Main Page

WinCvs Source Documentation

1.3 Beta 7 (Build 1)

Generated on Sun Feb 24 01:21:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


File Index

WinCvs Source File List

Here is a list of all files with brief descriptions:
common/AdminOptionDlg.cpp [code]
common/AdminOptionDlg.h [code]
common/AnnotateDlg.cpp [code]
common/AnnotateDlg.h [code]
common/AppConsole.cpp [code]
common/AppConsole.h [code]
common/AppGlue.cpp [code]
common/AppGlue.h [code]
common/AppGlue.mac.cpp [code]
common/AppGlue.mac.h [code]
common/AskYesNo.cpp [code]
common/AskYesNo.h [code]
common/Authen.cpp [code]
common/Authen.h [code]
common/BrowseViewColumn.cpp [code]
common/BrowseViewColumn.h [code]
common/BrowseViewHandlers.h [code]
common/BrowseViewModel.cpp [code]
common/BrowseViewModel.h [code]
common/CheckoutDlg.cpp [code]
common/CheckoutDlg.h [code]
common/CommitDlg.cpp [code]
common/CommitDlg.h [code]
common/CPStr.cpp [code]
common/CPStr.h [code]
common/CTCP2Parse.cpp [code]
common/CTCP2Parse.hpp [code]
common/CvsAlert.cpp [code]
common/CvsAlert.h [code]
common/CvsArgs.cpp [code]
common/CvsArgs.h [code]
common/CvsCommands.cpp [code]
common/CvsCommands.h [code]
common/CvsEntries.cpp [code]
common/CvsEntries.h [code]
common/cvsgui.c [code]
common/cvsgui.h [code]
common/cvsgui_process.cpp [code]
common/cvsgui_process.h [code]
common/cvsgui_protocol.h [code]
common/cvsgui_wire.cpp [code]
common/cvsgui_wire.h [code]
common/CvsIgnore.cpp [code]
common/CvsIgnore.h [code]
common/CvsPrefs.cpp [code]
common/CvsPrefs.h [code]
common/DiffDlg.cpp [code]
common/DiffDlg.h [code]
common/dll_garbage.c [code]
common/dll_garbage.h [code]
common/dll_glue.c [code]
common/dll_glue.h [code]
common/dll_loader.c [code]
common/dll_loader.h [code]
common/dll_process.h [code]
common/EditorMonDlg.cpp [code]
common/EditorMonDlg.h [code]
common/FileTraversal.cpp [code]
common/FileTraversal.h [code]
common/fnmatch.c [code]
common/fnmatch.h [code]
common/getline.c [code]
common/getline.h [code]
common/getopt.c [code]
common/getopt.h [code]
common/getopt1.c [code]
common/GetPassword.cpp [code]
common/GetPassword.h [code]
common/GetPrefs.cpp [code]
common/GetPrefs.h [code]
common/GetValue.cpp [code]
common/GetValue.h [code]
common/GraphOptDlg.cpp [code]
common/GraphOptDlg.h [code]
common/ImportDlg.cpp [code]
common/ImportDlg.h [code]
common/ImportFilter.cpp [code]
common/ImportFilter.h [code]
common/ImportFilterDlg.cpp [code]
common/ImportFilterDlg.h [code]
common/InitDlg.cpp [code]
common/InitDlg.h [code]
common/LineCmd.cpp [code]
common/LineCmd.h [code]
common/LogDlg.cpp [code]
common/LogDlg.h [code]
common/LogParse.cpp [code]
common/LogParse.h [code]
common/MacBinEncoding.cpp [code]
common/MacBinEncoding.h [code]
common/MacBinMaps.cpp [code]
common/MacBinMaps.h [code]
common/MacMisc.cpp [code]
common/MacMisc.h [code]
common/MacrosSetup.cpp [code]
common/MacrosSetup.h [code]
common/MakeSurePathExists.cpp [code]
common/MakeSurePathExists.h [code]
common/MoveToTrash.cpp [code]
common/MoveToTrash.h [code]
common/MultiFiles.cpp [code]
common/MultiFiles.h [code]
common/MultiString.cpp [code]
common/MultiString.h [code]
common/OptionalPropertySheet.cpp [code]
common/OptionalPropertySheet.h [code]
common/Persistent.cpp [code]
common/Persistent.h [code]
common/PromptFiles.cpp [code]
common/PromptFiles.h [code]
common/PythonContainer.cpp [code]
common/PythonContainer.h [code]
common/PythonGlue.cpp [code]
common/PythonGlue.h [code]
common/PythonGlue.impl.h [code]
common/PythonImpl.cpp [code]
common/PythonImpl.h [code]
common/PythonMacros.h [code]
common/ReleaseDlg.cpp [code]
common/ReleaseDlg.h [code]
common/RtagDlg.cpp [code]
common/RtagDlg.h [code]
common/SmartComboBox.cpp [code]
common/SmartComboBox.h [code]
common/SortList.h [code]
common/TagDlg.cpp [code]
common/TagDlg.h [code]
common/TclGlue.cpp [code]
common/TclGlue.h [code]
common/TclGlue.mac.cpp [code]
common/TclGlue.mac.h [code]
common/TextBinary.cpp [code]
common/TextBinary.h [code]
common/UCvsApp.cpp [code]
common/UCvsApp.h [code]
common/UCvsCommands.h [code]
common/UCvsConsole.cpp [code]
common/UCvsConsole.h [code]
common/UCvsDialogs.h [code]
common/UCvsFiles.cpp [code]
common/UCvsFiles.h [code]
common/UCvsFolders.cpp [code]
common/UCvsFolders.h [code]
common/UCvsFrame.cpp [code]
common/UCvsFrame.h [code]
common/UCvsGraph.cpp [code]
common/UCvsGraph.h [code]
common/UCvsMenubar.cpp [code]
common/UCvsMenubar.h [code]
common/UCvsToolbar.cpp [code]
common/UCvsToolbar.h [code]
common/UpdateDlg.cpp [code]
common/UpdateDlg.h [code]
common/VolsPaths.c [code]
common/VolsPaths.h [code]
rf/uconfig.h [code]
rf/uconsole.cpp [code]
rf/uconsole.h [code]
rf/udraw.cpp [code]
rf/udraw.h [code]
rf/uevent.cpp [code]
rf/umain.h [code]
rf/umenu.cpp [code]
rf/umenu.h [code]
rf/uobject.cpp [code]
rf/uobject.h [code]
rf/ustr.cpp [code]
rf/ustr.h [code]
rf/utoolbar.cpp [code]
rf/utoolbar.h [code]
rf/uwidget.cpp [code]
rf/uwidget.h [code]
rf/support/gtk/stdafx.h [code]
rf/support/macapp/stdafx.h [code]
rf/support/macapp/UPseudoSupport.cpp [code]
rf/support/macapp/UPseudoSupport.h [code]
rf/support/mfc/dib.c [code]
rf/support/mfc/dib.h [code]
rf/support/mfc/PseudoButton.cpp [code]
rf/support/mfc/PseudoButton.h [code]
rf/support/mfc/PseudoDlg.cpp [code]
rf/support/mfc/PseudoDlg.h [code]
rf/support/mfc/PseudoDraw.cpp [code]
rf/support/mfc/PseudoDraw.h [code]
rf/support/mfc/PseudoList.cpp [code]
rf/support/mfc/pseudolist.h [code]
rf/support/mfc/StdAfx.cpp [code]
rf/support/mfc/StdAfx.h [code]
rf/support/powerplant/stdafx.h [code]
rf/support/powerplant/UPseudoSupport.cpp [code]
rf/support/powerplant/UPseudoSupport.h [code]
WinCvs/BrowseFileView.cpp [code]
WinCvs/BrowseFileView.h [code]
WinCvs/BrowserBar.cpp [code]
WinCvs/BrowserBar.h [code]
WinCvs/ColorStatic.cpp [code]
WinCvs/ColorStatic.h [code]
WinCvs/ConsoleBar.cpp [code]
WinCvs/ConsoleBar.h [code]
WinCvs/CustomizeMenus.cpp [code]
WinCvs/CustomizeMenus.h [code]
WinCvs/CVS_Coworker.h [code]
WinCvs/CVS_Coworker_i.c [code]
WinCvs/CVS_Coworker_p.c [code]
WinCvs/CvsStatusBar.cpp [code]
WinCvs/CvsStatusBar.h [code]
WinCvs/dlldata.c [code]
WinCvs/ExploreBar.cpp [code]
WinCvs/ExploreBar.h [code]
WinCvs/FileViewWatcher.cpp [code]
WinCvs/FileViewWatcher.h [code]
WinCvs/findtcl.cpp [code]
WinCvs/GraphDoc.cpp [code]
WinCvs/GraphDoc.h [code]
WinCvs/GraphFrm.cpp [code]
WinCvs/GraphFrm.h [code]
WinCvs/GraphView.cpp [code]
WinCvs/GraphView.h [code]
WinCvs/HistComboBoxEx.cpp [code]
WinCvs/HistComboBoxEx.h [code]
WinCvs/LogFrm.cpp [code]
WinCvs/LogFrm.h [code]
WinCvs/MainFrm.cpp [code]
WinCvs/MainFrm.h [code]
WinCvs/ndir.c [code]
WinCvs/ndir.h [code]
WinCvs/NoPython.cpp [code]
WinCvs/NoPython.h [code]
WinCvs/ProgressDialog.cpp [code]
WinCvs/ProgressDialog.h [code]
WinCvs/resource.h [code]
WinCvs/SortHeaderCtrl.cpp [code]
WinCvs/SortHeaderCtrl.h [code]
WinCvs/Splash.cpp [code]
WinCvs/Splash.h [code]
WinCvs/Stat.cpp [code]
WinCvs/StdAfx.cpp [code]
WinCvs/StdAfx.h [code]
WinCvs/TbEdit.cpp [code]
WinCvs/TbEdit.h [code]
WinCvs/TipDlg.cpp [code]
WinCvs/TipDlg.h [code]
WinCvs/ToolbarCombo.cpp [code]
WinCvs/ToolbarCombo.h [code]
WinCvs/version_fu.h [code]
WinCvs/version_no.h [code]
WinCvs/Win32wstring.hpp [code]
WinCvs/wincvs.cpp [code]
WinCvs/wincvs.h [code]
WinCvs/wincvs.odl [code]
WinCvs/wincvs_winutil.cpp [code]
WinCvs/wincvs_winutil.h [code]
WinCvs/WinCvsBrowser.cpp [code]
WinCvs/WinCvsBrowser.h [code]
WinCvs/WinCvsDebug.cpp [code]
WinCvs/WinCvsDebug.h [code]
WinCvs/wincvsDoc.cpp [code]
WinCvs/wincvsDoc.h [code]
WinCvs/wincvsView.cpp [code]
WinCvs/wincvsView.h [code]
WinCvs/CJLib/CJLibrary/CJBrowseEdit.cpp [code]
WinCvs/CJLib/CJLibrary/CJCaption.cpp [code]
WinCvs/CJLib/CJLibrary/CJCaptionPopupWnd.cpp [code]
WinCvs/CJLib/CJLibrary/CJColorPicker.cpp [code]
WinCvs/CJLib/CJLibrary/CJColorPopup.cpp [code]
WinCvs/CJLib/CJLibrary/CJComboBoxEx.cpp [code]
WinCvs/CJLib/CJLibrary/CJControlBar.cpp [code]
WinCvs/CJLib/CJLibrary/CJDateTimeCtrl.cpp [code]
WinCvs/CJLib/CJLibrary/CJDockBar.cpp [code]
WinCvs/CJLib/CJLibrary/CJDockContext.cpp [code]
WinCvs/CJLib/CJLibrary/CJExplorerBar.cpp [code]
WinCvs/CJLib/CJLibrary/CJFlatButton.cpp [code]
WinCvs/CJLib/CJLibrary/CJFlatComboBox.cpp [code]
WinCvs/CJLib/CJLibrary/CJFlatHeaderCtrl.cpp [code]
WinCvs/CJLib/CJLibrary/CJFlatSplitterWnd.cpp [code]
WinCvs/CJLib/CJLibrary/CJFlatTabCtrl.cpp [code]
WinCvs/CJLib/CJLibrary/CJFontCombo.cpp [code]
WinCvs/CJLib/CJLibrary/CJFrameWnd.cpp [code]
WinCvs/CJLib/CJLibrary/CJHexEdit.cpp [code]
WinCvs/CJLib/CJLibrary/CJHtmlView.cpp [code]
WinCvs/CJLib/CJLibrary/CJHyperLink.cpp [code]
WinCvs/CJLib/CJLibrary/CJLibrary.cpp [code]
WinCvs/CJLib/CJLibrary/CJListBox.cpp [code]
WinCvs/CJLib/CJLibrary/CJListCtrl.cpp [code]
WinCvs/CJLib/CJLibrary/CJListView.cpp [code]
WinCvs/CJLib/CJLibrary/CJLogoPane.cpp [code]
WinCvs/CJLib/CJLibrary/CJMaskEdit.cpp [code]
WinCvs/CJLib/CJLibrary/CJMDIChildWnd.cpp [code]
WinCvs/CJLib/CJLibrary/CJMDIFrameWnd.cpp [code]
WinCvs/CJLib/CJLibrary/CJMemFile.cpp [code]
WinCvs/CJLib/CJLibrary/CJMenu.cpp [code]
WinCvs/CJLib/CJLibrary/CJMenuBar.cpp [code]
WinCvs/CJLib/CJLibrary/CJMetaFileButton.cpp [code]
WinCvs/CJLib/CJLibrary/CJMiniDockFrameWnd.cpp [code]
WinCvs/CJLib/CJLibrary/CJOutlookBar.cpp [code]
WinCvs/CJLib/CJLibrary/CJPagerCtrl.cpp [code]
WinCvs/CJLib/CJLibrary/CJReBar.cpp [code]
WinCvs/CJLib/CJLibrary/CJReBarCtrl.cpp [code]
WinCvs/CJLib/CJLibrary/CJShell.cpp [code]
WinCvs/CJLib/CJLibrary/CJShellList.cpp [code]
WinCvs/CJLib/CJLibrary/CJShellTree.cpp [code]
WinCvs/CJLib/CJLibrary/CJSizeDockBar.cpp [code]
WinCvs/CJLib/CJLibrary/CJSortClass.cpp [code]
WinCvs/CJLib/CJLibrary/CJStatusBar.cpp [code]
WinCvs/CJLib/CJLibrary/CJTabCtrl.cpp [code]
WinCvs/CJLib/CJLibrary/CJTabCtrlBar.cpp [code]
WinCvs/CJLib/CJLibrary/CJTabView.cpp [code]
WinCvs/CJLib/CJLibrary/CJToolBar.cpp [code]
WinCvs/CJLib/CJLibrary/CJToolBarBase.cpp [code]
WinCvs/CJLib/CJLibrary/CJToolBarCtrl.cpp [code]
WinCvs/CJLib/CJLibrary/CJTreeCtrl.cpp [code]
WinCvs/CJLib/CJLibrary/CJWindowPlacement.cpp [code]
WinCvs/CJLib/CJLibrary/GfxGroupEdit.cpp [code]
WinCvs/CJLib/CJLibrary/GfxOutBarCtrl.cpp [code]
WinCvs/CJLib/CJLibrary/GfxSplitterWnd.cpp [code]
WinCvs/CJLib/CJLibrary/Resource.h [code]
WinCvs/CJLib/CJLibrary/StdAfx.cpp [code]
WinCvs/CJLib/CJLibrary/StdAfx.h [code]
WinCvs/CJLib/CJLibrary/Subclass.cpp [code]
WinCvs/CJLib/Include/CJBrowseEdit.h [code]
WinCvs/CJLib/Include/CJCaption.h [code]
WinCvs/CJLib/Include/CJCaptionPopupWnd.h [code]
WinCvs/CJLib/Include/CJColorPicker.h [code]
WinCvs/CJLib/Include/CJColorPopup.h [code]
WinCvs/CJLib/Include/CJComboBoxEx.h [code]
WinCvs/CJLib/Include/CJControlBar.h [code]
WinCvs/CJLib/Include/CJDateTimeCtrl.h [code]
WinCvs/CJLib/Include/CJDockBar.h [code]
WinCvs/CJLib/Include/CJDockContext.h [code]
WinCvs/CJLib/Include/CJExplorerBar.h [code]
WinCvs/CJLib/Include/CJFlatButton.h [code]
WinCvs/CJLib/Include/CJFlatComboBox.h [code]
WinCvs/CJLib/Include/CJFlatHeaderCtrl.h [code]
WinCvs/CJLib/Include/CJFlatSplitterWnd.h [code]
WinCvs/CJLib/Include/CJFlatTabCtrl.h [code]
WinCvs/CJLib/Include/CJFontCombo.h [code]
WinCvs/CJLib/Include/CJFrameWnd.h [code]
WinCvs/CJLib/Include/CJHexEdit.h [code]
WinCvs/CJLib/Include/CJHtmlView.h [code]
WinCvs/CJLib/Include/CJHyperLink.h [code]
WinCvs/CJLib/Include/CJLibrary.h [code]
WinCvs/CJLib/Include/CJListBox.h [code]
WinCvs/CJLib/Include/CJListCtrl.h [code]
WinCvs/CJLib/Include/CJListView.h [code]
WinCvs/CJLib/Include/CJLogoPane.h [code]
WinCvs/CJLib/Include/CJMaskEdit.h [code]
WinCvs/CJLib/Include/CJMDIChildWnd.h [code]
WinCvs/CJLib/Include/CJMDIFrameWnd.h [code]
WinCvs/CJLib/Include/CJMemFile.h [code]
WinCvs/CJLib/Include/CJMenu.h [code]
WinCvs/CJLib/Include/CJMenuBar.h [code]
WinCvs/CJLib/Include/CJMetaFileButton.h [code]
WinCvs/CJLib/Include/CJMiniDockFrameWnd.h [code]
WinCvs/CJLib/Include/CJOutlookBar.h [code]
WinCvs/CJLib/Include/CJPagerCtrl.h [code]
WinCvs/CJLib/Include/CJReBar.h [code]
WinCvs/CJLib/Include/CJReBarCtrl.h [code]
WinCvs/CJLib/Include/CJResource.h [code]
WinCvs/CJLib/Include/CJShell.h [code]
WinCvs/CJLib/Include/CJShellList.h [code]
WinCvs/CJLib/Include/CJShellTree.h [code]
WinCvs/CJLib/Include/CJSizeDockBar.h [code]
WinCvs/CJLib/Include/CJSortClass.h [code]
WinCvs/CJLib/Include/CJStatusBar.h [code]
WinCvs/CJLib/Include/CJTabCtrl.h [code]
WinCvs/CJLib/Include/CJTabCtrlBar.h [code]
WinCvs/CJLib/Include/CJTabView.h [code]
WinCvs/CJLib/Include/CJToolBar.h [code]
WinCvs/CJLib/Include/CJToolBarBase.h [code]
WinCvs/CJLib/Include/CJToolBarCtrl.h [code]
WinCvs/CJLib/Include/CJTreeCtrl.h [code]
WinCvs/CJLib/Include/CJWindowPlacement.h [code]
WinCvs/CJLib/Include/GfxGroupEdit.h [code]
WinCvs/CJLib/Include/GfxOutBarCtrl.h [code]
WinCvs/CJLib/Include/GfxSplitterWnd.h [code]
WinCvs/CJLib/Include/Subclass.h [code]
WinCvs/CoWorker/cvs_coworker.h [code]
WinCvs/CoWorker/CVS_Coworker.idl [code]
WinCvs/CoWorker/CVS_Coworker_i.c [code]
WinCvs/CoWorker/CVS_Coworker_i.h [code]
WinCvs/CoWorker/CVS_Coworker_p.c [code]
WinCvs/CoWorker/CvsCoworker.cpp [code]
WinCvs/CoWorker/CvsCoworker.h [code]
WinCvs/CoWorker/CvsCoworkerErrors.h [code]
WinCvs/CoWorker/CvsFilenames.cpp [code]
WinCvs/CoWorker/CvsFilenames.h [code]
WinCvs/CoWorker/CvsProject.cpp [code]
WinCvs/CoWorker/CvsProject.h [code]
WinCvs/CoWorker/CvsString.cpp [code]
WinCvs/CoWorker/CvsString.h [code]
WinCvs/CoWorker/CvsTrace.cpp [code]
WinCvs/CoWorker/CvsTrace.h [code]
WinCvs/CoWorker/dlldata.c [code]
WinCvs/res/resrc1.h [code]
Generated on Sun Feb 24 01:21:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AdminOptionDlg.cpp File Reference

common/AdminOptionDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "AdminOptionDlg.h"

Include dependency graph for AdminOptionDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool CompatGetAdminOptions (kAdminOptionDlgType type, CPStr &optionString)

Function Documentation

bool CompatGetAdminOptions | ( | kAdminOptionDlgType | type,
 |  | CPStr & | optionString
 | ) |

Definition at line 153 of file AdminOptionDlg.cpp.

References CPStr, kAdminOptionDlgType, and CAdminOptionDlg::m_optionString.

00154 {
00155     bool userHitOK = false;
00156
00157 #ifdef WIN32
00158     CAdminOptionDlg adminOptionDlg(type);
00159     adminOptionDlg.m_optionString = (const char*)optionString;
00160     if( adminOptionDlg.DoModal() == IDOK )
00161     {
00162         optionString = (const char*)adminOptionDlg.m_optionString;
00163         userHitOK = true;
00164     }
00165 #endif /* WIN32 */
00166 #ifdef qMacCvsPP
00167 #endif /* qMacCvsPP */
00168 #if qUnix
00169 #endif // qUnix
00170
00171     return userHitOK;
00172 }

Generated on Sun Feb 24 01:21:38 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AdminOptionDlg.h File Reference

common/AdminOptionDlg.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CAdminOptionDlg

Defines

#define | AFX_ADMINOPTIONDLG_H__C9A89564_F0A4_4294_8C6C_18469D18BCB3__INCLUDED_

Enumerations

enum kAdminOptionDlgType {
kChangeLog,
kSetState,
kSetDescription
}

Functions

bool | CompatGetAdminOptions (kAdminOptionDlgType type, CPStr &optionString)

Define Documentation

#define AFX_ADMINOPTIONDLG_H__C9A89564_F0A4_4294_8C6C_18469D18BCB3__INCLUDED_

Definition at line 26 of file AdminOptionDlg.h.

Enumeration Type Documentation

enum kAdminOptionDlgType

Enumeration values:
kChangeLog
kSetState
kSetDescription

Definition at line 34 of file AdminOptionDlg.h.

Referenced by CAdminOptionDlg::CAdminOptionDlg, and CompatGetAdminOptions.

00035 {
00036     kChangeLog,
00037     kSetState,
00038     kSetDescription
00039 } kAdminOptionDlgType;

Function Documentation

bool CompatGetAdminOptions | ( | kAdminOptionDlgType | type,
 |  | CPStr & | optionString
 | ) |

Definition at line 153 of file AdminOptionDlg.cpp.

Referenced by CGraphView::OnGraphChangelogmessage, CGraphView::OnGraphSetdescription, and CGraphView::OnGraphSetstate.

00154 {
00155     bool userHitOK = false;
00156
00157 #ifdef WIN32
00158     CAdminOptionDlg adminOptionDlg(type);
00159     adminOptionDlg.m_optionString = (const char*)optionString;
00160     if( adminOptionDlg.DoModal() == IDOK )
00161     {
00162         optionString = (const char*)adminOptionDlg.m_optionString;
00163         userHitOK = true;
00164     }
00165 #endif /* WIN32 */
00166 #ifdef qMacCvsPP
00167 #endif /* qMacCvsPP */
00168 #if qUnix
00169 #endif // qUnix
00170
00171     return userHitOK;
00172 }

Generated on Sun Feb 24 01:21:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AnnotateDlg.cpp File Reference

common/AnnotateDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "OptionalPropertySheet.h"
#include "AnnotateDlg.h"
#include "CvsPrefs.h"
#include "GetPrefs.h"

Include dependency graph for AnnotateDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool CompatGetAnnotate (bool &noRecurs, bool &isDate, UPStr &rev, bool &force)

Function Documentation

bool CompatGetAnnotate | ( | bool & | noRecurs,
 |  | bool & | isDate,
 |  | UPStr & | rev,
 |  | bool & | force
 | ) |

Definition at line 154 of file AnnotateDlg.cpp.

References CPStr, COptionalPropertySheet::DoModal, COptionalPropertySheet::GetHideCommandDlg, CAnnotate_MAIN::m_force, CAnnotate_MAIN::m_hasRev, CAnnotate_MAIN::m_isDate, CAnnotate_MAIN::m_noRecurse, CAnnotate_MAIN::m_strRev, CGetPrefs_GLOBALS::StoreValues, and TRUE.

00155 {
00156     bool userHitOK = false;
00157
00158     static CPStr sLastRev;
00159     static bool bIsDate = false;
00160
00161     rev = "";
00162     noRecurs = false;
00163     force = false;
00164     bool hasRev = false;
00165     isDate = bIsDate;
00166
00167 #ifdef WIN32
00168     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgAnnotate(), "Annotate settings");
00169     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00170     CAnnotate_MAIN page1(sLastRev, isDate);
00171     CGetPrefs_GLOBALS page2;
00172     pages.AddPage(&page1);
00173     pages.AddPage(&page2);
00174     if(pages.DoModal() == IDOK)
00175     {
00176         noRecurs = page1.m_noRecurse == TRUE;
00177
00178         sLastRev = page1.m_strRev;
00179         isDate = page1.m_isDate == TRUE;
00180         hasRev = page1.m_hasRev == TRUE;
00181         force = page1.m_force == TRUE;
00182
00183         page2.StoreValues();
00184         gCvsPrefs.SetHideCommandDlgAnnotate(pages.GetHideCommandDlg());
00185         userHitOK = true;
00186     }
00187 #endif /* WIN32 */
00188
00189 #ifdef qMacCvsPP
00190 #endif /* qMacCvsPP */
00191
00192 #if qUnix
00193 #endif // qUnix
00194
00195     if(userHitOK)
00196     {
00197         if(hasRev)
00198             rev = sLastRev;
00199         bIsDate = isDate;
00200
00201         gCvsPrefs.save();
00202     }
00203
00204     return userHitOK;
00205 }

Generated on Sun Feb 24 01:21:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AnnotateDlg.h File Reference

common/AnnotateDlg.h File Reference

#include "CPStr.h"
#include "MultiString.h"
#include "SmartComboBox.h"

Include dependency graph for AnnotateDlg.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CAnnotate_MAIN

Defines

#define | AFX_ANNOTATEDLG_H__864729EE_838B_473D_8723_E1269829F781__INCLUDED_

Functions

bool | CompatGetAnnotate (bool &noRecurs, bool &isDate, UPStr &rev, bool &force)

Variables

CMString gRevNames
CMString gDateNames

Define Documentation

#define AFX_ANNOTATEDLG_H__864729EE_838B_473D_8723_E1269829F781__INCLUDED_

Definition at line 26 of file AnnotateDlg.h.

Function Documentation

bool CompatGetAnnotate | ( | bool & | noRecurs,
 |  | bool & | isDate,
 |  | UPStr & | rev,
 |  | bool & | force
 | ) |

Definition at line 154 of file AnnotateDlg.cpp.

Referenced by CvsCmdAnnotateFiles.

00155 {
00156     bool userHitOK = false;
00157
00158     static CPStr sLastRev;
00159     static bool bIsDate = false;
00160
00161     rev = "";
00162     noRecurs = false;
00163     force = false;
00164     bool hasRev = false;
00165     isDate = bIsDate;
00166
00167 #ifdef WIN32
00168     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgAnnotate(), "Annotate settings");
00169     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00170     CAnnotate_MAIN page1(sLastRev, isDate);
00171     CGetPrefs_GLOBALS page2;
00172     pages.AddPage(&page1);
00173     pages.AddPage(&page2);
00174     if(pages.DoModal() == IDOK)
00175     {
00176         noRecurs = page1.m_noRecurse == TRUE;
00177
00178         sLastRev = page1.m_strRev;
00179         isDate = page1.m_isDate == TRUE;
00180         hasRev = page1.m_hasRev == TRUE;
00181         force = page1.m_force == TRUE;
00182
00183         page2.StoreValues();
00184         gCvsPrefs.SetHideCommandDlgAnnotate(pages.GetHideCommandDlg());
00185         userHitOK = true;
00186     }
00187 #endif /* WIN32 */
00188
00189 #ifdef qMacCvsPP
00190 #endif /* qMacCvsPP */
00191
00192 #if qUnix
00193 #endif // qUnix
00194
00195     if(userHitOK)
00196     {
00197         if(hasRev)
00198             rev = sLastRev;
00199         bIsDate = isDate;
00200
00201         gCvsPrefs.save();
00202     }
00203
00204     return userHitOK;
00205 }

Variable Documentation

CMString gDateNames

Definition at line 40 of file AnnotateDlg.h.

CMString gRevNames

Definition at line 39 of file AnnotateDlg.h.

Generated on Sun Feb 24 01:21:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AppConsole.cpp File Reference

common/AppConsole.cpp File Reference

#include "stdafx.h"
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include "AppConsole.h"
#include "wincvs.h"
#include "wincvsView.h"

Include dependency graph for AppConsole.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void | cvs_out (const char *format,...)
void | cvs_err (const char *format,...)
void | cvs_outstr (const char *str, size_t len)
void | cvs_errstr (const char *str, size_t len)

Function Documentation

void cvs_err | ( | const char * | format,
 |  | ... |
 | ) |

Definition at line 90 of file AppConsole.cpp.

References NULL, UCvsConsole::OutConsole, CWincvsView::OutConsole, and UAppConsole.

00091 {
00092     va_list args;
00093     char mess[1024] = {'\0'};
00094
00095     va_start (args, format);
00096     vsprintf (mess, format, args);
00097     va_end (args);
00098
00099 #ifdef WIN32
00100     CWinApp* app = AfxGetApp();
00101     //ASSERT(app->IsKindOf(RUNTIME_CLASS(CWincvsApp)));
00102     CWincvsView *view = ((CWincvsApp *)app)->GetConsoleView();
00103     if(view == NULL)
00104         return;
00105
00106     view->OutConsole(mess, strlen(mess), true);
00107 #endif /* WIN32 */
00108 #ifdef qMacCvsPP
00109     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00110     if(log == 0L)
00111         return;
00112     log->WriteCharsToConsole(mess, strlen(mess), true);
00113 #endif /* qMacCvsPP */
00114 #ifdef qUnix
00115     UCvsConsole* console = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00116     if(console == 0L)
00117     {
00118         UAppConsole(mess);
00119         return;
00120     }
00121
00122     console->OutConsole(mess, strlen(mess), true);
00123 #endif /* qUnix */
00124 }

void cvs_errstr | ( | const char * | str,
 |  | size_t | len
 | ) |

Definition at line 155 of file AppConsole.cpp.

References NULL, UCvsConsole::OutConsole, CWincvsView::OutConsole, and UAppConsole.

00156 {
00157 #ifdef WIN32
00158     CWinApp* app = AfxGetApp();
00159     //ASSERT(app->IsKindOf(RUNTIME_CLASS(CWincvsApp)));
00160     CWincvsView *view = ((CWincvsApp *)app)->GetConsoleView();
00161     if(view == NULL)
00162         return;
00163
00164     view->OutConsole(str, len, true);
00165 #endif /* WIN32 */
00166 #ifdef qMacCvsPP
00167     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00168     if(log == 0L)
00169         return;
00170     log->WriteCharsToConsole(str, len, true);
00171 #endif /* qMacCvsPP */
00172 #ifdef qUnix
00173     UCvsConsole* console = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00174     if(console == 0L)
00175     {
00176         UAppConsole(str);
00177         return;
00178     }
00179
00180     console->OutConsole(str, len, true);
00181 #endif /* qUnix */
00182 }

void cvs_out | ( | const char * | format,
 |  | ... |
 | ) |

Definition at line 54 of file AppConsole.cpp.

References NULL, UCvsConsole::OutConsole, CWincvsView::OutConsole, and UAppConsole.

00055 {
00056     va_list args;
00057     char mess[1024] = {'\0'};
00058
00059     va_start (args, format);
00060     vsprintf (mess, format, args);
00061     va_end (args);
00062
00063 #ifdef WIN32
00064     CWinApp* app = AfxGetApp();
00065     //ASSERT(app->IsKindOf(RUNTIME_CLASS(CWincvsApp)));
00066     CWincvsView *view = ((CWincvsApp *)app)->GetConsoleView();
00067     if(view == NULL)
00068         return;
00069
00070     view->OutConsole(mess, strlen(mess));
00071 #endif /* WIN32 */
00072 #ifdef qMacCvsPP
00073     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00074     if(log == 0L)
00075         return;
00076     log->WriteCharsToConsole(mess, strlen(mess));
00077 #endif /* qMacCvsPP */
00078 #ifdef qUnix
00079     UCvsConsole* console = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00080     if(console == 0L)
00081     {
00082         UAppConsole(mess);
00083         return;
00084     }
00085
00086     console->OutConsole(mess, strlen(mess));
00087 #endif /* qUnix */
00088 }

void cvs_outstr | ( | const char * | str,
 |  | size_t | len
 | ) |

Definition at line 126 of file AppConsole.cpp.

References NULL, UCvsConsole::OutConsole, CWincvsView::OutConsole, and UAppConsole.

00127 {
00128 #ifdef WIN32
00129     CWinApp* app = AfxGetApp();
00130     //ASSERT(app->IsKindOf(RUNTIME_CLASS(CWincvsApp)));
00131     CWincvsView *view = ((CWincvsApp *)app)->GetConsoleView();
00132     if(view == NULL)
00133         return;
00134
00135     view->OutConsole(str, len);
00136 #endif /* WIN32 */
00137 #ifdef qMacCvsPP
00138     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00139     if(log == 0L)
00140         return;
00141     log->WriteCharsToConsole(str, len);
00142 #endif /* qMacCvsPP */
00143 #ifdef qUnix
00144     UCvsConsole* console = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00145     if(console == 0L)
00146     {
00147         UAppConsole(str);
00148         return;
00149     }
00150
00151     console->OutConsole(str, len);
00152 #endif /* qUnix */
00153 }

Generated on Sun Feb 24 01:21:40 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AppConsole.h File Reference

common/AppConsole.h File Reference

#include <stdio.h>

Include dependency graph for AppConsole.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CColorConsole

Enumerations

enum kConsoleColor {
kNormal,
kBrown,
kGreen,
kMagenta,
kRed,
kBlue,
kBold,
kItalic,
kUnderline,
kNL
}

Functions

void | cvs_out (const char *format,...)
void | cvs_err (const char *format,...)
void | cvs_outstr (const char *str, size_t len)
void | cvs_errstr (const char *str, size_t len)

Enumeration Type Documentation

enum kConsoleColor

Enumeration values:
kNormal
kBrown
kGreen
kMagenta
kRed
kBlue
kBold
kItalic
kUnderline
kNL

Definition at line 35 of file AppConsole.h.

Referenced by cvs_out, CColorConsole::operator<<, CWincvsView::OutColor, UCvsConsole::OutColor, and PyColorConsole::Print.

00036 {
00037     kNormal,
00038     kBrown,
00039     kGreen,
00040     kMagenta,
00041     kRed,
00042     kBlue,
00043     kBold,
00044     kItalic,
00045     kUnderline,
00046     kNL // newline
00047 } kConsoleColor;

Function Documentation

void cvs_err | ( | const char * | format,
 |  | ... |
 | ) |

Definition at line 90 of file AppConsole.cpp.

Referenced by _loadPersistentSettings, RemoveCvsArgs::addfile, ControlCvsArgs::addfile, AskCreatePersistentSettings, BrowserGetMultiFiles, BuildIgnoredList, CompatEndMoveToTrash, CompatMoveToTrash, CPython_Interp::CPython_Interp, CTcl_Interp::CTcl_Interp, CvsCmdAddFolder, CvsCmdLogin, CvsCmdLogout, CvsCmdReleaseFolder, CvsLogParse, CBrowseFileView::EditSel, UCvsFiles::EditSel, Entries_Open, Entries_SetVisited, fgetentent, FileTimeToUnixTime, FileTraverse, FillBuffer, AuthenModel::GetInstance, glue_getenv, InitializeInterp, CWincvsApp::InitInstance, CLogoutThread::InitInstance, launchCVS, LaunchDiff, LaunchViewer, list_add_type, list_add_warning, CPersistent::LoadAll, loadSettingsInternal, MakeTmpFile, mystrdup, UCvsFolders::OnCmdExplore, UCvsFiles::OnCmdExplore, UCvsFiles::OnCmdTrash, CFindSettings::OnError, MacroTraversal::OnError, MacroTraversal::OnFile, KoMoveToTrashHandler::OnFiles, CBrowseFileView::OnInitialUpdate, CWinCvsBrowser::OnViewExplore, CBrowseFileView::OnViewExplore, ReadIgnoredFile, CPersistent::SaveAll, CWincvsApp::SaveAllModified, CPersistent::SaveAllSettings, UCvsApp::SayWelcome, UCvsFolders::SetDefaultRoot, CGraphDoc::SetNode, SettingsGetLoc, Tag_Open, tclSafeRemove, testCVS, Authen::tokenToKind, UCvsApp::UCvsApp, UCvsGraph::UCvsGraph, and unmodified.

00091 {
00092     va_list args;
00093     char mess[1024] = {'\0'};
00094
00095     va_start (args, format);
00096     vsprintf (mess, format, args);
00097     va_end (args);
00098
00099 #ifdef WIN32
00100     CWinApp* app = AfxGetApp();
00101     //ASSERT(app->IsKindOf(RUNTIME_CLASS(CWincvsApp)));
00102     CWincvsView *view = ((CWincvsApp *)app)->GetConsoleView();
00103     if(view == NULL)
00104         return;
00105
00106     view->OutConsole(mess, strlen(mess), true);
00107 #endif /* WIN32 */
00108 #ifdef qMacCvsPP
00109     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00110     if(log == 0L)
00111         return;
00112     log->WriteCharsToConsole(mess, strlen(mess), true);
00113 #endif /* qMacCvsPP */
00114 #ifdef qUnix
00115     UCvsConsole* console = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00116     if(console == 0L)
00117     {
00118         UAppConsole(mess);
00119         return;
00120     }
00121
00122     console->OutConsole(mess, strlen(mess), true);
00123 #endif /* qUnix */
00124 }

void cvs_errstr | ( | const char * | str,
 |  | size_t | len
 | ) |

Definition at line 155 of file AppConsole.cpp.

Referenced by CRevisionConsole::cvs_err, CStreamConsole::cvs_err, cvsgui_write, CTcl_Interp::DoFile, CTcl_Interp::DoScript, glue_consoleerr, and tclCvsErrProc.

00156 {
00157 #ifdef WIN32
00158     CWinApp* app = AfxGetApp();
00159     //ASSERT(app->IsKindOf(RUNTIME_CLASS(CWincvsApp)));
00160     CWincvsView *view = ((CWincvsApp *)app)->GetConsoleView();
00161     if(view == NULL)
00162         return;
00163
00164     view->OutConsole(str, len, true);
00165 #endif /* WIN32 */
00166 #ifdef qMacCvsPP
00167     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00168     if(log == 0L)
00169         return;
00170     log->WriteCharsToConsole(str, len, true);
00171 #endif /* qMacCvsPP */
00172 #ifdef qUnix
00173     UCvsConsole* console = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00174     if(console == 0L)
00175     {
00176         UAppConsole(str);
00177         return;
00178     }
00179
00180     console->OutConsole(str, len, true);
00181 #endif /* qUnix */
00182 }

void cvs_out | ( | const char * | format,
 |  | ... |
 | ) |

Definition at line 54 of file AppConsole.cpp.

References CColorConsole::CColorConsole, kConsoleColor, CColorConsole::operator<<, and CColorConsole::~CColorConsole.

Referenced by RemoveCvsArgs::addfile, ControlCvsArgs::addfile, CompatEndMoveToTrash, CompatGetPrefs, ImportReport::EnterDirectory, glue_exit, CWincvsApp::InitInstance, CWincvsApp::OnAppCopyrights, CWincvsApp::OnAppCredits, UCvsFrame::OnCmdStopcvs, UCvsFiles::OnCmdTrash, UCvsFrame::OnCopyrights, UCvsFrame::OnCredits, CMainFrame::OnDropFiles, KoMoveToTrashHandler::OnFiles, CWincvsDoc::OnStopcvs, CWincvsDoc::OnUsePyshell, CWincvsDoc::OnUseTclshell, CvsArgs::print, and UCvsApp::SayWelcome.

00055 {
00056     va_list args;
00057     char mess[1024] = {'\0'};
00058
00059     va_start (args, format);
00060     vsprintf (mess, format, args);
00061     va_end (args);
00062
00063 #ifdef WIN32
00064     CWinApp* app = AfxGetApp();
00065     //ASSERT(app->IsKindOf(RUNTIME_CLASS(CWincvsApp)));
00066     CWincvsView *view = ((CWincvsApp *)app)->GetConsoleView();
00067     if(view == NULL)
00068         return;
00069
00070     view->OutConsole(mess, strlen(mess));
00071 #endif /* WIN32 */
00072 #ifdef qMacCvsPP
00073     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00074     if(log == 0L)
00075         return;
00076     log->WriteCharsToConsole(mess, strlen(mess));
00077 #endif /* qMacCvsPP */
00078 #ifdef qUnix
00079     UCvsConsole* console = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00080     if(console == 0L)
00081     {
00082         UAppConsole(mess);
00083         return;
00084     }
00085
00086     console->OutConsole(mess, strlen(mess));
00087 #endif /* qUnix */
00088 }

void cvs_outstr | ( | const char * | str,
 |  | size_t | len
 | ) |

Definition at line 126 of file AppConsole.cpp.

Referenced by cvsgui_write, CvsLogParse, CTcl_Interp::DoFile, CTcl_Interp::DoScript, glue_consoleout, LogWrite, CvsArgs::print, and tclCvsOutProc.

00127 {
00128 #ifdef WIN32
00129     CWinApp* app = AfxGetApp();
00130     //ASSERT(app->IsKindOf(RUNTIME_CLASS(CWincvsApp)));
00131     CWincvsView *view = ((CWincvsApp *)app)->GetConsoleView();
00132     if(view == NULL)
00133         return;
00134
00135     view->OutConsole(str, len);
00136 #endif /* WIN32 */
00137 #ifdef qMacCvsPP
00138     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00139     if(log == 0L)
00140         return;
00141     log->WriteCharsToConsole(str, len);
00142 #endif /* qMacCvsPP */
00143 #ifdef qUnix
00144     UCvsConsole* console = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00145     if(console == 0L)
00146     {
00147         UAppConsole(str);
00148         return;
00149     }
00150
00151     console->OutConsole(str, len);
00152 #endif /* qUnix */
00153 }

Generated on Sun Feb 24 01:21:40 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AppGlue.cpp File Reference

common/AppGlue.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "wincvsView.h"
#include "PromptFiles.h"
#include "BrowseFileView.h"
#include <process.h>
#include <direct.h>
#include "cvsgui_process.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <vector>
#include "Authen.h"
#include "CvsPrefs.h"
#include "AppGlue.h"
#include "AppConsole.h"
#include "GetPassword.h"
#include "AskYesNo.h"
#include "CvsArgs.h"
#include "FileTraversal.h"

Include dependency graph for AppGlue.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | CAuthenSetUp
class | CStreamConsole
class | CTmpFiles

Defines

#define | CVS_EXTERN_C

Functions

void | glue_exit (int code)
long | glue_consoleout (char *txt, long len)
long | glue_consoleerr (char *txt, long len)
long | glue_consolein (char *txt, long len)
const char * | glue_getenv (char *name)
int | testCVS (const char *cvsfile, int argc, char *const *argv)
int | launchCVS (const char *path, int argc, char *const *argv, CCvsConsole *console)
FILE * | launchCVS (const char *dir, const CvsArgs &args, UStr &tmpFile, const char *prefix, const char *extension)
const char * | launchCVS (const char *dir, const CvsArgs &args, const char *prefix, const char *extension)
void | WaitForCvs (void)

Variables

CCvsConsole * | gConsole = 0L
int | sLastExitCode
CvsProcessCallbacks sCallTable
CTmpFiles sTmpList

Define Documentation

#define CVS_EXTERN_C

Definition at line 104 of file AppGlue.cpp.

Referenced by glue_consoleerr, glue_consolein, glue_consoleout, glue_exit, and glue_getenv.

Function Documentation

long glue_consoleerr | ( | char * | txt,
 |  | long | len
 | ) |

Definition at line 140 of file AppGlue.cpp.

References CCvsConsole::cvs_err, cvs_errstr, and CVS_EXTERN_C.

00141 {
00142     if(gConsole != 0L)
00143         return gConsole->cvs_err(txt, len);
00144
00145 #ifdef macintosh
00146     // apple event output
00147     long newlen;
00148     if((newlen = ae_consoleout(txt, len)) != -1)
00149         return newlen;
00150 #endif
00151
00152     cvs_errstr(txt, len);
00153
00154     return len;
00155 }

long glue_consolein | ( | char * | txt,
 |  | long | len
 | ) |

Definition at line 157 of file AppGlue.cpp.

References CVS_EXTERN_C.

00158 {
00159 #ifdef macintosh
00160     // apple event input
00161     long newlen;
00162     if((newlen = ae_consolein(txt, len)) != -1)
00163         return newlen;
00164 #endif /* !macintosh */
00165
00166     return 0;
00167 }

long glue_consoleout | ( | char * | txt,
 |  | long | len
 | ) |

Definition at line 123 of file AppGlue.cpp.

References CVS_EXTERN_C, CCvsConsole::cvs_out, and cvs_outstr.

00124 {
00125     if(gConsole != 0L)
00126         return gConsole->cvs_out(txt, len);
00127
00128 #ifdef macintosh
00129     // apple event output
00130     long newlen;
00131     if((newlen = ae_consoleout(txt, len)) != -1)
00132         return newlen;
00133 #endif
00134
00135     cvs_outstr(txt, len);
00136
00137     return len;
00138 }

void glue_exit ( int code )

Definition at line 116 of file AppGlue.cpp.

References CVS_EXTERN_C, cvs_out, and sLastExitCode.

00117 {
00118     if(!gCvsPrefs.IsTclFileRunning())
00119         cvs_out("\n*****CVS exited normally with code %d*****\n\n", code);
00120     sLastExitCode = code;
00121 }

const char* glue_getenv ( char * name )

Definition at line 188 of file AppGlue.cpp.

References AskYesNo, BrowserGetDirectory, CompatGetPassword, CStr, cvs_err, CVS_EXTERN_C, AuthenModel::GetAllInstances, getenv, CWincvsApp::GetEnvMainThread, MacBinMaps::GetEnvPlainTypes, MacBinMaps::GetEnvTypes, AuthenModel::GetInstance, ISO8559_none, MAC_APPSINGLE, MAC_HQX, MacGetPrefsFolder, NULL, AuthenModel::OnGetEnv, Authen::skiptoken, and UFSSpec.

00189 {
00190     if(name == NULL)
00191         return NULL;
00192
00193 #ifdef WIN32
00194     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00195     if(::GetCurrentThreadId() != app->m_nThreadID &&
00196         (strcmp(name, "CVS_GETPASS") == 0 || strcmp(name, "CVSLIB_YESNO") == 0 ||
00197         strcmp(name, "HOME") == 0))
00198     {
00199         // synchonize it since the thread calls and
00200         // we call some MFC objects in it (prompt
00201         // password, get path...)
00202         CCvsThreadLock threadLock;
00203
00204         return app->GetEnvMainThread(name);
00205     }
00206 #endif /* WIN32 */
00207
00208 #ifdef macintosh
00209     char *result;
00210     if((result = ae_getenv(name)) != (char *)-1)
00211     {
00212         if(result == 0L && isGlobalEnvVariable(name))
00213         {
00214             // in this case only we let continue
00215             // to get the MacCVS settings. So the CWCVS
00216             // users (or any AppleEvent user) can set
00217             // these variables in MacCVS but still can overide
00218             // them using Apple Events.
00219         }
00220         else
00221             return result;
00222     }
00223 #endif /* macintosh */
00224
00225     // new : give a chance for the new AuthenModel to react to the getenv
00226     // callback
00227     AuthenModel *curModel = AuthenModel::GetInstance(gAuthen.kind());
00228     std::vector<AuthenModel *> & allInstances = AuthenModel::GetAllInstances();
00229     std::vector<AuthenModel *>::const_iterator i;
00230
00231     if(curModel != 0L)
00232     {
00233         const char *res = curModel->OnGetEnv(name);
00234         if(res != 0L)
00235             return res;
00236     }
00237
00238     for(i = allInstances.begin(); i != allInstances.end(); ++i)
00239     {
00240         AuthenModel *model = *i;
00241
00242         if(model == curModel)
00243             continue;
00244
00245         const char *res = model->OnGetEnv(name);
00246         if(res != 0L)
00247             return res;
00248     }
00249
00250     if(strcmp(name, "USER") == 0
00251 #ifdef WIN32
00252         // I do that (and see the "STRATA_HACK" in
00253         // subr.c) because people get tired on Windows
00254         // to have to check their Windows login :
00255         // this is only for .rhosts authentication.
00256         || strcmp(name, "LOGNAME") == 0
00257 #endif /* WIN32 */
00258         )
00259     {
00260         static char user[64];
00261
00262         // extract from the cvsroot
00263         const char *ccvsroot = gCvsPrefs;
00264         ccvsroot = Authen::skiptoken(ccvsroot);
00265         char *login = strchr(ccvsroot, '@');
00266         if(login == NULL)
00267         {
00268             // for WIN32 this means the CVSROOT is local
00269 #ifdef macintosh
00270             cvs_err("MacCvs: Cannot extract login from cvsroot %s !\n", ccvsroot);
00271 #endif /* macintosh */
00272             return NULL;
00273         }
00274         int length = login - ccvsroot;
00275         memcpy(user, ccvsroot, length * sizeof(char));
00276         user[length] = '\0';
00277         return user;
00278     }
00279     else if(strcmp(name, "CVSROOT") == 0)
00280     {
00281         static CStr root;
00282
00283         // extract from the cvsroot
00284         const char *ccvsroot = gCvsPrefs;
00285         ccvsroot = Authen::skiptoken(ccvsroot);
00286         root = gAuthen.token();
00287         root << ccvsroot;
00288         return root;
00289     }
00290     else if(strcmp(name, "CVSREAD") == 0)
00291     {
00292         return gCvsPrefs.CheckoutRO() ? (char *)"1" : 0L;
00293     }
00294     else if(strncmp(name, "CVS_GETPASS", strlen("CVS_GETPASS")) == 0)
00295     {
00296         UStr str("Enter the password:");
00297         char *tmp;
00298         if((tmp = strchr(name, '=')) != 0L)
00299         {
00300             str = ++tmp;
00301         }
00302         return CompatGetPassword(str);
00303     }
00304     else if(strcmp(name, "CVSLIB_YESNO") == 0)
00305     {
00306         return (char *)AskYesNo();
00307     }
00308     else if(strcmp(name, "DIRTY_MCP") == 0)
00309     {
00310         return gCvsPrefs.DirtySupport() ? (char *)"yes" : (char *)"no";
00311     }
00312 #ifdef WIN32
00313     else if(strcmp(name, "HOME") == 0)
00314     {
00315         // prompt for home the first time
00316         if(gCvsPrefs.Home() == 0L)
00317         {
00318             char oldpath[512];
00319             getcwd(oldpath, 511);
00320             const char *chome = BrowserGetDirectory("Select your home directory :");
00321             if(chome == 0L)
00322             {
00323                 chdir(oldpath);
00324                 return 0L;
00325             }
00326
00327             gCvsPrefs.SetHome(chome);
00328             gCvsPrefs.save();
00329             chdir(oldpath);
00330         }
00331
00332         // Windows 98 doesn't like C:\/.cvspass
00333         static CStr home;
00334         home = gCvsPrefs.Home();
00335         if(home.endsWith(kPathDelimiter))
00336         {
00337             home[home.length() - 1] = '\0';
00338         }
00339
00340         return home;
00341     }
00342     else if(strcmp(name, "CVSUSEUNIXLF") == 0)
00343     {
00344         return gCvsPrefs.UnixLF() ? (char *)"1" : 0L;
00345     }
00346 #endif /*WIN32 */
00347 #if TARGET_RT_MAC_MACHO
00348     else if(strcmp(name, "CVS_MACLF") == 0)
00349     {
00350         return gCvsPrefs.MacLF() ? (char *)"1" : 0L;
00351     }
00352 #endif
00353 #if TARGET_RT_MAC_CFM
00354     else if(strcmp(name, "HOME") == 0)
00355     {
00356         UFSSpec theFolder;
00357         static UStr thePath;
00358
00359         if(MacGetPrefsFolder(theFolder, thePath) != noErr)
00360         {
00361             cvs_err("Unable to locate the preferences folder !\n");
00362             return 0L;
00363         }
00364
00365         // We do not use any more the "@@@" trick. Instead
00366         // we let cvs convert it to a Unix path.
00367         //strcpy(thePath, "@@@");
00368         return thePath;
00369     }
00370     else if(strcmp(name, "CVSUSEUNIXLF") == 0)
00371     {
00372         return gCvsPrefs.UnixLF() ? (char *)"1" : 0L;
00373     }
00374 #endif
00375 #ifdef macintosh
00376     else if(strcmp(name, "ISO8859") == 0)
00377     {
00378         static char iso[6];
00379
00380         if(gCvsPrefs.IsoConvert() == ISO8559_none)
00381             return 0L;
00382
00383         sprintf(iso, "%d", (int)gCvsPrefs.IsoConvert());
00384         return iso;
00385     }
00386     else if(strcmp(name, "IC_ON_TXT") == 0)
00387     {
00388         return gCvsPrefs.ICTextOption() ? (char *)"1" : 0L;
00389     }
00390     else if(strcmp(name, "MAC_DEFAULT_RESOURCE_ENCODING") == 0)
00391     {
00392         switch(gCvsPrefs.MacBinEncoding())
00393         {
00394             case MAC_HQX:
00395                 return (char *)"HQX";
00396                 break;
00397             case MAC_APPSINGLE:
00398                 return (char *)"AppleSingle";
00399                 break;
00400         }
00401         return 0L;
00402     }
00403     else if(strcmp(name, "MAC_BINARY_TYPES_SINGLE") == 0)
00404     {
00405         return (char *)MacBinMaps::GetEnvTypes(MAC_APPSINGLE);
00406     }
00407     else if(strcmp(name, "MAC_BINARY_TYPES_HQX") == 0)
00408     {
00409         return (char *)MacBinMaps::GetEnvTypes(MAC_HQX);
00410     }
00411     else if(strcmp(name, "MAC_BINARY_TYPES_PLAIN") == 0)
00412     {
00413         return (char *)MacBinMaps::GetEnvPlainTypes();
00414     }
00415 #endif /* macintosh */
00416     else {
00417         char *res;
00418         res = getenv(name);
00419         return res;
00420     }
00421
00422     return NULL;
00423 }

const char* launchCVS | ( | const char * | dir,
 |  | const CvsArgs & | args,
 |  | const char * | prefix,
 |  | const char * | extension
 | ) |

Definition at line 792 of file AppGlue.cpp.

References CStr, launchCVS, CTmpFiles::push_back, and sTmpList.

00793 {
00794     CStr filename;
00795     FILE *file = launchCVS(dir, args, filename, prefix, extension);
00796     if(file == 0L)
00797         return 0L;
00798
00799     fclose(file);
00800     return sTmpList.push_back(filename);
00801 }

FILE* launchCVS | ( | const char * | dir,
 |  | const CvsArgs & | args,
 |  | UStr & | tmpFile,
 |  | const char * | prefix,
 |  | const char * | extension
 | ) |

Definition at line 748 of file AppGlue.cpp.

References CvsArgs::Argc, CvsArgs::Argv, CStr, cvs_err, launchCVS, and MakeTmpFile.

00749 {
00750     if(!MakeTmpFile(tmpFile, prefix, extension))
00751         return 0L;
00752
00753     FILE * res = fopen(tmpFile, "w+");
00754     if(res == 0L)
00755     {
00756         cvs_err("Impossible to open for write the temp file '%s' (error %d)",
00757             (const char *)tmpFile, errno);
00758         return 0L;
00759     }
00760
00761     CStreamConsole myconsole(res);
00762
00763     launchCVS(dir, args.Argc(), args.Argv(), &myconsole);
00764
00765     fseek(res, 0L, SEEK_SET);
00766
00767     return res;
00768 }

int launchCVS | ( | const char * | path,
 |  | int | argc,
 |  | char *const * | argv,
 |  | CCvsConsole * | console
 | ) |

Definition at line 529 of file AppGlue.cpp.

References CompatCallLibrary3, CompatConnectID, CStr, cvs_err, cvs_process_give_time, cvs_process_is_active, cvs_process_open, dllglue_main_func, UStr::endsWith, errInternal, UCvsApp::gApp, UCvsApp::gCurCvs, CWincvsApp::gCvsProcess, CWincvsApp::gCvsRunning, CWincvsApp::gCvsStopping, glue_eventdispatcher, UCvsApp::IsCvsRunning, loadCVS, CWincvsApp::PeekPumpAndIdle, UCvsApp::SetCvsRunning, UCvsApp::SetCvsStopping, sLastExitCode, SplitPath, stat, and unloadCVS.

00530 {
00531     CAuthenSetUp setupEnv;
00532
00533     gConsole = console;
00534
00535 #if TARGET_RT_MAC_CFM
00536     CompatConnectID connID;
00537
00538     if(!loadCVS(connID))
00539         return errInternal;
00540
00541     int exitc = 0;
00542
00543     // call the main
00544     if(!CompatCallLibrary3(connID, exitc, uppMainProcInfo, "dllglue_main",
00545         dllglue_main_func, path, argc, (char **)argv))
00546     {
00547         cvs_err("Error : Cannot find symbol ""dllglue_main""\n");
00548         exitc = errInternal;
00549     }
00550
00551
00552     unloadCVS(connID, exitc);
00553
00554     return exitc;
00555 #elif qUnix_old
00556     CStr cvscmd;
00557
00558     sLastExitCode = 0;
00559
00560     if(UCvsApp::gApp->IsCvsRunning())
00561     {
00562         cvs_err("Error : cvs is already running !\n");
00563         return errInternal;
00564     }
00565
00566     if(path != 0L && chdir(path) != 0)
00567     {
00568         cvs_err("Error : cannot chdir to %s (error %d)!\n", path, errno);
00569     }
00570
00571     UCvsApp::gApp->SetCvsStopping(false);
00572
00573     struct stat sb;
00574     cvscmd = "/home/bruenen/PRIVAT/cvsgui/cvsunix/src/cvs"; //UCvsApp::gApp->GetAppLibFolder();
00575     if(!cvscmd.endsWith(kPathDelimiter))
00576         cvscmd << kPathDelimiter;
00577     cvscmd << "cvs";
00578     UStr firstCmd = cvscmd;
00579     if(stat(cvscmd, &sb) == -1 || !(S_ISREG(sb.st_mode) || S_ISLNK(sb.st_mode)))
00580     {
00581         cvscmd = PACKAGE_SOURCE_DIR;
00582         CStr uppath, folder;
00583         SplitPath(cvscmd, uppath, folder);
00584         cvscmd = uppath;
00585         if(!cvscmd.endsWith(kPathDelimiter))
00586             cvscmd << kPathDelimiter;
00587         cvscmd << "cvsunix/src/cvs";
00588     }
00589
00590     if(stat(cvscmd, &sb) == -1 || !(S_ISREG(sb.st_mode) || S_ISLNK(sb.st_mode)))
00591     {
00592         cvs_err("Unable to find the cvs process in : (error %d)\n", errno);
00593         cvs_err("1) %s\n", (const char *)firstCmd);
00594         cvs_err("2) %s\n", (const char *)cvscmd);
00595     }
00596
00597     CvsProcess *proc = cvs_process_open(cvscmd, argc - 1, (char **)argv + 1, &sCallTable, false, 0L);
00598     if(proc == 0L)
00599     {
00600         cvs_err("Unable to initialize the cvs process (error %d)\n", errno);
00601         cvs_err("The cvs used is : %s\n", (const char *)cvscmd);
00602     }
00603     else if(console != 0L)
00604     {
00605         while(true)
00606         {
00607             cvs_process_give_time();
00608             if(!cvs_process_is_active(proc))
00609                 break;
00610         }
00611     }
00612     else
00613     {
00614         UCvsApp::gApp->SetCvsRunning(true);
00615         UCvsApp::gCurCvs = proc;
00616     }
00617
00618     return sLastExitCode;
00619 #elif defined(WIN32) || defined(qUnix) || TARGET_RT_MAC_MACHO
00620     CStr cvscmd;
00621
00622     sLastExitCode = 0;
00623
00624 #ifdef WIN32
00625     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00626     if( app->gCvsRunning && cvs_process_is_active(app->gCvsProcess) )   {
00627         cvs_err("Error : cvs is already running !\n");
00628         return -1;
00629     }
00630     //Jerzy - we don't want to chdir, on windows we can use the "currentDirectory" parameter
00631 #if _0_
00632     if(path != 0L && chdir(path) != 0) {
00633         cvs_err("Error : cannot chdir to %s (error %d)!\n", path, errno);
00634     }
00635 #endif // _0_
00636
00637     app->gCvsStopping = false;
00638 #elif qUnix
00639     if(UCvsApp::gApp->IsCvsRunning())   {
00640         cvs_err("Error : cvs is already running !\n");
00641         return errInternal;
00642     }
00643
00644     if(path != 0L && chdir(path) != 0){
00645         cvs_err("Error : cannot chdir to %s (error %d)!\n", path, errno);
00646     }
00647
00648     UCvsApp::gApp->SetCvsStopping(false);
00649 #elif TARGET_RT_MAC_MACHO
00650     if(CMacCvsApp::gApp->IsCvsRunning())    {
00651         cvs_err("Error : cvs is already running !\n");
00652         return errInternal;
00653     }
00654
00655     if(path != 0L && chdir(path) != 0){
00656         cvs_err("Error : cannot chdir to %s (error %d)!\n", path, errno);
00657     }
00658
00659     CMacCvsApp::gApp->SetCvsStopping(false);
00660 #endif
00661
00662     gCvsPrefs.WhichCvs(cvscmd, gCvsPrefs.UseAltCvs());
00663
00664     struct stat sb;
00665
00666     if(stat(cvscmd, &sb) == -1 ||
00667 #if qUnix || TARGET_RT_MAC_MACHO
00668          S_ISLNK(sb.st_mode) ||
00669 #endif
00670          !(S_ISREG(sb.st_mode)))
00671     {
00672         cvs_err("Unable to find the cvs process in : (error %d)\n", errno);
00673         cvs_err("1) %s\n", (const char *)cvscmd);
00674     }
00675
00676     CvsProcess *proc = cvs_process_open(cvscmd, argc - 1, (char **)argv + 1,
00677         &sCallTable, gCvsPrefs.CvsConsole(), path);
00678     if(proc == 0L)
00679     {
00680         cvs_err("Unable to initialize the cvs process (error %d)\n", errno);
00681         cvs_err("The cvs used is : %s\n", (const char *)cvscmd);
00682     }
00683     else
00684     {
00685 #if qUnix
00686         UCvsApp::gApp->SetCvsRunning(true);
00687         UCvsApp::gCurCvs = proc;
00688 #elif TARGET_RT_MAC_MACHO
00689         CMacCvsApp::gApp->SetCvsRunning(true);
00690         CMacCvsApp::gCurCvs = proc;
00691         UInt32 start = ::TickCount ();
00692
00693     if(console != 0L )
00694 #else
00695         app->gCvsRunning = true;
00696         app->gCvsProcess = proc;
00697
00698     if(console != 0L )
00699 #endif
00700         while( TRUE ) {
00701 #ifdef WIN32
00702             app->PeekPumpAndIdle();
00703 #endif
00704 #if TARGET_RT_MAC_MACHO
00705             if((::TickCount () - start) > 40)
00706             {
00707                 glue_eventdispatcher(0L);
00708                 start = ::TickCount ();
00709             }
00710 #endif
00711             cvs_process_give_time();
00712
00713             if( !cvs_process_is_active(proc) )
00714                 break;
00715         }
00716     /*}
00717 #ifdef qUnix
00718         else {
00719             UCvsApp::gApp->SetCvsRunning(true);
00720             UCvsApp::gCurCvs = proc;
00721         }
00722 #endif*/
00723     }
00724
00725     return sLastExitCode;
00726 #endif
00727 }

int testCVS | ( | const char * | cvsfile,
 |  | int | argc,
 |  | char *const * | argv
 | ) |

Definition at line 443 of file AppGlue.cpp.

References CStr, cvs_err, cvs_process_give_time, cvs_process_is_active, cvs_process_kill, cvs_process_open, errInternal, UCvsApp::gApp, CWincvsApp::gCvsProcess, CWincvsApp::gCvsRunning, CWincvsApp::gCvsStopping, UCvsApp::IsCvsRunning, NULL, CWincvsApp::PeekPumpAndIdle, UCvsApp::SetCvsStopping, sLastExitCode, and stat.

00444 {
00445     CAuthenSetUp setupEnv;
00446
00447 #ifdef macintosh
00448     return -1;
00449 #elif defined(WIN32) || defined qUnix
00450     CStr cvscmd(cvsfile);
00451
00452     sLastExitCode = 1;
00453
00454 #ifdef WIN32
00455     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00456     if( app->gCvsRunning && cvs_process_is_active(app->gCvsProcess) )   {
00457         cvs_err("Error : cvs is already running !\n");
00458         return -1;
00459     }
00460
00461     app->gCvsStopping = false;
00462 #elif qUnix
00463     if(UCvsApp::gApp->IsCvsRunning())   {
00464         cvs_err("Error : cvs is already running !\n");
00465         return errInternal;
00466     }
00467
00468     UCvsApp::gApp->SetCvsStopping(false);
00469 #endif
00470
00471     struct stat sb;
00472
00473     if(stat(cvscmd, &sb) == -1 ||
00474 #ifdef qUnix
00475          S_ISLNK(sb.st_mode) ||
00476 #endif
00477          !(S_ISREG(sb.st_mode)))
00478     {
00479         cvs_err("Unable to find the cvs process in : (error %d)\n", errno);
00480         cvs_err("1) %s\n", (const char *)cvscmd);
00481         return -1;
00482     }
00483
00484     //CvsProcess *proc = cvs_process_test(cvscmd, argc - 1, (char **)argv + 1, &sCallTable);
00485     CvsProcess *proc = cvs_process_open(cvscmd, argc - 1, (char **)argv + 1,
00486         &sCallTable, gCvsPrefs.CvsConsole(), NULL);
00487
00488     if(proc == 0L)
00489     {
00490         cvs_err("Unable to initialize the cvs process (error %d)\n", errno);
00491         cvs_err("The cvs used is : %s\n", (const char *)cvscmd);
00492     }
00493     else
00494     {
00495 #ifdef WIN32
00496         app->gCvsRunning = true;
00497         app->gCvsProcess = proc;
00498 #endif
00499
00500         time_t start = time(NULL);
00501
00502         while( (time(NULL) - start ) < 20) {
00503 #ifdef WIN32
00504             app->PeekPumpAndIdle();
00505 #endif
00506             cvs_process_give_time();
00507
00508             if( !cvs_process_is_active(proc) )
00509                 break;
00510
00511             if( (time(NULL) - start ) > 10 ) {
00512                 cvs_err("testing cvs timed out");
00513                 cvs_process_kill( proc );
00514             }
00515         }
00516
00517 /*#ifdef qUnix
00518         else {
00519             UCvsApp::gApp->SetCvsRunning(true);
00520             UCvsApp::gCurCvs = proc;
00521         }
00522 #endif*/
00523     }
00524
00525     return sLastExitCode;
00526 #endif
00527 }

void WaitForCvs ( void )

Definition at line 804 of file AppGlue.cpp.

References cvs_process_is_active, and CWincvsApp::gCvsProcess.

Referenced by CvsCmdLogin, MultiFiles::next, and CWincvsApp::SaveAllModified.

00805 {
00806     // pump messages manually
00807     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00808
00809     while(1)
00810     {
00811         if(app->gCvsProcess == 0L)
00812             return;
00813
00814         if(!cvs_process_is_active(app->gCvsProcess))
00815             return;
00816
00817         Sleep(100);
00818     }
00819 }

Variable Documentation

CCvsConsole* gConsole = 0L

Definition at line 98 of file AppGlue.cpp.

CvsProcessCallbacks sCallTable [static]

Initial value:

 {
    glue_consoleout,
    glue_consoleerr,
    glue_getenv,
    glue_exit
}

Definition at line 108 of file AppGlue.cpp.

int sLastExitCode [static]

Definition at line 99 of file AppGlue.cpp.

Referenced by glue_exit, launchCVS, and testCVS.

class CTmpFiles sTmpList

Referenced by launchCVS.

Generated on Sun Feb 24 01:21:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AppGlue.h File Reference

common/AppGlue.h File Reference

#include <stdio.h>

Include dependency graph for AppGlue.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCvsConsole

Defines

#define | errInternal -99
#define | errThreadRunning -98

Functions

int | testCVS (const char *path, int argc, char *const *argv)
int | launchCVS (const char *path, int argc, char *const *argv, CCvsConsole *console=0L)
FILE * | launchCVS (const char *dir, const CvsArgs &args, UStr &tmpFile, const char *prefix=0L, const char *extension=0L)
const char * | launchCVS (const char *dir, const CvsArgs &args, const char *prefix=0L, const char *extension=0L)
long | glue_consoleout (char *txt, long len)
long | glue_consoleerr (char *txt, long len)
long | glue_consolein (char *txt, long len)
const char * | glue_getenv (char *name)
void | glue_exit (int code)
void | WaitForCvs (void)

Variables

CCvsConsole * gConsole

Define Documentation

#define errInternal -99

Definition at line 37 of file AppGlue.h.

Referenced by launchCVS, and testCVS.

#define errThreadRunning -98

Definition at line 38 of file AppGlue.h.

Function Documentation

long glue_consoleerr | ( | char * | txt,
 |  | long | len
 | ) |

Definition at line 140 of file AppGlue.cpp.

00141 {
00142     if(gConsole != 0L)
00143         return gConsole->cvs_err(txt, len);
00144
00145 #ifdef macintosh
00146     // apple event output
00147     long newlen;
00148     if((newlen = ae_consoleout(txt, len)) != -1)
00149         return newlen;
00150 #endif
00151
00152     cvs_errstr(txt, len);
00153
00154     return len;
00155 }

long glue_consolein | ( | char * | txt,
 |  | long | len
 | ) |

Definition at line 157 of file AppGlue.cpp.

00158 {
00159 #ifdef macintosh
00160     // apple event input
00161     long newlen;
00162     if((newlen = ae_consolein(txt, len)) != -1)
00163         return newlen;
00164 #endif /* !macintosh */
00165
00166     return 0;
00167 }

long glue_consoleout | ( | char * | txt,
 |  | long | len
 | ) |

Definition at line 123 of file AppGlue.cpp.

00124 {
00125     if(gConsole != 0L)
00126         return gConsole->cvs_out(txt, len);
00127
00128 #ifdef macintosh
00129     // apple event output
00130     long newlen;
00131     if((newlen = ae_consoleout(txt, len)) != -1)
00132         return newlen;
00133 #endif
00134
00135     cvs_outstr(txt, len);
00136
00137     return len;
00138 }

void glue_exit ( int code )

Definition at line 116 of file AppGlue.cpp.

00117 {
00118     if(!gCvsPrefs.IsTclFileRunning())
00119         cvs_out("\n*****CVS exited normally with code %d*****\n\n", code);
00120     sLastExitCode = code;
00121 }

const char* glue_getenv ( char * name )

Definition at line 188 of file AppGlue.cpp.

Referenced by CMainFrame::OnTimer.

00189 {
00190     if(name == NULL)
00191         return NULL;
00192
00193 #ifdef WIN32
00194     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00195     if(::GetCurrentThreadId() != app->m_nThreadID &&
00196         (strcmp(name, "CVS_GETPASS") == 0 || strcmp(name, "CVSLIB_YESNO") == 0 ||
00197         strcmp(name, "HOME") == 0))
00198     {
00199         // synchonize it since the thread calls and
00200         // we call some MFC objects in it (prompt
00201         // password, get path...)
00202         CCvsThreadLock threadLock;
00203
00204         return app->GetEnvMainThread(name);
00205     }
00206 #endif /* WIN32 */
00207
00208 #ifdef macintosh
00209     char *result;
00210     if((result = ae_getenv(name)) != (char *)-1)
00211     {
00212         if(result == 0L && isGlobalEnvVariable(name))
00213         {
00214             // in this case only we let continue
00215             // to get the MacCVS settings. So the CWCVS
00216             // users (or any AppleEvent user) can set
00217             // these variables in MacCVS but still can overide
00218             // them using Apple Events.
00219         }
00220         else
00221             return result;
00222     }
00223 #endif /* macintosh */
00224
00225     // new : give a chance for the new AuthenModel to react to the getenv
00226     // callback
00227     AuthenModel *curModel = AuthenModel::GetInstance(gAuthen.kind());
00228     std::vector<AuthenModel *> & allInstances = AuthenModel::GetAllInstances();
00229     std::vector<AuthenModel *>::const_iterator i;
00230
00231     if(curModel != 0L)
00232     {
00233         const char *res = curModel->OnGetEnv(name);
00234         if(res != 0L)
00235             return res;
00236     }
00237
00238     for(i = allInstances.begin(); i != allInstances.end(); ++i)
00239     {
00240         AuthenModel *model = *i;
00241
00242         if(model == curModel)
00243             continue;
00244
00245         const char *res = model->OnGetEnv(name);
00246         if(res != 0L)
00247             return res;
00248     }
00249
00250     if(strcmp(name, "USER") == 0
00251 #ifdef WIN32
00252         // I do that (and see the "STRATA_HACK" in
00253         // subr.c) because people get tired on Windows
00254         // to have to check their Windows login :
00255         // this is only for .rhosts authentication.
00256         || strcmp(name, "LOGNAME") == 0
00257 #endif /* WIN32 */
00258         )
00259     {
00260         static char user[64];
00261
00262         // extract from the cvsroot
00263         const char *ccvsroot = gCvsPrefs;
00264         ccvsroot = Authen::skiptoken(ccvsroot);
00265         char *login = strchr(ccvsroot, '@');
00266         if(login == NULL)
00267         {
00268             // for WIN32 this means the CVSROOT is local
00269 #ifdef macintosh
00270             cvs_err("MacCvs: Cannot extract login from cvsroot %s !\n", ccvsroot);
00271 #endif /* macintosh */
00272             return NULL;
00273         }
00274         int length = login - ccvsroot;
00275         memcpy(user, ccvsroot, length * sizeof(char));
00276         user[length] = '\0';
00277         return user;
00278     }
00279     else if(strcmp(name, "CVSROOT") == 0)
00280     {
00281         static CStr root;
00282
00283         // extract from the cvsroot
00284         const char *ccvsroot = gCvsPrefs;
00285         ccvsroot = Authen::skiptoken(ccvsroot);
00286         root = gAuthen.token();
00287         root << ccvsroot;
00288         return root;
00289     }
00290     else if(strcmp(name, "CVSREAD") == 0)
00291     {
00292         return gCvsPrefs.CheckoutRO() ? (char *)"1" : 0L;
00293     }
00294     else if(strncmp(name, "CVS_GETPASS", strlen("CVS_GETPASS")) == 0)
00295     {
00296         UStr str("Enter the password:");
00297         char *tmp;
00298         if((tmp = strchr(name, '=')) != 0L)
00299         {
00300             str = ++tmp;
00301         }
00302         return CompatGetPassword(str);
00303     }
00304     else if(strcmp(name, "CVSLIB_YESNO") == 0)
00305     {
00306         return (char *)AskYesNo();
00307     }
00308     else if(strcmp(name, "DIRTY_MCP") == 0)
00309     {
00310         return gCvsPrefs.DirtySupport() ? (char *)"yes" : (char *)"no";
00311     }
00312 #ifdef WIN32
00313     else if(strcmp(name, "HOME") == 0)
00314     {
00315         // prompt for home the first time
00316         if(gCvsPrefs.Home() == 0L)
00317         {
00318             char oldpath[512];
00319             getcwd(oldpath, 511);
00320             const char *chome = BrowserGetDirectory("Select your home directory :");
00321             if(chome == 0L)
00322             {
00323                 chdir(oldpath);
00324                 return 0L;
00325             }
00326
00327             gCvsPrefs.SetHome(chome);
00328             gCvsPrefs.save();
00329             chdir(oldpath);
00330         }
00331
00332         // Windows 98 doesn't like C:\/.cvspass
00333         static CStr home;
00334         home = gCvsPrefs.Home();
00335         if(home.endsWith(kPathDelimiter))
00336         {
00337             home[home.length() - 1] = '\0';
00338         }
00339
00340         return home;
00341     }
00342     else if(strcmp(name, "CVSUSEUNIXLF") == 0)
00343     {
00344         return gCvsPrefs.UnixLF() ? (char *)"1" : 0L;
00345     }
00346 #endif /*WIN32 */
00347 #if TARGET_RT_MAC_MACHO
00348     else if(strcmp(name, "CVS_MACLF") == 0)
00349     {
00350         return gCvsPrefs.MacLF() ? (char *)"1" : 0L;
00351     }
00352 #endif
00353 #if TARGET_RT_MAC_CFM
00354     else if(strcmp(name, "HOME") == 0)
00355     {
00356         UFSSpec theFolder;
00357         static UStr thePath;
00358
00359         if(MacGetPrefsFolder(theFolder, thePath) != noErr)
00360         {
00361             cvs_err("Unable to locate the preferences folder !\n");
00362             return 0L;
00363         }
00364
00365         // We do not use any more the "@@@" trick. Instead
00366         // we let cvs convert it to a Unix path.
00367         //strcpy(thePath, "@@@");
00368         return thePath;
00369     }
00370     else if(strcmp(name, "CVSUSEUNIXLF") == 0)
00371     {
00372         return gCvsPrefs.UnixLF() ? (char *)"1" : 0L;
00373     }
00374 #endif
00375 #ifdef macintosh
00376     else if(strcmp(name, "ISO8859") == 0)
00377     {
00378         static char iso[6];
00379
00380         if(gCvsPrefs.IsoConvert() == ISO8559_none)
00381             return 0L;
00382
00383         sprintf(iso, "%d", (int)gCvsPrefs.IsoConvert());
00384         return iso;
00385     }
00386     else if(strcmp(name, "IC_ON_TXT") == 0)
00387     {
00388         return gCvsPrefs.ICTextOption() ? (char *)"1" : 0L;
00389     }
00390     else if(strcmp(name, "MAC_DEFAULT_RESOURCE_ENCODING") == 0)
00391     {
00392         switch(gCvsPrefs.MacBinEncoding())
00393         {
00394             case MAC_HQX:
00395                 return (char *)"HQX";
00396                 break;
00397             case MAC_APPSINGLE:
00398                 return (char *)"AppleSingle";
00399                 break;
00400         }
00401         return 0L;
00402     }
00403     else if(strcmp(name, "MAC_BINARY_TYPES_SINGLE") == 0)
00404     {
00405         return (char *)MacBinMaps::GetEnvTypes(MAC_APPSINGLE);
00406     }
00407     else if(strcmp(name, "MAC_BINARY_TYPES_HQX") == 0)
00408     {
00409         return (char *)MacBinMaps::GetEnvTypes(MAC_HQX);
00410     }
00411     else if(strcmp(name, "MAC_BINARY_TYPES_PLAIN") == 0)
00412     {
00413         return (char *)MacBinMaps::GetEnvPlainTypes();
00414     }
00415 #endif /* macintosh */
00416     else {
00417         char *res;
00418         res = getenv(name);
00419         return res;
00420     }
00421
00422     return NULL;
00423 }

const char* launchCVS | ( | const char * | dir,
 |  | const CvsArgs & | args,
 |  | const char * | prefix = 0L,
 |  | const char * | extension = 0L
 | ) |

Definition at line 792 of file AppGlue.cpp.

Referenced by CvsCmdAddBinaryFiles, CvsCmdAddFiles, CvsCmdAddFolder, CvsCmdAddUnicodeFiles, CvsCmdAnnotateFiles, CvsCmdCancelChangesFiles, CvsCmdCheckoutModule, CvsCmdCommitFiles, CvsCmdCommitFolder, CvsCmdDiffFiles, CvsCmdDiffFolder, CvsCmdEditFiles, CvsCmdEditFolder, CvsCmdEditorsFiles, CvsCmdEditorsFolder, CvsCmdImportModule, CvsCmdInit, CvsCmdLine, CvsCmdLockFiles, CvsCmdLockFolder, CvsCmdLogin, CvsCmdLogout, CvsCmdReleaseFolder, CvsCmdRemoveFiles, CvsCmdRtagBranch, CvsCmdRtagCreate, CvsCmdRtagDelete, CvsCmdStatusFiles, CvsCmdStatusFolder, CvsCmdTagBranchFiles, CvsCmdTagBranchFolder, CvsCmdTagCreateFiles, CvsCmdTagCreateFolder, CvsCmdTagDeleteFiles, CvsCmdTagDeleteFolder, CvsCmdUneditFiles, CvsCmdUneditFolder, CvsCmdUnlockFiles, CvsCmdUnlockFolder, CvsCmdUpdateFiles, CvsCmdUpdateFolder, CvsCmdWatchersFiles, CvsCmdWatchersFolder, CvsCmdWatchOffFiles, CvsCmdWatchOffFolder, CvsCmdWatchOnFiles, CvsCmdWatchOnFolder, cvsgui_RunCvs, CvsLogParse, launchCVS, CGraphView::OnGraphChangelogmessage, CGraphView::OnGraphSetdescription, CGraphView::OnGraphSetstate, CGraphView::OnQueryAnnotate, CGraphView::OnViewDelrev, CGraphView::OnViewDiff, CGraphView::OnViewRetrieve, CGraphView::OnViewTag, CGraphView::OnViewUnlockf, CGraphView::OnViewUpdate, and tclCvsProc.

00793 {
00794     CStr filename;
00795     FILE *file = launchCVS(dir, args, filename, prefix, extension);
00796     if(file == 0L)
00797         return 0L;
00798
00799     fclose(file);
00800     return sTmpList.push_back(filename);
00801 }

FILE* launchCVS | ( | const char * | dir,
 |  | const CvsArgs & | args,
 |  | UStr & | tmpFile,
 |  | const char * | prefix = 0L,
 |  | const char * | extension = 0L
 | ) |

int launchCVS | ( | const char * | path,
 |  | int | argc,
 |  | char *const * | argv,
 |  | CCvsConsole * | console = 0L
 | ) |

int testCVS | ( | const char * | path,
 |  | int | argc,
 |  | char *const * | argv
 | ) |

Definition at line 443 of file AppGlue.cpp.

00444 {
00445     CAuthenSetUp setupEnv;
00446
00447 #ifdef macintosh
00448     return -1;
00449 #elif defined(WIN32) || defined qUnix
00450     CStr cvscmd(cvsfile);
00451
00452     sLastExitCode = 1;
00453
00454 #ifdef WIN32
00455     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00456     if( app->gCvsRunning && cvs_process_is_active(app->gCvsProcess) )   {
00457         cvs_err("Error : cvs is already running !\n");
00458         return -1;
00459     }
00460
00461     app->gCvsStopping = false;
00462 #elif qUnix
00463     if(UCvsApp::gApp->IsCvsRunning())   {
00464         cvs_err("Error : cvs is already running !\n");
00465         return errInternal;
00466     }
00467
00468     UCvsApp::gApp->SetCvsStopping(false);
00469 #endif
00470
00471     struct stat sb;
00472
00473     if(stat(cvscmd, &sb) == -1 ||
00474 #ifdef qUnix
00475          S_ISLNK(sb.st_mode) ||
00476 #endif
00477          !(S_ISREG(sb.st_mode)))
00478     {
00479         cvs_err("Unable to find the cvs process in : (error %d)\n", errno);
00480         cvs_err("1) %s\n", (const char *)cvscmd);
00481         return -1;
00482     }
00483
00484     //CvsProcess *proc = cvs_process_test(cvscmd, argc - 1, (char **)argv + 1, &sCallTable);
00485     CvsProcess *proc = cvs_process_open(cvscmd, argc - 1, (char **)argv + 1,
00486         &sCallTable, gCvsPrefs.CvsConsole(), NULL);
00487
00488     if(proc == 0L)
00489     {
00490         cvs_err("Unable to initialize the cvs process (error %d)\n", errno);
00491         cvs_err("The cvs used is : %s\n", (const char *)cvscmd);
00492     }
00493     else
00494     {
00495 #ifdef WIN32
00496         app->gCvsRunning = true;
00497         app->gCvsProcess = proc;
00498 #endif
00499
00500         time_t start = time(NULL);
00501
00502         while( (time(NULL) - start ) < 20) {
00503 #ifdef WIN32
00504             app->PeekPumpAndIdle();
00505 #endif
00506             cvs_process_give_time();
00507
00508             if( !cvs_process_is_active(proc) )
00509                 break;
00510
00511             if( (time(NULL) - start ) > 10 ) {
00512                 cvs_err("testing cvs timed out");
00513                 cvs_process_kill( proc );
00514             }
00515         }
00516
00517 /*#ifdef qUnix
00518         else {
00519             UCvsApp::gApp->SetCvsRunning(true);
00520             UCvsApp::gCurCvs = proc;
00521         }
00522 #endif*/
00523     }
00524
00525     return sLastExitCode;
00526 #endif
00527 }

void WaitForCvs ( void )

Definition at line 804 of file AppGlue.cpp.

00805 {
00806     // pump messages manually
00807     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00808
00809     while(1)
00810     {
00811         if(app->gCvsProcess == 0L)
00812             return;
00813
00814         if(!cvs_process_is_active(app->gCvsProcess))
00815             return;
00816
00817         Sleep(100);
00818     }
00819 }

Variable Documentation

CCvsConsole* gConsole

Definition at line 70 of file AppGlue.h.

Generated on Sun Feb 24 01:21:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AppGlue.mac.cpp File Reference

common/AppGlue.mac.cpp File Reference

Go to the source code of this file.

Generated on Sun Feb 24 01:21:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AppGlue.mac.h File Reference

common/AppGlue.mac.h File Reference

#include "dll_loader.h"

Include dependency graph for AppGlue.mac.h:

Include dependency graph

Go to the source code of this file.

Functions

long | GUSIMSL_WriteConsoleHook (char *buffer, long n)
long | GUSIMSL_WriteErrHook (char *buffer, long n)
int | GUSIMSL_HandleEventHook (EventRecord *ev)
int | glue_eventdispatcher (EventRecord *ev)
bool | loadCVS (CompatConnectID &connID)
void | unloadCVS (CompatConnectID connID, int exitc)
int | decodeCVS (char *path)

Function Documentation

int decodeCVS ( char * path )

Referenced by CvsCmdAnnotateFiles, and CvsCmdDiffFiles.

int glue_eventdispatcher ( EventRecord * ev )

Referenced by launchCVS.

int GUSIMSL_HandleEventHook ( EventRecord * ev )

long GUSIMSL_WriteConsoleHook | ( | char * | buffer,
 |  | long | n
 | ) |

long GUSIMSL_WriteErrHook | ( | char * | buffer,
 |  | long | n
 | ) |

bool loadCVS ( CompatConnectID & connID )

Referenced by launchCVS.

void unloadCVS | ( | CompatConnectID | connID,
 |  | int | exitc
 | ) |

Referenced by launchCVS.

Generated on Sun Feb 24 01:21:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AskYesNo.cpp File Reference

common/AskYesNo.cpp File Reference

#include "stdafx.h"
#include "resource.h"
#include "AskYesNo.h"
#include "uwidget.h"

Include dependency graph for AskYesNo.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | UEditMessage
class | UPromptMessage

Functions

const char * | AskYesNo (void)
bool | PromptMessage (const char *msg, const char *title, const char *def, const char *cncl)
bool | PromptEditMessage (const char *msg, UStr &edit, const char *title, const char *def, const char *cncl)

Function Documentation

const char* AskYesNo ( void )

Definition at line 81 of file AskYesNo.cpp.

References CvsAlert.

Referenced by glue_getenv.

00082 {
00083 #ifdef WIN32
00084     CAskYesNo gp;
00085     return gp.DoModal() == IDOK ? "yes" : "no";
00086 #endif /* WIN32 */
00087 #ifdef qMacCvsPP
00088     if(!CMacCvsApp::gApp->IsFrontProcess() && CMacCvsApp::gApp->NotifyUser(0L))
00089     {
00090         while(!CMacCvsApp::gApp->IsFrontProcess())
00091         {
00092             CMacCvsApp::gApp->SpendSomeTime();
00093         }
00094     }
00095
00096     StDialogHandler theHandler(dlg_YesNo, LCommander::GetTopCommander());
00097     LWindow *theDialog = theHandler.GetDialog();
00098     ThrowIfNil_(theDialog);
00099
00100     theDialog->Show();
00101     MessageT hitMessage;
00102     while (true)
00103     {       // Let DialogHandler process events
00104         hitMessage = theHandler.DoDialog();
00105
00106         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00107             break;
00108     }
00109     theDialog->Hide();
00110
00111     return hitMessage == msg_OK ? "yes" : "no";
00112 #endif /* qMacCvsPP */
00113 #ifdef qUnix
00114     return CvsAlert("cvs is requiring you to answer yes or no (see the console for details)", "No", "Yes") ?
00115         "no" : "yes";
00116 #endif /* qUnix */
00117 }

bool PromptEditMessage | ( | const char * | msg,
 |  | UStr & | edit,
 |  | const char * | title,
 |  | const char * | def,
 |  | const char * | cncl
 | ) |

Definition at line 240 of file AskYesNo.cpp.

References IDD_EDITMESSAGE.

00241 {
00242     std::auto_ptr<UEditMessage> dlg(new UEditMessage(msg, edit, title, def, cncl));
00243     bool res = false;
00244
00245 #ifdef WIN32
00246     res = dlg->DoModal(IDD_EDITMESSAGE);
00247 #endif
00248 #ifdef qMacCvsPP
00249     res = dlg->DoModal(dlg_PromptEditCommand);
00250 #endif
00251
00252     if(res)
00253         edit = dlg->m_edit;
00254
00255     return res;
00256 }

bool PromptMessage | ( | const char * | msg,
 |  | const char * | title,
 |  | const char * | def,
 |  | const char * | cncl
 | ) |

Definition at line 180 of file AskYesNo.cpp.

References IDD_PROMPTMESSAGE.

00181 {
00182     std::auto_ptr<UPromptMessage> dlg(new UPromptMessage(msg, title, def, cncl));
00183     bool res = false;
00184
00185 #ifdef WIN32
00186     res = dlg->DoModal(IDD_PROMPTMESSAGE);
00187 #endif
00188 #ifdef qMacCvsPP
00189     res = dlg->DoModal(dlg_PromptCommand);
00190 #endif
00191
00192     return res;
00193 }

Generated on Sun Feb 24 01:21:42 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AskYesNo.h File Reference

common/AskYesNo.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CAskYesNo

Defines

#define | AFX_ASKYESNO_H__5946A8C4_8517_11D1_8949_444553540000__INCLUDED_

Functions

const char * | AskYesNo (void)
bool | PromptMessage (const char *msg, const char *title="Message", const char *def="OK", const char *cncl="Cancel")
bool | PromptEditMessage (const char *msg, UStr &edit, const char *title="Message", const char *def="OK", const char *cncl="Cancel")

Define Documentation

#define AFX_ASKYESNO_H__5946A8C4_8517_11D1_8949_444553540000__INCLUDED_

Definition at line 24 of file AskYesNo.h.

Function Documentation

const char* AskYesNo ( void )

Definition at line 81 of file AskYesNo.cpp.

00082 {
00083 #ifdef WIN32
00084     CAskYesNo gp;
00085     return gp.DoModal() == IDOK ? "yes" : "no";
00086 #endif /* WIN32 */
00087 #ifdef qMacCvsPP
00088     if(!CMacCvsApp::gApp->IsFrontProcess() && CMacCvsApp::gApp->NotifyUser(0L))
00089     {
00090         while(!CMacCvsApp::gApp->IsFrontProcess())
00091         {
00092             CMacCvsApp::gApp->SpendSomeTime();
00093         }
00094     }
00095
00096     StDialogHandler theHandler(dlg_YesNo, LCommander::GetTopCommander());
00097     LWindow *theDialog = theHandler.GetDialog();
00098     ThrowIfNil_(theDialog);
00099
00100     theDialog->Show();
00101     MessageT hitMessage;
00102     while (true)
00103     {       // Let DialogHandler process events
00104         hitMessage = theHandler.DoDialog();
00105
00106         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00107             break;
00108     }
00109     theDialog->Hide();
00110
00111     return hitMessage == msg_OK ? "yes" : "no";
00112 #endif /* qMacCvsPP */
00113 #ifdef qUnix
00114     return CvsAlert("cvs is requiring you to answer yes or no (see the console for details)", "No", "Yes") ?
00115         "no" : "yes";
00116 #endif /* qUnix */
00117 }

bool PromptEditMessage | ( | const char * | msg,
 |  | UStr & | edit,
 |  | const char * | title = "Message",
 |  | const char * | def = "OK",
 |  | const char * | cncl = "Cancel"
 | ) |

Definition at line 240 of file AskYesNo.cpp.

Referenced by cvsgui_PromptEditMessage.

00241 {
00242     std::auto_ptr<UEditMessage> dlg(new UEditMessage(msg, edit, title, def, cncl));
00243     bool res = false;
00244
00245 #ifdef WIN32
00246     res = dlg->DoModal(IDD_EDITMESSAGE);
00247 #endif
00248 #ifdef qMacCvsPP
00249     res = dlg->DoModal(dlg_PromptEditCommand);
00250 #endif
00251
00252     if(res)
00253         edit = dlg->m_edit;
00254
00255     return res;
00256 }

bool PromptMessage | ( | const char * | msg,
 |  | const char * | title = "Message",
 |  | const char * | def = "OK",
 |  | const char * | cncl = "Cancel"
 | ) |

Definition at line 180 of file AskYesNo.cpp.

Referenced by cvsgui_PromptMessage.

00181 {
00182     std::auto_ptr<UPromptMessage> dlg(new UPromptMessage(msg, title, def, cncl));
00183     bool res = false;
00184
00185 #ifdef WIN32
00186     res = dlg->DoModal(IDD_PROMPTMESSAGE);
00187 #endif
00188 #ifdef qMacCvsPP
00189     res = dlg->DoModal(dlg_PromptCommand);
00190 #endif
00191
00192     return res;
00193 }

Generated on Sun Feb 24 01:21:42 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Authen.cpp File Reference

common/Authen.cpp File Reference

#include "stdafx.h"
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include "Authen.h"
#include "CvsPrefs.h"
#include "AppConsole.h"
#include "MultiFiles.h"
#include "PromptFiles.h"
#include "CvsArgs.h"
#include "TextBinary.h"
#include "uwidget.h"
#include "SmartComboBox.h"
#include <algorithm>
#include "resource.h"

Include dependency graph for Authen.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | UAuthen_Gserver
class | UAuthen_Kserver
class | UAuthen_Pserver
class | UAuthen_Rhosts
class | UAuthen_SSH
class | AuthenGserver
class | AuthenKserver
class | AuthenLocal
class | AuthenNtserver
class | AuthenPserver
class | AuthenRhosts
class | AuthenSSH

Functions

CPersistentT< AuthenKind > | gAuthenKind ("P_Authen", local, kNoClass)

Variables

Authen gAuthen
AuthenLocal localInstance
AuthenPserver pserverInstance
AuthenRhosts rhostsInstance
AuthenNtserver ntserverInstance
AuthenGserver gserverInstance
AuthenSSH sshInstance

Function Documentation

CPersistentT<AuthenKind> gAuthenKind | ( | "P_Authen" | ,
 |  | local | ,
 |  | kNoClass |
 | ) | [static]

Variable Documentation

Authen gAuthen

Definition at line 66 of file Authen.cpp.

AuthenGserver gserverInstance [static]

Definition at line 1620 of file Authen.cpp.

AuthenLocal localInstance [static]

Definition at line 1612 of file Authen.cpp.

AuthenNtserver ntserverInstance [static]

Definition at line 1619 of file Authen.cpp.

AuthenPserver pserverInstance [static]

Definition at line 1613 of file Authen.cpp.

AuthenRhosts rhostsInstance [static]

Definition at line 1614 of file Authen.cpp.

AuthenSSH sshInstance [static]

Definition at line 1626 of file Authen.cpp.

Generated on Sun Feb 24 01:21:42 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Authen.h File Reference

common/Authen.h File Reference

#include "MultiString.h"

Include dependency graph for Authen.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | Authen
Authentication class. More...

class | AuthenModel
Authentication model class. More...

Enumerations

enum AuthenKind {
rhosts,
pserver,
kserver,
local,
ssh,
ntserver,
gserver
}
Authentications. More...

Variables

Authen gAuthen

Enumeration Type Documentation

enum AuthenKind

Authentications.

Enum to specify the authentications supported

Enumeration values:
rhosts | .rhosts file (rsh)
pserver | pserver
kserver | kserver
local | local mount
ssh | ssh
ntserver | ntserver
gserver | gserver

Definition at line 32 of file Authen.h.

Referenced by AuthenModel::GetInstance, AuthenGserver::GetKind, AuthenNtserver::GetKind, AuthenKserver::GetKind, AuthenRhosts::GetKind, AuthenPserver::GetKind, AuthenSSH::GetKind, AuthenLocal::GetKind, Authen::kind, Authen::kindToNum, Authen::kindToToken, CvsPrefs::load, Authen::numToKind, Authen::setkind, Authen::token, and Authen::tokenToKind.

00033 {
00034     rhosts,
00035     pserver,
00036     kserver,
00037     local,
00038     ssh,
00039     ntserver,
00040     gserver
00041 } AuthenKind;

Variable Documentation

Authen gAuthen

Definition at line 103 of file Authen.h.

Generated on Sun Feb 24 01:21:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


BrowseViewColumn.cpp File Reference

common/BrowseViewColumn.cpp File Reference

#include "stdafx.h"
#include "BrowseViewColumn.h"
#include "CvsEntries.h"
#include <time.h>

Include dependency graph for BrowseViewColumn.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | KoConflictColumn
class | KoDateColumn
class | KoNameColumn
class | KoOptionColumn
class | KoPathColumn
class | KoRecursiveModel
class | KoRegularModel
class | KoRevisionColumn
class | KoStatusColumn
class | KoTagColumn

Defines

#define | _countof(array) (sizeof(array)/sizeof(array[0]))

Functions

time_t | get_date (const char *date, struct timeb *now)
void | SafeCopy (char *buffer, const char *value, int bufferSize)
bool | IsLargeFonts ()
int CALLBACK | _Compare (LPARAM data1, LPARAM data2, LPARAM data)

Variables

KoNameColumn nameColumn
KoPathColumn pathColumn
KoRevisionColumn revisionColumn
KoOptionColumn optionColumn
KoStatusColumn statusColumn
KoTagColumn tagColumn
KoDateColumn dateColumn
KoConflictColumn conflictColumn
const KiColumn * | columnsRegular []
const int | typesRegular []
const KiColumn * | columnsRecursive []
const int | typesRecursive []
KoRegularModel modelRegular
KoRecursiveModel modelRecursive

Define Documentation

#define _countof ( array ) (sizeof(array)/sizeof(array[0]))

Definition at line 36 of file BrowseViewColumn.cpp.

Referenced by KoRecursiveModel::GetCount, and KoRegularModel::GetCount.

Function Documentation

int CALLBACK _Compare | ( | LPARAM | data1,
 |  | LPARAM | data2,
 |  | LPARAM | data
 | ) |

Definition at line 610 of file BrowseViewColumn.cpp.

References KiColumn::Compare, ENT_SUBDIR, EntnodeData::GetType, CSortParam::m_column, CSortParam::m_columnAlt, CSortParam::m_context, CSortParam::m_fAccendant, and CSortParam::m_fGroupSubDir.

00614 {
00615     int res = 0;
00616     bool fOneDirOnly = false;
00617
00618     EntnodeData *d1 = (EntnodeData *)data1;
00619     EntnodeData *d2 = (EntnodeData *)data2;
00620
00621     const CSortParam *pSortParam = (CSortParam*)data;
00622
00623     //  Group sub dirs ?
00624     if (pSortParam->m_fGroupSubDir)
00625     {
00626         int d1IsDir = d1->GetType()==ENT_SUBDIR;
00627         int d2IsDir = d2->GetType()==ENT_SUBDIR;
00628
00629         if( (d1IsDir + d2IsDir) == 1)
00630         {
00631             //  One (and only one of them) is a directory
00632             fOneDirOnly = true;
00633             res = d1IsDir ? -1 : 1;
00634         }
00635     }
00636
00637     if (!res)
00638     {
00639         res = pSortParam->m_column->Compare(pSortParam->m_context, d1, d2);
00640     }
00641
00642     if (res==0 && pSortParam->m_column != pSortParam->m_columnAlt)
00643         res = pSortParam->m_columnAlt->Compare(pSortParam->m_context, d1, d2);
00644     else if (!fOneDirOnly)
00645         res = pSortParam->m_fAccendant ? -res : res;
00646     return res;
00647 }

time_t get_date | ( | const char * | date,
 |  | struct timeb * | now
 | ) |

Referenced by KoDateColumn::Compare.

bool IsLargeFonts ( ) [static]

Definition at line 55 of file BrowseViewColumn.cpp.

Referenced by KoDateColumn::GetSetupData.

00056 {
00057     //JK - large fonts support for Windows
00058     static bool bLargeFonts = false;
00059     static bool defined = false;
00060     if (!defined)
00061     {
00062         defined = true;
00063         HWND hDesktop = ::GetDesktopWindow();
00064         HDC hDesktopDC = ::GetDC(hDesktop);
00065         short nLogPixels = ::GetDeviceCaps(hDesktopDC, LOGPIXELSX);
00066         ::ReleaseDC(hDesktop, hDesktopDC);
00067         bLargeFonts = (nLogPixels > 96);
00068     }
00069     return bLargeFonts;
00070 }

void SafeCopy | ( | char * | buffer,
 |  | const char * | value,
 |  | int | bufferSize
 | ) | [static]

Definition at line 42 of file BrowseViewColumn.cpp.

Referenced by KoConflictColumn::GetText, KoDateColumn::GetText, KoTagColumn::GetText, KoStatusColumn::GetText, KoOptionColumn::GetText, KoRevisionColumn::GetText, KoPathColumn::GetText, and KoNameColumn::GetText.

00043 {
00044     if (value && *value)
00045     {
00046         strncpy(buffer, value, bufferSize);
00047     }
00048     else
00049     {
00050         *buffer = 0;
00051     }
00052 }

Variable Documentation

const KiColumn* columnsRecursive[] [static]

Initial value:

 {
    &nameColumn, &pathColumn, &revisionColumn, &optionColumn, &statusColumn, &tagColumn, &dateColumn, &conflictColumn
}

Definition at line 527 of file BrowseViewColumn.cpp.

const KiColumn* columnsRegular[] [static]

Initial value:

 {
    &nameColumn, &revisionColumn, &optionColumn, &statusColumn, &tagColumn, &dateColumn, &conflictColumn
}

Definition at line 518 of file BrowseViewColumn.cpp.

KoConflictColumn conflictColumn

KoDateColumn dateColumn

KoRecursiveModel modelRecursive

Referenced by KiColumnModel::GetRecursiveModel.

KoRegularModel modelRegular

Referenced by KiColumnModel::GetRegularModel.

KoNameColumn nameColumn

KoOptionColumn optionColumn

KoPathColumn pathColumn

KoRevisionColumn revisionColumn

KoStatusColumn statusColumn

KoTagColumn tagColumn

const int typesRecursive[] [static]

Initial value:

 {
    EntnodeData::kName, EntnodeFile::kPath, EntnodeFile::kVN, EntnodeFile::kOption, EntnodeData::kStatus,
    EntnodeFile::kTag, EntnodeFile::kTS, EntnodeFile::kConflict
}

Definition at line 531 of file BrowseViewColumn.cpp.

Referenced by KoRecursiveModel::GetType.

const int typesRegular[] [static]

Initial value:

 {
    EntnodeData::kName, EntnodeFile::kVN, EntnodeFile::kOption, EntnodeData::kStatus,
    EntnodeFile::kTag, EntnodeFile::kTS, EntnodeFile::kConflict
}

Definition at line 522 of file BrowseViewColumn.cpp.

Referenced by KoRegularModel::GetType.

Generated on Sun Feb 24 01:21:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


BrowseViewColumn.h File Reference

common/BrowseViewColumn.h File Reference

#include "ustr.h"

Include dependency graph for BrowseViewColumn.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | KiColumn
class | KiColumnModel
class | KoColumnContext
struct | CSortParam

Functions

int CALLBACK | _Compare (LPARAM data1, LPARAM data2, LPARAM data)

Function Documentation

int CALLBACK _Compare | ( | LPARAM | data1,
 |  | LPARAM | data2,
 |  | LPARAM | data
 | ) |

Definition at line 299 of file CustomizeMenus.cpp.

Referenced by CCustomizeMenus::OnInitDialog.

00300 {
00301     CustInvertTable *d1 = (CustInvertTable *)data1;
00302     CustInvertTable *d2 = (CustInvertTable *)data2;
00303
00304     CString s1(GetInvString(d1));
00305     CString s2(GetInvString(d2));
00306     int cmp = strcmp(s1, s2);
00307     if(cmp == 0)
00308         return 0;
00309     if(d1->cmd == ID_SEPARATOR)
00310         return -1;
00311     if(d2->cmd == ID_SEPARATOR)
00312         return 1;
00313     return cmp;
00314 }

Generated on Sun Feb 24 01:21:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


BrowseViewHandlers.h File Reference

common/BrowseViewHandlers.h File Reference

#include "CvsAlert.h"

Include dependency graph for BrowseViewHandlers.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | KiSelectionHandler
class | KoAddBinaryHandler
class | KoAddHandler
class | KoAddUnicodeHandler
class | KoAnnotateHandler
class | KoBranchTagHandler
class | KoCommitHandler
class | KoCreateTagHandler
class | KoDeleteTagHandler
class | KoDiffHandler
class | KoEditHandler
class | KoEditorsHandler
class | KoFileRemoveHandler
class | KoForceEditHandler
class | KoGraphHandler
class | KoLockHandler
class | KoLogHandler
class | KoMoveToTrashHandler
class | KoQueryUpdateHandler
class | KoReleaseHandler
class | KoReservedEditHandler
class | KoStatusHandler
class | KoUneditHandler
class | KoUnlockHandler
class | KoUpdateHandler
class | KoUpdateMoveToTrashHandler
class | KoWatchersHandler
class | KoWatchOffHandler
class | KoWatchOnHandler

Generated on Sun Feb 24 01:21:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


BrowseViewModel.cpp File Reference

common/BrowseViewModel.cpp File Reference

#include "stdafx.h"
#include "BrowseViewModel.h"
#include "Persistent.h"
#include "CvsEntries.h"

Include dependency graph for BrowseViewModel.cpp:

Include dependency graph

Go to the source code of this file.

Functions

CPersistentBool | persistentChanged ("P_ViewChanged", false)
CPersistentBool | persistentAdded ("P_ViewAdded", false)
CPersistentBool | persistentRemoved ("P_ViewRemoved", false)
CPersistentBool | persistentConflicts ("P_ViewConflicts", false)
CPersistentBool | persistentUnknown ("P_ViewUnknown", false)
CPersistentBool | persistentHideUnknown ("P_ViewHideUnknown", false)
CPersistentBool | persistentMissing ("P_ViewMissing", false)
CPersistentBool | persistentRecursive ("P_DisplayRecursive", false)
CPersistentBool | persistentIgnore ("P_FileViewIgnore", true)

Function Documentation

CPersistentBool persistentAdded | ( | "P_ViewAdded" | ,
 |  | false |
 | ) | [static]

CPersistentBool persistentChanged | ( | "P_ViewChanged" | ,
 |  | false |
 | ) | [static]

CPersistentBool persistentConflicts | ( | "P_ViewConflicts" | ,
 |  | false |
 | ) | [static]

CPersistentBool persistentHideUnknown | ( | "P_ViewHideUnknown" | ,
 |  | false |
 | ) | [static]

CPersistentBool persistentIgnore | ( | "P_FileViewIgnore" | ,
 |  | true |
 | ) | [static]

CPersistentBool persistentMissing | ( | "P_ViewMissing" | ,
 |  | false |
 | ) | [static]

CPersistentBool persistentRecursive | ( | "P_DisplayRecursive" | ,
 |  | false |
 | ) | [static]

CPersistentBool persistentRemoved | ( | "P_ViewRemoved" | ,
 |  | false |
 | ) | [static]

CPersistentBool persistentUnknown | ( | "P_ViewUnknown" | ,
 |  | false |
 | ) | [static]

Generated on Sun Feb 24 01:21:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


BrowseViewModel.h File Reference

common/BrowseViewModel.h File Reference

#include "UStr.h"
#include <vector>

Include dependency graph for BrowseViewModel.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | KiFilterModel
class | KiIgnoreModel
class | KiRecursionModel
class | KoFilterModel
class | KoIgnoreModel
class | KoRecursionModel
struct | NotificationManager::Node
class | NotificationManager

Typedefs

typedef void(* | FNOBSERVER )(CObject *)

Typedef Documentation

typedef void(* FNOBSERVER)(CObject*)

Definition at line 31 of file BrowseViewModel.h.

Referenced by NotificationManager::CheckIn, and NotificationManager::Node::Node.

Generated on Sun Feb 24 01:21:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CheckoutDlg.cpp File Reference

common/CheckoutDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include <sys\stat.h>
#include <direct.h>
#include <errno.h>
#include "CheckoutDlg.h"
#include "CvsPrefs.h"
#include "UpdateDlg.h"
#include "MultiString.h"
#include "PromptFiles.h"
#include "GetPrefs.h"

Include dependency graph for CheckoutDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

CMString | gOldModules (10,"P_OldModules")
bool | CompatGetCheckout (UPStr &modname, UPStr &path, bool &norecurs, bool &toStdout, UPStr &date, UPStr &rev, bool &useMostRecent, UPStr &rev1, UPStr &rev2, bool &doexport, bool &forceCvsroot, bool &overrideCheckoutDir, UPStr &checkoutDir)

Function Documentation

bool CompatGetCheckout | ( | UPStr & | modname,
 |  | UPStr & | path,
 |  | bool & | norecurs,
 |  | bool & | toStdout,
 |  | UPStr & | date,
 |  | UPStr & | rev,
 |  | bool & | useMostRecent,
 |  | UPStr & | rev1,
 |  | UPStr & | rev2,
 |  | bool & | doexport,
 |  | bool & | forceCvsroot,
 |  | bool & | overrideCheckoutDir,
 |  | UPStr & | checkoutDir
 | ) |

Definition at line 596 of file CheckoutDlg.cpp.

References BrowserGetDirectory, CPStr, EV_INIT_WIDGET, kUMainWidget, CCheckout_MAIN::m_checkoutDir, CCheckout_OPTIONS::m_date, CUpdateMerge::m_date1, CUpdateMerge::m_date2, CCheckout_OPTIONS::m_export, CCheckout_OPTIONS::m_forceRoot, CCheckout_OPTIONS::m_hasDate, CUpdateMerge::m_hasDate1, CUpdateMerge::m_hasDate2, CCheckout_OPTIONS::m_hasRev, CCheckout_OPTIONS::m_match, CUpdateMerge::m_merge, CCheckout_MAIN::m_moduleName, CCheckout_MAIN::m_noRecurse, CCheckout_MAIN::m_overrideCheckoutDir, CCheckout_MAIN::m_path, CCheckout_OPTIONS::m_rev, CUpdateMerge::m_rev1, CUpdateMerge::m_rev2, CCheckout_MAIN::m_stdout, CGetPrefs_GLOBALS::StoreValues, CGetPrefs_CVSROOT::StoreValues, TRUE, UCreate_CheckoutDlg, and UEventSendMessage.

00602 {
00603     bool userHitOK = false;
00604
00605     date = "";
00606     rev = "";
00607     modname = "";
00608     norecurs = false;
00609     toStdout = false;
00610     useMostRecent = false;
00611     doexport = false;
00612     forceCvsroot = false;
00613     overrideCheckoutDir = false;
00614
00615     static CPStr sLastModName;
00616     static CPStr sLastRev;
00617     static CPStr sLastDate;
00618     static CPStr sLastRev1;
00619     static CPStr sLastRev2;
00620     static CPStr sLastDate1;
00621     static CPStr sLastDate2;
00622
00623     bool hasDate = false;
00624     bool hasRev = false;
00625     bool merge1 = false;
00626     bool merge2 = false;
00627     bool hasDate1 = false;
00628     bool hasDate2 = false;
00629
00630 #ifdef WIN32
00631     CPropertySheet pages("Checkout settings");
00632     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00633     CCheckout_MAIN page1(sLastModName, path);
00634     CCheckout_OPTIONS page2(sLastRev, sLastDate);
00635     CUpdateMerge page3(true, sLastRev1, sLastRev2, sLastDate1, sLastDate2);
00636     CGetPrefs_CVSROOT page4;
00637     CGetPrefs_GLOBALS page5;
00638     pages.AddPage(&page1);
00639     pages.AddPage(&page2);
00640     pages.AddPage(&page3);
00641     pages.AddPage(&page4);
00642     pages.AddPage(&page5);
00643     if(pages.DoModal() == IDOK)
00644     {
00645         sLastModName = (const char *)page1.m_moduleName;
00646         path = (const char *)page1.m_path;
00647         norecurs = page1.m_noRecurse == TRUE;
00648         toStdout = page1.m_stdout == TRUE;
00649         overrideCheckoutDir = page1.m_overrideCheckoutDir == TRUE;
00650         checkoutDir = (const char *)page1.m_checkoutDir;
00651
00652         sLastDate = page2.m_date;
00653         sLastRev = page2.m_rev;
00654         hasDate = page2.m_hasDate == TRUE;
00655         hasRev = page2.m_hasRev == TRUE;
00656         useMostRecent = page2.m_match == TRUE;
00657         doexport = page2.m_export == TRUE;
00658         forceCvsroot = page2.m_forceRoot == TRUE;
00659
00660         merge1 = page3.m_merge >= 1;
00661         merge2 = page3.m_merge == 2;
00662         sLastRev1 = page3.m_rev1;
00663         sLastRev2 = page3.m_rev2;
00664         hasDate1 = page3.m_hasDate1 == TRUE;
00665         hasDate2 = page3.m_hasDate2 == TRUE;
00666         sLastDate1 = page3.m_date1;
00667         sLastDate2 = page3.m_date2;
00668
00669         page4.StoreValues();
00670         page5.StoreValues();
00671         userHitOK = true;
00672     }
00673 #endif /* WIN32 */
00674 #ifdef qMacCvsPP
00675     StDialogHandler theHandler(dlg_Checkout, LCommander::GetTopCommander());
00676     LWindow *theDialog = theHandler.GetDialog();
00677     ThrowIfNil_(theDialog);
00678     static UInt16 sRuntimePanel = 1;
00679
00680     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00681         (theDialog->FindPaneByID(item_MultiViewPrefs));
00682     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00683
00684     multiView->SwitchToPanel(3);
00685     DoDataExchange_Globals(theDialog, true);
00686     multiView->SwitchToPanel(2);
00687     DoDataExchange_CheckoutOptions(theDialog, hasDate, hasRev,
00688         sLastDate, sLastRev, useMostRecent, doexport, forceCvsroot, true);
00689     multiView->SwitchToPanel(1);
00690     DoDataExchange_CheckoutMain(theDialog, sLastModName, norecurs, toStdout, overrideCheckoutDir, checkoutDir, true);
00691     dynamic_cast<LBroadcaster*> (theDialog->FindPaneByID (item_EditPath))->AddListener (&theHandler);
00692     dynamic_cast<LBroadcaster*> (theDialog->FindPaneByID (item_CheckGroupPath))->AddListener (&theHandler);
00693
00694
00695     groupView->SetValue(sRuntimePanel);
00696     theDialog->Show();
00697     MessageT hitMessage;
00698     while (true)
00699     {       // Let DialogHandler process events
00700         hitMessage = theHandler.DoDialog();
00701
00702         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00703             break;
00704
00705         if(hitMessage == item_CheckGroupPath || hitMessage == item_EditPath)
00706         {
00707             if(theDialog->GetValueForPaneID(item_CheckGroupPath) == Button_Off)
00708             {
00709                 continue;
00710             }
00711
00712             const char* dir = BrowserGetDirectory("Select the checkout directory :");
00713             if(dir != 0L)
00714             {
00715                 CPStr tmp(dir);
00716                 theDialog->SetDescriptorForPaneID(item_EditPath, tmp);
00717             }
00718             else if(hitMessage == item_CheckGroupPath)
00719             {
00720                 theDialog->SetValueForPaneID(item_CheckGroupPath, Button_Off);
00721             }
00722         }
00723     }
00724     theDialog->Hide();
00725     sRuntimePanel = groupView->GetValue();
00726
00727     if(hitMessage == msg_OK)
00728     {
00729         multiView->SwitchToPanel(1);
00730         DoDataExchange_CheckoutMain(theDialog, sLastModName, norecurs, toStdout, overrideCheckoutDir, checkoutDir, false);
00731         multiView->SwitchToPanel(2);
00732         DoDataExchange_CheckoutOptions(theDialog, hasDate, hasRev,
00733             sLastDate, sLastRev, useMostRecent, doexport, forceCvsroot, false);
00734         multiView->SwitchToPanel(3);
00735         DoDataExchange_Globals(theDialog, false);
00736
00737         Assert_(sLastModName.length() != 0);
00738
00739         userHitOK = true;
00740     }
00741 #endif /* qMacCvsPP */
00742 #if qUnix
00743     void *wid = UCreate_CheckoutDlg();
00744
00745     UCvsCheckout *dlg = new UCvsCheckout();
00746     UCvsCheckout_MAIN *tab1 = new UCvsCheckout_MAIN(sLastModName, path);
00747     UCvsCheckout_STICKY *tab2 = new UCvsCheckout_STICKY(sLastRev, sLastDate);
00748     UCvsCheckout_OPTIONS *tab3 = new UCvsCheckout_OPTIONS();
00749     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00750     dlg->AddPage(tab1, UCvsCheckout::kTabGeneral, 0);
00751     dlg->AddPage(tab2, UCvsCheckout::kTabGeneral, 1);
00752     dlg->AddPage(tab3, UCvsCheckout::kTabGeneral, 2);
00753
00754     if(dlg->DoModal())
00755     {
00756         sLastModName = tab1->m_modname;
00757         path = tab1->m_path;
00758         norecurs = tab1->m_norecurs;
00759         toStdout = tab1->m_stdout;
00760
00761         sLastDate = tab2->m_date;
00762         sLastRev = tab2->m_rev;
00763         hasDate = tab2->m_hasdate;
00764         hasRev = tab2->m_hasrev;
00765         useMostRecent = tab2->m_match;
00766
00767         doexport = tab3->m_export;
00768         forceCvsroot = tab3->m_forceroot;
00769
00770         userHitOK = true;
00771     }
00772
00773     delete dlg;
00774 #endif // qUnix
00775
00776     if(userHitOK)
00777     {
00778         if(hasDate && !sLastDate.empty())
00779             date = sLastDate;
00780
00781         if(hasRev && !sLastRev.empty())
00782             rev = sLastRev;
00783
00784         modname = sLastModName;
00785
00786         if(merge1 && merge2 && !sLastRev1.empty() && !sLastRev2.empty())
00787         {
00788             rev1 = sLastRev1;
00789             rev2 = sLastRev2;
00790
00791             if( hasDate1 )
00792                 rev1 << ":" << sLastDate1;
00793
00794             if( hasDate2 )
00795                 rev2 << ":" << sLastDate2;
00796
00797         }
00798
00799         if(merge1 && !merge2 && !sLastRev1.empty())
00800         {
00801             rev1 = sLastRev1;
00802
00803             if( hasDate1 )
00804                 rev1 << ":" << sLastDate1;
00805         }
00806
00807         gCvsPrefs.save();
00808     }
00809
00810     return userHitOK;
00811 }

CMString gOldModules | ( | 10 | ,
 |  | "P_OldModules" |
 | ) |

Generated on Sun Feb 24 01:21:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CheckoutDlg.h File Reference

common/CheckoutDlg.h File Reference

#include "CPStr.h"
#include "MultiString.h"
#include "SmartComboBox.h"

Include dependency graph for CheckoutDlg.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCheckout_MAIN
class | CCheckout_OPTIONS

Defines

#define | AFX_CHECKOUTDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Functions

bool | CompatGetCheckout (UPStr &modname, UPStr &path, bool &norecurs, bool &toStdout, UPStr &date, UPStr &rev, bool &useMostRecent, UPStr &rev1, UPStr &rev2, bool &doexport, bool &forceCvsroot, bool &overrideCheckoutDir, UPStr &checkoutDir)

Variables

CMString gOldModules

Define Documentation

#define AFX_CHECKOUTDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Definition at line 26 of file CheckoutDlg.h.

Function Documentation

bool CompatGetCheckout | ( | UPStr & | modname,
 |  | UPStr & | path,
 |  | bool & | norecurs,
 |  | bool & | toStdout,
 |  | UPStr & | date,
 |  | UPStr & | rev,
 |  | bool & | useMostRecent,
 |  | UPStr & | rev1,
 |  | UPStr & | rev2,
 |  | bool & | doexport,
 |  | bool & | forceCvsroot,
 |  | bool & | overrideCheckoutDir,
 |  | UPStr & | checkoutDir
 | ) |

Definition at line 596 of file CheckoutDlg.cpp.

Referenced by CvsCmdCheckoutModule.

00602 {
00603     bool userHitOK = false;
00604
00605     date = "";
00606     rev = "";
00607     modname = "";
00608     norecurs = false;
00609     toStdout = false;
00610     useMostRecent = false;
00611     doexport = false;
00612     forceCvsroot = false;
00613     overrideCheckoutDir = false;
00614
00615     static CPStr sLastModName;
00616     static CPStr sLastRev;
00617     static CPStr sLastDate;
00618     static CPStr sLastRev1;
00619     static CPStr sLastRev2;
00620     static CPStr sLastDate1;
00621     static CPStr sLastDate2;
00622
00623     bool hasDate = false;
00624     bool hasRev = false;
00625     bool merge1 = false;
00626     bool merge2 = false;
00627     bool hasDate1 = false;
00628     bool hasDate2 = false;
00629
00630 #ifdef WIN32
00631     CPropertySheet pages("Checkout settings");
00632     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00633     CCheckout_MAIN page1(sLastModName, path);
00634     CCheckout_OPTIONS page2(sLastRev, sLastDate);
00635     CUpdateMerge page3(true, sLastRev1, sLastRev2, sLastDate1, sLastDate2);
00636     CGetPrefs_CVSROOT page4;
00637     CGetPrefs_GLOBALS page5;
00638     pages.AddPage(&page1);
00639     pages.AddPage(&page2);
00640     pages.AddPage(&page3);
00641     pages.AddPage(&page4);
00642     pages.AddPage(&page5);
00643     if(pages.DoModal() == IDOK)
00644     {
00645         sLastModName = (const char *)page1.m_moduleName;
00646         path = (const char *)page1.m_path;
00647         norecurs = page1.m_noRecurse == TRUE;
00648         toStdout = page1.m_stdout == TRUE;
00649         overrideCheckoutDir = page1.m_overrideCheckoutDir == TRUE;
00650         checkoutDir = (const char *)page1.m_checkoutDir;
00651
00652         sLastDate = page2.m_date;
00653         sLastRev = page2.m_rev;
00654         hasDate = page2.m_hasDate == TRUE;
00655         hasRev = page2.m_hasRev == TRUE;
00656         useMostRecent = page2.m_match == TRUE;
00657         doexport = page2.m_export == TRUE;
00658         forceCvsroot = page2.m_forceRoot == TRUE;
00659
00660         merge1 = page3.m_merge >= 1;
00661         merge2 = page3.m_merge == 2;
00662         sLastRev1 = page3.m_rev1;
00663         sLastRev2 = page3.m_rev2;
00664         hasDate1 = page3.m_hasDate1 == TRUE;
00665         hasDate2 = page3.m_hasDate2 == TRUE;
00666         sLastDate1 = page3.m_date1;
00667         sLastDate2 = page3.m_date2;
00668
00669         page4.StoreValues();
00670         page5.StoreValues();
00671         userHitOK = true;
00672     }
00673 #endif /* WIN32 */
00674 #ifdef qMacCvsPP
00675     StDialogHandler theHandler(dlg_Checkout, LCommander::GetTopCommander());
00676     LWindow *theDialog = theHandler.GetDialog();
00677     ThrowIfNil_(theDialog);
00678     static UInt16 sRuntimePanel = 1;
00679
00680     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00681         (theDialog->FindPaneByID(item_MultiViewPrefs));
00682     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00683
00684     multiView->SwitchToPanel(3);
00685     DoDataExchange_Globals(theDialog, true);
00686     multiView->SwitchToPanel(2);
00687     DoDataExchange_CheckoutOptions(theDialog, hasDate, hasRev,
00688         sLastDate, sLastRev, useMostRecent, doexport, forceCvsroot, true);
00689     multiView->SwitchToPanel(1);
00690     DoDataExchange_CheckoutMain(theDialog, sLastModName, norecurs, toStdout, overrideCheckoutDir, checkoutDir, true);
00691     dynamic_cast<LBroadcaster*> (theDialog->FindPaneByID (item_EditPath))->AddListener (&theHandler);
00692     dynamic_cast<LBroadcaster*> (theDialog->FindPaneByID (item_CheckGroupPath))->AddListener (&theHandler);
00693
00694
00695     groupView->SetValue(sRuntimePanel);
00696     theDialog->Show();
00697     MessageT hitMessage;
00698     while (true)
00699     {       // Let DialogHandler process events
00700         hitMessage = theHandler.DoDialog();
00701
00702         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00703             break;
00704
00705         if(hitMessage == item_CheckGroupPath || hitMessage == item_EditPath)
00706         {
00707             if(theDialog->GetValueForPaneID(item_CheckGroupPath) == Button_Off)
00708             {
00709                 continue;
00710             }
00711
00712             const char* dir = BrowserGetDirectory("Select the checkout directory :");
00713             if(dir != 0L)
00714             {
00715                 CPStr tmp(dir);
00716                 theDialog->SetDescriptorForPaneID(item_EditPath, tmp);
00717             }
00718             else if(hitMessage == item_CheckGroupPath)
00719             {
00720                 theDialog->SetValueForPaneID(item_CheckGroupPath, Button_Off);
00721             }
00722         }
00723     }
00724     theDialog->Hide();
00725     sRuntimePanel = groupView->GetValue();
00726
00727     if(hitMessage == msg_OK)
00728     {
00729         multiView->SwitchToPanel(1);
00730         DoDataExchange_CheckoutMain(theDialog, sLastModName, norecurs, toStdout, overrideCheckoutDir, checkoutDir, false);
00731         multiView->SwitchToPanel(2);
00732         DoDataExchange_CheckoutOptions(theDialog, hasDate, hasRev,
00733             sLastDate, sLastRev, useMostRecent, doexport, forceCvsroot, false);
00734         multiView->SwitchToPanel(3);
00735         DoDataExchange_Globals(theDialog, false);
00736
00737         Assert_(sLastModName.length() != 0);
00738
00739         userHitOK = true;
00740     }
00741 #endif /* qMacCvsPP */
00742 #if qUnix
00743     void *wid = UCreate_CheckoutDlg();
00744
00745     UCvsCheckout *dlg = new UCvsCheckout();
00746     UCvsCheckout_MAIN *tab1 = new UCvsCheckout_MAIN(sLastModName, path);
00747     UCvsCheckout_STICKY *tab2 = new UCvsCheckout_STICKY(sLastRev, sLastDate);
00748     UCvsCheckout_OPTIONS *tab3 = new UCvsCheckout_OPTIONS();
00749     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00750     dlg->AddPage(tab1, UCvsCheckout::kTabGeneral, 0);
00751     dlg->AddPage(tab2, UCvsCheckout::kTabGeneral, 1);
00752     dlg->AddPage(tab3, UCvsCheckout::kTabGeneral, 2);
00753
00754     if(dlg->DoModal())
00755     {
00756         sLastModName = tab1->m_modname;
00757         path = tab1->m_path;
00758         norecurs = tab1->m_norecurs;
00759         toStdout = tab1->m_stdout;
00760
00761         sLastDate = tab2->m_date;
00762         sLastRev = tab2->m_rev;
00763         hasDate = tab2->m_hasdate;
00764         hasRev = tab2->m_hasrev;
00765         useMostRecent = tab2->m_match;
00766
00767         doexport = tab3->m_export;
00768         forceCvsroot = tab3->m_forceroot;
00769
00770         userHitOK = true;
00771     }
00772
00773     delete dlg;
00774 #endif // qUnix
00775
00776     if(userHitOK)
00777     {
00778         if(hasDate && !sLastDate.empty())
00779             date = sLastDate;
00780
00781         if(hasRev && !sLastRev.empty())
00782             rev = sLastRev;
00783
00784         modname = sLastModName;
00785
00786         if(merge1 && merge2 && !sLastRev1.empty() && !sLastRev2.empty())
00787         {
00788             rev1 = sLastRev1;
00789             rev2 = sLastRev2;
00790
00791             if( hasDate1 )
00792                 rev1 << ":" << sLastDate1;
00793
00794             if( hasDate2 )
00795                 rev2 << ":" << sLastDate2;
00796
00797         }
00798
00799         if(merge1 && !merge2 && !sLastRev1.empty())
00800         {
00801             rev1 = sLastRev1;
00802
00803             if( hasDate1 )
00804                 rev1 << ":" << sLastDate1;
00805         }
00806
00807         gCvsPrefs.save();
00808     }
00809
00810     return userHitOK;
00811 }

Variable Documentation

CMString gOldModules

Definition at line 44 of file CheckoutDlg.h.

Generated on Sun Feb 24 01:21:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CommitDlg.cpp File Reference

common/CommitDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include <process.h>
#include "CommitDlg.h"
#include "CvsPrefs.h"
#include "getline.h"
#include "TextBinary.h"
#include "MultiString.h"
#include "CvsCommands.h"
#include "EditorMonDlg.h"
#include "GetPrefs.h"

Include dependency graph for CommitDlg.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | HOWMUCH_WORDS 5

Functions

CMString | gCommitLogs (10,"P_CommitLogs")
CPersistentBool | gCheckValidEdits ("P_CheckValidEdits", false)
void | combozify (UStr &str)
bool | CompatGetCommit (UStr &commit, bool &norecurs, bool &forceCommit, bool &forceRecurse, UPStr &rev, bool &noModuleProgram, bool &checkValidEdits, const char *pathTmpl, MultiFiles *mf)

Define Documentation

#define HOWMUCH_WORDS 5

Function Documentation

void combozify ( UStr & str )

Definition at line 60 of file CommitDlg.cpp.

References CStr.

00061 {
00062     // extract the first xxx words
00063     const char *tmp = str;
00064     CStr result;
00065     int numWords = 0;
00066 #   define HOWMUCH_WORDS 5
00067     while(*tmp != '\0' && numWords < HOWMUCH_WORDS)
00068     {
00069         while(*tmp != '\0' && isspace(*tmp))
00070             tmp++;
00071
00072         while(*tmp != '\0' && !isspace(*tmp))
00073             result << *tmp ++;
00074
00075         if(*tmp != '\0')
00076             result << ' ';
00077
00078         numWords++;
00079     }
00080
00081     if(*tmp != '\0')
00082     {
00083         result << "...";
00084     }
00085     str = result;
00086 }

bool CompatGetCommit | ( | UStr & | commit,
 |  | bool & | norecurs,
 |  | bool & | forceCommit,
 |  | bool & | forceRecurse,
 |  | UPStr & | rev,
 |  | bool & | noModuleProgram,
 |  | bool & | checkValidEdits,
 |  | const char * | pathTmpl,
 |  | MultiFiles * | mf
 | ) |

Definition at line 800 of file CommitDlg.cpp.

References CPStr, CStr, EV_INIT_WIDGET, kUMainWidget, CCommit_OPTIONS::m_checkValidEdits, CCommit_OPTIONS::m_forceCommit, CCommit_OPTIONS::m_forceRecurse, CCommit_OPTIONS::m_forceRevision, CCommit_MAIN::m_logMsg, CCommit_OPTIONS::m_noModuleProgram, CCommit_OPTIONS::m_noRecurse, CCommit_OPTIONS::m_rev, CGetPrefs_GLOBALS::StoreValues, UCreate_CommitDlg, and UEventSendMessage.

00805 {
00806     bool userHitOK = false;
00807
00808     static CStr sLastMsg;
00809     static CPStr sLastRev;
00810
00811     bool hasRev = false;
00812
00813     norecurs = false;
00814     commit = "";
00815     forceCommit = false;
00816     forceRecurse = false;
00817     rev = "";
00818     noModuleProgram = false;
00819     checkValidEdits = (bool)gCheckValidEdits;
00820
00821 #ifdef WIN32
00822     CPropertySheet pages("Commit settings");
00823     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00824     CCommit_MAIN page1(sLastMsg, pathTmpl, mf);
00825     CCommit_OPTIONS page2;
00826     CGetPrefs_GLOBALS page3;
00827     pages.AddPage(&page1);
00828     pages.AddPage(&page2);
00829     pages.AddPage(&page3);
00830     if(pages.DoModal() == IDOK)
00831     {
00832         commit = (const char *)page1.m_logMsg;
00833         sLastMsg = (const char *)page1.m_logMsg;
00834         norecurs = page2.m_noRecurse ? true : false;
00835         forceCommit = page2.m_forceCommit ? true : false;
00836         forceRecurse = page2.m_forceRecurse ? true : false;
00837         hasRev = page2.m_forceRevision ? true : false;
00838         sLastRev = page2.m_rev;
00839         noModuleProgram = page2.m_noModuleProgram ? true : false;
00840         gCheckValidEdits = page2.m_checkValidEdits ? true : false;
00841         page3.StoreValues();
00842
00843         userHitOK = true;
00844     }
00845 #endif /* WIN32 */
00846 #ifdef qMacCvsPP
00847     StDialogHandler theHandler(dlg_Commit, LCommander::GetTopCommander());
00848     LWindow *theDialog = theHandler.GetDialog();
00849     ThrowIfNil_(theDialog);
00850     static UInt16 sRuntimePanel = 1;
00851
00852     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00853         (theDialog->FindPaneByID(item_MultiViewPrefs));
00854     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00855
00856     multiView->SwitchToPanel(3);
00857     DoDataExchange_Globals(theDialog, true);
00858     multiView->SwitchToPanel(2);
00859     DoDataExchange_CommitOptions(theDialog, forceCommit, forceRecurse, hasRev, sLastRev, noModuleProgram, true);
00860     multiView->SwitchToPanel(1);
00861     DoDataExchange_Commit(theDialog, sLastMsg, norecurs, pathTmpl, true);
00862
00863     groupView->SetValue(sRuntimePanel);
00864     theDialog->Show();
00865     MessageT hitMessage;
00866     while (true)
00867     {       // Let DialogHandler process events
00868         hitMessage = theHandler.DoDialog();
00869
00870         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00871             break;
00872     }
00873     theDialog->Hide();
00874     sRuntimePanel = groupView->GetValue();
00875
00876     if(hitMessage == msg_OK)
00877     {
00878         multiView->SwitchToPanel(1);
00879         DoDataExchange_Commit(theDialog, sLastMsg, norecurs, pathTmpl, false);
00880         multiView->SwitchToPanel(2);
00881         DoDataExchange_CommitOptions(theDialog, forceCommit, forceRecurse, hasRev, sLastRev, noModuleProgram, false);
00882         multiView->SwitchToPanel(3);
00883         DoDataExchange_Globals(theDialog, false);
00884         commit = sLastMsg;
00885         commit.replace('\015', '\012');
00886         userHitOK = true;
00887     }
00888 #endif /* qMacCvsPP */
00889 #if qUnix
00890     void *wid = UCreate_CommitDlg();
00891
00892     UCvsCommit *dlg = new UCvsCommit();
00893     UCvsCommit_MAIN *tab1 = new UCvsCommit_MAIN(sLastMsg, pathTmpl);
00894     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00895     dlg->AddPage(tab1, UCvsCommit::kTabGeneral, 0);
00896
00897     if(dlg->DoModal())
00898     {
00899         commit = tab1->m_logmsg;
00900         sLastMsg = tab1->m_logmsg;
00901         norecurs = tab1->m_norecurs;
00902
00903         userHitOK = true;
00904     }
00905
00906     delete dlg;
00907 #endif // qUnix
00908
00909     if(userHitOK)
00910     {
00911         if(commit.length() == 0)
00912             commit = "no message";
00913
00914         if(hasRev && !sLastRev.empty())
00915             rev = sLastRev;
00916
00917         checkValidEdits = (bool)gCheckValidEdits;
00918
00919         gCvsPrefs.save();
00920     }
00921
00922     return userHitOK;
00923 }

CPersistentBool gCheckValidEdits | ( | "P_CheckValidEdits" | ,
 |  | false |
 | ) | [static]

CMString gCommitLogs | ( | 10 | ,
 |  | "P_CommitLogs" |
 | ) | [static]

Generated on Sun Feb 24 01:21:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CommitDlg.h File Reference

common/CommitDlg.h File Reference

#include "CPStr.h"
#include "MultiString.h"
#include "MultiFiles.h"
#include "SmartComboBox.h"

Include dependency graph for CommitDlg.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCommit_MAIN
class | CCommit_OPTIONS

Defines

#define | AFX_COMMITDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Functions

bool | CompatGetCommit (UStr &commit, bool &norecurs, bool &forceCommit, bool &forceRecurse, UPStr &rev, bool &noModuleProgram, bool &checkValidEdits, const char *pathTmpl=0L, MultiFiles *mf=0L)
void | combozify (UStr &str)

Variables

CMString gRevNames

Define Documentation

#define AFX_COMMITDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Definition at line 26 of file CommitDlg.h.

Function Documentation

void combozify ( UStr & str )

Definition at line 60 of file CommitDlg.cpp.

References CCommit_MAIN::IDD, and IDD_COMMIT_MAIN.

00061 {
00062     // extract the first xxx words
00063     const char *tmp = str;
00064     CStr result;
00065     int numWords = 0;
00066 #   define HOWMUCH_WORDS 5
00067     while(*tmp != '\0' && numWords < HOWMUCH_WORDS)
00068     {
00069         while(*tmp != '\0' && isspace(*tmp))
00070             tmp++;
00071
00072         while(*tmp != '\0' && !isspace(*tmp))
00073             result << *tmp ++;
00074
00075         if(*tmp != '\0')
00076             result << ' ';
00077
00078         numWords++;
00079     }
00080
00081     if(*tmp != '\0')
00082     {
00083         result << "...";
00084     }
00085     str = result;
00086 }

bool CompatGetCommit | ( | UStr & | commit,
 |  | bool & | norecurs,
 |  | bool & | forceCommit,
 |  | bool & | forceRecurse,
 |  | UPStr & | rev,
 |  | bool & | noModuleProgram,
 |  | bool & | checkValidEdits,
 |  | const char * | pathTmpl = 0L,
 |  | MultiFiles * | mf = 0L
 | ) |

Definition at line 800 of file CommitDlg.cpp.

Referenced by CvsCmdCommitFiles, and CvsCmdCommitFolder.

00805 {
00806     bool userHitOK = false;
00807
00808     static CStr sLastMsg;
00809     static CPStr sLastRev;
00810
00811     bool hasRev = false;
00812
00813     norecurs = false;
00814     commit = "";
00815     forceCommit = false;
00816     forceRecurse = false;
00817     rev = "";
00818     noModuleProgram = false;
00819     checkValidEdits = (bool)gCheckValidEdits;
00820
00821 #ifdef WIN32
00822     CPropertySheet pages("Commit settings");
00823     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00824     CCommit_MAIN page1(sLastMsg, pathTmpl, mf);
00825     CCommit_OPTIONS page2;
00826     CGetPrefs_GLOBALS page3;
00827     pages.AddPage(&page1);
00828     pages.AddPage(&page2);
00829     pages.AddPage(&page3);
00830     if(pages.DoModal() == IDOK)
00831     {
00832         commit = (const char *)page1.m_logMsg;
00833         sLastMsg = (const char *)page1.m_logMsg;
00834         norecurs = page2.m_noRecurse ? true : false;
00835         forceCommit = page2.m_forceCommit ? true : false;
00836         forceRecurse = page2.m_forceRecurse ? true : false;
00837         hasRev = page2.m_forceRevision ? true : false;
00838         sLastRev = page2.m_rev;
00839         noModuleProgram = page2.m_noModuleProgram ? true : false;
00840         gCheckValidEdits = page2.m_checkValidEdits ? true : false;
00841         page3.StoreValues();
00842
00843         userHitOK = true;
00844     }
00845 #endif /* WIN32 */
00846 #ifdef qMacCvsPP
00847     StDialogHandler theHandler(dlg_Commit, LCommander::GetTopCommander());
00848     LWindow *theDialog = theHandler.GetDialog();
00849     ThrowIfNil_(theDialog);
00850     static UInt16 sRuntimePanel = 1;
00851
00852     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00853         (theDialog->FindPaneByID(item_MultiViewPrefs));
00854     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00855
00856     multiView->SwitchToPanel(3);
00857     DoDataExchange_Globals(theDialog, true);
00858     multiView->SwitchToPanel(2);
00859     DoDataExchange_CommitOptions(theDialog, forceCommit, forceRecurse, hasRev, sLastRev, noModuleProgram, true);
00860     multiView->SwitchToPanel(1);
00861     DoDataExchange_Commit(theDialog, sLastMsg, norecurs, pathTmpl, true);
00862
00863     groupView->SetValue(sRuntimePanel);
00864     theDialog->Show();
00865     MessageT hitMessage;
00866     while (true)
00867     {       // Let DialogHandler process events
00868         hitMessage = theHandler.DoDialog();
00869
00870         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00871             break;
00872     }
00873     theDialog->Hide();
00874     sRuntimePanel = groupView->GetValue();
00875
00876     if(hitMessage == msg_OK)
00877     {
00878         multiView->SwitchToPanel(1);
00879         DoDataExchange_Commit(theDialog, sLastMsg, norecurs, pathTmpl, false);
00880         multiView->SwitchToPanel(2);
00881         DoDataExchange_CommitOptions(theDialog, forceCommit, forceRecurse, hasRev, sLastRev, noModuleProgram, false);
00882         multiView->SwitchToPanel(3);
00883         DoDataExchange_Globals(theDialog, false);
00884         commit = sLastMsg;
00885         commit.replace('\015', '\012');
00886         userHitOK = true;
00887     }
00888 #endif /* qMacCvsPP */
00889 #if qUnix
00890     void *wid = UCreate_CommitDlg();
00891
00892     UCvsCommit *dlg = new UCvsCommit();
00893     UCvsCommit_MAIN *tab1 = new UCvsCommit_MAIN(sLastMsg, pathTmpl);
00894     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00895     dlg->AddPage(tab1, UCvsCommit::kTabGeneral, 0);
00896
00897     if(dlg->DoModal())
00898     {
00899         commit = tab1->m_logmsg;
00900         sLastMsg = tab1->m_logmsg;
00901         norecurs = tab1->m_norecurs;
00902
00903         userHitOK = true;
00904     }
00905
00906     delete dlg;
00907 #endif // qUnix
00908
00909     if(userHitOK)
00910     {
00911         if(commit.length() == 0)
00912             commit = "no message";
00913
00914         if(hasRev && !sLastRev.empty())
00915             rev = sLastRev;
00916
00917         checkValidEdits = (bool)gCheckValidEdits;
00918
00919         gCvsPrefs.save();
00920     }
00921
00922     return userHitOK;
00923 }

Variable Documentation

CMString gRevNames

Definition at line 48 of file CommitDlg.h.

Generated on Sun Feb 24 01:21:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CPStr.cpp File Reference

common/CPStr.cpp File Reference

#include "stdafx.h"
#include "CPStr.h"

Include dependency graph for CPStr.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:21:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CPStr.h File Reference

common/CPStr.h File Reference

#include <string.h>
#include <stdlib.h>
#include "Persistent.h"
#include "ustr.h"
#include <exception>

Include dependency graph for CPStr.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | PCPStr
class | PCStr
class | CStaticAllocT

Defines

#define | CPStr UPStr
#define | CStr UStr

Define Documentation

#define CPStr UPStr

Definition at line 35 of file CPStr.h.

Referenced by CMPString::CMPString, CompatGetAdminOptions, CompatGetAnnotate, CompatGetCheckout, CompatGetCommand, CompatGetCommit, CompatGetDiff, CompatGetImport, CompatGetLog, CompatGetUpdate, CompatRtagBranch, CompatRtagCreate, CompatRtagDelete, CompatTagBranch, CompatTagCreate, CompatTagDelete, CvsCmdAnnotateFiles, CvsCmdCheckoutModule, CvsCmdCommitFiles, CvsCmdCommitFolder, CvsCmdDiffFiles, CvsCmdDiffFolder, CvsCmdImportModule, CvsCmdLogFiles, CvsCmdLogFolder, CvsCmdRtagBranch, CvsCmdRtagCreate, CvsCmdRtagDelete, CvsCmdTagBranchFiles, CvsCmdTagBranchFolder, CvsCmdTagCreateFiles, CvsCmdTagCreateFolder, CvsCmdTagDeleteFiles, CvsCmdTagDeleteFolder, CvsCmdUpdateFiles, CvsCmdUpdateFolder, PCPStr::GetData, CPersistent::LoadAll, CGraphView::OnGraphChangelogmessage, CGraphView::OnGraphSetdescription, CGraphView::OnGraphSetstate, CImportFilterDlg::OnInitDialog, PCPStr::operator char *, PCPStr::operator const char *, PCPStr::operator const unsigned char *, PCPStr::operator unsigned char *, PCPStr::operator=, PCPStr::PCPStr, CPersistent::SaveAll, PCPStr::SetData, and TestFileIsAlias.

#define CStr UStr

Definition at line 36 of file CPStr.h.

Referenced by RemoveCvsArgs::addfile, ReportWarning::AddWarning, BuildIgnoredList, CAboutDlg::CAboutDlg, CImportEntry::CImportEntry, CImportWarning::CImportWarning, CMString::CMString, combozify, CompatGetCommand, CompatGetCommit, CompatGetEditorMsg, CompatGetImport, CompatMoveToTrash, CWinCvsBrowser::Create, CTcl_Interp::CTcl_Interp, CTipDlg::CTipDlg, CvsCmdAddFolder, CvsCmdAnnotateFiles, CvsCmdCheckoutModule, CvsCmdCommitFiles, CvsCmdCommitFolder, CvsCmdDiffFiles, CvsCmdImportModule, CvsCmdInit, CvsCmdMacrosAdmin, CvsCmdReleaseFolder, cvsgui_LaunchTclMacro, CvsLogParse, DDV_CheckPathExists, CTcl_Interp::Deunixfy, UCvsFiles::EditSel, Entries_SetVisited, FileTraverse, FlatenSubFolders, FormatMenuString, MultiFiles::get, CWincvsApp::GetAppModule, CWincvsApp::GetAppPath, CWincvsApp::GetAppVersion, PCStr::GetData, GetExtension, CWinCvsBrowser::GetItemByLocation, UCvsFolders::GetItemByLocation, getLoc, CTCLBrowserEnt::GetNormalized, CBrowseFileView::GetPath, getSettingName, glue_getenv, CvsPrefs::Home, ign_add, InitializeInterp, CWincvsApp::InitInstance, CTCLBrowserEnt::IsSamePath, Authen::kindstr, launchCVS, LaunchDiff, LaunchEditor, LaunchViewer, CPersistent::LoadAll, CWincvsApp::LookForResourceFile, MacrosGetLoc, MacrosReloadAll, MakeTmpFile, MigrateCvsrootList, myTcl_CreateInterp, CWinCvsBrowser::NotifySelectionChange, CGetPrefs_WINCVS::OnAltcvssel, CWincvsApp::OnAppCredits, CGetPrefs_WINCVS::OnBtnviewer, UCvsFiles::OnCmdAdd, UCvsFiles::OnCmdAddb, UCvsFiles::OnCmdCommit, UCvsFiles::OnCmdDiff, UCvsFiles::OnCmdEdit, UCvsFiles::OnCmdEditors, UCvsFiles::OnCmdExplore, UCvsFiles::OnCmdLock, UCvsFiles::OnCmdLog, UCvsFolders::OnCmdMacrosSel, UCvsFiles::OnCmdQueryUpdate, UCvsFiles::OnCmdRelease, UCvsFiles::OnCmdStatus, UCvsFiles::OnCmdTagBranch, UCvsFiles::OnCmdTagDelete, UCvsFiles::OnCmdTagNew, UCvsFiles::OnCmdTrash, UCvsFiles::OnCmdUIEditseldef, UCvsFiles::OnCmdUnedit, UCvsFiles::OnCmdUnlock, UCvsFiles::OnCmdUpdate, UCvsFiles::OnCmdWatchers, UCvsFiles::OnCmdWatchOff, UCvsFiles::OnCmdWatchOn, CCommit_MAIN::OnDiff, TViewFill::OnDirectory, CGetPrefs_WINCVS::OnExtdiffsel, MacroTraversal::OnFile, KoMoveToTrashHandler::OnFiles, CGraphView::OnGraphChangelogmessage, CGraphView::OnGraphSetdescription, CGraphView::OnGraphSetstate, CWincvsApp::OnHelpCvs, CWincvsApp::OnHelpCvsclient, CCommit_MAIN::OnInitDialog, CWinCvsBrowser::OnItemexpanding, UCvsFiles::OnMacroSel, CSplashWnd::OnPaint, CGraphView::OnQueryAnnotate, CWinCvsBrowser::OnUpdateCmd, CWinCvsBrowser::OnUpdateMacro, CWinCvsBrowser::OnViewAdd, CWinCvsBrowser::OnViewCommit, CWinCvsBrowser::OnViewDiff, CGraphView::OnViewDiff, CWinCvsBrowser::OnViewEdit, CWinCvsBrowser::OnViewEditors, CWinCvsBrowser::OnViewExplore, CWinCvsBrowser::OnViewForceedit, CWinCvsBrowser::OnViewLog, CWinCvsBrowser::OnViewQueryUpdate, CWinCvsBrowser::OnViewRelease, CGraphView::OnViewReload, CWinCvsBrowser::OnViewReservededit, CGraphView::OnViewRetrieve, CWinCvsBrowser::OnViewStatus, CWinCvsBrowser::OnViewTagBranch, CWinCvsBrowser::OnViewTagDelete, CWinCvsBrowser::OnViewTagNew, CWinCvsBrowser::OnViewUnedit, CWinCvsBrowser::OnViewUnlock, CGraphView::OnViewUnlockf, CWinCvsBrowser::OnViewUpdate, CWinCvsBrowser::OnViewWatchers, CWinCvsBrowser::OnViewWatchOff, CWinCvsBrowser::OnViewWatchOn, PCStr::operator char *, PCStr::operator const char *, PCStr::operator=, PCStr::PCStr, print, CvsArgs::print, ReportWarning::PrintOut, ReportConflict::PrintOut, PythonLibGetLoc, CvsArgs::reset, CWinCvsBrowser::ResetBrowser, CWinCvsBrowser::ResetView, CWinCvsBrowser::RetrievePath, revcmp, KoRevisionColumn::revcmp, CPersistent::SaveAll, PCStr::SetData, CHistComboBoxEx::SetIcon, SettingsGetLoc, SplitPath, CWinCvsBrowser::StepToLocation, CWinCvsBrowser::StoreExpanded, Tag_Open, tclCvsBrowserProc, tclCvsEntriesProc, tclSafeRemove, testCVS, Authen::token, TGraphDelCmd::TraverseNode, and CTcl_Interp::Unixfy.

Generated on Sun Feb 24 01:21:47 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CTCP2Parse.cpp File Reference

common/CTCP2Parse.cpp File Reference

#include "stdafx.h"
#include "CTCP2Parse.hpp"

Include dependency graph for CTCP2Parse.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | CTCP2_TOGGLE(ch, var)
#define | CCOLOR (char)3
#define | CCTCP2 (char)6
#define | MIRC_TRANSPARENT 16
#define | isn(ch) ((ch) >= '0' && (ch) <= '9')
#define | CBOLD (char)2
#define | CCTCP2 (char)6
#define | CSTOP (char)15
#define | CREV (char)22
#define | CUNDR (char)31
#define | INVALID_SEQUENCE -1
#define | ANSI_SGM_TA_RESET 0
#define | ANSI_SGM_TA_BOLD 1
#define | ANSI_SGM_TA_FAINT 2
#define | ANSI_SGM_TA_ITALIC 3
#define | ANSI_SGM_TA_ULINE 4
#define | ANSI_SGM_TA_BLINK 5
#define | ANSI_SGM_TA_REV 7
#define | ANSI_SGM_TA_CONSEAL 8
#define | ANSI_SGM_TA_NORMAL 22
#define | ANSI_SGM_TA_ITALIC_OFF 23
#define | ANSI_SGM_TA_ULINE_OFF 24
#define | ANSI_SGM_TA_BLINK_OFF 25
#define | ANSI_SGM_TA_REV_OFF 27
#define | ANSI_SGM_FC_BLK 30
#define | ANSI_SGM_FC_RED 31
#define | ANSI_SGM_FC_GRN 32
#define | ANSI_SGM_FC_YEL 33
#define | ANSI_SGM_FC_BLU 34
#define | ANSI_SGM_FC_MAG 35
#define | ANSI_SGM_FC_CYN 36
#define | ANSI_SGM_FC_WHT 37
#define | ANSI_SGM_FC_DEFAULT 39
#define | ANSI_SGM_BC_BLK 40
#define | ANSI_SGM_BC_RED 41
#define | ANSI_SGM_BC_GRN 42
#define | ANSI_SGM_BC_YEL 43
#define | ANSI_SGM_BC_BLU 44
#define | ANSI_SGM_BC_MAG 45
#define | ANSI_SGM_BC_CYN 46
#define | ANSI_SGM_BC_WHT 47
#define | ANSI_SGM_BC_DEFAULT 49

Define Documentation

#define ANSI_SGM_BC_BLK 40

Definition at line 622 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_BC_BLU 44

Definition at line 626 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_BC_CYN 46

Definition at line 628 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_BC_DEFAULT 49

Definition at line 630 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_BC_GRN 42

Definition at line 624 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_BC_MAG 45

Definition at line 627 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_BC_RED 41

Definition at line 623 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_BC_WHT 47

Definition at line 629 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_BC_YEL 43

Definition at line 625 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_FC_BLK 30

Definition at line 612 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_FC_BLU 34

Definition at line 616 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_FC_CYN 36

Definition at line 618 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_FC_DEFAULT 39

Definition at line 620 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_FC_GRN 32

Definition at line 614 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_FC_MAG 35

Definition at line 617 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_FC_RED 31

Definition at line 613 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_FC_WHT 37

Definition at line 619 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_FC_YEL 33

Definition at line 615 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_TA_BLINK 5

Definition at line 603 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_TA_BLINK_OFF 25

Definition at line 609 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_TA_BOLD 1

Definition at line 599 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_TA_CONSEAL 8

Definition at line 605 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_TA_FAINT 2

Definition at line 600 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_TA_ITALIC 3

Definition at line 601 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_TA_ITALIC_OFF 23

Definition at line 607 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_TA_NORMAL 22

Definition at line 606 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_TA_RESET 0

Definition at line 598 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_TA_REV 7

Definition at line 604 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_TA_REV_OFF 27

Definition at line 610 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_TA_ULINE 4

Definition at line 602 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define ANSI_SGM_TA_ULINE_OFF 24

Definition at line 608 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m.

#define CBOLD (char)2

Definition at line 495 of file CTCP2Parse.cpp.

Referenced by irciiAttrCvt::ircii2ctcp.

#define CCOLOR (char)3

Definition at line 369 of file CTCP2Parse.cpp.

#define CCTCP2 (char)6

Definition at line 496 of file CTCP2Parse.cpp.

#define CCTCP2 (char)6

Definition at line 496 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::do_m, irciiAttrCvt::ircii2ctcp, and mircAttrCvt::mirc2ctcp.

#define CREV (char)22

Definition at line 498 of file CTCP2Parse.cpp.

Referenced by irciiAttrCvt::ircii2ctcp.

#define CSTOP (char)15

Definition at line 497 of file CTCP2Parse.cpp.

Referenced by irciiAttrCvt::ircii2ctcp.

#define CTCP2_TOGGLE | ( | ch,
 |  | var | )

Value:

case (ch): \
        decodeToggle(line, &parseFrmChar, &parseEndChar, &(var)); \
            break;

#define CUNDR (char)31

Definition at line 499 of file CTCP2Parse.cpp.

Referenced by irciiAttrCvt::ircii2ctcp.

#define INVALID_SEQUENCE -1

Definition at line 552 of file CTCP2Parse.cpp.

Referenced by ansiAttrCvt::ansi2ctcp, and ansiAttrCvt::AnsiSeq::AnsiSeq.

#define isn ( ch ) ((ch) >= '0' && (ch) <= '9')

Definition at line 372 of file CTCP2Parse.cpp.

Referenced by mircAttrCvt::extractcolor.

#define MIRC_TRANSPARENT 16

Definition at line 371 of file CTCP2Parse.cpp.

Referenced by mircAttrCvt::extractcolor.

Generated on Sun Feb 24 01:21:47 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CTCP2Parse.hpp File Reference

common/CTCP2Parse.hpp File Reference

#include <string>
#include <vector>

Include dependency graph for CTCP2Parse.hpp:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | ansiAttrCvt
class | ansiAttrCvt::AnsiSeq
class | irciiAttrCvt
class | mircAttrCvt
struct | CTCP2Parse::RGBColor
class | CTCP2Parse

Generated on Sun Feb 24 01:21:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsAlert.cpp File Reference

common/CvsAlert.cpp File Reference

#include "stdafx.h"
#include "resource.h"
#include "CvsAlert.h"

Include dependency graph for CvsAlert.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool CvsAlert (const char *prompt, const char *defhit, const char *cnclhit)

Function Documentation

bool CvsAlert | ( | const char * | prompt,
 |  | const char * | defhit,
 |  | const char * | cnclhit
 | ) |

Definition at line 154 of file CvsAlert.cpp.

References EV_INIT_WIDGET, EV_SETTEXT, kUMainWidget, NULL, UCreate_AskYesNo, and UEventSendMessage.

00155 {
00156 #ifdef WIN32
00157     CCVSAlert gv(prompt, defhit, cnclhit);
00158     return gv.DoModal() == IDOK;
00159 #endif /* WIN32 */
00160 #ifdef macintosh
00161     static ModalFilterUPP filter = NULL;
00162
00163     if(filter == NULL)
00164         filter = NewModalFilterUPP(AlertModalFilter);
00165
00166     sPrompt = prompt;
00167     sDefhit = defhit;
00168     sCnclhit = cnclhit;
00169
00170     return CautionAlert(kDlgIdAlert, filter) == 1;
00171 #endif /* macintosh */
00172 #if qUnix
00173     void *wid = UCreate_AskYesNo();
00174
00175     UAskYesNo *dlg = new UAskYesNo();
00176     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00177     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, kUMainWidget, (void *)"Alert");
00178     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, UAskYesNo::kOK, (void *)defhit);
00179     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, UAskYesNo::kCancel, (void *)cnclhit);
00180     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, UAskYesNo::kText, (void *)prompt);
00181
00182     bool res = dlg->DoModal();
00183     delete dlg;
00184     return res;
00185 #endif
00186 }

Generated on Sun Feb 24 01:21:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsAlert.h File Reference

common/CvsAlert.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCVSAlert

Defines

#define | AFX_CVSALERT_H__ACFE8C41_9836_11D1_AE50_00C0F0067852__INCLUDED_

Functions

bool | CvsAlert (const char *prompt, const char *defhit, const char *cnclhit)

Define Documentation

#define AFX_CVSALERT_H__ACFE8C41_9836_11D1_AE50_00C0F0067852__INCLUDED_

Definition at line 25 of file CvsAlert.h.

Function Documentation

bool CvsAlert | ( | const char * | prompt,
 |  | const char * | defhit,
 |  | const char * | cnclhit
 | ) |

Definition at line 154 of file CvsAlert.cpp.

Referenced by AskCreatePersistentSettings, UCvsFrame::AskForQuitting, AskYesNo, CvsCmdAddBinaryFiles, CvsCmdAddFiles, CvsCmdAddUnicodeFiles, KoMoveToTrashHandler::OnFiles, CGraphView::OnGraphSetstate, and USmartCombo::RemoveItem.

00155 {
00156 #ifdef WIN32
00157     CCVSAlert gv(prompt, defhit, cnclhit);
00158     return gv.DoModal() == IDOK;
00159 #endif /* WIN32 */
00160 #ifdef macintosh
00161     static ModalFilterUPP filter = NULL;
00162
00163     if(filter == NULL)
00164         filter = NewModalFilterUPP(AlertModalFilter);
00165
00166     sPrompt = prompt;
00167     sDefhit = defhit;
00168     sCnclhit = cnclhit;
00169
00170     return CautionAlert(kDlgIdAlert, filter) == 1;
00171 #endif /* macintosh */
00172 #if qUnix
00173     void *wid = UCreate_AskYesNo();
00174
00175     UAskYesNo *dlg = new UAskYesNo();
00176     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00177     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, kUMainWidget, (void *)"Alert");
00178     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, UAskYesNo::kOK, (void *)defhit);
00179     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, UAskYesNo::kCancel, (void *)cnclhit);
00180     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, UAskYesNo::kText, (void *)prompt);
00181
00182     bool res = dlg->DoModal();
00183     delete dlg;
00184     return res;
00185 #endif
00186 }

Generated on Sun Feb 24 01:21:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsArgs.cpp File Reference

common/CvsArgs.cpp File Reference

#include "stdafx.h"
#include <stdlib.h>
#include <string.h>
#include "CvsPrefs.h"
#include "CvsArgs.h"
#include "AppConsole.h"
#include "Authen.h"

Include dependency graph for CvsArgs.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | MAX_PRINT_ARG 80

Functions

char * | mystrdup (const char *string)
char * | reduceString (const char *str, CStaticAllocT< char > &buf)
char * | expandLF (const char *str, CStaticAllocT< char > &buf)

Variables

CStaticAllocT< char > | buf

Define Documentation

#define MAX_PRINT_ARG 80

Definition at line 137 of file CvsArgs.cpp.

Referenced by CvsArgs::print, and reduceString.

Function Documentation

char* expandLF | ( | const char * | str,
 |  | CStaticAllocT< char > & | buf
 | ) | [static]

Definition at line 160 of file CvsArgs.cpp.

References CStaticAllocT::AdjustSize, and buf.

Referenced by CvsArgs::print.

00161 {
00162     int numLFs = 0;
00163     const char *runner = str;
00164     while((runner = strchr(runner, '\n')) != 0L)
00165     {
00166         numLFs++;
00167         runner++;
00168     }
00169
00170     size_t len = strlen(str);
00171     buf.AdjustSize(len + numLFs + 1); // numLFs * "\n" + '\0'
00172
00173     char *tmp = buf;
00174     char c;
00175     runner = str;
00176     while((c = *runner++) != '\0')
00177     {
00178         if(c == '\n')
00179         {
00180             *tmp++ = '\\';
00181             *tmp++ = 'n';
00182         }
00183         else
00184             *tmp++ = c;
00185     }
00186     *tmp++ = '\0';
00187
00188     return buf;
00189 }

char* mystrdup ( const char * string ) [static]

Definition at line 43 of file CvsArgs.cpp.

References cvs_err, exit, malloc, and NULL.

Referenced by CvsArgs::add, and CvsArgs::reset.

00044 {
00045     int size = strlen(string);
00046     char *result = (char *)malloc((size + 1) * sizeof(char));
00047     if(result == NULL)
00048     {
00049         cvs_err("Impossible to allocate %d bytes !\n", size + 1);
00050         exit(1);
00051     }
00052     strcpy(result, string);
00053     return result;
00054 }

char* reduceString | ( | const char * | str,
 |  | CStaticAllocT< char > & | buf
 | ) | [static]

Definition at line 138 of file CvsArgs.cpp.

References CStaticAllocT::AdjustSize, buf, and MAX_PRINT_ARG.

Referenced by CvsArgs::print.

00139 {
00140     buf.AdjustSize(MAX_PRINT_ARG + 4); // "..." + '\0'
00141     size_t len = strlen(str);
00142     if(len < MAX_PRINT_ARG)
00143     {
00144         strcpy(buf, str);
00145     }
00146     else
00147     {
00148         memcpy((char *)buf, str, MAX_PRINT_ARG * sizeof(char));
00149         char *tmp = (char *)buf + MAX_PRINT_ARG;
00150         *tmp++ = '.';
00151         *tmp++ = '.';
00152         *tmp++ = '.';
00153         *tmp = '\0';
00154     }
00155
00156     return buf;
00157 }

Variable Documentation

CStaticAllocT<char> buf [static]

Definition at line 191 of file CvsArgs.cpp.

Referenced by expandLF, and reduceString.

Generated on Sun Feb 24 01:21:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsArgs.h File Reference

common/CvsArgs.h File Reference

#include "TextBinary.h"

Include dependency graph for CvsArgs.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CvsArgs

Generated on Sun Feb 24 01:21:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsCommands.cpp File Reference

common/CvsCommands.cpp File Reference

#include "stdafx.h"
#include <errno.h>
#include "wincvs.h"
#include "CvsCommands.h"
#include "CvsPrefs.h"
#include "Authen.h"
#include "CvsArgs.h"
#include "MultiFiles.h"
#include "PromptFiles.h"
#include "AppConsole.h"
#include "AppGlue.h"
#include "MoveToTrash.h"
#include "LineCmd.h"
#include "CvsAlert.h"
#include "TextBinary.h"
#include "CommitDlg.h"
#include "ImportDlg.h"
#include "CheckoutDlg.h"
#include "TclGlue.h"
#include "ImportFilterDlg.h"
#include "UpdateDlg.h"
#include "LogDlg.h"
#include "DiffDlg.h"
#include "LogParse.h"
#include "RtagDlg.h"
#include "TagDlg.h"
#include "InitDlg.h"
#include "ReleaseDlg.h"
#include "AnnotateDlg.h"

Include dependency graph for CvsCommands.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | AddBinCvsArgs
class | AddCvsArgs
class | AddUnicodeCvsArgs
class | ControlCvsArgs
class | RemoveCvsArgs

Functions

char * | cleanUpLogMsg (const char *msg)
void | CvsCmdUpdateFolder (const char *dir, bool queryOnly)
void | CvsCmdCommitFolder (const char *dir)
void | CvsCmdDiffFolder (const char *dir)
void | CvsCmdAddFolder (const char *dir)
void | CvsCmdInit (const char *dir)
void | CvsCmdImportModule (const char *dir)
void | CvsCmdCheckoutModule (const char *dir)
void | CvsCmdRtagCreate (void)
void | CvsCmdRtagDelete (void)
void | CvsCmdRtagBranch (void)
void | CvsCmdLogin (void)
void | CvsCmdLogout (void)
void | CvsCmdUpdateFiles (MultiFiles *mfarg, bool queryOnly)
void | CvsCmdCommitFiles (MultiFiles *mfarg)
void | FlatenSubFolders (UStr &tmpf)
void | CvsCmdDiffFiles (MultiFiles *mfarg)
void | CvsCmdLogFiles (MultiFiles *mfarg, bool outGraph, void *defWnd)
void | CvsCmdAddFiles (MultiFiles *mfarg)
void | CvsCmdAddBinaryFiles (MultiFiles *mfarg)
void | CvsCmdAddUnicodeFiles (MultiFiles *mfarg)
void | CvsCmdRemoveFiles (MultiFiles *mfarg)
void | CvsCmdStatusFiles (MultiFiles *mfarg)
void | CvsCmdCancelChangesFiles (MultiFiles *mfarg)
void | CvsCmdLine (void)
void | CvsCmdLogFolder (const char *dir)
void | CvsCmdStatusFolder (const char *dir)
void | CvsCmdLockFiles (MultiFiles *mfarg)
void | CvsCmdUnlockFiles (MultiFiles *mfarg)
void | CvsCmdTagCreateFiles (MultiFiles *mfarg)
void | CvsCmdTagDeleteFiles (MultiFiles *mfarg)
void | CvsCmdTagBranchFiles (MultiFiles *mfarg)
void | CvsCmdLockFolder (const char *dir)
void | CvsCmdUnlockFolder (const char *dir)
void | CvsCmdTagCreateFolder (const char *dir)
void | CvsCmdTagDeleteFolder (const char *dir)
void | CvsCmdTagBranchFolder (const char *dir)
void | CvsCmdEditFiles (MultiFiles *mfarg, kEditCmdType editType)
void | CvsCmdUneditFiles (MultiFiles *mfarg)
void | CvsCmdWatchOnFiles (MultiFiles *mfarg)
void | CvsCmdWatchOffFiles (MultiFiles *mfarg)
void | CvsCmdWatchersFiles (MultiFiles *mfarg)
void | CvsCmdEditorsFiles (MultiFiles *mfarg)
void | CvsCmdEditFolder (const char *dir, kEditCmdType editType)
void | CvsCmdUneditFolder (const char *dir)
void | CvsCmdWatchOnFolder (const char *dir)
void | CvsCmdWatchOffFolder (const char *dir)
void | CvsCmdReleaseFolder (const char *dir)
void | CvsCmdWatchersFolder (const char *dir)
void | CvsCmdEditorsFolder (const char *dir)
void | CvsCmdMacrosAdmin (const char *macroName)
void | CvsCmdAnnotateFiles (MultiFiles *mfarg)

Function Documentation

char* cleanUpLogMsg ( const char * msg )

Definition at line 73 of file CvsCommands.cpp.

References CStaticAllocT::AdjustSize.

00074 {
00075     static CStaticAllocT<char> buf;
00076
00077     size_t len = strlen(msg);
00078     buf.AdjustSize(len + 1);
00079
00080     char *tmp = buf;
00081     char c;
00082     while((c = *msg++) != '\0')
00083     {
00084 #ifdef WIN32
00085         if(c == '\r')
00086             continue;
00087 #endif /* WIN32 */
00088 #ifdef macintosh
00089         if(c == '\r')
00090             c = '\n';
00091 #endif /* macintosh */
00092         *tmp++ = c;
00093     }
00094     *tmp++ = '\0';
00095
00096     return buf;
00097 }

void CvsCmdAddBinaryFiles ( MultiFiles * mfarg )

Definition at line 1261 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, CvsAlert, ControlCvsArgs::HasProblem, launchCVS, MultiFiles::next, and CvsArgs::print.

01262 {
01263     if(gCvsPrefs.empty())
01264         return;
01265
01266     MultiFiles mf;
01267     if(mfarg == 0L)
01268     {
01269         if(!BrowserGetMultiFiles("Select binary files to add :", mf))
01270             return;
01271         mfarg = &mf;
01272     }
01273
01274     while(mfarg->next())
01275     {
01276         AddBinCvsArgs args;
01277         args.add("add");
01278         args.add("-kb");
01279         const char *dir = mfarg->add(args);
01280
01281         if(!args.HasProblem() || !CvsAlert("Some problems have been found while adding binary files and should be corrected",
01282                 "Cancel", "Ignore"))
01283         {
01284             args.print(dir);
01285             launchCVS(dir, args.Argc(), args.Argv());
01286         }
01287     }
01288 }

void CvsCmdAddFiles ( MultiFiles * mfarg )

Definition at line 1219 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, CvsAlert, ControlCvsArgs::HasProblem, launchCVS, MultiFiles::next, and CvsArgs::print.

01220 {
01221     if(gCvsPrefs.empty())
01222         return;
01223
01224     MultiFiles mf;
01225     if(mfarg == 0L)
01226     {
01227         if(!BrowserGetMultiFiles("Select files to add :", mf))
01228             return;
01229         mfarg = &mf;
01230     }
01231
01232     while(mfarg->next())
01233     {
01234         AddCvsArgs args;
01235         args.add("add");
01236         const char *dir = mfarg->add(args);
01237
01238         if(!args.HasProblem() || !CvsAlert("Some problems have been found while adding files and should be corrected",
01239                 "Cancel", "Ignore"))
01240         {
01241             args.print(dir);
01242             launchCVS(dir, args.Argc(), args.Argv());
01243         }
01244     }
01245 }

void CvsCmdAddFolder ( const char * dir )

Definition at line 270 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, CStr, cvs_err, launchCVS, CvsArgs::print, and SplitPath.

00271 {
00272     if(gCvsPrefs.empty())
00273         return;
00274
00275     if(dir == 0L)
00276         dir = BrowserGetDirectory("Select a directory to add :");
00277     if(dir == 0L)
00278         return;
00279
00280     CStr uppath, folder;
00281     if(!SplitPath(dir, uppath, folder))
00282     {
00283         cvs_err("Unable to convert path name '%s'\n", dir);
00284         return;
00285     }
00286
00287     CvsArgs args;
00288     args.add("add");
00289     args.add(folder);
00290     args.print(uppath);
00291     launchCVS(uppath, args.Argc(), args.Argv());
00292 }

void CvsCmdAddUnicodeFiles ( MultiFiles * mfarg )

Definition at line 1304 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, CvsAlert, ControlCvsArgs::HasProblem, launchCVS, MultiFiles::next, and CvsArgs::print.

01305 {
01306     if(gCvsPrefs.empty())
01307         return;
01308
01309     MultiFiles mf;
01310     if(mfarg == 0L)
01311     {
01312         if(!BrowserGetMultiFiles("Select unicode files to add :", mf))
01313             return;
01314         mfarg = &mf;
01315     }
01316
01317     while(mfarg->next())
01318     {
01319         AddUnicodeCvsArgs args;
01320         args.add("add");
01321         args.add("-ku");
01322         const char *dir = mfarg->add(args);
01323
01324         if(!args.HasProblem() || !CvsAlert("Some problems have been found while adding unicode files and should be corrected",
01325                 "Cancel", "Ignore"))
01326         {
01327             args.print(dir);
01328             launchCVS(dir, args.Argc(), args.Argv());
01329         }
01330     }
01331 }

void CvsCmdAnnotateFiles ( MultiFiles * mfarg )

Definition at line 2159 of file CvsCommands.cpp.

References CvsArgs::add, BrowserGetMultiFiles, CompatGetAnnotate, CPStr, CStr, decodeCVS, FlatenSubFolders, MultiFiles::get, GetExtension, launchCVS, LaunchViewer, MultiFiles::next, and CvsArgs::print.

02160 {
02161     if(gCvsPrefs.empty())
02162         return;
02163
02164     MultiFiles mf;
02165     if(mfarg == 0L)
02166     {
02167         if(!BrowserGetMultiFiles("Select files to annotate :", mf))
02168             return;
02169         mfarg = &mf;
02170     }
02171
02172     bool noRecurs;
02173     bool isDate;
02174     CPStr rev;
02175     bool force;
02176
02177     if(!CompatGetAnnotate(noRecurs, isDate, rev, force))
02178         return;
02179
02180     while(mfarg->next())
02181     {
02182         CStr path, filename, ext, base;
02183         CStr file;
02184         for(int i = 0; ; i++)
02185         {
02186             if(!mfarg->get(i, path, filename))
02187                 break;
02188             // note that filename can contain subfolders
02189
02190             GetExtension(filename, base, ext);
02191
02192             CvsArgs args;
02193             CStr tmpf(base);
02194             if(!rev.empty())
02195             {
02196                 tmpf << "_ann_";
02197                 tmpf << rev;
02198                 tmpf << '_';
02199             }
02200             else
02201                 tmpf << "_ann_";
02202
02203             // convert subfolder names to regular name
02204             FlatenSubFolders(tmpf);
02205
02206             args.add("annotate");
02207             if(noRecurs)
02208             {
02209                 args.add("-l");
02210             }
02211             if(force)
02212             {
02213                 args.add("-f");
02214             }
02215             if(!rev.empty())
02216             {
02217                 args.add(isDate ? "-D" : "-r");
02218                 args.add(rev);
02219             }
02220             args.add(filename);
02221             args.print(path);
02222             file = launchCVS(path, args, (const char *)tmpf, ext);
02223 #ifdef qMacCvsPP
02224             decodeCVS (file);
02225 #endif
02226
02227             if(file.empty())
02228                 continue;
02229
02230             LaunchViewer(file, true);
02231         }
02232     }
02233 }

void CvsCmdCancelChangesFiles ( MultiFiles * mfarg )

Definition at line 1427 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, launchCVS, MultiFiles::next, and CvsArgs::print.

01428 {
01429     if(gCvsPrefs.empty())
01430         return;
01431
01432     MultiFiles mf;
01433     if(mfarg == 0L)
01434     {
01435         if(!BrowserGetMultiFiles("Select files to cancel changes :", mf))
01436             return;
01437         mfarg = &mf;
01438     }
01439
01440     while(mfarg->next())
01441     {
01442         RemoveCvsArgs args;
01443         args.add("update");
01444         const char *dir = mfarg->add(args);
01445         args.print(dir);
01446         launchCVS(dir, args.Argc(), args.Argv());
01447     }
01448 }

void CvsCmdCheckoutModule ( const char * dir )

Definition at line 422 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, CompatGetCheckout, CPStr, CStr, launchCVS, CvsArgs::print, and Authen::skiptoken.

00423 {
00424     if(gCvsPrefs.empty())
00425         return;
00426
00427 #ifndef WIN32
00428     if(dir == 0L)
00429         dir = BrowserGetDirectory("Select a directory to checkout to :");
00430     if(dir == 0L)
00431         return;
00432 #endif
00433
00434     bool norecurs;
00435     CPStr modname;
00436     CPStr path(dir);
00437     bool toStdout;
00438     CPStr date;
00439     CPStr rev;
00440     bool useMostRecent;
00441     CPStr rev1;
00442     CPStr rev2;
00443     bool doexport;
00444     bool forceCvsroot;
00445     bool overrideCheckoutDir;
00446     CPStr checkoutDir;
00447
00448     if( !CompatGetCheckout(modname, path, norecurs,
00449         toStdout, date, rev, useMostRecent, rev1, rev2, doexport, forceCvsroot,
00450         overrideCheckoutDir, checkoutDir) )
00451     {
00452         return;
00453     }
00454
00455     CvsArgs args;
00456
00457     if(forceCvsroot)
00458     {
00459         CStr root;
00460
00461         // extract from the cvsroot
00462         const char *ccvsroot = gCvsPrefs;
00463         ccvsroot = Authen::skiptoken(ccvsroot);
00464         root = gAuthen.token();
00465         root << ccvsroot;
00466         args.add("-d");
00467         args.add(root);
00468     }
00469
00470     args.add(doexport ? "export" : "checkout");
00471
00472     if(gCvsPrefs.PruneOption() && !doexport)
00473         args.add("-P");
00474
00475     if(norecurs)
00476         args.add("-l");
00477
00478     if(toStdout)
00479         args.add("-p");
00480
00481     if(useMostRecent)
00482         args.add("-f");
00483
00484     if(!rev1.empty())
00485     {
00486         CPStr tmp;
00487         tmp = "-j";
00488         tmp << rev1;
00489         args.add(tmp);
00490     }
00491
00492     if(!rev2.empty())
00493     {
00494         CPStr tmp;
00495         tmp = "-j";
00496         tmp << rev2;
00497         args.add(tmp);
00498     }
00499
00500     if(!date.empty())
00501     {
00502         args.add("-D");
00503         args.add(date);
00504     }
00505
00506     if(!rev.empty())
00507     {
00508         args.add("-r");
00509         args.add(rev);
00510     }
00511
00512     if(doexport && rev.empty() && date.empty())
00513     {
00514         args.add("-r");
00515         args.add("HEAD");
00516     }
00517
00518     if( overrideCheckoutDir )
00519     {
00520         args.add("-d");
00521         args.add(checkoutDir);
00522     }
00523
00524     args.add(modname);
00525     args.print(path);
00526     launchCVS(path, args.Argc(), args.Argv());
00527 }

void CvsCmdCommitFiles ( MultiFiles * mfarg )

Definition at line 789 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, cleanUpLogMsg, CompatGetCommit, CPStr, CStr, MultiFiles::get, launchCVS, MultiFiles::next, and CvsArgs::print.

00790 {
00791     if(gCvsPrefs.empty())
00792         return;
00793
00794     MultiFiles mf;
00795     if(mfarg == 0L)
00796     {
00797         if(!BrowserGetMultiFiles("Select files to commit :", mf))
00798             return;
00799         mfarg = &mf;
00800     }
00801
00802     bool firstTime = true;
00803     bool norecurs;
00804     CStr logmsg;
00805     bool forceCommit;
00806     bool forceRecurse;
00807     CPStr rev;
00808     bool noModuleProgram;
00809     bool checkValidEdits;
00810
00811     while(mfarg->next())
00812     {
00813         if(firstTime)
00814         {
00815             // we have to give the path where the commit is done is
00816             // the user expects to fill the CVS/Template file. we just
00817             // grab the first one for this purpose.
00818             const char *tmplDir = 0L;
00819             CStr pathTmpl, dontCareFile;
00820             if(mfarg->get(0, pathTmpl, dontCareFile))
00821                 tmplDir = pathTmpl;
00822
00823             if( !CompatGetCommit(logmsg, norecurs, forceCommit, forceRecurse, rev, noModuleProgram, checkValidEdits, tmplDir, mfarg) )
00824                 return;
00825
00826             firstTime = false;
00827         }
00828
00829         CvsArgs args;
00830         args.add("commit");
00831         if(checkValidEdits)
00832             args.add("-c");
00833         if(norecurs)
00834             args.add("-l");
00835         if(noModuleProgram)
00836             args.add("-n");
00837         if(forceRecurse)
00838             args.add("-R");
00839         if(forceCommit)
00840             args.add("-f");
00841         args.add("-m");
00842         args.add(cleanUpLogMsg(logmsg));
00843         if(!rev.empty())
00844         {
00845             args.add("-r");
00846             args.add(rev);
00847         }
00848         const char *dir = mfarg->add(args);
00849         args.print(dir);
00850         launchCVS(dir, args.Argc(), args.Argv());
00851     }
00852 }

void CvsCmdCommitFolder ( const char * dir )

Definition at line 177 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, cleanUpLogMsg, CompatGetCommit, CPStr, CStr, launchCVS, and CvsArgs::print.

00178 {
00179     if(gCvsPrefs.empty())
00180         return;
00181
00182     if(dir == 0L)
00183         dir = BrowserGetDirectory("Select a directory to commit :");
00184     if(dir == 0L)
00185         return;
00186
00187     bool norecurs;
00188     CStr logmsg;
00189     bool forceCommit;
00190     bool forceRecurse;
00191     CPStr rev;
00192     bool noModuleProgram;
00193     bool checkValidEdits;
00194
00195     if( !CompatGetCommit(logmsg, norecurs, forceCommit, forceRecurse, rev, noModuleProgram, checkValidEdits, dir) )
00196         return;
00197
00198     CvsArgs args;
00199     args.add("commit");
00200     if(checkValidEdits)
00201         args.add("-c");
00202     if(norecurs)
00203         args.add("-l");
00204     if(noModuleProgram)
00205         args.add("-n");
00206     if(forceRecurse)
00207         args.add("-R");
00208     if(forceCommit)
00209         args.add("-f");
00210     args.add("-m");
00211     args.add(cleanUpLogMsg(logmsg));
00212     if(!rev.empty())
00213     {
00214         args.add("-r");
00215         args.add(rev);
00216     }
00217     args.print(dir);
00218     launchCVS(dir, args.Argc(), args.Argv());
00219 }

void CvsCmdDiffFiles ( MultiFiles * mfarg )

Definition at line 881 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, CompatGetDiff, CPStr, CStr, decodeCVS, FlatenSubFolders, MultiFiles::get, GetExtension, launchCVS, LaunchDiff, MultiFiles::next, and CvsArgs::print.

00882 {
00883     if(gCvsPrefs.empty())
00884         return;
00885
00886     MultiFiles mf;
00887     if(mfarg == 0L)
00888     {
00889         if(!BrowserGetMultiFiles("Select files to diff :", mf))
00890             return;
00891         mfarg = &mf;
00892     }
00893
00894     bool noRecurs;
00895     bool isDate1;
00896     bool isDate2;
00897     bool useExtDiff;
00898     CPStr rev1;
00899     CPStr rev2;
00900     bool noWhiteSpace;
00901     bool ignoreCase;
00902     bool extDiffResult;
00903
00904     if(!CompatGetDiff(noRecurs, isDate1, isDate2, rev1, rev2, useExtDiff, noWhiteSpace, ignoreCase, true))
00905         return;
00906
00907     while(mfarg->next())
00908     {
00909         extDiffResult = false;
00910
00911         if (useExtDiff)
00912         {
00913             CStr path, filename, ext, base;
00914             CStr file1, file2;
00915             for(int i = 0; ; i++)
00916             {
00917                 if(!mfarg->get(i, path, filename))
00918                     break;
00919                 // note that filename can contain subfolders
00920
00921                 GetExtension(filename, base, ext);
00922
00923                 CvsArgs args;
00924                 CStr tmpf(base);
00925                 if(!rev1.empty())
00926                 {
00927                     tmpf << '_';
00928                     tmpf << rev1;
00929                     tmpf << '_';
00930                 }
00931                 else
00932                     tmpf << "_orig_";
00933
00934                 // convert subfolder names to regular name
00935                 FlatenSubFolders(tmpf);
00936
00937                 args.add("update");
00938                 args.add("-p");
00939                 if(!rev1.empty())
00940                 {
00941                     args.add(isDate1 ? "-D" : "-r");
00942                     args.add(rev1);
00943                 }
00944                 args.add(filename);
00945                 args.print(path);
00946                 file1 = launchCVS(path, args, (const char *)tmpf, ext);
00947 #ifdef qMacCvsPP
00948                 decodeCVS (file1);
00949 #endif
00950
00951                 if(rev2.empty())
00952                 {
00953                     file2 = path;
00954                     if(!file2.endsWith(kPathDelimiter))
00955                         file2 << kPathDelimiter;
00956                     file2 << filename;
00957                 }
00958                 else
00959                 {
00960                     CvsArgs args2;
00961
00962                     tmpf = base;
00963                     tmpf << '_';
00964                     tmpf << rev2;
00965                     tmpf << '_';
00966
00967                     // convert subfolder names to regular name
00968                     FlatenSubFolders(tmpf);
00969
00970                     args2.add("update");
00971                     args2.add("-p");
00972                     args2.add(isDate2 ? "-D" : "-r");
00973                     args2.add(rev2);
00974                     args2.add(filename);
00975                     args2.print(path);
00976                     file2 = launchCVS(path, args2, (const char *)tmpf, ext);
00977 #ifdef qMacCvsPP
00978                     decodeCVS (file2);
00979 #endif
00980                 }
00981
00982                 if(file1.empty() || file2.empty())
00983                     continue;
00984
00985                 extDiffResult = LaunchDiff(file1, file2);
00986             }
00987         }
00988
00989         if (!useExtDiff || !extDiffResult)
00990         {
00991             CvsArgs args;
00992             args.add("diff");
00993
00994             if(noRecurs)
00995                 args.add("-l");
00996             if(!rev1.empty())
00997             {
00998                 args.add(isDate1 ? "-D" : "-r");
00999                 args.add(rev1);
01000             }
01001             if(!rev2.empty())
01002             {
01003                 args.add(isDate2 ? "-D" : "-r");
01004                 args.add(rev2);
01005             }
01006             if(noWhiteSpace)
01007                 args.add("-w"); //--ignore-all-space
01008             if(ignoreCase)
01009                 args.add("-i"); //--ignore-case
01010
01011             const char *dir = mfarg->add(args);
01012             args.print(dir);
01013             launchCVS(dir, args.Argc(), args.Argv());
01014         }
01015     }
01016 }

void CvsCmdDiffFolder ( const char * dir )

Definition at line 222 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, CompatGetDiff, CPStr, launchCVS, and CvsArgs::print.

00223 {
00224     if(gCvsPrefs.empty())
00225         return;
00226
00227     if(dir == 0L)
00228         dir = BrowserGetDirectory("Select a directory to diff :");
00229
00230     if(dir == 0L)
00231         return;
00232
00233     bool noRecurs;
00234     bool isDate1;
00235     bool isDate2;
00236     bool useExtDiff;
00237     CPStr rev1;
00238     CPStr rev2;
00239     bool noWhiteSpace;
00240     bool ignoreCase;
00241
00242     if(!CompatGetDiff(noRecurs, isDate1, isDate2, rev1, rev2, useExtDiff, noWhiteSpace, ignoreCase))
00243         return;
00244
00245     CvsArgs args;
00246     args.add("diff");
00247
00248     if(noRecurs)
00249         args.add("-l");
00250     if(!rev1.empty())
00251     {
00252         args.add(isDate1 ? "-D" : "-r");
00253         args.add(rev1);
00254     }
00255     if(!rev2.empty())
00256     {
00257         args.add(isDate2 ? "-D" : "-r");
00258         args.add(rev2);
00259     }
00260     if(noWhiteSpace)
00261         args.add("-w"); //--ignore-all-space
00262     if(ignoreCase)
00263         args.add("-i"); //--ignore-case
00264
00265     args.print(dir);
00266     launchCVS(dir, args.Argc(), args.Argv());
00267 }

void CvsCmdEditFiles | ( | MultiFiles * | mfarg,
 |  | kEditCmdType | editType
 | ) |

Definition at line 1833 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, kEditCmdType, kEditForce, kEditNormal, kEditReserved, launchCVS, MultiFiles::next, and CvsArgs::print.

01834 {
01835     if(gCvsPrefs.empty())
01836         return;
01837
01838     MultiFiles mf;
01839     if(mfarg == 0L)
01840     {
01841         if(!BrowserGetMultiFiles("Select the files to edit :", mf))
01842             return;
01843         mfarg = &mf;
01844     }
01845
01846     while(mfarg->next())
01847     {
01848         CvsArgs args;
01849         args.add("edit");
01850
01851         switch( editType )
01852         {
01853         default:
01854         case kEditNormal:
01855             // intentionally blank
01856             break;
01857         case kEditReserved:
01858             args.add("-c");
01859             break;
01860         case kEditForce:
01861             args.add("-f");
01862             break;
01863         }
01864
01865         const char *dir = mfarg->add(args);
01866         args.print(dir);
01867         launchCVS(dir, args.Argc(), args.Argv());
01868     }
01869 }

void CvsCmdEditFolder | ( | const char * | dir,
 |  | kEditCmdType | editType
 | ) |

Definition at line 1993 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, kEditCmdType, kEditForce, kEditNormal, kEditReserved, launchCVS, and CvsArgs::print.

01994 {
01995     if(gCvsPrefs.empty())
01996         return;
01997
01998     if(dir == 0L)
01999         dir = BrowserGetDirectory("Select a directory to edit :");
02000     if(dir == 0L)
02001         return;
02002
02003     CvsArgs args;
02004     args.add("edit");
02005
02006     switch( editType )
02007     {
02008     default:
02009     case kEditNormal:
02010         // intentionally blank
02011         break;
02012     case kEditReserved:
02013         args.add("-c");
02014         break;
02015     case kEditForce:
02016         args.add("-f");
02017         break;
02018     }
02019
02020     args.print(dir);
02021     launchCVS(dir, args.Argc(), args.Argv());
02022 }

void CvsCmdEditorsFiles ( MultiFiles * mfarg )

Definition at line 1969 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, launchCVS, MultiFiles::next, and CvsArgs::print.

01970 {
01971     if(gCvsPrefs.empty())
01972         return;
01973
01974     MultiFiles mf;
01975     if(mfarg == 0L)
01976     {
01977         if(!BrowserGetMultiFiles("Select the files to get the editors from :", mf))
01978             return;
01979         mfarg = &mf;
01980     }
01981
01982     while(mfarg->next())
01983     {
01984         CvsArgs args;
01985         args.add("editors");
01986
01987         const char *dir = mfarg->add(args);
01988         args.print(dir);
01989         launchCVS(dir, args.Argc(), args.Argv());
01990     }
01991 }

void CvsCmdEditorsFolder ( const char * dir )

Definition at line 2130 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, launchCVS, and CvsArgs::print.

02131 {
02132     if(gCvsPrefs.empty())
02133         return;
02134
02135     if(dir == 0L)
02136         dir = BrowserGetDirectory("Select a directory to get the editors from :");
02137     if(dir == 0L)
02138         return;
02139
02140     CvsArgs args;
02141     args.add("editors");
02142
02143     args.print(dir);
02144     launchCVS(dir, args.Argc(), args.Argv());
02145 }

void CvsCmdImportModule ( const char * dir )

Definition at line 326 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, cleanUpLogMsg, CompatGetImport, CompatImportFilter, CPStr, CStr, free_list_types, ReportConflict::GetPattern, ReportConflict::HasForceBinary, ReportConflict::HasForceNoKeywords, ReportConflict::HasForceText, ReportConflict::HasForceUnicode, ReportConflict::HasIgnore, ReportConflict::IsBinary, ReportConflict::IsExtension, ReportConflict::IsUnicode, launchCVS, ReportConflict::next, and CvsArgs::print.

00327 {
00328     if(gCvsPrefs.empty())
00329         return;
00330
00331     if(dir == 0L)
00332         dir = BrowserGetDirectory("Select a directory to import :");
00333     if(dir == 0L)
00334         return;
00335
00336     ReportConflict * entries;
00337     ReportWarning * warnings;
00338
00339     if(!CompatImportFilter(dir, entries, warnings))
00340         return;
00341
00342     CPStr modname, vendortag, reltag, path(dir);
00343     CStr logmsg;
00344     bool useDefIgnore;
00345     bool useFilesTime;
00346
00347     if( !CompatGetImport(modname, logmsg, vendortag, reltag, path, useDefIgnore, useFilesTime) )
00348         return;
00349
00350     CvsArgs args;
00351     args.add("import");
00352
00353     if( useFilesTime )
00354     {
00355         args.add("-d");
00356     }
00357
00358     // fill the wrappers
00359     ReportConflict * tmpentry = entries;
00360     if( !useDefIgnore )
00361     {
00362         args.add("-I"); // no default (core, *.o...)
00363         args.add("!");
00364         args.add("-I"); // but ignore the CVS folders
00365         args.add("CVS");
00366     }
00367     while(tmpentry != 0L)
00368     {
00369         if(tmpentry->HasIgnore())
00370         {
00371             CPStr ign;
00372             args.add("-I");
00373             if(tmpentry->IsExtension())
00374                 ign << '*';
00375             ign << tmpentry->GetPattern();
00376             args.add(ign);
00377         }
00378         else if( !tmpentry->HasForceText() &&
00379             (tmpentry->IsBinary() || tmpentry->HasForceBinary() || tmpentry->HasForceNoKeywords() ||
00380             tmpentry->IsUnicode() || tmpentry->HasForceUnicode()) )
00381         {
00382             CPStr wrap;
00383             const char *pattern = tmpentry->GetPattern();
00384             bool hasSpace = strchr(pattern, ' ') != 0L;
00385             args.add("-W");
00386
00387             if( hasSpace )
00388                 wrap << '"';
00389
00390             if( tmpentry->IsExtension() )
00391                 wrap << '*';
00392
00393             wrap << pattern;
00394
00395             if( hasSpace )
00396                 wrap << '"';
00397
00398             if( tmpentry->HasForceNoKeywords() )
00399                 wrap << " -k 'o'";
00400             else if( tmpentry->IsUnicode() || tmpentry->HasForceUnicode() )
00401                 wrap << " -k 'u'";
00402             else
00403                 wrap << " -k 'b'";
00404
00405             args.add(wrap);
00406         }
00407         tmpentry = tmpentry->next;
00408     }
00409
00410     free_list_types(warnings, entries);
00411
00412     args.add("-m");
00413     args.add(cleanUpLogMsg(logmsg));
00414     args.add(modname);
00415     args.add(vendortag);
00416     args.add(reltag);
00417     args.print(path);
00418     launchCVS(path, args.Argc(), args.Argv());
00419 }

void CvsCmdInit ( const char * dir )

Definition at line 295 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, CompatGetInit, CStr, launchCVS, CvsArgs::print, and Authen::skiptoken.

00296 {
00297     if(gCvsPrefs.empty())
00298         return;
00299
00300     bool forceCvsroot;
00301
00302     if(!CompatGetInit(forceCvsroot))
00303         return;
00304
00305     CvsArgs args;
00306
00307     if(forceCvsroot)
00308     {
00309         CStr root;
00310
00311         // extract from the cvsroot
00312         const char *ccvsroot = gCvsPrefs;
00313         ccvsroot = Authen::skiptoken(ccvsroot);
00314         root = gAuthen.token();
00315         root << ccvsroot;
00316         args.add("-d");
00317         args.add(root);
00318     }
00319
00320     args.add("init");
00321     args.print();
00322     launchCVS(0L, args.Argc(), args.Argv());
00323 }

void CvsCmdLine ( void )

Definition at line 1450 of file CvsCommands.cpp.

References CvsArgs::Argc, CvsArgs::Argv, CompatGetCommand, launchCVS, and CvsArgs::print.

Referenced by CWincvsDoc::OnAppCmdline, and UCvsFrame::OnCmdCmdline.

01451 {
01452     CvsArgs args(false);
01453     const char *dir;
01454     if(!CompatGetCommand(args, dir))
01455         return;
01456     args.print(dir);
01457     launchCVS(dir, args.Argc(), args.Argv());
01458 }

void CvsCmdLockFiles ( MultiFiles * mfarg )

Definition at line 1551 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, launchCVS, MultiFiles::next, and CvsArgs::print.

01552 {
01553     if(gCvsPrefs.empty())
01554         return;
01555
01556     MultiFiles mf;
01557     if(mfarg == 0L)
01558     {
01559         if(!BrowserGetMultiFiles("Select files to lock :", mf))
01560             return;
01561         mfarg = &mf;
01562     }
01563
01564     while(mfarg->next())
01565     {
01566         CvsArgs args;
01567         args.add("admin");
01568         args.add("-l");
01569
01570         const char *dir = mfarg->add(args);
01571         args.print(dir);
01572         launchCVS(dir, args.Argc(), args.Argv());
01573     }
01574 }

void CvsCmdLockFolder ( const char * dir )

Definition at line 1710 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, launchCVS, and CvsArgs::print.

01711 {
01712     if(gCvsPrefs.empty())
01713         return;
01714
01715     if(dir == 0L)
01716         dir = BrowserGetDirectory("Select a directory to lock :");
01717     if(dir == 0L)
01718         return;
01719
01720     CvsArgs args;
01721     args.add("admin");
01722     args.add("-l");
01723
01724     args.print(dir);
01725     launchCVS(dir, args.Argc(), args.Argv());
01726 }

void CvsCmdLogFiles | ( | MultiFiles * | mfarg,
 |  | bool | outGraph,
 |  | void * | defWnd
 | ) |

Definition at line 1019 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, BrowserGetMultiFiles, CompatGetLog, CPStr, CvsLogParse, MultiFiles::next, and CvsArgs::print.

01020 {
01021     if(gCvsPrefs.empty())
01022         return;
01023
01024     MultiFiles mf;
01025     if(mfarg == 0L)
01026     {
01027         if(!BrowserGetMultiFiles("Select files to log :", mf))
01028             return;
01029         mfarg = &mf;
01030     }
01031
01032     bool noRecurs;
01033     bool defBranch;
01034     CPStr date;
01035     bool headerOnly;
01036     bool noTags;
01037     bool onlyRCSfile;
01038     bool hasRev;
01039     CPStr rev;
01040     CPStr states;
01041     bool hasUser;
01042     CPStr users;
01043
01044     if( !CompatGetLog(noRecurs, defBranch, date,
01045         headerOnly, noTags, onlyRCSfile, hasRev,
01046         rev, states, hasUser, users,
01047         outGraph) )
01048     {
01049         return;
01050     }
01051
01052     while(mfarg->next())
01053     {
01054         CvsArgs args;
01055         args.add("log");
01056
01057         if(noRecurs)
01058             args.add("-l");
01059         if(defBranch)
01060             args.add("-b");
01061         if(headerOnly)
01062             args.add("-h");
01063         if(noTags)
01064             args.add("-N");
01065         if(onlyRCSfile)
01066             args.add("-R");
01067
01068         if(!date.empty())
01069         {
01070             args.add("-d");
01071             args.add(date);
01072         }
01073         if(!states.empty())
01074         {
01075             args.add("-s");
01076             args.add(states);
01077         }
01078         if(hasRev)
01079         {
01080             CPStr tmp;
01081             tmp = "-r";
01082             tmp << rev;
01083             args.add(tmp);
01084         }
01085         if(hasUser)
01086         {
01087             CPStr tmp;
01088             tmp = "-w";
01089             tmp << users;
01090             args.add(tmp);
01091         }
01092
01093         const char *dir = mfarg->add(args);
01094         args.print(dir);
01095         CvsLogParse(dir, args, outGraph, defWnd);
01096     }
01097 }

void CvsCmdLogFolder ( const char * dir )

Definition at line 1461 of file CvsCommands.cpp.

References CvsArgs::add, BrowserGetDirectory, CompatGetLog, CPStr, CvsLogParse, NULL, and CvsArgs::print.

01462 {
01463     if(gCvsPrefs.empty())
01464         return;
01465
01466     if(dir == 0L)
01467         dir = BrowserGetDirectory("Select a directory to log :");
01468     if(dir == 0L)
01469         return;
01470
01471     bool noRecurs;
01472     bool defBranch;
01473     CPStr date;
01474     bool headerOnly;
01475     bool noTags;
01476     bool onlyRCSfile;
01477     bool hasRev;
01478     CPStr rev;
01479     CPStr states;
01480     bool hasUser;
01481     CPStr users;
01482
01483     if(!CompatGetLog(noRecurs, defBranch, date,
01484         headerOnly, noTags, onlyRCSfile, hasRev,
01485         rev, states, hasUser, users))
01486             return;
01487
01488     CvsArgs args;
01489     args.add("log");
01490
01491     if(noRecurs)
01492         args.add("-l");
01493     if(defBranch)
01494         args.add("-b");
01495     if(headerOnly)
01496         args.add("-h");
01497     if(noTags)
01498         args.add("-N");
01499     if(onlyRCSfile)
01500         args.add("-R");
01501
01502     if(!date.empty())
01503     {
01504         args.add("-d");
01505         args.add(date);
01506     }
01507     if(!states.empty())
01508     {
01509         args.add("-s");
01510         args.add(states);
01511     }
01512     if(hasRev)
01513     {
01514         CPStr tmp;
01515         tmp = "-r";
01516         tmp << rev;
01517         args.add(tmp);
01518     }
01519     if(hasUser)
01520     {
01521         CPStr tmp;
01522         tmp = "-w";
01523         tmp << users;
01524         args.add(tmp);
01525     }
01526
01527     args.print(dir);
01528     CvsLogParse(dir, args, false, NULL);
01529 }

void CvsCmdLogin ( void )

Definition at line 648 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, cvs_err, CvsCmdLogout, launchCVS, CvsArgs::print, pserver, and WaitForCvs.

Referenced by CWincvsDoc::OnAppLogin, and UCvsFrame::OnCmdLogin.

00649 {
00650     if(gCvsPrefs.empty())
00651         return;
00652
00653     if(gAuthen.kind() != pserver)
00654     {
00655         cvs_err("Logging in is only required with pserver authentication (see Preferences dialog).\n"
00656             "Please consult the CVS manual for more details.\n");
00657         return;
00658     }
00659
00660     if(gCvsPrefs.HasLoogedIn() && gCvsPrefs.LogoutTimeOut() > 0)
00661     {
00662         cvs_err("Making automatic logout:\n");
00663         CvsCmdLogout();
00664         WaitForCvs();
00665     }
00666     gCvsPrefs.SetHasLoogedIn(true);
00667
00668     CvsArgs args;
00669     args.add("login");
00670     args.print();
00671     launchCVS(0L, args.Argc(), args.Argv());
00672 }

void CvsCmdLogout ( void )

Definition at line 675 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, cvs_err, launchCVS, CvsArgs::print, and pserver.

Referenced by CvsCmdLogin, CLogoutThread::InitInstance, CWincvsDoc::OnAppLogout, UCvsFrame::OnCmdLogout, and CWincvsApp::SaveAllModified.

00676 {
00677     if(gCvsPrefs.empty())
00678         return;
00679
00680     if(gAuthen.kind() != pserver)
00681     {
00682         cvs_err("Logging out requires pserver authentication (see Preferences dialog).\n"
00683             "Please consult the CVS manual for more details.\n");
00684         return;
00685     }
00686
00687     gCvsPrefs.SetHasLoogedIn(false);
00688
00689     CvsArgs args;
00690     args.add("logout");
00691     args.print();
00692     launchCVS(0L, args.Argc(), args.Argv());
00693 }

void CvsCmdMacrosAdmin ( const char * macroName )

Definition at line 2147 of file CvsCommands.cpp.

References CStr, CTcl_Interp::DoScriptVar, CTcl_Interp::IsAvail, and CTcl_Interp::Unixfy.

02148 {
02149     if(gCvsPrefs.empty() || !CTcl_Interp::IsAvail())
02150         return;
02151
02152     CTcl_Interp interp;
02153     CStr path = macroName;
02154     CTcl_Interp::Unixfy(path);
02155     interp.DoScriptVar("source \"%s\"", (const char *)path);
02156 }

void CvsCmdReleaseFolder ( const char * dir )

Definition at line 2077 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, CompatGetRelease, CStr, cvs_err, launchCVS, CvsArgs::print, and SplitPath.

02078 {
02079     if(gCvsPrefs.empty())
02080         return;
02081
02082     if(dir == 0L)
02083         dir = BrowserGetDirectory("Select a directory to release :");
02084     if(dir == 0L)
02085         return;
02086
02087     CStr uppath, folder;
02088     if( !SplitPath(dir, uppath, folder) )
02089     {
02090         cvs_err("Unable to convert path name '%s'\n", dir);
02091         //even thought something didn't work we will try to continue and put all the responsibility onto the user
02092         uppath = dir;
02093         folder = ".";
02094     }
02095
02096     bool removeDirectory = false;
02097
02098     if( !CompatGetRelease(dir, removeDirectory) )
02099     {
02100         return;
02101     }
02102
02103     CvsArgs args;
02104     args.add("release");
02105     if( removeDirectory )
02106         args.add("-d");
02107     args.add(folder);
02108
02109     args.print(uppath);
02110     launchCVS(uppath, args.Argc(), args.Argv());
02111 }

void CvsCmdRemoveFiles ( MultiFiles * mfarg )

Definition at line 1372 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, CompatBeginMoveToTrash, CompatEndMoveToTrash, launchCVS, MultiFiles::next, and CvsArgs::print.

01373 {
01374     if(gCvsPrefs.empty())
01375         return;
01376
01377     MultiFiles mf;
01378     if(mfarg == 0L)
01379     {
01380         if(!BrowserGetMultiFiles("Select files to remove :", mf))
01381             return;
01382         mfarg = &mf;
01383     }
01384
01385     while(mfarg->next())
01386     {
01387         RemoveCvsArgs args;
01388
01389         CompatBeginMoveToTrash();
01390
01391         args.add("remove");
01392         const char *dir = mfarg->add(args);
01393         args.print(dir);
01394
01395         CompatEndMoveToTrash();
01396
01397         launchCVS(dir, args.Argc(), args.Argv());
01398     }
01399 }

void CvsCmdRtagBranch ( void )

Definition at line 604 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, CompatRtagBranch, CPStr, launchCVS, and CvsArgs::print.

Referenced by CWincvsDoc::OnAppRtagBranch, and UCvsFrame::OnCmdRtagBranch.

00605 {
00606     if(gCvsPrefs.empty())
00607         return;
00608
00609     bool norecurs;
00610     bool useMostRecent;
00611     bool lookAttic;
00612     CPStr modname;
00613     CPStr branchname;
00614     CPStr date;
00615     CPStr rev;
00616
00617     if(!CompatRtagBranch(norecurs, branchname, modname, date, rev,
00618         useMostRecent, lookAttic))
00619             return;
00620
00621     CvsArgs args;
00622     args.add("rtag");
00623     args.add("-b");
00624     if(norecurs)
00625         args.add("-l");
00626     if(useMostRecent)
00627         args.add("-f");
00628     if(lookAttic)
00629         args.add("-a");
00630     if(!date.empty())
00631     {
00632         args.add("-D");
00633         args.add(date);
00634     }
00635     if(!rev.empty())
00636     {
00637         args.add("-r");
00638         args.add(rev);
00639     }
00640
00641     args.add(branchname);
00642     args.add(modname);
00643     args.print();
00644     launchCVS(0L, args.Argc(), args.Argv());
00645 }

void CvsCmdRtagCreate ( void )

Definition at line 530 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, CompatRtagCreate, CPStr, launchCVS, and CvsArgs::print.

Referenced by CWincvsDoc::OnAppRtagNew, and UCvsFrame::OnCmdRtagNew.

00531 {
00532     if(gCvsPrefs.empty())
00533         return;
00534
00535     bool norecurs;
00536     bool useMostRecent;
00537     bool overwriteExisting;
00538     bool lookAttic;
00539     CPStr modname;
00540     CPStr tagname;
00541     CPStr date;
00542     CPStr rev;
00543
00544     if(!CompatRtagCreate(norecurs, overwriteExisting, tagname, modname, date, rev,
00545         useMostRecent, lookAttic))
00546             return;
00547
00548     CvsArgs args;
00549     args.add("rtag");
00550     if(norecurs)
00551         args.add("-l");
00552     if(useMostRecent)
00553         args.add("-f");
00554     if(overwriteExisting)
00555         args.add("-F");
00556     if(lookAttic)
00557         args.add("-a");
00558     if(!date.empty())
00559     {
00560         args.add("-D");
00561         args.add(date);
00562     }
00563     if(!rev.empty())
00564     {
00565         args.add("-r");
00566         args.add(rev);
00567     }
00568
00569     args.add(tagname);
00570     args.add(modname);
00571     args.print();
00572     launchCVS(0L, args.Argc(), args.Argv());
00573 }

void CvsCmdRtagDelete ( void )

Definition at line 576 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, CompatRtagDelete, CPStr, launchCVS, and CvsArgs::print.

Referenced by CWincvsDoc::OnAppRtagDelete, and UCvsFrame::OnCmdRtagDelete.

00577 {
00578     if(gCvsPrefs.empty())
00579         return;
00580
00581     bool norecurs;
00582     bool lookAttic;
00583     CPStr modname;
00584     CPStr tagname;
00585
00586     if(!CompatRtagDelete(norecurs, lookAttic, tagname, modname))
00587             return;
00588
00589     CvsArgs args;
00590     args.add("rtag");
00591     args.add("-d");
00592     if(norecurs)
00593         args.add("-l");
00594     if(lookAttic)
00595         args.add("-a");
00596
00597     args.add(tagname);
00598     args.add(modname);
00599     args.print();
00600     launchCVS(0L, args.Argc(), args.Argv());
00601 }

void CvsCmdStatusFiles ( MultiFiles * mfarg )

Definition at line 1402 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, launchCVS, MultiFiles::next, and CvsArgs::print.

01403 {
01404     if(gCvsPrefs.empty())
01405         return;
01406
01407     MultiFiles mf;
01408     if(mfarg == 0L)
01409     {
01410         if(!BrowserGetMultiFiles("Select files to status :", mf))
01411             return;
01412         mfarg = &mf;
01413     }
01414
01415     while(mfarg->next())
01416     {
01417         CvsArgs args;
01418         args.add("status");
01419         args.add("-v");
01420         const char *dir = mfarg->add(args);
01421         args.print(dir);
01422         launchCVS(dir, args.Argc(), args.Argv());
01423     }
01424 }

void CvsCmdStatusFolder ( const char * dir )

Definition at line 1532 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, launchCVS, and CvsArgs::print.

01533 {
01534     if(gCvsPrefs.empty())
01535         return;
01536
01537     if(dir == 0L)
01538         dir = BrowserGetDirectory("Select a directory to get status :");
01539     if(dir == 0L)
01540         return;
01541
01542     CvsArgs args;
01543     args.add("status");
01544     args.add("-v");
01545
01546     args.print(dir);
01547     launchCVS(dir, args.Argc(), args.Argv());
01548 }

void CvsCmdTagBranchFiles ( MultiFiles * mfarg )

Definition at line 1674 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, CompatTagBranch, CPStr, launchCVS, MultiFiles::next, and CvsArgs::print.

01675 {
01676     if(gCvsPrefs.empty())
01677         return;
01678
01679     MultiFiles mf;
01680     if(mfarg == 0L)
01681     {
01682         if(!BrowserGetMultiFiles("Select files to branch :", mf))
01683             return;
01684         mfarg = &mf;
01685     }
01686
01687     bool noRecurs, checkUnmod;
01688     CPStr branchName;
01689     if(!CompatTagBranch(noRecurs, branchName, checkUnmod))
01690         return;
01691
01692     while(mfarg->next())
01693     {
01694         CvsArgs args;
01695         args.add("tag");
01696         args.add("-b");
01697         if(noRecurs)
01698             args.add("-l");
01699         if(checkUnmod)
01700             args.add("-c");
01701         args.add(branchName);
01702
01703         const char *dir = mfarg->add(args);
01704         args.print(dir);
01705         launchCVS(dir, args.Argc(), args.Argv());
01706     }
01707 }

void CvsCmdTagBranchFolder ( const char * dir )

Definition at line 1805 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, CompatTagBranch, CPStr, launchCVS, and CvsArgs::print.

01806 {
01807     if(gCvsPrefs.empty())
01808         return;
01809
01810     if(dir == 0L)
01811         dir = BrowserGetDirectory("Select a directory to branch :");
01812     if(dir == 0L)
01813         return;
01814
01815     bool noRecurs, checkUnmod;
01816     CPStr tagName;
01817     if(!CompatTagBranch(noRecurs, tagName, checkUnmod))
01818         return;
01819
01820     CvsArgs args;
01821     args.add("tag");
01822     args.add("-b");
01823     if(noRecurs)
01824         args.add("-l");
01825     if(checkUnmod)
01826         args.add("-c");
01827     args.add(tagName);
01828
01829     args.print(dir);
01830     launchCVS(dir, args.Argc(), args.Argv());
01831 }

void CvsCmdTagCreateFiles ( MultiFiles * mfarg )

Definition at line 1603 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, CompatTagCreate, CPStr, launchCVS, MultiFiles::next, and CvsArgs::print.

01604 {
01605     if(gCvsPrefs.empty())
01606         return;
01607
01608     MultiFiles mf;
01609     if(mfarg == 0L)
01610     {
01611         if(!BrowserGetMultiFiles("Select files to tag :", mf))
01612             return;
01613         mfarg = &mf;
01614     }
01615
01616     bool noRecurs, overwriteExisting, checkUnmod;
01617     CPStr tagName;
01618     if(!CompatTagCreate(noRecurs, overwriteExisting, tagName, checkUnmod))
01619         return;
01620
01621     while(mfarg->next())
01622     {
01623         CvsArgs args;
01624         args.add("tag");
01625         if(noRecurs)
01626             args.add("-l");
01627         if(overwriteExisting)
01628             args.add("-F");
01629         if(checkUnmod)
01630             args.add("-c");
01631         args.add(tagName);
01632
01633         const char *dir = mfarg->add(args);
01634         args.print(dir);
01635         launchCVS(dir, args.Argc(), args.Argv());
01636     }
01637 }

void CvsCmdTagCreateFolder ( const char * dir )

Definition at line 1748 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, CompatTagCreate, CPStr, launchCVS, and CvsArgs::print.

01749 {
01750     if(gCvsPrefs.empty())
01751         return;
01752
01753     if(dir == 0L)
01754         dir = BrowserGetDirectory("Select a directory to tag :");
01755     if(dir == 0L)
01756         return;
01757
01758     bool noRecurs, overwriteExisting, checkUnmod;
01759     CPStr tagName;
01760     if(!CompatTagCreate(noRecurs, overwriteExisting, tagName, checkUnmod))
01761         return;
01762
01763     CvsArgs args;
01764     args.add("tag");
01765     if(noRecurs)
01766         args.add("-l");
01767     if(overwriteExisting)
01768         args.add("-F");
01769     if(checkUnmod)
01770         args.add("-c");
01771     args.add(tagName);
01772
01773     args.print(dir);
01774     launchCVS(dir, args.Argc(), args.Argv());
01775 }

void CvsCmdTagDeleteFiles ( MultiFiles * mfarg )

Definition at line 1640 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, CompatTagDelete, CPStr, launchCVS, MultiFiles::next, and CvsArgs::print.

01641 {
01642     if(gCvsPrefs.empty())
01643         return;
01644
01645     MultiFiles mf;
01646     if(mfarg == 0L)
01647     {
01648         if(!BrowserGetMultiFiles("Select files to untag :", mf))
01649             return;
01650         mfarg = &mf;
01651     }
01652
01653     bool noRecurs;
01654     CPStr tagName;
01655     if(!CompatTagDelete(noRecurs, tagName))
01656         return;
01657
01658     while(mfarg->next())
01659     {
01660         CvsArgs args;
01661         args.add("tag");
01662         args.add("-d");
01663         if(noRecurs)
01664             args.add("-l");
01665         args.add(tagName);
01666
01667         const char *dir = mfarg->add(args);
01668         args.print(dir);
01669         launchCVS(dir, args.Argc(), args.Argv());
01670     }
01671 }

void CvsCmdTagDeleteFolder ( const char * dir )

Definition at line 1778 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, CompatTagDelete, CPStr, launchCVS, and CvsArgs::print.

01779 {
01780     if(gCvsPrefs.empty())
01781         return;
01782
01783     if(dir == 0L)
01784         dir = BrowserGetDirectory("Select a directory to untag :");
01785     if(dir == 0L)
01786         return;
01787
01788     bool noRecurs;
01789     CPStr tagName;
01790     if(!CompatTagDelete(noRecurs, tagName))
01791         return;
01792
01793     CvsArgs args;
01794     args.add("tag");
01795     args.add("-d");
01796     if(noRecurs)
01797         args.add("-l");
01798     args.add(tagName);
01799
01800     args.print(dir);
01801     launchCVS(dir, args.Argc(), args.Argv());
01802 }

void CvsCmdUneditFiles ( MultiFiles * mfarg )

Definition at line 1871 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, launchCVS, MultiFiles::next, and CvsArgs::print.

01872 {
01873     if(gCvsPrefs.empty())
01874         return;
01875
01876     MultiFiles mf;
01877     if(mfarg == 0L)
01878     {
01879         if(!BrowserGetMultiFiles("Select the files to unedit :", mf))
01880             return;
01881         mfarg = &mf;
01882     }
01883
01884     while(mfarg->next())
01885     {
01886         CvsArgs args;
01887         args.add("unedit");
01888
01889         const char *dir = mfarg->add(args);
01890         args.print(dir);
01891         launchCVS(dir, args.Argc(), args.Argv());
01892     }
01893 }

void CvsCmdUneditFolder ( const char * dir )

Definition at line 2024 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, launchCVS, and CvsArgs::print.

02025 {
02026     if(gCvsPrefs.empty())
02027         return;
02028
02029     if(dir == 0L)
02030         dir = BrowserGetDirectory("Select a directory to unedit :");
02031     if(dir == 0L)
02032         return;
02033
02034     CvsArgs args;
02035     args.add("unedit");
02036
02037     args.print(dir);
02038     launchCVS(dir, args.Argc(), args.Argv());
02039 }

void CvsCmdUnlockFiles ( MultiFiles * mfarg )

Definition at line 1577 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, launchCVS, MultiFiles::next, and CvsArgs::print.

01578 {
01579     if(gCvsPrefs.empty())
01580         return;
01581
01582     MultiFiles mf;
01583     if(mfarg == 0L)
01584     {
01585         if(!BrowserGetMultiFiles("Select files to unlock :", mf))
01586             return;
01587         mfarg = &mf;
01588     }
01589
01590     while(mfarg->next())
01591     {
01592         CvsArgs args;
01593         args.add("admin");
01594         args.add("-u");
01595
01596         const char *dir = mfarg->add(args);
01597         args.print(dir);
01598         launchCVS(dir, args.Argc(), args.Argv());
01599     }
01600 }

void CvsCmdUnlockFolder ( const char * dir )

Definition at line 1729 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, launchCVS, and CvsArgs::print.

01730 {
01731     if(gCvsPrefs.empty())
01732         return;
01733
01734     if(dir == 0L)
01735         dir = BrowserGetDirectory("Select a directory to unlock :");
01736     if(dir == 0L)
01737         return;
01738
01739     CvsArgs args;
01740     args.add("admin");
01741     args.add("-u");
01742
01743     args.print(dir);
01744     launchCVS(dir, args.Argc(), args.Argv());
01745 }

void CvsCmdUpdateFiles | ( | MultiFiles * | mfarg,
 |  | bool | queryOnly
 | ) |

Definition at line 696 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, CompatGetUpdate, CPStr, launchCVS, MultiFiles::next, and CvsArgs::print.

00697 {
00698     if(gCvsPrefs.empty())
00699         return;
00700
00701     MultiFiles mf;
00702     if(mfarg == 0L)
00703     {
00704         if(!BrowserGetMultiFiles("Select files to update :", mf))
00705             return;
00706         mfarg = &mf;
00707     }
00708
00709     bool toStdout;
00710     bool noRecurs;
00711     bool resetSticky;
00712     CPStr date;
00713     CPStr rev;
00714     bool useMostRecent;
00715     CPStr rev1;
00716     CPStr rev2;
00717     bool createMissDir;
00718     bool getCleanCopy;
00719
00720     if(!queryOnly && !CompatGetUpdate(toStdout, noRecurs, resetSticky,
00721         date, rev, useMostRecent, rev1, rev2, createMissDir, getCleanCopy))
00722         return;
00723
00724     while(mfarg->next())
00725     {
00726         CvsArgs args;
00727
00728         if(queryOnly)
00729             args.add("-n");
00730
00731         args.add("update");
00732
00733         if(!queryOnly)
00734         {
00735             if(resetSticky)
00736                 args.add("-A");
00737
00738             if(createMissDir)
00739                 args.add("-d");
00740
00741             if(getCleanCopy)
00742                 args.add("-C");
00743
00744             if(!date.empty())
00745             {
00746                 args.add("-D");
00747                 args.add(date);
00748             }
00749
00750             if(useMostRecent)
00751                 args.add("-f");
00752
00753             if(!rev1.empty())
00754             {
00755                 CPStr tmp;
00756                 tmp = "-j";
00757                 tmp << rev1;
00758                 args.add(tmp);
00759             }
00760
00761             if(!rev2.empty())
00762             {
00763                 CPStr tmp;
00764                 tmp = "-j";
00765                 tmp << rev2;
00766                 args.add(tmp);
00767             }
00768
00769             /*if(noRecurs)
00770                 args.add("-l");*/
00771
00772             if(toStdout)
00773                 args.add("-p");
00774
00775             if(!rev.empty())
00776             {
00777                 args.add("-r");
00778                 args.add(rev);
00779             }
00780         }
00781
00782         const char *dir = mfarg->add(args);
00783         args.print(dir);
00784         launchCVS(dir, args.Argc(), args.Argv());
00785     }
00786 }

void CvsCmdUpdateFolder | ( | const char * | dir,
 |  | bool | queryOnly
 | ) |

Definition at line 100 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, CompatGetUpdate, CPStr, launchCVS, and CvsArgs::print.

00101 {
00102     if(gCvsPrefs.empty())
00103         return;
00104
00105     if(dir == 0L)
00106         dir = BrowserGetDirectory("Select a directory to update :");
00107     if(dir == 0L)
00108         return;
00109
00110     bool toStdout;
00111     bool noRecurs;
00112     bool resetSticky;
00113     CPStr date;
00114     CPStr rev;
00115     bool useMostRecent;
00116     CPStr rev1;
00117     CPStr rev2;
00118     bool createMissDir;
00119     bool getCleanCopy;
00120
00121     if(!queryOnly && !CompatGetUpdate(toStdout, noRecurs, resetSticky,
00122         date, rev, useMostRecent, rev1, rev2, createMissDir, getCleanCopy))
00123         return;
00124
00125     CvsArgs args;
00126     if(queryOnly)
00127         args.add("-n");
00128     args.add("update");
00129     if(gCvsPrefs.PruneOption())
00130         args.add("-P");
00131
00132     if(!queryOnly)
00133     {
00134         if(resetSticky)
00135             args.add("-A");
00136         if(createMissDir)
00137             args.add("-d");
00138         if(getCleanCopy)
00139             args.add("-C");
00140         if(!date.empty())
00141         {
00142             args.add("-D");
00143             args.add(date);
00144         }
00145         if(useMostRecent)
00146             args.add("-f");
00147         if(!rev1.empty())
00148         {
00149             CPStr tmp;
00150             tmp = "-j";
00151             tmp << rev1;
00152             args.add(tmp);
00153         }
00154         if(!rev2.empty())
00155         {
00156             CPStr tmp;
00157             tmp = "-j";
00158             tmp << rev2;
00159             args.add(tmp);
00160         }
00161         if(noRecurs)
00162             args.add("-l");
00163         if(toStdout)
00164             args.add("-p");
00165         if(!rev.empty())
00166         {
00167             args.add("-r");
00168             args.add(rev);
00169         }
00170     }
00171
00172     args.print(dir);
00173     launchCVS(dir, args.Argc(), args.Argv());
00174 }

void CvsCmdWatchersFiles ( MultiFiles * mfarg )

Definition at line 1945 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, launchCVS, MultiFiles::next, and CvsArgs::print.

01946 {
01947     if(gCvsPrefs.empty())
01948         return;
01949
01950     MultiFiles mf;
01951     if(mfarg == 0L)
01952     {
01953         if(!BrowserGetMultiFiles("Select the files to get the watchers from :", mf))
01954             return;
01955         mfarg = &mf;
01956     }
01957
01958     while(mfarg->next())
01959     {
01960         CvsArgs args;
01961         args.add("watchers");
01962
01963         const char *dir = mfarg->add(args);
01964         args.print(dir);
01965         launchCVS(dir, args.Argc(), args.Argv());
01966     }
01967 }

void CvsCmdWatchersFolder ( const char * dir )

Definition at line 2113 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, launchCVS, and CvsArgs::print.

02114 {
02115     if(gCvsPrefs.empty())
02116         return;
02117
02118     if(dir == 0L)
02119         dir = BrowserGetDirectory("Select a directory to get the watchers from :");
02120     if(dir == 0L)
02121         return;
02122
02123     CvsArgs args;
02124     args.add("watchers");
02125
02126     args.print(dir);
02127     launchCVS(dir, args.Argc(), args.Argv());
02128 }

void CvsCmdWatchOffFiles ( MultiFiles * mfarg )

Definition at line 1920 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, launchCVS, MultiFiles::next, and CvsArgs::print.

01921 {
01922     if(gCvsPrefs.empty())
01923         return;
01924
01925     MultiFiles mf;
01926     if(mfarg == 0L)
01927     {
01928         if(!BrowserGetMultiFiles("Select the files to unwatch :", mf))
01929             return;
01930         mfarg = &mf;
01931     }
01932
01933     while(mfarg->next())
01934     {
01935         CvsArgs args;
01936         args.add("watch");
01937         args.add("remove");
01938
01939         const char *dir = mfarg->add(args);
01940         args.print(dir);
01941         launchCVS(dir, args.Argc(), args.Argv());
01942     }
01943 }

void CvsCmdWatchOffFolder ( const char * dir )

Definition at line 2059 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, launchCVS, and CvsArgs::print.

02060 {
02061     if(gCvsPrefs.empty())
02062         return;
02063
02064     if(dir == 0L)
02065         dir = BrowserGetDirectory("Select a directory to unwatch :");
02066     if(dir == 0L)
02067         return;
02068
02069     CvsArgs args;
02070     args.add("watch");
02071     args.add("remove");
02072
02073     args.print(dir);
02074     launchCVS(dir, args.Argc(), args.Argv());
02075 }

void CvsCmdWatchOnFiles ( MultiFiles * mfarg )

Definition at line 1895 of file CvsCommands.cpp.

References MultiFiles::add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetMultiFiles, launchCVS, MultiFiles::next, and CvsArgs::print.

01896 {
01897     if(gCvsPrefs.empty())
01898         return;
01899
01900     MultiFiles mf;
01901     if(mfarg == 0L)
01902     {
01903         if(!BrowserGetMultiFiles("Select the files to watch :", mf))
01904             return;
01905         mfarg = &mf;
01906     }
01907
01908     while(mfarg->next())
01909     {
01910         CvsArgs args;
01911         args.add("watch");
01912         args.add("add");
01913
01914         const char *dir = mfarg->add(args);
01915         args.print(dir);
01916         launchCVS(dir, args.Argc(), args.Argv());
01917     }
01918 }

void CvsCmdWatchOnFolder ( const char * dir )

Definition at line 2041 of file CvsCommands.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, BrowserGetDirectory, launchCVS, and CvsArgs::print.

02042 {
02043     if(gCvsPrefs.empty())
02044         return;
02045
02046     if(dir == 0L)
02047         dir = BrowserGetDirectory("Select a directory to watch :");
02048     if(dir == 0L)
02049         return;
02050
02051     CvsArgs args;
02052     args.add("watch");
02053     args.add("add");
02054
02055     args.print(dir);
02056     launchCVS(dir, args.Argc(), args.Argv());
02057 }

void FlatenSubFolders ( UStr & tmpf ) [static]

Definition at line 861 of file CvsCommands.cpp.

References CStr.

Referenced by CvsCmdAnnotateFiles, and CvsCmdDiffFiles.

00862 {
00863     char* cp = (char*)tmpf;
00864     if (cp)
00865     {
00866         while(*cp)
00867         {
00868             if (*cp == kPathDelimiter)
00869             {
00870                 *cp = '.';
00871             }
00872             cp++;
00873         }
00874     }
00875 }

Generated on Sun Feb 24 01:21:50 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsCommands.h File Reference

common/CvsCommands.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Enumerations

enum kEditCmdType {
kEditNormal,
kEditReserved,
kEditForce
}
Cvs Edit command type enum. More...

Functions

char * | cleanUpLogMsg (const char *msg)
void | CvsCmdUpdateFolder (const char *dir=0L, bool queryOnly=false)
void | CvsCmdCommitFolder (const char *dir=0L)
void | CvsCmdDiffFolder (const char *dir=0L)
void | CvsCmdAddFolder (const char *dir=0L)
void | CvsCmdLogFolder (const char *dir=0L)
void | CvsCmdStatusFolder (const char *dir=0L)
void | CvsCmdLockFolder (const char *dir=0L)
void | CvsCmdUnlockFolder (const char *dir=0L)
void | CvsCmdTagCreateFolder (const char *dir=0L)
void | CvsCmdTagDeleteFolder (const char *dir=0L)
void | CvsCmdTagBranchFolder (const char *dir=0L)
void | CvsCmdInit (const char *dir=0L)
void | CvsCmdImportModule (const char *dir=0L)
void | CvsCmdCheckoutModule (const char *dir=0L)
void | CvsCmdRtagCreate (void)
void | CvsCmdRtagDelete (void)
void | CvsCmdRtagBranch (void)
void | CvsCmdLogin (void)
void | CvsCmdLogout (void)
void | CvsCmdUpdateFiles (MultiFiles *mf=0L, bool queryOnly=false)
void | CvsCmdCommitFiles (MultiFiles *mf=0L)
void | CvsCmdDiffFiles (MultiFiles *mf=0L)
void | CvsCmdAnnotateFiles (MultiFiles *mf=0L)
void | CvsCmdLogFiles (MultiFiles *mf=0L, bool outGraph=false, void *defWnd=0L)
void | CvsCmdAddFiles (MultiFiles *mf=0L)
void | CvsCmdAddBinaryFiles (MultiFiles *mf=0L)
void | CvsCmdAddUnicodeFiles (MultiFiles *mf=0L)
void | CvsCmdRemoveFiles (MultiFiles *mf=0L)
void | CvsCmdStatusFiles (MultiFiles *mf=0L)
void | CvsCmdCancelChangesFiles (MultiFiles *mf=0L)
void | CvsCmdLockFiles (MultiFiles *mf=0L)
void | CvsCmdUnlockFiles (MultiFiles *mf=0L)
void | CvsCmdTagCreateFiles (MultiFiles *mf=0L)
void | CvsCmdTagDeleteFiles (MultiFiles *mf=0L)
void | CvsCmdTagBranchFiles (MultiFiles *mf=0L)
void | CvsCmdLine (void)
void | CvsCmdEditFiles (MultiFiles *mf=0L, kEditCmdType editType=kEditNormal)
void | CvsCmdUneditFiles (MultiFiles *mf=0L)
void | CvsCmdWatchOnFiles (MultiFiles *mf=0L)
void | CvsCmdWatchOffFiles (MultiFiles *mf=0L)
void | CvsCmdWatchersFiles (MultiFiles *mf=0L)
void | CvsCmdEditorsFiles (MultiFiles *mf=0L)
void | CvsCmdEditFolder (const char *dir=0L, kEditCmdType editType=kEditNormal)
void | CvsCmdUneditFolder (const char *dir=0L)
void | CvsCmdWatchOnFolder (const char *dir=0L)
void | CvsCmdWatchOffFolder (const char *dir=0L)
void | CvsCmdReleaseFolder (const char *dir=0L)
void | CvsCmdWatchersFolder (const char *dir=0L)
void | CvsCmdEditorsFolder (const char *dir=0L)
void | CvsCmdMacrosAdmin (const char *macroName)

Enumeration Type Documentation

enum kEditCmdType

Cvs Edit command type enum.

Enumeration values:
kEditNormal | cvs edit
kEditReserved | cvs edit -c
kEditForce | cvs edit -f

Definition at line 29 of file CvsCommands.h.

Referenced by cleanUpLogMsg, CvsCmdEditFiles, and CvsCmdEditFolder.

00030 {
00031     kEditNormal,
00032     kEditReserved,
00033     kEditForce
00034 } kEditCmdType;

Function Documentation

char* cleanUpLogMsg ( const char * msg )

Definition at line 73 of file CvsCommands.cpp.

References kEditCmdType, and kEditNormal.

Referenced by CvsCmdCommitFiles, CvsCmdCommitFolder, CvsCmdImportModule, CGraphView::OnGraphChangelogmessage, CGraphView::OnGraphSetdescription, and CGraphView::OnGraphSetstate.

00074 {
00075     static CStaticAllocT<char> buf;
00076
00077     size_t len = strlen(msg);
00078     buf.AdjustSize(len + 1);
00079
00080     char *tmp = buf;
00081     char c;
00082     while((c = *msg++) != '\0')
00083     {
00084 #ifdef WIN32
00085         if(c == '\r')
00086             continue;
00087 #endif /* WIN32 */
00088 #ifdef macintosh
00089         if(c == '\r')
00090             c = '\n';
00091 #endif /* macintosh */
00092         *tmp++ = c;
00093     }
00094     *tmp++ = '\0';
00095
00096     return buf;
00097 }

void CvsCmdAddBinaryFiles ( MultiFiles * mf = 0L )

Definition at line 1261 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdAddb, and KoAddBinaryHandler::OnFiles.

01262 {
01263     if(gCvsPrefs.empty())
01264         return;
01265
01266     MultiFiles mf;
01267     if(mfarg == 0L)
01268     {
01269         if(!BrowserGetMultiFiles("Select binary files to add :", mf))
01270             return;
01271         mfarg = &mf;
01272     }
01273
01274     while(mfarg->next())
01275     {
01276         AddBinCvsArgs args;
01277         args.add("add");
01278         args.add("-kb");
01279         const char *dir = mfarg->add(args);
01280
01281         if(!args.HasProblem() || !CvsAlert("Some problems have been found while adding binary files and should be corrected",
01282                 "Cancel", "Ignore"))
01283         {
01284             args.print(dir);
01285             launchCVS(dir, args.Argc(), args.Argv());
01286         }
01287     }
01288 }

void CvsCmdAddFiles ( MultiFiles * mf = 0L )

Definition at line 1219 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdAdd, and KoAddHandler::OnFiles.

01220 {
01221     if(gCvsPrefs.empty())
01222         return;
01223
01224     MultiFiles mf;
01225     if(mfarg == 0L)
01226     {
01227         if(!BrowserGetMultiFiles("Select files to add :", mf))
01228             return;
01229         mfarg = &mf;
01230     }
01231
01232     while(mfarg->next())
01233     {
01234         AddCvsArgs args;
01235         args.add("add");
01236         const char *dir = mfarg->add(args);
01237
01238         if(!args.HasProblem() || !CvsAlert("Some problems have been found while adding files and should be corrected",
01239                 "Cancel", "Ignore"))
01240         {
01241             args.print(dir);
01242             launchCVS(dir, args.Argc(), args.Argv());
01243         }
01244     }
01245 }

void CvsCmdAddFolder ( const char * dir = 0L )

Definition at line 270 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdAdd, UCvsFiles::OnCmdAdd, UCvsFiles::OnCmdAddb, KoAddUnicodeHandler::OnFolder, KoAddBinaryHandler::OnFolder, KoAddHandler::OnFolder, and CWinCvsBrowser::OnViewAdd.

00271 {
00272     if(gCvsPrefs.empty())
00273         return;
00274
00275     if(dir == 0L)
00276         dir = BrowserGetDirectory("Select a directory to add :");
00277     if(dir == 0L)
00278         return;
00279
00280     CStr uppath, folder;
00281     if(!SplitPath(dir, uppath, folder))
00282     {
00283         cvs_err("Unable to convert path name '%s'\n", dir);
00284         return;
00285     }
00286
00287     CvsArgs args;
00288     args.add("add");
00289     args.add(folder);
00290     args.print(uppath);
00291     launchCVS(uppath, args.Argc(), args.Argv());
00292 }

void CvsCmdAddUnicodeFiles ( MultiFiles * mf = 0L )

Definition at line 1304 of file CvsCommands.cpp.

Referenced by KoAddUnicodeHandler::OnFiles.

01305 {
01306     if(gCvsPrefs.empty())
01307         return;
01308
01309     MultiFiles mf;
01310     if(mfarg == 0L)
01311     {
01312         if(!BrowserGetMultiFiles("Select unicode files to add :", mf))
01313             return;
01314         mfarg = &mf;
01315     }
01316
01317     while(mfarg->next())
01318     {
01319         AddUnicodeCvsArgs args;
01320         args.add("add");
01321         args.add("-ku");
01322         const char *dir = mfarg->add(args);
01323
01324         if(!args.HasProblem() || !CvsAlert("Some problems have been found while adding unicode files and should be corrected",
01325                 "Cancel", "Ignore"))
01326         {
01327             args.print(dir);
01328             launchCVS(dir, args.Argc(), args.Argv());
01329         }
01330     }
01331 }

void CvsCmdAnnotateFiles ( MultiFiles * mf = 0L )

Definition at line 2159 of file CvsCommands.cpp.

Referenced by KoAnnotateHandler::OnFiles.

02160 {
02161     if(gCvsPrefs.empty())
02162         return;
02163
02164     MultiFiles mf;
02165     if(mfarg == 0L)
02166     {
02167         if(!BrowserGetMultiFiles("Select files to annotate :", mf))
02168             return;
02169         mfarg = &mf;
02170     }
02171
02172     bool noRecurs;
02173     bool isDate;
02174     CPStr rev;
02175     bool force;
02176
02177     if(!CompatGetAnnotate(noRecurs, isDate, rev, force))
02178         return;
02179
02180     while(mfarg->next())
02181     {
02182         CStr path, filename, ext, base;
02183         CStr file;
02184         for(int i = 0; ; i++)
02185         {
02186             if(!mfarg->get(i, path, filename))
02187                 break;
02188             // note that filename can contain subfolders
02189
02190             GetExtension(filename, base, ext);
02191
02192             CvsArgs args;
02193             CStr tmpf(base);
02194             if(!rev.empty())
02195             {
02196                 tmpf << "_ann_";
02197                 tmpf << rev;
02198                 tmpf << '_';
02199             }
02200             else
02201                 tmpf << "_ann_";
02202
02203             // convert subfolder names to regular name
02204             FlatenSubFolders(tmpf);
02205
02206             args.add("annotate");
02207             if(noRecurs)
02208             {
02209                 args.add("-l");
02210             }
02211             if(force)
02212             {
02213                 args.add("-f");
02214             }
02215             if(!rev.empty())
02216             {
02217                 args.add(isDate ? "-D" : "-r");
02218                 args.add(rev);
02219             }
02220             args.add(filename);
02221             args.print(path);
02222             file = launchCVS(path, args, (const char *)tmpf, ext);
02223 #ifdef qMacCvsPP
02224             decodeCVS (file);
02225 #endif
02226
02227             if(file.empty())
02228                 continue;
02229
02230             LaunchViewer(file, true);
02231         }
02232     }
02233 }

void CvsCmdCancelChangesFiles ( MultiFiles * mf = 0L )

Definition at line 1427 of file CvsCommands.cpp.

01428 {
01429     if(gCvsPrefs.empty())
01430         return;
01431
01432     MultiFiles mf;
01433     if(mfarg == 0L)
01434     {
01435         if(!BrowserGetMultiFiles("Select files to cancel changes :", mf))
01436             return;
01437         mfarg = &mf;
01438     }
01439
01440     while(mfarg->next())
01441     {
01442         RemoveCvsArgs args;
01443         args.add("update");
01444         const char *dir = mfarg->add(args);
01445         args.print(dir);
01446         launchCVS(dir, args.Argc(), args.Argv());
01447     }
01448 }

void CvsCmdCheckoutModule ( const char * dir = 0L )

Definition at line 422 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdCheckout, CWinCvsBrowser::OnViewCheckout, CExploreBar::OnViewCheckout, and CBrowseFileView::OnViewCheckout.

00423 {
00424     if(gCvsPrefs.empty())
00425         return;
00426
00427 #ifndef WIN32
00428     if(dir == 0L)
00429         dir = BrowserGetDirectory("Select a directory to checkout to :");
00430     if(dir == 0L)
00431         return;
00432 #endif
00433
00434     bool norecurs;
00435     CPStr modname;
00436     CPStr path(dir);
00437     bool toStdout;
00438     CPStr date;
00439     CPStr rev;
00440     bool useMostRecent;
00441     CPStr rev1;
00442     CPStr rev2;
00443     bool doexport;
00444     bool forceCvsroot;
00445     bool overrideCheckoutDir;
00446     CPStr checkoutDir;
00447
00448     if( !CompatGetCheckout(modname, path, norecurs,
00449         toStdout, date, rev, useMostRecent, rev1, rev2, doexport, forceCvsroot,
00450         overrideCheckoutDir, checkoutDir) )
00451     {
00452         return;
00453     }
00454
00455     CvsArgs args;
00456
00457     if(forceCvsroot)
00458     {
00459         CStr root;
00460
00461         // extract from the cvsroot
00462         const char *ccvsroot = gCvsPrefs;
00463         ccvsroot = Authen::skiptoken(ccvsroot);
00464         root = gAuthen.token();
00465         root << ccvsroot;
00466         args.add("-d");
00467         args.add(root);
00468     }
00469
00470     args.add(doexport ? "export" : "checkout");
00471
00472     if(gCvsPrefs.PruneOption() && !doexport)
00473         args.add("-P");
00474
00475     if(norecurs)
00476         args.add("-l");
00477
00478     if(toStdout)
00479         args.add("-p");
00480
00481     if(useMostRecent)
00482         args.add("-f");
00483
00484     if(!rev1.empty())
00485     {
00486         CPStr tmp;
00487         tmp = "-j";
00488         tmp << rev1;
00489         args.add(tmp);
00490     }
00491
00492     if(!rev2.empty())
00493     {
00494         CPStr tmp;
00495         tmp = "-j";
00496         tmp << rev2;
00497         args.add(tmp);
00498     }
00499
00500     if(!date.empty())
00501     {
00502         args.add("-D");
00503         args.add(date);
00504     }
00505
00506     if(!rev.empty())
00507     {
00508         args.add("-r");
00509         args.add(rev);
00510     }
00511
00512     if(doexport && rev.empty() && date.empty())
00513     {
00514         args.add("-r");
00515         args.add("HEAD");
00516     }
00517
00518     if( overrideCheckoutDir )
00519     {
00520         args.add("-d");
00521         args.add(checkoutDir);
00522     }
00523
00524     args.add(modname);
00525     args.print(path);
00526     launchCVS(path, args.Argc(), args.Argv());
00527 }

void CvsCmdCommitFiles ( MultiFiles * mf = 0L )

Definition at line 789 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdCommit, and KoCommitHandler::OnFiles.

00790 {
00791     if(gCvsPrefs.empty())
00792         return;
00793
00794     MultiFiles mf;
00795     if(mfarg == 0L)
00796     {
00797         if(!BrowserGetMultiFiles("Select files to commit :", mf))
00798             return;
00799         mfarg = &mf;
00800     }
00801
00802     bool firstTime = true;
00803     bool norecurs;
00804     CStr logmsg;
00805     bool forceCommit;
00806     bool forceRecurse;
00807     CPStr rev;
00808     bool noModuleProgram;
00809     bool checkValidEdits;
00810
00811     while(mfarg->next())
00812     {
00813         if(firstTime)
00814         {
00815             // we have to give the path where the commit is done is
00816             // the user expects to fill the CVS/Template file. we just
00817             // grab the first one for this purpose.
00818             const char *tmplDir = 0L;
00819             CStr pathTmpl, dontCareFile;
00820             if(mfarg->get(0, pathTmpl, dontCareFile))
00821                 tmplDir = pathTmpl;
00822
00823             if( !CompatGetCommit(logmsg, norecurs, forceCommit, forceRecurse, rev, noModuleProgram, checkValidEdits, tmplDir, mfarg) )
00824                 return;
00825
00826             firstTime = false;
00827         }
00828
00829         CvsArgs args;
00830         args.add("commit");
00831         if(checkValidEdits)
00832             args.add("-c");
00833         if(norecurs)
00834             args.add("-l");
00835         if(noModuleProgram)
00836             args.add("-n");
00837         if(forceRecurse)
00838             args.add("-R");
00839         if(forceCommit)
00840             args.add("-f");
00841         args.add("-m");
00842         args.add(cleanUpLogMsg(logmsg));
00843         if(!rev.empty())
00844         {
00845             args.add("-r");
00846             args.add(rev);
00847         }
00848         const char *dir = mfarg->add(args);
00849         args.print(dir);
00850         launchCVS(dir, args.Argc(), args.Argv());
00851     }
00852 }

void CvsCmdCommitFolder ( const char * dir = 0L )

Definition at line 177 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdCommit, UCvsFiles::OnCmdCommit, KoCommitHandler::OnFolder, and CWinCvsBrowser::OnViewCommit.

00178 {
00179     if(gCvsPrefs.empty())
00180         return;
00181
00182     if(dir == 0L)
00183         dir = BrowserGetDirectory("Select a directory to commit :");
00184     if(dir == 0L)
00185         return;
00186
00187     bool norecurs;
00188     CStr logmsg;
00189     bool forceCommit;
00190     bool forceRecurse;
00191     CPStr rev;
00192     bool noModuleProgram;
00193     bool checkValidEdits;
00194
00195     if( !CompatGetCommit(logmsg, norecurs, forceCommit, forceRecurse, rev, noModuleProgram, checkValidEdits, dir) )
00196         return;
00197
00198     CvsArgs args;
00199     args.add("commit");
00200     if(checkValidEdits)
00201         args.add("-c");
00202     if(norecurs)
00203         args.add("-l");
00204     if(noModuleProgram)
00205         args.add("-n");
00206     if(forceRecurse)
00207         args.add("-R");
00208     if(forceCommit)
00209         args.add("-f");
00210     args.add("-m");
00211     args.add(cleanUpLogMsg(logmsg));
00212     if(!rev.empty())
00213     {
00214         args.add("-r");
00215         args.add(rev);
00216     }
00217     args.print(dir);
00218     launchCVS(dir, args.Argc(), args.Argv());
00219 }

void CvsCmdDiffFiles ( MultiFiles * mf = 0L )

Definition at line 881 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdDiff, CCommit_MAIN::OnDiff, and KoDiffHandler::OnFiles.

00882 {
00883     if(gCvsPrefs.empty())
00884         return;
00885
00886     MultiFiles mf;
00887     if(mfarg == 0L)
00888     {
00889         if(!BrowserGetMultiFiles("Select files to diff :", mf))
00890             return;
00891         mfarg = &mf;
00892     }
00893
00894     bool noRecurs;
00895     bool isDate1;
00896     bool isDate2;
00897     bool useExtDiff;
00898     CPStr rev1;
00899     CPStr rev2;
00900     bool noWhiteSpace;
00901     bool ignoreCase;
00902     bool extDiffResult;
00903
00904     if(!CompatGetDiff(noRecurs, isDate1, isDate2, rev1, rev2, useExtDiff, noWhiteSpace, ignoreCase, true))
00905         return;
00906
00907     while(mfarg->next())
00908     {
00909         extDiffResult = false;
00910
00911         if (useExtDiff)
00912         {
00913             CStr path, filename, ext, base;
00914             CStr file1, file2;
00915             for(int i = 0; ; i++)
00916             {
00917                 if(!mfarg->get(i, path, filename))
00918                     break;
00919                 // note that filename can contain subfolders
00920
00921                 GetExtension(filename, base, ext);
00922
00923                 CvsArgs args;
00924                 CStr tmpf(base);
00925                 if(!rev1.empty())
00926                 {
00927                     tmpf << '_';
00928                     tmpf << rev1;
00929                     tmpf << '_';
00930                 }
00931                 else
00932                     tmpf << "_orig_";
00933
00934                 // convert subfolder names to regular name
00935                 FlatenSubFolders(tmpf);
00936
00937                 args.add("update");
00938                 args.add("-p");
00939                 if(!rev1.empty())
00940                 {
00941                     args.add(isDate1 ? "-D" : "-r");
00942                     args.add(rev1);
00943                 }
00944                 args.add(filename);
00945                 args.print(path);
00946                 file1 = launchCVS(path, args, (const char *)tmpf, ext);
00947 #ifdef qMacCvsPP
00948                 decodeCVS (file1);
00949 #endif
00950
00951                 if(rev2.empty())
00952                 {
00953                     file2 = path;
00954                     if(!file2.endsWith(kPathDelimiter))
00955                         file2 << kPathDelimiter;
00956                     file2 << filename;
00957                 }
00958                 else
00959                 {
00960                     CvsArgs args2;
00961
00962                     tmpf = base;
00963                     tmpf << '_';
00964                     tmpf << rev2;
00965                     tmpf << '_';
00966
00967                     // convert subfolder names to regular name
00968                     FlatenSubFolders(tmpf);
00969
00970                     args2.add("update");
00971                     args2.add("-p");
00972                     args2.add(isDate2 ? "-D" : "-r");
00973                     args2.add(rev2);
00974                     args2.add(filename);
00975                     args2.print(path);
00976                     file2 = launchCVS(path, args2, (const char *)tmpf, ext);
00977 #ifdef qMacCvsPP
00978                     decodeCVS (file2);
00979 #endif
00980                 }
00981
00982                 if(file1.empty() || file2.empty())
00983                     continue;
00984
00985                 extDiffResult = LaunchDiff(file1, file2);
00986             }
00987         }
00988
00989         if (!useExtDiff || !extDiffResult)
00990         {
00991             CvsArgs args;
00992             args.add("diff");
00993
00994             if(noRecurs)
00995                 args.add("-l");
00996             if(!rev1.empty())
00997             {
00998                 args.add(isDate1 ? "-D" : "-r");
00999                 args.add(rev1);
01000             }
01001             if(!rev2.empty())
01002             {
01003                 args.add(isDate2 ? "-D" : "-r");
01004                 args.add(rev2);
01005             }
01006             if(noWhiteSpace)
01007                 args.add("-w"); //--ignore-all-space
01008             if(ignoreCase)
01009                 args.add("-i"); //--ignore-case
01010
01011             const char *dir = mfarg->add(args);
01012             args.print(dir);
01013             launchCVS(dir, args.Argc(), args.Argv());
01014         }
01015     }
01016 }

void CvsCmdDiffFolder ( const char * dir = 0L )

Definition at line 222 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdDiff, UCvsFiles::OnCmdDiff, KoDiffHandler::OnFolder, and CWinCvsBrowser::OnViewDiff.

00223 {
00224     if(gCvsPrefs.empty())
00225         return;
00226
00227     if(dir == 0L)
00228         dir = BrowserGetDirectory("Select a directory to diff :");
00229
00230     if(dir == 0L)
00231         return;
00232
00233     bool noRecurs;
00234     bool isDate1;
00235     bool isDate2;
00236     bool useExtDiff;
00237     CPStr rev1;
00238     CPStr rev2;
00239     bool noWhiteSpace;
00240     bool ignoreCase;
00241
00242     if(!CompatGetDiff(noRecurs, isDate1, isDate2, rev1, rev2, useExtDiff, noWhiteSpace, ignoreCase))
00243         return;
00244
00245     CvsArgs args;
00246     args.add("diff");
00247
00248     if(noRecurs)
00249         args.add("-l");
00250     if(!rev1.empty())
00251     {
00252         args.add(isDate1 ? "-D" : "-r");
00253         args.add(rev1);
00254     }
00255     if(!rev2.empty())
00256     {
00257         args.add(isDate2 ? "-D" : "-r");
00258         args.add(rev2);
00259     }
00260     if(noWhiteSpace)
00261         args.add("-w"); //--ignore-all-space
00262     if(ignoreCase)
00263         args.add("-i"); //--ignore-case
00264
00265     args.print(dir);
00266     launchCVS(dir, args.Argc(), args.Argv());
00267 }

void CvsCmdEditFiles | ( | MultiFiles * | mf = 0L,
 |  | kEditCmdType | editType = kEditNormal
 | ) |

Definition at line 1833 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdEdit, KoForceEditHandler::OnFiles, KoReservedEditHandler::OnFiles, and KoEditHandler::OnFiles.

01834 {
01835     if(gCvsPrefs.empty())
01836         return;
01837
01838     MultiFiles mf;
01839     if(mfarg == 0L)
01840     {
01841         if(!BrowserGetMultiFiles("Select the files to edit :", mf))
01842             return;
01843         mfarg = &mf;
01844     }
01845
01846     while(mfarg->next())
01847     {
01848         CvsArgs args;
01849         args.add("edit");
01850
01851         switch( editType )
01852         {
01853         default:
01854         case kEditNormal:
01855             // intentionally blank
01856             break;
01857         case kEditReserved:
01858             args.add("-c");
01859             break;
01860         case kEditForce:
01861             args.add("-f");
01862             break;
01863         }
01864
01865         const char *dir = mfarg->add(args);
01866         args.print(dir);
01867         launchCVS(dir, args.Argc(), args.Argv());
01868     }
01869 }

void CvsCmdEditFolder | ( | const char * | dir = 0L,
 |  | kEditCmdType | editType = kEditNormal
 | ) |

Definition at line 1993 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdEdit, UCvsFiles::OnCmdEdit, KoForceEditHandler::OnFolder, KoReservedEditHandler::OnFolder, KoEditHandler::OnFolder, CWinCvsBrowser::OnViewEdit, CWinCvsBrowser::OnViewForceedit, and CWinCvsBrowser::OnViewReservededit.

01994 {
01995     if(gCvsPrefs.empty())
01996         return;
01997
01998     if(dir == 0L)
01999         dir = BrowserGetDirectory("Select a directory to edit :");
02000     if(dir == 0L)
02001         return;
02002
02003     CvsArgs args;
02004     args.add("edit");
02005
02006     switch( editType )
02007     {
02008     default:
02009     case kEditNormal:
02010         // intentionally blank
02011         break;
02012     case kEditReserved:
02013         args.add("-c");
02014         break;
02015     case kEditForce:
02016         args.add("-f");
02017         break;
02018     }
02019
02020     args.print(dir);
02021     launchCVS(dir, args.Argc(), args.Argv());
02022 }

void CvsCmdEditorsFiles ( MultiFiles * mf = 0L )

Definition at line 1969 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdEditors, and KoEditorsHandler::OnFiles.

01970 {
01971     if(gCvsPrefs.empty())
01972         return;
01973
01974     MultiFiles mf;
01975     if(mfarg == 0L)
01976     {
01977         if(!BrowserGetMultiFiles("Select the files to get the editors from :", mf))
01978             return;
01979         mfarg = &mf;
01980     }
01981
01982     while(mfarg->next())
01983     {
01984         CvsArgs args;
01985         args.add("editors");
01986
01987         const char *dir = mfarg->add(args);
01988         args.print(dir);
01989         launchCVS(dir, args.Argc(), args.Argv());
01990     }
01991 }

void CvsCmdEditorsFolder ( const char * dir = 0L )

Definition at line 2130 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdEditors, UCvsFiles::OnCmdEditors, KoEditorsHandler::OnFolder, and CWinCvsBrowser::OnViewEditors.

02131 {
02132     if(gCvsPrefs.empty())
02133         return;
02134
02135     if(dir == 0L)
02136         dir = BrowserGetDirectory("Select a directory to get the editors from :");
02137     if(dir == 0L)
02138         return;
02139
02140     CvsArgs args;
02141     args.add("editors");
02142
02143     args.print(dir);
02144     launchCVS(dir, args.Argc(), args.Argv());
02145 }

void CvsCmdImportModule ( const char * dir = 0L )

Definition at line 326 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdImport, CWinCvsBrowser::OnViewImport, CExploreBar::OnViewImport, and CBrowseFileView::OnViewImport.

00327 {
00328     if(gCvsPrefs.empty())
00329         return;
00330
00331     if(dir == 0L)
00332         dir = BrowserGetDirectory("Select a directory to import :");
00333     if(dir == 0L)
00334         return;
00335
00336     ReportConflict * entries;
00337     ReportWarning * warnings;
00338
00339     if(!CompatImportFilter(dir, entries, warnings))
00340         return;
00341
00342     CPStr modname, vendortag, reltag, path(dir);
00343     CStr logmsg;
00344     bool useDefIgnore;
00345     bool useFilesTime;
00346
00347     if( !CompatGetImport(modname, logmsg, vendortag, reltag, path, useDefIgnore, useFilesTime) )
00348         return;
00349
00350     CvsArgs args;
00351     args.add("import");
00352
00353     if( useFilesTime )
00354     {
00355         args.add("-d");
00356     }
00357
00358     // fill the wrappers
00359     ReportConflict * tmpentry = entries;
00360     if( !useDefIgnore )
00361     {
00362         args.add("-I"); // no default (core, *.o...)
00363         args.add("!");
00364         args.add("-I"); // but ignore the CVS folders
00365         args.add("CVS");
00366     }
00367     while(tmpentry != 0L)
00368     {
00369         if(tmpentry->HasIgnore())
00370         {
00371             CPStr ign;
00372             args.add("-I");
00373             if(tmpentry->IsExtension())
00374                 ign << '*';
00375             ign << tmpentry->GetPattern();
00376             args.add(ign);
00377         }
00378         else if( !tmpentry->HasForceText() &&
00379             (tmpentry->IsBinary() || tmpentry->HasForceBinary() || tmpentry->HasForceNoKeywords() ||
00380             tmpentry->IsUnicode() || tmpentry->HasForceUnicode()) )
00381         {
00382             CPStr wrap;
00383             const char *pattern = tmpentry->GetPattern();
00384             bool hasSpace = strchr(pattern, ' ') != 0L;
00385             args.add("-W");
00386
00387             if( hasSpace )
00388                 wrap << '"';
00389
00390             if( tmpentry->IsExtension() )
00391                 wrap << '*';
00392
00393             wrap << pattern;
00394
00395             if( hasSpace )
00396                 wrap << '"';
00397
00398             if( tmpentry->HasForceNoKeywords() )
00399                 wrap << " -k 'o'";
00400             else if( tmpentry->IsUnicode() || tmpentry->HasForceUnicode() )
00401                 wrap << " -k 'u'";
00402             else
00403                 wrap << " -k 'b'";
00404
00405             args.add(wrap);
00406         }
00407         tmpentry = tmpentry->next;
00408     }
00409
00410     free_list_types(warnings, entries);
00411
00412     args.add("-m");
00413     args.add(cleanUpLogMsg(logmsg));
00414     args.add(modname);
00415     args.add(vendortag);
00416     args.add(reltag);
00417     args.print(path);
00418     launchCVS(path, args.Argc(), args.Argv());
00419 }

void CvsCmdInit ( const char * dir = 0L )

Definition at line 295 of file CvsCommands.cpp.

Referenced by UCvsFrame::OnCmdInit, and CWincvsDoc::OnViewInit.

00296 {
00297     if(gCvsPrefs.empty())
00298         return;
00299
00300     bool forceCvsroot;
00301
00302     if(!CompatGetInit(forceCvsroot))
00303         return;
00304
00305     CvsArgs args;
00306
00307     if(forceCvsroot)
00308     {
00309         CStr root;
00310
00311         // extract from the cvsroot
00312         const char *ccvsroot = gCvsPrefs;
00313         ccvsroot = Authen::skiptoken(ccvsroot);
00314         root = gAuthen.token();
00315         root << ccvsroot;
00316         args.add("-d");
00317         args.add(root);
00318     }
00319
00320     args.add("init");
00321     args.print();
00322     launchCVS(0L, args.Argc(), args.Argv());
00323 }

void CvsCmdLine ( void )

Definition at line 1450 of file CvsCommands.cpp.

01451 {
01452     CvsArgs args(false);
01453     const char *dir;
01454     if(!CompatGetCommand(args, dir))
01455         return;
01456     args.print(dir);
01457     launchCVS(dir, args.Argc(), args.Argv());
01458 }

void CvsCmdLockFiles ( MultiFiles * mf = 0L )

Definition at line 1551 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdLock, and KoLockHandler::OnFiles.

01552 {
01553     if(gCvsPrefs.empty())
01554         return;
01555
01556     MultiFiles mf;
01557     if(mfarg == 0L)
01558     {
01559         if(!BrowserGetMultiFiles("Select files to lock :", mf))
01560             return;
01561         mfarg = &mf;
01562     }
01563
01564     while(mfarg->next())
01565     {
01566         CvsArgs args;
01567         args.add("admin");
01568         args.add("-l");
01569
01570         const char *dir = mfarg->add(args);
01571         args.print(dir);
01572         launchCVS(dir, args.Argc(), args.Argv());
01573     }
01574 }

void CvsCmdLockFolder ( const char * dir = 0L )

Definition at line 1710 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdLock, UCvsFiles::OnCmdLock, and KoLockHandler::OnFolder.

01711 {
01712     if(gCvsPrefs.empty())
01713         return;
01714
01715     if(dir == 0L)
01716         dir = BrowserGetDirectory("Select a directory to lock :");
01717     if(dir == 0L)
01718         return;
01719
01720     CvsArgs args;
01721     args.add("admin");
01722     args.add("-l");
01723
01724     args.print(dir);
01725     launchCVS(dir, args.Argc(), args.Argv());
01726 }

void CvsCmdLogFiles | ( | MultiFiles * | mf = 0L,
 |  | bool | outGraph = false,
 |  | void * | defWnd = 0L
 | ) |

Definition at line 1019 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdGraph, UCvsFiles::OnCmdLog, KoGraphHandler::OnFiles, and KoLogHandler::OnFiles.

01020 {
01021     if(gCvsPrefs.empty())
01022         return;
01023
01024     MultiFiles mf;
01025     if(mfarg == 0L)
01026     {
01027         if(!BrowserGetMultiFiles("Select files to log :", mf))
01028             return;
01029         mfarg = &mf;
01030     }
01031
01032     bool noRecurs;
01033     bool defBranch;
01034     CPStr date;
01035     bool headerOnly;
01036     bool noTags;
01037     bool onlyRCSfile;
01038     bool hasRev;
01039     CPStr rev;
01040     CPStr states;
01041     bool hasUser;
01042     CPStr users;
01043
01044     if( !CompatGetLog(noRecurs, defBranch, date,
01045         headerOnly, noTags, onlyRCSfile, hasRev,
01046         rev, states, hasUser, users,
01047         outGraph) )
01048     {
01049         return;
01050     }
01051
01052     while(mfarg->next())
01053     {
01054         CvsArgs args;
01055         args.add("log");
01056
01057         if(noRecurs)
01058             args.add("-l");
01059         if(defBranch)
01060             args.add("-b");
01061         if(headerOnly)
01062             args.add("-h");
01063         if(noTags)
01064             args.add("-N");
01065         if(onlyRCSfile)
01066             args.add("-R");
01067
01068         if(!date.empty())
01069         {
01070             args.add("-d");
01071             args.add(date);
01072         }
01073         if(!states.empty())
01074         {
01075             args.add("-s");
01076             args.add(states);
01077         }
01078         if(hasRev)
01079         {
01080             CPStr tmp;
01081             tmp = "-r";
01082             tmp << rev;
01083             args.add(tmp);
01084         }
01085         if(hasUser)
01086         {
01087             CPStr tmp;
01088             tmp = "-w";
01089             tmp << users;
01090             args.add(tmp);
01091         }
01092
01093         const char *dir = mfarg->add(args);
01094         args.print(dir);
01095         CvsLogParse(dir, args, outGraph, defWnd);
01096     }
01097 }

void CvsCmdLogFolder ( const char * dir = 0L )

Definition at line 1461 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdLog, UCvsFiles::OnCmdLog, KoLogHandler::OnFolder, and CWinCvsBrowser::OnViewLog.

01462 {
01463     if(gCvsPrefs.empty())
01464         return;
01465
01466     if(dir == 0L)
01467         dir = BrowserGetDirectory("Select a directory to log :");
01468     if(dir == 0L)
01469         return;
01470
01471     bool noRecurs;
01472     bool defBranch;
01473     CPStr date;
01474     bool headerOnly;
01475     bool noTags;
01476     bool onlyRCSfile;
01477     bool hasRev;
01478     CPStr rev;
01479     CPStr states;
01480     bool hasUser;
01481     CPStr users;
01482
01483     if(!CompatGetLog(noRecurs, defBranch, date,
01484         headerOnly, noTags, onlyRCSfile, hasRev,
01485         rev, states, hasUser, users))
01486             return;
01487
01488     CvsArgs args;
01489     args.add("log");
01490
01491     if(noRecurs)
01492         args.add("-l");
01493     if(defBranch)
01494         args.add("-b");
01495     if(headerOnly)
01496         args.add("-h");
01497     if(noTags)
01498         args.add("-N");
01499     if(onlyRCSfile)
01500         args.add("-R");
01501
01502     if(!date.empty())
01503     {
01504         args.add("-d");
01505         args.add(date);
01506     }
01507     if(!states.empty())
01508     {
01509         args.add("-s");
01510         args.add(states);
01511     }
01512     if(hasRev)
01513     {
01514         CPStr tmp;
01515         tmp = "-r";
01516         tmp << rev;
01517         args.add(tmp);
01518     }
01519     if(hasUser)
01520     {
01521         CPStr tmp;
01522         tmp = "-w";
01523         tmp << users;
01524         args.add(tmp);
01525     }
01526
01527     args.print(dir);
01528     CvsLogParse(dir, args, false, NULL);
01529 }

void CvsCmdLogin ( void )

Definition at line 648 of file CvsCommands.cpp.

00649 {
00650     if(gCvsPrefs.empty())
00651         return;
00652
00653     if(gAuthen.kind() != pserver)
00654     {
00655         cvs_err("Logging in is only required with pserver authentication (see Preferences dialog).\n"
00656             "Please consult the CVS manual for more details.\n");
00657         return;
00658     }
00659
00660     if(gCvsPrefs.HasLoogedIn() && gCvsPrefs.LogoutTimeOut() > 0)
00661     {
00662         cvs_err("Making automatic logout:\n");
00663         CvsCmdLogout();
00664         WaitForCvs();
00665     }
00666     gCvsPrefs.SetHasLoogedIn(true);
00667
00668     CvsArgs args;
00669     args.add("login");
00670     args.print();
00671     launchCVS(0L, args.Argc(), args.Argv());
00672 }

void CvsCmdLogout ( void )

Definition at line 675 of file CvsCommands.cpp.

00676 {
00677     if(gCvsPrefs.empty())
00678         return;
00679
00680     if(gAuthen.kind() != pserver)
00681     {
00682         cvs_err("Logging out requires pserver authentication (see Preferences dialog).\n"
00683             "Please consult the CVS manual for more details.\n");
00684         return;
00685     }
00686
00687     gCvsPrefs.SetHasLoogedIn(false);
00688
00689     CvsArgs args;
00690     args.add("logout");
00691     args.print();
00692     launchCVS(0L, args.Argc(), args.Argv());
00693 }

void CvsCmdMacrosAdmin ( const char * macroName )

Definition at line 2147 of file CvsCommands.cpp.

Referenced by UCvsFrame::OnCmdMacroAdmin, and CWincvsDoc::OnMacroAdmin.

02148 {
02149     if(gCvsPrefs.empty() || !CTcl_Interp::IsAvail())
02150         return;
02151
02152     CTcl_Interp interp;
02153     CStr path = macroName;
02154     CTcl_Interp::Unixfy(path);
02155     interp.DoScriptVar("source \"%s\"", (const char *)path);
02156 }

void CvsCmdReleaseFolder ( const char * dir = 0L )

Definition at line 2077 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdRelease, UCvsFiles::OnCmdRelease, KoReleaseHandler::OnFolder, and CWinCvsBrowser::OnViewRelease.

02078 {
02079     if(gCvsPrefs.empty())
02080         return;
02081
02082     if(dir == 0L)
02083         dir = BrowserGetDirectory("Select a directory to release :");
02084     if(dir == 0L)
02085         return;
02086
02087     CStr uppath, folder;
02088     if( !SplitPath(dir, uppath, folder) )
02089     {
02090         cvs_err("Unable to convert path name '%s'\n", dir);
02091         //even thought something didn't work we will try to continue and put all the responsibility onto the user
02092         uppath = dir;
02093         folder = ".";
02094     }
02095
02096     bool removeDirectory = false;
02097
02098     if( !CompatGetRelease(dir, removeDirectory) )
02099     {
02100         return;
02101     }
02102
02103     CvsArgs args;
02104     args.add("release");
02105     if( removeDirectory )
02106         args.add("-d");
02107     args.add(folder);
02108
02109     args.print(uppath);
02110     launchCVS(uppath, args.Argc(), args.Argv());
02111 }

void CvsCmdRemoveFiles ( MultiFiles * mf = 0L )

Definition at line 1372 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdRmv, and KoFileRemoveHandler::OnFiles.

01373 {
01374     if(gCvsPrefs.empty())
01375         return;
01376
01377     MultiFiles mf;
01378     if(mfarg == 0L)
01379     {
01380         if(!BrowserGetMultiFiles("Select files to remove :", mf))
01381             return;
01382         mfarg = &mf;
01383     }
01384
01385     while(mfarg->next())
01386     {
01387         RemoveCvsArgs args;
01388
01389         CompatBeginMoveToTrash();
01390
01391         args.add("remove");
01392         const char *dir = mfarg->add(args);
01393         args.print(dir);
01394
01395         CompatEndMoveToTrash();
01396
01397         launchCVS(dir, args.Argc(), args.Argv());
01398     }
01399 }

void CvsCmdRtagBranch ( void )

Definition at line 604 of file CvsCommands.cpp.

00605 {
00606     if(gCvsPrefs.empty())
00607         return;
00608
00609     bool norecurs;
00610     bool useMostRecent;
00611     bool lookAttic;
00612     CPStr modname;
00613     CPStr branchname;
00614     CPStr date;
00615     CPStr rev;
00616
00617     if(!CompatRtagBranch(norecurs, branchname, modname, date, rev,
00618         useMostRecent, lookAttic))
00619             return;
00620
00621     CvsArgs args;
00622     args.add("rtag");
00623     args.add("-b");
00624     if(norecurs)
00625         args.add("-l");
00626     if(useMostRecent)
00627         args.add("-f");
00628     if(lookAttic)
00629         args.add("-a");
00630     if(!date.empty())
00631     {
00632         args.add("-D");
00633         args.add(date);
00634     }
00635     if(!rev.empty())
00636     {
00637         args.add("-r");
00638         args.add(rev);
00639     }
00640
00641     args.add(branchname);
00642     args.add(modname);
00643     args.print();
00644     launchCVS(0L, args.Argc(), args.Argv());
00645 }

void CvsCmdRtagCreate ( void )

Definition at line 530 of file CvsCommands.cpp.

00531 {
00532     if(gCvsPrefs.empty())
00533         return;
00534
00535     bool norecurs;
00536     bool useMostRecent;
00537     bool overwriteExisting;
00538     bool lookAttic;
00539     CPStr modname;
00540     CPStr tagname;
00541     CPStr date;
00542     CPStr rev;
00543
00544     if(!CompatRtagCreate(norecurs, overwriteExisting, tagname, modname, date, rev,
00545         useMostRecent, lookAttic))
00546             return;
00547
00548     CvsArgs args;
00549     args.add("rtag");
00550     if(norecurs)
00551         args.add("-l");
00552     if(useMostRecent)
00553         args.add("-f");
00554     if(overwriteExisting)
00555         args.add("-F");
00556     if(lookAttic)
00557         args.add("-a");
00558     if(!date.empty())
00559     {
00560         args.add("-D");
00561         args.add(date);
00562     }
00563     if(!rev.empty())
00564     {
00565         args.add("-r");
00566         args.add(rev);
00567     }
00568
00569     args.add(tagname);
00570     args.add(modname);
00571     args.print();
00572     launchCVS(0L, args.Argc(), args.Argv());
00573 }

void CvsCmdRtagDelete ( void )

Definition at line 576 of file CvsCommands.cpp.

00577 {
00578     if(gCvsPrefs.empty())
00579         return;
00580
00581     bool norecurs;
00582     bool lookAttic;
00583     CPStr modname;
00584     CPStr tagname;
00585
00586     if(!CompatRtagDelete(norecurs, lookAttic, tagname, modname))
00587             return;
00588
00589     CvsArgs args;
00590     args.add("rtag");
00591     args.add("-d");
00592     if(norecurs)
00593         args.add("-l");
00594     if(lookAttic)
00595         args.add("-a");
00596
00597     args.add(tagname);
00598     args.add(modname);
00599     args.print();
00600     launchCVS(0L, args.Argc(), args.Argv());
00601 }

void CvsCmdStatusFiles ( MultiFiles * mf = 0L )

Definition at line 1402 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdStatus, and KoStatusHandler::OnFiles.

01403 {
01404     if(gCvsPrefs.empty())
01405         return;
01406
01407     MultiFiles mf;
01408     if(mfarg == 0L)
01409     {
01410         if(!BrowserGetMultiFiles("Select files to status :", mf))
01411             return;
01412         mfarg = &mf;
01413     }
01414
01415     while(mfarg->next())
01416     {
01417         CvsArgs args;
01418         args.add("status");
01419         args.add("-v");
01420         const char *dir = mfarg->add(args);
01421         args.print(dir);
01422         launchCVS(dir, args.Argc(), args.Argv());
01423     }
01424 }

void CvsCmdStatusFolder ( const char * dir = 0L )

Definition at line 1532 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdStatus, UCvsFiles::OnCmdStatus, KoStatusHandler::OnFolder, and CWinCvsBrowser::OnViewStatus.

01533 {
01534     if(gCvsPrefs.empty())
01535         return;
01536
01537     if(dir == 0L)
01538         dir = BrowserGetDirectory("Select a directory to get status :");
01539     if(dir == 0L)
01540         return;
01541
01542     CvsArgs args;
01543     args.add("status");
01544     args.add("-v");
01545
01546     args.print(dir);
01547     launchCVS(dir, args.Argc(), args.Argv());
01548 }

void CvsCmdTagBranchFiles ( MultiFiles * mf = 0L )

Definition at line 1674 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdTagBranch, and KoBranchTagHandler::OnFiles.

01675 {
01676     if(gCvsPrefs.empty())
01677         return;
01678
01679     MultiFiles mf;
01680     if(mfarg == 0L)
01681     {
01682         if(!BrowserGetMultiFiles("Select files to branch :", mf))
01683             return;
01684         mfarg = &mf;
01685     }
01686
01687     bool noRecurs, checkUnmod;
01688     CPStr branchName;
01689     if(!CompatTagBranch(noRecurs, branchName, checkUnmod))
01690         return;
01691
01692     while(mfarg->next())
01693     {
01694         CvsArgs args;
01695         args.add("tag");
01696         args.add("-b");
01697         if(noRecurs)
01698             args.add("-l");
01699         if(checkUnmod)
01700             args.add("-c");
01701         args.add(branchName);
01702
01703         const char *dir = mfarg->add(args);
01704         args.print(dir);
01705         launchCVS(dir, args.Argc(), args.Argv());
01706     }
01707 }

void CvsCmdTagBranchFolder ( const char * dir = 0L )

Definition at line 1805 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdTagBranch, UCvsFiles::OnCmdTagBranch, KoBranchTagHandler::OnFolder, and CWinCvsBrowser::OnViewTagBranch.

01806 {
01807     if(gCvsPrefs.empty())
01808         return;
01809
01810     if(dir == 0L)
01811         dir = BrowserGetDirectory("Select a directory to branch :");
01812     if(dir == 0L)
01813         return;
01814
01815     bool noRecurs, checkUnmod;
01816     CPStr tagName;
01817     if(!CompatTagBranch(noRecurs, tagName, checkUnmod))
01818         return;
01819
01820     CvsArgs args;
01821     args.add("tag");
01822     args.add("-b");
01823     if(noRecurs)
01824         args.add("-l");
01825     if(checkUnmod)
01826         args.add("-c");
01827     args.add(tagName);
01828
01829     args.print(dir);
01830     launchCVS(dir, args.Argc(), args.Argv());
01831 }

void CvsCmdTagCreateFiles ( MultiFiles * mf = 0L )

Definition at line 1603 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdTagNew, and KoCreateTagHandler::OnFiles.

01604 {
01605     if(gCvsPrefs.empty())
01606         return;
01607
01608     MultiFiles mf;
01609     if(mfarg == 0L)
01610     {
01611         if(!BrowserGetMultiFiles("Select files to tag :", mf))
01612             return;
01613         mfarg = &mf;
01614     }
01615
01616     bool noRecurs, overwriteExisting, checkUnmod;
01617     CPStr tagName;
01618     if(!CompatTagCreate(noRecurs, overwriteExisting, tagName, checkUnmod))
01619         return;
01620
01621     while(mfarg->next())
01622     {
01623         CvsArgs args;
01624         args.add("tag");
01625         if(noRecurs)
01626             args.add("-l");
01627         if(overwriteExisting)
01628             args.add("-F");
01629         if(checkUnmod)
01630             args.add("-c");
01631         args.add(tagName);
01632
01633         const char *dir = mfarg->add(args);
01634         args.print(dir);
01635         launchCVS(dir, args.Argc(), args.Argv());
01636     }
01637 }

void CvsCmdTagCreateFolder ( const char * dir = 0L )

Definition at line 1748 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdTagNew, UCvsFiles::OnCmdTagNew, KoCreateTagHandler::OnFolder, and CWinCvsBrowser::OnViewTagNew.

01749 {
01750     if(gCvsPrefs.empty())
01751         return;
01752
01753     if(dir == 0L)
01754         dir = BrowserGetDirectory("Select a directory to tag :");
01755     if(dir == 0L)
01756         return;
01757
01758     bool noRecurs, overwriteExisting, checkUnmod;
01759     CPStr tagName;
01760     if(!CompatTagCreate(noRecurs, overwriteExisting, tagName, checkUnmod))
01761         return;
01762
01763     CvsArgs args;
01764     args.add("tag");
01765     if(noRecurs)
01766         args.add("-l");
01767     if(overwriteExisting)
01768         args.add("-F");
01769     if(checkUnmod)
01770         args.add("-c");
01771     args.add(tagName);
01772
01773     args.print(dir);
01774     launchCVS(dir, args.Argc(), args.Argv());
01775 }

void CvsCmdTagDeleteFiles ( MultiFiles * mf = 0L )

Definition at line 1640 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdTagDelete, and KoDeleteTagHandler::OnFiles.

01641 {
01642     if(gCvsPrefs.empty())
01643         return;
01644
01645     MultiFiles mf;
01646     if(mfarg == 0L)
01647     {
01648         if(!BrowserGetMultiFiles("Select files to untag :", mf))
01649             return;
01650         mfarg = &mf;
01651     }
01652
01653     bool noRecurs;
01654     CPStr tagName;
01655     if(!CompatTagDelete(noRecurs, tagName))
01656         return;
01657
01658     while(mfarg->next())
01659     {
01660         CvsArgs args;
01661         args.add("tag");
01662         args.add("-d");
01663         if(noRecurs)
01664             args.add("-l");
01665         args.add(tagName);
01666
01667         const char *dir = mfarg->add(args);
01668         args.print(dir);
01669         launchCVS(dir, args.Argc(), args.Argv());
01670     }
01671 }

void CvsCmdTagDeleteFolder ( const char * dir = 0L )

Definition at line 1778 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdTagDelete, UCvsFiles::OnCmdTagDelete, KoDeleteTagHandler::OnFolder, and CWinCvsBrowser::OnViewTagDelete.

01779 {
01780     if(gCvsPrefs.empty())
01781         return;
01782
01783     if(dir == 0L)
01784         dir = BrowserGetDirectory("Select a directory to untag :");
01785     if(dir == 0L)
01786         return;
01787
01788     bool noRecurs;
01789     CPStr tagName;
01790     if(!CompatTagDelete(noRecurs, tagName))
01791         return;
01792
01793     CvsArgs args;
01794     args.add("tag");
01795     args.add("-d");
01796     if(noRecurs)
01797         args.add("-l");
01798     args.add(tagName);
01799
01800     args.print(dir);
01801     launchCVS(dir, args.Argc(), args.Argv());
01802 }

void CvsCmdUneditFiles ( MultiFiles * mf = 0L )

Definition at line 1871 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdUnedit, and KoUneditHandler::OnFiles.

01872 {
01873     if(gCvsPrefs.empty())
01874         return;
01875
01876     MultiFiles mf;
01877     if(mfarg == 0L)
01878     {
01879         if(!BrowserGetMultiFiles("Select the files to unedit :", mf))
01880             return;
01881         mfarg = &mf;
01882     }
01883
01884     while(mfarg->next())
01885     {
01886         CvsArgs args;
01887         args.add("unedit");
01888
01889         const char *dir = mfarg->add(args);
01890         args.print(dir);
01891         launchCVS(dir, args.Argc(), args.Argv());
01892     }
01893 }

void CvsCmdUneditFolder ( const char * dir = 0L )

Definition at line 2024 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdUnedit, UCvsFiles::OnCmdUnedit, KoUneditHandler::OnFolder, and CWinCvsBrowser::OnViewUnedit.

02025 {
02026     if(gCvsPrefs.empty())
02027         return;
02028
02029     if(dir == 0L)
02030         dir = BrowserGetDirectory("Select a directory to unedit :");
02031     if(dir == 0L)
02032         return;
02033
02034     CvsArgs args;
02035     args.add("unedit");
02036
02037     args.print(dir);
02038     launchCVS(dir, args.Argc(), args.Argv());
02039 }

void CvsCmdUnlockFiles ( MultiFiles * mf = 0L )

Definition at line 1577 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdUnlock, and KoUnlockHandler::OnFiles.

01578 {
01579     if(gCvsPrefs.empty())
01580         return;
01581
01582     MultiFiles mf;
01583     if(mfarg == 0L)
01584     {
01585         if(!BrowserGetMultiFiles("Select files to unlock :", mf))
01586             return;
01587         mfarg = &mf;
01588     }
01589
01590     while(mfarg->next())
01591     {
01592         CvsArgs args;
01593         args.add("admin");
01594         args.add("-u");
01595
01596         const char *dir = mfarg->add(args);
01597         args.print(dir);
01598         launchCVS(dir, args.Argc(), args.Argv());
01599     }
01600 }

void CvsCmdUnlockFolder ( const char * dir = 0L )

Definition at line 1729 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdUnlock, UCvsFiles::OnCmdUnlock, KoUnlockHandler::OnFolder, and CWinCvsBrowser::OnViewUnlock.

01730 {
01731     if(gCvsPrefs.empty())
01732         return;
01733
01734     if(dir == 0L)
01735         dir = BrowserGetDirectory("Select a directory to unlock :");
01736     if(dir == 0L)
01737         return;
01738
01739     CvsArgs args;
01740     args.add("admin");
01741     args.add("-u");
01742
01743     args.print(dir);
01744     launchCVS(dir, args.Argc(), args.Argv());
01745 }

void CvsCmdUpdateFiles | ( | MultiFiles * | mf = 0L,
 |  | bool | queryOnly = false
 | ) |

Definition at line 696 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdQueryUpdate, UCvsFiles::OnCmdUpdate, KoQueryUpdateHandler::OnFiles, and KoUpdateHandler::OnFiles.

00697 {
00698     if(gCvsPrefs.empty())
00699         return;
00700
00701     MultiFiles mf;
00702     if(mfarg == 0L)
00703     {
00704         if(!BrowserGetMultiFiles("Select files to update :", mf))
00705             return;
00706         mfarg = &mf;
00707     }
00708
00709     bool toStdout;
00710     bool noRecurs;
00711     bool resetSticky;
00712     CPStr date;
00713     CPStr rev;
00714     bool useMostRecent;
00715     CPStr rev1;
00716     CPStr rev2;
00717     bool createMissDir;
00718     bool getCleanCopy;
00719
00720     if(!queryOnly && !CompatGetUpdate(toStdout, noRecurs, resetSticky,
00721         date, rev, useMostRecent, rev1, rev2, createMissDir, getCleanCopy))
00722         return;
00723
00724     while(mfarg->next())
00725     {
00726         CvsArgs args;
00727
00728         if(queryOnly)
00729             args.add("-n");
00730
00731         args.add("update");
00732
00733         if(!queryOnly)
00734         {
00735             if(resetSticky)
00736                 args.add("-A");
00737
00738             if(createMissDir)
00739                 args.add("-d");
00740
00741             if(getCleanCopy)
00742                 args.add("-C");
00743
00744             if(!date.empty())
00745             {
00746                 args.add("-D");
00747                 args.add(date);
00748             }
00749
00750             if(useMostRecent)
00751                 args.add("-f");
00752
00753             if(!rev1.empty())
00754             {
00755                 CPStr tmp;
00756                 tmp = "-j";
00757                 tmp << rev1;
00758                 args.add(tmp);
00759             }
00760
00761             if(!rev2.empty())
00762             {
00763                 CPStr tmp;
00764                 tmp = "-j";
00765                 tmp << rev2;
00766                 args.add(tmp);
00767             }
00768
00769             /*if(noRecurs)
00770                 args.add("-l");*/
00771
00772             if(toStdout)
00773                 args.add("-p");
00774
00775             if(!rev.empty())
00776             {
00777                 args.add("-r");
00778                 args.add(rev);
00779             }
00780         }
00781
00782         const char *dir = mfarg->add(args);
00783         args.print(dir);
00784         launchCVS(dir, args.Argc(), args.Argv());
00785     }
00786 }

void CvsCmdUpdateFolder | ( | const char * | dir = 0L,
 |  | bool | queryOnly = false
 | ) |

Definition at line 100 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdQueryUpdate, UCvsFiles::OnCmdQueryUpdate, UCvsFolders::OnCmdUpdate, UCvsFiles::OnCmdUpdate, KoQueryUpdateHandler::OnFolder, KoUpdateHandler::OnFolder, CWinCvsBrowser::OnViewQueryUpdate, and CWinCvsBrowser::OnViewUpdate.

00101 {
00102     if(gCvsPrefs.empty())
00103         return;
00104
00105     if(dir == 0L)
00106         dir = BrowserGetDirectory("Select a directory to update :");
00107     if(dir == 0L)
00108         return;
00109
00110     bool toStdout;
00111     bool noRecurs;
00112     bool resetSticky;
00113     CPStr date;
00114     CPStr rev;
00115     bool useMostRecent;
00116     CPStr rev1;
00117     CPStr rev2;
00118     bool createMissDir;
00119     bool getCleanCopy;
00120
00121     if(!queryOnly && !CompatGetUpdate(toStdout, noRecurs, resetSticky,
00122         date, rev, useMostRecent, rev1, rev2, createMissDir, getCleanCopy))
00123         return;
00124
00125     CvsArgs args;
00126     if(queryOnly)
00127         args.add("-n");
00128     args.add("update");
00129     if(gCvsPrefs.PruneOption())
00130         args.add("-P");
00131
00132     if(!queryOnly)
00133     {
00134         if(resetSticky)
00135             args.add("-A");
00136         if(createMissDir)
00137             args.add("-d");
00138         if(getCleanCopy)
00139             args.add("-C");
00140         if(!date.empty())
00141         {
00142             args.add("-D");
00143             args.add(date);
00144         }
00145         if(useMostRecent)
00146             args.add("-f");
00147         if(!rev1.empty())
00148         {
00149             CPStr tmp;
00150             tmp = "-j";
00151             tmp << rev1;
00152             args.add(tmp);
00153         }
00154         if(!rev2.empty())
00155         {
00156             CPStr tmp;
00157             tmp = "-j";
00158             tmp << rev2;
00159             args.add(tmp);
00160         }
00161         if(noRecurs)
00162             args.add("-l");
00163         if(toStdout)
00164             args.add("-p");
00165         if(!rev.empty())
00166         {
00167             args.add("-r");
00168             args.add(rev);
00169         }
00170     }
00171
00172     args.print(dir);
00173     launchCVS(dir, args.Argc(), args.Argv());
00174 }

void CvsCmdWatchersFiles ( MultiFiles * mf = 0L )

Definition at line 1945 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdWatchers, and KoWatchersHandler::OnFiles.

01946 {
01947     if(gCvsPrefs.empty())
01948         return;
01949
01950     MultiFiles mf;
01951     if(mfarg == 0L)
01952     {
01953         if(!BrowserGetMultiFiles("Select the files to get the watchers from :", mf))
01954             return;
01955         mfarg = &mf;
01956     }
01957
01958     while(mfarg->next())
01959     {
01960         CvsArgs args;
01961         args.add("watchers");
01962
01963         const char *dir = mfarg->add(args);
01964         args.print(dir);
01965         launchCVS(dir, args.Argc(), args.Argv());
01966     }
01967 }

void CvsCmdWatchersFolder ( const char * dir = 0L )

Definition at line 2113 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdWatchers, UCvsFiles::OnCmdWatchers, KoWatchersHandler::OnFolder, and CWinCvsBrowser::OnViewWatchers.

02114 {
02115     if(gCvsPrefs.empty())
02116         return;
02117
02118     if(dir == 0L)
02119         dir = BrowserGetDirectory("Select a directory to get the watchers from :");
02120     if(dir == 0L)
02121         return;
02122
02123     CvsArgs args;
02124     args.add("watchers");
02125
02126     args.print(dir);
02127     launchCVS(dir, args.Argc(), args.Argv());
02128 }

void CvsCmdWatchOffFiles ( MultiFiles * mf = 0L )

Definition at line 1920 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdWatchOff, and KoWatchOffHandler::OnFiles.

01921 {
01922     if(gCvsPrefs.empty())
01923         return;
01924
01925     MultiFiles mf;
01926     if(mfarg == 0L)
01927     {
01928         if(!BrowserGetMultiFiles("Select the files to unwatch :", mf))
01929             return;
01930         mfarg = &mf;
01931     }
01932
01933     while(mfarg->next())
01934     {
01935         CvsArgs args;
01936         args.add("watch");
01937         args.add("remove");
01938
01939         const char *dir = mfarg->add(args);
01940         args.print(dir);
01941         launchCVS(dir, args.Argc(), args.Argv());
01942     }
01943 }

void CvsCmdWatchOffFolder ( const char * dir = 0L )

Definition at line 2059 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdWatchOff, UCvsFiles::OnCmdWatchOff, KoWatchOffHandler::OnFolder, and CWinCvsBrowser::OnViewWatchOff.

02060 {
02061     if(gCvsPrefs.empty())
02062         return;
02063
02064     if(dir == 0L)
02065         dir = BrowserGetDirectory("Select a directory to unwatch :");
02066     if(dir == 0L)
02067         return;
02068
02069     CvsArgs args;
02070     args.add("watch");
02071     args.add("remove");
02072
02073     args.print(dir);
02074     launchCVS(dir, args.Argc(), args.Argv());
02075 }

void CvsCmdWatchOnFiles ( MultiFiles * mf = 0L )

Definition at line 1895 of file CvsCommands.cpp.

Referenced by UCvsFiles::OnCmdWatchOn, and KoWatchOnHandler::OnFiles.

01896 {
01897     if(gCvsPrefs.empty())
01898         return;
01899
01900     MultiFiles mf;
01901     if(mfarg == 0L)
01902     {
01903         if(!BrowserGetMultiFiles("Select the files to watch :", mf))
01904             return;
01905         mfarg = &mf;
01906     }
01907
01908     while(mfarg->next())
01909     {
01910         CvsArgs args;
01911         args.add("watch");
01912         args.add("add");
01913
01914         const char *dir = mfarg->add(args);
01915         args.print(dir);
01916         launchCVS(dir, args.Argc(), args.Argv());
01917     }
01918 }

void CvsCmdWatchOnFolder ( const char * dir = 0L )

Definition at line 2041 of file CvsCommands.cpp.

Referenced by UCvsFolders::OnCmdWatchOn, UCvsFiles::OnCmdWatchOn, KoWatchOnHandler::OnFolder, and CWinCvsBrowser::OnViewWatchOn.

02042 {
02043     if(gCvsPrefs.empty())
02044         return;
02045
02046     if(dir == 0L)
02047         dir = BrowserGetDirectory("Select a directory to watch :");
02048     if(dir == 0L)
02049         return;
02050
02051     CvsArgs args;
02052     args.add("watch");
02053     args.add("add");
02054
02055     args.print(dir);
02056     launchCVS(dir, args.Argc(), args.Argv());
02057 }

Generated on Sun Feb 24 01:21:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsEntries.cpp File Reference

common/CvsEntries.cpp File Reference

#include "stdafx.h"
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "CvsEntries.h"
#include "AppConsole.h"
#include "getline.h"
#include "FileTraversal.h"
#include "WinCvsDebug.h"
#include <time.h>

Include dependency graph for CvsEntries.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | NEW new

Functions

const char * | cloneStr (const char *cp)
void | disposeStr (const char *cp)
EntnodeData * | fgetentent (FILE *fpin, const char *path, char *cmd=0L)
bool | Entries_Open (CSortList< ENTNODE > &entries, const char *fullpath)
bool | unmodified (const struct stat &sb, const char *ts)
EntnodeData * | Entries_SetVisited (const char *path, CSortList< ENTNODE > &entries, const char *name, const struct stat &finfo, bool isFolder, const std::vector< UStr > *ignlist)
void | Entries_SetMissing (CSortList< ENTNODE > &entries)
bool | Tag_Open (UStr &tag, const char *fullpath)

Define Documentation

#define NEW new

Definition at line 62 of file CvsEntries.cpp.

Referenced by Entries_SetVisited, and fgetentent.

Function Documentation

const char* cloneStr ( const char * cp ) [static]

Definition at line 65 of file CvsEntries.cpp.

References strdup.

Referenced by EntnodeData::EntnodeData, EntnodeFile::EntnodeFile, and EntnodePath::EntnodePath.

00066 {
00067     if(cp && *cp)
00068     {
00069         cp = strdup(cp);
00070         if (!cp)
00071         {
00072             throw std::bad_alloc();
00073         }
00074     }
00075     else
00076     {
00077         cp = 0L;
00078     }
00079     return cp;
00080 }

void disposeStr ( const char * cp ) [static]

Definition at line 82 of file CvsEntries.cpp.

References free.

Referenced by EntnodeData::~EntnodeData, EntnodeFile::~EntnodeFile, and EntnodePath::~EntnodePath.

00083 {
00084     if (cp)
00085     {
00086         free((void*)cp);
00087     }
00088 }

bool Entries_Open | ( | CSortList< ENTNODE > & | entries,
 |  | const char * | fullpath
 | ) |

Definition at line 289 of file CvsEntries.cpp.

References cvs_err, CSortList::Delete, UStr::endsWith, fgetentent, CSortList::InsideAndInsert, CSortList::Reset, and EntnodeData::UnRef.

00290 {
00291     EntnodeData *ent;
00292
00293     UStr adminPath(fullpath);
00294     if(!adminPath.endsWith(kPathDelimiter))
00295         adminPath << kPathDelimiter;
00296     adminPath << "CVS";
00297     adminPath << kPathDelimiter;
00298
00299     entries.Reset();
00300     UStr filename = adminPath;
00301     filename << "Entries";
00302     FILE *fpin = fopen(filename, "r");
00303     if (fpin == 0L)
00304         return false;
00305
00306     while ((ent = fgetentent (fpin, fullpath)) != 0L)
00307     {
00308         ENTNODE newnode(ent);
00309         ent->UnRef();
00310
00311         if(entries.InsideAndInsert(newnode))
00312         {
00313             cvs_err("Warning : duplicated entry in the 'CVS/Entries' file in directory '%s'\n",
00314                 fullpath);
00315         }
00316     }
00317
00318     fclose (fpin);
00319
00320     filename = adminPath;
00321     filename << "Entries.log";
00322     fpin = fopen(filename, "r");
00323     if (fpin != 0L)
00324     {
00325         char cmd;
00326
00327         while ((ent = fgetentent (fpin, &cmd)) != 0L)
00328         {
00329             ENTNODE newnode(ent);
00330             ent->UnRef();
00331
00332             switch (cmd)
00333             {
00334             case 'A':
00335                 if(entries.InsideAndInsert(newnode))
00336                 {
00337                     // dont care
00338                 }
00339                 break;
00340             case 'R':
00341                 entries.Delete(newnode);
00342                 break;
00343             default:
00344                 /* Ignore unrecognized commands.  */
00345                 break;
00346             }
00347         }
00348         fclose (fpin);
00349     }
00350     return true;
00351 }

void Entries_SetMissing ( CSortList< ENTNODE > & entries )

Definition at line 552 of file CvsEntries.cpp.

References ENTNODE::Data, CSortList::Get, EntnodeData::IsRemoved, EntnodeData::IsVisited, CSortList::NumOfElements, EntnodeData::SetDesc, and EntnodeData::SetMissing.

00553 {
00554     int numEntries = entries.NumOfElements();
00555     for(int i = 0; i < numEntries; i++)
00556     {
00557         const ENTNODE & theNode = entries.Get(i);
00558         EntnodeData *data = theNode.Data();
00559         if(data->IsVisited())
00560             continue;
00561
00562         data->SetMissing(true);
00563         data->SetDesc(data->IsRemoved() ? "Removed" : "Missing");
00564     }
00565 }

EntnodeData* Entries_SetVisited | ( | const char * | path,
 |  | CSortList< ENTNODE > & | entries,
 |  | const char * | name,
 |  | const struct stat & | finfo,
 |  | bool | isFolder,
 |  | const std::vector< UStr > * | ignlist
 | ) |

Definition at line 413 of file CvsEntries.cpp.

References CStr, cvs_err, ENTNODE::Data, CSortList::Get, EntnodeData::GetConflict, GetWinCvsDebugMaskBit, CSortList::InsideAndInsert, EntnodeData::IsIgnored, EntnodeData::IsUnknown, EntnodeData::IsUnmodified, EntnodeFile::kOption, EntnodeFile::kTS, MatchIgnoredList, NEW, EntnodeData::SetDesc, EntnodeData::SetIgnored, EntnodeData::SetLocked, EntnodeData::SetUnknown, EntnodeData::SetUnmodified, EntnodeData::SetVisited, stat, unmodified, EntnodePath::UnRef, EntnodeData::UnRef, and wcvsdbg_trace_modified_checks_bit.

00415 {
00416     int index;
00417     bool isCvs = false;
00418
00419     EntnodePath *thePath = new EntnodePath(path);
00420
00421     if(isFolder)
00422     {
00423         EntnodeFolder *adata = NEW EntnodeFolder(name, thePath);
00424         ENTNODE anode(adata);
00425         adata->UnRef();
00426         isCvs = entries.InsideAndInsert(anode, &index);
00427     }
00428     else
00429     {
00430         EntnodeFile *adata = NEW EntnodeFile(name, thePath);
00431         ENTNODE anode(adata);
00432         adata->UnRef();
00433         isCvs = entries.InsideAndInsert(anode, &index);
00434     }
00435
00436     thePath->UnRef();
00437
00438     const ENTNODE & theNode = entries.Get(index);
00439     EntnodeData *data = theNode.Data();
00440     data->SetVisited(true);
00441     if(!isCvs)
00442     {
00443         data->SetUnknown(true);
00444         if(ignlist != 0L && MatchIgnoredList(name, *ignlist))
00445             data->SetIgnored(true);
00446
00447         // the folder may have some cvs informations in it, despite the fact
00448         // that it is not referenced by the parent directory, so try
00449         // to figure it.
00450
00451         if(!data->IsIgnored())
00452         {
00453             CStr cvsFile(path);
00454             if(!cvsFile.endsWith(kPathDelimiter))
00455                 cvsFile << kPathDelimiter;
00456             cvsFile << name;
00457             if(!cvsFile.endsWith(kPathDelimiter))
00458                 cvsFile << kPathDelimiter;
00459             cvsFile << "CVS";
00460             struct stat sb;
00461             if (stat(cvsFile, &sb) != -1 && S_ISDIR(sb.st_mode))
00462             {
00463                 data->SetUnknown(false);
00464             }
00465         }
00466     }
00467
00468     if(isFolder)
00469     {
00470         if(data->IsIgnored())
00471         {
00472             data->SetDesc("Ignored Folder");
00473         }
00474         else if(data->IsUnknown())
00475         {
00476             data->SetDesc("NonCvs Folder");
00477         }
00478         else
00479         {
00480             data->SetDesc("Folder");
00481         }
00482     }
00483     else
00484     {
00485         const char *ts = (*data)[EntnodeFile::kTS];
00486         if(ts == 0L)
00487             data->SetUnmodified(true);
00488         else
00489             data->SetUnmodified(unmodified(finfo, ts));
00490
00491 #if defined(WIN32)
00492         if (GetWinCvsDebugMaskBit(wcvsdbg_trace_modified_checks_bit))
00493         {
00494             char scratch[128];
00495
00496             /* copied from unmodified... */
00497             char *cp;
00498             struct tm *tm_p;
00499             struct tm local_tm;
00500             tm_p = gmtime (& finfo.st_mtime);
00501             if (tm_p)
00502             {
00503                 memcpy (&local_tm, tm_p, sizeof (local_tm));
00504                 cp = asctime (&local_tm);   /* copy in the modify time */
00505             }
00506             else
00507             {
00508                 cp = "NULL";
00509             }
00510
00511             _snprintf(scratch, 128,
00512                 "Checking timestamps for %s: Entries: %s, file: %s --> %s\n",
00513                 name, ts, cp,
00514                 data->IsUnmodified() ? "unmodified" : "modified");
00515             cvs_err(scratch);
00516             OutputDebugString(scratch);
00517         }
00518 #endif
00519
00520         data->SetLocked((finfo.st_mode & S_IWRITE) == 0);
00521
00522         const char *info = 0L;
00523         if(data->IsIgnored())
00524         {
00525             data->SetDesc("Ignored");
00526         }
00527         else if(data->IsUnknown())
00528         {
00529             data->SetDesc("NonCvs file");
00530         }
00531         else if(data->GetConflict() != 0L)
00532         {
00533             data->SetDesc("Conflict");
00534         }
00535         else if((info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-kb") == 0)
00536         {
00537             data->SetDesc(data->IsUnmodified() ? "Binary" : "Mod. Binary");
00538         }
00539         else if((info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-ku") == 0)
00540         {
00541             data->SetDesc(data->IsUnmodified() ? "Unicode" : "Mod. Unicode");
00542         }
00543         else
00544         {
00545             data->SetDesc(data->IsUnmodified() ? "File" : "Mod. File");
00546         }
00547     }
00548
00549     return data;
00550 }

EntnodeData* fgetentent | ( | FILE * | fpin,
 |  | const char * | path,
 |  | char * | cmd = 0L
 | ) | [static]

Definition at line 186 of file CvsEntries.cpp.

References cvs_err, ENT_FILE, ENT_SUBDIR, ent_type, free, getline, NEW, and EntnodePath::UnRef.

Referenced by Entries_Open.

00187 {
00188     EntnodeData *ent;
00189     char *line = 0L;
00190     size_t line_chars_allocated = 0;
00191     register char *cp;
00192     ent_type type;
00193     char *l, *user, *vn, *ts, *options;
00194     char *tag_or_date, *tag, *date, *ts_conflict;
00195     int line_length;
00196
00197     EntnodePath *thePath = new EntnodePath(path);
00198
00199     ent = 0L;
00200     while ((line_length = getline (&line, &line_chars_allocated, fpin)) > 0)
00201     {
00202         l = line;
00203
00204         /* If CMD is not NULL, we are reading an Entries.Log file.
00205         Each line in the Entries.Log file starts with a single
00206         character command followed by a space.  For backward
00207         compatibility, the absence of a space indicates an add
00208         command.  */
00209         if (cmd != 0L)
00210         {
00211             if (l[1] != ' ')
00212                 *cmd = 'A';
00213             else
00214             {
00215                 *cmd = l[0];
00216                 l += 2;
00217             }
00218         }
00219         type = ENT_FILE;
00220
00221         if (l[0] == 'D')
00222         {
00223             type = ENT_SUBDIR;
00224             ++l;
00225             /* An empty D line is permitted; it is a signal that this
00226             Entries file lists all known subdirectories.  */
00227         }
00228
00229         if (l[0] != '/')
00230             continue;
00231
00232         user = l + 1;
00233         if ((cp = strchr (user, '/')) == 0L)
00234             continue;
00235         *cp++ = '\0';
00236         vn = cp;
00237         if ((cp = strchr (vn, '/')) == 0L)
00238             continue;
00239         *cp++ = '\0';
00240         ts = cp;
00241         if ((cp = strchr (ts, '/')) == 0L)
00242             continue;
00243         *cp++ = '\0';
00244         options = cp;
00245         if ((cp = strchr (options, '/')) == 0L)
00246             continue;
00247         *cp++ = '\0';
00248         tag_or_date = cp;
00249         if ((cp = strchr (tag_or_date, '\n')) == 0L
00250 #ifdef macintosh
00251             && (cp = strchr (tag_or_date, '\r')) == 0L
00252 #endif
00253         )
00254             continue;
00255         *cp = '\0';
00256         tag = (char *) 0L;
00257         date = (char *) 0L;
00258         if (*tag_or_date == 'T')
00259             tag = tag_or_date + 1;
00260         else if (*tag_or_date == 'D')
00261             date = tag_or_date + 1;
00262
00263         if ((ts_conflict = strchr (ts, '+')))
00264             *ts_conflict++ = '\0';
00265
00266         if(type == ENT_SUBDIR)
00267             ent = NEW EntnodeFolder(user, thePath);
00268         else
00269             ent = NEW EntnodeFile(user, thePath, vn, ts, options,
00270                 tag, date, ts_conflict);
00271         break;
00272     }
00273
00274     if (line_length < 0 && !feof (fpin))
00275         cvs_err("Cannot read entries file (error %d)\n", errno);
00276
00277     free (line);
00278
00279     thePath->UnRef();
00280
00281     return ent;
00282 }

bool Tag_Open | ( | UStr & | tag,
 |  | const char * | fullpath
 | ) |

Definition at line 567 of file CvsEntries.cpp.

References CStr, cvs_err, free, and getline.

00568 {
00569     tag = "";
00570     CStr tagFile(fullpath);
00571     if(!tagFile.endsWith(kPathDelimiter))
00572         tagFile << kPathDelimiter;
00573     tagFile << "Tag";
00574
00575     FILE *fpin = fopen(tagFile, "r");
00576     if (fpin == 0L)
00577         return false;
00578
00579     char *line = 0L;
00580     size_t line_chars_allocated = 0;
00581     int line_length;
00582     if((line_length = getline (&line, &line_chars_allocated, fpin)) > 0)
00583     {
00584         char *tmp = strchr(line, '\n');
00585         if(tmp != 0L)
00586             *tmp = '\0';
00587         if(line[0] == 'T')
00588             tag = line + 1;
00589     }
00590     if(line != 0L)
00591         free(line);
00592     if (line_length < 0 && !feof (fpin))
00593     {
00594         cvs_err("Cannot open Tag file in '%s' (error %d)\n", fullpath, errno);
00595         return false;
00596     }
00597
00598     fclose (fpin);
00599     return !tag.empty();
00600 }

bool unmodified | ( | const struct stat & | sb,
 |  | const char * | ts
 | ) | [static]

Definition at line 354 of file CvsEntries.cpp.

References cvs_err, free, malloc, NULL, and stat.

Referenced by EntnodeData::EntnodeData, and Entries_SetVisited.

00355 {
00356     char *cp;
00357     struct tm *tm_p;
00358     struct tm local_tm;
00359     /* We want to use the same timestamp format as is stored in the
00360     st_mtime.  For unix (and NT I think) this *must* be universal
00361     time (UT), so that files don't appear to be modified merely
00362     because the timezone has changed.  For VMS, or hopefully other
00363     systems where gmtime returns NULL, the modification time is
00364     stored in local time, and therefore it is not possible to cause
00365     st_mtime to be out of sync by changing the timezone.  */
00366     tm_p = gmtime (&sb.st_mtime);
00367     if (tm_p)
00368     {
00369         memcpy (&local_tm, tm_p, sizeof (local_tm));
00370         cp = asctime (&local_tm);   /* copy in the modify time */
00371     }
00372     else
00373         cp = ctime(&sb.st_mtime);
00374
00375     cp[24] = 0;
00376
00377 // [6/8/2001] Jerzy K. - the code has been replaced by the version from cvsnt
00378 //which seems simpler and giving the same effect
00379 //keep it here for a while and remove eventually
00380 #if 0
00381 // Bug 432
00382     if( cp[8]=='0') cp[8]=' ';
00383 //  The C Standard Library and the Unix/cygwin versions of CVS
00384 //  write a padding space before days 1-9; Visual C++ libraries use
00385 //  a leading 0.  This affects ctime() and asctime() calls.  Bug 432
00386 //  adopts the padding space standard.  The following allows for backward
00387 //  compatibility with a WinCVS working area checked out prior to the
00388 //  Bug 432 fix.  (cp is the timestamp from the stat of the working file;
00389 //  ts is the timestamp as read from CVS/Entries).
00390     char *ns = (char *)malloc( (strlen(ts) + 1) * sizeof( char ) );
00391     if ( ns == NULL ) {
00392         cvs_err("Could not allocate memory for string ns\n");
00393         return 1;
00394     }
00395     strcpy( ns, ts );
00396     if( ns[8]=='0') ns[8]=' ';
00397     int compare_result = strcmp(ns, cp);
00398     free( ns );
00399     return compare_result == 0;
00400 // Bug 432
00401 #else
00402
00403     /* Deal with the differences in timestamps - posix uses space filled, NT uses zero filled */
00404     if(cp[8]=='0' && ts[8]==' ')
00405         cp[8]=' ';
00406     if(cp[8]==' ' && ts[8]=='0')
00407         cp[8]='0';
00408
00409     return strcmp(cp, ts) == 0;
00410 #endif
00411 }

Generated on Sun Feb 24 01:21:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsEntries.h File Reference

common/CvsEntries.h File Reference

#include "SortList.h"
#include "CvsIgnore.h"
#include "TextBinary.h"

Include dependency graph for CvsEntries.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | ENTNODE
class | EntnodeData
class | EntnodeFile
class | EntnodeFolder
class | EntnodePath

Enumerations

enum ent_type {
ENT_FILE,
ENT_SUBDIR
}

Functions

bool | Entries_Open (CSortList< ENTNODE > &entries, const char *fullpath)
EntnodeData * | Entries_SetVisited (const char *path, CSortList< ENTNODE > &entries, const char *name, const struct stat &finfo, bool isFolder, const std::vector< UStr > *ignlist=0L)
void | Entries_SetMissing (CSortList< ENTNODE > &entries)
bool | Tag_Open (UStr &tag, const char *fullpath)

Enumeration Type Documentation

enum ent_type

Enumeration values:
ENT_FILE
ENT_SUBDIR

Definition at line 33 of file CvsEntries.h.

Referenced by fgetentent, EntnodeFolder::GetType, and EntnodeFile::GetType.

00034 {
00035     ENT_FILE,
00036     ENT_SUBDIR
00037 } ent_type;

Function Documentation

bool Entries_Open | ( | CSortList< ENTNODE > & | entries,
 |  | const char * | fullpath
 | ) |

Definition at line 289 of file CvsEntries.cpp.

Referenced by TBrowserFill::EnterDirectory, TViewFill::EnterDirectory, CFillTclEntries::EnterDirectory, CFillPyEntries::EnterDirectory, CGraphDoc::SetNode, and UCvsGraph::UCvsGraph.

00290 {
00291     EntnodeData *ent;
00292
00293     UStr adminPath(fullpath);
00294     if(!adminPath.endsWith(kPathDelimiter))
00295         adminPath << kPathDelimiter;
00296     adminPath << "CVS";
00297     adminPath << kPathDelimiter;
00298
00299     entries.Reset();
00300     UStr filename = adminPath;
00301     filename << "Entries";
00302     FILE *fpin = fopen(filename, "r");
00303     if (fpin == 0L)
00304         return false;
00305
00306     while ((ent = fgetentent (fpin, fullpath)) != 0L)
00307     {
00308         ENTNODE newnode(ent);
00309         ent->UnRef();
00310
00311         if(entries.InsideAndInsert(newnode))
00312         {
00313             cvs_err("Warning : duplicated entry in the 'CVS/Entries' file in directory '%s'\n",
00314                 fullpath);
00315         }
00316     }
00317
00318     fclose (fpin);
00319
00320     filename = adminPath;
00321     filename << "Entries.log";
00322     fpin = fopen(filename, "r");
00323     if (fpin != 0L)
00324     {
00325         char cmd;
00326
00327         while ((ent = fgetentent (fpin, &cmd)) != 0L)
00328         {
00329             ENTNODE newnode(ent);
00330             ent->UnRef();
00331
00332             switch (cmd)
00333             {
00334             case 'A':
00335                 if(entries.InsideAndInsert(newnode))
00336                 {
00337                     // dont care
00338                 }
00339                 break;
00340             case 'R':
00341                 entries.Delete(newnode);
00342                 break;
00343             default:
00344                 /* Ignore unrecognized commands.  */
00345                 break;
00346             }
00347         }
00348         fclose (fpin);
00349     }
00350     return true;
00351 }

void Entries_SetMissing ( CSortList< ENTNODE > & entries )

Definition at line 552 of file CvsEntries.cpp.

Referenced by cvsgui_GetCvsEntries, TViewFill::ExitDirectory, CWinCvsBrowser::OnItemexpanding, UCvsFolders::OnTreeExpanding, UCvsFiles::ResetView, and tclCvsEntriesProc.

00553 {
00554     int numEntries = entries.NumOfElements();
00555     for(int i = 0; i < numEntries; i++)
00556     {
00557         const ENTNODE & theNode = entries.Get(i);
00558         EntnodeData *data = theNode.Data();
00559         if(data->IsVisited())
00560             continue;
00561
00562         data->SetMissing(true);
00563         data->SetDesc(data->IsRemoved() ? "Removed" : "Missing");
00564     }
00565 }

EntnodeData* Entries_SetVisited | ( | const char * | path,
 |  | CSortList< ENTNODE > & | entries,
 |  | const char * | name,
 |  | const struct stat & | finfo,
 |  | bool | isFolder,
 |  | const std::vector< UStr > * | ignlist = 0L
 | ) |

Definition at line 413 of file CvsEntries.cpp.

Referenced by TBrowserFill::OnDirectory, TViewFill::OnDirectory, CFillTclEntries::OnDirectory, CFillPyEntries::OnDirectory, TViewFill::OnFile, CFillTclEntries::OnFile, CFillPyEntries::OnFile, CHistComboBoxEx::SetIcon, CGraphDoc::SetNode, and UCvsGraph::UCvsGraph.

00415 {
00416     int index;
00417     bool isCvs = false;
00418
00419     EntnodePath *thePath = new EntnodePath(path);
00420
00421     if(isFolder)
00422     {
00423         EntnodeFolder *adata = NEW EntnodeFolder(name, thePath);
00424         ENTNODE anode(adata);
00425         adata->UnRef();
00426         isCvs = entries.InsideAndInsert(anode, &index);
00427     }
00428     else
00429     {
00430         EntnodeFile *adata = NEW EntnodeFile(name, thePath);
00431         ENTNODE anode(adata);
00432         adata->UnRef();
00433         isCvs = entries.InsideAndInsert(anode, &index);
00434     }
00435
00436     thePath->UnRef();
00437
00438     const ENTNODE & theNode = entries.Get(index);
00439     EntnodeData *data = theNode.Data();
00440     data->SetVisited(true);
00441     if(!isCvs)
00442     {
00443         data->SetUnknown(true);
00444         if(ignlist != 0L && MatchIgnoredList(name, *ignlist))
00445             data->SetIgnored(true);
00446
00447         // the folder may have some cvs informations in it, despite the fact
00448         // that it is not referenced by the parent directory, so try
00449         // to figure it.
00450
00451         if(!data->IsIgnored())
00452         {
00453             CStr cvsFile(path);
00454             if(!cvsFile.endsWith(kPathDelimiter))
00455                 cvsFile << kPathDelimiter;
00456             cvsFile << name;
00457             if(!cvsFile.endsWith(kPathDelimiter))
00458                 cvsFile << kPathDelimiter;
00459             cvsFile << "CVS";
00460             struct stat sb;
00461             if (stat(cvsFile, &sb) != -1 && S_ISDIR(sb.st_mode))
00462             {
00463                 data->SetUnknown(false);
00464             }
00465         }
00466     }
00467
00468     if(isFolder)
00469     {
00470         if(data->IsIgnored())
00471         {
00472             data->SetDesc("Ignored Folder");
00473         }
00474         else if(data->IsUnknown())
00475         {
00476             data->SetDesc("NonCvs Folder");
00477         }
00478         else
00479         {
00480             data->SetDesc("Folder");
00481         }
00482     }
00483     else
00484     {
00485         const char *ts = (*data)[EntnodeFile::kTS];
00486         if(ts == 0L)
00487             data->SetUnmodified(true);
00488         else
00489             data->SetUnmodified(unmodified(finfo, ts));
00490
00491 #if defined(WIN32)
00492         if (GetWinCvsDebugMaskBit(wcvsdbg_trace_modified_checks_bit))
00493         {
00494             char scratch[128];
00495
00496             /* copied from unmodified... */
00497             char *cp;
00498             struct tm *tm_p;
00499             struct tm local_tm;
00500             tm_p = gmtime (& finfo.st_mtime);
00501             if (tm_p)
00502             {
00503                 memcpy (&local_tm, tm_p, sizeof (local_tm));
00504                 cp = asctime (&local_tm);   /* copy in the modify time */
00505             }
00506             else
00507             {
00508                 cp = "NULL";
00509             }
00510
00511             _snprintf(scratch, 128,
00512                 "Checking timestamps for %s: Entries: %s, file: %s --> %s\n",
00513                 name, ts, cp,
00514                 data->IsUnmodified() ? "unmodified" : "modified");
00515             cvs_err(scratch);
00516             OutputDebugString(scratch);
00517         }
00518 #endif
00519
00520         data->SetLocked((finfo.st_mode & S_IWRITE) == 0);
00521
00522         const char *info = 0L;
00523         if(data->IsIgnored())
00524         {
00525             data->SetDesc("Ignored");
00526         }
00527         else if(data->IsUnknown())
00528         {
00529             data->SetDesc("NonCvs file");
00530         }
00531         else if(data->GetConflict() != 0L)
00532         {
00533             data->SetDesc("Conflict");
00534         }
00535         else if((info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-kb") == 0)
00536         {
00537             data->SetDesc(data->IsUnmodified() ? "Binary" : "Mod. Binary");
00538         }
00539         else if((info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-ku") == 0)
00540         {
00541             data->SetDesc(data->IsUnmodified() ? "Unicode" : "Mod. Unicode");
00542         }
00543         else
00544         {
00545             data->SetDesc(data->IsUnmodified() ? "File" : "Mod. File");
00546         }
00547     }
00548
00549     return data;
00550 }

bool Tag_Open | ( | UStr & | tag,
 |  | const char * | fullpath
 | ) |

Definition at line 567 of file CvsEntries.cpp.

Referenced by TViewFill::OnDirectory.

00568 {
00569     tag = "";
00570     CStr tagFile(fullpath);
00571     if(!tagFile.endsWith(kPathDelimiter))
00572         tagFile << kPathDelimiter;
00573     tagFile << "Tag";
00574
00575     FILE *fpin = fopen(tagFile, "r");
00576     if (fpin == 0L)
00577         return false;
00578
00579     char *line = 0L;
00580     size_t line_chars_allocated = 0;
00581     int line_length;
00582     if((line_length = getline (&line, &line_chars_allocated, fpin)) > 0)
00583     {
00584         char *tmp = strchr(line, '\n');
00585         if(tmp != 0L)
00586             *tmp = '\0';
00587         if(line[0] == 'T')
00588             tag = line + 1;
00589     }
00590     if(line != 0L)
00591         free(line);
00592     if (line_length < 0 && !feof (fpin))
00593     {
00594         cvs_err("Cannot open Tag file in '%s' (error %d)\n", fullpath, errno);
00595         return false;
00596     }
00597
00598     fclose (fpin);
00599     return !tag.empty();
00600 }

Generated on Sun Feb 24 01:21:52 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


cvsgui.c File Reference

common/cvsgui.c File Reference

#include <string.h>
#include <stdio.h>
#include <limits.h>
#include "cvsgui_process.h"
#include "cvsgui_protocol.h"

Include dependency graph for cvsgui.c:

Include dependency graph

Go to the source code of this file.

Defines

#define | PATH_MAX 512
#define | BUF_SIZE 8000

Functions

char * | getpass (const char *prompt)
char * | cvsguiglue_getenv (const char *env)
char * | cvsguiglue_getpass (const char *prompt)
void | cvsguiglue_exit (int code)
void | reopen_consoles (void)
void | close_consoles (void)
void | myflush (FILE *log, long *oldpos)
void | cvsguiglue_flushconsole (int closeit)
int | main (int argc, char *argv[])

Variables

pipe_t | _cvsgui_readfd = 0
pipe_t | _cvsgui_writefd = 0
long | outseek
long | errseek
char | outname [512] = {0}
char | errname [512] = {0}
FILE * | outlog
FILE * | errlog

Define Documentation

#define BUF_SIZE 8000

#define PATH_MAX 512

Definition at line 39 of file cvsgui.c.

Function Documentation

void close_consoles ( void ) [static]

Definition at line 128 of file cvsgui.c.

References errlog, errname, outlog, and outname.

Referenced by cvsguiglue_flushconsole.

00129 {
00130 #if !defined(WIN32) && !defined(__GNUC__)
00131     if(outlog != 0L)
00132         fclose(outlog);
00133     if(errlog != 0L)
00134         fclose(errlog);
00135     if(outname[0])
00136         unlink(outname);
00137     if(errname[0])
00138         unlink(errname);
00139     outlog = 0L;
00140     errlog = 0L;
00141     outname[0] = '\0';
00142     errname[0] = '\0';
00143 #endif
00144 }

void cvsguiglue_exit ( int code )

Definition at line 92 of file cvsgui.c.

References _cvsgui_writefd, cvsguiglue_flushconsole, exit, and gp_quit_write.

00093 {
00094     cvsguiglue_flushconsole(1);
00095
00096     if(_cvsgui_writefd != 0)
00097         gp_quit_write (_cvsgui_writefd, code);
00098     exit(code);
00099 }

void cvsguiglue_flushconsole ( int closeit )

Definition at line 184 of file cvsgui.c.

References close_consoles, errlog, errseek, myflush, outlog, and outseek.

00185 {
00186     fflush(stdout);
00187     fflush(stderr);
00188
00189 #if !defined(WIN32) && !defined(__GNUC__)
00190     if(outlog != 0L)
00191         myflush(outlog, &outseek);
00192     if(errlog != 0L)
00193         myflush(errlog, &errseek);
00194     if(closeit)
00195         close_consoles();
00196 #endif
00197 }

char* cvsguiglue_getenv ( const char * env )

Definition at line 65 of file cvsgui.c.

References _cvsgui_readfd, _cvsgui_writefd, cvsguiglue_flushconsole, getenv, gp_getenv_read, and gp_getenv_write.

00066 {
00067     char *res = 0L;
00068
00069     if(_cvsgui_readfd == 0)
00070         return getenv(env);
00071
00072     cvsguiglue_flushconsole(0);
00073
00074     if(env && gp_getenv_write (_cvsgui_writefd, env))
00075     {
00076         res = gp_getenv_read(_cvsgui_readfd);;
00077     }
00078
00079     return res;
00080 }

char* cvsguiglue_getpass ( const char * prompt )

Definition at line 82 of file cvsgui.c.

References _cvsgui_readfd, cvsguiglue_flushconsole, cvsguiglue_getenv, and getpass.

00083 {
00084     cvsguiglue_flushconsole(0);
00085
00086     if(_cvsgui_readfd == 0)
00087         return getpass(prompt);
00088
00089     return cvsguiglue_getenv("CVS_GETPASS");
00090 }

char* getpass ( const char * prompt )

int main | ( | int | argc,
 |  | char * | argv[]
 | ) |

Definition at line 199 of file cvsgui.c.

References _cvsgui_readfd, _cvsgui_writefd, cvs_process_init, cvsguiglue_flushconsole, cvsguiglue_main, free, gp_quit_write, malloc, and reopen_consoles.

00200 {
00201     int res;
00202     char **tmparg = 0L;
00203
00204     if(argc >= 4 && strcmp(argv[1], "-cvsgui") == 0)
00205     {
00206         int i;
00207
00208         _cvsgui_readfd = (pipe_t)atoi (argv[2]);
00209         _cvsgui_writefd = (pipe_t)atoi (argv[3]);
00210
00211         tmparg = (char **)malloc((argc - 2) * sizeof(char *));
00212         if(tmparg == 0L)
00213             goto ignore;
00214
00215         tmparg[0] = argv[0];
00216         for(i = 4; i < argc; i++)
00217         {
00218             tmparg[i - 3] = argv[i];
00219         }
00220         tmparg[argc - 3] = 0L;
00221         argc -= 3;
00222
00223         cvs_process_init();
00224         reopen_consoles();
00225     }
00226
00227 ignore:
00228     res = cvsguiglue_main(argc, tmparg != 0L ? tmparg :  argv);
00229
00230     if(tmparg != 0L)
00231     {
00232         cvsguiglue_flushconsole(1);
00233         if(_cvsgui_writefd != 0)
00234             gp_quit_write (_cvsgui_writefd, res);
00235         free(tmparg);
00236     }
00237
00238     return res;
00239 }

void myflush | ( | FILE * | log,
 |  | long * | oldpos
 | ) | [static]

Definition at line 147 of file cvsgui.c.

References _cvsgui_writefd, errlog, gp_console_write, and outlog.

Referenced by cvsguiglue_flushconsole.

00148 {
00149     long newpos, pos;
00150 #   define BUF_SIZE 8000
00151     char buf[BUF_SIZE];
00152     size_t len;
00153
00154     pos = fseek(log, *oldpos, SEEK_SET);
00155     if(pos != 0)
00156         goto fail;
00157
00158     while(!feof(log) && !ferror(log))
00159     {
00160         len = fread(buf, sizeof(char), BUF_SIZE, log);
00161         if(len > 0)
00162         {
00163             if(log == outlog)
00164                 gp_console_write (_cvsgui_writefd, buf, len, 0);
00165             if(log == errlog)
00166                 gp_console_write (_cvsgui_writefd, buf, len, 1);
00167         }
00168     }
00169
00170     if(ferror(log))
00171         goto fail;
00172
00173     newpos = ftell(log);
00174     if(newpos < 0)
00175         goto fail;
00176
00177     *oldpos = newpos;
00178     return;
00179 fail:
00180     fprintf(stderr, "Unable to redirect stdout/stderr !\n");
00181 }

void reopen_consoles ( void ) [static]

Definition at line 101 of file cvsgui.c.

References errlog, errname, errseek, exit, outlog, outname, and outseek.

Referenced by main.

00102 {
00103 #if !defined(WIN32) && !defined(__GNUC__)
00104     strcpy(outname, tempnam(0L, 0L));
00105     strcpy(errname, tempnam(0L, 0L));
00106     strcat(outname, ".out");
00107     strcat(errname, ".err");
00108
00109     outlog = freopen(outname, "w+", stdout);
00110     if(outlog == 0L)
00111     {
00112         fprintf(stderr, "Unable to reopen stdout !\n");
00113         exit(1);
00114     }
00115     errlog = freopen(errname, "w+", stderr);
00116     if(errlog == 0L)
00117     {
00118         fprintf(stderr, "Unable to reopen stderr !\n");
00119         exit(1);
00120     }
00121
00122     outseek = 0;
00123     errseek = 0;
00124 #endif
00125 }

Variable Documentation

pipe_t _cvsgui_readfd = 0

Definition at line 55 of file cvsgui.c.

Referenced by cvsguiglue_getenv, cvsguiglue_getpass, and main.

pipe_t _cvsgui_writefd = 0

Definition at line 56 of file cvsgui.c.

Referenced by cvsguiglue_exit, cvsguiglue_getenv, main, and myflush.

FILE* errlog [static]

Definition at line 63 of file cvsgui.c.

Referenced by close_consoles, cvsguiglue_flushconsole, myflush, and reopen_consoles.

char errname[ 512 ] = {0} [static]

Definition at line 61 of file cvsgui.c.

Referenced by close_consoles, and reopen_consoles.

long errseek [static]

Definition at line 59 of file cvsgui.c.

Referenced by cvsguiglue_flushconsole, and reopen_consoles.

FILE* outlog [static]

Definition at line 62 of file cvsgui.c.

Referenced by close_consoles, cvsguiglue_flushconsole, myflush, and reopen_consoles.

char outname[ 512 ] = {0} [static]

Definition at line 60 of file cvsgui.c.

Referenced by close_consoles, and reopen_consoles.

long outseek [static]

Definition at line 58 of file cvsgui.c.

Referenced by cvsguiglue_flushconsole, and reopen_consoles.

Generated on Sun Feb 24 01:21:52 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


cvsgui.h File Reference

common/cvsgui.h File Reference

#include <stdlib.h>

Include dependency graph for cvsgui.h:

Include dependency graph

Go to the source code of this file.

Defines

#define | getenv cvsguiglue_getenv
#define | getpass cvsguiglue_getpass
#define | getpassphrase cvsguiglue_getpass
#define | main cvsguiglue_main
#define | exit cvsguiglue_exit

Functions

char * | cvsguiglue_getenv (const char *env)
char * | cvsguiglue_getpass (const char *prompt)
int | cvsguiglue_main (int argc, char *argv[])
void | cvsguiglue_exit (int code)
void | cvsguiglue_flushconsole (int closeit)

Define Documentation

#define exit cvsguiglue_exit

Definition at line 51 of file cvsgui.h.

Referenced by BrowserGetMultiFiles, cvsguiglue_exit, dllglue_main, garbyNew, gp_getenv_read, listAddCell, listNew, mystrdup, and reopen_consoles.

#define getenv cvsguiglue_getenv

Definition at line 44 of file cvsgui.h.

Referenced by _getopt_initialize, cvsguiglue_getenv, glue_getenv, CvsPrefs::Home, initialize_all, MakeTmpFile, and AuthenSSH::RsaIdentityFile.

#define getpass cvsguiglue_getpass

Definition at line 45 of file cvsgui.h.

Referenced by cvsguiglue_getpass.

#define getpassphrase cvsguiglue_getpass

Definition at line 48 of file cvsgui.h.

#define main cvsguiglue_main

Definition at line 50 of file cvsgui.h.

Referenced by dllglue_main.

Function Documentation

void cvsguiglue_exit ( int code )

Definition at line 92 of file cvsgui.c.

00093 {
00094     cvsguiglue_flushconsole(1);
00095
00096     if(_cvsgui_writefd != 0)
00097         gp_quit_write (_cvsgui_writefd, code);
00098     exit(code);
00099 }

void cvsguiglue_flushconsole ( int closeit )

Definition at line 184 of file cvsgui.c.

Referenced by cvsguiglue_exit, cvsguiglue_getenv, cvsguiglue_getpass, and main.

00185 {
00186     fflush(stdout);
00187     fflush(stderr);
00188
00189 #if !defined(WIN32) && !defined(__GNUC__)
00190     if(outlog != 0L)
00191         myflush(outlog, &outseek);
00192     if(errlog != 0L)
00193         myflush(errlog, &errseek);
00194     if(closeit)
00195         close_consoles();
00196 #endif
00197 }

char* cvsguiglue_getenv ( const char * env )

Definition at line 65 of file cvsgui.c.

Referenced by cvsguiglue_getpass.

00066 {
00067     char *res = 0L;
00068
00069     if(_cvsgui_readfd == 0)
00070         return getenv(env);
00071
00072     cvsguiglue_flushconsole(0);
00073
00074     if(env && gp_getenv_write (_cvsgui_writefd, env))
00075     {
00076         res = gp_getenv_read(_cvsgui_readfd);;
00077     }
00078
00079     return res;
00080 }

char* cvsguiglue_getpass ( const char * prompt )

Definition at line 82 of file cvsgui.c.

00083 {
00084     cvsguiglue_flushconsole(0);
00085
00086     if(_cvsgui_readfd == 0)
00087         return getpass(prompt);
00088
00089     return cvsguiglue_getenv("CVS_GETPASS");
00090 }

int cvsguiglue_main | ( | int | argc,
 |  | char * | argv[]
 | ) |

Referenced by main.

Generated on Sun Feb 24 01:21:52 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


cvsgui_process.cpp File Reference

common/cvsgui_process.cpp File Reference

#include <errno.h>
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <stack>
#include <vector>
#include <algorithm>
#include "cvsgui_process.h"
#include "cvsgui_protocol.h"

Include dependency graph for cvsgui_process.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

struct | CDestroyThreadLock
class | CDummyInit
struct | CStackThreadLock

Defines

#define | STD_STL std::
#define | BUFFSIZE 1024

Functions

int | cvs_process_write (pipe_t fd, guint8 *buf, gulong count)
int | cvs_process_flush (pipe_t fd)
void | cvs_process_push (CvsProcess *cvs_process)
void | cvs_process_pop (void)
void | cvs_process_recv_message (CvsProcess *p)
void | cvs_process_handle_message (WireMessage *msg)
void | cvs_process_close (CvsProcess *cvs_process, int kill_it)
void | cvs_process_destroy (CvsProcess *cvs_process)
CvsProcess * | cvs_process_new (char *name, int argc, char **argv)
int | write (pipe_t fd, const void *buf, int count)
void | _gp_quit_read (pipe_t fd, WireMessage *msg)
void | _gp_quit_write (pipe_t fd, WireMessage *msg)
void | _gp_quit_destroy (WireMessage *msg)
void | _gp_getenv_read (pipe_t fd, WireMessage *msg)
void | _gp_getenv_write (pipe_t fd, WireMessage *msg)
void | _gp_getenv_destroy (WireMessage *msg)
void | _gp_console_read (pipe_t fd, WireMessage *msg)
void | _gp_console_write (pipe_t fd, WireMessage *msg)
void | _gp_console_destroy (WireMessage *msg)
void | gp_init ()
int | gp_quit_write (pipe_t fd, int code)
int | gp_getenv_write (pipe_t fd, const char *env)
char * | gp_getenv_read (pipe_t fd)
int | gp_console_write (pipe_t fd, const char *str, int len, int isStderr)
void | cvs_process_init ()
char * | build_command (int argc, char *const *argv)
DWORD | GetChldOutput (CvsProcess *process)
DWORD | GetChldError (CvsProcess *process)
DWORD | WaitChld (CvsProcess *process)
DWORD | ServeProtocol (CvsProcess *process)
CvsProcess * | cvs_process_open (char *name, int argc, char **argv, CvsProcessCallbacks *callbacks, int hasTty, const char *currentDirectory)
int | cvs_process_is_active (CvsProcess *cvs_process)
void | cvs_process_kill (CvsProcess *cvs_process)
int | cvs_process_give_time (void)

Variables

std::deque< CvsProcess * > | cvs_process_stack
std::vector< CvsProcess * > open_cvs_process
CvsProcess * | current_cvs_process = NULL
int | current_write_buffer_index = 0
char * | current_write_buffer = NULL
char | process_write_buffer [512]
CDummyInit sDummyObject

Define Documentation

#define BUFFSIZE 1024

Definition at line 543 of file cvsgui_process.cpp.

Referenced by GetChldError, and GetChldOutput.

#define STD_STL std::

Definition at line 56 of file cvsgui_process.cpp.

Referenced by cvs_process_close, cvs_process_give_time, and cvs_process_is_active.

Function Documentation

void _gp_console_destroy ( WireMessage * msg ) [static]

Definition at line 258 of file cvsgui_process.cpp.

References _WireMessage::data, free, and GPT_CONSOLE::str.

Referenced by gp_init.

00259 {
00260     GPT_CONSOLE *t = (GPT_CONSOLE *)msg->data;
00261     free(t->str);
00262     free(t);
00263 }

void _gp_console_read | ( | pipe_t | fd,
 |  | WireMessage * | msg
 | ) | [static]

Definition at line 229 of file cvsgui_process.cpp.

References _WireMessage::data, GPT_CONSOLE::isStderr, GPT_CONSOLE::len, malloc, pipe_t, GPT_CONSOLE::str, wire_read_int32, wire_read_int8, and wire_read_string.

Referenced by gp_init.

00230 {
00231     GPT_CONSOLE *t = (GPT_CONSOLE *)malloc(sizeof(GPT_CONSOLE));
00232     if(t == 0L)
00233         return;
00234
00235     if (!wire_read_int8 (fd, &t->isStderr, 1))
00236         return;
00237     if (!wire_read_int32 (fd, &t->len, 1))
00238         return;
00239     if (!wire_read_string (fd, &t->str, 1))
00240         return;
00241
00242     msg->data = t;
00243 }

void _gp_console_write | ( | pipe_t | fd,
 |  | WireMessage * | msg
 | ) | [static]

Definition at line 246 of file cvsgui_process.cpp.

References _WireMessage::data, GPT_CONSOLE::isStderr, GPT_CONSOLE::len, pipe_t, GPT_CONSOLE::str, wire_write_int32, wire_write_int8, and wire_write_string.

Referenced by gp_init.

00247 {
00248     GPT_CONSOLE *t = (GPT_CONSOLE *)msg->data;
00249     if (!wire_write_int8 (fd, &t->isStderr, 1))
00250         return;
00251     if (!wire_write_int32 (fd, &t->len, 1))
00252         return;
00253     if (!wire_write_string (fd, &t->str, 1))
00254         return;
00255 }

void _gp_getenv_destroy ( WireMessage * msg ) [static]

Definition at line 221 of file cvsgui_process.cpp.

References _WireMessage::data, free, and GPT_GETENV::str.

Referenced by gp_init.

00222 {
00223     GPT_GETENV *t = (GPT_GETENV *)msg->data;
00224     free(t->str);
00225     free(t);
00226 }

void _gp_getenv_read | ( | pipe_t | fd,
 |  | WireMessage * | msg
 | ) | [static]

Definition at line 196 of file cvsgui_process.cpp.

References _WireMessage::data, GPT_GETENV::empty, malloc, pipe_t, GPT_GETENV::str, wire_read_int8, and wire_read_string.

Referenced by gp_init.

00197 {
00198     GPT_GETENV *t = (GPT_GETENV *)malloc(sizeof(GPT_GETENV));
00199     if(t == 0L)
00200         return;
00201
00202     if (!wire_read_int8 (fd, &t->empty, 1))
00203         return;
00204     if (!wire_read_string (fd, &t->str, 1))
00205         return;
00206
00207     msg->data = t;
00208 }

void _gp_getenv_write | ( | pipe_t | fd,
 |  | WireMessage * | msg
 | ) | [static]

Definition at line 211 of file cvsgui_process.cpp.

References _WireMessage::data, GPT_GETENV::empty, pipe_t, GPT_GETENV::str, wire_write_int8, and wire_write_string.

Referenced by gp_init.

00212 {
00213     GPT_GETENV *t = (GPT_GETENV *)msg->data;
00214     if (!wire_write_int8 (fd, &t->empty, 1))
00215         return;
00216     if (!wire_write_string (fd, &t->str, 1))
00217         return;
00218 }

void _gp_quit_destroy ( WireMessage * msg ) [static]

Definition at line 190 of file cvsgui_process.cpp.

References _WireMessage::data, and free.

Referenced by gp_init.

00191 {
00192     free(msg->data);
00193 }

void _gp_quit_read | ( | pipe_t | fd,
 |  | WireMessage * | msg
 | ) | [static]

Definition at line 169 of file cvsgui_process.cpp.

References GPT_QUIT::code, _WireMessage::data, guint32, malloc, pipe_t, and wire_read_int32.

Referenced by gp_init.

00170 {
00171     GPT_QUIT *t = (GPT_QUIT *)malloc(sizeof(GPT_QUIT));
00172     if(t == 0L)
00173         return;
00174
00175     if (!wire_read_int32 (fd, (guint32 *)&t->code, 1))
00176         return;
00177
00178     msg->data = t;
00179 }

void _gp_quit_write | ( | pipe_t | fd,
 |  | WireMessage * | msg
 | ) | [static]

Definition at line 182 of file cvsgui_process.cpp.

References GPT_QUIT::code, _WireMessage::data, guint32, pipe_t, and wire_write_int32.

Referenced by gp_init.

00183 {
00184     GPT_QUIT *t = (GPT_QUIT *)msg->data;
00185     if (!wire_write_int32 (fd, (guint32 *)&t->code, 1))
00186         return;
00187 }

char* build_command | ( | int | argc,
 |  | char *const * | argv
 | ) | [static]

Definition at line 479 of file cvsgui_process.cpp.

References malloc.

Referenced by cvs_process_open.

00480 {
00481     int len;
00482
00483     /* Compute the total length the command will have.  */
00484     {
00485         int i;
00486
00487         len = 0;
00488         for (i = 0; i < argc; i++)
00489         {
00490             char *p;
00491
00492             len += 2;  /* for the double quotes */
00493
00494             for (p = argv[i]; *p; p++)
00495             {
00496                 if (*p == '"')
00497                     len += 2;
00498                 else
00499                     len++;
00500             }
00501             len++;  /* for the space or the '\0'  */
00502         }
00503     }
00504
00505     {
00506         /* The + 10 is in case len is 0.  */
00507         char *command = (char *) malloc (len + 10);
00508         int i;
00509         char *p;
00510
00511         if (! command)
00512         {
00513             errno = ENOMEM;
00514             return command;
00515         }
00516
00517         p = command;
00518         *p = '\0';
00519         /* copy each element of argv to command, putting each command
00520         in double quotes, and backslashing any quotes that appear
00521         within an argument.  */
00522         for (i = 0; i < argc; i++)
00523         {
00524             char *a;
00525             *p++ = '"';
00526             for (a = argv[i]; *a; a++)
00527             {
00528                 if (*a == '"')
00529                     *p++ = '\\', *p++ = '"';
00530                 else
00531                     *p++ = *a;
00532             }
00533             *p++ = '"';
00534             *p++ = ' ';
00535         }
00536         if (p > command)
00537             p[-1] = '\0';
00538
00539         return command;
00540     }
00541 }

void cvs_process_close | ( | CvsProcess * | cvs_process,
 |  | int | kill_it
 | ) | [static]

Definition at line 1169 of file cvsgui_process.cpp.

References FALSE, _CvsProcess::his_read, _CvsProcess::his_write, _CvsProcess::my_read, _CvsProcess::my_write, _CvsProcess::open, open_cvs_process, _CvsProcess::pid, _CvsProcess::pstderr, _CvsProcess::pstdin, _CvsProcess::pstdout, _CvsProcess::starting, STD_STL, _CvsProcess::threads, _CvsProcess::threadsID, TRUE, and wire_clear_error.

Referenced by cvs_process_destroy, cvs_process_handle_message, and cvs_process_recv_message.

01171 {
01172     CDestroyThreadLock locker;
01173
01174     if (cvs_process && cvs_process->open)
01175     {
01176 #ifdef WIN32
01177         if(GetCurrentThreadId() != cvs_process->threadsID[0])
01178         {
01179             // we wait for all the protocol to be over before we close
01180             // the process and the pipe.
01181             WaitForSingleObject(cvs_process->threads[0], 500);
01182             cvs_process->open = FALSE;
01183             WaitForSingleObject(cvs_process->threads[0], 500);
01184         }
01185 #endif
01186
01187         cvs_process->open = FALSE;
01188
01189 #ifndef WIN32
01190         int status;
01191
01192         /* If necessary, kill the filter.
01193          */
01194         if (kill_it && cvs_process->pid)
01195             status = kill (cvs_process->pid, SIGKILL);
01196
01197         /* Wait for the process to exit. This will happen
01198          *  immediately if it was just killed.
01199          */
01200         if (cvs_process->pid)
01201             waitpid (cvs_process->pid, &status, 0);
01202
01203         /* Close the pipes.
01204          */
01205         if (cvs_process->my_read)
01206             close (cvs_process->my_read);
01207         if (cvs_process->my_write)
01208             close (cvs_process->my_write);
01209         if (cvs_process->his_read)
01210             close (cvs_process->his_read);
01211         if (cvs_process->his_write)
01212             close (cvs_process->his_write);
01213 #else
01214         cvs_process->starting = TRUE;
01215
01216         // this is bad to do that, cvs won't have a chance
01217         // to raise the KILL signal (sigh...)
01218         if (kill_it && cvs_process->pid)
01219         {
01220             TerminateProcess(cvs_process->pid, -1);
01221         }
01222
01223         if (cvs_process->pid)
01224             CloseHandle(cvs_process->pid);
01225         if (cvs_process->my_read)
01226             CloseHandle(cvs_process->my_read);
01227         if (cvs_process->my_write)
01228             CloseHandle(cvs_process->my_write);
01229         if (cvs_process->his_read)
01230             CloseHandle(cvs_process->his_read);
01231         if (cvs_process->his_write)
01232             CloseHandle(cvs_process->his_write);
01233         if (cvs_process->pstdin)
01234             CloseHandle(cvs_process->pstdin);
01235         if (cvs_process->pstdout)
01236             CloseHandle(cvs_process->pstdout);
01237         if (cvs_process->pstderr)
01238             CloseHandle(cvs_process->pstderr);
01239 #endif
01240
01241         wire_clear_error();
01242
01243         /* Set the fields to null values.
01244          */
01245         cvs_process->pid = 0;
01246         cvs_process->my_read = 0;
01247         cvs_process->my_write = 0;
01248         cvs_process->his_read = 0;
01249         cvs_process->his_write = 0;
01250         cvs_process->pstdin = 0;
01251         cvs_process->pstdout = 0;
01252         cvs_process->pstderr = 0;
01253
01254         {
01255             CStackThreadLock locker;
01256
01257             STD_STL vector<CvsProcess *>::iterator i = STD_STL find(open_cvs_process.begin(), open_cvs_process.end(), cvs_process);
01258             if(i != open_cvs_process.end())
01259                 open_cvs_process.erase(i);
01260         }
01261     }
01262 }

void cvs_process_destroy ( CvsProcess * cvs_process ) [static]

Definition at line 422 of file cvsgui_process.cpp.

References _CvsProcess::argc, _CvsProcess::args, cvs_process_close, cvs_process_pop, _CvsProcess::destroy, free, _CvsProcess::threads, _CvsProcess::threadsID, and TRUE.

Referenced by cvs_process_kill, cvs_process_open, cvs_process_recv_message, and WaitChld.

00423 {
00424     if (cvs_process)
00425     {
00426         cvs_process_close (cvs_process, TRUE);
00427
00428         if(cvs_process->args != 0L)
00429         {
00430             for(int i = 0; i < cvs_process->argc; i++)
00431             {
00432                 if (cvs_process->args[i])
00433                 {
00434                     free (cvs_process->args[i]);
00435                     cvs_process->args[i] = 0L;
00436                 }
00437             }
00438             free(cvs_process->args);
00439             cvs_process->args = 0L;
00440         }
00441
00442         if (cvs_process == current_cvs_process)
00443             cvs_process_pop ();
00444
00445         if (!cvs_process->destroy)
00446         {
00447             cvs_process->destroy = TRUE;
00448 #ifdef WIN32
00449             // wait so the threads do not continue to use the pointer
00450             HANDLE WaitH[4];
00451             int cnt = 0;
00452             DWORD curT = GetCurrentThreadId();
00453             for(int i = 0; i < 4; i++)
00454             {
00455                 if(cvs_process->threads[i] && curT != cvs_process->threadsID[i])
00456                     WaitH[cnt++] = cvs_process->threads[i];
00457             }
00458             WaitForMultipleObjects(cnt, WaitH, TRUE, INFINITE);
00459
00460             //close the handles
00461             for(i = 0; i < 4; i++)
00462             {
00463                 if( cvs_process->threads[i] && CloseHandle(cvs_process->threads[i]) )
00464                 {
00465                     cvs_process->threads[i] = NULL;
00466                 }
00467             }
00468 #endif
00469             free (cvs_process);
00470         }
00471     }
00472 }

int cvs_process_flush ( pipe_t fd ) [static]

Definition at line 1446 of file cvsgui_process.cpp.

References current_write_buffer, current_write_buffer_index, FALSE, pipe_t, TRUE, and write.

Referenced by cvs_process_init.

01447 {
01448     int count;
01449     int bytes;
01450
01451     if (current_write_buffer_index > 0)
01452     {
01453         count = 0;
01454         while (count != current_write_buffer_index)
01455         {
01456             do {
01457                 bytes = write (fd, &current_write_buffer[count],
01458                                (current_write_buffer_index - count));
01459             } while ((bytes == -1) && (errno == EAGAIN));
01460
01461             if (bytes == -1)
01462                 return FALSE;
01463
01464             count += bytes;
01465         }
01466
01467         current_write_buffer_index = 0;
01468     }
01469
01470     return TRUE;
01471 }

int cvs_process_give_time ( void )

Definition at line 1290 of file cvsgui_process.cpp.

References cvs_process_recv_message, open_cvs_process, and STD_STL.

Referenced by launchCVS, UCvsApp::OnMainTimer, and testCVS.

01291 {
01292 #ifndef WIN32
01293     fd_set rset;
01294     int ready;
01295     int maxfd = 0;
01296     int fd;
01297     struct timeval tv;
01298     int didone = 0;
01299
01300     FD_ZERO (&rset);
01301
01302     STD_STL vector<CvsProcess *>::iterator i;
01303
01304     for (i = open_cvs_process.begin(); i != open_cvs_process.end(); ++i)
01305     {
01306         fd = (*i)->my_read;
01307
01308         FD_SET (fd, &rset);
01309         if (fd > maxfd)
01310             maxfd = fd;
01311     }
01312
01313     tv.tv_sec = 0;
01314     tv.tv_usec = 100000;
01315     ready = select (maxfd + 1, &rset, 0L, 0L, &tv);
01316
01317     STD_STL vector<CvsProcess *> toFire;
01318     if (ready > 0)
01319     {
01320         for (i = open_cvs_process.begin(); i != open_cvs_process.end(); ++i)
01321         {
01322             fd = (*i)->my_read;
01323
01324             if (FD_ISSET (fd, &rset))
01325                 toFire.push_back(*i);
01326         }
01327     }
01328
01329     for (i = toFire.begin(); i != toFire.end(); ++i)
01330     {
01331         fd = (*i)->my_read;
01332
01333         if (FD_ISSET (fd, &rset))
01334         {
01335             cvs_process_recv_message (*i);
01336             didone = 1;
01337         }
01338     }
01339
01340     return didone;
01341 #else
01342     // we don't have to do yield since we use preemptive threads
01343     return 0;
01344 #endif
01345 }

void cvs_process_handle_message ( WireMessage * msg ) [static]

Definition at line 1379 of file cvsgui_process.cpp.

References _CvsProcess::callbacks, GPT_QUIT::code, CvsProcessCallbacks::consoleerr, CvsProcessCallbacks::consoleout, cvs_process_close, cvs_process_pop, cvs_process_push, _WireMessage::data, CvsProcessCallbacks::exit, FALSE, CvsProcessCallbacks::getenv, GP_CONSOLE, GP_GETENV, gp_getenv_write, GP_QUIT, GPT_CONSOLE::isStderr, GPT_CONSOLE::len, _CvsProcess::my_write, GPT_CONSOLE::str, GPT_GETENV::str, and _WireMessage::type.

Referenced by cvs_process_recv_message.

01380 {
01381     switch (msg->type)
01382     {
01383     case GP_QUIT:
01384     {
01385         GPT_QUIT *t = (GPT_QUIT *)msg->data;
01386         current_cvs_process->callbacks->exit(t->code);
01387         cvs_process_close (current_cvs_process, FALSE);
01388         break;
01389     }
01390     case GP_GETENV:
01391     {
01392         GPT_GETENV *t = (GPT_GETENV *)msg->data;
01393         cvs_process_push (current_cvs_process);
01394         gp_getenv_write (current_cvs_process->my_write,
01395                          current_cvs_process->callbacks->getenv(t->str));
01396         cvs_process_pop ();
01397         break;
01398     }
01399     case GP_CONSOLE:
01400     {
01401         GPT_CONSOLE *t = (GPT_CONSOLE *)msg->data;
01402         if(t->isStderr)
01403             current_cvs_process->callbacks->consoleerr(t->str, t->len);
01404         else
01405             current_cvs_process->callbacks->consoleout(t->str, t->len);
01406         break;
01407     }
01408     }
01409 }

void cvs_process_init ( void )

Definition at line 365 of file cvsgui_process.cpp.

References cvs_process_flush, cvs_process_write, gp_init, wire_set_flusher, and wire_set_writer.

Referenced by cvs_process_new, and main.

00366 {
00367     /* initialize the gimp protocol library and set the read and
00368      *  write handlers.
00369      */
00370     gp_init ();
00371     wire_set_writer (cvs_process_write);
00372     wire_set_flusher (cvs_process_flush);
00373 }

int cvs_process_is_active ( CvsProcess * cvs_process )

Definition at line 1265 of file cvsgui_process.cpp.

References open_cvs_process, and STD_STL.

01266 {
01267     int res;
01268
01269     {
01270         CStackThreadLock locker;
01271
01272         STD_STL vector<CvsProcess *>::iterator i =
01273             STD_STL find(open_cvs_process.begin(), open_cvs_process.end(), cvs_process);
01274         res = i != open_cvs_process.end() ? 1 : 0;
01275     }
01276
01277     return res;
01278 }

void cvs_process_kill ( CvsProcess * cvs_process )

Definition at line 1281 of file cvsgui_process.cpp.

References cvs_process_destroy, and cvs_process_is_active.

01282 {
01283     if(cvs_process_is_active(cvs_process))
01284     {
01285         cvs_process_destroy(cvs_process);
01286     }
01287 }

CvsProcess * cvs_process_new | ( | char * | name,
 |  | int | argc,
 |  | char ** | argv
 | ) | [static]

Definition at line 376 of file cvsgui_process.cpp.

References _CvsProcess::argc, _CvsProcess::args, _CvsProcess::callbacks, cvs_process_init, _CvsProcess::destroy, FALSE, _CvsProcess::his_read, _CvsProcess::his_write, malloc, _CvsProcess::my_read, _CvsProcess::my_write, _CvsProcess::open, _CvsProcess::pid, _CvsProcess::pstderr, _CvsProcess::pstdin, _CvsProcess::pstdout, _CvsProcess::starting, strdup, _CvsProcess::threads, _CvsProcess::threadsID, TRUE, and _CvsProcess::write_buffer_index.

Referenced by cvs_process_open.

00377 {
00378     CvsProcess *cvs_process;
00379
00380     cvs_process_init();
00381
00382     cvs_process = (CvsProcess *)malloc(sizeof(CvsProcess));
00383     if(cvs_process == 0L)
00384         return 0L;
00385
00386     cvs_process->open = FALSE;
00387     cvs_process->destroy = FALSE;
00388 #ifdef WIN32
00389     cvs_process->starting = TRUE;
00390 #endif
00391     cvs_process->pid = 0;
00392     cvs_process->callbacks = 0L;
00393     cvs_process->argc = argc + 4;
00394     cvs_process->args = (char **)malloc((cvs_process->argc + 1) * sizeof(char *));
00395     cvs_process->args[0] = strdup (path);
00396     cvs_process->args[1] = strdup ("-cvsgui");
00397     cvs_process->args[2] = (char *)malloc(16 * sizeof(char));
00398     cvs_process->args[3] = (char *)malloc(16 * sizeof(char));
00399     for(int i = 0; i < argc; i++)
00400     {
00401         cvs_process->args[4 + i] = strdup(argv[i]);
00402     }
00403
00404     cvs_process->args[cvs_process->argc] = 0L;
00405     cvs_process->my_read = 0;
00406     cvs_process->my_write = 0;
00407     cvs_process->his_read = 0;
00408     cvs_process->his_write = 0;
00409     cvs_process->write_buffer_index = 0;
00410     cvs_process->pstdin = 0;
00411     cvs_process->pstdout = 0;
00412     cvs_process->pstderr = 0;
00413 #ifdef WIN32
00414     memset(cvs_process->threads, 0, sizeof(cvs_process->threads));
00415     memset(cvs_process->threadsID, 0, sizeof(cvs_process->threadsID));
00416 #endif
00417
00418     return cvs_process;
00419 }

CvsProcess* cvs_process_open | ( | char * | name,
 |  | int | argc,
 |  | char ** | argv,
 |  | CvsProcessCallbacks * | callbacks,
 |  | int | hasTty,
 |  | const char * | currentDirectory
 | ) |

Definition at line 889 of file cvsgui_process.cpp.

References _CvsProcess::argc, _CvsProcess::args, build_command, _CvsProcess::callbacks, cvs_process_destroy, cvs_process_new, FALSE, free, GetChldError, GetChldOutput, _CvsProcess::his_read, _CvsProcess::his_write, _CvsProcess::my_read, _CvsProcess::my_write, _CvsProcess::open, open_cvs_process, _CvsProcess::pid, _CvsProcess::pstderr, _CvsProcess::pstdin, _CvsProcess::pstdout, ServeProtocol, _CvsProcess::starting, _CvsProcess::threads, _CvsProcess::threadsID, TRUE, and WaitChld.

00890 {
00891     CvsProcess *cvs_process = cvs_process_new(name, argc, argv);
00892
00893     if (!cvs_process)
00894         return 0L;
00895
00896     cvs_process->callbacks = callbacks;
00897
00898 #ifndef WIN32
00899     int my_read[2];
00900     int my_write[2];
00901
00902     /* Open two pipes. (Bidirectional communication).
00903          */
00904     if ((pipe (my_read) == -1) || (pipe (my_write) == -1))
00905     {
00906         fprintf(stderr, "unable to open pipe\n");
00907         cvs_process_destroy (cvs_process);
00908         return 0L;
00909     }
00910
00911     cvs_process->my_read = my_read[0];
00912     cvs_process->my_write = my_write[1];
00913     cvs_process->his_read = my_write[0];
00914     cvs_process->his_write = my_read[1];
00915
00916     /* Remember the file descriptors for the pipes.
00917          */
00918     sprintf (cvs_process->args[2], "%d", cvs_process->his_read);
00919     sprintf (cvs_process->args[3], "%d", cvs_process->his_write);
00920
00921         /* Fork another process. We'll remember the process id
00922          *  so that we can later use it to kill the filter if
00923          *  necessary.
00924          */
00925     cvs_process->pid = fork ();
00926
00927     if (cvs_process->pid == 0)
00928     {
00929         close(cvs_process->my_read);
00930         close(cvs_process->my_write);
00931         /* Execute the filter. The "_exit" call should never
00932          *  be reached, unless some strange error condition
00933          *  exists.
00934          */
00935         execvp (cvs_process->args[0], cvs_process->args);
00936         _exit (1);
00937     }
00938     else if (cvs_process->pid == -1)
00939     {
00940         cvs_process_destroy (cvs_process);
00941         return 0L;
00942     }
00943
00944     close(cvs_process->his_read);  cvs_process->his_read  = -1;
00945     close(cvs_process->his_write); cvs_process->his_write = -1;
00946 #else
00947     SECURITY_ATTRIBUTES lsa;
00948     STARTUPINFO         si;
00949     PROCESS_INFORMATION pi;
00950
00951     HANDLE dupIn = 0L, dupOut = 0L;
00952     HANDLE stdChildIn = 0L, stdChildOut = 0L, stdChildErr = 0L;
00953     HANDLE stdoldIn = 0L, stdoldOut = 0L, stdoldErr = 0L;
00954     HANDLE stddupIn = 0L, stddupOut = 0L, stddupErr = 0L;
00955     char *command = 0L;
00956     BOOL resCreate;
00957     int cnt, i;
00958     LPTHREAD_START_ROUTINE threadsFunc[4];
00959
00960     lsa.nLength=sizeof(SECURITY_ATTRIBUTES);
00961     lsa.lpSecurityDescriptor=NULL;
00962     lsa.bInheritHandle=TRUE;
00963
00964     // create the pipes used for the cvsgui protocol
00965     if (!CreatePipe(&cvs_process->his_read,&dupIn,&lsa,0))
00966         goto error;
00967     if (!CreatePipe(&dupOut,&cvs_process->his_write,&lsa,0))
00968         goto error;
00969
00970     // duplicate the App side handles so they lose the inheritance
00971     if(!DuplicateHandle(GetCurrentProcess(), dupIn,
00972         GetCurrentProcess(), &cvs_process->my_write, 0, FALSE, DUPLICATE_SAME_ACCESS))
00973             goto error;
00974     CloseHandle(dupIn);
00975     dupIn = 0;
00976     if(!DuplicateHandle(GetCurrentProcess(), dupOut,
00977         GetCurrentProcess(), &cvs_process->my_read, 0, FALSE, DUPLICATE_SAME_ACCESS))
00978             goto error;
00979     CloseHandle(dupOut);
00980     dupOut = 0;
00981
00982     if(!hasTty)
00983     {
00984         // redirect stdout, stderr, stdin
00985         if (!CreatePipe(&stdChildIn,&stddupIn,&lsa,0))
00986             goto error;
00987         if (!CreatePipe(&stddupOut,&stdChildOut,&lsa,0))
00988             goto error;
00989         if (!CreatePipe(&stddupErr,&stdChildErr, &lsa,0))
00990             goto error;
00991
00992         // same thing as above
00993         if(!DuplicateHandle(GetCurrentProcess(), stddupIn,
00994             GetCurrentProcess(), &cvs_process->pstdin, 0, FALSE, DUPLICATE_SAME_ACCESS))
00995                 goto error;
00996         CloseHandle(stddupIn);
00997         stddupIn = 0;
00998         if(!DuplicateHandle(GetCurrentProcess(), stddupOut,
00999             GetCurrentProcess(), &cvs_process->pstdout, 0, FALSE, DUPLICATE_SAME_ACCESS))
01000                 goto error;
01001         CloseHandle(stddupOut);
01002         stddupOut = 0;
01003         if(!DuplicateHandle(GetCurrentProcess(), stddupErr,
01004             GetCurrentProcess(), &cvs_process->pstderr, 0, FALSE, DUPLICATE_SAME_ACCESS))
01005                 goto error;
01006         CloseHandle(stddupErr);
01007         stddupErr = 0;
01008     }
01009
01010     // Build the arguments for cvs
01011     sprintf (cvs_process->args[2], "%d", cvs_process->his_read);
01012     sprintf (cvs_process->args[3], "%d", cvs_process->his_write);
01013
01014     command = build_command(cvs_process->argc, cvs_process->args);
01015     if(command == 0L)
01016         goto error;
01017
01018     // Lets Redirect Console StdHandles and set the start options
01019     memset(&si,0,sizeof(STARTUPINFO));
01020     si.cb=sizeof(STARTUPINFO);
01021     si.dwFlags=hasTty ? 0 : STARTF_USESTDHANDLES;
01022     si.hStdInput =stdChildIn;
01023     si.hStdOutput=stdChildOut;
01024     si.hStdError =stdChildErr;
01025     if(!hasTty)
01026     {
01027         si.dwFlags|=STARTF_USESHOWWINDOW;
01028         si.wShowWindow = SW_SHOWMINNOACTIVE;
01029     }
01030
01031     if(!hasTty)
01032     {
01033         stdoldIn = GetStdHandle(STD_INPUT_HANDLE);
01034         stdoldOut = GetStdHandle(STD_OUTPUT_HANDLE);
01035         stdoldErr = GetStdHandle(STD_ERROR_HANDLE);
01036         SetStdHandle(STD_INPUT_HANDLE, stdChildIn);
01037         SetStdHandle(STD_OUTPUT_HANDLE, stdChildOut);
01038         SetStdHandle(STD_ERROR_HANDLE, stdChildErr);
01039     }
01040
01041     //Create Child Process
01042     resCreate = CreateProcess
01043          (
01044             NULL,
01045             command,
01046             NULL,
01047             NULL,
01048             TRUE,
01049             NORMAL_PRIORITY_CLASS,
01050             NULL,
01051             currentDirectory,
01052             &si,
01053             &pi);
01054
01055     if(!hasTty)
01056     {
01057         SetStdHandle(STD_INPUT_HANDLE, stdoldIn);
01058         SetStdHandle(STD_OUTPUT_HANDLE, stdoldOut);
01059         SetStdHandle(STD_ERROR_HANDLE, stdoldErr);
01060     }
01061
01062     if(!resCreate)
01063         goto error;
01064
01065     cvs_process->pid = pi.hProcess;
01066
01067     cnt = 0;
01068
01069     // now open-up threads which will serve the pipes
01070     threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)ServeProtocol;
01071     threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)WaitChld;
01072     if(!hasTty)
01073     {
01074         threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)GetChldOutput;
01075         threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)GetChldError;
01076     }
01077
01078     for(i = 0; i < cnt; i++)
01079     {
01080         if ((cvs_process->threads[i]=::CreateThread
01081                       (
01082                          (LPSECURITY_ATTRIBUTES)NULL,           // No security attributes.
01083                          (DWORD)0,                              // Use same stack size.
01084                          (LPTHREAD_START_ROUTINE)threadsFunc[i], // Thread procedure.
01085                          (LPVOID)cvs_process,                   // Parameter to pass.
01086                          (DWORD)0,                              // Run immediately.
01087                          (LPDWORD)&cvs_process->threadsID[i])
01088                       )==NULL)
01089         {
01090             TerminateProcess(cvs_process->pid,0);
01091             goto error;
01092         }
01093     }
01094
01095     //Close unneccesary Handles
01096     CloseHandle(cvs_process->his_read);
01097     cvs_process->his_read = 0;
01098     CloseHandle(cvs_process->his_write);
01099     cvs_process->his_write = 0;
01100
01101     if(!hasTty)
01102     {
01103         CloseHandle(stdChildIn);
01104         CloseHandle(stdChildOut);
01105         CloseHandle(stdChildErr);
01106     }
01107
01108     CloseHandle(pi.hThread);
01109
01110     free(command);
01111
01112     goto goodboy;
01113
01114 error:
01115     if(cvs_process->his_read != 0L)
01116         CloseHandle(cvs_process->his_read);
01117     if(cvs_process->his_write != 0L)
01118         CloseHandle(cvs_process->his_write);
01119     if(dupIn != 0L)
01120         CloseHandle(dupIn);
01121     if(dupOut != 0L)
01122         CloseHandle(dupOut);
01123     if(cvs_process->my_read != 0L)
01124         CloseHandle(cvs_process->my_read);
01125     if(cvs_process->my_write != 0L)
01126         CloseHandle(cvs_process->my_write);
01127     if(command != 0L)
01128         free(command);
01129     if(stdChildIn != 0L)
01130         CloseHandle(stdChildIn);
01131     if(stdChildOut != 0L)
01132         CloseHandle(stdChildOut);
01133     if(stdChildErr != 0L)
01134         CloseHandle(stdChildErr);
01135     if(stddupIn != 0L)
01136         CloseHandle(stddupIn);
01137     if(stddupOut != 0L)
01138         CloseHandle(stddupOut);
01139     if(stddupErr != 0L)
01140         CloseHandle(stddupErr);
01141     if(cvs_process->pstdin != 0L)
01142         CloseHandle(cvs_process->pstdin);
01143     if(cvs_process->pstdout != 0L)
01144         CloseHandle(cvs_process->pstdout);
01145     if(cvs_process->pstderr != 0L)
01146         CloseHandle(cvs_process->pstderr);
01147
01148     cvs_process_destroy (cvs_process);
01149     return 0L;
01150
01151 goodboy:
01152 #endif
01153
01154     {
01155         CStackThreadLock locker;
01156
01157         open_cvs_process.push_back(cvs_process);
01158     }
01159
01160     cvs_process->open = TRUE;
01161 #ifdef WIN32
01162     cvs_process->starting = FALSE;
01163 #endif
01164
01165     return cvs_process;
01166 }

void cvs_process_pop ( void ) [static]

Definition at line 1495 of file cvsgui_process.cpp.

References current_write_buffer, current_write_buffer_index, cvs_process_stack, _CvsProcess::write_buffer, and _CvsProcess::write_buffer_index.

Referenced by cvs_process_destroy, cvs_process_handle_message, and cvs_process_recv_message.

01496 {
01497     CStackThreadLock locker;
01498
01499     if (current_cvs_process)
01500     {
01501         current_cvs_process->write_buffer_index = current_write_buffer_index;
01502
01503         cvs_process_stack.pop_back();
01504     }
01505
01506     if (!cvs_process_stack.empty())
01507     {
01508         current_cvs_process = cvs_process_stack.back();
01509         current_write_buffer_index = current_cvs_process->write_buffer_index;
01510         current_write_buffer = current_cvs_process->write_buffer;
01511     }
01512     else
01513     {
01514         current_cvs_process = NULL;
01515         current_write_buffer_index = 0;
01516         current_write_buffer = NULL;
01517     }
01518 }

void cvs_process_push ( CvsProcess * cvs_process ) [static]

Definition at line 1474 of file cvsgui_process.cpp.

References current_write_buffer, current_write_buffer_index, cvs_process_stack, _CvsProcess::write_buffer, and _CvsProcess::write_buffer_index.

Referenced by cvs_process_handle_message, and cvs_process_recv_message.

01475 {
01476     CStackThreadLock locker;
01477
01478     if (cvs_process)
01479     {
01480         current_cvs_process = cvs_process;
01481
01482         cvs_process_stack.push_back(current_cvs_process);
01483
01484         current_write_buffer_index = current_cvs_process->write_buffer_index;
01485         current_write_buffer = current_cvs_process->write_buffer;
01486     }
01487     else
01488     {
01489         current_write_buffer_index = 0;
01490         current_write_buffer = NULL;
01491     }
01492 }

void cvs_process_recv_message ( CvsProcess * p ) [static]

Definition at line 1348 of file cvsgui_process.cpp.

References cvs_process_close, cvs_process_destroy, cvs_process_handle_message, cvs_process_is_active, cvs_process_pop, cvs_process_push, _CvsProcess::my_read, _CvsProcess::open, TRUE, wire_destroy, and wire_read_msg.

Referenced by cvs_process_give_time, and ServeProtocol.

01349 {
01350     WireMessage msg;
01351
01352     cvs_process_push (p);
01353
01354     memset (&msg, 0, sizeof (WireMessage));
01355     if (!wire_read_msg (p->my_read, &msg))
01356     {
01357         cvs_process_close (p, TRUE);
01358     }
01359     else
01360     {
01361         cvs_process_handle_message (&msg);
01362         wire_destroy (&msg);
01363     }
01364
01365     if(cvs_process_is_active(current_cvs_process))
01366     {
01367         if (!current_cvs_process->open)
01368         {
01369 #ifndef WIN32
01370             cvs_process_destroy (current_cvs_process);
01371 #endif
01372         }
01373         else
01374             cvs_process_pop ();
01375     }
01376 }

int cvs_process_write | ( | pipe_t | fd,
 |  | guint8 * | buf,
 |  | gulong | count
 | ) | [static]

Definition at line 1412 of file cvsgui_process.cpp.

References current_write_buffer, current_write_buffer_index, FALSE, guint8, gulong, pipe_t, process_write_buffer, TRUE, wire_flush, and WRITE_BUFFER_SIZE.

Referenced by cvs_process_init.

01415 {
01416     gulong bytes;
01417
01418     if(current_write_buffer == 0L)
01419         current_write_buffer = process_write_buffer;
01420
01421     while (count > 0)
01422     {
01423         if ((current_write_buffer_index + count) >= WRITE_BUFFER_SIZE)
01424         {
01425             bytes = WRITE_BUFFER_SIZE - current_write_buffer_index;
01426             memcpy (&current_write_buffer[current_write_buffer_index], buf, bytes);
01427             current_write_buffer_index += bytes;
01428             if (!wire_flush (fd))
01429                 return FALSE;
01430         }
01431         else
01432         {
01433             bytes = count;
01434             memcpy (&current_write_buffer[current_write_buffer_index], buf, bytes);
01435             current_write_buffer_index += bytes;
01436         }
01437
01438         buf += bytes;
01439         count -= bytes;
01440     }
01441
01442     return TRUE;
01443 }

DWORD GetChldError ( CvsProcess * process ) [static]

Definition at line 562 of file cvsgui_process.cpp.

References BUFFSIZE, _CvsProcess::callbacks, CvsProcessCallbacks::consoleerr, and _CvsProcess::pstderr.

Referenced by cvs_process_open.

00565 {
00566     char  buff[BUFFSIZE];
00567     DWORD dread;
00568
00569     while(ReadFile(process->pstderr,buff,BUFFSIZE-1,&dread,NULL))
00570     {
00571         buff[dread]='\0';
00572         process->callbacks->consoleerr(buff, dread);
00573     }
00574     return(1);
00575 }

DWORD GetChldOutput ( CvsProcess * process ) [static]

Definition at line 546 of file cvsgui_process.cpp.

References BUFFSIZE, _CvsProcess::callbacks, CvsProcessCallbacks::consoleout, and _CvsProcess::pstdout.

Referenced by cvs_process_open.

00549 {
00550     char  buff[BUFFSIZE];
00551     DWORD dread;
00552
00553     while(ReadFile(process->pstdout,buff,BUFFSIZE-1,&dread,NULL))
00554     {
00555         buff[dread]='\0';
00556         process->callbacks->consoleout(buff, dread);
00557     }
00558     return(1);
00559 }

int gp_console_write | ( | pipe_t | fd,
 |  | const char * | str,
 |  | int | len,
 |  | int | isStderr
 | ) |

Definition at line 343 of file cvsgui_process.cpp.

References _WireMessage::data, FALSE, GP_CONSOLE, GPT_CONSOLE::isStderr, GPT_CONSOLE::len, malloc, pipe_t, GPT_CONSOLE::str, TRUE, _WireMessage::type, wire_flush, and wire_write_msg.

00344 {
00345     WireMessage msg;
00346     GPT_CONSOLE *t = (GPT_CONSOLE *)malloc(sizeof(GPT_CONSOLE));
00347
00348     msg.type = GP_CONSOLE;
00349     msg.data = t;
00350
00351     t->isStderr = isStderr;
00352     t->len = len;
00353     t->str = (char *)malloc((len + 1) * sizeof(char));
00354     memcpy(t->str, str, len * sizeof(char));
00355     t->str[len] = '\0';
00356
00357     if (!wire_write_msg (fd, &msg))
00358         return FALSE;
00359     if (!wire_flush (fd))
00360         return FALSE;
00361     return TRUE;
00362 }

char* gp_getenv_read ( pipe_t fd )

Definition at line 322 of file cvsgui_process.cpp.

References _WireMessage::data, GPT_GETENV::empty, exit, GP_GETENV, pipe_t, GPT_GETENV::str, strdup, _WireMessage::type, wire_destroy, and wire_read_msg.

00323 {
00324     WireMessage msg;
00325     char *res;
00326
00327     memset (&msg, 0, sizeof (WireMessage));
00328     if (!wire_read_msg (fd, &msg) || msg.type != GP_GETENV)
00329     {
00330         fprintf(stderr, "cvsgui protocol error !\n");
00331         exit(-1);
00332     }
00333     GPT_GETENV *t = (GPT_GETENV *)msg.data;
00334     res = t->empty ? 0L : strdup(t->str);
00335     wire_destroy (&msg);
00336
00337     return res;
00338 }

int gp_getenv_write | ( | pipe_t | fd,
 |  | const char * | env
 | ) |

Definition at line 302 of file cvsgui_process.cpp.

References _WireMessage::data, GPT_GETENV::empty, FALSE, GP_GETENV, malloc, pipe_t, GPT_GETENV::str, strdup, TRUE, _WireMessage::type, wire_destroy, wire_flush, and wire_write_msg.

00303 {
00304     WireMessage msg;
00305     GPT_GETENV *t = (GPT_GETENV *)malloc(sizeof(GPT_GETENV));
00306
00307     msg.type = GP_GETENV;
00308     msg.data = t;
00309
00310     t->empty = env == 0L;
00311     t->str = strdup(env == 0L ? "" : env);
00312
00313     if (!wire_write_msg (fd, &msg))
00314         return FALSE;
00315     wire_destroy (&msg);
00316     if (!wire_flush (fd))
00317         return FALSE;
00318     return TRUE;
00319 }

void gp_init ( ) [static]

Definition at line 266 of file cvsgui_process.cpp.

References _gp_console_destroy, _gp_console_read, _gp_console_write, _gp_getenv_destroy, _gp_getenv_read, _gp_getenv_write, _gp_quit_destroy, _gp_quit_read, _gp_quit_write, GP_CONSOLE, GP_GETENV, GP_QUIT, and wire_register.

Referenced by cvs_process_init.

00267 {
00268     wire_register (GP_QUIT,
00269                    _gp_quit_read,
00270                    _gp_quit_write,
00271                    _gp_quit_destroy);
00272     wire_register (GP_GETENV,
00273                    _gp_getenv_read,
00274                    _gp_getenv_write,
00275                    _gp_getenv_destroy);
00276     wire_register (GP_CONSOLE,
00277                    _gp_console_read,
00278                    _gp_console_write,
00279                    _gp_console_destroy);
00280 }

int gp_quit_write | ( | pipe_t | fd,
 |  | int | code
 | ) |

Definition at line 283 of file cvsgui_process.cpp.

References GPT_QUIT::code, _WireMessage::data, FALSE, GP_QUIT, malloc, pipe_t, TRUE, _WireMessage::type, wire_flush, and wire_write_msg.

00284 {
00285     WireMessage msg;
00286     GPT_QUIT *t = (GPT_QUIT *)malloc(sizeof(GPT_QUIT));
00287
00288     msg.type = GP_QUIT;
00289     msg.data = t;
00290
00291     t->code = code;
00292
00293     if (!wire_write_msg (fd, &msg))
00294         return FALSE;
00295     if (!wire_flush (fd))
00296         return FALSE;
00297
00298     return TRUE;
00299 }

DWORD ServeProtocol ( CvsProcess * process ) [static]

Definition at line 588 of file cvsgui_process.cpp.

References cvs_process_is_active, cvs_process_recv_message, _CvsProcess::my_read, _CvsProcess::open, and _CvsProcess::starting.

Referenced by cvs_process_open.

00591 {
00592     while(process->starting)
00593     {
00594         Sleep(20);
00595         continue;
00596     }
00597
00598     DWORD avail;
00599     while(cvs_process_is_active(process) && process->open)
00600     {
00601         if(!PeekNamedPipe(process->my_read, 0L, 0 , 0L, &avail, 0L))
00602             break;
00603
00604         if(avail == 0)
00605         {
00606             Sleep(20);
00607             continue;
00608         }
00609
00610         cvs_process_recv_message(process);
00611     }
00612     return(1);
00613 }

DWORD WaitChld ( CvsProcess * process ) [static]

Definition at line 578 of file cvsgui_process.cpp.

References cvs_process_destroy, and _CvsProcess::pid.

Referenced by cvs_process_open.

00581 {
00582     WaitForSingleObject(process->pid, INFINITE);
00583     cvs_process_destroy(process);
00584     return(1);
00585 }

int write | ( | pipe_t | fd,
 |  | const void * | buf,
 |  | int | count
 | ) | [static]

Definition at line 108 of file cvsgui_process.cpp.

References pipe_t.

00109 {
00110     DWORD dwrite;
00111     if(!WriteFile(fd,buf,count,&dwrite,NULL))
00112     {
00113         errno = EINVAL;
00114         return -1;
00115     }
00116     return dwrite;
00117 }

Variable Documentation

CvsProcess* current_cvs_process = NULL [static]

Definition at line 76 of file cvsgui_process.cpp.

char* current_write_buffer = NULL [static]

Definition at line 78 of file cvsgui_process.cpp.

Referenced by cvs_process_flush, cvs_process_pop, cvs_process_push, and cvs_process_write.

int current_write_buffer_index = 0 [static]

Definition at line 77 of file cvsgui_process.cpp.

Referenced by cvs_process_flush, cvs_process_pop, cvs_process_push, and cvs_process_write.

std:: deque<CvsProcess *> cvs_process_stack [static]

Definition at line 74 of file cvsgui_process.cpp.

Referenced by cvs_process_pop, and cvs_process_push.

std:: vector<CvsProcess *> open_cvs_process [static]

Definition at line 75 of file cvsgui_process.cpp.

Referenced by cvs_process_close, cvs_process_give_time, cvs_process_is_active, and cvs_process_open.

char process_write_buffer[ 512 ] [static]

Definition at line 80 of file cvsgui_process.cpp.

Referenced by cvs_process_write.

class CDummyInit sDummyObject

Generated on Sun Feb 24 01:21:52 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


cvsgui_process.h File Reference

common/cvsgui_process.h File Reference

#include <sys/types.h>
#include "cvsgui_wire.h"

Include dependency graph for cvsgui_process.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

struct | _CvsProcess
struct | CvsProcessCallbacks

Defines

#define | WRITE_BUFFER_SIZE 512

Typedefs

typedef _CvsProcess | CvsProcess

Functions

CvsProcess * | cvs_process_open (char *name, int argc, char **argv, CvsProcessCallbacks *callbacks, int hasTty, const char *currentDirectory)
void | cvs_process_kill (CvsProcess *cvs_process)
void | cvs_process_init (void)
int | cvs_process_give_time (void)
int | cvs_process_is_active (CvsProcess *cvs_process)

Define Documentation

#define WRITE_BUFFER_SIZE 512

Definition at line 30 of file cvsgui_process.h.

Referenced by cvs_process_write.

Typedef Documentation

typedef struct _CvsProcess CvsProcess

Definition at line 32 of file cvsgui_process.h.

Function Documentation

int cvs_process_give_time ( void )

Definition at line 1290 of file cvsgui_process.cpp.

01291 {
01292 #ifndef WIN32
01293     fd_set rset;
01294     int ready;
01295     int maxfd = 0;
01296     int fd;
01297     struct timeval tv;
01298     int didone = 0;
01299
01300     FD_ZERO (&rset);
01301
01302     STD_STL vector<CvsProcess *>::iterator i;
01303
01304     for (i = open_cvs_process.begin(); i != open_cvs_process.end(); ++i)
01305     {
01306         fd = (*i)->my_read;
01307
01308         FD_SET (fd, &rset);
01309         if (fd > maxfd)
01310             maxfd = fd;
01311     }
01312
01313     tv.tv_sec = 0;
01314     tv.tv_usec = 100000;
01315     ready = select (maxfd + 1, &rset, 0L, 0L, &tv);
01316
01317     STD_STL vector<CvsProcess *> toFire;
01318     if (ready > 0)
01319     {
01320         for (i = open_cvs_process.begin(); i != open_cvs_process.end(); ++i)
01321         {
01322             fd = (*i)->my_read;
01323
01324             if (FD_ISSET (fd, &rset))
01325                 toFire.push_back(*i);
01326         }
01327     }
01328
01329     for (i = toFire.begin(); i != toFire.end(); ++i)
01330     {
01331         fd = (*i)->my_read;
01332
01333         if (FD_ISSET (fd, &rset))
01334         {
01335             cvs_process_recv_message (*i);
01336             didone = 1;
01337         }
01338     }
01339
01340     return didone;
01341 #else
01342     // we don't have to do yield since we use preemptive threads
01343     return 0;
01344 #endif
01345 }

void cvs_process_init ( void )

Definition at line 365 of file cvsgui_process.cpp.

00366 {
00367     /* initialize the gimp protocol library and set the read and
00368      *  write handlers.
00369      */
00370     gp_init ();
00371     wire_set_writer (cvs_process_write);
00372     wire_set_flusher (cvs_process_flush);
00373 }

int cvs_process_is_active ( CvsProcess * cvs_process )

Definition at line 1265 of file cvsgui_process.cpp.

Referenced by cvs_process_kill, cvs_process_recv_message, CWincvsApp::IdleCvsProgress, launchCVS, UCvsFrame::OnCmdStopcvs, UCvsApp::OnMainTimer, ServeProtocol, testCVS, and WaitForCvs.

01266 {
01267     int res;
01268
01269     {
01270         CStackThreadLock locker;
01271
01272         STD_STL vector<CvsProcess *>::iterator i =
01273             STD_STL find(open_cvs_process.begin(), open_cvs_process.end(), cvs_process);
01274         res = i != open_cvs_process.end() ? 1 : 0;
01275     }
01276
01277     return res;
01278 }

void cvs_process_kill ( CvsProcess * cvs_process )

Definition at line 1281 of file cvsgui_process.cpp.

Referenced by UCvsFrame::OnCmdStopcvs, CWincvsDoc::OnStopcvs, and testCVS.

01282 {
01283     if(cvs_process_is_active(cvs_process))
01284     {
01285         cvs_process_destroy(cvs_process);
01286     }
01287 }

CvsProcess* cvs_process_open | ( | char * | name,
 |  | int | argc,
 |  | char ** | argv,
 |  | CvsProcessCallbacks * | callbacks,
 |  | int | hasTty,
 |  | const char * | currentDirectory
 | ) |

Definition at line 889 of file cvsgui_process.cpp.

Referenced by launchCVS, and testCVS.

00890 {
00891     CvsProcess *cvs_process = cvs_process_new(name, argc, argv);
00892
00893     if (!cvs_process)
00894         return 0L;
00895
00896     cvs_process->callbacks = callbacks;
00897
00898 #ifndef WIN32
00899     int my_read[2];
00900     int my_write[2];
00901
00902     /* Open two pipes. (Bidirectional communication).
00903          */
00904     if ((pipe (my_read) == -1) || (pipe (my_write) == -1))
00905     {
00906         fprintf(stderr, "unable to open pipe\n");
00907         cvs_process_destroy (cvs_process);
00908         return 0L;
00909     }
00910
00911     cvs_process->my_read = my_read[0];
00912     cvs_process->my_write = my_write[1];
00913     cvs_process->his_read = my_write[0];
00914     cvs_process->his_write = my_read[1];
00915
00916     /* Remember the file descriptors for the pipes.
00917          */
00918     sprintf (cvs_process->args[2], "%d", cvs_process->his_read);
00919     sprintf (cvs_process->args[3], "%d", cvs_process->his_write);
00920
00921         /* Fork another process. We'll remember the process id
00922          *  so that we can later use it to kill the filter if
00923          *  necessary.
00924          */
00925     cvs_process->pid = fork ();
00926
00927     if (cvs_process->pid == 0)
00928     {
00929         close(cvs_process->my_read);
00930         close(cvs_process->my_write);
00931         /* Execute the filter. The "_exit" call should never
00932          *  be reached, unless some strange error condition
00933          *  exists.
00934          */
00935         execvp (cvs_process->args[0], cvs_process->args);
00936         _exit (1);
00937     }
00938     else if (cvs_process->pid == -1)
00939     {
00940         cvs_process_destroy (cvs_process);
00941         return 0L;
00942     }
00943
00944     close(cvs_process->his_read);  cvs_process->his_read  = -1;
00945     close(cvs_process->his_write); cvs_process->his_write = -1;
00946 #else
00947     SECURITY_ATTRIBUTES lsa;
00948     STARTUPINFO         si;
00949     PROCESS_INFORMATION pi;
00950
00951     HANDLE dupIn = 0L, dupOut = 0L;
00952     HANDLE stdChildIn = 0L, stdChildOut = 0L, stdChildErr = 0L;
00953     HANDLE stdoldIn = 0L, stdoldOut = 0L, stdoldErr = 0L;
00954     HANDLE stddupIn = 0L, stddupOut = 0L, stddupErr = 0L;
00955     char *command = 0L;
00956     BOOL resCreate;
00957     int cnt, i;
00958     LPTHREAD_START_ROUTINE threadsFunc[4];
00959
00960     lsa.nLength=sizeof(SECURITY_ATTRIBUTES);
00961     lsa.lpSecurityDescriptor=NULL;
00962     lsa.bInheritHandle=TRUE;
00963
00964     // create the pipes used for the cvsgui protocol
00965     if (!CreatePipe(&cvs_process->his_read,&dupIn,&lsa,0))
00966         goto error;
00967     if (!CreatePipe(&dupOut,&cvs_process->his_write,&lsa,0))
00968         goto error;
00969
00970     // duplicate the App side handles so they lose the inheritance
00971     if(!DuplicateHandle(GetCurrentProcess(), dupIn,
00972         GetCurrentProcess(), &cvs_process->my_write, 0, FALSE, DUPLICATE_SAME_ACCESS))
00973             goto error;
00974     CloseHandle(dupIn);
00975     dupIn = 0;
00976     if(!DuplicateHandle(GetCurrentProcess(), dupOut,
00977         GetCurrentProcess(), &cvs_process->my_read, 0, FALSE, DUPLICATE_SAME_ACCESS))
00978             goto error;
00979     CloseHandle(dupOut);
00980     dupOut = 0;
00981
00982     if(!hasTty)
00983     {
00984         // redirect stdout, stderr, stdin
00985         if (!CreatePipe(&stdChildIn,&stddupIn,&lsa,0))
00986             goto error;
00987         if (!CreatePipe(&stddupOut,&stdChildOut,&lsa,0))
00988             goto error;
00989         if (!CreatePipe(&stddupErr,&stdChildErr, &lsa,0))
00990             goto error;
00991
00992         // same thing as above
00993         if(!DuplicateHandle(GetCurrentProcess(), stddupIn,
00994             GetCurrentProcess(), &cvs_process->pstdin, 0, FALSE, DUPLICATE_SAME_ACCESS))
00995                 goto error;
00996         CloseHandle(stddupIn);
00997         stddupIn = 0;
00998         if(!DuplicateHandle(GetCurrentProcess(), stddupOut,
00999             GetCurrentProcess(), &cvs_process->pstdout, 0, FALSE, DUPLICATE_SAME_ACCESS))
01000                 goto error;
01001         CloseHandle(stddupOut);
01002         stddupOut = 0;
01003         if(!DuplicateHandle(GetCurrentProcess(), stddupErr,
01004             GetCurrentProcess(), &cvs_process->pstderr, 0, FALSE, DUPLICATE_SAME_ACCESS))
01005                 goto error;
01006         CloseHandle(stddupErr);
01007         stddupErr = 0;
01008     }
01009
01010     // Build the arguments for cvs
01011     sprintf (cvs_process->args[2], "%d", cvs_process->his_read);
01012     sprintf (cvs_process->args[3], "%d", cvs_process->his_write);
01013
01014     command = build_command(cvs_process->argc, cvs_process->args);
01015     if(command == 0L)
01016         goto error;
01017
01018     // Lets Redirect Console StdHandles and set the start options
01019     memset(&si,0,sizeof(STARTUPINFO));
01020     si.cb=sizeof(STARTUPINFO);
01021     si.dwFlags=hasTty ? 0 : STARTF_USESTDHANDLES;
01022     si.hStdInput =stdChildIn;
01023     si.hStdOutput=stdChildOut;
01024     si.hStdError =stdChildErr;
01025     if(!hasTty)
01026     {
01027         si.dwFlags|=STARTF_USESHOWWINDOW;
01028         si.wShowWindow = SW_SHOWMINNOACTIVE;
01029     }
01030
01031     if(!hasTty)
01032     {
01033         stdoldIn = GetStdHandle(STD_INPUT_HANDLE);
01034         stdoldOut = GetStdHandle(STD_OUTPUT_HANDLE);
01035         stdoldErr = GetStdHandle(STD_ERROR_HANDLE);
01036         SetStdHandle(STD_INPUT_HANDLE, stdChildIn);
01037         SetStdHandle(STD_OUTPUT_HANDLE, stdChildOut);
01038         SetStdHandle(STD_ERROR_HANDLE, stdChildErr);
01039     }
01040
01041     //Create Child Process
01042     resCreate = CreateProcess
01043          (
01044             NULL,
01045             command,
01046             NULL,
01047             NULL,
01048             TRUE,
01049             NORMAL_PRIORITY_CLASS,
01050             NULL,
01051             currentDirectory,
01052             &si,
01053             &pi);
01054
01055     if(!hasTty)
01056     {
01057         SetStdHandle(STD_INPUT_HANDLE, stdoldIn);
01058         SetStdHandle(STD_OUTPUT_HANDLE, stdoldOut);
01059         SetStdHandle(STD_ERROR_HANDLE, stdoldErr);
01060     }
01061
01062     if(!resCreate)
01063         goto error;
01064
01065     cvs_process->pid = pi.hProcess;
01066
01067     cnt = 0;
01068
01069     // now open-up threads which will serve the pipes
01070     threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)ServeProtocol;
01071     threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)WaitChld;
01072     if(!hasTty)
01073     {
01074         threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)GetChldOutput;
01075         threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)GetChldError;
01076     }
01077
01078     for(i = 0; i < cnt; i++)
01079     {
01080         if ((cvs_process->threads[i]=::CreateThread
01081                       (
01082                          (LPSECURITY_ATTRIBUTES)NULL,           // No security attributes.
01083                          (DWORD)0,                              // Use same stack size.
01084                          (LPTHREAD_START_ROUTINE)threadsFunc[i], // Thread procedure.
01085                          (LPVOID)cvs_process,                   // Parameter to pass.
01086                          (DWORD)0,                              // Run immediately.
01087                          (LPDWORD)&cvs_process->threadsID[i])
01088                       )==NULL)
01089         {
01090             TerminateProcess(cvs_process->pid,0);
01091             goto error;
01092         }
01093     }
01094
01095     //Close unneccesary Handles
01096     CloseHandle(cvs_process->his_read);
01097     cvs_process->his_read = 0;
01098     CloseHandle(cvs_process->his_write);
01099     cvs_process->his_write = 0;
01100
01101     if(!hasTty)
01102     {
01103         CloseHandle(stdChildIn);
01104         CloseHandle(stdChildOut);
01105         CloseHandle(stdChildErr);
01106     }
01107
01108     CloseHandle(pi.hThread);
01109
01110     free(command);
01111
01112     goto goodboy;
01113
01114 error:
01115     if(cvs_process->his_read != 0L)
01116         CloseHandle(cvs_process->his_read);
01117     if(cvs_process->his_write != 0L)
01118         CloseHandle(cvs_process->his_write);
01119     if(dupIn != 0L)
01120         CloseHandle(dupIn);
01121     if(dupOut != 0L)
01122         CloseHandle(dupOut);
01123     if(cvs_process->my_read != 0L)
01124         CloseHandle(cvs_process->my_read);
01125     if(cvs_process->my_write != 0L)
01126         CloseHandle(cvs_process->my_write);
01127     if(command != 0L)
01128         free(command);
01129     if(stdChildIn != 0L)
01130         CloseHandle(stdChildIn);
01131     if(stdChildOut != 0L)
01132         CloseHandle(stdChildOut);
01133     if(stdChildErr != 0L)
01134         CloseHandle(stdChildErr);
01135     if(stddupIn != 0L)
01136         CloseHandle(stddupIn);
01137     if(stddupOut != 0L)
01138         CloseHandle(stddupOut);
01139     if(stddupErr != 0L)
01140         CloseHandle(stddupErr);
01141     if(cvs_process->pstdin != 0L)
01142         CloseHandle(cvs_process->pstdin);
01143     if(cvs_process->pstdout != 0L)
01144         CloseHandle(cvs_process->pstdout);
01145     if(cvs_process->pstderr != 0L)
01146         CloseHandle(cvs_process->pstderr);
01147
01148     cvs_process_destroy (cvs_process);
01149     return 0L;
01150
01151 goodboy:
01152 #endif
01153
01154     {
01155         CStackThreadLock locker;
01156
01157         open_cvs_process.push_back(cvs_process);
01158     }
01159
01160     cvs_process->open = TRUE;
01161 #ifdef WIN32
01162     cvs_process->starting = FALSE;
01163 #endif
01164
01165     return cvs_process;
01166 }

Generated on Sun Feb 24 01:21:53 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


cvsgui_protocol.h File Reference

common/cvsgui_protocol.h File Reference

#include "cvsgui_wire.h"

Include dependency graph for cvsgui_protocol.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

struct | GPT_CONSOLE
struct | GPT_GETENV
struct | GPT_QUIT

Enumerations

enum {
GP_QUIT,
GP_GETENV,
GP_CONSOLE
}

Functions

int | gp_quit_write (pipe_t fd, int code)
int | gp_getenv_write (pipe_t fd, const char *env)
int | gp_console_write (pipe_t fd, const char *str, int len, int isStderr)
char * | gp_getenv_read (pipe_t fd)

Variables

pipe_t _cvsgui_readfd
pipe_t _cvsgui_writefd

Enumeration Type Documentation

anonymous enum

Enumeration values:
GP_QUIT
GP_GETENV
GP_CONSOLE

Definition at line 29 of file cvsgui_protocol.h.

00029      {
00030     GP_QUIT,
00031     GP_GETENV,
00032     GP_CONSOLE
00033 };

Function Documentation

int gp_console_write | ( | pipe_t | fd,
 |  | const char * | str,
 |  | int | len,
 |  | int | isStderr
 | ) |

Definition at line 343 of file cvsgui_process.cpp.

Referenced by myflush.

00344 {
00345     WireMessage msg;
00346     GPT_CONSOLE *t = (GPT_CONSOLE *)malloc(sizeof(GPT_CONSOLE));
00347
00348     msg.type = GP_CONSOLE;
00349     msg.data = t;
00350
00351     t->isStderr = isStderr;
00352     t->len = len;
00353     t->str = (char *)malloc((len + 1) * sizeof(char));
00354     memcpy(t->str, str, len * sizeof(char));
00355     t->str[len] = '\0';
00356
00357     if (!wire_write_msg (fd, &msg))
00358         return FALSE;
00359     if (!wire_flush (fd))
00360         return FALSE;
00361     return TRUE;
00362 }

char* gp_getenv_read ( pipe_t fd )

Definition at line 322 of file cvsgui_process.cpp.

Referenced by cvsguiglue_getenv.

00323 {
00324     WireMessage msg;
00325     char *res;
00326
00327     memset (&msg, 0, sizeof (WireMessage));
00328     if (!wire_read_msg (fd, &msg) || msg.type != GP_GETENV)
00329     {
00330         fprintf(stderr, "cvsgui protocol error !\n");
00331         exit(-1);
00332     }
00333     GPT_GETENV *t = (GPT_GETENV *)msg.data;
00334     res = t->empty ? 0L : strdup(t->str);
00335     wire_destroy (&msg);
00336
00337     return res;
00338 }

int gp_getenv_write | ( | pipe_t | fd,
 |  | const char * | env
 | ) |

Definition at line 302 of file cvsgui_process.cpp.

Referenced by cvs_process_handle_message, and cvsguiglue_getenv.

00303 {
00304     WireMessage msg;
00305     GPT_GETENV *t = (GPT_GETENV *)malloc(sizeof(GPT_GETENV));
00306
00307     msg.type = GP_GETENV;
00308     msg.data = t;
00309
00310     t->empty = env == 0L;
00311     t->str = strdup(env == 0L ? "" : env);
00312
00313     if (!wire_write_msg (fd, &msg))
00314         return FALSE;
00315     wire_destroy (&msg);
00316     if (!wire_flush (fd))
00317         return FALSE;
00318     return TRUE;
00319 }

int gp_quit_write | ( | pipe_t | fd,
 |  | int | code
 | ) |

Definition at line 283 of file cvsgui_process.cpp.

Referenced by cvsguiglue_exit, and main.

00284 {
00285     WireMessage msg;
00286     GPT_QUIT *t = (GPT_QUIT *)malloc(sizeof(GPT_QUIT));
00287
00288     msg.type = GP_QUIT;
00289     msg.data = t;
00290
00291     t->code = code;
00292
00293     if (!wire_write_msg (fd, &msg))
00294         return FALSE;
00295     if (!wire_flush (fd))
00296         return FALSE;
00297
00298     return TRUE;
00299 }

Variable Documentation

pipe_t _cvsgui_readfd

Definition at line 62 of file cvsgui_protocol.h.

pipe_t _cvsgui_writefd

Definition at line 63 of file cvsgui_protocol.h.

Generated on Sun Feb 24 01:21:53 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


cvsgui_wire.cpp File Reference

common/cvsgui_wire.cpp File Reference

#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "cvsgui_wire.h"
#include <map>

Include dependency graph for cvsgui_wire.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

struct | _WireHandler
struct | CAllHandlers

Defines

#define | STD_STL std::

Typedefs

typedef _WireHandler | WireHandler

Functions

int | read (pipe_t fd, void *buf, int count)
int | write (pipe_t fd, const void *buf, int count)
void | wire_register (guint32 type, WireReadFunc read_func, WireWriteFunc write_func, WireDestroyFunc destroy_func)
void | wire_set_reader (WireIOFunc read_func)
void | wire_set_writer (WireIOFunc write_func)
void | wire_set_flusher (WireFlushFunc flush_func)
int | wire_read (pipe_t fd, guint8 *buf, gulong count)
int | wire_write (pipe_t fd, guint8 *buf, gulong count)
int | wire_flush (pipe_t fd)
int | wire_error ()
void | wire_clear_error ()
int | wire_read_msg (pipe_t fd, WireMessage *msg)
int | wire_write_msg (pipe_t fd, WireMessage *msg)
void | wire_destroy (WireMessage *msg)
int | wire_read_int32 (pipe_t fd, guint32 *data, gint count)
int | wire_read_int16 (pipe_t fd, guint16 *data, gint count)
int | wire_read_int8 (pipe_t fd, guint8 *data, gint count)
int | wire_read_double (pipe_t fd, gdouble *data, gint count)
int | wire_read_string (pipe_t fd, gchar **data, gint count)
int | wire_write_int32 (pipe_t fd, guint32 *data, gint count)
int | wire_write_int16 (pipe_t fd, guint16 *data, gint count)
int | wire_write_int8 (pipe_t fd, guint8 *data, gint count)
int | wire_write_double (pipe_t fd, gdouble *data, gint count)
int | wire_write_string (pipe_t fd, gchar **data, gint count)

Variables

WireIOFunc | wire_read_func = NULL
WireIOFunc | wire_write_func = NULL
WireFlushFunc | wire_flush_func = NULL
int | wire_error_val = (0)
CAllHandlers sHandlers

Define Documentation

#define STD_STL std::

Definition at line 50 of file cvsgui_wire.cpp.

Referenced by wire_destroy, wire_read_msg, wire_register, wire_write_msg, and CAllHandlers::~CAllHandlers.

Typedef Documentation

typedef struct _WireHandler WireHandler

Definition at line 78 of file cvsgui_wire.cpp.

Function Documentation

int read | ( | pipe_t | fd,
 |  | void * | buf,
 |  | int | count
 | ) | [static]

Definition at line 54 of file cvsgui_wire.cpp.

References err, NULL, and pipe_t.

Referenced by wire_read.

00055 {
00056     DWORD dread;
00057     if(!ReadFile(fd,buf,count,&dread,NULL))
00058     {
00059         DWORD err = GetLastError();
00060         errno = EINVAL;
00061         return -1;
00062     }
00063     return dread;
00064 }

void wire_clear_error ( void )

Definition at line 250 of file cvsgui_wire.cpp.

References FALSE, and wire_error_val.

Referenced by cvs_process_close.

00251 {
00252     wire_error_val = FALSE;
00253 }

void wire_destroy ( WireMessage * msg )

Definition at line 301 of file cvsgui_wire.cpp.

References _WireHandler::destroy_func, sHandlers, STD_STL, _WireMessage::type, and CAllHandlers::wire_ht.

00302 {
00303     WireHandler *handler;
00304
00305     STD_STL map<guint32, WireHandler *>::iterator i = sHandlers.wire_ht.find(msg->type);
00306     if(i == sHandlers.wire_ht.end())
00307         return;
00308
00309     handler = (*i).second;
00310     (* handler->destroy_func) (msg);
00311 }

int wire_error ( void )

Definition at line 244 of file cvsgui_wire.cpp.

References wire_error_val.

00245 {
00246     return wire_error_val;
00247 }

int wire_flush ( pipe_t fd )

Definition at line 236 of file cvsgui_wire.cpp.

References FALSE, and pipe_t.

00237 {
00238     if (wire_flush_func)
00239         return (* wire_flush_func) (fd);
00240     return FALSE;
00241 }

int wire_read | ( | pipe_t | fd,
 |  | guint8 * | buf,
 |  | gulong | count
 | ) |

Definition at line 151 of file cvsgui_wire.cpp.

References FALSE, guint8, gulong, pipe_t, read, TRUE, and wire_error_val.

00154 {
00155     if (wire_read_func)
00156     {
00157         if (!(* wire_read_func) (fd, buf, count))
00158         {
00159             //g_print ("wire_read: error\n");
00160             wire_error_val = TRUE;
00161             return FALSE;
00162         }
00163     }
00164     else
00165     {
00166         int bytes;
00167
00168         while (count > 0)
00169         {
00170             do {
00171                 bytes = read (fd, (char*) buf, count);
00172             } while ((bytes == -1) && ((errno == EAGAIN) || (errno == EINTR)));
00173
00174             if (bytes == -1)
00175             {
00176                 //g_print ("wire_read: error\n");
00177                 wire_error_val = TRUE;
00178                 return FALSE;
00179             }
00180
00181             if (bytes == 0)
00182             {
00183                 //g_print ("wire_read: unexpected EOF (plug-in crashed?)\n");
00184                 wire_error_val = TRUE;
00185                 return FALSE;
00186             }
00187
00188             count -= bytes;
00189             buf += bytes;
00190         }
00191     }
00192
00193     return TRUE;
00194 }

int wire_read_double | ( | pipe_t | fd,
 |  | gdouble * | data,
 |  | gint | count
 | ) |

Definition at line 362 of file cvsgui_wire.cpp.

References FALSE, free, gdouble, gint, pipe_t, TRUE, and wire_read_string.

00365 {
00366     char *str;
00367     int i;
00368
00369     for (i = 0; i < count; i++)
00370     {
00371         if (!wire_read_string (fd, &str, 1))
00372             return FALSE;
00373         sscanf (str, "%le", &data[i]);
00374         free (str);
00375     }
00376
00377     return TRUE;
00378 }

int wire_read_int16 | ( | pipe_t | fd,
 |  | guint16 * | data,
 |  | gint | count
 | ) |

Definition at line 334 of file cvsgui_wire.cpp.

References FALSE, gint, guint16, guint8, pipe_t, TRUE, and wire_read_int8.

00337 {
00338     if (count > 0)
00339     {
00340         if (!wire_read_int8 (fd, (guint8*) data, count * 2))
00341             return FALSE;
00342
00343         while (count--)
00344         {
00345             *data = ntohs (*data);
00346             data++;
00347         }
00348     }
00349
00350     return TRUE;
00351 }

int wire_read_int32 | ( | pipe_t | fd,
 |  | guint32 * | data,
 |  | gint | count
 | ) |

Definition at line 314 of file cvsgui_wire.cpp.

References FALSE, gint, guint32, guint8, pipe_t, TRUE, and wire_read_int8.

00317 {
00318     if (count > 0)
00319     {
00320         if (!wire_read_int8 (fd, (guint8*) data, count * 4))
00321             return FALSE;
00322
00323         while (count--)
00324         {
00325             *data = ntohl (*data);
00326             data++;
00327         }
00328     }
00329
00330     return TRUE;
00331 }

int wire_read_int8 | ( | pipe_t | fd,
 |  | guint8 * | data,
 |  | gint | count
 | ) |

Definition at line 354 of file cvsgui_wire.cpp.

References gint, guint8, pipe_t, and wire_read.

00357 {
00358     return wire_read (fd, data, count);
00359 }

int wire_read_msg | ( | pipe_t | fd,
 |  | WireMessage * | msg
 | ) |

Definition at line 256 of file cvsgui_wire.cpp.

References FALSE, pipe_t, _WireHandler::read_func, sHandlers, STD_STL, _WireMessage::type, wire_error_val, CAllHandlers::wire_ht, and wire_read_int32.

00258 {
00259     WireHandler *handler;
00260
00261     if (wire_error_val)
00262         return !wire_error_val;
00263
00264     if (!wire_read_int32 (fd, &msg->type, 1))
00265         return FALSE;
00266
00267     STD_STL map<guint32, WireHandler *>::iterator i = sHandlers.wire_ht.find(msg->type);
00268     if(i == sHandlers.wire_ht.end())
00269         return FALSE;
00270
00271     handler = (*i).second;
00272     (* handler->read_func) (fd, msg);
00273
00274     return !wire_error_val;
00275 }

int wire_read_string | ( | pipe_t | fd,
 |  | gchar ** | data,
 |  | gint | count
 | ) |

Definition at line 381 of file cvsgui_wire.cpp.

References FALSE, free, gchar, gint, guint32, guint8, malloc, NULL, pipe_t, TRUE, wire_read_int32, and wire_read_int8.

00384 {
00385     guint32 tmp;
00386     int i;
00387
00388     for (i = 0; i < count; i++)
00389     {
00390         if (!wire_read_int32 (fd, &tmp, 1))
00391             return FALSE;
00392
00393         if (tmp > 0)
00394         {
00395             data[i] = (gchar *)malloc(tmp * sizeof(gchar));
00396             if (!wire_read_int8 (fd, (guint8*) data[i], tmp))
00397             {
00398                 free (data[i]);
00399                 return FALSE;
00400             }
00401         }
00402         else
00403         {
00404             data[i] = NULL;
00405         }
00406     }
00407
00408     return TRUE;
00409 }

void wire_register | ( | guint32 | type,
 |  | WireReadFunc | read_func,
 |  | WireWriteFunc | write_func,
 |  | WireDestroyFunc | destroy_func
 | ) |

Definition at line 111 of file cvsgui_wire.cpp.

References _WireHandler::destroy_func, guint32, malloc, _WireHandler::read_func, sHandlers, STD_STL, _WireHandler::type, CAllHandlers::wire_ht, WireDestroyFunc, WireReadFunc, WireWriteFunc, and _WireHandler::write_func.

00115 {
00116     WireHandler *handler;
00117
00118     STD_STL map<guint32, WireHandler *>::iterator i = sHandlers.wire_ht.find(type);
00119     if(i == sHandlers.wire_ht.end())
00120         handler = (WireHandler *)malloc(sizeof(WireHandler));
00121     else
00122         handler = (*i).second;
00123
00124     handler->type = type;
00125     handler->read_func = read_func;
00126     handler->write_func = write_func;
00127     handler->destroy_func = destroy_func;
00128
00129     sHandlers.wire_ht.insert(STD_STL map<guint32, WireHandler *>::value_type(type, handler));
00130 }

void wire_set_flusher ( WireFlushFunc flush_func )

Definition at line 145 of file cvsgui_wire.cpp.

References wire_flush_func, and WireFlushFunc.

00146 {
00147     wire_flush_func = flush_func;
00148 }

void wire_set_reader ( WireIOFunc read_func )

Definition at line 133 of file cvsgui_wire.cpp.

References wire_read_func, and WireIOFunc.

00134 {
00135     wire_read_func = read_func;
00136 }

void wire_set_writer ( WireIOFunc write_func )

Definition at line 139 of file cvsgui_wire.cpp.

References wire_write_func, and WireIOFunc.

00140 {
00141     wire_write_func = write_func;
00142 }

int wire_write | ( | pipe_t | fd,
 |  | guint8 * | buf,
 |  | gulong | count
 | ) |

Definition at line 197 of file cvsgui_wire.cpp.

References FALSE, guint8, gulong, pipe_t, TRUE, wire_error_val, and write.

00200 {
00201     if (wire_write_func)
00202     {
00203         if (!(* wire_write_func) (fd, buf, count))
00204         {
00205             //g_print ("wire_write: error\n");
00206             wire_error_val = TRUE;
00207             return FALSE;
00208         }
00209     }
00210     else
00211     {
00212         int bytes;
00213
00214         while (count > 0)
00215         {
00216             do {
00217                 bytes = write (fd, (char*) buf, count);
00218             } while ((bytes == -1) && ((errno == EAGAIN) || (errno == EINTR)));
00219
00220             if (bytes == -1)
00221             {
00222                 //g_print ("wire_write: error\n");
00223                 wire_error_val = TRUE;
00224                 return FALSE;
00225             }
00226
00227             count -= bytes;
00228             buf += bytes;
00229         }
00230     }
00231
00232     return TRUE;
00233 }

int wire_write_double | ( | pipe_t | fd,
 |  | gdouble * | data,
 |  | gint | count
 | ) |

Definition at line 462 of file cvsgui_wire.cpp.

References FALSE, gchar, gdouble, gint, pipe_t, TRUE, and wire_write_string.

00465 {
00466     gchar *t, buf[128];
00467     int i;
00468
00469     t = buf;
00470     for (i = 0; i < count; i++)
00471     {
00472         sprintf (buf, "%0.50e", data[i]);
00473         if (!wire_write_string (fd, &t, 1))
00474             return FALSE;
00475     }
00476
00477     return TRUE;
00478 }

int wire_write_int16 | ( | pipe_t | fd,
 |  | guint16 * | data,
 |  | gint | count
 | ) |

Definition at line 433 of file cvsgui_wire.cpp.

References FALSE, gint, guint16, guint8, pipe_t, TRUE, and wire_write_int8.

00436 {
00437     guint16 tmp;
00438     int i;
00439
00440     if (count > 0)
00441     {
00442         for (i = 0; i < count; i++)
00443         {
00444             tmp = htons (data[i]);
00445             if (!wire_write_int8 (fd, (guint8*) &tmp, 2))
00446                 return FALSE;
00447         }
00448     }
00449
00450     return TRUE;
00451 }

int wire_write_int32 | ( | pipe_t | fd,
 |  | guint32 * | data,
 |  | gint | count
 | ) |

Definition at line 412 of file cvsgui_wire.cpp.

References FALSE, gint, guint32, guint8, pipe_t, TRUE, and wire_write_int8.

00415 {
00416     guint32 tmp;
00417     int i;
00418
00419     if (count > 0)
00420     {
00421         for (i = 0; i < count; i++)
00422         {
00423             tmp = htonl (data[i]);
00424             if (!wire_write_int8 (fd, (guint8*) &tmp, 4))
00425                 return FALSE;
00426         }
00427     }
00428
00429     return TRUE;
00430 }

int wire_write_int8 | ( | pipe_t | fd,
 |  | guint8 * | data,
 |  | gint | count
 | ) |

Definition at line 454 of file cvsgui_wire.cpp.

References gint, guint8, pipe_t, and wire_write.

00457 {
00458     return wire_write (fd, data, count);
00459 }

int wire_write_msg | ( | pipe_t | fd,
 |  | WireMessage * | msg
 | ) |

Definition at line 278 of file cvsgui_wire.cpp.

References FALSE, pipe_t, sHandlers, STD_STL, _WireMessage::type, wire_error_val, CAllHandlers::wire_ht, wire_write_int32, and _WireHandler::write_func.

00280 {
00281     WireHandler *handler;
00282
00283     if (wire_error_val)
00284         return !wire_error_val;
00285
00286     STD_STL map<guint32, WireHandler *>::iterator i = sHandlers.wire_ht.find(msg->type);
00287     if(i == sHandlers.wire_ht.end())
00288         return FALSE;
00289
00290     handler = (*i).second;
00291
00292     if (!wire_write_int32 (fd, &msg->type, 1))
00293         return FALSE;
00294
00295     (* handler->write_func) (fd, msg);
00296
00297     return !wire_error_val;
00298 }

int wire_write_string | ( | pipe_t | fd,
 |  | gchar ** | data,
 |  | gint | count
 | ) |

Definition at line 481 of file cvsgui_wire.cpp.

References FALSE, gchar, gint, guint32, guint8, pipe_t, TRUE, wire_write_int32, and wire_write_int8.

00484 {
00485     guint32 tmp;
00486     int i;
00487
00488     for (i = 0; i < count; i++)
00489     {
00490         if (data[i])
00491             tmp = strlen (data[i]) + 1;
00492         else
00493             tmp = 0;
00494
00495         if (!wire_write_int32 (fd, &tmp, 1))
00496             return FALSE;
00497         if (tmp > 0)
00498             if (!wire_write_int8 (fd, (guint8*) data[i], tmp))
00499                 return FALSE;
00500     }
00501
00502     return TRUE;
00503 }

int write | ( | pipe_t | fd,
 |  | const void * | buf,
 |  | int | count
 | ) | [static]

Definition at line 66 of file cvsgui_wire.cpp.

References NULL, and pipe_t.

Referenced by cvs_process_flush, and wire_write.

00067 {
00068     DWORD dwrite;
00069     if(!WriteFile(fd,buf,count,&dwrite,NULL))
00070     {
00071         errno = EINVAL;
00072         return -1;
00073     }
00074     return dwrite;
00075 }

Variable Documentation

struct CAllHandlers sHandlers

Referenced by wire_destroy, wire_read_msg, wire_register, and wire_write_msg.

int wire_error_val = (0) [static]

Definition at line 91 of file cvsgui_wire.cpp.

Referenced by wire_clear_error, wire_error, wire_read, wire_read_msg, wire_write, and wire_write_msg.

WireFlushFunc wire_flush_func = NULL [static]

Definition at line 90 of file cvsgui_wire.cpp.

Referenced by wire_set_flusher.

WireIOFunc wire_read_func = NULL [static]

Definition at line 88 of file cvsgui_wire.cpp.

Referenced by wire_set_reader.

WireIOFunc wire_write_func = NULL [static]

Definition at line 89 of file cvsgui_wire.cpp.

Referenced by wire_set_writer.

Generated on Sun Feb 24 01:21:53 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


cvsgui_wire.h File Reference

common/cvsgui_wire.h File Reference

#include <Windows.h>

Include dependency graph for cvsgui_wire.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

struct | _WireMessage

Defines

#define | FALSE (0)
#define | TRUE (!FALSE)

Typedefs

typedef signed char | gint8
typedef unsigned char | guint8
typedef signed short | gint16
typedef unsigned short | guint16
typedef signed int | gint32
typedef unsigned int | guint32
typedef char | gchar
typedef short | gshort
typedef long | glong
typedef int | gint
typedef gint | gboolean
typedef unsigned char | guchar
typedef unsigned short | gushort
typedef unsigned long | gulong
typedef unsigned int | guint
typedef float | gfloat
typedef double | gdouble
typedef void * | gpointer
typedef const void * | gconstpointer
typedef HANDLE | pid_t
typedef HANDLE | pipe_t
typedef _WireMessage | WireMessage
typedef void(* | WireReadFunc )(pipe_t fd, WireMessage *msg)
typedef void(* | WireWriteFunc )(pipe_t fd, WireMessage *msg)
typedef void(* | WireDestroyFunc )(WireMessage *msg)
typedef int(* | WireIOFunc )(pipe_t fd, guint8 *buf, gulong count)
typedef int(* | WireFlushFunc )(pipe_t fd)

Functions

void | wire_register (guint32 type, WireReadFunc read_func, WireWriteFunc write_func, WireDestroyFunc destroy_func)
void | wire_set_reader (WireIOFunc read_func)
void | wire_set_writer (WireIOFunc write_func)
void | wire_set_flusher (WireFlushFunc flush_func)
int | wire_read (pipe_t fd, guint8 *buf, gulong count)
int | wire_write (pipe_t fd, guint8 *buf, gulong count)
int | wire_flush (pipe_t fd)
int | wire_error (void)
void | wire_clear_error (void)
int | wire_read_msg (pipe_t fd, WireMessage *msg)
int | wire_write_msg (pipe_t fd, WireMessage *msg)
void | wire_destroy (WireMessage *msg)
int | wire_read_int32 (pipe_t fd, guint32 *data, gint count)
int | wire_read_int16 (pipe_t fd, guint16 *data, gint count)
int | wire_read_int8 (pipe_t fd, guint8 *data, gint count)
int | wire_read_double (pipe_t fd, gdouble *data, gint count)
int | wire_read_string (pipe_t fd, gchar **data, gint count)
int | wire_write_int32 (pipe_t fd, guint32 *data, gint count)
int | wire_write_int16 (pipe_t fd, guint16 *data, gint count)
int | wire_write_int8 (pipe_t fd, guint8 *data, gint count)
int | wire_write_double (pipe_t fd, gdouble *data, gint count)
int | wire_write_string (pipe_t fd, gchar **data, gint count)

Define Documentation

#define FALSE (0)

Definition at line 61 of file cvsgui_wire.h.

Referenced by CCJReBar::_AddBar, _GetComCtlVersion, _statcore, CCJMenu::AddBitmapToImageList, CCJStatusBar::AddControl, CCJStatusBar::AddIndicator, CCJComboBoxEx::AddString, CCJTabView::AddView, CCJTabCtrlBar::AddView, CAdminOptionDlg::CAdminOptionDlg, CCJDockBar::CalcFixedLayout, CCJToolBar::CalcLayout, CCJSizeDockBar::CalcSizeBarLayout, CAnnotate_MAIN::CAnnotate_MAIN, CCheckout_MAIN::CCheckout_MAIN, CCheckout_OPTIONS::CCheckout_OPTIONS, CCJColorPicker::CCJColorPicker, CCJControlBar::CCJControlBar, CCJFlatButton::CCJFlatButton, CCJFlatComboBox::CCJFlatComboBox, CCJFlatHeaderCtrl::CCJFlatHeaderCtrl, CCJHexEdit::CCJHexEdit, CCJHyperLink::CCJHyperLink, CCJMenu::CCJMenu, CCJSizeDockBar::CCJSizeDockBar, CCJTreeCtrl::CCJTreeCtrl, CCommit_MAIN::CCommit_MAIN, CCommit_OPTIONS::CCommit_OPTIONS, CDiff_MAIN::CDiff_MAIN, CGfxGroupEdit::CGfxGroupEdit, CInit_MAIN::CInit_MAIN, CLogFilters::CLogFilters, CLogMain::CLogMain, CMainFrame::CMainFrame, CWinCvsBrowser::Create, CToolbarCombo::Create, CSplashWnd::Create, CExploreBar::Create, CCJTabCtrl::Create, CCJReBar::Create, CCJMiniDockFrameWnd::Create, CCJLogoPane::Create, CCJHtmlView::Create, CCJHexEdit::Create, CCJExplorerBar::Create, CCJMonthCalCtrl::Create, CCJColorPopup::Create, CCJCaptionPopupWnd::Create, CCJCaption::Create, CCJBrowseButton::Create, CBrowserBar::Create, CCJToolBar::CreateEx, CCJMenuBar::CreateEx, CCJFlatTabCtrl::CreateTabFont, CCJTabCtrlBar::CreateTabView, CReleaseDlg::CReleaseDlg, CRtag_MAIN::CRtag_MAIN, CRtag_OPTIONS::CRtag_OPTIONS, CTag_MAIN::CTag_MAIN, CUpdateMain::CUpdateMain, CUpdateMerge::CUpdateMerge, CUpdateSticky::CUpdateSticky, cvs_process_close, cvs_process_flush, cvs_process_handle_message, cvs_process_new, cvs_process_open, cvs_process_write, CWincvsApp::CWincvsApp, CCJFlatTabCtrl::DeleteItem, CCJTabCtrlBar::DeleteView, CHistComboBoxEx::DelKeyTest, CSmartComboBox::DelKeyTest, CCJComboBoxEx::Dir, CCustomizeMenus::DoDataExchange, CBrowseFileView::DoDrag, CCJColorPopup::DrawCell, CCJMenu::DrawItem, DrawNode, CCJDockContext::EndDragDockBar, FileTimeToUnixTime, CCJTreeCtrl::FindItem, FindNextWindow, CCJComboBoxEx::FindString, CCJSizeDockBar::FlatBorder, GetAsSystemTime, CCJColorPopup::GetCellRect, CCJTabCtrlBar::GetImageIndexFromRuntimeClass, CCJTreeCtrl::GetItemFont, CCJFlatTabCtrl::GetItemRect, CCJMenu::GetMenuText, GetNextParentWindow, CTipDlg::GetNextTipString, CCJHtmlView::GetProperty, CCJStatusBar::GetStatusPane, CCJTabView::GetView, CCJHyperLink::GotoURL, gp_console_write, gp_getenv_write, gp_quit_write, CWincvsApp::InitATL, CMainFrame::InitializeDockingWindows, CCJMDIFrameWnd::InitializeMenu, CWincvsApp::InitInstance, CLogoutThread::InitInstance, CCJToolBar::InsertControl, CCJComboBoxEx::InsertItem, CCJComboBoxEx::InsertString, CCJSizeDockBar::IsLastControlBar, IsValidHandle, CCJCaption::KillChildWindow, LaunchEditor, CCJToolBar::Layout, CCJToolBar::LoadBitmap, CCJHtmlView::LoadFromResource, CCJMenu::LoadFromToolBar, CCJMenu::LoadMenu, CCJMenu::LoadSysColorBitmap, CCJToolBar::LoadToolBar, CCJMenu::LoadToolbar, CCJMenu::LoadToolbars, CCJWindowPlacement::LoadWindowPos, CCJControlBar::Minimize, CCJHexEdit::Move, CCJControlBar::Normalize, CMainFrame::OnActivate, CGraphOptDlg::OnApply, CCJHtmlView::OnBeforeNavigate2, CMainFrame::OnBroadcastCmdMsg, CCJExplorerBar::OnButtonClose, CCJControlBar::OnButtonClose, CCJControlBar::OnButtonMinimize, CCJMaskEdit::OnChar, CGraphView::OnContextMenu, CDiff_MAIN::OnDiff1, CCJHtmlView::OnDraw, CCJFlatSplitterWnd::OnDrawSplitter, CTipDlg::OnInitDialog, CProgressDialog::OnInitDialog, CTag_MAIN::OnInitDialog, CRtag_OPTIONS::OnInitDialog, CRtag_MAIN::OnInitDialog, CCommit_MAIN::OnInitDialog, CAdminOptionDlg::OnInitDialog, CMainFrame::OnInitMenu, CGraphView::OnInitMenuPopup, CCustomizeMenus::OnItemchangedMenulist, CCJFlatComboBox::OnKillFocus, CGfxOutBarCtrl::OnLButtonDown, CCJSizeDockBar::OnLButtonUp, CCJFlatComboBox::OnLButtonUp, CCJFlatButton::OnLButtonUp, CCJControlBar::OnLButtonUp, CCJMenuBar::OnMenuInput, CUpdateMerge::OnMerge, CCJHyperLink::OnMouseMove, CCJToolBar::OnNcCreate, CCJReBar::OnNcCreate, CWincvsDoc::OnNewDocument, CGraphDoc::OnNewDocument, CCJHtmlView::OnNewWindow2, CTipDlg::OnNextTip, CCJPagerCtrl::OnPagerCalcSize, CCJPagerCtrl::OnPagerScroll, CCJHexEdit::OnPaint, CCJToolBar::OnPreserveZeroBorderHelper, CCJCaption::OnPushPinCancel, CCJColorPicker::OnSelEndCancel, CCJColorPicker::OnSelEndOK, CCJSizeDockBar::OnSetCursor, CCJHyperLink::OnSetCursor, CCJControlBar::OnSetCursor, CCJToolBar::OnSetSizeHelper, CCJHtmlView::OnSize, CCvsStatusBar::OnTimer, CCJFlatComboBox::OnTimer, CCJFlatButton::OnTimer, CCJToolBar::OnToolBarGetButtonInfo, CWinCvsBrowser::OnUpdateCmd, CExploreBar::OnUpdateCmd, CCJControlBar::OnUpdateCmdUI, CWincvsDoc::OnUpdateCvsCmd, CGraphView::OnUpdateGraphChangelogmessage, CGraphView::OnUpdateGraphSetdescription, CGraphView::OnUpdateGraphSetstate, CWinCvsBrowser::OnUpdateMacro, CBrowseFileView::OnUpdateMacro, CWincvsDoc::OnUpdateMacroAdmin, CWincvsDoc::OnUpdatePrefs, CGraphView::OnUpdateQueryAnnotate, CBrowseFileView::OnUpdateQueryAnnotate, CWincvsDoc::OnUpdateStopcvs, CWinCvsBrowser::OnUpdateViewAdd, CBrowseFileView::OnUpdateViewAdd, CBrowseFileView::OnUpdateViewAddB, CWinCvsBrowser::OnUpdateViewCheckout, CBrowseFileView::OnUpdateViewCheckout, CGraphView::OnUpdateViewDelrev, CGraphView::OnUpdateViewDiff, CBrowseFileView::OnUpdateViewEditseldef, CWinCvsBrowser::OnUpdateViewExplore, CBrowseFileView::OnUpdateViewExplore, CBrowseFileView::OnUpdateViewGraph, CWinCvsBrowser::OnUpdateViewImport, CBrowseFileView::OnUpdateViewImport, CBrowseFileView::OnUpdateViewRelease, CGraphView::OnUpdateViewReload, CGraphView::OnUpdateViewRetrieve, CBrowseFileView::OnUpdateViewRmv, CGraphView::OnUpdateViewSelnonsig, CGraphView::OnUpdateViewTag, CGraphView::OnUpdateViewUnlockf, CGraphView::OnUpdateViewUpdate, CBrowseFileView::OnUpdateViewUpdate, CCJTabCtrlBar::OverkillAssert, CCJTreeCtrl::PreCreateWindow, CCJToolBar::PreCreateWindow, CCJHexEdit::PreCreateWindow, CCJFlatTabCtrl::PreCreateWindow, CSplashWnd::PreTranslateAppMessage, CTbEdit::PreTranslateMessage, CWincvsView::QueryAcceptData, CGfxSplitterWnd::RecalcLayout, UDC::Rectangle, CCJStatusBar::RemovePane, CCJFlatSplitterWnd::ReplaceView, CBrowseFileView::ResetView, UDC::RoundRect, KoWatcher::Run, CCJTreeCtrl::SelectItems, CCJTabView::SetActiveView, CCJTabCtrlBar::SetActiveView, CCJToolBar::SetButtons, CCJToolBar::SetButtonText, CCJMonthCalCtrl::SetCurSel, CCJMonthCalCtrl::SetDayState, CCJComboBoxEx::SetEditSel, CCJComboBoxEx::SetItem, CCJMonthCalCtrl::SetSelRange, CCJDateTimeCtrl::SetTime, CCJMenuBar::SetTrackingState, CCJMonthCalCtrl::SizeMinReq, CCJDockContext::StartResize, CCJFlatSplitterWnd::SwitchView, CCommit_MAIN::SwitchWrapEdit, TestBuffer, TmFromOleDate, CCJDockContext::TrackDockBar, CCJMenuBar::TrackPopup, CCJMenuBar::TranslateFrameMessage, UMenuAddSeparator, CCJMenu::UnSetBitmapBackground, CCJMenu::UnSetDisableOldStyle, updateUIMenu, wire_clear_error, wire_flush, wire_read, wire_read_double, wire_read_int16, wire_read_int32, wire_read_msg, wire_read_string, wire_write, wire_write_double, wire_write_int16, wire_write_int32, wire_write_msg, wire_write_string, and CCJToolBar::WrapToolBar.

#define TRUE (!FALSE)

Definition at line 65 of file cvsgui_wire.h.

Referenced by _LoadSysColorBitmap, _statcore, CCJMenu::AddBitmapToImageList, CCJStatusBar::AddControl, CCJToolBar::AddDropDownButton, CCJStatusBar::AddIndicator, CCJTabView::AddView, CCJTabCtrlBar::AddView, CCJMenu::AppendODPopupMenuW, CCJDockBar::CalcFixedLayout, CCJSizeDockBar::CalcSizeBarLayout, CCJControlBar::CCJControlBar, CCJFlatButton::CCJFlatButton, CCJFlatSplitterWnd::CCJFlatSplitterWnd, CCJHexEdit::CCJHexEdit, CCJHyperLink::CCJHyperLink, CCJMenuBar::CCJMenuBar, CCJSizeDockBar::CCJSizeDockBar, CCJStatusBarPaneControlInfo::CCJStatusBarPaneControlInfo, CCJTabCtrlBar::CCJTabCtrlBar, CCJToolBar::CCJToolBar, CNoPython::CNoPython, CompatGetAnnotate, CompatGetCheckout, CompatGetCommand, CompatGetDiff, CompatGetImport, CompatGetInit, CompatGetLog, CompatGetRelease, CompatGetUpdate, CompatRtagBranch, CompatRtagCreate, CompatRtagDelete, CompatTagBranch, CompatTagCreate, CompatTagDelete, CWinCvsBrowser::Create, CToolbarCombo::Create, CCJTabCtrl::Create, CCJReBar::Create, CCJMiniDockFrameWnd::Create, CCJLogoPane::Create, CCJHtmlView::Create, CCJHexEdit::Create, CCJExplorerBar::Create, CCJMonthCalCtrl::Create, CCJColorPopup::Create, CCJCaptionPopupWnd::Create, CCJCaption::Create, CCJBrowseButton::Create, CBrowserBar::Create, CCJToolBar::CreateEx, CCJMenuBar::CreateEx, CCJTabCtrlBar::CreateTabView, CSortHeaderCtrl::CSortHeaderCtrl, CTipDlg::CTipDlg, cvs_process_close, cvs_process_destroy, cvs_process_flush, cvs_process_new, cvs_process_open, cvs_process_recv_message, cvs_process_write, CCJFlatTabCtrl::DeleteAllItems, CCJFlatTabCtrl::DeleteItem, CHistComboBoxEx::DelKeyTest, CSmartComboBox::DelKeyTest, CCJMDIFrameWnd::DockControlBarLeftOf, CCJMDIChildWnd::DockControlBarLeftOf, CCJFrameWnd::DockControlBarLeftOf, UWidget::DoModal, CPseudoRotButton::DoRotate, CCJMenu::Draw3DCheckmark, CCJCaptionButton::DrawButtonText, CCJMenu::DrawItem, CCJColorPicker::DrawItem, CCJToolCmdUI::Enable, UWidget::EndModal, CCJFontCombo::EnumFontProc, CCJTreeCtrl::FindItem, flushDisplay, FormatMenuString, GetAsSystemTime, CCJSizeDockBar::GetAvailableRect, CCJColorPopup::GetCellRect, CCJTreeCtrl::GetItemFont, CCJFlatTabCtrl::GetItemRect, CCJMenu::GetMenuText, GetNextParentWindow, CTipDlg::GetNextTipString, CCJHtmlView::GetProperty, CCJStatusBar::GetStatusPane, CCJDateTimeCtrl::GetTime, gp_console_write, gp_getenv_write, gp_quit_write, CSubclassWnd::HookWindow, CWincvsApp::InitATL, CMainFrame::InitializeDockingWindows, CCJMDIFrameWnd::InitializeMenu, CCJFrameWnd::InitializeMenu, CWincvsApp::InitInstance, CCJSizeDockBar::IsDockSizeBar, CCJTreeCtrl::IsFindValid, CCJSizeDockBar::IsLastControlBar, CCJToolBar::LoadBitmap, CCJHtmlView::LoadFromResource, CCJMenu::LoadFromToolBar, CCJMenuBar::LoadMenu, CCJMenu::LoadMenu, CCJMenu::LoadToolbar, CCJMenu::LoadToolbars, CCJWindowPlacement::LoadWindowPos, LogInitialize, CCJSizeDockBar::Maximize, CCJControlBar::Maximize, CCJMenuBar::MenuInputFilter, CCJHexEdit::Move, CCJSizeDockBar::Normalize, CCustomizeMenus::OnAdd, CCJToolBar::OnBarStyleChange, CMainFrame::OnBroadcastCmdMsg, CCJControlBar::OnButtonMinimize, CCJCaption::OnCaptButton, CGfxGroupEdit::OnChar, CCJColorPicker::OnClicked, CLogFrame::OnCmdMsg, CGraphFrame::OnCmdMsg, CGfxGroupEdit::OnCreate, CCJFlatTabCtrl::OnCreate, CCJControlBar::OnCreate, CWinCvsBrowser::OnCustomize, CBrowseFileView::OnCustomize, CDiff_MAIN::OnDiff1, CWincvsView::OnEditClearAll, CCJTreeCtrl::OnEraseBkgnd, CCJTabCtrl::OnEraseBkgnd, CCJOutlookBar::OnEraseBkgnd, CCJMetaFileButton::OnEraseBkgnd, CCJMaskEdit::OnEraseBkgnd, CCJListCtrl::OnEraseBkgnd, CCJListBox::OnEraseBkgnd, CCJHexEdit::OnEraseBkgnd, CCJFontCombo::OnEraseBkgnd, CCJFlatHeaderCtrl::OnEraseBkgnd, CCJFlatComboBox::OnEraseBkgnd, CCJFlatButton::OnEraseBkgnd, CCJControlBar::OnEraseBkgnd, CCJColorPopup::OnEraseBkgnd, CCJColorPicker::OnEraseBkgnd, CCJCaption::OnEraseBkgnd, CCommit_MAIN::OnEraseBkgnd, CAboutDlg::OnInitDialog, CTipDlg::OnInitDialog, CProgressDialog::OnInitDialog, CNoPython::OnInitDialog, CCustomizeMenus::OnInitDialog, CPseudoDlg::OnInitDialog, CTag_MAIN::OnInitDialog, CRtag_OPTIONS::OnInitDialog, CRtag_MAIN::OnInitDialog, COptionalPropertySheet::OnInitDialog, CCmdLine_MAIN::OnInitDialog, CImportFilterDlg::OnInitDialog, CGetPrefs_GLOBALS::OnInitDialog, GetPassword::OnInitDialog, CEditorMonDlg::OnInitDialog, CCommit_MAIN::OnInitDialog, CAdminOptionDlg::OnInitDialog, CBrowseFileView::OnInitialUpdate, CMainFrame::OnInitMenu, CGraphView::OnInitMenuPopup, CCustomizeMenus::OnItemchangedMenulist, CWinCvsBrowser::OnItemexpanding, CCJHexEdit::OnKeyDown, CCJFlatComboBox::OnLButtonDown, CCJFlatButton::OnLButtonDown, CCJControlBar::OnLButtonDown, CCJMenuBar::OnMenuInput, CCJMenuBar::OnMenuSelect, CUpdateMerge::OnMerge, CCJHyperLink::OnMouseMove, CCustomizeMenus::OnMove, CCJToolBar::OnNcCreate, CCJReBar::OnNcCreate, CCJSizeDockBar::OnNcLButtonDown, CWincvsDoc::OnNewDocument, CGraphDoc::OnNewDocument, CCJListView::OnNotify, CCJListCtrl::OnNotify, CCJTreeCtrl::OnPaint, CCJHexEdit::OnPaint, CGraphView::OnPreparePrinting, CBrowseFileView::OnPreparePrinting, CCustomizeMenus::OnRemove, CCJColorPicker::OnSelChange, CWinCvsBrowser::OnSelchanging, CCJColorPicker::OnSelEndCancel, CCJColorPicker::OnSelEndOK, CWinCvsBrowser::OnSetCursor, CCJHyperLink::OnSetCursor, CCJFlatButton::OnSetCursor, CBrowseFileView::OnSetCursor, CCJFlatComboBox::OnSetFocus, UWidget::OnSetLoc, UWidget::OnSetSliderProperty, CCJFlatComboBox::OnTimer, CCJFlatButton::OnTimer, CCJToolBar::OnToolBarGetButtonInfo, CCJExplorerBar::OnUpdateButtonClose, CExploreBar::OnUpdateCmd, CCJControlBar::OnUpdateCmdUI, CWinCvsBrowser::OnUpdateCustomize, CBrowseFileView::OnUpdateCustomize, CWincvsDoc::OnUpdateCvsCmd, CWincvsDoc::OnUpdateMacroAdmin, CCJMenuBar::OnUpdateMenuButton, CWincvsDoc::OnUpdatePrefs, CBrowseFileView::OnUpdateQueryAnnotate, CWincvsDoc::OnUpdateStopcvs, CBrowseFileView::OnUpdateViewAdd, CBrowseFileView::OnUpdateViewAddB, CWinCvsBrowser::OnUpdateViewCheckout, CBrowseFileView::OnUpdateViewCheckout, CBrowseFileView::OnUpdateViewEditseldef, CWinCvsBrowser::OnUpdateViewExplore, CBrowseFileView::OnUpdateViewExplore, CBrowseFileView::OnUpdateViewGraph, CWinCvsBrowser::OnUpdateViewImport, CBrowseFileView::OnUpdateViewImport, CBrowseFileView::OnUpdateViewRelease, CGraphView::OnUpdateViewReload, CBrowseFileView::OnUpdateViewRmv, CGraphView::OnUpdateViewSelnonsig, CWinCvsBrowser::OnUpdateViewUpdate, CGraphView::OnUpdateViewUpdate, CBrowseFileView::OnUpdateViewUpdate, CCJHexEdit::OnVScroll, CProgressDialog::PostNcDestroy, CCJTreeCtrl::PreCreateWindow, CCJToolBar::PreCreateWindow, CCJHexEdit::PreCreateWindow, CCJFlatTabCtrl::PreCreateWindow, CSplashWnd::PreTranslateAppMessage, CWincvsApp::PreTranslateMessage, CTbEdit::PreTranslateMessage, CHistComboBoxEx::PreTranslateMessage, CGfxGroupEdit::PreTranslateMessage, CCJTabCtrlBar::PreTranslateMessage, CCJFrameWnd::PreTranslateMessage, CCJFlatComboBox::PreTranslateMessage, CSmartComboBox::PreTranslateMessage, UToolbar::RebuildBar, CGfxSplitterWnd::RecalcLayout, UDC::Rectangle, CCJTabCtrlBar::RemoveAllTabs, CCJStatusBar::RemovePane, CCJFlatSplitterWnd::ReplaceView, UDC::RoundRect, CWincvsApp::SaveAllModified, CCJHexEdit::SelDelete, CCJTreeCtrl::SelectItems, CCJHexEdit::SelInsert, CCJTabView::SetActiveView, CCJTabCtrlBar::SetActiveView, CCJFlatButton::SetAlternateColors, CCJMenu::SetBitmapBackground, CCJHexEdit::SetBPR, CCJToolBar::SetButtonInfo, CCJToolBar::SetButtons, CCJToolBar::SetButtonStyle, CCJCaptionButton::SetButtonStyle, CCJToolBar::SetButtonText, CCJHexEdit::SetData, CCJMenu::SetDisableOldStyle, CCJBrowseEdit::SetDlgOpenFile, CCJHexEdit::SetOptions, CPseudoToggle::SetState, CCJMenuBar::SetTrackingState, CCJColorPicker::SetTrackSelection, CCJColorPopup::SetWindowSize, CCJColorPicker::SetWindowSize, CCJMonthCalCtrl::SizeMinReq, CCJDockContext::StartDragDockBar, CCJFlatSplitterWnd::SwitchView, CCommit_MAIN::SwitchWrapEdit, TmFromOleDate, CCJDockContext::TrackDockBar, CCJMenuBar::TrackPopup, CCJMenuBar::TranslateFrameMessage, CCJHexEdit::UpdateScrollbars, updateUIMenu, wire_read, wire_read_double, wire_read_int16, wire_read_int32, wire_read_string, wire_write, wire_write_double, wire_write_int16, wire_write_int32, wire_write_string, CCJToolBar::WrapToolBar, and CWndRedrawMngr::~CWndRedrawMngr.

Typedef Documentation

typedef gint gboolean

Definition at line 47 of file cvsgui_wire.h.

typedef char gchar

Definition at line 43 of file cvsgui_wire.h.

Referenced by UWidget::OnGetState, UWidget::OnGetText, UWidget::OnListGetInfo, UWidget::OnListNewRow, wire_read_string, wire_register, wire_set_writer, wire_write_double, and wire_write_string.

typedef const void* gconstpointer

Definition at line 58 of file cvsgui_wire.h.

typedef double gdouble

Definition at line 55 of file cvsgui_wire.h.

Referenced by wire_read_double, wire_register, wire_set_writer, and wire_write_double.

typedef float gfloat

Definition at line 54 of file cvsgui_wire.h.

typedef int gint

Definition at line 46 of file cvsgui_wire.h.

Referenced by UWidget::OnListGetNextSel, wire_read_double, wire_read_int16, wire_read_int32, wire_read_int8, wire_read_string, wire_register, wire_set_flusher, wire_set_reader, wire_set_writer, wire_write_double, wire_write_int16, wire_write_int32, wire_write_int8, and wire_write_string.

typedef signed short gint16

Definition at line 38 of file cvsgui_wire.h.

typedef signed int gint32

Definition at line 40 of file cvsgui_wire.h.

typedef signed char gint8

Definition at line 36 of file cvsgui_wire.h.

typedef long glong

Definition at line 45 of file cvsgui_wire.h.

typedef void* gpointer

Definition at line 57 of file cvsgui_wire.h.

Referenced by UWidget::OnComboAppend, UCvsConsole::OnCreate, UWidget::OnInitTabWidget, UWidget::OnInitWidget, and UWidget::OnTreeInsert.

typedef short gshort

Definition at line 44 of file cvsgui_wire.h.

typedef unsigned char guchar

Definition at line 49 of file cvsgui_wire.h.

typedef unsigned int guint

Definition at line 52 of file cvsgui_wire.h.

typedef unsigned short guint16

Definition at line 39 of file cvsgui_wire.h.

Referenced by wire_read_int16, wire_register, wire_set_reader, and wire_write_int16.

typedef unsigned int guint32

Definition at line 41 of file cvsgui_wire.h.

Referenced by _gp_quit_read, _gp_quit_write, wire_read_int32, wire_read_string, wire_register, wire_write_int32, and wire_write_string.

typedef unsigned char guint8

Definition at line 37 of file cvsgui_wire.h.

Referenced by cvs_process_write, wire_read, wire_read_int16, wire_read_int32, wire_read_int8, wire_read_string, wire_register, wire_set_reader, wire_write, wire_write_int16, wire_write_int32, wire_write_int8, and wire_write_string.

typedef unsigned long gulong

Definition at line 51 of file cvsgui_wire.h.

Referenced by cvs_process_write, wire_read, and wire_write.

typedef unsigned short gushort

Definition at line 50 of file cvsgui_wire.h.

typedef HANDLE pid_t

Definition at line 73 of file cvsgui_wire.h.

typedef HANDLE pipe_t

Definition at line 74 of file cvsgui_wire.h.

Referenced by _gp_console_read, _gp_console_write, _gp_getenv_read, _gp_getenv_write, _gp_quit_read, _gp_quit_write, cvs_process_flush, cvs_process_write, gp_console_write, gp_getenv_read, gp_getenv_write, gp_quit_write, read, wire_flush, wire_read, wire_read_double, wire_read_int16, wire_read_int32, wire_read_int8, wire_read_msg, wire_read_string, wire_register, wire_set_reader, wire_set_writer, wire_write, wire_write_double, wire_write_int16, wire_write_int32, wire_write_int8, wire_write_msg, wire_write_string, and write.

typedef void(* WireDestroyFunc)(WireMessage *msg)

Definition at line 83 of file cvsgui_wire.h.

Referenced by wire_register.

typedef int(* WireFlushFunc)(pipe_t fd)

Definition at line 85 of file cvsgui_wire.h.

Referenced by wire_set_flusher.

typedef int(* WireIOFunc)(pipe_t fd, guint8 *buf, gulong count)

Definition at line 84 of file cvsgui_wire.h.

Referenced by wire_set_reader, and wire_set_writer.

typedef struct _WireMessage WireMessage

Definition at line 79 of file cvsgui_wire.h.

typedef void(* WireReadFunc)(pipe_t fd, WireMessage *msg)

Definition at line 81 of file cvsgui_wire.h.

Referenced by wire_register.

typedef void(* WireWriteFunc)(pipe_t fd, WireMessage *msg)

Definition at line 82 of file cvsgui_wire.h.

Referenced by wire_register.

Function Documentation

void wire_clear_error ( void )

Definition at line 250 of file cvsgui_wire.cpp.

00251 {
00252     wire_error_val = FALSE;
00253 }

void wire_destroy ( WireMessage * msg )

Definition at line 301 of file cvsgui_wire.cpp.

Referenced by cvs_process_recv_message, gp_getenv_read, and gp_getenv_write.

00302 {
00303     WireHandler *handler;
00304
00305     STD_STL map<guint32, WireHandler *>::iterator i = sHandlers.wire_ht.find(msg->type);
00306     if(i == sHandlers.wire_ht.end())
00307         return;
00308
00309     handler = (*i).second;
00310     (* handler->destroy_func) (msg);
00311 }

int wire_error ( void )

Definition at line 244 of file cvsgui_wire.cpp.

00245 {
00246     return wire_error_val;
00247 }

int wire_flush ( pipe_t fd )

Definition at line 236 of file cvsgui_wire.cpp.

Referenced by cvs_process_write, gp_console_write, gp_getenv_write, and gp_quit_write.

00237 {
00238     if (wire_flush_func)
00239         return (* wire_flush_func) (fd);
00240     return FALSE;
00241 }

int wire_read | ( | pipe_t | fd,
 |  | guint8 * | buf,
 |  | gulong | count
 | ) |

Definition at line 151 of file cvsgui_wire.cpp.

Referenced by wire_read_int8.

00154 {
00155     if (wire_read_func)
00156     {
00157         if (!(* wire_read_func) (fd, buf, count))
00158         {
00159             //g_print ("wire_read: error\n");
00160             wire_error_val = TRUE;
00161             return FALSE;
00162         }
00163     }
00164     else
00165     {
00166         int bytes;
00167
00168         while (count > 0)
00169         {
00170             do {
00171                 bytes = read (fd, (char*) buf, count);
00172             } while ((bytes == -1) && ((errno == EAGAIN) || (errno == EINTR)));
00173
00174             if (bytes == -1)
00175             {
00176                 //g_print ("wire_read: error\n");
00177                 wire_error_val = TRUE;
00178                 return FALSE;
00179             }
00180
00181             if (bytes == 0)
00182             {
00183                 //g_print ("wire_read: unexpected EOF (plug-in crashed?)\n");
00184                 wire_error_val = TRUE;
00185                 return FALSE;
00186             }
00187
00188             count -= bytes;
00189             buf += bytes;
00190         }
00191     }
00192
00193     return TRUE;
00194 }

int wire_read_double | ( | pipe_t | fd,
 |  | gdouble * | data,
 |  | gint | count
 | ) |

Definition at line 362 of file cvsgui_wire.cpp.

00365 {
00366     char *str;
00367     int i;
00368
00369     for (i = 0; i < count; i++)
00370     {
00371         if (!wire_read_string (fd, &str, 1))
00372             return FALSE;
00373         sscanf (str, "%le", &data[i]);
00374         free (str);
00375     }
00376
00377     return TRUE;
00378 }

int wire_read_int16 | ( | pipe_t | fd,
 |  | guint16 * | data,
 |  | gint | count
 | ) |

Definition at line 334 of file cvsgui_wire.cpp.

00337 {
00338     if (count > 0)
00339     {
00340         if (!wire_read_int8 (fd, (guint8*) data, count * 2))
00341             return FALSE;
00342
00343         while (count--)
00344         {
00345             *data = ntohs (*data);
00346             data++;
00347         }
00348     }
00349
00350     return TRUE;
00351 }

int wire_read_int32 | ( | pipe_t | fd,
 |  | guint32 * | data,
 |  | gint | count
 | ) |

Definition at line 314 of file cvsgui_wire.cpp.

Referenced by _gp_console_read, _gp_quit_read, wire_read_msg, and wire_read_string.

00317 {
00318     if (count > 0)
00319     {
00320         if (!wire_read_int8 (fd, (guint8*) data, count * 4))
00321             return FALSE;
00322
00323         while (count--)
00324         {
00325             *data = ntohl (*data);
00326             data++;
00327         }
00328     }
00329
00330     return TRUE;
00331 }

int wire_read_int8 | ( | pipe_t | fd,
 |  | guint8 * | data,
 |  | gint | count
 | ) |

Definition at line 354 of file cvsgui_wire.cpp.

Referenced by _gp_console_read, _gp_getenv_read, wire_read_int16, wire_read_int32, and wire_read_string.

00357 {
00358     return wire_read (fd, data, count);
00359 }

int wire_read_msg | ( | pipe_t | fd,
 |  | WireMessage * | msg
 | ) |

Definition at line 256 of file cvsgui_wire.cpp.

Referenced by cvs_process_recv_message, and gp_getenv_read.

00258 {
00259     WireHandler *handler;
00260
00261     if (wire_error_val)
00262         return !wire_error_val;
00263
00264     if (!wire_read_int32 (fd, &msg->type, 1))
00265         return FALSE;
00266
00267     STD_STL map<guint32, WireHandler *>::iterator i = sHandlers.wire_ht.find(msg->type);
00268     if(i == sHandlers.wire_ht.end())
00269         return FALSE;
00270
00271     handler = (*i).second;
00272     (* handler->read_func) (fd, msg);
00273
00274     return !wire_error_val;
00275 }

int wire_read_string | ( | pipe_t | fd,
 |  | gchar ** | data,
 |  | gint | count
 | ) |

Definition at line 381 of file cvsgui_wire.cpp.

Referenced by _gp_console_read, _gp_getenv_read, and wire_read_double.

00384 {
00385     guint32 tmp;
00386     int i;
00387
00388     for (i = 0; i < count; i++)
00389     {
00390         if (!wire_read_int32 (fd, &tmp, 1))
00391             return FALSE;
00392
00393         if (tmp > 0)
00394         {
00395             data[i] = (gchar *)malloc(tmp * sizeof(gchar));
00396             if (!wire_read_int8 (fd, (guint8*) data[i], tmp))
00397             {
00398                 free (data[i]);
00399                 return FALSE;
00400             }
00401         }
00402         else
00403         {
00404             data[i] = NULL;
00405         }
00406     }
00407
00408     return TRUE;
00409 }

void wire_register | ( | guint32 | type,
 |  | WireReadFunc | read_func,
 |  | WireWriteFunc | write_func,
 |  | WireDestroyFunc | destroy_func
 | ) |

Definition at line 111 of file cvsgui_wire.cpp.

References gchar, gdouble, gint, guint16, guint32, guint8, and pipe_t.

Referenced by gp_init.

00115 {
00116     WireHandler *handler;
00117
00118     STD_STL map<guint32, WireHandler *>::iterator i = sHandlers.wire_ht.find(type);
00119     if(i == sHandlers.wire_ht.end())
00120         handler = (WireHandler *)malloc(sizeof(WireHandler));
00121     else
00122         handler = (*i).second;
00123
00124     handler->type = type;
00125     handler->read_func = read_func;
00126     handler->write_func = write_func;
00127     handler->destroy_func = destroy_func;
00128
00129     sHandlers.wire_ht.insert(STD_STL map<guint32, WireHandler *>::value_type(type, handler));
00130 }

void wire_set_flusher ( WireFlushFunc flush_func )

Definition at line 145 of file cvsgui_wire.cpp.

References gint.

Referenced by cvs_process_init.

00146 {
00147     wire_flush_func = flush_func;
00148 }

void wire_set_reader ( WireIOFunc read_func )

Definition at line 133 of file cvsgui_wire.cpp.

References gint, guint16, guint8, and pipe_t.

00134 {
00135     wire_read_func = read_func;
00136 }

void wire_set_writer ( WireIOFunc write_func )

Definition at line 139 of file cvsgui_wire.cpp.

References gchar, gdouble, gint, and pipe_t.

Referenced by cvs_process_init.

00140 {
00141     wire_write_func = write_func;
00142 }

int wire_write | ( | pipe_t | fd,
 |  | guint8 * | buf,
 |  | gulong | count
 | ) |

Definition at line 197 of file cvsgui_wire.cpp.

Referenced by wire_write_int8.

00200 {
00201     if (wire_write_func)
00202     {
00203         if (!(* wire_write_func) (fd, buf, count))
00204         {
00205             //g_print ("wire_write: error\n");
00206             wire_error_val = TRUE;
00207             return FALSE;
00208         }
00209     }
00210     else
00211     {
00212         int bytes;
00213
00214         while (count > 0)
00215         {
00216             do {
00217                 bytes = write (fd, (char*) buf, count);
00218             } while ((bytes == -1) && ((errno == EAGAIN) || (errno == EINTR)));
00219
00220             if (bytes == -1)
00221             {
00222                 //g_print ("wire_write: error\n");
00223                 wire_error_val = TRUE;
00224                 return FALSE;
00225             }
00226
00227             count -= bytes;
00228             buf += bytes;
00229         }
00230     }
00231
00232     return TRUE;
00233 }

int wire_write_double | ( | pipe_t | fd,
 |  | gdouble * | data,
 |  | gint | count
 | ) |

Definition at line 462 of file cvsgui_wire.cpp.

00465 {
00466     gchar *t, buf[128];
00467     int i;
00468
00469     t = buf;
00470     for (i = 0; i < count; i++)
00471     {
00472         sprintf (buf, "%0.50e", data[i]);
00473         if (!wire_write_string (fd, &t, 1))
00474             return FALSE;
00475     }
00476
00477     return TRUE;
00478 }

int wire_write_int16 | ( | pipe_t | fd,
 |  | guint16 * | data,
 |  | gint | count
 | ) |

Definition at line 433 of file cvsgui_wire.cpp.

00436 {
00437     guint16 tmp;
00438     int i;
00439
00440     if (count > 0)
00441     {
00442         for (i = 0; i < count; i++)
00443         {
00444             tmp = htons (data[i]);
00445             if (!wire_write_int8 (fd, (guint8*) &tmp, 2))
00446                 return FALSE;
00447         }
00448     }
00449
00450     return TRUE;
00451 }

int wire_write_int32 | ( | pipe_t | fd,
 |  | guint32 * | data,
 |  | gint | count
 | ) |

Definition at line 412 of file cvsgui_wire.cpp.

Referenced by _gp_console_write, _gp_quit_write, wire_write_msg, and wire_write_string.

00415 {
00416     guint32 tmp;
00417     int i;
00418
00419     if (count > 0)
00420     {
00421         for (i = 0; i < count; i++)
00422         {
00423             tmp = htonl (data[i]);
00424             if (!wire_write_int8 (fd, (guint8*) &tmp, 4))
00425                 return FALSE;
00426         }
00427     }
00428
00429     return TRUE;
00430 }

int wire_write_int8 | ( | pipe_t | fd,
 |  | guint8 * | data,
 |  | gint | count
 | ) |

Definition at line 454 of file cvsgui_wire.cpp.

Referenced by _gp_console_write, _gp_getenv_write, wire_write_int16, wire_write_int32, and wire_write_string.

00457 {
00458     return wire_write (fd, data, count);
00459 }

int wire_write_msg | ( | pipe_t | fd,
 |  | WireMessage * | msg
 | ) |

Definition at line 278 of file cvsgui_wire.cpp.

Referenced by gp_console_write, gp_getenv_write, and gp_quit_write.

00280 {
00281     WireHandler *handler;
00282
00283     if (wire_error_val)
00284         return !wire_error_val;
00285
00286     STD_STL map<guint32, WireHandler *>::iterator i = sHandlers.wire_ht.find(msg->type);
00287     if(i == sHandlers.wire_ht.end())
00288         return FALSE;
00289
00290     handler = (*i).second;
00291
00292     if (!wire_write_int32 (fd, &msg->type, 1))
00293         return FALSE;
00294
00295     (* handler->write_func) (fd, msg);
00296
00297     return !wire_error_val;
00298 }

int wire_write_string | ( | pipe_t | fd,
 |  | gchar ** | data,
 |  | gint | count
 | ) |

Definition at line 481 of file cvsgui_wire.cpp.

Referenced by _gp_console_write, _gp_getenv_write, and wire_write_double.

00484 {
00485     guint32 tmp;
00486     int i;
00487
00488     for (i = 0; i < count; i++)
00489     {
00490         if (data[i])
00491             tmp = strlen (data[i]) + 1;
00492         else
00493             tmp = 0;
00494
00495         if (!wire_write_int32 (fd, &tmp, 1))
00496             return FALSE;
00497         if (tmp > 0)
00498             if (!wire_write_int8 (fd, (guint8*) data[i], tmp))
00499                 return FALSE;
00500     }
00501
00502     return TRUE;
00503 }

Generated on Sun Feb 24 01:21:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsIgnore.cpp File Reference

common/CvsIgnore.cpp File Reference

#include "stdafx.h"
#include <stdlib.h>
#include <string.h>
#include "FileTraversal.h"
#include "AppConsole.h"
#include "CvsIgnore.h"
#include "getline.h"
#include "fnmatch.h"
#include "CvsPrefs.h"
#include "wincvs.h"

Include dependency graph for CvsIgnore.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void | ign_add (char *ign, bool hold, std::vector< UStr > &ignlist)
bool | ReadIgnoredFile (const char *fileName, std::vector< UStr > &ignlist)
void | BuildIgnoredList (std::vector< UStr > &ignlist, const char *path)
bool | MatchIgnoredList (const char *filename, const std::vector< UStr > &ignlist)

Function Documentation

void BuildIgnoredList | ( | std::vector< UStr > & | ignlist,
 |  | const char * | path
 | ) |

Definition at line 148 of file CvsIgnore.cpp.

References CStr, cvs_err, UStr::endsWith, ign_add, MacGetPrefsFolder, ReadIgnoredFile, stat, and UFSSpec.

00149 {
00150     ignlist.erase(ignlist.begin(), ignlist.end());
00151
00152     static std::vector<CStr> deflist;
00153     static bool deflistparsed = false;
00154
00155     if(!deflistparsed)
00156     {
00157 #ifdef macintosh
00158         UFSSpec theFolder;
00159         CStr home;
00160
00161         if(MacGetPrefsFolder(theFolder, home) == noErr)
00162         {
00163 #else /* !macintosh */
00164         if(gCvsPrefs.Home() != 0L)
00165         {
00166             CStr home(gCvsPrefs.Home());
00167 #endif /* !macintosh */
00168             struct stat sb;
00169             if (stat(home, &sb) != 0 || !S_ISDIR(sb.st_mode))
00170             {
00171                 cvs_err("Warning : unable to access your HOME path '%s'\n", gCvsPrefs.Home());
00172                 cvs_err("          ~/.cvsignore will not be read\n");
00173             }
00174             if(!home.empty() && !home.endsWith(kPathDelimiter))
00175                 home << kPathDelimiter;
00176             home << ".cvsignore";
00177
00178             // Read .cvsignore file from HOME directory.
00179             // If HOME dir doesn't have such a file then
00180             // try to read global file from executable path.
00181             if(ReadIgnoredFile(home, deflist) == false)
00182             {
00183                 CStr appPath;
00184
00185 #ifdef WIN32
00186                 ((CWincvsApp *)AfxGetApp())->GetAppPath(appPath);
00187 #elif defined(qUnix)
00188                 // Unix version uses only .cvsignore file in HOME dir
00189 #else
00190 #   ifdef qMacCvsPP
00191                 appPath = CMacCvsApp::GetAppPath();
00192 #   endif /* qMacCvsPP */
00193 #endif
00194                 if(!appPath.empty())
00195                 {
00196                     if(!appPath.endsWith(kPathDelimiter))
00197                         appPath << kPathDelimiter;
00198
00199                     appPath << ".cvsignore";
00200
00201                     ReadIgnoredFile(appPath, deflist);
00202                 }
00203             }
00204         }
00205         deflistparsed = true;
00206     }
00207     else
00208         ignlist = deflist;
00209
00210 #if qUnix
00211     // from cvs/src/ignore.c
00212     CStr ign_default(". .. core RCSLOG tags TAGS RCS SCCS .make.state\
00213  .nse_depinfo #* .#* cvslog.* ,* CVS CVS.adm .del-* *.a *.olb *.o *.obj\
00214  *.so *.Z *~ *.old *.elc *.ln *.bak *.BAK *.orig *.rej *.exe _$* *$");
00215     ign_add (ign_default, false, ignlist);
00216 #endif
00217
00218     UStr ignPath(path);
00219     if(!ignPath.endsWith(kPathDelimiter))
00220         ignPath << kPathDelimiter;
00221     ignPath << ".cvsignore";
00222
00223     // load the file from the current source directory
00224     ReadIgnoredFile(ignPath, ignlist);
00225 }

void ign_add | ( | char * | ign,
 |  | bool | hold,
 |  | std::vector< UStr > & | ignlist
 | ) | [static]

Definition at line 58 of file CvsIgnore.cpp.

References CStr.

Referenced by BuildIgnoredList, and ReadIgnoredFile.

00059 {
00060     if (!ign || !*ign)
00061         return;
00062
00063     int ign_hold = ignlist.size() == 0 ? -1 : (int)ignlist.size();
00064
00065     for (; *ign; ign++)
00066     {
00067         char *mark;
00068         char save;
00069
00070         /* ignore whitespace before the token */
00071         if (isspace (*ign))
00072             continue;
00073
00074         /*
00075         * if we find a single character !, we must re-set the ignore list
00076         * (saving it if necessary).  We also catch * as a special case in a
00077         * global ignore file as an optimization
00078         */
00079         if ((!*(ign+1) || isspace (*(ign+1))) && (*ign == '!' || *ign == '*'))
00080         {
00081             if (!hold)
00082             {
00083                 /* permanently reset the ignore list */
00084                 ignlist.erase(ignlist.begin(), ignlist.end());
00085
00086                 /* if we are doing a '!', continue; otherwise add the '*' */
00087                 if (*ign == '!')
00088                 {
00089                     continue;
00090                 }
00091             }
00092             else if (*ign == '!')
00093             {
00094                 /* temporarily reset the ignore list */
00095                 if (ign_hold >= 0)
00096                 {
00097                     ignlist.erase(ignlist.begin(), ignlist.begin() + ign_hold);
00098                     ign_hold = -1;
00099                 }
00100                 continue;
00101             }
00102         }
00103
00104         /* find the end of this token */
00105         for (mark = ign; *mark && !isspace (*mark); mark++)
00106             /* do nothing */ ;
00107
00108         save = *mark;
00109         *mark = '\0';
00110
00111         ignlist.push_back(CStr(ign));
00112
00113         *mark = save;
00114         if (save)
00115             ign = mark;
00116         else
00117             ign = mark - 1;
00118     }
00119 }

bool MatchIgnoredList | ( | const char * | filename,
 |  | const std::vector< UStr > & | ignlist
 | ) |

Definition at line 227 of file CvsIgnore.cpp.

References fnmatch.

00228 {
00229     std::vector<CStr>::const_iterator i;
00230     for(i = ignlist.begin(); i != ignlist.end(); ++i)
00231     {
00232         if(fnmatch (*i, filename, 0) == 0)
00233             return true;
00234     }
00235     return false;
00236 }

bool ReadIgnoredFile | ( | const char * | fileName,
 |  | std::vector< UStr > & | ignlist
 | ) | [static]

Definition at line 123 of file CvsIgnore.cpp.

References cvs_err, free, getline, ign_add, and NULL.

Referenced by BuildIgnoredList.

00124 {
00125     FILE *fp;
00126     char *line = NULL;
00127     size_t line_allocated = 0;
00128
00129     fp = fopen(fileName, "r");
00130     if(fp != 0L)
00131     {
00132         while (getline (&line, &line_allocated, fp) >= 0)
00133             ign_add (line, false, ignlist);
00134
00135         if (ferror (fp))
00136             cvs_err("Problem while parsing '%s'", fileName);
00137
00138         fclose (fp);
00139     }
00140
00141     if(line != 0L)
00142         free (line);
00143
00144     return(fp != 0L);
00145 }

Generated on Sun Feb 24 01:21:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsIgnore.h File Reference

common/CvsIgnore.h File Reference

#include <vector>
#include "CPStr.h"

Include dependency graph for CvsIgnore.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

void | BuildIgnoredList (std::vector< UStr > &ignlist, const char *path)
bool | MatchIgnoredList (const char *filename, const std::vector< UStr > &ignlist)

Function Documentation

void BuildIgnoredList | ( | std::vector< UStr > & | ignlist,
 |  | const char * | path
 | ) |

Definition at line 148 of file CvsIgnore.cpp.

Referenced by TBrowserFill::EnterDirectory, TViewFill::EnterDirectory, CFillTclEntries::EnterDirectory, CFillPyEntries::EnterDirectory, ImportReport::ImportReport, and CHistComboBoxEx::SetIcon.

00149 {
00150     ignlist.erase(ignlist.begin(), ignlist.end());
00151
00152     static std::vector<CStr> deflist;
00153     static bool deflistparsed = false;
00154
00155     if(!deflistparsed)
00156     {
00157 #ifdef macintosh
00158         UFSSpec theFolder;
00159         CStr home;
00160
00161         if(MacGetPrefsFolder(theFolder, home) == noErr)
00162         {
00163 #else /* !macintosh */
00164         if(gCvsPrefs.Home() != 0L)
00165         {
00166             CStr home(gCvsPrefs.Home());
00167 #endif /* !macintosh */
00168             struct stat sb;
00169             if (stat(home, &sb) != 0 || !S_ISDIR(sb.st_mode))
00170             {
00171                 cvs_err("Warning : unable to access your HOME path '%s'\n", gCvsPrefs.Home());
00172                 cvs_err("          ~/.cvsignore will not be read\n");
00173             }
00174             if(!home.empty() && !home.endsWith(kPathDelimiter))
00175                 home << kPathDelimiter;
00176             home << ".cvsignore";
00177
00178             // Read .cvsignore file from HOME directory.
00179             // If HOME dir doesn't have such a file then
00180             // try to read global file from executable path.
00181             if(ReadIgnoredFile(home, deflist) == false)
00182             {
00183                 CStr appPath;
00184
00185 #ifdef WIN32
00186                 ((CWincvsApp *)AfxGetApp())->GetAppPath(appPath);
00187 #elif defined(qUnix)
00188                 // Unix version uses only .cvsignore file in HOME dir
00189 #else
00190 #   ifdef qMacCvsPP
00191                 appPath = CMacCvsApp::GetAppPath();
00192 #   endif /* qMacCvsPP */
00193 #endif
00194                 if(!appPath.empty())
00195                 {
00196                     if(!appPath.endsWith(kPathDelimiter))
00197                         appPath << kPathDelimiter;
00198
00199                     appPath << ".cvsignore";
00200
00201                     ReadIgnoredFile(appPath, deflist);
00202                 }
00203             }
00204         }
00205         deflistparsed = true;
00206     }
00207     else
00208         ignlist = deflist;
00209
00210 #if qUnix
00211     // from cvs/src/ignore.c
00212     CStr ign_default(". .. core RCSLOG tags TAGS RCS SCCS .make.state\
00213  .nse_depinfo #* .#* cvslog.* ,* CVS CVS.adm .del-* *.a *.olb *.o *.obj\
00214  *.so *.Z *~ *.old *.elc *.ln *.bak *.BAK *.orig *.rej *.exe _$* *$");
00215     ign_add (ign_default, false, ignlist);
00216 #endif
00217
00218     UStr ignPath(path);
00219     if(!ignPath.endsWith(kPathDelimiter))
00220         ignPath << kPathDelimiter;
00221     ignPath << ".cvsignore";
00222
00223     // load the file from the current source directory
00224     ReadIgnoredFile(ignPath, ignlist);
00225 }

bool MatchIgnoredList | ( | const char * | filename,
 |  | const std::vector< UStr > & | ignlist
 | ) |

Definition at line 227 of file CvsIgnore.cpp.

Referenced by Entries_SetVisited, KoFilterModel::IsMatch, and list_add_type.

00228 {
00229     std::vector<CStr>::const_iterator i;
00230     for(i = ignlist.begin(); i != ignlist.end(); ++i)
00231     {
00232         if(fnmatch (*i, filename, 0) == 0)
00233             return true;
00234     }
00235     return false;
00236 }

Generated on Sun Feb 24 01:21:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsPrefs.cpp File Reference

common/CvsPrefs.cpp File Reference

#include "stdafx.h"
#include <string.h>
#include <stdlib.h>
#include "CvsPrefs.h"
#include "Authen.h"
#include "AppConsole.h"
#include "CvsArgs.h"
#include "MultiString.h"
#include "FileTraversal.h"
#include <process.h>
#include "WinCvsBrowser.h"
#include "wincvs.h"
#include "TextBinary.h"

Include dependency graph for CvsPrefs.cpp:

Include dependency graph

Go to the source code of this file.

Functions

CPersistentInt | gPersistentShema ("P_PersistentShema", SCHEMA_0)
CPersistentBool | gCheckoutRO ("P_CheckoutRO", true, kAddSettings)
CPersistentBool | gZ9Option ("P_Z9Option", false, kAddSettings)
CPersistentBool | gPruneOption ("P_PruneOption", true, kAddSettings)
CPersistentBool | gQuietOption ("P_QuietOption", false)
CPersistentInt | gIsoConvert ("P_NIsoConvert", ISO8559_none, kAddSettings)
CPersistentBool | gICTextOption ("P_ICTextOption", false, kAddSettings)
CPersistentBool | gAddBinControl ("P_AddBinControl", true)
CPersistentBool | gUseViewerAlways ("P_UseViewerAlways", false, kAddSettings)
CPersistentInt | gMacBinEncoding ("P_NMacBinEncoding", MAC_HQX, kAddSettings)
CPersistentInt | gUseShell ("P_UseShell", SHELL_TCL)
PCPStr | gCvsroot ("P_Cvsroot")
CMString | gOldCvsroots (20,"P_OldCvsroots")
CPersistentInt | gKserverPort ("P_KserverPort",-1, kAddSettings)
CPersistentInt | gPserverPort ("P_PserverPort",-1, kAddSettings)
CPersistentInt | gRhostPort ("P_RhostPort",-1, kAddSettings)
PCPStr | gServerName ("P_ServerName", 0L, kAddSettings)
PCStr | gRshName ("P_RshName", 0L, kAddSettings)
CPersistentBool | gEncryptCommunication ("P_EncryptCommunication", false, kAddSettings)
PCStr | gHome ("P_Home", 0L, kAddSettings)
PCStr | gViewer ("P_Viewer","Notepad")
PCStr | gHelper ("P_Helper","netscape")
PCStr | gBrowser ("P_Browser","gmc")
PCStr | gExtdiff ("P_Extdiff","")
CPersistentBool | gDirtySupport ("P_DirtySupport", true, kAddSettings)
CPersistentBool | gAlwaysUseCvsroot ("P_AlwaysUseCvsroot", false, kAddSettings)
CPersistentInt | gLogoutTimeOut ("P_LogoutTimeOut", 0)
PCStr | gProxyHost ("P_ProxyHost","www.mydomain", kAddSettings)
CPersistentInt | gProxyPort ("P_ProxyPort", 8888, kAddSettings)
CPersistentBool | gUseProxy ("P_UseProxy", false, kAddSettings)
CPersistentBool | gUnixLF ("P_UnixLF", false, kAddSettings)
CPersistentBool | gMacLF ("P_MacLF", false, kAddSettings)
CPersistentInt | gZLevel ("P_ZLevel", 9, kAddSettings)
CPersistentInt | gCvsVersion ("P_CvsVersion", 0, kAddSettings)
CPersistentBool | gCvsConsole ("P_CvsConsole", false, kAddSettings)
CPersistentInt | gWordWrapLogMsg ("P_WordWrapLogMsg", 0, kAddSettings)
PCStr | gLastWorkingDir ("P_LastWorkingDir", 0L, kAddSettings)
CPersistentBool | gHideCommandDlgUpdate ("P_HideCommandDlgUpdate", false)
CPersistentBool | gHideCommandDlgDiff ("P_HideCommandDlgDiff", false)
CPersistentBool | gHideCommandDlgLog ("P_HideCommandDlgLog", false)
CPersistentBool | gHideCommandDlgGraph ("P_HideCommandDlgGraph", false)
CPersistentBool | gHideCommandDlgAnnotate ("P_HideCommandDlgAnnotate", false)
CPersistentBool | gHideCommandDlgUseShift ("P_HideCommandDlgUseShift", true)
CKeyString | gWhichCvs (10,"P_WhichCvs")
CPersistentBool | gUseAltCvs ("P_UseAltCvs", false, kAddSettings)
void | MigrateCvsrootList ()
Helper method to migrate into a single CMString for cvsroot history. More...

bool | LaunchDiff (const char *f1, const char *f2)
bool | LaunchViewer (const char *fullpath, bool useDefault)
bool | LaunchEditor (const char *tmpFile, void *par)

Variables

CvsPrefs gCvsPrefs

Function Documentation

CPersistentBool gAddBinControl | ( | "P_AddBinControl" | ,
 |  | true |
 | ) | [static]

CPersistentBool gAlwaysUseCvsroot | ( | "P_AlwaysUseCvsroot" | ,
 |  | false | ,
 |  | kAddSettings |
 | ) | [static]

PCStr gBrowser | ( | "P_Browser" | ,
 |  | "gmc" |
 | ) | [static]

CPersistentBool gCheckoutRO | ( | "P_CheckoutRO" | ,
 |  | true | ,
 |  | kAddSettings |
 | ) | [static]

CPersistentBool gCvsConsole | ( | "P_CvsConsole" | ,
 |  | false | ,
 |  | kAddSettings |
 | ) | [static]

PCPStr gCvsroot ( "P_Cvsroot" ) [static]

CPersistentInt gCvsVersion | ( | "P_CvsVersion" | ,
 |  | 0 | ,
 |  | kAddSettings |
 | ) | [static]

CPersistentBool gDirtySupport | ( | "P_DirtySupport" | ,
 |  | true | ,
 |  | kAddSettings |
 | ) | [static]

CPersistentBool gEncryptCommunication | ( | "P_EncryptCommunication" | ,
 |  | false | ,
 |  | kAddSettings |
 | ) | [static]

PCStr gExtdiff | ( | "P_Extdiff" | ,
 |  | "" |
 | ) | [static]

PCStr gHelper | ( | "P_Helper" | ,
 |  | "netscape" |
 | ) | [static]

CPersistentBool gHideCommandDlgAnnotate | ( | "P_HideCommandDlgAnnotate" | ,
 |  | false |
 | ) | [static]

CPersistentBool gHideCommandDlgDiff | ( | "P_HideCommandDlgDiff" | ,
 |  | false |
 | ) | [static]

CPersistentBool gHideCommandDlgGraph | ( | "P_HideCommandDlgGraph" | ,
 |  | false |
 | ) | [static]

CPersistentBool gHideCommandDlgLog | ( | "P_HideCommandDlgLog" | ,
 |  | false |
 | ) | [static]

CPersistentBool gHideCommandDlgUpdate | ( | "P_HideCommandDlgUpdate" | ,
 |  | false |
 | ) | [static]

CPersistentBool gHideCommandDlgUseShift | ( | "P_HideCommandDlgUseShift" | ,
 |  | true |
 | ) | [static]

PCStr gHome | ( | "P_Home" | ,
 |  | 0L | ,
 |  | kAddSettings |
 | ) | [static]

CPersistentBool gICTextOption | ( | "P_ICTextOption" | ,
 |  | false | ,
 |  | kAddSettings |
 | ) | [static]

CPersistentInt gIsoConvert | ( | "P_NIsoConvert" | ,
 |  | ISO8559_none | ,
 |  | kAddSettings |
 | ) | [static]

CPersistentInt gKserverPort | ( | "P_KserverPort" | ,
 |  | - | 1,
 |  | kAddSettings |
 | ) | [static]

PCStr gLastWorkingDir | ( | "P_LastWorkingDir" | ,
 |  | 0L | ,
 |  | kAddSettings |
 | ) | [static]

CPersistentInt gLogoutTimeOut | ( | "P_LogoutTimeOut" | ,
 |  | 0 |
 | ) | [static]

CPersistentInt gMacBinEncoding | ( | "P_NMacBinEncoding" | ,
 |  | MAC_HQX | ,
 |  | kAddSettings |
 | ) | [static]

CPersistentBool gMacLF | ( | "P_MacLF" | ,
 |  | false | ,
 |  | kAddSettings |
 | ) | [static]

CMString gOldCvsroots | ( | 20 | ,
 |  | "P_OldCvsroots" |
 | ) |

CPersistentInt gPersistentShema | ( | "P_PersistentShema" | ,
 |  | SCHEMA_0 |
 | ) | [static]

PCStr gProxyHost | ( | "P_ProxyHost" | ,
 |  | "www.mydomain" | ,
 |  | kAddSettings |
 | ) | [static]

CPersistentInt gProxyPort | ( | "P_ProxyPort" | ,
 |  | 8888 | ,
 |  | kAddSettings |
 | ) | [static]

CPersistentBool gPruneOption | ( | "P_PruneOption" | ,
 |  | true | ,
 |  | kAddSettings |
 | ) | [static]

CPersistentInt gPserverPort | ( | "P_PserverPort" | ,
 |  | - | 1,
 |  | kAddSettings |
 | ) | [static]

CPersistentBool gQuietOption | ( | "P_QuietOption" | ,
 |  | false |
 | ) | [static]

CPersistentInt gRhostPort | ( | "P_RhostPort" | ,
 |  | - | 1,
 |  | kAddSettings |
 | ) | [static]

PCStr gRshName | ( | "P_RshName" | ,
 |  | 0L | ,
 |  | kAddSettings |
 | ) | [static]

PCPStr gServerName | ( | "P_ServerName" | ,
 |  | 0L | ,
 |  | kAddSettings |
 | ) | [static]

CPersistentBool gUnixLF | ( | "P_UnixLF" | ,
 |  | false | ,
 |  | kAddSettings |
 | ) | [static]

CPersistentBool gUseAltCvs | ( | "P_UseAltCvs" | ,
 |  | false | ,
 |  | kAddSettings |
 | ) | [static]

CPersistentBool gUseProxy | ( | "P_UseProxy" | ,
 |  | false | ,
 |  | kAddSettings |
 | ) | [static]

CPersistentInt gUseShell | ( | "P_UseShell" | ,
 |  | SHELL_TCL |
 | ) | [static]

CPersistentBool gUseViewerAlways | ( | "P_UseViewerAlways" | ,
 |  | false | ,
 |  | kAddSettings |
 | ) | [static]

PCStr gViewer | ( | "P_Viewer" | ,
 |  | "Notepad" |
 | ) | [static]

CKeyString gWhichCvs | ( | 10 | ,
 |  | "P_WhichCvs" |
 | ) | [static]

CPersistentInt gWordWrapLogMsg | ( | "P_WordWrapLogMsg" | ,
 |  | 0 | ,
 |  | kAddSettings |
 | ) | [static]

CPersistentBool gZ9Option | ( | "P_Z9Option" | ,
 |  | false | ,
 |  | kAddSettings |
 | ) | [static]

CPersistentInt gZLevel | ( | "P_ZLevel" | ,
 |  | 9 | ,
 |  | kAddSettings |
 | ) | [static]

bool LaunchDiff | ( | const char * | f1,
 |  | const char * | f2
 | ) |

Definition at line 686 of file CvsPrefs.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, CStr, cvs_err, UCvsApp::Execute, CvsPrefs::ExtDiff, FSSpec, UCvsApp::gApp, and NULL.

00687 {
00688 #ifdef qMacCvsPP
00689     const   OSType      kBBEditDiffCreatorCode  = FOUR_CHAR_CODE('BBds');
00690     const   OSType      kResourcererCreatorCode = FOUR_CHAR_CODE('Doug');
00691
00692     //  Resourcerer's Compare suite
00693     const   DescType    kAECompareClass = 'Comp';
00694     const   DescType    kAECompareEvent = 'Comp';
00695         const   DescType    keyNewer        = 'kNew';
00696         const   DescType    keyOlder        = 'kOld';
00697         const   DescType    keyShowDiff     = 'kShD';
00698         const   DescType    keyReturnDiff   = 'kRtD';
00699
00700     OSErr               e = noErr;
00701
00702     try {
00703         //  Convert to file specs
00704         Boolean             inShowDiffs = true;
00705 #if TARGET_RT_MAC_CFM
00706         FSSpec              spec1 = GUSIFileSpec (f1);
00707         FSSpec              spec2 = GUSIFileSpec (f2);
00708 #else
00709         FSRef               ref1 = GUSIFileSpec (f1);
00710         FSRef               ref2 = GUSIFileSpec (f2);
00711         FSSpec              spec1;
00712         FSSpec              spec2;
00713
00714         ThrowIfOSErr_(FSGetCatalogInfo(&ref1, kFSCatInfoNone, NULL, NULL, &spec1, NULL));
00715         ThrowIfOSErr_(FSGetCatalogInfo(&ref2, kFSCatInfoNone, NULL, NULL, &spec2, NULL));
00716 #endif
00717
00718         //  Find the file type
00719         FInfo   info;
00720         e = ::FSpGetFInfo (&spec2, &info);
00721         ThrowIfOSErr_(e);
00722
00723         //  Decide on the application
00724         OSType              applCreator = FOUR_CHAR_CODE('????');
00725         switch (info.fdType) {
00726             case 'TEXT':
00727                 applCreator = kBBEditDiffCreatorCode;
00728                 break;
00729
00730             default:
00731                 applCreator = kResourcererCreatorCode;
00732                 break;
00733             } // switch
00734
00735         //  Try to launch it
00736         LaunchFlags         launchFlags = launchContinue + launchNoFileFlags;
00737         OSType              applType = FOUR_CHAR_CODE('APPL');
00738         FSSpec              applSpec;
00739         ProcessSerialNumber applPSN;
00740         if (!UProcess::Launch (applCreator, applType, launchFlags, &applSpec, &applPSN)) Throw_(fnfErr);
00741
00742         //  Now, diff the files.  We use the Resourcerer suite and a BBEdit glue applet.
00743             //  Create the parameters
00744         StAEDescriptor  newerDesc (spec1);
00745         StAEDescriptor  olderDesc (spec2);
00746         StAEDescriptor  showDesc (inShowDiffs);
00747
00748             //  Create the event
00749         StAEDescriptor  addressDesc (typeProcessSerialNumber, &applPSN, sizeof (applPSN));
00750
00751         StAEDescriptor  diffEvent;
00752         e = ::AECreateAppleEvent (kAECompareClass, kAECompareEvent, addressDesc, kAutoGenerateReturnID, kAnyTransactionID, diffEvent);
00753         ThrowIfOSErr_(e);
00754
00755             //  Add the parameters
00756         e = ::AEPutParamDesc (diffEvent, keyNewer, newerDesc);
00757         ThrowIfOSErr_(e);
00758         e = ::AEPutParamDesc (diffEvent, keyOlder, olderDesc);
00759         ThrowIfOSErr_(e);
00760         e = ::AEPutParamDesc (diffEvent, keyShowDiff, showDesc);
00761         ThrowIfOSErr_(e);
00762
00763             //  Send the event
00764         UAppleEventsMgr::SendAppleEvent (diffEvent);
00765
00766         return true;
00767         } // try
00768
00769     catch (LException ex) {
00770         } // catch
00771 #endif
00772     if(gCvsPrefs.ExtDiff() == 0L)
00773     {
00774         cvs_err("The external diff program is not defined,\n");
00775         cvs_err("you need to set it in the preferences dialog.\n");
00776         return false;
00777     }
00778 #ifdef WIN32
00779     CString args;
00780     CStr program, file1, file2;
00781     if(strchr(gCvsPrefs.ExtDiff(), ' ') != 0L)
00782     {
00783         program << '\"';
00784         program << gCvsPrefs.ExtDiff();
00785         program << '\"';
00786     }
00787     else
00788         program = gCvsPrefs.ExtDiff();
00789
00790     if(strchr(f1, ' ') != 0L)
00791     {
00792         file1 << '\"';
00793         file1 << f1;
00794         file1 << '\"';
00795     }
00796     else
00797         file1 = f1;
00798
00799     if(strchr(f2, ' ') != 0L)
00800     {
00801         file2 << '\"';
00802         file2 << f2;
00803         file2 << '\"';
00804     }
00805     else
00806         file2 = f2;
00807
00808     args += file1;
00809     args += " ";
00810     args += file2;
00811
00812     HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), NULL, gCvsPrefs.ExtDiff(), args,
00813                         NULL, SW_SHOWDEFAULT);
00814
00815     if((UINT)hInst < 32)
00816     {
00817         // ExtDiff app was not found. Let's try to execute it from
00818         // the application path. However, this is done only when ExtDiff
00819         // value doesn't contain absolute path ("c:\subdir\" or "\subdir\").
00820         if(strchr(gCvsPrefs.ExtDiff(), ':') == 0L && (gCvsPrefs.ExtDiff()[0]) != '\\')
00821         {
00822             CStr appPath;
00823
00824             ((CWincvsApp *)AfxGetApp())->GetAppPath(appPath);
00825             if(!appPath.endsWith(kPathDelimiter))
00826                 appPath << kPathDelimiter;
00827
00828             appPath << gCvsPrefs.ExtDiff();
00829
00830             hInst = ShellExecute(*AfxGetMainWnd(), NULL, appPath, args,
00831                     NULL, SW_SHOWDEFAULT);
00832         }
00833     }
00834
00835     if((UINT)hInst < 32)
00836     {
00837         LPVOID lpMsgBuf;
00838         FormatMessage(
00839             FORMAT_MESSAGE_ALLOCATE_BUFFER |
00840             FORMAT_MESSAGE_FROM_SYSTEM |
00841             FORMAT_MESSAGE_IGNORE_INSERTS,
00842             NULL,
00843             GetLastError(),
00844             MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
00845             (LPTSTR) &lpMsgBuf,
00846             0,
00847             NULL
00848             );
00849         cvs_err("Unable to open '%s' (%s), using console instead\n",
00850             (char *)gCvsPrefs.ExtDiff(), (LPCSTR)lpMsgBuf);
00851         // Free the buffer.
00852         LocalFree( lpMsgBuf );
00853         return false;
00854     }
00855
00856     return true;
00857 #elif qUnix
00858     CvsArgs args(false);
00859     args.add(gCvsPrefs.ExtDiff());
00860     args.add(f1);
00861     args.add(f2);
00862     UCvsApp::gApp->Execute(args.Argc(), args.Argv());
00863     return true;
00864 #else
00865     return false;
00866 #endif
00867 }

bool LaunchEditor | ( | const char * | tmpFile,
 |  | void * | par
 | ) |

Definition at line 958 of file CvsPrefs.cpp.

References CStr, FALSE, NULL, and CvsPrefs::Viewer.

00959 {
00960     CStr program, file;
00961     if(strchr(gCvsPrefs.Viewer(), ' ') != 0L)
00962     {
00963         program << '\"';
00964         program << gCvsPrefs.Viewer();
00965         program << '\"';
00966     }
00967     else
00968         program = gCvsPrefs.Viewer();
00969     if(strchr(tmpFile, ' ') != 0L)
00970     {
00971         file << '\"';
00972         file << tmpFile;
00973         file << '\"';
00974     }
00975     else
00976         file = tmpFile;
00977
00978     CStr command;
00979     command << program;
00980     command << " ";
00981     command << file;
00982
00983 #ifdef WIN32
00984     STARTUPINFO sStartupInfo;
00985     PROCESS_INFORMATION sProcessInformation;
00986
00987     // Execute the command with a call to the CreateProcess API call.
00988     memset( &sStartupInfo, 0, sizeof(sStartupInfo) );
00989     sStartupInfo.cb = sizeof( sStartupInfo );
00990     sStartupInfo.dwFlags = STARTF_USESHOWWINDOW;
00991     sStartupInfo.wShowWindow = SW_SHOWNORMAL;
00992
00993     if( !CreateProcess( NULL,
00994         (char*)command,
00995         NULL,
00996         NULL,
00997         FALSE,
00998         0,
00999         NULL,
01000         NULL,
01001         &sStartupInfo,
01002         &sProcessInformation) )
01003     {
01004         sProcessInformation.hProcess = INVALID_HANDLE_VALUE;
01005         sProcessInformation.hThread = INVALID_HANDLE_VALUE;
01006     }
01007
01008     *((PROCESS_INFORMATION*)par) = sProcessInformation;
01009     return sProcessInformation.hProcess != INVALID_HANDLE_VALUE;
01010 #endif /* WIN32 */
01011
01012 #ifdef qMacCvsPP
01013     return true;
01014 #endif /* qMacCvsPP */
01015
01016 #if qUnix
01017     return true;
01018 #endif // qUnix
01019 }

bool LaunchViewer | ( | const char * | fullpath,
 |  | bool | useDefault
 | ) |

Definition at line 869 of file CvsPrefs.cpp.

References CStr, cvs_err, SplitPath, stat, CvsPrefs::UseViewerAlways, and CvsPrefs::Viewer.

00870 {
00871 #ifdef WIN32
00872     bool done = false;
00873
00874     if( !gCvsPrefs.UseViewerAlways() )
00875     {
00876         char viewer[_MAX_PATH];
00877         UStr buf;
00878         CStr uppath, folder;
00879         SplitPath(fullpath, uppath, folder);
00880
00881         HINSTANCE hInst = FindExecutable(fullpath, folder, viewer);
00882         if(!useDefault && (UINT)hInst >= 32)
00883         {
00884             // see Article ID: Q140724 for the problem desc of FindExecutable
00885             struct stat sb;
00886             HINSTANCE hInst;
00887             if (stat(viewer, &sb) != -1 && S_ISREG(sb.st_mode))
00888             {
00889                 CStr fullpathQuote;
00890                 if(strchr(fullpath, ' ') != 0L)
00891                 {
00892                     fullpathQuote << '\"';
00893                     fullpathQuote << fullpath;
00894                     fullpathQuote << '\"';
00895                 }
00896                 else
00897                     fullpathQuote = fullpath;
00898
00899                 hInst = ShellExecute(*AfxGetMainWnd(), "open", viewer, fullpathQuote,
00900                     folder, SW_SHOWDEFAULT);
00901             }
00902             else
00903                 hInst = ShellExecute(*AfxGetMainWnd(), "open", fullpath, 0L,
00904                     folder, SW_SHOWDEFAULT);
00905
00906             if((long)hInst < 32)
00907             {
00908                 cvs_err("Unable to open '%s' (error %d), using default viewer instead\n", (char *)fullpath, GetLastError());
00909             }
00910             else
00911                 done = true;
00912         }
00913     }
00914
00915     if(!done)
00916     {
00917         if(gCvsPrefs.Viewer() == 0L)
00918         {
00919             cvs_err("You need to define a default viewer for this file in the preferences\n");
00920             return false;
00921         }
00922
00923         const char * argv[3] = {0L, 0L, 0L};
00924         CStr program, file;
00925         if(strchr(gCvsPrefs.Viewer(), ' ') != 0L)
00926         {
00927             program << '\"';
00928             program << gCvsPrefs.Viewer();
00929             program << '\"';
00930         }
00931         else
00932             program = gCvsPrefs.Viewer();
00933         if(strchr(fullpath, ' ') != 0L)
00934         {
00935             file << '\"';
00936             file << fullpath;
00937             file << '\"';
00938         }
00939         else
00940             file = fullpath;
00941         argv[0] = program;
00942         argv[1] = file;
00943         int process = _spawnvp(_P_NOWAIT, gCvsPrefs.Viewer(), argv);
00944     }
00945
00946     return true;
00947 #endif /* WIN32 */
00948
00949 #ifdef qMacCvsPP
00950     return true;
00951 #endif /* qMacCvsPP */
00952
00953 #if qUnix
00954     return true;
00955 #endif // qUnix
00956 }

void MigrateCvsrootList ( )

Helper method to migrate into a single CMString for cvsroot history.

Definition at line 585 of file CvsPrefs.cpp.

References CStr, TMString< UStr >::Insert, NUM_CVSROOT, and PROFILE_NAME.

Referenced by CvsPrefs::load.

00586 {
00587     for(int nIndex = 0; nIndex <= NUM_CVSROOT; nIndex++)
00588     {
00589         CStr cvsroot;
00590 #ifdef WIN32
00591         char tmp[20];
00592         sprintf(tmp, "P_Cvsroot%d", nIndex);
00593         BYTE* ppData;
00594         UINT pBytes = 0;
00595
00596         if( !AfxGetApp()->GetProfileBinary(PROFILE_NAME, tmp, &ppData, &pBytes) )
00597         {
00598             continue;
00599         }
00600
00601         cvsroot = (char*)ppData;
00602         delete ppData;
00603 #endif /* WIN32 */
00604
00605 #if qUnix
00606 #endif // qUnix
00607
00608 #if qMacCvsPP
00609 #endif // qMacCvsPP
00610
00611         if( !cvsroot.empty() )
00612         {
00613             gOldCvsroots.Insert(cvsroot);
00614         }
00615     }
00616 }

Variable Documentation

CvsPrefs gCvsPrefs

Definition at line 79 of file CvsPrefs.cpp.

Generated on Sun Feb 24 01:21:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsPrefs.h File Reference

common/CvsPrefs.h File Reference

#include <string.h>
#include "CPStr.h"
#include "Persistent.h"

Include dependency graph for CvsPrefs.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CvsPrefs

Defines

#define | MIGRATECVSROOTLIST
#define | NUM_CVSROOT 20

Enumerations

enum SCHEMA_NUMBER {
SCHEMA_0,
SCHEMA_1
}
enum ISO8559 {
ISO8559_none,
ISO8559_1,
ISO8559_1_MacCvsPro,
ISO8559_2,
ISO8559_3,
ISO8559_4,
ISO8559_5,
ISO8559_6,
ISO8559_7,
ISO8559_8,
ISO8559_9,
ISO8559_10
}
enum MACENCODING {
MAC_HQX,
MAC_APPSINGLE
}
enum SHELL_KIND {
SHELL_TCL,
SHELL_PYTHON
}
enum kWinVersion {
kWin16,
kWinNT35,
kWinNT4,
kWin32
}

Functions

void | MigrateCvsrootList ()
Helper method to migrate into a single CMString for cvsroot history. More...

bool | LaunchDiff (const char *file1, const char *file2)
bool | LaunchViewer (const char *fullpath, bool useDefault=false)
bool | LaunchEditor (const char *tmpFile, void *par=0L)

Variables

CMString gOldCvsroots
CvsPrefs gCvsPrefs

Define Documentation

#define MIGRATECVSROOTLIST

Definition at line 40 of file CvsPrefs.h.

#define NUM_CVSROOT 20

Definition at line 78 of file CvsPrefs.h.

Referenced by CvsPrefs::load, CPersistent::LoadAll, and MigrateCvsrootList.

Enumeration Type Documentation

enum ISO8559

Enumeration values:
ISO8559_none
ISO8559_1
ISO8559_1_MacCvsPro
ISO8559_2
ISO8559_3
ISO8559_4
ISO8559_5
ISO8559_6
ISO8559_7
ISO8559_8
ISO8559_9
ISO8559_10

Definition at line 50 of file CvsPrefs.h.

Referenced by CvsPrefs::IsoConvert, CvsPrefs::load, and CvsPrefs::SetIsoConvert.

00051 {
00052     ISO8559_none, // no conversion
00053     ISO8559_1, // Latin1
00054     ISO8559_1_MacCvsPro, // Latin1
00055     ISO8559_2, // Latin2
00056     ISO8559_3, // Latin3
00057     ISO8559_4, // Latin4
00058     ISO8559_5, // Cyrillic
00059     ISO8559_6, // Arabic
00060     ISO8559_7, // Greek
00061     ISO8559_8, // Hebrew
00062     ISO8559_9, // Latin5 (Turkish)
00063     ISO8559_10 // Latin6 (Nordic)
00064 } ISO8559;

enum kWinVersion

Enumeration values:
kWin16
kWinNT35
kWinNT4
kWin32

Definition at line 81 of file CvsPrefs.h.

Referenced by CvsPrefs::WhichVersion.

00082     {
00083         kWin16,
00084         kWinNT35,
00085         kWinNT4,
00086         kWin32
00087     } kWinVersion;

enum MACENCODING

Enumeration values:
MAC_HQX
MAC_APPSINGLE

Definition at line 66 of file CvsPrefs.h.

Referenced by CvsPrefs::MacBinEncoding, and CvsPrefs::SetMacBinEncoding.

00067 {
00068     MAC_HQX, // HQX (7bits)
00069     MAC_APPSINGLE // Apple Single
00070 } MACENCODING;

enum SCHEMA_NUMBER

Enumeration values:
SCHEMA_0
SCHEMA_1

Definition at line 44 of file CvsPrefs.h.

00045 {
00046     SCHEMA_0,   //default
00047     SCHEMA_1    //WinCvs 1.3b7 and greater
00048 } SCHEMA_NUMBER;

enum SHELL_KIND

Enumeration values:
SHELL_TCL
SHELL_PYTHON

Definition at line 72 of file CvsPrefs.h.

Referenced by CvsPrefs::GetUseShell, and CvsPrefs::SetUseShell.

00073 {
00074     SHELL_TCL,
00075     SHELL_PYTHON
00076 } SHELL_KIND;

Function Documentation

bool LaunchDiff | ( | const char * | file1,
 |  | const char * | file2
 | ) |

Definition at line 686 of file CvsPrefs.cpp.

Referenced by CvsCmdDiffFiles, and CGraphView::OnViewDiff.

00687 {
00688 #ifdef qMacCvsPP
00689     const   OSType      kBBEditDiffCreatorCode  = FOUR_CHAR_CODE('BBds');
00690     const   OSType      kResourcererCreatorCode = FOUR_CHAR_CODE('Doug');
00691
00692     //  Resourcerer's Compare suite
00693     const   DescType    kAECompareClass = 'Comp';
00694     const   DescType    kAECompareEvent = 'Comp';
00695         const   DescType    keyNewer        = 'kNew';
00696         const   DescType    keyOlder        = 'kOld';
00697         const   DescType    keyShowDiff     = 'kShD';
00698         const   DescType    keyReturnDiff   = 'kRtD';
00699
00700     OSErr               e = noErr;
00701
00702     try {
00703         //  Convert to file specs
00704         Boolean             inShowDiffs = true;
00705 #if TARGET_RT_MAC_CFM
00706         FSSpec              spec1 = GUSIFileSpec (f1);
00707         FSSpec              spec2 = GUSIFileSpec (f2);
00708 #else
00709         FSRef               ref1 = GUSIFileSpec (f1);
00710         FSRef               ref2 = GUSIFileSpec (f2);
00711         FSSpec              spec1;
00712         FSSpec              spec2;
00713
00714         ThrowIfOSErr_(FSGetCatalogInfo(&ref1, kFSCatInfoNone, NULL, NULL, &spec1, NULL));
00715         ThrowIfOSErr_(FSGetCatalogInfo(&ref2, kFSCatInfoNone, NULL, NULL, &spec2, NULL));
00716 #endif
00717
00718         //  Find the file type
00719         FInfo   info;
00720         e = ::FSpGetFInfo (&spec2, &info);
00721         ThrowIfOSErr_(e);
00722
00723         //  Decide on the application
00724         OSType              applCreator = FOUR_CHAR_CODE('????');
00725         switch (info.fdType) {
00726             case 'TEXT':
00727                 applCreator = kBBEditDiffCreatorCode;
00728                 break;
00729
00730             default:
00731                 applCreator = kResourcererCreatorCode;
00732                 break;
00733             } // switch
00734
00735         //  Try to launch it
00736         LaunchFlags         launchFlags = launchContinue + launchNoFileFlags;
00737         OSType              applType = FOUR_CHAR_CODE('APPL');
00738         FSSpec              applSpec;
00739         ProcessSerialNumber applPSN;
00740         if (!UProcess::Launch (applCreator, applType, launchFlags, &applSpec, &applPSN)) Throw_(fnfErr);
00741
00742         //  Now, diff the files.  We use the Resourcerer suite and a BBEdit glue applet.
00743             //  Create the parameters
00744         StAEDescriptor  newerDesc (spec1);
00745         StAEDescriptor  olderDesc (spec2);
00746         StAEDescriptor  showDesc (inShowDiffs);
00747
00748             //  Create the event
00749         StAEDescriptor  addressDesc (typeProcessSerialNumber, &applPSN, sizeof (applPSN));
00750
00751         StAEDescriptor  diffEvent;
00752         e = ::AECreateAppleEvent (kAECompareClass, kAECompareEvent, addressDesc, kAutoGenerateReturnID, kAnyTransactionID, diffEvent);
00753         ThrowIfOSErr_(e);
00754
00755             //  Add the parameters
00756         e = ::AEPutParamDesc (diffEvent, keyNewer, newerDesc);
00757         ThrowIfOSErr_(e);
00758         e = ::AEPutParamDesc (diffEvent, keyOlder, olderDesc);
00759         ThrowIfOSErr_(e);
00760         e = ::AEPutParamDesc (diffEvent, keyShowDiff, showDesc);
00761         ThrowIfOSErr_(e);
00762
00763             //  Send the event
00764         UAppleEventsMgr::SendAppleEvent (diffEvent);
00765
00766         return true;
00767         } // try
00768
00769     catch (LException ex) {
00770         } // catch
00771 #endif
00772     if(gCvsPrefs.ExtDiff() == 0L)
00773     {
00774         cvs_err("The external diff program is not defined,\n");
00775         cvs_err("you need to set it in the preferences dialog.\n");
00776         return false;
00777     }
00778 #ifdef WIN32
00779     CString args;
00780     CStr program, file1, file2;
00781     if(strchr(gCvsPrefs.ExtDiff(), ' ') != 0L)
00782     {
00783         program << '\"';
00784         program << gCvsPrefs.ExtDiff();
00785         program << '\"';
00786     }
00787     else
00788         program = gCvsPrefs.ExtDiff();
00789
00790     if(strchr(f1, ' ') != 0L)
00791     {
00792         file1 << '\"';
00793         file1 << f1;
00794         file1 << '\"';
00795     }
00796     else
00797         file1 = f1;
00798
00799     if(strchr(f2, ' ') != 0L)
00800     {
00801         file2 << '\"';
00802         file2 << f2;
00803         file2 << '\"';
00804     }
00805     else
00806         file2 = f2;
00807
00808     args += file1;
00809     args += " ";
00810     args += file2;
00811
00812     HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), NULL, gCvsPrefs.ExtDiff(), args,
00813                         NULL, SW_SHOWDEFAULT);
00814
00815     if((UINT)hInst < 32)
00816     {
00817         // ExtDiff app was not found. Let's try to execute it from
00818         // the application path. However, this is done only when ExtDiff
00819         // value doesn't contain absolute path ("c:\subdir\" or "\subdir\").
00820         if(strchr(gCvsPrefs.ExtDiff(), ':') == 0L && (gCvsPrefs.ExtDiff()[0]) != '\\')
00821         {
00822             CStr appPath;
00823
00824             ((CWincvsApp *)AfxGetApp())->GetAppPath(appPath);
00825             if(!appPath.endsWith(kPathDelimiter))
00826                 appPath << kPathDelimiter;
00827
00828             appPath << gCvsPrefs.ExtDiff();
00829
00830             hInst = ShellExecute(*AfxGetMainWnd(), NULL, appPath, args,
00831                     NULL, SW_SHOWDEFAULT);
00832         }
00833     }
00834
00835     if((UINT)hInst < 32)
00836     {
00837         LPVOID lpMsgBuf;
00838         FormatMessage(
00839             FORMAT_MESSAGE_ALLOCATE_BUFFER |
00840             FORMAT_MESSAGE_FROM_SYSTEM |
00841             FORMAT_MESSAGE_IGNORE_INSERTS,
00842             NULL,
00843             GetLastError(),
00844             MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
00845             (LPTSTR) &lpMsgBuf,
00846             0,
00847             NULL
00848             );
00849         cvs_err("Unable to open '%s' (%s), using console instead\n",
00850             (char *)gCvsPrefs.ExtDiff(), (LPCSTR)lpMsgBuf);
00851         // Free the buffer.
00852         LocalFree( lpMsgBuf );
00853         return false;
00854     }
00855
00856     return true;
00857 #elif qUnix
00858     CvsArgs args(false);
00859     args.add(gCvsPrefs.ExtDiff());
00860     args.add(f1);
00861     args.add(f2);
00862     UCvsApp::gApp->Execute(args.Argc(), args.Argv());
00863     return true;
00864 #else
00865     return false;
00866 #endif
00867 }

bool LaunchEditor | ( | const char * | tmpFile,
 |  | void * | par = 0L
 | ) |

Definition at line 958 of file CvsPrefs.cpp.

Referenced by CompatGetEditorMsg.

00959 {
00960     CStr program, file;
00961     if(strchr(gCvsPrefs.Viewer(), ' ') != 0L)
00962     {
00963         program << '\"';
00964         program << gCvsPrefs.Viewer();
00965         program << '\"';
00966     }
00967     else
00968         program = gCvsPrefs.Viewer();
00969     if(strchr(tmpFile, ' ') != 0L)
00970     {
00971         file << '\"';
00972         file << tmpFile;
00973         file << '\"';
00974     }
00975     else
00976         file = tmpFile;
00977
00978     CStr command;
00979     command << program;
00980     command << " ";
00981     command << file;
00982
00983 #ifdef WIN32
00984     STARTUPINFO sStartupInfo;
00985     PROCESS_INFORMATION sProcessInformation;
00986
00987     // Execute the command with a call to the CreateProcess API call.
00988     memset( &sStartupInfo, 0, sizeof(sStartupInfo) );
00989     sStartupInfo.cb = sizeof( sStartupInfo );
00990     sStartupInfo.dwFlags = STARTF_USESHOWWINDOW;
00991     sStartupInfo.wShowWindow = SW_SHOWNORMAL;
00992
00993     if( !CreateProcess( NULL,
00994         (char*)command,
00995         NULL,
00996         NULL,
00997         FALSE,
00998         0,
00999         NULL,
01000         NULL,
01001         &sStartupInfo,
01002         &sProcessInformation) )
01003     {
01004         sProcessInformation.hProcess = INVALID_HANDLE_VALUE;
01005         sProcessInformation.hThread = INVALID_HANDLE_VALUE;
01006     }
01007
01008     *((PROCESS_INFORMATION*)par) = sProcessInformation;
01009     return sProcessInformation.hProcess != INVALID_HANDLE_VALUE;
01010 #endif /* WIN32 */
01011
01012 #ifdef qMacCvsPP
01013     return true;
01014 #endif /* qMacCvsPP */
01015
01016 #if qUnix
01017     return true;
01018 #endif // qUnix
01019 }

bool LaunchViewer | ( | const char * | fullpath,
 |  | bool | useDefault = false
 | ) |

Definition at line 869 of file CvsPrefs.cpp.

Referenced by CvsCmdAnnotateFiles, CBrowseFileView::EditSel, and CGraphView::OnQueryAnnotate.

00870 {
00871 #ifdef WIN32
00872     bool done = false;
00873
00874     if( !gCvsPrefs.UseViewerAlways() )
00875     {
00876         char viewer[_MAX_PATH];
00877         UStr buf;
00878         CStr uppath, folder;
00879         SplitPath(fullpath, uppath, folder);
00880
00881         HINSTANCE hInst = FindExecutable(fullpath, folder, viewer);
00882         if(!useDefault && (UINT)hInst >= 32)
00883         {
00884             // see Article ID: Q140724 for the problem desc of FindExecutable
00885             struct stat sb;
00886             HINSTANCE hInst;
00887             if (stat(viewer, &sb) != -1 && S_ISREG(sb.st_mode))
00888             {
00889                 CStr fullpathQuote;
00890                 if(strchr(fullpath, ' ') != 0L)
00891                 {
00892                     fullpathQuote << '\"';
00893                     fullpathQuote << fullpath;
00894                     fullpathQuote << '\"';
00895                 }
00896                 else
00897                     fullpathQuote = fullpath;
00898
00899                 hInst = ShellExecute(*AfxGetMainWnd(), "open", viewer, fullpathQuote,
00900                     folder, SW_SHOWDEFAULT);
00901             }
00902             else
00903                 hInst = ShellExecute(*AfxGetMainWnd(), "open", fullpath, 0L,
00904                     folder, SW_SHOWDEFAULT);
00905
00906             if((long)hInst < 32)
00907             {
00908                 cvs_err("Unable to open '%s' (error %d), using default viewer instead\n", (char *)fullpath, GetLastError());
00909             }
00910             else
00911                 done = true;
00912         }
00913     }
00914
00915     if(!done)
00916     {
00917         if(gCvsPrefs.Viewer() == 0L)
00918         {
00919             cvs_err("You need to define a default viewer for this file in the preferences\n");
00920             return false;
00921         }
00922
00923         const char * argv[3] = {0L, 0L, 0L};
00924         CStr program, file;
00925         if(strchr(gCvsPrefs.Viewer(), ' ') != 0L)
00926         {
00927             program << '\"';
00928             program << gCvsPrefs.Viewer();
00929             program << '\"';
00930         }
00931         else
00932             program = gCvsPrefs.Viewer();
00933         if(strchr(fullpath, ' ') != 0L)
00934         {
00935             file << '\"';
00936             file << fullpath;
00937             file << '\"';
00938         }
00939         else
00940             file = fullpath;
00941         argv[0] = program;
00942         argv[1] = file;
00943         int process = _spawnvp(_P_NOWAIT, gCvsPrefs.Viewer(), argv);
00944     }
00945
00946     return true;
00947 #endif /* WIN32 */
00948
00949 #ifdef qMacCvsPP
00950     return true;
00951 #endif /* qMacCvsPP */
00952
00953 #if qUnix
00954     return true;
00955 #endif // qUnix
00956 }

void MigrateCvsrootList ( )

Helper method to migrate into a single CMString for cvsroot history.

Definition at line 585 of file CvsPrefs.cpp.

00586 {
00587     for(int nIndex = 0; nIndex <= NUM_CVSROOT; nIndex++)
00588     {
00589         CStr cvsroot;
00590 #ifdef WIN32
00591         char tmp[20];
00592         sprintf(tmp, "P_Cvsroot%d", nIndex);
00593         BYTE* ppData;
00594         UINT pBytes = 0;
00595
00596         if( !AfxGetApp()->GetProfileBinary(PROFILE_NAME, tmp, &ppData, &pBytes) )
00597         {
00598             continue;
00599         }
00600
00601         cvsroot = (char*)ppData;
00602         delete ppData;
00603 #endif /* WIN32 */
00604
00605 #if qUnix
00606 #endif // qUnix
00607
00608 #if qMacCvsPP
00609 #endif // qMacCvsPP
00610
00611         if( !cvsroot.empty() )
00612         {
00613             gOldCvsroots.Insert(cvsroot);
00614         }
00615     }
00616 }

Variable Documentation

CvsPrefs gCvsPrefs

Definition at line 252 of file CvsPrefs.h.

CMString gOldCvsroots

Definition at line 91 of file CvsPrefs.h.

Generated on Sun Feb 24 01:21:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


DiffDlg.cpp File Reference

common/DiffDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "OptionalPropertySheet.h"
#include "DiffDlg.h"
#include "CvsPrefs.h"
#include "UpdateDlg.h"
#include "GetPrefs.h"

Include dependency graph for DiffDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

CPersistentBool | gUseExtDiff ("P_DiffUseExtDiff", false)
CPersistentBool | gIgnoreCase ("P_IgnoreCase", false)
CPersistentBool | gNoWhiteSpace ("P_NoWhiteSpace", false)
bool | CompatGetDiff (bool &noRecurs, bool &isDate1, bool &isDate2, UPStr &rev1, UPStr &rev2, bool &useExtDiff, bool &noWhiteSpace, bool &ignoreCase, bool allowExtDiff)

Function Documentation

bool CompatGetDiff | ( | bool & | noRecurs,
 |  | bool & | isDate1,
 |  | bool & | isDate2,
 |  | UPStr & | rev1,
 |  | UPStr & | rev2,
 |  | bool & | useExtDiff,
 |  | bool & | noWhiteSpace,
 |  | bool & | ignoreCase,
 |  | bool | allowExtDiff
 | ) |

Definition at line 476 of file DiffDlg.cpp.

References CPStr, COptionalPropertySheet::DoModal, EV_INIT_WIDGET, COptionalPropertySheet::GetHideCommandDlg, kUMainWidget, CDiff_MAIN::m_diff, CDiff_MAIN::m_extdiff, CDiff_MAIN::m_ignoreCase, CDiff_MAIN::m_isDate1, CDiff_MAIN::m_isDate2, CDiff_MAIN::m_norecurs, CDiff_MAIN::m_noWhiteSpace, CDiff_MAIN::m_rev1, CDiff_MAIN::m_rev2, CGetPrefs_GLOBALS::StoreValues, TRUE, UCreate_DiffDlg, and UEventSendMessage.

00480 {
00481     bool userHitOK = false;
00482
00483     static CPStr sLastRev1;
00484     static CPStr sLastRev2;
00485     static bool bNoWhiteSpace = false;
00486     static bool bIgnoreCase = false;
00487
00488     rev1 = "";
00489     rev2 = "";
00490     noRecurs = false;
00491     isDate1 = false;
00492     isDate2 = false;
00493     useExtDiff = (bool)gUseExtDiff;
00494     noWhiteSpace = bNoWhiteSpace;
00495     ignoreCase = bIgnoreCase;
00496     bool hasRev1 = false;
00497     bool hasRev2 = false;
00498
00499 #ifdef WIN32
00500     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgDiff(), "Diff settings");
00501     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00502     CDiff_MAIN page1(sLastRev1, sLastRev2, allowExtDiff, noWhiteSpace, ignoreCase);
00503     CGetPrefs_GLOBALS page2;
00504     pages.AddPage(&page1);
00505     pages.AddPage(&page2);
00506     if(pages.DoModal() == IDOK)
00507     {
00508         noRecurs = page1.m_norecurs == TRUE;
00509
00510         sLastRev1 = page1.m_rev1;
00511         sLastRev2 = page1.m_rev2;
00512         isDate1 = page1.m_isDate1 == TRUE;
00513         isDate2 = page1.m_isDate2 == TRUE;
00514         gUseExtDiff = page1.m_extdiff == TRUE;
00515
00516         if(page1.m_diff == 0)
00517         {
00518             hasRev1 = hasRev2 = false;
00519         }
00520         else if(page1.m_diff == 1)
00521         {
00522             hasRev1 = true;
00523             hasRev2 = false;
00524         }
00525         else
00526         {
00527             hasRev1 = true;
00528             hasRev2 = true;
00529         }
00530
00531         noWhiteSpace = page1.m_noWhiteSpace == TRUE;
00532         ignoreCase = page1.m_ignoreCase == TRUE;
00533
00534         page2.StoreValues();
00535         gCvsPrefs.SetHideCommandDlgDiff(pages.GetHideCommandDlg());
00536         userHitOK = true;
00537     }
00538 #endif /* WIN32 */
00539 #ifdef qMacCvsPP
00540     StDialogHandler theHandler(dlg_Diff, LCommander::GetTopCommander());
00541     LWindow *theDialog = theHandler.GetDialog();
00542     ThrowIfNil_(theDialog);
00543     static UInt16 sRuntimePanel = 1;
00544
00545     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00546         (theDialog->FindPaneByID(item_MultiViewPrefs));
00547     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00548
00549     multiView->SwitchToPanel(2);
00550     DoDataExchange_Globals(theDialog, true);
00551     multiView->SwitchToPanel(1);
00552     DoDataExchange_DiffMain(theDialog, noRecurs, isDate1, isDate2, sLastRev1, sLastRev2,
00553         hasRev1, hasRev2, true);
00554
00555     groupView->SetValue(sRuntimePanel);
00556     theDialog->Show();
00557     MessageT hitMessage;
00558     while (true)
00559     {       // Let DialogHandler process events
00560         hitMessage = theHandler.DoDialog();
00561
00562         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00563             break;
00564     }
00565     theDialog->Hide();
00566     sRuntimePanel = groupView->GetValue();
00567
00568     if(hitMessage == msg_OK)
00569     {
00570         multiView->SwitchToPanel(1);
00571         DoDataExchange_DiffMain(theDialog, noRecurs, isDate1, isDate2, sLastRev1, sLastRev2,
00572             hasRev1, hasRev2, false);
00573         multiView->SwitchToPanel(2);
00574         DoDataExchange_Globals(theDialog, false);
00575         userHitOK = true;
00576     }
00577 #endif /* qMacCvsPP */
00578 #if qUnix
00579     void *wid = UCreate_DiffDlg();
00580
00581     UCvsDiff *dlg = new UCvsDiff();
00582     UCvsDiff_MAIN *tab1 = new UCvsDiff_MAIN(sLastRev1, sLastRev2, allowExtDiff);
00583     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00584     dlg->AddPage(tab1, UCvsDiff::kTabGeneral, 0);
00585
00586     if(dlg->DoModal())
00587     {
00588         noRecurs = tab1->m_norecurs;
00589
00590
00591         noWhiteSpace = tab1->m_noWhiteSpace != 0;
00592         ignoreCase = tab1->m_ignoreCase != 0;
00593
00594         sLastRev1 = tab1->m_str1;
00595         sLastRev2 = tab1->m_str2;
00596         isDate1 = tab1->m_check1;
00597         isDate2 = tab1->m_check2;
00598         gUseExtDiff = tab1->m_extdiff;
00599         if(tab1->m_diff == 0)
00600         {
00601             hasRev1 = hasRev2 = false;
00602         }
00603         else if(tab1->m_diff == 1)
00604         {
00605             hasRev1 = true;
00606             hasRev2 = false;
00607         }
00608         else
00609         {
00610             hasRev1 = true;
00611             hasRev2 = true;
00612         }
00613
00614         userHitOK = true;
00615     }
00616
00617     delete dlg;
00618 #endif // qUnix
00619
00620     if(userHitOK)
00621     {
00622         if(hasRev1)
00623             rev1 = sLastRev1;
00624         if(hasRev2)
00625             rev2 = sLastRev2;
00626         useExtDiff = (bool)gUseExtDiff;
00627
00628         bNoWhiteSpace = noWhiteSpace;
00629         bIgnoreCase = ignoreCase;
00630
00631         gCvsPrefs.save();
00632     }
00633
00634     return userHitOK;
00635 }

CPersistentBool gIgnoreCase | ( | "P_IgnoreCase" | ,
 |  | false |
 | ) | [static]

CPersistentBool gNoWhiteSpace | ( | "P_NoWhiteSpace" | ,
 |  | false |
 | ) | [static]

CPersistentBool gUseExtDiff | ( | "P_DiffUseExtDiff" | ,
 |  | false |
 | ) | [static]

Generated on Sun Feb 24 01:21:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


DiffDlg.h File Reference

common/DiffDlg.h File Reference

#include "CPStr.h"
#include "SmartComboBox.h"

Include dependency graph for DiffDlg.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CDiff_MAIN

Defines

#define | AFX_DIFFDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Functions

bool | CompatGetDiff (bool &noRecurs, bool &isDate1, bool &isDate2, UPStr &rev1, UPStr &rev2, bool &useExtDiff, bool &noWhiteSpace, bool &ignoreCase, bool allowExtDiff=false)

Define Documentation

#define AFX_DIFFDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Definition at line 26 of file DiffDlg.h.

Function Documentation

bool CompatGetDiff | ( | bool & | noRecurs,
 |  | bool & | isDate1,
 |  | bool & | isDate2,
 |  | UPStr & | rev1,
 |  | UPStr & | rev2,
 |  | bool & | useExtDiff,
 |  | bool & | noWhiteSpace,
 |  | bool & | ignoreCase,
 |  | bool | allowExtDiff = false
 | ) |

Definition at line 476 of file DiffDlg.cpp.

Referenced by CvsCmdDiffFiles, and CvsCmdDiffFolder.

00480 {
00481     bool userHitOK = false;
00482
00483     static CPStr sLastRev1;
00484     static CPStr sLastRev2;
00485     static bool bNoWhiteSpace = false;
00486     static bool bIgnoreCase = false;
00487
00488     rev1 = "";
00489     rev2 = "";
00490     noRecurs = false;
00491     isDate1 = false;
00492     isDate2 = false;
00493     useExtDiff = (bool)gUseExtDiff;
00494     noWhiteSpace = bNoWhiteSpace;
00495     ignoreCase = bIgnoreCase;
00496     bool hasRev1 = false;
00497     bool hasRev2 = false;
00498
00499 #ifdef WIN32
00500     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgDiff(), "Diff settings");
00501     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00502     CDiff_MAIN page1(sLastRev1, sLastRev2, allowExtDiff, noWhiteSpace, ignoreCase);
00503     CGetPrefs_GLOBALS page2;
00504     pages.AddPage(&page1);
00505     pages.AddPage(&page2);
00506     if(pages.DoModal() == IDOK)
00507     {
00508         noRecurs = page1.m_norecurs == TRUE;
00509
00510         sLastRev1 = page1.m_rev1;
00511         sLastRev2 = page1.m_rev2;
00512         isDate1 = page1.m_isDate1 == TRUE;
00513         isDate2 = page1.m_isDate2 == TRUE;
00514         gUseExtDiff = page1.m_extdiff == TRUE;
00515
00516         if(page1.m_diff == 0)
00517         {
00518             hasRev1 = hasRev2 = false;
00519         }
00520         else if(page1.m_diff == 1)
00521         {
00522             hasRev1 = true;
00523             hasRev2 = false;
00524         }
00525         else
00526         {
00527             hasRev1 = true;
00528             hasRev2 = true;
00529         }
00530
00531         noWhiteSpace = page1.m_noWhiteSpace == TRUE;
00532         ignoreCase = page1.m_ignoreCase == TRUE;
00533
00534         page2.StoreValues();
00535         gCvsPrefs.SetHideCommandDlgDiff(pages.GetHideCommandDlg());
00536         userHitOK = true;
00537     }
00538 #endif /* WIN32 */
00539 #ifdef qMacCvsPP
00540     StDialogHandler theHandler(dlg_Diff, LCommander::GetTopCommander());
00541     LWindow *theDialog = theHandler.GetDialog();
00542     ThrowIfNil_(theDialog);
00543     static UInt16 sRuntimePanel = 1;
00544
00545     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00546         (theDialog->FindPaneByID(item_MultiViewPrefs));
00547     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00548
00549     multiView->SwitchToPanel(2);
00550     DoDataExchange_Globals(theDialog, true);
00551     multiView->SwitchToPanel(1);
00552     DoDataExchange_DiffMain(theDialog, noRecurs, isDate1, isDate2, sLastRev1, sLastRev2,
00553         hasRev1, hasRev2, true);
00554
00555     groupView->SetValue(sRuntimePanel);
00556     theDialog->Show();
00557     MessageT hitMessage;
00558     while (true)
00559     {       // Let DialogHandler process events
00560         hitMessage = theHandler.DoDialog();
00561
00562         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00563             break;
00564     }
00565     theDialog->Hide();
00566     sRuntimePanel = groupView->GetValue();
00567
00568     if(hitMessage == msg_OK)
00569     {
00570         multiView->SwitchToPanel(1);
00571         DoDataExchange_DiffMain(theDialog, noRecurs, isDate1, isDate2, sLastRev1, sLastRev2,
00572             hasRev1, hasRev2, false);
00573         multiView->SwitchToPanel(2);
00574         DoDataExchange_Globals(theDialog, false);
00575         userHitOK = true;
00576     }
00577 #endif /* qMacCvsPP */
00578 #if qUnix
00579     void *wid = UCreate_DiffDlg();
00580
00581     UCvsDiff *dlg = new UCvsDiff();
00582     UCvsDiff_MAIN *tab1 = new UCvsDiff_MAIN(sLastRev1, sLastRev2, allowExtDiff);
00583     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00584     dlg->AddPage(tab1, UCvsDiff::kTabGeneral, 0);
00585
00586     if(dlg->DoModal())
00587     {
00588         noRecurs = tab1->m_norecurs;
00589
00590
00591         noWhiteSpace = tab1->m_noWhiteSpace != 0;
00592         ignoreCase = tab1->m_ignoreCase != 0;
00593
00594         sLastRev1 = tab1->m_str1;
00595         sLastRev2 = tab1->m_str2;
00596         isDate1 = tab1->m_check1;
00597         isDate2 = tab1->m_check2;
00598         gUseExtDiff = tab1->m_extdiff;
00599         if(tab1->m_diff == 0)
00600         {
00601             hasRev1 = hasRev2 = false;
00602         }
00603         else if(tab1->m_diff == 1)
00604         {
00605             hasRev1 = true;
00606             hasRev2 = false;
00607         }
00608         else
00609         {
00610             hasRev1 = true;
00611             hasRev2 = true;
00612         }
00613
00614         userHitOK = true;
00615     }
00616
00617     delete dlg;
00618 #endif // qUnix
00619
00620     if(userHitOK)
00621     {
00622         if(hasRev1)
00623             rev1 = sLastRev1;
00624         if(hasRev2)
00625             rev2 = sLastRev2;
00626         useExtDiff = (bool)gUseExtDiff;
00627
00628         bNoWhiteSpace = noWhiteSpace;
00629         bIgnoreCase = ignoreCase;
00630
00631         gCvsPrefs.save();
00632     }
00633
00634     return userHitOK;
00635 }

Generated on Sun Feb 24 01:21:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


dll_garbage.c File Reference

common/dll_garbage.c File Reference

#include <stdio.h>
#include "dll_garbage.h"

Include dependency graph for dll_garbage.c:

Include dependency graph

Go to the source code of this file.

Compounds

struct | _frameRec
struct | DYN_LIST
struct | garbyRec
struct | poolRec

Defines

#define | AUTO_INITALIZE 0
#define | qRangeCheck 0
#define | platform_calloc(s1, s2) calloc(s1, s2)
#define | platform_malloc(s) malloc(s)
#define | platform_realloc(p, s) realloc(p, s)
#define | platform_free(p) free(p)
#define | GARBY_DEF_ALLOC 20
#define | GARBY_DEF_POOL 20
#define | MODULE_SIZE 8
#define | garbyFree(ptr) garby_free(ptr)
#define | garbyAlloc(ptr, line, file) garby_alloc(ptr)
#define | garbyRealloc(ptr, NewPtr, line, file) garby_realloc(ptr, NewPtr)

Typedefs

typedef _frameRec | frameRec
typedef DYN_LIST | DYN_LIST
typedef * | poolPtr
typedef * | garbyPtr

Functions

DYN_LIST * | listNew (int sizeOfCell, int numOfDefaultCell)
void | listFree (DYN_LIST *list)
void * | listAddCell (DYN_LIST *list)
int | GARBY_KEY (void *address)
void | garbyNew (void)
void | poolRemove (poolPtr collector, int reallyRemove, int verboseMemoryLeak, int *numLeaks)
void | garbyRemove (int verboseSummary, int verboseMemoryLeak)
void | setModule (char *where, const char *what)
void * | poolAlloc (poolPtr pool, void *ptr)
void * | poolFree (register poolPtr garb, void *ptr)
void * | garby_free (void *ptr)
void * | garby_alloc (void *ptr)
void * | garby_realloc (void *ptr, void *newptr)
void * | shl_malloc (size_t size)
void * | shl_calloc (size_t nmemb, size_t size)
void * | shl_realloc (void *ptr, size_t size)
void | shl_free (void *ptr)

Variables

garbyPtr | gGarbage = NULL

Define Documentation

#define AUTO_INITALIZE 0

Definition at line 46 of file dll_garbage.c.

#define GARBY_DEF_ALLOC 20

Definition at line 261 of file dll_garbage.c.

Referenced by garbyNew.

#define GARBY_DEF_POOL 20

Definition at line 262 of file dll_garbage.c.

Referenced by GARBY_KEY, garbyNew, and garbyRemove.

#define garbyAlloc | ( | ptr,
 |  | line,
 |  | file | ) | garby_alloc(ptr)

Definition at line 633 of file dll_garbage.c.

Referenced by shl_calloc, shl_malloc, and shl_realloc.

#define garbyFree ( ptr ) garby_free(ptr)

Definition at line 621 of file dll_garbage.c.

Referenced by shl_free, and shl_realloc.

#define garbyRealloc | ( | ptr,
 |  | NewPtr,
 |  | line,
 |  | file | ) | garby_realloc(ptr, NewPtr)

Definition at line 634 of file dll_garbage.c.

Referenced by shl_realloc.

#define MODULE_SIZE 8

Definition at line 263 of file dll_garbage.c.

Referenced by setModule.

#define platform_calloc | ( | s1,
 |  | s2 | ) | calloc(s1, s2)

Definition at line 93 of file dll_garbage.c.

Referenced by shl_calloc.

#define platform_free ( p ) free(p)

Definition at line 96 of file dll_garbage.c.

Referenced by garbyRemove, listFree, poolRemove, shl_free, and shl_realloc.

#define platform_malloc ( s ) malloc(s)

Definition at line 94 of file dll_garbage.c.

Referenced by garbyNew, listAddCell, listNew, shl_malloc, and shl_realloc.

#define platform_realloc | ( | p,
 |  | s | ) | realloc(p, s)

Definition at line 95 of file dll_garbage.c.

Referenced by shl_realloc.

#define qRangeCheck 0

Definition at line 52 of file dll_garbage.c.

Typedef Documentation

typedef struct DYN_LIST DYN_LIST

typedef struct _frameRec frameRec

typedef * garbyPtr

typedef * poolPtr

Function Documentation

void * garby_alloc ( void * ptr ) [static]

Definition at line 640 of file dll_garbage.c.

References GARBY_KEY, garbyNew, gGarbage, NULL, and poolAlloc.

Referenced by garby_realloc.

00642 {
00643 #if AUTO_INITALIZE
00644     if(gGarbage == 0L)
00645         garbyNew();
00646 #endif /* AUTO_INITALIZE */
00647
00648     if(gGarbage == NULL || ptr == NULL)
00649         return ptr;
00650
00651 #if qCvsDebug
00652     return poolAlloc(&gGarbage->pools[GARBY_KEY(ptr)], ptr, line, file);
00653 #else
00654     return poolAlloc(&gGarbage->pools[GARBY_KEY(ptr)], ptr);
00655 #endif
00656 }

void * garby_free ( void * ptr ) [static]

Definition at line 658 of file dll_garbage.c.

References GARBY_KEY, gGarbage, NULL, and poolFree.

Referenced by garby_realloc.

00659 {
00660     if(gGarbage == NULL || ptr == NULL)
00661         return ptr;
00662
00663     return poolFree(&gGarbage->pools[GARBY_KEY(ptr)], ptr);
00664 }

int GARBY_KEY ( void * address ) [static]

Definition at line 366 of file dll_garbage.c.

References GARBY_DEF_POOL.

Referenced by garby_alloc, and garby_free.

00367 {
00368     register unsigned long add = (unsigned long)address;
00369
00370     return (add >> 8) % GARBY_DEF_POOL;
00371 }

void * garby_realloc | ( | void * | ptr,
 |  | void * | newptr
 | ) | [static]

Definition at line 669 of file dll_garbage.c.

References garby_alloc, garby_free, garbyNew, and gGarbage.

00671 {
00672 #if AUTO_INITALIZE
00673     if(gGarbage == 0L)
00674         garbyNew();
00675 #endif /* AUTO_INITALIZE */
00676
00677     garby_free(ptr);
00678 #if qCvsDebug
00679     return garby_alloc(newptr, line, file);
00680 #else
00681     return garby_alloc(newptr);
00682 #endif
00683 }

void garbyNew ( void )

Definition at line 374 of file dll_garbage.c.

References exit, GARBY_DEF_ALLOC, GARBY_DEF_POOL, gGarbage, listNew, NULL, and platform_malloc.

Referenced by __cvs_initialize, garby_alloc, and garby_realloc.

00375 {
00376     int i;
00377
00378 #if AUTO_INITALIZE
00379     if(gGarbage != 0L)
00380         return;
00381 #endif /* AUTO_INITALIZE */
00382
00383     gGarbage = (garbyPtr) platform_malloc(sizeof(garbyRec));
00384     if(gGarbage == NULL)
00385     {
00386         fprintf(stderr, "failed to allocate %d bytes\n", sizeof(garbyRec));
00387         exit(-1);
00388     }
00389
00390 #if qRangeCheck
00391     for(i = 0; i < GARBY_DEF_POOL; i++)
00392     {
00393         gGarbage->pools[i].firstentry = NULL;
00394         gGarbage->pools[i].firstfree = NULL;
00395         gGarbage->pools[i].pool = 0L;
00396     }
00397 #endif /* qRangeCheck */
00398     for(i = 0; i < GARBY_DEF_POOL; i++)
00399     {
00400         gGarbage->pools[i].firstentry = NULL;
00401         gGarbage->pools[i].firstfree = NULL;
00402         gGarbage->pools[i].pool = listNew(sizeof(frameRec), GARBY_DEF_ALLOC);
00403     }
00404 }

void garbyRemove | ( | int | verboseSummary,
 |  | int | verboseMemoryLeak
 | ) |

Definition at line 444 of file dll_garbage.c.

References GARBY_DEF_POOL, gGarbage, NULL, platform_free, and poolRemove.

00445 {
00446     int i;
00447     int numLeaks = 0;
00448     int reallyRemove = !verboseSummary;
00449
00450     if(gGarbage == NULL)
00451         return;
00452
00453     for(i = 0; i < GARBY_DEF_POOL; i++)
00454         poolRemove(&gGarbage->pools[i], reallyRemove, verboseMemoryLeak, &numLeaks);
00455
00456     if(reallyRemove)
00457     {
00458         platform_free(gGarbage);
00459         gGarbage = NULL;
00460     }
00461
00462 #if qCvsDebug
00463     if(verboseSummary)
00464         fprintf(stderr, "\nGarbage collection : purged %d allocations\n", numLeaks);
00465 #endif
00466 }

void* listAddCell ( DYN_LIST * list ) [static]

Definition at line 340 of file dll_garbage.c.

References DYN_LIST::current, DYN_LIST::defaultnumcells, exit, DYN_LIST::next, NULL, DYN_LIST::numentries, platform_malloc, DYN_LIST::sizeofcell, and DYN_LIST::totpage.

Referenced by poolAlloc.

00341 {
00342     DYN_LIST *current;
00343
00344     current = list->current;
00345
00346     if(current->numentries == list->defaultnumcells)
00347     {
00348         current->next = (DYN_LIST *)platform_malloc(sizeof(DYN_LIST) + list->sizeofcell * list->defaultnumcells);
00349         if(current->next == NULL)
00350         {
00351             fprintf(stderr, "failed to allocate %d bytes\n", sizeof(DYN_LIST) + list->sizeofcell * list->defaultnumcells);
00352             exit(-1);
00353         }
00354
00355         current = current->next;
00356         current->numentries = 0;
00357         current->next = NULL;
00358         list->current = current;
00359         list->totpage++;
00360     }
00361
00362     return (char *)(current + 1) + current->numentries++ * list->sizeofcell;
00363 }

void listFree ( DYN_LIST * list ) [static]

Definition at line 326 of file dll_garbage.c.

References DYN_LIST::next, NULL, and platform_free.

Referenced by poolRemove.

00327 {
00328     DYN_LIST *ptc1, *ptc2;
00329
00330     ptc1 = list;
00331     while(ptc1 != NULL)
00332     {
00333         ptc2 = ptc1;
00334         ptc1 = ptc1->next;
00335         platform_free(ptc2);
00336     }
00337 }

DYN_LIST* listNew | ( | int | sizeOfCell,
 |  | int | numOfDefaultCell
 | ) | [static]

Definition at line 305 of file dll_garbage.c.

References DYN_LIST::current, DYN_LIST::defaultnumcells, exit, DYN_LIST::next, NULL, DYN_LIST::numentries, platform_malloc, DYN_LIST::sizeofcell, and DYN_LIST::totpage.

Referenced by garbyNew.

00306 {
00307     DYN_LIST *result;
00308
00309     result = (DYN_LIST *)platform_malloc(sizeof(DYN_LIST) + sizeOfCell * numOfDefaultCell);
00310     if(result == NULL)
00311     {
00312         fprintf(stderr, "failed to allocate %d bytes\n", sizeof(DYN_LIST) + sizeOfCell * numOfDefaultCell);
00313         exit(-1);
00314     }
00315
00316     result->numentries = result->totpage = 0;
00317     result->defaultnumcells = numOfDefaultCell;
00318     result->sizeofcell = sizeOfCell;
00319     result->next = NULL;
00320     result->current = result;
00321
00322     return result;
00323 }

void* poolAlloc | ( | poolPtr | pool,
 |  | void * | ptr
 | ) | [static]

Definition at line 527 of file dll_garbage.c.

References _frameRec::entry, listAddCell, _frameRec::next, NULL, and setModule.

Referenced by garby_alloc.

00529 {
00530     frameRec *newframe;
00531
00532     if(pool->firstfree != NULL)
00533     {
00534         /*
00535          * there is place already free inside collector
00536          */
00537         newframe = pool->firstfree;
00538         pool->firstfree = newframe->next;
00539     }
00540     else
00541     {
00542         /*
00543          * create a new entry into the pool
00544          */
00545         newframe = (frameRec *)listAddCell(pool->pool);
00546     }
00547
00548     newframe->entry = ptr;
00549     newframe->next = pool->firstentry;
00550     pool->firstentry = newframe;
00551
00552 #if qCvsDebug
00553     setModule(newframe->module, file);
00554     newframe->line = line;
00555 #endif
00556
00557     return ptr;
00558 }

void* poolFree | ( | register poolPtr | garb,
 |  | void * | ptr
 | ) | [static]

Definition at line 560 of file dll_garbage.c.

References _frameRec::entry, _frameRec::next, and NULL.

Referenced by garby_free.

00561 {
00562     frameRec *frame, *prev;
00563
00564     /*
00565      * if failed, collector is corrupted
00566      */
00567     frame = garb->firstentry;
00568     if(frame == NULL)
00569     {
00570 #ifdef macintosh
00571         /* only  on mac cause we are sure to intercept every allocations */
00572         fprintf(stderr, "panic ! memory collector is corrupted !\n");
00573         return NULL;
00574 #else /* !macintosh */
00575         return ptr;
00576 #endif /* !macintosh */
00577     }
00578
00579     /*
00580      * - we mark the entry to be free
00581      */
00582     if(frame->entry == ptr)
00583     {
00584         frame = garb->firstentry;
00585         garb->firstentry = frame->next;
00586     }
00587     else
00588     {
00589         prev = NULL;
00590         while(frame->entry != ptr)
00591         {
00592             prev = frame;
00593             frame = frame->next;
00594             /*
00595              * if failed, collector is corrupted
00596              */
00597             if(frame == NULL)
00598             {
00599 #ifdef macintosh
00600                 /* only  on mac cause we are sure to intercept every allocations */
00601                 fprintf(stderr, "panic ! memory collector is corrupted !\n");
00602                 return NULL;
00603 #else /* !macintosh */
00604                 return ptr;
00605 #endif /* !macintosh */
00606             }
00607         }
00608         prev->next = frame->next;
00609     }
00610
00611     /*
00612      * insert frame into free list
00613      */
00614     frame->next = garb->firstfree;
00615     garb->firstfree = frame;
00616
00617     return ptr;
00618 }

void poolRemove | ( | poolPtr | collector,
 |  | int | reallyRemove,
 |  | int | verboseMemoryLeak,
 |  | int * | numLeaks
 | ) | [static]

Definition at line 407 of file dll_garbage.c.

References _frameRec::entry, listFree, _frameRec::next, NULL, and platform_free.

Referenced by garbyRemove.

00408 {
00409     frameRec *frame = collector->firstentry;
00410
00411 #if qRangeCheck
00412     DYN_LIST *pool;
00413     if(reallyRemove)
00414     {
00415         collector->firstentry = 0L;
00416         collector->firstfree = 0L;
00417     }
00418 #endif /* qRangeCheck */
00419
00420     while(frame != NULL)
00421     {
00422 #if qCvsDebug
00423         if(verboseMemoryLeak)
00424             fprintf(stderr, "MEMORY LEAK!: %s line:%d\n", frame->module, frame->line);
00425 #endif
00426         if(reallyRemove)
00427             platform_free(frame->entry);
00428         frame = frame->next;
00429         (*numLeaks)++;
00430     }
00431     if(reallyRemove)
00432     {
00433 #if qRangeCheck
00434         pool = collector->pool;
00435         collector->pool = 0L;
00436         listFree(pool);
00437 #else /* !qRangeCheck */
00438         listFree(collector->pool);
00439 #endif /* !qRangeCheck */
00440     }
00441 }

void setModule | ( | char * | where,
 |  | const char * | what
 | ) | [static]

Definition at line 506 of file dll_garbage.c.

References MODULE_SIZE.

Referenced by poolAlloc.

00507 {
00508     int len, cp;
00509
00510     if(what == 0L)
00511     {
00512         strcpy(where, "Unknown");
00513         return;
00514     }
00515
00516     cp = len = strlen(what);
00517     if(len > (MODULE_SIZE - 1))
00518         cp = MODULE_SIZE - 1;
00519
00520     memcpy(where, what + len - cp, cp * sizeof(char));
00521     where[cp] = '\0';
00522 }

void* shl_calloc | ( | size_t | nmemb,
 |  | size_t | size
 | ) |

Definition at line 703 of file dll_garbage.c.

References garbyAlloc, NULL, and platform_calloc.

00705 {
00706     char *ptr;
00707
00708     if (nmemb == 0 || size == 0)
00709         return NULL;
00710
00711     ptr = (char *)platform_calloc(nmemb, size);
00712     return garbyAlloc(ptr, line, file);
00713 }

void shl_free ( void * ptr )

Definition at line 742 of file dll_garbage.c.

References garbyFree, NULL, and platform_free.

00743 {
00744     if (ptr != NULL)
00745         platform_free (garbyFree(ptr));
00746 }

void* shl_malloc ( size_t size )

Definition at line 688 of file dll_garbage.c.

References garbyAlloc, NULL, and platform_malloc.

00690 {
00691     char *ptr;
00692
00693     if (size == 0)
00694         return NULL;
00695
00696     ptr = (char *)platform_malloc(size);
00697     return garbyAlloc(ptr, line, file);
00698 }

void* shl_realloc | ( | void * | ptr,
 |  | size_t | size
 | ) |

Definition at line 718 of file dll_garbage.c.

References garbyAlloc, garbyFree, garbyRealloc, NULL, platform_free, platform_malloc, and platform_realloc.

00720 {
00721     char *Newptr;
00722
00723     if (ptr == NULL)
00724     {
00725         Newptr = (char *)platform_malloc(size);
00726         return garbyAlloc(Newptr, line, file);
00727     }
00728
00729     if (size == 0)
00730     {
00731         platform_free(garbyFree(ptr));
00732         return NULL;
00733     }
00734
00735     Newptr = (char *)platform_realloc(ptr, size);
00736     if(Newptr == ptr)
00737         return ptr;
00738
00739     return garbyRealloc(ptr, Newptr, line, file);
00740 }

Variable Documentation

garbyPtr gGarbage = NULL [static]

Definition at line 302 of file dll_garbage.c.

Referenced by garby_alloc, garby_free, garby_realloc, garbyNew, and garbyRemove.

Generated on Sun Feb 24 01:21:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


dll_garbage.h File Reference

common/dll_garbage.h File Reference

#include <stdlib.h>
#include <malloc.h>

Include dependency graph for dll_garbage.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | malloc shl_malloc
#define | calloc shl_calloc
#define | realloc shl_realloc
#define | free shl_free

Functions

void * | shl_calloc (size_t nmemb, size_t size)
void * | shl_malloc (size_t size)
void * | shl_realloc (void *ptr, size_t size)
void | shl_free (void *ptr)
void | garbyNew (void)
void | garbyRemove (int verboseSummary, int verboseMemoryLeak)

Define Documentation

#define calloc shl_calloc

Definition at line 46 of file dll_garbage.h.

Referenced by CCJHexEdit::SelInsert.

#define free shl_free

Definition at line 53 of file dll_garbage.h.

Referenced by _gp_console_destroy, _gp_getenv_destroy, _gp_quit_destroy, BrowserGetMultiFiles, closedir, cvs_process_destroy, cvs_process_open, CvsLogParse, disposeStr, fgetentent, FileTraverse, UStr::flush, UPStr::flush, free_dircontents, InitializeInterp, IsShellType, loadSettingsInternal, main, UWidget::OnComboAppend, MacroTraversal::OnFile, CWincvsView::OnKeyDown, CCommit_MAIN::OnTemplate, opendir, UStr::operator<<, ReadIgnoredFile, CvsArgs::reset, CCJHexEdit::SelDelete, CCJHexEdit::SelInsert, CCJHexEdit::SetData, Tag_Open, unmodified, wire_read_double, wire_read_string, awidget::~awidget, CAllHandlers::~CAllHandlers, CCustInvertTable::~CCustInvertTable, CStaticAllocT< char >::~CStaticAllocT, CTCLCvsConsole::~CTCLCvsConsole, CWincvsView::~CWincvsView, and UCvsConsole::~UCvsConsole.

#define malloc shl_malloc

Definition at line 45 of file dll_garbage.h.

Referenced by _gp_console_read, _gp_getenv_read, _gp_quit_read, CvsArgs::add, CStaticAllocT< char >::AdjustSize, BrowserGetMultiFiles, build_command, CTCLCvsConsole::CTCLCvsConsole, cvs_process_new, getstr, gp_console_write, gp_getenv_write, gp_quit_write, InitializeInterp, IsShellType, main, mystrdup, CWincvsView::OnKeyDown, opendir, UStr::operator<<, UStr::operator=, UPStr::operator=, CWincvsView::OutConsole, UCvsConsole::OutConsole, CvsArgs::reset, CCJHexEdit::SelDelete, UStr::set, UPStr::set, CCJHexEdit::SetData, strdup, unmodified, wire_read_string, and wire_register.

#define realloc shl_realloc

Definition at line 47 of file dll_garbage.h.

Referenced by CvsArgs::add, CStaticAllocT< char >::AdjustSize, CTCLCvsConsole::cvs_out, getstr, and UPStr::operator<<.

Function Documentation

void garbyNew ( void )

Definition at line 374 of file dll_garbage.c.

00375 {
00376     int i;
00377
00378 #if AUTO_INITALIZE
00379     if(gGarbage != 0L)
00380         return;
00381 #endif /* AUTO_INITALIZE */
00382
00383     gGarbage = (garbyPtr) platform_malloc(sizeof(garbyRec));
00384     if(gGarbage == NULL)
00385     {
00386         fprintf(stderr, "failed to allocate %d bytes\n", sizeof(garbyRec));
00387         exit(-1);
00388     }
00389
00390 #if qRangeCheck
00391     for(i = 0; i < GARBY_DEF_POOL; i++)
00392     {
00393         gGarbage->pools[i].firstentry = NULL;
00394         gGarbage->pools[i].firstfree = NULL;
00395         gGarbage->pools[i].pool = 0L;
00396     }
00397 #endif /* qRangeCheck */
00398     for(i = 0; i < GARBY_DEF_POOL; i++)
00399     {
00400         gGarbage->pools[i].firstentry = NULL;
00401         gGarbage->pools[i].firstfree = NULL;
00402         gGarbage->pools[i].pool = listNew(sizeof(frameRec), GARBY_DEF_ALLOC);
00403     }
00404 }

void garbyRemove | ( | int | verboseSummary,
 |  | int | verboseMemoryLeak
 | ) |

Definition at line 444 of file dll_garbage.c.

Referenced by __cvs_terminate, and flush_all.

00445 {
00446     int i;
00447     int numLeaks = 0;
00448     int reallyRemove = !verboseSummary;
00449
00450     if(gGarbage == NULL)
00451         return;
00452
00453     for(i = 0; i < GARBY_DEF_POOL; i++)
00454         poolRemove(&gGarbage->pools[i], reallyRemove, verboseMemoryLeak, &numLeaks);
00455
00456     if(reallyRemove)
00457     {
00458         platform_free(gGarbage);
00459         gGarbage = NULL;
00460     }
00461
00462 #if qCvsDebug
00463     if(verboseSummary)
00464         fprintf(stderr, "\nGarbage collection : purged %d allocations\n", numLeaks);
00465 #endif
00466 }

void* shl_calloc | ( | size_t | nmemb,
 |  | size_t | size
 | ) |

Definition at line 703 of file dll_garbage.c.

00705 {
00706     char *ptr;
00707
00708     if (nmemb == 0 || size == 0)
00709         return NULL;
00710
00711     ptr = (char *)platform_calloc(nmemb, size);
00712     return garbyAlloc(ptr, line, file);
00713 }

void shl_free ( void * ptr )

Definition at line 742 of file dll_garbage.c.

00743 {
00744     if (ptr != NULL)
00745         platform_free (garbyFree(ptr));
00746 }

void* shl_malloc ( size_t size )

Definition at line 688 of file dll_garbage.c.

00690 {
00691     char *ptr;
00692
00693     if (size == 0)
00694         return NULL;
00695
00696     ptr = (char *)platform_malloc(size);
00697     return garbyAlloc(ptr, line, file);
00698 }

void* shl_realloc | ( | void * | ptr,
 |  | size_t | size
 | ) |

Definition at line 718 of file dll_garbage.c.

00720 {
00721     char *Newptr;
00722
00723     if (ptr == NULL)
00724     {
00725         Newptr = (char *)platform_malloc(size);
00726         return garbyAlloc(Newptr, line, file);
00727     }
00728
00729     if (size == 0)
00730     {
00731         platform_free(garbyFree(ptr));
00732         return NULL;
00733     }
00734
00735     Newptr = (char *)platform_realloc(ptr, size);
00736     if(Newptr == ptr)
00737         return ptr;
00738
00739     return garbyRealloc(ptr, Newptr, line, file);
00740 }

Generated on Sun Feb 24 01:21:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


dll_glue.c File Reference

common/dll_glue.c File Reference

#include <unistd.h>
#include <stdio.h>
#include <setjmp.h>
#include <errno.h>
#include "dll_glue.h"
#include "dll_garbage.h"
#include "GUSIMSLSetup.h"

Include dependency graph for dll_glue.c:

Include dependency graph

Go to the source code of this file.

Functions

int | main (int argc, char **argv)
void | dllglue_flushconsole (void)
void | initialize_all (void)
void | flush_all (void)
void | dllglue_exit (int code)
char * | dllglue_getenv (const char *name)
long | dllglue_consoleout (char *buffer, long n)
long | dllglue_consoleerr (char *buffer, long n)
long | dllglue_consolein (char *buffer, long n)
int | dllglue_dispatchevent (EventRecord *userevent)
int | dllglue_main (const char *path, int argc, char **argv)
int | dllglue_decode_file (char *infile)
int | dllglue_setgetenv (UniversalProcPtr agetenv)
int | dllglue_seteventdispatch (UniversalProcPtr aeventdispatch)
int | dllglue_setconsoleout (UniversalProcPtr aconsoleout)
int | dllglue_setconsoleerr (UniversalProcPtr aconsoleerr)
int | dllglue_setconsolein (UniversalProcPtr aconsolein)
pascal OSErr | __initialize (CFragConnectionID connID)
pascal void | __terminate (void)
pascal OSErr | __cvs_initialize (const CFragInitBlock *theInitBlock)
pascal void | __cvs_terminate (void)

Variables

UniversalProcPtr | __glue_getenv = 0L
UniversalProcPtr | __glue_consoleout = 0L
UniversalProcPtr | __glue_consoleerr = 0L
UniversalProcPtr | __glue_consolein = 0L
UniversalProcPtr | __glue_eventdispatch = 0L
int | __glue_exit_code = 0
jmp_buf | _glue_buf
int | __no_msl_lf_convert
FSSpec sCvsContainerFileSpec

Function Documentation

pascal OSErr __cvs_initialize ( const CFragInitBlock * theInitBlock )

Definition at line 324 of file dll_glue.c.

References __initialize, garbyNew, and sCvsContainerFileSpec.

00325 {
00326     OSErr result = noErr;
00327
00328     if(CFragHasFileLocation(theInitBlock->fragLocator.where) &&
00329         theInitBlock->fragLocator.u.onDisk.fileSpec != 0L)
00330     {
00331         sCvsContainerFileSpec = *theInitBlock->fragLocator.u.onDisk.fileSpec;
00332     }
00333     garbyNew();
00334
00335     result = __initialize(theInitBlock->connectionID);
00336
00337     return result;
00338 }

pascal void __cvs_terminate ( void )

Definition at line 340 of file dll_glue.c.

References __terminate, and garbyRemove.

00341 {
00342     __terminate();
00343
00344     garbyRemove(false, false);
00345 }

pascal OSErr __initialize ( CFragConnectionID connID )

Referenced by __cvs_initialize.

pascal void __terminate ( void )

Referenced by __cvs_terminate.

long dllglue_consoleerr | ( | char * | buffer,
 |  | long | n
 | ) |

Definition at line 129 of file dll_glue.c.

References __glue_consoleerr.

Referenced by initialize_all.

00130 {
00131 #if !TARGET_API_MAC_CARBON
00132     if(__glue_consoleerr != 0L)
00133     {
00134         return (int)CallUniversalProc(__glue_consoleerr, uppConsoleOutProcInfo, buffer, n);
00135     }
00136 #else
00137     if(__glue_consoleerr != 0L)
00138     {
00139         return __glue_consoleerr(buffer, n);
00140     }
00141 #endif
00142     return 0;
00143 }

long dllglue_consolein | ( | char * | buffer,
 |  | long | n
 | ) |

Definition at line 145 of file dll_glue.c.

References __glue_consolein.

Referenced by initialize_all.

00146 {
00147 #if !TARGET_API_MAC_CARBON
00148     if(__glue_consolein != 0L)
00149     {
00150         return (int)CallUniversalProc(__glue_consolein, uppConsoleInProcInfo, buffer, n);
00151     }
00152 #else
00153     if(__glue_consolein != 0L)
00154     {
00155         return __glue_consolein(buffer, n);
00156     }
00157 #endif
00158     return 0;
00159 }

long dllglue_consoleout | ( | char * | buffer,
 |  | long | n
 | ) |

Definition at line 113 of file dll_glue.c.

References __glue_consoleout.

Referenced by initialize_all.

00114 {
00115 #if !TARGET_API_MAC_CARBON
00116     if(__glue_consoleout != 0L)
00117     {
00118         return (int)CallUniversalProc(__glue_consoleout, uppConsoleOutProcInfo, buffer, n);
00119     }
00120 #else
00121     if(__glue_consoleout != 0L)
00122     {
00123         return __glue_consoleout(buffer, n);
00124     }
00125 #endif
00126     return 0;
00127 }

int dllglue_decode_file ( char * infile )

Definition at line 202 of file dll_glue.c.

References __glue_exit_code, _glue_buf, flush_all, and initialize_all.

00203 {
00204     if(setjmp(_glue_buf) == 0)
00205     {
00206         initialize_all();
00207
00208         __glue_exit_code = decode_file (infile);
00209     }
00210     else
00211     {
00212     }
00213
00214     flush_all();
00215
00216     return __glue_exit_code;
00217 }

int dllglue_dispatchevent ( EventRecord * userevent )

Definition at line 161 of file dll_glue.c.

References __glue_eventdispatch.

Referenced by initialize_all.

00162 {
00163 #if !TARGET_API_MAC_CARBON
00164     if(__glue_eventdispatch != 0L)
00165     {
00166         return (int)CallUniversalProc(__glue_eventdispatch, uppEventDispatchProcInfo, userevent);
00167     }
00168 #else
00169     if(__glue_eventdispatch != 0L)
00170     {
00171         return __glue_eventdispatch(userevent);
00172     }
00173 #endif
00174     return 0;
00175 }

void dllglue_exit ( int code )

Definition at line 93 of file dll_glue.c.

References __glue_exit_code, and _glue_buf.

00094 {
00095     __glue_exit_code = code;
00096     longjmp(_glue_buf, 1);
00097 }

void dllglue_flushconsole ( void )

Definition at line 60 of file dll_glue.c.

Referenced by flush_all.

00061 {
00062     fflush(stdout);
00063     fflush(stderr);
00064 }

char* dllglue_getenv ( const char * name )

Definition at line 100 of file dll_glue.c.

References __glue_getenv.

00101 {
00102     if(__glue_getenv != 0L)
00103     {
00104 #if !TARGET_API_MAC_CARBON
00105         return (char *)CallUniversalProc(__glue_getenv, uppGetEnvProcInfo, name);
00106 #else /* TARGET_API_MAC_CARBON */
00107         return __glue_getenv(name);
00108 #endif /* TARGET_API_MAC_CARBON */
00109     }
00110     return 0L;
00111 }

int dllglue_main | ( | const char * | path,
 |  | int | argc,
 |  | char ** | argv
 | ) |

Definition at line 178 of file dll_glue.c.

References __glue_exit_code, _glue_buf, exit, flush_all, initialize_all, and main.

00179 {
00180     if(setjmp(_glue_buf) == 0)
00181     {
00182         initialize_all();
00183
00184         if(path != 0L && chdir(path) != 0)
00185         {
00186             fprintf(stderr, "Error: Unable to chdir %s (error %d)\n", path, errno);
00187             exit(1);
00188         }
00189
00190         main(argc, argv);
00191     }
00192     else
00193     {
00194     }
00195
00196     flush_all();
00197
00198     return __glue_exit_code;
00199 }

int dllglue_setconsoleerr ( UniversalProcPtr aconsoleerr )

Definition at line 276 of file dll_glue.c.

References __glue_consoleerr, and dllglue_consoleout_func.

00280 {
00281     if(__glue_consoleerr != 0L)
00282     {
00283 #if !TARGET_API_MAC_CARBON
00284         DisposeRoutineDescriptor(__glue_consoleerr);
00285 #endif /* !TARGET_API_MAC_CARBON */
00286         __glue_consoleerr = 0L;
00287     }
00288     __glue_consoleerr = aconsoleerr;
00289     return 0;
00290 }

int dllglue_setconsolein ( UniversalProcPtr aconsolein )

Definition at line 294 of file dll_glue.c.

References __glue_consolein, and dllglue_consolein_func.

00298 {
00299     if(__glue_consolein != 0L)
00300     {
00301 #if !TARGET_API_MAC_CARBON
00302         DisposeRoutineDescriptor(__glue_consolein);
00303 #endif /* !TARGET_API_MAC_CARBON */
00304         __glue_consolein = 0L;
00305     }
00306     __glue_consolein = aconsolein;
00307     return 0;
00308 }

int dllglue_setconsoleout ( UniversalProcPtr aconsoleout )

Definition at line 258 of file dll_glue.c.

References __glue_consoleout, and dllglue_consoleout_func.

00262 {
00263     if(__glue_consoleout != 0L)
00264     {
00265 #if !TARGET_API_MAC_CARBON
00266         DisposeRoutineDescriptor(__glue_consoleout);
00267 #endif /* !TARGET_API_MAC_CARBON */
00268         __glue_consoleout = 0L;
00269     }
00270     __glue_consoleout = aconsoleout;
00271     return 0;
00272 }

int dllglue_seteventdispatch ( UniversalProcPtr aeventdispatch )

Definition at line 239 of file dll_glue.c.

References __glue_eventdispatch.

00244 {
00245 #if !TARGET_API_MAC_CARBON
00246     if(__glue_eventdispatch != 0L)
00247     {
00248         DisposeRoutineDescriptor(__glue_eventdispatch);
00249         __glue_eventdispatch = 0L;
00250     }
00251 #endif
00252     __glue_eventdispatch = aeventdispatch;
00253     return 0;
00254 }

int dllglue_setgetenv ( UniversalProcPtr agetenv )

Definition at line 221 of file dll_glue.c.

References __glue_getenv, and dllglue_getenv_func.

00225 {
00226     if(__glue_getenv != 0L)
00227     {
00228 #if !TARGET_API_MAC_CARBON
00229         DisposeRoutineDescriptor(__glue_getenv);
00230 #endif /* !TARGET_API_MAC_CARBON */
00231         __glue_getenv = 0L;
00232     }
00233     __glue_getenv = agetenv;
00234     return 0;
00235 }

void flush_all ( void ) [static]

Definition at line 81 of file dll_glue.c.

References dllglue_flushconsole, dllglue_setconsoleerr, dllglue_setconsolein, dllglue_setconsoleout, dllglue_seteventdispatch, dllglue_setgetenv, and garbyRemove.

Referenced by dllglue_decode_file, and dllglue_main.

00082 {
00083     garbyRemove(true, false);
00084     dllglue_flushconsole();
00085     dllglue_setgetenv(0L);
00086     dllglue_setconsoleout(0L);
00087     dllglue_setconsoleerr(0L);
00088     dllglue_setconsolein(0L);
00089     dllglue_seteventdispatch(0L);
00090 }

void initialize_all ( void ) [static]

Definition at line 66 of file dll_glue.c.

References __no_msl_lf_convert, dllglue_consoleerr, dllglue_consolein, dllglue_consoleout, dllglue_dispatchevent, getenv, and NULL.

Referenced by dllglue_decode_file, and dllglue_main.

00067 {
00068     GusiMSLSetWriteConsole(dllglue_consoleout);
00069     GusiMSLSetErrConsole(dllglue_consoleerr);
00070     GusiMSLSetInConsole(dllglue_consolein);
00071     GusiMSLSetHandleEvent(dllglue_dispatchevent);
00072
00073     // create text files with the Unix LF (0x0A)
00074     // the default is CR on Classic/Carbon-CFM
00075     if(getenv("CVSUSEUNIXLF") != NULL)
00076     {
00077         __no_msl_lf_convert = 1;
00078     }
00079 }

int main | ( | int | argc,
 |  | char ** | argv
 | ) |

Variable Documentation

UniversalProcPtr __glue_consoleerr = 0L [static]

Definition at line 41 of file dll_glue.c.

Referenced by dllglue_consoleerr, and dllglue_setconsoleerr.

UniversalProcPtr __glue_consolein = 0L [static]

Definition at line 42 of file dll_glue.c.

Referenced by dllglue_consolein, and dllglue_setconsolein.

UniversalProcPtr __glue_consoleout = 0L [static]

Definition at line 40 of file dll_glue.c.

Referenced by dllglue_consoleout, and dllglue_setconsoleout.

UniversalProcPtr __glue_eventdispatch = 0L [static]

Definition at line 43 of file dll_glue.c.

Referenced by dllglue_dispatchevent, and dllglue_seteventdispatch.

int __glue_exit_code = 0 [static]

Definition at line 52 of file dll_glue.c.

Referenced by dllglue_decode_file, dllglue_exit, and dllglue_main.

UniversalProcPtr __glue_getenv = 0L [static]

Definition at line 39 of file dll_glue.c.

Referenced by dllglue_getenv, and dllglue_setgetenv.

int __no_msl_lf_convert

Definition at line 55 of file dll_glue.c.

Referenced by initialize_all.

jmp_buf _glue_buf [static]

Definition at line 53 of file dll_glue.c.

Referenced by dllglue_decode_file, dllglue_exit, and dllglue_main.

FSSpec sCvsContainerFileSpec

Definition at line 322 of file dll_glue.c.

Referenced by __cvs_initialize.

Generated on Sun Feb 24 01:21:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


dll_glue.h File Reference

common/dll_glue.h File Reference

#include <stdlib.h>
#include "dll_process.h"
#include <Events.h>

Include dependency graph for dll_glue.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | exit dllglue_exit
#define | getenv dllglue_getenv

Functions

int | dllglue_decode_file (char *infile)
int | dllglue_main (const char *path, int argc, char **argv)
int | dllglue_setgetenv (UniversalProcPtr agetenv)
int | dllglue_setconsoleout (UniversalProcPtr aconsoleout)
int | dllglue_setconsoleerr (UniversalProcPtr aconsoleerr)
int | dllglue_setconsolein (UniversalProcPtr aconsolein)
int | dllglue_seteventdispatch (UniversalProcPtr adispatch)
void | dllglue_exit (int code)
char * | dllglue_getenv (const char *)
int | dllglue_dispatchevent (EventRecord *userevent)
long | dllglue_consoleout (char *buffer, long n)
long | dllglue_consoleerr (char *buffer, long n)
long | dllglue_consolein (char *buffer, long n)
void | dllglue_flushconsole (void)

Define Documentation

#define exit dllglue_exit

Definition at line 57 of file dll_glue.h.

#define getenv dllglue_getenv

Definition at line 58 of file dll_glue.h.

Function Documentation

long dllglue_consoleerr | ( | char * | buffer,
 |  | long | n
 | ) |

Definition at line 129 of file dll_glue.c.

00130 {
00131 #if !TARGET_API_MAC_CARBON
00132     if(__glue_consoleerr != 0L)
00133     {
00134         return (int)CallUniversalProc(__glue_consoleerr, uppConsoleOutProcInfo, buffer, n);
00135     }
00136 #else
00137     if(__glue_consoleerr != 0L)
00138     {
00139         return __glue_consoleerr(buffer, n);
00140     }
00141 #endif
00142     return 0;
00143 }

long dllglue_consolein | ( | char * | buffer,
 |  | long | n
 | ) |

Definition at line 145 of file dll_glue.c.

00146 {
00147 #if !TARGET_API_MAC_CARBON
00148     if(__glue_consolein != 0L)
00149     {
00150         return (int)CallUniversalProc(__glue_consolein, uppConsoleInProcInfo, buffer, n);
00151     }
00152 #else
00153     if(__glue_consolein != 0L)
00154     {
00155         return __glue_consolein(buffer, n);
00156     }
00157 #endif
00158     return 0;
00159 }

long dllglue_consoleout | ( | char * | buffer,
 |  | long | n
 | ) |

Definition at line 113 of file dll_glue.c.

00114 {
00115 #if !TARGET_API_MAC_CARBON
00116     if(__glue_consoleout != 0L)
00117     {
00118         return (int)CallUniversalProc(__glue_consoleout, uppConsoleOutProcInfo, buffer, n);
00119     }
00120 #else
00121     if(__glue_consoleout != 0L)
00122     {
00123         return __glue_consoleout(buffer, n);
00124     }
00125 #endif
00126     return 0;
00127 }

int dllglue_decode_file ( char * infile )

Definition at line 202 of file dll_glue.c.

00203 {
00204     if(setjmp(_glue_buf) == 0)
00205     {
00206         initialize_all();
00207
00208         __glue_exit_code = decode_file (infile);
00209     }
00210     else
00211     {
00212     }
00213
00214     flush_all();
00215
00216     return __glue_exit_code;
00217 }

int dllglue_dispatchevent ( EventRecord * userevent )

Definition at line 161 of file dll_glue.c.

00162 {
00163 #if !TARGET_API_MAC_CARBON
00164     if(__glue_eventdispatch != 0L)
00165     {
00166         return (int)CallUniversalProc(__glue_eventdispatch, uppEventDispatchProcInfo, userevent);
00167     }
00168 #else
00169     if(__glue_eventdispatch != 0L)
00170     {
00171         return __glue_eventdispatch(userevent);
00172     }
00173 #endif
00174     return 0;
00175 }

void dllglue_exit ( int code )

Definition at line 93 of file dll_glue.c.

00094 {
00095     __glue_exit_code = code;
00096     longjmp(_glue_buf, 1);
00097 }

void dllglue_flushconsole ( void )

Definition at line 60 of file dll_glue.c.

00061 {
00062     fflush(stdout);
00063     fflush(stderr);
00064 }

char* dllglue_getenv ( const char * )

Definition at line 100 of file dll_glue.c.

00101 {
00102     if(__glue_getenv != 0L)
00103     {
00104 #if !TARGET_API_MAC_CARBON
00105         return (char *)CallUniversalProc(__glue_getenv, uppGetEnvProcInfo, name);
00106 #else /* TARGET_API_MAC_CARBON */
00107         return __glue_getenv(name);
00108 #endif /* TARGET_API_MAC_CARBON */
00109     }
00110     return 0L;
00111 }

int dllglue_main | ( | const char * | path,
 |  | int | argc,
 |  | char ** | argv
 | ) |

Definition at line 178 of file dll_glue.c.

00179 {
00180     if(setjmp(_glue_buf) == 0)
00181     {
00182         initialize_all();
00183
00184         if(path != 0L && chdir(path) != 0)
00185         {
00186             fprintf(stderr, "Error: Unable to chdir %s (error %d)\n", path, errno);
00187             exit(1);
00188         }
00189
00190         main(argc, argv);
00191     }
00192     else
00193     {
00194     }
00195
00196     flush_all();
00197
00198     return __glue_exit_code;
00199 }

int dllglue_setconsoleerr ( UniversalProcPtr aconsoleerr )

Definition at line 276 of file dll_glue.c.

Referenced by flush_all.

00280 {
00281     if(__glue_consoleerr != 0L)
00282     {
00283 #if !TARGET_API_MAC_CARBON
00284         DisposeRoutineDescriptor(__glue_consoleerr);
00285 #endif /* !TARGET_API_MAC_CARBON */
00286         __glue_consoleerr = 0L;
00287     }
00288     __glue_consoleerr = aconsoleerr;
00289     return 0;
00290 }

int dllglue_setconsolein ( UniversalProcPtr aconsolein )

Definition at line 294 of file dll_glue.c.

Referenced by flush_all.

00298 {
00299     if(__glue_consolein != 0L)
00300     {
00301 #if !TARGET_API_MAC_CARBON
00302         DisposeRoutineDescriptor(__glue_consolein);
00303 #endif /* !TARGET_API_MAC_CARBON */
00304         __glue_consolein = 0L;
00305     }
00306     __glue_consolein = aconsolein;
00307     return 0;
00308 }

int dllglue_setconsoleout ( UniversalProcPtr aconsoleout )

Definition at line 258 of file dll_glue.c.

Referenced by flush_all.

00262 {
00263     if(__glue_consoleout != 0L)
00264     {
00265 #if !TARGET_API_MAC_CARBON
00266         DisposeRoutineDescriptor(__glue_consoleout);
00267 #endif /* !TARGET_API_MAC_CARBON */
00268         __glue_consoleout = 0L;
00269     }
00270     __glue_consoleout = aconsoleout;
00271     return 0;
00272 }

int dllglue_seteventdispatch ( UniversalProcPtr adispatch )

Definition at line 239 of file dll_glue.c.

Referenced by flush_all.

00244 {
00245 #if !TARGET_API_MAC_CARBON
00246     if(__glue_eventdispatch != 0L)
00247     {
00248         DisposeRoutineDescriptor(__glue_eventdispatch);
00249         __glue_eventdispatch = 0L;
00250     }
00251 #endif
00252     __glue_eventdispatch = aeventdispatch;
00253     return 0;
00254 }

int dllglue_setgetenv ( UniversalProcPtr agetenv )

Definition at line 221 of file dll_glue.c.

Referenced by flush_all.

00225 {
00226     if(__glue_getenv != 0L)
00227     {
00228 #if !TARGET_API_MAC_CARBON
00229         DisposeRoutineDescriptor(__glue_getenv);
00230 #endif /* !TARGET_API_MAC_CARBON */
00231         __glue_getenv = 0L;
00232     }
00233     __glue_getenv = agetenv;
00234     return 0;
00235 }

Generated on Sun Feb 24 01:21:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


dll_loader.c File Reference

common/dll_loader.c File Reference

#include <windows.h>
#include <string.h>
#include "dll_loader.h"

Include dependency graph for dll_loader.c:

Include dependency graph

Go to the source code of this file.

Functions

int | CompatLoadLibrary (CompatConnectID *connID, const char *name_dll)
int | CompatCloseLibrary (CompatConnectID *connID)
void * | _CompatCallLibrary (CompatConnectID connID, const char *name_func)

Variables

void * | sCompatProc

Function Documentation

void* _CompatCallLibrary | ( | CompatConnectID | connID,
 |  | const char * | name_func
 | ) |

Definition at line 127 of file dll_loader.c.

References CompatConnectID.

00129 {
00130 #ifdef macintosh
00131     ProcPtr symAddr;
00132     UniversalProcPtr proc;
00133     Str255 pname;
00134
00135     c2pstrcpy(pname, name_func);
00136
00137     symAddr = getSymFunction(connID, pname);
00138 #   if TARGET_API_MAC_CARBON
00139     return symAddr;
00140 #   else
00141     if(symAddr == 0L)
00142         return 0L;
00143
00144     proc = NewRoutineDescriptor(symAddr, id_func, kPowerPCISA);
00145     return proc;
00146 #   endif
00147 #elif defined(WIN32)
00148     return GetProcAddress(connID, name_func);
00149 #else /* !WIN32 && !macintosh */
00150     return dynl_func(name_func, connID);
00151 #endif /* !WIN32 && !macintosh */
00152 }

int CompatCloseLibrary ( CompatConnectID * connID )

Definition at line 103 of file dll_loader.c.

References CompatConnectID.

00104 {
00105     if(connID == 0L)
00106         return 0;
00107
00108 #ifdef macintosh
00109     CloseConnection(connID);
00110     return 1;
00111 #elif defined(WIN32)
00112     FreeLibrary(*connID);
00113     connID = 0L;
00114     return 1;
00115 #else /* !WIN32 && !macintosh */
00116     dynl_unlink(*connID);
00117     connID = 0L;
00118     return 1;
00119 #endif /* !WIN32 && !macintosh */
00120 }

int CompatLoadLibrary | ( | CompatConnectID * | connID,
 |  | const char * | name_dll
 | ) |

Definition at line 76 of file dll_loader.c.

References CompatConnectID, and err.

00077 {
00078     if(connID == 0L)
00079         return 0;
00080
00081 #ifdef macintosh
00082     {
00083     OSErr err;
00084     Ptr mainAddr;
00085     Str255 errMessage;
00086     Str255 pname;
00087
00088     c2pstrcpy(pname, name_dll);
00089     err = GetSharedLibrary(pname, kPowerPCCFragArch, kPrivateCFragCopy, connID, &mainAddr, errMessage);
00090     return err == noErr;
00091     }
00092 #elif defined(WIN32)
00093     *connID = LoadLibrary(name_dll);
00094
00095     return (*connID) != 0L;
00096 #else /* !WIN32 && !macintosh */
00097     *connID = dynl_link(name_dll);
00098     return (*connID) != 0L;
00099 #endif /* !WIN32 && !macintosh */
00100 }

Variable Documentation

void* sCompatProc

Definition at line 45 of file dll_loader.c.

Generated on Sun Feb 24 01:21:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


dll_loader.h File Reference

common/dll_loader.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | CompatCallLibrary1(ID, res, idf, nf, tf, a1)
#define | CompatCallLibrary2(ID, res, idf, nf, tf, a1, a2)
#define | CompatCallLibrary3(ID, res, idf, nf, tf, a1, a2, a3)
#define | CompatFuncArg(funcInfo, func) func

Typedefs

typedef HINSTANCE | CompatConnectID

Functions

int | CompatLoadLibrary (CompatConnectID *connID, const char *name_dll)
int | CompatCloseLibrary (CompatConnectID *connID)
void * | _CompatCallLibrary (CompatConnectID connID, const char *name_func)

Variables

void * | sCompatProc

Define Documentation

#define CompatCallLibrary1 | ( | ID,
 |  | res,
 |  | idf,
 |  | nf,
 |  | tf,
 |  | a1 | )

Value:

( \
            sCompatProc = _CompatCallLibrary(ID, nf), \
            res = sCompatProc != NULL ? \
                ((tf)sCompatProc)(a1) : res, \
            sCompatProc != NULL \
        )

Definition at line 83 of file dll_loader.h.

#define CompatCallLibrary2 | ( | ID,
 |  | res,
 |  | idf,
 |  | nf,
 |  | tf,
 |  | a1,
 |  | a2 | )

Value:

( \
            sCompatProc = _CompatCallLibrary(ID, nf), \
            res = sCompatProc != NULL ? \
                ((tf)sCompatProc)(a1, a2) : res, \
            sCompatProc != NULL \
        )

Definition at line 90 of file dll_loader.h.

#define CompatCallLibrary3 | ( | ID,
 |  | res,
 |  | idf,
 |  | nf,
 |  | tf,
 |  | a1,
 |  | a2,
 |  | a3 | )

Value:

( \
            sCompatProc = _CompatCallLibrary(ID, nf), \
            res = sCompatProc != NULL ? \
                ((tf)sCompatProc)(a1, a2, a3) : res, \
            sCompatProc != NULL \
        )

Definition at line 97 of file dll_loader.h.

Referenced by launchCVS.

#define CompatFuncArg | ( | funcInfo,
 |  | func | ) | func

Definition at line 115 of file dll_loader.h.

Typedef Documentation

typedef HINSTANCE CompatConnectID

Definition at line 32 of file dll_loader.h.

Referenced by _CompatCallLibrary, CompatCloseLibrary, CompatLoadLibrary, CTcl_Interp::IsAvail, CPython_Interp::IsAvail, and launchCVS.

Function Documentation

void* _CompatCallLibrary | ( | CompatConnectID | connID,
 |  | const char * | name_func
 | ) |

Definition at line 127 of file dll_loader.c.

00129 {
00130 #ifdef macintosh
00131     ProcPtr symAddr;
00132     UniversalProcPtr proc;
00133     Str255 pname;
00134
00135     c2pstrcpy(pname, name_func);
00136
00137     symAddr = getSymFunction(connID, pname);
00138 #   if TARGET_API_MAC_CARBON
00139     return symAddr;
00140 #   else
00141     if(symAddr == 0L)
00142         return 0L;
00143
00144     proc = NewRoutineDescriptor(symAddr, id_func, kPowerPCISA);
00145     return proc;
00146 #   endif
00147 #elif defined(WIN32)
00148     return GetProcAddress(connID, name_func);
00149 #else /* !WIN32 && !macintosh */
00150     return dynl_func(name_func, connID);
00151 #endif /* !WIN32 && !macintosh */
00152 }

int CompatCloseLibrary ( CompatConnectID * connID )

Definition at line 103 of file dll_loader.c.

References CompatConnectID.

00104 {
00105     if(connID == 0L)
00106         return 0;
00107
00108 #ifdef macintosh
00109     CloseConnection(connID);
00110     return 1;
00111 #elif defined(WIN32)
00112     FreeLibrary(*connID);
00113     connID = 0L;
00114     return 1;
00115 #else /* !WIN32 && !macintosh */
00116     dynl_unlink(*connID);
00117     connID = 0L;
00118     return 1;
00119 #endif /* !WIN32 && !macintosh */
00120 }

int CompatLoadLibrary | ( | CompatConnectID * | connID,
 |  | const char * | name_dll
 | ) |

Definition at line 76 of file dll_loader.c.

References CompatConnectID.

Referenced by CTcl_Interp::IsAvail, and CPython_Interp::IsAvail.

00077 {
00078     if(connID == 0L)
00079         return 0;
00080
00081 #ifdef macintosh
00082     {
00083     OSErr err;
00084     Ptr mainAddr;
00085     Str255 errMessage;
00086     Str255 pname;
00087
00088     c2pstrcpy(pname, name_dll);
00089     err = GetSharedLibrary(pname, kPowerPCCFragArch, kPrivateCFragCopy, connID, &mainAddr, errMessage);
00090     return err == noErr;
00091     }
00092 #elif defined(WIN32)
00093     *connID = LoadLibrary(name_dll);
00094
00095     return (*connID) != 0L;
00096 #else /* !WIN32 && !macintosh */
00097     *connID = dynl_link(name_dll);
00098     return (*connID) != 0L;
00099 #endif /* !WIN32 && !macintosh */
00100 }

Variable Documentation

void* sCompatProc

Definition at line 82 of file dll_loader.h.

Generated on Sun Feb 24 01:21:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


dll_process.h File Reference

common/dll_process.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Typedefs

typedef char *(* | dllglue_getenv_func )(const char *)
typedef long(* | dllglue_consoleout_func )(char *, long)
typedef long(* | dllglue_consolein_func )(char *, long)
typedef int(* | dllglue_main_func )(const char *, int, char **)
typedef int(* | dllglue_setglue_func )(void *)

Typedef Documentation

typedef long(* dllglue_consolein_func)(char *, long)

Definition at line 86 of file dll_process.h.

Referenced by dllglue_setconsolein.

typedef long(* dllglue_consoleout_func)(char *, long)

Definition at line 85 of file dll_process.h.

Referenced by dllglue_setconsoleerr, and dllglue_setconsoleout.

typedef char*(* dllglue_getenv_func)(const char *)

Definition at line 84 of file dll_process.h.

Referenced by dllglue_setgetenv.

typedef int(* dllglue_main_func)(const char *, int, char**)

Definition at line 87 of file dll_process.h.

Referenced by launchCVS.

typedef int(* dllglue_setglue_func)(void *)

Definition at line 88 of file dll_process.h.

Generated on Sun Feb 24 01:21:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


EditorMonDlg.cpp File Reference

common/EditorMonDlg.cpp File Reference

#include "stdafx.h"
#include "CvsPrefs.h"
#include "TextBinary.h"
#include "wincvs.h"
#include "EditorMonDlg.h"

Include dependency graph for EditorMonDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool CompatGetEditorMsg (UStr &message)

Function Documentation

bool CompatGetEditorMsg ( UStr & message )

Definition at line 110 of file EditorMonDlg.cpp.

References CStr, LaunchEditor, CEditorMonDlg::m_hProcess, CEditorMonDlg::m_tempFile, MakeTmpFile, and SplitPath.

00111 {
00112     bool msgOK = false;
00113
00114 #ifdef WIN32
00115
00116     if(gCvsPrefs.Viewer() == 0L)
00117     {
00118         AfxMessageBox("You need to define a default viewer in the preferences", MB_OK | MB_ICONSTOP);
00119         return msgOK;
00120     }
00121
00122     CStr tmpFile;
00123     if( MakeTmpFile(tmpFile, "LogMsg", "tmp", true) )
00124     {
00125         //launch editor
00126         PROCESS_INFORMATION sProcessInformation;
00127         if( LaunchEditor( tmpFile, (void*)&sProcessInformation ) )
00128         {
00129             //we don't need the thread's handle so close it now
00130             CloseHandle( sProcessInformation.hThread );
00131
00132             //track the editor until it closes
00133             CStr uppath, folder;
00134             SplitPath(tmpFile, uppath, folder);
00135
00136             CEditorMonDlg editorMonDlg;
00137             editorMonDlg.m_hProcess = sProcessInformation.hProcess;
00138             editorMonDlg.m_tempFile = folder;
00139
00140             if( editorMonDlg.DoModal() == IDOK )
00141             {
00142                 msgOK = true;
00143             }
00144             else
00145             {
00146                 if( PostThreadMessage(sProcessInformation.dwThreadId, WM_QUIT, (WPARAM)EXIT_SUCCESS, 0) )
00147                 {
00148                     WaitForSingleObject( sProcessInformation.hProcess, 500 );
00149                 }
00150
00151                 int nStatus = WaitForSingleObject( sProcessInformation.hProcess, 0 );
00152                 if( nStatus != WAIT_OBJECT_0 )
00153                 {
00154                     TerminateProcess(sProcessInformation.hProcess, EXIT_SUCCESS);
00155                 }
00156             }
00157
00158             CloseHandle(sProcessInformation.hProcess);
00159         }
00160
00161         //copy the file into message string
00162         FILE* stream = fopen(tmpFile, "r");
00163         if( stream )
00164         {
00165             char line[100];
00166             while( fgets(line, 100, stream) )
00167             {
00168                 message << line;
00169             }
00170             fclose(stream);
00171         }
00172
00173         //cleanup
00174         ::DeleteFile(tmpFile);
00175     }
00176
00177 #if 0
00178     adminOptionDlg.m_optionString = (const char*)optionString;
00179     if( adminOptionDlg.DoModal() == IDOK )
00180     {
00181         optionString = (const char*)adminOptionDlg.m_optionString;
00182         userHitOK = true;
00183     }
00184 #endif
00185
00186 #endif /* WIN32 */
00187
00188 // the code below might help to do stuff on Unix or Mac later on
00189 #if 0
00190     const char * argv[2] = { 0L, 0L };
00191     CStr program;
00192     if(strchr(gCvsPrefs.Viewer(), ' ') != 0L)
00193     {
00194         program << '\"';
00195         program << gCvsPrefs.Viewer();
00196         program << '\"';
00197     }
00198     else
00199         program = gCvsPrefs.Viewer();
00200
00201     argv[0] = program;
00202     int process = _spawnvp(_P_NOWAIT, gCvsPrefs.Viewer(), argv);
00203 #endif
00204
00205
00206 #ifdef qMacCvsPP
00207 #endif /* qMacCvsPP */
00208 #if qUnix
00209 #endif // qUnix
00210
00211     return msgOK;
00212 }

Generated on Sun Feb 24 01:21:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


EditorMonDlg.h File Reference

common/EditorMonDlg.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CEditorMonDlg

Defines

#define | AFX_EDITORMONDLG_H__5146BF16_567B_4017_A1FD_619A7BD07906__INCLUDED_

Functions

bool | CompatGetEditorMsg (UStr &message)

Define Documentation

#define AFX_EDITORMONDLG_H__5146BF16_567B_4017_A1FD_619A7BD07906__INCLUDED_

Definition at line 26 of file EditorMonDlg.h.

Function Documentation

bool CompatGetEditorMsg ( UStr & message )

Definition at line 110 of file EditorMonDlg.cpp.

Referenced by CCommit_MAIN::OnLauncheditor.

00111 {
00112     bool msgOK = false;
00113
00114 #ifdef WIN32
00115
00116     if(gCvsPrefs.Viewer() == 0L)
00117     {
00118         AfxMessageBox("You need to define a default viewer in the preferences", MB_OK | MB_ICONSTOP);
00119         return msgOK;
00120     }
00121
00122     CStr tmpFile;
00123     if( MakeTmpFile(tmpFile, "LogMsg", "tmp", true) )
00124     {
00125         //launch editor
00126         PROCESS_INFORMATION sProcessInformation;
00127         if( LaunchEditor( tmpFile, (void*)&sProcessInformation ) )
00128         {
00129             //we don't need the thread's handle so close it now
00130             CloseHandle( sProcessInformation.hThread );
00131
00132             //track the editor until it closes
00133             CStr uppath, folder;
00134             SplitPath(tmpFile, uppath, folder);
00135
00136             CEditorMonDlg editorMonDlg;
00137             editorMonDlg.m_hProcess = sProcessInformation.hProcess;
00138             editorMonDlg.m_tempFile = folder;
00139
00140             if( editorMonDlg.DoModal() == IDOK )
00141             {
00142                 msgOK = true;
00143             }
00144             else
00145             {
00146                 if( PostThreadMessage(sProcessInformation.dwThreadId, WM_QUIT, (WPARAM)EXIT_SUCCESS, 0) )
00147                 {
00148                     WaitForSingleObject( sProcessInformation.hProcess, 500 );
00149                 }
00150
00151                 int nStatus = WaitForSingleObject( sProcessInformation.hProcess, 0 );
00152                 if( nStatus != WAIT_OBJECT_0 )
00153                 {
00154                     TerminateProcess(sProcessInformation.hProcess, EXIT_SUCCESS);
00155                 }
00156             }
00157
00158             CloseHandle(sProcessInformation.hProcess);
00159         }
00160
00161         //copy the file into message string
00162         FILE* stream = fopen(tmpFile, "r");
00163         if( stream )
00164         {
00165             char line[100];
00166             while( fgets(line, 100, stream) )
00167             {
00168                 message << line;
00169             }
00170             fclose(stream);
00171         }
00172
00173         //cleanup
00174         ::DeleteFile(tmpFile);
00175     }
00176
00177 #if 0
00178     adminOptionDlg.m_optionString = (const char*)optionString;
00179     if( adminOptionDlg.DoModal() == IDOK )
00180     {
00181         optionString = (const char*)adminOptionDlg.m_optionString;
00182         userHitOK = true;
00183     }
00184 #endif
00185
00186 #endif /* WIN32 */
00187
00188 // the code below might help to do stuff on Unix or Mac later on
00189 #if 0
00190     const char * argv[2] = { 0L, 0L };
00191     CStr program;
00192     if(strchr(gCvsPrefs.Viewer(), ' ') != 0L)
00193     {
00194         program << '\"';
00195         program << gCvsPrefs.Viewer();
00196         program << '\"';
00197     }
00198     else
00199         program = gCvsPrefs.Viewer();
00200
00201     argv[0] = program;
00202     int process = _spawnvp(_P_NOWAIT, gCvsPrefs.Viewer(), argv);
00203 #endif
00204
00205
00206 #ifdef qMacCvsPP
00207 #endif /* qMacCvsPP */
00208 #if qUnix
00209 #endif // qUnix
00210
00211     return msgOK;
00212 }

Generated on Sun Feb 24 01:22:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


FileTraversal.cpp File Reference

common/FileTraversal.cpp File Reference

#include "stdafx.h"
#include "resource.h"
#include "FileTraversal.h"
#include "CPStr.h"
#include "umain.h"
#include "AppConsole.h"
#include "wincvsdebug.h"

Include dependency graph for FileTraversal.cpp:

Include dependency graph

Go to the source code of this file.

Functions

kTraversal FileTraverse (const char *path, TraversalReport &report, const FSSpec *macDirSpec)

Function Documentation

kTraversal FileTraverse | ( | const char * | path,
 |  | TraversalReport & | report,
 |  | const FSSpec * | macDirSpec
 | ) |

Definition at line 97 of file FileTraversal.cpp.

References AppendWinCvsDebugMask, closedir, CStr, cvs_err, TraversalReport::EnterDirectory, TraversalReport::ExitDirectory, FileTraverse, free, GetWinCvsDebugMask, TraversalReport::gRunning, USemaphore::IsEnteredTwice, kContinueTraversal, kSkipFile, kTraversal, MAX_PATH, NULL, TraversalReport::OnAlias, TraversalReport::OnDirectory, TraversalReport::OnError, TraversalReport::OnFile, TraversalReport::OnIdle, opendir, readdir, SetWinCvsDebugMask, stat, STRUCT_DIRENT, UFSSpec, wcvsdbg_trace_dst_checks, wcvsdbg_trace_modified_checks, wcvsdbg_trace_stat, and wcvsdbg_verbose.

00098 {
00099     DIR *dirp = 0L;
00100     STRUCT_DIRENT *dp;
00101     struct stat sb;
00102     CStr fullname, errstr, dirname, tmpname;
00103     kTraversal res = kContinueTraversal;
00104     char *tmp;
00105     const UFSSpec *macspec = 0L;
00106 #if defined(WIN32)
00107     unsigned long dbg_mask = GetWinCvsDebugMask(false);
00108     CStr tracestr;
00109 #endif
00110
00111     // used to restore the current directory
00112     static bool getPathFlag = false;
00113     char* szOriginalPath = NULL;
00114     USemaphore policeman(getPathFlag);
00115     USemaphore runstate(TraversalReport::gRunning);
00116
00117     if(!policeman.IsEnteredTwice())
00118     {
00119         szOriginalPath = getcwd(NULL, MAX_PATH);
00120     }
00121
00122 #if !TARGET_OS_MAC
00123     if(path == 0L || (dirp = opendir(path)) == 0L)
00124 #elif TARGET_RT_MAC_CFM
00125     GUSIFileSpec folderspec;
00126     UFSSpec foldermacspec;
00127     if(macDirSpec != 0L)
00128         folderspec = *macDirSpec;
00129     else if(path != 0L)
00130         folderspec = path;
00131     foldermacspec = folderspec;
00132     macspec = &foldermacspec;
00133
00134     if((dirp = opendir(folderspec)) == 0L)
00135 #else
00136     FSRef foldermacspec;
00137     if(macDirSpec != 0L)
00138         foldermacspec = *macDirSpec;
00139     else if(path != 0L)
00140         FSPathMakeRef(posix_to_utf8(path), &foldermacspec, NULL);
00141     macspec = &foldermacspec;
00142     if(path == 0L || (dirp = opendir(path)) == 0L)
00143 #endif
00144     {
00145         errstr = "Error while accessing ";
00146         errstr << path;
00147         errstr << " (error " << errno << ')';
00148         res =  report.OnError(errstr, errno);
00149         goto exit;
00150     }
00151
00152     tmpname = path;
00153     tmp = tmpname;
00154     char *next;
00155     if(tmpname.endsWith(kPathDelimiter))
00156         tmp[strlen(tmp) - 1] = '\0';
00157     next = tmp;
00158     while((tmp = strchr(next, kPathDelimiter)) != 0L)
00159     {
00160         next = ++tmp;
00161     }
00162     dirname = next;
00163
00164     res = report.EnterDirectory(path, dirname, macspec);
00165     if(res != kContinueTraversal)
00166         goto abort;
00167
00168     while ((dp = readdir (dirp)) != NULL)
00169     {
00170         res = report.OnIdle(path);
00171         if(res != kContinueTraversal)
00172             goto abort;
00173
00174 #if !TARGET_RT_MAC_CFM
00175         if(strcmp(dp->d_name, ".") == 0 || strcmp(dp->d_name, "..") == 0)
00176             continue;
00177 #endif /* !TARGET_RT_MAC_CFM */
00178
00179         fullname = path;
00180         if(!fullname.endsWith(kPathDelimiter))
00181             fullname << kPathDelimiter;
00182         fullname << dp->d_name;
00183
00184         macspec = 0L;
00185         int statres;
00186
00187 #if TARGET_RT_MAC_CFM
00188         GUSIFileSpec inspec(folderspec);
00189         inspec += dp->d_name;
00190         UFSSpec infspec = inspec;
00191         macspec = &infspec;
00192
00193         statres = stat(inspec, &sb);
00194 #elif TARGET_RT_MAC_MACHO
00195         FSRef infspec;
00196         FSPathMakeRef(posix_to_utf8(fullname.c_str()), &infspec, NULL);
00197         macspec = &infspec;
00198
00199         statres = stat(fullname, &sb);
00200 #else
00201 #   if defined(WIN32)
00202         if ( (dbg_mask & wcvsdbg_trace_modified_checks) && (dbg_mask & wcvsdbg_verbose) )
00203         {
00204             AppendWinCvsDebugMask(wcvsdbg_trace_dst_checks
00205                                     | wcvsdbg_trace_stat);
00206             tracestr = "Stat(";
00207             tracestr << static_cast<const char *>(fullname);
00208             tracestr << ") ...\n";
00209             cvs_err(tracestr);
00210             OutputDebugString(tracestr);
00211         }
00212 #   endif   // defined(WIN32)
00213
00214         statres = stat(fullname, &sb);
00215 #endif
00216
00217         if (statres != -1)
00218         {
00219             if(S_ISDIR(sb.st_mode))
00220             {
00221                 res = report.OnDirectory(path, fullname, dp->d_name, sb, macspec);
00222
00223                 if(res == kSkipFile)
00224                     continue;
00225                 if(res != kContinueTraversal)
00226                     goto abort;
00227
00228                 res = FileTraverse(fullname, report, macspec);
00229                 if(res != kContinueTraversal)
00230                     goto abort;
00231
00232             }
00233             else if(S_ISREG(sb.st_mode))
00234             {
00235                 res = report.OnFile(path, fullname, dp->d_name, sb, macspec);
00236                 if(res == kSkipFile)
00237                     continue;
00238                 if(res != kContinueTraversal)
00239                     goto abort;
00240             }
00241 #ifdef S_ISLNK
00242             else if(S_ISLNK(sb.st_mode))
00243             {
00244                 res = report.OnAlias(path, fullname, dp->d_name, sb, macspec);
00245                 if(res == kSkipFile)
00246                     continue;
00247                 if(res != kContinueTraversal)
00248                     goto abort;
00249             }
00250 #endif /* S_ISLNK */
00251             else
00252             {
00253                 /* TODO : Unix devices */
00254                 errstr = "Error while accessing ";
00255                 errstr << fullname;
00256                 errstr << " (error " << errno << ')';
00257                 res = report.OnError(errstr, errno);
00258                 goto abort;
00259             }
00260         }
00261         else
00262         {
00263             errstr = "Error while accessing ";
00264             errstr << fullname;
00265             errstr << " (error " << errno << ')';
00266             res = report.OnError(errstr, errno);
00267             goto abort;
00268         }
00269     }
00270
00271     res = report.ExitDirectory(path);
00272
00273 abort:
00274     closedir (dirp);
00275 exit:
00276     if(0L != szOriginalPath)
00277     {
00278 #if !TARGET_RT_MAC_CFM
00279         chdir(szOriginalPath);
00280 #endif
00281         free(szOriginalPath);
00282         szOriginalPath = NULL;
00283     }
00284
00285 #if defined(WIN32)
00286     SetWinCvsDebugMask(dbg_mask);
00287 #endif  // defined(WIN32)
00288
00289     return res;
00290 }

Generated on Sun Feb 24 01:22:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


FileTraversal.h File Reference

common/FileTraversal.h File Reference

#include "TextBinary.h"
#include <sys/stat.h>
#include "ndir.h"
#include <direct.h>

Include dependency graph for FileTraversal.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | TraversalReport

Defines

#define | AFX_FILETRAVERSAL_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_
#define | MAX_PATH 5000
#define | STRUCT_DIRENT struct direct

Enumerations

enum kTraversal {
kContinueTraversal,
kStopTraversal,
kSkipFile,
kTraversalError
}

Functions

kTraversal | FileTraverse (const char *path, TraversalReport &report, const FSSpec *macDirSpec=0L)

Define Documentation

#define AFX_FILETRAVERSAL_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Definition at line 26 of file FileTraversal.h.

#define MAX_PATH 5000

Definition at line 64 of file FileTraversal.h.

Referenced by BrowserGetDirectory, CompatMakeSurePathExists, CreateFolder, FileTraverse, findTcl, CCJHyperLink::GetRegKey, CCJHyperLink::GotoURL, CCheckout_MAIN::OnBtnPath, AuthenSSH::RsaIdentityFile, CCJHyperLink::SetDefaultCursor, and TraverseHistory.

#define STRUCT_DIRENT struct direct

Definition at line 71 of file FileTraversal.h.

Referenced by FileTraverse.

Enumeration Type Documentation

enum kTraversal

Enumeration values:
kContinueTraversal
kStopTraversal
kSkipFile
kTraversalError

Definition at line 77 of file FileTraversal.h.

Referenced by TBrowserFill::EnterDirectory, TBrowserFillDummy::EnterDirectory, TViewFill::EnterDirectory, LSReport::EnterDirectory, CFillTclEntries::EnterDirectory, CFillPyEntries::EnterDirectory, ImportReport::EnterDirectory, TraversalReport::EnterDirectory, TBrowserFill::ExitDirectory, TBrowserFillDummy::ExitDirectory, TViewFill::ExitDirectory, LSReport::ExitDirectory, CFillTclEntries::ExitDirectory, CFillPyEntries::ExitDirectory, ImportReport::ExitDirectory, TraversalReport::ExitDirectory, FileTraverse, list_all_types_recur, TViewFill::OnAlias, CFillTclEntries::OnAlias, CFillPyEntries::OnAlias, ImportReport::OnAlias, TraversalReport::OnAlias, LSReport::OnAnyDevice, TraversalReport::OnAnyDevice, TBrowserFill::OnDirectory, TBrowserFillDummy::OnDirectory, TViewFill::OnDirectory, CFillTclEntries::OnDirectory, CFillPyEntries::OnDirectory, ImportReport::OnDirectory, TraversalReport::OnDirectory, TBrowserFill::OnError, TBrowserFillDummy::OnError, TViewFill::OnError, LSReport::OnError, CFillTclEntries::OnError, CFillPyEntries::OnError, CFindSettings::OnError, MacroTraversal::OnError, ImportReport::OnError, TraversalReport::OnError, TViewFill::OnFile, CFillTclEntries::OnFile, CFillPyEntries::OnFile, CFindSettings::OnFile, MacroTraversal::OnFile, ImportReport::OnFile, TraversalReport::OnFile, TBrowserFill::OnIdle, TBrowserFillDummy::OnIdle, TViewFill::OnIdle, LSReport::OnIdle, CFillTclEntries::OnIdle, CFillPyEntries::OnIdle, ImportReport::OnIdle, TraversalReport::OnIdle, CWinCvsBrowser::OnItemexpanding, CWinCvsBrowser::ResetBrowser, CBrowseFileView::ResetView, and tclDirProc.

00078 {
00079     kContinueTraversal,
00080     kStopTraversal,
00081     kSkipFile,
00082     kTraversalError
00083 } kTraversal;

Function Documentation

kTraversal FileTraverse | ( | const char * | path,
 |  | TraversalReport & | report,
 |  | const FSSpec * | macDirSpec = 0L
 | ) |

Definition at line 97 of file FileTraversal.cpp.

References kContinueTraversal.

Referenced by AskCreatePersistentSettings, cvsgui_GetCvsEntries, FileTraverse, GetAllPersistentSettings, HasPersistentSettings, list_all_types_recur, LoadPersistentSettings, MacrosReloadAll, TViewFill::OnDirectory, TBrowserFill::OnDirectory, CWinCvsBrowser::OnItemexpanding, UCvsFolders::OnTreeExpanding, CWinCvsBrowser::ResetBrowser, UCvsFolders::ResetBrowser, CBrowseFileView::ResetView, UCvsFiles::ResetView, SavePersistentSettings, tclCvsEntriesProc, and tclDirProc.

00098 {
00099     DIR *dirp = 0L;
00100     STRUCT_DIRENT *dp;
00101     struct stat sb;
00102     CStr fullname, errstr, dirname, tmpname;
00103     kTraversal res = kContinueTraversal;
00104     char *tmp;
00105     const UFSSpec *macspec = 0L;
00106 #if defined(WIN32)
00107     unsigned long dbg_mask = GetWinCvsDebugMask(false);
00108     CStr tracestr;
00109 #endif
00110
00111     // used to restore the current directory
00112     static bool getPathFlag = false;
00113     char* szOriginalPath = NULL;
00114     USemaphore policeman(getPathFlag);
00115     USemaphore runstate(TraversalReport::gRunning);
00116
00117     if(!policeman.IsEnteredTwice())
00118     {
00119         szOriginalPath = getcwd(NULL, MAX_PATH);
00120     }
00121
00122 #if !TARGET_OS_MAC
00123     if(path == 0L || (dirp = opendir(path)) == 0L)
00124 #elif TARGET_RT_MAC_CFM
00125     GUSIFileSpec folderspec;
00126     UFSSpec foldermacspec;
00127     if(macDirSpec != 0L)
00128         folderspec = *macDirSpec;
00129     else if(path != 0L)
00130         folderspec = path;
00131     foldermacspec = folderspec;
00132     macspec = &foldermacspec;
00133
00134     if((dirp = opendir(folderspec)) == 0L)
00135 #else
00136     FSRef foldermacspec;
00137     if(macDirSpec != 0L)
00138         foldermacspec = *macDirSpec;
00139     else if(path != 0L)
00140         FSPathMakeRef(posix_to_utf8(path), &foldermacspec, NULL);
00141     macspec = &foldermacspec;
00142     if(path == 0L || (dirp = opendir(path)) == 0L)
00143 #endif
00144     {
00145         errstr = "Error while accessing ";
00146         errstr << path;
00147         errstr << " (error " << errno << ')';
00148         res =  report.OnError(errstr, errno);
00149         goto exit;
00150     }
00151
00152     tmpname = path;
00153     tmp = tmpname;
00154     char *next;
00155     if(tmpname.endsWith(kPathDelimiter))
00156         tmp[strlen(tmp) - 1] = '\0';
00157     next = tmp;
00158     while((tmp = strchr(next, kPathDelimiter)) != 0L)
00159     {
00160         next = ++tmp;
00161     }
00162     dirname = next;
00163
00164     res = report.EnterDirectory(path, dirname, macspec);
00165     if(res != kContinueTraversal)
00166         goto abort;
00167
00168     while ((dp = readdir (dirp)) != NULL)
00169     {
00170         res = report.OnIdle(path);
00171         if(res != kContinueTraversal)
00172             goto abort;
00173
00174 #if !TARGET_RT_MAC_CFM
00175         if(strcmp(dp->d_name, ".") == 0 || strcmp(dp->d_name, "..") == 0)
00176             continue;
00177 #endif /* !TARGET_RT_MAC_CFM */
00178
00179         fullname = path;
00180         if(!fullname.endsWith(kPathDelimiter))
00181             fullname << kPathDelimiter;
00182         fullname << dp->d_name;
00183
00184         macspec = 0L;
00185         int statres;
00186
00187 #if TARGET_RT_MAC_CFM
00188         GUSIFileSpec inspec(folderspec);
00189         inspec += dp->d_name;
00190         UFSSpec infspec = inspec;
00191         macspec = &infspec;
00192
00193         statres = stat(inspec, &sb);
00194 #elif TARGET_RT_MAC_MACHO
00195         FSRef infspec;
00196         FSPathMakeRef(posix_to_utf8(fullname.c_str()), &infspec, NULL);
00197         macspec = &infspec;
00198
00199         statres = stat(fullname, &sb);
00200 #else
00201 #   if defined(WIN32)
00202         if ( (dbg_mask & wcvsdbg_trace_modified_checks) && (dbg_mask & wcvsdbg_verbose) )
00203         {
00204             AppendWinCvsDebugMask(wcvsdbg_trace_dst_checks
00205                                     | wcvsdbg_trace_stat);
00206             tracestr = "Stat(";
00207             tracestr << static_cast<const char *>(fullname);
00208             tracestr << ") ...\n";
00209             cvs_err(tracestr);
00210             OutputDebugString(tracestr);
00211         }
00212 #   endif   // defined(WIN32)
00213
00214         statres = stat(fullname, &sb);
00215 #endif
00216
00217         if (statres != -1)
00218         {
00219             if(S_ISDIR(sb.st_mode))
00220             {
00221                 res = report.OnDirectory(path, fullname, dp->d_name, sb, macspec);
00222
00223                 if(res == kSkipFile)
00224                     continue;
00225                 if(res != kContinueTraversal)
00226                     goto abort;
00227
00228                 res = FileTraverse(fullname, report, macspec);
00229                 if(res != kContinueTraversal)
00230                     goto abort;
00231
00232             }
00233             else if(S_ISREG(sb.st_mode))
00234             {
00235                 res = report.OnFile(path, fullname, dp->d_name, sb, macspec);
00236                 if(res == kSkipFile)
00237                     continue;
00238                 if(res != kContinueTraversal)
00239                     goto abort;
00240             }
00241 #ifdef S_ISLNK
00242             else if(S_ISLNK(sb.st_mode))
00243             {
00244                 res = report.OnAlias(path, fullname, dp->d_name, sb, macspec);
00245                 if(res == kSkipFile)
00246                     continue;
00247                 if(res != kContinueTraversal)
00248                     goto abort;
00249             }
00250 #endif /* S_ISLNK */
00251             else
00252             {
00253                 /* TODO : Unix devices */
00254                 errstr = "Error while accessing ";
00255                 errstr << fullname;
00256                 errstr << " (error " << errno << ')';
00257                 res = report.OnError(errstr, errno);
00258                 goto abort;
00259             }
00260         }
00261         else
00262         {
00263             errstr = "Error while accessing ";
00264             errstr << fullname;
00265             errstr << " (error " << errno << ')';
00266             res = report.OnError(errstr, errno);
00267             goto abort;
00268         }
00269     }
00270
00271     res = report.ExitDirectory(path);
00272
00273 abort:
00274     closedir (dirp);
00275 exit:
00276     if(0L != szOriginalPath)
00277     {
00278 #if !TARGET_RT_MAC_CFM
00279         chdir(szOriginalPath);
00280 #endif
00281         free(szOriginalPath);
00282         szOriginalPath = NULL;
00283     }
00284
00285 #if defined(WIN32)
00286     SetWinCvsDebugMask(dbg_mask);
00287 #endif  // defined(WIN32)
00288
00289     return res;
00290 }

Generated on Sun Feb 24 01:22:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


fnmatch.c File Reference

common/fnmatch.c File Reference

#include <errno.h>
#include "fnmatch.h"

Include dependency graph for fnmatch.c:

Include dependency graph

Go to the source code of this file.

Functions

int | fnmatch (const char *pattern, const char *string, int flags)

Variables

unsigned char | WNT_filename_classes []

Function Documentation

int fnmatch | ( | const char * | pattern,
 |  | const char * | string,
 |  | int | flags
 | ) |

Definition at line 51 of file fnmatch.c.

References __FNM_FLAGS, FNM_NOESCAPE, FNM_NOMATCH, FNM_PATHNAME, FNM_PERIOD, fnmatch, and FOLD_FN_CHAR.

00058 {
00059   register const char *p = pattern, *n = string;
00060   register char c;
00061
00062   if ((flags & ~__FNM_FLAGS) != 0)
00063     {
00064       errno = EINVAL;
00065       return -1;
00066     }
00067
00068   while ((c = *p++) != '\0')
00069     {
00070       switch (c)
00071     {
00072     case '?':
00073       if (*n == '\0')
00074         return FNM_NOMATCH;
00075       else if ((flags & FNM_PATHNAME) && *n == '/')
00076         return FNM_NOMATCH;
00077       else if ((flags & FNM_PERIOD) && *n == '.' &&
00078            (n == string || ((flags & FNM_PATHNAME) && n[-1] == '/')))
00079         return FNM_NOMATCH;
00080       break;
00081
00082     case '\\':
00083       if (!(flags & FNM_NOESCAPE))
00084         c = *p++;
00085       if (*n != c)
00086         return FNM_NOMATCH;
00087       break;
00088
00089     case '*':
00090       if ((flags & FNM_PERIOD) && *n == '.' &&
00091           (n == string || ((flags & FNM_PATHNAME) && n[-1] == '/')))
00092         return FNM_NOMATCH;
00093
00094       for (c = *p++; c == '?' || c == '*'; c = *p++, ++n)
00095         if (((flags & FNM_PATHNAME) && *n == '/') ||
00096         (c == '?' && *n == '\0'))
00097           return FNM_NOMATCH;
00098
00099       if (c == '\0')
00100         return 0;
00101
00102       {
00103         char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
00104         for (--p; *n != '\0'; ++n)
00105           if ((c == '[' || *n == c1) &&
00106           fnmatch(p, n, flags & ~FNM_PERIOD) == 0)
00107         return 0;
00108         return FNM_NOMATCH;
00109       }
00110
00111     case '[':
00112       {
00113         /* Nonzero if the sense of the character class is inverted.  */
00114         register int not;
00115
00116         if (*n == '\0')
00117           return FNM_NOMATCH;
00118
00119         if ((flags & FNM_PERIOD) && *n == '.' &&
00120         (n == string || ((flags & FNM_PATHNAME) && n[-1] == '/')))
00121           return FNM_NOMATCH;
00122
00123         not = (*p == '!' || *p == '^');
00124         if (not)
00125           ++p;
00126
00127         c = *p++;
00128         for (;;)
00129           {
00130         register char cstart = c, cend = c;
00131
00132         if (!(flags & FNM_NOESCAPE) && c == '\\')
00133           cstart = cend = *p++;
00134
00135         if (c == '\0')
00136           /* [ (unterminated) loses.  */
00137           return FNM_NOMATCH;
00138
00139         c = *p++;
00140
00141         if ((flags & FNM_PATHNAME) && c == '/')
00142           /* [/] can never match.  */
00143           return FNM_NOMATCH;
00144
00145         if (c == '-' && *p != ']')
00146           {
00147             cend = *p++;
00148             if (!(flags & FNM_NOESCAPE) && cend == '\\')
00149               cend = *p++;
00150             if (cend == '\0')
00151               return FNM_NOMATCH;
00152             c = *p++;
00153           }
00154
00155         if (*n >= cstart && *n <= cend)
00156           goto matched;
00157
00158         if (c == ']')
00159           break;
00160           }
00161         if (!not)
00162           return FNM_NOMATCH;
00163         break;
00164
00165       matched:;
00166         /* Skip the rest of the [...] that already matched.  */
00167         while (c != ']')
00168           {
00169         if (c == '\0')
00170           /* [... (unterminated) loses.  */
00171           return FNM_NOMATCH;
00172
00173         c = *p++;
00174         if (!(flags & FNM_NOESCAPE) && c == '\\')
00175           /* 1003.2d11 is unclear if this is right.  %%% */
00176           ++p;
00177           }
00178         if (not)
00179           return FNM_NOMATCH;
00180       }
00181       break;
00182
00183     default:
00184       if (FOLD_FN_CHAR (c) != FOLD_FN_CHAR (*n))
00185         return FNM_NOMATCH;
00186     }
00187
00188       ++n;
00189     }
00190
00191   if (*n == '\0')
00192     return 0;
00193
00194   return FNM_NOMATCH;
00195 }

Variable Documentation

unsigned char WNT_filename_classes[]

Definition at line 224 of file fnmatch.c.

Generated on Sun Feb 24 01:22:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


fnmatch.h File Reference

common/fnmatch.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | _FNMATCH_H 1
#define | FNM_PATHNAME (1 << 0)
#define | FNM_NOESCAPE (1 << 1)
#define | FNM_PERIOD (1 << 2)
#define | __FNM_FLAGS (FNM_PATHNAME|FNM_NOESCAPE|FNM_PERIOD)
#define | FNM_NOMATCH 1
#define | __STDC__ 1
#define | FOLD_FN_CHAR(c) (WNT_filename_classes[(unsigned char) (c)])

Functions

int | fnmatch (const char *pattern, const char *string, int flags)

Variables

unsigned char | WNT_filename_classes []

Define Documentation

#define __FNM_FLAGS (FNM_PATHNAME|FNM_NOESCAPE|FNM_PERIOD)

Definition at line 34 of file fnmatch.h.

Referenced by fnmatch.

#define __STDC__ 1

Definition at line 41 of file fnmatch.h.

#define _FNMATCH_H 1

Definition at line 20 of file fnmatch.h.

#define FNM_NOESCAPE (1 << 1)

Definition at line 30 of file fnmatch.h.

Referenced by fnmatch.

#define FNM_NOMATCH 1

Definition at line 38 of file fnmatch.h.

Referenced by fnmatch.

#define FNM_PATHNAME (1 << 0)

Definition at line 28 of file fnmatch.h.

Referenced by fnmatch.

#define FNM_PERIOD (1 << 2)

Definition at line 32 of file fnmatch.h.

Referenced by fnmatch.

#define FOLD_FN_CHAR ( c ) (WNT_filename_classes[(unsigned char) (c)])

Definition at line 56 of file fnmatch.h.

Referenced by fnmatch.

Function Documentation

int fnmatch | ( | const char * | pattern,
 |  | const char * | string,
 |  | int | flags
 | ) |

Definition at line 51 of file fnmatch.c.

Referenced by fnmatch, and MatchIgnoredList.

00058 {
00059   register const char *p = pattern, *n = string;
00060   register char c;
00061
00062   if ((flags & ~__FNM_FLAGS) != 0)
00063     {
00064       errno = EINVAL;
00065       return -1;
00066     }
00067
00068   while ((c = *p++) != '\0')
00069     {
00070       switch (c)
00071     {
00072     case '?':
00073       if (*n == '\0')
00074         return FNM_NOMATCH;
00075       else if ((flags & FNM_PATHNAME) && *n == '/')
00076         return FNM_NOMATCH;
00077       else if ((flags & FNM_PERIOD) && *n == '.' &&
00078            (n == string || ((flags & FNM_PATHNAME) && n[-1] == '/')))
00079         return FNM_NOMATCH;
00080       break;
00081
00082     case '\\':
00083       if (!(flags & FNM_NOESCAPE))
00084         c = *p++;
00085       if (*n != c)
00086         return FNM_NOMATCH;
00087       break;
00088
00089     case '*':
00090       if ((flags & FNM_PERIOD) && *n == '.' &&
00091           (n == string || ((flags & FNM_PATHNAME) && n[-1] == '/')))
00092         return FNM_NOMATCH;
00093
00094       for (c = *p++; c == '?' || c == '*'; c = *p++, ++n)
00095         if (((flags & FNM_PATHNAME) && *n == '/') ||
00096         (c == '?' && *n == '\0'))
00097           return FNM_NOMATCH;
00098
00099       if (c == '\0')
00100         return 0;
00101
00102       {
00103         char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
00104         for (--p; *n != '\0'; ++n)
00105           if ((c == '[' || *n == c1) &&
00106           fnmatch(p, n, flags & ~FNM_PERIOD) == 0)
00107         return 0;
00108         return FNM_NOMATCH;
00109       }
00110
00111     case '[':
00112       {
00113         /* Nonzero if the sense of the character class is inverted.  */
00114         register int not;
00115
00116         if (*n == '\0')
00117           return FNM_NOMATCH;
00118
00119         if ((flags & FNM_PERIOD) && *n == '.' &&
00120         (n == string || ((flags & FNM_PATHNAME) && n[-1] == '/')))
00121           return FNM_NOMATCH;
00122
00123         not = (*p == '!' || *p == '^');
00124         if (not)
00125           ++p;
00126
00127         c = *p++;
00128         for (;;)
00129           {
00130         register char cstart = c, cend = c;
00131
00132         if (!(flags & FNM_NOESCAPE) && c == '\\')
00133           cstart = cend = *p++;
00134
00135         if (c == '\0')
00136           /* [ (unterminated) loses.  */
00137           return FNM_NOMATCH;
00138
00139         c = *p++;
00140
00141         if ((flags & FNM_PATHNAME) && c == '/')
00142           /* [/] can never match.  */
00143           return FNM_NOMATCH;
00144
00145         if (c == '-' && *p != ']')
00146           {
00147             cend = *p++;
00148             if (!(flags & FNM_NOESCAPE) && cend == '\\')
00149               cend = *p++;
00150             if (cend == '\0')
00151               return FNM_NOMATCH;
00152             c = *p++;
00153           }
00154
00155         if (*n >= cstart && *n <= cend)
00156           goto matched;
00157
00158         if (c == ']')
00159           break;
00160           }
00161         if (!not)
00162           return FNM_NOMATCH;
00163         break;
00164
00165       matched:;
00166         /* Skip the rest of the [...] that already matched.  */
00167         while (c != ']')
00168           {
00169         if (c == '\0')
00170           /* [... (unterminated) loses.  */
00171           return FNM_NOMATCH;
00172
00173         c = *p++;
00174         if (!(flags & FNM_NOESCAPE) && c == '\\')
00175           /* 1003.2d11 is unclear if this is right.  %%% */
00176           ++p;
00177           }
00178         if (not)
00179           return FNM_NOMATCH;
00180       }
00181       break;
00182
00183     default:
00184       if (FOLD_FN_CHAR (c) != FOLD_FN_CHAR (*n))
00185         return FNM_NOMATCH;
00186     }
00187
00188       ++n;
00189     }
00190
00191   if (*n == '\0')
00192     return 0;
00193
00194   return FNM_NOMATCH;
00195 }

Variable Documentation

unsigned char WNT_filename_classes[]

Definition at line 57 of file fnmatch.h.

Generated on Sun Feb 24 01:22:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


getline.c File Reference

common/getline.c File Reference

#include <sys/types.h>
#include <stdio.h>
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include "getline.h"

Include dependency graph for getline.c:

Include dependency graph

Go to the source code of this file.

Defines

#define | MIN_CHUNK 64

Functions

int | getstr (char **lineptr, size_t *n, FILE *stream, char terminator, int offset)
int | getline (char **lineptr, size_t *n, FILE *stream)

Define Documentation

#define MIN_CHUNK 64

Definition at line 40 of file getline.c.

Referenced by getstr.

Function Documentation

int getline | ( | char ** | lineptr,
 |  | size_t * | n,
 |  | FILE * | stream
 | ) |

Definition at line 146 of file getline.c.

References getstr.

00147 {
00148   return getstr (lineptr, n, stream, '\n', 0);
00149 }

int getstr | ( | char ** | lineptr,
 |  | size_t * | n,
 |  | FILE * | stream,
 |  | char | terminator,
 |  | int | offset
 | ) |

Definition at line 51 of file getline.c.

References malloc, MIN_CHUNK, and realloc.

00052 {
00053   int nchars_avail;     /* Allocated but unused chars in *LINEPTR.  */
00054   char *read_pos;       /* Where we're reading into *LINEPTR. */
00055   int ret;
00056
00057   if (!lineptr || !n || !stream)
00058     {
00059       errno = EINVAL;
00060       return -1;
00061     }
00062
00063   if (!*lineptr)
00064     {
00065       *n = MIN_CHUNK;
00066       *lineptr = (char *)malloc (*n);
00067       if (!*lineptr)
00068     {
00069       errno = ENOMEM;
00070       return -1;
00071     }
00072     }
00073
00074   nchars_avail = *n - offset;
00075   read_pos = *lineptr + offset;
00076
00077   for (;;)
00078     {
00079       int save_errno;
00080       register int c = getc (stream);
00081
00082       save_errno = errno;
00083
00084       /* We always want at least one char left in the buffer, since we
00085      always (unless we get an error while reading the first char)
00086      NUL-terminate the line buffer.  */
00087
00088       assert((*lineptr + *n) == (read_pos + nchars_avail));
00089       if (nchars_avail < 2)
00090     {
00091       if (*n > MIN_CHUNK)
00092         *n *= 2;
00093       else
00094         *n += MIN_CHUNK;
00095
00096       nchars_avail = *n + *lineptr - read_pos;
00097       *lineptr = (char *)realloc (*lineptr, *n);
00098       if (!*lineptr)
00099         {
00100           errno = ENOMEM;
00101           return -1;
00102         }
00103       read_pos = *n - nchars_avail + *lineptr;
00104       assert((*lineptr + *n) == (read_pos + nchars_avail));
00105     }
00106
00107       if (ferror (stream))
00108     {
00109       /* Might like to return partial line, but there is no
00110          place for us to store errno.  And we don't want to just
00111          lose errno.  */
00112       errno = save_errno;
00113       return -1;
00114     }
00115
00116       if (c == EOF)
00117     {
00118       /* Return partial line, if any.  */
00119       if (read_pos == *lineptr)
00120         return -1;
00121       else
00122         break;
00123     }
00124
00125 #ifdef macintosh
00126       if (terminator == '\n' && c == '\r')
00127     c = '\n';
00128 #endif
00129
00130       *read_pos++ = c;
00131       nchars_avail--;
00132
00133       if (c == terminator)
00134     /* Return the line.  */
00135     break;
00136    }
00137
00138   /* Done - NUL terminate and return the number of chars read.  */
00139   *read_pos = '\0';
00140
00141   ret = read_pos - (*lineptr + offset);
00142   return ret;
00143 }

Generated on Sun Feb 24 01:22:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


getline.h File Reference

common/getline.h File Reference

#include <stdio.h>

Include dependency graph for getline.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | _getline_h_ 1
#define | __PROTO(args) args

Functions

int | getline (char **_lineptr, size_t *_n, FILE *_stream)
int | getstr (char **_lineptr, size_t *_n, FILE *_stream, char _terminator, int _offset)

Define Documentation

#define __PROTO ( args ) args

Definition at line 31 of file getline.h.

#define _getline_h_ 1

Definition at line 22 of file getline.h.

Function Documentation

int getline | ( | char ** | _lineptr,
 |  | size_t * | _n,
 |  | FILE * | _stream
 | ) |

Definition at line 146 of file getline.c.

Referenced by CvsLogParse, fgetentent, loadSettingsInternal, MacroTraversal::OnFile, CCommit_MAIN::OnTemplate, ReadIgnoredFile, and Tag_Open.

00147 {
00148   return getstr (lineptr, n, stream, '\n', 0);
00149 }

int getstr | ( | char ** | _lineptr,
 |  | size_t * | _n,
 |  | FILE * | _stream,
 |  | char | _terminator,
 |  | int | _offset
 | ) |

Definition at line 51 of file getline.c.

Referenced by getline.

00052 {
00053   int nchars_avail;     /* Allocated but unused chars in *LINEPTR.  */
00054   char *read_pos;       /* Where we're reading into *LINEPTR. */
00055   int ret;
00056
00057   if (!lineptr || !n || !stream)
00058     {
00059       errno = EINVAL;
00060       return -1;
00061     }
00062
00063   if (!*lineptr)
00064     {
00065       *n = MIN_CHUNK;
00066       *lineptr = (char *)malloc (*n);
00067       if (!*lineptr)
00068     {
00069       errno = ENOMEM;
00070       return -1;
00071     }
00072     }
00073
00074   nchars_avail = *n - offset;
00075   read_pos = *lineptr + offset;
00076
00077   for (;;)
00078     {
00079       int save_errno;
00080       register int c = getc (stream);
00081
00082       save_errno = errno;
00083
00084       /* We always want at least one char left in the buffer, since we
00085      always (unless we get an error while reading the first char)
00086      NUL-terminate the line buffer.  */
00087
00088       assert((*lineptr + *n) == (read_pos + nchars_avail));
00089       if (nchars_avail < 2)
00090     {
00091       if (*n > MIN_CHUNK)
00092         *n *= 2;
00093       else
00094         *n += MIN_CHUNK;
00095
00096       nchars_avail = *n + *lineptr - read_pos;
00097       *lineptr = (char *)realloc (*lineptr, *n);
00098       if (!*lineptr)
00099         {
00100           errno = ENOMEM;
00101           return -1;
00102         }
00103       read_pos = *n - nchars_avail + *lineptr;
00104       assert((*lineptr + *n) == (read_pos + nchars_avail));
00105     }
00106
00107       if (ferror (stream))
00108     {
00109       /* Might like to return partial line, but there is no
00110          place for us to store errno.  And we don't want to just
00111          lose errno.  */
00112       errno = save_errno;
00113       return -1;
00114     }
00115
00116       if (c == EOF)
00117     {
00118       /* Return partial line, if any.  */
00119       if (read_pos == *lineptr)
00120         return -1;
00121       else
00122         break;
00123     }
00124
00125 #ifdef macintosh
00126       if (terminator == '\n' && c == '\r')
00127     c = '\n';
00128 #endif
00129
00130       *read_pos++ = c;
00131       nchars_avail--;
00132
00133       if (c == terminator)
00134     /* Return the line.  */
00135     break;
00136    }
00137
00138   /* Done - NUL terminate and return the number of chars read.  */
00139   *read_pos = '\0';
00140
00141   ret = read_pos - (*lineptr + offset);
00142   return ret;
00143 }

Generated on Sun Feb 24 01:22:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


getopt.c File Reference

common/getopt.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include "getopt.h"
#include <string.h>

Include dependency graph for getopt.c:

Include dependency graph

Go to the source code of this file.

Defines

#define | my_index strchr

Enumerations

enum {
REQUIRE_ORDER,
PERMUTE,
RETURN_IN_ORDER
}

Functions

void | exchange (char **argv)
char * | _getopt_initialize (char *optstring)
int | _getopt_internal (int argc, char **argv, char *optstring, struct option *longopts, int *longind, int long_only)
int | getopt (int argc, char **argv, char *optstring)

Variables

char * | optarg = NULL
int | optind = 0
char * | nextchar
int | opterr = 1
int | optopt = '?'
enum { ... } | ordering
char * | posixly_correct
int | first_nonopt
int | last_nonopt

Define Documentation

#define my_index strchr

Definition at line 178 of file getopt.c.

Referenced by _getopt_internal.

Enumeration Type Documentation

anonymous enum

Enumeration values:
REQUIRE_ORDER
PERMUTE
RETURN_IN_ORDER

Definition at line 164 of file getopt.c.

00165 {
00166   REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
00167 } ordering;

Function Documentation

char* _getopt_initialize ( char * optstring ) [static]

Definition at line 308 of file getopt.c.

References first_nonopt, getenv, last_nonopt, nextchar, NULL, optind, ordering, PERMUTE, posixly_correct, REQUIRE_ORDER, and RETURN_IN_ORDER.

Referenced by _getopt_internal.

00310 {
00311   /* Start processing options with ARGV-element 1 (since ARGV-element 0
00312      is the program name); the sequence of previously skipped
00313      non-option ARGV-elements is empty.  */
00314
00315   first_nonopt = last_nonopt = optind = 1;
00316
00317   nextchar = NULL;
00318
00319   posixly_correct = getenv ("POSIXLY_CORRECT");
00320
00321   /* Determine how to handle the ordering of options and nonoptions.  */
00322
00323   if (optstring[0] == '-')
00324     {
00325       ordering = RETURN_IN_ORDER;
00326       ++optstring;
00327     }
00328   else if (optstring[0] == '+')
00329     {
00330       ordering = REQUIRE_ORDER;
00331       ++optstring;
00332     }
00333   else if (posixly_correct != NULL)
00334     ordering = REQUIRE_ORDER;
00335   else
00336     ordering = PERMUTE;
00337
00338   return optstring;
00339 }

int _getopt_internal | ( | int | argc,
 |  | char ** | argv,
 |  | char * | optstring,
 |  | struct option * | longopts,
 |  | int * | longind,
 |  | int | long_only
 | ) |

Definition at line 408 of file getopt.c.

References _getopt_initialize, exchange, first_nonopt, option::flag, option::has_arg, last_nonopt, my_index, option::name, nextchar, NULL, optarg, optind, optopt, ordering, PERMUTE, REQUIRE_ORDER, and option::val.

00411 {
00412   optarg = NULL;
00413
00414   if (optind == 0)
00415     optstring = _getopt_initialize (optstring);
00416
00417   if (nextchar == NULL || *nextchar == '\0')
00418     {
00419       /* Advance to the next ARGV-element.  */
00420
00421       if (ordering == PERMUTE)
00422     {
00423       /* If we have just processed some options following some non-options,
00424          exchange them so that the options come first.  */
00425
00426       if (first_nonopt != last_nonopt && last_nonopt != optind)
00427         exchange ((char **) argv);
00428       else if (last_nonopt != optind)
00429         first_nonopt = optind;
00430
00431       /* Skip any additional non-options
00432          and extend the range of non-options previously skipped.  */
00433
00434       while (optind < argc
00435          && (argv[optind][0] != '-' || argv[optind][1] == '\0'))
00436         optind++;
00437       last_nonopt = optind;
00438     }
00439
00440       /* The special ARGV-element `--' means premature end of options.
00441      Skip it like a null option,
00442      then exchange with previous non-options as if it were an option,
00443      then skip everything else like a non-option.  */
00444
00445       if (optind != argc && !strcmp (argv[optind], "--"))
00446     {
00447       optind++;
00448
00449       if (first_nonopt != last_nonopt && last_nonopt != optind)
00450         exchange ((char **) argv);
00451       else if (first_nonopt == last_nonopt)
00452         first_nonopt = optind;
00453       last_nonopt = argc;
00454
00455       optind = argc;
00456     }
00457
00458       /* If we have done all the ARGV-elements, stop the scan
00459      and back over any non-options that we skipped and permuted.  */
00460
00461       if (optind == argc)
00462     {
00463       /* Set the next-arg-index to point at the non-options
00464          that we previously skipped, so the caller will digest them.  */
00465       if (first_nonopt != last_nonopt)
00466         optind = first_nonopt;
00467       return EOF;
00468     }
00469
00470       /* If we have come to a non-option and did not permute it,
00471      either stop the scan or describe it to the caller and pass it by.  */
00472
00473       if ((argv[optind][0] != '-' || argv[optind][1] == '\0'))
00474     {
00475       if (ordering == REQUIRE_ORDER)
00476         return EOF;
00477       optarg = argv[optind++];
00478       return 1;
00479     }
00480
00481       /* We have found another option-ARGV-element.
00482      Skip the initial punctuation.  */
00483
00484       nextchar = (argv[optind] + 1
00485           + (longopts != NULL && argv[optind][1] == '-'));
00486     }
00487
00488   /* Decode the current option-ARGV-element.  */
00489
00490   /* Check whether the ARGV-element is a long option.
00491
00492      If long_only and the ARGV-element has the form "-f", where f is
00493      a valid short option, don't consider it an abbreviated form of
00494      a long option that starts with f.  Otherwise there would be no
00495      way to give the -f short option.
00496
00497      On the other hand, if there's a long option "fubar" and
00498      the ARGV-element is "-fu", do consider that an abbreviation of
00499      the long option, just like "--fu", and not "-f" with arg "u".
00500
00501      This distinction seems to be the most useful approach.  */
00502
00503   if (longopts != NULL
00504       && (argv[optind][1] == '-'
00505       || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
00506     {
00507       char *nameend;
00508       const struct option *p;
00509       const struct option *pfound = NULL;
00510       int exact = 0;
00511       int ambig = 0;
00512       int indfound;
00513       int option_index;
00514
00515       for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
00516     /* Do nothing.  */ ;
00517
00518       /* Test all long options for either exact match
00519      or abbreviated matches.  */
00520       for (p = longopts, option_index = 0; p->name; p++, option_index++)
00521     if (!strncmp (p->name, nextchar, nameend - nextchar))
00522       {
00523         if (nameend - nextchar == (int) strlen (p->name))
00524           {
00525         /* Exact match found.  */
00526         pfound = p;
00527         indfound = option_index;
00528         exact = 1;
00529         break;
00530           }
00531         else if (pfound == NULL)
00532           {
00533         /* First nonexact match found.  */
00534         pfound = p;
00535         indfound = option_index;
00536           }
00537         else
00538           /* Second or later nonexact match found.  */
00539           ambig = 1;
00540       }
00541
00542       if (ambig && !exact)
00543     {
00544       if (opterr)
00545         fprintf (stderr, "%s: option `%s' is ambiguous\n",
00546              argv[0], argv[optind]);
00547       nextchar += strlen (nextchar);
00548       optind++;
00549       return '?';
00550     }
00551
00552       if (pfound != NULL)
00553     {
00554       option_index = indfound;
00555       optind++;
00556       if (*nameend)
00557         {
00558           /* Don't test has_arg with >, because some C compilers don't
00559          allow it to be used on enums.  */
00560           if (pfound->has_arg)
00561         optarg = nameend + 1;
00562           else
00563         {
00564           if (opterr)
00565             {
00566               if (argv[optind - 1][1] == '-')
00567             /* --option */
00568             fprintf (stderr,
00569                  "%s: option `--%s' doesn't allow an argument\n",
00570                  argv[0], pfound->name);
00571               else
00572             /* +option or -option */
00573             fprintf (stderr,
00574                  "%s: option `%c%s' doesn't allow an argument\n",
00575                  argv[0], argv[optind - 1][0], pfound->name);
00576             }
00577           nextchar += strlen (nextchar);
00578           return '?';
00579         }
00580         }
00581       else if (pfound->has_arg == 1)
00582         {
00583           if (optind < argc)
00584         optarg = argv[optind++];
00585           else
00586         {
00587           if (opterr)
00588             fprintf (stderr, "%s: option `%s' requires an argument\n",
00589                  argv[0], argv[optind - 1]);
00590           nextchar += strlen (nextchar);
00591           return optstring[0] == ':' ? ':' : '?';
00592         }
00593         }
00594       nextchar += strlen (nextchar);
00595       if (longind != NULL)
00596         *longind = option_index;
00597       if (pfound->flag)
00598         {
00599           *(pfound->flag) = pfound->val;
00600           return 0;
00601         }
00602       return pfound->val;
00603     }
00604
00605       /* Can't find it as a long option.  If this is not getopt_long_only,
00606      or the option starts with '--' or is not a valid short
00607      option, then it's an error.
00608      Otherwise interpret it as a short option.  */
00609       if (!long_only || argv[optind][1] == '-'
00610       || my_index (optstring, *nextchar) == NULL)
00611     {
00612       if (opterr)
00613         {
00614           if (argv[optind][1] == '-')
00615         /* --option */
00616         fprintf (stderr, "%s: unrecognized option `--%s'\n",
00617              argv[0], nextchar);
00618           else
00619         /* +option or -option */
00620         fprintf (stderr, "%s: unrecognized option `%c%s'\n",
00621              argv[0], argv[optind][0], nextchar);
00622         }
00623       nextchar = (char *) "";
00624       optind++;
00625       return '?';
00626     }
00627     }
00628
00629   /* Look at and handle the next short option-character.  */
00630
00631   {
00632     char c = *nextchar++;
00633     char *temp = my_index (optstring, c);
00634
00635     /* Increment `optind' when we start to process its last character.  */
00636     if (*nextchar == '\0')
00637       ++optind;
00638
00639     if (temp == NULL || c == ':')
00640       {
00641     if (opterr)
00642       {
00643         if (posixly_correct)
00644           /* 1003.2 specifies the format of this message.  */
00645           fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c);
00646         else
00647           fprintf (stderr, "%s: invalid option -- %c\n", argv[0], c);
00648       }
00649     optopt = c;
00650     return '?';
00651       }
00652     if (temp[1] == ':')
00653       {
00654     if (temp[2] == ':')
00655       {
00656         /* This is an option that accepts an argument optionally.  */
00657         if (*nextchar != '\0')
00658           {
00659         optarg = nextchar;
00660         optind++;
00661           }
00662         else
00663           optarg = NULL;
00664         nextchar = NULL;
00665       }
00666     else
00667       {
00668         /* This is an option that requires an argument.  */
00669         if (*nextchar != '\0')
00670           {
00671         optarg = nextchar;
00672         /* If we end this ARGV-element by taking the rest as an arg,
00673            we must advance to the next element now.  */
00674         optind++;
00675           }
00676         else if (optind == argc)
00677           {
00678         if (opterr)
00679           {
00680             /* 1003.2 specifies the format of this message.  */
00681             fprintf (stderr, "%s: option requires an argument -- %c\n",
00682                  argv[0], c);
00683           }
00684         optopt = c;
00685         if (optstring[0] == ':')
00686           c = ':';
00687         else
00688           c = '?';
00689           }
00690         else
00691           /* We already incremented `optind' once;
00692          increment it again when taking next ARGV-elt as argument.  */
00693           optarg = argv[optind++];
00694         nextchar = NULL;
00695       }
00696       }
00697     return c;
00698   }
00699 }

void exchange ( char ** argv ) [static]

Definition at line 245 of file getopt.c.

References first_nonopt, last_nonopt, and optind.

Referenced by _getopt_internal.

00247 {
00248   int bottom = first_nonopt;
00249   int middle = last_nonopt;
00250   int top = optind;
00251   char *tem;
00252
00253   /* Exchange the shorter segment with the far end of the longer segment.
00254      That puts the shorter segment into the right place.
00255      It leaves the longer segment in the right place overall,
00256      but it consists of two parts that need to be swapped next.  */
00257
00258   while (top > middle && middle > bottom)
00259     {
00260       if (top - middle > middle - bottom)
00261     {
00262       /* Bottom segment is the short one.  */
00263       int len = middle - bottom;
00264       register int i;
00265
00266       /* Swap it with the top part of the top segment.  */
00267       for (i = 0; i < len; i++)
00268         {
00269           tem = argv[bottom + i];
00270           argv[bottom + i] = argv[top - (middle - bottom) + i];
00271           argv[top - (middle - bottom) + i] = tem;
00272         }
00273       /* Exclude the moved bottom segment from further swapping.  */
00274       top -= len;
00275     }
00276       else
00277     {
00278       /* Top segment is the short one.  */
00279       int len = top - middle;
00280       register int i;
00281
00282       /* Swap it with the bottom part of the bottom segment.  */
00283       for (i = 0; i < len; i++)
00284         {
00285           tem = argv[bottom + i];
00286           argv[bottom + i] = argv[middle + i];
00287           argv[middle + i] = tem;
00288         }
00289       /* Exclude the moved top segment from further swapping.  */
00290       bottom += len;
00291     }
00292     }
00293
00294   /* Update records for the slots the non-options now occupy.  */
00295
00296   first_nonopt += (optind - last_nonopt);
00297   last_nonopt = optind;
00298 }

int getopt | ( | int | argc,
 |  | char ** | argv,
 |  | char * | optstring
 | ) |

Definition at line 708 of file getopt.c.

References _getopt_internal.

00710 {
00711   return _getopt_internal (argc, argv, optstring,
00712                (const struct option *) 0,
00713                (int *) 0,
00714                0);
00715 }

Variable Documentation

int first_nonopt [static]

Definition at line 227 of file getopt.c.

Referenced by _getopt_initialize, _getopt_internal, and exchange.

int last_nonopt [static]

Definition at line 228 of file getopt.c.

Referenced by _getopt_initialize, _getopt_internal, and exchange.

char* nextchar [static]

Definition at line 122 of file getopt.c.

Referenced by _getopt_initialize, and _getopt_internal.

char* optarg = NULL

Definition at line 98 of file getopt.c.

Referenced by _getopt_internal.

int opterr = 1

Definition at line 127 of file getopt.c.

int optind = 0

Definition at line 113 of file getopt.c.

Referenced by _getopt_initialize, _getopt_internal, and exchange.

int optopt = '?'

Definition at line 133 of file getopt.c.

Referenced by _getopt_internal.

enum { ... } ordering [static]

Referenced by _getopt_initialize, and _getopt_internal.

char* posixly_correct [static]

Definition at line 170 of file getopt.c.

Referenced by _getopt_initialize.

Generated on Sun Feb 24 01:22:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


getopt.h File Reference

common/getopt.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

struct | option

Defines

#define | _GETOPT_H 1
#define | __STDC__ 1
#define | __GNU_LIBRARY__ 1
#define | _LIBC 1
#define | no_argument 0
#define | required_argument 1
#define | optional_argument 2

Functions

int | getopt (int argc, char *const *argv, const char *shortopts)
int | getopt_long (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind)
int | getopt_long_only (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind)
int | _getopt_internal (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind, int long_only)

Variables

char * | optarg
int | optind
int | opterr
int | optopt

Define Documentation

#define __GNU_LIBRARY__ 1

Definition at line 23 of file getopt.h.

#define __STDC__ 1

Definition at line 22 of file getopt.h.

#define _GETOPT_H 1

Definition at line 15 of file getopt.h.

#define _LIBC 1

Definition at line 24 of file getopt.h.

#define no_argument 0

Definition at line 95 of file getopt.h.

Referenced by MacroTraversal::OnFile.

#define optional_argument 2

Definition at line 97 of file getopt.h.

#define required_argument 1

Definition at line 96 of file getopt.h.

Referenced by MacroTraversal::OnFile, and UCvsApp::UCvsApp.

Function Documentation

int _getopt_internal | ( | int | argc,
 |  | char *const * | argv,
 |  | const char * | shortopts,
 |  | const struct option * | longopts,
 |  | int * | longind,
 |  | int | long_only
 | ) |

Referenced by getopt, getopt_long, and getopt_long_only.

int getopt | ( | int | argc,
 |  | char *const * | argv,
 |  | const char * | shortopts
 | ) |

int getopt_long | ( | int | argc,
 |  | char *const * | argv,
 |  | const char * | shortopts,
 |  | const struct option * | longopts,
 |  | int * | longind
 | ) |

Definition at line 71 of file getopt1.c.

00074 {
00075   return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
00076 }

int getopt_long_only | ( | int | argc,
 |  | char *const * | argv,
 |  | const char * | shortopts,
 |  | const struct option * | longopts,
 |  | int * | longind
 | ) |

Definition at line 93 of file getopt1.c.

00096 {
00097   return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
00098 }

Variable Documentation

char* optarg

Definition at line 33 of file getopt.h.

int opterr

Definition at line 52 of file getopt.h.

int optind

Definition at line 47 of file getopt.h.

int optopt

Definition at line 56 of file getopt.h.

Generated on Sun Feb 24 01:22:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


getopt1.c File Reference

common/getopt1.c File Reference

#include "getopt.h"
#include <stdio.h>
#include <stdlib.h>

Include dependency graph for getopt1.c:

Include dependency graph

Go to the source code of this file.

Defines

#define | NULL 0

Functions

int | getopt_long (int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index)
int | getopt_long_only (int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index)

Define Documentation

#define NULL 0

Definition at line 58 of file getopt1.c.

Referenced by CCJReBar::_AddBar, _AfxRelease, _CjxChildWindowFromPoint, _GetComCtlVersion, _GetDropDownWidth, _getopt_initialize, _getopt_internal, _LoadSysColorBitmap, _statcore, CSubclassWndMap::Add, addAccel, CCJReBar::AddBar, PyMenuMgr::AddButton, CCJMenu::AddFromToolBar, PyMenuMgr::AddPulldown, CCJToolBar::AddReplaceBitmap, PyMenuMgr::AddSeparator, PyMenuMgr::AddToggle, CCJTabCtrlBar::AddToolTip, CCJTabView::AddView, CCJTabCtrlBar::AddView, CCJMemFile::Append, CCJMenu::AppendMenuA, CCJMenu::AppendMenuW, CCJMenu::AppendODMenuW, CCJListView::AutoSaveColumns, CCJListCtrl::AutoSaveColumns, CCJHtmlView::BeforeNavigate2, BrowserGetDirectory, BrowserGetMultiFiles, CCJSizeDockBar::CalcDynamicLayout, CCJReBar::CalcFixedLayout, CCJDockBar::CalcFixedLayout, CCJToolBar::CalcLayout, CCJToolBar::CalcSize, CCJSizeDockBar::CalcSizeBarLayout, CCJDockContext::CanDockDockBar, CGfxOutBarCtrl::CBarFolder::CBarFolder, CGfxOutBarCtrl::CBarItem::CBarItem, CBrowseFileView::CBrowseFileView, CCJBrowseButton::CCJBrowseButton, CCJCaption::CCJCaption, CCJCaptionPopupWnd::CCJCaptionPopupWnd, CCJColorPicker::CCJColorPicker, CCJColorPopup::CCJColorPopup, CCJControlBar::CCJControlBar, CCJExplorerBar::CCJExplorerBar, CCJFlatButton::CCJFlatButton, CCJFlatHeaderCtrl::CCJFlatHeaderCtrl, CCJFlatTabCtrl::CCJFlatTabCtrl, CCJHexEdit::CCJHexEdit, CCJHtmlView::CCJHtmlView, CCJHyperLink::CCJHyperLink, CCJListCtrl::CCJListCtrl, CCJListView::CCJListView, CCJMDIChildWnd::CCJMDIChildWnd, CCJMemFile::CCJMemFile, CCJMenu::CCJMenu, CCJMenuData::CCJMenuData, CCJOutlookBar::CCJOutlookBar, CCJStatusBarPaneControlInfo::CCJStatusBarPaneControlInfo, CCJToolBar::CCJToolBar, CCJTreeCtrl::CCJTreeCtrl, CCJWindowPlacement::CCJWindowPlacement, CCVSAlert::CCVSAlert, CGfxOutBarCtrl::CGfxOutBarCtrl, CCJTreeCtrl::ClearSelection, CCJMemFile::Close, CCJSortClass::Compare, KoDateColumn::Compare, CompatGetPassword, CompatGetValue, CompatMoveToTrash, Win32wstring::convert, PyMenuMgr::Count, CPython_Interp::CPython_Interp, CSplashWnd::Create, CGfxOutBarCtrl::Create, CCJToolBarCtrl::Create, CCJToolBar::Create, CCJReBarCtrl::Create, CCJReBar::Create, CCJPagerCtrl::Create, CCJMenuBar::Create, CCJHtmlView::Create, CCJMonthCalCtrl::Create, CCJDateTimeCtrl::Create, CCJComboBoxEx::Create, CCJColorPopup::Create, CCJCaptionPopupWnd::Create, CCJCaption::Create, CCJBrowseButton::Create, PyPersistent::Create, PyCmdUI::Create, PyMenuMgr::Create, PyColorConsole::Create, PyCvsEntry::Create, CCJToolBar::CreateEx, CreateFolder, CCJFlatTabCtrl::CreateTabFont, CCJTabCtrlBar::CreateTabView, CRevisionConsole::CRevisionConsole, CSubclassWnd::CSubclassWnd, CTipDlg::CTipDlg, cvs_err, cvs_errstr, cvs_out, cvs_outstr, CvsAlert, CvsArgs::CvsArgs, CvsCmdLogFolder, cvsgui_GetCvsEntries, cvsgui_GetFileModTime, cvsgui_GetHistoryAsXML, cvsgui_GetMainMenuWidget, cvsgui_GetSelection, cvsgui_GetTopMacroAdminMenu, cvsgui_GetTopMacroSelectionMenu, cvsgui_LaunchBrowser, cvsgui_LaunchTclMacro, cvsgui_PromptEditMessage, cvsgui_PromptMessage, cvsgui_RunCvs, cvsgui_write, CvsLogParse, CWndRedrawMngr::CWndRedrawMngr, DDV_CJMinMaxDateTime, DDV_CJMinMaxMonth, DDX_CJColorPicker, DDX_ComboMString, DeferClientPos, PyMenuMgr::Delete, PyMenuMgr::DeleteByCmd, CCJMenu::DeleteMenu, CCJTabCtrlBar::DeleteView, CHistComboBoxEx::DelKeyTest, CSmartComboBox::DelKeyTest, CCJMenu::DestroyMenu, CCJMenu::DitherBlt, DllMain, CCJMDIFrameWnd::DockSizeBar, CCJMDIChildWnd::DockSizeBar, CCJFrameWnd::DockSizeBar, CCJDockContext::DockSizeBar, CBrowseFileView::DoDrag, CCJFlatButton::DrawButtonBitmap, CPseudoButton::DrawButtonBitmap, CCJFlatButton::DrawButtonIcon, CCJCBarButton::DrawButtonIcon, CCJFlatButton::DrawButtonText, CCJCaptionButton::DrawButtonText, CCJCaption::DrawCaptionIcon, CCJCaption::DrawCaptionText, CCJColorPopup::DrawCell, CCJFlatComboBox::DrawCombo, CCJControlBar::DrawGriperCaption, CCJMetaFileButton::DrawItem, CCJMenu::DrawItem, CCJFlatHeaderCtrl::DrawItem, CCJFlatButton::DrawItem, CCJColorPicker::DrawItem, UCvsFiles::EditSel, CCJToolCmdUI::Enable, PyCmdUI::Enable, CCJControlBar::EnableDockingOnSizeBar, CCJMDIFrameWnd::EnableDockingSizeBar, CCJMDIChildWnd::EnableDockingSizeBar, CCJFrameWnd::EnableDockingSizeBar, CCJDockContext::EndDragDockBar, CCJHtmlView::ExecWB, CCJMemFile::Extract, UCvsConsole::FeedThisLine, FileTraverse, CCJToolBar::FindDropDownButton, CCJTreeCtrl::FindItem, FindNextChildWindow, FindNextSiblingWindow, CCVS_CoworkerModule::FindOneOf, FindPrevSiblingWindow, FindPrevWindow, findTcl, CCJSizeDockBar::FlatBorder, flushDisplay, garby_alloc, garby_free, garbyNew, garbyRemove, CCJHtmlView::GetAddressBar, CCJHtmlView::GetApplication, CWincvsApp::GetAppVersion, GetAsSystemTime, PyCvsEntry::GetAttr, PyContainer::GetAttr, CCJHtmlView::GetBusy, CCJToolBar::GetButtonText, CCJMonthCalCtrl::GetColor, CCJHtmlView::GetContainer, CCJMonthCalCtrl::GetCurSel, CCJDockContext::GetDockBar, CWincvsApp::GetDocument, CWincvsApp::GetFileView, CCJTreeCtrl::GetFirstSelectedItem, CGfxOutBarCtrl::GetFolderChild, CCJHtmlView::GetFullName, CCJHtmlView::GetFullScreen, CCJHtmlView::GetHeight, CCJHtmlView::GetHtmlDocument, CGfxOutBarCtrl::GetImageList, CCJReBarCtrl::GetImageList, CCJComboBoxEx::GetItem, CCJTreeCtrl::GetLastItem, CCJHtmlView::GetLeft, CCJHtmlView::GetLocationName, CCJHtmlView::GetLocationURL, CCJMonthCalCtrl::GetMaxSelCount, CCJHtmlView::GetMenuBar, CCJMenu::GetMenuText, CCJMonthCalCtrl::GetMinReqRect, CCJMonthCalCtrl::GetMonthDelta, CCJTreeCtrl::GetNextItem, GetNextParentWindow, CCJTreeCtrl::GetNextSelectedItem, CTipDlg::GetNextTipString, CCJHtmlView::GetOffline, CCJStatusBar::GetPanControl, CCJHtmlView::GetParentBrowser, CCJTreeCtrl::GetPrevItem, GetPrevParentWindow, CCJTreeCtrl::GetPrevSelectedItem, CCJHtmlView::GetProperty, CCJDateTimeCtrl::GetRange, CCJHtmlView::GetReadyState, CCJHtmlView::GetRegisterAsBrowser, CCJHtmlView::GetRegisterAsDropTarget, CCJHyperLink::GetRegKey, CCJMonthCalCtrl::GetSelRange, CCJHtmlView::GetSilent, CCJHtmlView::GetStatusBar, GetSubCMenu, CCJFlatTabCtrl::GetTabWidth, CCJHtmlView::GetTheaterMode, CCJDateTimeCtrl::GetTime, CCJMonthCalCtrl::GetToday, CCJHtmlView::GetToolBar, CCJTabCtrlBar::GetToolTip, CCJHtmlView::GetTop, CCJHtmlView::GetTopLevelContainer, CGraphDoc::GetTreeView, CCJHtmlView::GetType, PyPersistent::GetValue, GetValue::GetValue, CCJTabView::GetView, CCJTabCtrlBar::GetView, CCJTabCtrlBar::GetViewName, CCJHtmlView::GetVisible, glue_getenv, CCJHtmlView::GoBack, CCJHtmlView::GoForward, CCJHtmlView::GoHome, CCJHtmlView::GoSearch, CCJHyperLink::GotoURL, CCJFlatSplitterWnd::HideColumn, CCJFlatSplitterWnd::HideRow, CGfxOutBarCtrl::HighlightFolder, CGfxOutBarCtrl::HighlightItem, CCJSizeDockBar::HitTest, CCJControlBar::HitTest, CCJListView::HitTestEx, CCJListCtrl::HitTestEx, CSubclassWnd::HookWindow, CCJMemFile::Import, CRevisionConsole::init, CWincvsApp::InitATL, CCJColorPopup::Initialise, initialize_all, CCJFontCombo::InitializeFonts, InitializeInterp, CCJMDIFrameWnd::InitializeMenu, CWincvsApp::InitInstance, CPython_Interp::InitPythonSupport, CCJMemFile::Insert, CCJToolBar::InsertControl, CCJComboBoxEx::InsertItem, CCJMenu::InsertMenuW, CCJMenu::InsertODMenuW, CSubclassWnd::IsHooked, CCJSizeDockBar::IsLastControlBar, KoFilterModel::IsMatch, IsShellType, IsValidHandle, KoTraversalContext::KoTraversalContext, LaunchDiff, LaunchEditor, LayoutRowCol, listAddCell, listFree, listNew, CCJMemFile::Load, CvsPrefs::load, CPersistent::LoadAll, CCJToolBar::LoadBitmap, CCJMenu::LoadCheckmarkBitmap, CCJHtmlView::LoadFromResource, CCJMenuBar::LoadMenu, CCJMenu::LoadMenu, CCJMenu::LoadSysColorBitmap, CCJToolBar::LoadToolBar, CCJMenu::LoadToolbar, CCJWindowPlacement::LoadWindowPos, CSubclassWndMap::Lookup, MakeOleVariant, CCJSizeDockBar::Maximize, CCJMenu::MeasureItem, CCJMenu::ModifyODMenuW, CCJHexEdit::Move, mystrdup, myTcl_CreateInterp, CCJHtmlView::Navigate, CCJHtmlView::Navigate2, CCJMDIFrameWnd::NewMenu, CHistComboBoxEx::NewRoot, NotificationManager::Node::Node, CCJSizeDockBar::Normalize, NormalizeFn, CCJToolBar::OnBarStyleChange, CMainFrame::OnBroadcastCmdMsg, CGetPrefs_WINCVS::OnBtnhome, CImport_OPTIONS::OnBtnpath, CCheckout_MAIN::OnBtnPath, CDiff_MAIN::OnCheck1, CDiff_MAIN::OnCheck2, CCJBrowseButton::OnClicked, CCJMDIFrameWnd::OnClose, CCJFrameWnd::OnClose, CCJHexEdit::OnContextMenu, CSplashWnd::OnCreate, CMainFrame::OnCreate, CBarConsole::OnCreate, CCJFlatTabCtrl::OnCreate, CCJExplorerBar::OnCreate, CCJControlBar::OnCreate, CBrowseFileView::OnDestroy, CDynToolBar::OnDestroy, CGfxSplitterWnd::OnDrawSplitter, CCJFlatSplitterWnd::OnDrawSplitter, CWincvsView::OnDropFiles, CMainFrame::OnDropFiles, CCJHexEdit::OnEditPaste, CWincvsApp::OnFileNew, CCJHtmlView::OnFilePrint, KoMoveToTrashHandler::OnFiles, CCJReBar::OnHeightChange, CTipDlg::OnInitDialog, CEditorMonDlg::OnInitDialog, CCommit_MAIN::OnInitDialog, CAdminOptionDlg::OnInitDialog, CMainFrame::OnInitMenu, CGraphView::OnInitMenuPopup, UWidget::OnInitWidget, CGfxSplitterWnd::OnInvertTracker, CCJSizeDockBar::OnInvertTracker, CCJControlBar::OnInvertTracker, CAnnotate_MAIN::OnIsdate, CCJHexEdit::OnKeyDown, CCJMetaFileButton::OnLButtonDblClk, CCJFlatButton::OnLButtonDblClk, CGfxOutBarCtrl::OnLButtonDown, CCJTreeCtrl::OnLButtonDown, CCJControlBar::OnLButtonDown, CCJSizeDockBar::OnLButtonUp, CCJMenuBar::OnMenuSelect, CGfxOutBarCtrl::OnMouseMove, CCJOutlookBar::OnMouseMove, CCJHexEdit::OnMouseMove, CCJFlatComboBox::OnMouseMove, CCJFlatButton::OnMouseMove, CCJControlBar::OnMouseMove, CCJToolBar::OnNcCreate, CCJReBar::OnNcCreate, CCJMiniDockFrameWnd::OnNcLButtonDblClk, CCJMiniDockFrameWnd::OnNcLButtonDown, CCJFlatTabCtrl::OnPaint, CGfxOutBarCtrl::OnRButtonDown, CCJTabCtrl::OnRButtonDown, CCJFlatHeaderCtrl::OnRButtonDown, CCJControlBar::OnRButtonDown, CCJReBar::OnRecalcParent, CBrowseFileView::OnResetView, CCmdLine_MAIN::OnSelfolder, CCJReBar::OnShowBand, CCJHtmlView::OnSize, CCJHtmlView::OnStatusTextChange, CCJToolBar::OnSysColorChange, CCJFlatButton::OnTimer, CCJToolBar::OnToolHitTest, CCJReBar::OnToolHitTest, CCJToolBar::OnUpdateCmdUI, CCJControlBar::OnUpdateCmdUI, CExploreBar::OnWindowPosChanged, CCJTabView::OnWindowPosChanged, CCJTabCtrlBar::OnWindowPosChanged, CBrowserBar::OnWindowPosChanged, CCJMemFile::Open, UCvsConsole::OutColor, CCJTabCtrlBar::OverkillAssert, Authen::parse_cvsroot, PathNameFromDirID, PathNameFromWD, CWincvsApp::PeekPumpAndIdle, poolAlloc, poolFree, poolRemove, CCJHyperLink::PositionWindow, CProgressDialog::PostNcDestroy, CCJMDIFrameWnd::PreCreateWindow, CCJFrameWnd::PreCreateWindow, CCJFlatTabCtrl::PreCreateWindow, CSplashWnd::PreTranslateAppMessage, PyColorConsole::Print, CvsArgs::print, CCJHtmlView::PutProperty, PyAutoObject::PyAutoObject, CWincvsView::QueryAcceptData, CCJHtmlView::QueryStatusWB, read, ReadIgnoredFile, UToolbar::RebuildBar, CCJSizeDockBar::RecalcAllExcept, CCJMDIFrameWnd::RecalcAllExcept, CCJMDIChildWnd::RecalcAllExcept, CCJFrameWnd::RecalcAllExcept, CGfxSplitterWnd::RecalcLayout, CCJMDIFrameWnd::RecalcLayout, CCJMDIChildWnd::RecalcLayout, CCJFrameWnd::RecalcLayout, CCJMenuBar::RecomputeMenuLayout, CCJHtmlView::Refresh, CCJHtmlView::Refresh2, CSubclassWndMap::RemoveAll, CCJTabCtrlBar::RemoveAllTabs, CCJTabCtrlBar::RemoveListItem, CCJMenu::RemoveMenu, CCJStatusBar::RemovePane, CvsArgs::reset, CBrowseFileView::ResetView, CCJFlatHeaderCtrl::ResizeWindow, AuthenSSH::RsaIdentityFile, CCJMemFile::Save, CPersistent::SaveAll, CBrowseFileView::SaveColumns, CWincvsDoc::Serialize, CCJTabView::SetActiveView, CCJTabCtrlBar::SetActiveView, CCJHtmlView::SetAddressBar, CGfxOutBarCtrl::SetAnimSelHighlight, CCJToolBar::SetBitmap, CCJToolBar::SetButtons, CCJToolBar::SetButtonText, CCJToolCmdUI::SetCheck, PyCmdUI::SetCheck, CCJCaption::SetChildWindow, CCJMonthCalCtrl::SetColor, CCJMonthCalCtrl::SetCurSel, CCJHyperLink::SetDefaultCursor, CCJBrowseEdit::SetDlgDefExt, CCJBrowseEdit::SetDlgFileName, CCJBrowseEdit::SetDlgFilter, CCJBrowseEdit::SetDlgOwner, CCJBrowseEdit::SetDlgTitle, CCJMonthCalCtrl::SetFirstDayOfWeek, CGfxOutBarCtrl::SetFolderImageList, CGfxOutBarCtrl::SetFolderText, CCJHtmlView::SetFullScreen, CCJHtmlView::SetHeight, CCJToolBar::SetHeight, CGfxOutBarCtrl::SetImageList, CCJComboBoxEx::SetItem, CGfxOutBarCtrl::SetItemText, CCJHtmlView::SetLeft, CCJHyperLink::SetLinkCursor, KoFilterModel::SetMask, CCJMonthCalCtrl::SetMaxSelCount, CCJHtmlView::SetMenuBar, CCJMonthCalCtrl::SetMonthDelta, CWinCvsBrowser::SetNewStyle, CCJHtmlView::SetOffline, CCJToolBar::SetOwner, CCJMonthCalCtrl::SetRange, CCJDateTimeCtrl::SetRange, CCJHtmlView::SetRegisterAsBrowser, CCJHtmlView::SetRegisterAsDropTarget, CCJMonthCalCtrl::SetSelRange, CCJHtmlView::SetSilent, CCJFlatHeaderCtrl::SetSortImage, CCJHtmlView::SetStatusBar, PyCmdUI::SetText, CCJHtmlView::SetTheaterMode, CCJDateTimeCtrl::SetTime, CCJMonthCalCtrl::SetToday, CCJHtmlView::SetToolBar, CCJHtmlView::SetTop, PyPersistent::SetValue, CCJTabCtrlBar::SetViewToolTip, CCJHtmlView::SetVisible, CCJMenuData::SetWideString, shl_calloc, shl_free, shl_malloc, shl_realloc, CCJFlatSplitterWnd::ShowColumn, CCJFlatSplitterWnd::ShowRow, CSplashWnd::ShowSplashScreen, CWincvsApp::ShowTipAtStartup, CCJMonthCalCtrl::SizeMinReq, CCJTabCtrlBar::SizeTabView, CCJToolBar::SizeToolBar, Authen::skiptoken, CCJHtmlView::Stop, CCJMenu::SynchronizeMenu, tclGetDebugMaskProc, tclGetFileModTimeProc, tclSetDebugMaskProc, TestBuffer, testCVS, CCJDockContext::ToggleDocking, CCJDockContext::TrackDockBar, TrimRight, UAppConsole, unmodified, PyAutoObject::UnRef, CWincvsApp::UpdateAllDocsView, CWinLogBranchData::UpdateSelf, CWinLogTagData::UpdateSelf, CWinLogRevData::UpdateSelf, CWinLogHeaderData::UpdateSelf, updateUIMenu, USmartCombo::USmartCombo, UWinPseudoWindowProc, VRef2VolName, wire_read_string, wnt_fstat, wnt_lstat, wnt_stat, CCJToolBar::WrapToolBar, write, CCJHtmlView::~CCJHtmlView, CCJMemFile::~CCJMemFile, CSplashWnd::~CSplashWnd, CSubclassWnd::~CSubclassWnd, and CTipDlg::~CTipDlg.

Function Documentation

int getopt_long | ( | int | argc,
 |  | char *const * | argv,
 |  | const char * | options,
 |  | const struct option * | long_options,
 |  | int * | opt_index
 | ) |

Definition at line 71 of file getopt1.c.

References _getopt_internal.

00074 {
00075   return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
00076 }

int getopt_long_only | ( | int | argc,
 |  | char *const * | argv,
 |  | const char * | options,
 |  | const struct option * | long_options,
 |  | int * | opt_index
 | ) |

Definition at line 93 of file getopt1.c.

References _getopt_internal.

00096 {
00097   return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
00098 }

Generated on Sun Feb 24 01:22:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GetPassword.cpp File Reference

common/GetPassword.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "GetPassword.h"
#include "CPStr.h"

Include dependency graph for GetPassword.cpp:

Include dependency graph

Go to the source code of this file.

Functions

char * CompatGetPassword (const char *prompt)

Function Documentation

char* CompatGetPassword ( const char * prompt )

Definition at line 164 of file GetPassword.cpp.

References EV_INIT_WIDGET, GetEnvValue, kUMainWidget, UStr::length, GetPassword::m_passwd, NULL, UCreate_PasswdDlg, and UEventSendMessage.

00165 {
00166 #ifdef WIN32
00167     static char passwd[255];
00168     GetPassword gp;
00169     if(gp.DoModal() == IDOK)
00170     {
00171         strcpy(passwd, gp.m_passwd);
00172         return passwd;
00173     }
00174     return "";
00175 #endif /* WIN32 */
00176 #ifdef qMacCvsPP
00177     if(!CMacCvsApp::gApp->IsFrontProcess() && CMacCvsApp::gApp->NotifyUser(0L))
00178     {
00179         while(!CMacCvsApp::gApp->IsFrontProcess())
00180         {
00181             CMacCvsApp::gApp->SpendSomeTime();
00182         }
00183     }
00184
00185     static UStr thepasswd;
00186     KCItemRef theItem               = NULL;
00187
00188     LStr255 pstr;
00189     UStr realPrompt;
00190 #if !qCarbon || UNIVERSAL_INTERFACES_VERSION >= 0x0334
00191     LStr255 phost, puser;
00192     bool doUseKeyChain = false;
00193     OSStatus theStatus;
00194     UStr loopKey;
00195 #endif
00196
00197     if(GetEnvValue(prompt, "prompt", realPrompt))
00198     {
00199         pstr = realPrompt;
00200
00201 #if !qCarbon || UNIVERSAL_INTERFACES_VERSION >= 0x0334
00202         // copied from MacCvsPro::CMacCVSDoc.cpp
00203         UStr host, user, authen;
00204         if(CMacCvsApp::CanUseKeychain() &&
00205             GetEnvValue(prompt, "host", host) &&
00206             GetEnvValue(prompt, "user", user))
00207         {
00208             doUseKeyChain = true;
00209
00210             OSStatus theStatus;
00211             UInt32 theLength;
00212
00213             phost = host;
00214             puser = user;
00215
00216             UStr authen;
00217             if(GetEnvValue(prompt, "authen", authen))
00218             {
00219                 phost += ":";
00220                 phost += authen;
00221             }
00222
00223             UStr dir;
00224             if(GetEnvValue(prompt, "dir", dir))
00225             {
00226                 phost += ":";
00227                 phost += dir;
00228             }
00229
00230             static char ppass[255];
00231
00232             theStatus = KCFindGenericPassword(phost, puser, sizeof(ppass) - 1,
00233                 ppass, &theLength, &theItem);
00234
00235             user = puser;
00236             host = phost;
00237             loopKey = user;
00238             loopKey << '@';
00239             loopKey << host;
00240             // we could have an endless loop is the password is not valid
00241             if (theStatus == noErr && CMacCvsApp::gApp->CheckLoopingPassword(loopKey))
00242             {
00243                 if (theItem != NULL)
00244                     KCReleaseItem(&theItem);
00245
00246                 ppass[theLength] = '\0';
00247
00248                 return ppass;
00249             }
00250         }
00251 #endif
00252     }
00253     else
00254         pstr = prompt;
00255
00256     StDialogHandler theHandler(dlg_Passwd, LCommander::GetTopCommander());
00257     LWindow *theDialog = theHandler.GetDialog();
00258     ThrowIfNil_(theDialog);
00259
00260     LEditText *passwd = dynamic_cast<LEditText*>
00261         (theDialog->FindPaneByID(item_GetPasswd));
00262     LStaticText *promptbox = dynamic_cast<LStaticText*>
00263         (theDialog->FindPaneByID('PROM'));
00264     theDialog->SetLatentSub(passwd);
00265
00266     promptbox->SetText(pstr);
00267
00268     theDialog->Show();
00269     MessageT hitMessage;
00270     while (true)
00271     {       // Let DialogHandler process events
00272         hitMessage = theHandler.DoDialog();
00273
00274         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00275             break;
00276     }
00277     theDialog->Hide();
00278
00279     if(hitMessage == msg_OK)
00280     {
00281         passwd->GetText(pstr);
00282
00283 #if !qCarbon || UNIVERSAL_INTERFACES_VERSION >= 0x0334
00284         if (doUseKeyChain && CMacCvsApp::CanUseKeychain())
00285         {
00286             if (theItem != NULL)
00287             {
00288                 theStatus = KCSetData(theItem, pstr[0], &pstr[1]);
00289
00290                 if (theStatus == noErr)
00291                     theStatus = KCUpdateItem(theItem);
00292             }
00293             else
00294             {
00295                 theStatus = KCAddGenericPassword(phost, puser,
00296                     pstr[0], &pstr[1], &theItem);
00297
00298                 KCAttribute theAttribute;
00299
00300                 if (theStatus == noErr)
00301                 {
00302                     UStr theDescriptionText("MacCVS password");
00303                     theAttribute.tag = kDescriptionKCItemAttr;
00304                     theAttribute.length = theDescriptionText.length();
00305                     theAttribute.data = (void *)(const char *)theDescriptionText;
00306                     theStatus = KCSetAttribute(theItem, &theAttribute);
00307                 }
00308
00309                 OSType theTypeCreator;
00310
00311                 if (theStatus == noErr)
00312                 {
00313                     theTypeCreator = 'mCVS';
00314                     theAttribute.tag = kCreatorKCItemAttr;
00315                     theAttribute.length = sizeof(theTypeCreator);
00316                     theAttribute.data = &theTypeCreator;
00317                     theStatus = KCSetAttribute(theItem, &theAttribute);
00318                 }
00319
00320                 if (theStatus == noErr)
00321                 {
00322                     theTypeCreator = 'APPL';
00323                     theAttribute.tag = kTypeKCItemAttr;
00324                     theStatus = KCSetAttribute(theItem, &theAttribute);
00325                 }
00326
00327                 if (theStatus == noErr)
00328                 {
00329                     Boolean theCustomIcon = true;
00330                     theAttribute.tag = kCustomIconKCItemAttr;
00331                     theAttribute.length = sizeof(theCustomIcon);
00332                     theAttribute.data = &theCustomIcon;
00333                     theStatus = KCSetAttribute(theItem, &theAttribute);
00334                 }
00335
00336                 if (theStatus == noErr)
00337                     theStatus = KCUpdateItem(theItem);
00338             }
00339
00340             if (theItem != NULL)
00341                 KCReleaseItem(&theItem);
00342
00343             CMacCvsApp::gApp->PushValidPassword(loopKey);
00344         }
00345 #endif
00346
00347         thepasswd = pstr;
00348         return thepasswd.length() == 0 ? (char *)"" : (char *)thepasswd;
00349     }
00350
00351 #if !qCarbon || UNIVERSAL_INTERFACES_VERSION >= 0x0334
00352     if (theItem != NULL)
00353         KCReleaseItem(&theItem);
00354 #endif
00355
00356     return "";
00357 #endif /* qMacCvsPP */
00358 #if qUnix
00359     static char passwd[255];
00360     void *wid = UCreate_PasswdDlg();
00361
00362     UCvsGetPasswd *dlg = new UCvsGetPasswd();
00363     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00364
00365     if(dlg->DoModal())
00366     {
00367         strcpy(passwd, dlg->m_passwd);
00368     }
00369     else
00370         strcpy(passwd, "");
00371
00372     delete dlg;
00373     return passwd;
00374 #endif // qUnix
00375 }

Generated on Sun Feb 24 01:22:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GetPassword.h File Reference

common/GetPassword.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | GetPassword

Defines

#define | AFX_GETPASSWORD_H__5946A8C4_8517_11D1_8949_444553540000__INCLUDED_

Functions

char * | CompatGetPassword (const char *prompt)

Define Documentation

#define AFX_GETPASSWORD_H__5946A8C4_8517_11D1_8949_444553540000__INCLUDED_

Definition at line 22 of file GetPassword.h.

Function Documentation

char* CompatGetPassword ( const char * prompt )

Definition at line 164 of file GetPassword.cpp.

Referenced by glue_getenv.

00165 {
00166 #ifdef WIN32
00167     static char passwd[255];
00168     GetPassword gp;
00169     if(gp.DoModal() == IDOK)
00170     {
00171         strcpy(passwd, gp.m_passwd);
00172         return passwd;
00173     }
00174     return "";
00175 #endif /* WIN32 */
00176 #ifdef qMacCvsPP
00177     if(!CMacCvsApp::gApp->IsFrontProcess() && CMacCvsApp::gApp->NotifyUser(0L))
00178     {
00179         while(!CMacCvsApp::gApp->IsFrontProcess())
00180         {
00181             CMacCvsApp::gApp->SpendSomeTime();
00182         }
00183     }
00184
00185     static UStr thepasswd;
00186     KCItemRef theItem               = NULL;
00187
00188     LStr255 pstr;
00189     UStr realPrompt;
00190 #if !qCarbon || UNIVERSAL_INTERFACES_VERSION >= 0x0334
00191     LStr255 phost, puser;
00192     bool doUseKeyChain = false;
00193     OSStatus theStatus;
00194     UStr loopKey;
00195 #endif
00196
00197     if(GetEnvValue(prompt, "prompt", realPrompt))
00198     {
00199         pstr = realPrompt;
00200
00201 #if !qCarbon || UNIVERSAL_INTERFACES_VERSION >= 0x0334
00202         // copied from MacCvsPro::CMacCVSDoc.cpp
00203         UStr host, user, authen;
00204         if(CMacCvsApp::CanUseKeychain() &&
00205             GetEnvValue(prompt, "host", host) &&
00206             GetEnvValue(prompt, "user", user))
00207         {
00208             doUseKeyChain = true;
00209
00210             OSStatus theStatus;
00211             UInt32 theLength;
00212
00213             phost = host;
00214             puser = user;
00215
00216             UStr authen;
00217             if(GetEnvValue(prompt, "authen", authen))
00218             {
00219                 phost += ":";
00220                 phost += authen;
00221             }
00222
00223             UStr dir;
00224             if(GetEnvValue(prompt, "dir", dir))
00225             {
00226                 phost += ":";
00227                 phost += dir;
00228             }
00229
00230             static char ppass[255];
00231
00232             theStatus = KCFindGenericPassword(phost, puser, sizeof(ppass) - 1,
00233                 ppass, &theLength, &theItem);
00234
00235             user = puser;
00236             host = phost;
00237             loopKey = user;
00238             loopKey << '@';
00239             loopKey << host;
00240             // we could have an endless loop is the password is not valid
00241             if (theStatus == noErr && CMacCvsApp::gApp->CheckLoopingPassword(loopKey))
00242             {
00243                 if (theItem != NULL)
00244                     KCReleaseItem(&theItem);
00245
00246                 ppass[theLength] = '\0';
00247
00248                 return ppass;
00249             }
00250         }
00251 #endif
00252     }
00253     else
00254         pstr = prompt;
00255
00256     StDialogHandler theHandler(dlg_Passwd, LCommander::GetTopCommander());
00257     LWindow *theDialog = theHandler.GetDialog();
00258     ThrowIfNil_(theDialog);
00259
00260     LEditText *passwd = dynamic_cast<LEditText*>
00261         (theDialog->FindPaneByID(item_GetPasswd));
00262     LStaticText *promptbox = dynamic_cast<LStaticText*>
00263         (theDialog->FindPaneByID('PROM'));
00264     theDialog->SetLatentSub(passwd);
00265
00266     promptbox->SetText(pstr);
00267
00268     theDialog->Show();
00269     MessageT hitMessage;
00270     while (true)
00271     {       // Let DialogHandler process events
00272         hitMessage = theHandler.DoDialog();
00273
00274         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00275             break;
00276     }
00277     theDialog->Hide();
00278
00279     if(hitMessage == msg_OK)
00280     {
00281         passwd->GetText(pstr);
00282
00283 #if !qCarbon || UNIVERSAL_INTERFACES_VERSION >= 0x0334
00284         if (doUseKeyChain && CMacCvsApp::CanUseKeychain())
00285         {
00286             if (theItem != NULL)
00287             {
00288                 theStatus = KCSetData(theItem, pstr[0], &pstr[1]);
00289
00290                 if (theStatus == noErr)
00291                     theStatus = KCUpdateItem(theItem);
00292             }
00293             else
00294             {
00295                 theStatus = KCAddGenericPassword(phost, puser,
00296                     pstr[0], &pstr[1], &theItem);
00297
00298                 KCAttribute theAttribute;
00299
00300                 if (theStatus == noErr)
00301                 {
00302                     UStr theDescriptionText("MacCVS password");
00303                     theAttribute.tag = kDescriptionKCItemAttr;
00304                     theAttribute.length = theDescriptionText.length();
00305                     theAttribute.data = (void *)(const char *)theDescriptionText;
00306                     theStatus = KCSetAttribute(theItem, &theAttribute);
00307                 }
00308
00309                 OSType theTypeCreator;
00310
00311                 if (theStatus == noErr)
00312                 {
00313                     theTypeCreator = 'mCVS';
00314                     theAttribute.tag = kCreatorKCItemAttr;
00315                     theAttribute.length = sizeof(theTypeCreator);
00316                     theAttribute.data = &theTypeCreator;
00317                     theStatus = KCSetAttribute(theItem, &theAttribute);
00318                 }
00319
00320                 if (theStatus == noErr)
00321                 {
00322                     theTypeCreator = 'APPL';
00323                     theAttribute.tag = kTypeKCItemAttr;
00324                     theStatus = KCSetAttribute(theItem, &theAttribute);
00325                 }
00326
00327                 if (theStatus == noErr)
00328                 {
00329                     Boolean theCustomIcon = true;
00330                     theAttribute.tag = kCustomIconKCItemAttr;
00331                     theAttribute.length = sizeof(theCustomIcon);
00332                     theAttribute.data = &theCustomIcon;
00333                     theStatus = KCSetAttribute(theItem, &theAttribute);
00334                 }
00335
00336                 if (theStatus == noErr)
00337                     theStatus = KCUpdateItem(theItem);
00338             }
00339
00340             if (theItem != NULL)
00341                 KCReleaseItem(&theItem);
00342
00343             CMacCvsApp::gApp->PushValidPassword(loopKey);
00344         }
00345 #endif
00346
00347         thepasswd = pstr;
00348         return thepasswd.length() == 0 ? (char *)"" : (char *)thepasswd;
00349     }
00350
00351 #if !qCarbon || UNIVERSAL_INTERFACES_VERSION >= 0x0334
00352     if (theItem != NULL)
00353         KCReleaseItem(&theItem);
00354 #endif
00355
00356     return "";
00357 #endif /* qMacCvsPP */
00358 #if qUnix
00359     static char passwd[255];
00360     void *wid = UCreate_PasswdDlg();
00361
00362     UCvsGetPasswd *dlg = new UCvsGetPasswd();
00363     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00364
00365     if(dlg->DoModal())
00366     {
00367         strcpy(passwd, dlg->m_passwd);
00368     }
00369     else
00370         strcpy(passwd, "");
00371
00372     delete dlg;
00373     return passwd;
00374 #endif // qUnix
00375 }

Generated on Sun Feb 24 01:22:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GetPrefs.cpp File Reference

common/GetPrefs.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "umain.h"
#include <afxdao.h>
#include "GetPrefs.h"
#include "CvsPrefs.h"
#include "Authen.h"
#include "AppConsole.h"
#include "AppGlue.h"
#include "PromptFiles.h"
#include "MultiFiles.h"
#include "CvsArgs.h"
#include "FileTraversal.h"

Include dependency graph for GetPrefs.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void CompatGetPrefs (void)

Function Documentation

void CompatGetPrefs ( void )

Definition at line 1449 of file GetPrefs.cpp.

References cvs_out, EV_INIT_WIDGET, kUMainWidget, MacBinMaps::LoadDefaults, MacBinMaps::SaveDefaults, CMacBinTable::SetCurrentMap, CGetPrefs_CVSCMD_DIALOGS::StoreValues, CGetPrefs_WINCVS::StoreValues, CGetPrefs_GLOBALS::StoreValues, CGetPrefs_CVSROOT::StoreValues, UCreate_gcvs_Settings, and UEventSendMessage.

Referenced by CWincvsDoc::OnAppPreferences, UCvsFrame::OnCmdPreferences, and UCvsApp::SayWelcome.

01450 {
01451     bool userHitOK = false;
01452
01453 #ifdef WIN32
01454     CPropertySheet pages("WinCvs Preferences");
01455     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01456     CGetPrefs_CVSROOT page1;
01457     CGetPrefs_GLOBALS page2;
01458     CGetPrefs_WINCVS page4;
01459     CGetPrefs_CVSCMD_DIALOGS page5;
01460     pages.AddPage(&page1);
01461     pages.AddPage(&page2);
01462     pages.AddPage(&page4);
01463     pages.AddPage(&page5);
01464     if(pages.DoModal() == IDOK)
01465     {
01466         page1.StoreValues();
01467         page2.StoreValues();
01468         page4.StoreValues();
01469         page5.StoreValues();
01470         userHitOK = true;
01471     }
01472 #endif /* WIN32 */
01473 #ifdef qMacCvsPP
01474     MacBinMaps maps;
01475     maps.LoadDefaults();
01476     CMacBinTable::SetCurrentMap(&maps);
01477
01478     StDialogHandler theHandler(dlg_Prefs, LCommander::GetTopCommander());
01479     LWindow *theDialog = theHandler.GetDialog();
01480     ThrowIfNil_(theDialog);
01481     static UInt16 sRuntimePanel = 1;
01482
01483     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01484         (theDialog->FindPaneByID(item_MultiViewPrefs));
01485     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01486
01487     UCvsPrefs_CVSROOT *handler = new UCvsPrefs_CVSROOT;
01488     ThrowIfNil_(handler);
01489
01490     UEventSendMessage(handler->GetWidID(), EV_INIT_WIDGET, 0, theDialog);
01491
01492     multiView->SwitchToPanel(5);
01493     DoDataExchange_Fonts(theDialog, true);
01494     multiView->SwitchToPanel(4);
01495     DoDataExchange_BinFiles(theDialog, maps, true);
01496     multiView->SwitchToPanel(3);
01497     DoDataExchange_TextFiles(theDialog, true);
01498     multiView->SwitchToPanel(2);
01499     DoDataExchange_Globals(theDialog, true);
01500     multiView->SwitchToPanel(1);
01501     DoDataExchange_Cvsroot(handler, true);
01502
01503     groupView->SetValue(sRuntimePanel);
01504     theDialog->Show();
01505     MessageT hitMessage;
01506     while (true)
01507     {       // Let DialogHandler process events
01508         hitMessage = theHandler.DoDialog();
01509
01510         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01511             break;
01512     }
01513     theDialog->Hide();
01514     sRuntimePanel = groupView->GetValue();
01515
01516     if(hitMessage == msg_OK)
01517     {
01518         userHitOK = true;
01519
01520         multiView->SwitchToPanel(1);
01521         DoDataExchange_Cvsroot(handler, false);
01522         multiView->SwitchToPanel(2);
01523         DoDataExchange_Globals(theDialog, false);
01524         multiView->SwitchToPanel(3);
01525         DoDataExchange_TextFiles(theDialog, false);
01526         multiView->SwitchToPanel(4);
01527         DoDataExchange_BinFiles(theDialog, maps, false);
01528         multiView->SwitchToPanel(5);
01529         DoDataExchange_Fonts(theDialog, false);
01530
01531         maps.SaveDefaults();
01532     }
01533 #endif /* qMacCvsPP */
01534 #if qUnix
01535     void *wid = UCreate_gcvs_Settings();
01536
01537     UCvsPrefs_MAIN *dlg = new UCvsPrefs_MAIN();
01538     UCvsPrefs_CVSROOT *tab1 = new UCvsPrefs_CVSROOT();
01539     UCvsPrefs_GLOBALS *tab2 = new UCvsPrefs_GLOBALS();
01540     UCvsPrefs_PORTS *tab3 = new UCvsPrefs_PORTS();
01541     UCvsPrefs_PROXY *tab4 = new UCvsPrefs_PROXY();
01542     UCvsPrefs_GCVS *tab5 = new UCvsPrefs_GCVS();
01543     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01544     dlg->AddPage(tab1, UCvsPrefs_MAIN::kTabGeneral, 0);
01545     dlg->AddPage(tab2, UCvsPrefs_MAIN::kTabGeneral, 1);
01546     dlg->AddPage(tab3, UCvsPrefs_MAIN::kTabGeneral, 2);
01547     dlg->AddPage(tab4, UCvsPrefs_MAIN::kTabGeneral, 3);
01548     dlg->AddPage(tab5, UCvsPrefs_MAIN::kTabGeneral, 4);
01549
01550     if(dlg->DoModal())
01551     {
01552         tab1->StoreValues();
01553         tab2->StoreValues();
01554         tab3->StoreValues();
01555         tab4->StoreValues();
01556         tab5->StoreValues();
01557
01558         userHitOK = true;
01559     }
01560     delete dlg;
01561 #endif // qUnix
01562
01563     if(userHitOK && !gCvsPrefs.empty())
01564     {
01565         cvs_out("NEW CVSROOT: %s (%s)\n", (const char *)gCvsPrefs, gAuthen.kindstr());
01566         gCvsPrefs.save();
01567     }
01568 }

Generated on Sun Feb 24 01:22:03 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GetPrefs.h File Reference

common/GetPrefs.h File Reference

#include "SmartComboBox.h"
#include "Authen.h"

Include dependency graph for GetPrefs.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CGetPrefs_CVSCMD_DIALOGS
class | CGetPrefs_CVSROOT
class | CGetPrefs_GLOBALS
class | CGetPrefs_WINCVS

Defines

#define | AFX_GETPREFS_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Functions

void | CompatGetPrefs (void)

Define Documentation

#define AFX_GETPREFS_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Definition at line 22 of file GetPrefs.h.

Function Documentation

void CompatGetPrefs ( void )

Definition at line 1449 of file GetPrefs.cpp.

01450 {
01451     bool userHitOK = false;
01452
01453 #ifdef WIN32
01454     CPropertySheet pages("WinCvs Preferences");
01455     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01456     CGetPrefs_CVSROOT page1;
01457     CGetPrefs_GLOBALS page2;
01458     CGetPrefs_WINCVS page4;
01459     CGetPrefs_CVSCMD_DIALOGS page5;
01460     pages.AddPage(&page1);
01461     pages.AddPage(&page2);
01462     pages.AddPage(&page4);
01463     pages.AddPage(&page5);
01464     if(pages.DoModal() == IDOK)
01465     {
01466         page1.StoreValues();
01467         page2.StoreValues();
01468         page4.StoreValues();
01469         page5.StoreValues();
01470         userHitOK = true;
01471     }
01472 #endif /* WIN32 */
01473 #ifdef qMacCvsPP
01474     MacBinMaps maps;
01475     maps.LoadDefaults();
01476     CMacBinTable::SetCurrentMap(&maps);
01477
01478     StDialogHandler theHandler(dlg_Prefs, LCommander::GetTopCommander());
01479     LWindow *theDialog = theHandler.GetDialog();
01480     ThrowIfNil_(theDialog);
01481     static UInt16 sRuntimePanel = 1;
01482
01483     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01484         (theDialog->FindPaneByID(item_MultiViewPrefs));
01485     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01486
01487     UCvsPrefs_CVSROOT *handler = new UCvsPrefs_CVSROOT;
01488     ThrowIfNil_(handler);
01489
01490     UEventSendMessage(handler->GetWidID(), EV_INIT_WIDGET, 0, theDialog);
01491
01492     multiView->SwitchToPanel(5);
01493     DoDataExchange_Fonts(theDialog, true);
01494     multiView->SwitchToPanel(4);
01495     DoDataExchange_BinFiles(theDialog, maps, true);
01496     multiView->SwitchToPanel(3);
01497     DoDataExchange_TextFiles(theDialog, true);
01498     multiView->SwitchToPanel(2);
01499     DoDataExchange_Globals(theDialog, true);
01500     multiView->SwitchToPanel(1);
01501     DoDataExchange_Cvsroot(handler, true);
01502
01503     groupView->SetValue(sRuntimePanel);
01504     theDialog->Show();
01505     MessageT hitMessage;
01506     while (true)
01507     {       // Let DialogHandler process events
01508         hitMessage = theHandler.DoDialog();
01509
01510         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01511             break;
01512     }
01513     theDialog->Hide();
01514     sRuntimePanel = groupView->GetValue();
01515
01516     if(hitMessage == msg_OK)
01517     {
01518         userHitOK = true;
01519
01520         multiView->SwitchToPanel(1);
01521         DoDataExchange_Cvsroot(handler, false);
01522         multiView->SwitchToPanel(2);
01523         DoDataExchange_Globals(theDialog, false);
01524         multiView->SwitchToPanel(3);
01525         DoDataExchange_TextFiles(theDialog, false);
01526         multiView->SwitchToPanel(4);
01527         DoDataExchange_BinFiles(theDialog, maps, false);
01528         multiView->SwitchToPanel(5);
01529         DoDataExchange_Fonts(theDialog, false);
01530
01531         maps.SaveDefaults();
01532     }
01533 #endif /* qMacCvsPP */
01534 #if qUnix
01535     void *wid = UCreate_gcvs_Settings();
01536
01537     UCvsPrefs_MAIN *dlg = new UCvsPrefs_MAIN();
01538     UCvsPrefs_CVSROOT *tab1 = new UCvsPrefs_CVSROOT();
01539     UCvsPrefs_GLOBALS *tab2 = new UCvsPrefs_GLOBALS();
01540     UCvsPrefs_PORTS *tab3 = new UCvsPrefs_PORTS();
01541     UCvsPrefs_PROXY *tab4 = new UCvsPrefs_PROXY();
01542     UCvsPrefs_GCVS *tab5 = new UCvsPrefs_GCVS();
01543     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01544     dlg->AddPage(tab1, UCvsPrefs_MAIN::kTabGeneral, 0);
01545     dlg->AddPage(tab2, UCvsPrefs_MAIN::kTabGeneral, 1);
01546     dlg->AddPage(tab3, UCvsPrefs_MAIN::kTabGeneral, 2);
01547     dlg->AddPage(tab4, UCvsPrefs_MAIN::kTabGeneral, 3);
01548     dlg->AddPage(tab5, UCvsPrefs_MAIN::kTabGeneral, 4);
01549
01550     if(dlg->DoModal())
01551     {
01552         tab1->StoreValues();
01553         tab2->StoreValues();
01554         tab3->StoreValues();
01555         tab4->StoreValues();
01556         tab5->StoreValues();
01557
01558         userHitOK = true;
01559     }
01560     delete dlg;
01561 #endif // qUnix
01562
01563     if(userHitOK && !gCvsPrefs.empty())
01564     {
01565         cvs_out("NEW CVSROOT: %s (%s)\n", (const char *)gCvsPrefs, gAuthen.kindstr());
01566         gCvsPrefs.save();
01567     }
01568 }

Generated on Sun Feb 24 01:22:03 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GetValue.cpp File Reference

common/GetValue.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "GetValue.h"

Include dependency graph for GetValue.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool CompatGetValue (char *value, const char *defvalue, const char *title)

Function Documentation

bool CompatGetValue | ( | char * | value,
 |  | const char * | defvalue,
 |  | const char * | title
 | ) |

Definition at line 92 of file GetValue.cpp.

References GetDItemHdl, GetValue::m_value, and NULL.

00093 {
00094 #ifdef WIN32
00095     GetValue gv(defvalue, title);
00096     if(gv.DoModal() == IDOK)
00097     {
00098         strcpy(value, gv.m_value);
00099         return true;
00100     }
00101     return false;
00102 #endif /* WIN32 */
00103 #ifdef macintosh
00104     GrafPtr     OldPort;
00105     DialogPtr   alertDialog;
00106     short       WhichItem = 0;
00107     Str255 pdef = {'\0'}, ptitle = {'\0'}, pvalue;
00108
00109     if(defvalue != NULL)
00110     {
00111         strcpy((char *)pdef, defvalue);
00112         c2pstr((char *)pdef);
00113     }
00114     if(title != NULL)
00115     {
00116         strcpy((char *)ptitle, title);
00117         c2pstr((char *)ptitle);
00118     }
00119
00120     GetPort(&OldPort);
00121     alertDialog = GetNewDialog(kDlgIdGetValue, NULL, (WindowPtr)-1);
00122     SetPort(alertDialog);
00123
00124     SetDialogItemText(GetDItemHdl(alertDialog, 3), pdef);
00125     SetDialogItemText(GetDItemHdl(alertDialog, 4), ptitle);
00126
00127     while(WhichItem != 1 && WhichItem != 2)
00128     {
00129         ModalDialog(NULL, &WhichItem);
00130
00131         if(WhichItem == 1)
00132         {
00133             GetDialogItemText(GetDItemHdl(alertDialog, 3), pvalue);
00134             if(pvalue[0] == '\0')
00135                 WhichItem = 0;
00136         }
00137     }
00138
00139     if(WhichItem == 1)
00140     {
00141         GetDialogItemText(GetDItemHdl(alertDialog, 3), pvalue);
00142         p2cstr(pvalue);
00143         strcpy(value, (char *)pvalue);
00144     }
00145
00146     DisposeDialog(alertDialog);
00147     SetPort(OldPort);
00148
00149     return WhichItem == 1;
00150 #endif /* macintosh */
00151 #ifdef UNIX_CVS
00152     return false;
00153 #endif /* UNIX_CVS */
00154 }

Generated on Sun Feb 24 01:22:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GetValue.h File Reference

common/GetValue.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | GetValue

Defines

#define | AFX_GETVALUE_H__5946A8C3_8517_11D1_8949_444553540000__INCLUDED_
#define | MAX_VALUE_LEN 1024

Functions

bool | CompatGetValue (char *value, const char *defvalue=0L, const char *title=0L)

Define Documentation

#define AFX_GETVALUE_H__5946A8C3_8517_11D1_8949_444553540000__INCLUDED_

Definition at line 22 of file GetValue.h.

#define MAX_VALUE_LEN 1024

Definition at line 33 of file GetValue.h.

Function Documentation

bool CompatGetValue | ( | char * | value,
 |  | const char * | defvalue = 0L,
 |  | const char * | title = 0L
 | ) |

Definition at line 92 of file GetValue.cpp.

00093 {
00094 #ifdef WIN32
00095     GetValue gv(defvalue, title);
00096     if(gv.DoModal() == IDOK)
00097     {
00098         strcpy(value, gv.m_value);
00099         return true;
00100     }
00101     return false;
00102 #endif /* WIN32 */
00103 #ifdef macintosh
00104     GrafPtr     OldPort;
00105     DialogPtr   alertDialog;
00106     short       WhichItem = 0;
00107     Str255 pdef = {'\0'}, ptitle = {'\0'}, pvalue;
00108
00109     if(defvalue != NULL)
00110     {
00111         strcpy((char *)pdef, defvalue);
00112         c2pstr((char *)pdef);
00113     }
00114     if(title != NULL)
00115     {
00116         strcpy((char *)ptitle, title);
00117         c2pstr((char *)ptitle);
00118     }
00119
00120     GetPort(&OldPort);
00121     alertDialog = GetNewDialog(kDlgIdGetValue, NULL, (WindowPtr)-1);
00122     SetPort(alertDialog);
00123
00124     SetDialogItemText(GetDItemHdl(alertDialog, 3), pdef);
00125     SetDialogItemText(GetDItemHdl(alertDialog, 4), ptitle);
00126
00127     while(WhichItem != 1 && WhichItem != 2)
00128     {
00129         ModalDialog(NULL, &WhichItem);
00130
00131         if(WhichItem == 1)
00132         {
00133             GetDialogItemText(GetDItemHdl(alertDialog, 3), pvalue);
00134             if(pvalue[0] == '\0')
00135                 WhichItem = 0;
00136         }
00137     }
00138
00139     if(WhichItem == 1)
00140     {
00141         GetDialogItemText(GetDItemHdl(alertDialog, 3), pvalue);
00142         p2cstr(pvalue);
00143         strcpy(value, (char *)pvalue);
00144     }
00145
00146     DisposeDialog(alertDialog);
00147     SetPort(OldPort);
00148
00149     return WhichItem == 1;
00150 #endif /* macintosh */
00151 #ifdef UNIX_CVS
00152     return false;
00153 #endif /* UNIX_CVS */
00154 }

Generated on Sun Feb 24 01:22:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GraphOptDlg.cpp File Reference

common/GraphOptDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "MainFrm.h"
#include "GraphView.h"
#include "GraphOptDlg.h"
#include "CvsPrefs.h"

Include dependency graph for GraphOptDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool CompatGetGraphOptions (CPersistentInt &selColor, CPersistentInt &shadowColor, CPersistentInt &headerColor, CPersistentInt &tagColor, CPersistentInt &branchColor, CPersistentInt &nodeColor, CPersistentInt &deadNodeColor, CPersistentInt &userStateNodeColor)

Function Documentation

bool CompatGetGraphOptions | ( | CPersistentInt & | selColor,
 |  | CPersistentInt & | shadowColor,
 |  | CPersistentInt & | headerColor,
 |  | CPersistentInt & | tagColor,
 |  | CPersistentInt & | branchColor,
 |  | CPersistentInt & | nodeColor,
 |  | CPersistentInt & | deadNodeColor,
 |  | CPersistentInt & | userStateNodeColor
 | ) |

Definition at line 231 of file GraphOptDlg.cpp.

00234 {
00235     bool userHitOK = false;
00236
00237 #ifdef WIN32
00238     CGraphOptDlg graphOptDlg(selColor, shadowColor,
00239         headerColor, tagColor, branchColor,
00240         nodeColor, deadNodeColor, userStateNodeColor);
00241     if( graphOptDlg.DoModal() == IDOK )
00242     {
00243         userHitOK = true;
00244     }
00245 #endif /* WIN32 */
00246 #ifdef qMacCvsPP
00247 #endif /* qMacCvsPP */
00248 #if qUnix
00249 #endif // qUnix
00250
00251     return userHitOK && !gCvsPrefs.empty();
00252 }

Generated on Sun Feb 24 01:22:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GraphOptDlg.h File Reference

common/GraphOptDlg.h File Reference

#include "ColorStatic.h"

Include dependency graph for GraphOptDlg.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CGraphOptDlg

Defines

#define | AFX_GRAPHOPTDLG_H__E05908EC_20A6_43FE_93C7_0964E6ABB6B1__INCLUDED_

Functions

bool | CompatGetGraphOptions (CPersistentInt &selColor, CPersistentInt &shadowColor, CPersistentInt &headerColor, CPersistentInt &tagColor, CPersistentInt &branchColor, CPersistentInt &nodeColor, CPersistentInt &deadNodeColor, CPersistentInt &userStateNodeColor)

Define Documentation

#define AFX_GRAPHOPTDLG_H__E05908EC_20A6_43FE_93C7_0964E6ABB6B1__INCLUDED_

Definition at line 26 of file GraphOptDlg.h.

Function Documentation

bool CompatGetGraphOptions | ( | CPersistentInt & | selColor,
 |  | CPersistentInt & | shadowColor,
 |  | CPersistentInt & | headerColor,
 |  | CPersistentInt & | tagColor,
 |  | CPersistentInt & | branchColor,
 |  | CPersistentInt & | nodeColor,
 |  | CPersistentInt & | deadNodeColor,
 |  | CPersistentInt & | userStateNodeColor
 | ) |

Definition at line 231 of file GraphOptDlg.cpp.

Referenced by CGraphView::OnGraphGraphoptions.

00234 {
00235     bool userHitOK = false;
00236
00237 #ifdef WIN32
00238     CGraphOptDlg graphOptDlg(selColor, shadowColor,
00239         headerColor, tagColor, branchColor,
00240         nodeColor, deadNodeColor, userStateNodeColor);
00241     if( graphOptDlg.DoModal() == IDOK )
00242     {
00243         userHitOK = true;
00244     }
00245 #endif /* WIN32 */
00246 #ifdef qMacCvsPP
00247 #endif /* qMacCvsPP */
00248 #if qUnix
00249 #endif // qUnix
00250
00251     return userHitOK && !gCvsPrefs.empty();
00252 }

Generated on Sun Feb 24 01:22:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ImportDlg.cpp File Reference

common/ImportDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "ImportDlg.h"
#include "CvsPrefs.h"
#include "MultiString.h"
#include "PromptFiles.h"
#include "TextBinary.h"
#include "GetPrefs.h"

Include dependency graph for ImportDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

CMString | gVendorNames (10,"P_VendorNames", sDefVendors)
CMString | gReleasesNames (10,"P_ReleaseNames", sDefReleases)
CMString | gImportModuleNames (10,"P_ImportModuleNames", sDefModuleNames)
bool | CompatGetImport (UPStr &modname, UStr &logmsg, UPStr &vendortag, UPStr &reltag, UPStr &path, bool &useDefIgnore, bool &useFilesTime)

Variables

char * | sDefReleases []
char * | sDefVendors []
char * | sDefModuleNames []

Function Documentation

bool CompatGetImport | ( | UPStr & | modname,
 |  | UStr & | logmsg,
 |  | UPStr & | vendortag,
 |  | UPStr & | reltag,
 |  | UPStr & | path,
 |  | bool & | useDefIgnore,
 |  | bool & | useFilesTime
 | ) |

Definition at line 436 of file ImportDlg.cpp.

References BrowserGetDirectory, CPStr, CStr, EV_INIT_WIDGET, kUMainWidget, CImport_MAIN::m_logmsg, CImport_MAIN::m_modname, CImport_OPTIONS::m_path, CImport_MAIN::m_rtag, CImport_OPTIONS::m_useDefIgnore, CImport_OPTIONS::m_useFilesTime, CImport_MAIN::m_vtag, SplitPath, CGetPrefs_GLOBALS::StoreValues, CGetPrefs_CVSROOT::StoreValues, TRUE, UCreate_ImportDlg, and UEventSendMessage.

00439 {
00440     bool userHitOK = false;
00441     modname = "";
00442     logmsg = "";
00443     vendortag = "";
00444     reltag = "";
00445     useDefIgnore = false;
00446     useFilesTime = false;
00447
00448     static CPStr sLastModName;  /*Obsolete - remove it and always use sFolder! Get rid after all platforms have combo boxes for recent modules!*/
00449
00450     static CPStr sFolder;
00451     static CStr sLastMsg;
00452     static CPStr sLastVTag("avendor");
00453     static CPStr sLastRTag("arelease");
00454
00455     //dig out the folder so we can suggest the module name
00456     CStr uppath, folder;
00457     if( SplitPath(path, uppath, folder) )
00458         sFolder = folder;
00459
00460     if( sLastModName.length() == 0L )   /*Obsolete - see above*/
00461     {
00462         sLastModName = folder;
00463     }
00464 #ifdef WIN32
00465     CPropertySheet pages("Import settings");
00466     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00467     CImport_MAIN page1(sLastMsg, sFolder, sLastRTag, sLastVTag);
00468     CImport_OPTIONS page2(path, useDefIgnore, useFilesTime);
00469     CGetPrefs_CVSROOT page3;
00470     CGetPrefs_GLOBALS page4;
00471     pages.AddPage(&page1);
00472     pages.AddPage(&page2);
00473     pages.AddPage(&page3);
00474     pages.AddPage(&page4);
00475     if(pages.DoModal() == IDOK)
00476     {
00477         sLastModName = (const char *)page1.m_modname;
00478         sLastMsg = (const char *)page1.m_logmsg;
00479         sLastVTag = (const char *)page1.m_vtag;
00480         sLastRTag = (const char *)page1.m_rtag;
00481         path = (const char *)page2.m_path;
00482         useDefIgnore = page2.m_useDefIgnore == TRUE;
00483         useFilesTime = page2.m_useFilesTime == TRUE;
00484
00485         page3.StoreValues();
00486         page4.StoreValues();
00487         userHitOK = true;
00488     }
00489 #endif /* WIN32 */
00490 #ifdef qMacCvsPP
00491     StDialogHandler theHandler(dlg_Import, LCommander::GetTopCommander());
00492     LWindow *theDialog = theHandler.GetDialog();
00493     ThrowIfNil_(theDialog);
00494     static UInt16 sRuntimePanel = 1;
00495
00496     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00497         (theDialog->FindPaneByID(item_MultiViewPrefs));
00498     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00499
00500     multiView->SwitchToPanel(3);
00501     DoDataExchange_Globals(theDialog, true);
00502     multiView->SwitchToPanel(2);
00503     DoDataExchange (theDialog, item_ImportCvsIgnore, useDefIgnore, true);
00504     DoDataExchange (theDialog, item_EditPath, path, true);
00505     dynamic_cast<LControl*> (theDialog->FindPaneByID (item_EditPath))->AddListener (&theHandler);
00506
00507     multiView->SwitchToPanel(1);
00508     DoDataExchange_ImportMain(theDialog, sLastModName, sLastMsg, true);
00509     DoDataExchange_ImportTags(theDialog, sLastVTag, sLastRTag, true);
00510
00511
00512     groupView->SetValue(sRuntimePanel);
00513     theDialog->Show();
00514     MessageT hitMessage;
00515     while (true)
00516     {       // Let DialogHandler process events
00517         hitMessage = theHandler.DoDialog();
00518
00519         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00520             break;
00521
00522         if(hitMessage == item_EditPath)
00523         {
00524             const char * dir = BrowserGetDirectory("Choose folder to import :");
00525             if(dir != 0L)
00526             {
00527                 CPStr tmp(dir);
00528                 theDialog->SetDescriptorForPaneID(item_EditPath, tmp);
00529             }
00530         }
00531     }
00532     theDialog->Hide();
00533     sRuntimePanel = groupView->GetValue();
00534
00535     if(hitMessage == msg_OK)
00536     {
00537         multiView->SwitchToPanel(1);
00538         DoDataExchange_ImportMain(theDialog, sLastModName, sLastMsg, false);
00539         DoDataExchange_ImportTags(theDialog, sLastVTag, sLastRTag, false);
00540         multiView->SwitchToPanel(2);
00541         DoDataExchange (theDialog, item_ImportCvsIgnore, useDefIgnore, false);
00542         DoDataExchange (theDialog, item_EditPath, path, false);
00543         multiView->SwitchToPanel(3);
00544         DoDataExchange_Globals(theDialog, false);
00545
00546         Assert_(sLastModName.length() != 0);
00547
00548         userHitOK = true;
00549     }
00550 #endif /* qMacCvsPP */
00551 #if qUnix
00552     void *wid = UCreate_ImportDlg();
00553
00554     UCvsImport *dlg = new UCvsImport();
00555     UCvsImport_MAIN *tab1 = new UCvsImport_MAIN(sLastMsg, sLastModName, sLastRTag, sLastVTag);
00556     UCvsImport_OPTIONS *tab2 = new UCvsImport_OPTIONS(path);
00557     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00558     dlg->AddPage(tab1, UCvsImport::kTabGeneral, 0);
00559     dlg->AddPage(tab2, UCvsImport::kTabGeneral, 1);
00560
00561     if(dlg->DoModal())
00562     {
00563         sLastModName = tab1->m_modname;
00564         sLastMsg = tab1->m_logmsg;
00565         sLastVTag = tab1->m_vtag;
00566         sLastRTag = tab1->m_rtag;
00567         path = tab2->m_path;
00568
00569         userHitOK = true;
00570     }
00571
00572     delete dlg;
00573 #endif // qUnix
00574
00575     if(userHitOK)
00576     {
00577         gCvsPrefs.save();
00578         if(sLastMsg.length() == 0)
00579             sLastMsg = "no message";
00580         if(sLastVTag.length() == 0)
00581             sLastVTag = "initial";
00582         if(sLastRTag.length() == 0)
00583             sLastRTag = "start";
00584
00585         modname = sLastModName;
00586         logmsg = sLastMsg;
00587         vendortag = sLastVTag;
00588         reltag = sLastRTag;
00589 #ifdef macintosh
00590         logmsg.replace('\015', '\012');
00591 #endif /* macintosh */
00592     }
00593     return userHitOK;
00594 }

CMString gImportModuleNames | ( | 10 | ,
 |  | "P_ImportModuleNames" | ,
 |  | sDefModuleNames |
 | ) | [static]

CMString gReleasesNames | ( | 10 | ,
 |  | "P_ReleaseNames" | ,
 |  | sDefReleases |
 | ) |

CMString gVendorNames | ( | 10 | ,
 |  | "P_VendorNames" | ,
 |  | sDefVendors |
 | ) | [static]

Variable Documentation

char* sDefModuleNames[] [static]

Initial value:

{
    "Module",
    "Project",
    0L
}

Definition at line 67 of file ImportDlg.cpp.

char* sDefReleases[] [static]

Initial value:

{
    "V10",
    "V101",
    0L
}

Definition at line 54 of file ImportDlg.cpp.

char* sDefVendors[] [static]

Initial value:

{
    "GNU",
    0L
}

Definition at line 61 of file ImportDlg.cpp.

Generated on Sun Feb 24 01:22:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ImportDlg.h File Reference

common/ImportDlg.h File Reference

#include "CPStr.h"
#include "SmartComboBox.h"

Include dependency graph for ImportDlg.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CImport_MAIN
class | CImport_OPTIONS

Defines

#define | AFX_IMPORTDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Functions

bool | CompatGetImport (UPStr &modname, UStr &logmsg, UPStr &vendortag, UPStr &reltag, UPStr &path, bool &useDefIgnore, bool &useFilesTime)

Define Documentation

#define AFX_IMPORTDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Definition at line 26 of file ImportDlg.h.

Function Documentation

bool CompatGetImport | ( | UPStr & | modname,
 |  | UStr & | logmsg,
 |  | UPStr & | vendortag,
 |  | UPStr & | reltag,
 |  | UPStr & | path,
 |  | bool & | useDefIgnore,
 |  | bool & | useFilesTime
 | ) |

Definition at line 436 of file ImportDlg.cpp.

Referenced by CvsCmdImportModule.

00439 {
00440     bool userHitOK = false;
00441     modname = "";
00442     logmsg = "";
00443     vendortag = "";
00444     reltag = "";
00445     useDefIgnore = false;
00446     useFilesTime = false;
00447
00448     static CPStr sLastModName;  /*Obsolete - remove it and always use sFolder! Get rid after all platforms have combo boxes for recent modules!*/
00449
00450     static CPStr sFolder;
00451     static CStr sLastMsg;
00452     static CPStr sLastVTag("avendor");
00453     static CPStr sLastRTag("arelease");
00454
00455     //dig out the folder so we can suggest the module name
00456     CStr uppath, folder;
00457     if( SplitPath(path, uppath, folder) )
00458         sFolder = folder;
00459
00460     if( sLastModName.length() == 0L )   /*Obsolete - see above*/
00461     {
00462         sLastModName = folder;
00463     }
00464 #ifdef WIN32
00465     CPropertySheet pages("Import settings");
00466     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00467     CImport_MAIN page1(sLastMsg, sFolder, sLastRTag, sLastVTag);
00468     CImport_OPTIONS page2(path, useDefIgnore, useFilesTime);
00469     CGetPrefs_CVSROOT page3;
00470     CGetPrefs_GLOBALS page4;
00471     pages.AddPage(&page1);
00472     pages.AddPage(&page2);
00473     pages.AddPage(&page3);
00474     pages.AddPage(&page4);
00475     if(pages.DoModal() == IDOK)
00476     {
00477         sLastModName = (const char *)page1.m_modname;
00478         sLastMsg = (const char *)page1.m_logmsg;
00479         sLastVTag = (const char *)page1.m_vtag;
00480         sLastRTag = (const char *)page1.m_rtag;
00481         path = (const char *)page2.m_path;
00482         useDefIgnore = page2.m_useDefIgnore == TRUE;
00483         useFilesTime = page2.m_useFilesTime == TRUE;
00484
00485         page3.StoreValues();
00486         page4.StoreValues();
00487         userHitOK = true;
00488     }
00489 #endif /* WIN32 */
00490 #ifdef qMacCvsPP
00491     StDialogHandler theHandler(dlg_Import, LCommander::GetTopCommander());
00492     LWindow *theDialog = theHandler.GetDialog();
00493     ThrowIfNil_(theDialog);
00494     static UInt16 sRuntimePanel = 1;
00495
00496     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00497         (theDialog->FindPaneByID(item_MultiViewPrefs));
00498     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00499
00500     multiView->SwitchToPanel(3);
00501     DoDataExchange_Globals(theDialog, true);
00502     multiView->SwitchToPanel(2);
00503     DoDataExchange (theDialog, item_ImportCvsIgnore, useDefIgnore, true);
00504     DoDataExchange (theDialog, item_EditPath, path, true);
00505     dynamic_cast<LControl*> (theDialog->FindPaneByID (item_EditPath))->AddListener (&theHandler);
00506
00507     multiView->SwitchToPanel(1);
00508     DoDataExchange_ImportMain(theDialog, sLastModName, sLastMsg, true);
00509     DoDataExchange_ImportTags(theDialog, sLastVTag, sLastRTag, true);
00510
00511
00512     groupView->SetValue(sRuntimePanel);
00513     theDialog->Show();
00514     MessageT hitMessage;
00515     while (true)
00516     {       // Let DialogHandler process events
00517         hitMessage = theHandler.DoDialog();
00518
00519         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00520             break;
00521
00522         if(hitMessage == item_EditPath)
00523         {
00524             const char * dir = BrowserGetDirectory("Choose folder to import :");
00525             if(dir != 0L)
00526             {
00527                 CPStr tmp(dir);
00528                 theDialog->SetDescriptorForPaneID(item_EditPath, tmp);
00529             }
00530         }
00531     }
00532     theDialog->Hide();
00533     sRuntimePanel = groupView->GetValue();
00534
00535     if(hitMessage == msg_OK)
00536     {
00537         multiView->SwitchToPanel(1);
00538         DoDataExchange_ImportMain(theDialog, sLastModName, sLastMsg, false);
00539         DoDataExchange_ImportTags(theDialog, sLastVTag, sLastRTag, false);
00540         multiView->SwitchToPanel(2);
00541         DoDataExchange (theDialog, item_ImportCvsIgnore, useDefIgnore, false);
00542         DoDataExchange (theDialog, item_EditPath, path, false);
00543         multiView->SwitchToPanel(3);
00544         DoDataExchange_Globals(theDialog, false);
00545
00546         Assert_(sLastModName.length() != 0);
00547
00548         userHitOK = true;
00549     }
00550 #endif /* qMacCvsPP */
00551 #if qUnix
00552     void *wid = UCreate_ImportDlg();
00553
00554     UCvsImport *dlg = new UCvsImport();
00555     UCvsImport_MAIN *tab1 = new UCvsImport_MAIN(sLastMsg, sLastModName, sLastRTag, sLastVTag);
00556     UCvsImport_OPTIONS *tab2 = new UCvsImport_OPTIONS(path);
00557     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00558     dlg->AddPage(tab1, UCvsImport::kTabGeneral, 0);
00559     dlg->AddPage(tab2, UCvsImport::kTabGeneral, 1);
00560
00561     if(dlg->DoModal())
00562     {
00563         sLastModName = tab1->m_modname;
00564         sLastMsg = tab1->m_logmsg;
00565         sLastVTag = tab1->m_vtag;
00566         sLastRTag = tab1->m_rtag;
00567         path = tab2->m_path;
00568
00569         userHitOK = true;
00570     }
00571
00572     delete dlg;
00573 #endif // qUnix
00574
00575     if(userHitOK)
00576     {
00577         gCvsPrefs.save();
00578         if(sLastMsg.length() == 0)
00579             sLastMsg = "no message";
00580         if(sLastVTag.length() == 0)
00581             sLastVTag = "initial";
00582         if(sLastRTag.length() == 0)
00583             sLastRTag = "start";
00584
00585         modname = sLastModName;
00586         logmsg = sLastMsg;
00587         vendortag = sLastVTag;
00588         reltag = sLastRTag;
00589 #ifdef macintosh
00590         logmsg.replace('\015', '\012');
00591 #endif /* macintosh */
00592     }
00593     return userHitOK;
00594 }

Generated on Sun Feb 24 01:22:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ImportFilter.cpp File Reference

common/ImportFilter.cpp File Reference

#include "stdafx.h"
#include "resource.h"
#include "ImportFilter.h"
#include "AppConsole.h"
#include "CvsIgnore.h"

Include dependency graph for ImportFilter.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | ImportReport

Defines

#define | NEW new
#define | MACSPEC

Functions

void | list_add_warning (ReportWarning *&warnings, kTextBinTYPE warn, const char *sample)
void | list_add_type (ImportReport *impReport, ReportConflict *&conflicts, kFileType fileType, const char *sample, const char *fullname, int mac_type, int mac_creator)
kTraversal | list_all_types_recur (const char *path, ReportWarning *&warnings, ReportConflict *&conflicts)
void | free_list_types (ReportWarning *warnings, ReportConflict *conflicts)

Variables

const char * | lf = "\r\n"

Define Documentation

#define MACSPEC

#define NEW new

Definition at line 72 of file ImportFilter.cpp.

Referenced by list_add_type, and list_add_warning.

Function Documentation

void free_list_types | ( | ReportWarning * | warnings,
 |  | ReportConflict * | conflicts
 | ) |

Definition at line 598 of file ImportFilter.cpp.

References ReportConflict::next, and ReportWarning::next.

00599 {
00600     ReportWarning *tmpwarn;
00601     ReportWarning *warn = warnings;
00602     while(warn != 0L)
00603     {
00604         tmpwarn = warn;
00605         warn = warn->next;
00606         delete tmpwarn;
00607     }
00608
00609     ReportConflict *tmpconf;
00610     ReportConflict *conf = conflicts;
00611     while(conf != 0L)
00612     {
00613         tmpconf = conf;
00614         conf = conf->next;
00615         delete tmpconf;
00616     }
00617 }

void list_add_type | ( | ImportReport * | impReport,
 |  | ReportConflict *& | conflicts,
 |  | kFileType | fileType,
 |  | const char * | sample,
 |  | const char * | fullname,
 |  | int | mac_type,
 |  | int | mac_creator
 | ) | [static]

Definition at line 531 of file ImportFilter.cpp.

References ReportConflict::AddPattern, cvs_err, ReportConflict::GetMacCreator, ReportConflict::GetMacType, ReportConflict::HasConflict, ReportConflict::Ignore, ReportConflict::IsBinary, ReportConflict::IsUnicode, kFileType, kFileTypeBin, kFileTypeUnicode, ImportReport::m_Ignlist, ReportConflict::Match, MatchIgnoredList, NEW, ReportConflict::next, ReportConflict::SetConflict, and ReportConflict::SetTypeCreatorConflict.

Referenced by ImportReport::OnFile.

00534 {
00535     // look for a matching entry
00536     ReportConflict *entry = conflicts;
00537     while(entry != 0L)
00538     {
00539         if(entry->Match(sample))
00540         {
00541             if(entry->HasConflict())
00542                 return;
00543
00544             if(entry->IsBinary() ^ (kFileTypeBin == fileType))
00545                 entry->SetConflict(fullname);
00546
00547             if(entry->IsUnicode() ^ (kFileTypeUnicode == fileType))
00548                 entry->SetConflict(fullname);
00549
00550             // mac only
00551             if(entry->GetMacType() != mac_type || entry->GetMacCreator() != mac_creator)
00552                 entry->SetTypeCreatorConflict(fullname);
00553
00554             // it matches perfectly
00555             return;
00556         }
00557
00558         entry = entry->next;
00559     }
00560
00561     // find the extension
00562     const char *tmp = sample, *ext = 0L;
00563     while((tmp = strchr(tmp, '.')) != 0L)
00564     {
00565         ext = tmp++;
00566     }
00567
00568     // add a new entry
00569     ReportConflict *newc = NEW ReportConflict(mac_type, mac_creator);
00570     if(newc == 0L)
00571     {
00572         cvs_err("Impossible to allocate %d bytes !\n", sizeof(ReportConflict));
00573         return;
00574     }
00575
00576     newc->AddPattern(ext != 0L ? ext : sample, fileType, ext != 0L, fullname);
00577     if(conflicts == 0L)
00578         conflicts = newc;
00579     else
00580     {
00581         newc->next = conflicts;
00582         conflicts = newc;
00583     }
00584
00585     // MN - Apply ignore filter. If $HOME/.cvsignore tells that
00586     // file should be ignored then set object to ignored state.
00587     if(MatchIgnoredList(sample, impReport->m_Ignlist))
00588         newc->Ignore();
00589 }

void list_add_warning | ( | ReportWarning *& | warnings,
 |  | kTextBinTYPE | warn,
 |  | const char * | sample
 | ) | [static]

Definition at line 360 of file ImportFilter.cpp.

References ReportWarning::AddWarning, cvs_err, ReportWarning::Kind, kTextBinTYPE, NEW, and ReportWarning::next.

Referenced by ImportReport::OnAlias, ImportReport::OnError, and ImportReport::OnFile.

00361 {
00362     // find if it exists already a same kind of warning
00363     ReportWarning *tmp = warnings;
00364     while(tmp != 0L)
00365     {
00366         if(tmp->Kind() == warn)
00367             break;
00368         tmp = tmp->next;
00369     }
00370     if(tmp != 0L && tmp->Kind() == warn)
00371     {
00372         tmp->AddWarning(sample);
00373         return;
00374     }
00375
00376     // insert new one
00377     tmp = NEW ReportWarning(warn);
00378     if(tmp == 0L)
00379     {
00380         cvs_err("Impossible to allocate %d bytes !\n", sizeof(ReportWarning));
00381         return;
00382     }
00383
00384     tmp->AddWarning(sample);
00385     if(warnings == 0L)
00386     {
00387         warnings = tmp;
00388     }
00389     else
00390     {
00391         tmp->next = warnings;
00392         warnings = tmp;
00393     }
00394 }

kTraversal list_all_types_recur | ( | const char * | path,
 |  | ReportWarning *& | warnings,
 |  | ReportConflict *& | conflicts
 | ) |

Definition at line 591 of file ImportFilter.cpp.

References FileTraverse, and kTraversal.

00593 {
00594     ImportReport report(path, warnings, conflicts);
00595     return FileTraverse(path, report);
00596 }

Variable Documentation

const char* lf = "\r\n" [static]

Definition at line 58 of file ImportFilter.cpp.

Referenced by ReportWarning::PrintOut, and ReportConflict::PrintOut.

Generated on Sun Feb 24 01:22:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ImportFilter.h File Reference

common/ImportFilter.h File Reference

#include <vector>
#include "TextBinary.h"
#include "CPStr.h"
#include "FileTraversal.h"

Include dependency graph for ImportFilter.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | ReportConflict
class | ReportWarning

Defines

#define | AFX_IMPORTFILTER_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Functions

kTraversal | list_all_types_recur (const char *path, ReportWarning *&warnings, ReportConflict *&conflicts)
void | free_list_types (ReportWarning *warnings, ReportConflict *conflicts)

Define Documentation

#define AFX_IMPORTFILTER_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Definition at line 26 of file ImportFilter.h.

Function Documentation

void free_list_types | ( | ReportWarning * | warnings,
 |  | ReportConflict * | conflicts
 | ) |

Definition at line 598 of file ImportFilter.cpp.

Referenced by CompatImportFilter, and CvsCmdImportModule.

00599 {
00600     ReportWarning *tmpwarn;
00601     ReportWarning *warn = warnings;
00602     while(warn != 0L)
00603     {
00604         tmpwarn = warn;
00605         warn = warn->next;
00606         delete tmpwarn;
00607     }
00608
00609     ReportConflict *tmpconf;
00610     ReportConflict *conf = conflicts;
00611     while(conf != 0L)
00612     {
00613         tmpconf = conf;
00614         conf = conf->next;
00615         delete tmpconf;
00616     }
00617 }

kTraversal list_all_types_recur | ( | const char * | path,
 |  | ReportWarning *& | warnings,
 |  | ReportConflict *& | conflicts
 | ) |

Definition at line 591 of file ImportFilter.cpp.

Referenced by CompatImportFilter.

00593 {
00594     ImportReport report(path, warnings, conflicts);
00595     return FileTraverse(path, report);
00596 }

Generated on Sun Feb 24 01:22:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ImportFilterDlg.cpp File Reference

common/ImportFilterDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "ImportFilterDlg.h"

Include dependency graph for ImportFilterDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool CompatImportFilter (const char *path, ReportConflict *&entries, ReportWarning *&warnings)

Function Documentation

bool CompatImportFilter | ( | const char * | path,
 |  | ReportConflict *& | entries,
 |  | ReportWarning *& | warnings
 | ) |

Definition at line 1169 of file ImportFilterDlg.cpp.

References EV_INIT_WIDGET, free_list_types, kUMainWidget, list_all_types_recur, UCreate_ImportFilterDlg, and UEventSendMessage.

01171 {
01172     bool result = false;
01173     entries = 0L;
01174     warnings = 0L;
01175
01176     list_all_types_recur(path, warnings, entries);
01177     if(entries == 0L && warnings == 0L)
01178         return false;
01179
01180 #ifdef WIN32
01181     CImportFilterDlg pages(entries, warnings);
01182     if(pages.DoModal() == IDOK)
01183     {
01184         result = true;
01185     }
01186 #endif /* WIN32 */
01187 #ifdef qMacCvsPP
01188     gWarnings = warnings;
01189     gEntries = entries;
01190
01191     StDialogHandler theHandler(dlg_ImpFilter, LCommander::GetTopCommander());
01192     LWindow *theDialog = theHandler.GetDialog();
01193     ThrowIfNil_(theDialog);
01194
01195     theDialog->Show();
01196     MessageT hitMessage;
01197     while (true)
01198     {       // Let DialogHandler process events
01199         hitMessage = theHandler.DoDialog();
01200
01201         if(hitMessage == item_ImpPushEdit)
01202         {
01203             // simulate dbl click
01204             LOutlineTable *tab = dynamic_cast<LOutlineTable*>
01205                 (theDialog->FindPaneByID(item_ImpFilterList));
01206
01207             STableCell  cell = tab->GetFirstSelectedCell();
01208             if(!cell.IsNullCell())
01209             {
01210                 //TableIndexT index;
01211                 //tab->CellToIndex(cell, index);
01212                 CImportItem *item = dynamic_cast<CImportItem*>(tab->FindItemForRow(cell.row));
01213                 Assert_(item != 0L);
01214                 if(item != 0L)
01215                     item->EditImportCell();
01216             }
01217         }
01218
01219         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01220             break;
01221     }
01222     theDialog->Hide();
01223
01224     if(hitMessage == msg_OK)
01225     {
01226         result = true;
01227     }
01228 #endif /* qMacCvsPP */
01229 #if qUnix
01230     void *wid = UCreate_ImportFilterDlg();
01231
01232     UCvsImpFilter *dlg = new UCvsImpFilter(entries, warnings);
01233     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01234
01235     if(dlg->DoModal())
01236     {
01237         result = true;
01238     }
01239
01240     delete dlg;
01241 #endif // qUnix
01242
01243     if(!result)
01244     {
01245         free_list_types(warnings, entries);
01246         entries = 0L;
01247         warnings = 0L;
01248     }
01249
01250     return result;
01251 }

Generated on Sun Feb 24 01:22:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ImportFilterDlg.h File Reference

common/ImportFilterDlg.h File Reference

#include "ImportFilter.h"

Include dependency graph for ImportFilterDlg.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CImportEntry
class | CImportFilterDlg
class | CImportWarning

Defines

#define | AFX_IMPORTFILDERDLG_H__CFB7AA41_BDDB_11D1_B965_0020AF51D9DA__INCLUDED_

Functions

bool | CompatImportFilter (const char *path, ReportConflict *&entries, ReportWarning *&warnings)

Define Documentation

#define AFX_IMPORTFILDERDLG_H__CFB7AA41_BDDB_11D1_B965_0020AF51D9DA__INCLUDED_

Definition at line 26 of file ImportFilterDlg.h.

Function Documentation

bool CompatImportFilter | ( | const char * | path,
 |  | ReportConflict *& | entries,
 |  | ReportWarning *& | warnings
 | ) |

Definition at line 1169 of file ImportFilterDlg.cpp.

Referenced by CvsCmdImportModule.

01171 {
01172     bool result = false;
01173     entries = 0L;
01174     warnings = 0L;
01175
01176     list_all_types_recur(path, warnings, entries);
01177     if(entries == 0L && warnings == 0L)
01178         return false;
01179
01180 #ifdef WIN32
01181     CImportFilterDlg pages(entries, warnings);
01182     if(pages.DoModal() == IDOK)
01183     {
01184         result = true;
01185     }
01186 #endif /* WIN32 */
01187 #ifdef qMacCvsPP
01188     gWarnings = warnings;
01189     gEntries = entries;
01190
01191     StDialogHandler theHandler(dlg_ImpFilter, LCommander::GetTopCommander());
01192     LWindow *theDialog = theHandler.GetDialog();
01193     ThrowIfNil_(theDialog);
01194
01195     theDialog->Show();
01196     MessageT hitMessage;
01197     while (true)
01198     {       // Let DialogHandler process events
01199         hitMessage = theHandler.DoDialog();
01200
01201         if(hitMessage == item_ImpPushEdit)
01202         {
01203             // simulate dbl click
01204             LOutlineTable *tab = dynamic_cast<LOutlineTable*>
01205                 (theDialog->FindPaneByID(item_ImpFilterList));
01206
01207             STableCell  cell = tab->GetFirstSelectedCell();
01208             if(!cell.IsNullCell())
01209             {
01210                 //TableIndexT index;
01211                 //tab->CellToIndex(cell, index);
01212                 CImportItem *item = dynamic_cast<CImportItem*>(tab->FindItemForRow(cell.row));
01213                 Assert_(item != 0L);
01214                 if(item != 0L)
01215                     item->EditImportCell();
01216             }
01217         }
01218
01219         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01220             break;
01221     }
01222     theDialog->Hide();
01223
01224     if(hitMessage == msg_OK)
01225     {
01226         result = true;
01227     }
01228 #endif /* qMacCvsPP */
01229 #if qUnix
01230     void *wid = UCreate_ImportFilterDlg();
01231
01232     UCvsImpFilter *dlg = new UCvsImpFilter(entries, warnings);
01233     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01234
01235     if(dlg->DoModal())
01236     {
01237         result = true;
01238     }
01239
01240     delete dlg;
01241 #endif // qUnix
01242
01243     if(!result)
01244     {
01245         free_list_types(warnings, entries);
01246         entries = 0L;
01247         warnings = 0L;
01248     }
01249
01250     return result;
01251 }

Generated on Sun Feb 24 01:22:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


InitDlg.cpp File Reference

common/InitDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "InitDlg.h"
#include "CvsPrefs.h"
#include "GetPrefs.h"
#include "PromptFiles.h"

Include dependency graph for InitDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool CompatGetInit (bool &forceCvsroot)

Function Documentation

bool CompatGetInit ( bool & forceCvsroot )

Definition at line 87 of file InitDlg.cpp.

References CInit_MAIN::m_forceroot, CGetPrefs_GLOBALS::StoreValues, CGetPrefs_CVSROOT::StoreValues, and TRUE.

00088 {
00089     bool userHitOK = false;
00090
00091     forceCvsroot = true;
00092
00093 #ifdef WIN32
00094     CPropertySheet pages("Init settings");
00095     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00096     CInit_MAIN page1(forceCvsroot);
00097     CGetPrefs_CVSROOT page2;
00098     CGetPrefs_GLOBALS page3;
00099     pages.AddPage(&page1);
00100     pages.AddPage(&page2);
00101     pages.AddPage(&page3);
00102     if(pages.DoModal() == IDOK)
00103     {
00104         forceCvsroot = page1.m_forceroot == TRUE;
00105
00106         page2.StoreValues();
00107         page3.StoreValues();
00108         userHitOK = true;
00109     }
00110 #endif /* WIN32 */
00111
00112     if(userHitOK)
00113     {
00114         gCvsPrefs.save();
00115     }
00116     return userHitOK;
00117 }

Generated on Sun Feb 24 01:22:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


InitDlg.h File Reference

common/InitDlg.h File Reference

#include "CPStr.h"

Include dependency graph for InitDlg.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CInit_MAIN

Defines

#define | AFX_INITDLG_H__155D02C3_2323_11D3_B1A6_004095463819__INCLUDED_

Functions

bool | CompatGetInit (bool &forceCvsroot)

Define Documentation

#define AFX_INITDLG_H__155D02C3_2323_11D3_B1A6_004095463819__INCLUDED_

Definition at line 26 of file InitDlg.h.

Function Documentation

bool CompatGetInit ( bool & forceCvsroot )

Definition at line 87 of file InitDlg.cpp.

Referenced by CvsCmdInit.

00088 {
00089     bool userHitOK = false;
00090
00091     forceCvsroot = true;
00092
00093 #ifdef WIN32
00094     CPropertySheet pages("Init settings");
00095     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00096     CInit_MAIN page1(forceCvsroot);
00097     CGetPrefs_CVSROOT page2;
00098     CGetPrefs_GLOBALS page3;
00099     pages.AddPage(&page1);
00100     pages.AddPage(&page2);
00101     pages.AddPage(&page3);
00102     if(pages.DoModal() == IDOK)
00103     {
00104         forceCvsroot = page1.m_forceroot == TRUE;
00105
00106         page2.StoreValues();
00107         page3.StoreValues();
00108         userHitOK = true;
00109     }
00110 #endif /* WIN32 */
00111
00112     if(userHitOK)
00113     {
00114         gCvsPrefs.save();
00115     }
00116     return userHitOK;
00117 }

Generated on Sun Feb 24 01:22:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LineCmd.cpp File Reference

common/LineCmd.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "MultiString.h"
#include "LineCmd.h"
#include "CvsArgs.h"
#include "PromptFiles.h"
#include "CPStr.h"
#include "TextBinary.h"
#include "GetPrefs.h"
#include "CvsPrefs.h"

Include dependency graph for LineCmd.cpp:

Include dependency graph

Go to the source code of this file.

Functions

CMString | gPrevCvsCmd (20,"P_PrevCvsCmd", sDefPrevCvsCmd)
bool | CompatGetCommand (CvsArgs &args, const char *&dir)

Variables

char * | sDefPrevCvsCmd []

Function Documentation

bool CompatGetCommand | ( | CvsArgs & | args,
 |  | const char *& | dir
 | ) |

Definition at line 401 of file LineCmd.cpp.

References CvsArgs::add, BrowserGetDirectory, CPStr, CStr, DEF_CVS_CMD, EV_INIT_WIDGET, kUMainWidget, CCmdLine_MAIN::m_checkPath, CCmdLine_MAIN::m_cmdLine, CCmdLine_MAIN::m_folderLoc, MAX_ARGS, MAX_CMD_LEN, CGetPrefs_GLOBALS::StoreValues, StringToArgv, TRUE, UCreate_CmdlineDlg, and UEventSendMessage.

00402 {
00403     char cmd[MAX_CMD_LEN] = {'\0'};
00404     dir = 0L;
00405
00406     static CStr sLastCmdline(DEF_CVS_CMD);
00407 #ifdef macintosh
00408     static CPStr sLastPath("pick:a:mac:path:");
00409 #else /* !macintosh */
00410     static CPStr sLastPath("");
00411 #endif /* !macintosh */
00412     static bool sLastHasPath = false;
00413
00414 #ifdef WIN32
00415     CPropertySheet pages("Command line settings");
00416     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00417     CCmdLine_MAIN page1(sLastCmdline, sLastHasPath, sLastPath);
00418     CGetPrefs_GLOBALS page2;
00419     pages.AddPage(&page1);
00420     pages.AddPage(&page2);
00421     if( pages.DoModal() == IDOK )
00422     {
00423         sLastCmdline = page1.m_cmdLine;
00424         sLastHasPath = page1.m_checkPath == TRUE;
00425         sLastPath = page1.m_folderLoc;
00426
00427         dir = page1.m_checkPath ? (const char *)sLastPath : 0L;
00428         strcpy(cmd, page1.m_cmdLine);
00429
00430         page2.StoreValues();
00431         gCvsPrefs.save();
00432     }
00433     else
00434         return false;
00435 #endif /* WIN32 */
00436 #if qUnix
00437     void *wid = UCreate_CmdlineDlg();
00438
00439     UCvsCmdline *dlg = new UCvsCmdline();
00440     UCvsCmdline_MAIN *tab1 = new UCvsCmdline_MAIN(sLastCmdline, sLastHasPath, sLastPath);
00441     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00442     dlg->AddPage(tab1, UCvsCmdline::kTabGeneral, 0);
00443
00444     if(dlg->DoModal())
00445     {
00446         sLastCmdline = tab1->m_cmdline;
00447         sLastHasPath = tab1->m_checkpath;
00448         sLastPath = tab1->m_folderloc;
00449
00450         dir = tab1->m_checkpath ? (const char *)sLastPath : 0L;
00451         strcpy(cmd, tab1->m_cmdline);
00452     }
00453     else
00454     {
00455         delete dlg;
00456         return false;
00457     }
00458
00459     delete dlg;
00460 #endif // qUnix
00461 #ifdef qMacCvsPP
00462     StDialogHandler theHandler(dlg_Cmdline, LCommander::GetTopCommander());
00463     LWindow *theDialog = theHandler.GetDialog();
00464     ThrowIfNil_(theDialog);
00465     static UInt16 sRuntimePanel = 1;
00466
00467     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00468         (theDialog->FindPaneByID(item_MultiViewPrefs));
00469     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00470
00471     multiView->SwitchToPanel(2);
00472     DoDataExchange_Globals(theDialog, true);
00473     multiView->SwitchToPanel(1);
00474     DoDataExchange_CmdlineMain(theDialog, sLastCmdline, sLastPath, sLastHasPath, true);
00475
00476     LCheckBoxGroupBox *cbox = dynamic_cast<LCheckBoxGroupBox*>
00477         (theDialog->FindPaneByID(item_CheckGroupPath));
00478     LPushButton *epath = dynamic_cast<LPushButton*>
00479         (theDialog->FindPaneByID(item_EditPath));
00480     epath->AddListener(&theHandler);
00481     cbox->AddListener(&theHandler);
00482
00483     groupView->SetValue(sRuntimePanel);
00484     theDialog->Show();
00485     MessageT hitMessage;
00486     while (true)
00487     {       // Let DialogHandler process events
00488         hitMessage = theHandler.DoDialog();
00489
00490         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00491             break;
00492
00493         if(hitMessage == item_CheckGroupPath || hitMessage == item_EditPath)
00494         {
00495             cbox = dynamic_cast<LCheckBoxGroupBox*>
00496                 (theDialog->FindPaneByID(item_CheckGroupPath));
00497             epath = dynamic_cast<LPushButton*>
00498                 (theDialog->FindPaneByID(item_EditPath));
00499             if(cbox->GetValue() == Button_Off)
00500             {
00501                 dir = 0L;
00502                 continue;
00503             }
00504
00505             dir = BrowserGetDirectory("Select where to execute :");
00506             if(dir != 0L)
00507             {
00508                 CPStr tmp(dir);
00509                 epath->SetDescriptor(tmp);
00510             }
00511             else if(hitMessage == item_CheckGroupPath)
00512             {
00513                 cbox->SetValue(Button_Off);
00514             }
00515         }
00516
00517     }
00518     theDialog->Hide();
00519     sRuntimePanel = groupView->GetValue();
00520
00521     if(hitMessage == msg_OK)
00522     {
00523         multiView->SwitchToPanel(1);
00524         DoDataExchange_CmdlineMain(theDialog, sLastCmdline, sLastPath, sLastHasPath, false);
00525         multiView->SwitchToPanel(2);
00526         DoDataExchange_Globals(theDialog, false);
00527
00528         strcpy(cmd, sLastCmdline);
00529         Assert_(sLastCmdline.length() != 0);
00530         dir = sLastHasPath ? (const char *)sLastPath : 0L;
00531     }
00532     else
00533         return false;
00534 #endif /* qMacCvsPP */
00535
00536     if(cmd[0] == '\0' || (dir != 0L && dir[0] == '\0'))
00537         return false;
00538
00539     char *argv[MAX_ARGS];
00540     int argc = StringToArgv(cmd, argv);
00541
00542     for (int i = 0; i < argc; i++)
00543         args.add(argv[i]);
00544
00545     return true;
00546 }

CMString gPrevCvsCmd | ( | 20 | ,
 |  | "P_PrevCvsCmd" | ,
 |  | sDefPrevCvsCmd |
 | ) | [static]

Variable Documentation

char* sDefPrevCvsCmd[]

Initial value:

{
    "cvs --help-options",
    "cvs --help-commands",
    "cvs --help-synonyms",
    "cvs -H <cvs_command>",
    0L
}

Definition at line 52 of file LineCmd.cpp.

Generated on Sun Feb 24 01:22:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LineCmd.h File Reference

common/LineCmd.h File Reference

#include "SmartComboBox.h"

Include dependency graph for LineCmd.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCmdLine_MAIN

Defines

#define | AFX_LINECMD_H__5946A8C5_8517_11D1_8949_444553540000__INCLUDED_
#define | DEF_CVS_CMD "cvs "

Functions

bool | CompatGetCommand (CvsArgs &args, const char *&dir)

Define Documentation

#define AFX_LINECMD_H__5946A8C5_8517_11D1_8949_444553540000__INCLUDED_

Definition at line 22 of file LineCmd.h.

#define DEF_CVS_CMD "cvs "

Definition at line 32 of file LineCmd.h.

Referenced by CompatGetCommand, CCmdLine_MAIN::DoDataExchange, and CCmdLine_MAIN::OnSetfocusCmdline.

Function Documentation

bool CompatGetCommand | ( | CvsArgs & | args,
 |  | const char *& | dir
 | ) |

Definition at line 401 of file LineCmd.cpp.

Referenced by CvsCmdLine.

00402 {
00403     char cmd[MAX_CMD_LEN] = {'\0'};
00404     dir = 0L;
00405
00406     static CStr sLastCmdline(DEF_CVS_CMD);
00407 #ifdef macintosh
00408     static CPStr sLastPath("pick:a:mac:path:");
00409 #else /* !macintosh */
00410     static CPStr sLastPath("");
00411 #endif /* !macintosh */
00412     static bool sLastHasPath = false;
00413
00414 #ifdef WIN32
00415     CPropertySheet pages("Command line settings");
00416     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00417     CCmdLine_MAIN page1(sLastCmdline, sLastHasPath, sLastPath);
00418     CGetPrefs_GLOBALS page2;
00419     pages.AddPage(&page1);
00420     pages.AddPage(&page2);
00421     if( pages.DoModal() == IDOK )
00422     {
00423         sLastCmdline = page1.m_cmdLine;
00424         sLastHasPath = page1.m_checkPath == TRUE;
00425         sLastPath = page1.m_folderLoc;
00426
00427         dir = page1.m_checkPath ? (const char *)sLastPath : 0L;
00428         strcpy(cmd, page1.m_cmdLine);
00429
00430         page2.StoreValues();
00431         gCvsPrefs.save();
00432     }
00433     else
00434         return false;
00435 #endif /* WIN32 */
00436 #if qUnix
00437     void *wid = UCreate_CmdlineDlg();
00438
00439     UCvsCmdline *dlg = new UCvsCmdline();
00440     UCvsCmdline_MAIN *tab1 = new UCvsCmdline_MAIN(sLastCmdline, sLastHasPath, sLastPath);
00441     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00442     dlg->AddPage(tab1, UCvsCmdline::kTabGeneral, 0);
00443
00444     if(dlg->DoModal())
00445     {
00446         sLastCmdline = tab1->m_cmdline;
00447         sLastHasPath = tab1->m_checkpath;
00448         sLastPath = tab1->m_folderloc;
00449
00450         dir = tab1->m_checkpath ? (const char *)sLastPath : 0L;
00451         strcpy(cmd, tab1->m_cmdline);
00452     }
00453     else
00454     {
00455         delete dlg;
00456         return false;
00457     }
00458
00459     delete dlg;
00460 #endif // qUnix
00461 #ifdef qMacCvsPP
00462     StDialogHandler theHandler(dlg_Cmdline, LCommander::GetTopCommander());
00463     LWindow *theDialog = theHandler.GetDialog();
00464     ThrowIfNil_(theDialog);
00465     static UInt16 sRuntimePanel = 1;
00466
00467     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00468         (theDialog->FindPaneByID(item_MultiViewPrefs));
00469     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00470
00471     multiView->SwitchToPanel(2);
00472     DoDataExchange_Globals(theDialog, true);
00473     multiView->SwitchToPanel(1);
00474     DoDataExchange_CmdlineMain(theDialog, sLastCmdline, sLastPath, sLastHasPath, true);
00475
00476     LCheckBoxGroupBox *cbox = dynamic_cast<LCheckBoxGroupBox*>
00477         (theDialog->FindPaneByID(item_CheckGroupPath));
00478     LPushButton *epath = dynamic_cast<LPushButton*>
00479         (theDialog->FindPaneByID(item_EditPath));
00480     epath->AddListener(&theHandler);
00481     cbox->AddListener(&theHandler);
00482
00483     groupView->SetValue(sRuntimePanel);
00484     theDialog->Show();
00485     MessageT hitMessage;
00486     while (true)
00487     {       // Let DialogHandler process events
00488         hitMessage = theHandler.DoDialog();
00489
00490         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00491             break;
00492
00493         if(hitMessage == item_CheckGroupPath || hitMessage == item_EditPath)
00494         {
00495             cbox = dynamic_cast<LCheckBoxGroupBox*>
00496                 (theDialog->FindPaneByID(item_CheckGroupPath));
00497             epath = dynamic_cast<LPushButton*>
00498                 (theDialog->FindPaneByID(item_EditPath));
00499             if(cbox->GetValue() == Button_Off)
00500             {
00501                 dir = 0L;
00502                 continue;
00503             }
00504
00505             dir = BrowserGetDirectory("Select where to execute :");
00506             if(dir != 0L)
00507             {
00508                 CPStr tmp(dir);
00509                 epath->SetDescriptor(tmp);
00510             }
00511             else if(hitMessage == item_CheckGroupPath)
00512             {
00513                 cbox->SetValue(Button_Off);
00514             }
00515         }
00516
00517     }
00518     theDialog->Hide();
00519     sRuntimePanel = groupView->GetValue();
00520
00521     if(hitMessage == msg_OK)
00522     {
00523         multiView->SwitchToPanel(1);
00524         DoDataExchange_CmdlineMain(theDialog, sLastCmdline, sLastPath, sLastHasPath, false);
00525         multiView->SwitchToPanel(2);
00526         DoDataExchange_Globals(theDialog, false);
00527
00528         strcpy(cmd, sLastCmdline);
00529         Assert_(sLastCmdline.length() != 0);
00530         dir = sLastHasPath ? (const char *)sLastPath : 0L;
00531     }
00532     else
00533         return false;
00534 #endif /* qMacCvsPP */
00535
00536     if(cmd[0] == '\0' || (dir != 0L && dir[0] == '\0'))
00537         return false;
00538
00539     char *argv[MAX_ARGS];
00540     int argc = StringToArgv(cmd, argv);
00541
00542     for (int i = 0; i < argc; i++)
00543         args.add(argv[i]);
00544
00545     return true;
00546 }

Generated on Sun Feb 24 01:22:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LogDlg.cpp File Reference

common/LogDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "OptionalPropertySheet.h"
#include "LogDlg.h"
#include "CvsPrefs.h"
#include "MultiString.h"
#include "GetPrefs.h"

Include dependency graph for LogDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

CMString | gLogRevNames (10,"P_LogTagNames", sDefLogTagNames)
CMString | gLogDateNames (10,"P_LogDateNames", sDefLogDateNames)
CMString | gLogStateNames (10,"P_LogStateNames", sDefLogStateNames)
CMString | gLogUserNames (10,"P_LogUserNames", sDefLogUserNames)
bool | CompatGetLog (bool &noRecurs, bool &defBranch, UPStr &date, bool &headerOnly, bool &noTags, bool &onlyRCSfile, bool &hasRev, UPStr &rev, UPStr &states, bool &hasUsers, UPStr &users, bool outGraph)

Variables

char * | sDefLogTagNames []
char * | sDefLogDateNames []
char * | sDefLogStateNames []
char * | sDefLogUserNames []

Function Documentation

bool CompatGetLog | ( | bool & | noRecurs,
 |  | bool & | defBranch,
 |  | UPStr & | date,
 |  | bool & | headerOnly,
 |  | bool & | noTags,
 |  | bool & | onlyRCSfile,
 |  | bool & | hasRev,
 |  | UPStr & | rev,
 |  | UPStr & | states,
 |  | bool & | hasUsers,
 |  | UPStr & | users,
 |  | bool | outGraph
 | ) |

Definition at line 578 of file LogDlg.cpp.

References CPStr, COptionalPropertySheet::DoModal, EV_INIT_WIDGET, COptionalPropertySheet::GetHideCommandDlg, kUMainWidget, CLogFilters::m_date, CLogMain::m_defbranch, CLogFilters::m_hasdate, CLogFilters::m_hasrev, CLogFilters::m_hasstate, CLogFilters::m_hasuser, CLogMain::m_norecurs, CLogMain::m_notags, CLogMain::m_nousers, CLogMain::m_onlyrcs, CLogFilters::m_rev, CLogFilters::m_state, CLogFilters::m_user, CGetPrefs_GLOBALS::StoreValues, TRUE, UCreate_LogDlg, and UEventSendMessage.

00582 {
00583     bool userHitOK = false;
00584
00585     static CPStr sLastDate;
00586     static CPStr sLastRev;
00587     static CPStr sLastUsers;
00588     static CPStr sLastStates;
00589
00590     bool hasDate = false;
00591     bool hasStates = false;
00592
00593     hasRev = false;
00594     hasUsers = false;
00595     date = "";
00596     rev = "";
00597     states = "";
00598     users = "";
00599     noRecurs = false;
00600     defBranch = false;
00601     headerOnly = false;
00602     noTags = false;
00603     onlyRCSfile = false;
00604
00605 #ifdef WIN32
00606     COptionalPropertySheet pages(outGraph ? gCvsPrefs.HideCommandDlgGraph() : gCvsPrefs.HideCommandDlgLog(),
00607         outGraph ? "Graph settings" : "Log settings");
00608     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00609     CLogMain page1;
00610     CLogFilters page2(sLastDate, sLastRev, sLastUsers, sLastStates);
00611     CGetPrefs_GLOBALS page3;
00612     pages.AddPage(&page1);
00613     pages.AddPage(&page2);
00614     pages.AddPage(&page3);
00615     if(pages.DoModal() == IDOK)
00616     {
00617         noRecurs = page1.m_norecurs == TRUE;
00618         defBranch = page1.m_defbranch == TRUE;
00619         headerOnly = page1.m_nousers == TRUE;
00620         noTags = page1.m_notags == TRUE;
00621         onlyRCSfile = page1.m_onlyrcs == TRUE;
00622
00623         sLastDate = page2.m_date;
00624         sLastRev = page2.m_rev;
00625         sLastUsers = page2.m_user;
00626         sLastStates = page2.m_state;
00627
00628         hasRev = page2.m_hasrev == TRUE;
00629         hasUsers = page2.m_hasuser == TRUE;
00630         hasDate = page2.m_hasdate == TRUE;
00631         hasStates = page2.m_hasstate == TRUE;
00632
00633         page3.StoreValues();
00634         if( outGraph )
00635         {
00636             gCvsPrefs.SetHideCommandDlgGraph(pages.GetHideCommandDlg());
00637         }
00638         else
00639         {
00640             gCvsPrefs.SetHideCommandDlgLog(pages.GetHideCommandDlg());
00641         }
00642         userHitOK = true;
00643     }
00644 #endif /* WIN32 */
00645 #ifdef qMacCvsPP
00646     StDialogHandler theHandler(dlg_Log, LCommander::GetTopCommander());
00647     LWindow *theDialog = theHandler.GetDialog();
00648     ThrowIfNil_(theDialog);
00649     static UInt16 sRuntimePanel = 1;
00650
00651     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00652         (theDialog->FindPaneByID(item_MultiViewPrefs));
00653     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00654
00655     multiView->SwitchToPanel(3);
00656     DoDataExchange_Globals(theDialog, true);
00657     multiView->SwitchToPanel(2);
00658     DoDataExchange_LogFilters(theDialog, hasDate, hasStates, hasRev, hasUsers,
00659         sLastDate, sLastRev, sLastUsers, sLastStates, true);
00660     multiView->SwitchToPanel(1);
00661     DoDataExchange_LogSettings(theDialog, noRecurs, defBranch, headerOnly, noTags, onlyRCSfile, true);
00662
00663     groupView->SetValue(sRuntimePanel);
00664     theDialog->Show();
00665     MessageT hitMessage;
00666     while (true)
00667     {       // Let DialogHandler process events
00668         hitMessage = theHandler.DoDialog();
00669
00670         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00671             break;
00672     }
00673     theDialog->Hide();
00674     sRuntimePanel = groupView->GetValue();
00675
00676     if(hitMessage == msg_OK)
00677     {
00678         multiView->SwitchToPanel(1);
00679         DoDataExchange_LogSettings(theDialog, noRecurs, defBranch, headerOnly, noTags, onlyRCSfile, false);
00680         multiView->SwitchToPanel(2);
00681         DoDataExchange_LogFilters(theDialog, hasDate, hasStates, hasRev, hasUsers,
00682         sLastDate, sLastRev, sLastUsers, sLastStates, false);
00683         multiView->SwitchToPanel(3);
00684         DoDataExchange_Globals(theDialog, false);
00685         userHitOK = true;
00686     }
00687 #endif /* qMacCvsPP */
00688 #if qUnix
00689     void *wid = UCreate_LogDlg();
00690
00691     UCvsLog *dlg = new UCvsLog();
00692     UCvsLog_MAIN *tab1 = new UCvsLog_MAIN();
00693     UCvsLog_FILTERS *tab2 = new UCvsLog_FILTERS(sLastDate, sLastRev, sLastUsers, sLastStates);
00694     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00695     dlg->AddPage(tab1, UCvsLog::kTabGeneral, 0);
00696     dlg->AddPage(tab2, UCvsLog::kTabGeneral, 1);
00697
00698     if(dlg->DoModal())
00699     {
00700         noRecurs = tab1->m_norecurs;
00701         defBranch = tab1->m_defbranch;
00702         headerOnly = tab1->m_nousers;
00703         noTags = tab1->m_notags;
00704         onlyRCSfile = tab1->m_onlyrcs;
00705
00706         sLastDate = tab2->m_date;
00707         sLastRev = tab2->m_rev;
00708         sLastUsers = tab2->m_user;
00709         sLastStates = tab2->m_state;
00710
00711         hasRev = tab2->m_hasrev;
00712         hasUsers = tab2->m_hasuser;
00713         hasDate = tab2->m_hasdate;
00714         hasStates = tab2->m_hasstate;
00715
00716         userHitOK = true;
00717     }
00718
00719     delete dlg;
00720 #endif // qUnix
00721
00722     if(userHitOK)
00723     {
00724         if(hasDate && !sLastDate.empty())
00725             date = sLastDate;
00726         if(hasRev)
00727             rev = sLastRev;
00728         if(hasUsers)
00729             users = sLastUsers;
00730         if(hasStates && !sLastStates.empty())
00731             states = sLastStates;
00732
00733         gCvsPrefs.save();
00734     }
00735
00736     return userHitOK;
00737 }

CMString gLogDateNames | ( | 10 | ,
 |  | "P_LogDateNames" | ,
 |  | sDefLogDateNames |
 | ) | [static]

CMString gLogRevNames | ( | 10 | ,
 |  | "P_LogTagNames" | ,
 |  | sDefLogTagNames |
 | ) | [static]

CMString gLogStateNames | ( | 10 | ,
 |  | "P_LogStateNames" | ,
 |  | sDefLogStateNames |
 | ) | [static]

CMString gLogUserNames | ( | 10 | ,
 |  | "P_LogUserNames" | ,
 |  | sDefLogUserNames |
 | ) | [static]

Variable Documentation

char* sDefLogDateNames[]

Initial value:

{
    ">1998-3-24",
    "<1998-1-24",
    "1998-1-24<1998-3-24",
    "<=3-24",
    0L
}

Definition at line 70 of file LogDlg.cpp.

char* sDefLogStateNames[]

Initial value:

{
    "mystate",
    "dead",
    "exp",
    "mystate,mystate2",
    0L
}

Definition at line 79 of file LogDlg.cpp.

char* sDefLogTagNames[]

Initial value:

{
    "1.32:1.35",
    "1.32:",
    ":1.35",
    "branch-release1-0",
    "HEAD",
    0L
}

Definition at line 60 of file LogDlg.cpp.

char* sDefLogUserNames[]

Initial value:

{
    "johna",
    "garyb",
    "johna,garyb",
    0L
}

Definition at line 88 of file LogDlg.cpp.

Generated on Sun Feb 24 01:22:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LogDlg.h File Reference

common/LogDlg.h File Reference

#include "CPStr.h"
#include "SmartComboBox.h"

Include dependency graph for LogDlg.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CLogFilters
class | CLogMain

Defines

#define | AFX_LOGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Functions

bool | CompatGetLog (bool &noRecurs, bool &defBranch, UPStr &date, bool &headerOnly, bool &noTags, bool &onlyRCSfile, bool &hasRev, UPStr &rev, UPStr &states, bool &hasUser, UPStr &users, bool outGraph=false)

Define Documentation

#define AFX_LOGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Definition at line 26 of file LogDlg.h.

Function Documentation

bool CompatGetLog | ( | bool & | noRecurs,
 |  | bool & | defBranch,
 |  | UPStr & | date,
 |  | bool & | headerOnly,
 |  | bool & | noTags,
 |  | bool & | onlyRCSfile,
 |  | bool & | hasRev,
 |  | UPStr & | rev,
 |  | UPStr & | states,
 |  | bool & | hasUser,
 |  | UPStr & | users,
 |  | bool | outGraph = false
 | ) |

Definition at line 578 of file LogDlg.cpp.

Referenced by CvsCmdLogFiles, and CvsCmdLogFolder.

00582 {
00583     bool userHitOK = false;
00584
00585     static CPStr sLastDate;
00586     static CPStr sLastRev;
00587     static CPStr sLastUsers;
00588     static CPStr sLastStates;
00589
00590     bool hasDate = false;
00591     bool hasStates = false;
00592
00593     hasRev = false;
00594     hasUsers = false;
00595     date = "";
00596     rev = "";
00597     states = "";
00598     users = "";
00599     noRecurs = false;
00600     defBranch = false;
00601     headerOnly = false;
00602     noTags = false;
00603     onlyRCSfile = false;
00604
00605 #ifdef WIN32
00606     COptionalPropertySheet pages(outGraph ? gCvsPrefs.HideCommandDlgGraph() : gCvsPrefs.HideCommandDlgLog(),
00607         outGraph ? "Graph settings" : "Log settings");
00608     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00609     CLogMain page1;
00610     CLogFilters page2(sLastDate, sLastRev, sLastUsers, sLastStates);
00611     CGetPrefs_GLOBALS page3;
00612     pages.AddPage(&page1);
00613     pages.AddPage(&page2);
00614     pages.AddPage(&page3);
00615     if(pages.DoModal() == IDOK)
00616     {
00617         noRecurs = page1.m_norecurs == TRUE;
00618         defBranch = page1.m_defbranch == TRUE;
00619         headerOnly = page1.m_nousers == TRUE;
00620         noTags = page1.m_notags == TRUE;
00621         onlyRCSfile = page1.m_onlyrcs == TRUE;
00622
00623         sLastDate = page2.m_date;
00624         sLastRev = page2.m_rev;
00625         sLastUsers = page2.m_user;
00626         sLastStates = page2.m_state;
00627
00628         hasRev = page2.m_hasrev == TRUE;
00629         hasUsers = page2.m_hasuser == TRUE;
00630         hasDate = page2.m_hasdate == TRUE;
00631         hasStates = page2.m_hasstate == TRUE;
00632
00633         page3.StoreValues();
00634         if( outGraph )
00635         {
00636             gCvsPrefs.SetHideCommandDlgGraph(pages.GetHideCommandDlg());
00637         }
00638         else
00639         {
00640             gCvsPrefs.SetHideCommandDlgLog(pages.GetHideCommandDlg());
00641         }
00642         userHitOK = true;
00643     }
00644 #endif /* WIN32 */
00645 #ifdef qMacCvsPP
00646     StDialogHandler theHandler(dlg_Log, LCommander::GetTopCommander());
00647     LWindow *theDialog = theHandler.GetDialog();
00648     ThrowIfNil_(theDialog);
00649     static UInt16 sRuntimePanel = 1;
00650
00651     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00652         (theDialog->FindPaneByID(item_MultiViewPrefs));
00653     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00654
00655     multiView->SwitchToPanel(3);
00656     DoDataExchange_Globals(theDialog, true);
00657     multiView->SwitchToPanel(2);
00658     DoDataExchange_LogFilters(theDialog, hasDate, hasStates, hasRev, hasUsers,
00659         sLastDate, sLastRev, sLastUsers, sLastStates, true);
00660     multiView->SwitchToPanel(1);
00661     DoDataExchange_LogSettings(theDialog, noRecurs, defBranch, headerOnly, noTags, onlyRCSfile, true);
00662
00663     groupView->SetValue(sRuntimePanel);
00664     theDialog->Show();
00665     MessageT hitMessage;
00666     while (true)
00667     {       // Let DialogHandler process events
00668         hitMessage = theHandler.DoDialog();
00669
00670         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00671             break;
00672     }
00673     theDialog->Hide();
00674     sRuntimePanel = groupView->GetValue();
00675
00676     if(hitMessage == msg_OK)
00677     {
00678         multiView->SwitchToPanel(1);
00679         DoDataExchange_LogSettings(theDialog, noRecurs, defBranch, headerOnly, noTags, onlyRCSfile, false);
00680         multiView->SwitchToPanel(2);
00681         DoDataExchange_LogFilters(theDialog, hasDate, hasStates, hasRev, hasUsers,
00682         sLastDate, sLastRev, sLastUsers, sLastStates, false);
00683         multiView->SwitchToPanel(3);
00684         DoDataExchange_Globals(theDialog, false);
00685         userHitOK = true;
00686     }
00687 #endif /* qMacCvsPP */
00688 #if qUnix
00689     void *wid = UCreate_LogDlg();
00690
00691     UCvsLog *dlg = new UCvsLog();
00692     UCvsLog_MAIN *tab1 = new UCvsLog_MAIN();
00693     UCvsLog_FILTERS *tab2 = new UCvsLog_FILTERS(sLastDate, sLastRev, sLastUsers, sLastStates);
00694     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00695     dlg->AddPage(tab1, UCvsLog::kTabGeneral, 0);
00696     dlg->AddPage(tab2, UCvsLog::kTabGeneral, 1);
00697
00698     if(dlg->DoModal())
00699     {
00700         noRecurs = tab1->m_norecurs;
00701         defBranch = tab1->m_defbranch;
00702         headerOnly = tab1->m_nousers;
00703         noTags = tab1->m_notags;
00704         onlyRCSfile = tab1->m_onlyrcs;
00705
00706         sLastDate = tab2->m_date;
00707         sLastRev = tab2->m_rev;
00708         sLastUsers = tab2->m_user;
00709         sLastStates = tab2->m_state;
00710
00711         hasRev = tab2->m_hasrev;
00712         hasUsers = tab2->m_hasuser;
00713         hasDate = tab2->m_hasdate;
00714         hasStates = tab2->m_hasstate;
00715
00716         userHitOK = true;
00717     }
00718
00719     delete dlg;
00720 #endif // qUnix
00721
00722     if(userHitOK)
00723     {
00724         if(hasDate && !sLastDate.empty())
00725             date = sLastDate;
00726         if(hasRev)
00727             rev = sLastRev;
00728         if(hasUsers)
00729             users = sLastUsers;
00730         if(hasStates && !sLastStates.empty())
00731             states = sLastStates;
00732
00733         gCvsPrefs.save();
00734     }
00735
00736     return userHitOK;
00737 }

Generated on Sun Feb 24 01:22:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LogParse.cpp File Reference

common/LogParse.cpp File Reference

#include "stdafx.h"
#include <errno.h>
#include <stdio.h>
#include "wincvs.h"
#include "GraphDoc.h"
#include "LogParse.h"
#include "CvsArgs.h"
#include "CvsLog.h"
#include "AppGlue.h"
#include "AppConsole.h"
#include "CPStr.h"
#include "getline.h"

Include dependency graph for LogParse.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void | print (CColorConsole &out, const CRevFile &rev)
void | print (CColorConsole &out, const CRcsFile &rcs, bool recurse=true)
void | print (CColorConsole &out, const CLogNode *node, UStr &offset)
void | CvsLogOutput (CColorConsole &out, CLogNode *node)
void | CvsLogParse (const char *dir, const CvsArgs &args, bool outGraph, void *defWnd)

Function Documentation

void CvsLogOutput | ( | CColorConsole & | out,
 |  | CLogNode * | node
 | ) |

Definition at line 183 of file LogParse.cpp.

References print.

00184 {
00185     switch(node->GetType())
00186     {
00187         case kNodeHeader :
00188         {
00189             CRcsFile & rcs = **(CLogNodeHeader *)node;
00190             print(out, rcs, false);
00191             break;
00192         }
00193         case kNodeBranch :
00194             break;
00195         case kNodeRev :
00196         {
00197             CRevFile & rev = **(CLogNodeRev *)node;
00198             print(out, rev);
00199             break;
00200         }
00201         case kNodeTag :
00202             break;
00203     }
00204 }

void CvsLogParse | ( | const char * | dir,
 |  | const CvsArgs & | args,
 |  | bool | outGraph,
 |  | void * | defWnd
 | ) |

Definition at line 206 of file LogParse.cpp.

References CStr, cvs_err, cvs_outstr, CvsLogParse, EV_INIT_WIDGET, EV_SHOW_WIDGET, free, getline, UCmdTarget::GetWidID, CWincvsApp::gLogGraph, kUMainWidget, launchCVS, NULL, print, CGraphDoc::SetNode, UCreate_GraphWindow, UEventSendMessage, and UMAKEINT.

00207 {
00208     // make a stream of the cvs log output
00209     CStr tmpFile;
00210     FILE *output;
00211     output = launchCVS(dir, args, tmpFile);
00212     if(output == 0L)
00213         return;
00214
00215     // parse
00216     std::vector<CRcsFile> & allRcs = CvsLogParse(output);
00217
00218     // maybe something went wrong or may be the user
00219     // asked to print only the RCS names, so print the
00220     // output directly whithout parsing../
00221     if(allRcs.empty())
00222     {
00223         char *line = 0L;
00224         size_t line_chars_allocated = 0;
00225         int line_length;
00226         fseek(output, SEEK_SET, 0);
00227         while ((line_length = getline (&line, &line_chars_allocated, output)) > 0)
00228         {
00229             cvs_outstr(line, line_length);
00230             cvs_outstr("\n", 1);
00231         }
00232
00233         if (line_length < 0 && !feof (output))
00234             cvs_err("Cannot read output file (error %d)\n", errno);
00235
00236         if(line != 0L)
00237             free (line);
00238     }
00239
00240     // close the temp file
00241     fclose(output);
00242     if(unlink(tmpFile) != 0)
00243     {
00244         cvs_err("Impossible to delete the file '%s' (error %d)",
00245             (const char *)tmpFile, errno);
00246     }
00247
00248     if(allRcs.empty())
00249         return;
00250
00251     // output the result
00252     CColorConsole out;
00253     std::vector<CRcsFile>::iterator i;
00254     for(i = allRcs.begin(); i != allRcs.end(); ++i)
00255     {
00256         CRcsFile & rcs = *i;
00257         if(!outGraph)
00258             print(out, rcs);
00259         else
00260         {
00261             CLogNode *node = CvsLogGraph(rcs);
00262             if(node == 0L)
00263             {
00264                 cvs_err("Impossible to create a graph for %s\n",
00265                     (const char *)rcs.WorkingFile());
00266             }
00267
00268 #ifdef WIN32
00269             CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00270             CGraphDoc *doc;
00271             if(defWnd != 0L)
00272                 doc = (CGraphDoc *)defWnd;
00273             else
00274                 doc = (CGraphDoc*)app->gLogGraph->OpenDocumentFile(NULL);
00275             doc->SetNode(node, dir);
00276 #elif qMacCvsPP
00277             if(defWnd != 0L)
00278                 ((CTreeView *)defWnd)->SetNode(node, dir);
00279             else
00280                 CMacCvsApp::gApp->NewLogTree(node, dir);
00281 #elif qUnix
00282             UCvsGraph * graph = new UCvsGraph(node, dir);
00283             void *win = UCreate_GraphWindow();
00284             UEventSendMessage(graph->GetWidID(), EV_INIT_WIDGET, kUMainWidget, win);
00285             UEventSendMessage(graph->GetWidID(), EV_SHOW_WIDGET, UMAKEINT(kUMainWidget, 1), 0L);
00286 #else
00287             CStr offset;
00288             print(out, node, offset);
00289             delete node;
00290 #endif
00291         }
00292     }
00293
00294     // reset the parser
00295     CvsLogReset();
00296 }

void print | ( | CColorConsole & | out,
 |  | const CLogNode * | node,
 |  | UStr & | offset
 | ) | [static]

Definition at line 144 of file LogParse.cpp.

References CStr, kBold, kNL, kNormal, and kRed.

Referenced by CvsLogOutput, CvsLogParse, and print.

00145 {
00146     out << offset;
00147     switch(node->GetType())
00148     {
00149         case kNodeHeader :
00150         {
00151             CLogNodeHeader *header = (CLogNodeHeader *)node;
00152             out << offset << "Rcs file : '" << kRed << (**header).RcsFile() << kNormal << '\'' << kNL;
00153             break;
00154         }
00155         case kNodeBranch :
00156             break;
00157         case kNodeRev :
00158         {
00159             CLogNodeRev *rev = (CLogNodeRev *)node;
00160             out << offset << kBold << (**rev).RevNum().c_str() << kNormal << kNL;
00161             break;
00162         }
00163         case kNodeTag :
00164             break;
00165     }
00166
00167     CStr newOffset;
00168     newOffset = offset;
00169     newOffset << "    ";
00170     std::vector<CLogNode *>::const_iterator i;
00171     for(i = node->Childs().begin(); i != node->Childs().end(); ++i)
00172     {
00173         print(out, *i, newOffset);
00174         newOffset << ' ';
00175     }
00176
00177     if(node->Next() != 0L)
00178     {
00179         print(out, node->Next(), offset);
00180     }
00181 }

void print | ( | CColorConsole & | out,
 |  | const CRcsFile & | rcs,
 |  | bool | recurse = true
 | ) | [static]

Definition at line 97 of file LogParse.cpp.

References kBold, kBrown, kGreen, kNL, kNormal, kRed, and print.

00098 {
00099     out << "Rcs file : '" << kRed << rcs.RcsFile() << kNormal << '\'' << kNL;
00100     out << "Working file : '" << kBold << rcs.WorkingFile() << kNormal << '\'' << kNL;
00101     out << "Head revision : " << kBold << kRed << rcs.HeadRev().c_str() << kNormal << kNL;
00102     out << "Branch revision : " << kBold << rcs.BranchRev().c_str() << kNormal << kNL;
00103
00104     out << "Locks :" << kBold << (rcs.LockStrict() ? " strict" : "") << kNormal << kNL;
00105     std::vector<CRevNumber>::const_iterator s;
00106     for(s = rcs.LocksList().begin(); s != rcs.LocksList().end(); ++s)
00107     {
00108         const CRevNumber & lock = *s;
00109         out << '\t' << kBold << lock.c_str() << " : '" << lock.Tag() << '\'' << kNormal << kNL;
00110     }
00111
00112     out << "Access :" << kNL;
00113     std::vector<CLogStr>::const_iterator a;
00114     for(a = rcs.AccessList().begin(); a != rcs.AccessList().end(); ++a)
00115     {
00116         out << "\t'" << kBold << *a << kNormal << '\'' << kNL;
00117     }
00118
00119     if(!rcs.SymbolicList().empty())
00120     {
00121         out << "Symbolic names :" << kNL;
00122         std::vector<CRevNumber>::const_iterator n;
00123         for(n = rcs.SymbolicList().begin(); n != rcs.SymbolicList().end(); ++n)
00124         {
00125             const CRevNumber & symb = *n;
00126             out << '\t' << kBold << symb.c_str() << " : '" << symb.Tag() << '\'' << kNormal << kNL;
00127         }
00128     }
00129
00130     out << "Keyword substitution : '" << kBold << rcs.KeywordSubst() << kNormal << '\'' << kNL;
00131     out << "Total revisions : " << kBold << rcs.TotRevisions() << kNormal << kNL;
00132     out << "Selected revisions : " << kBold << rcs.SelRevisions() << kNormal << kNL;
00133     out << "Description :" << kNL << kBrown << rcs.DescLog() << kNormal << kNL;
00134
00135     std::vector<CRevFile>::const_iterator i;
00136     if(recurse) for(i = rcs.AllRevs().begin(); i != rcs.AllRevs().end(); ++i)
00137     {
00138         print(out, *i);
00139     }
00140
00141     out << kGreen << "===============================================" << kNormal << kNL;
00142 }

void print | ( | CColorConsole & | out,
 |  | const CRevFile & | rev
 | ) | [static]

Definition at line 66 of file LogParse.cpp.

References kBlue, kBold, kBrown, kNL, kNormal, and kRed.

00067 {
00068     out << kBlue << "----------------------------" << kNormal << kNL;
00069     out << "Revision : " << kBold << kRed << rev.RevNum().c_str() << kNormal << kNL;
00070     if(!rev.Locker().empty())
00071         out << "Locked by : '" << kBold << rev.Locker() << kNormal << '\'' << kNL;
00072     out << "Date : " << kBold <<
00073         (rev.RevTime().tm_year + 1900) << '/' <<
00074         rev.RevTime().tm_mon << '/' <<
00075         rev.RevTime().tm_mday << ' ' <<
00076         rev.RevTime().tm_hour << ':' <<
00077         rev.RevTime().tm_min << ':' <<
00078         rev.RevTime().tm_sec << kNormal << kNL;
00079     out << "Author : '" << kBold << rev.Author() << kNormal << '\'' << kNL;
00080     out << "State : '" << kBold << rev.State() << kNormal << '\'' << kNL;
00081     out << "Lines : +" << kBold << rev.ChgPos() << ' ' << rev.ChgNeg() << kNormal << kNL;
00082
00083     if(!rev.BranchesList().empty())
00084     {
00085         out << "Branches :" << kNL;
00086         std::vector<CRevNumber>::const_iterator s;
00087         for(s = rev.BranchesList().begin(); s != rev.BranchesList().end(); ++s)
00088         {
00089             const CRevNumber & branch = *s;
00090             out << '\t' << kBold << branch.c_str() << kNormal << kNL;
00091         }
00092     }
00093
00094     out << "Description :" << kNL << kBrown << rev.DescLog() << kNormal << kNL;
00095 }

Generated on Sun Feb 24 01:22:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LogParse.h File Reference

common/LogParse.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | AFX_LOGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Functions

void | CvsLogParse (const char *dir, const CvsArgs &args, bool outGraph=false, void *defWnd=0L)
void | CvsLogOutput (CColorConsole &out, CLogNode *node)

Define Documentation

#define AFX_LOGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Definition at line 26 of file LogParse.h.

Function Documentation

void CvsLogOutput | ( | CColorConsole & | out,
 |  | CLogNode * | node
 | ) |

Definition at line 183 of file LogParse.cpp.

Referenced by CGraphView::OnLButtonDown.

00184 {
00185     switch(node->GetType())
00186     {
00187         case kNodeHeader :
00188         {
00189             CRcsFile & rcs = **(CLogNodeHeader *)node;
00190             print(out, rcs, false);
00191             break;
00192         }
00193         case kNodeBranch :
00194             break;
00195         case kNodeRev :
00196         {
00197             CRevFile & rev = **(CLogNodeRev *)node;
00198             print(out, rev);
00199             break;
00200         }
00201         case kNodeTag :
00202             break;
00203     }
00204 }

void CvsLogParse | ( | const char * | dir,
 |  | const CvsArgs & | args,
 |  | bool | outGraph = false,
 |  | void * | defWnd = 0L
 | ) |

Definition at line 206 of file LogParse.cpp.

Referenced by CvsCmdLogFiles, CvsCmdLogFolder, cvsgui_GetHistoryAsXML, CvsLogParse, and CGraphView::OnViewReload.

00207 {
00208     // make a stream of the cvs log output
00209     CStr tmpFile;
00210     FILE *output;
00211     output = launchCVS(dir, args, tmpFile);
00212     if(output == 0L)
00213         return;
00214
00215     // parse
00216     std::vector<CRcsFile> & allRcs = CvsLogParse(output);
00217
00218     // maybe something went wrong or may be the user
00219     // asked to print only the RCS names, so print the
00220     // output directly whithout parsing../
00221     if(allRcs.empty())
00222     {
00223         char *line = 0L;
00224         size_t line_chars_allocated = 0;
00225         int line_length;
00226         fseek(output, SEEK_SET, 0);
00227         while ((line_length = getline (&line, &line_chars_allocated, output)) > 0)
00228         {
00229             cvs_outstr(line, line_length);
00230             cvs_outstr("\n", 1);
00231         }
00232
00233         if (line_length < 0 && !feof (output))
00234             cvs_err("Cannot read output file (error %d)\n", errno);
00235
00236         if(line != 0L)
00237             free (line);
00238     }
00239
00240     // close the temp file
00241     fclose(output);
00242     if(unlink(tmpFile) != 0)
00243     {
00244         cvs_err("Impossible to delete the file '%s' (error %d)",
00245             (const char *)tmpFile, errno);
00246     }
00247
00248     if(allRcs.empty())
00249         return;
00250
00251     // output the result
00252     CColorConsole out;
00253     std::vector<CRcsFile>::iterator i;
00254     for(i = allRcs.begin(); i != allRcs.end(); ++i)
00255     {
00256         CRcsFile & rcs = *i;
00257         if(!outGraph)
00258             print(out, rcs);
00259         else
00260         {
00261             CLogNode *node = CvsLogGraph(rcs);
00262             if(node == 0L)
00263             {
00264                 cvs_err("Impossible to create a graph for %s\n",
00265                     (const char *)rcs.WorkingFile());
00266             }
00267
00268 #ifdef WIN32
00269             CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00270             CGraphDoc *doc;
00271             if(defWnd != 0L)
00272                 doc = (CGraphDoc *)defWnd;
00273             else
00274                 doc = (CGraphDoc*)app->gLogGraph->OpenDocumentFile(NULL);
00275             doc->SetNode(node, dir);
00276 #elif qMacCvsPP
00277             if(defWnd != 0L)
00278                 ((CTreeView *)defWnd)->SetNode(node, dir);
00279             else
00280                 CMacCvsApp::gApp->NewLogTree(node, dir);
00281 #elif qUnix
00282             UCvsGraph * graph = new UCvsGraph(node, dir);
00283             void *win = UCreate_GraphWindow();
00284             UEventSendMessage(graph->GetWidID(), EV_INIT_WIDGET, kUMainWidget, win);
00285             UEventSendMessage(graph->GetWidID(), EV_SHOW_WIDGET, UMAKEINT(kUMainWidget, 1), 0L);
00286 #else
00287             CStr offset;
00288             print(out, node, offset);
00289             delete node;
00290 #endif
00291         }
00292     }
00293
00294     // reset the parser
00295     CvsLogReset();
00296 }

Generated on Sun Feb 24 01:22:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MacBinEncoding.cpp File Reference

common/MacBinEncoding.cpp File Reference

Go to the source code of this file.

Generated on Sun Feb 24 01:22:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MacBinEncoding.h File Reference

common/MacBinEncoding.h File Reference

#include <LOutlineTable.h>
#include <LCommander.h>
#include <LOutlineItem.h>
#include <LString.h>
#include "MacBinMaps.h"

Include dependency graph for MacBinEncoding.h:

Include dependency graph

Go to the source code of this file.

Compounds

class | CMacBinItem
class | CMacBinTable

Generated on Sun Feb 24 01:22:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MacBinMaps.cpp File Reference

common/MacBinMaps.cpp File Reference

Go to the source code of this file.

Generated on Sun Feb 24 01:22:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MacBinMaps.h File Reference

common/MacBinMaps.h File Reference

#include "CvsPrefs.h"

Include dependency graph for MacBinMaps.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

struct | MACBINMAP
struct | MACBINMAPENTRIES
class | MacBinMaps

Defines

#define | MAX_MACBIN_DESC 63

Define Documentation

#define MAX_MACBIN_DESC 63

Definition at line 32 of file MacBinMaps.h.

Generated on Sun Feb 24 01:22:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MacMisc.cpp File Reference

common/MacMisc.cpp File Reference

Go to the source code of this file.

Generated on Sun Feb 24 01:22:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MacMisc.h File Reference

common/MacMisc.h File Reference

#include "TextBinary.h"
#include "ustr.h"
#include <Dialogs.h>
#include <string.h>

Include dependency graph for MacMisc.h:

Include dependency graph

Go to the source code of this file.

Defines

#define | stricmp strcasecmp
#define | strnicmp strncasecmp

Functions

Handle | GetDItemHdl (DialogPtr dlg, SInt16 Id)
ControlHandle | GetDItemCtrlHdl (DialogPtr dlg, SInt16 Id)
SInt16 | GetDItemMenuSel (DialogPtr dlg, SInt16 Id)
void | SetDItemMenuSel (DialogPtr dlg, SInt16 Id, SInt16 sel)
OSErr | MacGetSpecialFolder (FSSpec &theFolder, UStr &thePath, OSType inType, const char *inDesc)
OSErr | MacGetTempFolder (FSSpec &theFolder, UStr &thePath)
OSErr | MacGetPrefsFolder (FSSpec &theFolder, UStr &thePath)

Define Documentation

#define stricmp strcasecmp

Definition at line 47 of file MacMisc.h.

Referenced by _statcore, AskCreatePersistentSettings, EntnodeData::Compare, KoStatusColumn::Compare, KoPathColumn::Compare, KoNameColumn::Compare, compareConflict, compareName, compareOption, compareRevs, compareStatus, compareTag, getSettingName, ReportConflict::Match, CHistComboBoxEx::NewRoot, TBrowserFill::OnDirectory, TBrowserFillDummy::OnDirectory, TViewFill::OnDirectory, CFillTclEntries::OnDirectory, CFillPyEntries::OnDirectory, ImportReport::OnDirectory, MacroTraversal::OnFile, CWinCvsBrowser::ResetBrowser, UCvsFolders::ResetBrowser, CBrowseFileView::ResetView, UCvsFiles::Search, KoFilterModel::SetMask, CWinCvsBrowser::StepToLocation, tclSetDebugMaskProc, TestValidName, WinInitWidgets, and wnt_stat.

#define strnicmp strncasecmp

Definition at line 48 of file MacMisc.h.

Referenced by MacroTraversal::OnFile, CFindSettings::searchPath, and CWinCvsBrowser::StepToLocation.

Function Documentation

ControlHandle GetDItemCtrlHdl | ( | DialogPtr | dlg,
 |  | SInt16 | Id
 | ) |

Handle GetDItemHdl | ( | DialogPtr | dlg,
 |  | SInt16 | Id
 | ) |

Referenced by CompatGetValue.

SInt16 GetDItemMenuSel | ( | DialogPtr | dlg,
 |  | SInt16 | Id
 | ) |

OSErr MacGetPrefsFolder | ( | FSSpec & | theFolder,
 |  | UStr & | thePath
 | ) |

Referenced by BuildIgnoredList, glue_getenv, and CvsPrefs::load.

OSErr MacGetSpecialFolder | ( | FSSpec & | theFolder,
 |  | UStr & | thePath,
 |  | OSType | inType,
 |  | const char * | inDesc
 | ) |

OSErr MacGetTempFolder | ( | FSSpec & | theFolder,
 |  | UStr & | thePath
 | ) |

Referenced by MakeTmpFile.

void SetDItemMenuSel | ( | DialogPtr | dlg,
 |  | SInt16 | Id,
 |  | SInt16 | sel
 | ) |

Generated on Sun Feb 24 01:22:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MacrosSetup.cpp File Reference

common/MacrosSetup.cpp File Reference

#include "stdafx.h"
#include "MacrosSetup.h"
#include "AppConsole.h"
#include "FileTraversal.h"
#include "getline.h"
#include "CvsArgs.h"
#include "getopt.h"
#include "wincvs.h"

Include dependency graph for MacrosSetup.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | MacroTraversal

Functions

void | getLoc (UStr &path, const char *subFolder)
void | MacrosGetLoc (UStr &path)
void | PythonLibGetLoc (UStr &path)
void | MacrosFlushAll (void)
void | MacrosReloadAll (void)

Variables

CMacroSet gMacrosAdmin
CMacroSet gMacrosSel

Function Documentation

void getLoc | ( | UStr & | path,
 |  | const char * | subFolder
 | ) | [static]

Definition at line 72 of file MacrosSetup.cpp.

References CStr, UStr::empty, UStr::endsWith, CWincvsApp::GetAppPath, SplitPath, and stat.

Referenced by MacrosGetLoc, and PythonLibGetLoc.

00073 {
00074     path = "";
00075 #ifdef WIN32
00076     CWincvsApp* pApp = (CWincvsApp *)AfxGetApp();
00077     pApp->GetAppPath(path);
00078
00079     CString appPath = path;
00080     // first the macro folder may be ./macro
00081     CString test = appPath;
00082     test.TrimRight('\\');
00083     test += "\\";
00084     test += subFolder;
00085
00086     struct stat sb;
00087     if(stat(test, &sb) != -1 && S_ISDIR(sb.st_mode))
00088     {
00089         path = test;
00090         return;
00091     }
00092
00093     CStr uppath, file;
00094     while(SplitPath(appPath, uppath, file) && !uppath.empty())
00095     {
00096         test = uppath;
00097         test.TrimRight('\\');
00098         test += "\\";
00099         test += subFolder;
00100
00101         if(stat(test, &sb) != -1 && S_ISDIR(sb.st_mode))
00102         {
00103             path = test;
00104             return;
00105         }
00106         appPath = uppath;
00107     }
00108     path = test;
00109 #elif defined(qUnix)
00110     struct stat sb;
00111     path = PACKAGE_DATA_DIR;
00112     if(stat(path, &sb) == -1 || !S_ISDIR(sb.st_mode))
00113     {
00114         path = PACKAGE_SOURCE_DIR;
00115         CStr uppath, folder;
00116         SplitPath(path, uppath, folder);
00117         path = uppath;
00118         if(!path.endsWith(kPathDelimiter))
00119             path << kPathDelimiter;
00120         path << subFolder;
00121     }
00122 #elif qMacCvsPP
00123     UStr appPath = CMacCvsApp::GetAppPath();
00124     if(!appPath.endsWith(kPathDelimiter))
00125         appPath << kPathDelimiter;
00126     UStr test = appPath;
00127     test << subFolder;
00128
00129     struct stat sb;
00130     if(stat(test, &sb) != -1 && S_ISDIR(sb.st_mode))
00131     {
00132         path = test;
00133         return;
00134     }
00135
00136     UStr uppath, file;
00137     while(SplitPath(appPath, uppath, file) && !uppath.empty())
00138     {
00139         test = uppath;
00140         if(!test.endsWith(kPathDelimiter))
00141             test << kPathDelimiter;
00142         test << subFolder;
00143
00144         if(stat(test, &sb) != -1 && S_ISDIR(sb.st_mode))
00145         {
00146             path = test;
00147             return;
00148         }
00149         appPath = uppath;
00150     }
00151     path = test;
00152 #else
00153     if(!path.empty() && !path.endsWith(kPathDelimiter))
00154     {
00155         path << kPathDelimiter;
00156     }
00157     path << subFolder;
00158 #endif
00159 }

void MacrosFlushAll ( void ) [static]

Definition at line 171 of file MacrosSetup.cpp.

References CMacroSet::Flush.

Referenced by MacrosReloadAll.

00172 {
00173     gMacrosAdmin.Flush();
00174     gMacrosSel.Flush();
00175 }

void MacrosGetLoc ( UStr & path )

Definition at line 161 of file MacrosSetup.cpp.

References CStr, getLoc, and MACROS_FOLDER.

00162 {
00163     getLoc(path, MACROS_FOLDER);
00164 }

void MacrosReloadAll ( void )

Definition at line 317 of file MacrosSetup.cpp.

References CStr, FileTraverse, MacrosFlushAll, and MacrosGetLoc.

Referenced by UCvsApp::UCvsApp.

00318 {
00319     MacrosFlushAll();
00320
00321     // get the macro folder
00322     CStr path;
00323     MacrosGetLoc(path);
00324
00325     // traverse the macro folder
00326     MacroTraversal traverse;
00327     FileTraverse(path, traverse);
00328 }

void PythonLibGetLoc ( UStr & path )

Definition at line 166 of file MacrosSetup.cpp.

References CStr, getLoc, and PYTHONLIB_FOLDER.

00167 {
00168     getLoc(path, PYTHONLIB_FOLDER);
00169 }

Variable Documentation

CMacroSet gMacrosAdmin

Definition at line 69 of file MacrosSetup.cpp.

CMacroSet gMacrosSel

Definition at line 70 of file MacrosSetup.cpp.

Generated on Sun Feb 24 01:22:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MacrosSetup.h File Reference

common/MacrosSetup.h File Reference

#include <vector>
#include "CPStr.h"

Include dependency graph for MacrosSetup.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CMacroEntry
class | CMacroSet

Defines

#define | MACROS_FOLDER "Macros"
#define | PYTHONLIB_FOLDER "PythonLib"

Functions

void | MacrosReloadAll (void)
void | MacrosGetLoc (UStr &path)
void | PythonLibGetLoc (UStr &path)

Variables

CMacroSet gMacrosAdmin
CMacroSet gMacrosSel

Define Documentation

#define MACROS_FOLDER "Macros"

Definition at line 35 of file MacrosSetup.h.

Referenced by MacrosGetLoc.

#define PYTHONLIB_FOLDER "PythonLib"

Definition at line 36 of file MacrosSetup.h.

Referenced by PythonLibGetLoc.

Function Documentation

void MacrosGetLoc ( UStr & path )

Definition at line 161 of file MacrosSetup.cpp.

Referenced by CTcl_Interp::CTcl_Interp, MacrosReloadAll, and PyMacrosReloadAll.

00162 {
00163     getLoc(path, MACROS_FOLDER);
00164 }

void MacrosReloadAll ( void )

Definition at line 317 of file MacrosSetup.cpp.

00318 {
00319     MacrosFlushAll();
00320
00321     // get the macro folder
00322     CStr path;
00323     MacrosGetLoc(path);
00324
00325     // traverse the macro folder
00326     MacroTraversal traverse;
00327     FileTraverse(path, traverse);
00328 }

void PythonLibGetLoc ( UStr & path )

Definition at line 166 of file MacrosSetup.cpp.

Referenced by InitializeInterp.

00167 {
00168     getLoc(path, PYTHONLIB_FOLDER);
00169 }

Variable Documentation

CMacroSet gMacrosAdmin

Definition at line 98 of file MacrosSetup.h.

CMacroSet gMacrosSel

Definition at line 99 of file MacrosSetup.h.

Generated on Sun Feb 24 01:22:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MakeSurePathExists.cpp File Reference

common/MakeSurePathExists.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include <sys\stat.h>
#include <direct.h>
#include <errno.h>
#include "MakeSurePathExists.h"
#include "FileTraversal.h"

Include dependency graph for MakeSurePathExists.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool | CompatMakeSurePathExists (const char *path, bool promptForCreation)
bool | CreateFolder (const char *fn)

Function Documentation

bool CompatMakeSurePathExists | ( | const char * | path,
 |  | bool | promptForCreation
 | ) |

Definition at line 44 of file MakeSurePathExists.cpp.

References CreateFolder, and MAX_PATH.

00045 {
00046     bool valid = false;
00047
00048 #ifdef WIN32
00049     TCHAR fn[MAX_PATH];
00050     if (_tfullpath(fn, path, MAX_PATH))
00051     {
00052         struct _tstat dirstat;
00053         if (_tstat(fn, &dirstat) == 0)
00054         {
00055             if (dirstat.st_mode & _S_IFDIR)
00056             {
00057                 valid = true;
00058             }
00059         }
00060         else
00061         {
00062             // not found, ask for permission to create
00063             if( promptForCreation &&
00064                 AfxMessageBox("Folder " +
00065                 CString(path) +
00066                 " not found.\nDo you want to create it?", MB_YESNO) == IDYES )
00067             {
00068                 valid = CreateFolder(fn);
00069             }
00070         }
00071     }
00072 #endif
00073
00074     return valid;
00075 }

bool CreateFolder ( const char * fn )

Definition at line 78 of file MakeSurePathExists.cpp.

References CreateFolder, MAX_PATH, and NULL.

00079 {
00080 #ifdef WIN32
00081     // remove possible trailing separator
00082     TCHAR folder[MAX_PATH];
00083     _tcscpy(folder, fn);
00084     int len = _tcslen(folder);
00085     if (len > 1)
00086     {
00087         switch (folder[len - 1])
00088         {
00089         case _T('\\'):
00090         case _T('/'):
00091             folder[len - 1] = 0;
00092             break;
00093         }
00094     }
00095
00096     // try to create
00097     if (_tmkdir(folder) == 0)
00098     {
00099         return true;
00100     }
00101
00102     // if path does not exist, create parent folder and then try again
00103     if (errno == ENOENT)
00104     {
00105         TCHAR drive[_MAX_DRIVE];
00106         TCHAR dir[_MAX_PATH];
00107         TCHAR fname[_MAX_PATH];
00108         _tsplitpath(folder, drive, dir, fname, NULL);
00109         if (!*fname)
00110         {
00111             return false;
00112         }
00113         _tmakepath(fname, drive, dir, NULL, NULL);
00114         if (!CreateFolder(fname))
00115         {
00116             return false;
00117         }
00118
00119         return _tmkdir(folder) == 0;
00120     }
00121 #endif
00122     // not possible to create
00123     return false;
00124 }

Generated on Sun Feb 24 01:22:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MakeSurePathExists.h File Reference

common/MakeSurePathExists.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

bool | CreateFolder (const char *fn)
bool | CompatMakeSurePathExists (const char *path, bool promptForCreation=true)

Function Documentation

bool CompatMakeSurePathExists | ( | const char * | path,
 |  | bool | promptForCreation = true
 | ) |

Definition at line 44 of file MakeSurePathExists.cpp.

Referenced by DDV_CheckPathExists.

00045 {
00046     bool valid = false;
00047
00048 #ifdef WIN32
00049     TCHAR fn[MAX_PATH];
00050     if (_tfullpath(fn, path, MAX_PATH))
00051     {
00052         struct _tstat dirstat;
00053         if (_tstat(fn, &dirstat) == 0)
00054         {
00055             if (dirstat.st_mode & _S_IFDIR)
00056             {
00057                 valid = true;
00058             }
00059         }
00060         else
00061         {
00062             // not found, ask for permission to create
00063             if( promptForCreation &&
00064                 AfxMessageBox("Folder " +
00065                 CString(path) +
00066                 " not found.\nDo you want to create it?", MB_YESNO) == IDYES )
00067             {
00068                 valid = CreateFolder(fn);
00069             }
00070         }
00071     }
00072 #endif
00073
00074     return valid;
00075 }

bool CreateFolder ( const char * fn )

Definition at line 78 of file MakeSurePathExists.cpp.

Referenced by CompatMakeSurePathExists, and CreateFolder.

00079 {
00080 #ifdef WIN32
00081     // remove possible trailing separator
00082     TCHAR folder[MAX_PATH];
00083     _tcscpy(folder, fn);
00084     int len = _tcslen(folder);
00085     if (len > 1)
00086     {
00087         switch (folder[len - 1])
00088         {
00089         case _T('\\'):
00090         case _T('/'):
00091             folder[len - 1] = 0;
00092             break;
00093         }
00094     }
00095
00096     // try to create
00097     if (_tmkdir(folder) == 0)
00098     {
00099         return true;
00100     }
00101
00102     // if path does not exist, create parent folder and then try again
00103     if (errno == ENOENT)
00104     {
00105         TCHAR drive[_MAX_DRIVE];
00106         TCHAR dir[_MAX_PATH];
00107         TCHAR fname[_MAX_PATH];
00108         _tsplitpath(folder, drive, dir, fname, NULL);
00109         if (!*fname)
00110         {
00111             return false;
00112         }
00113         _tmakepath(fname, drive, dir, NULL, NULL);
00114         if (!CreateFolder(fname))
00115         {
00116             return false;
00117         }
00118
00119         return _tmkdir(folder) == 0;
00120     }
00121 #endif
00122     // not possible to create
00123     return false;
00124 }

Generated on Sun Feb 24 01:22:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MoveToTrash.cpp File Reference

common/MoveToTrash.cpp File Reference

#include "stdafx.h"
#include "MoveToTrash.h"
#include "CPStr.h"
#include "FileTraversal.h"
#include "AppConsole.h"
#include <direct.h>

Include dependency graph for MoveToTrash.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void | CompatBeginMoveToTrash (void)
void | CompatEndMoveToTrash (void)
bool | CompatMoveToTrash (const char *file, const char *dir, const FSSpec *spec)

Function Documentation

void CompatBeginMoveToTrash ( void )

Definition at line 323 of file MoveToTrash.cpp.

Referenced by CvsCmdRemoveFiles.

00324 {
00325 #ifdef macintosh
00326     sToTrash.erase(sToTrash.begin(), sToTrash.end());
00327     sTrashRetainer = true;
00328 #endif
00329 }

void CompatEndMoveToTrash ( void )

Definition at line 331 of file MoveToTrash.cpp.

References cvs_err, cvs_out, and err.

Referenced by CvsCmdRemoveFiles.

00332 {
00333 #ifdef macintosh
00334     if(sToTrash.size() > 0)
00335     {
00336         OSErr err;
00337         err = MoveToTrash(sToTrash);
00338         if(err != noErr)
00339             cvs_err("Unable to send files to the trash (Error %d)\n", err);
00340         else
00341             cvs_out("Files has been moved successfully to the trash...\n");
00342     }
00343
00344     sToTrash.erase(sToTrash.begin(), sToTrash.end());
00345     sTrashRetainer = false;
00346 #endif
00347 }

bool CompatMoveToTrash | ( | const char * | file,
 |  | const char * | dir,
 |  | const FSSpec * | spec
 | ) |

Definition at line 349 of file MoveToTrash.cpp.

References CStr, cvs_err, NULL, and UFSSpec.

00350 {
00351 #ifdef macintosh
00352     if(sTrashRetainer)
00353     {
00354         sToTrash.push_back(*spec);
00355         return true;
00356     }
00357
00358     return spec != NULL ? MoveToTrash(spec) == noErr : false;
00359 #elif defined(WIN32)
00360     SHFILEOPSTRUCT fileop;
00361     CStr fullpath(dir);
00362     if(!fullpath.empty() && !fullpath.endsWith(kPathDelimiter))
00363     {
00364         fullpath << kPathDelimiter;
00365     }
00366     fullpath << file;
00367     fullpath << ' ';
00368     fullpath[fullpath.length() - 1] = '\0';
00369
00370     fileop.hwnd     = *AfxGetMainWnd();
00371     fileop.wFunc    = FO_DELETE;
00372     fileop.pFrom    = fullpath;
00373     fileop.pTo      = 0L;
00374     fileop.fFlags   = FOF_ALLOWUNDO | FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI;
00375
00376     if(SHFileOperation(&fileop) != 0)
00377     {
00378         if(dir != 0L && chdir(dir) != 0)
00379             return false;
00380
00381         cvs_err("Unable to send \'%s\' to the recycle bin (error %d)\n",
00382             file, GetLastError());
00383         cvs_err("Trying now to delete \'%s\' instead\n", file);
00384         return remove(file) == 0;
00385     }
00386     return true;
00387 #else /* !macintosh && !WIN32 */
00388     CStr fullpath(dir);
00389     if(!fullpath.empty() && !fullpath.endsWith(kPathDelimiter))
00390     {
00391         fullpath << kPathDelimiter;
00392     }
00393     fullpath << file;
00394
00395     return remove(fullpath) == 0;
00396 #endif /* !macintosh && !WIN32 */
00397 }

Generated on Sun Feb 24 01:22:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MoveToTrash.h File Reference

common/MoveToTrash.h File Reference

#include "TextBinary.h"

Include dependency graph for MoveToTrash.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

bool | CompatMoveToTrash (const char *file, const char *dir=0L, const FSSpec *spec=0L)
void | CompatBeginMoveToTrash (void)
void | CompatEndMoveToTrash (void)

Function Documentation

void CompatBeginMoveToTrash ( void )

Definition at line 323 of file MoveToTrash.cpp.

00324 {
00325 #ifdef macintosh
00326     sToTrash.erase(sToTrash.begin(), sToTrash.end());
00327     sTrashRetainer = true;
00328 #endif
00329 }

void CompatEndMoveToTrash ( void )

Definition at line 331 of file MoveToTrash.cpp.

00332 {
00333 #ifdef macintosh
00334     if(sToTrash.size() > 0)
00335     {
00336         OSErr err;
00337         err = MoveToTrash(sToTrash);
00338         if(err != noErr)
00339             cvs_err("Unable to send files to the trash (Error %d)\n", err);
00340         else
00341             cvs_out("Files has been moved successfully to the trash...\n");
00342     }
00343
00344     sToTrash.erase(sToTrash.begin(), sToTrash.end());
00345     sTrashRetainer = false;
00346 #endif
00347 }

bool CompatMoveToTrash | ( | const char * | file,
 |  | const char * | dir = 0L,
 |  | const FSSpec * | spec = 0L
 | ) |

Definition at line 349 of file MoveToTrash.cpp.

Referenced by RemoveCvsArgs::addfile, UCvsFiles::OnCmdTrash, KoMoveToTrashHandler::OnFiles, and tclSafeRemove.

00350 {
00351 #ifdef macintosh
00352     if(sTrashRetainer)
00353     {
00354         sToTrash.push_back(*spec);
00355         return true;
00356     }
00357
00358     return spec != NULL ? MoveToTrash(spec) == noErr : false;
00359 #elif defined(WIN32)
00360     SHFILEOPSTRUCT fileop;
00361     CStr fullpath(dir);
00362     if(!fullpath.empty() && !fullpath.endsWith(kPathDelimiter))
00363     {
00364         fullpath << kPathDelimiter;
00365     }
00366     fullpath << file;
00367     fullpath << ' ';
00368     fullpath[fullpath.length() - 1] = '\0';
00369
00370     fileop.hwnd     = *AfxGetMainWnd();
00371     fileop.wFunc    = FO_DELETE;
00372     fileop.pFrom    = fullpath;
00373     fileop.pTo      = 0L;
00374     fileop.fFlags   = FOF_ALLOWUNDO | FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI;
00375
00376     if(SHFileOperation(&fileop) != 0)
00377     {
00378         if(dir != 0L && chdir(dir) != 0)
00379             return false;
00380
00381         cvs_err("Unable to send \'%s\' to the recycle bin (error %d)\n",
00382             file, GetLastError());
00383         cvs_err("Trying now to delete \'%s\' instead\n", file);
00384         return remove(file) == 0;
00385     }
00386     return true;
00387 #else /* !macintosh && !WIN32 */
00388     CStr fullpath(dir);
00389     if(!fullpath.empty() && !fullpath.endsWith(kPathDelimiter))
00390     {
00391         fullpath << kPathDelimiter;
00392     }
00393     fullpath << file;
00394
00395     return remove(fullpath) == 0;
00396 #endif /* !macintosh && !WIN32 */
00397 }

Generated on Sun Feb 24 01:22:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MultiFiles.cpp File Reference

common/MultiFiles.cpp File Reference

#include "stdafx.h"
#include <stdlib.h>
#include <string.h>
#include "MultiFiles.h"
#include "CvsArgs.h"
#include "AppConsole.h"
#include "CPStr.h"
#include "AppGlue.h"
#include <errno.h>

Include dependency graph for MultiFiles.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:22:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MultiFiles.h File Reference

common/MultiFiles.h File Reference

#include "TextBinary.h"
#include "CPStr.h"
#include <vector>

Include dependency graph for MultiFiles.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | FileEntry
class | MultiFiles
class | MultiFilesEntry

Generated on Sun Feb 24 01:22:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MultiString.cpp File Reference

common/MultiString.cpp File Reference

#include "stdafx.h"
#include "MultiString.h"

Include dependency graph for MultiString.cpp:

Include dependency graph

Go to the source code of this file.

Variables

template class | TMString< UStr >
template class | TMString< UPStr >

Variable Documentation

template class TMString< UPStr >

Definition at line 161 of file MultiString.cpp.

template class TMString< UStr >

Definition at line 160 of file MultiString.cpp.

Generated on Sun Feb 24 01:22:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MultiString.h File Reference

common/MultiString.h File Reference

#include <vector>
#include "Persistent.h"
#include "CPStr.h"

Include dependency graph for MultiString.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CKeyString
class | CMPString
class | CMString
class | TMPersistent
class | TMString

Defines

#define | NAMESPACE(w) ::

Define Documentation

#define NAMESPACE ( w ) ::

Definition at line 36 of file MultiString.h.

Referenced by CMMenuString::GetData, TMString::GetData, TMString::Insert, CCommit_MAIN::OnSelchangeCombo, CCmdLine_MAIN::OnSelchangePrevcmd, TMString::Remove, CMMenuString::SizeOf, and TMString::SizeOf.

Generated on Sun Feb 24 01:22:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


OptionalPropertySheet.cpp File Reference

common/OptionalPropertySheet.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "OptionalPropertySheet.h"
#include "CvsPrefs.h"

Include dependency graph for OptionalPropertySheet.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:22:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


OptionalPropertySheet.h File Reference

common/OptionalPropertySheet.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | COptionalPropertySheet

Defines

#define | AFX_OPTIONALPROPERTYSHEET_H__F82DC8BB_73CD_4AEA_8635_1A0932F24C7D__INCLUDED_

Define Documentation

#define AFX_OPTIONALPROPERTYSHEET_H__F82DC8BB_73CD_4AEA_8635_1A0932F24C7D__INCLUDED_

Definition at line 22 of file OptionalPropertySheet.h.

Generated on Sun Feb 24 01:22:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Persistent.cpp File Reference

common/Persistent.cpp File Reference

#include "stdafx.h"
#include <stdlib.h>
#include <string.h>
#include <map>
#include <errno.h>
#include "wincvs.h"
#include "Persistent.h"
#include "AppConsole.h"
#include "CPStr.h"
#include "uconsole.h"
#include "uwidget.h"
#include "FileTraversal.h"
#include "Authen.h"
#include "CvsPrefs.h"
#include "getline.h"
#include "CvsAlert.h"

Include dependency graph for Persistent.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | CFindSettings
class | USaveSettings

Defines

#define | NEW new
#define | SETTINGS_FOLDER "Settings"

Functions

int | simple_diff (const char *file1, const char *file2)
bool | SettingsGetLoc (UStr &path)
bool | GetAllPersistentSettings (std::map< UStr, UStr > &res)
bool | loadSettingsInternal (const char *fullname, bool(*func)(const char *token, const char *value, void *data), void *data)
void | getSettingName (const char *fromfile, UStr &res)
bool | HasPersistentSettings (const char *path)
bool | _loadPersistentSettings (const char *token, const char *value, void *data)
void | LoadPersistentSettings (const char *path, bool quiet)
void | SaveAsPersistentSettings (const char *name, const char *path)
void | AskCreatePersistentSettings (const char *path)
void | SavePersistentSettings (const char *path)

Define Documentation

#define NEW new

Definition at line 92 of file Persistent.cpp.

Referenced by AskCreatePersistentSettings, and CPersistent::Register.

#define SETTINGS_FOLDER "Settings"

Definition at line 665 of file Persistent.cpp.

Referenced by SettingsGetLoc.

Function Documentation

bool _loadPersistentSettings | ( | const char * | token,
 |  | const char * | value,
 |  | void * | data
 | ) | [static]

Definition at line 1063 of file Persistent.cpp.

References cvs_err, CPersistent::Find, CPersistent::CPersistentEntry::fUniqueName, CPersistent::CPersistentEntry::fValue, UObject::IsKindOf, Authen::tokenToKind, and URUNTIME_CLASS.

Referenced by LoadPersistentSettings.

01064 {
01065     if(strcmp(token, "CVSROOT") == 0)
01066     {
01067         gCvsPrefs = value;
01068     }
01069     else if(strcmp(token, "AUTHENTICATION") == 0)
01070     {
01071         gAuthen.setkind(Authen::tokenToKind(value));
01072     }
01073     else if(strcmp(token, "PATH") == 0)
01074     {
01075     }
01076     else
01077     {
01078         CPersistent::CPersistentEntry *entry = CPersistent::Find(token);
01079         if(entry == 0L)
01080         {
01081             //cvs_err("Persistent value '%s' is not registred\n", token);
01082         }
01083         else
01084         {
01085             if(entry->fValue->IsKindOf(URUNTIME_CLASS(CPersistentBool)))
01086             {
01087                 CPersistentBool *pbool = (CPersistentBool *)entry->fValue;
01088                 if(strcmp(value, "true") == 0)
01089                     *pbool = true;
01090                 else if(strcmp(value, "false") == 0)
01091                     *pbool = false;
01092                 else
01093                     cvs_err("Invalid value '%s' for persistent '%s'\n",
01094                         (const char *)value, entry->fUniqueName);
01095             }
01096             else if(entry->fValue->IsKindOf(URUNTIME_CLASS(CPersistentInt)))
01097             {
01098                 CPersistentInt *pint = (CPersistentInt *)entry->fValue;
01099                 int aint;
01100                 int check = sscanf(value, "%d", &aint);
01101                 if(check == 1)
01102                     *pint = aint;
01103                 else
01104                     cvs_err("Invalid value '%s' for persistent '%s'\n",
01105                         (const char *)value, entry->fUniqueName);
01106             }
01107             else if(entry->fValue->IsKindOf(URUNTIME_CLASS(PCStr)))
01108             {
01109                 PCStr *pstr = (PCStr *)entry->fValue;
01110                 *pstr = value;
01111             }
01112             else if(entry->fValue->IsKindOf(URUNTIME_CLASS(PCPStr)))
01113             {
01114                 PCPStr *pstr = (PCPStr *)entry->fValue;
01115                 *pstr = value;
01116             }
01117             else
01118             {
01119                 cvs_err("Unknown persistent value '%s'\n", entry->fUniqueName);
01120             }
01121         }
01122     }
01123
01124     return false;
01125 }

void AskCreatePersistentSettings ( const char * path )

Definition at line 1164 of file Persistent.cpp.

References cvs_err, CvsAlert, UWidget::DoModal, UStr::empty, EV_INIT_WIDGET, FileTraverse, getSettingName, UCmdTarget::GetWidID, IDD_SAVESETTINGS, kUMainWidget, LoadPersistentSettings, USaveSettings::m_copyFromPath, USaveSettings::m_settingName, CFindSettings::m_settingsFile, NEW, SaveAsPersistentSettings, SettingsGetLoc, stricmp, UCreate_SettingsDlg, and UEventSendMessage.

01165 {
01166     UStr settingsDir;
01167     if(!SettingsGetLoc(settingsDir))
01168         return;
01169
01170     int id = 0;
01171 #ifdef WIN32
01172     id = IDD_SAVESETTINGS;
01173 #endif
01174 #ifdef qMacCvsPP
01175     id = dlg_SaveSettings;
01176 #endif
01177     CFindSettings finder(path);
01178     FileTraverse(settingsDir, finder);
01179
01180     UStr oldName;
01181
01182     if(!finder.m_settingsFile.empty())
01183     {
01184         getSettingName(finder.m_settingsFile, oldName);
01185     }
01186
01187     USaveSettings *dlg = NEW USaveSettings(path, oldName);
01188
01189 #if qUnix
01190     void *wid;
01191 #   if qGTK
01192     wid = UCreate_SettingsDlg();
01193 #   endif
01194
01195     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01196 #endif
01197
01198     if(dlg->DoModal(id))
01199     {
01200         UStr name = dlg->m_settingName;
01201         UStr fileToDelete;
01202
01203         if(!name.empty())
01204         {
01205             if(!oldName.empty())
01206             {
01207                 if(stricmp(oldName, name) != 0)
01208                 {
01209                     UStr prompt("The setting '");
01210                     prompt << oldName;
01211                     prompt << "' already points on the same folder. ";
01212                     prompt << "Press 'Delete' if you want to overide this setting ";
01213                     prompt << "(two settings cannot point on the same location).";
01214                     if(CvsAlert(prompt, "Cancel", "Delete"))
01215                     {
01216                         delete dlg;
01217                         return;
01218                     }
01219                     fileToDelete = finder.m_settingsFile;
01220                 }
01221             }
01222
01223             if(!dlg->m_copyFromPath.empty())
01224                 LoadPersistentSettings(dlg->m_copyFromPath);
01225             SaveAsPersistentSettings(name, path);
01226
01227             if(!fileToDelete.empty())
01228             {
01229                 if(remove(fileToDelete) != 0)
01230                     cvs_err("Error while deleting '%s' (error %d)\n", (const char *)fileToDelete, errno);
01231             }
01232         }
01233     }
01234     delete dlg;
01235 }

bool GetAllPersistentSettings ( std::map< UStr, UStr > & res ) [static]

Definition at line 1039 of file Persistent.cpp.

References FileTraverse, and SettingsGetLoc.

Referenced by USaveSettings::DoDataExchange.

01040 {
01041     UStr settingsDir;
01042     if(!SettingsGetLoc(settingsDir))
01043         return false;
01044
01045     CFindSettings finder(res);
01046     FileTraverse(settingsDir, finder);
01047
01048     return !res.empty();
01049 }

void getSettingName | ( | const char * | fromfile,
 |  | UStr & | res
 | ) | [static]

Definition at line 936 of file Persistent.cpp.

References CStr, GetExtension, SplitPath, and stricmp.

Referenced by AskCreatePersistentSettings, and CFindSettings::searchAllPath.

00937 {
00938     CStr base, ext, uppath, filename;
00939     SplitPath(fromfile, uppath, filename);
00940     GetExtension(filename, base, ext);
00941     if(!base.empty() && stricmp(ext, "txt") == 0)
00942         res = base;
00943     else
00944         res = filename;
00945 }

bool HasPersistentSettings ( const char * path )

Definition at line 1051 of file Persistent.cpp.

References UStr::empty, FileTraverse, CFindSettings::m_settingsFile, and SettingsGetLoc.

01052 {
01053     UStr settingsDir;
01054     if(!SettingsGetLoc(settingsDir))
01055         return false;
01056
01057     CFindSettings finder(path);
01058     FileTraverse(settingsDir, finder);
01059
01060     return !finder.m_settingsFile.empty();
01061 }

void LoadPersistentSettings | ( | const char * | path,
 |  | bool | quiet
 | ) |

Definition at line 1127 of file Persistent.cpp.

References _loadPersistentSettings, UStr::empty, FileTraverse, kBold, kNL, kNormal, kUnderline, loadSettingsInternal, CFindSettings::m_settingsFile, and SettingsGetLoc.

01128 {
01129     UStr settingsDir;
01130     if(!SettingsGetLoc(settingsDir))
01131         return;
01132
01133     CFindSettings finder(path);
01134     FileTraverse(settingsDir, finder);
01135
01136     if(finder.m_settingsFile.empty())
01137         return;
01138
01139     if(loadSettingsInternal(finder.m_settingsFile, _loadPersistentSettings, 0L) && !quiet)
01140     {
01141         CColorConsole out;
01142         out << kBold << "Loaded settings for " << kNormal << kUnderline << path << kNormal << kBold << " successfully..." << kNormal << kNL;
01143     }
01144 }

bool loadSettingsInternal | ( | const char * | fullname,
 |  | bool(* | func)(const char *token, const char *value, void *data),
 |  | void * | data
 | ) | [static]

Definition at line 867 of file Persistent.cpp.

References cvs_err, free, getline, and UStr::set.

Referenced by LoadPersistentSettings, and CFindSettings::OnFile.

00869 {
00870     bool res = false;
00871     int line_length;
00872     char *line = 0L;
00873     size_t line_chars_allocated = 0;
00874     FILE *fp = fopen(fullname, "r");
00875
00876     if(fp == 0L)
00877     {
00878         cvs_err("Failed to open the setting file '%s' for reading (error %d)",
00879             fullname, errno);
00880         goto fail;
00881     }
00882
00883     while ((line_length = getline (&line, &line_chars_allocated, fp)) > 0)
00884     {
00885         // read each token=value
00886         char *tmp = 0L;
00887
00888         if((tmp = strchr(line, '\n')) != 0L)
00889             *tmp = '\0';
00890
00891         tmp = line;
00892         while(isspace(*tmp) && *tmp != '\0')
00893             tmp++;
00894         if(*tmp == '\0' || *tmp == '#')
00895             continue;
00896
00897         UStr token;
00898         UStr value;
00899         const char *tmp2 = strchr(tmp, '=');
00900         if(tmp2 == 0L)
00901             continue;
00902
00903         token.set(tmp, tmp2 - tmp);
00904         value = tmp2 + 1;
00905
00906         // check version
00907         if(strcmp(token, "VERSION") == 0)
00908         {
00909             if(atoi(value) != 1)
00910             {
00911                 cvs_err("Newer format than expected in the setting file '%s'\n", fullname);
00912                 goto fail;
00913             }
00914             continue;
00915         }
00916
00917         if(func(token, value, data))
00918             break;
00919     }
00920
00921     if (line_length < 0 && !feof (fp))
00922     {
00923         cvs_err("Cannot read file (error %d)\n", errno);
00924         goto fail;
00925     }
00926
00927     res = true;
00928 fail:
00929     if(line != 0L)
00930         free(line);
00931     if(fp!= 0L)
00932         fclose(fp);
00933     return res;
00934 }

void SaveAsPersistentSettings | ( | const char * | name,
 |  | const char * | path
 | ) | [static]

Definition at line 1146 of file Persistent.cpp.

References UStr::empty, UStr::endsWith, kBold, kNL, kNormal, kUnderline, CPersistent::SaveAllSettings, and SettingsGetLoc.

Referenced by AskCreatePersistentSettings.

01147 {
01148     UStr settingFileName;
01149     if(!SettingsGetLoc(settingFileName))
01150         return;
01151
01152     if(!settingFileName.empty() && !settingFileName.endsWith(kPathDelimiter))
01153         settingFileName << kPathDelimiter;
01154     settingFileName << name;
01155     settingFileName << ".txt";
01156
01157     if(CPersistent::SaveAllSettings(settingFileName, path))
01158     {
01159         CColorConsole out;
01160         out << kBold << "Saved settings for " << kNormal << kUnderline << path << kNormal << kBold << " successfully..." << kNormal << kNL;
01161     }
01162 }

void SavePersistentSettings ( const char * path )

Definition at line 1237 of file Persistent.cpp.

References UStr::empty, FileTraverse, kBold, kNL, kNormal, kUnderline, CFindSettings::m_settingsFile, CFindSettings::m_topfolder, CPersistent::SaveAllSettings, and SettingsGetLoc.

01238 {
01239     UStr settingsDir;
01240     if(!SettingsGetLoc(settingsDir))
01241         return;
01242
01243     CFindSettings finder(path);
01244     FileTraverse(settingsDir, finder);
01245
01246     if(finder.m_settingsFile.empty())
01247         return;
01248
01249     if(CPersistent::SaveAllSettings(finder.m_settingsFile, finder.m_topfolder))
01250     {
01251         CColorConsole out;
01252         out << kBold << "Saved settings for " << kNormal << kUnderline << path << kNormal << kBold << " successfully..." << kNormal << kNL;
01253     }
01254 }

bool SettingsGetLoc ( UStr & path ) [static]

Definition at line 667 of file Persistent.cpp.

References CStr, cvs_err, CWincvsApp::GetAppPath, SETTINGS_FOLDER, and stat.

Referenced by AskCreatePersistentSettings, GetAllPersistentSettings, HasPersistentSettings, LoadPersistentSettings, SaveAsPersistentSettings, and SavePersistentSettings.

00668 {
00669     struct stat sb;
00670
00671     path = "";
00672 #ifdef WIN32
00673     CWincvsApp* pApp = (CWincvsApp *)AfxGetApp();
00674     pApp->GetAppPath(path);
00675     if(!path.empty() && !path.endsWith(kPathDelimiter))
00676     {
00677         path << kPathDelimiter;
00678     }
00679     path << SETTINGS_FOLDER;
00680 #elif defined(qUnix)
00681     path = gCvsPrefs.Home();
00682     if(!path.endsWith(kPathDelimiter))
00683         path << kPathDelimiter;
00684     path << ".gcvs";
00685
00686     if(stat(path, &sb) != -1)
00687     {
00688         if(!S_ISDIR(sb.st_mode))
00689         {
00690             cvs_err("The file '%s' already exists and is not a directory", (char *)path, errno);
00691             return false;
00692         }
00693     }
00694     else if(mkdir(path, 0750) != 0)
00695     {
00696         cvs_err("Unable to create the directory '%s' (error %d)", (char *)path, errno);
00697         return false;
00698     }
00699
00700     if(!path.endsWith(kPathDelimiter))
00701         path << kPathDelimiter;
00702     path << SETTINGS_FOLDER;
00703 #else
00704 #   ifdef qMacCvsPP
00705     path = CMacCvsApp::GetAppPath();
00706 #   endif /* qMacCvsPP */
00707
00708     if(!path.empty() && !path.endsWith(kPathDelimiter))
00709     {
00710         path << kPathDelimiter;
00711     }
00712     path << SETTINGS_FOLDER;
00713 #endif
00714
00715     if(stat(path, &sb) != -1 && S_ISDIR(sb.st_mode))
00716         return true;
00717
00718 #if qUnix || TARGET_RT_MAC_MACHO
00719     if(mkdir(path, 0750) != 0)
00720 #else
00721     if(mkdir(path) != 0)
00722 #endif
00723     {
00724         cvs_err("Failed to create the setting folder '%s' (error %d)",
00725             (const char *)path, errno);
00726         return false;
00727     }
00728     return true;
00729 }

int simple_diff | ( | const char * | file1,
 |  | const char * | file2
 | ) | [static]

Definition at line 157 of file Persistent.cpp.

Referenced by CPersistent::SaveAllSettings.

00158 {
00159     FILE *f1 = fopen(file1, "rb");
00160     if(f1 == 0L)
00161         return -1;
00162
00163     FILE *f2 = fopen(file2, "rb");
00164     if(f2 == 0L)
00165     {
00166         fclose(f1);
00167         return 1;
00168     }
00169
00170     int res = -1;
00171     char buf1[8000];
00172     char buf2[8000];
00173     size_t num1, num2;
00174     while(!feof(f1) && !feof(f2) && !ferror(f1) && !ferror(f2))
00175     {
00176         num1 = fread(buf1, sizeof(char), 8000, f1);
00177         num2 = fread(buf2, sizeof(char), 8000, f2);
00178         if(num1 != num2 || (res = memcmp(buf1, buf2, num1 * sizeof(char))) != 0)
00179             goto fail;
00180     }
00181
00182     if(ferror(f1) || ferror(f2))
00183         goto fail;
00184
00185     if(feof(f1) ^ feof(f2))
00186         goto fail;
00187
00188     res = 0;
00189 fail:
00190     fclose(f1);
00191     fclose(f2);
00192     return res;
00193 }

Generated on Sun Feb 24 01:22:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Persistent.h File Reference

common/Persistent.h File Reference

#include <string.h>
#include <vector>
#include "uobject.h"

Include dependency graph for Persistent.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CPersistent
struct | CPersistent::CPersistentEntry
class | CPersistentBool
class | CPersistentInt
class | CPersistentT

Defines

#define | PERSISTENT_CAST(T)
#define | PROFILE_NAME "CVS settings"

Enumerations

enum kClassPersistent {
kNoClass = 0x00,
kAddSettings = 0x01
}

Functions

void | LoadPersistentSettings (const char *path, bool quiet=false)
bool | HasPersistentSettings (const char *path)
void | AskCreatePersistentSettings (const char *path)
void | SavePersistentSettings (const char *path)

Define Documentation

#define PERSISTENT_CAST ( T )

Value:

inline operator const T &() const {return fValue;} \
    inline const T * operator ->() const {return &fValue;} \
    inline T & operator=(const T & val) { TouchTimeStamp(); return fValue = val;} \
    inline bool operator==(const T & val) const {return fValue == val;}

Definition at line 89 of file Persistent.h.

#define PROFILE_NAME "CVS settings"

Definition at line 156 of file Persistent.h.

Referenced by CvsPrefs::load, CPersistent::LoadAll, MigrateCvsrootList, and CPersistent::SaveAll.

Enumeration Type Documentation

enum kClassPersistent

Enumeration values:
kNoClass
kAddSettings

Definition at line 36 of file Persistent.h.

Referenced by CKeyString::CKeyString, CMPString::CMPString, CMString::CMString, CPersistent::CPersistent, CPersistentBool::CPersistentBool, CPersistentInt::CPersistentInt, CPersistentT< bool >::CPersistentT, PCPStr::PCPStr, PCStr::PCStr, PyPersistent::PyPersistent, CPersistent::Register, TMPersistent::TMPersistent, and TMString::TMString.

00037 {
00038     kNoClass = 0x00,
00039     kAddSettings = 0x01
00040 } kClassPersistent;

Function Documentation

void AskCreatePersistentSettings ( const char * path )

Definition at line 1164 of file Persistent.cpp.

Referenced by UCvsFrame::OnCmdSaveSettings, CWincvsDoc::OnSavesettings, CWinCvsBrowser::ResetBrowser, and UCvsFolders::ResetBrowser.

01165 {
01166     UStr settingsDir;
01167     if(!SettingsGetLoc(settingsDir))
01168         return;
01169
01170     int id = 0;
01171 #ifdef WIN32
01172     id = IDD_SAVESETTINGS;
01173 #endif
01174 #ifdef qMacCvsPP
01175     id = dlg_SaveSettings;
01176 #endif
01177     CFindSettings finder(path);
01178     FileTraverse(settingsDir, finder);
01179
01180     UStr oldName;
01181
01182     if(!finder.m_settingsFile.empty())
01183     {
01184         getSettingName(finder.m_settingsFile, oldName);
01185     }
01186
01187     USaveSettings *dlg = NEW USaveSettings(path, oldName);
01188
01189 #if qUnix
01190     void *wid;
01191 #   if qGTK
01192     wid = UCreate_SettingsDlg();
01193 #   endif
01194
01195     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01196 #endif
01197
01198     if(dlg->DoModal(id))
01199     {
01200         UStr name = dlg->m_settingName;
01201         UStr fileToDelete;
01202
01203         if(!name.empty())
01204         {
01205             if(!oldName.empty())
01206             {
01207                 if(stricmp(oldName, name) != 0)
01208                 {
01209                     UStr prompt("The setting '");
01210                     prompt << oldName;
01211                     prompt << "' already points on the same folder. ";
01212                     prompt << "Press 'Delete' if you want to overide this setting ";
01213                     prompt << "(two settings cannot point on the same location).";
01214                     if(CvsAlert(prompt, "Cancel", "Delete"))
01215                     {
01216                         delete dlg;
01217                         return;
01218                     }
01219                     fileToDelete = finder.m_settingsFile;
01220                 }
01221             }
01222
01223             if(!dlg->m_copyFromPath.empty())
01224                 LoadPersistentSettings(dlg->m_copyFromPath);
01225             SaveAsPersistentSettings(name, path);
01226
01227             if(!fileToDelete.empty())
01228             {
01229                 if(remove(fileToDelete) != 0)
01230                     cvs_err("Error while deleting '%s' (error %d)\n", (const char *)fileToDelete, errno);
01231             }
01232         }
01233     }
01234     delete dlg;
01235 }

bool HasPersistentSettings ( const char * path )

Definition at line 1051 of file Persistent.cpp.

Referenced by CWinCvsBrowser::ResetBrowser, and UCvsFolders::ResetBrowser.

01052 {
01053     UStr settingsDir;
01054     if(!SettingsGetLoc(settingsDir))
01055         return false;
01056
01057     CFindSettings finder(path);
01058     FileTraverse(settingsDir, finder);
01059
01060     return !finder.m_settingsFile.empty();
01061 }

void LoadPersistentSettings | ( | const char * | path,
 |  | bool | quiet = false
 | ) |

Definition at line 1127 of file Persistent.cpp.

Referenced by AskCreatePersistentSettings, CWinCvsBrowser::ResetBrowser, and UCvsFolders::ResetBrowser.

01128 {
01129     UStr settingsDir;
01130     if(!SettingsGetLoc(settingsDir))
01131         return;
01132
01133     CFindSettings finder(path);
01134     FileTraverse(settingsDir, finder);
01135
01136     if(finder.m_settingsFile.empty())
01137         return;
01138
01139     if(loadSettingsInternal(finder.m_settingsFile, _loadPersistentSettings, 0L) && !quiet)
01140     {
01141         CColorConsole out;
01142         out << kBold << "Loaded settings for " << kNormal << kUnderline << path << kNormal << kBold << " successfully..." << kNormal << kNL;
01143     }
01144 }

void SavePersistentSettings ( const char * path )

Definition at line 1237 of file Persistent.cpp.

Referenced by CvsPrefs::save.

01238 {
01239     UStr settingsDir;
01240     if(!SettingsGetLoc(settingsDir))
01241         return;
01242
01243     CFindSettings finder(path);
01244     FileTraverse(settingsDir, finder);
01245
01246     if(finder.m_settingsFile.empty())
01247         return;
01248
01249     if(CPersistent::SaveAllSettings(finder.m_settingsFile, finder.m_topfolder))
01250     {
01251         CColorConsole out;
01252         out << kBold << "Saved settings for " << kNormal << kUnderline << path << kNormal << kBold << " successfully..." << kNormal << kNL;
01253     }
01254 }

Generated on Sun Feb 24 01:22:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PromptFiles.cpp File Reference

common/PromptFiles.cpp File Reference

#include "stdafx.h"
#include "PromptFiles.h"
#include "MultiFiles.h"
#include "AppConsole.h"

Include dependency graph for PromptFiles.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool | BrowserGetDirectory (const char *prompt, char *fileName, int size, CWnd *pParentWnd)
const char * | BrowserGetDirectory (const char *prompt, CWnd *pParentWnd)
bool | BrowserGetMultiFiles (const char *prompt, MultiFiles &mf, const char *lpszFilter)

Variables

char | sDefaultPath [MAX_PATH]

Function Documentation

const char* BrowserGetDirectory | ( | const char * | prompt,
 |  | CWnd * | pParentWnd
 | ) |

Definition at line 270 of file PromptFiles.cpp.

References BrowserGetDirectory, MAX_PATH, NULL, and sDefaultPath.

00271     {
00272         BOOL selected = BrowserGetDirectory(prompt, sDefaultPath, MAX_PATH, pParentWnd);
00273         return (selected) ? sDefaultPath : NULL;
00274     }

bool BrowserGetDirectory | ( | const char * | prompt,
 |  | char * | fileName,
 |  | int | size,
 |  | CWnd * | pParentWnd
 | ) |

Definition at line 247 of file PromptFiles.cpp.

00248     {
00249         CCJShell m_shell;
00250         m_shell.m_strTitle = (prompt) ? prompt : "";
00251
00252         if (fileName[0])
00253         {
00254             m_shell.m_strSelDir = fileName;
00255         }
00256
00257         if( m_shell.BrowseForFolder(pParentWnd != 0L ? pParentWnd : AfxGetMainWnd()) )
00258         {
00259             lstrcpyn(fileName, m_shell.m_strPath, size);
00260             return true;
00261         }
00262
00263         return false;
00264     }

bool BrowserGetMultiFiles | ( | const char * | prompt,
 |  | MultiFiles & | mf,
 |  | const char * | lpszFilter
 | ) |

Definition at line 277 of file PromptFiles.cpp.

References cvs_err, exit, free, malloc, MultiFiles::newdir, MultiFiles::newfile, NULL, and sDefaultPath.

00278     {
00279         bool result = false;
00280         CFileDialog fd(true, NULL, NULL,
00281             OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_ALLOWMULTISELECT |
00282             OFN_FILEMUSTEXIST,
00283             lpszFilter );
00284
00285         fd.m_ofn.nMaxFile = 38000 * sizeof(char);
00286         fd.m_ofn.lpstrFile = (char *)malloc(fd.m_ofn.nMaxFile * sizeof(char));
00287         fd.m_ofn.lpstrTitle = prompt;
00288         fd.m_ofn.lpstrInitialDir = sDefaultPath[0] != '\0' ? sDefaultPath : NULL;
00289         fd.m_ofn.nMaxFileTitle   = 38000;
00290         fd.m_ofn.lpstrFileTitle  = (char *)malloc(fd.m_ofn.nMaxFileTitle * sizeof(char));
00291         if(fd.m_ofn.lpstrFile == NULL || fd.m_ofn.lpstrFileTitle == NULL)
00292         {
00293             cvs_err("Impossible to allocate %d bytes !\n", 38000 * sizeof(char));
00294             exit(1);
00295         }
00296
00297         // add the directory and the files
00298         fd.m_ofn.lpstrFile[0] = '\0';
00299         fd.m_ofn.lpstrFileTitle[0] = '\0';
00300         if(fd.DoModal() == IDOK)
00301         {
00302             GetCurrentDirectory(sizeof(sDefaultPath), sDefaultPath);
00303             const char *tmp = fd.m_ofn.lpstrFile;
00304             if(fd.m_ofn.lpstrFileTitle[0] == '\0')
00305             {
00306                 mf.newdir(tmp);
00307                 tmp += strlen(tmp) + 1;
00308                 while(tmp[0] != '\0')
00309                 {
00310                     mf.newfile(tmp);
00311                     tmp += strlen(tmp) + 1;
00312                 }
00313             }
00314             else
00315             {
00316                 mf.newdir(sDefaultPath);
00317                 mf.newfile(tmp + fd.m_ofn.nFileOffset);
00318             }
00319             result = true;
00320         }
00321
00322         free(fd.m_ofn.lpstrFile);
00323         free(fd.m_ofn.lpstrFileTitle);
00324         return result;
00325     }

Variable Documentation

char sDefaultPath[MAX_PATH] [static]

Definition at line 267 of file PromptFiles.cpp.

Referenced by BrowserGetDirectory, and BrowserGetMultiFiles.

Generated on Sun Feb 24 01:22:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PromptFiles.h File Reference

common/PromptFiles.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

const char * | BrowserGetDirectory (const char *prompt, CWnd *pParentWnd=0L)
bool | BrowserGetDirectory (const char *prompt, char *fileName, int size, CWnd *pParentWnd=0L)
bool | BrowserGetMultiFiles (const char *prompt, MultiFiles &mf, const char *lpszFilter=NULL)

Function Documentation

bool BrowserGetDirectory | ( | const char * | prompt,
 |  | char * | fileName,
 |  | int | size,
 |  | CWnd * | pParentWnd = 0L
 | ) |

Referenced by BrowserGetDirectory, CompatGetCheckout, CompatGetCommand, CompatGetImport, CvsCmdAddFolder, CvsCmdCheckoutModule, CvsCmdCommitFolder, CvsCmdDiffFolder, CvsCmdEditFolder, CvsCmdEditorsFolder, CvsCmdImportModule, CvsCmdLockFolder, CvsCmdLogFolder, CvsCmdReleaseFolder, CvsCmdStatusFolder, CvsCmdTagBranchFolder, CvsCmdTagCreateFolder, CvsCmdTagDeleteFolder, CvsCmdUneditFolder, CvsCmdUnlockFolder, CvsCmdUpdateFolder, CvsCmdWatchersFolder, CvsCmdWatchOffFolder, CvsCmdWatchOnFolder, glue_getenv, CWincvsDoc::OnBrowserOpen, UCvsFrame::OnBrowserPopup, CGetPrefs_WINCVS::OnBtnhome, CImport_OPTIONS::OnBtnpath, CCheckout_MAIN::OnBtnPath, and CCmdLine_MAIN::OnSelfolder.

const char* BrowserGetDirectory | ( | const char * | prompt,
 |  | CWnd * | pParentWnd = 0L
 | ) |

bool BrowserGetMultiFiles | ( | const char * | prompt,
 |  | MultiFiles & | mf,
 |  | const char * | lpszFilter = NULL
 | ) |

Definition at line 277 of file PromptFiles.cpp.

Referenced by CvsCmdAddBinaryFiles, CvsCmdAddFiles, CvsCmdAddUnicodeFiles, CvsCmdAnnotateFiles, CvsCmdCancelChangesFiles, CvsCmdCommitFiles, CvsCmdDiffFiles, CvsCmdEditFiles, CvsCmdEditorsFiles, CvsCmdLockFiles, CvsCmdLogFiles, CvsCmdRemoveFiles, CvsCmdStatusFiles, CvsCmdTagBranchFiles, CvsCmdTagCreateFiles, CvsCmdTagDeleteFiles, CvsCmdUneditFiles, CvsCmdUnlockFiles, CvsCmdUpdateFiles, CvsCmdWatchersFiles, CvsCmdWatchOffFiles, CvsCmdWatchOnFiles, CGetPrefs_WINCVS::OnAltcvssel, UAuthen_SSH::OnBtnName, UAuthen_SSH::OnBtnRSA, CGetPrefs_WINCVS::OnBtnviewer, and CGetPrefs_WINCVS::OnExtdiffsel.

00278     {
00279         bool result = false;
00280         CFileDialog fd(true, NULL, NULL,
00281             OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_ALLOWMULTISELECT |
00282             OFN_FILEMUSTEXIST,
00283             lpszFilter );
00284
00285         fd.m_ofn.nMaxFile = 38000 * sizeof(char);
00286         fd.m_ofn.lpstrFile = (char *)malloc(fd.m_ofn.nMaxFile * sizeof(char));
00287         fd.m_ofn.lpstrTitle = prompt;
00288         fd.m_ofn.lpstrInitialDir = sDefaultPath[0] != '\0' ? sDefaultPath : NULL;
00289         fd.m_ofn.nMaxFileTitle   = 38000;
00290         fd.m_ofn.lpstrFileTitle  = (char *)malloc(fd.m_ofn.nMaxFileTitle * sizeof(char));
00291         if(fd.m_ofn.lpstrFile == NULL || fd.m_ofn.lpstrFileTitle == NULL)
00292         {
00293             cvs_err("Impossible to allocate %d bytes !\n", 38000 * sizeof(char));
00294             exit(1);
00295         }
00296
00297         // add the directory and the files
00298         fd.m_ofn.lpstrFile[0] = '\0';
00299         fd.m_ofn.lpstrFileTitle[0] = '\0';
00300         if(fd.DoModal() == IDOK)
00301         {
00302             GetCurrentDirectory(sizeof(sDefaultPath), sDefaultPath);
00303             const char *tmp = fd.m_ofn.lpstrFile;
00304             if(fd.m_ofn.lpstrFileTitle[0] == '\0')
00305             {
00306                 mf.newdir(tmp);
00307                 tmp += strlen(tmp) + 1;
00308                 while(tmp[0] != '\0')
00309                 {
00310                     mf.newfile(tmp);
00311                     tmp += strlen(tmp) + 1;
00312                 }
00313             }
00314             else
00315             {
00316                 mf.newdir(sDefaultPath);
00317                 mf.newfile(tmp + fd.m_ofn.nFileOffset);
00318             }
00319             result = true;
00320         }
00321
00322         free(fd.m_ofn.lpstrFile);
00323         free(fd.m_ofn.lpstrFileTitle);
00324         return result;
00325     }

Generated on Sun Feb 24 01:22:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PythonContainer.cpp File Reference

common/PythonContainer.cpp File Reference

#include "stdafx.h"
#include "PythonContainer.h"
#include <vector>

Include dependency graph for PythonContainer.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void | PyHandleCvsguiError (CException *e)
void | PyHandleCvsguiError (const char *msg)

Variables

PyObject * | gCvsguiErr = NULL

Function Documentation

void PyHandleCvsguiError ( const char * msg )

Definition at line 125 of file PythonContainer.cpp.

References gCvsguiErr, and PyErr_SetString.

00126 {
00127     PyErr_SetString(gCvsguiErr, msg);
00128 }

void PyHandleCvsguiError ( CException * e )

Definition at line 110 of file PythonContainer.cpp.

References gCvsguiErr, and PyErr_SetString.

00111 {
00112     char tmp[256];
00113     if(e->GetErrorMessage(tmp, sizeof(tmp)))
00114         PyErr_SetString(gCvsguiErr, tmp);
00115     else
00116         PyErr_SetString(gCvsguiErr, "Unknown error");
00117 }

Variable Documentation

PyObject* gCvsguiErr = NULL

Definition at line 28 of file PythonContainer.cpp.

Referenced by PyHandleCvsguiError.

Generated on Sun Feb 24 01:22:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PythonContainer.h File Reference

common/PythonContainer.h File Reference

#include <Python.h>
#include <exception>
#include <vector>
#include "PythonMacros.h"
#include "PythonGlue.impl.h"

Include dependency graph for PythonContainer.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | PyAutoObject
class | PyContainer
class | PyRegistry

Defines

#define | USE_PYTHON 1
#define | USE_DL_EXPORT

Typedefs

typedef void(* | PyRegistry_InitValues )(PyObject *d)

Variables

PyObject * | gCvsguiErr

Define Documentation

#define USE_DL_EXPORT

Definition at line 34 of file PythonContainer.h.

#define USE_PYTHON 1

Definition at line 29 of file PythonContainer.h.

Typedef Documentation

typedef void(* PyRegistry_InitValues)(PyObject *d)

Definition at line 44 of file PythonContainer.h.

Referenced by PyRegistry::PyRegistry.

Variable Documentation

PyObject* gCvsguiErr

Definition at line 186 of file PythonContainer.h.

Generated on Sun Feb 24 01:22:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PythonGlue.cpp File Reference

common/PythonGlue.cpp File Reference

#include "stdafx.h"
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include "resource.h"
#include "NoPython.h"
#include "PythonGlue.h"
#include "CvsLog.h"
#include "AppConsole.h"
#include "MacrosSetup.h"
#include "umenu.h"
#include "PythonContainer.h"
#include "PythonImpl.h"
#include "TclGlue.h"
#include "AppGlue.h"
#include "CvsArgs.h"
#include "FileTraversal.h"
#include "AskYesNo.h"
#include "dll_loader.h"
#include "CvsPrefs.h"
#include <Python.h>
#include <osdefs.h>
#include "wincvs_winutil.h"

Include dependency graph for PythonGlue.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | CBuffer
class | CFillPyEntries
class | CPyCvsConsole
class | CPyThreadState

Defines

#define | NEW new
#define | LOAD_CODEFRAG(name)

Enumerations

enum {
_stdout_style = 15,
_stderr_style = 16,
_trace_style = 17
}

Functions

PyObject * | cvsgui_write (PyObject *self, PyObject *args)
PyObject * | cvsgui_GetMainMenuWidget (PyObject *self, PyObject *args)
PyObject * | cvsgui_GetTopMacroSelectionMenu (PyObject *self, PyObject *args)
PyObject * | cvsgui_GetTopMacroAdminMenu (PyObject *self, PyObject *args)
PyObject * | cvsgui_GetSelection (PyObject *self, PyObject *args)
PyObject * | cvsgui_GetCvsEntries (PyObject *self, PyObject *args)
PyObject * | cvsgui_GetFileModTime (PyObject *self, PyObject *args)
PyObject * | cvsgui_LaunchTclMacro (PyObject *self, PyObject *args)
PyObject * | cvsgui_PromptMessage (PyObject *self, PyObject *args)
PyObject * | cvsgui_PromptEditMessage (PyObject *self, PyObject *args)
PyObject * | cvsgui_LaunchBrowser (PyObject *self, PyObject *args)
void | outputXML (FILE *out, CLogNode *node)
PyObject * | cvsgui_GetHistoryAsXML (PyObject *self, PyObject *args)
PyObject * | cvsgui_RunCvs (PyObject *self, PyObject *args)
void | InitializeInterp (PyThreadState *interp)
void | PyMacrosReloadAll (void)
void | PyDoCmdUI (UCmdUI *ucmdui)
void | PyDoPython (int cmd)
bool | PyIsUICacheValid ()
void | PyValidUICache ()
void | PyInvalUICache ()
void | PyAppendCache (EntnodeData *data)

Variables

bool | gUICacheValid = false
std::vector< ENTNODE > gUICache
PyObject * | gUICacheObj = NULL
PyMethodDef | cvsgui_methods []
std::vector< PyMethodDef > | gAllMethods

Define Documentation

#define LOAD_CODEFRAG ( name )

Value:

if(pyAvail) \
            pyAvail = (*(void **)&name##_glue = \
                _CompatCallLibrary(connID, #name)) != 0L

#define NEW new

Definition at line 79 of file PythonGlue.cpp.

Enumeration Type Documentation

anonymous enum

Enumeration values:
_stdout_style
_stderr_style
_trace_style

Definition at line 104 of file PythonGlue.cpp.

00105 {
00106     _stdout_style = 15,
00107     _stderr_style = 16,
00108     _trace_style = 17
00109 };

Function Documentation

PyObject* cvsgui_GetCvsEntries | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 352 of file PythonGlue.cpp.

References ENTNODE::Compare, PyAutoObject::CopyReturn, ENTNODE::Data, Entries_SetMissing, FileTraverse, CSortList::Get, PyAutoObject::IsValid, PyCvsEntry::New, NULL, CSortList::NumOfElements, PyArg_ParseTuple, and PyTuple_New.

00353 {
00354     char *path;
00355
00356     if(!PyArg_ParseTuple(args, "s", &path))
00357         return NULL;
00358
00359     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00360     CFillPyEntries traverse(entries);
00361     /*kTraversal res = */FileTraverse(path, traverse);
00362
00363     // add the missing files
00364     Entries_SetMissing(entries);
00365
00366     int numEntries = entries.NumOfElements();
00367     PyObject *obj = PyTuple_New(numEntries);
00368     if(obj == NULL)
00369         return NULL;
00370
00371     for(int i = 0; i < numEntries; i++)
00372     {
00373         const ENTNODE & theNode = entries.Get(i);
00374         EntnodeData *data = theNode.Data();
00375
00376         PyAutoObject<PyCvsEntry::obj_t> res = PyCvsEntry::New();
00377         if (!res.IsValid())
00378             return NULL;
00379
00380         res->m_object = new PyCvsEntry(data);
00381
00382         PyTuple_SET_ITEM(obj, i, res.CopyReturn());
00383     }
00384
00385     return obj;
00386 }

PyObject* cvsgui_GetFileModTime | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 393 of file PythonGlue.cpp.

References NULL, Py_BuildValue, PyArg_ParseTuple, PyErr_SetString, wnt_stat::st_mtime, and wnt_stat.

00394 {
00395     struct wnt_stat sb;
00396     struct tm * p_utc = NULL;
00397
00398     const char *path;
00399
00400 // PyObject_Length exists only for debugging version (ActiveState Python 2.1)
00401 #if defined(_DEBUG)
00402     int len = PyObject_Length(args);
00403     if (len < 1)
00404     {
00405         char errstr[255];
00406         sprintf(errstr, "Too few arguments (%d, expected 1)", len);
00407         PyErr_SetString(gCvsguiErr, errstr);
00408         return NULL;
00409     }
00410     else if (len > 1)
00411     {
00412         char errstr[255];
00413         sprintf(errstr, "Too many arguments (%d, expected 1)", len);
00414         PyErr_SetString(gCvsguiErr, errstr);
00415         return NULL;
00416     }
00417 #endif
00418
00419     if(!PyArg_ParseTuple(args, "s", &path))
00420         return NULL;
00421
00422     if (wnt_stat(path, &sb) != 0)
00423     {
00424         char errstr[255];
00425         sprintf(errstr, "Could not find file \"%s\"", path);
00426         PyErr_SetString(gCvsguiErr, errstr);
00427         return NULL;
00428     }
00429
00430     p_utc = gmtime(& sb.st_mtime);
00431     return Py_BuildValue("s", asctime(p_utc));
00432 }

PyObject* cvsgui_GetHistoryAsXML | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 715 of file PythonGlue.cpp.

References CvsLogParse, GetPyFile_Type, NULL, outputXML, PyArg_ParseTuple, PyFile_AsFile, PyHandleCvsguiError, and PyContainer::Void.

00716 {
00717     PyObject *logfile, *xmlfile;
00718
00719     if(!PyArg_ParseTuple(args, "O!O!", GetPyFile_Type(), &logfile,
00720         GetPyFile_Type(), &xmlfile))
00721             return NULL;
00722
00723     TRY
00724     {
00725         std::vector<CRcsFile> & allRcs = CvsLogParse(PyFile_AsFile(logfile));
00726
00727         std::vector<CRcsFile>::iterator i;
00728         FILE *xml = PyFile_AsFile(xmlfile);
00729         fputs("<ROOT>\n", xml);
00730         for(i = allRcs.begin(); i != allRcs.end(); ++i)
00731         {
00732             std::auto_ptr<CLogNode> node(CvsLogGraph(*i));
00733             outputXML(xml, node.get());
00734         }
00735         fputs("</ROOT>\n", xml);
00736
00737         CvsLogReset();
00738     }
00739     CATCH_ALL(e)
00740     {
00741         PyHandleCvsguiError(e);
00742         return NULL;
00743     }
00744     END_CATCH_ALL
00745
00746     return PyContainer::Void();
00747 }

PyObject* cvsgui_GetMainMenuWidget | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 137 of file PythonGlue.cpp.

References NULL, PyArg_ParseTuple, PyHandleCvsguiError, and PyInt_FromLong.

00138 {
00139     int res = 0;
00140
00141     if(!PyArg_ParseTuple(args, ""))
00142         return NULL;
00143
00144     TRY
00145     {
00146     }
00147     CATCH_ALL(e)
00148     {
00149         PyHandleCvsguiError(e);
00150         return NULL;
00151     }
00152     END_CATCH_ALL
00153
00154     return PyInt_FromLong(res);
00155 }

PyObject* cvsgui_GetSelection | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 250 of file PythonGlue.cpp.

References PyAutoObject::CopyReturn, gUICacheObj, PyAutoObject::IsValid, PyCvsEntry::New, NULL, PyArg_ParseTuple, and PyTuple_New.

00251 {
00252     if(!PyArg_ParseTuple(args, ""))
00253         return NULL;
00254
00255     if(gUICacheObj != 0L)
00256     {
00257         Py_INCREF(gUICacheObj);
00258         return gUICacheObj;
00259     }
00260
00261     gUICacheObj = PyTuple_New(gUICache.size());
00262     if(gUICacheObj == NULL)
00263         return NULL;
00264
00265     std::vector<ENTNODE>::const_iterator i;
00266     int cnt;
00267     for(cnt = 0, i = gUICache.begin(); i != gUICache.end(); ++i, ++cnt)
00268     {
00269         PyAutoObject<PyCvsEntry::obj_t> res = PyCvsEntry::New();
00270         if (!res.IsValid())
00271             return NULL;
00272
00273         res->m_object = new PyCvsEntry(*i);
00274
00275         PyTuple_SET_ITEM(gUICacheObj, cnt, res.CopyReturn());
00276     }
00277
00278     Py_INCREF(gUICacheObj);
00279     return gUICacheObj;
00280 }

PyObject* cvsgui_GetTopMacroAdminMenu | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 204 of file PythonGlue.cpp.

References PyAutoObject::CopyReturn, GetMenuEntry, ID_MACRO_ADMIN, PyAutoObject::IsValid, PyMenuMgr::New, NULL, PyArg_ParseTuple, PyHandleCvsguiError, and UMENU.

00205 {
00206     static UMENU macroMenu = 0L;
00207
00208     if(!PyArg_ParseTuple(args, ""))
00209         return NULL;
00210
00211     PyAutoObject<PyMenuMgr::obj_t> res = PyMenuMgr::New();
00212     if (!res.IsValid())
00213         return NULL;
00214
00215     TRY
00216     {
00217 #ifdef WIN32
00218         int pos;
00219         if(macroMenu == 0L)
00220         {
00221             CMenu *top = GetMenuEntry(ID_MACRO_ADMIN, pos);
00222             if(top)
00223             {
00224                 top->DeleteMenu(pos, MF_BYPOSITION);
00225                 macroMenu = (UMENU)(HMENU)*top;
00226             }
00227         }
00228 #endif
00229 #if qMacCvsPP
00230         if(macroMenu == 0L)
00231         {
00232             LMenuBar *menuBar   = LMenuBar::GetCurrentMenuBar();
00233             LMenu *menu = menuBar->FetchMenu(menu_MacroAdmin);
00234             if(menu)
00235                 macroMenu = menu->GetMenuID();
00236         }
00237 #endif
00238         res->m_object = new PyMenuMgr(macroMenu);
00239     }
00240     CATCH_ALL(e)
00241     {
00242         PyHandleCvsguiError(e);
00243         return NULL;
00244     }
00245     END_CATCH_ALL
00246
00247     return res.CopyReturn();
00248 }

PyObject* cvsgui_GetTopMacroSelectionMenu | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 157 of file PythonGlue.cpp.

References PyAutoObject::CopyReturn, GetMenuEntry, ID_MACRO_SEL, PyAutoObject::IsValid, PyMenuMgr::New, NULL, PyArg_ParseTuple, PyHandleCvsguiError, and UMENU.

00158 {
00159     static UMENU macroMenu = 0L;
00160
00161     if(!PyArg_ParseTuple(args, ""))
00162         return NULL;
00163
00164     PyAutoObject<PyMenuMgr::obj_t> res = PyMenuMgr::New();
00165     if (!res.IsValid())
00166         return NULL;
00167
00168     TRY
00169     {
00170 #ifdef WIN32
00171         int pos;
00172         if(macroMenu == 0L)
00173         {
00174             CMenu *top = GetMenuEntry(ID_MACRO_SEL, pos);
00175             if(top)
00176             {
00177                 top->DeleteMenu(pos, MF_BYPOSITION);
00178                 macroMenu = (UMENU)(HMENU)*top;
00179             }
00180         }
00181 #endif
00182 #if qMacCvsPP
00183         if(macroMenu == 0L)
00184         {
00185             LMenuBar *menuBar   = LMenuBar::GetCurrentMenuBar();
00186             LMenu *menu = menuBar->FetchMenu(menu_MacroSel);
00187             if(menu)
00188                 macroMenu = menu->GetMenuID();
00189         }
00190 #endif
00191
00192         res->m_object = new PyMenuMgr(macroMenu);
00193     }
00194     CATCH_ALL(e)
00195     {
00196         PyHandleCvsguiError(e);
00197         return NULL;
00198     }
00199     END_CATCH_ALL
00200
00201     return res.CopyReturn();
00202 }

PyObject* cvsgui_LaunchBrowser | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 584 of file PythonGlue.cpp.

References NULL, PyArg_ParseTuple, and PyContainer::Void.

00585 {
00586     char *url;
00587
00588     if(!PyArg_ParseTuple(args, "s", &url))
00589         return NULL;
00590
00591 #ifdef WIN32
00592     ShellExecute(NULL, "open", url, /*postData*/0L, NULL, SW_SHOWNORMAL);
00593 #endif
00594
00595     return PyContainer::Void();
00596 }

PyObject* cvsgui_LaunchTclMacro | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 435 of file PythonGlue.cpp.

References CStr, CTcl_Interp::DoScriptVar, CTcl_Interp::IsAvail, EntnodeData::kPath, NULL, PyArg_ParseTuple, TclBrowserAppend, TclBrowserReset, CTcl_Interp::Unixfy, and PyContainer::Void.

00436 {
00437     char *macroName;
00438
00439     if(!PyArg_ParseTuple(args, "s", &macroName) || !CTcl_Interp::IsAvail())
00440         return NULL;
00441
00442     std::vector<ENTNODE>::const_iterator i;
00443     TclBrowserReset();
00444     for(i = gUICache.begin(); i != gUICache.end(); ++i)
00445     {
00446         EntnodeData *data = *i;
00447         TclBrowserAppend((*data)[EntnodeData::kPath], data);
00448     }
00449
00450     CTcl_Interp interp;
00451     CStr path = macroName;
00452     CTcl_Interp::Unixfy(path);
00453     interp.DoScriptVar("source \"%s\"", (const char *)path);
00454
00455     return PyContainer::Void();
00456 }

PyObject* cvsgui_PromptEditMessage | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 559 of file PythonGlue.cpp.

References UStr::c_str, UStr::empty, NULL, PromptEditMessage, Py_BuildValue, PyArg_ParseTuple, and PyHandleCvsguiError.

00560 {
00561     char *msg, *title, *ok, *cncl, *edit;
00562
00563     if(!PyArg_ParseTuple(args, "sssss", &msg, &edit, &title, &ok, &cncl))
00564         return NULL;
00565
00566     bool res;
00567     UStr ed;
00568
00569     TRY
00570     {
00571         ed = edit;
00572         res = PromptEditMessage(msg, ed, title, ok, cncl);
00573     }
00574     CATCH_ALL(e)
00575     {
00576         PyHandleCvsguiError(e);
00577         return NULL;
00578     }
00579     END_CATCH_ALL
00580
00581     return Py_BuildValue("(is)", res ? 1 : 0, ed.empty() ? "" : ed.c_str());
00582 }

PyObject* cvsgui_PromptMessage | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 531 of file PythonGlue.cpp.

References PyContainer::False, NULL, PromptMessage, PyArg_ParseTuple, PyHandleCvsguiError, and PyContainer::True.

00532 {
00533     char *msg, *title, *ok, *cncl;
00534
00535     if(!PyArg_ParseTuple(args, "ssss", &msg, &title, &ok, &cncl))
00536         return NULL;
00537
00538     bool res;
00539
00540     TRY
00541     {
00542         res = PromptMessage(msg, title, ok, cncl);
00543     }
00544     CATCH_ALL(e)
00545     {
00546         PyHandleCvsguiError(e);
00547         return NULL;
00548     }
00549     END_CATCH_ALL
00550
00551     if(res)
00552     {
00553         return PyContainer::True();
00554     }
00555
00556     return PyContainer::False();
00557 }

PyObject* cvsgui_RunCvs | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 749 of file PythonGlue.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, GetPyTuple_Type, launchCVS, CPyCvsConsole::m_err, CPyCvsConsole::m_out, NULL, Py_BuildValue, PyArg_ParseTuple, PyErr_SetString, PyHandleCvsguiError, PyString_AsString, PyString_Check, PyTuple_Size, UStr::set, and CBuffer::size.

00750 {
00751     CvsArgs arg;
00752     PyObject *cargs;
00753     int exitOnError = 1;
00754     int exitc;
00755     CPyCvsConsole console;
00756
00757     if(!PyArg_ParseTuple(args, "O!|i", GetPyTuple_Type(), &cargs, &exitOnError))
00758         return NULL;
00759
00760     TRY
00761     {
00762         int argc = PyTuple_Size(cargs);
00763         for(int i = 0; i < argc; i++)
00764         {
00765             PyObject *o = PyTuple_GET_ITEM(cargs, i);
00766             if(!PyString_Check(o))
00767             {
00768                 PyErr_SetString(gCvsguiErr, "Wrong argument type, should be string");
00769                 return NULL;
00770             }
00771
00772             arg.add(PyString_AsString(o));
00773         }
00774
00775         exitc = launchCVS(0L, arg.Argc(), arg.Argv(), &console);
00776
00777         if(exitOnError && exitc != 0)
00778         {
00779             UStr str;
00780             str.set(console.m_err, console.m_err.size());
00781             str << "cvs returned an non-zero error code (";
00782             str << exitc;
00783             str << ")\n";
00784             PyErr_SetString(gCvsguiErr, str);
00785             return NULL;
00786         }
00787     }
00788     CATCH_ALL(e)
00789     {
00790         PyHandleCvsguiError(e);
00791         return NULL;
00792     }
00793     END_CATCH_ALL
00794
00795     return Py_BuildValue("(is#s#)", exitc, (char *)console.m_out, console.m_out.size(),
00796         (char *)console.m_err, console.m_err.size());
00797 }

PyObject* cvsgui_write | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 111 of file PythonGlue.cpp.

References _stdout_style, cvs_errstr, cvs_outstr, NULL, PyArg_ParseTuple, PyHandleCvsguiError, and PyContainer::Void.

00112 {
00113     char *str;
00114     int style;
00115     PyObject *shell;
00116
00117     if(!PyArg_ParseTuple(args, "siO", &str, &style, &shell))
00118         return NULL;
00119
00120     TRY
00121     {
00122         if(style == _stdout_style)
00123             cvs_outstr(str, strlen(str));
00124         else
00125             cvs_errstr(str, strlen(str));
00126     }
00127     CATCH_ALL(e)
00128     {
00129         PyHandleCvsguiError(e);
00130         return NULL;
00131     }
00132     END_CATCH_ALL
00133
00134     return PyContainer::Void();
00135 }

void InitializeInterp ( PyThreadState * interp ) [static]

Definition at line 821 of file PythonGlue.cpp.

References PyRegistry::CallInitValues, CStr, cvs_err, cvsgui_methods, free, malloc, NULL, Py_GetPath, Py_InitModule4, PyDict_SetItemString, PyErr_NewException, PyModule_GetDict, PyRun_SimpleString, PyString_FromString, PySys_SetPath, PythonLibGetLoc, PyThreadState, and PyRegistry::RegisterAllObjects.

Referenced by CPython_Interp::CPython_Interp, and CPython_Interp::InitPythonSupport.

00822 {
00823     CPyThreadState lock(interp);
00824
00825     // first time, create the method table for cvsgui module
00826     if(gAllMethods.empty())
00827     {
00828         PyMethodDef *tmp = cvsgui_methods;
00829         while(tmp->ml_name)
00830         {
00831             gAllMethods.push_back(*tmp);
00832             tmp++;
00833         }
00834
00835         PyRegistry::RegisterAllObjects(gAllMethods);
00836     }
00837
00838     // this module contains the glue code functions
00839     PyObject *m = Py_InitModule4("_cvsgui", &gAllMethods[0],
00840         "The cvsgui glue functions", (PyObject*)NULL,PYTHON_API_VERSION);
00841
00842     if(m == NULL)
00843     {
00844         cvs_err("Could not create the Python cvsgui module !\n");
00845         return;
00846     }
00847
00848     // this is the exception we raised when the error comes from us
00849     PyObject *d = PyModule_GetDict(m);
00850     if(gCvsguiErr == NULL)
00851         gCvsguiErr = PyErr_NewException("_cvsgui.error", NULL, NULL);
00852     if (gCvsguiErr != NULL)
00853         PyDict_SetItemString(d, "error", gCvsguiErr);
00854
00855     PyRegistry::CallInitValues(d);
00856
00857     // Ideally we need to use Jonathan's mechanism
00858     PyObject *ver = PyString_FromString("1.3");
00859     if (ver != NULL) {
00860         PyDict_SetItemString(d, "CVSGUI_VERSION", ver);
00861         Py_DECREF(ver);
00862     }
00863
00864     char *script = NULL;
00865
00866 #ifdef WIN32
00867     HINSTANCE hInst = ::AfxGetInstanceHandle();
00868     HRSRC rsrc = FindResource(hInst, "PYSHELL", "PYSCRIPT");
00869
00870     if(rsrc)
00871     {
00872         HGLOBAL h = LoadResource(hInst, rsrc);
00873         if(h)
00874         {
00875             DWORD size = SizeofResource(hInst, rsrc);
00876             script = (char *)malloc(size + 1);
00877             char *ptr = (char *)LockResource(h);
00878
00879             if(script)
00880             {
00881                 char *tmp = script;
00882                 while(size--)
00883                 {
00884                     char c = *ptr++;
00885                     if(c == '\r')
00886                         continue;
00887                     *tmp++ = c;
00888                 }
00889                 *tmp = '\0';
00890             }
00891
00892             FreeResource(h);
00893         }
00894     }
00895
00896 #endif // WIN32
00897 #if qMacCvsPP
00898     StResource rsrcH(FOUR_CHAR_CODE('PYTH'), 128);
00899     size_t size = GetHandleSize(rsrcH);
00900     script = (char *)malloc(size + 1);
00901     if(script)
00902     {
00903         char *ptr = (char *)*rsrcH;
00904         char *tmp = script;
00905         while(size--)
00906         {
00907             char c = *ptr++;
00908             if(c == '\r')
00909                 c = '\n';
00910             *tmp++ = c;
00911         }
00912         *tmp = '\0';
00913     }
00914 #endif
00915
00916     // augment the library path of python with our library
00917     CStr ourLibPath;
00918     PythonLibGetLoc(ourLibPath);
00919
00920     UStr libPath = Py_GetPath();
00921     if(!ourLibPath.empty())
00922     {
00923         libPath << DELIM;
00924         libPath << ourLibPath;
00925         PySys_SetPath((char *)(const char *)libPath);
00926     }
00927
00928     // this is the script to setup stdout/stderr and reroute it
00929     // to the console window
00930     if(script)
00931     {
00932         PyRun_SimpleString(script);
00933
00934         free(script);
00935     }
00936     else
00937     {
00938         cvs_err("Could not initialize properly the Python interpreter !\n");
00939     }
00940 }

void outputXML | ( | FILE * | out,
 |  | CLogNode * | node
 | ) | [static]

Definition at line 598 of file PythonGlue.cpp.

Referenced by cvsgui_GetHistoryAsXML.

00599 {
00600     switch(node->GetType())
00601     {
00602         case kNodeHeader :
00603         {
00604             fputs("<RCS>\n", out);
00605             const CRcsFile rcs = **(CLogNodeHeader *)node;
00606             fprintf(out, "<RCSFILE>%s</RCSFILE>\n", rcs.RcsFile().c_str());
00607             fprintf(out, "<WORKINGFILE>%s</WORKINGFILE>\n", rcs.WorkingFile().c_str());
00608             fprintf(out, "<HEADREV>%s</HEADREV>\n", rcs.HeadRev().c_str());
00609             fprintf(out, "<BRANCHREV>%s</BRANCHREV>\n", rcs.BranchRev().c_str());
00610             fprintf(out, "<KEYWORDSUBST>%s</KEYWORDSUBST>\n", rcs.KeywordSubst().c_str());
00611             fprintf(out, "<DESCRIPTION>%s</DESCRIPTION>\n", rcs.DescLog().c_str());
00612             fprintf(out, "<SELREVISIONS>%d</SELREVISIONS>\n", rcs.SelRevisions());
00613             fprintf(out, "<TOTREVISIONS>%d</TOTREVISIONS>\n", rcs.TotRevisions());
00614             fprintf(out, "<LOCKSTRICT>%d</LOCKSTRICT>\n", rcs.LockStrict() ? 1 : 0);
00615
00616             fputs("<ACCESSLIST>\n", out);
00617             const std::vector<CLogStr> & ac = rcs.AccessList();
00618             std::vector<CLogStr>::const_iterator i;
00619             for(i = ac.begin(); i != ac.end(); ++i)
00620             {
00621                 fprintf(out, "<ACCESS>%s</ACCESS>\n", (*i).c_str());
00622             }
00623             fputs("</ACCESSLIST>\n", out);
00624
00625             fputs("<SYMBOLICLIST>\n", out);
00626             const std::vector<CRevNumber> & sy = rcs.SymbolicList();
00627             std::vector<CRevNumber>::const_iterator j;
00628             for(j = sy.begin(); j != sy.end(); ++j)
00629             {
00630                 fprintf(out, "<SYMBOLIC>%s</SYMBOLIC>\n", (*j).c_str());
00631             }
00632             fputs("</SYMBOLICLIST>\n", out);
00633
00634             fputs("<LOCKLIST>\n", out);
00635             const std::vector<CRevNumber> & lo = rcs.LocksList();
00636             for(j = lo.begin(); j != lo.end(); ++j)
00637             {
00638                 fprintf(out, "<LOCK>%s</LOCK>\n", (*j).c_str());
00639             }
00640             fputs("</LOCKLIST>\n", out);
00641             break;
00642         }
00643         case kNodeRev :
00644         {
00645             const CRevFile & rev = **(CLogNodeRev *)node;
00646             fputs("<REVISION>\n", out);
00647             fprintf(out, "<NUMBER>%s</NUMBER>\n", rev.RevNum().c_str());
00648             const struct tm & tm = rev.RevTime();
00649             fprintf(out, "<DATE>%d/%d/%d %d:%d:%d</DATE>\n", (tm.tm_year + 1900),
00650                 tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
00651             fprintf(out, "<AUTHOR>%s</AUTHOR>\n", rev.Author().c_str());
00652             fprintf(out, "<STATE>%s</STATE>\n", rev.State().c_str());
00653             fprintf(out, "<CHANGES>+%d%d</CHANGES>\n", rev.ChgPos(), rev.ChgNeg());
00654             fprintf(out, "<DESCRIPTION>%s</DESCRIPTION>\n", rev.DescLog().c_str());
00655
00656             fputs("<BRANCHLIST>\n", out);
00657             const std::vector<CRevNumber> & sy = rev.BranchesList();
00658             std::vector<CRevNumber>::const_iterator j;
00659             for(j = sy.begin(); j != sy.end(); ++j)
00660             {
00661                 fprintf(out, "<REVBRANCH>%s</REVBRANCH>\n", (*j).c_str());
00662             }
00663             fputs("</BRANCHLIST>\n", out);
00664             break;
00665         }
00666         case kNodeBranch :
00667         {
00668             fputs("<BRANCH>\n", out);
00669             const CLogStr & branch = **(CLogNodeBranch *)node;
00670             fprintf(out, "<BRANCHNAME>%s</BRANCHNAME>\n", branch.c_str());
00671             break;
00672         }
00673         case kNodeTag :
00674         {
00675             fputs("<TAG>\n", out);
00676             const CLogStr & tag = **(CLogNodeTag *)node;
00677             fprintf(out, "<TAGNAME>%s</TAGNAME>\n", tag.c_str());
00678             break;
00679         }
00680     }
00681
00682     if(node->Childs().size() > 0)
00683     {
00684         fputs("<REVISIONS>\n", out);
00685         std::vector<CLogNode *>::const_iterator i;
00686         for(i = node->Childs().begin(); i != node->Childs().end(); ++i)
00687         {
00688             outputXML(out, *i);
00689         }
00690         fputs("</REVISIONS>\n", out);
00691     }
00692
00693     switch(node->GetType())
00694     {
00695         case kNodeHeader :
00696             fputs("</RCS>\n", out);
00697             break;
00698         case kNodeRev :
00699             fputs("</REVISION>\n", out);
00700             break;
00701         case kNodeBranch :
00702             fputs("</BRANCH>\n", out);
00703             break;
00704         case kNodeTag :
00705             fputs("</TAG>\n", out);
00706             break;
00707     }
00708
00709     if(node->Next() != 0L)
00710     {
00711         outputXML(out, node->Next());
00712     }
00713 }

void PyAppendCache ( EntnodeData * data )

Definition at line 1253 of file PythonGlue.cpp.

References gUICacheObj, and gUICacheValid.

01254 {
01255 #if USE_PYTHON
01256     Py_XDECREF(gUICacheObj);
01257     gUICacheObj = 0L;
01258     gUICache.push_back(ENTNODE(data));
01259     gUICacheValid = true;
01260 #endif
01261 }

void PyDoCmdUI ( UCmdUI * ucmdui )

Definition at line 1212 of file PythonGlue.cpp.

References CPython_Interp::DoScriptVar, and UCmdUI::m_nID.

01213 {
01214     CPython_Interp interp;
01215     interp.DoScriptVar("from cvsgui.MacroRegistry import *; "
01216         "from cvsgui.CmdUI import *; "
01217         "gMacroRegistry.DoCmdUI(CmdUI(%d), %d)", (long)ucmdui, ucmdui->m_nID);
01218 }

void PyDoPython ( int cmd )

Definition at line 1220 of file PythonGlue.cpp.

References CPython_Interp::DoScriptVar.

01221 {
01222     CPython_Interp interp;
01223     interp.DoScriptVar("from cvsgui.MacroRegistry import *; "
01224         "gMacroRegistry.DoCmd(%d)", cmd);
01225 }

void PyInvalUICache ( )

Definition at line 1243 of file PythonGlue.cpp.

References gUICacheObj, and gUICacheValid.

Referenced by CPython_Interp::ClosePythonSupport, CWincvsApp::PreTranslateMessage, and CWincvsView::~CWincvsView.

01244 {
01245 #if USE_PYTHON
01246     gUICache.erase(gUICache.begin(), gUICache.end());
01247     gUICacheValid = false;
01248     Py_XDECREF(gUICacheObj);
01249     gUICacheObj = 0L;
01250 #endif
01251 }

bool PyIsUICacheValid ( )

Definition at line 1227 of file PythonGlue.cpp.

References gUICacheValid.

Referenced by CWinCvsBrowser::OnUpdateMacro, and CBrowseFileView::OnUpdateMacro.

01228 {
01229 #if USE_PYTHON
01230     return gUICacheValid;
01231 #else
01232     return false;
01233 #endif
01234 }

void PyMacrosReloadAll ( void )

Definition at line 1195 of file PythonGlue.cpp.

References UStr::c_str, CPython_Interp::DoScriptVar, and MacrosGetLoc.

Referenced by CWincvsApp::InitInstance.

01196 {
01197     // get the macro folder
01198     UStr path;
01199     MacrosGetLoc(path);
01200
01201 #ifdef WIN32
01202     CString newpath(path);
01203     newpath.Replace("\\", "\\\\");
01204     path = newpath;
01205 #endif
01206
01207     CPython_Interp interp;
01208     interp.DoScriptVar("from cvsgui.MacroRegistry import *; "
01209         "gMacroRegistry.LoadMacros(\"%s\")", (char *)path.c_str());;
01210 }

void PyValidUICache ( )

Definition at line 1236 of file PythonGlue.cpp.

References gUICacheValid.

01237 {
01238 #if USE_PYTHON
01239     gUICacheValid = true;
01240 #endif
01241 }

Variable Documentation

PyMethodDef cvsgui_methods[] [static]

Initial value:

{
    {"write", (PyCFunction)cvsgui_write, METH_VARARGS, ""},
    {"GetMainMenuWidget", (PyCFunction)cvsgui_GetMainMenuWidget, METH_VARARGS, ""},
    {"GetTopMacroSelectionMenu", (PyCFunction)cvsgui_GetTopMacroSelectionMenu, METH_VARARGS, ""},
    {"GetTopMacroAdminMenu", (PyCFunction)cvsgui_GetTopMacroAdminMenu, METH_VARARGS, ""},
    {"GetSelection", (PyCFunction)cvsgui_GetSelection, METH_VARARGS, ""},
    {"GetCvsEntries", (PyCFunction)cvsgui_GetCvsEntries, METH_VARARGS, ""},

    {"GetFileModTime", (PyCFunction)cvsgui_GetFileModTime, METH_VARARGS, ""},

    {"LaunchTclMacro", (PyCFunction)cvsgui_LaunchTclMacro, METH_VARARGS, ""},
    {"RunCvs", (PyCFunction)cvsgui_RunCvs, METH_VARARGS, ""},
    {"PromptMessage", (PyCFunction)cvsgui_PromptMessage, METH_VARARGS, ""},
    {"PromptEditMessage", (PyCFunction)cvsgui_PromptEditMessage, METH_VARARGS, ""},
    {"LaunchBrowser", (PyCFunction)cvsgui_LaunchBrowser, METH_VARARGS, ""},
    {"GetHistoryAsXML", (PyCFunction)cvsgui_GetHistoryAsXML, METH_VARARGS, ""},
    {NULL, NULL}
}

Definition at line 799 of file PythonGlue.cpp.

Referenced by InitializeInterp.

std::vector<PyMethodDef> gAllMethods [static]

Definition at line 819 of file PythonGlue.cpp.

std::vector<ENTNODE> gUICache [static]

Definition at line 86 of file PythonGlue.cpp.

PyObject* gUICacheObj = NULL [static]

Definition at line 87 of file PythonGlue.cpp.

Referenced by cvsgui_GetSelection, PyAppendCache, and PyInvalUICache.

bool gUICacheValid = false [static]

Definition at line 85 of file PythonGlue.cpp.

Referenced by PyAppendCache, PyInvalUICache, PyIsUICacheValid, and PyValidUICache.

Generated on Sun Feb 24 01:22:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PythonGlue.h File Reference

common/PythonGlue.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CPython_Interp

Typedefs

typedef _ts | PyThreadState

Functions

void | PyMacrosReloadAll (void)
void | PyDoCmdUI (UCmdUI *ucmdui)
void | PyDoPython (int cmd)
bool | PyIsUICacheValid ()
void | PyValidUICache ()
void | PyInvalUICache ()
void | PyAppendCache (EntnodeData *data)

Typedef Documentation

typedef struct _ts PyThreadState

Definition at line 30 of file PythonGlue.h.

Referenced by CPyThreadState::CPyThreadState, and InitializeInterp.

Function Documentation

void PyAppendCache ( EntnodeData * data )

Definition at line 1253 of file PythonGlue.cpp.

Referenced by CWinCvsBrowser::OnUpdateMacro, and CBrowseFileView::OnUpdateMacro.

01254 {
01255 #if USE_PYTHON
01256     Py_XDECREF(gUICacheObj);
01257     gUICacheObj = 0L;
01258     gUICache.push_back(ENTNODE(data));
01259     gUICacheValid = true;
01260 #endif
01261 }

void PyDoCmdUI ( UCmdUI * ucmdui )

Definition at line 1212 of file PythonGlue.cpp.

Referenced by CWinCvsBrowser::OnUpdateMacro, and CBrowseFileView::OnUpdateMacro.

01213 {
01214     CPython_Interp interp;
01215     interp.DoScriptVar("from cvsgui.MacroRegistry import *; "
01216         "from cvsgui.CmdUI import *; "
01217         "gMacroRegistry.DoCmdUI(CmdUI(%d), %d)", (long)ucmdui, ucmdui->m_nID);
01218 }

void PyDoPython ( int cmd )

Definition at line 1220 of file PythonGlue.cpp.

Referenced by CWinCvsBrowser::OnMacro, and CBrowseFileView::OnMacro.

01221 {
01222     CPython_Interp interp;
01223     interp.DoScriptVar("from cvsgui.MacroRegistry import *; "
01224         "gMacroRegistry.DoCmd(%d)", cmd);
01225 }

void PyInvalUICache ( )

Definition at line 1243 of file PythonGlue.cpp.

01244 {
01245 #if USE_PYTHON
01246     gUICache.erase(gUICache.begin(), gUICache.end());
01247     gUICacheValid = false;
01248     Py_XDECREF(gUICacheObj);
01249     gUICacheObj = 0L;
01250 #endif
01251 }

bool PyIsUICacheValid ( )

Definition at line 1227 of file PythonGlue.cpp.

01228 {
01229 #if USE_PYTHON
01230     return gUICacheValid;
01231 #else
01232     return false;
01233 #endif
01234 }

void PyMacrosReloadAll ( void )

Definition at line 1195 of file PythonGlue.cpp.

01196 {
01197     // get the macro folder
01198     UStr path;
01199     MacrosGetLoc(path);
01200
01201 #ifdef WIN32
01202     CString newpath(path);
01203     newpath.Replace("\\", "\\\\");
01204     path = newpath;
01205 #endif
01206
01207     CPython_Interp interp;
01208     interp.DoScriptVar("from cvsgui.MacroRegistry import *; "
01209         "gMacroRegistry.LoadMacros(\"%s\")", (char *)path.c_str());;
01210 }

void PyValidUICache ( )

Definition at line 1236 of file PythonGlue.cpp.

01237 {
01238 #if USE_PYTHON
01239     gUICacheValid = true;
01240 #endif
01241 }

Generated on Sun Feb 24 01:22:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PythonGlue.impl.h File Reference

common/PythonGlue.impl.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | PYTHONGLUE_EXTERN extern
#define | DEC_GLUE(f) (*f##_glue)
#define | VAR_GLUE(f) f##_glue
#define | GLUE_WRAP(f) f##_glue
#define | PyThreadState_Swap GLUE_WRAP(PyThreadState_Swap)
#define | PyDict_SetItemString GLUE_WRAP(PyDict_SetItemString)
#define | PyErr_Clear GLUE_WRAP(PyErr_Clear)
#define | PyInt_FromLong GLUE_WRAP(PyInt_FromLong)
#define | PyErr_SetString GLUE_WRAP(PyErr_SetString)
#define | PyArg_ParseTuple GLUE_WRAP(PyArg_ParseTuple)
#define | PyTuple_New GLUE_WRAP(PyTuple_New)
#define | Py_BuildValue GLUE_WRAP(Py_BuildValue)
#define | PyFile_AsFile GLUE_WRAP(PyFile_AsFile)
#define | PyString_AsString GLUE_WRAP(PyString_AsString)
#define | PyTuple_Size GLUE_WRAP(PyTuple_Size)
#define | PyRun_SimpleString GLUE_WRAP(PyRun_SimpleString)
#define | PyRun_SimpleFile GLUE_WRAP(PyRun_SimpleFile)
#define | Py_SetProgramName GLUE_WRAP(Py_SetProgramName)
#define | Py_Initialize GLUE_WRAP(Py_Initialize)
#define | Py_Finalize GLUE_WRAP(Py_Finalize)
#define | Py_IsInitialized GLUE_WRAP(Py_IsInitialized)
#define | Py_NewInterpreter GLUE_WRAP(Py_NewInterpreter)
#define | Py_EndInterpreter GLUE_WRAP(Py_EndInterpreter)
#define | PyString_FromString GLUE_WRAP(PyString_FromString)
#define | PyErr_NewException GLUE_WRAP(PyErr_NewException)
#define | PyModule_GetDict GLUE_WRAP(PyModule_GetDict)
#define | Py_InitModule4 GLUE_WRAP(Py_InitModule4)
#define | PyEval_InitThreads GLUE_WRAP(PyEval_InitThreads)
#define | Py_FindMethod GLUE_WRAP(Py_FindMethod)
#define | _PyObject_New GLUE_WRAP(_PyObject_New)
#define | _PyObject_Del GLUE_WRAP(_PyObject_Del)
#define | PySys_SetPath GLUE_WRAP(PySys_SetPath)
#define | Py_GetPath GLUE_WRAP(Py_GetPath)
#define | PyString_Check(op) ((op)->ob_type == GetPyString_Type())
#define | PyTuple_Check(op) ((op)->ob_type == GetPyTuple_Type())
#define | PyInt_Check(op) ((op)->ob_type == GetPyInt_Type())

Functions

PyTypeObject * | GetPyType_Type ()
PyTypeObject * | GetPyFile_Type ()
PyTypeObject * | GetPyString_Type ()
PyTypeObject * | GetPyTuple_Type ()
PyTypeObject * | GetPyInt_Type ()
PyObject * | GetPyNone ()
PyObject * | GetPyTrue ()
PyObject * | GetPyFalse ()

Variables

PyThreadState *(* PyThreadState_Swap_glue )(PyThreadState *)
int(* | PyDict_SetItemString_glue )(PyObject *dp, char *key, PyObject *item)
void(* | PyErr_Clear_glue )(void)
PyObject *(* | PyInt_FromLong_glue )(long)
void(* | PyErr_SetString_glue )(PyObject *, const char *)
int(* | PyArg_ParseTuple_glue )(PyObject *, char *,...)
PyObject *(* | PyTuple_New_glue )(int size)
PyObject *(* | Py_BuildValue_glue )(char *,...)
FILE *(* | PyFile_AsFile_glue )(PyObject *)
char *(* | PyString_AsString_glue )(PyObject *)
int(* | PyTuple_Size_glue )(PyObject *)
int(* | PyRun_SimpleString_glue )(char *)
int(* | PyRun_SimpleFile_glue )(FILE *, char *)
void(* | Py_SetProgramName_glue )(char *)
void(* | Py_Initialize_glue )(void)
void(* | Py_Finalize_glue )(void)
int(* | Py_IsInitialized_glue )(void)
PyThreadState *(* | Py_NewInterpreter_glue )(void)
void(* | Py_EndInterpreter_glue )(PyThreadState *)
PyObject *(* | PyString_FromString_glue )(const char *)
PyObject *(* | PyErr_NewException_glue )(char *name, PyObject *base, PyObject *dict)
PyObject *(* | PyModule_GetDict_glue )(PyObject *)
PyObject *(* | Py_InitModule4_glue )(char *name, PyMethodDef *methods, char *doc, PyObject *self, int apiver)
void(* | PyEval_InitThreads_glue )(void)
PyObject *(* | Py_FindMethod_glue )(PyMethodDef[], PyObject *, char *)
PyObject *(* | _PyObject_New_glue )(PyTypeObject *)
void(* | _PyObject_Del_glue )(PyObject *)
void(* | PySys_SetPath_glue )(char *)
char *(* | Py_GetPath_glue )(void)
PyTypeObject * | PyType_Type_glue
PyTypeObject * | PyFile_Type_glue
PyTypeObject * | PyString_Type_glue
PyTypeObject * | PyTuple_Type_glue
PyTypeObject * | PyInt_Type_glue
PyObject * | _Py_NoneStruct_glue
PyObject * | _Py_ZeroStruct_glue
PyObject * | _Py_TrueStruct_glue

Define Documentation

#define _PyObject_Del GLUE_WRAP(_PyObject_Del)

Definition at line 103 of file PythonGlue.impl.h.

Referenced by CPython_Interp::IsAvail.

#define _PyObject_New GLUE_WRAP(_PyObject_New)

Definition at line 102 of file PythonGlue.impl.h.

Referenced by CPython_Interp::IsAvail.

#define DEC_GLUE ( f ) (*f##_glue)

Definition at line 33 of file PythonGlue.impl.h.

#define GLUE_WRAP ( f ) f##_glue

Definition at line 75 of file PythonGlue.impl.h.

#define Py_BuildValue GLUE_WRAP(Py_BuildValue)

Definition at line 84 of file PythonGlue.impl.h.

Referenced by cvsgui_GetFileModTime, cvsgui_PromptEditMessage, cvsgui_RunCvs, and CPython_Interp::IsAvail.

#define Py_EndInterpreter GLUE_WRAP(Py_EndInterpreter)

Definition at line 95 of file PythonGlue.impl.h.

Referenced by CPython_Interp::IsAvail, and CPython_Interp::~CPython_Interp.

#define Py_Finalize GLUE_WRAP(Py_Finalize)

Definition at line 92 of file PythonGlue.impl.h.

Referenced by CPython_Interp::ClosePythonSupport, and CPython_Interp::IsAvail.

#define Py_FindMethod GLUE_WRAP(Py_FindMethod)

Definition at line 101 of file PythonGlue.impl.h.

Referenced by CPython_Interp::IsAvail.

#define Py_GetPath GLUE_WRAP(Py_GetPath)

Definition at line 105 of file PythonGlue.impl.h.

Referenced by InitializeInterp, and CPython_Interp::IsAvail.

#define Py_Initialize GLUE_WRAP(Py_Initialize)

Definition at line 91 of file PythonGlue.impl.h.

Referenced by CPython_Interp::InitPythonSupport, and CPython_Interp::IsAvail.

#define Py_InitModule4 GLUE_WRAP(Py_InitModule4)

Definition at line 99 of file PythonGlue.impl.h.

Referenced by InitializeInterp, and CPython_Interp::IsAvail.

#define Py_IsInitialized GLUE_WRAP(Py_IsInitialized)

Definition at line 93 of file PythonGlue.impl.h.

Referenced by CPython_Interp::IsAvail.

#define Py_NewInterpreter GLUE_WRAP(Py_NewInterpreter)

Definition at line 94 of file PythonGlue.impl.h.

Referenced by CPython_Interp::CPython_Interp, and CPython_Interp::IsAvail.

#define Py_SetProgramName GLUE_WRAP(Py_SetProgramName)

Definition at line 90 of file PythonGlue.impl.h.

Referenced by CPython_Interp::InitPythonSupport, and CPython_Interp::IsAvail.

#define PyArg_ParseTuple GLUE_WRAP(PyArg_ParseTuple)

Definition at line 82 of file PythonGlue.impl.h.

Referenced by PyMenuMgr::AddButton, PyMenuMgr::AddPulldown, PyMenuMgr::AddSeparator, PyMenuMgr::AddToggle, PyMenuMgr::Count, PyPersistent::Create, PyCmdUI::Create, PyMenuMgr::Create, PyColorConsole::Create, PyCvsEntry::Create, cvsgui_GetCvsEntries, cvsgui_GetFileModTime, cvsgui_GetHistoryAsXML, cvsgui_GetMainMenuWidget, cvsgui_GetSelection, cvsgui_GetTopMacroAdminMenu, cvsgui_GetTopMacroSelectionMenu, cvsgui_LaunchBrowser, cvsgui_LaunchTclMacro, cvsgui_PromptEditMessage, cvsgui_PromptMessage, cvsgui_RunCvs, cvsgui_write, PyMenuMgr::Delete, PyMenuMgr::DeleteByCmd, PyCmdUI::Enable, PyPersistent::GetValue, CPython_Interp::IsAvail, PyColorConsole::Print, PyCmdUI::SetCheck, PyCmdUI::SetText, and PyPersistent::SetValue.

#define PyDict_SetItemString GLUE_WRAP(PyDict_SetItemString)

Definition at line 78 of file PythonGlue.impl.h.

Referenced by InitializeInterp, CPython_Interp::IsAvail, and PyContainer::RegisterValue.

#define PyErr_Clear GLUE_WRAP(PyErr_Clear)

Definition at line 79 of file PythonGlue.impl.h.

Referenced by CPython_Interp::IsAvail, PyColorConsole::Print, and PyContainer::RegisterValue.

#define PyErr_NewException GLUE_WRAP(PyErr_NewException)

Definition at line 97 of file PythonGlue.impl.h.

Referenced by InitializeInterp, and CPython_Interp::IsAvail.

#define PyErr_SetString GLUE_WRAP(PyErr_SetString)

Definition at line 81 of file PythonGlue.impl.h.

Referenced by cvsgui_GetFileModTime, cvsgui_RunCvs, CPython_Interp::IsAvail, and PyHandleCvsguiError.

#define PyEval_InitThreads GLUE_WRAP(PyEval_InitThreads)

Definition at line 100 of file PythonGlue.impl.h.

Referenced by CPython_Interp::InitPythonSupport, and CPython_Interp::IsAvail.

#define PyFile_AsFile GLUE_WRAP(PyFile_AsFile)

Definition at line 85 of file PythonGlue.impl.h.

Referenced by cvsgui_GetHistoryAsXML, and CPython_Interp::IsAvail.

#define PyInt_Check ( op ) ((op)->ob_type == GetPyInt_Type())

Definition at line 121 of file PythonGlue.impl.h.

#define PyInt_FromLong GLUE_WRAP(PyInt_FromLong)

Definition at line 80 of file PythonGlue.impl.h.

Referenced by PyMenuMgr::Count, cvsgui_GetMainMenuWidget, CPython_Interp::IsAvail, and PyContainer::RegisterValue.

#define PyModule_GetDict GLUE_WRAP(PyModule_GetDict)

Definition at line 98 of file PythonGlue.impl.h.

Referenced by InitializeInterp, and CPython_Interp::IsAvail.

#define PyRun_SimpleFile GLUE_WRAP(PyRun_SimpleFile)

Definition at line 89 of file PythonGlue.impl.h.

Referenced by CPython_Interp::DoFile, and CPython_Interp::IsAvail.

#define PyRun_SimpleString GLUE_WRAP(PyRun_SimpleString)

Definition at line 88 of file PythonGlue.impl.h.

Referenced by CPython_Interp::DoScript, InitializeInterp, and CPython_Interp::IsAvail.

#define PyString_AsString GLUE_WRAP(PyString_AsString)

Definition at line 86 of file PythonGlue.impl.h.

Referenced by cvsgui_RunCvs, and CPython_Interp::IsAvail.

#define PyString_Check ( op ) ((op)->ob_type == GetPyString_Type())

Definition at line 117 of file PythonGlue.impl.h.

Referenced by cvsgui_RunCvs.

#define PyString_FromString GLUE_WRAP(PyString_FromString)

Definition at line 96 of file PythonGlue.impl.h.

Referenced by PyCvsEntry::GetAttr, PyPersistent::GetValue, InitializeInterp, and CPython_Interp::IsAvail.

#define PySys_SetPath GLUE_WRAP(PySys_SetPath)

Definition at line 104 of file PythonGlue.impl.h.

Referenced by InitializeInterp, and CPython_Interp::IsAvail.

#define PYTHONGLUE_EXTERN extern

Definition at line 29 of file PythonGlue.impl.h.

#define PyThreadState_Swap GLUE_WRAP(PyThreadState_Swap)

Definition at line 77 of file PythonGlue.impl.h.

Referenced by CPython_Interp::ClosePythonSupport, CPyThreadState::CPyThreadState, CPython_Interp::InitPythonSupport, CPython_Interp::IsAvail, and CPyThreadState::~CPyThreadState.

#define PyTuple_Check ( op ) ((op)->ob_type == GetPyTuple_Type())

Definition at line 119 of file PythonGlue.impl.h.

#define PyTuple_New GLUE_WRAP(PyTuple_New)

Definition at line 83 of file PythonGlue.impl.h.

Referenced by cvsgui_GetCvsEntries, cvsgui_GetSelection, and CPython_Interp::IsAvail.

#define PyTuple_Size GLUE_WRAP(PyTuple_Size)

Definition at line 87 of file PythonGlue.impl.h.

Referenced by cvsgui_RunCvs, and CPython_Interp::IsAvail.

#define VAR_GLUE ( f ) f##_glue

Definition at line 34 of file PythonGlue.impl.h.

Function Documentation

PyObject* GetPyFalse ( )

Definition at line 502 of file PythonImpl.cpp.

Referenced by PyContainer::False.

00503 {
00504     return _Py_ZeroStruct_glue;
00505 }

PyTypeObject* GetPyFile_Type ( )

Definition at line 472 of file PythonImpl.cpp.

Referenced by cvsgui_GetHistoryAsXML.

00473 {
00474     return PyFile_Type_glue;
00475 }

PyTypeObject* GetPyInt_Type ( )

Definition at line 487 of file PythonImpl.cpp.

00488 {
00489     return PyInt_Type_glue;
00490 }

PyObject* GetPyNone ( )

Definition at line 492 of file PythonImpl.cpp.

Referenced by PyContainer::Void.

00493 {
00494     return _Py_NoneStruct_glue;
00495 }

PyTypeObject* GetPyString_Type ( )

Definition at line 477 of file PythonImpl.cpp.

00478 {
00479     return PyString_Type_glue;
00480 }

PyObject* GetPyTrue ( )

Definition at line 497 of file PythonImpl.cpp.

Referenced by PyContainer::True.

00498 {
00499     return _Py_TrueStruct_glue;
00500 }

PyTypeObject* GetPyTuple_Type ( )

Definition at line 482 of file PythonImpl.cpp.

Referenced by cvsgui_RunCvs.

00483 {
00484     return PyTuple_Type_glue;
00485 }

PyTypeObject* GetPyType_Type ( )

Definition at line 467 of file PythonImpl.cpp.

Referenced by PyRegistry::PyRegistry.

00468 {
00469     return PyType_Type_glue;
00470 }

Variable Documentation

PyObject* _Py_NoneStruct_glue

Definition at line 71 of file PythonGlue.impl.h.

Referenced by GetPyNone.

PyObject* _Py_TrueStruct_glue

Definition at line 73 of file PythonGlue.impl.h.

Referenced by GetPyTrue.

PyObject* _Py_ZeroStruct_glue

Definition at line 72 of file PythonGlue.impl.h.

Referenced by GetPyFalse.

void(* _PyObject_Del_glue)(PyObject *)

Definition at line 62 of file PythonGlue.impl.h.

PyObject*(* _PyObject_New_glue)(PyTypeObject *)

Definition at line 61 of file PythonGlue.impl.h.

PyObject*(* Py_BuildValue_glue)(char *, ...)

Definition at line 43 of file PythonGlue.impl.h.

void(* Py_EndInterpreter_glue)(PyThreadState *)

Definition at line 54 of file PythonGlue.impl.h.

void(* Py_Finalize_glue)(void)

Definition at line 51 of file PythonGlue.impl.h.

PyObject*(* Py_FindMethod_glue)(PyMethodDef[], PyObject *, char *)

Definition at line 60 of file PythonGlue.impl.h.

char*(* Py_GetPath_glue)(void)

Definition at line 64 of file PythonGlue.impl.h.

void(* Py_Initialize_glue)(void)

Definition at line 50 of file PythonGlue.impl.h.

PyObject*(* Py_InitModule4_glue)(char *name, PyMethodDef *methods, char *doc, PyObject *self, int apiver)

Definition at line 58 of file PythonGlue.impl.h.

int(* Py_IsInitialized_glue)(void)

Definition at line 52 of file PythonGlue.impl.h.

PyThreadState*(* Py_NewInterpreter_glue)(void)

Definition at line 53 of file PythonGlue.impl.h.

void(* Py_SetProgramName_glue)(char *)

Definition at line 49 of file PythonGlue.impl.h.

int(* PyArg_ParseTuple_glue)(PyObject *, char *, ...)

Definition at line 41 of file PythonGlue.impl.h.

int(* PyDict_SetItemString_glue)(PyObject *dp, char *key, PyObject *item)

Definition at line 37 of file PythonGlue.impl.h.

void(* PyErr_Clear_glue)(void)

Definition at line 38 of file PythonGlue.impl.h.

PyObject*(* PyErr_NewException_glue)(char *name, PyObject *base, PyObject *dict)

Definition at line 56 of file PythonGlue.impl.h.

void(* PyErr_SetString_glue)(PyObject *, const char *)

Definition at line 40 of file PythonGlue.impl.h.

void(* PyEval_InitThreads_glue)(void)

Definition at line 59 of file PythonGlue.impl.h.

FILE*(* PyFile_AsFile_glue)(PyObject *)

Definition at line 44 of file PythonGlue.impl.h.

PyTypeObject* PyFile_Type_glue

Definition at line 67 of file PythonGlue.impl.h.

Referenced by GetPyFile_Type.

PyObject*(* PyInt_FromLong_glue)(long)

Definition at line 39 of file PythonGlue.impl.h.

PyTypeObject* PyInt_Type_glue

Definition at line 70 of file PythonGlue.impl.h.

Referenced by GetPyInt_Type.

PyObject*(* PyModule_GetDict_glue)(PyObject *)

Definition at line 57 of file PythonGlue.impl.h.

int(* PyRun_SimpleFile_glue)(FILE *, char *)

Definition at line 48 of file PythonGlue.impl.h.

int(* PyRun_SimpleString_glue)(char *)

Definition at line 47 of file PythonGlue.impl.h.

char*(* PyString_AsString_glue)(PyObject *)

Definition at line 45 of file PythonGlue.impl.h.

PyObject*(* PyString_FromString_glue)(const char *)

Definition at line 55 of file PythonGlue.impl.h.

PyTypeObject* PyString_Type_glue

Definition at line 68 of file PythonGlue.impl.h.

Referenced by GetPyString_Type.

void(* PySys_SetPath_glue)(char *)

Definition at line 63 of file PythonGlue.impl.h.

PyThreadState*(* PyThreadState_Swap_glue)(PyThreadState *)

Definition at line 36 of file PythonGlue.impl.h.

PyObject*(* PyTuple_New_glue)(int size)

Definition at line 42 of file PythonGlue.impl.h.

int(* PyTuple_Size_glue)(PyObject *)

Definition at line 46 of file PythonGlue.impl.h.

PyTypeObject* PyTuple_Type_glue

Definition at line 69 of file PythonGlue.impl.h.

Referenced by GetPyTuple_Type.

PyTypeObject* PyType_Type_glue

Definition at line 66 of file PythonGlue.impl.h.

Referenced by GetPyType_Type.

Generated on Sun Feb 24 01:22:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PythonImpl.cpp File Reference

common/PythonImpl.cpp File Reference

#include "stdafx.h"
#include "PythonImpl.h"
#include "CvsPrefs.h"
#include "umenu.h"
#include "PythonGlue.impl.h"

Include dependency graph for PythonImpl.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | PYTHONGLUE_EXTERN

Functions

int | ParseUMENU (PyObject *v, UMENU *menu)
PyTypeObject * | GetPyType_Type ()
PyTypeObject * | GetPyFile_Type ()
PyTypeObject * | GetPyString_Type ()
PyTypeObject * | GetPyTuple_Type ()
PyTypeObject * | GetPyInt_Type ()
PyObject * | GetPyNone ()
PyObject * | GetPyTrue ()
PyObject * | GetPyFalse ()

Define Documentation

#define PYTHONGLUE_EXTERN

Definition at line 464 of file PythonImpl.cpp.

Function Documentation

PyObject* GetPyFalse ( )

Definition at line 502 of file PythonImpl.cpp.

References _Py_ZeroStruct_glue.

00503 {
00504     return _Py_ZeroStruct_glue;
00505 }

PyTypeObject* GetPyFile_Type ( )

Definition at line 472 of file PythonImpl.cpp.

References PyFile_Type_glue.

00473 {
00474     return PyFile_Type_glue;
00475 }

PyTypeObject* GetPyInt_Type ( )

Definition at line 487 of file PythonImpl.cpp.

References PyInt_Type_glue.

00488 {
00489     return PyInt_Type_glue;
00490 }

PyObject* GetPyNone ( )

Definition at line 492 of file PythonImpl.cpp.

References _Py_NoneStruct_glue.

00493 {
00494     return _Py_NoneStruct_glue;
00495 }

PyTypeObject* GetPyString_Type ( )

Definition at line 477 of file PythonImpl.cpp.

References PyString_Type_glue.

00478 {
00479     return PyString_Type_glue;
00480 }

PyObject* GetPyTrue ( )

Definition at line 497 of file PythonImpl.cpp.

References _Py_TrueStruct_glue.

00498 {
00499     return _Py_TrueStruct_glue;
00500 }

PyTypeObject* GetPyTuple_Type ( )

Definition at line 482 of file PythonImpl.cpp.

References PyTuple_Type_glue.

00483 {
00484     return PyTuple_Type_glue;
00485 }

PyTypeObject* GetPyType_Type ( )

Definition at line 467 of file PythonImpl.cpp.

References PyType_Type_glue.

00468 {
00469     return PyType_Type_glue;
00470 }

int ParseUMENU | ( | PyObject * | v,
 |  | UMENU * | menu
 | ) | [static]

Definition at line 196 of file PythonImpl.cpp.

References PyMenuMgr::GetType, and UMENU.

00197 {
00198     if(v->ob_type == PyMenuMgr::GetType())
00199     {
00200         *menu = *((PyMenuMgr::obj_t *)v)->m_object;
00201         return 1;
00202     }
00203
00204     return 0;
00205 }

Generated on Sun Feb 24 01:22:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PythonImpl.h File Reference

common/PythonImpl.h File Reference

#include "PythonContainer.h"
#include "CvsEntries.h"
#include "AppConsole.h"
#include "CPStr.h"
#include "umain.h"

Include dependency graph for PythonImpl.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

struct | PyPersistent::obj_t
struct | PyCmdUI::obj_t
class | PyCmdUI
struct | PyMenuMgr::obj_t
struct | PyColorConsole::obj_t
class | PyColorConsole
struct | PyCvsEntry::obj_t
class | PyCvsEntry
class | PyMenuMgr
class | PyPersistent

Generated on Sun Feb 24 01:22:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PythonMacros.h File Reference

common/PythonMacros.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | _COMMON_PY_DECL_CLASS(c)
#define | PY_DECL_CLASS_INHERITED(c, a)
#define | PY_DECL_CLASS(c)
#define | PY_IMPL_CLASS(c, adoc)
#define | PY_DECL_METHOD(c, m)
#define | PY_BEGIN_IMPL_METHOD(c)
#define | PY_IMPL_METHOD(c, m, adoc) {#m, (binaryfunc)Py##c::_##m, METH_VARARGS, (char *)adoc},
#define | PY_END_IMPL_METHOD

Functions

void | PyHandleCvsguiError (CException *e)
void | PyHandleCvsguiError (const char *msg)

Define Documentation

#define _COMMON_PY_DECL_CLASS ( c )

Value:

public: \
    typedef struct \
    { \
        PyObject_HEAD \
        Py##c *m_object; \
    } obj_t; \
    static const char *m_doc; \
    static void dealloc(obj_t *self); \
    static PyObject *getattr(obj_t *self, char *name); \
    static PyAutoObject<obj_t> New(void); \
    static PyMethodDef m_methods[]; \
    static PyRegistry m_registry; \
    static inline PyTypeObject *GetType(void) { return &m_registry.m_type; } \
    static PyObject *Create(PyObject *selfptr, PyObject *args); \
    static void InitValues(PyObject *d);

Definition at line 41 of file PythonMacros.h.

#define PY_BEGIN_IMPL_METHOD ( c )

Value:

PyMethodDef Py##c::m_methods[] = \
    {

Definition at line 136 of file PythonMacros.h.

#define PY_DECL_CLASS ( c )

Value:

_COMMON_PY_DECL_CLASS(c) \
    static PyObject *FindMethod(PyObject *self, char *name) \
    { \
        return Py_FindMethod(m_methods, self, name); \
    }

Definition at line 69 of file PythonMacros.h.

#define PY_DECL_CLASS_INHERITED | ( | c,
 |  | a | )

Value:

_COMMON_PY_DECL_CLASS(c) \
    static PyObject *FindMethod(PyObject *self, char *name) \
    { \
        PyObject *res = Py_FindMethod(m_methods, self, name); \
        if(res != NULL) \
            return res; \
        PyErr_Clear(); \
        return Py##a::FindMethod(self, name); \
    }

Definition at line 58 of file PythonMacros.h.

#define PY_DECL_METHOD | ( | c,
 |  | m | )

Value:

protected: \
    static PyObject *_##m(obj_t *self, PyObject *args) \
    { \
        TRY \
        { \
            if(self->m_object) \
                return self->m_object->##m(args); \
        } \
        CATCH_ALL(e) \
        { \
            PyHandleCvsguiError(e); \
            return NULL; \
        } \
        END_CATCH_ALL \
        return NULL; \
    } \
public: \
    PyObject *m(PyObject *args);

Definition at line 116 of file PythonMacros.h.

#define PY_END_IMPL_METHOD

Value:

{NULL, NULL} \
    };

Definition at line 143 of file PythonMacros.h.

#define PY_IMPL_CLASS | ( | c,
 |  | adoc | )

Definition at line 77 of file PythonMacros.h.

#define PY_IMPL_METHOD | ( | c,
 |  | m,
 |  | adoc | ) | {#m, (binaryfunc)Py##c::_##m, METH_VARARGS, (char *)adoc},

Definition at line 140 of file PythonMacros.h.

Function Documentation

void PyHandleCvsguiError ( const char * msg )

Definition at line 125 of file PythonContainer.cpp.

Referenced by PyPersistent::Create, PyCmdUI::Create, PyMenuMgr::Create, PyColorConsole::Create, PyCvsEntry::Create, cvsgui_GetHistoryAsXML, cvsgui_GetMainMenuWidget, cvsgui_GetTopMacroAdminMenu, cvsgui_GetTopMacroSelectionMenu, cvsgui_PromptEditMessage, cvsgui_PromptMessage, cvsgui_RunCvs, and cvsgui_write.

00126 {
00127     PyErr_SetString(gCvsguiErr, msg);
00128 }

void PyHandleCvsguiError ( CException * e )

Generated on Sun Feb 24 01:22:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ReleaseDlg.cpp File Reference

common/ReleaseDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "ReleaseDlg.h"

Include dependency graph for ReleaseDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool CompatGetRelease (const char *dir, bool &removeDirectory)

Function Documentation

bool CompatGetRelease | ( | const char * | dir,
 |  | bool & | removeDirectory
 | ) |

Definition at line 76 of file ReleaseDlg.cpp.

References CReleaseDlg::m_bRemoveDirectory, CReleaseDlg::m_strDirectory, and TRUE.

00077 {
00078     bool userHitOK = false;
00079
00080 #ifdef WIN32
00081     CReleaseDlg oReleaseDlg;
00082     oReleaseDlg.m_strDirectory = dir;
00083
00084     if(oReleaseDlg.DoModal() == IDOK)
00085     {
00086         removeDirectory = oReleaseDlg.m_bRemoveDirectory == TRUE;
00087         userHitOK = true;
00088     }
00089 #endif /* WIN32 */
00090
00091 #ifdef qMacCvsPP
00092     userHitOK = true;
00093 #endif /* qMacCvsPP */
00094
00095 #if qUnix
00096     userHitOK = true;
00097 #endif // qUnix
00098
00099     return userHitOK;
00100 }

Generated on Sun Feb 24 01:22:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ReleaseDlg.h File Reference

common/ReleaseDlg.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CReleaseDlg

Defines

#define | AFX_RELEASEDLG_H__12B5FA97_703E_4616_B361_F2917D45E54A__INCLUDED_

Functions

bool | CompatGetRelease (const char *dir, bool &removeDirectory)

Define Documentation

#define AFX_RELEASEDLG_H__12B5FA97_703E_4616_B361_F2917D45E54A__INCLUDED_

Definition at line 26 of file ReleaseDlg.h.

Function Documentation

bool CompatGetRelease | ( | const char * | dir,
 |  | bool & | removeDirectory
 | ) |

Definition at line 76 of file ReleaseDlg.cpp.

Referenced by CvsCmdReleaseFolder.

00077 {
00078     bool userHitOK = false;
00079
00080 #ifdef WIN32
00081     CReleaseDlg oReleaseDlg;
00082     oReleaseDlg.m_strDirectory = dir;
00083
00084     if(oReleaseDlg.DoModal() == IDOK)
00085     {
00086         removeDirectory = oReleaseDlg.m_bRemoveDirectory == TRUE;
00087         userHitOK = true;
00088     }
00089 #endif /* WIN32 */
00090
00091 #ifdef qMacCvsPP
00092     userHitOK = true;
00093 #endif /* qMacCvsPP */
00094
00095 #if qUnix
00096     userHitOK = true;
00097 #endif // qUnix
00098
00099     return userHitOK;
00100 }

Generated on Sun Feb 24 01:22:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


RtagDlg.cpp File Reference

common/RtagDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "GetPrefs.h"
#include "RtagDlg.h"
#include "CvsPrefs.h"
#include "UpdateDlg.h"

Include dependency graph for RtagDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool | CompatRtagCreate (bool &noRecurs, bool &overwriteExisting, UPStr &tagName, UPStr &modName, UPStr &date, UPStr &rev, bool &useMostRecent, bool &lookAttic)
bool | CompatRtagDelete (bool &noRecurs, bool &lookAttic, UPStr &tagName, UPStr &modName)
bool | CompatRtagBranch (bool &noRecurs, UPStr &branchName, UPStr &modName, UPStr &date, UPStr &rev, bool &useMostRecent, bool &lookAttic)

Function Documentation

bool CompatRtagBranch | ( | bool & | noRecurs,
 |  | UPStr & | branchName,
 |  | UPStr & | modName,
 |  | UPStr & | date,
 |  | UPStr & | rev,
 |  | bool & | useMostRecent,
 |  | bool & | lookAttic
 | ) |

Definition at line 1191 of file RtagDlg.cpp.

References CPStr, EV_INIT_WIDGET, kRtagFork, kUMainWidget, CRtag_OPTIONS::m_date, CRtag_OPTIONS::m_hasDate, CRtag_OPTIONS::m_hasRev, CRtag_MAIN::m_lookAttic, CRtag_MAIN::m_moduleName, CRtag_MAIN::m_noRecurs, CRtag_OPTIONS::m_rev, CRtag_MAIN::m_tagName, CRtag_OPTIONS::m_useMostRecent, CGetPrefs_GLOBALS::StoreValues, TRUE, UCreate_BranchModDlg, and UEventSendMessage.

01194 {
01195     bool userHitOK = false;
01196
01197     static CPStr sLastModule;
01198     static CPStr sLastBranch;
01199     static CPStr sLastDate;
01200     static CPStr sLastRev;
01201
01202     bool hasDate = false;
01203     bool hasRev = false;
01204
01205     date = "";
01206     rev = "";
01207     branchName = "";
01208     modName = "";
01209     noRecurs = false;
01210     useMostRecent = false;
01211     lookAttic = false;
01212
01213 #ifdef WIN32
01214     CPropertySheet pages("Create branch settings");
01215     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01216
01217     CRtag_MAIN page1(kRtagFork, sLastModule, sLastBranch, noRecurs, lookAttic);
01218     CRtag_OPTIONS page2(kRtagFork, hasDate, hasRev, sLastDate, sLastRev, useMostRecent);
01219     CGetPrefs_GLOBALS page3;
01220     pages.AddPage(&page1);
01221     pages.AddPage(&page2);
01222     pages.AddPage(&page3);
01223     if(pages.DoModal() == IDOK)
01224     {
01225         sLastModule = page1.m_moduleName;
01226         sLastBranch = page1.m_tagName;
01227         noRecurs = page1.m_noRecurs == TRUE;
01228         lookAttic = page1.m_lookAttic == TRUE;
01229         sLastDate = page2.m_date;
01230         sLastRev = page2.m_rev;
01231         hasDate = page2.m_hasDate == TRUE;
01232         hasRev = page2.m_hasRev == TRUE;
01233         useMostRecent = page2.m_useMostRecent == TRUE;
01234
01235         page3.StoreValues();
01236         userHitOK = true;
01237     }
01238 #endif /* WIN32 */
01239 #if qUnix
01240     void *wid = UCreate_BranchModDlg();
01241
01242     UCvsRtagBranch *dlg = new UCvsRtagBranch();
01243     UCvsRtagBranch_MAIN *tab1 =
01244         new UCvsRtagBranch_MAIN(sLastModule, sLastBranch, hasDate, hasRev,
01245                                   sLastDate, sLastRev, noRecurs, useMostRecent,
01246                                   lookAttic);
01247     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01248     dlg->AddPage(tab1, UCvsRtagBranch::kTabGeneral, 0);
01249
01250     if(dlg->DoModal())
01251     {
01252         lookAttic = tab1->m_attic;
01253         sLastDate = tab1->m_date;
01254         sLastRev = tab1->m_rev;
01255         hasDate = tab1->m_hasdate;
01256         hasRev = tab1->m_hasrev;
01257         noRecurs = tab1->m_norecurs;
01258         useMostRecent = tab1->m_match;
01259         sLastModule = tab1->m_modname;
01260         sLastBranch = tab1->m_tagname;
01261
01262         userHitOK = true;
01263     }
01264
01265     delete dlg;
01266 #endif // qUnix
01267 #ifdef qMacCvsPP
01268     StDialogHandler theHandler(dlg_RtagBranch, LCommander::GetTopCommander());
01269     LWindow *theDialog = theHandler.GetDialog();
01270     ThrowIfNil_(theDialog);
01271     static UInt16 sRuntimePanel = 1;
01272
01273     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01274         (theDialog->FindPaneByID(item_MultiViewPrefs));
01275     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01276
01277     multiView->SwitchToPanel(3);
01278     DoDataExchange_Globals(theDialog, true);
01279     multiView->SwitchToPanel(2);
01280     DoDataExchange_RtagBranchOptions(theDialog, noRecurs, true);
01281     multiView->SwitchToPanel(1);
01282     DoDataExchange_RtagBranchMain(theDialog, sLastModule, sLastBranch,
01283         hasDate, hasRev, sLastDate, sLastRev,
01284         useMostRecent, lookAttic, true);
01285
01286     groupView->SetValue(sRuntimePanel);
01287     theDialog->Show();
01288     MessageT hitMessage;
01289     while (true)
01290     {       // Let DialogHandler process events
01291         hitMessage = theHandler.DoDialog();
01292
01293         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01294             break;
01295     }
01296     theDialog->Hide();
01297     sRuntimePanel = groupView->GetValue();
01298
01299     if(hitMessage == msg_OK)
01300     {
01301         multiView->SwitchToPanel(1);
01302         DoDataExchange_RtagBranchMain(theDialog, sLastModule, sLastBranch,
01303             hasDate, hasRev, sLastDate, sLastRev,
01304             useMostRecent, lookAttic, false);
01305         multiView->SwitchToPanel(2);
01306         DoDataExchange_RtagBranchOptions(theDialog, noRecurs, false);
01307         multiView->SwitchToPanel(3);
01308         DoDataExchange_Globals(theDialog, false);
01309         userHitOK = true;
01310     }
01311 #endif /* qMacCvsPP */
01312
01313     if(userHitOK)
01314     {
01315         if(hasDate && !sLastDate.empty())
01316             date = sLastDate;
01317         if(hasRev && !sLastRev.empty())
01318             rev = sLastRev;
01319
01320         branchName = sLastBranch;
01321         modName = sLastModule;
01322
01323         gCvsPrefs.save();
01324     }
01325
01326     return userHitOK;
01327 }

bool CompatRtagCreate | ( | bool & | noRecurs,
 |  | bool & | overwriteExisting,
 |  | UPStr & | tagName,
 |  | UPStr & | modName,
 |  | UPStr & | date,
 |  | UPStr & | rev,
 |  | bool & | useMostRecent,
 |  | bool & | lookAttic
 | ) |

Definition at line 946 of file RtagDlg.cpp.

References CPStr, EV_INIT_WIDGET, kRtagAdd, kUMainWidget, CRtag_OPTIONS::m_date, CRtag_OPTIONS::m_hasDate, CRtag_OPTIONS::m_hasRev, CRtag_MAIN::m_lookAttic, CRtag_MAIN::m_moduleName, CRtag_MAIN::m_noRecurs, CRtag_MAIN::m_overwriteExisting, CRtag_OPTIONS::m_rev, CRtag_MAIN::m_tagName, CRtag_OPTIONS::m_useMostRecent, CGetPrefs_GLOBALS::StoreValues, TRUE, UCreate_TagModDlg, and UEventSendMessage.

00949 {
00950     bool userHitOK = false;
00951
00952     static CPStr sLastModule;
00953     static CPStr sLastTag;
00954     static CPStr sLastDate;
00955     static CPStr sLastRev;
00956
00957     bool hasDate = false;
00958     bool hasRev = false;
00959
00960     date = "";
00961     rev = "";
00962     tagName = "";
00963     modName = "";
00964     noRecurs = false;
00965     overwriteExisting = false;
00966     useMostRecent = false;
00967     lookAttic = false;
00968
00969 #ifdef WIN32
00970     CPropertySheet pages("Create tag settings");
00971     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00972     CRtag_MAIN page1(kRtagAdd, sLastModule, sLastTag, noRecurs, lookAttic, overwriteExisting);
00973     CRtag_OPTIONS page2(kRtagAdd, hasDate, hasRev, sLastDate, sLastRev, useMostRecent);
00974     CGetPrefs_GLOBALS page3;
00975     pages.AddPage(&page1);
00976     pages.AddPage(&page2);
00977     pages.AddPage(&page3);
00978     if(pages.DoModal() == IDOK)
00979     {
00980         sLastModule = page1.m_moduleName;
00981         sLastTag = page1.m_tagName;
00982         noRecurs = page1.m_noRecurs == TRUE;
00983         overwriteExisting = page1.m_overwriteExisting == TRUE;
00984         lookAttic = page1.m_lookAttic == TRUE;
00985
00986         sLastDate = page2.m_date;
00987         sLastRev = page2.m_rev;
00988         hasDate = page2.m_hasDate == TRUE;
00989         hasRev = page2.m_hasRev == TRUE;
00990         useMostRecent = page2.m_useMostRecent == TRUE;
00991
00992         page3.StoreValues();
00993         userHitOK = true;
00994     }
00995 #endif /* WIN32 */
00996 #if qUnix
00997     void *wid = UCreate_TagModDlg();
00998
00999     UCvsRtagCreate *dlg = new UCvsRtagCreate();
01000     UCvsRtagCreate_MAIN *tab1 =
01001         new UCvsRtagCreate_MAIN(sLastModule, sLastTag, hasDate, hasRev,
01002                                 sLastDate, sLastRev, noRecurs, overwriteExisting,
01003                                 useMostRecent, lookAttic);
01004     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01005     dlg->AddPage(tab1, UCvsRtagCreate::kTabGeneral, 0);
01006
01007     if(dlg->DoModal())
01008     {
01009         lookAttic = tab1->m_attic;
01010         sLastDate = tab1->m_date;
01011         sLastRev = tab1->m_rev;
01012         hasDate = tab1->m_hasdate;
01013         hasRev = tab1->m_hasrev;
01014         noRecurs = tab1->m_norecurs;
01015         useMostRecent = tab1->m_match;
01016         sLastModule = tab1->m_modname;
01017         sLastTag = tab1->m_tagname;
01018         overwriteExisting = tab1->m_overwrite;
01019
01020         userHitOK = true;
01021     }
01022
01023     delete dlg;
01024 #endif // qUnix
01025 #ifdef qMacCvsPP
01026     StDialogHandler theHandler(dlg_RtagCreate, LCommander::GetTopCommander());
01027     LWindow *theDialog = theHandler.GetDialog();
01028     ThrowIfNil_(theDialog);
01029     static UInt16 sRuntimePanel = 1;
01030
01031     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01032         (theDialog->FindPaneByID(item_MultiViewPrefs));
01033     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01034
01035     multiView->SwitchToPanel(3);
01036     DoDataExchange_Globals(theDialog, true);
01037     multiView->SwitchToPanel(2);
01038     DoDataExchange_RtagCreateOptions(theDialog, noRecurs, overwriteExisting, true);
01039     multiView->SwitchToPanel(1);
01040     DoDataExchange_RtagCreateMain(theDialog, sLastModule, sLastTag,
01041         hasDate, hasRev, sLastDate, sLastRev,
01042         useMostRecent, lookAttic, true);
01043
01044     groupView->SetValue(sRuntimePanel);
01045     theDialog->Show();
01046     MessageT hitMessage;
01047     while (true)
01048     {       // Let DialogHandler process events
01049         hitMessage = theHandler.DoDialog();
01050
01051         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01052             break;
01053     }
01054     theDialog->Hide();
01055     sRuntimePanel = groupView->GetValue();
01056
01057     if(hitMessage == msg_OK)
01058     {
01059         multiView->SwitchToPanel(1);
01060         DoDataExchange_RtagCreateMain(theDialog, sLastModule, sLastTag,
01061             hasDate, hasRev, sLastDate, sLastRev,
01062             useMostRecent, lookAttic, false);
01063         multiView->SwitchToPanel(2);
01064         DoDataExchange_RtagCreateOptions(theDialog, noRecurs, overwriteExisting, false);
01065         multiView->SwitchToPanel(3);
01066         DoDataExchange_Globals(theDialog, false);
01067         userHitOK = true;
01068     }
01069 #endif /* qMacCvsPP */
01070
01071     if(userHitOK)
01072     {
01073         if(hasDate && !sLastDate.empty())
01074             date = sLastDate;
01075         if(hasRev && !sLastRev.empty())
01076             rev = sLastRev;
01077
01078         tagName = sLastTag;
01079         modName = sLastModule;
01080
01081         gCvsPrefs.save();
01082     }
01083
01084     return userHitOK;
01085 }

bool CompatRtagDelete | ( | bool & | noRecurs,
 |  | bool & | lookAttic,
 |  | UPStr & | tagName,
 |  | UPStr & | modName
 | ) |

Definition at line 1087 of file RtagDlg.cpp.

References CPStr, EV_INIT_WIDGET, kRtagDelete, kUMainWidget, CRtag_MAIN::m_lookAttic, CRtag_MAIN::m_moduleName, CRtag_MAIN::m_noRecurs, CRtag_MAIN::m_tagName, CGetPrefs_GLOBALS::StoreValues, TRUE, UCreate_UntagModDlg, and UEventSendMessage.

01089 {
01090
01091     bool userHitOK = false;
01092
01093     static CPStr sLastModule;
01094     static CPStr sLastTag;
01095
01096     tagName = "";
01097     modName = "";
01098     noRecurs = false;
01099     lookAttic = false;
01100
01101 #ifdef WIN32
01102     CPropertySheet pages("Delete tag settings");
01103     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01104     CRtag_MAIN page1(kRtagDelete, sLastModule, sLastTag, noRecurs, lookAttic);
01105     CGetPrefs_GLOBALS page2;
01106     pages.AddPage(&page1);
01107     pages.AddPage(&page2);
01108     if(pages.DoModal() == IDOK)
01109     {
01110         lookAttic = page1.m_lookAttic == TRUE;
01111         noRecurs = page1.m_noRecurs == TRUE;
01112         sLastModule = page1.m_moduleName;
01113         sLastTag = page1.m_tagName;
01114
01115         page2.StoreValues();
01116         userHitOK = true;
01117     }
01118 #endif /* WIN32 */
01119 #if qUnix
01120     void *wid = UCreate_UntagModDlg();
01121
01122     UCvsRtagDel *dlg = new UCvsRtagDel();
01123     UCvsRtagDel_MAIN *tab1 = new UCvsRtagDel_MAIN(sLastModule, sLastTag,
01124                                                   noRecurs, lookAttic);
01125     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01126     dlg->AddPage(tab1, UCvsRtagDel::kTabGeneral, 0);
01127
01128     if(dlg->DoModal())
01129     {
01130         lookAttic = tab1->m_attic;
01131         noRecurs = tab1->m_norecurs;
01132         sLastModule = tab1->m_modname;
01133         sLastTag = tab1->m_tagname;
01134
01135         userHitOK = true;
01136     }
01137
01138     delete dlg;
01139 #endif // qUnix
01140 #ifdef qMacCvsPP
01141     StDialogHandler theHandler(dlg_RtagDelete, LCommander::GetTopCommander());
01142     LWindow *theDialog = theHandler.GetDialog();
01143     ThrowIfNil_(theDialog);
01144     static UInt16 sRuntimePanel = 1;
01145
01146     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01147         (theDialog->FindPaneByID(item_MultiViewPrefs));
01148     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01149
01150     multiView->SwitchToPanel(2);
01151     DoDataExchange_Globals(theDialog, true);
01152     multiView->SwitchToPanel(1);
01153     DoDataExchange_RtagDeleteMain(theDialog, sLastModule, sLastTag,
01154         noRecurs, lookAttic, true);
01155
01156     groupView->SetValue(sRuntimePanel);
01157     theDialog->Show();
01158     MessageT hitMessage;
01159     while (true)
01160     {       // Let DialogHandler process events
01161         hitMessage = theHandler.DoDialog();
01162
01163         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01164             break;
01165     }
01166     theDialog->Hide();
01167     sRuntimePanel = groupView->GetValue();
01168
01169     if(hitMessage == msg_OK)
01170     {
01171         multiView->SwitchToPanel(1);
01172         DoDataExchange_RtagDeleteMain(theDialog, sLastModule, sLastTag,
01173             noRecurs, lookAttic, false);
01174         multiView->SwitchToPanel(2);
01175         DoDataExchange_Globals(theDialog, false);
01176         userHitOK = true;
01177     }
01178 #endif /* qMacCvsPP */
01179
01180     if(userHitOK)
01181     {
01182         tagName = sLastTag;
01183         modName = sLastModule;
01184
01185         gCvsPrefs.save();
01186     }
01187
01188     return userHitOK;
01189 }

Generated on Sun Feb 24 01:22:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


RtagDlg.h File Reference

common/RtagDlg.h File Reference

#include "CPStr.h"
#include "SmartComboBox.h"

Include dependency graph for RtagDlg.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CRtag_MAIN
class | CRtag_OPTIONS

Defines

#define | AFX_RTAGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Enumerations

enum kRtagDlgType {
kRtagAdd,
kRtagDelete,
kRtagFork
}

Functions

bool | CompatRtagCreate (bool &noRecurs, bool &overwriteExisting, UPStr &tagName, UPStr &modName, UPStr &date, UPStr &rev, bool &useMostRecent, bool &lookAttic)
bool | CompatRtagDelete (bool &noRecurs, bool &lookAttic, UPStr &tagName, UPStr &modName)
bool | CompatRtagBranch (bool &noRecurs, UPStr &branchName, UPStr &modName, UPStr &date, UPStr &rev, bool &useMostRecent, bool &lookAttic)

Variables

CMString gOldModules

Define Documentation

#define AFX_RTAGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Definition at line 26 of file RtagDlg.h.

Enumeration Type Documentation

enum kRtagDlgType

Enumeration values:
kRtagAdd
kRtagDelete
kRtagFork

Definition at line 49 of file RtagDlg.h.

Referenced by CRtag_MAIN::CRtag_MAIN, and CRtag_OPTIONS::CRtag_OPTIONS.

00050 {
00051     kRtagAdd,
00052     kRtagDelete,
00053     kRtagFork
00054 } kRtagDlgType;

Function Documentation

bool CompatRtagBranch | ( | bool & | noRecurs,
 |  | UPStr & | branchName,
 |  | UPStr & | modName,
 |  | UPStr & | date,
 |  | UPStr & | rev,
 |  | bool & | useMostRecent,
 |  | bool & | lookAttic
 | ) |

Definition at line 1191 of file RtagDlg.cpp.

Referenced by CvsCmdRtagBranch.

01194 {
01195     bool userHitOK = false;
01196
01197     static CPStr sLastModule;
01198     static CPStr sLastBranch;
01199     static CPStr sLastDate;
01200     static CPStr sLastRev;
01201
01202     bool hasDate = false;
01203     bool hasRev = false;
01204
01205     date = "";
01206     rev = "";
01207     branchName = "";
01208     modName = "";
01209     noRecurs = false;
01210     useMostRecent = false;
01211     lookAttic = false;
01212
01213 #ifdef WIN32
01214     CPropertySheet pages("Create branch settings");
01215     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01216
01217     CRtag_MAIN page1(kRtagFork, sLastModule, sLastBranch, noRecurs, lookAttic);
01218     CRtag_OPTIONS page2(kRtagFork, hasDate, hasRev, sLastDate, sLastRev, useMostRecent);
01219     CGetPrefs_GLOBALS page3;
01220     pages.AddPage(&page1);
01221     pages.AddPage(&page2);
01222     pages.AddPage(&page3);
01223     if(pages.DoModal() == IDOK)
01224     {
01225         sLastModule = page1.m_moduleName;
01226         sLastBranch = page1.m_tagName;
01227         noRecurs = page1.m_noRecurs == TRUE;
01228         lookAttic = page1.m_lookAttic == TRUE;
01229         sLastDate = page2.m_date;
01230         sLastRev = page2.m_rev;
01231         hasDate = page2.m_hasDate == TRUE;
01232         hasRev = page2.m_hasRev == TRUE;
01233         useMostRecent = page2.m_useMostRecent == TRUE;
01234
01235         page3.StoreValues();
01236         userHitOK = true;
01237     }
01238 #endif /* WIN32 */
01239 #if qUnix
01240     void *wid = UCreate_BranchModDlg();
01241
01242     UCvsRtagBranch *dlg = new UCvsRtagBranch();
01243     UCvsRtagBranch_MAIN *tab1 =
01244         new UCvsRtagBranch_MAIN(sLastModule, sLastBranch, hasDate, hasRev,
01245                                   sLastDate, sLastRev, noRecurs, useMostRecent,
01246                                   lookAttic);
01247     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01248     dlg->AddPage(tab1, UCvsRtagBranch::kTabGeneral, 0);
01249
01250     if(dlg->DoModal())
01251     {
01252         lookAttic = tab1->m_attic;
01253         sLastDate = tab1->m_date;
01254         sLastRev = tab1->m_rev;
01255         hasDate = tab1->m_hasdate;
01256         hasRev = tab1->m_hasrev;
01257         noRecurs = tab1->m_norecurs;
01258         useMostRecent = tab1->m_match;
01259         sLastModule = tab1->m_modname;
01260         sLastBranch = tab1->m_tagname;
01261
01262         userHitOK = true;
01263     }
01264
01265     delete dlg;
01266 #endif // qUnix
01267 #ifdef qMacCvsPP
01268     StDialogHandler theHandler(dlg_RtagBranch, LCommander::GetTopCommander());
01269     LWindow *theDialog = theHandler.GetDialog();
01270     ThrowIfNil_(theDialog);
01271     static UInt16 sRuntimePanel = 1;
01272
01273     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01274         (theDialog->FindPaneByID(item_MultiViewPrefs));
01275     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01276
01277     multiView->SwitchToPanel(3);
01278     DoDataExchange_Globals(theDialog, true);
01279     multiView->SwitchToPanel(2);
01280     DoDataExchange_RtagBranchOptions(theDialog, noRecurs, true);
01281     multiView->SwitchToPanel(1);
01282     DoDataExchange_RtagBranchMain(theDialog, sLastModule, sLastBranch,
01283         hasDate, hasRev, sLastDate, sLastRev,
01284         useMostRecent, lookAttic, true);
01285
01286     groupView->SetValue(sRuntimePanel);
01287     theDialog->Show();
01288     MessageT hitMessage;
01289     while (true)
01290     {       // Let DialogHandler process events
01291         hitMessage = theHandler.DoDialog();
01292
01293         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01294             break;
01295     }
01296     theDialog->Hide();
01297     sRuntimePanel = groupView->GetValue();
01298
01299     if(hitMessage == msg_OK)
01300     {
01301         multiView->SwitchToPanel(1);
01302         DoDataExchange_RtagBranchMain(theDialog, sLastModule, sLastBranch,
01303             hasDate, hasRev, sLastDate, sLastRev,
01304             useMostRecent, lookAttic, false);
01305         multiView->SwitchToPanel(2);
01306         DoDataExchange_RtagBranchOptions(theDialog, noRecurs, false);
01307         multiView->SwitchToPanel(3);
01308         DoDataExchange_Globals(theDialog, false);
01309         userHitOK = true;
01310     }
01311 #endif /* qMacCvsPP */
01312
01313     if(userHitOK)
01314     {
01315         if(hasDate && !sLastDate.empty())
01316             date = sLastDate;
01317         if(hasRev && !sLastRev.empty())
01318             rev = sLastRev;
01319
01320         branchName = sLastBranch;
01321         modName = sLastModule;
01322
01323         gCvsPrefs.save();
01324     }
01325
01326     return userHitOK;
01327 }

bool CompatRtagCreate | ( | bool & | noRecurs,
 |  | bool & | overwriteExisting,
 |  | UPStr & | tagName,
 |  | UPStr & | modName,
 |  | UPStr & | date,
 |  | UPStr & | rev,
 |  | bool & | useMostRecent,
 |  | bool & | lookAttic
 | ) |

Definition at line 946 of file RtagDlg.cpp.

Referenced by CvsCmdRtagCreate.

00949 {
00950     bool userHitOK = false;
00951
00952     static CPStr sLastModule;
00953     static CPStr sLastTag;
00954     static CPStr sLastDate;
00955     static CPStr sLastRev;
00956
00957     bool hasDate = false;
00958     bool hasRev = false;
00959
00960     date = "";
00961     rev = "";
00962     tagName = "";
00963     modName = "";
00964     noRecurs = false;
00965     overwriteExisting = false;
00966     useMostRecent = false;
00967     lookAttic = false;
00968
00969 #ifdef WIN32
00970     CPropertySheet pages("Create tag settings");
00971     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00972     CRtag_MAIN page1(kRtagAdd, sLastModule, sLastTag, noRecurs, lookAttic, overwriteExisting);
00973     CRtag_OPTIONS page2(kRtagAdd, hasDate, hasRev, sLastDate, sLastRev, useMostRecent);
00974     CGetPrefs_GLOBALS page3;
00975     pages.AddPage(&page1);
00976     pages.AddPage(&page2);
00977     pages.AddPage(&page3);
00978     if(pages.DoModal() == IDOK)
00979     {
00980         sLastModule = page1.m_moduleName;
00981         sLastTag = page1.m_tagName;
00982         noRecurs = page1.m_noRecurs == TRUE;
00983         overwriteExisting = page1.m_overwriteExisting == TRUE;
00984         lookAttic = page1.m_lookAttic == TRUE;
00985
00986         sLastDate = page2.m_date;
00987         sLastRev = page2.m_rev;
00988         hasDate = page2.m_hasDate == TRUE;
00989         hasRev = page2.m_hasRev == TRUE;
00990         useMostRecent = page2.m_useMostRecent == TRUE;
00991
00992         page3.StoreValues();
00993         userHitOK = true;
00994     }
00995 #endif /* WIN32 */
00996 #if qUnix
00997     void *wid = UCreate_TagModDlg();
00998
00999     UCvsRtagCreate *dlg = new UCvsRtagCreate();
01000     UCvsRtagCreate_MAIN *tab1 =
01001         new UCvsRtagCreate_MAIN(sLastModule, sLastTag, hasDate, hasRev,
01002                                 sLastDate, sLastRev, noRecurs, overwriteExisting,
01003                                 useMostRecent, lookAttic);
01004     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01005     dlg->AddPage(tab1, UCvsRtagCreate::kTabGeneral, 0);
01006
01007     if(dlg->DoModal())
01008     {
01009         lookAttic = tab1->m_attic;
01010         sLastDate = tab1->m_date;
01011         sLastRev = tab1->m_rev;
01012         hasDate = tab1->m_hasdate;
01013         hasRev = tab1->m_hasrev;
01014         noRecurs = tab1->m_norecurs;
01015         useMostRecent = tab1->m_match;
01016         sLastModule = tab1->m_modname;
01017         sLastTag = tab1->m_tagname;
01018         overwriteExisting = tab1->m_overwrite;
01019
01020         userHitOK = true;
01021     }
01022
01023     delete dlg;
01024 #endif // qUnix
01025 #ifdef qMacCvsPP
01026     StDialogHandler theHandler(dlg_RtagCreate, LCommander::GetTopCommander());
01027     LWindow *theDialog = theHandler.GetDialog();
01028     ThrowIfNil_(theDialog);
01029     static UInt16 sRuntimePanel = 1;
01030
01031     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01032         (theDialog->FindPaneByID(item_MultiViewPrefs));
01033     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01034
01035     multiView->SwitchToPanel(3);
01036     DoDataExchange_Globals(theDialog, true);
01037     multiView->SwitchToPanel(2);
01038     DoDataExchange_RtagCreateOptions(theDialog, noRecurs, overwriteExisting, true);
01039     multiView->SwitchToPanel(1);
01040     DoDataExchange_RtagCreateMain(theDialog, sLastModule, sLastTag,
01041         hasDate, hasRev, sLastDate, sLastRev,
01042         useMostRecent, lookAttic, true);
01043
01044     groupView->SetValue(sRuntimePanel);
01045     theDialog->Show();
01046     MessageT hitMessage;
01047     while (true)
01048     {       // Let DialogHandler process events
01049         hitMessage = theHandler.DoDialog();
01050
01051         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01052             break;
01053     }
01054     theDialog->Hide();
01055     sRuntimePanel = groupView->GetValue();
01056
01057     if(hitMessage == msg_OK)
01058     {
01059         multiView->SwitchToPanel(1);
01060         DoDataExchange_RtagCreateMain(theDialog, sLastModule, sLastTag,
01061             hasDate, hasRev, sLastDate, sLastRev,
01062             useMostRecent, lookAttic, false);
01063         multiView->SwitchToPanel(2);
01064         DoDataExchange_RtagCreateOptions(theDialog, noRecurs, overwriteExisting, false);
01065         multiView->SwitchToPanel(3);
01066         DoDataExchange_Globals(theDialog, false);
01067         userHitOK = true;
01068     }
01069 #endif /* qMacCvsPP */
01070
01071     if(userHitOK)
01072     {
01073         if(hasDate && !sLastDate.empty())
01074             date = sLastDate;
01075         if(hasRev && !sLastRev.empty())
01076             rev = sLastRev;
01077
01078         tagName = sLastTag;
01079         modName = sLastModule;
01080
01081         gCvsPrefs.save();
01082     }
01083
01084     return userHitOK;
01085 }

bool CompatRtagDelete | ( | bool & | noRecurs,
 |  | bool & | lookAttic,
 |  | UPStr & | tagName,
 |  | UPStr & | modName
 | ) |

Definition at line 1087 of file RtagDlg.cpp.

Referenced by CvsCmdRtagDelete.

01089 {
01090
01091     bool userHitOK = false;
01092
01093     static CPStr sLastModule;
01094     static CPStr sLastTag;
01095
01096     tagName = "";
01097     modName = "";
01098     noRecurs = false;
01099     lookAttic = false;
01100
01101 #ifdef WIN32
01102     CPropertySheet pages("Delete tag settings");
01103     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01104     CRtag_MAIN page1(kRtagDelete, sLastModule, sLastTag, noRecurs, lookAttic);
01105     CGetPrefs_GLOBALS page2;
01106     pages.AddPage(&page1);
01107     pages.AddPage(&page2);
01108     if(pages.DoModal() == IDOK)
01109     {
01110         lookAttic = page1.m_lookAttic == TRUE;
01111         noRecurs = page1.m_noRecurs == TRUE;
01112         sLastModule = page1.m_moduleName;
01113         sLastTag = page1.m_tagName;
01114
01115         page2.StoreValues();
01116         userHitOK = true;
01117     }
01118 #endif /* WIN32 */
01119 #if qUnix
01120     void *wid = UCreate_UntagModDlg();
01121
01122     UCvsRtagDel *dlg = new UCvsRtagDel();
01123     UCvsRtagDel_MAIN *tab1 = new UCvsRtagDel_MAIN(sLastModule, sLastTag,
01124                                                   noRecurs, lookAttic);
01125     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01126     dlg->AddPage(tab1, UCvsRtagDel::kTabGeneral, 0);
01127
01128     if(dlg->DoModal())
01129     {
01130         lookAttic = tab1->m_attic;
01131         noRecurs = tab1->m_norecurs;
01132         sLastModule = tab1->m_modname;
01133         sLastTag = tab1->m_tagname;
01134
01135         userHitOK = true;
01136     }
01137
01138     delete dlg;
01139 #endif // qUnix
01140 #ifdef qMacCvsPP
01141     StDialogHandler theHandler(dlg_RtagDelete, LCommander::GetTopCommander());
01142     LWindow *theDialog = theHandler.GetDialog();
01143     ThrowIfNil_(theDialog);
01144     static UInt16 sRuntimePanel = 1;
01145
01146     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01147         (theDialog->FindPaneByID(item_MultiViewPrefs));
01148     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01149
01150     multiView->SwitchToPanel(2);
01151     DoDataExchange_Globals(theDialog, true);
01152     multiView->SwitchToPanel(1);
01153     DoDataExchange_RtagDeleteMain(theDialog, sLastModule, sLastTag,
01154         noRecurs, lookAttic, true);
01155
01156     groupView->SetValue(sRuntimePanel);
01157     theDialog->Show();
01158     MessageT hitMessage;
01159     while (true)
01160     {       // Let DialogHandler process events
01161         hitMessage = theHandler.DoDialog();
01162
01163         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01164             break;
01165     }
01166     theDialog->Hide();
01167     sRuntimePanel = groupView->GetValue();
01168
01169     if(hitMessage == msg_OK)
01170     {
01171         multiView->SwitchToPanel(1);
01172         DoDataExchange_RtagDeleteMain(theDialog, sLastModule, sLastTag,
01173             noRecurs, lookAttic, false);
01174         multiView->SwitchToPanel(2);
01175         DoDataExchange_Globals(theDialog, false);
01176         userHitOK = true;
01177     }
01178 #endif /* qMacCvsPP */
01179
01180     if(userHitOK)
01181     {
01182         tagName = sLastTag;
01183         modName = sLastModule;
01184
01185         gCvsPrefs.save();
01186     }
01187
01188     return userHitOK;
01189 }

Variable Documentation

CMString gOldModules

Definition at line 47 of file RtagDlg.h.

Generated on Sun Feb 24 01:22:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


SmartComboBox.cpp File Reference

common/SmartComboBox.cpp File Reference

#include "stdafx.h"
#include "SmartComboBox.h"
#include "resource.h"
#include "MultiString.h"
#include "CvsAlert.h"

Include dependency graph for SmartComboBox.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:22:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


SmartComboBox.h File Reference

common/SmartComboBox.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | USmartCombo
This is an abstract class for Smart Combo Box (CSmartComboBox). More...

class | CSmartComboBox
This is a Smart Combo Box class(CSmartComboBox). More...

Defines

#define | AFX_SMARTCOMBOBOX_H__E3F8DAE6_C2EF_49CE_AE52_3AE54F5A629C__INCLUDED_
#define | WM_SMCB_SETFEATURE WM_USER + 1
#define | WM_SMCB_SETITEMS WM_USER + 2
#define | WM_SMCB_SETREADONLY WM_USER + 3

Define Documentation

#define AFX_SMARTCOMBOBOX_H__E3F8DAE6_C2EF_49CE_AE52_3AE54F5A629C__INCLUDED_

Definition at line 22 of file SmartComboBox.h.

#define WM_SMCB_SETFEATURE WM_USER + 1

Private window message to set the features. See CSmartComboBox::OnSetFeature for more details.

Definition at line 85 of file SmartComboBox.h.

Referenced by UWidget::OnSmartComboSetFeature.

#define WM_SMCB_SETITEMS WM_USER + 2

Private window message to set the droplist items collection. See CSmartComboBox::OnSetItems for more details.

Definition at line 91 of file SmartComboBox.h.

Referenced by UWidget::OnSmartComboSetItems.

#define WM_SMCB_SETREADONLY WM_USER + 3

Private window message to set the read-only feature. See CSmartComboBox::OnSetFeature for more details.

Definition at line 97 of file SmartComboBox.h.

Referenced by UWidget::OnSmartComboSetReadOnly.

Generated on Sun Feb 24 01:22:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


SortList.h File Reference

common/SortList.h File Reference

#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <assert.h>

Include dependency graph for SortList.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CSortList

Enumerations

enum computeSort {
computeNone,
computeLR
}

Enumeration Type Documentation

enum computeSort

Enumeration values:
computeNone
computeLR

Definition at line 38 of file SortList.h.

Referenced by CSortList< ENTNODE >::Location.

00039 {
00040     computeNone,
00041     computeLR
00042 } computeSort;

Generated on Sun Feb 24 01:22:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TagDlg.cpp File Reference

common/TagDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "GetPrefs.h"
#include "TagDlg.h"
#include "CvsPrefs.h"
#include "UpdateDlg.h"

Include dependency graph for TagDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool | CompatTagCreate (bool &noRecurs, bool &overwriteExisting, UPStr &tagName, bool &checkUnmod)
bool | CompatTagDelete (bool &noRecurs, UPStr &tagName)
bool | CompatTagBranch (bool &noRecurs, UPStr &branchName, bool &checkUnmod)

Function Documentation

bool CompatTagBranch | ( | bool & | noRecurs,
 |  | UPStr & | branchName,
 |  | bool & | checkUnmod
 | ) |

Definition at line 802 of file TagDlg.cpp.

References CPStr, EV_INIT_WIDGET, kTagFork, kUMainWidget, CTag_MAIN::m_checkUnmod, CTag_MAIN::m_noRecurs, CTag_MAIN::m_tagName, CGetPrefs_GLOBALS::StoreValues, TRUE, UCreate_BranchDlg, and UEventSendMessage.

00804 {
00805     bool userHitOK = false;
00806
00807     static CPStr sLastBranch;
00808
00809     branchName = "";
00810     noRecurs = false;
00811     checkUnmod = false;
00812
00813 #ifdef WIN32
00814     CPropertySheet pages("Create branch settings");
00815     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00816     CTag_MAIN page1(kTagFork, sLastBranch, noRecurs, checkUnmod);
00817     CGetPrefs_GLOBALS page2;
00818     pages.AddPage(&page1);
00819     pages.AddPage(&page2);
00820     if(pages.DoModal() == IDOK)
00821     {
00822         checkUnmod = page1.m_checkUnmod == TRUE;
00823         noRecurs = page1.m_noRecurs == TRUE;
00824         sLastBranch = page1.m_tagName;
00825
00826         page2.StoreValues();
00827         userHitOK = true;
00828     }
00829 #endif /* WIN32 */
00830 #if qUnix
00831     void *wid = UCreate_BranchDlg();
00832
00833     UCvsTagBranch *dlg = new UCvsTagBranch();
00834     UCvsTagBranch_MAIN *tab1 = new UCvsTagBranch_MAIN(sLastBranch, noRecurs, checkUnmod);
00835     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00836     dlg->AddPage(tab1, UCvsTagBranch::kTabGeneral, 0);
00837
00838     if(dlg->DoModal())
00839     {
00840         checkUnmod = tab1->m_checkunmod;
00841         noRecurs = tab1->m_norecurs;
00842         sLastBranch = tab1->m_tagname;
00843
00844         userHitOK = true;
00845     }
00846
00847     delete dlg;
00848 #endif // qUnix
00849 #ifdef qMacCvsPP
00850     StDialogHandler theHandler(dlg_TagBranch, LCommander::GetTopCommander());
00851     LWindow *theDialog = theHandler.GetDialog();
00852     ThrowIfNil_(theDialog);
00853     static UInt16 sRuntimePanel = 1;
00854
00855     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00856         (theDialog->FindPaneByID(item_MultiViewPrefs));
00857     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00858
00859     multiView->SwitchToPanel(2);
00860     DoDataExchange_Globals(theDialog, true);
00861     multiView->SwitchToPanel(1);
00862     DoDataExchange_TagBranchMain(theDialog, sLastBranch,
00863         noRecurs, checkUnmod, true);
00864
00865     groupView->SetValue(sRuntimePanel);
00866     theDialog->Show();
00867     MessageT hitMessage;
00868     while (true)
00869     {       // Let DialogHandler process events
00870         hitMessage = theHandler.DoDialog();
00871
00872         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00873             break;
00874     }
00875     theDialog->Hide();
00876     sRuntimePanel = groupView->GetValue();
00877
00878     if(hitMessage == msg_OK)
00879     {
00880         multiView->SwitchToPanel(1);
00881         DoDataExchange_TagBranchMain(theDialog, sLastBranch,
00882             noRecurs, checkUnmod, false);
00883         multiView->SwitchToPanel(2);
00884         DoDataExchange_Globals(theDialog, false);
00885         userHitOK = true;
00886     }
00887 #endif /* qMacCvsPP */
00888
00889     if(userHitOK)
00890     {
00891         branchName = sLastBranch;
00892
00893         gCvsPrefs.save();
00894     }
00895
00896     return userHitOK;
00897 }

bool CompatTagCreate | ( | bool & | noRecurs,
 |  | bool & | overwriteExisting,
 |  | UPStr & | tagName,
 |  | bool & | checkUnmod
 | ) |

Definition at line 609 of file TagDlg.cpp.

References CPStr, EV_INIT_WIDGET, kTagAdd, kUMainWidget, CTag_MAIN::m_checkUnmod, CTag_MAIN::m_noRecurs, CTag_MAIN::m_overwriteExisting, CTag_MAIN::m_tagName, CGetPrefs_GLOBALS::StoreValues, TRUE, UCreate_TagDlg, and UEventSendMessage.

00611 {
00612     bool userHitOK = false;
00613
00614     static CPStr sLastTag;
00615
00616     tagName = "";
00617     noRecurs = false;
00618     overwriteExisting = false;
00619     checkUnmod = false;
00620
00621 #ifdef WIN32
00622     CPropertySheet pages("Create tag settings");
00623     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00624     CTag_MAIN page1(kTagAdd, sLastTag, noRecurs, checkUnmod, overwriteExisting);
00625     CGetPrefs_GLOBALS page2;
00626     pages.AddPage(&page1);
00627     pages.AddPage(&page2);
00628     if(pages.DoModal() == IDOK)
00629     {
00630         checkUnmod = page1.m_checkUnmod == TRUE;
00631         noRecurs = page1.m_noRecurs == TRUE;
00632         sLastTag = page1.m_tagName;
00633         overwriteExisting = page1.m_overwriteExisting == TRUE;
00634
00635         page2.StoreValues();
00636         userHitOK = true;
00637     }
00638 #endif /* WIN32 */
00639 #if qUnix
00640     void *wid = UCreate_TagDlg();
00641
00642     UCvsTagCreate *dlg = new UCvsTagCreate();
00643     UCvsTagCreate_MAIN *tab1 =
00644         new UCvsTagCreate_MAIN(sLastTag, noRecurs, overwriteExisting, checkUnmod);
00645     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00646     dlg->AddPage(tab1, UCvsTagCreate::kTabGeneral, 0);
00647
00648     if(dlg->DoModal())
00649     {
00650         checkUnmod = tab1->m_checkunmod;
00651         noRecurs = tab1->m_norecurs;
00652         sLastTag = tab1->m_tagname;
00653         overwriteExisting = tab1->m_overwrite;
00654
00655         userHitOK = true;
00656     }
00657
00658     delete dlg;
00659 #endif // qUnix
00660 #ifdef qMacCvsPP
00661     StDialogHandler theHandler(dlg_TagCreate, LCommander::GetTopCommander());
00662     LWindow *theDialog = theHandler.GetDialog();
00663     ThrowIfNil_(theDialog);
00664     static UInt16 sRuntimePanel = 1;
00665
00666     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00667         (theDialog->FindPaneByID(item_MultiViewPrefs));
00668     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00669
00670     multiView->SwitchToPanel(2);
00671     DoDataExchange_Globals(theDialog, true);
00672     multiView->SwitchToPanel(1);
00673     DoDataExchange_TagCreateMain(theDialog, sLastTag,
00674         noRecurs, overwriteExisting, checkUnmod, true);
00675
00676     groupView->SetValue(sRuntimePanel);
00677     theDialog->Show();
00678     MessageT hitMessage;
00679     while (true)
00680     {       // Let DialogHandler process events
00681         hitMessage = theHandler.DoDialog();
00682
00683         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00684             break;
00685     }
00686     theDialog->Hide();
00687     sRuntimePanel = groupView->GetValue();
00688
00689     if(hitMessage == msg_OK)
00690     {
00691         multiView->SwitchToPanel(1);
00692         DoDataExchange_TagCreateMain(theDialog, sLastTag,
00693             noRecurs, overwriteExisting, checkUnmod, false);
00694         multiView->SwitchToPanel(2);
00695         DoDataExchange_Globals(theDialog, false);
00696         userHitOK = true;
00697     }
00698 #endif /* qMacCvsPP */
00699
00700     if(userHitOK)
00701     {
00702         tagName = sLastTag;
00703
00704         gCvsPrefs.save();
00705     }
00706
00707     return userHitOK;
00708 }

bool CompatTagDelete | ( | bool & | noRecurs,
 |  | UPStr & | tagName
 | ) |

Definition at line 710 of file TagDlg.cpp.

References CPStr, EV_INIT_WIDGET, kTagDelete, kUMainWidget, CTag_MAIN::m_noRecurs, CTag_MAIN::m_tagName, CGetPrefs_GLOBALS::StoreValues, TRUE, UCreate_UntagDlg, and UEventSendMessage.

00711 {
00712
00713     bool userHitOK = false;
00714
00715     static CPStr sLastTag;
00716
00717     tagName = "";
00718     noRecurs = false;
00719
00720 #ifdef WIN32
00721     CPropertySheet pages("Delete tag settings");
00722     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00723     CTag_MAIN page1(kTagDelete, sLastTag, noRecurs);
00724     CGetPrefs_GLOBALS page2;
00725     pages.AddPage(&page1);
00726     pages.AddPage(&page2);
00727     if(pages.DoModal() == IDOK)
00728     {
00729         noRecurs = page1.m_noRecurs == TRUE;
00730         sLastTag = page1.m_tagName;
00731
00732         page2.StoreValues();
00733         userHitOK = true;
00734     }
00735 #endif /* WIN32 */
00736 #if qUnix
00737     void *wid = UCreate_UntagDlg();
00738
00739     UCvsTagDel *dlg = new UCvsTagDel();
00740     UCvsTagDel_MAIN *tab1 = new UCvsTagDel_MAIN(sLastTag, noRecurs);
00741     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00742     dlg->AddPage(tab1, UCvsTagDel::kTabGeneral, 0);
00743
00744     if(dlg->DoModal())
00745     {
00746         noRecurs = tab1->m_norecurs;
00747         sLastTag = tab1->m_tagname;
00748
00749         userHitOK = true;
00750     }
00751
00752     delete dlg;
00753 #endif // qUnix
00754 #ifdef qMacCvsPP
00755     StDialogHandler theHandler(dlg_TagDelete, LCommander::GetTopCommander());
00756     LWindow *theDialog = theHandler.GetDialog();
00757     ThrowIfNil_(theDialog);
00758     static UInt16 sRuntimePanel = 1;
00759
00760     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00761         (theDialog->FindPaneByID(item_MultiViewPrefs));
00762     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00763
00764     multiView->SwitchToPanel(2);
00765     DoDataExchange_Globals(theDialog, true);
00766     multiView->SwitchToPanel(1);
00767     DoDataExchange_TagDeleteMain(theDialog, sLastTag, noRecurs, true);
00768
00769     groupView->SetValue(sRuntimePanel);
00770     theDialog->Show();
00771     MessageT hitMessage;
00772     while (true)
00773     {       // Let DialogHandler process events
00774         hitMessage = theHandler.DoDialog();
00775
00776         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00777             break;
00778     }
00779     theDialog->Hide();
00780     sRuntimePanel = groupView->GetValue();
00781
00782     if(hitMessage == msg_OK)
00783     {
00784         multiView->SwitchToPanel(1);
00785         DoDataExchange_TagDeleteMain(theDialog, sLastTag, noRecurs, false);
00786         multiView->SwitchToPanel(2);
00787         DoDataExchange_Globals(theDialog, false);
00788         userHitOK = true;
00789     }
00790 #endif /* qMacCvsPP */
00791
00792     if(userHitOK)
00793     {
00794         tagName = sLastTag;
00795
00796         gCvsPrefs.save();
00797     }
00798
00799     return userHitOK;
00800 }

Generated on Sun Feb 24 01:22:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TagDlg.h File Reference

common/TagDlg.h File Reference

#include "CPStr.h"
#include "SmartComboBox.h"

Include dependency graph for TagDlg.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CTag_MAIN

Defines

#define | AFX_TAGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Enumerations

enum kTagDlgType {
kTagAdd,
kTagDelete,
kTagFork
}

Functions

bool | CompatTagCreate (bool &noRecurs, bool &overwriteExisting, UPStr &tagName, bool &checkUnmod)
bool | CompatTagDelete (bool &noRecurs, UPStr &tagName)
bool | CompatTagBranch (bool &noRecurs, UPStr &branchName, bool &checkUnmod)

Define Documentation

#define AFX_TAGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Definition at line 26 of file TagDlg.h.

Enumeration Type Documentation

enum kTagDlgType

Enumeration values:
kTagAdd
kTagDelete
kTagFork

Definition at line 44 of file TagDlg.h.

Referenced by CTag_MAIN::CTag_MAIN.

00045 {
00046     kTagAdd,
00047     kTagDelete,
00048     kTagFork
00049 } kTagDlgType;

Function Documentation

bool CompatTagBranch | ( | bool & | noRecurs,
 |  | UPStr & | branchName,
 |  | bool & | checkUnmod
 | ) |

Definition at line 802 of file TagDlg.cpp.

Referenced by CvsCmdTagBranchFiles, and CvsCmdTagBranchFolder.

00804 {
00805     bool userHitOK = false;
00806
00807     static CPStr sLastBranch;
00808
00809     branchName = "";
00810     noRecurs = false;
00811     checkUnmod = false;
00812
00813 #ifdef WIN32
00814     CPropertySheet pages("Create branch settings");
00815     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00816     CTag_MAIN page1(kTagFork, sLastBranch, noRecurs, checkUnmod);
00817     CGetPrefs_GLOBALS page2;
00818     pages.AddPage(&page1);
00819     pages.AddPage(&page2);
00820     if(pages.DoModal() == IDOK)
00821     {
00822         checkUnmod = page1.m_checkUnmod == TRUE;
00823         noRecurs = page1.m_noRecurs == TRUE;
00824         sLastBranch = page1.m_tagName;
00825
00826         page2.StoreValues();
00827         userHitOK = true;
00828     }
00829 #endif /* WIN32 */
00830 #if qUnix
00831     void *wid = UCreate_BranchDlg();
00832
00833     UCvsTagBranch *dlg = new UCvsTagBranch();
00834     UCvsTagBranch_MAIN *tab1 = new UCvsTagBranch_MAIN(sLastBranch, noRecurs, checkUnmod);
00835     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00836     dlg->AddPage(tab1, UCvsTagBranch::kTabGeneral, 0);
00837
00838     if(dlg->DoModal())
00839     {
00840         checkUnmod = tab1->m_checkunmod;
00841         noRecurs = tab1->m_norecurs;
00842         sLastBranch = tab1->m_tagname;
00843
00844         userHitOK = true;
00845     }
00846
00847     delete dlg;
00848 #endif // qUnix
00849 #ifdef qMacCvsPP
00850     StDialogHandler theHandler(dlg_TagBranch, LCommander::GetTopCommander());
00851     LWindow *theDialog = theHandler.GetDialog();
00852     ThrowIfNil_(theDialog);
00853     static UInt16 sRuntimePanel = 1;
00854
00855     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00856         (theDialog->FindPaneByID(item_MultiViewPrefs));
00857     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00858
00859     multiView->SwitchToPanel(2);
00860     DoDataExchange_Globals(theDialog, true);
00861     multiView->SwitchToPanel(1);
00862     DoDataExchange_TagBranchMain(theDialog, sLastBranch,
00863         noRecurs, checkUnmod, true);
00864
00865     groupView->SetValue(sRuntimePanel);
00866     theDialog->Show();
00867     MessageT hitMessage;
00868     while (true)
00869     {       // Let DialogHandler process events
00870         hitMessage = theHandler.DoDialog();
00871
00872         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00873             break;
00874     }
00875     theDialog->Hide();
00876     sRuntimePanel = groupView->GetValue();
00877
00878     if(hitMessage == msg_OK)
00879     {
00880         multiView->SwitchToPanel(1);
00881         DoDataExchange_TagBranchMain(theDialog, sLastBranch,
00882             noRecurs, checkUnmod, false);
00883         multiView->SwitchToPanel(2);
00884         DoDataExchange_Globals(theDialog, false);
00885         userHitOK = true;
00886     }
00887 #endif /* qMacCvsPP */
00888
00889     if(userHitOK)
00890     {
00891         branchName = sLastBranch;
00892
00893         gCvsPrefs.save();
00894     }
00895
00896     return userHitOK;
00897 }

bool CompatTagCreate | ( | bool & | noRecurs,
 |  | bool & | overwriteExisting,
 |  | UPStr & | tagName,
 |  | bool & | checkUnmod
 | ) |

Definition at line 609 of file TagDlg.cpp.

Referenced by CvsCmdTagCreateFiles, and CvsCmdTagCreateFolder.

00611 {
00612     bool userHitOK = false;
00613
00614     static CPStr sLastTag;
00615
00616     tagName = "";
00617     noRecurs = false;
00618     overwriteExisting = false;
00619     checkUnmod = false;
00620
00621 #ifdef WIN32
00622     CPropertySheet pages("Create tag settings");
00623     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00624     CTag_MAIN page1(kTagAdd, sLastTag, noRecurs, checkUnmod, overwriteExisting);
00625     CGetPrefs_GLOBALS page2;
00626     pages.AddPage(&page1);
00627     pages.AddPage(&page2);
00628     if(pages.DoModal() == IDOK)
00629     {
00630         checkUnmod = page1.m_checkUnmod == TRUE;
00631         noRecurs = page1.m_noRecurs == TRUE;
00632         sLastTag = page1.m_tagName;
00633         overwriteExisting = page1.m_overwriteExisting == TRUE;
00634
00635         page2.StoreValues();
00636         userHitOK = true;
00637     }
00638 #endif /* WIN32 */
00639 #if qUnix
00640     void *wid = UCreate_TagDlg();
00641
00642     UCvsTagCreate *dlg = new UCvsTagCreate();
00643     UCvsTagCreate_MAIN *tab1 =
00644         new UCvsTagCreate_MAIN(sLastTag, noRecurs, overwriteExisting, checkUnmod);
00645     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00646     dlg->AddPage(tab1, UCvsTagCreate::kTabGeneral, 0);
00647
00648     if(dlg->DoModal())
00649     {
00650         checkUnmod = tab1->m_checkunmod;
00651         noRecurs = tab1->m_norecurs;
00652         sLastTag = tab1->m_tagname;
00653         overwriteExisting = tab1->m_overwrite;
00654
00655         userHitOK = true;
00656     }
00657
00658     delete dlg;
00659 #endif // qUnix
00660 #ifdef qMacCvsPP
00661     StDialogHandler theHandler(dlg_TagCreate, LCommander::GetTopCommander());
00662     LWindow *theDialog = theHandler.GetDialog();
00663     ThrowIfNil_(theDialog);
00664     static UInt16 sRuntimePanel = 1;
00665
00666     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00667         (theDialog->FindPaneByID(item_MultiViewPrefs));
00668     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00669
00670     multiView->SwitchToPanel(2);
00671     DoDataExchange_Globals(theDialog, true);
00672     multiView->SwitchToPanel(1);
00673     DoDataExchange_TagCreateMain(theDialog, sLastTag,
00674         noRecurs, overwriteExisting, checkUnmod, true);
00675
00676     groupView->SetValue(sRuntimePanel);
00677     theDialog->Show();
00678     MessageT hitMessage;
00679     while (true)
00680     {       // Let DialogHandler process events
00681         hitMessage = theHandler.DoDialog();
00682
00683         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00684             break;
00685     }
00686     theDialog->Hide();
00687     sRuntimePanel = groupView->GetValue();
00688
00689     if(hitMessage == msg_OK)
00690     {
00691         multiView->SwitchToPanel(1);
00692         DoDataExchange_TagCreateMain(theDialog, sLastTag,
00693             noRecurs, overwriteExisting, checkUnmod, false);
00694         multiView->SwitchToPanel(2);
00695         DoDataExchange_Globals(theDialog, false);
00696         userHitOK = true;
00697     }
00698 #endif /* qMacCvsPP */
00699
00700     if(userHitOK)
00701     {
00702         tagName = sLastTag;
00703
00704         gCvsPrefs.save();
00705     }
00706
00707     return userHitOK;
00708 }

bool CompatTagDelete | ( | bool & | noRecurs,
 |  | UPStr & | tagName
 | ) |

Definition at line 710 of file TagDlg.cpp.

Referenced by CvsCmdTagDeleteFiles, and CvsCmdTagDeleteFolder.

00711 {
00712
00713     bool userHitOK = false;
00714
00715     static CPStr sLastTag;
00716
00717     tagName = "";
00718     noRecurs = false;
00719
00720 #ifdef WIN32
00721     CPropertySheet pages("Delete tag settings");
00722     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00723     CTag_MAIN page1(kTagDelete, sLastTag, noRecurs);
00724     CGetPrefs_GLOBALS page2;
00725     pages.AddPage(&page1);
00726     pages.AddPage(&page2);
00727     if(pages.DoModal() == IDOK)
00728     {
00729         noRecurs = page1.m_noRecurs == TRUE;
00730         sLastTag = page1.m_tagName;
00731
00732         page2.StoreValues();
00733         userHitOK = true;
00734     }
00735 #endif /* WIN32 */
00736 #if qUnix
00737     void *wid = UCreate_UntagDlg();
00738
00739     UCvsTagDel *dlg = new UCvsTagDel();
00740     UCvsTagDel_MAIN *tab1 = new UCvsTagDel_MAIN(sLastTag, noRecurs);
00741     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00742     dlg->AddPage(tab1, UCvsTagDel::kTabGeneral, 0);
00743
00744     if(dlg->DoModal())
00745     {
00746         noRecurs = tab1->m_norecurs;
00747         sLastTag = tab1->m_tagname;
00748
00749         userHitOK = true;
00750     }
00751
00752     delete dlg;
00753 #endif // qUnix
00754 #ifdef qMacCvsPP
00755     StDialogHandler theHandler(dlg_TagDelete, LCommander::GetTopCommander());
00756     LWindow *theDialog = theHandler.GetDialog();
00757     ThrowIfNil_(theDialog);
00758     static UInt16 sRuntimePanel = 1;
00759
00760     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00761         (theDialog->FindPaneByID(item_MultiViewPrefs));
00762     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00763
00764     multiView->SwitchToPanel(2);
00765     DoDataExchange_Globals(theDialog, true);
00766     multiView->SwitchToPanel(1);
00767     DoDataExchange_TagDeleteMain(theDialog, sLastTag, noRecurs, true);
00768
00769     groupView->SetValue(sRuntimePanel);
00770     theDialog->Show();
00771     MessageT hitMessage;
00772     while (true)
00773     {       // Let DialogHandler process events
00774         hitMessage = theHandler.DoDialog();
00775
00776         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00777             break;
00778     }
00779     theDialog->Hide();
00780     sRuntimePanel = groupView->GetValue();
00781
00782     if(hitMessage == msg_OK)
00783     {
00784         multiView->SwitchToPanel(1);
00785         DoDataExchange_TagDeleteMain(theDialog, sLastTag, noRecurs, false);
00786         multiView->SwitchToPanel(2);
00787         DoDataExchange_Globals(theDialog, false);
00788         userHitOK = true;
00789     }
00790 #endif /* qMacCvsPP */
00791
00792     if(userHitOK)
00793     {
00794         tagName = sLastTag;
00795
00796         gCvsPrefs.save();
00797     }
00798
00799     return userHitOK;
00800 }

Generated on Sun Feb 24 01:22:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TclGlue.cpp File Reference

common/TclGlue.cpp File Reference

#include "stdafx.h"
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include "tcl.h"
#include "TclGlue.h"
#include "AppConsole.h"
#include "AppGlue.h"
#include "CvsArgs.h"
#include "CvsEntries.h"
#include "dll_loader.h"
#include "FileTraversal.h"
#include "MacrosSetup.h"
#include "MoveToTrash.h"
#include "CvsPrefs.h"
#include "wincvs.h"
#include "wincvsdebug.h"

Include dependency graph for TclGlue.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | CFillTclEntries
class | LSReport
class | CTCLBrowserEnt
class | CTCLCvsConsole

Defines

#define | USE_TCL 1
#define | __STDC__ 1
#define | UNDEF_STDC
#define | __STDC__ 0
#define | NEW new
#define | DECLC
#define | DEC_GLUE(f) (*f##_glue)
#define | GLUE_WRAP(f) f##_glue
#define | Tcl_CreateCommand GLUE_WRAP(Tcl_CreateCommand)
#define | Tcl_CreateInterp GLUE_WRAP(Tcl_CreateInterp)
#define | Tcl_AppendResult GLUE_WRAP(Tcl_AppendResult)
#define | Tcl_SetResult GLUE_WRAP(Tcl_SetResult)
#define | Tcl_DeleteInterp GLUE_WRAP(Tcl_DeleteInterp)
#define | Tcl_Eval GLUE_WRAP(Tcl_Eval)
#define | Tcl_EvalFile GLUE_WRAP(Tcl_EvalFile)
#define | Tcl_Alloc GLUE_WRAP(Tcl_Alloc)
#define | Tcl_Free GLUE_WRAP(Tcl_Free)
#define | Tcl_Realloc GLUE_WRAP(Tcl_Realloc)
#define | Tcl_ExprLong GLUE_WRAP(Tcl_ExprLong)
#define | Tcl_Concat GLUE_WRAP(Tcl_Concat)
#define | Tcl_SetVar2 GLUE_WRAP(Tcl_SetVar2)
#define | Tcl_DStringStartSublist GLUE_WRAP(Tcl_DStringStartSublist)
#define | Tcl_DStringEndSublist GLUE_WRAP(Tcl_DStringEndSublist)
#define | Tcl_DStringFree GLUE_WRAP(Tcl_DStringFree)
#define | Tcl_DStringInit GLUE_WRAP(Tcl_DStringInit)
#define | Tcl_DStringResult GLUE_WRAP(Tcl_DStringResult)
#define | Tcl_DStringAppendElement GLUE_WRAP(Tcl_DStringAppendElement)
#define | TclFreeObj GLUE_WRAP(TclFreeObj)
#define | Tcl_SetObjResult GLUE_WRAP(Tcl_SetObjResult)
#define | Tcl_NewStringObj GLUE_WRAP(Tcl_NewStringObj)
#define | Tcl_NewListObj GLUE_WRAP(Tcl_NewListObj)
#define | Tcl_ListObjAppendElement GLUE_WRAP(Tcl_ListObjAppendElement)
#define | Tcl_SourceRCFile GLUE_WRAP(Tcl_SourceRCFile)
#define | Tcl_Init GLUE_WRAP(Tcl_Init)
#define | Tcl_SetVar GLUE_WRAP(Tcl_SetVar)
#define | Tcl_FindExecutable GLUE_WRAP(Tcl_FindExecutable)
#define | _TCL_CALLBACK(f) f
#define | LOAD_CODEFRAG(name)

Functions

Tcl_Command Tcl_CreateCommand_glue | _ANSI_ARGS_ ((Tcl_Interp *interp, char *cmdName, Tcl_CmdProc *proc, ClientData clientData, Tcl_CmdDeleteProc *deleteProc))
Tcl_Interp *Tcl_CreateInterp_glue | _ANSI_ARGS_ ((void))
void Tcl_AppendResult_glue | _ANSI_ARGS_ (TCL_VARARGS(Tcl_Interp *, interp))
void Tcl_SetResult_glue | _ANSI_ARGS_ ((Tcl_Interp *interp, char *string, Tcl_FreeProc *freeProc))
void Tcl_DeleteInterp_glue | _ANSI_ARGS_ ((Tcl_Interp *interp))
int Tcl_Eval_glue | _ANSI_ARGS_ ((Tcl_Interp *interp, char *string))
int Tcl_EvalFile_glue | _ANSI_ARGS_ ((Tcl_Interp *interp, char *fileName))
char *Tcl_Alloc_glue | _ANSI_ARGS_ ((unsigned int size))
void Tcl_Free_glue | _ANSI_ARGS_ ((char *ptr))
char *Tcl_Realloc_glue | _ANSI_ARGS_ ((char *ptr, unsigned int size))
int Tcl_ExprLong_glue | _ANSI_ARGS_ ((Tcl_Interp *interp, char *string, long *ptr))
char *Tcl_Concat_glue | _ANSI_ARGS_ ((int argc, char **argv))
char *Tcl_SetVar2_glue | _ANSI_ARGS_ ((Tcl_Interp *interp, char *part1, char *part2, char *newValue, int flags))
void Tcl_DStringStartSublist_glue | _ANSI_ARGS_ ((Tcl_DString *dsPtr))
void Tcl_DStringResult_glue | _ANSI_ARGS_ ((Tcl_Interp *interp, Tcl_DString *dsPtr))
char *Tcl_DStringAppendElement_glue | _ANSI_ARGS_ ((Tcl_DString *dsPtr, CONST char *string))
void TclFreeObj_glue | _ANSI_ARGS_ ((Tcl_Obj *objPtr))
void Tcl_SetObjResult_glue | _ANSI_ARGS_ ((Tcl_Interp *interp, Tcl_Obj *resultObjPtr))
Tcl_Obj *Tcl_NewStringObj_glue | _ANSI_ARGS_ ((CONST char *bytes, int length))
Tcl_Obj *Tcl_NewListObj_glue | _ANSI_ARGS_ ((int objc, Tcl_Obj *CONST objv[]))
int Tcl_ListObjAppendElement_glue | _ANSI_ARGS_ ((Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Obj *objPtr))
char *Tcl_SetVar_glue | _ANSI_ARGS_ ((Tcl_Interp *interp, char *varName, char *newValue, int flags))
void Tcl_FindExecutable_glue | _ANSI_ARGS_ ((CONST char *argv0))
int | tclCvsProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
int | tclHelpProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
int | tclCvsOutProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
int | tclCvsErrProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
int | tclCvsBrowserProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
int | tclCvsEntriesProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
void | tclCvsEntriesDeleteProc (ClientData clientData)
int | tclDirProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
int | tclCvsExitOnErrorProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
int | tclCvsLastErrorCodeProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
int | tclSafeRemove (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
int | tclGetFileModTimeProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
int | tclSetDebugMaskProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
int | tclGetDebugMaskProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
void | TclBrowserReset (void)
void | TclBrowserAppend (const char *, EntnodeData *data)
Tcl_Interp * | myTcl_CreateInterp (void)

Variables

std::vector< CTCLBrowserEnt > sTclBrowser

Define Documentation

#define __STDC__ 0

Definition at line 70 of file TclGlue.cpp.

#define __STDC__ 1

Definition at line 70 of file TclGlue.cpp.

#define _TCL_CALLBACK ( f ) f

Definition at line 205 of file TclGlue.cpp.

Referenced by CTcl_Interp::CTcl_Interp, and tclCvsEntriesProc.

#define DEC_GLUE ( f ) (*f##_glue)

Definition at line 117 of file TclGlue.cpp.

#define DECLC

Definition at line 113 of file TclGlue.cpp.

Referenced by tclCvsBrowserProc, tclCvsEntriesDeleteProc, tclCvsEntriesProc, tclCvsErrProc, tclCvsExitOnErrorProc, tclCvsLastErrorCodeProc, tclCvsOutProc, tclCvsProc, tclDirProc, tclGetDebugMaskProc, tclGetFileModTimeProc, tclHelpProc, tclSafeRemove, and tclSetDebugMaskProc.

#define GLUE_WRAP ( f ) f##_glue

Definition at line 164 of file TclGlue.cpp.

#define LOAD_CODEFRAG ( name )

Value:

if(tclAvail) \
            tclAvail = (*(void **)&name##_glue = \
                _CompatCallLibrary(connID, #name)) != 0L

#define NEW new

Definition at line 107 of file TclGlue.cpp.

Referenced by tclCvsEntriesProc.

#define Tcl_Alloc GLUE_WRAP(Tcl_Alloc)

Definition at line 172 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail.

#define Tcl_AppendResult GLUE_WRAP(Tcl_AppendResult)

Definition at line 167 of file TclGlue.cpp.

Referenced by CTCLCvsConsole::cvs_out, CTcl_Interp::IsAvail, LSReport::OnAnyDevice, LSReport::OnError, tclCvsBrowserProc, tclCvsEntriesProc, tclCvsExitOnErrorProc, tclCvsLastErrorCodeProc, tclGetDebugMaskProc, tclGetFileModTimeProc, tclHelpProc, tclSafeRemove, and tclSetDebugMaskProc.

#define Tcl_Concat GLUE_WRAP(Tcl_Concat)

Definition at line 176 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail, tclCvsBrowserProc, tclCvsExitOnErrorProc, tclGetDebugMaskProc, tclGetFileModTimeProc, and tclSetDebugMaskProc.

#define Tcl_CreateCommand GLUE_WRAP(Tcl_CreateCommand)

Definition at line 165 of file TclGlue.cpp.

Referenced by CTcl_Interp::CTcl_Interp, CTcl_Interp::IsAvail, and tclCvsEntriesProc.

#define Tcl_CreateInterp GLUE_WRAP(Tcl_CreateInterp)

Definition at line 166 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail, and myTcl_CreateInterp.

#define Tcl_DeleteInterp GLUE_WRAP(Tcl_DeleteInterp)

Definition at line 169 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail, and CTcl_Interp::~CTcl_Interp.

#define Tcl_DStringAppendElement GLUE_WRAP(Tcl_DStringAppendElement)

Definition at line 183 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail.

#define Tcl_DStringEndSublist GLUE_WRAP(Tcl_DStringEndSublist)

Definition at line 179 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail.

#define Tcl_DStringFree GLUE_WRAP(Tcl_DStringFree)

Definition at line 180 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail.

#define Tcl_DStringInit GLUE_WRAP(Tcl_DStringInit)

Definition at line 181 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail.

#define Tcl_DStringResult GLUE_WRAP(Tcl_DStringResult)

Definition at line 182 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail.

#define Tcl_DStringStartSublist GLUE_WRAP(Tcl_DStringStartSublist)

Definition at line 178 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail.

#define Tcl_Eval GLUE_WRAP(Tcl_Eval)

Definition at line 170 of file TclGlue.cpp.

Referenced by CTcl_Interp::DoScript, and CTcl_Interp::IsAvail.

#define Tcl_EvalFile GLUE_WRAP(Tcl_EvalFile)

Definition at line 171 of file TclGlue.cpp.

Referenced by CTcl_Interp::DoFile, and CTcl_Interp::IsAvail.

#define Tcl_ExprLong GLUE_WRAP(Tcl_ExprLong)

Definition at line 175 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail.

#define Tcl_FindExecutable GLUE_WRAP(Tcl_FindExecutable)

Definition at line 192 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail, and myTcl_CreateInterp.

#define Tcl_Free GLUE_WRAP(Tcl_Free)

Definition at line 173 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail, tclCvsBrowserProc, tclCvsExitOnErrorProc, tclGetDebugMaskProc, tclGetFileModTimeProc, and tclSetDebugMaskProc.

#define Tcl_Init GLUE_WRAP(Tcl_Init)

Definition at line 190 of file TclGlue.cpp.

Referenced by CTcl_Interp::CTcl_Interp, and CTcl_Interp::IsAvail.

#define Tcl_ListObjAppendElement GLUE_WRAP(Tcl_ListObjAppendElement)

Definition at line 188 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail, and tclCvsBrowserProc.

#define Tcl_NewListObj GLUE_WRAP(Tcl_NewListObj)

Definition at line 187 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail, and tclCvsBrowserProc.

#define Tcl_NewStringObj GLUE_WRAP(Tcl_NewStringObj)

Definition at line 186 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail, and tclCvsBrowserProc.

#define Tcl_Realloc GLUE_WRAP(Tcl_Realloc)

Definition at line 174 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail.

#define Tcl_SetObjResult GLUE_WRAP(Tcl_SetObjResult)

Definition at line 185 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail, and tclCvsBrowserProc.

#define Tcl_SetResult GLUE_WRAP(Tcl_SetResult)

Definition at line 168 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail.

#define Tcl_SetVar GLUE_WRAP(Tcl_SetVar)

Definition at line 191 of file TclGlue.cpp.

Referenced by CTcl_Interp::CTcl_Interp, and CTcl_Interp::IsAvail.

#define Tcl_SetVar2 GLUE_WRAP(Tcl_SetVar2)

Definition at line 177 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail, and tclCvsBrowserProc.

#define Tcl_SourceRCFile GLUE_WRAP(Tcl_SourceRCFile)

Definition at line 189 of file TclGlue.cpp.

Referenced by CTcl_Interp::CTcl_Interp, and CTcl_Interp::IsAvail.

#define TclFreeObj GLUE_WRAP(TclFreeObj)

Definition at line 184 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail.

#define UNDEF_STDC

Definition at line 57 of file TclGlue.cpp.

#define USE_TCL 1

Definition at line 40 of file TclGlue.cpp.

Function Documentation

void Tcl_FindExecutable_glue _ANSI_ARGS_ ( (CONST char *argv0) )

char* Tcl_SetVar_glue _ANSI_ARGS_ ( (Tcl_Interp *interp, char *varName, char *newValue, int flags) )

int Tcl_ListObjAppendElement_glue _ANSI_ARGS_ ( (Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Obj *objPtr) )

Tcl_Obj* Tcl_NewListObj_glue _ANSI_ARGS_ ( (int objc, Tcl_Obj *CONST objv[]) )

Tcl_Obj* Tcl_NewStringObj_glue _ANSI_ARGS_ ( (CONST char *bytes, int length) )

void Tcl_SetObjResult_glue _ANSI_ARGS_ ( (Tcl_Interp *interp, Tcl_Obj *resultObjPtr) )

void TclFreeObj_glue _ANSI_ARGS_ ( (Tcl_Obj *objPtr) )

char* Tcl_DStringAppendElement_glue _ANSI_ARGS_ ( (Tcl_DString *dsPtr, CONST char *string) )

void Tcl_DStringResult_glue _ANSI_ARGS_ ( (Tcl_Interp *interp, Tcl_DString *dsPtr) )

void Tcl_DStringInit_glue _ANSI_ARGS_ ( (Tcl_DString *dsPtr) )

char* Tcl_SetVar2_glue _ANSI_ARGS_ ( (Tcl_Interp *interp, char *part1, char *part2, char *newValue, int flags) )

char* Tcl_Concat_glue _ANSI_ARGS_ ( (int argc, char **argv) )

int Tcl_ExprLong_glue _ANSI_ARGS_ ( (Tcl_Interp *interp, char *string, long *ptr) )

char* Tcl_Realloc_glue _ANSI_ARGS_ ( (char *ptr, unsigned int size) )

void Tcl_Free_glue _ANSI_ARGS_ ( (char *ptr) )

char* Tcl_Alloc_glue _ANSI_ARGS_ ( (unsigned int size) )

int Tcl_EvalFile_glue _ANSI_ARGS_ ( (Tcl_Interp *interp, char *fileName) )

int Tcl_Eval_glue _ANSI_ARGS_ ( (Tcl_Interp *interp, char *string) )

int Tcl_Init_glue _ANSI_ARGS_ ( (Tcl_Interp *interp) )

void Tcl_SetResult_glue _ANSI_ARGS_ ( (Tcl_Interp *interp, char *string, Tcl_FreeProc *freeProc) )

void Tcl_AppendResult_glue _ANSI_ARGS_ ( TCL_VARARGS(Tcl_Interp *, interp) )

Tcl_Interp* Tcl_CreateInterp_glue _ANSI_ARGS_ ( (void) )

Tcl_Command Tcl_CreateCommand_glue _ANSI_ARGS_ ( (Tcl_Interp *interp, char *cmdName, Tcl_CmdProc *proc, ClientData clientData, Tcl_CmdDeleteProc *deleteProc) )

Tcl_Interp* myTcl_CreateInterp ( void ) [static]

Definition at line 920 of file TclGlue.cpp.

References CStr, CWincvsApp::GetAppModule, NULL, Tcl_CreateInterp, and Tcl_FindExecutable.

Referenced by CTcl_Interp::CTcl_Interp, and CTcl_Interp::IsAvail.

00921 {
00922 #   ifdef WIN32
00923     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00924     CStr path;
00925     app->GetAppModule(path);
00926     Tcl_FindExecutable(path);
00927 #   endif
00928
00929 #   ifdef qMacCvsPP
00930     CStr appPath = CMacCvsApp::GetAppPath();
00931     Tcl_FindExecutable(appPath);
00932 #   endif
00933
00934 #   if USE_TCL
00935     Tcl_Interp *res = Tcl_CreateInterp();
00936     return res;
00937 #   else
00938     return NULL;
00939 #   endif
00940 }

void TclBrowserAppend | ( | const char * | ,
 |  | EntnodeData * | data
 | ) |

Definition at line 913 of file TclGlue.cpp.

00914 {
00915 #if USE_TCL
00916     sTclBrowser.push_back(CTCLBrowserEnt(data));
00917 #endif
00918 }

void TclBrowserReset ( void )

Definition at line 903 of file TclGlue.cpp.

Referenced by cvsgui_LaunchTclMacro, UCvsFolders::OnCmdMacrosSel, and UCvsFiles::OnMacroSel.

00904 {
00905 #if USE_TCL
00906     sTclBrowser.erase(sTclBrowser.begin(), sTclBrowser.end());
00907 #endif
00908 }

int tclCvsBrowserProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 389 of file TclGlue.cpp.

References CStr, DECLC, ENT_FILE, EntnodeData::GetDesc, EntnodeData::GetType, EntnodeData::IsIgnored, EntnodeData::IsLocked, EntnodeData::IsMissing, EntnodeData::IsUnknown, EntnodeData::IsUnmodified, EntnodeFile::kConflict, EntnodeFile::kOption, EntnodeData::kStatus, EntnodeFile::kTag, EntnodeFile::kTS, EntnodeFile::kVN, Tcl_AppendResult, Tcl_Concat, TCL_ERROR, Tcl_Free, Tcl_ListObjAppendElement, Tcl_NewListObj, Tcl_NewStringObj, TCL_OK, Tcl_SetObjResult, Tcl_SetVar2, and CTcl_Interp::Unixfy.

Referenced by CTcl_Interp::CTcl_Interp, and tclCvsEntriesProc.

00390 {
00391     if(argc < 2)
00392     {
00393         Tcl_AppendResult(interp, argv[0], " : Missing arguments\n", 0L);
00394         return TCL_ERROR;
00395     }
00396
00397     std::vector<CTCLBrowserEnt> & browser = clientData != 0L ?
00398         *(std::vector<CTCLBrowserEnt> *)clientData : sTclBrowser;
00399     if(strcmp(argv[1], "get") == 0)
00400     {
00401         if(argc != 2)
00402         {
00403             char *str = Tcl_Concat(argc, argv);
00404             Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00405             Tcl_Free(str);
00406             return TCL_ERROR;
00407         }
00408
00409         Tcl_Obj *list = Tcl_NewListObj(0, 0L);
00410         std::vector<CTCLBrowserEnt>::const_iterator i;
00411         for(i = browser.begin(); i != browser.end(); ++i)
00412         {
00413             const std::vector<CTCLBrowserEnt>::const_iterator entry = i;
00414             CStr path;
00415             entry->GetData()->GetFullPathName(path);
00416             CTcl_Interp::Unixfy(path);
00417
00418             Tcl_Obj * obj = Tcl_NewStringObj(path, path.length());
00419             Tcl_ListObjAppendElement(interp, list, obj);
00420             //TclFreeObj(obj);
00421         }
00422         Tcl_SetObjResult(interp, list);
00423         //TclFreeObj(list);
00424     }
00425     else if(strcmp(argv[1], "info") == 0)
00426     {
00427         if(argc != 4)
00428         {
00429             char *str = Tcl_Concat(argc, argv);
00430             Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00431             Tcl_Free(str);
00432             return TCL_ERROR;
00433         }
00434
00435         std::vector<CTCLBrowserEnt>::const_iterator i;
00436         for(i = browser.begin(); i != browser.end(); ++i)
00437         {
00438             const std::vector<CTCLBrowserEnt>::const_iterator entry = i;
00439             if(entry->IsSamePath(argv[2]))
00440             {
00441                 EntnodeData* data = entry->GetData();
00442                 CStr path, fname, value;
00443                 entry->GetNormalized(path, fname);
00444                 char *res = Tcl_SetVar2(interp, argv[3], "name", fname, 0);
00445                 if(res == 0L)
00446                     goto err1;
00447
00448                 value = data->GetType() == ENT_FILE ? "file" : "folder";
00449                 res = Tcl_SetVar2(interp, argv[3], "kind", value, 0);
00450                 if(res == 0L)
00451                     goto err1;
00452
00453                 res = Tcl_SetVar2(interp, argv[3], "path", path, 0);
00454                 if(res == 0L)
00455                     goto err1;
00456
00457                 value = (*data)[EntnodeData::kStatus];
00458                 res = Tcl_SetVar2(interp, argv[3], "status", value, 0);
00459                 if(res == 0L)
00460                     goto err1;
00461
00462                 value = data->IsMissing() ? "1" : "0";
00463                 res = Tcl_SetVar2(interp, argv[3], "missing", value, 0);
00464                 if(res == 0L)
00465                     goto err1;
00466
00467                 value = data->IsUnknown() ? "1" : "0";
00468                 res = Tcl_SetVar2(interp, argv[3], "unknown", value, 0);
00469                 if(res == 0L)
00470                     goto err1;
00471
00472                 value = data->IsIgnored() ? "1" : "0";
00473                 res = Tcl_SetVar2(interp, argv[3], "ignored", value, 0);
00474                 if(res == 0L)
00475                     goto err1;
00476
00477                 value = data->IsLocked() ? "1" : "0";
00478                 res = Tcl_SetVar2(interp, argv[3], "locked", value, 0);
00479                 if(res == 0L)
00480                     goto err1;
00481
00482                 value = data->IsUnmodified() ? "0" : "1";
00483                 res = Tcl_SetVar2(interp, argv[3], "modified", value, 0);
00484                 if(res == 0L)
00485                     goto err1;
00486
00487                 value = data->GetDesc();
00488                 res = Tcl_SetVar2(interp, argv[3], "status", value, 0);
00489                 if(res == 0L)
00490                     goto err1;
00491
00492                 if(data->GetType() == ENT_FILE)
00493                 {
00494                     value = (*data)[EntnodeFile::kVN];
00495                     res = Tcl_SetVar2(interp, argv[3], "revision", value, 0);
00496                     if(res == 0L)
00497                         goto err1;
00498
00499                     value = (*data)[EntnodeFile::kTS];
00500                     res = Tcl_SetVar2(interp, argv[3], "timestamp", value, 0);
00501                     if(res == 0L)
00502                         goto err1;
00503
00504                     value = (*data)[EntnodeFile::kOption];
00505                     res = Tcl_SetVar2(interp, argv[3], "option", value, 0);
00506                     if(res == 0L)
00507                         goto err1;
00508
00509                     value = (*data)[EntnodeFile::kTag];
00510                     res = Tcl_SetVar2(interp, argv[3], "tag", value, 0);
00511                     if(res == 0L)
00512                         goto err1;
00513
00514                     value = (*data)[EntnodeFile::kConflict];
00515                     res = Tcl_SetVar2(interp, argv[3], "conflict", value, 0);
00516                     if(res == 0L)
00517                         goto err1;
00518                 }
00519
00520                 goto ok1;
00521 err1:
00522                 Tcl_AppendResult(interp, argv[0], " : Error while creating '", argv[3], "'\n", 0L);
00523                 return TCL_ERROR;
00524 ok1:
00525                 break;
00526             }
00527         }
00528     }
00529     else
00530     {
00531         char *str = Tcl_Concat(argc, argv);
00532         Tcl_AppendResult(interp, argv[0], " : Wrong arguments : '", str, "'\n", 0L);
00533         Tcl_Free(str);
00534         return TCL_ERROR;
00535     }
00536     return TCL_OK;
00537 }

void tclCvsEntriesDeleteProc ( ClientData clientData ) [static]

Definition at line 610 of file TclGlue.cpp.

References DECLC.

Referenced by tclCvsEntriesProc.

00611 {
00612     if(clientData != 0L)
00613         delete (std::vector<CTCLBrowserEnt> *)clientData;
00614 }

int tclCvsEntriesProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 616 of file TclGlue.cpp.

References _TCL_CALLBACK, ENTNODE::Compare, CStr, ENTNODE::Data, DECLC, CTcl_Interp::Deunixfy, Entries_SetMissing, FileTraverse, CSortList::Get, NEW, CSortList::NumOfElements, Tcl_AppendResult, Tcl_CreateCommand, TCL_ERROR, TCL_OK, tclCvsBrowserProc, and tclCvsEntriesDeleteProc.

Referenced by CTcl_Interp::CTcl_Interp.

00617 {
00618     if(argc != 3)
00619     {
00620         Tcl_AppendResult(interp, argv[0], " : Wrong # of arguments\n", 0L);
00621         return TCL_ERROR;
00622     }
00623
00624     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00625
00626     // refetch all items
00627     CFillTclEntries traverse(entries);
00628     CStr path(argv[1]);
00629     CTcl_Interp::Deunixfy(path);
00630     /*kTraversal res = */FileTraverse(path, traverse);
00631
00632     // add the missing files
00633     Entries_SetMissing(entries);
00634
00635     // now make the TCL entries
00636     std::vector<CTCLBrowserEnt> *browser = NEW std::vector<CTCLBrowserEnt>;
00637
00638     int numEntries = entries.NumOfElements();
00639     for(int i = 0; i < numEntries; i++)
00640     {
00641         const ENTNODE & theNode = entries.Get(i);
00642         EntnodeData *data = theNode.Data();
00643         browser->push_back(CTCLBrowserEnt(data));
00644     }
00645
00646     Tcl_Command cmd = Tcl_CreateCommand (interp, argv[2], _TCL_CALLBACK(tclCvsBrowserProc),
00647         (ClientData)browser, tclCvsEntriesDeleteProc);
00648
00649     return cmd != 0L ? TCL_OK : TCL_ERROR;
00650 }

int tclCvsErrProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 380 of file TclGlue.cpp.

References cvs_errstr, DECLC, and TCL_OK.

Referenced by CTcl_Interp::CTcl_Interp.

00381 {
00382     for(int i = 1; i < argc; i++)
00383     {
00384         cvs_errstr(argv[i], strlen(argv[i]));
00385     }
00386     return TCL_OK;
00387 }

int tclCvsExitOnErrorProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 724 of file TclGlue.cpp.

References DECLC, CTcl_Interp::SetCvsExitOnError, Tcl_AppendResult, Tcl_Concat, TCL_ERROR, Tcl_Free, and TCL_OK.

Referenced by CTcl_Interp::CTcl_Interp.

00725 {
00726     CTcl_Interp *tcl_interp = (CTcl_Interp*) clientData;
00727
00728     //
00729     // CvsExitOnError command can be used to define whether TCL macro
00730     // is automatically terminated if CVS command returned error (non zero).
00731     //
00732     // CvsExitOnError has following modes:
00733     //   false  = Do not exit automaticaly. CvsLastErrorCode constains the last error code.
00734     //   true   = Exit TCL script in error (default).
00735     //
00736     if(argc < 2)
00737     {
00738         Tcl_AppendResult(interp, argv[0], " : Missing argument (true|false)\n", 0L);
00739         return TCL_ERROR;
00740     }
00741
00742     if(strcmp(argv[1], "true") == 0)
00743         tcl_interp->SetCvsExitOnError(true);
00744     else if(strcmp(argv[1], "false") == 0)
00745         tcl_interp->SetCvsExitOnError(false);
00746     else
00747     {
00748         char *str = Tcl_Concat(argc, argv);
00749         Tcl_AppendResult(interp, argv[0], " : Wrong argument : '", str, "'\n", 0L);
00750         Tcl_Free(str);
00751
00752         return TCL_ERROR;
00753     }
00754
00755     return TCL_OK;
00756 }

int tclCvsLastErrorCodeProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 758 of file TclGlue.cpp.

References DECLC, CTcl_Interp::GetCvsLastErrorCode, CTcl_Interp::SetCvsLastErrorCode, Tcl_AppendResult, and TCL_OK.

Referenced by CTcl_Interp::CTcl_Interp.

00759 {
00760     CTcl_Interp *tcl_interp = (CTcl_Interp*) clientData;
00761
00762     if(argc < 2)
00763     {
00764         char value[35];
00765
00766         // CvsLastErrorCode called without arguments, so return current value
00767         sprintf(value, "%d", tcl_interp->GetCvsLastErrorCode());
00768         Tcl_AppendResult(interp, value, 0L);
00769     }
00770     else
00771     {
00772         // Set the value of LastErrorCode variable
00773         tcl_interp->SetCvsLastErrorCode(atoi(argv[1]));
00774     }
00775
00776     return TCL_OK;
00777 }

int tclCvsOutProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 371 of file TclGlue.cpp.

References cvs_outstr, DECLC, and TCL_OK.

Referenced by CTcl_Interp::CTcl_Interp.

00372 {
00373     for(int i = 1; i < argc; i++)
00374     {
00375         cvs_outstr(argv[i], strlen(argv[i]));
00376     }
00377     return TCL_OK;
00378 }

int tclCvsProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 327 of file TclGlue.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, DECLC, CTcl_Interp::GetCvsExitOnError, launchCVS, CTcl_Interp::SetCvsLastErrorCode, TCL_ERROR, and TCL_OK.

Referenced by CTcl_Interp::CTcl_Interp.

00328 {
00329     CTcl_Interp *tcl_interp = (CTcl_Interp*) clientData;
00330     CvsArgs args;
00331
00332     for(int i = 1; i < argc; i++)
00333     {
00334         args.add(argv[i]);
00335     }
00336
00337     CTCLCvsConsole console(interp);
00338     int exitc = launchCVS(0L, args.Argc(), args.Argv(), &console);
00339
00340     //
00341     // Set CvsLastErrorCode value. TCL script can query
00342     // this value using cvslasterrorcode command
00343     //
00344     tcl_interp->SetCvsLastErrorCode(exitc);
00345
00346     //
00347     // If command succeeded then return always TCL_OK and
00348     // proceed with script. If command failed (exitc != 0)
00349     // then exit only if CvsExitOnError is TRUE.
00350     //
00351     if(exitc == 0)
00352         return TCL_OK;
00353     else
00354         return tcl_interp->GetCvsExitOnError() ? TCL_ERROR : TCL_OK;
00355 }

int tclDirProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 693 of file TclGlue.cpp.

References DECLC, FileTraverse, LSReport::fState, and kTraversal.

Referenced by CTcl_Interp::CTcl_Interp.

00694 {
00695     LSReport report(interp);
00696     char path[256];
00697     getcwd(path, 256);
00698     kTraversal res = FileTraverse(path, report);
00699     return report.fState;
00700 }

int tclGetDebugMaskProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 866 of file TclGlue.cpp.

References DECLC, GetWinCvsDebugMask, GetWinCvsDebugMaskBit, NULL, Tcl_AppendResult, Tcl_Concat, TCL_ERROR, Tcl_Free, and TCL_OK.

Referenced by CTcl_Interp::CTcl_Interp.

00867 {
00868     char retstr[32];
00869     if (argc < 2)
00870     {
00871         _snprintf(retstr,32,"%u",GetWinCvsDebugMask());
00872         Tcl_AppendResult(interp, retstr, 0L);
00873         return TCL_OK;
00874     }
00875
00876     if (argc > 3)
00877     {
00878         char * str = Tcl_Concat(argc, argv);
00879         Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00880         Tcl_Free(str);
00881         return TCL_ERROR;
00882     }
00883
00884     char * endc = NULL;
00885     unsigned long n;
00886
00887     n = strtoul(argv[1], & endc, 0);
00888     if (*endc)
00889     {
00890         Tcl_AppendResult(interp, argv[0], " : Could not understand argument '", argv[1], "'\n", 0L);
00891         return TCL_ERROR;
00892     }
00893
00894     _snprintf(retstr, 32, "%u", GetWinCvsDebugMaskBit(n));
00895     Tcl_AppendResult(interp, retstr, 0L);
00896
00897     return TCL_OK;
00898 }

int tclGetFileModTimeProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 780 of file TclGlue.cpp.

References DECLC, NULL, wnt_stat::st_mtime, Tcl_AppendResult, Tcl_Concat, TCL_ERROR, Tcl_Free, TCL_OK, and wnt_stat.

Referenced by CTcl_Interp::CTcl_Interp.

00781 {
00782     struct wnt_stat sb;
00783     struct tm * p_utc = NULL;
00784
00785     if (argc < 2)
00786     {
00787         Tcl_AppendResult(interp, argv[0], " : Missing argument (int)\n", 0L);
00788         return TCL_ERROR;
00789     }
00790
00791     if (argc > 2)
00792     {
00793         char * str = Tcl_Concat(argc, argv);
00794         Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00795         Tcl_Free(str);
00796         return TCL_ERROR;
00797     }
00798
00799     if (wnt_stat(argv[1], &sb) != 0)
00800     {
00801         Tcl_AppendResult(interp, argv[0], " : Could not find file : '", argv[1], "'\n", 0L);
00802         return TCL_ERROR;
00803     }
00804
00805     p_utc = gmtime(& sb.st_mtime);
00806     Tcl_AppendResult(interp, asctime(p_utc), 0L);
00807     return TCL_OK;
00808 }

int tclHelpProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 357 of file TclGlue.cpp.

References DECLC, Tcl_AppendResult, and TCL_OK.

Referenced by CTcl_Interp::CTcl_Interp.

00358 {
00359     Tcl_AppendResult(interp, "Help :\n", 0L);
00360     Tcl_AppendResult(interp, "   cvs  : the cvs tool.\n", 0L);
00361     Tcl_AppendResult(interp, "   help : this help.\n", 0L);
00362     Tcl_AppendResult(interp, "Others commands :\n", 0L);
00363     Tcl_AppendResult(interp, "   cd   : change directory\n", 0L);
00364     Tcl_AppendResult(interp, "   pwd  : print current directory\n", 0L);
00365     Tcl_AppendResult(interp, "   ls   : list the current directory\n", 0L);
00366     Tcl_AppendResult(interp, "   info ?  : misc. informations\n", 0L);
00367     Tcl_AppendResult(interp, "   info commands : all the TCL commands\n", 0L);
00368     return TCL_OK;
00369 }

int tclSafeRemove | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 703 of file TclGlue.cpp.

References CompatMoveToTrash, CStr, cvs_err, DECLC, CTcl_Interp::Deunixfy, Tcl_AppendResult, TCL_ERROR, and TCL_OK.

Referenced by CTcl_Interp::CTcl_Interp.

00704 {
00705     if(argc < 2)
00706     {
00707         Tcl_AppendResult(interp, argv[0], " : Missing list of files\n", 0L);
00708         return TCL_ERROR;
00709     }
00710
00711     for(int i = 1; i < argc; i++)
00712     {
00713         CStr fn(argv[i]);
00714         CTcl_Interp::Deunixfy(fn);
00715         if(!CompatMoveToTrash(fn, 0))  // dir is not needed, TCL profides fully qualified file name
00716         {
00717             cvs_err("Unable to trash '%s'\n", (char *)fn);
00718         }
00719     }
00720
00721     return TCL_OK;
00722 }

int tclSetDebugMaskProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 810 of file TclGlue.cpp.

References DECLC, NULL, SetWinCvsDebugMask, SetWinCvsDebugMaskBit, stricmp, Tcl_AppendResult, Tcl_Concat, TCL_ERROR, Tcl_Free, and TCL_OK.

Referenced by CTcl_Interp::CTcl_Interp.

00811 {
00812     if (argc < 2)
00813     {
00814         Tcl_AppendResult(interp, argv[0], " : Missing argument (int)\n", 0L);
00815         return TCL_ERROR;
00816     }
00817
00818     if (argc > 3)
00819     {
00820         char * str = Tcl_Concat(argc, argv);
00821         Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00822         Tcl_Free(str);
00823         return TCL_ERROR;
00824     }
00825
00826     char * endc = NULL;
00827     unsigned long n;
00828     bool b;
00829
00830     n = strtoul(argv[1], & endc, 0);
00831     if (*endc)
00832     {
00833         Tcl_AppendResult(interp, argv[0], " : Could not understand argument '", argv[1], "'\n", 0L);
00834         return TCL_ERROR;
00835     }
00836
00837     if (argc == 2)
00838     {
00839         SetWinCvsDebugMask(n);
00840         return TCL_OK;
00841     }
00842
00843
00844     if (!stricmp(argv[2], "true"))
00845     {
00846         b = true;
00847     }
00848     else if (!stricmp(argv[2], "false"))
00849     {
00850         b = false;
00851     }
00852     else
00853     {
00854         b = strtoul(argv[2], & endc, 0) != 0;
00855         if (*endc)
00856         {
00857             Tcl_AppendResult(interp, argv[0], " : Could not understand argument '", argv[2], "'\n", 0L);
00858             return TCL_ERROR;
00859         }
00860     }
00861
00862     SetWinCvsDebugMaskBit(n,b);
00863     return TCL_OK;
00864 }

Variable Documentation

std::vector<CTCLBrowserEnt> sTclBrowser [static]

Definition at line 281 of file TclGlue.cpp.

Generated on Sun Feb 24 01:22:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TclGlue.h File Reference

common/TclGlue.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CTcl_Interp

Defines

#define | TCL_OK 0
#define | TCL_ERROR 1
#define | TCL_RETURN 2
#define | TCL_BREAK 3
#define | TCL_CONTINUE 4
#define | kTCLPathDelimiter '/'

Typedefs

typedef int | kTclRes

Functions

void | TclBrowserReset (void)
void | TclBrowserAppend (const char *path, EntnodeData *data)

Define Documentation

#define kTCLPathDelimiter '/'

Definition at line 42 of file TclGlue.h.

Referenced by CTcl_Interp::Deunixfy, and CTcl_Interp::Unixfy.

#define TCL_BREAK 3

Definition at line 35 of file TclGlue.h.

#define TCL_CONTINUE 4

Definition at line 36 of file TclGlue.h.

#define TCL_ERROR 1

Definition at line 33 of file TclGlue.h.

Referenced by CTcl_Interp::DoFile, CTcl_Interp::DoScript, LSReport::OnError, tclCvsBrowserProc, tclCvsEntriesProc, tclCvsExitOnErrorProc, tclCvsProc, tclGetDebugMaskProc, tclGetFileModTimeProc, tclSafeRemove, and tclSetDebugMaskProc.

#define TCL_OK 0

Definition at line 32 of file TclGlue.h.

Referenced by LSReport::LSReport, tclCvsBrowserProc, tclCvsEntriesProc, tclCvsErrProc, tclCvsExitOnErrorProc, tclCvsLastErrorCodeProc, tclCvsOutProc, tclCvsProc, tclGetDebugMaskProc, tclGetFileModTimeProc, tclHelpProc, tclSafeRemove, and tclSetDebugMaskProc.

#define TCL_RETURN 2

Definition at line 34 of file TclGlue.h.

Typedef Documentation

typedef int kTclRes

Definition at line 39 of file TclGlue.h.

Referenced by CTcl_Interp::DoFile, CTcl_Interp::DoScript, and CTcl_Interp::DoScriptVar.

Function Documentation

void TclBrowserAppend | ( | const char * | path,
 |  | EntnodeData * | data
 | ) |

Definition at line 913 of file TclGlue.cpp.

Referenced by cvsgui_LaunchTclMacro, UCvsFolders::OnCmdMacrosSel, and UCvsFiles::OnMacroSel.

00914 {
00915 #if USE_TCL
00916     sTclBrowser.push_back(CTCLBrowserEnt(data));
00917 #endif
00918 }

void TclBrowserReset ( void )

Definition at line 903 of file TclGlue.cpp.

00904 {
00905 #if USE_TCL
00906     sTclBrowser.erase(sTclBrowser.begin(), sTclBrowser.end());
00907 #endif
00908 }

Generated on Sun Feb 24 01:22:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TclGlue.mac.cpp File Reference

common/TclGlue.mac.cpp File Reference

#include "stdafx.h"

Include dependency graph for TclGlue.mac.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:22:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TclGlue.mac.h File Reference

common/TclGlue.mac.h File Reference

#include "dll_loader.h"

Include dependency graph for TclGlue.mac.h:

Include dependency graph

Go to the source code of this file.

Functions

int | CarbonCompatLoadLibrary (CompatConnectID *connID, const char *name_dll)
int | CarbonCompatCloseLibrary (CompatConnectID *connID)
void * | _CarbonCompatCallLibrary (CompatConnectID connID, const char *name_func)
void * | _tcl_cfm_macho (void *func)

Function Documentation

void* _CarbonCompatCallLibrary | ( | CompatConnectID | connID,
 |  | const char * | name_func
 | ) |

void* _tcl_cfm_macho ( void * func )

int CarbonCompatCloseLibrary ( CompatConnectID * connID )

int CarbonCompatLoadLibrary | ( | CompatConnectID * | connID,
 |  | const char * | name_dll
 | ) |

Generated on Sun Feb 24 01:22:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TextBinary.cpp File Reference

common/TextBinary.cpp File Reference

#include "stdafx.h"
#include <sys/stat.h>
#include <direct.h>
#include <io.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include "TextBinary.h"
#include "FileTraversal.h"
#include "AppConsole.h"
#include "CPStr.h"
#include "CvsPrefs.h"

Include dependency graph for TextBinary.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | MAX_TEST_SIZE 100000

Functions

kTextBinTYPE | FillBuffer (const char *arg, const char *dir, const FSSpec *spec, bool bin)
kTextBinTYPE | TestBuffer (const char *arg, const char *dir, const FSSpec *spec, kFileType expectType)
kTextBinTYPE | TestValidName (const char *filename)
kTextBinTYPE | TestFileIsAlias (const char *arg, const char *dir, const FSSpec *spec)
kTextBinTYPE | FileIsText (const char *arg, const char *dir, const FSSpec *spec)
kTextBinTYPE | FileIsBinary (const char *arg, const char *dir, const FSSpec *spec)
kTextBinTYPE | FileIsUnicode (const char *arg, const char *dir, const FSSpec *spec)
bool | SplitPath (const char *dir, UStr &uppath, UStr &folder)
void | GetExtension (const char *file, UStr &base, UStr &ext)
bool | MakeTmpFile (UStr &file, const char *prefix, const char *extension, bool create)
bool | GetEnvValue (const char *cmd, const char *key, UStr &value)
int | StringToArgv (const char *cmdLine, char **argv)

Variables

CStaticAllocT< char > | sBuf
int | sBufSize

Define Documentation

#define MAX_TEST_SIZE 100000

Definition at line 64 of file TextBinary.cpp.

Referenced by FillBuffer.

Function Documentation

kTextBinTYPE FileIsBinary | ( | const char * | arg,
 |  | const char * | dir,
 |  | const FSSpec * | spec
 | ) |

Definition at line 373 of file TextBinary.cpp.

References FillBuffer, kBinIsText, kFileIsOK, kFileTypeBin, kTextBinTYPE, TestBuffer, TestFileIsAlias, TestValidName, and UFSSpec.

00374 {
00375     kTextBinTYPE state;
00376
00377     state = FillBuffer(arg, dir, spec, true);
00378     if(state != kFileIsOK)
00379         return state;
00380
00381     state = TestBuffer(arg, dir, spec, kFileTypeBin);
00382
00383 #ifdef macintosh
00384     kTextBinTYPE sigstate = GetMacSig(arg, dir, spec, true);
00385     if(sigstate != kFileIsOK)
00386         return state;
00387     if(state != kFileIsOK && state != kBinIsText)
00388         return state;
00389 #else /* !macintosh */
00390     if(state != kFileIsOK)
00391         return state;
00392 #endif /* !macintosh */
00393
00394     state = TestValidName(arg);
00395     if(state != kFileIsOK)
00396         return state;
00397
00398     state = TestFileIsAlias(arg, dir, spec);
00399     if(state != kFileIsOK)
00400         return state;
00401
00402     return kFileIsOK;
00403 }

kTextBinTYPE FileIsText | ( | const char * | arg,
 |  | const char * | dir,
 |  | const FSSpec * | spec
 | ) |

Definition at line 341 of file TextBinary.cpp.

References FillBuffer, kFileIsOK, kFileTypeText, kTextBinTYPE, sBufSize, TestBuffer, TestFileIsAlias, TestValidName, and UFSSpec.

00342 {
00343     kTextBinTYPE state;
00344
00345 #ifdef macintosh
00346     state = GetMacSig(arg, dir, spec, false);
00347     if(state != kFileIsOK)
00348         return state;
00349 #endif /* macintosh */
00350
00351     state = FillBuffer(arg, dir, spec, false);
00352     if(state != kFileIsOK)
00353         return state;
00354
00355     if(sBufSize == 0)
00356         return kFileIsOK;
00357
00358     state = TestBuffer(arg, dir, spec, kFileTypeText);
00359     if(state != kFileIsOK)
00360         return state;
00361
00362     state = TestValidName(arg);
00363     if(state != kFileIsOK)
00364         return state;
00365
00366     state = TestFileIsAlias(arg, dir, spec);
00367     if(state != kFileIsOK)
00368         return state;
00369
00370     return kFileIsOK;
00371 }

kTextBinTYPE FileIsUnicode | ( | const char * | arg,
 |  | const char * | dir,
 |  | const FSSpec * | spec
 | ) |

Definition at line 405 of file TextBinary.cpp.

References FillBuffer, kBinIsText, kFileIsOK, kFileTypeUnicode, kTextBinTYPE, TestBuffer, TestFileIsAlias, TestValidName, and UFSSpec.

00406 {
00407     kTextBinTYPE state;
00408
00409     state = FillBuffer(arg, dir, spec, true);
00410     if(state != kFileIsOK)
00411         return state;
00412
00413     state = TestBuffer(arg, dir, spec, kFileTypeUnicode);
00414
00415 #ifdef macintosh
00416     kTextBinTYPE sigstate = GetMacSig(arg, dir, spec, true);
00417     if(sigstate != kFileIsOK)
00418         return state;
00419     if(state != kFileIsOK && state != kBinIsText)
00420         return state;
00421 #else /* !macintosh */
00422     if(state != kFileIsOK)
00423         return state;
00424 #endif /* !macintosh */
00425
00426     state = TestValidName(arg);
00427     if(state != kFileIsOK)
00428         return state;
00429
00430     state = TestFileIsAlias(arg, dir, spec);
00431     if(state != kFileIsOK)
00432         return state;
00433
00434     return kFileIsOK;
00435 }

kTextBinTYPE FillBuffer | ( | const char * | arg,
 |  | const char * | dir,
 |  | const FSSpec * | spec,
 |  | bool | bin
 | ) | [static]

Definition at line 77 of file TextBinary.cpp.

References CStaticAllocT::AdjustSize, cvs_err, kFileIsOK, kFileMissing, kTextBinTYPE, MAX_TEST_SIZE, sBufSize, and UFSSpec.

Referenced by FileIsBinary, FileIsText, and FileIsUnicode.

00078 {
00079     sBuf.AdjustSize(MAX_TEST_SIZE);
00080
00081     if(chdir(dir) != 0)
00082     {
00083         cvs_err("Unable to chdir to ""%s"" (error %d)\n", dir, errno);
00084         return kFileMissing;
00085     }
00086
00087     FILE *samp = fopen(arg, bin ? "rb" : "r");
00088     if(samp == 0L)
00089     {
00090         return kFileMissing;
00091     }
00092
00093     sBufSize = fread(sBuf, sizeof(char), MAX_TEST_SIZE, samp);
00094     if(sBufSize < 0)
00095     {
00096         cvs_err("Unable to read ""%s"" (error %d)\n", arg, errno);
00097         return kFileMissing;
00098     }
00099
00100     fclose(samp);
00101     return kFileIsOK;
00102 }

bool GetEnvValue | ( | const char * | cmd,
 |  | const char * | key,
 |  | UStr & | value
 | ) |

Definition at line 576 of file TextBinary.cpp.

References UStr::set.

00577 {
00578     const char *tmp = strstr(cmd, key);
00579     if(tmp == 0L)
00580         return false;
00581     tmp = strchr(tmp, '=');
00582     if(tmp == 0L)
00583         return false;
00584     tmp++;
00585     const char *tmp2 = strchr(tmp, '&');
00586     if(tmp2 == 0L)
00587         value = tmp;
00588     else
00589         value.set(tmp, tmp2 - tmp);
00590     return true;
00591 }

void GetExtension | ( | const char * | file,
 |  | UStr & | base,
 |  | UStr & | ext
 | ) |

Definition at line 464 of file TextBinary.cpp.

References CStr.

00465 {
00466     char *tmp = strrchr(file, '.');
00467     if(tmp == 0L)
00468     {
00469         ext = "";
00470         base = file;
00471     }
00472     else
00473     {
00474         ext = tmp + 1;
00475         base = file;
00476         base[tmp - file] = '\0';
00477     }
00478 }

bool MakeTmpFile | ( | UStr & | file,
 |  | const char * | prefix,
 |  | const char * | extension,
 |  | bool | create
 | ) |

Definition at line 480 of file TextBinary.cpp.

References CStr, cvs_err, err, getenv, MacGetTempFolder, stat, and UFSSpec.

00481 {
00482     static int count = 0;
00483     char filename[256];
00484
00485     CStr tmpPath;
00486     CStr ext;
00487     CStr prf;
00488
00489     if(extension != 0L && extension[0] != '\0')
00490     {
00491         if(extension[0] != '.')
00492             ext = ".";
00493         ext << extension;
00494     }
00495
00496     if(prefix != 0L && prefix[0] != '\0')
00497     {
00498         prf = prefix;
00499     }
00500     else
00501         prf = "cvsgui";
00502
00503 #ifdef WIN32
00504     char *ptr;
00505     ptr = getenv(_T("TMP"));
00506     if (ptr != 0L && _access( ptr, 0 ) != -1 )
00507         tmpPath = ptr;
00508     else
00509         tmpPath = ".";
00510 #endif /* !WIN32 */
00511 #ifdef macintosh
00512     UFSSpec theFolder;
00513     OSErr err;
00514
00515     if((err = MacGetTempFolder(theFolder, tmpPath)) != noErr)
00516     {
00517         cvs_err("Unable to locate the preferences folder (error %d) !\n", err);
00518         return 0L;
00519     }
00520
00521     for (;;) {
00522         sprintf(filename, "%s%d%s", (const char *)prf, count, (const char *)ext);
00523         if (::strlen (filename) <= 31) break;
00524
00525         if (prf.length () == 0) {
00526             cvs_err("Unable to truncate temp file !\n");
00527             return 0L;
00528             } // if
00529
00530         prf.set (prf, prf.length () - 1);
00531         } // for
00532 #endif /* !macintosh */
00533 #if qUnix
00534     tmpPath = "/tmp";
00535 #endif
00536
00537     struct stat sb;
00538     if (stat(tmpPath, &sb) == -1 || !S_ISDIR(sb.st_mode))
00539     {
00540         cvs_err("Unable to access '%s' (error %d) !\n", (const char *)tmpPath, errno);
00541         return false;
00542     }
00543
00544     if(!tmpPath.endsWith(kPathDelimiter))
00545         tmpPath << kPathDelimiter;
00546
00547     int maxtry = 10000;
00548     while(1)
00549     {
00550         sprintf(filename, "%s%d%s", (const char *)prf, count++, (const char *)ext);
00551         file = tmpPath;
00552         file << filename;
00553         if (stat(file, &sb) == -1 && errno == ENOENT)
00554         {
00555             if( create )
00556             {
00557                 FILE* stream = fopen(file, "w");
00558                 if( stream )
00559                 {
00560                     fclose(stream);
00561                 }
00562             }
00563             return true;
00564         }
00565
00566         if(maxtry-- == 0)
00567         {
00568             cvs_err("Time out to access '%s' !\n", (const char *)tmpPath);
00569             break;
00570         }
00571     }
00572
00573     return false;
00574 }

bool SplitPath | ( | const char * | dir,
 |  | UStr & | uppath,
 |  | UStr & | folder
 | ) |

Definition at line 437 of file TextBinary.cpp.

References CStr.

00438 {
00439     char newdir[512];
00440     char olddir[512];
00441     char newfile[256];
00442     int lendir = strlen(dir);
00443     strcpy(olddir, dir);
00444     if(dir[lendir - 1] == kPathDelimiter)
00445     {
00446         olddir[lendir - 1] = '\0';
00447         --lendir;
00448     }
00449     const char *tmp = olddir, *prev = olddir;
00450
00451     while((tmp = strchr(tmp, kPathDelimiter)) != 0L)
00452         prev = ++tmp;
00453
00454     strcpy(newdir, olddir);
00455     newdir[prev - olddir] = '\0';
00456     strcpy(newfile, prev);
00457
00458     uppath = newdir;
00459     folder = newfile;
00460
00461     return true;
00462 }

int StringToArgv | ( | const char * | cmdLine,
 |  | char ** | argv
 | ) |

Definition at line 593 of file TextBinary.cpp.

References MAX_ARGS, and MAX_CMD_LEN.

00594 {
00595     int argc = 0;
00596
00597     char    Quote = '\0';               /*  Contains the quote character if we are
00598                                             inside "" or '', or \0 otherwise */
00599     const char* walker1 = cmdLine;      /*  walker1 traverses the original
00600                                             command line */
00601     char*   walker2;                    /*  walker2 traverses the parsed copy of
00602                                             the command line */
00603     char    theChar;                    /*  theChar is the character we are currently
00604                                             parsing */
00605     char    arguments [MAX_CMD_LEN];            /*  will contain a parsed copy of the
00606                                             command line */
00607
00608     walker2 = arguments;                                        /*  copy into arguments */
00609     while ((theChar = *walker1++) != '\0') {                    /*  parse command line to \0 */
00610         if (theChar == ' ')                                     /*  skip leading space before an argument */
00611             continue;
00612         argv [argc++] = walker2;                                /*  set argv to point to the space
00613                                                                     where we copy the next argument */
00614         if (argc > MAX_ARGS) {                                  /*  if we filled argv, skip the rest */
00615             argc--;
00616             break;
00617         }
00618         do {                                                    /*  parse an argument */
00619             if (theChar == '\\' && *walker1++)                  /*  skip \s */
00620                 theChar = *walker1++;
00621             else
00622                 if ((theChar == '"') || (theChar == '\'')) {    /*  when we find a quote... */
00623                     if (Quote == '\0') {                        /*  if we are not inside quotes already, */
00624                         Quote = theChar;                        /*  remember we are inside quotes now */
00625                         continue;                               /*  go to the next character */
00626                     }
00627                     if (theChar == Quote) {                     /*  if we are already inside that kind of quotes */
00628                         Quote = '\0';                           /*  close quotes */
00629                         continue;                               /*  go to the next character */
00630                     }
00631                 }
00632             *walker2++ = theChar;                               /*  copy the character into args */
00633                                                                 /*  repeat until we reach the end of arguments
00634                                                                     or we reach a space that is not inside quotes */
00635         } while ((*walker1 != '\0') && (((theChar = *walker1++) != ' ') || (Quote != '\0')));
00636         *walker2++ = 0;                                         /* null-terminate the last argument */
00637     }
00638
00639     return argc;
00640 }

kTextBinTYPE TestBuffer | ( | const char * | arg,
 |  | const char * | dir,
 |  | const FSSpec * | spec,
 |  | kFileType | expectType
 | ) | [static]

Definition at line 104 of file TextBinary.cpp.

References ASSERT, FALSE, kBinIsText, kBinIsUnicode, kFileIsOK, kFileType, kFileTypeBin, kFileTypeText, kFileTypeUnicode, kTextBinTYPE, kTextEscapeChar, kTextIsBinary, kTextIsUnicode, kTextWrongLF, kUnicodeIsBinary, kUnicodeIsText, kWin32, NULL, sBufSize, and UFSSpec.

Referenced by FileIsBinary, FileIsText, and FileIsUnicode.

00105 {
00106     if(sBufSize == 0)
00107         return kFileIsOK;
00108
00109     bool isUnicode = false;
00110 #ifdef WIN32
00111     isUnicode = gCvsPrefs.WhichVersion() == kWin32 ? false : IsTextUnicode(sBuf, sBufSize, NULL);
00112 #endif /* WIN32 */
00113
00114     // Windows : fread skips the \r, so we don't care.
00115     // Mac : MSL exchanges when reading the \r and \n,
00116     // so we look for \n
00117     // Others : default to \n
00118
00119     const unsigned char nativeNL = '\n';
00120     const unsigned char nonnativeNL = '\r';
00121
00122     float percent = 0;
00123     int numBinChars = 0;
00124     int numTextChars = 0;
00125
00126     if( !isUnicode )
00127     {
00128         // figure if it is binary
00129         int i;
00130         unsigned char c;
00131         char *tmp;
00132
00133         for(tmp = sBuf, i = 0; i < sBufSize; i++)
00134         {
00135             c = (unsigned char)*tmp++;
00136             if((c < 0x20 && c != nativeNL && c != nonnativeNL && c != '\t') || (c >= 0x80
00137 #ifdef macintosh
00138                 && c != (unsigned char)'Ñ' && c != (unsigned char)'¥' /* powerplant */
00139 #endif /* macintosh */
00140                 ))
00141                 numBinChars++;
00142             else
00143                 numTextChars++;
00144         }
00145
00146         percent = (float)numBinChars / (float)sBufSize;
00147     }
00148
00149     // more than 5% binary makes binary
00150     bool isbin = percent >= 0.05;
00151
00152     switch( expectType )
00153     {
00154     case kFileTypeText:
00155         if( isUnicode )
00156         {
00157             return kTextIsUnicode;
00158         }
00159         else if( isbin )
00160         {
00161             return kTextIsBinary;
00162         }
00163         break;
00164     case kFileTypeBin:
00165         if( isUnicode )
00166         {
00167             return kBinIsUnicode;
00168         }
00169         else if( !isbin )
00170         {
00171             return kBinIsText;
00172         }
00173         break;
00174     case kFileTypeUnicode:
00175         if( !isUnicode )
00176         {
00177             return isbin ? kUnicodeIsBinary : kUnicodeIsText;
00178         }
00179         break;
00180     default:
00181 #ifdef WIN32
00182         ASSERT(FALSE); // uknown type
00183 #endif
00184         break;
00185     }
00186
00187     // for the text files, check if the new lines are good
00188     if(kFileTypeText == expectType)
00189     {
00190         int i;
00191         unsigned char c;
00192         char *tmp;
00193         int numNonNative = 0, numNative = 0;
00194         for(tmp = sBuf, i = 0; i < sBufSize; i++)
00195         {
00196             c = (unsigned char)*tmp++;
00197             if(c == nonnativeNL)
00198                 numNonNative++;
00199             else if(c == nativeNL)
00200                 numNative++;
00201         }
00202         if(numNative == 0)
00203         {
00204             if(numNonNative > 0)
00205                 return kTextWrongLF;
00206         }
00207         else
00208         {
00209             percent = (float)numNonNative / (float)numNative;
00210             if(percent >= 0.1)
00211                 return kTextWrongLF;
00212         }
00213
00214         if(numBinChars > 0)
00215             return kTextEscapeChar;
00216     }
00217
00218     return kFileIsOK;
00219 }

kTextBinTYPE TestFileIsAlias | ( | const char * | arg,
 |  | const char * | dir,
 |  | const FSSpec * | spec
 | ) | [static]

Definition at line 319 of file TextBinary.cpp.

References CPStr, kFileIsAlias, kFileIsOK, kFileMissing, kTextBinTYPE, stat, and UFSSpec.

Referenced by FileIsBinary, FileIsText, and FileIsUnicode.

00320 {
00321     kTextBinTYPE result = kFileIsOK;
00322
00323 #ifdef S_ISLNK
00324     CPStr fullname;
00325     struct stat sb;
00326
00327     fullname = dir;
00328     if(!fullname.endsWith(kPathDelimiter))
00329         fullname << kPathDelimiter;
00330     fullname << arg;
00331
00332     if (stat(fullname, &sb) == -1)
00333         result = kFileMissing;
00334     else if(S_ISLNK(sb.st_mode))
00335         result = kFileIsAlias;
00336 #endif /* S_ISLNK */
00337
00338     return result;
00339 }

kTextBinTYPE TestValidName ( const char * filename ) [static]

Definition at line 298 of file TextBinary.cpp.

References kFileInvalidName, kFileIsOK, kTextBinTYPE, and stricmp.

Referenced by FileIsBinary, FileIsText, and FileIsUnicode.

00299 {
00300     kTextBinTYPE result = kFileIsOK;
00301
00302     if(strchr(filename, '/') != 0L)
00303         result = kFileInvalidName;
00304     if(strchr(filename, '\n') != 0L)
00305         result = kFileInvalidName;
00306
00307 #ifdef macintosh
00308     if(strchr(filename, '\r') != 0L)
00309         result = kFileInvalidName;
00310     if(strcmp(filename, ".") == 0 || strcmp(filename, "..") == 0)
00311         result = kFileInvalidName;
00312     if(strcmp(filename, "CVS") != 0 && stricmp(filename, "cvs") == 0)
00313         result = kFileInvalidName;
00314 #endif /* !macintosh */
00315
00316     return result;
00317 }

Variable Documentation

CStaticAllocT<char> sBuf [static]

Definition at line 74 of file TextBinary.cpp.

int sBufSize [static]

Definition at line 75 of file TextBinary.cpp.

Referenced by FileIsText, FillBuffer, and TestBuffer.

Generated on Sun Feb 24 01:22:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TextBinary.h File Reference

common/TextBinary.h File Reference

#include "CPStr.h"

Include dependency graph for TextBinary.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | UFSSpec FSSpec
#define | MAX_ARGS 40
#define | MAX_CMD_LEN 2048

Typedefs

typedef int | FSSpec

Enumerations

enum kTextBinTYPE {
kFileIsOK,
kFileMissing,
kFileIsAlias,
kFileInvalidName,
kTextWrongLF,
kTextIsBinary,
kTextEscapeChar,
kTextWrongSig,
kTextIsUnicode,
kBinIsText,
kBinWrongSig,
kBinIsUnicode,
kUnicodeIsText,
kUnicodeIsBinary
}
File type enum. More...

enum kFileType {
kFileTypeText,
kFileTypeBin,
kFileTypeUnicode
}
Expected file type enum. More...

Functions

kTextBinTYPE | FileIsText (const char *arg, const char *dir, const FSSpec *spec=0L)
kTextBinTYPE | FileIsBinary (const char *arg, const char *dir, const FSSpec *spec=0L)
kTextBinTYPE | FileIsUnicode (const char *arg, const char *dir, const FSSpec *spec=0L)
bool | SplitPath (const char *dir, UStr &uppath, UStr &folder)
bool | MakeTmpFile (UStr &file, const char *prefix, const char *extension=0L, bool create=false)
void | GetExtension (const char *file, UStr &base, UStr &ext)
bool | GetEnvValue (const char *cmd, const char *key, UStr &value)
int | StringToArgv (const char *cmdLine, char **argv)

Variables

const char | kPathDelimiter = '\\'

Define Documentation

#define MAX_ARGS 40

Definition at line 101 of file TextBinary.h.

Referenced by CompatGetCommand, and StringToArgv.

#define MAX_CMD_LEN 2048

Definition at line 102 of file TextBinary.h.

Referenced by CompatGetCommand, and StringToArgv.

#define UFSSpec FSSpec

Definition at line 39 of file TextBinary.h.

Referenced by MultiFilesEntry::add, RemoveCvsArgs::addfile, ControlCvsArgs::addfile, CvsArgs::addfile, BuildIgnoredList, CompatMoveToTrash, TraversalReport::EnterDirectory, FileEntry::FileEntry, FileIsBinary, FileIsText, AddUnicodeCvsArgs::FileIsType, AddBinCvsArgs::FileIsType, AddCvsArgs::FileIsType, FileIsUnicode, FileTraverse, FillBuffer, glue_getenv, MakeTmpFile, MultiFiles::newfile, TraversalReport::OnAlias, TraversalReport::OnAnyDevice, TraversalReport::OnDirectory, CFindSettings::OnFile, MacroTraversal::OnFile, ImportReport::OnFile, TraversalReport::OnFile, TestBuffer, and TestFileIsAlias.

Typedef Documentation

typedef int FSSpec

Definition at line 38 of file TextBinary.h.

Referenced by TBrowserFill::EnterDirectory, TBrowserFillDummy::EnterDirectory, TViewFill::EnterDirectory, LSReport::EnterDirectory, CFillTclEntries::EnterDirectory, CFillPyEntries::EnterDirectory, ImportReport::EnterDirectory, LaunchDiff, CvsPrefs::load, CPersistent::LoadAll, TViewFill::OnAlias, CFillTclEntries::OnAlias, CFillPyEntries::OnAlias, ImportReport::OnAlias, LSReport::OnAnyDevice, TBrowserFill::OnDirectory, TBrowserFillDummy::OnDirectory, TViewFill::OnDirectory, CFillTclEntries::OnDirectory, CFillPyEntries::OnDirectory, ImportReport::OnDirectory, TViewFill::OnFile, CFillTclEntries::OnFile, CFillPyEntries::OnFile, ImportReport::OnFile, and CPersistent::SaveAll.

Enumeration Type Documentation

enum kFileType

Expected file type enum.

Enumeration values:
kFileTypeText
kFileTypeBin
kFileTypeUnicode

Definition at line 77 of file TextBinary.h.

Referenced by ReportConflict::AddPattern, list_add_type, ImportReport::OnFile, and TestBuffer.

00078 {
00079     kFileTypeText,
00080     kFileTypeBin,
00081     kFileTypeUnicode
00082 } kFileType;

enum kTextBinTYPE

File type enum.

Enumeration values:
kFileIsOK | good file
kFileMissing | file is missing or unreadable
kFileIsAlias | file is an alias
kFileInvalidName | invalid character ('/')
kTextWrongLF | for example it has Mac \r on Windows
kTextIsBinary | file should be text but seems to be binary
kTextEscapeChar | file has some extras characters (0x00-0x1F, 0x80-0xFF)
kTextWrongSig | file has not the 'TEXT' signature (Mac only)
kTextIsUnicode | file should be text but seems to be unicode file
kBinIsText | binary file seems to be a text file
kBinWrongSig | file should not have the 'TEXT' signature in it (Mac only)
kBinIsUnicode | binary file seems to be unicode file
kUnicodeIsText | unicode file seems to be text file
kUnicodeIsBinary | unicode file seems to be binary

Definition at line 51 of file TextBinary.h.

Referenced by ControlCvsArgs::addfile, FileIsBinary, FileIsText, AddUnicodeCvsArgs::FileIsType, AddBinCvsArgs::FileIsType, AddCvsArgs::FileIsType, FileIsUnicode, FillBuffer, ReportWarning::Kind, list_add_warning, ImportReport::OnFile, ReportWarning::ReportWarning, TestBuffer, TestFileIsAlias, and TestValidName.

00052 {
00053     // text and binary flags
00054     kFileIsOK,
00055     kFileMissing,
00056     kFileIsAlias,
00057     kFileInvalidName,
00058
00059     // text flags
00060     kTextWrongLF,
00061     kTextIsBinary,
00062     kTextEscapeChar,
00063     kTextWrongSig,
00064     kTextIsUnicode,
00065
00066     // binary flags
00067     kBinIsText,
00068     kBinWrongSig,
00069     kBinIsUnicode,
00070
00071     // unicode flags
00072     kUnicodeIsText,
00073     kUnicodeIsBinary
00074 } kTextBinTYPE;

Function Documentation

kTextBinTYPE FileIsBinary | ( | const char * | arg,
 |  | const char * | dir,
 |  | const FSSpec * | spec = 0L
 | ) |

Definition at line 373 of file TextBinary.cpp.

Referenced by AddBinCvsArgs::FileIsType, and ImportReport::OnFile.

00374 {
00375     kTextBinTYPE state;
00376
00377     state = FillBuffer(arg, dir, spec, true);
00378     if(state != kFileIsOK)
00379         return state;
00380
00381     state = TestBuffer(arg, dir, spec, kFileTypeBin);
00382
00383 #ifdef macintosh
00384     kTextBinTYPE sigstate = GetMacSig(arg, dir, spec, true);
00385     if(sigstate != kFileIsOK)
00386         return state;
00387     if(state != kFileIsOK && state != kBinIsText)
00388         return state;
00389 #else /* !macintosh */
00390     if(state != kFileIsOK)
00391         return state;
00392 #endif /* !macintosh */
00393
00394     state = TestValidName(arg);
00395     if(state != kFileIsOK)
00396         return state;
00397
00398     state = TestFileIsAlias(arg, dir, spec);
00399     if(state != kFileIsOK)
00400         return state;
00401
00402     return kFileIsOK;
00403 }

kTextBinTYPE FileIsText | ( | const char * | arg,
 |  | const char * | dir,
 |  | const FSSpec * | spec = 0L
 | ) |

Definition at line 341 of file TextBinary.cpp.

Referenced by AddCvsArgs::FileIsType, and ImportReport::OnFile.

00342 {
00343     kTextBinTYPE state;
00344
00345 #ifdef macintosh
00346     state = GetMacSig(arg, dir, spec, false);
00347     if(state != kFileIsOK)
00348         return state;
00349 #endif /* macintosh */
00350
00351     state = FillBuffer(arg, dir, spec, false);
00352     if(state != kFileIsOK)
00353         return state;
00354
00355     if(sBufSize == 0)
00356         return kFileIsOK;
00357
00358     state = TestBuffer(arg, dir, spec, kFileTypeText);
00359     if(state != kFileIsOK)
00360         return state;
00361
00362     state = TestValidName(arg);
00363     if(state != kFileIsOK)
00364         return state;
00365
00366     state = TestFileIsAlias(arg, dir, spec);
00367     if(state != kFileIsOK)
00368         return state;
00369
00370     return kFileIsOK;
00371 }

kTextBinTYPE FileIsUnicode | ( | const char * | arg,
 |  | const char * | dir,
 |  | const FSSpec * | spec = 0L
 | ) |

Definition at line 405 of file TextBinary.cpp.

Referenced by AddUnicodeCvsArgs::FileIsType.

00406 {
00407     kTextBinTYPE state;
00408
00409     state = FillBuffer(arg, dir, spec, true);
00410     if(state != kFileIsOK)
00411         return state;
00412
00413     state = TestBuffer(arg, dir, spec, kFileTypeUnicode);
00414
00415 #ifdef macintosh
00416     kTextBinTYPE sigstate = GetMacSig(arg, dir, spec, true);
00417     if(sigstate != kFileIsOK)
00418         return state;
00419     if(state != kFileIsOK && state != kBinIsText)
00420         return state;
00421 #else /* !macintosh */
00422     if(state != kFileIsOK)
00423         return state;
00424 #endif /* !macintosh */
00425
00426     state = TestValidName(arg);
00427     if(state != kFileIsOK)
00428         return state;
00429
00430     state = TestFileIsAlias(arg, dir, spec);
00431     if(state != kFileIsOK)
00432         return state;
00433
00434     return kFileIsOK;
00435 }

bool GetEnvValue | ( | const char * | cmd,
 |  | const char * | key,
 |  | UStr & | value
 | ) |

Definition at line 576 of file TextBinary.cpp.

Referenced by CompatGetPassword.

00577 {
00578     const char *tmp = strstr(cmd, key);
00579     if(tmp == 0L)
00580         return false;
00581     tmp = strchr(tmp, '=');
00582     if(tmp == 0L)
00583         return false;
00584     tmp++;
00585     const char *tmp2 = strchr(tmp, '&');
00586     if(tmp2 == 0L)
00587         value = tmp;
00588     else
00589         value.set(tmp, tmp2 - tmp);
00590     return true;
00591 }

void GetExtension | ( | const char * | file,
 |  | UStr & | base,
 |  | UStr & | ext
 | ) |

Definition at line 464 of file TextBinary.cpp.

Referenced by CvsCmdAnnotateFiles, CvsCmdDiffFiles, getSettingName, CGraphView::OnQueryAnnotate, and CGraphView::OnViewDiff.

00465 {
00466     char *tmp = strrchr(file, '.');
00467     if(tmp == 0L)
00468     {
00469         ext = "";
00470         base = file;
00471     }
00472     else
00473     {
00474         ext = tmp + 1;
00475         base = file;
00476         base[tmp - file] = '\0';
00477     }
00478 }

bool MakeTmpFile | ( | UStr & | file,
 |  | const char * | prefix,
 |  | const char * | extension = 0L,
 |  | bool | create = false
 | ) |

Definition at line 480 of file TextBinary.cpp.

Referenced by CompatGetEditorMsg, and launchCVS.

00481 {
00482     static int count = 0;
00483     char filename[256];
00484
00485     CStr tmpPath;
00486     CStr ext;
00487     CStr prf;
00488
00489     if(extension != 0L && extension[0] != '\0')
00490     {
00491         if(extension[0] != '.')
00492             ext = ".";
00493         ext << extension;
00494     }
00495
00496     if(prefix != 0L && prefix[0] != '\0')
00497     {
00498         prf = prefix;
00499     }
00500     else
00501         prf = "cvsgui";
00502
00503 #ifdef WIN32
00504     char *ptr;
00505     ptr = getenv(_T("TMP"));
00506     if (ptr != 0L && _access( ptr, 0 ) != -1 )
00507         tmpPath = ptr;
00508     else
00509         tmpPath = ".";
00510 #endif /* !WIN32 */
00511 #ifdef macintosh
00512     UFSSpec theFolder;
00513     OSErr err;
00514
00515     if((err = MacGetTempFolder(theFolder, tmpPath)) != noErr)
00516     {
00517         cvs_err("Unable to locate the preferences folder (error %d) !\n", err);
00518         return 0L;
00519     }
00520
00521     for (;;) {
00522         sprintf(filename, "%s%d%s", (const char *)prf, count, (const char *)ext);
00523         if (::strlen (filename) <= 31) break;
00524
00525         if (prf.length () == 0) {
00526             cvs_err("Unable to truncate temp file !\n");
00527             return 0L;
00528             } // if
00529
00530         prf.set (prf, prf.length () - 1);
00531         } // for
00532 #endif /* !macintosh */
00533 #if qUnix
00534     tmpPath = "/tmp";
00535 #endif
00536
00537     struct stat sb;
00538     if (stat(tmpPath, &sb) == -1 || !S_ISDIR(sb.st_mode))
00539     {
00540         cvs_err("Unable to access '%s' (error %d) !\n", (const char *)tmpPath, errno);
00541         return false;
00542     }
00543
00544     if(!tmpPath.endsWith(kPathDelimiter))
00545         tmpPath << kPathDelimiter;
00546
00547     int maxtry = 10000;
00548     while(1)
00549     {
00550         sprintf(filename, "%s%d%s", (const char *)prf, count++, (const char *)ext);
00551         file = tmpPath;
00552         file << filename;
00553         if (stat(file, &sb) == -1 && errno == ENOENT)
00554         {
00555             if( create )
00556             {
00557                 FILE* stream = fopen(file, "w");
00558                 if( stream )
00559                 {
00560                     fclose(stream);
00561                 }
00562             }
00563             return true;
00564         }
00565
00566         if(maxtry-- == 0)
00567         {
00568             cvs_err("Time out to access '%s' !\n", (const char *)tmpPath);
00569             break;
00570         }
00571     }
00572
00573     return false;
00574 }

bool SplitPath | ( | const char * | dir,
 |  | UStr & | uppath,
 |  | UStr & | folder
 | ) |

Definition at line 437 of file TextBinary.cpp.

Referenced by CompatGetEditorMsg, CompatGetImport, CvsCmdAddFolder, CvsCmdReleaseFolder, USaveSettings::DoDataExchange, FormatMenuString, getLoc, CTCLBrowserEnt::GetNormalized, getSettingName, launchCVS, LaunchViewer, CWincvsApp::LookForResourceFile, UCvsFolders::OnCmdMacrosSel, UCvsFiles::OnCmdUpone, CWinCvsBrowser::OnUpdateMacro, and CHistComboBoxEx::SetIcon.

00438 {
00439     char newdir[512];
00440     char olddir[512];
00441     char newfile[256];
00442     int lendir = strlen(dir);
00443     strcpy(olddir, dir);
00444     if(dir[lendir - 1] == kPathDelimiter)
00445     {
00446         olddir[lendir - 1] = '\0';
00447         --lendir;
00448     }
00449     const char *tmp = olddir, *prev = olddir;
00450
00451     while((tmp = strchr(tmp, kPathDelimiter)) != 0L)
00452         prev = ++tmp;
00453
00454     strcpy(newdir, olddir);
00455     newdir[prev - olddir] = '\0';
00456     strcpy(newfile, prev);
00457
00458     uppath = newdir;
00459     folder = newfile;
00460
00461     return true;
00462 }

int StringToArgv | ( | const char * | cmdLine,
 |  | char ** | argv
 | ) |

Definition at line 593 of file TextBinary.cpp.

Referenced by CompatGetCommand.

00594 {
00595     int argc = 0;
00596
00597     char    Quote = '\0';               /*  Contains the quote character if we are
00598                                             inside "" or '', or \0 otherwise */
00599     const char* walker1 = cmdLine;      /*  walker1 traverses the original
00600                                             command line */
00601     char*   walker2;                    /*  walker2 traverses the parsed copy of
00602                                             the command line */
00603     char    theChar;                    /*  theChar is the character we are currently
00604                                             parsing */
00605     char    arguments [MAX_CMD_LEN];            /*  will contain a parsed copy of the
00606                                             command line */
00607
00608     walker2 = arguments;                                        /*  copy into arguments */
00609     while ((theChar = *walker1++) != '\0') {                    /*  parse command line to \0 */
00610         if (theChar == ' ')                                     /*  skip leading space before an argument */
00611             continue;
00612         argv [argc++] = walker2;                                /*  set argv to point to the space
00613                                                                     where we copy the next argument */
00614         if (argc > MAX_ARGS) {                                  /*  if we filled argv, skip the rest */
00615             argc--;
00616             break;
00617         }
00618         do {                                                    /*  parse an argument */
00619             if (theChar == '\\' && *walker1++)                  /*  skip \s */
00620                 theChar = *walker1++;
00621             else
00622                 if ((theChar == '"') || (theChar == '\'')) {    /*  when we find a quote... */
00623                     if (Quote == '\0') {                        /*  if we are not inside quotes already, */
00624                         Quote = theChar;                        /*  remember we are inside quotes now */
00625                         continue;                               /*  go to the next character */
00626                     }
00627                     if (theChar == Quote) {                     /*  if we are already inside that kind of quotes */
00628                         Quote = '\0';                           /*  close quotes */
00629                         continue;                               /*  go to the next character */
00630                     }
00631                 }
00632             *walker2++ = theChar;                               /*  copy the character into args */
00633                                                                 /*  repeat until we reach the end of arguments
00634                                                                     or we reach a space that is not inside quotes */
00635         } while ((*walker1 != '\0') && (((theChar = *walker1++) != ' ') || (Quote != '\0')));
00636         *walker2++ = 0;                                         /* null-terminate the last argument */
00637     }
00638
00639     return argc;
00640 }

Variable Documentation

const char kPathDelimiter = '\\' [static]

Definition at line 43 of file TextBinary.h.

Generated on Sun Feb 24 01:22:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsApp.cpp File Reference

common/UCvsApp.cpp File Reference

#include "stdafx.h"
#include "UCvsApp.h"
#include "UCvsCommands.h"
#include "UCvsFolders.h"
#include "UCvsFiles.h"
#include "TclGlue.h"
#include "GetPrefs.h"
#include "CvsPrefs.h"
#include "AppConsole.h"
#include "MacrosSetup.h"
#include "Authen.h"
#include "getopt.h"

Include dependency graph for UCvsApp.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void | usage (void)
void * | UCreate_pixmap (UWidget *parent, const char *fileIcon)

Function Documentation

void* UCreate_pixmap | ( | UWidget * | parent,
 |  | const char * | fileIcon
 | ) |

Definition at line 430 of file UCvsApp.cpp.

References UWidget::GetWidget, and kUMainWidget.

00431 {
00432 #if qGTK
00433     GtkWidget *wid = (GtkWidget *) parent->GetWidget (kUMainWidget);
00434     return GTK_PIXMAP (create_pixmap (wid, fileIcon));
00435 #else
00436     return 0L;
00437 #endif
00438 }

void usage ( void ) [static]

Definition at line 69 of file UCvsApp.cpp.

Referenced by UCvsApp::UCvsApp.

00070 {
00071     fprintf (stderr, "gcvs [--root=path]\n");
00072 }

Generated on Sun Feb 24 01:22:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsApp.h File Reference

common/UCvsApp.h File Reference

#include "uwidget.h"
#include "cvsgui_process.h"

Include dependency graph for UCvsApp.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class UCvsApp

Generated on Sun Feb 24 01:22:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsCommands.h File Reference

common/UCvsCommands.h File Reference

#include "umain.h"

Include dependency graph for UCvsCommands.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Enumerations

enum {
kUCvsFrameID = 1,
kUMainConsoleID,
kUCvsFoldersID,
kUCvsFilesID,
kUCvsToolbarID,
kUCvsMenubarID
}
enum {
cmdSAVE = EV_COMMAND_START + 100,
cmdSAVE_AS,
cmdPRINT,
cmdPRINT_PREVIEW,
cmdPRINT_SETUP,
cmdSEND_MAIL,
cmdEXIT,
cmdUNDO,
cmdCUT,
cmdCOPY,
cmdPASTE,
cmdSELECT_ALL,
cmdCLEAR_ALL,
cmdFIND,
cmdREPEAT,
cmdFONT,
cmdTOOLBAR,
cmdSTATUS_BAR,
cmdBROWSER_BAR,
cmdFILES_BAR,
cmdMULTI_BAR,
cmdTAGS_BAR,
cmdCONSOLE_BAR,
cmdWORKSPACE,
cmdOPEN,
cmdPREFERENCES,
cmdCMDLINE,
cmdLOGIN,
cmdLOGOUT,
cmdSTOPCVS,
cmdINIT,
cmdIMPORT,
cmdCHECKOUT,
cmdRTAGCREATE,
cmdRTAGDELETE,
cmdRTAGBRANCH,
cmdUPDATE,
cmdCOMMIT,
cmdADD,
cmdADDB,
cmdRMV,
cmdTRASH,
cmdTAGNEW,
cmdTAGDELETE,
cmdTAGBRANCH,
cmdEXPLORE,
cmdQUERYUPDATE,
cmdRELOAD,
cmdEDITSEL,
cmdEDITSELDEF,
cmdDIFF,
cmdLOG,
cmdSTATUS,
cmdGRAPH,
cmdLOCKF,
cmdUNLOCKF,
cmdEDIT,
cmdUNEDIT,
cmdWATCHON,
cmdWATCHOFF,
cmdRELEASE,
cmdWATCHERS,
cmdEDITORS,
cmdCASCADE,
cmdTILE_HORZ,
cmdARRANGE,
cmdFINDER,
cmdCVS,
cmdCVSCLIENT,
cmdABOUT,
cmdIGNORE,
cmdUPFOLDER,
cmdSAVESETTINGS,
cmdSELMACRO,
cmdSELMACROEND = cmdSELMACRO + 30,
cmdMACROADMIN,
cmdMACROADMINEND = cmdMACROADMIN + 20,
cmdCREDITS,
cmdCOPYRIGHTS
}

Enumeration Type Documentation

anonymous enum

Enumeration values:
kUCvsFrameID
kUMainConsoleID
kUCvsFoldersID
kUCvsFilesID
kUCvsToolbarID
kUCvsMenubarID

Definition at line 32 of file UCvsCommands.h.

00033 {
00034     kUCvsFrameID = 1,           /* the main frane */
00035     kUMainConsoleID,            /* the pseudo-console */
00036     kUCvsFoldersID,             /* the folder tree */
00037     kUCvsFilesID,               /* the files list */
00038     kUCvsToolbarID,             /* the toolbar */
00039     kUCvsMenubarID              /* the menubar */
00040 };

anonymous enum

Enumeration values:
cmdSAVE
cmdSAVE_AS
cmdPRINT
cmdPRINT_PREVIEW
cmdPRINT_SETUP
cmdSEND_MAIL
cmdEXIT
cmdUNDO
cmdCUT
cmdCOPY
cmdPASTE
cmdSELECT_ALL
cmdCLEAR_ALL
cmdFIND
cmdREPEAT
cmdFONT
cmdTOOLBAR
cmdSTATUS_BAR
cmdBROWSER_BAR
cmdFILES_BAR
cmdMULTI_BAR
cmdTAGS_BAR
cmdCONSOLE_BAR
cmdWORKSPACE
cmdOPEN
cmdPREFERENCES
cmdCMDLINE
cmdLOGIN
cmdLOGOUT
cmdSTOPCVS
cmdINIT
cmdIMPORT
cmdCHECKOUT
cmdRTAGCREATE
cmdRTAGDELETE
cmdRTAGBRANCH
cmdUPDATE
cmdCOMMIT
cmdADD
cmdADDB
cmdRMV
cmdTRASH
cmdTAGNEW
cmdTAGDELETE
cmdTAGBRANCH
cmdEXPLORE
cmdQUERYUPDATE
cmdRELOAD
cmdEDITSEL
cmdEDITSELDEF
cmdDIFF
cmdLOG
cmdSTATUS
cmdGRAPH
cmdLOCKF
cmdUNLOCKF
cmdEDIT
cmdUNEDIT
cmdWATCHON
cmdWATCHOFF
cmdRELEASE
cmdWATCHERS
cmdEDITORS
cmdCASCADE
cmdTILE_HORZ
cmdARRANGE
cmdFINDER
cmdCVS
cmdCVSCLIENT
cmdABOUT
cmdIGNORE
cmdUPFOLDER
cmdSAVESETTINGS
cmdSELMACRO
cmdSELMACROEND
cmdMACROADMIN
cmdMACROADMINEND
cmdCREDITS
cmdCOPYRIGHTS

Definition at line 44 of file UCvsCommands.h.

00045 {
00046     cmdSAVE = EV_COMMAND_START + 100,
00047     cmdSAVE_AS,
00048     cmdPRINT,
00049     cmdPRINT_PREVIEW,
00050     cmdPRINT_SETUP,
00051     cmdSEND_MAIL,
00052     cmdEXIT,
00053     cmdUNDO,
00054     cmdCUT,
00055     cmdCOPY,
00056     cmdPASTE,
00057     cmdSELECT_ALL,
00058     cmdCLEAR_ALL,
00059     cmdFIND,
00060     cmdREPEAT,
00061     cmdFONT,
00062     cmdTOOLBAR,
00063     cmdSTATUS_BAR,
00064     cmdBROWSER_BAR,
00065     cmdFILES_BAR,
00066     cmdMULTI_BAR,
00067     cmdTAGS_BAR,
00068     cmdCONSOLE_BAR,
00069     cmdWORKSPACE,
00070     cmdOPEN,
00071     cmdPREFERENCES,
00072     cmdCMDLINE,
00073     cmdLOGIN,
00074     cmdLOGOUT,
00075     cmdSTOPCVS,
00076     cmdINIT,
00077     cmdIMPORT,
00078     cmdCHECKOUT,
00079     cmdRTAGCREATE,
00080     cmdRTAGDELETE,
00081     cmdRTAGBRANCH,
00082     cmdUPDATE,
00083     cmdCOMMIT,
00084     cmdADD,
00085     cmdADDB,
00086     cmdRMV,
00087     cmdTRASH,
00088     cmdTAGNEW,
00089     cmdTAGDELETE,
00090     cmdTAGBRANCH,
00091     cmdEXPLORE,
00092     cmdQUERYUPDATE,
00093     cmdRELOAD,
00094     cmdEDITSEL,
00095     cmdEDITSELDEF,
00096     cmdDIFF,
00097     cmdLOG,
00098     cmdSTATUS,
00099     cmdGRAPH,
00100     cmdLOCKF,
00101     cmdUNLOCKF,
00102     cmdEDIT,
00103     cmdUNEDIT,
00104     cmdWATCHON,
00105     cmdWATCHOFF,
00106     cmdRELEASE,
00107     cmdWATCHERS,
00108     cmdEDITORS,
00109     cmdCASCADE,
00110     cmdTILE_HORZ,
00111     cmdARRANGE,
00112     cmdFINDER,
00113     cmdCVS,
00114     cmdCVSCLIENT,
00115     cmdABOUT,
00116     cmdIGNORE,
00117     cmdUPFOLDER,
00118     cmdSAVESETTINGS,
00119
00120     cmdSELMACRO, // contiguous BEGIN
00121     cmdSELMACROEND = cmdSELMACRO + 30,
00122
00123     cmdMACROADMIN, // contiguous BEGIN
00124     cmdMACROADMINEND = cmdMACROADMIN + 20,
00125
00126     cmdCREDITS, // contiguous BEGIN
00127     cmdCOPYRIGHTS // END
00128 };

Generated on Sun Feb 24 01:22:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsConsole.cpp File Reference

common/UCvsConsole.cpp File Reference

#include "stdafx.h"
#include "UCvsConsole.h"
#include "UCvsCommands.h"
#include "uconsole.h"
#include "TclGlue.h"

Include dependency graph for UCvsConsole.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:22:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsConsole.h File Reference

common/UCvsConsole.h File Reference

#include "uwidget.h"
#include "AppConsole.h"

Include dependency graph for UCvsConsole.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

struct | UCOLOR
class | UCvsConsole

Generated on Sun Feb 24 01:22:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsDialogs.h File Reference

common/UCvsDialogs.h File Reference

#include "uwidget.h"

Include dependency graph for UCvsDialogs.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

void * | UCreate_pixmap (UWidget *parent, const char *fileIcon)
void * | UCreate_MainWindow (void)
void * | UCreate_GraphWindow (void)
void * | UCreate_AskYesNo (void)
void * | UCreate_gcvs_Settings (void)
void * | UCreate_UpdateDlg (void)
void * | UCreate_PasswdDlg (void)
void * | UCreate_CommitDlg (void)
void * | UCreate_DiffDlg (void)
void * | UCreate_CheckoutDlg (void)
void * | UCreate_LogDlg (void)
void * | UCreate_ImportFilterDlg (void)
void * | UCreate_ImpWarningDlg (void)
void * | UCreate_ImpEntryDlg (void)
void * | UCreate_ImportDlg (void)
void * | UCreate_CmdlineDlg (void)
void * | UCreate_TagModDlg (void)
void * | UCreate_UntagModDlg (void)
void * | UCreate_BranchModDlg (void)
void * | UCreate_TagDlg (void)
void * | UCreate_UntagDlg (void)
void * | UCreate_BranchDlg (void)
void * | UCreate_SettingsDlg (void)

Function Documentation

void* UCreate_AskYesNo ( void )

Referenced by CvsAlert.

void* UCreate_BranchDlg ( void )

Referenced by CompatTagBranch.

void* UCreate_BranchModDlg ( void )

Referenced by CompatRtagBranch.

void* UCreate_CheckoutDlg ( void )

Referenced by CompatGetCheckout.

void* UCreate_CmdlineDlg ( void )

Referenced by CompatGetCommand.

void* UCreate_CommitDlg ( void )

Referenced by CompatGetCommit.

void* UCreate_DiffDlg ( void )

Referenced by CompatGetDiff.

void* UCreate_gcvs_Settings ( void )

Referenced by CompatGetPrefs.

void* UCreate_GraphWindow ( void )

Referenced by CvsLogParse.

void* UCreate_ImpEntryDlg ( void )

void* UCreate_ImportDlg ( void )

Referenced by CompatGetImport.

void* UCreate_ImportFilterDlg ( void )

Referenced by CompatImportFilter.

void* UCreate_ImpWarningDlg ( void )

void* UCreate_LogDlg ( void )

Referenced by CompatGetLog.

void* UCreate_MainWindow ( void )

void* UCreate_PasswdDlg ( void )

Referenced by CompatGetPassword.

void* UCreate_pixmap | ( | UWidget * | parent,
 |  | const char * | fileIcon
 | ) |

Definition at line 430 of file UCvsApp.cpp.

Referenced by UCvsFolders::OnCreate, and UCvsFiles::OnCreate.

00431 {
00432 #if qGTK
00433     GtkWidget *wid = (GtkWidget *) parent->GetWidget (kUMainWidget);
00434     return GTK_PIXMAP (create_pixmap (wid, fileIcon));
00435 #else
00436     return 0L;
00437 #endif
00438 }

void* UCreate_SettingsDlg ( void )

Referenced by AskCreatePersistentSettings.

void* UCreate_TagDlg ( void )

Referenced by CompatTagCreate.

void* UCreate_TagModDlg ( void )

Referenced by CompatRtagCreate.

void* UCreate_UntagDlg ( void )

Referenced by CompatTagDelete.

void* UCreate_UntagModDlg ( void )

Referenced by CompatRtagDelete.

void* UCreate_UpdateDlg ( void )

Referenced by CompatGetUpdate.

Generated on Sun Feb 24 01:22:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsFiles.cpp File Reference

common/UCvsFiles.cpp File Reference

#include "stdafx.h"
#include "UCvsFiles.h"
#include "UCvsDialogs.h"
#include "UCvsFolders.h"
#include "UCvsCommands.h"
#include "UCvsFrame.h"
#include "UCvsApp.h"
#include "CvsPrefs.h"
#include "FileTraversal.h"
#include "MultiFiles.h"
#include "CvsCommands.h"
#include "CvsArgs.h"
#include "TclGlue.h"
#include "AppConsole.h"
#include "MoveToTrash.h"
#include "MacrosSetup.h"

Include dependency graph for UCvsFiles.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | TViewFill

Defines

#define | NAMESPACE(w) ::
#define | NUM_COLUMNS 7

Enumerations

enum {
kFileIconText = 0,
kFileIconBinary,
kFileIconUnknown,
kFileIconAdded,
kFileIconConflict,
kFileIconMiss,
kFolderIcon,
kFolderIconUnknown,
kFolderIconMiss,
kFileIconTextMod,
kFileIconBinaryMod,
kFileIconIgnored,
kFolderIconIgnored,
kFileIconRemoved
}

Functions

CPersistentBool | gFileViewIgnore ("P_FileViewIgnore", true)
CPersistentInt | gFileViewSort ("P_FileViewSort", EntnodeData::kName)
CPersistentBool | gFileViewSortAsc ("P_FileViewSortAsc", true)
int | compareName (UWidget *wid, void *data1, void *data2)
int | compareStatus (UWidget *wid, void *data1, void *data2)
int | compareOption (UWidget *wid, void *data1, void *data2)
int | revcmp (const char *rev1, const char *rev2)
int | compareRevs (UWidget *wid, void *data1, void *data2)
int | compareTag (UWidget *wid, void *data1, void *data2)
int | compareConflict (UWidget *wid, void *data1, void *data2)

Variables

void * | sFileIconTextIcon
void * | sFileIconBinaryIcon
void * | sFileIconUnknownIcon
void * | sFileIconAddedIcon
void * | sFileIconConflictIcon
void * | sFileIconMissIcon
void * | sFolderIconIcon
void * | sFolderIconUnknownIcon
void * | sFolderIconMissIcon
void * | sFileIconTextModIcon
void * | sFileIconBinaryModIcon
void * | sFileIconIgnoredIcon
void * | sFolderIconIgnoredIcon
void * | sFileIconRemovedIcon
char * | _gszColumnLabel [7]
int | _gnColumnWidth [7]

Define Documentation

#define NAMESPACE ( w ) ::

Definition at line 59 of file UCvsFiles.cpp.

#define NUM_COLUMNS 7

Definition at line 200 of file UCvsFiles.cpp.

Referenced by UCvsFiles::OnCreate, TViewFill::OnDirectory, TViewFill::OnFile, and UCvsFiles::ResetView.

Enumeration Type Documentation

anonymous enum

Enumeration values:
kFileIconText
kFileIconBinary
kFileIconUnknown
kFileIconAdded
kFileIconConflict
kFileIconMiss
kFolderIcon
kFolderIconUnknown
kFolderIconMiss
kFileIconTextMod
kFileIconBinaryMod
kFileIconIgnored
kFolderIconIgnored
kFileIconRemoved

Definition at line 182 of file UCvsFiles.cpp.

00183 {
00184     kFileIconText = 0,
00185     kFileIconBinary,
00186     kFileIconUnknown,
00187     kFileIconAdded,
00188     kFileIconConflict,
00189     kFileIconMiss,
00190     kFolderIcon,
00191     kFolderIconUnknown,
00192     kFolderIconMiss,
00193     kFileIconTextMod,
00194     kFileIconBinaryMod,
00195     kFileIconIgnored,
00196     kFolderIconIgnored,
00197     kFileIconRemoved
00198 };

Function Documentation

int compareConflict | ( | UWidget * | wid,
 |  | void * | data1,
 |  | void * | data2
 | ) | [static]

Definition at line 2066 of file UCvsFiles.cpp.

References UCvsFiles::IsSortAscendant, EntnodeFile::kConflict, EntnodeData::kName, and stricmp.

Referenced by UCvsFiles::Resort.

02067 {
02068     UCvsFiles *w = (UCvsFiles *)wid;
02069     EntnodeData *d1 = (EntnodeData *)data1;
02070     EntnodeData *d2 = (EntnodeData *)data2;
02071     const char *s1 = (*d1)[EntnodeFile::kConflict];
02072     const char *s2 = (*d2)[EntnodeFile::kConflict];
02073     int res;
02074     if(s1 != 0L && s2 != 0L)
02075         res = strcmp(s1, s2);
02076     else
02077         res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
02078     if(res == 0)
02079         res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
02080     return w->IsSortAscendant() ? res : -res;
02081 }

int compareName | ( | UWidget * | wid,
 |  | void * | data1,
 |  | void * | data2
 | ) | [static]

Definition at line 1962 of file UCvsFiles.cpp.

References UCvsFiles::IsSortAscendant, EntnodeData::kName, and stricmp.

Referenced by UCvsFiles::Resort.

01963 {
01964     UCvsFiles *w = (UCvsFiles *)wid;
01965     EntnodeData *d1 = (EntnodeData *)data1;
01966     EntnodeData *d2 = (EntnodeData *)data2;
01967     int res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
01968     return w->IsSortAscendant() ? res : -res;
01969 }

int compareOption | ( | UWidget * | wid,
 |  | void * | data1,
 |  | void * | data2
 | ) | [static]

Definition at line 1982 of file UCvsFiles.cpp.

References UCvsFiles::IsSortAscendant, EntnodeData::kName, EntnodeFile::kOption, and stricmp.

Referenced by UCvsFiles::Resort.

01983 {
01984     UCvsFiles *w = (UCvsFiles *)wid;
01985     EntnodeData *d1 = (EntnodeData *)data1;
01986     EntnodeData *d2 = (EntnodeData *)data2;
01987     const char *s1 = (*d1)[EntnodeFile::kOption];
01988     const char *s2 = (*d2)[EntnodeFile::kOption];
01989     int res;
01990     if(s1 != 0L && s2 != 0L)
01991         res = strcmp(s1, s2);
01992     else
01993         res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
01994     if(res == 0)
01995         res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
01996     return w->IsSortAscendant() ? res : -res;
01997 }

int compareRevs | ( | UWidget * | wid,
 |  | void * | data1,
 |  | void * | data2
 | ) | [static]

Definition at line 2032 of file UCvsFiles.cpp.

References UCvsFiles::IsSortAscendant, EntnodeData::kName, EntnodeFile::kVN, revcmp, and stricmp.

Referenced by UCvsFiles::Resort.

02033 {
02034     UCvsFiles *w = (UCvsFiles *)wid;
02035     EntnodeData *d1 = (EntnodeData *)data1;
02036     EntnodeData *d2 = (EntnodeData *)data2;
02037     const char *s1 = (*d1)[EntnodeFile::kVN];
02038     const char *s2 = (*d2)[EntnodeFile::kVN];
02039     int res;
02040     if(s1 != 0L && s2 != 0L)
02041         res = revcmp(s1, s2);
02042     else
02043         res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
02044     if(res == 0)
02045         res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
02046     return w->IsSortAscendant() ? res : -res;
02047 }

int compareStatus | ( | UWidget * | wid,
 |  | void * | data1,
 |  | void * | data2
 | ) | [static]

Definition at line 1971 of file UCvsFiles.cpp.

References UCvsFiles::IsSortAscendant, EntnodeData::kName, EntnodeData::kStatus, and stricmp.

Referenced by UCvsFiles::Resort.

01972 {
01973     UCvsFiles *w = (UCvsFiles *)wid;
01974     EntnodeData *d1 = (EntnodeData *)data1;
01975     EntnodeData *d2 = (EntnodeData *)data2;
01976     int res = stricmp((*d1)[EntnodeData::kStatus], (*d2)[EntnodeData::kStatus]);
01977     if(res == 0)
01978         res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
01979     return w->IsSortAscendant() ? res : -res;
01980 }

int compareTag | ( | UWidget * | wid,
 |  | void * | data1,
 |  | void * | data2
 | ) | [static]

Definition at line 2049 of file UCvsFiles.cpp.

References UCvsFiles::IsSortAscendant, EntnodeData::kName, EntnodeFile::kTag, and stricmp.

Referenced by UCvsFiles::Resort.

02050 {
02051     UCvsFiles *w = (UCvsFiles *)wid;
02052     EntnodeData *d1 = (EntnodeData *)data1;
02053     EntnodeData *d2 = (EntnodeData *)data2;
02054     const char *s1 = (*d1)[EntnodeFile::kTag];
02055     const char *s2 = (*d2)[EntnodeFile::kTag];
02056     int res;
02057     if(s1 != 0L && s2 != 0L)
02058         res = strcmp(s1, s2);
02059     else
02060         res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
02061     if(res == 0)
02062         res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
02063     return w->IsSortAscendant() ? res : -res;
02064 }

CPersistentBool gFileViewIgnore | ( | "P_FileViewIgnore" | ,
 |  | true |
 | ) |

CPersistentInt gFileViewSort | ( | "P_FileViewSort" | ,
 |  | EntnodeData::kName |
 | ) |

CPersistentBool gFileViewSortAsc | ( | "P_FileViewSortAsc" | ,
 |  | true |
 | ) |

int revcmp | ( | const char * | rev1,
 |  | const char * | rev2
 | ) | [static]

Definition at line 1999 of file UCvsFiles.cpp.

References CStr.

Referenced by compareRevs.

02000 {
02001     if(rev1 == 0L && rev2 == 0L)
02002         return 0;
02003     else if(rev1 == 0L || rev2 == 0L)
02004         return rev1 == 0L ? -1 : 1;
02005
02006     CStr r1(rev1), r2(rev2);
02007     CStr q1, q2;
02008     char *tmp;
02009     int v1, v2;
02010
02011     if((tmp = strchr(r1, '.')) != 0L)
02012     {
02013         tmp[0] = '\0';
02014         q1 = tmp + 1;
02015     }
02016
02017     v1 = atoi(r1);
02018
02019     if((tmp = strchr(r2, '.')) != 0L)
02020     {
02021         tmp[0] = '\0';
02022         q2 = tmp + 1;
02023     }
02024     v2 = atoi(r2);
02025
02026     if(v1 == v2)
02027         return revcmp(q1.empty() ? (char *)0L : (const char *)q1, q2.empty() ? (char *)0L : (const char *)q2);
02028
02029     return v1 < v2 ? -1 : 1;
02030 }

Variable Documentation

int _gnColumnWidth[ 7 ] [static]

Initial value:

{
    150, 50, 50, 100, 150, 150, 150
}

Definition at line 207 of file UCvsFiles.cpp.

Referenced by UCvsFiles::OnCreate.

char* _gszColumnLabel[ 7 ] [static]

Initial value:

{
    "Name", "Rev.", "Option", "Status", "Tag", "Date", "Conflict"
}

Definition at line 202 of file UCvsFiles.cpp.

Referenced by UCvsFiles::OnCreate.

void* sFileIconAddedIcon [static]

Definition at line 153 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry, and UCvsFiles::OnCreate.

void* sFileIconBinaryIcon [static]

Definition at line 151 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry, and UCvsFiles::OnCreate.

void* sFileIconBinaryModIcon [static]

Definition at line 160 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry, and UCvsFiles::OnCreate.

void* sFileIconConflictIcon [static]

Definition at line 154 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry, and UCvsFiles::OnCreate.

void* sFileIconIgnoredIcon [static]

Definition at line 161 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry, and UCvsFiles::OnCreate.

void* sFileIconMissIcon [static]

Definition at line 155 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry, and UCvsFiles::OnCreate.

void* sFileIconRemovedIcon [static]

Definition at line 163 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry, and UCvsFiles::OnCreate.

void* sFileIconTextIcon [static]

Definition at line 150 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry, and UCvsFiles::OnCreate.

void* sFileIconTextModIcon [static]

Definition at line 159 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry, and UCvsFiles::OnCreate.

void* sFileIconUnknownIcon [static]

Definition at line 152 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry, and UCvsFiles::OnCreate.

void* sFolderIconIcon [static]

Definition at line 156 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry, and UCvsFiles::OnCreate.

void* sFolderIconIgnoredIcon [static]

Definition at line 162 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry, and UCvsFiles::OnCreate.

void* sFolderIconMissIcon [static]

Definition at line 158 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry, and UCvsFiles::OnCreate.

void* sFolderIconUnknownIcon [static]

Definition at line 157 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry, and UCvsFiles::OnCreate.

Generated on Sun Feb 24 01:22:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsFiles.h File Reference

common/UCvsFiles.h File Reference

#include "uwidget.h"
#include "CvsEntries.h"

Include dependency graph for UCvsFiles.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class UCvsFiles

Variables

CPersistentBool gFileViewIgnore

Variable Documentation

CPersistentBool gFileViewIgnore

Definition at line 130 of file UCvsFiles.h.

Generated on Sun Feb 24 01:22:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsFolders.cpp File Reference

common/UCvsFolders.cpp File Reference

#include "stdafx.h"
#include "UCvsFolders.h"
#include "UCvsDialogs.h"
#include "UCvsApp.h"
#include "UCvsFiles.h"
#include "UCvsCommands.h"
#include "UCvsFrame.h"
#include "MultiString.h"
#include "FileTraversal.h"
#include "CvsEntries.h"
#include "CvsPrefs.h"
#include "AppConsole.h"
#include "CvsCommands.h"
#include "TclGlue.h"
#include "MacrosSetup.h"
#include "CvsArgs.h"

Include dependency graph for UCvsFolders.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | TBrowserFill
class | TBrowserFillDummy
class | CTempToggleBool

Enumerations

enum {
kIconFolderClosed,
kIconFolderOpened,
kIconFolderCVSClosed,
kIconFolderCVSOpened,
kIconFolderIgnoreClosed,
kIconFolderIgnoreOpened,
kIconFolderIgnoreLost
}

Functions

PCPStr | gOldLoc ("P_BrowserLoc","C:\\")
CMString | gHistoryLocs (100,"P_BrowserLocs")
void * | GetIcon (UCvsFolders *treeCrtl, UTREEITEM item, bool hasCvsInfos, bool expand, EntnodeData *data)

Variables

const char * | gDummyFile = "@@@dummy file@@@"
void * | sFolderIcon
void * | sFolderUnknownIcon
void * | sFolderIgnoredIcon
void * | sFolderMissingIcon
bool | sTemporaryTurnOffNotify = false

Enumeration Type Documentation

anonymous enum

Enumeration values:
kIconFolderClosed
kIconFolderOpened
kIconFolderCVSClosed
kIconFolderCVSOpened
kIconFolderIgnoreClosed
kIconFolderIgnoreOpened
kIconFolderIgnoreLost

Definition at line 68 of file UCvsFolders.cpp.

00069 {
00070     kIconFolderClosed,
00071     kIconFolderOpened,
00072     kIconFolderCVSClosed,
00073     kIconFolderCVSOpened,
00074     kIconFolderIgnoreClosed,
00075     kIconFolderIgnoreOpened,
00076     kIconFolderIgnoreLost
00077 };

Function Documentation

void* GetIcon | ( | UCvsFolders * | treeCrtl,
 |  | UTREEITEM | item,
 |  | bool | hasCvsInfos,
 |  | bool | expand,
 |  | EntnodeData * | data
 | ) | [static]

Definition at line 167 of file UCvsFolders.cpp.

References EntnodeData::IsIgnored, EntnodeData::IsMissing, EntnodeData::IsUnknown, kIconFolderClosed, kIconFolderCVSClosed, kIconFolderCVSOpened, kIconFolderIgnoreClosed, kIconFolderIgnoreLost, kIconFolderIgnoreOpened, kIconFolderOpened, sFolderIcon, sFolderIgnoredIcon, sFolderMissingIcon, sFolderUnknownIcon, and UTREEITEM.

Referenced by CCJFlatButton::DrawButtonIcon, CCJCBarButton::DrawButtonIcon, TBrowserFill::ExitDirectory, TBrowserFillDummy::ExitDirectory, TBrowserFill::OnDirectory, and UCvsFolders::OnTreeExpanding.

00168 {
00169     int newImage;
00170     void *result = 0L;
00171
00172     if(data == 0L)
00173     {
00174         if(expand)
00175             newImage = hasCvsInfos ? kIconFolderCVSOpened : kIconFolderOpened;
00176         else
00177             newImage = hasCvsInfos ? kIconFolderCVSClosed : kIconFolderClosed;
00178     }
00179     else
00180     {
00181         if(expand)
00182         {
00183             if(data->IsIgnored())
00184                 newImage = kIconFolderIgnoreOpened;
00185             else if(data->IsUnknown())
00186                 newImage = kIconFolderOpened;
00187             else if(data->IsMissing())
00188                 newImage = kIconFolderIgnoreLost;
00189             else
00190                 newImage = kIconFolderCVSOpened;
00191         }
00192         else
00193         {
00194             if(data->IsIgnored())
00195                 newImage = kIconFolderIgnoreClosed;
00196             else if(data->IsUnknown())
00197                 newImage = kIconFolderClosed;
00198             else if(data->IsMissing())
00199                 newImage = kIconFolderIgnoreLost;
00200             else
00201                 newImage = kIconFolderCVSClosed;
00202         }
00203     }
00204
00205 #if qGTK
00206     void *pixmap = 0L;
00207     switch(newImage)
00208     {
00209     case kIconFolderClosed:
00210     case kIconFolderOpened:
00211         pixmap = sFolderUnknownIcon;
00212         break;
00213     case kIconFolderCVSClosed:
00214     case kIconFolderCVSOpened:
00215         pixmap = sFolderIcon;
00216         break;
00217     case kIconFolderIgnoreClosed:
00218     case kIconFolderIgnoreOpened:
00219         pixmap = sFolderIgnoredIcon;
00220         break;
00221     case kIconFolderIgnoreLost:
00222         pixmap = sFolderMissingIcon;
00223         break;
00224     }
00225     if(pixmap != 0L)
00226     {
00227         result = gtk_pixmap_new (GTK_PIXMAP(pixmap)->pixmap, GTK_PIXMAP(pixmap)->mask);
00228     }
00229 #endif
00230
00231     return result;
00232 }

CMString gHistoryLocs | ( | 100 | ,
 |  | "P_BrowserLocs" |
 | ) | [static]

PCPStr gOldLoc | ( | "P_BrowserLoc" | ,
 |  | "C:\\" |
 | ) | [static]

Variable Documentation

const char* gDummyFile = "@@@dummy file@@@" [static]

Definition at line 59 of file UCvsFolders.cpp.

Referenced by TBrowserFillDummy::ExitDirectory.

void* sFolderIcon [static]

Definition at line 63 of file UCvsFolders.cpp.

Referenced by GetIcon, and UCvsFolders::OnCreate.

void* sFolderIgnoredIcon [static]

Definition at line 65 of file UCvsFolders.cpp.

Referenced by GetIcon, and UCvsFolders::OnCreate.

void* sFolderMissingIcon [static]

Definition at line 66 of file UCvsFolders.cpp.

Referenced by GetIcon, and UCvsFolders::OnCreate.

void* sFolderUnknownIcon [static]

Definition at line 64 of file UCvsFolders.cpp.

Referenced by GetIcon, and UCvsFolders::OnCreate.

bool sTemporaryTurnOffNotify = false [static]

Definition at line 143 of file UCvsFolders.cpp.

Referenced by UCvsFolders::DeleteAllItems, UCvsFolders::OnTreeSelecting, and UCvsFolders::StepToLocation.

Generated on Sun Feb 24 01:22:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsFolders.h File Reference

common/UCvsFolders.h File Reference

#include "uwidget.h"

Include dependency graph for UCvsFolders.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class UCvsFolders

Generated on Sun Feb 24 01:22:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsFrame.cpp File Reference

common/UCvsFrame.cpp File Reference

#include "stdafx.h"
#include "UCvsFrame.h"
#include "UCvsApp.h"
#include "UCvsCommands.h"
#include "UCvsFolders.h"
#include "CvsAlert.h"
#include "PromptFiles.h"
#include "CvsPrefs.h"
#include "AppConsole.h"
#include "CvsCommands.h"
#include "TclGlue.h"
#include "MacrosSetup.h"
#include "GetPrefs.h"
#include "UCvsDialogs.h"

Include dependency graph for UCvsFrame.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:22:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsFrame.h File Reference

common/UCvsFrame.h File Reference

#include "uwidget.h"
#include "UCvsCommands.h"

Include dependency graph for UCvsFrame.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | UCvsFrame
class | UWaitCursor

Generated on Sun Feb 24 01:22:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsGraph.cpp File Reference

common/UCvsGraph.cpp File Reference

#include "stdafx.h"
#include <sys/stat.h>
#include "UCvsGraph.h"
#include "UCvsFiles.h"
#include "CvsEntries.h"
#include "CvsLog.h"
#include "AppConsole.h"
#include "udraw.h"

Include dependency graph for UCvsGraph.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | CScrollView
class | CWinLogBranchData
class | CWinLogData
class | CWinLogHeaderData
class | CWinLogRevData
class | CWinLogTagData

Functions

void | DrawNode (UDC &hdc, const URect &selfB, UCOLORREF contour, UCOLORREF shadowc, bool isRounded, bool issel)

Variables

const int | kVChildSpace = 8
const int | kHChildSpace = 40
const int | kInflateNodeSpace = 8

Function Documentation

void DrawNode | ( | UDC & | hdc,
 |  | const URect & | selfB,
 |  | UCOLORREF | contour,
 |  | UCOLORREF | shadowc,
 |  | bool | isRounded,
 |  | bool | issel
 | ) | [static]

Definition at line 197 of file UCvsGraph.cpp.

References UPen::CreatePen, UBrush::CreateSolidBrush, UPen::DeleteObject, UBrush::DeleteObject, URect::OffsetRect, UDC::Rectangle, UDC::RoundRect, UDC::SelectObject, UCOLORREF, UPS_SOLID, and URGB.

00200 {
00201     UPen *pOldPen = 0L;
00202     UBrush *pOldBrush = 0L;
00203     UPen pen, pen2;
00204     UBrush brush;
00205     UCOLORREF selcolor = URGB(160, 160, 160);
00206     UCOLORREF wcolor = URGB(255, 255, 255);
00207
00208     try
00209     {
00210         if(!isRounded)
00211         {
00212             if(!issel)
00213             {
00214                 brush.CreateSolidBrush(wcolor);
00215                 pOldBrush = hdc.SelectObject(&brush);
00216                 pen.CreatePen(UPS_SOLID, 1, contour);
00217                 pOldPen = hdc.SelectObject(&pen);
00218                 hdc.Rectangle(selfB);
00219             }
00220             else
00221             {
00222                 brush.CreateSolidBrush(selcolor);
00223                 pOldBrush = hdc.SelectObject(&brush);
00224                 pen.CreatePen(UPS_SOLID, 1, contour);
00225                 pOldPen = hdc.SelectObject(&pen);
00226                 hdc.Rectangle(selfB);
00227             }
00228         }
00229         else
00230         {
00231             URect shadow;
00232             if(!issel)
00233             {
00234                 brush.CreateSolidBrush(shadowc);
00235                 pOldBrush = hdc.SelectObject(&brush);
00236                 pen.CreatePen(UPS_SOLID, 1, shadowc);
00237                 pOldPen = hdc.SelectObject(&pen);
00238                 shadow = selfB;
00239                 shadow.OffsetRect(UPoint(2, 2));
00240                 hdc.RoundRect(&shadow, UPoint(6, 6));
00241
00242                 brush.DeleteObject();
00243                 brush.CreateSolidBrush(wcolor);
00244                 hdc.SelectObject(&brush);
00245                 pen2.CreatePen(UPS_SOLID, 1, contour);
00246                 hdc.SelectObject(&pen2);
00247                 hdc.RoundRect(selfB, UPoint(6, 6));
00248             }
00249             else
00250             {
00251                 brush.CreateSolidBrush(shadowc);
00252                 pOldBrush = hdc.SelectObject(&brush);
00253                 pen.CreatePen(UPS_SOLID, 1, shadowc);
00254                 pOldPen = hdc.SelectObject(&pen);
00255                 shadow = selfB;
00256                 shadow.OffsetRect(UPoint(2, 2));
00257                 hdc.RoundRect(&shadow, UPoint(6, 6));
00258
00259                 brush.DeleteObject();
00260                 brush.CreateSolidBrush(selcolor);
00261                 hdc.SelectObject(&brush);
00262                 pen2.CreatePen(UPS_SOLID, 1, contour);
00263                 hdc.SelectObject(&pen2);
00264                 hdc.RoundRect(selfB, UPoint(6, 6));
00265             }
00266         }
00267
00268         if (pOldPen != 0L)
00269         {
00270             hdc.SelectObject(pOldPen);
00271             pOldPen = 0L;
00272         }
00273         if (pOldBrush != 0L)
00274         {
00275             hdc.SelectObject(pOldBrush);
00276             pOldBrush = 0L;
00277         }
00278
00279         pen.DeleteObject();
00280         pen2.DeleteObject();
00281         brush.DeleteObject();
00282     }
00283     catch(...)
00284     {
00285         if (pOldPen != 0L)
00286             hdc.SelectObject(pOldPen);
00287         if (pOldBrush != 0L)
00288             hdc.SelectObject(pOldBrush);
00289     }
00290 }

Variable Documentation

const int kHChildSpace = 40

Definition at line 469 of file UCvsGraph.cpp.

Referenced by CWinLogData::ComputeBounds.

const int kInflateNodeSpace = 8

Definition at line 470 of file UCvsGraph.cpp.

Referenced by CWinLogData::ComputeBounds.

const int kVChildSpace = 8

Definition at line 468 of file UCvsGraph.cpp.

Referenced by CWinLogData::ComputeBounds.

Generated on Sun Feb 24 01:22:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsGraph.h File Reference

common/UCvsGraph.h File Reference

#include "uwidget.h"

Include dependency graph for UCvsGraph.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class UCvsGraph

Generated on Sun Feb 24 01:22:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsMenubar.cpp File Reference

common/UCvsMenubar.cpp File Reference

#include "stdafx.h"
#include "UCvsMenubar.h"
#include "UCvsCommands.h"
#include "MacrosSetup.h"

Include dependency graph for UCvsMenubar.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void CreateMainMenubar (int widid)

Function Documentation

void CreateMainMenubar ( int widid )

Definition at line 55 of file UCvsMenubar.cpp.

References cmdABOUT, cmdADD, cmdADDB, cmdARRANGE, cmdBROWSER_BAR, cmdCASCADE, cmdCHECKOUT, cmdCLEAR_ALL, cmdCMDLINE, cmdCOMMIT, cmdCONSOLE_BAR, cmdCOPY, cmdCOPYRIGHTS, cmdCREDITS, cmdCUT, cmdCVS, cmdCVSCLIENT, cmdDIFF, cmdEDIT, cmdEDITORS, cmdEDITSEL, cmdEDITSELDEF, cmdEXIT, cmdEXPLORE, cmdFILES_BAR, cmdFIND, cmdFINDER, cmdFONT, cmdGRAPH, cmdIMPORT, cmdINIT, cmdLOCKF, cmdLOG, cmdLOGIN, cmdLOGOUT, cmdMACROADMIN, cmdMULTI_BAR, cmdOPEN, cmdPASTE, cmdPREFERENCES, cmdPRINT, cmdPRINT_PREVIEW, cmdPRINT_SETUP, cmdQUERYUPDATE, cmdRELEASE, cmdRELOAD, cmdREPEAT, cmdRMV, cmdRTAGBRANCH, cmdRTAGCREATE, cmdRTAGDELETE, cmdSAVE, cmdSAVE_AS, cmdSAVESETTINGS, cmdSELECT_ALL, cmdSELMACRO, cmdSEND_MAIL, cmdSTATUS, cmdSTATUS_BAR, cmdSTOPCVS, cmdTAGBRANCH, cmdTAGDELETE, cmdTAGNEW, cmdTAGS_BAR, cmdTILE_HORZ, cmdTOOLBAR, cmdTRASH, cmdUNDO, cmdUNEDIT, cmdUNLOCKF, cmdUPDATE, cmdWATCHERS, cmdWATCHOFF, cmdWATCHON, cmdWORKSPACE, UMENU, UMENU_NULL, UMenuAddButton, UMenuAddPulldown, and UMenuAddSeparator.

00056 {
00057     std::vector<CMacroEntry>::const_iterator i;
00058     int cnt;
00059
00060     UMENU menu = UMenuAddPulldown(widid, "&File", UMENU_NULL);
00061     UMenuAddButton(widid, "&Save\tCtrl+S", menu, 0L, cmdSAVE);
00062     UMenuAddButton(widid, "Save &As...", menu, 0L, cmdSAVE_AS);
00063     UMenuAddSeparator(widid, menu);
00064     UMenuAddButton(widid, "&Print...\tCtrl+P", menu, 0L, cmdPRINT);
00065     UMenuAddButton(widid, "Print Pre&view", menu, 0L, cmdPRINT_PREVIEW);
00066     UMenuAddButton(widid, "P&rint Setup...", menu, 0L, cmdPRINT_SETUP);
00067     UMenuAddSeparator(widid, menu);
00068     UMenuAddButton(widid, "Sen&d...", menu, 0L, cmdSEND_MAIL);
00069     UMenuAddSeparator(widid, menu);
00070     UMenuAddButton(widid, "E&xit\tCtrl+Q", menu, 0L, cmdEXIT);
00071
00072     menu = UMenuAddPulldown(widid, "&Edit", UMENU_NULL);
00073     UMenuAddButton(widid, "&Undo\tCtrl+Z", menu, 0L, cmdUNDO);
00074     UMenuAddSeparator(widid, menu);
00075     UMenuAddButton(widid, "Cu&t\tCtrl+X", menu, 0L, cmdCUT);
00076     UMenuAddButton(widid, "&Copy\tCtrl+C", menu, 0L, cmdCOPY);
00077     UMenuAddButton(widid, "&Paste\tCtrl+V", menu, 0L, cmdPASTE);
00078     UMenuAddSeparator(widid, menu);
00079     UMenuAddButton(widid, "Select &All\tCtrl+A", menu, 0L, cmdSELECT_ALL);
00080     UMenuAddButton(widid, "&Erase all", menu, 0L, cmdCLEAR_ALL);
00081     UMenuAddSeparator(widid, menu);
00082     UMenuAddButton(widid, "&Find...\tCtrl+F", menu, 0L, cmdFIND);
00083     UMenuAddButton(widid, "Find next\tF3", menu, 0L, cmdREPEAT);
00084     UMenuAddSeparator(widid, menu);
00085     UMenuAddButton(widid, "F&ont...", menu, 0L, cmdFONT);
00086
00087     menu = UMenuAddPulldown(widid, "&View", UMENU_NULL);
00088     UMenuAddButton(widid, "&Toolbar", menu, 0L, cmdTOOLBAR);
00089     UMenuAddButton(widid, "&Status Bar", menu, 0L, cmdSTATUS_BAR);
00090     UMenuAddButton(widid, "&Browser Bar", menu, 0L, cmdBROWSER_BAR);
00091     UMenuAddButton(widid, "&Files Bar", menu, 0L, cmdFILES_BAR);
00092     UMenuAddButton(widid, "&Multi-Users Bar", menu, 0L, cmdMULTI_BAR);
00093     UMenuAddButton(widid, "T&ags Bar", menu, 0L, cmdTAGS_BAR);
00094     UMenuAddButton(widid, "&Console Bar", menu, 0L, cmdCONSOLE_BAR);
00095     UMenuAddButton(widid, "&Workspace Bar", menu, 0L, cmdWORKSPACE);
00096     UMenuAddSeparator(widid, menu);
00097     UMenuAddButton(widid, "Change browser &location...", menu, 0L, cmdOPEN);
00098     UMenuAddButton(widid, "S&ave settings for location...", menu, 0L, cmdSAVESETTINGS);
00099
00100     menu = UMenuAddPulldown(widid, "&Admin", UMENU_NULL);
00101     UMenuAddButton(widid, "Pr&eferences...\tCtrl+F1", menu, 0L, cmdPREFERENCES);
00102     UMenuAddButton(widid, "&Command Line...", menu, 0L, cmdCMDLINE);
00103     UMenuAddSeparator(widid, menu);
00104     UMenuAddButton(widid, "&Login...", menu, 0L, cmdLOGIN);
00105     UMenuAddButton(widid, "Lo&gout", menu, 0L, cmdLOGOUT);
00106     UMenuAddSeparator(widid, menu);
00107     UMenuAddButton(widid, "&Stop cvs", menu, 0L, cmdSTOPCVS);
00108     menu = UMenuAddPulldown(widid, "Macros admin", menu);
00109     for(cnt = 0, i = gMacrosAdmin.entries.begin(); i != gMacrosAdmin.entries.end(); ++i, cnt++)
00110     {
00111         UMenuAddButton(widid, (*i).name, menu, 0L, cmdMACROADMIN + cnt);
00112     }
00113
00114     menu = UMenuAddPulldown(widid, "&Create", UMENU_NULL);
00115     UMenuAddButton(widid, "&Create a new repository...", menu, 0L, cmdINIT);
00116     UMenuAddSeparator(widid, menu);
00117     UMenuAddButton(widid, "Import module...", menu, 0L, cmdIMPORT);
00118     UMenuAddButton(widid, "Checkout module...", menu, 0L, cmdCHECKOUT);
00119     UMenuAddSeparator(widid, menu);
00120     UMenuAddButton(widid, "&Create a tag by module...", menu, 0L, cmdRTAGCREATE);
00121     UMenuAddButton(widid, "&Delete a tag by module...", menu, 0L, cmdRTAGDELETE);
00122     UMenuAddButton(widid, "Create a &branch by module...", menu, 0L, cmdRTAGBRANCH);
00123
00124     menu = UMenuAddPulldown(widid, "&Modify", UMENU_NULL);
00125     UMenuAddButton(widid, "&Update selection...\tCtrl+U", menu, 0L, cmdUPDATE);
00126     UMenuAddButton(widid, "Co&mmit selection...\tCtrl+M", menu, 0L, cmdCOMMIT);
00127     UMenuAddSeparator(widid, menu);
00128     UMenuAddButton(widid, "&Add selection", menu, 0L, cmdADD);
00129     UMenuAddButton(widid, "Add selection binar&y", menu, 0L, cmdADDB);
00130     UMenuAddButton(widid, "&Remove selection", menu, 0L, cmdRMV);
00131     UMenuAddSeparator(widid, menu);
00132     UMenuAddButton(widid, "Erase &selection\tCtrl+Backspace", menu, 0L, cmdTRASH);
00133     UMenuAddSeparator(widid, menu);
00134     UMenuAddButton(widid, "&Create a tag on selection...", menu, 0L, cmdTAGNEW);
00135     UMenuAddButton(widid, "&Delete a tag on selection...", menu, 0L, cmdTAGDELETE);
00136     UMenuAddButton(widid, "Create a &branch on selection...", menu, 0L, cmdTAGBRANCH);
00137
00138     menu = UMenuAddPulldown(widid, "&Query", UMENU_NULL);
00139     UMenuAddButton(widid, "E&xplore selection\tF2", menu, 0L, cmdEXPLORE);
00140     UMenuAddButton(widid, "&Query Update\tF4", menu, 0L, cmdQUERYUPDATE);
00141     UMenuAddButton(widid, "R&eload view\tF5", menu, 0L, cmdRELOAD);
00142     UMenuAddSeparator(widid, menu);
00143     UMenuAddButton(widid, "View selection\tF7", menu, 0L, cmdEDITSEL);
00144     UMenuAddButton(widid, "View default", menu, 0L, cmdEDITSELDEF);
00145     UMenuAddSeparator(widid, menu);
00146     UMenuAddButton(widid, "&Diff selection\tAlt+=", menu, 0L, cmdDIFF);
00147     UMenuAddButton(widid, "&Log selection", menu, 0L, cmdLOG);
00148     UMenuAddButton(widid, "Status sele&ction", menu, 0L, cmdSTATUS);
00149     UMenuAddButton(widid, "Graph selection\tCtrl+G", menu, 0L, cmdGRAPH);
00150
00151     menu = UMenuAddPulldown(widid, "&Trace", UMENU_NULL);
00152     UMenuAddButton(widid, "Lock selection", menu, 0L, cmdLOCKF);
00153     UMenuAddButton(widid, "Unlock selection", menu, 0L, cmdUNLOCKF);
00154     UMenuAddButton(widid, "Edit selection", menu, 0L, cmdEDIT);
00155     UMenuAddButton(widid, "Unedit selection", menu, 0L, cmdUNEDIT);
00156     UMenuAddButton(widid, "Add a Watch on selection", menu, 0L, cmdWATCHON);
00157     UMenuAddButton(widid, "Remove a watch from selection", menu, 0L, cmdWATCHOFF);
00158     UMenuAddSeparator(widid, menu);
00159     UMenuAddButton(widid, "Release selection", menu, 0L, cmdRELEASE);
00160     UMenuAddSeparator(widid, menu);
00161     UMenuAddButton(widid, "Watchers of selection", menu, 0L, cmdWATCHERS);
00162     UMenuAddButton(widid, "Editors of selection", menu, 0L, cmdEDITORS);
00163
00164     menu = UMenuAddPulldown(widid, "Macro&s", UMENU_NULL);
00165     for(cnt = 0, i = gMacrosSel.entries.begin(); i != gMacrosSel.entries.end(); ++i, cnt++)
00166     {
00167         UMenuAddButton(widid, (*i).name, menu, 0L, cmdSELMACRO + cnt);
00168     }
00169
00170     menu = UMenuAddPulldown(widid, "&Window", UMENU_NULL);
00171     UMenuAddButton(widid, "&Cascade", menu, 0L, cmdCASCADE);
00172     UMenuAddButton(widid, "&Tile", menu, 0L, cmdTILE_HORZ);
00173     UMenuAddButton(widid, "&Arrange Icons", menu, 0L, cmdARRANGE);
00174
00175     menu = UMenuAddPulldown(widid, "&Help", UMENU_NULL);
00176     UMenuAddButton(widid, "&Help Topics", menu, 0L, cmdFINDER);
00177     UMenuAddButton(widid, "Help on cvs-1.10", menu, 0L, cmdCVS);
00178     UMenuAddButton(widid, "Help on cvs client", menu, 0L, cmdCVSCLIENT);
00179     UMenuAddSeparator(widid, menu);
00180     UMenuAddButton(widid, "&About wincvs...", menu, 0L, cmdABOUT);
00181     UMenuAddButton(widid, "&Credits", menu, 0L, cmdCREDITS);
00182     UMenuAddButton(widid, "C&opyrights", menu, 0L, cmdCOPYRIGHTS);
00183 }

Generated on Sun Feb 24 01:22:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsMenubar.h File Reference

common/UCvsMenubar.h File Reference

#include "umenu.h"

Include dependency graph for UCvsMenubar.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | UCvsMenubar

Functions

void | CreateMainMenubar (int widid)

Function Documentation

void CreateMainMenubar ( int widid )

Definition at line 55 of file UCvsMenubar.cpp.

00056 {
00057     std::vector<CMacroEntry>::const_iterator i;
00058     int cnt;
00059
00060     UMENU menu = UMenuAddPulldown(widid, "&File", UMENU_NULL);
00061     UMenuAddButton(widid, "&Save\tCtrl+S", menu, 0L, cmdSAVE);
00062     UMenuAddButton(widid, "Save &As...", menu, 0L, cmdSAVE_AS);
00063     UMenuAddSeparator(widid, menu);
00064     UMenuAddButton(widid, "&Print...\tCtrl+P", menu, 0L, cmdPRINT);
00065     UMenuAddButton(widid, "Print Pre&view", menu, 0L, cmdPRINT_PREVIEW);
00066     UMenuAddButton(widid, "P&rint Setup...", menu, 0L, cmdPRINT_SETUP);
00067     UMenuAddSeparator(widid, menu);
00068     UMenuAddButton(widid, "Sen&d...", menu, 0L, cmdSEND_MAIL);
00069     UMenuAddSeparator(widid, menu);
00070     UMenuAddButton(widid, "E&xit\tCtrl+Q", menu, 0L, cmdEXIT);
00071
00072     menu = UMenuAddPulldown(widid, "&Edit", UMENU_NULL);
00073     UMenuAddButton(widid, "&Undo\tCtrl+Z", menu, 0L, cmdUNDO);
00074     UMenuAddSeparator(widid, menu);
00075     UMenuAddButton(widid, "Cu&t\tCtrl+X", menu, 0L, cmdCUT);
00076     UMenuAddButton(widid, "&Copy\tCtrl+C", menu, 0L, cmdCOPY);
00077     UMenuAddButton(widid, "&Paste\tCtrl+V", menu, 0L, cmdPASTE);
00078     UMenuAddSeparator(widid, menu);
00079     UMenuAddButton(widid, "Select &All\tCtrl+A", menu, 0L, cmdSELECT_ALL);
00080     UMenuAddButton(widid, "&Erase all", menu, 0L, cmdCLEAR_ALL);
00081     UMenuAddSeparator(widid, menu);
00082     UMenuAddButton(widid, "&Find...\tCtrl+F", menu, 0L, cmdFIND);
00083     UMenuAddButton(widid, "Find next\tF3", menu, 0L, cmdREPEAT);
00084     UMenuAddSeparator(widid, menu);
00085     UMenuAddButton(widid, "F&ont...", menu, 0L, cmdFONT);
00086
00087     menu = UMenuAddPulldown(widid, "&View", UMENU_NULL);
00088     UMenuAddButton(widid, "&Toolbar", menu, 0L, cmdTOOLBAR);
00089     UMenuAddButton(widid, "&Status Bar", menu, 0L, cmdSTATUS_BAR);
00090     UMenuAddButton(widid, "&Browser Bar", menu, 0L, cmdBROWSER_BAR);
00091     UMenuAddButton(widid, "&Files Bar", menu, 0L, cmdFILES_BAR);
00092     UMenuAddButton(widid, "&Multi-Users Bar", menu, 0L, cmdMULTI_BAR);
00093     UMenuAddButton(widid, "T&ags Bar", menu, 0L, cmdTAGS_BAR);
00094     UMenuAddButton(widid, "&Console Bar", menu, 0L, cmdCONSOLE_BAR);
00095     UMenuAddButton(widid, "&Workspace Bar", menu, 0L, cmdWORKSPACE);
00096     UMenuAddSeparator(widid, menu);
00097     UMenuAddButton(widid, "Change browser &location...", menu, 0L, cmdOPEN);
00098     UMenuAddButton(widid, "S&ave settings for location...", menu, 0L, cmdSAVESETTINGS);
00099
00100     menu = UMenuAddPulldown(widid, "&Admin", UMENU_NULL);
00101     UMenuAddButton(widid, "Pr&eferences...\tCtrl+F1", menu, 0L, cmdPREFERENCES);
00102     UMenuAddButton(widid, "&Command Line...", menu, 0L, cmdCMDLINE);
00103     UMenuAddSeparator(widid, menu);
00104     UMenuAddButton(widid, "&Login...", menu, 0L, cmdLOGIN);
00105     UMenuAddButton(widid, "Lo&gout", menu, 0L, cmdLOGOUT);
00106     UMenuAddSeparator(widid, menu);
00107     UMenuAddButton(widid, "&Stop cvs", menu, 0L, cmdSTOPCVS);
00108     menu = UMenuAddPulldown(widid, "Macros admin", menu);
00109     for(cnt = 0, i = gMacrosAdmin.entries.begin(); i != gMacrosAdmin.entries.end(); ++i, cnt++)
00110     {
00111         UMenuAddButton(widid, (*i).name, menu, 0L, cmdMACROADMIN + cnt);
00112     }
00113
00114     menu = UMenuAddPulldown(widid, "&Create", UMENU_NULL);
00115     UMenuAddButton(widid, "&Create a new repository...", menu, 0L, cmdINIT);
00116     UMenuAddSeparator(widid, menu);
00117     UMenuAddButton(widid, "Import module...", menu, 0L, cmdIMPORT);
00118     UMenuAddButton(widid, "Checkout module...", menu, 0L, cmdCHECKOUT);
00119     UMenuAddSeparator(widid, menu);
00120     UMenuAddButton(widid, "&Create a tag by module...", menu, 0L, cmdRTAGCREATE);
00121     UMenuAddButton(widid, "&Delete a tag by module...", menu, 0L, cmdRTAGDELETE);
00122     UMenuAddButton(widid, "Create a &branch by module...", menu, 0L, cmdRTAGBRANCH);
00123
00124     menu = UMenuAddPulldown(widid, "&Modify", UMENU_NULL);
00125     UMenuAddButton(widid, "&Update selection...\tCtrl+U", menu, 0L, cmdUPDATE);
00126     UMenuAddButton(widid, "Co&mmit selection...\tCtrl+M", menu, 0L, cmdCOMMIT);
00127     UMenuAddSeparator(widid, menu);
00128     UMenuAddButton(widid, "&Add selection", menu, 0L, cmdADD);
00129     UMenuAddButton(widid, "Add selection binar&y", menu, 0L, cmdADDB);
00130     UMenuAddButton(widid, "&Remove selection", menu, 0L, cmdRMV);
00131     UMenuAddSeparator(widid, menu);
00132     UMenuAddButton(widid, "Erase &selection\tCtrl+Backspace", menu, 0L, cmdTRASH);
00133     UMenuAddSeparator(widid, menu);
00134     UMenuAddButton(widid, "&Create a tag on selection...", menu, 0L, cmdTAGNEW);
00135     UMenuAddButton(widid, "&Delete a tag on selection...", menu, 0L, cmdTAGDELETE);
00136     UMenuAddButton(widid, "Create a &branch on selection...", menu, 0L, cmdTAGBRANCH);
00137
00138     menu = UMenuAddPulldown(widid, "&Query", UMENU_NULL);
00139     UMenuAddButton(widid, "E&xplore selection\tF2", menu, 0L, cmdEXPLORE);
00140     UMenuAddButton(widid, "&Query Update\tF4", menu, 0L, cmdQUERYUPDATE);
00141     UMenuAddButton(widid, "R&eload view\tF5", menu, 0L, cmdRELOAD);
00142     UMenuAddSeparator(widid, menu);
00143     UMenuAddButton(widid, "View selection\tF7", menu, 0L, cmdEDITSEL);
00144     UMenuAddButton(widid, "View default", menu, 0L, cmdEDITSELDEF);
00145     UMenuAddSeparator(widid, menu);
00146     UMenuAddButton(widid, "&Diff selection\tAlt+=", menu, 0L, cmdDIFF);
00147     UMenuAddButton(widid, "&Log selection", menu, 0L, cmdLOG);
00148     UMenuAddButton(widid, "Status sele&ction", menu, 0L, cmdSTATUS);
00149     UMenuAddButton(widid, "Graph selection\tCtrl+G", menu, 0L, cmdGRAPH);
00150
00151     menu = UMenuAddPulldown(widid, "&Trace", UMENU_NULL);
00152     UMenuAddButton(widid, "Lock selection", menu, 0L, cmdLOCKF);
00153     UMenuAddButton(widid, "Unlock selection", menu, 0L, cmdUNLOCKF);
00154     UMenuAddButton(widid, "Edit selection", menu, 0L, cmdEDIT);
00155     UMenuAddButton(widid, "Unedit selection", menu, 0L, cmdUNEDIT);
00156     UMenuAddButton(widid, "Add a Watch on selection", menu, 0L, cmdWATCHON);
00157     UMenuAddButton(widid, "Remove a watch from selection", menu, 0L, cmdWATCHOFF);
00158     UMenuAddSeparator(widid, menu);
00159     UMenuAddButton(widid, "Release selection", menu, 0L, cmdRELEASE);
00160     UMenuAddSeparator(widid, menu);
00161     UMenuAddButton(widid, "Watchers of selection", menu, 0L, cmdWATCHERS);
00162     UMenuAddButton(widid, "Editors of selection", menu, 0L, cmdEDITORS);
00163
00164     menu = UMenuAddPulldown(widid, "Macro&s", UMENU_NULL);
00165     for(cnt = 0, i = gMacrosSel.entries.begin(); i != gMacrosSel.entries.end(); ++i, cnt++)
00166     {
00167         UMenuAddButton(widid, (*i).name, menu, 0L, cmdSELMACRO + cnt);
00168     }
00169
00170     menu = UMenuAddPulldown(widid, "&Window", UMENU_NULL);
00171     UMenuAddButton(widid, "&Cascade", menu, 0L, cmdCASCADE);
00172     UMenuAddButton(widid, "&Tile", menu, 0L, cmdTILE_HORZ);
00173     UMenuAddButton(widid, "&Arrange Icons", menu, 0L, cmdARRANGE);
00174
00175     menu = UMenuAddPulldown(widid, "&Help", UMENU_NULL);
00176     UMenuAddButton(widid, "&Help Topics", menu, 0L, cmdFINDER);
00177     UMenuAddButton(widid, "Help on cvs-1.10", menu, 0L, cmdCVS);
00178     UMenuAddButton(widid, "Help on cvs client", menu, 0L, cmdCVSCLIENT);
00179     UMenuAddSeparator(widid, menu);
00180     UMenuAddButton(widid, "&About wincvs...", menu, 0L, cmdABOUT);
00181     UMenuAddButton(widid, "&Credits", menu, 0L, cmdCREDITS);
00182     UMenuAddButton(widid, "C&opyrights", menu, 0L, cmdCOPYRIGHTS);
00183 }

Generated on Sun Feb 24 01:22:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsToolbar.cpp File Reference

common/UCvsToolbar.cpp File Reference

#include "stdafx.h"
#include "UCvsToolbar.h"
#include "UCvsCommands.h"

Include dependency graph for UCvsToolbar.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void CreateMainToolbar (void)

Function Documentation

void CreateMainToolbar ( void )

Definition at line 54 of file UCvsToolbar.cpp.

References cmdADD, cmdADDB, cmdCOMMIT, cmdDIFF, cmdEDIT, cmdEXPLORE, cmdGRAPH, cmdIGNORE, cmdLOCKF, cmdLOG, cmdRELEASE, cmdRELOAD, cmdRMV, cmdSTATUS, cmdSTOPCVS, cmdTAGBRANCH, cmdTAGDELETE, cmdTAGNEW, cmdTRASH, cmdUNEDIT, cmdUNLOCKF, cmdUPDATE, cmdUPFOLDER, cmdWATCHOFF, cmdWATCHON, DDD_NONE, DDV_NONE, EV_TB_BUTTON, EV_TB_CHECKBTN, EV_TB_END, EV_TB_INIT, EV_TB_SEPARATOR, UTB_INIT::heightbtn, kUCvsToolbarID, UTB_INIT::title, UEventSendMessage, and UTB_INIT::widthbtn.

00055 {
00056     UTB_INIT init;
00057     init.widthbtn = 16;
00058     init.heightbtn = 16;
00059     init.title = "Main Toolbar";
00060     UEventSendMessage(kUCvsToolbarID, EV_TB_INIT, 0, &init);
00061
00062     UTB_BUTTON updtBtn = {
00063         "update.xpm",
00064         cmdUPDATE,
00065         DDV_NONE,
00066         DDD_NONE,
00067         "Update the selected items, changes your disk only\nUpdate selected"
00068     };
00069     UTB_BUTTON commitBtn = {
00070         "commit.xpm",
00071         cmdCOMMIT,
00072         DDV_NONE,
00073         DDD_NONE,
00074         "Commit the selected items, changes the remote repository\nCommit selected"
00075     };
00076     UTB_BUTTON stopBtn = {
00077         "stop.xpm",
00078         cmdSTOPCVS,
00079         DDV_NONE,
00080         DDD_NONE,
00081         "Stop when cvs is running...\nStop cvs..."
00082     };
00083     UTB_BUTTON ignoreBtn = {
00084         "ignore.xpm",
00085         cmdIGNORE,
00086         DDV_NONE,
00087         DDD_NONE,
00088         "View or hide the cvs ignored files/folders\nIgnore switch"
00089     };
00090     UTB_BUTTON reloadBtn = {
00091         "reload.xpm",
00092         cmdRELOAD,
00093         DDV_NONE,
00094         DDD_NONE,
00095         "Refresh the views, updating the contents\nRefresh view"
00096     };
00097     UTB_BUTTON exploreBtn = {
00098         "explore.xpm",
00099         cmdEXPLORE,
00100         DDV_NONE,
00101         DDD_NONE,
00102         "Open an explorer window for this selection\nExplore selection"
00103     };
00104     UTB_BUTTON upBtn = {
00105         "upfolder.xpm",
00106         cmdUPFOLDER,
00107         DDV_NONE,
00108         DDD_NONE,
00109         "Go to the upper folder and refresh\nUp one level"
00110     };
00111     UTB_BUTTON diffBtn = {
00112         "diff.xpm",
00113         cmdDIFF,
00114         DDV_NONE,
00115         DDD_NONE,
00116         "Print the differences with the CVS remote repository\nDiff selected"
00117     };
00118     UTB_BUTTON logBtn = {
00119         "log.xpm",
00120         cmdLOG,
00121         DDV_NONE,
00122         DDD_NONE,
00123         "Print the history of the selected files\nLog selected"
00124     };
00125     UTB_BUTTON statusBtn = {
00126         "status.xpm",
00127         cmdSTATUS,
00128         DDV_NONE,
00129         DDD_NONE,
00130         "Print the current status of the selected files\nStatus selected"
00131     };
00132     UTB_BUTTON graphBtn = {
00133         "graph.xpm",
00134         cmdGRAPH,
00135         DDV_NONE,
00136         DDD_NONE,
00137         "Print the history as a graph of the selected files\nGraph selected"
00138     };
00139     UTB_BUTTON trashBtn = {
00140         "trash.xpm",
00141         cmdTRASH,
00142         DDV_NONE,
00143         DDD_NONE,
00144         "Erase the selection from your disk\nErase selected"
00145     };
00146     UTB_BUTTON addBtn = {
00147         "add.xpm",
00148         cmdADD,
00149         DDV_NONE,
00150         DDD_NONE,
00151         "Add the selected items to the remote CVS repository\nAdd selected"
00152     };
00153     UTB_BUTTON addbBtn = {
00154         "addb.xpm",
00155         cmdADDB,
00156         DDV_NONE,
00157         DDD_NONE,
00158         "Add the selected binary items to the remote CVS repository\nAdd selected binary"
00159     };
00160     UTB_BUTTON rmvBtn = {
00161         "remove.xpm",
00162         cmdRMV,
00163         DDV_NONE,
00164         DDD_NONE,
00165         "Remove the selected items to the remote CVS repository\nRemove selected"
00166     };
00167     UTB_BUTTON tagBtn = {
00168         "tag.xpm",
00169         cmdTAGNEW,
00170         DDV_NONE,
00171         DDD_NONE,
00172         "Create/move a tag on the selection\nTag selection"
00173     };
00174     UTB_BUTTON untagBtn = {
00175         "untag.xpm",
00176         cmdTAGDELETE,
00177         DDV_NONE,
00178         DDD_NONE,
00179         "Remove a tag on the selection\nUntag selection"
00180     };
00181     UTB_BUTTON branchBtn = {
00182         "branch.xpm",
00183         cmdTAGBRANCH,
00184         DDV_NONE,
00185         DDD_NONE,
00186         "Open (fork) a branch on the selection\nFork selection"
00187     };
00188     UTB_BUTTON lockBtn = {
00189         "lock.xpm",
00190         cmdLOCKF,
00191         DDV_NONE,
00192         DDD_NONE,
00193         "Lock the selected file on the remote repository until next commit\nLock selection"
00194     };
00195     UTB_BUTTON unlockBtn = {
00196         "unlock.xpm",
00197         cmdUNLOCKF,
00198         DDV_NONE,
00199         DDD_NONE,
00200         "Unlock the selected file on the remote repository\nUnlock selection"
00201     };
00202     UTB_BUTTON watchBtn = {
00203         "watch.xpm",
00204         cmdWATCHON,
00205         DDV_NONE,
00206         DDD_NONE,
00207         "Put a watch on the selected files\nWatch selection"
00208     };
00209     UTB_BUTTON unwatchBtn = {
00210         "unwatch.xpm",
00211         cmdWATCHOFF,
00212         DDV_NONE,
00213         DDD_NONE,
00214         "Release a watch on the selected files\nRelease watch selection"
00215     };
00216     UTB_BUTTON editBtn = {
00217         "edit.xpm",
00218         cmdEDIT,
00219         DDV_NONE,
00220         DDD_NONE,
00221         "Edit the selected files\nEdit selection"
00222     };
00223     UTB_BUTTON uneditBtn = {
00224         "unedit.xpm",
00225         cmdUNEDIT,
00226         DDV_NONE,
00227         DDD_NONE,
00228         "Unedit the selected files\nUnedit selection"
00229     };
00230     UTB_BUTTON releaseBtn = {
00231         "release.xpm",
00232         cmdRELEASE,
00233         DDV_NONE,
00234         DDD_NONE,
00235         "Release the selected files\nRelease selection"
00236     };
00237     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &updtBtn);
00238     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &commitBtn);
00239     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00240     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &stopBtn);
00241     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00242     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &addBtn);
00243     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &addbBtn);
00244     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &rmvBtn);
00245     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00246     UEventSendMessage(kUCvsToolbarID, EV_TB_CHECKBTN, 0, &ignoreBtn);
00247     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &reloadBtn);
00248     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &exploreBtn);
00249     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &upBtn);
00250     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00251     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &diffBtn);
00252     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &logBtn);
00253     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &statusBtn);
00254     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00255     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &graphBtn);
00256     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00257     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &trashBtn);
00258     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00259     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &tagBtn);
00260     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &untagBtn);
00261     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &branchBtn);
00262     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00263     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &lockBtn);
00264     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &unlockBtn);
00265     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00266     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &watchBtn);
00267     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &unwatchBtn);
00268     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00269     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &editBtn);
00270     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &uneditBtn);
00271     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00272     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &releaseBtn);
00273
00274     UEventSendMessage(kUCvsToolbarID, EV_TB_END, 0, 0L);
00275 }

Generated on Sun Feb 24 01:22:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsToolbar.h File Reference

common/UCvsToolbar.h File Reference

#include "utoolbar.h"

Include dependency graph for UCvsToolbar.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | UCvsToolbar

Functions

void | CreateMainToolbar (void)

Function Documentation

void CreateMainToolbar ( void )

Definition at line 54 of file UCvsToolbar.cpp.

00055 {
00056     UTB_INIT init;
00057     init.widthbtn = 16;
00058     init.heightbtn = 16;
00059     init.title = "Main Toolbar";
00060     UEventSendMessage(kUCvsToolbarID, EV_TB_INIT, 0, &init);
00061
00062     UTB_BUTTON updtBtn = {
00063         "update.xpm",
00064         cmdUPDATE,
00065         DDV_NONE,
00066         DDD_NONE,
00067         "Update the selected items, changes your disk only\nUpdate selected"
00068     };
00069     UTB_BUTTON commitBtn = {
00070         "commit.xpm",
00071         cmdCOMMIT,
00072         DDV_NONE,
00073         DDD_NONE,
00074         "Commit the selected items, changes the remote repository\nCommit selected"
00075     };
00076     UTB_BUTTON stopBtn = {
00077         "stop.xpm",
00078         cmdSTOPCVS,
00079         DDV_NONE,
00080         DDD_NONE,
00081         "Stop when cvs is running...\nStop cvs..."
00082     };
00083     UTB_BUTTON ignoreBtn = {
00084         "ignore.xpm",
00085         cmdIGNORE,
00086         DDV_NONE,
00087         DDD_NONE,
00088         "View or hide the cvs ignored files/folders\nIgnore switch"
00089     };
00090     UTB_BUTTON reloadBtn = {
00091         "reload.xpm",
00092         cmdRELOAD,
00093         DDV_NONE,
00094         DDD_NONE,
00095         "Refresh the views, updating the contents\nRefresh view"
00096     };
00097     UTB_BUTTON exploreBtn = {
00098         "explore.xpm",
00099         cmdEXPLORE,
00100         DDV_NONE,
00101         DDD_NONE,
00102         "Open an explorer window for this selection\nExplore selection"
00103     };
00104     UTB_BUTTON upBtn = {
00105         "upfolder.xpm",
00106         cmdUPFOLDER,
00107         DDV_NONE,
00108         DDD_NONE,
00109         "Go to the upper folder and refresh\nUp one level"
00110     };
00111     UTB_BUTTON diffBtn = {
00112         "diff.xpm",
00113         cmdDIFF,
00114         DDV_NONE,
00115         DDD_NONE,
00116         "Print the differences with the CVS remote repository\nDiff selected"
00117     };
00118     UTB_BUTTON logBtn = {
00119         "log.xpm",
00120         cmdLOG,
00121         DDV_NONE,
00122         DDD_NONE,
00123         "Print the history of the selected files\nLog selected"
00124     };
00125     UTB_BUTTON statusBtn = {
00126         "status.xpm",
00127         cmdSTATUS,
00128         DDV_NONE,
00129         DDD_NONE,
00130         "Print the current status of the selected files\nStatus selected"
00131     };
00132     UTB_BUTTON graphBtn = {
00133         "graph.xpm",
00134         cmdGRAPH,
00135         DDV_NONE,
00136         DDD_NONE,
00137         "Print the history as a graph of the selected files\nGraph selected"
00138     };
00139     UTB_BUTTON trashBtn = {
00140         "trash.xpm",
00141         cmdTRASH,
00142         DDV_NONE,
00143         DDD_NONE,
00144         "Erase the selection from your disk\nErase selected"
00145     };
00146     UTB_BUTTON addBtn = {
00147         "add.xpm",
00148         cmdADD,
00149         DDV_NONE,
00150         DDD_NONE,
00151         "Add the selected items to the remote CVS repository\nAdd selected"
00152     };
00153     UTB_BUTTON addbBtn = {
00154         "addb.xpm",
00155         cmdADDB,
00156         DDV_NONE,
00157         DDD_NONE,
00158         "Add the selected binary items to the remote CVS repository\nAdd selected binary"
00159     };
00160     UTB_BUTTON rmvBtn = {
00161         "remove.xpm",
00162         cmdRMV,
00163         DDV_NONE,
00164         DDD_NONE,
00165         "Remove the selected items to the remote CVS repository\nRemove selected"
00166     };
00167     UTB_BUTTON tagBtn = {
00168         "tag.xpm",
00169         cmdTAGNEW,
00170         DDV_NONE,
00171         DDD_NONE,
00172         "Create/move a tag on the selection\nTag selection"
00173     };
00174     UTB_BUTTON untagBtn = {
00175         "untag.xpm",
00176         cmdTAGDELETE,
00177         DDV_NONE,
00178         DDD_NONE,
00179         "Remove a tag on the selection\nUntag selection"
00180     };
00181     UTB_BUTTON branchBtn = {
00182         "branch.xpm",
00183         cmdTAGBRANCH,
00184         DDV_NONE,
00185         DDD_NONE,
00186         "Open (fork) a branch on the selection\nFork selection"
00187     };
00188     UTB_BUTTON lockBtn = {
00189         "lock.xpm",
00190         cmdLOCKF,
00191         DDV_NONE,
00192         DDD_NONE,
00193         "Lock the selected file on the remote repository until next commit\nLock selection"
00194     };
00195     UTB_BUTTON unlockBtn = {
00196         "unlock.xpm",
00197         cmdUNLOCKF,
00198         DDV_NONE,
00199         DDD_NONE,
00200         "Unlock the selected file on the remote repository\nUnlock selection"
00201     };
00202     UTB_BUTTON watchBtn = {
00203         "watch.xpm",
00204         cmdWATCHON,
00205         DDV_NONE,
00206         DDD_NONE,
00207         "Put a watch on the selected files\nWatch selection"
00208     };
00209     UTB_BUTTON unwatchBtn = {
00210         "unwatch.xpm",
00211         cmdWATCHOFF,
00212         DDV_NONE,
00213         DDD_NONE,
00214         "Release a watch on the selected files\nRelease watch selection"
00215     };
00216     UTB_BUTTON editBtn = {
00217         "edit.xpm",
00218         cmdEDIT,
00219         DDV_NONE,
00220         DDD_NONE,
00221         "Edit the selected files\nEdit selection"
00222     };
00223     UTB_BUTTON uneditBtn = {
00224         "unedit.xpm",
00225         cmdUNEDIT,
00226         DDV_NONE,
00227         DDD_NONE,
00228         "Unedit the selected files\nUnedit selection"
00229     };
00230     UTB_BUTTON releaseBtn = {
00231         "release.xpm",
00232         cmdRELEASE,
00233         DDV_NONE,
00234         DDD_NONE,
00235         "Release the selected files\nRelease selection"
00236     };
00237     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &updtBtn);
00238     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &commitBtn);
00239     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00240     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &stopBtn);
00241     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00242     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &addBtn);
00243     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &addbBtn);
00244     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &rmvBtn);
00245     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00246     UEventSendMessage(kUCvsToolbarID, EV_TB_CHECKBTN, 0, &ignoreBtn);
00247     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &reloadBtn);
00248     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &exploreBtn);
00249     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &upBtn);
00250     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00251     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &diffBtn);
00252     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &logBtn);
00253     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &statusBtn);
00254     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00255     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &graphBtn);
00256     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00257     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &trashBtn);
00258     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00259     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &tagBtn);
00260     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &untagBtn);
00261     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &branchBtn);
00262     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00263     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &lockBtn);
00264     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &unlockBtn);
00265     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00266     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &watchBtn);
00267     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &unwatchBtn);
00268     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00269     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &editBtn);
00270     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &uneditBtn);
00271     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00272     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &releaseBtn);
00273
00274     UEventSendMessage(kUCvsToolbarID, EV_TB_END, 0, 0L);
00275 }

Generated on Sun Feb 24 01:22:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UpdateDlg.cpp File Reference

common/UpdateDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "OptionalPropertySheet.h"
#include "UpdateDlg.h"
#include "CvsPrefs.h"
#include "GetPrefs.h"

Include dependency graph for UpdateDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

CMString | gRevNames (10,"P_TagNames", sDefTagNames)
CMString | gDateNames (10,"P_DateNames", sDefDateNames)
CMString | gDateOrRevNames (20,"P_RebDateNames", sDefRevDateNames)
bool | CompatGetUpdate (bool &toStdout, bool &noRecurs, bool &resetSticky, UPStr &date, UPStr &rev, bool &useMostRecent, UPStr &rev1, UPStr &rev2, bool &createMissDir, bool &getCleanCopy)

Variables

char * | sDefTagNames []
char * | sDefDateNames []
char * | sDefRevDateNames []

Function Documentation

bool CompatGetUpdate | ( | bool & | toStdout,
 |  | bool & | noRecurs,
 |  | bool & | resetSticky,
 |  | UPStr & | date,
 |  | UPStr & | rev,
 |  | bool & | useMostRecent,
 |  | UPStr & | rev1,
 |  | UPStr & | rev2,
 |  | bool & | createMissDir,
 |  | bool & | getCleanCopy
 | ) |

Definition at line 750 of file UpdateDlg.cpp.

References CPStr, COptionalPropertySheet::DoModal, EV_INIT_WIDGET, COptionalPropertySheet::GetHideCommandDlg, kUMainWidget, CUpdateMain::m_createmissdir, CUpdateSticky::m_date, CUpdateMerge::m_date1, CUpdateMerge::m_date2, CUpdateMain::m_delsticky, CUpdateMain::m_getcleancopy, CUpdateSticky::m_hasdate, CUpdateMerge::m_hasDate1, CUpdateMerge::m_hasDate2, CUpdateSticky::m_hasrev, CUpdateSticky::m_match, CUpdateMerge::m_merge, CUpdateMain::m_norecurs, CUpdateSticky::m_rev, CUpdateMerge::m_rev1, CUpdateMerge::m_rev2, CUpdateMain::m_stdout, CGetPrefs_GLOBALS::StoreValues, TRUE, UCreate_UpdateDlg, and UEventSendMessage.

00756 {
00757     bool userHitOK = false;
00758
00759     static CPStr sLastDate;
00760     static CPStr sLastRev;
00761     static CPStr sLastRev1;
00762     static CPStr sLastRev2;
00763     static CPStr sLastDate1;
00764     static CPStr sLastDate2;
00765
00766     bool hasDate = false;
00767     bool hasRev = false;
00768     bool merge1 = false;
00769     bool merge2 = false;
00770     bool hasDate1 = false;
00771     bool hasDate2 = false;
00772
00773     date = "";
00774     rev = "";
00775     rev1 = "";
00776     rev2 = "";
00777     toStdout = false;
00778     noRecurs = false;
00779     resetSticky = false;
00780     useMostRecent = false;
00781     createMissDir = false;
00782     getCleanCopy = false;
00783
00784 #ifdef WIN32
00785     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgUpdate(), "Update settings");
00786     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00787     CUpdateMain page1;
00788     CUpdateSticky page2(sLastRev, sLastDate);
00789     CUpdateMerge page3(false, sLastRev1, sLastRev2, sLastDate1, sLastDate2);
00790     CGetPrefs_GLOBALS page4;
00791     pages.AddPage(&page1);
00792     pages.AddPage(&page2);
00793     pages.AddPage(&page3);
00794     pages.AddPage(&page4);
00795     if(pages.DoModal() == IDOK)
00796     {
00797         toStdout = page1.m_stdout == TRUE;
00798         noRecurs = page1.m_norecurs == TRUE;
00799         resetSticky = page1.m_delsticky == TRUE;
00800         createMissDir = page1.m_createmissdir == TRUE;
00801         getCleanCopy = page1.m_getcleancopy == TRUE;
00802
00803         sLastDate = page2.m_date;
00804         sLastRev = page2.m_rev;
00805         hasDate = page2.m_hasdate == TRUE;
00806         hasRev = page2.m_hasrev == TRUE;
00807         useMostRecent = page2.m_match == TRUE;
00808
00809         merge1 = page3.m_merge >= 1;
00810         merge2 = page3.m_merge == 2;
00811         sLastRev1 = page3.m_rev1;
00812         sLastRev2 = page3.m_rev2;
00813         hasDate1 = page3.m_hasDate1 == TRUE;
00814         hasDate2 = page3.m_hasDate2 == TRUE;
00815         sLastDate1 = page3.m_date1;
00816         sLastDate2 = page3.m_date2;
00817
00818         page4.StoreValues();
00819         gCvsPrefs.SetHideCommandDlgUpdate(pages.GetHideCommandDlg());
00820         userHitOK = true;
00821     }
00822 #endif /* WIN32 */
00823 #ifdef qMacCvsPP
00824     StDialogHandler theHandler(dlg_Update, LCommander::GetTopCommander());
00825     LWindow *theDialog = theHandler.GetDialog();
00826     ThrowIfNil_(theDialog);
00827     static UInt16 sRuntimePanel = 1;
00828
00829     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00830         (theDialog->FindPaneByID(item_MultiViewPrefs));
00831     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00832
00833     multiView->SwitchToPanel(4);
00834     DoDataExchange_Globals(theDialog, true);
00835     multiView->SwitchToPanel(3);
00836     DoDataExchange_UpdateMerge(theDialog, merge1, merge2, sLastRev1, sLastRev2, true);
00837     multiView->SwitchToPanel(2);
00838     DoDataExchange_UpdateSticky(theDialog, hasDate, hasRev, sLastDate, sLastRev, useMostRecent, true);
00839     multiView->SwitchToPanel(1);
00840     DoDataExchange_UpdateSettings(theDialog, toStdout, noRecurs, resetSticky, createMissDir, getCleanCopy, true);
00841
00842     groupView->SetValue(sRuntimePanel);
00843     theDialog->Show();
00844     MessageT hitMessage;
00845     while (true)
00846     {       // Let DialogHandler process events
00847         hitMessage = theHandler.DoDialog();
00848
00849         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00850             break;
00851     }
00852     theDialog->Hide();
00853     sRuntimePanel = groupView->GetValue();
00854
00855     if(hitMessage == msg_OK)
00856     {
00857         multiView->SwitchToPanel(1);
00858         DoDataExchange_UpdateSettings(theDialog, toStdout, noRecurs, resetSticky, createMissDir, getCleanCopy, false);
00859         multiView->SwitchToPanel(2);
00860         DoDataExchange_UpdateSticky(theDialog, hasDate, hasRev, sLastDate, sLastRev, useMostRecent, false);
00861         multiView->SwitchToPanel(3);
00862         DoDataExchange_UpdateMerge(theDialog, merge1, merge2, sLastRev1, sLastRev2, false);
00863         multiView->SwitchToPanel(4);
00864         DoDataExchange_Globals(theDialog, false);
00865         userHitOK = true;
00866     }
00867 #endif /* qMacCvsPP */
00868 #if qUnix
00869     void *wid;
00870 #   if qGTK
00871     wid = UCreate_UpdateDlg();
00872 #   endif
00873
00874     UCvsUpdate *dlg = new UCvsUpdate();
00875     UCvsUpdate_MAIN *tab1 = new UCvsUpdate_MAIN();
00876     UCvsUpdate_STICKY *tab2 = new UCvsUpdate_STICKY(sLastRev, sLastDate);
00877     UCvsUpdate_MERGE *tab3 = new UCvsUpdate_MERGE(sLastRev1, sLastRev2);
00878     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00879     dlg->AddPage(tab1, UCvsUpdate::kTabGeneral, 0);
00880     dlg->AddPage(tab2, UCvsUpdate::kTabGeneral, 1);
00881     dlg->AddPage(tab3, UCvsUpdate::kTabGeneral, 2);
00882
00883     if(dlg->DoModal())
00884     {
00885         toStdout = tab1->m_toStdout;
00886         noRecurs = tab1->m_noRecurs;
00887         resetSticky = tab1->m_resetSticky;
00888         createMissDir = tab1->m_createMissDir;
00889
00890         sLastDate = tab2->m_date;
00891         sLastRev = tab2->m_rev;
00892         hasDate = tab2->m_hasdate;
00893         hasRev = tab2->m_hasrev;
00894         useMostRecent = tab2->m_match;
00895
00896         merge1 = tab3->m_merge >= 1;
00897         merge2 = tab3->m_merge == 2;
00898         sLastRev1 = tab3->m_rev1;
00899         sLastRev2 = tab3->m_rev2;
00900
00901         userHitOK = true;
00902     }
00903
00904     delete dlg;
00905 #endif // qUnix
00906
00907     if(userHitOK)
00908     {
00909         if(hasDate && !sLastDate.empty())
00910             date = sLastDate;
00911
00912         if(hasRev && !sLastRev.empty())
00913             rev = sLastRev;
00914
00915         if(merge1 && merge2 && !sLastRev1.empty() && !sLastRev2.empty())
00916         {
00917             rev1 = sLastRev1;
00918             rev2 = sLastRev2;
00919
00920             if( hasDate1 )
00921                 rev1 << ":" << sLastDate1;
00922
00923             if( hasDate2 )
00924                 rev2 << ":" << sLastDate2;
00925         }
00926
00927         if(merge1 && !merge2 && !sLastRev1.empty())
00928         {
00929             rev1 = sLastRev1;
00930
00931             if( hasDate1 )
00932                 rev1 << ":" << sLastDate1;
00933         }
00934
00935         gCvsPrefs.save();
00936     }
00937
00938     return userHitOK;
00939 }

CMString gDateNames | ( | 10 | ,
 |  | "P_DateNames" | ,
 |  | sDefDateNames |
 | ) |

CMString gDateOrRevNames | ( | 20 | ,
 |  | "P_RebDateNames" | ,
 |  | sDefRevDateNames |
 | ) |

CMString gRevNames | ( | 10 | ,
 |  | "P_TagNames" | ,
 |  | sDefTagNames |
 | ) |

Variable Documentation

char* sDefDateNames[]

Initial value:

{
    "1998-3",
    "1998-3-24",
    "1998-3-24 20:55",
    "24 Mar",
    "24 Mar 1998",
    "<=1998-3-24",
    0L
}

Definition at line 68 of file UpdateDlg.cpp.

char* sDefRevDateNames[]

Initial value:

{
    "1.1",
    "1.6.2.4",
    "HEAD",
    "branch-release-1-0",
    "1998-3",
    "1998-3-24",
    "1998-3-24 20:55",
    "24 Mar",
    "24 Mar 1998",
    "<=1998-3-24",
    0L
}

Definition at line 79 of file UpdateDlg.cpp.

char* sDefTagNames[]

Initial value:

{
    "1.1",
    "1.6.2.4",
    "HEAD",
    "branch-release-1-0",
    0L
}

Definition at line 59 of file UpdateDlg.cpp.

Generated on Sun Feb 24 01:22:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UpdateDlg.h File Reference

common/UpdateDlg.h File Reference

#include "CPStr.h"
#include "MultiString.h"
#include "SmartComboBox.h"

Include dependency graph for UpdateDlg.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CUpdateMain
class | CUpdateMerge
class | CUpdateSticky

Defines

#define | AFX_UPDATEDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Functions

bool | CompatGetUpdate (bool &toStdout, bool &noRecurs, bool &resetSticky, UPStr &date, UPStr &rev, bool &useMostRecent, UPStr &rev1, UPStr &rev2, bool &createMissDir, bool &getCleanCopy)

Variables

CMString gRevNames
CMString gReleasesNames
CMString gDateNames
CMString gDateOrRevNames

Define Documentation

#define AFX_UPDATEDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Definition at line 26 of file UpdateDlg.h.

Function Documentation

bool CompatGetUpdate | ( | bool & | toStdout,
 |  | bool & | noRecurs,
 |  | bool & | resetSticky,
 |  | UPStr & | date,
 |  | UPStr & | rev,
 |  | bool & | useMostRecent,
 |  | UPStr & | rev1,
 |  | UPStr & | rev2,
 |  | bool & | createMissDir,
 |  | bool & | getCleanCopy
 | ) |

Definition at line 750 of file UpdateDlg.cpp.

Referenced by CvsCmdUpdateFiles, and CvsCmdUpdateFolder.

00756 {
00757     bool userHitOK = false;
00758
00759     static CPStr sLastDate;
00760     static CPStr sLastRev;
00761     static CPStr sLastRev1;
00762     static CPStr sLastRev2;
00763     static CPStr sLastDate1;
00764     static CPStr sLastDate2;
00765
00766     bool hasDate = false;
00767     bool hasRev = false;
00768     bool merge1 = false;
00769     bool merge2 = false;
00770     bool hasDate1 = false;
00771     bool hasDate2 = false;
00772
00773     date = "";
00774     rev = "";
00775     rev1 = "";
00776     rev2 = "";
00777     toStdout = false;
00778     noRecurs = false;
00779     resetSticky = false;
00780     useMostRecent = false;
00781     createMissDir = false;
00782     getCleanCopy = false;
00783
00784 #ifdef WIN32
00785     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgUpdate(), "Update settings");
00786     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00787     CUpdateMain page1;
00788     CUpdateSticky page2(sLastRev, sLastDate);
00789     CUpdateMerge page3(false, sLastRev1, sLastRev2, sLastDate1, sLastDate2);
00790     CGetPrefs_GLOBALS page4;
00791     pages.AddPage(&page1);
00792     pages.AddPage(&page2);
00793     pages.AddPage(&page3);
00794     pages.AddPage(&page4);
00795     if(pages.DoModal() == IDOK)
00796     {
00797         toStdout = page1.m_stdout == TRUE;
00798         noRecurs = page1.m_norecurs == TRUE;
00799         resetSticky = page1.m_delsticky == TRUE;
00800         createMissDir = page1.m_createmissdir == TRUE;
00801         getCleanCopy = page1.m_getcleancopy == TRUE;
00802
00803         sLastDate = page2.m_date;
00804         sLastRev = page2.m_rev;
00805         hasDate = page2.m_hasdate == TRUE;
00806         hasRev = page2.m_hasrev == TRUE;
00807         useMostRecent = page2.m_match == TRUE;
00808
00809         merge1 = page3.m_merge >= 1;
00810         merge2 = page3.m_merge == 2;
00811         sLastRev1 = page3.m_rev1;
00812         sLastRev2 = page3.m_rev2;
00813         hasDate1 = page3.m_hasDate1 == TRUE;
00814         hasDate2 = page3.m_hasDate2 == TRUE;
00815         sLastDate1 = page3.m_date1;
00816         sLastDate2 = page3.m_date2;
00817
00818         page4.StoreValues();
00819         gCvsPrefs.SetHideCommandDlgUpdate(pages.GetHideCommandDlg());
00820         userHitOK = true;
00821     }
00822 #endif /* WIN32 */
00823 #ifdef qMacCvsPP
00824     StDialogHandler theHandler(dlg_Update, LCommander::GetTopCommander());
00825     LWindow *theDialog = theHandler.GetDialog();
00826     ThrowIfNil_(theDialog);
00827     static UInt16 sRuntimePanel = 1;
00828
00829     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00830         (theDialog->FindPaneByID(item_MultiViewPrefs));
00831     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00832
00833     multiView->SwitchToPanel(4);
00834     DoDataExchange_Globals(theDialog, true);
00835     multiView->SwitchToPanel(3);
00836     DoDataExchange_UpdateMerge(theDialog, merge1, merge2, sLastRev1, sLastRev2, true);
00837     multiView->SwitchToPanel(2);
00838     DoDataExchange_UpdateSticky(theDialog, hasDate, hasRev, sLastDate, sLastRev, useMostRecent, true);
00839     multiView->SwitchToPanel(1);
00840     DoDataExchange_UpdateSettings(theDialog, toStdout, noRecurs, resetSticky, createMissDir, getCleanCopy, true);
00841
00842     groupView->SetValue(sRuntimePanel);
00843     theDialog->Show();
00844     MessageT hitMessage;
00845     while (true)
00846     {       // Let DialogHandler process events
00847         hitMessage = theHandler.DoDialog();
00848
00849         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00850             break;
00851     }
00852     theDialog->Hide();
00853     sRuntimePanel = groupView->GetValue();
00854
00855     if(hitMessage == msg_OK)
00856     {
00857         multiView->SwitchToPanel(1);
00858         DoDataExchange_UpdateSettings(theDialog, toStdout, noRecurs, resetSticky, createMissDir, getCleanCopy, false);
00859         multiView->SwitchToPanel(2);
00860         DoDataExchange_UpdateSticky(theDialog, hasDate, hasRev, sLastDate, sLastRev, useMostRecent, false);
00861         multiView->SwitchToPanel(3);
00862         DoDataExchange_UpdateMerge(theDialog, merge1, merge2, sLastRev1, sLastRev2, false);
00863         multiView->SwitchToPanel(4);
00864         DoDataExchange_Globals(theDialog, false);
00865         userHitOK = true;
00866     }
00867 #endif /* qMacCvsPP */
00868 #if qUnix
00869     void *wid;
00870 #   if qGTK
00871     wid = UCreate_UpdateDlg();
00872 #   endif
00873
00874     UCvsUpdate *dlg = new UCvsUpdate();
00875     UCvsUpdate_MAIN *tab1 = new UCvsUpdate_MAIN();
00876     UCvsUpdate_STICKY *tab2 = new UCvsUpdate_STICKY(sLastRev, sLastDate);
00877     UCvsUpdate_MERGE *tab3 = new UCvsUpdate_MERGE(sLastRev1, sLastRev2);
00878     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00879     dlg->AddPage(tab1, UCvsUpdate::kTabGeneral, 0);
00880     dlg->AddPage(tab2, UCvsUpdate::kTabGeneral, 1);
00881     dlg->AddPage(tab3, UCvsUpdate::kTabGeneral, 2);
00882
00883     if(dlg->DoModal())
00884     {
00885         toStdout = tab1->m_toStdout;
00886         noRecurs = tab1->m_noRecurs;
00887         resetSticky = tab1->m_resetSticky;
00888         createMissDir = tab1->m_createMissDir;
00889
00890         sLastDate = tab2->m_date;
00891         sLastRev = tab2->m_rev;
00892         hasDate = tab2->m_hasdate;
00893         hasRev = tab2->m_hasrev;
00894         useMostRecent = tab2->m_match;
00895
00896         merge1 = tab3->m_merge >= 1;
00897         merge2 = tab3->m_merge == 2;
00898         sLastRev1 = tab3->m_rev1;
00899         sLastRev2 = tab3->m_rev2;
00900
00901         userHitOK = true;
00902     }
00903
00904     delete dlg;
00905 #endif // qUnix
00906
00907     if(userHitOK)
00908     {
00909         if(hasDate && !sLastDate.empty())
00910             date = sLastDate;
00911
00912         if(hasRev && !sLastRev.empty())
00913             rev = sLastRev;
00914
00915         if(merge1 && merge2 && !sLastRev1.empty() && !sLastRev2.empty())
00916         {
00917             rev1 = sLastRev1;
00918             rev2 = sLastRev2;
00919
00920             if( hasDate1 )
00921                 rev1 << ":" << sLastDate1;
00922
00923             if( hasDate2 )
00924                 rev2 << ":" << sLastDate2;
00925         }
00926
00927         if(merge1 && !merge2 && !sLastRev1.empty())
00928         {
00929             rev1 = sLastRev1;
00930
00931             if( hasDate1 )
00932                 rev1 << ":" << sLastDate1;
00933         }
00934
00935         gCvsPrefs.save();
00936     }
00937
00938     return userHitOK;
00939 }

Variable Documentation

CMString gDateNames

Definition at line 46 of file UpdateDlg.h.

CMString gDateOrRevNames

Definition at line 47 of file UpdateDlg.h.

CMString gReleasesNames

Definition at line 45 of file UpdateDlg.h.

CMString gRevNames

Definition at line 44 of file UpdateDlg.h.

Generated on Sun Feb 24 01:22:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


VolsPaths.c File Reference

common/VolsPaths.c File Reference

#include "VolsPaths.h"
#include <Types.h>
#include <Files.h>
#include <Resources.h>
#include <errors.h>
#include <Memory.h>
#include <string.h>
#include <strings.h>
#include <TextUtils.h>

Include dependency graph for VolsPaths.c:

Include dependency graph

Go to the source code of this file.

Defines

#define | VOLSPATHS_C

Functions

OSErr | VRef2VolName (short theVRef, StringPtr theVolName)
OSErr | VolName2VRef (StringPtr myPVolName, short *theVRefPtr)
OSErr | PathNameFromDirID (const long aDirID, const short avRefNum, char *aPath)
OSErr | PathNameFromWD (const short avRefNum, char *aPath)

Define Documentation

#define VOLSPATHS_C

Definition at line 39 of file VolsPaths.c.

Function Documentation

OSErr PathNameFromDirID | ( | const long | aDirID,
 |  | const short | avRefNum,
 |  | char * | aPath
 | ) |

Definition at line 158 of file VolsPaths.c.

References NULL.

00161 {
00162     Handle      strHandle = NULL;
00163     OSErr       anError = noErr;
00164     long        currDirID = 0,
00165                 nextDirID = 0;
00166     Size        theLen = 0;     // GetHandleSize
00167     char        tempName[64];   // directory or volume name
00168     CInfoPBRec  aPBblock;
00169
00170     /* create an empty string handle for Munger */
00171     strHandle = NewHandle(0);
00172
00173     if (strHandle == NULL)
00174     {
00175         anError = MemError();
00176     }
00177     else
00178     {
00179         *aPath = '\0';
00180         aPBblock.dirInfo.ioCompletion   = NULL;
00181         aPBblock.dirInfo.ioNamePtr      = (StringPtr)tempName;  // temp destination buffer
00182         nextDirID                       = aDirID;   // start at DirID passed in..
00183
00184         /* walk up the directories, collecting dir names as we go, until we hit the top (volname) */
00185         do {
00186
00187             aPBblock.dirInfo.ioVRefNum      = avRefNum;
00188             aPBblock.dirInfo.ioFDirIndex    = -1; // ignore ioNamePtr input, use ioDirID
00189             aPBblock.dirInfo.ioDrDirID      = nextDirID;
00190
00191             anError = PBGetCatInfoSync(&aPBblock);
00192             currDirID   = aPBblock.dirInfo.ioDrDirID;   // remember current
00193             nextDirID   = aPBblock.dirInfo.ioDrParID;   // find parent for next loop
00194
00195             if (anError != noErr)
00196                 break;
00197
00198             /* Insert a separator in front of the Directory Entry */
00199             Munger(strHandle, 0L, NULL, 0L, ":", 1L);
00200
00201             /* Insert the next directory/volume name into the front of the string */
00202             Munger(strHandle, 0L, NULL, 0L, &(tempName[1]), (long)tempName[0]);
00203
00204             /* NOTE: fsRtDirID is defined in Files.h */
00205         } while (currDirID != fsRtDirID);
00206
00207         /* now move the string into the parameter */
00208         theLen = GetHandleSize(strHandle);
00209         if (!anError && theLen)
00210         {
00211             BlockMove(&(**strHandle), aPath, theLen);
00212             anError = MemError();
00213         }
00214         aPath[theLen] = '\0';   /* set C string length */
00215
00216         /* dispose of temp storage */
00217         DisposeHandle(strHandle);
00218
00219     } /*else NULL*/
00220
00221     return(anError);
00222
00223 } /* PathNameFromDirID */

OSErr PathNameFromWD | ( | const short | avRefNum,
 |  | char * | aPath
 | ) |

Definition at line 247 of file VolsPaths.c.

References NULL, and PathNameFromDirID.

00249 {
00250     WDPBRec aPBblock;
00251     OSErr   anError = noErr;
00252
00253 /*
00254  PBGetWDInfo has a bug under A/UX 1.1.  If vRefNum is a real vRefNum
00255  and not a wdRefNum, then it returns garbage.  Since A/UX has only 1
00256  volume (in the Macintosh sense) and only 1 root directory, this can
00257  occur only when a file has been selected in the root directory (/).
00258  So we look for this and hard code the DirID and vRefNum.
00259  */
00260 #if defined(AUX)
00261     if ((aPathStyle == ePathTypeAUX) && (avRefNum == -1))
00262     {
00263         anError = PathNameFromDirID(fsRtDirID, -1, aPath);
00264     }
00265     else
00266 #endif
00267     {
00268         aPBblock.ioCompletion = NULL;
00269         aPBblock.ioNamePtr = NULL;
00270         aPBblock.ioVRefNum = avRefNum;
00271         aPBblock.ioWDIndex = 0;
00272         aPBblock.ioWDProcID = 0;
00273
00274         /* Change the Working Directory number in vRefnum into a real vRefnum */
00275         /* and DirID. The real vRefnum is returned in ioVRefnum, and the real */
00276         /* DirID is returned in ioWDDirID. */
00277
00278         anError = PBGetWDInfoSync(&aPBblock);
00279         if (anError == noErr)
00280             anError = PathNameFromDirID(aPBblock.ioWDDirID,
00281                                         aPBblock.ioWDVRefNum,
00282                                         aPath);
00283     }
00284
00285     return(anError);
00286
00287 } /* PathNameFromWD */

OSErr VolName2VRef | ( | StringPtr | myPVolName,
 |  | short * | theVRefPtr
 | ) |

Definition at line 90 of file VolsPaths.c.

00091 {
00092     OSErr           anError = noErr;
00093     Boolean         foundIt = false;
00094     short           theDriveNum;
00095     short           theVRefNum;
00096     HParamBlockRec  aParamBlk;
00097     char            myCVolName[32], theCVolName[32];
00098     Str31           theVolName;
00099
00100     // convert passed vol name from P 2 C string for compare
00101     p2cstrcpy(myCVolName, myPVolName);
00102
00103     // loop through all mounted volumes, see if myPVolName matches one
00104     for (theDriveNum = 1; !foundIt && (anError==noErr); theDriveNum++)
00105     {
00106         theVolName[0] = '\0';
00107         aParamBlk.volumeParam.ioNamePtr = (StringPtr)&theVolName;
00108         aParamBlk.volumeParam.ioVolIndex = theDriveNum;
00109
00110         anError = PBHGetVInfoSync((HParmBlkPtr)&aParamBlk);
00111         if (anError == noErr)
00112         {
00113             p2cstrcpy(theCVolName, theVolName);
00114             if (strcmp(theCVolName, myCVolName)==0)
00115             {
00116                 foundIt = true;
00117                 theVRefNum = aParamBlk.volumeParam.ioVRefNum;
00118             }
00119         }
00120     }
00121
00122     if (foundIt)
00123         *theVRefPtr = theVRefNum;
00124     else
00125         *theVRefPtr = 0;
00126
00127     if (anError == nsvErr) // no such vol, just bumped end of volume list
00128         anError = noErr;
00129
00130     return anError;
00131 } // VolName2VRef

OSErr VRef2VolName | ( | short | theVRef,
 |  | StringPtr | theVolName
 | ) |

Definition at line 71 of file VolsPaths.c.

References NULL.

00072 {
00073     OSErr           anError;
00074     HVolumeParam    pbVInfo;
00075
00076     pbVInfo.ioCompletion = NULL;
00077     theVolName[0] = '\0';
00078     pbVInfo.ioNamePtr = theVolName;
00079     pbVInfo.ioVRefNum = theVRef;
00080     pbVInfo.ioVolIndex = 0; // use VRefNum only
00081     anError = PBHGetVInfoSync((HParmBlkPtr)&pbVInfo);
00082
00083     return anError;
00084 } // VRef2VolName

Generated on Sun Feb 24 01:22:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


VolsPaths.h File Reference

common/VolsPaths.h File Reference

#include <MacTypes.h>

Include dependency graph for VolsPaths.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

OSErr | VRef2VolName (short theVRef, StringPtr theVolName)
OSErr | VolName2VRef (StringPtr myPVolName, short *theVRefPtr)
OSErr | PathNameFromDirID (const long aDirID, const short avRefNum, char *aPath)
OSErr | PathNameFromWD (const short avRefNum, char *aPath)

Function Documentation

OSErr PathNameFromDirID | ( | const long | aDirID,
 |  | const short | avRefNum,
 |  | char * | aPath
 | ) |

Definition at line 158 of file VolsPaths.c.

Referenced by PathNameFromWD.

00161 {
00162     Handle      strHandle = NULL;
00163     OSErr       anError = noErr;
00164     long        currDirID = 0,
00165                 nextDirID = 0;
00166     Size        theLen = 0;     // GetHandleSize
00167     char        tempName[64];   // directory or volume name
00168     CInfoPBRec  aPBblock;
00169
00170     /* create an empty string handle for Munger */
00171     strHandle = NewHandle(0);
00172
00173     if (strHandle == NULL)
00174     {
00175         anError = MemError();
00176     }
00177     else
00178     {
00179         *aPath = '\0';
00180         aPBblock.dirInfo.ioCompletion   = NULL;
00181         aPBblock.dirInfo.ioNamePtr      = (StringPtr)tempName;  // temp destination buffer
00182         nextDirID                       = aDirID;   // start at DirID passed in..
00183
00184         /* walk up the directories, collecting dir names as we go, until we hit the top (volname) */
00185         do {
00186
00187             aPBblock.dirInfo.ioVRefNum      = avRefNum;
00188             aPBblock.dirInfo.ioFDirIndex    = -1; // ignore ioNamePtr input, use ioDirID
00189             aPBblock.dirInfo.ioDrDirID      = nextDirID;
00190
00191             anError = PBGetCatInfoSync(&aPBblock);
00192             currDirID   = aPBblock.dirInfo.ioDrDirID;   // remember current
00193             nextDirID   = aPBblock.dirInfo.ioDrParID;   // find parent for next loop
00194
00195             if (anError != noErr)
00196                 break;
00197
00198             /* Insert a separator in front of the Directory Entry */
00199             Munger(strHandle, 0L, NULL, 0L, ":", 1L);
00200
00201             /* Insert the next directory/volume name into the front of the string */
00202             Munger(strHandle, 0L, NULL, 0L, &(tempName[1]), (long)tempName[0]);
00203
00204             /* NOTE: fsRtDirID is defined in Files.h */
00205         } while (currDirID != fsRtDirID);
00206
00207         /* now move the string into the parameter */
00208         theLen = GetHandleSize(strHandle);
00209         if (!anError && theLen)
00210         {
00211             BlockMove(&(**strHandle), aPath, theLen);
00212             anError = MemError();
00213         }
00214         aPath[theLen] = '\0';   /* set C string length */
00215
00216         /* dispose of temp storage */
00217         DisposeHandle(strHandle);
00218
00219     } /*else NULL*/
00220
00221     return(anError);
00222
00223 } /* PathNameFromDirID */

OSErr PathNameFromWD | ( | const short | avRefNum,
 |  | char * | aPath
 | ) |

Definition at line 247 of file VolsPaths.c.

00249 {
00250     WDPBRec aPBblock;
00251     OSErr   anError = noErr;
00252
00253 /*
00254  PBGetWDInfo has a bug under A/UX 1.1.  If vRefNum is a real vRefNum
00255  and not a wdRefNum, then it returns garbage.  Since A/UX has only 1
00256  volume (in the Macintosh sense) and only 1 root directory, this can
00257  occur only when a file has been selected in the root directory (/).
00258  So we look for this and hard code the DirID and vRefNum.
00259  */
00260 #if defined(AUX)
00261     if ((aPathStyle == ePathTypeAUX) && (avRefNum == -1))
00262     {
00263         anError = PathNameFromDirID(fsRtDirID, -1, aPath);
00264     }
00265     else
00266 #endif
00267     {
00268         aPBblock.ioCompletion = NULL;
00269         aPBblock.ioNamePtr = NULL;
00270         aPBblock.ioVRefNum = avRefNum;
00271         aPBblock.ioWDIndex = 0;
00272         aPBblock.ioWDProcID = 0;
00273
00274         /* Change the Working Directory number in vRefnum into a real vRefnum */
00275         /* and DirID. The real vRefnum is returned in ioVRefnum, and the real */
00276         /* DirID is returned in ioWDDirID. */
00277
00278         anError = PBGetWDInfoSync(&aPBblock);
00279         if (anError == noErr)
00280             anError = PathNameFromDirID(aPBblock.ioWDDirID,
00281                                         aPBblock.ioWDVRefNum,
00282                                         aPath);
00283     }
00284
00285     return(anError);
00286
00287 } /* PathNameFromWD */

OSErr VolName2VRef | ( | StringPtr | myPVolName,
 |  | short * | theVRefPtr
 | ) |

Definition at line 90 of file VolsPaths.c.

00091 {
00092     OSErr           anError = noErr;
00093     Boolean         foundIt = false;
00094     short           theDriveNum;
00095     short           theVRefNum;
00096     HParamBlockRec  aParamBlk;
00097     char            myCVolName[32], theCVolName[32];
00098     Str31           theVolName;
00099
00100     // convert passed vol name from P 2 C string for compare
00101     p2cstrcpy(myCVolName, myPVolName);
00102
00103     // loop through all mounted volumes, see if myPVolName matches one
00104     for (theDriveNum = 1; !foundIt && (anError==noErr); theDriveNum++)
00105     {
00106         theVolName[0] = '\0';
00107         aParamBlk.volumeParam.ioNamePtr = (StringPtr)&theVolName;
00108         aParamBlk.volumeParam.ioVolIndex = theDriveNum;
00109
00110         anError = PBHGetVInfoSync((HParmBlkPtr)&aParamBlk);
00111         if (anError == noErr)
00112         {
00113             p2cstrcpy(theCVolName, theVolName);
00114             if (strcmp(theCVolName, myCVolName)==0)
00115             {
00116                 foundIt = true;
00117                 theVRefNum = aParamBlk.volumeParam.ioVRefNum;
00118             }
00119         }
00120     }
00121
00122     if (foundIt)
00123         *theVRefPtr = theVRefNum;
00124     else
00125         *theVRefPtr = 0;
00126
00127     if (anError == nsvErr) // no such vol, just bumped end of volume list
00128         anError = noErr;
00129
00130     return anError;
00131 } // VolName2VRef

OSErr VRef2VolName | ( | short | theVRef,
 |  | StringPtr | theVolName
 | ) |

Definition at line 71 of file VolsPaths.c.

00072 {
00073     OSErr           anError;
00074     HVolumeParam    pbVInfo;
00075
00076     pbVInfo.ioCompletion = NULL;
00077     theVolName[0] = '\0';
00078     pbVInfo.ioNamePtr = theVolName;
00079     pbVInfo.ioVRefNum = theVRef;
00080     pbVInfo.ioVolIndex = 0; // use VRefNum only
00081     anError = PBHGetVInfoSync((HParmBlkPtr)&pbVInfo);
00082
00083     return anError;
00084 } // VRef2VolName

Generated on Sun Feb 24 01:22:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


uconfig.h File Reference

rf/uconfig.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define UEXPORT

Define Documentation

#define UEXPORT

Definition at line 27 of file uconfig.h.

Referenced by PtInRect, and UMakeBitmap.

Generated on Sun Feb 24 01:22:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


uconsole.cpp File Reference

rf/uconsole.cpp File Reference

#include "stdafx.h"
#include <stdio.h>
#include <stdarg.h>
#include "uconsole.h"

Include dependency graph for uconsole.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void UAppConsole (const char *format,...)

Function Documentation

void UAppConsole | ( | const char * | format,
 |  | ... |
 | ) |

Definition at line 42 of file uconsole.cpp.

References NULL, and UASSERT.

00043 {
00044     va_list args;
00045     char mess[1024] = {'\0'};
00046
00047     UASSERT(format != NULL);
00048
00049     va_start (args, format);
00050     vsprintf (mess, format, args);
00051     va_end (args);
00052
00053 #if qGTK
00054     g_warning(mess);
00055 #elif defined(qUnix)
00056 #elif qMacAPP
00057 #   if qDebug
00058     DebugWarning_AC(1, mess, __FILE__, __LINE__);
00059 #   endif
00060 #elif qMacPP
00061     SignalString_(mess);
00062 #elif defined(WIN32)
00063 #   ifdef _DEBUG
00064     _CrtDbgReport(_CRT_WARN, __FILE__, __LINE__, NULL, mess);
00065 #   endif
00066 #else
00067     (void)printf(mess);
00068     (void)fflush(stdout);
00069 #endif
00070 }

Generated on Sun Feb 24 01:22:47 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


uconsole.h File Reference

rf/uconsole.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | UTHROW(a) throw a

Functions

void | UAppConsole (const char *format,...)

Define Documentation

#define UTHROW ( a ) throw a

Definition at line 31 of file uconsole.h.

Function Documentation

void UAppConsole | ( | const char * | format,
 |  | ... |
 | ) |

Definition at line 42 of file uconsole.cpp.

Referenced by cvs_err, cvs_errstr, cvs_out, cvs_outstr, UWidget::DoModal, UWidget::EndModal, UPseudoPageHider::ExecuteSelf, UCvsConsole::FeedThisLine, UWidget::GetTooltip, UWidget::GetWidget, UToolbar::OnCommands, UCvsConsole::OnCreate, UMacAppMenu::OnUpdateUI, UCvsConsole::OutColor, CPersistent::Register, UStr::set, UPStr::set, UCmdTarget::UDispatchMessage, UEventSendMessage, UEventSendMessageExt, and CPersistent::UnRegister.

00043 {
00044     va_list args;
00045     char mess[1024] = {'\0'};
00046
00047     UASSERT(format != NULL);
00048
00049     va_start (args, format);
00050     vsprintf (mess, format, args);
00051     va_end (args);
00052
00053 #if qGTK
00054     g_warning(mess);
00055 #elif defined(qUnix)
00056 #elif qMacAPP
00057 #   if qDebug
00058     DebugWarning_AC(1, mess, __FILE__, __LINE__);
00059 #   endif
00060 #elif qMacPP
00061     SignalString_(mess);
00062 #elif defined(WIN32)
00063 #   ifdef _DEBUG
00064     _CrtDbgReport(_CRT_WARN, __FILE__, __LINE__, NULL, mess);
00065 #   endif
00066 #else
00067     (void)printf(mess);
00068     (void)fflush(stdout);
00069 #endif
00070 }

Generated on Sun Feb 24 01:22:47 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


udraw.cpp File Reference

rf/udraw.cpp File Reference

#include "stdafx.h"
#include "udraw.h"
#include "uwidget.h"

Include dependency graph for udraw.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | MIN(a, b) ((a) < (b) ? (a) : (b))
#define | MAX(a, b) ((a) > (b) ? (a) : (b))

Functions

bool | PtInRect (const URECT *r, UPOINT pt)
void | SetRect (URECT *r, int x1, int y1, int x2, int y2)
void | SetRectEmpty (URECT *r)
bool | EqualRect (const URECT *r1, const URECT *r2)
void | InflateRect (URECT *r, int x, int y)
void | OffsetRect (URECT *r, int x, int y)
bool | IsRectEmpty (const URECT *r)
bool | UnionRect (URECT *dest, const URECT *src1, const URECT *src2)
bool | IntersectRect (URECT *dest, const URECT *src1, const URECT *src2)

Define Documentation

#define MAX | ( | a,
 |  | b | ) | ((a) > (b) ? (a) : (b))

Definition at line 35 of file udraw.cpp.

Referenced by UnionRect.

#define MIN | ( | a,
 |  | b | ) | ((a) < (b) ? (a) : (b))

Definition at line 31 of file udraw.cpp.

Referenced by UnionRect.

Function Documentation

bool EqualRect | ( | const URECT * | r1,
 |  | const URECT * | r2
 | ) |

Definition at line 64 of file udraw.cpp.

References URECT::bottom, URECT::left, URECT::right, and URECT::top.

00065 {
00066     return r1->left == r2->left && r1->top == r2->top &&
00067         r1->right == r2->right && r1->bottom == r2->bottom;
00068 }

void InflateRect | ( | URECT * | r,
 |  | int | x,
 |  | int | y
 | ) |

Definition at line 69 of file udraw.cpp.

References URECT::bottom, URECT::left, URECT::right, and URECT::top.

00070 {
00071     r->left += x;
00072     r->top += y;
00073     r->right -= x;
00074     r->bottom -= y;
00075     if(r->left > r->right)
00076         r->left = r->right;
00077     if(r->top > r->bottom)
00078         r->top = r->bottom;
00079 }

bool IntersectRect | ( | URECT * | dest,
 |  | const URECT * | src1,
 |  | const URECT * | src2
 | ) |

Definition at line 113 of file udraw.cpp.

References URECT::bottom, URECT::left, URECT::right, and URECT::top.

00114 {
00115     const URECT *temp;
00116     bool return_val = false;
00117
00118     if (src2->left < src1->left)
00119     {
00120         temp = src1;
00121         src1 = src2;
00122         src2 = temp;
00123     }
00124     dest->left = src2->left;
00125
00126     if (src2->left < src1->right)
00127     {
00128         if (src1->right < src2->right)
00129             dest->right = src1->right;
00130         else
00131             dest->right = src2->right;
00132
00133         if (src2->top < src1->top)
00134         {
00135             temp = src1;
00136             src1 = src2;
00137             src2 = temp;
00138         }
00139         dest->top = src2->top;
00140
00141         if (src2->top < src1->bottom)
00142         {
00143             return_val = true;
00144
00145             if (src1->bottom < src2->bottom)
00146                 dest->bottom = src1->bottom;
00147             else
00148                 dest->bottom = src2->bottom;
00149
00150             if (dest->left == dest->right)
00151                 return_val = false;
00152             if (dest->top == dest->bottom)
00153                 return_val = false;
00154         }
00155     }
00156
00157     return return_val;
00158 }

bool IsRectEmpty ( const URECT * r ) [inline]

Definition at line 89 of file udraw.cpp.

References URECT::bottom, URECT::left, URECT::right, and URECT::top.

00090 {
00091     return r->left == r->right || r->top == r->bottom;
00092 }

void OffsetRect | ( | URECT * | r,
 |  | int | x,
 |  | int | y
 | ) |

Definition at line 81 of file udraw.cpp.

References URECT::bottom, URECT::left, URECT::right, and URECT::top.

00082 {
00083     r->left += x;
00084     r->right += x;
00085     r->top += y;
00086     r->bottom += y;
00087 }

bool PtInRect | ( | const URECT * | r,
 |  | UPOINT | pt
 | ) |

Definition at line 38 of file udraw.cpp.

References URECT::bottom, URECT::left, URECT::right, URECT::top, UPOINT::x, and UPOINT::y.

00039 {
00040     return pt.x >= r->left && pt.x < r->right &&
00041         pt.y >= r->top && pt.y < r->bottom;
00042 }

void SetRect | ( | URECT * | r,
 |  | int | x1,
 |  | int | y1,
 |  | int | x2,
 |  | int | y2
 | ) |

Definition at line 44 of file udraw.cpp.

References URECT::bottom, URECT::left, URECT::right, and URECT::top.

00045 {
00046     r->left = x1;
00047     r->top = y1;
00048     r->right = x2;
00049     r->bottom = y2;
00050     if(r->left > r->right)
00051         r->left = r->right;
00052     if(r->top > r->bottom)
00053         r->top = r->bottom;
00054 }

void SetRectEmpty ( URECT * r )

Definition at line 56 of file udraw.cpp.

References URECT::bottom, URECT::left, URECT::right, and URECT::top.

00057 {
00058     r->left = 0;
00059     r->top = 0;
00060     r->right = 0;
00061     r->bottom = 0;
00062 }

bool UnionRect | ( | URECT * | dest,
 |  | const URECT * | src1,
 |  | const URECT * | src2
 | ) |

Definition at line 94 of file udraw.cpp.

References URECT::bottom, URECT::left, MAX, MIN, URECT::right, and URECT::top.

00095 {
00096     if(::IsRectEmpty(src1))
00097     {
00098         *dest = *src2;
00099         return true;
00100     }
00101     if(::IsRectEmpty(src2))
00102     {
00103         *dest = *src1;
00104         return true;
00105     }
00106     dest->left = MIN (src1->left, src2->left);
00107     dest->top = MIN (src1->top, src2->top);
00108     dest->right = MAX (src1->right, src2->right);
00109     dest->bottom = MAX (src1->bottom, src2->bottom);
00110     return true;
00111 }

Generated on Sun Feb 24 01:22:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


udraw.h File Reference

rf/udraw.h File Reference

#include "uconfig.h"
#include "umain.h"

Include dependency graph for udraw.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | UBrush
class | UDC
class | UPen
class | UPoint
class | URect
class | USize

Defines

#define | URGB(r, g, b) ((UCOLORREF)(((unsigned char)(r)|((unsigned short)((unsigned char)(g))<<8))|(((unsigned int)(unsigned char)(b))<<16)))
#define | UGetRValue(rgb) ((unsigned char)(rgb))
#define | UGetGValue(rgb) ((unsigned char)(((unsigned short)(rgb)) >> 8))
#define | UGetBValue(rgb) ((unsigned char)((rgb)>>16))
#define | UPS_SOLID 0

Typedefs

typedef long | UCOLORREF

Functions

bool | PtInRect (const URECT *r, UPOINT pt)
void | SetRect (URECT *r, int x1, int y1, int x2, int y2)
void | SetRectEmpty (URECT *r)
bool | EqualRect (const URECT *r1, const URECT *r2)
void | InflateRect (URECT *r, int x, int y)
void | OffsetRect (URECT *r, int x, int y)
bool | UnionRect (URECT *dest, const URECT *src1, const URECT *src2)
bool | IntersectRect (URECT *dest, const URECT *src1, const URECT *src2)
void | CopyRect (URECT *dst, const URECT *src)

Define Documentation

#define UGetBValue ( rgb ) ((unsigned char)((rgb)>>16))

Definition at line 458 of file udraw.h.

Referenced by UPen::CreatePen, and UBrush::CreateSolidBrush.

#define UGetGValue ( rgb ) ((unsigned char)(((unsigned short)(rgb)) >> 8))

Definition at line 457 of file udraw.h.

Referenced by UPen::CreatePen, and UBrush::CreateSolidBrush.

#define UGetRValue ( rgb ) ((unsigned char)(rgb))

Definition at line 456 of file udraw.h.

Referenced by UPen::CreatePen, and UBrush::CreateSolidBrush.

#define UPS_SOLID 0

Definition at line 460 of file udraw.h.

Referenced by DrawNode, and CWinLogData::Update.

#define URGB | ( | r,
 |  | g,
 |  | b | ) | ((UCOLORREF)(((unsigned char)(r)|((unsigned short)((unsigned char)(g))<<8))|(((unsigned int)(unsigned char)(b))<<16)))

Definition at line 455 of file udraw.h.

Referenced by DrawNode, CWinLogData::Update, CWinLogBranchData::UpdateSelf, CWinLogTagData::UpdateSelf, CWinLogRevData::UpdateSelf, and CWinLogHeaderData::UpdateSelf.

Typedef Documentation

typedef long UCOLORREF

Definition at line 454 of file udraw.h.

Referenced by UPen::CreatePen, UBrush::CreateSolidBrush, and DrawNode.

Function Documentation

void CopyRect | ( | URECT * | dst,
 |  | const URECT * | src
 | ) | [inline]

Definition at line 42 of file udraw.h.

00042 { *dst = *src; }

bool EqualRect | ( | const URECT * | r1,
 |  | const URECT * | r2
 | ) |

Definition at line 64 of file udraw.cpp.

Referenced by URect::EqualRect, and URect::operator==.

00065 {
00066     return r1->left == r2->left && r1->top == r2->top &&
00067         r1->right == r2->right && r1->bottom == r2->bottom;
00068 }

void InflateRect | ( | URECT * | r,
 |  | int | x,
 |  | int | y
 | ) |

Definition at line 69 of file udraw.cpp.

00070 {
00071     r->left += x;
00072     r->top += y;
00073     r->right -= x;
00074     r->bottom -= y;
00075     if(r->left > r->right)
00076         r->left = r->right;
00077     if(r->top > r->bottom)
00078         r->top = r->bottom;
00079 }

bool IntersectRect | ( | URECT * | dest,
 |  | const URECT * | src1,
 |  | const URECT * | src2
 | ) |

Definition at line 113 of file udraw.cpp.

Referenced by URect::IntersectRect.

00114 {
00115     const URECT *temp;
00116     bool return_val = false;
00117
00118     if (src2->left < src1->left)
00119     {
00120         temp = src1;
00121         src1 = src2;
00122         src2 = temp;
00123     }
00124     dest->left = src2->left;
00125
00126     if (src2->left < src1->right)
00127     {
00128         if (src1->right < src2->right)
00129             dest->right = src1->right;
00130         else
00131             dest->right = src2->right;
00132
00133         if (src2->top < src1->top)
00134         {
00135             temp = src1;
00136             src1 = src2;
00137             src2 = temp;
00138         }
00139         dest->top = src2->top;
00140
00141         if (src2->top < src1->bottom)
00142         {
00143             return_val = true;
00144
00145             if (src1->bottom < src2->bottom)
00146                 dest->bottom = src1->bottom;
00147             else
00148                 dest->bottom = src2->bottom;
00149
00150             if (dest->left == dest->right)
00151                 return_val = false;
00152             if (dest->top == dest->bottom)
00153                 return_val = false;
00154         }
00155     }
00156
00157     return return_val;
00158 }

void OffsetRect | ( | URECT * | r,
 |  | int | x,
 |  | int | y
 | ) |

Definition at line 81 of file udraw.cpp.

References UPoint::UPoint.

00082 {
00083     r->left += x;
00084     r->right += x;
00085     r->top += y;
00086     r->bottom += y;
00087 }

bool PtInRect | ( | const URECT * | r,
 |  | UPOINT | pt
 | ) |

Definition at line 38 of file udraw.cpp.

References UEXPORT.

Referenced by CPseudoToggle::OnLButtonUp, and URect::PtInRect.

00039 {
00040     return pt.x >= r->left && pt.x < r->right &&
00041         pt.y >= r->top && pt.y < r->bottom;
00042 }

void SetRect | ( | URECT * | r,
 |  | int | x1,
 |  | int | y1,
 |  | int | x2,
 |  | int | y2
 | ) |

Definition at line 44 of file udraw.cpp.

00045 {
00046     r->left = x1;
00047     r->top = y1;
00048     r->right = x2;
00049     r->bottom = y2;
00050     if(r->left > r->right)
00051         r->left = r->right;
00052     if(r->top > r->bottom)
00053         r->top = r->bottom;
00054 }

void SetRectEmpty ( URECT * r )

Definition at line 56 of file udraw.cpp.

Referenced by CCJToolBar::GetItemRect.

00057 {
00058     r->left = 0;
00059     r->top = 0;
00060     r->right = 0;
00061     r->bottom = 0;
00062 }

bool UnionRect | ( | URECT * | dest,
 |  | const URECT * | src1,
 |  | const URECT * | src2
 | ) |

Definition at line 94 of file udraw.cpp.

Referenced by URect::UnionRect.

00095 {
00096     if(::IsRectEmpty(src1))
00097     {
00098         *dest = *src2;
00099         return true;
00100     }
00101     if(::IsRectEmpty(src2))
00102     {
00103         *dest = *src1;
00104         return true;
00105     }
00106     dest->left = MIN (src1->left, src2->left);
00107     dest->top = MIN (src1->top, src2->top);
00108     dest->right = MAX (src1->right, src2->right);
00109     dest->bottom = MAX (src1->bottom, src2->bottom);
00110     return true;
00111 }

Generated on Sun Feb 24 01:22:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


uevent.cpp File Reference

rf/uevent.cpp File Reference

#include "stdafx.h"
#include <time.h>
#include "umain.h"
#include "uconsole.h"
#include "uwidget.h"
#include <map>
#include "PseudoButton.h"

Include dependency graph for uevent.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | CAllTargets
union | UMessageMapFunctions
class | CMsg
class | CTurnOffDispatching

Defines

#define | MIN_IDLE 100
#define | _countof(array) (sizeof(array)/sizeof(array[0]))

Functions

int | UEventSendMessage (int wid, int evt, int arg1, void *arg2)
int | UEventSendMessageExt (int wid, int evt, int arg1, void *arg2, int *handledFlag)
int | UEventPostMessage (int wid, int evt, int arg1, void *arg2)
int | UEventNotifyMessage (int evt, int arg1, void *arg2)
int | UEventGetWidID (void)
UCmdTarget * | UEventQueryWidget (int widid)
void | UEventRemoveWidID (int widid)
void | UEventSetTooltipHandler (void(*handler)(const char *))
void | UEventGiveTime (void)
long | UTickCount (void)
const std::map< int, UCmdTarget * > & | UEventGetTargets (void)

Variables

long | sLastIdle = 0
void(* | sTooltipHandler )(const char *)=0L
CAllTargets sAllTargets
bool | sTurnOffDispatching = false
std::vector< CMsg > sRetainedMsgs

Define Documentation

#define _countof ( array ) (sizeof(array)/sizeof(array[0]))

#define MIN_IDLE 100

minimum idle used by the framework to handle the timers

Definition at line 74 of file uevent.cpp.

Referenced by UEventGiveTime.

Function Documentation

const std:: map<int, UCmdTarget *>& UEventGetTargets ( void )

Definition at line 763 of file uevent.cpp.

References CAllTargets::Get, sAllTargets, and STD.

Referenced by LMainPseudoAttachment::ExecuteSelf, UWidget::HasModal, UToolbar::OnCommands, UMenu::OnCommands, UToolbar::OnUpdateUI, UMenu::OnUpdateUI, and UMacAppMenu::OnUpdateUI.

00764 {
00765     return sAllTargets.Get();
00766 }

int UEventGetWidID ( void )

Definition at line 296 of file uevent.cpp.

00297 {
00298     static int newid = 100;
00299     return newid++;
00300 }

void UEventGiveTime ( void )

Definition at line 673 of file uevent.cpp.

References UWidget::BeforeUpdateUI, UWidget::DoValidUI, EV_TIMER, EV_UPDATEUI, CAllTargets::Get, UWidget::GetTimers, UCmdTarget::GetWidID, UObject::IsKindOf, UWidget::IsUIValid, CMsg::m_arg1, CMsg::m_arg2, UTimer::m_cmd, CMsg::m_ev, UTimer::m_lap, UTimer::m_lastlap, CMsg::m_wid, MIN_IDLE, sAllTargets, sLastIdle, STD, UEventSendMessage, URUNTIME_CLASS, and UTickCount.

00674 {
00675     STD map< int, UCmdTarget * >::const_iterator iter;
00676     const STD map<int, UCmdTarget *> & targets = sAllTargets.Get();
00677
00678     // post the retained events
00679     while(!sRetainedMsgs.empty())
00680     {
00681         CMsg msg = *sRetainedMsgs.begin();
00682         sRetainedMsgs.erase(sRetainedMsgs.begin());
00683         UEventSendMessage(msg.m_wid, msg.m_ev, msg.m_arg1, msg.m_arg2);
00684     }
00685
00686     // take care about the EV_UPDATEUI notification
00687     if(!UWidget::IsUIValid())
00688     {
00689         UWidget::DoValidUI(true);
00690
00691         // warn the widget it's going to happen so they can cache
00692         // some informations.
00693         for(iter = targets.begin(); iter != targets.end(); ++iter)
00694         {
00695             UCmdTarget *target = (*iter).second;
00696             if(!target->IsKindOf(URUNTIME_CLASS(UWidget)))
00697                 continue;
00698
00699             UWidget *wid = (UWidget *)target;
00700             wid->BeforeUpdateUI();
00701         }
00702
00703         for(iter = targets.begin(); iter != targets.end(); ++iter)
00704         {
00705             UCmdTarget *target = (*iter).second;
00706             if(!target->IsKindOf(URUNTIME_CLASS(UWidget)))
00707                 continue;
00708
00709             UWidget *wid = (UWidget *)target;
00710             UEventSendMessage(wid->GetWidID(), EV_UPDATEUI, 0, 0L);
00711         }
00712     }
00713
00714     long thisIdle = UTickCount();
00715     if((thisIdle - sLastIdle) < MIN_IDLE)
00716         return;
00717
00718     // search the timers
00719     for(iter = targets.begin(); iter != targets.end(); ++iter)
00720     {
00721         UCmdTarget *target = (*iter).second;
00722         if(!target->IsKindOf(URUNTIME_CLASS(UWidget)))
00723             continue;
00724
00725         UWidget *wid = (UWidget *)target;
00726         std::vector<UTimer> & timers = wid->GetTimers();
00727         std::vector<UTimer>::iterator t;
00728         for(t = timers.begin(); t != timers.end(); ++t)
00729         {
00730             UTimer & timer = *t;
00731             if((thisIdle - timer.m_lastlap) >= timer.m_lap)
00732             {
00733                 // trigger the timer
00734                 timer.m_lastlap = thisIdle;
00735                 UEventSendMessage(wid->GetWidID(), EV_TIMER, timer.m_cmd, (void *)thisIdle);
00736             }
00737         }
00738     }
00739
00740     sLastIdle = thisIdle;
00741 }

int UEventNotifyMessage | ( | int | evt,
 |  | int | arg1,
 |  | void * | arg2
 | ) |

Definition at line 269 of file uevent.cpp.

References CAllTargets::Get, UCmdTarget::kUNoDispatchInfo, sAllTargets, STD, UASSERT, UCmdTarget::UDispatchInfo, and UCmdTarget::UDispatchMessage.

00270 {
00271     STD map< int, UCmdTarget * >::const_iterator iter;
00272     const STD map<int, UCmdTarget *> & targets = sAllTargets.Get();
00273     int res = 0;
00274
00275     for(iter = targets.begin(); iter != targets.end(); ++iter)
00276     {
00277         UCmdTarget *target = (*iter).second;
00278         UCmdTarget::UDispatchInfo dispatchInfo = UCmdTarget::kUNoDispatchInfo;
00279 #if qDebug
00280         try {
00281 #endif
00282         res = target->UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00283 #if qDebug
00284         } catch(...) {
00285             UASSERT(0);
00286             throw;
00287         }
00288 #endif
00289         if(res)
00290             break;
00291     }
00292
00293     return res;
00294 }

int UEventPostMessage | ( | int | wid,
 |  | int | evt,
 |  | int | arg1,
 |  | void * | arg2
 | ) |

Definition at line 262 of file uevent.cpp.

00263 {
00264     sRetainedMsgs.push_back(CMsg(wid, evt, arg1, arg2));
00265     return 0;
00266 }

UCmdTarget* UEventQueryWidget ( int widid )

Definition at line 302 of file uevent.cpp.

References CAllTargets::Get, sAllTargets, and STD.

00303 {
00304     const STD map<int, UCmdTarget *> & targets = sAllTargets.Get();
00305     STD map< int, UCmdTarget * >::const_iterator iter = targets.find(widid);
00306     if(iter != targets.end())
00307     {
00308         UCmdTarget *target = (*iter).second;
00309         return target;
00310     }
00311     return 0L;
00312 }

void UEventRemoveWidID ( int widid )

Definition at line 314 of file uevent.cpp.

References CAllTargets::Get, sAllTargets, and STD.

00315 {
00316     STD map<int, UCmdTarget *> & targets = sAllTargets.Get();
00317     STD map<int, UCmdTarget *>::iterator i = targets.find(widid);
00318     if(i == targets.end())
00319         return;
00320     targets.erase(i);
00321 }

int UEventSendMessage | ( | int | wid,
 |  | int | evt,
 |  | int | arg1,
 |  | void * | arg2
 | ) |

Definition at line 199 of file uevent.cpp.

References CAllTargets::Get, UCmdTarget::kUNoDispatchInfo, sAllTargets, STD, UAppConsole, UASSERT, UCmdTarget::UDispatchInfo, and UCmdTarget::UDispatchMessage.

00200 {
00201     if(sTurnOffDispatching)
00202         return 0;
00203
00204     const STD map<int, UCmdTarget *> & targets = sAllTargets.Get();
00205     STD map< int, UCmdTarget * >::const_iterator iter = targets.find(wid);
00206     int res = 0;
00207
00208     if(iter != targets.end())
00209     {
00210         UCmdTarget *target = (*iter).second;
00211         UCmdTarget::UDispatchInfo dispatchInfo = UCmdTarget::kUNoDispatchInfo;
00212 #if qDebug
00213         try {
00214 #endif
00215         res = target->UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00216 #if qDebug
00217         } catch(...) {
00218             UASSERT(0);
00219             throw;
00220         }
00221 #endif
00222     }
00223     else
00224     {
00225         UAppConsole("Unknown widget id : %d\n", wid);
00226     }
00227
00228     return res;
00229 }

int UEventSendMessageExt | ( | int | wid,
 |  | int | evt,
 |  | int | arg1,
 |  | void * | arg2,
 |  | int * | handledFlag
 | ) |

Definition at line 231 of file uevent.cpp.

References CAllTargets::Get, UCmdTarget::kUDispatchHandled, UCmdTarget::kUNoDispatchInfo, sAllTargets, STD, UAppConsole, UASSERT, UCmdTarget::UDispatchInfo, and UCmdTarget::UDispatchMessage.

00232 {
00233     const STD map<int, UCmdTarget *> & targets = sAllTargets.Get();
00234     STD map< int, UCmdTarget * >::const_iterator iter = targets.find(wid);
00235     int res = 0;
00236     UCmdTarget::UDispatchInfo dispatchInfo = UCmdTarget::kUNoDispatchInfo;
00237
00238     if(iter != targets.end())
00239     {
00240         UCmdTarget *target = (*iter).second;
00241 #if qDebug
00242         try {
00243 #endif
00244         res = target->UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00245 #if qDebug
00246         } catch(...) {
00247             UASSERT(0);
00248             throw;
00249         }
00250 #endif
00251     }
00252     else
00253     {
00254         UAppConsole("Unknown widget id : %d\n", wid);
00255     }
00256
00257     *handledFlag = (dispatchInfo & UCmdTarget::kUDispatchHandled) != 0;
00258     return res;
00259 }

void UEventSetTooltipHandler ( void(* handler)(const char *) )

Definition at line 668 of file uevent.cpp.

References sTooltipHandler.

00669 {
00670     sTooltipHandler = handler;
00671 }

long UTickCount ( void )

Definition at line 743 of file uevent.cpp.

Referenced by UWidget::AddTimer, and UEventGiveTime.

00744 {
00745 #ifdef WIN32
00746     return ::GetTickCount();
00747 #elif defined(macintosh)
00748     long res = ::TickCount();
00749     return res = (float)res * (1000.0 / 60.0);
00750 #else
00751     struct timeval tval;
00752     static long refcount;
00753
00754     gettimeofday(&tval, 0L);
00755
00756     if(refcount == 0)
00757         refcount = tval.tv_sec;
00758
00759     return (tval.tv_sec - refcount) * 1000 + tval.tv_usec / 1000;
00760 #endif
00761 }

Variable Documentation

class CAllTargets sAllTargets

Referenced by UCmdTarget::UCmdTarget, UEventGetTargets, UEventGiveTime, UEventNotifyMessage, UEventQueryWidget, UEventRemoveWidID, UEventSendMessage, and UEventSendMessageExt.

long sLastIdle = 0 [static]

Definition at line 76 of file uevent.cpp.

Referenced by UEventGiveTime.

std::vector<CMsg> sRetainedMsgs [static]

Definition at line 178 of file uevent.cpp.

void(* sTooltipHandler)(const char *) = 0L [static]

Definition at line 81 of file uevent.cpp.

Referenced by UCmdUI::SetTooltip, and UEventSetTooltipHandler.

bool sTurnOffDispatching = false [static]

Definition at line 121 of file uevent.cpp.

Referenced by CTurnOffDispatching::CTurnOffDispatching, and CTurnOffDispatching::~CTurnOffDispatching.

Generated on Sun Feb 24 01:22:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


umain.h File Reference

rf/umain.h File Reference

#include "uobject.h"
#include <map>

Include dependency graph for umain.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | UCmdTarget
class | UCmdUI
struct | ULIST_INFO
struct | ULIST_INSERT
struct | UMSGMAP
struct | UMSGMAP_ENTRY
struct | UPOINT
struct | URECT
class | USemaphore
struct | USIZE
struct | USLIDER
struct | UTB_BUTTON
struct | UTB_DROPDOWN
struct | UTB_INIT
struct | UTREE_INFO
struct | UTREE_INSERT

Defines

#define | STD std::
#define | ON_UCREATE(baseClass)
#define | ON_UDESTROY(baseClass)
#define | ON_UENTER(baseClass)
#define | ON_ULEAVE(baseClass)
#define | ON_UEXPOSE(baseClass)
#define | ON_UMMOVE(baseClass)
#define | ON_UBTNDOWN(baseClass)
#define | ON_UBTNUP(baseClass)
#define | ON_UBTNDBLDOWN(baseClass)
#define | ON_KEYDOWN(baseClass)
#define | ON_RESIZE(cmd, hook)
#define | ON_SETCURSOR(baseClass)
#define | ON_CHGCURSOR(baseClass, cmdmin, cmdmax)
#define | ON_TB_INIT(baseClass)
#define | ON_TB_END(baseClass)
#define | ON_TB_BUTTON(baseClass)
#define | ON_TB_DROPDOWN(baseClass)
#define | ON_TB_CHECKBTN(baseClass)
#define | ON_TB_GETCOLOR(baseClass)
#define | ON_TB_SEPARATOR(baseClass)
#define | ON_UCOMMAND(cmd, hook)
#define | ON_UCOMMAND_RANGE(cmdmin, cmdmax, hook)
#define | ON_UCOMMAND_RANGEEX(cmdmin, cmdmax, hook)
#define | ON_UUPDATECMD(cmd, hook)
#define | ON_FETCHCMD(baseClass, cmdmin, cmdmax)
#define | ON_UUPDATECMD_RANGE(cmdmin, cmdmax, hook)
#define | ON_USETTOOLTIP(cmdmin, cmdmax, hook)
#define | ON_UGETLLOC(cmdmin, cmdmax, hook)
#define | ON_USETLLOC(cmdmin, cmdmax, hook)
#define | ON_QUERYSTATE(cmdmin, cmdmax, hook)
#define | ON_EDITCHANGE(cmd, hook)
#define | ON_EDITCHANGE_RANGE(cmdmin, cmdmax, hook)
#define | ON_EDITACTIVATE(cmd, hook)
#define | ON_EDITACTIVATE_RANGE(cmdmin, cmdmax, hook)
#define | ON_SCROLLCHANGE(cmd, hook)
#define | ON_SCROLLCHANGE_RANGE(cmdmin, cmdmax, hook)
#define | ON_TIMER(cmd, hook)
#define | ON_UPDATEUI(baseClass)
#define | ON_UPDATEFOCUS(baseClass)
#define | ON_SETSTATE(cmdmin, cmdmax, hook)
#define | ON_ENABLECMD(cmdmin, cmdmax, hook)
#define | ON_CHGFOCUS(baseClass, cmdmin, cmdmax)
#define | ON_INVALIDATE(baseClass, cmdmin, cmdmax)
#define | ON_REDRAW(baseClass, cmdmin, cmdmax)
#define | ON_SHOW_WIDGET(cmd, hook)
#define | ON_PAGE_CHANGED(baseClass, cmdmin, cmdmax)
#define | ON_SHOW_WIDGET_RANGE(cmdmin, cmdmax, hook)
#define | ON_DROPREF(cmdmin, cmdmax, hook)
#define | ON_UNOTIFY(cmd, hook)
#define | ON_INIT_WIDGET(baseClass, cmdmin, cmdmax)
#define | ON_INIT_TAB_WIDGET(baseClass, cmdmin, cmdmax)
#define | ON_SETTEXT(cmdmin, cmdmax, hook)
#define | ON_GETTEXT(cmdmin, cmdmax, hook)
#define | ON_SETFLOAT(baseClass, cmdmin, cmdmax)
#define | ON_GETFLOAT(baseClass, cmdmin, cmdmax)
#define | ON_DRAGQUERY(cmd, hook)
#define | ON_DROPQUERY(cmd, hook)
#define | ON_DROPIT(cmd, hook)
#define | ON_DRAGQUERY_RANGE(cmdmin, cmdmax, hook)
#define | ON_DROPQUERY_RANGE(cmdmin, cmdmax, hook)
#define | ON_DROPIT_RANGE(cmdmin, cmdmax, hook)
#define | ON_DROPQUERY_CMDID(baseClass)
#define | ON_SET_SLIDER(baseClass, cmdmin, cmdmax)
#define | ON_GET_SLIDERPROP(baseClass, cmdmin, cmdmax)
#define | ON_SET_SLIDERPROP(baseClass, cmdmin, cmdmax)
#define | ON_TREE_RESETALL(baseClass, cmdmin, cmdmax)
#define | ON_TREE_INSERT(baseClass, cmdmin, cmdmax)
#define | ON_TREE_GETINFO(baseClass, cmdmin, cmdmax)
#define | ON_TREE_SETDATA(baseClass, cmdmin, cmdmax)
#define | ON_TREE_SETICON(baseClass, cmdmin, cmdmax)
#define | ON_TREE_DELETE(baseClass, cmdmin, cmdmax)
#define | ON_TREE_EXPAND(baseClass, cmdmin, cmdmax)
#define | ON_TREE_SELECT(baseClass, cmdmin, cmdmax)
#define | ON_TREE_GETSEL(baseClass, cmdmin, cmdmax)
#define | ON_TREE_EXPANDING(cmd, hook)
#define | ON_TREE_SELECTING(cmd, hook)
#define | ON_LIST_SELECTING(cmd, hook)
#define | ON_LIST_SELCOLUMN(cmd, hook)
#define | ON_LIST_RESORT(baseClass, cmdmin, cmdmax)
#define | ON_LIST_DBLCLICK(cmd, hook)
#define | ON_LIST_ADDSEL(baseClass, cmdmin, cmdmax)
#define | ON_LIST_DELROW(baseClass, cmdmin, cmdmax)
#define | ON_LIST_RESETALL(baseClass, cmdmin, cmdmax)
#define | ON_LIST_ADDCOLUMNS(baseClass, cmdmin, cmdmax)
#define | ON_LIST_SETFEEDBACK(baseClass, cmdmin, cmdmax)
#define | ON_LIST_SETCOLTITLE(baseClass, cmdmin, cmdmax)
#define | ON_LIST_SETCOLWIDTH(baseClass, cmdmin, cmdmax)
#define | ON_LIST_NEWROW(baseClass, cmdmin, cmdmax)
#define | ON_LIST_ROWSETDATA(baseClass, cmdmin, cmdmax)
#define | ON_LIST_ROWGETDATA(baseClass, cmdmin, cmdmax)
#define | ON_LIST_INSERT(baseClass, cmdmin, cmdmax)
#define | ON_LIST_GETNEXTSEL(baseClass, cmdmin, cmdmax)
#define | ON_LIST_GETNEXT(baseClass, cmdmin, cmdmax)
#define | ON_LIST_GETINFO(baseClass, cmdmin, cmdmax)
#define | ON_COMBO_RESETALL(baseClass, cmdmin, cmdmax)
#define | ON_COMBO_APPEND(baseClass, cmdmin, cmdmax)
#define | ON_COMBO_SETSEL(baseClass, cmdmin, cmdmax)
#define | ON_COMBO_DELSEL(baseClass, cmdmin, cmdmax)
#define | ON_COMBO_ENABLESEL(baseClass, cmdmin, cmdmax)
#define | ON_COMBO_GETSEL(baseClass, cmdmin, cmdmax)
#define | ON_COMBO_GETMENU(baseClass, cmdmin, cmdmax)
#define | ON_COMBO_GETCOUNT(baseClass, cmdmin, cmdmax)
#define | ON_COMBO_SEL(cmd, hook)
#define | ON_COMBO_SEL_RANGE(cmdmin, cmdmax, hook)
#define | ON_SMARTCOMBO_SETFEATURE(baseClass, cmdmin, cmdmax)
#define | ON_SMARTCOMBO_SETITEMS(baseClass, cmdmin, cmdmax)
#define | ON_SMARTCOMBO_SETREADONLY(baseClass, cmdmin, cmdmax)
#define | ON_CUSTOM_DRAW(cmd, hook)
#define | ON_CUSTOM_DRAW_RANGE(cmdmin, cmdmax, hook)
#define | UDECLARE_MESSAGE_MAP()
#define | UBEGIN_MESSAGE_MAP(theClass, baseClass)
#define | UEND_MESSAGE_MAP()
#define | ev_msg
#define | UMAKEINT(a, b) ((int)(((short)(a)) | ((int)((short)(b))) << 16))
#define | ULOWORD(l) ((short)(l))
#define | UHIWORD(l) ((short)(((int)(l) >> 16) & 0xFFFF))
#define | UK_LBUTTON 0x01
#define | UK_MBUTTON 0x02
#define | UK_RBUTTON 0x04
#define | UK_CONTROL 0x08
#define | UK_SHIFT 0x10
#define | UK_ALT 0x20
#define | UK_CANCEL 0x03
#define | UK_BACK 0x08
#define | UK_TAB 0x09
#define | UK_CLEAR 0x0C
#define | UK_RETURN 0x0D
#define | UK_ESCAPE 0x1B
#define | UK_SPACE 0x20
#define | UK_PRIOR 0x21
#define | UK_NEXT 0x22
#define | UK_END 0x23
#define | UK_HOME 0x24
#define | UK_LEFT 0x25
#define | UK_UP 0x26
#define | UK_RIGHT 0x27
#define | UK_DOWN 0x28
#define | UK_INSERT 0x2D
#define | UK_DELETE 0x2E
#define | UK_HELP 0x2F
#define | UK_PLUS 0x6B
#define | UK_MINUS 0x6D
#define | UK_NUMPAD0 0x60
#define | UK_NUMPAD1 0x61
#define | UK_NUMPAD2 0x62
#define | UK_NUMPAD3 0x63
#define | UK_NUMPAD4 0x64
#define | UK_NUMPAD5 0x65
#define | UK_NUMPAD6 0x66
#define | UK_NUMPAD7 0x67
#define | UK_NUMPAD8 0x68
#define | UK_NUMPAD9 0x69
#define | UK_MULTIPLY 0x6A
#define | UK_ADD 0x6B
#define | UK_SEPARATOR 0x6C
#define | UK_SUBTRACT 0x6D
#define | UK_DECIMAL 0x6E
#define | UK_DIVIDE 0x6F
#define | UK_F1 0x70
#define | UK_F2 0x71
#define | UK_F3 0x72
#define | UK_F4 0x73
#define | UK_F5 0x74
#define | UK_F6 0x75
#define | UK_F7 0x76
#define | UK_F8 0x77
#define | UK_F9 0x78
#define | UK_F10 0x79
#define | UK_F11 0x7A
#define | UK_F12 0x7B
#define | UK_F13 0x7C
#define | UK_F14 0x7D
#define | UK_F15 0x7E
#define | UK_F16 0x7F
#define | UK_F17 0x80
#define | UK_F18 0x81
#define | UK_F19 0x82
#define | UK_F20 0x83
#define | UK_F21 0x84
#define | UK_F22 0x85
#define | UK_F23 0x86
#define | UK_F24 0x87
#define | WINCMD_DLG_START 2000
#define | WINCMD_DLG_END 3000
#define | UCMD_to_WINCMD(cmd) (cmd)
#define | WINCMD_to_UCMD(cmd) (cmd)
#define | UCMD_to_WINCTL(cmd) ((cmd)-EV_COMMAND_START+WINCMD_DLG_START)
#define | WINCTL_to_UCMD(cmd) ((cmd)-WINCMD_DLG_START+EV_COMMAND_START)
#define | UMENU_NULL ((UMENU)0L)
#define | UTB_SEPARATOR (-1)

Typedefs

typedef void(UCmdTarget::* | UPMSG )(void)
typedef long | UMENU
typedef void * | UTREEITEM
typedef int(* | UListSorter )(UWidget *wid, void *data1, void *data2)

Enumerations

enum UEventType {
EV_NONE,
EV_CREATE,
EV_DESTROY,
EV_ENTER,
EV_LEAVE,
EV_EXPOSE,
EV_MMOVE,
EV_BTNDOWN,
EV_BTNUP,
EV_BTNDBLDOWN,
EV_KEYDOWN,
EV_SETCURSOR,
EV_CHGCURSOR,
EV_RESIZE,
EV_GETLOC,
EV_SETLOC,
EV_CMD,
EV_UPDTCMD,
EV_ENABLECMD,
EV_FETCHCMD,
EV_SETTOOLTIP,
EV_QUERYSTATE,
EV_GETINTEGER = EV_QUERYSTATE,
EV_SETSTATE,
EV_SETINTEGER = EV_SETSTATE,
EV_CHGFOCUS,
EV_INVALIDATE,
EV_REDRAW,
EV_GETTEXT,
EV_SETTEXT,
EV_GETFLOAT,
EV_SETFLOAT,
EV_INIT_WIDGET,
EV_INIT_TAB_WIDGET,
EV_SHOW_WIDGET,
EV_PAGE_CHANGED,
EV_NOTIFY,
EV_EDITCHANGE,
EV_EDITACTIVATE,
EV_TIMER,
EV_UPDATEUI,
EV_UPDATEFOCUS,
EV_DRAGQUERY,
EV_DROPQUERY,
EV_DROPIT,
EV_DROPQUERY_CMDID,
EV_DROPREF,
EV_TB_INIT,
EV_TB_END,
EV_TB_BUTTON,
EV_TB_DROPDOWN,
EV_TB_CHECKBTN,
EV_TB_SEPARATOR,
EV_TB_GETCOLOR,
EV_SET_SLIDER,
EV_GET_SLIDERPROP,
EV_SET_SLIDERPROP,
EV_SCROLLCHANGE,
EV_CUSTOM_DRAW,
EV_TREE_RESETALL,
EV_TREE_INSERT,
EV_TREE_GETINFO,
EV_TREE_SETDATA,
EV_TREE_SETICON,
EV_TREE_DELETE,
EV_TREE_EXPANDING,
EV_TREE_SELECTING,
EV_TREE_EXPAND,
EV_TREE_SELECT,
EV_TREE_GETSEL,
EV_LIST_SELECTING,
EV_LIST_SELCOLUMN,
EV_LIST_RESORT,
EV_LIST_DBLCLICK,
EV_LIST_RESETALL,
EV_LIST_SETFEEDBACK,
EV_LIST_ADDCOLUMNS,
EV_LIST_SETCOLTITLE,
EV_LIST_SETCOLWIDTH,
EV_LIST_NEWROW,
EV_LIST_ROWSETDATA,
EV_LIST_ROWGETDATA,
EV_LIST_INSERT,
EV_LIST_ADDSEL,
EV_LIST_DELROW,
EV_LIST_GETNEXTSEL,
EV_LIST_GETINFO,
EV_LIST_GETNEXT,
EV_COMBO_RESETALL,
EV_COMBO_APPEND,
EV_COMBO_SETSEL,
EV_COMBO_GETSEL,
EV_COMBO_SEL,
EV_COMBO_GETCOUNT,
EV_COMBO_DELSEL,
EV_COMBO_ENABLESEL,
EV_COMBO_GETMENU,
EV_SMARTCOMBO_SETFEATURE,
EV_SMARTCOMBO_SETITEMS,
EV_SMARTCOMBO_SETREADONLY,
EV_COMMAND_START = 1000
}
enum UEventParam {
epNone,
epV_V,
epV_VP,
epV_iVP,
epV_IVP,
epV_i,
epV_I,
epV_ii,
epV_iii,
epV_iiVP,
epi_i,
epi_V,
epi_ii,
epi_iVP,
epi_VP
}
enum UMSG_EXT {
UMSG_NOEXT,
UMSG_RANGE
}
enum | UTB_VAR { DDV_NONE }
enum | UTB_DROP { DDD_NONE = 0x00 }
enum UCURSOR {
uCursArrow,
uCursWatch
}

Functions

int | UEventSendMessage (int wid, int evt, int arg1, void *arg2)
int | UEventSendMessageExt (int wid, int evt, int arg1, void *arg2, int *handledFlag)
int | UEventPostMessage (int wid, int evt, int arg1, void *arg2)
int | UEventNotifyMessage (int evt, int arg1, void *arg2)
int | UEventGetWidID (void)
void | UEventRemoveWidID (int widid)
void | UEventSetTooltipHandler (void(*handler)(const char *))
void | UEventGiveTime (void)
long | UTickCount (void)
UCmdTarget * | UEventQueryWidget (int widid)
const std::map< int, UCmdTarget * > & | UEventGetTargets (void)
HBITMAP | UMakeBitmap (const char *icon)
HBITMAP | UMakeBitmap (char **icon)
HBITMAP | UMakeBitmap (char **icon, int &width, int &height, COLORREF back)

Define Documentation

#define ev_msg

Definition at line 677 of file umain.h.

#define ON_CHGCURSOR | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_CHGCURSOR, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, UCURSOR cursor))&baseClass::OnChgCursor },

Definition at line 223 of file umain.h.

#define ON_CHGFOCUS | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_CHGFOCUS, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd))&baseClass::OnChgFocus },

Definition at line 339 of file umain.h.

#define ON_COMBO_APPEND | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_COMBO_APPEND, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, const char *txt))&baseClass::OnComboAppend },

Definition at line 555 of file umain.h.

#define ON_COMBO_DELSEL | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_COMBO_DELSEL, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int sel))&baseClass::OnComboDelSel },

Definition at line 563 of file umain.h.

#define ON_COMBO_ENABLESEL | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_COMBO_ENABLESEL, epV_iii, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int sel, int state))&baseClass::OnComboEnableSel },

Definition at line 567 of file umain.h.

#define ON_COMBO_GETCOUNT | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_COMBO_GETCOUNT, epi_i, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(int (UCmdTarget::*)(int cmd))&baseClass::OnComboGetCount },

Definition at line 579 of file umain.h.

#define ON_COMBO_GETMENU | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_COMBO_GETMENU, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, UMENU *menu))&baseClass::OnComboGetMenu },

Definition at line 575 of file umain.h.

#define ON_COMBO_GETSEL | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_COMBO_GETSEL, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(int (UCmdTarget::*)(int cmd, UStr *txt))&baseClass::OnComboGetPos },

Definition at line 571 of file umain.h.

#define ON_COMBO_RESETALL | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_COMBO_RESETALL, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd))&baseClass::OnComboResetAll },

Definition at line 551 of file umain.h.

#define ON_COMBO_SEL | ( | cmd,
 |  | hook | )

Value:

{ EV_COMBO_SEL, epV_IVP, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(int pos, const char *txt))&hook },

Definition at line 583 of file umain.h.

#define ON_COMBO_SEL_RANGE | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_COMBO_SEL, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int pos, const char *txt))&hook },

Definition at line 587 of file umain.h.

#define ON_COMBO_SETSEL | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_COMBO_SETSEL, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int sel))&baseClass::OnComboSetPos },

Definition at line 559 of file umain.h.

#define ON_CUSTOM_DRAW | ( | cmd,
 |  | hook | )

Value:

{ EV_CUSTOM_DRAW, epV_VP, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(void *drawInfo))&hook },

Definition at line 603 of file umain.h.

#define ON_CUSTOM_DRAW_RANGE | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_CUSTOM_DRAW, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, void *drawInfo))&hook },

Definition at line 607 of file umain.h.

#define ON_DRAGQUERY | ( | cmd,
 |  | hook | )

Value:

{ EV_DRAGQUERY, epV_VP, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(UDragable *))&hook },

Definition at line 395 of file umain.h.

#define ON_DRAGQUERY_RANGE | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_DRAGQUERY, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int, UDragable *))&hook },

Definition at line 407 of file umain.h.

#define ON_DROPIT | ( | cmd,
 |  | hook | )

Value:

{ EV_DROPIT, epV_VP, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(const UDragable *))&hook },

Definition at line 403 of file umain.h.

#define ON_DROPIT_RANGE | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_DROPIT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int, const UDragable *))&hook },

Definition at line 415 of file umain.h.

#define ON_DROPQUERY | ( | cmd,
 |  | hook | )

Value:

{ EV_DROPQUERY, epV_VP, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(UDropable **))&hook },

Definition at line 399 of file umain.h.

#define ON_DROPQUERY_CMDID ( baseClass )

Value:

{ EV_DROPQUERY_CMDID, epV_iiVP, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(int, int, int *))&baseClass::OnDropQueryCmdID },

Definition at line 419 of file umain.h.

#define ON_DROPQUERY_RANGE | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_DROPQUERY, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int, UDropable **))&hook },

Definition at line 411 of file umain.h.

#define ON_DROPREF | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_DROPREF, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int numref, long *refs))&hook },

Definition at line 363 of file umain.h.

#define ON_EDITACTIVATE | ( | cmd,
 |  | hook | )

Value:

{ EV_EDITACTIVATE, epV_V, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(void))&hook },

Definition at line 303 of file umain.h.

#define ON_EDITACTIVATE_RANGE | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_EDITACTIVATE, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd))&hook },

Definition at line 307 of file umain.h.

#define ON_EDITCHANGE | ( | cmd,
 |  | hook | )

Value:

{ EV_EDITCHANGE, epV_V, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(void))&hook },

Definition at line 295 of file umain.h.

#define ON_EDITCHANGE_RANGE | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_EDITCHANGE, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd))&hook },

Definition at line 299 of file umain.h.

#define ON_ENABLECMD | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_ENABLECMD, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int state))&hook },

Definition at line 335 of file umain.h.

#define ON_FETCHCMD | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_FETCHCMD, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(int (UCmdTarget::*)(int cmd, void *widget))&baseClass::OnFetchCmd },

Definition at line 271 of file umain.h.

#define ON_GET_SLIDERPROP | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_GET_SLIDERPROP, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, USLIDER *prop))&baseClass::OnGetSliderProperty },

Definition at line 427 of file umain.h.

#define ON_GETFLOAT | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_GETFLOAT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, float *f))&baseClass::OnGetFloat },

Definition at line 391 of file umain.h.

#define ON_GETTEXT | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_GETTEXT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int, UStr *))&hook },

Definition at line 383 of file umain.h.

#define ON_INIT_TAB_WIDGET | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_INIT_TAB_WIDGET, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int, int, void *))&baseClass::OnInitTabWidget },

Definition at line 375 of file umain.h.

#define ON_INIT_WIDGET | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_INIT_WIDGET, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int, void *))&baseClass::OnInitWidget },

Definition at line 371 of file umain.h.

#define ON_INVALIDATE | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_INVALIDATE, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd))&baseClass::OnInvalidate },

Definition at line 343 of file umain.h.

#define ON_KEYDOWN ( baseClass )

Value:

{ EV_KEYDOWN, epV_i, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(int c))&baseClass::OnKeyDown },

Definition at line 211 of file umain.h.

#define ON_LIST_ADDCOLUMNS | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_LIST_ADDCOLUMNS, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int num))&baseClass::OnListAddColumns },

Definition at line 507 of file umain.h.

#define ON_LIST_ADDSEL | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_LIST_ADDSEL, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int entry))&baseClass::OnListAddSel },

Definition at line 495 of file umain.h.

#define ON_LIST_DBLCLICK | ( | cmd,
 |  | hook | )

Value:

{ EV_LIST_DBLCLICK, epV_V, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(void))&hook },

Definition at line 491 of file umain.h.

#define ON_LIST_DELROW | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_LIST_DELROW, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int row))&baseClass::OnListDelRow },

Definition at line 499 of file umain.h.

#define ON_LIST_GETINFO | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_LIST_GETINFO, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, ULIST_INFO *data))&baseClass::OnListGetInfo },

Definition at line 547 of file umain.h.

#define ON_LIST_GETNEXT | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_LIST_GETNEXT, epi_ii, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(int (UCmdTarget::*)(int cmd, int whichCell))&baseClass::OnListGetNext },

Definition at line 543 of file umain.h.

#define ON_LIST_GETNEXTSEL | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_LIST_GETNEXTSEL, epi_ii, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(int (UCmdTarget::*)(int cmd, int selectedCell))&baseClass::OnListGetNextSel },

Definition at line 539 of file umain.h.

#define ON_LIST_INSERT | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_LIST_INSERT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, ULIST_INSERT *data))&baseClass::OnListInsert },

Definition at line 535 of file umain.h.

#define ON_LIST_NEWROW | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_LIST_NEWROW, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int *num))&baseClass::OnListNewRow },

Definition at line 523 of file umain.h.

#define ON_LIST_RESETALL | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_LIST_RESETALL, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd))&baseClass::OnListResetAll },

Definition at line 503 of file umain.h.

#define ON_LIST_RESORT | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_LIST_RESORT, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int column, UListSorter s))&baseClass::OnListResort },

Definition at line 487 of file umain.h.

#define ON_LIST_ROWGETDATA | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_LIST_ROWGETDATA, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int row, void **data))&baseClass::OnListRowGetData },

Definition at line 531 of file umain.h.

#define ON_LIST_ROWSETDATA | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_LIST_ROWSETDATA, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int row, void *data))&baseClass::OnListRowSetData },

Definition at line 527 of file umain.h.

#define ON_LIST_SELCOLUMN | ( | cmd,
 |  | hook | )

Value:

{ EV_LIST_SELCOLUMN, epV_I, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(int entry))&hook },

Definition at line 483 of file umain.h.

#define ON_LIST_SELECTING | ( | cmd,
 |  | hook | )

Value:

{ EV_LIST_SELECTING, epV_IVP, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(int entry, const char *txt))&hook },

Definition at line 479 of file umain.h.

#define ON_LIST_SETCOLTITLE | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_LIST_SETCOLTITLE, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int num, const char *title))&baseClass::OnListSetColTitle },

Definition at line 515 of file umain.h.

#define ON_LIST_SETCOLWIDTH | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_LIST_SETCOLWIDTH, epV_iii, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int num, int width))&baseClass::OnListSetColWidth },

Definition at line 519 of file umain.h.

#define ON_LIST_SETFEEDBACK | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_LIST_SETFEEDBACK, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int turnOn))&baseClass::OnListSetFeedback },

Definition at line 511 of file umain.h.

#define ON_PAGE_CHANGED | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_PAGE_CHANGED, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int pagenum))&baseClass::OnPageChanged },

Definition at line 355 of file umain.h.

#define ON_QUERYSTATE | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_QUERYSTATE, epi_i, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(int (UCmdTarget::*)(int cmd))&hook },

Definition at line 291 of file umain.h.

#define ON_REDRAW | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_REDRAW, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd))&baseClass::OnRedraw },

Definition at line 347 of file umain.h.

#define ON_RESIZE | ( | cmd,
 |  | hook | )

Value:

{ EV_RESIZE, epV_VP, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(const URECT * r))&hook },

Definition at line 215 of file umain.h.

#define ON_SCROLLCHANGE | ( | cmd,
 |  | hook | )

Value:

{ EV_SCROLLCHANGE, epV_VP, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(int pos))&hook },

Definition at line 311 of file umain.h.

#define ON_SCROLLCHANGE_RANGE | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_SCROLLCHANGE, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int pos))&hook },

Definition at line 315 of file umain.h.

#define ON_SET_SLIDER | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_SET_SLIDER, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int pos))&baseClass::OnSetSlider },

Definition at line 423 of file umain.h.

#define ON_SET_SLIDERPROP | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_SET_SLIDERPROP, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, const USLIDER *prop))&baseClass::OnSetSliderProperty },

Definition at line 431 of file umain.h.

#define ON_SETCURSOR ( baseClass )

Value:

{ EV_SETCURSOR, epV_V, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnSetCursor },

Definition at line 219 of file umain.h.

#define ON_SETFLOAT | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_SETFLOAT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, const float *f))&baseClass::OnSetFloat },

Definition at line 387 of file umain.h.

#define ON_SETSTATE | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_SETSTATE, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int state))&hook },

Definition at line 331 of file umain.h.

#define ON_SETTEXT | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_SETTEXT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int, const char *))&hook },

Definition at line 379 of file umain.h.

#define ON_SHOW_WIDGET | ( | cmd,
 |  | hook | )

Value:

{ EV_SHOW_WIDGET, epV_I, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(int state))&hook },

Definition at line 351 of file umain.h.

#define ON_SHOW_WIDGET_RANGE | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_SHOW_WIDGET, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int state))&hook },

Definition at line 359 of file umain.h.

#define ON_SMARTCOMBO_SETFEATURE | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_SMARTCOMBO_SETFEATURE, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int feature))&baseClass::OnSmartComboSetFeature },

Definition at line 591 of file umain.h.

#define ON_SMARTCOMBO_SETITEMS | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_SMARTCOMBO_SETITEMS, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, CMString* items))&baseClass::OnSmartComboSetItems },

Definition at line 595 of file umain.h.

#define ON_SMARTCOMBO_SETREADONLY | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_SMARTCOMBO_SETREADONLY, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, bool readOnly))&baseClass::OnSmartComboSetReadOnly },

Definition at line 599 of file umain.h.

#define ON_TB_BUTTON ( baseClass )

Value:

{ EV_TB_BUTTON, epV_VP, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(UTB_BUTTON *info))&baseClass::OnTbButton },

Definition at line 235 of file umain.h.

#define ON_TB_CHECKBTN ( baseClass )

Value:

{ EV_TB_CHECKBTN, epV_VP, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(UTB_BUTTON *info))&baseClass::OnTbCheckBtn },

Definition at line 243 of file umain.h.

#define ON_TB_DROPDOWN ( baseClass )

Value:

{ EV_TB_DROPDOWN, epV_VP, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(UTB_DROPDOWN *info))&baseClass::OnTbDropDown },

Definition at line 239 of file umain.h.

#define ON_TB_END ( baseClass )

Value:

{ EV_TB_END, epV_V, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnTbEnd },

Definition at line 231 of file umain.h.

#define ON_TB_GETCOLOR ( baseClass )

Value:

{ EV_TB_GETCOLOR, epV_iVP, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, float *color))&baseClass::OnTbGetColor },

Definition at line 247 of file umain.h.

#define ON_TB_INIT ( baseClass )

Value:

{ EV_TB_INIT, epV_VP, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(UTB_INIT *info))&baseClass::OnTbInit },

Definition at line 227 of file umain.h.

#define ON_TB_SEPARATOR ( baseClass )

Value:

{ EV_TB_SEPARATOR, epV_V, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnTbSeparator },

Definition at line 251 of file umain.h.

#define ON_TIMER | ( | cmd,
 |  | hook | )

Value:

{ EV_TIMER, epV_VP, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(long time))&hook },

Definition at line 319 of file umain.h.

#define ON_TREE_DELETE | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_TREE_DELETE, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, UTREEITEM item))&baseClass::OnTreeDelete },

Definition at line 455 of file umain.h.

#define ON_TREE_EXPAND | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_TREE_EXPAND, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int collapse, UTREEITEM item))&baseClass::OnTreeExpand },

Definition at line 459 of file umain.h.

#define ON_TREE_EXPANDING | ( | cmd,
 |  | hook | )

Value:

{ EV_TREE_EXPANDING, epV_IVP, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(int collapse, UTREEITEM item))&hook },

Definition at line 471 of file umain.h.

#define ON_TREE_GETINFO | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_TREE_GETINFO, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, UTREE_INFO *data))&baseClass::OnTreeGetInfo },

Definition at line 443 of file umain.h.

#define ON_TREE_GETSEL | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_TREE_GETSEL, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, UTREEITEM *item))&baseClass::OnTreeGetSel },

Definition at line 467 of file umain.h.

#define ON_TREE_INSERT | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_TREE_INSERT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, UTREE_INSERT *data))&baseClass::OnTreeInsert },

Definition at line 439 of file umain.h.

#define ON_TREE_RESETALL | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_TREE_RESETALL, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd))&baseClass::OnTreeResetAll },

Definition at line 435 of file umain.h.

#define ON_TREE_SELECT | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_TREE_SELECT, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int deselect, UTREEITEM item))&baseClass::OnTreeSelect },

Definition at line 463 of file umain.h.

#define ON_TREE_SELECTING | ( | cmd,
 |  | hook | )

Value:

{ EV_TREE_SELECTING, epV_IVP, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(int deselect, UTREEITEM item))&hook },

Definition at line 475 of file umain.h.

#define ON_TREE_SETDATA | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_TREE_SETDATA, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, UTREE_INFO *data))&baseClass::OnTreeSetData },

Definition at line 447 of file umain.h.

#define ON_TREE_SETICON | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_TREE_SETICON, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, UTREE_INFO *data))&baseClass::OnTreeSetIcon },

Definition at line 451 of file umain.h.

#define ON_UBTNDBLDOWN ( baseClass )

Value:

{ EV_BTNDBLDOWN, epV_iii, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(int x, int y, int mod))&baseClass::OnBtnDblDown },

Definition at line 207 of file umain.h.

#define ON_UBTNDOWN ( baseClass )

Value:

{ EV_BTNDOWN, epV_iii, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(int x, int y, int mod))&baseClass::OnBtnDown },

Definition at line 199 of file umain.h.

#define ON_UBTNUP ( baseClass )

Value:

{ EV_BTNUP, epV_iii, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(int x, int y, int mod))&baseClass::OnBtnUp },

Definition at line 203 of file umain.h.

#define ON_UCOMMAND | ( | cmd,
 |  | hook | )

Value:

{ EV_CMD, epi_V, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(int (UCmdTarget::*)(void))&hook },

Definition at line 255 of file umain.h.

#define ON_UCOMMAND_RANGE | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_CMD, epi_i, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(int (UCmdTarget::*)(int cmd))&hook },

Definition at line 259 of file umain.h.

#define ON_UCOMMAND_RANGEEX | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_CMD, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(int (UCmdTarget::*)(int cmd, void *data))&hook },

Definition at line 263 of file umain.h.

#define ON_UCREATE ( baseClass )

Value:

{ EV_CREATE, epV_V, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnCreate },

Definition at line 175 of file umain.h.

#define ON_UDESTROY ( baseClass )

Value:

{ EV_DESTROY, epV_V, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnDestroy },

Definition at line 179 of file umain.h.

#define ON_UENTER ( baseClass )

Value:

{ EV_ENTER, epV_VP, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(void *))&baseClass::OnEnter },

Definition at line 183 of file umain.h.

#define ON_UEXPOSE ( baseClass )

Value:

{ EV_EXPOSE, epV_V, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnExpose },

Definition at line 191 of file umain.h.

#define ON_UGETLLOC | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_GETLOC, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, URECT *r))&hook },

Definition at line 283 of file umain.h.

#define ON_ULEAVE ( baseClass )

Value:

{ EV_LEAVE, epV_V, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnLeave },

Definition at line 187 of file umain.h.

#define ON_UMMOVE ( baseClass )

Value:

{ EV_MMOVE, epV_iii, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(int x, int y, int mod))&baseClass::OnMouseMove },

Definition at line 195 of file umain.h.

#define ON_UNOTIFY | ( | cmd,
 |  | hook | )

Value:

{ EV_NOTIFY, epV_V, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(void))&hook },

Definition at line 367 of file umain.h.

#define ON_UPDATEFOCUS ( baseClass )

Value:

{ EV_UPDATEFOCUS, epi_iVP, UMSG_NOEXT, 0, 0, \
        (UPMSG)(int (UCmdTarget::*)(int leave, void *widget))&baseClass::OnUpdateFocus },

Definition at line 327 of file umain.h.

#define ON_UPDATEUI ( baseClass )

Value:

{ EV_UPDATEUI, epV_V, UMSG_NOEXT, 0, 0, \
        (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnUpdateUI },

Definition at line 323 of file umain.h.

#define ON_USETLLOC | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_SETLOC, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, const URECT *r))&hook },

Definition at line 287 of file umain.h.

#define ON_USETTOOLTIP | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_SETTOOLTIP, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, UCmdUI *pCmdUI))&hook },

Definition at line 279 of file umain.h.

#define ON_UUPDATECMD | ( | cmd,
 |  | hook | )

Value:

{ EV_UPDTCMD, epV_VP, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(UCmdUI *pCmdUI))&hook },

Definition at line 267 of file umain.h.

#define ON_UUPDATECMD_RANGE | ( | cmdmin,
 |  | cmdmax,
 |  | hook | )

Value:

{ EV_UPDTCMD, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, UCmdUI *pCmdUI))&hook },

Definition at line 275 of file umain.h.

#define STD std::

Definition at line 165 of file umain.h.

Referenced by LMainPseudoAttachment::ExecuteSelf, CAllTargets::Get, UWidget::HasModal, UToolbar::OnCommands, UMenu::OnCommands, UToolbar::OnUpdateUI, UMenu::OnUpdateUI, UMacAppMenu::OnUpdateUI, UEventGetTargets, UEventGiveTime, UEventNotifyMessage, UEventQueryWidget, UEventRemoveWidID, UEventSendMessage, UEventSendMessageExt, and CAllTargets::~CAllTargets.

#define UBEGIN_MESSAGE_MAP | ( | theClass,
 |  | baseClass | )

Value:

const UMSGMAP* theClass::GetBaseMessageMap() \
        { return baseClass::GetThisMessageMap(); } \
    const UMSGMAP* theClass::GetThisMessageMap() \
        { return &theClass::messageMap; } \
    const UMSGMAP* theClass::GetMessageMap() const \
        { return &theClass::messageMap; } \
    const UMSGMAP theClass::messageMap = \
    { baseClass::GetThisMessageMap(), &theClass::_messageEntries[0] }; \
    const UMSGMAP_ENTRY theClass::_messageEntries[] = \
    { \

Definition at line 661 of file umain.h.

#define UCMD_to_WINCMD ( cmd ) (cmd)

Definition at line 854 of file umain.h.

Referenced by CDynToolBar::OnDropDownButton, UToolbar::RebuildBar, UMenuAddButton, and UMenuAddToggle.

#define UCMD_to_WINCTL ( cmd ) ((cmd)-EV_COMMAND_START+WINCMD_DLG_START)

Definition at line 856 of file umain.h.

Referenced by CPseudoDlg::DoDataExchange.

#define UDECLARE_MESSAGE_MAP ( )

Value:

private: \
    static const UMSGMAP_ENTRY _messageEntries[]; \
protected: \
    static const UMSGMAP messageMap; \
    static const UMSGMAP* GetBaseMessageMap(); \
    static const UMSGMAP* GetThisMessageMap(); \
    virtual const UMSGMAP* GetMessageMap() const; \

Definition at line 652 of file umain.h.

#define UEND_MESSAGE_MAP ( )

Value:

{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 } \
    }; \

Definition at line 673 of file umain.h.

#define UHIWORD ( l ) ((short)(((int)(l) >> 16) & 0xFFFF))

Definition at line 777 of file umain.h.

Referenced by UWidget::DoModal, and UCmdTarget::UDispatchMessage.

#define UK_ADD 0x6B

Definition at line 821 of file umain.h.

#define UK_ALT 0x20

Definition at line 785 of file umain.h.

Referenced by addAccel, GetMenuTitle, and UWinToUMod.

#define UK_BACK 0x08

Definition at line 789 of file umain.h.

#define UK_CANCEL 0x03

Definition at line 788 of file umain.h.

#define UK_CLEAR 0x0C

Definition at line 791 of file umain.h.

#define UK_CONTROL 0x08

Definition at line 783 of file umain.h.

Referenced by addAccel, GetMenuTitle, and UWinToUMod.

#define UK_DECIMAL 0x6E

Definition at line 824 of file umain.h.

#define UK_DELETE 0x2E

Definition at line 804 of file umain.h.

#define UK_DIVIDE 0x6F

Definition at line 825 of file umain.h.

#define UK_DOWN 0x28

Definition at line 802 of file umain.h.

#define UK_END 0x23

Definition at line 797 of file umain.h.

#define UK_ESCAPE 0x1B

Definition at line 793 of file umain.h.

#define UK_F1 0x70

Definition at line 826 of file umain.h.

#define UK_F10 0x79

Definition at line 835 of file umain.h.

#define UK_F11 0x7A

Definition at line 836 of file umain.h.

#define UK_F12 0x7B

Definition at line 837 of file umain.h.

#define UK_F13 0x7C

Definition at line 838 of file umain.h.

#define UK_F14 0x7D

Definition at line 839 of file umain.h.

#define UK_F15 0x7E

Definition at line 840 of file umain.h.

#define UK_F16 0x7F

Definition at line 841 of file umain.h.

#define UK_F17 0x80

Definition at line 842 of file umain.h.

#define UK_F18 0x81

Definition at line 843 of file umain.h.

#define UK_F19 0x82

Definition at line 844 of file umain.h.

#define UK_F2 0x71

Definition at line 827 of file umain.h.

#define UK_F20 0x83

Definition at line 845 of file umain.h.

#define UK_F21 0x84

Definition at line 846 of file umain.h.

#define UK_F22 0x85

Definition at line 847 of file umain.h.

#define UK_F23 0x86

Definition at line 848 of file umain.h.

#define UK_F24 0x87

Definition at line 849 of file umain.h.

#define UK_F3 0x72

Definition at line 828 of file umain.h.

#define UK_F4 0x73

Definition at line 829 of file umain.h.

#define UK_F5 0x74

Definition at line 830 of file umain.h.

#define UK_F6 0x75

Definition at line 831 of file umain.h.

#define UK_F7 0x76

Definition at line 832 of file umain.h.

#define UK_F8 0x77

Definition at line 833 of file umain.h.

#define UK_F9 0x78

Definition at line 834 of file umain.h.

#define UK_HELP 0x2F

Definition at line 805 of file umain.h.

#define UK_HOME 0x24

Definition at line 798 of file umain.h.

#define UK_INSERT 0x2D

Definition at line 803 of file umain.h.

#define UK_LBUTTON 0x01

Definition at line 780 of file umain.h.

#define UK_LEFT 0x25

Definition at line 799 of file umain.h.

#define UK_MBUTTON 0x02

Definition at line 781 of file umain.h.

Referenced by UWinToUMod.

#define UK_MINUS 0x6D

Definition at line 808 of file umain.h.

#define UK_MULTIPLY 0x6A

Definition at line 820 of file umain.h.

#define UK_NEXT 0x22

Definition at line 796 of file umain.h.

#define UK_NUMPAD0 0x60

Definition at line 810 of file umain.h.

#define UK_NUMPAD1 0x61

Definition at line 811 of file umain.h.

#define UK_NUMPAD2 0x62

Definition at line 812 of file umain.h.

#define UK_NUMPAD3 0x63

Definition at line 813 of file umain.h.

#define UK_NUMPAD4 0x64

Definition at line 814 of file umain.h.

#define UK_NUMPAD5 0x65

Definition at line 815 of file umain.h.

#define UK_NUMPAD6 0x66

Definition at line 816 of file umain.h.

#define UK_NUMPAD7 0x67

Definition at line 817 of file umain.h.

#define UK_NUMPAD8 0x68

Definition at line 818 of file umain.h.

#define UK_NUMPAD9 0x69

Definition at line 819 of file umain.h.

#define UK_PLUS 0x6B

Definition at line 807 of file umain.h.

#define UK_PRIOR 0x21

Definition at line 795 of file umain.h.

#define UK_RBUTTON 0x04

Definition at line 782 of file umain.h.

Referenced by UWinToUMod.

#define UK_RETURN 0x0D

Definition at line 792 of file umain.h.

#define UK_RIGHT 0x27

Definition at line 801 of file umain.h.

#define UK_SEPARATOR 0x6C

Definition at line 822 of file umain.h.

#define UK_SHIFT 0x10

Definition at line 784 of file umain.h.

Referenced by UWinToUMod.

#define UK_SPACE 0x20

Definition at line 794 of file umain.h.

#define UK_SUBTRACT 0x6D

Definition at line 823 of file umain.h.

#define UK_TAB 0x09

Definition at line 790 of file umain.h.

#define UK_UP 0x26

Definition at line 800 of file umain.h.

#define ULOWORD ( l ) ((short)(l))

Definition at line 776 of file umain.h.

Referenced by UWidget::DoModal, and UCmdTarget::UDispatchMessage.

#define UMAKEINT | ( | a,
 |  | b | ) | ((int)(((short)(a)) | ((int)((short)(b))) << 16))

Definition at line 775 of file umain.h.

Referenced by UWidget::AddPage, CvsLogParse, UCvsFiles::DisableGeneric, USaveSettings::DoDataExchange, UAuthen_Gserver::DoDataExchange, UAuthen_Kserver::DoDataExchange, UAuthen_Rhosts::DoDataExchange, UAuthen_Pserver::DoDataExchange, UAuthen_SSH::DoDataExchange, TPseudoWinBehavior::DoEvent, UWidget::DoModal, UPseudoPlaceHolder::DoRotate, CPseudoItem::DoubleClick, LPseudoWinAttachment::ListenToMessage, UAuthen_SSH::OnCheckName, UAuthen_SSH::OnCheckOptions, UAuthen_Kserver::OnCheckPort, UAuthen_Rhosts::OnCheckPort, UAuthen_Pserver::OnCheckPort, UAuthen_Pserver::OnCheckProxy, UAuthen_SSH::OnCheckRSA, UAuthen_Rhosts::OnCheckRshName, UAuthen_Rhosts::OnCheckServerName, UCvsFiles::OnCmdAdd, UCvsFiles::OnCmdAddb, UCvsFiles::OnCmdCommit, UCvsFiles::OnCmdDiff, UCvsFiles::OnCmdEdit, UCvsFiles::OnCmdEditors, UCvsFiles::OnCmdEditsel, UCvsFiles::OnCmdEditseldef, UCvsFiles::OnCmdExplore, UCvsFiles::OnCmdGraph, UCvsFiles::OnCmdLock, UCvsFiles::OnCmdLog, UCvsFiles::OnCmdQueryUpdate, UCvsFiles::OnCmdRelease, UCvsFiles::OnCmdRmv, UCvsFiles::OnCmdStatus, UCvsFiles::OnCmdTagBranch, UCvsFiles::OnCmdTagDelete, UCvsFiles::OnCmdTagNew, UCvsFiles::OnCmdTrash, UCvsFiles::OnCmdUIAdd, UCvsFiles::OnCmdUIAddB, UCvsFiles::OnCmdUIEditseldef, UCvsFiles::OnCmdUIExplore, UCvsFiles::OnCmdUIGraph, UCvsFiles::OnCmdUIMacroSel, UCvsFiles::OnCmdUIRelease, UCvsFiles::OnCmdUIRmv, UCvsFiles::OnCmdUITrash, UCvsFiles::OnCmdUIUpdate, UCvsFiles::OnCmdUnedit, UCvsFiles::OnCmdUnlock, UCvsFiles::OnCmdUpdate, UCvsFiles::OnCmdWatchers, UCvsFiles::OnCmdWatchOff, UCvsFiles::OnCmdWatchOn, UWidget::OnComboAppend, USaveSettings::OnCopyFrom, UCvsFiles::OnCreate, UCvsFiles::OnDblClick, TViewFill::OnDirectory, TViewFill::OnFile, UWidget::OnInitWidget, CPseudoList::OnLButtonDblClk, UCvsFiles::OnMacroSel, UWidget::OnPageChanged, UCvsFolders::OnTreeExpanding, UWidget::OnTreeInsert, UCvsFolders::ResetBrowser, UCvsFolders::ResetView, UCvsFiles::ResetView, UCvsFiles::Resort, UCvsFiles::Search, CPseudoItem::SingleClick, UCvsFolders::StepToLocation, UWaitCursor::UWaitCursor, UWinPseudoWindowProc, and UWaitCursor::~UWaitCursor.

#define UMENU_NULL ((UMENU)0L)

Definition at line 862 of file umain.h.

Referenced by CreateMainMenubar, UWidget::OnComboGetMenu, UMenuAddButton, UMenuAddPulldown, UMenuAddSeparator, UMenuAddToggle, UMenuCount, UMenuDelete, and UMenuDeleteByCmd.

#define UTB_SEPARATOR (-1)

Definition at line 865 of file umain.h.

Referenced by UToolbar::RebuildBar.

#define WINCMD_DLG_END 3000

Definition at line 853 of file umain.h.

#define WINCMD_DLG_START 2000

Definition at line 852 of file umain.h.

#define WINCMD_to_UCMD ( cmd ) (cmd)

Definition at line 855 of file umain.h.

Referenced by CDynToolBar::OnDropDownButton, CWinCvsBrowser::OnMacro, CBrowseFileView::OnMacro, CWinCvsBrowser::OnUpdateMacro, and CBrowseFileView::OnUpdateMacro.

#define WINCTL_to_UCMD ( cmd ) ((cmd)-WINCMD_DLG_START+EV_COMMAND_START)

Definition at line 857 of file umain.h.

Referenced by UWinPseudoWindowProc, and WinInitWidgets.

Typedef Documentation

typedef int(* UListSorter)(UWidget *wid, void *data1, void *data2)

Definition at line 959 of file umain.h.

Referenced by UWidget::OnListResort, and UCvsFiles::Resort.

typedef long UMENU

Definition at line 861 of file umain.h.

Referenced by PyMenuMgr::Create, CreateMainMenubar, cvsgui_GetTopMacroAdminMenu, cvsgui_GetTopMacroSelectionMenu, UWidget::OnComboGetMenu, ParseUMENU, PyMenuMgr::PyMenuMgr, UMenuAddButton, UMenuAddPulldown, UMenuAddSeparator, UMenuAddToggle, UMenuCount, UMenuDelete, and UMenuDeleteByCmd.

typedef void(UCmdTarget::* UPMSG)(void)

Definition at line 173 of file umain.h.

typedef void* UTREEITEM

Definition at line 929 of file umain.h.

Referenced by UCvsFolders::DeleteAllItems, GetIcon, UCvsFolders::GetItemByLocation, UCvsFolders::OnCmdAdd, UCvsFolders::OnCmdCommit, UCvsFolders::OnCmdDiff, UCvsFolders::OnCmdEdit, UCvsFolders::OnCmdEditors, UCvsFolders::OnCmdExplore, UCvsFolders::OnCmdLock, UCvsFolders::OnCmdLog, UCvsFolders::OnCmdMacrosSel, UCvsFolders::OnCmdQueryUpdate, UCvsFolders::OnCmdRelease, UCvsFolders::OnCmdStatus, UCvsFolders::OnCmdTagBranch, UCvsFolders::OnCmdTagDelete, UCvsFolders::OnCmdTagNew, UCvsFolders::OnCmdUIExplore, UCvsFolders::OnCmdUIMacrosSel, UCvsFolders::OnCmdUnedit, UCvsFolders::OnCmdUnlock, UCvsFolders::OnCmdUpdate, UCvsFolders::OnCmdWatchers, UCvsFolders::OnCmdWatchOff, UCvsFolders::OnCmdWatchOn, UWidget::OnTreeDelete, UWidget::OnTreeExpand, UCvsFolders::OnTreeExpanding, UWidget::OnTreeGetSel, UWidget::OnTreeSelect, UCvsFolders::OnTreeSelecting, UCvsFolders::OnUpdateGeneric, UCvsFolders::ResetView, UCvsFolders::RetrievePath, UCvsFolders::StepToLocation, UCvsFolders::StoreExpanded, TBrowserFill::TBrowserFill, and TBrowserFillDummy::TBrowserFillDummy.

Enumeration Type Documentation

enum UCURSOR

Enumeration values:
uCursArrow
uCursWatch

Definition at line 908 of file umain.h.

Referenced by UWidget::OnChgCursor.

00909 {
00910     uCursArrow,
00911     uCursWatch
00912 } UCURSOR;

enum UEventParam

Enumeration values:
epNone
epV_V
epV_VP
epV_iVP
epV_IVP
epV_i
epV_I
epV_ii
epV_iii
epV_iiVP
epi_i
epi_V
epi_ii
epi_iVP
epi_VP

Definition at line 611 of file umain.h.

00612 {
00613     epNone,
00614     epV_V,      // void (void)
00615     epV_VP,     // void (arg2)
00616     epV_iVP,    // void (arg1, arg2)
00617     epV_IVP,    // void (HI(arg1), arg2)
00618     epV_i,      // void (arg1)
00619     epV_I,      // void (HI(arg1))
00620     epV_ii,     // void (LO(arg1), HI(arg1))
00621     epV_iii,    // void (LO(arg1), HI(arg1), (int)arg2)
00622     epV_iiVP,   // void (LO(arg1), HI(arg1), arg2)
00623     epi_i,      // int (arg1)
00624     epi_V,      // int (void)
00625     epi_ii,     // int (LO(arg1), HI(arg1))
00626     epi_iVP,    // int (arg1, arg2)
00627     epi_VP      // int (arg2)
00628 } UEventParam;

enum UEventType

Enumeration values:
EV_NONE
EV_CREATE
EV_DESTROY
EV_ENTER
EV_LEAVE
EV_EXPOSE
EV_MMOVE
EV_BTNDOWN
EV_BTNUP
EV_BTNDBLDOWN
EV_KEYDOWN
EV_SETCURSOR
EV_CHGCURSOR
EV_RESIZE
EV_GETLOC
EV_SETLOC
EV_CMD
EV_UPDTCMD
EV_ENABLECMD
EV_FETCHCMD
EV_SETTOOLTIP
EV_QUERYSTATE
EV_GETINTEGER
EV_SETSTATE
EV_SETINTEGER
EV_CHGFOCUS
EV_INVALIDATE
EV_REDRAW
EV_GETTEXT
EV_SETTEXT
EV_GETFLOAT
EV_SETFLOAT
EV_INIT_WIDGET
EV_INIT_TAB_WIDGET
EV_SHOW_WIDGET
EV_PAGE_CHANGED
EV_NOTIFY
EV_EDITCHANGE
EV_EDITACTIVATE
EV_TIMER
EV_UPDATEUI
EV_UPDATEFOCUS
EV_DRAGQUERY
EV_DROPQUERY
EV_DROPIT
EV_DROPQUERY_CMDID
EV_DROPREF
EV_TB_INIT
EV_TB_END
EV_TB_BUTTON
EV_TB_DROPDOWN
EV_TB_CHECKBTN
EV_TB_SEPARATOR
EV_TB_GETCOLOR
EV_SET_SLIDER
EV_GET_SLIDERPROP
EV_SET_SLIDERPROP
EV_SCROLLCHANGE
EV_CUSTOM_DRAW
EV_TREE_RESETALL
EV_TREE_INSERT
EV_TREE_GETINFO
EV_TREE_SETDATA
EV_TREE_SETICON
EV_TREE_DELETE
EV_TREE_EXPANDING
EV_TREE_SELECTING
EV_TREE_EXPAND
EV_TREE_SELECT
EV_TREE_GETSEL
EV_LIST_SELECTING
EV_LIST_SELCOLUMN
EV_LIST_RESORT
EV_LIST_DBLCLICK
EV_LIST_RESETALL
EV_LIST_SETFEEDBACK
EV_LIST_ADDCOLUMNS
EV_LIST_SETCOLTITLE
EV_LIST_SETCOLWIDTH
EV_LIST_NEWROW
EV_LIST_ROWSETDATA
EV_LIST_ROWGETDATA
EV_LIST_INSERT
EV_LIST_ADDSEL
EV_LIST_DELROW
EV_LIST_GETNEXTSEL
EV_LIST_GETINFO
EV_LIST_GETNEXT
EV_COMBO_RESETALL
EV_COMBO_APPEND
EV_COMBO_SETSEL
EV_COMBO_GETSEL
EV_COMBO_SEL
EV_COMBO_GETCOUNT
EV_COMBO_DELSEL
EV_COMBO_ENABLESEL
EV_COMBO_GETMENU
EV_SMARTCOMBO_SETFEATURE
EV_SMARTCOMBO_SETITEMS
EV_SMARTCOMBO_SETREADONLY
EV_COMMAND_START

Definition at line 33 of file umain.h.

00034 {
00035     EV_NONE,
00036
00037     /* system events */
00038     EV_CREATE,      /* void OnCreate(void) */
00039     EV_DESTROY,     /* void OnDestroy(void) */
00040     EV_ENTER,       /* void OnEnter(void *data) */
00041     EV_LEAVE,       /* void OnLeave(void) */
00042     EV_EXPOSE,      /* void OnExpose(void) */
00043     EV_MMOVE,       /* void OnMouseMove(int x, int y, int mod) */
00044     EV_BTNDOWN,     /* void OnBtnDown(int x, int y, int mod) */
00045     EV_BTNUP,       /* void OnBtnUp(int x, int y, int mod) */
00046     EV_BTNDBLDOWN,  /* void OnBtnDblDown(int x, int y, int mod) */
00047     EV_KEYDOWN,     /* void OnKeyDown(int c) */
00048     EV_SETCURSOR,   /* void OnSetCursor(void) */
00049     EV_CHGCURSOR,   /* void OnChgCursor(int cmd, UCURSOR cursor) */
00050     EV_RESIZE,      /* void OnResize(const URECT * r) */
00051     EV_GETLOC,      /* void OnGetLoc<Cmd>(int cmd, URECT *) */
00052     EV_SETLOC,      /* void OnSetLoc<Cmd>(int cmd, const URECT *) */
00053
00054     /* generic */
00055     EV_CMD,         /* int On<Cmd>(void) */
00056     EV_UPDTCMD,     /* void OnUpdate<Cmd>(UCmdUI *pCmdUI) */
00057     EV_ENABLECMD,   /* void OnEnableCmd<Cmd>(int cmd, int enabled) */
00058     EV_FETCHCMD,    /* int OnFetchCmd(int cmd, void *widget) */
00059     EV_SETTOOLTIP,  /* void OnSetTooltip<Cmd>(int cmd, UCmdUI *pCmdUI) */
00060     EV_QUERYSTATE,  /* int OnQueryState<Cmd>(int cmd) */
00061     EV_GETINTEGER = EV_QUERYSTATE,
00062     EV_SETSTATE,    /* void OnSetState<Cmd>(int cmd, int state) */
00063     EV_SETINTEGER = EV_SETSTATE,
00064     EV_CHGFOCUS,    /* void OnChgFocus(int cmd) */
00065     EV_INVALIDATE,  /* void OnInvalidate(int cmd) */
00066     EV_REDRAW,      /* void OnRedraw(int cmd) */
00067     EV_GETTEXT,     /* void OnGetText(int cmd, UStr *text); */
00068     EV_SETTEXT,     /* void OnSetText(int cmd, const char *text); */
00069     EV_GETFLOAT,    /* void OnGetFloat(int cmd, float *f); */
00070     EV_SETFLOAT,    /* void OnSetFloat(int cmd, const float *f); */
00071     EV_INIT_WIDGET, /* void OnInitWidget(int cmd, void *widget); */
00072     EV_INIT_TAB_WIDGET, /* void OnInitTabWidget(int cmd, int page, void *widget); */
00073     EV_SHOW_WIDGET, /* void OnShowWidget<Cmd>(int cmd, int state) */
00074     EV_PAGE_CHANGED,    /* void OnPageChanged<Cmd>(int cmd, int pagenum) */
00075
00076     /* notifying */
00077     EV_NOTIFY,          /* void OnNotify<Cmd>(void) */
00078     EV_EDITCHANGE,      /* void OnEditChange<Cmd>(void) */
00079     EV_EDITACTIVATE,    /* void OnEditActivate<Cmd>(void) */
00080     EV_TIMER,           /* void OnTimer<Cmd>(long time) */
00081     EV_UPDATEUI,        /* void OnUpdateUI(void) */
00082     EV_UPDATEFOCUS,     /* int OnUpdateFocus(int leave, void *widget) */
00083
00084     /* drag'n drop */
00085     EV_DRAGQUERY,       /* void OnDragQuery<Cmd>(UDragable *) */
00086     EV_DROPQUERY,       /* void OnDropQuery<Cmd>(UDropable **) */
00087     EV_DROPIT,          /* void OnDropIt<Cmd>(const UDragable *) */
00088     EV_DROPQUERY_CMDID, /* void OnDropQueryCmdID<Cmd>(int x, int y, int *cmdid) */
00089     EV_DROPREF,     /* void OnDropRef<Cmd>(int cmd, int nbref, long *ref) */
00090
00091     /* toolbar manager */
00092     EV_TB_INIT,         /* void OnTbInit(UTB_INIT *info) */
00093     EV_TB_END,          /* void OnTbEnd(void) */
00094     EV_TB_BUTTON,       /* void OnTbButton(UTB_BUTTON *info) */
00095     EV_TB_DROPDOWN,     /* void OnTbDropDown(UTB_DROPDOWN *info) */
00096     EV_TB_CHECKBTN,     /* void OnTbCheckBtn(UTB_BUTTON *info) */
00097     EV_TB_SEPARATOR,    /* void OnTbSeparator(void) */
00098     EV_TB_GETCOLOR,     /* void OnTbGetColor(int cmd, float *color) */
00099
00100     /* slider */
00101     EV_SET_SLIDER,      /* void OnSetSlider(int cmd, int pos) */
00102     EV_GET_SLIDERPROP,  /* void OnGetSliderProperty(int cmd, USLIDER *prop) */
00103     EV_SET_SLIDERPROP,  /* void OnSetSliderProperty(int cmd, const USLIDER *prop) */
00104     EV_SCROLLCHANGE,    /* void OnScrollChange<Cmd>(int pos) */
00105
00106     /* custom drawing */
00107     EV_CUSTOM_DRAW,     /* void OnCustomDraw<Cmd>(void *drawInfo) */
00108
00109     /* tree */
00110     EV_TREE_RESETALL,   /* void OnTreeResetAll(int cmd) */
00111     EV_TREE_INSERT,     /* void OnTreeInsert(int cmd, UTREE_INSERT *data) */
00112     EV_TREE_GETINFO,    /* void OnTreeGetInfo(int cmd, UTREE_INFO *data) */
00113     EV_TREE_SETDATA,    /* void OnTreeSetData(int cmd, UTREE_INFO *data) */
00114     EV_TREE_SETICON,    /* void OnTreeSetIcon(int cmd, UTREE_INFO *data) */
00115     EV_TREE_DELETE,     /* void OnTreeDelete(int cmd, UTREEITEM item) */
00116     EV_TREE_EXPANDING,  /* void OnTreeExpanding<cmd>(int collapse, UTREEITEM item) */
00117     EV_TREE_SELECTING,  /* void OnTreeSelecting<cmd>(int deselecting, UTREEITEM item) */
00118     EV_TREE_EXPAND,     /* void OnTreeExpand(int cmd, int collapse, UTREEITEM item) */
00119     EV_TREE_SELECT,     /* void OnTreeSelect(int cmd, int deselect, UTREEITEM item) */
00120     EV_TREE_GETSEL,     /* void OnTreeGetSel(int cmd, UTREEITEM *item) */
00121
00122     /* list */
00123     EV_LIST_SELECTING,      /* void OnListChange<Cmd>(int entry, const char *txt) */
00124     EV_LIST_SELCOLUMN,      /* void OnListSelColumn<Cmd>(int entry) */
00125     EV_LIST_RESORT,         /* void OnListResort(int cmd, int column, UListSorter s) */
00126     EV_LIST_DBLCLICK,       /* void OnListDblClick<Cmd>(void) */
00127     EV_LIST_RESETALL,       /* void OnListResetAll(int cmd) */
00128     EV_LIST_SETFEEDBACK,    /* void OnListSetFeedback(int cmd, int turnOn) */
00129     EV_LIST_ADDCOLUMNS,     /* void OnListAddColumns(int cmd, int num) */
00130     EV_LIST_SETCOLTITLE,    /* void OnListSetColTitle(int cmd, int num, const char *title) */
00131     EV_LIST_SETCOLWIDTH,    /* void OnListSetColWidth(int cmd, int num, int width) */
00132     EV_LIST_NEWROW,         /* void OnListNewRow(int cmd, int *num) */
00133     EV_LIST_ROWSETDATA,     /* void OnListRowSetData(int cmd, int row, void *data) */
00134     EV_LIST_ROWGETDATA,     /* void OnListRowGetData(int cmd, int row, void **data) */
00135     EV_LIST_INSERT,         /* void OnListInsert(int cmd, ULIST_INSERT *data) */
00136     EV_LIST_ADDSEL,         /* void OnListAddSel(int cmd, int entry) */
00137     EV_LIST_DELROW,         /* void OnListDelRow(int cmd, int row) */
00138     EV_LIST_GETNEXTSEL,     /* int OnListGetNextSel(int cmd, int selectedCell) */
00139     EV_LIST_GETINFO,        /* void OnListGetInfo(int cmd, ULIST_INFO *data) */
00140     EV_LIST_GETNEXT,        /* int OnListGetNext(int cmd, int whichCell) */
00141
00142     /* combo */
00143     EV_COMBO_RESETALL,  /* void OnComboResetAll(int cmd) */
00144     EV_COMBO_APPEND,    /* void OnComboAppend(int cmd, const char *str) */
00145     EV_COMBO_SETSEL,    /* void OnComboSetPos(int cmd, int pos) */
00146     EV_COMBO_GETSEL,    /* int OnComboGetPos(int cmd, UStr *txt) */
00147     EV_COMBO_SEL,       /* void OnComboSel<Cmd>(int pos, const char *txt) */
00148     EV_COMBO_GETCOUNT,  /* int OnComboGetCount(int cmd) */
00149     EV_COMBO_DELSEL,    /* void OnComboDelSel(int cmd, int pos) */
00150     EV_COMBO_ENABLESEL, /* void OnComboEnableSel(int cmd, int pos, int state) */
00151     EV_COMBO_GETMENU,   /* void OnComboGetMenu(int cmd, UMENU *menu) */
00152
00153     /* smart combo (Win32 only at the moment)*/
00154     EV_SMARTCOMBO_SETFEATURE,   /* void OnSmartComboSetFeature(int cmd, int feature) */
00155     EV_SMARTCOMBO_SETITEMS  ,   /* void OnSmartComboSetItems(int cmd, CMString* items) */
00156     EV_SMARTCOMBO_SETREADONLY,  /* void OnSmartComboSetReadOnly(int cmd, bool readOnly) */
00157
00158     /* user defined */
00159     EV_COMMAND_START = 1000
00160 } UEventType;

enum UMSG_EXT

Enumeration values:
UMSG_NOEXT
UMSG_RANGE

Definition at line 630 of file umain.h.

00631 {
00632     UMSG_NOEXT,
00633     UMSG_RANGE
00634 } UMSG_EXT;

enum UTB_DROP

Enumeration values:
DDD_NONE

Definition at line 880 of file umain.h.

00881 {
00882     DDD_NONE = 0x00
00883 } UTB_DROP;

enum UTB_VAR

Enumeration values:
DDV_NONE

Definition at line 875 of file umain.h.

Referenced by awidget::awidget, TbEntryButton::TbEntryButton, and TbEntryChkButton::TbEntryChkButton.

00876 {
00877     DDV_NONE
00878 } UTB_VAR;

Function Documentation

const std:: map<int, UCmdTarget *>& UEventGetTargets ( void )

Definition at line 763 of file uevent.cpp.

References USemaphore::m_semaphore.

00764 {
00765     return sAllTargets.Get();
00766 }

int UEventGetWidID ( void )

Definition at line 296 of file uevent.cpp.

00297 {
00298     static int newid = 100;
00299     return newid++;
00300 }

void UEventGiveTime ( void )

Definition at line 673 of file uevent.cpp.

00674 {
00675     STD map< int, UCmdTarget * >::const_iterator iter;
00676     const STD map<int, UCmdTarget *> & targets = sAllTargets.Get();
00677
00678     // post the retained events
00679     while(!sRetainedMsgs.empty())
00680     {
00681         CMsg msg = *sRetainedMsgs.begin();
00682         sRetainedMsgs.erase(sRetainedMsgs.begin());
00683         UEventSendMessage(msg.m_wid, msg.m_ev, msg.m_arg1, msg.m_arg2);
00684     }
00685
00686     // take care about the EV_UPDATEUI notification
00687     if(!UWidget::IsUIValid())
00688     {
00689         UWidget::DoValidUI(true);
00690
00691         // warn the widget it's going to happen so they can cache
00692         // some informations.
00693         for(iter = targets.begin(); iter != targets.end(); ++iter)
00694         {
00695             UCmdTarget *target = (*iter).second;
00696             if(!target->IsKindOf(URUNTIME_CLASS(UWidget)))
00697                 continue;
00698
00699             UWidget *wid = (UWidget *)target;
00700             wid->BeforeUpdateUI();
00701         }
00702
00703         for(iter = targets.begin(); iter != targets.end(); ++iter)
00704         {
00705             UCmdTarget *target = (*iter).second;
00706             if(!target->IsKindOf(URUNTIME_CLASS(UWidget)))
00707                 continue;
00708
00709             UWidget *wid = (UWidget *)target;
00710             UEventSendMessage(wid->GetWidID(), EV_UPDATEUI, 0, 0L);
00711         }
00712     }
00713
00714     long thisIdle = UTickCount();
00715     if((thisIdle - sLastIdle) < MIN_IDLE)
00716         return;
00717
00718     // search the timers
00719     for(iter = targets.begin(); iter != targets.end(); ++iter)
00720     {
00721         UCmdTarget *target = (*iter).second;
00722         if(!target->IsKindOf(URUNTIME_CLASS(UWidget)))
00723             continue;
00724
00725         UWidget *wid = (UWidget *)target;
00726         std::vector<UTimer> & timers = wid->GetTimers();
00727         std::vector<UTimer>::iterator t;
00728         for(t = timers.begin(); t != timers.end(); ++t)
00729         {
00730             UTimer & timer = *t;
00731             if((thisIdle - timer.m_lastlap) >= timer.m_lap)
00732             {
00733                 // trigger the timer
00734                 timer.m_lastlap = thisIdle;
00735                 UEventSendMessage(wid->GetWidID(), EV_TIMER, timer.m_cmd, (void *)thisIdle);
00736             }
00737         }
00738     }
00739
00740     sLastIdle = thisIdle;
00741 }

int UEventNotifyMessage | ( | int | evt,
 |  | int | arg1,
 |  | void * | arg2
 | ) |

Definition at line 269 of file uevent.cpp.

Referenced by UPseudoFakePane::ActivateSelf, UPseudoFakePane::DeactivateSelf, TPseudoWinBehavior::DoEvent, TPseudoAppBehavior::DoToolboxEvent, and LMainPseudoAttachment::ExecuteSelf.

00270 {
00271     STD map< int, UCmdTarget * >::const_iterator iter;
00272     const STD map<int, UCmdTarget *> & targets = sAllTargets.Get();
00273     int res = 0;
00274
00275     for(iter = targets.begin(); iter != targets.end(); ++iter)
00276     {
00277         UCmdTarget *target = (*iter).second;
00278         UCmdTarget::UDispatchInfo dispatchInfo = UCmdTarget::kUNoDispatchInfo;
00279 #if qDebug
00280         try {
00281 #endif
00282         res = target->UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00283 #if qDebug
00284         } catch(...) {
00285             UASSERT(0);
00286             throw;
00287         }
00288 #endif
00289         if(res)
00290             break;
00291     }
00292
00293     return res;
00294 }

int UEventPostMessage | ( | int | wid,
 |  | int | evt,
 |  | int | arg1,
 |  | void * | arg2
 | ) |

Definition at line 262 of file uevent.cpp.

00263 {
00264     sRetainedMsgs.push_back(CMsg(wid, evt, arg1, arg2));
00265     return 0;
00266 }

UCmdTarget* UEventQueryWidget ( int widid )

Definition at line 302 of file uevent.cpp.

Referenced by UCvsApp::GetBrowserView, UCvsApp::GetFilesView, UCvsFolders::OnTreeSelecting, LPseudoWinAttachment::SearchWidID, UDC::UDC, UMenuAddButton, UMenuAddPulldown, and UMenuAddToggle.

00303 {
00304     const STD map<int, UCmdTarget *> & targets = sAllTargets.Get();
00305     STD map< int, UCmdTarget * >::const_iterator iter = targets.find(widid);
00306     if(iter != targets.end())
00307     {
00308         UCmdTarget *target = (*iter).second;
00309         return target;
00310     }
00311     return 0L;
00312 }

void UEventRemoveWidID ( int widid )

Definition at line 314 of file uevent.cpp.

Referenced by UCmdTarget::~UCmdTarget.

00315 {
00316     STD map<int, UCmdTarget *> & targets = sAllTargets.Get();
00317     STD map<int, UCmdTarget *>::iterator i = targets.find(widid);
00318     if(i == targets.end())
00319         return;
00320     targets.erase(i);
00321 }

int UEventSendMessage | ( | int | wid,
 |  | int | evt,
 |  | int | arg1,
 |  | void * | arg2
 | ) |

Definition at line 199 of file uevent.cpp.

Referenced by UWidget::AddPage, AskCreatePersistentSettings, LPseudoWinAttachment::CheckWindowSize, CompatGetCheckout, CompatGetCommand, CompatGetCommit, CompatGetDiff, CompatGetImport, CompatGetLog, CompatGetPassword, CompatGetPrefs, CompatGetUpdate, CompatImportFilter, CompatRtagBranch, CompatRtagCreate, CompatRtagDelete, CompatTagBranch, CompatTagCreate, CompatTagDelete, CreateMainToolbar, CvsAlert, CvsLogParse, UCvsFolders::DeleteAllItems, UCvsFiles::DisableGeneric, USaveSettings::DoDataExchange, UAuthen_Gserver::DoDataExchange, UAuthen_Kserver::DoDataExchange, UAuthen_Rhosts::DoDataExchange, UAuthen_Pserver::DoDataExchange, UAuthen_SSH::DoDataExchange, UEditMessage::DoDataExchange, UPromptMessage::DoDataExchange, TPseudoWinBehavior::DoEvent, UWidget::DoModal, UPseudoPageHider::DoRotate, UPseudoPlaceHolder::DoRotate, CPseudoItem::DoubleClick, TPseudoCustomView::Draw, LMainPseudoAttachment::ExecuteSelf, LPseudoDrawAttachment::ExecuteSelf, TBrowserFill::ExitDirectory, TBrowserFillDummy::ExitDirectory, UCvsFolders::GetItemByLocation, LPseudoWinAttachment::ListenToMessage, macpp_fecthview, UAuthen_SSH::OnBtnName, UAuthen_SSH::OnBtnRSA, UAuthen_SSH::OnCheckName, UAuthen_SSH::OnCheckOptions, UAuthen_Kserver::OnCheckPort, UAuthen_Rhosts::OnCheckPort, UAuthen_Pserver::OnCheckPort, UAuthen_Pserver::OnCheckProxy, UAuthen_SSH::OnCheckRSA, UAuthen_Rhosts::OnCheckRshName, UAuthen_Rhosts::OnCheckServerName, UCvsFolders::OnCmdAdd, UCvsFiles::OnCmdAdd, UCvsFiles::OnCmdAddb, UCvsFolders::OnCmdCommit, UCvsFiles::OnCmdCommit, UCvsFolders::OnCmdDiff, UCvsFiles::OnCmdDiff, UCvsFolders::OnCmdEdit, UCvsFiles::OnCmdEdit, UCvsFolders::OnCmdEditors, UCvsFiles::OnCmdEditors, UCvsFiles::OnCmdEditsel, UCvsFiles::OnCmdEditseldef, UCvsFolders::OnCmdExplore, UCvsFiles::OnCmdExplore, UCvsFiles::OnCmdGraph, UCvsFolders::OnCmdLock, UCvsFiles::OnCmdLock, UCvsFolders::OnCmdLog, UCvsFiles::OnCmdLog, UCvsFolders::OnCmdMacrosSel, UCvsFolders::OnCmdQueryUpdate, UCvsFiles::OnCmdQueryUpdate, UCvsFolders::OnCmdRelease, UCvsFiles::OnCmdRelease, UCvsFiles::OnCmdRmv, UCvsFolders::OnCmdStatus, UCvsFiles::OnCmdStatus, UCvsFolders::OnCmdTagBranch, UCvsFiles::OnCmdTagBranch, UCvsFolders::OnCmdTagDelete, UCvsFiles::OnCmdTagDelete, UCvsFolders::OnCmdTagNew, UCvsFiles::OnCmdTagNew, UCvsFiles::OnCmdTrash, UCvsFiles::OnCmdUIAdd, UCvsFiles::OnCmdUIAddB, UCvsFiles::OnCmdUIEditseldef, UCvsFolders::OnCmdUIExplore, UCvsFiles::OnCmdUIExplore, UCvsFiles::OnCmdUIGraph, UCvsFiles::OnCmdUIMacroSel, UCvsFolders::OnCmdUIMacrosSel, UCvsFiles::OnCmdUIRelease, UCvsFiles::OnCmdUIRmv, UCvsFiles::OnCmdUITrash, UCvsFiles::OnCmdUIUpdate, UCvsFolders::OnCmdUnedit, UCvsFiles::OnCmdUnedit, UCvsFolders::OnCmdUnlock, UCvsFiles::OnCmdUnlock, UCvsFolders::OnCmdUpdate, UCvsFiles::OnCmdUpdate, UCvsFolders::OnCmdWatchers, UCvsFiles::OnCmdWatchers, UCvsFolders::OnCmdWatchOff, UCvsFiles::OnCmdWatchOff, UCvsFolders::OnCmdWatchOn, UCvsFiles::OnCmdWatchOn, USaveSettings::OnCopyFrom, UCvsGraph::OnCreate, UCvsFiles::OnCreate, UCvsFiles::OnDblClick, CDynToolBar::OnDestroy, TBrowserFill::OnDirectory, TViewFill::OnDirectory, TViewFill::OnFile, CPseudoDlg::OnInitDialog, UWidget::OnInitWidget, CPseudoList::OnLButtonDblClk, UCvsFiles::OnMacroSel, CPseudoDraw::OnPaint, UToolbar::OnTbButton, UToolbar::OnTbCheckBtn, UCvsFolders::OnTreeExpanding, UCvsFolders::OnTreeSelecting, UCvsFolders::OnUpdateGeneric, UWidget::OnUpdateUI, UToolbar::OnUpdateUI, UMenu::OnUpdateUI, UMacAppMenu::OnUpdateUI, UCvsFolders::ResetBrowser, UCvsFolders::ResetView, UCvsFiles::ResetView, UCvsFiles::Resort, UCvsFolders::RetrievePath, UCvsFiles::Search, CPseudoItem::SingleClick, UCvsFolders::StepToLocation, UCvsFolders::StoreExpanded, UEventGiveTime, UMenuAddButton, UMenuAddToggle, UWaitCursor::UWaitCursor, UWinPseudoWindowProc, TPseudoWinAdorner::ViewChangedFrame, WinInitWidgets, CPseudoDlg::~CPseudoDlg, LPseudoWinAttachment::~LPseudoWinAttachment, TPseudoWinAdorner::~TPseudoWinAdorner, and UWaitCursor::~UWaitCursor.

00200 {
00201     if(sTurnOffDispatching)
00202         return 0;
00203
00204     const STD map<int, UCmdTarget *> & targets = sAllTargets.Get();
00205     STD map< int, UCmdTarget * >::const_iterator iter = targets.find(wid);
00206     int res = 0;
00207
00208     if(iter != targets.end())
00209     {
00210         UCmdTarget *target = (*iter).second;
00211         UCmdTarget::UDispatchInfo dispatchInfo = UCmdTarget::kUNoDispatchInfo;
00212 #if qDebug
00213         try {
00214 #endif
00215         res = target->UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00216 #if qDebug
00217         } catch(...) {
00218             UASSERT(0);
00219             throw;
00220         }
00221 #endif
00222     }
00223     else
00224     {
00225         UAppConsole("Unknown widget id : %d\n", wid);
00226     }
00227
00228     return res;
00229 }

int UEventSendMessageExt | ( | int | wid,
 |  | int | evt,
 |  | int | arg1,
 |  | void * | arg2,
 |  | int * | handledFlag
 | ) |

Definition at line 231 of file uevent.cpp.

Referenced by TPseudoAppBehavior::DoMenuCommand, LMainPseudoAttachment::ExecuteSelf, UToolbar::OnCommands, and UMenu::OnCommands.

00232 {
00233     const STD map<int, UCmdTarget *> & targets = sAllTargets.Get();
00234     STD map< int, UCmdTarget * >::const_iterator iter = targets.find(wid);
00235     int res = 0;
00236     UCmdTarget::UDispatchInfo dispatchInfo = UCmdTarget::kUNoDispatchInfo;
00237
00238     if(iter != targets.end())
00239     {
00240         UCmdTarget *target = (*iter).second;
00241 #if qDebug
00242         try {
00243 #endif
00244         res = target->UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00245 #if qDebug
00246         } catch(...) {
00247             UASSERT(0);
00248             throw;
00249         }
00250 #endif
00251     }
00252     else
00253     {
00254         UAppConsole("Unknown widget id : %d\n", wid);
00255     }
00256
00257     *handledFlag = (dispatchInfo & UCmdTarget::kUDispatchHandled) != 0;
00258     return res;
00259 }

void UEventSetTooltipHandler ( void(* handler)(const char *) )

Definition at line 668 of file uevent.cpp.

00669 {
00670     sTooltipHandler = handler;
00671 }

HBITMAP UMakeBitmap | ( | char ** | icon,
 |  | int & | width,
 |  | int & | height,
 |  | COLORREF | back
 | ) |

Definition at line 97 of file umenu.cpp.

References EV_COMBO_APPEND, EV_COMBO_DELSEL, EV_COMBO_ENABLESEL, EV_COMBO_GETCOUNT, EV_COMBO_GETMENU, EV_COMBO_GETSEL, EV_COMBO_RESETALL, EV_COMBO_SEL, EV_COMBO_SETSEL, EV_COMMAND_START, EV_CUSTOM_DRAW, EV_GET_SLIDERPROP, EV_LIST_ADDCOLUMNS, EV_LIST_ADDSEL, EV_LIST_DBLCLICK, EV_LIST_DELROW, EV_LIST_GETINFO, EV_LIST_GETNEXT, EV_LIST_GETNEXTSEL, EV_LIST_INSERT, EV_LIST_NEWROW, EV_LIST_RESETALL, EV_LIST_RESORT, EV_LIST_ROWGETDATA, EV_LIST_ROWSETDATA, EV_LIST_SELCOLUMN, EV_LIST_SELECTING, EV_LIST_SETCOLTITLE, EV_LIST_SETCOLWIDTH, EV_LIST_SETFEEDBACK, EV_SCROLLCHANGE, EV_SET_SLIDER, EV_SET_SLIDERPROP, EV_SMARTCOMBO_SETFEATURE, EV_SMARTCOMBO_SETITEMS, EV_SMARTCOMBO_SETREADONLY, EV_TB_GETCOLOR, EV_TB_SEPARATOR, EV_TREE_DELETE, EV_TREE_EXPAND, EV_TREE_EXPANDING, EV_TREE_GETINFO, EV_TREE_GETSEL, EV_TREE_INSERT, EV_TREE_RESETALL, EV_TREE_SELECT, EV_TREE_SELECTING, EV_TREE_SETDATA, and EV_TREE_SETICON.

00098 {
00099     BYTE **src = (BYTE **)icon;
00100
00101     // read the header
00102     int w, h, nc, cpp, i, x, y;
00103     if(sscanf((char *)*src++, "%d%d%d%d", &w, &h, &nc, &cpp) != 4)
00104         return 0L;
00105
00106     width = w;
00107     height = h;
00108
00109     HBITMAP hbitmap = CreateDIB(w, h, 8, 0L);
00110     LPBITMAPINFO header = (LPBITMAPINFO)GlobalLock(hbitmap);
00111     BYTE *image = (LPBYTE)header + header->bmiHeader.biSize + PaletteSize(header);
00112     RGBQUAD *pRgb = (RGBQUAD *)((LPBYTE)header + header->bmiHeader.biSize);
00113
00114     // read the colormap
00115     std::map<short, BYTE> colors;
00116     for(i = 0; i < nc; i++)
00117     {
00118         const BYTE *line = *src++;
00119         short aref;
00120         if(cpp == 1)
00121         {
00122             aref = line[0];
00123             line += 4;
00124         }
00125         else if(cpp == 2)
00126         {
00127             aref = ((short)line[1] << 8)  | line[0];
00128             line += 5;
00129         }
00130         else
00131             ASSERT(0);
00132
00133         COLORREF color;
00134
00135         if(strcmp((char *)line, "None") == 0)
00136         {
00137             color = back;
00138         }
00139         else
00140         {
00141             if(*line++ != '#')
00142                 return 0L;
00143
00144             if(strlen((char *)line) < 6)
00145                 return 0L;
00146
00147             int comp[6], c;
00148             int j;
00149             for(j = 0; j < 6; j++)
00150             {
00151                 c = *line++;
00152                 if(c >= '0' && c <= '9')
00153                     comp[j] = c - '0';
00154                 else if(c >= 'a' && c <= 'f')
00155                     comp[j] = c - 'a' + 10;
00156                 else if(c >= 'A' && c <= 'F')
00157                     comp[j] = c - 'A' + 10;
00158                 else
00159                     return 0L;
00160             }
00161
00162             color = RGB(comp[0]*16+comp[1],comp[2]*16+comp[3],comp[4]*16+comp[5]);
00163         }
00164
00165         colors.insert(std::make_pair(aref, i));
00166
00167         pRgb->rgbRed = GetRValue(color);
00168         pRgb->rgbGreen = GetGValue(color);
00169         pRgb->rgbBlue = GetBValue(color);
00170         pRgb->rgbReserved = 0;
00171         pRgb++;
00172     }
00173
00174     if(nc != colors.size() || nc > 256)
00175         return 0L;
00176
00177     // make the bitmap
00178     for(y = 0; y < h; y++)
00179     {
00180         const BYTE *line = *src++;
00181         BYTE *ptr = image + WIDTHBYTES(w * 8) * (h - y - 1);
00182         for(x = 0; x < w; x++)
00183         {
00184             short aref;
00185             if(cpp == 1)
00186             {
00187                 aref = line[0];
00188                 line++;
00189             }
00190             else if(cpp == 2)
00191             {
00192                 aref = ((short)line[1] << 8)  | line[0];
00193                 line += 2;
00194             }
00195             std::map<short, BYTE>::iterator pos = colors.find(aref);
00196             if(pos == colors.end())
00197                 return 0L;
00198             *ptr++ = (*pos).second;
00199         }
00200     }
00201
00202     GlobalUnlock(hbitmap);
00203
00204     HBITMAP ddbbmap = DIBToBitmap(hbitmap);
00205     GlobalFree((HGLOBAL)hbitmap);
00206
00207     return ddbbmap;
00208 }

HBITMAP UMakeBitmap ( char ** icon )

Definition at line 210 of file umenu.cpp.

00211 {
00212     int w, h;
00213     return UMakeBitmap(icon, w, h, ::GetSysColor(COLOR_BTNFACE));
00214 }

HBITMAP UMakeBitmap ( const char * icon )

Definition at line 216 of file umenu.cpp.

00217 {
00218     std::vector<UStr> icstr;
00219     const char *tmp;
00220     while((tmp = strchr(icon, '\n')) != 0L)
00221     {
00222         UStr str;
00223         str.set(icon, tmp - icon);
00224         icon = tmp + 1;
00225         icstr.push_back(str);
00226     }
00227     if(icon[0] != '\0')
00228     {
00229         icstr.push_back(UStr(icon));
00230     }
00231
00232     std::vector<UStr>::const_iterator i;
00233     std::vector<const char *> ic;
00234     for(i = icstr.begin(); i != icstr.end(); ++i)
00235     {
00236         ic.push_back((*i).c_str());
00237     }
00238     return UMakeBitmap((char **)&ic[0]);
00239 }

long UTickCount ( void )

Definition at line 743 of file uevent.cpp.

00744 {
00745 #ifdef WIN32
00746     return ::GetTickCount();
00747 #elif defined(macintosh)
00748     long res = ::TickCount();
00749     return res = (float)res * (1000.0 / 60.0);
00750 #else
00751     struct timeval tval;
00752     static long refcount;
00753
00754     gettimeofday(&tval, 0L);
00755
00756     if(refcount == 0)
00757         refcount = tval.tv_sec;
00758
00759     return (tval.tv_sec - refcount) * 1000 + tval.tv_usec / 1000;
00760 #endif
00761 }

Generated on Sun Feb 24 01:22:52 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


umenu.cpp File Reference

rf/umenu.cpp File Reference

#include "stdafx.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <float.h>
#include <vector>
#include <map>
#include "umenu.h"
#include "uconsole.h"
#include "dib.h"

Include dependency graph for umenu.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | CTRLALT_STROKE "Ctrl+Alt+"
#define | CTRL_STROKE "Ctrl+"
#define | ALT_STROKE "Alt+"

Functions

HBITMAP | UMakeBitmap (char **icon, int &width, int &height, COLORREF back)
HBITMAP | UMakeBitmap (char **icon)
HBITMAP | UMakeBitmap (const char *icon)
void | GetMenuTitle (const char *name, UStr &title, int cmd, char &mnemonic, int &mod, int &key)
UMENU | UMenuAddPulldown (int widid, const char *name, UMENU top)
void | addAccel (int cmd, int mod, int key)
void | UMenuDelete (UMENU top, int afterIndex)
int | UMenuCount (UMENU top)
void | UMenuDeleteByCmd (UMENU top, int cmd)
UMENU | UMenuAddButton (int widid, const char *name, UMENU top, const void *pixmap, int cmd)
UMENU | UMenuAddToggle (int widid, const char *name, UMENU top, const void *pixmap, int cmd)
UMENU | UMenuAddSeparator (int widid, UMENU top)

Define Documentation

#define ALT_STROKE "Alt+"

Definition at line 244 of file umenu.cpp.

Referenced by GetMenuTitle.

#define CTRL_STROKE "Ctrl+"

Definition at line 243 of file umenu.cpp.

Referenced by GetMenuTitle.

#define CTRLALT_STROKE "Ctrl+Alt+"

Definition at line 242 of file umenu.cpp.

Referenced by GetMenuTitle.

Function Documentation

void addAccel | ( | int | cmd,
 |  | int | mod,
 |  | int | key
 | ) | [static]

Definition at line 396 of file umenu.cpp.

References NULL, UK_ALT, and UK_CONTROL.

Referenced by UMenuAddButton, and UMenuAddToggle.

00397 {
00398     if(key == 0)
00399         return;
00400
00401     // Save the current accelerator table.
00402     CWnd *wnd = AfxGetMainWnd();
00403     CFrameWnd *frame = 0L;
00404     if(wnd->IsKindOf(RUNTIME_CLASS(CFrameWnd)))
00405         frame = (CFrameWnd *)wnd;
00406     else
00407         frame = wnd->GetParentFrame();
00408     if(frame == 0L)
00409         return;
00410
00411     HACCEL haccelOld = frame->m_hAccelTable;
00412
00413     // Count the number of entries in the current
00414     // table, allocate a buffer for the table, and
00415     // then copy the table into the buffer.
00416
00417     int cAccelerators = CopyAcceleratorTable(haccelOld, NULL, 0);
00418     LPACCEL lpaccelNew = (LPACCEL) LocalAlloc(LPTR, (cAccelerators + 1) * sizeof(ACCEL));
00419     if (lpaccelNew == NULL)
00420         return;
00421
00422     CopyAcceleratorTable(haccelOld, lpaccelNew, cAccelerators);
00423
00424     // Find the accelerator that the user modified
00425     // and change its flags and virtual-key code
00426     // as appropriate.
00427
00428     for (int i = 0; i < cAccelerators; i++)
00429     {
00430         if(lpaccelNew[i].cmd == cmd)
00431         {
00432             lpaccelNew[i].fVirt = FVIRTKEY;
00433             if(mod & UK_ALT)
00434                 lpaccelNew[i].fVirt |= FALT;
00435             if(mod & UK_CONTROL)
00436                 lpaccelNew[i].fVirt |= FCONTROL;
00437             lpaccelNew[i].key = key;
00438             break;
00439         }
00440     }
00441
00442     if(i == cAccelerators)
00443     {
00444         lpaccelNew[i].cmd = cmd;
00445         lpaccelNew[i].fVirt = FVIRTKEY;
00446         if(mod & UK_ALT)
00447             lpaccelNew[i].fVirt |= FALT;
00448         if(mod & UK_CONTROL)
00449             lpaccelNew[i].fVirt |= FCONTROL;
00450         lpaccelNew[i].key = key;
00451         cAccelerators++;
00452     }
00453
00454     // Create the new accelerator table, and
00455     // destroy the old one.
00456     DestroyAcceleratorTable(haccelOld);
00457     frame->m_hAccelTable = CreateAcceleratorTable(lpaccelNew, cAccelerators);
00458     LocalFree(lpaccelNew);
00459 }

void GetMenuTitle | ( | const char * | name,
 |  | UStr & | title,
 |  | int | cmd,
 |  | char & | mnemonic,
 |  | int & | mod,
 |  | int & | key
 | ) | [static]

Definition at line 246 of file umenu.cpp.

References ALT_STROKE, CTRL_STROKE, CTRLALT_STROKE, UStr::length, UK_ALT, and UK_CONTROL.

Referenced by UMenuAddButton, UMenuAddPulldown, and UMenuAddToggle.

00248 {
00249     title = "";
00250     mod = 0;
00251     key = 0;
00252     mnemonic = '\0';
00253
00254     // get the accelerator
00255     UStr copy(name);
00256     char *tmp;
00257     if((tmp = strchr(copy, '\t')) != 0L)
00258     {
00259         *tmp++ = '\0';
00260         if(strncmp(tmp, CTRLALT_STROKE, strlen(CTRLALT_STROKE)) == 0)
00261         {
00262             mod = UK_CONTROL | UK_ALT;
00263             key = tmp[strlen(CTRLALT_STROKE)];
00264         }
00265         else if(strncmp(tmp, CTRL_STROKE, strlen(CTRL_STROKE)) == 0)
00266         {
00267             mod = UK_CONTROL;
00268             key = tmp[strlen(CTRL_STROKE)];
00269         }
00270         else if(strncmp(tmp, ALT_STROKE, strlen(ALT_STROKE)) == 0)
00271         {
00272             mod = UK_ALT;
00273             key = tmp[strlen(ALT_STROKE)];
00274         }
00275         name = copy;
00276     }
00277
00278     title = name;
00279 #ifndef WIN32
00280     if((tmp = strchr(title, '&')) != 0L)
00281     {
00282         size_t l = tmp - (const char *)title;
00283         memmove(&title[l], &title[l + 1], title.length() - l);
00284     }
00285 #endif
00286 }

HBITMAP UMakeBitmap ( const char * icon )

Definition at line 216 of file umenu.cpp.

References UStr::set, and UEXPORT.

Referenced by CPseudoButton::LoadXPM, CPseudoRotButton::LoadXPMs, UToolbar::OnTbButton, UToolbar::OnTbCheckBtn, UToolbar::OnTbDropDown, UMakeBitmap, UMenuAddButton, and UMenuAddToggle.

00217 {
00218     std::vector<UStr> icstr;
00219     const char *tmp;
00220     while((tmp = strchr(icon, '\n')) != 0L)
00221     {
00222         UStr str;
00223         str.set(icon, tmp - icon);
00224         icon = tmp + 1;
00225         icstr.push_back(str);
00226     }
00227     if(icon[0] != '\0')
00228     {
00229         icstr.push_back(UStr(icon));
00230     }
00231
00232     std::vector<UStr>::const_iterator i;
00233     std::vector<const char *> ic;
00234     for(i = icstr.begin(); i != icstr.end(); ++i)
00235     {
00236         ic.push_back((*i).c_str());
00237     }
00238     return UMakeBitmap((char **)&ic[0]);
00239 }

HBITMAP UMakeBitmap ( char ** icon )

Definition at line 210 of file umenu.cpp.

References UMakeBitmap.

00211 {
00212     int w, h;
00213     return UMakeBitmap(icon, w, h, ::GetSysColor(COLOR_BTNFACE));
00214 }

HBITMAP UMakeBitmap | ( | char ** | icon,
 |  | int & | width,
 |  | int & | height,
 |  | COLORREF | back
 | ) |

Definition at line 97 of file umenu.cpp.

References ASSERT, CreateDIB, DIBToBitmap, PaletteSize, and WIDTHBYTES.

00098 {
00099     BYTE **src = (BYTE **)icon;
00100
00101     // read the header
00102     int w, h, nc, cpp, i, x, y;
00103     if(sscanf((char *)*src++, "%d%d%d%d", &w, &h, &nc, &cpp) != 4)
00104         return 0L;
00105
00106     width = w;
00107     height = h;
00108
00109     HBITMAP hbitmap = CreateDIB(w, h, 8, 0L);
00110     LPBITMAPINFO header = (LPBITMAPINFO)GlobalLock(hbitmap);
00111     BYTE *image = (LPBYTE)header + header->bmiHeader.biSize + PaletteSize(header);
00112     RGBQUAD *pRgb = (RGBQUAD *)((LPBYTE)header + header->bmiHeader.biSize);
00113
00114     // read the colormap
00115     std::map<short, BYTE> colors;
00116     for(i = 0; i < nc; i++)
00117     {
00118         const BYTE *line = *src++;
00119         short aref;
00120         if(cpp == 1)
00121         {
00122             aref = line[0];
00123             line += 4;
00124         }
00125         else if(cpp == 2)
00126         {
00127             aref = ((short)line[1] << 8)  | line[0];
00128             line += 5;
00129         }
00130         else
00131             ASSERT(0);
00132
00133         COLORREF color;
00134
00135         if(strcmp((char *)line, "None") == 0)
00136         {
00137             color = back;
00138         }
00139         else
00140         {
00141             if(*line++ != '#')
00142                 return 0L;
00143
00144             if(strlen((char *)line) < 6)
00145                 return 0L;
00146
00147             int comp[6], c;
00148             int j;
00149             for(j = 0; j < 6; j++)
00150             {
00151                 c = *line++;
00152                 if(c >= '0' && c <= '9')
00153                     comp[j] = c - '0';
00154                 else if(c >= 'a' && c <= 'f')
00155                     comp[j] = c - 'a' + 10;
00156                 else if(c >= 'A' && c <= 'F')
00157                     comp[j] = c - 'A' + 10;
00158                 else
00159                     return 0L;
00160             }
00161
00162             color = RGB(comp[0]*16+comp[1],comp[2]*16+comp[3],comp[4]*16+comp[5]);
00163         }
00164
00165         colors.insert(std::make_pair(aref, i));
00166
00167         pRgb->rgbRed = GetRValue(color);
00168         pRgb->rgbGreen = GetGValue(color);
00169         pRgb->rgbBlue = GetBValue(color);
00170         pRgb->rgbReserved = 0;
00171         pRgb++;
00172     }
00173
00174     if(nc != colors.size() || nc > 256)
00175         return 0L;
00176
00177     // make the bitmap
00178     for(y = 0; y < h; y++)
00179     {
00180         const BYTE *line = *src++;
00181         BYTE *ptr = image + WIDTHBYTES(w * 8) * (h - y - 1);
00182         for(x = 0; x < w; x++)
00183         {
00184             short aref;
00185             if(cpp == 1)
00186             {
00187                 aref = line[0];
00188                 line++;
00189             }
00190             else if(cpp == 2)
00191             {
00192                 aref = ((short)line[1] << 8)  | line[0];
00193                 line += 2;
00194             }
00195             std::map<short, BYTE>::iterator pos = colors.find(aref);
00196             if(pos == colors.end())
00197                 return 0L;
00198             *ptr++ = (*pos).second;
00199         }
00200     }
00201
00202     GlobalUnlock(hbitmap);
00203
00204     HBITMAP ddbbmap = DIBToBitmap(hbitmap);
00205     GlobalFree((HGLOBAL)hbitmap);
00206
00207     return ddbbmap;
00208 }

UMENU UMenuAddButton | ( | int | widid,
 |  | const char * | name,
 |  | UMENU | top,
 |  | const void * | pixmap,
 |  | int | cmd
 | ) |

Definition at line 639 of file umenu.cpp.

References addAccel, EV_INIT_WIDGET, GetMenuTitle, UObject::IsKindOf, UASSERT, UCMD_to_WINCMD, UEventQueryWidget, UEventSendMessage, UMakeBitmap, UMENU, UMENU_NULL, URUNTIME_CLASS, and VERIFY.

00640 {
00641     UStr title;
00642     int  mod, key;
00643     char mnemonic;
00644     GetMenuTitle(name, title, cmd, mnemonic, mod, key);
00645
00646     UASSERT(top != UMENU_NULL);
00647
00648 #ifdef qMacPP
00649     LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00650     LMenu *menu = menuBar->FetchMenu(top);
00651     if(menu)
00652     {
00653         LStr255 pstr(title);
00654         menu->InsertCommand(pstr, cmd, max_Int16 - 1);
00655     }
00656     else
00657     {
00658         MenuHandle mhdl = ::GetMenu(top);
00659         if(mhdl != 0L)
00660         {
00661             SInt16  menuLength = ::CountMenuItems(mhdl);
00662             LStr255 pstr(title);
00663             ::MacInsertMenuItem(mhdl, pstr, menuLength);
00664         }
00665     }
00666
00667     return UMENU_NULL;
00668 #endif
00669 #ifdef qMacAPP
00670     MenuRef menu = MAGetMenu(top);
00671     if(menu)
00672     {
00673         CStr255_AC pstr(title);
00674         gDispatcher->DoMakeMenuBarManager();
00675         TMenuBarManager::fgMenuBarManager->AddMenuItem(pstr, top, ::CountMenuItems(menu), cmd);
00676     }
00677
00678     return UMENU_NULL;
00679 #endif
00680 #ifdef qGTK
00681     UCmdTarget *target = UEventQueryWidget(widid);
00682     if(target == 0L || !target->IsKindOf(URUNTIME_CLASS(UMenu)))
00683         return UMENU_NULL;
00684     UMenu *pmenu = (UMenu *)target;
00685
00686     if(!GTK_IS_MENU_SHELL(top))
00687         return UMENU_NULL;
00688     GtkWidget *parent = (GtkWidget *)top;
00689
00690     GtkWidget *menuitem = gtk_menu_item_new_with_label_pixmap(title, pixmap);
00691     gtk_widget_show (menuitem);
00692     gtk_container_add (GTK_CONTAINER (parent), menuitem);
00693     addToAccelGroup((GtkAccelGroup *)pmenu->GetAccelGroup(), menuitem, mod, key);
00694 //      gtk_tooltips_set_tip (tooltips, quit1, "Quit the application", NULL);
00695     UEventSendMessage(widid, EV_INIT_WIDGET, cmd, menuitem);
00696
00697     return UMENU_NULL;
00698 #endif
00699 #ifdef WIN32
00700     HMENU menuhdl = (HMENU)top;
00701     CMenu parent;
00702     VERIFY(parent.Attach(menuhdl));
00703
00704     parent.AppendMenu(MF_STRING, UCMD_to_WINCMD(cmd), name);
00705     addAccel(UCMD_to_WINCMD(cmd), mod, key);
00706
00707     if(pixmap != 0L && strlen((const char *)pixmap))
00708     {
00709         HBITMAP bmap = UMakeBitmap((const char *)pixmap);
00710         CBitmap b;
00711         VERIFY(b.Attach(bmap));
00712         parent.SetMenuItemBitmaps(UCMD_to_WINCMD(cmd), MF_BYCOMMAND, &b, &b);
00713         b.Detach();
00714     }
00715
00716     parent.Detach();
00717     return UMENU_NULL;
00718 #endif
00719 }

UMENU UMenuAddPulldown | ( | int | widid,
 |  | const char * | name,
 |  | UMENU | top
 | ) |

Definition at line 288 of file umenu.cpp.

References GetMenuTitle, UWidget::GetWidget, UObject::IsKindOf, kUMainWidget, UEventQueryWidget, UMENU, UMENU_NULL, URUNTIME_CLASS, and VERIFY.

00289 {
00290     UStr title;
00291     int  mod, key;
00292     char mnemonic;
00293     GetMenuTitle(name, title, 0, mnemonic, mod, key);
00294
00295 #ifdef qMacAPP
00296     return UMENU_NULL;
00297 #endif
00298 #ifdef qMacPP
00299     if(top == UMENU_NULL)
00300     {
00301         Assert_(0); // TODO
00302     }
00303     else
00304     {
00305         LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00306         LMenu *menu = menuBar->FetchMenu(top);
00307         if(menu == 0L)
00308             return UMENU_NULL;
00309
00310         LStr255 pstr(name);
00311         LMenu *newMenu = new LMenu(::UniqueID('MENU'), pstr);
00312         menuBar->InstallMenu(newMenu, hierMenu);
00313
00314         menu->InsertCommand(pstr, cmd_UseMenuItem, max_Int16 - 1);
00315 #if TARGET_API_MAC_CARBON
00316         UAppearanceMenus::SetItemHierID(menu->GetMacMenuH(), ::CountMenuItems(menu->GetMacMenuH()),
00317             newMenu->GetMenuID());
00318 #else
00319         UConditionalMenus::SetItemHierID(menu->GetMacMenuH(), ::CountMenuItems(menu->GetMacMenuH()),
00320             newMenu->GetMenuID());
00321 #endif
00322         return newMenu->GetMenuID();
00323     }
00324     return UMENU_NULL;
00325 #endif
00326 #ifdef qGTK
00327     GtkWidget *parent = 0L;
00328
00329     if(top == UMENU_NULL)
00330     {
00331         // try to find the menubar : the menu bar should be mapped
00332         // to a UMenu object as the main widget
00333         const UCmdTarget *target = UEventQueryWidget(widid);
00334         UMenu *menu = 0L;
00335         if(target == 0L || !target->IsKindOf(URUNTIME_CLASS(UMenu)))
00336             return UMENU_NULL;
00337
00338         menu = (UMenu *)target;
00339         if(menu == 0L)
00340             return UMENU_NULL;
00341
00342         GtkWidget *wid = (GtkWidget *)menu->GetWidget(kUMainWidget);
00343         if(wid == 0L || !GTK_IS_MENU_SHELL(wid))
00344             return UMENU_NULL;
00345
00346         parent = wid;
00347     }
00348     else
00349     {
00350         if(!GTK_IS_MENU_SHELL(top))
00351             return UMENU_NULL;
00352         parent = (GtkWidget *)top;
00353     }
00354
00355     GtkWidget *menuitem = gtk_menu_item_new_with_label(title);
00356     gtk_widget_show(menuitem);
00357     gtk_container_add(GTK_CONTAINER (parent), menuitem);
00358
00359     GtkWidget *menu = gtk_menu_new();
00360     gtk_menu_item_set_submenu(GTK_MENU_ITEM (menuitem), menu);
00361     /*GtkAccelGroup *accel_group = */gtk_menu_ensure_uline_accel_group (GTK_MENU (menu));
00362
00363     return (UMENU)menu;
00364 #endif
00365 #ifdef WIN32
00366     if(top == UMENU_NULL)
00367     {
00368         CMenu* pTopMenu = AfxGetMainWnd()->GetMenu();
00369         CMenu menu;
00370         menu.CreatePopupMenu();
00371         pTopMenu->AppendMenu(MF_POPUP, (UINT)menu.GetSafeHmenu(), name);
00372
00373         static bool firsttime = true;
00374         if(firsttime)
00375         {
00376             pTopMenu->DeleteMenu(0, MF_BYPOSITION);
00377             firsttime = false;
00378         }
00379         return (UMENU)menu.Detach();
00380     }
00381     else
00382     {
00383         HMENU menuhdl = (HMENU)top;
00384         CMenu parent;
00385         CMenu menu;
00386         menu.CreatePopupMenu();
00387         VERIFY(parent.Attach(menuhdl));
00388         parent.AppendMenu(MF_POPUP, (UINT)menu.GetSafeHmenu(), name);
00389         parent.Detach();
00390         return (UMENU)menu.Detach();
00391     }
00392 #endif
00393 }

UMENU UMenuAddSeparator | ( | int | widid,
 |  | UMENU | top
 | ) |

Definition at line 803 of file umenu.cpp.

References FALSE, UASSERT, UMENU, UMENU_NULL, and VERIFY.

00804 {
00805     UASSERT(top != UMENU_NULL);
00806
00807 #ifdef qMacPP
00808     LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00809     LMenu *menu = menuBar->FetchMenu(top);
00810     if(menu)
00811     {
00812         menu->InsertCommand("\p-", 0, max_Int16 - 1);
00813     }
00814     else
00815     {
00816         MenuHandle mhdl = ::GetMenu(top);
00817         if(mhdl != 0L)
00818         {
00819             SInt16  menuLength = ::CountMenuItems(mhdl);
00820             ::MacInsertMenuItem(mhdl, "\p-", menuLength);
00821         }
00822     }
00823
00824     return UMENU_NULL;
00825 #endif
00826 #ifdef qMacAPP
00827     MenuRef menu = MAGetMenu(top);
00828     if(menu)
00829     {
00830         CStr255_AC pstr("-");
00831         gDispatcher->DoMakeMenuBarManager();
00832         TMenuBarManager::fgMenuBarManager->AddMenuItem(pstr, top, ::CountMenuItems(menu), 0);
00833     }
00834
00835     return UMENU_NULL;
00836 #endif
00837 #ifdef qGTK
00838     if(!GTK_IS_MENU_SHELL(top))
00839         return UMENU_NULL;
00840     GtkWidget *parent = (GtkWidget *)top;
00841
00842     GtkWidget *menuitem = gtk_menu_item_new();
00843     gtk_widget_show(menuitem);
00844     gtk_container_add(GTK_CONTAINER (parent), menuitem);
00845     gtk_widget_set_sensitive(menuitem, FALSE);
00846     return UMENU_NULL;
00847 #endif
00848 #ifdef WIN32
00849     HMENU menuhdl = (HMENU)top;
00850     CMenu parent;
00851     VERIFY(parent.Attach(menuhdl));
00852     parent.AppendMenu(MF_SEPARATOR);
00853     parent.Detach();
00854     return UMENU_NULL;
00855 #endif
00856 }

UMENU UMenuAddToggle | ( | int | widid,
 |  | const char * | name,
 |  | UMENU | top,
 |  | const void * | pixmap,
 |  | int | cmd
 | ) |

Definition at line 721 of file umenu.cpp.

References addAccel, ASSERT, EV_INIT_WIDGET, GetMenuTitle, UObject::IsKindOf, UCMD_to_WINCMD, UEventQueryWidget, UEventSendMessage, UMakeBitmap, UMENU, UMENU_NULL, URUNTIME_CLASS, and VERIFY.

00722 {
00723     UStr title;
00724     int  mod, key;
00725     char mnemonic;
00726     GetMenuTitle(name, title, cmd, mnemonic, mod, key);
00727
00728 #ifdef qMacPP
00729     LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00730     LMenu *menu = menuBar->FetchMenu(top);
00731     if(menu)
00732     {
00733         LStr255 pstr(title);
00734         menu->InsertCommand(pstr, cmd, max_Int16 - 1);
00735     }
00736     else
00737     {
00738         MenuHandle mhdl = ::GetMenu(top);
00739         if(mhdl != 0L)
00740         {
00741             SInt16  menuLength = ::CountMenuItems(mhdl);
00742             LStr255 pstr(title);
00743             ::MacInsertMenuItem(mhdl, pstr, menuLength);
00744         }
00745     }
00746
00747     return UMENU_NULL;
00748 #endif
00749 #ifdef qMacAPP
00750     MenuRef menu = MAGetMenu(top);
00751     if(menu)
00752     {
00753         CStr255_AC pstr(title);
00754         gDispatcher->DoMakeMenuBarManager();
00755         TMenuBarManager::fgMenuBarManager->AddMenuItem(pstr, top, ::CountMenuItems(menu), cmd);
00756     }
00757
00758     return UMENU_NULL;
00759 #endif
00760 #ifdef qGTK
00761     UCmdTarget *target = UEventQueryWidget(widid);
00762     if(target == 0L || !target->IsKindOf(URUNTIME_CLASS(UMenu)))
00763         return UMENU_NULL;
00764     UMenu *pmenu = (UMenu *)target;
00765
00766     if(!GTK_IS_MENU_SHELL(top))
00767         return UMENU_NULL;
00768     GtkWidget *parent = (GtkWidget *)top;
00769
00770     GtkWidget *menuitem = gtk_check_menu_item_new_with_label(title);
00771     gtk_widget_show(menuitem);
00772     gtk_container_add(GTK_CONTAINER (parent), menuitem);
00773     addToAccelGroup((GtkAccelGroup *)pmenu->GetAccelGroup(), menuitem, mod, key);
00774 //      gtk_tooltips_set_tip (tooltips, quit1, "Quit the application", NULL);
00775     UEventSendMessage(widid, EV_INIT_WIDGET, cmd, menuitem);
00776
00777     return UMENU_NULL;
00778 #endif
00779 #ifdef WIN32
00780     ASSERT(top != UMENU_NULL);
00781
00782     HMENU menuhdl = (HMENU)top;
00783     CMenu parent;
00784     VERIFY(parent.Attach(menuhdl));
00785
00786     parent.AppendMenu(MF_STRING, UCMD_to_WINCMD(cmd), name);
00787     addAccel(UCMD_to_WINCMD(cmd), mod, key);
00788
00789     if(pixmap != 0L && strlen((const char *)pixmap))
00790     {
00791         HBITMAP bmap = UMakeBitmap((const char *)pixmap);
00792         CBitmap b;
00793         VERIFY(b.Attach(bmap));
00794         parent.SetMenuItemBitmaps(UCMD_to_WINCMD(cmd), MF_BYCOMMAND, &b, &b);
00795         b.Detach();
00796     }
00797
00798     parent.Detach();
00799     return UMENU_NULL;
00800 #endif
00801 }

int UMenuCount ( UMENU top )

Definition at line 566 of file umenu.cpp.

References UASSERT, UMENU, UMENU_NULL, and VERIFY.

00567 {
00568     UASSERT(top != UMENU_NULL);
00569
00570 #ifdef qMacAPP
00571     MenuRef menu = MAGetMenu(top);
00572     if(menu)
00573     {
00574         return ::CountMenuItems(menu);
00575     }
00576 #endif
00577 #ifdef qMacPP
00578     LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00579     LMenu *menu = menuBar->FetchMenu(top);
00580     if(menu)
00581     {
00582         return ::CountMenuItems(menu->GetMacMenuH());
00583     }
00584     else
00585     {
00586         MenuHandle mhdl = ::GetMenu(top);
00587         if(mhdl != 0L)
00588         {
00589             return ::CountMenuItems(mhdl);
00590         }
00591     }
00592 #endif
00593 #ifdef WIN32
00594     CMenu parent;
00595     HMENU menuhdl = (HMENU)top;
00596     VERIFY(parent.Attach(menuhdl));
00597
00598     UINT numItems = parent.GetMenuItemCount();
00599     parent.Detach();
00600
00601     return numItems;
00602 #endif
00603
00604     return 0;
00605 }

void UMenuDelete | ( | UMENU | top,
 |  | int | afterIndex
 | ) |

Definition at line 506 of file umenu.cpp.

References UASSERT, UMENU, UMENU_NULL, and VERIFY.

00507 {
00508     UASSERT(top != UMENU_NULL);
00509
00510 #ifdef qMacAPP
00511     MenuRef menu = MAGetMenu(top);
00512     if(menu)
00513     {
00514         short numItems = ::CountMenuItems(menu);
00515         afterIndex++;
00516         while (numItems >= afterIndex)
00517         {
00518             ::DeleteMenuItem(menu, numItems);
00519             --numItems;
00520         }
00521     }
00522 #endif
00523 #ifdef qMacPP
00524     LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00525     LMenu *menu = menuBar->FetchMenu(top);
00526     if(menu)
00527     {
00528         short numItems = ::CountMenuItems(menu->GetMacMenuH());
00529         afterIndex++;
00530         while (numItems >= afterIndex)
00531         {
00532             menu->RemoveItem(numItems);
00533             --numItems;
00534         }
00535     }
00536     else
00537     {
00538         MenuHandle mhdl = ::GetMenu(top);
00539         if(mhdl != 0L)
00540         {
00541             short numItems = ::CountMenuItems(mhdl);
00542             afterIndex++;
00543             while (numItems >= afterIndex)
00544             {
00545                 ::DeleteMenuItem(mhdl, numItems);
00546                 --numItems;
00547             }
00548         }
00549     }
00550 #endif
00551 #ifdef WIN32
00552     CMenu parent;
00553     HMENU menuhdl = (HMENU)top;
00554     VERIFY(parent.Attach(menuhdl));
00555
00556     int numItems = (int)parent.GetMenuItemCount() - 1;
00557     while (numItems >= afterIndex)
00558     {
00559         VERIFY(parent.DeleteMenu(numItems, MF_BYPOSITION));
00560         --numItems;
00561     }
00562     parent.Detach();
00563 #endif
00564 }

void UMenuDeleteByCmd | ( | UMENU | top,
 |  | int | cmd
 | ) |

Definition at line 607 of file umenu.cpp.

References UASSERT, UMENU, UMENU_NULL, and VERIFY.

00608 {
00609     UASSERT(top != UMENU_NULL);
00610
00611 #ifdef qMacAPP
00612     MenuID menuNo;
00613     short itemNo;
00614     MenuRef menu = CommandToComponents(cmd, menuNo, itemNo);
00615     if(menu)
00616     {
00617         ::DeleteMenuItem(menu, itemNo);
00618     }
00619 #endif
00620 #ifdef qMacPP
00621     LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00622     LMenu *menu = menuBar->FetchMenu(top);
00623     if(menu)
00624     {
00625         menu->RemoveCommand(cmd);
00626     }
00627 #endif
00628 #ifdef WIN32
00629     CMenu parent;
00630     HMENU menuhdl = (HMENU)top;
00631     VERIFY(parent.Attach(menuhdl));
00632
00633     VERIFY(parent.DeleteMenu(cmd, MF_BYCOMMAND));
00634
00635     parent.Detach();
00636 #endif
00637 }

Generated on Sun Feb 24 01:22:53 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


umenu.h File Reference

rf/umenu.h File Reference

#include "uwidget.h"

Include dependency graph for umenu.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | UMenu

Functions

UMENU | UMenuAddPulldown (int widid, const char *name, UMENU top)
UMENU | UMenuAddToggle (int widid, const char *name, UMENU top, const void *pixmap, int cmd)
UMENU | UMenuAddButton (int widid, const char *name, UMENU top, const void *pixmap, int cmd)
UMENU | UMenuAddSeparator (int widid, UMENU top)
void | UMenuDelete (UMENU top, int afterIndex)
void | UMenuDeleteByCmd (UMENU top, int cmd)
int | UMenuCount (UMENU top)

Function Documentation

UMENU UMenuAddButton | ( | int | widid,
 |  | const char * | name,
 |  | UMENU | top,
 |  | const void * | pixmap,
 |  | int | cmd
 | ) |

Definition at line 639 of file umenu.cpp.

Referenced by PyMenuMgr::AddButton, and CreateMainMenubar.

00640 {
00641     UStr title;
00642     int  mod, key;
00643     char mnemonic;
00644     GetMenuTitle(name, title, cmd, mnemonic, mod, key);
00645
00646     UASSERT(top != UMENU_NULL);
00647
00648 #ifdef qMacPP
00649     LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00650     LMenu *menu = menuBar->FetchMenu(top);
00651     if(menu)
00652     {
00653         LStr255 pstr(title);
00654         menu->InsertCommand(pstr, cmd, max_Int16 - 1);
00655     }
00656     else
00657     {
00658         MenuHandle mhdl = ::GetMenu(top);
00659         if(mhdl != 0L)
00660         {
00661             SInt16  menuLength = ::CountMenuItems(mhdl);
00662             LStr255 pstr(title);
00663             ::MacInsertMenuItem(mhdl, pstr, menuLength);
00664         }
00665     }
00666
00667     return UMENU_NULL;
00668 #endif
00669 #ifdef qMacAPP
00670     MenuRef menu = MAGetMenu(top);
00671     if(menu)
00672     {
00673         CStr255_AC pstr(title);
00674         gDispatcher->DoMakeMenuBarManager();
00675         TMenuBarManager::fgMenuBarManager->AddMenuItem(pstr, top, ::CountMenuItems(menu), cmd);
00676     }
00677
00678     return UMENU_NULL;
00679 #endif
00680 #ifdef qGTK
00681     UCmdTarget *target = UEventQueryWidget(widid);
00682     if(target == 0L || !target->IsKindOf(URUNTIME_CLASS(UMenu)))
00683         return UMENU_NULL;
00684     UMenu *pmenu = (UMenu *)target;
00685
00686     if(!GTK_IS_MENU_SHELL(top))
00687         return UMENU_NULL;
00688     GtkWidget *parent = (GtkWidget *)top;
00689
00690     GtkWidget *menuitem = gtk_menu_item_new_with_label_pixmap(title, pixmap);
00691     gtk_widget_show (menuitem);
00692     gtk_container_add (GTK_CONTAINER (parent), menuitem);
00693     addToAccelGroup((GtkAccelGroup *)pmenu->GetAccelGroup(), menuitem, mod, key);
00694 //      gtk_tooltips_set_tip (tooltips, quit1, "Quit the application", NULL);
00695     UEventSendMessage(widid, EV_INIT_WIDGET, cmd, menuitem);
00696
00697     return UMENU_NULL;
00698 #endif
00699 #ifdef WIN32
00700     HMENU menuhdl = (HMENU)top;
00701     CMenu parent;
00702     VERIFY(parent.Attach(menuhdl));
00703
00704     parent.AppendMenu(MF_STRING, UCMD_to_WINCMD(cmd), name);
00705     addAccel(UCMD_to_WINCMD(cmd), mod, key);
00706
00707     if(pixmap != 0L && strlen((const char *)pixmap))
00708     {
00709         HBITMAP bmap = UMakeBitmap((const char *)pixmap);
00710         CBitmap b;
00711         VERIFY(b.Attach(bmap));
00712         parent.SetMenuItemBitmaps(UCMD_to_WINCMD(cmd), MF_BYCOMMAND, &b, &b);
00713         b.Detach();
00714     }
00715
00716     parent.Detach();
00717     return UMENU_NULL;
00718 #endif
00719 }

UMENU UMenuAddPulldown | ( | int | widid,
 |  | const char * | name,
 |  | UMENU | top
 | ) |

Definition at line 288 of file umenu.cpp.

Referenced by PyMenuMgr::AddPulldown, and CreateMainMenubar.

00289 {
00290     UStr title;
00291     int  mod, key;
00292     char mnemonic;
00293     GetMenuTitle(name, title, 0, mnemonic, mod, key);
00294
00295 #ifdef qMacAPP
00296     return UMENU_NULL;
00297 #endif
00298 #ifdef qMacPP
00299     if(top == UMENU_NULL)
00300     {
00301         Assert_(0); // TODO
00302     }
00303     else
00304     {
00305         LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00306         LMenu *menu = menuBar->FetchMenu(top);
00307         if(menu == 0L)
00308             return UMENU_NULL;
00309
00310         LStr255 pstr(name);
00311         LMenu *newMenu = new LMenu(::UniqueID('MENU'), pstr);
00312         menuBar->InstallMenu(newMenu, hierMenu);
00313
00314         menu->InsertCommand(pstr, cmd_UseMenuItem, max_Int16 - 1);
00315 #if TARGET_API_MAC_CARBON
00316         UAppearanceMenus::SetItemHierID(menu->GetMacMenuH(), ::CountMenuItems(menu->GetMacMenuH()),
00317             newMenu->GetMenuID());
00318 #else
00319         UConditionalMenus::SetItemHierID(menu->GetMacMenuH(), ::CountMenuItems(menu->GetMacMenuH()),
00320             newMenu->GetMenuID());
00321 #endif
00322         return newMenu->GetMenuID();
00323     }
00324     return UMENU_NULL;
00325 #endif
00326 #ifdef qGTK
00327     GtkWidget *parent = 0L;
00328
00329     if(top == UMENU_NULL)
00330     {
00331         // try to find the menubar : the menu bar should be mapped
00332         // to a UMenu object as the main widget
00333         const UCmdTarget *target = UEventQueryWidget(widid);
00334         UMenu *menu = 0L;
00335         if(target == 0L || !target->IsKindOf(URUNTIME_CLASS(UMenu)))
00336             return UMENU_NULL;
00337
00338         menu = (UMenu *)target;
00339         if(menu == 0L)
00340             return UMENU_NULL;
00341
00342         GtkWidget *wid = (GtkWidget *)menu->GetWidget(kUMainWidget);
00343         if(wid == 0L || !GTK_IS_MENU_SHELL(wid))
00344             return UMENU_NULL;
00345
00346         parent = wid;
00347     }
00348     else
00349     {
00350         if(!GTK_IS_MENU_SHELL(top))
00351             return UMENU_NULL;
00352         parent = (GtkWidget *)top;
00353     }
00354
00355     GtkWidget *menuitem = gtk_menu_item_new_with_label(title);
00356     gtk_widget_show(menuitem);
00357     gtk_container_add(GTK_CONTAINER (parent), menuitem);
00358
00359     GtkWidget *menu = gtk_menu_new();
00360     gtk_menu_item_set_submenu(GTK_MENU_ITEM (menuitem), menu);
00361     /*GtkAccelGroup *accel_group = */gtk_menu_ensure_uline_accel_group (GTK_MENU (menu));
00362
00363     return (UMENU)menu;
00364 #endif
00365 #ifdef WIN32
00366     if(top == UMENU_NULL)
00367     {
00368         CMenu* pTopMenu = AfxGetMainWnd()->GetMenu();
00369         CMenu menu;
00370         menu.CreatePopupMenu();
00371         pTopMenu->AppendMenu(MF_POPUP, (UINT)menu.GetSafeHmenu(), name);
00372
00373         static bool firsttime = true;
00374         if(firsttime)
00375         {
00376             pTopMenu->DeleteMenu(0, MF_BYPOSITION);
00377             firsttime = false;
00378         }
00379         return (UMENU)menu.Detach();
00380     }
00381     else
00382     {
00383         HMENU menuhdl = (HMENU)top;
00384         CMenu parent;
00385         CMenu menu;
00386         menu.CreatePopupMenu();
00387         VERIFY(parent.Attach(menuhdl));
00388         parent.AppendMenu(MF_POPUP, (UINT)menu.GetSafeHmenu(), name);
00389         parent.Detach();
00390         return (UMENU)menu.Detach();
00391     }
00392 #endif
00393 }

UMENU UMenuAddSeparator | ( | int | widid,
 |  | UMENU | top
 | ) |

Definition at line 803 of file umenu.cpp.

Referenced by PyMenuMgr::AddSeparator, and CreateMainMenubar.

00804 {
00805     UASSERT(top != UMENU_NULL);
00806
00807 #ifdef qMacPP
00808     LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00809     LMenu *menu = menuBar->FetchMenu(top);
00810     if(menu)
00811     {
00812         menu->InsertCommand("\p-", 0, max_Int16 - 1);
00813     }
00814     else
00815     {
00816         MenuHandle mhdl = ::GetMenu(top);
00817         if(mhdl != 0L)
00818         {
00819             SInt16  menuLength = ::CountMenuItems(mhdl);
00820             ::MacInsertMenuItem(mhdl, "\p-", menuLength);
00821         }
00822     }
00823
00824     return UMENU_NULL;
00825 #endif
00826 #ifdef qMacAPP
00827     MenuRef menu = MAGetMenu(top);
00828     if(menu)
00829     {
00830         CStr255_AC pstr("-");
00831         gDispatcher->DoMakeMenuBarManager();
00832         TMenuBarManager::fgMenuBarManager->AddMenuItem(pstr, top, ::CountMenuItems(menu), 0);
00833     }
00834
00835     return UMENU_NULL;
00836 #endif
00837 #ifdef qGTK
00838     if(!GTK_IS_MENU_SHELL(top))
00839         return UMENU_NULL;
00840     GtkWidget *parent = (GtkWidget *)top;
00841
00842     GtkWidget *menuitem = gtk_menu_item_new();
00843     gtk_widget_show(menuitem);
00844     gtk_container_add(GTK_CONTAINER (parent), menuitem);
00845     gtk_widget_set_sensitive(menuitem, FALSE);
00846     return UMENU_NULL;
00847 #endif
00848 #ifdef WIN32
00849     HMENU menuhdl = (HMENU)top;
00850     CMenu parent;
00851     VERIFY(parent.Attach(menuhdl));
00852     parent.AppendMenu(MF_SEPARATOR);
00853     parent.Detach();
00854     return UMENU_NULL;
00855 #endif
00856 }

UMENU UMenuAddToggle | ( | int | widid,
 |  | const char * | name,
 |  | UMENU | top,
 |  | const void * | pixmap,
 |  | int | cmd
 | ) |

Definition at line 721 of file umenu.cpp.

Referenced by PyMenuMgr::AddToggle.

00722 {
00723     UStr title;
00724     int  mod, key;
00725     char mnemonic;
00726     GetMenuTitle(name, title, cmd, mnemonic, mod, key);
00727
00728 #ifdef qMacPP
00729     LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00730     LMenu *menu = menuBar->FetchMenu(top);
00731     if(menu)
00732     {
00733         LStr255 pstr(title);
00734         menu->InsertCommand(pstr, cmd, max_Int16 - 1);
00735     }
00736     else
00737     {
00738         MenuHandle mhdl = ::GetMenu(top);
00739         if(mhdl != 0L)
00740         {
00741             SInt16  menuLength = ::CountMenuItems(mhdl);
00742             LStr255 pstr(title);
00743             ::MacInsertMenuItem(mhdl, pstr, menuLength);
00744         }
00745     }
00746
00747     return UMENU_NULL;
00748 #endif
00749 #ifdef qMacAPP
00750     MenuRef menu = MAGetMenu(top);
00751     if(menu)
00752     {
00753         CStr255_AC pstr(title);
00754         gDispatcher->DoMakeMenuBarManager();
00755         TMenuBarManager::fgMenuBarManager->AddMenuItem(pstr, top, ::CountMenuItems(menu), cmd);
00756     }
00757
00758     return UMENU_NULL;
00759 #endif
00760 #ifdef qGTK
00761     UCmdTarget *target = UEventQueryWidget(widid);
00762     if(target == 0L || !target->IsKindOf(URUNTIME_CLASS(UMenu)))
00763         return UMENU_NULL;
00764     UMenu *pmenu = (UMenu *)target;
00765
00766     if(!GTK_IS_MENU_SHELL(top))
00767         return UMENU_NULL;
00768     GtkWidget *parent = (GtkWidget *)top;
00769
00770     GtkWidget *menuitem = gtk_check_menu_item_new_with_label(title);
00771     gtk_widget_show(menuitem);
00772     gtk_container_add(GTK_CONTAINER (parent), menuitem);
00773     addToAccelGroup((GtkAccelGroup *)pmenu->GetAccelGroup(), menuitem, mod, key);
00774 //      gtk_tooltips_set_tip (tooltips, quit1, "Quit the application", NULL);
00775     UEventSendMessage(widid, EV_INIT_WIDGET, cmd, menuitem);
00776
00777     return UMENU_NULL;
00778 #endif
00779 #ifdef WIN32
00780     ASSERT(top != UMENU_NULL);
00781
00782     HMENU menuhdl = (HMENU)top;
00783     CMenu parent;
00784     VERIFY(parent.Attach(menuhdl));
00785
00786     parent.AppendMenu(MF_STRING, UCMD_to_WINCMD(cmd), name);
00787     addAccel(UCMD_to_WINCMD(cmd), mod, key);
00788
00789     if(pixmap != 0L && strlen((const char *)pixmap))
00790     {
00791         HBITMAP bmap = UMakeBitmap((const char *)pixmap);
00792         CBitmap b;
00793         VERIFY(b.Attach(bmap));
00794         parent.SetMenuItemBitmaps(UCMD_to_WINCMD(cmd), MF_BYCOMMAND, &b, &b);
00795         b.Detach();
00796     }
00797
00798     parent.Detach();
00799     return UMENU_NULL;
00800 #endif
00801 }

int UMenuCount ( UMENU top )

Definition at line 566 of file umenu.cpp.

Referenced by PyMenuMgr::Count.

00567 {
00568     UASSERT(top != UMENU_NULL);
00569
00570 #ifdef qMacAPP
00571     MenuRef menu = MAGetMenu(top);
00572     if(menu)
00573     {
00574         return ::CountMenuItems(menu);
00575     }
00576 #endif
00577 #ifdef qMacPP
00578     LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00579     LMenu *menu = menuBar->FetchMenu(top);
00580     if(menu)
00581     {
00582         return ::CountMenuItems(menu->GetMacMenuH());
00583     }
00584     else
00585     {
00586         MenuHandle mhdl = ::GetMenu(top);
00587         if(mhdl != 0L)
00588         {
00589             return ::CountMenuItems(mhdl);
00590         }
00591     }
00592 #endif
00593 #ifdef WIN32
00594     CMenu parent;
00595     HMENU menuhdl = (HMENU)top;
00596     VERIFY(parent.Attach(menuhdl));
00597
00598     UINT numItems = parent.GetMenuItemCount();
00599     parent.Detach();
00600
00601     return numItems;
00602 #endif
00603
00604     return 0;
00605 }

void UMenuDelete | ( | UMENU | top,
 |  | int | afterIndex
 | ) |

Definition at line 506 of file umenu.cpp.

Referenced by PyMenuMgr::Delete.

00507 {
00508     UASSERT(top != UMENU_NULL);
00509
00510 #ifdef qMacAPP
00511     MenuRef menu = MAGetMenu(top);
00512     if(menu)
00513     {
00514         short numItems = ::CountMenuItems(menu);
00515         afterIndex++;
00516         while (numItems >= afterIndex)
00517         {
00518             ::DeleteMenuItem(menu, numItems);
00519             --numItems;
00520         }
00521     }
00522 #endif
00523 #ifdef qMacPP
00524     LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00525     LMenu *menu = menuBar->FetchMenu(top);
00526     if(menu)
00527     {
00528         short numItems = ::CountMenuItems(menu->GetMacMenuH());
00529         afterIndex++;
00530         while (numItems >= afterIndex)
00531         {
00532             menu->RemoveItem(numItems);
00533             --numItems;
00534         }
00535     }
00536     else
00537     {
00538         MenuHandle mhdl = ::GetMenu(top);
00539         if(mhdl != 0L)
00540         {
00541             short numItems = ::CountMenuItems(mhdl);
00542             afterIndex++;
00543             while (numItems >= afterIndex)
00544             {
00545                 ::DeleteMenuItem(mhdl, numItems);
00546                 --numItems;
00547             }
00548         }
00549     }
00550 #endif
00551 #ifdef WIN32
00552     CMenu parent;
00553     HMENU menuhdl = (HMENU)top;
00554     VERIFY(parent.Attach(menuhdl));
00555
00556     int numItems = (int)parent.GetMenuItemCount() - 1;
00557     while (numItems >= afterIndex)
00558     {
00559         VERIFY(parent.DeleteMenu(numItems, MF_BYPOSITION));
00560         --numItems;
00561     }
00562     parent.Detach();
00563 #endif
00564 }

void UMenuDeleteByCmd | ( | UMENU | top,
 |  | int | cmd
 | ) |

Definition at line 607 of file umenu.cpp.

Referenced by PyMenuMgr::DeleteByCmd.

00608 {
00609     UASSERT(top != UMENU_NULL);
00610
00611 #ifdef qMacAPP
00612     MenuID menuNo;
00613     short itemNo;
00614     MenuRef menu = CommandToComponents(cmd, menuNo, itemNo);
00615     if(menu)
00616     {
00617         ::DeleteMenuItem(menu, itemNo);
00618     }
00619 #endif
00620 #ifdef qMacPP
00621     LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00622     LMenu *menu = menuBar->FetchMenu(top);
00623     if(menu)
00624     {
00625         menu->RemoveCommand(cmd);
00626     }
00627 #endif
00628 #ifdef WIN32
00629     CMenu parent;
00630     HMENU menuhdl = (HMENU)top;
00631     VERIFY(parent.Attach(menuhdl));
00632
00633     VERIFY(parent.DeleteMenu(cmd, MF_BYCOMMAND));
00634
00635     parent.Detach();
00636 #endif
00637 }

Generated on Sun Feb 24 01:22:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


uobject.cpp File Reference

rf/uobject.cpp File Reference

#include "stdafx.h"
#include <string.h>
#include "uobject.h"

Include dependency graph for uobject.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:22:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


uobject.h File Reference

rf/uobject.h File Reference

#include "uconfig.h"

Include dependency graph for uobject.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | UObject
class | URuntimeClass

Defines

#define | URUNTIME_CLASS(class_name) (class_name::rt##class_name())
#define | UDECLARE_DYNAMIC(class_name)
#define | UDECLARE_DYNCREATE(class_name)
#define | UIMPLEMENT_RUNTIMECLASS(class_name, base_class_name, pfnNew)
#define | UIMPLEMENT_DYNAMIC(class_name, base_class_name) UIMPLEMENT_RUNTIMECLASS(class_name, base_class_name, 0L)
#define | UIMPLEMENT_DYNCREATE(class_name, base_class_name)
#define | UDYNAMIC_CAST(TYPE, EXPR) ((TYPE *)((EXPR) == 0L ? 0L : ((EXPR)->IsKindOf(URUNTIME_CLASS(TYPE)) ? (TYPE *)EXPR : 0L)))

Define Documentation

#define UDECLARE_DYNAMIC ( class_name )

Value:

protected: \
    static const URuntimeClass* _GetBaseClass(); \
    static const URuntimeClass class##class_name; \
public: \
    static const URuntimeClass *rt##class_name(void); \
    virtual const URuntimeClass* GetRuntimeClass() const; \

Definition at line 56 of file uobject.h.

#define UDECLARE_DYNCREATE ( class_name )

Value:

UDECLARE_DYNAMIC(class_name) \
    static UObject* CreateObject(); \

Definition at line 65 of file uobject.h.

#define UDYNAMIC_CAST | ( | TYPE,
 |  | EXPR | ) | ((TYPE *)((EXPR) == 0L ? 0L : ((EXPR)->IsKindOf(URUNTIME_CLASS(TYPE)) ? (TYPE *)EXPR : 0L)))

Definition at line 105 of file uobject.h.

Referenced by LPseudoWinAttachment::SearchWidID.

#define UIMPLEMENT_DYNAMIC | ( | class_name,
 |  | base_class_name | ) | UIMPLEMENT_RUNTIMECLASS(class_name, base_class_name, 0L)

Definition at line 80 of file uobject.h.

#define UIMPLEMENT_DYNCREATE | ( | class_name,
 |  | base_class_name | )

Value:

UObject* class_name::CreateObject() \
        { return new class_name; } \
    UIMPLEMENT_RUNTIMECLASS(class_name, base_class_name, \
        class_name::CreateObject)

Definition at line 83 of file uobject.h.

#define UIMPLEMENT_RUNTIMECLASS | ( | class_name,
 |  | base_class_name,
 |  | pfnNew | )

Value:

const URuntimeClass *class_name::rt##class_name(void) \
        { return &class_name::class##class_name; } \
    const URuntimeClass* class_name::_GetBaseClass() \
        { return URUNTIME_CLASS(base_class_name); } \
    const URuntimeClass class_name::class##class_name( \
        #class_name, sizeof(class class_name), pfnNew, \
            &class_name::_GetBaseClass); \
    const URuntimeClass* class_name::GetRuntimeClass() const \
        { return URUNTIME_CLASS(class_name); } \

Definition at line 69 of file uobject.h.

#define URUNTIME_CLASS ( class_name ) (class_name::rt##class_name())

Definition at line 54 of file uobject.h.

Referenced by _loadPersistentSettings, UCvsApp::GetBrowserView, UCvsApp::GetFilesView, UObject::GetRuntimeClass, UWidget::HasModal, UCvsFolders::OnTreeSelecting, CPersistent::SaveAllSettings, UDC::UDC, UEventGiveTime, UMenuAddButton, UMenuAddPulldown, and UMenuAddToggle.

Generated on Sun Feb 24 01:22:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ustr.cpp File Reference

rf/ustr.cpp File Reference

#include "stdafx.h"
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <new>
#include "ustr.h"
#include "uconsole.h"

Include dependency graph for ustr.cpp:

Include dependency graph

Go to the source code of this file.

Variables

const unsigned int kMaxChar = 255

Variable Documentation

const unsigned int kMaxChar = 255 [static]

Definition at line 44 of file ustr.cpp.

Referenced by UPStr::operator<<, UPStr::operator=, and UPStr::set.

Generated on Sun Feb 24 01:22:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ustr.h File Reference

rf/ustr.h File Reference

#include "uconfig.h"
#include <string.h>

Include dependency graph for ustr.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | UPStr
up to 255 characters pascal and C string. More...

class | UStr
C string class. More...

Defines

#define | EGCS_CONST

Define Documentation

#define EGCS_CONST

Definition at line 29 of file ustr.h.

Referenced by UStr::operator char *, UPStr::operator char *, PCStr::operator char *, PCPStr::operator char *, UPStr::operator unsigned char *, and PCPStr::operator unsigned char *.

Generated on Sun Feb 24 01:22:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


utoolbar.cpp File Reference

rf/utoolbar.cpp File Reference

#include "stdafx.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <float.h>
#include "utoolbar.h"
#include "uconsole.h"
#include <vector>
#include <map>

Include dependency graph for utoolbar.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | aref
struct | AREF
class | awidget
class | CColorMenu
class | TbEntry
class | TbEntryButton
class | TbEntryChkButton
class | TbEntryDropDown
class | TbEntrySeparator
class | WININFO

Defines

#define | NEW new

Enumerations

enum tbeKind {
tbeDropDown,
tbeButton,
tbeSeparator
}

Define Documentation

#define NEW new

Definition at line 54 of file utoolbar.cpp.

Referenced by aref::aref, UToolbar::OnTbButton, UToolbar::OnTbCheckBtn, UToolbar::OnTbDropDown, UToolbar::OnTbInit, and UToolbar::OnTbSeparator.

Enumeration Type Documentation

enum tbeKind

Enumeration values:
tbeDropDown
tbeButton
tbeSeparator

Definition at line 72 of file utoolbar.cpp.

Referenced by TbEntry::TbEntry.

00073 {
00074     tbeDropDown,
00075     tbeButton,
00076     tbeSeparator
00077 } tbeKind;

Generated on Sun Feb 24 01:22:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


utoolbar.h File Reference

rf/utoolbar.h File Reference

#include "uwidget.h"

Include dependency graph for utoolbar.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CDynToolBar
class | UToolbar

Generated on Sun Feb 24 01:22:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


uwidget.cpp File Reference

rf/uwidget.cpp File Reference

#include "stdafx.h"
#include <stdio.h>
#include "uwidget.h"
#include "uconsole.h"
#include "udraw.h"
#include "umenu.h"
#include "SmartComboBox.h"
#include "PseudoDlg.h"
#include "PseudoButton.h"

Include dependency graph for uwidget.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define NEW new

Define Documentation

#define NEW new

Definition at line 80 of file uwidget.cpp.

Referenced by UWidget::OnInitWidget, UWidget::OnListNewRow, and UWidget::UWidget.

Generated on Sun Feb 24 01:22:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


uwidget.h File Reference

rf/uwidget.h File Reference

#include "umain.h"
#include "ustr.h"
#include <vector>
#include <map>

Include dependency graph for uwidget.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

struct | UColor
portable color definition. More...

class | UTimer
used by the UWidget class to implement timers/repeaters. More...

class | UWidget
This is the pseudo widget class. More...

Defines

#define | kUMainWidget 0
\def kUMainWidget the command associated with the main widget. More...

Functions

LRESULT | UWinPseudoWindowProc (CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam)

Define Documentation

#define kUMainWidget 0

\def kUMainWidget the command associated with the main widget.

Definition at line 88 of file uwidget.h.

Referenced by UWidget::AddPage, AskCreatePersistentSettings, LPseudoWinAttachment::CheckWindowSize, CompatGetCheckout, CompatGetCommand, CompatGetCommit, CompatGetDiff, CompatGetImport, CompatGetLog, CompatGetPassword, CompatGetPrefs, CompatGetUpdate, CompatImportFilter, CompatRtagBranch, CompatRtagCreate, CompatRtagDelete, CompatTagBranch, CompatTagCreate, CompatTagDelete, CvsAlert, CvsLogParse, UCvsFolders::DeleteAllItems, UCvsFiles::DisableGeneric, CPseudoDlg::DoDataExchange, UPromptMessage::DoDataExchange, UWidget::DoModal, UWidget::EndModal, TBrowserFill::ExitDirectory, TBrowserFillDummy::ExitDirectory, UCvsConsole::FeedThisLine, UCvsFolders::GetItemByLocation, macpp_getattachwindow, UCvsFolders::OnCmdAdd, UCvsFiles::OnCmdAdd, UCvsFiles::OnCmdAddb, UCvsFolders::OnCmdCommit, UCvsFiles::OnCmdCommit, UCvsFolders::OnCmdDiff, UCvsFiles::OnCmdDiff, UCvsFolders::OnCmdEdit, UCvsFiles::OnCmdEdit, UCvsFolders::OnCmdEditors, UCvsFiles::OnCmdEditors, UCvsFiles::OnCmdEditsel, UCvsFiles::OnCmdEditseldef, UCvsFolders::OnCmdExplore, UCvsFiles::OnCmdExplore, UCvsFiles::OnCmdGraph, UCvsFolders::OnCmdLock, UCvsFiles::OnCmdLock, UCvsFolders::OnCmdLog, UCvsFiles::OnCmdLog, UCvsFolders::OnCmdMacrosSel, UCvsFolders::OnCmdQueryUpdate, UCvsFiles::OnCmdQueryUpdate, UCvsFolders::OnCmdRelease, UCvsFiles::OnCmdRelease, UCvsFiles::OnCmdRmv, UCvsFolders::OnCmdStatus, UCvsFiles::OnCmdStatus, UCvsFolders::OnCmdTagBranch, UCvsFiles::OnCmdTagBranch, UCvsFolders::OnCmdTagDelete, UCvsFiles::OnCmdTagDelete, UCvsFolders::OnCmdTagNew, UCvsFiles::OnCmdTagNew, UCvsFiles::OnCmdTrash, UCvsFiles::OnCmdUIAdd, UCvsFiles::OnCmdUIAddB, UCvsFiles::OnCmdUIEditseldef, UCvsFolders::OnCmdUIExplore, UCvsFiles::OnCmdUIExplore, UCvsFiles::OnCmdUIGraph, UCvsFiles::OnCmdUIMacroSel, UCvsFolders::OnCmdUIMacrosSel, UCvsFiles::OnCmdUIRelease, UCvsFiles::OnCmdUIRmv, UCvsFiles::OnCmdUITrash, UCvsFiles::OnCmdUIUpdate, UCvsFolders::OnCmdUnedit, UCvsFiles::OnCmdUnedit, UCvsFolders::OnCmdUnlock, UCvsFiles::OnCmdUnlock, UCvsFolders::OnCmdUpdate, UCvsFiles::OnCmdUpdate, UCvsFolders::OnCmdWatchers, UCvsFiles::OnCmdWatchers, UCvsFolders::OnCmdWatchOff, UCvsFiles::OnCmdWatchOff, UCvsFolders::OnCmdWatchOn, UCvsFiles::OnCmdWatchOn, UCvsGraph::OnCreate, UCvsFiles::OnCreate, UCvsConsole::OnCreate, UCvsFiles::OnDblClick, TBrowserFill::OnDirectory, TViewFill::OnDirectory, TViewFill::OnFile, UWidget::OnInitWidget, UWidget::OnListAddColumns, UWidget::OnListResetAll, UWidget::OnListSetColWidth, UCvsFiles::OnMacroSel, UToolbar::OnTbButton, UToolbar::OnTbCheckBtn, UToolbar::OnTbInit, UToolbar::OnTbSeparator, UCvsFolders::OnTreeExpanding, UCvsFolders::OnTreeSelecting, UCvsFolders::OnUpdateGeneric, UMenu::OnUpdateUI, UMacAppMenu::OnUpdateUI, UCvsConsole::OutColor, UCvsFolders::ResetBrowser, UCvsFolders::ResetView, UCvsFiles::ResetView, UCvsFiles::Resort, UCvsFolders::RetrievePath, UCvsFiles::Search, UCvsFolders::StepToLocation, UCvsFolders::StoreExpanded, UCreate_pixmap, UMenuAddPulldown, UWaitCursor::UWaitCursor, CPseudoDlg::~CPseudoDlg, and UWaitCursor::~UWaitCursor.

Function Documentation

LRESULT UWinPseudoWindowProc | ( | CWnd * | wnd,
 |  | UWidget * | wid,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |

Definition at line 212 of file PseudoDlg.cpp.

Referenced by CPseudoDlg::WindowProc.

00213 {
00214     bool sentOne = false;
00215
00216     if(wid == 0L)
00217         return 1;
00218
00219     if (message == WM_COMMAND)
00220     {
00221         UINT nID = LOWORD(wParam);
00222         if(!IS_PSEUDO_CTL(nID))
00223             return 1;
00224
00225         int nCode = HIWORD(wParam);
00226         HWND hWndCtrl = (HWND)lParam;
00227         switch(nCode)
00228         {
00229         case BN_CLICKED:
00230             UEventSendMessage(wid->GetWidID(), EV_CMD, WINCTL_to_UCMD(nID), 0L);
00231             sentOne = true;
00232             break;
00233         case CBN_SELCHANGE:
00234         {
00235             ASSERT(::IsWindow(hWndCtrl));
00236             int sel = (int)::SendMessage(hWndCtrl, CB_GETCURSEL, 0, 0);
00237             const char *txt = 0L;
00238             char buf[1024] = {'\0'};
00239             if(sel != -1 && (int)::SendMessage(hWndCtrl, CB_GETLBTEXT, sel, (LPARAM)buf) != CB_ERR)
00240                 txt = buf;
00241             if(strcmp(buf, "-") != 0) // separator
00242                 UEventSendMessage(wid->GetWidID(), EV_COMBO_SEL,
00243                     UMAKEINT(WINCTL_to_UCMD(nID), sel), (void *)txt);
00244             sentOne = true;
00245             break;
00246         }
00247         case EN_CHANGE:
00248             if(wid->m_noDispatch)
00249                 break;
00250
00251             ASSERT(::IsWindow(hWndCtrl));
00252             UEventSendMessage(wid->GetWidID(), EV_EDITCHANGE,
00253                 WINCTL_to_UCMD(nID), 0L);
00254             break;
00255         }
00256     }
00257     else if (message == WM_NOTIFY)
00258     {
00259         NMHDR* pNMHDR = (NMHDR*)lParam;
00260         if (pNMHDR->hwndFrom != NULL)
00261         {
00262             UINT nID = _AfxGetDlgCtrlID(pNMHDR->hwndFrom);
00263             int nCode = pNMHDR->code;
00264             if(!IS_PSEUDO_CTL(nID))
00265                 return 1;
00266
00267             switch(nCode)
00268             {
00269             case LVN_ITEMCHANGED:
00270                 NMLISTVIEW *state = (NMLISTVIEW *)pNMHDR;
00271
00272                 HWND wnd = state->hdr.hwndFrom;
00273                 ASSERT(::IsWindow(wnd));
00274
00275                 int id = state->hdr.idFrom;
00276                 std::map<int, void *>::const_iterator i = wid->GetWidgets().find(WINCTL_to_UCMD(id));
00277                 if(i != wid->GetWidgets().end())
00278                 {
00279                     CWnd *w = (CWnd *)(*i).second;
00280                     if(w->IsKindOf(RUNTIME_CLASS(CListCtrl)))
00281                     {
00282                         CListCtrl *list = (CListCtrl*)w;
00283                         CString s = list->GetItemText(state->iItem, 0);
00284
00285                         UEventSendMessage(wid->GetWidID(), EV_LIST_SELECTING,
00286                             UMAKEINT(WINCTL_to_UCMD(state->hdr.idFrom), state->iItem), (void *)(const char *)s);
00287                         sentOne = true;
00288                     }
00289                 }
00290                 break;
00291             }
00292         }
00293     }
00294     else if (message == WM_SIZE)
00295     {
00296         int id = findIdForWnd(wnd, wid);
00297         if(id != -1)
00298         {
00299             URECT r = {0, 0, LOWORD(lParam), HIWORD(lParam)};
00300             UEventSendMessage(wid->GetWidID(), EV_RESIZE, id, &r);
00301             sentOne = true;
00302         }
00303     }
00304     else if (message == WM_MOUSEMOVE)
00305     {
00306         int id = findIdForWnd(wnd, wid);
00307         if(id != -1)
00308         {
00309             UEventSendMessage(wid->GetWidID(), EV_MMOVE, UMAKEINT(LOWORD(lParam), HIWORD(lParam)),
00310                 (void *)UWinToUMod(wParam));
00311             sentOne = true;
00312         }
00313     }
00314     else if (message == WM_LBUTTONDOWN)
00315     {
00316         int id = findIdForWnd(wnd, wid);
00317         if(id != -1)
00318         {
00319             UEventSendMessage(wid->GetWidID(), EV_BTNDOWN, UMAKEINT(LOWORD(lParam), HIWORD(lParam)),
00320                 (void *)UWinToUMod(wParam));
00321             sentOne = true;
00322         }
00323     }
00324     else if (message == WM_LBUTTONUP)
00325     {
00326         int id = findIdForWnd(wnd, wid);
00327         if(id != -1)
00328         {
00329             UEventSendMessage(wid->GetWidID(), EV_BTNUP, UMAKEINT(LOWORD(lParam), HIWORD(lParam)),
00330                 (void *)UWinToUMod(wParam));
00331             sentOne = true;
00332         }
00333     }
00334     else if (message == WM_LBUTTONDBLCLK)
00335     {
00336         int id = findIdForWnd(wnd, wid);
00337         if(id != -1)
00338         {
00339             UEventSendMessage(wid->GetWidID(), EV_BTNDBLDOWN, UMAKEINT(LOWORD(lParam), HIWORD(lParam)),
00340                 (void *)UWinToUMod(wParam));
00341             sentOne = true;
00342         }
00343     }
00344     else if (message == WM_KEYDOWN)
00345     {
00346         int id = findIdForWnd(wnd, wid);
00347         if(id != -1)
00348         {
00349             UEventSendMessage(wid->GetWidID(), EV_KEYDOWN, wParam, 0L);
00350             sentOne = true;
00351         }
00352     }
00353     else if (message == WM_HSCROLL)
00354     {
00355         HWND hwndScrollBar = (HWND) lParam;       // handle to scroll bar
00356         int nID = ::GetDlgCtrlID(hwndScrollBar);
00357         if(!IS_PSEUDO_CTL(nID))
00358             return 1;
00359
00360         int cmd = WINCTL_to_UCMD(nID);
00361         CWnd *wnds = (CWnd *)wid->GetWidget(cmd);
00362         if(wnds == 0L || !wnds->IsKindOf(RUNTIME_CLASS(CScrollBar)))
00363             return 1;
00364
00365         CScrollBar *scroll = (CScrollBar *)wnds;
00366
00367         int nScrollCode = (int) LOWORD(wParam);  // scroll bar value
00368         int nPos;
00369         if(nScrollCode == SB_THUMBPOSITION || nScrollCode == SB_THUMBTRACK)
00370         {
00371             nPos = (short int) HIWORD(wParam);   // scroll box position
00372
00373             if(nScrollCode == SB_THUMBPOSITION)
00374                 scroll->SetScrollPos(nPos);
00375         }
00376         else
00377         {
00378             SCROLLINFO info;
00379             VERIFY(scroll->GetScrollInfo(&info));
00380             nPos = info.nPos;
00381
00382             switch(nScrollCode)
00383             {
00384             case SB_ENDSCROLL:
00385                 return 1;
00386                 break;
00387             case SB_LINELEFT:
00388                 nPos -= 1;
00389                 break;
00390             case SB_LINERIGHT:
00391                 nPos += 1;
00392                 break;
00393             case SB_PAGELEFT:
00394                 nPos -= info.nPage;
00395                 break;
00396             case SB_PAGERIGHT:
00397                 nPos += info.nPage;
00398                 break;
00399             case SB_LEFT:
00400                 nPos = info.nMin;
00401                 break;
00402             case SB_RIGHT:
00403                 nPos = info.nMax;
00404                 break;
00405             }
00406
00407             scroll->SetScrollPos(nPos);
00408         }
00409
00410         UEventSendMessage(wid->GetWidID(), EV_SCROLLCHANGE, WINCTL_to_UCMD(nID),
00411             (void *)nPos);
00412         sentOne = true;
00413     }
00414     else if (message == WM_VSCROLL)
00415     {
00416         HWND hwndScrollBar = (HWND) lParam;       // handle to scroll bar
00417         int nID = ::GetDlgCtrlID(hwndScrollBar);
00418         if(!IS_PSEUDO_CTL(nID))
00419             return 1;
00420
00421         int cmd = WINCTL_to_UCMD(nID);
00422         CWnd *wnds = (CWnd *)wid->GetWidget(cmd);
00423         if(wnds == 0L || !wnds->IsKindOf(RUNTIME_CLASS(CScrollBar)))
00424             return 1;
00425
00426         CScrollBar *scroll = (CScrollBar *)wnds;
00427
00428         int nScrollCode = (int) LOWORD(wParam);  // scroll bar value
00429         int nPos;
00430         if(nScrollCode == SB_THUMBPOSITION || nScrollCode == SB_THUMBTRACK)
00431         {
00432             nPos = (short int) HIWORD(wParam);   // scroll box position
00433
00434             if(nScrollCode == SB_THUMBPOSITION)
00435                 scroll->SetScrollPos(nPos);
00436         }
00437         else
00438         {
00439             SCROLLINFO info;
00440             VERIFY(scroll->GetScrollInfo(&info));
00441             nPos = info.nPos;
00442
00443             switch(nScrollCode)
00444             {
00445             case SB_ENDSCROLL:
00446                 return 1;
00447                 break;
00448             case SB_LINEUP:
00449                 nPos -= 1;
00450                 break;
00451             case SB_LINEDOWN:
00452                 nPos += 1;
00453                 break;
00454             case SB_PAGEUP:
00455                 nPos -= info.nPage;
00456                 break;
00457             case SB_PAGEDOWN:
00458                 nPos += info.nPage;
00459                 break;
00460             case SB_TOP:
00461                 nPos = info.nMin;
00462                 break;
00463             case SB_BOTTOM:
00464                 nPos = info.nMax;
00465                 break;
00466             }
00467
00468             if(nPos > info.nMax)
00469                 nPos = info.nMax;
00470             else if(nPos < info.nMin)
00471                 nPos = info.nMin;
00472             scroll->SetScrollPos(nPos);
00473         }
00474
00475         UEventSendMessage(wid->GetWidID(), EV_SCROLLCHANGE, WINCTL_to_UCMD(nID),
00476             (void *)nPos);
00477         sentOne = true;
00478     }
00479
00480     if(sentOne)
00481         UWidget::DoValidUI(false);
00482
00483     return 1;
00484 }

Generated on Sun Feb 24 01:22:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


stdafx.h File Reference

rf/support/gtk/stdafx.h File Reference

#include <gtk/gtk.h>

Include dependency graph for stdafx.h:

Include dependency graph

Go to the source code of this file.

Defines

#define | UASSERT g_assert

Functions

GtkLabel * | getLabelFromContainer (GtkContainer *w)

Define Documentation

#define UASSERT g_assert

Definition at line 7 of file stdafx.h.

Referenced by UCmdUI::Check, UAppConsole, UEventNotifyMessage, UEventSendMessage, UEventSendMessageExt, UMenuAddButton, UMenuAddSeparator, UMenuCount, UMenuDelete, UMenuDeleteByCmd, and TPseudoRotateIconButton::WriteFields.

Function Documentation

GtkLabel* getLabelFromContainer ( GtkContainer * w )

Referenced by UWidget::OnGetText, UWidget::OnSetText, and UCmdUI::SetText.

Generated on Sun Feb 24 01:22:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/gtk/stdafx.h Source File

rf/support/gtk/stdafx.h

Go to the documentation of this file.
00001 /* compatibility */
00002 #ifdef HAVE_CONFIG_H
00003 #include "config.h"
00004 #endif /* HAVE_CONFIG_H */
00005
00006 /* the GTK assert */
00007 #define UASSERT g_assert
00008
00009 #include <gtk/gtk.h>
00010
00011 extern "C" {
00012     GtkLabel *getLabelFromContainer(GtkContainer *w);
00013 }
Generated on Sun Feb 24 01:21:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


stdafx.h File Reference

rf/support/macapp/stdafx.h File Reference

#include "MacAppTypes.h"

Include dependency graph for stdafx.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | qMacAPP 1
#define | qRangeCheck 0
#define | qReleaseBuild 1
#define | qRelease qReleaseBuild
#define | wantDebugging qDebug
#define | UASSERT(cond)
#define | UTHROW(err) throw CException_AC(mFulErr)

Functions

char * | strdup (const char *str)

Define Documentation

#define qMacAPP 1

Definition at line 1 of file stdafx.h.

#define qRangeCheck 0

Definition at line 7 of file stdafx.h.

#define qRelease qReleaseBuild

Definition at line 12 of file stdafx.h.

#define qReleaseBuild 1

Definition at line 8 of file stdafx.h.

#define UASSERT ( cond )

Definition at line 22 of file stdafx.h.

#define UTHROW ( err ) throw CException_AC(mFulErr)

Definition at line 24 of file stdafx.h.

Referenced by UStr::operator<<, UStr::operator=, and UPStr::operator=.

#define wantDebugging qDebug

Definition at line 14 of file stdafx.h.

Function Documentation

char* strdup ( const char * str )

Definition at line 17 of file UPseudoSupport.cpp.

00018 {
00019     if(str == 0L)
00020         return 0L;
00021
00022     size_t len = strlen(str);
00023     char *res = (char *)malloc((len + 1) * sizeof(char));
00024     if(res == 0L)
00025         throw CException_AC(mFulErr);
00026     strcpy(res, str);
00027     return res;
00028 }

Generated on Sun Feb 24 01:22:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/macapp/stdafx.h Source File

rf/support/macapp/stdafx.h

Go to the documentation of this file.
00001 #define qMacAPP 1
00002
00003 #if qDebug
00004 #   define qRangeCheck 1
00005 #   define qReleaseBuild 0
00006 #else
00007 #   define qRangeCheck 0
00008 #   define qReleaseBuild 1
00009 #endif
00010
00011 #undef qRelease
00012 #define qRelease qReleaseBuild
00013
00014 #define wantDebugging qDebug
00015
00016 #include "MacAppTypes.h"
00017
00018 /* the MacAPP assert */
00019 #if qDebug
00020 #   define UASSERT(cond) DebugAssert_AC((cond), #cond, __FILE__, __LINE__)
00021 #else
00022 #   define UASSERT(cond)
00023 #endif
00024 #define UTHROW(err) throw CException_AC(mFulErr)
00025
00026 extern "C" char *strdup(const char *str);
Generated on Sun Feb 24 01:21:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UPseudoSupport.cpp File Reference

rf/support/macapp/UPseudoSupport.cpp File Reference

#include "stdafx.h"
#include <stdlib.h>
#include <Errors.h>
#include "UPseudoSupport.h"
#include "UPopup.h"
#include "UDialogTEView.h"
#include "UEditText.h"
#include "UWindow.h"
#include "USlider.h"
#include "uconsole.h"

Include dependency graph for UPseudoSupport.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | CDummyClass
struct | CViewInfo

Defines

#define | MA_CHECK(cond) Assertion_AC(cond, #cond)
#define | Inherited TBehavior
#define | Inherited TTextListView
#define | Inherited TView
#define | Inherited TEditText
#define | Inherited TBehavior
#define | Inherited TIconButton
#define | Inherited TPopup
#define | Inherited TIconPopup
#define | Inherited TScrollBar
#define | Inherited TPseudoIconButton
#define | Inherited TIconCheckBox
#define | Inherited TAdorner
#define | OFFSET 40

Enumerations

enum {
kHierarchicalMin = 0,
kHierarchicalMax = 235
}

Functions

char * | strdup (const char *str)
MA_DEFINE_CLASS_M1 (TPseudoWinBehavior, TBehavior)
MA_DEFINE_CLASS_M0 (TPseudoTextListView)
void | NumberToString_US (double n, UStr &s, int decimalPlaces)
void | extractInfos (std::vector< CViewInfo > &infos, std::vector< TPopup * > &popups, TView *view)
bool | InBetweenVSide (const CViewRect &popPos, const CViewRect &pos)
int | findmostright (TPopup *popup, const std::vector< CViewInfo > &infos)
void | macapp_workaround_adlib_bug (TView *view)

Variables

CDummyClass sDummyStarter

Define Documentation

#define Inherited TAdorner

Definition at line 728 of file UPseudoSupport.cpp.

#define Inherited TIconCheckBox

Definition at line 728 of file UPseudoSupport.cpp.

#define Inherited TPseudoIconButton

Definition at line 728 of file UPseudoSupport.cpp.

#define Inherited TScrollBar

Definition at line 728 of file UPseudoSupport.cpp.

#define Inherited TIconPopup

Definition at line 728 of file UPseudoSupport.cpp.

#define Inherited TPopup

Definition at line 728 of file UPseudoSupport.cpp.

#define Inherited TIconButton

Definition at line 728 of file UPseudoSupport.cpp.

#define Inherited TBehavior

Definition at line 728 of file UPseudoSupport.cpp.

#define Inherited TEditText

Definition at line 728 of file UPseudoSupport.cpp.

#define Inherited TView

Definition at line 728 of file UPseudoSupport.cpp.

#define Inherited TTextListView

Definition at line 728 of file UPseudoSupport.cpp.

#define Inherited TBehavior

Definition at line 728 of file UPseudoSupport.cpp.

#define MA_CHECK ( cond ) Assertion_AC(cond, #cond)

Definition at line 15 of file UPseudoSupport.cpp.

Referenced by TPseudoTextListView::DoMouseCommand_SelectCells, TPseudoTextListView::GetItemText, and TPseudoTextListView::InsStringBefore.

#define OFFSET 40

Enumeration Type Documentation

anonymous enum

Enumeration values:
kHierarchicalMin
kHierarchicalMax

Definition at line 783 of file UPseudoSupport.cpp.

00784 {
00785     kHierarchicalMin = 0,
00786     kHierarchicalMax = 235
00787 };

Function Documentation

void extractInfos | ( | std::vector< CViewInfo > & | infos,
 |  | std::vector< TPopup * > & | popups,
 |  | TView * | view
 | ) | [static]

Definition at line 893 of file UPseudoSupport.cpp.

References CViewInfo::view.

Referenced by macapp_workaround_adlib_bug.

00894 {
00895     if(view == 0L)
00896         return;
00897
00898     if(MA_MEMBER(view, TPopup) && !MA_MEMBER(view, TIconPopup))
00899     {
00900         popups.push_back((TPopup *)view);
00901     }
00902     else
00903     {
00904         CViewInfo info;
00905         info.view = view;
00906         infos.push_back(info);
00907     }
00908
00909     extractInfos(infos, popups, view->GetNextView());
00910     extractInfos(infos, popups, view->GetSubView());
00911 }

int findmostright | ( | TPopup * | popup,
 |  | const std::vector< CViewInfo > & | infos
 | ) | [static]

Definition at line 921 of file UPseudoSupport.cpp.

References InBetweenVSide.

Referenced by macapp_workaround_adlib_bug.

00922 {
00923     int most_right = popup->GetWindow()->GetExtent().right;
00924     CViewRect popPos = popup->GetFrame();
00925     popPos = popup->GetSuperView()->LocalToRootView(popPos);
00926
00927     std::vector<CViewInfo>::const_iterator i;
00928     for(i = infos.begin(); i != infos.end(); ++i)
00929     {
00930         TView *view = (*i).view;
00931
00932         CViewRect pos = view->GetFrame();
00933         pos = view->GetSuperView()->LocalToRootView(pos);
00934         if(pos.left > popPos.right && InBetweenVSide(popPos, pos))
00935         {
00936             // the top/bottom popup is inside the top/bottom view
00937             if(pos.left < most_right)
00938                 most_right = pos.left;
00939         }
00940     }
00941
00942     return most_right;
00943 }

bool InBetweenVSide | ( | const CViewRect & | popPos,
 |  | const CViewRect & | pos
 | ) | [static]

Definition at line 913 of file UPseudoSupport.cpp.

Referenced by findmostright.

00914 {
00915     return (popPos.top >= pos.top && popPos.top <= pos.bottom) ||
00916         (popPos.bottom >= pos.top && popPos.bottom <= pos.bottom) ||
00917          (pos.top >= popPos.top && pos.top <= popPos.bottom) ||
00918         (pos.bottom >= popPos.top && pos.bottom <= popPos.bottom);
00919 }

MA_DEFINE_CLASS_M0 ( TPseudoTextListView )

MA_DEFINE_CLASS_M1 | ( | TPseudoWinBehavior | ,
 |  | TBehavior |
 | ) |

void macapp_workaround_adlib_bug ( TView * view )

Definition at line 945 of file UPseudoSupport.cpp.

References extractInfos, and findmostright.

00946 {
00947     std::vector<TPopup *> popups;
00948     std::vector<CViewInfo> infos;
00949     extractInfos(infos, popups, view->GetSubView());
00950 #   define OFFSET 40
00951
00952     std::vector<TPopup *>::iterator p;
00953     for(p = popups.begin(); p != popups.end(); ++p)
00954     {
00955         TPopup *popup = *p;
00956
00957         int most_right = findmostright(popup, infos);
00958         CViewRect oldPos = popup->GetFrame();
00959         oldPos = popup->GetSuperView()->LocalToRootView(oldPos);
00960         if(most_right > (oldPos.right + OFFSET))
00961         {
00962             oldPos.right = most_right - OFFSET;
00963             oldPos = popup->GetSuperView()->RootViewToLocal(oldPos);
00964             popup->SetFrame(oldPos, true);
00965         }
00966     }
00967 }

void NumberToString_US | ( | double | n,
 |  | UStr & | s,
 |  | int | decimalPlaces
 | ) | [static]

Definition at line 406 of file UPseudoSupport.cpp.

Referenced by TPseudoDoubleNumberText::SetValue.

00407 {
00408     char tmp[255];
00409     if(decimalPlaces > 0)
00410         sprintf(tmp, "%0.*f", decimalPlaces, n);
00411     else
00412         sprintf(tmp, "%ld", round(n));
00413     s = tmp;
00414 }

char* strdup ( const char * str )

Definition at line 17 of file UPseudoSupport.cpp.

References malloc.

00018 {
00019     if(str == 0L)
00020         return 0L;
00021
00022     size_t len = strlen(str);
00023     char *res = (char *)malloc((len + 1) * sizeof(char));
00024     if(res == 0L)
00025         throw CException_AC(mFulErr);
00026     strcpy(res, str);
00027     return res;
00028 }

Variable Documentation

class CDummyClass sDummyStarter

Generated on Sun Feb 24 01:22:40 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/macapp/UPseudoSupport.cpp Source File

rf/support/macapp/UPseudoSupport.cpp

Go to the documentation of this file.
00001 #include "stdafx.h"
00002
00003 #include <stdlib.h>
00004 #include <Errors.h>
00005
00006 #include "UPseudoSupport.h"
00007 #include "UPopup.h"
00008 #include "UDialogTEView.h"
00009 #include "UEditText.h"
00010 #include "UWindow.h"
00011 #include "USlider.h"
00012
00013 #include "uconsole.h"
00014
00015 #define MA_CHECK(cond) Assertion_AC(cond, #cond)
00016
00017 extern "C" char *strdup(const char *str)
00018 {
00019     if(str == 0L)
00020         return 0L;
00021
00022     size_t len = strlen(str);
00023     char *res = (char *)malloc((len + 1) * sizeof(char));
00024     if(res == 0L)
00025         throw CException_AC(mFulErr);
00026     strcpy(res, str);
00027     return res;
00028 }
00029
00030 #undef Inherited
00031 #define Inherited TBehavior
00032
00033 MA_DEFINE_CLASS_M1(TPseudoWinBehavior, Inherited);
00034
00035 TPseudoWinBehavior::TPseudoWinBehavior() : TBehavior(kPseudoWinBehavior), fWidID(-1)
00036 {
00037 }
00038
00039 TPseudoWinBehavior::~TPseudoWinBehavior()
00040 {
00041 }
00042
00043 void TPseudoWinBehavior::DoEvent(EventNumber eventNumber, TEventHandler* source, TEvent* event)
00044 {
00045     // find out the command who fired the event (if any)
00046     int cmdid = -1;
00047
00048     // the typing event is originated by a sub-view of an TEditText field
00049     TEventHandler* ourSource = source;
00050     if(eventNumber == cTyping && MA_MEMBER(ourSource, TDialogTEView))
00051     {
00052         ourSource = ((TDialogTEView *)ourSource)->fEditText;
00053     }
00054
00055     if(fWidID != -1)
00056         cmdid = UEventSendMessage(fWidID, EV_FETCHCMD, 0, ourSource);
00057
00058     if(cmdid != -1) switch(eventNumber)
00059     {
00060         case mBecameTarget:
00061         case mResignedTarget:
00062             UEventNotifyMessage(EV_UPDATEFOCUS, eventNumber == mResignedTarget, ourSource);
00063             break;
00064         case mButtonHit:
00065         case mRadioHit:
00066         case mCheckBoxHit:
00067             UEventSendMessage(fWidID, EV_CMD, cmdid, 0L);
00068             break;
00069         case mHScrollBarHit:
00070         case mVScrollBarHit:
00071             if(MA_MEMBER(ourSource, TSlider) || MA_MEMBER(ourSource, TScrollBar))
00072             {
00073                 TCtlMgr *slider = (TCtlMgr *)ourSource;
00074                 UEventSendMessage(fWidID, EV_SCROLLCHANGE, cmdid, (void *)slider->GetValue());
00075             }
00076             break;
00077         case mPopupHit:
00078             if(MA_MEMBER(ourSource, TPopup))
00079             {
00080                 TPopup *popup = (TPopup *)ourSource;
00081                 short cur = popup->GetCurrentItem();
00082                 CStr255_AC pstr = popup->GetItemText(cur);
00083                 UPStr content(pstr);
00084                 UEventSendMessage(fWidID, EV_COMBO_SEL, UMAKEINT(cmdid, cur - 1),
00085                     (void *)(const char *)content);
00086             }
00087             break;
00088         case mControlHit:
00089             if(MA_MEMBER(ourSource, TSlider))
00090             {
00091                 TSlider *slider = (TSlider *)ourSource;
00092                 UEventSendMessage(fWidID, EV_SCROLLCHANGE, cmdid, (void *)slider->GetValue());
00093             }
00094             break;
00095         case cTyping:
00096             if(MA_MEMBER(ourSource, TEditText))
00097             {
00098                 UEventSendMessage(fWidID, EV_EDITCHANGE, cmdid, 0L);
00099             }
00100             break;
00101         case TPseudoTextListView::kSelectionChanged:
00102         case TPseudoTextListView::kMultiClickSelection:
00103             if(MA_MEMBER(ourSource, TPseudoTextListView))
00104             {
00105                 TPseudoTextListView *txt = (TPseudoTextListView *)ourSource;
00106                 short entry = txt->FirstSelectedItem();
00107                 CChar255_AC name;
00108                 if(entry > 0)
00109                     name = txt->GetItemText(entry);
00110
00111                 UEventSendMessage(fWidID,
00112                     eventNumber == TPseudoTextListView::kSelectionChanged ?
00113                     EV_LIST_SELECTING : EV_LIST_DBLCLICK, UMAKEINT(cmdid, entry - 1),
00114                     (void *)(const char *)name);
00115             }
00116             break;
00117     }
00118
00119     Inherited::DoEvent(eventNumber, source, event);
00120 }
00121
00122
00123 #undef Inherited
00124 #define Inherited TTextListView
00125 MA_DEFINE_CLASS_M0(TPseudoTextListView);
00126
00127 TPseudoTextListView::TPseudoTextListView()
00128 {
00129 }
00130
00131
00132
00133 TPseudoTextListView::~TPseudoTextListView()
00134 {
00135 }
00136
00137
00138 IDType TPseudoTextListView::GetStandardSignature(void) const
00139 {
00140     return TPseudoTextListView::kTextStringListViewSignature;
00141 }
00142
00143 CStr255_AC TPseudoTextListView::GetItemText(GridCoordinate anItem) const
00144 {
00145     MA_CHECK(this->fNumOfRows == this->fStringContainer.size());
00146     MA_CHECK(1 <= anItem && this->fStringContainer.size() >= anItem);
00147
00148     CStr255_AC aString = this->fStringContainer[anItem - 1];
00149     return aString;
00150 }
00151
00152 void TPseudoTextListView::InsStringBefore(short anItem, const char * string)
00153 {
00154     MA_CHECK(1 <= anItem && this->fStringContainer.size() >= anItem - 1);
00155
00156     std::vector<CStr255_AC>::iterator iter = this->fStringContainer.end();
00157
00158     try
00159     {
00160         iter = this->fStringContainer.insert(
00161                     this->fStringContainer.begin() + (anItem - 1), string);
00162     }
00163     catch(CException_AC& theException)
00164     {
00165         if (iter != this->fStringContainer.end())
00166         {
00167             this->fStringContainer.erase(iter);
00168                 // Put it back like it was.  This will maintain internal consistency.
00169         }
00170         throw;
00171     }
00172
00173     this->InsItemBefore(anItem, 1);
00174 }
00175
00176 void TPseudoTextListView::InsStringFirst(const char * string)
00177 {
00178     this->InsStringBefore(1, string);
00179 }
00180
00181 void TPseudoTextListView::InsStringLast(const char * string)
00182 {
00183     this->InsStringBefore(this->fNumOfRows + 1, string);
00184 }
00185
00186 void TPseudoTextListView::DelItemAt(GridCoordinate anItem, GridCoordinate numOfItems)
00187 {
00188     this->fStringContainer.erase(
00189             this->fStringContainer.begin() + (anItem - 1),
00190             this->fStringContainer.begin() + (anItem - 1 + numOfItems));
00191
00192     this->Inherited::DelItemAt(anItem, numOfItems);
00193 }
00194
00195 void TPseudoTextListView::RemoveAll(void)
00196 {
00197     this->DelItemFirst(this->fNumOfRows);
00198 }
00199
00200 bool TPseudoTextListView::DoMouseCommand_SelectCells(GridCell whichCell, TToolboxEvent * event)
00201 {
00202     MA_CHECK(nil != event);
00203
00204     bool selectionChanged = false;
00205         // Will be true if the selection changed.
00206
00207     if (this->CanSelectCell(whichCell))
00208     {
00209         bool shifted = event->IsShiftKeyPressed();
00210         bool commandKey = event->IsCommandKeyPressed();
00211
00212         if (commandKey)
00213         {
00214             this->SelectCell(whichCell, !this->fSingleSelection,
00215                     kHighlight, !this->IsCellSelected(whichCell));
00216
00217             selectionChanged = true;
00218         }
00219         else if (shifted && !this->fSingleSelection)
00220         {
00221             GridCell runner = whichCell;
00222
00223             if (this->IsCellSelected(whichCell))
00224             {
00225                 for ( ; runner.v <= this->fNumOfRows; runner.v++)
00226                 {
00227                     if (!this->IsCellSelected(runner))
00228                     {
00229                         break;
00230                     }
00231
00232                     this->SelectCell(runner, kExtend, kHighlight, kDeSelect);
00233                 }
00234             }
00235             else
00236             {
00237                 for ( ; runner.v > 0; runner.v--)
00238                 {
00239                     if (this->IsCellSelected(runner))
00240                     {
00241                         break;
00242                     }
00243
00244                     this->SelectCell(runner, kExtend, kHighlight, kSelect);
00245                 }
00246             }
00247
00248             selectionChanged = true;
00249         }
00250         else if (!this->IsCellSelected(whichCell))
00251         {
00252             this->SelectCell(whichCell, kDontExtend, kHighlight, kSelect);
00253
00254             selectionChanged = true;
00255         }
00256     }
00257
00258     return selectionChanged;
00259 }
00260
00261 void TPseudoTextListView::DoMouseCommand(CViewPoint & theMouse, TToolboxEvent * event, CPoint_AC)
00262 {
00263     GridCell aCell;
00264
00265     if (badChoice != this->IdentifyPoint(theMouse, aCell))
00266     {
00267         this->DoMouseCommand_SelectCells(aCell, event);
00268             // First be sure to select/deselect the cell they clicked on.
00269
00270         if (event->GetClickCount() > 1)
00271         {
00272             this->HandleEvent(kMultiClickSelection, this, event);
00273         }
00274     }
00275 }
00276
00277 void TPseudoTextListView::DoKeyEvent(TToolboxEvent* event)// override
00278 {
00279     Boolean handledCharacter = false;
00280
00281     if (this->IsEnabled() && this->Focus())     // if view is not enabled then we don't take ANY keystrokes
00282     {
00283         GridCell selected;
00284         unsigned char ch = event->GetText()[1];
00285
00286         if (ch == chUp)
00287         {
00288             selected = this->FirstSelectedCell();
00289             selected.v -= 1;
00290
00291             this->DoMouseCommand_SelectCells(selected, event);
00292
00293             handledCharacter = true;
00294         }
00295         else if (ch == chDown)
00296         {
00297             selected = this->LastSelectedCell();
00298             selected.v += 1;
00299
00300             this->DoMouseCommand_SelectCells(selected, event);
00301
00302             handledCharacter = true;
00303         }
00304     }
00305
00306     if (!handledCharacter)
00307         Inherited::DoKeyEvent(event);
00308 }
00309
00310 void TPseudoTextListView::SetSelection(const TGridViewDesignator* cellsToSelect,
00311                         bool extendSelection, bool highlight, bool select)
00312 {
00313     this->Inherited::SetSelection(cellsToSelect, extendSelection, highlight, select);
00314
00315     this->Changed(kSelectionChanged, this);
00316     this->HandleEvent(kSelectionChanged, this, nil);
00317 }
00318
00319 #undef Inherited
00320 #define Inherited TView
00321
00322 MA_DEFINE_CLASS_M1(TPseudoCustomView, Inherited);
00323
00324 TPseudoCustomView::TPseudoCustomView()
00325 {
00326 }
00327
00328 TPseudoCustomView::~TPseudoCustomView()
00329 {
00330 }
00331
00332 void TPseudoCustomView::Draw(const CViewRect& area)
00333 {
00334     TWindow *wind = GetWindow();
00335     if(wind != 0L)
00336     {
00337         TPseudoWinBehavior *pseudo = dynamic_cast_AC(TPseudoWinBehavior*,
00338             wind->GetBehaviorWithIdentifier(TPseudoWinBehavior::kPseudoWinBehavior));
00339         if(pseudo != 0L)
00340         {
00341             int cmdid = UEventSendMessage(pseudo->GetWidID(), EV_FETCHCMD, 0, this);
00342             if(cmdid != -1)
00343                 UEventSendMessage(pseudo->GetWidID(), EV_CUSTOM_DRAW, cmdid, this);
00344         }
00345     }
00346 }
00347
00348
00349 #undef Inherited
00350 #define Inherited TEditText
00351
00352 MA_DEFINE_CLASS_M1(TPseudoDoubleNumberText, Inherited);
00353
00354 TPseudoDoubleNumberText::TPseudoDoubleNumberText() : fMaximum(DBL_MAX), fMinimum(DBL_MIN),
00355     fPrecision(kDefaultPrecision)
00356 {
00357 }
00358
00359 TPseudoDoubleNumberText::~TPseudoDoubleNumberText()
00360 {
00361 }
00362
00363 IDType TPseudoDoubleNumberText::GetStandardSignature() const
00364 {
00365     return kStdDoubleNumberText;
00366 }
00367
00368 void TPseudoDoubleNumberText::ReadFields(CStream_AC* aStream)
00369 {
00370     Inherited::ReadFields(aStream);
00371
00372     CStr255_AC theString;
00373     theString = aStream->ReadString(255);
00374     sscanf(CChar255_AC(theString), "%lf", &fMinimum);
00375     theString = aStream->ReadString(255);
00376     sscanf(CChar255_AC(theString), "%lf", &fMaximum);
00377     fPrecision = aStream->ReadInteger();
00378 }
00379
00380 void TPseudoDoubleNumberText::WriteFields(CStream_AC* aStream) const
00381 {
00382     Inherited::WriteFields(aStream);
00383
00384     char tmp[255];
00385     sprintf(tmp, "%lf", fMinimum);
00386     aStream->WriteString(CStr255_AC(tmp));
00387     sprintf(tmp, "%lf", fMaximum);
00388     aStream->WriteString(CStr255_AC(tmp));
00389     aStream->WriteLong(fPrecision);
00390 }
00391
00392
00393 double TPseudoDoubleNumberText::GetValue()
00394 {
00395     double theValue = 0.0;
00396     CStr255_AC theString = GetText();
00397
00398     if (!theString.IsEmpty())
00399     {
00400         sscanf(CChar255_AC(theString), "%lf", &theValue);
00401     }
00402
00403     return theValue;
00404 }
00405
00406 static void NumberToString_US(double n, UStr & s, int decimalPlaces)
00407 {
00408     char tmp[255];
00409     if(decimalPlaces > 0)
00410         sprintf(tmp, "%0.*f", decimalPlaces, n);
00411     else
00412         sprintf(tmp, "%ld", round(n));
00413     s = tmp;
00414 }
00415
00416 void TPseudoDoubleNumberText::SetValue(double newValue, bool redraw)
00417 {
00418     newValue = fMinimum >= newValue ? fMinimum : newValue;
00419     newValue = newValue <= fMaximum ? newValue : fMaximum;
00420
00421     UStr aString;
00422     NumberToString_US(newValue, aString, fPrecision);
00423
00424     CStr255_AC tempString = aString;
00425     SetText(tempString, redraw);
00426 }
00427
00428 long TPseudoDoubleNumberText::GetValidationError()
00429 {
00430     CStr255_AC theString = GetText();
00431
00432     if (!theString.IsEmpty())
00433     {
00434         double extValue;
00435         bool valid = sscanf(CChar255_AC(theString), "%lf", &extValue) == 1;
00436
00437         if (!valid)
00438             return kNonNumericCharacters;
00439         else if (extValue < fMinimum)
00440             return kValueTooSmall;
00441         else if (extValue > fMaximum)
00442             return kValueTooLarge;
00443     }
00444
00445     return kValidValue;
00446 }
00447
00448 #undef Inherited
00449 #define Inherited TBehavior
00450
00451 MA_DEFINE_CLASS_M1(TPseudoAppBehavior, Inherited);
00452
00453 TPseudoAppBehavior::TPseudoAppBehavior() : TBehavior()
00454 {
00455     SetIdleFreq(0); // ASAP
00456 }
00457
00458 TPseudoAppBehavior::~TPseudoAppBehavior()
00459 {
00460 }
00461
00462 bool TPseudoAppBehavior::DoIdle(IdlePhase phase)
00463 {
00464     ::UEventGiveTime();
00465     return false;
00466 }
00467
00468 void TPseudoAppBehavior::DoMenuCommand(CommandNumber aCommandNumber)
00469 {
00470     if(UMacAppMenu::sMAMenuWidID != -1)
00471     {
00472         int handledFlag;
00473         int res = UEventSendMessageExt(UMacAppMenu::sMAMenuWidID, EV_CMD,
00474             aCommandNumber, 0L, &handledFlag);
00475         if(res == 0 && handledFlag)
00476             return;
00477     }
00478
00479     // regular MacApp handling
00480     Inherited::DoMenuCommand(aCommandNumber);
00481 }
00482
00483 void TPseudoAppBehavior::DoSetupMenus()
00484 {
00485     UWidget::DoValidUI(false);
00486     ::UEventGiveTime();
00487
00488     Inherited::DoSetupMenus();
00489 }
00490
00491 bool TPseudoAppBehavior::DoToolboxEvent(TToolboxEvent* event)
00492 {
00493     if(event && event->GetIdentifier() == activateEvt)
00494     {
00495         bool activate = ((event->GetModifiers()) & activeFlag) != 0;
00496         TWindow * aWindow = TWindow::WMgrToWindow((WindowRef)(event->GetMessage()));
00497         if(aWindow)
00498         {
00499             UEventNotifyMessage(EV_UPDATEFOCUS, !activate, aWindow);
00500                 // so the pseudo widget update its current widget.
00501                 // it's important for the menu handling.
00502         }
00503     }
00504
00505     return Inherited::DoToolboxEvent(event);
00506 }
00507
00508 #undef Inherited
00509 #define Inherited TIconButton
00510
00511 MA_DEFINE_CLASS_M1(TPseudoIconButton, Inherited);
00512
00513 TPseudoIconButton::TPseudoIconButton()
00514 {
00515 }
00516
00517 TPseudoIconButton::~TPseudoIconButton()
00518 {
00519 }
00520
00521 void TPseudoIconButton::ReadFields(CStream_AC* aStream)
00522 {
00523     Inherited::ReadFields(aStream);
00524
00525     *aStream >> fContentType;
00526     SetContentRsrcID(fContentType, fRsrcID);
00527 }
00528
00529 void TPseudoIconButton::WriteFields(CStream_AC* aStream) const
00530 {
00531     Inherited::WriteFields(aStream);
00532
00533     *aStream << fContentType;
00534 }
00535
00536 #undef Inherited
00537 #define Inherited TPopup
00538
00539 MA_DEFINE_CLASS_M1(TBuggyPopup, Inherited);
00540
00541 TBuggyPopup::TBuggyPopup()
00542 {
00543 }
00544
00545 TBuggyPopup::~TBuggyPopup()
00546 {
00547 }
00548
00549 void TBuggyPopup::ReadFields(CStream_AC* aStream)
00550 {
00551     Inherited::ReadFields(aStream);
00552
00553     *aStream >> fRealWidth;
00554 }
00555
00556 void TBuggyPopup::WriteFields(CStream_AC* aStream) const
00557 {
00558     Inherited::WriteFields(aStream);
00559
00560     *aStream << fRealWidth;
00561 }
00562
00563 void TBuggyPopup::DoPostCreate(TDocument* itsDocument)
00564 {
00565     if(fRealWidth > 0)
00566     {
00567         CViewRect r = GetExtent();
00568         Resize(CViewPoint(fRealWidth, r.Height()), true);
00569     }
00570 }
00571
00572 #undef Inherited
00573 #define Inherited TIconPopup
00574
00575 MA_DEFINE_CLASS_M1(TPseudoIconPopup, Inherited);
00576
00577 TPseudoIconPopup::TPseudoIconPopup()
00578 {
00579 }
00580
00581 TPseudoIconPopup::~TPseudoIconPopup()
00582 {
00583 }
00584
00585 void TPseudoIconPopup::ReadFields(CStream_AC* aStream)
00586 {
00587     Inherited::ReadFields(aStream);
00588
00589     *aStream >> fContentType;
00590     SetContentRsrcID(fContentType, fRsrcID);
00591 }
00592
00593 void TPseudoIconPopup::WriteFields(CStream_AC* aStream) const
00594 {
00595     Inherited::WriteFields(aStream);
00596
00597     *aStream << fContentType;
00598 }
00599
00600 #undef Inherited
00601 #define Inherited TScrollBar
00602
00603 MA_DEFINE_CLASS_M1(TPseudoScrollBar, Inherited);
00604
00605 TPseudoScrollBar::TPseudoScrollBar() : fPageStep(1), fButtonStep(1)
00606 {
00607 }
00608
00609 TPseudoScrollBar::~TPseudoScrollBar()
00610 {
00611 }
00612
00613 void TPseudoScrollBar::TrackScrollBar(short partCode)
00614 {
00615     switch (partCode)
00616     {
00617         case kControlPageUpPart:
00618             if (GetValue() > GetMinimum())
00619                 DeltaValue(-fPageStep);
00620             break;
00621         case kControlUpButtonPart:
00622             if (GetValue() > GetMinimum())
00623                 DeltaValue(-fButtonStep);
00624             break;
00625         case kControlPageDownPart:
00626             if (GetValue() < GetMaximum())
00627                 DeltaValue(fPageStep);
00628             break;
00629         case kControlDownButtonPart:
00630             if (GetValue() < GetMaximum())
00631                 DeltaValue(fButtonStep);
00632             break;
00633     }
00634 }
00635
00636 #undef Inherited
00637 #define Inherited TPseudoIconButton
00638
00639 MA_DEFINE_CLASS_M1(TPseudoRotateIconButton, Inherited);
00640
00641 TPseudoRotateIconButton::TPseudoRotateIconButton() : fCurrentIcon(0)
00642 {
00643 }
00644
00645 TPseudoRotateIconButton::~TPseudoRotateIconButton()
00646 {
00647 }
00648
00649 void TPseudoRotateIconButton::ReadFields(CStream_AC* aStream)
00650 {
00651     Inherited::ReadFields(aStream);
00652
00653     CChar255_AC str(aStream->ReadString(255));
00654     const char *ptr = str;
00655     while(ptr != 0L)
00656     {
00657         int v;
00658         const char *tmp = strchr(ptr, ',');
00659         if(tmp != 0L)
00660         {
00661             CChar255_AC stmp;
00662             size_t offset = tmp - ptr;
00663             stmp.CopyFrom(ptr, offset);
00664             ptr += offset + 1;
00665             if(sscanf(stmp, "%d", &v) == 1)
00666                 fIconSuite.push_back(v);
00667         }
00668         else
00669         {
00670             if(sscanf(ptr, "%d", &v) == 1)
00671                 fIconSuite.push_back(v);
00672             ptr = 0;
00673         }
00674     }
00675
00676     if(fIconSuite.size() != 0)
00677         SetContentRsrcID(fContentType, fIconSuite[0]);
00678 }
00679
00680 void TPseudoRotateIconButton::WriteFields(CStream_AC* aStream) const
00681 {
00682     Inherited::WriteFields(aStream);
00683
00684     // do we really need to write ?
00685     *aStream << "";
00686     UASSERT(0);
00687 }
00688
00689 void TPseudoRotateIconButton::DoRotate(int icon)
00690 {
00691     if(fCurrentIcon != icon && icon >= 0 && icon < fIconSuite.size())
00692     {
00693         fCurrentIcon = icon;
00694         SetContentRsrcID(fContentType, fIconSuite[fCurrentIcon]);
00695         ForceRedraw();
00696     }
00697 }
00698
00699 #undef Inherited
00700 #define Inherited TIconCheckBox
00701
00702 MA_DEFINE_CLASS_M1(TPseudoIconCheckBox, Inherited);
00703
00704 TPseudoIconCheckBox::TPseudoIconCheckBox()
00705 {
00706 }
00707
00708 TPseudoIconCheckBox::~TPseudoIconCheckBox()
00709 {
00710 }
00711
00712 void TPseudoIconCheckBox::ReadFields(CStream_AC* aStream)
00713 {
00714     Inherited::ReadFields(aStream);
00715
00716     *aStream >> fContentType;
00717     SetContentRsrcID(fContentType, fRsrcID);
00718 }
00719
00720 void TPseudoIconCheckBox::WriteFields(CStream_AC* aStream) const
00721 {
00722     Inherited::WriteFields(aStream);
00723
00724     *aStream << fContentType;
00725 }
00726
00727 #undef Inherited
00728 #define Inherited TAdorner
00729
00730 MA_DEFINE_CLASS_M1(TPseudoWinAdorner, Inherited);
00731
00732 TPseudoWinAdorner::TPseudoWinAdorner() : TAdorner(kPseudoWinAdorner), fWidID(-1)
00733 {
00734 }
00735
00736 TPseudoWinAdorner::~TPseudoWinAdorner()
00737 {
00738     if(fWidID != -1)
00739         UEventSendMessage(fWidID, EV_DESTROY, 0, 0L);
00740 }
00741
00742 void TPseudoWinAdorner::ViewChangedFrame (TView* itsView,
00743                             const CViewRect& oldFrame,
00744                             const CViewRect& newFrame,
00745                             bool    invalidate)
00746 {
00747     TWindow *wind = itsView->GetWindow();
00748     if(wind != 0L && fWidID != -1)
00749     {
00750         int cmdid = UEventSendMessage(fWidID, EV_FETCHCMD, 0, itsView);
00751         if(cmdid != -1)
00752         {
00753             URECT r;
00754             r.left = newFrame.left;
00755             r.right = newFrame.right;
00756             r.top = newFrame.top;
00757             r.bottom = newFrame.bottom;
00758
00759             UEventSendMessage(fWidID, EV_RESIZE, cmdid, &r);
00760         }
00761     }
00762 }
00763
00764 UIMPLEMENT_DYNAMIC(UMacAppMenu, UMenu)
00765
00766 UBEGIN_MESSAGE_MAP(UMacAppMenu, UMenu)
00767     ON_UPDATEUI(UMacAppMenu)
00768 UEND_MESSAGE_MAP()
00769
00770 int UMacAppMenu::sMAMenuWidID = -1;
00771
00772 UMacAppMenu::UMacAppMenu() : UMenu(::UEventGetWidID())
00773 {
00774     sMAMenuWidID = GetWidID();
00775 }
00776
00777 UMacAppMenu::~UMacAppMenu()
00778 {
00779 }
00780
00781 // If hierarchical the range of IDs for applications is restricted.  See IM V-236.
00782 // If the menu isn't managed by MacApp and is in a TPopup, its ID must be outside this range.
00783 enum
00784 {
00785     kHierarchicalMin = 0,
00786     kHierarchicalMax = 235
00787 };
00788
00789 void UMacAppMenu::OnUpdateUI()
00790 {
00791     static bool sSemaphore = false;
00792     USemaphore policeman(sSemaphore);
00793     if(policeman.IsEnteredTwice())
00794         return;
00795
00796     // this is the interesting thing about the toolbar : it resends the
00797     // update UI to other widgets according to the focus information and
00798     // allows the update to be handled several times if the handler asks for it
00799     // (by using UCmdUI::SetContinue)
00800
00801     const STD map<int, UCmdTarget *> & targets = UEventGetTargets();
00802     std::map<int, void *>::iterator w;
00803     int cmdid;
00804     int widFocus = UWidget::GetFocus();
00805
00806     for(CMenuIterator iter; iter.Current(); ++iter)
00807     {
00808         MenuRef menu = iter;
00809         short menuID = (**menu).menuID;
00810
00811         // see UMenuMgr.cpp from MacApp
00812         if (menuID < kHierarchicalMin || menuID > kHierarchicalMax)
00813             continue;
00814
00815         short numitems = ::CountMItems(menu);
00816         for(int j = 1; j <= numitems; j++)
00817         {
00818             cmdid = CommandFromMenuItem(menuID, j);
00819             if(cmdid < 0)
00820             {
00821                 UAppConsole("The item %d of the menu %d has not a MacApp cmd\n", j, menuID);
00822             }
00823             else
00824             {
00825                 if(cmdid == kUMainWidget)
00826                     continue;
00827
00828                 // first forward the command to the focused widget : if it doesn't want it
00829                 // we give it to the next pseudo widget.
00830                 if(widFocus != -1 && widFocus != GetWidID())
00831                 {
00832                     UCmdUI pUI(cmdid);
00833                     UEventSendMessage(widFocus, EV_UPDTCMD, pUI.m_nID, &pUI);
00834                     if(!pUI.CanContinue())
00835                         continue;
00836                 }
00837
00838                 STD map<int, UCmdTarget *>::const_iterator i;
00839                 for(i = targets.begin(); i != targets.end(); ++i)
00840                 {
00841                     int widid = (*i).first;
00842                     if(widid == widFocus || widid == GetWidID())
00843                         continue;
00844
00845                     UCmdUI pUI(cmdid);
00846                     UEventSendMessage(widid, EV_UPDTCMD, pUI.m_nID, &pUI);
00847                     if(!pUI.CanContinue())
00848                         break;
00849                 }
00850                 if(i == targets.end())
00851                 {
00852                     //UAppConsole("The cmd %d of the menubar has no update handler, it's gonna be disabled\n", cmdid);
00853                     UCmdUI pUI(cmdid);
00854                     pUI.Enable(false);
00855                 }
00856             }
00857         }
00858     }
00859 }
00860
00861 class CDummyClass
00862 {
00863 public:
00864     CDummyClass()
00865     {
00866         InitUSlider();
00867         if (!gUGridViewInitialized)
00868         {
00869             InitUGridView();
00870         }
00871         MA_REGISTER_CLASS(TPseudoAppBehavior);
00872         MA_REGISTER_CLASS(TPseudoIconButton);
00873         MA_REGISTER_CLASS(TPseudoIconPopup);
00874         MA_REGISTER_CLASS(TPseudoScrollBar);
00875         MA_REGISTER_CLASS(TPseudoRotateIconButton);
00876         MA_REGISTER_CLASS(TPseudoIconCheckBox);
00877         MA_REGISTER_CLASS(TBuggyPopup);
00878         MA_REGISTER_CLASS(TPseudoWinBehavior);
00879         MA_REGISTER_CLASS(TPseudoCustomView);
00880         MA_REGISTER_CLASS(TPseudoWinAdorner);
00881         MA_REGISTER_SIGNATURE(TPseudoTextListView,
00882                 TPseudoTextListView::kTextStringListViewSignature);
00883         MA_REGISTER_CLASS(TPseudoDoubleNumberText);
00884     }
00885
00886 } sDummyStarter;
00887
00888 typedef struct CViewInfo
00889 {
00890     TView *view;
00891 };
00892
00893 static void extractInfos(std::vector<CViewInfo> & infos, std::vector<TPopup *> & popups, TView *view)
00894 {
00895     if(view == 0L)
00896         return;
00897
00898     if(MA_MEMBER(view, TPopup) && !MA_MEMBER(view, TIconPopup))
00899     {
00900         popups.push_back((TPopup *)view);
00901     }
00902     else
00903     {
00904         CViewInfo info;
00905         info.view = view;
00906         infos.push_back(info);
00907     }
00908
00909     extractInfos(infos, popups, view->GetNextView());
00910     extractInfos(infos, popups, view->GetSubView());
00911 }
00912
00913 static bool InBetweenVSide(const CViewRect & popPos, const CViewRect & pos)
00914 {
00915     return (popPos.top >= pos.top && popPos.top <= pos.bottom) ||
00916         (popPos.bottom >= pos.top && popPos.bottom <= pos.bottom) ||
00917          (pos.top >= popPos.top && pos.top <= popPos.bottom) ||
00918         (pos.bottom >= popPos.top && pos.bottom <= popPos.bottom);
00919 }
00920
00921 static int findmostright(TPopup *popup, const std::vector<CViewInfo> & infos)
00922 {
00923     int most_right = popup->GetWindow()->GetExtent().right;
00924     CViewRect popPos = popup->GetFrame();
00925     popPos = popup->GetSuperView()->LocalToRootView(popPos);
00926
00927     std::vector<CViewInfo>::const_iterator i;
00928     for(i = infos.begin(); i != infos.end(); ++i)
00929     {
00930         TView *view = (*i).view;
00931
00932         CViewRect pos = view->GetFrame();
00933         pos = view->GetSuperView()->LocalToRootView(pos);
00934         if(pos.left > popPos.right && InBetweenVSide(popPos, pos))
00935         {
00936             // the top/bottom popup is inside the top/bottom view
00937             if(pos.left < most_right)
00938                 most_right = pos.left;
00939         }
00940     }
00941
00942     return most_right;
00943 }
00944
00945 void macapp_workaround_adlib_bug(TView *view)
00946 {
00947     std::vector<TPopup *> popups;
00948     std::vector<CViewInfo> infos;
00949     extractInfos(infos, popups, view->GetSubView());
00950 #   define OFFSET 40
00951
00952     std::vector<TPopup *>::iterator p;
00953     for(p = popups.begin(); p != popups.end(); ++p)
00954     {
00955         TPopup *popup = *p;
00956
00957         int most_right = findmostright(popup, infos);
00958         CViewRect oldPos = popup->GetFrame();
00959         oldPos = popup->GetSuperView()->LocalToRootView(oldPos);
00960         if(most_right > (oldPos.right + OFFSET))
00961         {
00962             oldPos.right = most_right - OFFSET;
00963             oldPos = popup->GetSuperView()->RootViewToLocal(oldPos);
00964             popup->SetFrame(oldPos, true);
00965         }
00966     }
00967 }
00968
Generated on Sun Feb 24 01:21:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UPseudoSupport.h File Reference

rf/support/macapp/UPseudoSupport.h File Reference

#include "uwidget.h"
#include "umenu.h"
#include "UBehavior.h"
#include "UGridView.h"
#include "UEditText.h"
#include "UIconButton.h"
#include <vector>

Include dependency graph for UPseudoSupport.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | UMacAppMenu
class | TBuggyPopup
class | TPseudoAppBehavior
class | TPseudoCustomView
class | TPseudoDoubleNumberText
class | TPseudoIconButton
class | TPseudoIconCheckBox
class | TPseudoIconPopup
class | TPseudoRotateIconButton
class | TPseudoScrollBar
class | TPseudoTextListView
class | TPseudoWinAdorner
class | TPseudoWinBehavior

Functions

void | macapp_workaround_adlib_bug (TView *view)

Function Documentation

void macapp_workaround_adlib_bug ( TView * view )

Definition at line 945 of file UPseudoSupport.cpp.

00946 {
00947     std::vector<TPopup *> popups;
00948     std::vector<CViewInfo> infos;
00949     extractInfos(infos, popups, view->GetSubView());
00950 #   define OFFSET 40
00951
00952     std::vector<TPopup *>::iterator p;
00953     for(p = popups.begin(); p != popups.end(); ++p)
00954     {
00955         TPopup *popup = *p;
00956
00957         int most_right = findmostright(popup, infos);
00958         CViewRect oldPos = popup->GetFrame();
00959         oldPos = popup->GetSuperView()->LocalToRootView(oldPos);
00960         if(most_right > (oldPos.right + OFFSET))
00961         {
00962             oldPos.right = most_right - OFFSET;
00963             oldPos = popup->GetSuperView()->RootViewToLocal(oldPos);
00964             popup->SetFrame(oldPos, true);
00965         }
00966     }
00967 }

Generated on Sun Feb 24 01:22:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/macapp/UPseudoSupport.h Source File

rf/support/macapp/UPseudoSupport.h

Go to the documentation of this file.
00001 #ifndef UPSEUDOSUPPORT_H
00002 #define UPSEUDOSUPPORT_H
00003
00004 #include "uwidget.h"
00005 #include "umenu.h"
00006
00007 #include "UBehavior.h"
00008 #include "UGridView.h"
00009 #include "UEditText.h"
00010 #include "UIconButton.h"
00011 #include <vector>
00012
00013 class TBuggyPopup : public TPopup
00014 {
00015     MA_DECLARE_CLASS;
00016
00017     TBuggyPopup();
00018     virtual ~TBuggyPopup();
00019
00020     virtual void ReadFields(CStream_AC* aStream);
00021     virtual void WriteFields(CStream_AC* aStream) const;
00022     virtual void DoPostCreate(TDocument* itsDocument);
00023 protected:
00024     int fRealWidth;
00025 };
00026
00027 class TPseudoScrollBar : public TScrollBar
00028 {
00029     MA_DECLARE_CLASS;
00030
00031     TPseudoScrollBar();
00032     virtual ~TPseudoScrollBar();
00033
00034     virtual void TrackScrollBar(short partCode);
00035
00036     int fPageStep;
00037     int fButtonStep;
00038 };
00039
00040 class TPseudoIconPopup : public TIconPopup
00041 {
00042     MA_DECLARE_CLASS;
00043
00044     TPseudoIconPopup();
00045     virtual ~TPseudoIconPopup();
00046
00047     virtual void ReadFields(CStream_AC* aStream);
00048     virtual void WriteFields(CStream_AC* aStream) const;
00049 };
00050
00051 class TPseudoIconButton : public TIconButton
00052 {
00053     MA_DECLARE_CLASS;
00054
00055     TPseudoIconButton();
00056     virtual ~TPseudoIconButton();
00057
00058     virtual void ReadFields(CStream_AC* aStream);
00059     virtual void WriteFields(CStream_AC* aStream) const;
00060 };
00061
00062 class TPseudoRotateIconButton : public TPseudoIconButton
00063 {
00064     MA_DECLARE_CLASS;
00065
00066     TPseudoRotateIconButton();
00067     virtual ~TPseudoRotateIconButton();
00068
00069     virtual void ReadFields(CStream_AC* aStream);
00070     virtual void WriteFields(CStream_AC* aStream) const;
00071
00072     void DoRotate(int icon);
00073
00074 protected:
00075     std::vector<short> fIconSuite;
00076     int fCurrentIcon;
00077 };
00078
00079 class TPseudoIconCheckBox : public TIconCheckBox
00080 {
00081     MA_DECLARE_CLASS;
00082
00083     TPseudoIconCheckBox();
00084     virtual ~TPseudoIconCheckBox();
00085
00086     virtual void ReadFields(CStream_AC* aStream);
00087     virtual void WriteFields(CStream_AC* aStream) const;
00088 };
00089
00090 class UMacAppMenu : public UMenu
00091 {
00092     UDECLARE_DYNAMIC(UMacAppMenu)
00093
00094 public:
00095     UMacAppMenu();
00096     virtual ~UMacAppMenu();
00097
00098     static int sMAMenuWidID;
00099
00100     ev_msg void OnUpdateUI(void);
00101
00102     UDECLARE_MESSAGE_MAP()
00103 };
00104
00105 class TPseudoAppBehavior : public TBehavior
00106 {
00107     MA_DECLARE_CLASS;
00108 public:
00109     TPseudoAppBehavior();
00110     virtual ~TPseudoAppBehavior();
00111
00112     virtual bool DoIdle(IdlePhase phase);
00113     virtual void DoMenuCommand(CommandNumber aCommandNumber);
00114     virtual void DoSetupMenus();
00115     virtual bool DoToolboxEvent(TToolboxEvent* event);
00116
00117 protected:
00118 };
00119
00120 class TPseudoWinBehavior : public TBehavior
00121 {
00122     MA_DECLARE_CLASS;
00123 public:
00124
00125     enum
00126     {
00127         kPseudoWinBehavior = 'pswb'
00128     };
00129
00130     TPseudoWinBehavior();
00131     virtual ~TPseudoWinBehavior();
00132
00133     virtual void DoEvent(EventNumber eventNumber, TEventHandler* source, TEvent* event);
00134
00135     inline int GetWidID() const { return fWidID; }
00136 protected:
00137     inline void SetPseudoWidget(int widid) { fWidID = widid; }
00138
00139     int fWidID;
00140
00141     friend class UWidget;
00142 };
00143
00144 class TPseudoWinAdorner : public TAdorner
00145 {
00146     MA_DECLARE_CLASS;
00147 public:
00148
00149     enum
00150     {
00151         kPseudoWinAdorner = 'pswa'
00152     };
00153
00154     TPseudoWinAdorner();
00155     virtual ~TPseudoWinAdorner();
00156
00157     virtual void ViewChangedFrame (TView* itsView,
00158                                             const CViewRect& oldFrame,
00159                                             const CViewRect& newFrame,
00160                                             bool    invalidate);
00161
00162 protected:
00163     inline void SetPseudoWidget(int widid) { fWidID = widid; }
00164
00165     int fWidID;
00166
00167     friend class UWidget;
00168 };
00169
00170 class TPseudoCustomView : public TView
00171 {
00172     MA_DECLARE_CLASS;
00173 public:
00174
00175     TPseudoCustomView();
00176     virtual ~TPseudoCustomView();
00177
00178     virtual void Draw(const CViewRect& area);
00179 };
00180
00181 class TPseudoTextListView : public TTextListView
00182 {
00183     MA_DECLARE_CLASS;
00184
00185 public:
00186     enum
00187     {
00188         kTextStringListViewSignature = 'TxLv',
00189
00190         kSelectionChanged = 'TxSC',
00191         kMultiClickSelection = 'TxMu'
00192     };
00193
00194     TPseudoTextListView();
00195     virtual ~TPseudoTextListView();
00196
00197     virtual IDType GetStandardSignature(void) const;
00198
00199     virtual CStr255_AC GetItemText(GridCoordinate) const;
00200
00201     virtual void InsStringBefore(short anItem, const char * string);
00202     virtual void InsStringFirst(const char * string);
00203     virtual void InsStringLast(const char * string);
00204
00205     virtual void DelItemAt(GridCoordinate anItem, GridCoordinate numOfItems);
00206     virtual void RemoveAll(void);
00207
00208     virtual void DoKeyEvent(TToolboxEvent * event);
00209     virtual void DoMouseCommand(CViewPoint & theMouse, TToolboxEvent * event, CPoint_AC);
00210     virtual void SetSelection(const TGridViewDesignator* cellsToSelect,
00211                         bool extendSelection, bool highlight, bool select);
00212
00213 protected:
00214     virtual bool DoMouseCommand_SelectCells(GridCell whichCell, class TToolboxEvent * event);
00215
00216     std::vector<CStr255_AC> fStringContainer;
00217 };
00218
00219 class TPseudoDoubleNumberText : public TEditText
00220 {
00221     MA_DECLARE_CLASS;
00222
00223 public:
00224     enum
00225     {
00226         kDefaultPrecision = 5,
00227         kStdDoubleNumberText = 'dNum'
00228     };
00229
00230     TPseudoDoubleNumberText();
00231     virtual ~TPseudoDoubleNumberText();
00232
00233     virtual IDType GetStandardSignature() const;
00234     virtual void ReadFields(CStream_AC* aStream);
00235     virtual void WriteFields(CStream_AC* aStream) const;
00236     virtual long GetValidationError();
00237         // Overrides
00238
00239     virtual double GetValue();
00240     virtual void SetValue(double newValue, bool redraw);
00241 protected:
00242     double fMinimum;
00243     double fMaximum;
00244     short fPrecision;
00245 };
00246
00247 void macapp_workaround_adlib_bug(TView *view);
00248
00249 #endif
Generated on Sun Feb 24 01:21:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/mfc/dib.c Source File

rf/support/mfc/dib.c

Go to the documentation of this file.
00001 /*************************************************************************
00002 /* This is a 'best of' choice of DIB functions taken from Microsoft
00003 /* examples files (examples wincap32 : file.c, dibutil.c ...)
00004 /*************************************************************************/
00005
00006 #include <windows.h>
00007 #include <windowsx.h>
00008 #include "dib.h"
00009
00010
00011 /****************************************************************************
00012  *                                                                          *
00013  *  FUNCTION   : DibNumColors(VOID FAR * pv)                                *
00014  *                                                                          *
00015  *  PURPOSE    : Determines the number of colors in the DIB by looking at   *
00016  *               the BitCount filed in the info block.                      *
00017  *                                                                          *
00018  *  RETURNS    : The number of colors in the DIB.                           *
00019  *               if bitmap is in 8 bit mode but use only 4 colors           *
00020  *               function can return 4 (number of color really used)        *
00021  *               Use DibGetPaletteSize instead...                           *
00022  *                                                                          *
00023  ****************************************************************************/
00024 WORD DibNumColors (VOID FAR * pv)
00025 {
00026     INT                 bits;
00027     LPBITMAPINFOHEADER  lpbi;
00028     LPBITMAPCOREHEADER  lpbc;
00029
00030     lpbi = ((LPBITMAPINFOHEADER)pv);
00031     lpbc = ((LPBITMAPCOREHEADER)pv);
00032
00033     /*  With the BITMAPINFO format headers, the size of the palette
00034      *  is in biClrUsed, whereas in the BITMAPCORE - style headers, it
00035      *  is dependent on the bits per pixel ( = 2 raised to the power of
00036      *  bits/pixel).
00037      */
00038     if (lpbi->biSize != sizeof(BITMAPCOREHEADER)){
00039         if (lpbi->biClrUsed != 0)
00040             return (WORD)lpbi->biClrUsed;
00041         bits = lpbi->biBitCount;
00042     }
00043     else
00044         bits = lpbc->bcBitCount;
00045
00046     switch (bits){
00047         case 1:
00048                 return 2;
00049         case 4:
00050                 return 16;
00051         case 8:
00052                 return 256;
00053         default:
00054                 /* A 24 bitcount DIB has no color table */
00055                 return 0;
00056     }
00057 }
00058
00059 /****************************************************************************
00060  *                                                                          *
00061  *  FUNCTION   : DibGetPaletteSize(VOID FAR * pv)                           *
00062  *                                                                          *
00063  *  PURPOSE    : Return the bitmap encoding type (8 bit, 24 bit...          *
00064  *               the BitCount filed in the info block.                      *
00065  *                                                                          *
00066  *  RETURNS    : the encoding type of the bitmap.                           *
00067  *                                                                          *
00068  ****************************************************************************/
00069 WORD DibGetPaletteSize (VOID FAR * pv)
00070 {
00071     INT                 bits;
00072     LPBITMAPINFOHEADER  lpbi;
00073     LPBITMAPCOREHEADER  lpbc;
00074
00075     lpbi = ((LPBITMAPINFOHEADER)pv);
00076     lpbc = ((LPBITMAPCOREHEADER)pv);
00077
00078     /*  With the BITMAPINFO format headers, the size of the palette
00079      *  is in biClrUsed, whereas in the BITMAPCORE - style headers, it
00080      *  is dependent on the bits per pixel ( = 2 raised to the power of
00081      *  bits/pixel).
00082      */
00083     if (lpbi->biSize != sizeof(BITMAPCOREHEADER))
00084         bits = lpbi->biBitCount;
00085     else
00086         bits = lpbc->bcBitCount;
00087
00088     return bits;
00089 }
00090
00091 /****************************************************************************
00092  *                                                                          *
00093  *  FUNCTION   :  DibCopyPalette(HBITMAP src, HBITMAP dst)                  *
00094  *                                                                          *
00095  *  PURPOSE    :  Copy the palette from src to dst if possible              *                                                                          *
00096  *                                                                          *
00097  ****************************************************************************/
00098 VOID
00099 DibCopyPalette(HBITMAP dst, HBITMAP src)
00100 {
00101     LPBITMAPINFO src_header, dst_header;
00102     RGBQUAD *src_rgb, *dst_rgb;
00103     WORD colorMode;
00104
00105     src_header = (LPBITMAPINFO) GlobalLock((HGLOBAL)src);
00106     dst_header = (LPBITMAPINFO) GlobalLock((HGLOBAL)dst);
00107
00108     src_rgb = (RGBQUAD FAR *)((LPSTR)src_header + (WORD)src_header->bmiHeader.biSize);
00109     dst_rgb = (RGBQUAD FAR *)((LPSTR)dst_header + (WORD)dst_header->bmiHeader.biSize);
00110
00111     colorMode = DibGetPaletteSize(src_header);
00112     switch(colorMode)
00113     {
00114         case 4:
00115         case 8:
00116             memcpy(dst_rgb, src_rgb,PaletteSize(&src_header->bmiHeader));
00117             break;
00118     }
00119
00120     GlobalUnlock((HGLOBAL)src);
00121     GlobalUnlock((HGLOBAL)dst);
00122 }
00123
00124 /****************************************************************************
00125  *                                                                          *
00126  *  FUNCTION   :  PaletteSize(VOID FAR * pv)                                *
00127  *                                                                          *
00128  *  PURPOSE    :  Calculates the palette size in bytes. If the info. block  *
00129  *                is of the BITMAPCOREHEADER type, the number of colors is  *
00130  *                multiplied by 3 to give the palette size, otherwise the   *
00131  *                number of colors is multiplied by 4.                                                          *
00132  *                                                                          *
00133  *  RETURNS    :  Palette size in number of bytes.                          *
00134  *                                                                          *
00135  ****************************************************************************/
00136 WORD PaletteSize (VOID FAR * pv)
00137 {
00138     LPBITMAPINFOHEADER lpbi;
00139     WORD               NumColors;
00140
00141     lpbi      = (LPBITMAPINFOHEADER)pv;
00142     NumColors = DibNumColors(lpbi);
00143
00144     if (lpbi->biSize == sizeof(BITMAPCOREHEADER))
00145         return (WORD)(NumColors * sizeof(RGBTRIPLE));
00146     else
00147         return (WORD)(NumColors * sizeof(RGBQUAD));
00148 }
00149
00150 /****************************************************************************
00151  *                                                                          *
00152  *  FUNCTION   : WriteMapFileHeaderandConvertFromDwordAlignToPacked(HFILE fh, LPBITMAPFILEHEADER pbf)
00153  *                                                                          *
00154  *  PURPOSE    : write header structure (which NOT packed) and write it PACKED
00155  *                                                                          *
00156  *  RETURNS    : VOID
00157  *                                                                          *
00158  ****************************************************************************/
00159
00160 VOID WriteMapFileHeaderandConvertFromDwordAlignToPacked(HFILE fh, LPBITMAPFILEHEADER pbf)
00161 {
00162
00163         /* write bfType*/
00164     _lwrite(fh, (LPSTR)&pbf->bfType, (UINT)sizeof (WORD));
00165         /* now pass over extra word, and only write next 3 DWORDS!*/
00166         _lwrite(fh, (LPSTR)&pbf->bfSize, sizeof(DWORD) * 3);
00167 }
00168
00169 /*************************************************************************
00170  *
00171  * CreateDIB()
00172  *
00173  * Parameters:
00174  *
00175  * DWORD dwWidth    - Width for new bitmap, in pixels
00176  * DWORD dwHeight   - Height for new bitmap
00177  * WORD  wBitCount  - Bit Count for new DIB (1, 4, 8, or 24)
00178  *
00179  * Return Value:
00180  *
00181  * HDIB             - Handle to new DIB
00182  *
00183  * Description:
00184  *
00185  * This function allocates memory for and initializes a new DIB by
00186  * filling in the BITMAPINFOHEADER, allocating memory for the color
00187  * table, and allocating memory for the bitmap bits.  As with all
00188  * HDIBs, the header, colortable and bits are all in one contiguous
00189  * memory block.  This function is similar to the CreateBitmap()
00190  * Windows API.
00191  *
00192  * The colortable and bitmap bits are left uninitialized (zeroed) in the
00193  * returned HDIB.
00194  *
00195  *
00196  * History:   Date      Author              Reason
00197  *            3/20/92   Mark Bader          Created
00198  *
00199  ************************************************************************/
00200
00201 HBITMAP CreateDIB(DWORD dwWidth, DWORD dwHeight, WORD wBitCount, HPALETTE hPal)
00202 {
00203     BITMAPINFOHEADER    bi;             /*  bitmap header */
00204     LPBITMAPINFOHEADER  lpbi;           /*  pointer to BITMAPINFOHEADER */
00205     DWORD               dwLen;          /*  size of memory block */
00206     HBITMAP             hDIB;
00207     DWORD               dwBytesPerLine; /*  Number of bytes per scanline */
00208
00209
00210     /*  Make sure bits per pixel is valid */
00211
00212     if (wBitCount <= 1)
00213         wBitCount = 1;
00214     else if (wBitCount <= 4)
00215         wBitCount = 4;
00216     else if (wBitCount <= 8)
00217         wBitCount = 8;
00218     else if (wBitCount <= 24)
00219         wBitCount = 24;
00220     else
00221         wBitCount = 4;  /*  set default value to 4 if parameter is bogus */
00222
00223     /*  initialize BITMAPINFOHEADER */
00224
00225     bi.biSize = sizeof(BITMAPINFOHEADER);
00226     bi.biWidth = dwWidth;         /*  fill in width from parameter */
00227     bi.biHeight = dwHeight;       /*  fill in height from parameter */
00228     bi.biPlanes = 1;              /*  must be 1 */
00229     bi.biBitCount = wBitCount;    /*  from parameter */
00230     bi.biCompression = BI_RGB;
00231     bi.biSizeImage = 0;           /*  0's here mean "default" */
00232     bi.biXPelsPerMeter = 0;
00233     bi.biYPelsPerMeter = 0;
00234     bi.biClrUsed = 0;
00235     bi.biClrImportant = 0;
00236
00237     /*  calculate size of memory block required to store the DIB.  This */
00238     /*  block should be big enough to hold the BITMAPINFOHEADER, the color */
00239     /*  table, and the bits */
00240
00241     dwBytesPerLine = WIDTHBYTES(wBitCount * dwWidth);
00242     dwLen = bi.biSize + PaletteSize((LPSTR)&bi) + (dwBytesPerLine * dwHeight);
00243
00244     /*  alloc memory block to store our bitmap */
00245
00246     hDIB = GlobalAlloc(GHND, dwLen);
00247
00248     /*  major bummer if we couldn't get memory block */
00249
00250     if (!hDIB)
00251         return NULL;
00252
00253     /*  lock memory and get pointer to it */
00254
00255     lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDIB);
00256
00257     /*  use our bitmap info structure to fill in first part of */
00258     /*  our DIB with the BITMAPINFOHEADER */
00259
00260     *lpbi = bi;
00261
00262     /*
00263      * Copy the palette in the new created image
00264      */
00265     if (wBitCount == 8)
00266     {
00267         PALETTEENTRY pal[256];
00268         RGBQUAD *pRgb;
00269         int i;
00270
00271         GetPaletteEntries(hPal, 0, 256, pal);
00272
00273         pRgb = (RGBQUAD FAR *)((LPSTR)lpbi + (WORD)lpbi->biSize);
00274
00275         /* Fill in the palette entries from the DIB color table and
00276          * create a logical color palette.
00277          */
00278         for (i = 0; i < 256; i++)
00279         {
00280             pRgb[i].rgbRed = pal[i].peRed;
00281             pRgb[i].rgbGreen = pal[i].peGreen;
00282             pRgb[i].rgbBlue = pal[i].peBlue;
00283         }
00284     }
00285
00286     // Since we don't know what the colortable and bits should contain,
00287     // just leave these blank.  Unlock the DIB and return the HDIB.
00288
00289     GlobalUnlock(hDIB);
00290
00291     //return handle to the DIB
00292
00293     return hDIB;
00294 }
00295
00296 /*************************************************************************
00297  *
00298  * Function:  ReadDIBFile (int)
00299  *
00300  *  Purpose:  Reads in the specified DIB file into a global chunk of
00301  *            memory.
00302  *
00303  *  Returns:  A handle to a dib (hDIB) if successful.
00304  *            NULL if an error occurs.
00305  *
00306  * Comments:  BITMAPFILEHEADER is stripped off of the DIB.  Everything
00307  *            from the end of the BITMAPFILEHEADER structure on is
00308  *            returned in the global memory handle.
00309  *
00310  *
00311  * NOTE: The DIB API were not written to handle OS/2 DIBs, so this
00312  * function will reject any file that is not a Windows DIB.
00313  *
00314  * History:   Date      Author       Reason
00315  *            9/15/91   Mark Bader   Based on DIBVIEW
00316  *            6/25/92   Mark Bader   Added check for OS/2 DIB
00317  *            7/21/92   Mark Bader   Added code to deal with bfOffBits
00318  *                                     field in BITMAPFILEHEADER
00319  *            9/11/92   Mark Bader   Fixed Realloc Code to free original mem
00320  *            1/25/94   Hung Nguyen  Changed file APIs to Win32 APIs
00321  *
00322  *************************************************************************/
00323
00324 HANDLE ReadDIBFile(HANDLE hFile)
00325 {
00326     BITMAPFILEHEADER    bmfHeader;
00327     DWORD               dwBitsSize;
00328     UINT                nNumColors;   /*  Number of colors in table */
00329     HANDLE              hDIB;
00330     HANDLE              hDIBtmp;      /*  Used for GlobalRealloc() //MPB */
00331     LPBITMAPINFOHEADER  lpbi;
00332     DWORD               offBits;
00333     DWORD               dwRead;
00334
00335     /*  get length of DIB in bytes for use when reading */
00336
00337     dwBitsSize = GetFileSize(hFile, NULL);
00338
00339     /*  Allocate memory for header & color table. We'll enlarge this */
00340     /*  memory as needed. */
00341
00342     hDIB = GlobalAlloc(GMEM_MOVEABLE, (DWORD)(sizeof(BITMAPINFOHEADER) +
00343             256 * sizeof(RGBQUAD)));
00344
00345     if (!hDIB)
00346         return NULL;
00347
00348     lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDIB);
00349
00350     if (!lpbi)
00351     {
00352         GlobalFree(hDIB);
00353         return NULL;
00354     }
00355
00356     /*  read the BITMAPFILEHEADER from our file */
00357
00358     if (!ReadFile(hFile, (LPSTR)&bmfHeader, sizeof (BITMAPFILEHEADER),
00359             &dwRead, NULL))
00360         goto ErrExit;
00361
00362     if (sizeof (BITMAPFILEHEADER) != dwRead)
00363         goto ErrExit;
00364
00365     if (bmfHeader.bfType != 0x4d42)  /*  'BM' */
00366         goto ErrExit;
00367
00368     /*  read the BITMAPINFOHEADER */
00369
00370     if (!ReadFile(hFile, (LPSTR)lpbi, sizeof(BITMAPINFOHEADER), &dwRead,
00371             NULL))
00372         goto ErrExit;
00373
00374     if (sizeof(BITMAPINFOHEADER) != dwRead)
00375         goto ErrExit;
00376
00377     /*  Check to see that it's a Windows DIB -- an OS/2 DIB would cause */
00378     /*  strange problems with the rest of the DIB API since the fields */
00379     /*  in the header are different and the color table entries are */
00380     /*  smaller. */
00381     /*  */
00382     /*  If it's not a Windows DIB (e.g. if biSize is wrong), return NULL. */
00383
00384     if (lpbi->biSize == sizeof(BITMAPCOREHEADER))
00385         goto ErrExit;
00386
00387     /*  Now determine the size of the color table and read it.  Since the */
00388     /*  bitmap bits are offset in the file by bfOffBits, we need to do some */
00389     /*  special processing here to make sure the bits directly follow */
00390     /*  the color table (because that's the format we are susposed to pass */
00391     /*  back) */
00392
00393     if (!(nNumColors = (UINT)lpbi->biClrUsed))
00394     {
00395         /*  no color table for 24-bit, default size otherwise */
00396
00397         if (lpbi->biBitCount != 24)
00398             nNumColors = 1 << lpbi->biBitCount; /*  standard size table */
00399     }
00400
00401     /*  fill in some default values if they are zero */
00402
00403     if (lpbi->biClrUsed == 0)
00404         lpbi->biClrUsed = nNumColors;
00405
00406     if (lpbi->biSizeImage == 0)
00407     {
00408         lpbi->biSizeImage = ((((lpbi->biWidth * (DWORD)lpbi->biBitCount) +
00409                 31) & ~31) >> 3) * lpbi->biHeight;
00410     }
00411
00412     /*  get a proper-sized buffer for header, color table and bits */
00413
00414     GlobalUnlock(hDIB);
00415     hDIBtmp = GlobalReAlloc(hDIB, lpbi->biSize + nNumColors *
00416             sizeof(RGBQUAD) + lpbi->biSizeImage, 0);
00417
00418     if (!hDIBtmp) /*  can't resize buffer for loading */
00419         goto ErrExitNoUnlock; /* MPB */
00420     else
00421         hDIB = hDIBtmp;
00422
00423     lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDIB);
00424
00425     /*  read the color table */
00426
00427     ReadFile (hFile, (LPSTR)(lpbi) + lpbi->biSize,
00428             nNumColors * sizeof(RGBQUAD), &dwRead, NULL);
00429
00430     /*  offset to the bits from start of DIB header */
00431
00432     offBits = lpbi->biSize + nNumColors * sizeof(RGBQUAD);
00433
00434     /*  If the bfOffBits field is non-zero, then the bits might *not* be */
00435     /*  directly following the color table in the file.  Use the value in */
00436     /*  bfOffBits to seek the bits. */
00437
00438     if (bmfHeader.bfOffBits != 0L)
00439         SetFilePointer(hFile, bmfHeader.bfOffBits, NULL, FILE_BEGIN);
00440
00441     if (ReadFile(hFile, (LPSTR)lpbi + offBits, lpbi->biSizeImage, &dwRead,
00442             NULL))
00443         goto OKExit;
00444
00445
00446 ErrExit:
00447     GlobalUnlock(hDIB);
00448
00449 ErrExitNoUnlock:
00450     GlobalFree(hDIB);
00451     return NULL;
00452
00453 OKExit:
00454     GlobalUnlock(hDIB);
00455     return hDIB;
00456 }
00457
00458 /*************************************************************************
00459  *
00460  * LoadDIB()
00461  *
00462  * Loads the specified DIB from a file, allocates memory for it,
00463  * and reads the disk file into the memory.
00464  *
00465  *
00466  * Parameters:
00467  *
00468  * LPSTR lpFileName - specifies the file to load a DIB from
00469  *
00470  * Returns: A handle to a DIB, or NULL if unsuccessful.
00471  *
00472  * NOTE: The DIB API were not written to handle OS/2 DIBs; This
00473  * function will reject any file that is not a Windows DIB.
00474  *
00475  * History:   Date      Author       Reason
00476  *            9/15/91   Mark Bader   Based on DIBVIEW
00477  *
00478  *************************************************************************/
00479
00480 HBITMAP LoadDIB(LPSTR lpFileName)
00481 {
00482     HBITMAP     hDIB;
00483     HANDLE      hFile;
00484
00485     if ((hFile = CreateFile(lpFileName, GENERIC_READ, FILE_SHARE_READ, NULL,
00486             OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
00487             NULL)) != INVALID_HANDLE_VALUE)
00488     {
00489         hDIB = ReadDIBFile(hFile);
00490         CloseHandle(hFile);
00491         return hDIB;
00492     }
00493     else
00494         return NULL;
00495 }
00496
00497 /*************************************************************************
00498  *
00499  * SaveBmpFromDDB()
00500  *
00501  * Saves the specified DDB into the specified file name on disk.
00502  *
00503  *************************************************************************/
00504
00505 BOOL
00506 SaveBmpFromDDB(HDC hDC, HBITMAP hBmp, PSTR pszFileName)
00507 {
00508     int         hFile;
00509     OFSTRUCT    ofReOpenBuff;
00510     HBITMAP     hTmpBmp, hBmpOld;
00511     BOOL        bSuccess;
00512     BITMAPFILEHEADER    bfh;
00513     PBITMAPINFO pbmi;
00514     PBYTE       pBits;
00515     BITMAPINFO  bmi;
00516     PBYTE pjTmp, pjTmpBmi;
00517     ULONG sizBMI;
00518
00519
00520     bSuccess = TRUE;
00521 #if 0
00522     if (ghPal) {
00523         SelectPalette(hDC, ghPal, FALSE);
00524         RealizePalette(hDC);
00525     }
00526 #endif
00527     if (!hBmp) {
00528         return FALSE;
00529     }
00530
00531     //
00532     // Let the graphics engine to retrieve the dimension of the bitmap for us
00533     // GetDIBits uses the size to determine if it's BITMAPCOREINFO or BITMAPINFO
00534     // if BitCount != 0, color table will be retrieved
00535     //
00536     bmi.bmiHeader.biSize = 0x28;              // GDI need this to work
00537     bmi.bmiHeader.biBitCount = 0;             // don't get the color table
00538     if ((GetDIBits(hDC, hBmp, 0, 0, (LPSTR)NULL, &bmi, DIB_RGB_COLORS)) == 0) {
00539         return FALSE;
00540     }
00541
00542     //
00543     // Now that we know the size of the image, alloc enough memory to retrieve
00544     // the actual bits
00545     //
00546     if ((pBits = (PBYTE)GlobalAlloc(GMEM_FIXED | GMEM_ZEROINIT,
00547                 bmi.bmiHeader.biSizeImage)) == NULL) {
00548         return FALSE;
00549     }
00550
00551     //
00552     // Note: 24 bits per pixel has no color table.  So, we don't have to
00553     // allocate memory for retrieving that.  Otherwise, we do.
00554     //
00555     pbmi = &bmi;                                      // assume no color table
00556
00557     switch (bmi.bmiHeader.biBitCount) {
00558         case 24:                                      // has color table
00559             sizBMI = sizeof(BITMAPINFOHEADER);
00560             break;
00561         case 16:
00562         case 32:
00563             sizBMI = sizeof(BITMAPINFOHEADER)+sizeof(DWORD)*3;
00564             break;
00565         default:
00566             sizBMI = sizeof(BITMAPINFOHEADER)+sizeof(RGBQUAD)*(1<<bmi.bmiHeader.biBitCount);
00567             break;
00568
00569     }
00570
00571     //
00572     // Allocate memory for color table if it is not 24bpp...
00573     //
00574     if (sizBMI != sizeof(BITMAPINFOHEADER)) {
00575         ULONG       sizTmp;
00576         //
00577         // I need more memory for the color table
00578         //
00579         if ((pbmi = (PBITMAPINFO)GlobalAlloc(GMEM_FIXED | GMEM_ZEROINIT, sizBMI )) == NULL) {
00580             bSuccess = FALSE;
00581             goto ErrExit1;
00582         }
00583         //
00584         // Now that we've a bigger chunk of memory, let's copy the Bitmap
00585         // info header data over
00586         //
00587         pjTmp = (PBYTE)pbmi;
00588         pjTmpBmi = (PBYTE)&bmi;
00589         sizTmp = sizeof(BITMAPINFOHEADER);
00590
00591         while(sizTmp--)
00592         {
00593             *(((PBYTE)pjTmp)++) = *((pjTmpBmi)++);
00594         }
00595     }
00596
00597     //
00598     // Let's open the file and get ready for writing
00599     //
00600     if ((hFile = OpenFile(pszFileName, (LPOFSTRUCT)&ofReOpenBuff,
00601                  OF_CREATE | OF_WRITE)) == -1) {
00602         goto ErrExit2;
00603     }
00604
00605     //
00606     // But first, fill in the info for the BitmapFileHeader
00607     //
00608     bfh.bfType = 0x4D42;                            // 'BM'
00609     bfh.bfSize = sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER)+sizBMI+
00610         pbmi->bmiHeader.biSizeImage;
00611     bfh.bfReserved1 =
00612     bfh.bfReserved2 = 0;
00613     bfh.bfOffBits = sizeof(BITMAPFILEHEADER)+sizBMI;
00614
00615     //
00616     // Write out the file header now
00617     //
00618     if (_lwrite(hFile, (LPSTR)&bfh, sizeof(BITMAPFILEHEADER)) == -1) {
00619         bSuccess = FALSE;
00620         goto ErrExit3;
00621     }
00622
00623     //
00624     // Bitmap can't be selected into a DC when calling GetDIBits
00625     // Assume that the hDC is the DC where the bitmap would have been selected
00626     // if indeed it has been selected
00627     //
00628     if (hTmpBmp = CreateCompatibleBitmap(hDC, pbmi->bmiHeader.biWidth, pbmi->bmiHeader.biHeight)) {
00629         hBmpOld = SelectObject(hDC, hTmpBmp);
00630         if ((GetDIBits(hDC, hBmp, 0, pbmi->bmiHeader.biHeight, (LPSTR)pBits, pbmi, DIB_RGB_COLORS))==0){
00631             bSuccess = FALSE;
00632             goto ErrExit4;
00633         }
00634     } else {
00635         bSuccess = FALSE;
00636         goto ErrExit3;
00637     }
00638
00639     //
00640     // Now write out the BitmapInfoHeader and color table, if any
00641     //
00642     if (_lwrite(hFile, (LPSTR)pbmi, sizBMI) == -1) {
00643         bSuccess = FALSE;
00644         goto ErrExit4;
00645     }
00646
00647     //
00648     // write the bits also
00649     //
00650     if (_lwrite(hFile, (LPSTR)pBits, pbmi->bmiHeader.biSizeImage) == -1) {
00651         bSuccess = FALSE;
00652         goto ErrExit4;
00653     }
00654
00655
00656 ErrExit4:
00657     SelectObject(hDC, hBmpOld);
00658     DeleteObject(hTmpBmp);
00659 ErrExit3:
00660     _lclose(hFile);
00661 ErrExit2:
00662     GlobalFree(pbmi);
00663 ErrExit1:
00664     GlobalFree(pBits);
00665     return bSuccess;
00666 }
00667
00668 /*************************************************************************
00669  *
00670  * SaveDIB()
00671  *
00672  * Saves the specified DIB into the specified file name on disk.  No
00673  * error checking is done, so if the file already exists, it will be
00674  * written over.
00675  *
00676  * Parameters:
00677  *
00678  * HDIB hDib - Handle to the dib to save
00679  *
00680  * LPSTR lpFileName - pointer to full pathname to save DIB under
00681  *
00682  * Return value: 0 if successful, or one of:
00683  *        ERR_INVALIDHANDLE
00684  *        ERR_OPEN
00685  *        ERR_LOCK
00686  *
00687  * History:
00688  *
00689  * NOTE: The DIB API were not written to handle OS/2 DIBs, so this
00690  * function will not save a file if it is not a Windows DIB.
00691  *
00692  * History:   Date      Author       Reason
00693  *            9/15/91   Mark Bader   Taken from DIBVIEW (which was taken
00694  *                                      from SHOWDIB)
00695  *            1/30/92   Mark Bader   Fixed problem of writing too many
00696  *                                      bytes to the file
00697  *            6/24/92   Mark Bader   Added check for OS/2 DIB
00698  *            2/1/94    Hung Nguyen  Changed file APIs to Win32 APIs
00699  *
00700  *************************************************************************/
00701
00702 BOOL SaveDIB(HBITMAP hDib, LPSTR lpFileName)
00703 {
00704     BITMAPFILEHEADER    bmfHdr;     /*  Header for Bitmap file */
00705     LPBITMAPINFOHEADER  lpBI;       /*  Pointer to DIB info structure */
00706     HANDLE              fh;         /*  file handle for opened file */
00707     DWORD               dwDIBSize;
00708     DWORD               dwWritten;
00709
00710     if (!hDib)
00711         return FALSE;
00712
00713     fh = CreateFile(lpFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
00714             FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
00715
00716     if (fh == INVALID_HANDLE_VALUE)
00717         return FALSE;
00718
00719     /*  Get a pointer to the DIB memory, the first of which contains */
00720     /*  a BITMAPINFO structure */
00721
00722     lpBI = (LPBITMAPINFOHEADER)GlobalLock(hDib);
00723     if (!lpBI)
00724     {
00725         CloseHandle(fh);
00726         return FALSE;
00727     }
00728
00729     /*  Check to see if we're dealing with an OS/2 DIB.  If so, don't */
00730     /*  save it because our functions aren't written to deal with these */
00731     /*  DIBs. */
00732
00733     if (lpBI->biSize != sizeof(BITMAPINFOHEADER))
00734     {
00735         GlobalUnlock(hDib);
00736         CloseHandle(fh);
00737         return FALSE;
00738     }
00739
00740     /*  Fill in the fields of the file header */
00741
00742     /*  Fill in file type (first 2 bytes must be "BM" for a bitmap) */
00743
00744     bmfHdr.bfType = DIB_HEADER_MARKER;  /*  "BM" */
00745
00746     /*  Calculating the size of the DIB is a bit tricky (if we want to */
00747     /*  do it right).  The easiest way to do this is to call GlobalSize() */
00748     /*  on our global handle, but since the size of our global memory may have */
00749     /*  been padded a few bytes, we may end up writing out a few too */
00750     /*  many bytes to the file (which may cause problems with some apps, */
00751     /*  like HC 3.0). */
00752     /*  */
00753     /*  So, instead let's calculate the size manually. */
00754     /*  */
00755     /*  To do this, find size of header plus size of color table.  Since the */
00756     /*  first DWORD in both BITMAPINFOHEADER and BITMAPCOREHEADER conains */
00757     /*  the size of the structure, let's use this. */
00758
00759     /*  Partial Calculation */
00760
00761     dwDIBSize = *(LPDWORD)lpBI + PaletteSize((LPSTR)lpBI);
00762
00763     /*  Now calculate the size of the image */
00764
00765     /*  It's an RLE bitmap, we can't calculate size, so trust the biSizeImage */
00766     /*  field */
00767
00768     if ((lpBI->biCompression == BI_RLE8) || (lpBI->biCompression == BI_RLE4))
00769         dwDIBSize += lpBI->biSizeImage;
00770     else
00771     {
00772         DWORD dwBmBitsSize;  /*  Size of Bitmap Bits only */
00773
00774         /*  It's not RLE, so size is Width (DWORD aligned) * Height */
00775
00776         dwBmBitsSize = WIDTHBYTES((lpBI->biWidth)*((DWORD)lpBI->biBitCount)) *
00777                 lpBI->biHeight;
00778
00779         dwDIBSize += dwBmBitsSize;
00780
00781         /*  Now, since we have calculated the correct size, why don't we */
00782         /*  fill in the biSizeImage field (this will fix any .BMP files which  */
00783         /*  have this field incorrect). */
00784
00785         lpBI->biSizeImage = dwBmBitsSize;
00786     }
00787
00788
00789     /*  Calculate the file size by adding the DIB size to sizeof(BITMAPFILEHEADER) */
00790
00791     bmfHdr.bfSize = dwDIBSize + sizeof(BITMAPFILEHEADER);
00792     bmfHdr.bfReserved1 = 0;
00793     bmfHdr.bfReserved2 = 0;
00794
00795     /*  Now, calculate the offset the actual bitmap bits will be in */
00796     /*  the file -- It's the Bitmap file header plus the DIB header, */
00797     /*  plus the size of the color table. */
00798
00799     bmfHdr.bfOffBits = (DWORD)sizeof(BITMAPFILEHEADER) + lpBI->biSize +
00800             PaletteSize((LPSTR)lpBI);
00801
00802     /*  Write the file header */
00803
00804     WriteFile(fh, (LPSTR)&bmfHdr, sizeof(BITMAPFILEHEADER), &dwWritten, NULL);
00805
00806     /*  Write the DIB header and the bits -- use local version of */
00807     /*  MyWrite, so we can write more than 32767 bytes of data */
00808
00809     WriteFile(fh, (LPSTR)lpBI, dwDIBSize, &dwWritten, NULL);
00810
00811     GlobalUnlock(hDib);
00812     CloseHandle(fh);
00813
00814     if (dwWritten == 0)
00815         return FALSE; /*  oops, something happened in the write */
00816     else
00817         return TRUE; /*  Success code */
00818 }
00819
00820
00821 /*************************************************************************
00822 /* The following functions were adapted from Microsoft examples sources
00823 /*************************************************************************/
00824
00825 /*************************************************************************
00826  *
00827  * CopyScreenToBitmap()
00828  *
00829  * Parameter:
00830  *
00831  * LPRECT lpRect    - specifies the window
00832  *
00833  * Return Value:
00834  *
00835  * HDIB             - identifies the device-dependent bitmap
00836  *
00837  * Description:
00838  *
00839  * This function copies the specified part of the screen to a device-
00840  * dependent bitmap.
00841  *
00842  * History:   Date      Author             Reason
00843  *            9/15/91   Patrick Schreiber  Created
00844  *            9/25/91   Patrick Schreiber  Added header and comments
00845  *
00846  ************************************************************************/
00847
00848 HBITMAP CopyScreenToBitmap(HWND win, LPRECT lpRect)
00849 {
00850     HDC         hScrDC, hMemDC;         /*  screen DC and memory DC */
00851     HBITMAP     hBitmap, hOldBitmap;    /*  handles to deice-dependent bitmaps */
00852     int         nX, nY, nX2, nY2;       /*  coordinates of rectangle to grab */
00853     int         nWidth, nHeight;        /*  DIB width and height */
00854     int         xScrn, yScrn;           /*  screen resolution */
00855     /*  check for an empty rectangle */
00856
00857     if (IsRectEmpty(lpRect))
00858       return NULL;
00859
00860     /*  create a DC for the screen and create */
00861     /*  a memory DC compatible to screen DC */
00862
00863     /* hScrDC = CreateDC("DISPLAY", NULL, NULL, NULL); */
00864     /* hMemDC = CreateCompatibleDC(hScrDC); */
00865     hScrDC = GetDC(win);
00866     hMemDC = CreateCompatibleDC (hScrDC);
00867     /*  get points of rectangle to grab */
00868
00869     nX = lpRect->left;
00870     nY = lpRect->top;
00871     nX2 = lpRect->right;
00872     nY2 = lpRect->bottom;
00873
00874     /*  get screen resolution */
00875
00876     xScrn = GetDeviceCaps(hScrDC, HORZRES);
00877     yScrn = GetDeviceCaps(hScrDC, VERTRES);
00878
00879     /* make sure bitmap rectangle is visible */
00880
00881     if (nX < 0)
00882         nX = 0;
00883     if (nY < 0)
00884         nY = 0;
00885     if (nX2 > xScrn)
00886         nX2 = xScrn;
00887     if (nY2 > yScrn)
00888         nY2 = yScrn;
00889
00890     nWidth = nX2 - nX;
00891     nHeight = nY2 - nY;
00892
00893     // create a bitmap compatible with the screen DC
00894     hBitmap = CreateCompatibleBitmap(hScrDC, nWidth, nHeight);
00895
00896     // select new bitmap into memory DC
00897     hOldBitmap = SelectObject(hMemDC, hBitmap);
00898
00899     // bitblt screen DC to memory DC
00900     BitBlt(hMemDC, 0, 0, nWidth, nHeight, hScrDC, nX, nY, SRCCOPY);
00901
00902     // select old bitmap back into memory DC and get handle to
00903     // bitmap of the screen
00904
00905     hBitmap = SelectObject(hMemDC, hOldBitmap);
00906
00907     // clean up
00908
00909     ReleaseDC(win, hScrDC);
00910     DeleteDC(hMemDC);
00911
00912     // return handle to the bitmap
00913
00914     return hBitmap;
00915 }
00916
00917
00918 HBITMAP
00919 DIBToBitmap(hDIB)
00920     HBITMAP hDIB;
00921 {
00922     LPSTR       lpDIBHdr, lpDIBBits;  // pointer to DIB header, pointer to DIB bits
00923     HBITMAP     hBitmap;            // handle to device-dependent bitmap
00924     HDC         hDC;                    // handle to DC
00925
00926     if (!hDIB)
00927         return NULL;
00928
00929     /* lock memory block and get a pointer to it */
00930     lpDIBHdr = GlobalLock(hDIB);
00931     lpDIBBits = lpDIBHdr + *(LPDWORD)lpDIBHdr + PaletteSize(lpDIBHdr);
00932
00933     /* get a DC */
00934     hDC = GetDC(NULL);
00935     if (!hDC)
00936     {
00937         GlobalUnlock(hDIB);
00938         return NULL;
00939     }
00940
00941     /* create bitmap from DIB info. and bits */
00942     hBitmap = CreateDIBitmap(hDC, (LPBITMAPINFOHEADER)lpDIBHdr, CBM_INIT,
00943             lpDIBBits, (LPBITMAPINFO)lpDIBHdr, DIB_RGB_COLORS);
00944
00945
00946     ReleaseDC(NULL, hDC);
00947     GlobalUnlock(hDIB);
00948     return hBitmap;
00949 }
00950
00951 /****************************************************************************
00952  *                                                                          *
00953  *  FUNCTION   : DibFromBitmap()                                            *
00954  *                                                                          *
00955  *  PURPOSE    : Will create a global memory block in DIB format that       *
00956  *               represents the Device-dependent bitmap (DDB) passed in.    *
00957  *                                                                          *
00958  *  RETURNS    : A handle to the DIB                                        *
00959  *                                                                          *
00960  ****************************************************************************/
00961 HANDLE
00962 DDBtoDIB(hbm, biBits, hPal)
00963     HBITMAP hbm;
00964     WORD biBits;
00965     HPALETTE hPal;
00966 {
00967     BITMAP               bm;
00968     BITMAPINFOHEADER     bi;
00969     BITMAPINFOHEADER FAR *lpbi;
00970     DWORD                dwLen;
00971     HANDLE               hdib;
00972     HANDLE               h;
00973     HDC                  hdc;
00974     HPALETTE oldPal;
00975
00976     if (!hbm)
00977         return NULL;
00978
00979     GetObject(hbm,sizeof(bm),(LPSTR)&bm);
00980
00981     if (biBits == 0)
00982         biBits =  bm.bmPlanes * bm.bmBitsPixel;
00983
00984     bi.biSize               = sizeof(BITMAPINFOHEADER);
00985     bi.biWidth              = bm.bmWidth;
00986     bi.biHeight             = bm.bmHeight;
00987     bi.biPlanes             = 1;
00988     bi.biBitCount           = biBits;
00989     bi.biCompression        = BI_RGB;
00990     bi.biSizeImage          = 0;
00991     bi.biXPelsPerMeter      = 0;
00992     bi.biYPelsPerMeter      = 0;
00993     bi.biClrUsed            = 0;
00994     bi.biClrImportant       = 0;
00995
00996     dwLen  = bi.biSize + PaletteSize(&bi);
00997
00998     hdc = GetDC(NULL);
00999     oldPal = SelectPalette(hdc, hPal, FALSE);
01000     RealizePalette(hdc);
01001
01002     hdib = GlobalAlloc(GHND,dwLen);
01003
01004     if (!hdib)
01005     {
01006         SelectPalette(hdc, oldPal, FALSE);
01007         ReleaseDC(NULL, hdc);
01008         return NULL;
01009     }
01010
01011     lpbi = (VOID FAR *)GlobalLock(hdib);
01012
01013     *lpbi = bi;
01014
01015     /*  call GetDIBits with a NULL lpBits param, so it will calculate the
01016      *  biSizeImage field for us
01017      */
01018     GetDIBits(hdc, hbm, 0L, (DWORD)bi.biHeight,
01019         (LPBYTE)NULL, (LPBITMAPINFO)lpbi, (DWORD)DIB_RGB_COLORS);
01020
01021     bi = *lpbi;
01022     GlobalUnlock(hdib);
01023
01024     /* If the driver did not fill in the biSizeImage field, make one up */
01025     if (bi.biSizeImage == 0)
01026         bi.biSizeImage = WIDTHBYTES((DWORD)bm.bmWidth * biBits) * bm.bmHeight;
01027
01028     /*  realloc the buffer big enough to hold all the bits */
01029     dwLen = bi.biSize + PaletteSize(&bi) + bi.biSizeImage;
01030
01031     if (h = GlobalReAlloc(hdib,dwLen,0))
01032         hdib = h;
01033     else
01034     {
01035         GlobalFree(hdib);
01036         hdib = NULL;
01037
01038         SelectPalette(hdc, oldPal, FALSE);
01039         ReleaseDC(NULL,hdc);
01040         return hdib;
01041     }
01042
01043     /*  call GetDIBits with a NON-NULL lpBits param, and actualy get the
01044      *  bits this time
01045      */
01046     lpbi = (VOID FAR *)GlobalLock(hdib);
01047
01048     if (GetDIBits( hdc,
01049                    hbm,
01050                    0L,
01051                    (DWORD)bi.biHeight,
01052                    (LPBYTE)lpbi + (WORD)lpbi->biSize + PaletteSize(lpbi),
01053                    (LPBITMAPINFO)lpbi, (DWORD)DIB_RGB_COLORS) == 0)
01054     {
01055          GlobalUnlock(hdib);
01056          hdib = NULL;
01057          SelectPalette(hdc, oldPal, FALSE);
01058          ReleaseDC(NULL,hdc);
01059          return NULL;
01060     }
01061
01062     bi = *lpbi;
01063     GlobalUnlock(hdib);
01064
01065     SelectPalette(hdc, oldPal, FALSE);
01066     ReleaseDC(NULL,hdc);
01067     return hdib;
01068 }
01069
01070 /*************************************************************************
01071  *
01072  * Function:  ReadDIBRsrc (int)
01073  *
01074  *  Purpose:  Reads in the specified DIB file into a global chunk of
01075  *            memory.
01076  *
01077  *  Returns:  A handle to a dib (hDIB) if successful.
01078  *            NULL if an error occurs.
01079  *
01080  * Comments:  BITMAPFILEHEADER is stripped off of the DIB.  Everything
01081  *            from the end of the BITMAPFILEHEADER structure on is
01082  *            returned in the global memory handle.
01083  *
01084  *
01085  * NOTE: The DIB API were not written to handle OS/2 DIBs, so this
01086  * function will reject any file that is not a Windows DIB.
01087  *
01088  * History:   Date      Author       Reason
01089  *            9/15/91   Mark Bader   Based on DIBVIEW
01090  *            6/25/92   Mark Bader   Added check for OS/2 DIB
01091  *            7/21/92   Mark Bader   Added code to deal with bfOffBits
01092  *                                     field in BITMAPFILEHEADER
01093  *            9/11/92   Mark Bader   Fixed Realloc Code to free original mem
01094  *            1/25/94   Hung Nguyen  Changed file APIs to Win32 APIs
01095  *
01096  *************************************************************************/
01097
01098 HANDLE ReadDIBRsrc(HINSTANCE hInst, HRSRC hRsrc )
01099 {
01100     BITMAPFILEHEADER    bmfHeader;
01101     DWORD               dwBitsSize;
01102     UINT                nNumColors;   /*  Number of colors in table */
01103     HANDLE              hDIB;
01104     HANDLE              hDIBtmp;      /*  Used for GlobalRealloc() //MPB */
01105     LPBITMAPINFOHEADER  lpbi;
01106     DWORD               offBits;
01107     LPSTR               rsrcptr, beginrsrc;
01108     HGLOBAL             hg;
01109
01110     /*  get length of DIB in bytes for use when reading */
01111
01112     hg = LoadResource(hInst, hRsrc);
01113     if(hg == NULL)
01114         return NULL;
01115
01116     beginrsrc = rsrcptr = LockResource(hg);
01117     dwBitsSize = SizeofResource(hInst, hRsrc);
01118
01119     /*  Allocate memory for header & color table. We'll enlarge this */
01120     /*  memory as needed. */
01121
01122     hDIB = GlobalAlloc(GMEM_MOVEABLE, (DWORD)(sizeof(BITMAPINFOHEADER) +
01123             256 * sizeof(RGBQUAD)));
01124
01125     if (!hDIB)
01126         goto ErrExitRsrc;
01127
01128     lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDIB);
01129
01130     if (!lpbi)
01131     {
01132         GlobalFree(hDIB);
01133         goto ErrExitRsrc;
01134     }
01135
01136     /*  read the BITMAPFILEHEADER from our file */
01137
01138     memcpy(&bmfHeader, rsrcptr, sizeof (BITMAPFILEHEADER));
01139     rsrcptr += sizeof (BITMAPFILEHEADER);
01140
01141     if (bmfHeader.bfType != 0x4d42)  /*  'BM' */
01142         goto ErrExit;
01143
01144     /*  read the BITMAPINFOHEADER */
01145
01146     memcpy(lpbi, rsrcptr, sizeof(BITMAPINFOHEADER));
01147     rsrcptr += sizeof (BITMAPINFOHEADER);
01148
01149     /*  Check to see that it's a Windows DIB -- an OS/2 DIB would cause */
01150     /*  strange problems with the rest of the DIB API since the fields */
01151     /*  in the header are different and the color table entries are */
01152     /*  smaller. */
01153     /*  */
01154     /*  If it's not a Windows DIB (e.g. if biSize is wrong), return NULL. */
01155
01156     if (lpbi->biSize == sizeof(BITMAPCOREHEADER))
01157         goto ErrExit;
01158
01159     /*  Now determine the size of the color table and read it.  Since the */
01160     /*  bitmap bits are offset in the file by bfOffBits, we need to do some */
01161     /*  special processing here to make sure the bits directly follow */
01162     /*  the color table (because that's the format we are susposed to pass */
01163     /*  back) */
01164
01165     if (!(nNumColors = (UINT)lpbi->biClrUsed))
01166     {
01167         /*  no color table for 24-bit, default size otherwise */
01168
01169         if (lpbi->biBitCount != 24)
01170             nNumColors = 1 << lpbi->biBitCount; /*  standard size table */
01171     }
01172
01173     /*  fill in some default values if they are zero */
01174
01175     if (lpbi->biClrUsed == 0)
01176         lpbi->biClrUsed = nNumColors;
01177
01178     if (lpbi->biSizeImage == 0)
01179     {
01180         lpbi->biSizeImage = ((((lpbi->biWidth * (DWORD)lpbi->biBitCount) +
01181                 31) & ~31) >> 3) * lpbi->biHeight;
01182     }
01183
01184     /*  get a proper-sized buffer for header, color table and bits */
01185
01186     GlobalUnlock(hDIB);
01187     hDIBtmp = GlobalReAlloc(hDIB, lpbi->biSize + nNumColors *
01188             sizeof(RGBQUAD) + lpbi->biSizeImage, 0);
01189
01190     if (!hDIBtmp) /*  can't resize buffer for loading */
01191         goto ErrExitNoUnlock; /* MPB */
01192     else
01193         hDIB = hDIBtmp;
01194
01195     lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDIB);
01196
01197     /*  read the color table */
01198
01199     memcpy((LPSTR)(lpbi) + lpbi->biSize, rsrcptr, nNumColors * sizeof(RGBQUAD));
01200     rsrcptr += nNumColors * sizeof(RGBQUAD);
01201
01202     /*  offset to the bits from start of DIB header */
01203     offBits = lpbi->biSize + nNumColors * sizeof(RGBQUAD);
01204
01205     /*  If the bfOffBits field is non-zero, then the bits might *not* be */
01206     /*  directly following the color table in the file.  Use the value in */
01207     /*  bfOffBits to seek the bits. */
01208
01209     if (bmfHeader.bfOffBits != 0L)
01210         rsrcptr = beginrsrc + bmfHeader.bfOffBits;
01211
01212     memcpy((LPSTR)lpbi + offBits, rsrcptr, lpbi->biSizeImage);
01213     goto OKExit;
01214
01215 ErrExit:
01216     GlobalUnlock(hDIB);
01217
01218 ErrExitNoUnlock:
01219     GlobalFree(hDIB);
01220 ErrExitRsrc:
01221     FreeResource(hg);
01222     return NULL;
01223
01224 OKExit:
01225     FreeResource(hg);
01226     GlobalUnlock(hDIB);
01227     return hDIB;
01228 }
Generated on Sun Feb 24 01:21:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/mfc/dib.h Source File

rf/support/mfc/dib.h

Go to the documentation of this file.
00001 #ifndef DIB_H
00002 #define DIB_H
00003
00004 #define DIB_HEADER_MARKER   ((WORD) ('M' << 8) | 'B')
00005 /* Macro to determine to round off the given value to the closest byte */
00006 #define WIDTHBYTES(i)   ((i+31)/32*4)
00007 #define WIDTHBYTES16(i)   ((i+15)/16*2)
00008 #define WIDTHBYTES8(i)   ((i+7)/8)
00009
00010 /* Pour les Bitmaps, surchage de Alloc() et utilisation
00011  * de l'allocateur Windows GlobalAlloc() pour afficher des
00012  * bitmaps > 64 Ko sous Windows 3.1.
00013  */
00014
00015 #define BM_ALLOC(nb, size) GlobalAllocPtr( GHND, (nb)*(size) )
00016 #define BM_FREE(ptr) GlobalFreePtr(ptr)
00017
00018 #define BFT_BITMAP 0x4d42   /* 'BM' */
00019
00020 /*****************************************************/
00021 /* make new sizeof structs to cover dword alignment  */
00022 /*****************************************************/
00023
00024 #define SIZEOF_BITMAPFILEHEADER_PACKED  (   \
00025     sizeof(WORD) +      /* bfType      */   \
00026     sizeof(DWORD) +     /* bfSize      */   \
00027     sizeof(WORD) +      /* bfReserved1 */   \
00028     sizeof(WORD) +      /* bfReserved2 */   \
00029     sizeof(DWORD))      /* bfOffBits   */
00030
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034
00035 /* Prototypes */
00036 VOID DibCopyPalette(HBITMAP , HBITMAP );
00037 WORD PaletteSize (VOID FAR *);
00038 WORD DibNumColors (VOID FAR *);
00039 WORD DibGetPaletteSize (VOID FAR *);
00040 VOID WriteMapFileHeaderandConvertFromDwordAlignToPacked(HFILE, LPBITMAPFILEHEADER);
00041 HANDLE ReadDIBFile(HANDLE);
00042 HANDLE ReadDIBRsrc(HINSTANCE, HRSRC);
00043 HBITMAP LoadDIB(LPSTR);
00044 BOOL SaveDIB(HBITMAP, LPSTR);
00045 HBITMAP CreateDIB(DWORD, DWORD, WORD, HPALETTE);
00046 HBITMAP CopyScreenToBitmap(HWND, LPRECT);
00047 HBITMAP DIBToBitmap(HBITMAP);
00048 HANDLE DDBtoDIB(HBITMAP, WORD, HPALETTE);
00049 BOOL SaveBmpFromDDB(HDC, HBITMAP, PSTR);
00050
00051 #ifdef __cplusplus
00052 }
00053 #endif
00054
00055 #endif /* DIB_H */
Generated on Sun Feb 24 01:21:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/mfc/PseudoButton.cpp Source File

rf/support/mfc/PseudoButton.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00018
00019 /*
00020  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00021  */
00022
00023 #include "stdafx.h"
00024 #include "umain.h"
00025 #include "PseudoButton.h"
00026 #include "dib.h"
00027 #include <map>
00028 #include <string.h>
00029
00030 #ifdef _DEBUG
00031 #define new DEBUG_NEW
00032 #undef THIS_FILE
00033 static char THIS_FILE[] = __FILE__;
00034 #endif
00035
00037 // CPseudoButton
00038
00039 IMPLEMENT_DYNAMIC(CPseudoButton, CCJFlatButton)
00040
00041 CPseudoButton::CPseudoButton() : m_bitmap(0L), m_disbitmap(0L)
00042 {
00043 }
00044
00045 CPseudoButton::~CPseudoButton()
00046 {
00047     if(m_bitmap != 0L)
00048         AfxDeleteObject((HGDIOBJ*)&m_bitmap);
00049     if(m_disbitmap != 0L)
00050         AfxDeleteObject((HGDIOBJ*)&m_disbitmap);
00051 }
00052
00053 void CPseudoButton::DrawItem(LPDRAWITEMSTRUCT lpDIS)
00054 {
00055     BOOL oldFlag = m_bFlatLook;
00056     if(lpDIS->itemState & ODS_DISABLED)
00057         m_bFlatLook = true;
00058     CCJFlatButton::DrawItem(lpDIS);
00059     m_bFlatLook = oldFlag;
00060 }
00061
00062 bool CPseudoButton::loadIcon(CString & icon, int rsrcid)
00063 {
00064     icon = "";
00065     bool res = false;
00066
00067     HINSTANCE inst = ::AfxGetResourceHandle();
00068     HRSRC hRsrc = FindResource(inst, MAKEINTRESOURCE(rsrcid), "CICN");
00069     if (hRsrc != 0L)
00070     {
00071         HGLOBAL hg = LoadResource(inst, hRsrc);
00072         if (hg != 0L)
00073         {
00074             DWORD size = SizeofResource(inst, hRsrc);
00075             char *rsrcptr = (char *)LockResource(hg);
00076             icon = CString(rsrcptr, size);
00077             FreeResource(hg);
00078             res = true;
00079         }
00080     }
00081
00082     return res;
00083 }
00084
00085 bool CPseudoButton::LoadXPM(int rsrcid)
00086 {
00087     CString sicon;
00088
00089     if(!CPseudoButton::loadIcon(sicon, rsrcid))
00090         return false;
00091
00092     COLORREF back = ::GetSysColor(COLOR_BTNFACE);
00093     COLORREF fore = ::GetSysColor(COLOR_GRAYTEXT);
00094
00095     int w, h;
00096     HBITMAP bmap = UMakeBitmap((const char *)sicon, w, h, DD_PIXMAP, back, fore);
00097     if(bmap == 0L)
00098         return false;
00099
00100     SetBitmap(bmap);
00101     if(m_bitmap != 0L)
00102         AfxDeleteObject((HGDIOBJ*)&m_bitmap);
00103     m_bitmap = bmap;
00104
00105     bmap = UMakeBitmap((const char *)sicon, w, h, DD_PIXMAP, back, fore, false);
00106     if(bmap == 0L)
00107         return false;
00108     if(m_disbitmap != 0L)
00109         AfxDeleteObject((HGDIOBJ*)&m_disbitmap);
00110     m_disbitmap = bmap;
00111     return true;
00112 }
00113
00114 void CPseudoButton::DrawButtonBitmap(CDC* pDC, UINT nState, CRect& rcItem)
00115 {
00116     // get the handle to the bitmap (if any) associated
00117     // with this button.
00118     HBITMAP hBitmap = GetBitmap();
00119     if( hBitmap == NULL ) {
00120         return;
00121     }
00122
00123     CRect rc = rcItem;
00124
00125     // if the button is selected.
00126     if( nState & ODS_SELECTED ) {
00127         rcItem.OffsetRect(1,1);
00128     }
00129
00130     // draw the bitmap associated with this button.
00131     if((nState & ODS_DISABLED) != 0 && m_disbitmap != 0L)
00132         pDC->DrawState( rc.TopLeft(), rc.Size(), m_disbitmap,
00133             DSS_NORMAL, (HBRUSH)NULL );
00134     else if(m_bitmap != 0L)
00135         pDC->DrawState( rc.TopLeft(), rc.Size(), m_bitmap,
00136             DSS_NORMAL, (HBRUSH)NULL );
00137     else
00138         pDC->DrawState( rc.TopLeft(), rc.Size(), hBitmap,
00139             ( nState & ODS_DISABLED )?DSS_DISABLED:DSS_NORMAL, (HBRUSH)NULL );
00140 }
00141
00142 BEGIN_MESSAGE_MAP(CPseudoButton, CCJFlatButton)
00143     //{{AFX_MSG_MAP(CPseudoButton)
00144     //}}AFX_MSG_MAP
00145 END_MESSAGE_MAP()
00146
00148 // CPseudoRotButton
00149
00150 IMPLEMENT_DYNAMIC(CPseudoRotButton, CPseudoButton)
00151
00152 CPseudoRotButton::CPseudoRotButton() : m_curindex(-1)
00153 {
00154 }
00155
00156 CPseudoRotButton::~CPseudoRotButton()
00157 {
00158     m_bitmap = 0L;
00159     m_disbitmap = 0L;
00160     std::vector<HBITMAP>::iterator i;
00161     for(i = m_bitmaps.begin(); i != m_bitmaps.end(); ++i)
00162     {
00163         HBITMAP bmap = *i;
00164         AfxDeleteObject((HGDIOBJ*)&bmap);
00165     }
00166     for(i = m_disbitmaps.begin(); i != m_disbitmaps.end(); ++i)
00167     {
00168         HBITMAP bmap = *i;
00169         AfxDeleteObject((HGDIOBJ*)&bmap);
00170     }
00171 }
00172
00173 bool CPseudoRotButton::LoadXPMs(const int *rsrcid, int numrsrc)
00174 {
00175     CString sicon;
00176     COLORREF back = ::GetSysColor(COLOR_BTNFACE);
00177     COLORREF fore = ::GetSysColor(COLOR_GRAYTEXT);
00178
00179     for(int i = 0; i < numrsrc; i++)
00180     {
00181         if(!CPseudoButton::loadIcon(sicon, rsrcid[i]))
00182             return false;
00183
00184         int w, h;
00185         HBITMAP bmap = UMakeBitmap((const char *)sicon, w, h, DD_PIXMAP, back, fore);
00186         if(bmap == 0L)
00187             return false;
00188
00189         HBITMAP disbmap = UMakeBitmap((const char *)sicon, w, h, DD_PIXMAP, back, fore, false);
00190         if(disbmap == 0L)
00191             return false;
00192
00193         m_bitmaps.push_back(bmap);
00194         m_disbitmaps.push_back(disbmap);
00195     }
00196
00197     DoRotate(0);
00198     return true;
00199 }
00200
00201 void CPseudoRotButton::DoRotate(int index)
00202 {
00203     if(index < 0 || index > m_bitmaps.size() || index > m_disbitmaps.size() ||
00204         m_curindex == index)
00205         return;
00206
00207     SetBitmap(m_bitmaps[index]);
00208     Invalidate(TRUE);
00209     m_curindex = index;
00210     m_bitmap = m_bitmaps[index];
00211     m_disbitmap = m_disbitmaps[index];
00212 }
00213
00214 BEGIN_MESSAGE_MAP(CPseudoRotButton, CPseudoButton)
00215     //{{AFX_MSG_MAP(CPseudoRotButton)
00216     //}}AFX_MSG_MAP
00217 END_MESSAGE_MAP()
00218
00220
00221 IMPLEMENT_DYNAMIC(CPseudoToggle, CPseudoButton)
00222
00223 CPseudoToggle::CPseudoToggle()
00224 {
00225     m_flag = 0;
00226     m_radio = false;
00227 }
00228
00229 CPseudoToggle::~CPseudoToggle()
00230 {
00231 }
00232
00233 void CPseudoToggle::SetState(int state)
00234 {
00235     int newstate = state ? 1 : 0;
00236     if(m_flag == newstate)
00237         return;
00238
00239     m_flag = newstate;
00240     Invalidate(TRUE);
00241
00242     if(state && IsRadio() && !m_group.IsEmpty())
00243     {
00244         CWnd *hwndChild, *parent = GetParent();
00245         for (hwndChild = parent->GetTopWindow(); hwndChild != 0L; hwndChild = hwndChild->GetNextWindow())
00246         {
00247             if(hwndChild != this && hwndChild->IsWindowEnabled() && hwndChild->IsKindOf(RUNTIME_CLASS(CPseudoToggle)))
00248             {
00249                 CPseudoToggle *btn = (CPseudoToggle *)hwndChild;
00250                 if(btn->IsRadio() && m_group == btn->GetGroup())
00251                 {
00252                     btn->SetState(0);
00253                     break;
00254                 }
00255             }
00256         }
00257     }
00258 }
00259
00260 void CPseudoToggle::DrawItem(LPDRAWITEMSTRUCT lpDIS)
00261 {
00262     if(m_flag)
00263         lpDIS->itemState |= ODS_SELECTED;
00264     CPseudoButton::DrawItem(lpDIS);
00265 }
00266
00267 void CPseudoToggle::OnLButtonUp(UINT nFlags, CPoint point)
00268 {
00269     CRect rect;
00270     GetClientRect(&rect);
00271
00272     //check you are still on the button
00273     if(PtInRect(rect, point))
00274         ToggleBtn();
00275
00276     CPseudoButton::OnLButtonUp(nFlags, point);
00277 }
00278
00279 BEGIN_MESSAGE_MAP(CPseudoToggle, CPseudoButton)
00280     //{{AFX_MSG_MAP(CPseudoToggle)
00281     ON_WM_LBUTTONUP()
00282     //}}AFX_MSG_MAP
00283 END_MESSAGE_MAP()
00284
00285 static const BYTE *nextLine(const BYTE *src, CString & line)
00286 {
00287     const char *tmp = strchr((const char *)src, '\n');
00288     if(tmp == 0L)
00289         return 0L;
00290
00291     line = CString((const char *)src, tmp - (const char *)src - 1);
00292     src = (const BYTE *)tmp + 1;
00293     return src;
00294 }
00295
00296 HBITMAP UMakeBitmap(const void *icon, int & width, int & height, UTB_KIND kind,
00297                     COLORREF back, COLORREF fore, bool enabled)
00298 {
00299     if( kind == DD_BMAP)
00300     {
00301         HBITMAP hbitmap;
00302         LPBITMAPINFO header;
00303         BYTE *image, *src = (BYTE *)icon, c, k;
00304         RGBQUAD *pRgb;
00305
00306         hbitmap = CreateDIB(width, height, 1, 0L);
00307         header = (LPBITMAPINFO)GlobalLock(hbitmap);
00308         image = (LPBYTE)header + header->bmiHeader.biSize + PaletteSize(header);
00309         pRgb = (RGBQUAD *)((LPBYTE)header + header->bmiHeader.biSize);
00310
00311         pRgb->rgbRed = GetRValue(back);
00312         pRgb->rgbGreen = GetGValue(back);
00313         pRgb->rgbBlue = GetBValue(back);
00314         pRgb->rgbReserved = 0;
00315         pRgb++;
00316         pRgb->rgbRed = GetRValue(fore);
00317         pRgb->rgbGreen = GetGValue(fore);
00318         pRgb->rgbBlue = GetBValue(fore);
00319         pRgb->rgbReserved = 0;
00320
00321         int row = WIDTHBYTES(width * 1);
00322         int row2 = WIDTHBYTES8(width * 1);
00323         for(int y = 0; y < height; y++)
00324         {
00325             BYTE *ptr = image + row * (height - y - 1);
00326             for(int x = 0; x < row2; x++)
00327             {
00328                 c = *src++;
00329                 k = 0;
00330                 int n = 8;
00331                 while(n--)
00332                 {
00333                     if(c & 1)
00334                         k |= 1 << n;
00335                     c = c >> 1;
00336                 }
00337                 *ptr++ = k;
00338             }
00339         }
00340
00341         GlobalUnlock(hbitmap);
00342
00343         HBITMAP ddbbmap = DIBToBitmap(hbitmap);
00344         GlobalFree((HGLOBAL)hbitmap);
00345
00346         return ddbbmap;
00347     }
00348     else if(kind == DD_PIXMAP)
00349     {
00350         const BYTE *src = (BYTE *)icon;
00351         CString aline;
00352
00353         src = nextLine(src, aline);
00354         if(src == 0L)
00355             return 0L;
00356
00357         // read the header
00358         int w, h, nc, cpp, i, x, y;
00359         if(sscanf(aline, "%d%d%d%d", &w, &h, &nc, &cpp) != 4)
00360             return 0L;
00361
00362         width = w;
00363         height = h;
00364
00365         HBITMAP hbitmap = CreateDIB(w, h, 8, 0L);
00366         LPBITMAPINFO header = (LPBITMAPINFO)GlobalLock(hbitmap);
00367         BYTE *image = (LPBYTE)header + header->bmiHeader.biSize + PaletteSize(header);
00368         RGBQUAD *pRgb = (RGBQUAD *)((LPBYTE)header + header->bmiHeader.biSize);
00369
00370         // read the colormap
00371         std::map<short, BYTE> colors;
00372         for(i = 0; i < nc; i++)
00373         {
00374             src = nextLine(src, aline);
00375             if(src == 0L)
00376                 return 0L;
00377
00378             const BYTE *line = (const BYTE *)(const char *)aline;
00379             short aref;
00380             if(cpp == 1)
00381             {
00382                 aref = line[0];
00383                 line += 1;
00384             }
00385             else if(cpp == 2)
00386             {
00387                 aref = ((short)line[1] << 8)  | line[0];
00388                 line += 2;
00389             }
00390             else
00391             {
00392                 ASSERT(0);
00393                 return 0L;
00394             }
00395
00396             while(isspace(*line) && *line)
00397                 line++;
00398             if(*line++ != 'c')
00399                 return 0L;
00400
00401             while(isspace(*line) && *line)
00402                 line++;
00403             if(*line == '\0')
00404                 return 0L;
00405
00406             if(*line == '#')
00407             {
00408                 line++;
00409
00410                 if(strlen((char *)line) < 6)
00411                     return 0L;
00412
00413                 int comp[6], c;
00414                 int j;
00415                 for(j = 0; j < 6; j++)
00416                 {
00417                     c = *line++;
00418                     if(c >= '0' && c <= '9')
00419                         comp[j] = c - '0';
00420                     else if(c >= 'a' && c <= 'f')
00421                         comp[j] = c - 'a' + 10;
00422                     else if(c >= 'A' && c <= 'F')
00423                         comp[j] = c - 'A' + 10;
00424                     else
00425                         return 0L;
00426                 }
00427
00428                 colors.insert(std::make_pair(aref, i));
00429
00430                 if(i == 0)
00431                 {
00432                     COLORREF bk = back;
00433                     pRgb->rgbRed = GetRValue(bk);
00434                     pRgb->rgbGreen = GetGValue(bk);
00435                     pRgb->rgbBlue = GetBValue(bk);
00436                     pRgb->rgbReserved = 0;
00437                 }
00438                 else
00439                 {
00440                     COLORREF color = RGB(comp[0]*16+comp[1],comp[2]*16+comp[3],comp[4]*16+comp[5]);
00441                     if(!enabled)
00442                         color = fore;
00443                     pRgb->rgbRed = GetRValue(color);
00444                     pRgb->rgbGreen = GetGValue(color);
00445                     pRgb->rgbBlue = GetBValue(color);
00446                     pRgb->rgbReserved = 0;
00447                 }
00448             }
00449             else if(strcmp((char *)line, "None") == 0)
00450             {
00451                 colors.insert(std::make_pair(aref, i));
00452                 COLORREF bk = back;
00453                 pRgb->rgbRed = GetRValue(bk);
00454                 pRgb->rgbGreen = GetGValue(bk);
00455                 pRgb->rgbBlue = GetBValue(bk);
00456                 pRgb->rgbReserved = 0;
00457             }
00458             else
00459                 return 0L;
00460             pRgb++;
00461         }
00462
00463         if(nc != colors.size() || nc > 256)
00464             return 0L;
00465
00466         // make the bitmap
00467         for(y = 0; y < h; y++)
00468         {
00469             src = nextLine(src, aline);
00470             if(src == 0L)
00471                 return 0L;
00472
00473             const BYTE *line = (const BYTE *)(const char *)aline;
00474             BYTE *ptr = image + WIDTHBYTES(w * 8) * (h - y - 1);
00475             for(x = 0; x < w; x++)
00476             {
00477                 short aref;
00478                 if(cpp == 1)
00479                 {
00480                     aref = line[0];
00481                     line++;
00482                 }
00483                 else if(cpp == 2)
00484                 {
00485                     aref = ((short)line[1] << 8)  | line[0];
00486                     line += 2;
00487                 }
00488                 std::map<short, BYTE>::iterator pos = colors.find(aref);
00489                 if(pos == colors.end())
00490                     return 0L;
00491                 *ptr++ = (*pos).second;
00492             }
00493         }
00494
00495         GlobalUnlock(hbitmap);
00496
00497         HBITMAP ddbbmap = DIBToBitmap(hbitmap);
00498         GlobalFree((HGLOBAL)hbitmap);
00499
00500         return ddbbmap;
00501     }
00502     else if(kind == DD_RGB)
00503     {
00504         BYTE *src = (BYTE *)icon;
00505
00506         // read the header
00507         int w = width, h = height, x, y;
00508
00509         HBITMAP hbitmap = CreateDIB(w, h, 24, 0L);
00510         LPBITMAPINFO header = (LPBITMAPINFO)GlobalLock(hbitmap);
00511         BYTE *image = (LPBYTE)header + header->bmiHeader.biSize + PaletteSize(header);
00512
00513         // make the bitmap
00514         for(y = 0; y < h; y++)
00515         {
00516 #if 0
00517             BYTE *ptr = image + WIDTHBYTES(w * 24) * (h - y - 1);
00518 #else
00519             BYTE *ptr = image + WIDTHBYTES(w * 24) * y;
00520 #endif
00521             for(x = 0; x < w; x++)
00522             {
00523                 ptr[2] = *src++;
00524                 ptr[1] = *src++;
00525                 ptr[0] = *src++;
00526                 ptr += 3;
00527                 src++;
00528             }
00529         }
00530
00531         GlobalUnlock(hbitmap);
00532
00533         HBITMAP ddbbmap = DIBToBitmap(hbitmap);
00534         GlobalFree((HGLOBAL)hbitmap);
00535
00536         return ddbbmap;
00537     }
00538
00539     return 0L;
00540 }
00541
00542 HBITMAP UMakeBitmap(const void *icon, int width, int height, UTB_KIND kind, bool enabled)
00543 {
00544     return UMakeBitmap(icon, width, height, kind,
00545         ::GetSysColor(COLOR_BTNFACE), ::GetSysColor(COLOR_BTNTEXT), enabled);
00546 }
Generated on Sun Feb 24 01:21:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/mfc/PseudoButton.h Source File

rf/support/mfc/PseudoButton.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 // CPseudoButton window
00022
00023 #ifndef PSEUDOBUTTON_H
00024 #define PSEUDOBUTTON_H
00025
00026 #include <vector>
00027
00028 typedef enum
00029 {
00030     DD_END,
00031     DD_PIXMAP,  /* X11 pixmap (color indexed) */
00032     DD_BMAP,    /* X11 bitmap (B&W) */
00033     DD_RGB      /* RGB / char */
00034 } UTB_KIND;
00035
00036 HBITMAP UMakeBitmap(const void *icon, int & width, int & height, UTB_KIND kind,
00037                     COLORREF back, COLORREF fore, bool enabled = true);
00038
00039 HBITMAP UMakeBitmap(const void *icon, int width, int height, UTB_KIND kind, bool enabled = true);
00040
00041 class CPseudoButton : public CCJFlatButton
00042 {
00043     DECLARE_DYNAMIC(CPseudoButton)
00044
00045 // Construction
00046 public:
00047     CPseudoButton();
00048
00049     virtual bool LoadXPM(int rsrcid);
00050         // return false if it fails
00051
00052     static bool loadIcon(CString & icon, int rsrcid);
00053
00054     virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
00055
00056 // Attributes
00057 protected:
00058     HBITMAP m_bitmap;
00059     HBITMAP m_disbitmap;
00060
00061 // Operations
00062 public:
00063
00064 // Overrides
00065     // ClassWizard generated virtual function overrides
00066     //{{AFX_VIRTUAL(CPseudoButton)
00067     //}}AFX_VIRTUAL
00068
00069 // Implementation
00070 public:
00071     virtual ~CPseudoButton();
00072
00073     // Generated message map functions
00074 protected:
00075     virtual void DrawButtonBitmap(CDC* pDC, UINT nState, CRect& rcItem);
00076
00077     //{{AFX_MSG(CPseudoButton)
00078     //}}AFX_MSG
00079
00080     DECLARE_MESSAGE_MAP()
00081 };
00082
00084
00085 class CPseudoRotButton : public CPseudoButton
00086 {
00087     DECLARE_DYNAMIC(CPseudoRotButton)
00088
00089 // Construction
00090 public:
00091     CPseudoRotButton();
00092
00093 // Attributes
00094 protected:
00095     std::vector<HBITMAP> m_bitmaps;
00096     std::vector<HBITMAP> m_disbitmaps;
00097     int m_curindex;
00098
00099 // Operations
00100 public:
00101     virtual bool LoadXPMs(const int *rsrcid, int numrsrc);
00102
00103     virtual void DoRotate(int index);
00104     inline int GetCurrent(void) const { return m_curindex; }
00105
00106 // Overrides
00107     // ClassWizard generated virtual function overrides
00108     //{{AFX_VIRTUAL(CPseudoRotButton)
00109     //}}AFX_VIRTUAL
00110
00111 // Implementation
00112 public:
00113     virtual ~CPseudoRotButton();
00114
00115     // Generated message map functions
00116 protected:
00117     //{{AFX_MSG(CPseudoRotButton)
00118     //}}AFX_MSG
00119
00120     DECLARE_MESSAGE_MAP()
00121 };
00122
00124
00125 class CPseudoToggle : public CPseudoButton
00126 {
00127     DECLARE_DYNAMIC(CPseudoToggle)
00128
00129 // Construction
00130 public:
00131     CPseudoToggle();
00132
00133 // Attributes
00134 protected:
00135     int m_flag;
00136     bool m_radio;
00137     CString m_group;
00138
00139 // Operations
00140 public:
00141     ~CPseudoToggle();
00142     virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
00143
00144     // visual state (pushed/unpushed)
00145     virtual void SetState(int state);
00146     inline int GetState(void) const { return m_flag;}
00147     inline void ToggleBtn() { SetState(GetState() == 0 ? 1:0);}
00148
00149     // radio button behaviour
00150     inline void SetRadio(bool state) { m_radio = state; }
00151     inline bool IsRadio(void) const  { return m_radio; }
00152     inline void SetGroup(const char *group) { m_group = group; }
00153     inline const char *GetGroup(void) const { return m_group; }
00154
00155     //{{AFX_MSG(COglView)
00156     afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00157     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00158     afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
00159     //}}AFX_MSG
00160     DECLARE_MESSAGE_MAP()
00161 };
00162
00163 #endif
00164
Generated on Sun Feb 24 01:21:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/mfc/PseudoDlg.cpp Source File

rf/support/mfc/PseudoDlg.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 // PseudoDlg.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025 #include "uwidget.h"
00026 #include "PseudoDlg.h"
00027 #include "PseudoDraw.h"
00028 #include "PseudoList.h"
00029 #include "SmartComboBox.h"
00030
00031 #ifdef _DEBUG
00032 #define new DEBUG_NEW
00033 #undef THIS_FILE
00034 static char THIS_FILE[] = __FILE__;
00035 #endif
00036
00037 #define IS_PSEUDO_CTL(id) ((id) >= WINCMD_DLG_START && (id) < WINCMD_DLG_END)
00038
00040 // CPseudoDlg dialog
00041
00042 CPseudoDlg::CPseudoDlg(int dlgid, UWidget *pseudo, CWnd* pParent /*=NULL*/)
00043     : CDialog(dlgid, pParent), m_pseudo(pseudo)
00044 {
00045     //{{AFX_DATA_INIT(CPseudoDlg)
00046         // NOTE: the ClassWizard will add member initialization here
00047     //}}AFX_DATA_INIT
00048 }
00049
00050 CPseudoDlg::~CPseudoDlg()
00051 {
00052     if(m_pseudo != 0L)
00053     {
00054         UEventSendMessage(m_pseudo->GetWidID(), EV_DESTROY, 0, 0L);
00055
00056         std::map<int, void *>::iterator k;
00057         for(k = m_pseudo->GetWidgets().begin(); k != m_pseudo->GetWidgets().end(); ++k)
00058         {
00059             CWnd *wnd = (CWnd *)(*k).second;
00060             if((*k).first != kUMainWidget)
00061                 delete wnd;
00062         }
00063     }
00064 }
00065
00066 void CPseudoDlg::DoDataExchange(CDataExchange* pDX)
00067 {
00068     CDialog::DoDataExchange(pDX);
00069
00070     if(m_pseudo != 0L)
00071     {
00072         std::map<int, void *>::iterator i;
00073         for(i = m_pseudo->GetWidgets().begin(); i != m_pseudo->GetWidgets().end(); ++i)
00074         {
00075             if((*i).first != kUMainWidget)
00076                 DDX_Control(pDX, UCMD_to_WINCTL((*i).first), *(CWnd *)(*i).second);
00077         }
00078
00079         m_pseudo->DoDataExchange(!pDX->m_bSaveAndValidate);
00080     }
00081
00082     //{{AFX_DATA_MAP(CPseudoDlg)
00083     //}}AFX_DATA_MAP
00084 }
00085
00086
00087 BEGIN_MESSAGE_MAP(CPseudoDlg, CDialog)
00088     //{{AFX_MSG_MAP(CPseudoDlg)
00089     //}}AFX_MSG_MAP
00090 END_MESSAGE_MAP()
00091
00092 void WinInitWidgets(CWnd *wnd, UWidget *pseudo)
00093 {
00094     CWnd* pWndStart = 0L;
00095     pWndStart = wnd->GetTopWindow();
00096     while(pWndStart != 0L)
00097     {
00098         HWND hwnd = *pWndStart;
00099         int id = ::GetDlgCtrlID(*pWndStart);
00100         CWnd *res = 0L;
00101         if(IS_PSEUDO_CTL(id))
00102         {
00103             TCHAR szCompare[100];
00104             ::GetClassName(hwnd, szCompare, _countof(szCompare));
00105             DWORD style = (DWORD)GetWindowLong(hwnd, GWL_STYLE);
00106
00107             // check overided widgets
00108             std::map<int, CRuntimeClass *> & list = pseudo->GetOverideList();
00109             std::map<int, CRuntimeClass *>::const_iterator i = list.find(WINCTL_to_UCMD(id));
00110             if(i != list.end())
00111             {
00112                 CRuntimeClass *clss = (*i).second;
00113                 if(clss->IsDerivedFrom(RUNTIME_CLASS(CWnd)))
00114                 {
00115                     res = (CWnd *)clss->CreateObject();
00116                 }
00117             }
00118
00119             if(res == 0L)
00120             {
00121                 if(stricmp(szCompare, "BUTTON") == 0)
00122                 {
00123                     CButton *btn = new CButton();
00124                     res = btn;
00125                 }
00126                 else if(stricmp(szCompare, "Static") == 0)
00127                 {
00128                     if(style & SS_ETCHEDFRAME)
00129                     {
00130                         CPseudoDraw *draw = new CPseudoDraw(pseudo, WINCTL_to_UCMD(id));
00131                         res = draw;
00132                     }
00133                     else
00134                     {
00135                         CStatic *stat = new CStatic();
00136                         res = stat;
00137                     }
00138                 }
00139                 else if(stricmp(szCompare, "ComboBox") == 0)
00140                 {
00141                     CComboBox *combo = new CSmartComboBox(USmartCombo::AutoDropWidth);
00142                     res = combo;
00143                 }
00144                 else if(stricmp(szCompare, WC_LISTVIEW) == 0)
00145                 {
00146                     CPseudoList *list = new CPseudoList(pseudo->GetWidID(), WINCTL_to_UCMD(id));
00147                     res = list;
00148                 }
00149                 else
00150                 {
00151                     res = new CWnd();
00152                 }
00153             }
00154
00155             UEventSendMessage(pseudo->GetWidID(), EV_INIT_WIDGET, WINCTL_to_UCMD(id), res);
00156         }
00157         pWndStart = pWndStart->GetNextWindow();
00158     }
00159
00160     std::map<int, CRuntimeClass *> & list = pseudo->GetOverideList();
00161     list.erase(list.begin(), list.end());
00162 }
00163
00165 // CPseudoDlg message handlers
00166
00167 BOOL CPseudoDlg::OnInitDialog()
00168 {
00169     if(m_pseudo != 0L)
00170     {
00171         WinInitWidgets(this, m_pseudo);
00172         UEventSendMessage(m_pseudo->GetWidID(), EV_CREATE, 0, 0L);
00173     }
00174
00175     CDialog::OnInitDialog();
00176
00177     return TRUE;  // return TRUE unless you set the focus to a control
00178                   // EXCEPTION: OCX Property Pages should return FALSE
00179 }
00180
00181 static int findIdForWnd(CWnd *wnd, UWidget *wid)
00182 {
00183     const std::map<int, void *> & allWids = wid->GetWidgets();
00184     std::map<int, void *>::const_iterator i;
00185     for(i = allWids.begin(); i != allWids.end(); ++i)
00186     {
00187         if(wnd == (CWnd *)(*i).second)
00188             return (*i).first;
00189     }
00190     return -1;
00191 }
00192
00193 static int UWinToUMod(UINT nFlags)
00194 {
00195     int res = 0;
00196     if(nFlags & MK_LBUTTON)
00197         res |= VK_LBUTTON;
00198     if(nFlags & MK_RBUTTON)
00199         res |= UK_RBUTTON;
00200     if(nFlags & MK_SHIFT)
00201         res |= UK_SHIFT;
00202     if(nFlags & MK_CONTROL)
00203         res |= UK_CONTROL;
00204     if(nFlags & MK_MBUTTON)
00205         res |= UK_MBUTTON;
00206     if ((GetKeyState(VK_MENU) & 0x8000) != 0)
00207         res |= UK_ALT;
00208
00209     return res;
00210 }
00211
00212 LRESULT UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam)
00213 {
00214     bool sentOne = false;
00215
00216     if(wid == 0L)
00217         return 1;
00218
00219     if (message == WM_COMMAND)
00220     {
00221         UINT nID = LOWORD(wParam);
00222         if(!IS_PSEUDO_CTL(nID))
00223             return 1;
00224
00225         int nCode = HIWORD(wParam);
00226         HWND hWndCtrl = (HWND)lParam;
00227         switch(nCode)
00228         {
00229         case BN_CLICKED:
00230             UEventSendMessage(wid->GetWidID(), EV_CMD, WINCTL_to_UCMD(nID), 0L);
00231             sentOne = true;
00232             break;
00233         case CBN_SELCHANGE:
00234         {
00235             ASSERT(::IsWindow(hWndCtrl));
00236             int sel = (int)::SendMessage(hWndCtrl, CB_GETCURSEL, 0, 0);
00237             const char *txt = 0L;
00238             char buf[1024] = {'\0'};
00239             if(sel != -1 && (int)::SendMessage(hWndCtrl, CB_GETLBTEXT, sel, (LPARAM)buf) != CB_ERR)
00240                 txt = buf;
00241             if(strcmp(buf, "-") != 0) // separator
00242                 UEventSendMessage(wid->GetWidID(), EV_COMBO_SEL,
00243                     UMAKEINT(WINCTL_to_UCMD(nID), sel), (void *)txt);
00244             sentOne = true;
00245             break;
00246         }
00247         case EN_CHANGE:
00248             if(wid->m_noDispatch)
00249                 break;
00250
00251             ASSERT(::IsWindow(hWndCtrl));
00252             UEventSendMessage(wid->GetWidID(), EV_EDITCHANGE,
00253                 WINCTL_to_UCMD(nID), 0L);
00254             break;
00255         }
00256     }
00257     else if (message == WM_NOTIFY)
00258     {
00259         NMHDR* pNMHDR = (NMHDR*)lParam;
00260         if (pNMHDR->hwndFrom != NULL)
00261         {
00262             UINT nID = _AfxGetDlgCtrlID(pNMHDR->hwndFrom);
00263             int nCode = pNMHDR->code;
00264             if(!IS_PSEUDO_CTL(nID))
00265                 return 1;
00266
00267             switch(nCode)
00268             {
00269             case LVN_ITEMCHANGED:
00270                 NMLISTVIEW *state = (NMLISTVIEW *)pNMHDR;
00271
00272                 HWND wnd = state->hdr.hwndFrom;
00273                 ASSERT(::IsWindow(wnd));
00274
00275                 int id = state->hdr.idFrom;
00276                 std::map<int, void *>::const_iterator i = wid->GetWidgets().find(WINCTL_to_UCMD(id));
00277                 if(i != wid->GetWidgets().end())
00278                 {
00279                     CWnd *w = (CWnd *)(*i).second;
00280                     if(w->IsKindOf(RUNTIME_CLASS(CListCtrl)))
00281                     {
00282                         CListCtrl *list = (CListCtrl*)w;
00283                         CString s = list->GetItemText(state->iItem, 0);
00284
00285                         UEventSendMessage(wid->GetWidID(), EV_LIST_SELECTING,
00286                             UMAKEINT(WINCTL_to_UCMD(state->hdr.idFrom), state->iItem), (void *)(const char *)s);
00287                         sentOne = true;
00288                     }
00289                 }
00290                 break;
00291             }
00292         }
00293     }
00294     else if (message == WM_SIZE)
00295     {
00296         int id = findIdForWnd(wnd, wid);
00297         if(id != -1)
00298         {
00299             URECT r = {0, 0, LOWORD(lParam), HIWORD(lParam)};
00300             UEventSendMessage(wid->GetWidID(), EV_RESIZE, id, &r);
00301             sentOne = true;
00302         }
00303     }
00304     else if (message == WM_MOUSEMOVE)
00305     {
00306         int id = findIdForWnd(wnd, wid);
00307         if(id != -1)
00308         {
00309             UEventSendMessage(wid->GetWidID(), EV_MMOVE, UMAKEINT(LOWORD(lParam), HIWORD(lParam)),
00310                 (void *)UWinToUMod(wParam));
00311             sentOne = true;
00312         }
00313     }
00314     else if (message == WM_LBUTTONDOWN)
00315     {
00316         int id = findIdForWnd(wnd, wid);
00317         if(id != -1)
00318         {
00319             UEventSendMessage(wid->GetWidID(), EV_BTNDOWN, UMAKEINT(LOWORD(lParam), HIWORD(lParam)),
00320                 (void *)UWinToUMod(wParam));
00321             sentOne = true;
00322         }
00323     }
00324     else if (message == WM_LBUTTONUP)
00325     {
00326         int id = findIdForWnd(wnd, wid);
00327         if(id != -1)
00328         {
00329             UEventSendMessage(wid->GetWidID(), EV_BTNUP, UMAKEINT(LOWORD(lParam), HIWORD(lParam)),
00330                 (void *)UWinToUMod(wParam));
00331             sentOne = true;
00332         }
00333     }
00334     else if (message == WM_LBUTTONDBLCLK)
00335     {
00336         int id = findIdForWnd(wnd, wid);
00337         if(id != -1)
00338         {
00339             UEventSendMessage(wid->GetWidID(), EV_BTNDBLDOWN, UMAKEINT(LOWORD(lParam), HIWORD(lParam)),
00340                 (void *)UWinToUMod(wParam));
00341             sentOne = true;
00342         }
00343     }
00344     else if (message == WM_KEYDOWN)
00345     {
00346         int id = findIdForWnd(wnd, wid);
00347         if(id != -1)
00348         {
00349             UEventSendMessage(wid->GetWidID(), EV_KEYDOWN, wParam, 0L);
00350             sentOne = true;
00351         }
00352     }
00353     else if (message == WM_HSCROLL)
00354     {
00355         HWND hwndScrollBar = (HWND) lParam;       // handle to scroll bar
00356         int nID = ::GetDlgCtrlID(hwndScrollBar);
00357         if(!IS_PSEUDO_CTL(nID))
00358             return 1;
00359
00360         int cmd = WINCTL_to_UCMD(nID);
00361         CWnd *wnds = (CWnd *)wid->GetWidget(cmd);
00362         if(wnds == 0L || !wnds->IsKindOf(RUNTIME_CLASS(CScrollBar)))
00363             return 1;
00364
00365         CScrollBar *scroll = (CScrollBar *)wnds;
00366
00367         int nScrollCode = (int) LOWORD(wParam);  // scroll bar value
00368         int nPos;
00369         if(nScrollCode == SB_THUMBPOSITION || nScrollCode == SB_THUMBTRACK)
00370         {
00371             nPos = (short int) HIWORD(wParam);   // scroll box position
00372
00373             if(nScrollCode == SB_THUMBPOSITION)
00374                 scroll->SetScrollPos(nPos);
00375         }
00376         else
00377         {
00378             SCROLLINFO info;
00379             VERIFY(scroll->GetScrollInfo(&info));
00380             nPos = info.nPos;
00381
00382             switch(nScrollCode)
00383             {
00384             case SB_ENDSCROLL:
00385                 return 1;
00386                 break;
00387             case SB_LINELEFT:
00388                 nPos -= 1;
00389                 break;
00390             case SB_LINERIGHT:
00391                 nPos += 1;
00392                 break;
00393             case SB_PAGELEFT:
00394                 nPos -= info.nPage;
00395                 break;
00396             case SB_PAGERIGHT:
00397                 nPos += info.nPage;
00398                 break;
00399             case SB_LEFT:
00400                 nPos = info.nMin;
00401                 break;
00402             case SB_RIGHT:
00403                 nPos = info.nMax;
00404                 break;
00405             }
00406
00407             scroll->SetScrollPos(nPos);
00408         }
00409
00410         UEventSendMessage(wid->GetWidID(), EV_SCROLLCHANGE, WINCTL_to_UCMD(nID),
00411             (void *)nPos);
00412         sentOne = true;
00413     }
00414     else if (message == WM_VSCROLL)
00415     {
00416         HWND hwndScrollBar = (HWND) lParam;       // handle to scroll bar
00417         int nID = ::GetDlgCtrlID(hwndScrollBar);
00418         if(!IS_PSEUDO_CTL(nID))
00419             return 1;
00420
00421         int cmd = WINCTL_to_UCMD(nID);
00422         CWnd *wnds = (CWnd *)wid->GetWidget(cmd);
00423         if(wnds == 0L || !wnds->IsKindOf(RUNTIME_CLASS(CScrollBar)))
00424             return 1;
00425
00426         CScrollBar *scroll = (CScrollBar *)wnds;
00427
00428         int nScrollCode = (int) LOWORD(wParam);  // scroll bar value
00429         int nPos;
00430         if(nScrollCode == SB_THUMBPOSITION || nScrollCode == SB_THUMBTRACK)
00431         {
00432             nPos = (short int) HIWORD(wParam);   // scroll box position
00433
00434             if(nScrollCode == SB_THUMBPOSITION)
00435                 scroll->SetScrollPos(nPos);
00436         }
00437         else
00438         {
00439             SCROLLINFO info;
00440             VERIFY(scroll->GetScrollInfo(&info));
00441             nPos = info.nPos;
00442
00443             switch(nScrollCode)
00444             {
00445             case SB_ENDSCROLL:
00446                 return 1;
00447                 break;
00448             case SB_LINEUP:
00449                 nPos -= 1;
00450                 break;
00451             case SB_LINEDOWN:
00452                 nPos += 1;
00453                 break;
00454             case SB_PAGEUP:
00455                 nPos -= info.nPage;
00456                 break;
00457             case SB_PAGEDOWN:
00458                 nPos += info.nPage;
00459                 break;
00460             case SB_TOP:
00461                 nPos = info.nMin;
00462                 break;
00463             case SB_BOTTOM:
00464                 nPos = info.nMax;
00465                 break;
00466             }
00467
00468             if(nPos > info.nMax)
00469                 nPos = info.nMax;
00470             else if(nPos < info.nMin)
00471                 nPos = info.nMin;
00472             scroll->SetScrollPos(nPos);
00473         }
00474
00475         UEventSendMessage(wid->GetWidID(), EV_SCROLLCHANGE, WINCTL_to_UCMD(nID),
00476             (void *)nPos);
00477         sentOne = true;
00478     }
00479
00480     if(sentOne)
00481         UWidget::DoValidUI(false);
00482
00483     return 1;
00484 }
00485
00486 LRESULT CPseudoDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
00487 {
00488     if(m_pseudo != 0L && !UWinPseudoWindowProc(this, m_pseudo, message, wParam, lParam))
00489         return 0;
00490
00491     return CDialog::WindowProc(message, wParam, lParam);
00492 }
Generated on Sun Feb 24 01:21:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/mfc/PseudoDlg.h Source File

rf/support/mfc/PseudoDlg.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 #if !defined(AFX_PSEUDODLG_H__9EDC5FE5_21FD_4ACE_9AEB_7A521350A2EE__INCLUDED_)
00022 #define AFX_PSEUDODLG_H__9EDC5FE5_21FD_4ACE_9AEB_7A521350A2EE__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 // PseudoDlg.h : header file
00028 //
00029
00030 class UWidget;
00031
00033 // CPseudoDlg dialog
00034
00035 class CPseudoDlg : public CDialog
00036 {
00037 // Construction
00038 public:
00039     CPseudoDlg(int dlgid, UWidget *pseudo, CWnd* pParent = NULL);   // standard constructor
00040     virtual ~CPseudoDlg();
00041
00042 // Dialog Data
00043     //{{AFX_DATA(CPseudoDlg)
00044     //}}AFX_DATA
00045
00046
00047 // Overrides
00048     // ClassWizard generated virtual function overrides
00049     //{{AFX_VIRTUAL(CPseudoDlg)
00050     protected:
00051     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00052     //}}AFX_VIRTUAL
00053
00054 // Implementation
00055 protected:
00056     UWidget *m_pseudo;
00057     virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
00058
00059     // Generated message map functions
00060     //{{AFX_MSG(CPseudoDlg)
00061     virtual BOOL OnInitDialog();
00062     //}}AFX_MSG
00063     DECLARE_MESSAGE_MAP()
00064 };
00065
00066 //{{AFX_INSERT_LOCATION}}
00067 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00068
00069 #endif // !defined(AFX_PSEUDODLG_H__9EDC5FE5_21FD_4ACE_9AEB_7A521350A2EE__INCLUDED_)
Generated on Sun Feb 24 01:21:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/mfc/PseudoDraw.cpp Source File

rf/support/mfc/PseudoDraw.cpp

Go to the documentation of this file.
00001 // PseudoDraw.cpp : implementation file
00002 //
00003
00004 #include "stdafx.h"
00005
00006 #include "PseudoDraw.h"
00007 #include "uwidget.h"
00008
00009 #ifdef _DEBUG
00010 #define new DEBUG_NEW
00011 #undef THIS_FILE
00012 static char THIS_FILE[] = __FILE__;
00013 #endif
00014
00016 // CPseudoDraw
00017
00018 CPseudoDraw::CPseudoDraw(UWidget *pseudo, int cmdid) : m_pseudo(pseudo), m_cmdid(cmdid)
00019 {
00020 }
00021
00022 CPseudoDraw::~CPseudoDraw()
00023 {
00024 }
00025
00026
00027 BEGIN_MESSAGE_MAP(CPseudoDraw, CStatic)
00028     //{{AFX_MSG_MAP(CPseudoDraw)
00029     ON_WM_PAINT()
00030     //}}AFX_MSG_MAP
00031 END_MESSAGE_MAP()
00032
00034 // CPseudoDraw message handlers
00035
00036 void CPseudoDraw::OnPaint()
00037 {
00038     CPaintDC dc(this); // device context for painting
00039
00040     if(m_pseudo != 0L)
00041         UEventSendMessage(m_pseudo->GetWidID(), EV_CUSTOM_DRAW, m_cmdid, &dc);
00042 }
Generated on Sun Feb 24 01:21:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/mfc/PseudoDraw.h Source File

rf/support/mfc/PseudoDraw.h

Go to the documentation of this file.
00001 #if !defined(AFX_STATICDRAW_H__8DCC3165_D42E_4FAA_BCCF_F4328685535E__INCLUDED_)
00002 #define AFX_STATICDRAW_H__8DCC3165_D42E_4FAA_BCCF_F4328685535E__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007 // PseudoDraw.h : header file
00008 //
00009
00011 // CPseudoDraw window
00012
00013 class UWidget;
00014
00015 class CPseudoDraw : public CStatic
00016 {
00017 // Construction
00018 public:
00019     CPseudoDraw(UWidget *pseudo, int cmdid);
00020
00021 // Attributes
00022 public:
00023     UWidget *m_pseudo;
00024     int m_cmdid;
00025
00026 // Operations
00027 public:
00028
00029 // Overrides
00030     // ClassWizard generated virtual function overrides
00031     //{{AFX_VIRTUAL(CPseudoDraw)
00032     //}}AFX_VIRTUAL
00033
00034 // Implementation
00035 public:
00036     virtual ~CPseudoDraw();
00037
00038     // Generated message map functions
00039 protected:
00040     //{{AFX_MSG(CPseudoDraw)
00041     afx_msg void OnPaint();
00042     //}}AFX_MSG
00043
00044     DECLARE_MESSAGE_MAP()
00045 };
00046
00048
00049 //{{AFX_INSERT_LOCATION}}
00050 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00051
00052 #endif // !defined(AFX_STATICDRAW_H__8DCC3165_D42E_4FAA_BCCF_F4328685535E__INCLUDED_)
Generated on Sun Feb 24 01:21:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/mfc/PseudoList.cpp Source File

rf/support/mfc/PseudoList.cpp

Go to the documentation of this file.
00001 // PseudoList.cpp : implementation file
00002 //
00003
00004 #include "stdafx.h"
00005 #include "PseudoList.h"
00006 #include "umain.h"
00007
00008 #ifdef _DEBUG
00009 #define new DEBUG_NEW
00010 #undef THIS_FILE
00011 static char THIS_FILE[] = __FILE__;
00012 #endif
00013
00015 // CPseudoList
00016
00017 CPseudoList::CPseudoList(int wid, int cmd) : m_wid(wid), m_cmd(cmd)
00018 {
00019 }
00020
00021 CPseudoList::~CPseudoList()
00022 {
00023 }
00024
00025
00026 BEGIN_MESSAGE_MAP(CPseudoList, CListCtrl)
00027     //{{AFX_MSG_MAP(CPseudoList)
00028     ON_WM_LBUTTONDBLCLK()
00029     //}}AFX_MSG_MAP
00030 END_MESSAGE_MAP()
00031
00033 // CPseudoList message handlers
00034
00035 void CPseudoList::OnLButtonDblClk(UINT nFlags, CPoint point)
00036 {
00037     UINT pFlags;
00038     int nItem = HitTest(point, &pFlags);
00039     if(nItem != -1)
00040     {
00041         CString s = GetItemText(nItem, 0);
00042
00043         UEventSendMessage(m_wid, EV_LIST_DBLCLICK, UMAKEINT(m_cmd, nItem),
00044             (void *)(const char *)s);
00045     }
00046
00047     CListCtrl::OnLButtonDblClk(nFlags, point);
00048 }
Generated on Sun Feb 24 01:21:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/mfc/pseudolist.h Source File

rf/support/mfc/pseudolist.h

Go to the documentation of this file.
00001 #if !defined(AFX_PSEUDOLIST_H__49AF86B3_E6AB_4885_843C_1CE5AC8C4980__INCLUDED_)
00002 #define AFX_PSEUDOLIST_H__49AF86B3_E6AB_4885_843C_1CE5AC8C4980__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007 // PseudoList.h : header file
00008 //
00009
00011 // CPseudoList window
00012
00013 class CPseudoList : public CListCtrl
00014 {
00015 // Construction
00016 public:
00017     CPseudoList(int wid, int cmd);
00018
00019 // Attributes
00020 public:
00021
00022 // Operations
00023 public:
00024
00025 // Overrides
00026     // ClassWizard generated virtual function overrides
00027     //{{AFX_VIRTUAL(CPseudoList)
00028     //}}AFX_VIRTUAL
00029
00030 // Implementation
00031 public:
00032     virtual ~CPseudoList();
00033
00034     // Generated message map functions
00035 protected:
00036     int m_cmd, m_wid;
00037
00038     //{{AFX_MSG(CPseudoList)
00039     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00040     //}}AFX_MSG
00041
00042     DECLARE_MESSAGE_MAP()
00043 };
00044
00046
00047 //{{AFX_INSERT_LOCATION}}
00048 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00049
00050 #endif // !defined(AFX_PSEUDOLIST_H__49AF86B3_E6AB_4885_843C_1CE5AC8C4980__INCLUDED_)
Generated on Sun Feb 24 01:21:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


dib.c File Reference

rf/support/mfc/dib.c File Reference

#include <windows.h>
#include <windowsx.h>
#include "dib.h"

Include dependency graph for dib.c:

Include dependency graph

Go to the source code of this file.

Functions

WORD | DibNumColors (VOID FAR *pv)
WORD | DibGetPaletteSize (VOID FAR *pv)
VOID | DibCopyPalette (HBITMAP dst, HBITMAP src)
WORD | PaletteSize (VOID FAR *pv)
VOID | WriteMapFileHeaderandConvertFromDwordAlignToPacked (HFILE fh, LPBITMAPFILEHEADER pbf)
HBITMAP | CreateDIB (DWORD dwWidth, DWORD dwHeight, WORD wBitCount, HPALETTE hPal)
HANDLE | ReadDIBFile (HANDLE hFile)
HBITMAP | LoadDIB (LPSTR lpFileName)
BOOL | SaveBmpFromDDB (HDC hDC, HBITMAP hBmp, PSTR pszFileName)
BOOL | SaveDIB (HBITMAP hDib, LPSTR lpFileName)
HBITMAP | CopyScreenToBitmap (HWND win, LPRECT lpRect)
HBITMAP | DIBToBitmap (hDIB) HBITMAP hDIB

Variables

WORD | biBits
HPALETTE | hPal

Function Documentation

HBITMAP CopyScreenToBitmap | ( | HWND | win,
 |  | LPRECT | lpRect
 | ) |

Definition at line 848 of file dib.c.

00849 {
00850     HDC         hScrDC, hMemDC;         /*  screen DC and memory DC */
00851     HBITMAP     hBitmap, hOldBitmap;    /*  handles to deice-dependent bitmaps */
00852     int         nX, nY, nX2, nY2;       /*  coordinates of rectangle to grab */
00853     int         nWidth, nHeight;        /*  DIB width and height */
00854     int         xScrn, yScrn;           /*  screen resolution */
00855     /*  check for an empty rectangle */
00856
00857     if (IsRectEmpty(lpRect))
00858       return NULL;
00859
00860     /*  create a DC for the screen and create */
00861     /*  a memory DC compatible to screen DC */
00862
00863     /* hScrDC = CreateDC("DISPLAY", NULL, NULL, NULL); */
00864     /* hMemDC = CreateCompatibleDC(hScrDC); */
00865     hScrDC = GetDC(win);
00866     hMemDC = CreateCompatibleDC (hScrDC);
00867     /*  get points of rectangle to grab */
00868
00869     nX = lpRect->left;
00870     nY = lpRect->top;
00871     nX2 = lpRect->right;
00872     nY2 = lpRect->bottom;
00873
00874     /*  get screen resolution */
00875
00876     xScrn = GetDeviceCaps(hScrDC, HORZRES);
00877     yScrn = GetDeviceCaps(hScrDC, VERTRES);
00878
00879     /* make sure bitmap rectangle is visible */
00880
00881     if (nX < 0)
00882         nX = 0;
00883     if (nY < 0)
00884         nY = 0;
00885     if (nX2 > xScrn)
00886         nX2 = xScrn;
00887     if (nY2 > yScrn)
00888         nY2 = yScrn;
00889
00890     nWidth = nX2 - nX;
00891     nHeight = nY2 - nY;
00892
00893     // create a bitmap compatible with the screen DC
00894     hBitmap = CreateCompatibleBitmap(hScrDC, nWidth, nHeight);
00895
00896     // select new bitmap into memory DC
00897     hOldBitmap = SelectObject(hMemDC, hBitmap);
00898
00899     // bitblt screen DC to memory DC
00900     BitBlt(hMemDC, 0, 0, nWidth, nHeight, hScrDC, nX, nY, SRCCOPY);
00901
00902     // select old bitmap back into memory DC and get handle to
00903     // bitmap of the screen
00904
00905     hBitmap = SelectObject(hMemDC, hOldBitmap);
00906
00907     // clean up
00908
00909     ReleaseDC(win, hScrDC);
00910     DeleteDC(hMemDC);
00911
00912     // return handle to the bitmap
00913
00914     return hBitmap;
00915 }

HBITMAP CreateDIB | ( | DWORD | dwWidth,
 |  | DWORD | dwHeight,
 |  | WORD | wBitCount,
 |  | HPALETTE | hPal
 | ) |

Definition at line 201 of file dib.c.

00202 {
00203     BITMAPINFOHEADER    bi;             /*  bitmap header */
00204     LPBITMAPINFOHEADER  lpbi;           /*  pointer to BITMAPINFOHEADER */
00205     DWORD               dwLen;          /*  size of memory block */
00206     HBITMAP             hDIB;
00207     DWORD               dwBytesPerLine; /*  Number of bytes per scanline */
00208
00209
00210     /*  Make sure bits per pixel is valid */
00211
00212     if (wBitCount <= 1)
00213         wBitCount = 1;
00214     else if (wBitCount <= 4)
00215         wBitCount = 4;
00216     else if (wBitCount <= 8)
00217         wBitCount = 8;
00218     else if (wBitCount <= 24)
00219         wBitCount = 24;
00220     else
00221         wBitCount = 4;  /*  set default value to 4 if parameter is bogus */
00222
00223     /*  initialize BITMAPINFOHEADER */
00224
00225     bi.biSize = sizeof(BITMAPINFOHEADER);
00226     bi.biWidth = dwWidth;         /*  fill in width from parameter */
00227     bi.biHeight = dwHeight;       /*  fill in height from parameter */
00228     bi.biPlanes = 1;              /*  must be 1 */
00229     bi.biBitCount = wBitCount;    /*  from parameter */
00230     bi.biCompression = BI_RGB;
00231     bi.biSizeImage = 0;           /*  0's here mean "default" */
00232     bi.biXPelsPerMeter = 0;
00233     bi.biYPelsPerMeter = 0;
00234     bi.biClrUsed = 0;
00235     bi.biClrImportant = 0;
00236
00237     /*  calculate size of memory block required to store the DIB.  This */
00238     /*  block should be big enough to hold the BITMAPINFOHEADER, the color */
00239     /*  table, and the bits */
00240
00241     dwBytesPerLine = WIDTHBYTES(wBitCount * dwWidth);
00242     dwLen = bi.biSize + PaletteSize((LPSTR)&bi) + (dwBytesPerLine * dwHeight);
00243
00244     /*  alloc memory block to store our bitmap */
00245
00246     hDIB = GlobalAlloc(GHND, dwLen);
00247
00248     /*  major bummer if we couldn't get memory block */
00249
00250     if (!hDIB)
00251         return NULL;
00252
00253     /*  lock memory and get pointer to it */
00254
00255     lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDIB);
00256
00257     /*  use our bitmap info structure to fill in first part of */
00258     /*  our DIB with the BITMAPINFOHEADER */
00259
00260     *lpbi = bi;
00261
00262     /*
00263      * Copy the palette in the new created image
00264      */
00265     if (wBitCount == 8)
00266     {
00267         PALETTEENTRY pal[256];
00268         RGBQUAD *pRgb;
00269         int i;
00270
00271         GetPaletteEntries(hPal, 0, 256, pal);
00272
00273         pRgb = (RGBQUAD FAR *)((LPSTR)lpbi + (WORD)lpbi->biSize);
00274
00275         /* Fill in the palette entries from the DIB color table and
00276          * create a logical color palette.
00277          */
00278         for (i = 0; i < 256; i++)
00279         {
00280             pRgb[i].rgbRed = pal[i].peRed;
00281             pRgb[i].rgbGreen = pal[i].peGreen;
00282             pRgb[i].rgbBlue = pal[i].peBlue;
00283         }
00284     }
00285
00286     // Since we don't know what the colortable and bits should contain,
00287     // just leave these blank.  Unlock the DIB and return the HDIB.
00288
00289     GlobalUnlock(hDIB);
00290
00291     //return handle to the DIB
00292
00293     return hDIB;
00294 }

VOID DibCopyPalette | ( | HBITMAP | dst,
 |  | HBITMAP | src
 | ) |

Definition at line 99 of file dib.c.

00100 {
00101     LPBITMAPINFO src_header, dst_header;
00102     RGBQUAD *src_rgb, *dst_rgb;
00103     WORD colorMode;
00104
00105     src_header = (LPBITMAPINFO) GlobalLock((HGLOBAL)src);
00106     dst_header = (LPBITMAPINFO) GlobalLock((HGLOBAL)dst);
00107
00108     src_rgb = (RGBQUAD FAR *)((LPSTR)src_header + (WORD)src_header->bmiHeader.biSize);
00109     dst_rgb = (RGBQUAD FAR *)((LPSTR)dst_header + (WORD)dst_header->bmiHeader.biSize);
00110
00111     colorMode = DibGetPaletteSize(src_header);
00112     switch(colorMode)
00113     {
00114         case 4:
00115         case 8:
00116             memcpy(dst_rgb, src_rgb,PaletteSize(&src_header->bmiHeader));
00117             break;
00118     }
00119
00120     GlobalUnlock((HGLOBAL)src);
00121     GlobalUnlock((HGLOBAL)dst);
00122 }

WORD DibGetPaletteSize ( VOID FAR * pv )

Definition at line 69 of file dib.c.

00070 {
00071     INT                 bits;
00072     LPBITMAPINFOHEADER  lpbi;
00073     LPBITMAPCOREHEADER  lpbc;
00074
00075     lpbi = ((LPBITMAPINFOHEADER)pv);
00076     lpbc = ((LPBITMAPCOREHEADER)pv);
00077
00078     /*  With the BITMAPINFO format headers, the size of the palette
00079      *  is in biClrUsed, whereas in the BITMAPCORE - style headers, it
00080      *  is dependent on the bits per pixel ( = 2 raised to the power of
00081      *  bits/pixel).
00082      */
00083     if (lpbi->biSize != sizeof(BITMAPCOREHEADER))
00084         bits = lpbi->biBitCount;
00085     else
00086         bits = lpbc->bcBitCount;
00087
00088     return bits;
00089 }

WORD DibNumColors ( VOID FAR * pv )

Definition at line 24 of file dib.c.

00025 {
00026     INT                 bits;
00027     LPBITMAPINFOHEADER  lpbi;
00028     LPBITMAPCOREHEADER  lpbc;
00029
00030     lpbi = ((LPBITMAPINFOHEADER)pv);
00031     lpbc = ((LPBITMAPCOREHEADER)pv);
00032
00033     /*  With the BITMAPINFO format headers, the size of the palette
00034      *  is in biClrUsed, whereas in the BITMAPCORE - style headers, it
00035      *  is dependent on the bits per pixel ( = 2 raised to the power of
00036      *  bits/pixel).
00037      */
00038     if (lpbi->biSize != sizeof(BITMAPCOREHEADER)){
00039         if (lpbi->biClrUsed != 0)
00040             return (WORD)lpbi->biClrUsed;
00041         bits = lpbi->biBitCount;
00042     }
00043     else
00044         bits = lpbc->bcBitCount;
00045
00046     switch (bits){
00047         case 1:
00048                 return 2;
00049         case 4:
00050                 return 16;
00051         case 8:
00052                 return 256;
00053         default:
00054                 /* A 24 bitcount DIB has no color table */
00055                 return 0;
00056     }
00057 }

HBITMAP DIBToBitmap ( hDIB )

HBITMAP LoadDIB ( LPSTR lpFileName )

Definition at line 480 of file dib.c.

00481 {
00482     HBITMAP     hDIB;
00483     HANDLE      hFile;
00484
00485     if ((hFile = CreateFile(lpFileName, GENERIC_READ, FILE_SHARE_READ, NULL,
00486             OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
00487             NULL)) != INVALID_HANDLE_VALUE)
00488     {
00489         hDIB = ReadDIBFile(hFile);
00490         CloseHandle(hFile);
00491         return hDIB;
00492     }
00493     else
00494         return NULL;
00495 }

WORD PaletteSize ( VOID FAR * pv )

Definition at line 136 of file dib.c.

00137 {
00138     LPBITMAPINFOHEADER lpbi;
00139     WORD               NumColors;
00140
00141     lpbi      = (LPBITMAPINFOHEADER)pv;
00142     NumColors = DibNumColors(lpbi);
00143
00144     if (lpbi->biSize == sizeof(BITMAPCOREHEADER))
00145         return (WORD)(NumColors * sizeof(RGBTRIPLE));
00146     else
00147         return (WORD)(NumColors * sizeof(RGBQUAD));
00148 }

HANDLE ReadDIBFile ( HANDLE hFile )

Definition at line 324 of file dib.c.

00325 {
00326     BITMAPFILEHEADER    bmfHeader;
00327     DWORD               dwBitsSize;
00328     UINT                nNumColors;   /*  Number of colors in table */
00329     HANDLE              hDIB;
00330     HANDLE              hDIBtmp;      /*  Used for GlobalRealloc() //MPB */
00331     LPBITMAPINFOHEADER  lpbi;
00332     DWORD               offBits;
00333     DWORD               dwRead;
00334
00335     /*  get length of DIB in bytes for use when reading */
00336
00337     dwBitsSize = GetFileSize(hFile, NULL);
00338
00339     /*  Allocate memory for header & color table. We'll enlarge this */
00340     /*  memory as needed. */
00341
00342     hDIB = GlobalAlloc(GMEM_MOVEABLE, (DWORD)(sizeof(BITMAPINFOHEADER) +
00343             256 * sizeof(RGBQUAD)));
00344
00345     if (!hDIB)
00346         return NULL;
00347
00348     lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDIB);
00349
00350     if (!lpbi)
00351     {
00352         GlobalFree(hDIB);
00353         return NULL;
00354     }
00355
00356     /*  read the BITMAPFILEHEADER from our file */
00357
00358     if (!ReadFile(hFile, (LPSTR)&bmfHeader, sizeof (BITMAPFILEHEADER),
00359             &dwRead, NULL))
00360         goto ErrExit;
00361
00362     if (sizeof (BITMAPFILEHEADER) != dwRead)
00363         goto ErrExit;
00364
00365     if (bmfHeader.bfType != 0x4d42)  /*  'BM' */
00366         goto ErrExit;
00367
00368     /*  read the BITMAPINFOHEADER */
00369
00370     if (!ReadFile(hFile, (LPSTR)lpbi, sizeof(BITMAPINFOHEADER), &dwRead,
00371             NULL))
00372         goto ErrExit;
00373
00374     if (sizeof(BITMAPINFOHEADER) != dwRead)
00375         goto ErrExit;
00376
00377     /*  Check to see that it's a Windows DIB -- an OS/2 DIB would cause */
00378     /*  strange problems with the rest of the DIB API since the fields */
00379     /*  in the header are different and the color table entries are */
00380     /*  smaller. */
00381     /*  */
00382     /*  If it's not a Windows DIB (e.g. if biSize is wrong), return NULL. */
00383
00384     if (lpbi->biSize == sizeof(BITMAPCOREHEADER))
00385         goto ErrExit;
00386
00387     /*  Now determine the size of the color table and read it.  Since the */
00388     /*  bitmap bits are offset in the file by bfOffBits, we need to do some */
00389     /*  special processing here to make sure the bits directly follow */
00390     /*  the color table (because that's the format we are susposed to pass */
00391     /*  back) */
00392
00393     if (!(nNumColors = (UINT)lpbi->biClrUsed))
00394     {
00395         /*  no color table for 24-bit, default size otherwise */
00396
00397         if (lpbi->biBitCount != 24)
00398             nNumColors = 1 << lpbi->biBitCount; /*  standard size table */
00399     }
00400
00401     /*  fill in some default values if they are zero */
00402
00403     if (lpbi->biClrUsed == 0)
00404         lpbi->biClrUsed = nNumColors;
00405
00406     if (lpbi->biSizeImage == 0)
00407     {
00408         lpbi->biSizeImage = ((((lpbi->biWidth * (DWORD)lpbi->biBitCount) +
00409                 31) & ~31) >> 3) * lpbi->biHeight;
00410     }
00411
00412     /*  get a proper-sized buffer for header, color table and bits */
00413
00414     GlobalUnlock(hDIB);
00415     hDIBtmp = GlobalReAlloc(hDIB, lpbi->biSize + nNumColors *
00416             sizeof(RGBQUAD) + lpbi->biSizeImage, 0);
00417
00418     if (!hDIBtmp) /*  can't resize buffer for loading */
00419         goto ErrExitNoUnlock; /* MPB */
00420     else
00421         hDIB = hDIBtmp;
00422
00423     lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDIB);
00424
00425     /*  read the color table */
00426
00427     ReadFile (hFile, (LPSTR)(lpbi) + lpbi->biSize,
00428             nNumColors * sizeof(RGBQUAD), &dwRead, NULL);
00429
00430     /*  offset to the bits from start of DIB header */
00431
00432     offBits = lpbi->biSize + nNumColors * sizeof(RGBQUAD);
00433
00434     /*  If the bfOffBits field is non-zero, then the bits might *not* be */
00435     /*  directly following the color table in the file.  Use the value in */
00436     /*  bfOffBits to seek the bits. */
00437
00438     if (bmfHeader.bfOffBits != 0L)
00439         SetFilePointer(hFile, bmfHeader.bfOffBits, NULL, FILE_BEGIN);
00440
00441     if (ReadFile(hFile, (LPSTR)lpbi + offBits, lpbi->biSizeImage, &dwRead,
00442             NULL))
00443         goto OKExit;
00444
00445
00446 ErrExit:
00447     GlobalUnlock(hDIB);
00448
00449 ErrExitNoUnlock:
00450     GlobalFree(hDIB);
00451     return NULL;
00452
00453 OKExit:
00454     GlobalUnlock(hDIB);
00455     return hDIB;
00456 }

BOOL SaveBmpFromDDB | ( | HDC | hDC,
 |  | HBITMAP | hBmp,
 |  | PSTR | pszFileName
 | ) |

Definition at line 506 of file dib.c.

00507 {
00508     int         hFile;
00509     OFSTRUCT    ofReOpenBuff;
00510     HBITMAP     hTmpBmp, hBmpOld;
00511     BOOL        bSuccess;
00512     BITMAPFILEHEADER    bfh;
00513     PBITMAPINFO pbmi;
00514     PBYTE       pBits;
00515     BITMAPINFO  bmi;
00516     PBYTE pjTmp, pjTmpBmi;
00517     ULONG sizBMI;
00518
00519
00520     bSuccess = TRUE;
00521 #if 0
00522     if (ghPal) {
00523         SelectPalette(hDC, ghPal, FALSE);
00524         RealizePalette(hDC);
00525     }
00526 #endif
00527     if (!hBmp) {
00528         return FALSE;
00529     }
00530
00531     //
00532     // Let the graphics engine to retrieve the dimension of the bitmap for us
00533     // GetDIBits uses the size to determine if it's BITMAPCOREINFO or BITMAPINFO
00534     // if BitCount != 0, color table will be retrieved
00535     //
00536     bmi.bmiHeader.biSize = 0x28;              // GDI need this to work
00537     bmi.bmiHeader.biBitCount = 0;             // don't get the color table
00538     if ((GetDIBits(hDC, hBmp, 0, 0, (LPSTR)NULL, &bmi, DIB_RGB_COLORS)) == 0) {
00539         return FALSE;
00540     }
00541
00542     //
00543     // Now that we know the size of the image, alloc enough memory to retrieve
00544     // the actual bits
00545     //
00546     if ((pBits = (PBYTE)GlobalAlloc(GMEM_FIXED | GMEM_ZEROINIT,
00547                 bmi.bmiHeader.biSizeImage)) == NULL) {
00548         return FALSE;
00549     }
00550
00551     //
00552     // Note: 24 bits per pixel has no color table.  So, we don't have to
00553     // allocate memory for retrieving that.  Otherwise, we do.
00554     //
00555     pbmi = &bmi;                                      // assume no color table
00556
00557     switch (bmi.bmiHeader.biBitCount) {
00558         case 24:                                      // has color table
00559             sizBMI = sizeof(BITMAPINFOHEADER);
00560             break;
00561         case 16:
00562         case 32:
00563             sizBMI = sizeof(BITMAPINFOHEADER)+sizeof(DWORD)*3;
00564             break;
00565         default:
00566             sizBMI = sizeof(BITMAPINFOHEADER)+sizeof(RGBQUAD)*(1<<bmi.bmiHeader.biBitCount);
00567             break;
00568
00569     }
00570
00571     //
00572     // Allocate memory for color table if it is not 24bpp...
00573     //
00574     if (sizBMI != sizeof(BITMAPINFOHEADER)) {
00575         ULONG       sizTmp;
00576         //
00577         // I need more memory for the color table
00578         //
00579         if ((pbmi = (PBITMAPINFO)GlobalAlloc(GMEM_FIXED | GMEM_ZEROINIT, sizBMI )) == NULL) {
00580             bSuccess = FALSE;
00581             goto ErrExit1;
00582         }
00583         //
00584         // Now that we've a bigger chunk of memory, let's copy the Bitmap
00585         // info header data over
00586         //
00587         pjTmp = (PBYTE)pbmi;
00588         pjTmpBmi = (PBYTE)&bmi;
00589         sizTmp = sizeof(BITMAPINFOHEADER);
00590
00591         while(sizTmp--)
00592         {
00593             *(((PBYTE)pjTmp)++) = *((pjTmpBmi)++);
00594         }
00595     }
00596
00597     //
00598     // Let's open the file and get ready for writing
00599     //
00600     if ((hFile = OpenFile(pszFileName, (LPOFSTRUCT)&ofReOpenBuff,
00601                  OF_CREATE | OF_WRITE)) == -1) {
00602         goto ErrExit2;
00603     }
00604
00605     //
00606     // But first, fill in the info for the BitmapFileHeader
00607     //
00608     bfh.bfType = 0x4D42;                            // 'BM'
00609     bfh.bfSize = sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER)+sizBMI+
00610         pbmi->bmiHeader.biSizeImage;
00611     bfh.bfReserved1 =
00612     bfh.bfReserved2 = 0;
00613     bfh.bfOffBits = sizeof(BITMAPFILEHEADER)+sizBMI;
00614
00615     //
00616     // Write out the file header now
00617     //
00618     if (_lwrite(hFile, (LPSTR)&bfh, sizeof(BITMAPFILEHEADER)) == -1) {
00619         bSuccess = FALSE;
00620         goto ErrExit3;
00621     }
00622
00623     //
00624     // Bitmap can't be selected into a DC when calling GetDIBits
00625     // Assume that the hDC is the DC where the bitmap would have been selected
00626     // if indeed it has been selected
00627     //
00628     if (hTmpBmp = CreateCompatibleBitmap(hDC, pbmi->bmiHeader.biWidth, pbmi->bmiHeader.biHeight)) {
00629         hBmpOld = SelectObject(hDC, hTmpBmp);
00630         if ((GetDIBits(hDC, hBmp, 0, pbmi->bmiHeader.biHeight, (LPSTR)pBits, pbmi, DIB_RGB_COLORS))==0){
00631             bSuccess = FALSE;
00632             goto ErrExit4;
00633         }
00634     } else {
00635         bSuccess = FALSE;
00636         goto ErrExit3;
00637     }
00638
00639     //
00640     // Now write out the BitmapInfoHeader and color table, if any
00641     //
00642     if (_lwrite(hFile, (LPSTR)pbmi, sizBMI) == -1) {
00643         bSuccess = FALSE;
00644         goto ErrExit4;
00645     }
00646
00647     //
00648     // write the bits also
00649     //
00650     if (_lwrite(hFile, (LPSTR)pBits, pbmi->bmiHeader.biSizeImage) == -1) {
00651         bSuccess = FALSE;
00652         goto ErrExit4;
00653     }
00654
00655
00656 ErrExit4:
00657     SelectObject(hDC, hBmpOld);
00658     DeleteObject(hTmpBmp);
00659 ErrExit3:
00660     _lclose(hFile);
00661 ErrExit2:
00662     GlobalFree(pbmi);
00663 ErrExit1:
00664     GlobalFree(pBits);
00665     return bSuccess;
00666 }

BOOL SaveDIB | ( | HBITMAP | hDib,
 |  | LPSTR | lpFileName
 | ) |

Definition at line 702 of file dib.c.

00703 {
00704     BITMAPFILEHEADER    bmfHdr;     /*  Header for Bitmap file */
00705     LPBITMAPINFOHEADER  lpBI;       /*  Pointer to DIB info structure */
00706     HANDLE              fh;         /*  file handle for opened file */
00707     DWORD               dwDIBSize;
00708     DWORD               dwWritten;
00709
00710     if (!hDib)
00711         return FALSE;
00712
00713     fh = CreateFile(lpFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
00714             FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
00715
00716     if (fh == INVALID_HANDLE_VALUE)
00717         return FALSE;
00718
00719     /*  Get a pointer to the DIB memory, the first of which contains */
00720     /*  a BITMAPINFO structure */
00721
00722     lpBI = (LPBITMAPINFOHEADER)GlobalLock(hDib);
00723     if (!lpBI)
00724     {
00725         CloseHandle(fh);
00726         return FALSE;
00727     }
00728
00729     /*  Check to see if we're dealing with an OS/2 DIB.  If so, don't */
00730     /*  save it because our functions aren't written to deal with these */
00731     /*  DIBs. */
00732
00733     if (lpBI->biSize != sizeof(BITMAPINFOHEADER))
00734     {
00735         GlobalUnlock(hDib);
00736         CloseHandle(fh);
00737         return FALSE;
00738     }
00739
00740     /*  Fill in the fields of the file header */
00741
00742     /*  Fill in file type (first 2 bytes must be "BM" for a bitmap) */
00743
00744     bmfHdr.bfType = DIB_HEADER_MARKER;  /*  "BM" */
00745
00746     /*  Calculating the size of the DIB is a bit tricky (if we want to */
00747     /*  do it right).  The easiest way to do this is to call GlobalSize() */
00748     /*  on our global handle, but since the size of our global memory may have */
00749     /*  been padded a few bytes, we may end up writing out a few too */
00750     /*  many bytes to the file (which may cause problems with some apps, */
00751     /*  like HC 3.0). */
00752     /*  */
00753     /*  So, instead let's calculate the size manually. */
00754     /*  */
00755     /*  To do this, find size of header plus size of color table.  Since the */
00756     /*  first DWORD in both BITMAPINFOHEADER and BITMAPCOREHEADER conains */
00757     /*  the size of the structure, let's use this. */
00758
00759     /*  Partial Calculation */
00760
00761     dwDIBSize = *(LPDWORD)lpBI + PaletteSize((LPSTR)lpBI);
00762
00763     /*  Now calculate the size of the image */
00764
00765     /*  It's an RLE bitmap, we can't calculate size, so trust the biSizeImage */
00766     /*  field */
00767
00768     if ((lpBI->biCompression == BI_RLE8) || (lpBI->biCompression == BI_RLE4))
00769         dwDIBSize += lpBI->biSizeImage;
00770     else
00771     {
00772         DWORD dwBmBitsSize;  /*  Size of Bitmap Bits only */
00773
00774         /*  It's not RLE, so size is Width (DWORD aligned) * Height */
00775
00776         dwBmBitsSize = WIDTHBYTES((lpBI->biWidth)*((DWORD)lpBI->biBitCount)) *
00777                 lpBI->biHeight;
00778
00779         dwDIBSize += dwBmBitsSize;
00780
00781         /*  Now, since we have calculated the correct size, why don't we */
00782         /*  fill in the biSizeImage field (this will fix any .BMP files which  */
00783         /*  have this field incorrect). */
00784
00785         lpBI->biSizeImage = dwBmBitsSize;
00786     }
00787
00788
00789     /*  Calculate the file size by adding the DIB size to sizeof(BITMAPFILEHEADER) */
00790
00791     bmfHdr.bfSize = dwDIBSize + sizeof(BITMAPFILEHEADER);
00792     bmfHdr.bfReserved1 = 0;
00793     bmfHdr.bfReserved2 = 0;
00794
00795     /*  Now, calculate the offset the actual bitmap bits will be in */
00796     /*  the file -- It's the Bitmap file header plus the DIB header, */
00797     /*  plus the size of the color table. */
00798
00799     bmfHdr.bfOffBits = (DWORD)sizeof(BITMAPFILEHEADER) + lpBI->biSize +
00800             PaletteSize((LPSTR)lpBI);
00801
00802     /*  Write the file header */
00803
00804     WriteFile(fh, (LPSTR)&bmfHdr, sizeof(BITMAPFILEHEADER), &dwWritten, NULL);
00805
00806     /*  Write the DIB header and the bits -- use local version of */
00807     /*  MyWrite, so we can write more than 32767 bytes of data */
00808
00809     WriteFile(fh, (LPSTR)lpBI, dwDIBSize, &dwWritten, NULL);
00810
00811     GlobalUnlock(hDib);
00812     CloseHandle(fh);
00813
00814     if (dwWritten == 0)
00815         return FALSE; /*  oops, something happened in the write */
00816     else
00817         return TRUE; /*  Success code */
00818 }

VOID WriteMapFileHeaderandConvertFromDwordAlignToPacked | ( | HFILE | fh,
 |  | LPBITMAPFILEHEADER | pbf
 | ) |

Definition at line 160 of file dib.c.

00161 {
00162
00163         /* write bfType*/
00164     _lwrite(fh, (LPSTR)&pbf->bfType, (UINT)sizeof (WORD));
00165         /* now pass over extra word, and only write next 3 DWORDS!*/
00166         _lwrite(fh, (LPSTR)&pbf->bfSize, sizeof(DWORD) * 3);
00167 }

Variable Documentation

WORD biBits

Definition at line 964 of file dib.c.

HPALETTE hPal

Definition at line 965 of file dib.c.

Referenced by CCJReBarCtrl::SetPalette.

Generated on Sun Feb 24 01:22:42 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


dib.h File Reference

rf/support/mfc/dib.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | DIB_HEADER_MARKER ((WORD) ('M' << 8) | 'B')
#define | WIDTHBYTES(i) ((i+31)/32*4)
#define | WIDTHBYTES16(i) ((i+15)/16*2)
#define | WIDTHBYTES8(i) ((i+7)/8)
#define | BM_ALLOC(nb, size) GlobalAllocPtr( GHND, (nb)*(size) )
#define | BM_FREE(ptr) GlobalFreePtr(ptr)
#define | BFT_BITMAP 0x4d42
#define | SIZEOF_BITMAPFILEHEADER_PACKED

Functions

VOID | DibCopyPalette (HBITMAP, HBITMAP)
WORD | PaletteSize (VOID FAR *)
WORD | DibNumColors (VOID FAR *)
WORD | DibGetPaletteSize (VOID FAR *)
VOID | WriteMapFileHeaderandConvertFromDwordAlignToPacked (HFILE, LPBITMAPFILEHEADER)
HANDLE | ReadDIBFile (HANDLE)
HANDLE | ReadDIBRsrc (HINSTANCE, HRSRC)
HBITMAP | LoadDIB (LPSTR)
BOOL | SaveDIB (HBITMAP, LPSTR)
HBITMAP | CreateDIB (DWORD, DWORD, WORD, HPALETTE)
HBITMAP | CopyScreenToBitmap (HWND, LPRECT)
HBITMAP | DIBToBitmap (HBITMAP)
HANDLE | DDBtoDIB (HBITMAP, WORD, HPALETTE)
BOOL | SaveBmpFromDDB (HDC, HBITMAP, PSTR)

Define Documentation

#define BFT_BITMAP 0x4d42

Definition at line 18 of file dib.h.

#define BM_ALLOC | ( | nb,
 |  | size | ) | GlobalAllocPtr( GHND, (nb)*(size) )

Definition at line 15 of file dib.h.

#define BM_FREE ( ptr ) GlobalFreePtr(ptr)

Definition at line 16 of file dib.h.

#define DIB_HEADER_MARKER ((WORD) ('M' << 8) | 'B')

Definition at line 4 of file dib.h.

#define SIZEOF_BITMAPFILEHEADER_PACKED

Value:

(   \
    sizeof(WORD) +          \
    sizeof(DWORD) +         \
    sizeof(WORD) +          \
    sizeof(WORD) +          \
    sizeof(DWORD))

Definition at line 24 of file dib.h.

#define WIDTHBYTES ( i ) ((i+31)/32*4)

Definition at line 6 of file dib.h.

Referenced by UMakeBitmap.

#define WIDTHBYTES16 ( i ) ((i+15)/16*2)

Definition at line 7 of file dib.h.

#define WIDTHBYTES8 ( i ) ((i+7)/8)

Definition at line 8 of file dib.h.

Referenced by UMakeBitmap.

Function Documentation

HBITMAP CopyScreenToBitmap | ( | HWND | ,
 |  | LPRECT |
 | ) |

Definition at line 848 of file dib.c.

00849 {
00850     HDC         hScrDC, hMemDC;         /*  screen DC and memory DC */
00851     HBITMAP     hBitmap, hOldBitmap;    /*  handles to deice-dependent bitmaps */
00852     int         nX, nY, nX2, nY2;       /*  coordinates of rectangle to grab */
00853     int         nWidth, nHeight;        /*  DIB width and height */
00854     int         xScrn, yScrn;           /*  screen resolution */
00855     /*  check for an empty rectangle */
00856
00857     if (IsRectEmpty(lpRect))
00858       return NULL;
00859
00860     /*  create a DC for the screen and create */
00861     /*  a memory DC compatible to screen DC */
00862
00863     /* hScrDC = CreateDC("DISPLAY", NULL, NULL, NULL); */
00864     /* hMemDC = CreateCompatibleDC(hScrDC); */
00865     hScrDC = GetDC(win);
00866     hMemDC = CreateCompatibleDC (hScrDC);
00867     /*  get points of rectangle to grab */
00868
00869     nX = lpRect->left;
00870     nY = lpRect->top;
00871     nX2 = lpRect->right;
00872     nY2 = lpRect->bottom;
00873
00874     /*  get screen resolution */
00875
00876     xScrn = GetDeviceCaps(hScrDC, HORZRES);
00877     yScrn = GetDeviceCaps(hScrDC, VERTRES);
00878
00879     /* make sure bitmap rectangle is visible */
00880
00881     if (nX < 0)
00882         nX = 0;
00883     if (nY < 0)
00884         nY = 0;
00885     if (nX2 > xScrn)
00886         nX2 = xScrn;
00887     if (nY2 > yScrn)
00888         nY2 = yScrn;
00889
00890     nWidth = nX2 - nX;
00891     nHeight = nY2 - nY;
00892
00893     // create a bitmap compatible with the screen DC
00894     hBitmap = CreateCompatibleBitmap(hScrDC, nWidth, nHeight);
00895
00896     // select new bitmap into memory DC
00897     hOldBitmap = SelectObject(hMemDC, hBitmap);
00898
00899     // bitblt screen DC to memory DC
00900     BitBlt(hMemDC, 0, 0, nWidth, nHeight, hScrDC, nX, nY, SRCCOPY);
00901
00902     // select old bitmap back into memory DC and get handle to
00903     // bitmap of the screen
00904
00905     hBitmap = SelectObject(hMemDC, hOldBitmap);
00906
00907     // clean up
00908
00909     ReleaseDC(win, hScrDC);
00910     DeleteDC(hMemDC);
00911
00912     // return handle to the bitmap
00913
00914     return hBitmap;
00915 }

HBITMAP CreateDIB | ( | DWORD | ,
 |  | DWORD | ,
 |  | WORD | ,
 |  | HPALETTE |
 | ) |

Definition at line 201 of file dib.c.

Referenced by UMakeBitmap.

00202 {
00203     BITMAPINFOHEADER    bi;             /*  bitmap header */
00204     LPBITMAPINFOHEADER  lpbi;           /*  pointer to BITMAPINFOHEADER */
00205     DWORD               dwLen;          /*  size of memory block */
00206     HBITMAP             hDIB;
00207     DWORD               dwBytesPerLine; /*  Number of bytes per scanline */
00208
00209
00210     /*  Make sure bits per pixel is valid */
00211
00212     if (wBitCount <= 1)
00213         wBitCount = 1;
00214     else if (wBitCount <= 4)
00215         wBitCount = 4;
00216     else if (wBitCount <= 8)
00217         wBitCount = 8;
00218     else if (wBitCount <= 24)
00219         wBitCount = 24;
00220     else
00221         wBitCount = 4;  /*  set default value to 4 if parameter is bogus */
00222
00223     /*  initialize BITMAPINFOHEADER */
00224
00225     bi.biSize = sizeof(BITMAPINFOHEADER);
00226     bi.biWidth = dwWidth;         /*  fill in width from parameter */
00227     bi.biHeight = dwHeight;       /*  fill in height from parameter */
00228     bi.biPlanes = 1;              /*  must be 1 */
00229     bi.biBitCount = wBitCount;    /*  from parameter */
00230     bi.biCompression = BI_RGB;
00231     bi.biSizeImage = 0;           /*  0's here mean "default" */
00232     bi.biXPelsPerMeter = 0;
00233     bi.biYPelsPerMeter = 0;
00234     bi.biClrUsed = 0;
00235     bi.biClrImportant = 0;
00236
00237     /*  calculate size of memory block required to store the DIB.  This */
00238     /*  block should be big enough to hold the BITMAPINFOHEADER, the color */
00239     /*  table, and the bits */
00240
00241     dwBytesPerLine = WIDTHBYTES(wBitCount * dwWidth);
00242     dwLen = bi.biSize + PaletteSize((LPSTR)&bi) + (dwBytesPerLine * dwHeight);
00243
00244     /*  alloc memory block to store our bitmap */
00245
00246     hDIB = GlobalAlloc(GHND, dwLen);
00247
00248     /*  major bummer if we couldn't get memory block */
00249
00250     if (!hDIB)
00251         return NULL;
00252
00253     /*  lock memory and get pointer to it */
00254
00255     lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDIB);
00256
00257     /*  use our bitmap info structure to fill in first part of */
00258     /*  our DIB with the BITMAPINFOHEADER */
00259
00260     *lpbi = bi;
00261
00262     /*
00263      * Copy the palette in the new created image
00264      */
00265     if (wBitCount == 8)
00266     {
00267         PALETTEENTRY pal[256];
00268         RGBQUAD *pRgb;
00269         int i;
00270
00271         GetPaletteEntries(hPal, 0, 256, pal);
00272
00273         pRgb = (RGBQUAD FAR *)((LPSTR)lpbi + (WORD)lpbi->biSize);
00274
00275         /* Fill in the palette entries from the DIB color table and
00276          * create a logical color palette.
00277          */
00278         for (i = 0; i < 256; i++)
00279         {
00280             pRgb[i].rgbRed = pal[i].peRed;
00281             pRgb[i].rgbGreen = pal[i].peGreen;
00282             pRgb[i].rgbBlue = pal[i].peBlue;
00283         }
00284     }
00285
00286     // Since we don't know what the colortable and bits should contain,
00287     // just leave these blank.  Unlock the DIB and return the HDIB.
00288
00289     GlobalUnlock(hDIB);
00290
00291     //return handle to the DIB
00292
00293     return hDIB;
00294 }

HANDLE DDBtoDIB | ( | HBITMAP | ,
 |  | WORD | ,
 |  | HPALETTE |
 | ) |

VOID DibCopyPalette | ( | HBITMAP | ,
 |  | HBITMAP |
 | ) |

Definition at line 99 of file dib.c.

00100 {
00101     LPBITMAPINFO src_header, dst_header;
00102     RGBQUAD *src_rgb, *dst_rgb;
00103     WORD colorMode;
00104
00105     src_header = (LPBITMAPINFO) GlobalLock((HGLOBAL)src);
00106     dst_header = (LPBITMAPINFO) GlobalLock((HGLOBAL)dst);
00107
00108     src_rgb = (RGBQUAD FAR *)((LPSTR)src_header + (WORD)src_header->bmiHeader.biSize);
00109     dst_rgb = (RGBQUAD FAR *)((LPSTR)dst_header + (WORD)dst_header->bmiHeader.biSize);
00110
00111     colorMode = DibGetPaletteSize(src_header);
00112     switch(colorMode)
00113     {
00114         case 4:
00115         case 8:
00116             memcpy(dst_rgb, src_rgb,PaletteSize(&src_header->bmiHeader));
00117             break;
00118     }
00119
00120     GlobalUnlock((HGLOBAL)src);
00121     GlobalUnlock((HGLOBAL)dst);
00122 }

WORD DibGetPaletteSize ( VOID FAR * )

Definition at line 69 of file dib.c.

00070 {
00071     INT                 bits;
00072     LPBITMAPINFOHEADER  lpbi;
00073     LPBITMAPCOREHEADER  lpbc;
00074
00075     lpbi = ((LPBITMAPINFOHEADER)pv);
00076     lpbc = ((LPBITMAPCOREHEADER)pv);
00077
00078     /*  With the BITMAPINFO format headers, the size of the palette
00079      *  is in biClrUsed, whereas in the BITMAPCORE - style headers, it
00080      *  is dependent on the bits per pixel ( = 2 raised to the power of
00081      *  bits/pixel).
00082      */
00083     if (lpbi->biSize != sizeof(BITMAPCOREHEADER))
00084         bits = lpbi->biBitCount;
00085     else
00086         bits = lpbc->bcBitCount;
00087
00088     return bits;
00089 }

WORD DibNumColors ( VOID FAR * )

Definition at line 24 of file dib.c.

00025 {
00026     INT                 bits;
00027     LPBITMAPINFOHEADER  lpbi;
00028     LPBITMAPCOREHEADER  lpbc;
00029
00030     lpbi = ((LPBITMAPINFOHEADER)pv);
00031     lpbc = ((LPBITMAPCOREHEADER)pv);
00032
00033     /*  With the BITMAPINFO format headers, the size of the palette
00034      *  is in biClrUsed, whereas in the BITMAPCORE - style headers, it
00035      *  is dependent on the bits per pixel ( = 2 raised to the power of
00036      *  bits/pixel).
00037      */
00038     if (lpbi->biSize != sizeof(BITMAPCOREHEADER)){
00039         if (lpbi->biClrUsed != 0)
00040             return (WORD)lpbi->biClrUsed;
00041         bits = lpbi->biBitCount;
00042     }
00043     else
00044         bits = lpbc->bcBitCount;
00045
00046     switch (bits){
00047         case 1:
00048                 return 2;
00049         case 4:
00050                 return 16;
00051         case 8:
00052                 return 256;
00053         default:
00054                 /* A 24 bitcount DIB has no color table */
00055                 return 0;
00056     }
00057 }

HBITMAP DIBToBitmap ( HBITMAP )

Referenced by UMakeBitmap.

HBITMAP LoadDIB ( LPSTR )

Definition at line 480 of file dib.c.

00481 {
00482     HBITMAP     hDIB;
00483     HANDLE      hFile;
00484
00485     if ((hFile = CreateFile(lpFileName, GENERIC_READ, FILE_SHARE_READ, NULL,
00486             OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
00487             NULL)) != INVALID_HANDLE_VALUE)
00488     {
00489         hDIB = ReadDIBFile(hFile);
00490         CloseHandle(hFile);
00491         return hDIB;
00492     }
00493     else
00494         return NULL;
00495 }

WORD PaletteSize ( VOID FAR * )

Definition at line 136 of file dib.c.

Referenced by UMakeBitmap.

00137 {
00138     LPBITMAPINFOHEADER lpbi;
00139     WORD               NumColors;
00140
00141     lpbi      = (LPBITMAPINFOHEADER)pv;
00142     NumColors = DibNumColors(lpbi);
00143
00144     if (lpbi->biSize == sizeof(BITMAPCOREHEADER))
00145         return (WORD)(NumColors * sizeof(RGBTRIPLE));
00146     else
00147         return (WORD)(NumColors * sizeof(RGBQUAD));
00148 }

HANDLE ReadDIBFile ( HANDLE )

Definition at line 324 of file dib.c.

00325 {
00326     BITMAPFILEHEADER    bmfHeader;
00327     DWORD               dwBitsSize;
00328     UINT                nNumColors;   /*  Number of colors in table */
00329     HANDLE              hDIB;
00330     HANDLE              hDIBtmp;      /*  Used for GlobalRealloc() //MPB */
00331     LPBITMAPINFOHEADER  lpbi;
00332     DWORD               offBits;
00333     DWORD               dwRead;
00334
00335     /*  get length of DIB in bytes for use when reading */
00336
00337     dwBitsSize = GetFileSize(hFile, NULL);
00338
00339     /*  Allocate memory for header & color table. We'll enlarge this */
00340     /*  memory as needed. */
00341
00342     hDIB = GlobalAlloc(GMEM_MOVEABLE, (DWORD)(sizeof(BITMAPINFOHEADER) +
00343             256 * sizeof(RGBQUAD)));
00344
00345     if (!hDIB)
00346         return NULL;
00347
00348     lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDIB);
00349
00350     if (!lpbi)
00351     {
00352         GlobalFree(hDIB);
00353         return NULL;
00354     }
00355
00356     /*  read the BITMAPFILEHEADER from our file */
00357
00358     if (!ReadFile(hFile, (LPSTR)&bmfHeader, sizeof (BITMAPFILEHEADER),
00359             &dwRead, NULL))
00360         goto ErrExit;
00361
00362     if (sizeof (BITMAPFILEHEADER) != dwRead)
00363         goto ErrExit;
00364
00365     if (bmfHeader.bfType != 0x4d42)  /*  'BM' */
00366         goto ErrExit;
00367
00368     /*  read the BITMAPINFOHEADER */
00369
00370     if (!ReadFile(hFile, (LPSTR)lpbi, sizeof(BITMAPINFOHEADER), &dwRead,
00371             NULL))
00372         goto ErrExit;
00373
00374     if (sizeof(BITMAPINFOHEADER) != dwRead)
00375         goto ErrExit;
00376
00377     /*  Check to see that it's a Windows DIB -- an OS/2 DIB would cause */
00378     /*  strange problems with the rest of the DIB API since the fields */
00379     /*  in the header are different and the color table entries are */
00380     /*  smaller. */
00381     /*  */
00382     /*  If it's not a Windows DIB (e.g. if biSize is wrong), return NULL. */
00383
00384     if (lpbi->biSize == sizeof(BITMAPCOREHEADER))
00385         goto ErrExit;
00386
00387     /*  Now determine the size of the color table and read it.  Since the */
00388     /*  bitmap bits are offset in the file by bfOffBits, we need to do some */
00389     /*  special processing here to make sure the bits directly follow */
00390     /*  the color table (because that's the format we are susposed to pass */
00391     /*  back) */
00392
00393     if (!(nNumColors = (UINT)lpbi->biClrUsed))
00394     {
00395         /*  no color table for 24-bit, default size otherwise */
00396
00397         if (lpbi->biBitCount != 24)
00398             nNumColors = 1 << lpbi->biBitCount; /*  standard size table */
00399     }
00400
00401     /*  fill in some default values if they are zero */
00402
00403     if (lpbi->biClrUsed == 0)
00404         lpbi->biClrUsed = nNumColors;
00405
00406     if (lpbi->biSizeImage == 0)
00407     {
00408         lpbi->biSizeImage = ((((lpbi->biWidth * (DWORD)lpbi->biBitCount) +
00409                 31) & ~31) >> 3) * lpbi->biHeight;
00410     }
00411
00412     /*  get a proper-sized buffer for header, color table and bits */
00413
00414     GlobalUnlock(hDIB);
00415     hDIBtmp = GlobalReAlloc(hDIB, lpbi->biSize + nNumColors *
00416             sizeof(RGBQUAD) + lpbi->biSizeImage, 0);
00417
00418     if (!hDIBtmp) /*  can't resize buffer for loading */
00419         goto ErrExitNoUnlock; /* MPB */
00420     else
00421         hDIB = hDIBtmp;
00422
00423     lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDIB);
00424
00425     /*  read the color table */
00426
00427     ReadFile (hFile, (LPSTR)(lpbi) + lpbi->biSize,
00428             nNumColors * sizeof(RGBQUAD), &dwRead, NULL);
00429
00430     /*  offset to the bits from start of DIB header */
00431
00432     offBits = lpbi->biSize + nNumColors * sizeof(RGBQUAD);
00433
00434     /*  If the bfOffBits field is non-zero, then the bits might *not* be */
00435     /*  directly following the color table in the file.  Use the value in */
00436     /*  bfOffBits to seek the bits. */
00437
00438     if (bmfHeader.bfOffBits != 0L)
00439         SetFilePointer(hFile, bmfHeader.bfOffBits, NULL, FILE_BEGIN);
00440
00441     if (ReadFile(hFile, (LPSTR)lpbi + offBits, lpbi->biSizeImage, &dwRead,
00442             NULL))
00443         goto OKExit;
00444
00445
00446 ErrExit:
00447     GlobalUnlock(hDIB);
00448
00449 ErrExitNoUnlock:
00450     GlobalFree(hDIB);
00451     return NULL;
00452
00453 OKExit:
00454     GlobalUnlock(hDIB);
00455     return hDIB;
00456 }

HANDLE ReadDIBRsrc | ( | HINSTANCE | ,
 |  | HRSRC |
 | ) |

BOOL SaveBmpFromDDB | ( | HDC | ,
 |  | HBITMAP | ,
 |  | PSTR |
 | ) |

Definition at line 506 of file dib.c.

00507 {
00508     int         hFile;
00509     OFSTRUCT    ofReOpenBuff;
00510     HBITMAP     hTmpBmp, hBmpOld;
00511     BOOL        bSuccess;
00512     BITMAPFILEHEADER    bfh;
00513     PBITMAPINFO pbmi;
00514     PBYTE       pBits;
00515     BITMAPINFO  bmi;
00516     PBYTE pjTmp, pjTmpBmi;
00517     ULONG sizBMI;
00518
00519
00520     bSuccess = TRUE;
00521 #if 0
00522     if (ghPal) {
00523         SelectPalette(hDC, ghPal, FALSE);
00524         RealizePalette(hDC);
00525     }
00526 #endif
00527     if (!hBmp) {
00528         return FALSE;
00529     }
00530
00531     //
00532     // Let the graphics engine to retrieve the dimension of the bitmap for us
00533     // GetDIBits uses the size to determine if it's BITMAPCOREINFO or BITMAPINFO
00534     // if BitCount != 0, color table will be retrieved
00535     //
00536     bmi.bmiHeader.biSize = 0x28;              // GDI need this to work
00537     bmi.bmiHeader.biBitCount = 0;             // don't get the color table
00538     if ((GetDIBits(hDC, hBmp, 0, 0, (LPSTR)NULL, &bmi, DIB_RGB_COLORS)) == 0) {
00539         return FALSE;
00540     }
00541
00542     //
00543     // Now that we know the size of the image, alloc enough memory to retrieve
00544     // the actual bits
00545     //
00546     if ((pBits = (PBYTE)GlobalAlloc(GMEM_FIXED | GMEM_ZEROINIT,
00547                 bmi.bmiHeader.biSizeImage)) == NULL) {
00548         return FALSE;
00549     }
00550
00551     //
00552     // Note: 24 bits per pixel has no color table.  So, we don't have to
00553     // allocate memory for retrieving that.  Otherwise, we do.
00554     //
00555     pbmi = &bmi;                                      // assume no color table
00556
00557     switch (bmi.bmiHeader.biBitCount) {
00558         case 24:                                      // has color table
00559             sizBMI = sizeof(BITMAPINFOHEADER);
00560             break;
00561         case 16:
00562         case 32:
00563             sizBMI = sizeof(BITMAPINFOHEADER)+sizeof(DWORD)*3;
00564             break;
00565         default:
00566             sizBMI = sizeof(BITMAPINFOHEADER)+sizeof(RGBQUAD)*(1<<bmi.bmiHeader.biBitCount);
00567             break;
00568
00569     }
00570
00571     //
00572     // Allocate memory for color table if it is not 24bpp...
00573     //
00574     if (sizBMI != sizeof(BITMAPINFOHEADER)) {
00575         ULONG       sizTmp;
00576         //
00577         // I need more memory for the color table
00578         //
00579         if ((pbmi = (PBITMAPINFO)GlobalAlloc(GMEM_FIXED | GMEM_ZEROINIT, sizBMI )) == NULL) {
00580             bSuccess = FALSE;
00581             goto ErrExit1;
00582         }
00583         //
00584         // Now that we've a bigger chunk of memory, let's copy the Bitmap
00585         // info header data over
00586         //
00587         pjTmp = (PBYTE)pbmi;
00588         pjTmpBmi = (PBYTE)&bmi;
00589         sizTmp = sizeof(BITMAPINFOHEADER);
00590
00591         while(sizTmp--)
00592         {
00593             *(((PBYTE)pjTmp)++) = *((pjTmpBmi)++);
00594         }
00595     }
00596
00597     //
00598     // Let's open the file and get ready for writing
00599     //
00600     if ((hFile = OpenFile(pszFileName, (LPOFSTRUCT)&ofReOpenBuff,
00601                  OF_CREATE | OF_WRITE)) == -1) {
00602         goto ErrExit2;
00603     }
00604
00605     //
00606     // But first, fill in the info for the BitmapFileHeader
00607     //
00608     bfh.bfType = 0x4D42;                            // 'BM'
00609     bfh.bfSize = sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER)+sizBMI+
00610         pbmi->bmiHeader.biSizeImage;
00611     bfh.bfReserved1 =
00612     bfh.bfReserved2 = 0;
00613     bfh.bfOffBits = sizeof(BITMAPFILEHEADER)+sizBMI;
00614
00615     //
00616     // Write out the file header now
00617     //
00618     if (_lwrite(hFile, (LPSTR)&bfh, sizeof(BITMAPFILEHEADER)) == -1) {
00619         bSuccess = FALSE;
00620         goto ErrExit3;
00621     }
00622
00623     //
00624     // Bitmap can't be selected into a DC when calling GetDIBits
00625     // Assume that the hDC is the DC where the bitmap would have been selected
00626     // if indeed it has been selected
00627     //
00628     if (hTmpBmp = CreateCompatibleBitmap(hDC, pbmi->bmiHeader.biWidth, pbmi->bmiHeader.biHeight)) {
00629         hBmpOld = SelectObject(hDC, hTmpBmp);
00630         if ((GetDIBits(hDC, hBmp, 0, pbmi->bmiHeader.biHeight, (LPSTR)pBits, pbmi, DIB_RGB_COLORS))==0){
00631             bSuccess = FALSE;
00632             goto ErrExit4;
00633         }
00634     } else {
00635         bSuccess = FALSE;
00636         goto ErrExit3;
00637     }
00638
00639     //
00640     // Now write out the BitmapInfoHeader and color table, if any
00641     //
00642     if (_lwrite(hFile, (LPSTR)pbmi, sizBMI) == -1) {
00643         bSuccess = FALSE;
00644         goto ErrExit4;
00645     }
00646
00647     //
00648     // write the bits also
00649     //
00650     if (_lwrite(hFile, (LPSTR)pBits, pbmi->bmiHeader.biSizeImage) == -1) {
00651         bSuccess = FALSE;
00652         goto ErrExit4;
00653     }
00654
00655
00656 ErrExit4:
00657     SelectObject(hDC, hBmpOld);
00658     DeleteObject(hTmpBmp);
00659 ErrExit3:
00660     _lclose(hFile);
00661 ErrExit2:
00662     GlobalFree(pbmi);
00663 ErrExit1:
00664     GlobalFree(pBits);
00665     return bSuccess;
00666 }

BOOL SaveDIB | ( | HBITMAP | ,
 |  | LPSTR |
 | ) |

Definition at line 702 of file dib.c.

00703 {
00704     BITMAPFILEHEADER    bmfHdr;     /*  Header for Bitmap file */
00705     LPBITMAPINFOHEADER  lpBI;       /*  Pointer to DIB info structure */
00706     HANDLE              fh;         /*  file handle for opened file */
00707     DWORD               dwDIBSize;
00708     DWORD               dwWritten;
00709
00710     if (!hDib)
00711         return FALSE;
00712
00713     fh = CreateFile(lpFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
00714             FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
00715
00716     if (fh == INVALID_HANDLE_VALUE)
00717         return FALSE;
00718
00719     /*  Get a pointer to the DIB memory, the first of which contains */
00720     /*  a BITMAPINFO structure */
00721
00722     lpBI = (LPBITMAPINFOHEADER)GlobalLock(hDib);
00723     if (!lpBI)
00724     {
00725         CloseHandle(fh);
00726         return FALSE;
00727     }
00728
00729     /*  Check to see if we're dealing with an OS/2 DIB.  If so, don't */
00730     /*  save it because our functions aren't written to deal with these */
00731     /*  DIBs. */
00732
00733     if (lpBI->biSize != sizeof(BITMAPINFOHEADER))
00734     {
00735         GlobalUnlock(hDib);
00736         CloseHandle(fh);
00737         return FALSE;
00738     }
00739
00740     /*  Fill in the fields of the file header */
00741
00742     /*  Fill in file type (first 2 bytes must be "BM" for a bitmap) */
00743
00744     bmfHdr.bfType = DIB_HEADER_MARKER;  /*  "BM" */
00745
00746     /*  Calculating the size of the DIB is a bit tricky (if we want to */
00747     /*  do it right).  The easiest way to do this is to call GlobalSize() */
00748     /*  on our global handle, but since the size of our global memory may have */
00749     /*  been padded a few bytes, we may end up writing out a few too */
00750     /*  many bytes to the file (which may cause problems with some apps, */
00751     /*  like HC 3.0). */
00752     /*  */
00753     /*  So, instead let's calculate the size manually. */
00754     /*  */
00755     /*  To do this, find size of header plus size of color table.  Since the */
00756     /*  first DWORD in both BITMAPINFOHEADER and BITMAPCOREHEADER conains */
00757     /*  the size of the structure, let's use this. */
00758
00759     /*  Partial Calculation */
00760
00761     dwDIBSize = *(LPDWORD)lpBI + PaletteSize((LPSTR)lpBI);
00762
00763     /*  Now calculate the size of the image */
00764
00765     /*  It's an RLE bitmap, we can't calculate size, so trust the biSizeImage */
00766     /*  field */
00767
00768     if ((lpBI->biCompression == BI_RLE8) || (lpBI->biCompression == BI_RLE4))
00769         dwDIBSize += lpBI->biSizeImage;
00770     else
00771     {
00772         DWORD dwBmBitsSize;  /*  Size of Bitmap Bits only */
00773
00774         /*  It's not RLE, so size is Width (DWORD aligned) * Height */
00775
00776         dwBmBitsSize = WIDTHBYTES((lpBI->biWidth)*((DWORD)lpBI->biBitCount)) *
00777                 lpBI->biHeight;
00778
00779         dwDIBSize += dwBmBitsSize;
00780
00781         /*  Now, since we have calculated the correct size, why don't we */
00782         /*  fill in the biSizeImage field (this will fix any .BMP files which  */
00783         /*  have this field incorrect). */
00784
00785         lpBI->biSizeImage = dwBmBitsSize;
00786     }
00787
00788
00789     /*  Calculate the file size by adding the DIB size to sizeof(BITMAPFILEHEADER) */
00790
00791     bmfHdr.bfSize = dwDIBSize + sizeof(BITMAPFILEHEADER);
00792     bmfHdr.bfReserved1 = 0;
00793     bmfHdr.bfReserved2 = 0;
00794
00795     /*  Now, calculate the offset the actual bitmap bits will be in */
00796     /*  the file -- It's the Bitmap file header plus the DIB header, */
00797     /*  plus the size of the color table. */
00798
00799     bmfHdr.bfOffBits = (DWORD)sizeof(BITMAPFILEHEADER) + lpBI->biSize +
00800             PaletteSize((LPSTR)lpBI);
00801
00802     /*  Write the file header */
00803
00804     WriteFile(fh, (LPSTR)&bmfHdr, sizeof(BITMAPFILEHEADER), &dwWritten, NULL);
00805
00806     /*  Write the DIB header and the bits -- use local version of */
00807     /*  MyWrite, so we can write more than 32767 bytes of data */
00808
00809     WriteFile(fh, (LPSTR)lpBI, dwDIBSize, &dwWritten, NULL);
00810
00811     GlobalUnlock(hDib);
00812     CloseHandle(fh);
00813
00814     if (dwWritten == 0)
00815         return FALSE; /*  oops, something happened in the write */
00816     else
00817         return TRUE; /*  Success code */
00818 }

VOID WriteMapFileHeaderandConvertFromDwordAlignToPacked | ( | HFILE | ,
 |  | LPBITMAPFILEHEADER |
 | ) |

Definition at line 160 of file dib.c.

00161 {
00162
00163         /* write bfType*/
00164     _lwrite(fh, (LPSTR)&pbf->bfType, (UINT)sizeof (WORD));
00165         /* now pass over extra word, and only write next 3 DWORDS!*/
00166         _lwrite(fh, (LPSTR)&pbf->bfSize, sizeof(DWORD) * 3);
00167 }

Generated on Sun Feb 24 01:22:42 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PseudoButton.cpp File Reference

rf/support/mfc/PseudoButton.cpp File Reference

#include "stdafx.h"
#include "umain.h"
#include "PseudoButton.h"
#include "dib.h"
#include <map>
#include <string.h>

Include dependency graph for PseudoButton.cpp:

Include dependency graph

Go to the source code of this file.

Functions

const BYTE * | nextLine (const BYTE *src, CString &line)
HBITMAP | UMakeBitmap (const void *icon, int &width, int &height, UTB_KIND kind, COLORREF back, COLORREF fore, bool enabled)
HBITMAP | UMakeBitmap (const void *icon, int width, int height, UTB_KIND kind, bool enabled)

Function Documentation

const BYTE* nextLine | ( | const BYTE * | src,
 |  | CString & | line
 | ) | [static]

Definition at line 285 of file PseudoButton.cpp.

Referenced by UMakeBitmap.

00286 {
00287     const char *tmp = strchr((const char *)src, '\n');
00288     if(tmp == 0L)
00289         return 0L;
00290
00291     line = CString((const char *)src, tmp - (const char *)src - 1);
00292     src = (const BYTE *)tmp + 1;
00293     return src;
00294 }

HBITMAP UMakeBitmap | ( | const void * | icon,
 |  | int | width,
 |  | int | height,
 |  | UTB_KIND | kind,
 |  | bool | enabled
 | ) |

Definition at line 542 of file PseudoButton.cpp.

References UMakeBitmap, and UTB_KIND.

00543 {
00544     return UMakeBitmap(icon, width, height, kind,
00545         ::GetSysColor(COLOR_BTNFACE), ::GetSysColor(COLOR_BTNTEXT), enabled);
00546 }

HBITMAP UMakeBitmap | ( | const void * | icon,
 |  | int & | width,
 |  | int & | height,
 |  | UTB_KIND | kind,
 |  | COLORREF | back,
 |  | COLORREF | fore,
 |  | bool | enabled
 | ) |

Definition at line 296 of file PseudoButton.cpp.

References ASSERT, CreateDIB, DD_BMAP, DD_PIXMAP, DD_RGB, DIBToBitmap, nextLine, PaletteSize, UTB_KIND, WIDTHBYTES, and WIDTHBYTES8.

00298 {
00299     if( kind == DD_BMAP)
00300     {
00301         HBITMAP hbitmap;
00302         LPBITMAPINFO header;
00303         BYTE *image, *src = (BYTE *)icon, c, k;
00304         RGBQUAD *pRgb;
00305
00306         hbitmap = CreateDIB(width, height, 1, 0L);
00307         header = (LPBITMAPINFO)GlobalLock(hbitmap);
00308         image = (LPBYTE)header + header->bmiHeader.biSize + PaletteSize(header);
00309         pRgb = (RGBQUAD *)((LPBYTE)header + header->bmiHeader.biSize);
00310
00311         pRgb->rgbRed = GetRValue(back);
00312         pRgb->rgbGreen = GetGValue(back);
00313         pRgb->rgbBlue = GetBValue(back);
00314         pRgb->rgbReserved = 0;
00315         pRgb++;
00316         pRgb->rgbRed = GetRValue(fore);
00317         pRgb->rgbGreen = GetGValue(fore);
00318         pRgb->rgbBlue = GetBValue(fore);
00319         pRgb->rgbReserved = 0;
00320
00321         int row = WIDTHBYTES(width * 1);
00322         int row2 = WIDTHBYTES8(width * 1);
00323         for(int y = 0; y < height; y++)
00324         {
00325             BYTE *ptr = image + row * (height - y - 1);
00326             for(int x = 0; x < row2; x++)
00327             {
00328                 c = *src++;
00329                 k = 0;
00330                 int n = 8;
00331                 while(n--)
00332                 {
00333                     if(c & 1)
00334                         k |= 1 << n;
00335                     c = c >> 1;
00336                 }
00337                 *ptr++ = k;
00338             }
00339         }
00340
00341         GlobalUnlock(hbitmap);
00342
00343         HBITMAP ddbbmap = DIBToBitmap(hbitmap);
00344         GlobalFree((HGLOBAL)hbitmap);
00345
00346         return ddbbmap;
00347     }
00348     else if(kind == DD_PIXMAP)
00349     {
00350         const BYTE *src = (BYTE *)icon;
00351         CString aline;
00352
00353         src = nextLine(src, aline);
00354         if(src == 0L)
00355             return 0L;
00356
00357         // read the header
00358         int w, h, nc, cpp, i, x, y;
00359         if(sscanf(aline, "%d%d%d%d", &w, &h, &nc, &cpp) != 4)
00360             return 0L;
00361
00362         width = w;
00363         height = h;
00364
00365         HBITMAP hbitmap = CreateDIB(w, h, 8, 0L);
00366         LPBITMAPINFO header = (LPBITMAPINFO)GlobalLock(hbitmap);
00367         BYTE *image = (LPBYTE)header + header->bmiHeader.biSize + PaletteSize(header);
00368         RGBQUAD *pRgb = (RGBQUAD *)((LPBYTE)header + header->bmiHeader.biSize);
00369
00370         // read the colormap
00371         std::map<short, BYTE> colors;
00372         for(i = 0; i < nc; i++)
00373         {
00374             src = nextLine(src, aline);
00375             if(src == 0L)
00376                 return 0L;
00377
00378             const BYTE *line = (const BYTE *)(const char *)aline;
00379             short aref;
00380             if(cpp == 1)
00381             {
00382                 aref = line[0];
00383                 line += 1;
00384             }
00385             else if(cpp == 2)
00386             {
00387                 aref = ((short)line[1] << 8)  | line[0];
00388                 line += 2;
00389             }
00390             else
00391             {
00392                 ASSERT(0);
00393                 return 0L;
00394             }
00395
00396             while(isspace(*line) && *line)
00397                 line++;
00398             if(*line++ != 'c')
00399                 return 0L;
00400
00401             while(isspace(*line) && *line)
00402                 line++;
00403             if(*line == '\0')
00404                 return 0L;
00405
00406             if(*line == '#')
00407             {
00408                 line++;
00409
00410                 if(strlen((char *)line) < 6)
00411                     return 0L;
00412
00413                 int comp[6], c;
00414                 int j;
00415                 for(j = 0; j < 6; j++)
00416                 {
00417                     c = *line++;
00418                     if(c >= '0' && c <= '9')
00419                         comp[j] = c - '0';
00420                     else if(c >= 'a' && c <= 'f')
00421                         comp[j] = c - 'a' + 10;
00422                     else if(c >= 'A' && c <= 'F')
00423                         comp[j] = c - 'A' + 10;
00424                     else
00425                         return 0L;
00426                 }
00427
00428                 colors.insert(std::make_pair(aref, i));
00429
00430                 if(i == 0)
00431                 {
00432                     COLORREF bk = back;
00433                     pRgb->rgbRed = GetRValue(bk);
00434                     pRgb->rgbGreen = GetGValue(bk);
00435                     pRgb->rgbBlue = GetBValue(bk);
00436                     pRgb->rgbReserved = 0;
00437                 }
00438                 else
00439                 {
00440                     COLORREF color = RGB(comp[0]*16+comp[1],comp[2]*16+comp[3],comp[4]*16+comp[5]);
00441                     if(!enabled)
00442                         color = fore;
00443                     pRgb->rgbRed = GetRValue(color);
00444                     pRgb->rgbGreen = GetGValue(color);
00445                     pRgb->rgbBlue = GetBValue(color);
00446                     pRgb->rgbReserved = 0;
00447                 }
00448             }
00449             else if(strcmp((char *)line, "None") == 0)
00450             {
00451                 colors.insert(std::make_pair(aref, i));
00452                 COLORREF bk = back;
00453                 pRgb->rgbRed = GetRValue(bk);
00454                 pRgb->rgbGreen = GetGValue(bk);
00455                 pRgb->rgbBlue = GetBValue(bk);
00456                 pRgb->rgbReserved = 0;
00457             }
00458             else
00459                 return 0L;
00460             pRgb++;
00461         }
00462
00463         if(nc != colors.size() || nc > 256)
00464             return 0L;
00465
00466         // make the bitmap
00467         for(y = 0; y < h; y++)
00468         {
00469             src = nextLine(src, aline);
00470             if(src == 0L)
00471                 return 0L;
00472
00473             const BYTE *line = (const BYTE *)(const char *)aline;
00474             BYTE *ptr = image + WIDTHBYTES(w * 8) * (h - y - 1);
00475             for(x = 0; x < w; x++)
00476             {
00477                 short aref;
00478                 if(cpp == 1)
00479                 {
00480                     aref = line[0];
00481                     line++;
00482                 }
00483                 else if(cpp == 2)
00484                 {
00485                     aref = ((short)line[1] << 8)  | line[0];
00486                     line += 2;
00487                 }
00488                 std::map<short, BYTE>::iterator pos = colors.find(aref);
00489                 if(pos == colors.end())
00490                     return 0L;
00491                 *ptr++ = (*pos).second;
00492             }
00493         }
00494
00495         GlobalUnlock(hbitmap);
00496
00497         HBITMAP ddbbmap = DIBToBitmap(hbitmap);
00498         GlobalFree((HGLOBAL)hbitmap);
00499
00500         return ddbbmap;
00501     }
00502     else if(kind == DD_RGB)
00503     {
00504         BYTE *src = (BYTE *)icon;
00505
00506         // read the header
00507         int w = width, h = height, x, y;
00508
00509         HBITMAP hbitmap = CreateDIB(w, h, 24, 0L);
00510         LPBITMAPINFO header = (LPBITMAPINFO)GlobalLock(hbitmap);
00511         BYTE *image = (LPBYTE)header + header->bmiHeader.biSize + PaletteSize(header);
00512
00513         // make the bitmap
00514         for(y = 0; y < h; y++)
00515         {
00516 #if 0
00517             BYTE *ptr = image + WIDTHBYTES(w * 24) * (h - y - 1);
00518 #else
00519             BYTE *ptr = image + WIDTHBYTES(w * 24) * y;
00520 #endif
00521             for(x = 0; x < w; x++)
00522             {
00523                 ptr[2] = *src++;
00524                 ptr[1] = *src++;
00525                 ptr[0] = *src++;
00526                 ptr += 3;
00527                 src++;
00528             }
00529         }
00530
00531         GlobalUnlock(hbitmap);
00532
00533         HBITMAP ddbbmap = DIBToBitmap(hbitmap);
00534         GlobalFree((HGLOBAL)hbitmap);
00535
00536         return ddbbmap;
00537     }
00538
00539     return 0L;
00540 }

Generated on Sun Feb 24 01:22:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PseudoButton.h File Reference

rf/support/mfc/PseudoButton.h File Reference

#include <vector>

Include dependency graph for PseudoButton.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CPseudoButton
class | CPseudoRotButton
class | CPseudoToggle

Enumerations

enum UTB_KIND {
DD_END,
DD_PIXMAP,
DD_BMAP,
DD_RGB
}

Functions

HBITMAP | UMakeBitmap (const void *icon, int &width, int &height, UTB_KIND kind, COLORREF back, COLORREF fore, bool enabled=true)
HBITMAP | UMakeBitmap (const void *icon, int width, int height, UTB_KIND kind, bool enabled=true)

Enumeration Type Documentation

enum UTB_KIND

Enumeration values:
DD_END
DD_PIXMAP
DD_BMAP
DD_RGB

Definition at line 28 of file PseudoButton.h.

Referenced by UMakeBitmap.

00029 {
00030     DD_END,
00031     DD_PIXMAP,  /* X11 pixmap (color indexed) */
00032     DD_BMAP,    /* X11 bitmap (B&W) */
00033     DD_RGB      /* RGB / char */
00034 } UTB_KIND;

Function Documentation

HBITMAP UMakeBitmap | ( | const void * | icon,
 |  | int | width,
 |  | int | height,
 |  | UTB_KIND | kind,
 |  | bool | enabled = true
 | ) |

HBITMAP UMakeBitmap | ( | const void * | icon,
 |  | int & | width,
 |  | int & | height,
 |  | UTB_KIND | kind,
 |  | COLORREF | back,
 |  | COLORREF | fore,
 |  | bool | enabled = true
 | ) |

Generated on Sun Feb 24 01:22:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PseudoDlg.cpp File Reference

rf/support/mfc/PseudoDlg.cpp File Reference

#include "stdafx.h"
#include "uwidget.h"
#include "PseudoDlg.h"
#include "PseudoDraw.h"
#include "PseudoList.h"
#include "SmartComboBox.h"

Include dependency graph for PseudoDlg.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | IS_PSEUDO_CTL(id) ((id) >= WINCMD_DLG_START && (id) < WINCMD_DLG_END)

Functions

void | WinInitWidgets (CWnd *wnd, UWidget *pseudo)
int | findIdForWnd (CWnd *wnd, UWidget *wid)
int | UWinToUMod (UINT nFlags)
LRESULT | UWinPseudoWindowProc (CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam)

Define Documentation

#define IS_PSEUDO_CTL ( id ) ((id) >= WINCMD_DLG_START && (id) < WINCMD_DLG_END)

Definition at line 37 of file PseudoDlg.cpp.

Referenced by UWinPseudoWindowProc, and WinInitWidgets.

Function Documentation

int findIdForWnd | ( | CWnd * | wnd,
 |  | UWidget * | wid
 | ) | [static]

Definition at line 181 of file PseudoDlg.cpp.

References UWidget::GetWidgets.

Referenced by UWinPseudoWindowProc.

00182 {
00183     const std::map<int, void *> & allWids = wid->GetWidgets();
00184     std::map<int, void *>::const_iterator i;
00185     for(i = allWids.begin(); i != allWids.end(); ++i)
00186     {
00187         if(wnd == (CWnd *)(*i).second)
00188             return (*i).first;
00189     }
00190     return -1;
00191 }

LRESULT UWinPseudoWindowProc | ( | CWnd * | wnd,
 |  | UWidget * | wid,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |

Definition at line 212 of file PseudoDlg.cpp.

References ASSERT, UWidget::DoValidUI, EV_BTNDBLDOWN, EV_BTNDOWN, EV_BTNUP, EV_CMD, EV_COMBO_SEL, EV_EDITCHANGE, EV_KEYDOWN, EV_LIST_SELECTING, EV_MMOVE, EV_RESIZE, EV_SCROLLCHANGE, findIdForWnd, UWidget::GetWidget, UWidget::GetWidgets, UCmdTarget::GetWidID, IS_PSEUDO_CTL, UWidget::m_noDispatch, NULL, UEventSendMessage, UMAKEINT, UWinToUMod, VERIFY, and WINCTL_to_UCMD.

00213 {
00214     bool sentOne = false;
00215
00216     if(wid == 0L)
00217         return 1;
00218
00219     if (message == WM_COMMAND)
00220     {
00221         UINT nID = LOWORD(wParam);
00222         if(!IS_PSEUDO_CTL(nID))
00223             return 1;
00224
00225         int nCode = HIWORD(wParam);
00226         HWND hWndCtrl = (HWND)lParam;
00227         switch(nCode)
00228         {
00229         case BN_CLICKED:
00230             UEventSendMessage(wid->GetWidID(), EV_CMD, WINCTL_to_UCMD(nID), 0L);
00231             sentOne = true;
00232             break;
00233         case CBN_SELCHANGE:
00234         {
00235             ASSERT(::IsWindow(hWndCtrl));
00236             int sel = (int)::SendMessage(hWndCtrl, CB_GETCURSEL, 0, 0);
00237             const char *txt = 0L;
00238             char buf[1024] = {'\0'};
00239             if(sel != -1 && (int)::SendMessage(hWndCtrl, CB_GETLBTEXT, sel, (LPARAM)buf) != CB_ERR)
00240                 txt = buf;
00241             if(strcmp(buf, "-") != 0) // separator
00242                 UEventSendMessage(wid->GetWidID(), EV_COMBO_SEL,
00243                     UMAKEINT(WINCTL_to_UCMD(nID), sel), (void *)txt);
00244             sentOne = true;
00245             break;
00246         }
00247         case EN_CHANGE:
00248             if(wid->m_noDispatch)
00249                 break;
00250
00251             ASSERT(::IsWindow(hWndCtrl));
00252             UEventSendMessage(wid->GetWidID(), EV_EDITCHANGE,
00253                 WINCTL_to_UCMD(nID), 0L);
00254             break;
00255         }
00256     }
00257     else if (message == WM_NOTIFY)
00258     {
00259         NMHDR* pNMHDR = (NMHDR*)lParam;
00260         if (pNMHDR->hwndFrom != NULL)
00261         {
00262             UINT nID = _AfxGetDlgCtrlID(pNMHDR->hwndFrom);
00263             int nCode = pNMHDR->code;
00264             if(!IS_PSEUDO_CTL(nID))
00265                 return 1;
00266
00267             switch(nCode)
00268             {
00269             case LVN_ITEMCHANGED:
00270                 NMLISTVIEW *state = (NMLISTVIEW *)pNMHDR;
00271
00272                 HWND wnd = state->hdr.hwndFrom;
00273                 ASSERT(::IsWindow(wnd));
00274
00275                 int id = state->hdr.idFrom;
00276                 std::map<int, void *>::const_iterator i = wid->GetWidgets().find(WINCTL_to_UCMD(id));
00277                 if(i != wid->GetWidgets().end())
00278                 {
00279                     CWnd *w = (CWnd *)(*i).second;
00280                     if(w->IsKindOf(RUNTIME_CLASS(CListCtrl)))
00281                     {
00282                         CListCtrl *list = (CListCtrl*)w;
00283                         CString s = list->GetItemText(state->iItem, 0);
00284
00285                         UEventSendMessage(wid->GetWidID(), EV_LIST_SELECTING,
00286                             UMAKEINT(WINCTL_to_UCMD(state->hdr.idFrom), state->iItem), (void *)(const char *)s);
00287                         sentOne = true;
00288                     }
00289                 }
00290                 break;
00291             }
00292         }
00293     }
00294     else if (message == WM_SIZE)
00295     {
00296         int id = findIdForWnd(wnd, wid);
00297         if(id != -1)
00298         {
00299             URECT r = {0, 0, LOWORD(lParam), HIWORD(lParam)};
00300             UEventSendMessage(wid->GetWidID(), EV_RESIZE, id, &r);
00301             sentOne = true;
00302         }
00303     }
00304     else if (message == WM_MOUSEMOVE)
00305     {
00306         int id = findIdForWnd(wnd, wid);
00307         if(id != -1)
00308         {
00309             UEventSendMessage(wid->GetWidID(), EV_MMOVE, UMAKEINT(LOWORD(lParam), HIWORD(lParam)),
00310                 (void *)UWinToUMod(wParam));
00311             sentOne = true;
00312         }
00313     }
00314     else if (message == WM_LBUTTONDOWN)
00315     {
00316         int id = findIdForWnd(wnd, wid);
00317         if(id != -1)
00318         {
00319             UEventSendMessage(wid->GetWidID(), EV_BTNDOWN, UMAKEINT(LOWORD(lParam), HIWORD(lParam)),
00320                 (void *)UWinToUMod(wParam));
00321             sentOne = true;
00322         }
00323     }
00324     else if (message == WM_LBUTTONUP)
00325     {
00326         int id = findIdForWnd(wnd, wid);
00327         if(id != -1)
00328         {
00329             UEventSendMessage(wid->GetWidID(), EV_BTNUP, UMAKEINT(LOWORD(lParam), HIWORD(lParam)),
00330                 (void *)UWinToUMod(wParam));
00331             sentOne = true;
00332         }
00333     }
00334     else if (message == WM_LBUTTONDBLCLK)
00335     {
00336         int id = findIdForWnd(wnd, wid);
00337         if(id != -1)
00338         {
00339             UEventSendMessage(wid->GetWidID(), EV_BTNDBLDOWN, UMAKEINT(LOWORD(lParam), HIWORD(lParam)),
00340                 (void *)UWinToUMod(wParam));
00341             sentOne = true;
00342         }
00343     }
00344     else if (message == WM_KEYDOWN)
00345     {
00346         int id = findIdForWnd(wnd, wid);
00347         if(id != -1)
00348         {
00349             UEventSendMessage(wid->GetWidID(), EV_KEYDOWN, wParam, 0L);
00350             sentOne = true;
00351         }
00352     }
00353     else if (message == WM_HSCROLL)
00354     {
00355         HWND hwndScrollBar = (HWND) lParam;       // handle to scroll bar
00356         int nID = ::GetDlgCtrlID(hwndScrollBar);
00357         if(!IS_PSEUDO_CTL(nID))
00358             return 1;
00359
00360         int cmd = WINCTL_to_UCMD(nID);
00361         CWnd *wnds = (CWnd *)wid->GetWidget(cmd);
00362         if(wnds == 0L || !wnds->IsKindOf(RUNTIME_CLASS(CScrollBar)))
00363             return 1;
00364
00365         CScrollBar *scroll = (CScrollBar *)wnds;
00366
00367         int nScrollCode = (int) LOWORD(wParam);  // scroll bar value
00368         int nPos;
00369         if(nScrollCode == SB_THUMBPOSITION || nScrollCode == SB_THUMBTRACK)
00370         {
00371             nPos = (short int) HIWORD(wParam);   // scroll box position
00372
00373             if(nScrollCode == SB_THUMBPOSITION)
00374                 scroll->SetScrollPos(nPos);
00375         }
00376         else
00377         {
00378             SCROLLINFO info;
00379             VERIFY(scroll->GetScrollInfo(&info));
00380             nPos = info.nPos;
00381
00382             switch(nScrollCode)
00383             {
00384             case SB_ENDSCROLL:
00385                 return 1;
00386                 break;
00387             case SB_LINELEFT:
00388                 nPos -= 1;
00389                 break;
00390             case SB_LINERIGHT:
00391                 nPos += 1;
00392                 break;
00393             case SB_PAGELEFT:
00394                 nPos -= info.nPage;
00395                 break;
00396             case SB_PAGERIGHT:
00397                 nPos += info.nPage;
00398                 break;
00399             case SB_LEFT:
00400                 nPos = info.nMin;
00401                 break;
00402             case SB_RIGHT:
00403                 nPos = info.nMax;
00404                 break;
00405             }
00406
00407             scroll->SetScrollPos(nPos);
00408         }
00409
00410         UEventSendMessage(wid->GetWidID(), EV_SCROLLCHANGE, WINCTL_to_UCMD(nID),
00411             (void *)nPos);
00412         sentOne = true;
00413     }
00414     else if (message == WM_VSCROLL)
00415     {
00416         HWND hwndScrollBar = (HWND) lParam;       // handle to scroll bar
00417         int nID = ::GetDlgCtrlID(hwndScrollBar);
00418         if(!IS_PSEUDO_CTL(nID))
00419             return 1;
00420
00421         int cmd = WINCTL_to_UCMD(nID);
00422         CWnd *wnds = (CWnd *)wid->GetWidget(cmd);
00423         if(wnds == 0L || !wnds->IsKindOf(RUNTIME_CLASS(CScrollBar)))
00424             return 1;
00425
00426         CScrollBar *scroll = (CScrollBar *)wnds;
00427
00428         int nScrollCode = (int) LOWORD(wParam);  // scroll bar value
00429         int nPos;
00430         if(nScrollCode == SB_THUMBPOSITION || nScrollCode == SB_THUMBTRACK)
00431         {
00432             nPos = (short int) HIWORD(wParam);   // scroll box position
00433
00434             if(nScrollCode == SB_THUMBPOSITION)
00435                 scroll->SetScrollPos(nPos);
00436         }
00437         else
00438         {
00439             SCROLLINFO info;
00440             VERIFY(scroll->GetScrollInfo(&info));
00441             nPos = info.nPos;
00442
00443             switch(nScrollCode)
00444             {
00445             case SB_ENDSCROLL:
00446                 return 1;
00447                 break;
00448             case SB_LINEUP:
00449                 nPos -= 1;
00450                 break;
00451             case SB_LINEDOWN:
00452                 nPos += 1;
00453                 break;
00454             case SB_PAGEUP:
00455                 nPos -= info.nPage;
00456                 break;
00457             case SB_PAGEDOWN:
00458                 nPos += info.nPage;
00459                 break;
00460             case SB_TOP:
00461                 nPos = info.nMin;
00462                 break;
00463             case SB_BOTTOM:
00464                 nPos = info.nMax;
00465                 break;
00466             }
00467
00468             if(nPos > info.nMax)
00469                 nPos = info.nMax;
00470             else if(nPos < info.nMin)
00471                 nPos = info.nMin;
00472             scroll->SetScrollPos(nPos);
00473         }
00474
00475         UEventSendMessage(wid->GetWidID(), EV_SCROLLCHANGE, WINCTL_to_UCMD(nID),
00476             (void *)nPos);
00477         sentOne = true;
00478     }
00479
00480     if(sentOne)
00481         UWidget::DoValidUI(false);
00482
00483     return 1;
00484 }

int UWinToUMod ( UINT nFlags ) [static]

Definition at line 193 of file PseudoDlg.cpp.

References UK_ALT, UK_CONTROL, UK_MBUTTON, UK_RBUTTON, and UK_SHIFT.

Referenced by UWinPseudoWindowProc.

00194 {
00195     int res = 0;
00196     if(nFlags & MK_LBUTTON)
00197         res |= VK_LBUTTON;
00198     if(nFlags & MK_RBUTTON)
00199         res |= UK_RBUTTON;
00200     if(nFlags & MK_SHIFT)
00201         res |= UK_SHIFT;
00202     if(nFlags & MK_CONTROL)
00203         res |= UK_CONTROL;
00204     if(nFlags & MK_MBUTTON)
00205         res |= UK_MBUTTON;
00206     if ((GetKeyState(VK_MENU) & 0x8000) != 0)
00207         res |= UK_ALT;
00208
00209     return res;
00210 }

void WinInitWidgets | ( | CWnd * | wnd,
 |  | UWidget * | pseudo
 | ) |

Definition at line 92 of file PseudoDlg.cpp.

References USmartCombo::AutoDropWidth, EV_INIT_WIDGET, UWidget::GetOverideList, UCmdTarget::GetWidID, IS_PSEUDO_CTL, stat, stricmp, UEventSendMessage, and WINCTL_to_UCMD.

Referenced by CPseudoDlg::OnInitDialog.

00093 {
00094     CWnd* pWndStart = 0L;
00095     pWndStart = wnd->GetTopWindow();
00096     while(pWndStart != 0L)
00097     {
00098         HWND hwnd = *pWndStart;
00099         int id = ::GetDlgCtrlID(*pWndStart);
00100         CWnd *res = 0L;
00101         if(IS_PSEUDO_CTL(id))
00102         {
00103             TCHAR szCompare[100];
00104             ::GetClassName(hwnd, szCompare, _countof(szCompare));
00105             DWORD style = (DWORD)GetWindowLong(hwnd, GWL_STYLE);
00106
00107             // check overided widgets
00108             std::map<int, CRuntimeClass *> & list = pseudo->GetOverideList();
00109             std::map<int, CRuntimeClass *>::const_iterator i = list.find(WINCTL_to_UCMD(id));
00110             if(i != list.end())
00111             {
00112                 CRuntimeClass *clss = (*i).second;
00113                 if(clss->IsDerivedFrom(RUNTIME_CLASS(CWnd)))
00114                 {
00115                     res = (CWnd *)clss->CreateObject();
00116                 }
00117             }
00118
00119             if(res == 0L)
00120             {
00121                 if(stricmp(szCompare, "BUTTON") == 0)
00122                 {
00123                     CButton *btn = new CButton();
00124                     res = btn;
00125                 }
00126                 else if(stricmp(szCompare, "Static") == 0)
00127                 {
00128                     if(style & SS_ETCHEDFRAME)
00129                     {
00130                         CPseudoDraw *draw = new CPseudoDraw(pseudo, WINCTL_to_UCMD(id));
00131                         res = draw;
00132                     }
00133                     else
00134                     {
00135                         CStatic *stat = new CStatic();
00136                         res = stat;
00137                     }
00138                 }
00139                 else if(stricmp(szCompare, "ComboBox") == 0)
00140                 {
00141                     CComboBox *combo = new CSmartComboBox(USmartCombo::AutoDropWidth);
00142                     res = combo;
00143                 }
00144                 else if(stricmp(szCompare, WC_LISTVIEW) == 0)
00145                 {
00146                     CPseudoList *list = new CPseudoList(pseudo->GetWidID(), WINCTL_to_UCMD(id));
00147                     res = list;
00148                 }
00149                 else
00150                 {
00151                     res = new CWnd();
00152                 }
00153             }
00154
00155             UEventSendMessage(pseudo->GetWidID(), EV_INIT_WIDGET, WINCTL_to_UCMD(id), res);
00156         }
00157         pWndStart = pWndStart->GetNextWindow();
00158     }
00159
00160     std::map<int, CRuntimeClass *> & list = pseudo->GetOverideList();
00161     list.erase(list.begin(), list.end());
00162 }

Generated on Sun Feb 24 01:22:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PseudoDlg.h File Reference

rf/support/mfc/PseudoDlg.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CPseudoDlg

Defines

#define | AFX_PSEUDODLG_H__9EDC5FE5_21FD_4ACE_9AEB_7A521350A2EE__INCLUDED_

Define Documentation

#define AFX_PSEUDODLG_H__9EDC5FE5_21FD_4ACE_9AEB_7A521350A2EE__INCLUDED_

Definition at line 22 of file PseudoDlg.h.

Generated on Sun Feb 24 01:22:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PseudoDraw.cpp File Reference

rf/support/mfc/PseudoDraw.cpp File Reference

#include "stdafx.h"
#include "PseudoDraw.h"
#include "uwidget.h"

Include dependency graph for PseudoDraw.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:22:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PseudoDraw.h File Reference

rf/support/mfc/PseudoDraw.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CPseudoDraw

Defines

#define | AFX_STATICDRAW_H__8DCC3165_D42E_4FAA_BCCF_F4328685535E__INCLUDED_

Define Documentation

#define AFX_STATICDRAW_H__8DCC3165_D42E_4FAA_BCCF_F4328685535E__INCLUDED_

Definition at line 2 of file PseudoDraw.h.

Generated on Sun Feb 24 01:22:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PseudoList.cpp File Reference

rf/support/mfc/PseudoList.cpp File Reference

#include "stdafx.h"
#include "PseudoList.h"
#include "umain.h"

Include dependency graph for PseudoList.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:22:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


pseudolist.h File Reference

rf/support/mfc/pseudolist.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CPseudoList

Defines

#define | AFX_PSEUDOLIST_H__49AF86B3_E6AB_4885_843C_1CE5AC8C4980__INCLUDED_

Define Documentation

#define AFX_PSEUDOLIST_H__49AF86B3_E6AB_4885_843C_1CE5AC8C4980__INCLUDED_

Definition at line 2 of file pseudolist.h.

Generated on Sun Feb 24 01:22:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


StdAfx.cpp File Reference

rf/support/mfc/StdAfx.cpp File Reference

#include "stdafx.h"

Include dependency graph for StdAfx.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:22:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/mfc/StdAfx.cpp Source File

rf/support/mfc/StdAfx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  pseudo.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
Generated on Sun Feb 24 01:21:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


StdAfx.h File Reference

rf/support/mfc/StdAfx.h File Reference

#include <afx.h>
#include <afxwin.h>
#include <afxext.h>
#include <afxdisp.h>
#include <afxdtctl.h>
#include <afxcmn.h>
#include "CJLibrary.h"

Include dependency graph for StdAfx.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | AFX_STDAFX_H__EDF5958A_92F6_11D3_9365_00C0F00AE104__INCLUDED_
#define | VC_EXTRALEAN
#define | qDebug 0
#define | UASSERT ASSERT

Define Documentation

#define AFX_STDAFX_H__EDF5958A_92F6_11D3_9365_00C0F00AE104__INCLUDED_

Definition at line 7 of file StdAfx.h.

#define qDebug 0

Definition at line 29 of file StdAfx.h.

#define UASSERT ASSERT

Definition at line 32 of file StdAfx.h.

#define VC_EXTRALEAN

Definition at line 15 of file StdAfx.h.

Generated on Sun Feb 24 01:22:38 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/mfc/StdAfx.h Source File

rf/support/mfc/StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //  or project specific include files that are used frequently, but
00003 //      are changed infrequently
00004 //
00005
00006 #if !defined(AFX_STDAFX_H__EDF5958A_92F6_11D3_9365_00C0F00AE104__INCLUDED_)
00007 #define AFX_STDAFX_H__EDF5958A_92F6_11D3_9365_00C0F00AE104__INCLUDED_
00008
00009 #pragma warning (disable : 4786)
00010
00011 #if _MSC_VER > 1000
00012 #pragma once
00013 #endif // _MSC_VER > 1000
00014
00015 #define VC_EXTRALEAN        // Exclude rarely-used stuff from Windows headers
00016
00017 #include <afx.h>
00018 #include <afxwin.h>
00019 #include <afxext.h>         // MFC extensions
00020 #include <afxdisp.h>        // MFC Automation classes
00021 #include <afxdtctl.h>       // MFC support for Internet Explorer 4 Common Controls
00022 #ifndef _AFX_NO_AFXCMN_SUPPORT
00023 #include <afxcmn.h>         // MFC support for Windows Common Controls
00024 #endif // _AFX_NO_AFXCMN_SUPPORT
00025
00026 #ifdef _DEBUG
00027 #   define qDebug 1
00028 #else
00029 #   define qDebug 0
00030 #endif
00031
00032 #define UASSERT ASSERT
00033     // the pseudo ASSERT
00034
00035 #include "CJLibrary.h"
00036         // the CJ library provides a bunch of usefull Windows classes.
00037
00038 //{{AFX_INSERT_LOCATION}}
00039 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00040
00041 #endif // !defined(AFX_STDAFX_H__EDF5958A_92F6_11D3_9365_00C0F00AE104__INCLUDED_)
Generated on Sun Feb 24 01:21:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


stdafx.h File Reference

rf/support/powerplant/stdafx.h File Reference

#include <PP_ClassHeaders.cp>

Include dependency graph for stdafx.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | qMacPP 1
#define | UASSERT Assert_
#define | UTHROW(err) Throw_Err(mFulErr)

Functions

char * | strdup (const char *str)

Define Documentation

#define qMacPP 1

Definition at line 1 of file stdafx.h.

Referenced by UCmdUI::UCmdUI, and UWidget::UWidget.

#define UASSERT Assert_

Definition at line 10 of file stdafx.h.

#define UTHROW ( err ) Throw_Err(mFulErr)

Definition at line 11 of file stdafx.h.

Function Documentation

char* strdup ( const char * str )

Definition at line 17 of file UPseudoSupport.cpp.

Referenced by awidget::awidget, cloneStr, cvs_process_new, gp_getenv_read, gp_getenv_write, CCustInvertTable::Initialize, LogSetFilter, UWidget::OnComboAppend, and awidget::operator=.

00018 {
00019     if(str == 0L)
00020         return 0L;
00021
00022     size_t len = strlen(str);
00023     char *res = (char *)malloc((len + 1) * sizeof(char));
00024     if(res == 0L)
00025         throw CException_AC(mFulErr);
00026     strcpy(res, str);
00027     return res;
00028 }

Generated on Sun Feb 24 01:22:38 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/powerplant/stdafx.h Source File

rf/support/powerplant/stdafx.h

Go to the documentation of this file.
00001 #define qMacPP 1
00002
00003 #if qDebug
00004 #   include <PP_DebugHeaders.cp>
00005 #else
00006 #   include <PP_ClassHeaders.cp>
00007 #endif
00008
00009 /* the MacAPP assert */
00010 #define UASSERT Assert_
00011 #define UTHROW(err) Throw_Err(mFulErr)
00012
00013 extern "C" char *strdup(const char *str);
Generated on Sun Feb 24 01:21:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UPseudoSupport.cpp File Reference

rf/support/powerplant/UPseudoSupport.cpp File Reference

#include "stdafx.h"
#include "UPseudoSupport.h"
#include "uconsole.h"
#include "udraw.h"
#include "umenu.h"
#include <stdio.h>
#include <stdlib.h>
#include <UGAColorRamp.h>
#include <LTableMonoGeometry.h>
#include <LTableMultiGeometry.h>
#include <LTableSingleSelector.h>
#include <LOutlineKeySelector.h>
#include <LOutlineTable.h>
#include <LTextTableView.h>
#include <LCellSizeToFit.h>
#include <LTableArrayStorage.h>
#include <LTextArray.h>
#include <LTableSingleRowSelector.h>
#include <LEditText.h>
#include <LPopupButton.h>
#include <LScrollBar.h>
#include <LPageController.h>
#include <LTabsControl.h>
#include <LSlider.h>
#include <LLittleArrows.h>
#include <LCheckBoxGroupBox.h>

Include dependency graph for UPseudoSupport.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | CDummyClass
class | LPseudoDrawAttachment
class | UPPMenu

Defines

#define | NEW new

Functions

bool | macpp_getcmdid (LPane *view, int &cmdid)
bool | macpp_getcmdid (PaneIDT atype, int &cmdid)
LPseudoWinAttachment * | macpp_getattachwindow (UWidget *wid)
LPseudoWinAttachment * | macpp_getattachwindow (LWindow *wind)
void | macpp_fecthview (int widid, LPane *pane)
void | macpp_linkbroadcasters (LPane *pane, LListener *listener)
void | macpp_preparetable (LOutlineTable *table)
void | macpp_preparetable (void *win, LTextTableView *table)
LWindow * | macpp_findwindow (LPane *pane)

Variables

bool | gTurnOffBroadcast = false
CDummyClass sDummyStarter

Define Documentation

#define NEW new

Definition at line 32 of file UPseudoSupport.cpp.

Referenced by LMainPseudoAttachment::ExecuteSelf, macpp_fecthview, and macpp_preparetable.

Function Documentation

void macpp_fecthview | ( | int | widid,
 |  | LPane * | pane
 | ) |

Definition at line 146 of file UPseudoSupport.cpp.

References EV_INIT_WIDGET, macpp_fecthview, macpp_getcmdid, NEW, UPseudoPlaceHolder::SetWidID, UPseudoPageHider::SetWidID, and UEventSendMessage.

00147 {
00148     int cmdid;
00149     if(macpp_getcmdid(pane, cmdid))
00150     {
00151         UEventSendMessage(widid, EV_INIT_WIDGET, cmdid, pane);
00152
00153         // look for any attachement we know of
00154         const TArray<LAttachment*>* theAttachments = pane->GetAttachmentsList();
00155         if (theAttachments != nil)
00156         {
00157             TArrayIterator<LAttachment*> iterate(*theAttachments);
00158
00159             LAttachment*    theAttach;
00160             while (iterate.Next(theAttach))
00161             {
00162                 UPseudoPageHider *hider = dynamic_cast<UPseudoPageHider*>(theAttach);
00163                 if(hider != 0L)
00164                     hider->SetWidID(widid);
00165             }
00166         }
00167
00168         // for any control, set the broadcast message to be the Pane ID
00169         LControl *control = dynamic_cast<LControl*>(pane);
00170         if(control != 0L && control->GetValueMessage() == 0)
00171         {
00172             control->SetValueMessage(pane->GetPaneID());
00173         }
00174
00175         // idem
00176         LCheckBoxGroupBox *groupbox = dynamic_cast<LCheckBoxGroupBox*>(pane);
00177         if(groupbox != 0L && groupbox->GetValueMessage() == 0)
00178         {
00179             groupbox->SetValueMessage(pane->GetPaneID());
00180         }
00181
00182         // set the widget id for some custom controls
00183         UPseudoPlaceHolder *holder = dynamic_cast<UPseudoPlaceHolder*>(pane);
00184         if(holder != 0L)
00185         {
00186             holder->SetWidID(widid);
00187             return; // don't fetch inside, it'll be owned by another pseudo widget
00188         }
00189
00190         // this attachment let us fire a EV_CUSTOM_DRAW event when painting
00191         if(typeid(*pane) == typeid(LView))
00192         {
00193             LPseudoDrawAttachment *attach = NEW LPseudoDrawAttachment(widid, cmdid);
00194             pane->AddAttachment(attach);
00195         }
00196     }
00197
00198     // menus with an unspecified menu id need to be created if we want to use
00199     // later on the EV_COMBO_APPEND message on it.
00200     LPopupButton *controler = dynamic_cast<LPopupButton*>(pane);
00201     if(controler != 0L)
00202     {
00203         if(controler->GetMenuID() == MENU_Unspecified && controler->GetMacMenuH() == 0L)
00204             controler->SetMacMenuH(::NewMenu(::UniqueID('MENU'), "\p"), true);
00205     }
00206
00207     // recurse
00208     LView *view = dynamic_cast<LView*>(pane);
00209     if(view == 0L)
00210         return;
00211
00212     TArrayIterator<LPane*> iterator(view->GetSubPanes());
00213     LPane   *theSub;
00214     while (iterator.Next(theSub))
00215     {
00216         macpp_fecthview(widid, theSub);
00217     }
00218 }

LWindow* macpp_findwindow ( LPane * pane ) [static]

Definition at line 275 of file UPseudoSupport.cpp.

Referenced by UPseudoPageHider::DoRotate, UPseudoPlaceHolder::DoRotate, and UPseudoPlaceHolder::FinishCreateSelf.

00276 {
00277     LPane *topView = 0L;
00278     while(pane != 0L)
00279     {
00280         topView = pane;
00281         pane = pane->GetSuperView();
00282     }
00283     return dynamic_cast<LWindow *>(topView);
00284 }

LPseudoWinAttachment* macpp_getattachwindow ( LWindow * wind )

Definition at line 122 of file UPseudoSupport.cpp.

00123 {
00124     if(wind != 0L)
00125     {
00126         const TArray<LAttachment*>* theAttachments = wind->GetAttachmentsList();
00127
00128         if (theAttachments != nil)
00129         {
00130             TArrayIterator<LAttachment*> iterate(*theAttachments);
00131
00132             LAttachment*    theAttach;
00133             while (iterate.Next(theAttach))
00134             {
00135                 LPseudoWinAttachment*   theWinAttach = dynamic_cast<LPseudoWinAttachment*>(theAttach);
00136                 if (theWinAttach != nil)
00137                 {
00138                     return theWinAttach;
00139                 }
00140             }
00141         }
00142     }
00143     return 0L;
00144 }

LPseudoWinAttachment* macpp_getattachwindow ( UWidget * wid )

Definition at line 110 of file UPseudoSupport.cpp.

References UWidget::GetWidget, kUMainWidget, and macpp_getattachwindow.

00111 {
00112     LPane *win = (LPane *)wid->GetWidget(kUMainWidget);
00113     LWindow *wind = dynamic_cast<LWindow *>((LPane *)win);
00114
00115     if(wind != 0L)
00116     {
00117         return macpp_getattachwindow(wind);
00118     }
00119     return 0L;
00120 }

bool macpp_getcmdid | ( | PaneIDT | atype,
 |  | int & | cmdid
 | ) | [static]

Definition at line 96 of file UPseudoSupport.cpp.

References EV_COMMAND_START.

Referenced by UPseudoPageHider::DoRotate, UPseudoPlaceHolder::DoRotate, LPseudoWinAttachment::ListenToMessage, and macpp_fecthview.

00097 {
00098     const char *atypestr = (char *)&atype;
00099     if(atypestr[0] != 'p' && atypestr[1] != 's')
00100         return false;
00101
00102     if(atypestr[2] < '0' || atypestr[2] > '9')
00103         return false;
00104     if(atypestr[3] < '0' || atypestr[3] > '9')
00105         return false;
00106     cmdid = (int)(atypestr[2] - '0') * 10 + (int)(atypestr[3] - '0') + EV_COMMAND_START;
00107     return true;
00108 }

bool macpp_getcmdid | ( | LPane * | view,
 |  | int & | cmdid
 | ) | [static]

Definition at line 81 of file UPseudoSupport.cpp.

References EV_COMMAND_START.

00082 {
00083     PaneIDT atype = view->GetPaneID();
00084     const char *atypestr = (char *)&atype;
00085     if(atypestr[0] != 'p' && atypestr[1] != 's')
00086         return false;
00087
00088     if(atypestr[2] < '0' || atypestr[2] > '9')
00089         return false;
00090     if(atypestr[3] < '0' || atypestr[3] > '9')
00091         return false;
00092     cmdid = (int)(atypestr[2] - '0') * 10 + (int)(atypestr[3] - '0') + EV_COMMAND_START;
00093     return true;
00094 }

void macpp_linkbroadcasters | ( | LPane * | pane,
 |  | LListener * | listener
 | ) |

Definition at line 220 of file UPseudoSupport.cpp.

References macpp_linkbroadcasters.

00221 {
00222     LBroadcaster *broadcaster = dynamic_cast<LBroadcaster *>(pane);
00223     if(broadcaster != 0L && !broadcaster->HasListener(listener))
00224         broadcaster->AddListener(listener);
00225
00226     LView *view = dynamic_cast<LView*>(pane);
00227     if(view == 0L)
00228         return;
00229
00230     TArrayIterator<LPane*> iterator(view->GetSubPanes());
00231     LPane   *theSub;
00232     while (iterator.Next(theSub))
00233     {
00234         macpp_linkbroadcasters(theSub, listener);
00235     }
00236 }

void macpp_preparetable | ( | void * | win,
 |  | LTextTableView * | table
 | ) |

Definition at line 257 of file UPseudoSupport.cpp.

References NEW, UTextTableView_DoubleClick, and UTextTableView_SingleClick.

00258 {
00259     if(table->GetTableGeometry() != 0L)
00260         return;
00261
00262     SDimension16    tableSize;
00263     table->SetCellSizer(NEW LCellSizeToFit());
00264     table->GetFrameSize(tableSize);
00265     table->SetTableGeometry(NEW LTableMonoGeometry(table,
00266         tableSize.width/1 /* col width = width/num Cols */,
00267         12  /* row height */));
00268     table->SetTableSelector(NEW LTableSingleRowSelector( table ));
00269     table->SetTableStorage(NEW LTableArrayStorage(table, (UInt32)0));
00270     table->SetDoubleClickMessage(UTextTableView_DoubleClick);
00271     table->SetSingleClickMessage(UTextTableView_SingleClick);
00272     table->SetCustomHilite(true); // cause there is a hilite bug if we don't
00273 }

void macpp_preparetable ( LOutlineTable * table )

Definition at line 238 of file UPseudoSupport.cpp.

References NEW.

00239 {
00240     if(table->GetTableGeometry() != 0L)
00241         return;
00242
00243     // try to guess a good height for the geometry
00244     int height = 20;
00245     TextTraitsH traitsH = UTextTraits::LoadTextTraits(table->GetTextTraits());
00246     if(traitsH != 0L)
00247         height = ((**traitsH).size * 6) / 4;
00248
00249     LTableMultiGeometry *geom = NEW LTableMultiGeometry(table, 50, height);
00250     if(geom != 0L)
00251         table->SetTableGeometry(geom);
00252     table->SetTableSelector(NEW LTableSingleRowSelector( table ));
00253     table->AddAttachment(NEW LOutlineKeySelector(table, msg_AnyMessage));
00254     table->AddAttachment(NEW LKeyScrollAttachment(table));
00255 }

Variable Documentation

bool gTurnOffBroadcast = false

Definition at line 41 of file UPseudoSupport.cpp.

Referenced by UPseudoPlaceHolder::DoRotate.

class CDummyClass sDummyStarter

Generated on Sun Feb 24 01:22:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/powerplant/UPseudoSupport.cpp Source File

rf/support/powerplant/UPseudoSupport.cpp

Go to the documentation of this file.
00001 #include "stdafx.h"
00002
00003 #include "UPseudoSupport.h"
00004 #include "uconsole.h"
00005 #include "udraw.h"
00006 #include "umenu.h"
00007
00008 #include <stdio.h>
00009 #include <stdlib.h>
00010
00011 #include <UGAColorRamp.h>
00012 #include <LTableMonoGeometry.h>
00013 #include <LTableMultiGeometry.h>
00014 #include <LTableSingleSelector.h>
00015 #include <LOutlineKeySelector.h>
00016 #include <LOutlineTable.h>
00017 #include <LTextTableView.h>
00018 #include <LCellSizeToFit.h>
00019 #include <LTableArrayStorage.h>
00020 #include <LTextArray.h>
00021 #include <LTableSingleRowSelector.h>
00022 #include <LEditText.h>
00023 #include <LPopupButton.h>
00024 #include <LScrollBar.h>
00025 #include <LPageController.h>
00026 #include <LTabsControl.h>
00027 #include <LSlider.h>
00028 #include <LLittleArrows.h>
00029 #include <LCheckBoxGroupBox.h>
00030
00031 #ifndef NEW
00032 #   define NEW new
00033 #endif
00034
00035 #if __option(RTTI)
00036 #   include <typeinfo>
00037 #else
00038 #   error "RTTI option disabled -- must be enabled for LPaneTree to function"
00039 #endif
00040
00041 bool gTurnOffBroadcast = false;
00042
00043 class UPPMenu : public UMenu
00044 {
00045 public:
00046     UPPMenu();
00047     virtual ~UPPMenu();
00048
00049     static int sPPMenuWidID;
00050 };
00051
00052 class LPseudoDrawAttachment : public LAttachment
00053 {
00054 public:
00055     LPseudoDrawAttachment(int widid, int cmdid);
00056     virtual ~LPseudoDrawAttachment();
00057
00058 protected:
00059     virtual void    ExecuteSelf(
00060                             MessageT        inMessage,
00061                             void*           ioParam);
00062
00063     int m_widid, m_cmdid;
00064 };
00065
00066 #if TARGET_RT_MAC_CFM
00067 extern "C" char *strdup(const char *str)
00068 {
00069     if(str == 0L)
00070         return 0L;
00071
00072     size_t len = strlen(str);
00073     char *res = (char *)malloc((len + 1) * sizeof(char));
00074     if(res == 0L)
00075         throw LException(mFulErr);
00076     strcpy(res, str);
00077     return res;
00078 }
00079 #endif
00080
00081 static bool macpp_getcmdid(LPane *view, int & cmdid)
00082 {
00083     PaneIDT atype = view->GetPaneID();
00084     const char *atypestr = (char *)&atype;
00085     if(atypestr[0] != 'p' && atypestr[1] != 's')
00086         return false;
00087
00088     if(atypestr[2] < '0' || atypestr[2] > '9')
00089         return false;
00090     if(atypestr[3] < '0' || atypestr[3] > '9')
00091         return false;
00092     cmdid = (int)(atypestr[2] - '0') * 10 + (int)(atypestr[3] - '0') + EV_COMMAND_START;
00093     return true;
00094 }
00095
00096 static bool macpp_getcmdid(PaneIDT atype, int & cmdid)
00097 {
00098     const char *atypestr = (char *)&atype;
00099     if(atypestr[0] != 'p' && atypestr[1] != 's')
00100         return false;
00101
00102     if(atypestr[2] < '0' || atypestr[2] > '9')
00103         return false;
00104     if(atypestr[3] < '0' || atypestr[3] > '9')
00105         return false;
00106     cmdid = (int)(atypestr[2] - '0') * 10 + (int)(atypestr[3] - '0') + EV_COMMAND_START;
00107     return true;
00108 }
00109
00110 LPseudoWinAttachment *macpp_getattachwindow(UWidget *wid)
00111 {
00112     LPane *win = (LPane *)wid->GetWidget(kUMainWidget);
00113     LWindow *wind = dynamic_cast<LWindow *>((LPane *)win);
00114
00115     if(wind != 0L)
00116     {
00117         return macpp_getattachwindow(wind);
00118     }
00119     return 0L;
00120 }
00121
00122 LPseudoWinAttachment *macpp_getattachwindow(LWindow *wind)
00123 {
00124     if(wind != 0L)
00125     {
00126         const TArray<LAttachment*>* theAttachments = wind->GetAttachmentsList();
00127
00128         if (theAttachments != nil)
00129         {
00130             TArrayIterator<LAttachment*> iterate(*theAttachments);
00131
00132             LAttachment*    theAttach;
00133             while (iterate.Next(theAttach))
00134             {
00135                 LPseudoWinAttachment*   theWinAttach = dynamic_cast<LPseudoWinAttachment*>(theAttach);
00136                 if (theWinAttach != nil)
00137                 {
00138                     return theWinAttach;
00139                 }
00140             }
00141         }
00142     }
00143     return 0L;
00144 }
00145
00146 void macpp_fecthview(int widid, LPane *pane)
00147 {
00148     int cmdid;
00149     if(macpp_getcmdid(pane, cmdid))
00150     {
00151         UEventSendMessage(widid, EV_INIT_WIDGET, cmdid, pane);
00152
00153         // look for any attachement we know of
00154         const TArray<LAttachment*>* theAttachments = pane->GetAttachmentsList();
00155         if (theAttachments != nil)
00156         {
00157             TArrayIterator<LAttachment*> iterate(*theAttachments);
00158
00159             LAttachment*    theAttach;
00160             while (iterate.Next(theAttach))
00161             {
00162                 UPseudoPageHider *hider = dynamic_cast<UPseudoPageHider*>(theAttach);
00163                 if(hider != 0L)
00164                     hider->SetWidID(widid);
00165             }
00166         }
00167
00168         // for any control, set the broadcast message to be the Pane ID
00169         LControl *control = dynamic_cast<LControl*>(pane);
00170         if(control != 0L && control->GetValueMessage() == 0)
00171         {
00172             control->SetValueMessage(pane->GetPaneID());
00173         }
00174
00175         // idem
00176         LCheckBoxGroupBox *groupbox = dynamic_cast<LCheckBoxGroupBox*>(pane);
00177         if(groupbox != 0L && groupbox->GetValueMessage() == 0)
00178         {
00179             groupbox->SetValueMessage(pane->GetPaneID());
00180         }
00181
00182         // set the widget id for some custom controls
00183         UPseudoPlaceHolder *holder = dynamic_cast<UPseudoPlaceHolder*>(pane);
00184         if(holder != 0L)
00185         {
00186             holder->SetWidID(widid);
00187             return; // don't fetch inside, it'll be owned by another pseudo widget
00188         }
00189
00190         // this attachment let us fire a EV_CUSTOM_DRAW event when painting
00191         if(typeid(*pane) == typeid(LView))
00192         {
00193             LPseudoDrawAttachment *attach = NEW LPseudoDrawAttachment(widid, cmdid);
00194             pane->AddAttachment(attach);
00195         }
00196     }
00197
00198     // menus with an unspecified menu id need to be created if we want to use
00199     // later on the EV_COMBO_APPEND message on it.
00200     LPopupButton *controler = dynamic_cast<LPopupButton*>(pane);
00201     if(controler != 0L)
00202     {
00203         if(controler->GetMenuID() == MENU_Unspecified && controler->GetMacMenuH() == 0L)
00204             controler->SetMacMenuH(::NewMenu(::UniqueID('MENU'), "\p"), true);
00205     }
00206
00207     // recurse
00208     LView *view = dynamic_cast<LView*>(pane);
00209     if(view == 0L)
00210         return;
00211
00212     TArrayIterator<LPane*> iterator(view->GetSubPanes());
00213     LPane   *theSub;
00214     while (iterator.Next(theSub))
00215     {
00216         macpp_fecthview(widid, theSub);
00217     }
00218 }
00219
00220 void macpp_linkbroadcasters(LPane *pane, LListener *listener)
00221 {
00222     LBroadcaster *broadcaster = dynamic_cast<LBroadcaster *>(pane);
00223     if(broadcaster != 0L && !broadcaster->HasListener(listener))
00224         broadcaster->AddListener(listener);
00225
00226     LView *view = dynamic_cast<LView*>(pane);
00227     if(view == 0L)
00228         return;
00229
00230     TArrayIterator<LPane*> iterator(view->GetSubPanes());
00231     LPane   *theSub;
00232     while (iterator.Next(theSub))
00233     {
00234         macpp_linkbroadcasters(theSub, listener);
00235     }
00236 }
00237
00238 void macpp_preparetable(LOutlineTable *table)
00239 {
00240     if(table->GetTableGeometry() != 0L)
00241         return;
00242
00243     // try to guess a good height for the geometry
00244     int height = 20;
00245     TextTraitsH traitsH = UTextTraits::LoadTextTraits(table->GetTextTraits());
00246     if(traitsH != 0L)
00247         height = ((**traitsH).size * 6) / 4;
00248
00249     LTableMultiGeometry *geom = NEW LTableMultiGeometry(table, 50, height);
00250     if(geom != 0L)
00251         table->SetTableGeometry(geom);
00252     table->SetTableSelector(NEW LTableSingleRowSelector( table ));
00253     table->AddAttachment(NEW LOutlineKeySelector(table, msg_AnyMessage));
00254     table->AddAttachment(NEW LKeyScrollAttachment(table));
00255 }
00256
00257 void macpp_preparetable(void *win, LTextTableView *table)
00258 {
00259     if(table->GetTableGeometry() != 0L)
00260         return;
00261
00262     SDimension16    tableSize;
00263     table->SetCellSizer(NEW LCellSizeToFit());
00264     table->GetFrameSize(tableSize);
00265     table->SetTableGeometry(NEW LTableMonoGeometry(table,
00266         tableSize.width/1 /* col width = width/num Cols */,
00267         12  /* row height */));
00268     table->SetTableSelector(NEW LTableSingleRowSelector( table ));
00269     table->SetTableStorage(NEW LTableArrayStorage(table, (UInt32)0));
00270     table->SetDoubleClickMessage(UTextTableView_DoubleClick);
00271     table->SetSingleClickMessage(UTextTableView_SingleClick);
00272     table->SetCustomHilite(true); // cause there is a hilite bug if we don't
00273 }
00274
00275 static LWindow *macpp_findwindow(LPane *pane)
00276 {
00277     LPane *topView = 0L;
00278     while(pane != 0L)
00279     {
00280         topView = pane;
00281         pane = pane->GetSuperView();
00282     }
00283     return dynamic_cast<LWindow *>(topView);
00284 }
00285
00286 LPseudoDrawAttachment::LPseudoDrawAttachment(int widid, int cmdid) : LAttachment(msg_DrawOrPrint),
00287     m_widid(widid), m_cmdid(cmdid)
00288 {
00289 }
00290
00291 LPseudoDrawAttachment::~LPseudoDrawAttachment()
00292 {
00293 }
00294
00295 void LPseudoDrawAttachment::ExecuteSelf(MessageT inMessage, void *ioParam)
00296 {
00297     SetExecuteHost(true);
00298     LView *view = dynamic_cast<LView*>(GetOwnerHost());
00299     UEventSendMessage(m_widid, EV_CUSTOM_DRAW, m_cmdid, view);
00300 }
00301
00302 LMainPseudoAttachment::LMainPseudoAttachment() : LAttachment(msg_AnyMessage)
00303 {
00304     StartIdling();
00305 }
00306
00307 LMainPseudoAttachment::~LMainPseudoAttachment()
00308 {
00309 }
00310
00311 void LMainPseudoAttachment::SpendTime(const EventRecord&    inMacEvent)
00312 {
00313     ::UEventGiveTime();
00314 }
00315
00316 void LMainPseudoAttachment::ExecuteSelf(MessageT inMessage, void *ioParam)
00317 {
00318     SetExecuteHost(true);
00319
00320     if(UPPMenu::sPPMenuWidID == -1)
00321     {
00322         NEW UPPMenu();
00323     }
00324
00325     if((inMessage > 0 && inMessage < 800) || inMessage >= EV_COMMAND_START)
00326     {
00327         int handledFlag;
00328         int res = UEventSendMessageExt(UPPMenu::sPPMenuWidID, EV_CMD,
00329             inMessage, 0L, &handledFlag);
00330         if(res == 0 && handledFlag)
00331         {
00332             SetExecuteHost(false);
00333             return;
00334         }
00335         else
00336             SetExecuteHost(true);
00337     }
00338
00339     switch (inMessage)
00340     {
00341         case msg_CommandStatus:
00342         {
00343             SCommandStatus *status = static_cast<SCommandStatus*> (ioParam);
00344             CommandT cmdid = status->command;
00345             UPseudoCmdStatusWrapper wrapper;
00346             wrapper.outEnabled = status->enabled;
00347             wrapper.outUsesMark = status->usesMark;
00348             wrapper.outMark = status->mark;
00349             wrapper.outName = status->name;
00350
00351             // first forward the command to the focused widget : if it doesn't want it
00352             // we give it to the next pseudo widget.
00353             int widFocus = UWidget::GetFocus();
00354             if(widFocus != -1)
00355             {
00356                 UCmdUI pUI(cmdid);
00357                 pUI.m_wrapper = &wrapper;
00358                 UEventSendMessage(widFocus, EV_UPDTCMD, pUI.m_nID, &pUI);
00359                 if(!pUI.CanContinue())
00360                 {
00361                     SetExecuteHost(false);
00362                     break;
00363                 }
00364             }
00365
00366             STD map<int, UCmdTarget *>::const_iterator i;
00367             const STD map<int, UCmdTarget *> & targets = UEventGetTargets();
00368             for(i = targets.begin(); i != targets.end(); ++i)
00369             {
00370                 int widid = (*i).first;
00371                 if(widid == widFocus)
00372                     continue;
00373
00374                 UCmdUI pUI(cmdid);
00375                 pUI.m_wrapper = &wrapper;
00376                 UEventSendMessage(widid, EV_UPDTCMD, pUI.m_nID, &pUI);
00377                 if(!pUI.CanContinue())
00378                     break;
00379             }
00380
00381             if(i != targets.end())
00382                 SetExecuteHost(false);
00383             break;
00384         }
00385
00386         case msg_Event:
00387         {
00388             EventRecord *ev = static_cast<EventRecord*> (ioParam);
00389
00390 #if 0
00391             if(ev->what == activateEvt)
00392             {
00393                 bool activate = (ev->modifiers & activeFlag) != 0;
00394                 LWindow *theWindow = LWindow::FetchWindowObject((WindowPtr)ev->message);
00395                 if(theWindow != 0L)
00396                 {
00397                     UEventNotifyMessage(EV_UPDATEFOCUS, !activate, theWindow);
00398                         // so the pseudo widget update its current widget.
00399                         // it's important for the menu handling.
00400                 }
00401             }
00402 #endif
00403             if(ev->what == activateEvt ||
00404                 ev->what == mouseDown ||
00405                 ev->what == mouseUp ||
00406                 ev->what == keyDown ||
00407                 ev->what == keyUp ||
00408                 ev->what == autoKey)
00409             {
00410                 UWidget::DoValidUI(false);
00411                 LCommander::SetUpdateCommandStatus(true);
00412             }
00413             break;
00414         }
00415     }
00416 }
00417
00418 LPseudoWinAttachment::LPseudoWinAttachment(int widid) : LAttachment(msg_GrowZone), m_widid(widid)
00419 {
00420     ::SetRect(&m_lastRect, 0, 0, 0, 0);
00421
00422     CheckWindowSize();
00423 }
00424
00425 LPseudoWinAttachment::~LPseudoWinAttachment()
00426 {
00427     UEventSendMessage(m_widid, EV_DESTROY, 0, 0L);
00428 }
00429
00430 int LPseudoWinAttachment::GetPageValue(int cmdid) const
00431 {
00432     std::map<int, int>::const_iterator i = m_PageValues.find(cmdid);
00433     if(i != m_PageValues.end())
00434         return (*i).second;
00435     return 1;
00436 }
00437
00438 void LPseudoWinAttachment::SetPageValue(int cmdid, int value)
00439 {
00440     std::map<int, int>::value_type val(cmdid, value);
00441     m_PageValues.erase(cmdid);
00442     m_PageValues.insert(val);
00443 }
00444
00445 void LPseudoWinAttachment::ExecuteSelf(MessageT inMessage, void *ioParam)
00446 {
00447     SetExecuteHost(true);
00448
00449     // not used yet
00450 }
00451
00452 void LPseudoWinAttachment::CheckWindowSize(void)
00453 {
00454     LWindow *wind = dynamic_cast<LWindow*>(GetOwnerHost());
00455     if(wind != 0L)
00456     {
00457         Rect r;
00458         wind->GetGlobalBounds(r);
00459         if(!::EqualRect(&r, &m_lastRect))
00460         {
00461             m_lastRect = r;
00462             URect ur(r);
00463             UEventSendMessage(m_widid, EV_RESIZE, kUMainWidget, &ur);
00464         }
00465     }
00466 }
00467
00468 int LPseudoWinAttachment::SearchWidID(LPane *pane)
00469 {
00470     int res = m_widid;
00471
00472     // first ask the cache
00473     std::map<LPane *, int>::iterator i = m_CacheWidgets.find(pane);
00474     if(i != m_CacheWidgets.end())
00475         return (*i).second;
00476
00477     // then look if it belongs to a tab
00478     UCmdTarget *target = UEventQueryWidget(m_widid);
00479     UWidget *wid = UDYNAMIC_CAST(UWidget, target);
00480     if(wid == 0L)
00481         return res;
00482
00483     std::map<int, UWidget *>::iterator t;
00484     for(t = wid->m_tabs.begin(); t != wid->m_tabs.end(); ++t)
00485     {
00486         UWidget *tab = (*t).second;
00487         std::map<int, void *>::iterator s;
00488         for(s = tab->m_widgets.begin(); s != tab->m_widgets.end(); ++s)
00489         {
00490             if((*s).second == (void *)pane)
00491             {
00492                 res = tab->GetWidID();
00493                 break; // it's a tab widget
00494             }
00495         }
00496     }
00497
00498     // so we guess it's in the main widget !
00499     std::map<LPane *, int>::value_type val(pane, res);
00500     m_CacheWidgets.insert(val);
00501
00502     return res;
00503 }
00504
00505 void LPseudoWinAttachment::InvalidCache(UWidget *tab_wid)
00506 {
00507     std::map<int, void *>::iterator s;
00508     for(s = tab_wid->m_widgets.begin(); s != tab_wid->m_widgets.end(); ++s)
00509     {
00510         std::map<LPane *, int>::iterator i = m_CacheWidgets.find((LPane *)(*s).second);
00511         if(i != m_CacheWidgets.end())
00512             m_CacheWidgets.erase(i);
00513     }
00514 }
00515
00516
00517 void LPseudoWinAttachment::ListenToMessage(
00518                             MessageT        inMessage,
00519                             void*           ioParam)
00520 {
00521     int cmdid;
00522     LPane *pane;
00523
00524     if(gTurnOffBroadcast)
00525         return;
00526
00527     if(macpp_getcmdid(inMessage, cmdid))
00528     {
00529         LWindow *wind = dynamic_cast<LWindow*>(GetOwnerHost());
00530         if(wind != 0L)
00531         {
00532             pane = wind->FindPaneByID(inMessage);
00533
00534             if(pane != 0L)
00535             {
00536                 int widid = SearchWidID(pane);
00537
00538                 LEditText *edit;
00539                 LControl *control;
00540                 LMenuController *popup;
00541                 LScrollBar *bar;
00542                 LSlider *slider;
00543                 LLittleArrows *arrows;
00544                 LCheckBoxGroupBox *groupbox;
00545
00546                 if((edit = dynamic_cast<LEditText*>(pane)) != 0L)
00547                     UEventSendMessage(widid, EV_EDITCHANGE, cmdid, 0L);
00548                 else if((popup = dynamic_cast<LMenuController*>(pane)) != 0L &&
00549                     popup->GetMacMenuH() != 0L)
00550                 {
00551                     SInt16 item = popup->GetCurrentMenuItem();
00552                     LStr255 pstr;
00553                     if(item > 0)
00554                         popup->GetMenuItemText(item, pstr);
00555                     UStr content(pstr);
00556                     UEventSendMessage(widid, EV_COMBO_SEL, UMAKEINT(cmdid, item - 1),
00557                         (void *)(const char *)content);
00558                 }
00559                 else if((bar = dynamic_cast<LScrollBar*>(pane)) != 0L)
00560                     UEventSendMessage(widid, EV_SCROLLCHANGE, cmdid, (void *)bar->GetValue());
00561                 else if((slider = dynamic_cast<LSlider*>(pane)) != 0L)
00562                     UEventSendMessage(widid, EV_SCROLLCHANGE, cmdid, (void *)slider->GetValue());
00563                 else if((arrows = dynamic_cast<LLittleArrows*>(pane)) != 0L)
00564                     UEventSendMessage(widid, EV_SCROLLCHANGE, cmdid, (void *)arrows->GetValue());
00565                 else if((control = dynamic_cast<LControl*>(pane)) != 0L)
00566                     UEventSendMessage(widid, EV_CMD, cmdid, 0L);
00567                 else if((groupbox = dynamic_cast<LCheckBoxGroupBox*>(pane)) != 0L)
00568                     UEventSendMessage(widid, EV_CMD, cmdid, 0L);
00569             }
00570         }
00571     }
00572     else switch (inMessage)
00573     {
00574         case msg_ScrollAction:
00575         {
00576             LScrollBar::SScrollMessage *message = static_cast<LScrollBar::SScrollMessage *>(ioParam);
00577             LScrollBar* scrollBar = message->scrollBar;
00578             int fPageStep = 1;
00579             if(macpp_getcmdid(scrollBar->GetPaneID(), cmdid))
00580                 fPageStep = GetPageValue(cmdid);
00581             int fButtonStep = 1;
00582             switch(message->hotSpot)
00583             {
00584             case kControlPageUpPart:
00585                 scrollBar->SetValue(scrollBar->GetValue() - fPageStep);
00586                 break;
00587             case kControlUpButtonPart:
00588                 scrollBar->SetValue(scrollBar->GetValue() - fButtonStep);
00589                 break;
00590             case kControlPageDownPart:
00591                 scrollBar->SetValue(scrollBar->GetValue() + fPageStep);
00592                 break;
00593             case kControlDownButtonPart:
00594                 scrollBar->SetValue(scrollBar->GetValue() + fButtonStep);
00595                 break;
00596             }
00597             break;
00598         }
00599         case UTextTableView_SingleClick:
00600         case UTextTableView_DoubleClick:
00601             pane = static_cast<LPane *>(ioParam);
00602
00603             if(pane != 0L && macpp_getcmdid(pane, cmdid))
00604             {
00605                 UStr name;
00606                 int entry = 0;
00607                 LTextTableView *table = dynamic_cast<LTextTableView *>(pane);
00608                 if(table != 0L)
00609                 {
00610                     STableCell cell = table->GetFirstSelectedCell();
00611                     if(!cell.IsNullCell())
00612                     {
00613                         char tmp[255];
00614                         UInt32 ioDataSize = 255;
00615                         table->GetCellData(cell, tmp, ioDataSize);
00616                         name.set(tmp, ioDataSize);
00617                         entry = cell.row;
00618                     }
00619                 }
00620
00621                 UEventSendMessage(SearchWidID(pane),
00622                     inMessage == UTextTableView_SingleClick ?
00623                     EV_LIST_SELECTING : EV_LIST_DBLCLICK, UMAKEINT(cmdid, entry - 1),
00624                     (void *)(const char *)name);
00625             }
00626             break;
00627     }
00628 }
00629
00630 CPseudoItem::CPseudoItem(int widid, int cmdid) : m_widid(widid), m_cmdid(cmdid), m_data(0L)
00631 {
00632 }
00633
00634 CPseudoItem::~CPseudoItem()
00635 {
00636 }
00637
00638 // this is the routine called to know what to draw within the
00639 // table cell. See the comments in LOutlineItem.cp for more info.
00640 void
00641 CPseudoItem::GetDrawContentsSelf(
00642     const STableCell&       inCell,
00643     SOutlineDrawContents&   ioDrawContents)
00644 {
00645     std::map<int, UStr>::iterator i = m_texts.find(inCell.col);
00646     if(i != m_texts.end())
00647     {
00648         ioDrawContents.outShowSelection = true;
00649         LStr255 pstr((*i).second);
00650         LString::CopyPStr(pstr, ioDrawContents.outTextString);
00651     }
00652 }
00653
00654 // just to be cute, we'll draw an adornment (again, see the LOutlineItem.cp
00655 // comments for more information). We'll draw a groovy gray background
00656 void
00657 CPseudoItem::DrawRowAdornments(
00658     const Rect&     inLocalRowRect )
00659 {
00660     ShadeRow(UGAColorRamp::GetColor(colorRamp_White), inLocalRowRect);
00661     RGBColor c = UGAColorRamp::GetColor(colorRamp_Gray2);
00662     RGBForeColor(&c);
00663     MoveTo(inLocalRowRect.right, inLocalRowRect.top);
00664     LineTo(inLocalRowRect.right, inLocalRowRect.bottom);
00665 }
00666
00667 void CPseudoItem::DrawCell(const STableCell & inCell, const Rect & inLocalCellRect)
00668 {
00669     LOutlineItem::DrawCell(inCell, inLocalCellRect);
00670
00671     RGBColor c = UGAColorRamp::GetColor(colorRamp_Gray2);
00672     RGBForeColor(&c);
00673     MoveTo(inLocalCellRect.right - 1, inLocalCellRect.top);
00674     LineTo(inLocalCellRect.right - 1, inLocalCellRect.bottom);
00675 }
00676
00677 void CPseudoItem::SingleClick(
00678                                 const STableCell&           inCell,
00679                                 const SMouseDownEvent&      inMouseDown,
00680                                 const SOutlineDrawContents& inDrawContents,
00681                                 Boolean                     inHitText)
00682 {
00683     UStr name;
00684     std::map<int, UStr>::iterator i = m_texts.find(inCell.col - 1);
00685     if(i != m_texts.end())
00686     {
00687         name = (*i).second;
00688     }
00689     UEventSendMessage(m_widid,
00690         EV_LIST_SELECTING, UMAKEINT(m_cmdid, inCell.row - 1),
00691         (void *)(const char *)name);
00692
00693     LOutlineItem::SingleClick(inCell, inMouseDown, inDrawContents, inHitText);
00694 }
00695
00696 void
00697 CPseudoItem::DoubleClick(
00698     const STableCell&           inCell,
00699     const SMouseDownEvent&      inMouseDown,
00700     const SOutlineDrawContents& inDrawContents,
00701     Boolean                     inHitText)
00702 {
00703     UStr name;
00704     std::map<int, UStr>::iterator i = m_texts.find(inCell.col - 1);
00705     if(i != m_texts.end())
00706     {
00707         name = (*i).second;
00708     }
00709     UEventSendMessage(m_widid,
00710         EV_LIST_DBLCLICK, UMAKEINT(m_cmdid, inCell.row - 1),
00711         (void *)(const char *)name);
00712
00713     LOutlineItem::DoubleClick(inCell, inMouseDown, inDrawContents, inHitText);
00714 }
00715
00716 int UPPMenu::sPPMenuWidID = -1;
00717
00718 UPPMenu::UPPMenu() : UMenu(::UEventGetWidID())
00719 {
00720     sPPMenuWidID = GetWidID();
00721 }
00722
00723 UPPMenu::~UPPMenu()
00724 {
00725 }
00726
00727 UPseudoRotButton::UPseudoRotButton(LStream *inStream, ClassIDT inImpID) : LBevelButton(inStream, inImpID), fCurrentIcon(0)
00728 {
00729     ReadIconsID(inStream, fIconSuite);
00730
00731     if(fIconSuite.size() != 0)
00732         DoRotate(0, false);
00733 }
00734
00735 UPseudoRotButton::~UPseudoRotButton()
00736 {
00737 }
00738
00739 void UPseudoRotButton::ReadIconsID(LStream *inStream, std::vector<short> & res)
00740 {
00741     LStr255 pstr;
00742
00743     inStream->ReadPString(pstr);
00744     UStr str(pstr);
00745     const char *ptr = str;
00746     while(ptr != 0L)
00747     {
00748         int v;
00749         const char *tmp = strchr(ptr, ',');
00750         if(tmp != 0L)
00751         {
00752             UStr stmp;
00753             size_t offset = tmp - ptr;
00754             stmp.set(ptr, offset);
00755             ptr += offset + 1;
00756             if(sscanf(stmp, "%d", &v) == 1)
00757                 res.push_back(v);
00758         }
00759         else
00760         {
00761             if(sscanf(ptr, "%d", &v) == 1)
00762                 res.push_back(v);
00763             ptr = 0L;
00764         }
00765     }
00766 }
00767
00768 void UPseudoRotButton::DoRotate(int icon, bool refresh)
00769 {
00770     if(fCurrentIcon != icon && icon >= 0 && icon < fIconSuite.size())
00771     {
00772         fCurrentIcon = icon;
00773         ControlButtonContentInfo info;
00774         GetContentInfo(info);
00775         if(info.contentType == kControlContentCIconRes ||
00776             info.contentType == kControlContentIconSuiteRes ||
00777             info.contentType == kControlContentICONRes ||
00778             info.contentType == kControlContentPictRes)
00779         {
00780             info.u.resID = fIconSuite[icon];
00781             SetContentInfo(info);
00782         }
00783         if(refresh)
00784             Refresh();
00785     }
00786 }
00787
00788 UPseudoPlaceHolder::UPseudoPlaceHolder(LStream *inStream) : LPlaceHolder(inStream),
00789     fCurrentView(0L), fWidid(-1)
00790 {
00791     LStr255 pstr;
00792     inStream->ReadPString(pstr);
00793     *inStream >> fController;
00794
00795     UStr str(pstr);
00796     const char *ptr = str;
00797     while(ptr != 0L)
00798     {
00799         int v;
00800         const char *tmp = strchr(ptr, ',');
00801         if(tmp != 0L)
00802         {
00803             UStr stmp;
00804             size_t offset = tmp - ptr;
00805             stmp.set(ptr, offset);
00806             ptr += offset + 1;
00807             if(sscanf(stmp, "%d", &v) == 1)
00808                 fViewSuite.push_back(v);
00809         }
00810         else
00811         {
00812             if(sscanf(ptr, "%d", &v) == 1)
00813                 fViewSuite.push_back(v);
00814             ptr = 0L;
00815         }
00816     }
00817 }
00818
00819 UPseudoPlaceHolder::~UPseudoPlaceHolder()
00820 {
00821 }
00822
00823 void UPseudoPlaceHolder::DoRotate(int entry)
00824 {
00825     int cmdid;
00826     if(macpp_getcmdid(GetPaneID(), cmdid) && entry >= 0 && entry < fViewSuite.size())
00827     {
00828         LWindow *win = macpp_findwindow(this);
00829         if(win == 0L)
00830             return;
00831
00832         LView* samplePanel = UReanimator::CreateView(fViewSuite[entry], this, win);
00833         if(samplePanel == 0L)
00834             return;
00835
00836         InstallOccupant (samplePanel);
00837
00838         LView *oldView = fCurrentView;
00839
00840         if (fCurrentView != 0L)
00841         {
00842             fCurrentView->Hide ();
00843             fCurrentView = nil;
00844         }
00845
00846         Refresh();
00847         fCurrentView = samplePanel;
00848
00849         if(fWidid != -1 && !gTurnOffBroadcast)
00850             UEventSendMessage(fWidid, EV_PAGE_CHANGED, UMAKEINT(cmdid, entry), 0L);
00851
00852         if (oldView != 0L)
00853         {
00854             delete oldView;
00855         }
00856
00857     }
00858 }
00859
00860 void UPseudoPlaceHolder::ListenToMessage(MessageT inMessage, void * ioParam)
00861 {
00862     if(inMessage == fController)
00863     {
00864         SInt32 currPageIndex = *static_cast<SInt32 *>(ioParam);
00865         DoRotate(currPageIndex - 1);
00866     }
00867 }
00868
00869 void UPseudoPlaceHolder::FinishCreateSelf(void)
00870 {
00871     DoRotate(0);
00872
00873     LWindow *win = macpp_findwindow(this);
00874     if(win == 0L)
00875         return;
00876
00877     LPageController *controller = dynamic_cast<LPageController*>(win->FindPaneByID(fController));
00878     if (controller != 0L)
00879     {
00880         controller->StartBroadcasting ();
00881         controller->AddListener (this);
00882     }
00883     LTabsControl *controller2 = dynamic_cast<LTabsControl*>(win->FindPaneByID(fController));
00884     if (controller2 != 0L)
00885     {
00886         controller2->StartBroadcasting ();
00887         controller2->AddListener (this);
00888     }
00889 }
00890
00891 UPseudoPageHider::UPseudoPageHider(LStream *inStream) : LAttachment(inStream),
00892     fWidid(-1), fCurSel(-1), fPageCtrl(0L)
00893 {
00894     SetMessage(msg_FinishCreate);
00895
00896     LStr255 pstr;
00897     inStream->ReadPString(pstr);
00898
00899     UStr str(pstr);
00900     const char *ptr = str;
00901     while(ptr != 0L)
00902     {
00903         PaneIDT paneID;
00904         const char *tmp = strchr(ptr, ',');
00905         if(tmp != 0L)
00906         {
00907             UStr stmp;
00908             size_t offset = tmp - ptr;
00909             stmp.set(ptr, offset);
00910             ptr += offset + 1;
00911             if(stmp.length() == 4)
00912             {
00913                 paneID = *(PaneIDT *)(char *)stmp;
00914                 fViewSuite.push_back(paneID);
00915             }
00916         }
00917         else
00918         {
00919             if(strlen(ptr) == 4)
00920             {
00921                 paneID = *(PaneIDT *)ptr;
00922                 fViewSuite.push_back(paneID);
00923             }
00924             ptr = 0L;
00925         }
00926     }
00927 }
00928
00929 void    UPseudoPageHider::ExecuteSelf(
00930                         MessageT        inMessage,
00931                         void*           ioParam)
00932 {
00933     if(inMessage == msg_FinishCreate)
00934     {
00935         LPane *pane = reinterpret_cast<LPane*>(ioParam);
00936         fPageCtrl = dynamic_cast<LPageController*>(pane);
00937         if(fPageCtrl == 0L)
00938         {
00939             UAppConsole("The UPseudoPageHider attachement does not have any LPageController to attach to.");
00940         }
00941         else
00942         {
00943             // add ourself to the broadcast so we receive the changes
00944             fPageCtrl->StartBroadcasting ();
00945             fPageCtrl->AddListener (this);
00946         }
00947     }
00948 }
00949
00950 UPseudoPageHider::~UPseudoPageHider()
00951 {
00952 }
00953
00954 void UPseudoPageHider::DoRotate(int entry)
00955 {
00956     if(fPageCtrl == 0L)
00957         return;
00958
00959     int cmdid;
00960     if(macpp_getcmdid(fPageCtrl->GetPaneID(), cmdid) && entry >= 0 && entry < fViewSuite.size() &&
00961         entry != fCurSel)
00962     {
00963         fCurSel = entry;
00964
00965         LWindow *win = macpp_findwindow(fPageCtrl);
00966         if(win == 0L)
00967             return;
00968
00969         LPane* samplePanel;
00970         std::vector<PaneIDT>::iterator i;
00971         for(i = fViewSuite.begin(); i != fViewSuite.end(); ++i)
00972         {
00973             samplePanel = win->FindPaneByID(*i);
00974             if(samplePanel != 0L)
00975                 samplePanel->Hide();
00976         }
00977
00978         samplePanel = win->FindPaneByID(fViewSuite[entry]);
00979         if(samplePanel == 0L)
00980             return;
00981
00982         samplePanel->Show();
00983
00984         if(fWidid != -1)
00985             UEventSendMessage(fWidid, EV_CMD, cmdid, (void *)entry);
00986     }
00987 }
00988
00989 void UPseudoPageHider::ListenToMessage(MessageT inMessage, void * ioParam)
00990 {
00991     if(fPageCtrl != 0L && inMessage == fPageCtrl->GetPaneID())
00992     {
00993         SInt32 currPageIndex = *static_cast<SInt32 *>(ioParam);
00994         DoRotate(currPageIndex - 1);
00995     }
00996 }
00997
00998 UPseudoFakePane::UPseudoFakePane(const SPaneInfo    &inPaneInfo, LPseudoWinAttachment *inAttach) :
00999     LPane(inPaneInfo), m_Attach(inAttach)
01000 {
01001 }
01002
01003 UPseudoFakePane::~UPseudoFakePane()
01004 {
01005 }
01006
01007 void UPseudoFakePane::ActivateSelf()
01008 {
01009     UEventNotifyMessage(EV_UPDATEFOCUS, 0, dynamic_cast<LWindow *>(GetSuperView()));
01010 }
01011
01012 void UPseudoFakePane::DeactivateSelf()
01013 {
01014     UEventNotifyMessage(EV_UPDATEFOCUS, 1, dynamic_cast<LWindow *>(GetSuperView()));
01015 }
01016
01017 void UPseudoFakePane::AdaptToSuperFrameSize(
01018                             SInt32      inSurrWidthDelta,
01019                             SInt32      inSurrHeightDelta,
01020                             Boolean     inRefresh)
01021 {
01022     LPane::AdaptToSuperFrameSize(inSurrWidthDelta, inSurrHeightDelta, inRefresh);
01023
01024     m_Attach->CheckWindowSize();
01025 }
01026
01027
01028 class CDummyClass
01029 {
01030 public:
01031     CDummyClass()
01032     {
01033         RegisterClass_(UPseudoRotButton);
01034         RegisterClass_(UPseudoPlaceHolder);
01035         RegisterClass_(UPseudoPageHider);
01036     }
01037
01038 } sDummyStarter;
Generated on Sun Feb 24 01:21:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UPseudoSupport.h File Reference

rf/support/powerplant/UPseudoSupport.h File Reference

#include "uwidget.h"
#include <LOutlineItem.h>
#include <LCmdBevelButton.h>
#include <LPlaceHolder.h>
#include <map>
#include <vector>

Include dependency graph for UPseudoSupport.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | LMainPseudoAttachment
class | LPseudoWinAttachment
struct | UPseudoCmdStatusWrapper
class | UPseudoFakePane
class | CPseudoItem
class | UPseudoPageHider
class | UPseudoPlaceHolder
class | UPseudoRotButton

Defines

#define | UTextTableView_SingleClick FOUR_CHAR_CODE('UTVS')
#define | UTextTableView_DoubleClick FOUR_CHAR_CODE('UTVD')

Functions

void | macpp_fecthview (int widid, LPane *view)
void | macpp_linkbroadcasters (LPane *view, LListener *listener)
void | macpp_preparetable (LOutlineTable *table)
void | macpp_preparetable (void *win, LTextTableView *table)
LPseudoWinAttachment * | macpp_getattachwindow (UWidget *wid)
LPseudoWinAttachment * | macpp_getattachwindow (LWindow *wind)

Variables

bool | gTurnOffBroadcast

Define Documentation

#define UTextTableView_DoubleClick FOUR_CHAR_CODE('UTVD')

Definition at line 201 of file UPseudoSupport.h.

Referenced by LPseudoWinAttachment::ListenToMessage, and macpp_preparetable.

#define UTextTableView_SingleClick FOUR_CHAR_CODE('UTVS')

Definition at line 200 of file UPseudoSupport.h.

Referenced by LPseudoWinAttachment::ListenToMessage, and macpp_preparetable.

Function Documentation

void macpp_fecthview | ( | int | widid,
 |  | LPane * | view
 | ) |

Definition at line 146 of file UPseudoSupport.cpp.

Referenced by macpp_fecthview, UWidget::OnInitWidget, and UWidget::OnPageChanged.

00147 {
00148     int cmdid;
00149     if(macpp_getcmdid(pane, cmdid))
00150     {
00151         UEventSendMessage(widid, EV_INIT_WIDGET, cmdid, pane);
00152
00153         // look for any attachement we know of
00154         const TArray<LAttachment*>* theAttachments = pane->GetAttachmentsList();
00155         if (theAttachments != nil)
00156         {
00157             TArrayIterator<LAttachment*> iterate(*theAttachments);
00158
00159             LAttachment*    theAttach;
00160             while (iterate.Next(theAttach))
00161             {
00162                 UPseudoPageHider *hider = dynamic_cast<UPseudoPageHider*>(theAttach);
00163                 if(hider != 0L)
00164                     hider->SetWidID(widid);
00165             }
00166         }
00167
00168         // for any control, set the broadcast message to be the Pane ID
00169         LControl *control = dynamic_cast<LControl*>(pane);
00170         if(control != 0L && control->GetValueMessage() == 0)
00171         {
00172             control->SetValueMessage(pane->GetPaneID());
00173         }
00174
00175         // idem
00176         LCheckBoxGroupBox *groupbox = dynamic_cast<LCheckBoxGroupBox*>(pane);
00177         if(groupbox != 0L && groupbox->GetValueMessage() == 0)
00178         {
00179             groupbox->SetValueMessage(pane->GetPaneID());
00180         }
00181
00182         // set the widget id for some custom controls
00183         UPseudoPlaceHolder *holder = dynamic_cast<UPseudoPlaceHolder*>(pane);
00184         if(holder != 0L)
00185         {
00186             holder->SetWidID(widid);
00187             return; // don't fetch inside, it'll be owned by another pseudo widget
00188         }
00189
00190         // this attachment let us fire a EV_CUSTOM_DRAW event when painting
00191         if(typeid(*pane) == typeid(LView))
00192         {
00193             LPseudoDrawAttachment *attach = NEW LPseudoDrawAttachment(widid, cmdid);
00194             pane->AddAttachment(attach);
00195         }
00196     }
00197
00198     // menus with an unspecified menu id need to be created if we want to use
00199     // later on the EV_COMBO_APPEND message on it.
00200     LPopupButton *controler = dynamic_cast<LPopupButton*>(pane);
00201     if(controler != 0L)
00202     {
00203         if(controler->GetMenuID() == MENU_Unspecified && controler->GetMacMenuH() == 0L)
00204             controler->SetMacMenuH(::NewMenu(::UniqueID('MENU'), "\p"), true);
00205     }
00206
00207     // recurse
00208     LView *view = dynamic_cast<LView*>(pane);
00209     if(view == 0L)
00210         return;
00211
00212     TArrayIterator<LPane*> iterator(view->GetSubPanes());
00213     LPane   *theSub;
00214     while (iterator.Next(theSub))
00215     {
00216         macpp_fecthview(widid, theSub);
00217     }
00218 }

LPseudoWinAttachment* macpp_getattachwindow ( LWindow * wind )

Definition at line 122 of file UPseudoSupport.cpp.

Referenced by macpp_getattachwindow, UWidget::OnGetSliderProperty, UWidget::OnPageChanged, and UWidget::OnSetSliderProperty.

00123 {
00124     if(wind != 0L)
00125     {
00126         const TArray<LAttachment*>* theAttachments = wind->GetAttachmentsList();
00127
00128         if (theAttachments != nil)
00129         {
00130             TArrayIterator<LAttachment*> iterate(*theAttachments);
00131
00132             LAttachment*    theAttach;
00133             while (iterate.Next(theAttach))
00134             {
00135                 LPseudoWinAttachment*   theWinAttach = dynamic_cast<LPseudoWinAttachment*>(theAttach);
00136                 if (theWinAttach != nil)
00137                 {
00138                     return theWinAttach;
00139                 }
00140             }
00141         }
00142     }
00143     return 0L;
00144 }

LPseudoWinAttachment* macpp_getattachwindow ( UWidget * wid )

void macpp_linkbroadcasters | ( | LPane * | view,
 |  | LListener * | listener
 | ) |

Definition at line 220 of file UPseudoSupport.cpp.

Referenced by macpp_linkbroadcasters, UWidget::OnInitWidget, and UWidget::OnPageChanged.

00221 {
00222     LBroadcaster *broadcaster = dynamic_cast<LBroadcaster *>(pane);
00223     if(broadcaster != 0L && !broadcaster->HasListener(listener))
00224         broadcaster->AddListener(listener);
00225
00226     LView *view = dynamic_cast<LView*>(pane);
00227     if(view == 0L)
00228         return;
00229
00230     TArrayIterator<LPane*> iterator(view->GetSubPanes());
00231     LPane   *theSub;
00232     while (iterator.Next(theSub))
00233     {
00234         macpp_linkbroadcasters(theSub, listener);
00235     }
00236 }

void macpp_preparetable | ( | void * | win,
 |  | LTextTableView * | table
 | ) |

Definition at line 257 of file UPseudoSupport.cpp.

Referenced by UWidget::OnListAddColumns, UWidget::OnListResetAll, and UWidget::OnListSetColWidth.

00258 {
00259     if(table->GetTableGeometry() != 0L)
00260         return;
00261
00262     SDimension16    tableSize;
00263     table->SetCellSizer(NEW LCellSizeToFit());
00264     table->GetFrameSize(tableSize);
00265     table->SetTableGeometry(NEW LTableMonoGeometry(table,
00266         tableSize.width/1 /* col width = width/num Cols */,
00267         12  /* row height */));
00268     table->SetTableSelector(NEW LTableSingleRowSelector( table ));
00269     table->SetTableStorage(NEW LTableArrayStorage(table, (UInt32)0));
00270     table->SetDoubleClickMessage(UTextTableView_DoubleClick);
00271     table->SetSingleClickMessage(UTextTableView_SingleClick);
00272     table->SetCustomHilite(true); // cause there is a hilite bug if we don't
00273 }

void macpp_preparetable ( LOutlineTable * table )

Variable Documentation

bool gTurnOffBroadcast

Definition at line 12 of file UPseudoSupport.h.

Generated on Sun Feb 24 01:22:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/support/powerplant/UPseudoSupport.h Source File

rf/support/powerplant/UPseudoSupport.h

Go to the documentation of this file.
00001 #ifndef UPSEUDOSUPPORT_H
00002 #define UPSEUDOSUPPORT_H
00003
00004 #include "uwidget.h"
00005 #include <LOutlineItem.h>
00006 #include <LCmdBevelButton.h>
00007 #include <LPlaceHolder.h>
00008
00009 #include <map>
00010 #include <vector>
00011
00012 extern bool gTurnOffBroadcast;
00013
00014 struct UPseudoCmdStatusWrapper
00015 {
00016     Boolean *outEnabled;
00017     Boolean *outUsesMark;
00018     UInt16 *outMark;
00019     unsigned char *outName;
00020 };
00021
00022 class UPseudoRotButton : public LBevelButton
00023 {
00024 public:
00025     enum { class_ID = FOUR_CHAR_CODE('UPRB') };
00026
00027     UPseudoRotButton(LStream *inStream, ClassIDT inImpID = LBevelButton::imp_class_ID);
00028     virtual ~UPseudoRotButton();
00029
00030     virtual void DoRotate(int icon, bool refresh = true);
00031     inline int GetCurrentState(void) const { return fCurrentIcon; }
00032 protected:
00033     void ReadIconsID(LStream *inStream, std::vector<short> & res);
00034
00035     std::vector<short> fIconSuite;
00036     int fCurrentIcon;
00037 };
00038
00039 class UPseudoPlaceHolder : public LPlaceHolder, public LListener
00040 {
00041 public:
00042     enum { class_ID = FOUR_CHAR_CODE('UPLH') };
00043
00044     UPseudoPlaceHolder(LStream *inStream);
00045     virtual ~UPseudoPlaceHolder();
00046
00047     void DoRotate(int entry);
00048     inline void SetWidID(int widid) { fWidid = widid; }
00049     inline LView *GetCurrentView(void) { return fCurrentView; }
00050
00051     virtual void    ListenToMessage(
00052                             MessageT        inMessage,
00053                             void*           ioParam);
00054
00055 protected:
00056     virtual void    FinishCreateSelf();
00057
00058     std::vector<short> fViewSuite;
00059     LView *fCurrentView;
00060     PaneIDT fController;
00061     int fWidid;
00062 };
00063
00064 class UPseudoPageHider : public LAttachment, public LListener
00065 {
00066 public:
00067     enum { class_ID = FOUR_CHAR_CODE('UPPH') };
00068
00069     UPseudoPageHider(LStream *inStream);
00070     virtual ~UPseudoPageHider();
00071
00072     inline void SetWidID(int widid) { fWidid = widid; }
00073
00074     virtual void    ListenToMessage(
00075                             MessageT        inMessage,
00076                             void*           ioParam);
00077
00078 protected:
00079     void DoRotate(int entry);
00080
00081     virtual void    ExecuteSelf(
00082                             MessageT        inMessage,
00083                             void*           ioParam);
00084
00085     std::vector<PaneIDT> fViewSuite;
00086     int fWidid;
00087     int fCurSel;
00088     class LPageController *fPageCtrl;
00089 };
00090
00091 class LMainPseudoAttachment : public LAttachment, public LPeriodical
00092 {
00093 public:
00094     LMainPseudoAttachment();
00095     virtual ~LMainPseudoAttachment();
00096
00097     virtual void        SpendTime(
00098                                 const EventRecord&  inMacEvent);
00099
00100 protected:
00101     virtual void    ExecuteSelf(
00102                             MessageT        inMessage,
00103                             void*           ioParam);
00104 };
00105
00106 class LPseudoWinAttachment : public LAttachment, public LListener
00107 {
00108 public:
00109     LPseudoWinAttachment(int widid);
00110     virtual ~LPseudoWinAttachment();
00111
00112     int GetPageValue(int cmdid) const;
00113     void SetPageValue(int cmdid, int value);
00114
00115     void CheckWindowSize(void);
00116
00117     int SearchWidID(LPane *pane);
00118         // since several pseudo-widgets can be attached to
00119         // the window (ex: tab controller), we need to search
00120         // for the correct Widget to broadcast the event.
00121
00122     void InvalidCache(UWidget *tab_wid);
00123         // when a view is removed (from a tab window)
00124         // we need to invalidate the cache used by 'SearchWidID'.
00125
00126 protected:
00127     virtual void    ExecuteSelf(
00128                             MessageT        inMessage,
00129                             void*           ioParam);
00130     virtual void    ListenToMessage(
00131                             MessageT        inMessage,
00132                             void*           ioParam);
00133
00134     int m_widid;
00135     Rect m_lastRect;
00136     std::map<int, int> m_PageValues;
00137     std::map<LPane *, int> m_CacheWidgets;
00138 };
00139
00140 class UPseudoFakePane : public LPane
00141 {
00142 public:
00143     UPseudoFakePane(const SPaneInfo &inPaneInfo, LPseudoWinAttachment *inAttach);
00144     virtual ~UPseudoFakePane();
00145
00146     virtual void        AdaptToSuperFrameSize(
00147                                 SInt32      inSurrWidthDelta,
00148                                 SInt32      inSurrHeightDelta,
00149                                 Boolean     inRefresh);
00150
00151 protected:
00152     LPseudoWinAttachment *m_Attach;
00153
00154     virtual void        ActivateSelf();
00155     virtual void        DeactivateSelf();
00156 };
00157
00158 class CPseudoItem : public LOutlineItem
00159 {
00160 public:
00161     CPseudoItem(int widid, int cmdid);
00162     virtual ~CPseudoItem();
00163
00164     std::map<int, UStr> m_texts;
00165     void *m_data;
00166
00167 protected:
00168     virtual void GetDrawContentsSelf(const STableCell& inCell, SOutlineDrawContents& ioDrawContents);
00169
00170     virtual void DrawRowAdornments(const Rect& inLocalRowRect);
00171     virtual void            DrawCell(
00172                                     const STableCell&       inCell,
00173                                     const Rect&             inLocalCellRect);
00174
00175     virtual void DoubleClick(const STableCell& inCell, const SMouseDownEvent& inMouseDown,
00176         const SOutlineDrawContents& inDrawContents, Boolean inHitText);
00177     virtual void            SingleClick(
00178                                     const STableCell&           inCell,
00179                                     const SMouseDownEvent&      inMouseDown,
00180                                     const SOutlineDrawContents& inDrawContents,
00181                                     Boolean                     inHitText);
00182
00183     int m_widid, m_cmdid;
00184 private:
00185     // defensive programming
00186     CPseudoItem();
00187     CPseudoItem( const CPseudoItem &inOriginal );
00188     CPseudoItem&    operator=( const CPseudoItem &inOriginal );
00189 };
00190
00191 class LTextTableView;
00192
00193 extern void macpp_fecthview(int widid, LPane *view);
00194 extern void macpp_linkbroadcasters(LPane *view, LListener *listener);
00195 extern void macpp_preparetable(LOutlineTable *table);
00196 extern void macpp_preparetable(void *win, LTextTableView *table);
00197 extern LPseudoWinAttachment *macpp_getattachwindow(UWidget *wid);
00198 extern LPseudoWinAttachment *macpp_getattachwindow(LWindow *wind);
00199
00200 #define UTextTableView_SingleClick FOUR_CHAR_CODE('UTVS')
00201 #define UTextTableView_DoubleClick FOUR_CHAR_CODE('UTVD')
00202
00203 #endif
Generated on Sun Feb 24 01:21:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/BrowseFileView.cpp Source File

WinCvs/BrowseFileView.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 1998
00019  */
00020
00021 /*
00022  * BrowseFileView.cpp -- Implements the view with all the files
00023  *
00024  */
00025
00026 #include "stdafx.h"
00027 #include <process.h>
00028 #include <vector>
00029 #include <IO.h>
00030 #include "wincvs.h"
00031
00032 #include "BrowseFileView.h"
00033 #include "FileTraversal.h"
00034 #include "CvsCommands.h"
00035 #include "MultiFiles.h"
00036 #include "CvsArgs.h"
00037 #include "AppConsole.h"
00038 #include "CvsPrefs.h"
00039 #include "CvsIgnore.h"
00040 #include "TclGlue.h"
00041 #include "MacrosSetup.h"
00042 #include "MoveToTrash.h"
00043 #include "WinCvsBrowser.h"
00044 #include "MainFrm.h"
00045 #include "wincvs_winutil.h"
00046 #include "BrowseViewModel.h"
00047 #include "BrowseViewHandlers.h"
00048 #include "FileViewWatcher.h"
00049 #include "BrowseViewColumn.h"
00050 #include "PythonGlue.h"
00051
00052 #include "umain.h"
00053
00054 #ifdef _DEBUG
00055 #define new DEBUG_NEW
00056 #undef THIS_FILE
00057 static char THIS_FILE[] = __FILE__;
00058 #endif
00059
00060 static const int FILECHANGE_TIMER = 999;
00061 static const int kSpc = 3;
00062 static const int WM_RESETVIEW = WM_APP + 12;
00063
00064 // persistent values
00065 CPersistentInt gFileViewSort("P_FileViewSort", EntnodeData::kName);
00066 CPersistentBool gFileViewSortAsc("P_FileViewSortAsc", false);
00067
00069 // CBrowseFileView
00070
00071 IMPLEMENT_DYNCREATE(CBrowseFileView, CListView)
00072
00073 BEGIN_MESSAGE_MAP(CBrowseFileView, CListView)
00074     //{{AFX_MSG_MAP(CBrowseFileView)
00075     ON_COMMAND(ID_VIEW_SMALLICONS, OnViewSmallIcons)
00076     ON_COMMAND(ID_VIEW_FULLLIST, OnViewList)
00077     ON_COMMAND(ID_VIEW_ROWDETAILS, OnViewFullRowDetails)
00078     ON_UPDATE_COMMAND_UI(ID_VIEW_SMALLICONS, OnUpdateViewSmallIcons)
00079     ON_UPDATE_COMMAND_UI(ID_VIEW_ADD, OnUpdateViewAdd)
00080     ON_UPDATE_COMMAND_UI(ID_VIEW_ADDB, OnUpdateViewAddB)
00081     ON_UPDATE_COMMAND_UI(ID_VIEW_ADDU, OnUpdateViewAddB)
00082     ON_UPDATE_COMMAND_UI(ID_VIEW_COMMIT, OnUpdateViewUpdate)
00083     ON_UPDATE_COMMAND_UI(ID_VIEW_RELEASE, OnUpdateViewRelease)
00084     ON_UPDATE_COMMAND_UI(ID_VIEW_RMV, OnUpdateViewRmv)
00085     ON_UPDATE_COMMAND_UI(ID_VIEW_GRAPH, OnUpdateViewGraph)
00086     ON_UPDATE_COMMAND_UI(ID_VIEW_FULLLIST, OnUpdateViewList)
00087     ON_UPDATE_COMMAND_UI(ID_VIEW_EDITSELDEF, OnUpdateViewEditseldef)
00088     ON_UPDATE_COMMAND_UI(ID_VIEW_ROWDETAILS, OnUpdateViewFullRowDetails)
00089     ON_WM_LBUTTONDOWN()
00090     ON_WM_LBUTTONDBLCLK()
00091     ON_NOTIFY_REFLECT(LVN_COLUMNCLICK, OnColumnclick)
00092     ON_COMMAND(ID_VIEW_ADD, OnViewAdd)
00093     ON_COMMAND(ID_VIEW_ADDB, OnViewAddb)
00094     ON_COMMAND(ID_VIEW_ADDU, OnViewAddu)
00095     ON_COMMAND(ID_VIEW_COMMIT, OnViewCommit)
00096     ON_COMMAND(ID_VIEW_RMV, OnViewRmv)
00097     ON_COMMAND(ID_VIEW_UPDATE, OnViewUpdate)
00098     ON_COMMAND(ID_VIEW_QUERYUPDATE, OnViewQueryUpdate)
00099     ON_UPDATE_COMMAND_UI(ID_VIEW_RELOAD, OnUpdateViewReload)
00100     ON_COMMAND(ID_VIEW_RELOAD, OnViewReload)
00101     ON_NOTIFY_REFLECT(LVN_KEYDOWN, OnKeydown)
00102     ON_COMMAND(ID_VIEW_UPONE, OnViewUpone)
00103     ON_UPDATE_COMMAND_UI(ID_VIEW_UPONE, OnUpdateViewUpone)
00104     ON_COMMAND(ID_VIEW_TRASH, OnViewTrash)
00105     ON_UPDATE_COMMAND_UI(ID_VIEW_TRASH, OnUpdateViewTrash)
00106     ON_COMMAND(ID_VIEW_DIFF, OnViewDiff)
00107     ON_COMMAND(ID_VIEW_LOG, OnViewLog)
00108     ON_COMMAND(ID_VIEW_GRAPH, OnViewGraph)
00109     ON_COMMAND(ID_VIEW_STATUS, OnViewStatus)
00110     ON_COMMAND(ID_VIEW_UNLOCKF, OnViewUnlock)
00111     ON_COMMAND(ID_VIEW_WATCHON, OnViewWatchOn)
00112     ON_COMMAND(ID_VIEW_WATCHOFF, OnViewWatchOff)
00113     ON_COMMAND(ID_VIEW_EDIT, OnViewEdit)
00114     ON_COMMAND(ID_VIEW_UNEDIT, OnViewUnedit)
00115     ON_COMMAND(ID_VIEW_WATCHERS, OnViewWatchers)
00116     ON_COMMAND(ID_VIEW_EDITORS, OnViewEditors)
00117     ON_COMMAND(ID_VIEW_RELEASE, OnViewRelease)
00118     ON_COMMAND(ID_VIEW_TAGNEW, OnViewTagNew)
00119     ON_COMMAND(ID_VIEW_TAGDELETE, OnViewTagDelete)
00120     ON_COMMAND(ID_VIEW_TAGBRANCH, OnViewTagBranch)
00121     ON_WM_RBUTTONDOWN()
00122     ON_COMMAND(ID_VIEW_EXPLORE, OnViewExplore)
00123     ON_UPDATE_COMMAND_UI(ID_VIEW_EXPLORE, OnUpdateViewExplore)
00124     ON_WM_TIMER()
00125     ON_COMMAND(ID_VIEW_EDITSEL, OnViewEditsel)
00126     ON_COMMAND(ID_VIEW_EDITSELDEF, OnViewEditseldef)
00127     ON_COMMAND(ID_VIEW_CHECKOUT, OnViewCheckout)
00128     ON_UPDATE_COMMAND_UI(ID_VIEW_CHECKOUT, OnUpdateViewCheckout)
00129     ON_COMMAND(ID_VIEW_IMPORT, OnViewImport)
00130     ON_UPDATE_COMMAND_UI(ID_VIEW_IMPORT, OnUpdateViewImport)
00131     ON_NOTIFY_REFLECT(LVN_BEGINDRAG, OnBegindrag)
00132     ON_NOTIFY_REFLECT(LVN_BEGINRDRAG, OnBeginrdrag)
00133     ON_WM_SETCURSOR()
00134     ON_NOTIFY_REFLECT(LVN_DELETEITEM, OnDeleteitem)
00135     ON_WM_DESTROY()
00136     ON_UPDATE_COMMAND_UI(ID_QUERY_ANNOTATE, OnUpdateQueryAnnotate)
00137     ON_COMMAND(ID_QUERY_ANNOTATE, OnQueryAnnotate)
00138     ON_COMMAND(ID_EDIT_SELECT_ALL, OnEditSelectAll)
00139     ON_COMMAND(ID_VIEW_RESERVEDEDIT, OnViewReservededit)
00140     ON_COMMAND(ID_VIEW_FORCEEDIT, OnViewForceedit)
00141     ON_UPDATE_COMMAND_UI(ID_VIEW_DIFF, OnUpdateViewUpdate)
00142     ON_UPDATE_COMMAND_UI(ID_VIEW_EDIT, OnUpdateViewUpdate)
00143     ON_UPDATE_COMMAND_UI(ID_VIEW_RESERVEDEDIT, OnUpdateViewUpdate)
00144     ON_UPDATE_COMMAND_UI(ID_VIEW_FORCEEDIT, OnUpdateViewUpdate)
00145     ON_UPDATE_COMMAND_UI(ID_VIEW_EDITORS, OnUpdateViewUpdate)
00146     ON_UPDATE_COMMAND_UI(ID_VIEW_LOG, OnUpdateViewUpdate)
00147     ON_UPDATE_COMMAND_UI(ID_VIEW_TAGNEW, OnUpdateViewUpdate)
00148     ON_UPDATE_COMMAND_UI(ID_VIEW_TAGDELETE, OnUpdateViewUpdate)
00149     ON_UPDATE_COMMAND_UI(ID_VIEW_TAGBRANCH, OnUpdateViewUpdate)
00150     ON_UPDATE_COMMAND_UI(ID_VIEW_STATUS, OnUpdateViewUpdate)
00151     ON_UPDATE_COMMAND_UI(ID_VIEW_UNEDIT, OnUpdateViewUpdate)
00152     ON_UPDATE_COMMAND_UI(ID_VIEW_UPDATE, OnUpdateViewUpdate)
00153     ON_UPDATE_COMMAND_UI(ID_VIEW_QUERYUPDATE, OnUpdateViewUpdate)
00154     ON_UPDATE_COMMAND_UI(ID_VIEW_UNLOCKF, OnUpdateViewUpdate)
00155     ON_UPDATE_COMMAND_UI(ID_VIEW_WATCHERS, OnUpdateViewUpdate)
00156     ON_UPDATE_COMMAND_UI(ID_VIEW_WATCHON, OnUpdateViewUpdate)
00157     ON_UPDATE_COMMAND_UI(ID_VIEW_WATCHOFF, OnUpdateViewUpdate)
00158     ON_UPDATE_COMMAND_UI(ID_VIEW_EDITSEL, OnUpdateViewTrash)
00159     //}}AFX_MSG_MAP
00160     ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
00161     ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
00162     ON_UPDATE_COMMAND_UI_RANGE(ID_MACRO_START, ID_MACRO_END, OnUpdateMacro)
00163     ON_COMMAND_EX_RANGE(ID_MACRO_START, ID_MACRO_END, OnMacro)
00164     ON_UPDATE_COMMAND_UI_RANGE(ID_CUST_FILES_MENU, ID_CUST_FOLDER_MENU, OnUpdateCustomize)
00165     ON_COMMAND_EX_RANGE(ID_CUST_FILES_MENU, ID_CUST_FOLDER_MENU, OnCustomize)
00166     ON_MESSAGE(KoWatcher::WM_FILECHANGE, OnFileChange)
00167     ON_MESSAGE(WM_RESETVIEW, OnResetView)
00168 END_MESSAGE_MAP()
00169
00170 CImageList CBrowseFileView::m_SmallImageList;
00171 CImageList CBrowseFileView::m_StateImageList;
00172
00173 // context for traversing
00174 class KoTraversalContext
00175 {
00176     bool m_isRecursive;
00177     bool m_isShowIgnored;
00178     KiFilterModel* m_filter;
00179
00180 public:
00181     CBrowseFileView* m_view;
00182
00183
00184     KoTraversalContext(CBrowseFileView* view)
00185     : m_view(view), m_filter(NULL), m_isRecursive(false), m_isShowIgnored(false)
00186     {
00187         if (CWincvsApp* app = (CWincvsApp *)AfxGetApp())
00188         {
00189             m_filter = app->GetFilterModel();
00190             m_isRecursive = app->GetRecursionModel()->IsShowRecursive();
00191             m_isShowIgnored = app->GetIgnoreModel()->IsShowIgnored();
00192         }
00193     }
00194
00195     bool IsRecursive() const
00196     {
00197         return m_isRecursive;
00198     }
00199
00200     bool IsShowIgnored() const
00201     {
00202         return m_isShowIgnored;
00203     }
00204
00205     bool IsMatch(EntnodeData* data) const
00206     {
00207         return m_filter->IsMatch(data);
00208     }
00209 };
00210
00211 class TViewFill : public TraversalReport
00212 {
00213 public:
00214     CSortList<ENTNODE> m_entries;
00215     vector<CStr> m_ignlist;
00216     const KoTraversalContext* m_context;
00217
00218     TViewFill(const KoTraversalContext* context)
00219     : m_context(context)
00220     , m_entries(200, ENTNODE::Compare)
00221     { }
00222
00223     CBrowseFileView* GetView() const
00224     {
00225         return m_context->m_view;
00226     }
00227
00228     CListCtrl& GetListCtrl() const
00229     {
00230         return GetView()->GetListCtrl();
00231     }
00232
00233     bool IsRecursive() const
00234     {
00235         return m_context->IsRecursive();
00236     }
00237
00238     bool IsShowIgnored() const
00239     {
00240         return m_context->IsShowIgnored();
00241     }
00242
00243     virtual kTraversal EnterDirectory(const char *fullpath, const char *dirname, const FSSpec * macspec)
00244     {
00245         Entries_Open (m_entries, fullpath);
00246         BuildIgnoredList(m_ignlist, fullpath);
00247         return kContinueTraversal;
00248     }
00249
00250     virtual kTraversal ExitDirectory(const char *fullpath)
00251     {
00252         // add the missing files
00253         Entries_SetMissing(m_entries);
00254
00255         int numEntries = m_entries.NumOfElements();
00256         for(int i = 0; i < numEntries; i++)
00257         {
00258             const ENTNODE & theNode = m_entries.Get(i);
00259             EntnodeData *data = theNode.Data();
00260             if (data->IsMissing() && m_context->IsMatch(data))
00261             {
00262                 if (!IsRecursive() || data->GetType() == ENT_FILE)
00263                 {
00264                     int iImage = data->GetType() == ENT_FILE ?
00265                                 (data->IsRemoved() ? kFileIconRemoved : kFileIconMiss) : kFolderIconMiss;
00266                     InitItem(data, iImage);
00267                 }
00268             }
00269         }
00270
00271         m_ignlist.clear();
00272         return kContinueTraversal;
00273     }
00274
00275     // initializes and adds new item to list view
00276     int InitItem(EntnodeData *data, int iImage, const char *tag = 0L)
00277     {
00278         CListCtrl& listCtrl = GetListCtrl();
00279         KoColumnContext context(GetView()->GetPath());
00280         TCHAR buf[256];
00281         GetView()->GetColumnModel()->GetAt(0)->GetText(&context, data, buf, 256);
00282
00283         LV_ITEM lvi;
00284         lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
00285         lvi.iItem = listCtrl.GetItemCount();
00286         lvi.iSubItem = 0;
00287         lvi.pszText = buf;
00288         lvi.iImage = iImage;
00289         lvi.lParam = (LPARAM)(LPVOID)data;
00290         int pos = listCtrl.InsertItem(&lvi);
00291         if (pos >= 0)
00292         {
00293             // note ownership addition
00294             data->Ref();
00295
00296             // set item text for additional columns
00297             KiColumnModel* model = GetView()->GetColumnModel();
00298             int columnCount = model->GetCount();
00299             for(int j = 1; j < columnCount; j++)
00300             {
00301                 TCHAR buf[256];
00302                 model->GetAt(j)->GetText(&context, data, buf, 256);
00303                 listCtrl.SetItemText(pos, j, buf);
00304             }
00305
00306             if(tag != 0L && tag[0] != '\0' && !IsRecursive())
00307                 listCtrl.SetItemText(pos, EntnodeFile::kTag, tag);
00308         }
00309         return pos;
00310     }
00311
00312
00313     virtual kTraversal OnError(const char *err, int errcode)
00314     {
00315         return kTraversalError;
00316     }
00317
00318     virtual kTraversal OnIdle(const char *fullpath)
00319     {
00320         return kContinueTraversal;
00321     }
00322
00323     virtual kTraversal OnDirectory(const char *fullpath,
00324         const char *fullname,
00325         const char *name,
00326         const struct stat & dir, const FSSpec * macspec)
00327     {
00328         if(stricmp(name, "CVS") == 0)
00329             return kSkipFile;
00330
00331         EntnodeData *data = Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00332         if (!IsShowIgnored() && data->IsIgnored())
00333         {
00334             return kSkipFile;
00335         }
00336
00337         if (IsRecursive())
00338         {
00339             if (!data->IsIgnored() && !data->IsUnknown() && !data->IsMissing())
00340             {
00341                 TViewFill traverse(m_context);
00342                 FileTraverse(fullname, traverse);
00343             }
00344             return kSkipFile;
00345         }
00346
00347         // get the tag
00348         CStr subCVS;
00349         CStr tagName;
00350         subCVS = fullname;
00351         if(!subCVS.endsWith(kPathDelimiter))
00352             subCVS << kPathDelimiter;
00353         subCVS << "CVS";
00354         Tag_Open(tagName, subCVS);
00355
00356         InitItem(data, CBrowseFileView::GetImageForEntry(data), tagName);
00357         return kSkipFile;
00358     }
00359
00360     virtual kTraversal OnAlias(const char *fullpath,
00361         const char *fullname,
00362         const char *name,
00363         const struct stat & dir, const FSSpec * macspec)
00364     {
00365         return OnFile(fullpath, fullname, name, dir, macspec);
00366     }
00367
00368     virtual kTraversal OnFile(const char *fullpath,
00369         const char *fullname,
00370         const char *name,
00371         const struct stat & dir, const FSSpec * macspec)
00372     {
00373         EntnodeData *data = Entries_SetVisited(fullpath, m_entries, name, dir, false, &m_ignlist);
00374         if(!IsShowIgnored() && data->IsIgnored())
00375             return kContinueTraversal;
00376
00377         if (m_context->IsMatch(data))
00378         {
00379             int pos = InitItem(data, CBrowseFileView::GetImageForEntry(data));
00380             if (pos >=  0)
00381             {
00382                 UINT state = data->IsLocked() ? INDEXTOSTATEIMAGEMASK(2) : INDEXTOSTATEIMAGEMASK(1);
00383                 CListCtrl& listCtrl = GetListCtrl();
00384                 listCtrl.SetItemState(pos, state, LVIS_STATEIMAGEMASK);
00385             }
00386         }
00387         return kContinueTraversal;
00388     }
00389 };
00390
00392 // CBrowseFileView construction/destruction
00393
00394 CBrowseFileView::CBrowseFileView()
00395 : m_checkChanges(false)
00396 , m_watch(NULL)
00397 , m_isResetViewLocked(false)
00398 , m_isFilesChange(false)
00399 , m_isResetViewPending(false)
00400 , m_uiFilechangeTimer(0)
00401 {
00402     m_sort = (int)gFileViewSort;
00403     SetRecursive(false);
00404     m_ascendant = (bool)gFileViewSortAsc;
00405     m_entriesMod = 0;
00406     m_entriesLogMod = 0;
00407 }
00408
00409 CBrowseFileView::~CBrowseFileView()
00410 {
00411     gFileViewSortAsc = m_ascendant;
00412     gFileViewSort = m_sort;
00413 }
00414
00415 void CBrowseFileView::InvalidateView(void)
00416 {
00417     m_entriesMod = 0;
00418 }
00419
00420 BOOL CBrowseFileView::PreCreateWindow(CREATESTRUCT& cs)
00421 {
00422     cs.style |= WS_TABSTOP | LVS_SHOWSELALWAYS | LVS_REPORT;
00423     cs.dwExStyle |= LVS_EX_FULLROWSELECT;
00424
00425     return CListView::PreCreateWindow(cs);
00426 }
00427
00428 int CBrowseFileView::GetImageForEntry(EntnodeData *data)
00429 {
00430     int result;
00431     if(data->GetType() == ENT_FILE)
00432     {
00433         const char *info = 0L;
00434         if(data->IsIgnored())
00435         {
00436             result = kFileIconIgnored;
00437         }
00438         else if(data->IsUnknown())
00439         {
00440             result = kFileIconUnknown;
00441         }
00442         else if(data->GetConflict() != 0L)
00443         {
00444             result = kFileIconConflict;
00445         }
00446         else if(data->IsRemoved())
00447         {
00448             result = kFileIconRemoved;
00449         }
00450         else if((info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-kb") == 0)
00451         {
00452             const char* vn = (*data)[EntnodeFile::kVN];
00453             bool isAdded = vn && (strcmp(vn, "0") == 0);
00454
00455             result = data->IsUnmodified() ? kFileIconBinary :
00456                 isAdded ? kFileIconBinaryAdded : kFileIconBinaryMod;
00457         }
00458         else if((info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-ku") == 0)
00459         {
00460             const char* vn = (*data)[EntnodeFile::kVN];
00461             bool isAdded = vn && (strcmp(vn, "0") == 0);
00462
00463             result = data->IsUnmodified() ? kFileIconUnicode :
00464                 isAdded ? kFileIconUnicodeAdded : kFileIconUnicodeMod;
00465         }
00466         else
00467         {
00468             const char* vn = (*data)[EntnodeFile::kVN];
00469             bool isAdded = vn && (strcmp(vn, "0") == 0);
00470
00471             result = data->IsUnmodified() ? kFileIconText :
00472                 isAdded ? kFileIconAdded : kFileIconTextMod;
00473         }
00474     }
00475     else
00476     {
00477         if(data->IsIgnored())
00478         {
00479             result = kFolderIconIgnored;
00480         }
00481         else if(data->IsUnknown())
00482         {
00483             result = kFolderIconUnknown;
00484         }
00485         else
00486         {
00487             result = kFolderIcon;
00488         }
00489     }
00490
00491     return result;
00492 }
00493
00494 void CBrowseFileView::SetRecursive(bool isRecursive)
00495 {
00496     m_isRecursive = isRecursive;
00497     m_modelColumns = (m_isRecursive) ? KiColumnModel::GetRecursiveModel() : KiColumnModel::GetRegularModel();
00498 }
00499
00500 static void onFilteringChanged(CObject *obj)
00501 {
00502     ((CBrowseFileView *)obj)->OnFilteringChanged();
00503 }
00504
00505 void CBrowseFileView::OnInitialUpdate()
00506 {
00507     CListView::OnInitialUpdate();
00508
00509     CListCtrl& ListCtrl = GetListCtrl();
00510
00511     // Replace standard header with sort header
00512     if (HWND hWnd = ListView_GetHeader(ListCtrl.m_hWnd))
00513     {
00514         m_ctrlHeader.SubclassWindow(hWnd);
00515     }
00516     ListCtrl.SetExtendedStyle(LVS_EX_HEADERDRAGDROP);
00517
00518 // set image lists
00519     if(m_SmallImageList.m_hImageList == 0L)
00520         m_SmallImageList.Create(IDB_SMALLICONS, 16, 1, RGB(255, 255, 255));
00521     if(m_StateImageList.m_hImageList == 0L)
00522         m_StateImageList.Create(IDR_STATEICONS, 16, 1, RGB(255, 0, 0));
00523
00524     ListCtrl.SetImageList(&m_SmallImageList, LVSIL_SMALL);
00525     ListCtrl.SetImageList(&m_StateImageList, LVSIL_STATE);
00526
00527     KoTraversalContext context(this);
00528     SetRecursive(context.IsRecursive());
00529     AddColumns();
00530     SetFullRowSel(TRUE);
00531
00532     LoadColumns();
00533
00534     // register for notifications on filter change
00535     if (CWincvsApp* app = (CWincvsApp *)AfxGetApp())
00536     {
00537         app->GetFilterModel()->GetNotificationManager()->CheckIn(this, onFilteringChanged);
00538         app->GetRecursionModel()->GetNotificationManager()->CheckIn(this, onFilteringChanged);
00539         app->GetIgnoreModel()->GetNotificationManager()->CheckIn(this, onFilteringChanged);
00540     }
00541
00542     m_uiFilechangeTimer = SetTimer(FILECHANGE_TIMER, 200, 0L);
00543     if( 0L == m_uiFilechangeTimer )
00544     {
00545         cvs_err("Can't start the file change notification timer.\n");
00546     }
00547 }
00548
00549 void CBrowseFileView::AddColumns()
00550 {
00551     KiColumnModel* model = GetColumnModel();
00552     int columnCount = model->GetCount();
00553     CListCtrl& listCtrl = GetListCtrl();
00554     for(int i = 0; i<columnCount; i++)
00555     {
00556         LV_COLUMN lvc;
00557         model->GetAt(i)->GetSetupData(&lvc);
00558         lvc.iSubItem = i;
00559         lvc.mask |= LVCF_SUBITEM;
00560         listCtrl.InsertColumn(i,&lvc);
00561     }
00562 }
00563
00564 void CBrowseFileView::DeleteColumns()
00565 {
00566     KiColumnModel* model = GetColumnModel();
00567     int columnCount = model->GetCount();
00568     CListCtrl& listCtrl = GetListCtrl();
00569     for(int i = 0; i<columnCount; i++)
00570     {
00571         listCtrl.DeleteColumn(0);
00572     }
00573 }
00574
00575 void CBrowseFileView::GetEntriesModTime(time_t & newEntriesMod,
00576                                         time_t & newEntriesLogMod)
00577 {
00578     newEntriesMod = 0;
00579     newEntriesLogMod = 0;
00580     if(chdir(m_path) != 0)
00581         return;
00582     if(chdir("CVS") != 0)
00583         return;
00584
00585     struct stat sb;
00586     if (stat("Entries", &sb) != -1)
00587         newEntriesMod = sb.st_mtime;
00588     if (stat("Entries.log", &sb) != -1)
00589         newEntriesLogMod = sb.st_mtime;
00590     chdir(m_path);
00591 }
00592
00593 class CRecursionLock
00594 {
00595     bool & m_semaphore;
00596 public:
00597     CRecursionLock(bool & semaphore)
00598     : m_semaphore(semaphore)
00599     {
00600         m_semaphore = true;
00601     }
00602
00603     ~CRecursionLock()
00604     {
00605         m_semaphore = false;
00606     }
00607 };
00608
00609 void CBrowseFileView::ResetView(bool notifyBrowser, const char *selectFile)
00610 {
00611     // no outstanding request to reset the view any more
00612     m_isResetViewPending = false;
00613
00614     if (m_isResetViewLocked)
00615     {
00616         // no recursion
00617         return;
00618     }
00619     CRecursionLock recursionLock(m_isResetViewLocked);
00620
00621     // reset dirty indicators
00622     m_isFilesChange = false;
00623     GetEntriesModTime(m_entriesMod, m_entriesLogMod);
00624
00625     CWaitCursor doWait;
00626
00627     bool bPartialOK = true;
00628
00629     CListCtrl& ListCtrl = GetListCtrl();
00630     int i;
00631
00632     // get the selection to later try to restore it
00633     CvsArgs selection(false);
00634     if (!selectFile)
00635     {
00636         int nItem = -1;
00637         UStr buf;
00638         while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
00639         {
00640             EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
00641             selection.add(data->GetFullPathName(buf));
00642         }
00643     }
00644
00645     // delete all items
00646     VERIFY( ListCtrl.DeleteAllItems() );
00647
00648     // make sure columns are ok
00649     KoTraversalContext context(this);
00650     if ((context.IsRecursive() && !m_isRecursive) || (!context.IsRecursive() && m_isRecursive))
00651     {
00652
00653         KiColumnModel* oldModel = GetColumnModel();
00654         int oldCount = oldModel->GetCount();
00655         const KiColumn* oldColumn = (0 <= m_sort && m_sort < oldCount) ? oldModel->GetAt(m_sort) : NULL;
00656         DeleteColumns();
00657         SetRecursive(context.IsRecursive());
00658         AddColumns();
00659         if (oldColumn == NULL)
00660         {
00661             m_sort = 0;
00662         }
00663         else
00664         {
00665             KiColumnModel* newModel = GetColumnModel();
00666             int newCount = newModel->GetCount();
00667             int sort = -1;
00668             for (int pos = 0; pos < newCount && sort == -1; pos++)
00669             {
00670                 if (newModel->GetAt(pos) == oldColumn)
00671                 {
00672                     sort = pos;
00673                 }
00674             }
00675             m_sort = (sort >= 0) ? sort : 0;
00676         }
00677     }
00678
00679     // refetch all items
00680     TViewFill traverse(&context);
00681     kTraversal res = FileTraverse(m_path, traverse);
00682
00683     //JK - find the file for selection
00684     if( selectFile != 0L )
00685     {
00686         int count = ListCtrl.GetItemCount();
00687         for (int i = 0; i < count; i++)
00688         {
00689             EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(i);
00690
00691             //files only
00692             if(data->GetType() == ENT_SUBDIR)
00693                 continue;
00694
00695             UStr buf;
00696             const char* currentFile = data->GetFullPathName(buf);
00697             if( stricmp( selectFile, currentFile) == 0 )
00698             {
00699                 selection.reset(false); //we don't want any other selection
00700                 selection.add(currentFile);
00701                 bPartialOK = FALSE;
00702                 break;
00703             }
00704         }
00705     }
00706
00707     Resort();
00708
00709     // now restore the selection
00710     int argc = selection.Argc();
00711     char * const *argv = selection.Argv();
00712     bool isFirst = true;
00713     bool focusSet = false;
00714     int count = ListCtrl.GetItemCount();
00715     //If there are no selections, then skip the looping
00716     if( argc )
00717     {
00718         for (int nItem = 0; nItem < count; nItem++)
00719         {
00720             EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
00721             UStr buf;
00722             const char* currentFile = data->GetFullPathName(buf);
00723             for(i = 0; i < argc; i++)
00724             {
00725                 const char* fn = argv[i];
00726                 if (stricmp(fn, currentFile) == 0)
00727                 {
00728                     VERIFY( ListCtrl.SetItemState(nItem, LVIS_SELECTED, LVIS_SELECTED) );
00729                     if(isFirst)
00730                     {
00731                         isFirst = false;
00732                         if( !bPartialOK )
00733                         {
00734                             //move to the bottom first, so the selection will be on top
00735                             ListCtrl.EnsureVisible(ListCtrl.GetItemCount()-1 , bPartialOK);
00736                         }
00737                         //make sure the first selected file is visible
00738                         VERIFY( ListCtrl.EnsureVisible(nItem, bPartialOK/*TRUE*/) );
00739                         VERIFY( focusSet = (ListCtrl.SetItemState(nItem, LVIS_FOCUSED, LVIS_FOCUSED)!=0) );
00740                     }
00741                     break;
00742                 }
00743             }
00744         }
00745     }
00746
00747     if( !focusSet && ListCtrl.GetItemCount())
00748     {
00749         //VERIFY( ListCtrl.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED) );
00750         VERIFY( focusSet = (ListCtrl.SetItemState(0, LVIS_FOCUSED, LVIS_FOCUSED)!=0) );
00751     }
00752
00753     if(notifyBrowser)
00754     {
00755         // notify the tree
00756         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00757         if( app )
00758         {
00759             app->GetBrowserView()->ResetView(true);
00760         }
00761     }
00762
00763     // start monitoring file changes
00764     if (!m_watch)
00765     {
00766         m_watch = new KoWatcher(m_hWnd);
00767     }
00768     m_watch->SignalStartWatch(m_path, m_isRecursive);
00769 }
00770
00771 void CBrowseFileView::ResetView(const char *path, bool notifyBrowser, const char *selectFile)
00772 {
00773     m_path = path;
00774     ResetView(false, selectFile);
00775     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00776     app->GetDocument()->SetTitle(m_path);
00777
00778     if(notifyBrowser)
00779     {
00780         // notify the tree
00781         app->GetBrowserView()->StepToLocation(path);
00782     }
00783 }
00784
00786 // CBrowseFileView diagnostics
00787
00788 #ifdef _DEBUG
00789 void CBrowseFileView::AssertValid() const
00790 {
00791     CListView::AssertValid();
00792 }
00793
00794 void CBrowseFileView::Dump(CDumpContext& dc) const
00795 {
00796     CListView::Dump(dc);
00797 }
00798 #endif //_DEBUG
00799
00800 BOOL CBrowseFileView::SetViewType(DWORD dwViewType)
00801 {
00802     return(ModifyStyle(LVS_TYPEMASK,dwViewType & LVS_TYPEMASK));
00803 }
00804
00805 DWORD CBrowseFileView::GetViewType()
00806 {
00807     return(GetStyle() & LVS_TYPEMASK);
00808 }
00809
00810 void CBrowseFileView::OnViewSmallIcons()
00811 {
00812     if (GetViewType() != LVS_SMALLICON)
00813         SetViewType(LVS_SMALLICON);
00814 }
00815
00816 void CBrowseFileView::OnViewList()
00817 {
00818     if (GetViewType() != LVS_LIST)
00819         SetViewType(LVS_LIST);
00820 }
00821
00822 void CBrowseFileView::OnViewFullRowDetails()
00823 {
00824     if (GetViewType() != LVS_REPORT)
00825         SetViewType(LVS_REPORT);
00826 }
00827
00828 void CBrowseFileView::OnUpdateViewSmallIcons(CCmdUI* pCmdUI)
00829 {
00830     pCmdUI->SetCheck(GetViewType() == LVS_SMALLICON);
00831 }
00832
00833 void CBrowseFileView::OnUpdateViewList(CCmdUI* pCmdUI)
00834 {
00835     pCmdUI->SetCheck(GetViewType() == LVS_LIST);
00836 }
00837
00838 void CBrowseFileView::OnUpdateViewFullRowDetails(CCmdUI* pCmdUI)
00839 {
00840     pCmdUI->SetCheck(GetViewType() == LVS_REPORT);
00841 }
00842
00843 void CBrowseFileView::OnLButtonDown(UINT nFlags, CPoint point)
00844 {
00845     CListView::OnLButtonDown(nFlags, point);
00846 }
00847
00848 void CBrowseFileView::EditSel(EntnodeData *data, bool useDefault)
00849 {
00850     UStr buf;
00851     const char* fullpath = data->GetFullPathName(buf);
00852     if(data->GetType() == ENT_SUBDIR)
00853     {
00854         struct stat st;
00855         if (stat(fullpath, &st) != 0 && errno == ENOENT)
00856         {
00857             // Assume we're looking at directory previously in CVS,
00858             // but not currently in the filesystem.
00859             // If we ever run across another case (permissions perhaps)
00860             // then you might want to add code here.
00861             cvs_err("'%s' is not accessible\n", (char*)fullpath);
00862         }
00863         else
00864         {
00865             ResetView(fullpath, true);
00866             gCvsPrefs.SetLastWorkingDir(fullpath);
00867         }
00868     }
00869     else
00870     {
00871         LaunchViewer(fullpath, useDefault);
00872     }
00873 }
00874
00875 void CBrowseFileView::OnLButtonDblClk(UINT nFlags, CPoint point)
00876 {
00877     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00878     if(app->gCvsRunning)
00879         return;
00880
00881     CListCtrl& ListCtrl = GetListCtrl();
00882
00883     UINT pFlags;
00884     int nItem = ListCtrl.HitTest(point, &pFlags);
00885     if(nItem != -1)
00886     {
00887         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
00888         EditSel(data);
00889     }
00890
00891     CListView::OnLButtonDblClk(nFlags, point);
00892 }
00893
00894 bool CBrowseFileView::DisableCommon(bool bCheckSelection /*= true*/)
00895 {
00896     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00897     CListCtrl& ListCtrl = GetListCtrl();
00898     bool bCommon = app->gCvsRunning || gCvsPrefs.empty();
00899     bool bSelection = ListCtrl.GetSelectedCount() == 0 || this != CWnd::GetFocus();
00900
00901     return bCheckSelection ? bCommon || bSelection : bCommon;
00902 }
00903
00904 void CBrowseFileView::OnUpdateViewRelease(CCmdUI* pCmdUI)
00905 {
00906     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00907     CListCtrl& ListCtrl = GetListCtrl();
00908
00909     if(DisableCommon())
00910     {
00911         pCmdUI->Enable(FALSE);
00912         return;
00913     }
00914
00915     int nItem = -1;
00916     BOOL res = TRUE;
00917     int numFiles = 0;
00918     int numFolders = 0;
00919
00920     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
00921     {
00922         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
00923         if(data->IsUnknown() || data->GetType() != ENT_SUBDIR)
00924         {
00925             res = FALSE;
00926             break;
00927         }
00928         numFolders++;
00929
00930         if(numFolders > 1)
00931         {
00932             res = FALSE;
00933             break;
00934         }
00935     }
00936
00937     pCmdUI->Enable(res);
00938 }
00939
00940 void CBrowseFileView::OnUpdateViewAdd(CCmdUI* pCmdUI)
00941 {
00942     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00943     CListCtrl& ListCtrl = GetListCtrl();
00944
00945     if(DisableCommon())
00946     {
00947         pCmdUI->Enable(FALSE);
00948         return;
00949     }
00950
00951     int nItem = -1;
00952     BOOL res = TRUE;
00953     int numFiles = 0;
00954     int numFolders = 0;
00955
00956     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
00957     {
00958         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
00959         if(!(data->IsUnknown() || (data->IsRemoved() && data->IsMissing())))
00960         {
00961             res = FALSE;
00962             break;
00963         }
00964         if(data->GetType() == ENT_FILE)
00965         {
00966             numFiles++;
00967         }
00968         else
00969             numFolders++;
00970
00971         if((numFiles != 0 && numFolders != 0) || numFolders > 1)
00972         {
00973             res = FALSE;
00974             break;
00975         }
00976     }
00977
00978     pCmdUI->Enable(res);
00979 }
00980
00981 void CBrowseFileView::OnUpdateViewAddB(CCmdUI* pCmdUI)
00982 {
00983     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00984     CListCtrl& ListCtrl = GetListCtrl();
00985
00986     if(DisableCommon())
00987     {
00988         pCmdUI->Enable(FALSE);
00989         return;
00990     }
00991
00992     int nItem = -1;
00993     BOOL res = TRUE;
00994
00995     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
00996     {
00997         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
00998         if(data->GetType() != ENT_FILE)
00999         {
01000             res = FALSE;
01001             break;
01002         }
01003         if(!(data->IsUnknown() || (data->IsRemoved() && data->IsMissing())))
01004         {
01005             res = FALSE;
01006             break;
01007         }
01008     }
01009
01010     pCmdUI->Enable(res);
01011 }
01012
01013 void CBrowseFileView::OnUpdateViewUpdate(CCmdUI* pCmdUI)
01014 {
01015     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01016     CListCtrl& ListCtrl = GetListCtrl();
01017
01018     if(DisableCommon())
01019     {
01020         pCmdUI->Enable(FALSE);
01021         return;
01022     }
01023
01024     int nItem = -1;
01025     BOOL res = TRUE;
01026     int numFiles = 0;
01027     int numFolders = 0;
01028
01029     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01030     {
01031         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01032         if(data->IsUnknown())
01033         {
01034             res = FALSE;
01035             break;
01036         }
01037         if(data->GetType() == ENT_FILE)
01038             numFiles++;
01039         else
01040             numFolders++;
01041
01042         if((numFiles != 0 && numFolders != 0) || numFolders > 1)
01043         {
01044             res = FALSE;
01045             break;
01046         }
01047     }
01048
01049     pCmdUI->Enable(res);
01050 }
01051
01052 void CBrowseFileView::OnUpdateViewGraph(CCmdUI* pCmdUI)
01053 {
01054     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01055     CListCtrl& ListCtrl = GetListCtrl();
01056
01057     if(DisableCommon())
01058     {
01059         pCmdUI->Enable(FALSE);
01060         return;
01061     }
01062
01063     int nItem = -1;
01064     BOOL res = TRUE;
01065
01066     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01067     {
01068         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01069         if(data->IsUnknown() || data->GetType() == ENT_SUBDIR)
01070         {
01071             res = FALSE;
01072             break;
01073         }
01074     }
01075
01076     pCmdUI->Enable(res);
01077 }
01078
01079 void CBrowseFileView::OnUpdateViewRmv(CCmdUI* pCmdUI)
01080 {
01081     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01082     CListCtrl& ListCtrl = GetListCtrl();
01083
01084     if(DisableCommon())
01085     {
01086         pCmdUI->Enable(FALSE);
01087         return;
01088     }
01089
01090     int nItem = -1;
01091     BOOL res = TRUE;
01092
01093     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01094     {
01095         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01096         if(data->IsUnknown() || data->IsRemoved() || data->GetType() == ENT_SUBDIR)
01097         {
01098             res = FALSE;
01099             break;
01100         }
01101     }
01102
01103     pCmdUI->Enable(res);
01104 }
01105
01106 void CBrowseFileView::Resort(void)
01107 {
01108     CListCtrl& ListCtrl = GetListCtrl();
01109     KoColumnContext context(GetPath());
01110     KiColumnModel* model = GetColumnModel();
01111     CSortParam sortParam(m_ascendant, true, model->GetAt(m_sort), model->GetAt(0), &context);
01112     m_ctrlHeader.SetSortImage(m_sort, m_ascendant);
01113
01114     ListCtrl.SortItems( _Compare, (LPARAM)&sortParam);
01115 }
01116
01117 void CBrowseFileView::OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult)
01118 {
01119     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
01120     CListCtrl& ListCtrl = GetListCtrl();
01121
01122     if(pNMListView->iSubItem == m_sort)
01123         m_ascendant = !m_ascendant;
01124     else
01125     {
01126         m_ascendant = true;
01127         m_sort = pNMListView->iSubItem;
01128         KiColumnModel* model = GetColumnModel();
01129         m_ascendant = model->GetAt(m_sort)->IsDefaultAscending();
01130     }
01131
01132     Resort();
01133     *pResult = 0;
01134 }
01135
01136 void CBrowseFileView::ProcessSelectionCommand(KiSelectionHandler* handler)
01137 {
01138     CListCtrl& ListCtrl = GetListCtrl();
01139     int nItem = -1;
01140     int pathLen = GetPath().length();
01141
01142     MultiFiles mf;
01143
01144     // first add the folders
01145     mf.newdir(GetPath());
01146
01147     //  process selection
01148     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01149     {
01150         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01151         UStr buf;
01152         const char* fullpath = data->GetFullPathName(buf);
01153         if(data->GetType() == ENT_SUBDIR)
01154         {
01155             handler->OnFolder(fullpath);
01156         }
01157         else
01158         {
01159             const char* fn = data->GetFullPathName(buf) + pathLen;
01160             if (*fn == '\\')
01161             {
01162                 fn++;
01163             }
01164             mf.newfile(fn);
01165         }
01166     }
01167     if(mf.NumFiles() != 0)
01168     {
01169         handler->OnFiles(&mf);
01170     }
01171 }
01172
01173 void CBrowseFileView::OnViewAdd()
01174 {
01175     KoAddHandler handler;
01176     ProcessSelectionCommand(&handler);
01177 }
01178
01179 void CBrowseFileView::OnViewAddb()
01180 {
01181     KoAddBinaryHandler handler;
01182     ProcessSelectionCommand(&handler);
01183 }
01184
01185 void CBrowseFileView::OnViewAddu()
01186 {
01187     KoAddUnicodeHandler handler;
01188     ProcessSelectionCommand(&handler);
01189 }
01190
01191 void CBrowseFileView::OnViewCommit()
01192 {
01193     KoCommitHandler handler;
01194     ProcessSelectionCommand(&handler);
01195 }
01196
01197 void CBrowseFileView::OnViewRmv()
01198 {
01199     KoFileRemoveHandler handler;
01200     ProcessSelectionCommand(&handler);
01201 }
01202
01203 void CBrowseFileView::OnViewUpdate()
01204 {
01205     KoUpdateHandler handler;
01206     ProcessSelectionCommand(&handler);
01207 }
01208
01209 void CBrowseFileView::OnViewQueryUpdate()
01210 {
01211     KoQueryUpdateHandler handler;
01212     ProcessSelectionCommand(&handler);
01213 }
01214
01215 void CBrowseFileView::OnUpdateViewReload(CCmdUI* pCmdUI)
01216 {
01217     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01218     pCmdUI->Enable(!app->gCvsRunning);
01219 }
01220
01221 void CBrowseFileView::OnViewReload()
01222 {
01223     ResetView(true);
01224 }
01225
01226 void CBrowseFileView::OnKeydown(NMHDR* pNMHDR, LRESULT* pResult)
01227 {
01228     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01229     if(app->gCvsRunning)
01230         return;
01231
01232     CListCtrl& ListCtrl = GetListCtrl();
01233     LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pNMHDR;
01234
01235     if(pLVKeyDow->wVKey == VK_BACK)
01236     {
01237         OnViewUpone();
01238     }
01239     else if(pLVKeyDow->wVKey == VK_RETURN && ListCtrl.GetSelectedCount() == 1)
01240     {
01241         int nItem = -1;
01242         if((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01243         {
01244             EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01245             if(data->GetType() == ENT_SUBDIR)
01246             {
01247                 UStr buf;
01248                 const char* fullpath = data->GetFullPathName(buf);
01249                 ResetView(fullpath, true);
01250             }
01251             else
01252             {
01253                 EditSel(data);
01254             }
01255         }
01256     }
01257
01258     *pResult = 0;
01259 }
01260
01261 static CString GetRoot()
01262 {
01263     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01264     return app->GetRoot();
01265 }
01266
01267 static int GetPathLength(LPCTSTR path)
01268 {
01269     int len = _tcslen(path);
01270     return (len > 0 && path[len - 1] == kPathDelimiter) ? (len - 1) : len;
01271 }
01272
01273 static bool IsSamePath(LPCTSTR path1, LPCTSTR path2)
01274 {
01275     int len1 = GetPathLength(path1);
01276     int len2 = GetPathLength(path2);
01277     return len1 == len2 && _tcsicmp(path1, path2) == 0;
01278 }
01279
01280 void CBrowseFileView::OnViewUpone()
01281 {
01282     if(!IsSamePath(m_path, GetRoot()) && chdir(m_path) == 0 && chdir("..") == 0)
01283     {
01284         char newpath[1024];
01285         getcwd(newpath, 1023);
01286         ResetView(newpath, true);
01287     }
01288     else
01289     {
01290         MessageBeep(MB_ICONHAND);
01291     }
01292 }
01293
01294 void CBrowseFileView::OnUpdateViewUpone(CCmdUI* pCmdUI)
01295 {
01296     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01297     pCmdUI->Enable(!app->gCvsRunning && !IsSamePath(m_path, GetRoot()));
01298 }
01299
01300 void CBrowseFileView::OnViewTrash()
01301 {
01302     KoMoveToTrashHandler handler;
01303     ProcessSelectionCommand(&handler);
01304 }
01305
01306 void CBrowseFileView::OnUpdateViewTrash(CCmdUI* pCmdUI)
01307 {
01308     bool enabled = !DisableCommon();
01309     if(enabled)
01310     {
01311         KoUpdateMoveToTrashHandler handler;
01312         ProcessSelectionCommand(&handler);
01313         enabled = handler.IsEnabled();
01314     }
01315     pCmdUI->Enable(enabled);
01316 }
01317
01318 void CBrowseFileView::OnViewDiff()
01319 {
01320     KoDiffHandler handler;
01321     ProcessSelectionCommand(&handler);
01322 }
01323
01324 void CBrowseFileView::OnViewLog()
01325 {
01326     KoLogHandler handler;
01327     ProcessSelectionCommand(&handler);
01328 }
01329
01330 void CBrowseFileView::OnViewGraph()
01331 {
01332     KoGraphHandler handler;
01333     ProcessSelectionCommand(&handler);
01334 }
01335
01336 void CBrowseFileView::OnViewStatus()
01337 {
01338     KoStatusHandler handler;
01339     ProcessSelectionCommand(&handler);
01340 }
01341
01342 void CBrowseFileView::OnViewUnlock()
01343 {
01344     KoUnlockHandler handler;
01345     ProcessSelectionCommand(&handler);
01346 }
01347
01348 void CBrowseFileView::OnViewWatchOn()
01349 {
01350     KoWatchOnHandler handler;
01351     ProcessSelectionCommand(&handler);
01352 }
01353
01354 void CBrowseFileView::OnViewWatchOff()
01355 {
01356     KoWatchOffHandler handler;
01357     ProcessSelectionCommand(&handler);
01358 }
01359
01360 void CBrowseFileView::OnViewEdit()
01361 {
01362     KoEditHandler handler;
01363     ProcessSelectionCommand(&handler);
01364 }
01365
01366 void CBrowseFileView::OnViewReservededit()
01367 {
01368     KoReservedEditHandler handler;
01369     ProcessSelectionCommand(&handler);
01370 }
01371
01372 void CBrowseFileView::OnViewForceedit()
01373 {
01374     KoForceEditHandler handler;
01375     ProcessSelectionCommand(&handler);
01376 }
01377 void CBrowseFileView::OnViewUnedit()
01378 {
01379     KoUneditHandler handler;
01380     ProcessSelectionCommand(&handler);
01381 }
01382
01383 void CBrowseFileView::OnViewRelease()
01384 {
01385     KoReleaseHandler handler;
01386     ProcessSelectionCommand(&handler);
01387 }
01388
01389 void CBrowseFileView::OnViewWatchers()
01390 {
01391     KoWatchersHandler handler;
01392     ProcessSelectionCommand(&handler);
01393 }
01394
01395 void CBrowseFileView::OnViewEditors()
01396 {
01397     KoEditorsHandler handler;
01398     ProcessSelectionCommand(&handler);
01399 }
01400
01401 void CBrowseFileView::OnRButtonDown(UINT nFlags, CPoint point)
01402 {
01403     CListView::OnRButtonDown(nFlags, point);
01404
01405     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01406     CListCtrl& ListCtrl = GetListCtrl();
01407
01408     if(DisableCommon())
01409         return;
01410
01411     UINT pFlags;
01412     int testItem = ListCtrl.HitTest(point, &pFlags);
01413     if(testItem == -1)
01414         return;
01415
01416     if(ListCtrl.GetItemState(testItem, LVIS_SELECTED) == 0)
01417         return;
01418
01419     if(pFlags & (LVHT_ONITEMICON|LVHT_ONITEMLABEL|LVHT_ONITEMSTATEICON) == 0)
01420         return;
01421
01422     CMenu* pMyMenu=::GetCustomMenu(kCustomFilesMenu,this);
01423     if (pMyMenu)
01424     {
01425         ClientToScreen(&point);
01426         pMyMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON, point.x, point.y, this);
01427         delete pMyMenu;
01428     }
01429 }
01430
01431 void CBrowseFileView::OnViewTagNew()
01432 {
01433     KoCreateTagHandler handler;
01434     ProcessSelectionCommand(&handler);
01435 }
01436
01437 void CBrowseFileView::OnViewTagDelete()
01438 {
01439     KoDeleteTagHandler handler;
01440     ProcessSelectionCommand(&handler);
01441 }
01442
01443 void CBrowseFileView::OnViewTagBranch()
01444 {
01445     KoBranchTagHandler handler;
01446     ProcessSelectionCommand(&handler);
01447 }
01448
01449 BOOL CBrowseFileView::OnCustomize(UINT nID)
01450 {
01451     CustomizeMenus(nID == ID_CUST_FILES_MENU ? kCustomFilesMenu : kCustomBrowserMenu);
01452     return TRUE;
01453 }
01454
01455 void CBrowseFileView::OnUpdateCustomize(CCmdUI* pCmdUI)
01456 {
01457     pCmdUI->Enable(TRUE);
01458 }
01459
01460 BOOL CBrowseFileView::OnMacro(UINT nID)
01461 {
01462     PyDoPython(WINCMD_to_UCMD(nID));
01463
01464     return 1;
01465 }
01466
01467 void CBrowseFileView::OnUpdateMacro(CCmdUI* pCmdUI)
01468 {
01469     if(DisableCommon(false))
01470     {
01471         pCmdUI->Enable(FALSE);
01472         return;
01473     }
01474
01475     // fill the cache with current selection
01476     if(!PyIsUICacheValid())
01477     {
01478         CListCtrl& ListCtrl = GetListCtrl();
01479         int nItem = -1;
01480         while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01481         {
01482             EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01483             PyAppendCache(data);
01484         }
01485     }
01486
01487     UCmdUI ucmdui(WINCMD_to_UCMD(pCmdUI->m_nID));
01488     ucmdui.pCmdUI = pCmdUI;
01489     PyDoCmdUI(&ucmdui);
01490 }
01491
01492 void CBrowseFileView::OnViewExplore()
01493 {
01494     const char* fullpath = m_path;
01495
01496     CListCtrl& ListCtrl = GetListCtrl();
01497     int nItem = -1;
01498
01499     // first add the folders
01500     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01501     {
01502         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01503         if(data->GetType() == ENT_SUBDIR)
01504         {
01505             UStr buf;
01506             fullpath = data->GetFullPathName(buf);
01507             break;
01508         }
01509     }
01510
01511     HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), "explore", fullpath,
01512             0L, 0L, SW_SHOWDEFAULT);
01513     if((long)hInst < 32)
01514     {
01515         cvs_err("Unable to explore '%s' (error %d)\n", (char *)m_path, GetLastError());
01516     }
01517 }
01518
01519 void CBrowseFileView::OnUpdateViewExplore(CCmdUI* pCmdUI)
01520 {
01521     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01522     CListCtrl& ListCtrl = GetListCtrl();
01523     if(DisableCommon())
01524     {
01525         pCmdUI->Enable(FALSE);
01526         return;
01527     }
01528
01529     int nItem = -1;
01530     int numItem = 0;
01531     BOOL res = TRUE;
01532
01533     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01534     {
01535         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01536         if(data->IsMissing() || ++numItem > 1)
01537         {
01538             res = FALSE;
01539             break;
01540         }
01541     }
01542
01543     pCmdUI->Enable(res);
01544 }
01545
01546 void CBrowseFileView::OnTimer(UINT nIDEvent)
01547 {
01548     if (nIDEvent == m_uiFilechangeTimer)
01549     {
01550         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01551         if(!app->gCvsRunning)
01552         {
01553             // cvs command finished
01554             if( m_checkChanges )
01555             {
01556                 // Refresh the directory tree and file view
01557                 m_checkChanges = false;
01558                 ResetView(true);
01559
01560                 return;
01561             }
01562
01563             // file change
01564             if (m_isFilesChange )
01565             {
01566                 ResetView();
01567             }
01568
01569             // check if we need to reload
01570             time_t newEntriesMod;
01571             time_t newEntriesLogMod;
01572             GetEntriesModTime(newEntriesMod, newEntriesLogMod);
01573             if (m_entriesMod != newEntriesMod || m_entriesLogMod != newEntriesLogMod)
01574             {
01575                 ResetView();
01576             }
01577         }
01578         return;
01579     }
01580     CListView::OnTimer(nIDEvent);
01581 }
01582
01583 LRESULT CBrowseFileView::OnFileChange(WPARAM, LPARAM)
01584 {
01585     m_isFilesChange = true;
01586     return 0;
01587 }
01588
01589 void CBrowseFileView::SetFullRowSel(BOOL bFullRowSel)
01590 {
01591     CListCtrl& ListCtrl = GetListCtrl();
01592     DWORD dwExStyle = ListView_GetExtendedListViewStyle(ListCtrl.m_hWnd);
01593     if (bFullRowSel)
01594         (dwExStyle |= LVS_EX_FULLROWSELECT);
01595     else
01596         (dwExStyle &= ~LVS_EX_FULLROWSELECT);
01597     ListView_SetExtendedListViewStyle(ListCtrl.m_hWnd, dwExStyle);
01598 }
01599
01600 void CBrowseFileView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
01601 {
01602     CListView::OnBeginPrinting(pDC, pInfo);
01603
01604     int nPageHeight = pDC->GetDeviceCaps(VERTRES);
01605     TEXTMETRIC tm;
01606     pDC->GetTextMetrics(&tm);
01607
01608     // compute the bounds
01609     CListCtrl& ListCtrl = GetListCtrl();
01610     m_numberOfLines = ListCtrl.GetItemCount();
01611     m_heightOfLines = 2 * tm.tmHeight;
01612     m_numberByPages = nPageHeight / m_heightOfLines;
01613     m_numberOfPages = m_numberOfLines / m_numberByPages + 1;
01614
01615     pInfo->SetMaxPage(m_numberOfPages);
01616 }
01617
01618 BOOL CBrowseFileView::OnPreparePrinting(CPrintInfo* pInfo)
01619 {
01620     BOOL res = DoPreparePrinting(pInfo);
01621     if(!res)
01622         return res;
01623
01624     return TRUE;
01625 }
01626
01627 void CBrowseFileView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
01628 {
01629     if (!pDC->IsPrinting())
01630         return;
01631
01632     // now compute the first item to draw
01633     CListCtrl& ListCtrl = GetListCtrl();
01634     int nFirstItem = -1;
01635     int numToIgnore = m_numberByPages * (pInfo->m_nCurPage - 1);
01636     while(numToIgnore-- && (nFirstItem = ListCtrl.GetNextItem(nFirstItem, LVNI_ALL)) != -1)
01637     {
01638     }
01639
01640     TEXTMETRIC tm;
01641     pDC->GetTextMetrics(&tm);
01642
01643     int nItem = nFirstItem, n = 0;
01644     int horz = pInfo->m_rectDraw.Width();
01645     int vert = pInfo->m_rectDraw.Height();
01646     // measure for each column
01647     KiColumnModel* model = GetColumnModel();
01648     int columnCount = model->GetCount();
01649     std::vector<int> widths(columnCount, 0);
01650     int totalwidth = 0;
01651     int j;
01652     KoColumnContext context(GetPath());
01653     while(n++ < m_numberByPages && (nItem = ListCtrl.GetNextItem(nItem, LVNI_ALL)) != -1)
01654     {
01655         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01656         for(j = 0; j < columnCount; j++)
01657         {
01658             TCHAR buffer[256];
01659             model->GetAt(j)->GetText(&context, data, buffer, 256);
01660             int width = pDC->GetTextExtent(buffer, _tcslen(buffer)).cx + kSpc;
01661             widths[j] = max(widths[j], width);
01662         }
01663     }
01664
01665     for(j = 0; j < columnCount; j++)
01666     {
01667         totalwidth += widths[j];
01668     }
01669
01670     for(j = 0; j < columnCount; j++)
01671     {
01672         widths[j] += (horz - totalwidth) / columnCount;
01673     }
01674
01675     // compute the margins
01676     for(j = columnCount - 1; j >= 0; j--)
01677     {
01678         int margin = 0;
01679         for(int i = j - 1; i >= 0; i--)
01680         {
01681             margin += widths[i];
01682         }
01683         widths[j] = margin;
01684     }
01685     // now print
01686     nItem = nFirstItem;
01687     n = 0;
01688     CPoint off = pInfo->m_rectDraw.TopLeft();
01689     while(n++ < m_numberByPages && (nItem = ListCtrl.GetNextItem(nItem, LVNI_ALL)) != -1)
01690     {
01691         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01692         for(j = 0; j < columnCount; j++)
01693         {
01694             const char *info = (*data)[j];
01695             if(info == 0L)
01696                 continue;
01697
01698             CPoint where = off;
01699             where.x += widths[j];
01700             CString s(info);
01701             CRect r(0,0,0,0);
01702             pDC->DrawText(s, -1, &r, DT_CALCRECT);
01703             r.OffsetRect(where);
01704             pDC->DrawText(s, -1, &r, DT_CENTER);
01705         }
01706         off += CPoint(0, m_heightOfLines);
01707     }
01708     //CListView::OnPrint(pDC, pInfo);
01709 }
01710
01711 void CBrowseFileView::OnViewEditsel()
01712 {
01713     CListCtrl& ListCtrl = GetListCtrl();
01714     int nItem = -1;
01715
01716     // first add the folders
01717     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01718     {
01719         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01720         EditSel(data);
01721     }
01722 }
01723
01724 void CBrowseFileView::OnViewEditseldef()
01725 {
01726     CListCtrl& ListCtrl = GetListCtrl();
01727     int nItem = -1;
01728
01729     // first add the folders
01730     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01731     {
01732         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01733         EditSel(data, true);
01734     }
01735 }
01736
01737 void CBrowseFileView::OnUpdateViewEditseldef(CCmdUI* pCmdUI)
01738 {
01739     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01740     CListCtrl& ListCtrl = GetListCtrl();
01741     if(DisableCommon())
01742     {
01743         pCmdUI->Enable(FALSE);
01744         return;
01745     }
01746
01747     int nItem = -1;
01748     BOOL res = TRUE;
01749
01750     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01751     {
01752         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01753         if(data->GetType() == ENT_SUBDIR || data->IsMissing())
01754         {
01755             res = FALSE;
01756             break;
01757         }
01758     }
01759
01760     CString str;
01761     if( FormatMenuString(pCmdUI->m_nID, str) && pCmdUI->m_pParentMenu )
01762     {
01763         pCmdUI->SetText(str);
01764     }
01765
01766     pCmdUI->Enable(res);
01767 }
01768
01769 void CBrowseFileView::OnViewCheckout()
01770 {
01771     CvsCmdCheckoutModule();
01772 }
01773
01774 void CBrowseFileView::OnUpdateViewCheckout(CCmdUI* pCmdUI)
01775 {
01776     if(DisableCommon(false))
01777     {
01778         pCmdUI->Enable(FALSE);
01779         return;
01780     }
01781     pCmdUI->Enable(TRUE);
01782     pCmdUI->SetText("Chec&kout module...");
01783 }
01784
01785 void CBrowseFileView::OnViewImport()
01786 {
01787     CvsCmdImportModule();
01788 }
01789
01790 void CBrowseFileView::OnUpdateViewImport(CCmdUI* pCmdUI)
01791 {
01792     if(DisableCommon())
01793     {
01794         pCmdUI->Enable(FALSE);
01795         return;
01796     }
01797     pCmdUI->Enable(TRUE);
01798     pCmdUI->SetText("&Import module...");
01799 }
01800
01801 // Drag and drop.
01802 // Implemented by Nikita Jorniak <nikita@tanner.com>
01803 // Comment: This works to drag files from WinCVS and drop them to any external viewer/editor,
01804 // which supports Windows Shell standard CF_HDROP Clipboard style.
01805 // Directories are intentionally left out.
01806 // Tested: MS DevStudio, Windows Explorer.
01807 // Tested on Windows NT 4.0 (Service Pack 6)
01808 void CBrowseFileView::DoDrag()
01809 {
01810     CListCtrl& ListCtrl = GetListCtrl();
01811     int nItem=-1;
01812     int nSize = 0;
01813     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01814     {
01815         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01816         if(data->GetType()!=ENT_SUBDIR)
01817         {
01818             UStr buf;
01819             const char* fullpath = data->GetFullPathName(buf);
01820             nSize += strlen(fullpath) + 1;
01821         }
01822     }
01823     if(nSize>0)
01824     {
01825         HGLOBAL hMem = GlobalAlloc(GMEM_FIXED, sizeof(DROPFILES)+nSize+1);
01826         if(hMem!=NULL)
01827         {
01828             DROPFILES& df = *reinterpret_cast<DROPFILES*>(hMem);
01829             df.pFiles = sizeof(DROPFILES);
01830             df.fNC = FALSE;
01831             df.pt.x = df.pt.y = 0;
01832             df.fWide = FALSE;
01833
01834             nItem=-1;
01835             int Offset = sizeof(DROPFILES);
01836             while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01837             {
01838                 EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01839                 if(data->GetType()!=ENT_SUBDIR)
01840                 {
01841                     UStr buf;
01842                     const char* fullpath = data->GetFullPathName(buf);
01843                     int len = strlen(fullpath) + 1;
01844                     memcpy(reinterpret_cast<BYTE*>(hMem)+Offset, fullpath, len);
01845                     Offset+=len;
01846                 }
01847             }
01848             reinterpret_cast<BYTE*>(hMem)[Offset]=0;
01849
01850             COleDataSource ds;
01851             ds.CacheGlobalData( CF_HDROP, hMem );
01852             ds.DoDragDrop( DROPEFFECT_COPY );
01853         }
01854     }
01855 }
01856
01857 void CBrowseFileView::OnBegindrag(NMHDR* pNMHDR, LRESULT* pResult)
01858 {
01859     DoDrag();
01860     *pResult = 0;
01861 }
01862
01863 void CBrowseFileView::OnBeginrdrag(NMHDR* pNMHDR, LRESULT* pResult)
01864 {
01865     DoDrag();
01866     *pResult = 0;
01867 }
01868
01869 void CBrowseFileView::OnDestroy()
01870 {
01871     SaveColumns();
01872     if(m_watch)
01873     {
01874         m_watch->SignalTerminate();
01875         m_watch = NULL;
01876     }
01877
01878     // unregister notifications
01879     if (CWincvsApp* app = (CWincvsApp *)AfxGetApp())
01880     {
01881         app->GetFilterModel()->GetNotificationManager()->CheckOut(this);
01882         app->GetRecursionModel()->GetNotificationManager()->CheckOut(this);
01883         app->GetIgnoreModel()->GetNotificationManager()->CheckOut(this);
01884     }
01885
01886     //kill the timer
01887     if( m_uiFilechangeTimer )
01888     {
01889         KillTimer(m_uiFilechangeTimer);
01890     }
01891
01892     CListView::OnDestroy();
01893 }
01894
01895 void CBrowseFileView::SaveColumns()
01896 {
01897     AfxGetApp()->WriteProfileString("FileDetailView", NULL, NULL);
01898
01899     char buffer[2048];
01900     char* cp = buffer;
01901     int count = m_ctrlHeader.GetItemCount();
01902     for (int i = 0; i < count; ++i)
01903     {
01904         int width = GetListCtrl().GetColumnWidth(i);
01905         cp += sprintf(cp, "%d ", width);
01906     }
01907     AfxGetApp()->WriteProfileString("FileDetailView", "Column Widths", buffer);
01908
01909     int order[128];
01910     if (m_ctrlHeader.GetOrderArray(order, count))
01911     {
01912         cp = buffer;
01913         for (int i = 0; i < count; ++i)
01914         {
01915             cp += sprintf(cp, "%d ", order[i]);
01916         }
01917         AfxGetApp()->WriteProfileString("FileDetailView", "Column Order", buffer);
01918     }
01919 }
01920
01921 bool CBrowseFileView::LoadColumns()
01922 {
01923     CString widths = AfxGetApp()->GetProfileString("FileDetailView", "Column Widths");
01924     CString orders  = AfxGetApp()->GetProfileString("FileDetailView", "Column Order");
01925     if (widths.IsEmpty() || orders.IsEmpty())
01926     {
01927         return false;
01928     }
01929
01930     int count = m_ctrlHeader.GetItemCount();
01931     int order[128];
01932     for (int i = 0; i < count; ++i)
01933     {
01934         CString strSubString;
01935         AfxExtractSubString( strSubString, widths, i, _T(' '));
01936         int width =  _ttoi( strSubString );
01937         GetListCtrl().SetColumnWidth(i, width);
01938
01939         AfxExtractSubString( strSubString, orders, i, _T(' '));
01940         order[i] =  _ttoi( strSubString );
01941     }
01942     m_ctrlHeader.SetOrderArray(count, order);
01943
01944     return true;
01945 }
01946
01947 BOOL CBrowseFileView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
01948 {
01949     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01950     if(app->gCvsRunning)
01951     {
01952         SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
01953         return TRUE;
01954     }
01955
01956     return CListView::OnSetCursor(pWnd, nHitTest, message);
01957 }
01958
01959
01960 void CBrowseFileView::OnFilteringChanged()
01961 {
01962     if (!m_isResetViewPending)
01963     {
01964         m_isResetViewPending = true;
01965         PostMessage(WM_RESETVIEW);
01966     }
01967 }
01968
01969 void CBrowseFileView::OnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult)
01970 {
01971     NM_LISTVIEW* p = (NM_LISTVIEW*)pNMHDR;
01972     if (p->lParam)
01973     {
01974         EntnodeData* data = (EntnodeData*)(LPVOID)p->lParam;
01975         data->UnRef();
01976     }
01977     *pResult = 0;
01978 }
01979
01980 LRESULT CBrowseFileView::OnResetView(WPARAM, LPARAM)
01981 {
01982     ResetView(false, NULL);
01983     return 0;
01984 }
01985
01986 void CBrowseFileView::OnUpdateQueryAnnotate(CCmdUI* pCmdUI)
01987 {
01988     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01989     CListCtrl& ListCtrl = GetListCtrl();
01990
01991     if(DisableCommon())
01992     {
01993         pCmdUI->Enable(FALSE);
01994         return;
01995     }
01996
01997     int nItem = -1;
01998     BOOL res = TRUE;
01999
02000     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
02001     {
02002         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
02003         if(data->IsUnknown() || data->GetType() == ENT_SUBDIR)
02004         {
02005             res = FALSE;
02006             break;
02007         }
02008     }
02009
02010     pCmdUI->Enable(res);
02011 }
02012
02013 void CBrowseFileView::OnQueryAnnotate()
02014 {
02015     KoAnnotateHandler handler;
02016     ProcessSelectionCommand(&handler);
02017 }
02018
02019 void CBrowseFileView::OnEditSelectAll()
02020 {
02021     CListCtrl& ListCtrl = GetListCtrl();
02022
02023     for( int nIndex = 0; nIndex < ListCtrl.GetItemCount(); nIndex++ )
02024     {
02025         EntnodeData *data = (EntnodeData*)ListCtrl.GetItemData(nIndex);
02026         if( data->GetType() == ENT_FILE )
02027         {
02028             ListCtrl.SetItemState(nIndex, LVIS_SELECTED, LVIS_SELECTED);
02029         }
02030     }
02031
02032     if( ListCtrl.GetSelectedCount() )
02033     {
02034         ListCtrl.SetFocus();
02035     }
02036 }
Generated on Sun Feb 24 01:21:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/BrowseFileView.h Source File

WinCvs/BrowseFileView.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 1998
00019  */
00020
00021 /*
00022  * BrowseFileView.h -- Implements the view with all the files
00023  *
00024  * FILTER-VIEW-DEV branch, last merged up to 1.22
00025  */
00026
00027 #if !defined(AFX_BROWSEFILEVIEW_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
00028 #define AFX_BROWSEFILEVIEW_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_
00029
00030 #if _MSC_VER >= 1000
00031 #pragma once
00032 #endif // _MSC_VER >= 1000
00033
00034 #include "CvsEntries.h"
00035 #include "CPStr.h"
00036 #include "SortHeaderCtrl.h"
00037
00038 class MultiFiles;
00039 class KoWatcher; // implementation helper
00040 class KiSelectionHandler;
00041 class KiColumnModel;
00042
00043 enum
00044 {
00045     kFileIconText = 0,
00046     kFileIconBinary,
00047     kFileIconUnknown,
00048     kFileIconAdded,
00049     kFileIconConflict,
00050     kFileIconMiss,
00051     kFolderIcon,
00052     kFolderIconUnknown,
00053     kFolderIconMiss,
00054     kFileIconTextMod,
00055     kFileIconBinaryMod,
00056     kFileIconIgnored,
00057     kFolderIconIgnored,
00058     kFileIconRemoved,
00059     kFileIconBinaryAdded,
00060     kFileIconUnicode,
00061     kFileIconUnicodeMod,
00062     kFileIconUnicodeAdded
00063 };
00064
00065 class CBrowseFileView : public CListView
00066 {
00067 protected: // create from serialization only
00068     CBrowseFileView();
00069     DECLARE_DYNCREATE(CBrowseFileView)
00070
00071     bool DisableCommon(bool bCheckSelection = true);
00072         // for CCmdUI
00073
00074 // Operations
00075 public:
00076
00077     void OnFilteringChanged();
00078         // called to notify the view that app's filtering has changed
00079
00080     void ResetView(const char *path, bool notifyBrowser = false, const char *selectFile = 0L);
00081         // reset to this path and notify optionally the directories tree
00082         // optionally place the selection on specified file
00083
00084     void ResetView(bool notifyBrowser = false, const char *selectFile = 0L);
00085         // - reload and try to guess if something changed
00086         // according to the mod. time of CVS
00087         // - notify optionally the directories tree
00088         // - this should *not* be called from another thread. Use
00089         // the next one if you call from a thread.
00090         // optionally place the selection on specified file
00091
00092     inline void CheckChanges(void) { m_checkChanges = true; }
00093         // this will call ResetView(forceReload = false)
00094         // the next time the timer is called. To be used for foreign
00095         // threads in order to reload the view after cvs ends.
00096
00097     void Resort(void);
00098         // resort according to the current key
00099
00100     void InvalidateView(void);
00101         // will cause to rebuild the view after cvs returned
00102
00103     static int GetImageForEntry(EntnodeData *data);
00104         // return the ID of the image which symbolizes the
00105         // state of the file/directory
00106
00107     inline CFrameWnd *GetMainFrame() { return GetRoutingFrame(); }
00108         // used for changing the routing of CmdMsg
00109
00110     void ProcessSelectionCommand(KiSelectionHandler* handler);
00111         // processes a handler for selection command
00112
00113     void SaveColumns();
00114         // saves column state
00115
00116     bool LoadColumns();
00117         // loads column state
00118
00119     // retrieves columnar model of the data
00120     KiColumnModel* GetColumnModel() const
00121     {
00122         return m_modelColumns;
00123     }
00124
00125     void AddColumns();
00126         // adds columns to view
00127
00128     void DeleteColumns();
00129         // deletes all columns
00130
00131 // Overrides
00132     // ClassWizard generated virtual function overrides
00133     //{{AFX_VIRTUAL(CBrowseFileView)
00134     public:
00135     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00136     protected:
00137     virtual void OnInitialUpdate(); // called first time after construct
00138     virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
00139     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
00140     virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
00141     //}}AFX_VIRTUAL
00142
00143 // Implementation
00144 public:
00145     virtual ~CBrowseFileView();
00146 #ifdef _DEBUG
00147     virtual void AssertValid() const;
00148     virtual void Dump(CDumpContext& dc) const;
00149 #endif
00150
00151 protected:
00152     void GetEntriesModTime(time_t & newEntriesMod, time_t & newEntriesLogMod);
00153     void EditSel(EntnodeData *data, bool useDefault = false);
00154     void DoDrag();
00155     void SetRecursive(bool isRecursive);
00156
00157     CSortHeaderCtrl m_ctrlHeader;
00158         // Sort header control
00159
00160     CStr m_path;
00161         // current path
00162     time_t m_entriesMod;
00163     time_t m_entriesLogMod;
00164         // time stamp of CVS/*
00165     int m_sort;
00166         // sort key
00167     bool m_ascendant;
00168         // sort flag
00169
00170     KiColumnModel* m_modelColumns;
00171     // columnar model in use
00172
00173     bool m_checkChanges;
00174         // used by the timer and CheckChanges
00175     int m_numberOfLines;
00176     int m_numberByPages;
00177     int m_numberOfPages;
00178     int m_heightOfLines;
00179         // for printing
00180
00181     bool m_isRecursive;
00182         // true if displaying recursively
00183
00184     KoWatcher* m_watch;
00185     // a thread to monitor file change notifications
00186
00187     bool m_isResetViewLocked;
00188     // flag to lock out recursion into ResetView()
00189
00190     bool m_isFilesChange;
00191     // tells if file change notification is pending
00192
00193     UINT m_uiFilechangeTimer;
00194     //stores the timer event for file's change notification, default to FILECHANGE_TIMER
00195
00196     bool m_isResetViewPending;
00197     // tells if there is an outstanding request to refresh the view contents
00198
00199 // Generated message map functions
00200 protected:
00201     //{{AFX_MSG(CBrowseFileView)
00202     afx_msg void OnViewSmallIcons();
00203     afx_msg void OnViewList();
00204     afx_msg void OnViewFullRowDetails();
00205     afx_msg void OnUpdateViewSmallIcons(CCmdUI* pCmdUI);
00206     afx_msg void OnUpdateViewAdd(CCmdUI* pCmdUI);
00207     afx_msg void OnUpdateViewAddB(CCmdUI* pCmdUI);
00208     afx_msg void OnUpdateViewUpdate(CCmdUI* pCmdUI);
00209     afx_msg void OnUpdateViewRelease(CCmdUI* pCmdUI);
00210     afx_msg void OnUpdateViewRmv(CCmdUI* pCmdUI);
00211     afx_msg void OnUpdateViewGraph(CCmdUI* pCmdUI);
00212     afx_msg void OnUpdateViewList(CCmdUI* pCmdUI);
00213     afx_msg void OnUpdateViewEditseldef(CCmdUI* pCmdUI);
00214     afx_msg void OnUpdateViewFullRowDetails(CCmdUI* pCmdUI);
00215     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00216     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00217     afx_msg void OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult);
00218     afx_msg void OnViewAdd();
00219     afx_msg void OnViewAddb();
00220     afx_msg void OnViewCommit();
00221     afx_msg void OnViewRmv();
00222     afx_msg void OnViewUpdate();
00223     afx_msg void OnViewQueryUpdate();
00224     afx_msg void OnUpdateViewReload(CCmdUI* pCmdUI);
00225     afx_msg void OnViewReload();
00226     afx_msg void OnKeydown(NMHDR* pNMHDR, LRESULT* pResult);
00227     afx_msg void OnViewUpone();
00228     afx_msg void OnUpdateViewUpone(CCmdUI* pCmdUI);
00229     afx_msg void OnViewTrash();
00230     afx_msg void OnUpdateViewTrash(CCmdUI* pCmdUI);
00231     afx_msg void OnViewDiff();
00232     afx_msg void OnViewLog();
00233     afx_msg void OnViewGraph();
00234     afx_msg void OnViewStatus();
00235     afx_msg void OnViewUnlock();
00236     afx_msg void OnViewWatchOn();
00237     afx_msg void OnViewWatchOff();
00238     afx_msg void OnViewEdit();
00239     afx_msg void OnViewUnedit();
00240     afx_msg void OnViewWatchers();
00241     afx_msg void OnViewEditors();
00242     afx_msg void OnViewRelease();
00243     afx_msg void OnViewTagNew();
00244     afx_msg void OnViewTagDelete();
00245     afx_msg void OnViewTagBranch();
00246     afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00247     afx_msg void OnViewExplore();
00248     afx_msg void OnUpdateViewExplore(CCmdUI* pCmdUI);
00249     afx_msg void OnTimer(UINT nIDEvent);
00250     afx_msg void OnViewEditsel();
00251     afx_msg void OnViewEditseldef();
00252     afx_msg void OnViewCheckout();
00253     afx_msg void OnUpdateViewCheckout(CCmdUI* pCmdUI);
00254     afx_msg void OnViewImport();
00255     afx_msg void OnUpdateViewImport(CCmdUI* pCmdUI);
00256     afx_msg void OnBegindrag(NMHDR* pNMHDR, LRESULT* pResult);
00257     afx_msg void OnBeginrdrag(NMHDR* pNMHDR, LRESULT* pResult);
00258     afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
00259     afx_msg void OnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult);
00260     afx_msg void OnDestroy();
00261     afx_msg void OnUpdateQueryAnnotate(CCmdUI* pCmdUI);
00262     afx_msg void OnQueryAnnotate();
00263     afx_msg void OnEditSelectAll();
00264     afx_msg void OnViewReservededit();
00265     afx_msg void OnViewForceedit();
00266     afx_msg void OnViewAddu();
00267     //}}AFX_MSG
00268     afx_msg void OnUpdateMacro(CCmdUI* pCmdUI);
00269     afx_msg BOOL OnMacro(UINT nID);
00270     afx_msg void OnUpdateCustomize(CCmdUI* pCmdUI);
00271     afx_msg BOOL OnCustomize(UINT nID);
00272     afx_msg LRESULT OnFileChange(WPARAM, LPARAM);
00273     afx_msg LRESULT OnResetView(WPARAM, LPARAM);
00274
00275     DECLARE_MESSAGE_MAP()
00276
00277 // list view image lists
00278 protected:
00279     void SetFullRowSel(BOOL bFullRowSel);
00280     static CImageList m_SmallImageList;
00281     static CImageList m_StateImageList;
00282
00283 // view type helpers
00284 public:
00285     BOOL SetViewType(DWORD dwViewType);
00286     DWORD GetViewType();
00287 // member access
00288     const CStr& GetPath() const { return m_path; };
00289 };
00290
00291 #endif // !defined(AFX_BROWSEFILEVIEW_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/BrowserBar.cpp Source File

WinCvs/BrowserBar.cpp

Go to the documentation of this file.
00001 // BrowserBar.cpp : implementation file
00002 //
00003
00004 #include "stdafx.h"
00005 #include "wincvs.h"
00006 #include "BrowserBar.h"
00007
00008 #ifdef _DEBUG
00009 #define new DEBUG_NEW
00010 #undef THIS_FILE
00011 static char THIS_FILE[] = __FILE__;
00012 #endif
00013
00015 // CBrowserBar
00016
00017 IMPLEMENT_DYNCREATE(CBrowserBar, CView)
00018
00019 CBrowserBar::CBrowserBar() : m_browser(0L)
00020 {
00021 }
00022
00023 CBrowserBar::~CBrowserBar()
00024 {
00025 }
00026
00027
00028 BEGIN_MESSAGE_MAP(CBrowserBar, CView)
00029     //{{AFX_MSG_MAP(CBrowserBar)
00030     ON_WM_WINDOWPOSCHANGED()
00031     ON_WM_DESTROY()
00032     ON_WM_PAINT()
00033     //}}AFX_MSG_MAP
00034 END_MESSAGE_MAP()
00035
00037 // CBrowserBar drawing
00038
00040 // CBrowserBar diagnostics
00041
00042 #ifdef _DEBUG
00043 void CBrowserBar::AssertValid() const
00044 {
00045     CView::AssertValid();
00046 }
00047
00048 void CBrowserBar::Dump(CDumpContext& dc) const
00049 {
00050     CView::Dump(dc);
00051 }
00052 #endif //_DEBUG
00053
00055 // CBrowserBar message handlers
00056
00057 void CBrowserBar::OnDraw(CDC* pDC)
00058 {
00059     CDocument* pDoc = GetDocument();
00060 }
00061
00062 BOOL CBrowserBar::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
00063 {
00064     BOOL res = CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
00065     if(!res)
00066         return FALSE;
00067
00068     m_browser = (CWinCvsBrowser *)RUNTIME_CLASS(CWinCvsBrowser)->CreateObject();
00069     VERIFY(m_browser->Create(0L, "", WS_CHILD | WS_VISIBLE | WS_TABSTOP, CRect(0,0,0,0), this, 0));
00070
00071     return TRUE;
00072 }
00073
00074 void CBrowserBar::OnWindowPosChanged(WINDOWPOS FAR* wp)
00075 {
00076     CView::OnWindowPosChanged(wp);
00077
00078     //m_browser->SetWindowPos(NULL, wp->x, wp->y, wp->cx, wp->cy, SWP_NOZORDER);
00079     CRect r;
00080     GetClientRect(&r);
00081     if(m_browser != 0L)
00082         m_browser->SetWindowPos(NULL, r.left, r.top, r.Width(), r.Height(), SWP_NOZORDER);
00083 }
00084
00085 void CBrowserBar::OnDestroy()
00086 {
00087     if(m_browser)
00088         m_browser->DestroyWindow();
00089
00090     CView::OnDestroy();
00091 }
00092
00093 void CBrowserBar::OnPaint()
00094 {
00095     CPaintDC dc(this); // device context for painting
00096
00097     CRect r;
00098     GetClientRect(&r);
00099     CBrush brush(GetSysColor(COLOR_WINDOW));
00100     dc.FillRect(r, &brush);
00101 }
Generated on Sun Feb 24 01:21:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/BrowserBar.h Source File

WinCvs/BrowserBar.h

Go to the documentation of this file.
00001 #if !defined(AFX_BROWSERBAR_H__64721953_F9A8_11D2_BDEC_000000000000__INCLUDED_)
00002 #define AFX_BROWSERBAR_H__64721953_F9A8_11D2_BDEC_000000000000__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007 // BrowserBar.h : header file
00008 //
00009
00010 #include "WinCvsBrowser.h"
00011
00013 // CBrowserBar view
00014
00015 class CBrowserBar : public CView
00016 {
00017 public:
00018     virtual ~CBrowserBar();
00019
00020 protected:
00021     CBrowserBar();           // protected constructor used by dynamic creation
00022     DECLARE_DYNCREATE(CBrowserBar)
00023
00024 // Attributes
00025 public:
00026
00027 // Operations
00028 public:
00029     inline CWinCvsBrowser *GetBrowserView() { return m_browser; }
00030
00031 // Overrides
00032     // ClassWizard generated virtual function overrides
00033     //{{AFX_VIRTUAL(CBrowserBar)
00034     public:
00035     virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
00036     protected:
00037     virtual void OnDraw(CDC* pDC);      // overridden to draw this view
00038     //}}AFX_VIRTUAL
00039
00040 // Implementation
00041 protected:
00042 #ifdef _DEBUG
00043     virtual void AssertValid() const;
00044     virtual void Dump(CDumpContext& dc) const;
00045 #endif
00046
00047     CWinCvsBrowser *m_browser;
00048
00049     // Generated message map functions
00050 protected:
00051     //{{AFX_MSG(CBrowserBar)
00052     afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
00053     afx_msg void OnDestroy();
00054     afx_msg void OnPaint();
00055     //}}AFX_MSG
00056     DECLARE_MESSAGE_MAP()
00057 };
00058
00060
00061 //{{AFX_INSERT_LOCATION}}
00062 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00063
00064 #endif // !defined(AFX_BROWSERBAR_H__64721953_F9A8_11D2_BDEC_000000000000__INCLUDED_)
Generated on Sun Feb 24 01:21:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/ColorStatic.cpp Source File

WinCvs/ColorStatic.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- September 2001
00019  */
00020
00021 /*
00022  * ColorStatic.cpp --- color sample static control
00023  */
00024
00025 #include "stdafx.h"
00026 #include "wincvs.h"
00027 #include "ColorStatic.h"
00028
00029 #ifdef _DEBUG
00030 #define new DEBUG_NEW
00031 #undef THIS_FILE
00032 static char THIS_FILE[] = __FILE__;
00033 #endif
00034
00036 // CColorStatic
00037
00038 CColorStatic::CColorStatic()
00039 {
00040     m_color = RGB(255, 255, 255);
00041 }
00042
00043 CColorStatic::~CColorStatic()
00044 {
00045 }
00046
00047
00048 BEGIN_MESSAGE_MAP(CColorStatic, CStatic)
00049     //{{AFX_MSG_MAP(CColorStatic)
00050     ON_WM_PAINT()
00051     //}}AFX_MSG_MAP
00052 END_MESSAGE_MAP()
00053
00055 // CColorStatic message handlers
00056
00057 void CColorStatic::SetColor(COLORREF color)
00058 {
00059     m_color = color;
00060     if( IsWindow(m_hWnd) )
00061     {
00062         RedrawWindow();
00063     }
00064 }
00065
00066 COLORREF CColorStatic::GetColor()
00067 {
00068     return m_color;
00069 }
00070
00071 void CColorStatic::OnPaint()
00072 {
00073     CPaintDC dc(this); // device context for painting
00074
00075     CRect rect;
00076     GetClientRect(rect);
00077     dc.FillSolidRect(rect, m_color);
00078
00079     // Do not call CStatic::OnPaint() for painting messages
00080 }
Generated on Sun Feb 24 01:21:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/ColorStatic.h Source File

WinCvs/ColorStatic.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- September 2001
00019  */
00020
00021 /*
00022  * ColorStatic.h --- color sample static control
00023  */
00024
00025 #if !defined(AFX_COLORSTATIC_H__4D2B055E_F042_428F_A662_09ABEA902DCE__INCLUDED_)
00026 #define AFX_COLORSTATIC_H__4D2B055E_F042_428F_A662_09ABEA902DCE__INCLUDED_
00027
00028 #if _MSC_VER > 1000
00029 #pragma once
00030 #endif // _MSC_VER > 1000
00031 // ColorStatic.h : header file
00032 //
00033
00035 // CColorStatic window
00036
00037 class CColorStatic : public CStatic
00038 {
00039 // Construction
00040 public:
00041     CColorStatic();
00042
00043 // Attributes
00044 public:
00045
00046 // Operations
00047 public:
00048
00049 // Overrides
00050     // ClassWizard generated virtual function overrides
00051     //{{AFX_VIRTUAL(CColorStatic)
00052     //}}AFX_VIRTUAL
00053
00054 // Implementation
00055 public:
00056     COLORREF GetColor();
00057     void SetColor(COLORREF color);
00058     virtual ~CColorStatic();
00059
00060     // Generated message map functions
00061 protected:
00062     //{{AFX_MSG(CColorStatic)
00063     afx_msg void OnPaint();
00064     //}}AFX_MSG
00065
00066     DECLARE_MESSAGE_MAP()
00067 private:
00068     COLORREF m_color;
00069 };
00070
00072
00073 //{{AFX_INSERT_LOCATION}}
00074 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00075
00076 #endif // !defined(AFX_COLORSTATIC_H__4D2B055E_F042_428F_A662_09ABEA902DCE__INCLUDED_)
Generated on Sun Feb 24 01:21:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/ConsoleBar.cpp Source File

WinCvs/ConsoleBar.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 1999
00019  */
00020
00021 /*
00022  * ConsoleBar.cpp -- Bar which owns the console
00023  */
00024
00025 #include "stdafx.h"
00026 #include "ConsoleBar.h"
00027 #include "wincvsView.h"
00028 #include "resource.h"
00029
00030 #ifdef _DEBUG
00031 #define new DEBUG_NEW
00032 #undef THIS_FILE
00033 static char THIS_FILE[] = __FILE__;
00034 #endif
00035
00037 // CBarConsole
00038
00039 CBarConsole::CBarConsole() : m_view(0L)
00040 {
00041     // TODO: add construction code here.
00042 }
00043
00044 CBarConsole::~CBarConsole()
00045 {
00046     // TODO: add destruction code here.
00047 }
00048
00049 BEGIN_MESSAGE_MAP(CBarConsole, CCJControlBar)
00050     //{{AFX_MSG_MAP(CBarConsole)
00051     ON_WM_CREATE()
00052     //}}AFX_MSG_MAP
00053 END_MESSAGE_MAP()
00054
00056 // CBarConsole message handlers
00057
00058 int CBarConsole::OnCreate(LPCREATESTRUCT lpCreateStruct)
00059 {
00060     if (CCJControlBar::OnCreate(lpCreateStruct) == -1)
00061         return -1;
00062
00063     m_view = (CWincvsView *)RUNTIME_CLASS(CWincvsView)->CreateObject();
00064     if(m_view == 0L)
00065     {
00066         TRACE0("Failed to create view for CBarConsole\n");
00067         return -1;
00068     }
00069
00070     // TODO: Add your specialized creation code here
00071     if (!m_view->Create(NULL, "",WS_CHILD | WS_VISIBLE | WS_BORDER,
00072         CRect(0,0,0,0), this, 0/*IDC_LIST_CTRL_2*/))
00073     {
00074         TRACE0("Failed to create view for CMyBarLeft\n");
00075         return -1;
00076     }
00077
00078     SetChild(m_view);
00079
00080     return 0;
00081 }
Generated on Sun Feb 24 01:21:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/ConsoleBar.h Source File

WinCvs/ConsoleBar.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 1999
00019  */
00020
00021 /*
00022  * ConsoleBar.cpp -- Bar which owns the console
00023  */
00024
00025 #ifndef CONSOLE_BAR_H
00026 #define CONSOLE_BAR_H
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif // _MSC_VER >= 1000
00031
00033 // CBarConsole class
00034
00035 class CWincvsView;
00036
00037 class CBarConsole : public CCJControlBar
00038 {
00039 // Construction
00040 public:
00041     CBarConsole();
00042
00043 // Attributes
00044 public:
00045     CWincvsView *m_view;
00046
00047 // Operations
00048 public:
00049
00050 // Overrides
00051     // ClassWizard generated virtual function overrides
00052     //{{AFX_VIRTUAL(CBarConsole)
00053     //}}AFX_VIRTUAL
00054
00055 // Implementation
00056 public:
00057     virtual ~CBarConsole();
00058
00059 // Generated message map functions
00060 protected:
00061     //{{AFX_MSG(CBarConsole)
00062     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00063     //}}AFX_MSG
00064     DECLARE_MESSAGE_MAP()
00065 };
00066
00068
00069 //{{AFX_INSERT_LOCATION}}
00070 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00071
00072 #endif // !defined(CONSOLE_BAR_H)
00073
Generated on Sun Feb 24 01:21:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CustomizeMenus.cpp Source File

WinCvs/CustomizeMenus.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 2000
00019  */
00020
00021 // CustomizeMenus.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025 #include "wincvs.h"
00026 #include "CustomizeMenus.h"
00027 #include "MacrosSetup.h"
00028
00029 #ifdef _DEBUG
00030 #define new DEBUG_NEW
00031 #undef THIS_FILE
00032 static char THIS_FILE[] = __FILE__;
00033 #endif
00034
00035 #define INVTAB(msg, e) {msg, #e, e}
00036 static CustInvertTable sInitInvTable[] =
00037 {
00038     INVTAB("Separator", ID_SEPARATOR),
00039     INVTAB("Pr&eferences...\tCtrl+F1", ID_APP_PREFERENCES),
00040     INVTAB("&Command Line...", ID_APP_CMDLINE),
00041     INVTAB("&Login...", ID_APP_LOGIN),
00042     INVTAB("Lo&gout", ID_APP_LOGOUT),
00043     INVTAB("&Stop cvs", ID_STOPCVS),
00044     INVTAB("&Create a new repository...", ID_VIEW_INIT),
00045     INVTAB("&Import module from selection...", ID_VIEW_IMPORT),
00046     INVTAB("Chec&kout module to selection...", ID_VIEW_CHECKOUT),
00047     INVTAB("Create a &tag by module...", ID_APP_RTAGCREATE),
00048     INVTAB("&Delete a tag by module...", ID_APP_RTAGDELETE),
00049     INVTAB("Create a &branch by module...", ID_APP_RTAGBRANCH),
00050     INVTAB("&Update selection...\tCtrl+U", ID_VIEW_UPDATE),
00051     INVTAB("Co&mmit selection...\tCtrl+M", ID_VIEW_COMMIT),
00052     INVTAB("&Add selection", ID_VIEW_ADD),
00053     INVTAB("Add selection &binary", ID_VIEW_ADDB),
00054     INVTAB("Add selection &unicode", ID_VIEW_ADDU),
00055     INVTAB("&Remove selection", ID_VIEW_RMV),
00056     INVTAB("Erase &selection\tCtrl+Backspace", ID_VIEW_TRASH),
00057     INVTAB("Create a &tag on selection...", ID_VIEW_TAGNEW),
00058     INVTAB("&Delete a tag on selection...", ID_VIEW_TAGDELETE),
00059     INVTAB("Create a &branch on selection...", ID_VIEW_TAGBRANCH),
00060     INVTAB("E&xplore selection\tF2", ID_VIEW_EXPLORE),
00061     INVTAB("&Query Update\tF4", ID_VIEW_QUERYUPDATE),
00062     INVTAB("R&eload view\tF5", ID_VIEW_RELOAD),
00063     INVTAB("View &selection\tF7", ID_VIEW_EDITSEL),
00064     INVTAB("View &default", ID_VIEW_EDITSELDEF),
00065     INVTAB("&Diff selection\tAlt+=", ID_VIEW_DIFF),
00066     INVTAB("&Log selection...", ID_VIEW_LOG),
00067     INVTAB("&Status selection", ID_VIEW_STATUS),
00068     INVTAB("&Graph selection...\tCtrl+G", ID_VIEW_GRAPH),
00069     INVTAB("&Annotate selection...", ID_QUERY_ANNOTATE),
00070     INVTAB("&Unlock selection", ID_VIEW_UNLOCKF),
00071     INVTAB("&Edit selection", ID_VIEW_EDIT),
00072     INVTAB("Reserve&d edit selection", ID_VIEW_RESERVEDEDIT),
00073     INVTAB("&Force edit selection", ID_VIEW_FORCEEDIT),
00074     INVTAB("&Unedit selection", ID_VIEW_UNEDIT),
00075     INVTAB("&Add a Watch on selection", ID_VIEW_WATCHON),
00076     INVTAB("&Remove a watch from selection", ID_VIEW_WATCHOFF),
00077     INVTAB("Release &selection", ID_VIEW_RELEASE),
00078     INVTAB("&Watchers of selection", ID_VIEW_WATCHERS),
00079     INVTAB("E&ditors of selection", ID_VIEW_EDITORS),
00080     {0L, 0L, 0}
00081 };
00082
00083 class CCustInvertTable : public std::vector<CustInvertTable>
00084 {
00085 public:
00086     CCustInvertTable();
00087     virtual ~CCustInvertTable();
00088
00089     // get the macro inside the persistent cmd table
00090     void Initialize();
00091
00092 protected:
00093     std::vector<char *> m_garbage;
00094 } sInvTable;
00095
00096 CCustInvertTable::CCustInvertTable()
00097 {
00098     // init the cmd table with the static MFC commands
00099     const CustInvertTable *tmp = sInitInvTable;
00100     CustInvertTable newEntry;
00101     while(tmp->key != 0L)
00102     {
00103         newEntry = *tmp;
00104         push_back(newEntry);
00105         tmp++;
00106     }
00107 }
00108
00109 CCustInvertTable::~CCustInvertTable()
00110 {
00111     std::vector<char *>::iterator i;
00112     for(i = m_garbage.begin(); i != m_garbage.end(); ++i)
00113     {
00114         free(*i);
00115     }
00116 }
00117
00118 void CCustInvertTable::Initialize()
00119 {
00120     if(m_garbage.size() != 0)
00121         return;
00122
00123 #if 0 // fix me, Python
00124     vector<CMacroEntry>::const_iterator i;
00125     int cnt;
00126     CustInvertTable newEntry;
00127     for(cnt = 0, i = gMacrosAdmin.entries.begin(); i != gMacrosAdmin.entries.end(); ++i, cnt++)
00128     {
00129         newEntry.cmd = ID_MACRO_ADMIN + cnt;
00130         char *name = strdup((*i).name);
00131         m_garbage.push_back(name);
00132         newEntry.key = name;
00133         newEntry.title = name;
00134         push_back(newEntry);
00135     }
00136     for(cnt = 0, i = gMacrosSel.entries.begin(); i != gMacrosSel.entries.end(); ++i, cnt++)
00137     {
00138         newEntry.cmd = ID_MACRO_SEL + cnt;
00139         char *name = strdup((*i).name);
00140         m_garbage.push_back(name);
00141         newEntry.key = name;
00142         newEntry.title = name;
00143         push_back(newEntry);
00144     }
00145 #endif
00146 }
00147
00148 const CustInvertTable *CustGetByKey(const char *entry)
00149 {
00150     std::vector<CustInvertTable>::const_iterator tmp;
00151     sInvTable.Initialize();
00152     for(tmp = sInvTable.begin(); tmp != sInvTable.end(); ++tmp)
00153     {
00154         if(strcmp(entry, (*tmp).key) == 0)
00155             return &*tmp;
00156     }
00157     return 0L;
00158 }
00159
00160 static char *GetInvString(const CustInvertTable *entry)
00161 {
00162     static CString res;
00163     res = entry->title;
00164     int ind;
00165     if((ind = res.Find('&')) != -1)
00166         res.Delete(ind);
00167     if((ind = res.Find('\t')) != -1)
00168         res = res.Left(ind);
00169     return (char *)(const char *)res;
00170 }
00171
00172 static bool IsInInvertList(const CustInvertTable *entry, const std::vector<UStr> & list)
00173 {
00174     std::vector<UStr>::const_iterator i;
00175     for(i = list.begin(); i != list.end(); ++i)
00176     {
00177         const CustInvertTable *tab = CustGetByKey(*i);
00178         if(tab == 0L)
00179             continue;
00180
00181         if(strcmp(entry->key, tab->key) == 0)
00182             return true;
00183     }
00184     return false;
00185 }
00186
00188 // CCustomizeMenus dialog
00189
00190
00191 CCustomizeMenus::CCustomizeMenus(CMMenuString *fromMenu, CWnd* pParent /*=NULL*/)
00192     : CDialog(CCustomizeMenus::IDD, pParent), m_Menu(fromMenu)
00193 {
00194     //{{AFX_DATA_INIT(CCustomizeMenus)
00195     //}}AFX_DATA_INIT
00196 }
00197
00198
00199 void CCustomizeMenus::DoDataExchange(CDataExchange* pDX)
00200 {
00201     CDialog::DoDataExchange(pDX);
00202     //{{AFX_DATA_MAP(CCustomizeMenus)
00203     DDX_Control(pDX, IDC_MENULIST, m_menuList);
00204     DDX_Control(pDX, IDC_ALLCMDS, m_cmdsList);
00205     DDX_Control(pDX, IDC_UP, m_upbtn);
00206     DDX_Control(pDX, IDC_REMOVE, m_removebtn);
00207     DDX_Control(pDX, IDC_DOWN, m_downbtn);
00208     DDX_Control(pDX, IDC_ADD, m_addbtn);
00209     //}}AFX_DATA_MAP
00210
00211     if(!pDX->m_bSaveAndValidate)
00212     {
00213         // initialize the buttons
00214         m_upbtn.EnableWindow(FALSE);
00215         m_downbtn.EnableWindow(FALSE);
00216         m_addbtn.EnableWindow(FALSE);
00217         m_removebtn.EnableWindow(FALSE);
00218         m_cmdsList.SetExtendedStyle(
00219             m_cmdsList.GetExtendedStyle() |
00220             LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT);
00221         m_menuList.SetExtendedStyle(
00222             m_menuList.GetExtendedStyle() |
00223             LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
00224     }
00225 }
00226
00227
00228 BEGIN_MESSAGE_MAP(CCustomizeMenus, CDialog)
00229     //{{AFX_MSG_MAP(CCustomizeMenus)
00230     ON_BN_CLICKED(IDC_REMOVE, OnRemove)
00231     ON_BN_CLICKED(IDC_ADD, OnAdd)
00232     ON_NOTIFY(LVN_ITEMCHANGED, IDC_ALLCMDS, OnItemchangedAllcmds)
00233     ON_NOTIFY(NM_DBLCLK, IDC_MENULIST, OnDblclkMenulist)
00234     ON_NOTIFY(NM_DBLCLK, IDC_ALLCMDS, OnDblclkAllcmds)
00235     ON_NOTIFY(LVN_ITEMCHANGED, IDC_MENULIST, OnItemchangedMenulist)
00236     ON_BN_CLICKED(IDC_DOWN, OnDown)
00237     ON_BN_CLICKED(IDC_UP, OnUp)
00238     ON_NOTIFY(LVN_BEGINDRAG, IDC_MENULIST, OnBegindragMenulist)
00239     //}}AFX_MSG_MAP
00240 END_MESSAGE_MAP()
00241
00243 // CCustomizeMenus message handlers
00244
00245 void CCustomizeMenus::OnRemove()
00246 {
00247     int nItem = m_menuList.GetNextItem(-1, LVNI_SELECTED);
00248     if(nItem == -1)
00249         return;
00250
00251     const CustInvertTable *data = (const CustInvertTable *)
00252         m_menuList.GetItemData(nItem);
00253
00254     if(data->cmd != ID_SEPARATOR)
00255     {
00256         LV_ITEM lvi;
00257         lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
00258         lvi.iItem = m_cmdsList.GetItemCount();
00259         lvi.iSubItem = 0;
00260         lvi.lParam = (DWORD)data;
00261         lvi.pszText = GetInvString(data);
00262         lvi.iImage = GetIcon(data);
00263
00264         int newItem = m_cmdsList.InsertItem(&lvi);
00265         VERIFY(m_cmdsList.EnsureVisible(newItem, TRUE));
00266         VERIFY(m_cmdsList.SetItemState(newItem, LVIS_SELECTED, LVIS_SELECTED));
00267     }
00268
00269     VERIFY(m_menuList.DeleteItem(nItem));
00270 }
00271
00272 void CCustomizeMenus::OnAdd()
00273 {
00274     int nItem = m_cmdsList.GetNextItem(-1, LVNI_SELECTED);
00275     if(nItem == -1)
00276         return;
00277
00278     const CustInvertTable *data = (const CustInvertTable *)
00279         m_cmdsList.GetItemData(nItem);
00280
00281     LV_ITEM lvi;
00282     lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
00283     lvi.iItem = m_menuList.GetItemCount();
00284     lvi.iSubItem = 0;
00285     lvi.lParam = (DWORD)data;
00286     lvi.pszText = GetInvString(data);
00287     lvi.iImage = GetIcon(data);
00288
00289     int newItem = m_menuList.InsertItem(&lvi);
00290     VERIFY(m_menuList.EnsureVisible(newItem, TRUE));
00291     VERIFY(m_menuList.SetItemState(newItem, LVIS_SELECTED, LVIS_SELECTED));
00292
00293     if(data->cmd != ID_SEPARATOR)
00294     {
00295         VERIFY(m_cmdsList.DeleteItem(nItem));
00296     }
00297 }
00298
00299 static int CALLBACK _Compare(LPARAM data1, LPARAM data2, LPARAM data)
00300 {
00301     CustInvertTable *d1 = (CustInvertTable *)data1;
00302     CustInvertTable *d2 = (CustInvertTable *)data2;
00303
00304     CString s1(GetInvString(d1));
00305     CString s2(GetInvString(d2));
00306     int cmp = strcmp(s1, s2);
00307     if(cmp == 0)
00308         return 0;
00309     if(d1->cmd == ID_SEPARATOR)
00310         return -1;
00311     if(d2->cmd == ID_SEPARATOR)
00312         return 1;
00313     return cmp;
00314 }
00315
00316 void CCustomizeMenus::OnOK()
00317 {
00318     std::vector<UStr> & list = m_Menu->GetList();
00319     list.erase(list.begin(), list.end());
00320
00321     int nItem = -1;
00322     while((nItem = m_menuList.GetNextItem(nItem, LVNI_ALL)) != -1)
00323     {
00324         const CustInvertTable *data = (const CustInvertTable *)
00325             m_menuList.GetItemData(nItem);
00326
00327         list.push_back(data->key);
00328     }
00329
00330     CDialog::OnOK();
00331 }
00332
00333 BOOL CCustomizeMenus::OnInitDialog()
00334 {
00335     m_SmallImageList.Create(IDR_CUSTMENUS, 16, 1, RGB(255, 255, 255));
00336     sInvTable.Initialize();
00337
00338     CDialog::OnInitDialog();
00339
00340     LV_COLUMN lvc;
00341     int cnt;
00342     const std::vector<UStr> & list = m_Menu->GetList();
00343
00344     // Get the client rect of the list view control
00345     CRect rect;
00346     m_cmdsList.GetClientRect(&rect);
00347
00348     // Make the width of the column to the width of the client area minus
00349     // the width of a scroll bar
00350     int nWidth = rect.right - ::GetSystemMetrics(SM_CXVSCROLL);
00351
00352     // first the left list
00353     lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM;
00354     lvc.iSubItem = 0;
00355     lvc.cx = nWidth;
00356     lvc.fmt = LVCFMT_LEFT;
00357     m_cmdsList.InsertColumn(0, &lvc);
00358     m_cmdsList.SetImageList(&m_SmallImageList, LVSIL_SMALL);
00359
00360     std::vector<CustInvertTable>::const_iterator table;
00361     for(cnt = 0, table = sInvTable.begin(); table != sInvTable.end(); ++table, cnt++)
00362     {
00363         const CustInvertTable & tablEntry = *table;
00364         if(table->cmd != ID_SEPARATOR && IsInInvertList(&tablEntry, list))
00365             continue;
00366
00367         LV_ITEM lvi;
00368         lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
00369         lvi.iItem = cnt;
00370         lvi.iSubItem = 0;
00371         lvi.lParam = (DWORD)&tablEntry;
00372         lvi.pszText = GetInvString(&tablEntry);
00373         lvi.iImage = GetIcon(table);
00374
00375         m_cmdsList.InsertItem(&lvi);
00376     }
00377
00378     m_cmdsList.SortItems(_Compare, 0L);
00379
00380     // then the right one
00381     lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM;
00382     lvc.iSubItem = 0;
00383     lvc.cx = nWidth;
00384     lvc.fmt = LVCFMT_LEFT;
00385     m_menuList.InsertColumn(0, &lvc);
00386     m_menuList.SetImageList(&m_SmallImageList, LVSIL_SMALL);
00387
00388     std::vector<UStr>::const_iterator i;
00389
00390     for(cnt = 0, i = list.begin(); i != list.end(); ++i, cnt++)
00391     {
00392         const CustInvertTable *tab = CustGetByKey(*i);
00393         if(tab == 0L)
00394             continue;
00395
00396         LV_ITEM lvi;
00397         lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
00398         lvi.iItem = cnt;
00399         lvi.iSubItem = 0;
00400         lvi.lParam = (DWORD)tab;
00401         lvi.pszText = GetInvString(tab);
00402         lvi.iImage = GetIcon(tab);
00403
00404         m_menuList.InsertItem(&lvi);
00405     }
00406
00407     return TRUE;  // return TRUE unless you set the focus to a control
00408                   // EXCEPTION: OCX Property Pages should return FALSE
00409 }
00410
00411 void CCustomizeMenus::OnItemchangedAllcmds(NMHDR* pNMHDR, LRESULT* pResult)
00412 {
00413     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
00414     // TODO: Add your control notification handler code here
00415
00416     *pResult = 0;
00417     int nItem = m_cmdsList.GetNextItem(-1, LVNI_SELECTED);
00418     m_addbtn.EnableWindow(nItem != -1);
00419 }
00420
00421 void CCustomizeMenus::OnDblclkMenulist(NMHDR* pNMHDR, LRESULT* pResult)
00422 {
00423     OnRemove();
00424
00425     *pResult = 0;
00426 }
00427
00428 void CCustomizeMenus::OnDblclkAllcmds(NMHDR* pNMHDR, LRESULT* pResult)
00429 {
00430     OnAdd();
00431
00432     *pResult = 0;
00433 }
00434
00435 void CCustomizeMenus::OnItemchangedMenulist(NMHDR* pNMHDR, LRESULT* pResult)
00436 {
00437     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
00438     // TODO: Add your control notification handler code here
00439
00440     *pResult = 0;
00441     int nItem = m_menuList.GetNextItem(-1, LVNI_SELECTED);
00442     m_removebtn.EnableWindow(nItem != -1);
00443
00444     if(nItem == -1)
00445     {
00446         m_upbtn.EnableWindow(FALSE);
00447         m_downbtn.EnableWindow(FALSE);
00448     }
00449     else if(nItem == 0)
00450     {
00451         m_upbtn.EnableWindow(FALSE);
00452         m_downbtn.EnableWindow(m_menuList.GetItemCount() > 1 ? TRUE : FALSE);
00453     }
00454     else if(nItem == m_menuList.GetItemCount() - 1)
00455     {
00456         m_upbtn.EnableWindow(TRUE);
00457         m_downbtn.EnableWindow(FALSE);
00458     }
00459     else
00460     {
00461         m_upbtn.EnableWindow(TRUE);
00462         m_downbtn.EnableWindow(TRUE);
00463     }
00464 }
00465
00466 void CCustomizeMenus::OnMove(int offset)
00467 {
00468     int nItem = m_menuList.GetNextItem(-1, LVNI_SELECTED);
00469     if(nItem == -1)
00470         return;
00471
00472     const CustInvertTable *data = (const CustInvertTable *)
00473         m_menuList.GetItemData(nItem);
00474
00475     int newPos = nItem + offset;
00476     if(newPos < 0 || newPos > m_menuList.GetItemCount())
00477         return;
00478
00479     VERIFY(m_menuList.DeleteItem(nItem));
00480
00481     LV_ITEM lvi;
00482     lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
00483     lvi.iItem = newPos;
00484     lvi.iSubItem = 0;
00485     lvi.lParam = (DWORD)data;
00486     lvi.pszText = GetInvString(data);
00487     lvi.iImage = GetIcon(data);
00488
00489     int newItem = m_menuList.InsertItem(&lvi);
00490     VERIFY(m_menuList.EnsureVisible(newItem, TRUE));
00491     VERIFY(m_menuList.SetItemState(newItem, LVIS_SELECTED, LVIS_SELECTED));
00492 }
00493
00494 void CCustomizeMenus::OnDown()
00495 {
00496     OnMove(1);
00497 }
00498
00499 void CCustomizeMenus::OnUp()
00500 {
00501     OnMove(-1);
00502 }
00503
00504 void CCustomizeMenus::OnBegindragMenulist(NMHDR* pNMHDR, LRESULT* pResult)
00505 {
00506     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
00507     // TODO: Add your control notification handler code here
00508
00509     *pResult = 0;
00510 }
00511
00512 int CCustomizeMenus::GetIcon(const CustInvertTable *entry)
00513 {
00514     if(entry->cmd == ID_SEPARATOR)
00515         return 0;
00516
00517     if(entry->cmd >= ID_MACRO_SEL && entry->cmd < (ID_MACRO_SEL + 100))
00518         return 2;
00519
00520     if(entry->cmd >= ID_MACRO_ADMIN && entry->cmd < (ID_MACRO_ADMIN + 100))
00521         return 2;
00522
00523     return 1;
00524 }
Generated on Sun Feb 24 01:21:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CustomizeMenus.h Source File

WinCvs/CustomizeMenus.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 2000
00019  */
00020
00021 #if !defined(AFX_CUSTOMIZEMENUS_H__28A6AE7E_C54B_47A5_A8F5_A127E2E9F3BF__INCLUDED_)
00022 #define AFX_CUSTOMIZEMENUS_H__28A6AE7E_C54B_47A5_A8F5_A127E2E9F3BF__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 // CustomizeMenus.h : header file
00028 //
00029
00030 #include "Persistent.h"
00031 #include "CPStr.h"
00032
00033 typedef struct
00034 {
00035     const char *title;
00036     const char *key;
00037     int cmd;
00038 } CustInvertTable;
00039
00040 const CustInvertTable *CustGetByKey(const char *entry);
00041
00042 class CMMenuString : public CPersistent
00043 {
00044 public:
00045     CMMenuString(unsigned int maxstr, const char *uniqueName, char * const *defaultStr = 0L);
00046         // defaultStr is a null terminated set of strings
00047
00048     virtual ~CMMenuString();
00049
00050     virtual unsigned int SizeOf(void) const;
00051     virtual const void *GetData(void) const;
00052     virtual void SetData(const void *ptr, unsigned int size);
00053         // persistent interface
00054
00055     void Insert(const char *newstr);
00056         // add a new string
00057
00058     inline const std::vector<UStr> & GetList(void) const { return fAllStrs; }
00059     inline std::vector<UStr> & GetList(void) { TouchTimeStamp(); return fAllStrs; }
00060
00061 protected:
00062     std::vector<UStr> fAllStrs;
00063     CStaticAllocT<char> fBuf;
00064     unsigned int fMaxStr;
00065 };
00066
00068 // CCustomizeMenus dialog
00069
00070 class CCustomizeMenus : public CDialog
00071 {
00072 // Construction
00073 public:
00074     CCustomizeMenus(CMMenuString *fromMenu, CWnd* pParent = NULL);   // standard constructor
00075
00076 // Dialog Data
00077     //{{AFX_DATA(CCustomizeMenus)
00078     enum { IDD = IDD_CUSTOMIZE };
00079     CListCtrl   m_menuList;
00080     CListCtrl   m_cmdsList;
00081     CButton m_upbtn;
00082     CButton m_removebtn;
00083     CButton m_downbtn;
00084     CButton m_addbtn;
00085     //}}AFX_DATA
00086
00087
00088 // Overrides
00089     // ClassWizard generated virtual function overrides
00090     //{{AFX_VIRTUAL(CCustomizeMenus)
00091     protected:
00092     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00093     //}}AFX_VIRTUAL
00094
00095 // Implementation
00096 protected:
00097     CMMenuString *m_Menu;
00098     CImageList m_SmallImageList;
00099
00100     void OnMove(int offset);
00101     virtual void OnOK();
00102
00103     int GetIcon(const CustInvertTable *entry);
00104
00105     // Generated message map functions
00106     //{{AFX_MSG(CCustomizeMenus)
00107     afx_msg void OnRemove();
00108     afx_msg void OnAdd();
00109     virtual BOOL OnInitDialog();
00110     afx_msg void OnItemchangedAllcmds(NMHDR* pNMHDR, LRESULT* pResult);
00111     afx_msg void OnDblclkMenulist(NMHDR* pNMHDR, LRESULT* pResult);
00112     afx_msg void OnDblclkAllcmds(NMHDR* pNMHDR, LRESULT* pResult);
00113     afx_msg void OnItemchangedMenulist(NMHDR* pNMHDR, LRESULT* pResult);
00114     afx_msg void OnDown();
00115     afx_msg void OnUp();
00116     afx_msg void OnBegindragMenulist(NMHDR* pNMHDR, LRESULT* pResult);
00117     //}}AFX_MSG
00118     DECLARE_MESSAGE_MAP()
00119 };
00120
00121 //{{AFX_INSERT_LOCATION}}
00122 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00123
00124 #endif // !defined(AFX_CUSTOMIZEMENUS_H__28A6AE7E_C54B_47A5_A8F5_A127E2E9F3BF__INCLUDED_)
Generated on Sun Feb 24 01:21:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CVS_Coworker.h Source File

WinCvs/CVS_Coworker.h

Go to the documentation of this file.
00001
00002 #pragma warning( disable: 4049 )  /* more than 64k source lines */
00003
00004 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
00005
00006
00007  /* File created by MIDL compiler version 6.00.0347 */
00008 /* at Sat Feb 23 22:55:05 2002
00009  */
00010 /* Compiler settings for D:\cvsgui\WinCvs\CoWorker\CVS_Coworker.idl:
00011     Os, W1, Zp8, env=Win32 (32b run)
00012     protocol : dce , ms_ext, c_ext
00013     error checks: allocation ref bounds_check enum stub_data
00014     VC __declspec() decoration level:
00015          __declspec(uuid()), __declspec(selectany), __declspec(novtable)
00016          DECLSPEC_UUID(), MIDL_INTERFACE()
00017 */
00018 //@@MIDL_FILE_HEADING(  )
00019
00020
00021 /* verify that the <rpcndr.h> version is high enough to compile this file*/
00022 #ifndef __REQUIRED_RPCNDR_H_VERSION__
00023 #define __REQUIRED_RPCNDR_H_VERSION__ 440
00024 #endif
00025
00026 #include "rpc.h"
00027 #include "rpcndr.h"
00028
00029 #ifndef __RPCNDR_H_VERSION__
00030 #error this stub requires an updated version of <rpcndr.h>
00031 #endif // __RPCNDR_H_VERSION__
00032
00033 #ifndef COM_NO_WINDOWS_H
00034 #include "windows.h"
00035 #include "ole2.h"
00036 #endif /*COM_NO_WINDOWS_H*/
00037
00038 #ifndef __CVS_Coworker_h__
00039 #define __CVS_Coworker_h__
00040
00041 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
00042 #pragma once
00043 #endif
00044
00045 /* Forward Declarations */
00046
00047 #ifndef __ICvsCoworker_FWD_DEFINED__
00048 #define __ICvsCoworker_FWD_DEFINED__
00049 typedef interface ICvsCoworker ICvsCoworker;
00050 #endif  /* __ICvsCoworker_FWD_DEFINED__ */
00051
00052
00053 #ifndef __CvsCoworker_FWD_DEFINED__
00054 #define __CvsCoworker_FWD_DEFINED__
00055
00056 #ifdef __cplusplus
00057 typedef class CvsCoworker CvsCoworker;
00058 #else
00059 typedef struct CvsCoworker CvsCoworker;
00060 #endif /* __cplusplus */
00061
00062 #endif  /* __CvsCoworker_FWD_DEFINED__ */
00063
00064
00065 /* header files for imported files */
00066 #include "oaidl.h"
00067 #include "ocidl.h"
00068
00069 #ifdef __cplusplus
00070 extern "C"{
00071 #endif
00072
00073 void * __RPC_USER MIDL_user_allocate(size_t);
00074 void __RPC_USER MIDL_user_free( void * );
00075
00076 /* interface __MIDL_itf_CVS_Coworker_0000 */
00077 /* [local] */
00078
00079 typedef /* [helpstring][uuid] */  DECLSPEC_UUID("10E5359F-F454-11D2-B442-0080C6F9179D")
00080 enum CvsOption
00081     {   cvsOptionCompareContents    = 1,
00082     cvsOptionCompareChecksum    = 2,
00083     cvsOptionCompareTimestamp   = 3
00084     }   CvsOption;
00085
00086 typedef /* [helpstring][uuid] */  DECLSPEC_UUID("10E5359E-F454-11D2-B442-0080C6F9179D")
00087 enum CvsCommand
00088     {   cvsCommandUpdate    = 0,
00089     cvsCommandCheckout  = 1,
00090     cvsCommandCheckin   = 2,
00091     cvsCommandUncheckout    = 3,
00092     cvsCommandAdd   = 4,
00093     cvsCommandRemove    = 5,
00094     cvsCommandDiff  = 6,
00095     cvsCommandHistory   = 7,
00096     cvsCommandRename    = 8,
00097     cvsCommandProperties    = 9,
00098     cvsCommandOptions   = 10
00099     }   CvsCommand;
00100
00101
00102
00103 extern RPC_IF_HANDLE __MIDL_itf_CVS_Coworker_0000_v0_0_c_ifspec;
00104 extern RPC_IF_HANDLE __MIDL_itf_CVS_Coworker_0000_v0_0_s_ifspec;
00105
00106 #ifndef __ICvsCoworker_INTERFACE_DEFINED__
00107 #define __ICvsCoworker_INTERFACE_DEFINED__
00108
00109 /* interface ICvsCoworker */
00110 /* [unique][helpstring][oleautomation][uuid][object] */
00111
00112
00113 EXTERN_C const IID IID_ICvsCoworker;
00114
00115 #if defined(__cplusplus) && !defined(CINTERFACE)
00116
00117     MIDL_INTERFACE("10E5359C-F454-11D2-B442-0080C6F9179D")
00118     ICvsCoworker : public IUnknown
00119     {
00120     public:
00121         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetLastError(
00122             /* [in] */ int handle,
00123             /* [out] */ int *piError) = 0;
00124
00125         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetErrorMessage(
00126             /* [in] */ int handle,
00127             /* [in] */ int iError,
00128             /* [in] */ int cbErrorBuffer,
00129             /* [size_is][string][out] */ unsigned char *sErrorBuffer) = 0;
00130
00131         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE OpenProject(
00132             /* [out] */ int *pHandle,
00133             /* [string][in] */ const unsigned char *sUsername,
00134             /* [string][in] */ const unsigned char *sProjectName,
00135             /* [string][in] */ const unsigned char *sProjectHome) = 0;
00136
00137         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetProject(
00138             /* [out] */ int *pHandle,
00139             /* [in] */ const unsigned char *sUsername,
00140             /* [in] */ int cbProjectNameBuffer,
00141             /* [size_is][string][out][in] */ unsigned char *sProjectName,
00142             /* [in] */ int cbProjectHomeBuffer,
00143             /* [size_is][string][out][in] */ unsigned char *sProjectHome,
00144             /* [in] */ BOOL bAllowPathChange,
00145             /* [in] */ BOOL bAllowNewProject,
00146             /* [out] */ BOOL *pbNewProject) = 0;
00147
00148         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE UpdateFiles(
00149             /* [in] */ int handle,
00150             /* [string][in] */ const unsigned char *sFilenames,
00151             /* [in] */ BOOL bDirectories,
00152             /* [in] */ BOOL bRecurse) = 0;
00153
00154         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CheckoutFiles(
00155             /* [in] */ int handle,
00156             /* [string][in] */ const unsigned char *sFilenames) = 0;
00157
00158         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CheckinFiles(
00159             /* [in] */ int handle,
00160             /* [string][in] */ const unsigned char *sFilenames,
00161             /* [in] */ BOOL bKeepCheckedOut) = 0;
00162
00163         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE UncheckoutFiles(
00164             /* [in] */ int handle,
00165             /* [string][in] */ const unsigned char *sFilenames) = 0;
00166
00167         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AddFiles(
00168             /* [in] */ int handle,
00169             /* [string][in] */ const unsigned char *sOptionsAndFilenames,
00170             /* [string][in] */ const unsigned char *sComment) = 0;
00171
00172         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RemoveFiles(
00173             /* [in] */ int handle,
00174             /* [string][in] */ const unsigned char *sFilenames) = 0;
00175
00176         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RenameFile(
00177             /* [in] */ int handle,
00178             /* [string][in] */ const unsigned char *sOldFilename,
00179             /* [string][in] */ const unsigned char *sNewFilename) = 0;
00180
00181         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE DiffFile(
00182             /* [in] */ int handle,
00183             /* [string][in] */ const unsigned char *sFilename,
00184             /* [in] */ BOOL bIgnoreCase,
00185             /* [in] */ BOOL bIgnoreBlanks) = 0;
00186
00187         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ShowFileHistory(
00188             /* [in] */ int handle,
00189             /* [string][in] */ const unsigned char *sFilenames) = 0;
00190
00191         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ShowFileProperties(
00192             /* [in] */ int handle,
00193             /* [string][in] */ const unsigned char *sFilename) = 0;
00194
00195         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ShowUserInterface(
00196             /* [in] */ int handle,
00197             /* [string][in] */ const unsigned char *sFilenames) = 0;
00198
00199         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE HasAdvancedOptionsForCommand(
00200             /* [in] */ int handle,
00201             /* [in] */ CvsCommand command,
00202             /* [retval][out] */ BOOL *pbAdvancedOptions) = 0;
00203
00204         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ShowAdvancedOptionsForCommand(
00205             /* [in] */ int handle,
00206             /* [in] */ CvsCommand command) = 0;
00207
00208         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetFileChanges(
00209             /* [in] */ int handle,
00210             /* [in] */ int cbFilenameBuffer,
00211             /* [size_is][string][out] */ unsigned char *sFilenameBuffer) = 0;
00212
00213         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetFilesToAdd(
00214             /* [in] */ int handle,
00215             /* [in] */ int cbFilenamesBuffer,
00216             /* [size_is][string][out] */ unsigned char *sFilenamesBuffer) = 0;
00217
00218         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CloseProject(
00219             /* [in] */ int handle) = 0;
00220
00221     };
00222
00223 #else   /* C style interface */
00224
00225     typedef struct ICvsCoworkerVtbl
00226     {
00227         BEGIN_INTERFACE
00228
00229         HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
00230             ICvsCoworker * This,
00231             /* [in] */ REFIID riid,
00232             /* [iid_is][out] */ void **ppvObject);
00233
00234         ULONG ( STDMETHODCALLTYPE *AddRef )(
00235             ICvsCoworker * This);
00236
00237         ULONG ( STDMETHODCALLTYPE *Release )(
00238             ICvsCoworker * This);
00239
00240         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetLastError )(
00241             ICvsCoworker * This,
00242             /* [in] */ int handle,
00243             /* [out] */ int *piError);
00244
00245         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetErrorMessage )(
00246             ICvsCoworker * This,
00247             /* [in] */ int handle,
00248             /* [in] */ int iError,
00249             /* [in] */ int cbErrorBuffer,
00250             /* [size_is][string][out] */ unsigned char *sErrorBuffer);
00251
00252         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *OpenProject )(
00253             ICvsCoworker * This,
00254             /* [out] */ int *pHandle,
00255             /* [string][in] */ const unsigned char *sUsername,
00256             /* [string][in] */ const unsigned char *sProjectName,
00257             /* [string][in] */ const unsigned char *sProjectHome);
00258
00259         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetProject )(
00260             ICvsCoworker * This,
00261             /* [out] */ int *pHandle,
00262             /* [in] */ const unsigned char *sUsername,
00263             /* [in] */ int cbProjectNameBuffer,
00264             /* [size_is][string][out][in] */ unsigned char *sProjectName,
00265             /* [in] */ int cbProjectHomeBuffer,
00266             /* [size_is][string][out][in] */ unsigned char *sProjectHome,
00267             /* [in] */ BOOL bAllowPathChange,
00268             /* [in] */ BOOL bAllowNewProject,
00269             /* [out] */ BOOL *pbNewProject);
00270
00271         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *UpdateFiles )(
00272             ICvsCoworker * This,
00273             /* [in] */ int handle,
00274             /* [string][in] */ const unsigned char *sFilenames,
00275             /* [in] */ BOOL bDirectories,
00276             /* [in] */ BOOL bRecurse);
00277
00278         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CheckoutFiles )(
00279             ICvsCoworker * This,
00280             /* [in] */ int handle,
00281             /* [string][in] */ const unsigned char *sFilenames);
00282
00283         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CheckinFiles )(
00284             ICvsCoworker * This,
00285             /* [in] */ int handle,
00286             /* [string][in] */ const unsigned char *sFilenames,
00287             /* [in] */ BOOL bKeepCheckedOut);
00288
00289         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *UncheckoutFiles )(
00290             ICvsCoworker * This,
00291             /* [in] */ int handle,
00292             /* [string][in] */ const unsigned char *sFilenames);
00293
00294         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *AddFiles )(
00295             ICvsCoworker * This,
00296             /* [in] */ int handle,
00297             /* [string][in] */ const unsigned char *sOptionsAndFilenames,
00298             /* [string][in] */ const unsigned char *sComment);
00299
00300         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *RemoveFiles )(
00301             ICvsCoworker * This,
00302             /* [in] */ int handle,
00303             /* [string][in] */ const unsigned char *sFilenames);
00304
00305         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *RenameFile )(
00306             ICvsCoworker * This,
00307             /* [in] */ int handle,
00308             /* [string][in] */ const unsigned char *sOldFilename,
00309             /* [string][in] */ const unsigned char *sNewFilename);
00310
00311         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *DiffFile )(
00312             ICvsCoworker * This,
00313             /* [in] */ int handle,
00314             /* [string][in] */ const unsigned char *sFilename,
00315             /* [in] */ BOOL bIgnoreCase,
00316             /* [in] */ BOOL bIgnoreBlanks);
00317
00318         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ShowFileHistory )(
00319             ICvsCoworker * This,
00320             /* [in] */ int handle,
00321             /* [string][in] */ const unsigned char *sFilenames);
00322
00323         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ShowFileProperties )(
00324             ICvsCoworker * This,
00325             /* [in] */ int handle,
00326             /* [string][in] */ const unsigned char *sFilename);
00327
00328         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ShowUserInterface )(
00329             ICvsCoworker * This,
00330             /* [in] */ int handle,
00331             /* [string][in] */ const unsigned char *sFilenames);
00332
00333         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *HasAdvancedOptionsForCommand )(
00334             ICvsCoworker * This,
00335             /* [in] */ int handle,
00336             /* [in] */ CvsCommand command,
00337             /* [retval][out] */ BOOL *pbAdvancedOptions);
00338
00339         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ShowAdvancedOptionsForCommand )(
00340             ICvsCoworker * This,
00341             /* [in] */ int handle,
00342             /* [in] */ CvsCommand command);
00343
00344         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetFileChanges )(
00345             ICvsCoworker * This,
00346             /* [in] */ int handle,
00347             /* [in] */ int cbFilenameBuffer,
00348             /* [size_is][string][out] */ unsigned char *sFilenameBuffer);
00349
00350         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetFilesToAdd )(
00351             ICvsCoworker * This,
00352             /* [in] */ int handle,
00353             /* [in] */ int cbFilenamesBuffer,
00354             /* [size_is][string][out] */ unsigned char *sFilenamesBuffer);
00355
00356         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CloseProject )(
00357             ICvsCoworker * This,
00358             /* [in] */ int handle);
00359
00360         END_INTERFACE
00361     } ICvsCoworkerVtbl;
00362
00363     interface ICvsCoworker
00364     {
00365         CONST_VTBL struct ICvsCoworkerVtbl *lpVtbl;
00366     };
00367
00368
00369
00370 #ifdef COBJMACROS
00371
00372
00373 #define ICvsCoworker_QueryInterface(This,riid,ppvObject)    \
00374     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
00375
00376 #define ICvsCoworker_AddRef(This)   \
00377     (This)->lpVtbl -> AddRef(This)
00378
00379 #define ICvsCoworker_Release(This)  \
00380     (This)->lpVtbl -> Release(This)
00381
00382
00383 #define ICvsCoworker_GetLastError(This,handle,piError)  \
00384     (This)->lpVtbl -> GetLastError(This,handle,piError)
00385
00386 #define ICvsCoworker_GetErrorMessage(This,handle,iError,cbErrorBuffer,sErrorBuffer) \
00387     (This)->lpVtbl -> GetErrorMessage(This,handle,iError,cbErrorBuffer,sErrorBuffer)
00388
00389 #define ICvsCoworker_OpenProject(This,pHandle,sUsername,sProjectName,sProjectHome)  \
00390     (This)->lpVtbl -> OpenProject(This,pHandle,sUsername,sProjectName,sProjectHome)
00391
00392 #define ICvsCoworker_GetProject(This,pHandle,sUsername,cbProjectNameBuffer,sProjectName,cbProjectHomeBuffer,sProjectHome,bAllowPathChange,bAllowNewProject,pbNewProject)    \
00393     (This)->lpVtbl -> GetProject(This,pHandle,sUsername,cbProjectNameBuffer,sProjectName,cbProjectHomeBuffer,sProjectHome,bAllowPathChange,bAllowNewProject,pbNewProject)
00394
00395 #define ICvsCoworker_UpdateFiles(This,handle,sFilenames,bDirectories,bRecurse)  \
00396     (This)->lpVtbl -> UpdateFiles(This,handle,sFilenames,bDirectories,bRecurse)
00397
00398 #define ICvsCoworker_CheckoutFiles(This,handle,sFilenames)  \
00399     (This)->lpVtbl -> CheckoutFiles(This,handle,sFilenames)
00400
00401 #define ICvsCoworker_CheckinFiles(This,handle,sFilenames,bKeepCheckedOut)   \
00402     (This)->lpVtbl -> CheckinFiles(This,handle,sFilenames,bKeepCheckedOut)
00403
00404 #define ICvsCoworker_UncheckoutFiles(This,handle,sFilenames)    \
00405     (This)->lpVtbl -> UncheckoutFiles(This,handle,sFilenames)
00406
00407 #define ICvsCoworker_AddFiles(This,handle,sOptionsAndFilenames,sComment)    \
00408     (This)->lpVtbl -> AddFiles(This,handle,sOptionsAndFilenames,sComment)
00409
00410 #define ICvsCoworker_RemoveFiles(This,handle,sFilenames)    \
00411     (This)->lpVtbl -> RemoveFiles(This,handle,sFilenames)
00412
00413 #define ICvsCoworker_RenameFile(This,handle,sOldFilename,sNewFilename)  \
00414     (This)->lpVtbl -> RenameFile(This,handle,sOldFilename,sNewFilename)
00415
00416 #define ICvsCoworker_DiffFile(This,handle,sFilename,bIgnoreCase,bIgnoreBlanks)  \
00417     (This)->lpVtbl -> DiffFile(This,handle,sFilename,bIgnoreCase,bIgnoreBlanks)
00418
00419 #define ICvsCoworker_ShowFileHistory(This,handle,sFilenames)    \
00420     (This)->lpVtbl -> ShowFileHistory(This,handle,sFilenames)
00421
00422 #define ICvsCoworker_ShowFileProperties(This,handle,sFilename)  \
00423     (This)->lpVtbl -> ShowFileProperties(This,handle,sFilename)
00424
00425 #define ICvsCoworker_ShowUserInterface(This,handle,sFilenames)  \
00426     (This)->lpVtbl -> ShowUserInterface(This,handle,sFilenames)
00427
00428 #define ICvsCoworker_HasAdvancedOptionsForCommand(This,handle,command,pbAdvancedOptions)    \
00429     (This)->lpVtbl -> HasAdvancedOptionsForCommand(This,handle,command,pbAdvancedOptions)
00430
00431 #define ICvsCoworker_ShowAdvancedOptionsForCommand(This,handle,command) \
00432     (This)->lpVtbl -> ShowAdvancedOptionsForCommand(This,handle,command)
00433
00434 #define ICvsCoworker_GetFileChanges(This,handle,cbFilenameBuffer,sFilenameBuffer)   \
00435     (This)->lpVtbl -> GetFileChanges(This,handle,cbFilenameBuffer,sFilenameBuffer)
00436
00437 #define ICvsCoworker_GetFilesToAdd(This,handle,cbFilenamesBuffer,sFilenamesBuffer)  \
00438     (This)->lpVtbl -> GetFilesToAdd(This,handle,cbFilenamesBuffer,sFilenamesBuffer)
00439
00440 #define ICvsCoworker_CloseProject(This,handle)  \
00441     (This)->lpVtbl -> CloseProject(This,handle)
00442
00443 #endif /* COBJMACROS */
00444
00445
00446 #endif  /* C style interface */
00447
00448
00449
00450 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetLastError_Proxy(
00451     ICvsCoworker * This,
00452     /* [in] */ int handle,
00453     /* [out] */ int *piError);
00454
00455
00456 void __RPC_STUB ICvsCoworker_GetLastError_Stub(
00457     IRpcStubBuffer *This,
00458     IRpcChannelBuffer *_pRpcChannelBuffer,
00459     PRPC_MESSAGE _pRpcMessage,
00460     DWORD *_pdwStubPhase);
00461
00462
00463 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetErrorMessage_Proxy(
00464     ICvsCoworker * This,
00465     /* [in] */ int handle,
00466     /* [in] */ int iError,
00467     /* [in] */ int cbErrorBuffer,
00468     /* [size_is][string][out] */ unsigned char *sErrorBuffer);
00469
00470
00471 void __RPC_STUB ICvsCoworker_GetErrorMessage_Stub(
00472     IRpcStubBuffer *This,
00473     IRpcChannelBuffer *_pRpcChannelBuffer,
00474     PRPC_MESSAGE _pRpcMessage,
00475     DWORD *_pdwStubPhase);
00476
00477
00478 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_OpenProject_Proxy(
00479     ICvsCoworker * This,
00480     /* [out] */ int *pHandle,
00481     /* [string][in] */ const unsigned char *sUsername,
00482     /* [string][in] */ const unsigned char *sProjectName,
00483     /* [string][in] */ const unsigned char *sProjectHome);
00484
00485
00486 void __RPC_STUB ICvsCoworker_OpenProject_Stub(
00487     IRpcStubBuffer *This,
00488     IRpcChannelBuffer *_pRpcChannelBuffer,
00489     PRPC_MESSAGE _pRpcMessage,
00490     DWORD *_pdwStubPhase);
00491
00492
00493 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetProject_Proxy(
00494     ICvsCoworker * This,
00495     /* [out] */ int *pHandle,
00496     /* [in] */ const unsigned char *sUsername,
00497     /* [in] */ int cbProjectNameBuffer,
00498     /* [size_is][string][out][in] */ unsigned char *sProjectName,
00499     /* [in] */ int cbProjectHomeBuffer,
00500     /* [size_is][string][out][in] */ unsigned char *sProjectHome,
00501     /* [in] */ BOOL bAllowPathChange,
00502     /* [in] */ BOOL bAllowNewProject,
00503     /* [out] */ BOOL *pbNewProject);
00504
00505
00506 void __RPC_STUB ICvsCoworker_GetProject_Stub(
00507     IRpcStubBuffer *This,
00508     IRpcChannelBuffer *_pRpcChannelBuffer,
00509     PRPC_MESSAGE _pRpcMessage,
00510     DWORD *_pdwStubPhase);
00511
00512
00513 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_UpdateFiles_Proxy(
00514     ICvsCoworker * This,
00515     /* [in] */ int handle,
00516     /* [string][in] */ const unsigned char *sFilenames,
00517     /* [in] */ BOOL bDirectories,
00518     /* [in] */ BOOL bRecurse);
00519
00520
00521 void __RPC_STUB ICvsCoworker_UpdateFiles_Stub(
00522     IRpcStubBuffer *This,
00523     IRpcChannelBuffer *_pRpcChannelBuffer,
00524     PRPC_MESSAGE _pRpcMessage,
00525     DWORD *_pdwStubPhase);
00526
00527
00528 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckoutFiles_Proxy(
00529     ICvsCoworker * This,
00530     /* [in] */ int handle,
00531     /* [string][in] */ const unsigned char *sFilenames);
00532
00533
00534 void __RPC_STUB ICvsCoworker_CheckoutFiles_Stub(
00535     IRpcStubBuffer *This,
00536     IRpcChannelBuffer *_pRpcChannelBuffer,
00537     PRPC_MESSAGE _pRpcMessage,
00538     DWORD *_pdwStubPhase);
00539
00540
00541 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckinFiles_Proxy(
00542     ICvsCoworker * This,
00543     /* [in] */ int handle,
00544     /* [string][in] */ const unsigned char *sFilenames,
00545     /* [in] */ BOOL bKeepCheckedOut);
00546
00547
00548 void __RPC_STUB ICvsCoworker_CheckinFiles_Stub(
00549     IRpcStubBuffer *This,
00550     IRpcChannelBuffer *_pRpcChannelBuffer,
00551     PRPC_MESSAGE _pRpcMessage,
00552     DWORD *_pdwStubPhase);
00553
00554
00555 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_UncheckoutFiles_Proxy(
00556     ICvsCoworker * This,
00557     /* [in] */ int handle,
00558     /* [string][in] */ const unsigned char *sFilenames);
00559
00560
00561 void __RPC_STUB ICvsCoworker_UncheckoutFiles_Stub(
00562     IRpcStubBuffer *This,
00563     IRpcChannelBuffer *_pRpcChannelBuffer,
00564     PRPC_MESSAGE _pRpcMessage,
00565     DWORD *_pdwStubPhase);
00566
00567
00568 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_AddFiles_Proxy(
00569     ICvsCoworker * This,
00570     /* [in] */ int handle,
00571     /* [string][in] */ const unsigned char *sOptionsAndFilenames,
00572     /* [string][in] */ const unsigned char *sComment);
00573
00574
00575 void __RPC_STUB ICvsCoworker_AddFiles_Stub(
00576     IRpcStubBuffer *This,
00577     IRpcChannelBuffer *_pRpcChannelBuffer,
00578     PRPC_MESSAGE _pRpcMessage,
00579     DWORD *_pdwStubPhase);
00580
00581
00582 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_RemoveFiles_Proxy(
00583     ICvsCoworker * This,
00584     /* [in] */ int handle,
00585     /* [string][in] */ const unsigned char *sFilenames);
00586
00587
00588 void __RPC_STUB ICvsCoworker_RemoveFiles_Stub(
00589     IRpcStubBuffer *This,
00590     IRpcChannelBuffer *_pRpcChannelBuffer,
00591     PRPC_MESSAGE _pRpcMessage,
00592     DWORD *_pdwStubPhase);
00593
00594
00595 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_RenameFile_Proxy(
00596     ICvsCoworker * This,
00597     /* [in] */ int handle,
00598     /* [string][in] */ const unsigned char *sOldFilename,
00599     /* [string][in] */ const unsigned char *sNewFilename);
00600
00601
00602 void __RPC_STUB ICvsCoworker_RenameFile_Stub(
00603     IRpcStubBuffer *This,
00604     IRpcChannelBuffer *_pRpcChannelBuffer,
00605     PRPC_MESSAGE _pRpcMessage,
00606     DWORD *_pdwStubPhase);
00607
00608
00609 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_DiffFile_Proxy(
00610     ICvsCoworker * This,
00611     /* [in] */ int handle,
00612     /* [string][in] */ const unsigned char *sFilename,
00613     /* [in] */ BOOL bIgnoreCase,
00614     /* [in] */ BOOL bIgnoreBlanks);
00615
00616
00617 void __RPC_STUB ICvsCoworker_DiffFile_Stub(
00618     IRpcStubBuffer *This,
00619     IRpcChannelBuffer *_pRpcChannelBuffer,
00620     PRPC_MESSAGE _pRpcMessage,
00621     DWORD *_pdwStubPhase);
00622
00623
00624 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileHistory_Proxy(
00625     ICvsCoworker * This,
00626     /* [in] */ int handle,
00627     /* [string][in] */ const unsigned char *sFilenames);
00628
00629
00630 void __RPC_STUB ICvsCoworker_ShowFileHistory_Stub(
00631     IRpcStubBuffer *This,
00632     IRpcChannelBuffer *_pRpcChannelBuffer,
00633     PRPC_MESSAGE _pRpcMessage,
00634     DWORD *_pdwStubPhase);
00635
00636
00637 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileProperties_Proxy(
00638     ICvsCoworker * This,
00639     /* [in] */ int handle,
00640     /* [string][in] */ const unsigned char *sFilename);
00641
00642
00643 void __RPC_STUB ICvsCoworker_ShowFileProperties_Stub(
00644     IRpcStubBuffer *This,
00645     IRpcChannelBuffer *_pRpcChannelBuffer,
00646     PRPC_MESSAGE _pRpcMessage,
00647     DWORD *_pdwStubPhase);
00648
00649
00650 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowUserInterface_Proxy(
00651     ICvsCoworker * This,
00652     /* [in] */ int handle,
00653     /* [string][in] */ const unsigned char *sFilenames);
00654
00655
00656 void __RPC_STUB ICvsCoworker_ShowUserInterface_Stub(
00657     IRpcStubBuffer *This,
00658     IRpcChannelBuffer *_pRpcChannelBuffer,
00659     PRPC_MESSAGE _pRpcMessage,
00660     DWORD *_pdwStubPhase);
00661
00662
00663 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_HasAdvancedOptionsForCommand_Proxy(
00664     ICvsCoworker * This,
00665     /* [in] */ int handle,
00666     /* [in] */ CvsCommand command,
00667     /* [retval][out] */ BOOL *pbAdvancedOptions);
00668
00669
00670 void __RPC_STUB ICvsCoworker_HasAdvancedOptionsForCommand_Stub(
00671     IRpcStubBuffer *This,
00672     IRpcChannelBuffer *_pRpcChannelBuffer,
00673     PRPC_MESSAGE _pRpcMessage,
00674     DWORD *_pdwStubPhase);
00675
00676
00677 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy(
00678     ICvsCoworker * This,
00679     /* [in] */ int handle,
00680     /* [in] */ CvsCommand command);
00681
00682
00683 void __RPC_STUB ICvsCoworker_ShowAdvancedOptionsForCommand_Stub(
00684     IRpcStubBuffer *This,
00685     IRpcChannelBuffer *_pRpcChannelBuffer,
00686     PRPC_MESSAGE _pRpcMessage,
00687     DWORD *_pdwStubPhase);
00688
00689
00690 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFileChanges_Proxy(
00691     ICvsCoworker * This,
00692     /* [in] */ int handle,
00693     /* [in] */ int cbFilenameBuffer,
00694     /* [size_is][string][out] */ unsigned char *sFilenameBuffer);
00695
00696
00697 void __RPC_STUB ICvsCoworker_GetFileChanges_Stub(
00698     IRpcStubBuffer *This,
00699     IRpcChannelBuffer *_pRpcChannelBuffer,
00700     PRPC_MESSAGE _pRpcMessage,
00701     DWORD *_pdwStubPhase);
00702
00703
00704 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFilesToAdd_Proxy(
00705     ICvsCoworker * This,
00706     /* [in] */ int handle,
00707     /* [in] */ int cbFilenamesBuffer,
00708     /* [size_is][string][out] */ unsigned char *sFilenamesBuffer);
00709
00710
00711 void __RPC_STUB ICvsCoworker_GetFilesToAdd_Stub(
00712     IRpcStubBuffer *This,
00713     IRpcChannelBuffer *_pRpcChannelBuffer,
00714     PRPC_MESSAGE _pRpcMessage,
00715     DWORD *_pdwStubPhase);
00716
00717
00718 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_CloseProject_Proxy(
00719     ICvsCoworker * This,
00720     /* [in] */ int handle);
00721
00722
00723 void __RPC_STUB ICvsCoworker_CloseProject_Stub(
00724     IRpcStubBuffer *This,
00725     IRpcChannelBuffer *_pRpcChannelBuffer,
00726     PRPC_MESSAGE _pRpcMessage,
00727     DWORD *_pdwStubPhase);
00728
00729
00730
00731 #endif  /* __ICvsCoworker_INTERFACE_DEFINED__ */
00732
00733
00734
00735 #ifndef __CVS_COWORKERLib_LIBRARY_DEFINED__
00736 #define __CVS_COWORKERLib_LIBRARY_DEFINED__
00737
00738 /* library CVS_COWORKERLib */
00739 /* [helpstring][version][uuid] */
00740
00741
00742 EXTERN_C const IID LIBID_CVS_COWORKERLib;
00743
00744 EXTERN_C const CLSID CLSID_CvsCoworker;
00745
00746 #ifdef __cplusplus
00747
00748 class DECLSPEC_UUID("10E5359D-F454-11D2-B442-0080C6F9179D")
00749 CvsCoworker;
00750 #endif
00751 #endif /* __CVS_COWORKERLib_LIBRARY_DEFINED__ */
00752
00753 /* Additional Prototypes for ALL interfaces */
00754
00755 /* end of Additional Prototypes */
00756
00757 #ifdef __cplusplus
00758 }
00759 #endif
00760
00761 #endif
00762
00763
Generated on Sun Feb 24 01:21:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CVS_Coworker_i.c Source File

WinCvs/CVS_Coworker_i.c

Go to the documentation of this file.
00001
00002 #pragma warning( disable: 4049 )  /* more than 64k source lines */
00003
00004 /* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
00005
00006 /* link this file in with the server and any clients */
00007
00008
00009  /* File created by MIDL compiler version 6.00.0347 */
00010 /* at Sat Feb 23 22:55:05 2002
00011  */
00012 /* Compiler settings for D:\cvsgui\WinCvs\CoWorker\CVS_Coworker.idl:
00013     Os, W1, Zp8, env=Win32 (32b run)
00014     protocol : dce , ms_ext, c_ext
00015     error checks: allocation ref bounds_check enum stub_data
00016     VC __declspec() decoration level:
00017          __declspec(uuid()), __declspec(selectany), __declspec(novtable)
00018          DECLSPEC_UUID(), MIDL_INTERFACE()
00019 */
00020 //@@MIDL_FILE_HEADING(  )
00021
00022 #if !defined(_M_IA64) && !defined(_M_AMD64)
00023
00024 #ifdef __cplusplus
00025 extern "C"{
00026 #endif
00027
00028
00029 #include <rpc.h>
00030 #include <rpcndr.h>
00031
00032 #ifdef _MIDL_USE_GUIDDEF_
00033
00034 #ifndef INITGUID
00035 #define INITGUID
00036 #include <guiddef.h>
00037 #undef INITGUID
00038 #else
00039 #include <guiddef.h>
00040 #endif
00041
00042 #define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
00043         DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
00044
00045 #else // !_MIDL_USE_GUIDDEF_
00046
00047 #ifndef __IID_DEFINED__
00048 #define __IID_DEFINED__
00049
00050 typedef struct _IID
00051 {
00052     unsigned long x;
00053     unsigned short s1;
00054     unsigned short s2;
00055     unsigned char  c[8];
00056 } IID;
00057
00058 #endif // __IID_DEFINED__
00059
00060 #ifndef CLSID_DEFINED
00061 #define CLSID_DEFINED
00062 typedef IID CLSID;
00063 #endif // CLSID_DEFINED
00064
00065 #define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
00066         const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
00067
00068 #endif !_MIDL_USE_GUIDDEF_
00069
00070 MIDL_DEFINE_GUID(IID, IID_ICvsCoworker,0x10E5359C,0xF454,0x11D2,0xB4,0x42,0x00,0x80,0xC6,0xF9,0x17,0x9D);
00071
00072
00073 MIDL_DEFINE_GUID(IID, LIBID_CVS_COWORKERLib,0x10E53590,0xF454,0x11D2,0xB4,0x42,0x00,0x80,0xC6,0xF9,0x17,0x9D);
00074
00075
00076 MIDL_DEFINE_GUID(CLSID, CLSID_CvsCoworker,0x10E5359D,0xF454,0x11D2,0xB4,0x42,0x00,0x80,0xC6,0xF9,0x17,0x9D);
00077
00078 #undef MIDL_DEFINE_GUID
00079
00080 #ifdef __cplusplus
00081 }
00082 #endif
00083
00084
00085
00086 #endif /* !defined(_M_IA64) && !defined(_M_AMD64)*/
00087
Generated on Sun Feb 24 01:21:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CVS_Coworker_p.c Source File

WinCvs/CVS_Coworker_p.c

Go to the documentation of this file.
00001
00002 #pragma warning( disable: 4049 )  /* more than 64k source lines */
00003
00004 /* this ALWAYS GENERATED file contains the proxy stub code */
00005
00006
00007  /* File created by MIDL compiler version 6.00.0347 */
00008 /* at Sat Feb 23 22:55:05 2002
00009  */
00010 /* Compiler settings for D:\cvsgui\WinCvs\CoWorker\CVS_Coworker.idl:
00011     Os, W1, Zp8, env=Win32 (32b run)
00012     protocol : dce , ms_ext, c_ext
00013     error checks: allocation ref bounds_check enum stub_data
00014     VC __declspec() decoration level:
00015          __declspec(uuid()), __declspec(selectany), __declspec(novtable)
00016          DECLSPEC_UUID(), MIDL_INTERFACE()
00017 */
00018 //@@MIDL_FILE_HEADING(  )
00019
00020 #if !defined(_M_IA64) && !defined(_M_AMD64)
00021
00022 /* verify that the <rpcproxy.h> version is high enough to compile this file*/
00023 #ifndef __REDQ_RPCPROXY_H_VERSION__
00024 #define __REQUIRED_RPCPROXY_H_VERSION__ 440
00025 #endif
00026
00027
00028 #include "rpcproxy.h"
00029 #ifndef __RPCPROXY_H_VERSION__
00030 #error this stub requires an updated version of <rpcproxy.h>
00031 #endif // __RPCPROXY_H_VERSION__
00032
00033
00034 #include "CVS_Coworker.h"
00035
00036 #define TYPE_FORMAT_STRING_SIZE   65
00037 #define PROC_FORMAT_STRING_SIZE   151
00038 #define TRANSMIT_AS_TABLE_SIZE    0
00039 #define WIRE_MARSHAL_TABLE_SIZE   0
00040
00041 typedef struct _MIDL_TYPE_FORMAT_STRING
00042     {
00043     short          Pad;
00044     unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];
00045     } MIDL_TYPE_FORMAT_STRING;
00046
00047 typedef struct _MIDL_PROC_FORMAT_STRING
00048     {
00049     short          Pad;
00050     unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];
00051     } MIDL_PROC_FORMAT_STRING;
00052
00053
00054 static RPC_SYNTAX_IDENTIFIER  _RpcTransferSyntax =
00055 {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}};
00056
00057
00058 extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
00059 extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
00060
00061
00062 extern const MIDL_STUB_DESC Object_StubDesc;
00063
00064
00065 extern const MIDL_SERVER_INFO ICvsCoworker_ServerInfo;
00066 extern const MIDL_STUBLESS_PROXY_INFO ICvsCoworker_ProxyInfo;
00067
00068
00069 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetLastError_Proxy(
00070     ICvsCoworker * This,
00071     /* [in] */ int handle,
00072     /* [out] */ int *piError)
00073 {
00074
00075     HRESULT _RetVal;
00076
00077     RPC_MESSAGE _RpcMessage;
00078
00079     MIDL_STUB_MESSAGE _StubMsg;
00080
00081     RpcTryExcept
00082         {
00083         NdrProxyInitialize(
00084                       ( void *  )This,
00085                       ( PRPC_MESSAGE  )&_RpcMessage,
00086                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00087                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00088                       3);
00089
00090
00091
00092         if(!piError)
00093             {
00094             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00095             }
00096         RpcTryFinally
00097             {
00098
00099             _StubMsg.BufferLength = 8;
00100             NdrProxyGetBuffer(This, &_StubMsg);
00101             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00102             *(( int * )_StubMsg.Buffer)++ = handle;
00103
00104             NdrProxySendReceive(This, &_StubMsg);
00105
00106             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
00107             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
00108
00109             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00110                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
00111
00112             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00113             *piError = *(( int * )_StubMsg.Buffer)++;
00114
00115             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00116
00117             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00118                 {
00119                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
00120                 }
00121             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
00122
00123             }
00124         RpcFinally
00125             {
00126             NdrProxyFreeBuffer(This, &_StubMsg);
00127
00128             }
00129         RpcEndFinally
00130
00131         }
00132     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00133         {
00134         NdrClearOutParameters(
00135                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00136                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00137                          ( void * )piError);
00138         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00139         }
00140     RpcEndExcept
00141     return _RetVal;
00142 }
00143
00144 void __RPC_STUB ICvsCoworker_GetLastError_Stub(
00145     IRpcStubBuffer *This,
00146     IRpcChannelBuffer *_pRpcChannelBuffer,
00147     PRPC_MESSAGE _pRpcMessage,
00148     DWORD *_pdwStubPhase)
00149 {
00150     int _M0 =   0;
00151     HRESULT _RetVal;
00152     MIDL_STUB_MESSAGE _StubMsg;
00153     int handle;
00154     int *piError;
00155
00156 NdrStubInitialize(
00157                      _pRpcMessage,
00158                      &_StubMsg,
00159                      &Object_StubDesc,
00160                      _pRpcChannelBuffer);
00161     handle = 0;
00162     ( int * )piError = 0;
00163     RpcTryFinally
00164         {
00165         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00166             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
00167
00168         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00169
00170         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00171             {
00172             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00173             }
00174         handle = *(( int * )_StubMsg.Buffer)++;
00175
00176         piError = &_M0;
00177
00178         *_pdwStubPhase = STUB_CALL_SERVER;
00179         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetLastError(
00180                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00181                 handle,
00182                 piError);
00183
00184         *_pdwStubPhase = STUB_MARSHAL;
00185
00186         _StubMsg.BufferLength = 36;
00187         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00188         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00189         *(( int * )_StubMsg.Buffer)++ = *piError;
00190
00191         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00192         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
00193
00194         }
00195     RpcFinally
00196         {
00197         }
00198     RpcEndFinally
00199     _pRpcMessage->BufferLength =
00200         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
00201
00202 }
00203
00204
00205 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetErrorMessage_Proxy(
00206     ICvsCoworker * This,
00207     /* [in] */ int handle,
00208     /* [in] */ int iError,
00209     /* [in] */ int cbErrorBuffer,
00210     /* [size_is][string][out] */ unsigned char *sErrorBuffer)
00211 {
00212
00213     HRESULT _RetVal;
00214
00215     RPC_MESSAGE _RpcMessage;
00216
00217     MIDL_STUB_MESSAGE _StubMsg;
00218
00219     RpcTryExcept
00220         {
00221         NdrProxyInitialize(
00222                       ( void *  )This,
00223                       ( PRPC_MESSAGE  )&_RpcMessage,
00224                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00225                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00226                       4);
00227
00228
00229
00230         if(!sErrorBuffer)
00231             {
00232             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00233             }
00234         RpcTryFinally
00235             {
00236
00237             _StubMsg.BufferLength = 24;
00238             NdrProxyGetBuffer(This, &_StubMsg);
00239             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00240             *(( int * )_StubMsg.Buffer)++ = handle;
00241
00242             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00243             *(( int * )_StubMsg.Buffer)++ = iError;
00244
00245             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00246             *(( int * )_StubMsg.Buffer)++ = cbErrorBuffer;
00247
00248             NdrProxySendReceive(This, &_StubMsg);
00249
00250             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
00251             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
00252
00253             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00254                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] );
00255
00256             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00257                                            (unsigned char * *)&sErrorBuffer,
00258                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10],
00259                                            (unsigned char)0 );
00260
00261             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00262
00263             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00264                 {
00265                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
00266                 }
00267             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
00268
00269             }
00270         RpcFinally
00271             {
00272             NdrProxyFreeBuffer(This, &_StubMsg);
00273
00274             }
00275         RpcEndFinally
00276
00277         }
00278     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00279         {
00280         _StubMsg.MaxCount = ( unsigned long  )cbErrorBuffer;
00281
00282         NdrClearOutParameters(
00283                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00284                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[6],
00285                          ( void * )sErrorBuffer);
00286         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00287         }
00288     RpcEndExcept
00289     return _RetVal;
00290 }
00291
00292 void __RPC_STUB ICvsCoworker_GetErrorMessage_Stub(
00293     IRpcStubBuffer *This,
00294     IRpcChannelBuffer *_pRpcChannelBuffer,
00295     PRPC_MESSAGE _pRpcMessage,
00296     DWORD *_pdwStubPhase)
00297 {
00298     HRESULT _RetVal;
00299     MIDL_STUB_MESSAGE _StubMsg;
00300     int cbErrorBuffer;
00301     int handle;
00302     int iError;
00303     unsigned char *sErrorBuffer;
00304
00305 NdrStubInitialize(
00306                      _pRpcMessage,
00307                      &_StubMsg,
00308                      &Object_StubDesc,
00309                      _pRpcChannelBuffer);
00310     handle = 0;
00311     iError = 0;
00312     cbErrorBuffer = 0;
00313     ( unsigned char * )sErrorBuffer = 0;
00314     RpcTryFinally
00315         {
00316         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00317             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] );
00318
00319         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00320
00321         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00322             {
00323             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00324             }
00325         handle = *(( int * )_StubMsg.Buffer)++;
00326
00327         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00328
00329         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00330             {
00331             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00332             }
00333         iError = *(( int * )_StubMsg.Buffer)++;
00334
00335         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00336
00337         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00338             {
00339             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00340             }
00341         cbErrorBuffer = *(( int * )_StubMsg.Buffer)++;
00342
00343         if(cbErrorBuffer * 1 < 0)
00344             {
00345             RpcRaiseException(RPC_X_INVALID_BOUND);
00346             }
00347         sErrorBuffer = NdrAllocate(&_StubMsg,cbErrorBuffer * 1);
00348
00349         *_pdwStubPhase = STUB_CALL_SERVER;
00350         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetErrorMessage(
00351                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00352                    handle,
00353                    iError,
00354                    cbErrorBuffer,
00355                    sErrorBuffer);
00356
00357         *_pdwStubPhase = STUB_MARSHAL;
00358
00359         _StubMsg.BufferLength = 8;
00360         _StubMsg.MaxCount = ( unsigned long  )cbErrorBuffer;
00361
00362         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00363                                        (unsigned char *)sErrorBuffer,
00364                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10] );
00365
00366         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00367         _StubMsg.MaxCount = ( unsigned long  )cbErrorBuffer;
00368
00369         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00370                                      (unsigned char *)sErrorBuffer,
00371                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10] );
00372
00373         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00374         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
00375
00376         }
00377     RpcFinally
00378         {
00379         _StubMsg.MaxCount = ( unsigned long  )cbErrorBuffer;
00380
00381         NdrPointerFree( &_StubMsg,
00382                         (unsigned char *)sErrorBuffer,
00383                         &__MIDL_TypeFormatString.Format[6] );
00384
00385         }
00386     RpcEndFinally
00387     _pRpcMessage->BufferLength =
00388         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
00389
00390 }
00391
00392
00393 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_OpenProject_Proxy(
00394     ICvsCoworker * This,
00395     /* [out] */ int *pHandle,
00396     /* [string][in] */ const unsigned char *sUsername,
00397     /* [string][in] */ const unsigned char *sProjectName,
00398     /* [string][in] */ const unsigned char *sProjectHome)
00399 {
00400
00401     HRESULT _RetVal;
00402
00403     RPC_MESSAGE _RpcMessage;
00404
00405     MIDL_STUB_MESSAGE _StubMsg;
00406
00407     RpcTryExcept
00408         {
00409         NdrProxyInitialize(
00410                       ( void *  )This,
00411                       ( PRPC_MESSAGE  )&_RpcMessage,
00412                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00413                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00414                       5);
00415
00416
00417
00418         if(!pHandle)
00419             {
00420             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00421             }
00422         if(!sUsername)
00423             {
00424             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00425             }
00426         if(!sProjectName)
00427             {
00428             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00429             }
00430         if(!sProjectHome)
00431             {
00432             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00433             }
00434         RpcTryFinally
00435             {
00436
00437             _StubMsg.BufferLength = 0;
00438             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00439                                            (unsigned char *)sUsername,
00440                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00441
00442             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00443                                            (unsigned char *)sProjectName,
00444                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00445
00446             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00447                                            (unsigned char *)sProjectHome,
00448                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00449
00450             NdrProxyGetBuffer(This, &_StubMsg);
00451             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00452                                          (unsigned char *)sUsername,
00453                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00454
00455             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00456                                          (unsigned char *)sProjectName,
00457                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00458
00459             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00460                                          (unsigned char *)sProjectHome,
00461                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00462
00463             NdrProxySendReceive(This, &_StubMsg);
00464
00465             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
00466             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
00467
00468             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00469                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[20] );
00470
00471             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00472             *pHandle = *(( int * )_StubMsg.Buffer)++;
00473
00474             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00475
00476             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00477                 {
00478                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
00479                 }
00480             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
00481
00482             }
00483         RpcFinally
00484             {
00485             NdrProxyFreeBuffer(This, &_StubMsg);
00486
00487             }
00488         RpcEndFinally
00489
00490         }
00491     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00492         {
00493         NdrClearOutParameters(
00494                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00495                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00496                          ( void * )pHandle);
00497         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00498         }
00499     RpcEndExcept
00500     return _RetVal;
00501 }
00502
00503 void __RPC_STUB ICvsCoworker_OpenProject_Stub(
00504     IRpcStubBuffer *This,
00505     IRpcChannelBuffer *_pRpcChannelBuffer,
00506     PRPC_MESSAGE _pRpcMessage,
00507     DWORD *_pdwStubPhase)
00508 {
00509     int _M9 =   0;
00510     HRESULT _RetVal;
00511     MIDL_STUB_MESSAGE _StubMsg;
00512     int *pHandle;
00513     const unsigned char *sProjectHome;
00514     const unsigned char *sProjectName;
00515     const unsigned char *sUsername;
00516
00517 NdrStubInitialize(
00518                      _pRpcMessage,
00519                      &_StubMsg,
00520                      &Object_StubDesc,
00521                      _pRpcChannelBuffer);
00522     ( int * )pHandle = 0;
00523     ( unsigned char * )sUsername = 0;
00524     ( unsigned char * )sProjectName = 0;
00525     ( unsigned char * )sProjectHome = 0;
00526     RpcTryFinally
00527         {
00528         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00529             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[20] );
00530
00531         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00532                                        (unsigned char * *)&sUsername,
00533                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00534                                        (unsigned char)0 );
00535
00536         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00537                                        (unsigned char * *)&sProjectName,
00538                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00539                                        (unsigned char)0 );
00540
00541         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00542                                        (unsigned char * *)&sProjectHome,
00543                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00544                                        (unsigned char)0 );
00545
00546         pHandle = &_M9;
00547
00548         *_pdwStubPhase = STUB_CALL_SERVER;
00549         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> OpenProject(
00550                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00551                pHandle,
00552                sUsername,
00553                sProjectName,
00554                sProjectHome);
00555
00556         *_pdwStubPhase = STUB_MARSHAL;
00557
00558         _StubMsg.BufferLength = 36;
00559         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00560         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00561         *(( int * )_StubMsg.Buffer)++ = *pHandle;
00562
00563         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00564         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
00565
00566         }
00567     RpcFinally
00568         {
00569         }
00570     RpcEndFinally
00571     _pRpcMessage->BufferLength =
00572         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
00573
00574 }
00575
00576
00577 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetProject_Proxy(
00578     ICvsCoworker * This,
00579     /* [out] */ int *pHandle,
00580     /* [in] */ const unsigned char *sUsername,
00581     /* [in] */ int cbProjectNameBuffer,
00582     /* [size_is][string][out][in] */ unsigned char *sProjectName,
00583     /* [in] */ int cbProjectHomeBuffer,
00584     /* [size_is][string][out][in] */ unsigned char *sProjectHome,
00585     /* [in] */ BOOL bAllowPathChange,
00586     /* [in] */ BOOL bAllowNewProject,
00587     /* [out] */ BOOL *pbNewProject)
00588 {
00589
00590     HRESULT _RetVal;
00591
00592     RPC_MESSAGE _RpcMessage;
00593
00594     MIDL_STUB_MESSAGE _StubMsg;
00595
00596     RpcTryExcept
00597         {
00598         NdrProxyInitialize(
00599                       ( void *  )This,
00600                       ( PRPC_MESSAGE  )&_RpcMessage,
00601                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00602                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00603                       6);
00604
00605
00606
00607         if(!pHandle)
00608             {
00609             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00610             }
00611         if(!sUsername)
00612             {
00613             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00614             }
00615         if(!sProjectName)
00616             {
00617             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00618             }
00619         if(!sProjectHome)
00620             {
00621             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00622             }
00623         if(!pbNewProject)
00624             {
00625             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00626             }
00627         RpcTryFinally
00628             {
00629
00630             _StubMsg.BufferLength = 57;
00631             _StubMsg.MaxCount = ( unsigned long  )cbProjectNameBuffer;
00632
00633             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00634                                            (unsigned char *)sProjectName,
00635                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00636
00637             _StubMsg.MaxCount = ( unsigned long  )cbProjectHomeBuffer;
00638
00639             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00640                                            (unsigned char *)sProjectHome,
00641                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00642
00643             NdrProxyGetBuffer(This, &_StubMsg);
00644             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 0) & ~ 0);
00645             *(( unsigned char * )_StubMsg.Buffer)++ = *sUsername;
00646
00647             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00648             *(( int * )_StubMsg.Buffer)++ = cbProjectNameBuffer;
00649
00650             _StubMsg.MaxCount = ( unsigned long  )cbProjectNameBuffer;
00651
00652             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00653                                          (unsigned char *)sProjectName,
00654                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00655
00656             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00657             *(( int * )_StubMsg.Buffer)++ = cbProjectHomeBuffer;
00658
00659             _StubMsg.MaxCount = ( unsigned long  )cbProjectHomeBuffer;
00660
00661             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00662                                          (unsigned char *)sProjectHome,
00663                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00664
00665             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00666             *(( BOOL * )_StubMsg.Buffer)++ = bAllowPathChange;
00667
00668             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00669             *(( BOOL * )_StubMsg.Buffer)++ = bAllowNewProject;
00670
00671             NdrProxySendReceive(This, &_StubMsg);
00672
00673             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
00674             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
00675
00676             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00677                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[38] );
00678
00679             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00680             *pHandle = *(( int * )_StubMsg.Buffer)++;
00681
00682             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00683                                            (unsigned char * *)&sProjectName,
00684                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28],
00685                                            (unsigned char)0 );
00686
00687             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00688                                            (unsigned char * *)&sProjectHome,
00689                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38],
00690                                            (unsigned char)0 );
00691
00692             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00693             *pbNewProject = *(( BOOL * )_StubMsg.Buffer)++;
00694
00695             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00696
00697             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00698                 {
00699                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
00700                 }
00701             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
00702
00703             }
00704         RpcFinally
00705             {
00706             NdrProxyFreeBuffer(This, &_StubMsg);
00707
00708             }
00709         RpcEndFinally
00710
00711         }
00712     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00713         {
00714         NdrClearOutParameters(
00715                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00716                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00717                          ( void * )pHandle);
00718         _StubMsg.MaxCount = ( unsigned long  )cbProjectNameBuffer;
00719
00720         NdrClearOutParameters(
00721                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00722                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[24],
00723                          ( void * )sProjectName);
00724         _StubMsg.MaxCount = ( unsigned long  )cbProjectHomeBuffer;
00725
00726         NdrClearOutParameters(
00727                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00728                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[34],
00729                          ( void * )sProjectHome);
00730         NdrClearOutParameters(
00731                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00732                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00733                          ( void * )pbNewProject);
00734         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00735         }
00736     RpcEndExcept
00737     return _RetVal;
00738 }
00739
00740 void __RPC_STUB ICvsCoworker_GetProject_Stub(
00741     IRpcStubBuffer *This,
00742     IRpcChannelBuffer *_pRpcChannelBuffer,
00743     PRPC_MESSAGE _pRpcMessage,
00744     DWORD *_pdwStubPhase)
00745 {
00746     int _M14    =   0;
00747     BOOL _M15   =   0;
00748     HRESULT _RetVal;
00749     MIDL_STUB_MESSAGE _StubMsg;
00750     BOOL bAllowNewProject;
00751     BOOL bAllowPathChange;
00752     int cbProjectHomeBuffer;
00753     int cbProjectNameBuffer;
00754     int *pHandle;
00755     BOOL *pbNewProject;
00756     unsigned char *sProjectHome;
00757     unsigned char *sProjectName;
00758     const unsigned char *sUsername;
00759
00760 NdrStubInitialize(
00761                      _pRpcMessage,
00762                      &_StubMsg,
00763                      &Object_StubDesc,
00764                      _pRpcChannelBuffer);
00765     ( int * )pHandle = 0;
00766     ( unsigned char * )sUsername = 0;
00767     cbProjectNameBuffer = 0;
00768     ( unsigned char * )sProjectName = 0;
00769     cbProjectHomeBuffer = 0;
00770     ( unsigned char * )sProjectHome = 0;
00771     bAllowPathChange = 0;
00772     bAllowNewProject = 0;
00773     ( BOOL * )pbNewProject = 0;
00774     RpcTryFinally
00775         {
00776         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00777             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[38] );
00778
00779         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 0) & ~ 0);
00780         sUsername = ( unsigned char * )_StubMsg.Buffer;
00781         _StubMsg.Buffer += sizeof( unsigned char  );
00782
00783         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00784
00785         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00786             {
00787             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00788             }
00789         cbProjectNameBuffer = *(( int * )_StubMsg.Buffer)++;
00790
00791         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00792                                        (unsigned char * *)&sProjectName,
00793                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28],
00794                                        (unsigned char)0 );
00795
00796         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00797
00798         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00799             {
00800             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00801             }
00802         cbProjectHomeBuffer = *(( int * )_StubMsg.Buffer)++;
00803
00804         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00805                                        (unsigned char * *)&sProjectHome,
00806                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38],
00807                                        (unsigned char)0 );
00808
00809         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00810
00811         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00812             {
00813             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00814             }
00815         bAllowPathChange = *(( BOOL * )_StubMsg.Buffer)++;
00816
00817         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00818
00819         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00820             {
00821             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00822             }
00823         bAllowNewProject = *(( BOOL * )_StubMsg.Buffer)++;
00824
00825         pHandle = &_M14;
00826         pbNewProject = &_M15;
00827
00828         *_pdwStubPhase = STUB_CALL_SERVER;
00829         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetProject(
00830               (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00831               pHandle,
00832               sUsername,
00833               cbProjectNameBuffer,
00834               sProjectName,
00835               cbProjectHomeBuffer,
00836               sProjectHome,
00837               bAllowPathChange,
00838               bAllowNewProject,
00839               pbNewProject);
00840
00841         *_pdwStubPhase = STUB_MARSHAL;
00842
00843         _StubMsg.BufferLength = 64;
00844         _StubMsg.MaxCount = ( unsigned long  )cbProjectNameBuffer;
00845
00846         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00847                                        (unsigned char *)sProjectName,
00848                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00849
00850         _StubMsg.MaxCount = ( unsigned long  )cbProjectHomeBuffer;
00851
00852         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00853                                        (unsigned char *)sProjectHome,
00854                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00855
00856         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00857         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00858         *(( int * )_StubMsg.Buffer)++ = *pHandle;
00859
00860         _StubMsg.MaxCount = ( unsigned long  )cbProjectNameBuffer;
00861
00862         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00863                                      (unsigned char *)sProjectName,
00864                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00865
00866         _StubMsg.MaxCount = ( unsigned long  )cbProjectHomeBuffer;
00867
00868         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00869                                      (unsigned char *)sProjectHome,
00870                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00871
00872         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00873         *(( BOOL * )_StubMsg.Buffer)++ = *pbNewProject;
00874
00875         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00876         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
00877
00878         }
00879     RpcFinally
00880         {
00881         _StubMsg.MaxCount = ( unsigned long  )cbProjectNameBuffer;
00882
00883         NdrPointerFree( &_StubMsg,
00884                         (unsigned char *)sProjectName,
00885                         &__MIDL_TypeFormatString.Format[24] );
00886
00887         _StubMsg.MaxCount = ( unsigned long  )cbProjectHomeBuffer;
00888
00889         NdrPointerFree( &_StubMsg,
00890                         (unsigned char *)sProjectHome,
00891                         &__MIDL_TypeFormatString.Format[34] );
00892
00893         }
00894     RpcEndFinally
00895     _pRpcMessage->BufferLength =
00896         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
00897
00898 }
00899
00900
00901 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_UpdateFiles_Proxy(
00902     ICvsCoworker * This,
00903     /* [in] */ int handle,
00904     /* [string][in] */ const unsigned char *sFilenames,
00905     /* [in] */ BOOL bDirectories,
00906     /* [in] */ BOOL bRecurse)
00907 {
00908
00909     HRESULT _RetVal;
00910
00911     RPC_MESSAGE _RpcMessage;
00912
00913     MIDL_STUB_MESSAGE _StubMsg;
00914
00915     RpcTryExcept
00916         {
00917         NdrProxyInitialize(
00918                       ( void *  )This,
00919                       ( PRPC_MESSAGE  )&_RpcMessage,
00920                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00921                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00922                       7);
00923
00924
00925
00926         if(!sFilenames)
00927             {
00928             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00929             }
00930         RpcTryFinally
00931             {
00932
00933             _StubMsg.BufferLength = 24;
00934             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00935                                            (unsigned char *)sFilenames,
00936                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00937
00938             NdrProxyGetBuffer(This, &_StubMsg);
00939             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00940             *(( int * )_StubMsg.Buffer)++ = handle;
00941
00942             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00943                                          (unsigned char *)sFilenames,
00944                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00945
00946             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00947             *(( BOOL * )_StubMsg.Buffer)++ = bDirectories;
00948
00949             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00950             *(( BOOL * )_StubMsg.Buffer)++ = bRecurse;
00951
00952             NdrProxySendReceive(This, &_StubMsg);
00953
00954             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
00955             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
00956
00957             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00958                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
00959
00960             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00961
00962             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00963                 {
00964                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
00965                 }
00966             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
00967
00968             }
00969         RpcFinally
00970             {
00971             NdrProxyFreeBuffer(This, &_StubMsg);
00972
00973             }
00974         RpcEndFinally
00975
00976         }
00977     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00978         {
00979         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00980         }
00981     RpcEndExcept
00982     return _RetVal;
00983 }
00984
00985 void __RPC_STUB ICvsCoworker_UpdateFiles_Stub(
00986     IRpcStubBuffer *This,
00987     IRpcChannelBuffer *_pRpcChannelBuffer,
00988     PRPC_MESSAGE _pRpcMessage,
00989     DWORD *_pdwStubPhase)
00990 {
00991     HRESULT _RetVal;
00992     MIDL_STUB_MESSAGE _StubMsg;
00993     BOOL bDirectories;
00994     BOOL bRecurse;
00995     int handle;
00996     const unsigned char *sFilenames;
00997
00998 NdrStubInitialize(
00999                      _pRpcMessage,
01000                      &_StubMsg,
01001                      &Object_StubDesc,
01002                      _pRpcChannelBuffer);
01003     handle = 0;
01004     ( unsigned char * )sFilenames = 0;
01005     bDirectories = 0;
01006     bRecurse = 0;
01007     RpcTryFinally
01008         {
01009         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01010             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
01011
01012         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01013
01014         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01015             {
01016             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01017             }
01018         handle = *(( int * )_StubMsg.Buffer)++;
01019
01020         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01021                                        (unsigned char * *)&sFilenames,
01022                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01023                                        (unsigned char)0 );
01024
01025         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01026
01027         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01028             {
01029             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01030             }
01031         bDirectories = *(( BOOL * )_StubMsg.Buffer)++;
01032
01033         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01034
01035         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01036             {
01037             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01038             }
01039         bRecurse = *(( BOOL * )_StubMsg.Buffer)++;
01040
01041
01042         *_pdwStubPhase = STUB_CALL_SERVER;
01043         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> UpdateFiles(
01044                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01045                handle,
01046                sFilenames,
01047                bDirectories,
01048                bRecurse);
01049
01050         *_pdwStubPhase = STUB_MARSHAL;
01051
01052         _StubMsg.BufferLength = 8;
01053         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01054         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01055         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01056
01057         }
01058     RpcFinally
01059         {
01060         }
01061     RpcEndFinally
01062     _pRpcMessage->BufferLength =
01063         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01064
01065 }
01066
01067
01068 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckoutFiles_Proxy(
01069     ICvsCoworker * This,
01070     /* [in] */ int handle,
01071     /* [string][in] */ const unsigned char *sFilenames)
01072 {
01073
01074     HRESULT _RetVal;
01075
01076     RPC_MESSAGE _RpcMessage;
01077
01078     MIDL_STUB_MESSAGE _StubMsg;
01079
01080     RpcTryExcept
01081         {
01082         NdrProxyInitialize(
01083                       ( void *  )This,
01084                       ( PRPC_MESSAGE  )&_RpcMessage,
01085                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01086                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01087                       8);
01088
01089
01090
01091         if(!sFilenames)
01092             {
01093             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01094             }
01095         RpcTryFinally
01096             {
01097
01098             _StubMsg.BufferLength = 8;
01099             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01100                                            (unsigned char *)sFilenames,
01101                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01102
01103             NdrProxyGetBuffer(This, &_StubMsg);
01104             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01105             *(( int * )_StubMsg.Buffer)++ = handle;
01106
01107             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01108                                          (unsigned char *)sFilenames,
01109                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01110
01111             NdrProxySendReceive(This, &_StubMsg);
01112
01113             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
01114             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
01115
01116             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01117                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01118
01119             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01120
01121             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01122                 {
01123                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
01124                 }
01125             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
01126
01127             }
01128         RpcFinally
01129             {
01130             NdrProxyFreeBuffer(This, &_StubMsg);
01131
01132             }
01133         RpcEndFinally
01134
01135         }
01136     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01137         {
01138         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01139         }
01140     RpcEndExcept
01141     return _RetVal;
01142 }
01143
01144 void __RPC_STUB ICvsCoworker_CheckoutFiles_Stub(
01145     IRpcStubBuffer *This,
01146     IRpcChannelBuffer *_pRpcChannelBuffer,
01147     PRPC_MESSAGE _pRpcMessage,
01148     DWORD *_pdwStubPhase)
01149 {
01150     HRESULT _RetVal;
01151     MIDL_STUB_MESSAGE _StubMsg;
01152     int handle;
01153     const unsigned char *sFilenames;
01154
01155 NdrStubInitialize(
01156                      _pRpcMessage,
01157                      &_StubMsg,
01158                      &Object_StubDesc,
01159                      _pRpcChannelBuffer);
01160     handle = 0;
01161     ( unsigned char * )sFilenames = 0;
01162     RpcTryFinally
01163         {
01164         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01165             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01166
01167         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01168
01169         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01170             {
01171             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01172             }
01173         handle = *(( int * )_StubMsg.Buffer)++;
01174
01175         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01176                                        (unsigned char * *)&sFilenames,
01177                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01178                                        (unsigned char)0 );
01179
01180
01181         *_pdwStubPhase = STUB_CALL_SERVER;
01182         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CheckoutFiles(
01183                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01184                  handle,
01185                  sFilenames);
01186
01187         *_pdwStubPhase = STUB_MARSHAL;
01188
01189         _StubMsg.BufferLength = 8;
01190         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01191         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01192         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01193
01194         }
01195     RpcFinally
01196         {
01197         }
01198     RpcEndFinally
01199     _pRpcMessage->BufferLength =
01200         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01201
01202 }
01203
01204
01205 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckinFiles_Proxy(
01206     ICvsCoworker * This,
01207     /* [in] */ int handle,
01208     /* [string][in] */ const unsigned char *sFilenames,
01209     /* [in] */ BOOL bKeepCheckedOut)
01210 {
01211
01212     HRESULT _RetVal;
01213
01214     RPC_MESSAGE _RpcMessage;
01215
01216     MIDL_STUB_MESSAGE _StubMsg;
01217
01218     RpcTryExcept
01219         {
01220         NdrProxyInitialize(
01221                       ( void *  )This,
01222                       ( PRPC_MESSAGE  )&_RpcMessage,
01223                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01224                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01225                       9);
01226
01227
01228
01229         if(!sFilenames)
01230             {
01231             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01232             }
01233         RpcTryFinally
01234             {
01235
01236             _StubMsg.BufferLength = 16;
01237             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01238                                            (unsigned char *)sFilenames,
01239                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01240
01241             NdrProxyGetBuffer(This, &_StubMsg);
01242             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01243             *(( int * )_StubMsg.Buffer)++ = handle;
01244
01245             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01246                                          (unsigned char *)sFilenames,
01247                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01248
01249             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01250             *(( BOOL * )_StubMsg.Buffer)++ = bKeepCheckedOut;
01251
01252             NdrProxySendReceive(This, &_StubMsg);
01253
01254             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
01255             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
01256
01257             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01258                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] );
01259
01260             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01261
01262             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01263                 {
01264                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
01265                 }
01266             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
01267
01268             }
01269         RpcFinally
01270             {
01271             NdrProxyFreeBuffer(This, &_StubMsg);
01272
01273             }
01274         RpcEndFinally
01275
01276         }
01277     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01278         {
01279         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01280         }
01281     RpcEndExcept
01282     return _RetVal;
01283 }
01284
01285 void __RPC_STUB ICvsCoworker_CheckinFiles_Stub(
01286     IRpcStubBuffer *This,
01287     IRpcChannelBuffer *_pRpcChannelBuffer,
01288     PRPC_MESSAGE _pRpcMessage,
01289     DWORD *_pdwStubPhase)
01290 {
01291     HRESULT _RetVal;
01292     MIDL_STUB_MESSAGE _StubMsg;
01293     BOOL bKeepCheckedOut;
01294     int handle;
01295     const unsigned char *sFilenames;
01296
01297 NdrStubInitialize(
01298                      _pRpcMessage,
01299                      &_StubMsg,
01300                      &Object_StubDesc,
01301                      _pRpcChannelBuffer);
01302     handle = 0;
01303     ( unsigned char * )sFilenames = 0;
01304     bKeepCheckedOut = 0;
01305     RpcTryFinally
01306         {
01307         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01308             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] );
01309
01310         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01311
01312         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01313             {
01314             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01315             }
01316         handle = *(( int * )_StubMsg.Buffer)++;
01317
01318         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01319                                        (unsigned char * *)&sFilenames,
01320                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01321                                        (unsigned char)0 );
01322
01323         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01324
01325         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01326             {
01327             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01328             }
01329         bKeepCheckedOut = *(( BOOL * )_StubMsg.Buffer)++;
01330
01331
01332         *_pdwStubPhase = STUB_CALL_SERVER;
01333         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CheckinFiles(
01334                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01335                 handle,
01336                 sFilenames,
01337                 bKeepCheckedOut);
01338
01339         *_pdwStubPhase = STUB_MARSHAL;
01340
01341         _StubMsg.BufferLength = 8;
01342         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01343         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01344         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01345
01346         }
01347     RpcFinally
01348         {
01349         }
01350     RpcEndFinally
01351     _pRpcMessage->BufferLength =
01352         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01353
01354 }
01355
01356
01357 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_UncheckoutFiles_Proxy(
01358     ICvsCoworker * This,
01359     /* [in] */ int handle,
01360     /* [string][in] */ const unsigned char *sFilenames)
01361 {
01362
01363     HRESULT _RetVal;
01364
01365     RPC_MESSAGE _RpcMessage;
01366
01367     MIDL_STUB_MESSAGE _StubMsg;
01368
01369     RpcTryExcept
01370         {
01371         NdrProxyInitialize(
01372                       ( void *  )This,
01373                       ( PRPC_MESSAGE  )&_RpcMessage,
01374                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01375                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01376                       10);
01377
01378
01379
01380         if(!sFilenames)
01381             {
01382             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01383             }
01384         RpcTryFinally
01385             {
01386
01387             _StubMsg.BufferLength = 8;
01388             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01389                                            (unsigned char *)sFilenames,
01390                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01391
01392             NdrProxyGetBuffer(This, &_StubMsg);
01393             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01394             *(( int * )_StubMsg.Buffer)++ = handle;
01395
01396             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01397                                          (unsigned char *)sFilenames,
01398                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01399
01400             NdrProxySendReceive(This, &_StubMsg);
01401
01402             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
01403             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
01404
01405             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01406                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01407
01408             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01409
01410             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01411                 {
01412                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
01413                 }
01414             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
01415
01416             }
01417         RpcFinally
01418             {
01419             NdrProxyFreeBuffer(This, &_StubMsg);
01420
01421             }
01422         RpcEndFinally
01423
01424         }
01425     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01426         {
01427         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01428         }
01429     RpcEndExcept
01430     return _RetVal;
01431 }
01432
01433 void __RPC_STUB ICvsCoworker_UncheckoutFiles_Stub(
01434     IRpcStubBuffer *This,
01435     IRpcChannelBuffer *_pRpcChannelBuffer,
01436     PRPC_MESSAGE _pRpcMessage,
01437     DWORD *_pdwStubPhase)
01438 {
01439     HRESULT _RetVal;
01440     MIDL_STUB_MESSAGE _StubMsg;
01441     int handle;
01442     const unsigned char *sFilenames;
01443
01444 NdrStubInitialize(
01445                      _pRpcMessage,
01446                      &_StubMsg,
01447                      &Object_StubDesc,
01448                      _pRpcChannelBuffer);
01449     handle = 0;
01450     ( unsigned char * )sFilenames = 0;
01451     RpcTryFinally
01452         {
01453         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01454             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01455
01456         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01457
01458         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01459             {
01460             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01461             }
01462         handle = *(( int * )_StubMsg.Buffer)++;
01463
01464         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01465                                        (unsigned char * *)&sFilenames,
01466                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01467                                        (unsigned char)0 );
01468
01469
01470         *_pdwStubPhase = STUB_CALL_SERVER;
01471         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> UncheckoutFiles(
01472                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01473                    handle,
01474                    sFilenames);
01475
01476         *_pdwStubPhase = STUB_MARSHAL;
01477
01478         _StubMsg.BufferLength = 8;
01479         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01480         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01481         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01482
01483         }
01484     RpcFinally
01485         {
01486         }
01487     RpcEndFinally
01488     _pRpcMessage->BufferLength =
01489         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01490
01491 }
01492
01493
01494 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_AddFiles_Proxy(
01495     ICvsCoworker * This,
01496     /* [in] */ int handle,
01497     /* [string][in] */ const unsigned char *sOptionsAndFilenames,
01498     /* [string][in] */ const unsigned char *sComment)
01499 {
01500
01501     HRESULT _RetVal;
01502
01503     RPC_MESSAGE _RpcMessage;
01504
01505     MIDL_STUB_MESSAGE _StubMsg;
01506
01507     RpcTryExcept
01508         {
01509         NdrProxyInitialize(
01510                       ( void *  )This,
01511                       ( PRPC_MESSAGE  )&_RpcMessage,
01512                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01513                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01514                       11);
01515
01516
01517
01518         if(!sOptionsAndFilenames)
01519             {
01520             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01521             }
01522         if(!sComment)
01523             {
01524             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01525             }
01526         RpcTryFinally
01527             {
01528
01529             _StubMsg.BufferLength = 8;
01530             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01531                                            (unsigned char *)sOptionsAndFilenames,
01532                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01533
01534             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01535                                            (unsigned char *)sComment,
01536                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01537
01538             NdrProxyGetBuffer(This, &_StubMsg);
01539             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01540             *(( int * )_StubMsg.Buffer)++ = handle;
01541
01542             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01543                                          (unsigned char *)sOptionsAndFilenames,
01544                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01545
01546             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01547                                          (unsigned char *)sComment,
01548                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01549
01550             NdrProxySendReceive(This, &_StubMsg);
01551
01552             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
01553             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
01554
01555             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01556                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01557
01558             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01559
01560             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01561                 {
01562                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
01563                 }
01564             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
01565
01566             }
01567         RpcFinally
01568             {
01569             NdrProxyFreeBuffer(This, &_StubMsg);
01570
01571             }
01572         RpcEndFinally
01573
01574         }
01575     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01576         {
01577         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01578         }
01579     RpcEndExcept
01580     return _RetVal;
01581 }
01582
01583 void __RPC_STUB ICvsCoworker_AddFiles_Stub(
01584     IRpcStubBuffer *This,
01585     IRpcChannelBuffer *_pRpcChannelBuffer,
01586     PRPC_MESSAGE _pRpcMessage,
01587     DWORD *_pdwStubPhase)
01588 {
01589     HRESULT _RetVal;
01590     MIDL_STUB_MESSAGE _StubMsg;
01591     int handle;
01592     const unsigned char *sComment;
01593     const unsigned char *sOptionsAndFilenames;
01594
01595 NdrStubInitialize(
01596                      _pRpcMessage,
01597                      &_StubMsg,
01598                      &Object_StubDesc,
01599                      _pRpcChannelBuffer);
01600     handle = 0;
01601     ( unsigned char * )sOptionsAndFilenames = 0;
01602     ( unsigned char * )sComment = 0;
01603     RpcTryFinally
01604         {
01605         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01606             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01607
01608         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01609
01610         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01611             {
01612             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01613             }
01614         handle = *(( int * )_StubMsg.Buffer)++;
01615
01616         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01617                                        (unsigned char * *)&sOptionsAndFilenames,
01618                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01619                                        (unsigned char)0 );
01620
01621         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01622                                        (unsigned char * *)&sComment,
01623                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01624                                        (unsigned char)0 );
01625
01626
01627         *_pdwStubPhase = STUB_CALL_SERVER;
01628         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> AddFiles(
01629             (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01630             handle,
01631             sOptionsAndFilenames,
01632             sComment);
01633
01634         *_pdwStubPhase = STUB_MARSHAL;
01635
01636         _StubMsg.BufferLength = 8;
01637         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01638         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01639         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01640
01641         }
01642     RpcFinally
01643         {
01644         }
01645     RpcEndFinally
01646     _pRpcMessage->BufferLength =
01647         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01648
01649 }
01650
01651
01652 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_RemoveFiles_Proxy(
01653     ICvsCoworker * This,
01654     /* [in] */ int handle,
01655     /* [string][in] */ const unsigned char *sFilenames)
01656 {
01657
01658     HRESULT _RetVal;
01659
01660     RPC_MESSAGE _RpcMessage;
01661
01662     MIDL_STUB_MESSAGE _StubMsg;
01663
01664     RpcTryExcept
01665         {
01666         NdrProxyInitialize(
01667                       ( void *  )This,
01668                       ( PRPC_MESSAGE  )&_RpcMessage,
01669                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01670                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01671                       12);
01672
01673
01674
01675         if(!sFilenames)
01676             {
01677             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01678             }
01679         RpcTryFinally
01680             {
01681
01682             _StubMsg.BufferLength = 8;
01683             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01684                                            (unsigned char *)sFilenames,
01685                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01686
01687             NdrProxyGetBuffer(This, &_StubMsg);
01688             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01689             *(( int * )_StubMsg.Buffer)++ = handle;
01690
01691             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01692                                          (unsigned char *)sFilenames,
01693                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01694
01695             NdrProxySendReceive(This, &_StubMsg);
01696
01697             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
01698             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
01699
01700             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01701                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01702
01703             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01704
01705             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01706                 {
01707                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
01708                 }
01709             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
01710
01711             }
01712         RpcFinally
01713             {
01714             NdrProxyFreeBuffer(This, &_StubMsg);
01715
01716             }
01717         RpcEndFinally
01718
01719         }
01720     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01721         {
01722         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01723         }
01724     RpcEndExcept
01725     return _RetVal;
01726 }
01727
01728 void __RPC_STUB ICvsCoworker_RemoveFiles_Stub(
01729     IRpcStubBuffer *This,
01730     IRpcChannelBuffer *_pRpcChannelBuffer,
01731     PRPC_MESSAGE _pRpcMessage,
01732     DWORD *_pdwStubPhase)
01733 {
01734     HRESULT _RetVal;
01735     MIDL_STUB_MESSAGE _StubMsg;
01736     int handle;
01737     const unsigned char *sFilenames;
01738
01739 NdrStubInitialize(
01740                      _pRpcMessage,
01741                      &_StubMsg,
01742                      &Object_StubDesc,
01743                      _pRpcChannelBuffer);
01744     handle = 0;
01745     ( unsigned char * )sFilenames = 0;
01746     RpcTryFinally
01747         {
01748         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01749             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01750
01751         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01752
01753         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01754             {
01755             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01756             }
01757         handle = *(( int * )_StubMsg.Buffer)++;
01758
01759         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01760                                        (unsigned char * *)&sFilenames,
01761                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01762                                        (unsigned char)0 );
01763
01764
01765         *_pdwStubPhase = STUB_CALL_SERVER;
01766         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> RemoveFiles(
01767                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01768                handle,
01769                sFilenames);
01770
01771         *_pdwStubPhase = STUB_MARSHAL;
01772
01773         _StubMsg.BufferLength = 8;
01774         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01775         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01776         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01777
01778         }
01779     RpcFinally
01780         {
01781         }
01782     RpcEndFinally
01783     _pRpcMessage->BufferLength =
01784         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01785
01786 }
01787
01788
01789 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_RenameFile_Proxy(
01790     ICvsCoworker * This,
01791     /* [in] */ int handle,
01792     /* [string][in] */ const unsigned char *sOldFilename,
01793     /* [string][in] */ const unsigned char *sNewFilename)
01794 {
01795
01796     HRESULT _RetVal;
01797
01798     RPC_MESSAGE _RpcMessage;
01799
01800     MIDL_STUB_MESSAGE _StubMsg;
01801
01802     RpcTryExcept
01803         {
01804         NdrProxyInitialize(
01805                       ( void *  )This,
01806                       ( PRPC_MESSAGE  )&_RpcMessage,
01807                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01808                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01809                       13);
01810
01811
01812
01813         if(!sOldFilename)
01814             {
01815             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01816             }
01817         if(!sNewFilename)
01818             {
01819             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01820             }
01821         RpcTryFinally
01822             {
01823
01824             _StubMsg.BufferLength = 8;
01825             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01826                                            (unsigned char *)sOldFilename,
01827                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01828
01829             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01830                                            (unsigned char *)sNewFilename,
01831                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01832
01833             NdrProxyGetBuffer(This, &_StubMsg);
01834             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01835             *(( int * )_StubMsg.Buffer)++ = handle;
01836
01837             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01838                                          (unsigned char *)sOldFilename,
01839                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01840
01841             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01842                                          (unsigned char *)sNewFilename,
01843                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01844
01845             NdrProxySendReceive(This, &_StubMsg);
01846
01847             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
01848             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
01849
01850             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01851                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01852
01853             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01854
01855             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01856                 {
01857                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
01858                 }
01859             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
01860
01861             }
01862         RpcFinally
01863             {
01864             NdrProxyFreeBuffer(This, &_StubMsg);
01865
01866             }
01867         RpcEndFinally
01868
01869         }
01870     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01871         {
01872         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01873         }
01874     RpcEndExcept
01875     return _RetVal;
01876 }
01877
01878 void __RPC_STUB ICvsCoworker_RenameFile_Stub(
01879     IRpcStubBuffer *This,
01880     IRpcChannelBuffer *_pRpcChannelBuffer,
01881     PRPC_MESSAGE _pRpcMessage,
01882     DWORD *_pdwStubPhase)
01883 {
01884     HRESULT _RetVal;
01885     MIDL_STUB_MESSAGE _StubMsg;
01886     int handle;
01887     const unsigned char *sNewFilename;
01888     const unsigned char *sOldFilename;
01889
01890 NdrStubInitialize(
01891                      _pRpcMessage,
01892                      &_StubMsg,
01893                      &Object_StubDesc,
01894                      _pRpcChannelBuffer);
01895     handle = 0;
01896     ( unsigned char * )sOldFilename = 0;
01897     ( unsigned char * )sNewFilename = 0;
01898     RpcTryFinally
01899         {
01900         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01901             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01902
01903         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01904
01905         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01906             {
01907             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01908             }
01909         handle = *(( int * )_StubMsg.Buffer)++;
01910
01911         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01912                                        (unsigned char * *)&sOldFilename,
01913                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01914                                        (unsigned char)0 );
01915
01916         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01917                                        (unsigned char * *)&sNewFilename,
01918                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01919                                        (unsigned char)0 );
01920
01921
01922         *_pdwStubPhase = STUB_CALL_SERVER;
01923         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> RenameFile(
01924               (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01925               handle,
01926               sOldFilename,
01927               sNewFilename);
01928
01929         *_pdwStubPhase = STUB_MARSHAL;
01930
01931         _StubMsg.BufferLength = 8;
01932         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01933         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01934         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01935
01936         }
01937     RpcFinally
01938         {
01939         }
01940     RpcEndFinally
01941     _pRpcMessage->BufferLength =
01942         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01943
01944 }
01945
01946
01947 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_DiffFile_Proxy(
01948     ICvsCoworker * This,
01949     /* [in] */ int handle,
01950     /* [string][in] */ const unsigned char *sFilename,
01951     /* [in] */ BOOL bIgnoreCase,
01952     /* [in] */ BOOL bIgnoreBlanks)
01953 {
01954
01955     HRESULT _RetVal;
01956
01957     RPC_MESSAGE _RpcMessage;
01958
01959     MIDL_STUB_MESSAGE _StubMsg;
01960
01961     RpcTryExcept
01962         {
01963         NdrProxyInitialize(
01964                       ( void *  )This,
01965                       ( PRPC_MESSAGE  )&_RpcMessage,
01966                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01967                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01968                       14);
01969
01970
01971
01972         if(!sFilename)
01973             {
01974             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01975             }
01976         RpcTryFinally
01977             {
01978
01979             _StubMsg.BufferLength = 24;
01980             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01981                                            (unsigned char *)sFilename,
01982                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01983
01984             NdrProxyGetBuffer(This, &_StubMsg);
01985             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01986             *(( int * )_StubMsg.Buffer)++ = handle;
01987
01988             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01989                                          (unsigned char *)sFilename,
01990                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01991
01992             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01993             *(( BOOL * )_StubMsg.Buffer)++ = bIgnoreCase;
01994
01995             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01996             *(( BOOL * )_StubMsg.Buffer)++ = bIgnoreBlanks;
01997
01998             NdrProxySendReceive(This, &_StubMsg);
01999
02000             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02001             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02002
02003             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02004                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
02005
02006             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02007
02008             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02009                 {
02010                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02011                 }
02012             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02013
02014             }
02015         RpcFinally
02016             {
02017             NdrProxyFreeBuffer(This, &_StubMsg);
02018
02019             }
02020         RpcEndFinally
02021
02022         }
02023     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02024         {
02025         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02026         }
02027     RpcEndExcept
02028     return _RetVal;
02029 }
02030
02031 void __RPC_STUB ICvsCoworker_DiffFile_Stub(
02032     IRpcStubBuffer *This,
02033     IRpcChannelBuffer *_pRpcChannelBuffer,
02034     PRPC_MESSAGE _pRpcMessage,
02035     DWORD *_pdwStubPhase)
02036 {
02037     HRESULT _RetVal;
02038     MIDL_STUB_MESSAGE _StubMsg;
02039     BOOL bIgnoreBlanks;
02040     BOOL bIgnoreCase;
02041     int handle;
02042     const unsigned char *sFilename;
02043
02044 NdrStubInitialize(
02045                      _pRpcMessage,
02046                      &_StubMsg,
02047                      &Object_StubDesc,
02048                      _pRpcChannelBuffer);
02049     handle = 0;
02050     ( unsigned char * )sFilename = 0;
02051     bIgnoreCase = 0;
02052     bIgnoreBlanks = 0;
02053     RpcTryFinally
02054         {
02055         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02056             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
02057
02058         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02059
02060         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02061             {
02062             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02063             }
02064         handle = *(( int * )_StubMsg.Buffer)++;
02065
02066         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02067                                        (unsigned char * *)&sFilename,
02068                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02069                                        (unsigned char)0 );
02070
02071         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02072
02073         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02074             {
02075             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02076             }
02077         bIgnoreCase = *(( BOOL * )_StubMsg.Buffer)++;
02078
02079         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02080
02081         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02082             {
02083             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02084             }
02085         bIgnoreBlanks = *(( BOOL * )_StubMsg.Buffer)++;
02086
02087
02088         *_pdwStubPhase = STUB_CALL_SERVER;
02089         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> DiffFile(
02090             (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02091             handle,
02092             sFilename,
02093             bIgnoreCase,
02094             bIgnoreBlanks);
02095
02096         *_pdwStubPhase = STUB_MARSHAL;
02097
02098         _StubMsg.BufferLength = 8;
02099         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02100         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02101         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02102
02103         }
02104     RpcFinally
02105         {
02106         }
02107     RpcEndFinally
02108     _pRpcMessage->BufferLength =
02109         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02110
02111 }
02112
02113
02114 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileHistory_Proxy(
02115     ICvsCoworker * This,
02116     /* [in] */ int handle,
02117     /* [string][in] */ const unsigned char *sFilenames)
02118 {
02119
02120     HRESULT _RetVal;
02121
02122     RPC_MESSAGE _RpcMessage;
02123
02124     MIDL_STUB_MESSAGE _StubMsg;
02125
02126     RpcTryExcept
02127         {
02128         NdrProxyInitialize(
02129                       ( void *  )This,
02130                       ( PRPC_MESSAGE  )&_RpcMessage,
02131                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02132                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02133                       15);
02134
02135
02136
02137         if(!sFilenames)
02138             {
02139             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02140             }
02141         RpcTryFinally
02142             {
02143
02144             _StubMsg.BufferLength = 8;
02145             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02146                                            (unsigned char *)sFilenames,
02147                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02148
02149             NdrProxyGetBuffer(This, &_StubMsg);
02150             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02151             *(( int * )_StubMsg.Buffer)++ = handle;
02152
02153             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02154                                          (unsigned char *)sFilenames,
02155                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02156
02157             NdrProxySendReceive(This, &_StubMsg);
02158
02159             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02160             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02161
02162             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02163                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02164
02165             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02166
02167             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02168                 {
02169                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02170                 }
02171             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02172
02173             }
02174         RpcFinally
02175             {
02176             NdrProxyFreeBuffer(This, &_StubMsg);
02177
02178             }
02179         RpcEndFinally
02180
02181         }
02182     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02183         {
02184         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02185         }
02186     RpcEndExcept
02187     return _RetVal;
02188 }
02189
02190 void __RPC_STUB ICvsCoworker_ShowFileHistory_Stub(
02191     IRpcStubBuffer *This,
02192     IRpcChannelBuffer *_pRpcChannelBuffer,
02193     PRPC_MESSAGE _pRpcMessage,
02194     DWORD *_pdwStubPhase)
02195 {
02196     HRESULT _RetVal;
02197     MIDL_STUB_MESSAGE _StubMsg;
02198     int handle;
02199     const unsigned char *sFilenames;
02200
02201 NdrStubInitialize(
02202                      _pRpcMessage,
02203                      &_StubMsg,
02204                      &Object_StubDesc,
02205                      _pRpcChannelBuffer);
02206     handle = 0;
02207     ( unsigned char * )sFilenames = 0;
02208     RpcTryFinally
02209         {
02210         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02211             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02212
02213         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02214
02215         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02216             {
02217             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02218             }
02219         handle = *(( int * )_StubMsg.Buffer)++;
02220
02221         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02222                                        (unsigned char * *)&sFilenames,
02223                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02224                                        (unsigned char)0 );
02225
02226
02227         *_pdwStubPhase = STUB_CALL_SERVER;
02228         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowFileHistory(
02229                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02230                    handle,
02231                    sFilenames);
02232
02233         *_pdwStubPhase = STUB_MARSHAL;
02234
02235         _StubMsg.BufferLength = 8;
02236         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02237         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02238         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02239
02240         }
02241     RpcFinally
02242         {
02243         }
02244     RpcEndFinally
02245     _pRpcMessage->BufferLength =
02246         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02247
02248 }
02249
02250
02251 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileProperties_Proxy(
02252     ICvsCoworker * This,
02253     /* [in] */ int handle,
02254     /* [string][in] */ const unsigned char *sFilename)
02255 {
02256
02257     HRESULT _RetVal;
02258
02259     RPC_MESSAGE _RpcMessage;
02260
02261     MIDL_STUB_MESSAGE _StubMsg;
02262
02263     RpcTryExcept
02264         {
02265         NdrProxyInitialize(
02266                       ( void *  )This,
02267                       ( PRPC_MESSAGE  )&_RpcMessage,
02268                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02269                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02270                       16);
02271
02272
02273
02274         if(!sFilename)
02275             {
02276             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02277             }
02278         RpcTryFinally
02279             {
02280
02281             _StubMsg.BufferLength = 8;
02282             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02283                                            (unsigned char *)sFilename,
02284                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02285
02286             NdrProxyGetBuffer(This, &_StubMsg);
02287             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02288             *(( int * )_StubMsg.Buffer)++ = handle;
02289
02290             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02291                                          (unsigned char *)sFilename,
02292                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02293
02294             NdrProxySendReceive(This, &_StubMsg);
02295
02296             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02297             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02298
02299             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02300                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02301
02302             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02303
02304             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02305                 {
02306                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02307                 }
02308             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02309
02310             }
02311         RpcFinally
02312             {
02313             NdrProxyFreeBuffer(This, &_StubMsg);
02314
02315             }
02316         RpcEndFinally
02317
02318         }
02319     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02320         {
02321         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02322         }
02323     RpcEndExcept
02324     return _RetVal;
02325 }
02326
02327 void __RPC_STUB ICvsCoworker_ShowFileProperties_Stub(
02328     IRpcStubBuffer *This,
02329     IRpcChannelBuffer *_pRpcChannelBuffer,
02330     PRPC_MESSAGE _pRpcMessage,
02331     DWORD *_pdwStubPhase)
02332 {
02333     HRESULT _RetVal;
02334     MIDL_STUB_MESSAGE _StubMsg;
02335     int handle;
02336     const unsigned char *sFilename;
02337
02338 NdrStubInitialize(
02339                      _pRpcMessage,
02340                      &_StubMsg,
02341                      &Object_StubDesc,
02342                      _pRpcChannelBuffer);
02343     handle = 0;
02344     ( unsigned char * )sFilename = 0;
02345     RpcTryFinally
02346         {
02347         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02348             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02349
02350         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02351
02352         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02353             {
02354             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02355             }
02356         handle = *(( int * )_StubMsg.Buffer)++;
02357
02358         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02359                                        (unsigned char * *)&sFilename,
02360                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02361                                        (unsigned char)0 );
02362
02363
02364         *_pdwStubPhase = STUB_CALL_SERVER;
02365         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowFileProperties(
02366                       (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02367                       handle,
02368                       sFilename);
02369
02370         *_pdwStubPhase = STUB_MARSHAL;
02371
02372         _StubMsg.BufferLength = 8;
02373         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02374         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02375         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02376
02377         }
02378     RpcFinally
02379         {
02380         }
02381     RpcEndFinally
02382     _pRpcMessage->BufferLength =
02383         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02384
02385 }
02386
02387
02388 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowUserInterface_Proxy(
02389     ICvsCoworker * This,
02390     /* [in] */ int handle,
02391     /* [string][in] */ const unsigned char *sFilenames)
02392 {
02393
02394     HRESULT _RetVal;
02395
02396     RPC_MESSAGE _RpcMessage;
02397
02398     MIDL_STUB_MESSAGE _StubMsg;
02399
02400     RpcTryExcept
02401         {
02402         NdrProxyInitialize(
02403                       ( void *  )This,
02404                       ( PRPC_MESSAGE  )&_RpcMessage,
02405                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02406                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02407                       17);
02408
02409
02410
02411         if(!sFilenames)
02412             {
02413             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02414             }
02415         RpcTryFinally
02416             {
02417
02418             _StubMsg.BufferLength = 8;
02419             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02420                                            (unsigned char *)sFilenames,
02421                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02422
02423             NdrProxyGetBuffer(This, &_StubMsg);
02424             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02425             *(( int * )_StubMsg.Buffer)++ = handle;
02426
02427             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02428                                          (unsigned char *)sFilenames,
02429                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02430
02431             NdrProxySendReceive(This, &_StubMsg);
02432
02433             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02434             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02435
02436             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02437                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02438
02439             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02440
02441             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02442                 {
02443                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02444                 }
02445             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02446
02447             }
02448         RpcFinally
02449             {
02450             NdrProxyFreeBuffer(This, &_StubMsg);
02451
02452             }
02453         RpcEndFinally
02454
02455         }
02456     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02457         {
02458         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02459         }
02460     RpcEndExcept
02461     return _RetVal;
02462 }
02463
02464 void __RPC_STUB ICvsCoworker_ShowUserInterface_Stub(
02465     IRpcStubBuffer *This,
02466     IRpcChannelBuffer *_pRpcChannelBuffer,
02467     PRPC_MESSAGE _pRpcMessage,
02468     DWORD *_pdwStubPhase)
02469 {
02470     HRESULT _RetVal;
02471     MIDL_STUB_MESSAGE _StubMsg;
02472     int handle;
02473     const unsigned char *sFilenames;
02474
02475 NdrStubInitialize(
02476                      _pRpcMessage,
02477                      &_StubMsg,
02478                      &Object_StubDesc,
02479                      _pRpcChannelBuffer);
02480     handle = 0;
02481     ( unsigned char * )sFilenames = 0;
02482     RpcTryFinally
02483         {
02484         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02485             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02486
02487         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02488
02489         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02490             {
02491             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02492             }
02493         handle = *(( int * )_StubMsg.Buffer)++;
02494
02495         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02496                                        (unsigned char * *)&sFilenames,
02497                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02498                                        (unsigned char)0 );
02499
02500
02501         *_pdwStubPhase = STUB_CALL_SERVER;
02502         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowUserInterface(
02503                      (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02504                      handle,
02505                      sFilenames);
02506
02507         *_pdwStubPhase = STUB_MARSHAL;
02508
02509         _StubMsg.BufferLength = 8;
02510         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02511         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02512         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02513
02514         }
02515     RpcFinally
02516         {
02517         }
02518     RpcEndFinally
02519     _pRpcMessage->BufferLength =
02520         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02521
02522 }
02523
02524
02525 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_HasAdvancedOptionsForCommand_Proxy(
02526     ICvsCoworker * This,
02527     /* [in] */ int handle,
02528     /* [in] */ CvsCommand command,
02529     /* [retval][out] */ BOOL *pbAdvancedOptions)
02530 {
02531
02532     HRESULT _RetVal;
02533
02534     RPC_MESSAGE _RpcMessage;
02535
02536     MIDL_STUB_MESSAGE _StubMsg;
02537
02538     RpcTryExcept
02539         {
02540         NdrProxyInitialize(
02541                       ( void *  )This,
02542                       ( PRPC_MESSAGE  )&_RpcMessage,
02543                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02544                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02545                       18);
02546
02547
02548
02549         if(!pbAdvancedOptions)
02550             {
02551             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02552             }
02553         RpcTryFinally
02554             {
02555
02556             _StubMsg.BufferLength = 14;
02557             NdrProxyGetBuffer(This, &_StubMsg);
02558             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02559             *(( int * )_StubMsg.Buffer)++ = handle;
02560
02561             NdrSimpleTypeMarshall(
02562                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02563                          ( unsigned char * )&command,
02564                          13);
02565             NdrProxySendReceive(This, &_StubMsg);
02566
02567             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02568             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02569
02570             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02571                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[110] );
02572
02573             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02574             *pbAdvancedOptions = *(( BOOL * )_StubMsg.Buffer)++;
02575
02576             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02577
02578             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02579                 {
02580                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02581                 }
02582             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02583
02584             }
02585         RpcFinally
02586             {
02587             NdrProxyFreeBuffer(This, &_StubMsg);
02588
02589             }
02590         RpcEndFinally
02591
02592         }
02593     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02594         {
02595         NdrClearOutParameters(
02596                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02597                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
02598                          ( void * )pbAdvancedOptions);
02599         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02600         }
02601     RpcEndExcept
02602     return _RetVal;
02603 }
02604
02605 void __RPC_STUB ICvsCoworker_HasAdvancedOptionsForCommand_Stub(
02606     IRpcStubBuffer *This,
02607     IRpcChannelBuffer *_pRpcChannelBuffer,
02608     PRPC_MESSAGE _pRpcMessage,
02609     DWORD *_pdwStubPhase)
02610 {
02611     BOOL _M42   =   0;
02612     HRESULT _RetVal;
02613     MIDL_STUB_MESSAGE _StubMsg;
02614     CvsCommand command;
02615     int handle;
02616     BOOL *pbAdvancedOptions;
02617
02618 NdrStubInitialize(
02619                      _pRpcMessage,
02620                      &_StubMsg,
02621                      &Object_StubDesc,
02622                      _pRpcChannelBuffer);
02623     handle = 0;
02624     command = 0;
02625     ( BOOL * )pbAdvancedOptions = 0;
02626     RpcTryFinally
02627         {
02628         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02629             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[110] );
02630
02631         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02632
02633         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02634             {
02635             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02636             }
02637         handle = *(( int * )_StubMsg.Buffer)++;
02638
02639         NdrSimpleTypeUnmarshall(
02640                            ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02641                            ( unsigned char * )&command,
02642                            13);
02643         pbAdvancedOptions = &_M42;
02644
02645         *_pdwStubPhase = STUB_CALL_SERVER;
02646         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> HasAdvancedOptionsForCommand(
02647                                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02648                                 handle,
02649                                 command,
02650                                 pbAdvancedOptions);
02651
02652         *_pdwStubPhase = STUB_MARSHAL;
02653
02654         _StubMsg.BufferLength = 36;
02655         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02656         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02657         *(( BOOL * )_StubMsg.Buffer)++ = *pbAdvancedOptions;
02658
02659         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02660         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02661
02662         }
02663     RpcFinally
02664         {
02665         }
02666     RpcEndFinally
02667     _pRpcMessage->BufferLength =
02668         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02669
02670 }
02671
02672
02673 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy(
02674     ICvsCoworker * This,
02675     /* [in] */ int handle,
02676     /* [in] */ CvsCommand command)
02677 {
02678
02679     HRESULT _RetVal;
02680
02681     RPC_MESSAGE _RpcMessage;
02682
02683     MIDL_STUB_MESSAGE _StubMsg;
02684
02685     RpcTryExcept
02686         {
02687         NdrProxyInitialize(
02688                       ( void *  )This,
02689                       ( PRPC_MESSAGE  )&_RpcMessage,
02690                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02691                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02692                       19);
02693
02694
02695
02696         RpcTryFinally
02697             {
02698
02699             _StubMsg.BufferLength = 14;
02700             NdrProxyGetBuffer(This, &_StubMsg);
02701             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02702             *(( int * )_StubMsg.Buffer)++ = handle;
02703
02704             NdrSimpleTypeMarshall(
02705                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02706                          ( unsigned char * )&command,
02707                          13);
02708             NdrProxySendReceive(This, &_StubMsg);
02709
02710             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02711             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02712
02713             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02714                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[120] );
02715
02716             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02717
02718             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02719                 {
02720                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02721                 }
02722             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02723
02724             }
02725         RpcFinally
02726             {
02727             NdrProxyFreeBuffer(This, &_StubMsg);
02728
02729             }
02730         RpcEndFinally
02731
02732         }
02733     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02734         {
02735         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02736         }
02737     RpcEndExcept
02738     return _RetVal;
02739 }
02740
02741 void __RPC_STUB ICvsCoworker_ShowAdvancedOptionsForCommand_Stub(
02742     IRpcStubBuffer *This,
02743     IRpcChannelBuffer *_pRpcChannelBuffer,
02744     PRPC_MESSAGE _pRpcMessage,
02745     DWORD *_pdwStubPhase)
02746 {
02747     HRESULT _RetVal;
02748     MIDL_STUB_MESSAGE _StubMsg;
02749     CvsCommand command;
02750     int handle;
02751
02752 NdrStubInitialize(
02753                      _pRpcMessage,
02754                      &_StubMsg,
02755                      &Object_StubDesc,
02756                      _pRpcChannelBuffer);
02757     handle = 0;
02758     command = 0;
02759     RpcTryFinally
02760         {
02761         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02762             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[120] );
02763
02764         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02765
02766         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02767             {
02768             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02769             }
02770         handle = *(( int * )_StubMsg.Buffer)++;
02771
02772         NdrSimpleTypeUnmarshall(
02773                            ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02774                            ( unsigned char * )&command,
02775                            13);
02776
02777         *_pdwStubPhase = STUB_CALL_SERVER;
02778         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowAdvancedOptionsForCommand(
02779                                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02780                                  handle,
02781                                  command);
02782
02783         *_pdwStubPhase = STUB_MARSHAL;
02784
02785         _StubMsg.BufferLength = 8;
02786         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02787         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02788         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02789
02790         }
02791     RpcFinally
02792         {
02793         }
02794     RpcEndFinally
02795     _pRpcMessage->BufferLength =
02796         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02797
02798 }
02799
02800
02801 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFileChanges_Proxy(
02802     ICvsCoworker * This,
02803     /* [in] */ int handle,
02804     /* [in] */ int cbFilenameBuffer,
02805     /* [size_is][string][out] */ unsigned char *sFilenameBuffer)
02806 {
02807
02808     HRESULT _RetVal;
02809
02810     RPC_MESSAGE _RpcMessage;
02811
02812     MIDL_STUB_MESSAGE _StubMsg;
02813
02814     RpcTryExcept
02815         {
02816         NdrProxyInitialize(
02817                       ( void *  )This,
02818                       ( PRPC_MESSAGE  )&_RpcMessage,
02819                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02820                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02821                       20);
02822
02823
02824
02825         if(!sFilenameBuffer)
02826             {
02827             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02828             }
02829         RpcTryFinally
02830             {
02831
02832             _StubMsg.BufferLength = 16;
02833             NdrProxyGetBuffer(This, &_StubMsg);
02834             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02835             *(( int * )_StubMsg.Buffer)++ = handle;
02836
02837             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02838             *(( int * )_StubMsg.Buffer)++ = cbFilenameBuffer;
02839
02840             NdrProxySendReceive(This, &_StubMsg);
02841
02842             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02843             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02844
02845             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02846                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[126] );
02847
02848             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02849                                            (unsigned char * *)&sFilenameBuffer,
02850                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48],
02851                                            (unsigned char)0 );
02852
02853             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02854
02855             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02856                 {
02857                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02858                 }
02859             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02860
02861             }
02862         RpcFinally
02863             {
02864             NdrProxyFreeBuffer(This, &_StubMsg);
02865
02866             }
02867         RpcEndFinally
02868
02869         }
02870     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02871         {
02872         _StubMsg.MaxCount = ( unsigned long  )cbFilenameBuffer;
02873
02874         NdrClearOutParameters(
02875                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02876                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[44],
02877                          ( void * )sFilenameBuffer);
02878         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02879         }
02880     RpcEndExcept
02881     return _RetVal;
02882 }
02883
02884 void __RPC_STUB ICvsCoworker_GetFileChanges_Stub(
02885     IRpcStubBuffer *This,
02886     IRpcChannelBuffer *_pRpcChannelBuffer,
02887     PRPC_MESSAGE _pRpcMessage,
02888     DWORD *_pdwStubPhase)
02889 {
02890     HRESULT _RetVal;
02891     MIDL_STUB_MESSAGE _StubMsg;
02892     int cbFilenameBuffer;
02893     int handle;
02894     unsigned char *sFilenameBuffer;
02895
02896 NdrStubInitialize(
02897                      _pRpcMessage,
02898                      &_StubMsg,
02899                      &Object_StubDesc,
02900                      _pRpcChannelBuffer);
02901     handle = 0;
02902     cbFilenameBuffer = 0;
02903     ( unsigned char * )sFilenameBuffer = 0;
02904     RpcTryFinally
02905         {
02906         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02907             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[126] );
02908
02909         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02910
02911         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02912             {
02913             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02914             }
02915         handle = *(( int * )_StubMsg.Buffer)++;
02916
02917         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02918
02919         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02920             {
02921             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02922             }
02923         cbFilenameBuffer = *(( int * )_StubMsg.Buffer)++;
02924
02925         if(cbFilenameBuffer * 1 < 0)
02926             {
02927             RpcRaiseException(RPC_X_INVALID_BOUND);
02928             }
02929         sFilenameBuffer = NdrAllocate(&_StubMsg,cbFilenameBuffer * 1);
02930
02931         *_pdwStubPhase = STUB_CALL_SERVER;
02932         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetFileChanges(
02933                   (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02934                   handle,
02935                   cbFilenameBuffer,
02936                   sFilenameBuffer);
02937
02938         *_pdwStubPhase = STUB_MARSHAL;
02939
02940         _StubMsg.BufferLength = 8;
02941         _StubMsg.MaxCount = ( unsigned long  )cbFilenameBuffer;
02942
02943         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02944                                        (unsigned char *)sFilenameBuffer,
02945                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48] );
02946
02947         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02948         _StubMsg.MaxCount = ( unsigned long  )cbFilenameBuffer;
02949
02950         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02951                                      (unsigned char *)sFilenameBuffer,
02952                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48] );
02953
02954         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02955         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02956
02957         }
02958     RpcFinally
02959         {
02960         _StubMsg.MaxCount = ( unsigned long  )cbFilenameBuffer;
02961
02962         NdrPointerFree( &_StubMsg,
02963                         (unsigned char *)sFilenameBuffer,
02964                         &__MIDL_TypeFormatString.Format[44] );
02965
02966         }
02967     RpcEndFinally
02968     _pRpcMessage->BufferLength =
02969         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02970
02971 }
02972
02973
02974 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFilesToAdd_Proxy(
02975     ICvsCoworker * This,
02976     /* [in] */ int handle,
02977     /* [in] */ int cbFilenamesBuffer,
02978     /* [size_is][string][out] */ unsigned char *sFilenamesBuffer)
02979 {
02980
02981     HRESULT _RetVal;
02982
02983     RPC_MESSAGE _RpcMessage;
02984
02985     MIDL_STUB_MESSAGE _StubMsg;
02986
02987     RpcTryExcept
02988         {
02989         NdrProxyInitialize(
02990                       ( void *  )This,
02991                       ( PRPC_MESSAGE  )&_RpcMessage,
02992                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02993                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02994                       21);
02995
02996
02997
02998         if(!sFilenamesBuffer)
02999             {
03000             RpcRaiseException(RPC_X_NULL_REF_POINTER);
03001             }
03002         RpcTryFinally
03003             {
03004
03005             _StubMsg.BufferLength = 16;
03006             NdrProxyGetBuffer(This, &_StubMsg);
03007             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03008             *(( int * )_StubMsg.Buffer)++ = handle;
03009
03010             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03011             *(( int * )_StubMsg.Buffer)++ = cbFilenamesBuffer;
03012
03013             NdrProxySendReceive(This, &_StubMsg);
03014
03015             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
03016             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
03017
03018             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
03019                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[136] );
03020
03021             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
03022                                            (unsigned char * *)&sFilenamesBuffer,
03023                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58],
03024                                            (unsigned char)0 );
03025
03026             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03027
03028             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
03029                 {
03030                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
03031                 }
03032             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
03033
03034             }
03035         RpcFinally
03036             {
03037             NdrProxyFreeBuffer(This, &_StubMsg);
03038
03039             }
03040         RpcEndFinally
03041
03042         }
03043     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
03044         {
03045         _StubMsg.MaxCount = ( unsigned long  )cbFilenamesBuffer;
03046
03047         NdrClearOutParameters(
03048                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
03049                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[54],
03050                          ( void * )sFilenamesBuffer);
03051         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
03052         }
03053     RpcEndExcept
03054     return _RetVal;
03055 }
03056
03057 void __RPC_STUB ICvsCoworker_GetFilesToAdd_Stub(
03058     IRpcStubBuffer *This,
03059     IRpcChannelBuffer *_pRpcChannelBuffer,
03060     PRPC_MESSAGE _pRpcMessage,
03061     DWORD *_pdwStubPhase)
03062 {
03063     HRESULT _RetVal;
03064     MIDL_STUB_MESSAGE _StubMsg;
03065     int cbFilenamesBuffer;
03066     int handle;
03067     unsigned char *sFilenamesBuffer;
03068
03069 NdrStubInitialize(
03070                      _pRpcMessage,
03071                      &_StubMsg,
03072                      &Object_StubDesc,
03073                      _pRpcChannelBuffer);
03074     handle = 0;
03075     cbFilenamesBuffer = 0;
03076     ( unsigned char * )sFilenamesBuffer = 0;
03077     RpcTryFinally
03078         {
03079         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
03080             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[136] );
03081
03082         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03083
03084         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
03085             {
03086             RpcRaiseException(RPC_X_BAD_STUB_DATA);
03087             }
03088         handle = *(( int * )_StubMsg.Buffer)++;
03089
03090         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03091
03092         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
03093             {
03094             RpcRaiseException(RPC_X_BAD_STUB_DATA);
03095             }
03096         cbFilenamesBuffer = *(( int * )_StubMsg.Buffer)++;
03097
03098         if(cbFilenamesBuffer * 1 < 0)
03099             {
03100             RpcRaiseException(RPC_X_INVALID_BOUND);
03101             }
03102         sFilenamesBuffer = NdrAllocate(&_StubMsg,cbFilenamesBuffer * 1);
03103
03104         *_pdwStubPhase = STUB_CALL_SERVER;
03105         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetFilesToAdd(
03106                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
03107                  handle,
03108                  cbFilenamesBuffer,
03109                  sFilenamesBuffer);
03110
03111         *_pdwStubPhase = STUB_MARSHAL;
03112
03113         _StubMsg.BufferLength = 8;
03114         _StubMsg.MaxCount = ( unsigned long  )cbFilenamesBuffer;
03115
03116         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
03117                                        (unsigned char *)sFilenamesBuffer,
03118                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58] );
03119
03120         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
03121         _StubMsg.MaxCount = ( unsigned long  )cbFilenamesBuffer;
03122
03123         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
03124                                      (unsigned char *)sFilenamesBuffer,
03125                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58] );
03126
03127         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03128         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
03129
03130         }
03131     RpcFinally
03132         {
03133         _StubMsg.MaxCount = ( unsigned long  )cbFilenamesBuffer;
03134
03135         NdrPointerFree( &_StubMsg,
03136                         (unsigned char *)sFilenamesBuffer,
03137                         &__MIDL_TypeFormatString.Format[54] );
03138
03139         }
03140     RpcEndFinally
03141     _pRpcMessage->BufferLength =
03142         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
03143
03144 }
03145
03146
03147 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_CloseProject_Proxy(
03148     ICvsCoworker * This,
03149     /* [in] */ int handle)
03150 {
03151
03152     HRESULT _RetVal;
03153
03154     RPC_MESSAGE _RpcMessage;
03155
03156     MIDL_STUB_MESSAGE _StubMsg;
03157
03158     RpcTryExcept
03159         {
03160         NdrProxyInitialize(
03161                       ( void *  )This,
03162                       ( PRPC_MESSAGE  )&_RpcMessage,
03163                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
03164                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
03165                       22);
03166
03167
03168
03169         RpcTryFinally
03170             {
03171
03172             _StubMsg.BufferLength = 8;
03173             NdrProxyGetBuffer(This, &_StubMsg);
03174             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03175             *(( int * )_StubMsg.Buffer)++ = handle;
03176
03177             NdrProxySendReceive(This, &_StubMsg);
03178
03179             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
03180             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
03181
03182             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
03183                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[146] );
03184
03185             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03186
03187             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
03188                 {
03189                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
03190                 }
03191             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
03192
03193             }
03194         RpcFinally
03195             {
03196             NdrProxyFreeBuffer(This, &_StubMsg);
03197
03198             }
03199         RpcEndFinally
03200
03201         }
03202     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
03203         {
03204         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
03205         }
03206     RpcEndExcept
03207     return _RetVal;
03208 }
03209
03210 void __RPC_STUB ICvsCoworker_CloseProject_Stub(
03211     IRpcStubBuffer *This,
03212     IRpcChannelBuffer *_pRpcChannelBuffer,
03213     PRPC_MESSAGE _pRpcMessage,
03214     DWORD *_pdwStubPhase)
03215 {
03216     HRESULT _RetVal;
03217     MIDL_STUB_MESSAGE _StubMsg;
03218     int handle;
03219
03220 NdrStubInitialize(
03221                      _pRpcMessage,
03222                      &_StubMsg,
03223                      &Object_StubDesc,
03224                      _pRpcChannelBuffer);
03225     handle = 0;
03226     RpcTryFinally
03227         {
03228         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
03229             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[146] );
03230
03231         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03232
03233         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
03234             {
03235             RpcRaiseException(RPC_X_BAD_STUB_DATA);
03236             }
03237         handle = *(( int * )_StubMsg.Buffer)++;
03238
03239
03240         *_pdwStubPhase = STUB_CALL_SERVER;
03241         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CloseProject((ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,handle);
03242
03243         *_pdwStubPhase = STUB_MARSHAL;
03244
03245         _StubMsg.BufferLength = 8;
03246         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
03247         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03248         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
03249
03250         }
03251     RpcFinally
03252         {
03253         }
03254     RpcEndFinally
03255     _pRpcMessage->BufferLength =
03256         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
03257
03258 }
03259
03260
03261
03262 #if !defined(__RPC_WIN32__)
03263 #error  Invalid build platform for this stub.
03264 #endif
03265
03266 static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
03267     {
03268         0,
03269         {
03270             0x4e,       /* FC_IN_PARAM_BASETYPE */
03271             0x8,        /* FC_LONG */
03272 /*  2 */
03273             0x51,       /* FC_OUT_PARAM */
03274             0x1,        /* x86 stack size = 1 */
03275 /*  4 */    NdrFcShort( 0x2 ),  /* Type Offset=2 */
03276 /*  6 */    0x53,       /* FC_RETURN_PARAM_BASETYPE */
03277             0x8,        /* FC_LONG */
03278 /*  8 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03279             0x8,        /* FC_LONG */
03280 /* 10 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03281             0x8,        /* FC_LONG */
03282 /* 12 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03283             0x8,        /* FC_LONG */
03284 /* 14 */
03285             0x51,       /* FC_OUT_PARAM */
03286             0x1,        /* x86 stack size = 1 */
03287 /* 16 */    NdrFcShort( 0x6 ),  /* Type Offset=6 */
03288 /* 18 */    0x53,       /* FC_RETURN_PARAM_BASETYPE */
03289             0x8,        /* FC_LONG */
03290 /* 20 */
03291             0x51,       /* FC_OUT_PARAM */
03292             0x1,        /* x86 stack size = 1 */
03293 /* 22 */    NdrFcShort( 0x2 ),  /* Type Offset=2 */
03294 /* 24 */
03295             0x4d,       /* FC_IN_PARAM */
03296             0x1,        /* x86 stack size = 1 */
03297 /* 26 */    NdrFcShort( 0x10 ), /* Type Offset=16 */
03298 /* 28 */
03299             0x4d,       /* FC_IN_PARAM */
03300             0x1,        /* x86 stack size = 1 */
03301 /* 30 */    NdrFcShort( 0x10 ), /* Type Offset=16 */
03302 /* 32 */
03303             0x4d,       /* FC_IN_PARAM */
03304             0x1,        /* x86 stack size = 1 */
03305 /* 34 */    NdrFcShort( 0x10 ), /* Type Offset=16 */
03306 /* 36 */    0x53,       /* FC_RETURN_PARAM_BASETYPE */
03307             0x8,        /* FC_LONG */
03308 /* 38 */
03309             0x51,       /* FC_OUT_PARAM */
03310             0x1,        /* x86 stack size = 1 */
03311 /* 40 */    NdrFcShort( 0x2 ),  /* Type Offset=2 */
03312 /* 42 */
03313             0x4d,       /* FC_IN_PARAM */
03314             0x1,        /* x86 stack size = 1 */
03315 /* 44 */    NdrFcShort( 0x14 ), /* Type Offset=20 */
03316 /* 46 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03317             0x8,        /* FC_LONG */
03318 /* 48 */
03319             0x50,       /* FC_IN_OUT_PARAM */
03320             0x1,        /* x86 stack size = 1 */
03321 /* 50 */    NdrFcShort( 0x18 ), /* Type Offset=24 */
03322 /* 52 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03323             0x8,        /* FC_LONG */
03324 /* 54 */
03325             0x50,       /* FC_IN_OUT_PARAM */
03326             0x1,        /* x86 stack size = 1 */
03327 /* 56 */    NdrFcShort( 0x22 ), /* Type Offset=34 */
03328 /* 58 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03329             0x8,        /* FC_LONG */
03330 /* 60 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03331             0x8,        /* FC_LONG */
03332 /* 62 */
03333             0x51,       /* FC_OUT_PARAM */
03334             0x1,        /* x86 stack size = 1 */
03335 /* 64 */    NdrFcShort( 0x2 ),  /* Type Offset=2 */
03336 /* 66 */    0x53,       /* FC_RETURN_PARAM_BASETYPE */
03337             0x8,        /* FC_LONG */
03338 /* 68 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03339             0x8,        /* FC_LONG */
03340 /* 70 */
03341             0x4d,       /* FC_IN_PARAM */
03342             0x1,        /* x86 stack size = 1 */
03343 /* 72 */    NdrFcShort( 0x10 ), /* Type Offset=16 */
03344 /* 74 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03345             0x8,        /* FC_LONG */
03346 /* 76 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03347             0x8,        /* FC_LONG */
03348 /* 78 */    0x53,       /* FC_RETURN_PARAM_BASETYPE */
03349             0x8,        /* FC_LONG */
03350 /* 80 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03351             0x8,        /* FC_LONG */
03352 /* 82 */
03353             0x4d,       /* FC_IN_PARAM */
03354             0x1,        /* x86 stack size = 1 */
03355 /* 84 */    NdrFcShort( 0x10 ), /* Type Offset=16 */
03356 /* 86 */    0x53,       /* FC_RETURN_PARAM_BASETYPE */
03357             0x8,        /* FC_LONG */
03358 /* 88 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03359             0x8,        /* FC_LONG */
03360 /* 90 */
03361             0x4d,       /* FC_IN_PARAM */
03362             0x1,        /* x86 stack size = 1 */
03363 /* 92 */    NdrFcShort( 0x10 ), /* Type Offset=16 */
03364 /* 94 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03365             0x8,        /* FC_LONG */
03366 /* 96 */    0x53,       /* FC_RETURN_PARAM_BASETYPE */
03367             0x8,        /* FC_LONG */
03368 /* 98 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03369             0x8,        /* FC_LONG */
03370 /* 100 */
03371             0x4d,       /* FC_IN_PARAM */
03372             0x1,        /* x86 stack size = 1 */
03373 /* 102 */   NdrFcShort( 0x10 ), /* Type Offset=16 */
03374 /* 104 */
03375             0x4d,       /* FC_IN_PARAM */
03376             0x1,        /* x86 stack size = 1 */
03377 /* 106 */   NdrFcShort( 0x10 ), /* Type Offset=16 */
03378 /* 108 */   0x53,       /* FC_RETURN_PARAM_BASETYPE */
03379             0x8,        /* FC_LONG */
03380 /* 110 */   0x4e,       /* FC_IN_PARAM_BASETYPE */
03381             0x8,        /* FC_LONG */
03382 /* 112 */   0x4e,       /* FC_IN_PARAM_BASETYPE */
03383             0xd,        /* FC_ENUM16 */
03384 /* 114 */
03385             0x51,       /* FC_OUT_PARAM */
03386             0x1,        /* x86 stack size = 1 */
03387 /* 116 */   NdrFcShort( 0x2 ),  /* Type Offset=2 */
03388 /* 118 */   0x53,       /* FC_RETURN_PARAM_BASETYPE */
03389             0x8,        /* FC_LONG */
03390 /* 120 */   0x4e,       /* FC_IN_PARAM_BASETYPE */
03391             0x8,        /* FC_LONG */
03392 /* 122 */   0x4e,       /* FC_IN_PARAM_BASETYPE */
03393             0xd,        /* FC_ENUM16 */
03394 /* 124 */   0x53,       /* FC_RETURN_PARAM_BASETYPE */
03395             0x8,        /* FC_LONG */
03396 /* 126 */   0x4e,       /* FC_IN_PARAM_BASETYPE */
03397             0x8,        /* FC_LONG */
03398 /* 128 */   0x4e,       /* FC_IN_PARAM_BASETYPE */
03399             0x8,        /* FC_LONG */
03400 /* 130 */
03401             0x51,       /* FC_OUT_PARAM */
03402             0x1,        /* x86 stack size = 1 */
03403 /* 132 */   NdrFcShort( 0x2c ), /* Type Offset=44 */
03404 /* 134 */   0x53,       /* FC_RETURN_PARAM_BASETYPE */
03405             0x8,        /* FC_LONG */
03406 /* 136 */   0x4e,       /* FC_IN_PARAM_BASETYPE */
03407             0x8,        /* FC_LONG */
03408 /* 138 */   0x4e,       /* FC_IN_PARAM_BASETYPE */
03409             0x8,        /* FC_LONG */
03410 /* 140 */
03411             0x51,       /* FC_OUT_PARAM */
03412             0x1,        /* x86 stack size = 1 */
03413 /* 142 */   NdrFcShort( 0x36 ), /* Type Offset=54 */
03414 /* 144 */   0x53,       /* FC_RETURN_PARAM_BASETYPE */
03415             0x8,        /* FC_LONG */
03416 /* 146 */   0x4e,       /* FC_IN_PARAM_BASETYPE */
03417             0x8,        /* FC_LONG */
03418 /* 148 */   0x53,       /* FC_RETURN_PARAM_BASETYPE */
03419             0x8,        /* FC_LONG */
03420
03421             0x0
03422         }
03423     };
03424
03425 static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
03426     {
03427         0,
03428         {
03429             NdrFcShort( 0x0 ),  /* 0 */
03430 /*  2 */
03431             0x11, 0xc,  /* FC_RP [alloced_on_stack] [simple_pointer] */
03432 /*  4 */    0x8,        /* FC_LONG */
03433             0x5c,       /* FC_PAD */
03434 /*  6 */
03435             0x11, 0x0,  /* FC_RP */
03436 /*  8 */    NdrFcShort( 0x2 ),  /* Offset= 2 (10) */
03437 /* 10 */
03438             0x22,       /* FC_C_CSTRING */
03439             0x44,       /* FC_STRING_SIZED */
03440 /* 12 */    0x28,       /* Corr desc:  parameter, FC_LONG */
03441             0x0,        /*  */
03442 /* 14 */    NdrFcShort( 0xc ),  /* x86 Stack size/offset = 12 */
03443 /* 16 */
03444             0x11, 0x8,  /* FC_RP [simple_pointer] */
03445 /* 18 */
03446             0x22,       /* FC_C_CSTRING */
03447             0x5c,       /* FC_PAD */
03448 /* 20 */
03449             0x11, 0x8,  /* FC_RP [simple_pointer] */
03450 /* 22 */    0x2,        /* FC_CHAR */
03451             0x5c,       /* FC_PAD */
03452 /* 24 */
03453             0x11, 0x0,  /* FC_RP */
03454 /* 26 */    NdrFcShort( 0x2 ),  /* Offset= 2 (28) */
03455 /* 28 */
03456             0x22,       /* FC_C_CSTRING */
03457             0x44,       /* FC_STRING_SIZED */
03458 /* 30 */    0x28,       /* Corr desc:  parameter, FC_LONG */
03459             0x0,        /*  */
03460 /* 32 */    NdrFcShort( 0xc ),  /* x86 Stack size/offset = 12 */
03461 /* 34 */
03462             0x11, 0x0,  /* FC_RP */
03463 /* 36 */    NdrFcShort( 0x2 ),  /* Offset= 2 (38) */
03464 /* 38 */
03465             0x22,       /* FC_C_CSTRING */
03466             0x44,       /* FC_STRING_SIZED */
03467 /* 40 */    0x28,       /* Corr desc:  parameter, FC_LONG */
03468             0x0,        /*  */
03469 /* 42 */    NdrFcShort( 0x14 ), /* x86 Stack size/offset = 20 */
03470 /* 44 */
03471             0x11, 0x0,  /* FC_RP */
03472 /* 46 */    NdrFcShort( 0x2 ),  /* Offset= 2 (48) */
03473 /* 48 */
03474             0x22,       /* FC_C_CSTRING */
03475             0x44,       /* FC_STRING_SIZED */
03476 /* 50 */    0x28,       /* Corr desc:  parameter, FC_LONG */
03477             0x0,        /*  */
03478 /* 52 */    NdrFcShort( 0x8 ),  /* x86 Stack size/offset = 8 */
03479 /* 54 */
03480             0x11, 0x0,  /* FC_RP */
03481 /* 56 */    NdrFcShort( 0x2 ),  /* Offset= 2 (58) */
03482 /* 58 */
03483             0x22,       /* FC_C_CSTRING */
03484             0x44,       /* FC_STRING_SIZED */
03485 /* 60 */    0x28,       /* Corr desc:  parameter, FC_LONG */
03486             0x0,        /*  */
03487 /* 62 */    NdrFcShort( 0x8 ),  /* x86 Stack size/offset = 8 */
03488
03489             0x0
03490         }
03491     };
03492
03493
03494 /* Standard interface: __MIDL_itf_CVS_Coworker_0000, ver. 0.0,
03495    GUID={0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} */
03496
03497
03498 /* Object interface: IUnknown, ver. 0.0,
03499    GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
03500
03501
03502 /* Object interface: ICvsCoworker, ver. 0.0,
03503    GUID={0x10E5359C,0xF454,0x11D2,{0xB4,0x42,0x00,0x80,0xC6,0xF9,0x17,0x9D}} */
03504
03505 #pragma code_seg(".orpc")
03506 static const unsigned short ICvsCoworker_FormatStringOffsetTable[] =
03507     {
03508     0,
03509     8,
03510     20,
03511     38,
03512     68,
03513     80,
03514     88,
03515     80,
03516     98,
03517     80,
03518     98,
03519     68,
03520     80,
03521     80,
03522     80,
03523     110,
03524     120,
03525     126,
03526     136,
03527     146
03528     };
03529
03530 static const MIDL_STUBLESS_PROXY_INFO ICvsCoworker_ProxyInfo =
03531     {
03532     &Object_StubDesc,
03533     __MIDL_ProcFormatString.Format,
03534     &ICvsCoworker_FormatStringOffsetTable[-3],
03535     0,
03536     0,
03537     0
03538     };
03539
03540
03541 static const MIDL_SERVER_INFO ICvsCoworker_ServerInfo =
03542     {
03543     &Object_StubDesc,
03544     0,
03545     __MIDL_ProcFormatString.Format,
03546     &ICvsCoworker_FormatStringOffsetTable[-3],
03547     0,
03548     0,
03549     0,
03550     0};
03551 const CINTERFACE_PROXY_VTABLE(23) _ICvsCoworkerProxyVtbl =
03552 {
03553     &IID_ICvsCoworker,
03554     IUnknown_QueryInterface_Proxy,
03555     IUnknown_AddRef_Proxy,
03556     IUnknown_Release_Proxy ,
03557     ICvsCoworker_GetLastError_Proxy ,
03558     ICvsCoworker_GetErrorMessage_Proxy ,
03559     ICvsCoworker_OpenProject_Proxy ,
03560     ICvsCoworker_GetProject_Proxy ,
03561     ICvsCoworker_UpdateFiles_Proxy ,
03562     ICvsCoworker_CheckoutFiles_Proxy ,
03563     ICvsCoworker_CheckinFiles_Proxy ,
03564     ICvsCoworker_UncheckoutFiles_Proxy ,
03565     ICvsCoworker_AddFiles_Proxy ,
03566     ICvsCoworker_RemoveFiles_Proxy ,
03567     ICvsCoworker_RenameFile_Proxy ,
03568     ICvsCoworker_DiffFile_Proxy ,
03569     ICvsCoworker_ShowFileHistory_Proxy ,
03570     ICvsCoworker_ShowFileProperties_Proxy ,
03571     ICvsCoworker_ShowUserInterface_Proxy ,
03572     ICvsCoworker_HasAdvancedOptionsForCommand_Proxy ,
03573     ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy ,
03574     ICvsCoworker_GetFileChanges_Proxy ,
03575     ICvsCoworker_GetFilesToAdd_Proxy ,
03576     ICvsCoworker_CloseProject_Proxy
03577 };
03578
03579
03580 static const PRPC_STUB_FUNCTION ICvsCoworker_table[] =
03581 {
03582     ICvsCoworker_GetLastError_Stub,
03583     ICvsCoworker_GetErrorMessage_Stub,
03584     ICvsCoworker_OpenProject_Stub,
03585     ICvsCoworker_GetProject_Stub,
03586     ICvsCoworker_UpdateFiles_Stub,
03587     ICvsCoworker_CheckoutFiles_Stub,
03588     ICvsCoworker_CheckinFiles_Stub,
03589     ICvsCoworker_UncheckoutFiles_Stub,
03590     ICvsCoworker_AddFiles_Stub,
03591     ICvsCoworker_RemoveFiles_Stub,
03592     ICvsCoworker_RenameFile_Stub,
03593     ICvsCoworker_DiffFile_Stub,
03594     ICvsCoworker_ShowFileHistory_Stub,
03595     ICvsCoworker_ShowFileProperties_Stub,
03596     ICvsCoworker_ShowUserInterface_Stub,
03597     ICvsCoworker_HasAdvancedOptionsForCommand_Stub,
03598     ICvsCoworker_ShowAdvancedOptionsForCommand_Stub,
03599     ICvsCoworker_GetFileChanges_Stub,
03600     ICvsCoworker_GetFilesToAdd_Stub,
03601     ICvsCoworker_CloseProject_Stub
03602 };
03603
03604 const CInterfaceStubVtbl _ICvsCoworkerStubVtbl =
03605 {
03606     &IID_ICvsCoworker,
03607     &ICvsCoworker_ServerInfo,
03608     23,
03609     &ICvsCoworker_table[-3],
03610     CStdStubBuffer_METHODS
03611 };
03612
03613 static const MIDL_STUB_DESC Object_StubDesc =
03614     {
03615     0,
03616     NdrOleAllocate,
03617     NdrOleFree,
03618     0,
03619     0,
03620     0,
03621     0,
03622     0,
03623     __MIDL_TypeFormatString.Format,
03624     1, /* -error bounds_check flag */
03625     0x10001, /* Ndr library version */
03626     0,
03627     0x600015b, /* MIDL Version 6.0.347 */
03628     0,
03629     0,
03630     0,  /* notify & notify_flag routine table */
03631     0x1, /* MIDL flag */
03632     0, /* cs routines */
03633     0,   /* proxy/server info */
03634     0   /* Reserved5 */
03635     };
03636
03637 const CInterfaceProxyVtbl * _CVS_Coworker_ProxyVtblList[] =
03638 {
03639     ( CInterfaceProxyVtbl *) &_ICvsCoworkerProxyVtbl,
03640     0
03641 };
03642
03643 const CInterfaceStubVtbl * _CVS_Coworker_StubVtblList[] =
03644 {
03645     ( CInterfaceStubVtbl *) &_ICvsCoworkerStubVtbl,
03646     0
03647 };
03648
03649 PCInterfaceName const _CVS_Coworker_InterfaceNamesList[] =
03650 {
03651     "ICvsCoworker",
03652     0
03653 };
03654
03655
03656 #define _CVS_Coworker_CHECK_IID(n)  IID_GENERIC_CHECK_IID( _CVS_Coworker, pIID, n)
03657
03658 int __stdcall _CVS_Coworker_IID_Lookup( const IID * pIID, int * pIndex )
03659 {
03660
03661     if(!_CVS_Coworker_CHECK_IID(0))
03662         {
03663         *pIndex = 0;
03664         return 1;
03665         }
03666
03667     return 0;
03668 }
03669
03670 const ExtendedProxyFileInfo CVS_Coworker_ProxyFileInfo =
03671 {
03672     (PCInterfaceProxyVtblList *) & _CVS_Coworker_ProxyVtblList,
03673     (PCInterfaceStubVtblList *) & _CVS_Coworker_StubVtblList,
03674     (const PCInterfaceName * ) & _CVS_Coworker_InterfaceNamesList,
03675     0, // no delegation
03676     & _CVS_Coworker_IID_Lookup,
03677     1,
03678     1,
03679     0, /* table of [async_uuid] interfaces */
03680     0, /* Filler1 */
03681     0, /* Filler2 */
03682     0  /* Filler3 */
03683 };
03684
03685
03686 #endif /* !defined(_M_IA64) && !defined(_M_AMD64)*/
03687
Generated on Sun Feb 24 01:21:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CvsStatusBar.cpp Source File

WinCvs/CvsStatusBar.cpp

Go to the documentation of this file.
00001 // CvsStatusBar.cpp : implementation file
00002 //
00003
00004 #include "stdafx.h"
00005 #include "wincvs.h"
00006 #include "CvsStatusBar.h"
00007 #include "CvsPrefs.h"
00008
00009 #ifdef _DEBUG
00010 #define new DEBUG_NEW
00011 #undef THIS_FILE
00012 static char THIS_FILE[] = __FILE__;
00013 #endif
00014
00016 // CCvsStatusBar
00017
00018 CCvsStatusBar::CCvsStatusBar() : m_step(-1), m_settimer(false)
00019 {
00020     m_indic.LoadBitmap(IDB_IDLE);
00021 }
00022
00023 CCvsStatusBar::~CCvsStatusBar()
00024 {
00025 }
00026
00027 void CCvsStatusBar::DrawItem(LPDRAWITEMSTRUCT p)
00028 {
00029     if(!m_settimer)
00030     {
00031         SetTimer(999, 100, 0L);
00032         m_settimer = true;
00033     }
00034
00035     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00036     if(!app->gCvsRunning && !gCvsPrefs.IsTclFileRunning())
00037         return;
00038
00039     static int tab[12] = {
00040         -2, -1, 1, 4, 8, 11, 13, 11,
00041         8, 4, 1, -1};
00042     CDC hdc;
00043     CBrush b(RGB(0, 0, 0xFF));
00044
00045     hdc.Attach(p->hDC);
00046     CRect r(p->rcItem);
00047     hdc.FillRect(r, &b);
00048     CPoint off(r.TopLeft());
00049     off.x -= m_step;
00050     int cnt = 0;
00051     while(off.x < r.right)
00052     {
00053         CPoint offy(off);
00054         offy.y += tab[(m_step + cnt) % 12];
00055         hdc.DrawState(offy, CSize(16,16), m_indic, DSS_NORMAL);
00056         off.x += 24;
00057         cnt++;
00058     }
00059     hdc.Detach();
00060 }
00061
00062 void CCvsStatusBar::OnTimer(UINT nIDEvent)
00063 {
00064     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00065     if(app->gCvsRunning || gCvsPrefs.IsTclFileRunning())
00066     {
00067         if(++m_step == 24)
00068             m_step = 0;
00069
00070         CRect r;
00071         GetItemRect(1, r);
00072         InvalidateRect(r, FALSE);
00073     }
00074     else if(m_step != -1)
00075     {
00076         m_step = -1;
00077         CRect r;
00078         GetItemRect(1, r);
00079         InvalidateRect(r, FALSE);
00080     }
00081 }
00082
00083 BEGIN_MESSAGE_MAP(CCvsStatusBar, CStatusBar)
00084     //{{AFX_MSG_MAP(CCvsStatusBar)
00085     ON_WM_TIMER()
00086     //}}AFX_MSG_MAP
00087 END_MESSAGE_MAP()
00088
00090 // CCvsStatusBar message handlers
Generated on Sun Feb 24 01:21:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CvsStatusBar.h Source File

WinCvs/CvsStatusBar.h

Go to the documentation of this file.
00001 #if !defined(AFX_CVSSTATUSBAR_H__F549ACF2_ECFE_4933_A05D_5FC8248C3CD4__INCLUDED_)
00002 #define AFX_CVSSTATUSBAR_H__F549ACF2_ECFE_4933_A05D_5FC8248C3CD4__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007 // CvsStatusBar.h : header file
00008 //
00009
00011 // CCvsStatusBar window
00012
00013 class CCvsStatusBar : public CStatusBar
00014 {
00015 // Construction
00016 public:
00017     CCvsStatusBar();
00018
00019 // Attributes
00020 public:
00021
00022 // Operations
00023 public:
00024     virtual void DrawItem(LPDRAWITEMSTRUCT);
00025
00026 // Overrides
00027     // ClassWizard generated virtual function overrides
00028     //{{AFX_VIRTUAL(CCvsStatusBar)
00029     //}}AFX_VIRTUAL
00030
00031 // Implementation
00032 public:
00033     virtual ~CCvsStatusBar();
00034
00035     // Generated message map functions
00036 protected:
00037     CBitmap m_indic;
00038     int m_step;
00039     bool m_settimer;
00040     //{{AFX_MSG(CCvsStatusBar)
00041     afx_msg void OnTimer(UINT nIDEvent);
00042     //}}AFX_MSG
00043
00044     DECLARE_MESSAGE_MAP()
00045 };
00046
00048
00049 //{{AFX_INSERT_LOCATION}}
00050 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00051
00052 #endif // !defined(AFX_CVSSTATUSBAR_H__F549ACF2_ECFE_4933_A05D_5FC8248C3CD4__INCLUDED_)
Generated on Sun Feb 24 01:21:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/dlldata.c Source File

WinCvs/dlldata.c

Go to the documentation of this file.
00001 /*********************************************************
00002    DllData file -- generated by MIDL compiler
00003
00004         DO NOT ALTER THIS FILE
00005
00006    This file is regenerated by MIDL on every IDL file compile.
00007
00008    To completely reconstruct this file, delete it and rerun MIDL
00009    on all the IDL files in this DLL, specifying this file for the
00010    /dlldata command line option
00011
00012 *********************************************************/
00013
00014
00015 #include <rpcproxy.h>
00016
00017 #ifdef __cplusplus
00018 extern "C"   {
00019 #endif
00020
00021 EXTERN_PROXY_FILE( CVS_Coworker )
00022
00023
00024 PROXYFILE_LIST_START
00025 /* Start of list */
00026   REFERENCE_PROXY_FILE( CVS_Coworker ),
00027 /* End of list */
00028 PROXYFILE_LIST_END
00029
00030
00031 DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
00032
00033 #ifdef __cplusplus
00034 }  /*extern "C" */
00035 #endif
00036
00037 /* end of generated dlldata file */
Generated on Sun Feb 24 01:21:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/ExploreBar.cpp Source File

WinCvs/ExploreBar.cpp

Go to the documentation of this file.
00001 // ExploreBar.cpp : implementation file
00002 //
00003
00004 #include "stdafx.h"
00005 #include "wincvs.h"
00006 #include "MainFrm.h"
00007 #include "ExploreBar.h"
00008 #include "BrowseFileView.h"
00009 #include "FileTraversal.h"
00010 #include "CvsCommands.h"
00011 #include "CvsPrefs.h"
00012
00013 #ifdef _DEBUG
00014 #define new DEBUG_NEW
00015 #undef THIS_FILE
00016 static char THIS_FILE[] = __FILE__;
00017 #endif
00018
00019 IMPLEMENT_DYNAMIC(CMyShellTree, CCJShellTree)
00020
00021 BEGIN_MESSAGE_MAP(CMyShellTree, CCJShellTree)
00022     //{{AFX_MSG_MAP(CMyShellTree)
00023     ON_NOTIFY_REFLECT(NM_RCLICK, OnRclick)
00024     ON_NOTIFY_REFLECT(TVN_DELETEITEM, OnDeleteitem)
00025     ON_NOTIFY_REFLECT(TVN_SELCHANGED, OnSelchanged)
00026     ON_NOTIFY_REFLECT(TVN_ITEMEXPANDING, OnItemexpanding)
00027     //}}AFX_MSG_MAP
00028 END_MESSAGE_MAP()
00029
00030 bool CMyShellTree::DisableCommon()
00031 {
00032     CWincvsApp *app = (CWincvsApp *)AfxGetApp();
00033     return app->gCvsRunning || gCvsPrefs.empty();
00034 }
00035
00036 void CMyShellTree::OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult)
00037 {
00038     if(DisableCommon())
00039     {
00040         *pResult = 1;
00041         return;
00042     }
00043
00044     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00045     CCJShellTree::OnItemexpanding(pNMHDR,pResult);
00046     CCJShellTree::Invalidate();
00047     *pResult = 0;
00048 }
00049
00050 void CMyShellTree::OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult)
00051 {
00052     if(DisableCommon())
00053     {
00054         *pResult = 1;
00055         return;
00056     }
00057
00058     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00059
00060     CString szPath;
00061     CCJShellTree::OnSelchanged(pNMHDR,pResult);
00062
00063     if(CCJShellTree::GetSelectedFolderPath(szPath))
00064     {
00065         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00066         CBrowseFileView *view = app->GetFileView();
00067         if(view != 0L)
00068             view->ResetView(szPath);
00069     }
00070
00071     *pResult = 0;
00072 }
00073
00074 void CMyShellTree::OnRclick(NMHDR* pNMHDR, LRESULT* pResult)
00075 {
00076     if(DisableCommon())
00077     {
00078         *pResult = 1;
00079         return;
00080     }
00081
00082     // TODO: Add your control notification handler code here
00083     CCJShellTree::OnRclick(pNMHDR,pResult);
00084     *pResult = 0;
00085 }
00086
00087 void CMyShellTree::OnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult)
00088 {
00089     if(DisableCommon())
00090     {
00091         *pResult = 1;
00092         return;
00093     }
00094
00095     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00096     // TODO: Add your control notification handler code here
00097     CCJShellTree::OnDeleteitem(pNMHDR,pResult);
00098     *pResult = 0;
00099 }
00100
00102 // CExploreBar
00103
00104 IMPLEMENT_DYNCREATE(CExploreBar, CView)
00105
00106 CExploreBar::CExploreBar()
00107 {
00108 }
00109
00110 CExploreBar::~CExploreBar()
00111 {
00112 }
00113
00114
00115 BEGIN_MESSAGE_MAP(CExploreBar, CView)
00116     //{{AFX_MSG_MAP(CExploreBar)
00117     ON_WM_WINDOWPOSCHANGED()
00118     ON_COMMAND(ID_VIEW_CHECKOUT, OnViewCheckout)
00119     ON_UPDATE_COMMAND_UI(ID_VIEW_CHECKOUT, OnUpdateViewCheckout)
00120     ON_COMMAND(ID_VIEW_IMPORT, OnViewImport)
00121     ON_UPDATE_COMMAND_UI(ID_VIEW_IMPORT, OnUpdateViewImport)
00122     //}}AFX_MSG_MAP
00123 END_MESSAGE_MAP()
00124
00126 // CExploreBar drawing
00127
00128 void CExploreBar::OnDraw(CDC* pDC)
00129 {
00130     CDocument* pDoc = GetDocument();
00131 }
00132
00134 // CExploreBar diagnostics
00135
00136 #ifdef _DEBUG
00137 void CExploreBar::AssertValid() const
00138 {
00139     CView::AssertValid();
00140 }
00141
00142 void CExploreBar::Dump(CDumpContext& dc) const
00143 {
00144     CView::Dump(dc);
00145 }
00146 #endif //_DEBUG
00147
00149 // CExploreBar message handlers
00150
00151 BOOL CExploreBar::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
00152 {
00153     BOOL res = CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
00154
00155     if(res)
00156     {
00157         if (!m_TreeCtrl.Create(
00158             WS_VISIBLE|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS,
00159             CRect(0,0,0,0), this, IDC_BAR_TREE))
00160         {
00161             TRACE0("Unable to create caption button.\n");
00162             return FALSE;
00163         }
00164     }
00165
00166     //m_TreeCtrl.EnableImages();
00167     //m_TreeCtrl.PopulateTree();
00168
00169     //SetChild(&m_TreeCtrl);
00170
00171     return res;
00172 }
00173
00174 void CExploreBar::OnWindowPosChanged(WINDOWPOS FAR* wp)
00175 {
00176     CView::OnWindowPosChanged(wp);
00177
00178     CRect r;
00179     GetClientRect(&r);
00180     m_TreeCtrl.SetWindowPos(NULL, r.left, r.top, r.Width(), r.Height(), SWP_NOZORDER);
00181 }
00182
00183 void CExploreBar::OnUpdateCmd(CCmdUI* pCmdUI)
00184 {
00185     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00186     if(DisableCommon())
00187     {
00188         pCmdUI->Enable(FALSE);
00189         return;
00190     }
00191     CString folderPath;
00192     if(!m_TreeCtrl.GetSelectedFolderPath(folderPath) || folderPath.IsEmpty())
00193     {
00194         pCmdUI->Enable(FALSE);
00195         return;
00196     }
00197
00198     pCmdUI->Enable(TRUE);
00199 }
00200
00201 bool CExploreBar::DisableCommon()
00202 {
00203     CWincvsApp *app = (CWincvsApp *)AfxGetApp();
00204     return app->gCvsRunning || gCvsPrefs.empty();
00205 }
00206
00207 void CExploreBar::OnViewCheckout()
00208 {
00209     CString folderPath;
00210     if(m_TreeCtrl.GetSelectedFolderPath(folderPath) && !folderPath.IsEmpty())
00211         CvsCmdCheckoutModule(folderPath);
00212 }
00213
00214 void CExploreBar::OnUpdateViewCheckout(CCmdUI* pCmdUI)
00215 {
00216     OnUpdateCmd(pCmdUI);
00217     pCmdUI->SetText("Chec&kout module to selection...");
00218 }
00219
00220 void CExploreBar::OnViewImport()
00221 {
00222     CString folderPath;
00223     if(m_TreeCtrl.GetSelectedFolderPath(folderPath) && !folderPath.IsEmpty())
00224         CvsCmdImportModule(folderPath);
00225 }
00226
00227 void CExploreBar::OnUpdateViewImport(CCmdUI* pCmdUI)
00228 {
00229     OnUpdateCmd(pCmdUI);
00230     pCmdUI->SetText("&Import module from selection...");
00231 }
Generated on Sun Feb 24 01:21:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/ExploreBar.h Source File

WinCvs/ExploreBar.h

Go to the documentation of this file.
00001 #if !defined(AFX_EXPLOREBAR_H__A132A164_1A90_11D3_B1A1_004095463819__INCLUDED_)
00002 #define AFX_EXPLOREBAR_H__A132A164_1A90_11D3_B1A1_004095463819__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007 // ExploreBar.h : header file
00008 //
00009
00010 #include "CJShellTree.h"
00011
00013 // CExploreBar view
00014
00015 class CMyShellTree : public CCJShellTree
00016 {
00017     DECLARE_DYNAMIC(CMyShellTree)
00018
00019 protected:
00020     bool DisableCommon();
00021
00022     //{{AFX_MSG(CMyShellTree)
00023     afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
00024     afx_msg void OnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult);
00025     afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
00026     afx_msg void OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult);
00027     //}}AFX_MSG
00028
00029     DECLARE_MESSAGE_MAP()
00030 };
00031
00032 class CExploreBar : public CView
00033 {
00034 protected:
00035     CExploreBar();           // protected constructor used by dynamic creation
00036     DECLARE_DYNCREATE(CExploreBar)
00037
00038 // Attributes
00039 public:
00040     CMyShellTree  m_TreeCtrl;
00041
00042 // Operations
00043 public:
00044
00045 // Overrides
00046     // ClassWizard generated virtual function overrides
00047     //{{AFX_VIRTUAL(CExploreBar)
00048     public:
00049     virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
00050     protected:
00051     virtual void OnDraw(CDC* pDC);      // overridden to draw this view
00052     //}}AFX_VIRTUAL
00053
00054 // Implementation
00055 protected:
00056     virtual ~CExploreBar();
00057     void OnUpdateCmd(CCmdUI* pCmdUI);
00058     bool DisableCommon();
00059
00060 #ifdef _DEBUG
00061     virtual void AssertValid() const;
00062     virtual void Dump(CDumpContext& dc) const;
00063 #endif
00064
00065     // Generated message map functions
00066 protected:
00067     //{{AFX_MSG(CExploreBar)
00068     afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
00069     afx_msg void OnViewCheckout();
00070     afx_msg void OnUpdateViewCheckout(CCmdUI* pCmdUI);
00071     afx_msg void OnViewImport();
00072     afx_msg void OnUpdateViewImport(CCmdUI* pCmdUI);
00073     //}}AFX_MSG
00074     DECLARE_MESSAGE_MAP()
00075 };
00076
00078
00079 //{{AFX_INSERT_LOCATION}}
00080 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00081
00082 #endif // !defined(AFX_EXPLOREBAR_H__A132A164_1A90_11D3_B1A1_004095463819__INCLUDED_)
Generated on Sun Feb 24 01:21:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/FileViewWatcher.cpp Source File

WinCvs/FileViewWatcher.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018 * Author : V.Antonevich <v_antonevich@hotmail.com> --- November 2000
00019 */
00020
00021 /*
00022 * FileViewWatcher.cpp --- file modification watcher thread
00023 */
00024
00025 #include "stdafx.h"
00026 #include "wincvs.h"
00027 #include "FileViewWatcher.h"
00028
00029 #ifdef _DEBUG
00030 #define new DEBUG_NEW
00031 #undef THIS_FILE
00032 static char THIS_FILE[] = __FILE__;
00033 #endif
00034
00035 UINT KoWatcher::Run()
00036 {
00037     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00038
00039     for(;;)
00040     {
00041         // if a lot of changes happen suddenly in the folder, we
00042         // don't want WinCvs to die under the WM_FILECHANGE message,
00043         // so we need to slow down a bit.
00044         Sleep(app->m_isBackgroundProcess ? 2000 : 200);
00045
00046         DWORD dw = WaitForMultipleObjects(m_count, m_handles, FALSE, INFINITE);
00047         switch (dw)
00048         {
00049             case WAIT_OBJECT_0 :
00050             {
00051                 // process signal to start watching
00052                 StopWatch();
00053                 StartWatch();
00054                 m_eventStartWatching.Unlock();
00055                 break;
00056             }
00057             case WAIT_OBJECT_0 + 1 :
00058             {
00059                 // process signal to terminate
00060                 StopWatch();
00061                 delete this;
00062                 return 0;
00063             }
00064             case WAIT_OBJECT_0 + 2 :
00065             {
00066                 // process file change signal
00067                 StopWatch();
00068                 PostMessage(m_hWnd, WM_FILECHANGE, 0, 0);
00069                 break;
00070             }
00071
00072         }
00073     }
00074     return 0;
00075 }
00076
00077 bool KoWatcher::StartWatch()
00078 {
00079     // retrieve parameters first
00080     TCHAR path[_MAX_PATH];
00081     bool isRecursive;
00082     m_section.Lock();
00083     lstrcpyn(path, m_path, _MAX_PATH);
00084     isRecursive = m_isRecursive;
00085     m_section.Unlock();
00086
00087     // start watching
00088     HANDLE h =  FindFirstChangeNotification(
00089                     path,
00090                     isRecursive,
00091                     FILE_NOTIFY_CHANGE_FILE_NAME |
00092                     FILE_NOTIFY_CHANGE_DIR_NAME |
00093                     //FILE_NOTIFY_CHANGE_SIZE |
00094                     FILE_NOTIFY_CHANGE_LAST_WRITE |
00095                     //FILE_NOTIFY_CHANGE_LAST_ACCESS |
00096 #if _MSC_VER >= 1200
00097                     //FILE_NOTIFY_CHANGE_CREATION | (makes Win98 fails)
00098 #endif
00099                     //FILE_NOTIFY_CHANGE_SECURITY |
00100                     FILE_NOTIFY_CHANGE_ATTRIBUTES
00101                 );
00102     if (h != INVALID_HANDLE_VALUE)
00103     {
00104         m_handles[2] = h;
00105         m_count = 3;
00106     }
00107     return m_count == 3;
00108 }
00109
00110 // stops monitoring
00111 void KoWatcher::StopWatch()
00112 {
00113     if (m_count == 3 && m_handles[2] != INVALID_HANDLE_VALUE)
00114     {
00115         // reset and close the handle
00116         FindNextChangeNotification(m_handles[2]);
00117         FindCloseChangeNotification(m_handles[2]);
00118         m_handles[2] = INVALID_HANDLE_VALUE;
00119         m_count = 2;
00120     }
00121 }
Generated on Sun Feb 24 01:21:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/FileViewWatcher.h Source File

WinCvs/FileViewWatcher.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018 * Author : V.Antonevich <v_antonevich@hotmail.com> --- November 2000
00019 */
00020
00021 /*
00022 * FileViewWatcher.h --- file modification watcher thread
00023 */
00024
00025 #ifndef __FILEVIEWWATCHWER_H__
00026 #define __FILEVIEWWATCHWER_H__
00027
00028 #include <afxmt.h>
00029
00030 // file modification watcher thread
00031 class KoWatcher
00032 {
00033 // Attributes
00034 private:
00035     CEvent m_eventStartWatching;
00036     // signals that watcher thread shall start watching
00037
00038     CEvent m_eventTerminate;
00039     // signals that watcher thread should terminate
00040
00041     CCriticalSection m_section;
00042     // to synchronize access to data fileds
00043
00044     TCHAR m_path[_MAX_PATH];
00045     // path to watch for changes
00046
00047     bool m_isRecursive;
00048     // flag to tell if watching for recursive changes
00049
00050     HWND m_hWnd;
00051     // window to post notification to
00052
00053     HANDLE m_handles[3];
00054     // objects being watched
00055
00056     DWORD m_count;
00057     // count of handles
00058
00059 public:
00060     // messages posted out
00061     enum
00062     {
00063         WM_FILECHANGE = WM_APP + 51,
00064         // private message for delivering file change notification
00065     };
00066
00067
00068 // Construction
00069 public:
00070     KoWatcher(HWND hWnd)
00071     : m_isRecursive(false)
00072     , m_hWnd(hWnd)
00073     {
00074         m_handles[0] = m_eventStartWatching;
00075         m_handles[1] = m_eventTerminate;
00076         m_count = 2;
00077         *m_path = 0;
00078
00079         // start the thread immediately
00080         AfxBeginThread(DelegateRun, this);
00081     }
00082
00083 private:
00084     // must call SignalTerminate() to destroy this object
00085     ~KoWatcher()
00086     {}
00087
00088 // Operations
00089 public:
00090     // signal to start watching for file changes in particular destination
00091     void SignalStartWatch(LPCTSTR path, bool isRecursive)
00092     {
00093         // store parameters
00094         m_section.Lock();
00095         _tcscpy(m_path, path);
00096         m_isRecursive = isRecursive;
00097         m_section.Unlock();
00098         m_eventStartWatching.SetEvent();
00099     }
00100
00101     // signals to terminate
00102     void SignalTerminate()
00103     {
00104         m_eventTerminate.SetEvent();
00105     }
00106
00107 // Implementations
00108 private:
00109     // delegates control to non-static member
00110     static UINT DelegateRun(LPVOID p)
00111     {
00112         KoWatcher* watcher = (KoWatcher*)p;
00113         return watcher->Run();
00114     }
00115
00116     // responds to events until requested to terminate
00117     UINT Run();
00118
00119     // starts monitoring
00120     bool StartWatch();
00121
00122     // stops monitoring
00123     void StopWatch();
00124 };
00125
00126
00127
00128 #endif
00129 // __FILEVIEWWATCHWER_H__
Generated on Sun Feb 24 01:21:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/findtcl.cpp Source File

WinCvs/findtcl.cpp

Go to the documentation of this file.
00001 #include "stdafx.h"
00002 #include <string>
00003 #include <deque>
00004 #include <algorithm>
00005 #include <windows.h>
00006
00007 // I don't care to know about name truncation in the debug data
00008 #pragma warning(disable:4786)
00009
00010
00011 // local protos
00012 static void buildTail (char *, const char *, int);
00013 static void buildWildTail (char *, char *, int);
00014 static bool verRemove (std::string &);
00015 static bool verLess (std::string &, std::string &);
00016 static bool fileRemove (std::string &);
00017 static bool fileLess (std::string &, std::string &);
00018
00019 // locally shared variables restricted to this module
00020 static char *minVer;
00021 static int exact;
00022 static int dbgOnly;
00023
00024 char *
00025 findTcl (char *_minVer, int _exact, int _dbgOnly)
00026 {
00027     //char *tclRootPath = NULL;
00028     static char tclLibFullPath[MAX_PATH];
00029     char *savedPos;
00030     char *pos1, *pos2;
00031     char *prefix = "\\bin\\tcl";
00032     WIN32_FIND_DATA hFFData;
00033     HANDLE hFind;
00034     int i = 0;
00035     std::deque<std::string> vers;
00036     std::deque<std::string>::iterator versNewLast;
00037
00038
00039     minVer = _minVer;
00040     exact = _exact;
00041     dbgOnly = _dbgOnly;
00042
00043
00044     // Look in the current path on the assumption if it's there, you want to use
00045     // it instead of any others if it passes the version test.
00046
00047     // Append the beginning
00048     pos1 = tclLibFullPath;
00049     pos2 = ".\\tcl";
00050     while (*pos2 != '\0') { *pos1++ = *pos2++; };
00051     savedPos = pos1;
00052
00053     if (exact != 0)
00054     {
00055         // build the end of the filename from the parameter given
00056         buildTail(savedPos, minVer, dbgOnly);
00057
00058         // See if it *really* exists
00059         hFind = ::FindFirstFile(tclLibFullPath, &hFFData);
00060
00061         if (hFind != INVALID_HANDLE_VALUE)
00062         {
00063             // gotcha.
00064             ::FindClose(hFind);
00065             return tclLibFullPath;
00066         }
00067         // no success..  fall through for registry search
00068
00069     }
00070     else
00071     {
00072
00073         // Try a range of filenames
00074         buildWildTail(savedPos, minVer, dbgOnly);
00075
00076         // See if we got some
00077         hFind = ::FindFirstFile(tclLibFullPath, &hFFData);
00078
00079         if (hFind != INVALID_HANDLE_VALUE)
00080         {
00081             BOOL rtn;
00082
00083             do
00084             {
00085                 vers.push_back(std::string(hFFData.cFileName));
00086                 rtn = ::FindNextFile(hFind, &hFFData);
00087             } while (rtn != 0);   // got more?
00088
00089             ::FindClose(hFind);
00090
00091             // sort filename strings
00092             std::sort(vers.begin(), vers.end(), fileLess);
00093
00094             // remove all invalid entries based on flags.
00095             versNewLast = std::remove_if(vers.begin(), vers.end(), fileRemove);
00096
00097             if (vers.begin() != versNewLast) {
00098                 // using copy itself doesn't terminate the string...  how odd..
00099                 tclLibFullPath [(versNewLast - 1)->copy(tclLibFullPath, MAX_PATH)] = '\0';
00100                 return tclLibFullPath;
00101             }
00102         }
00103
00104         // no success..  fall through for registry search
00105     }
00106
00107
00108     // Do a registry search.
00109     HKEY topTclKey = NULL, subTclVer = NULL;
00110     DWORD max_path = MAX_PATH;
00111     LONG result;
00112     char sSubKey[MAX_PATH];
00113     const char *verTarget;
00114
00115     result = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
00116         "SOFTWARE\\Scriptics\\Tcl",
00117         0,
00118         KEY_ENUMERATE_SUB_KEYS,
00119         &topTclKey);
00120
00121     if (result != ERROR_SUCCESS)
00122     {
00123         // active TCL
00124         //HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TclScript\DefaultIcon
00125         result = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
00126             "SOFTWARE\\Classes\\TclScript\\DefaultIcon",
00127             0,
00128             KEY_QUERY_VALUE,
00129             &topTclKey);
00130
00131         if (result == ERROR_SUCCESS)
00132         {
00133             result = RegQueryValueEx(topTclKey,
00134                 "",
00135                 NULL,
00136                 NULL,
00137                 reinterpret_cast<PUCHAR>(tclLibFullPath),
00138                 &max_path);
00139
00140             RegCloseKey(topTclKey);
00141
00142             if (result == ERROR_SUCCESS)
00143             {
00144                 CString s(tclLibFullPath);
00145                 s.Replace("tk", "tcl");
00146                 strcpy(tclLibFullPath, s);
00147                 char *tmp = strrchr(tclLibFullPath, ',');
00148                 if(tmp != 0L)
00149                     *tmp = '\0';
00150                 return tclLibFullPath;
00151             }
00152         }
00153
00154         if (result != ERROR_SUCCESS)
00155         {
00156             std::string err("The registry path (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl) does not exist.");
00157             err.append("  Redo your Tcl install or, assuming you compiled your own core, read /win/README from the source distribution.");
00158             throw err;
00159         }
00160     }
00161
00162     // Read all SubKey names
00163  enumAgain:
00164     result = RegEnumKey(topTclKey, i, sSubKey, MAX_PATH);
00165     if (result != ERROR_NO_MORE_ITEMS) {
00166         vers.push_back(std::string(sSubKey));
00167         i++; goto enumAgain;
00168     }
00169     else if (i == 0)
00170     {
00171         std::string err("The registry path (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl) has no SubKeys.");
00172         err.append("  Reinstall Tcl to fix this or hand edit your registry.");
00173         RegCloseKey(topTclKey);
00174         throw err;
00175     }
00176
00177     // sort version strings
00178     std::sort(vers.begin(), vers.end(), verLess);
00179
00180     // remove all invalid entries based on flags.
00181     versNewLast = std::remove_if(vers.begin(), vers.end(), verRemove);
00182
00183     if (vers.begin() != versNewLast)
00184         verTarget = (versNewLast - 1)->c_str();
00185     else
00186     {
00187         std::string err("Unable to locate a proper Tcl core in the registry for version ");
00188         err.append(minVer);
00189         if (exact != 0)
00190             err.append(".");
00191         else
00192             err.append(" or greater.");
00193         RegCloseKey(topTclKey);
00194         throw err;
00195     }
00196
00197     result = RegOpenKeyEx(topTclKey,
00198         verTarget,
00199         0,
00200         KEY_READ,
00201         &subTclVer);
00202
00203     if (result != ERROR_SUCCESS)
00204     {
00205         std::string err("The registry path (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl<target>) does not exist.");
00206         err.append("  Redo your Tcl install or, assuming you compiled your own core, read /win/README from the source distribution.");
00207         RegCloseKey(topTclKey);
00208         throw err;
00209     }
00210
00211     result = RegQueryValueEx(subTclVer,
00212         "Root",
00213         NULL,
00214         NULL,
00215         reinterpret_cast<PUCHAR>(tclLibFullPath),
00216         &max_path);
00217
00218     if (result != ERROR_SUCCESS)
00219     {
00220         std::string err("The registry path (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\");
00221         err.append(verTarget);
00222         err.append(") did not have a \"Root\" SubKey.");
00223         RegCloseKey(topTclKey);
00224         RegCloseKey(subTclVer);
00225         throw err;
00226     };
00227
00228     pos1 = tclLibFullPath;
00229     while (*pos1 != '\0') { pos1++; }
00230
00231     // Append the bin directory and prefix
00232     pos2 = prefix;
00233     while (*pos2 != '\0') { *pos1++ = *pos2++; };
00234     savedPos = pos1;
00235
00236     // Build the end of the filename
00237     buildTail(savedPos, verTarget, dbgOnly);
00238
00239     // See if it *really* exists
00240     hFind = ::FindFirstFile(tclLibFullPath, &hFFData);
00241
00242     if (hFind != INVALID_HANDLE_VALUE) {
00243         // gotcha.
00244         ::FindClose(hFind);
00245         RegCloseKey(topTclKey);
00246         RegCloseKey(subTclVer);
00247         return tclLibFullPath;
00248     }
00249     else
00250     {
00251         ::FindClose(hFind);
00252         std::string err("The registry key (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\");
00253         err.append(minVer);
00254         err.append("\\Root) said a core was located at (");
00255         err.append(tclLibFullPath);
00256         err.append(").  This was found to be false.");
00257         RegCloseKey(topTclKey);
00258         RegCloseKey(subTclVer);
00259         throw err;
00260     }
00261
00262     RegCloseKey(topTclKey);
00263     RegCloseKey(subTclVer);
00264     throw std::string("A proper Tcl core could not be found anywhere.");
00265     return NULL;
00266 }
00267
00268 static void
00269 buildTail(char *pos, const char *ver, int dbgOnly)
00270 {
00271     const char *pos2;
00272     char *shLibExt = ".dll";
00273
00274     /* append version w/o decimal */
00275     pos2 = ver;
00276     while (*pos2 != '\0') {
00277         if (*pos2 != '.') *pos++ = *pos2++;
00278         else pos2++;
00279     };
00280
00281     /* if asked, add the debug suffix */
00282     if (dbgOnly != 0) *pos++ = 'd';
00283
00284     /* append the extension */
00285     pos2 = shLibExt;
00286     while (*pos2 != '\0') {
00287         *pos++ = *pos2++;
00288     };
00289
00290     /* terminate it */
00291     *pos = '\0';
00292 };
00293
00294
00295 static void
00296 buildWildTail(char *pos, char *ver, int dbgOnly)
00297 {
00298     char *pos2;
00299     char *shLibExt = ".dll";
00300
00301     /* just append the major version */
00302     *pos++ = *ver;
00303     *pos++ = '?';
00304
00305     /* if asked, add the debug suffix */
00306     if (dbgOnly != 0) *pos++ = 'd';
00307
00308     /* append the extension */
00309     pos2 = shLibExt;
00310     while (*pos2 != '\0') {
00311         *pos++ = *pos2++;
00312     };
00313
00314     /* terminate it */
00315     *pos = '\0';
00316 };
00317
00318 static bool verRemove (std::string &s)
00319 {
00320     double fa, fb;
00321     fa = atof(s.c_str());
00322     fb = atof(minVer);
00323
00324     if (exact == 0)
00325     {
00326         // remove when major version is different.
00327         if ((int)fa != (int)fb)
00328             return true;
00329         // remove when less than minor version
00330         return (fa - (int)fa < fb - (int)fb);
00331     }
00332     else
00333         // remove when not identical for an exact match
00334         return (fa != fb);
00335 };
00336
00337 static bool verLess(std::string &a, std::string &b) {
00338     double fa, fb;
00339     fa = atof(a.c_str());
00340     fb = atof(b.c_str());
00341     return (fa < fb);
00342 };
00343
00344 static bool
00345 fileRemove (std::string &f)
00346 {
00347     // strip off 'tcl' and '.dll'
00348     return verRemove(f.substr(3,1) + "." + f.substr(4,1));
00349 }
00350
00351 static bool
00352 fileLess (std::string &a, std::string &b)
00353 {
00354   return verLess(
00355       a.substr(3,1) + "." + a.substr(4,1),
00356       b.substr(3,1) + "." + b.substr(4,1)
00357       );
00358 }
Generated on Sun Feb 24 01:21:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/GraphDoc.cpp Source File

WinCvs/GraphDoc.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 // GraphDoc.cpp : implementation of the CGraphDoc class
00022 //
00023
00024 #include "stdafx.h"
00025
00026 #include <direct.h>
00027 #include <sys/stat.h>
00028
00029 #include "Wincvs.h"
00030
00031 #include "GraphDoc.h"
00032 #include "CvsLog.h"
00033 #include "WinCvsView.h"
00034 #include "GraphView.h"
00035 #include "CvsEntries.h"
00036
00037 #ifdef _DEBUG
00038 #define new DEBUG_NEW
00039 #undef THIS_FILE
00040 static char THIS_FILE[] = __FILE__;
00041 #endif
00042
00044 // CGraphDoc
00045
00046 IMPLEMENT_DYNCREATE(CGraphDoc, CDocument)
00047
00048 BEGIN_MESSAGE_MAP(CGraphDoc, CDocument)
00049     //{{AFX_MSG_MAP(CGraphDoc)
00050         // NOTE - the ClassWizard will add and remove mapping macros here.
00051         //    DO NOT EDIT what you see in these blocks of generated code!
00052     //}}AFX_MSG_MAP
00053     ON_COMMAND(ID_FILE_SEND_MAIL, OnFileSendMail)
00054     ON_UPDATE_COMMAND_UI(ID_FILE_SEND_MAIL, OnUpdateFileSendMail)
00055 END_MESSAGE_MAP()
00056
00057 BEGIN_DISPATCH_MAP(CGraphDoc, CDocument)
00058     //{{AFX_DISPATCH_MAP(CGraphDoc)
00059     DISP_FUNCTION(CGraphDoc, "NumNodes", NumNodes, VT_I4, VTS_NONE)
00060     //}}AFX_DISPATCH_MAP
00061 END_DISPATCH_MAP()
00062
00063 // Note: we add support for IID_ITest to support typesafe binding
00064 //  from VBA.  This IID must match the GUID that is attached to the
00065 //  dispinterface in the .ODL file.
00066
00067 // {09F456B5-0018-11D2-BCAA-000000000000}
00068 static const IID IID_ITest =
00069 { 0x9f456b5, 0x18, 0x11d2, { 0xbc, 0xaa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } };
00070
00071 BEGIN_INTERFACE_MAP(CGraphDoc, CDocument)
00072     INTERFACE_PART(CGraphDoc, IID_ITest, Dispatch)
00073 END_INTERFACE_MAP()
00074
00076 // CGraphDoc construction/destruction
00077
00078 CGraphDoc::CGraphDoc()
00079 {
00080     EnableAutomation();
00081
00082     AfxOleLockApp();
00083
00084     fNode = 0L;
00085     fData = 0L;
00086 }
00087
00088 CGraphDoc::~CGraphDoc()
00089 {
00090     AfxOleUnlockApp();
00091
00092     PrepareNew();
00093 }
00094
00095 void CGraphDoc::PrepareNew(void)
00096 {
00097     if(fNode != 0L)
00098     {
00099         delete fNode;
00100         fNode = 0L;
00101     }
00102     if(fData != 0L)
00103     {
00104         fData->UnRef();
00105         fData = 0L;
00106     }
00107     fDir.Empty();
00108     fName.Empty();
00109 }
00110
00111 BOOL CGraphDoc::OnNewDocument()
00112 {
00113     PrepareNew();
00114
00115     if (!CDocument::OnNewDocument())
00116         return FALSE;
00117
00118     return TRUE;
00119 }
00120
00121 static void NormalizeFn(const char* folder, const char* fn, char* dir, char* name)
00122 {
00123     char buffer[_MAX_PATH];
00124     char dirBuffer[_MAX_PATH];
00125     char nameBuffer[_MAX_PATH];
00126     char drive[_MAX_PATH];
00127     char ext[_MAX_EXT];
00128     _makepath(buffer, NULL, folder, fn, NULL);
00129     _splitpath(buffer, drive, dirBuffer, nameBuffer, ext);
00130     _makepath(dir, drive, dirBuffer, NULL, NULL);
00131     _makepath(name, NULL, NULL, nameBuffer, ext);
00132 }
00133
00134 void CGraphDoc::SetNode(CLogNode *node, const char *folder)
00135 {
00136     PrepareNew();
00137
00138     // normalize folder/fname since the latter can be a path relative to folder
00139     const char *fn = (**(CLogNodeHeader *)node).WorkingFile();
00140     char dir[_MAX_PATH];
00141     char name[_MAX_PATH];
00142     NormalizeFn(folder, fn, dir, name);
00143
00144     fNode = node;
00145     fDir = dir;
00146
00147     // get the CVS/Entries infos for this file
00148     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00149     if(!Entries_Open (entries, dir))
00150     {
00151         cvs_err("Warning : Error while accessing the CVS folder in '%s'\n", dir);
00152     }
00153     else
00154     {
00155         if(node->GetType() != kNodeHeader)
00156         {
00157             cvs_err("Warning : Top node is not a RCS file description !\n");
00158         }
00159         else
00160         {
00161             struct stat sb;
00162             if (stat(fn, &sb) == -1)    //JK - used to be "name", fix for the flat mode
00163             {
00164                 cvs_err("Warning : Unknown file '%s'\n", name);
00165             }
00166             else
00167             {
00168                 fData = Entries_SetVisited(dir, entries, name, sb, false);
00169                 fData->Ref();
00170                 fName = name;
00171             }
00172         }
00173     }
00174
00175     // create the graph and redraw
00176     CGraphView *view = GetTreeView();
00177     if(view != 0L)
00178     {
00179         view->CalcImageSize();
00180         view->Invalidate();
00181         SetTitle(fName);
00182     }
00183 }
00184
00185
00187 // CGraphDoc serialization
00188
00189 void CGraphDoc::Serialize(CArchive& ar)
00190 {
00191     if (ar.IsStoring())
00192     {
00193         // TODO: add storing code here
00194     }
00195     else
00196     {
00197         // TODO: add loading code here
00198     }
00199 }
00200
00201 CGraphView *CGraphDoc::GetTreeView(void)
00202 {
00203     POSITION posv = GetFirstViewPosition();
00204     CView* view;
00205     while(posv != NULL)
00206     {
00207         view = GetNextView(posv);
00208         if(view->IsKindOf(RUNTIME_CLASS(CGraphView)))
00209             return (CGraphView *)view;
00210     }
00211     return NULL;
00212 }
00213
00215 // CGraphDoc diagnostics
00216
00217 #ifdef _DEBUG
00218 void CGraphDoc::AssertValid() const
00219 {
00220     CDocument::AssertValid();
00221 }
00222
00223 void CGraphDoc::Dump(CDumpContext& dc) const
00224 {
00225     CDocument::Dump(dc);
00226 }
00227 #endif //_DEBUG
00228
00230 // CGraphDoc commands
00231
00232 long CGraphDoc::NumNodes()
00233 {
00234     return 0;
00235 }
Generated on Sun Feb 24 01:21:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/GraphDoc.h Source File

WinCvs/GraphDoc.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 // GraphDoc.h : interface of the CGraphDoc class
00022 //
00024
00025 #if !defined(AFX_GRAPHDOC_H__09F456C1_0018_11D2_BCAA_000000000000__INCLUDED_)
00026 #define AFX_GRAPHDOC_H__09F456C1_0018_11D2_BCAA_000000000000__INCLUDED_
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif // _MSC_VER >= 1000
00031
00032 class CLogNode;
00033 class CWincvsView;
00034 class CGraphView;
00035 class EntnodeData;
00036
00037 class CGraphDoc : public CDocument
00038 {
00039 protected: // create from serialization only
00040     CGraphDoc();
00041     DECLARE_DYNCREATE(CGraphDoc)
00042
00043 // Attributes
00044 public:
00045
00046     void SetNode(CLogNode *node, const char *dir);
00047     inline CLogNode *GetNode(void) { return fNode; }
00048     inline EntnodeData *GetEntryInfo(void) { return fData; }
00049     inline const char *GetDir(void) const { return fDir; }
00050     inline const char *GetName(void) const { return fName; }
00051         // the RCS log description as a tree
00052
00053     CGraphView *GetTreeView(void);
00054         // get the graph (tree) view
00055
00056     // Operations
00057 public:
00058
00059 // Overrides
00060     // ClassWizard generated virtual function overrides
00061     //{{AFX_VIRTUAL(CGraphDoc)
00062     public:
00063     virtual BOOL OnNewDocument();
00064     virtual void Serialize(CArchive& ar);
00065     //}}AFX_VIRTUAL
00066
00067 // Implementation
00068 public:
00069     virtual ~CGraphDoc();
00070 #ifdef _DEBUG
00071     virtual void AssertValid() const;
00072     virtual void Dump(CDumpContext& dc) const;
00073 #endif
00074
00075 protected:
00076     CLogNode *fNode;
00077     CString fDir;
00078     CString fName;
00079     EntnodeData *fData;
00080
00081     void PrepareNew(void);
00082
00083 // Generated message map functions
00084 protected:
00085     //{{AFX_MSG(CGraphDoc)
00086         // NOTE - the ClassWizard will add and remove member functions here.
00087         //    DO NOT EDIT what you see in these blocks of generated code !
00088     //}}AFX_MSG
00089     DECLARE_MESSAGE_MAP()
00090
00091     // Generated OLE dispatch map functions
00092     //{{AFX_DISPATCH(CGraphDoc)
00093     afx_msg long NumNodes();
00094     //}}AFX_DISPATCH
00095     DECLARE_DISPATCH_MAP()
00096     DECLARE_INTERFACE_MAP()
00097 };
00098
00100
00101 //{{AFX_INSERT_LOCATION}}
00102 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00103
00104 #endif // !defined(AFX_GRAPHDOC_H__09F456C1_0018_11D2_BCAA_000000000000__INCLUDED_)
Generated on Sun Feb 24 01:21:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/GraphFrm.cpp Source File

WinCvs/GraphFrm.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 // GraphFrm.cpp : implementation of the CGraphFrame class
00022 //
00023
00024 #include "stdafx.h"
00025 #include "wincvs.h"
00026
00027 #include "GraphFrm.h"
00028 #include "GraphView.h"
00029 #include "WinCvsView.h"
00030 #include "MainFrm.h"
00031
00032 #ifdef _DEBUG
00033 #define new DEBUG_NEW
00034 #undef THIS_FILE
00035 static char THIS_FILE[] = __FILE__;
00036 #endif
00037
00039 // CGraphFrame
00040
00041 IMPLEMENT_DYNCREATE(CGraphFrame, CCJMDIChildWnd)
00042
00043 BEGIN_MESSAGE_MAP(CGraphFrame, CCJMDIChildWnd)
00044     //{{AFX_MSG_MAP(CGraphFrame)
00045         // NOTE - the ClassWizard will add and remove mapping macros here.
00046         //    DO NOT EDIT what you see in these blocks of generated code !
00047     //}}AFX_MSG_MAP
00048 END_MESSAGE_MAP()
00049
00051 // CGraphFrame construction/destruction
00052
00053 CGraphFrame::CGraphFrame()
00054 {
00055     // TODO: add member initialization code here
00056
00057 }
00058
00059 CGraphFrame::~CGraphFrame()
00060 {
00061 }
00062
00064 // CGraphFrame diagnostics
00065
00066 #ifdef _DEBUG
00067 void CGraphFrame::AssertValid() const
00068 {
00069     CCJMDIChildWnd::AssertValid();
00070 }
00071
00072 void CGraphFrame::Dump(CDumpContext& dc) const
00073 {
00074     CCJMDIChildWnd::Dump(dc);
00075 }
00076
00077 #endif //_DEBUG
00078
00080 // CGraphFrame message handlers
00081
00082 BOOL CGraphFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
00083 {
00084     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00085     if(app->GetMainFrame()->OnBroadcastCmdMsg(nID, nCode, pExtra, pHandlerInfo))
00086         return TRUE;
00087
00088     return CCJMDIChildWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
00089 }
Generated on Sun Feb 24 01:21:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/GraphFrm.h Source File

WinCvs/GraphFrm.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 // GraphFrm.h : interface of the CGraphFrame class
00022 //
00024
00025 #if !defined(AFX_GRAPHFRM_H__09F456BF_0018_11D2_BCAA_000000000000__INCLUDED_)
00026 #define AFX_GRAPHFRM_H__09F456BF_0018_11D2_BCAA_000000000000__INCLUDED_
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif // _MSC_VER >= 1000
00031
00032 class CGraphFrame : public CCJMDIChildWnd
00033 {
00034     DECLARE_DYNCREATE(CGraphFrame)
00035 public:
00036     CGraphFrame();
00037
00038 // Attributes
00039 public:
00040
00041 // Operations
00042 public:
00043
00044 // Overrides
00045     // ClassWizard generated virtual function overrides
00046     //{{AFX_VIRTUAL(CGraphFrame)
00047     virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
00048     //}}AFX_VIRTUAL
00049
00050 // Implementation
00051 public:
00052     virtual ~CGraphFrame();
00053
00054 #ifdef _DEBUG
00055     virtual void AssertValid() const;
00056     virtual void Dump(CDumpContext& dc) const;
00057 #endif
00058
00059 // Generated message map functions
00060 protected:
00061
00062     //{{AFX_MSG(CGraphFrame)
00063         // NOTE - the ClassWizard will add and remove member functions here.
00064         //    DO NOT EDIT what you see in these blocks of generated code!
00065     //}}AFX_MSG
00066     DECLARE_MESSAGE_MAP()
00067 };
00068
00070
00071 //{{AFX_INSERT_LOCATION}}
00072 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00073
00074 #endif // !defined(AFX_GRAPH_H__09F456BF_0018_11D2_BCAA_000000000000__INCLUDED_)
Generated on Sun Feb 24 01:21:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/GraphView.cpp Source File

WinCvs/GraphView.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 // GraphView.cpp : implementation file
00018 //
00019
00020 #include "stdafx.h"
00021 #include "wincvs.h"
00022 #include "GraphView.h"
00023 #include "GraphDoc.h"
00024 #include "AppConsole.h"
00025 #include "LogParse.h"
00026 #include "CvsEntries.h"
00027 #include "BrowseFileView.h"
00028 #include "WinCvsBrowser.h"
00029 #include "CvsArgs.h"
00030 #include "AppGlue.h"
00031 #include "WincvsView.h"
00032 #include "CvsPrefs.h"
00033 #include "FileTraversal.h"
00034 #include "ProgressDialog.h"
00035 #include "GraphOptDlg.h"
00036 #include "AdminOptionDlg.h"
00037 #include "CvsAlert.h"
00038 #include "CvsCommands.h"
00039
00040 #ifdef _DEBUG
00041 #define new DEBUG_NEW
00042 #undef THIS_FILE
00043 static char THIS_FILE[] = __FILE__;
00044 #endif
00045
00046 // persitent settings
00047 CPersistentInt gGraphSelColor("P_GraphSelColor", RGB_DEF_SEL);
00048 CPersistentInt gGraphShadowColor("P_GraphShadowColor", RGB_DEF_SHADOW);
00049 CPersistentInt gGraphHeaderColor("P_GraphHeaderColor", RGB_DEF_HEADER);
00050 CPersistentInt gGraphTagColor("P_GraphTagColor", RGB_DEF_TAG);
00051 CPersistentInt gGraphBranchColor("P_GraphBranchColor", RGB_DEF_BRANCH);
00052 CPersistentInt gGraphNodeColor("P_GraphNodeColor", RGB_DEF_NODE);
00053 CPersistentInt gGraphDeadNodeColor("P_GraphDeadNodeColor", RGB_DEF_DEADNODE);
00054 CPersistentInt gGraphUserStateNodeColor("P_GraphUserStateNodeColor", RGB_DEF_USERSTATENODE);
00055
00057 // CGraphView
00058
00059 IMPLEMENT_DYNCREATE(CGraphView, CScrollView)
00060
00061 CGraphView::CGraphView()
00062 {
00063     fFirstTime = true;
00064     if(m_ImageList.m_hImageList == 0L)
00065         m_ImageList.Create(IDB_SMALLICONS, 16, 1, RGB(255, 255, 255));
00066 }
00067
00068 CGraphView::~CGraphView()
00069 {
00070 }
00071
00072
00073 BEGIN_MESSAGE_MAP(CGraphView, CScrollView)
00074     //{{AFX_MSG_MAP(CGraphView)
00075     ON_WM_LBUTTONDOWN()
00076     ON_COMMAND(ID_VIEW_RELOAD, OnViewReload)
00077     ON_UPDATE_COMMAND_UI(ID_VIEW_RELOAD, OnUpdateViewReload)
00078     ON_COMMAND(ID_VIEW_DIFF, OnViewDiff)
00079     ON_UPDATE_COMMAND_UI(ID_VIEW_DIFF, OnUpdateViewDiff)
00080     ON_COMMAND(ID_VIEW_UPDATE, OnViewUpdate)
00081     ON_UPDATE_COMMAND_UI(ID_VIEW_UPDATE, OnUpdateViewUpdate)
00082     ON_COMMAND(ID_VIEW_TAG, OnViewTag)
00083     ON_UPDATE_COMMAND_UI(ID_VIEW_TAG, OnUpdateViewTag)
00084     ON_COMMAND(ID_VIEW_DELREV, OnViewDelrev)
00085     ON_UPDATE_COMMAND_UI(ID_VIEW_DELREV, OnUpdateViewDelrev)
00086     ON_COMMAND(ID_VIEW_SELNONSIG, OnViewSelnonsig)
00087     ON_UPDATE_COMMAND_UI(ID_VIEW_SELNONSIG, OnUpdateViewSelnonsig)
00088     ON_COMMAND(ID_VIEW_RETRIEVE, OnViewRetrieve)
00089     ON_UPDATE_COMMAND_UI(ID_VIEW_RETRIEVE, OnUpdateViewRetrieve)
00090     ON_UPDATE_COMMAND_UI(ID_VIEW_RECURSIVE, DisableUpdate)
00091     ON_WM_CONTEXTMENU()
00092     ON_COMMAND(ID_QUERY_ANNOTATE, OnQueryAnnotate)
00093     ON_UPDATE_COMMAND_UI(ID_QUERY_ANNOTATE, OnUpdateQueryAnnotate)
00094     ON_COMMAND(ID_GRAPH_GRAPHOPTIONS, OnGraphGraphoptions)
00095     ON_UPDATE_COMMAND_UI(ID_GRAPH_CHANGELOGMESSAGE, OnUpdateGraphChangelogmessage)
00096     ON_COMMAND(ID_GRAPH_CHANGELOGMESSAGE, OnGraphChangelogmessage)
00097     ON_UPDATE_COMMAND_UI(ID_GRAPH_SETDESCRIPTION, OnUpdateGraphSetdescription)
00098     ON_COMMAND(ID_GRAPH_SETDESCRIPTION, OnGraphSetdescription)
00099     ON_COMMAND(ID_GRAPH_SETSTATE, OnGraphSetstate)
00100     ON_UPDATE_COMMAND_UI(ID_GRAPH_SETSTATE, OnUpdateGraphSetstate)
00101     ON_COMMAND(ID_VIEW_UNLOCKF, OnViewUnlockf)
00102     ON_UPDATE_COMMAND_UI(ID_VIEW_MISSING, DisableUpdate)
00103     ON_UPDATE_COMMAND_UI(ID_VIEW_MODIFIED, DisableUpdate)
00104     ON_UPDATE_COMMAND_UI(ID_VIEW_CONFLICT, DisableUpdate)
00105     ON_UPDATE_COMMAND_UI(ID_VIEW_UNKNOWN, DisableUpdate)
00106     ON_UPDATE_COMMAND_UI(ID_VIEW_HIDEUNKNOWN, DisableUpdate)
00107     ON_UPDATE_COMMAND_UI(ID_VIEW_IGNORE, DisableUpdate)
00108     ON_UPDATE_COMMAND_UI(ID_VIEW_ADDED, DisableUpdate)
00109     ON_UPDATE_COMMAND_UI(ID_VIEW_REMOVED, DisableUpdate)
00110     ON_UPDATE_COMMAND_UI(ID_VIEW_CHANGED, DisableUpdate)
00111     ON_UPDATE_COMMAND_UI(ID_FILTERMASK, DisableUpdate)
00112     ON_UPDATE_COMMAND_UI(ID_VIEW_UNLOCKF, OnUpdateViewUnlockf)
00113     //}}AFX_MSG_MAP
00114     ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
00115     ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
00116     ON_WM_INITMENUPOPUP()
00117 END_MESSAGE_MAP()
00118
00119 class CWinLogData : public CLogNodeData
00120 {
00121 public:
00122     CWinLogData(CLogNode *node);
00123     virtual ~CWinLogData();
00124
00125     inline kLogNode GetType(void) const { return fNode->GetType(); }
00126     const char *GetStr(void);
00127
00128     void ComputeBounds(const CPoint & topLeft, CDC & hdc,
00129         EntnodeData *entryInfo = 0L);
00130     void Offset(CPoint o);
00131     void Update(CDC & hdc, EntnodeData *entryInfo = 0L);
00132
00133     inline CRect & Bounds(void) { return totB; }
00134     inline CRect & SelfBounds(void) { return selfB; }
00135
00136     inline bool Selected(void) const { return sel; }
00137     void SetSelected(CScrollView *view, bool state);
00138     void UnselectAll(CScrollView *view);
00139     CWinLogData *HitTest(CPoint point);
00140
00141     static CWinLogData *CreateNewData(CLogNode *node);
00142
00143     bool IsDiskNode(EntnodeData *entryInfo);
00144     bool IsDeadNode();
00145     bool IsUserState();
00146
00147 protected:
00148     virtual void UpdateSelf(CDC & hdc, EntnodeData *entryInfo) = 0;
00149     virtual CSize GetBoundsSelf(CDC & hdc, EntnodeData *entryInfo) = 0;
00150
00151     inline CWinLogData *GetData(CLogNode *node)
00152         { return (CWinLogData *)node->GetUserData(); }
00153
00154     CRect selfB;
00155     CRect totB;
00156     bool sel;
00157 };
00158
00159 class CWinLogHeaderData : public CWinLogData
00160 {
00161 public:
00162     CWinLogHeaderData(CLogNode *node) : CWinLogData(node) {}
00163     virtual ~CWinLogHeaderData() {}
00164
00165 protected:
00166     virtual void UpdateSelf(CDC & hdc, EntnodeData *entryInfo);
00167     virtual CSize GetBoundsSelf(CDC & hdc, EntnodeData *entryInfo);
00168 };
00169
00170 class CWinLogRevData : public CWinLogData
00171 {
00172 public:
00173     CWinLogRevData(CLogNode *node) : CWinLogData(node) {}
00174     virtual ~CWinLogRevData() {}
00175
00176 protected:
00177     virtual void UpdateSelf(CDC & hdc, EntnodeData *entryInfo);
00178     virtual CSize GetBoundsSelf(CDC & hdc, EntnodeData *entryInfo);
00179 };
00180
00181 class CWinLogTagData : public CWinLogData
00182 {
00183 public:
00184     CWinLogTagData(CLogNode *node) : CWinLogData(node) {}
00185     virtual ~CWinLogTagData() {}
00186
00187 protected:
00188     virtual void UpdateSelf(CDC & hdc, EntnodeData *entryInfo);
00189     virtual CSize GetBoundsSelf(CDC & hdc, EntnodeData *entryInfo);
00190 };
00191
00192 class CWinLogBranchData : public CWinLogData
00193 {
00194 public:
00195     CWinLogBranchData(CLogNode *node) : CWinLogData(node) {}
00196     virtual ~CWinLogBranchData() {}
00197
00198 protected:
00199     virtual void UpdateSelf(CDC & hdc, EntnodeData *entryInfo);
00200     virtual CSize GetBoundsSelf(CDC & hdc, EntnodeData *entryInfo);
00201 };
00202
00203 CSize CWinLogHeaderData::GetBoundsSelf(CDC & hdc, EntnodeData *entryInfo)
00204 {
00205     CLogNodeHeader & header = *(CLogNodeHeader *)fNode;
00206     return hdc.GetTextExtent((*header).WorkingFile(),
00207         (*header).WorkingFile().length());
00208 }
00209
00211 static void DrawOctangle(CDC& hdc, const CRect& selfB)
00212 {
00213     int cutLen = selfB.Height() / 4;
00214     CPoint point1(selfB.left, selfB.top + cutLen);
00215     CPoint point2(selfB.left + cutLen, selfB.top);
00216     CPoint point3(selfB.right - cutLen, selfB.top);
00217     CPoint point4(selfB.right, selfB.top + cutLen);
00218     CPoint point5(selfB.right, selfB.bottom - cutLen);
00219     CPoint point6(selfB.right - cutLen, selfB.bottom);
00220     CPoint point7(selfB.left + cutLen, selfB.bottom);
00221     CPoint point8(selfB.left, selfB.bottom - cutLen);
00222     CPoint arrPoints[OCTANGLE_COUNT] = {
00223         point1,
00224         point2,
00225         point3,
00226         point4,
00227         point5,
00228         point6,
00229         point7,
00230         point8};
00231
00232     hdc.Polygon(arrPoints, OCTANGLE_COUNT);
00233 }
00234
00235 static void DrawNode(CDC & hdc, const CRect & selfB,
00236                      COLORREF contour,
00237                      kNodeShape shape, bool issel, int penStyle = PS_SOLID)
00238 {
00239     CPen *pOldPen = 0L;
00240     CBrush *pOldBrush = 0L;
00241     CPen pen, pen2;
00242     CBrush brush;
00243     COLORREF selcolor = gGraphSelColor;
00244     COLORREF shadowc = gGraphShadowColor;
00245
00246     TRY
00247     {
00248         //prepare the shadow
00249         CRect shadow = selfB;
00250         shadow.OffsetRect(SHADOW_OFFSET_PT);
00251
00252         brush.CreateSolidBrush(shadowc);
00253         pOldBrush = hdc.SelectObject(&brush);
00254         pen.CreatePen(penStyle, 1, shadowc);
00255         pOldPen = hdc.SelectObject(&pen);
00256
00257         //draw the shadow
00258         switch( shape )
00259         {
00260         case kRectangle:
00261             hdc.Rectangle(shadow);
00262             break;
00263         case kRoundRect:
00264             hdc.RoundRect(shadow, ROUND_RECT_PT);
00265             break;
00266         case kOctangle:
00267             DrawOctangle(hdc, shadow);
00268             break;
00269         default:
00270             ASSERT(FALSE);  //unknown type
00271             return;
00272         }
00273
00274         //prepare selection
00275         if( issel )
00276         {
00277             brush.DeleteObject();
00278             brush.CreateSolidBrush(selcolor);
00279             hdc.SelectObject(&brush);
00280         }
00281         else
00282         {
00283             hdc.SelectObject(pOldBrush);
00284             pOldBrush = 0L;
00285         }
00286
00287         pen2.CreatePen(penStyle, 1, contour);
00288         hdc.SelectObject(&pen2);
00289
00290         //draw the main shape
00291         switch( shape )
00292         {
00293         case kRectangle:
00294             hdc.Rectangle(selfB);
00295             break;
00296         case kRoundRect:
00297             hdc.RoundRect(selfB, ROUND_RECT_PT);
00298             break;
00299         case kOctangle:
00300             DrawOctangle(hdc, selfB);
00301             break;
00302         default:
00303             ASSERT(FALSE);  //unknown type
00304             return;
00305         }
00306
00307         //cleanup
00308         if (pOldPen != 0L)
00309         {
00310             hdc.SelectObject(pOldPen);
00311             pOldPen = 0L;
00312         }
00313         if (pOldBrush != 0L)
00314         {
00315             hdc.SelectObject(pOldBrush);
00316             pOldBrush = 0L;
00317         }
00318
00319         pen.DeleteObject();
00320         pen2.DeleteObject();
00321         brush.DeleteObject();
00322     }
00323     CATCH_ALL(e)
00324     {
00325         if (pOldPen != 0L)
00326             hdc.SelectObject(pOldPen);
00327         if (pOldBrush != 0L)
00328             hdc.SelectObject(pOldBrush);
00329     }
00330     END_CATCH_ALL
00331 }
00332
00333 void CWinLogHeaderData::UpdateSelf(CDC & hdc, EntnodeData *entryInfo)
00334 {
00335     // draw the node
00336     ::DrawNode(hdc, selfB, gGraphHeaderColor, kRoundRect, sel);
00337
00338     // draw the content of the node
00339     TEXTMETRIC tm;
00340     hdc.GetTextMetrics(&tm);
00341     CPoint center = selfB.CenterPoint();
00342     int nCenterX = center.x;
00343     int nCenterY = center.y - tm.tmHeight/2;
00344     CLogNodeHeader & header = *(CLogNodeHeader *)fNode;
00345     hdc.ExtTextOut(nCenterX, nCenterY, ETO_CLIPPED, selfB,
00346         (*header).WorkingFile(), (*header).WorkingFile().length(), NULL);
00347 }
00348
00349 CSize CWinLogRevData::GetBoundsSelf(CDC & hdc, EntnodeData *entryInfo)
00350 {
00351     CLogNodeRev & rev = *(CLogNodeRev *)fNode;
00352     CSize size = hdc.GetTextExtent((*rev).RevNum().c_str(),
00353         strlen((*rev).RevNum().c_str()));
00354     if(IsDiskNode(entryInfo))
00355     {
00356         size.cx += 2 + 16 + 2;
00357         size.cy = max(16, size.cy);
00358     }
00359     return size;
00360 }
00361
00362 void CWinLogRevData::UpdateSelf(CDC & hdc, EntnodeData *entryInfo)
00363 {
00364     CRect txtRect = selfB;
00365
00366     if(IsDiskNode(entryInfo))
00367     {
00368         txtRect.left += 2 + 16 + 2;
00369     }
00370
00371     // draw the node
00372     COLORREF contour = gGraphNodeColor;
00373     int penStyle = PS_SOLID;
00374
00375     if(IsDeadNode())
00376     {
00377         contour = (COLORREF)gGraphDeadNodeColor;
00378         penStyle = STYLE_DEADNODE;
00379     }
00380     else if(IsUserState())
00381     {
00382         contour = (COLORREF)gGraphUserStateNodeColor;
00383         penStyle = STYLE_USERSTATENODE;
00384     }
00385
00386     ::DrawNode(hdc, selfB, contour, kRectangle, sel, penStyle);
00387
00388     // draw the state icon if it is the rev. of the disk
00389     if(IsDiskNode(entryInfo))
00390     {
00391         CImageList & list = CGraphView::GetImgList();
00392         CPoint w(selfB.TopLeft());
00393         w.x += 2;
00394         w.y += (selfB.Height() - 16) / 2;
00395         list.Draw(&hdc, CBrowseFileView::GetImageForEntry(entryInfo),
00396             w, ILD_TRANSPARENT);
00397     }
00398
00399     // draw the content of the node
00400     TEXTMETRIC tm;
00401     hdc.GetTextMetrics(&tm);
00402     CPoint center = txtRect.CenterPoint();
00403     int nCenterX = center.x;
00404     int nCenterY = center.y - tm.tmHeight/2;
00405     CLogNodeRev & rev = *(CLogNodeRev *)fNode;
00406     hdc.ExtTextOut(nCenterX, nCenterY, ETO_CLIPPED, txtRect,
00407             (*rev).RevNum().c_str(), strlen((*rev).RevNum().c_str()), NULL);
00408 }
00409
00410 CSize CWinLogTagData::GetBoundsSelf(CDC & hdc, EntnodeData *entryInfo)
00411 {
00412     CLogNodeTag & tag = *(CLogNodeTag *)fNode;
00413     return hdc.GetTextExtent(*tag, (*tag).length());
00414 }
00415
00416 void CWinLogTagData::UpdateSelf(CDC & hdc, EntnodeData *entryInfo)
00417 {
00418     // draw the node
00419     ::DrawNode(hdc, selfB, gGraphTagColor, kRoundRect, sel);
00420
00421     // draw the content of the node
00422     TEXTMETRIC tm;
00423     hdc.GetTextMetrics(&tm);
00424     CPoint center = selfB.CenterPoint();
00425     int nCenterX = center.x;
00426     int nCenterY = center.y - tm.tmHeight/2;
00427     CLogNodeTag & tag = *(CLogNodeTag *)fNode;
00428     hdc.ExtTextOut(nCenterX, nCenterY, ETO_CLIPPED, selfB,
00429         *tag, (*tag).length(), NULL);
00430 }
00431
00432 CSize CWinLogBranchData::GetBoundsSelf(CDC & hdc, EntnodeData *entryInfo)
00433 {
00434     CLogNodeBranch & branch = *(CLogNodeBranch *)fNode;
00435     return hdc.GetTextExtent(*branch, (*branch).length());
00436 }
00437
00438 void CWinLogBranchData::UpdateSelf(CDC & hdc, EntnodeData *entryInfo)
00439 {
00440     // draw the node
00441     ::DrawNode(hdc, selfB, gGraphBranchColor, kOctangle, sel);
00442
00443     // draw the content of the node
00444     TEXTMETRIC tm;
00445     hdc.GetTextMetrics(&tm);
00446     CPoint center = selfB.CenterPoint();
00447     int nCenterX = center.x;
00448     int nCenterY = center.y - tm.tmHeight/2;
00449     CLogNodeBranch & branch = *(CLogNodeBranch *)fNode;
00450     hdc.ExtTextOut(nCenterX, nCenterY, ETO_CLIPPED, selfB,
00451         *branch, (*branch).length(), NULL);
00452 }
00453
00454 CWinLogData::CWinLogData(CLogNode *node) : CLogNodeData(node)
00455 {
00456     selfB.SetRectEmpty();
00457     totB.SetRectEmpty();
00458     sel = false;
00459 }
00460
00461 CWinLogData::~CWinLogData()
00462 {
00463 }
00464
00465 const char *CWinLogData::GetStr(void)
00466 {
00467     switch(GetType())
00468     {
00469         case kNodeHeader :
00470         {
00471             CLogNodeHeader & header = *(CLogNodeHeader *)fNode;
00472             return (*header).WorkingFile();
00473             break;
00474         }
00475         case kNodeBranch :
00476         {
00477             CLogNodeBranch & branch = *(CLogNodeBranch *)fNode;
00478             return *branch;
00479             break;
00480         }
00481         case kNodeRev :
00482         {
00483             CLogNodeRev & rev = *(CLogNodeRev *)fNode;
00484             return (*rev).RevNum().c_str();
00485             break;
00486         }
00487         case kNodeTag :
00488         {
00489             CLogNodeTag & tag = *(CLogNodeTag *)fNode;
00490             return *tag;
00491             break;
00492         }
00493     }
00494     return 0L;
00495 }
00496
00497 CWinLogData * CWinLogData::CreateNewData(CLogNode *node)
00498 {
00499     if(node->GetUserData() != 0L)
00500         return (CWinLogData *)node->GetUserData();
00501
00502     CWinLogData *res = 0L;
00503     switch(node->GetType())
00504     {
00505     case kNodeHeader :
00506         res = new CWinLogHeaderData(node);
00507         break;
00508     case kNodeBranch :
00509         res = new CWinLogBranchData(node);
00510         break;
00511     case kNodeRev :
00512         res = new CWinLogRevData(node);
00513         break;
00514     case kNodeTag :
00515         res = new CWinLogTagData(node);
00516         break;
00517     }
00518     node->SetUserData(res);
00519     return res;
00520 }
00521
00522 bool CWinLogData::IsDiskNode(EntnodeData *entryInfo)
00523 {
00524     if(entryInfo == 0L || GetType() != kNodeRev)
00525         return false;
00526     const char *vn = (*entryInfo)[EntnodeFile::kVN];
00527     if(vn == 0L)
00528         return false;
00529
00530     return strcmp(vn, (**(CLogNodeRev *)fNode).RevNum().c_str()) == 0;
00531 }
00532
00533 bool CWinLogData::IsDeadNode()
00534 {
00535     if(GetType() != kNodeRev)
00536         return false;
00537
00538     return strcmp("dead", (**(CLogNodeRev *)fNode).State()) == 0;
00539 }
00540
00541 bool CWinLogData::IsUserState()
00542 {
00543     if(GetType() != kNodeRev)
00544         return false;
00545
00546     return !(strcmp("dead", (**(CLogNodeRev *)fNode).State()) == 0 ||
00547         strcmp("Exp", (**(CLogNodeRev *)fNode).State()) == 0);
00548 }
00549
00550 const int kVChildSpace = 8;
00551 const int kHChildSpace = 40;
00552 const int kInflateNodeSpace = 8;
00553
00554 void CWinLogData::Offset(CPoint o)
00555 {
00556     selfB.OffsetRect(o);
00557     totB.OffsetRect(o);
00558     vector<CLogNode *>::iterator i;
00559     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00560     {
00561         CLogNode *subNode = *i;
00562         GetData(subNode)->Offset(o);
00563     }
00564     if(fNode->Next() != 0L)
00565         GetData(fNode->Next())->Offset(o);
00566 }
00567
00568 void CWinLogData::SetSelected(CScrollView *view, bool state)
00569 {
00570     sel = state;
00571
00572     CRect invalR = selfB;
00573     invalR.OffsetRect(-view->GetDeviceScrollPosition());
00574     view->InvalidateRect(invalR);
00575 }
00576
00577 void CWinLogData::UnselectAll(CScrollView *view)
00578 {
00579     if(sel)
00580     {
00581         SetSelected(view, false);
00582     }
00583
00584     vector<CLogNode *>::iterator i;
00585     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00586     {
00587         CLogNode *subNode = *i;
00588         GetData(subNode)->UnselectAll(view);
00589     }
00590     if(fNode->Next() != 0L)
00591         GetData(fNode->Next())->UnselectAll(view);
00592 }
00593
00594 CWinLogData *CWinLogData::HitTest(CPoint point)
00595 {
00596     if(!totB.PtInRect(point))
00597         return 0L;
00598     if(selfB.PtInRect(point))
00599         return this;
00600
00601     CWinLogData *result;
00602     vector<CLogNode *>::iterator i;
00603     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00604     {
00605         CLogNode *subNode = *i;
00606         result = GetData(subNode)->HitTest(point);
00607         if(result != 0L)
00608             return result;
00609     }
00610     if(fNode->Next() != 0L)
00611     {
00612         result = GetData(fNode->Next())->HitTest(point);
00613         if(result != 0L)
00614             return result;
00615     }
00616     return 0L;
00617 }
00618
00619 void CWinLogData::Update(CDC & hdc, EntnodeData *entryInfo)
00620 {
00621     CLogNode *subNode;
00622     CLogNode *nextNode = fNode->Next();
00623     CPen *pOldPen = 0L;
00624     CBrush *pOldBrush = 0L;
00625     CPen pen, pen2;
00626     CBrush brush;
00627
00628     UpdateSelf(hdc, entryInfo);
00629
00630     TRY
00631     {
00632         pen.CreatePen(PS_SOLID, 2, RGB(0, 0, 255));
00633         pen2.CreatePen(PS_SOLID, 1, RGB(0, 0, 0));
00634         pOldPen = hdc.SelectObject(&pen);
00635
00636         int topY = selfB.TopLeft().y + 2;
00637         int botY = selfB.BottomRight().y - 2;
00638         int lefX = selfB.BottomRight().x + 4;
00639
00640         int count = 1;
00641         int tot = fNode->Childs().size() + 1;
00642
00643         // draw the children
00644         vector<CLogNode *>::iterator i;
00645         for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i, ++count)
00646         {
00647             subNode = *i;
00648
00649             // draw the link
00650             CRect & cb = GetData(subNode)->SelfBounds();
00651             if(subNode->GetType() == kNodeRev || subNode->GetType() == kNodeBranch)
00652                 hdc.SelectObject(&pen);
00653             else
00654                 hdc.SelectObject(&pen2);
00655             float y = (float)topY + (float)(botY - topY) *
00656                 (float)count / (float)tot;
00657             int rigX = cb.TopLeft().x - 4;
00658             float x = (float)rigX - (float)(rigX - lefX) *
00659                 (float)count / (float)tot;
00660
00661             //special drawing for the header node
00662             if( count == 1 && fNode->GetType() == kNodeHeader )
00663             {
00664                 hdc.MoveTo(selfB.TopLeft().x + kHChildSpace/2, selfB.BottomRight().y);
00665                 hdc.LineTo(selfB.TopLeft().x + kHChildSpace/2, cb.CenterPoint().y);
00666                 hdc.LineTo(cb.TopLeft().x, cb.CenterPoint().y);
00667             }
00668             else
00669             {
00670                 //int halfX = (cb.TopLeft().x - selfB.BottomRight().x) / 2;
00671                 hdc.MoveTo(selfB.BottomRight().x, (int)y);
00672                 hdc.LineTo(x, (int)y);
00673                 hdc.LineTo(x, cb.CenterPoint().y);
00674                 hdc.LineTo(cb.TopLeft().x, cb.CenterPoint().y);
00675             }
00676
00677             // draw the sub-node
00678             GetData(subNode)->Update(hdc, entryInfo);
00679         }
00680
00681         // draw the next node
00682         if(nextNode != 0L)
00683         {
00684             // draw the link
00685             CRect & nb = GetData(nextNode)->SelfBounds();
00686             if(nextNode->GetType() == kNodeRev || nextNode->GetType() == kNodeBranch)
00687                 hdc.SelectObject(&pen);
00688             else
00689                 hdc.SelectObject(&pen2);
00690             int centerX = selfB.Width() < nb.Width() ?
00691                 selfB.CenterPoint().x : nb.CenterPoint().x;
00692             hdc.MoveTo(centerX, selfB.BottomRight().y);
00693             hdc.LineTo(centerX, nb.TopLeft().y);
00694
00695             // draw the next node
00696             GetData(nextNode)->Update(hdc, entryInfo);
00697         }
00698
00699         if (pOldPen != 0L)
00700         {
00701             hdc.SelectObject(pOldPen);
00702             pOldPen = 0L;
00703         }
00704         if (pOldBrush != 0L)
00705         {
00706             hdc.SelectObject(pOldBrush);
00707             pOldBrush = 0L;
00708         }
00709
00710         pen.DeleteObject();
00711         pen2.DeleteObject();
00712     }
00713     CATCH_ALL(e)
00714     {
00715         if (pOldPen != 0L)
00716             hdc.SelectObject(pOldPen);
00717         if (pOldBrush != 0L)
00718             hdc.SelectObject(pOldBrush);
00719     }
00720     END_CATCH_ALL
00721 }
00722
00723 void CWinLogData::ComputeBounds(const CPoint & topLeft, CDC & hdc,
00724                                 EntnodeData *entryInfo)
00725 {
00726     CLogNode *subNode;
00727     CLogNode *nextNode = fNode->Next();
00728
00729     // first compute childrens bounds
00730     vector<CLogNode *>::iterator i;
00731     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00732     {
00733         subNode = *i;
00734         CWinLogData::CreateNewData(subNode);
00735         GetData(subNode)->ComputeBounds(topLeft, hdc, entryInfo);
00736     }
00737     if(nextNode != 0L)
00738         CWinLogData::CreateNewData(nextNode);
00739
00740     // compute self place
00741     selfB.SetRectEmpty();
00742     CSize size = GetBoundsSelf(hdc, entryInfo);
00743     size.cx += kInflateNodeSpace;
00744     size.cy += kInflateNodeSpace;
00745     selfB.SetRect(0, 0, size.cx, size.cy);
00746
00747     // offset to the place assigned to this node
00748     selfB.OffsetRect(topLeft - selfB.TopLeft());
00749
00750     // calculate the total height of the childrens
00751     int vSize = 0;
00752     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00753     {
00754         subNode = *i;
00755         CRect & b = GetData(subNode)->Bounds();
00756         vSize += b.Height();
00757     }
00758     if(!fNode->Childs().empty())
00759         vSize += (fNode->Childs().size() - 1) * kVChildSpace;
00760
00761     // offset the children relative to self
00762     CPoint startChilds(topLeft.x + selfB.Width() + kHChildSpace,
00763         /*selfB.CenterPoint().y - vSize / 2*/topLeft.y);
00764
00765     //place the first child at the bottom of the header node so it won't take so much space for long filenames
00766     if( fNode->GetType() == kNodeHeader )
00767     {
00768         startChilds = CPoint(topLeft.x + kHChildSpace, topLeft.y + selfB.Height() + kVChildSpace);
00769     }
00770
00771     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00772     {
00773         subNode = *i;
00774         CRect curPos = GetData(subNode)->Bounds();
00775         GetData(subNode)->Offset(startChilds - curPos.TopLeft());
00776         startChilds.y += curPos.Height() + kVChildSpace;
00777     }
00778
00779     // calculate the total bounds of the childrens
00780     CRect bc;
00781     bc.SetRectEmpty();
00782     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00783     {
00784         subNode = *i;
00785         CRect & b = GetData(subNode)->Bounds();
00786         bc.UnionRect(bc, b);
00787     }
00788
00789     // now we got the complete size
00790     totB.UnionRect(selfB, bc);
00791
00792     if(nextNode != 0L)
00793     {
00794         CPoint nextTopLeft;
00795         nextTopLeft.x = totB.TopLeft().x;
00796         nextTopLeft.y = totB.BottomRight().y + kVChildSpace;
00797         GetData(nextNode)->ComputeBounds(nextTopLeft, hdc, entryInfo);
00798
00799         totB.UnionRect(totB, GetData(nextNode)->Bounds());
00800     }
00801 }
00802
00804 // CGraphView drawing
00805
00806 CImageList CGraphView::m_ImageList;
00807
00808 void CGraphView::CalcImageSize(void)
00809 {
00810     const CPoint startPoint(STARTPOINT_PT);
00811     CWindowDC dc(this);
00812     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
00813     CLogNode *root = pDoc->GetNode();
00814     if(root == 0L)
00815         return;
00816
00817     // set all the bounds locations
00818     CWinLogData *data = CWinLogData::CreateNewData(root);
00819     root->SetUserData(data);
00820     data->ComputeBounds(startPoint, dc, pDoc->GetEntryInfo());
00821
00822     // reoffset from (0, 0)
00823     CRect bounds = data->Bounds();
00824     data->Offset(startPoint - bounds.TopLeft());
00825     bounds = data->Bounds();
00826
00827     // set the scroll size, we add the margin of the start point offset on each side
00828     SetScrollSizes(MM_TEXT, bounds.Size() + CSize(startPoint)+CSize(startPoint)+CSize(SHADOW_OFFSET_PT));
00829 }
00830
00831 void CGraphView::OnInitialUpdate()
00832 {
00833     CScrollView::OnInitialUpdate();
00834
00835     SetScrollSizes(MM_TEXT, CSize(200, 100));
00836     //CalcImageSize();
00837 }
00838
00839 void CGraphView::OnDraw(CDC* pDC)
00840 {
00841     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
00842     CLogNode *root = pDoc->GetNode();
00843     if(root == 0L || root->GetUserData() == 0L)
00844         return;
00845
00846     CWinLogData *data = (CWinLogData *)root->GetUserData();
00847
00848     pDC->SetTextAlign(TA_CENTER);
00849     pDC->SetBkMode(TRANSPARENT);
00850     data->Update(*pDC, pDoc->GetEntryInfo());
00851 }
00852
00854 // CGraphView diagnostics
00855
00856 #ifdef _DEBUG
00857 void CGraphView::AssertValid() const
00858 {
00859     CScrollView::AssertValid();
00860 }
00861
00862 void CGraphView::Dump(CDumpContext& dc) const
00863 {
00864     CScrollView::Dump(dc);
00865 }
00866 #endif //_DEBUG
00867
00868 class CGraphRectTracker : public CRectTracker
00869 {
00870 public:
00871     CGraphRectTracker(CGraphView *view) : mView(view) {}
00872
00873     virtual void OnChangedRect(const CRect& rectOld);
00874 protected:
00875     CGraphView *mView;
00876 };
00877
00878 void CGraphRectTracker::OnChangedRect(const CRect& rectOld)
00879 {
00880 #if 0 // :-< doesn't work...
00881     CRect r;
00882     mView->GetClientRect(&r);
00883     CPoint rb = m_rect.BottomRight();
00884
00885     if(!r.PtInRect(rb))
00886     {
00887         CPoint orig = mView->GetDeviceScrollPosition();
00888         CPoint offset;
00889         if(rb.x >= r.right)
00890             offset.x += 10;
00891         if(rb.y >= r.bottom)
00892             offset.y += 10;
00893         orig += offset;
00894         m_rect -= offset;
00895         mView->ScrollToPosition(orig);
00896     }
00897 #endif
00898 }
00899
00900 // traversal class
00901 typedef enum
00902 {
00903     kTContinue,
00904     kTGetDown,
00905     kTStop
00906 } kTGraph;
00907
00908 class TGraph
00909 {
00910 public:
00911
00912     kTGraph TraverseGraph(CLogNode * node);
00913
00914     virtual kTGraph TraverseNode(CLogNode *node) = 0;
00915 protected:
00916 };
00917
00918 kTGraph TGraph::TraverseGraph(CLogNode * node)
00919 {
00920     kTGraph res;
00921
00922     res = TraverseNode(node);
00923     if(res == kTStop)
00924         return kTStop;
00925
00926     if(res == kTGetDown)
00927     {
00928         vector<CLogNode *>::iterator i;
00929         for(i = node->Childs().begin(); i != node->Childs().end(); ++i)
00930         {
00931             res = TraverseGraph(*i);
00932             if(res == kTStop)
00933                 return kTStop;
00934         }
00935     }
00936
00937     if(node->Next() != 0L)
00938     {
00939         res = TraverseGraph(node->Next());
00940         if(res == kTStop)
00941             return kTStop;
00942     }
00943
00944     return kTContinue;
00945 };
00946
00947 class TGraphRectSelect : public TGraph
00948 {
00949 public:
00950     TGraphRectSelect(bool shiftOn, CGraphView *view, CRect & r) :
00951         mShiftOn(shiftOn), mView(view), mR(r) {}
00952
00953     virtual kTGraph TraverseNode(CLogNode *node)
00954     {
00955         CWinLogData *data = (CWinLogData *)node->GetUserData();
00956
00957         // no need to go further
00958         CRect inter;
00959         if(!inter.IntersectRect(mR, data->Bounds()))
00960         {
00961             return kTContinue;
00962         }
00963         // self enclosed in the tracker ?
00964         CRect & b = data->SelfBounds();
00965         if(mR.PtInRect(b.TopLeft()) && mR.PtInRect(b.BottomRight()))
00966         {
00967             if(!mShiftOn)
00968             {
00969                 if(!data->Selected())
00970                     data->SetSelected(mView, true);
00971             }
00972             else
00973                 data->SetSelected(mView, !data->Selected());
00974         }
00975         // traverse childrens
00976         return kTGetDown;
00977     }
00978
00979 protected:
00980     bool mShiftOn;
00981     CGraphView *mView;
00982     CRect & mR;
00983 };
00984
00986 // CGraphView message handlers
00987
00988 void CGraphView::OnLButtonDown(UINT nFlags, CPoint point)
00989 {
00990     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
00991     CLogNode *root = pDoc->GetNode();
00992     if(root == 0L || root->GetUserData() == 0L)
00993         return;
00994
00995     CWinLogData *data = (CWinLogData *)root->GetUserData();
00996
00997     if(nFlags & MK_LBUTTON)
00998     {
00999         if((nFlags & MK_SHIFT) == 0 && (nFlags & MK_CONTROL) == 0)
01000             data->UnselectAll(this);
01001         point += GetDeviceScrollPosition();
01002         CWinLogData *hit = data->HitTest(point);
01003
01004         if(hit != 0L)
01005         {
01006             if((nFlags & MK_SHIFT) == 0 && (nFlags & MK_CONTROL) == 0)
01007             {
01008                 if(!hit->Selected())
01009                 {
01010                     hit->SetSelected(this, true);
01011                     CWincvsApp *app = (CWincvsApp *)AfxGetApp();
01012                     CWincvsView *view = app->GetConsoleView();
01013                     if(view != 0L)
01014                     {
01015                         CColorConsole out(view);
01016                         CvsLogOutput(out, hit->Node());
01017                     }
01018                 }
01019             }
01020             else
01021             {
01022                 hit->SetSelected(this, !hit->Selected());
01023             }
01024         }
01025         else
01026         {
01027             CGraphRectTracker track(this);
01028             point -= GetDeviceScrollPosition();
01029             if(track.TrackRubberBand(this, point, true))
01030             {
01031                 // traverse and mark
01032                 track.m_rect.OffsetRect(GetDeviceScrollPosition());
01033                 track.m_rect.NormalizeRect();
01034                 TGraphRectSelect traversal((nFlags & MK_CONTROL) != 0, this,
01035                     track.m_rect);
01036                 traversal.TraverseGraph(root);
01037             }
01038         }
01039     }
01040     else if(nFlags & MK_RBUTTON)
01041     {
01042     }
01043
01044     CScrollView::OnLButtonDown(nFlags, point);
01045 }
01046
01047 class TGraphCmdStatus : public TGraph
01048 {
01049 public:
01050     TGraphCmdStatus() :
01051         fSel1(0L), fSel2(0L), fCountSel(0) {}
01052
01053     virtual kTGraph TraverseNode(CLogNode *node)
01054     {
01055         CWinLogData *data = (CWinLogData *)node->GetUserData();
01056
01057         if(data->Selected())
01058         {
01059             if(fSel1 == 0L)
01060                 fSel1 = data;
01061             else if(fSel2 == 0L)
01062                 fSel2 = data;
01063             fCountSel++;
01064         }
01065
01066         return kTGetDown;
01067     }
01068
01069     CWinLogData *fSel1;
01070     CWinLogData *fSel2;
01071     int fCountSel;
01072 };
01073
01074 class CGraphConsole : public CCvsConsole
01075 {
01076 public:
01077     CGraphConsole()
01078     {
01079         CWincvsApp *app = (CWincvsApp *)AfxGetApp();
01080         view = app->GetConsoleView();
01081     }
01082
01083     virtual long cvs_out(char *txt, long len)
01084     {
01085         if(view != 0L)
01086             view->OutConsole(txt, len);
01087         return  len;
01088     }
01089
01090     virtual long cvs_err(char *txt, long len)
01091     {
01092         if(view != 0L)
01093             view->OutConsole(txt, len, true);
01094         return  len;
01095     }
01096
01097     CWincvsView *view;
01098 };
01099
01100 void CGraphView::OnViewReload()
01101 {
01102     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01103     CLogNode *root = pDoc->GetNode();
01104     if(root == 0L || root->GetUserData() == 0L)
01105         return;
01106
01107     CvsArgs args;
01108     args.add("log");
01109     args.add(pDoc->GetName());
01110     args.print(pDoc->GetDir());
01111     CStr dir(pDoc->GetDir());
01112     CvsLogParse(dir, args, true, pDoc);
01113 }
01114
01115 void CGraphView::OnUpdateViewReload(CCmdUI* pCmdUI)
01116 {
01117     if(DisableCommon())
01118         pCmdUI->Enable(FALSE);
01119     else
01120         pCmdUI->Enable(TRUE);
01121 }
01122
01123 void CGraphView::OnViewDiff()
01124 {
01125     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01126     CLogNode *root = pDoc->GetNode();
01127     if(root == 0L || root->GetUserData() == 0L)
01128         return;
01129
01130     TGraphCmdStatus trav;
01131     trav.TraverseGraph(root);
01132
01133     bool done = false;
01134     if(gCvsPrefs.ExtDiff() != 0L)
01135     {
01136         CStr f1, f2, prf1, prf2, ext, base;
01137         CvsArgs args1, args2;
01138
01139         GetExtension(pDoc->GetName(), base, ext);
01140
01141         prf1 = base;
01142         prf1 << '_';
01143         prf1 << trav.fSel1->GetStr();
01144         prf1 << '_';
01145         args1.add("update");
01146         args1.add("-p");
01147         args1.add("-r");
01148         args1.add(trav.fSel1->GetStr());
01149         args1.add(pDoc->GetName());
01150         args1.print(pDoc->GetDir());
01151         f1 = launchCVS(pDoc->GetDir(), args1, (const char *)prf1, ext);
01152
01153         if(trav.fCountSel == 2)
01154         {
01155             prf2 = base;
01156             prf2 << '_';
01157             prf2 << trav.fSel2->GetStr();
01158             prf2 << '_';
01159             args2.add("update");
01160             args2.add("-p");
01161             args2.add("-r");
01162             args2.add(trav.fSel2->GetStr());
01163             args2.add(pDoc->GetName());
01164             args2.print(pDoc->GetDir());
01165             f2 = launchCVS(pDoc->GetDir(), args2, (const char *)prf2, ext);
01166         }
01167         else
01168         {
01169             f2 = pDoc->GetDir();
01170             if(!f2.endsWith(kPathDelimiter))
01171                 f2 << kPathDelimiter;
01172             f2 << pDoc->GetName();
01173         }
01174
01175         if(f1.empty() || f2.empty())
01176             return;
01177
01178         done = LaunchDiff(f1, f2);
01179     }
01180
01181     if(!done)
01182     {
01183         CvsArgs args;
01184         CGraphConsole cons;
01185         args.add("diff");
01186         args.add("-r");
01187         args.add(trav.fSel1->GetStr());
01188         if(trav.fCountSel == 2)
01189         {
01190             args.add("-r");
01191             args.add(trav.fSel2->GetStr());
01192         }
01193         args.add(pDoc->GetName());
01194         args.print(pDoc->GetDir());
01195         launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01196     }
01197 }
01198
01199 void CGraphView::OnUpdateViewDiff(CCmdUI* pCmdUI)
01200 {
01201     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01202     CLogNode *root = pDoc->GetNode();
01203     if(DisableCommon())
01204     {
01205         pCmdUI->Enable(FALSE);
01206         return;
01207     }
01208
01209     TGraphCmdStatus trav;
01210     trav.TraverseGraph(root);
01211     BOOL outEnabled = (trav.fCountSel == 2 && trav.fSel1->GetType() != kNodeHeader &&
01212         trav.fSel2->GetType() != kNodeHeader) ||
01213         (trav.fCountSel == 1 && trav.fSel1->GetType() != kNodeHeader);
01214     pCmdUI->Enable(outEnabled);
01215 }
01216
01217 void CGraphView::OnViewUpdate()
01218 {
01219     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01220     CLogNode *root = pDoc->GetNode();
01221     if(root == 0L || root->GetUserData() == 0L)
01222         return;
01223
01224     CvsArgs args;
01225     args.add("update");
01226     args.add("-A");
01227     args.add(pDoc->GetName());
01228     args.print(pDoc->GetDir());
01229     CGraphConsole cons;
01230     launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01231
01232     OnViewReload();
01233 }
01234
01235 void CGraphView::OnUpdateViewUpdate(CCmdUI* pCmdUI)
01236 {
01237     if(DisableCommon())
01238         pCmdUI->Enable(FALSE);
01239     else
01240         pCmdUI->Enable(TRUE);
01241 }
01242
01243 void CGraphView::OnViewTag()
01244 {
01245     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01246     CLogNode *root = pDoc->GetNode();
01247     if(root == 0L || root->GetUserData() == 0L)
01248         return;
01249
01250     TGraphCmdStatus trav;
01251     trav.TraverseGraph(root);
01252     CvsArgs args;
01253     args.add("update");
01254     CLogNode *node = trav.fSel1->Node();
01255     switch(node->GetType())
01256     {
01257         case kNodeHeader :
01258         {
01259             args.add("-A");
01260             break;
01261         }
01262         case kNodeRev :
01263         case kNodeBranch :
01264         case kNodeTag :
01265         {
01266             args.add("-r");
01267             args.add(trav.fSel1->GetStr());
01268             break;
01269         }
01270     }
01271     args.add(pDoc->GetName());
01272     args.print(pDoc->GetDir());
01273     CGraphConsole cons;
01274     launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01275
01276     OnViewReload();
01277 }
01278
01279 void CGraphView::OnUpdateViewTag(CCmdUI* pCmdUI)
01280 {
01281     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01282     CLogNode *root = pDoc->GetNode();
01283     if(DisableCommon())
01284     {
01285         pCmdUI->Enable(FALSE);
01286         return;
01287     }
01288
01289     TGraphCmdStatus trav;
01290     trav.TraverseGraph(root);
01291     BOOL outEnabled = trav.fCountSel == 1;
01292     pCmdUI->Enable(outEnabled);
01293 }
01294
01295 void CGraphView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
01296 {
01297     // TODO: Add your specialized code here and/or call the base class
01298
01299     CScrollView::OnBeginPrinting(pDC, pInfo);
01300
01301     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01302     CLogNode *root = pDoc->GetNode();
01303     if(root == 0L)
01304         return;
01305
01306     // set all the bounds locations
01307     CWinLogData *data = CWinLogData::CreateNewData(root);
01308     root->SetUserData(data);
01309     CPoint start(0, 0);
01310     data->ComputeBounds(start, *pDC, pDoc->GetEntryInfo());
01311
01312     // compute the number of pages
01313     CRect bounds = data->Bounds();
01314     m_pageHeight = pDC->GetDeviceCaps(VERTRES);
01315     m_numberOfPages = bounds.Height() / m_pageHeight + 1;
01316
01317     pInfo->SetMaxPage(m_numberOfPages);
01318 }
01319
01320 void CGraphView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
01321 {
01322     // TODO: Add your specialized code here and/or call the base class
01323
01324     CScrollView::OnEndPrinting(pDC, pInfo);
01325
01326     CalcImageSize();
01327     Invalidate();
01328 }
01329
01330 BOOL CGraphView::OnPreparePrinting(CPrintInfo* pInfo)
01331 {
01332     BOOL res = DoPreparePrinting(pInfo);
01333     if(!res)
01334         return res;
01335
01336     return TRUE;
01337 }
01338
01339 void CGraphView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
01340 {
01341     if (!pDC->IsPrinting())
01342         return;
01343
01344     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01345     CLogNode *root = pDoc->GetNode();
01346     if(root == 0L || root->GetUserData() == 0L)
01347         return;
01348
01349     CWinLogData *data = (CWinLogData *)root->GetUserData();
01350
01351     // Orient the viewport so that the first row to be printed
01352     // has a viewport coordinate of (0,0).
01353     int yTopOfPage = (pInfo->m_nCurPage -1) * m_pageHeight;
01354     pDC->SetViewportOrg(0, -yTopOfPage);
01355     pDC->SetTextAlign(TA_CENTER);
01356     pDC->SetBkMode(TRANSPARENT);
01357     data->Update(*pDC, pDoc->GetEntryInfo());
01358
01359     //  CScrollView::OnPrint(pDC, pInfo);
01360 }
01361
01362 bool CGraphView::DisableCommon()
01363 {
01364     CWincvsApp *app = (CWincvsApp *)AfxGetApp();
01365     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01366     CLogNode *root = pDoc->GetNode();
01367     return root == 0L || root->GetUserData() == 0L || app->gCvsRunning || this != CWnd::GetFocus() || gCvsPrefs.empty();
01368 }
01369
01370 bool CGraphView::IsSelSingleNode(kLogNode type, bool equal /*= true*/)
01371 {
01372     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01373     CLogNode *root = pDoc->GetNode();
01374
01375     TGraphCmdStatus trav;
01376     trav.TraverseGraph(root);
01377     return (trav.fCountSel == 1 &&
01378         (equal ? trav.fSel1->GetType() == type : trav.fSel1->GetType() != type));
01379 }
01380
01381 class TGraphDelCmd : public TGraph
01382 {
01383 public:
01384     TGraphDelCmd() :
01385         fCountSel(0), fOnlyRev(true) {}
01386
01387     virtual kTGraph TraverseNode(CLogNode *node)
01388     {
01389         CWinLogData *data = (CWinLogData *)node->GetUserData();
01390
01391         if(data->Selected())
01392         {
01393             if(data->GetType() != kNodeRev)
01394                 fOnlyRev = false;
01395             else
01396                 fAllRevs.push_back(CStr(data->GetStr()));
01397             fCountSel++;
01398         }
01399
01400         return kTGetDown;
01401     }
01402
01403     int fCountSel;
01404     bool fOnlyRev;
01405     std::vector<CStr> fAllRevs;
01406 };
01407
01408 void CGraphView::OnViewDelrev()
01409 {
01410     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01411     CLogNode *root = pDoc->GetNode();
01412     if(root == 0L || root->GetUserData() == 0L)
01413         return;
01414
01415     if(AfxMessageBox("Are you really sure you want to do that ? This will permanently remove the revisions on the server.",
01416         MB_OKCANCEL|MB_DEFBUTTON2|MB_ICONSTOP) != IDOK)
01417             return;
01418
01419     TGraphDelCmd trav;
01420     trav.TraverseGraph(root);
01421
01422     CProgress progress(true, "Deleting revisions...");
01423
01424     std::vector<CStr>::const_iterator i;
01425     int count = 0;
01426     for(i = trav.fAllRevs.begin(); i != trav.fAllRevs.end(); ++i, ++count)
01427     {
01428         progress.SetProgress(((float)count / (float)trav.fAllRevs.size()) * 100.0 + .5);
01429         if(progress.HasAborted())
01430             break;
01431
01432         CvsArgs args;
01433         args.add("admin");
01434         args.add("-o");
01435         args.add(*i);
01436         args.add(pDoc->GetName());
01437         args.print(pDoc->GetDir());
01438         CGraphConsole cons;
01439         launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01440     }
01441
01442     if(!progress.HasAborted())
01443         progress.SetProgress(100);
01444
01445     OnViewReload();
01446 }
01447
01448 void CGraphView::OnUpdateViewDelrev(CCmdUI* pCmdUI)
01449 {
01450     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01451     CLogNode *root = pDoc->GetNode();
01452     if(DisableCommon())
01453     {
01454         pCmdUI->Enable(FALSE);
01455         return;
01456     }
01457
01458     TGraphDelCmd trav;
01459     trav.TraverseGraph(root);
01460     BOOL outEnabled = trav.fCountSel >= 1 && trav.fOnlyRev;
01461     pCmdUI->Enable(outEnabled);
01462 }
01463
01464 class TGraphSelNonSig : public TGraph
01465 {
01466 public:
01467     TGraphSelNonSig(CGraphView *view) : fView(view)
01468     {
01469     }
01470
01471     virtual kTGraph TraverseNode(CLogNode *node)
01472     {
01473         CWinLogData *data = (CWinLogData *)node->GetUserData();
01474
01475         if(data->GetType() == kNodeRev)
01476         {
01477             if(node->Next() != 0L && node->Childs().size() == 0)
01478                 data->SetSelected(fView, true);
01479         }
01480
01481         return kTGetDown;
01482     }
01483
01484     CGraphView *fView;
01485 };
01486
01487 void CGraphView::OnViewSelnonsig()
01488 {
01489     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01490     CLogNode *root = pDoc->GetNode();
01491     if(root == 0L || root->GetUserData() == 0L)
01492         return;
01493
01494     CWinLogData *data = (CWinLogData *)root->GetUserData();
01495     data->UnselectAll(this);
01496
01497     TGraphSelNonSig trav(this);
01498     trav.TraverseGraph(root);
01499 }
01500
01501 void CGraphView::OnUpdateViewSelnonsig(CCmdUI* pCmdUI)
01502 {
01503     if(DisableCommon())
01504         pCmdUI->Enable(FALSE);
01505     else
01506         pCmdUI->Enable(TRUE);
01507 }
01508
01509 // CVS console used to retrieve a specific revision
01510 class CRevisionConsole : public CCvsConsole
01511 {
01512 public:
01513     CRevisionConsole()
01514     : fOut(NULL)
01515     {}
01516
01517     ~CRevisionConsole()
01518     {
01519         if (fOut)
01520         {
01521             fclose(fOut);
01522         }
01523     }
01524
01525     BOOL init(LPCTSTR path, LPCTSTR fname)
01526     {
01527         TCHAR buf[_MAX_PATH];
01528         _tmakepath(buf, NULL, path, fname, NULL);
01529         fOut = fopen(buf, "w+");
01530         return fOut != NULL;
01531     }
01532
01533     virtual long cvs_out(char *txt, long len)
01534     {
01535         fwrite(txt, sizeof(char), len, fOut);
01536         return len;
01537     }
01538
01539     virtual long cvs_err(char *txt, long len)
01540     {
01541         cvs_errstr(txt, len);
01542         return len;
01543     }
01544
01545 protected:
01546     FILE *fOut;
01547 };
01548
01549
01550 void CGraphView::OnViewRetrieve()
01551 {
01552     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01553     CLogNode *root = pDoc->GetNode();
01554     if(root == 0L || root->GetUserData() == 0L)
01555         return;
01556
01557     TGraphCmdStatus trav;
01558     trav.TraverseGraph(root);
01559
01560     CStr f1, prf1;
01561     CvsArgs args;
01562
01563     prf1 = pDoc->GetName();
01564     prf1 << ".#.";
01565     prf1 << trav.fSel1->GetStr();
01566     args.add("update");
01567     args.add("-p");
01568     args.add("-r");
01569     args.add(trav.fSel1->GetStr());
01570     args.add(pDoc->GetName());
01571     args.print(pDoc->GetDir());
01572
01573     CRevisionConsole console;
01574     console.init(pDoc->GetDir(), prf1);
01575
01576     int code = launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &console);
01577 }
01578
01579 void CGraphView::OnUpdateViewRetrieve(CCmdUI* pCmdUI)
01580 {
01581     BOOL enabled = FALSE;
01582     if(!DisableCommon())
01583     {
01584         enabled = IsSelSingleNode(kNodeHeader, false);
01585     }
01586     pCmdUI->Enable(enabled);
01587 }
01588
01589 void CGraphView::DisableUpdate(CCmdUI* pCmdUI)
01590 {
01591     pCmdUI->Enable(false);
01592 }
01593
01594 void CGraphView::OnContextMenu(CWnd* pWnd, CPoint point)
01595 {
01596     //Comply with windows UI standard (Windows Explorer file view used as a reference),
01597     //change selections according to the state of Control and Shift keys
01598     BYTE abKeyboardState[256];
01599     BOOL bControlState = FALSE;
01600     BOOL bShiftState = FALSE;
01601     memset( abKeyboardState, 0, 256 );
01602
01603     if( GetKeyboardState(abKeyboardState) )
01604     {
01605         bControlState = abKeyboardState[VK_CONTROL] & 0x80;
01606         bShiftState = abKeyboardState[VK_SHIFT] & 0x80;
01607     }
01608
01609     if( (!bControlState || (bControlState && bShiftState)) && !DisableCommon() )
01610     {
01611         CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01612         CLogNode *root = pDoc->GetNode();
01613
01614         TGraphCmdStatus trav;
01615         trav.TraverseGraph(root);
01616
01617         CWinLogData *data = (CWinLogData *)root->GetUserData();
01618         CPoint hitPoint(point);
01619         ScreenToClient(&hitPoint);
01620         hitPoint += GetDeviceScrollPosition();
01621         CWinLogData *hit = data->HitTest(hitPoint);
01622
01623         if( hit != 0L )
01624         {
01625             if( trav.fCountSel == 0 )
01626             {
01627                 hit->SetSelected(this, true);
01628             }
01629             else if( trav.fCountSel >= 1 && trav.fSel1->GetType() != kNodeHeader )
01630             {
01631                 if( !(hit->Selected() && bShiftState) && !(bControlState && bShiftState && hit->Selected()) )
01632                 {
01633                     data->UnselectAll(this);
01634                 }
01635                 hit->SetSelected(this, true);
01636             }
01637         }
01638     }
01639
01640
01641
01642     // Get the menu to display from the main app window, which for graph view
01643     // will be IDR_GRAPH,  The submenu to display is the menu under "Graph".
01644     // Note that if the position of this menu changes, the index under
01645     // GetSubMenu must also change.
01646     CMenu* pMenu    = ::AfxGetMainWnd()->GetMenu();
01647     CMenu* pSubMenu = pMenu->GetSubMenu(5);
01648
01649     pSubMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON,
01650         point.x, point.y, this);
01651 }
01652
01653 void CGraphView::OnInitMenuPopup(CMenu *pPopupMenu, UINT nIndex,BOOL bSysMenu)
01654 {
01655     ASSERT(pPopupMenu != NULL);
01656     // Check the enabled state of various menu items.
01657
01658     CCmdUI state;
01659     state.m_pMenu = pPopupMenu;
01660     ASSERT(state.m_pOther == NULL);
01661     ASSERT(state.m_pParentMenu == NULL);
01662
01663     // Determine if menu is popup in top-level menu and set m_pOther to
01664     // it if so (m_pParentMenu == NULL indicates that it is secondary popup).
01665     HMENU hParentMenu;
01666     if (AfxGetThreadState()->m_hTrackingMenu == pPopupMenu->m_hMenu)
01667         state.m_pParentMenu = pPopupMenu;    // Parent == child for tracking popup.
01668     else if ((hParentMenu = ::GetMenu(m_hWnd)) != NULL)
01669     {
01670         CWnd* pParent = this;
01671            // Child windows don't have menus--need to go to the top!
01672         if (pParent != NULL &&
01673            (hParentMenu = ::GetMenu(pParent->m_hWnd)) != NULL)
01674         {
01675            int nIndexMax = ::GetMenuItemCount(hParentMenu);
01676            for (int nIndex = 0; nIndex < nIndexMax; nIndex++)
01677            {
01678             if (::GetSubMenu(hParentMenu, nIndex) == pPopupMenu->m_hMenu)
01679             {
01680                 // When popup is found, m_pParentMenu is containing menu.
01681                 state.m_pParentMenu = CMenu::FromHandle(hParentMenu);
01682                 break;
01683             }
01684            }
01685         }
01686     }
01687
01688     state.m_nIndexMax = pPopupMenu->GetMenuItemCount();
01689     for (state.m_nIndex = 0; state.m_nIndex < state.m_nIndexMax;
01690       state.m_nIndex++)
01691     {
01692         state.m_nID = pPopupMenu->GetMenuItemID(state.m_nIndex);
01693         if (state.m_nID == 0)
01694            continue; // Menu separator or invalid cmd - ignore it.
01695
01696         ASSERT(state.m_pOther == NULL);
01697         ASSERT(state.m_pMenu != NULL);
01698         if (state.m_nID == (UINT)-1)
01699         {
01700            // Possibly a popup menu, route to first item of that popup.
01701            state.m_pSubMenu = pPopupMenu->GetSubMenu(state.m_nIndex);
01702            if (state.m_pSubMenu == NULL ||
01703             (state.m_nID = state.m_pSubMenu->GetMenuItemID(0)) == 0 ||
01704             state.m_nID == (UINT)-1)
01705            {
01706             continue;       // First item of popup can't be routed to.
01707            }
01708            state.DoUpdate(this, TRUE);   // Popups are never auto disabled.
01709         }
01710         else
01711         {
01712            // Normal menu item.
01713            // Auto enable/disable if frame window has m_bAutoMenuEnable
01714            // set and command is _not_ a system command.
01715            state.m_pSubMenu = NULL;
01716            state.DoUpdate(this, FALSE);
01717         }
01718
01719         // Adjust for menu deletions and additions.
01720         UINT nCount = pPopupMenu->GetMenuItemCount();
01721         if (nCount < state.m_nIndexMax)
01722         {
01723             state.m_nIndex -= (state.m_nIndexMax - nCount);
01724             while (state.m_nIndex < nCount &&
01725                 pPopupMenu->GetMenuItemID(state.m_nIndex) == state.m_nID)
01726             {
01727                 state.m_nIndex++;
01728             }
01729         }
01730         state.m_nIndexMax = nCount;
01731       }
01732
01733 }
01734
01735 void CGraphView::OnUpdateQueryAnnotate(CCmdUI* pCmdUI)
01736 {
01737     BOOL enabled = FALSE;
01738     if(!DisableCommon())
01739     {
01740         enabled = IsSelSingleNode(kNodeHeader, false);
01741     }
01742     pCmdUI->Enable(enabled);
01743 }
01744
01745 void CGraphView::OnQueryAnnotate()
01746 {
01747     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01748     CLogNode *root = pDoc->GetNode();
01749     if(root == 0L || root->GetUserData() == 0L)
01750         return;
01751
01752     TGraphCmdStatus trav;
01753     trav.TraverseGraph(root);
01754
01755     if(gCvsPrefs.ExtDiff() != 0L)
01756     {
01757         CStr file, prf, ext, base;
01758         CvsArgs args;
01759
01760         GetExtension(pDoc->GetName(), base, ext);
01761
01762         prf = base;
01763         prf << "_ann_";
01764         prf << trav.fSel1->GetStr();
01765         prf << '_';
01766         args.add("annotate");
01767         args.add("-r");
01768         args.add(trav.fSel1->GetStr());
01769         args.add(pDoc->GetName());
01770         args.print(pDoc->GetDir());
01771         file = launchCVS(pDoc->GetDir(), args, (const char *)prf, ext);
01772
01773         if(file.empty())
01774             return;
01775
01776         LaunchViewer(file);
01777     }
01778 }
01779
01780 void CGraphView::OnGraphGraphoptions()
01781 {
01782     if( CompatGetGraphOptions(gGraphSelColor, gGraphShadowColor,
01783         gGraphHeaderColor, gGraphTagColor, gGraphBranchColor,
01784         gGraphNodeColor, gGraphDeadNodeColor, gGraphUserStateNodeColor) )
01785     {
01786         // add any additional processing here
01787     }
01788
01789     CWincvsApp* pApp = (CWincvsApp*)AfxGetApp();
01790     if( pApp )
01791     {
01792         pApp->UpdateAllDocsView();
01793     }
01794 }
01795
01796 void CGraphView::OnUpdateGraphChangelogmessage(CCmdUI* pCmdUI)
01797 {
01798     BOOL enabled = FALSE;
01799     if(!DisableCommon())
01800     {
01801         enabled = IsSelSingleNode(kNodeRev);
01802     }
01803     pCmdUI->Enable(enabled);
01804 }
01805
01806 void CGraphView::OnGraphChangelogmessage()
01807 {
01808     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01809     CLogNode *root = pDoc->GetNode();
01810     if(root == 0L || root->GetUserData() == 0L)
01811         return;
01812
01813     TGraphCmdStatus trav;
01814     trav.TraverseGraph(root);
01815
01816     CLogNode *node = trav.fSel1->Node();
01817     ASSERT(node->GetType() == kNodeRev);
01818     CRevFile& rev = **(CLogNodeRev *)node;
01819
01820     CPStr msg = (const char*)rev.DescLog();
01821
01822     if( CompatGetAdminOptions(kChangeLog, msg) )
01823     {
01824         CvsArgs args;
01825         args.add("admin");
01826         args.add(CStr("-m") + trav.fSel1->GetStr() + CStr(":") + cleanUpLogMsg(msg));
01827
01828         args.add(pDoc->GetName());
01829         args.print(pDoc->GetDir());
01830
01831         CGraphConsole cons;
01832         launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01833         OnViewReload();
01834     }
01835 }
01836
01837 void CGraphView::OnUpdateGraphSetdescription(CCmdUI* pCmdUI)
01838 {
01839     BOOL enabled = FALSE;
01840     if(!DisableCommon())
01841     {
01842         enabled = IsSelSingleNode(kNodeHeader);
01843     }
01844     pCmdUI->Enable(enabled);
01845 }
01846
01847 void CGraphView::OnGraphSetdescription()
01848 {
01849     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01850     CLogNode *root = pDoc->GetNode();
01851     if(root == 0L || root->GetUserData() == 0L)
01852         return;
01853
01854     TGraphCmdStatus trav;
01855     trav.TraverseGraph(root);
01856
01857     CLogNode *node = trav.fSel1->Node();
01858     ASSERT(node->GetType() == kNodeHeader);
01859     CRcsFile& rev = **(CLogNodeHeader *)node;
01860
01861     CPStr msg = (const char*)rev.DescLog();
01862
01863     if( CompatGetAdminOptions(kSetDescription, msg) )
01864     {
01865         CvsArgs args;
01866         args.add("admin");
01867         args.add(CStr("-t-") + cleanUpLogMsg(msg));
01868
01869         args.add(pDoc->GetName());
01870         args.print(pDoc->GetDir());
01871
01872         CGraphConsole cons;
01873         launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01874         OnViewReload();
01875     }
01876 }
01877
01878 void CGraphView::OnUpdateGraphSetstate(CCmdUI* pCmdUI)
01879 {
01880     BOOL enabled = FALSE;
01881     if(!DisableCommon())
01882     {
01883         enabled = IsSelSingleNode(kNodeRev);
01884     }
01885     pCmdUI->Enable(enabled);
01886 }
01887
01888 void CGraphView::OnGraphSetstate()
01889 {
01890     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01891     CLogNode *root = pDoc->GetNode();
01892     if(root == 0L || root->GetUserData() == 0L)
01893         return;
01894
01895     TGraphCmdStatus trav;
01896     trav.TraverseGraph(root);
01897
01898     CLogNode *node = trav.fSel1->Node();
01899     ASSERT(node->GetType() == kNodeRev);
01900     CRevFile& rev = **(CLogNodeRev *)node;
01901
01902     CPStr state = (const char*)rev.State();
01903
01904     if( strcmp("dead", (const char*)state ) == 0 &&
01905         CvsAlert("The revision state is: \"dead\". You should not alter it manually.\nAre you sure you want to continue?", "Cancel", "Continue") )
01906     {
01907         return;
01908     }
01909
01910     if( CompatGetAdminOptions(kSetState, state) )
01911     {
01912         CvsArgs args;
01913         args.add("admin");
01914         args.add("-s");
01915         args.add(cleanUpLogMsg(state) + CStr(":") + trav.fSel1->GetStr());
01916
01917         args.add(pDoc->GetName());
01918         args.print(pDoc->GetDir());
01919
01920         CGraphConsole cons;
01921         launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01922         OnViewReload();
01923     }
01924 }
01925
01926 void CGraphView::OnUpdateViewUnlockf(CCmdUI* pCmdUI)
01927 {
01928     BOOL enabled = FALSE;
01929     if(!DisableCommon())
01930     {
01931         enabled = IsSelSingleNode(kNodeRev);
01932     }
01933     pCmdUI->Enable(enabled);
01934 }
01935
01936 void CGraphView::OnViewUnlockf()
01937 {
01938     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01939     CLogNode *root = pDoc->GetNode();
01940     if(root == 0L || root->GetUserData() == 0L)
01941         return;
01942
01943     TGraphCmdStatus trav;
01944     trav.TraverseGraph(root);
01945
01946     CvsArgs args;
01947     args.add("admin");
01948     args.add(CStr("-u") + trav.fSel1->GetStr());
01949
01950     args.add(pDoc->GetName());
01951     args.print(pDoc->GetDir());
01952
01953     CGraphConsole cons;
01954     launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01955     OnViewReload();
01956 }
Generated on Sun Feb 24 01:21:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/GraphView.h Source File

WinCvs/GraphView.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 #if !defined(AFX_GRAPHVIEW_H__7A07C311_03F9_11D2_BCB2_000000000000__INCLUDED_)
00018 #define AFX_GRAPHVIEW_H__7A07C311_03F9_11D2_BCB2_000000000000__INCLUDED_
00019
00020 #if _MSC_VER >= 1000
00021 #pragma once
00022 #endif // _MSC_VER >= 1000
00023 // GraphView.h : header file
00024 //
00025
00026 #include "CvsLog.h"
00027
00028 #define STARTPOINT_PT       (CPoint(5, 5))
00029
00030 #define OCTANGLE_COUNT      8
00031 #define SHADOW_OFFSET_PT    (CPoint(4, 4))
00032 #define ROUND_RECT_PT       (CPoint(6, 6))
00033
00034 #define RGB_DEF_SEL             RGB(160, 160, 160)
00035 #define RGB_DEF_SHADOW          RGB(128, 128, 128)
00036 #define RGB_DEF_HEADER          RGB(255, 0, 0)
00037 #define RGB_DEF_TAG             RGB(0, 0, 0)
00038 #define RGB_DEF_BRANCH          RGB(0, 0, 255)
00039 #define RGB_DEF_NODE            RGB(0, 0, 255)
00040 #define RGB_DEF_DEADNODE        RGB(255, 0, 0)
00041 #define RGB_DEF_USERSTATENODE   RGB(0, 128, 64)
00042 #define STYLE_DEADNODE          PS_DOT
00043 #define STYLE_USERSTATENODE     PS_DASH
00044
00045 typedef enum
00046 {
00047     kRectangle,
00048     kRoundRect,
00049     kOctangle
00050 } kNodeShape;
00051
00053 // CGraphView view
00054
00055 class CGraphView : public CScrollView
00056 {
00057 protected:
00058     CGraphView();           // protected constructor used by dynamic creation
00059     DECLARE_DYNCREATE(CGraphView)
00060
00061 // Attributes
00062 public:
00063     void CalcImageSize(void);
00064         // calculate the size of the graph and set the scroll bars
00065
00066     static inline CImageList & GetImgList(void) { return m_ImageList; }
00067
00068     // Operations
00069 public:
00070
00071 // Overrides
00072     // ClassWizard generated virtual function overrides
00073     //{{AFX_VIRTUAL(CGraphView)
00074     protected:
00075     virtual void OnDraw(CDC* pDC);      // overridden to draw this view
00076     virtual void OnInitialUpdate();     // first time after construct
00077     virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
00078     virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
00079     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
00080     virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
00081     //}}AFX_VIRTUAL
00082
00083 // Implementation
00084 protected:
00085
00086     bool fFirstTime;
00087     static CImageList m_ImageList;
00088
00089     int m_numberOfPages;
00090     int m_pageHeight;
00091         // for printing
00092
00093     bool DisableCommon();
00094     bool IsSelSingleNode(kLogNode type, bool equal = true);
00095
00096     virtual ~CGraphView();
00097 #ifdef _DEBUG
00098     virtual void AssertValid() const;
00099     virtual void Dump(CDumpContext& dc) const;
00100 #endif
00101     void OnInitMenuPopup(CMenu *pPopupMenu, UINT nIndex,BOOL bSysMenu);
00102
00103     // Generated message map functions
00104     //{{AFX_MSG(CGraphView)
00105     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00106     afx_msg void OnViewReload();
00107     afx_msg void OnUpdateViewReload(CCmdUI* pCmdUI);
00108     afx_msg void OnViewDiff();
00109     afx_msg void OnUpdateViewDiff(CCmdUI* pCmdUI);
00110     afx_msg void OnViewUpdate();
00111     afx_msg void OnUpdateViewUpdate(CCmdUI* pCmdUI);
00112     afx_msg void OnViewTag();
00113     afx_msg void OnUpdateViewTag(CCmdUI* pCmdUI);
00114     afx_msg void OnViewDelrev();
00115     afx_msg void OnUpdateViewDelrev(CCmdUI* pCmdUI);
00116     afx_msg void OnViewSelnonsig();
00117     afx_msg void OnUpdateViewSelnonsig(CCmdUI* pCmdUI);
00118     afx_msg void OnViewRetrieve();
00119     afx_msg void OnUpdateViewRetrieve(CCmdUI* pCmdUI);
00120     afx_msg void DisableUpdate(CCmdUI* pCmdUI);
00121     afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
00122     afx_msg void OnQueryAnnotate();
00123     afx_msg void OnUpdateQueryAnnotate(CCmdUI* pCmdUI);
00124     afx_msg void OnGraphGraphoptions();
00125     afx_msg void OnUpdateGraphChangelogmessage(CCmdUI* pCmdUI);
00126     afx_msg void OnGraphChangelogmessage();
00127     afx_msg void OnUpdateGraphSetdescription(CCmdUI* pCmdUI);
00128     afx_msg void OnGraphSetdescription();
00129     afx_msg void OnGraphSetstate();
00130     afx_msg void OnUpdateGraphSetstate(CCmdUI* pCmdUI);
00131     afx_msg void OnViewUnlockf();
00132     afx_msg void OnUpdateViewUnlockf(CCmdUI* pCmdUI);
00133     //}}AFX_MSG
00134     DECLARE_MESSAGE_MAP()
00135 };
00136
00138
00139 //{{AFX_INSERT_LOCATION}}
00140 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00141
00142 #endif // !defined(AFX_GRAPHVIEW_H__7A07C311_03F9_11D2_BCB2_000000000000__INCLUDED_)
Generated on Sun Feb 24 01:21:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/HistComboBoxEx.cpp Source File

WinCvs/HistComboBoxEx.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- July 2001
00019  */
00020
00021 // HistComboBoxEx.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025 #include "wincvs.h"
00026 #include "HistComboBoxEx.h"
00027 #include "FileTraversal.h"
00028 #include "CvsEntries.h"
00029
00030 #include "MainFrm.h"
00031 #include "CvsAlert.h"
00032
00033 #ifdef _DEBUG
00034 #define new DEBUG_NEW
00035 #undef THIS_FILE
00036 static char THIS_FILE[] = __FILE__;
00037 #endif
00038
00039 static PCPStr gOldLoc("P_BrowserLoc", "C:\\");
00040
00041 int TraverseHistory(CHistComboBoxEx& browseHist)
00042 {
00043     char szPath[MAX_PATH] = "";
00044     for( int nIndex = 0; nIndex < browseHist.GetCount(); nIndex++ )
00045     {
00046         COMBOBOXEXITEM cbi;
00047         cbi.mask = CBEIF_TEXT;
00048         cbi.iItem = nIndex;
00049         cbi.pszText = szPath;
00050         cbi.cchTextMax = MAX_PATH;
00051
00052         browseHist.GetItem(&cbi);
00053         browseHist.SetIcon(cbi);
00054     }
00055
00056     return nIndex;
00057 }
00058
00060 // CHistComboBoxEx
00061
00062 CHistComboBoxEx::CHistComboBoxEx(int feature /*= USmartCombo::DefaultFeature*/)
00063     : USmartCombo(feature)
00064 {
00065 }
00066
00067 CHistComboBoxEx::~CHistComboBoxEx()
00068 {
00069 }
00070
00071
00072 BEGIN_MESSAGE_MAP(CHistComboBoxEx, CComboBoxEx)
00073     //{{AFX_MSG_MAP(CHistComboBoxEx)
00074     ON_CONTROL_REFLECT(CBN_DROPDOWN, OnDropdown)
00075     //}}AFX_MSG_MAP
00076 END_MESSAGE_MAP()
00077
00079 // CHistComboBoxEx message handlers
00080
00081 const char* CHistComboBoxEx::GetOldLoc()
00082 {
00083     return gOldLoc;
00084 }
00085
00086 int CHistComboBoxEx::NewRoot(const char* root)
00087 {
00088     if(stricmp(gOldLoc, root) != 0)
00089         gOldLoc = root;
00090
00091     CMString* pstrItems = GetItems();
00092     ASSERT(pstrItems != NULL);
00093
00094     // update the history combo
00095     pstrItems->Insert(root);
00096     ResetContent();
00097     const std::vector<CStr> & list = pstrItems->GetList();
00098     std::vector<CStr>::const_iterator i;
00099     for(i = list.begin(); i != list.end(); ++i)
00100     {
00101         InsertString(-1, *i);
00102     }
00103     SetCurSel(0);
00104     TRACE("Browse History has %d items\n", GetCount());
00105
00106     return GetCount();
00107 }
00108
00110 CString CHistComboBoxEx::FindBestRoot(CMString& strItems, const char* path, bool mustExist /*= false*/)
00111 {
00112     CString normPath(path);
00113     CString bestRoot;
00114     normPath.TrimRight("\\/");
00115     normPath.MakeLower();
00116
00117     const std::vector<CStr> & list = strItems.GetList();
00118     std::vector<CStr>::const_iterator i;
00119     for(i = list.begin(); i != list.end(); ++i)
00120     {
00121         CString root = *i;
00122         root.TrimRight("\\/");
00123         root.MakeLower();
00124
00125         if( normPath.Find(root) != -1 )
00126         {
00127             //we want the longest root so it's near the file
00128             if( root.GetLength() > bestRoot.GetLength() )
00129             {
00130                 bestRoot = *i;
00131             }
00132         }
00133     }
00134
00135     if( !mustExist && bestRoot.IsEmpty() )
00136     {
00137         bestRoot = path;
00138         bestRoot.TrimRight("\\/");
00139     }
00140
00141     //handle the drive root
00142     if( bestRoot.GetAllocLength() &&
00143         ':' == bestRoot[bestRoot.GetLength()-1])
00144     {
00145         bestRoot += kPathDelimiter;
00146     }
00147
00148     return bestRoot;
00149 }
00150
00151 int CHistComboBoxEx::InsertString(int nIndex, LPCTSTR lpszString)
00152 {
00153     int nRes = -1;
00154
00155     COMBOBOXEXITEM cbi;
00156     cbi.mask = CBEIF_TEXT;
00157     cbi.iItem = 0 > nIndex ? GetCount() : nIndex;
00158     cbi.pszText = (LPTSTR)lpszString;   //this cast is safe because we are Inserting item only
00159     cbi.cchTextMax = 0;
00160
00161     nRes = InsertItem(&cbi);
00162     SetIcon(cbi);
00163
00164     return nRes;
00165 }
00166
00167 int CHistComboBoxEx::AddString(LPCTSTR lpszString)
00168 {
00169     return InsertString(-1, lpszString);
00170 }
00171
00172 BOOL CHistComboBoxEx::SetIcon(COMBOBOXEXITEM cbi)
00173 {
00174     //initialize the image list if neccessary
00175     if( m_ImageList.m_hImageList == 0L )
00176     {
00177         m_ImageList.Create(IDB_HISTLOC, HISTLOC_IMAGE_CX, 1, RGB(255, 255, 255));
00178         SetImageList(&m_ImageList);
00179     }
00180
00181     cbi.mask = CBEIF_IMAGE | /*CBEIF_OVERLAY |*/ CBEIF_SELECTEDIMAGE;
00182     cbi.iImage = cbi.iSelectedImage = kLocationIconUnknown;
00183     //cbi.iOverlay = ;
00184
00185     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00186     vector<CStr> ignlist;
00187     struct stat sb;
00188     const char *fullpath = cbi.pszText;
00189
00190     int statres = stat(fullpath, &sb);
00191     if( statres != -1 )
00192     {
00193         if( S_ISDIR(sb.st_mode) )
00194         {
00195             CStr uppath, folder;
00196             if( !SplitPath(fullpath, uppath, folder) || uppath.empty() )
00197             {
00198                 uppath = fullpath;
00199                 folder = ".";
00200             }
00201
00202             BuildIgnoredList(ignlist, uppath);
00203
00204             EntnodeData *data = Entries_SetVisited(uppath, entries, folder, sb, true, &ignlist);
00205             if( !data->IsUnknown() )
00206             {
00207                 cbi.iImage = cbi.iSelectedImage = kLocationIcon;
00208             }
00209             if( data->IsIgnored() )
00210             {
00211                 cbi.iImage = cbi.iSelectedImage = kLocationIconIgnored;
00212             }
00213             if( data->IsMissing() )
00214             {
00215                 cbi.iImage = cbi.iSelectedImage = kLocationIconMissing;
00216             }
00217         }
00218     }
00219     else
00220     {
00221         cbi.iImage = cbi.iSelectedImage = kLocationIconErased;
00222     }
00223
00224     return SetItem(&cbi);
00225 }
00226
00231 BOOL CHistComboBoxEx::PreTranslateMessage(MSG* pMsg)
00232 {
00233     if( HasFeature(USmartCombo::RemoveItems) )
00234     {
00235         if( DelKeyTest(pMsg) )
00236         {
00237             return TRUE;
00238         }
00239     }
00240
00241     return CComboBoxEx::PreTranslateMessage(pMsg);
00242 }
00243
00249 void CHistComboBoxEx::OnDropdown()
00250 {
00251     TraverseHistory(*this);
00252     if( HasFeature(USmartCombo::AutoDropWidth) )
00253     {
00254         SetDroppedWidth(CalcDroppedWidth());
00255     }
00256 }
00257
00263 int CHistComboBoxEx::CalcDroppedWidth()
00264 {
00265     int maxSize = 0;
00266
00267     CClientDC ClientDC(this);
00268     int savedDc = ClientDC.SaveDC();
00269     ClientDC.SelectObject(GetFont());
00270
00271     CString strLBText;
00272     for( int nIndex = 0; nIndex < GetCount(); nIndex++ )
00273     {
00274         GetLBText( nIndex, strLBText );
00275         CSize size = ClientDC.GetTextExtent(strLBText);
00276
00277         if( size.cx > maxSize )
00278         {
00279             maxSize = size.cx;
00280         }
00281     }
00282     ClientDC.RestoreDC(savedDc);
00283
00284     maxSize += ::GetSystemMetrics(SM_CXVSCROLL)     //vertical scroll bar
00285         + 4*::GetSystemMetrics(SM_CXEDGE)           //the border aroung the text and icon: Edge-Icon-Edge - Edge-Text-Edge
00286         + HISTLOC_IMAGE_CX                          //the icon width
00287         + 2;                                        //the focus frame width
00288
00289     CRect rect;
00290     GetWindowRect(rect);
00291     maxSize = min(ClientDC.GetDeviceCaps(HORZRES) - rect.TopLeft().x, maxSize);
00292
00293     return maxSize;
00294 }
00295
00302 BOOL CHistComboBoxEx::DelKeyTest(MSG* pMsg)
00303 {
00304     CMString* pstrItems = GetItems();
00305     ASSERT(pstrItems != NULL);
00306
00307     BOOL bRes = FALSE;
00308
00309     if( WM_KEYDOWN == pMsg->message &&
00310         VK_DELETE == (int)pMsg->wParam &&
00311         pstrItems &&
00312         GetDroppedState() )
00313     {
00314         int sel = GetCurSel();
00315         if( CB_ERR < sel && GetCount() > 1 )
00316         {
00317             CString strItem;
00318             GetLBText(sel, strItem);
00319
00320             if( RemoveItem(strItem) )
00321             {
00322                 DeleteString(sel);
00323
00324                 if( GetCount() )
00325                 {
00326                     int nNewSel = (0 == sel ? sel : (GetCount() ? 0 : -1));
00327                     if( 0 != nNewSel || 0 == sel )
00328                     {
00329                         SetCurSel(nNewSel);
00330
00331                         //trigger the location change for all views
00332                         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00333                         CMainFrame* mainFrm = app->GetMainFrame();
00334                         mainFrm->ChangeLocation();
00335                     }
00336                 }
00337             }
00338         }
00339         else if( GetCount() == 1 )
00340         {
00341             AfxMessageBox("Can't remove the last item from the history.\n"
00342                 "Please add a new location first and then remove the current one.", MB_OK | MB_ICONSTOP);
00343         }
00344
00345         //we have to prevent it going to another window
00346         bRes = TRUE;
00347     }
00348
00349     return bRes;
00350 }
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/HistComboBoxEx.h Source File

WinCvs/HistComboBoxEx.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- July 2001
00019  */
00020
00021 #if !defined(AFX_HISTCOMBOBOXEX_H__E330E7B9_8C79_44CB_8F07_01D395975365__INCLUDED_)
00022 #define AFX_HISTCOMBOBOXEX_H__E330E7B9_8C79_44CB_8F07_01D395975365__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 // HistComboBoxEx.h : header file
00028 //
00029
00030 #define HISTLOC_IMAGE_CX        16
00031 #define HISTLOC_VISIBLEITEMS    8
00032
00033 enum
00034 {
00035     kLocationIconUnknown = 0,
00036     kLocationIcon,
00037     kLocationIconIgnored,
00038     kLocationIconMissing,
00039     kLocationIconErased
00040 };
00041
00043 // CHistComboBoxEx window
00044
00045 class CHistComboBoxEx : public CComboBoxEx, public USmartCombo
00046 {
00047 // Construction
00048 public:
00049     CHistComboBoxEx(int feature = USmartCombo::DefaultFeature);
00050
00051 // Attributes
00052 public:
00053
00054 // Operations
00055 public:
00056
00057 // Overrides
00058     // ClassWizard generated virtual function overrides
00059     //{{AFX_VIRTUAL(CHistComboBoxEx)
00060     public:
00061     virtual BOOL PreTranslateMessage(MSG* pMsg);
00062     //}}AFX_VIRTUAL
00063
00064 // Implementation
00065 public:
00066     virtual ~CHistComboBoxEx();
00067
00068     // Generated message map functions
00069 protected:
00070     //{{AFX_MSG(CHistComboBoxEx)
00071     afx_msg void OnDropdown();
00072     //}}AFX_MSG
00073
00074     DECLARE_MESSAGE_MAP()
00075 private:
00076     virtual int CalcDroppedWidth();
00077     BOOL DelKeyTest(MSG* pMsg);
00078
00079 private:
00080     CImageList m_ImageList;
00081
00082 public:
00083     int AddString(LPCTSTR lpszString);
00084     int InsertString(int nIndex, LPCTSTR lpszString);
00085     BOOL SetIcon(COMBOBOXEXITEM cbi);
00086
00087     const char* GetOldLoc();
00088     int NewRoot(const char* root);
00089     static CString FindBestRoot(CMString& strItems, const char* path, bool mustExist = false);
00090 };
00091
00093
00094 //{{AFX_INSERT_LOCATION}}
00095 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00096
00097 #endif // !defined(AFX_HISTCOMBOBOXEX_H__E330E7B9_8C79_44CB_8F07_01D395975365__INCLUDED_)
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/LogFrm.cpp Source File

WinCvs/LogFrm.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 // ChildFrm.cpp : implementation of the CLogFrame class
00022 //
00023
00024 #include "stdafx.h"
00025 #include "wincvs.h"
00026
00027 #include "LogFrm.h"
00028 #include "WinCvsBrowser.h"
00029 #include "BrowseFileView.h"
00030 #include "WincvsView.h"
00031 #include "MainFrm.h"
00032
00033 #include "wincvs_winutil.h"
00034
00035 #ifdef _DEBUG
00036 #define new DEBUG_NEW
00037 #undef THIS_FILE
00038 static char THIS_FILE[] = __FILE__;
00039 #endif
00040
00042 // inline function(s)
00043
00044 inline BOOL IsKeyMovingFocus(MSG* pMsg)
00045 {
00046      return ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_TAB) &&
00047          (!(0x8000 & GetKeyState(VK_CONTROL)))
00048          );
00049 }
00050
00052 // CLogFrame
00053
00054 IMPLEMENT_DYNCREATE(CLogFrame, CCJMDIChildWnd)
00055
00056 BEGIN_MESSAGE_MAP(CLogFrame, CCJMDIChildWnd)
00057     //{{AFX_MSG_MAP(CLogFrame)
00058     ON_WM_CLOSE()
00059     ON_WM_DESTROY()
00060     //}}AFX_MSG_MAP
00061 END_MESSAGE_MAP()
00062
00064 // CLogFrame construction/destruction
00065
00066 CLogFrame::CLogFrame()
00067 {
00068     // TODO: add member initialization code here
00069
00070 }
00071
00072 CLogFrame::~CLogFrame()
00073 {
00074 }
00075
00076 BOOL CLogFrame::OnCreateClient(LPCREATESTRUCT lpcs,
00077      CCreateContext* pContext)
00078 {
00079     BOOL res = CCJMDIChildWnd::OnCreateClient(lpcs, pContext);
00080     MDIMaximize();
00081
00082     return res;
00083 }
00084
00086 // CLogFrame diagnostics
00087
00088 #ifdef _DEBUG
00089 void CLogFrame::AssertValid() const
00090 {
00091     CCJMDIChildWnd::AssertValid();
00092 }
00093
00094 void CLogFrame::Dump(CDumpContext& dc) const
00095 {
00096     CCJMDIChildWnd::Dump(dc);
00097 }
00098
00099 #endif //_DEBUG
00100
00102 // CLogFrame message handlers
00103
00104 void CLogFrame::OnClose()
00105 {
00106     // prevent from closing the main frame
00107     //CCJMDIChildWnd::OnClose();
00108 }
00109
00110 BOOL CLogFrame::PreTranslateMessage(MSG* pMsg)
00111 {
00112 /*  if (IsKeyMovingFocus(pMsg))
00113     {
00114         CWnd* pWnd;
00115         if (0x8000 & GetKeyState(VK_SHIFT))
00116             pWnd = FindPrevWindow(GetFocus());
00117         else
00118             pWnd = FindNextWindow(GetFocus());
00119         if(pWnd)
00120         {
00121             LRESULT DlgCode = ::SendMessage(pMsg->hwnd, WM_GETDLGCODE, 0, 0);
00122             if (!(DlgCode & (DLGC_WANTTAB | DLGC_WANTALLKEYS)))
00123             {
00124                 if (pWnd->IsKindOf(RUNTIME_CLASS(CView)))
00125                     SetActiveView((CView*)pWnd, TRUE);
00126                 else
00127                     pWnd->SetFocus();
00128             }
00129         }
00130         return TRUE;
00131     }*/
00132
00133     return CCJMDIChildWnd::PreTranslateMessage(pMsg);
00134 }
00135
00136 BOOL CLogFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
00137 {
00138     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00139     if(app->GetMainFrame()->OnBroadcastCmdMsg(nID, nCode, pExtra, pHandlerInfo))
00140         return TRUE;
00141
00142     return CCJMDIChildWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
00143 }
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/LogFrm.h Source File

WinCvs/LogFrm.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 // ChildFrm.h : interface of the CLogFrame class
00022 //
00024
00025 #if !defined(AFX_CHILDFRM_H__09F456BF_0018_11D2_BCAA_000000000000__INCLUDED_)
00026 #define AFX_CHILDFRM_H__09F456BF_0018_11D2_BCAA_000000000000__INCLUDED_
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif // _MSC_VER >= 1000
00031
00032 class CLogFrame : public CCJMDIChildWnd
00033 {
00034     DECLARE_DYNCREATE(CLogFrame)
00035 public:
00036     CLogFrame();
00037
00038 // Attributes
00039 public:
00040
00041 // Operations
00042 public:
00043
00044 // Overrides
00045     // ClassWizard generated virtual function overrides
00046     //{{AFX_VIRTUAL(CLogFrame)
00047     public:
00048     virtual BOOL PreTranslateMessage(MSG* pMsg);
00049     virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
00050     //}}AFX_VIRTUAL
00051
00052 // Implementation
00053 public:
00054     virtual ~CLogFrame();
00055     virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
00056
00057 #ifdef _DEBUG
00058     virtual void AssertValid() const;
00059     virtual void Dump(CDumpContext& dc) const;
00060 #endif
00061
00062 // Generated message map functions
00063 protected:
00064
00065     //{{AFX_MSG(CLogFrame)
00066     afx_msg void OnClose();
00067     //}}AFX_MSG
00068     DECLARE_MESSAGE_MAP()
00069 };
00070
00072
00073 //{{AFX_INSERT_LOCATION}}
00074 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00075
00076 #endif // !defined(AFX_CHILDFRM_H__09F456BF_0018_11D2_BCAA_000000000000__INCLUDED_)
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/MainFrm.cpp Source File

WinCvs/MainFrm.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  *
00020  * Sep. 21, 00 - added option to compile this file without 'explore' view,
00021  *               define NOEXPLOREVIEW
00022  */
00023
00024 // MainFrm.cpp : implementation of the CMainFrame class
00025 //
00026
00027 #include "stdafx.h"
00028 #include <afxmt.h>
00029 //#include <../src/afximpl.h>
00030 #include "wincvs.h"
00031
00032 #include "MainFrm.h"
00033 #include "WinCvsBrowser.h"
00034 #include "BrowseFileView.h"
00035 #include "WincvsView.h"
00036 #include "Persistent.h"
00037 #include "AppConsole.h"
00038 #include "Splash.h"
00039 #include "BrowserBar.h"
00040 #include "ExploreBar.h"
00041 #include "CvsPrefs.h"
00042 #include "AppGlue.h"
00043
00044 #ifdef _DEBUG
00045 #define new DEBUG_NEW
00046 #undef THIS_FILE
00047 static char THIS_FILE[] = __FILE__;
00048 #endif
00049
00050 CMString gHistoryLocs(100, "P_BrowserLocs");
00051
00052 static bool IsAppEnabled()
00053 {
00054     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00055     return !app->gCvsRunning && !gCvsPrefs.empty();
00056 }
00057
00058 class CWinPlacement : public CPersistent
00059 {
00060 public:
00061     WINDOWPLACEMENT placement;
00062     bool hasOne;
00063
00064     CWinPlacement(const char *uniqueName) : CPersistent(uniqueName, kNoClass)
00065     {
00066         hasOne = false;
00067     }
00068     virtual ~CWinPlacement()
00069     {
00070     }
00071
00072     virtual unsigned int SizeOf(void) const
00073     {
00074         return hasOne ? sizeof(WINDOWPLACEMENT) : 0;
00075     }
00076
00077     virtual const void *GetData(void) const
00078     {
00079         return hasOne ? &placement : 0L;
00080     }
00081
00082     virtual void SetData(const void *ptr, unsigned int size)
00083     {
00084         if(size == sizeof(WINDOWPLACEMENT))
00085         {
00086             memcpy(&placement, ptr, sizeof(WINDOWPLACEMENT));
00087             hasOne = true;
00088         }
00089     }
00090
00091     CWinPlacement & operator=(const WINDOWPLACEMENT & newplace)
00092     {
00093         TouchTimeStamp();
00094         memcpy(&placement, &newplace, sizeof(WINDOWPLACEMENT));
00095         hasOne = true;
00096         return *this;
00097     }
00098 };
00099
00100 static CWinPlacement gMainPlacement("P_MainPlacement");
00101
00103 // CMainFrame
00104
00105 IMPLEMENT_DYNAMIC(CMainFrame, CCJMDIFrameWnd)
00106
00107 BEGIN_MESSAGE_MAP(CMainFrame, CCJMDIFrameWnd)
00108     ON_WM_INITMENU()
00109     //{{AFX_MSG_MAP(CMainFrame)
00110     ON_WM_CREATE()
00111     ON_WM_CLOSE()
00112     ON_WM_DROPFILES()
00113     ON_CBN_SELCHANGE(ID_HISTORYBROWSE, OnHistorySelect)
00114     ON_WM_ACTIVATE()
00115     ON_WM_SYSCOMMAND()
00116     ON_COMMAND(ID_VIEW_RECURSIVE, OnViewRecursive)
00117     ON_COMMAND(ID_VIEW_MODIFIED, OnViewModified)
00118     ON_UPDATE_COMMAND_UI(ID_VIEW_MODIFIED, OnUpdateViewModified)
00119     ON_UPDATE_COMMAND_UI(ID_VIEW_RECURSIVE, OnUpdateViewRecursive)
00120     ON_COMMAND(ID_VIEW_CONFLICT, OnViewConflict)
00121     ON_UPDATE_COMMAND_UI(ID_VIEW_CONFLICT, OnUpdateViewConflict)
00122     ON_COMMAND(ID_VIEW_UNKNOWN, OnViewUnknown)
00123     ON_UPDATE_COMMAND_UI(ID_VIEW_UNKNOWN, OnUpdateViewUnknown)
00124     ON_COMMAND(ID_VIEW_MISSING, OnViewMissing)
00125     ON_UPDATE_COMMAND_UI(ID_VIEW_MISSING, OnUpdateViewMissing)
00126     ON_COMMAND(ID_VIEW_IGNORE, OnViewIgnore)
00127     ON_UPDATE_COMMAND_UI(ID_VIEW_IGNORE, OnUpdateViewIgnore)
00128     ON_UPDATE_COMMAND_UI(ID_FILTERMASK, OnUpdateFilterMask)
00129     ON_UPDATE_COMMAND_UI(ID_HISTORYBROWSE, OnUpdateHistory)
00130     ON_COMMAND(ID_VIEW_ADDED, OnViewAdded)
00131     ON_UPDATE_COMMAND_UI(ID_VIEW_ADDED, OnUpdateViewAdded)
00132     ON_UPDATE_COMMAND_UI(ID_VIEW_REMOVED, OnUpdateViewRemoved)
00133     ON_COMMAND(ID_VIEW_REMOVED, OnViewRemoved)
00134     ON_COMMAND(ID_VIEW_CHANGED, OnViewChanged)
00135     ON_UPDATE_COMMAND_UI(ID_VIEW_CHANGED, OnUpdateViewChanged)
00136     ON_COMMAND(ID_VIEW_HIDEUNKNOWN, OnViewHideunknown)
00137     ON_UPDATE_COMMAND_UI(ID_VIEW_HIDEUNKNOWN, OnUpdateViewHideunknown)
00138     ON_WM_TIMER()
00139     //}}AFX_MSG_MAP
00140     ON_COMMAND_EX(ID_VIEW_BROWSER_BAR, CCJMDIFrameWnd::OnBarCheck)
00141     ON_COMMAND_EX(ID_VIEW_FILES_BAR, CCJMDIFrameWnd::OnBarCheck)
00142     ON_COMMAND_EX(ID_VIEW_FILTER_BAR, CCJMDIFrameWnd::OnBarCheck)
00143     ON_COMMAND_EX(ID_VIEW_MULTI_BAR, CCJMDIFrameWnd::OnBarCheck)
00144     ON_COMMAND_EX(ID_VIEW_TAGS_BAR, CCJMDIFrameWnd::OnBarCheck)
00145     ON_COMMAND_EX(ID_VIEW_CONSOLE_BAR, CCJMDIFrameWnd::OnBarCheck)
00146     ON_COMMAND_EX(ID_VIEW_WORKSPACE, CCJMDIFrameWnd::OnBarCheck)
00147     ON_UPDATE_COMMAND_UI(ID_VIEW_BROWSER_BAR, CCJMDIFrameWnd::OnUpdateControlBarMenu)
00148     ON_UPDATE_COMMAND_UI(ID_VIEW_FILES_BAR, CCJMDIFrameWnd::OnUpdateControlBarMenu)
00149     ON_UPDATE_COMMAND_UI(ID_VIEW_FILTER_BAR, CCJMDIFrameWnd::OnUpdateControlBarMenu)
00150     ON_UPDATE_COMMAND_UI(ID_VIEW_MULTI_BAR, CCJMDIFrameWnd::OnUpdateControlBarMenu)
00151     ON_UPDATE_COMMAND_UI(ID_VIEW_TAGS_BAR, CCJMDIFrameWnd::OnUpdateControlBarMenu)
00152     ON_UPDATE_COMMAND_UI(ID_VIEW_CONSOLE_BAR, CCJMDIFrameWnd::OnUpdateControlBarMenu)
00153     ON_UPDATE_COMMAND_UI(ID_VIEW_WORKSPACE, CCJMDIFrameWnd::OnUpdateControlBarMenu)
00154     // Global help commands
00155     ON_COMMAND(ID_HELP_FINDER, CCJMDIFrameWnd::OnHelpFinder)
00156     ON_COMMAND(ID_HELP, CCJMDIFrameWnd::OnHelp)
00157     ON_COMMAND(ID_CONTEXT_HELP, CCJMDIFrameWnd::OnContextHelp)
00158     ON_COMMAND(ID_DEFAULT_HELP, CCJMDIFrameWnd::OnHelpFinder)
00159 END_MESSAGE_MAP()
00160
00161 static UINT indicators[] =
00162 {
00163     ID_SEPARATOR,           // status line indicator
00164     ID_SEPARATOR,           // rotating icon
00165     ID_INDICATOR_CAPS,
00166     ID_INDICATOR_NUM,
00167     ID_INDICATOR_SCRL,
00168 };
00169
00171 // CMainFrame construction/destruction
00172
00173 CMainFrame::CMainFrame()
00174 {
00175     m_bRestoreFocus = FALSE;
00176 }
00177
00178 CMainFrame::~CMainFrame()
00179 {
00180 }
00181
00182 BOOL CMainFrame::InitializeDockingWindows()
00183 {
00184     // Initial size when docked: top, bottom, left, right.
00185     // ??? SetInitialSize(125,225,225,225);
00186
00187     if (!m_wndWorkspace.Create(this, ID_VIEW_WORKSPACE,
00188         _T("Workspace"), CSize(200,100), CBRS_LEFT))
00189     {
00190         TRACE0("Failed to create dialog bar (Workspace)\n");
00191         return -1;      // fail to create
00192     }
00193
00194     m_wndWorkspace.AddView(_T("Modules"), RUNTIME_CLASS(CBrowserBar));
00195 #ifndef NOEXPLOREVIEW
00196     m_wndWorkspace.AddView(_T("Explore"), RUNTIME_CLASS(CExploreBar));
00197 #endif
00198     m_wndWorkspace.SetActiveView(0);
00199     // Define the image list to use with the tab control
00200     m_TabImages.Create (IDR_WORKSPACE, 16, 1, RGB(255,255,255));
00201     m_wndWorkspace.SetTabImageList(&m_TabImages);
00202     //m_wndWorkspace.SetMenuID(IDR_POPUP);
00203     m_wndWorkspace.EnableDockingOnSizeBar(CBRS_ALIGN_ANY);
00204
00205     if (!m_consolebar.Create(this, ID_VIEW_CONSOLE_BAR,
00206         _T("Output"), CSize(300,100), CBRS_BOTTOM))
00207     {
00208         TRACE0("Failed to create dialog bar (Output)\n");
00209         return FALSE;       // fail to create
00210     }
00211
00212     //m_consolebar.SetMenuID(IDR_POPUP);
00213     m_consolebar.EnableDockingOnSizeBar(CBRS_ALIGN_ANY);
00214
00215     EnableDockingSizeBar(CBRS_ALIGN_ANY);
00216     DockSizeBar(&m_wndWorkspace);
00217     DockSizeBar(&m_consolebar);
00218
00219     return TRUE;
00220 }
00221
00222 static void onFilterMaskEntered(CObject *obj)
00223 {
00224     ((CMainFrame *)obj)->OnFilterMaskEntered();
00225 }
00226
00227 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
00228 {
00229     if (CCJMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
00230         return -1;
00231
00232     if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
00233         | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
00234         !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
00235     {
00236         TRACE0("Failed to create toolbar (Standard)\n");
00237         return -1;      // fail to create
00238     }
00239
00240     if (!m_wndBrowser.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
00241         | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(0, 0, 0, 0), ID_VIEW_BROWSER_BAR) ||
00242         !m_wndBrowser.LoadToolBar(IDR_BROWSER))
00243     {
00244         TRACE0("Failed to create toolbar (Browse)\n");
00245         return -1;      // fail to create
00246     }
00247
00248     m_wndBrowser.SetButtonInfo(3, ID_SEPARATOR, TBBS_SEPARATOR, 200);
00249     CRect rect;
00250     m_wndBrowser.GetItemRect(3, &rect);
00251     rect.bottom += HISTLOC_VISIBLEITEMS * HISTLOC_IMAGE_CX + rect.bottom % HISTLOC_IMAGE_CX;
00252
00253     m_browseHist.SetItems(&gHistoryLocs);
00254
00255     if (!m_browseHist.Create(CBS_DROPDOWNLIST|WS_CHILD|WS_VISIBLE|WS_TABSTOP|WS_VSCROLL|WS_HSCROLL,
00256             rect, &m_wndBrowser, ID_HISTORYBROWSE))
00257     {
00258         TRACE0("Failed to create combobox (Browse History)\n");
00259         return -1;      // fail to create
00260     }
00261
00262     // Older versions of Windows* (NT 3.51 for instance) fail with DEFAULT_GUI_FONT
00263     if (!m_fontNormal.CreateStockObject(DEFAULT_GUI_FONT))
00264     {
00265         if (!m_fontNormal.CreatePointFont(80, "MS Sans Serif"))
00266         {
00267             TRACE0("Failed to create default GUI font\n");
00268             return -1;
00269         }
00270     }
00271
00272     // Make browse history use default GUI font
00273     m_browseHist.SetFont(&m_fontNormal);
00274
00275     if (!m_wndList.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
00276         | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(0, 0, 0, 0), ID_VIEW_FILES_BAR) ||
00277         !m_wndList.LoadToolBar(IDR_FILELIST))
00278     {
00279         TRACE0("Failed to create toolbar (Files)\n");
00280         return -1;      // fail to create
00281     }
00282
00283     if (!m_wndFilter.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
00284         | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(0, 0, 0, 0), ID_VIEW_FILTER_BAR) ||
00285         !m_wndFilter.LoadToolBar(IDR_FILTER))
00286     {
00287         TRACE0("Failed to create toolbar (Filter)\n");
00288         return -1;      // fail to create
00289     }
00290
00291     if (!m_wndMultiUser.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
00292         | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(0, 0, 0, 0), ID_VIEW_MULTI_BAR) ||
00293         !m_wndMultiUser.LoadToolBar(IDR_MULTIUSER))
00294     {
00295         TRACE0("Failed to create toolbar (Multi-User)\n");
00296         return -1;      // fail to create
00297     }
00298
00299     if (!m_wndTags.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
00300         | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(0, 0, 0, 0), ID_VIEW_TAGS_BAR) ||
00301         !m_wndTags.LoadToolBar(IDR_TAGS))
00302     {
00303         TRACE0("Failed to create toolbar (Tags)\n");
00304         return -1;      // fail to create
00305     }
00306
00307     if (!m_wndStatusBar.Create(this) ||
00308         !m_wndStatusBar.SetIndicators(indicators,
00309           sizeof(indicators)/sizeof(UINT)))
00310     {
00311         TRACE0("Failed to create status bar\n");
00312         return -1;      // fail to create
00313     }
00314
00315     // rotating icon
00316     UINT nID, nStyle;
00317     int cxWidth;
00318     m_wndStatusBar.GetPaneInfo( 1, nID, nStyle, cxWidth);
00319     m_wndStatusBar.SetPaneInfo( 1, nID, nStyle|SBPS_OWNERDRAW, 100);
00320
00321     EnableDocking(CBRS_ALIGN_ANY);
00322
00323     // Set toolbar title (visible when toolbar is floating)
00324     // Adjust toolbar height (default of 26 pixels is a little bit too small)
00325     // Enable docking
00326     m_wndToolBar.SetWindowText("Standard");
00327     m_wndToolBar.SetHeight(28);
00328     m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
00329         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
00330     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
00331     DockControlBar(&m_wndToolBar,AFX_IDW_DOCKBAR_TOP);
00332
00333     m_wndBrowser.SetWindowText("Browse");
00334     m_wndBrowser.SetHeight(28);
00335     m_wndBrowser.SetBarStyle(m_wndBrowser.GetBarStyle() |
00336         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
00337     m_wndBrowser.EnableDocking(CBRS_ALIGN_ANY);
00338     DockControlBarLeftOf(&m_wndBrowser,&m_wndToolBar);
00339
00340     m_wndList.SetWindowText("Files");
00341     m_wndList.SetHeight(28);
00342     m_wndList.SetBarStyle(m_wndList.GetBarStyle() |
00343         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
00344     m_wndList.EnableDocking(CBRS_ALIGN_ANY);
00345     DockControlBarLeftOf(&m_wndList,&m_wndBrowser);
00346
00347     m_wndMultiUser.SetWindowText("Multi-Users");
00348     m_wndMultiUser.SetHeight(28);
00349     m_wndMultiUser.SetBarStyle(m_wndMultiUser.GetBarStyle() |
00350         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
00351     m_wndMultiUser.EnableDocking(CBRS_ALIGN_ANY);
00352     DockControlBarLeftOf(&m_wndMultiUser,&m_wndList);
00353
00354     m_wndTags.SetWindowText("Tags");
00355     m_wndTags.SetHeight(28);
00356     m_wndTags.SetBarStyle(m_wndTags.GetBarStyle() |
00357         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
00358     m_wndTags.EnableDocking(CBRS_ALIGN_ANY);
00359     DockControlBarLeftOf(&m_wndTags,&m_wndMultiUser);
00360
00361     m_wndFilter.SetWindowText("Filter");
00362     m_wndFilter.SetHeight(28);
00363     m_wndFilter.SetBarStyle(m_wndFilter.GetBarStyle() |
00364         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
00365     m_wndFilter.EnableDocking(CBRS_ALIGN_ANY);
00366     DockControlBarLeftOf(&m_wndFilter,&m_wndTags);
00367
00368     m_wndFilter.SetButtonInfo(2, ID_SEPARATOR, TBBS_SEPARATOR, 200);
00369     m_wndFilter.GetItemRect(2, &rect);
00370     rect.bottom += 80;
00371
00372     if (!m_comboFilterMask.Create(CBS_DROPDOWN|WS_CHILD|WS_VISIBLE|WS_TABSTOP,
00373             rect, &m_wndFilter, ID_FILTERMASK))
00374     {
00375         TRACE0("Failed to create combobox (filter mask)\n");
00376         return -1;          // fail to create
00377     }
00378
00379     // Make browse history use default GUI font
00380     m_comboFilterMask.SetFont(&m_fontNormal);
00381     m_comboFilterMask.GetManager()->CheckIn(this, onFilterMaskEntered);
00382
00383
00384     if(!InitializeDockingWindows())
00385     {
00386         TRACE0("Failed to initialize docking windows\n");
00387         return -1;      // fail to create
00388     }
00389
00390 #if 1
00391     // load the dock state, but check the toolbar exists (MFC bug)
00392     CDockState state;
00393     state.LoadState(_T("Bar State"));
00394     for (int i = 0; i < state.m_arrBarInfo.GetSize(); i++)
00395     {
00396         CControlBarInfo* pInfo = (CControlBarInfo*)state.m_arrBarInfo[i];
00397         ASSERT(pInfo != NULL);
00398         if (!pInfo->m_bFloating)
00399         {
00400             pInfo->m_pBar = GetControlBar(pInfo->m_nBarID);
00401             if(pInfo->m_pBar == NULL)
00402             {
00403                 delete (CControlBarInfo*)state.m_arrBarInfo[i];
00404                 state.m_arrBarInfo.RemoveAt(i);
00405                 i--;
00406             }
00407         }
00408     }
00409     SetDockState(state);
00410 #else
00411     LoadBarState(_T("Bar State"));
00412 #endif
00413     m_state.LoadWindowPos(this);
00414
00415     // CG: The following line was added by the Splash Screen component.
00416     CSplashWnd::ShowSplashScreen(this);
00417
00418     SetTimer(99, 200, 0L);
00419
00420     return 0;
00421 }
00422
00423 void CMainFrame::DockControlBarLeftOf(CToolBar* Bar,CToolBar* LeftOf)
00424 {
00425     CRect rect;
00426     DWORD dw;
00427     UINT n;
00428
00429     // get MFC to adjust the dimensions of all docked ToolBars
00430     // so that GetWindowRect will be accurate
00431     RecalcLayout();
00432     LeftOf->GetWindowRect(&rect);
00433     rect.OffsetRect(1,0);
00434     dw=LeftOf->GetBarStyle();
00435     n = 0;
00436     n = (dw&CBRS_ALIGN_TOP) ? AFX_IDW_DOCKBAR_TOP : n;
00437     n = (dw&CBRS_ALIGN_BOTTOM && n==0) ? AFX_IDW_DOCKBAR_BOTTOM : n;
00438     n = (dw&CBRS_ALIGN_LEFT && n==0) ? AFX_IDW_DOCKBAR_LEFT : n;
00439     n = (dw&CBRS_ALIGN_RIGHT && n==0) ? AFX_IDW_DOCKBAR_RIGHT : n;
00440
00441     // When we take the default parameters on rect, DockControlBar will dock
00442     // each Toolbar on a seperate line.  By calculating a rectangle, we in effect
00443     // are simulating a Toolbar being dragged to that location and docked.
00444     DockControlBar(Bar,n,&rect);
00445 }
00446
00447 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
00448 {
00449     // TODO: Modify the Window class or styles here by modifying
00450     //  the CREATESTRUCT cs
00451
00452     return CCJMDIFrameWnd::PreCreateWindow(cs);
00453 }
00454
00456 // CMainFrame diagnostics
00457
00458 #ifdef _DEBUG
00459 void CMainFrame::AssertValid() const
00460 {
00461     CCJMDIFrameWnd::AssertValid();
00462 }
00463
00464 void CMainFrame::Dump(CDumpContext& dc) const
00465 {
00466     CCJMDIFrameWnd::Dump(dc);
00467 }
00468
00469 #endif //_DEBUG
00470
00472 // CMainFrame message handlers
00473
00474 void CMainFrame::OnClose()
00475 {
00476     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00477     if(app->gCvsRunning)
00478     {
00479         AfxMessageBox("Cvs is currently running : stop cvs first before quitting", MB_OK | MB_ICONSTOP);
00480         return;
00481     }
00482
00483     // only way I found to notify the browser
00484     // and to prevent the memory leak support.
00485     app->GetBrowserView()->ResetBrowser(0L);
00486
00487     // Charybids Ltd's suggested fix:
00488     // Saving the window positions whilst iconic trashes the registry.
00489     if (!IsIconic())
00490     {
00491         m_state.SaveWindowPos(this);
00492         SaveBarState(_T("Bar State"));
00493
00494         WINDOWPLACEMENT wp;
00495         wp.length = sizeof wp;
00496         if (GetWindowPlacement(&wp)) {
00497             wp.flags &= WPF_RESTORETOMAXIMIZED;
00498             gMainPlacement = wp;
00499         }
00500     }
00501
00502     // write all the persistents to the .INI file
00503     gCvsPrefs.save();
00504
00505     CCJMDIFrameWnd::OnClose();
00506 }
00507
00508 void CMainFrame::OnDropFiles(HDROP hDropInfo)
00509 {
00510     SetActiveWindow();  // activate us first !
00511     UINT nFiles = ::DragQueryFile(hDropInfo, (UINT)-1, NULL, 0);
00512
00513     CWinApp* pApp = AfxGetApp();
00514     for (UINT iFile = 0; iFile < nFiles; iFile++)
00515     {
00516         TCHAR szFileName[_MAX_PATH];
00517         ::DragQueryFile(hDropInfo, iFile, szFileName, _MAX_PATH);
00518
00519         if( iFile == 0 )
00520         {
00521             CColorConsole out;
00522             out << kBold << "Locating: " << kNormal << kUnderline << szFileName << kNormal <<  kNormal << kNL;
00523
00524             CWincvsApp* pApp = (CWincvsApp *)AfxGetApp();
00525             if( pApp )
00526             {
00527                 const TCHAR *p1, *p2 = szFileName;
00528
00529                 while( p2 )
00530                 {
00531                     p1 = ++p2;
00532                     p2 = strchr(p2, _T('\\'));
00533                 }
00534
00535                 CWinCvsBrowser* pBrowser = pApp->GetBrowserView();
00536                 if( pBrowser )
00537                 {
00538                     if( pBrowser->StepToLocation(szFileName, true) )
00539                     {
00540                         pApp->GetFileView()->ResetView(false, p1);
00541                     }
00542                 }
00543             }
00544         }
00545
00546         // replace \ by /
00547         TCHAR *tmp = szFileName;
00548         while( (tmp = strchr(tmp, '\\')) != 0L )
00549         {
00550             *tmp++ = '/';
00551         }
00552
00553         cvs_out("%s\n", szFileName);
00554
00555         //pApp->OpenDocumentFile(szFileName);
00556     }//end for
00557
00558     ::DragFinish(hDropInfo);
00559 }
00560
00561 void CMainFrame::OnInitMenu(CMenu* pMenu)
00562 {
00563     CCJMDIFrameWnd::OnInitMenu(pMenu);
00564
00565 #if 0 // now it's in the resources
00566     // CG: This block added by 'Tip of the Day' component.
00567     {
00568         // TODO: This code adds the "Tip of the Day" menu item
00569         // on the fly.  It may be removed after adding the menu
00570         // item to all applicable menu items using the resource
00571         // editor.
00572
00573         // Add Tip of the Day menu item on the fly!
00574         static CMenu* pSubMenu = NULL;
00575
00576         CString strHelp; strHelp.LoadString(CG_IDS_TIPOFTHEDAYHELP);
00577         CString strMenu;
00578         int nMenuCount = pMenu->GetMenuItemCount();
00579         BOOL bFound = FALSE;
00580         for (int i=0; i < nMenuCount; i++)
00581         {
00582             pMenu->GetMenuString(i, strMenu, MF_BYPOSITION);
00583             if (strMenu == strHelp)
00584             {
00585                 pSubMenu = pMenu->GetSubMenu(i);
00586                 bFound = TRUE;
00587                 ASSERT(pSubMenu != NULL);
00588             }
00589         }
00590
00591         CString strTipMenu;
00592         strTipMenu.LoadString(CG_IDS_TIPOFTHEDAYMENU);
00593         if (!bFound)
00594         {
00595             // Help menu is not available. Please add it!
00596             if (pSubMenu == NULL)
00597             {
00598                 // The same pop-up menu is shared between mainfrm and frame
00599                 // with the doc.
00600                 static CMenu popUpMenu;
00601                 pSubMenu = &popUpMenu;
00602                 pSubMenu->CreatePopupMenu();
00603                 pSubMenu->InsertMenu(0, MF_STRING|MF_BYPOSITION,
00604                     CG_IDS_TIPOFTHEDAY, strTipMenu);
00605             }
00606             pMenu->AppendMenu(MF_STRING|MF_BYPOSITION|MF_ENABLED|MF_POPUP,
00607                 (UINT)pSubMenu->m_hMenu, strHelp);
00608             DrawMenuBar();
00609         }
00610         else
00611         {
00612             // Check to see if the Tip of the Day menu has already been added.
00613             pSubMenu->GetMenuString(0, strMenu, MF_BYPOSITION);
00614
00615             if (strMenu != strTipMenu)
00616             {
00617                 // Tip of the Day submenu has not been added to the
00618                 // first position, so add it.
00619                 pSubMenu->InsertMenu(0, MF_BYPOSITION);  // Separator
00620                 pSubMenu->InsertMenu(0, MF_STRING|MF_BYPOSITION,
00621                     CG_IDS_TIPOFTHEDAY, strTipMenu);
00622             }
00623         }
00624     }
00625 #endif
00626 }
00627
00628 void CMainFrame::InitialShowWindow(int nCmdShow)
00629 {
00630     if (gMainPlacement.hasOne)
00631     {
00632         WINDOWPLACEMENT wp = gMainPlacement.placement;
00633         if (nCmdShow != SW_SHOWNORMAL)
00634             wp.showCmd = nCmdShow;
00635         else if (wp.showCmd & SW_SHOWMINIMIZED)
00636             wp.showCmd = (wp.flags & WPF_RESTORETOMAXIMIZED) ? SW_MAXIMIZE : SW_SHOWNORMAL;
00637         SetWindowPlacement(&wp);
00638     }
00639     else
00640     {
00641         ShowWindow(nCmdShow);
00642     }
00643 }
00644
00645 void CMainFrame::OnHistorySelect()
00646 {
00647     ChangeLocation();
00648 }
00649
00650 void CMainFrame::ChangeLocation()
00651 {
00652     int nCurSel = m_browseHist.GetCurSel();
00653     CString s;
00654     m_browseHist.GetLBText(nCurSel, s);
00655     if(!s.IsEmpty())
00656     {
00657         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00658         app->GetBrowserView()->ResetBrowser(s, true);
00659         app->ActivateBrowserView();
00660     }
00661 }
00662
00663 CWinCvsBrowser *CMainFrame::GetBrowserView()
00664 {
00665     CBrowserBar *bar = (CBrowserBar *)m_wndWorkspace.GetView(0);
00666     return bar->GetBrowserView();
00667 }
00668
00669 CCJShellTree *CMainFrame::GetExplorerView()
00670 {
00671     CExploreBar *bar = (CExploreBar *)m_wndWorkspace.GetView(1);
00672     return &bar->m_TreeCtrl;
00673 }
00674
00675 BOOL CMainFrame::OnBroadcastCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
00676 {
00677     CPushRoutingFrame push(this);
00678
00679     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00680
00681     // pump through dock bars FIRST
00682     CWinCvsBrowser *bView = app->GetBrowserView();
00683     if (bView != NULL && bView == CWnd::GetFocus() && bView->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
00684         return TRUE;
00685 #ifndef NOEXPLOREVIEW
00686     // pump through dock bars FIRST
00687     CCJShellTree *eView = app->GetExplorerView();
00688     if (eView != NULL && eView == CWnd::GetFocus())
00689     {
00690         if(eView->GetParent()->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
00691             return TRUE;
00692     }
00693 #endif
00694
00695     CWincvsView *cView = app->GetConsoleView();
00696     if (cView != NULL && cView == CWnd::GetFocus() && cView->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
00697         return TRUE;
00698
00699     return FALSE;
00700 }
00701
00702 void CMainFrame::DropFiles(HDROP hDropInfo)
00703 {
00704     OnDropFiles(hDropInfo);
00705 }
00706
00707 void CMainFrame::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
00708 {
00709     CCJMDIFrameWnd::OnActivate(nState, pWndOther, bMinimized);
00710
00711     // TODO: Add your message handler code here
00712
00713     //JK - prevent the focus to be gone from FileView to the Workspace - for the Dialogs etc.
00714     CWincvsApp* pApp = (CWincvsApp*)AfxGetApp();
00715     ASSERT(pApp);
00716
00717     if( WA_INACTIVE == nState && !m_bRestoreFocus )
00718     {
00719         m_bRestoreFocus = BOOL( GetFocus() == pApp->GetFileView() );
00720         pApp->m_isBackgroundProcess = true;
00721     }
00722     else
00723     {
00724         pApp->m_isBackgroundProcess = false;
00725         if( !bMinimized && m_bRestoreFocus )
00726         {
00727             m_bRestoreFocus = FALSE;
00728             CBrowseFileView* pBrowseFileView = pApp->GetFileView();
00729             if(pBrowseFileView)
00730             {
00731                 pBrowseFileView->SetFocus();
00732             }
00733         }
00734     }
00735 }
00736
00737 void CMainFrame::OnSysCommand(UINT nID, LPARAM lParam)
00738 {
00739     // TODO: Add your message handler code here and/or call default
00740
00741     //JK - prevent the focus to be gone from FileView to the Workspace - for the Minimize
00742     if( SC_MINIMIZE == nID )
00743     {
00744         CWincvsApp* pApp = (CWincvsApp*)AfxGetApp();
00745         ASSERT(pApp);
00746
00747         m_bRestoreFocus = BOOL( GetFocus() == pApp->GetFileView() );
00748     }
00749
00750     CCJMDIFrameWnd::OnSysCommand(nID, lParam);
00751 }
00752
00753 void CMainFrame::OnViewRecursive()
00754 {
00755     m_recursion.ToggleRecursion();
00756     m_recursion.GetNotificationManager()->NotifyAll();
00757     OnFilterMaskEntered();
00758 }
00759
00760 void CMainFrame::OnUpdateViewRecursive(CCmdUI* pCmdUI)
00761 {
00762     pCmdUI->Enable(IsAppEnabled());
00763     pCmdUI->SetCheck(m_recursion.IsShowRecursive());
00764 }
00765
00766 bool CMainFrame::FreshenFileMask()
00767 {
00768     CString strFileMask;
00769     m_comboFilterMask.GetWindowText(strFileMask);
00770     return m_filter.SetMask(strFileMask);
00771 }
00772
00773 void CMainFrame::OnViewModified()
00774 {
00775     m_filter.ToggleModified();
00776     FreshenFileMask();
00777     m_filter.GetNotificationManager()->NotifyAll();
00778 }
00779
00780 void CMainFrame::OnUpdateViewModified(CCmdUI* pCmdUI)
00781 {
00782     pCmdUI->Enable(IsAppEnabled());
00783     pCmdUI->SetCheck(m_filter.IsModified());
00784 }
00785
00786 void CMainFrame::OnFilterMaskEntered()
00787 {
00788     if (FreshenFileMask())
00789     {
00790         m_filter.GetNotificationManager()->NotifyAll();
00791     }
00792 }
00793
00794 void CMainFrame::OnViewConflict()
00795 {
00796     m_filter.ToggleConflict();
00797     FreshenFileMask();
00798     m_filter.GetNotificationManager()->NotifyAll();
00799 }
00800
00801 void CMainFrame::OnUpdateViewConflict(CCmdUI* pCmdUI)
00802 {
00803     pCmdUI->Enable(IsAppEnabled());
00804     pCmdUI->SetCheck(m_filter.IsConflict());
00805 }
00806
00807 void CMainFrame::OnViewUnknown()
00808 {
00809     m_filter.ToggleUnknown();
00810     FreshenFileMask();
00811     m_filter.GetNotificationManager()->NotifyAll();
00812 }
00813
00814 void CMainFrame::OnUpdateViewUnknown(CCmdUI* pCmdUI)
00815 {
00816     pCmdUI->Enable(IsAppEnabled());
00817     pCmdUI->SetCheck(m_filter.IsUnknown());
00818 }
00819
00820 void CMainFrame::OnViewMissing()
00821 {
00822     m_filter.ToggleMissing();
00823     FreshenFileMask();
00824     m_filter.GetNotificationManager()->NotifyAll();
00825 }
00826
00827 void CMainFrame::OnUpdateViewMissing(CCmdUI* pCmdUI)
00828 {
00829     pCmdUI->Enable(IsAppEnabled());
00830     pCmdUI->SetCheck(m_filter.IsMissing());
00831 }
00832
00833 void CMainFrame::OnViewIgnore()
00834 {
00835     m_ignore.ToggleIgnore();
00836     m_ignore.GetNotificationManager()->NotifyAll();
00837     OnFilterMaskEntered();
00838 }
00839
00840 void CMainFrame::OnUpdateViewIgnore(CCmdUI* pCmdUI)
00841 {
00842     pCmdUI->Enable(IsAppEnabled());
00843     pCmdUI->SetCheck(m_ignore.IsShowIgnored());
00844 }
00845
00846 void CMainFrame::OnUpdateFilterMask(CCmdUI* pCmdUI)
00847 {
00848     pCmdUI->Enable(IsAppEnabled());
00849 }
00850
00851 void CMainFrame::OnUpdateHistory(CCmdUI* pCmdUI)
00852 {
00853     pCmdUI->Enable(IsAppEnabled());
00854 }
00855
00856 void CMainFrame::OnViewAdded()
00857 {
00858     m_filter.ToggleAdded();
00859     FreshenFileMask();
00860     m_filter.GetNotificationManager()->NotifyAll();
00861 }
00862
00863 void CMainFrame::OnUpdateViewAdded(CCmdUI* pCmdUI)
00864 {
00865     pCmdUI->Enable(IsAppEnabled());
00866     pCmdUI->SetCheck(m_filter.IsAdded());
00867 }
00868
00869 void CMainFrame::OnUpdateViewRemoved(CCmdUI* pCmdUI)
00870 {
00871     pCmdUI->Enable(IsAppEnabled());
00872     pCmdUI->SetCheck(m_filter.IsRemoved());
00873 }
00874
00875 void CMainFrame::OnViewRemoved()
00876 {
00877     m_filter.ToggleRemoved();
00878     FreshenFileMask();
00879     m_filter.GetNotificationManager()->NotifyAll();
00880 }
00881
00882 void CMainFrame::OnViewChanged()
00883 {
00884     m_filter.ToggleChanged();
00885     FreshenFileMask();
00886     m_filter.GetNotificationManager()->NotifyAll();
00887 }
00888
00889 void CMainFrame::OnUpdateViewChanged(CCmdUI* pCmdUI)
00890 {
00891     pCmdUI->Enable(IsAppEnabled());
00892     pCmdUI->SetCheck(m_filter.IsChanged());
00893 }
00894
00895 void CMainFrame::OnViewHideunknown()
00896 {
00897     m_filter.ToggleHideUnknown();
00898     FreshenFileMask();
00899     m_filter.GetNotificationManager()->NotifyAll();
00900 }
00901
00902 void CMainFrame::OnUpdateViewHideunknown(CCmdUI* pCmdUI)
00903 {
00904     pCmdUI->Enable(IsAppEnabled() && m_filter.IsDefaultMode());
00905     pCmdUI->SetCheck(m_filter.IsHideUnknown());
00906 }
00907
00908 static bool sAskingMainThread;
00909 static UStr sGetEnvResult;
00910
00911 static CSemaphore sGetEnv(0);
00912
00913 char *CMainFrame::GetEnvMainThread(const char *name)
00914 {
00915     ASSERT(::GetCurrentThreadId() != AfxGetApp()->m_nThreadID);
00916
00917     sGetEnvResult = name;
00918     sAskingMainThread = true;
00919
00920     sGetEnv.Lock();
00921
00922     return sGetEnvResult;
00923 }
00924
00925 void CMainFrame::OnTimer(UINT nIDEvent)
00926 {
00927     if(sAskingMainThread)
00928     {
00929         sAskingMainThread = false;
00930
00931         sGetEnvResult = glue_getenv(sGetEnvResult);
00932         sGetEnv.Unlock();
00933     }
00934 }
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/MainFrm.h Source File

WinCvs/MainFrm.h

Go to the documentation of this file.
00001 // MainFrm.h : interface of the CMainFrame class
00002 //
00004
00005 #if !defined(AFX_MAINFRM_H__D2D77DCC_8299_11D1_8949_444553540000__INCLUDED_)
00006 #define AFX_MAINFRM_H__D2D77DCC_8299_11D1_8949_444553540000__INCLUDED_
00007
00008 #if _MSC_VER >= 1000
00009 #pragma once
00010 #endif // _MSC_VER >= 1000
00011
00012 #include "ConsoleBar.h"
00013 #include "CvsStatusBar.h"
00014 #include "BrowseViewModel.h"
00015 #include "ToolbarCombo.h"
00016 #include "HistComboBoxEx.h"
00017
00018 class CMainFrame : public CCJMDIFrameWnd
00019 {
00020     DECLARE_DYNAMIC(CMainFrame)
00021 public:
00022     CMainFrame();
00023 #if 0
00024 protected: // create from serialization only
00025     CMainFrame();
00026     DECLARE_DYNCREATE(CMainFrame)
00027 #endif
00028
00029 // Attributes
00030 protected:
00031      KoFilterModel m_filter;
00032      KoRecursionModel m_recursion;
00033      KoIgnoreModel m_ignore;
00034
00035 // Operations
00036 public:
00037
00038 // Overrides
00039     // ClassWizard generated virtual function overrides
00040     //{{AFX_VIRTUAL(CMainFrame)
00041     public:
00042     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00043     //}}AFX_VIRTUAL
00044
00045 // Implementation
00046 public:
00047     void DropFiles(HDROP hDropInfo);
00048     void InitialShowWindow(int nCmdShow);
00049     virtual ~CMainFrame();
00050
00051     CWinCvsBrowser *GetBrowserView();
00052     CCJShellTree *GetExplorerView();
00053     inline CCJTabCtrlBar *GetWorkspace() { return &m_wndWorkspace; }
00054     inline CMDIMenuList & GetMenuList(void) { return m_menuList; }
00055
00056     inline CWincvsView *GetConsoleView() { return m_consolebar.m_view; }
00057     inline CHistComboBoxEx & GetBrowseHistory(void) { return m_browseHist; }
00058     inline CStatusBar *GetStatusBar() { return &m_wndStatusBar; }
00059
00060     BOOL OnBroadcastCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
00061         // take care about the cmd msg routing on the dock bars
00062
00063     char *GetEnvMainThread(const char *name);
00064
00065     // KiFilterModel implementation
00066     KiFilterModel* GetFilterModel()
00067     {
00068         return &m_filter;
00069     }
00070
00071     // KiRecursionModel implementation
00072     KiRecursionModel* GetRecursionModel()
00073     {
00074         return &m_recursion;
00075     }
00076
00077     // KiRecursionModel implementation
00078     KiIgnoreModel* GetIgnoreModel()
00079     {
00080         return &m_ignore;
00081     }
00082
00083     void OnFilterMaskEntered();
00084
00085     void ChangeLocation();
00086
00087 #ifdef _DEBUG
00088     virtual void AssertValid() const;
00089     virtual void Dump(CDumpContext& dc) const;
00090 #endif
00091
00092 protected:  // control bar embedded members
00093     CCvsStatusBar  m_wndStatusBar;
00094     CToolBar    m_wndToolBar;
00095     CToolBar    m_wndBrowser;
00096     CToolBar    m_wndMultiUser;
00097     CToolBar    m_wndTags;
00098     CToolBar    m_wndList;
00099     CToolBar    m_wndFilter;
00100     CHistComboBoxEx m_browseHist;
00101     CToolbarCombo m_comboFilterMask;
00102     CFont       m_fontNormal;
00103     CBarConsole m_consolebar;
00104     CCJTabCtrlBar   m_wndWorkspace;
00105     CImageList  m_TabImages;
00106     CCJWindowPlacement  m_state;
00107
00108     BOOL InitializeDockingWindows();
00109
00110 // Generated message map functions
00111 protected:
00112     afx_msg void OnInitMenu(CMenu* pMenu);
00113     void DockControlBarLeftOf(CToolBar* Bar,CToolBar* LeftOf);
00114     bool FreshenFileMask();
00115
00116     //{{AFX_MSG(CMainFrame)
00117     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00118     afx_msg void OnClose();
00119     afx_msg void OnDropFiles(HDROP hDropInfo);
00120     afx_msg void OnHistorySelect();
00121     afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
00122     afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
00123     afx_msg void OnViewRecursive();
00124     afx_msg void OnViewModified();
00125     afx_msg void OnUpdateViewModified(CCmdUI* pCmdUI);
00126     afx_msg void OnUpdateViewRecursive(CCmdUI* pCmdUI);
00127     afx_msg void OnViewConflict();
00128     afx_msg void OnUpdateViewConflict(CCmdUI* pCmdUI);
00129     afx_msg void OnViewUnknown();
00130     afx_msg void OnUpdateViewUnknown(CCmdUI* pCmdUI);
00131     afx_msg void OnViewMissing();
00132     afx_msg void OnUpdateViewMissing(CCmdUI* pCmdUI);
00133     afx_msg void OnViewIgnore();
00134     afx_msg void OnUpdateViewIgnore(CCmdUI* pCmdUI);
00135     afx_msg void OnUpdateFilterMask(CCmdUI* pCmdUI);
00136     afx_msg void OnUpdateHistory(CCmdUI* pCmdUI);
00137     afx_msg void OnViewAdded();
00138     afx_msg void OnUpdateViewAdded(CCmdUI* pCmdUI);
00139     afx_msg void OnUpdateViewRemoved(CCmdUI* pCmdUI);
00140     afx_msg void OnViewRemoved();
00141     afx_msg void OnViewChanged();
00142     afx_msg void OnUpdateViewChanged(CCmdUI* pCmdUI);
00143     afx_msg void OnViewHideunknown();
00144     afx_msg void OnUpdateViewHideunknown(CCmdUI* pCmdUI);
00145     afx_msg void OnTimer(UINT nIDEvent);
00146     //}}AFX_MSG
00147     DECLARE_MESSAGE_MAP()
00148 private:
00149     BOOL m_bRestoreFocus;
00150 };
00151
00153
00154 //{{AFX_INSERT_LOCATION}}
00155 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00156
00157 #endif // !defined(AFX_MAINFRM_H__D2D77DCC_8299_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/ndir.c Source File

WinCvs/ndir.c

Go to the documentation of this file.
00001 /*  msd_dir.c - portable directory routines
00002     Copyright (C) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
00003
00004     This program is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation; either version 1, or (at your option)
00007     any later version.
00008
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU General Public License for more details.  */
00013
00014 /* Everything non trivial in this code is from: @(#)msd_dir.c 1.4
00015    87/11/06.  A public domain implementation of BSD directory routines
00016    for MS-DOS.  Written by Michael Rendell ({uunet,utai}michael@garfield),
00017    August 1897 */
00018
00019 /*
00020  * Modified for WinCvs : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00021  */
00022
00023
00024 #include <io.h>
00025 #include <stdio.h>
00026 #include <stdlib.h>
00027 #include <string.h>
00028 #include <sys/types.h>
00029 #include <sys/stat.h>
00030
00031 #include <dos.h>
00032
00033 #include <ndir.h>
00034
00035 static void free_dircontents (struct _dircontents *);
00036
00037 /* find ALL files! */
00038 #define ATTRIBUTES  (_A_RDONLY | _A_HIDDEN | _A_SYSTEM | _A_SUBDIR)
00039
00040
00041
00042 DIR *
00043 opendir (const char *name)
00044 {
00045   struct _finddata_t find_buf;
00046   DIR *dirp;
00047   struct _dircontents *dp;
00048   char name_buf[_MAX_PATH + 1];
00049   char *slash = "";
00050   long hFile;
00051
00052   if (!name)
00053     name = "";
00054   else if (*name)
00055     {
00056       const char *s;
00057       int l = strlen (name);
00058
00059       s = name + l - 1;
00060       if ( !(l == 2 && *s == ':') && *s != '\\' && *s != '/')
00061     slash = "/";    /* save to insert slash between path and "*.*" */
00062     }
00063
00064   strcat (strcat (strcpy (name_buf, name), slash), "*.*");
00065
00066   dirp = (DIR *) malloc (sizeof (DIR));
00067   if (dirp == (DIR *)0)
00068     return (DIR *)0;
00069
00070   dirp->dd_loc = 0;
00071   dirp->dd_contents = dirp->dd_cp = (struct _dircontents *) 0;
00072
00073   if ((hFile = _findfirst (name_buf, &find_buf)) < 0)
00074     {
00075       free (dirp);
00076       return (DIR *)0;
00077     }
00078
00079   do
00080     {
00081       dp = (struct _dircontents *) malloc (sizeof (struct _dircontents));
00082       if (dp == (struct _dircontents *)0)
00083     {
00084       free_dircontents (dirp->dd_contents);
00085       return (DIR *)0;
00086     }
00087
00088       dp->_d_entry = malloc (strlen (find_buf.name) + 1);
00089       if (dp->_d_entry == (char *)0)
00090     {
00091       free (dp);
00092       free_dircontents (dirp->dd_contents);
00093       return (DIR *)0;
00094     }
00095
00096       if (dirp->dd_contents)
00097     dirp->dd_cp = dirp->dd_cp->_d_next = dp;
00098       else
00099     dirp->dd_contents = dirp->dd_cp = dp;
00100
00101       strcpy (dp->_d_entry, find_buf.name);
00102
00103       dp->_d_next = (struct _dircontents *)0;
00104
00105     } while (!_findnext (hFile, &find_buf));
00106
00107   dirp->dd_cp = dirp->dd_contents;
00108
00109   _findclose(hFile);
00110
00111   return dirp;
00112 }
00113
00114
00115 void
00116 closedir (DIR *dirp)
00117 {
00118   free_dircontents (dirp->dd_contents);
00119   free ((char *) dirp);
00120 }
00121
00122
00123 struct direct *
00124 readdir (DIR *dirp)
00125 {
00126   static struct direct dp;
00127
00128   if (dirp->dd_cp == (struct _dircontents *)0)
00129     return (struct direct *)0;
00130   dp.d_namlen = dp.d_reclen =
00131     strlen (strcpy (dp.d_name, dirp->dd_cp->_d_entry));
00132 #if 0 /* JB */
00133   strlwr (dp.d_name);       /* JF */
00134 #endif
00135   dp.d_ino = 0;
00136   dirp->dd_cp = dirp->dd_cp->_d_next;
00137   dirp->dd_loc++;
00138
00139   return &dp;
00140 }
00141
00142
00143 void
00144 seekdir (DIR *dirp, long off)
00145 {
00146   long i = off;
00147   struct _dircontents *dp;
00148
00149   if (off < 0)
00150     return;
00151   for (dp = dirp->dd_contents; --i >= 0 && dp; dp = dp->_d_next)
00152     ;
00153   dirp->dd_loc = off - (i + 1);
00154   dirp->dd_cp = dp;
00155 }
00156
00157
00158 long
00159 telldir (DIR *dirp)
00160 {
00161   return dirp->dd_loc;
00162 }
00163
00164
00165 /* Garbage collection */
00166
00167 static void
00168 free_dircontents (struct _dircontents *dp)
00169 {
00170   struct _dircontents *odp;
00171
00172   while (dp)
00173     {
00174       if (dp->_d_entry)
00175     free (dp->_d_entry);
00176       dp = (odp = dp)->_d_next;
00177       free (odp);
00178     }
00179 }
00180
00181
00182 #ifdef TEST
00183
00184 void main (int argc, char *argv[]);
00185
00186 void
00187 main (int argc, char *argv[])
00188 {
00189   static DIR *directory;
00190   struct direct *entry = (struct direct *)0;
00191
00192   char *name = "";
00193
00194   if (argc > 1)
00195     name = argv[1];
00196
00197   directory = opendir (name);
00198
00199   if (!directory)
00200     {
00201       fprintf (stderr, "can't open directory `%s'.\n", name);
00202       exit (2);
00203     }
00204
00205   while (entry = readdir (directory))
00206     printf ("> %s\n", entry->d_name);
00207
00208   printf ("done.\n");
00209 }
00210
00211 #endif /* TEST */
00212
00213 /*
00214  * Local Variables:
00215  * mode:C
00216  * ChangeLog:ChangeLog
00217  * compile-command:make
00218  * End:
00219  */
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/ndir.h Source File

WinCvs/ndir.h

Go to the documentation of this file.
00001 /*  ndir.c - portable directory routines
00002     Copyright (C) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
00003
00004     This program is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation; either version 1, or (at your option)
00007     any later version.
00008
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU General Public License for more details.  */
00013
00014 /* Everything non trivial in this code is taken from: @(#)msd_dir.c 1.4
00015    87/11/06.  A public domain implementation of BSD directory routines
00016    for MS-DOS.  Written by Michael Rendell ({uunet,utai}michael@garfield),
00017    August 1897 */
00018
00019 /*
00020  * Modified for WinCvs : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00021  */
00022
00023 #if _MSC_VER > 1000
00024 #pragma once
00025 #endif
00026
00027 #ifndef _NDIR_H
00028 #define _NDIR_H
00029
00030 #include <sys/types.h>  /* ino_t definition */
00031
00032 #define rewinddir(dirp) seekdir(dirp, 0L)
00033
00034 /* 255 is said to be big enough for Windows NT.  The more elegant
00035    solution would be declaring d_name as one byte long and allocating
00036    it to the actual size needed.  */
00037 #define MAXNAMLEN   255
00038
00039 struct direct
00040 {
00041   ino_t d_ino;          /* a bit of a farce */
00042   int d_reclen;         /* more farce */
00043   int d_namlen;         /* length of d_name */
00044   char d_name[MAXNAMLEN + 1];   /* garentee null termination */
00045 };
00046
00047 struct _dircontents
00048 {
00049   char *_d_entry;
00050   struct _dircontents *_d_next;
00051 };
00052
00053 typedef struct _dirdesc
00054 {
00055   int dd_id;            /* uniquely identify each open directory */
00056   long dd_loc;          /* where we are in directory entry is this */
00057   struct _dircontents *dd_contents; /* pointer to contents of dir */
00058   struct _dircontents *dd_cp;   /* pointer to current position */
00059 } DIR;
00060
00061 #ifdef __cplusplus
00062 extern "C" {
00063 #endif /* __cplusplus */
00064
00065 extern void seekdir (DIR *, long);
00066 extern long telldir (DIR *);
00067 extern DIR *opendir (const char *);
00068 extern void closedir (DIR *);
00069 extern struct direct *readdir (DIR *);
00070
00071 #ifdef __cplusplus
00072 }
00073 #endif /* __cplusplus */
00074
00075
00076 /*
00077  * Local Variables:
00078  * mode:C
00079  * ChangeLog:ChangeLog
00080  * compile-command:make
00081  * End:
00082  */
00083 #endif /* _NDIR_H */
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/NoPython.cpp Source File

WinCvs/NoPython.cpp

Go to the documentation of this file.
00001 // NoPython.cpp : implementation file
00002 //
00003
00004 #include "stdafx.h"
00005 #include "wincvs.h"
00006 #include "NoPython.h"
00007 #include "Persistent.h"
00008 #include "Splash.h"
00009
00010 #ifdef _DEBUG
00011 #define new DEBUG_NEW
00012 #undef THIS_FILE
00013 static char THIS_FILE[] = __FILE__;
00014 #endif
00015
00016 static CPersistentBool gWarnPython("P_WarnPython", true);
00017
00019 // CNoPython dialog
00020
00021
00022 CNoPython::CNoPython(CWnd* pParent /*=NULL*/)
00023     : CDialog(CNoPython::IDD, pParent)
00024 {
00025     //{{AFX_DATA_INIT(CNoPython)
00026     m_remind = TRUE;
00027     //}}AFX_DATA_INIT
00028 }
00029
00030
00031 void CNoPython::DoDataExchange(CDataExchange* pDX)
00032 {
00033     CDialog::DoDataExchange(pDX);
00034     //{{AFX_DATA_MAP(CNoPython)
00035     DDX_Control(pDX, IDC_PYTHONURL, m_url);
00036     DDX_Check(pDX, IDC_REMIND, m_remind);
00037     //}}AFX_DATA_MAP
00038 }
00039
00040
00041 BEGIN_MESSAGE_MAP(CNoPython, CDialog)
00042     //{{AFX_MSG_MAP(CNoPython)
00043     //}}AFX_MSG_MAP
00044 END_MESSAGE_MAP()
00045
00047 // CNoPython message handlers
00048
00049 BOOL CNoPython::OnInitDialog()
00050 {
00051     CDialog::OnInitDialog();
00052
00053     m_url.SetURL(_T("http://www.python.org"));
00054
00055     return TRUE;  // return TRUE unless you set the focus to a control
00056                   // EXCEPTION: OCX Property Pages should return FALSE
00057 }
00058
00059 void WarnNoPython(void)
00060 {
00061     if((bool)gWarnPython)
00062     {
00063         // because it conflicts
00064         CSplashWnd::CloseSplashScreen();
00065
00066         CNoPython dlg;
00067         dlg.DoModal();
00068         if(!dlg.m_remind)
00069             gWarnPython = false;
00070     }
00071 }
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/NoPython.h Source File

WinCvs/NoPython.h

Go to the documentation of this file.
00001 #if !defined(AFX_NOPYTHON_H__F675DE42_0FA7_4785_8946_E8FC861BBA57__INCLUDED_)
00002 #define AFX_NOPYTHON_H__F675DE42_0FA7_4785_8946_E8FC861BBA57__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007 // NoPython.h : header file
00008 //
00009
00010 void WarnNoPython(void);
00011
00013 // CNoPython dialog
00014
00015 class CNoPython : public CDialog
00016 {
00017 // Construction
00018 public:
00019     CNoPython(CWnd* pParent = NULL);   // standard constructor
00020
00021 // Dialog Data
00022     //{{AFX_DATA(CNoPython)
00023     enum { IDD = IDD_NOPYTHON };
00024     CCJHyperLink m_url;
00025     BOOL    m_remind;
00026     //}}AFX_DATA
00027
00028
00029 // Overrides
00030     // ClassWizard generated virtual function overrides
00031     //{{AFX_VIRTUAL(CNoPython)
00032     protected:
00033     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00034     //}}AFX_VIRTUAL
00035
00036 // Implementation
00037 protected:
00038
00039     // Generated message map functions
00040     //{{AFX_MSG(CNoPython)
00041     virtual BOOL OnInitDialog();
00042     //}}AFX_MSG
00043     DECLARE_MESSAGE_MAP()
00044 };
00045
00046 //{{AFX_INSERT_LOCATION}}
00047 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00048
00049 #endif // !defined(AFX_NOPYTHON_H__F675DE42_0FA7_4785_8946_E8FC861BBA57__INCLUDED_)
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/ProgressDialog.cpp Source File

WinCvs/ProgressDialog.cpp

Go to the documentation of this file.
00001 // ProgressDialog.cpp : implementation file
00002 //
00003
00004 #include "stdafx.h"
00005 #include "wincvs.h"
00006 #include "ProgressDialog.h"
00007
00008 #ifdef _DEBUG
00009 #define new DEBUG_NEW
00010 #undef THIS_FILE
00011 static char THIS_FILE[] = __FILE__;
00012 #endif
00013
00015 // CProgressDialog dialog
00016
00017
00018 CProgressDialog::CProgressDialog(bool & abort, bool interruptable, CWnd* pParent /*=NULL*/)
00019     : m_abort(abort), m_stopable(interruptable), m_pParent(pParent), hWndParent(0L),
00020     CDialog(CProgressDialog::IDD, pParent)
00021 {
00022     //{{AFX_DATA_INIT(CProgressDialog)
00023         // NOTE: the ClassWizard will add member initialization here
00024     //}}AFX_DATA_INIT
00025 }
00026
00027
00028 void CProgressDialog::DoDataExchange(CDataExchange* pDX)
00029 {
00030     CDialog::DoDataExchange(pDX);
00031     //{{AFX_DATA_MAP(CProgressDialog)
00032     DDX_Control(pDX, IDC_PROGRESS, m_progress);
00033     //}}AFX_DATA_MAP
00034 }
00035
00036
00037 BEGIN_MESSAGE_MAP(CProgressDialog, CDialog)
00038     //{{AFX_MSG_MAP(CProgressDialog)
00039     //}}AFX_MSG_MAP
00040 END_MESSAGE_MAP()
00041
00043 // CProgressDialog message handlers
00044
00045 void CProgressDialog::PostNcDestroy()
00046 {
00047     MSG msg;
00048     if (hWndParent != NULL && ::GetActiveWindow() == m_hWnd)
00049         ::SetActiveWindow(hWndParent);
00050     PostModal();
00051     while (PeekMessage(&msg, m_hWnd, 0, 0, PM_NOREMOVE) == TRUE)
00052         AfxGetApp()->PumpMessage();
00053     delete this;
00054 }
00055
00056 void CProgressDialog::OnOK()
00057 {
00058     m_abort = true;
00059     DestroyWindow();
00060 }
00061
00062 BOOL CProgressDialog::OnInitDialog()
00063 {
00064     CenterWindow();
00065
00066     CDialog::OnInitDialog();
00067
00068     CWnd *wnd = GetDlgItem(IDOK);
00069     if(wnd != 0L && !m_stopable)
00070     {
00071         wnd->EnableWindow(FALSE);
00072     }
00073     ShowWindow(SW_SHOW);
00074
00075     return TRUE;  // return TRUE unless you set the focus to a control
00076 }
00077
00078 BOOL CProgressDialog::Create()
00079 {
00080     hWndParent = PreModal();
00081     return CDialog::Create(CProgressDialog::IDD, m_pParent);
00082 }
00083
00084 static void flushDisplay(CDialog *dlg, bool & abort)
00085 {
00086     MSG msg;
00087     while (PeekMessage(&msg, NULL, WM_PAINT, WM_PAINT, PM_NOREMOVE) == TRUE)
00088         AfxGetApp()->PumpMessage();
00089     while (PeekMessage(&msg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_NOREMOVE) == TRUE)
00090     {
00091         CPoint pt(LOWORD(msg.lParam), HIWORD(msg.lParam));
00092         ClientToScreen(msg.hwnd, &pt);
00093         CWnd *hwnd = CWnd::WindowFromPoint(pt);
00094         if(!abort && (*hwnd == *dlg || dlg->IsChild(hwnd)))
00095             AfxGetApp()->PumpMessage();
00096         else
00097             PeekMessage(&msg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE);
00098     }
00099 }
00100
00101 CProgress::CProgress(bool interruptable, const char *title) : m_dlg(0L), m_abort(false)
00102 {
00103     m_dlg = new CProgressDialog(m_abort, interruptable);
00104     if (!m_dlg->Create())
00105     {
00106         TRACE0("Failed to create DlgBar\n");
00107         delete m_dlg;
00108         m_dlg = 0L;
00109         return;      // fail to create
00110     }
00111     if(title != 0L)
00112         m_dlg->SetWindowText(title);
00113     ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
00114 }
00115
00116 CProgress::~CProgress()
00117 {
00118     if(m_dlg != 0L)
00119         m_dlg->DestroyWindow();
00120 }
00121
00122 void CProgress::SetProgress(int percent)
00123 {
00124     if(m_dlg == 0L)
00125         return;
00126
00127     m_dlg->m_progress.SetPos(percent);
00128     flushDisplay(m_dlg, m_abort);
00129     ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
00130     if(m_abort)
00131         m_dlg = 0L;
00132 }
00133
00134 void CProgress::DoAbort(void)
00135 {
00136     if(m_dlg != 0L)
00137         m_dlg->DestroyWindow();
00138     m_dlg = 0L;
00139 }
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/ProgressDialog.h Source File

WinCvs/ProgressDialog.h

Go to the documentation of this file.
00001 #if !defined(AFX_PROGRESSDIALOG_H__09D80542_6467_11D3_85F5_00609419FCC1__INCLUDED_)
00002 #define AFX_PROGRESSDIALOG_H__09D80542_6467_11D3_85F5_00609419FCC1__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007 // ProgressDialog.h : header file
00008 //
00009
00010 class CProgressDialog;
00011
00012 // the real thing to use
00013 class CProgress
00014 {
00015 public:
00016     CProgress(bool interruptable, const char *title = 0L);
00017     ~CProgress();
00018
00019     inline bool HasAborted(void) const { return m_abort; }
00020     void SetProgress(int percent);
00021     void DoAbort(void);
00022
00023 protected:
00024     CProgressDialog *m_dlg;
00025     bool m_abort;
00026 };
00027
00029 // CProgressDialog dialog
00030
00031 class CProgressDialog : public CDialog
00032 {
00033 // Construction
00034 public:
00035     CProgressDialog(bool & abort, bool interruptable, CWnd* pParent = NULL);   // standard constructor
00036     BOOL Create();
00037
00038 // Dialog Data
00039     //{{AFX_DATA(CProgressDialog)
00040     enum { IDD = IDD_PROGRESS };
00041     CProgressCtrl   m_progress;
00042     //}}AFX_DATA
00043
00044 // Overrides
00045     // ClassWizard generated virtual function overrides
00046     //{{AFX_VIRTUAL(CProgressDialog)
00047     protected:
00048     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00049     virtual void PostNcDestroy();
00050     //}}AFX_VIRTUAL
00051
00052 // Implementation
00053 protected:
00054     virtual void OnOK();
00055
00056     CWnd* m_pParent;
00057     bool & m_abort;
00058     bool m_stopable;
00059     HWND hWndParent;
00060
00061     // Generated message map functions
00062     //{{AFX_MSG(CProgressDialog)
00063     virtual BOOL OnInitDialog();
00064     //}}AFX_MSG
00065     DECLARE_MESSAGE_MAP()
00066 };
00067
00068 //{{AFX_INSERT_LOCATION}}
00069 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00070
00071 #endif // !defined(AFX_PROGRESSDIALOG_H__09D80542_6467_11D3_85F5_00609419FCC1__INCLUDED_)
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/resource.h Source File

WinCvs/resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by wincvs.rc
00004 //
00005 #define IDR_CNTR_INPLACE                6
00006 #define IDD_ABOUTBOX                    100
00007 #define IDP_OLE_INIT_FAILED             100
00008 #define IDP_FAILED_TO_CREATE            102
00009 #define IDB_LIGHTBULB                   103
00010 #define IDP_SOCKETS_INIT_FAILED         104
00011 #define IDD_TIP                         105
00012 #define CG_IDS_TIPOFTHEDAY              106
00013 #define CG_IDS_TIPOFTHEDAYMENU          107
00014 #define CG_IDS_DIDYOUKNOW               108
00015 #define CG_IDS_FILE_ABSENT              109
00016 #define CG_IDP_FILE_CORRUPT             110
00017 #define CG_IDS_TIPOFTHEDAYHELP          111
00018 #define IDB_SPLASH                      112
00019 #define IDR_CVS_COWORKER                113
00020 #define IDR_CVSCOWORKER                 114
00021 #define IDR_CVSGETOPTION                115
00022 #define IDR_MAINFRAME                   128
00023 #define IDR_WINCVSTYPE                  129
00024 #define IDS_DEFFONT                     129
00025 #define IDR_BROWSER                     129
00026 #define IDD_PREFERENCES                 130
00027 #define IDD_PASSWRD                     132
00028 #define IDD_CMDLINE                     133
00029 #define IDD_ALERT                       134
00030 #define IDD_PREFS_CVSROOT               135
00031 #define IDD_PREFS_GLOBALS               136
00032 #define IDD_CHECKOUT_MAIN               137
00033 #define IDD_COMMIT_MAIN                 138
00034 #define IDD_IMPORT_MAIN                 139
00035 #define IDD_IMPORT_OPTIONS              140
00036 #define IDD_CMDLINE_MAIN                142
00037 #define IDD_IMPORTFILTER                143
00038 #define IDI_CVSWARNING                  144
00039 #define IDI_CVSERROR                    145
00040 #define IDD_WARNINGDESC                 145
00041 #define IDD_ENTRYDESC                   146
00042 #define IDD_UPDATE_MAIN                 147
00043 #define IDD_UPDATE_STICKY               148
00044 #define IDD_UPDATE_MERGE                149
00045 #define IDI_FOLDER                      149
00046 #define IDD_LOG_MAIN                    150
00047 #define IDI_FOLDERO                     150
00048 #define IDI_FOLDERCVS                   151
00049 #define IDD_LOG_FILTERS                 152
00050 #define IDI_FOLDEROCVS                  152
00051 #define IDB_SMALLICONS                  152
00052 #define IDD_DIFF_OPTIONS                153
00053 #define IDD_DIFF_MAIN                   154
00054 #define IDD_CHECKOUT_OPTIONS            155
00055 #define IDD_PREFS_WINCVS                156
00056 #define IDR_FILELIST                    157
00057 #define IDD_YESNO                       157
00058 #define IDR_MULTIUSER                   158
00059 #define IDR_GRAPH                       161
00060 #define IDI_FOLDERIGN                   162
00061 #define IDI_FOLDEROIGN                  163
00062 #define IDR_STATEICONS                  164
00063 #define IDI_FOLDERLOST                  164
00064 #define IDR_TAGS                        165
00065 #define IDD_INIT_MAIN                   165
00066 #define IDR_WORKSPACE                   173
00067 #define IDB_LOCATE                      176
00068 #define IDD_PROGRESS                    177
00069 #define IDR_MENUICONS                   178
00070 #define IDB_ABOUT                       180
00071 #define IDD_CUSTOMIZE                   181
00072 #define IDR_CUSTMENUS                   182
00073 #define IDB_PYTHON                      183
00074 #define IDD_SAVESETTINGS                184
00075 #define IDB_IDLE                        185
00076 #define IDD_RELEASE                     185
00077 #define IDR_FILTER                      186
00078 #define IDD_COMMIT_OPTIONS              186
00079 #define IDB_HISTLOC                     187
00080 #define IDD_RSH                         188
00081 #define IDD_PSERVER                     189
00082 #define IDD_SSH                         190
00083 #define IDD_PREFS_CVSCMD_DIALOGS        191
00084 #define IDD_ANNOTATE_MAIN               192
00085 #define IDD_GRAPH_OPTIONS               193
00086 #define IDD_PROMPTMESSAGE               194
00087 #define IDD_EDITMESSAGE                 195
00088 #define IDD_ADMINOPTION                 196
00089 #define IDD_EDITORMON                   197
00090 #define IDD_NOPYTHON                    198
00091 #define IDD_TAG_MAIN                    199
00092 #define IDD_RTAG_MAIN                   200
00093 #define IDD_RTAG_OPTIONS                201
00094 #define IDD_GSERVER                     202
00095 #define IDC_CVSROOT                     1000
00096 #define IDC_BULB                        1000
00097 #define IDC_CHECKOUTRO                  1001
00098 #define IDC_STARTUP                     1001
00099 #define IDC_TCPIP                       1002
00100 #define IDC_NEXTTIP                     1002
00101 #define IDC_PRUNE                       1003
00102 #define IDC_RHOSTS                      1004
00103 #define IDC_DIRTYSUPPORT                1004
00104 #define IDC_TIPSTRING                   1004
00105 #define IDC_PSERVER                     1005
00106 #define IDC_CHECKUNIXLF                 1005
00107 #define IDC_KSERVER                     1006
00108 #define IDC_QUIET                       1007
00109 #define IDC_CTNLADD                     1008
00110 #define IDC_PROMPTEDIT                  1009
00111 #define IDC_ALWAYSROOT                  1009
00112 #define IDC_PASSWD                      1010
00113 #define IDC_LOGOUT                      1010
00114 #define IDC_CMDLINE                     1011
00115 #define IDC_SELFOLDER                   1012
00116 #define IDC_FOLDERLOC                   1013
00117 #define IDC_BTNPATH2                    1014
00118 #define IDC_ALERTCAPTION                1015
00119 #define IDC_ALRTMSG                     1016
00120 #define IDC_CVSVERS                     1017
00121 #define IDC_AUTHEN                      1018
00122 #define IDC_STDOUT                      1019
00123 #define IDC_MODNAME                     1020
00124 #define IDC_BTNPATH                     1021
00125 #define IDC_TAGNAME                     1021
00126 #define IDC_NORECURS                    1022
00127 #define IDC_PATH                        1023
00128 #define IDC_FORCE                       1023
00129 #define IDC_LOGMSG                      1024
00130 #define IDC_OVERWRITE                   1024
00131 #define IDC_SPECIFY_REV                 1024
00132 #define IDC_DELSTICKY                   1025
00133 #define IDC_LOGMSG_WRAP                 1025
00134 #define IDC_VTAG                        1026
00135 #define IDC_CREATEMISSDIR               1026
00136 #define IDC_RHOSTPORT                   1027
00137 #define IDC_CLEANCOPY                   1027
00138 #define IDC_CHECKRHOSTPORT              1028
00139 #define IDC_CHECKPSERVERPORT            1029
00140 #define IDC_PSERVERPORT                 1030
00141 #define IDC_CHECKKSERVERPORT            1031
00142 #define IDC_KSERVERPORT                 1032
00143 #define IDC_CHECKSERVERNAME             1033
00144 #define IDC_SERVERNAME                  1034
00145 #define IDC_COMBOROOT                   1035
00146 #define IDC_CHECKRSHNAME                1035
00147 #define IDC_LISTENTRIES                 1036
00148 #define IDC_SERVERNAME2                 1036
00149 #define IDC_RSHNAME                     1036
00150 #define IDC_COMBORSAIDENTITY            1036
00151 #define IDC_EDITENTRY                   1037
00152 #define IDC_WARNINGDESC                 1038
00153 #define IDC_ENTRYSTATE                  1039
00154 #define IDC_DATE                        1040
00155 #define IDC_ENTRYSTATE3                 1041
00156 #define IDC_ENTRYSTATE4                 1042
00157 #define IDC_COMBOREV                    1043
00158 #define IDC_ENTRYSTATE5                 1043
00159 #define IDC_REV                         1044
00160 #define IDC_COMBODATE1                  1044
00161 #define IDC_MERGE2                      1045
00162 #define IDC_COMBOSTATE                  1046
00163 #define IDC_COMBODATE2                  1046
00164 #define IDC_COMBOREV2                   1047
00165 #define IDC_MERGE                       1048
00166 #define IDC_USER                        1049
00167 #define IDC_COMBO2                      1049
00168 #define IDC_NOTAGS                      1050
00169 #define IDC_NOUSERS                     1051
00170 #define IDC_RTAG                        1052
00171 #define IDC_CHECKPATH                   1053
00172 #define IDC_BTNHOME                     1054
00173 #define IDC_HOME                        1055
00174 #define IDC_ENTRYSTATE2                 1056
00175 #define IDC_COMBODATE                   1057
00176 #define IDC_ENTRYSTATE6                 1057
00177 #define IDC_MATCH                       1058
00178 #define IDC_MERGE1                      1059
00179 #define IDC_COMBOUSER                   1060
00180 #define IDC_DEFBRANCH                   1061
00181 #define IDC_STATE                       1062
00182 #define IDC_ONLYRCS                     1063
00183 #define IDC_CHECK1                      1064
00184 #define IDC_CHECK2                      1065
00185 #define IDC_DIFF1                       1066
00186 #define IDC_DIFF2                       1067
00187 #define IDC_DIFF3                       1068
00188 #define IDC_COMBO1                      1069
00189 #define IDC_BTNPROGRAM                  1070
00190 #define IDC_COMBORTAG                   1070
00191 #define IDC_PROGRAM                     1071
00192 #define IDC_BAR_TREE                    1072
00193 #define IDC_ATTIC                       1075
00194 #define IDC_EXTDIFF                     1076
00195 #define IDC_EXTDIFFSEL                  1077
00196 #define IDC_DIFFPROG                    1078
00197 #define IDC_CHECKUNMOD                  1079
00198 #define IDC_EDIT_POSITION               1079
00199 #define IDC_ALTCVSCHK                   1079
00200 #define IDC_ALTCVSPROG                  1080
00201 #define IDC_COMBO                       1081
00202 #define IDC_ALTCVSSEL                   1081
00203 #define IDC_WINCVSVER                   1082
00204 #define IDC_SPINLOGOUT                  1083
00205 #define IDC_EDITLOGOUT                  1084
00206 #define IDC_CHECKPROXY                  1085
00207 #define IDC_EDITHOST                    1086
00208 #define IDC_EDITPORT                    1087
00209 #define IDC_FORCEROOT                   1088
00210 #define IDC_EXPORT                      1089
00211 #define IDC_HELPINIT                    1090
00212 #define IDC_LOCATE                      1091
00213 #define IDC_PROGRESS                    1093
00214 #define IDC_ZLEVEL                      1095
00215 #define IDC_ZSPIN                       1096
00216 #define IDC_RSAIDENTITYSEL              1097
00217 #define IDC_WINCVSURL                   1097
00218 #define IDC_RSAIDENTITY                 1098
00219 #define IDC_ALLCMDS                     1098
00220 #define IDC_CMDMENU                     1099
00221 #define IDC_ADD                         1101
00222 #define IDC_REMOVE                      1102
00223 #define IDC_UP                          1103
00224 #define IDC_DOWN                        1104
00225 #define IDC_MENULIST                    1106
00226 #define IDC_LAUNCHEDITOR                1109
00227 #define IDC_WORDWRAP                    1110
00228 #define IDC_TEMPLATE                    1111
00229 #define IDC_DELETED                     1113
00230 #define IDC_IGNOREWHITESPACE            1118
00231 #define IDC_IGNORECASE                  1119
00232 #define IDC_DIRECTORY                   1120
00233 #define IDC_EDIT_CHECKOUTDIR            1121
00234 #define IDC_CHECK_OVERRIDECHECKOUTDIR   1122
00235 #define IDC_USE_VIEWER_ALWAYS           1125
00236 #define IDC_USEDEFIGNORE                1127
00237 #define IDC_FORCECOMMIT                 1128
00238 #define IDC_USEFILESTIME                1128
00239 #define IDC_FORCERECURSE                1129
00240 #define IDC_FORCEREVISION               1130
00241 #define IDC_NOMODULEPROGRAM             1131
00242 #define IDC_COMBOVTAG                   1132
00243 #define IDC_CHECKVALIDEDITS             1132
00244 #define IDC_COMBOMODNAME                1133
00245 #define IDC_HOST                        1135
00246 #define IDC_LOGIN                       1136
00247 #define IDC_SETTINGS                    1137
00248 #define IDC_AUTHENDESC                  1138
00249 #define IDC_CHECKUPDATE                 1139
00250 #define IDC_CHECKDIFF                   1140
00251 #define IDC_CHECKGRAPH                  1141
00252 #define IDC_CHECKLOG                    1142
00253 #define IDC_RADIOSHIFT                  1143
00254 #define IDC_RADIOCONTROL                1144
00255 #define IDC_CONSOLE                     1144
00256 #define IDC_ISDATE                      1145
00257 #define IDC_CHECKANNOTATE               1145
00258 #define IDC_COMBO_REV                   1146
00259 #define IDC_DIFF                        1147
00260 #define IDC_FILETODIFF                  1148
00261 #define IDC_APPLY                       1149
00262 #define IDC_RESET                       1150
00263 #define IDC_HEADER                      1152
00264 #define IDC_TAG                         1153
00265 #define IDC_RGBHEADER                   1154
00266 #define IDC_RGBTAG                      1155
00267 #define IDC_RGBBRANCH                   1156
00268 #define IDC_RGBNODE                     1157
00269 #define IDC_RGBDEAD                     1158
00270 #define IDC_RGBSTATE                    1159
00271 #define IDC_BRANCH                      1160
00272 #define IDC_NODE                        1161
00273 #define IDC_SELECTION                   1162
00274 #define IDC_SHADOW                      1163
00275 #define IDC_DEAD                        1164
00276 #define IDC_RGBSELECTION                1165
00277 #define IDC_RGBSHADOW                   1166
00278 #define IDC_OPTIONSTRING                1167
00279 #define IDC_OPTIONDESC                  1168
00280 #define IDC_OPTIONSTRING_SL             1169
00281 #define IDC_TEMPFILE                    1170
00282 #define IDC_REMIND                      1171
00283 #define IDC_PYTHONURL                   1172
00284 #define IDC_PREVIEWINFO                 1173
00285 #define IDC_PREVCMD                     1175
00286 #define IDC_CHECKDATE1                  1177
00287 #define IDC_CHECKDATE2                  1178
00288 #define IDC_GRPBOX_TEXT                 1179
00289 #define IDC_TAGDESC_TEXT                1180
00290 #define IDC_MODULEDESC_TEXT             1181
00291 #define ID_CANCEL_EDIT_CNTR             32768
00292 #define ID_APP_PREFERENCES              32775
00293 #define ID_APP_CMDLINE                  32776
00294 #define ID_APP_LOGIN                    32779
00295 #define ID_STOPCVS                      32795
00296 #define ID_BROWSER_OPEN                 32797
00297 #define ID_VIEW_BROWSER_BAR             32798
00298 #define ID_UPDATEBF                     32799
00299 #define ID_COMMITBF                     32800
00300 #define ID_ADDBF                        32801
00301 #define ID_VIEW_SMALLICONS              32802
00302 #define ID_VIEW_FULLLIST                32803
00303 #define ID_VIEW_ROWDETAILS              32804
00304 #define ID_VIEW_FILES_BAR               32805
00305 #define ID_VIEW_UPDATE                  32806
00306 #define ID_VIEW_COMMIT                  32807
00307 #define ID_VIEW_ADD                     32808
00308 #define ID_VIEW_WORKSPACE               32809
00309 #define ID_MENUBAR                      32810
00310 #define ID_VIEW_ADDB                    32811
00311 #define ID_VIEW_RMV                     32812
00312 #define IDS_COMBOBROWSER                32813
00313 #define ID_VIEW_RELOAD                  32814
00314 #define ID_VIEW_UPONE                   32826
00315 #define ID_VIEW_TRASH                   32830
00316 #define ID_VIEW_DIFF                    32833
00317 #define ID_VIEW_LOG                     32834
00318 #define ID_VIEW_STATUS                  32835
00319 #define ID_VIEW_LOCKF                   32836
00320 #define ID_VIEW_UNLOCKF                 32837
00321 #define ID_VIEW_MULTI_BAR               32838
00322 #define ID_MENUITEM32840                32840
00323 #define ID_VIEW_WATCHON                 32843
00324 #define ID_VIEW_WATCHOFF                32844
00325 #define ID_VIEW_EDIT                    32845
00326 #define ID_VIEW_UNEDIT                  32846
00327 #define ID_VIEW_RELEASE                 32847
00328 #define ID_VIEW_WATCHERS                32857
00329 #define ID_VIEW_EDITORS                 32858
00330 #define ID_CUST_FILES_MENU              32859
00331 #define ID_CUST_FOLDER_MENU             32860
00332 #define ID_APP_CREDITS                  32872
00333 #define ID_APP_COPYRIGHTS               32873
00334 #define ID_GRAPH_CLOSE                  32874
00335 #define ID_VIEW_GRAPH                   32875
00336 #define ID_APP_RTAGCREATE               32881
00337 #define ID_APP_RTAGDELETE               32882
00338 #define ID_APP_RTAGBRANCH               32883
00339 #define ID_VIEW_TAG                     32884
00340 #define ID_VIEW_TAGNEW                  32886
00341 #define ID_VIEW_TAGDELETE               32887
00342 #define ID_VIEW_TAGBRANCH               32888
00343 #define ID_VIEW_TAGS_BAR                32889
00344 #define ID_VIEW_CONSOLE_BAR             32898
00345 #define ID_VIEW_EXPLORE                 32899
00346 #define ID_HISTORYBROWSE                32900
00347 #define ID_VIEW_QUERYUPDATE             32901
00348 #define ID_VIEW_IGNORE                  32902
00349 #define ID_HELP_CVS                     32903
00350 #define ID_HELP_CVSCLIENT               32904
00351 #define ID_APP_LOGOUT                   32906
00352 #define ID_VIEW_EDITSEL                 32908
00353 #define ID_VIEW_EDITSELDEF              32909
00354 #define ID_ACCEL32911                   32911
00355 #define ID_VIEWW_INIT                   32912
00356 #define ID_VIEW_IMPORT                  32913
00357 #define ID_VIEW_INIT                    32914
00358 #define ID_VIEW_CHECKOUT                32915
00359 #define ID_VIEW_DELREV                  32916
00360 #define ID_VIEW_SELNONSIG               32917
00361 #define ID_BUTTON32918                  32918
00362 #define ID_BUTTON32919                  32919
00363 #define ID_BUTTON32920                  32920
00364 #define ID_BUTTON32921                  32921
00365 #define ID_SAVESETTINGS                 32922
00366 #define ID_VIEW_RETRIEVE                32923
00367 #define ID_VIEW_RECURSIVE               32924
00368 #define ID_VIEW_FILTER_BAR              32925
00369 #define ID_VIEW_MODIFIED                32927
00370 #define ID_FILTERMASK                   32928
00371 #define ID_VIEW_CONFLICT                32929
00372 #define ID_VIEW_UNKNOWN                 32931
00373 #define ID_VIEW_MISSING                 32932
00374 #define ID_VIEW_ADDED                   32935
00375 #define ID_VIEW_REMOVED                 32936
00376 #define ID_VIEW_CHANGED                 32937
00377 #define ID_VIEW_HIDEUNKNOWN             32938
00378 #define ID_BUTTON32940                  32940
00379 #define ID_QUERY_ANNOTATE               32941
00380 #define ID_VIEW_BROWSELOCATION_REMOVEUNWANTED 32943
00381 #define ID_USE_TCLSHELL                 32944
00382 #define ID_USE_PYSHELL                  32945
00383 #define ID_GRAPH_GRAPHOPTIONS           32946
00384 #define ID_GRAPH_ADMINOPTIONS_CHANGELOGMESSAGE 32950
00385 #define ID_GRAPH_ADMINOPTIONS_SETSTATE  32951
00386 #define ID_GRAPH_ADMINOPTIONS_SETDESCRIPTION 32952
00387 #define ID_GRAPH_CHANGELOGMESSAGE       32954
00388 #define ID_GRAPH_SETSTATE               32955
00389 #define ID_GRAPH_SETDESCRIPTION         32956
00390 #define ID_VIEW_RESERVEDEDIT            32957
00391 #define ID_VIEW_FORCEEDIT               32958
00392 #define ID_VIEW_ADDU                    32960
00393 #define ID_MACRO_START                  34000
00394 #define ID_MACRO_SEL                    34100
00395 #define ID_MACRO_ADMIN                  34200
00396 #define ID_MACRO_END                    34200
00397
00398 // Next default values for new objects
00399 //
00400 #ifdef APSTUDIO_INVOKED
00401 #ifndef APSTUDIO_READONLY_SYMBOLS
00402 #define _APS_3D_CONTROLS                     1
00403 #define _APS_NEXT_RESOURCE_VALUE        201
00404 #define _APS_NEXT_COMMAND_VALUE         32961
00405 #define _APS_NEXT_CONTROL_VALUE         1182
00406 #define _APS_NEXT_SYMED_VALUE           113
00407 #endif
00408 #endif
Generated on Sun Feb 24 01:21:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/SortHeaderCtrl.cpp Source File

WinCvs/SortHeaderCtrl.cpp

Go to the documentation of this file.
00001 #include "stdafx.h"
00002 #include "SortHeaderCtrl.h"
00003
00005 // CSortHeaderCtrl
00006
00007 IMPLEMENT_DYNAMIC(CSortHeaderCtrl, CHeaderCtrl)
00008
00009 BEGIN_MESSAGE_MAP(CSortHeaderCtrl, CHeaderCtrl)
00010     //{{AFX_MSG_MAP(CSortHeaderCtrl)
00011     //}}AFX_MSG_MAP
00012 END_MESSAGE_MAP()
00013
00014 CSortHeaderCtrl::CSortHeaderCtrl()
00015 {
00016     m_bSortAsc  = TRUE;
00017     m_nSortCol  = -1;
00018 }
00019
00020 CSortHeaderCtrl::~CSortHeaderCtrl()
00021 {
00022 }
00023
00024 int CSortHeaderCtrl::SetSortImage(int nCol, BOOL bAsc)
00025 {
00026     int nPrevCol = m_nSortCol;
00027
00028     m_nSortCol = nCol;
00029     m_bSortAsc = bAsc;
00030
00031     // Change the item to ownder drawn
00032     HD_ITEM hditem;
00033
00034     hditem.mask = HDI_FORMAT;
00035     GetItem( nCol, &hditem );
00036     hditem.fmt |= HDF_OWNERDRAW;
00037     SetItem( nCol, &hditem );
00038
00039     // Invalidate header control so that it gets redrawn
00040     Invalidate();
00041
00042     return nPrevCol;
00043 }
00044
00045 void CSortHeaderCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
00046 {
00047     CDC dc;
00048
00049     dc.Attach( lpDrawItemStruct->hDC );
00050
00051     // Get the column rect
00052     CRect rcLabel( lpDrawItemStruct->rcItem );
00053
00054     // Save DC
00055     int nSavedDC = dc.SaveDC();
00056
00057     // Set clipping region to limit drawing within column
00058     CRgn rgn;
00059     rgn.CreateRectRgnIndirect( &rcLabel );
00060     dc.SelectObject( &rgn );
00061     rgn.DeleteObject();
00062
00063     // Draw the background
00064     dc.FillRect(rcLabel, &CBrush(::GetSysColor(COLOR_3DFACE)));
00065
00066     // Labels are offset by a certain amount
00067     // This offset is related to the width of a space character
00068     int offset = dc.GetTextExtent(_T(" "), 1 ).cx*2;
00069
00070     // Get the column text and format
00071     TCHAR buf[256];
00072     HD_ITEM hditem;
00073
00074     hditem.mask = HDI_TEXT | HDI_FORMAT;
00075     hditem.pszText = buf;
00076     hditem.cchTextMax = 255;
00077
00078     GetItem( lpDrawItemStruct->itemID, &hditem );
00079
00080     // Determine format for drawing column label
00081     UINT uFormat = DT_SINGLELINE | DT_NOPREFIX | DT_NOCLIP
00082                         | DT_VCENTER | DT_END_ELLIPSIS ;
00083
00084     if( hditem.fmt & HDF_CENTER)
00085         uFormat |= DT_CENTER;
00086     else if( hditem.fmt & HDF_RIGHT)
00087         uFormat |= DT_RIGHT;
00088     else
00089         uFormat |= DT_LEFT;
00090
00091     // Adjust the rect if the mouse button is pressed on it
00092     if( lpDrawItemStruct->itemState == ODS_SELECTED )
00093     {
00094         rcLabel.left++;
00095         rcLabel.top += 2;
00096         rcLabel.right++;
00097     }
00098
00099     // Adjust the rect further if Sort arrow is to be displayed
00100     if( lpDrawItemStruct->itemID == (UINT)m_nSortCol )
00101     {
00102         rcLabel.right -= 3 * offset;
00103     }
00104
00105     rcLabel.left += offset;
00106     rcLabel.right -= offset;
00107
00108     // Draw column label
00109     if( rcLabel.left < rcLabel.right )
00110         dc.DrawText(buf,-1,rcLabel, uFormat);
00111
00112     // Draw the Sort arrow
00113     if( lpDrawItemStruct->itemID == (UINT)m_nSortCol )
00114     {
00115         CRect rcIcon( lpDrawItemStruct->rcItem );
00116
00117         // Set up pens to use for drawing the triangle
00118         CPen penLight(PS_SOLID, 1, GetSysColor(COLOR_3DHILIGHT));
00119         CPen penShadow(PS_SOLID, 1, GetSysColor(COLOR_3DSHADOW));
00120         CPen *pOldPen = dc.SelectObject( &penLight );
00121
00122         offset = (rcIcon.bottom - rcIcon.top) / 4;
00123         if (m_bSortAsc)
00124         {
00125             // Draw triangle pointing upwards
00126             dc.MoveTo( rcIcon.right - 2* offset, offset);
00127             dc.LineTo( rcIcon.right - offset, rcIcon.bottom - offset-1 );
00128             dc.LineTo( rcIcon.right - 3*offset-2, rcIcon.bottom - offset-1 );
00129             dc.MoveTo( rcIcon.right - 3*offset-1, rcIcon.bottom - offset-1 );
00130             dc.SelectObject( &penShadow );
00131             dc.LineTo( rcIcon.right - 2*offset, offset-1);
00132         }
00133         else
00134         {
00135             // Draw triangle pointing downwards
00136             dc.MoveTo( rcIcon.right - offset-1, offset);
00137             dc.LineTo( rcIcon.right - 2*offset-1, rcIcon.bottom - offset );
00138             dc.MoveTo( rcIcon.right - 2*offset-2, rcIcon.bottom - offset );
00139             dc.SelectObject( &penShadow );
00140             dc.LineTo( rcIcon.right - 3*offset-1, offset );
00141             dc.LineTo( rcIcon.right - offset-1, offset);
00142         }
00143
00144         // Restore the pen
00145         dc.SelectObject( pOldPen );
00146     }
00147
00148     // Restore dc
00149     dc.RestoreDC( nSavedDC );
00150
00151     // Detach the dc before returning
00152     dc.Detach();
00153 }
00154
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/SortHeaderCtrl.h Source File

WinCvs/SortHeaderCtrl.h

Go to the documentation of this file.
00001 #ifndef __SORTHEADERCTRL_H__
00002 #define __SORTHEADERCTRL_H__
00003
00004
00006 // CSortHeaderCtrl
00007
00008 class CSortHeaderCtrl : public CHeaderCtrl
00009 {
00010     DECLARE_DYNAMIC(CSortHeaderCtrl)
00011
00012 // Construction
00013 public:
00014     CSortHeaderCtrl();
00015
00016 // Attributes
00017 protected:
00018     int     m_nSortCol;
00019     BOOL    m_bSortAsc;
00020
00021 // Operations
00022 public:
00023
00024 // Overrides
00025     // ClassWizard generated virtual function overrides
00026     //{{AFX_VIRTUAL(CSortHeaderCtrl)
00027     //}}AFX_VIRTUAL
00028
00029     virtual void    DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
00030     virtual int     SetSortImage(int nCol, BOOL bAsc);
00031
00032 // Implementation
00033 public:
00034     virtual ~CSortHeaderCtrl();
00035
00036 // Generated message map functions
00037 protected:
00038     //{{AFX_MSG(CSortHeaderCtrl)
00039     //}}AFX_MSG
00040
00041     DECLARE_MESSAGE_MAP()
00042 };
00043
00044 #endif
00045 // __SORTHEADERCTRL_H__
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/Splash.cpp Source File

WinCvs/Splash.cpp

Go to the documentation of this file.
00001 // CG: This file was added by the Splash Screen component.
00002 // Splash.cpp : implementation file
00003 //
00004
00005 #include "stdafx.h"  // e. g. stdafx.h
00006 #include "resource.h"  // e.g. resource.h
00007
00008 #include "Splash.h"  // e.g. splash.h
00009 #include "wincvs.h"  // e.g. splash.h
00010 #include "CPStr.h"  // e.g. splash.h
00011
00012 #ifdef _DEBUG
00013 #define new DEBUG_NEW
00014 #undef THIS_FILE
00015 static char BASED_CODE THIS_FILE[] = __FILE__;
00016 #endif
00017
00018 // right margin of the bitmap
00019 namespace
00020 {
00021 const int gc_nBitmapRightMargin(519 - 491);
00022 }
00023
00025 //   Splash Screen class
00026
00027 BOOL CSplashWnd::c_bShowSplashWnd;
00028 CSplashWnd* CSplashWnd::c_pSplashWnd;
00029 CSplashWnd::CSplashWnd()
00030 {
00031 }
00032
00033 CSplashWnd::~CSplashWnd()
00034 {
00035     // Clear the static window pointer.
00036     ASSERT(c_pSplashWnd == this);
00037     c_pSplashWnd = NULL;
00038 }
00039
00040 BEGIN_MESSAGE_MAP(CSplashWnd, CWnd)
00041     //{{AFX_MSG_MAP(CSplashWnd)
00042     ON_WM_CREATE()
00043     ON_WM_PAINT()
00044     ON_WM_TIMER()
00045     //}}AFX_MSG_MAP
00046 END_MESSAGE_MAP()
00047
00048 void CSplashWnd::EnableSplashScreen(BOOL bEnable /*= TRUE*/)
00049 {
00050     c_bShowSplashWnd = bEnable;
00051 }
00052
00053 void CSplashWnd::ShowSplashScreen(CWnd* pParentWnd /*= NULL*/)
00054 {
00055     if (!c_bShowSplashWnd || c_pSplashWnd != NULL)
00056         return;
00057
00058     // Allocate a new splash screen, and create the window.
00059     c_pSplashWnd = new CSplashWnd;
00060     if (!c_pSplashWnd->Create(pParentWnd))
00061         delete c_pSplashWnd;
00062     else
00063         c_pSplashWnd->UpdateWindow();
00064 }
00065
00066 BOOL CSplashWnd::PreTranslateAppMessage(MSG* pMsg)
00067 {
00068     if (c_pSplashWnd == NULL)
00069         return FALSE;
00070
00071     // If we get a keyboard or mouse message, hide the splash screen.
00072     if (pMsg->message == WM_KEYDOWN ||
00073         pMsg->message == WM_SYSKEYDOWN ||
00074         pMsg->message == WM_LBUTTONDOWN ||
00075         pMsg->message == WM_RBUTTONDOWN ||
00076         pMsg->message == WM_MBUTTONDOWN ||
00077         pMsg->message == WM_NCLBUTTONDOWN ||
00078         pMsg->message == WM_NCRBUTTONDOWN ||
00079         pMsg->message == WM_NCMBUTTONDOWN)
00080     {
00081         c_pSplashWnd->HideSplashScreen();
00082         return TRUE;    // message handled here
00083     }
00084
00085     return FALSE;   // message not handled
00086 }
00087
00088 BOOL CSplashWnd::Create(CWnd* pParentWnd /*= NULL*/)
00089 {
00090     if (!m_bitmap.LoadBitmap(IDB_SPLASH))
00091         return FALSE;
00092
00093     BITMAP bm;
00094     m_bitmap.GetBitmap(&bm);
00095
00096     return CreateEx(0,
00097         AfxRegisterWndClass(0, AfxGetApp()->LoadStandardCursor(IDC_ARROW)),
00098         NULL, WS_POPUP | WS_VISIBLE, 0, 0, bm.bmWidth, bm.bmHeight, pParentWnd->GetSafeHwnd(), NULL);
00099 }
00100
00101 void CSplashWnd::HideSplashScreen()
00102 {
00103     // Destroy the window, and update the mainframe.
00104     DestroyWindow();
00105     AfxGetMainWnd()->UpdateWindow();
00106 }
00107
00108 void CSplashWnd::CloseSplashScreen()
00109 {
00110     if(c_pSplashWnd)
00111     {
00112         c_pSplashWnd->HideSplashScreen();
00113     }
00114 }
00115
00116 void CSplashWnd::PostNcDestroy()
00117 {
00118     // Free the C++ class.
00119     delete this;
00120 }
00121
00122 int CSplashWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
00123 {
00124     if (CWnd::OnCreate(lpCreateStruct) == -1)
00125         return -1;
00126
00127     // Center the window.
00128     CenterWindow();
00129
00130     // Set a timer to destroy the splash screen.
00131     SetTimer(1, 750, NULL);
00132
00133     return 0;
00134 }
00135
00136 void CSplashWnd::OnPaint()
00137 {
00138     CPaintDC dc(this);
00139
00140     CDC dcImage;
00141     if (!dcImage.CreateCompatibleDC(&dc))
00142         return;
00143
00144     BITMAP bm;
00145     m_bitmap.GetBitmap(&bm);
00146
00147     // Paint the image.
00148     CBitmap* pOldBitmap = dcImage.SelectObject(&m_bitmap);
00149     dc.BitBlt(0, 0, bm.bmWidth, bm.bmHeight, &dcImage, 0, 0, SRCCOPY);
00150     dcImage.SelectObject(pOldBitmap);
00151
00152     // Get version information from the application
00153     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00154     CStr vers;
00155
00156     if(app->GetAppVersion(vers))
00157     {
00158         dc.SetBkMode(TRANSPARENT);
00159         dc.SetTextAlign(TA_RIGHT | TA_TOP);
00160         dc.TextOut(bm.bmWidth - gc_nBitmapRightMargin - 10, 219, vers, vers.length());
00161     }
00162 }
00163
00164 void CSplashWnd::OnTimer(UINT nIDEvent)
00165 {
00166     // Destroy the splash screen window.
00167     HideSplashScreen();
00168 }
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/Splash.h Source File

WinCvs/Splash.h

Go to the documentation of this file.
00001 // CG: This file was added by the Splash Screen component.
00002
00003 #ifndef _SPLASH_SCRN_
00004 #define _SPLASH_SCRN_
00005
00006 // Splash.h : header file
00007 //
00008
00010 //   Splash Screen class
00011
00012 class CSplashWnd : public CWnd
00013 {
00014 // Construction
00015 protected:
00016     CSplashWnd();
00017
00018 // Attributes:
00019 public:
00020     CBitmap m_bitmap;
00021
00022 // Operations
00023 public:
00024     static void EnableSplashScreen(BOOL bEnable = TRUE);
00025     static void ShowSplashScreen(CWnd* pParentWnd = NULL);
00026     static BOOL PreTranslateAppMessage(MSG* pMsg);
00027     static void CloseSplashScreen();
00028
00029 // Overrides
00030     // ClassWizard generated virtual function overrides
00031     //{{AFX_VIRTUAL(CSplashWnd)
00032     //}}AFX_VIRTUAL
00033
00034 // Implementation
00035 public:
00036     ~CSplashWnd();
00037     virtual void PostNcDestroy();
00038
00039 protected:
00040     BOOL Create(CWnd* pParentWnd = NULL);
00041     void HideSplashScreen();
00042     static BOOL c_bShowSplashWnd;
00043     static CSplashWnd* c_pSplashWnd;
00044
00045 // Generated message map functions
00046 protected:
00047     //{{AFX_MSG(CSplashWnd)
00048     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00049     afx_msg void OnPaint();
00050     afx_msg void OnTimer(UINT nIDEvent);
00051     //}}AFX_MSG
00052     DECLARE_MESSAGE_MAP()
00053 };
00054
00055
00056 #endif
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/Stat.cpp Source File

WinCvs/Stat.cpp

Go to the documentation of this file.
00001 #include <stdafx.h>
00002 #include <errno.h>
00003 #include <io.h>
00004 #include "AppConsole.h"
00005 #include "wincvsdebug.h"
00006
00007 static struct { DWORD err; int dos;} errors[] =
00008 {
00009         {  ERROR_INVALID_FUNCTION,       EINVAL    },  /* 1 */
00010         {  ERROR_FILE_NOT_FOUND,         ENOENT    },  /* 2 */
00011         {  ERROR_PATH_NOT_FOUND,         ENOENT    },  /* 3 */
00012         {  ERROR_TOO_MANY_OPEN_FILES,    EMFILE    },  /* 4 */
00013         {  ERROR_ACCESS_DENIED,          EACCES    },  /* 5 */
00014         {  ERROR_INVALID_HANDLE,         EBADF     },  /* 6 */
00015         {  ERROR_ARENA_TRASHED,          ENOMEM    },  /* 7 */
00016         {  ERROR_NOT_ENOUGH_MEMORY,      ENOMEM    },  /* 8 */
00017         {  ERROR_INVALID_BLOCK,          ENOMEM    },  /* 9 */
00018         {  ERROR_BAD_ENVIRONMENT,        E2BIG     },  /* 10 */
00019         {  ERROR_BAD_FORMAT,             ENOEXEC   },  /* 11 */
00020         {  ERROR_INVALID_ACCESS,         EINVAL    },  /* 12 */
00021         {  ERROR_INVALID_DATA,           EINVAL    },  /* 13 */
00022         {  ERROR_INVALID_DRIVE,          ENOENT    },  /* 15 */
00023         {  ERROR_CURRENT_DIRECTORY,      EACCES    },  /* 16 */
00024         {  ERROR_NOT_SAME_DEVICE,        EXDEV     },  /* 17 */
00025         {  ERROR_NO_MORE_FILES,          ENOENT    },  /* 18 */
00026         {  ERROR_LOCK_VIOLATION,         EACCES    },  /* 33 */
00027         {  ERROR_BAD_NETPATH,            ENOENT    },  /* 53 */
00028         {  ERROR_NETWORK_ACCESS_DENIED,  EACCES    },  /* 65 */
00029         {  ERROR_BAD_NET_NAME,           ENOENT    },  /* 67 */
00030         {  ERROR_FILE_EXISTS,            EEXIST    },  /* 80 */
00031         {  ERROR_CANNOT_MAKE,            EACCES    },  /* 82 */
00032         {  ERROR_FAIL_I24,               EACCES    },  /* 83 */
00033         {  ERROR_INVALID_PARAMETER,      EINVAL    },  /* 87 */
00034         {  ERROR_NO_PROC_SLOTS,          EAGAIN    },  /* 89 */
00035         {  ERROR_DRIVE_LOCKED,           EACCES    },  /* 108 */
00036         {  ERROR_BROKEN_PIPE,            EPIPE     },  /* 109 */
00037         {  ERROR_DISK_FULL,              ENOSPC    },  /* 112 */
00038         {  ERROR_INVALID_TARGET_HANDLE,  EBADF     },  /* 114 */
00039         {  ERROR_INVALID_HANDLE,         EINVAL    },  /* 124 */
00040         {  ERROR_WAIT_NO_CHILDREN,       ECHILD    },  /* 128 */
00041         {  ERROR_CHILD_NOT_COMPLETE,     ECHILD    },  /* 129 */
00042         {  ERROR_DIRECT_ACCESS_HANDLE,   EBADF     },  /* 130 */
00043         {  ERROR_NEGATIVE_SEEK,          EINVAL    },  /* 131 */
00044         {  ERROR_SEEK_ON_DEVICE,         EACCES    },  /* 132 */
00045         {  ERROR_DIR_NOT_EMPTY,          ENOTEMPTY },  /* 145 */
00046         {  ERROR_NOT_LOCKED,             EACCES    },  /* 158 */
00047         {  ERROR_BAD_PATHNAME,           ENOENT    },  /* 161 */
00048         {  ERROR_MAX_THRDS_REACHED,      EAGAIN    },  /* 164 */
00049         {  ERROR_LOCK_FAILED,            EACCES    },  /* 167 */
00050         {  ERROR_ALREADY_EXISTS,         EEXIST    },  /* 183 */
00051         {  ERROR_FILENAME_EXCED_RANGE,   ENOENT    },  /* 206 */
00052         {  ERROR_NESTING_NOT_ALLOWED,    EAGAIN    },  /* 215 */
00053         {  ERROR_NOT_ENOUGH_QUOTA,       ENOMEM    }    /* 1816 */
00054 };
00055
00056 static const WORD month_len [12] =
00057 {
00058     31, /* Jan */
00059     28, /* Feb */
00060     31, /* Mar */
00061     30, /* Apr */
00062     31, /* May */
00063     30, /* Jun */
00064     31, /* Jul */
00065     31, /* Aug */
00066     30, /* Sep */
00067     31, /* Oct */
00068     30, /* Nov */
00069     31  /* Dec */
00070 };
00071
00072 static const char * month_names[12] =
00073 {
00074     "Jan", "Feb", "Mar", "Apr",
00075     "May", "Jun", "Jul", "Aug",
00076     "Sep", "Oct", "Nov", "Dec"
00077 };
00078
00079 /* One second = 10,000,000 * 100 nsec */
00080     static const ULONGLONG systemtime_second = 10000000L;
00081
00082
00083 static void _dosmaperr(DWORD dwErr)
00084 {
00085     int n;
00086     for(n=0; n<sizeof(errors)/sizeof(errors[0]); n++)
00087     {
00088         if(errors[n].err==dwErr)
00089         {
00090             errno=errors[n].dos;
00091             return;
00092         }
00093     }
00094     errno=EFAULT;
00095 }
00096
00097 /* Is the year a leap year?
00098  *
00099  * Use standard Gregorian: every year divisible by 4
00100  * except centuries indivisible by 400.
00101  *
00102  * INPUTS: WORD year the year (AD)
00103  *
00104  * OUTPUTS: TRUE if it's a leap year.
00105  */
00106 BOOL IsLeapYear ( WORD year )
00107 {
00108     return ( (year & 3u == 0)
00109             && ( (year % 100u == 0)
00110                 || (year % 400u == 0) ));
00111 }
00112
00113 /* A fairly complicated comparison:
00114  *
00115  * Compares a test date against a target date.
00116  * If the test date is earlier, return a negative number
00117  * If the test date is later, return a positive number
00118  * If the two dates are equal, return zero.
00119  *
00120  * The comparison is complicated by the way we specify
00121  * TargetDate.
00122  *
00123  * TargetDate is assumed to be the kind of date used in
00124  * TIME_ZONE_INFORMATION.DaylightDate: If wYear is 0,
00125  * then it's a kind of code for things like 1st Sunday
00126  * of the month. As described in the Windows API docs,
00127  * wDay is an index of week:
00128  *      1 = first of month
00129  *      2 = second of month
00130  *      3 = third of month
00131  *      4 = fourth of month
00132  *      5 = last of month (even if there are only four such days).
00133  *
00134  * Thus, if wYear = 0, wMonth = 4, wDay = 2, wDayOfWeek = 4
00135  * it specifies the second Thursday of April.
00136  *
00137  * INPUTS: SYSTEMTIME * p_test_date     The date to be tested
00138  *
00139  *         SYSTEMTIME * p_target_date   The target date. This should be in
00140  *                                      the format for a TIME_ZONE_INFORMATION
00141  *                                      DaylightDate or StandardDate.
00142  *
00143  * OUTPUT:  -4/+4 if test month is less/greater than target month
00144  *          -2/+2 if test day is less/greater than target day
00145  *          -1/+2 if test hour:minute:seconds.milliseconds less/greater than target
00146  *          0     if both dates/times are equal.
00147  *
00148  */
00149 static int CompareTargetDate (
00150     const SYSTEMTIME * p_test_date,
00151     const SYSTEMTIME * p_target_date
00152     )
00153 {
00154     WORD first_day_of_month; /* day of week of the first. Sunday = 0 */
00155     WORD end_of_month;       /* last day of month */
00156     WORD temp_date;
00157     int test_milliseconds, target_milliseconds;
00158
00159     /* Check that p_target_date is in the correct foramt: */
00160     ASSERT(p_target_date->wYear==0 && p_test_date->wYear != 0);
00161     if (p_target_date->wYear != 0 || p_test_date->wYear == 0)
00162         return 0;
00163
00164     /* Don't waste time calculating if we can shortcut the comparison... */
00165     if (p_test_date->wMonth != p_target_date->wMonth)
00166     {
00167         return (p_test_date->wMonth > p_target_date->wMonth) ? 4 : -4;
00168     }
00169
00170     /* Months equal. Now we neet to do some calculation.
00171      * If we know that y is the day of the week for some arbitrary date x,
00172      * then the day of the week of the first of the month is given by
00173      * (1 + y - x) mod 7.
00174      *
00175      * For instance, if the 19th is a Wednesday (day of week = 3), then
00176      * the date of the first Wednesday of the month is (19 mod 7) = 5.
00177      * If the 5th is a Wednesday (3), then the first of the month is
00178      * four days earlier (it's the first, not the zeroth):
00179      * (3 - 4) = -1; -1 mod 7 = 6. The first is a Saturday.
00180      *
00181      * Check ourselves: The 19th falls on a (6 + 19 - 1) mod 7
00182      * = 24 mod 7 = 3: Wednesday, as it should be.
00183      */
00184     first_day_of_month = (WORD)( (1u + p_test_date->wDayOfWeek - p_test_date->wDay) % 7u);
00185
00186     /* If the first of the month comes on day y, then the first day of week z falls on
00187      * (z - y + 1) mod 7.
00188      *
00189      * For instance, if the first is a Saturday (6), then the first Tuesday (2) falls on a
00190      * (2 - 6 + 1) mod 7 = -3 mod 7 = 4: The fourth. This is correct (see above).
00191      *
00192      * temp_date gets the first <target day of week> in the month.
00193      */
00194     temp_date = (WORD)( (1u + p_target_date->wDayOfWeek - first_day_of_month) % 7u);
00195     /* If we're looking for the third Tuesday in the month, find the date of the first
00196      * Tuesday and add (3 - 1) * 7. In the example, it's the 4 + 14 = 18th.
00197      *
00198      * temp_date now should hold the date for the wDay'th wDayOfWeek of the month.
00199      * we only need to handle the special case of the last <DayOfWeek> of the month.
00200      */
00201     temp_date = (WORD)( temp_date + 7 * p_target_date->wDay );
00202
00203     /* what's the last day of the month? */
00204     end_of_month = month_len [p_target_date->wMonth - 1];
00205     /* Correct if it's February of a leap year? */
00206     if ( p_test_date->wMonth == 2 && IsLeapYear(p_test_date->wYear) )
00207     {
00208         ++ end_of_month;
00209     }
00210
00211     /* if we tried to calculate the fifth Tuesday of the month
00212      * we may well have overshot. Correct for that case.
00213      */
00214     while ( temp_date > end_of_month)
00215         temp_date -= 7;
00216
00217     /* At long last, we're ready to do the comparison. */
00218     if ( p_test_date->wDay != temp_date )
00219     {
00220         return (p_test_date->wDay > temp_date) ? 2 : -2;
00221     }
00222     else
00223     {
00224         test_milliseconds = ((p_test_date->wHour * 60 + p_test_date->wMinute) * 60
00225                                 + p_test_date->wSecond) * 1000 + p_test_date->wMilliseconds;
00226         target_milliseconds = ((p_target_date->wHour * 60 + p_target_date->wMinute) * 60
00227                                 + p_target_date->wSecond) * 1000 + p_target_date->wMilliseconds;
00228         test_milliseconds -= target_milliseconds;
00229         return (test_milliseconds > 0) ? 1 : (test_milliseconds < 0) ? -1 : 0;
00230     }
00231
00232 }
00233
00234 //
00235 //  Get time zone bias for local time *pst.
00236 //
00237 //  UTC time = *pst + bias.
00238 //
00239 static int GetTimeZoneBias( const SYSTEMTIME * pst )
00240 {
00241     TIME_ZONE_INFORMATION tz;
00242     int n, bias;
00243
00244     GetTimeZoneInformation ( &tz );
00245
00246     /*  I only deal with cases where we look at
00247      *  a "last sunday" kind of thing.
00248      */
00249     ASSERT(tz.DaylightDate.wYear == 0 && tz.StandardDate.wYear == 0);
00250
00251     bias = tz.Bias;
00252
00253     n = CompareTargetDate ( pst, & tz.DaylightDate );
00254     if (n < 0)
00255         bias += tz.StandardBias;
00256     else
00257     {
00258         n = CompareTargetDate ( pst, & tz.StandardDate );
00259         if (n < 0)
00260             bias += tz.DaylightBias;
00261         else
00262             bias += tz.StandardBias;
00263     }
00264     return bias;
00265 }
00266
00267 //
00268 //  Is the (local) time in DST?
00269 //
00270 static bool IsDST( const SYSTEMTIME * pst )
00271 {
00272     TIME_ZONE_INFORMATION tz;
00273
00274     GetTimeZoneInformation ( &tz );
00275
00276     /*  I only deal with cases where we look at
00277      *  a "last sunday" kind of thing.
00278      */
00279     ASSERT(tz.DaylightDate.wYear == 0 && tz.StandardDate.wYear == 0);
00280
00281     return (CompareTargetDate ( pst, & tz.DaylightDate ) >= 0)
00282             && (CompareTargetDate ( pst, & tz.StandardDate ) < 0);
00283 }
00284
00285 /* Convert a system time from local time to UTC time, correctly
00286  * taking DST into account (sort of).
00287  *
00288  * INPUTS:
00289  *      const SYSTEMTIME * p_local:
00290  *              A file time. It may be in UTC or in local
00291  *              time (see local_time, below, for details).
00292  *
00293  *      SYSTEMTIME * p_utc:
00294  *              The destination for the converted time.
00295  *
00296  * OUTPUTS:
00297  *      SYSTEMTIME * p_utc:
00298  *              The destination for the converted time.
00299  */
00300
00301 void LocalSystemTimeToUtcSystemTime( const SYSTEMTIME * p_local, SYSTEMTIME * p_utc)
00302 {
00303     FILETIME ft;
00304     ULARGE_INTEGER itime, delta;
00305     int bias = GetTimeZoneBias(p_local);
00306
00307     // delta = bias correction: bias minutes.
00308     SystemTimeToFileTime(p_local, & ft);
00309     itime.QuadPart = ((ULARGE_INTEGER *) &ft)->QuadPart;
00310     delta.QuadPart = systemtime_second * 60 * bias;   // bias in minutes...
00311     itime.QuadPart += delta.QuadPart;
00312
00313     ((ULARGE_INTEGER *) & ft)->QuadPart = itime.QuadPart;
00314     FileTimeToSystemTime(& ft, p_utc);
00315 }
00316
00317
00318 /* Convert a file time to a Unix time_t structure. This function is as
00319  * complicated as it is because it needs to ask what time system the
00320  * filetime describes.
00321  *
00322  * INPUTS:
00323  *      const FILETIME * ft: A file time. It may be in UTC or in local
00324  *                           time (see local_time, below, for details).
00325  *
00326  *      time_t * ut:         The destination for the converted time.
00327  *
00328  *      BOOL local_time:     TRUE if the time in *ft is in local time
00329  *                           and I need to convert to a real UTC time.
00330  *
00331  * OUTPUTS:
00332  *      time_t * ut:         Store the result in *ut.
00333  */
00334 static BOOL FileTimeToUnixTime ( const FILETIME* pft, time_t* put, BOOL local_time )
00335 {
00336     BOOL success = FALSE;
00337
00338    /* FILETIME = number of 100-nanosecond ticks since midnight
00339     * 1 Jan 1601 UTC. time_t = number of 1-second ticks since
00340     * midnight 1 Jan 1970 UTC. To translate, we subtract a
00341     * FILETIME representation of midnight, 1 Jan 1970 from the
00342     * time in question and divide by the number of 100-ns ticks
00343     * in one second.
00344     */
00345
00346
00347     SYSTEMTIME base_st =
00348     {
00349         1970,   /* wYear            */
00350         1,      /* wMonth           */
00351         0,      /* wDayOfWeek       */
00352         1,      /* wDay             */
00353         0,      /* wHour            */
00354         0,      /* wMinute          */
00355         0,      /* wSecond          */
00356         0       /* wMilliseconds    */
00357     };
00358
00359     ULARGE_INTEGER itime;
00360     FILETIME base_ft;
00361     int bias = 0;
00362
00363     if (local_time)
00364     {
00365         SYSTEMTIME temp_st;
00366         success = FileTimeToSystemTime(pft, & temp_st);
00367         bias =  GetTimeZoneBias(& temp_st);
00368     }
00369
00370     success = SystemTimeToFileTime ( &base_st, &base_ft );
00371     if (success)
00372     {
00373         itime.QuadPart = ((ULARGE_INTEGER *)pft)->QuadPart;
00374
00375         itime.QuadPart -= ((ULARGE_INTEGER *)&base_ft)->QuadPart;
00376         itime.QuadPart /= systemtime_second;    // itime is now in seconds.
00377         itime.QuadPart += bias * 60;    // bias is in minutes.
00378
00379         *put = itime.LowPart;
00380     }
00381
00382     if (!success)
00383     {
00384         *put = -1;   /* error value used by mktime() */
00385     }
00386
00387     if (GetWinCvsDebugMaskBit(wcvsdbg_trace_stat_bit))
00388     {
00389             char scratch[128];
00390             SYSTEMTIME temp_st;
00391             struct tm gmt;
00392             bool bDst;
00393             FileTimeToSystemTime(pft, &temp_st);
00394             bDst = IsDST(& temp_st);
00395             gmt = *gmtime(put);
00396             _snprintf(scratch, 128,
00397                 "Converting file time (%s, bias = %d): %s %02d %02d:%02d:%02d.%03d %4d --> %s\n",
00398                 local_time ? (bDst ? "Daylight" : "Standard") : "UTC", bias,
00399                 month_names[temp_st.wMonth - 1], temp_st.wDay,
00400                 temp_st.wHour, temp_st.wMinute, temp_st.wSecond, temp_st.wMilliseconds,
00401                 temp_st.wYear,
00402                 asctime(& gmt) );
00403
00404             cvs_err(scratch);
00405             OutputDebugString(scratch);
00406     }
00407
00408     return success;
00409 }
00410
00411 static int _statcore(HANDLE hFile, const char *filename, struct stat *buf)
00412 {
00413     BY_HANDLE_FILE_INFORMATION bhfi;
00414     int isdev;
00415     char szFs[32];
00416     int is_gmt_fs = -1;
00417
00418     if(hFile)
00419     {
00420         /* Find out what kind of handle underlies filedes
00421         */
00422         isdev = GetFileType(hFile) & ~FILE_TYPE_REMOTE;
00423
00424         if ( isdev != FILE_TYPE_DISK )
00425         {
00426             /* not a disk file. probably a device or pipe
00427              */
00428             if ( (isdev == FILE_TYPE_CHAR) || (isdev == FILE_TYPE_PIPE) )
00429             {
00430                 /* treat pipes and devices similarly. no further info is
00431                  * available from any API, so set the fields as reasonably
00432                  * as possible and return.
00433                  */
00434                 if ( isdev == FILE_TYPE_CHAR )
00435                     buf->st_mode = _S_IFCHR;
00436                 else
00437                     buf->st_mode = _S_IFIFO;
00438
00439                 buf->st_rdev = buf->st_dev = (_dev_t)hFile;
00440                 buf->st_nlink = 1;
00441                 buf->st_uid = buf->st_gid = buf->st_ino = 0;
00442                 buf->st_atime = buf->st_mtime = buf->st_ctime = 0;
00443                 if ( isdev == FILE_TYPE_CHAR )
00444                     buf->st_size = 0;
00445                 else
00446                 {
00447                     unsigned long ulAvail;
00448                     int rc;
00449                     rc = PeekNamedPipe(hFile,NULL,0,NULL,&ulAvail,NULL);
00450                     if (rc)
00451                         buf->st_size = (_off_t)ulAvail;
00452                     else
00453                         buf->st_size = (_off_t)0;
00454                 }
00455
00456                 return 0;
00457             }
00458             else if ( isdev == FILE_TYPE_UNKNOWN )
00459             {
00460                 // Network device
00461                 errno = EBADF;
00462                 return -1;
00463             }
00464         }
00465     }
00466
00467     /* set the common fields
00468      */
00469     buf->st_ino = buf->st_uid = buf->st_gid = buf->st_mode = 0;
00470     buf->st_nlink = 1;
00471
00472     if(hFile)
00473     {
00474         /* use the file handle to get all the info about the file
00475          */
00476         if ( !GetFileInformationByHandle(hFile, &bhfi) )
00477         {
00478             _dosmaperr(GetLastError());
00479             return -1;
00480         }
00481     }
00482     else
00483     {
00484         WIN32_FIND_DATA fd;
00485         HANDLE hFind;
00486
00487         if(strlen(filename)==3 && !stricmp(filename+1,":\\"))
00488         {
00489             // Can't do anything about the root directory...
00490             // Win2k and Win98 can return info, but Win95 can't, so
00491             // it's best to do nothing.
00492             memset(&bhfi,0,sizeof(bhfi));
00493             bhfi.dwFileAttributes=GetFileAttributes(filename);
00494             if(bhfi.dwFileAttributes==0xFFFFFFFF)
00495             {
00496                 _dosmaperr(GetLastError());
00497                 return -1;
00498             }
00499             bhfi.nNumberOfLinks=1;
00500         }
00501         else
00502         {
00503             hFind=FindFirstFile(filename,&fd);
00504             if(hFind==INVALID_HANDLE_VALUE)
00505             {
00506                 _dosmaperr(GetLastError());
00507                 return -1;
00508             }
00509             FindClose(hFind);
00510             memset(&bhfi,0,sizeof(bhfi));
00511             bhfi.dwFileAttributes=fd.dwFileAttributes;
00512             bhfi.ftCreationTime=fd.ftCreationTime;
00513             bhfi.ftLastAccessTime=fd.ftLastAccessTime;
00514             bhfi.ftLastWriteTime=fd.ftLastWriteTime;
00515             bhfi.nFileSizeLow=fd.nFileSizeLow;
00516             bhfi.nFileSizeHigh=fd.nFileSizeHigh;
00517             bhfi.nNumberOfLinks=1;
00518         }
00519     }
00520
00521     if ( bhfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY )
00522         buf->st_mode |= (_S_IREAD + (_S_IREAD >> 3) + (_S_IREAD >> 6));
00523     else
00524         buf->st_mode |= ((_S_IREAD|_S_IWRITE) + ((_S_IREAD|_S_IWRITE) >> 3)
00525           + ((_S_IREAD|_S_IWRITE) >> 6));
00526     if (bhfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
00527         buf->st_mode |= (_S_IEXEC + (_S_IEXEC >> 3) + (_S_IEXEC >> 6));
00528
00529     // Potential, but unlikely problem... casting DWORD to short.
00530     // Reported by Jerzy Kaczorowski, addressed by Jonathan Gilligan
00531     // if the number of links is greater than 0x7FFF
00532     // there would be an overflow problem.
00533     // This is a problem inherent in the struct stat, and hence
00534     // in the design of the C library.
00535     ASSERT(bhfi.nNumberOfLinks <= SHRT_MAX);
00536     if (bhfi.nNumberOfLinks > SHRT_MAX) {
00537         buf->st_nlink = SHRT_MAX;
00538         }
00539     else {
00540         buf->st_nlink= static_cast<short>(bhfi.nNumberOfLinks);
00541         }
00542
00543     if(!filename)
00544     {
00545         // We have to assume here that the repository doesn't span drives, so the
00546         // current directory is correct.
00547         *szFs='\0';
00548         GetVolumeInformation(NULL,NULL,0,NULL,NULL,NULL,szFs,32);
00549         if(!stricmp(szFs,"NTFS"))
00550             is_gmt_fs = 1;
00551         else
00552             is_gmt_fs = 0;
00553     }
00554     else
00555     {
00556         if(filename[1]!=':')
00557         {
00558             if((filename[0]=='\\' || filename[0]=='/') && (filename[1]=='\\' || filename[1]=='/'))
00559             {
00560                 // UNC pathname, assumed to be on an NTFS server.  No way to
00561                 // check, actually (GVI doesn't return anything useful).
00562                 is_gmt_fs = 1;
00563             }
00564             else
00565             {
00566                 // Relative path, treat as local
00567                 GetVolumeInformation(NULL,NULL,0,NULL,NULL,NULL,szFs,sizeof(szFs));
00568                 if(!stricmp(szFs,"NTFS"))
00569                     is_gmt_fs = 1;
00570                 else
00571                     is_gmt_fs = 0;
00572             }
00573         }
00574         else
00575         {
00576             // Drive specified...
00577             char szRootPath[4] = "?:\\";
00578             szRootPath[0]=filename[0];
00579             *szFs='\0';
00580             GetVolumeInformation(szRootPath,NULL,0,NULL,NULL,NULL,szFs,sizeof(szFs));
00581             if(!stricmp(szFs,"NTFS") || !stricmp(szFs,"HPFS"))
00582                 is_gmt_fs = 1;
00583             else
00584                 is_gmt_fs = 0;
00585         }
00586     }
00587
00588     if(is_gmt_fs) // NTFS - everything is in GMT already
00589     {
00590         FileTimeToUnixTime ( &bhfi.ftLastAccessTime, &buf->st_atime, FALSE );
00591         FileTimeToUnixTime ( &bhfi.ftLastWriteTime, &buf->st_mtime, FALSE );
00592         FileTimeToUnixTime ( &bhfi.ftCreationTime, &buf->st_ctime, FALSE );
00593     }
00594     else
00595     {
00596         // FAT - timestamps are in incorrectly translated local time.
00597         // translate them back and let FileTimeToUnixTime() do the
00598         // job properly.
00599
00600         FILETIME At,Wt,Ct;
00601
00602         FileTimeToLocalFileTime ( &bhfi.ftLastAccessTime, &At );
00603         FileTimeToLocalFileTime ( &bhfi.ftLastWriteTime, &Wt );
00604         FileTimeToLocalFileTime ( &bhfi.ftCreationTime, &Ct );
00605         FileTimeToUnixTime ( &At, &buf->st_atime, TRUE );
00606         FileTimeToUnixTime ( &Wt, &buf->st_mtime, TRUE );
00607         FileTimeToUnixTime ( &Ct, &buf->st_ctime, TRUE );
00608     }
00609
00610     buf->st_size = bhfi.nFileSizeLow;
00611     if(bhfi.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
00612         buf->st_mode |= _S_IFDIR;
00613     else
00614         buf->st_mode |= _S_IFREG;
00615
00616     /* On DOS, this field contains the drive number, but
00617      * the drive number is not available on this platform.
00618      * Also, for UNC network names, there is no drive number.
00619      */
00620     buf->st_rdev = buf->st_dev = 0;
00621     return 0;
00622 }
00623
00624 int wnt_stat(const char *name, struct stat *buf)
00625 {
00626     if(stricmp(name,"Entries") && stricmp(name,"Entries.log"))
00627         name=name;
00628     return _statcore(NULL,name,buf);
00629 }
00630
00631 int wnt_fstat (int fildes, struct stat *buf)
00632 {
00633     return _statcore((HANDLE)_get_osfhandle(fildes),NULL,buf);
00634 }
00635
00636 int wnt_lstat (const char *name, struct stat *buf)
00637 {
00638     return _statcore(NULL,name,buf);
00639 }
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


BrowseFileView.cpp File Reference

WinCvs/BrowseFileView.cpp File Reference

#include "stdafx.h"
#include <process.h>
#include <vector>
#include <IO.h>
#include "wincvs.h"
#include "BrowseFileView.h"
#include "FileTraversal.h"
#include "CvsCommands.h"
#include "MultiFiles.h"
#include "CvsArgs.h"
#include "AppConsole.h"
#include "CvsPrefs.h"
#include "CvsIgnore.h"
#include "TclGlue.h"
#include "MacrosSetup.h"
#include "MoveToTrash.h"
#include "WinCvsBrowser.h"
#include "MainFrm.h"
#include "wincvs_winutil.h"
#include "BrowseViewModel.h"
#include "BrowseViewHandlers.h"
#include "FileViewWatcher.h"
#include "BrowseViewColumn.h"
#include "PythonGlue.h"
#include "umain.h"

Include dependency graph for BrowseFileView.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | KoTraversalContext
class | CRecursionLock
class | TViewFill

Functions

CPersistentInt | gFileViewSort ("P_FileViewSort", EntnodeData::kName)
CPersistentBool | gFileViewSortAsc ("P_FileViewSortAsc", false)
void | onFilteringChanged (CObject *obj)
CString | GetRoot ()
int | GetPathLength (LPCTSTR path)
bool | IsSamePath (LPCTSTR path1, LPCTSTR path2)

Variables

const int | FILECHANGE_TIMER = 999
const int | kSpc = 3
const int | WM_RESETVIEW = WM_APP + 12

Function Documentation

int GetPathLength ( LPCTSTR path ) [static]

Definition at line 1267 of file BrowseFileView.cpp.

Referenced by IsSamePath.

01268 {
01269     int len = _tcslen(path);
01270     return (len > 0 && path[len - 1] == kPathDelimiter) ? (len - 1) : len;
01271 }

CString GetRoot ( ) [static]

Definition at line 1261 of file BrowseFileView.cpp.

References CWincvsApp::GetRoot.

Referenced by CBrowseFileView::OnUpdateViewUpone, and CBrowseFileView::OnViewUpone.

01262 {
01263     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01264     return app->GetRoot();
01265 }

CPersistentInt gFileViewSort | ( | "P_FileViewSort" | ,
 |  | EntnodeData::kName |
 | ) |

CPersistentBool gFileViewSortAsc | ( | "P_FileViewSortAsc" | ,
 |  | false |
 | ) |

bool IsSamePath | ( | LPCTSTR | path1,
 |  | LPCTSTR | path2
 | ) | [static]

Definition at line 1273 of file BrowseFileView.cpp.

References GetPathLength.

Referenced by CBrowseFileView::OnUpdateViewUpone, and CBrowseFileView::OnViewUpone.

01274 {
01275     int len1 = GetPathLength(path1);
01276     int len2 = GetPathLength(path2);
01277     return len1 == len2 && _tcsicmp(path1, path2) == 0;
01278 }

void onFilteringChanged ( CObject * obj ) [static]

Definition at line 500 of file BrowseFileView.cpp.

Referenced by CBrowseFileView::OnInitialUpdate.

00501 {
00502     ((CBrowseFileView *)obj)->OnFilteringChanged();
00503 }

Variable Documentation

const int FILECHANGE_TIMER = 999 [static]

Definition at line 60 of file BrowseFileView.cpp.

Referenced by CBrowseFileView::OnInitialUpdate.

const int kSpc = 3 [static]

Definition at line 61 of file BrowseFileView.cpp.

Referenced by CBrowseFileView::OnPrint.

const int WM_RESETVIEW = WM_APP + 12 [static]

Definition at line 62 of file BrowseFileView.cpp.

Referenced by CBrowseFileView::OnFilteringChanged.

Generated on Sun Feb 24 01:22:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


BrowseFileView.h File Reference

WinCvs/BrowseFileView.h File Reference

#include "CvsEntries.h"
#include "CPStr.h"
#include "SortHeaderCtrl.h"

Include dependency graph for BrowseFileView.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CBrowseFileView

Defines

#define | AFX_BROWSEFILEVIEW_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Enumerations

enum {
kFileIconText = 0,
kFileIconBinary,
kFileIconUnknown,
kFileIconAdded,
kFileIconConflict,
kFileIconMiss,
kFolderIcon,
kFolderIconUnknown,
kFolderIconMiss,
kFileIconTextMod,
kFileIconBinaryMod,
kFileIconIgnored,
kFolderIconIgnored,
kFileIconRemoved,
kFileIconBinaryAdded,
kFileIconUnicode,
kFileIconUnicodeMod,
kFileIconUnicodeAdded
}

Define Documentation

#define AFX_BROWSEFILEVIEW_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Definition at line 28 of file BrowseFileView.h.

Enumeration Type Documentation

anonymous enum

Enumeration values:
kFileIconText
kFileIconBinary
kFileIconUnknown
kFileIconAdded
kFileIconConflict
kFileIconMiss
kFolderIcon
kFolderIconUnknown
kFolderIconMiss
kFileIconTextMod
kFileIconBinaryMod
kFileIconIgnored
kFolderIconIgnored
kFileIconRemoved
kFileIconBinaryAdded
kFileIconUnicode
kFileIconUnicodeMod
kFileIconUnicodeAdded

Definition at line 43 of file BrowseFileView.h.

00044 {
00045     kFileIconText = 0,
00046     kFileIconBinary,
00047     kFileIconUnknown,
00048     kFileIconAdded,
00049     kFileIconConflict,
00050     kFileIconMiss,
00051     kFolderIcon,
00052     kFolderIconUnknown,
00053     kFolderIconMiss,
00054     kFileIconTextMod,
00055     kFileIconBinaryMod,
00056     kFileIconIgnored,
00057     kFolderIconIgnored,
00058     kFileIconRemoved,
00059     kFileIconBinaryAdded,
00060     kFileIconUnicode,
00061     kFileIconUnicodeMod,
00062     kFileIconUnicodeAdded
00063 };

Generated on Sun Feb 24 01:22:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


BrowserBar.cpp File Reference

WinCvs/BrowserBar.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "BrowserBar.h"

Include dependency graph for BrowserBar.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:22:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


BrowserBar.h File Reference

WinCvs/BrowserBar.h File Reference

#include "WinCvsBrowser.h"

Include dependency graph for BrowserBar.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CBrowserBar

Defines

#define | AFX_BROWSERBAR_H__64721953_F9A8_11D2_BDEC_000000000000__INCLUDED_

Define Documentation

#define AFX_BROWSERBAR_H__64721953_F9A8_11D2_BDEC_000000000000__INCLUDED_

Definition at line 2 of file BrowserBar.h.

Generated on Sun Feb 24 01:23:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ColorStatic.cpp File Reference

WinCvs/ColorStatic.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "ColorStatic.h"

Include dependency graph for ColorStatic.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ColorStatic.h File Reference

WinCvs/ColorStatic.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CColorStatic

Defines

#define | AFX_COLORSTATIC_H__4D2B055E_F042_428F_A662_09ABEA902DCE__INCLUDED_

Define Documentation

#define AFX_COLORSTATIC_H__4D2B055E_F042_428F_A662_09ABEA902DCE__INCLUDED_

Definition at line 26 of file ColorStatic.h.

Generated on Sun Feb 24 01:23:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ConsoleBar.cpp File Reference

WinCvs/ConsoleBar.cpp File Reference

#include "stdafx.h"
#include "ConsoleBar.h"
#include "wincvsView.h"
#include "resource.h"

Include dependency graph for ConsoleBar.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ConsoleBar.h File Reference

WinCvs/ConsoleBar.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CBarConsole

Generated on Sun Feb 24 01:23:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CustomizeMenus.cpp File Reference

WinCvs/CustomizeMenus.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "CustomizeMenus.h"
#include "MacrosSetup.h"

Include dependency graph for CustomizeMenus.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | CCustInvertTable

Defines

#define | INVTAB(msg, e) {msg, #e, e}

Functions

const CustInvertTable * | CustGetByKey (const char *entry)
char * | GetInvString (const CustInvertTable *entry)
bool | IsInInvertList (const CustInvertTable *entry, const std::vector< UStr > &list)
int CALLBACK | _Compare (LPARAM data1, LPARAM data2, LPARAM data)

Variables

CustInvertTable sInitInvTable []
CCustInvertTable sInvTable

Define Documentation

#define INVTAB | ( | msg,
 |  | e | ) | {msg, #e, e}

Definition at line 35 of file CustomizeMenus.cpp.

Function Documentation

int CALLBACK _Compare | ( | LPARAM | data1,
 |  | LPARAM | data2,
 |  | LPARAM | data
 | ) | [static]

Definition at line 299 of file CustomizeMenus.cpp.

References CustInvertTable::cmd, and GetInvString.

00300 {
00301     CustInvertTable *d1 = (CustInvertTable *)data1;
00302     CustInvertTable *d2 = (CustInvertTable *)data2;
00303
00304     CString s1(GetInvString(d1));
00305     CString s2(GetInvString(d2));
00306     int cmp = strcmp(s1, s2);
00307     if(cmp == 0)
00308         return 0;
00309     if(d1->cmd == ID_SEPARATOR)
00310         return -1;
00311     if(d2->cmd == ID_SEPARATOR)
00312         return 1;
00313     return cmp;
00314 }

const CustInvertTable* CustGetByKey ( const char * entry )

Definition at line 148 of file CustomizeMenus.cpp.

References CCustInvertTable::Initialize, and sInvTable.

00149 {
00150     std::vector<CustInvertTable>::const_iterator tmp;
00151     sInvTable.Initialize();
00152     for(tmp = sInvTable.begin(); tmp != sInvTable.end(); ++tmp)
00153     {
00154         if(strcmp(entry, (*tmp).key) == 0)
00155             return &*tmp;
00156     }
00157     return 0L;
00158 }

char* GetInvString ( const CustInvertTable * entry ) [static]

Definition at line 160 of file CustomizeMenus.cpp.

References CustInvertTable::title.

Referenced by _Compare, CCustomizeMenus::OnAdd, CCustomizeMenus::OnInitDialog, CCustomizeMenus::OnMove, and CCustomizeMenus::OnRemove.

00161 {
00162     static CString res;
00163     res = entry->title;
00164     int ind;
00165     if((ind = res.Find('&')) != -1)
00166         res.Delete(ind);
00167     if((ind = res.Find('\t')) != -1)
00168         res = res.Left(ind);
00169     return (char *)(const char *)res;
00170 }

bool IsInInvertList | ( | const CustInvertTable * | entry,
 |  | const std::vector< UStr > & | list
 | ) | [static]

Definition at line 172 of file CustomizeMenus.cpp.

References CustGetByKey, and CustInvertTable::key.

Referenced by CCustomizeMenus::OnInitDialog.

00173 {
00174     std::vector<UStr>::const_iterator i;
00175     for(i = list.begin(); i != list.end(); ++i)
00176     {
00177         const CustInvertTable *tab = CustGetByKey(*i);
00178         if(tab == 0L)
00179             continue;
00180
00181         if(strcmp(entry->key, tab->key) == 0)
00182             return true;
00183     }
00184     return false;
00185 }

Variable Documentation

CustInvertTable sInitInvTable[] [static]

Definition at line 36 of file CustomizeMenus.cpp.

CCustInvertTable sInvTable

Referenced by CustGetByKey, and CCustomizeMenus::OnInitDialog.

Generated on Sun Feb 24 01:23:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CustomizeMenus.h File Reference

WinCvs/CustomizeMenus.h File Reference

#include "Persistent.h"
#include "CPStr.h"

Include dependency graph for CustomizeMenus.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCustomizeMenus
class | CMMenuString
struct | CustInvertTable

Defines

#define | AFX_CUSTOMIZEMENUS_H__28A6AE7E_C54B_47A5_A8F5_A127E2E9F3BF__INCLUDED_

Functions

const CustInvertTable * | CustGetByKey (const char *entry)

Define Documentation

#define AFX_CUSTOMIZEMENUS_H__28A6AE7E_C54B_47A5_A8F5_A127E2E9F3BF__INCLUDED_

Definition at line 22 of file CustomizeMenus.h.

Function Documentation

const CustInvertTable* CustGetByKey ( const char * entry )

Definition at line 148 of file CustomizeMenus.cpp.

Referenced by GetCustomMenu, IsInInvertList, and CCustomizeMenus::OnInitDialog.

00149 {
00150     std::vector<CustInvertTable>::const_iterator tmp;
00151     sInvTable.Initialize();
00152     for(tmp = sInvTable.begin(); tmp != sInvTable.end(); ++tmp)
00153     {
00154         if(strcmp(entry, (*tmp).key) == 0)
00155             return &*tmp;
00156     }
00157     return 0L;
00158 }

Generated on Sun Feb 24 01:23:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CVS_Coworker.h File Reference

WinCvs/CVS_Coworker.h File Reference

#include "rpc.h"
#include "rpcndr.h"
#include "windows.h"
#include "ole2.h"
#include "oaidl.h"
#include "ocidl.h"

Include dependency graph for CVS_Coworker.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | __REQUIRED_RPCNDR_H_VERSION__ 440

Typedefs

typedef interface ICvsCoworker | ICvsCoworker
typedef CvsCoworker | CvsCoworker

Functions

void *__RPC_USER | MIDL_user_allocate (size_t)
void __RPC_USER | MIDL_user_free (void *)
typedef | DECLSPEC_UUID ("10E5359F-F454-11D2-B442-0080C6F9179D") enum CvsOption
typedef | DECLSPEC_UUID ("10E5359E-F454-11D2-B442-0080C6F9179D") enum CvsCommand
virtual HRESULT STDMETHODCALLTYPE | GetErrorMessage (int handle, int iError, int cbErrorBuffer, unsigned char *sErrorBuffer)=0
virtual HRESULT STDMETHODCALLTYPE | OpenProject (int *pHandle, const unsigned char *sUsername, const unsigned char *sProjectName, const unsigned char *sProjectHome)=0
virtual HRESULT STDMETHODCALLTYPE | GetProject (int *pHandle, const unsigned char *sUsername, int cbProjectNameBuffer, unsigned char *sProjectName, int cbProjectHomeBuffer, unsigned char *sProjectHome, BOOL bAllowPathChange, BOOL bAllowNewProject, BOOL *pbNewProject)=0
virtual HRESULT STDMETHODCALLTYPE | UpdateFiles (int handle, const unsigned char *sFilenames, BOOL bDirectories, BOOL bRecurse)=0
virtual HRESULT STDMETHODCALLTYPE | CheckoutFiles (int handle, const unsigned char *sFilenames)=0
virtual HRESULT STDMETHODCALLTYPE | CheckinFiles (int handle, const unsigned char *sFilenames, BOOL bKeepCheckedOut)=0
virtual HRESULT STDMETHODCALLTYPE | UncheckoutFiles (int handle, const unsigned char *sFilenames)=0
virtual HRESULT STDMETHODCALLTYPE | AddFiles (int handle, const unsigned char *sOptionsAndFilenames, const unsigned char *sComment)=0
virtual HRESULT STDMETHODCALLTYPE | RemoveFiles (int handle, const unsigned char *sFilenames)=0
virtual HRESULT STDMETHODCALLTYPE | RenameFile (int handle, const unsigned char *sOldFilename, const unsigned char *sNewFilename)=0
virtual HRESULT STDMETHODCALLTYPE | DiffFile (int handle, const unsigned char *sFilename, BOOL bIgnoreCase, BOOL bIgnoreBlanks)=0
virtual HRESULT STDMETHODCALLTYPE | ShowFileHistory (int handle, const unsigned char *sFilenames)=0
virtual HRESULT STDMETHODCALLTYPE | ShowFileProperties (int handle, const unsigned char *sFilename)=0
virtual HRESULT STDMETHODCALLTYPE | ShowUserInterface (int handle, const unsigned char *sFilenames)=0
virtual HRESULT STDMETHODCALLTYPE | HasAdvancedOptionsForCommand (int handle, CvsCommand command, BOOL *pbAdvancedOptions)=0
virtual HRESULT STDMETHODCALLTYPE | ShowAdvancedOptionsForCommand (int handle, CvsCommand command)=0
virtual HRESULT STDMETHODCALLTYPE | GetFileChanges (int handle, int cbFilenameBuffer, unsigned char *sFilenameBuffer)=0
virtual HRESULT STDMETHODCALLTYPE | GetFilesToAdd (int handle, int cbFilenamesBuffer, unsigned char *sFilenamesBuffer)=0
virtual HRESULT STDMETHODCALLTYPE | CloseProject (int handle)=0
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetLastError_Proxy (ICvsCoworker *This, int handle, int *piError)
void __RPC_STUB | ICvsCoworker_GetLastError_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetErrorMessage_Proxy (ICvsCoworker *This, int handle, int iError, int cbErrorBuffer, unsigned char *sErrorBuffer)
void __RPC_STUB | ICvsCoworker_GetErrorMessage_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_OpenProject_Proxy (ICvsCoworker *This, int *pHandle, const unsigned char *sUsername, const unsigned char *sProjectName, const unsigned char *sProjectHome)
void __RPC_STUB | ICvsCoworker_OpenProject_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetProject_Proxy (ICvsCoworker *This, int *pHandle, const unsigned char *sUsername, int cbProjectNameBuffer, unsigned char *sProjectName, int cbProjectHomeBuffer, unsigned char *sProjectHome, BOOL bAllowPathChange, BOOL bAllowNewProject, BOOL *pbNewProject)
void __RPC_STUB | ICvsCoworker_GetProject_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_UpdateFiles_Proxy (ICvsCoworker *This, int handle, const unsigned char *sFilenames, BOOL bDirectories, BOOL bRecurse)
void __RPC_STUB | ICvsCoworker_UpdateFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_CheckoutFiles_Proxy (ICvsCoworker *This, int handle, const unsigned char *sFilenames)
void __RPC_STUB | ICvsCoworker_CheckoutFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_CheckinFiles_Proxy (ICvsCoworker *This, int handle, const unsigned char *sFilenames, BOOL bKeepCheckedOut)
void __RPC_STUB | ICvsCoworker_CheckinFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_UncheckoutFiles_Proxy (ICvsCoworker *This, int handle, const unsigned char *sFilenames)
void __RPC_STUB | ICvsCoworker_UncheckoutFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_AddFiles_Proxy (ICvsCoworker *This, int handle, const unsigned char *sOptionsAndFilenames, const unsigned char *sComment)
void __RPC_STUB | ICvsCoworker_AddFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_RemoveFiles_Proxy (ICvsCoworker *This, int handle, const unsigned char *sFilenames)
void __RPC_STUB | ICvsCoworker_RemoveFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_RenameFile_Proxy (ICvsCoworker *This, int handle, const unsigned char *sOldFilename, const unsigned char *sNewFilename)
void __RPC_STUB | ICvsCoworker_RenameFile_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_DiffFile_Proxy (ICvsCoworker *This, int handle, const unsigned char *sFilename, BOOL bIgnoreCase, BOOL bIgnoreBlanks)
void __RPC_STUB | ICvsCoworker_DiffFile_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowFileHistory_Proxy (ICvsCoworker *This, int handle, const unsigned char *sFilenames)
void __RPC_STUB | ICvsCoworker_ShowFileHistory_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowFileProperties_Proxy (ICvsCoworker *This, int handle, const unsigned char *sFilename)
void __RPC_STUB | ICvsCoworker_ShowFileProperties_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowUserInterface_Proxy (ICvsCoworker *This, int handle, const unsigned char *sFilenames)
void __RPC_STUB | ICvsCoworker_ShowUserInterface_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_HasAdvancedOptionsForCommand_Proxy (ICvsCoworker *This, int handle, CvsCommand command, BOOL *pbAdvancedOptions)
void __RPC_STUB | ICvsCoworker_HasAdvancedOptionsForCommand_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy (ICvsCoworker *This, int handle, CvsCommand command)
void __RPC_STUB | ICvsCoworker_ShowAdvancedOptionsForCommand_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetFileChanges_Proxy (ICvsCoworker *This, int handle, int cbFilenameBuffer, unsigned char *sFilenameBuffer)
void __RPC_STUB | ICvsCoworker_GetFileChanges_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetFilesToAdd_Proxy (ICvsCoworker *This, int handle, int cbFilenamesBuffer, unsigned char *sFilenamesBuffer)
void __RPC_STUB | ICvsCoworker_GetFilesToAdd_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_CloseProject_Proxy (ICvsCoworker *This, int handle)
void __RPC_STUB | ICvsCoworker_CloseProject_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
class | DECLSPEC_UUID ("10E5359D-F454-11D2-B442-0080C6F9179D") CvsCoworker

Variables

CvsOption
CvsCommand
RPC_IF_HANDLE | __MIDL_itf_CVS_Coworker_0000_v0_0_c_ifspec
RPC_IF_HANDLE | __MIDL_itf_CVS_Coworker_0000_v0_0_s_ifspec
EXTERN_C const IID | IID_ICvsCoworker
ICvsCoworker __pad2__
ICvsCoworker int * | piError = 0
EXTERN_C const IID | LIBID_CVS_COWORKERLib
EXTERN_C const CLSID | CLSID_CvsCoworker

Define Documentation

#define __REQUIRED_RPCNDR_H_VERSION__ 440

Definition at line 23 of file CVS_Coworker.h.

Typedef Documentation

typedef class CvsCoworker CvsCoworker

Definition at line 57 of file CVS_Coworker.h.

typedef interface ICvsCoworker ICvsCoworker

Definition at line 49 of file CVS_Coworker.h.

Referenced by ICvsCoworker_GetErrorMessage_Stub, ICvsCoworker_GetProject_Proxy, ICvsCoworker_OpenProject_Proxy, and ICvsCoworker_OpenProject_Stub.

Function Documentation

virtual HRESULT STDMETHODCALLTYPE AddFiles | ( | int | handle,
 |  | const unsigned char * | sOptionsAndFilenames,
 |  | const unsigned char * | sComment
 | ) | [pure virtual]

Referenced by ICvsCoworker_AddFiles_Stub, and ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE CheckinFiles | ( | int | handle,
 |  | const unsigned char * | sFilenames,
 |  | BOOL | bKeepCheckedOut
 | ) | [pure virtual]

Referenced by ICvsCoworker_CheckinFiles_Stub.

virtual HRESULT STDMETHODCALLTYPE CheckoutFiles | ( | int | handle,
 |  | const unsigned char * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_CheckoutFiles_Stub.

virtual HRESULT STDMETHODCALLTYPE CloseProject ( int handle ) [pure virtual]

Referenced by ICvsCoworker_CloseProject_Stub, and ICvsCoworker_GetErrorMessage_Stub.

class DECLSPEC_UUID ( "10E5359D-F454-11D2-B442-0080C6F9179D" )

typedef DECLSPEC_UUID ( "10E5359E-F454-11D2-B442-0080C6F9179D" )

Definition at line 86 of file CVS_Coworker.h.

References CvsCommand.

00088     {   cvsCommandUpdate    = 0,
00089     cvsCommandCheckout  = 1,
00090     cvsCommandCheckin   = 2,
00091     cvsCommandUncheckout    = 3,
00092     cvsCommandAdd   = 4,
00093     cvsCommandRemove    = 5,
00094     cvsCommandDiff  = 6,
00095     cvsCommandHistory   = 7,
00096     cvsCommandRename    = 8,
00097     cvsCommandProperties    = 9,
00098     cvsCommandOptions   = 10
00099     }   CvsCommand;

typedef DECLSPEC_UUID ( "10E5359F-F454-11D2-B442-0080C6F9179D" )

Definition at line 79 of file CVS_Coworker.h.

References CvsOption.

00081     {   cvsOptionCompareContents    = 1,
00082     cvsOptionCompareChecksum    = 2,
00083     cvsOptionCompareTimestamp   = 3
00084     }   CvsOption;

virtual HRESULT STDMETHODCALLTYPE DiffFile | ( | int | handle,
 |  | const unsigned char * | sFilename,
 |  | BOOL | bIgnoreCase,
 |  | BOOL | bIgnoreBlanks
 | ) | [pure virtual]

Referenced by ICvsCoworker_DiffFile_Stub, and ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE GetErrorMessage | ( | int | handle,
 |  | int | iError,
 |  | int | cbErrorBuffer,
 |  | unsigned char * | sErrorBuffer
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE GetFileChanges | ( | int | handle,
 |  | int | cbFilenameBuffer,
 |  | unsigned char * | sFilenameBuffer
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub, and ICvsCoworker_GetFileChanges_Stub.

virtual HRESULT STDMETHODCALLTYPE GetFilesToAdd | ( | int | handle,
 |  | int | cbFilenamesBuffer,
 |  | unsigned char * | sFilenamesBuffer
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub, and ICvsCoworker_GetFilesToAdd_Stub.

virtual HRESULT STDMETHODCALLTYPE GetProject | ( | int * | pHandle,
 |  | const unsigned char * | sUsername,
 |  | int | cbProjectNameBuffer,
 |  | unsigned char * | sProjectName,
 |  | int | cbProjectHomeBuffer,
 |  | unsigned char * | sProjectHome,
 |  | BOOL | bAllowPathChange,
 |  | BOOL | bAllowNewProject,
 |  | BOOL * | pbNewProject
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetProject_Stub.

virtual HRESULT STDMETHODCALLTYPE HasAdvancedOptionsForCommand | ( | int | handle,
 |  | CvsCommand | command,
 |  | BOOL * | pbAdvancedOptions
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub, and ICvsCoworker_HasAdvancedOptionsForCommand_Stub.

HRESULT STDMETHODCALLTYPE ICvsCoworker_AddFiles_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sOptionsAndFilenames,
 |  | const unsigned char * | sComment
 | ) |

Definition at line 1494 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

01499 {
01500
01501     HRESULT _RetVal;
01502
01503     RPC_MESSAGE _RpcMessage;
01504
01505     MIDL_STUB_MESSAGE _StubMsg;
01506
01507     RpcTryExcept
01508         {
01509         NdrProxyInitialize(
01510                       ( void *  )This,
01511                       ( PRPC_MESSAGE  )&_RpcMessage,
01512                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01513                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01514                       11);
01515
01516
01517
01518         if(!sOptionsAndFilenames)
01519             {
01520             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01521             }
01522         if(!sComment)
01523             {
01524             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01525             }
01526         RpcTryFinally
01527             {
01528
01529             _StubMsg.BufferLength = 8;
01530             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01531                                            (unsigned char *)sOptionsAndFilenames,
01532                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01533
01534             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01535                                            (unsigned char *)sComment,
01536                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01537
01538             NdrProxyGetBuffer(This, &_StubMsg);
01539             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01540             *(( int * )_StubMsg.Buffer)++ = handle;
01541
01542             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01543                                          (unsigned char *)sOptionsAndFilenames,
01544                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01545
01546             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01547                                          (unsigned char *)sComment,
01548                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01549
01550             NdrProxySendReceive(This, &_StubMsg);
01551
01552             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
01553             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
01554
01555             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01556                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01557
01558             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01559
01560             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01561                 {
01562                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
01563                 }
01564             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
01565
01566             }
01567         RpcFinally
01568             {
01569             NdrProxyFreeBuffer(This, &_StubMsg);
01570
01571             }
01572         RpcEndFinally
01573
01574         }
01575     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01576         {
01577         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01578         }
01579     RpcEndExcept
01580     return _RetVal;
01581 }

void __RPC_STUB ICvsCoworker_AddFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1583 of file CVS_Coworker_p.c.

01588 {
01589     HRESULT _RetVal;
01590     MIDL_STUB_MESSAGE _StubMsg;
01591     int handle;
01592     const unsigned char *sComment;
01593     const unsigned char *sOptionsAndFilenames;
01594
01595 NdrStubInitialize(
01596                      _pRpcMessage,
01597                      &_StubMsg,
01598                      &Object_StubDesc,
01599                      _pRpcChannelBuffer);
01600     handle = 0;
01601     ( unsigned char * )sOptionsAndFilenames = 0;
01602     ( unsigned char * )sComment = 0;
01603     RpcTryFinally
01604         {
01605         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01606             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01607
01608         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01609
01610         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01611             {
01612             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01613             }
01614         handle = *(( int * )_StubMsg.Buffer)++;
01615
01616         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01617                                        (unsigned char * *)&sOptionsAndFilenames,
01618                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01619                                        (unsigned char)0 );
01620
01621         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01622                                        (unsigned char * *)&sComment,
01623                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01624                                        (unsigned char)0 );
01625
01626
01627         *_pdwStubPhase = STUB_CALL_SERVER;
01628         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> AddFiles(
01629             (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01630             handle,
01631             sOptionsAndFilenames,
01632             sComment);
01633
01634         *_pdwStubPhase = STUB_MARSHAL;
01635
01636         _StubMsg.BufferLength = 8;
01637         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01638         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01639         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01640
01641         }
01642     RpcFinally
01643         {
01644         }
01645     RpcEndFinally
01646     _pRpcMessage->BufferLength =
01647         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01648
01649 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckinFiles_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sFilenames,
 |  | BOOL | bKeepCheckedOut
 | ) |

Definition at line 1205 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

01210 {
01211
01212     HRESULT _RetVal;
01213
01214     RPC_MESSAGE _RpcMessage;
01215
01216     MIDL_STUB_MESSAGE _StubMsg;
01217
01218     RpcTryExcept
01219         {
01220         NdrProxyInitialize(
01221                       ( void *  )This,
01222                       ( PRPC_MESSAGE  )&_RpcMessage,
01223                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01224                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01225                       9);
01226
01227
01228
01229         if(!sFilenames)
01230             {
01231             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01232             }
01233         RpcTryFinally
01234             {
01235
01236             _StubMsg.BufferLength = 16;
01237             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01238                                            (unsigned char *)sFilenames,
01239                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01240
01241             NdrProxyGetBuffer(This, &_StubMsg);
01242             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01243             *(( int * )_StubMsg.Buffer)++ = handle;
01244
01245             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01246                                          (unsigned char *)sFilenames,
01247                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01248
01249             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01250             *(( BOOL * )_StubMsg.Buffer)++ = bKeepCheckedOut;
01251
01252             NdrProxySendReceive(This, &_StubMsg);
01253
01254             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
01255             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
01256
01257             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01258                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] );
01259
01260             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01261
01262             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01263                 {
01264                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
01265                 }
01266             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
01267
01268             }
01269         RpcFinally
01270             {
01271             NdrProxyFreeBuffer(This, &_StubMsg);
01272
01273             }
01274         RpcEndFinally
01275
01276         }
01277     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01278         {
01279         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01280         }
01281     RpcEndExcept
01282     return _RetVal;
01283 }

void __RPC_STUB ICvsCoworker_CheckinFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1285 of file CVS_Coworker_p.c.

01290 {
01291     HRESULT _RetVal;
01292     MIDL_STUB_MESSAGE _StubMsg;
01293     BOOL bKeepCheckedOut;
01294     int handle;
01295     const unsigned char *sFilenames;
01296
01297 NdrStubInitialize(
01298                      _pRpcMessage,
01299                      &_StubMsg,
01300                      &Object_StubDesc,
01301                      _pRpcChannelBuffer);
01302     handle = 0;
01303     ( unsigned char * )sFilenames = 0;
01304     bKeepCheckedOut = 0;
01305     RpcTryFinally
01306         {
01307         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01308             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] );
01309
01310         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01311
01312         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01313             {
01314             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01315             }
01316         handle = *(( int * )_StubMsg.Buffer)++;
01317
01318         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01319                                        (unsigned char * *)&sFilenames,
01320                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01321                                        (unsigned char)0 );
01322
01323         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01324
01325         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01326             {
01327             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01328             }
01329         bKeepCheckedOut = *(( BOOL * )_StubMsg.Buffer)++;
01330
01331
01332         *_pdwStubPhase = STUB_CALL_SERVER;
01333         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CheckinFiles(
01334                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01335                 handle,
01336                 sFilenames,
01337                 bKeepCheckedOut);
01338
01339         *_pdwStubPhase = STUB_MARSHAL;
01340
01341         _StubMsg.BufferLength = 8;
01342         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01343         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01344         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01345
01346         }
01347     RpcFinally
01348         {
01349         }
01350     RpcEndFinally
01351     _pRpcMessage->BufferLength =
01352         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01353
01354 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckoutFiles_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sFilenames
 | ) |

Definition at line 1068 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

01072 {
01073
01074     HRESULT _RetVal;
01075
01076     RPC_MESSAGE _RpcMessage;
01077
01078     MIDL_STUB_MESSAGE _StubMsg;
01079
01080     RpcTryExcept
01081         {
01082         NdrProxyInitialize(
01083                       ( void *  )This,
01084                       ( PRPC_MESSAGE  )&_RpcMessage,
01085                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01086                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01087                       8);
01088
01089
01090
01091         if(!sFilenames)
01092             {
01093             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01094             }
01095         RpcTryFinally
01096             {
01097
01098             _StubMsg.BufferLength = 8;
01099             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01100                                            (unsigned char *)sFilenames,
01101                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01102
01103             NdrProxyGetBuffer(This, &_StubMsg);
01104             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01105             *(( int * )_StubMsg.Buffer)++ = handle;
01106
01107             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01108                                          (unsigned char *)sFilenames,
01109                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01110
01111             NdrProxySendReceive(This, &_StubMsg);
01112
01113             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
01114             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
01115
01116             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01117                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01118
01119             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01120
01121             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01122                 {
01123                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
01124                 }
01125             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
01126
01127             }
01128         RpcFinally
01129             {
01130             NdrProxyFreeBuffer(This, &_StubMsg);
01131
01132             }
01133         RpcEndFinally
01134
01135         }
01136     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01137         {
01138         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01139         }
01140     RpcEndExcept
01141     return _RetVal;
01142 }

void __RPC_STUB ICvsCoworker_CheckoutFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1144 of file CVS_Coworker_p.c.

01149 {
01150     HRESULT _RetVal;
01151     MIDL_STUB_MESSAGE _StubMsg;
01152     int handle;
01153     const unsigned char *sFilenames;
01154
01155 NdrStubInitialize(
01156                      _pRpcMessage,
01157                      &_StubMsg,
01158                      &Object_StubDesc,
01159                      _pRpcChannelBuffer);
01160     handle = 0;
01161     ( unsigned char * )sFilenames = 0;
01162     RpcTryFinally
01163         {
01164         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01165             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01166
01167         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01168
01169         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01170             {
01171             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01172             }
01173         handle = *(( int * )_StubMsg.Buffer)++;
01174
01175         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01176                                        (unsigned char * *)&sFilenames,
01177                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01178                                        (unsigned char)0 );
01179
01180
01181         *_pdwStubPhase = STUB_CALL_SERVER;
01182         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CheckoutFiles(
01183                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01184                  handle,
01185                  sFilenames);
01186
01187         *_pdwStubPhase = STUB_MARSHAL;
01188
01189         _StubMsg.BufferLength = 8;
01190         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01191         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01192         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01193
01194         }
01195     RpcFinally
01196         {
01197         }
01198     RpcEndFinally
01199     _pRpcMessage->BufferLength =
01200         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01201
01202 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_CloseProject_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle
 | ) |

Definition at line 3147 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

03150 {
03151
03152     HRESULT _RetVal;
03153
03154     RPC_MESSAGE _RpcMessage;
03155
03156     MIDL_STUB_MESSAGE _StubMsg;
03157
03158     RpcTryExcept
03159         {
03160         NdrProxyInitialize(
03161                       ( void *  )This,
03162                       ( PRPC_MESSAGE  )&_RpcMessage,
03163                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
03164                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
03165                       22);
03166
03167
03168
03169         RpcTryFinally
03170             {
03171
03172             _StubMsg.BufferLength = 8;
03173             NdrProxyGetBuffer(This, &_StubMsg);
03174             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03175             *(( int * )_StubMsg.Buffer)++ = handle;
03176
03177             NdrProxySendReceive(This, &_StubMsg);
03178
03179             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
03180             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
03181
03182             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
03183                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[146] );
03184
03185             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03186
03187             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
03188                 {
03189                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
03190                 }
03191             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
03192
03193             }
03194         RpcFinally
03195             {
03196             NdrProxyFreeBuffer(This, &_StubMsg);
03197
03198             }
03199         RpcEndFinally
03200
03201         }
03202     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
03203         {
03204         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
03205         }
03206     RpcEndExcept
03207     return _RetVal;
03208 }

void __RPC_STUB ICvsCoworker_CloseProject_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 3210 of file CVS_Coworker_p.c.

03215 {
03216     HRESULT _RetVal;
03217     MIDL_STUB_MESSAGE _StubMsg;
03218     int handle;
03219
03220 NdrStubInitialize(
03221                      _pRpcMessage,
03222                      &_StubMsg,
03223                      &Object_StubDesc,
03224                      _pRpcChannelBuffer);
03225     handle = 0;
03226     RpcTryFinally
03227         {
03228         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
03229             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[146] );
03230
03231         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03232
03233         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
03234             {
03235             RpcRaiseException(RPC_X_BAD_STUB_DATA);
03236             }
03237         handle = *(( int * )_StubMsg.Buffer)++;
03238
03239
03240         *_pdwStubPhase = STUB_CALL_SERVER;
03241         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CloseProject((ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,handle);
03242
03243         *_pdwStubPhase = STUB_MARSHAL;
03244
03245         _StubMsg.BufferLength = 8;
03246         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
03247         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03248         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
03249
03250         }
03251     RpcFinally
03252         {
03253         }
03254     RpcEndFinally
03255     _pRpcMessage->BufferLength =
03256         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
03257
03258 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_DiffFile_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sFilename,
 |  | BOOL | bIgnoreCase,
 |  | BOOL | bIgnoreBlanks
 | ) |

Definition at line 1947 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

01953 {
01954
01955     HRESULT _RetVal;
01956
01957     RPC_MESSAGE _RpcMessage;
01958
01959     MIDL_STUB_MESSAGE _StubMsg;
01960
01961     RpcTryExcept
01962         {
01963         NdrProxyInitialize(
01964                       ( void *  )This,
01965                       ( PRPC_MESSAGE  )&_RpcMessage,
01966                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01967                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01968                       14);
01969
01970
01971
01972         if(!sFilename)
01973             {
01974             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01975             }
01976         RpcTryFinally
01977             {
01978
01979             _StubMsg.BufferLength = 24;
01980             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01981                                            (unsigned char *)sFilename,
01982                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01983
01984             NdrProxyGetBuffer(This, &_StubMsg);
01985             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01986             *(( int * )_StubMsg.Buffer)++ = handle;
01987
01988             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01989                                          (unsigned char *)sFilename,
01990                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01991
01992             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01993             *(( BOOL * )_StubMsg.Buffer)++ = bIgnoreCase;
01994
01995             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01996             *(( BOOL * )_StubMsg.Buffer)++ = bIgnoreBlanks;
01997
01998             NdrProxySendReceive(This, &_StubMsg);
01999
02000             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02001             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02002
02003             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02004                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
02005
02006             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02007
02008             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02009                 {
02010                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02011                 }
02012             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02013
02014             }
02015         RpcFinally
02016             {
02017             NdrProxyFreeBuffer(This, &_StubMsg);
02018
02019             }
02020         RpcEndFinally
02021
02022         }
02023     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02024         {
02025         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02026         }
02027     RpcEndExcept
02028     return _RetVal;
02029 }

void __RPC_STUB ICvsCoworker_DiffFile_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2031 of file CVS_Coworker_p.c.

02036 {
02037     HRESULT _RetVal;
02038     MIDL_STUB_MESSAGE _StubMsg;
02039     BOOL bIgnoreBlanks;
02040     BOOL bIgnoreCase;
02041     int handle;
02042     const unsigned char *sFilename;
02043
02044 NdrStubInitialize(
02045                      _pRpcMessage,
02046                      &_StubMsg,
02047                      &Object_StubDesc,
02048                      _pRpcChannelBuffer);
02049     handle = 0;
02050     ( unsigned char * )sFilename = 0;
02051     bIgnoreCase = 0;
02052     bIgnoreBlanks = 0;
02053     RpcTryFinally
02054         {
02055         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02056             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
02057
02058         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02059
02060         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02061             {
02062             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02063             }
02064         handle = *(( int * )_StubMsg.Buffer)++;
02065
02066         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02067                                        (unsigned char * *)&sFilename,
02068                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02069                                        (unsigned char)0 );
02070
02071         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02072
02073         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02074             {
02075             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02076             }
02077         bIgnoreCase = *(( BOOL * )_StubMsg.Buffer)++;
02078
02079         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02080
02081         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02082             {
02083             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02084             }
02085         bIgnoreBlanks = *(( BOOL * )_StubMsg.Buffer)++;
02086
02087
02088         *_pdwStubPhase = STUB_CALL_SERVER;
02089         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> DiffFile(
02090             (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02091             handle,
02092             sFilename,
02093             bIgnoreCase,
02094             bIgnoreBlanks);
02095
02096         *_pdwStubPhase = STUB_MARSHAL;
02097
02098         _StubMsg.BufferLength = 8;
02099         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02100         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02101         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02102
02103         }
02104     RpcFinally
02105         {
02106         }
02107     RpcEndFinally
02108     _pRpcMessage->BufferLength =
02109         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02110
02111 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetErrorMessage_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | int | iError,
 |  | int | cbErrorBuffer,
 |  | unsigned char * | sErrorBuffer
 | ) |

Definition at line 205 of file CVS_Coworker_p.c.

References CvsCommand.

Referenced by CINTERFACE_PROXY_VTABLE.

00211 {
00212
00213     HRESULT _RetVal;
00214
00215     RPC_MESSAGE _RpcMessage;
00216
00217     MIDL_STUB_MESSAGE _StubMsg;
00218
00219     RpcTryExcept
00220         {
00221         NdrProxyInitialize(
00222                       ( void *  )This,
00223                       ( PRPC_MESSAGE  )&_RpcMessage,
00224                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00225                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00226                       4);
00227
00228
00229
00230         if(!sErrorBuffer)
00231             {
00232             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00233             }
00234         RpcTryFinally
00235             {
00236
00237             _StubMsg.BufferLength = 24;
00238             NdrProxyGetBuffer(This, &_StubMsg);
00239             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00240             *(( int * )_StubMsg.Buffer)++ = handle;
00241
00242             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00243             *(( int * )_StubMsg.Buffer)++ = iError;
00244
00245             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00246             *(( int * )_StubMsg.Buffer)++ = cbErrorBuffer;
00247
00248             NdrProxySendReceive(This, &_StubMsg);
00249
00250             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
00251             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
00252
00253             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00254                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] );
00255
00256             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00257                                            (unsigned char * *)&sErrorBuffer,
00258                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10],
00259                                            (unsigned char)0 );
00260
00261             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00262
00263             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00264                 {
00265                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
00266                 }
00267             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
00268
00269             }
00270         RpcFinally
00271             {
00272             NdrProxyFreeBuffer(This, &_StubMsg);
00273
00274             }
00275         RpcEndFinally
00276
00277         }
00278     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00279         {
00280         _StubMsg.MaxCount = ( unsigned long  )cbErrorBuffer;
00281
00282         NdrClearOutParameters(
00283                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00284                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[6],
00285                          ( void * )sErrorBuffer);
00286         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00287         }
00288     RpcEndExcept
00289     return _RetVal;
00290 }

void __RPC_STUB ICvsCoworker_GetErrorMessage_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 292 of file CVS_Coworker_p.c.

References AddFiles, CloseProject, CvsCommand, DiffFile, GetFileChanges, GetFilesToAdd, HasAdvancedOptionsForCommand, ICvsCoworker, RemoveFiles, RenameFile, ShowAdvancedOptionsForCommand, ShowFileHistory, ShowFileProperties, and ShowUserInterface.

00297 {
00298     HRESULT _RetVal;
00299     MIDL_STUB_MESSAGE _StubMsg;
00300     int cbErrorBuffer;
00301     int handle;
00302     int iError;
00303     unsigned char *sErrorBuffer;
00304
00305 NdrStubInitialize(
00306                      _pRpcMessage,
00307                      &_StubMsg,
00308                      &Object_StubDesc,
00309                      _pRpcChannelBuffer);
00310     handle = 0;
00311     iError = 0;
00312     cbErrorBuffer = 0;
00313     ( unsigned char * )sErrorBuffer = 0;
00314     RpcTryFinally
00315         {
00316         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00317             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] );
00318
00319         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00320
00321         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00322             {
00323             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00324             }
00325         handle = *(( int * )_StubMsg.Buffer)++;
00326
00327         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00328
00329         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00330             {
00331             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00332             }
00333         iError = *(( int * )_StubMsg.Buffer)++;
00334
00335         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00336
00337         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00338             {
00339             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00340             }
00341         cbErrorBuffer = *(( int * )_StubMsg.Buffer)++;
00342
00343         if(cbErrorBuffer * 1 < 0)
00344             {
00345             RpcRaiseException(RPC_X_INVALID_BOUND);
00346             }
00347         sErrorBuffer = NdrAllocate(&_StubMsg,cbErrorBuffer * 1);
00348
00349         *_pdwStubPhase = STUB_CALL_SERVER;
00350         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetErrorMessage(
00351                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00352                    handle,
00353                    iError,
00354                    cbErrorBuffer,
00355                    sErrorBuffer);
00356
00357         *_pdwStubPhase = STUB_MARSHAL;
00358
00359         _StubMsg.BufferLength = 8;
00360         _StubMsg.MaxCount = ( unsigned long  )cbErrorBuffer;
00361
00362         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00363                                        (unsigned char *)sErrorBuffer,
00364                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10] );
00365
00366         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00367         _StubMsg.MaxCount = ( unsigned long  )cbErrorBuffer;
00368
00369         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00370                                      (unsigned char *)sErrorBuffer,
00371                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10] );
00372
00373         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00374         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
00375
00376         }
00377     RpcFinally
00378         {
00379         _StubMsg.MaxCount = ( unsigned long  )cbErrorBuffer;
00380
00381         NdrPointerFree( &_StubMsg,
00382                         (unsigned char *)sErrorBuffer,
00383                         &__MIDL_TypeFormatString.Format[6] );
00384
00385         }
00386     RpcEndFinally
00387     _pRpcMessage->BufferLength =
00388         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
00389
00390 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFileChanges_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | int | cbFilenameBuffer,
 |  | unsigned char * | sFilenameBuffer
 | ) |

Definition at line 2801 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

02806 {
02807
02808     HRESULT _RetVal;
02809
02810     RPC_MESSAGE _RpcMessage;
02811
02812     MIDL_STUB_MESSAGE _StubMsg;
02813
02814     RpcTryExcept
02815         {
02816         NdrProxyInitialize(
02817                       ( void *  )This,
02818                       ( PRPC_MESSAGE  )&_RpcMessage,
02819                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02820                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02821                       20);
02822
02823
02824
02825         if(!sFilenameBuffer)
02826             {
02827             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02828             }
02829         RpcTryFinally
02830             {
02831
02832             _StubMsg.BufferLength = 16;
02833             NdrProxyGetBuffer(This, &_StubMsg);
02834             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02835             *(( int * )_StubMsg.Buffer)++ = handle;
02836
02837             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02838             *(( int * )_StubMsg.Buffer)++ = cbFilenameBuffer;
02839
02840             NdrProxySendReceive(This, &_StubMsg);
02841
02842             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02843             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02844
02845             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02846                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[126] );
02847
02848             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02849                                            (unsigned char * *)&sFilenameBuffer,
02850                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48],
02851                                            (unsigned char)0 );
02852
02853             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02854
02855             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02856                 {
02857                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02858                 }
02859             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02860
02861             }
02862         RpcFinally
02863             {
02864             NdrProxyFreeBuffer(This, &_StubMsg);
02865
02866             }
02867         RpcEndFinally
02868
02869         }
02870     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02871         {
02872         _StubMsg.MaxCount = ( unsigned long  )cbFilenameBuffer;
02873
02874         NdrClearOutParameters(
02875                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02876                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[44],
02877                          ( void * )sFilenameBuffer);
02878         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02879         }
02880     RpcEndExcept
02881     return _RetVal;
02882 }

void __RPC_STUB ICvsCoworker_GetFileChanges_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2884 of file CVS_Coworker_p.c.

02889 {
02890     HRESULT _RetVal;
02891     MIDL_STUB_MESSAGE _StubMsg;
02892     int cbFilenameBuffer;
02893     int handle;
02894     unsigned char *sFilenameBuffer;
02895
02896 NdrStubInitialize(
02897                      _pRpcMessage,
02898                      &_StubMsg,
02899                      &Object_StubDesc,
02900                      _pRpcChannelBuffer);
02901     handle = 0;
02902     cbFilenameBuffer = 0;
02903     ( unsigned char * )sFilenameBuffer = 0;
02904     RpcTryFinally
02905         {
02906         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02907             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[126] );
02908
02909         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02910
02911         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02912             {
02913             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02914             }
02915         handle = *(( int * )_StubMsg.Buffer)++;
02916
02917         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02918
02919         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02920             {
02921             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02922             }
02923         cbFilenameBuffer = *(( int * )_StubMsg.Buffer)++;
02924
02925         if(cbFilenameBuffer * 1 < 0)
02926             {
02927             RpcRaiseException(RPC_X_INVALID_BOUND);
02928             }
02929         sFilenameBuffer = NdrAllocate(&_StubMsg,cbFilenameBuffer * 1);
02930
02931         *_pdwStubPhase = STUB_CALL_SERVER;
02932         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetFileChanges(
02933                   (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02934                   handle,
02935                   cbFilenameBuffer,
02936                   sFilenameBuffer);
02937
02938         *_pdwStubPhase = STUB_MARSHAL;
02939
02940         _StubMsg.BufferLength = 8;
02941         _StubMsg.MaxCount = ( unsigned long  )cbFilenameBuffer;
02942
02943         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02944                                        (unsigned char *)sFilenameBuffer,
02945                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48] );
02946
02947         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02948         _StubMsg.MaxCount = ( unsigned long  )cbFilenameBuffer;
02949
02950         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02951                                      (unsigned char *)sFilenameBuffer,
02952                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48] );
02953
02954         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02955         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02956
02957         }
02958     RpcFinally
02959         {
02960         _StubMsg.MaxCount = ( unsigned long  )cbFilenameBuffer;
02961
02962         NdrPointerFree( &_StubMsg,
02963                         (unsigned char *)sFilenameBuffer,
02964                         &__MIDL_TypeFormatString.Format[44] );
02965
02966         }
02967     RpcEndFinally
02968     _pRpcMessage->BufferLength =
02969         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02970
02971 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFilesToAdd_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | int | cbFilenamesBuffer,
 |  | unsigned char * | sFilenamesBuffer
 | ) |

Definition at line 2974 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

02979 {
02980
02981     HRESULT _RetVal;
02982
02983     RPC_MESSAGE _RpcMessage;
02984
02985     MIDL_STUB_MESSAGE _StubMsg;
02986
02987     RpcTryExcept
02988         {
02989         NdrProxyInitialize(
02990                       ( void *  )This,
02991                       ( PRPC_MESSAGE  )&_RpcMessage,
02992                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02993                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02994                       21);
02995
02996
02997
02998         if(!sFilenamesBuffer)
02999             {
03000             RpcRaiseException(RPC_X_NULL_REF_POINTER);
03001             }
03002         RpcTryFinally
03003             {
03004
03005             _StubMsg.BufferLength = 16;
03006             NdrProxyGetBuffer(This, &_StubMsg);
03007             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03008             *(( int * )_StubMsg.Buffer)++ = handle;
03009
03010             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03011             *(( int * )_StubMsg.Buffer)++ = cbFilenamesBuffer;
03012
03013             NdrProxySendReceive(This, &_StubMsg);
03014
03015             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
03016             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
03017
03018             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
03019                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[136] );
03020
03021             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
03022                                            (unsigned char * *)&sFilenamesBuffer,
03023                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58],
03024                                            (unsigned char)0 );
03025
03026             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03027
03028             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
03029                 {
03030                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
03031                 }
03032             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
03033
03034             }
03035         RpcFinally
03036             {
03037             NdrProxyFreeBuffer(This, &_StubMsg);
03038
03039             }
03040         RpcEndFinally
03041
03042         }
03043     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
03044         {
03045         _StubMsg.MaxCount = ( unsigned long  )cbFilenamesBuffer;
03046
03047         NdrClearOutParameters(
03048                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
03049                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[54],
03050                          ( void * )sFilenamesBuffer);
03051         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
03052         }
03053     RpcEndExcept
03054     return _RetVal;
03055 }

void __RPC_STUB ICvsCoworker_GetFilesToAdd_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 3057 of file CVS_Coworker_p.c.

03062 {
03063     HRESULT _RetVal;
03064     MIDL_STUB_MESSAGE _StubMsg;
03065     int cbFilenamesBuffer;
03066     int handle;
03067     unsigned char *sFilenamesBuffer;
03068
03069 NdrStubInitialize(
03070                      _pRpcMessage,
03071                      &_StubMsg,
03072                      &Object_StubDesc,
03073                      _pRpcChannelBuffer);
03074     handle = 0;
03075     cbFilenamesBuffer = 0;
03076     ( unsigned char * )sFilenamesBuffer = 0;
03077     RpcTryFinally
03078         {
03079         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
03080             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[136] );
03081
03082         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03083
03084         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
03085             {
03086             RpcRaiseException(RPC_X_BAD_STUB_DATA);
03087             }
03088         handle = *(( int * )_StubMsg.Buffer)++;
03089
03090         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03091
03092         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
03093             {
03094             RpcRaiseException(RPC_X_BAD_STUB_DATA);
03095             }
03096         cbFilenamesBuffer = *(( int * )_StubMsg.Buffer)++;
03097
03098         if(cbFilenamesBuffer * 1 < 0)
03099             {
03100             RpcRaiseException(RPC_X_INVALID_BOUND);
03101             }
03102         sFilenamesBuffer = NdrAllocate(&_StubMsg,cbFilenamesBuffer * 1);
03103
03104         *_pdwStubPhase = STUB_CALL_SERVER;
03105         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetFilesToAdd(
03106                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
03107                  handle,
03108                  cbFilenamesBuffer,
03109                  sFilenamesBuffer);
03110
03111         *_pdwStubPhase = STUB_MARSHAL;
03112
03113         _StubMsg.BufferLength = 8;
03114         _StubMsg.MaxCount = ( unsigned long  )cbFilenamesBuffer;
03115
03116         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
03117                                        (unsigned char *)sFilenamesBuffer,
03118                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58] );
03119
03120         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
03121         _StubMsg.MaxCount = ( unsigned long  )cbFilenamesBuffer;
03122
03123         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
03124                                      (unsigned char *)sFilenamesBuffer,
03125                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58] );
03126
03127         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03128         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
03129
03130         }
03131     RpcFinally
03132         {
03133         _StubMsg.MaxCount = ( unsigned long  )cbFilenamesBuffer;
03134
03135         NdrPointerFree( &_StubMsg,
03136                         (unsigned char *)sFilenamesBuffer,
03137                         &__MIDL_TypeFormatString.Format[54] );
03138
03139         }
03140     RpcEndFinally
03141     _pRpcMessage->BufferLength =
03142         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
03143
03144 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetLastError_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | int * | piError
 | ) |

Definition at line 69 of file CVS_Coworker_p.c.

References MIDL_user_allocate, and MIDL_user_free.

Referenced by CINTERFACE_PROXY_VTABLE.

00073 {
00074
00075     HRESULT _RetVal;
00076
00077     RPC_MESSAGE _RpcMessage;
00078
00079     MIDL_STUB_MESSAGE _StubMsg;
00080
00081     RpcTryExcept
00082         {
00083         NdrProxyInitialize(
00084                       ( void *  )This,
00085                       ( PRPC_MESSAGE  )&_RpcMessage,
00086                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00087                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00088                       3);
00089
00090
00091
00092         if(!piError)
00093             {
00094             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00095             }
00096         RpcTryFinally
00097             {
00098
00099             _StubMsg.BufferLength = 8;
00100             NdrProxyGetBuffer(This, &_StubMsg);
00101             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00102             *(( int * )_StubMsg.Buffer)++ = handle;
00103
00104             NdrProxySendReceive(This, &_StubMsg);
00105
00106             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
00107             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
00108
00109             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00110                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
00111
00112             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00113             *piError = *(( int * )_StubMsg.Buffer)++;
00114
00115             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00116
00117             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00118                 {
00119                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
00120                 }
00121             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
00122
00123             }
00124         RpcFinally
00125             {
00126             NdrProxyFreeBuffer(This, &_StubMsg);
00127
00128             }
00129         RpcEndFinally
00130
00131         }
00132     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00133         {
00134         NdrClearOutParameters(
00135                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00136                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00137                          ( void * )piError);
00138         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00139         }
00140     RpcEndExcept
00141     return _RetVal;
00142 }

void __RPC_STUB ICvsCoworker_GetLastError_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 144 of file CVS_Coworker_p.c.

References CvsCommand.

00149 {
00150     int _M0 =   0;
00151     HRESULT _RetVal;
00152     MIDL_STUB_MESSAGE _StubMsg;
00153     int handle;
00154     int *piError;
00155
00156 NdrStubInitialize(
00157                      _pRpcMessage,
00158                      &_StubMsg,
00159                      &Object_StubDesc,
00160                      _pRpcChannelBuffer);
00161     handle = 0;
00162     ( int * )piError = 0;
00163     RpcTryFinally
00164         {
00165         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00166             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
00167
00168         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00169
00170         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00171             {
00172             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00173             }
00174         handle = *(( int * )_StubMsg.Buffer)++;
00175
00176         piError = &_M0;
00177
00178         *_pdwStubPhase = STUB_CALL_SERVER;
00179         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetLastError(
00180                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00181                 handle,
00182                 piError);
00183
00184         *_pdwStubPhase = STUB_MARSHAL;
00185
00186         _StubMsg.BufferLength = 36;
00187         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00188         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00189         *(( int * )_StubMsg.Buffer)++ = *piError;
00190
00191         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00192         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
00193
00194         }
00195     RpcFinally
00196         {
00197         }
00198     RpcEndFinally
00199     _pRpcMessage->BufferLength =
00200         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
00201
00202 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetProject_Proxy | ( | ICvsCoworker * | This,
 |  | int * | pHandle,
 |  | const unsigned char * | sUsername,
 |  | int | cbProjectNameBuffer,
 |  | unsigned char * | sProjectName,
 |  | int | cbProjectHomeBuffer,
 |  | unsigned char * | sProjectHome,
 |  | BOOL | bAllowPathChange,
 |  | BOOL | bAllowNewProject,
 |  | BOOL * | pbNewProject
 | ) |

Definition at line 577 of file CVS_Coworker_p.c.

References CvsCommand, and ICvsCoworker.

Referenced by CINTERFACE_PROXY_VTABLE.

00588 {
00589
00590     HRESULT _RetVal;
00591
00592     RPC_MESSAGE _RpcMessage;
00593
00594     MIDL_STUB_MESSAGE _StubMsg;
00595
00596     RpcTryExcept
00597         {
00598         NdrProxyInitialize(
00599                       ( void *  )This,
00600                       ( PRPC_MESSAGE  )&_RpcMessage,
00601                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00602                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00603                       6);
00604
00605
00606
00607         if(!pHandle)
00608             {
00609             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00610             }
00611         if(!sUsername)
00612             {
00613             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00614             }
00615         if(!sProjectName)
00616             {
00617             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00618             }
00619         if(!sProjectHome)
00620             {
00621             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00622             }
00623         if(!pbNewProject)
00624             {
00625             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00626             }
00627         RpcTryFinally
00628             {
00629
00630             _StubMsg.BufferLength = 57;
00631             _StubMsg.MaxCount = ( unsigned long  )cbProjectNameBuffer;
00632
00633             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00634                                            (unsigned char *)sProjectName,
00635                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00636
00637             _StubMsg.MaxCount = ( unsigned long  )cbProjectHomeBuffer;
00638
00639             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00640                                            (unsigned char *)sProjectHome,
00641                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00642
00643             NdrProxyGetBuffer(This, &_StubMsg);
00644             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 0) & ~ 0);
00645             *(( unsigned char * )_StubMsg.Buffer)++ = *sUsername;
00646
00647             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00648             *(( int * )_StubMsg.Buffer)++ = cbProjectNameBuffer;
00649
00650             _StubMsg.MaxCount = ( unsigned long  )cbProjectNameBuffer;
00651
00652             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00653                                          (unsigned char *)sProjectName,
00654                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00655
00656             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00657             *(( int * )_StubMsg.Buffer)++ = cbProjectHomeBuffer;
00658
00659             _StubMsg.MaxCount = ( unsigned long  )cbProjectHomeBuffer;
00660
00661             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00662                                          (unsigned char *)sProjectHome,
00663                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00664
00665             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00666             *(( BOOL * )_StubMsg.Buffer)++ = bAllowPathChange;
00667
00668             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00669             *(( BOOL * )_StubMsg.Buffer)++ = bAllowNewProject;
00670
00671             NdrProxySendReceive(This, &_StubMsg);
00672
00673             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
00674             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
00675
00676             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00677                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[38] );
00678
00679             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00680             *pHandle = *(( int * )_StubMsg.Buffer)++;
00681
00682             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00683                                            (unsigned char * *)&sProjectName,
00684                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28],
00685                                            (unsigned char)0 );
00686
00687             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00688                                            (unsigned char * *)&sProjectHome,
00689                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38],
00690                                            (unsigned char)0 );
00691
00692             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00693             *pbNewProject = *(( BOOL * )_StubMsg.Buffer)++;
00694
00695             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00696
00697             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00698                 {
00699                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
00700                 }
00701             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
00702
00703             }
00704         RpcFinally
00705             {
00706             NdrProxyFreeBuffer(This, &_StubMsg);
00707
00708             }
00709         RpcEndFinally
00710
00711         }
00712     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00713         {
00714         NdrClearOutParameters(
00715                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00716                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00717                          ( void * )pHandle);
00718         _StubMsg.MaxCount = ( unsigned long  )cbProjectNameBuffer;
00719
00720         NdrClearOutParameters(
00721                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00722                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[24],
00723                          ( void * )sProjectName);
00724         _StubMsg.MaxCount = ( unsigned long  )cbProjectHomeBuffer;
00725
00726         NdrClearOutParameters(
00727                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00728                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[34],
00729                          ( void * )sProjectHome);
00730         NdrClearOutParameters(
00731                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00732                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00733                          ( void * )pbNewProject);
00734         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00735         }
00736     RpcEndExcept
00737     return _RetVal;
00738 }

void __RPC_STUB ICvsCoworker_GetProject_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 740 of file CVS_Coworker_p.c.

00745 {
00746     int _M14    =   0;
00747     BOOL _M15   =   0;
00748     HRESULT _RetVal;
00749     MIDL_STUB_MESSAGE _StubMsg;
00750     BOOL bAllowNewProject;
00751     BOOL bAllowPathChange;
00752     int cbProjectHomeBuffer;
00753     int cbProjectNameBuffer;
00754     int *pHandle;
00755     BOOL *pbNewProject;
00756     unsigned char *sProjectHome;
00757     unsigned char *sProjectName;
00758     const unsigned char *sUsername;
00759
00760 NdrStubInitialize(
00761                      _pRpcMessage,
00762                      &_StubMsg,
00763                      &Object_StubDesc,
00764                      _pRpcChannelBuffer);
00765     ( int * )pHandle = 0;
00766     ( unsigned char * )sUsername = 0;
00767     cbProjectNameBuffer = 0;
00768     ( unsigned char * )sProjectName = 0;
00769     cbProjectHomeBuffer = 0;
00770     ( unsigned char * )sProjectHome = 0;
00771     bAllowPathChange = 0;
00772     bAllowNewProject = 0;
00773     ( BOOL * )pbNewProject = 0;
00774     RpcTryFinally
00775         {
00776         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00777             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[38] );
00778
00779         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 0) & ~ 0);
00780         sUsername = ( unsigned char * )_StubMsg.Buffer;
00781         _StubMsg.Buffer += sizeof( unsigned char  );
00782
00783         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00784
00785         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00786             {
00787             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00788             }
00789         cbProjectNameBuffer = *(( int * )_StubMsg.Buffer)++;
00790
00791         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00792                                        (unsigned char * *)&sProjectName,
00793                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28],
00794                                        (unsigned char)0 );
00795
00796         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00797
00798         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00799             {
00800             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00801             }
00802         cbProjectHomeBuffer = *(( int * )_StubMsg.Buffer)++;
00803
00804         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00805                                        (unsigned char * *)&sProjectHome,
00806                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38],
00807                                        (unsigned char)0 );
00808
00809         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00810
00811         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00812             {
00813             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00814             }
00815         bAllowPathChange = *(( BOOL * )_StubMsg.Buffer)++;
00816
00817         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00818
00819         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00820             {
00821             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00822             }
00823         bAllowNewProject = *(( BOOL * )_StubMsg.Buffer)++;
00824
00825         pHandle = &_M14;
00826         pbNewProject = &_M15;
00827
00828         *_pdwStubPhase = STUB_CALL_SERVER;
00829         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetProject(
00830               (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00831               pHandle,
00832               sUsername,
00833               cbProjectNameBuffer,
00834               sProjectName,
00835               cbProjectHomeBuffer,
00836               sProjectHome,
00837               bAllowPathChange,
00838               bAllowNewProject,
00839               pbNewProject);
00840
00841         *_pdwStubPhase = STUB_MARSHAL;
00842
00843         _StubMsg.BufferLength = 64;
00844         _StubMsg.MaxCount = ( unsigned long  )cbProjectNameBuffer;
00845
00846         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00847                                        (unsigned char *)sProjectName,
00848                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00849
00850         _StubMsg.MaxCount = ( unsigned long  )cbProjectHomeBuffer;
00851
00852         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00853                                        (unsigned char *)sProjectHome,
00854                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00855
00856         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00857         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00858         *(( int * )_StubMsg.Buffer)++ = *pHandle;
00859
00860         _StubMsg.MaxCount = ( unsigned long  )cbProjectNameBuffer;
00861
00862         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00863                                      (unsigned char *)sProjectName,
00864                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00865
00866         _StubMsg.MaxCount = ( unsigned long  )cbProjectHomeBuffer;
00867
00868         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00869                                      (unsigned char *)sProjectHome,
00870                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00871
00872         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00873         *(( BOOL * )_StubMsg.Buffer)++ = *pbNewProject;
00874
00875         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00876         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
00877
00878         }
00879     RpcFinally
00880         {
00881         _StubMsg.MaxCount = ( unsigned long  )cbProjectNameBuffer;
00882
00883         NdrPointerFree( &_StubMsg,
00884                         (unsigned char *)sProjectName,
00885                         &__MIDL_TypeFormatString.Format[24] );
00886
00887         _StubMsg.MaxCount = ( unsigned long  )cbProjectHomeBuffer;
00888
00889         NdrPointerFree( &_StubMsg,
00890                         (unsigned char *)sProjectHome,
00891                         &__MIDL_TypeFormatString.Format[34] );
00892
00893         }
00894     RpcEndFinally
00895     _pRpcMessage->BufferLength =
00896         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
00897
00898 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_HasAdvancedOptionsForCommand_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | CvsCommand | command,
 |  | BOOL * | pbAdvancedOptions
 | ) |

Definition at line 2525 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

02530 {
02531
02532     HRESULT _RetVal;
02533
02534     RPC_MESSAGE _RpcMessage;
02535
02536     MIDL_STUB_MESSAGE _StubMsg;
02537
02538     RpcTryExcept
02539         {
02540         NdrProxyInitialize(
02541                       ( void *  )This,
02542                       ( PRPC_MESSAGE  )&_RpcMessage,
02543                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02544                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02545                       18);
02546
02547
02548
02549         if(!pbAdvancedOptions)
02550             {
02551             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02552             }
02553         RpcTryFinally
02554             {
02555
02556             _StubMsg.BufferLength = 14;
02557             NdrProxyGetBuffer(This, &_StubMsg);
02558             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02559             *(( int * )_StubMsg.Buffer)++ = handle;
02560
02561             NdrSimpleTypeMarshall(
02562                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02563                          ( unsigned char * )&command,
02564                          13);
02565             NdrProxySendReceive(This, &_StubMsg);
02566
02567             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02568             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02569
02570             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02571                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[110] );
02572
02573             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02574             *pbAdvancedOptions = *(( BOOL * )_StubMsg.Buffer)++;
02575
02576             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02577
02578             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02579                 {
02580                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02581                 }
02582             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02583
02584             }
02585         RpcFinally
02586             {
02587             NdrProxyFreeBuffer(This, &_StubMsg);
02588
02589             }
02590         RpcEndFinally
02591
02592         }
02593     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02594         {
02595         NdrClearOutParameters(
02596                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02597                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
02598                          ( void * )pbAdvancedOptions);
02599         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02600         }
02601     RpcEndExcept
02602     return _RetVal;
02603 }

void __RPC_STUB ICvsCoworker_HasAdvancedOptionsForCommand_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2605 of file CVS_Coworker_p.c.

02610 {
02611     BOOL _M42   =   0;
02612     HRESULT _RetVal;
02613     MIDL_STUB_MESSAGE _StubMsg;
02614     CvsCommand command;
02615     int handle;
02616     BOOL *pbAdvancedOptions;
02617
02618 NdrStubInitialize(
02619                      _pRpcMessage,
02620                      &_StubMsg,
02621                      &Object_StubDesc,
02622                      _pRpcChannelBuffer);
02623     handle = 0;
02624     command = 0;
02625     ( BOOL * )pbAdvancedOptions = 0;
02626     RpcTryFinally
02627         {
02628         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02629             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[110] );
02630
02631         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02632
02633         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02634             {
02635             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02636             }
02637         handle = *(( int * )_StubMsg.Buffer)++;
02638
02639         NdrSimpleTypeUnmarshall(
02640                            ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02641                            ( unsigned char * )&command,
02642                            13);
02643         pbAdvancedOptions = &_M42;
02644
02645         *_pdwStubPhase = STUB_CALL_SERVER;
02646         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> HasAdvancedOptionsForCommand(
02647                                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02648                                 handle,
02649                                 command,
02650                                 pbAdvancedOptions);
02651
02652         *_pdwStubPhase = STUB_MARSHAL;
02653
02654         _StubMsg.BufferLength = 36;
02655         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02656         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02657         *(( BOOL * )_StubMsg.Buffer)++ = *pbAdvancedOptions;
02658
02659         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02660         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02661
02662         }
02663     RpcFinally
02664         {
02665         }
02666     RpcEndFinally
02667     _pRpcMessage->BufferLength =
02668         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02669
02670 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_OpenProject_Proxy | ( | ICvsCoworker * | This,
 |  | int * | pHandle,
 |  | const unsigned char * | sUsername,
 |  | const unsigned char * | sProjectName,
 |  | const unsigned char * | sProjectHome
 | ) |

Definition at line 393 of file CVS_Coworker_p.c.

References ICvsCoworker, and piError.

Referenced by CINTERFACE_PROXY_VTABLE.

00399 {
00400
00401     HRESULT _RetVal;
00402
00403     RPC_MESSAGE _RpcMessage;
00404
00405     MIDL_STUB_MESSAGE _StubMsg;
00406
00407     RpcTryExcept
00408         {
00409         NdrProxyInitialize(
00410                       ( void *  )This,
00411                       ( PRPC_MESSAGE  )&_RpcMessage,
00412                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00413                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00414                       5);
00415
00416
00417
00418         if(!pHandle)
00419             {
00420             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00421             }
00422         if(!sUsername)
00423             {
00424             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00425             }
00426         if(!sProjectName)
00427             {
00428             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00429             }
00430         if(!sProjectHome)
00431             {
00432             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00433             }
00434         RpcTryFinally
00435             {
00436
00437             _StubMsg.BufferLength = 0;
00438             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00439                                            (unsigned char *)sUsername,
00440                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00441
00442             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00443                                            (unsigned char *)sProjectName,
00444                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00445
00446             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00447                                            (unsigned char *)sProjectHome,
00448                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00449
00450             NdrProxyGetBuffer(This, &_StubMsg);
00451             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00452                                          (unsigned char *)sUsername,
00453                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00454
00455             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00456                                          (unsigned char *)sProjectName,
00457                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00458
00459             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00460                                          (unsigned char *)sProjectHome,
00461                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00462
00463             NdrProxySendReceive(This, &_StubMsg);
00464
00465             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
00466             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
00467
00468             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00469                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[20] );
00470
00471             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00472             *pHandle = *(( int * )_StubMsg.Buffer)++;
00473
00474             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00475
00476             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00477                 {
00478                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
00479                 }
00480             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
00481
00482             }
00483         RpcFinally
00484             {
00485             NdrProxyFreeBuffer(This, &_StubMsg);
00486
00487             }
00488         RpcEndFinally
00489
00490         }
00491     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00492         {
00493         NdrClearOutParameters(
00494                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00495                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00496                          ( void * )pHandle);
00497         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00498         }
00499     RpcEndExcept
00500     return _RetVal;
00501 }

void __RPC_STUB ICvsCoworker_OpenProject_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 503 of file CVS_Coworker_p.c.

References ICvsCoworker.

00508 {
00509     int _M9 =   0;
00510     HRESULT _RetVal;
00511     MIDL_STUB_MESSAGE _StubMsg;
00512     int *pHandle;
00513     const unsigned char *sProjectHome;
00514     const unsigned char *sProjectName;
00515     const unsigned char *sUsername;
00516
00517 NdrStubInitialize(
00518                      _pRpcMessage,
00519                      &_StubMsg,
00520                      &Object_StubDesc,
00521                      _pRpcChannelBuffer);
00522     ( int * )pHandle = 0;
00523     ( unsigned char * )sUsername = 0;
00524     ( unsigned char * )sProjectName = 0;
00525     ( unsigned char * )sProjectHome = 0;
00526     RpcTryFinally
00527         {
00528         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00529             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[20] );
00530
00531         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00532                                        (unsigned char * *)&sUsername,
00533                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00534                                        (unsigned char)0 );
00535
00536         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00537                                        (unsigned char * *)&sProjectName,
00538                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00539                                        (unsigned char)0 );
00540
00541         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00542                                        (unsigned char * *)&sProjectHome,
00543                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00544                                        (unsigned char)0 );
00545
00546         pHandle = &_M9;
00547
00548         *_pdwStubPhase = STUB_CALL_SERVER;
00549         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> OpenProject(
00550                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00551                pHandle,
00552                sUsername,
00553                sProjectName,
00554                sProjectHome);
00555
00556         *_pdwStubPhase = STUB_MARSHAL;
00557
00558         _StubMsg.BufferLength = 36;
00559         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00560         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00561         *(( int * )_StubMsg.Buffer)++ = *pHandle;
00562
00563         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00564         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
00565
00566         }
00567     RpcFinally
00568         {
00569         }
00570     RpcEndFinally
00571     _pRpcMessage->BufferLength =
00572         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
00573
00574 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_RemoveFiles_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sFilenames
 | ) |

Definition at line 1652 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

01656 {
01657
01658     HRESULT _RetVal;
01659
01660     RPC_MESSAGE _RpcMessage;
01661
01662     MIDL_STUB_MESSAGE _StubMsg;
01663
01664     RpcTryExcept
01665         {
01666         NdrProxyInitialize(
01667                       ( void *  )This,
01668                       ( PRPC_MESSAGE  )&_RpcMessage,
01669                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01670                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01671                       12);
01672
01673
01674
01675         if(!sFilenames)
01676             {
01677             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01678             }
01679         RpcTryFinally
01680             {
01681
01682             _StubMsg.BufferLength = 8;
01683             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01684                                            (unsigned char *)sFilenames,
01685                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01686
01687             NdrProxyGetBuffer(This, &_StubMsg);
01688             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01689             *(( int * )_StubMsg.Buffer)++ = handle;
01690
01691             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01692                                          (unsigned char *)sFilenames,
01693                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01694
01695             NdrProxySendReceive(This, &_StubMsg);
01696
01697             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
01698             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
01699
01700             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01701                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01702
01703             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01704
01705             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01706                 {
01707                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
01708                 }
01709             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
01710
01711             }
01712         RpcFinally
01713             {
01714             NdrProxyFreeBuffer(This, &_StubMsg);
01715
01716             }
01717         RpcEndFinally
01718
01719         }
01720     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01721         {
01722         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01723         }
01724     RpcEndExcept
01725     return _RetVal;
01726 }

void __RPC_STUB ICvsCoworker_RemoveFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1728 of file CVS_Coworker_p.c.

01733 {
01734     HRESULT _RetVal;
01735     MIDL_STUB_MESSAGE _StubMsg;
01736     int handle;
01737     const unsigned char *sFilenames;
01738
01739 NdrStubInitialize(
01740                      _pRpcMessage,
01741                      &_StubMsg,
01742                      &Object_StubDesc,
01743                      _pRpcChannelBuffer);
01744     handle = 0;
01745     ( unsigned char * )sFilenames = 0;
01746     RpcTryFinally
01747         {
01748         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01749             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01750
01751         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01752
01753         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01754             {
01755             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01756             }
01757         handle = *(( int * )_StubMsg.Buffer)++;
01758
01759         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01760                                        (unsigned char * *)&sFilenames,
01761                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01762                                        (unsigned char)0 );
01763
01764
01765         *_pdwStubPhase = STUB_CALL_SERVER;
01766         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> RemoveFiles(
01767                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01768                handle,
01769                sFilenames);
01770
01771         *_pdwStubPhase = STUB_MARSHAL;
01772
01773         _StubMsg.BufferLength = 8;
01774         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01775         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01776         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01777
01778         }
01779     RpcFinally
01780         {
01781         }
01782     RpcEndFinally
01783     _pRpcMessage->BufferLength =
01784         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01785
01786 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_RenameFile_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sOldFilename,
 |  | const unsigned char * | sNewFilename
 | ) |

Definition at line 1789 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

01794 {
01795
01796     HRESULT _RetVal;
01797
01798     RPC_MESSAGE _RpcMessage;
01799
01800     MIDL_STUB_MESSAGE _StubMsg;
01801
01802     RpcTryExcept
01803         {
01804         NdrProxyInitialize(
01805                       ( void *  )This,
01806                       ( PRPC_MESSAGE  )&_RpcMessage,
01807                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01808                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01809                       13);
01810
01811
01812
01813         if(!sOldFilename)
01814             {
01815             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01816             }
01817         if(!sNewFilename)
01818             {
01819             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01820             }
01821         RpcTryFinally
01822             {
01823
01824             _StubMsg.BufferLength = 8;
01825             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01826                                            (unsigned char *)sOldFilename,
01827                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01828
01829             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01830                                            (unsigned char *)sNewFilename,
01831                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01832
01833             NdrProxyGetBuffer(This, &_StubMsg);
01834             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01835             *(( int * )_StubMsg.Buffer)++ = handle;
01836
01837             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01838                                          (unsigned char *)sOldFilename,
01839                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01840
01841             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01842                                          (unsigned char *)sNewFilename,
01843                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01844
01845             NdrProxySendReceive(This, &_StubMsg);
01846
01847             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
01848             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
01849
01850             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01851                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01852
01853             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01854
01855             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01856                 {
01857                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
01858                 }
01859             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
01860
01861             }
01862         RpcFinally
01863             {
01864             NdrProxyFreeBuffer(This, &_StubMsg);
01865
01866             }
01867         RpcEndFinally
01868
01869         }
01870     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01871         {
01872         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01873         }
01874     RpcEndExcept
01875     return _RetVal;
01876 }

void __RPC_STUB ICvsCoworker_RenameFile_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1878 of file CVS_Coworker_p.c.

01883 {
01884     HRESULT _RetVal;
01885     MIDL_STUB_MESSAGE _StubMsg;
01886     int handle;
01887     const unsigned char *sNewFilename;
01888     const unsigned char *sOldFilename;
01889
01890 NdrStubInitialize(
01891                      _pRpcMessage,
01892                      &_StubMsg,
01893                      &Object_StubDesc,
01894                      _pRpcChannelBuffer);
01895     handle = 0;
01896     ( unsigned char * )sOldFilename = 0;
01897     ( unsigned char * )sNewFilename = 0;
01898     RpcTryFinally
01899         {
01900         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01901             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01902
01903         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01904
01905         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01906             {
01907             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01908             }
01909         handle = *(( int * )_StubMsg.Buffer)++;
01910
01911         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01912                                        (unsigned char * *)&sOldFilename,
01913                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01914                                        (unsigned char)0 );
01915
01916         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01917                                        (unsigned char * *)&sNewFilename,
01918                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01919                                        (unsigned char)0 );
01920
01921
01922         *_pdwStubPhase = STUB_CALL_SERVER;
01923         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> RenameFile(
01924               (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01925               handle,
01926               sOldFilename,
01927               sNewFilename);
01928
01929         *_pdwStubPhase = STUB_MARSHAL;
01930
01931         _StubMsg.BufferLength = 8;
01932         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01933         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01934         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01935
01936         }
01937     RpcFinally
01938         {
01939         }
01940     RpcEndFinally
01941     _pRpcMessage->BufferLength =
01942         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01943
01944 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | CvsCommand | command
 | ) |

Definition at line 2673 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

02677 {
02678
02679     HRESULT _RetVal;
02680
02681     RPC_MESSAGE _RpcMessage;
02682
02683     MIDL_STUB_MESSAGE _StubMsg;
02684
02685     RpcTryExcept
02686         {
02687         NdrProxyInitialize(
02688                       ( void *  )This,
02689                       ( PRPC_MESSAGE  )&_RpcMessage,
02690                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02691                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02692                       19);
02693
02694
02695
02696         RpcTryFinally
02697             {
02698
02699             _StubMsg.BufferLength = 14;
02700             NdrProxyGetBuffer(This, &_StubMsg);
02701             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02702             *(( int * )_StubMsg.Buffer)++ = handle;
02703
02704             NdrSimpleTypeMarshall(
02705                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02706                          ( unsigned char * )&command,
02707                          13);
02708             NdrProxySendReceive(This, &_StubMsg);
02709
02710             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02711             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02712
02713             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02714                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[120] );
02715
02716             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02717
02718             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02719                 {
02720                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02721                 }
02722             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02723
02724             }
02725         RpcFinally
02726             {
02727             NdrProxyFreeBuffer(This, &_StubMsg);
02728
02729             }
02730         RpcEndFinally
02731
02732         }
02733     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02734         {
02735         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02736         }
02737     RpcEndExcept
02738     return _RetVal;
02739 }

void __RPC_STUB ICvsCoworker_ShowAdvancedOptionsForCommand_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2741 of file CVS_Coworker_p.c.

02746 {
02747     HRESULT _RetVal;
02748     MIDL_STUB_MESSAGE _StubMsg;
02749     CvsCommand command;
02750     int handle;
02751
02752 NdrStubInitialize(
02753                      _pRpcMessage,
02754                      &_StubMsg,
02755                      &Object_StubDesc,
02756                      _pRpcChannelBuffer);
02757     handle = 0;
02758     command = 0;
02759     RpcTryFinally
02760         {
02761         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02762             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[120] );
02763
02764         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02765
02766         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02767             {
02768             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02769             }
02770         handle = *(( int * )_StubMsg.Buffer)++;
02771
02772         NdrSimpleTypeUnmarshall(
02773                            ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02774                            ( unsigned char * )&command,
02775                            13);
02776
02777         *_pdwStubPhase = STUB_CALL_SERVER;
02778         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowAdvancedOptionsForCommand(
02779                                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02780                                  handle,
02781                                  command);
02782
02783         *_pdwStubPhase = STUB_MARSHAL;
02784
02785         _StubMsg.BufferLength = 8;
02786         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02787         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02788         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02789
02790         }
02791     RpcFinally
02792         {
02793         }
02794     RpcEndFinally
02795     _pRpcMessage->BufferLength =
02796         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02797
02798 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileHistory_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sFilenames
 | ) |

Definition at line 2114 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

02118 {
02119
02120     HRESULT _RetVal;
02121
02122     RPC_MESSAGE _RpcMessage;
02123
02124     MIDL_STUB_MESSAGE _StubMsg;
02125
02126     RpcTryExcept
02127         {
02128         NdrProxyInitialize(
02129                       ( void *  )This,
02130                       ( PRPC_MESSAGE  )&_RpcMessage,
02131                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02132                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02133                       15);
02134
02135
02136
02137         if(!sFilenames)
02138             {
02139             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02140             }
02141         RpcTryFinally
02142             {
02143
02144             _StubMsg.BufferLength = 8;
02145             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02146                                            (unsigned char *)sFilenames,
02147                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02148
02149             NdrProxyGetBuffer(This, &_StubMsg);
02150             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02151             *(( int * )_StubMsg.Buffer)++ = handle;
02152
02153             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02154                                          (unsigned char *)sFilenames,
02155                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02156
02157             NdrProxySendReceive(This, &_StubMsg);
02158
02159             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02160             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02161
02162             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02163                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02164
02165             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02166
02167             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02168                 {
02169                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02170                 }
02171             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02172
02173             }
02174         RpcFinally
02175             {
02176             NdrProxyFreeBuffer(This, &_StubMsg);
02177
02178             }
02179         RpcEndFinally
02180
02181         }
02182     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02183         {
02184         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02185         }
02186     RpcEndExcept
02187     return _RetVal;
02188 }

void __RPC_STUB ICvsCoworker_ShowFileHistory_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2190 of file CVS_Coworker_p.c.

02195 {
02196     HRESULT _RetVal;
02197     MIDL_STUB_MESSAGE _StubMsg;
02198     int handle;
02199     const unsigned char *sFilenames;
02200
02201 NdrStubInitialize(
02202                      _pRpcMessage,
02203                      &_StubMsg,
02204                      &Object_StubDesc,
02205                      _pRpcChannelBuffer);
02206     handle = 0;
02207     ( unsigned char * )sFilenames = 0;
02208     RpcTryFinally
02209         {
02210         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02211             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02212
02213         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02214
02215         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02216             {
02217             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02218             }
02219         handle = *(( int * )_StubMsg.Buffer)++;
02220
02221         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02222                                        (unsigned char * *)&sFilenames,
02223                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02224                                        (unsigned char)0 );
02225
02226
02227         *_pdwStubPhase = STUB_CALL_SERVER;
02228         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowFileHistory(
02229                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02230                    handle,
02231                    sFilenames);
02232
02233         *_pdwStubPhase = STUB_MARSHAL;
02234
02235         _StubMsg.BufferLength = 8;
02236         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02237         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02238         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02239
02240         }
02241     RpcFinally
02242         {
02243         }
02244     RpcEndFinally
02245     _pRpcMessage->BufferLength =
02246         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02247
02248 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileProperties_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sFilename
 | ) |

Definition at line 2251 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

02255 {
02256
02257     HRESULT _RetVal;
02258
02259     RPC_MESSAGE _RpcMessage;
02260
02261     MIDL_STUB_MESSAGE _StubMsg;
02262
02263     RpcTryExcept
02264         {
02265         NdrProxyInitialize(
02266                       ( void *  )This,
02267                       ( PRPC_MESSAGE  )&_RpcMessage,
02268                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02269                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02270                       16);
02271
02272
02273
02274         if(!sFilename)
02275             {
02276             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02277             }
02278         RpcTryFinally
02279             {
02280
02281             _StubMsg.BufferLength = 8;
02282             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02283                                            (unsigned char *)sFilename,
02284                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02285
02286             NdrProxyGetBuffer(This, &_StubMsg);
02287             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02288             *(( int * )_StubMsg.Buffer)++ = handle;
02289
02290             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02291                                          (unsigned char *)sFilename,
02292                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02293
02294             NdrProxySendReceive(This, &_StubMsg);
02295
02296             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02297             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02298
02299             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02300                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02301
02302             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02303
02304             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02305                 {
02306                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02307                 }
02308             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02309
02310             }
02311         RpcFinally
02312             {
02313             NdrProxyFreeBuffer(This, &_StubMsg);
02314
02315             }
02316         RpcEndFinally
02317
02318         }
02319     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02320         {
02321         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02322         }
02323     RpcEndExcept
02324     return _RetVal;
02325 }

void __RPC_STUB ICvsCoworker_ShowFileProperties_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2327 of file CVS_Coworker_p.c.

02332 {
02333     HRESULT _RetVal;
02334     MIDL_STUB_MESSAGE _StubMsg;
02335     int handle;
02336     const unsigned char *sFilename;
02337
02338 NdrStubInitialize(
02339                      _pRpcMessage,
02340                      &_StubMsg,
02341                      &Object_StubDesc,
02342                      _pRpcChannelBuffer);
02343     handle = 0;
02344     ( unsigned char * )sFilename = 0;
02345     RpcTryFinally
02346         {
02347         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02348             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02349
02350         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02351
02352         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02353             {
02354             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02355             }
02356         handle = *(( int * )_StubMsg.Buffer)++;
02357
02358         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02359                                        (unsigned char * *)&sFilename,
02360                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02361                                        (unsigned char)0 );
02362
02363
02364         *_pdwStubPhase = STUB_CALL_SERVER;
02365         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowFileProperties(
02366                       (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02367                       handle,
02368                       sFilename);
02369
02370         *_pdwStubPhase = STUB_MARSHAL;
02371
02372         _StubMsg.BufferLength = 8;
02373         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02374         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02375         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02376
02377         }
02378     RpcFinally
02379         {
02380         }
02381     RpcEndFinally
02382     _pRpcMessage->BufferLength =
02383         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02384
02385 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowUserInterface_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sFilenames
 | ) |

Definition at line 2388 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

02392 {
02393
02394     HRESULT _RetVal;
02395
02396     RPC_MESSAGE _RpcMessage;
02397
02398     MIDL_STUB_MESSAGE _StubMsg;
02399
02400     RpcTryExcept
02401         {
02402         NdrProxyInitialize(
02403                       ( void *  )This,
02404                       ( PRPC_MESSAGE  )&_RpcMessage,
02405                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02406                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02407                       17);
02408
02409
02410
02411         if(!sFilenames)
02412             {
02413             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02414             }
02415         RpcTryFinally
02416             {
02417
02418             _StubMsg.BufferLength = 8;
02419             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02420                                            (unsigned char *)sFilenames,
02421                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02422
02423             NdrProxyGetBuffer(This, &_StubMsg);
02424             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02425             *(( int * )_StubMsg.Buffer)++ = handle;
02426
02427             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02428                                          (unsigned char *)sFilenames,
02429                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02430
02431             NdrProxySendReceive(This, &_StubMsg);
02432
02433             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02434             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02435
02436             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02437                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02438
02439             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02440
02441             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02442                 {
02443                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02444                 }
02445             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02446
02447             }
02448         RpcFinally
02449             {
02450             NdrProxyFreeBuffer(This, &_StubMsg);
02451
02452             }
02453         RpcEndFinally
02454
02455         }
02456     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02457         {
02458         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02459         }
02460     RpcEndExcept
02461     return _RetVal;
02462 }

void __RPC_STUB ICvsCoworker_ShowUserInterface_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2464 of file CVS_Coworker_p.c.

02469 {
02470     HRESULT _RetVal;
02471     MIDL_STUB_MESSAGE _StubMsg;
02472     int handle;
02473     const unsigned char *sFilenames;
02474
02475 NdrStubInitialize(
02476                      _pRpcMessage,
02477                      &_StubMsg,
02478                      &Object_StubDesc,
02479                      _pRpcChannelBuffer);
02480     handle = 0;
02481     ( unsigned char * )sFilenames = 0;
02482     RpcTryFinally
02483         {
02484         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02485             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02486
02487         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02488
02489         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02490             {
02491             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02492             }
02493         handle = *(( int * )_StubMsg.Buffer)++;
02494
02495         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02496                                        (unsigned char * *)&sFilenames,
02497                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02498                                        (unsigned char)0 );
02499
02500
02501         *_pdwStubPhase = STUB_CALL_SERVER;
02502         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowUserInterface(
02503                      (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02504                      handle,
02505                      sFilenames);
02506
02507         *_pdwStubPhase = STUB_MARSHAL;
02508
02509         _StubMsg.BufferLength = 8;
02510         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02511         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02512         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02513
02514         }
02515     RpcFinally
02516         {
02517         }
02518     RpcEndFinally
02519     _pRpcMessage->BufferLength =
02520         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02521
02522 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_UncheckoutFiles_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sFilenames
 | ) |

Definition at line 1357 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

01361 {
01362
01363     HRESULT _RetVal;
01364
01365     RPC_MESSAGE _RpcMessage;
01366
01367     MIDL_STUB_MESSAGE _StubMsg;
01368
01369     RpcTryExcept
01370         {
01371         NdrProxyInitialize(
01372                       ( void *  )This,
01373                       ( PRPC_MESSAGE  )&_RpcMessage,
01374                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01375                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01376                       10);
01377
01378
01379
01380         if(!sFilenames)
01381             {
01382             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01383             }
01384         RpcTryFinally
01385             {
01386
01387             _StubMsg.BufferLength = 8;
01388             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01389                                            (unsigned char *)sFilenames,
01390                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01391
01392             NdrProxyGetBuffer(This, &_StubMsg);
01393             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01394             *(( int * )_StubMsg.Buffer)++ = handle;
01395
01396             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01397                                          (unsigned char *)sFilenames,
01398                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01399
01400             NdrProxySendReceive(This, &_StubMsg);
01401
01402             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
01403             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
01404
01405             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01406                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01407
01408             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01409
01410             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01411                 {
01412                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
01413                 }
01414             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
01415
01416             }
01417         RpcFinally
01418             {
01419             NdrProxyFreeBuffer(This, &_StubMsg);
01420
01421             }
01422         RpcEndFinally
01423
01424         }
01425     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01426         {
01427         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01428         }
01429     RpcEndExcept
01430     return _RetVal;
01431 }

void __RPC_STUB ICvsCoworker_UncheckoutFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1433 of file CVS_Coworker_p.c.

01438 {
01439     HRESULT _RetVal;
01440     MIDL_STUB_MESSAGE _StubMsg;
01441     int handle;
01442     const unsigned char *sFilenames;
01443
01444 NdrStubInitialize(
01445                      _pRpcMessage,
01446                      &_StubMsg,
01447                      &Object_StubDesc,
01448                      _pRpcChannelBuffer);
01449     handle = 0;
01450     ( unsigned char * )sFilenames = 0;
01451     RpcTryFinally
01452         {
01453         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01454             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01455
01456         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01457
01458         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01459             {
01460             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01461             }
01462         handle = *(( int * )_StubMsg.Buffer)++;
01463
01464         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01465                                        (unsigned char * *)&sFilenames,
01466                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01467                                        (unsigned char)0 );
01468
01469
01470         *_pdwStubPhase = STUB_CALL_SERVER;
01471         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> UncheckoutFiles(
01472                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01473                    handle,
01474                    sFilenames);
01475
01476         *_pdwStubPhase = STUB_MARSHAL;
01477
01478         _StubMsg.BufferLength = 8;
01479         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01480         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01481         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01482
01483         }
01484     RpcFinally
01485         {
01486         }
01487     RpcEndFinally
01488     _pRpcMessage->BufferLength =
01489         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01490
01491 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_UpdateFiles_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sFilenames,
 |  | BOOL | bDirectories,
 |  | BOOL | bRecurse
 | ) |

Definition at line 901 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

00907 {
00908
00909     HRESULT _RetVal;
00910
00911     RPC_MESSAGE _RpcMessage;
00912
00913     MIDL_STUB_MESSAGE _StubMsg;
00914
00915     RpcTryExcept
00916         {
00917         NdrProxyInitialize(
00918                       ( void *  )This,
00919                       ( PRPC_MESSAGE  )&_RpcMessage,
00920                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00921                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00922                       7);
00923
00924
00925
00926         if(!sFilenames)
00927             {
00928             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00929             }
00930         RpcTryFinally
00931             {
00932
00933             _StubMsg.BufferLength = 24;
00934             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00935                                            (unsigned char *)sFilenames,
00936                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00937
00938             NdrProxyGetBuffer(This, &_StubMsg);
00939             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00940             *(( int * )_StubMsg.Buffer)++ = handle;
00941
00942             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00943                                          (unsigned char *)sFilenames,
00944                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00945
00946             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00947             *(( BOOL * )_StubMsg.Buffer)++ = bDirectories;
00948
00949             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00950             *(( BOOL * )_StubMsg.Buffer)++ = bRecurse;
00951
00952             NdrProxySendReceive(This, &_StubMsg);
00953
00954             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
00955             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
00956
00957             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00958                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
00959
00960             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00961
00962             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00963                 {
00964                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
00965                 }
00966             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
00967
00968             }
00969         RpcFinally
00970             {
00971             NdrProxyFreeBuffer(This, &_StubMsg);
00972
00973             }
00974         RpcEndFinally
00975
00976         }
00977     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00978         {
00979         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00980         }
00981     RpcEndExcept
00982     return _RetVal;
00983 }

void __RPC_STUB ICvsCoworker_UpdateFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 985 of file CVS_Coworker_p.c.

00990 {
00991     HRESULT _RetVal;
00992     MIDL_STUB_MESSAGE _StubMsg;
00993     BOOL bDirectories;
00994     BOOL bRecurse;
00995     int handle;
00996     const unsigned char *sFilenames;
00997
00998 NdrStubInitialize(
00999                      _pRpcMessage,
01000                      &_StubMsg,
01001                      &Object_StubDesc,
01002                      _pRpcChannelBuffer);
01003     handle = 0;
01004     ( unsigned char * )sFilenames = 0;
01005     bDirectories = 0;
01006     bRecurse = 0;
01007     RpcTryFinally
01008         {
01009         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01010             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
01011
01012         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01013
01014         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01015             {
01016             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01017             }
01018         handle = *(( int * )_StubMsg.Buffer)++;
01019
01020         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01021                                        (unsigned char * *)&sFilenames,
01022                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01023                                        (unsigned char)0 );
01024
01025         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01026
01027         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01028             {
01029             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01030             }
01031         bDirectories = *(( BOOL * )_StubMsg.Buffer)++;
01032
01033         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01034
01035         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01036             {
01037             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01038             }
01039         bRecurse = *(( BOOL * )_StubMsg.Buffer)++;
01040
01041
01042         *_pdwStubPhase = STUB_CALL_SERVER;
01043         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> UpdateFiles(
01044                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01045                handle,
01046                sFilenames,
01047                bDirectories,
01048                bRecurse);
01049
01050         *_pdwStubPhase = STUB_MARSHAL;
01051
01052         _StubMsg.BufferLength = 8;
01053         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01054         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01055         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01056
01057         }
01058     RpcFinally
01059         {
01060         }
01061     RpcEndFinally
01062     _pRpcMessage->BufferLength =
01063         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01064
01065 }

void* __RPC_USER MIDL_user_allocate ( size_t )

Referenced by ICvsCoworker_GetLastError_Proxy.

void __RPC_USER MIDL_user_free ( void * )

Referenced by ICvsCoworker_GetLastError_Proxy.

virtual HRESULT STDMETHODCALLTYPE OpenProject | ( | int * | pHandle,
 |  | const unsigned char * | sUsername,
 |  | const unsigned char * | sProjectName,
 |  | const unsigned char * | sProjectHome
 | ) | [pure virtual]

Referenced by ICvsCoworker_OpenProject_Stub.

virtual HRESULT STDMETHODCALLTYPE RemoveFiles | ( | int | handle,
 |  | const unsigned char * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub, and ICvsCoworker_RemoveFiles_Stub.

virtual HRESULT STDMETHODCALLTYPE RenameFile | ( | int | handle,
 |  | const unsigned char * | sOldFilename,
 |  | const unsigned char * | sNewFilename
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub, and ICvsCoworker_RenameFile_Stub.

virtual HRESULT STDMETHODCALLTYPE ShowAdvancedOptionsForCommand | ( | int | handle,
 |  | CvsCommand | command
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub, and ICvsCoworker_ShowAdvancedOptionsForCommand_Stub.

virtual HRESULT STDMETHODCALLTYPE ShowFileHistory | ( | int | handle,
 |  | const unsigned char * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub, and ICvsCoworker_ShowFileHistory_Stub.

virtual HRESULT STDMETHODCALLTYPE ShowFileProperties | ( | int | handle,
 |  | const unsigned char * | sFilename
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub, and ICvsCoworker_ShowFileProperties_Stub.

virtual HRESULT STDMETHODCALLTYPE ShowUserInterface | ( | int | handle,
 |  | const unsigned char * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub, and ICvsCoworker_ShowUserInterface_Stub.

virtual HRESULT STDMETHODCALLTYPE UncheckoutFiles | ( | int | handle,
 |  | const unsigned char * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_UncheckoutFiles_Stub.

virtual HRESULT STDMETHODCALLTYPE UpdateFiles | ( | int | handle,
 |  | const unsigned char * | sFilenames,
 |  | BOOL | bDirectories,
 |  | BOOL | bRecurse
 | ) | [pure virtual]

Referenced by ICvsCoworker_UpdateFiles_Stub.

Variable Documentation

RPC_IF_HANDLE __MIDL_itf_CVS_Coworker_0000_v0_0_c_ifspec

Definition at line 103 of file CVS_Coworker.h.

RPC_IF_HANDLE __MIDL_itf_CVS_Coworker_0000_v0_0_s_ifspec

Definition at line 104 of file CVS_Coworker.h.

ICvsCoworker __pad2__

Definition at line 122 of file CVS_Coworker.h.

EXTERN_C const CLSID CLSID_CvsCoworker

Definition at line 744 of file CVS_Coworker.h.

CvsCommand

Definition at line 99 of file CVS_Coworker.h.

Referenced by DECLSPEC_UUID, ICvsCoworker_GetErrorMessage_Proxy, ICvsCoworker_GetErrorMessage_Stub, ICvsCoworker_GetLastError_Stub, and ICvsCoworker_GetProject_Proxy.

CvsOption

Definition at line 84 of file CVS_Coworker.h.

Referenced by DECLSPEC_UUID.

EXTERN_C const IID IID_ICvsCoworker

Definition at line 113 of file CVS_Coworker.h.

EXTERN_C const IID LIBID_CVS_COWORKERLib

Definition at line 742 of file CVS_Coworker.h.

ICvsCoworker int* piError = 0

Definition at line 123 of file CVS_Coworker.h.

Referenced by ICvsCoworker_OpenProject_Proxy.

Generated on Sun Feb 24 01:23:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CVS_Coworker_i.c File Reference

WinCvs/CVS_Coworker_i.c File Reference

#include <rpc.h>
#include <rpcndr.h>

Include dependency graph for CVS_Coworker_i.c:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

struct | _IID

Defines

#define | MIDL_DEFINE_GUID(type, name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}

Typedefs

typedef _IID | IID
typedef IID | CLSID

Variables

const IID | IID_ICvsCoworker = { 0x10E5359C , 0xF454 , 0x11D2 ,{ 0xB4 , 0x42 , 0x00 , 0x80 , 0xC6 , 0xF9 , 0x17 , 0x9D }}
const IID | LIBID_CVS_COWORKERLib = { 0x10E53590 , 0xF454 , 0x11D2 ,{ 0xB4 , 0x42 , 0x00 , 0x80 , 0xC6 , 0xF9 , 0x17 , 0x9D }}
const CLSID | CLSID_CvsCoworker = { 0x10E5359D , 0xF454 , 0x11D2 ,{ 0xB4 , 0x42 , 0x00 , 0x80 , 0xC6 , 0xF9 , 0x17 , 0x9D }}

Define Documentation

#define MIDL_DEFINE_GUID | ( | type,
 |  | name,
 |  | l,
 |  | w1,
 |  | w2,
 |  | b1,
 |  | b2,
 |  | b3,
 |  | b4,
 |  | b5,
 |  | b6,
 |  | b7,
 |  | b8 | ) | const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}

Definition at line 65 of file CVS_Coworker_i.c.

Typedef Documentation

typedef IID CLSID

Definition at line 62 of file CVS_Coworker_i.c.

typedef struct _IID IID

Variable Documentation

const CLSID CLSID_CvsCoworker = { 0x10E5359D , 0xF454 , 0x11D2 ,{ 0xB4 , 0x42 , 0x00 , 0x80 , 0xC6 , 0xF9 , 0x17 , 0x9D }}

Definition at line 76 of file CVS_Coworker_i.c.

const IID IID_ICvsCoworker = { 0x10E5359C , 0xF454 , 0x11D2 ,{ 0xB4 , 0x42 , 0x00 , 0x80 , 0xC6 , 0xF9 , 0x17 , 0x9D }}

Definition at line 70 of file CVS_Coworker_i.c.

const IID LIBID_CVS_COWORKERLib = { 0x10E53590 , 0xF454 , 0x11D2 ,{ 0xB4 , 0x42 , 0x00 , 0x80 , 0xC6 , 0xF9 , 0x17 , 0x9D }}

Definition at line 73 of file CVS_Coworker_i.c.

Generated on Sun Feb 24 01:23:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CVS_Coworker_p.c File Reference

WinCvs/CVS_Coworker_p.c File Reference

#include "rpcproxy.h"
#include "CVS_Coworker.h"

Include dependency graph for CVS_Coworker_p.c:

Include dependency graph

Go to the source code of this file.

Compounds

struct | _MIDL_PROC_FORMAT_STRING
struct | _MIDL_TYPE_FORMAT_STRING

Defines

#define | __REQUIRED_RPCPROXY_H_VERSION__ 440
#define | TYPE_FORMAT_STRING_SIZE 65
#define | PROC_FORMAT_STRING_SIZE 151
#define | TRANSMIT_AS_TABLE_SIZE 0
#define | WIRE_MARSHAL_TABLE_SIZE 0
#define | _CVS_Coworker_CHECK_IID(n) IID_GENERIC_CHECK_IID( _CVS_Coworker, pIID, n)

Typedefs

typedef _MIDL_TYPE_FORMAT_STRING | MIDL_TYPE_FORMAT_STRING
typedef _MIDL_PROC_FORMAT_STRING | MIDL_PROC_FORMAT_STRING

Functions

HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetLastError_Proxy (ICvsCoworker *This, int handle, int *piError)
void __RPC_STUB | ICvsCoworker_GetLastError_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetErrorMessage_Proxy (ICvsCoworker *This, int handle, int iError, int cbErrorBuffer, unsigned char *sErrorBuffer)
void __RPC_STUB | ICvsCoworker_GetErrorMessage_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_OpenProject_Proxy (ICvsCoworker *This, int *pHandle, const unsigned char *sUsername, const unsigned char *sProjectName, const unsigned char *sProjectHome)
void __RPC_STUB | ICvsCoworker_OpenProject_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetProject_Proxy (ICvsCoworker *This, int *pHandle, const unsigned char *sUsername, int cbProjectNameBuffer, unsigned char *sProjectName, int cbProjectHomeBuffer, unsigned char *sProjectHome, BOOL bAllowPathChange, BOOL bAllowNewProject, BOOL *pbNewProject)
void __RPC_STUB | ICvsCoworker_GetProject_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_UpdateFiles_Proxy (ICvsCoworker *This, int handle, const unsigned char *sFilenames, BOOL bDirectories, BOOL bRecurse)
void __RPC_STUB | ICvsCoworker_UpdateFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_CheckoutFiles_Proxy (ICvsCoworker *This, int handle, const unsigned char *sFilenames)
void __RPC_STUB | ICvsCoworker_CheckoutFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_CheckinFiles_Proxy (ICvsCoworker *This, int handle, const unsigned char *sFilenames, BOOL bKeepCheckedOut)
void __RPC_STUB | ICvsCoworker_CheckinFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_UncheckoutFiles_Proxy (ICvsCoworker *This, int handle, const unsigned char *sFilenames)
void __RPC_STUB | ICvsCoworker_UncheckoutFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_AddFiles_Proxy (ICvsCoworker *This, int handle, const unsigned char *sOptionsAndFilenames, const unsigned char *sComment)
void __RPC_STUB | ICvsCoworker_AddFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_RemoveFiles_Proxy (ICvsCoworker *This, int handle, const unsigned char *sFilenames)
void __RPC_STUB | ICvsCoworker_RemoveFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_RenameFile_Proxy (ICvsCoworker *This, int handle, const unsigned char *sOldFilename, const unsigned char *sNewFilename)
void __RPC_STUB | ICvsCoworker_RenameFile_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_DiffFile_Proxy (ICvsCoworker *This, int handle, const unsigned char *sFilename, BOOL bIgnoreCase, BOOL bIgnoreBlanks)
void __RPC_STUB | ICvsCoworker_DiffFile_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowFileHistory_Proxy (ICvsCoworker *This, int handle, const unsigned char *sFilenames)
void __RPC_STUB | ICvsCoworker_ShowFileHistory_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowFileProperties_Proxy (ICvsCoworker *This, int handle, const unsigned char *sFilename)
void __RPC_STUB | ICvsCoworker_ShowFileProperties_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowUserInterface_Proxy (ICvsCoworker *This, int handle, const unsigned char *sFilenames)
void __RPC_STUB | ICvsCoworker_ShowUserInterface_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_HasAdvancedOptionsForCommand_Proxy (ICvsCoworker *This, int handle, CvsCommand command, BOOL *pbAdvancedOptions)
void __RPC_STUB | ICvsCoworker_HasAdvancedOptionsForCommand_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy (ICvsCoworker *This, int handle, CvsCommand command)
void __RPC_STUB | ICvsCoworker_ShowAdvancedOptionsForCommand_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetFileChanges_Proxy (ICvsCoworker *This, int handle, int cbFilenameBuffer, unsigned char *sFilenameBuffer)
void __RPC_STUB | ICvsCoworker_GetFileChanges_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetFilesToAdd_Proxy (ICvsCoworker *This, int handle, int cbFilenamesBuffer, unsigned char *sFilenamesBuffer)
void __RPC_STUB | ICvsCoworker_GetFilesToAdd_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_CloseProject_Proxy (ICvsCoworker *This, int handle)
void __RPC_STUB | ICvsCoworker_CloseProject_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
const | CINTERFACE_PROXY_VTABLE (23) _ICvsCoworkerProxyVtbl=
int __stdcall | _CVS_Coworker_IID_Lookup (const IID *pIID, int *pIndex)

Variables

RPC_SYNTAX_IDENTIFIER | _RpcTransferSyntax
const MIDL_TYPE_FORMAT_STRING | __MIDL_TypeFormatString
const MIDL_PROC_FORMAT_STRING | __MIDL_ProcFormatString
const MIDL_STUB_DESC | Object_StubDesc
const MIDL_SERVER_INFO | ICvsCoworker_ServerInfo
const MIDL_STUBLESS_PROXY_INFO | ICvsCoworker_ProxyInfo
const unsigned short | ICvsCoworker_FormatStringOffsetTable []
const PRPC_STUB_FUNCTION | ICvsCoworker_table []
const CInterfaceStubVtbl | _ICvsCoworkerStubVtbl
const CInterfaceProxyVtbl * | _CVS_Coworker_ProxyVtblList []
const CInterfaceStubVtbl * | _CVS_Coworker_StubVtblList []
PCInterfaceName const | _CVS_Coworker_InterfaceNamesList []
const ExtendedProxyFileInfo | CVS_Coworker_ProxyFileInfo

Define Documentation

#define __REQUIRED_RPCPROXY_H_VERSION__ 440

Definition at line 24 of file CVS_Coworker_p.c.

#define _CVS_Coworker_CHECK_IID ( n ) IID_GENERIC_CHECK_IID( _CVS_Coworker, pIID, n)

Definition at line 3656 of file CVS_Coworker_p.c.

Referenced by _CVS_Coworker_IID_Lookup.

#define PROC_FORMAT_STRING_SIZE 151

Definition at line 37 of file CVS_Coworker_p.c.

#define TRANSMIT_AS_TABLE_SIZE 0

Definition at line 38 of file CVS_Coworker_p.c.

#define TYPE_FORMAT_STRING_SIZE 65

Definition at line 36 of file CVS_Coworker_p.c.

#define WIRE_MARSHAL_TABLE_SIZE 0

Definition at line 39 of file CVS_Coworker_p.c.

Typedef Documentation

typedef struct _MIDL_PROC_FORMAT_STRING MIDL_PROC_FORMAT_STRING

typedef struct _MIDL_TYPE_FORMAT_STRING MIDL_TYPE_FORMAT_STRING

Function Documentation

int __stdcall _CVS_Coworker_IID_Lookup | ( | const IID * | pIID,
 |  | int * | pIndex
 | ) |

Definition at line 3658 of file CVS_Coworker_p.c.

References _CVS_Coworker_CHECK_IID.

03659 {
03660
03661     if(!_CVS_Coworker_CHECK_IID(0))
03662         {
03663         *pIndex = 0;
03664         return 1;
03665         }
03666
03667     return 0;
03668 }

const CINTERFACE_PROXY_VTABLE ( 23 )

Definition at line 3551 of file CVS_Coworker_p.c.

References ICvsCoworker_AddFiles_Proxy, ICvsCoworker_CheckinFiles_Proxy, ICvsCoworker_CheckoutFiles_Proxy, ICvsCoworker_CloseProject_Proxy, ICvsCoworker_DiffFile_Proxy, ICvsCoworker_GetErrorMessage_Proxy, ICvsCoworker_GetFileChanges_Proxy, ICvsCoworker_GetFilesToAdd_Proxy, ICvsCoworker_GetLastError_Proxy, ICvsCoworker_GetProject_Proxy, ICvsCoworker_HasAdvancedOptionsForCommand_Proxy, ICvsCoworker_OpenProject_Proxy, ICvsCoworker_RemoveFiles_Proxy, ICvsCoworker_RenameFile_Proxy, ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy, ICvsCoworker_ShowFileHistory_Proxy, ICvsCoworker_ShowFileProperties_Proxy, ICvsCoworker_ShowUserInterface_Proxy, ICvsCoworker_UncheckoutFiles_Proxy, and ICvsCoworker_UpdateFiles_Proxy.

03552 {
03553     &IID_ICvsCoworker,
03554     IUnknown_QueryInterface_Proxy,
03555     IUnknown_AddRef_Proxy,
03556     IUnknown_Release_Proxy ,
03557     ICvsCoworker_GetLastError_Proxy ,
03558     ICvsCoworker_GetErrorMessage_Proxy ,
03559     ICvsCoworker_OpenProject_Proxy ,
03560     ICvsCoworker_GetProject_Proxy ,
03561     ICvsCoworker_UpdateFiles_Proxy ,
03562     ICvsCoworker_CheckoutFiles_Proxy ,
03563     ICvsCoworker_CheckinFiles_Proxy ,
03564     ICvsCoworker_UncheckoutFiles_Proxy ,
03565     ICvsCoworker_AddFiles_Proxy ,
03566     ICvsCoworker_RemoveFiles_Proxy ,
03567     ICvsCoworker_RenameFile_Proxy ,
03568     ICvsCoworker_DiffFile_Proxy ,
03569     ICvsCoworker_ShowFileHistory_Proxy ,
03570     ICvsCoworker_ShowFileProperties_Proxy ,
03571     ICvsCoworker_ShowUserInterface_Proxy ,
03572     ICvsCoworker_HasAdvancedOptionsForCommand_Proxy ,
03573     ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy ,
03574     ICvsCoworker_GetFileChanges_Proxy ,
03575     ICvsCoworker_GetFilesToAdd_Proxy ,
03576     ICvsCoworker_CloseProject_Proxy
03577 };

HRESULT STDMETHODCALLTYPE ICvsCoworker_AddFiles_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sOptionsAndFilenames,
 |  | const unsigned char * | sComment
 | ) |

Definition at line 1494 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_FORMAT_STRING::Format, and Object_StubDesc.

01499 {
01500
01501     HRESULT _RetVal;
01502
01503     RPC_MESSAGE _RpcMessage;
01504
01505     MIDL_STUB_MESSAGE _StubMsg;
01506
01507     RpcTryExcept
01508         {
01509         NdrProxyInitialize(
01510                       ( void *  )This,
01511                       ( PRPC_MESSAGE  )&_RpcMessage,
01512                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01513                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01514                       11);
01515
01516
01517
01518         if(!sOptionsAndFilenames)
01519             {
01520             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01521             }
01522         if(!sComment)
01523             {
01524             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01525             }
01526         RpcTryFinally
01527             {
01528
01529             _StubMsg.BufferLength = 8;
01530             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01531                                            (unsigned char *)sOptionsAndFilenames,
01532                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01533
01534             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01535                                            (unsigned char *)sComment,
01536                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01537
01538             NdrProxyGetBuffer(This, &_StubMsg);
01539             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01540             *(( int * )_StubMsg.Buffer)++ = handle;
01541
01542             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01543                                          (unsigned char *)sOptionsAndFilenames,
01544                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01545
01546             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01547                                          (unsigned char *)sComment,
01548                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01549
01550             NdrProxySendReceive(This, &_StubMsg);
01551
01552             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
01553             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
01554
01555             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01556                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01557
01558             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01559
01560             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01561                 {
01562                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
01563                 }
01564             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
01565
01566             }
01567         RpcFinally
01568             {
01569             NdrProxyFreeBuffer(This, &_StubMsg);
01570
01571             }
01572         RpcEndFinally
01573
01574         }
01575     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01576         {
01577         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01578         }
01579     RpcEndExcept
01580     return _RetVal;
01581 }

void __RPC_STUB ICvsCoworker_AddFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1583 of file CVS_Coworker_p.c.

References AddFiles, _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and Object_StubDesc.

01588 {
01589     HRESULT _RetVal;
01590     MIDL_STUB_MESSAGE _StubMsg;
01591     int handle;
01592     const unsigned char *sComment;
01593     const unsigned char *sOptionsAndFilenames;
01594
01595 NdrStubInitialize(
01596                      _pRpcMessage,
01597                      &_StubMsg,
01598                      &Object_StubDesc,
01599                      _pRpcChannelBuffer);
01600     handle = 0;
01601     ( unsigned char * )sOptionsAndFilenames = 0;
01602     ( unsigned char * )sComment = 0;
01603     RpcTryFinally
01604         {
01605         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01606             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01607
01608         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01609
01610         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01611             {
01612             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01613             }
01614         handle = *(( int * )_StubMsg.Buffer)++;
01615
01616         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01617                                        (unsigned char * *)&sOptionsAndFilenames,
01618                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01619                                        (unsigned char)0 );
01620
01621         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01622                                        (unsigned char * *)&sComment,
01623                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01624                                        (unsigned char)0 );
01625
01626
01627         *_pdwStubPhase = STUB_CALL_SERVER;
01628         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> AddFiles(
01629             (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01630             handle,
01631             sOptionsAndFilenames,
01632             sComment);
01633
01634         *_pdwStubPhase = STUB_MARSHAL;
01635
01636         _StubMsg.BufferLength = 8;
01637         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01638         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01639         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01640
01641         }
01642     RpcFinally
01643         {
01644         }
01645     RpcEndFinally
01646     _pRpcMessage->BufferLength =
01647         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01648
01649 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckinFiles_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sFilenames,
 |  | BOOL | bKeepCheckedOut
 | ) |

Definition at line 1205 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_FORMAT_STRING::Format, and Object_StubDesc.

01210 {
01211
01212     HRESULT _RetVal;
01213
01214     RPC_MESSAGE _RpcMessage;
01215
01216     MIDL_STUB_MESSAGE _StubMsg;
01217
01218     RpcTryExcept
01219         {
01220         NdrProxyInitialize(
01221                       ( void *  )This,
01222                       ( PRPC_MESSAGE  )&_RpcMessage,
01223                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01224                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01225                       9);
01226
01227
01228
01229         if(!sFilenames)
01230             {
01231             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01232             }
01233         RpcTryFinally
01234             {
01235
01236             _StubMsg.BufferLength = 16;
01237             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01238                                            (unsigned char *)sFilenames,
01239                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01240
01241             NdrProxyGetBuffer(This, &_StubMsg);
01242             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01243             *(( int * )_StubMsg.Buffer)++ = handle;
01244
01245             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01246                                          (unsigned char *)sFilenames,
01247                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01248
01249             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01250             *(( BOOL * )_StubMsg.Buffer)++ = bKeepCheckedOut;
01251
01252             NdrProxySendReceive(This, &_StubMsg);
01253
01254             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
01255             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
01256
01257             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01258                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] );
01259
01260             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01261
01262             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01263                 {
01264                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
01265                 }
01266             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
01267
01268             }
01269         RpcFinally
01270             {
01271             NdrProxyFreeBuffer(This, &_StubMsg);
01272
01273             }
01274         RpcEndFinally
01275
01276         }
01277     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01278         {
01279         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01280         }
01281     RpcEndExcept
01282     return _RetVal;
01283 }

void __RPC_STUB ICvsCoworker_CheckinFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1285 of file CVS_Coworker_p.c.

References CheckinFiles, _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and Object_StubDesc.

01290 {
01291     HRESULT _RetVal;
01292     MIDL_STUB_MESSAGE _StubMsg;
01293     BOOL bKeepCheckedOut;
01294     int handle;
01295     const unsigned char *sFilenames;
01296
01297 NdrStubInitialize(
01298                      _pRpcMessage,
01299                      &_StubMsg,
01300                      &Object_StubDesc,
01301                      _pRpcChannelBuffer);
01302     handle = 0;
01303     ( unsigned char * )sFilenames = 0;
01304     bKeepCheckedOut = 0;
01305     RpcTryFinally
01306         {
01307         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01308             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] );
01309
01310         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01311
01312         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01313             {
01314             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01315             }
01316         handle = *(( int * )_StubMsg.Buffer)++;
01317
01318         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01319                                        (unsigned char * *)&sFilenames,
01320                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01321                                        (unsigned char)0 );
01322
01323         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01324
01325         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01326             {
01327             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01328             }
01329         bKeepCheckedOut = *(( BOOL * )_StubMsg.Buffer)++;
01330
01331
01332         *_pdwStubPhase = STUB_CALL_SERVER;
01333         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CheckinFiles(
01334                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01335                 handle,
01336                 sFilenames,
01337                 bKeepCheckedOut);
01338
01339         *_pdwStubPhase = STUB_MARSHAL;
01340
01341         _StubMsg.BufferLength = 8;
01342         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01343         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01344         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01345
01346         }
01347     RpcFinally
01348         {
01349         }
01350     RpcEndFinally
01351     _pRpcMessage->BufferLength =
01352         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01353
01354 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckoutFiles_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sFilenames
 | ) |

Definition at line 1068 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_FORMAT_STRING::Format, and Object_StubDesc.

01072 {
01073
01074     HRESULT _RetVal;
01075
01076     RPC_MESSAGE _RpcMessage;
01077
01078     MIDL_STUB_MESSAGE _StubMsg;
01079
01080     RpcTryExcept
01081         {
01082         NdrProxyInitialize(
01083                       ( void *  )This,
01084                       ( PRPC_MESSAGE  )&_RpcMessage,
01085                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01086                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01087                       8);
01088
01089
01090
01091         if(!sFilenames)
01092             {
01093             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01094             }
01095         RpcTryFinally
01096             {
01097
01098             _StubMsg.BufferLength = 8;
01099             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01100                                            (unsigned char *)sFilenames,
01101                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01102
01103             NdrProxyGetBuffer(This, &_StubMsg);
01104             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01105             *(( int * )_StubMsg.Buffer)++ = handle;
01106
01107             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01108                                          (unsigned char *)sFilenames,
01109                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01110
01111             NdrProxySendReceive(This, &_StubMsg);
01112
01113             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
01114             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
01115
01116             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01117                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01118
01119             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01120
01121             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01122                 {
01123                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
01124                 }
01125             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
01126
01127             }
01128         RpcFinally
01129             {
01130             NdrProxyFreeBuffer(This, &_StubMsg);
01131
01132             }
01133         RpcEndFinally
01134
01135         }
01136     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01137         {
01138         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01139         }
01140     RpcEndExcept
01141     return _RetVal;
01142 }

void __RPC_STUB ICvsCoworker_CheckoutFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1144 of file CVS_Coworker_p.c.

References CheckoutFiles, _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and Object_StubDesc.

01149 {
01150     HRESULT _RetVal;
01151     MIDL_STUB_MESSAGE _StubMsg;
01152     int handle;
01153     const unsigned char *sFilenames;
01154
01155 NdrStubInitialize(
01156                      _pRpcMessage,
01157                      &_StubMsg,
01158                      &Object_StubDesc,
01159                      _pRpcChannelBuffer);
01160     handle = 0;
01161     ( unsigned char * )sFilenames = 0;
01162     RpcTryFinally
01163         {
01164         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01165             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01166
01167         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01168
01169         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01170             {
01171             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01172             }
01173         handle = *(( int * )_StubMsg.Buffer)++;
01174
01175         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01176                                        (unsigned char * *)&sFilenames,
01177                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01178                                        (unsigned char)0 );
01179
01180
01181         *_pdwStubPhase = STUB_CALL_SERVER;
01182         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CheckoutFiles(
01183                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01184                  handle,
01185                  sFilenames);
01186
01187         *_pdwStubPhase = STUB_MARSHAL;
01188
01189         _StubMsg.BufferLength = 8;
01190         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01191         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01192         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01193
01194         }
01195     RpcFinally
01196         {
01197         }
01198     RpcEndFinally
01199     _pRpcMessage->BufferLength =
01200         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01201
01202 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_CloseProject_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle
 | ) |

Definition at line 3147 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, and Object_StubDesc.

03150 {
03151
03152     HRESULT _RetVal;
03153
03154     RPC_MESSAGE _RpcMessage;
03155
03156     MIDL_STUB_MESSAGE _StubMsg;
03157
03158     RpcTryExcept
03159         {
03160         NdrProxyInitialize(
03161                       ( void *  )This,
03162                       ( PRPC_MESSAGE  )&_RpcMessage,
03163                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
03164                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
03165                       22);
03166
03167
03168
03169         RpcTryFinally
03170             {
03171
03172             _StubMsg.BufferLength = 8;
03173             NdrProxyGetBuffer(This, &_StubMsg);
03174             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03175             *(( int * )_StubMsg.Buffer)++ = handle;
03176
03177             NdrProxySendReceive(This, &_StubMsg);
03178
03179             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
03180             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
03181
03182             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
03183                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[146] );
03184
03185             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03186
03187             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
03188                 {
03189                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
03190                 }
03191             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
03192
03193             }
03194         RpcFinally
03195             {
03196             NdrProxyFreeBuffer(This, &_StubMsg);
03197
03198             }
03199         RpcEndFinally
03200
03201         }
03202     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
03203         {
03204         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
03205         }
03206     RpcEndExcept
03207     return _RetVal;
03208 }

void __RPC_STUB ICvsCoworker_CloseProject_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 3210 of file CVS_Coworker_p.c.

References CloseProject, _MIDL_PROC_FORMAT_STRING::Format, and Object_StubDesc.

03215 {
03216     HRESULT _RetVal;
03217     MIDL_STUB_MESSAGE _StubMsg;
03218     int handle;
03219
03220 NdrStubInitialize(
03221                      _pRpcMessage,
03222                      &_StubMsg,
03223                      &Object_StubDesc,
03224                      _pRpcChannelBuffer);
03225     handle = 0;
03226     RpcTryFinally
03227         {
03228         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
03229             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[146] );
03230
03231         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03232
03233         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
03234             {
03235             RpcRaiseException(RPC_X_BAD_STUB_DATA);
03236             }
03237         handle = *(( int * )_StubMsg.Buffer)++;
03238
03239
03240         *_pdwStubPhase = STUB_CALL_SERVER;
03241         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CloseProject((ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,handle);
03242
03243         *_pdwStubPhase = STUB_MARSHAL;
03244
03245         _StubMsg.BufferLength = 8;
03246         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
03247         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03248         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
03249
03250         }
03251     RpcFinally
03252         {
03253         }
03254     RpcEndFinally
03255     _pRpcMessage->BufferLength =
03256         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
03257
03258 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_DiffFile_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sFilename,
 |  | BOOL | bIgnoreCase,
 |  | BOOL | bIgnoreBlanks
 | ) |

Definition at line 1947 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_FORMAT_STRING::Format, and Object_StubDesc.

01953 {
01954
01955     HRESULT _RetVal;
01956
01957     RPC_MESSAGE _RpcMessage;
01958
01959     MIDL_STUB_MESSAGE _StubMsg;
01960
01961     RpcTryExcept
01962         {
01963         NdrProxyInitialize(
01964                       ( void *  )This,
01965                       ( PRPC_MESSAGE  )&_RpcMessage,
01966                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01967                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01968                       14);
01969
01970
01971
01972         if(!sFilename)
01973             {
01974             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01975             }
01976         RpcTryFinally
01977             {
01978
01979             _StubMsg.BufferLength = 24;
01980             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01981                                            (unsigned char *)sFilename,
01982                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01983
01984             NdrProxyGetBuffer(This, &_StubMsg);
01985             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01986             *(( int * )_StubMsg.Buffer)++ = handle;
01987
01988             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01989                                          (unsigned char *)sFilename,
01990                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01991
01992             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01993             *(( BOOL * )_StubMsg.Buffer)++ = bIgnoreCase;
01994
01995             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01996             *(( BOOL * )_StubMsg.Buffer)++ = bIgnoreBlanks;
01997
01998             NdrProxySendReceive(This, &_StubMsg);
01999
02000             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02001             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02002
02003             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02004                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
02005
02006             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02007
02008             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02009                 {
02010                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02011                 }
02012             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02013
02014             }
02015         RpcFinally
02016             {
02017             NdrProxyFreeBuffer(This, &_StubMsg);
02018
02019             }
02020         RpcEndFinally
02021
02022         }
02023     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02024         {
02025         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02026         }
02027     RpcEndExcept
02028     return _RetVal;
02029 }

void __RPC_STUB ICvsCoworker_DiffFile_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2031 of file CVS_Coworker_p.c.

References DiffFile, _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and Object_StubDesc.

02036 {
02037     HRESULT _RetVal;
02038     MIDL_STUB_MESSAGE _StubMsg;
02039     BOOL bIgnoreBlanks;
02040     BOOL bIgnoreCase;
02041     int handle;
02042     const unsigned char *sFilename;
02043
02044 NdrStubInitialize(
02045                      _pRpcMessage,
02046                      &_StubMsg,
02047                      &Object_StubDesc,
02048                      _pRpcChannelBuffer);
02049     handle = 0;
02050     ( unsigned char * )sFilename = 0;
02051     bIgnoreCase = 0;
02052     bIgnoreBlanks = 0;
02053     RpcTryFinally
02054         {
02055         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02056             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
02057
02058         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02059
02060         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02061             {
02062             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02063             }
02064         handle = *(( int * )_StubMsg.Buffer)++;
02065
02066         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02067                                        (unsigned char * *)&sFilename,
02068                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02069                                        (unsigned char)0 );
02070
02071         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02072
02073         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02074             {
02075             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02076             }
02077         bIgnoreCase = *(( BOOL * )_StubMsg.Buffer)++;
02078
02079         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02080
02081         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02082             {
02083             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02084             }
02085         bIgnoreBlanks = *(( BOOL * )_StubMsg.Buffer)++;
02086
02087
02088         *_pdwStubPhase = STUB_CALL_SERVER;
02089         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> DiffFile(
02090             (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02091             handle,
02092             sFilename,
02093             bIgnoreCase,
02094             bIgnoreBlanks);
02095
02096         *_pdwStubPhase = STUB_MARSHAL;
02097
02098         _StubMsg.BufferLength = 8;
02099         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02100         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02101         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02102
02103         }
02104     RpcFinally
02105         {
02106         }
02107     RpcEndFinally
02108     _pRpcMessage->BufferLength =
02109         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02110
02111 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetErrorMessage_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | int | iError,
 |  | int | cbErrorBuffer,
 |  | unsigned char * | sErrorBuffer
 | ) |

Definition at line 205 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and Object_StubDesc.

00211 {
00212
00213     HRESULT _RetVal;
00214
00215     RPC_MESSAGE _RpcMessage;
00216
00217     MIDL_STUB_MESSAGE _StubMsg;
00218
00219     RpcTryExcept
00220         {
00221         NdrProxyInitialize(
00222                       ( void *  )This,
00223                       ( PRPC_MESSAGE  )&_RpcMessage,
00224                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00225                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00226                       4);
00227
00228
00229
00230         if(!sErrorBuffer)
00231             {
00232             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00233             }
00234         RpcTryFinally
00235             {
00236
00237             _StubMsg.BufferLength = 24;
00238             NdrProxyGetBuffer(This, &_StubMsg);
00239             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00240             *(( int * )_StubMsg.Buffer)++ = handle;
00241
00242             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00243             *(( int * )_StubMsg.Buffer)++ = iError;
00244
00245             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00246             *(( int * )_StubMsg.Buffer)++ = cbErrorBuffer;
00247
00248             NdrProxySendReceive(This, &_StubMsg);
00249
00250             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
00251             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
00252
00253             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00254                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] );
00255
00256             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00257                                            (unsigned char * *)&sErrorBuffer,
00258                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10],
00259                                            (unsigned char)0 );
00260
00261             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00262
00263             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00264                 {
00265                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
00266                 }
00267             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
00268
00269             }
00270         RpcFinally
00271             {
00272             NdrProxyFreeBuffer(This, &_StubMsg);
00273
00274             }
00275         RpcEndFinally
00276
00277         }
00278     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00279         {
00280         _StubMsg.MaxCount = ( unsigned long  )cbErrorBuffer;
00281
00282         NdrClearOutParameters(
00283                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00284                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[6],
00285                          ( void * )sErrorBuffer);
00286         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00287         }
00288     RpcEndExcept
00289     return _RetVal;
00290 }

void __RPC_STUB ICvsCoworker_GetErrorMessage_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 292 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, GetErrorMessage, and Object_StubDesc.

00297 {
00298     HRESULT _RetVal;
00299     MIDL_STUB_MESSAGE _StubMsg;
00300     int cbErrorBuffer;
00301     int handle;
00302     int iError;
00303     unsigned char *sErrorBuffer;
00304
00305 NdrStubInitialize(
00306                      _pRpcMessage,
00307                      &_StubMsg,
00308                      &Object_StubDesc,
00309                      _pRpcChannelBuffer);
00310     handle = 0;
00311     iError = 0;
00312     cbErrorBuffer = 0;
00313     ( unsigned char * )sErrorBuffer = 0;
00314     RpcTryFinally
00315         {
00316         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00317             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] );
00318
00319         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00320
00321         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00322             {
00323             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00324             }
00325         handle = *(( int * )_StubMsg.Buffer)++;
00326
00327         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00328
00329         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00330             {
00331             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00332             }
00333         iError = *(( int * )_StubMsg.Buffer)++;
00334
00335         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00336
00337         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00338             {
00339             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00340             }
00341         cbErrorBuffer = *(( int * )_StubMsg.Buffer)++;
00342
00343         if(cbErrorBuffer * 1 < 0)
00344             {
00345             RpcRaiseException(RPC_X_INVALID_BOUND);
00346             }
00347         sErrorBuffer = NdrAllocate(&_StubMsg,cbErrorBuffer * 1);
00348
00349         *_pdwStubPhase = STUB_CALL_SERVER;
00350         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetErrorMessage(
00351                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00352                    handle,
00353                    iError,
00354                    cbErrorBuffer,
00355                    sErrorBuffer);
00356
00357         *_pdwStubPhase = STUB_MARSHAL;
00358
00359         _StubMsg.BufferLength = 8;
00360         _StubMsg.MaxCount = ( unsigned long  )cbErrorBuffer;
00361
00362         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00363                                        (unsigned char *)sErrorBuffer,
00364                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10] );
00365
00366         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00367         _StubMsg.MaxCount = ( unsigned long  )cbErrorBuffer;
00368
00369         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00370                                      (unsigned char *)sErrorBuffer,
00371                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10] );
00372
00373         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00374         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
00375
00376         }
00377     RpcFinally
00378         {
00379         _StubMsg.MaxCount = ( unsigned long  )cbErrorBuffer;
00380
00381         NdrPointerFree( &_StubMsg,
00382                         (unsigned char *)sErrorBuffer,
00383                         &__MIDL_TypeFormatString.Format[6] );
00384
00385         }
00386     RpcEndFinally
00387     _pRpcMessage->BufferLength =
00388         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
00389
00390 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFileChanges_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | int | cbFilenameBuffer,
 |  | unsigned char * | sFilenameBuffer
 | ) |

Definition at line 2801 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and Object_StubDesc.

02806 {
02807
02808     HRESULT _RetVal;
02809
02810     RPC_MESSAGE _RpcMessage;
02811
02812     MIDL_STUB_MESSAGE _StubMsg;
02813
02814     RpcTryExcept
02815         {
02816         NdrProxyInitialize(
02817                       ( void *  )This,
02818                       ( PRPC_MESSAGE  )&_RpcMessage,
02819                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02820                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02821                       20);
02822
02823
02824
02825         if(!sFilenameBuffer)
02826             {
02827             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02828             }
02829         RpcTryFinally
02830             {
02831
02832             _StubMsg.BufferLength = 16;
02833             NdrProxyGetBuffer(This, &_StubMsg);
02834             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02835             *(( int * )_StubMsg.Buffer)++ = handle;
02836
02837             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02838             *(( int * )_StubMsg.Buffer)++ = cbFilenameBuffer;
02839
02840             NdrProxySendReceive(This, &_StubMsg);
02841
02842             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02843             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02844
02845             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02846                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[126] );
02847
02848             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02849                                            (unsigned char * *)&sFilenameBuffer,
02850                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48],
02851                                            (unsigned char)0 );
02852
02853             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02854
02855             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02856                 {
02857                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02858                 }
02859             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02860
02861             }
02862         RpcFinally
02863             {
02864             NdrProxyFreeBuffer(This, &_StubMsg);
02865
02866             }
02867         RpcEndFinally
02868
02869         }
02870     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02871         {
02872         _StubMsg.MaxCount = ( unsigned long  )cbFilenameBuffer;
02873
02874         NdrClearOutParameters(
02875                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02876                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[44],
02877                          ( void * )sFilenameBuffer);
02878         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02879         }
02880     RpcEndExcept
02881     return _RetVal;
02882 }

void __RPC_STUB ICvsCoworker_GetFileChanges_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2884 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, GetFileChanges, and Object_StubDesc.

02889 {
02890     HRESULT _RetVal;
02891     MIDL_STUB_MESSAGE _StubMsg;
02892     int cbFilenameBuffer;
02893     int handle;
02894     unsigned char *sFilenameBuffer;
02895
02896 NdrStubInitialize(
02897                      _pRpcMessage,
02898                      &_StubMsg,
02899                      &Object_StubDesc,
02900                      _pRpcChannelBuffer);
02901     handle = 0;
02902     cbFilenameBuffer = 0;
02903     ( unsigned char * )sFilenameBuffer = 0;
02904     RpcTryFinally
02905         {
02906         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02907             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[126] );
02908
02909         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02910
02911         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02912             {
02913             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02914             }
02915         handle = *(( int * )_StubMsg.Buffer)++;
02916
02917         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02918
02919         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02920             {
02921             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02922             }
02923         cbFilenameBuffer = *(( int * )_StubMsg.Buffer)++;
02924
02925         if(cbFilenameBuffer * 1 < 0)
02926             {
02927             RpcRaiseException(RPC_X_INVALID_BOUND);
02928             }
02929         sFilenameBuffer = NdrAllocate(&_StubMsg,cbFilenameBuffer * 1);
02930
02931         *_pdwStubPhase = STUB_CALL_SERVER;
02932         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetFileChanges(
02933                   (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02934                   handle,
02935                   cbFilenameBuffer,
02936                   sFilenameBuffer);
02937
02938         *_pdwStubPhase = STUB_MARSHAL;
02939
02940         _StubMsg.BufferLength = 8;
02941         _StubMsg.MaxCount = ( unsigned long  )cbFilenameBuffer;
02942
02943         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02944                                        (unsigned char *)sFilenameBuffer,
02945                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48] );
02946
02947         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02948         _StubMsg.MaxCount = ( unsigned long  )cbFilenameBuffer;
02949
02950         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02951                                      (unsigned char *)sFilenameBuffer,
02952                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48] );
02953
02954         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02955         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02956
02957         }
02958     RpcFinally
02959         {
02960         _StubMsg.MaxCount = ( unsigned long  )cbFilenameBuffer;
02961
02962         NdrPointerFree( &_StubMsg,
02963                         (unsigned char *)sFilenameBuffer,
02964                         &__MIDL_TypeFormatString.Format[44] );
02965
02966         }
02967     RpcEndFinally
02968     _pRpcMessage->BufferLength =
02969         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02970
02971 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFilesToAdd_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | int | cbFilenamesBuffer,
 |  | unsigned char * | sFilenamesBuffer
 | ) |

Definition at line 2974 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and Object_StubDesc.

02979 {
02980
02981     HRESULT _RetVal;
02982
02983     RPC_MESSAGE _RpcMessage;
02984
02985     MIDL_STUB_MESSAGE _StubMsg;
02986
02987     RpcTryExcept
02988         {
02989         NdrProxyInitialize(
02990                       ( void *  )This,
02991                       ( PRPC_MESSAGE  )&_RpcMessage,
02992                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02993                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02994                       21);
02995
02996
02997
02998         if(!sFilenamesBuffer)
02999             {
03000             RpcRaiseException(RPC_X_NULL_REF_POINTER);
03001             }
03002         RpcTryFinally
03003             {
03004
03005             _StubMsg.BufferLength = 16;
03006             NdrProxyGetBuffer(This, &_StubMsg);
03007             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03008             *(( int * )_StubMsg.Buffer)++ = handle;
03009
03010             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03011             *(( int * )_StubMsg.Buffer)++ = cbFilenamesBuffer;
03012
03013             NdrProxySendReceive(This, &_StubMsg);
03014
03015             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
03016             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
03017
03018             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
03019                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[136] );
03020
03021             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
03022                                            (unsigned char * *)&sFilenamesBuffer,
03023                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58],
03024                                            (unsigned char)0 );
03025
03026             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03027
03028             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
03029                 {
03030                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
03031                 }
03032             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
03033
03034             }
03035         RpcFinally
03036             {
03037             NdrProxyFreeBuffer(This, &_StubMsg);
03038
03039             }
03040         RpcEndFinally
03041
03042         }
03043     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
03044         {
03045         _StubMsg.MaxCount = ( unsigned long  )cbFilenamesBuffer;
03046
03047         NdrClearOutParameters(
03048                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
03049                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[54],
03050                          ( void * )sFilenamesBuffer);
03051         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
03052         }
03053     RpcEndExcept
03054     return _RetVal;
03055 }

void __RPC_STUB ICvsCoworker_GetFilesToAdd_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 3057 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, GetFilesToAdd, and Object_StubDesc.

03062 {
03063     HRESULT _RetVal;
03064     MIDL_STUB_MESSAGE _StubMsg;
03065     int cbFilenamesBuffer;
03066     int handle;
03067     unsigned char *sFilenamesBuffer;
03068
03069 NdrStubInitialize(
03070                      _pRpcMessage,
03071                      &_StubMsg,
03072                      &Object_StubDesc,
03073                      _pRpcChannelBuffer);
03074     handle = 0;
03075     cbFilenamesBuffer = 0;
03076     ( unsigned char * )sFilenamesBuffer = 0;
03077     RpcTryFinally
03078         {
03079         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
03080             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[136] );
03081
03082         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03083
03084         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
03085             {
03086             RpcRaiseException(RPC_X_BAD_STUB_DATA);
03087             }
03088         handle = *(( int * )_StubMsg.Buffer)++;
03089
03090         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03091
03092         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
03093             {
03094             RpcRaiseException(RPC_X_BAD_STUB_DATA);
03095             }
03096         cbFilenamesBuffer = *(( int * )_StubMsg.Buffer)++;
03097
03098         if(cbFilenamesBuffer * 1 < 0)
03099             {
03100             RpcRaiseException(RPC_X_INVALID_BOUND);
03101             }
03102         sFilenamesBuffer = NdrAllocate(&_StubMsg,cbFilenamesBuffer * 1);
03103
03104         *_pdwStubPhase = STUB_CALL_SERVER;
03105         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetFilesToAdd(
03106                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
03107                  handle,
03108                  cbFilenamesBuffer,
03109                  sFilenamesBuffer);
03110
03111         *_pdwStubPhase = STUB_MARSHAL;
03112
03113         _StubMsg.BufferLength = 8;
03114         _StubMsg.MaxCount = ( unsigned long  )cbFilenamesBuffer;
03115
03116         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
03117                                        (unsigned char *)sFilenamesBuffer,
03118                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58] );
03119
03120         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
03121         _StubMsg.MaxCount = ( unsigned long  )cbFilenamesBuffer;
03122
03123         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
03124                                      (unsigned char *)sFilenamesBuffer,
03125                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58] );
03126
03127         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
03128         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
03129
03130         }
03131     RpcFinally
03132         {
03133         _StubMsg.MaxCount = ( unsigned long  )cbFilenamesBuffer;
03134
03135         NdrPointerFree( &_StubMsg,
03136                         (unsigned char *)sFilenamesBuffer,
03137                         &__MIDL_TypeFormatString.Format[54] );
03138
03139         }
03140     RpcEndFinally
03141     _pRpcMessage->BufferLength =
03142         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
03143
03144 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetLastError_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | int * | piError
 | ) |

Definition at line 69 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and Object_StubDesc.

00073 {
00074
00075     HRESULT _RetVal;
00076
00077     RPC_MESSAGE _RpcMessage;
00078
00079     MIDL_STUB_MESSAGE _StubMsg;
00080
00081     RpcTryExcept
00082         {
00083         NdrProxyInitialize(
00084                       ( void *  )This,
00085                       ( PRPC_MESSAGE  )&_RpcMessage,
00086                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00087                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00088                       3);
00089
00090
00091
00092         if(!piError)
00093             {
00094             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00095             }
00096         RpcTryFinally
00097             {
00098
00099             _StubMsg.BufferLength = 8;
00100             NdrProxyGetBuffer(This, &_StubMsg);
00101             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00102             *(( int * )_StubMsg.Buffer)++ = handle;
00103
00104             NdrProxySendReceive(This, &_StubMsg);
00105
00106             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
00107             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
00108
00109             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00110                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
00111
00112             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00113             *piError = *(( int * )_StubMsg.Buffer)++;
00114
00115             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00116
00117             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00118                 {
00119                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
00120                 }
00121             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
00122
00123             }
00124         RpcFinally
00125             {
00126             NdrProxyFreeBuffer(This, &_StubMsg);
00127
00128             }
00129         RpcEndFinally
00130
00131         }
00132     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00133         {
00134         NdrClearOutParameters(
00135                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00136                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00137                          ( void * )piError);
00138         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00139         }
00140     RpcEndExcept
00141     return _RetVal;
00142 }

void __RPC_STUB ICvsCoworker_GetLastError_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 144 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, and Object_StubDesc.

00149 {
00150     int _M0 =   0;
00151     HRESULT _RetVal;
00152     MIDL_STUB_MESSAGE _StubMsg;
00153     int handle;
00154     int *piError;
00155
00156 NdrStubInitialize(
00157                      _pRpcMessage,
00158                      &_StubMsg,
00159                      &Object_StubDesc,
00160                      _pRpcChannelBuffer);
00161     handle = 0;
00162     ( int * )piError = 0;
00163     RpcTryFinally
00164         {
00165         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00166             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
00167
00168         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00169
00170         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00171             {
00172             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00173             }
00174         handle = *(( int * )_StubMsg.Buffer)++;
00175
00176         piError = &_M0;
00177
00178         *_pdwStubPhase = STUB_CALL_SERVER;
00179         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetLastError(
00180                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00181                 handle,
00182                 piError);
00183
00184         *_pdwStubPhase = STUB_MARSHAL;
00185
00186         _StubMsg.BufferLength = 36;
00187         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00188         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00189         *(( int * )_StubMsg.Buffer)++ = *piError;
00190
00191         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00192         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
00193
00194         }
00195     RpcFinally
00196         {
00197         }
00198     RpcEndFinally
00199     _pRpcMessage->BufferLength =
00200         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
00201
00202 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetProject_Proxy | ( | ICvsCoworker * | This,
 |  | int * | pHandle,
 |  | const unsigned char * | sUsername,
 |  | int | cbProjectNameBuffer,
 |  | unsigned char * | sProjectName,
 |  | int | cbProjectHomeBuffer,
 |  | unsigned char * | sProjectHome,
 |  | BOOL | bAllowPathChange,
 |  | BOOL | bAllowNewProject,
 |  | BOOL * | pbNewProject
 | ) |

Definition at line 577 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_FORMAT_STRING::Format, and Object_StubDesc.

00588 {
00589
00590     HRESULT _RetVal;
00591
00592     RPC_MESSAGE _RpcMessage;
00593
00594     MIDL_STUB_MESSAGE _StubMsg;
00595
00596     RpcTryExcept
00597         {
00598         NdrProxyInitialize(
00599                       ( void *  )This,
00600                       ( PRPC_MESSAGE  )&_RpcMessage,
00601                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00602                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00603                       6);
00604
00605
00606
00607         if(!pHandle)
00608             {
00609             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00610             }
00611         if(!sUsername)
00612             {
00613             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00614             }
00615         if(!sProjectName)
00616             {
00617             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00618             }
00619         if(!sProjectHome)
00620             {
00621             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00622             }
00623         if(!pbNewProject)
00624             {
00625             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00626             }
00627         RpcTryFinally
00628             {
00629
00630             _StubMsg.BufferLength = 57;
00631             _StubMsg.MaxCount = ( unsigned long  )cbProjectNameBuffer;
00632
00633             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00634                                            (unsigned char *)sProjectName,
00635                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00636
00637             _StubMsg.MaxCount = ( unsigned long  )cbProjectHomeBuffer;
00638
00639             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00640                                            (unsigned char *)sProjectHome,
00641                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00642
00643             NdrProxyGetBuffer(This, &_StubMsg);
00644             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 0) & ~ 0);
00645             *(( unsigned char * )_StubMsg.Buffer)++ = *sUsername;
00646
00647             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00648             *(( int * )_StubMsg.Buffer)++ = cbProjectNameBuffer;
00649
00650             _StubMsg.MaxCount = ( unsigned long  )cbProjectNameBuffer;
00651
00652             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00653                                          (unsigned char *)sProjectName,
00654                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00655
00656             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00657             *(( int * )_StubMsg.Buffer)++ = cbProjectHomeBuffer;
00658
00659             _StubMsg.MaxCount = ( unsigned long  )cbProjectHomeBuffer;
00660
00661             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00662                                          (unsigned char *)sProjectHome,
00663                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00664
00665             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00666             *(( BOOL * )_StubMsg.Buffer)++ = bAllowPathChange;
00667
00668             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00669             *(( BOOL * )_StubMsg.Buffer)++ = bAllowNewProject;
00670
00671             NdrProxySendReceive(This, &_StubMsg);
00672
00673             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
00674             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
00675
00676             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00677                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[38] );
00678
00679             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00680             *pHandle = *(( int * )_StubMsg.Buffer)++;
00681
00682             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00683                                            (unsigned char * *)&sProjectName,
00684                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28],
00685                                            (unsigned char)0 );
00686
00687             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00688                                            (unsigned char * *)&sProjectHome,
00689                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38],
00690                                            (unsigned char)0 );
00691
00692             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00693             *pbNewProject = *(( BOOL * )_StubMsg.Buffer)++;
00694
00695             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00696
00697             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00698                 {
00699                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
00700                 }
00701             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
00702
00703             }
00704         RpcFinally
00705             {
00706             NdrProxyFreeBuffer(This, &_StubMsg);
00707
00708             }
00709         RpcEndFinally
00710
00711         }
00712     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00713         {
00714         NdrClearOutParameters(
00715                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00716                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00717                          ( void * )pHandle);
00718         _StubMsg.MaxCount = ( unsigned long  )cbProjectNameBuffer;
00719
00720         NdrClearOutParameters(
00721                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00722                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[24],
00723                          ( void * )sProjectName);
00724         _StubMsg.MaxCount = ( unsigned long  )cbProjectHomeBuffer;
00725
00726         NdrClearOutParameters(
00727                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00728                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[34],
00729                          ( void * )sProjectHome);
00730         NdrClearOutParameters(
00731                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00732                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00733                          ( void * )pbNewProject);
00734         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00735         }
00736     RpcEndExcept
00737     return _RetVal;
00738 }

void __RPC_STUB ICvsCoworker_GetProject_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 740 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, GetProject, and Object_StubDesc.

00745 {
00746     int _M14    =   0;
00747     BOOL _M15   =   0;
00748     HRESULT _RetVal;
00749     MIDL_STUB_MESSAGE _StubMsg;
00750     BOOL bAllowNewProject;
00751     BOOL bAllowPathChange;
00752     int cbProjectHomeBuffer;
00753     int cbProjectNameBuffer;
00754     int *pHandle;
00755     BOOL *pbNewProject;
00756     unsigned char *sProjectHome;
00757     unsigned char *sProjectName;
00758     const unsigned char *sUsername;
00759
00760 NdrStubInitialize(
00761                      _pRpcMessage,
00762                      &_StubMsg,
00763                      &Object_StubDesc,
00764                      _pRpcChannelBuffer);
00765     ( int * )pHandle = 0;
00766     ( unsigned char * )sUsername = 0;
00767     cbProjectNameBuffer = 0;
00768     ( unsigned char * )sProjectName = 0;
00769     cbProjectHomeBuffer = 0;
00770     ( unsigned char * )sProjectHome = 0;
00771     bAllowPathChange = 0;
00772     bAllowNewProject = 0;
00773     ( BOOL * )pbNewProject = 0;
00774     RpcTryFinally
00775         {
00776         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00777             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[38] );
00778
00779         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 0) & ~ 0);
00780         sUsername = ( unsigned char * )_StubMsg.Buffer;
00781         _StubMsg.Buffer += sizeof( unsigned char  );
00782
00783         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00784
00785         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00786             {
00787             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00788             }
00789         cbProjectNameBuffer = *(( int * )_StubMsg.Buffer)++;
00790
00791         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00792                                        (unsigned char * *)&sProjectName,
00793                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28],
00794                                        (unsigned char)0 );
00795
00796         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00797
00798         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00799             {
00800             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00801             }
00802         cbProjectHomeBuffer = *(( int * )_StubMsg.Buffer)++;
00803
00804         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00805                                        (unsigned char * *)&sProjectHome,
00806                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38],
00807                                        (unsigned char)0 );
00808
00809         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00810
00811         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00812             {
00813             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00814             }
00815         bAllowPathChange = *(( BOOL * )_StubMsg.Buffer)++;
00816
00817         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00818
00819         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00820             {
00821             RpcRaiseException(RPC_X_BAD_STUB_DATA);
00822             }
00823         bAllowNewProject = *(( BOOL * )_StubMsg.Buffer)++;
00824
00825         pHandle = &_M14;
00826         pbNewProject = &_M15;
00827
00828         *_pdwStubPhase = STUB_CALL_SERVER;
00829         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetProject(
00830               (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00831               pHandle,
00832               sUsername,
00833               cbProjectNameBuffer,
00834               sProjectName,
00835               cbProjectHomeBuffer,
00836               sProjectHome,
00837               bAllowPathChange,
00838               bAllowNewProject,
00839               pbNewProject);
00840
00841         *_pdwStubPhase = STUB_MARSHAL;
00842
00843         _StubMsg.BufferLength = 64;
00844         _StubMsg.MaxCount = ( unsigned long  )cbProjectNameBuffer;
00845
00846         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00847                                        (unsigned char *)sProjectName,
00848                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00849
00850         _StubMsg.MaxCount = ( unsigned long  )cbProjectHomeBuffer;
00851
00852         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00853                                        (unsigned char *)sProjectHome,
00854                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00855
00856         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00857         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00858         *(( int * )_StubMsg.Buffer)++ = *pHandle;
00859
00860         _StubMsg.MaxCount = ( unsigned long  )cbProjectNameBuffer;
00861
00862         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00863                                      (unsigned char *)sProjectName,
00864                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00865
00866         _StubMsg.MaxCount = ( unsigned long  )cbProjectHomeBuffer;
00867
00868         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00869                                      (unsigned char *)sProjectHome,
00870                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00871
00872         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00873         *(( BOOL * )_StubMsg.Buffer)++ = *pbNewProject;
00874
00875         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00876         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
00877
00878         }
00879     RpcFinally
00880         {
00881         _StubMsg.MaxCount = ( unsigned long  )cbProjectNameBuffer;
00882
00883         NdrPointerFree( &_StubMsg,
00884                         (unsigned char *)sProjectName,
00885                         &__MIDL_TypeFormatString.Format[24] );
00886
00887         _StubMsg.MaxCount = ( unsigned long  )cbProjectHomeBuffer;
00888
00889         NdrPointerFree( &_StubMsg,
00890                         (unsigned char *)sProjectHome,
00891                         &__MIDL_TypeFormatString.Format[34] );
00892
00893         }
00894     RpcEndFinally
00895     _pRpcMessage->BufferLength =
00896         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
00897
00898 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_HasAdvancedOptionsForCommand_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | CvsCommand | command,
 |  | BOOL * | pbAdvancedOptions
 | ) |

Definition at line 2525 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and Object_StubDesc.

02530 {
02531
02532     HRESULT _RetVal;
02533
02534     RPC_MESSAGE _RpcMessage;
02535
02536     MIDL_STUB_MESSAGE _StubMsg;
02537
02538     RpcTryExcept
02539         {
02540         NdrProxyInitialize(
02541                       ( void *  )This,
02542                       ( PRPC_MESSAGE  )&_RpcMessage,
02543                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02544                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02545                       18);
02546
02547
02548
02549         if(!pbAdvancedOptions)
02550             {
02551             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02552             }
02553         RpcTryFinally
02554             {
02555
02556             _StubMsg.BufferLength = 14;
02557             NdrProxyGetBuffer(This, &_StubMsg);
02558             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02559             *(( int * )_StubMsg.Buffer)++ = handle;
02560
02561             NdrSimpleTypeMarshall(
02562                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02563                          ( unsigned char * )&command,
02564                          13);
02565             NdrProxySendReceive(This, &_StubMsg);
02566
02567             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02568             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02569
02570             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02571                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[110] );
02572
02573             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02574             *pbAdvancedOptions = *(( BOOL * )_StubMsg.Buffer)++;
02575
02576             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02577
02578             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02579                 {
02580                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02581                 }
02582             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02583
02584             }
02585         RpcFinally
02586             {
02587             NdrProxyFreeBuffer(This, &_StubMsg);
02588
02589             }
02590         RpcEndFinally
02591
02592         }
02593     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02594         {
02595         NdrClearOutParameters(
02596                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02597                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
02598                          ( void * )pbAdvancedOptions);
02599         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02600         }
02601     RpcEndExcept
02602     return _RetVal;
02603 }

void __RPC_STUB ICvsCoworker_HasAdvancedOptionsForCommand_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2605 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, HasAdvancedOptionsForCommand, and Object_StubDesc.

02610 {
02611     BOOL _M42   =   0;
02612     HRESULT _RetVal;
02613     MIDL_STUB_MESSAGE _StubMsg;
02614     CvsCommand command;
02615     int handle;
02616     BOOL *pbAdvancedOptions;
02617
02618 NdrStubInitialize(
02619                      _pRpcMessage,
02620                      &_StubMsg,
02621                      &Object_StubDesc,
02622                      _pRpcChannelBuffer);
02623     handle = 0;
02624     command = 0;
02625     ( BOOL * )pbAdvancedOptions = 0;
02626     RpcTryFinally
02627         {
02628         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02629             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[110] );
02630
02631         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02632
02633         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02634             {
02635             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02636             }
02637         handle = *(( int * )_StubMsg.Buffer)++;
02638
02639         NdrSimpleTypeUnmarshall(
02640                            ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02641                            ( unsigned char * )&command,
02642                            13);
02643         pbAdvancedOptions = &_M42;
02644
02645         *_pdwStubPhase = STUB_CALL_SERVER;
02646         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> HasAdvancedOptionsForCommand(
02647                                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02648                                 handle,
02649                                 command,
02650                                 pbAdvancedOptions);
02651
02652         *_pdwStubPhase = STUB_MARSHAL;
02653
02654         _StubMsg.BufferLength = 36;
02655         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02656         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02657         *(( BOOL * )_StubMsg.Buffer)++ = *pbAdvancedOptions;
02658
02659         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02660         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02661
02662         }
02663     RpcFinally
02664         {
02665         }
02666     RpcEndFinally
02667     _pRpcMessage->BufferLength =
02668         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02669
02670 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_OpenProject_Proxy | ( | ICvsCoworker * | This,
 |  | int * | pHandle,
 |  | const unsigned char * | sUsername,
 |  | const unsigned char * | sProjectName,
 |  | const unsigned char * | sProjectHome
 | ) |

Definition at line 393 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_FORMAT_STRING::Format, and Object_StubDesc.

00399 {
00400
00401     HRESULT _RetVal;
00402
00403     RPC_MESSAGE _RpcMessage;
00404
00405     MIDL_STUB_MESSAGE _StubMsg;
00406
00407     RpcTryExcept
00408         {
00409         NdrProxyInitialize(
00410                       ( void *  )This,
00411                       ( PRPC_MESSAGE  )&_RpcMessage,
00412                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00413                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00414                       5);
00415
00416
00417
00418         if(!pHandle)
00419             {
00420             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00421             }
00422         if(!sUsername)
00423             {
00424             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00425             }
00426         if(!sProjectName)
00427             {
00428             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00429             }
00430         if(!sProjectHome)
00431             {
00432             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00433             }
00434         RpcTryFinally
00435             {
00436
00437             _StubMsg.BufferLength = 0;
00438             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00439                                            (unsigned char *)sUsername,
00440                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00441
00442             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00443                                            (unsigned char *)sProjectName,
00444                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00445
00446             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00447                                            (unsigned char *)sProjectHome,
00448                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00449
00450             NdrProxyGetBuffer(This, &_StubMsg);
00451             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00452                                          (unsigned char *)sUsername,
00453                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00454
00455             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00456                                          (unsigned char *)sProjectName,
00457                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00458
00459             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00460                                          (unsigned char *)sProjectHome,
00461                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00462
00463             NdrProxySendReceive(This, &_StubMsg);
00464
00465             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
00466             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
00467
00468             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00469                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[20] );
00470
00471             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00472             *pHandle = *(( int * )_StubMsg.Buffer)++;
00473
00474             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00475
00476             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00477                 {
00478                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
00479                 }
00480             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
00481
00482             }
00483         RpcFinally
00484             {
00485             NdrProxyFreeBuffer(This, &_StubMsg);
00486
00487             }
00488         RpcEndFinally
00489
00490         }
00491     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00492         {
00493         NdrClearOutParameters(
00494                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00495                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00496                          ( void * )pHandle);
00497         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00498         }
00499     RpcEndExcept
00500     return _RetVal;
00501 }

void __RPC_STUB ICvsCoworker_OpenProject_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 503 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, Object_StubDesc, and OpenProject.

00508 {
00509     int _M9 =   0;
00510     HRESULT _RetVal;
00511     MIDL_STUB_MESSAGE _StubMsg;
00512     int *pHandle;
00513     const unsigned char *sProjectHome;
00514     const unsigned char *sProjectName;
00515     const unsigned char *sUsername;
00516
00517 NdrStubInitialize(
00518                      _pRpcMessage,
00519                      &_StubMsg,
00520                      &Object_StubDesc,
00521                      _pRpcChannelBuffer);
00522     ( int * )pHandle = 0;
00523     ( unsigned char * )sUsername = 0;
00524     ( unsigned char * )sProjectName = 0;
00525     ( unsigned char * )sProjectHome = 0;
00526     RpcTryFinally
00527         {
00528         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00529             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[20] );
00530
00531         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00532                                        (unsigned char * *)&sUsername,
00533                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00534                                        (unsigned char)0 );
00535
00536         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00537                                        (unsigned char * *)&sProjectName,
00538                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00539                                        (unsigned char)0 );
00540
00541         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00542                                        (unsigned char * *)&sProjectHome,
00543                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00544                                        (unsigned char)0 );
00545
00546         pHandle = &_M9;
00547
00548         *_pdwStubPhase = STUB_CALL_SERVER;
00549         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> OpenProject(
00550                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00551                pHandle,
00552                sUsername,
00553                sProjectName,
00554                sProjectHome);
00555
00556         *_pdwStubPhase = STUB_MARSHAL;
00557
00558         _StubMsg.BufferLength = 36;
00559         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00560         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00561         *(( int * )_StubMsg.Buffer)++ = *pHandle;
00562
00563         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00564         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
00565
00566         }
00567     RpcFinally
00568         {
00569         }
00570     RpcEndFinally
00571     _pRpcMessage->BufferLength =
00572         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
00573
00574 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_RemoveFiles_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sFilenames
 | ) |

Definition at line 1652 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_FORMAT_STRING::Format, and Object_StubDesc.

01656 {
01657
01658     HRESULT _RetVal;
01659
01660     RPC_MESSAGE _RpcMessage;
01661
01662     MIDL_STUB_MESSAGE _StubMsg;
01663
01664     RpcTryExcept
01665         {
01666         NdrProxyInitialize(
01667                       ( void *  )This,
01668                       ( PRPC_MESSAGE  )&_RpcMessage,
01669                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01670                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01671                       12);
01672
01673
01674
01675         if(!sFilenames)
01676             {
01677             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01678             }
01679         RpcTryFinally
01680             {
01681
01682             _StubMsg.BufferLength = 8;
01683             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01684                                            (unsigned char *)sFilenames,
01685                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01686
01687             NdrProxyGetBuffer(This, &_StubMsg);
01688             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01689             *(( int * )_StubMsg.Buffer)++ = handle;
01690
01691             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01692                                          (unsigned char *)sFilenames,
01693                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01694
01695             NdrProxySendReceive(This, &_StubMsg);
01696
01697             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
01698             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
01699
01700             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01701                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01702
01703             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01704
01705             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01706                 {
01707                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
01708                 }
01709             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
01710
01711             }
01712         RpcFinally
01713             {
01714             NdrProxyFreeBuffer(This, &_StubMsg);
01715
01716             }
01717         RpcEndFinally
01718
01719         }
01720     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01721         {
01722         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01723         }
01724     RpcEndExcept
01725     return _RetVal;
01726 }

void __RPC_STUB ICvsCoworker_RemoveFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1728 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, Object_StubDesc, and RemoveFiles.

01733 {
01734     HRESULT _RetVal;
01735     MIDL_STUB_MESSAGE _StubMsg;
01736     int handle;
01737     const unsigned char *sFilenames;
01738
01739 NdrStubInitialize(
01740                      _pRpcMessage,
01741                      &_StubMsg,
01742                      &Object_StubDesc,
01743                      _pRpcChannelBuffer);
01744     handle = 0;
01745     ( unsigned char * )sFilenames = 0;
01746     RpcTryFinally
01747         {
01748         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01749             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01750
01751         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01752
01753         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01754             {
01755             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01756             }
01757         handle = *(( int * )_StubMsg.Buffer)++;
01758
01759         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01760                                        (unsigned char * *)&sFilenames,
01761                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01762                                        (unsigned char)0 );
01763
01764
01765         *_pdwStubPhase = STUB_CALL_SERVER;
01766         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> RemoveFiles(
01767                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01768                handle,
01769                sFilenames);
01770
01771         *_pdwStubPhase = STUB_MARSHAL;
01772
01773         _StubMsg.BufferLength = 8;
01774         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01775         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01776         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01777
01778         }
01779     RpcFinally
01780         {
01781         }
01782     RpcEndFinally
01783     _pRpcMessage->BufferLength =
01784         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01785
01786 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_RenameFile_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sOldFilename,
 |  | const unsigned char * | sNewFilename
 | ) |

Definition at line 1789 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_FORMAT_STRING::Format, and Object_StubDesc.

01794 {
01795
01796     HRESULT _RetVal;
01797
01798     RPC_MESSAGE _RpcMessage;
01799
01800     MIDL_STUB_MESSAGE _StubMsg;
01801
01802     RpcTryExcept
01803         {
01804         NdrProxyInitialize(
01805                       ( void *  )This,
01806                       ( PRPC_MESSAGE  )&_RpcMessage,
01807                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01808                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01809                       13);
01810
01811
01812
01813         if(!sOldFilename)
01814             {
01815             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01816             }
01817         if(!sNewFilename)
01818             {
01819             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01820             }
01821         RpcTryFinally
01822             {
01823
01824             _StubMsg.BufferLength = 8;
01825             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01826                                            (unsigned char *)sOldFilename,
01827                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01828
01829             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01830                                            (unsigned char *)sNewFilename,
01831                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01832
01833             NdrProxyGetBuffer(This, &_StubMsg);
01834             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01835             *(( int * )_StubMsg.Buffer)++ = handle;
01836
01837             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01838                                          (unsigned char *)sOldFilename,
01839                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01840
01841             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01842                                          (unsigned char *)sNewFilename,
01843                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01844
01845             NdrProxySendReceive(This, &_StubMsg);
01846
01847             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
01848             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
01849
01850             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01851                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01852
01853             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01854
01855             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01856                 {
01857                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
01858                 }
01859             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
01860
01861             }
01862         RpcFinally
01863             {
01864             NdrProxyFreeBuffer(This, &_StubMsg);
01865
01866             }
01867         RpcEndFinally
01868
01869         }
01870     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01871         {
01872         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01873         }
01874     RpcEndExcept
01875     return _RetVal;
01876 }

void __RPC_STUB ICvsCoworker_RenameFile_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1878 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, Object_StubDesc, and RenameFile.

01883 {
01884     HRESULT _RetVal;
01885     MIDL_STUB_MESSAGE _StubMsg;
01886     int handle;
01887     const unsigned char *sNewFilename;
01888     const unsigned char *sOldFilename;
01889
01890 NdrStubInitialize(
01891                      _pRpcMessage,
01892                      &_StubMsg,
01893                      &Object_StubDesc,
01894                      _pRpcChannelBuffer);
01895     handle = 0;
01896     ( unsigned char * )sOldFilename = 0;
01897     ( unsigned char * )sNewFilename = 0;
01898     RpcTryFinally
01899         {
01900         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01901             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01902
01903         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01904
01905         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01906             {
01907             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01908             }
01909         handle = *(( int * )_StubMsg.Buffer)++;
01910
01911         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01912                                        (unsigned char * *)&sOldFilename,
01913                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01914                                        (unsigned char)0 );
01915
01916         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01917                                        (unsigned char * *)&sNewFilename,
01918                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01919                                        (unsigned char)0 );
01920
01921
01922         *_pdwStubPhase = STUB_CALL_SERVER;
01923         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> RenameFile(
01924               (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01925               handle,
01926               sOldFilename,
01927               sNewFilename);
01928
01929         *_pdwStubPhase = STUB_MARSHAL;
01930
01931         _StubMsg.BufferLength = 8;
01932         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01933         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01934         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01935
01936         }
01937     RpcFinally
01938         {
01939         }
01940     RpcEndFinally
01941     _pRpcMessage->BufferLength =
01942         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01943
01944 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | CvsCommand | command
 | ) |

Definition at line 2673 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, and Object_StubDesc.

02677 {
02678
02679     HRESULT _RetVal;
02680
02681     RPC_MESSAGE _RpcMessage;
02682
02683     MIDL_STUB_MESSAGE _StubMsg;
02684
02685     RpcTryExcept
02686         {
02687         NdrProxyInitialize(
02688                       ( void *  )This,
02689                       ( PRPC_MESSAGE  )&_RpcMessage,
02690                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02691                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02692                       19);
02693
02694
02695
02696         RpcTryFinally
02697             {
02698
02699             _StubMsg.BufferLength = 14;
02700             NdrProxyGetBuffer(This, &_StubMsg);
02701             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02702             *(( int * )_StubMsg.Buffer)++ = handle;
02703
02704             NdrSimpleTypeMarshall(
02705                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02706                          ( unsigned char * )&command,
02707                          13);
02708             NdrProxySendReceive(This, &_StubMsg);
02709
02710             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02711             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02712
02713             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02714                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[120] );
02715
02716             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02717
02718             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02719                 {
02720                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02721                 }
02722             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02723
02724             }
02725         RpcFinally
02726             {
02727             NdrProxyFreeBuffer(This, &_StubMsg);
02728
02729             }
02730         RpcEndFinally
02731
02732         }
02733     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02734         {
02735         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02736         }
02737     RpcEndExcept
02738     return _RetVal;
02739 }

void __RPC_STUB ICvsCoworker_ShowAdvancedOptionsForCommand_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2741 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, Object_StubDesc, and ShowAdvancedOptionsForCommand.

02746 {
02747     HRESULT _RetVal;
02748     MIDL_STUB_MESSAGE _StubMsg;
02749     CvsCommand command;
02750     int handle;
02751
02752 NdrStubInitialize(
02753                      _pRpcMessage,
02754                      &_StubMsg,
02755                      &Object_StubDesc,
02756                      _pRpcChannelBuffer);
02757     handle = 0;
02758     command = 0;
02759     RpcTryFinally
02760         {
02761         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02762             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[120] );
02763
02764         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02765
02766         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02767             {
02768             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02769             }
02770         handle = *(( int * )_StubMsg.Buffer)++;
02771
02772         NdrSimpleTypeUnmarshall(
02773                            ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02774                            ( unsigned char * )&command,
02775                            13);
02776
02777         *_pdwStubPhase = STUB_CALL_SERVER;
02778         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowAdvancedOptionsForCommand(
02779                                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02780                                  handle,
02781                                  command);
02782
02783         *_pdwStubPhase = STUB_MARSHAL;
02784
02785         _StubMsg.BufferLength = 8;
02786         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02787         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02788         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02789
02790         }
02791     RpcFinally
02792         {
02793         }
02794     RpcEndFinally
02795     _pRpcMessage->BufferLength =
02796         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02797
02798 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileHistory_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sFilenames
 | ) |

Definition at line 2114 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_FORMAT_STRING::Format, and Object_StubDesc.

02118 {
02119
02120     HRESULT _RetVal;
02121
02122     RPC_MESSAGE _RpcMessage;
02123
02124     MIDL_STUB_MESSAGE _StubMsg;
02125
02126     RpcTryExcept
02127         {
02128         NdrProxyInitialize(
02129                       ( void *  )This,
02130                       ( PRPC_MESSAGE  )&_RpcMessage,
02131                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02132                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02133                       15);
02134
02135
02136
02137         if(!sFilenames)
02138             {
02139             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02140             }
02141         RpcTryFinally
02142             {
02143
02144             _StubMsg.BufferLength = 8;
02145             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02146                                            (unsigned char *)sFilenames,
02147                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02148
02149             NdrProxyGetBuffer(This, &_StubMsg);
02150             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02151             *(( int * )_StubMsg.Buffer)++ = handle;
02152
02153             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02154                                          (unsigned char *)sFilenames,
02155                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02156
02157             NdrProxySendReceive(This, &_StubMsg);
02158
02159             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02160             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02161
02162             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02163                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02164
02165             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02166
02167             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02168                 {
02169                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02170                 }
02171             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02172
02173             }
02174         RpcFinally
02175             {
02176             NdrProxyFreeBuffer(This, &_StubMsg);
02177
02178             }
02179         RpcEndFinally
02180
02181         }
02182     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02183         {
02184         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02185         }
02186     RpcEndExcept
02187     return _RetVal;
02188 }

void __RPC_STUB ICvsCoworker_ShowFileHistory_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2190 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, Object_StubDesc, and ShowFileHistory.

02195 {
02196     HRESULT _RetVal;
02197     MIDL_STUB_MESSAGE _StubMsg;
02198     int handle;
02199     const unsigned char *sFilenames;
02200
02201 NdrStubInitialize(
02202                      _pRpcMessage,
02203                      &_StubMsg,
02204                      &Object_StubDesc,
02205                      _pRpcChannelBuffer);
02206     handle = 0;
02207     ( unsigned char * )sFilenames = 0;
02208     RpcTryFinally
02209         {
02210         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02211             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02212
02213         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02214
02215         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02216             {
02217             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02218             }
02219         handle = *(( int * )_StubMsg.Buffer)++;
02220
02221         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02222                                        (unsigned char * *)&sFilenames,
02223                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02224                                        (unsigned char)0 );
02225
02226
02227         *_pdwStubPhase = STUB_CALL_SERVER;
02228         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowFileHistory(
02229                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02230                    handle,
02231                    sFilenames);
02232
02233         *_pdwStubPhase = STUB_MARSHAL;
02234
02235         _StubMsg.BufferLength = 8;
02236         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02237         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02238         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02239
02240         }
02241     RpcFinally
02242         {
02243         }
02244     RpcEndFinally
02245     _pRpcMessage->BufferLength =
02246         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02247
02248 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileProperties_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sFilename
 | ) |

Definition at line 2251 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_FORMAT_STRING::Format, and Object_StubDesc.

02255 {
02256
02257     HRESULT _RetVal;
02258
02259     RPC_MESSAGE _RpcMessage;
02260
02261     MIDL_STUB_MESSAGE _StubMsg;
02262
02263     RpcTryExcept
02264         {
02265         NdrProxyInitialize(
02266                       ( void *  )This,
02267                       ( PRPC_MESSAGE  )&_RpcMessage,
02268                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02269                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02270                       16);
02271
02272
02273
02274         if(!sFilename)
02275             {
02276             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02277             }
02278         RpcTryFinally
02279             {
02280
02281             _StubMsg.BufferLength = 8;
02282             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02283                                            (unsigned char *)sFilename,
02284                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02285
02286             NdrProxyGetBuffer(This, &_StubMsg);
02287             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02288             *(( int * )_StubMsg.Buffer)++ = handle;
02289
02290             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02291                                          (unsigned char *)sFilename,
02292                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02293
02294             NdrProxySendReceive(This, &_StubMsg);
02295
02296             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02297             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02298
02299             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02300                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02301
02302             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02303
02304             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02305                 {
02306                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02307                 }
02308             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02309
02310             }
02311         RpcFinally
02312             {
02313             NdrProxyFreeBuffer(This, &_StubMsg);
02314
02315             }
02316         RpcEndFinally
02317
02318         }
02319     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02320         {
02321         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02322         }
02323     RpcEndExcept
02324     return _RetVal;
02325 }

void __RPC_STUB ICvsCoworker_ShowFileProperties_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2327 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, Object_StubDesc, and ShowFileProperties.

02332 {
02333     HRESULT _RetVal;
02334     MIDL_STUB_MESSAGE _StubMsg;
02335     int handle;
02336     const unsigned char *sFilename;
02337
02338 NdrStubInitialize(
02339                      _pRpcMessage,
02340                      &_StubMsg,
02341                      &Object_StubDesc,
02342                      _pRpcChannelBuffer);
02343     handle = 0;
02344     ( unsigned char * )sFilename = 0;
02345     RpcTryFinally
02346         {
02347         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02348             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02349
02350         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02351
02352         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02353             {
02354             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02355             }
02356         handle = *(( int * )_StubMsg.Buffer)++;
02357
02358         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02359                                        (unsigned char * *)&sFilename,
02360                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02361                                        (unsigned char)0 );
02362
02363
02364         *_pdwStubPhase = STUB_CALL_SERVER;
02365         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowFileProperties(
02366                       (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02367                       handle,
02368                       sFilename);
02369
02370         *_pdwStubPhase = STUB_MARSHAL;
02371
02372         _StubMsg.BufferLength = 8;
02373         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02374         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02375         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02376
02377         }
02378     RpcFinally
02379         {
02380         }
02381     RpcEndFinally
02382     _pRpcMessage->BufferLength =
02383         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02384
02385 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowUserInterface_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sFilenames
 | ) |

Definition at line 2388 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_FORMAT_STRING::Format, and Object_StubDesc.

02392 {
02393
02394     HRESULT _RetVal;
02395
02396     RPC_MESSAGE _RpcMessage;
02397
02398     MIDL_STUB_MESSAGE _StubMsg;
02399
02400     RpcTryExcept
02401         {
02402         NdrProxyInitialize(
02403                       ( void *  )This,
02404                       ( PRPC_MESSAGE  )&_RpcMessage,
02405                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02406                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02407                       17);
02408
02409
02410
02411         if(!sFilenames)
02412             {
02413             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02414             }
02415         RpcTryFinally
02416             {
02417
02418             _StubMsg.BufferLength = 8;
02419             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02420                                            (unsigned char *)sFilenames,
02421                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02422
02423             NdrProxyGetBuffer(This, &_StubMsg);
02424             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02425             *(( int * )_StubMsg.Buffer)++ = handle;
02426
02427             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02428                                          (unsigned char *)sFilenames,
02429                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02430
02431             NdrProxySendReceive(This, &_StubMsg);
02432
02433             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
02434             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
02435
02436             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02437                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02438
02439             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02440
02441             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02442                 {
02443                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
02444                 }
02445             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
02446
02447             }
02448         RpcFinally
02449             {
02450             NdrProxyFreeBuffer(This, &_StubMsg);
02451
02452             }
02453         RpcEndFinally
02454
02455         }
02456     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02457         {
02458         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02459         }
02460     RpcEndExcept
02461     return _RetVal;
02462 }

void __RPC_STUB ICvsCoworker_ShowUserInterface_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2464 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, Object_StubDesc, and ShowUserInterface.

02469 {
02470     HRESULT _RetVal;
02471     MIDL_STUB_MESSAGE _StubMsg;
02472     int handle;
02473     const unsigned char *sFilenames;
02474
02475 NdrStubInitialize(
02476                      _pRpcMessage,
02477                      &_StubMsg,
02478                      &Object_StubDesc,
02479                      _pRpcChannelBuffer);
02480     handle = 0;
02481     ( unsigned char * )sFilenames = 0;
02482     RpcTryFinally
02483         {
02484         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02485             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02486
02487         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02488
02489         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
02490             {
02491             RpcRaiseException(RPC_X_BAD_STUB_DATA);
02492             }
02493         handle = *(( int * )_StubMsg.Buffer)++;
02494
02495         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02496                                        (unsigned char * *)&sFilenames,
02497                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02498                                        (unsigned char)0 );
02499
02500
02501         *_pdwStubPhase = STUB_CALL_SERVER;
02502         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowUserInterface(
02503                      (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02504                      handle,
02505                      sFilenames);
02506
02507         *_pdwStubPhase = STUB_MARSHAL;
02508
02509         _StubMsg.BufferLength = 8;
02510         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02511         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02512         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
02513
02514         }
02515     RpcFinally
02516         {
02517         }
02518     RpcEndFinally
02519     _pRpcMessage->BufferLength =
02520         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
02521
02522 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_UncheckoutFiles_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sFilenames
 | ) |

Definition at line 1357 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_FORMAT_STRING::Format, and Object_StubDesc.

01361 {
01362
01363     HRESULT _RetVal;
01364
01365     RPC_MESSAGE _RpcMessage;
01366
01367     MIDL_STUB_MESSAGE _StubMsg;
01368
01369     RpcTryExcept
01370         {
01371         NdrProxyInitialize(
01372                       ( void *  )This,
01373                       ( PRPC_MESSAGE  )&_RpcMessage,
01374                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01375                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01376                       10);
01377
01378
01379
01380         if(!sFilenames)
01381             {
01382             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01383             }
01384         RpcTryFinally
01385             {
01386
01387             _StubMsg.BufferLength = 8;
01388             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01389                                            (unsigned char *)sFilenames,
01390                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01391
01392             NdrProxyGetBuffer(This, &_StubMsg);
01393             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01394             *(( int * )_StubMsg.Buffer)++ = handle;
01395
01396             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01397                                          (unsigned char *)sFilenames,
01398                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01399
01400             NdrProxySendReceive(This, &_StubMsg);
01401
01402             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
01403             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
01404
01405             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01406                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01407
01408             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01409
01410             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01411                 {
01412                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
01413                 }
01414             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
01415
01416             }
01417         RpcFinally
01418             {
01419             NdrProxyFreeBuffer(This, &_StubMsg);
01420
01421             }
01422         RpcEndFinally
01423
01424         }
01425     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01426         {
01427         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01428         }
01429     RpcEndExcept
01430     return _RetVal;
01431 }

void __RPC_STUB ICvsCoworker_UncheckoutFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1433 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, Object_StubDesc, and UncheckoutFiles.

01438 {
01439     HRESULT _RetVal;
01440     MIDL_STUB_MESSAGE _StubMsg;
01441     int handle;
01442     const unsigned char *sFilenames;
01443
01444 NdrStubInitialize(
01445                      _pRpcMessage,
01446                      &_StubMsg,
01447                      &Object_StubDesc,
01448                      _pRpcChannelBuffer);
01449     handle = 0;
01450     ( unsigned char * )sFilenames = 0;
01451     RpcTryFinally
01452         {
01453         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01454             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01455
01456         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01457
01458         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01459             {
01460             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01461             }
01462         handle = *(( int * )_StubMsg.Buffer)++;
01463
01464         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01465                                        (unsigned char * *)&sFilenames,
01466                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01467                                        (unsigned char)0 );
01468
01469
01470         *_pdwStubPhase = STUB_CALL_SERVER;
01471         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> UncheckoutFiles(
01472                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01473                    handle,
01474                    sFilenames);
01475
01476         *_pdwStubPhase = STUB_MARSHAL;
01477
01478         _StubMsg.BufferLength = 8;
01479         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01480         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01481         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01482
01483         }
01484     RpcFinally
01485         {
01486         }
01487     RpcEndFinally
01488     _pRpcMessage->BufferLength =
01489         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01490
01491 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_UpdateFiles_Proxy | ( | ICvsCoworker * | This,
 |  | int | handle,
 |  | const unsigned char * | sFilenames,
 |  | BOOL | bDirectories,
 |  | BOOL | bRecurse
 | ) |

Definition at line 901 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_FORMAT_STRING::Format, and Object_StubDesc.

00907 {
00908
00909     HRESULT _RetVal;
00910
00911     RPC_MESSAGE _RpcMessage;
00912
00913     MIDL_STUB_MESSAGE _StubMsg;
00914
00915     RpcTryExcept
00916         {
00917         NdrProxyInitialize(
00918                       ( void *  )This,
00919                       ( PRPC_MESSAGE  )&_RpcMessage,
00920                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00921                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00922                       7);
00923
00924
00925
00926         if(!sFilenames)
00927             {
00928             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00929             }
00930         RpcTryFinally
00931             {
00932
00933             _StubMsg.BufferLength = 24;
00934             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00935                                            (unsigned char *)sFilenames,
00936                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00937
00938             NdrProxyGetBuffer(This, &_StubMsg);
00939             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00940             *(( int * )_StubMsg.Buffer)++ = handle;
00941
00942             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00943                                          (unsigned char *)sFilenames,
00944                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00945
00946             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00947             *(( BOOL * )_StubMsg.Buffer)++ = bDirectories;
00948
00949             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00950             *(( BOOL * )_StubMsg.Buffer)++ = bRecurse;
00951
00952             NdrProxySendReceive(This, &_StubMsg);
00953
00954             _StubMsg.BufferStart = (unsigned char *) _RpcMessage.Buffer;
00955             _StubMsg.BufferEnd   = _StubMsg.BufferStart + _RpcMessage.BufferLength;
00956
00957             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00958                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
00959
00960             _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00961
00962             if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
00963                 {
00964                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
00965                 }
00966             _RetVal = *(( HRESULT * )_StubMsg.Buffer)++;
00967
00968             }
00969         RpcFinally
00970             {
00971             NdrProxyFreeBuffer(This, &_StubMsg);
00972
00973             }
00974         RpcEndFinally
00975
00976         }
00977     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00978         {
00979         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00980         }
00981     RpcEndExcept
00982     return _RetVal;
00983 }

void __RPC_STUB ICvsCoworker_UpdateFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 985 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, Object_StubDesc, and UpdateFiles.

00990 {
00991     HRESULT _RetVal;
00992     MIDL_STUB_MESSAGE _StubMsg;
00993     BOOL bDirectories;
00994     BOOL bRecurse;
00995     int handle;
00996     const unsigned char *sFilenames;
00997
00998 NdrStubInitialize(
00999                      _pRpcMessage,
01000                      &_StubMsg,
01001                      &Object_StubDesc,
01002                      _pRpcChannelBuffer);
01003     handle = 0;
01004     ( unsigned char * )sFilenames = 0;
01005     bDirectories = 0;
01006     bRecurse = 0;
01007     RpcTryFinally
01008         {
01009         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01010             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
01011
01012         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01013
01014         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01015             {
01016             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01017             }
01018         handle = *(( int * )_StubMsg.Buffer)++;
01019
01020         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01021                                        (unsigned char * *)&sFilenames,
01022                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01023                                        (unsigned char)0 );
01024
01025         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01026
01027         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01028             {
01029             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01030             }
01031         bDirectories = *(( BOOL * )_StubMsg.Buffer)++;
01032
01033         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01034
01035         if(_StubMsg.Buffer + 4 > _StubMsg.BufferEnd)
01036             {
01037             RpcRaiseException(RPC_X_BAD_STUB_DATA);
01038             }
01039         bRecurse = *(( BOOL * )_StubMsg.Buffer)++;
01040
01041
01042         *_pdwStubPhase = STUB_CALL_SERVER;
01043         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> UpdateFiles(
01044                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01045                handle,
01046                sFilenames,
01047                bDirectories,
01048                bRecurse);
01049
01050         *_pdwStubPhase = STUB_MARSHAL;
01051
01052         _StubMsg.BufferLength = 8;
01053         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01054         _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01055         *(( HRESULT * )_StubMsg.Buffer)++ = _RetVal;
01056
01057         }
01058     RpcFinally
01059         {
01060         }
01061     RpcEndFinally
01062     _pRpcMessage->BufferLength =
01063         (unsigned int)(_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer);
01064
01065 }

Variable Documentation

const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString

Definition at line 3266 of file CVS_Coworker_p.c.

const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString

Definition at line 3425 of file CVS_Coworker_p.c.

PCInterfaceName const _CVS_Coworker_InterfaceNamesList[]

Initial value:

{
    "ICvsCoworker",
    0
}

Definition at line 3649 of file CVS_Coworker_p.c.

const CInterfaceProxyVtbl* _CVS_Coworker_ProxyVtblList[]

Initial value:

{
    ( CInterfaceProxyVtbl *) &_ICvsCoworkerProxyVtbl,
    0
}

Definition at line 3637 of file CVS_Coworker_p.c.

const CInterfaceStubVtbl* _CVS_Coworker_StubVtblList[]

Initial value:

{
    ( CInterfaceStubVtbl *) &_ICvsCoworkerStubVtbl,
    0
}

Definition at line 3643 of file CVS_Coworker_p.c.

const CInterfaceStubVtbl _ICvsCoworkerStubVtbl

Initial value:

{
    &IID_ICvsCoworker,
    &ICvsCoworker_ServerInfo,
    23,
    &ICvsCoworker_table[-3],
    CStdStubBuffer_METHODS
}

Definition at line 3604 of file CVS_Coworker_p.c.

RPC_SYNTAX_IDENTIFIER _RpcTransferSyntax [static]

Initial value:

{{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}}

Definition at line 54 of file CVS_Coworker_p.c.

const ExtendedProxyFileInfo CVS_Coworker_ProxyFileInfo

Initial value:

{
    (PCInterfaceProxyVtblList *) & _CVS_Coworker_ProxyVtblList,
    (PCInterfaceStubVtblList *) & _CVS_Coworker_StubVtblList,
    (const PCInterfaceName * ) & _CVS_Coworker_InterfaceNamesList,
    0,
    & _CVS_Coworker_IID_Lookup,
    1,
    1,
    0,
    0,
    0,
    0
}

Definition at line 3670 of file CVS_Coworker_p.c.

const unsigned short ICvsCoworker_FormatStringOffsetTable[] [static]

Initial value:

    {
    0,
    8,
    20,
    38,
    68,
    80,
    88,
    80,
    98,
    80,
    98,
    68,
    80,
    80,
    80,
    110,
    120,
    126,
    136,
    146
    }

Definition at line 3506 of file CVS_Coworker_p.c.

const MIDL_STUBLESS_PROXY_INFO ICvsCoworker_ProxyInfo

Initial value:

    {
    &Object_StubDesc,
    __MIDL_ProcFormatString.Format,
    &ICvsCoworker_FormatStringOffsetTable[-3],
    0,
    0,
    0
    }

Definition at line 3530 of file CVS_Coworker_p.c.

const MIDL_SERVER_INFO ICvsCoworker_ServerInfo

Initial value:

    {
    &Object_StubDesc,
    0,
    __MIDL_ProcFormatString.Format,
    &ICvsCoworker_FormatStringOffsetTable[-3],
    0,
    0,
    0,
    0}

Definition at line 3541 of file CVS_Coworker_p.c.

const PRPC_STUB_FUNCTION ICvsCoworker_table[] [static]

Initial value:

{
    ICvsCoworker_GetLastError_Stub,
    ICvsCoworker_GetErrorMessage_Stub,
    ICvsCoworker_OpenProject_Stub,
    ICvsCoworker_GetProject_Stub,
    ICvsCoworker_UpdateFiles_Stub,
    ICvsCoworker_CheckoutFiles_Stub,
    ICvsCoworker_CheckinFiles_Stub,
    ICvsCoworker_UncheckoutFiles_Stub,
    ICvsCoworker_AddFiles_Stub,
    ICvsCoworker_RemoveFiles_Stub,
    ICvsCoworker_RenameFile_Stub,
    ICvsCoworker_DiffFile_Stub,
    ICvsCoworker_ShowFileHistory_Stub,
    ICvsCoworker_ShowFileProperties_Stub,
    ICvsCoworker_ShowUserInterface_Stub,
    ICvsCoworker_HasAdvancedOptionsForCommand_Stub,
    ICvsCoworker_ShowAdvancedOptionsForCommand_Stub,
    ICvsCoworker_GetFileChanges_Stub,
    ICvsCoworker_GetFilesToAdd_Stub,
    ICvsCoworker_CloseProject_Stub
}

Definition at line 3580 of file CVS_Coworker_p.c.

const MIDL_STUB_DESC Object_StubDesc

Initial value:

    {
    0,
    NdrOleAllocate,
    NdrOleFree,
    0,
    0,
    0,
    0,
    0,
    __MIDL_TypeFormatString.Format,
    1,
    0x10001,
    0,
    0x600015b,
    0,
    0,
    0,
    0x1,
    0,
    0,
    0
    }

Definition at line 3613 of file CVS_Coworker_p.c.

Generated on Sun Feb 24 01:23:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsStatusBar.cpp File Reference

WinCvs/CvsStatusBar.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "CvsStatusBar.h"
#include "CvsPrefs.h"

Include dependency graph for CvsStatusBar.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsStatusBar.h File Reference

WinCvs/CvsStatusBar.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCvsStatusBar

Defines

#define | AFX_CVSSTATUSBAR_H__F549ACF2_ECFE_4933_A05D_5FC8248C3CD4__INCLUDED_

Define Documentation

#define AFX_CVSSTATUSBAR_H__F549ACF2_ECFE_4933_A05D_5FC8248C3CD4__INCLUDED_

Definition at line 2 of file CvsStatusBar.h.

Generated on Sun Feb 24 01:23:47 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


dlldata.c File Reference

WinCvs/dlldata.c File Reference

#include <rpcproxy.h>

Include dependency graph for dlldata.c:

Include dependency graph

Go to the source code of this file.

Functions

PROXYFILE_LIST_START REFERENCE_PROXY_FILE (CVS_Coworker)

Function Documentation

PROXYFILE_LIST_START REFERENCE_PROXY_FILE ( CVS_Coworker )

Generated on Sun Feb 24 01:23:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ExploreBar.cpp File Reference

WinCvs/ExploreBar.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "MainFrm.h"
#include "ExploreBar.h"
#include "BrowseFileView.h"
#include "FileTraversal.h"
#include "CvsCommands.h"
#include "CvsPrefs.h"

Include dependency graph for ExploreBar.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:47 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ExploreBar.h File Reference

WinCvs/ExploreBar.h File Reference

#include "CJShellTree.h"

Include dependency graph for ExploreBar.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CExploreBar
class | CMyShellTree

Defines

#define | AFX_EXPLOREBAR_H__A132A164_1A90_11D3_B1A1_004095463819__INCLUDED_

Define Documentation

#define AFX_EXPLOREBAR_H__A132A164_1A90_11D3_B1A1_004095463819__INCLUDED_

Definition at line 2 of file ExploreBar.h.

Generated on Sun Feb 24 01:23:47 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


FileViewWatcher.cpp File Reference

WinCvs/FileViewWatcher.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "FileViewWatcher.h"

Include dependency graph for FileViewWatcher.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


FileViewWatcher.h File Reference

WinCvs/FileViewWatcher.h File Reference

#include <afxmt.h>

Include dependency graph for FileViewWatcher.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class KoWatcher

Generated on Sun Feb 24 01:23:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


findtcl.cpp File Reference

WinCvs/findtcl.cpp File Reference

#include "stdafx.h"
#include <string>
#include <deque>
#include <algorithm>
#include <windows.h>

Include dependency graph for findtcl.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void | buildTail (char *, const char *, int)
void | buildWildTail (char *, char *, int)
bool | verRemove (std::string &)
bool | verLess (std::string &, std::string &)
bool | fileRemove (std::string &)
bool | fileLess (std::string &, std::string &)
char * | findTcl (char *_minVer, int _exact, int _dbgOnly)

Variables

char * | minVer
int | exact
int | dbgOnly

Function Documentation

void buildTail | ( | char * | ,
 |  | const char * | ,
 |  | int |
 | ) | [static]

Definition at line 269 of file findtcl.cpp.

References dbgOnly.

Referenced by findTcl.

00270 {
00271     const char *pos2;
00272     char *shLibExt = ".dll";
00273
00274     /* append version w/o decimal */
00275     pos2 = ver;
00276     while (*pos2 != '\0') {
00277         if (*pos2 != '.') *pos++ = *pos2++;
00278         else pos2++;
00279     };
00280
00281     /* if asked, add the debug suffix */
00282     if (dbgOnly != 0) *pos++ = 'd';
00283
00284     /* append the extension */
00285     pos2 = shLibExt;
00286     while (*pos2 != '\0') {
00287         *pos++ = *pos2++;
00288     };
00289
00290     /* terminate it */
00291     *pos = '\0';
00292 };

void buildWildTail | ( | char * | ,
 |  | char * | ,
 |  | int |
 | ) | [static]

Definition at line 296 of file findtcl.cpp.

References dbgOnly.

Referenced by findTcl.

00297 {
00298     char *pos2;
00299     char *shLibExt = ".dll";
00300
00301     /* just append the major version */
00302     *pos++ = *ver;
00303     *pos++ = '?';
00304
00305     /* if asked, add the debug suffix */
00306     if (dbgOnly != 0) *pos++ = 'd';
00307
00308     /* append the extension */
00309     pos2 = shLibExt;
00310     while (*pos2 != '\0') {
00311         *pos++ = *pos2++;
00312     };
00313
00314     /* terminate it */
00315     *pos = '\0';
00316 };

bool fileLess | ( | std::string & | ,
 |  | std::string & |
 | ) | [static]

Definition at line 352 of file findtcl.cpp.

References verLess.

Referenced by findTcl.

00353 {
00354   return verLess(
00355       a.substr(3,1) + "." + a.substr(4,1),
00356       b.substr(3,1) + "." + b.substr(4,1)
00357       );
00358 }

bool fileRemove ( std::string & ) [static]

Definition at line 345 of file findtcl.cpp.

References verRemove.

Referenced by findTcl.

00346 {
00347     // strip off 'tcl' and '.dll'
00348     return verRemove(f.substr(3,1) + "." + f.substr(4,1));
00349 }

char* findTcl | ( | char * | _minVer,
 |  | int | _exact,
 |  | int | _dbgOnly
 | ) |

Definition at line 25 of file findtcl.cpp.

References buildTail, buildWildTail, dbgOnly, err, exact, fileLess, fileRemove, MAX_PATH, minVer, NULL, verLess, and verRemove.

Referenced by CTcl_Interp::IsAvail.

00026 {
00027     //char *tclRootPath = NULL;
00028     static char tclLibFullPath[MAX_PATH];
00029     char *savedPos;
00030     char *pos1, *pos2;
00031     char *prefix = "\\bin\\tcl";
00032     WIN32_FIND_DATA hFFData;
00033     HANDLE hFind;
00034     int i = 0;
00035     std::deque<std::string> vers;
00036     std::deque<std::string>::iterator versNewLast;
00037
00038
00039     minVer = _minVer;
00040     exact = _exact;
00041     dbgOnly = _dbgOnly;
00042
00043
00044     // Look in the current path on the assumption if it's there, you want to use
00045     // it instead of any others if it passes the version test.
00046
00047     // Append the beginning
00048     pos1 = tclLibFullPath;
00049     pos2 = ".\\tcl";
00050     while (*pos2 != '\0') { *pos1++ = *pos2++; };
00051     savedPos = pos1;
00052
00053     if (exact != 0)
00054     {
00055         // build the end of the filename from the parameter given
00056         buildTail(savedPos, minVer, dbgOnly);
00057
00058         // See if it *really* exists
00059         hFind = ::FindFirstFile(tclLibFullPath, &hFFData);
00060
00061         if (hFind != INVALID_HANDLE_VALUE)
00062         {
00063             // gotcha.
00064             ::FindClose(hFind);
00065             return tclLibFullPath;
00066         }
00067         // no success..  fall through for registry search
00068
00069     }
00070     else
00071     {
00072
00073         // Try a range of filenames
00074         buildWildTail(savedPos, minVer, dbgOnly);
00075
00076         // See if we got some
00077         hFind = ::FindFirstFile(tclLibFullPath, &hFFData);
00078
00079         if (hFind != INVALID_HANDLE_VALUE)
00080         {
00081             BOOL rtn;
00082
00083             do
00084             {
00085                 vers.push_back(std::string(hFFData.cFileName));
00086                 rtn = ::FindNextFile(hFind, &hFFData);
00087             } while (rtn != 0);   // got more?
00088
00089             ::FindClose(hFind);
00090
00091             // sort filename strings
00092             std::sort(vers.begin(), vers.end(), fileLess);
00093
00094             // remove all invalid entries based on flags.
00095             versNewLast = std::remove_if(vers.begin(), vers.end(), fileRemove);
00096
00097             if (vers.begin() != versNewLast) {
00098                 // using copy itself doesn't terminate the string...  how odd..
00099                 tclLibFullPath [(versNewLast - 1)->copy(tclLibFullPath, MAX_PATH)] = '\0';
00100                 return tclLibFullPath;
00101             }
00102         }
00103
00104         // no success..  fall through for registry search
00105     }
00106
00107
00108     // Do a registry search.
00109     HKEY topTclKey = NULL, subTclVer = NULL;
00110     DWORD max_path = MAX_PATH;
00111     LONG result;
00112     char sSubKey[MAX_PATH];
00113     const char *verTarget;
00114
00115     result = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
00116         "SOFTWARE\\Scriptics\\Tcl",
00117         0,
00118         KEY_ENUMERATE_SUB_KEYS,
00119         &topTclKey);
00120
00121     if (result != ERROR_SUCCESS)
00122     {
00123         // active TCL
00124         //HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TclScript\DefaultIcon
00125         result = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
00126             "SOFTWARE\\Classes\\TclScript\\DefaultIcon",
00127             0,
00128             KEY_QUERY_VALUE,
00129             &topTclKey);
00130
00131         if (result == ERROR_SUCCESS)
00132         {
00133             result = RegQueryValueEx(topTclKey,
00134                 "",
00135                 NULL,
00136                 NULL,
00137                 reinterpret_cast<PUCHAR>(tclLibFullPath),
00138                 &max_path);
00139
00140             RegCloseKey(topTclKey);
00141
00142             if (result == ERROR_SUCCESS)
00143             {
00144                 CString s(tclLibFullPath);
00145                 s.Replace("tk", "tcl");
00146                 strcpy(tclLibFullPath, s);
00147                 char *tmp = strrchr(tclLibFullPath, ',');
00148                 if(tmp != 0L)
00149                     *tmp = '\0';
00150                 return tclLibFullPath;
00151             }
00152         }
00153
00154         if (result != ERROR_SUCCESS)
00155         {
00156             std::string err("The registry path (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl) does not exist.");
00157             err.append("  Redo your Tcl install or, assuming you compiled your own core, read /win/README from the source distribution.");
00158             throw err;
00159         }
00160     }
00161
00162     // Read all SubKey names
00163  enumAgain:
00164     result = RegEnumKey(topTclKey, i, sSubKey, MAX_PATH);
00165     if (result != ERROR_NO_MORE_ITEMS) {
00166         vers.push_back(std::string(sSubKey));
00167         i++; goto enumAgain;
00168     }
00169     else if (i == 0)
00170     {
00171         std::string err("The registry path (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl) has no SubKeys.");
00172         err.append("  Reinstall Tcl to fix this or hand edit your registry.");
00173         RegCloseKey(topTclKey);
00174         throw err;
00175     }
00176
00177     // sort version strings
00178     std::sort(vers.begin(), vers.end(), verLess);
00179
00180     // remove all invalid entries based on flags.
00181     versNewLast = std::remove_if(vers.begin(), vers.end(), verRemove);
00182
00183     if (vers.begin() != versNewLast)
00184         verTarget = (versNewLast - 1)->c_str();
00185     else
00186     {
00187         std::string err("Unable to locate a proper Tcl core in the registry for version ");
00188         err.append(minVer);
00189         if (exact != 0)
00190             err.append(".");
00191         else
00192             err.append(" or greater.");
00193         RegCloseKey(topTclKey);
00194         throw err;
00195     }
00196
00197     result = RegOpenKeyEx(topTclKey,
00198         verTarget,
00199         0,
00200         KEY_READ,
00201         &subTclVer);
00202
00203     if (result != ERROR_SUCCESS)
00204     {
00205         std::string err("The registry path (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl<target>) does not exist.");
00206         err.append("  Redo your Tcl install or, assuming you compiled your own core, read /win/README from the source distribution.");
00207         RegCloseKey(topTclKey);
00208         throw err;
00209     }
00210
00211     result = RegQueryValueEx(subTclVer,
00212         "Root",
00213         NULL,
00214         NULL,
00215         reinterpret_cast<PUCHAR>(tclLibFullPath),
00216         &max_path);
00217
00218     if (result != ERROR_SUCCESS)
00219     {
00220         std::string err("The registry path (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\");
00221         err.append(verTarget);
00222         err.append(") did not have a \"Root\" SubKey.");
00223         RegCloseKey(topTclKey);
00224         RegCloseKey(subTclVer);
00225         throw err;
00226     };
00227
00228     pos1 = tclLibFullPath;
00229     while (*pos1 != '\0') { pos1++; }
00230
00231     // Append the bin directory and prefix
00232     pos2 = prefix;
00233     while (*pos2 != '\0') { *pos1++ = *pos2++; };
00234     savedPos = pos1;
00235
00236     // Build the end of the filename
00237     buildTail(savedPos, verTarget, dbgOnly);
00238
00239     // See if it *really* exists
00240     hFind = ::FindFirstFile(tclLibFullPath, &hFFData);
00241
00242     if (hFind != INVALID_HANDLE_VALUE) {
00243         // gotcha.
00244         ::FindClose(hFind);
00245         RegCloseKey(topTclKey);
00246         RegCloseKey(subTclVer);
00247         return tclLibFullPath;
00248     }
00249     else
00250     {
00251         ::FindClose(hFind);
00252         std::string err("The registry key (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\");
00253         err.append(minVer);
00254         err.append("\\Root) said a core was located at (");
00255         err.append(tclLibFullPath);
00256         err.append(").  This was found to be false.");
00257         RegCloseKey(topTclKey);
00258         RegCloseKey(subTclVer);
00259         throw err;
00260     }
00261
00262     RegCloseKey(topTclKey);
00263     RegCloseKey(subTclVer);
00264     throw std::string("A proper Tcl core could not be found anywhere.");
00265     return NULL;
00266 }

bool verLess | ( | std::string & | ,
 |  | std::string & |
 | ) | [static]

Definition at line 337 of file findtcl.cpp.

Referenced by fileLess, and findTcl.

00337                                                 {
00338     double fa, fb;
00339     fa = atof(a.c_str());
00340     fb = atof(b.c_str());
00341     return (fa < fb);
00342 };

bool verRemove ( std::string & ) [static]

Definition at line 318 of file findtcl.cpp.

References exact, and minVer.

Referenced by fileRemove, and findTcl.

00319 {
00320     double fa, fb;
00321     fa = atof(s.c_str());
00322     fb = atof(minVer);
00323
00324     if (exact == 0)
00325     {
00326         // remove when major version is different.
00327         if ((int)fa != (int)fb)
00328             return true;
00329         // remove when less than minor version
00330         return (fa - (int)fa < fb - (int)fb);
00331     }
00332     else
00333         // remove when not identical for an exact match
00334         return (fa != fb);
00335 };

Variable Documentation

int dbgOnly [static]

Definition at line 22 of file findtcl.cpp.

Referenced by buildTail, buildWildTail, and findTcl.

int exact [static]

Definition at line 21 of file findtcl.cpp.

Referenced by findTcl, and verRemove.

char* minVer [static]

Definition at line 20 of file findtcl.cpp.

Referenced by findTcl, and verRemove.

Generated on Sun Feb 24 01:23:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GraphDoc.cpp File Reference

WinCvs/GraphDoc.cpp File Reference

#include "stdafx.h"
#include <direct.h>
#include <sys/stat.h>
#include "Wincvs.h"
#include "GraphDoc.h"
#include "CvsLog.h"
#include "WinCvsView.h"
#include "GraphView.h"
#include "CvsEntries.h"

Include dependency graph for GraphDoc.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void | NormalizeFn (const char *folder, const char *fn, char *dir, char *name)

Variables

const IID | IID_ITest

Function Documentation

void NormalizeFn | ( | const char * | folder,
 |  | const char * | fn,
 |  | char * | dir,
 |  | char * | name
 | ) | [static]

Definition at line 121 of file GraphDoc.cpp.

References NULL.

Referenced by CGraphDoc::SetNode.

00122 {
00123     char buffer[_MAX_PATH];
00124     char dirBuffer[_MAX_PATH];
00125     char nameBuffer[_MAX_PATH];
00126     char drive[_MAX_PATH];
00127     char ext[_MAX_EXT];
00128     _makepath(buffer, NULL, folder, fn, NULL);
00129     _splitpath(buffer, drive, dirBuffer, nameBuffer, ext);
00130     _makepath(dir, drive, dirBuffer, NULL, NULL);
00131     _makepath(name, NULL, NULL, nameBuffer, ext);
00132 }

Variable Documentation

const IID IID_ITest [static]

Initial value:

{ 0x9f456b5, 0x18, 0x11d2, { 0xbc, 0xaa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }

Definition at line 68 of file GraphDoc.cpp.

Generated on Sun Feb 24 01:23:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GraphDoc.h File Reference

WinCvs/GraphDoc.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CGraphDoc

Defines

#define | AFX_GRAPHDOC_H__09F456C1_0018_11D2_BCAA_000000000000__INCLUDED_

Define Documentation

#define AFX_GRAPHDOC_H__09F456C1_0018_11D2_BCAA_000000000000__INCLUDED_

Definition at line 26 of file GraphDoc.h.

Generated on Sun Feb 24 01:23:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GraphFrm.cpp File Reference

WinCvs/GraphFrm.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "GraphFrm.h"
#include "GraphView.h"
#include "WinCvsView.h"
#include "MainFrm.h"

Include dependency graph for GraphFrm.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GraphFrm.h File Reference

WinCvs/GraphFrm.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CGraphFrame

Defines

#define | AFX_GRAPHFRM_H__09F456BF_0018_11D2_BCAA_000000000000__INCLUDED_

Define Documentation

#define AFX_GRAPHFRM_H__09F456BF_0018_11D2_BCAA_000000000000__INCLUDED_

Definition at line 26 of file GraphFrm.h.

Generated on Sun Feb 24 01:23:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GraphView.cpp File Reference

WinCvs/GraphView.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "GraphView.h"
#include "GraphDoc.h"
#include "AppConsole.h"
#include "LogParse.h"
#include "CvsEntries.h"
#include "BrowseFileView.h"
#include "WinCvsBrowser.h"
#include "CvsArgs.h"
#include "AppGlue.h"
#include "WincvsView.h"
#include "CvsPrefs.h"
#include "FileTraversal.h"
#include "ProgressDialog.h"
#include "GraphOptDlg.h"
#include "AdminOptionDlg.h"
#include "CvsAlert.h"
#include "CvsCommands.h"

Include dependency graph for GraphView.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | CGraphConsole
class | CGraphRectTracker
class | CRevisionConsole
class | TGraph
class | TGraphCmdStatus
class | TGraphDelCmd
class | TGraphRectSelect
class | TGraphSelNonSig
class | CWinLogBranchData
class | CWinLogData
class | CWinLogHeaderData
class | CWinLogRevData
class | CWinLogTagData

Enumerations

enum kTGraph {
kTContinue,
kTGetDown,
kTStop
}

Functions

CPersistentInt | gGraphSelColor ("P_GraphSelColor", RGB(160, 160, 160))
CPersistentInt | gGraphShadowColor ("P_GraphShadowColor", RGB(128, 128, 128))
CPersistentInt | gGraphHeaderColor ("P_GraphHeaderColor", RGB(255, 0, 0))
CPersistentInt | gGraphTagColor ("P_GraphTagColor", RGB(0, 0, 0))
CPersistentInt | gGraphBranchColor ("P_GraphBranchColor", RGB(0, 0, 255))
CPersistentInt | gGraphNodeColor ("P_GraphNodeColor", RGB(0, 0, 255))
CPersistentInt | gGraphDeadNodeColor ("P_GraphDeadNodeColor", RGB(255, 0, 0))
CPersistentInt | gGraphUserStateNodeColor ("P_GraphUserStateNodeColor", RGB(0, 128, 64))
void | DrawOctangle (CDC &hdc, const CRect &selfB)
helper function to draw the figure used for branch tag representation. More...

void | DrawNode (CDC &hdc, const CRect &selfB, COLORREF contour, kNodeShape shape, bool issel, int penStyle=PS_SOLID)

Variables

const int | kVChildSpace = 8
const int | kHChildSpace = 40
const int | kInflateNodeSpace = 8

Enumeration Type Documentation

enum kTGraph

Enumeration values:
kTContinue
kTGetDown
kTStop

Definition at line 901 of file GraphView.cpp.

Referenced by TGraph::TraverseGraph, TGraphSelNonSig::TraverseNode, TGraphDelCmd::TraverseNode, TGraphCmdStatus::TraverseNode, and TGraphRectSelect::TraverseNode.

00902 {
00903     kTContinue,
00904     kTGetDown,
00905     kTStop
00906 } kTGraph;

Function Documentation

void DrawNode | ( | CDC & | hdc,
 |  | const CRect & | selfB,
 |  | COLORREF | contour,
 |  | kNodeShape | shape,
 |  | bool | issel,
 |  | int | penStyle = PS_SOLID
 | ) | [static]

Definition at line 235 of file GraphView.cpp.

References ASSERT, DrawOctangle, FALSE, kNodeShape, kOctangle, kRectangle, kRoundRect, ROUND_RECT_PT, and SHADOW_OFFSET_PT.

00238 {
00239     CPen *pOldPen = 0L;
00240     CBrush *pOldBrush = 0L;
00241     CPen pen, pen2;
00242     CBrush brush;
00243     COLORREF selcolor = gGraphSelColor;
00244     COLORREF shadowc = gGraphShadowColor;
00245
00246     TRY
00247     {
00248         //prepare the shadow
00249         CRect shadow = selfB;
00250         shadow.OffsetRect(SHADOW_OFFSET_PT);
00251
00252         brush.CreateSolidBrush(shadowc);
00253         pOldBrush = hdc.SelectObject(&brush);
00254         pen.CreatePen(penStyle, 1, shadowc);
00255         pOldPen = hdc.SelectObject(&pen);
00256
00257         //draw the shadow
00258         switch( shape )
00259         {
00260         case kRectangle:
00261             hdc.Rectangle(shadow);
00262             break;
00263         case kRoundRect:
00264             hdc.RoundRect(shadow, ROUND_RECT_PT);
00265             break;
00266         case kOctangle:
00267             DrawOctangle(hdc, shadow);
00268             break;
00269         default:
00270             ASSERT(FALSE);  //unknown type
00271             return;
00272         }
00273
00274         //prepare selection
00275         if( issel )
00276         {
00277             brush.DeleteObject();
00278             brush.CreateSolidBrush(selcolor);
00279             hdc.SelectObject(&brush);
00280         }
00281         else
00282         {
00283             hdc.SelectObject(pOldBrush);
00284             pOldBrush = 0L;
00285         }
00286
00287         pen2.CreatePen(penStyle, 1, contour);
00288         hdc.SelectObject(&pen2);
00289
00290         //draw the main shape
00291         switch( shape )
00292         {
00293         case kRectangle:
00294             hdc.Rectangle(selfB);
00295             break;
00296         case kRoundRect:
00297             hdc.RoundRect(selfB, ROUND_RECT_PT);
00298             break;
00299         case kOctangle:
00300             DrawOctangle(hdc, selfB);
00301             break;
00302         default:
00303             ASSERT(FALSE);  //unknown type
00304             return;
00305         }
00306
00307         //cleanup
00308         if (pOldPen != 0L)
00309         {
00310             hdc.SelectObject(pOldPen);
00311             pOldPen = 0L;
00312         }
00313         if (pOldBrush != 0L)
00314         {
00315             hdc.SelectObject(pOldBrush);
00316             pOldBrush = 0L;
00317         }
00318
00319         pen.DeleteObject();
00320         pen2.DeleteObject();
00321         brush.DeleteObject();
00322     }
00323     CATCH_ALL(e)
00324     {
00325         if (pOldPen != 0L)
00326             hdc.SelectObject(pOldPen);
00327         if (pOldBrush != 0L)
00328             hdc.SelectObject(pOldBrush);
00329     }
00330     END_CATCH_ALL
00331 }

void DrawOctangle | ( | CDC & | hdc,
 |  | const CRect & | selfB
 | ) | [static]

helper function to draw the figure used for branch tag representation.

Definition at line 211 of file GraphView.cpp.

References OCTANGLE_COUNT.

Referenced by DrawNode.

00212 {
00213     int cutLen = selfB.Height() / 4;
00214     CPoint point1(selfB.left, selfB.top + cutLen);
00215     CPoint point2(selfB.left + cutLen, selfB.top);
00216     CPoint point3(selfB.right - cutLen, selfB.top);
00217     CPoint point4(selfB.right, selfB.top + cutLen);
00218     CPoint point5(selfB.right, selfB.bottom - cutLen);
00219     CPoint point6(selfB.right - cutLen, selfB.bottom);
00220     CPoint point7(selfB.left + cutLen, selfB.bottom);
00221     CPoint point8(selfB.left, selfB.bottom - cutLen);
00222     CPoint arrPoints[OCTANGLE_COUNT] = {
00223         point1,
00224         point2,
00225         point3,
00226         point4,
00227         point5,
00228         point6,
00229         point7,
00230         point8};
00231
00232     hdc.Polygon(arrPoints, OCTANGLE_COUNT);
00233 }

CPersistentInt gGraphBranchColor | ( | "P_GraphBranchColor" | ,
 |  | RGB(0, 0, 255) |
 | ) |

CPersistentInt gGraphDeadNodeColor | ( | "P_GraphDeadNodeColor" | ,
 |  | RGB(255, 0, 0) |
 | ) |

CPersistentInt gGraphHeaderColor | ( | "P_GraphHeaderColor" | ,
 |  | RGB(255, 0, 0) |
 | ) |

CPersistentInt gGraphNodeColor | ( | "P_GraphNodeColor" | ,
 |  | RGB(0, 0, 255) |
 | ) |

CPersistentInt gGraphSelColor | ( | "P_GraphSelColor" | ,
 |  | RGB(160, 160, 160) |
 | ) |

CPersistentInt gGraphShadowColor | ( | "P_GraphShadowColor" | ,
 |  | RGB(128, 128, 128) |
 | ) |

CPersistentInt gGraphTagColor | ( | "P_GraphTagColor" | ,
 |  | RGB(0, 0, 0) |
 | ) |

CPersistentInt gGraphUserStateNodeColor | ( | "P_GraphUserStateNodeColor" | ,
 |  | RGB(0, 128, 64) |
 | ) |

Variable Documentation

const int kHChildSpace = 40

Definition at line 551 of file GraphView.cpp.

Referenced by CWinLogData::ComputeBounds, and CWinLogData::Update.

const int kInflateNodeSpace = 8

Definition at line 552 of file GraphView.cpp.

Referenced by CWinLogData::ComputeBounds.

const int kVChildSpace = 8

Definition at line 550 of file GraphView.cpp.

Referenced by CWinLogData::ComputeBounds.

Generated on Sun Feb 24 01:23:50 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GraphView.h File Reference

WinCvs/GraphView.h File Reference

#include "CvsLog.h"

Include dependency graph for GraphView.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CGraphView

Defines

#define | AFX_GRAPHVIEW_H__7A07C311_03F9_11D2_BCB2_000000000000__INCLUDED_
#define | STARTPOINT_PT (CPoint(5, 5))
#define | OCTANGLE_COUNT 8
#define | SHADOW_OFFSET_PT (CPoint(4, 4))
#define | ROUND_RECT_PT (CPoint(6, 6))
#define | RGB_DEF_SEL RGB(160, 160, 160)
#define | RGB_DEF_SHADOW RGB(128, 128, 128)
#define | RGB_DEF_HEADER RGB(255, 0, 0)
#define | RGB_DEF_TAG RGB(0, 0, 0)
#define | RGB_DEF_BRANCH RGB(0, 0, 255)
#define | RGB_DEF_NODE RGB(0, 0, 255)
#define | RGB_DEF_DEADNODE RGB(255, 0, 0)
#define | RGB_DEF_USERSTATENODE RGB(0, 128, 64)
#define | STYLE_DEADNODE PS_DOT
#define | STYLE_USERSTATENODE PS_DASH

Enumerations

enum kNodeShape {
kRectangle,
kRoundRect,
kOctangle
}

Define Documentation

#define AFX_GRAPHVIEW_H__7A07C311_03F9_11D2_BCB2_000000000000__INCLUDED_

Definition at line 18 of file GraphView.h.

#define OCTANGLE_COUNT 8

Definition at line 30 of file GraphView.h.

Referenced by DrawOctangle.

#define RGB_DEF_BRANCH RGB(0, 0, 255)

Definition at line 38 of file GraphView.h.

Referenced by CGraphOptDlg::OnReset.

#define RGB_DEF_DEADNODE RGB(255, 0, 0)

Definition at line 40 of file GraphView.h.

Referenced by CGraphOptDlg::OnReset.

#define RGB_DEF_HEADER RGB(255, 0, 0)

Definition at line 36 of file GraphView.h.

Referenced by CGraphOptDlg::OnReset.

#define RGB_DEF_NODE RGB(0, 0, 255)

Definition at line 39 of file GraphView.h.

Referenced by CGraphOptDlg::OnReset.

#define RGB_DEF_SEL RGB(160, 160, 160)

Definition at line 34 of file GraphView.h.

Referenced by CGraphOptDlg::OnReset.

#define RGB_DEF_SHADOW RGB(128, 128, 128)

Definition at line 35 of file GraphView.h.

Referenced by CGraphOptDlg::OnReset.

#define RGB_DEF_TAG RGB(0, 0, 0)

Definition at line 37 of file GraphView.h.

Referenced by CGraphOptDlg::OnReset.

#define RGB_DEF_USERSTATENODE RGB(0, 128, 64)

Definition at line 41 of file GraphView.h.

Referenced by CGraphOptDlg::OnReset.

#define ROUND_RECT_PT (CPoint(6, 6))

Definition at line 32 of file GraphView.h.

Referenced by DrawNode.

#define SHADOW_OFFSET_PT (CPoint(4, 4))

Definition at line 31 of file GraphView.h.

Referenced by CGraphView::CalcImageSize, and DrawNode.

#define STARTPOINT_PT (CPoint(5, 5))

Definition at line 28 of file GraphView.h.

Referenced by CGraphView::CalcImageSize.

#define STYLE_DEADNODE PS_DOT

Definition at line 42 of file GraphView.h.

Referenced by CWinLogRevData::UpdateSelf.

#define STYLE_USERSTATENODE PS_DASH

Definition at line 43 of file GraphView.h.

Referenced by CWinLogRevData::UpdateSelf.

Enumeration Type Documentation

enum kNodeShape

Enumeration values:
kRectangle
kRoundRect
kOctangle

Definition at line 45 of file GraphView.h.

Referenced by DrawNode.

00046 {
00047     kRectangle,
00048     kRoundRect,
00049     kOctangle
00050 } kNodeShape;

Generated on Sun Feb 24 01:23:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


HistComboBoxEx.cpp File Reference

WinCvs/HistComboBoxEx.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "HistComboBoxEx.h"
#include "FileTraversal.h"
#include "CvsEntries.h"
#include "MainFrm.h"
#include "CvsAlert.h"

Include dependency graph for HistComboBoxEx.cpp:

Include dependency graph

Go to the source code of this file.

Functions

PCPStr | gOldLoc ("P_BrowserLoc","C:\\")
int | TraverseHistory (CHistComboBoxEx &browseHist)

Function Documentation

PCPStr gOldLoc | ( | "P_BrowserLoc" | ,
 |  | "C:\\" |
 | ) | [static]

int TraverseHistory ( CHistComboBoxEx & browseHist )

Definition at line 41 of file HistComboBoxEx.cpp.

References MAX_PATH, and CHistComboBoxEx::SetIcon.

Referenced by CHistComboBoxEx::OnDropdown.

00042 {
00043     char szPath[MAX_PATH] = "";
00044     for( int nIndex = 0; nIndex < browseHist.GetCount(); nIndex++ )
00045     {
00046         COMBOBOXEXITEM cbi;
00047         cbi.mask = CBEIF_TEXT;
00048         cbi.iItem = nIndex;
00049         cbi.pszText = szPath;
00050         cbi.cchTextMax = MAX_PATH;
00051
00052         browseHist.GetItem(&cbi);
00053         browseHist.SetIcon(cbi);
00054     }
00055
00056     return nIndex;
00057 }

Generated on Sun Feb 24 01:23:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


HistComboBoxEx.h File Reference

WinCvs/HistComboBoxEx.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CHistComboBoxEx

Defines

#define | AFX_HISTCOMBOBOXEX_H__E330E7B9_8C79_44CB_8F07_01D395975365__INCLUDED_
#define | HISTLOC_IMAGE_CX 16
#define | HISTLOC_VISIBLEITEMS 8

Enumerations

enum {
kLocationIconUnknown = 0,
kLocationIcon,
kLocationIconIgnored,
kLocationIconMissing,
kLocationIconErased
}

Define Documentation

#define AFX_HISTCOMBOBOXEX_H__E330E7B9_8C79_44CB_8F07_01D395975365__INCLUDED_

Definition at line 22 of file HistComboBoxEx.h.

#define HISTLOC_IMAGE_CX 16

Definition at line 30 of file HistComboBoxEx.h.

Referenced by CHistComboBoxEx::CalcDroppedWidth, CMainFrame::OnCreate, and CHistComboBoxEx::SetIcon.

#define HISTLOC_VISIBLEITEMS 8

Definition at line 31 of file HistComboBoxEx.h.

Referenced by CMainFrame::OnCreate.

Enumeration Type Documentation

anonymous enum

Enumeration values:
kLocationIconUnknown
kLocationIcon
kLocationIconIgnored
kLocationIconMissing
kLocationIconErased

Definition at line 33 of file HistComboBoxEx.h.

00034 {
00035     kLocationIconUnknown = 0,
00036     kLocationIcon,
00037     kLocationIconIgnored,
00038     kLocationIconMissing,
00039     kLocationIconErased
00040 };

Generated on Sun Feb 24 01:23:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LogFrm.cpp File Reference

WinCvs/LogFrm.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "LogFrm.h"
#include "WinCvsBrowser.h"
#include "BrowseFileView.h"
#include "WincvsView.h"
#include "MainFrm.h"
#include "wincvs_winutil.h"

Include dependency graph for LogFrm.cpp:

Include dependency graph

Go to the source code of this file.

Functions

BOOL IsKeyMovingFocus (MSG *pMsg)

Function Documentation

BOOL IsKeyMovingFocus ( MSG * pMsg ) [inline]

Definition at line 44 of file LogFrm.cpp.

00045 {
00046      return ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_TAB) &&
00047          (!(0x8000 & GetKeyState(VK_CONTROL)))
00048          );
00049 }

Generated on Sun Feb 24 01:23:52 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LogFrm.h File Reference

WinCvs/LogFrm.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CLogFrame

Defines

#define | AFX_CHILDFRM_H__09F456BF_0018_11D2_BCAA_000000000000__INCLUDED_

Define Documentation

#define AFX_CHILDFRM_H__09F456BF_0018_11D2_BCAA_000000000000__INCLUDED_

Definition at line 26 of file LogFrm.h.

Generated on Sun Feb 24 01:23:52 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MainFrm.cpp File Reference

WinCvs/MainFrm.cpp File Reference

#include "stdafx.h"
#include <afxmt.h>
#include "wincvs.h"
#include "MainFrm.h"
#include "WinCvsBrowser.h"
#include "BrowseFileView.h"
#include "WincvsView.h"
#include "Persistent.h"
#include "AppConsole.h"
#include "Splash.h"
#include "BrowserBar.h"
#include "ExploreBar.h"
#include "CvsPrefs.h"
#include "AppGlue.h"

Include dependency graph for MainFrm.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | CWinPlacement

Functions

CMString | gHistoryLocs (100,"P_BrowserLocs")
bool | IsAppEnabled ()
CWinPlacement | gMainPlacement ("P_MainPlacement")
void | onFilterMaskEntered (CObject *obj)
CSemaphore | sGetEnv (0)

Variables

UINT | indicators []
bool | sAskingMainThread
UStr sGetEnvResult

Function Documentation

CMString gHistoryLocs | ( | 100 | ,
 |  | "P_BrowserLocs" |
 | ) |

CWinPlacement gMainPlacement ( "P_MainPlacement" ) [static]

bool IsAppEnabled ( ) [static]

Definition at line 52 of file MainFrm.cpp.

References CWincvsApp::gCvsRunning.

Referenced by CMainFrame::OnUpdateFilterMask, CMainFrame::OnUpdateHistory, CMainFrame::OnUpdateViewAdded, CMainFrame::OnUpdateViewChanged, CMainFrame::OnUpdateViewConflict, CMainFrame::OnUpdateViewHideunknown, CMainFrame::OnUpdateViewIgnore, CMainFrame::OnUpdateViewMissing, CMainFrame::OnUpdateViewModified, CMainFrame::OnUpdateViewRecursive, CMainFrame::OnUpdateViewRemoved, and CMainFrame::OnUpdateViewUnknown.

00053 {
00054     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00055     return !app->gCvsRunning && !gCvsPrefs.empty();
00056 }

void onFilterMaskEntered ( CObject * obj ) [static]

Definition at line 222 of file MainFrm.cpp.

Referenced by CMainFrame::OnCreate.

00223 {
00224     ((CMainFrame *)obj)->OnFilterMaskEntered();
00225 }

CSemaphore sGetEnv ( 0 ) [static]

Referenced by CMainFrame::GetEnvMainThread, and CMainFrame::OnTimer.

Variable Documentation

UINT indicators[] [static]

Initial value:

{
    ID_SEPARATOR,
    ID_SEPARATOR,
    ID_INDICATOR_CAPS,
    ID_INDICATOR_NUM,
    ID_INDICATOR_SCRL,
}

Definition at line 161 of file MainFrm.cpp.

Referenced by CMainFrame::OnCreate.

bool sAskingMainThread [static]

Definition at line 908 of file MainFrm.cpp.

Referenced by CMainFrame::GetEnvMainThread, and CMainFrame::OnTimer.

UStr sGetEnvResult [static]

Definition at line 909 of file MainFrm.cpp.

Generated on Sun Feb 24 01:23:52 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MainFrm.h File Reference

WinCvs/MainFrm.h File Reference

#include "ConsoleBar.h"
#include "CvsStatusBar.h"
#include "BrowseViewModel.h"
#include "ToolbarCombo.h"
#include "HistComboBoxEx.h"

Include dependency graph for MainFrm.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CMainFrame

Defines

#define | AFX_MAINFRM_H__D2D77DCC_8299_11D1_8949_444553540000__INCLUDED_

Define Documentation

#define AFX_MAINFRM_H__D2D77DCC_8299_11D1_8949_444553540000__INCLUDED_

Definition at line 6 of file MainFrm.h.

Generated on Sun Feb 24 01:23:53 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ndir.c File Reference

WinCvs/ndir.c File Reference

#include <io.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dos.h>
#include <ndir.h>

Include dependency graph for ndir.c:

Include dependency graph

Go to the source code of this file.

Defines

#define | ATTRIBUTES (_A_RDONLY | _A_HIDDEN | _A_SYSTEM | _A_SUBDIR)

Functions

void | free_dircontents (struct _dircontents *)
DIR * | opendir (const char *name)
void | closedir (DIR *dirp)
direct * | readdir (DIR *dirp)
void | seekdir (DIR *dirp, long off)
long | telldir (DIR *dirp)

Define Documentation

#define ATTRIBUTES (_A_RDONLY | _A_HIDDEN | _A_SYSTEM | _A_SUBDIR)

Definition at line 38 of file ndir.c.

Function Documentation

void closedir ( DIR * dirp )

Definition at line 116 of file ndir.c.

References _dirdesc::dd_contents, free, and free_dircontents.

00117 {
00118   free_dircontents (dirp->dd_contents);
00119   free ((char *) dirp);
00120 }

void free_dircontents ( struct _dircontents * ) [static]

Definition at line 168 of file ndir.c.

References _dircontents::_d_entry, _dircontents::_d_next, and free.

Referenced by closedir, and opendir.

00169 {
00170   struct _dircontents *odp;
00171
00172   while (dp)
00173     {
00174       if (dp->_d_entry)
00175     free (dp->_d_entry);
00176       dp = (odp = dp)->_d_next;
00177       free (odp);
00178     }
00179 }

DIR* opendir ( const char * name )

Definition at line 43 of file ndir.c.

References _dircontents::_d_entry, _dircontents::_d_next, free, free_dircontents, and malloc.

00044 {
00045   struct _finddata_t find_buf;
00046   DIR *dirp;
00047   struct _dircontents *dp;
00048   char name_buf[_MAX_PATH + 1];
00049   char *slash = "";
00050   long hFile;
00051
00052   if (!name)
00053     name = "";
00054   else if (*name)
00055     {
00056       const char *s;
00057       int l = strlen (name);
00058
00059       s = name + l - 1;
00060       if ( !(l == 2 && *s == ':') && *s != '\\' && *s != '/')
00061     slash = "/";    /* save to insert slash between path and "*.*" */
00062     }
00063
00064   strcat (strcat (strcpy (name_buf, name), slash), "*.*");
00065
00066   dirp = (DIR *) malloc (sizeof (DIR));
00067   if (dirp == (DIR *)0)
00068     return (DIR *)0;
00069
00070   dirp->dd_loc = 0;
00071   dirp->dd_contents = dirp->dd_cp = (struct _dircontents *) 0;
00072
00073   if ((hFile = _findfirst (name_buf, &find_buf)) < 0)
00074     {
00075       free (dirp);
00076       return (DIR *)0;
00077     }
00078
00079   do
00080     {
00081       dp = (struct _dircontents *) malloc (sizeof (struct _dircontents));
00082       if (dp == (struct _dircontents *)0)
00083     {
00084       free_dircontents (dirp->dd_contents);
00085       return (DIR *)0;
00086     }
00087
00088       dp->_d_entry = malloc (strlen (find_buf.name) + 1);
00089       if (dp->_d_entry == (char *)0)
00090     {
00091       free (dp);
00092       free_dircontents (dirp->dd_contents);
00093       return (DIR *)0;
00094     }
00095
00096       if (dirp->dd_contents)
00097     dirp->dd_cp = dirp->dd_cp->_d_next = dp;
00098       else
00099     dirp->dd_contents = dirp->dd_cp = dp;
00100
00101       strcpy (dp->_d_entry, find_buf.name);
00102
00103       dp->_d_next = (struct _dircontents *)0;
00104
00105     } while (!_findnext (hFile, &find_buf));
00106
00107   dirp->dd_cp = dirp->dd_contents;
00108
00109   _findclose(hFile);
00110
00111   return dirp;
00112 }

struct direct* readdir ( DIR * dirp )

Definition at line 124 of file ndir.c.

References direct::d_ino, direct::d_name, direct::d_namlen, and direct::d_reclen.

00125 {
00126   static struct direct dp;
00127
00128   if (dirp->dd_cp == (struct _dircontents *)0)
00129     return (struct direct *)0;
00130   dp.d_namlen = dp.d_reclen =
00131     strlen (strcpy (dp.d_name, dirp->dd_cp->_d_entry));
00132 #if 0 /* JB */
00133   strlwr (dp.d_name);       /* JF */
00134 #endif
00135   dp.d_ino = 0;
00136   dirp->dd_cp = dirp->dd_cp->_d_next;
00137   dirp->dd_loc++;
00138
00139   return &dp;
00140 }

void seekdir | ( | DIR * | dirp,
 |  | long | off
 | ) |

Definition at line 144 of file ndir.c.

References _dircontents::_d_next, _dirdesc::dd_contents, _dirdesc::dd_cp, and _dirdesc::dd_loc.

00145 {
00146   long i = off;
00147   struct _dircontents *dp;
00148
00149   if (off < 0)
00150     return;
00151   for (dp = dirp->dd_contents; --i >= 0 && dp; dp = dp->_d_next)
00152     ;
00153   dirp->dd_loc = off - (i + 1);
00154   dirp->dd_cp = dp;
00155 }

long telldir ( DIR * dirp )

Definition at line 159 of file ndir.c.

References _dirdesc::dd_loc.

00160 {
00161   return dirp->dd_loc;
00162 }

Generated on Sun Feb 24 01:23:53 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ndir.h File Reference

WinCvs/ndir.h File Reference

#include <sys/types.h>

Include dependency graph for ndir.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

struct | _dircontents
struct | _dirdesc
struct | direct

Defines

#define | rewinddir(dirp) seekdir(dirp, 0L)
#define | MAXNAMLEN 255

Typedefs

typedef _dirdesc | DIR

Functions

void | seekdir (DIR *, long)
long | telldir (DIR *)
DIR * | opendir (const char *)
void | closedir (DIR *)
direct * readdir (DIR *)

Define Documentation

#define MAXNAMLEN 255

Definition at line 37 of file ndir.h.

#define rewinddir ( dirp ) seekdir(dirp, 0L)

Definition at line 32 of file ndir.h.

Typedef Documentation

typedef struct _dirdesc DIR

Function Documentation

void closedir ( DIR * )

Definition at line 116 of file ndir.c.

Referenced by FileTraverse.

00117 {
00118   free_dircontents (dirp->dd_contents);
00119   free ((char *) dirp);
00120 }

DIR* opendir ( const char * )

Definition at line 43 of file ndir.c.

References direct::d_namlen.

Referenced by FileTraverse.

00044 {
00045   struct _finddata_t find_buf;
00046   DIR *dirp;
00047   struct _dircontents *dp;
00048   char name_buf[_MAX_PATH + 1];
00049   char *slash = "";
00050   long hFile;
00051
00052   if (!name)
00053     name = "";
00054   else if (*name)
00055     {
00056       const char *s;
00057       int l = strlen (name);
00058
00059       s = name + l - 1;
00060       if ( !(l == 2 && *s == ':') && *s != '\\' && *s != '/')
00061     slash = "/";    /* save to insert slash between path and "*.*" */
00062     }
00063
00064   strcat (strcat (strcpy (name_buf, name), slash), "*.*");
00065
00066   dirp = (DIR *) malloc (sizeof (DIR));
00067   if (dirp == (DIR *)0)
00068     return (DIR *)0;
00069
00070   dirp->dd_loc = 0;
00071   dirp->dd_contents = dirp->dd_cp = (struct _dircontents *) 0;
00072
00073   if ((hFile = _findfirst (name_buf, &find_buf)) < 0)
00074     {
00075       free (dirp);
00076       return (DIR *)0;
00077     }
00078
00079   do
00080     {
00081       dp = (struct _dircontents *) malloc (sizeof (struct _dircontents));
00082       if (dp == (struct _dircontents *)0)
00083     {
00084       free_dircontents (dirp->dd_contents);
00085       return (DIR *)0;
00086     }
00087
00088       dp->_d_entry = malloc (strlen (find_buf.name) + 1);
00089       if (dp->_d_entry == (char *)0)
00090     {
00091       free (dp);
00092       free_dircontents (dirp->dd_contents);
00093       return (DIR *)0;
00094     }
00095
00096       if (dirp->dd_contents)
00097     dirp->dd_cp = dirp->dd_cp->_d_next = dp;
00098       else
00099     dirp->dd_contents = dirp->dd_cp = dp;
00100
00101       strcpy (dp->_d_entry, find_buf.name);
00102
00103       dp->_d_next = (struct _dircontents *)0;
00104
00105     } while (!_findnext (hFile, &find_buf));
00106
00107   dirp->dd_cp = dirp->dd_contents;
00108
00109   _findclose(hFile);
00110
00111   return dirp;
00112 }

struct direct* readdir ( DIR * )

Definition at line 124 of file ndir.c.

Referenced by FileTraverse.

00125 {
00126   static struct direct dp;
00127
00128   if (dirp->dd_cp == (struct _dircontents *)0)
00129     return (struct direct *)0;
00130   dp.d_namlen = dp.d_reclen =
00131     strlen (strcpy (dp.d_name, dirp->dd_cp->_d_entry));
00132 #if 0 /* JB */
00133   strlwr (dp.d_name);       /* JF */
00134 #endif
00135   dp.d_ino = 0;
00136   dirp->dd_cp = dirp->dd_cp->_d_next;
00137   dirp->dd_loc++;
00138
00139   return &dp;
00140 }

void seekdir | ( | DIR * | ,
 |  | long |
 | ) |

Definition at line 144 of file ndir.c.

00145 {
00146   long i = off;
00147   struct _dircontents *dp;
00148
00149   if (off < 0)
00150     return;
00151   for (dp = dirp->dd_contents; --i >= 0 && dp; dp = dp->_d_next)
00152     ;
00153   dirp->dd_loc = off - (i + 1);
00154   dirp->dd_cp = dp;
00155 }

long telldir ( DIR * )

Definition at line 159 of file ndir.c.

00160 {
00161   return dirp->dd_loc;
00162 }

Generated on Sun Feb 24 01:23:53 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


NoPython.cpp File Reference

WinCvs/NoPython.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "NoPython.h"
#include "Persistent.h"
#include "Splash.h"

Include dependency graph for NoPython.cpp:

Include dependency graph

Go to the source code of this file.

Functions

CPersistentBool | gWarnPython ("P_WarnPython", true)
void | WarnNoPython (void)

Function Documentation

CPersistentBool gWarnPython | ( | "P_WarnPython" | ,
 |  | true |
 | ) | [static]

void WarnNoPython ( void )

Definition at line 59 of file NoPython.cpp.

References CSplashWnd::CloseSplashScreen, and CNoPython::m_remind.

Referenced by CPython_Interp::IsAvail.

00060 {
00061     if((bool)gWarnPython)
00062     {
00063         // because it conflicts
00064         CSplashWnd::CloseSplashScreen();
00065
00066         CNoPython dlg;
00067         dlg.DoModal();
00068         if(!dlg.m_remind)
00069             gWarnPython = false;
00070     }
00071 }

Generated on Sun Feb 24 01:23:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


NoPython.h File Reference

WinCvs/NoPython.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CNoPython

Defines

#define | AFX_NOPYTHON_H__F675DE42_0FA7_4785_8946_E8FC861BBA57__INCLUDED_

Functions

void | WarnNoPython (void)

Define Documentation

#define AFX_NOPYTHON_H__F675DE42_0FA7_4785_8946_E8FC861BBA57__INCLUDED_

Definition at line 2 of file NoPython.h.

Function Documentation

void WarnNoPython ( void )

Definition at line 59 of file NoPython.cpp.

00060 {
00061     if((bool)gWarnPython)
00062     {
00063         // because it conflicts
00064         CSplashWnd::CloseSplashScreen();
00065
00066         CNoPython dlg;
00067         dlg.DoModal();
00068         if(!dlg.m_remind)
00069             gWarnPython = false;
00070     }
00071 }

Generated on Sun Feb 24 01:23:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ProgressDialog.cpp File Reference

WinCvs/ProgressDialog.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "ProgressDialog.h"

Include dependency graph for ProgressDialog.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void flushDisplay (CDialog *dlg, bool &abort)

Function Documentation

void flushDisplay | ( | CDialog * | dlg,
 |  | bool & | abort
 | ) | [static]

Definition at line 84 of file ProgressDialog.cpp.

References NULL, and TRUE.

Referenced by CProgress::SetProgress.

00085 {
00086     MSG msg;
00087     while (PeekMessage(&msg, NULL, WM_PAINT, WM_PAINT, PM_NOREMOVE) == TRUE)
00088         AfxGetApp()->PumpMessage();
00089     while (PeekMessage(&msg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_NOREMOVE) == TRUE)
00090     {
00091         CPoint pt(LOWORD(msg.lParam), HIWORD(msg.lParam));
00092         ClientToScreen(msg.hwnd, &pt);
00093         CWnd *hwnd = CWnd::WindowFromPoint(pt);
00094         if(!abort && (*hwnd == *dlg || dlg->IsChild(hwnd)))
00095             AfxGetApp()->PumpMessage();
00096         else
00097             PeekMessage(&msg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE);
00098     }
00099 }

Generated on Sun Feb 24 01:23:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ProgressDialog.h File Reference

WinCvs/ProgressDialog.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CProgress
class | CProgressDialog

Defines

#define | AFX_PROGRESSDIALOG_H__09D80542_6467_11D3_85F5_00609419FCC1__INCLUDED_

Define Documentation

#define AFX_PROGRESSDIALOG_H__09D80542_6467_11D3_85F5_00609419FCC1__INCLUDED_

Definition at line 2 of file ProgressDialog.h.

Generated on Sun Feb 24 01:23:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


resource.h File Reference

WinCvs/resource.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | IDR_CNTR_INPLACE 6
#define | IDD_ABOUTBOX 100
#define | IDP_OLE_INIT_FAILED 100
#define | IDP_FAILED_TO_CREATE 102
#define | IDB_LIGHTBULB 103
#define | IDP_SOCKETS_INIT_FAILED 104
#define | IDD_TIP 105
#define | CG_IDS_TIPOFTHEDAY 106
#define | CG_IDS_TIPOFTHEDAYMENU 107
#define | CG_IDS_DIDYOUKNOW 108
#define | CG_IDS_FILE_ABSENT 109
#define | CG_IDP_FILE_CORRUPT 110
#define | CG_IDS_TIPOFTHEDAYHELP 111
#define | IDB_SPLASH 112
#define | IDR_CVS_COWORKER 113
#define | IDR_CVSCOWORKER 114
#define | IDR_CVSGETOPTION 115
#define | IDR_MAINFRAME 128
#define | IDR_WINCVSTYPE 129
#define | IDS_DEFFONT 129
#define | IDR_BROWSER 129
#define | IDD_PREFERENCES 130
#define | IDD_PASSWRD 132
#define | IDD_CMDLINE 133
#define | IDD_ALERT 134
#define | IDD_PREFS_CVSROOT 135
#define | IDD_PREFS_GLOBALS 136
#define | IDD_CHECKOUT_MAIN 137
#define | IDD_COMMIT_MAIN 138
#define | IDD_IMPORT_MAIN 139
#define | IDD_IMPORT_OPTIONS 140
#define | IDD_CMDLINE_MAIN 142
#define | IDD_IMPORTFILTER 143
#define | IDI_CVSWARNING 144
#define | IDI_CVSERROR 145
#define | IDD_WARNINGDESC 145
#define | IDD_ENTRYDESC 146
#define | IDD_UPDATE_MAIN 147
#define | IDD_UPDATE_STICKY 148
#define | IDD_UPDATE_MERGE 149
#define | IDI_FOLDER 149
#define | IDD_LOG_MAIN 150
#define | IDI_FOLDERO 150
#define | IDI_FOLDERCVS 151
#define | IDD_LOG_FILTERS 152
#define | IDI_FOLDEROCVS 152
#define | IDB_SMALLICONS 152
#define | IDD_DIFF_OPTIONS 153
#define | IDD_DIFF_MAIN 154
#define | IDD_CHECKOUT_OPTIONS 155
#define | IDD_PREFS_WINCVS 156
#define | IDR_FILELIST 157
#define | IDD_YESNO 157
#define | IDR_MULTIUSER 158
#define | IDR_GRAPH 161
#define | IDI_FOLDERIGN 162
#define | IDI_FOLDEROIGN 163
#define | IDR_STATEICONS 164
#define | IDI_FOLDERLOST 164
#define | IDR_TAGS 165
#define | IDD_INIT_MAIN 165
#define | IDR_WORKSPACE 173
#define | IDB_LOCATE 176
#define | IDD_PROGRESS 177
#define | IDR_MENUICONS 178
#define | IDB_ABOUT 180
#define | IDD_CUSTOMIZE 181
#define | IDR_CUSTMENUS 182
#define | IDB_PYTHON 183
#define | IDD_SAVESETTINGS 184
#define | IDB_IDLE 185
#define | IDD_RELEASE 185
#define | IDR_FILTER 186
#define | IDD_COMMIT_OPTIONS 186
#define | IDB_HISTLOC 187
#define | IDD_RSH 188
#define | IDD_PSERVER 189
#define | IDD_SSH 190
#define | IDD_PREFS_CVSCMD_DIALOGS 191
#define | IDD_ANNOTATE_MAIN 192
#define | IDD_GRAPH_OPTIONS 193
#define | IDD_PROMPTMESSAGE 194
#define | IDD_EDITMESSAGE 195
#define | IDD_ADMINOPTION 196
#define | IDD_EDITORMON 197
#define | IDD_NOPYTHON 198
#define | IDD_TAG_MAIN 199
#define | IDD_RTAG_MAIN 200
#define | IDD_RTAG_OPTIONS 201
#define | IDD_GSERVER 202
#define | IDC_CVSROOT 1000
#define | IDC_BULB 1000
#define | IDC_CHECKOUTRO 1001
#define | IDC_STARTUP 1001
#define | IDC_TCPIP 1002
#define | IDC_NEXTTIP 1002
#define | IDC_PRUNE 1003
#define | IDC_RHOSTS 1004
#define | IDC_DIRTYSUPPORT 1004
#define | IDC_TIPSTRING 1004
#define | IDC_PSERVER 1005
#define | IDC_CHECKUNIXLF 1005
#define | IDC_KSERVER 1006
#define | IDC_QUIET 1007
#define | IDC_CTNLADD 1008
#define | IDC_PROMPTEDIT 1009
#define | IDC_ALWAYSROOT 1009
#define | IDC_PASSWD 1010
#define | IDC_LOGOUT 1010
#define | IDC_CMDLINE 1011
#define | IDC_SELFOLDER 1012
#define | IDC_FOLDERLOC 1013
#define | IDC_BTNPATH2 1014
#define | IDC_ALERTCAPTION 1015
#define | IDC_ALRTMSG 1016
#define | IDC_CVSVERS 1017
#define | IDC_AUTHEN 1018
#define | IDC_STDOUT 1019
#define | IDC_MODNAME 1020
#define | IDC_BTNPATH 1021
#define | IDC_TAGNAME 1021
#define | IDC_NORECURS 1022
#define | IDC_PATH 1023
#define | IDC_FORCE 1023
#define | IDC_LOGMSG 1024
#define | IDC_OVERWRITE 1024
#define | IDC_SPECIFY_REV 1024
#define | IDC_DELSTICKY 1025
#define | IDC_LOGMSG_WRAP 1025
#define | IDC_VTAG 1026
#define | IDC_CREATEMISSDIR 1026
#define | IDC_RHOSTPORT 1027
#define | IDC_CLEANCOPY 1027
#define | IDC_CHECKRHOSTPORT 1028
#define | IDC_CHECKPSERVERPORT 1029
#define | IDC_PSERVERPORT 1030
#define | IDC_CHECKKSERVERPORT 1031
#define | IDC_KSERVERPORT 1032
#define | IDC_CHECKSERVERNAME 1033
#define | IDC_SERVERNAME 1034
#define | IDC_COMBOROOT 1035
#define | IDC_CHECKRSHNAME 1035
#define | IDC_LISTENTRIES 1036
#define | IDC_SERVERNAME2 1036
#define | IDC_RSHNAME 1036
#define | IDC_COMBORSAIDENTITY 1036
#define | IDC_EDITENTRY 1037
#define | IDC_WARNINGDESC 1038
#define | IDC_ENTRYSTATE 1039
#define | IDC_DATE 1040
#define | IDC_ENTRYSTATE3 1041
#define | IDC_ENTRYSTATE4 1042
#define | IDC_COMBOREV 1043
#define | IDC_ENTRYSTATE5 1043
#define | IDC_REV 1044
#define | IDC_COMBODATE1 1044
#define | IDC_MERGE2 1045
#define | IDC_COMBOSTATE 1046
#define | IDC_COMBODATE2 1046
#define | IDC_COMBOREV2 1047
#define | IDC_MERGE 1048
#define | IDC_USER 1049
#define | IDC_COMBO2 1049
#define | IDC_NOTAGS 1050
#define | IDC_NOUSERS 1051
#define | IDC_RTAG 1052
#define | IDC_CHECKPATH 1053
#define | IDC_BTNHOME 1054
#define | IDC_HOME 1055
#define | IDC_ENTRYSTATE2 1056
#define | IDC_COMBODATE 1057
#define | IDC_ENTRYSTATE6 1057
#define | IDC_MATCH 1058
#define | IDC_MERGE1 1059
#define | IDC_COMBOUSER 1060
#define | IDC_DEFBRANCH 1061
#define | IDC_STATE 1062
#define | IDC_ONLYRCS 1063
#define | IDC_CHECK1 1064
#define | IDC_CHECK2 1065
#define | IDC_DIFF1 1066
#define | IDC_DIFF2 1067
#define | IDC_DIFF3 1068
#define | IDC_COMBO1 1069
#define | IDC_BTNPROGRAM 1070
#define | IDC_COMBORTAG 1070
#define | IDC_PROGRAM 1071
#define | IDC_BAR_TREE 1072
#define | IDC_ATTIC 1075
#define | IDC_EXTDIFF 1076
#define | IDC_EXTDIFFSEL 1077
#define | IDC_DIFFPROG 1078
#define | IDC_CHECKUNMOD 1079
#define | IDC_EDIT_POSITION 1079
#define | IDC_ALTCVSCHK 1079
#define | IDC_ALTCVSPROG 1080
#define | IDC_COMBO 1081
#define | IDC_ALTCVSSEL 1081
#define | IDC_WINCVSVER 1082
#define | IDC_SPINLOGOUT 1083
#define | IDC_EDITLOGOUT 1084
#define | IDC_CHECKPROXY 1085
#define | IDC_EDITHOST 1086
#define | IDC_EDITPORT 1087
#define | IDC_FORCEROOT 1088
#define | IDC_EXPORT 1089
#define | IDC_HELPINIT 1090
#define | IDC_LOCATE 1091
#define | IDC_PROGRESS 1093
#define | IDC_ZLEVEL 1095
#define | IDC_ZSPIN 1096
#define | IDC_RSAIDENTITYSEL 1097
#define | IDC_WINCVSURL 1097
#define | IDC_RSAIDENTITY 1098
#define | IDC_ALLCMDS 1098
#define | IDC_CMDMENU 1099
#define | IDC_ADD 1101
#define | IDC_REMOVE 1102
#define | IDC_UP 1103
#define | IDC_DOWN 1104
#define | IDC_MENULIST 1106
#define | IDC_LAUNCHEDITOR 1109
#define | IDC_WORDWRAP 1110
#define | IDC_TEMPLATE 1111
#define | IDC_DELETED 1113
#define | IDC_IGNOREWHITESPACE 1118
#define | IDC_IGNORECASE 1119
#define | IDC_DIRECTORY 1120
#define | IDC_EDIT_CHECKOUTDIR 1121
#define | IDC_CHECK_OVERRIDECHECKOUTDIR 1122
#define | IDC_USE_VIEWER_ALWAYS 1125
#define | IDC_USEDEFIGNORE 1127
#define | IDC_FORCECOMMIT 1128
#define | IDC_USEFILESTIME 1128
#define | IDC_FORCERECURSE 1129
#define | IDC_FORCEREVISION 1130
#define | IDC_NOMODULEPROGRAM 1131
#define | IDC_COMBOVTAG 1132
#define | IDC_CHECKVALIDEDITS 1132
#define | IDC_COMBOMODNAME 1133
#define | IDC_HOST 1135
#define | IDC_LOGIN 1136
#define | IDC_SETTINGS 1137
#define | IDC_AUTHENDESC 1138
#define | IDC_CHECKUPDATE 1139
#define | IDC_CHECKDIFF 1140
#define | IDC_CHECKGRAPH 1141
#define | IDC_CHECKLOG 1142
#define | IDC_RADIOSHIFT 1143
#define | IDC_RADIOCONTROL 1144
#define | IDC_CONSOLE 1144
#define | IDC_ISDATE 1145
#define | IDC_CHECKANNOTATE 1145
#define | IDC_COMBO_REV 1146
#define | IDC_DIFF 1147
#define | IDC_FILETODIFF 1148
#define | IDC_APPLY 1149
#define | IDC_RESET 1150
#define | IDC_HEADER 1152
#define | IDC_TAG 1153
#define | IDC_RGBHEADER 1154
#define | IDC_RGBTAG 1155
#define | IDC_RGBBRANCH 1156
#define | IDC_RGBNODE 1157
#define | IDC_RGBDEAD 1158
#define | IDC_RGBSTATE 1159
#define | IDC_BRANCH 1160
#define | IDC_NODE 1161
#define | IDC_SELECTION 1162
#define | IDC_SHADOW 1163
#define | IDC_DEAD 1164
#define | IDC_RGBSELECTION 1165
#define | IDC_RGBSHADOW 1166
#define | IDC_OPTIONSTRING 1167
#define | IDC_OPTIONDESC 1168
#define | IDC_OPTIONSTRING_SL 1169
#define | IDC_TEMPFILE 1170
#define | IDC_REMIND 1171
#define | IDC_PYTHONURL 1172
#define | IDC_PREVIEWINFO 1173
#define | IDC_PREVCMD 1175
#define | IDC_CHECKDATE1 1177
#define | IDC_CHECKDATE2 1178
#define | IDC_GRPBOX_TEXT 1179
#define | IDC_TAGDESC_TEXT 1180
#define | IDC_MODULEDESC_TEXT 1181
#define | ID_CANCEL_EDIT_CNTR 32768
#define | ID_APP_PREFERENCES 32775
#define | ID_APP_CMDLINE 32776
#define | ID_APP_LOGIN 32779
#define | ID_STOPCVS 32795
#define | ID_BROWSER_OPEN 32797
#define | ID_VIEW_BROWSER_BAR 32798
#define | ID_UPDATEBF 32799
#define | ID_COMMITBF 32800
#define | ID_ADDBF 32801
#define | ID_VIEW_SMALLICONS 32802
#define | ID_VIEW_FULLLIST 32803
#define | ID_VIEW_ROWDETAILS 32804
#define | ID_VIEW_FILES_BAR 32805
#define | ID_VIEW_UPDATE 32806
#define | ID_VIEW_COMMIT 32807
#define | ID_VIEW_ADD 32808
#define | ID_VIEW_WORKSPACE 32809
#define | ID_MENUBAR 32810
#define | ID_VIEW_ADDB 32811
#define | ID_VIEW_RMV 32812
#define | IDS_COMBOBROWSER 32813
#define | ID_VIEW_RELOAD 32814
#define | ID_VIEW_UPONE 32826
#define | ID_VIEW_TRASH 32830
#define | ID_VIEW_DIFF 32833
#define | ID_VIEW_LOG 32834
#define | ID_VIEW_STATUS 32835
#define | ID_VIEW_LOCKF 32836
#define | ID_VIEW_UNLOCKF 32837
#define | ID_VIEW_MULTI_BAR 32838
#define | ID_MENUITEM32840 32840
#define | ID_VIEW_WATCHON 32843
#define | ID_VIEW_WATCHOFF 32844
#define | ID_VIEW_EDIT 32845
#define | ID_VIEW_UNEDIT 32846
#define | ID_VIEW_RELEASE 32847
#define | ID_VIEW_WATCHERS 32857
#define | ID_VIEW_EDITORS 32858
#define | ID_CUST_FILES_MENU 32859
#define | ID_CUST_FOLDER_MENU 32860
#define | ID_APP_CREDITS 32872
#define | ID_APP_COPYRIGHTS 32873
#define | ID_GRAPH_CLOSE 32874
#define | ID_VIEW_GRAPH 32875
#define | ID_APP_RTAGCREATE 32881
#define | ID_APP_RTAGDELETE 32882
#define | ID_APP_RTAGBRANCH 32883
#define | ID_VIEW_TAG 32884
#define | ID_VIEW_TAGNEW 32886
#define | ID_VIEW_TAGDELETE 32887
#define | ID_VIEW_TAGBRANCH 32888
#define | ID_VIEW_TAGS_BAR 32889
#define | ID_VIEW_CONSOLE_BAR 32898
#define | ID_VIEW_EXPLORE 32899
#define | ID_HISTORYBROWSE 32900
#define | ID_VIEW_QUERYUPDATE 32901
#define | ID_VIEW_IGNORE 32902
#define | ID_HELP_CVS 32903
#define | ID_HELP_CVSCLIENT 32904
#define | ID_APP_LOGOUT 32906
#define | ID_VIEW_EDITSEL 32908
#define | ID_VIEW_EDITSELDEF 32909
#define | ID_ACCEL32911 32911
#define | ID_VIEWW_INIT 32912
#define | ID_VIEW_IMPORT 32913
#define | ID_VIEW_INIT 32914
#define | ID_VIEW_CHECKOUT 32915
#define | ID_VIEW_DELREV 32916
#define | ID_VIEW_SELNONSIG 32917
#define | ID_BUTTON32918 32918
#define | ID_BUTTON32919 32919
#define | ID_BUTTON32920 32920
#define | ID_BUTTON32921 32921
#define | ID_SAVESETTINGS 32922
#define | ID_VIEW_RETRIEVE 32923
#define | ID_VIEW_RECURSIVE 32924
#define | ID_VIEW_FILTER_BAR 32925
#define | ID_VIEW_MODIFIED 32927
#define | ID_FILTERMASK 32928
#define | ID_VIEW_CONFLICT 32929
#define | ID_VIEW_UNKNOWN 32931
#define | ID_VIEW_MISSING 32932
#define | ID_VIEW_ADDED 32935
#define | ID_VIEW_REMOVED 32936
#define | ID_VIEW_CHANGED 32937
#define | ID_VIEW_HIDEUNKNOWN 32938
#define | ID_BUTTON32940 32940
#define | ID_QUERY_ANNOTATE 32941
#define | ID_VIEW_BROWSELOCATION_REMOVEUNWANTED 32943
#define | ID_USE_TCLSHELL 32944
#define | ID_USE_PYSHELL 32945
#define | ID_GRAPH_GRAPHOPTIONS 32946
#define | ID_GRAPH_ADMINOPTIONS_CHANGELOGMESSAGE 32950
#define | ID_GRAPH_ADMINOPTIONS_SETSTATE 32951
#define | ID_GRAPH_ADMINOPTIONS_SETDESCRIPTION 32952
#define | ID_GRAPH_CHANGELOGMESSAGE 32954
#define | ID_GRAPH_SETSTATE 32955
#define | ID_GRAPH_SETDESCRIPTION 32956
#define | ID_VIEW_RESERVEDEDIT 32957
#define | ID_VIEW_FORCEEDIT 32958
#define | ID_VIEW_ADDU 32960
#define | ID_MACRO_START 34000
#define | ID_MACRO_SEL 34100
#define | ID_MACRO_ADMIN 34200
#define | ID_MACRO_END 34200

Define Documentation

#define CG_IDP_FILE_CORRUPT 110

Definition at line 16 of file resource.h.

Referenced by CTipDlg::CTipDlg, and CTipDlg::GetNextTipString.

#define CG_IDS_DIDYOUKNOW 108

Definition at line 14 of file resource.h.

Referenced by CTipDlg::OnPaint.

#define CG_IDS_FILE_ABSENT 109

Definition at line 15 of file resource.h.

Referenced by CTipDlg::CTipDlg.

#define CG_IDS_TIPOFTHEDAY 106

Definition at line 12 of file resource.h.

Referenced by CMainFrame::OnInitMenu.

#define CG_IDS_TIPOFTHEDAYHELP 111

Definition at line 17 of file resource.h.

Referenced by CMainFrame::OnInitMenu.

#define CG_IDS_TIPOFTHEDAYMENU 107

Definition at line 13 of file resource.h.

Referenced by CMainFrame::OnInitMenu.

#define ID_ACCEL32911 32911

Definition at line 354 of file resource.h.

#define ID_ADDBF 32801

Definition at line 300 of file resource.h.

#define ID_APP_CMDLINE 32776

Definition at line 293 of file resource.h.

#define ID_APP_COPYRIGHTS 32873

Definition at line 333 of file resource.h.

#define ID_APP_CREDITS 32872

Definition at line 332 of file resource.h.

#define ID_APP_LOGIN 32779

Definition at line 294 of file resource.h.

#define ID_APP_LOGOUT 32906

Definition at line 351 of file resource.h.

#define ID_APP_PREFERENCES 32775

Definition at line 292 of file resource.h.

Referenced by CWincvsApp::InitInstance.

#define ID_APP_RTAGBRANCH 32883

Definition at line 338 of file resource.h.

#define ID_APP_RTAGCREATE 32881

Definition at line 336 of file resource.h.

#define ID_APP_RTAGDELETE 32882

Definition at line 337 of file resource.h.

#define ID_BROWSER_OPEN 32797

Definition at line 296 of file resource.h.

#define ID_BUTTON32918 32918

Definition at line 361 of file resource.h.

#define ID_BUTTON32919 32919

Definition at line 362 of file resource.h.

#define ID_BUTTON32920 32920

Definition at line 363 of file resource.h.

#define ID_BUTTON32921 32921

Definition at line 364 of file resource.h.

#define ID_BUTTON32940 32940

Definition at line 378 of file resource.h.

#define ID_CANCEL_EDIT_CNTR 32768

Definition at line 291 of file resource.h.

#define ID_COMMITBF 32800

Definition at line 299 of file resource.h.

#define ID_CUST_FILES_MENU 32859

Definition at line 330 of file resource.h.

Referenced by GetCustomMenu, CWinCvsBrowser::OnCustomize, and CBrowseFileView::OnCustomize.

#define ID_CUST_FOLDER_MENU 32860

Definition at line 331 of file resource.h.

Referenced by GetCustomMenu.

#define ID_FILTERMASK 32928

Definition at line 370 of file resource.h.

Referenced by CMainFrame::OnCreate.

#define ID_GRAPH_ADMINOPTIONS_CHANGELOGMESSAGE 32950

Definition at line 384 of file resource.h.

#define ID_GRAPH_ADMINOPTIONS_SETDESCRIPTION 32952

Definition at line 386 of file resource.h.

#define ID_GRAPH_ADMINOPTIONS_SETSTATE 32951

Definition at line 385 of file resource.h.

#define ID_GRAPH_CHANGELOGMESSAGE 32954

Definition at line 387 of file resource.h.

#define ID_GRAPH_CLOSE 32874

Definition at line 334 of file resource.h.

#define ID_GRAPH_GRAPHOPTIONS 32946

Definition at line 383 of file resource.h.

#define ID_GRAPH_SETDESCRIPTION 32956

Definition at line 389 of file resource.h.

#define ID_GRAPH_SETSTATE 32955

Definition at line 388 of file resource.h.

#define ID_HELP_CVS 32903

Definition at line 349 of file resource.h.

#define ID_HELP_CVSCLIENT 32904

Definition at line 350 of file resource.h.

#define ID_HISTORYBROWSE 32900

Definition at line 346 of file resource.h.

Referenced by CMainFrame::OnCreate.

#define ID_MACRO_ADMIN 34200

Definition at line 395 of file resource.h.

Referenced by cvsgui_GetTopMacroAdminMenu, CCustomizeMenus::GetIcon, CCustInvertTable::Initialize, and CWincvsDoc::OnMacroAdmin.

#define ID_MACRO_END 34200

Definition at line 396 of file resource.h.

#define ID_MACRO_SEL 34100

Definition at line 394 of file resource.h.

Referenced by cvsgui_GetTopMacroSelectionMenu, CCustomizeMenus::GetIcon, and CCustInvertTable::Initialize.

#define ID_MACRO_START 34000

Definition at line 393 of file resource.h.

#define ID_MENUBAR 32810

Definition at line 309 of file resource.h.

#define ID_MENUITEM32840 32840

Definition at line 322 of file resource.h.

#define ID_QUERY_ANNOTATE 32941

Definition at line 379 of file resource.h.

#define ID_SAVESETTINGS 32922

Definition at line 365 of file resource.h.

#define ID_STOPCVS 32795

Definition at line 295 of file resource.h.

#define ID_UPDATEBF 32799

Definition at line 298 of file resource.h.

#define ID_USE_PYSHELL 32945

Definition at line 382 of file resource.h.

#define ID_USE_TCLSHELL 32944

Definition at line 381 of file resource.h.

#define ID_VIEW_ADD 32808

Definition at line 307 of file resource.h.

#define ID_VIEW_ADDB 32811

Definition at line 310 of file resource.h.

#define ID_VIEW_ADDED 32935

Definition at line 374 of file resource.h.

#define ID_VIEW_ADDU 32960

Definition at line 392 of file resource.h.

#define ID_VIEW_BROWSELOCATION_REMOVEUNWANTED 32943

Definition at line 380 of file resource.h.

#define ID_VIEW_BROWSER_BAR 32798

Definition at line 297 of file resource.h.

Referenced by CMainFrame::OnCreate.

#define ID_VIEW_CHANGED 32937

Definition at line 376 of file resource.h.

#define ID_VIEW_CHECKOUT 32915

Definition at line 358 of file resource.h.

#define ID_VIEW_COMMIT 32807

Definition at line 306 of file resource.h.

#define ID_VIEW_CONFLICT 32929

Definition at line 371 of file resource.h.

#define ID_VIEW_CONSOLE_BAR 32898

Definition at line 344 of file resource.h.

Referenced by CMainFrame::InitializeDockingWindows.

#define ID_VIEW_DELREV 32916

Definition at line 359 of file resource.h.

#define ID_VIEW_DIFF 32833

Definition at line 316 of file resource.h.

#define ID_VIEW_EDIT 32845

Definition at line 325 of file resource.h.

#define ID_VIEW_EDITORS 32858

Definition at line 329 of file resource.h.

#define ID_VIEW_EDITSEL 32908

Definition at line 352 of file resource.h.

#define ID_VIEW_EDITSELDEF 32909

Definition at line 353 of file resource.h.

Referenced by FormatMenuString.

#define ID_VIEW_EXPLORE 32899

Definition at line 345 of file resource.h.

#define ID_VIEW_FILES_BAR 32805

Definition at line 304 of file resource.h.

Referenced by CMainFrame::OnCreate.

#define ID_VIEW_FILTER_BAR 32925

Definition at line 368 of file resource.h.

Referenced by CMainFrame::OnCreate.

#define ID_VIEW_FORCEEDIT 32958

Definition at line 391 of file resource.h.

#define ID_VIEW_FULLLIST 32803

Definition at line 302 of file resource.h.

#define ID_VIEW_GRAPH 32875

Definition at line 335 of file resource.h.

#define ID_VIEW_HIDEUNKNOWN 32938

Definition at line 377 of file resource.h.

#define ID_VIEW_IGNORE 32902

Definition at line 348 of file resource.h.

#define ID_VIEW_IMPORT 32913

Definition at line 356 of file resource.h.

#define ID_VIEW_INIT 32914

Definition at line 357 of file resource.h.

#define ID_VIEW_LOCKF 32836

Definition at line 319 of file resource.h.

#define ID_VIEW_LOG 32834

Definition at line 317 of file resource.h.

#define ID_VIEW_MISSING 32932

Definition at line 373 of file resource.h.

#define ID_VIEW_MODIFIED 32927

Definition at line 369 of file resource.h.

#define ID_VIEW_MULTI_BAR 32838

Definition at line 321 of file resource.h.

Referenced by CMainFrame::OnCreate.

#define ID_VIEW_QUERYUPDATE 32901

Definition at line 347 of file resource.h.

#define ID_VIEW_RECURSIVE 32924

Definition at line 367 of file resource.h.

#define ID_VIEW_RELEASE 32847

Definition at line 327 of file resource.h.

#define ID_VIEW_RELOAD 32814

Definition at line 313 of file resource.h.

#define ID_VIEW_REMOVED 32936

Definition at line 375 of file resource.h.

#define ID_VIEW_RESERVEDEDIT 32957

Definition at line 390 of file resource.h.

#define ID_VIEW_RETRIEVE 32923

Definition at line 366 of file resource.h.

#define ID_VIEW_RMV 32812

Definition at line 311 of file resource.h.

#define ID_VIEW_ROWDETAILS 32804

Definition at line 303 of file resource.h.

#define ID_VIEW_SELNONSIG 32917

Definition at line 360 of file resource.h.

#define ID_VIEW_SMALLICONS 32802

Definition at line 301 of file resource.h.

#define ID_VIEW_STATUS 32835

Definition at line 318 of file resource.h.

#define ID_VIEW_TAG 32884

Definition at line 339 of file resource.h.

#define ID_VIEW_TAGBRANCH 32888

Definition at line 342 of file resource.h.

#define ID_VIEW_TAGDELETE 32887

Definition at line 341 of file resource.h.

#define ID_VIEW_TAGNEW 32886

Definition at line 340 of file resource.h.

#define ID_VIEW_TAGS_BAR 32889

Definition at line 343 of file resource.h.

Referenced by CMainFrame::OnCreate.

#define ID_VIEW_TRASH 32830

Definition at line 315 of file resource.h.

#define ID_VIEW_UNEDIT 32846

Definition at line 326 of file resource.h.

#define ID_VIEW_UNKNOWN 32931

Definition at line 372 of file resource.h.

#define ID_VIEW_UNLOCKF 32837

Definition at line 320 of file resource.h.

#define ID_VIEW_UPDATE 32806

Definition at line 305 of file resource.h.

#define ID_VIEW_UPONE 32826

Definition at line 314 of file resource.h.

#define ID_VIEW_WATCHERS 32857

Definition at line 328 of file resource.h.

#define ID_VIEW_WATCHOFF 32844

Definition at line 324 of file resource.h.

#define ID_VIEW_WATCHON 32843

Definition at line 323 of file resource.h.

#define ID_VIEW_WORKSPACE 32809

Definition at line 308 of file resource.h.

Referenced by CMainFrame::InitializeDockingWindows.

#define ID_VIEWW_INIT 32912

Definition at line 355 of file resource.h.

#define IDB_ABOUT 180

Definition at line 70 of file resource.h.

#define IDB_HISTLOC 187

Definition at line 79 of file resource.h.

Referenced by CHistComboBoxEx::SetIcon.

#define IDB_IDLE 185

Definition at line 75 of file resource.h.

Referenced by CCvsStatusBar::CCvsStatusBar.

#define IDB_LIGHTBULB 103

Definition at line 9 of file resource.h.

Referenced by CTipDlg::OnPaint.

#define IDB_LOCATE 176

Definition at line 67 of file resource.h.

#define IDB_PYTHON 183

Definition at line 73 of file resource.h.

#define IDB_SMALLICONS 152

Definition at line 51 of file resource.h.

Referenced by CGraphView::CGraphView, and CBrowseFileView::OnInitialUpdate.

#define IDB_SPLASH 112

Definition at line 18 of file resource.h.

Referenced by CSplashWnd::Create.

#define IDC_ADD 1101

Definition at line 221 of file resource.h.

Referenced by CCustomizeMenus::DoDataExchange.

#define IDC_ALERTCAPTION 1015

Definition at line 118 of file resource.h.

#define IDC_ALLCMDS 1098

Definition at line 219 of file resource.h.

Referenced by CCustomizeMenus::DoDataExchange.

#define IDC_ALRTMSG 1016

Definition at line 119 of file resource.h.

Referenced by CCVSAlert::DoDataExchange.

#define IDC_ALTCVSCHK 1079

Definition at line 199 of file resource.h.

Referenced by CGetPrefs_WINCVS::DoDataExchange, and CGetPrefs_WINCVS::OnAltcvschk.

#define IDC_ALTCVSPROG 1080

Definition at line 200 of file resource.h.

Referenced by CGetPrefs_WINCVS::DoDataExchange, CGetPrefs_WINCVS::OnAltcvschk, and CGetPrefs_WINCVS::OnAltcvssel.

#define IDC_ALTCVSSEL 1081

Definition at line 202 of file resource.h.

Referenced by CGetPrefs_WINCVS::OnAltcvschk.

#define IDC_ALWAYSROOT 1009

Definition at line 111 of file resource.h.

Referenced by CGetPrefs_GLOBALS::DoDataExchange.

#define IDC_APPLY 1149

Definition at line 261 of file resource.h.

Referenced by CGraphOptDlg::DoDataExchange.

#define IDC_ATTIC 1075

Definition at line 193 of file resource.h.

Referenced by CRtag_MAIN::DoDataExchange.

#define IDC_AUTHEN 1018

Definition at line 121 of file resource.h.

Referenced by CGetPrefs_CVSROOT::DoDataExchange.

#define IDC_AUTHENDESC 1138

Definition at line 248 of file resource.h.

#define IDC_BAR_TREE 1072

Definition at line 192 of file resource.h.

Referenced by CExploreBar::Create.

#define IDC_BRANCH 1160

Definition at line 271 of file resource.h.

#define IDC_BTNHOME 1054

Definition at line 172 of file resource.h.

#define IDC_BTNPATH 1021

Definition at line 124 of file resource.h.

#define IDC_BTNPATH2 1014

Definition at line 117 of file resource.h.

#define IDC_BTNPROGRAM 1070

Definition at line 189 of file resource.h.

#define IDC_BULB 1000

Definition at line 96 of file resource.h.

Referenced by CTipDlg::OnPaint.

#define IDC_CHECK1 1064

Definition at line 183 of file resource.h.

Referenced by CDiff_MAIN::DoDataExchange, CDiff_MAIN::OnCheck1, and CDiff_MAIN::OnDiff1.

#define IDC_CHECK2 1065

Definition at line 184 of file resource.h.

Referenced by CDiff_MAIN::DoDataExchange, CDiff_MAIN::OnCheck2, and CDiff_MAIN::OnDiff1.

#define IDC_CHECK_OVERRIDECHECKOUTDIR 1122

Definition at line 234 of file resource.h.

Referenced by CCheckout_MAIN::DoDataExchange, and CCheckout_MAIN::OnCheckOverridecheckoutdir.

#define IDC_CHECKANNOTATE 1145

Definition at line 257 of file resource.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS::DoDataExchange.

#define IDC_CHECKDATE1 1177

Definition at line 286 of file resource.h.

Referenced by CUpdateMerge::DoDataExchange, and CUpdateMerge::OnMerge.

#define IDC_CHECKDATE2 1178

Definition at line 287 of file resource.h.

Referenced by CUpdateMerge::DoDataExchange, and CUpdateMerge::OnMerge.

#define IDC_CHECKDIFF 1140

Definition at line 250 of file resource.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS::DoDataExchange.

#define IDC_CHECKGRAPH 1141

Definition at line 251 of file resource.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS::DoDataExchange.

#define IDC_CHECKKSERVERPORT 1031

Definition at line 141 of file resource.h.

#define IDC_CHECKLOG 1142

Definition at line 252 of file resource.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS::DoDataExchange.

#define IDC_CHECKOUTRO 1001

Definition at line 97 of file resource.h.

Referenced by CGetPrefs_GLOBALS::DoDataExchange.

#define IDC_CHECKPATH 1053

Definition at line 171 of file resource.h.

Referenced by CCmdLine_MAIN::DoDataExchange, and CCmdLine_MAIN::OnCheckpath.

#define IDC_CHECKPROXY 1085

Definition at line 206 of file resource.h.

#define IDC_CHECKPSERVERPORT 1029

Definition at line 139 of file resource.h.

#define IDC_CHECKRHOSTPORT 1028

Definition at line 138 of file resource.h.

#define IDC_CHECKRSHNAME 1035

Definition at line 146 of file resource.h.

#define IDC_CHECKSERVERNAME 1033

Definition at line 143 of file resource.h.

#define IDC_CHECKUNIXLF 1005

Definition at line 106 of file resource.h.

Referenced by CGetPrefs_GLOBALS::DoDataExchange.

#define IDC_CHECKUNMOD 1079

Definition at line 197 of file resource.h.

Referenced by CTag_MAIN::DoDataExchange.

#define IDC_CHECKUPDATE 1139

Definition at line 249 of file resource.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS::DoDataExchange.

#define IDC_CHECKVALIDEDITS 1132

Definition at line 243 of file resource.h.

Referenced by CCommit_OPTIONS::DoDataExchange.

#define IDC_CLEANCOPY 1027

Definition at line 137 of file resource.h.

Referenced by CUpdateMain::DoDataExchange.

#define IDC_CMDLINE 1011

Definition at line 114 of file resource.h.

Referenced by CCmdLine_MAIN::DoDataExchange.

#define IDC_CMDMENU 1099

Definition at line 220 of file resource.h.

#define IDC_COMBO 1081

Definition at line 201 of file resource.h.

Referenced by CCommit_MAIN::DoDataExchange.

#define IDC_COMBO1 1069

Definition at line 188 of file resource.h.

Referenced by CDiff_MAIN::DoDataExchange, CDiff_MAIN::OnCheck1, and CDiff_MAIN::OnDiff1.

#define IDC_COMBO2 1049

Definition at line 167 of file resource.h.

Referenced by CDiff_MAIN::DoDataExchange, CDiff_MAIN::OnCheck2, and CDiff_MAIN::OnDiff1.

#define IDC_COMBO_REV 1146

Definition at line 258 of file resource.h.

Referenced by CAnnotate_MAIN::DoDataExchange, CAnnotate_MAIN::OnIsdate, and CAnnotate_MAIN::OnSpecifyRev.

#define IDC_COMBODATE 1057

Definition at line 175 of file resource.h.

Referenced by CUpdateSticky::DoDataExchange, CRtag_OPTIONS::DoDataExchange, CLogFilters::DoDataExchange, CCheckout_OPTIONS::DoDataExchange, CUpdateSticky::OnDate, CRtag_OPTIONS::OnDate, CLogFilters::OnDate, and CCheckout_OPTIONS::OnDate.

#define IDC_COMBODATE1 1044

Definition at line 160 of file resource.h.

Referenced by CUpdateMerge::DoDataExchange, and CUpdateMerge::OnMerge.

#define IDC_COMBODATE2 1046

Definition at line 163 of file resource.h.

Referenced by CUpdateMerge::DoDataExchange, and CUpdateMerge::OnMerge.

#define IDC_COMBOMODNAME 1133

Definition at line 244 of file resource.h.

Referenced by CImport_MAIN::DoDataExchange.

#define IDC_COMBOREV 1043

Definition at line 157 of file resource.h.

Referenced by CUpdateMerge::DoDataExchange, CUpdateSticky::DoDataExchange, CRtag_OPTIONS::DoDataExchange, CLogFilters::DoDataExchange, CCommit_OPTIONS::DoDataExchange, CCheckout_OPTIONS::DoDataExchange, CCommit_OPTIONS::OnForcerevision, CUpdateMerge::OnMerge, CUpdateSticky::OnRev, CRtag_OPTIONS::OnRev, CLogFilters::OnRev, and CCheckout_OPTIONS::OnRev.

#define IDC_COMBOREV2 1047

Definition at line 164 of file resource.h.

Referenced by CUpdateMerge::DoDataExchange, and CUpdateMerge::OnMerge.

#define IDC_COMBOROOT 1035

Definition at line 145 of file resource.h.

Referenced by CGetPrefs_CVSROOT::DoDataExchange.

#define IDC_COMBORSAIDENTITY 1036

Definition at line 150 of file resource.h.

#define IDC_COMBORTAG 1070

Definition at line 190 of file resource.h.

Referenced by CImport_MAIN::DoDataExchange.

#define IDC_COMBOSTATE 1046

Definition at line 162 of file resource.h.

Referenced by CLogFilters::DoDataExchange, and CLogFilters::OnState.

#define IDC_COMBOUSER 1060

Definition at line 179 of file resource.h.

Referenced by CLogFilters::DoDataExchange, and CLogFilters::OnUser.

#define IDC_COMBOVTAG 1132

Definition at line 242 of file resource.h.

Referenced by CImport_MAIN::DoDataExchange.

#define IDC_CONSOLE 1144

Definition at line 255 of file resource.h.

Referenced by CGetPrefs_CVSROOT::DoDataExchange.

#define IDC_CREATEMISSDIR 1026

Definition at line 135 of file resource.h.

Referenced by CUpdateMain::DoDataExchange.

#define IDC_CTNLADD 1008

Definition at line 109 of file resource.h.

Referenced by CGetPrefs_GLOBALS::DoDataExchange.

#define IDC_CVSROOT 1000

Definition at line 95 of file resource.h.

#define IDC_CVSVERS 1017

Definition at line 120 of file resource.h.

Referenced by CGetPrefs_CVSROOT::DoDataExchange.

#define IDC_DATE 1040

Definition at line 154 of file resource.h.

Referenced by CUpdateSticky::DoDataExchange, CRtag_OPTIONS::DoDataExchange, CLogFilters::DoDataExchange, CCheckout_OPTIONS::DoDataExchange, CUpdateSticky::OnDate, CRtag_OPTIONS::OnDate, CLogFilters::OnDate, and CCheckout_OPTIONS::OnDate.

#define IDC_DEAD 1164

Definition at line 275 of file resource.h.

#define IDC_DEFBRANCH 1061

Definition at line 180 of file resource.h.

Referenced by CLogMain::DoDataExchange.

#define IDC_DELETED 1113

Definition at line 229 of file resource.h.

#define IDC_DELSTICKY 1025

Definition at line 132 of file resource.h.

Referenced by CUpdateMain::DoDataExchange.

#define IDC_DIFF 1147

Definition at line 259 of file resource.h.

Referenced by CCommit_MAIN::OnInitDialog.

#define IDC_DIFF1 1066

Definition at line 185 of file resource.h.

Referenced by CDiff_MAIN::DoDataExchange, and CDiff_MAIN::OnDiff1.

#define IDC_DIFF2 1067

Definition at line 186 of file resource.h.

Referenced by CDiff_MAIN::OnDiff1.

#define IDC_DIFF3 1068

Definition at line 187 of file resource.h.

Referenced by CDiff_MAIN::OnDiff1.

#define IDC_DIFFPROG 1078

Definition at line 196 of file resource.h.

Referenced by CGetPrefs_WINCVS::DoDataExchange, CGetPrefs_WINCVS::OnExtdiff, and CGetPrefs_WINCVS::OnExtdiffsel.

#define IDC_DIRECTORY 1120

Definition at line 232 of file resource.h.

Referenced by CReleaseDlg::DoDataExchange.

#define IDC_DIRTYSUPPORT 1004

Definition at line 103 of file resource.h.

Referenced by CGetPrefs_GLOBALS::DoDataExchange.

#define IDC_DOWN 1104

Definition at line 224 of file resource.h.

Referenced by CCustomizeMenus::DoDataExchange.

#define IDC_EDIT_CHECKOUTDIR 1121

Definition at line 233 of file resource.h.

Referenced by CCheckout_MAIN::DoDataExchange, and CCheckout_MAIN::OnCheckOverridecheckoutdir.

#define IDC_EDIT_POSITION 1079

Definition at line 198 of file resource.h.

Referenced by CCommit_MAIN::UpdateInfo.

#define IDC_EDITENTRY 1037

Definition at line 151 of file resource.h.

Referenced by CImportFilterDlg::DoDataExchange.

#define IDC_EDITHOST 1086

Definition at line 207 of file resource.h.

#define IDC_EDITLOGOUT 1084

Definition at line 205 of file resource.h.

Referenced by CGetPrefs_GLOBALS::DoDataExchange, and CGetPrefs_GLOBALS::OnLogout.

#define IDC_EDITPORT 1087

Definition at line 208 of file resource.h.

#define IDC_ENTRYSTATE 1039

Definition at line 153 of file resource.h.

Referenced by CImportEntry::DoDataExchange.

#define IDC_ENTRYSTATE2 1056

Definition at line 174 of file resource.h.

#define IDC_ENTRYSTATE3 1041

Definition at line 155 of file resource.h.

#define IDC_ENTRYSTATE4 1042

Definition at line 156 of file resource.h.

#define IDC_ENTRYSTATE5 1043

Definition at line 158 of file resource.h.

#define IDC_ENTRYSTATE6 1057

Definition at line 176 of file resource.h.

#define IDC_EXPORT 1089

Definition at line 210 of file resource.h.

Referenced by CCheckout_OPTIONS::DoDataExchange.

#define IDC_EXTDIFF 1076

Definition at line 194 of file resource.h.

Referenced by CGetPrefs_WINCVS::DoDataExchange, CDiff_MAIN::DoDataExchange, CGetPrefs_WINCVS::OnExtdiff, and CDiff_MAIN::OnExtdiff.

#define IDC_EXTDIFFSEL 1077

Definition at line 195 of file resource.h.

Referenced by CGetPrefs_WINCVS::OnExtdiff.

#define IDC_FILETODIFF 1148

Definition at line 260 of file resource.h.

Referenced by CCommit_MAIN::DoDataExchange.

#define IDC_FOLDERLOC 1013

Definition at line 116 of file resource.h.

Referenced by CCmdLine_MAIN::DoDataExchange, CCmdLine_MAIN::OnCheckpath, and CCmdLine_MAIN::OnSelfolder.

#define IDC_FORCE 1023

Definition at line 128 of file resource.h.

Referenced by CAnnotate_MAIN::DoDataExchange, and CAnnotate_MAIN::OnSpecifyRev.

#define IDC_FORCECOMMIT 1128

Definition at line 237 of file resource.h.

Referenced by CCommit_OPTIONS::DoDataExchange.

#define IDC_FORCERECURSE 1129

Definition at line 239 of file resource.h.

Referenced by CCommit_OPTIONS::DoDataExchange.

#define IDC_FORCEREVISION 1130

Definition at line 240 of file resource.h.

Referenced by CCommit_OPTIONS::DoDataExchange, and CCommit_OPTIONS::OnForcerevision.

#define IDC_FORCEROOT 1088

Definition at line 209 of file resource.h.

Referenced by CInit_MAIN::DoDataExchange, and CCheckout_OPTIONS::DoDataExchange.

#define IDC_GRPBOX_TEXT 1179

Definition at line 288 of file resource.h.

Referenced by CTag_MAIN::DoDataExchange, CRtag_OPTIONS::DoDataExchange, and CRtag_MAIN::DoDataExchange.

#define IDC_HEADER 1152

Definition at line 263 of file resource.h.

#define IDC_HELPINIT 1090

Definition at line 211 of file resource.h.

Referenced by CInit_MAIN::DoDataExchange.

#define IDC_HOME 1055

Definition at line 173 of file resource.h.

Referenced by CGetPrefs_WINCVS::DoDataExchange, and CGetPrefs_WINCVS::OnBtnhome.

#define IDC_HOST 1135

Definition at line 245 of file resource.h.

Referenced by CGetPrefs_CVSROOT::DoDataExchange.

#define IDC_IGNORECASE 1119

Definition at line 231 of file resource.h.

Referenced by CDiff_MAIN::DoDataExchange, and CDiff_MAIN::OnExtdiff.

#define IDC_IGNOREWHITESPACE 1118

Definition at line 230 of file resource.h.

Referenced by CDiff_MAIN::DoDataExchange, and CDiff_MAIN::OnExtdiff.

#define IDC_ISDATE 1145

Definition at line 256 of file resource.h.

Referenced by CAnnotate_MAIN::DoDataExchange, CAnnotate_MAIN::OnIsdate, and CAnnotate_MAIN::OnSpecifyRev.

#define IDC_KSERVER 1006

Definition at line 107 of file resource.h.

#define IDC_KSERVERPORT 1032

Definition at line 142 of file resource.h.

#define IDC_LAUNCHEDITOR 1109

Definition at line 226 of file resource.h.

#define IDC_LISTENTRIES 1036

Definition at line 147 of file resource.h.

Referenced by CImportFilterDlg::DoDataExchange.

#define IDC_LOCATE 1091

Definition at line 212 of file resource.h.

#define IDC_LOGIN 1136

Definition at line 246 of file resource.h.

Referenced by CGetPrefs_CVSROOT::DoDataExchange.

#define IDC_LOGMSG 1024

Definition at line 129 of file resource.h.

Referenced by CImport_MAIN::DoDataExchange, CCommit_MAIN::DoDataExchange, and CCommit_MAIN::GetLogMsgID.

#define IDC_LOGMSG_WRAP 1025

Definition at line 133 of file resource.h.

Referenced by CCommit_MAIN::DoDataExchange, and CCommit_MAIN::GetLogMsgID.

#define IDC_LOGOUT 1010

Definition at line 113 of file resource.h.

Referenced by CGetPrefs_GLOBALS::DoDataExchange, and CGetPrefs_GLOBALS::OnLogout.

#define IDC_MATCH 1058

Definition at line 177 of file resource.h.

Referenced by CUpdateSticky::DoDataExchange, CRtag_OPTIONS::DoDataExchange, and CCheckout_OPTIONS::DoDataExchange.

#define IDC_MENULIST 1106

Definition at line 225 of file resource.h.

Referenced by CCustomizeMenus::DoDataExchange.

#define IDC_MERGE 1048

Definition at line 165 of file resource.h.

Referenced by CUpdateMerge::DoDataExchange.

#define IDC_MERGE1 1059

Definition at line 178 of file resource.h.

Referenced by CUpdateMerge::OnMerge.

#define IDC_MERGE2 1045

Definition at line 161 of file resource.h.

Referenced by CUpdateMerge::OnMerge.

#define IDC_MODNAME 1020

Definition at line 123 of file resource.h.

Referenced by CRtag_MAIN::DoDataExchange, CCheckout_MAIN::DoDataExchange, and CCheckout_MAIN::OnCheckOverridecheckoutdir.

#define IDC_MODULEDESC_TEXT 1181

Definition at line 290 of file resource.h.

Referenced by CRtag_MAIN::DoDataExchange.

#define IDC_NEXTTIP 1002

Definition at line 100 of file resource.h.

#define IDC_NODE 1161

Definition at line 272 of file resource.h.

#define IDC_NOMODULEPROGRAM 1131

Definition at line 241 of file resource.h.

Referenced by CCommit_OPTIONS::DoDataExchange.

#define IDC_NORECURS 1022

Definition at line 126 of file resource.h.

Referenced by CUpdateMain::DoDataExchange, CTag_MAIN::DoDataExchange, CRtag_MAIN::DoDataExchange, CLogMain::DoDataExchange, CDiff_MAIN::DoDataExchange, CCommit_OPTIONS::DoDataExchange, CCheckout_MAIN::DoDataExchange, and CAnnotate_MAIN::DoDataExchange.

#define IDC_NOTAGS 1050

Definition at line 168 of file resource.h.

Referenced by CLogMain::DoDataExchange.

#define IDC_NOUSERS 1051

Definition at line 169 of file resource.h.

Referenced by CLogMain::DoDataExchange.

#define IDC_ONLYRCS 1063

Definition at line 182 of file resource.h.

Referenced by CLogMain::DoDataExchange.

#define IDC_OPTIONDESC 1168

Definition at line 279 of file resource.h.

#define IDC_OPTIONSTRING 1167

Definition at line 278 of file resource.h.

Referenced by CAdminOptionDlg::DoDataExchange, and CAdminOptionDlg::OnInitDialog.

#define IDC_OPTIONSTRING_SL 1169

Definition at line 280 of file resource.h.

Referenced by CAdminOptionDlg::DoDataExchange, and CAdminOptionDlg::OnInitDialog.

#define IDC_OVERWRITE 1024

Definition at line 130 of file resource.h.

Referenced by CTag_MAIN::DoDataExchange, and CRtag_MAIN::DoDataExchange.

#define IDC_PASSWD 1010

Definition at line 112 of file resource.h.

Referenced by GetPassword::DoDataExchange.

#define IDC_PATH 1023

Definition at line 127 of file resource.h.

Referenced by CImport_OPTIONS::DoDataExchange, CGetPrefs_CVSROOT::DoDataExchange, CCheckout_MAIN::DoDataExchange, and CImport_OPTIONS::OnBtnpath.

#define IDC_PREVCMD 1175

Definition at line 285 of file resource.h.

Referenced by CCmdLine_MAIN::DoDataExchange.

#define IDC_PREVIEWINFO 1173

Definition at line 284 of file resource.h.

Referenced by CCommit_MAIN::DoDataExchange.

#define IDC_PROGRAM 1071

Definition at line 191 of file resource.h.

Referenced by CGetPrefs_WINCVS::DoDataExchange, and CGetPrefs_WINCVS::OnBtnviewer.

#define IDC_PROGRESS 1093

Definition at line 213 of file resource.h.

Referenced by CProgressDialog::DoDataExchange.

#define IDC_PROMPTEDIT 1009

Definition at line 110 of file resource.h.

Referenced by GetValue::DoDataExchange.

#define IDC_PRUNE 1003

Definition at line 101 of file resource.h.

Referenced by CGetPrefs_GLOBALS::DoDataExchange.

#define IDC_PSERVER 1005

Definition at line 105 of file resource.h.

#define IDC_PSERVERPORT 1030

Definition at line 140 of file resource.h.

#define IDC_PYTHONURL 1172

Definition at line 283 of file resource.h.

Referenced by CNoPython::DoDataExchange.

#define IDC_QUIET 1007

Definition at line 108 of file resource.h.

Referenced by CGetPrefs_GLOBALS::DoDataExchange.

#define IDC_RADIOCONTROL 1144

Definition at line 254 of file resource.h.

#define IDC_RADIOSHIFT 1143

Definition at line 253 of file resource.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS::DoDataExchange.

#define IDC_REMIND 1171

Definition at line 282 of file resource.h.

Referenced by CNoPython::DoDataExchange.

#define IDC_REMOVE 1102

Definition at line 222 of file resource.h.

Referenced by CCustomizeMenus::DoDataExchange, and CReleaseDlg::DoDataExchange.

#define IDC_RESET 1150

Definition at line 262 of file resource.h.

#define IDC_REV 1044

Definition at line 159 of file resource.h.

Referenced by CUpdateSticky::DoDataExchange, CRtag_OPTIONS::DoDataExchange, CLogFilters::DoDataExchange, CCheckout_OPTIONS::DoDataExchange, CUpdateSticky::OnRev, CRtag_OPTIONS::OnRev, CLogFilters::OnRev, and CCheckout_OPTIONS::OnRev.

#define IDC_RGBBRANCH 1156

Definition at line 267 of file resource.h.

Referenced by CGraphOptDlg::DoDataExchange.

#define IDC_RGBDEAD 1158

Definition at line 269 of file resource.h.

Referenced by CGraphOptDlg::DoDataExchange.

#define IDC_RGBHEADER 1154

Definition at line 265 of file resource.h.

Referenced by CGraphOptDlg::DoDataExchange.

#define IDC_RGBNODE 1157

Definition at line 268 of file resource.h.

Referenced by CGraphOptDlg::DoDataExchange.

#define IDC_RGBSELECTION 1165

Definition at line 276 of file resource.h.

Referenced by CGraphOptDlg::DoDataExchange.

#define IDC_RGBSHADOW 1166

Definition at line 277 of file resource.h.

Referenced by CGraphOptDlg::DoDataExchange.

#define IDC_RGBSTATE 1159

Definition at line 270 of file resource.h.

Referenced by CGraphOptDlg::DoDataExchange.

#define IDC_RGBTAG 1155

Definition at line 266 of file resource.h.

Referenced by CGraphOptDlg::DoDataExchange.

#define IDC_RHOSTPORT 1027

Definition at line 136 of file resource.h.

#define IDC_RHOSTS 1004

Definition at line 102 of file resource.h.

#define IDC_RSAIDENTITY 1098

Definition at line 218 of file resource.h.

#define IDC_RSAIDENTITYSEL 1097

Definition at line 216 of file resource.h.

#define IDC_RSHNAME 1036

Definition at line 149 of file resource.h.

#define IDC_RTAG 1052

Definition at line 170 of file resource.h.

#define IDC_SELECTION 1162

Definition at line 273 of file resource.h.

#define IDC_SELFOLDER 1012

Definition at line 115 of file resource.h.

Referenced by CCmdLine_MAIN::DoDataExchange.

#define IDC_SERVERNAME 1034

Definition at line 144 of file resource.h.

#define IDC_SERVERNAME2 1036

Definition at line 148 of file resource.h.

#define IDC_SETTINGS 1137

Definition at line 247 of file resource.h.

#define IDC_SHADOW 1163

Definition at line 274 of file resource.h.

#define IDC_SPECIFY_REV 1024

Definition at line 131 of file resource.h.

Referenced by CAnnotate_MAIN::DoDataExchange, and CAnnotate_MAIN::OnSpecifyRev.

#define IDC_SPINLOGOUT 1083

Definition at line 204 of file resource.h.

Referenced by CGetPrefs_GLOBALS::DoDataExchange, and CGetPrefs_GLOBALS::OnLogout.

#define IDC_STARTUP 1001

Definition at line 98 of file resource.h.

Referenced by CTipDlg::DoDataExchange.

#define IDC_STATE 1062

Definition at line 181 of file resource.h.

Referenced by CLogFilters::DoDataExchange, and CLogFilters::OnState.

#define IDC_STDOUT 1019

Definition at line 122 of file resource.h.

Referenced by CUpdateMain::DoDataExchange, and CCheckout_MAIN::DoDataExchange.

#define IDC_TAG 1153

Definition at line 264 of file resource.h.

#define IDC_TAGDESC_TEXT 1180

Definition at line 289 of file resource.h.

Referenced by CTag_MAIN::DoDataExchange, and CRtag_MAIN::DoDataExchange.

#define IDC_TAGNAME 1021

Definition at line 125 of file resource.h.

Referenced by CTag_MAIN::DoDataExchange, and CRtag_MAIN::DoDataExchange.

#define IDC_TCPIP 1002

Definition at line 99 of file resource.h.

Referenced by CGetPrefs_GLOBALS::DoDataExchange, and CGetPrefs_GLOBALS::OnTcpip.

#define IDC_TEMPFILE 1170

Definition at line 281 of file resource.h.

Referenced by CEditorMonDlg::DoDataExchange.

#define IDC_TEMPLATE 1111

Definition at line 228 of file resource.h.

Referenced by CCommit_MAIN::OnInitDialog.

#define IDC_TIPSTRING 1004

Definition at line 104 of file resource.h.

Referenced by CTipDlg::DoDataExchange, and CTipDlg::OnCtlColor.

#define IDC_UP 1103

Definition at line 223 of file resource.h.

Referenced by CCustomizeMenus::DoDataExchange.

#define IDC_USE_VIEWER_ALWAYS 1125

Definition at line 235 of file resource.h.

Referenced by CGetPrefs_WINCVS::DoDataExchange.

#define IDC_USEDEFIGNORE 1127

Definition at line 236 of file resource.h.

Referenced by CImport_OPTIONS::DoDataExchange.

#define IDC_USEFILESTIME 1128

Definition at line 238 of file resource.h.

Referenced by CImport_OPTIONS::DoDataExchange.

#define IDC_USER 1049

Definition at line 166 of file resource.h.

Referenced by CLogFilters::DoDataExchange, and CLogFilters::OnUser.

#define IDC_VTAG 1026

Definition at line 134 of file resource.h.

#define IDC_WARNINGDESC 1038

Definition at line 152 of file resource.h.

Referenced by CImportEntry::DoDataExchange, and CImportWarning::DoDataExchange.

#define IDC_WINCVSURL 1097

Definition at line 217 of file resource.h.

Referenced by CAboutDlg::DoDataExchange.

#define IDC_WINCVSVER 1082

Definition at line 203 of file resource.h.

Referenced by CAboutDlg::DoDataExchange.

#define IDC_WORDWRAP 1110

Definition at line 227 of file resource.h.

Referenced by CCommit_MAIN::DoDataExchange.

#define IDC_ZLEVEL 1095

Definition at line 214 of file resource.h.

Referenced by CGetPrefs_GLOBALS::DoDataExchange, and CGetPrefs_GLOBALS::OnTcpip.

#define IDC_ZSPIN 1096

Definition at line 215 of file resource.h.

Referenced by CGetPrefs_GLOBALS::DoDataExchange, and CGetPrefs_GLOBALS::OnTcpip.

#define IDD_ABOUTBOX 100

Definition at line 6 of file resource.h.

#define IDD_ADMINOPTION 196

Definition at line 88 of file resource.h.

#define IDD_ALERT 134

Definition at line 29 of file resource.h.

#define IDD_ANNOTATE_MAIN 192

Definition at line 84 of file resource.h.

#define IDD_CHECKOUT_MAIN 137

Definition at line 32 of file resource.h.

#define IDD_CHECKOUT_OPTIONS 155

Definition at line 54 of file resource.h.

#define IDD_CMDLINE 133

Definition at line 28 of file resource.h.

#define IDD_CMDLINE_MAIN 142

Definition at line 36 of file resource.h.

#define IDD_COMMIT_MAIN 138

Definition at line 33 of file resource.h.

Referenced by combozify.

#define IDD_COMMIT_OPTIONS 186

Definition at line 78 of file resource.h.

#define IDD_CUSTOMIZE 181

Definition at line 71 of file resource.h.

#define IDD_DIFF_MAIN 154

Definition at line 53 of file resource.h.

#define IDD_DIFF_OPTIONS 153

Definition at line 52 of file resource.h.

#define IDD_EDITMESSAGE 195

Definition at line 87 of file resource.h.

Referenced by PromptEditMessage.

#define IDD_EDITORMON 197

Definition at line 89 of file resource.h.

#define IDD_ENTRYDESC 146

Definition at line 41 of file resource.h.

#define IDD_GRAPH_OPTIONS 193

Definition at line 85 of file resource.h.

#define IDD_GSERVER 202

Definition at line 94 of file resource.h.

Referenced by AuthenGserver::DoSettings.

#define IDD_IMPORT_MAIN 139

Definition at line 34 of file resource.h.

#define IDD_IMPORT_OPTIONS 140

Definition at line 35 of file resource.h.

#define IDD_IMPORTFILTER 143

Definition at line 37 of file resource.h.

#define IDD_INIT_MAIN 165

Definition at line 65 of file resource.h.

#define IDD_LOG_FILTERS 152

Definition at line 49 of file resource.h.

#define IDD_LOG_MAIN 150

Definition at line 46 of file resource.h.

#define IDD_NOPYTHON 198

Definition at line 90 of file resource.h.

#define IDD_PASSWRD 132

Definition at line 27 of file resource.h.

#define IDD_PREFERENCES 130

Definition at line 26 of file resource.h.

#define IDD_PREFS_CVSCMD_DIALOGS 191

Definition at line 83 of file resource.h.

#define IDD_PREFS_CVSROOT 135

Definition at line 30 of file resource.h.

#define IDD_PREFS_GLOBALS 136

Definition at line 31 of file resource.h.

#define IDD_PREFS_WINCVS 156

Definition at line 55 of file resource.h.

#define IDD_PROGRESS 177

Definition at line 68 of file resource.h.

#define IDD_PROMPTMESSAGE 194

Definition at line 86 of file resource.h.

Referenced by PromptMessage.

#define IDD_PSERVER 189

Definition at line 81 of file resource.h.

Referenced by AuthenPserver::DoSettings.

#define IDD_RELEASE 185

Definition at line 76 of file resource.h.

#define IDD_RSH 188

Definition at line 80 of file resource.h.

Referenced by AuthenRhosts::DoSettings.

#define IDD_RTAG_MAIN 200

Definition at line 92 of file resource.h.

#define IDD_RTAG_OPTIONS 201

Definition at line 93 of file resource.h.

#define IDD_SAVESETTINGS 184

Definition at line 74 of file resource.h.

Referenced by AskCreatePersistentSettings.

#define IDD_SSH 190

Definition at line 82 of file resource.h.

Referenced by AuthenSSH::DoSettings.

#define IDD_TAG_MAIN 199

Definition at line 91 of file resource.h.

#define IDD_TIP 105

Definition at line 11 of file resource.h.

Referenced by CTipDlg::CTipDlg.

#define IDD_UPDATE_MAIN 147

Definition at line 42 of file resource.h.

#define IDD_UPDATE_MERGE 149

Definition at line 44 of file resource.h.

#define IDD_UPDATE_STICKY 148

Definition at line 43 of file resource.h.

#define IDD_WARNINGDESC 145

Definition at line 40 of file resource.h.

#define IDD_YESNO 157

Definition at line 57 of file resource.h.

#define IDI_CVSERROR 145

Definition at line 39 of file resource.h.

Referenced by CImportFilterDlg::OnInitDialog.

#define IDI_CVSWARNING 144

Definition at line 38 of file resource.h.

Referenced by CImportFilterDlg::OnInitDialog.

#define IDI_FOLDER 149

Definition at line 45 of file resource.h.

Referenced by CWinCvsBrowser::Create.

#define IDI_FOLDERCVS 151

Definition at line 48 of file resource.h.

Referenced by CWinCvsBrowser::Create.

#define IDI_FOLDERIGN 162

Definition at line 60 of file resource.h.

Referenced by CWinCvsBrowser::Create.

#define IDI_FOLDERLOST 164

Definition at line 63 of file resource.h.

Referenced by CWinCvsBrowser::Create.

#define IDI_FOLDERO 150

Definition at line 47 of file resource.h.

Referenced by CWinCvsBrowser::Create.

#define IDI_FOLDEROCVS 152

Definition at line 50 of file resource.h.

Referenced by CWinCvsBrowser::Create.

#define IDI_FOLDEROIGN 163

Definition at line 61 of file resource.h.

Referenced by CWinCvsBrowser::Create.

#define IDP_FAILED_TO_CREATE 102

Definition at line 8 of file resource.h.

#define IDP_OLE_INIT_FAILED 100

Definition at line 7 of file resource.h.

Referenced by CWincvsApp::InitInstance.

#define IDP_SOCKETS_INIT_FAILED 104

Definition at line 10 of file resource.h.

Referenced by CWincvsApp::InitInstance.

#define IDR_BROWSER 129

Definition at line 25 of file resource.h.

Referenced by CWincvsApp::InitInstance, and CMainFrame::OnCreate.

#define IDR_CNTR_INPLACE 6

Definition at line 5 of file resource.h.

Referenced by CWincvsApp::InitInstance.

#define IDR_CUSTMENUS 182

Definition at line 72 of file resource.h.

Referenced by CCustomizeMenus::OnInitDialog.

#define IDR_CVS_COWORKER 113

Definition at line 19 of file resource.h.

Referenced by CWincvsApp::InitATL.

#define IDR_CVSCOWORKER 114

Definition at line 20 of file resource.h.

#define IDR_CVSGETOPTION 115

Definition at line 21 of file resource.h.

#define IDR_FILELIST 157

Definition at line 56 of file resource.h.

Referenced by CWincvsApp::InitInstance, and CMainFrame::OnCreate.

#define IDR_FILTER 186

Definition at line 77 of file resource.h.

Referenced by CWincvsApp::InitInstance, and CMainFrame::OnCreate.

#define IDR_GRAPH 161

Definition at line 59 of file resource.h.

Referenced by CWincvsApp::InitInstance.

#define IDR_MAINFRAME 128

Definition at line 22 of file resource.h.

Referenced by CWincvsApp::InitInstance, and CMainFrame::OnCreate.

#define IDR_MENUICONS 178

Definition at line 69 of file resource.h.

#define IDR_MULTIUSER 158

Definition at line 58 of file resource.h.

Referenced by CWincvsApp::InitInstance, and CMainFrame::OnCreate.

#define IDR_STATEICONS 164

Definition at line 62 of file resource.h.

Referenced by CBrowseFileView::OnInitialUpdate.

#define IDR_TAGS 165

Definition at line 64 of file resource.h.

Referenced by CWincvsApp::InitInstance, and CMainFrame::OnCreate.

#define IDR_WINCVSTYPE 129

Definition at line 23 of file resource.h.

#define IDR_WORKSPACE 173

Definition at line 66 of file resource.h.

Referenced by CMainFrame::InitializeDockingWindows.

#define IDS_COMBOBROWSER 32813

Definition at line 312 of file resource.h.

#define IDS_DEFFONT 129

Definition at line 24 of file resource.h.

Generated on Sun Feb 24 01:23:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


SortHeaderCtrl.cpp File Reference

WinCvs/SortHeaderCtrl.cpp File Reference

#include "stdafx.h"
#include "SortHeaderCtrl.h"

Include dependency graph for SortHeaderCtrl.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


SortHeaderCtrl.h File Reference

WinCvs/SortHeaderCtrl.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CSortHeaderCtrl

Generated on Sun Feb 24 01:23:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Splash.cpp File Reference

WinCvs/Splash.cpp File Reference

#include "stdafx.h"
#include "resource.h"
#include "Splash.h"
#include "wincvs.h"
#include "CPStr.h"

Include dependency graph for Splash.cpp:

Include dependency graph

Go to the source code of this file.

Functions

const int gc_nBitmapRightMargin (519-491)

Function Documentation

const int gc_nBitmapRightMargin ( 519- 491 ) [static]

Referenced by CSplashWnd::OnPaint.

Generated on Sun Feb 24 01:23:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Splash.h File Reference

WinCvs/Splash.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CSplashWnd

Generated on Sun Feb 24 01:23:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Stat.cpp File Reference

WinCvs/Stat.cpp File Reference

#include <stdafx.h>
#include <errno.h>
#include <io.h>
#include "AppConsole.h"
#include "wincvsdebug.h"

Include dependency graph for Stat.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void | _dosmaperr (DWORD dwErr)
BOOL | IsLeapYear (WORD year)
int | CompareTargetDate (const SYSTEMTIME *p_test_date, const SYSTEMTIME *p_target_date)
int | GetTimeZoneBias (const SYSTEMTIME *pst)
bool | IsDST (const SYSTEMTIME *pst)
void | LocalSystemTimeToUtcSystemTime (const SYSTEMTIME *p_local, SYSTEMTIME *p_utc)
BOOL | FileTimeToUnixTime (const FILETIME *pft, time_t *put, BOOL local_time)
int | _statcore (HANDLE hFile, const char *filename, struct stat *buf)
int | wnt_stat (const char *name, struct stat *buf)
int | wnt_fstat (int fildes, struct stat *buf)
int | wnt_lstat (const char *name, struct stat *buf)

Variables

struct {
DWORD err
int dos
} errors []
const WORD | month_len [12]
const char * | month_names [12]
const ULONGLONG | systemtime_second = 10000000L

Function Documentation

void _dosmaperr ( DWORD dwErr ) [static]

Definition at line 83 of file Stat.cpp.

References errors.

Referenced by _statcore.

00084 {
00085     int n;
00086     for(n=0; n<sizeof(errors)/sizeof(errors[0]); n++)
00087     {
00088         if(errors[n].err==dwErr)
00089         {
00090             errno=errors[n].dos;
00091             return;
00092         }
00093     }
00094     errno=EFAULT;
00095 }

int _statcore | ( | HANDLE | hFile,
 |  | const char * | filename,
 |  | struct stat * | buf
 | ) | [static]

Definition at line 411 of file Stat.cpp.

References _dosmaperr, ASSERT, FALSE, FileTimeToUnixTime, NULL, stat, stricmp, and TRUE.

Referenced by wnt_fstat, wnt_lstat, and wnt_stat.

00412 {
00413     BY_HANDLE_FILE_INFORMATION bhfi;
00414     int isdev;
00415     char szFs[32];
00416     int is_gmt_fs = -1;
00417
00418     if(hFile)
00419     {
00420         /* Find out what kind of handle underlies filedes
00421         */
00422         isdev = GetFileType(hFile) & ~FILE_TYPE_REMOTE;
00423
00424         if ( isdev != FILE_TYPE_DISK )
00425         {
00426             /* not a disk file. probably a device or pipe
00427              */
00428             if ( (isdev == FILE_TYPE_CHAR) || (isdev == FILE_TYPE_PIPE) )
00429             {
00430                 /* treat pipes and devices similarly. no further info is
00431                  * available from any API, so set the fields as reasonably
00432                  * as possible and return.
00433                  */
00434                 if ( isdev == FILE_TYPE_CHAR )
00435                     buf->st_mode = _S_IFCHR;
00436                 else
00437                     buf->st_mode = _S_IFIFO;
00438
00439                 buf->st_rdev = buf->st_dev = (_dev_t)hFile;
00440                 buf->st_nlink = 1;
00441                 buf->st_uid = buf->st_gid = buf->st_ino = 0;
00442                 buf->st_atime = buf->st_mtime = buf->st_ctime = 0;
00443                 if ( isdev == FILE_TYPE_CHAR )
00444                     buf->st_size = 0;
00445                 else
00446                 {
00447                     unsigned long ulAvail;
00448                     int rc;
00449                     rc = PeekNamedPipe(hFile,NULL,0,NULL,&ulAvail,NULL);
00450                     if (rc)
00451                         buf->st_size = (_off_t)ulAvail;
00452                     else
00453                         buf->st_size = (_off_t)0;
00454                 }
00455
00456                 return 0;
00457             }
00458             else if ( isdev == FILE_TYPE_UNKNOWN )
00459             {
00460                 // Network device
00461                 errno = EBADF;
00462                 return -1;
00463             }
00464         }
00465     }
00466
00467     /* set the common fields
00468      */
00469     buf->st_ino = buf->st_uid = buf->st_gid = buf->st_mode = 0;
00470     buf->st_nlink = 1;
00471
00472     if(hFile)
00473     {
00474         /* use the file handle to get all the info about the file
00475          */
00476         if ( !GetFileInformationByHandle(hFile, &bhfi) )
00477         {
00478             _dosmaperr(GetLastError());
00479             return -1;
00480         }
00481     }
00482     else
00483     {
00484         WIN32_FIND_DATA fd;
00485         HANDLE hFind;
00486
00487         if(strlen(filename)==3 && !stricmp(filename+1,":\\"))
00488         {
00489             // Can't do anything about the root directory...
00490             // Win2k and Win98 can return info, but Win95 can't, so
00491             // it's best to do nothing.
00492             memset(&bhfi,0,sizeof(bhfi));
00493             bhfi.dwFileAttributes=GetFileAttributes(filename);
00494             if(bhfi.dwFileAttributes==0xFFFFFFFF)
00495             {
00496                 _dosmaperr(GetLastError());
00497                 return -1;
00498             }
00499             bhfi.nNumberOfLinks=1;
00500         }
00501         else
00502         {
00503             hFind=FindFirstFile(filename,&fd);
00504             if(hFind==INVALID_HANDLE_VALUE)
00505             {
00506                 _dosmaperr(GetLastError());
00507                 return -1;
00508             }
00509             FindClose(hFind);
00510             memset(&bhfi,0,sizeof(bhfi));
00511             bhfi.dwFileAttributes=fd.dwFileAttributes;
00512             bhfi.ftCreationTime=fd.ftCreationTime;
00513             bhfi.ftLastAccessTime=fd.ftLastAccessTime;
00514             bhfi.ftLastWriteTime=fd.ftLastWriteTime;
00515             bhfi.nFileSizeLow=fd.nFileSizeLow;
00516             bhfi.nFileSizeHigh=fd.nFileSizeHigh;
00517             bhfi.nNumberOfLinks=1;
00518         }
00519     }
00520
00521     if ( bhfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY )
00522         buf->st_mode |= (_S_IREAD + (_S_IREAD >> 3) + (_S_IREAD >> 6));
00523     else
00524         buf->st_mode |= ((_S_IREAD|_S_IWRITE) + ((_S_IREAD|_S_IWRITE) >> 3)
00525           + ((_S_IREAD|_S_IWRITE) >> 6));
00526     if (bhfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
00527         buf->st_mode |= (_S_IEXEC + (_S_IEXEC >> 3) + (_S_IEXEC >> 6));
00528
00529     // Potential, but unlikely problem... casting DWORD to short.
00530     // Reported by Jerzy Kaczorowski, addressed by Jonathan Gilligan
00531     // if the number of links is greater than 0x7FFF
00532     // there would be an overflow problem.
00533     // This is a problem inherent in the struct stat, and hence
00534     // in the design of the C library.
00535     ASSERT(bhfi.nNumberOfLinks <= SHRT_MAX);
00536     if (bhfi.nNumberOfLinks > SHRT_MAX) {
00537         buf->st_nlink = SHRT_MAX;
00538         }
00539     else {
00540         buf->st_nlink= static_cast<short>(bhfi.nNumberOfLinks);
00541         }
00542
00543     if(!filename)
00544     {
00545         // We have to assume here that the repository doesn't span drives, so the
00546         // current directory is correct.
00547         *szFs='\0';
00548         GetVolumeInformation(NULL,NULL,0,NULL,NULL,NULL,szFs,32);
00549         if(!stricmp(szFs,"NTFS"))
00550             is_gmt_fs = 1;
00551         else
00552             is_gmt_fs = 0;
00553     }
00554     else
00555     {
00556         if(filename[1]!=':')
00557         {
00558             if((filename[0]=='\\' || filename[0]=='/') && (filename[1]=='\\' || filename[1]=='/'))
00559             {
00560                 // UNC pathname, assumed to be on an NTFS server.  No way to
00561                 // check, actually (GVI doesn't return anything useful).
00562                 is_gmt_fs = 1;
00563             }
00564             else
00565             {
00566                 // Relative path, treat as local
00567                 GetVolumeInformation(NULL,NULL,0,NULL,NULL,NULL,szFs,sizeof(szFs));
00568                 if(!stricmp(szFs,"NTFS"))
00569                     is_gmt_fs = 1;
00570                 else
00571                     is_gmt_fs = 0;
00572             }
00573         }
00574         else
00575         {
00576             // Drive specified...
00577             char szRootPath[4] = "?:\\";
00578             szRootPath[0]=filename[0];
00579             *szFs='\0';
00580             GetVolumeInformation(szRootPath,NULL,0,NULL,NULL,NULL,szFs,sizeof(szFs));
00581             if(!stricmp(szFs,"NTFS") || !stricmp(szFs,"HPFS"))
00582                 is_gmt_fs = 1;
00583             else
00584                 is_gmt_fs = 0;
00585         }
00586     }
00587
00588     if(is_gmt_fs) // NTFS - everything is in GMT already
00589     {
00590         FileTimeToUnixTime ( &bhfi.ftLastAccessTime, &buf->st_atime, FALSE );
00591         FileTimeToUnixTime ( &bhfi.ftLastWriteTime, &buf->st_mtime, FALSE );
00592         FileTimeToUnixTime ( &bhfi.ftCreationTime, &buf->st_ctime, FALSE );
00593     }
00594     else
00595     {
00596         // FAT - timestamps are in incorrectly translated local time.
00597         // translate them back and let FileTimeToUnixTime() do the
00598         // job properly.
00599
00600         FILETIME At,Wt,Ct;
00601
00602         FileTimeToLocalFileTime ( &bhfi.ftLastAccessTime, &At );
00603         FileTimeToLocalFileTime ( &bhfi.ftLastWriteTime, &Wt );
00604         FileTimeToLocalFileTime ( &bhfi.ftCreationTime, &Ct );
00605         FileTimeToUnixTime ( &At, &buf->st_atime, TRUE );
00606         FileTimeToUnixTime ( &Wt, &buf->st_mtime, TRUE );
00607         FileTimeToUnixTime ( &Ct, &buf->st_ctime, TRUE );
00608     }
00609
00610     buf->st_size = bhfi.nFileSizeLow;
00611     if(bhfi.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
00612         buf->st_mode |= _S_IFDIR;
00613     else
00614         buf->st_mode |= _S_IFREG;
00615
00616     /* On DOS, this field contains the drive number, but
00617      * the drive number is not available on this platform.
00618      * Also, for UNC network names, there is no drive number.
00619      */
00620     buf->st_rdev = buf->st_dev = 0;
00621     return 0;
00622 }

int CompareTargetDate | ( | const SYSTEMTIME * | p_test_date,
 |  | const SYSTEMTIME * | p_target_date
 | ) | [static]

Definition at line 149 of file Stat.cpp.

References ASSERT, IsLeapYear, and month_len.

Referenced by GetTimeZoneBias, and IsDST.

00153 {
00154     WORD first_day_of_month; /* day of week of the first. Sunday = 0 */
00155     WORD end_of_month;       /* last day of month */
00156     WORD temp_date;
00157     int test_milliseconds, target_milliseconds;
00158
00159     /* Check that p_target_date is in the correct foramt: */
00160     ASSERT(p_target_date->wYear==0 && p_test_date->wYear != 0);
00161     if (p_target_date->wYear != 0 || p_test_date->wYear == 0)
00162         return 0;
00163
00164     /* Don't waste time calculating if we can shortcut the comparison... */
00165     if (p_test_date->wMonth != p_target_date->wMonth)
00166     {
00167         return (p_test_date->wMonth > p_target_date->wMonth) ? 4 : -4;
00168     }
00169
00170     /* Months equal. Now we neet to do some calculation.
00171      * If we know that y is the day of the week for some arbitrary date x,
00172      * then the day of the week of the first of the month is given by
00173      * (1 + y - x) mod 7.
00174      *
00175      * For instance, if the 19th is a Wednesday (day of week = 3), then
00176      * the date of the first Wednesday of the month is (19 mod 7) = 5.
00177      * If the 5th is a Wednesday (3), then the first of the month is
00178      * four days earlier (it's the first, not the zeroth):
00179      * (3 - 4) = -1; -1 mod 7 = 6. The first is a Saturday.
00180      *
00181      * Check ourselves: The 19th falls on a (6 + 19 - 1) mod 7
00182      * = 24 mod 7 = 3: Wednesday, as it should be.
00183      */
00184     first_day_of_month = (WORD)( (1u + p_test_date->wDayOfWeek - p_test_date->wDay) % 7u);
00185
00186     /* If the first of the month comes on day y, then the first day of week z falls on
00187      * (z - y + 1) mod 7.
00188      *
00189      * For instance, if the first is a Saturday (6), then the first Tuesday (2) falls on a
00190      * (2 - 6 + 1) mod 7 = -3 mod 7 = 4: The fourth. This is correct (see above).
00191      *
00192      * temp_date gets the first <target day of week> in the month.
00193      */
00194     temp_date = (WORD)( (1u + p_target_date->wDayOfWeek - first_day_of_month) % 7u);
00195     /* If we're looking for the third Tuesday in the month, find the date of the first
00196      * Tuesday and add (3 - 1) * 7. In the example, it's the 4 + 14 = 18th.
00197      *
00198      * temp_date now should hold the date for the wDay'th wDayOfWeek of the month.
00199      * we only need to handle the special case of the last <DayOfWeek> of the month.
00200      */
00201     temp_date = (WORD)( temp_date + 7 * p_target_date->wDay );
00202
00203     /* what's the last day of the month? */
00204     end_of_month = month_len [p_target_date->wMonth - 1];
00205     /* Correct if it's February of a leap year? */
00206     if ( p_test_date->wMonth == 2 && IsLeapYear(p_test_date->wYear) )
00207     {
00208         ++ end_of_month;
00209     }
00210
00211     /* if we tried to calculate the fifth Tuesday of the month
00212      * we may well have overshot. Correct for that case.
00213      */
00214     while ( temp_date > end_of_month)
00215         temp_date -= 7;
00216
00217     /* At long last, we're ready to do the comparison. */
00218     if ( p_test_date->wDay != temp_date )
00219     {
00220         return (p_test_date->wDay > temp_date) ? 2 : -2;
00221     }
00222     else
00223     {
00224         test_milliseconds = ((p_test_date->wHour * 60 + p_test_date->wMinute) * 60
00225                                 + p_test_date->wSecond) * 1000 + p_test_date->wMilliseconds;
00226         target_milliseconds = ((p_target_date->wHour * 60 + p_target_date->wMinute) * 60
00227                                 + p_target_date->wSecond) * 1000 + p_target_date->wMilliseconds;
00228         test_milliseconds -= target_milliseconds;
00229         return (test_milliseconds > 0) ? 1 : (test_milliseconds < 0) ? -1 : 0;
00230     }
00231
00232 }

BOOL FileTimeToUnixTime | ( | const FILETIME * | pft,
 |  | time_t * | put,
 |  | BOOL | local_time
 | ) | [static]

Definition at line 334 of file Stat.cpp.

References cvs_err, FALSE, GetTimeZoneBias, GetWinCvsDebugMaskBit, IsDST, month_names, systemtime_second, and wcvsdbg_trace_stat_bit.

Referenced by _statcore.

00335 {
00336     BOOL success = FALSE;
00337
00338    /* FILETIME = number of 100-nanosecond ticks since midnight
00339     * 1 Jan 1601 UTC. time_t = number of 1-second ticks since
00340     * midnight 1 Jan 1970 UTC. To translate, we subtract a
00341     * FILETIME representation of midnight, 1 Jan 1970 from the
00342     * time in question and divide by the number of 100-ns ticks
00343     * in one second.
00344     */
00345
00346
00347     SYSTEMTIME base_st =
00348     {
00349         1970,   /* wYear            */
00350         1,      /* wMonth           */
00351         0,      /* wDayOfWeek       */
00352         1,      /* wDay             */
00353         0,      /* wHour            */
00354         0,      /* wMinute          */
00355         0,      /* wSecond          */
00356         0       /* wMilliseconds    */
00357     };
00358
00359     ULARGE_INTEGER itime;
00360     FILETIME base_ft;
00361     int bias = 0;
00362
00363     if (local_time)
00364     {
00365         SYSTEMTIME temp_st;
00366         success = FileTimeToSystemTime(pft, & temp_st);
00367         bias =  GetTimeZoneBias(& temp_st);
00368     }
00369
00370     success = SystemTimeToFileTime ( &base_st, &base_ft );
00371     if (success)
00372     {
00373         itime.QuadPart = ((ULARGE_INTEGER *)pft)->QuadPart;
00374
00375         itime.QuadPart -= ((ULARGE_INTEGER *)&base_ft)->QuadPart;
00376         itime.QuadPart /= systemtime_second;    // itime is now in seconds.
00377         itime.QuadPart += bias * 60;    // bias is in minutes.
00378
00379         *put = itime.LowPart;
00380     }
00381
00382     if (!success)
00383     {
00384         *put = -1;   /* error value used by mktime() */
00385     }
00386
00387     if (GetWinCvsDebugMaskBit(wcvsdbg_trace_stat_bit))
00388     {
00389             char scratch[128];
00390             SYSTEMTIME temp_st;
00391             struct tm gmt;
00392             bool bDst;
00393             FileTimeToSystemTime(pft, &temp_st);
00394             bDst = IsDST(& temp_st);
00395             gmt = *gmtime(put);
00396             _snprintf(scratch, 128,
00397                 "Converting file time (%s, bias = %d): %s %02d %02d:%02d:%02d.%03d %4d --> %s\n",
00398                 local_time ? (bDst ? "Daylight" : "Standard") : "UTC", bias,
00399                 month_names[temp_st.wMonth - 1], temp_st.wDay,
00400                 temp_st.wHour, temp_st.wMinute, temp_st.wSecond, temp_st.wMilliseconds,
00401                 temp_st.wYear,
00402                 asctime(& gmt) );
00403
00404             cvs_err(scratch);
00405             OutputDebugString(scratch);
00406     }
00407
00408     return success;
00409 }

int GetTimeZoneBias ( const SYSTEMTIME * pst ) [static]

Definition at line 239 of file Stat.cpp.

References ASSERT, and CompareTargetDate.

Referenced by FileTimeToUnixTime, and LocalSystemTimeToUtcSystemTime.

00240 {
00241     TIME_ZONE_INFORMATION tz;
00242     int n, bias;
00243
00244     GetTimeZoneInformation ( &tz );
00245
00246     /*  I only deal with cases where we look at
00247      *  a "last sunday" kind of thing.
00248      */
00249     ASSERT(tz.DaylightDate.wYear == 0 && tz.StandardDate.wYear == 0);
00250
00251     bias = tz.Bias;
00252
00253     n = CompareTargetDate ( pst, & tz.DaylightDate );
00254     if (n < 0)
00255         bias += tz.StandardBias;
00256     else
00257     {
00258         n = CompareTargetDate ( pst, & tz.StandardDate );
00259         if (n < 0)
00260             bias += tz.DaylightBias;
00261         else
00262             bias += tz.StandardBias;
00263     }
00264     return bias;
00265 }

bool IsDST ( const SYSTEMTIME * pst ) [static]

Definition at line 270 of file Stat.cpp.

References ASSERT, and CompareTargetDate.

Referenced by FileTimeToUnixTime.

00271 {
00272     TIME_ZONE_INFORMATION tz;
00273
00274     GetTimeZoneInformation ( &tz );
00275
00276     /*  I only deal with cases where we look at
00277      *  a "last sunday" kind of thing.
00278      */
00279     ASSERT(tz.DaylightDate.wYear == 0 && tz.StandardDate.wYear == 0);
00280
00281     return (CompareTargetDate ( pst, & tz.DaylightDate ) >= 0)
00282             && (CompareTargetDate ( pst, & tz.StandardDate ) < 0);
00283 }

BOOL IsLeapYear ( WORD year )

Definition at line 106 of file Stat.cpp.

Referenced by CompareTargetDate.

00107 {
00108     return ( (year & 3u == 0)
00109             && ( (year % 100u == 0)
00110                 || (year % 400u == 0) ));
00111 }

void LocalSystemTimeToUtcSystemTime | ( | const SYSTEMTIME * | p_local,
 |  | SYSTEMTIME * | p_utc
 | ) |

Definition at line 301 of file Stat.cpp.

References GetTimeZoneBias, and systemtime_second.

00302 {
00303     FILETIME ft;
00304     ULARGE_INTEGER itime, delta;
00305     int bias = GetTimeZoneBias(p_local);
00306
00307     // delta = bias correction: bias minutes.
00308     SystemTimeToFileTime(p_local, & ft);
00309     itime.QuadPart = ((ULARGE_INTEGER *) &ft)->QuadPart;
00310     delta.QuadPart = systemtime_second * 60 * bias;   // bias in minutes...
00311     itime.QuadPart += delta.QuadPart;
00312
00313     ((ULARGE_INTEGER *) & ft)->QuadPart = itime.QuadPart;
00314     FileTimeToSystemTime(& ft, p_utc);
00315 }

int wnt_fstat | ( | int | fildes,
 |  | struct stat * | buf
 | ) |

Definition at line 631 of file Stat.cpp.

References _statcore, NULL, and stat.

00632 {
00633     return _statcore((HANDLE)_get_osfhandle(fildes),NULL,buf);
00634 }

int wnt_lstat | ( | const char * | name,
 |  | struct stat * | buf
 | ) |

Definition at line 636 of file Stat.cpp.

References _statcore, NULL, and stat.

00637 {
00638     return _statcore(NULL,name,buf);
00639 }

int wnt_stat | ( | const char * | name,
 |  | struct stat * | buf
 | ) |

Definition at line 624 of file Stat.cpp.

References _statcore, NULL, stat, and stricmp.

00625 {
00626     if(stricmp(name,"Entries") && stricmp(name,"Entries.log"))
00627         name=name;
00628     return _statcore(NULL,name,buf);
00629 }

Variable Documentation

int dos

Definition at line 7 of file Stat.cpp.

DWORD err

Definition at line 7 of file Stat.cpp.

Referenced by CompatEndMoveToTrash, CompatLoadLibrary, findTcl, CvsPrefs::load, CPersistent::LoadAll, MakeTmpFile, TBrowserFill::OnError, TBrowserFillDummy::OnError, TViewFill::OnError, LSReport::OnError, CFillTclEntries::OnError, CFillPyEntries::OnError, CFindSettings::OnError, MacroTraversal::OnError, ImportReport::OnError, TraversalReport::OnError, read, and CPersistent::SaveAll.

struct { ... } errors[] [static]

Referenced by _dosmaperr.

const WORD month_len[12] [static]

Initial value:

{
    31,
    28,
    31,
    30,
    31,
    30,
    31,
    31,
    30,
    31,
    30,
    31
}

Definition at line 56 of file Stat.cpp.

Referenced by CompareTargetDate.

const char* month_names[12] [static]

Initial value:

{
    "Jan", "Feb", "Mar", "Apr",
    "May", "Jun", "Jul", "Aug",
    "Sep", "Oct", "Nov", "Dec"
}

Definition at line 72 of file Stat.cpp.

Referenced by FileTimeToUnixTime.

const ULONGLONG systemtime_second = 10000000L [static]

Definition at line 80 of file Stat.cpp.

Referenced by FileTimeToUnixTime, and LocalSystemTimeToUtcSystemTime.

Generated on Sun Feb 24 01:23:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


StdAfx.cpp File Reference

WinCvs/StdAfx.cpp File Reference

#include "stdafx.h"

Include dependency graph for StdAfx.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:22:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/StdAfx.cpp Source File

WinCvs/StdAfx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  wincvs.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
Generated on Sun Feb 24 01:21:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


StdAfx.h File Reference

WinCvs/StdAfx.h File Reference

#include <afxwin.h>
#include <afxext.h>
#include <afxole.h>
#include <afxodlgs.h>
#include <afxdisp.h>
#include <afxcmn.h>
#include <afxsock.h>
#include "CJLibrary.h"
#include <atlbase.h>
#include <atlcom.h>
#include "TipDlg.h"
#include <vector>
#include <map>
#include <afxrich.h>
#include <afxcview.h>
#include <sys/stat.h>

Include dependency graph for StdAfx.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCVS_CoworkerModule
struct | wnt_stat

Defines

#define | AFX_STDAFX_H__D2D77DCA_8299_11D1_8949_444553540000__INCLUDED_
#define | VC_EXTRALEAN
#define | qCvsDebug 0
#define | UASSERT ASSERT
#define | _ATL_APARTMENT_THREADED
#define | fstat wnt_fstat
#define | lstat wnt_lstat
#define | stat wnt_stat

Functions

int | wnt_stat (const char *name, struct wnt_stat *buf)
int | wnt_fstat (int fildes, struct wnt_stat *buf)
int | wnt_lstat (const char *name, struct wnt_stat *buf)

Variables

CCVS_CoworkerModule _Module

Define Documentation

#define _ATL_APARTMENT_THREADED

Definition at line 40 of file StdAfx.h.

#define AFX_STDAFX_H__D2D77DCA_8299_11D1_8949_444553540000__INCLUDED_

Definition at line 7 of file StdAfx.h.

#define fstat wnt_fstat

Definition at line 92 of file StdAfx.h.

#define lstat wnt_lstat

Definition at line 93 of file StdAfx.h.

#define qCvsDebug 0

Definition at line 34 of file StdAfx.h.

#define stat wnt_stat

Definition at line 94 of file StdAfx.h.

Referenced by _statcore, RemoveCvsArgs::addfile, BuildIgnoredList, CBrowseFileView::EditSel, Entries_SetVisited, FileTraverse, CBrowseFileView::GetEntriesModTime, UCvsFiles::GetEntriesModTime, getLoc, launchCVS, LaunchViewer, CWincvsApp::LookForResourceFile, MakeTmpFile, TViewFill::OnAlias, CFillTclEntries::OnAlias, CFillPyEntries::OnAlias, ImportReport::OnAlias, TraversalReport::OnAlias, LSReport::OnAnyDevice, TraversalReport::OnAnyDevice, TBrowserFill::OnDirectory, TBrowserFillDummy::OnDirectory, TViewFill::OnDirectory, CFillTclEntries::OnDirectory, CFillPyEntries::OnDirectory, ImportReport::OnDirectory, TraversalReport::OnDirectory, TViewFill::OnFile, CFillTclEntries::OnFile, CFillPyEntries::OnFile, CFindSettings::OnFile, MacroTraversal::OnFile, ImportReport::OnFile, TraversalReport::OnFile, UWidget::OnGetFloat, UWidget::OnGetState, UWidget::OnSetFloat, UWidget::OnSetState, CWinCvsBrowser::OnUpdateCmd, UCvsFolders::OnUpdateGeneric, CWinCvsBrowser::ResetBrowser, UCvsFolders::ResetBrowser, UCvsFolders::SetDefaultRoot, CHistComboBoxEx::SetIcon, CGraphDoc::SetNode, UCmdUI::SetText, SettingsGetLoc, testCVS, TestFileIsAlias, UCvsGraph::UCvsGraph, unmodified, CvsPrefs::WhichCvs, WinInitWidgets, wnt_fstat, wnt_lstat, and wnt_stat.

#define UASSERT ASSERT

Definition at line 37 of file StdAfx.h.

#define VC_EXTRALEAN

Definition at line 13 of file StdAfx.h.

Function Documentation

int wnt_fstat | ( | int | fildes,
 |  | struct wnt_stat * | buf
 | ) |

int wnt_lstat | ( | const char * | name,
 |  | struct wnt_stat * | buf
 | ) |

int wnt_stat | ( | const char * | name,
 |  | struct wnt_stat * | buf
 | ) |

Referenced by cvsgui_GetFileModTime, and tclGetFileModTimeProc.

Variable Documentation

CCVS_CoworkerModule _Module

Definition at line 52 of file StdAfx.h.

Generated on Sun Feb 24 01:22:40 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/StdAfx.h Source File

WinCvs/StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //  or project specific include files that are used frequently, but
00003 //      are changed infrequently
00004 //
00005
00006 #if !defined(AFX_STDAFX_H__D2D77DCA_8299_11D1_8949_444553540000__INCLUDED_)
00007 #define AFX_STDAFX_H__D2D77DCA_8299_11D1_8949_444553540000__INCLUDED_
00008
00009 #if _MSC_VER >= 1000
00010 #pragma once
00011 #endif // _MSC_VER >= 1000
00012
00013 #define VC_EXTRALEAN        // Exclude rarely-used stuff from Windows headers
00014
00015 #include <afxwin.h>         // MFC core and standard components
00016 #include <afxext.h>         // MFC extensions
00017 #include <afxole.h>         // MFC OLE classes
00018 #include <afxodlgs.h>       // MFC OLE dialog classes
00019 #include <afxdisp.h>        // MFC OLE automation classes
00020 #ifndef _AFX_NO_AFXCMN_SUPPORT
00021 #include <afxcmn.h>         // MFC support for Windows Common Controls
00022 #endif // _AFX_NO_AFXCMN_SUPPORT
00023
00024 #include <afxsock.h>        // MFC socket extensions
00025
00026 //{{AFX_INSERT_LOCATION}}
00027 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00028
00029 #include "CJLibrary.h"      // MFC socket extensions
00030
00031 #ifdef _DEBUG
00032 #   define qCvsDebug 1
00033 #else
00034 #   define qCvsDebug 0
00035 #endif
00036
00037 #define UASSERT ASSERT
00038 // for the pseudo-interface
00039
00040 #define _ATL_APARTMENT_THREADED
00041 #include <atlbase.h>
00042 //You may derive a class from CComModule and use it if you want to override
00043 //something, but do not change the name of _Module
00044 class CCVS_CoworkerModule : public CComModule
00045 {
00046 public:
00047     LONG Unlock();
00048     LONG Lock();
00049     LPCTSTR FindOneOf(LPCTSTR p1, LPCTSTR p2);
00050     DWORD dwThreadID;
00051 };
00052 extern CCVS_CoworkerModule _Module;
00053 #include <atlcom.h>
00054
00055 #pragma warning (disable : 4786)
00056
00057 #include "TipDlg.h"
00058 #include <vector>
00059 #include <map>
00060 #include <afxrich.h>
00061 #include <afxcview.h>
00062
00063 #ifdef _DEBUG
00064 #   include <malloc.h>
00065 #   include <stdlib.h>
00066 #   include <crtdbg.h>
00067 #   define   malloc(s)         _malloc_dbg(s, _NORMAL_BLOCK, __FILE__, __LINE__)
00068 #   define   calloc(c, s)      _calloc_dbg(c, s, _NORMAL_BLOCK, __FILE__, __LINE__)
00069 #   define   realloc(p, s)     _realloc_dbg(p, s, _NORMAL_BLOCK, __FILE__, __LINE__)
00070 #   define   free(p)           _free_dbg(p, _NORMAL_BLOCK)
00071 #endif
00072
00073 #include <sys/stat.h>
00074 // Replacement stat() routine
00075 struct wnt_stat {
00076         _dev_t st_dev;
00077         _ino_t st_ino;
00078         unsigned short st_mode;
00079         short st_nlink;
00080         short st_uid;
00081         short st_gid;
00082         _dev_t st_rdev;
00083         _off_t st_size;
00084         time_t st_atime;
00085         time_t st_mtime;
00086         time_t st_ctime;
00087         };
00088 int wnt_stat(const char *name, struct wnt_stat *buf);
00089 int wnt_fstat (int fildes, struct wnt_stat *buf);
00090 int wnt_lstat (const char *name, struct wnt_stat *buf);
00091
00092 #define fstat wnt_fstat
00093 #define lstat wnt_lstat
00094 #define stat wnt_stat
00095
00096 #endif // !defined(AFX_STDAFX_H__D2D77DCA_8299_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/TbEdit.cpp Source File

WinCvs/TbEdit.cpp

Go to the documentation of this file.
00001 // TbEdit.cpp : implementation file
00002 //
00003
00004 #include "stdafx.h"
00005 #include "wincvs.h"
00006 #include "TbEdit.h"
00007
00008 #ifdef _DEBUG
00009 #define new DEBUG_NEW
00010 #undef THIS_FILE
00011 static char THIS_FILE[] = __FILE__;
00012 #endif
00013
00015 // CTbEdit
00016
00017 CTbEdit::CTbEdit()
00018 {
00019 }
00020
00021 CTbEdit::~CTbEdit()
00022 {
00023 }
00024
00025
00026 BEGIN_MESSAGE_MAP(CTbEdit, CEdit)
00027     //{{AFX_MSG_MAP(CTbEdit)
00028     //}}AFX_MSG_MAP
00029 END_MESSAGE_MAP()
00030
00032 // CTbEdit message handlers
00033
00034
00035 BOOL CTbEdit::PreTranslateMessage(MSG* pMsg)
00036 {
00037     if (pMsg->message == WM_KEYDOWN)
00038     {
00039         int nVirtKey = (int) pMsg->wParam;
00040         switch (nVirtKey)
00041         {
00042             case VK_ESCAPE:
00043                 GetOwner()->PostMessage(WM_CONTENTCHANGE, FALSE);
00044                 break;
00045             case VK_RETURN:
00046                 GetOwner()->PostMessage(WM_CONTENTCHANGE, TRUE);
00047                 break;
00048         }
00049     }
00050     return CEdit::PreTranslateMessage(pMsg);
00051 }
00052
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/TbEdit.h Source File

WinCvs/TbEdit.h

Go to the documentation of this file.
00001 #if !defined(AFX_TBEDIT_H__AEA5EC19_1292_4A30_93EA_E209A6BAE000__INCLUDED_)
00002 #define AFX_TBEDIT_H__AEA5EC19_1292_4A30_93EA_E209A6BAE000__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007 // TbEdit.h : header file
00008 //
00009
00011 // CTbEdit window
00012
00013 class CTbEdit : public CEdit
00014 {
00015 // Construction
00016 public:
00017     CTbEdit();
00018
00019 // Attributes
00020 public:
00021     enum { WM_CONTENTCHANGE = WM_APP + 56};
00022 // Operations
00023 public:
00024
00025 // Overrides
00026     // ClassWizard generated virtual function overrides
00027     //{{AFX_VIRTUAL(CTbEdit)
00028     public:
00029     virtual BOOL PreTranslateMessage(MSG* pMsg);
00030     //}}AFX_VIRTUAL
00031
00032 // Implementation
00033 public:
00034     virtual ~CTbEdit();
00035
00036     // Generated message map functions
00037 protected:
00038     //{{AFX_MSG(CTbEdit)
00039     //}}AFX_MSG
00040
00041     DECLARE_MESSAGE_MAP()
00042 };
00043
00045
00046 //{{AFX_INSERT_LOCATION}}
00047 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00048
00049 #endif // !defined(AFX_TBEDIT_H__AEA5EC19_1292_4A30_93EA_E209A6BAE000__INCLUDED_)
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/TipDlg.cpp Source File

WinCvs/TipDlg.cpp

Go to the documentation of this file.
00001 #include "stdafx.h"
00002 #include "resource.h"
00003 // CG: This file added by 'Tip of the Day' component.
00004
00005 #include <winreg.h>
00006 #include <sys\stat.h>
00007 #include <sys\types.h>
00008
00009 #include "wincvs.h"
00010 #include "CPStr.h"
00011 #include "TextBinary.h"
00012
00013 #ifdef _DEBUG
00014 #define new DEBUG_NEW
00015 #undef THIS_FILE
00016 static char THIS_FILE[] = __FILE__;
00017 #endif
00018
00020 // CTipDlg dialog
00021
00022 #define MAX_BUFLEN 1000
00023
00024 static const TCHAR szSection[] = _T("Tip");
00025 static const TCHAR szIntFilePos[] = _T("FilePos");
00026 static const TCHAR szTimeStamp[] = _T("TimeStamp");
00027 static const TCHAR szIntStartup[] = _T("StartUp");
00028
00029 CTipDlg::CTipDlg(CWnd* pParent /*=NULL*/)
00030     : CDialog(IDD_TIP, pParent)
00031 {
00032     //{{AFX_DATA_INIT(CTipDlg)
00033     m_bStartup = TRUE;
00034     //}}AFX_DATA_INIT
00035
00036     // We need to find out what the startup and file position parameters are
00037     // If startup does not exist, we assume that the Tips on startup is checked TRUE.
00038     CWincvsApp* pApp = (CWincvsApp *)AfxGetApp();
00039     m_bStartup = !pApp->GetProfileInt(szSection, szIntStartup, 0);
00040     UINT iFilePos = pApp->GetProfileInt(szSection, szIntFilePos, 0);
00041     CStr tips;
00042     pApp->GetAppPath(tips);
00043     if(!tips.empty() && !tips.endsWith(kPathDelimiter))
00044     {
00045         tips << kPathDelimiter;
00046     }
00047     tips << "tips.txt";
00048
00049     // Now try to open the tips file
00050     m_pStream = fopen(tips, "r");
00051 #if qCvsDebug
00052     if(m_pStream == 0L)
00053         m_pStream = fopen("c:\\cvsgui\\wincvs\\hlp\\tips.txt", "r");
00054     if(m_pStream == 0L)
00055         m_pStream = fopen("d:\\cvsgui\\wincvs\\hlp\\tips.txt", "r");
00056     if(m_pStream == 0L)
00057         m_pStream = fopen("e:\\cvsgui\\wincvs\\hlp\\tips.txt", "r");
00058     if(m_pStream == 0L)
00059         m_pStream = fopen("f:\\cvsgui\\wincvs\\hlp\\tips.txt", "r");
00060 #endif
00061     if (m_pStream == NULL)
00062     {
00063         m_strTip.LoadString(CG_IDS_FILE_ABSENT);
00064         return;
00065     }
00066
00067     // If the timestamp in the INI file is different from the timestamp of
00068     // the tips file, then we know that the tips file has been modified
00069     // Reset the file position to 0 and write the latest timestamp to the
00070     // ini file
00071     struct _stat buf;
00072     _fstat(_fileno(m_pStream), &buf);
00073     CString strCurrentTime = ctime(&buf.st_ctime);
00074     strCurrentTime.TrimRight();
00075     CString strStoredTime =
00076         pApp->GetProfileString(szSection, szTimeStamp, NULL);
00077     if (strCurrentTime != strStoredTime)
00078     {
00079         iFilePos = 0;
00080         pApp->WriteProfileString(szSection, szTimeStamp, strCurrentTime);
00081     }
00082
00083     if (fseek(m_pStream, iFilePos, SEEK_SET) != 0)
00084     {
00085         AfxMessageBox(CG_IDP_FILE_CORRUPT);
00086     }
00087     else
00088     {
00089         GetNextTipString(m_strTip);
00090     }
00091 }
00092
00093 CTipDlg::~CTipDlg()
00094 {
00095     // This destructor is executed whether the user had pressed the escape key
00096     // or clicked on the close button. If the user had pressed the escape key,
00097     // it is still required to update the filepos in the ini file with the
00098     // latest position so that we don't repeat the tips!
00099
00100     // But make sure the tips file existed in the first place....
00101     if (m_pStream != NULL)
00102     {
00103         CWinApp* pApp = AfxGetApp();
00104         pApp->WriteProfileInt(szSection, szIntFilePos, ftell(m_pStream));
00105         fclose(m_pStream);
00106     }
00107 }
00108
00109 void CTipDlg::DoDataExchange(CDataExchange* pDX)
00110 {
00111     CDialog::DoDataExchange(pDX);
00112     //{{AFX_DATA_MAP(CTipDlg)
00113     DDX_Check(pDX, IDC_STARTUP, m_bStartup);
00114     DDX_Text(pDX, IDC_TIPSTRING, m_strTip);
00115     //}}AFX_DATA_MAP
00116 }
00117
00118 BEGIN_MESSAGE_MAP(CTipDlg, CDialog)
00119     //{{AFX_MSG_MAP(CTipDlg)
00120     ON_BN_CLICKED(IDC_NEXTTIP, OnNextTip)
00121     ON_WM_CTLCOLOR()
00122     ON_WM_PAINT()
00123     //}}AFX_MSG_MAP
00124 END_MESSAGE_MAP()
00125
00127 // CTipDlg message handlers
00128
00129 void CTipDlg::OnNextTip()
00130 {
00131     GetNextTipString(m_strTip);
00132     UpdateData(FALSE);
00133 }
00134
00135 void CTipDlg::GetNextTipString(CString& strNext)
00136 {
00137     LPTSTR lpsz = strNext.GetBuffer(MAX_BUFLEN);
00138
00139     // This routine identifies the next string that needs to be
00140     // read from the tips file
00141     BOOL bStop = FALSE;
00142     while (!bStop)
00143     {
00144         if (_fgetts(lpsz, MAX_BUFLEN, m_pStream) == NULL)
00145         {
00146             // We have either reached EOF or enocuntered some problem
00147             // In both cases reset the pointer to the beginning of the file
00148             // This behavior is same as VC++ Tips file
00149             if (fseek(m_pStream, 0, SEEK_SET) != 0)
00150                 AfxMessageBox(CG_IDP_FILE_CORRUPT);
00151         }
00152         else
00153         {
00154             if (*lpsz != ' ' && *lpsz != '\t' &&
00155                 *lpsz != '\n' && *lpsz != ';')
00156             {
00157                 // There should be no space at the beginning of the tip
00158                 // This behavior is same as VC++ Tips file
00159                 // Comment lines are ignored and they start with a semicolon
00160                 bStop = TRUE;
00161             }
00162         }
00163     }
00164     strNext.ReleaseBuffer();
00165 }
00166
00167 HBRUSH CTipDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
00168 {
00169     if (pWnd->GetDlgCtrlID() == IDC_TIPSTRING)
00170         return (HBRUSH)GetStockObject(WHITE_BRUSH);
00171
00172     return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
00173 }
00174
00175 void CTipDlg::OnOK()
00176 {
00177     CDialog::OnOK();
00178
00179     // Update the startup information stored in the INI file
00180     CWinApp* pApp = AfxGetApp();
00181     pApp->WriteProfileInt(szSection, szIntStartup, !m_bStartup);
00182 }
00183
00184 BOOL CTipDlg::OnInitDialog()
00185 {
00186     CDialog::OnInitDialog();
00187
00188     // If Tips file does not exist then disable NextTip
00189     if (m_pStream == NULL)
00190         GetDlgItem(IDC_NEXTTIP)->EnableWindow(FALSE);
00191
00192     return TRUE;  // return TRUE unless you set the focus to a control
00193 }
00194
00195 void CTipDlg::OnPaint()
00196 {
00197     CPaintDC dc(this); // device context for painting
00198
00199     // Get paint area for the big static control
00200     CWnd* pStatic = GetDlgItem(IDC_BULB);
00201     CRect rect;
00202     pStatic->GetWindowRect(&rect);
00203     ScreenToClient(&rect);
00204
00205     // Paint the background white.
00206     CBrush brush;
00207     brush.CreateStockObject(WHITE_BRUSH);
00208     dc.FillRect(rect, &brush);
00209
00210     // Load bitmap and get dimensions of the bitmap
00211     CBitmap bmp;
00212     bmp.LoadBitmap(IDB_LIGHTBULB);
00213     BITMAP bmpInfo;
00214     bmp.GetBitmap(&bmpInfo);
00215
00216     // Draw bitmap in top corner and validate only top portion of window
00217     CDC dcTmp;
00218     dcTmp.CreateCompatibleDC(&dc);
00219     dcTmp.SelectObject(&bmp);
00220     rect.bottom = bmpInfo.bmHeight + rect.top;
00221     dc.BitBlt(rect.left, rect.top, rect.Width(), rect.Height(),
00222         &dcTmp, 0, 0, SRCCOPY);
00223
00224     // Draw out "Did you know..." message next to the bitmap
00225     CString strMessage;
00226     strMessage.LoadString(CG_IDS_DIDYOUKNOW);
00227     rect.left += bmpInfo.bmWidth;
00228     dc.DrawText(strMessage, rect, DT_VCENTER | DT_SINGLELINE);
00229
00230     // Do not call CDialog::OnPaint() for painting messages
00231 }
00232
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/TipDlg.h Source File

WinCvs/TipDlg.h

Go to the documentation of this file.
00001 #if !defined(TIPDLG_H_INCLUDED_)
00002 #define TIPDLG_H_INCLUDED_
00003
00004 // CG: This file added by 'Tip of the Day' component.
00005
00007 // CTipDlg dialog
00008
00009 class CTipDlg : public CDialog
00010 {
00011 // Construction
00012 public:
00013     CTipDlg(CWnd* pParent = NULL);   // standard constructor
00014
00015 // Dialog Data
00016     //{{AFX_DATA(CTipDlg)
00017     // enum { IDD = IDD_TIP };
00018     BOOL    m_bStartup;
00019     CString m_strTip;
00020     //}}AFX_DATA
00021
00022     FILE* m_pStream;
00023
00024 // Overrides
00025     // ClassWizard generated virtual function overrides
00026     //{{AFX_VIRTUAL(CTipDlg)
00027     protected:
00028     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00029     //}}AFX_VIRTUAL
00030
00031 // Implementation
00032 public:
00033     virtual ~CTipDlg();
00034
00035 protected:
00036     // Generated message map functions
00037     //{{AFX_MSG(CTipDlg)
00038     afx_msg void OnNextTip();
00039     afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
00040     virtual void OnOK();
00041     virtual BOOL OnInitDialog();
00042     afx_msg void OnPaint();
00043     //}}AFX_MSG
00044     DECLARE_MESSAGE_MAP()
00045
00046     void GetNextTipString(CString& strNext);
00047 };
00048
00049 #endif // !defined(TIPDLG_H_INCLUDED_)
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/ToolbarCombo.cpp Source File

WinCvs/ToolbarCombo.cpp

Go to the documentation of this file.
00001 // ToolbarCombo.cpp : implementation file
00002 //
00003
00004 #include "stdafx.h"
00005 #include "wincvs.h"
00006 #include "ToolbarCombo.h"
00007
00008 #ifdef _DEBUG
00009 #define new DEBUG_NEW
00010 #undef THIS_FILE
00011 static char THIS_FILE[] = __FILE__;
00012 #endif
00013
00014 BEGIN_MESSAGE_MAP(CToolbarCombo, CComboBoxEx)
00015     //{{AFX_MSG_MAP(CToolbarCombo)
00016     ON_CONTROL_REFLECT(CBN_SELENDOK, OnSelendok)
00017     ON_CONTROL_REFLECT(CBN_SELENDCANCEL, OnSelendcancel)
00018     //}}AFX_MSG_MAP
00019     ON_MESSAGE(CTbEdit::WM_CONTENTCHANGE, OnContentChange)
00020 END_MESSAGE_MAP()
00021
00022
00024 // CToolbarCombo
00025
00026 CToolbarCombo::CToolbarCombo()
00027 {
00028 }
00029
00030 CToolbarCombo::~CToolbarCombo()
00031 {
00032 }
00033
00034 BOOL CToolbarCombo::Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID )
00035 {
00036     if (!CComboBoxEx::Create(dwStyle, rect, pParentWnd, nID))
00037     {
00038         return FALSE;
00039     }
00040     SetExtendedStyle(CBES_EX_CASESENSITIVE, CBES_EX_CASESENSITIVE);
00041     m_edit.SubclassWindow(GetEditCtrl()->m_hWnd);
00042     m_edit.SetOwner(this);
00043     return TRUE;
00044 }
00045
00046 LRESULT CToolbarCombo::OnContentChange(WPARAM wp, LPARAM lp)
00047 {
00048     bool complete = wp != 0;
00049     if (complete)
00050     {
00051         CString text;
00052         m_edit.GetWindowText(text);
00053         SetText(text);
00054     }
00055     else
00056     {
00057         // restore previous text
00058         ResetText();
00059     }
00060     return 0;
00061 }
00062
00063 void CToolbarCombo::ResetText()
00064 {
00065     m_edit.SetWindowText(m_text);
00066 }
00067
00068 void CToolbarCombo::SetText(const CString& text)
00069 {
00070     if (m_text.Compare(text) != 0)
00071     {
00072         m_text = text;
00073
00074         // append selection to combo box
00075         int count = GetCount();
00076         for (int i = count - 1; i >= 0 ; i--)
00077         {
00078             TCHAR buffer[256];
00079             GetItemText(i, buffer, 256);
00080             if (text.Compare(buffer) == 0)
00081             {
00082                 DeleteItem(i);
00083             }
00084         }
00085         COMBOBOXEXITEM item;
00086         item.mask = CBEIF_TEXT;
00087         item.iItem = 0;
00088         item.pszText = (LPTSTR)(LPCTSTR)text;
00089         InsertItem(&item);
00090         count = GetCount();
00091         while (count > 8)
00092         {
00093             count--;
00094             DeleteItem(count);
00095         }
00096
00097         m_manager.NotifyAll();
00098     }
00099 }
00100
00101 void CToolbarCombo::GetItemText(int pos, LPTSTR buffer, int count)
00102 {
00103     COMBOBOXEXITEM item;
00104     item.mask = CBEIF_TEXT;
00105     item.pszText = buffer;
00106     item.cchTextMax = count;
00107     item.iItem = pos;
00108     VERIFY(GetItem(&item));
00109 }
00110
00111 void CToolbarCombo::OnSelendok()
00112 {
00113     CComboBox* combo = GetComboBoxCtrl();
00114     int pos = combo->GetCurSel();
00115     if (pos >= 0)
00116     {
00117         TCHAR buffer[256];
00118         GetItemText(pos, buffer, 256);
00119         SetText(buffer);
00120         ResetText();
00121     }
00122 }
00123
00124 void CToolbarCombo::OnSelendcancel()
00125 {
00126     ResetText();
00127 }
Generated on Sun Feb 24 01:21:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/ToolbarCombo.h Source File

WinCvs/ToolbarCombo.h

Go to the documentation of this file.
00001 #if !defined(AFX_TOOLBARCOMBO_H__3AE857F3_B4BD_11D4_8200_005004D6EF6C__INCLUDED_)
00002 #define AFX_TOOLBARCOMBO_H__3AE857F3_B4BD_11D4_8200_005004D6EF6C__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007 // ToolbarCombo.h : header file
00008 //
00009
00010 #include "BrowseViewModel.h"
00011 #include "tbedit.h"
00012
00014 // CToolbarCombo window
00015
00016 class CToolbarCombo : public CComboBoxEx
00017 {
00018 // Construction
00019 public:
00020     CToolbarCombo();
00021
00022 // Attributes
00023 private:
00024     CTbEdit m_edit;
00025     NotificationManager m_manager;
00026     CString m_text;
00027
00028 // Operations
00029 public:
00030     BOOL Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
00031
00032     NotificationManager* GetManager()
00033     {
00034         return &m_manager;
00035     }
00036
00037     const CString& GetText()
00038     {
00039         return m_text;
00040     }
00041
00042
00043     // retrieves text of an item
00044     // parameters
00045     //   pos - item index
00046     //   buffer - buffer to receive the text
00047     //   count - count of characters in the buffer
00048     void GetItemText(int pos, LPTSTR buffer, int count);
00049
00050
00051 // Overrides
00052     // ClassWizard generated virtual function overrides
00053     //{{AFX_VIRTUAL(CToolbarCombo)
00054     //}}AFX_VIRTUAL
00055
00056 // Implementation
00057 public:
00058     virtual ~CToolbarCombo();
00059
00060     // Generated message map functions
00061 protected:
00062     void SetText(const CString& text);
00063     void ResetText();
00064
00065     //{{AFX_MSG(CToolbarCombo)
00066     afx_msg void OnSelendok();
00067     afx_msg void OnSelendcancel();
00068     //}}AFX_MSG
00069     afx_msg LRESULT OnContentChange(WPARAM wp, LPARAM lp);
00070     DECLARE_MESSAGE_MAP()
00071 };
00072
00074
00075 //{{AFX_INSERT_LOCATION}}
00076 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00077
00078 #endif // !defined(AFX_TOOLBARCOMBO_H__3AE857F3_B4BD_11D4_8200_005004D6EF6C__INCLUDED_)
Generated on Sun Feb 24 01:21:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/version_fu.h Source File

WinCvs/version_fu.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jonathan M. Gilligan <jonathan.gilligan@vanderbilt.edu> --- 23 June 2001
00019  */
00020
00021 /*
00022  * version_fu.h -- Macros used for version numbering
00023  */
00024
00025 #pragma once
00026
00028 // Documentation
00029 //
00030 // The macros below generate a number of strings that describe aspects of
00031 // the current build.
00032 //
00033 // Principal aspects include a number of MS-specified flags:
00034 //
00035 // Debug build:         Self-explanatory.
00036 //
00037 // Prerelease build:    An experimental or alpha or beta build. If either
00038 //                      of the symbols WINCVS_ALPHA_RELEASE or
00039 //                      WINCVS_BETA_RELEASE is defined, then the build is
00040 //                      automatically tagged as prerelease.
00041 //
00042 //                      The build is automatically flagged as a prerelease
00043 //                      build if the flag WINCVS_RELEASE is NOT defined.
00044 //                      Moreover, if either WINCVS_ALPHA_RELEASE or
00045 //                      WINCVS_BETA_RELEASE is defined, it overrides
00046 //                      WINCVS_RELEASE.
00047 //
00048 // Private Build:       A non-standard build. We use the private build
00049 //                      flag to indicate that the build was not an
00050 //                  `   official release. As checked out with CVS, the
00051 //                      sources are set up to build as a private build.
00052 //
00053 //                      To build an official release, the flag
00054 //                      WINCVS_OFFICIAL_DISTRIBUTION should be
00055 //                      defined at build time.
00056 //
00057 // Special Build:       Some other kind of non-standard build. We do not
00058 //                      currently define special builds, but the plumbing
00059 //                      is in place in version_fu to handle special builds
00060 //                      if the flag WINCVS_SPECIAL_BUILD is defined.
00061 //
00062 //
00063 // Strings and other macros generated by version_fu:
00064 //
00065 // WINCVS_FILEVERSION,
00066 // CVSNTDOS_FILEVERSION,
00067 // WINCVS_PRODUCTVERSION:   Version tokens to be used in the VERSION_INFO
00068 //                      resource. These tokens have the form x,x,x,x where
00069 //                      x is a decimal number indicating
00070 //                      major,minor,patch,build.
00071 //
00072 //                      File version refers to the specific executable file
00073 //                      (WinCVS.exe or cvs.exe). Product version refers to
00074 //                      the WinCVS package as a whole.
00075 //
00076 // WINCVS_FILEVERSION_STRING,
00077 // CVSNTDOS_FILEVERSION_STRING,
00078 // WINCVS_PRODUCTVERSION_STRING:    Double-quoted string equivalents of the
00079 //                      above. The format is:
00080 //                      "N x.x.x.x r (s p u d Build x)",
00081 //                      Where
00082 //                      N = name (of file or product)
00083 //                      x.x.x.x = major.minor.patchlevel.build,
00084 //                      r = prerelease build string,
00085 //                      s = special build string,
00086 //                      p = private build string,
00087 //                      u = unicode build string,
00088 //                      d = debug build string.
00089 //
00090 //                      Example:
00091 //                      "WinCvs 1.3.2.7 Beta 2 (Special Private Unicode Debug Build 7)"
00092 //
00093 // WCVS_PATCHED_FLAG,
00094 // WCVS_SPECIAL_BUILD_FLAG,
00095 // WCVS_PRIVATE_BUILD_FLAG,
00096 // WCVS_PRERELEASE_FLAG,
00097 // WVVS_DEBUG_BUILD_FLAG:   These are flags (numbers, which can be OR'ed together
00098 //                          for the FILEFLAGS member of VERSION_INFO.
00099 //
00100 // WCVS_UNICODE_BUILD_STRING_PREFIX,
00101 // WCVS_DEBUG_BUILD_STRING_PREFIX,
00102 // WCVS_SPECIAL_BUILD_STRING_PREFIX,
00103 // WCVS_PRIVATE_BUILD_STRING_PREFIX,
00104 // WCVS_PRERELEASE_BUILD_STRING_PREFIX:    These are strings (ending with
00105 //                          a space) that can be concatenated together
00106 //                          to produce a description of the various
00107 //                          build conditions. The _PREFIX part of the name
00108 //                          indicates that these are in a form to be
00109 //                          concatenated together.
00110 //
00111 //                          The order these fields appear in the File
00112 //                          Description and Product Description fields of
00113 //                          VERSION_INFO are: PRERELEASE, PRIVATE, SPECIAL,
00114 //                          UNICODE, and DEBUG.
00115 //
00116 // WCVS_SPECIAL_BUILD_STRING,
00117 // WCVS_PRIVATE_BUILD_STRING:    the _PREFIX versions with "build"
00118 //                          concatenated to the end.
00119 //
00120 //
00121
00123
00125 // Preprocessor definitions (for version_no.h)
00126 //
00127 // Preprocessor flags (empty #defines):
00128 // These should be #defined in version_no.h
00129 //
00130 // WINCVS_OFFICIAL_DISTRIBUTION:    #define this only when making
00131 //                      an official distribution package. This flag should
00132 //                      never be defined in anything checked into the cvs
00133 //                      repository.
00134 //
00135 // WINCVS_RELEASE:      define this if this is a release (as opposed to a
00136 //                      prerelease) build.
00137 //
00138 // WINCVS_ALPHA_RELEASE:    define this if this is a alpha release. The
00139 //                      alpha number (e.g., alpha 2) will be taken from
00140 //                      the product patch level (see below).
00141 //
00142 // WINCVS_BETA_RELEASE: define this if this is a beta release. The beta
00143 //                      number (e.g., beta 2) will be taken from the
00144 //                      product patch level (see below).
00145 //
00146 // Preprocessor values (#defines with contents):
00147 // These should be #defined in version_no.h
00148 //
00149 // WINCVS_FILE_MAJOR,
00150 // WINCVS_FILE_MINOR,
00151 // WINCVS_FILE_PATCHLEVEL,
00152 //
00153 // CVSNTDOS_FILE_MAJOR,
00154 // CVSNTDOS_FILE_MINOR,
00155 // CVSNTDOS_FILE_PATCHLEVEL,
00156 //
00157 // WINCVS_PRODUCT_MAJOR,
00158 // WINCVS_PRODUCT_MINOR,
00159 // WINCVS_PRODUCT_PATCHLEVEL,
00160 //
00161 // WINCVS_BUILD,
00162 // CVSNTDOS_BUILD:      These macros all indicate parts of the version
00163 //                      number. *FILE* indicates specific numbers for the
00164 //                      .exe files (WinCVS.exe, CVS.exe). The *PRODUCT*
00165 //                      numbers indicate the version of the package as a
00166 //                      whole.
00167 //
00168 //                      At this time, WinCVS.exe is at version 1.3.2.x
00169 //                      (WinCVS 1.3 beta 2, build x), cvs.exe is at
00170 //                      1.11.1.x (cvs 1.11 patch level 1, build x). Both
00171 //                      files are part of the WinCVS 1.3 beta 2
00172 //                      distribution.
00173 //
00174 //                      The build numbers for both files should be
00175 //                      incremented (by hand editing version_no.h) at
00176 //                      least once for every build posted publicly at
00177 //                      cvsgui.org.
00178 //
00179 //                      EXAMPLE:
00180 //
00181 //                      #define WINCVS_FILE_MAJOR           1
00182 //                      #define WINCVS_FILE_MINOR           3
00183 //                      #define WINCVS_FILE_PATCHLEVEL      2
00184 //
00185 //                      #define CVSNTDOS_FILE_MAJOR         1
00186 //                      #define CVSNTDOS_FILE_MINOR        11
00187 //                      #define CVSNTDOS_FILE_PATCHLEVEL    1
00188 //
00189 //                      #define WINCVS_PRODUCT_MAJOR        1
00190 //                      #define WINCVS_PRODUCT_MINOR        3
00191 //                      #define WINCVS_PRODUCT_PATCHLEVEL   2
00192 //
00193 //                      #define WINCVS_BUILD                1
00194 //                      #define CVSNTDOS_BUILD              1
00195 //
00196 //
00197 // WINCVS_SPECIAL_BUILD,
00198 // WINCVS_PRIVATE_BUILD:    These should be #defined to a double-quoted
00199 //                      string that will be used to create a prefix for
00200 //                      the build description string. E.g., the following:
00201 //
00202 //                      #define WINCVS_SPECIAL_BUILD "anomalous"
00203 //                      #define WINCVS_PRIVATE_BUILD "in house"
00204 //
00205 //                      Will produce the text "in house anomalous build"
00206 //                      in the file and product description strings,
00207 //                      "anomalous build" in the Special Build Description
00208 //                      string, and "in house build" in the Private Build
00209 //                      string in the VERSION_INFO resource.
00210 //
00211 // All other necessary preprocessor definitions are synthesized by
00212 // version_fu.h
00213 //
00215
00217 // We need two macros because token expansion occurs when PP_STRINGIZE
00218 // expands x when passing it to PP_PASTE.
00219 #define PP_PASTE(x) #x
00220 #define PP_STRINGIZE(x) PP_PASTE(x)
00221
00222 #define WINCVS_FILEVERSION WINCVS_FILE_MAJOR,WINCVS_FILE_MINOR,WINCVS_FILE_PATCHLEVEL,WINCVS_BUILD
00223 #define CVSNTDOS_FILEVERSION CVSNTDOS_FILE_MAJOR,CVSNTDOS_FILE_MINOR,CVSNTDOS_FILE_PATCHLEVEL,CVSNTDOS_BUILD
00224 #define WINCVS_PRODUCTVERSION WINCVS_PRODUCT_MAJOR,WINCVS_PRODUCT_MINOR,WINCVS_PRODUCT_PATCHLEVEL,WINCVS_BUILD
00225
00226 #if defined(_UNICODE)
00227 #define WCVS_UNICODE_BUILD_STRING_PREFIX "Unicode "
00228 #else
00229 #define WCVS_UNICODE_BUILD_STRING_PREFIX
00230 #endif
00231
00232 #if defined(WCVS_PATCH)
00233 #define WCVS_PATCHED_FLAG VS_FF_PATCHED
00234 #else   // defined(WCVS_PATCH)
00235 #define WCVS_PATCHED_FLAG 0
00236 #endif  // defined(WCVS_PATCH)
00237
00238 #if defined(WINCVS_SPECIAL_BUILD)
00239 #define WCVS_SPECIAL_BUILD_STRING_PREFIX WINCVS_SPECIAL_BUILD " "
00240 #define WCVS_SPECIAL_BUILD_STRING WCVS_SPECIAL_BUILD_STRING_PREFIX "build"
00241 #define WCVS_SPECIAL_BUILD_FLAG VS_FF_SPECIALBUILD
00242 #else   // defined(WINCVS_SPECIAL_BUILD)
00243 #define WCVS_SPECIAL_BUILD_STRING_PREFIX
00244 #define WCVS_SPECIAL_BUILD_STRING
00245 #define WCVS_SPECIAL_BUILD_FLAG 0
00246 #endif  // defined(WINCVS_SPECIAL_BUILD)
00247
00248 #if defined(WINCVS_OFFICIAL_DISTRIBUTION)
00249 #define WCVS_PRIVATE_BUILD_STRING_PREFIX
00250 #define WCVS_PRIVATE_BUILD_STRING
00251 #define WCVS_PRIVATE_BUILD_FLAG 0
00252 #else   // defined(WINCVS_OFFICIAL_DISTRIBUTION)
00253 #   if defined(WINCVS_PRIVATE_BUILD)
00254 #       define WCVS_PRIVATE_BUILD_STRING_PREFIX WINCVS_PRIVATE_BUILD " "
00255 #   else    // defined(WINCVS_PRIVATE_BUILD)
00256 #       define WCVS_PRIVATE_BUILD_STRING_PREFIX "Local "
00257 #   endif   // defined(WINCVS_PRIVATE_BUILD)
00258 #define WCVS_PRIVATE_BUILD_STRING WCVS_PRIVATE_BUILD_STRING_PREFIX "build"
00259 #define WCVS_PRIVATE_BUILD_FLAG VS_FF_PRIVATEBUILD
00260 #endif  // defined(WINCVS_OFFICIAL_DISTRIBUTION)
00261
00262 #if defined(WINCVS_ALPHA_RELEASE)
00263 #   if defined(WINCVS_RELEASE)
00264 #       undef WINCVS_RELEASE
00265 #   endif   // defined(WINCVS_RELEASE)
00266 #   if defined(WINCVS_BETA_RELEASE)
00267 #       undef WINCVS_BETA_RELEASE
00268 #   endif   // defined(WINCVS_BETA_RELEASE)
00269 #elif defined(WINCVS_BETA_RELEASE)      // defined(WINCVS_ALPHA_RELEASE)
00270 #   if defined(WINCVS_RELEASE)
00271 #       undef WINCVS_RELEASE
00272 #   endif   // defined(WINCVS_RELEASE)
00273 #endif  // defined(WINCVS_ALPHA_RELEASE)
00274
00275 #if defined(WINCVS_RELEASE)
00276 #define WCVS_PRERELEASE_BUILD_STRING_PREFIX
00277 #define WCVS_PRERELEASE_FLAG 0
00278 #else   // defined(WINCVS_RELEASE)
00279 #   if defined(WINCVS_ALPHA_RELEASE)
00280 #       define WCVS_PRERELEASE_BUILD_STRING_PREFIX PP_STRINGIZE(Alpha WINCVS_PRODUCT_PATCHLEVEL) " "
00281 #   elif defined(WINCVS_BETA_RELEASE)   // defined(WINCVS_ALPHA_RELEASE)
00282 #       define WCVS_PRERELEASE_BUILD_STRING_PREFIX PP_STRINGIZE(Beta WINCVS_PRODUCT_PATCHLEVEL) " "
00283 #   else    // defined(WINCVS_ALPHA_RELEASE)
00284 #       define WCVS_PRERELEASE_BUILD_STRING_PREFIX "Prerelease "
00285 #   endif   // defined(WINCVS_ALPHA_VERSION) ...
00286 #define WCVS_PRERELEASE_FLAG VS_FF_PRERELEASE
00287 #endif  // defined(WINCVS_RELEASE)
00288
00289 #if defined(_DEBUG)
00290 #define WCVS_DEBUG_FLAG VS_FF_DEBUG
00291 #define WCVS_DEBUG_BUILD_STRING_PREFIX "Debug "
00292 #else   // defined(_DEBUG)
00293 #define WCVS_DEBUG_BUILD_STRING_PREFIX
00294 #define WCVS_DEBUG_FLAG 0
00295 #endif  // defined(_DEBUG)
00296
00297 //
00298 //  Resource Compiler chokes if we break these long lines with line continuation characters '\'
00299 //
00300 #define WINCVS_FILEVERSION_STRING PP_STRINGIZE(WINCVS_FILE_MAJOR.WINCVS_FILE_MINOR.WINCVS_FILE_PATCHLEVEL.WINCVS_BUILD) " " WCVS_PRERELEASE_BUILD_STRING_PREFIX "(" WCVS_PRIVATE_BUILD_STRING_PREFIX WCVS_SPECIAL_BUILD_STRING_PREFIX WCVS_UNICODE_BUILD_STRING_PREFIX WCVS_DEBUG_BUILD_STRING_PREFIX PP_STRINGIZE(Build WINCVS_BUILD) ")"
00301 #define CVSNTDOS_FILEVERSION_STRING PP_STRINGIZE(CVSNTDOS_FILE_MAJOR.CVSNTDOS_FILE_MINOR.CVSNTDOS_FILE_PATCHLEVEL.CVSNTDOS_BUILD) " " WCVS_PRERELEASE_BUILD_STRING_PREFIX "(" WCVS_PRIVATE_BUILD_STRING_PREFIX WCVS_SPECIAL_BUILD_STRING_PREFIX WCVS_UNICODE_BUILD_STRING_PREFIX WCVS_DEBUG_BUILD_STRING_PREFIX PP_STRINGIZE(Build CVSNTDOS_BUILD) ")"
00302
00303 #define WINCVS_PRODUCTVERSION_STRING PP_STRINGIZE(WINCVS_FILE_MAJOR.WINCVS_FILE_MINOR.WINCVS_FILE_PATCHLEVEL.WINCVS_BUILD) " " WCVS_PRERELEASE_BUILD_STRING_PREFIX "(" WCVS_PRIVATE_BUILD_STRING_PREFIX WCVS_SPECIAL_BUILD_STRING_PREFIX WCVS_UNICODE_BUILD_STRING_PREFIX WCVS_DEBUG_BUILD_STRING_PREFIX PP_STRINGIZE(Build WINCVS_BUILD) ")"
Generated on Sun Feb 24 01:21:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/version_no.h Source File

WinCvs/version_no.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jonathan M. Gilligan <jonathan.gilligan@vanderbilt.edu> --- 23 June 2001
00019  */
00020
00021 /*
00022  * version_no.h -- Definitions for version numbering in WinCVS,
00023  *                 detailed documentation is below, see also, version_fu.h
00024  */
00025
00026 #pragma once
00027
00028 // For WinCVS version 1.3 beta 7
00029 #define WINCVS_FILE_MAJOR 1
00030 #define WINCVS_FILE_MINOR 3
00031 #define WINCVS_FILE_PATCHLEVEL 7
00032
00033 #define WINCVS_PRODUCT_MAJOR 1
00034 #define WINCVS_PRODUCT_MINOR 3
00035 #define WINCVS_PRODUCT_PATCHLEVEL 7
00036
00037 #define CVSNTDOS_FILE_MAJOR 1
00038 #define CVSNTDOS_FILE_MINOR 11
00039 #define CVSNTDOS_FILE_PATCHLEVEL 1
00040
00041 // manually increment these when declaring a build.
00042 // Ideally, tag the repository with the build number
00043 // so a build can be reproduced.
00044 #define WINCVS_BUILD 1
00045 #define CVSNTDOS_BUILD 1
00046
00047 //
00048 // Example preprocessor definitions.
00049 //
00050 // #define WINCVS_SPECIAL_BUILD "My special"
00051 // note: no "build" at the end. This is added by
00052 // version-fu.
00053 //
00054 //#define WINCVS_ALPHA_RELEASE
00055 //#define WINCVS_BETA_RELEASE
00056 //
00057
00058 #define WINCVS_BETA_RELEASE
00059 #define WINCVS_PRIVATE_BUILD "Local"
00060 #define WINCVS_OFFICIAL_DISTRIBUTION
00061
00063 // Preprocessor definitions (for version_no.h)
00064 //
00065 // Preprocessor flags (empty #defines):
00066 // These should be #defined in version_no.h
00067 //
00068 // WINCVS_OFFICIAL_DISTRIBUTION:    #define this only when making
00069 //                      an official distribution package. This flag should
00070 //                      never be defined in anything checked into the cvs
00071 //                      repository.
00072 //
00073 // WINCVS_RELEASE:      define this if this is a release (as opposed to a
00074 //                      prerelease) build.
00075 //
00076 // WINCVS_ALPHA_RELEASE:    define this if this is a alpha release. The
00077 //                      alpha number (e.g., alpha 2) will be taken from
00078 //                      the product patch level (see below).
00079 //
00080 // WINCVS_BETA_RELEASE: define this if this is a beta release. The beta
00081 //                      number (e.g., beta 2) will be taken from the
00082 //                      product patch level (see below).
00083 //
00084 // Preprocessor values (#defines with contents):
00085 // These should be #defined in version_no.h
00086 //
00087 // WINCVS_FILE_MAJOR,
00088 // WINCVS_FILE_MINOR,
00089 // WINCVS_FILE_PATCHLEVEL,
00090 //
00091 // CVSNTDOS_FILE_MAJOR,
00092 // CVSNTDOS_FILE_MINOR,
00093 // CVSNTDOS_FILE_PATCHLEVEL,
00094 //
00095 // WINCVS_PRODUCT_MAJOR,
00096 // WINCVS_PRODUCT_MINOR,
00097 // WINCVS_PRODUCT_PATCHLEVEL,
00098 //
00099 // WINCVS_BUILD,
00100 // CVSNTDOS_BUILD:      These macros all indicate parts of the version
00101 //                      number. *FILE* indicates specific numbers for the
00102 //                      .exe files (WinCVS.exe, CVS.exe). The *PRODUCT*
00103 //                      numbers indicate the version of the package as a
00104 //                      whole.
00105 //
00106 //                      At this time, WinCVS.exe is at version 1.3.2.x
00107 //                      (WinCVS 1.3 beta 2, build x), cvs.exe is at
00108 //                      1.11.1.x (cvs 1.11 patch level 1, build x). Both
00109 //                      files are part of the WinCVS 1.3 beta 2
00110 //                      distribution.
00111 //
00112 //                      The build numbers for both files should be
00113 //                      incremented (by hand editing version_no.h) at
00114 //                      least once for every build posted publicly at
00115 //                      cvsgui.org.
00116 //
00117 //                      EXAMPLE:
00118 //
00119 //                      #define WINCVS_FILE_MAJOR           1
00120 //                      #define WINCVS_FILE_MINOR           3
00121 //                      #define WINCVS_FILE_PATCHLEVEL      2
00122 //
00123 //                      #define CVSNTDOS_FILE_MAJOR         1
00124 //                      #define CVSNTDOS_FILE_MINOR        11
00125 //                      #define CVSNTDOS_FILE_PATCHLEVEL    1
00126 //
00127 //                      #define WINCVS_PRODUCT_MAJOR        1
00128 //                      #define WINCVS_PRODUCT_MINOR        3
00129 //                      #define WINCVS_PRODUCT_PATCHLEVEL   2
00130 //
00131 //                      #define WINCVS_BUILD                1
00132 //                      #define CVSNTDOS_BUILD              1
00133 //
00134 //
00135 // WINCVS_SPECIAL_BUILD,
00136 // WINCVS_PRIVATE_BUILD:    These should be #defined to a double-quoted
00137 //                      string that will be used to create a prefix for
00138 //                      the build description string. E.g., the following:
00139 //
00140 //                      #define WINCVS_SPECIAL_BUILD "anomalous"
00141 //                      #define WINCVS_PRIVATE_BUILD "in house"
00142 //
00143 //                      Will produce the text "in house anomalous build"
00144 //                      in the file and product description strings,
00145 //                      "anomalous build" in the Special Build Description
00146 //                      string, and "in house build" in the Private Build
00147 //                      string in the VERSION_INFO resource.
00148 //
00149 // All other necessary preprocessor definitions are synthesized by
00150 // version_fu.h
00151 //
Generated on Sun Feb 24 01:21:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/Win32wstring.hpp Source File

WinCvs/Win32wstring.hpp

Go to the documentation of this file.
00001 // RCS: @(#) $Id: Win32wstring.hpp,v 1.1 2001/01/13 14:42:51 davygrvy Exp $
00002
00003 #include <string>
00004 #include <windows.h>
00005
00006
00007 // Wide (unicode) strings, windows style.
00008 class Win32wstring : public std::wstring
00009 {
00010 public:
00011     Win32wstring(unsigned int codepage, std::string *s)
00012     {
00013         convert(codepage, s->c_str(), s->length());
00014     }
00015
00016     Win32wstring(unsigned int codepage, std::string &s)
00017     {
00018         convert(codepage, s.c_str(), s.length());
00019     }
00020
00021 private:
00022     void convert(unsigned int codepage, const char *s, int inLen)
00023     {
00024         register int outLen;
00025         register wchar_t *buff = NULL;
00026
00027         // I read this in the msdn docs:
00028         // "Windows NT 4.0 and Windows 2000: Translate using UTF-8.
00029         //  When this is set, dwFlags must be zero."
00030         //
00031         // Does this mean UTF-8 conversions don't work on win 95/98 ???
00032         //
00033         DWORD flags = (codepage == CP_UTF8 ? 0 : MB_USEGLYPHCHARS);
00034
00035         // calc size needed
00036         outLen = ::MultiByteToWideChar(codepage, flags, s, inLen, buff, 0);
00037
00038         buff = new wchar_t [outLen];
00039
00040         // do it
00041         ::MultiByteToWideChar(codepage, flags, s, inLen, buff, outLen);
00042
00043         // set the string into our base class.
00044         assign(buff, outLen);
00045
00046         // discard the scratch space.
00047         delete [] buff;
00048     }
00049 };
Generated on Sun Feb 24 01:21:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/wincvs.cpp Source File

WinCvs/wincvs.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 // wincvs.cpp : Defines the class behaviors for the application.
00022 //
00023
00024 #include "stdafx.h"
00025 #include "wincvs.h"
00026
00027 #include "MainFrm.h"
00028 #include "wincvsDoc.h"
00029 #include "GraphDoc.h"
00030 #include "LogFrm.h"
00031 #include "GraphFrm.h"
00032 #include "wincvsView.h"
00033 #include "GraphView.h"
00034 #include "WinCvsBrowser.h"
00035 #include "BrowseFileView.h"
00036 #include "AppGlue.h"
00037 #include "CvsPrefs.h"
00038 #include "AppConsole.h"
00039 #include "Splash.h"
00040 #include "TextBinary.h"
00041 #include "MacrosSetup.h"
00042 #include "MultiString.h"
00043 #include "CvsCommands.h"
00044 #include "Authen.h"
00045 #include "TclGlue.h"
00046 #include "PythonGlue.h"
00047 #include "BrowserBar.h"
00048 #include "FileTraversal.h"
00049 #include "MakeSurePathExists.h"
00050 #include "cvsgui_process.h"
00051
00052 #include "CVSTrace.h"
00053 #include "CVS_Coworker_i.h"
00054 #include "CVS_Coworker_i.c"
00055 #include "CVSCoworker.h"
00056
00057 #ifdef _DEBUG
00058 #define new DEBUG_NEW
00059 #undef THIS_FILE
00060 static char THIS_FILE[] = __FILE__;
00061 #endif
00062
00063 CCVS_CoworkerModule _Module;
00064
00065 BEGIN_OBJECT_MAP(ObjectMap)
00066 OBJECT_ENTRY(CLSID_CvsCoworker, CvsCoworker)
00067 END_OBJECT_MAP()
00068
00069 LONG CCVS_CoworkerModule::Unlock()
00070 {
00071     AfxOleUnlockApp();
00072     return 0;
00073 }
00074
00075 LONG CCVS_CoworkerModule::Lock()
00076 {
00077     AfxOleLockApp();
00078     return 1;
00079 }
00080 LPCTSTR CCVS_CoworkerModule::FindOneOf(LPCTSTR p1, LPCTSTR p2)
00081 {
00082     while (*p1 != NULL)
00083     {
00084         LPCTSTR p = p2;
00085         while (*p != NULL)
00086         {
00087             if (*p1 == *p)
00088                 return CharNext(p1);
00089             p = CharNext(p);
00090         }
00091         p1++;
00092     }
00093     return NULL;
00094 }
00095
00096 // to handle auto-logout
00097 class CLogoutThread : public CWinThread
00098 {
00099 public:
00100     DECLARE_DYNAMIC(CLogoutThread)
00101
00102     CLogoutThread();
00103     virtual ~CLogoutThread();
00104     virtual void Delete();
00105
00106     void KillThread(void) { m_term = true; }
00107         // terminate
00108
00109 // Overrides
00110     // ClassWizard generated virtual function overrides
00111     //{{AFX_VIRTUAL(CLogoutThread)
00112     //}}AFX_VIRTUAL
00113
00114 protected:
00115     bool m_term;
00116
00117     virtual BOOL InitInstance();
00118
00119     // Generated message map functions
00120     //{{AFX_MSG(CLogoutThread)
00121         // NOTE - the ClassWizard will add and remove member functions here.
00122     //}}AFX_MSG
00123
00124     DECLARE_MESSAGE_MAP()
00125 };
00126
00127 CLogoutThread::CLogoutThread() : m_term(false)
00128 {
00129 }
00130
00131 CLogoutThread::~CLogoutThread()
00132 {
00133 }
00134
00135 void CLogoutThread::Delete()
00136 {
00137     CWinThread::Delete();
00138 }
00139
00140 BOOL CLogoutThread::InitInstance()
00141 {
00142     for(;;)
00143     {
00144         Sleep(1000);
00145
00146         if(m_term)
00147             return FALSE;
00148
00149         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00150         if(gAuthen.kind() != pserver || !gCvsPrefs.HasLoogedIn() ||
00151             gCvsPrefs.LogoutTimeOut() <= 0 || app->gCvsRunning)
00152                 continue;
00153
00154         DWORD time = ::GetTickCount();
00155         if(app->GetIdleTime() != 0 &&
00156             (time - app->GetIdleTime()) >= (gCvsPrefs.LogoutTimeOut() * 60 * 1000))
00157         {
00158             app->ResetIdleTime();
00159             cvs_err("Making automatic logout after %d minute(s):\n", gCvsPrefs.LogoutTimeOut());
00160             CvsCmdLogout();
00161         }
00162     }
00163
00164     return FALSE;
00165 }
00166
00167 IMPLEMENT_DYNAMIC(CLogoutThread, CWinThread);
00168
00169 BEGIN_MESSAGE_MAP(CLogoutThread, CWinThread)
00170     //{{AFX_MSG_MAP(CLogoutThread)
00171         // NOTE - the ClassWizard will add and remove mapping macros here.
00172     //}}AFX_MSG_MAP
00173 END_MESSAGE_MAP()
00174
00175 static CLogoutThread *sLogout = 0L;
00176
00178 // CWincvsApp
00179
00180 BEGIN_MESSAGE_MAP(CWincvsApp, CWinApp)
00181     ON_COMMAND(CG_IDS_TIPOFTHEDAY, ShowTipOfTheDay)
00182     //{{AFX_MSG_MAP(CWincvsApp)
00183     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
00184     ON_COMMAND(ID_APP_COPYRIGHTS, OnAppCopyrights)
00185     ON_COMMAND(ID_APP_CREDITS, OnAppCredits)
00186     ON_UPDATE_COMMAND_UI(ID_APP_COPYRIGHTS, OnLogWindowIsPresent)
00187     ON_UPDATE_COMMAND_UI(ID_APP_CREDITS, OnLogWindowIsPresent)
00188     ON_COMMAND(ID_HELP_CVS, OnHelpCvs)
00189     ON_COMMAND(ID_HELP_CVSCLIENT, OnHelpCvsclient)
00190     //}}AFX_MSG_MAP
00191     // Standard file based document commands
00192     ON_COMMAND(ID_FILE_NEW, OnFileNew)
00193     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
00194     // Standard print setup command
00195     ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
00196 END_MESSAGE_MAP()
00197
00199 // CWincvsApp construction
00200
00201 CWincvsApp::CWincvsApp() : m_isBackgroundProcess(false)
00202 {
00203     gCvsRunning = false;
00204     gCvsStopping = false;
00205     gLastCvsResult = 0;
00206     m_idletime = 0;
00207     m_bATLInited = FALSE;
00208     gCvsProcess = 0L;
00209 }
00210
00211 void CWincvsApp::OnLogWindowIsPresent(CCmdUI* pCmdUI)
00212 {
00213     pCmdUI->Enable(GetConsoleView() != 0L);
00214 }
00215
00216 void CWincvsApp::OnFileNew()
00217 {
00218     gLogTempl->OpenDocumentFile(NULL);
00219 }
00220
00222 // The one and only CWincvsApp object
00223
00224 CWincvsApp theApp;
00225
00226 // This identifier was generated to be statistically unique for your app.
00227 // You may change it if you prefer to choose a specific identifier.
00228
00229 // {D2D77DC2-8299-11D1-8949-444553540000}
00230 static const CLSID clsid =
00231 { 0xd2d77dc2, 0x8299, 0x11d1, { 0x89, 0x49, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0 } };
00232
00234 // CWincvsApp initialization
00235
00236 /*
00237  * The handle is of an unknown type.  Test the validity of this OS
00238  * handle by duplicating it, then closing the dupe.  The Win32 API
00239  * doesn't provide an IsValidHandle() function, so we have to emulate
00240  * it here.  This test will not work on a console handle reliably,
00241  * which is why we can't test every handle that comes into this
00242  * function in this way.
00243  */
00244 bool IsValidHandle( HANDLE handle )
00245 {
00246     HANDLE dupedHandle = NULL;
00247
00248     /*
00249      * GetFileType() returns FILE_TYPE_UNKNOWN for invalid handles.
00250      */
00251
00252     if( GetFileType(handle) == FILE_TYPE_UNKNOWN )
00253     {
00254         if( !DuplicateHandle(GetCurrentProcess(),
00255             handle,
00256             GetCurrentProcess(),
00257             &dupedHandle,
00258             0,
00259             FALSE,
00260             DUPLICATE_SAME_ACCESS) )
00261         {
00262             /*
00263             * Unable to make a duplicate. It's definately invalid at this point
00264             */
00265
00266             return false;
00267         }
00268
00269         /*
00270         * Use structured exception handling (Win32 SEH) to protect the close
00271         * of this duped handle which might throw EXCEPTION_INVALID_HANDLE.
00272         */
00273         __try
00274         {
00275             CloseHandle(dupedHandle);
00276         }
00277         __except (EXCEPTION_EXECUTE_HANDLER)
00278         {
00279             /*
00280             * Definately an invalid handle.  So, therefore, the original
00281             * is invalid also.
00282             */
00283
00284             return false;
00285         }
00286     }
00287
00288     return true;
00289 }
00290
00291 BOOL CWincvsApp::InitInstance()
00292 {
00293 #if qCvsDebug
00294     int tmpDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
00295     tmpDbgFlag |= _CRTDBG_LEAK_CHECK_DF;
00296     _CrtSetDbgFlag(tmpDbgFlag);
00297 #endif
00298     CStr lastWorkingDir;
00299
00300     // David Gravereaux <davygrvy@interwoven.com> suggests this might
00301     // be a work around to the bug #42 (I love the bug number,
00302     // really fits the bug description ;-))
00303 #if 0
00304     if (!IsValidHandle(GetStdHandle(STD_OUTPUT_HANDLE)))
00305     {
00306         SetStdHandle(STD_OUTPUT_HANDLE, 0L);
00307     }
00308 #endif
00309
00310     // CG: The following block was added by the Splash Screen component.
00311     {
00312         CCommandLineInfo cmdInfo;
00313         ParseCommandLine(cmdInfo);
00314
00315         CSplashWnd::EnableSplashScreen(
00316             (!(m_nCmdShow & SW_SHOWMINIMIZED)) && cmdInfo.m_bShowSplash);
00317     }
00318
00319     if (!AfxSocketInit())
00320     {
00321         AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
00322         return FALSE;
00323     }
00324
00325     if (!InitATL())
00326         return FALSE;
00327
00328     // Initialize OLE libraries
00329     if (!AfxOleInit())
00330     {
00331         AfxMessageBox(IDP_OLE_INIT_FAILED);
00332         return FALSE;
00333     }
00334
00335     AfxEnableControlContainer();
00336
00337     // Standard initialization
00338     // If you are not using these features and wish to reduce the size
00339     //  of your final executable, you should remove from the following
00340     //  the specific initialization routines you do not need.
00341
00342 #ifdef _AFXDLL
00343     Enable3dControls();         // Call this when using MFC in a shared DLL
00344 #else
00345     Enable3dControlsStatic();   // Call this when linking to MFC statically
00346 #endif
00347
00348     InitializeCriticalSection(&CCvsThreadLock::m_lock);
00349
00350     // Change the registry key under which our settings are stored.
00351     // You should modify this string to be something appropriate
00352     // such as the name of your company or organization.
00353     SetRegistryKey(_T("WinCvs"));
00354
00355     LoadStdProfileSettings(5);  // Load standard INI file options (including MRU)
00356     gCvsPrefs.load();
00357
00358     CStr strVersion;
00359     GetAppVersion(strVersion);
00360     WriteProfileString(_T(""), _T("Current Version"), strVersion);
00361
00362     //
00363     // We need to make a temp local copy of LastWorkingDir property here,
00364     // because CWinCvsBrowser::OnSelchanging event would override
00365     // LastWorkingDir preference when browser window is created.
00366     //
00367     lastWorkingDir = gCvsPrefs.LastWorkingDir();
00368
00369     // Register the application's document templates.  Document templates
00370     //  serve as the connection between documents, frame windows and views.
00371
00372     gLogTempl = new CMultiDocTemplate(
00373         IDR_MAINFRAME,
00374         RUNTIME_CLASS(CWincvsDoc),
00375         RUNTIME_CLASS(CLogFrame),
00376         RUNTIME_CLASS(CBrowseFileView));
00377     AddDocTemplate(gLogTempl);
00378
00379     gLogGraph = new CMultiDocTemplate(
00380         IDR_GRAPH,
00381         RUNTIME_CLASS(CGraphDoc),
00382         RUNTIME_CLASS(CGraphFrame),
00383         RUNTIME_CLASS(CGraphView));
00384     AddDocTemplate(gLogGraph);
00385
00386     /*gLogHtml = new CMultiDocTemplate(
00387         IDR_GRAPH,
00388         RUNTIME_CLASS(CDocument),
00389         RUNTIME_CLASS(CMDIChildWnd),
00390         RUNTIME_CLASS(CGraphView));
00391     AddDocTemplate(gLogGraph);*/
00392
00393     // Connect the COleTemplateServer to the document template.
00394     //  The COleTemplateServer creates new documents on behalf
00395     //  of requesting OLE containers by using information
00396     //  specified in the document template.
00397     m_server.ConnectTemplate(clsid, gLogTempl, TRUE);
00398         // Note: SDI applications register server objects only if /Embedding
00399         //   or /Automation is present on the command line.
00400
00401     // Register all OLE server factories as running.  This enables the
00402     //  OLE libraries to create objects from other applications.
00403     COleTemplateServer::RegisterAll();
00404         // Note: MDI applications register all server objects without regard
00405         //  to the /Embedding or /Automation on the command line.
00406
00407     // create main MDI Frame window
00408     m_mainFrame = new CMainFrame;
00409     if (!m_mainFrame->LoadFrame(IDR_CNTR_INPLACE))
00410         return FALSE;
00411     m_pMainWnd = m_mainFrame;
00412
00413     // Initialize the cool menus...
00414 #if 0
00415     UINT barIds[] = {IDR_BROWSER, IDR_MAINFRAME, IDR_MULTIUSER, IDR_TAGS, IDR_FILELIST, IDR_FILTER};
00416     m_mainFrame->InitializeMenu(gLogTempl,
00417         IDR_MAINFRAME, barIds, _countof(barIds), IDR_MAINFRAME);
00418     m_mainFrame->InitializeMenu(gLogGraph,
00419         IDR_GRAPH, barIds, _countof(barIds), IDR_GRAPH);
00420 #endif
00421
00422     // Parse command line for standard shell commands, DDE, file open
00423     CCommandLineInfo cmdInfo;
00424     ParseCommandLine(cmdInfo);
00425
00426     // Check to see if launched as OLE server
00427     if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated)
00428     {
00429 #if 0
00430         // Register all OLE server (factories) as running.  This enables the
00431         //  OLE libraries to create objects from other applications.
00432         COleTemplateServer::RegisterAll();
00433 #endif
00434
00435         // Application was run with /Embedding or /Automation.  Don't show the
00436         //  main window in this case.
00437         return TRUE;
00438     }
00439
00440     // When a server application is launched stand-alone, it is a good idea
00441     //  to update the system registry in case it has been damaged.
00442     m_server.UpdateRegistry(OAT_DISPATCH_OBJECT);
00443     COleObjectFactory::UpdateRegistryAll();
00444
00445     //JK - try to resolve the long filename if the argument passed is the short filename (like when it's a call thru SendTo shell menu)
00446     if( -1 != cmdInfo.m_strFileName.Find('~') )
00447     {
00448         CString strLongFileName;
00449         CString strTempTileName = cmdInfo.m_strFileName;
00450
00451         SHFILEINFO sFileInfo;
00452         int nSlashPos = -1;
00453
00454         BOOL bError = FALSE;
00455
00456         while( -1 != (nSlashPos = strTempTileName.ReverseFind(kPathDelimiter)) )
00457         {
00458             if( SHGetFileInfo((LPCTSTR)strTempTileName, 0, &sFileInfo, sizeof(sFileInfo), SHGFI_DISPLAYNAME) )
00459             {
00460                 CString strFileNameBit = strTempTileName.Mid(nSlashPos + 1);
00461
00462                 strLongFileName = sFileInfo.szDisplayName + strLongFileName;
00463                 strLongFileName = kPathDelimiter + strLongFileName;
00464                 strTempTileName = strTempTileName.Left(nSlashPos);
00465             }
00466             else
00467             {
00468                 bError = TRUE;
00469                 break;  //we need it or we get the dead loop
00470             }
00471         }//end while
00472
00473         if( !bError )
00474         {
00475             cmdInfo.m_strFileName = strTempTileName + strLongFileName;
00476         }
00477     }
00478
00479     //JK - open in the directory, so remove the file
00480     CString strOpenDirectory;
00481     CString strSelectFile;
00482     if( !cmdInfo.m_strFileName.IsEmpty() )
00483     {
00484         TCHAR fullpath[_MAX_PATH];
00485         _tfullpath(fullpath, cmdInfo.m_strFileName, _MAX_PATH);
00486         if( GetFileAttributes(cmdInfo.m_strFileName) != 0xFFFFFFFF )
00487         {
00488             cmdInfo.m_strFileName.Replace('/', kPathDelimiter); //normalize path
00489             TCHAR drive[_MAX_DRIVE];
00490             TCHAR dir[_MAX_DIR];
00491             _tsplitpath(fullpath, drive, dir, NULL, NULL);
00492             strSelectFile = fullpath;
00493             _tmakepath(fullpath, drive, dir, NULL, NULL);
00494             strOpenDirectory = fullpath;
00495         }
00496     }
00497
00498     // Dispatch commands specified on the command line
00499     //JK - we need to trick the ProcessShellCommand a bit
00500     //because we might get a directory as a parameter we don't want it to check after the file...
00501     cmdInfo.m_nShellCommand = CCommandLineInfo::FileNew;
00502     if (!ProcessShellCommand(cmdInfo))
00503         return FALSE;
00504
00505     // The one and only window has been initialized, so show and update it.
00506     m_mainFrame/*m_pMainWnd*/->InitialShowWindow(m_nCmdShow);
00507     m_mainFrame/*m_pMainWnd*/->UpdateWindow();
00508
00509     m_mainFrame/*m_pMainWnd*/->DragAcceptFiles();
00510     //CWincvsView *cons = GetConsoleView();
00511     //if(cons != 0L)
00512     //  cons->DragAcceptFiles();
00513
00514
00515     CWinCvsBrowser *browser = GetBrowserView();
00516     CWincvsDoc *doc = (CWincvsDoc *)GetDocument();
00517     if(doc != 0L && browser != 0L)
00518         doc->SetTitle(browser->GetRoot());
00519     CBrowseFileView *fileView = GetFileView();
00520     if(fileView != 0L)
00521     {
00522         if( strOpenDirectory.IsEmpty() )
00523         {
00524             // Goto the last working directory, which was selected
00525             // when WinCVS was closed
00526             if( !lastWorkingDir.empty() && browser->StepToLocation(lastWorkingDir) )
00527             {
00528                 fileView->ResetView(lastWorkingDir, false, (LPCTSTR) 0L);
00529                 gCvsPrefs.SetLastWorkingDir(lastWorkingDir);
00530             }
00531             else
00532                 fileView->ResetView(browser->GetRoot());
00533         }
00534         else
00535         {
00536             CColorConsole out;
00537             out << kBold << "Locating: " << kNormal << kUnderline << cmdInfo.m_strFileName << kNormal <<  kNormal << kNL;
00538
00539             //search the browse location (will create a new location if not found)
00540             extern CMString gHistoryLocs;
00541             CString bestRoot = CHistComboBoxEx::FindBestRoot(gHistoryLocs, strOpenDirectory);
00542             if( !bestRoot.IsEmpty() )
00543             {
00544                 browser->ResetBrowser((LPCTSTR)bestRoot);
00545             }
00546
00547             if( browser->StepToLocation((LPCTSTR)strOpenDirectory) )
00548             {
00549                 fileView->ResetView( (LPCTSTR)strOpenDirectory, false, (LPCTSTR)strSelectFile );
00550             }
00551             else
00552             {
00553                 fileView->ResetView( browser->GetRoot() );
00554             }
00555         }
00556     }
00557
00558     //MacrosReloadAll();
00559     PyMacrosReloadAll();
00560
00561     //JK - if you launch WinCvs with the file or directory as a parameter you obviously don't need a "tip of the day" because you're in a hurry
00562     if( strOpenDirectory.IsEmpty() )
00563     {
00564         // CG: This line inserted by 'Tip of the Day' component.
00565         ShowTipAtStartup();
00566     }
00567
00568     // auto-logout thread
00569     sLogout = new CLogoutThread();
00570     if (sLogout == 0L)
00571     {
00572         cvs_err("Impossible to create the auto-logout thread !\n");
00573     }
00574     else
00575     {
00576         ASSERT_VALID(sLogout);
00577
00578         // Create Thread in a suspended state so we can set the Priority
00579         // before it starts getting away from us
00580         if (!sLogout->CreateThread(CREATE_SUSPENDED))
00581         {
00582             cvs_err("Impossible to start the auto-logout thread (error %d)!\n", GetLastError());
00583             delete sLogout;
00584             sLogout = 0L;
00585         }
00586
00587         if(sLogout != 0L)
00588         {
00589             // If you want to make the sample more sprightly, set the thread priority here
00590             // a little higher. It has been set at idle priority to keep from bogging down
00591             // other apps that may also be running.
00592             VERIFY(sLogout->SetThreadPriority(THREAD_PRIORITY_NORMAL));
00593             // Now the thread can run wild
00594             sLogout->ResumeThread();
00595         }
00596     }
00597
00598     // load preferences. If CVSROOT is not defined
00599     // then prompt first preferences dialog.
00600     if(gCvsPrefs.empty())
00601         SendMessage(*m_mainFrame, WM_COMMAND, ID_APP_PREFERENCES, 0L);
00602         //doc->OnAppPreferences();
00603     else
00604         cvs_out("CVSROOT: %s (%s)\n", (const char *)gCvsPrefs, gAuthen.kindstr());
00605
00606     bool hasTCL = CTcl_Interp::IsAvail();
00607     bool hasPY = CPython_Interp::IsAvail();
00608
00609     if(gCvsPrefs.GetUseShell() == SHELL_PYTHON && !hasPY && hasTCL)
00610     {
00611         gCvsPrefs.SetUseShell(SHELL_TCL);
00612     }
00613     else if(gCvsPrefs.GetUseShell() == SHELL_TCL && hasPY && !hasTCL)
00614     {
00615         gCvsPrefs.SetUseShell(SHELL_PYTHON);
00616     }
00617
00618     if(gCvsPrefs.GetUseShell() == SHELL_TCL)
00619     {
00620         cvs_out("TCL is available, shell is enabled : help (select and press enter)\n");
00621     }
00622
00623     if(!hasTCL && !hasPY)
00624     {
00625         cvs_err("TCL or Python are *not* available, shell is disabled\n");
00626     }
00627
00628     //make sure the current directory is properly setup
00629     if( 0L != fileView )
00630     {
00631         chdir( fileView->GetPath() );
00632     }
00633
00634     return TRUE;
00635 }
00636
00638 // CAboutDlg dialog used for App About
00639
00640 class CAboutDlg : public CDialog
00641 {
00642 public:
00643     CAboutDlg();
00644
00645 // Dialog Data
00646     //{{AFX_DATA(CAboutDlg)
00647     enum { IDD = IDD_ABOUTBOX };
00648     CString m_vers;
00649     CCJHyperLink m_url;
00650     //}}AFX_DATA
00651
00652     // ClassWizard generated virtual function overrides
00653     //{{AFX_VIRTUAL(CAboutDlg)
00654     protected:
00655     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00656     //}}AFX_VIRTUAL
00657
00658 // Implementation
00659 protected:
00660     //{{AFX_MSG(CAboutDlg)
00661     virtual BOOL OnInitDialog();
00662     //}}AFX_MSG
00663     DECLARE_MESSAGE_MAP()
00664 };
00665
00666 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
00667 {
00668     //{{AFX_DATA_INIT(CAboutDlg)
00669     m_vers = _T("WinCvs ");
00670     //}}AFX_DATA_INIT
00671
00672     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00673     CStr vers;
00674
00675     if(app->GetAppVersion(vers))
00676     {
00677         m_vers = vers;
00678     }
00679 }
00680
00681 BOOL CAboutDlg::OnInitDialog()
00682 {
00683     CDialog::OnInitDialog();
00684
00685     m_url.SetURL(_T("http://www.cvsgui.org"));
00686
00687     return TRUE;  // return TRUE unless you set the focus to a control
00688                   // EXCEPTION: OCX Property Pages should return FALSE
00689 }
00690
00691 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
00692 {
00693     CDialog::DoDataExchange(pDX);
00694     //{{AFX_DATA_MAP(CAboutDlg)
00695     DDX_Control(pDX, IDC_WINCVSURL, m_url);
00696     DDX_Text(pDX, IDC_WINCVSVER, m_vers);
00697     //}}AFX_DATA_MAP
00698 }
00699
00700 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
00701     //{{AFX_MSG_MAP(CAboutDlg)
00702     //}}AFX_MSG_MAP
00703 END_MESSAGE_MAP()
00704
00705 // App command to run the dialog
00706 void CWincvsApp::OnAppAbout()
00707 {
00708     CAboutDlg aboutDlg;
00709     aboutDlg.DoModal();
00710 }
00711
00712 CWincvsView *CWincvsApp::GetConsoleView(void)
00713 {
00714     if(m_mainFrame == 0L)
00715         return 0L;
00716
00717     return m_mainFrame->GetConsoleView();
00718 }
00719
00720 CStatusBar *CWincvsApp::GetStatusBar()
00721 {
00722     if(m_mainFrame == 0L)
00723         return 0L;
00724
00725     return m_mainFrame->GetStatusBar();
00726 }
00727
00728 CWinCvsBrowser *CWincvsApp::GetBrowserView(void)
00729 {
00730     if(m_mainFrame == 0L)
00731         return 0L;
00732
00733     return m_mainFrame->GetBrowserView();
00734 }
00735
00736 CString CWincvsApp::GetRoot()
00737 {
00738     CString root;
00739     CWinCvsBrowser* view = GetBrowserView();
00740     if (view)
00741     {
00742         root = view->GetRoot();
00743     }
00744     return root;
00745 }
00746
00747 void CWincvsApp::ActivateBrowserView(void)
00748 {
00749     if(m_mainFrame == 0L)
00750         return;
00751
00752     m_mainFrame->GetWorkspace()->SetActiveView(RUNTIME_CLASS(CBrowserBar));
00753 }
00754
00755 CCJShellTree *CWincvsApp::GetExplorerView(void)
00756 {
00757     if(m_mainFrame == 0L)
00758         return 0L;
00759
00760     return m_mainFrame->GetExplorerView();
00761 }
00762
00763 CBrowseFileView *CWincvsApp::GetFileView(void)
00764 {
00765     POSITION post = GetFirstDocTemplatePosition();
00766     CDocTemplate* tmpl;
00767     while(post != NULL)
00768     {
00769         tmpl = GetNextDocTemplate(post);
00770         if(!tmpl->IsKindOf(RUNTIME_CLASS(CMultiDocTemplate)))
00771             continue;
00772         POSITION posd = tmpl->GetFirstDocPosition();
00773         CDocument* doc;
00774         while(posd != NULL)
00775         {
00776             doc = tmpl->GetNextDoc(posd);
00777             if(!doc->IsKindOf(RUNTIME_CLASS(CWincvsDoc)))
00778                 continue;
00779             POSITION posv = doc->GetFirstViewPosition();
00780             CView* view;
00781             while(posv != NULL)
00782             {
00783                 view = doc->GetNextView(posv);
00784                 if(view->IsKindOf(RUNTIME_CLASS(CBrowseFileView)))
00785                     return (CBrowseFileView *)view;
00786             }
00787         }
00788     }
00789     return NULL;
00790 }
00791
00792 CDocument *CWincvsApp::GetDocument(void)
00793 {
00794     CWinApp *app = AfxGetApp();
00795     POSITION post = app->GetFirstDocTemplatePosition();
00796     CDocTemplate* tmpl;
00797     while(post != NULL)
00798     {
00799         tmpl = app->GetNextDocTemplate(post);
00800         POSITION posd = tmpl->GetFirstDocPosition();
00801         CDocument* doc;
00802         while(posd != NULL)
00803         {
00804             doc = tmpl->GetNextDoc(posd);
00805             if(!doc->IsKindOf(RUNTIME_CLASS(CWincvsDoc)))
00806                 continue;
00807             return doc;
00808         }
00809     }
00810     ASSERT(0);
00811     return 0L;
00812 }
00813
00815 // CWincvsApp commands
00816
00820 bool TrimRight( char* szValue, bool bTest = false )
00821 {
00822     bool bRes = false;
00823
00824     char* pszPos = szValue;
00825     char* pszLastSpacePos = NULL;
00826
00827     //locate last white space
00828     while( *pszPos != '\0' )
00829     {
00830         if( isspace(*pszPos) )
00831         {
00832             if( pszLastSpacePos == NULL )
00833             {
00834                 pszLastSpacePos = pszPos;
00835             }
00836         }
00837         else
00838         {
00839             pszLastSpacePos = NULL;
00840         }
00841
00842         pszPos++;
00843     }
00844
00845     //and cut it off
00846     if( pszLastSpacePos )
00847     {
00848         if( !bTest )
00849         {
00850             *pszLastSpacePos = '\0';
00851         }
00852         bRes = true;
00853     }
00854
00855     return bRes;
00856 }
00857
00859 void AFXAPI DDV_CheckPathExists(CDataExchange* pDX, int nIDC, CString& value, bool promptForCreation /*= true*/)
00860 {
00861     if( pDX->m_bSaveAndValidate )
00862     {
00863         if( !CompatMakeSurePathExists(value, false) )
00864         {
00865             if( CStr(value).endsWith(kPathDelimiter) )
00866             {
00867                 value.TrimRight(kPathDelimiter);
00868             }
00869
00870             if( !CompatMakeSurePathExists(value, promptForCreation) )
00871             {
00872                 AfxMessageBox("Cannot find folder: " + value);
00873                 pDX->PrepareEditCtrl(nIDC);
00874                 pDX->Fail();
00875             }
00876         }
00877     }
00878 }
00879
00881 void AFXAPI DDV_CheckCVSROOT(CDataExchange* pDX, CString& value)
00882 {
00883     //check after the trailing white spaces - often an unwanted result of copy-paste
00884     if( pDX->m_bSaveAndValidate &&
00885         TrimRight(value.GetBuffer(value.GetLength()+1), true) )
00886     {
00887         value.ReleaseBuffer();
00888
00889         if( AfxMessageBox("The CVSROOT value contains the trailing spaces. Do you want to trim them?", MB_ICONQUESTION | MB_YESNO) == IDYES )
00890         {
00891             TrimRight(value.GetBuffer(value.GetLength()+1));
00892             value.ReleaseBuffer();
00893         }
00894     }
00895 }
00896
00898 void AFXAPI DDX_ComboMString(CDataExchange* pDX, int nIDC, CSmartComboBox& combo)
00899 {
00900     CMString* mstr = combo.GetItems();
00901     ASSERT(mstr != NULL);
00902
00903     if( mstr )
00904     {
00905         if( !pDX || !pDX->m_bSaveAndValidate )
00906         {
00907             CString strOldText;
00908             combo.GetWindowText(strOldText);
00909
00910             combo.ResetContent();
00911
00912             const vector<CStr> & list = mstr->GetList();
00913             vector<CStr>::const_iterator i;
00914             for(i = list.begin(); i != list.end(); ++i)
00915             {
00916                 combo.AddString(*i);
00917             }
00918
00919             combo.SetWindowText(strOldText);
00920         }
00921         else
00922         {
00923             CString value;
00924             DDX_CBString(pDX, nIDC, value);
00925             if( !value.IsEmpty() )
00926             {
00927                 mstr->Insert(value);
00928             }
00929         }
00930     }
00931 }
00932
00934 void AFXAPI DDV_MinChars(CDataExchange* pDX, CString const& value, int nChars)
00935 {
00936     ASSERT(nChars > 0);        // allow them something
00937     if (pDX->m_bSaveAndValidate && value.GetLength() < nChars)
00938     {
00939         TCHAR szT[255];
00940         wsprintf(szT, _T("Please enter more than %d character"), nChars);
00941         CString prompt;
00942         AfxMessageBox(szT, MB_ICONEXCLAMATION, AFX_IDP_PARSE_STRING_SIZE);
00943         prompt.Empty(); // exception prep
00944         pDX->Fail();
00945     }
00946 }
00947
00948 int CWincvsApp::ExitInstance()
00949 {
00950     // Save existing preferences. This will save, for example,
00951     // the current working directory as "LastWorkingDir" property.
00952     gCvsPrefs.save();
00953
00954     DeleteCriticalSection(&CCvsThreadLock::m_lock);
00955
00956     if (m_bATLInited)
00957     {
00958         LogCleanup();
00959         _Module.RevokeClassObjects();
00960         _Module.Term();
00961         CoUninitialize();
00962     }
00963
00964     return CWinApp::ExitInstance();
00965 }
00966
00967 void CWincvsApp::OnAppCopyrights()
00968 {
00969     cvs_out("\nBoth WinCVS and CVS are distributed under the terms of\n");
00970     cvs_out("the GNU General Public Licence (GPL).\n\n");
00971     cvs_out("* MacCVS/WinCvs : maintained by Alexandre Parenteau (aubonbeurre@hotmail.com)\n");
00972     cvs_out("* WinCvs documentation : Copyright © 1999 Don Harper <don@lamrc.com>.\n");
00973     cvs_out("* CVS : Copyright © 1989-1998 Brian Berliner, david d `zoo' zuhn,\n");
00974     cvs_out("        Jeff Polk, and other authors\n");
00975     cvs_out("* CJLIB : Copyright © 1998-99 Kirk Stowell <kstowell@codejockeys.com>\n");
00976     cvs_out("* Kerberos : Copyright © 1997 the Massachusetts Institute of Technology\n");
00977     cvs_out("* TCL : Copyright © Sun Microsystems Inc.\n");
00978     cvs_out("* Python : Copyright © Guido van Rossum\n");
00979     cvs_out("* MFC : Copyright © 1992-1997 Microsoft Corporation\n");
00980     cvs_out("\nSome others copyrights may apply, check the source code for details.\n");
00981 }
00982
00983 void CWincvsApp::OnAppCredits()
00984 {
00985     CStr vers;
00986
00987     if(GetAppVersion(vers))
00988         cvs_out("\n%s - Client/Local\n", (const char *)vers);
00989     else
00990         cvs_out("\nWinCvs 1.2 - Client/Local/\n");
00991     cvs_out("- WinCvs is developed by (alphabetically):\n");
00992     cvs_out("\t* V.Antonevich <v_antonevich@hotmail.com>\n");
00993     cvs_out("\t* Jerzy Kaczorowski  <kaczoroj@hotmail.com>\n");
00994     cvs_out("\t* Alexandre Parenteau <aubonbeurre@hotmail.com>\n");
00995     cvs_out("\t* Others contributors (see the ChangeLog)\n");
00996     cvs_out("- WinCvs page : http://www.cvsgui.org\n");
00997     cvs_out("- cvs page : http://www.cvshome.org\n");
00998     cvs_out("- WinCvs documentation : Don Harper <don@lamrc.com>.\n");
00999     cvs_out("- WinHelp cvs documentation : Norbert Klamann.\n");
01000     cvs_out("- Special thanks to :\n");
01001     cvs_out("\t* The Strata Inc. developpers who are so patients with WinCvs\n");
01002     cvs_out("\t  and help to identify a lot of problems.\n");
01003     cvs_out("\t* All the people who are submitting bugs, patches and\n");
01004     cvs_out("\t  answer the cvsgui mailing list.\n");
01005     cvs_out("- Bug reports, suggestions :\n");
01006     cvs_out("\t* Richard Wesley, Alain Aslag Roy, Eric Aubourg and many others\n");
01007     cvs_out("- Cvs contributors :\n");
01008     cvs_out("\t* Too many to be listed here, see the 'ChangeLog' instead !\n");
01009 }
01010
01011 void CWincvsApp::ShowTipAtStartup(void)
01012 {
01013     // CG: This function added by 'Tip of the Day' component.
01014
01015     CCommandLineInfo cmdInfo;
01016     ParseCommandLine(cmdInfo);
01017     if (cmdInfo.m_bShowSplash)
01018     {
01019         CTipDlg dlg( IsWindow(m_pMainWnd->GetSafeHwnd()) ? m_pMainWnd : NULL );
01020         if (dlg.m_bStartup)
01021             dlg.DoModal();
01022     }
01023
01024 }
01025
01026 void CWincvsApp::ShowTipOfTheDay(void)
01027 {
01028     // CG: This function added by 'Tip of the Day' component.
01029
01030     CTipDlg dlg;
01031     dlg.DoModal();
01032
01033 }
01034
01035 BOOL CWincvsApp::PreTranslateMessage(MSG* pMsg)
01036 {
01037     // CG: The following lines were added by the Splash Screen component.
01038     if (CSplashWnd::PreTranslateAppMessage(pMsg))
01039         return TRUE;
01040
01041     DWORD time = ::GetTickCount();
01042     if (m_idletime == 0 ||
01043         pMsg->message == WM_KEYDOWN ||
01044         pMsg->message == WM_SYSKEYDOWN ||
01045         pMsg->message == WM_LBUTTONDOWN ||
01046         pMsg->message == WM_RBUTTONDOWN ||
01047         pMsg->message == WM_MBUTTONDOWN ||
01048         pMsg->message == WM_NCLBUTTONDOWN ||
01049         pMsg->message == WM_NCRBUTTONDOWN ||
01050         pMsg->message == WM_NCMBUTTONDOWN)
01051     {
01052         m_idletime = time;
01053         PyInvalUICache();
01054     }
01055
01056     IdleCvsProgress();
01057
01058     return CWinApp::PreTranslateMessage(pMsg);
01059 }
01060
01061 void CWincvsApp::GetAppPath(CStr & path) const
01062 {
01063     path = "";
01064     HINSTANCE hInst = ::AfxGetInstanceHandle();
01065     if(hInst != 0L)
01066     {
01067         char apath[512];
01068         DWORD len = ::GetModuleFileName(hInst, apath, 512);
01069         CStr uppath;
01070         CStr exefile;
01071         if(len > 0 && ::SplitPath(apath, uppath, exefile))
01072         {
01073             path = uppath;
01074         }
01075     }
01076 }
01077
01078 void CWincvsApp::GetAppModule(CStr & module) const
01079 {
01080     module = "";
01081     HINSTANCE hInst = ::AfxGetInstanceHandle();
01082     if(hInst != 0L)
01083     {
01084         char apath[512];
01085         DWORD len = ::GetModuleFileName(hInst, apath, 512);
01086         if(len > 0)
01087         {
01088             module = apath;
01089         }
01090     }
01091 }
01092
01093 void CWincvsApp::LookForResourceFile(const char *what, CStr & path)
01094 {
01095     path = "";
01096     GetAppPath(path);
01097
01098     CString appPath = path;
01099     // first the macro folder may be ./macro
01100     CString test = appPath;
01101     test.TrimRight('\\');
01102     test += "\\";
01103     test += what;
01104
01105     struct stat sb;
01106     if(stat(test, &sb) != -1 && S_ISREG(sb.st_mode))
01107     {
01108         path = test;
01109         return;
01110     }
01111
01112     CStr uppath, file;
01113     while(SplitPath(appPath, uppath, file) && !uppath.empty())
01114     {
01115         test = uppath;
01116         test.TrimRight('\\');
01117         test += "\\";
01118         test += what;
01119
01120         if(stat(test, &sb) != -1 && S_ISREG(sb.st_mode))
01121         {
01122             path = test;
01123             return;
01124         }
01125         appPath = uppath;
01126     }
01127     path = test;
01128 }
01129
01130
01131 void CWincvsApp::OnHelpCvs()
01132 {
01133     CStr hlp;
01134     LookForResourceFile("cvs.hlp", hlp);
01135     ::WinHelp(*AfxGetMainWnd(), hlp, HELP_CONTENTS, 0L);
01136 }
01137
01138 void CWincvsApp::OnHelpCvsclient()
01139 {
01140     CStr hlp;
01141     LookForResourceFile("cvscli.hlp", hlp);
01142     ::WinHelp(*AfxGetMainWnd(), hlp, HELP_CONTENTS, 0L);
01143 }
01144
01145 bool CWincvsApp::GetAppVersion(CStr & vers) const
01146 {
01147     bool bRet=false;
01148     char  szFullPath[_MAX_PATH];
01149     DWORD len = ::GetModuleFileName(AfxGetInstanceHandle(), szFullPath, sizeof(szFullPath));
01150     DWORD dwVerHnd;
01151     DWORD dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd);
01152     if (dwVerInfoSize && len)
01153     {
01154         // If we were able to get the information, process it:
01155         HANDLE  hMem;
01156         LPVOID  lpvMem;
01157         char    szGetName[256];
01158         int     cchRoot;
01159
01160         hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize);
01161         lpvMem = GlobalLock(hMem);
01162         GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize, lpvMem);
01163         lstrcpy(szGetName, "\\StringFileInfo\\040904b0\\");
01164         cchRoot = lstrlen(szGetName);
01165
01166         BOOL  fRet;
01167         UINT  cchVer = 0;
01168         LPVOID lszVer = NULL;
01169
01170         lstrcpy(&szGetName[cchRoot], "ProductVersion");
01171         fRet = VerQueryValue(lpvMem, szGetName, &lszVer, &cchVer);
01172
01173         if (fRet && cchVer && lszVer)
01174         {
01175             vers = (char *)lszVer;
01176             bRet = true;
01177         }
01178         GlobalUnlock(hMem);
01179         GlobalFree(hMem);
01180     }
01181     return bRet;
01182 }
01183
01184 BOOL CWincvsApp::SaveAllModified()
01185 {
01186     // prevent from exiting when cvs is running
01187     if(gCvsRunning)
01188     {
01189         gCvsStopping = true;
01190         return TRUE;
01191     }
01192
01193     if(sLogout != 0L)
01194     {
01195         HANDLE hdl = sLogout->m_hThread;
01196         sLogout->KillThread();
01197         WaitForSingleObject(hdl, INFINITE);
01198         //delete sLogout;
01199         sLogout = 0L;
01200     }
01201
01202     // auto-logout
01203     if(gAuthen.kind() == pserver && gCvsPrefs.HasLoogedIn() &&
01204         gCvsPrefs.LogoutTimeOut() > 0)
01205     {
01206         cvs_err("Making automatic logout before quitting:\n");
01207         CvsCmdLogout();
01208         WaitForCvs();
01209     }
01210
01211     return CWinApp::SaveAllModified();
01212 }
01213
01214 char *CWincvsApp::GetEnvMainThread(const char *name)
01215 {
01216     return m_mainFrame->GetEnvMainThread(name);
01217 }
01218
01219 void CWincvsApp::IdleCvsProgress(void)
01220 {
01221     static bool bWasCvsRunning = false; //to restore the idle message once CVS has stoped
01222
01223     if(!gCvsRunning)
01224     {
01225         if( bWasCvsRunning )
01226         {
01227             bWasCvsRunning = false;
01228
01229             CString strIdleString;
01230             strIdleString.LoadString(AFX_IDS_IDLEMESSAGE);
01231
01232             CStatusBar *bar = GetStatusBar();
01233             if(bar != 0L)
01234                 bar->SetWindowText(strIdleString);
01235         }
01236         return;
01237     }
01238
01239     if(gCvsProcess != 0L)
01240     {
01241         if(!cvs_process_is_active(gCvsProcess))
01242         {
01243             gCvsRunning = false;
01244             gCvsStopping = false;
01245             gCvsProcess = 0L;
01246             GetFileView()->CheckChanges();
01247         }
01248     }
01249
01250     bWasCvsRunning = true;
01251
01252     DWORD whatTimeIsIt = ::GetTickCount();
01253     static DWORD lastTime = 0;
01254     // let's make some stuff every second while cvs is idling
01255     if((whatTimeIsIt - lastTime) < 1000)
01256         return;
01257
01258     lastTime = whatTimeIsIt;
01259     char path[_MAX_PATH];
01260     getcwd(path, _MAX_PATH);
01261     CStatusBar *bar = GetStatusBar();
01262     if(bar != 0L)
01263         bar->SetWindowText(path);
01264 }
01265
01266 static inline bool MatchToken(LPCTSTR sLine,LPCTSTR sToken)
01267 {
01268     int n = _tcslen(sToken);
01269     if (0 != _tcsnicmp(sLine,sToken,n)) {
01270         return false;
01271     }
01272     LPCTSTR p = sLine + n;
01273     return ((!*p) || (0 != _tcschr(_T(" \t"),*p)));
01274 }
01275
01276 #ifdef _DEBUG
01277 static inline void DEBUG_MESSAGE(LPCTSTR sMessage)
01278 {
01279     if (::getenv("NOCVSDEBUG")) return;
01280     TCHAR s[256];
01281     ::wsprintf(s,_T("\n[PID %u THREAD %u] CVS_Coworker %s\n"),
01282         (unsigned) GetCurrentProcessId(),
01283         (unsigned) GetCurrentThreadId(),
01284         sMessage
01285         );
01286     ::MessageBox(0,s,_T("DEBUG"),MB_OK);
01287 }
01288 #else
01289 #define DEBUG_MESSAGE(S) 0
01290 #endif
01291
01292 BOOL CWincvsApp::InitATL()
01293 {
01294     m_bATLInited = TRUE;
01295
01296 #if _WIN32_WINNT >= 0x0400
01297     HRESULT hRes = CoInitializeEx(NULL, COINIT_MULTITHREADED);
01298 #else
01299     HRESULT hRes = CoInitialize(NULL);
01300 #endif
01301
01302     if (FAILED(hRes))
01303     {
01304         m_bATLInited = FALSE;
01305         return FALSE;
01306     }
01307
01308     _Module.Init(ObjectMap, AfxGetInstanceHandle());
01309     _Module.dwThreadID = GetCurrentThreadId();
01310
01311     LPTSTR lpCmdLine = GetCommandLine(); //this line necessary for _ATL_MIN_CRT
01312     TCHAR szTokens[] = _T("-/");
01313
01314     BOOL bRun = TRUE;
01315     LPCTSTR lpszToken = _Module.FindOneOf(lpCmdLine, szTokens);
01316     while (lpszToken != NULL)
01317     {
01318         if (MatchToken(lpszToken,_T("UnregServer"))) {
01319             _Module.UpdateRegistryFromResource(IDR_CVS_COWORKER, FALSE);
01320             _Module.UnregisterServer(TRUE); //TRUE means typelib is unreg'd
01321             bRun = FALSE;
01322             DEBUG_MESSAGE(_T("Now UNREGISTERED"));
01323             break;
01324         }
01325         if (MatchToken(lpszToken,_T("RegServer"))) {
01326             //RegisterLogging();  // specific to CVS_Coworker
01327             _Module.UpdateRegistryFromResource(IDR_CVS_COWORKER, TRUE);
01328             _Module.RegisterServer(TRUE);
01329             bRun = FALSE;
01330             DEBUG_MESSAGE(_T("REGISTERED"));
01331             break;
01332         }
01333         lpszToken = _Module.FindOneOf(lpszToken, szTokens);
01334     }
01335
01336     if (!bRun)
01337     {
01338         m_bATLInited = FALSE;
01339         _Module.Term();
01340         CoUninitialize();
01341         return FALSE;
01342     }
01343
01344     //StartLogging();         // specific to CVS_Coworker
01345     hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER,REGCLS_MULTIPLEUSE);
01346     if (FAILED(hRes))
01347     {
01348         m_bATLInited = FALSE;
01349         CoUninitialize();
01350         return FALSE;
01351     }
01352
01353     return TRUE;
01354 }
01355
01356 // retrieve filtering model to use
01357 KiFilterModel* CWincvsApp::GetFilterModel() const
01358 {
01359     return m_mainFrame->GetFilterModel();
01360 }
01361
01362 // retrieve recursion model to use
01363 KiRecursionModel* CWincvsApp::GetRecursionModel() const
01364 {
01365     return m_mainFrame->GetRecursionModel();
01366 }
01367
01368 KiIgnoreModel* CWincvsApp::GetIgnoreModel() const
01369 {
01370     return m_mainFrame->GetIgnoreModel();
01371 }
01372
01373 void CWincvsApp::UpdateAllDocsView()
01374 {
01375     POSITION pos = GetFirstDocTemplatePosition();
01376     while( pos )
01377     {
01378         CDocTemplate* pTemplate = GetNextDocTemplate(pos);
01379         POSITION pos2 = pTemplate->GetFirstDocPosition();
01380         while(pos2)
01381         {
01382             CDocument* pDocument;
01383             if(pDocument = pTemplate->GetNextDoc(pos2))
01384             {
01385                 pDocument->UpdateAllViews(NULL);
01386             }
01387         }
01388     }
01389 }
01390
01391 void CWincvsApp::PeekPumpAndIdle(void)
01392 {
01393     MSG Msg;
01394     while( ::PeekMessage(&Msg, NULL, 0, 0, PM_NOREMOVE) )
01395     {
01396         PumpMessage();
01397     }
01398
01399     LONG lIdle = 0;
01400     while( OnIdle(lIdle++) )
01401         ;
01402 }
Generated on Sun Feb 24 01:21:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/wincvs.h Source File

WinCvs/wincvs.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 // wincvs.h : main header file for the WINCVS application
00022 //
00023
00024 #if !defined(AFX_WINCVS_H__D2D77DC7_8299_11D1_8949_444553540000__INCLUDED_)
00025 #define AFX_WINCVS_H__D2D77DC7_8299_11D1_8949_444553540000__INCLUDED_
00026
00027 #if _MSC_VER >= 1000
00028 #pragma once
00029 #endif // _MSC_VER >= 1000
00030
00031 #ifndef __AFXWIN_H__
00032     #error include 'stdafx.h' before including this file for PCH
00033 #endif
00034
00035 #include "resource.h"       // main symbols
00036 #include "MultiString.h"
00037 #include "SmartComboBox.h"
00038
00040 // CWincvsApp:
00041 // See wincvs.cpp for the implementation of this class
00042 //
00043
00044 class CWincvsView;
00045 class CWinCvsBrowser;
00046 class CBrowseFileView;
00047 class CStr;
00048 class CMainFrame;
00049 class CStatusBar;
00050 class KiFilterModel;
00051 class KiRecursionModel;
00052 class KiIgnoreModel;
00053
00054 class CWincvsApp : public CWinApp
00055 {
00056 public:
00057     CWincvsApp();
00058
00059     CWincvsView *GetConsoleView(void);
00060         // get the top console
00061
00062     CWinCvsBrowser *GetBrowserView(void);
00063     void ActivateBrowserView(void);
00064         // get the left directory browser
00065
00066     CCJShellTree *GetExplorerView(void);
00067         // get the left directory explorer
00068
00069     CBrowseFileView *GetFileView(void);
00070         // get the right files browser
00071
00072     CDocument *GetDocument(void);
00073         // get the document
00074
00075     CStatusBar *GetStatusBar();
00076         // get the mainframe status bar
00077
00078     CString GetRoot();
00079         // returns currently selected root
00080
00081     inline CMainFrame *GetMainFrame(void) { return m_mainFrame; }
00082         // get the document
00083
00084     void PeekPumpAndIdle(void);
00085         // peek and pump application messages and perform the idle processsing
00086
00087     bool gCvsRunning;
00088         // the dll is running
00089
00090     bool gCvsStopping;
00091         // the dll is about to stop
00092
00093     int gLastCvsResult;
00094         // last know exit() return value of cvs
00095
00096     CMultiDocTemplate* gLogTempl;
00097     CMultiDocTemplate* gLogGraph;
00098     CMultiDocTemplate* gLogHtml;
00099
00100     void UpdateAllDocsView();
00101         // call UpdateAllViews for all documents
00102
00103     struct _CvsProcess *gCvsProcess;
00104         // the current cvs process
00105
00106     void GetAppPath(CStr & path) const;
00107         // return the application path
00108
00109     void GetAppModule(CStr & module) const;
00110         // return the application module
00111
00112     bool GetAppVersion(CStr & vers) const;
00113         // return false if an error occured
00114
00115     inline DWORD GetIdleTime(void) const { return m_idletime; }
00116     inline void ResetIdleTime(void) { m_idletime = 0; }
00117
00118     // in order to get an idea of where is cvs
00119     void IdleCvsProgress(void);
00120
00121     // retrieve filtering model to use
00122     KiFilterModel* GetFilterModel() const;
00123
00124     // retrieve recursion model to use
00125     KiRecursionModel* GetRecursionModel() const;
00126
00127     // ignore model in use
00128     KiIgnoreModel* GetIgnoreModel() const;
00129
00130     // ask a GetEnv value from the main thread for those
00131     // which require interaction (ex: CVS_GETPASS)
00132     char *GetEnvMainThread(const char *name);
00133
00134 // Overrides
00135     // ClassWizard generated virtual function overrides
00136     //{{AFX_VIRTUAL(CWincvsApp)
00137     public:
00138     virtual BOOL InitInstance();
00139     virtual int ExitInstance();
00140     virtual BOOL SaveAllModified();
00141     virtual BOOL PreTranslateMessage(MSG* pMsg);
00142     //}}AFX_VIRTUAL
00143
00144     bool m_isBackgroundProcess;
00145         // tells if the app is in background
00146
00147 protected:
00148     BOOL InitATL();
00149     void LookForResourceFile(const char *what, CStr & path);
00150
00151     afx_msg void OnFileNew();
00152
00153     DWORD m_idletime;
00154     CMainFrame *m_mainFrame;
00155     BOOL m_bATLInited;
00156
00157 // Implementation
00158     COleTemplateServer m_server;
00159         // Server object for document creation
00160
00161     //{{AFX_MSG(CWincvsApp)
00162     afx_msg void OnAppAbout();
00163     afx_msg void OnAppCopyrights();
00164     afx_msg void OnAppCredits();
00165     afx_msg void OnLogWindowIsPresent(CCmdUI* pCmdUI);
00166     afx_msg void OnHelpCvs();
00167     afx_msg void OnHelpCvsclient();
00168     //}}AFX_MSG
00169     DECLARE_MESSAGE_MAP()
00170 private:
00171     void ShowTipAtStartup(void);
00172     void ShowTipOfTheDay(void);
00173 };
00174
00175
00177
00178 //{{AFX_INSERT_LOCATION}}
00179 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00180
00181 void AFXAPI DDV_CheckPathExists(CDataExchange* pDX, int nIDC, CString& value, bool promptForCreation = true);
00182 void AFXAPI DDV_MinChars(CDataExchange* pDX, CString const& value, int nChars);
00183 void AFXAPI DDV_CheckCVSROOT(CDataExchange* pDX, CString& value);
00184 void AFXAPI DDX_ComboMString(CDataExchange* pDX, int nIDC, CSmartComboBox& combo);
00185
00186 #endif // !defined(AFX_WINCVS_H__D2D77DC7_8299_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/wincvs.odl Source File

WinCvs/wincvs.odl

Go to the documentation of this file.
00001 // wincvs.odl : type library source for wincvs.exe
00002
00003 // This file will be processed by the MIDL compiler to produce the
00004 // type library (wincvs.tlb).
00005
00006 [ uuid(D2D77DC3-8299-11D1-8949-444553540000), version(1.0) ]
00007 library Wincvs
00008 {
00009     importlib("stdole32.tlb");
00010
00011
00012     //  Primary dispatch interface for CWincvsDoc
00013
00014     [ uuid(D2D77DC4-8299-11D1-8949-444553540000) ]
00015     dispinterface IWincvs
00016     {
00017         properties:
00018             // NOTE - ClassWizard will maintain property information here.
00019             //    Use extreme caution when editing this section.
00020             //{{AFX_ODL_PROP(CWincvsDoc)
00021             [id(1)] BSTR ViewPath;
00022             //}}AFX_ODL_PROP
00023
00024         methods:
00025             // NOTE - ClassWizard will maintain method information here.
00026             //    Use extreme caution when editing this section.
00027             //{{AFX_ODL_METHOD(CWincvsDoc)
00028             //}}AFX_ODL_METHOD
00029
00030     };
00031
00032     //  Class information for CWincvsDoc
00033
00034     [ uuid(D2D77DC2-8299-11D1-8949-444553540000) ]
00035     coclass Document
00036     {
00037         [default] dispinterface IWincvs;
00038     };
00039
00040     //{{AFX_APPEND_ODL}}
00041     //}}AFX_APPEND_ODL}}
00042 };
Generated on Sun Feb 24 01:21:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/wincvs_winutil.cpp Source File

WinCvs/wincvs_winutil.cpp

Go to the documentation of this file.
00001
00002 #include "stdafx.h"
00003
00004 #include "wincvs_winutil.h"
00005 #include "MultiString.h"
00006 #include "wincvs.h"
00007 #include "MainFrm.h"
00008 #include "CustomizeMenus.h"
00009 #include "CvsPrefs.h"
00010 #include "TextBinary.h"
00011
00012
00014 // helper functions declaration
00015
00016 CWnd* FindNextSiblingWindow(CWnd* pWnd, BOOL CheckTabStop);
00017 CWnd* FindNextChildWindow(CWnd* pWnd, BOOL CheckTabStop);
00018 CWnd* GetNextParentWindow(CWnd* pWnd);
00019
00020 CWnd* FindPrevSiblingWindow(CWnd* pWnd, BOOL CheckTabStop);
00021 CWnd* GetPrevParentWindow(CWnd* pWnd);
00022 CWnd* GetEndOfDecendantWindow(CWnd* pWnd);
00023
00025 // inline function(s)
00026
00027 inline BOOL IsTargetWindow(CWnd* pWnd, BOOL CheckTabStop)
00028 {
00029     return ((!CheckTabStop) || (WS_TABSTOP & pWnd->GetStyle()));
00030 }
00031
00033 // implementation
00034
00035 CWnd* FindNextWindow(CWnd* pWnd, BOOL CheckTabStop)
00036 {
00037     ASSERT_VALID(pWnd);
00038     if (pWnd)
00039     {
00040         CWnd* pNextWnd;
00041         pNextWnd = FindNextChildWindow(pWnd, CheckTabStop);
00042         if (pNextWnd)
00043             return pNextWnd;
00044
00045         pNextWnd = FindNextSiblingWindow(pWnd, CheckTabStop);
00046         if (pNextWnd)
00047             return pNextWnd;
00048
00049         CWnd* pParentWnd = GetNextParentWindow(pWnd);
00050         while ((pParentWnd) && (pNextWnd != pWnd))
00051         {
00052             pNextWnd = FindNextChildWindow(pParentWnd, CheckTabStop);
00053             if (pNextWnd)
00054                 return pNextWnd;
00055             pParentWnd = GetNextParentWindow(pParentWnd);
00056         }
00057     }
00058     return pWnd;
00059 }
00060
00061 CWnd* GetNextParentWindow(CWnd* pWnd)
00062 {
00063     if (pWnd)
00064     {
00065         if (pWnd->IsKindOf(RUNTIME_CLASS(CFrameWnd)))
00066             return pWnd->GetTopWindow();
00067
00068         CFrameWnd* pFrameWnd = pWnd->GetParentFrame();
00069         ASSERT_VALID(pFrameWnd);
00070         CWnd* pParentWnd = pWnd->GetParent();
00071         ASSERT_VALID(pParentWnd);
00072
00073         CWnd* pCrntWnd;
00074         BOOL bFound = FALSE;
00075         while ((!bFound) && (pParentWnd != pFrameWnd))
00076         {
00077             pCrntWnd = pParentWnd->GetNextWindow();
00078             if (pCrntWnd)
00079                 bFound = TRUE;
00080             else
00081                 pParentWnd = pParentWnd->GetParent();
00082         }
00083         return (bFound) ? pCrntWnd : pParentWnd->GetTopWindow();
00084     }
00085     return NULL;
00086 }
00087
00088 CWnd* FindNextSiblingWindow(CWnd* pWnd, BOOL CheckTabStop)
00089 {
00090     if (pWnd)
00091     {
00092         CWnd* pSiblingWnd = pWnd->GetNextWindow();
00093         while (pSiblingWnd)
00094         {
00095             if (IsTargetWindow(pSiblingWnd, CheckTabStop))
00096                 return pSiblingWnd;
00097             CWnd* pChildWnd = FindNextChildWindow(pSiblingWnd, CheckTabStop);
00098             if (pChildWnd)
00099                 return pChildWnd;
00100             pSiblingWnd = pSiblingWnd->GetNextWindow();
00101         }
00102     }
00103     return NULL;
00104 }
00105
00106 CWnd* FindNextChildWindow(CWnd* pWnd, BOOL CheckTabStop)
00107 {
00108     if (pWnd)
00109     {
00110         CWnd* pChildWnd = pWnd->GetTopWindow();
00111         while (pChildWnd)
00112         {
00113             if (IsTargetWindow(pChildWnd, CheckTabStop))
00114                 return pChildWnd;
00115             CWnd* pSiblingWnd = FindNextSiblingWindow(pChildWnd, CheckTabStop);
00116             if (pSiblingWnd)
00117                 return pSiblingWnd;
00118             pChildWnd = pChildWnd->GetTopWindow();
00119         }
00120     }
00121     return NULL;
00122 }
00123
00124 CWnd* FindPrevWindow(CWnd* pWnd, BOOL CheckTabStop)
00125 {
00126     ASSERT_VALID(pWnd);
00127     if (pWnd)
00128     {
00129         CWnd* pWndCrntLevel = pWnd;
00130         while (TRUE)
00131         {
00132             CWnd* pFoundWnd;
00133             pFoundWnd = FindPrevSiblingWindow(pWndCrntLevel, CheckTabStop);
00134             if (pFoundWnd)
00135                 return pFoundWnd;
00136             pWndCrntLevel = GetPrevParentWindow(pWndCrntLevel);
00137             if (!pWndCrntLevel)
00138             {
00139                 pFoundWnd = GetEndOfDecendantWindow(pWnd->GetParentFrame());
00140                 if (IsTargetWindow(pFoundWnd, CheckTabStop))
00141                     return pFoundWnd;
00142                 pWndCrntLevel = pFoundWnd;
00143             }
00144         }
00145     }
00146     return NULL;
00147 }
00148
00149 CWnd* GetPrevParentWindow(CWnd* pWnd)
00150 {
00151     if (pWnd)
00152     {
00153         if (!pWnd->IsKindOf(RUNTIME_CLASS(CFrameWnd)))
00154         {
00155             CWnd* pParentWnd = pWnd->GetParent();
00156             ASSERT_VALID(pParentWnd);
00157             return pParentWnd;
00158         }
00159     }
00160     return NULL;
00161 }
00162
00163 CWnd* FindPrevSiblingWindow(CWnd* pWnd, BOOL CheckTabStop)
00164 {
00165     if (pWnd)
00166     {
00167         CWnd* pSiblingWnd = pWnd->GetWindow(GW_HWNDPREV);
00168         while (pSiblingWnd)
00169         {
00170             if (IsTargetWindow(pSiblingWnd, CheckTabStop))
00171                 return pSiblingWnd;
00172             pSiblingWnd = pSiblingWnd->GetWindow(GW_HWNDPREV);
00173         }
00174     }
00175     return NULL;
00176 }
00177
00178 CWnd* GetEndOfDecendantWindow(CWnd* pWnd)
00179 {
00180     CWnd* pTmpWnd = pWnd;
00181     CWnd* pPreTmpWnd;
00182     while (pTmpWnd)
00183     {
00184         pPreTmpWnd = pTmpWnd;
00185         pTmpWnd = pTmpWnd->GetWindow(GW_CHILD);
00186         if (pTmpWnd)
00187         {
00188             pPreTmpWnd = pTmpWnd;
00189             pTmpWnd = pTmpWnd->GetWindow(GW_HWNDLAST);
00190         }
00191     }
00192     return pPreTmpWnd;
00193 }
00194
00195 static void updateUIMenu(CMenu *pMyMenu, CView* pThis)
00196 {
00197     CCmdUI state;
00198     state.m_pMenu = pMyMenu;
00199
00200     state.m_nIndexMax = pMyMenu->GetMenuItemCount();
00201     for (state.m_nIndex = 0; state.m_nIndex < state.m_nIndexMax;
00202       state.m_nIndex++)
00203     {
00204         state.m_nID = pMyMenu->GetMenuItemID(state.m_nIndex);
00205         if (state.m_nID == 0)
00206             continue; // menu separator or invalid cmd - ignore it
00207
00208         ASSERT(state.m_pOther == NULL);
00209         ASSERT(state.m_pMenu != NULL);
00210         if (state.m_nID == (UINT)-1)
00211         {
00212             // possibly a popup menu, route to first item of that popup
00213             state.m_pSubMenu = pMyMenu->GetSubMenu(state.m_nIndex);
00214             if (state.m_pSubMenu == NULL ||
00215                 (state.m_nID = state.m_pSubMenu->GetMenuItemID(0)) == 0 ||
00216                 state.m_nID == (UINT)-1)
00217             {
00218                 continue;       // first item of popup can't be routed to
00219             }
00220             state.DoUpdate(pThis, FALSE);    // popups are never auto disabled
00221         }
00222         else
00223         {
00224             // normal menu item
00225             // Auto enable/disable if frame window has 'm_bAutoMenuEnable'
00226             //    set and command is _not_ a system command.
00227             state.m_pSubMenu = NULL;
00228             state.DoUpdate(pThis, TRUE);
00229         }
00230
00231 #   if 0 /* ??? */
00232         // adjust for menu deletions and additions
00233         UINT nCount = pMyMenu->GetMenuItemCount();
00234         if (nCount < state.m_nIndexMax)
00235         {
00236             state.m_nIndex -= (state.m_nIndexMax - nCount);
00237             while (state.m_nIndex < nCount &&
00238                 pMyMenu->GetMenuItemID(state.m_nIndex) == state.m_nID)
00239             {
00240                 state.m_nIndex++;
00241             }
00242         }
00243         state.m_nIndexMax = nCount;
00244 #   endif
00245     }
00246 }
00247
00248 CMenu* GetSubCMenu(int nStartId, CView* pThis)
00249 {
00250     CMenu* pTopMenu = AfxGetMainWnd()->GetMenu();
00251     ASSERT(pTopMenu != 0L);
00252     if(pTopMenu == 0L)
00253         return NULL;
00254
00255     CMenu* pMyMenu=NULL;
00256     int iPos;
00257     for (iPos = pTopMenu->GetMenuItemCount()-1; iPos >= 0; iPos--)
00258     {
00259         CMenu* pMenu = pTopMenu->GetSubMenu(iPos);
00260         if (pMenu && pMenu->GetMenuItemID(0) == nStartId)
00261         {
00262             pMyMenu = pMenu;
00263             break;
00264         }
00265     }
00266     ASSERT(pMyMenu != 0L);
00267     if(pMyMenu == 0L)
00268         return NULL;
00269
00270     updateUIMenu(pMyMenu, pThis);
00271
00272     return pMyMenu;
00273 }
00274
00275 CMenu* _GetMenuEntryRecurs(CMenu *menu, int nStartId, int & pos)
00276 {
00277     if(menu == 0L)
00278         return 0l;
00279
00280     int iPos;
00281     for (iPos = 0; iPos < menu->GetMenuItemCount(); iPos++)
00282     {
00283         UINT id = menu->GetMenuItemID(iPos);
00284         if(id == nStartId)
00285         {
00286             pos = iPos;
00287             return menu;
00288         }
00289
00290         if(id == (UINT)-1)
00291         {
00292             CMenu *res = _GetMenuEntryRecurs(menu->GetSubMenu(iPos), nStartId, pos);
00293             if(res != 0L)
00294                 return res;
00295         }
00296     }
00297
00298     return 0L;
00299 }
00300
00301 CMenu* GetMenuEntry(int nStartId, int & pos)
00302 {
00303     CMenu* pTopMenu = AfxGetMainWnd()->GetMenu();
00304     ASSERT(pTopMenu != 0L);
00305
00306     return _GetMenuEntryRecurs(pTopMenu, nStartId, pos);
00307 }
00308
00309 CMMenuString::CMMenuString(unsigned int maxstr, const char *uniqueName, char * const *defaultStr) :
00310     CPersistent(uniqueName, kNoClass), fMaxStr(maxstr)
00311 {
00312     if(defaultStr != 0L)
00313     {
00314         int i = 0;
00315         while(defaultStr[i] != 0L)
00316         {
00317             Insert(defaultStr[i++]);
00318         }
00319     }
00320 }
00321
00322 CMMenuString::~CMMenuString()
00323 {
00324 }
00325
00326 unsigned int CMMenuString::SizeOf(void) const
00327 {
00328     NAMESPACE(std) vector<UStr>::const_iterator i;
00329     unsigned int thesize = sizeof(int);
00330
00331     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00332     {
00333         thesize += (*i).length() + 1;
00334     }
00335     return thesize;
00336 }
00337
00338 const void *CMMenuString::GetData(void) const
00339 {
00340     unsigned int thesize = SizeOf(), tmpsize;
00341     ((CMMenuString *)this)->fBuf.AdjustSize(thesize);
00342     char *tmp = ((CMMenuString *)this)->fBuf;
00343     *(int *)tmp = fAllStrs.size();
00344     tmp += sizeof(int) / sizeof(char);
00345
00346     NAMESPACE(std) vector<UStr>::const_iterator i;
00347     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00348     {
00349         tmpsize = (*i).length() + 1;
00350         memcpy(tmp, (const char *)(*i), tmpsize * sizeof(char));
00351         tmp += tmpsize;
00352     }
00353
00354     return (char *)fBuf;
00355 }
00356
00357 void CMMenuString::SetData(const void *ptr, unsigned int size)
00358 {
00359     const char *tmp = (char *)ptr;
00360     unsigned int thesize;
00361     fAllStrs.erase(fAllStrs.begin(), fAllStrs.end());
00362     thesize = *(int *)tmp;
00363     tmp += sizeof(int) / sizeof(char);
00364     for(unsigned int i = 0; i < thesize && i < fMaxStr; i++)
00365     {
00366         fAllStrs.push_back(UStr(tmp));
00367         tmp += strlen(tmp) + 1;
00368     }
00369 }
00370
00371 void CMMenuString::Insert(const char *newstr)
00372 {
00373     TouchTimeStamp();
00374     fAllStrs.push_back(UStr(newstr));
00375 }
00376
00377 char *sDefBrowserMenu[] =
00378 {
00379     "ID_VIEW_UPDATE",
00380     "ID_VIEW_COMMIT",
00381     "ID_SEPARATOR",
00382     "ID_VIEW_EXPLORE",
00383     "ID_VIEW_QUERYUPDATE",
00384     "ID_VIEW_RELOAD",
00385     "ID_SEPARATOR",
00386     "ID_VIEW_IMPORT",
00387     "ID_VIEW_CHECKOUT",
00388     0L
00389 };
00390
00391 char *sDefFilesMenu[] =
00392 {
00393     "ID_VIEW_UPDATE",
00394     "ID_VIEW_COMMIT",
00395     "ID_SEPARATOR",
00396     "ID_VIEW_EXPLORE",
00397     "ID_VIEW_QUERYUPDATE",
00398     "ID_VIEW_RELOAD",
00399     "ID_SEPARATOR",
00400     "ID_VIEW_EDITSEL",
00401     "ID_VIEW_EDITSELDEF",
00402     "ID_SEPARATOR",
00403     "ID_VIEW_DIFF",
00404     "ID_VIEW_LOG",
00405     "ID_VIEW_STATUS",
00406     "ID_VIEW_GRAPH",
00407     "ID_QUERY_ANNOTATE",
00408     0L
00409 };
00410
00411 static CMMenuString gFilesMenu(99, "P_FilesMenu", sDefFilesMenu);
00412 static CMMenuString gBrowserMenu(99, "P_BrowserMenu", sDefBrowserMenu);
00413
00414 CMenu* GetCustomMenu(int whichmenu, CView* pThis)
00415 {
00416     CMMenuString *multiMenu;
00417
00418     switch(whichmenu)
00419     {
00420     case kCustomBrowserMenu:
00421         multiMenu = &gBrowserMenu;
00422         break;
00423     case kCustomFilesMenu:
00424         multiMenu = &gFilesMenu;
00425         break;
00426     default:
00427         ASSERT(0);
00428         return 0L;
00429     }
00430
00431     CMenu *res = new CMenu;
00432     VERIFY(res->CreatePopupMenu());
00433
00434     std::vector<UStr> & list = multiMenu->GetList();
00435     std::vector<UStr>::iterator i;
00436
00437     for(i = list.begin(); i != list.end(); ++i)
00438     {
00439         const CustInvertTable *tab = CustGetByKey(*i);
00440         if(tab == 0L)
00441         {
00442             TRACE1("Hum... was '%s' an old command ? Removing it...",
00443                 (const char *)*i);
00444             list.erase(i);
00445             i = list.begin();
00446         }
00447     }
00448
00449     for(i = list.begin(); i != list.end(); ++i)
00450     {
00451         const CustInvertTable *tab = CustGetByKey(*i);
00452
00453         if(tab->cmd == ID_SEPARATOR)
00454         {
00455             res->AppendMenu(MF_SEPARATOR);
00456         }
00457         else
00458         {
00459             CString str = tab->title;
00460             FormatMenuString(tab->cmd, str);
00461             res->AppendMenu(MF_STRING, tab->cmd, str);
00462         }
00463     }
00464
00465     res->AppendMenu(MF_SEPARATOR);
00466     res->AppendMenu(MF_STRING, whichmenu == kCustomFilesMenu ?
00467         ID_CUST_FILES_MENU : ID_CUST_FOLDER_MENU,
00468         CString("Customize this menu..."));
00469
00470     updateUIMenu(res, pThis);
00471
00472     return res;
00473 }
00474
00475 void CustomizeMenus(int whichmenu)
00476 {
00477     CMMenuString *multiMenu;
00478
00479     switch(whichmenu)
00480     {
00481     case kCustomBrowserMenu:
00482         multiMenu = &gBrowserMenu;
00483         break;
00484     case kCustomFilesMenu:
00485         multiMenu = &gFilesMenu;
00486         break;
00487     default:
00488         ASSERT(0);
00489         return;
00490     }
00491
00492     CCustomizeMenus custom(multiMenu);
00493     if(custom.DoModal() == IDOK)
00494     {
00495         gCvsPrefs.save();
00496     }
00497 }
00498
00499 bool FormatMenuString(int cmd, CString& str)
00500 {
00501     bool res = false;
00502
00503     switch(cmd)
00504     {
00505     case ID_VIEW_EDITSELDEF:
00506         {
00507             CString viever("default viewer");
00508             if( gCvsPrefs.Viewer() != 0L )
00509             {
00510                 CStr uppath, folder;
00511                 SplitPath(gCvsPrefs.Viewer(), uppath, folder);
00512
00513                 viever = folder.empty() ? (uppath.empty() ? gCvsPrefs.Viewer() : uppath) : folder;
00514                 if( viever.Find(" ") > -1 )
00515                 {
00516                     viever = "\"" + viever + "\"";
00517                 }
00518             }
00519             str = "View &with " + viever;
00520
00521         }
00522         res = TRUE;
00523         break;
00524
00525     default:
00526         break;
00527     }
00528
00529     return res;
00530 }
00531
00533 // CWndRedrawManager class
00534
00536 CWndRedrawMngr::CWndRedrawMngr(CWnd* pWnd, BOOL bRedraw /*= FALSE*/)
00537 {
00538     ASSERT(pWnd != NULL);
00539     m_pWnd = pWnd;
00540
00541     if( m_pWnd )
00542     {
00543         m_pWnd->SetRedraw(bRedraw);
00544     }
00545 }
00546
00548 CWndRedrawMngr::~CWndRedrawMngr()
00549 {
00550     if( m_pWnd )
00551     {
00552         m_pWnd->SetRedraw(TRUE);
00553     }
00554 }
00555
00557 void CWndRedrawMngr::SetRedraw(BOOL bRedraw)
00558 {
00559     if( m_pWnd )
00560     {
00561         m_pWnd->SetRedraw(bRedraw);
00562     }
00563 }
Generated on Sun Feb 24 01:21:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/wincvs_winutil.h Source File

WinCvs/wincvs_winutil.h

Go to the documentation of this file.
00001 #ifndef WINCVS_WINUTIL_H
00002 #define WINCVS_WINUTIL_H
00003
00004 CWnd* FindNextWindow(CWnd* pWnd, BOOL CheckTabStop = TRUE);
00005 CWnd* FindPrevWindow(CWnd* pWnd, BOOL CheckTabStop = TRUE);
00006
00007 CMenu* GetSubCMenu(int nStartId, CView* pThis);
00008     // return the menu which has the cmd nStartId
00009
00010 CMenu* GetMenuEntry(int nStartId, int & pos);
00011     // return the menu and position of a cmd
00012
00013 enum
00014 {
00015     kCustomBrowserMenu,
00016     kCustomFilesMenu
00017 };
00018
00019 CMenu* GetCustomMenu(int whichmenu, CView* pThis);
00020     // return the custom menu
00021
00022 void CustomizeMenus(int whichmenu);
00023     // ask to customize the menus
00024
00025 bool FormatMenuString(int cmd, CString& str);
00026     // get the string for the command
00027     // return TRUE if string found for the command (str contains the resulting string)
00028
00030 class CWndRedrawMngr
00031 {
00032 private:
00033     CWnd* m_pWnd;
00034 public:
00035     CWndRedrawMngr(CWnd* pWnd, BOOL bRedraw = FALSE);
00036     virtual ~CWndRedrawMngr();
00037
00038     void SetRedraw(BOOL bRedraw);
00039 };
00040
00041 #endif  /*WINCVS_WINUTIL_H*/
Generated on Sun Feb 24 01:21:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/WinCvsBrowser.cpp Source File

WinCvs/WinCvsBrowser.cpp

Go to the documentation of this file.
00001 // WinCvsBrowser.cpp : implementation file
00002 //
00003
00004 #include "stdafx.h"
00005 #include "wincvs.h"
00006 #include "MainFrm.h"
00007 #include "WinCvsBrowser.h"
00008 #include "FileTraversal.h"
00009 #include "AppConsole.h"
00010 #include "CvsPrefs.h"
00011 #include "CvsCommands.h"
00012 #include "BrowseFileView.h"
00013 #include "TclGlue.h"
00014 #include "MacrosSetup.h"
00015 #include "wincvs_winutil.h"
00016 #include "PythonGlue.h"
00017
00018 #include "umain.h"
00019
00020 #ifdef WIN32
00021 #   include "resource.h"
00022 #endif /* WIN32 */
00023
00024 #ifdef _DEBUG
00025 #define new DEBUG_NEW
00026 #undef THIS_FILE
00027 static char THIS_FILE[] = __FILE__;
00028 #endif
00029
00030 static const int WM_RESETVIEW = WM_APP + 12;
00031
00032 enum
00033 {
00034     kIconFolderClosed,
00035     kIconFolderOpened,
00036     kIconFolderCVSClosed,
00037     kIconFolderCVSOpened,
00038     kIconFolderIgnoreClosed,
00039     kIconFolderIgnoreOpened,
00040     kIconFolderIgnoreLost
00041 };
00042
00044 // CWinCvsBrowser
00045
00046 IMPLEMENT_DYNCREATE(CWinCvsBrowser, CTreeView)
00047
00048 BEGIN_MESSAGE_MAP(CWinCvsBrowser, CTreeView)
00049     //{{AFX_MSG_MAP(CWinCvsBrowser)
00050     ON_NOTIFY_REFLECT(TVN_ITEMEXPANDING, OnItemexpanding)
00051     ON_WM_RBUTTONDOWN()
00052     ON_NOTIFY_REFLECT(TVN_SELCHANGING, OnSelchanging)
00053     ON_UPDATE_COMMAND_UI(ID_VIEW_ADD, OnUpdateViewAdd)
00054     ON_UPDATE_COMMAND_UI(ID_VIEW_COMMIT, OnUpdateViewUpdate)
00055     ON_COMMAND(ID_VIEW_ADD, OnViewAdd)
00056     ON_COMMAND(ID_VIEW_COMMIT, OnViewCommit)
00057     ON_COMMAND(ID_VIEW_UPDATE, OnViewUpdate)
00058     ON_COMMAND(ID_VIEW_QUERYUPDATE, OnViewQueryUpdate)
00059     ON_COMMAND(ID_VIEW_DIFF, OnViewDiff)
00060     ON_COMMAND(ID_VIEW_LOG, OnViewLog)
00061     ON_COMMAND(ID_VIEW_STATUS, OnViewStatus)
00062     ON_COMMAND(ID_VIEW_UNLOCKF, OnViewUnlock)
00063     ON_COMMAND(ID_VIEW_WATCHON, OnViewWatchOn)
00064     ON_COMMAND(ID_VIEW_WATCHOFF, OnViewWatchOff)
00065     ON_COMMAND(ID_VIEW_EDIT, OnViewEdit)
00066     ON_COMMAND(ID_VIEW_RESERVEDEDIT, OnViewReservededit)
00067     ON_COMMAND(ID_VIEW_FORCEEDIT, OnViewForceedit)
00068     ON_COMMAND(ID_VIEW_UNEDIT, OnViewUnedit)
00069     ON_COMMAND(ID_VIEW_WATCHERS, OnViewWatchers)
00070     ON_COMMAND(ID_VIEW_EDITORS, OnViewEditors)
00071     ON_COMMAND(ID_VIEW_RELEASE, OnViewRelease)
00072     ON_COMMAND(ID_VIEW_TAGNEW, OnViewTagNew)
00073     ON_COMMAND(ID_VIEW_TAGDELETE, OnViewTagDelete)
00074     ON_COMMAND(ID_VIEW_TAGBRANCH, OnViewTagBranch)
00075     ON_COMMAND(ID_VIEW_EXPLORE, OnViewExplore)
00076     ON_UPDATE_COMMAND_UI(ID_VIEW_EXPLORE, OnUpdateViewExplore)
00077     ON_UPDATE_COMMAND_UI(ID_VIEW_RELOAD, OnUpdateViewReload)
00078     ON_COMMAND(ID_VIEW_RELOAD, OnViewReload)
00079     ON_COMMAND(ID_VIEW_CHECKOUT, OnViewCheckout)
00080     ON_UPDATE_COMMAND_UI(ID_VIEW_CHECKOUT, OnUpdateViewCheckout)
00081     ON_COMMAND(ID_VIEW_IMPORT, OnViewImport)
00082     ON_UPDATE_COMMAND_UI(ID_VIEW_IMPORT, OnUpdateViewImport)
00083     ON_WM_SETCURSOR()
00084     ON_NOTIFY_REFLECT(TVN_SELCHANGED, OnSelchanged)
00085     ON_WM_DESTROY()
00086     ON_UPDATE_COMMAND_UI(ID_VIEW_DIFF, OnUpdateViewUpdate)
00087     ON_UPDATE_COMMAND_UI(ID_VIEW_EDIT, OnUpdateViewUpdate)
00088     ON_UPDATE_COMMAND_UI(ID_VIEW_RESERVEDEDIT, OnUpdateViewUpdate)
00089     ON_UPDATE_COMMAND_UI(ID_VIEW_FORCEEDIT, OnUpdateViewUpdate)
00090     ON_UPDATE_COMMAND_UI(ID_VIEW_EDITORS, OnUpdateViewUpdate)
00091     ON_UPDATE_COMMAND_UI(ID_VIEW_LOG, OnUpdateViewUpdate)
00092     ON_UPDATE_COMMAND_UI(ID_VIEW_RELEASE, OnUpdateViewUpdate)
00093     ON_UPDATE_COMMAND_UI(ID_VIEW_STATUS, OnUpdateViewUpdate)
00094     ON_UPDATE_COMMAND_UI(ID_VIEW_UNEDIT, OnUpdateViewUpdate)
00095     ON_UPDATE_COMMAND_UI(ID_VIEW_UPDATE, OnUpdateViewUpdate)
00096     ON_UPDATE_COMMAND_UI(ID_VIEW_QUERYUPDATE, OnUpdateViewUpdate)
00097     ON_UPDATE_COMMAND_UI(ID_VIEW_UNLOCKF, OnUpdateViewUpdate)
00098     ON_UPDATE_COMMAND_UI(ID_VIEW_WATCHERS, OnUpdateViewUpdate)
00099     ON_UPDATE_COMMAND_UI(ID_VIEW_WATCHON, OnUpdateViewUpdate)
00100     ON_UPDATE_COMMAND_UI(ID_VIEW_WATCHOFF, OnUpdateViewUpdate)
00101     ON_UPDATE_COMMAND_UI(ID_VIEW_TAGNEW, OnUpdateViewUpdate)
00102     ON_UPDATE_COMMAND_UI(ID_VIEW_TAGDELETE, OnUpdateViewUpdate)
00103     ON_UPDATE_COMMAND_UI(ID_VIEW_TAGBRANCH, OnUpdateViewUpdate)
00104     //}}AFX_MSG_MAP
00105     ON_UPDATE_COMMAND_UI_RANGE(ID_MACRO_START, ID_MACRO_END, OnUpdateMacro)
00106     ON_COMMAND_EX_RANGE(ID_MACRO_START, ID_MACRO_END, OnMacro)
00107     ON_UPDATE_COMMAND_UI_RANGE(ID_CUST_FILES_MENU, ID_CUST_FOLDER_MENU, OnUpdateCustomize)
00108     ON_COMMAND_EX_RANGE(ID_CUST_FILES_MENU, ID_CUST_FOLDER_MENU, OnCustomize)
00109     ON_MESSAGE(WM_RESETVIEW, OnResetView)
00110 END_MESSAGE_MAP()
00111
00112 CImageList CWinCvsBrowser::m_Imagelist;
00113
00114 static const char *gDummyFile = "@@@dummy file@@@";
00115
00116 CWinCvsBrowser::CWinCvsBrowser()
00117 : m_isSelectionNotificationLocked(false)
00118 , m_isSelectionChanged(false)
00119 , m_isResetViewPending(false)
00120 {
00121 }
00122
00123 CWinCvsBrowser::~CWinCvsBrowser()
00124 { }
00125
00127 // CWinCvsBrowser drawing
00128
00129 void CWinCvsBrowser::OnDraw(CDC* pDC)
00130 {
00131     // TODO: add draw code here
00132 }
00133
00135 // CWinCvsBrowser diagnostics
00136
00137 #ifdef _DEBUG
00138 void CWinCvsBrowser::AssertValid() const
00139 {
00140     CTreeView::AssertValid();
00141 }
00142
00143 void CWinCvsBrowser::Dump(CDumpContext& dc) const
00144 {
00145     CTreeView::Dump(dc);
00146 }
00147 #endif //_DEBUG
00148
00150 // CWinCvsBrowser message handlers
00151
00152 BOOL CWinCvsBrowser::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
00153 {
00154     if (!CTreeView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext))
00155     {
00156         return FALSE;
00157     }
00158
00159     if(m_Imagelist.m_hImageList == 0L)
00160         m_Imagelist.Create(16, 16, ILC_MASK, 1, 1);
00161     m_Imagelist.SetBkColor(GetSysColor(COLOR_WINDOW));
00162
00163     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00164     HICON hIcon = app->LoadIcon(IDI_FOLDER);
00165     m_Imagelist.Add(hIcon);
00166     hIcon = app->LoadIcon(IDI_FOLDERO);
00167     m_Imagelist.Add(hIcon);
00168     hIcon = app->LoadIcon(IDI_FOLDERCVS);
00169     m_Imagelist.Add(hIcon);
00170     hIcon = app->LoadIcon(IDI_FOLDEROCVS);
00171     m_Imagelist.Add(hIcon);
00172     hIcon = app->LoadIcon(IDI_FOLDERIGN);
00173     m_Imagelist.Add(hIcon);
00174     hIcon = app->LoadIcon(IDI_FOLDEROIGN);
00175     m_Imagelist.Add(hIcon);
00176     hIcon = app->LoadIcon(IDI_FOLDERLOST);
00177     m_Imagelist.Add(hIcon);
00178
00179     CTreeCtrl& treeCtrl = GetTreeCtrl();
00180     treeCtrl.SetImageList(&m_Imagelist, TVSIL_NORMAL);
00181
00182     // set the initial root
00183     CMainFrame* mainFrm = app->GetMainFrame();
00184     CHistComboBoxEx& hist = mainFrm->GetBrowseHistory();
00185     CStr newpath((const char *)hist.GetOldLoc());
00186     ResetBrowser(newpath, true);
00187
00188     SetNewStyle(TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT, TRUE);
00189
00190     return TRUE;
00191 }
00192
00193 void CWinCvsBrowser::DeleteAllItems(HTREEITEM root)
00194 {
00195     // we don't want the file view to be notified when things get deleted
00196     // process selection after we are done with all that jazz below
00197     CSelectionChangeNotifier notifier(this, true);
00198
00199     CTreeCtrl& treeCtrl = GetTreeCtrl();
00200     bool eraseRoot = false;
00201     if(root == 0L)
00202     {
00203         root = treeCtrl.GetRootItem( );
00204         eraseRoot = true;
00205     }
00206     if(root == 0L)
00207         return;
00208
00209     HTREEITEM childItem = treeCtrl.GetNextItem(root, TVGN_CHILD);
00210
00211     // erase all the childs
00212     while(childItem != 0L)
00213     {
00214         EntnodeData *data = (EntnodeData *)treeCtrl.GetItemData(childItem);
00215         if(data != 0L) {
00216             treeCtrl.SetItemData(childItem,0L); //So that subsequent references after UnRef() won't SEGV
00217             data->UnRef();  //Or move this one after DeleteAllItems? so we don't loose one system call. For now, safe way
00218         }
00219
00220         DeleteAllItems(childItem);
00221
00222         HTREEITEM nextItem = treeCtrl.GetNextItem(childItem, TVGN_NEXT);
00223         VERIFY(treeCtrl.DeleteItem(childItem));
00224         childItem = nextItem;
00225     }
00226
00227     // erase the root only if initially root was 0L
00228     if(eraseRoot)
00229     {
00230         EntnodeData *data = (EntnodeData *)treeCtrl.GetItemData(root);
00231         ASSERT(data == 0L);
00232
00233         VERIFY(treeCtrl.DeleteItem(root));
00234     }
00235 }
00236
00237 static void SetIcon(CTreeCtrl& treeCtrl, HTREEITEM item,
00238                     bool hasCvsInfos, bool expand, EntnodeData *data = 0L)
00239 {
00240     TV_ITEM pItem;
00241     pItem.hItem = item;
00242     pItem.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
00243     VERIFY(treeCtrl.GetItem(&pItem));
00244
00245     int newImage;
00246     if(data == 0L)
00247     {
00248         if(expand)
00249             newImage = hasCvsInfos ? kIconFolderCVSOpened : kIconFolderOpened;
00250         else
00251             newImage = hasCvsInfos ? kIconFolderCVSClosed : kIconFolderClosed;
00252     }
00253     else
00254     {
00255         if(expand)
00256         {
00257             if(data->IsIgnored())
00258                 newImage = kIconFolderIgnoreOpened;
00259             else if(data->IsUnknown())
00260                 newImage = kIconFolderOpened;
00261             else
00262                 newImage = kIconFolderCVSOpened;
00263         }
00264         else
00265         {
00266             if(data->IsIgnored())
00267                 newImage = kIconFolderIgnoreClosed;
00268             else if(data->IsUnknown())
00269                 newImage = kIconFolderClosed;
00270             else
00271                 newImage = kIconFolderCVSClosed;
00272         }
00273     }
00274
00275     if(pItem.iImage != newImage)
00276     {
00277         pItem.iImage = newImage;
00278         pItem.iSelectedImage = newImage;
00279         pItem.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
00280         treeCtrl.SetItem(&pItem);
00281     }
00282 }
00283
00284 // regarding a path and a root item, create an
00285 // item with a dummy item inside if and only if
00286 // the folder is not empty.
00287 class TBrowserFillDummy : public TraversalReport
00288 {
00289 public:
00290     HTREEITEM   m_root;
00291     HTREEITEM   m_item;
00292     CTreeCtrl & m_treeCtrl;
00293     bool        m_empty;
00294     bool        m_hascvs;
00295     EntnodeData *m_data;
00296
00297     TBrowserFillDummy(CTreeCtrl & treeCtrl, HTREEITEM root, HTREEITEM item, EntnodeData *data) :
00298         m_root(root), m_item(item), m_treeCtrl(treeCtrl), m_empty(true),
00299         m_data(data), m_hascvs(false) {}
00300
00301     virtual kTraversal EnterDirectory(const char *fullpath, const char *dirname, const FSSpec * macspec)
00302     {
00303         if(m_item == 0L)
00304         {
00305             TV_INSERTSTRUCT tvstruct;
00306             tvstruct.hParent = m_root;
00307             tvstruct.hInsertAfter = TVI_SORT;
00308             tvstruct.item.iImage = kIconFolderClosed;
00309             tvstruct.item.iSelectedImage = kIconFolderClosed;
00310             tvstruct.item.pszText = (char *)dirname;
00311             tvstruct.item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT;
00312             m_item = m_treeCtrl.InsertItem(&tvstruct);
00313         }
00314
00315         // assign the entries to this item
00316         if(m_data != 0L)
00317         {
00318             EntnodeData *data = (EntnodeData *)m_treeCtrl.GetItemData(m_item);
00319
00320             if(m_data != 0L)
00321                 m_data->Ref();
00322             m_treeCtrl.SetItemData(m_item, (long)m_data);
00323
00324             if(data != 0L)
00325                 data->UnRef();
00326         }
00327         else
00328             m_data = (EntnodeData *)m_treeCtrl.GetItemData(m_item);
00329
00330         return kContinueTraversal;
00331     }
00332
00333     virtual kTraversal ExitDirectory(const char *fullpath)
00334     {
00335         SetIcon(m_treeCtrl, m_item, m_hascvs, false, m_data);
00336
00337         if(m_empty)
00338             return kContinueTraversal;
00339
00340         // add a dummy item to simulate the folder
00341         // is not empty. This dummy item will be
00342         // replaced by a complete listing when the
00343         // node is expanding...
00344         TV_INSERTSTRUCT tvstruct;
00345         tvstruct.hParent = m_item;
00346         tvstruct.hInsertAfter = TVI_SORT;
00347         tvstruct.item.pszText = (char *)gDummyFile;
00348         tvstruct.item.mask = TVIF_TEXT;
00349         m_treeCtrl.InsertItem(&tvstruct);
00350
00351         return kContinueTraversal;
00352     }
00353
00354     virtual kTraversal OnError(const char *err, int errcode)
00355     {
00356         return kTraversalError;
00357     }
00358
00359     virtual kTraversal OnIdle(const char *fullpath)
00360     {
00361         return kContinueTraversal;
00362     }
00363
00364     virtual kTraversal OnDirectory(const char *fullpath,
00365         const char *fullname,
00366         const char *name,
00367         const struct stat & dir, const FSSpec * macspec)
00368     {
00369         if(stricmp(name, "cvs") == 0)
00370             m_hascvs = true;
00371         else
00372             m_empty = false;
00373         return kSkipFile;
00374     }
00375 };
00376
00377 // regarding a path and a root item, create an
00378 // item with all the subdirectories inside.
00379 class TBrowserFill : public TraversalReport
00380 {
00381 public:
00382     HTREEITEM m_root;
00383     HTREEITEM m_item;
00384     CTreeCtrl& m_treeCtrl;
00385     bool m_hascvs;
00386     CSortList<ENTNODE> & m_entries;
00387     vector<CStr> m_ignlist;
00388     bool m_isShowIgnored;
00389
00390     TBrowserFill(CTreeCtrl & treeCtrl, HTREEITEM root, HTREEITEM item, CSortList<ENTNODE> & entries) :
00391             m_root(root), m_item(item), m_treeCtrl(treeCtrl), m_hascvs(false),
00392             m_entries(entries), m_isShowIgnored(false)
00393     {
00394         if (CWincvsApp* app = (CWincvsApp *)AfxGetApp())
00395         {
00396             m_isShowIgnored = app->GetIgnoreModel()->IsShowIgnored();
00397         }
00398     }
00399
00400     virtual kTraversal EnterDirectory(const char *fullpath, const char *dirname, const FSSpec * macspec)
00401     {
00402         ASSERT(m_item != 0L);
00403
00404         Entries_Open (m_entries, fullpath);
00405         BuildIgnoredList(m_ignlist, fullpath);
00406
00407         return kContinueTraversal;
00408     }
00409
00410     virtual kTraversal ExitDirectory(const char *fullpath)
00411     {
00412         m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00413         SetIcon(m_treeCtrl, m_item, m_hascvs, true,
00414             (EntnodeData *)m_treeCtrl.GetItemData(m_item));
00415         return kContinueTraversal;
00416     }
00417
00418     virtual kTraversal OnError(const char *err, int errcode)
00419     {
00420         return kTraversalError;
00421     }
00422
00423     virtual kTraversal OnIdle(const char *fullpath)
00424     {
00425         return kContinueTraversal;
00426     }
00427
00428     virtual kTraversal OnDirectory(const char *fullpath,
00429         const char *fullname,
00430         const char *name,
00431         const struct stat & dir, const FSSpec * macspec)
00432     {
00433         if(stricmp(name, "cvs") == 0)
00434         {
00435             m_hascvs = true;
00436             return kSkipFile;
00437         }
00438
00439         // is the sub-directory ignored ?
00440         EntnodeData *data = Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00441         if(!m_isShowIgnored && data->IsIgnored())
00442             return kSkipFile;
00443
00444         // create the item for the sub-directory
00445         TBrowserFillDummy traverse(m_treeCtrl, m_item, 0L, data);
00446         kTraversal res = FileTraverse(fullname, traverse);
00447
00448         // assign the icon regarding our Entries info
00449         if(traverse.m_item != 0L)
00450         {
00451             SetIcon(m_treeCtrl, traverse.m_item, m_hascvs, false, data);
00452         }
00453
00454         return kSkipFile;
00455     }
00456
00457 };
00458
00459 void CWinCvsBrowser::ResetBrowser(const char *path, bool notifyView)
00460 {
00461     CWaitCursor doWait;
00462
00463     // Must make a copy of 'path' before calling DeleteAllItems(), since
00464     // this function may have been called with 'm_root' passed as the first
00465     // parameter (in fact it is in several places in the code) whose value
00466     // gets deleted by the call to DeleteAllItems() below, making 'path'
00467     // point to an invalid memory location
00468     CStr pathCopy(path);
00469     DeleteAllItems();
00470     bool isReload = !pathCopy.empty() && !m_root.empty() && stricmp(m_root, pathCopy) == 0;
00471
00472     m_root = pathCopy;
00473
00474     if(pathCopy.empty())
00475         return;
00476
00477     if(!isReload)
00478     {
00479         if(HasPersistentSettings(m_root))
00480             LoadPersistentSettings(m_root);
00481         else
00482         {
00483             // check if the path has a CVS folder. If not,
00484             // we don't want the user to be prompted (like when
00485             // WinCvs is starting for the first time).
00486             UStr cvsFolder(m_root);
00487             if(!cvsFolder.endsWith(kPathDelimiter))
00488                 cvsFolder << kPathDelimiter;
00489             cvsFolder << "CVS";
00490             struct stat sb;
00491             if (stat(cvsFolder, &sb) != -1 && S_ISDIR(sb.st_mode))
00492                 AskCreatePersistentSettings(m_root);
00493         }
00494     }
00495
00496     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00497     CMainFrame* mainFrm = app->GetMainFrame();
00498     CHistComboBoxEx& hist = mainFrm->GetBrowseHistory();
00499     hist.NewRoot(m_root);
00500
00501     CTreeCtrl& treeCtrl = GetTreeCtrl();
00502     TBrowserFillDummy traverse(treeCtrl, 0L, 0L, 0L);
00503     kTraversal res = FileTraverse(m_root, traverse);
00504
00505     CBrowseFileView *fileView = app->GetFileView();
00506     if(fileView != 0L)
00507     {
00508         HTREEITEM root = treeCtrl.GetRootItem( );
00509         if(root != 0L)
00510         {
00511             treeCtrl.Expand(root, TVE_EXPAND);
00512             if(notifyView)
00513             {
00514                 VERIFY(treeCtrl.Select(root, TVGN_CARET));
00515             }
00516         }
00517     }
00518 }
00519
00520 void CWinCvsBrowser::SetNewStyle(long lStyleMask, BOOL bSetBits)
00521 {
00522     long        lStyleOld;
00523
00524     lStyleOld = GetWindowLong(m_hWnd, GWL_STYLE);
00525     lStyleOld &= ~lStyleMask;
00526     if (bSetBits)
00527         lStyleOld |= lStyleMask;
00528
00529     SetWindowLong(m_hWnd, GWL_STYLE, lStyleOld);
00530     SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
00531 }
00532
00533 void CWinCvsBrowser::RetrievePath(HTREEITEM item, CStr & path)
00534 {
00535     CTreeCtrl& treeCtrl = GetTreeCtrl();
00536     CStr tmp, newPath;
00537     path = "";
00538     TV_ITEM pItem;
00539     char name[512];
00540     do
00541     {
00542         pItem.hItem = item;
00543         pItem.pszText = name;
00544         pItem.cchTextMax = 512;
00545         pItem.mask = TVIF_HANDLE | TVIF_TEXT;
00546
00547         VERIFY(treeCtrl.GetItem(&pItem));
00548         item = treeCtrl.GetParentItem(item);
00549
00550         tmp = path;
00551         newPath = item == 0L ? (const char *)m_root : pItem.pszText;
00552         if(!newPath.endsWith(kPathDelimiter))
00553             newPath << kPathDelimiter;
00554         newPath << path;
00555         path = newPath;
00556     } while(item != 0L);
00557 }
00558
00559 void CWinCvsBrowser::OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult)
00560 {
00561     // prevent from changing directory if cvs is running
00562     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00563     if(app->gCvsRunning)
00564     {
00565         *pResult = TRUE;
00566         return;
00567     }
00568
00569     CTreeCtrl& treeCtrl = GetTreeCtrl();
00570     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00571
00572     HTREEITEM item = pNMTreeView->itemNew.hItem;
00573
00574     EntnodeData *data = (EntnodeData *)treeCtrl.GetItemData(item);
00575     if(data != 0L && data->IsMissing())
00576     {
00577         *pResult = TRUE;
00578         return;
00579     }
00580
00581     // erase all the childs
00582     DeleteAllItems(item);
00583
00584     CStr path;
00585     RetrievePath(item, path);
00586
00587     if(pNMTreeView->action & TVE_COLLAPSE)
00588     {
00589         TBrowserFillDummy traverse(treeCtrl, 0L, item, 0L);
00590         kTraversal res = FileTraverse(path, traverse);
00591     }
00592     else if(pNMTreeView->action & TVE_EXPAND)
00593     {
00594         CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00595         TBrowserFill traverse(treeCtrl, 0L, item, entries);
00596         kTraversal res = FileTraverse(path, traverse);
00597
00598         // add the missing folders
00599         Entries_SetMissing(entries);
00600         int numEntries = entries.NumOfElements();
00601         for(int i = 0; i < numEntries; i++)
00602         {
00603             const ENTNODE & theNode = entries.Get(i);
00604             EntnodeData *data = theNode.Data();
00605             if(!data->IsMissing() || data->GetType() != ENT_SUBDIR)
00606                 continue;
00607
00608             TV_INSERTSTRUCT tvstruct;
00609             tvstruct.hParent = item;
00610             tvstruct.hInsertAfter = TVI_SORT;
00611             tvstruct.item.iImage = kIconFolderIgnoreLost;
00612             tvstruct.item.iSelectedImage = kIconFolderIgnoreLost;
00613             tvstruct.item.pszText = (char *)(*data)[EntnodeData::kName];
00614             tvstruct.item.lParam = (long)data->Ref();
00615             tvstruct.item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT | TVIF_PARAM;
00616             treeCtrl.InsertItem(&tvstruct);
00617
00618         }
00619     }
00620
00621     *pResult = 0;
00622 }
00623
00624 void CWinCvsBrowser::OnUpdateCmd(CCmdUI* pCmdUI, BOOL needCvsInfos)
00625 {
00626     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00627     if(DisableCommon())
00628     {
00629         pCmdUI->Enable(FALSE);
00630         return;
00631     }
00632     CTreeCtrl& treeCtrl = GetTreeCtrl();
00633     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00634     if(selItem == 0L)
00635     {
00636         pCmdUI->Enable(FALSE);
00637         return;
00638     }
00639
00640     CStr path;
00641     RetrievePath(selItem, path);
00642     if(!path.endsWith(kPathDelimiter))
00643         path << kPathDelimiter;
00644     path << "CVS";
00645
00646     struct stat sb;
00647     if (stat(path, &sb) == -1 || !S_ISDIR(sb.st_mode))
00648         pCmdUI->Enable(!needCvsInfos);
00649     else
00650         pCmdUI->Enable(needCvsInfos);
00651 }
00652
00653 void CWinCvsBrowser::OnRButtonDown(UINT nFlags, CPoint point)
00654 {
00655     // prevent from changing directory if cvs is running
00656     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00657     if(app->gCvsRunning)
00658         return;
00659
00660     // prompt a menu when hitting a selection
00661     // with the right button...
00662     CTreeCtrl& treeCtrl = GetTreeCtrl();
00663     UINT pFlags;
00664     HTREEITEM testItem = treeCtrl.HitTest(point, &pFlags);
00665     if(testItem != 0L && (pFlags & (TVHT_ONITEM|TVHT_ONITEMBUTTON)) != 0)
00666     {
00667         treeCtrl.SelectItem(testItem);
00668         // Locate the submenu AFTER item selection
00669         CMenu* pMyMenu=::GetCustomMenu(kCustomBrowserMenu,this);
00670         if (pMyMenu)
00671         {
00672             ClientToScreen(&point);
00673             pMyMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON, point.x, point.y, this);
00674             delete pMyMenu;
00675             return;
00676         }
00677     }
00678     CTreeView::OnRButtonDown(nFlags, point);    //L->R
00679 }
00680
00681 void CWinCvsBrowser::OnSelchanging(NMHDR* pNMHDR, LRESULT* pResult)
00682 {
00683     // prevent from changing directory if cvs is running
00684     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00685     if(app->gCvsRunning)
00686     {
00687         *pResult = TRUE;
00688         return;
00689     }
00690
00691     CTreeCtrl& treeCtrl = GetTreeCtrl();
00692     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00693     HTREEITEM item = pNMTreeView->itemNew.hItem;
00694
00695     EntnodeData *data = (EntnodeData *)treeCtrl.GetItemData(item);
00696     if(data != 0L && data->IsMissing())
00697     {
00698         *pResult = TRUE;
00699         return;
00700     }
00701
00702     *pResult = 0;
00703 }
00704
00705 void CWinCvsBrowser::OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult)
00706 {
00707     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00708     m_isSelectionChanged = true;
00709     NotifySelectionChange();
00710
00711     *pResult = 0;
00712 }
00713
00714 void CWinCvsBrowser::NotifySelectionChange()
00715 {
00716     if(!m_isSelectionNotificationLocked)
00717     {
00718         if (m_isSelectionChanged)
00719         {
00720             CStr path;
00721             HTREEITEM item = GetTreeCtrl().GetSelectedItem();
00722             if (item)
00723             {
00724                 RetrievePath(item, path);
00725                 CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00726                 CBrowseFileView *fileView = app->GetFileView();
00727                 if (fileView)
00728                 {
00729                     fileView->ResetView(path);
00730                 }
00731                 gCvsPrefs.SetLastWorkingDir(path);
00732             }
00733         }
00734     }
00735 }
00736
00737 void CWinCvsBrowser::OnUpdateViewAdd(CCmdUI* pCmdUI)
00738 {
00739     OnUpdateCmd(pCmdUI, FALSE);
00740 }
00741
00742 void CWinCvsBrowser::OnUpdateViewUpdate(CCmdUI* pCmdUI)
00743 {
00744     OnUpdateCmd(pCmdUI, TRUE);
00745 }
00746
00747 void CWinCvsBrowser::OnViewAdd()
00748 {
00749     CTreeCtrl& treeCtrl = GetTreeCtrl();
00750     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00751
00752     CStr path;
00753     RetrievePath(selItem, path);
00754     CvsCmdAddFolder(path);
00755 }
00756
00757 void CWinCvsBrowser::OnViewCommit()
00758 {
00759     CTreeCtrl& treeCtrl = GetTreeCtrl();
00760     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00761
00762     CStr path;
00763     RetrievePath(selItem, path);
00764     CvsCmdCommitFolder(path);
00765 }
00766
00767 void CWinCvsBrowser::OnViewUpdate()
00768 {
00769     CTreeCtrl& treeCtrl = GetTreeCtrl();
00770     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00771
00772     CStr path;
00773     RetrievePath(selItem, path);
00774     CvsCmdUpdateFolder(path);
00775 }
00776
00777 void CWinCvsBrowser::OnViewQueryUpdate()
00778 {
00779     CTreeCtrl& treeCtrl = GetTreeCtrl();
00780     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00781
00782     CStr path;
00783     RetrievePath(selItem, path);
00784     CvsCmdUpdateFolder(path, true);
00785 }
00786
00787 void CWinCvsBrowser::OnViewDiff()
00788 {
00789     CTreeCtrl& treeCtrl = GetTreeCtrl();
00790     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00791
00792     CStr path;
00793     RetrievePath(selItem, path);
00794     CvsCmdDiffFolder(path);
00795 }
00796
00797 void CWinCvsBrowser::OnViewLog()
00798 {
00799     CTreeCtrl& treeCtrl = GetTreeCtrl();
00800     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00801
00802     CStr path;
00803     RetrievePath(selItem, path);
00804     CvsCmdLogFolder(path);
00805 }
00806
00807 void CWinCvsBrowser::OnViewStatus()
00808 {
00809     CTreeCtrl& treeCtrl = GetTreeCtrl();
00810     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00811
00812     CStr path;
00813     RetrievePath(selItem, path);
00814     CvsCmdStatusFolder(path);
00815 }
00816
00817 void CWinCvsBrowser::OnViewUnlock()
00818 {
00819     CTreeCtrl& treeCtrl = GetTreeCtrl();
00820     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00821
00822     CStr path;
00823     RetrievePath(selItem, path);
00824     CvsCmdUnlockFolder(path);
00825 }
00826
00827 void CWinCvsBrowser::OnViewWatchOn()
00828 {
00829     CTreeCtrl& treeCtrl = GetTreeCtrl();
00830     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00831
00832     CStr path;
00833     RetrievePath(selItem, path);
00834     CvsCmdWatchOnFolder(path);
00835 }
00836
00837 void CWinCvsBrowser::OnViewWatchOff()
00838 {
00839     CTreeCtrl& treeCtrl = GetTreeCtrl();
00840     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00841
00842     CStr path;
00843     RetrievePath(selItem, path);
00844     CvsCmdWatchOffFolder(path);
00845 }
00846
00847 void CWinCvsBrowser::OnViewEdit()
00848 {
00849     CTreeCtrl& treeCtrl = GetTreeCtrl();
00850     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00851
00852     CStr path;
00853     RetrievePath(selItem, path);
00854     CvsCmdEditFolder(path);
00855 }
00856
00857 void CWinCvsBrowser::OnViewReservededit()
00858 {
00859     CTreeCtrl& treeCtrl = GetTreeCtrl();
00860     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00861
00862     CStr path;
00863     RetrievePath(selItem, path);
00864     CvsCmdEditFolder(path, kEditReserved);
00865 }
00866
00867 void CWinCvsBrowser::OnViewForceedit()
00868 {
00869     CTreeCtrl& treeCtrl = GetTreeCtrl();
00870     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00871
00872     CStr path;
00873     RetrievePath(selItem, path);
00874     CvsCmdEditFolder(path, kEditForce);
00875 }
00876
00877 void CWinCvsBrowser::OnViewUnedit()
00878 {
00879     CTreeCtrl& treeCtrl = GetTreeCtrl();
00880     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00881
00882     CStr path;
00883     RetrievePath(selItem, path);
00884     CvsCmdUneditFolder(path);
00885 }
00886
00887 void CWinCvsBrowser::OnViewWatchers()
00888 {
00889     CTreeCtrl& treeCtrl = GetTreeCtrl();
00890     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00891
00892     CStr path;
00893     RetrievePath(selItem, path);
00894     CvsCmdWatchersFolder(path);
00895 }
00896
00897 void CWinCvsBrowser::OnViewEditors()
00898 {
00899     CTreeCtrl& treeCtrl = GetTreeCtrl();
00900     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00901
00902     CStr path;
00903     RetrievePath(selItem, path);
00904     CvsCmdEditorsFolder(path);
00905 }
00906
00907 void CWinCvsBrowser::OnViewRelease()
00908 {
00909     CTreeCtrl& treeCtrl = GetTreeCtrl();
00910     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00911
00912     CStr path;
00913     RetrievePath(selItem, path);
00914     CvsCmdReleaseFolder(path);
00915 }
00916
00917 void CWinCvsBrowser::OnViewTagNew()
00918 {
00919     CTreeCtrl& treeCtrl = GetTreeCtrl();
00920     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00921
00922     CStr path;
00923     RetrievePath(selItem, path);
00924     CvsCmdTagCreateFolder(path);
00925 }
00926
00927 void CWinCvsBrowser::OnViewTagDelete()
00928 {
00929     CTreeCtrl& treeCtrl = GetTreeCtrl();
00930     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00931
00932     CStr path;
00933     RetrievePath(selItem, path);
00934     CvsCmdTagDeleteFolder(path);
00935 }
00936
00937 void CWinCvsBrowser::OnViewTagBranch()
00938 {
00939     CTreeCtrl& treeCtrl = GetTreeCtrl();
00940     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00941
00942     CStr path;
00943     RetrievePath(selItem, path);
00944     CvsCmdTagBranchFolder(path);
00945 }
00946
00947 static void onIgnoreChanged(CObject *obj)
00948 {
00949     ((CWinCvsBrowser *)obj)->OnIgnoreChanged();
00950 }
00951
00952 void CWinCvsBrowser::OnInitialUpdate()
00953 {
00954     CTreeView::OnInitialUpdate();
00955
00956     CTreeCtrl& treeCtrl = GetTreeCtrl();
00957     HTREEITEM root = treeCtrl.GetRootItem( );
00958     if(root != 0L)
00959     {
00960         treeCtrl.Expand(root, TVE_EXPAND);
00961         VERIFY(treeCtrl.Select(root, TVGN_CARET));
00962     }
00963
00964     if (CWincvsApp* app = (CWincvsApp *)AfxGetApp())
00965     {
00966         app->GetIgnoreModel()->GetNotificationManager()->CheckIn(this, onIgnoreChanged);
00967     }
00968 }
00969
00970 void CWinCvsBrowser::OnViewExplore()
00971 {
00972     CTreeCtrl& treeCtrl = GetTreeCtrl();
00973     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00974
00975     CStr path;
00976     RetrievePath(selItem, path);
00977     HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), "explore", path,
00978             0L, 0L, SW_SHOWDEFAULT);
00979     if((long)hInst < 32)
00980     {
00981         cvs_err("Unable to explore '%s' (error %d)\n", (char *)path, GetLastError());
00982     }
00983 }
00984
00985 void CWinCvsBrowser::OnUpdateViewExplore(CCmdUI* pCmdUI)
00986 {
00987     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00988     if(DisableCommon())
00989     {
00990         pCmdUI->Enable(FALSE);
00991         return;
00992     }
00993     CTreeCtrl& treeCtrl = GetTreeCtrl();
00994     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00995     if(selItem == 0L)
00996     {
00997         pCmdUI->Enable(FALSE);
00998         return;
00999     }
01000     pCmdUI->Enable(TRUE);
01001 }
01002
01003 bool CWinCvsBrowser::StepToLocation(const char *path, bool notifyView)
01004 {
01005     bool bRes = false;  //return
01006
01007     CStr root(m_root);
01008     if(!root.endsWith(kPathDelimiter))
01009         root << kPathDelimiter;
01010     CStr subpath(path);
01011     if(!subpath.endsWith(kPathDelimiter))
01012         subpath << kPathDelimiter;
01013
01014     // check if it is a sub-path
01015
01016     //JK - for windows case insensitive seems better
01017     if(strnicmp(root, subpath, root.length()) != 0)
01018         return false;
01019
01020     CTreeCtrl& treeCtrl = GetTreeCtrl();
01021     HTREEITEM item = treeCtrl.GetRootItem();
01022     HTREEITEM lastitem = 0L;
01023     if(item == 0L)
01024         return false;
01025
01026     if (stricmp(root, subpath) == 0)
01027     {
01028         // must select root node
01029         lastitem = item;
01030         treeCtrl.Expand(item, TVE_EXPAND);
01031     }
01032     else
01033     {
01034         // step inside synchronized
01035         const char *tmp = (const char *)subpath + root.length() - 1;
01036         while((tmp = strchr(tmp, kPathDelimiter)) != 0L)
01037         {
01038             const char *name = ++tmp;
01039             if(name[0] == '\0')
01040                 break;
01041
01042             CStr subname;
01043             const char *tmp2 = strchr(name, kPathDelimiter);
01044             if(tmp2 == 0L)
01045                 subname = name;
01046             else
01047                 subname.set(name, tmp2 - name);
01048
01049             HTREEITEM childItem = treeCtrl.GetNextItem(item, TVGN_CHILD);
01050
01051             // find the subitem which matches this name
01052             while(childItem != 0L)
01053             {
01054                 EntnodeData *data = (EntnodeData *)treeCtrl.GetItemData(childItem);
01055                 if(data != 0L)
01056                 {
01057                     if(_stricmp((*data)[EntnodeData::kName], subname) == 0)
01058                     {
01059                         // found it !
01060                         lastitem = item = childItem;
01061                         treeCtrl.Expand(item, TVE_EXPAND);
01062                         break;
01063                     }
01064                 }
01065
01066                 childItem = treeCtrl.GetNextItem(childItem, TVGN_NEXT);
01067             }
01068         }
01069     }
01070
01071     // in case this is called by the view, turn off notifying
01072     // when the item gets selected
01073     // JK - {!= 0} is for: Compiler Warning (level 3) C4800
01074     if(lastitem != 0L)
01075     {
01076         CSelectionChangeNotifier notifier(this, notifyView);
01077         VERIFY( bRes = (treeCtrl.Select(lastitem, TVGN_CARET) != 0) );
01078     }
01079
01080     return bRes;
01081 }
01082
01083 HTREEITEM CWinCvsBrowser::GetItemByLocation(const char *path)
01084 {
01085     CStr root(m_root);
01086     if(!root.endsWith(kPathDelimiter))
01087         root << kPathDelimiter;
01088     CStr subpath(path);
01089     if(!subpath.endsWith(kPathDelimiter))
01090         subpath << kPathDelimiter;
01091
01092     // check if it is a sub-path
01093     if(strncmp(root, subpath, root.length()) != 0)
01094         return 0L;
01095
01096     CTreeCtrl& treeCtrl = GetTreeCtrl();
01097     HTREEITEM item = treeCtrl.GetRootItem();
01098     if(item == 0L)
01099         return 0L;
01100
01101     // step inside synchronized
01102     const char *tmp = (const char *)subpath + root.length() - 1;
01103     while((tmp = strchr(tmp, kPathDelimiter)) != 0L)
01104     {
01105         const char *name = ++tmp;
01106         if(name[0] == '\0')
01107             break;
01108
01109         CStr subname;
01110         const char *tmp2 = strchr(name, kPathDelimiter);
01111         if(tmp2 == 0L)
01112             subname = name;
01113         else
01114             subname.set(name, tmp2 - name);
01115
01116         HTREEITEM childItem = treeCtrl.GetNextItem(item, TVGN_CHILD);
01117
01118         // find the subitem which matches this name
01119         while(childItem != 0L)
01120         {
01121             EntnodeData *data = (EntnodeData *)treeCtrl.GetItemData(childItem);
01122             if(data != 0L)
01123             {
01124                 if(_stricmp((*data)[EntnodeData::kName], subname) == 0)
01125                 {
01126                     item = childItem;
01127                     break;
01128                 }
01129             }
01130
01131             childItem = treeCtrl.GetNextItem(childItem, TVGN_NEXT);
01132         }
01133         if(childItem == 0L)
01134             return 0L;
01135     }
01136
01137     return item;
01138 }
01139
01140 void CWinCvsBrowser::StoreExpanded(std::vector<CStr> & allExpanded, HTREEITEM root)
01141 {
01142     HTREEITEM item = root;
01143     CTreeCtrl& treeCtrl = GetTreeCtrl();
01144     if(item == 0L)
01145         item = treeCtrl.GetRootItem();
01146     if(item == 0L)
01147         return;
01148
01149     TV_ITEM pItem;
01150     pItem.hItem = item;
01151     pItem.mask = TVIF_STATE;
01152     VERIFY(treeCtrl.GetItem(&pItem));
01153
01154     if(pItem.state & TVIS_EXPANDED)
01155     {
01156         CStr path;
01157         RetrievePath(item, path);
01158         allExpanded.push_back(path);
01159     }
01160
01161     HTREEITEM childItem = treeCtrl.GetNextItem(item, TVGN_CHILD);
01162
01163     while(childItem != 0L)
01164     {
01165         StoreExpanded(allExpanded, childItem);
01166         childItem = treeCtrl.GetNextItem(childItem, TVGN_NEXT);
01167     }
01168 }
01169
01170 void CWinCvsBrowser::ResetView(bool forceReload, bool notifyView)
01171 {
01172     // no outstanding request to reset the view any more
01173     m_isResetViewPending = false;
01174
01175     CWaitCursor doWait;
01176     CWndRedrawMngr redrawMngr(this);
01177
01178     bool contentChanged = false;
01179     vector<CStr> allExpanded;
01180     StoreExpanded(allExpanded);
01181     CTreeCtrl& treeCtrl = GetTreeCtrl();
01182     CStr selPath;
01183     HTREEITEM selItem = treeCtrl.GetSelectedItem();
01184     if(selItem != 0L)
01185         RetrievePath(selItem, selPath);
01186
01187     if(forceReload)
01188     {
01189         ResetBrowser(m_root);
01190         contentChanged = true;
01191     }
01192
01193     if(contentChanged)
01194     {
01195         // restore the expanded paths and the selected item
01196         vector<CStr>::const_iterator i;
01197         for(i = allExpanded.begin(); i != allExpanded.end(); ++i)
01198         {
01199             StepToLocation(*i);
01200         }
01201         if(!selPath.empty())
01202         {
01203             selItem = GetItemByLocation(selPath);
01204             if(selItem != 0L)
01205             {
01206                 VERIFY(treeCtrl.Select(selItem, TVGN_CARET));
01207                 treeCtrl.EnsureVisible(selItem);
01208             }
01209         }
01210     }
01211
01212     // we don't need to notify the file view if we force the reload
01213     // because that's already done
01214     if(notifyView)
01215     {
01216         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01217         app->GetFileView()->ResetView();
01218     }
01219 }
01220
01221 void CWinCvsBrowser::OnUpdateViewReload(CCmdUI* pCmdUI)
01222 {
01223     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01224     pCmdUI->Enable(!app->gCvsRunning);
01225 }
01226
01227 void CWinCvsBrowser::OnViewReload()
01228 {
01229     ResetView(true, true);
01230 }
01231
01232 BOOL CWinCvsBrowser::OnMacro(UINT nID)
01233 {
01234     PyDoPython(WINCMD_to_UCMD(nID));
01235
01236     return 1;
01237 }
01238
01239 void CWinCvsBrowser::OnUpdateMacro(CCmdUI* pCmdUI)
01240 {
01241     if(DisableCommon())
01242     {
01243         pCmdUI->Enable(FALSE);
01244         return;
01245     }
01246
01247     // fill the cache with current selection
01248     if(!PyIsUICacheValid())
01249     {
01250         CTreeCtrl& treeCtrl = GetTreeCtrl();
01251         HTREEITEM selItem = treeCtrl.GetSelectedItem();
01252         if(selItem != 0L)
01253         {
01254             CStr selPath;
01255             RetrievePath(selItem, selPath);
01256             CStr uppath, folder;
01257             SplitPath(selPath, uppath, folder);
01258
01259             bool deleteData = false;
01260             EntnodeData *data = (EntnodeData *)treeCtrl.GetItemData(selItem);
01261             if(data == 0L)
01262             {
01263                 deleteData = true;
01264                 EntnodePath *thePath = new EntnodePath(uppath);
01265                 data = new EntnodeFolder(folder, thePath);
01266                 thePath->UnRef();
01267             }
01268
01269             PyAppendCache(data);
01270
01271             if(deleteData)
01272                 data->UnRef();
01273         }
01274     }
01275
01276     UCmdUI ucmdui(WINCMD_to_UCMD(pCmdUI->m_nID));
01277     ucmdui.pCmdUI = pCmdUI;
01278     PyDoCmdUI(&ucmdui);
01279 }
01280
01281 BOOL CWinCvsBrowser::PreCreateWindow(CREATESTRUCT& cs)
01282 {
01283     cs.style |= WS_TABSTOP | TVS_SHOWSELALWAYS;
01284
01285     return CTreeView::PreCreateWindow(cs);
01286 }
01287
01288 bool CWinCvsBrowser::DisableCommon()
01289 {
01290     CWincvsApp *app = (CWincvsApp *)AfxGetApp();
01291     return app->gCvsRunning || gCvsPrefs.empty();
01292 }
01293
01294
01295 void CWinCvsBrowser::OnViewCheckout()
01296 {
01297     CvsCmdCheckoutModule();
01298 }
01299
01300 void CWinCvsBrowser::OnUpdateViewCheckout(CCmdUI* pCmdUI)
01301 {
01302     if(DisableCommon())
01303     {
01304         pCmdUI->Enable(FALSE);
01305         return;
01306     }
01307     pCmdUI->Enable(TRUE);
01308     pCmdUI->SetText("Chec&kout module...");
01309 }
01310
01311 void CWinCvsBrowser::OnViewImport()
01312 {
01313     CvsCmdImportModule();
01314 }
01315
01316 void CWinCvsBrowser::OnUpdateViewImport(CCmdUI* pCmdUI)
01317 {
01318     if(DisableCommon())
01319     {
01320         pCmdUI->Enable(FALSE);
01321         return;
01322     }
01323     pCmdUI->Enable(TRUE);
01324     pCmdUI->SetText("&Import module...");
01325 }
01326
01327 BOOL CWinCvsBrowser::OnCustomize(UINT nID)
01328 {
01329     CustomizeMenus(nID == ID_CUST_FILES_MENU ? kCustomFilesMenu : kCustomBrowserMenu);
01330     return TRUE;
01331 }
01332
01333 void CWinCvsBrowser::OnUpdateCustomize(CCmdUI* pCmdUI)
01334 {
01335     pCmdUI->Enable(TRUE);
01336 }
01337
01338 BOOL CWinCvsBrowser::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
01339 {
01340     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01341     if(app->gCvsRunning)
01342     {
01343         SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
01344         return TRUE;
01345     }
01346
01347     return CTreeView::OnSetCursor(pWnd, nHitTest, message);
01348 }
01349
01350 void CWinCvsBrowser::OnDestroy()
01351 {
01352     if (CWincvsApp* app = (CWincvsApp *)AfxGetApp())
01353     {
01354         app->GetIgnoreModel()->GetNotificationManager()->CheckOut(this);
01355     }
01356
01357     CTreeView::OnDestroy();
01358 }
01359
01360 void CWinCvsBrowser::OnIgnoreChanged()
01361 {
01362     if (!m_isResetViewPending)
01363     {
01364         m_isResetViewPending = true;
01365         PostMessage(WM_RESETVIEW);
01366     }
01367 }
01368
01369 LRESULT CWinCvsBrowser::OnResetView(WPARAM, LPARAM)
01370 {
01371     ResetView(true, false);
01372     return 0;
01373 }
Generated on Sun Feb 24 01:21:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/WinCvsBrowser.h Source File

WinCvs/WinCvsBrowser.h

Go to the documentation of this file.
00001 #if !defined(AFX_WINCVSBROWSER_H__144A4971_CAB4_11D1_BC80_000000000000__INCLUDED_)
00002 #define AFX_WINCVSBROWSER_H__144A4971_CAB4_11D1_BC80_000000000000__INCLUDED_
00003
00004 #if _MSC_VER >= 1000
00005 #pragma once
00006 #endif // _MSC_VER >= 1000
00007 // WinCvsBrowser.h : header file
00008 //
00009
00010 #include <afxcview.h>
00011 #include "CPStr.h"
00012
00014 // CWinCvsBrowser view
00015
00016 class CWinCvsBrowser : public CTreeView
00017 {
00018 // associated classes
00019 public:
00020     // ensures selection notification is properly issued
00021     class CSelectionChangeNotifier
00022     {
00023     // Attributes
00024     protected:
00025         bool m_notify;
00026         // if true, the object will issue proper selection notification when going out of scope
00027
00028         bool m_wasLocked;
00029         // tells if the view was already locked at the time of initialization
00030
00031         CWinCvsBrowser* m_view;
00032         // the view to change the state
00033
00034     // Construction
00035     public:
00036         // constructor can be configured either to issue notification or discard it
00037         CSelectionChangeNotifier(CWinCvsBrowser* view, bool notify)
00038         : m_notify(notify)
00039         , m_view(view)
00040         , m_wasLocked(view->m_isSelectionNotificationLocked)
00041         {
00042             if (!m_wasLocked)
00043             {
00044                 m_view->m_isSelectionChanged = false;
00045                 m_view->m_isSelectionNotificationLocked = true;
00046             }
00047         }
00048
00049         ~CSelectionChangeNotifier()
00050         {
00051             m_view->m_isSelectionNotificationLocked = m_wasLocked;
00052             if (!m_wasLocked)
00053             {
00054                 if (m_notify)
00055                 {
00056                     m_view->NotifySelectionChange();
00057                 }
00058                 m_view->m_isSelectionChanged = false;
00059             }
00060         }
00061     };
00062     friend CSelectionChangeNotifier;
00063
00064 protected:
00065     CWinCvsBrowser();           // protected constructor used by dynamic creation
00066     DECLARE_DYNCREATE(CWinCvsBrowser)
00067
00068 // Attributes
00069 protected:
00070
00071     bool m_isSelectionNotificationLocked;
00072     // tells if propagating selection changes is currently locked out
00073
00074     bool m_isSelectionChanged;
00075     // flag to tell if selection indeed changed since was set to true
00076     // valid if m_isSelectionNotificationLocked is true
00077
00078     bool m_isResetViewPending;
00079     // tells if request to rebuild the view is pending
00080
00081 // Operations
00082 public:
00083
00084     void NotifySelectionChange();
00085     // isues notification on selected item change
00086
00087
00088     void SetNewStyle(long lStyleMask, BOOL bSetBits);
00089
00090     void DeleteAllItems(HTREEITEM root = 0L);
00091         // used when resetting and take care about our item data
00092         // if root != 0L : delete all childs of root (except root)
00093         // if root == 0L : delete all
00094
00095     void ResetBrowser(const char *path, bool notifyView = false);
00096         // set the browser root path.
00097
00098     void RetrievePath(HTREEITEM item, CStr & path);
00099         // given an item of the tree, guess the full path.
00100
00101     bool StepToLocation(const char *path, bool notifyView = false);
00102         // expand and select the path and optionally synchronize the
00103         // file view.
00104         // return true if success, false if error
00105
00106     void ResetView(bool forceReload = false, bool notifyView = false);
00107         // force reload or check modifications before redrawing
00108         // and optionally synchronize the file view.
00109
00110     inline const char *GetRoot(void) const { return m_root; }
00111
00112     void OnIgnoreChanged();
00113
00114 // Overrides
00115     // ClassWizard generated virtual function overrides
00116     //{{AFX_VIRTUAL(CWinCvsBrowser)
00117     public:
00118     virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
00119     virtual void OnInitialUpdate();
00120     protected:
00121     virtual void OnDraw(CDC* pDC);      // overridden to draw this view
00122     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00123     //}}AFX_VIRTUAL
00124
00125 // Implementation
00126 protected:
00127     CStr m_root;
00128         // current path of the browser
00129     static CImageList m_Imagelist;
00130         // several folders aspects
00131
00132     void StoreExpanded(std::vector<CStr> & allExpanded, HTREEITEM root = 0L);
00133     bool DisableCommon();
00134
00135     HTREEITEM GetItemByLocation(const char *path);
00136
00137     virtual ~CWinCvsBrowser();
00138     void OnUpdateCmd(CCmdUI* pCmdUI, BOOL needCvsInfos);
00139 #ifdef _DEBUG
00140     virtual void AssertValid() const;
00141     virtual void Dump(CDumpContext& dc) const;
00142 #endif
00143
00144     // Generated message map functions
00145 protected:
00146     //{{AFX_MSG(CWinCvsBrowser)
00147     afx_msg void OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult);
00148     afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00149     afx_msg void OnSelchanging(NMHDR* pNMHDR, LRESULT* pResult);
00150     afx_msg void OnUpdateViewAdd(CCmdUI* pCmdUI);
00151     afx_msg void OnUpdateViewUpdate(CCmdUI* pCmdUI);
00152     afx_msg void OnViewAdd();
00153     afx_msg void OnViewCommit();
00154     afx_msg void OnViewUpdate();
00155     afx_msg void OnViewQueryUpdate();
00156     afx_msg void OnViewDiff();
00157     afx_msg void OnViewLog();
00158     afx_msg void OnViewStatus();
00159     afx_msg void OnViewUnlock();
00160     afx_msg void OnViewWatchOn();
00161     afx_msg void OnViewWatchOff();
00162     afx_msg void OnViewEdit();
00163     afx_msg void OnViewUnedit();
00164     afx_msg void OnViewWatchers();
00165     afx_msg void OnViewEditors();
00166     afx_msg void OnViewRelease();
00167     afx_msg void OnViewTagNew();
00168     afx_msg void OnViewTagDelete();
00169     afx_msg void OnViewTagBranch();
00170     afx_msg void OnViewExplore();
00171     afx_msg void OnUpdateViewExplore(CCmdUI* pCmdUI);
00172     afx_msg void OnUpdateViewReload(CCmdUI* pCmdUI);
00173     afx_msg void OnViewReload();
00174     afx_msg void OnViewCheckout();
00175     afx_msg void OnUpdateViewCheckout(CCmdUI* pCmdUI);
00176     afx_msg void OnViewImport();
00177     afx_msg void OnUpdateViewImport(CCmdUI* pCmdUI);
00178     afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
00179     afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
00180     afx_msg void OnDestroy();
00181     afx_msg void OnViewReservededit();
00182     afx_msg void OnViewForceedit();
00183     //}}AFX_MSG
00184     afx_msg void OnUpdateMacro(CCmdUI* pCmdUI);
00185     afx_msg BOOL OnMacro(UINT nID);
00186     afx_msg void OnUpdateCustomize(CCmdUI* pCmdUI);
00187     afx_msg BOOL OnCustomize(UINT nID);
00188     afx_msg LRESULT OnResetView(WPARAM, LPARAM);
00189
00190     DECLARE_MESSAGE_MAP()
00191 };
00192
00194
00195 //{{AFX_INSERT_LOCATION}}
00196 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00197
00198 #endif // !defined(AFX_WINCVSBROWSER_H__144A4971_CAB4_11D1_BC80_000000000000__INCLUDED_)
Generated on Sun Feb 24 01:21:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/WinCvsDebug.cpp Source File

WinCvs/WinCvsDebug.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jonathan M. Gilligan <jonathan.gilligan@vanderbilt.edu> --- July 2001
00019  */
00020
00021 /*
00022  * WinCvsDebug.cpp --- Miscellaneous debugging stuff.
00023  */
00024
00025 #include "stdafx.h"
00026 #include "WinCvsDebug.h"
00027
00028 namespace
00029 {
00030     unsigned long wincvs_debug_mask = 0L;
00031 }
00032
00033 unsigned long GetWinCvsDebugMask(bool clear_mask)
00034 {
00035     unsigned long retval = wincvs_debug_mask;
00036     if ( clear_mask && (wincvs_debug_mask & wcvsdbg_one_shot) )
00037         wincvs_debug_mask = wcvsdbg_one_shot;
00038     return retval;
00039 }
00040
00041 void SetWinCvsDebugMask(unsigned long umask)
00042 {
00043     wincvs_debug_mask = umask;
00044 }
00045
00046 void AppendWinCvsDebugMask(unsigned long umask)
00047 {
00048     wincvs_debug_mask = wincvs_debug_mask | umask;
00049 }
00050
00051 void SetWinCvsDebugMaskBit(unsigned char bit, bool val)
00052 {
00053     if (bit > sizeof(wincvs_debug_mask) * 8)
00054     {
00055         return;
00056     }
00057     if (val)
00058     {
00059         wincvs_debug_mask = wincvs_debug_mask | 1 << bit;
00060     }
00061     else
00062     {
00063         wincvs_debug_mask = wincvs_debug_mask & ~(1 << bit);
00064     }
00065 }
00066
00067 bool GetWinCvsDebugMaskBit(unsigned char bit, bool clear_mask)
00068 {
00069     bool retval = (wincvs_debug_mask & (1 << bit)) != 0;
00070     if ( clear_mask && (wincvs_debug_mask & wcvsdbg_one_shot) && (bit != wcvsdbg_one_shot_bit) )
00071     {
00072         wincvs_debug_mask = wincvs_debug_mask & ~(1 << bit);
00073     }
00074     return retval;
00075 }
Generated on Sun Feb 24 01:21:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/WinCvsDebug.h Source File

WinCvs/WinCvsDebug.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jonathan M. Gilligan <jonathan.gilligan@vanderbilt.edu> --- July 2001
00019  */
00020
00021 /*
00022  * WinCvsDebug.h --- Miscellaneous debugging stuff.
00023  */
00024
00025 #pragma once
00026 #if !defined(WINCVSDEBUG_H_INCLUDED)
00027 #define WINCVSDEBUG_H_INCLUDED
00028
00029 enum wcvs_debug_mask_bits
00030 {
00031     wcvsdbg_one_shot_bit = 0,
00032     wcvsdbg_verbose_bit,
00033     wcvsdbg_trace_dst_checks_bit,
00034     wcvsdbg_trace_modified_checks_bit,
00035     wcvsdbg_trace_stat_bit
00036 };
00037
00038 enum wcvs_debug_mask_flags
00039 {
00040     wcvsdbg_one_shot = 1L << wcvsdbg_one_shot_bit,
00041     wcvsdbg_verbose = 1L << wcvsdbg_verbose_bit,
00042     wcvsdbg_trace_dst_checks = 1L << wcvsdbg_trace_dst_checks_bit,
00043     wcvsdbg_trace_modified_checks = 1L << wcvsdbg_trace_modified_checks_bit,
00044     wcvsdbg_trace_stat = 1L << wcvsdbg_trace_stat_bit
00045 };
00046
00047 unsigned long GetWinCvsDebugMask(bool clear_mask = true);
00048 bool GetWinCvsDebugMaskBit(unsigned char bit, bool clear_mask = true);
00049
00050 void SetWinCvsDebugMask(unsigned long umask);
00051 void AppendWinCvsDebugMask(unsigned long umask);
00052 void SetWinCvsDebugMaskBit(unsigned char bit, bool val);
00053
00054 #endif  // !defined(WINCVSDEBUG_H_INCLUDED)
Generated on Sun Feb 24 01:21:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/wincvsDoc.cpp Source File

WinCvs/wincvsDoc.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 // wincvsDoc.cpp : implementation of the CWincvsDoc class
00022 //
00023
00024 #include "stdafx.h"
00025 #include "wincvs.h"
00026 #include <afxrich.h>
00027
00028 #include "wincvsDoc.h"
00029 #include "CvsCommands.h"
00030 #include "GetPrefs.h"
00031 #include "Authen.h"
00032 #include "CvsPrefs.h"
00033 #include "AppConsole.h"
00034 #include "PromptFiles.h"
00035 #include "WinCvsBrowser.h"
00036 #include "TclGlue.h"
00037 #include "PythonGlue.h"
00038 #include "MacrosSetup.h"
00039 #include "cvsgui_process.h"
00040
00041 #ifdef _DEBUG
00042 #define new DEBUG_NEW
00043 #undef THIS_FILE
00044 static char THIS_FILE[] = __FILE__;
00045 #endif
00046
00048 // CWincvsDoc
00049
00050 IMPLEMENT_DYNCREATE(CWincvsDoc, CDocument)
00051
00052 BEGIN_MESSAGE_MAP(CWincvsDoc, CDocument)
00053     //{{AFX_MSG_MAP(CWincvsDoc)
00054     ON_COMMAND(ID_APP_PREFERENCES, OnAppPreferences)
00055     ON_COMMAND(ID_APP_RTAGCREATE, OnAppRtagNew)
00056     ON_COMMAND(ID_APP_RTAGDELETE, OnAppRtagDelete)
00057     ON_COMMAND(ID_APP_RTAGBRANCH, OnAppRtagBranch)
00058     ON_COMMAND(ID_APP_CMDLINE, OnAppCmdline)
00059     ON_UPDATE_COMMAND_UI(ID_APP_RTAGCREATE, OnUpdateCvsCmd)
00060     ON_UPDATE_COMMAND_UI(ID_APP_PREFERENCES, OnUpdatePrefs)
00061     ON_COMMAND(ID_STOPCVS, OnStopcvs)
00062     ON_UPDATE_COMMAND_UI(ID_STOPCVS, OnUpdateStopcvs)
00063     ON_COMMAND(ID_BROWSER_OPEN, OnBrowserOpen)
00064     ON_COMMAND(ID_APP_LOGIN, OnAppLogin)
00065 //  ON_UPDATE_COMMAND_UI(ID_MACRO_ADMIN, OnUpdateMacroAdmin)
00066     ON_COMMAND(ID_APP_LOGOUT, OnAppLogout)
00067     ON_COMMAND(ID_VIEW_INIT, OnViewInit)
00068     ON_COMMAND(ID_SAVESETTINGS, OnSavesettings)
00069     ON_UPDATE_COMMAND_UI(ID_SAVESETTINGS, OnUpdateSavesettings)
00070     ON_COMMAND(ID_VIEW_BROWSELOCATION_REMOVEUNWANTED, OnViewBrowselocationRemoveunwanted)
00071     ON_UPDATE_COMMAND_UI(ID_VIEW_INIT, OnUpdateCvsCmd)
00072     ON_UPDATE_COMMAND_UI(ID_APP_RTAGDELETE, OnUpdateCvsCmd)
00073     ON_UPDATE_COMMAND_UI(ID_APP_RTAGBRANCH, OnUpdateCvsCmd)
00074     ON_UPDATE_COMMAND_UI(ID_APP_CMDLINE, OnUpdateCvsCmd)
00075     ON_UPDATE_COMMAND_UI(ID_APP_LOGIN, OnUpdateCvsCmd)
00076     ON_UPDATE_COMMAND_UI(ID_BROWSER_OPEN, OnUpdateCvsCmd)
00077     ON_UPDATE_COMMAND_UI(ID_APP_LOGOUT, OnUpdateCvsCmd)
00078     ON_UPDATE_COMMAND_UI(ID_VIEW_BROWSELOCATION_REMOVEUNWANTED, OnUpdateCvsCmd)
00079     ON_COMMAND(ID_USE_PYSHELL, OnUsePyshell)
00080     ON_UPDATE_COMMAND_UI(ID_USE_PYSHELL, OnUpdateUsePyshell)
00081     ON_COMMAND(ID_USE_TCLSHELL, OnUseTclshell)
00082     ON_UPDATE_COMMAND_UI(ID_USE_TCLSHELL, OnUpdateUseTclshell)
00083     //}}AFX_MSG_MAP
00084     // Enable default OLE container implementation
00085     //ON_UPDATE_COMMAND_UI(ID_EDIT_PASTE, CDocument::OnUpdatePasteMenu)
00086 //  ON_COMMAND_EX_RANGE(ID_MACRO_ADMIN, ID_MACRO_ADMIN + 99, OnMacroAdmin)
00087     ON_COMMAND(ID_FILE_SEND_MAIL, OnFileSendMail)
00088     ON_UPDATE_COMMAND_UI(ID_FILE_SEND_MAIL, OnUpdateFileSendMail)
00089 END_MESSAGE_MAP()
00090
00091 BEGIN_DISPATCH_MAP(CWincvsDoc, CDocument)
00092     //{{AFX_DISPATCH_MAP(CWincvsDoc)
00093     DISP_PROPERTY_NOTIFY(CWincvsDoc, "ViewPath", m_viewPath, OnViewPathChanged, VT_BSTR)
00094     //}}AFX_DISPATCH_MAP
00095 END_DISPATCH_MAP()
00096
00097 // Note: we add support for IID_IWincvs to support typesafe binding
00098 //  from VBA.  This IID must match the GUID that is attached to the
00099 //  dispinterface in the .ODL file.
00100
00101 // {D2D77DC4-8299-11D1-8949-444553540000}
00102 static const IID IID_IWincvs =
00103 { 0xd2d77dc4, 0x8299, 0x11d1, { 0x89, 0x49, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0 } };
00104
00105 BEGIN_INTERFACE_MAP(CWincvsDoc, CDocument)
00106     INTERFACE_PART(CWincvsDoc, IID_IWincvs, Dispatch)
00107 END_INTERFACE_MAP()
00108
00110 // CWincvsDoc construction/destruction
00111
00112 CWincvsDoc::CWincvsDoc()
00113 {
00114     // Use OLE compound files
00115     //EnableCompoundFile();
00116
00117     // TODO: add one-time construction code here
00118
00119     //EnableAutomation();
00120
00121     //AfxOleLockApp();
00122 }
00123
00124 CWincvsDoc::~CWincvsDoc()
00125 {
00126     //AfxOleUnlockApp();
00127 }
00128
00129 //CRichEditCntrItem* CWincvsDoc::CreateClientItem(REOBJECT* preo) const
00130 //{
00131 //  return new CRichEditCntrItem(preo, (CRichEditDoc *)this);
00132 //}
00133
00134 BOOL CWincvsDoc::OnNewDocument()
00135 {
00136     if (!CDocument::OnNewDocument())
00137         return FALSE;
00138
00139     return TRUE;
00140 }
00141
00142
00143
00145 // CWincvsDoc serialization
00146
00147 class _afxRichEditCookie
00148 {
00149 public:
00150     CArchive& m_ar;
00151     DWORD m_dwError;
00152     _afxRichEditCookie(CArchive& ar) : m_ar(ar) {m_dwError=0;}
00153 };
00154
00155 // return 0 for no error, otherwise return error code
00156 extern "C" DWORD CALLBACK EditStreamCallBack(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
00157 {
00158     _afxRichEditCookie* pCookie = (_afxRichEditCookie*)dwCookie;
00159     CArchive& ar = pCookie->m_ar;
00160     ar.Flush();
00161     DWORD dw = 0;
00162     *pcb = cb;
00163     TRY
00164     {
00165         if (ar.IsStoring())
00166             ar.GetFile()->WriteHuge(pbBuff, cb);
00167         else
00168             *pcb = ar.GetFile()->ReadHuge(pbBuff, cb);
00169     }
00170     CATCH(CFileException, e)
00171     {
00172         *pcb = 0;
00173         pCookie->m_dwError = (DWORD)e->m_cause;
00174         dw = 1;
00175     }
00176     AND_CATCH_ALL(e)
00177     {
00178         *pcb = 0;
00179         pCookie->m_dwError = (DWORD)CFileException::generic;
00180         dw = 1;
00181     }
00182     END_CATCH_ALL
00183     return dw;
00184 }
00185
00186 void CWincvsDoc::Serialize(CArchive& ar)
00187 {
00188     if (ar.IsStoring())
00189     {
00190         POSITION pos = GetFirstViewPosition();
00191         CView* view;
00192         while((view = GetNextView(pos)) != NULL)
00193         {
00194             if(view->IsKindOf(RUNTIME_CLASS(CRichEditView)))
00195             {
00196                 int nFormat = SF_TEXT;
00197                 EDITSTREAM es = {0, 0, (EDITSTREAMCALLBACK)EditStreamCallBack};
00198                 _afxRichEditCookie cookie(ar);
00199                 es.dwCookie = (DWORD)&cookie;
00200                 ((CRichEditView *)view)->GetRichEditCtrl().StreamOut(nFormat, es);
00201                 break;
00202             }
00203         }
00204     }
00205     else
00206     {
00207         // We don't load right now
00208     }
00209
00210     // Calling the base class CDocument enables serialization
00211     //  of the container document's COleClientItem objects.
00212     // (but we don't have COleClientItem)
00213     CDocument::Serialize(ar);
00214 }
00215
00217 // CWincvsDoc diagnostics
00218
00219 #ifdef _DEBUG
00220 void CWincvsDoc::AssertValid() const
00221 {
00222     CDocument::AssertValid();
00223 }
00224
00225 void CWincvsDoc::Dump(CDumpContext& dc) const
00226 {
00227     CDocument::Dump(dc);
00228 }
00229 #endif //_DEBUG
00230
00232 // CWincvsDoc commands
00233
00234
00235 void CWincvsDoc::OnAppPreferences()
00236 {
00237     CompatGetPrefs();
00238 }
00239
00240 void CWincvsDoc::OnAppCmdline()
00241 {
00242     CvsCmdLine();
00243 }
00244
00245 void CWincvsDoc::OnAppLogin()
00246 {
00247     CvsCmdLogin();
00248 }
00249
00250 void CWincvsDoc::OnUpdateCvsCmd(CCmdUI* pCmdUI)
00251 {
00252     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00253     pCmdUI->Enable(app->gCvsRunning || gCvsPrefs.empty() ? FALSE : TRUE);
00254 }
00255
00256 void CWincvsDoc::OnUpdatePrefs(CCmdUI* pCmdUI)
00257 {
00258     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00259     pCmdUI->Enable(app->gCvsRunning ? FALSE : TRUE);
00260 }
00261
00262 void CWincvsDoc::OnStopcvs()
00263 {
00264     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00265     app->gCvsStopping = true;
00266     cvs_process_kill(app->gCvsProcess);
00267     cvs_out("*****CVS stopped on user request !!! *****\n\n");
00268 }
00269
00270 void CWincvsDoc::OnUpdateStopcvs(CCmdUI* pCmdUI)
00271 {
00272     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00273     pCmdUI->Enable(app->gCvsRunning && !app->gCvsStopping ? TRUE : FALSE);
00274 }
00275
00276 void CWincvsDoc::OnBrowserOpen()
00277 {
00278     const char *newPath =
00279         BrowserGetDirectory("Select a folder to open with the browser");
00280     if(newPath == 0L)
00281         return;
00282
00283     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00284     app->GetBrowserView()->ResetBrowser(newPath, true);
00285 }
00286
00287 void CWincvsDoc::OnViewPathChanged()
00288 {
00289     // TODO: Add notification handler code
00290
00291 }
00292
00293 void CWincvsDoc::OnAppRtagNew()
00294 {
00295     CvsCmdRtagCreate();
00296 }
00297
00298 void CWincvsDoc::OnAppRtagDelete()
00299 {
00300     CvsCmdRtagDelete();
00301 }
00302
00303 void CWincvsDoc::OnAppRtagBranch()
00304 {
00305     CvsCmdRtagBranch();
00306 }
00307
00308 BOOL CWincvsDoc::OnMacroAdmin(UINT nID)
00309 {
00310     CMacroEntry & entry = gMacrosAdmin.entries[nID - ID_MACRO_ADMIN];
00311     CvsCmdMacrosAdmin(entry.path);
00312
00313     return 1;
00314 }
00315
00316 void CWincvsDoc::OnUpdateMacroAdmin(CCmdUI* pCmdUI)
00317 {
00318     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00319     if(app->gCvsRunning || gCvsPrefs.empty() || !CTcl_Interp::IsAvail())
00320     {
00321         pCmdUI->Enable(FALSE);
00322         return;
00323     }
00324
00325     if(pCmdUI->m_pSubMenu != 0L || pCmdUI->m_pMenu == 0L)
00326         return;
00327
00328     int iMRUMax = pCmdUI->m_pMenu->GetMenuItemCount();
00329     for (int iMRU = 0; iMRU < iMRUMax; iMRU++)
00330         pCmdUI->m_pMenu->DeleteMenu(pCmdUI->m_nID + iMRU, MF_BYCOMMAND);
00331
00332     vector<CMacroEntry>::const_iterator i;
00333     for(i = gMacrosAdmin.entries.begin(); i != gMacrosAdmin.entries.end(); ++i)
00334     {
00335         pCmdUI->m_pMenu->InsertMenu(pCmdUI->m_nIndex++,
00336             MF_STRING | MF_BYPOSITION, pCmdUI->m_nID++,
00337             (*i).name);
00338     }
00339
00340     pCmdUI->m_nIndexMax = pCmdUI->m_pMenu->GetMenuItemCount();
00341     pCmdUI->m_nIndex--; // point to last menu added
00342     pCmdUI->m_bEnableChanged = TRUE;    // all the added items are enabled
00343 }
00344
00345 void CWincvsDoc::OnAppLogout()
00346 {
00347     CvsCmdLogout();
00348 }
00349
00350 void CWincvsDoc::OnViewInit()
00351 {
00352     CvsCmdInit();
00353 }
00354
00355 void CWincvsDoc::OnSavesettings()
00356 {
00357     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00358     AskCreatePersistentSettings(app->GetBrowserView()->GetRoot());
00359 }
00360
00361 void CWincvsDoc::OnUpdateSavesettings(CCmdUI* pCmdUI)
00362 {
00363     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00364     pCmdUI->Enable(!app->gCvsRunning && !gCvsPrefs.empty());
00365 }
00366
00367 void CWincvsDoc::OnViewBrowselocationRemoveunwanted()
00368 {
00369     AfxMessageBox("To remove the unwanted location history items click DEL key when selecting from the combo box list.", MB_OK | MB_ICONINFORMATION);
00370 }
00371
00372 void CWincvsDoc::OnUsePyshell()
00373 {
00374     gCvsPrefs.SetUseShell(SHELL_PYTHON);
00375     cvs_out("Switching the shell to Python...\n");
00376 }
00377
00378 void CWincvsDoc::OnUpdateUsePyshell(CCmdUI* pCmdUI)
00379 {
00380     pCmdUI->Enable(CPython_Interp::IsAvail());
00381     pCmdUI->SetRadio(gCvsPrefs.GetUseShell() == SHELL_PYTHON);
00382 }
00383
00384 void CWincvsDoc::OnUseTclshell()
00385 {
00386     gCvsPrefs.SetUseShell(SHELL_TCL);
00387     cvs_out("Switching the shell to TCL...\n");
00388 }
00389
00390 void CWincvsDoc::OnUpdateUseTclshell(CCmdUI* pCmdUI)
00391 {
00392     pCmdUI->Enable(CTcl_Interp::IsAvail());
00393     pCmdUI->SetRadio(gCvsPrefs.GetUseShell() == SHELL_TCL);
00394 }
Generated on Sun Feb 24 01:21:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/wincvsDoc.h Source File

WinCvs/wincvsDoc.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 // wincvsDoc.h : interface of the CWincvsDoc class
00022 //
00024
00025 #if !defined(AFX_WINCVSDOC_H__D2D77DCE_8299_11D1_8949_444553540000__INCLUDED_)
00026 #define AFX_WINCVSDOC_H__D2D77DCE_8299_11D1_8949_444553540000__INCLUDED_
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif // _MSC_VER >= 1000
00031
00032 class CWincvsDoc : public CDocument
00033 {
00034 public:
00035     DECLARE_DYNCREATE(CWincvsDoc)
00036
00037 // Attributes
00038     CWincvsDoc();
00039
00040     //virtual CRichEditCntrItem* CreateClientItem(REOBJECT* preo = NULL) const;
00041
00042     // Operations
00043 public:
00044
00045 // Overrides
00046     // ClassWizard generated virtual function overrides
00047     //{{AFX_VIRTUAL(CWincvsDoc)
00048     public:
00049     virtual BOOL OnNewDocument();
00050     virtual void Serialize(CArchive& ar);
00051     //}}AFX_VIRTUAL
00052
00053 // Implementation
00054 public:
00055     virtual ~CWincvsDoc();
00056 #ifdef _DEBUG
00057     virtual void AssertValid() const;
00058     virtual void Dump(CDumpContext& dc) const;
00059 #endif
00060
00061 protected:
00062
00063 // Generated message map functions
00064 protected:
00065     //{{AFX_MSG(CWincvsDoc)
00066     afx_msg void OnAppPreferences();
00067     afx_msg void OnAppRtagNew();
00068     afx_msg void OnAppRtagDelete();
00069     afx_msg void OnAppRtagBranch();
00070     afx_msg void OnAppCmdline();
00071     afx_msg void OnUpdateCvsCmd(CCmdUI* pCmdUI);
00072     afx_msg void OnUpdatePrefs(CCmdUI* pCmdUI);
00073     afx_msg void OnStopcvs();
00074     afx_msg void OnUpdateStopcvs(CCmdUI* pCmdUI);
00075     afx_msg void OnBrowserOpen();
00076     afx_msg void OnAppLogin();
00077     afx_msg BOOL OnMacroAdmin(UINT nID);
00078     afx_msg void OnUpdateMacroAdmin(CCmdUI* pCmdUI);
00079     afx_msg void OnAppLogout();
00080     afx_msg void OnViewInit();
00081     afx_msg void OnSavesettings();
00082     afx_msg void OnUpdateSavesettings(CCmdUI* pCmdUI);
00083     afx_msg void OnViewBrowselocationRemoveunwanted();
00084     afx_msg void OnUsePyshell();
00085     afx_msg void OnUpdateUsePyshell(CCmdUI* pCmdUI);
00086     afx_msg void OnUseTclshell();
00087     afx_msg void OnUpdateUseTclshell(CCmdUI* pCmdUI);
00088     //}}AFX_MSG
00089     DECLARE_MESSAGE_MAP()
00090
00091     // Generated OLE dispatch map functions
00092     //{{AFX_DISPATCH(CWincvsDoc)
00093     CString m_viewPath;
00094     afx_msg void OnViewPathChanged();
00095     //}}AFX_DISPATCH
00096     DECLARE_DISPATCH_MAP()
00097     DECLARE_INTERFACE_MAP()
00098 };
00099
00101
00102 //{{AFX_INSERT_LOCATION}}
00103 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00104
00105 #endif // !defined(AFX_WINCVSDOC_H__D2D77DCE_8299_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/wincvsView.cpp Source File

WinCvs/wincvsView.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 // wincvsView.cpp : implementation of the CWincvsView class
00022 //
00023
00024 #include "stdafx.h"
00025 #include <atlconv.h>
00026 #include "wincvs.h"
00027 #include "wincvsDoc.h"
00028 #include "wincvsView.h"
00029 #include "wincvs_winutil.h"
00030 #include "MainFrm.h"
00031
00032 #include "Persistent.h"
00033 #include "CvsPrefs.h"
00034 #include "AppGlue.h"
00035 #include "TclGlue.h"
00036 #include "PythonGlue.h"
00037
00038 #ifdef _DEBUG
00039 #define new DEBUG_NEW
00040 #undef THIS_FILE
00041 static char THIS_FILE[] = __FILE__;
00042 #endif
00043
00044 // critical section to protect while accessing MFC from cvs
00045 CRITICAL_SECTION CCvsThreadLock::m_lock;
00046
00047 class CCharFormat : public CHARFORMAT
00048 {
00049 public:
00050     CCharFormat()
00051     {
00052         USES_CONVERSION;
00053         CString strDefFont = _T("Courier New");
00054         //VERIFY(strDefFont.LoadString(IDS_DEFFONT));
00055         cbSize = sizeof(CHARFORMAT);
00056         dwMask = CFM_BOLD|CFM_ITALIC|CFM_UNDERLINE|CFM_STRIKEOUT|CFM_SIZE|
00057             CFM_COLOR|CFM_OFFSET|CFM_PROTECTED;
00058         dwEffects = CFE_AUTOCOLOR;
00059         yHeight = 200; //10pt
00060         yOffset = 0;
00061         crTextColor = RGB(0, 0, 0);
00062         bCharSet = 0;
00063         bPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
00064         ASSERT(strDefFont.GetLength() < LF_FACESIZE);
00065         lstrcpynA(szFaceName, T2A((LPTSTR) (LPCTSTR) strDefFont), LF_FACESIZE);
00066         dwMask |= CFM_FACE;
00067     }
00068     CCharFormat(const CHARFORMAT &newf)
00069     {
00070         *(CHARFORMAT *)this = newf;
00071     }
00072     inline operator CHARFORMAT &()
00073     {
00074         return *(CHARFORMAT *)this;
00075     }
00076 };
00077
00078 static CPersistentT<CCharFormat> gViewFont("P_ViewFont", CCharFormat(), kNoClass);
00079
00081 // CWincvsView
00082
00083 IMPLEMENT_DYNCREATE(CWincvsView, CRichEditView)
00084
00085 BEGIN_MESSAGE_MAP(CWincvsView, CRichEditView)
00086     //{{AFX_MSG_MAP(CWincvsView)
00087     ON_WM_DESTROY()
00088     ON_WM_SETFOCUS()
00089     ON_WM_SIZE()
00090     ON_COMMAND(ID_FORMAT_FONT, OnMyFormatFont)
00091     ON_WM_KEYDOWN()
00092     ON_WM_DROPFILES()
00093     ON_COMMAND(ID_EDIT_CLEAR_ALL, OnEditClearAll)
00094     ON_WM_RBUTTONDOWN()
00095     ON_WM_GETDLGCODE()
00096     //}}AFX_MSG_MAP
00097     // Standard printing commands
00098     ON_COMMAND(ID_FILE_PRINT, CRichEditView::OnFilePrint)
00099     ON_COMMAND(ID_FILE_PRINT_DIRECT, CRichEditView::OnFilePrint)
00100     ON_COMMAND(ID_FILE_PRINT_PREVIEW, CRichEditView::OnFilePrintPreview)
00101 END_MESSAGE_MAP()
00102
00104 // CWincvsView construction/destruction
00105
00106 char *CWincvsView::sbuf = 0L;
00107 int CWincvsView::snumbuf = 0;
00108
00109 CWincvsView::CWincvsView()
00110 {
00111     fRtfFormat = ::RegisterClipboardFormat(_T("Rich Text Format"));
00112 }
00113
00114 CWincvsView::~CWincvsView()
00115 {
00116     snumbuf = 0;
00117     if(sbuf != 0L)
00118     {
00119         free(sbuf);
00120         sbuf = 0L;
00121     }
00122     PyInvalUICache();
00123     CPython_Interp::ClosePythonSupport();
00124 }
00125
00126 BOOL CWincvsView::PreCreateWindow(CREATESTRUCT& cs)
00127 {
00128     // TODO: Modify the Window class or styles here by modifying
00129     //  the CREATESTRUCT cs
00130
00131     BOOL bRet = CRichEditView::PreCreateWindow(cs);
00132     cs.style |= WS_TABSTOP | ES_MULTILINE;
00133     return  bRet;
00134 }
00135
00137 // CWincvsView drawing
00138
00139 void CWincvsView::OnDraw(CDC* pDC)
00140 {
00141     //CWincvsDoc* pDoc = GetDocument();
00142     //ASSERT_VALID(pDoc);
00143
00144     // TODO: add draw code for native data here
00145     // TODO: also draw all OLE items in the document
00146
00147     // Draw the selection at an arbitrary position.  This code should be
00148     //  removed once your real drawing code is implemented.  This position
00149     //  corresponds exactly to the rectangle returned by CWincvsCntrItem,
00150     //  to give the effect of in-place editing.
00151
00152     // TODO: remove this code when final draw code is complete.
00153
00154     //if (m_pSelection == NULL)
00155     //{
00156     //  POSITION pos = pDoc->GetStartPosition();
00157     //  m_pSelection = (CWincvsCntrItem*)pDoc->GetNextClientItem(pos);
00158     //}
00159     //if (m_pSelection != NULL)
00160     //  m_pSelection->Draw(pDC, CRect(10, 10, 210, 210));
00161 }
00162
00163 void CWincvsView::OnInitialUpdate()
00164 {
00165     CRichEditView::OnInitialUpdate();
00166
00167     CRichEditCtrl& edit = GetRichEditCtrl();
00168     edit.SetSel(0, -1);
00169     SetCharFormat((CCharFormat)gViewFont);
00170     edit.SetSel(-1, -1);
00171
00172     CPython_Interp::InitPythonSupport();
00173 }
00174
00176 // CWincvsView printing
00177
00178 BOOL CWincvsView::OnPreparePrinting(CPrintInfo* pInfo)
00179 {
00180     return DoPreparePrinting(pInfo);
00181     //return CRichEditView::OnPreparePrinting(pInfo);
00182 }
00183
00184 void CWincvsView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
00185 {
00186     // TODO: add extra initialization before printing
00187     CRichEditView::OnBeginPrinting(pDC, pInfo);
00188 }
00189
00190 void CWincvsView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
00191 {
00192     // TODO: add cleanup after printing
00193     CRichEditView::OnEndPrinting(pDC, pInfo);
00194 }
00195
00196 void CWincvsView::OnDestroy()
00197 {
00198     // Deactivate the item on destruction; this is important
00199     // when a splitter view is being used.
00200     CRichEditView::OnDestroy();
00201     //COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
00202     //if (pActiveItem != NULL && pActiveItem->GetActiveView() == this)
00203     //{
00204     //  pActiveItem->Deactivate();
00205     //  ASSERT(GetDocument()->GetInPlaceActiveItem(this) == NULL);
00206     //}
00207 }
00208
00209
00211 // OLE Client support and commands
00212
00213 BOOL CWincvsView::IsSelected(const CObject* pDocItem) const
00214 {
00215     // The implementation below is adequate if your selection consists of
00216     //  only CWincvsCntrItem objects.  To handle different selection
00217     //  mechanisms, the implementation here should be replaced.
00218
00219     // TODO: implement this function that tests for a selected OLE client item
00220
00221     //return pDocItem == m_pSelection;
00222     return CRichEditView::IsSelected(pDocItem);
00223 }
00224
00225 #if 0
00226 // The following command handler provides the standard keyboard
00227 //  user interface to cancel an in-place editing session.  Here,
00228 //  the container (not the server) causes the deactivation.
00229 void CWincvsView::OnCancelEditCntr()
00230 {
00231     // Close any in-place active item on this view.
00232     COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
00233     if (pActiveItem != NULL)
00234     {
00235         pActiveItem->Close();
00236     }
00237     ASSERT(GetDocument()->GetInPlaceActiveItem(this) == NULL);
00238 }
00239 #endif
00240
00241 // Special handling of OnSetFocus and OnSize are required for a container
00242 //  when an object is being edited in-place.
00243 void CWincvsView::OnSetFocus(CWnd* pOldWnd)
00244 {
00245 //  COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
00246 //  if (pActiveItem != NULL &&
00247 //      pActiveItem->GetItemState() == COleClientItem::activeUIState)
00248 //  {
00249         // need to set focus to this item if it is in the same view
00250 //      CWnd* pWnd = pActiveItem->GetInPlaceWindow();
00251 //      if (pWnd != NULL)
00252 //      {
00253 //          pWnd->SetFocus();   // don't call the base class
00254 //          return;
00255 //      }
00256 //  }
00257
00258     CRichEditView::OnSetFocus(pOldWnd);
00259 }
00260
00261 void CWincvsView::OnSize(UINT nType, int cx, int cy)
00262 {
00263     CRichEditView::OnSize(nType, cx, cy);
00264 //  COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
00265 //  if (pActiveItem != NULL)
00266 //      pActiveItem->SetItemRects();
00267 }
00268
00269 void CWincvsView::FeedThisLine(const char *buf, int numbuf, bool isStderr)
00270 {
00271     CRichEditCtrl& edit = GetRichEditCtrl();
00272     edit.SetSel(-1, -1);
00273
00274     CHARFORMAT cf;
00275     cf.cbSize = sizeof(CHARFORMAT);
00276     cf = GetCharFormatSelection();
00277
00278     bool colorChanged = false;
00279     COLORREF oldColor = cf.crTextColor;
00280     DWORD oldEffect = cf.dwEffects;
00281     CString s(buf, numbuf);
00282
00283     if(s.GetLength() >= 5 && s[1] == ' ' &&
00284         (s[0] == 'M' || s[0] == 'C' || s[0] == 'U' ||
00285         s[0] == 'P' || s[0] == 'N' || s[0] == 'A' ||
00286         s[0] == 'R' || s[0] == 'I' || s[0] == '?' ||
00287         s[0] == '<' || s[0] == '>'))
00288     {
00289         colorChanged = true;
00290         switch(s[0])
00291         {
00292         default:
00293         case '?' :
00294         case 'I' :
00295             cf.crTextColor = RGB(0x80, 0x80, 0x00);
00296             break;
00297         case 'U' :
00298         case 'N' :
00299             cf.crTextColor = RGB(0x00, 0xA0, 0x00);
00300             break;
00301         case 'M' :
00302         case 'A' :
00303         case 'R' :
00304             cf.crTextColor = RGB(0xFF, 0x00, 0xFF);
00305             break;
00306         case 'C' :
00307         case '<' :
00308             cf.crTextColor = RGB(0xFF, 0x00, 0x00);
00309             break;
00310         case '>' :
00311         case 'P' :
00312             cf.crTextColor = RGB(0x00, 0x00, 0xFF);
00313             break;
00314         }
00315         cf.dwMask = CFM_COLOR;
00316         cf.dwEffects = 0;
00317         SetCharFormat(cf);
00318     }
00319     else if(isStderr)
00320     {
00321         colorChanged = true;
00322         cf.crTextColor = RGB(0xFF, 0x80, 0x00);
00323         cf.dwMask = CFM_COLOR;
00324         cf.dwEffects = 0;
00325         SetCharFormat(cf);
00326     }
00327
00328     edit.ReplaceSel(s);
00329
00330     if(colorChanged)
00331     {
00332         cf.dwMask = CFM_COLOR;
00333         cf.crTextColor = oldColor;
00334         cf.dwEffects = oldEffect;
00335         SetCharFormat(cf);
00336     }
00337 }
00338
00339 CHARFORMAT CWincvsView::GetCurFormat(bool jumpEnd)
00340 {
00341     CRichEditCtrl& edit = GetRichEditCtrl();
00342     if(jumpEnd)
00343         edit.SetSel(-1, -1);
00344
00345     CHARFORMAT cf;
00346     cf.cbSize = sizeof(CHARFORMAT);
00347     return GetCharFormatSelection();
00348 }
00349
00350 void CWincvsView::OutColor(const char *txt, long len)
00351 {
00352     // synchonize it since the thread calls it
00353     CCvsThreadLock threadLock;
00354
00355     CString s;
00356     for(int i = 0; i < len; i++)
00357     {
00358         char c = *txt++;
00359         if(c == 0x0d || c == 0x0a)
00360         {
00361             s += (char)0x0d;
00362             s += (char)0x0a;
00363             // special case if we got already \r\n
00364             if((i+1) < len && c == 0x0d && txt[0] == 0x0a)
00365                 i++;
00366         }
00367         else
00368             s += c;
00369     }
00370
00371     CRichEditCtrl& edit = GetRichEditCtrl();
00372     edit.ReplaceSel(s);
00373 }
00374
00375 void CWincvsView::OutColor(kConsoleColor color)
00376 {
00377     CCvsThreadLock threadLock;
00378
00379     CRichEditCtrl& edit = GetRichEditCtrl();
00380
00381     CHARFORMAT cf = GetCurFormat(false);
00382     cf.dwEffects = 0;
00383
00384     switch(color)
00385     {
00386         default:
00387             return;
00388             break;
00389         case kBrown :
00390             cf.dwMask = CFM_COLOR;
00391             cf.crTextColor = RGB(0x80, 0x80, 0x00);
00392             break;
00393         case kGreen :
00394             cf.dwMask = CFM_COLOR;
00395             cf.crTextColor = RGB(0x00, 0xA0, 0x00);
00396             break;
00397         case kMagenta :
00398             cf.dwMask = CFM_COLOR;
00399             cf.crTextColor = RGB(0xFF, 0x00, 0xFF);
00400             break;
00401         case kRed :
00402             cf.dwMask = CFM_COLOR;
00403             cf.crTextColor = RGB(0xFF, 0x00, 0x00);
00404             break;
00405         case kBlue :
00406             cf.dwMask = CFM_COLOR;
00407             cf.crTextColor = RGB(0x00, 0x00, 0xFF);
00408             break;
00409         case kBold :
00410             cf.dwMask = CFM_BOLD;
00411             cf.dwEffects = CFE_BOLD;
00412             break;
00413         case kItalic :
00414             cf.dwMask = CFM_ITALIC;
00415             cf.dwEffects = CFE_ITALIC;
00416             break;
00417         case kUnderline :
00418             cf.dwMask = CFM_UNDERLINE;
00419             cf.dwEffects = CFE_UNDERLINE;
00420             break;
00421     }
00422
00423     SetCharFormat(cf);
00424 }
00425
00426 void CWincvsView::OutColor(CHARFORMAT & format)
00427 {
00428     CCvsThreadLock threadLock;
00429
00430     CRichEditCtrl& edit = GetRichEditCtrl();
00431     SetCharFormat(format);
00432 }
00433
00434 void CWincvsView::OutConsole(const char *txt, long len, bool isStderr)
00435 {
00436     // synchonize it since the thread calls it
00437     CCvsThreadLock threadLock;
00438
00439     if(len == 0)
00440         return;
00441
00442     if(sbuf == 0L)
00443     {
00444         sbuf = (char *)malloc((MAX_CHAR_BY_LINE + 3) * sizeof(char));
00445         if(sbuf == 0L)
00446             return;
00447     }
00448
00449     int i = 0;
00450     char c;
00451 once_again:
00452     for(; i < len && snumbuf < MAX_CHAR_BY_LINE; snumbuf++)
00453     {
00454         c = txt[i++];
00455         if(c == 0x0d || c == 0x0a)
00456             break;
00457         sbuf[snumbuf] = c;
00458     }
00459
00460     // special case if we got already \r\n
00461     if(i < len && c == 0x0d && txt[i] == 0x0a)
00462         i++;
00463
00464     if(c == 0x0d || c == 0x0a || snumbuf == MAX_CHAR_BY_LINE)
00465     {
00466         sbuf[snumbuf++] = 0x0d;
00467         sbuf[snumbuf++] = 0x0a;
00468         sbuf[snumbuf++] = 0x00;
00469
00470         FeedThisLine(sbuf, snumbuf, isStderr);
00471         snumbuf = 0;
00472     }
00473
00474     if(i != len)
00475         goto once_again;
00476 }
00477
00479 // CWincvsView diagnostics
00480
00481 #ifdef _DEBUG
00482 void CWincvsView::AssertValid() const
00483 {
00484     CRichEditView::AssertValid();
00485 }
00486
00487 void CWincvsView::Dump(CDumpContext& dc) const
00488 {
00489     CRichEditView::Dump(dc);
00490 }
00491
00492 CWincvsDoc* CWincvsView::GetDocument() // non-debug version is inline
00493 {
00494     ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CWincvsDoc)));
00495     return (CWincvsDoc*)m_pDocument;
00496 }
00497
00498 #endif //_DEBUG
00499
00501 // CWincvsView message handlers
00502
00503 void CWincvsView::OnMyFormatFont()
00504 {
00505     CRichEditCtrl& edit = GetRichEditCtrl();
00506     edit.SetSel(0, -1);
00507     CRichEditView::OnFormatFont();
00508     edit.SetSel(-1, -1);
00509     gViewFont = CCharFormat(GetCharFormatSelection());
00510     gCvsPrefs.save();
00511 }
00512
00513 void CWincvsView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
00514 {
00515     CRichEditView::OnKeyDown(nChar, nRepCnt, nFlags);
00516
00517     if(nChar != VK_RETURN)
00518     {
00519         return;
00520     }
00521
00522     long len = GetTextLength();
00523     if(len == 0)
00524         return;
00525
00526     TCHAR *buf = (char *)malloc((len + 1) * sizeof(TCHAR));
00527     if(buf == 0L)
00528         return;
00529
00530     TEXTRANGE textRange;
00531     textRange.chrg.cpMin = 0;
00532     textRange.chrg.cpMax = len;
00533     textRange.lpstrText = buf;
00534     GetRichEditCtrl().SendMessage(EM_GETTEXTRANGE, 0, (LPARAM)&textRange);
00535
00536     long nStartChar, nEndChar;
00537     GetRichEditCtrl().GetSel(nStartChar, nEndChar);
00538
00539     if (nStartChar == nEndChar) // i.e. there is no selection
00540     {
00541         // get the end and the beginning of the line
00542         if(nStartChar > 0 && buf[nStartChar] == '\r')
00543             nStartChar--;
00544         while(nStartChar > 0 && buf[nStartChar] != '\n' && buf[nStartChar] != '\r')
00545             nStartChar--;
00546         if(buf[nStartChar] == '\n' || buf[nStartChar] == '\r')
00547             nStartChar++;
00548         while(nEndChar < len && buf[nEndChar] != '\n' && buf[nEndChar] != '\r')
00549             nEndChar++;
00550     }
00551
00552     long length = nEndChar - nStartChar;
00553     if(length > 0 && nStartChar < len)
00554     {
00555         OutConsole("\n", 1);
00556         buf[nEndChar] = '\0';
00557         if(gCvsPrefs.GetUseShell() == SHELL_PYTHON && CPython_Interp::IsAvail())
00558         {
00559             CPython_Interp interp;
00560             interp.DoScript(buf + nStartChar);
00561         }
00562         else if(gCvsPrefs.GetUseShell() == SHELL_TCL && CTcl_Interp::IsAvail())
00563         {
00564             CTcl_Interp interp;
00565             interp.DoScript(buf + nStartChar);
00566         }
00567     }
00568
00569     free(buf);
00570 }
00571
00572 HRESULT CWincvsView::QueryAcceptData(LPDATAOBJECT lpdataobj,
00573     CLIPFORMAT* lpcfFormat, DWORD dwReco, BOOL bReally, HGLOBAL hMetaPict)
00574 {
00575     ASSERT(lpcfFormat != NULL);
00576     if (!bReally) // not actually pasting
00577         return S_OK;
00578     // if direct pasting a particular native format allow it
00579     if (IsRichEditFormat(*lpcfFormat))
00580         return S_OK;
00581
00582     COleDataObject dataobj;
00583     dataobj.Attach(lpdataobj, FALSE);
00584     // if format is 0, then force particular formats if available
00585     if (*lpcfFormat == 0 && (m_nPasteType == 0))
00586     {
00587         if (fRtfFormat != 0 && dataobj.IsDataAvailable(fRtfFormat)) // native avail, let richedit do as it wants
00588         {
00589             *lpcfFormat = fRtfFormat;
00590             return S_OK;
00591         }
00592         else if (dataobj.IsDataAvailable(CF_TEXT))
00593         {
00594             *lpcfFormat = CF_TEXT;
00595             return S_OK;
00596         }
00597     }
00598     // *DO NOT* paste OLE formats
00599     // crash reported by Gerhard Möller
00600     //DoPaste(dataobj, *lpcfFormat, hMetaPict);
00601     return S_FALSE;
00602 }
00603
00604 BOOL CWincvsView::CanPaste() const
00605 {
00606     return (CountClipboardFormats() != 0) &&
00607         (IsClipboardFormatAvailable(CF_TEXT) ||
00608         IsClipboardFormatAvailable(fRtfFormat) ||
00609         //IsClipboardFormatAvailable(_oleData.cfEmbedSource) ||
00610         //IsClipboardFormatAvailable(_oleData.cfEmbeddedObject) ||
00611         //IsClipboardFormatAvailable(_oleData.cfFileName) ||
00612         //IsClipboardFormatAvailable(_oleData.cfFileNameW) ||
00613         //IsClipboardFormatAvailable(CF_METAFILEPICT) ||
00614         //IsClipboardFormatAvailable(CF_DIB) ||
00615         //IsClipboardFormatAvailable(CF_BITMAP) ||
00616         GetRichEditCtrl().CanPaste());
00617 }
00618
00619 void CWincvsView::OnDropFiles(HDROP hDropInfo)
00620 {
00621     CWnd* pWnd = AfxGetMainWnd();   //look in InitInstance m_pMainWnd = m_mainFrame;
00622
00623     if( pWnd )
00624     {
00625         CMainFrame* pMainFrame = (CMainFrame*)pWnd;
00626
00627         if( pMainFrame->GetSafeHwnd() != NULL )
00628         {
00629             pMainFrame->DropFiles( hDropInfo );
00630         }
00631     }
00632
00633     //this cause the crash, remove
00634     //CRichEditView::OnDropFiles(hDropInfo);
00635 }
00636
00637 void CWincvsView::OnEditClearAll()
00638 {
00639     CRichEditCtrl& edit = GetRichEditCtrl();
00640     edit.SetSel(0, -1);
00641     edit.ReplaceSel("", TRUE);
00642 }
00643
00644 void CWincvsView::OnRButtonDown(UINT nFlags, CPoint point)
00645 {
00646     CWincvsApp* pApp=static_cast<CWincvsApp*>(AfxGetApp());
00647     CMenu* pSubMenu=::GetSubCMenu(ID_EDIT_UNDO,this);
00648     if (pSubMenu) {
00649         ClientToScreen(&point);
00650         pSubMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON, point.x, point.y, this);
00651     }
00652 //  CRichEditView::OnRButtonDown(nFlags, point);
00653 }
00654
00655 UINT CWincvsView::OnGetDlgCode()
00656 {
00657     LRESULT DlgCode;
00658     DlgCode = CRichEditView::OnGetDlgCode();
00659     if (0x8000 & GetKeyState(VK_TAB))
00660         return  DlgCode & ~(DLGC_WANTTAB | DLGC_WANTALLKEYS | DLGC_WANTCHARS);
00661     else
00662         return DlgCode;
00663 }
Generated on Sun Feb 24 01:21:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/wincvsView.h Source File

WinCvs/wincvsView.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 // wincvsView.h : interface of the CWincvsView class
00022 //
00024
00025 #if !defined(AFX_WINCVSVIEW_H__D2D77DD0_8299_11D1_8949_444553540000__INCLUDED_)
00026 #define AFX_WINCVSVIEW_H__D2D77DD0_8299_11D1_8949_444553540000__INCLUDED_
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif // _MSC_VER >= 1000
00031
00032 #include <afxrich.h>
00033 #include "AppConsole.h"
00034
00035 class CWincvsDoc;
00036
00037 class CCvsThreadLock
00038 {
00039 public:
00040     static CRITICAL_SECTION m_lock;
00041
00042     CCvsThreadLock()
00043     {
00044         EnterCriticalSection(&m_lock);
00045     }
00046     ~CCvsThreadLock()
00047     {
00048         LeaveCriticalSection(&m_lock);
00049     }
00050 };
00051
00052 class CWincvsView : public CRichEditView
00053 {
00054 protected: // create from serialization only
00055     CWincvsView();
00056     DECLARE_DYNCREATE(CWincvsView)
00057
00058 // Attributes
00059 public:
00060     CWincvsDoc* GetDocument();
00061     void OutConsole(const char *txt, long len, bool isStderr = false);
00062         // insert "len" character
00063
00064     void OutColor(const char *txt, long len);
00065     void OutColor(kConsoleColor color);
00066     void OutColor(CHARFORMAT & format);
00067         // colorized output
00068
00069     CHARFORMAT GetCurFormat(bool jumpEnd = true);
00070         // get current format of the text (this call put the cursor
00071         // at the end of the text by default)
00072
00073 // Operations
00074 public:
00075
00076     BOOL CanPaste() const;
00077
00078 // Overrides
00079     // ClassWizard generated virtual function overrides
00080     //{{AFX_VIRTUAL(CWincvsView)
00081     public:
00082     virtual void OnDraw(CDC* pDC);  // overridden to draw this view
00083     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00084     protected:
00085     virtual void OnInitialUpdate(); // called first time after construct
00086     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
00087     virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
00088     virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
00089     virtual BOOL IsSelected(const CObject* pDocItem) const;// Container support
00090     //}}AFX_VIRTUAL
00091
00092 // Implementation
00093 public:
00094     virtual ~CWincvsView();
00095 #ifdef _DEBUG
00096     virtual void AssertValid() const;
00097     virtual void Dump(CDumpContext& dc) const;
00098 #endif
00099
00100 protected:
00101 #   define MAX_CHAR_BY_LINE 1024
00102     static char *sbuf;
00103     static int snumbuf;
00104     UINT fRtfFormat;
00105
00106     void FeedThisLine(const char *buf, int numbuf, bool isStderr);
00107
00108     virtual HRESULT QueryAcceptData(LPDATAOBJECT, CLIPFORMAT*, DWORD,
00109         BOOL, HGLOBAL);
00110
00111 // Generated message map functions
00112 protected:
00113     //{{AFX_MSG(CWincvsView)
00114     afx_msg void OnDestroy();
00115     afx_msg void OnSetFocus(CWnd* pOldWnd);
00116     afx_msg void OnSize(UINT nType, int cx, int cy);
00117     afx_msg void OnMyFormatFont();
00118     afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00119     afx_msg void OnDropFiles(HDROP hDropInfo);
00120     afx_msg void OnEditClearAll();
00121     afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00122     afx_msg UINT OnGetDlgCode();
00123     //}}AFX_MSG
00124     DECLARE_MESSAGE_MAP()
00125 };
00126
00127 #ifndef _DEBUG  // debug version in wincvsView.cpp
00128 inline CWincvsDoc* CWincvsView::GetDocument()
00129    { return (CWincvsDoc*)m_pDocument; }
00130 #endif
00131
00133
00134 //{{AFX_INSERT_LOCATION}}
00135 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00136
00137 #endif // !defined(AFX_WINCVSVIEW_H__D2D77DD0_8299_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJBrowseEdit.cpp Source File

WinCvs/CJLib/CJLibrary/CJBrowseEdit.cpp

Go to the documentation of this file.
00001 // CJBrowseEdit.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:48 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/CJLibrary/CJBrowseEdit.cpp $
00011  *
00012  * $History: CJBrowseEdit.cpp $
00013  *
00014  * *****************  Version 14  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:35p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Modified resource include for static builds.
00018  *
00019  * Fixed potential resource and memory leak problems.
00020  *
00021  * Made class methods virtual for inheritance purposes.
00022  *
00023  * *****************  Version 13  *****************
00024  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00025  * Updated in $/CodeJockey/CJLibrary
00026  * Updated copyright and contact information.
00027  *
00028  * *****************  Version 12  *****************
00029  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00030  * Updated in $/CodeJockey/CJLibrary
00031  * Added Unicode compliance, thanks to Barry Burton for his help with
00032  * this.
00033  *
00034  * *****************  Version 11  *****************
00035  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00036  * Updated in $/CodeJockey/CJLibrary
00037  *
00038  * *****************  Version 10  *****************
00039  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00040  * Updated in $/CodeJockey/CJLibrary
00041  *
00042  * *****************  Version 9  *****************
00043  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00044  * Updated in $/CodeJockey/CJLibrary
00045  *
00046  * *****************  Version 8  *****************
00047  * User: Kirk Stowell Date: 7/25/99    Time: 12:15a
00048  * Updated in $/CodeJockey/CJLibrary
00049  *
00050  * *****************  Version 7  *****************
00051  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00052  * Updated in $/CodeJockey/CJLibrary
00053  *
00054  * *****************  Version 6  *****************
00055  * User: Kirk Stowell Date: 6/25/99    Time: 11:03a
00056  * Updated in $/CodeJockey/CJLibrary
00057  * Chaned image list color mask and export macros.
00058  *
00059  * *****************  Version 5  *****************
00060  * User: Kirk Stowell Date: 6/14/99    Time: 10:41p
00061  * Updated in $/CodeJockey/CJ60Lib
00062  * Cleaned up control and pointer initialization, creation and activation.
00063  * Added support for CCJMenu popup.
00064  *
00065  * *****************  Version 4  *****************
00066  * User: Kirk Stowell Date: 6/01/99    Time: 11:57p
00067  * Updated in $/CodeJockey/CJ60Lib
00068  * Minor fix with build using error level 4 warning.
00069  *
00070  * *****************  Version 3  *****************
00071  * User: Kirk Stowell Date: 5/29/99    Time: 12:53a
00072  * Updated in $/CodeJockey/CJ60Lib
00073  * Changed reference to CCJShellFile to CCJShell, to reflect class
00074  * renaming.
00075  *
00076  * *****************  Version 2  *****************
00077  * User: Kirk Stowell Date: 4/03/99    Time: 10:54p
00078  * Updated in $/CodeJockey/CJ60Lib
00079  * Added comments and cleaned up code.
00080  *
00081  * *****************  Version 1  *****************
00082  * User: Kirk Stowell Date: 1/16/99    Time: 10:53p
00083  * Created in $/CodeJockey/CJ60Lib
00084  * Initial release.
00085  *
00086  ***************************************************************************/
00088
00089 #include "stdafx.h"
00090 #include "CJBrowseEdit.h"
00091 #include "CJShell.h"
00092 #include "CJMenu.h"        // CCJMenu class declaration
00093 #include "CJResource.h"
00094
00095 #ifdef _DEBUG
00096 #define new DEBUG_NEW
00097 #undef THIS_FILE
00098 static char THIS_FILE[] = __FILE__;
00099 #endif
00100
00102 // CCJBrowseButton class
00104
00105 CCJBrowseButton::CCJBrowseButton()
00106 {
00107     m_pParentWnd = NULL;
00108     m_pEditWnd   = NULL;
00109     m_hIcon      = NULL;
00110 }
00111
00112 CCJBrowseButton::~CCJBrowseButton()
00113 {
00114     // fix potential resource leak - KStowell - 10-22-99.
00115     m_Font.DeleteObject();
00116     _destroyIcon(m_hIcon);
00117 }
00118
00119 BEGIN_MESSAGE_MAP(CCJBrowseButton, CButton)
00120     //{{AFX_MSG_MAP(CCJBrowseButton)
00121     ON_CONTROL_REFLECT(BN_CLICKED, OnClicked)
00122     //}}AFX_MSG_MAP
00123 END_MESSAGE_MAP()
00124
00125 BOOL CCJBrowseButton::Create(CWnd* pWnd, BROWSE_TYPE eType, UINT nMenu, UINT nSubMenuIndx)
00126 {
00127     ASSERT( eType );
00128     ASSERT_VALID( pWnd );
00129     ASSERT_VALID( pWnd->GetParent() );
00130
00131     m_pEditWnd      = pWnd;
00132     m_pParentWnd    = m_pEditWnd->GetParent();
00133     m_eType         = eType;
00134     m_nMenu         = nMenu;
00135     m_nSubMenuIndx  = nSubMenuIndx;
00136
00137     CRect rc;
00138     m_pEditWnd->GetWindowRect( &rc );
00139     m_pEditWnd->SetWindowPos( NULL, 0, 0, rc.Width()-23, rc.Height(), SWP_NOZORDER|SWP_NOMOVE );
00140     m_pParentWnd->ScreenToClient( &rc );
00141     rc.left = rc.right-18;
00142
00143     DWORD dwStyle = WS_VISIBLE|WS_CHILD|WS_TABSTOP|BS_CENTER|BS_VCENTER;
00144
00145     // if this is a browse for directory or file edit control.
00146     if(( m_eType == BT_DIRECTORY ) || ( m_eType == BT_FILE ))
00147     {
00148         if( !CButton::Create(_T("..."), dwStyle, rc, m_pParentWnd, GetNextID( m_pParentWnd )))
00149         {
00150             TRACE0( "Failed to create browse edit browse button.\n" );
00151             return FALSE;
00152         }
00153
00154         // set the tab order and font, enable the window based on parent's state.
00155         SetWindowPos( m_pEditWnd, 0,0,0,0, SWP_NOSIZE|SWP_NOMOVE );
00156         EnableWindow( m_pEditWnd->IsWindowEnabled( ));
00157         UpdateFont();
00158
00159         return TRUE;
00160     }
00161
00162     // if this is a popup menu edit control.
00163     else if( m_eType == BT_POPUPMENU )
00164     {
00165         if( !CButton::Create( NULL, dwStyle|BS_ICON, rc, m_pParentWnd, GetNextID( m_pParentWnd )))
00166         {
00167             TRACE0( "Failed to create browse edit browse button.\n" );
00168             return FALSE;
00169         }
00170
00171         // set the tab order and font, enable the window based on parent's state.
00172         SetWindowPos( m_pEditWnd, 0,0,0,0, SWP_NOSIZE|SWP_NOMOVE );
00173         EnableWindow( m_pEditWnd->IsWindowEnabled( ));
00174         UpdateFont();
00175
00176         // create the icon arrow that is displayed on the button.
00177         CImageList imageList;
00178         CBitmap    bitmap;
00179
00180         bitmap.LoadBitmap( IDB_BTN_ARROW );
00181         imageList.Create( 15, 17, ILC_COLORDDB|ILC_MASK, 1, 1 );
00182         imageList.Add( &bitmap, RGB( 255,0,255 ));
00183
00184         // set the icon and free resources.
00185         // fix potential resource leak - KStowell - 10-22-99.
00186         m_hIcon = imageList.ExtractIcon( 0 );
00187         SetIcon(m_hIcon);
00188         imageList.Detach();
00189         bitmap.DeleteObject();
00190
00191         return TRUE;
00192     }
00193
00194     return FALSE;
00195 }
00196
00197 void CCJBrowseButton::OnClicked()
00198 {
00199     if( m_eType == BT_DIRECTORY )
00200     {
00201         CCJShell sfi;
00202         sfi.m_strTitle = m_strTitle;
00203
00204         if( sfi.BrowseForFolder( m_pParentWnd ) == IDOK ) {
00205             m_pEditWnd->SetWindowText( sfi.m_strPath );
00206         }
00207     }
00208
00209     else if( m_eType == BT_FILE )
00210     {
00211         CFileDialog dlg( m_bOpenFileDialog, m_strDefExt, m_strFileName,
00212             m_dwFlags, m_strFilter, m_pParentWnd );
00213
00214         if( dlg.DoModal() == IDOK ) {
00215             m_pEditWnd->SetWindowText( dlg.GetPathName( ));
00216         }
00217     }
00218
00219     else if( m_eType == BT_POPUPMENU )
00220     {
00221         ASSERT( m_nMenu != 0 );
00222         SetState( true );
00223
00224         CRect rc;
00225         GetWindowRect( &rc );
00226
00227         CMenu menu;
00228         VERIFY( menu.LoadMenu( m_nMenu ));
00229
00230         CCJMenu* pPopup = (CCJMenu*)menu.GetSubMenu( m_nSubMenuIndx );
00231         ASSERT( pPopup != NULL );
00232
00233         pPopup->TrackPopupMenu( TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_VERTICAL,
00234             rc.right, rc.top, m_pParentWnd, &rc );
00235
00236         // Return the button state to normal.
00237         SetState( false );
00238     }
00239 }
00240
00241 void CCJBrowseButton::UpdateFont()
00242 {
00243     m_Font.DeleteObject();
00244     NONCLIENTMETRICS ncm;
00245     ncm.cbSize = sizeof(ncm);
00246     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00247     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00248     SetFont(&m_Font);
00249 }
00250
00252 // CCJBrowseEdit
00253
00254 CCJBrowseEdit::CCJBrowseEdit() : m_eType( BT_DIRECTORY ), m_nMenu( (UINT)-1 )
00255 {
00256
00257 }
00258
00259 CCJBrowseEdit::~CCJBrowseEdit()
00260 {
00261 }
00262
00263 BEGIN_MESSAGE_MAP(CCJBrowseEdit, CEdit)
00264     //{{AFX_MSG_MAP(CCJBrowseEdit)
00265     ON_WM_ENABLE()
00266     ON_WM_SHOWWINDOW()
00267     ON_WM_CREATE()
00268     //}}AFX_MSG_MAP
00269 END_MESSAGE_MAP()
00270
00272 // CCJBrowseEdit message handlers
00273
00274 void CCJBrowseEdit::OnEnable(BOOL bEnable)
00275 {
00276     CEdit::OnEnable(bEnable);
00277     m_btnBrowse.EnableWindow(bEnable);
00278 }
00279
00280 void CCJBrowseEdit::OnShowWindow(BOOL bShow, UINT nStatus)
00281 {
00282     CEdit::OnShowWindow( bShow, nStatus );
00283     m_btnBrowse.ShowWindow( bShow?SW_SHOW:SW_HIDE );
00284 }
00285
00286 void CCJBrowseEdit::PreSubclassWindow()
00287 {
00288     CEdit::PreSubclassWindow();
00289
00290     // initialize control to defaults.
00291     InitializeControl();
00292 }
00293
00294 int CCJBrowseEdit::OnCreate(LPCREATESTRUCT lpCreateStruct)
00295 {
00296     if (CEdit::OnCreate(lpCreateStruct) == -1)
00297         return -1;
00298
00299     // initialize control to defaults.
00300     InitializeControl();
00301
00302     return 0;
00303 }
00304
00305 void CCJBrowseEdit::InitializeControl()
00306 {
00307     // create the browse button associated with this control.
00308     if( m_btnBrowse.Create( this, m_eType, m_nMenu, m_nSubMenuIndx ))
00309     {
00310         // initialize some defaults
00311         SetDlgOpenFile();
00312         SetDlgDefExt( _T( "*.*" ));
00313         SetDlgFileName();
00314         SetDlgStyle( OFN_HIDEREADONLY|OFN_FILEMUSTEXIST|OFN_EXPLORER );
00315         SetDlgFilter( _T( "All Files (*.*)|*.*||" ));
00316         SetDlgOwner( GetParent( ));
00317         SetDlgTitle( _T( "Select Folder" ));
00318     }
00319 }
Generated on Sun Feb 24 01:21:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJCaption.cpp Source File

WinCvs/CJLib/CJLibrary/CJCaption.cpp

Go to the documentation of this file.
00001 // CJCaption.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:48 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/CJLibrary/CJCaption.cpp $
00011  *
00012  * $History: CJCaption.cpp $
00013  *
00014  * *****************  Version 17  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:41p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Updated OnEraseBkgnd(...) and OnPaint() for flicker free drawing.
00018  *
00019  * Fixed bug when popup window is closed, the mainframe resizes and then
00020  * the popup is reopened and pushpin is pressed, the child will not be
00021  * correctly sized and positioned. Added changes to handle flicker free
00022  * drawing of the control window.
00023  *
00024  * Modified resource include for static builds.
00025  *
00026  * Fixed the bug where the icon on the right hand side of the bar doesn't
00027  * clip when you resize the bar to almost nothing. Added method
00028  * SetTextStyle(...) to set the CDC:: DrawText(...) text styles to be user
00029  * defined. Thanks to Adrian for help with this.
00030  *
00031  * Fixed potential resource and memory leak problems.
00032  *
00033  * Fixed small bug with UNICODE display placing unwanted character at the
00034  * end of the string.
00035  *
00036  * Made class methods virtual for inheritance purposes.
00037  *
00038  * *****************  Version 16  *****************
00039  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00040  * Updated in $/CodeJockey/CJLibrary
00041  * Updated copyright and contact information.
00042  *
00043  * *****************  Version 15  *****************
00044  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00045  * Updated in $/CodeJockey/CJLibrary
00046  * Added Unicode compliance, thanks to Barry Burton for his help with
00047  * this.
00048  *
00049  * *****************  Version 14  *****************
00050  * User: Kirk Stowell Date: 6/23/99    Time: 12:36a
00051  * Updated in $/CodeJockey/CJLibrary
00052  *
00053  * *****************  Version 13  *****************
00054  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00055  * Updated in $/CodeJockey/CJLibrary
00056  *
00057  * *****************  Version 12  *****************
00058  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00059  * Updated in $/CodeJockey/CJLibrary
00060  *
00061  * *****************  Version 11  *****************
00062  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00063  * Updated in $/CodeJockey/CJLibrary
00064  *
00065  * *****************  Version 10  *****************
00066  * User: Kirk Stowell Date: 7/25/99    Time: 12:15a
00067  * Updated in $/CodeJockey/CJLibrary
00068  *
00069  * *****************  Version 9  *****************
00070  * User: Kirk Stowell Date: 7/24/99    Time: 9:32p
00071  * Updated in $/CodeJockey/CJLibrary
00072  *
00073  * *****************  Version 6  *****************
00074  * User: Kirk Stowell Date: 7/08/99    Time: 2:43a
00075  * Updated in $/CodeJockey/CJLibrary
00076  * Amundsen - Eirik [eirik.amundsen@siemens.no] - Fixed problem with
00077  * caption repainting when banner is smaller than displayed text.
00078  *
00079  * *****************  Version 5  *****************
00080  * User: Kirk Stowell Date: 5/17/99    Time: 8:13p
00081  * Updated in $/CodeJockey/CJ60Lib
00082  * Fixed painting bug with border, cleaned up inline methods.
00083  *
00084  * *****************  Version 4  *****************
00085  * User: Kirk Stowell Date: 4/03/99    Time: 12:35p
00086  * Updated in $/Code Jockey/CJ60Lib
00087  * Added comments and cleaned up code.
00088  *
00089  * *****************  Version 3  *****************
00090  * User: Kirk Stowell Date: 3/03/99    Time: 12:27p
00091  * Updated in $/CodeJockey/CJ60Lib
00092  * Added further functionality to class so that you can define text size,
00093  * text color, border size, border and background color. Basically to
00094  * create a look similar to Outlook's Captions.
00095  *
00096  * *****************  Version 2  *****************
00097  * User: Kirk Stowell Date: 2/01/99    Time: 12:28p
00098  * Updated in $/CodeJockey/CJ60Lib
00099  * Made some cosmetic fixes.
00100  *
00101  * *****************  Version 1  *****************
00102  * User: Kirk Stowell Date: 1/16/99    Time: 12:27p
00103  * Created in $/CodeJockey/CJ60Lib
00104  * Initial first release.
00105  *
00106  ***************************************************************************/
00108
00109 #include "StdAfx.h"
00110 #include "CJResource.h"
00111 #include "CJCaption.h"
00112 #include "CJCaptionPopupWnd.h"
00113
00114 #ifdef _DEBUG
00115 #define new DEBUG_NEW
00116 #undef THIS_FILE
00117 static char THIS_FILE[] = __FILE__;
00118 #endif
00119
00121 // CCJCaptionButton
00122
00123 BEGIN_MESSAGE_MAP(CCJCaptionButton, CCJFlatButton)
00124     //{{AFX_MSG_MAP(CCJCaptionButton)
00125     //}}AFX_MSG_MAP
00126 END_MESSAGE_MAP()
00127
00128 BOOL CCJCaptionButton::SetButtonStyle(CFont* pFont, COLORREF clrBackground, COLORREF clrFont)
00129 {
00130     m_pFont = pFont;
00131     SetAlternateColors(clrBackground, m_clrHilite, m_clrDkShad, clrFont);
00132     return TRUE;
00133 }
00134
00135 void CCJCaptionButton::DrawButtonText(CDC* pDC, UINT nState, CRect& rcItem)
00136 {
00137     // Get the window text, return if empty.
00138     CString strWindowText; GetWindowText(strWindowText);
00139     if( strWindowText.IsEmpty( ))
00140         return;
00141
00142     if( m_pFont == NULL ) {
00143         m_pFont = &m_Font;
00144     }
00145
00146     CRect rc = rcItem;
00147     rc.DeflateRect( 5,0 );
00148
00149     // Set the text color and select the button font.
00150     pDC->SetTextColor(( nState & ODS_DISABLED )?m_clrTextGy:m_clrTextNm);
00151     CFont *oldFont = pDC->SelectObject( m_pFont );
00152
00153     // get the height of the text to be displayed.
00154     int cy = pDC->DrawText( strWindowText, -1, rc, DT_SINGLELINE|DT_CALCRECT );
00155     rc.top = (rcItem.Height()-cy)/2;
00156
00157     // draw the text, and select the original font.
00158     pDC->DrawState( rc.TopLeft(), strWindowText.GetLength(), strWindowText,
00159         ( nState & ODS_DISABLED )?DSS_DISABLED:DSS_NORMAL, TRUE, 0, (HBRUSH)NULL );
00160
00161     // Set up pen to use for drawing the triangle
00162     CPen pen(PS_SOLID, 1, m_clrTextNm);
00163     CPen *pOldPen = pDC->SelectObject( &pen );
00164
00165     // get the client rect.
00166     CRect rcWnd;
00167     GetClientRect(&rcWnd);
00168
00169     // initialize coordinates for triangle.
00170     int x1 = rcWnd.right-11;
00171     int x2 = rcWnd.right-6;
00172     int y1 = rcWnd.bottom-7;
00173     int y2 = rcWnd.bottom-5;
00174
00175     // draw the triangle.
00176     pDC->MoveTo( x1, y1 );
00177     pDC->LineTo( x2, y1 );
00178     pDC->MoveTo( x1+1, y1+1 );
00179     pDC->LineTo( x2-1, y1+1 );
00180     pDC->SetPixel( x1+2, y2, m_clrTextNm );
00181
00182     // restore old pen and font.
00183     pDC->SelectObject( oldFont );
00184     pDC->SelectObject( pOldPen );
00185
00186     // fix potential resource leak - KStowell - 10-21-99
00187     pen.DeleteObject();
00188 }
00189
00191 // CCJCaption
00192
00193 CCJCaption::CCJCaption()
00194 {
00195     m_strWindText   = _T("");
00196     m_pNotifyWnd    = NULL;
00197     m_pWndPopDown   = NULL;
00198     m_pChildWnd     = NULL;
00199     m_cx            = ::GetSystemMetrics(SM_CXSMICON);
00200     m_cy            = ::GetSystemMetrics(SM_CYSMICON);
00201     m_clrBtnHilite  = ::GetSysColor(COLOR_BTNHILIGHT);
00202     m_clrBtnShadow  = ::GetSysColor(COLOR_BTNSHADOW);
00203     m_clrBtnFace    = ::GetSysColor(COLOR_BTNFACE);
00204     m_clrFont       = ::GetSysColor(COLOR_WINDOWTEXT);
00205     m_clrBorder     = ::GetSysColor(COLOR_BTNFACE);
00206     m_clrBackgnd    = ::GetSysColor(COLOR_BTNFACE);
00207     m_nBorder       = 0;
00208     m_pFont         = NULL;
00209     m_hIcon         = NULL;
00210
00211     SetTextStyle( DT_SINGLELINE|DT_END_ELLIPSIS );
00212 }
00213
00214 CCJCaption::~CCJCaption()
00215 {
00216     // fix potential resource leak - KStowell - 10-22-99.
00217     m_Font.DeleteObject();
00218 }
00219
00220 BEGIN_MESSAGE_MAP(CCJCaption, CStatic)
00221     //{{AFX_MSG_MAP(CCJCaption)
00222     ON_WM_PAINT()
00223     ON_WM_SYSCOLORCHANGE()
00224     ON_WM_SIZE()
00225     ON_WM_ERASEBKGND()
00226     //}}AFX_MSG_MAP
00227     ON_BN_CLICKED(IDC_CAPT_BUTTON, OnCaptButton)
00228     ON_MESSAGE(CM_ONPUSHPINBUTTON, OnPushPinButton)
00229     ON_MESSAGE(CM_ONPUSHPINCANCEL, OnPushPinCancel)
00230 END_MESSAGE_MAP()
00231
00233 // CCJCaption message handlers
00234
00235 void CCJCaption::OnPaint()
00236 {
00237     CPaintDC dc(this); // device context for painting
00238
00239     // KStowell - Get the client rect.
00240     CRect rcClient;
00241     GetClientRect( &rcClient );
00242
00243     // KStowell - Create a memory device-context. This is done to help reduce
00244     // screen flicker, since we will paint the entire control to the
00245     // off screen device context first.
00246     CDC memDC;
00247     CBitmap bitmap;
00248     memDC.CreateCompatibleDC(&dc);
00249     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00250     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00251     memDC.FillSolidRect( rcClient, m_clrBtnFace );
00252
00253     // First let the control do its default drawing.
00254     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00255
00256     // draw the backgound, text and icon.
00257     DrawCaptionBack( &memDC, rcClient );
00258     DrawCaptionText( &memDC, rcClient );
00259     DrawCaptionIcon( &memDC, rcClient );
00260
00261     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00262     dc.BitBlt(rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), &memDC, 0,0, SRCCOPY);
00263
00264     // KStowell - Cleanup resources.
00265     memDC.SelectObject(pOldBitmap);
00266     memDC.DeleteDC();
00267     bitmap.DeleteObject();
00268 }
00269
00270 void CCJCaption::DrawCaptionBack(CDC* pDC, CRect& rcItem)
00271 {
00272     CRect rc = rcItem;
00273
00274     // Set the background mode to transparent.
00275     pDC->SetBkMode( TRANSPARENT );
00276
00277     // repaint the background.
00278     pDC->FillSolidRect( rc, m_clrBtnFace );
00279
00280     // draw the caption border.
00281     if( m_dwExStyle & WS_EX_FLATEDGE ) {
00282         pDC->Draw3dRect(rc, m_clrBtnHilite, m_clrBtnShadow);
00283     }
00284
00285     // draw the caption banner border.
00286     if( m_nBorder != 0 ) {
00287         rc.DeflateRect( m_nBorder, m_nBorder );
00288         pDC->FillSolidRect(rc, m_clrBackgnd);
00289     }
00290 }
00291
00292 void CCJCaption::DrawCaptionText(CDC* pDC, CRect& rcItem)
00293 {
00294     // if the caption text is empty, return.
00295     if( m_strWindText.IsEmpty( ))
00296         return;
00297
00298     if( m_pFont == NULL ) {
00299         m_pFont = &m_Font;
00300     }
00301
00302     CRect rc = rcItem;
00303     rc.OffsetRect( 10,0 );
00304
00305     // Set the text color and select the caption font.
00306     pDC->SetTextColor( m_clrFont );
00307     CFont* oldFont = pDC->SelectObject( m_pFont );
00308
00309     // get the height of the text to be displayed.
00310     int cy = pDC->DrawText( m_strWindText, -1, rc, DT_SINGLELINE|DT_CALCRECT );
00311     rc.top = (rcItem.Height()-cy)/2;
00312     rc.bottom = rc.top+cy;
00313     rc.right  = rcItem.right-(m_cx + m_nBorder);
00314
00315     // draw the text, and select the original font.
00316     pDC->DrawText( m_strWindText, rc, m_dwTextStyle );
00317     pDC->SelectObject( oldFont );
00318 }
00319
00320 void CCJCaption::DrawCaptionIcon(CDC* pDC, CRect& rcItem)
00321 {
00322     // If no icon was defined, just return.
00323     if( m_hIcon == NULL )
00324         return;
00325
00326     CRect rc = rcItem;
00327     rc.left = ( rc.right - m_cx )-( m_nBorder + 2 );
00328
00329     // stop the icon at the left hand border
00330     if (rc.left < m_nBorder) {
00331         rc.left = m_nBorder;
00332     }
00333
00334     rc.top = ( rcItem.Height() - m_cy )/2;
00335     rc.right = rc.left + m_cx;
00336     rc.bottom = rc.top + m_cy;
00337
00338     // Only draw the icon if it will fit into the space between the borders
00339     if (rc.right < rcItem.right - m_nBorder) {
00340         // draw the icon associated with the caption.
00341         ::DrawIconEx( pDC->GetSafeHdc(), rc.left, rc.top, m_hIcon,
00342             rc.Width(), rc.Height(), NULL, (HBRUSH)NULL, DI_NORMAL);
00343     }
00344 }
00345
00346 void CCJCaption::OnSysColorChange()
00347 {
00348     CStatic::OnSysColorChange();
00349
00350     m_clrBtnHilite = ::GetSysColor(COLOR_BTNHILIGHT);
00351     m_clrBtnShadow = ::GetSysColor(COLOR_BTNSHADOW);
00352     m_clrBtnFace   = ::GetSysColor(COLOR_BTNFACE);
00353 }
00354
00355 BOOL CCJCaption::Create(CWnd* pParentWnd, LPCTSTR lpszWindowName, DWORD dwExStyle, DWORD dwStyle, const CRect& rect, UINT nID)
00356 {
00357     // Let the base class create the control.
00358     if( !CStatic::Create( NULL, dwStyle, rect, pParentWnd, nID ))
00359     {
00360         TRACE(_T("Unable to create caption.\n"));
00361         return FALSE;
00362     }
00363
00364     UpdateFont();
00365
00366     // save the style.
00367     if( dwExStyle & WS_EX_FLATEDGE ) {
00368         m_dwExStyle = dwExStyle;
00369     }
00370
00371     else {
00372         ModifyStyleEx( 0, dwExStyle );
00373     }
00374
00375     // Save the window text.
00376     m_strWindText = lpszWindowName;
00377
00378     // Create the button to be used with child window.
00379     if( !m_CaptionButton.Create( m_strWindText, BS_ICON|BS_OWNERDRAW|BS_VCENTER,
00380         CRect(0,0,0,0), this, IDC_CAPT_BUTTON ))
00381     {
00382         TRACE0( "Unable to create caption button.\n" );
00383         return FALSE;
00384     }
00385
00386     // set the button font and colors.
00387     m_CaptionButton.SetButtonStyle( m_pFont, m_clrBackgnd, m_clrFont );
00388
00389     return TRUE;
00390 }
00391
00392 void CCJCaption::ModifyCaptionStyle(int nBorderSize, CFont* pFont, LPCTSTR lpszWindText, HICON hIcon)
00393 {
00394     ASSERT(::IsWindow(m_hWnd));
00395
00396     if( nBorderSize ) {
00397         m_nBorder = nBorderSize;
00398     }
00399
00400     if( pFont ) {
00401         m_pFont = pFont;
00402         m_CaptionButton.SetButtonStyle( m_pFont, m_clrBackgnd, m_clrFont );
00403     }
00404
00405     if( lpszWindText ) {
00406         m_strWindText = lpszWindText;
00407     }
00408
00409     if( hIcon ) {
00410         m_hIcon = hIcon;
00411     }
00412
00413     Invalidate();
00414 }
00415
00416 void CCJCaption::SetChildWindow(CWnd* pChild, CWnd* pNotifyWnd)
00417 {
00418     ASSERT( pChild != NULL );       // must be valid.
00419     ASSERT( pNotifyWnd != NULL );   // must be valid.
00420
00421     // save window pointers, and show caption button.
00422     m_pChildWnd  = pChild;
00423     m_pNotifyWnd = pNotifyWnd;
00424
00425     // set the size of the child window.
00426     m_pChildWnd->GetWindowRect(&m_rcChild);
00427
00428     CRect rcClient;
00429     m_pChildWnd->GetParent()->GetClientRect(&rcClient);
00430     m_nOffset = rcClient.Height()-m_rcChild.Height();
00431
00432     m_CaptionButton.ModifyStyle( 0, WS_VISIBLE );
00433     Invalidate();
00434 }
00435
00436 void CCJCaption::KillChildWindow()
00437 {
00438     m_CaptionButton.SetState(FALSE);
00439     m_CaptionButton.ModifyStyle( WS_VISIBLE, 0 );
00440     m_pWndPopDown->DestroyWindow();
00441     _delete( m_pWndPopDown );
00442 }
00443
00444 void CCJCaption::OnSize(UINT nType, int cx, int cy)
00445 {
00446     CStatic::OnSize(nType, cx, cy);
00447
00448     if( m_CaptionButton.GetSafeHwnd())
00449     {
00450         CDC* pDC = GetDC();
00451         CFont* pOldFont = pDC->SelectObject(m_pFont);
00452
00453         TEXTMETRIC tm;
00454         pDC->GetTextMetrics(&tm);
00455
00456         CSize size = pDC->GetTextExtent(m_strWindText, m_strWindText.GetLength());
00457         size.cx += tm.tmAveCharWidth+21;
00458         pDC->SelectObject(pOldFont);
00459         ReleaseDC(pDC);
00460
00461         CRect rc( 0, 0, size.cx, cy );
00462         rc.DeflateRect(m_nBorder+1, m_nBorder+1);
00463         m_CaptionButton.MoveWindow(rc);
00464     }
00465 }
00466
00467 void CCJCaption::OnCaptButton()
00468 {
00469     CRect rc;
00470     m_CaptionButton.GetWindowRect(&rc);
00471     rc.right  = rc.left + m_rcChild.Width();
00472     rc.top    = rc.bottom;
00473     rc.bottom = rc.top + m_rcChild.Height();
00474
00475     //if window is already present delete it
00476     _delete( m_pWndPopDown );
00477
00478     // Get the class name and create the window
00479     m_pWndPopDown = new CCJCaptionPopupWnd;
00480     m_pWndPopDown->Create( rc, this, m_pChildWnd );
00481     m_pChildWnd->ShowWindow(SW_SHOW);
00482     m_CaptionButton.SetState(TRUE);
00483 }
00484
00485 void CCJCaption::OnPushPinButton(UINT lParam, LONG wParam)
00486 {
00487     UNUSED_ALWAYS( lParam );
00488     UNUSED_ALWAYS( wParam );
00489
00490     KillChildWindow();
00491     m_pNotifyWnd->SendMessage(CM_ONPUSHPINBUTTON, 0, 0);
00492     m_pChildWnd->GetParent()->GetClientRect(&m_rcChild);
00493     if(m_nOffset>0) {
00494         m_rcChild.top += m_nOffset;
00495     }
00496     m_pChildWnd->MoveWindow(m_rcChild);
00497     Invalidate();
00498 }
00499
00500 void CCJCaption::OnPushPinCancel(UINT lParam, LONG wParam)
00501 {
00502     UNUSED_ALWAYS( lParam );
00503     UNUSED_ALWAYS( wParam );
00504
00505     m_CaptionButton.SetState(FALSE);
00506     m_pWndPopDown->DestroyWindow();
00507
00508     _delete( m_pWndPopDown );
00509
00510     m_pNotifyWnd->SendMessage(CM_ONPUSHPINCANCEL, 0, 0);
00511 }
00512
00513 void CCJCaption::UpdateCaption(LPCTSTR lpszWindowText, HICON hIcon)
00514 {
00515     ASSERT(::IsWindow(m_hWnd));
00516
00517     CRect rcClient;
00518     GetClientRect(&rcClient);
00519     CDC* pDC = GetDC();
00520
00521     UpdateCaptionBack(pDC, rcClient);
00522
00523     if( lpszWindowText )
00524     {
00525         m_strWindText = lpszWindowText;
00526         UpdateCaptionText(pDC, rcClient);
00527     }
00528
00529     if( hIcon ) {
00530         m_hIcon = hIcon;
00531         DrawCaptionIcon( pDC, rcClient );
00532     }
00533
00534     ReleaseDC(pDC);
00535 }
00536
00537 void CCJCaption::UpdateCaptionBack(CDC* pDC, CRect& rcItem)
00538 {
00539     CRect rc = rcItem;
00540
00541     // Set the background mode to transparent.
00542     pDC->SetBkMode( TRANSPARENT );
00543
00544     rc.DeflateRect(1,1);
00545     // repaint the background.
00546     pDC->FillSolidRect( rc, m_clrBtnFace );
00547
00548     // draw the caption banner border.
00549     if( m_nBorder != 0 ) {
00550         rc.DeflateRect( m_nBorder-1, m_nBorder-1 );
00551         pDC->FillSolidRect(rc, m_clrBackgnd);
00552     }
00553 }
00554
00555 void CCJCaption::UpdateCaptionText(CDC* pDC, CRect& rcItem)
00556 {
00557     CFont* pOldFont = pDC->SelectObject(m_pFont);
00558
00559     TEXTMETRIC tm;
00560     pDC->GetTextMetrics(&tm);
00561
00562     CSize size = pDC->GetTextExtent(m_strWindText, m_strWindText.GetLength());
00563     size.cx += tm.tmAveCharWidth+21;
00564     pDC->SelectObject(pOldFont);
00565
00566     CRect rc( 0, 0, size.cx, rcItem.Height() );
00567     rc.DeflateRect(m_nBorder+1, m_nBorder+1);
00568     m_CaptionButton.MoveWindow(rc);
00569     m_CaptionButton.SetWindowText(m_strWindText);
00570
00571     DrawCaptionText( pDC, rcItem );
00572 }
00573
00574 void CCJCaption::UpdateFont()
00575 {
00576     m_Font.DeleteObject();
00577     NONCLIENTMETRICS ncm;
00578     ncm.cbSize = sizeof(ncm);
00579     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00580     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00581     m_pFont = &m_Font;
00582 }
00583
00584 BOOL CCJCaption::OnEraseBkgnd(CDC* pDC)
00585 {
00586     // KStowell - overridden for flicker-free drawing.
00587     UNUSED_ALWAYS(pDC);
00588     return TRUE;
00589 }
Generated on Sun Feb 24 01:21:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJCaptionPopupWnd.cpp Source File

WinCvs/CJLib/CJLibrary/CJCaptionPopupWnd.cpp

Go to the documentation of this file.
00001 // CJCaptionPopupWnd.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:48 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/CJLibrary/CJCaptionPopupWnd.cpp $
00011  *
00012  * $History: CJCaptionPopupWnd.cpp $
00013  *
00014  * *****************  Version 5  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:43p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Modified resource include for static builds.
00018  *
00019  * Fixed potential resource and memory leak problems.
00020  *
00021  * *****************  Version 4  *****************
00022  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00023  * Updated in $/CodeJockey/CJLibrary
00024  * Updated copyright and contact information.
00025  *
00026  * *****************  Version 3  *****************
00027  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00028  * Updated in $/CodeJockey/CJLibrary
00029  * Added Unicode compliance, thanks to Barry Burton for his help with
00030  * this.
00031  *
00032  * *****************  Version 2  *****************
00033  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00034  * Updated in $/CodeJockey/CJLibrary
00035  *
00036  * *****************  Version 1  *****************
00037  * User: Kirk Stowell Date: 7/14/99    Time: 9:46p
00038  * Created in $/CodeJockey/CJLibrary
00039  * Initial creation. Added popup class as a helper class for the
00040  * CCJCaption class. This class is used to display a popup window which
00041  * contains a child CWnd derived object.
00042  *
00043  ***************************************************************************/
00045
00046
00047 #include "stdafx.h"
00048 #include "CJResource.h"
00049 #include "CJCaptionPopupWnd.h"
00050
00051 #ifdef _DEBUG
00052 #define new DEBUG_NEW
00053 #undef THIS_FILE
00054 static char THIS_FILE[] = __FILE__;
00055 #endif
00056
00058 // CCJCaptionPopupWnd
00059
00060 CCJCaptionPopupWnd::CCJCaptionPopupWnd()
00061 {
00062     m_pChildWnd     = NULL;
00063     m_pChildParent  = NULL;
00064     m_pParentWnd    = NULL;
00065     m_hIconOn       = NULL;
00066     m_hIconOff      = NULL;
00067 }
00068
00069 CCJCaptionPopupWnd::~CCJCaptionPopupWnd()
00070 {
00071     // fix potential resource leak - KStowell - 10-22-99.
00072     _destroyIcon(m_hIconOn);
00073     _destroyIcon(m_hIconOff);
00074     DestroyWindow();
00075 }
00076
00077 BEGIN_MESSAGE_MAP(CCJCaptionPopupWnd, CWnd)
00078     //{{AFX_MSG_MAP(CCJCaptionPopupWnd)
00079     ON_WM_DESTROY()
00080     ON_BN_CLICKED(IDC_CAPT_BUTTON, OnCaptButton)
00081     ON_WM_PAINT()
00082     ON_WM_TIMER()
00083     //}}AFX_MSG_MAP
00084 END_MESSAGE_MAP()
00085
00087 // CCJCaptionPopupWnd message handlers
00088
00089 BOOL CCJCaptionPopupWnd::Create(const CRect& rect, CWnd* pParentWnd, CWnd* pChildWnd)
00090 {
00091     ASSERT(pParentWnd != NULL); // must be valid.
00092     m_pParentWnd = pParentWnd;
00093
00094     ASSERT(pChildWnd  != NULL); // must be valid.
00095     m_pChildWnd = pChildWnd;
00096
00097     // register the wnd class.
00098     CString wndClass = ::AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW,
00099         0, ::GetSysColorBrush(COLOR_BTNFACE));
00100
00101     // define the styles for this window.
00102     DWORD dwStyleEx = WS_EX_TOOLWINDOW;
00103     DWORD dwStyle   = WS_VISIBLE|WS_POPUP|WS_DLGFRAME;
00104
00105     // call the base class for creation.
00106     if( !CWnd::CreateEx( dwStyleEx, wndClass, _T(""), dwStyle, rect.left, rect.top,
00107         rect.Width(), rect.Height(), pParentWnd->GetSafeHwnd(), 0, NULL ))
00108     {
00109         TRACE0( "Failed to create caption popdown window.\n" );
00110         return FALSE;
00111     }
00112
00113     // set the child windows parent to this popup window, save
00114     // the previous parent, since we need to reset this when the
00115     // window is destroyed.
00116     m_pChildParent = m_pChildWnd->SetParent(this);
00117     ASSERT(m_pChildParent != NULL);
00118
00119     // define the caption and client rect.
00120     CRect rcClient;
00121     GetClientRect(&rcClient);
00122     rcClient.DeflateRect(2,2);
00123     CRect rcCapt( rcClient );
00124
00125     // move the window to fit the client area of this window.
00126     rcClient.top += 19;
00127     m_pChildWnd->MoveWindow(rcClient);
00128
00129     // define the size for the push pin caption.
00130     rcCapt.bottom = rcCapt.top + 19;
00131
00132     // Create the caption.
00133     if( !m_Caption.Create( this, _T( "Click push pin to keep open" ), WS_EX_FLATEDGE,
00134         WS_VISIBLE|SS_CENTER|SS_CENTERIMAGE, rcCapt ))
00135     {
00136         TRACE0( "Unable to create caption.\n" );
00137         return FALSE;
00138     }
00139
00140     // define the size for the caption button.
00141     CRect rcButton( rcCapt );
00142     rcButton.DeflateRect(2,2);
00143     rcButton.left = rcButton.right - 16;
00144
00145     // Create the caption button.
00146     if( !m_CaptionButton.Create( NULL, WS_VISIBLE|BS_ICON|BS_OWNERDRAW|BS_CENTER|BS_VCENTER,
00147         rcButton, this, IDC_CAPT_BUTTON ))
00148     {
00149         TRACE0( "Unable to create caption button.\n" );
00150         return FALSE;
00151     }
00152
00153     CImageList imageList;
00154     imageList.Create(IDB_PUSHPIN, 16, 1, RGB(255,0,255));
00155
00156     // Associate the button icon
00157     m_hIconOff = imageList.ExtractIcon(0);
00158     m_hIconOn  = imageList.ExtractIcon(1);
00159     m_CaptionButton.SetIcon(m_hIconOff, m_hIconOn, CSize(16,15));
00160     imageList.DeleteImageList();
00161
00162     // start the timer after everything has been initialized.
00163     SetTimer(1, 10, NULL);
00164
00165     return TRUE;
00166 }
00167
00168 void CCJCaptionPopupWnd::OnDestroy()
00169 {
00170     // set the child window's parent back it's original parent.
00171     m_pChildWnd->SetParent(m_pChildParent);
00172     CWnd::OnDestroy();
00173 }
00174
00175 void CCJCaptionPopupWnd::OnCaptButton()
00176 {
00177     // send message to parent control that push pin button was pressed.
00178     m_pParentWnd->SendMessage(CM_ONPUSHPINBUTTON, 0, 0);
00179 }
00180
00181 void CCJCaptionPopupWnd::OnPaint()
00182 {
00183     CPaintDC dc(this); // device context for painting
00184
00185     CRect rc;
00186     GetClientRect(&rc);
00187     rc.DeflateRect(1,1);
00188
00189     // draw a border for the client area.
00190     dc.Draw3dRect( rc, ::GetSysColor(COLOR_BTNSHADOW),
00191         ::GetSysColor(COLOR_BTNHILIGHT));
00192 }
00193
00194 void CCJCaptionPopupWnd::OnTimer(UINT nIDEvent)
00195 {
00196     UNUSED_ALWAYS( nIDEvent );
00197
00198     // get a handle to the window which currently
00199     // has the input focus...
00200     HWND hWnd_HasFocus      = GetFocus()->GetSafeHwnd();
00201
00202     // get a handle to the caption, caption button, child window
00203     // and popup window...
00204     HWND hWnd_Caption       = m_Caption.GetSafeHwnd();
00205     HWND hWnd_CaptionButton = m_CaptionButton.GetSafeHwnd();
00206     HWND hWnd_Popup         = GetSafeHwnd();
00207     HWND hWnd_PopupChild    = m_pChildWnd->GetSafeHwnd();
00208
00209     // check to see if the window that has input focus is part
00210     // of the caption popup window, if not, send a message
00211     // to the parent control.
00212     if(( hWnd_HasFocus != hWnd_Caption ) &&
00213        ( hWnd_HasFocus != hWnd_CaptionButton ) &&
00214        ( hWnd_HasFocus != hWnd_Popup ) &&
00215        ( hWnd_HasFocus != hWnd_PopupChild ))
00216     {
00217         // send message to parent control that our popup window
00218         // has lost input focus.
00219         m_pParentWnd->SendMessage(CM_ONPUSHPINCANCEL, 0, 0);
00220     }
00221 }
Generated on Sun Feb 24 01:21:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJColorPicker.cpp Source File

WinCvs/CJLib/CJLibrary/CJColorPicker.cpp

Go to the documentation of this file.
00001 // CJColorPicker.cpp : implementation file
00002 //
00003 // CJColorPicker is a drop-in Color picker control. Check out the
00004 // header file or the accompanying HTML doc file for details.
00005 //
00006 // Written by Chris Maunder (chrismaunder@codeguru.com)
00007 // Extended by Alexander Bischofberger (bischofb@informatik.tu-muenchen.de)
00008 // Copyright (c) 1998.
00009 //
00010 // This code may be used in compiled form in any way you desire. This
00011 // file may be redistributed unmodified by any means PROVIDING it is
00012 // not sold for profit without the authors written consent, and
00013 // providing that this notice and the authors name is included. If
00014 // the source code in  this file is used in any commercial application
00015 // then a simple email would be nice.
00016 //
00017 // This file is provided "as is" with no expressed or implied warranty.
00018 // The author accepts no liability if it causes any damage to your
00019 // computer, causes your pet cat to fall ill, increases baldness or
00020 // makes you car start emitting strange noises when you start it up.
00021 //
00022 // Expect bugs.
00023 //
00024 // Please use and enjoy. Please let me know of any bugs/mods/improvements
00025 // that you have found/implemented and I will fix/incorporate them into this
00026 // file.
00027 //
00028 // Updated 16 May 1998
00029 //         31 May 1998 - added Default text (CJM)
00030 //          9 Jan 1999 - minor vis update
00031 //
00033 /****************************************************************************
00034  *
00035  * $Date: 1999/11/30 21:45:48 $
00036  * $Revision: 1.1.1.3 $
00037  * $Archive: /CodeJock/CJLibrary/CJColorPicker.cpp $
00038  *
00039  * $History: CJColorPicker.cpp $
00040  *
00041  * *****************  Version 5  *****************
00042  * User: Kirk Stowell Date: 10/31/99   Time: 11:49p
00043  * Updated in $/CodeJock/CJLibrary
00044  * Overrode OnEraseBkgnd(...), OnPaint() and made modifications to
00045  * DrawItem(...) for flicker free drawing.
00046  *
00047  * Modified resource include for static builds.
00048  *
00049  * Added method CheckTextColor(...) which tests if the intensity of the
00050  * color is greater as 128. If the intensity < 128 => color is dark, so
00051  * the text must be light. Stephane Routelous
00052  * [routelous@cad-cam-concept.de]
00053  *
00054  * Fixed potential resource and memory leak problems.
00055  *
00056  * Removed un-necessary calls to GetParent(), a call is made only once at
00057  * initialization, to ensure we are working with a valid handle.
00058  *
00059  * Made class methods virtual for inheritance purposes.
00060  *
00061  * *****************  Version 4  *****************
00062  * User: Kirk Stowell Date: 10/14/99   Time: 12:22p
00063  * Updated in $/CodeJock/CJLibrary
00064  * Added source control history to file header.
00065  *
00066  ***************************************************************************/
00068
00069 #include "stdafx.h"
00070 #include "CJColorPopup.h"
00071 #include "CJColorPicker.h"
00072 #include "CJResource.h"
00073
00074 #ifdef _DEBUG
00075 #define new DEBUG_NEW
00076 #undef THIS_FILE
00077 static char THIS_FILE[] = __FILE__;
00078 #endif
00079
00080 void AFXAPI DDX_CJColorPicker(CDataExchange *pDX, int nIDC, COLORREF& crColor)
00081 {
00082     HWND hWndCtrl = pDX->PrepareCtrl(nIDC);
00083     ASSERT (hWndCtrl != NULL);
00084
00085     CCJColorPicker* pColorPicker = (CCJColorPicker*) CWnd::FromHandle(hWndCtrl);
00086     if (pDX->m_bSaveAndValidate)
00087     {
00088         crColor = pColorPicker->GetColor();
00089     }
00090     else // initializing
00091     {
00092         pColorPicker->SetColor(crColor);
00093     }
00094 }
00095
00097 // CCJColorPicker
00098
00099 CCJColorPicker::CCJColorPicker()
00100 {
00101     SetBkColor(GetSysColor(COLOR_3DFACE));
00102     SetTextColor(GetSysColor(COLOR_BTNTEXT));
00103
00104     m_bTrackSelection = FALSE;
00105     m_nSelectionMode = CP_MODE_BK;
00106     m_bActive = FALSE;
00107
00108 // 1999-06-11 begin mods KStowell
00109     m_strDefaultText.LoadString( IDS_COLOR_AUTO );
00110     m_strCustomText.LoadString( IDS_COLOR_CUST );
00111 // 1999-06-11 end mods KStowell
00112
00113 // 10-14-1999 - Kirk Stowell
00114     m_pParentWnd = NULL;
00115 }
00116
00117 CCJColorPicker::~CCJColorPicker()
00118 {
00119 }
00120
00121 IMPLEMENT_DYNCREATE(CCJColorPicker, CButton)
00122
00123 BEGIN_MESSAGE_MAP(CCJColorPicker, CButton)
00124     //{{AFX_MSG_MAP(CCJColorPicker)
00125     ON_CONTROL_REFLECT_EX(BN_CLICKED, OnClicked)
00126     ON_WM_CREATE()
00127     ON_WM_ERASEBKGND()
00128     ON_WM_PAINT()
00129     //}}AFX_MSG_MAP
00130     ON_MESSAGE(CPN_SELENDOK,     OnSelEndOK)
00131     ON_MESSAGE(CPN_SELENDCANCEL, OnSelEndCancel)
00132     ON_MESSAGE(CPN_SELCHANGE,    OnSelChange)
00133 END_MESSAGE_MAP()
00134
00136 // CCJColorPicker message handlers
00137
00138 LONG CCJColorPicker::OnSelEndOK(UINT lParam, LONG /*wParam*/)
00139 {
00140     COLORREF crNewColor = (COLORREF) lParam;
00141     m_bActive = FALSE;
00142     SetColor(crNewColor);
00143     //BEGIN SRO
00144     CheckTextColor(crNewColor);
00145     //END SRO
00146
00147     // 10-14-1999 - Kirk Stowell - Removed redundant calls to GetParent().
00148     if (m_pParentWnd) {
00149         m_pParentWnd->SendMessage(CPN_CLOSEUP, lParam, (WPARAM) GetDlgCtrlID());
00150         m_pParentWnd->SendMessage(CPN_SELENDOK, lParam, (WPARAM) GetDlgCtrlID());
00151     }
00152
00153     if (crNewColor != GetColor()) {
00154         if (m_pParentWnd) {
00155             m_pParentWnd->SendMessage(CPN_SELCHANGE, lParam, (WPARAM) GetDlgCtrlID());
00156         }
00157     }
00158
00159     return TRUE;
00160 }
00161
00162 LONG CCJColorPicker::OnSelEndCancel(UINT lParam, LONG /*wParam*/)
00163 {
00164     m_bActive = FALSE;
00165     SetColor((COLORREF) lParam);
00166     //BEGIN SRO
00167     CheckTextColor((COLORREF) lParam);
00168     //END SRO
00169
00170     // 10-14-1999 - Kirk Stowell - Removed redundant calls to GetParent().
00171     if (m_pParentWnd) {
00172         m_pParentWnd->SendMessage(CPN_CLOSEUP, lParam, (WPARAM) GetDlgCtrlID());
00173         m_pParentWnd->SendMessage(CPN_SELENDCANCEL, lParam, (WPARAM) GetDlgCtrlID());
00174     }
00175
00176     return TRUE;
00177 }
00178
00179 LONG CCJColorPicker::OnSelChange(UINT lParam, LONG /*wParam*/)
00180 {
00181     if (m_bTrackSelection) {
00182         SetColor((COLORREF) lParam);
00183         //BEGIN SRO
00184         CheckTextColor((COLORREF) lParam);
00185         //END SRO
00186     }
00187
00188     // 10-14-1999 - Kirk Stowell - Removed redundant calls to GetParent().
00189     if (m_pParentWnd) {
00190         m_pParentWnd->SendMessage(CPN_SELCHANGE, lParam, (WPARAM) GetDlgCtrlID());
00191     }
00192
00193     return TRUE;
00194 }
00195
00196 int CCJColorPicker::OnCreate(LPCREATESTRUCT lpCreateStruct)
00197 {
00198     if (CButton::OnCreate(lpCreateStruct) == -1)
00199         return -1;
00200
00201     SetWindowSize();    // resize appropriately
00202     return 0;
00203 }
00204
00205 // On mouse click, create and show a CJColorPopup window for Color selection
00206 BOOL CCJColorPicker::OnClicked()
00207 {
00208     m_bActive = TRUE;
00209
00210     CRect rect;
00211     GetWindowRect(rect);
00212     new CCJColorPopup(CPoint(rect.left, rect.bottom),    // Point to display popup
00213                      GetColor(),                       // Selected Color
00214                      this,                              // parent
00215                      m_strDefaultText,                  // "Default" text area
00216                      m_strCustomText);                  // Custom Text
00217
00218     // 10-14-1999 - Kirk Stowell - Removed redundant calls to GetParent().
00219     if (m_pParentWnd) {
00220         m_pParentWnd->SendMessage(CPN_DROPDOWN, (LPARAM)GetColor(), (WPARAM) GetDlgCtrlID());
00221     }
00222
00223     // Docs say I should return FALSE to stop the parent also getting the message.
00224     // HA! What a joke.
00225
00226     return TRUE;
00227 }
00228
00229 // 1999-06-11 begin mods KStowell
00230 void CCJColorPicker::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
00231 {
00232     ASSERT(lpDrawItemStruct != NULL);
00233
00234     // define some temporary variables.
00235     CDC*    pDC         = CDC::FromHandle( lpDrawItemStruct->hDC );
00236     CRect   rcItem      = lpDrawItemStruct->rcItem;
00237     int     nState      = lpDrawItemStruct->itemState;
00238     DWORD   dwState     = EDGE_RAISED;
00239     DWORD   dwArrow     = DFCS_SCROLLDOWN;
00240
00241     // Paint the background.
00242     pDC->FillSolidRect(rcItem, ::GetSysColor(COLOR_3DFACE));
00243
00244     // set display flags based on state.
00245     if((nState & ODS_SELECTED) || (m_bActive == TRUE)) {
00246         dwState = EDGE_SUNKEN;
00247         dwArrow = DFCS_SCROLLDOWN|DFCS_PUSHED;
00248     }
00249     if(nState & ODS_DISABLED) {
00250         dwArrow = DFCS_SCROLLDOWN|DFCS_INACTIVE;
00251     }
00252
00253     // Draw the drop arrow.
00254     CRect rcArrow( rcItem );
00255     rcArrow.left = rcArrow.Width()-::GetSystemMetrics( SM_CXHTHUMB );
00256     pDC->DrawFrameControl( &rcArrow, DFC_SCROLL, dwArrow );
00257     pDC->Draw3dRect( rcArrow, ::GetSysColor( COLOR_3DFACE ), ::GetSysColor( COLOR_3DFACE ));
00258     rcArrow.DeflateRect( 1,1 );
00259     pDC->Draw3dRect( rcArrow, ::GetSysColor( COLOR_3DFACE ), ::GetSysColor( COLOR_3DFACE ));
00260
00261     if((nState & ODS_SELECTED) || (m_bActive == TRUE))
00262         rcArrow.OffsetRect( 1,1 );
00263
00264     // draw the seperator line.
00265     CPen penShadow( PS_SOLID, 1, ::GetSysColor( COLOR_3DSHADOW  ));
00266     CPen* pOldPen = pDC->SelectObject( &penShadow );
00267     pDC->MoveTo( rcArrow.left-1, rcArrow.top+2 );
00268     pDC->LineTo( rcArrow.left-1, rcArrow.bottom-2 );
00269
00270     CPen penHilite( PS_SOLID, 1, ::GetSysColor( COLOR_3DHILIGHT ));
00271     pDC->SelectObject( &penHilite );
00272     pDC->MoveTo( rcArrow.left, rcArrow.top+2 );
00273     pDC->LineTo( rcArrow.left, rcArrow.bottom-2 );
00274
00275     // draw the control border.
00276     pDC->DrawEdge( rcItem, dwState, BF_RECT );
00277
00278     // draw the focus rect.
00279     rcItem.DeflateRect( 2, 2 );
00280     pDC->Draw3dRect( rcItem, ::GetSysColor( COLOR_3DFACE ), ::GetSysColor( COLOR_3DFACE ) );
00281     if( nState & ODS_FOCUS ) {
00282         pDC->DrawFocusRect( rcItem );
00283     }
00284
00285     // draw the color box.
00286     if((nState & ODS_SELECTED) || (m_bActive == TRUE))
00287         rcItem.OffsetRect( 1,1 );
00288
00289     rcItem.DeflateRect( 2, 2 );
00290     rcItem.right = rcArrow.left-4;
00291
00292     CBrush brush( ((nState & ODS_DISABLED) || m_crColorBk == CLR_DEFAULT)?
00293         ::GetSysColor(COLOR_3DFACE) : m_crColorBk);
00294     CBrush* pOldBrush = (CBrush*)pDC->SelectObject( &brush );
00295     pDC->SelectStockObject(( nState & ODS_DISABLED )?WHITE_PEN:BLACK_PEN );
00296     pDC->Rectangle( rcItem );
00297
00298     // Draw the window text (if any)
00299     CString strText;
00300     GetWindowText(strText);
00301     if (strText.GetLength())
00302     {
00303         pDC->SetBkMode(TRANSPARENT);
00304         if (nState & ODS_DISABLED)
00305         {
00306             rcItem.OffsetRect(1,1);
00307             pDC->SetTextColor(::GetSysColor(COLOR_3DHILIGHT));
00308             pDC->DrawText(strText, rcItem, DT_CENTER|DT_SINGLELINE|DT_VCENTER);
00309             rcItem.OffsetRect(-1,-1);
00310             pDC->SetTextColor(::GetSysColor(COLOR_3DSHADOW));
00311             pDC->DrawText(strText, rcItem, DT_CENTER|DT_SINGLELINE|DT_VCENTER);
00312         }
00313         else
00314         {
00315             pDC->SetTextColor((m_crColorText == CLR_DEFAULT)? 0 : m_crColorText);
00316             pDC->DrawText(strText, rcItem, DT_CENTER|DT_SINGLELINE|DT_VCENTER);
00317         }
00318     }
00319
00320     // fix potential resource leak - KStowell - 10-21-99
00321     pDC->SelectObject( pOldPen );
00322     pDC->SelectObject( pOldBrush );
00323     brush.DeleteObject();
00324     penHilite.DeleteObject();
00325     penHilite.DeleteObject();
00326 }
00327 // 1999-06-11 end mods KStowell
00328
00330 // CCJColorPicker overrides
00331
00332 void CCJColorPicker::PreSubclassWindow()
00333 {
00334     ModifyStyle(0, BS_OWNERDRAW);        // Make it owner drawn
00335     CButton::PreSubclassWindow();
00336     SetWindowSize();                     // resize appropriately
00337 }
00338
00340 // CCJColorPicker attributes
00341
00342 COLORREF CCJColorPicker::GetColor()
00343 {
00344     return (m_nSelectionMode == CP_MODE_TEXT)?
00345         GetTextColor(): GetBkColor();
00346 }
00347
00348 void CCJColorPicker::SetColor(COLORREF crColor)
00349 {
00350     (m_nSelectionMode == CP_MODE_TEXT)?
00351         SetTextColor(crColor): SetBkColor(crColor);
00352 }
00353
00354 void CCJColorPicker::SetBkColor(COLORREF crColorBk)
00355 {
00356     m_crColorBk = crColorBk;
00357
00358     //BEGIN SRO
00359     CheckTextColor(crColorBk);
00360     //END SRO
00361
00362     if (IsWindow(m_hWnd)) RedrawWindow();
00363 }
00364
00365 void CCJColorPicker::SetTextColor(COLORREF crColorText)
00366 {
00367     m_crColorText = crColorText;
00368     if (IsWindow(m_hWnd)) RedrawWindow();
00369 }
00370
00371 void CCJColorPicker::SetDefaultText(LPCTSTR szDefaultText)
00372 {
00373     m_strDefaultText = (szDefaultText)? szDefaultText : _T("");
00374 }
00375
00376 void CCJColorPicker::SetCustomText(LPCTSTR szCustomText)
00377 {
00378     m_strCustomText = (szCustomText)? szCustomText : _T("");
00379 }
00380
00382 // CCJColorPicker implementation
00383
00384 void CCJColorPicker::SetWindowSize()
00385 {
00386     // 10-14-1999 - Kirk Stowell - Added to help reduce flicker, we only need to make
00387     // a call to GetParent() once at initialization.
00388     m_pParentWnd = GetParent();
00389
00390     // Get size dimensions of edges
00391     CSize MarginSize(::GetSystemMetrics(SM_CXEDGE), ::GetSystemMetrics(SM_CYEDGE));
00392
00393     // Get size of dropdown arrow
00394     int nArrowWidth = max(::GetSystemMetrics(SM_CXHTHUMB), 5*MarginSize.cx);
00395     int nArrowHeight = max(::GetSystemMetrics(SM_CYVTHUMB), 5*MarginSize.cy);
00396     CSize ArrowSize(max(nArrowWidth, nArrowHeight), max(nArrowWidth, nArrowHeight));
00397
00398     // Get window size
00399     CRect rect;
00400     GetWindowRect(rect);
00401
00402     if (m_pParentWnd) {
00403         m_pParentWnd->ScreenToClient(rect);
00404     }
00405
00406     // Set window size at least as wide as 2 arrows, and as high as arrow + margins
00407     int nWidth = max(rect.Width(), 2*ArrowSize.cx + 2*MarginSize.cx);
00408     MoveWindow(rect.left, rect.top, nWidth, ArrowSize.cy+2*MarginSize.cy, TRUE);
00409
00410     // Get the new coords of this window
00411     GetWindowRect(rect);
00412     ScreenToClient(rect);
00413
00414     // Get the rect where the arrow goes, and convert to client coords.
00415     m_ArrowRect.SetRect(rect.right - ArrowSize.cx - MarginSize.cx,
00416                         rect.top + MarginSize.cy, rect.right - MarginSize.cx,
00417                         rect.bottom - MarginSize.cy);
00418 }
00419
00420 void CCJColorPicker::CheckTextColor(COLORREF crColor)
00421 {
00422     int R = GetRValue(crColor);
00423     int G = GetGValue(crColor);
00424     int B = GetBValue(crColor);
00425
00426     double Intensity = .299 * R + .587 * G + .114 * B ;
00427
00428     if ( Intensity >= 127 ) {
00429         SetTextColor(RGB(0,0,0));
00430     } else {
00431         SetTextColor(RGB(255,255,255));
00432     }
00433 }
00434
00435 BOOL CCJColorPicker::OnEraseBkgnd(CDC* pDC)
00436 {
00437     // overridden for flicker-free drawing.
00438     UNUSED_ALWAYS(pDC);
00439     return TRUE;
00440 }
00441
00442 void CCJColorPicker::OnPaint()
00443 {
00444     CPaintDC dc(this); // device context for painting
00445
00446     // KStowell - Get the client rect.
00447     CRect rcClient, rcClip;
00448     dc.GetClipBox( &rcClip );
00449     GetClientRect( &rcClient );
00450
00451     // KStowell - Create a memory device-context. This is done to help reduce
00452     // screen flicker, since we will paint the entire control to the
00453     // off screen device context first.
00454     CDC memDC;
00455     CBitmap bitmap;
00456     memDC.CreateCompatibleDC(&dc);
00457     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00458     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00459
00460     // KStowell - Repaint the background.
00461     memDC.FillSolidRect( rcClient, ::GetSysColor(COLOR_WINDOW) );
00462
00463     // let the control do its default drawing.
00464     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00465
00466     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00467     dc.BitBlt( rcClip.left, rcClip.top, rcClip.Width(), rcClip.Height(), &memDC,
00468         rcClip.left, rcClip.top, SRCCOPY );
00469
00470     // KStowell - Cleanup resources.
00471     memDC.SelectObject(pOldBitmap);
00472     memDC.DeleteDC();
00473     bitmap.DeleteObject();
00474 }
Generated on Sun Feb 24 01:21:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJColorPopup.cpp Source File

WinCvs/CJLib/CJLibrary/CJColorPopup.cpp

Go to the documentation of this file.
00001 // CJColorPopup.cpp : implementation file
00002 //
00003 // Written by Chris Maunder (chrismaunder@codeguru.com)
00004 // Extended by Alexander Bischofberger (bischofb@informatik.tu-muenchen.de)
00005 // Copyright (c) 1998.
00006 //
00007 // Updated 30 May 1998 to allow any number of Colors, and to
00008 //                     make the appearance closer to Office 97.
00009 //                     Also added "Default" text area.         (CJM)
00010 //
00011 //         13 June 1998 Fixed change of focus bug (CJM)
00012 //         30 June 1998 Fixed bug caused by focus bug fix (D'oh!!)
00013 //                      Solution suggested by Paul Wilkerson.
00014 //
00015 // CJColorPopup is a helper class for the Color picker control
00016 // CJColorPicker. Check out the header file or the accompanying
00017 // HTML doc file for details.
00018 //
00019 // This code may be used in compiled form in any way you desire. This
00020 // file may be redistributed unmodified by any means PROVIDING it is
00021 // not sold for profit without the authors written consent, and
00022 // providing that this notice and the authors name is included.
00023 //
00024 // This file is provided "as is" with no expressed or implied warranty.
00025 // The author accepts no liability if it causes any damage to you or your
00026 // computer whatsoever. It's free, so don't hassle me about it.
00027 //
00028 // Expect bugs.
00029 //
00030 // Please use and enjoy. Please let me know of any bugs/mods/improvements
00031 // that you have found/implemented and I will fix/incorporate them into this
00032 // file.
00033 //
00035 /****************************************************************************
00036  *
00037  * $Date: 1999/11/30 21:45:48 $
00038  * $Revision: 1.1.1.2 $
00039  * $Archive: /CodeJock/CJLibrary/CJColorPopup.cpp $
00040  *
00041  * $History: CJColorPopup.cpp $
00042  *
00043  * *****************  Version 9  *****************
00044  * User: Kirk Stowell Date: 10/31/99   Time: 11:54p
00045  * Updated in $/CodeJock/CJLibrary
00046  * Overrode OnEraseBkgnd(...) and made modifications to OnPaint(...) to
00047  * handle flicker free drawing.
00048  *
00049  * Modified resource include for static builds.
00050  *
00051  * Fixed potential resource and memory leak problems.
00052  *
00053  * Made class methods virtual for inheritance purposes.
00054  *
00055  * *****************  Version 8  *****************
00056  * User: Kirk Stowell Date: 10/14/99   Time: 12:23p
00057  * Updated in $/CodeJock/CJLibrary
00058  * Added source control history to file header.
00059  *
00060  ***************************************************************************/
00062
00063 #include "stdafx.h"
00064 #include <math.h>
00065 #include "CJColorPicker.h"
00066 #include "CJColorPopup.h"
00067 #include "CJResource.h"
00068
00069 #ifdef _DEBUG
00070 #define new DEBUG_NEW
00071 #undef THIS_FILE
00072 static char THIS_FILE[] = __FILE__;
00073 #endif
00074
00075 #define DEFAULT_BOX_VALUE -3
00076 #define CUSTOM_BOX_VALUE  -2
00077 #define INVALID_Color    -1
00078
00079 #define MAX_ColorS          100
00080 #define NUM_COLUMNS         10
00081
00082 ColorTableEntry CCJColorPopup::m_crColors[] =
00083 {
00084     { RGB(0x00, 0x00, 0x00),    _T("Black")             },
00085     { RGB(0xA5, 0x2A, 0x00),    _T("Brown")             },
00086     { RGB(0x00, 0x40, 0x40),    _T("Dark Olive Green")  },
00087     { RGB(0x00, 0x55, 0x00),    _T("Dark Green")        },
00088     { RGB(0x00, 0x00, 0x5E),    _T("Dark Teal")         },
00089     { RGB(0x00, 0x00, 0x8B),    _T("Dark blue")         },
00090     { RGB(0x4B, 0x00, 0x82),    _T("Indigo")            },
00091     { RGB(0x28, 0x28, 0x28),    _T("Dark grey")         },
00092
00093     { RGB(0x8B, 0x00, 0x00),    _T("Dark red")          },
00094     { RGB(0xFF, 0x68, 0x20),    _T("Orange")            },
00095     { RGB(0x8B, 0x8B, 0x00),    _T("Dark yellow")       },
00096     { RGB(0x00, 0x93, 0x00),    _T("Green")             },
00097     { RGB(0x38, 0x8E, 0x8E),    _T("Teal")              },
00098     { RGB(0x00, 0x00, 0xFF),    _T("Blue")              },
00099     { RGB(0x7B, 0x7B, 0xC0),    _T("Blue-grey")         },
00100     { RGB(0x66, 0x66, 0x66),    _T("Grey - 40")         },
00101
00102     { RGB(0xFF, 0x00, 0x00),    _T("Red")               },
00103     { RGB(0xFF, 0xAD, 0x5B),    _T("Light orange")      },
00104     { RGB(0x32, 0xCD, 0x32),    _T("Lime")              },
00105     { RGB(0x3C, 0xB3, 0x71),    _T("Sea green")         },
00106     { RGB(0x7F, 0xFF, 0xD4),    _T("Aqua")              },
00107     { RGB(0x7D, 0x9E, 0xC0),    _T("Light blue")        },
00108     { RGB(0x80, 0x00, 0x80),    _T("Violet")            },
00109     { RGB(0x7F, 0x7F, 0x7F),    _T("Grey - 50")         },
00110
00111     { RGB(0xFF, 0xC0, 0xCB),    _T("Pink")              },
00112     { RGB(0xFF, 0xD7, 0x00),    _T("Gold")              },
00113     { RGB(0xFF, 0xFF, 0x00),    _T("Yellow")            },
00114     { RGB(0x00, 0xFF, 0x00),    _T("Bright green")      },
00115     { RGB(0x40, 0xE0, 0xD0),    _T("Turquoise")         },
00116     { RGB(0xC0, 0xFF, 0xFF),    _T("Skyblue")           },
00117     { RGB(0x48, 0x00, 0x48),    _T("Plum")              },
00118     { RGB(0xC0, 0xC0, 0xC0),    _T("Light grey")        },
00119
00120     { RGB(0xFF, 0xE4, 0xE1),    _T("Rose")              },
00121     { RGB(0xD2, 0xB4, 0x8C),    _T("Tan")               },
00122     { RGB(0xFF, 0xFF, 0xE0),    _T("Light yellow")      },
00123     { RGB(0x98, 0xFB, 0x98),    _T("Pale green ")       },
00124     { RGB(0xAF, 0xEE, 0xEE),    _T("Pale turquoise")    },
00125     { RGB(0x68, 0x83, 0x8B),    _T("Pale blue")         },
00126     { RGB(0xE6, 0xE6, 0xFA),    _T("Lavender")          },
00127     { RGB(0xFF, 0xFF, 0xFF),    _T("White")             }
00128 };
00129
00131 // CCJColorPopup
00132
00133 CCJColorPopup::CCJColorPopup()
00134 {
00135     Initialise();
00136 }
00137
00138 CCJColorPopup::CCJColorPopup(CPoint p, COLORREF crColor, CWnd* pParentWnd,
00139                            LPCTSTR szDefaultText /* = NULL */,
00140                            LPCTSTR szCustomText  /* = NULL */)
00141 {
00142     Initialise();
00143
00144     m_crColor       = m_crInitialColor = crColor;
00145     m_pParent        = pParentWnd;
00146
00147 // 1999-06-11 begin mods KStowell
00148     if( szDefaultText == NULL )
00149         m_strDefaultText.LoadString( IDS_COLOR_AUTO );
00150     else
00151         m_strDefaultText = szDefaultText;
00152
00153     if( szCustomText == NULL )
00154         m_strCustomText.LoadString( IDS_COLOR_CUST );
00155     else
00156         m_strCustomText = szCustomText;
00157 // 1999-06-11 end mods KStowell
00158
00159     CCJColorPopup::Create(p, crColor, pParentWnd, szDefaultText, szCustomText);
00160 }
00161
00162 void CCJColorPopup::Initialise()
00163 {
00164     m_nNumColors       = sizeof(m_crColors)/sizeof(ColorTableEntry);
00165     ASSERT(m_nNumColors <= MAX_ColorS);
00166     if (m_nNumColors > MAX_ColorS)
00167         m_nNumColors = MAX_ColorS;
00168
00169     m_nNumColumns       = 0;
00170     m_nNumRows          = 0;
00171     m_nBoxSize          = 18;
00172     m_nMargin           = ::GetSystemMetrics(SM_CXEDGE);
00173     m_nCurrentSel       = INVALID_Color;
00174     m_nChosenColorSel  = INVALID_Color;
00175     m_pParent           = NULL;
00176     m_crColor          = m_crInitialColor = RGB(0,0,0);
00177
00178     // Idiot check: Make sure the Color square is at least 5 x 5;
00179     if (m_nBoxSize - 2*m_nMargin - 2 < 5) m_nBoxSize = 5 + 2*m_nMargin + 2;
00180
00181     // Create the palette
00182     struct {
00183         LOGPALETTE    LogPalette;
00184         PALETTEENTRY  PalEntry[MAX_ColorS];
00185     } pal;
00186
00187     LOGPALETTE* pLogPalette = (LOGPALETTE*) &pal;
00188     pLogPalette->palVersion    = 0x300;
00189     pLogPalette->palNumEntries = (WORD) m_nNumColors;
00190
00191     for (int i = 0; i < m_nNumColors; i++)
00192     {
00193         pLogPalette->palPalEntry[i].peRed   = GetRValue(m_crColors[i].crColor);
00194         pLogPalette->palPalEntry[i].peGreen = GetGValue(m_crColors[i].crColor);
00195         pLogPalette->palPalEntry[i].peBlue  = GetBValue(m_crColors[i].crColor);
00196         pLogPalette->palPalEntry[i].peFlags = 0;
00197     }
00198
00199     m_Palette.CreatePalette(pLogPalette);
00200 }
00201
00202 CCJColorPopup::~CCJColorPopup()
00203 {
00204     m_Font.DeleteObject();
00205     m_Palette.DeleteObject();
00206 }
00207
00208 BOOL CCJColorPopup::Create(CPoint p, COLORREF crColor, CWnd* pParentWnd,
00209                           LPCTSTR szDefaultText /* = NULL */,
00210                           LPCTSTR szCustomText  /* = NULL */)
00211 {
00212     ASSERT(pParentWnd && ::IsWindow(pParentWnd->GetSafeHwnd()));
00213     ASSERT(pParentWnd->IsKindOf(RUNTIME_CLASS(CCJColorPicker)));
00214
00215     m_pParent  = pParentWnd;
00216     m_crColor = m_crInitialColor = crColor;
00217
00218     // Get the class name and create the window
00219     CString szClassName = AfxRegisterWndClass(CS_CLASSDC|CS_SAVEBITS|CS_HREDRAW|CS_VREDRAW,
00220                                               0,
00221                                               (HBRUSH) (COLOR_BTNFACE+1),
00222                                               0);
00223
00224     if (!CWnd::CreateEx(0, szClassName, _T(""), WS_VISIBLE|WS_POPUP,
00225                         p.x, p.y, 100, 100, // size updated soon
00226                         pParentWnd->GetSafeHwnd(), 0, NULL))
00227         return FALSE;
00228
00229     UpdateFont();
00230
00231     // Store the Custom text
00232     if (szCustomText != NULL)
00233         m_strCustomText = szCustomText;
00234
00235     // Store the Default Area text
00236     if (szDefaultText != NULL)
00237         m_strDefaultText = szDefaultText;
00238
00239     // Set the window size
00240     SetWindowSize();
00241
00242     // Create the tooltips
00243     CreateToolTips();
00244
00245     // Find which cell (if any) corresponds to the initial Color
00246     FindCellFromColor(crColor);
00247
00248     // Capture all mouse events for the life of this window
00249     SetCapture();
00250
00251     return TRUE;
00252 }
00253
00254 BEGIN_MESSAGE_MAP(CCJColorPopup, CWnd)
00255     //{{AFX_MSG_MAP(CCJColorPopup)
00256     ON_WM_NCDESTROY()
00257     ON_WM_LBUTTONUP()
00258     ON_WM_PAINT()
00259     ON_WM_MOUSEMOVE()
00260     ON_WM_KEYDOWN()
00261     ON_WM_QUERYNEWPALETTE()
00262     ON_WM_PALETTECHANGED()
00263     ON_WM_KILLFOCUS()
00264     ON_WM_ACTIVATEAPP()
00265     ON_WM_ERASEBKGND()
00266     //}}AFX_MSG_MAP
00267 END_MESSAGE_MAP()
00268
00270 // CCJColorPopup message handlers
00271
00272 // For tooltips
00273 BOOL CCJColorPopup::PreTranslateMessage(MSG* pMsg)
00274 {
00275     m_ToolTip.RelayEvent(pMsg);
00276     return CWnd::PreTranslateMessage(pMsg);
00277 }
00278
00279 // If an arrow key is pressed, then move the selection
00280 void CCJColorPopup::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
00281 {
00282     int row = GetRow(m_nCurrentSel),
00283         col = GetColumn(m_nCurrentSel);
00284
00285     if (nChar == VK_DOWN)
00286     {
00287         if (row == DEFAULT_BOX_VALUE)
00288             row = col = 0;
00289         else if (row == CUSTOM_BOX_VALUE)
00290         {
00291             if (m_strDefaultText.GetLength())
00292                 row = col = DEFAULT_BOX_VALUE;
00293             else
00294                 row = col = 0;
00295         }
00296         else
00297         {
00298             row++;
00299             if (GetIndex(row,col) < 0)
00300             {
00301                 if (m_strCustomText.GetLength())
00302                     row = col = CUSTOM_BOX_VALUE;
00303                 else if (m_strDefaultText.GetLength())
00304                     row = col = DEFAULT_BOX_VALUE;
00305                 else
00306                     row = col = 0;
00307             }
00308         }
00309         ChangeSelection(GetIndex(row, col));
00310     }
00311
00312     if (nChar == VK_UP)
00313     {
00314         if (row == DEFAULT_BOX_VALUE)
00315         {
00316             if (m_strCustomText.GetLength())
00317                 row = col = CUSTOM_BOX_VALUE;
00318             else
00319            {
00320                 row = GetRow(m_nNumColors-1);
00321                 col = GetColumn(m_nNumColors-1);
00322             }
00323         }
00324         else if (row == CUSTOM_BOX_VALUE)
00325         {
00326             row = GetRow(m_nNumColors-1);
00327             col = GetColumn(m_nNumColors-1);
00328         }
00329         else if (row > 0) row--;
00330         else /* row == 0 */
00331         {
00332             if (m_strDefaultText.GetLength())
00333                 row = col = DEFAULT_BOX_VALUE;
00334             else if (m_strCustomText.GetLength())
00335                 row = col = CUSTOM_BOX_VALUE;
00336             else
00337             {
00338                 row = GetRow(m_nNumColors-1);
00339                 col = GetColumn(m_nNumColors-1);
00340             }
00341         }
00342         ChangeSelection(GetIndex(row, col));
00343     }
00344
00345     if (nChar == VK_RIGHT)
00346     {
00347         if (row == DEFAULT_BOX_VALUE)
00348             row = col = 0;
00349         else if (row == CUSTOM_BOX_VALUE)
00350         {
00351             if (m_strDefaultText.GetLength())
00352                 row = col = DEFAULT_BOX_VALUE;
00353             else
00354                 row = col = 0;
00355         }
00356         else if (col < m_nNumColumns-1)
00357             col++;
00358         else
00359         {
00360             col = 0; row++;
00361         }
00362
00363         if (GetIndex(row,col) == INVALID_Color)
00364         {
00365             if (m_strCustomText.GetLength())
00366                 row = col = CUSTOM_BOX_VALUE;
00367             else if (m_strDefaultText.GetLength())
00368                 row = col = DEFAULT_BOX_VALUE;
00369             else
00370                 row = col = 0;
00371         }
00372
00373         ChangeSelection(GetIndex(row, col));
00374     }
00375
00376     if (nChar == VK_LEFT)
00377     {
00378         if (row == DEFAULT_BOX_VALUE)
00379         {
00380             if (m_strCustomText.GetLength())
00381                 row = col = CUSTOM_BOX_VALUE;
00382             else
00383            {
00384                 row = GetRow(m_nNumColors-1);
00385                 col = GetColumn(m_nNumColors-1);
00386             }
00387         }
00388         else if (row == CUSTOM_BOX_VALUE)
00389         {
00390             row = GetRow(m_nNumColors-1);
00391             col = GetColumn(m_nNumColors-1);
00392         }
00393         else if (col > 0) col--;
00394         else /* col == 0 */
00395         {
00396             if (row > 0) { row--; col = m_nNumColumns-1; }
00397             else
00398             {
00399                 if (m_strDefaultText.GetLength())
00400                     row = col = DEFAULT_BOX_VALUE;
00401                 else if (m_strCustomText.GetLength())
00402                     row = col = CUSTOM_BOX_VALUE;
00403                 else
00404                 {
00405                     row = GetRow(m_nNumColors-1);
00406                     col = GetColumn(m_nNumColors-1);
00407                 }
00408             }
00409         }
00410         ChangeSelection(GetIndex(row, col));
00411     }
00412
00413     if (nChar == VK_ESCAPE)
00414     {
00415         m_crColor = m_crInitialColor;
00416         EndSelection(CPN_SELENDCANCEL);
00417         return;
00418     }
00419
00420     if (nChar == VK_RETURN || nChar == VK_SPACE)
00421     {
00422         EndSelection(CPN_SELENDOK);
00423         return;
00424     }
00425
00426     CWnd::OnKeyDown(nChar, nRepCnt, nFlags);
00427 }
00428
00429 // auto-deletion
00430 void CCJColorPopup::OnNcDestroy()
00431 {
00432     CWnd::OnNcDestroy();
00433     delete this;
00434 }
00435
00436 void CCJColorPopup::OnPaint()
00437 {
00438     CPaintDC dc(this); // device context for painting
00439
00440     // KStowell - Get the client rect for this control.
00441     CRect rcClient;
00442     GetClientRect(&rcClient);
00443
00444     // KStowell - Create a memory device-context. This is done to help reduce
00445     // screen flicker, since we will paint the entire control to the
00446     // off screen device context first.
00447     CDC memDC;
00448     memDC.CreateCompatibleDC(&dc);
00449     CBitmap bitmap;
00450     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00451     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00452     memDC.FillSolidRect(rcClient, ::GetSysColor(COLOR_BTNFACE));
00453
00454     // Draw the Default Area text
00455     if (m_strDefaultText.GetLength())
00456         DrawCell(&memDC, DEFAULT_BOX_VALUE);
00457
00458     // Draw Color cells
00459     for (int i = 0; i < m_nNumColors; i++)
00460         DrawCell(&memDC, i);
00461
00462     // Draw custom text
00463     if (m_strCustomText.GetLength())
00464         DrawCell(&memDC, CUSTOM_BOX_VALUE);
00465
00466     // Draw raised window edge (ex-window style WS_EX_WINDOWEDGE is sposed to do this,
00467     // but for some reason isn't
00468     CRect rect;
00469     GetClientRect(rect);
00470     memDC.DrawEdge(rect, EDGE_RAISED, BF_RECT);
00471
00472     // KStowell - copy the memory device context back into the original DC via BitBlt().
00473     dc.BitBlt(rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), &memDC, 0,0, SRCCOPY);
00474
00475     // KStowell - cleanup.
00476     memDC.SelectObject(pOldBitmap);
00477     memDC.DeleteDC();
00478     bitmap.DeleteObject();
00479 }
00480
00481 void CCJColorPopup::OnMouseMove(UINT nFlags, CPoint point)
00482 {
00483     int nNewSelection = INVALID_Color;
00484
00485     // Translate points to be relative raised window edge
00486     point.x -= m_nMargin;
00487     point.y -= m_nMargin;
00488
00489     // First check we aren't in text box
00490     if (m_strCustomText.GetLength() && m_CustomTextRect.PtInRect(point))
00491         nNewSelection = CUSTOM_BOX_VALUE;
00492     else if (m_strDefaultText.GetLength() && m_DefaultTextRect.PtInRect(point))
00493         nNewSelection = DEFAULT_BOX_VALUE;
00494     else
00495     {
00496         // Take into account text box
00497         if (m_strDefaultText.GetLength())
00498             point.y -= m_DefaultTextRect.Height();
00499
00500         // Get the row and column
00501         nNewSelection = GetIndex(point.y / m_nBoxSize, point.x / m_nBoxSize);
00502
00503         // In range? If not, default and exit
00504         if (nNewSelection < 0 || nNewSelection >= m_nNumColors)
00505         {
00506             CWnd::OnMouseMove(nFlags, point);
00507             return;
00508         }
00509     }
00510
00511     // OK - we have the row and column of the current selection (may be CUSTOM_BOX_VALUE)
00512     // Has the row/col selection changed? If yes, then redraw old and new cells.
00513     if (nNewSelection != m_nCurrentSel)
00514         ChangeSelection(nNewSelection);
00515
00516     CWnd::OnMouseMove(nFlags, point);
00517 }
00518
00519 // End selection on LButtonUp
00520 void CCJColorPopup::OnLButtonUp(UINT nFlags, CPoint point)
00521 {
00522     CWnd::OnLButtonUp(nFlags, point);
00523
00524     DWORD pos = GetMessagePos();
00525     point = CPoint(LOWORD(pos), HIWORD(pos));
00526
00527     if (m_WindowRect.PtInRect(point))
00528         EndSelection(CPN_SELENDOK);
00529     else
00530         EndSelection(CPN_SELENDCANCEL);
00531 }
00532
00534 // CCJColorPopup implementation
00535
00536 int CCJColorPopup::GetIndex(int row, int col) const
00537 {
00538     if ((row == CUSTOM_BOX_VALUE || col == CUSTOM_BOX_VALUE) && m_strCustomText.GetLength())
00539         return CUSTOM_BOX_VALUE;
00540     else if ((row == DEFAULT_BOX_VALUE || col == DEFAULT_BOX_VALUE) && m_strDefaultText.GetLength())
00541         return DEFAULT_BOX_VALUE;
00542     else if (row < 0 || col < 0 || row >= m_nNumRows || col >= m_nNumColumns)
00543         return INVALID_Color;
00544     else
00545     {
00546         if (row*m_nNumColumns + col >= m_nNumColors)
00547             return INVALID_Color;
00548         else
00549             return row*m_nNumColumns + col;
00550     }
00551 }
00552
00553 int CCJColorPopup::GetRow(int nIndex) const
00554 {
00555     if (nIndex == CUSTOM_BOX_VALUE && m_strCustomText.GetLength())
00556         return CUSTOM_BOX_VALUE;
00557     else if (nIndex == DEFAULT_BOX_VALUE && m_strDefaultText.GetLength())
00558         return DEFAULT_BOX_VALUE;
00559     else if (nIndex < 0 || nIndex >= m_nNumColors)
00560         return INVALID_Color;
00561     else
00562         return nIndex / m_nNumColumns;
00563 }
00564
00565 int CCJColorPopup::GetColumn(int nIndex) const
00566 {
00567     if (nIndex == CUSTOM_BOX_VALUE && m_strCustomText.GetLength())
00568         return CUSTOM_BOX_VALUE;
00569     else if (nIndex == DEFAULT_BOX_VALUE && m_strDefaultText.GetLength())
00570         return DEFAULT_BOX_VALUE;
00571     else if (nIndex < 0 || nIndex >= m_nNumColors)
00572         return INVALID_Color;
00573     else
00574         return nIndex % m_nNumColumns;
00575 }
00576
00577 void CCJColorPopup::FindCellFromColor(COLORREF crColor)
00578 {
00579     if (crColor == CLR_DEFAULT && m_strDefaultText.GetLength())
00580     {
00581         m_nChosenColorSel = DEFAULT_BOX_VALUE;
00582         return;
00583     }
00584
00585     for (int i = 0; i < m_nNumColors; i++)
00586     {
00587         if (GetColor(i) == crColor)
00588         {
00589             m_nChosenColorSel = i;
00590             return;
00591         }
00592     }
00593
00594     if (m_strCustomText.GetLength())
00595         m_nChosenColorSel = CUSTOM_BOX_VALUE;
00596     else
00597         m_nChosenColorSel = INVALID_Color;
00598 }
00599
00600 // Gets the dimensions of the Color cell given by (row,col)
00601 BOOL CCJColorPopup::GetCellRect(int nIndex, const LPRECT& rect)
00602 {
00603     if (nIndex == CUSTOM_BOX_VALUE)
00604     {
00605         ::SetRect(rect,
00606                   m_CustomTextRect.left,  m_CustomTextRect.top,
00607                   m_CustomTextRect.right, m_CustomTextRect.bottom);
00608         return TRUE;
00609     }
00610     else if (nIndex == DEFAULT_BOX_VALUE)
00611     {
00612         ::SetRect(rect,
00613                   m_DefaultTextRect.left,  m_DefaultTextRect.top,
00614                   m_DefaultTextRect.right, m_DefaultTextRect.bottom);
00615         return TRUE;
00616     }
00617
00618     if (nIndex < 0 || nIndex >= m_nNumColors)
00619         return FALSE;
00620
00621     rect->left = GetColumn(nIndex) * m_nBoxSize + m_nMargin;
00622     rect->top  = GetRow(nIndex) * m_nBoxSize + m_nMargin;
00623
00624     // Move everything down if we are displaying a default text area
00625     if (m_strDefaultText.GetLength())
00626         rect->top += (m_nMargin + m_DefaultTextRect.Height());
00627
00628     rect->right = rect->left + m_nBoxSize;
00629     rect->bottom = rect->top + m_nBoxSize;
00630
00631     return TRUE;
00632 }
00633
00634 // Works out an appropriate size and position of this window
00635 void CCJColorPopup::SetWindowSize()
00636 {
00637     CSize TextSize;
00638
00639     // If we are showing a custom or default text area, get the font and text size.
00640     if (m_strCustomText.GetLength() || m_strDefaultText.GetLength())
00641     {
00642         CClientDC dc(this);
00643         CFont* pOldFont = (CFont*) dc.SelectObject(&m_Font);
00644
00645         // Get the size of the custom text (if there IS custom text)
00646         TextSize = CSize(0,0);
00647         if (m_strCustomText.GetLength())
00648             TextSize = dc.GetTextExtent(m_strCustomText);
00649
00650         // Get the size of the default text (if there IS default text)
00651         if (m_strDefaultText.GetLength())
00652         {
00653             CSize DefaultSize = dc.GetTextExtent(m_strDefaultText);
00654             if (DefaultSize.cx > TextSize.cx) TextSize.cx = DefaultSize.cx;
00655             if (DefaultSize.cy > TextSize.cy) TextSize.cy = DefaultSize.cy;
00656         }
00657
00658         dc.SelectObject(pOldFont);
00659         TextSize += CSize(2*m_nMargin,2*m_nMargin);
00660
00661         // Add even more space to draw the horizontal line
00662         TextSize.cy += 2*m_nMargin + 2;
00663     }
00664
00665     // Get the number of columns and rows
00666     //m_nNumColumns = (int) sqrt((double)m_nNumColors);    // for a square window (yuk)
00667     m_nNumColumns = NUM_COLUMNS;
00668     m_nNumRows = m_nNumColors / m_nNumColumns;
00669     if (m_nNumColors % m_nNumColumns) m_nNumRows++;
00670
00671     // Get the current window position, and set the new size
00672     CRect rect;
00673     GetWindowRect(rect);
00674
00675     m_WindowRect.SetRect(rect.left, rect.top,
00676                          rect.left + m_nNumColumns*m_nBoxSize + 2*m_nMargin,
00677                          rect.top  + m_nNumRows*m_nBoxSize + 2*m_nMargin);
00678
00679     // if custom text, then expand window if necessary, and set text width as
00680     // window width
00681     if (m_strDefaultText.GetLength())
00682     {
00683         if (TextSize.cx > m_WindowRect.Width())
00684             m_WindowRect.right = m_WindowRect.left + TextSize.cx;
00685         TextSize.cx = m_WindowRect.Width()-2*m_nMargin;
00686
00687         // Work out the text area
00688         m_DefaultTextRect.SetRect(m_nMargin, m_nMargin,
00689                                   m_nMargin+TextSize.cx, 2*m_nMargin+TextSize.cy);
00690         m_WindowRect.bottom += m_DefaultTextRect.Height() + 2*m_nMargin;
00691     }
00692
00693     // if custom text, then expand window if necessary, and set text width as
00694     // window width
00695     if (m_strCustomText.GetLength())
00696     {
00697         if (TextSize.cx > m_WindowRect.Width())
00698             m_WindowRect.right = m_WindowRect.left + TextSize.cx;
00699         TextSize.cx = m_WindowRect.Width()-2*m_nMargin;
00700
00701         // Work out the text area
00702         m_CustomTextRect.SetRect(m_nMargin, m_WindowRect.Height(),
00703                                  m_nMargin+TextSize.cx,
00704                                  m_WindowRect.Height()+m_nMargin+TextSize.cy);
00705         m_WindowRect.bottom += m_CustomTextRect.Height() + 2*m_nMargin;
00706    }
00707
00708     // Need to check it'll fit on screen: Too far right?
00709     CSize ScreenSize(::GetSystemMetrics(SM_CXSCREEN), ::GetSystemMetrics(SM_CYSCREEN));
00710     if (m_WindowRect.right > ScreenSize.cx)
00711         m_WindowRect.OffsetRect(-(m_WindowRect.right - ScreenSize.cx), 0);
00712
00713     // Too far left?
00714     if (m_WindowRect.left < 0)
00715         m_WindowRect.OffsetRect( -m_WindowRect.left, 0);
00716
00717     // Bottom falling out of screen?
00718     if (m_WindowRect.bottom > ScreenSize.cy)
00719     {
00720         CRect ParentRect;
00721         m_pParent->GetWindowRect(ParentRect);
00722         m_WindowRect.OffsetRect(0, -(ParentRect.Height() + m_WindowRect.Height()));
00723     }
00724
00725     // Set the window size and position
00726     MoveWindow(m_WindowRect, TRUE);
00727 }
00728
00729 void CCJColorPopup::CreateToolTips()
00730 {
00731     // Create the tool tip
00732     if (!m_ToolTip.Create(this)) return;
00733
00734     // Add a tool for each cell
00735     for (int i = 0; i < m_nNumColors; i++)
00736     {
00737         CRect rect;
00738         if (!GetCellRect(i, rect)) continue;
00739             m_ToolTip.AddTool(this, GetColorName(i), rect, 1);
00740     }
00741 }
00742
00743 void CCJColorPopup::ChangeSelection(int nIndex)
00744 {
00745     CClientDC dc(this);        // device context for drawing
00746
00747     if (nIndex > m_nNumColors)
00748         nIndex = CUSTOM_BOX_VALUE;
00749
00750     if ((m_nCurrentSel >= 0 && m_nCurrentSel < m_nNumColors) ||
00751         m_nCurrentSel == CUSTOM_BOX_VALUE || m_nCurrentSel == DEFAULT_BOX_VALUE)
00752     {
00753         // Set Current selection as invalid and redraw old selection (this way
00754         // the old selection will be drawn unselected)
00755         int OldSel = m_nCurrentSel;
00756         m_nCurrentSel = INVALID_Color;
00757         DrawCell(&dc, OldSel);
00758     }
00759
00760     // Set the current selection as row/col and draw (it will be drawn selected)
00761     m_nCurrentSel = nIndex;
00762     DrawCell(&dc, m_nCurrentSel);
00763
00764     // Store the current Color
00765     if (m_nCurrentSel == CUSTOM_BOX_VALUE)
00766         m_pParent->SendMessage(CPN_SELCHANGE, (WPARAM) m_crInitialColor, 0);
00767     else if (m_nCurrentSel == DEFAULT_BOX_VALUE)
00768     {
00769         m_crColor = CLR_DEFAULT;
00770         m_pParent->SendMessage(CPN_SELCHANGE, (WPARAM) CLR_DEFAULT, 0);
00771     }
00772     else
00773     {
00774         m_crColor = GetColor(m_nCurrentSel);
00775         m_pParent->SendMessage(CPN_SELCHANGE, (WPARAM) m_crColor, 0);
00776     }
00777 }
00778
00779 void CCJColorPopup::EndSelection(int nMessage)
00780 {
00781     ReleaseCapture();
00782
00783     // If custom text selected, perform a custom Color selection
00784     if (nMessage != CPN_SELENDCANCEL && m_nCurrentSel == CUSTOM_BOX_VALUE)
00785     {
00786         CColorDialog dlg(m_crInitialColor, CC_FULLOPEN | CC_ANYCOLOR, this);
00787
00788         if (dlg.DoModal() == IDOK)
00789             m_crColor = dlg.GetColor();
00790         else
00791             nMessage = CPN_SELENDCANCEL;
00792     }
00793
00794     if (nMessage == CPN_SELENDCANCEL)
00795         m_crColor = m_crInitialColor;
00796
00797     m_pParent->SendMessage(nMessage, (WPARAM) m_crColor, 0);
00798
00799     DestroyWindow();
00800 }
00801
00802 void CCJColorPopup::DrawCell(CDC* pDC, int nIndex)
00803 {
00804     // For the Custom Text area
00805     if (m_strCustomText.GetLength() && nIndex == CUSTOM_BOX_VALUE)
00806     {
00807         // The extent of the actual text button
00808         CRect TextButtonRect = m_CustomTextRect;
00809         TextButtonRect.top += 2*m_nMargin;
00810
00811         // Fill background
00812         pDC->FillSolidRect(TextButtonRect, ::GetSysColor(COLOR_3DFACE));
00813
00814         // Draw horizontal line
00815         pDC->FillSolidRect(m_CustomTextRect.left+2*m_nMargin, m_CustomTextRect.top,
00816                            m_CustomTextRect.Width()-4*m_nMargin, 1, ::GetSysColor(COLOR_3DSHADOW));
00817         pDC->FillSolidRect(m_CustomTextRect.left+2*m_nMargin, m_CustomTextRect.top+1,
00818                            m_CustomTextRect.Width()-4*m_nMargin, 1, ::GetSysColor(COLOR_3DHILIGHT));
00819
00820         TextButtonRect.DeflateRect(1,1);
00821
00822         // fill background
00823         if (m_nChosenColorSel == nIndex && m_nCurrentSel != nIndex)
00824             pDC->FillSolidRect(TextButtonRect, ::GetSysColor(COLOR_3DLIGHT));
00825         else
00826             pDC->FillSolidRect(TextButtonRect, ::GetSysColor(COLOR_3DFACE));
00827
00828         // Draw button
00829         if (m_nCurrentSel == nIndex)
00830             pDC->DrawEdge(TextButtonRect, BDR_RAISEDINNER, BF_RECT);
00831         else if (m_nChosenColorSel == nIndex)
00832             pDC->DrawEdge(TextButtonRect, BDR_SUNKENOUTER, BF_RECT);
00833
00834         // Draw custom text
00835         CFont *pOldFont = (CFont*) pDC->SelectObject(&m_Font);
00836         pDC->SetBkMode(TRANSPARENT);
00837         pDC->DrawText(m_strCustomText, TextButtonRect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
00838         pDC->SelectObject(pOldFont);
00839
00840         return;
00841     }
00842
00843     // For the Default Text area
00844     if (m_strDefaultText.GetLength() && nIndex == DEFAULT_BOX_VALUE)
00845     {
00846         // Fill background
00847         pDC->FillSolidRect(m_DefaultTextRect, ::GetSysColor(COLOR_3DFACE));
00848
00849         // The extent of the actual text button
00850         CRect TextButtonRect = m_DefaultTextRect;
00851         TextButtonRect.DeflateRect(1,1);
00852
00853         // fill background
00854         if (m_nChosenColorSel == nIndex && m_nCurrentSel != nIndex)
00855             pDC->FillSolidRect(TextButtonRect, ::GetSysColor(COLOR_3DLIGHT));
00856         else
00857             pDC->FillSolidRect(TextButtonRect, ::GetSysColor(COLOR_3DFACE));
00858
00859         // Draw thin line around text
00860         CRect LineRect = TextButtonRect;
00861         LineRect.DeflateRect(2*m_nMargin,2*m_nMargin);
00862         CPen pen(PS_SOLID, 1, ::GetSysColor(COLOR_3DSHADOW));
00863         CPen* pOldPen = pDC->SelectObject(&pen);
00864         pDC->SelectStockObject(NULL_BRUSH);
00865         pDC->Rectangle(LineRect);
00866         pDC->SelectObject(pOldPen);
00867
00868         // Draw button
00869         if (m_nCurrentSel == nIndex)
00870             pDC->DrawEdge(TextButtonRect, BDR_RAISEDINNER, BF_RECT);
00871         else if (m_nChosenColorSel == nIndex)
00872             pDC->DrawEdge(TextButtonRect, BDR_SUNKENOUTER, BF_RECT);
00873
00874         // Draw custom text
00875         CFont *pOldFont = (CFont*) pDC->SelectObject(&m_Font);
00876         pDC->SetBkMode(TRANSPARENT);
00877         pDC->DrawText(m_strDefaultText, TextButtonRect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
00878         pDC->SelectObject(pOldFont);
00879
00880         // fix potential resource leak - KStowell - 10-21-99
00881         pen.DeleteObject();
00882         return;
00883     }
00884
00885     CRect rect;
00886     if (!GetCellRect(nIndex, rect)) return;
00887
00888     // Select and realize the palette
00889     CPalette* pOldPalette = NULL;
00890     if (pDC->GetDeviceCaps(RASTERCAPS) & RC_PALETTE)
00891     {
00892         pOldPalette = pDC->SelectPalette(&m_Palette, FALSE);
00893         pDC->RealizePalette();
00894     }
00895
00896     // fill background
00897     if (m_nChosenColorSel == nIndex && m_nCurrentSel != nIndex)
00898         pDC->FillSolidRect(rect, ::GetSysColor(COLOR_3DHILIGHT));
00899     else
00900         pDC->FillSolidRect(rect, ::GetSysColor(COLOR_3DFACE));
00901
00902     // Draw button
00903     if (m_nCurrentSel == nIndex)
00904         pDC->DrawEdge(rect, BDR_RAISEDINNER, BF_RECT);
00905     else if (m_nChosenColorSel == nIndex)
00906         pDC->DrawEdge(rect, BDR_SUNKENOUTER, BF_RECT);
00907
00908     CBrush brush(PALETTERGB(GetRValue(GetColor(nIndex)),
00909                             GetGValue(GetColor(nIndex)),
00910                             GetBValue(GetColor(nIndex)) ));
00911     CPen   pen;
00912     pen.CreatePen(PS_SOLID, 1, ::GetSysColor(COLOR_3DSHADOW));
00913
00914     CBrush* pOldBrush = (CBrush*) pDC->SelectObject(&brush);
00915     CPen*   pOldPen   = (CPen*)   pDC->SelectObject(&pen);
00916
00917     // Draw the cell Color
00918     rect.DeflateRect(m_nMargin+1, m_nMargin+1);
00919     pDC->Rectangle(rect);
00920
00921     // restore DC and cleanup
00922     pDC->SelectObject(pOldBrush);
00923     pDC->SelectObject(pOldPen);
00924     brush.DeleteObject();
00925     pen.DeleteObject();
00926
00927     if (pOldPalette && pDC->GetDeviceCaps(RASTERCAPS) & RC_PALETTE)
00928         pDC->SelectPalette(pOldPalette, FALSE);
00929 }
00930
00931 BOOL CCJColorPopup::OnQueryNewPalette()
00932 {
00933     Invalidate();
00934     return CWnd::OnQueryNewPalette();
00935 }
00936
00937 void CCJColorPopup::OnPaletteChanged(CWnd* pFocusWnd)
00938 {
00939     CWnd::OnPaletteChanged(pFocusWnd);
00940
00941     if (pFocusWnd->GetSafeHwnd() != GetSafeHwnd())
00942         Invalidate();
00943 }
00944
00945 void CCJColorPopup::OnKillFocus(CWnd* pNewWnd)
00946 {
00947     CWnd::OnKillFocus(pNewWnd);
00948
00949     ReleaseCapture();
00950     //DestroyWindow(); - causes crash when Custom Color dialog appears.
00951 }
00952
00953 // KillFocus problem fix suggested by Paul Wilkerson.
00954 void CCJColorPopup::OnActivateApp(BOOL bActive, HTASK hTask)
00955 {
00956     CWnd::OnActivateApp(bActive, hTask);
00957
00958     // If Deactivating App, cancel this selection
00959     if (!bActive)
00960          EndSelection(CPN_SELENDCANCEL);
00961 }
00962
00963 void CCJColorPopup::UpdateFont()
00964 {
00965     m_Font.DeleteObject();
00966     NONCLIENTMETRICS ncm;
00967     ncm.cbSize = sizeof(ncm);
00968     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00969     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00970     SetFont(&m_Font);
00971 }
00972
00973 BOOL CCJColorPopup::OnEraseBkgnd(CDC* pDC)
00974 {
00975     // KStowell - overridden for flicker-free drawing.
00976     UNUSED_ALWAYS(pDC);
00977     return TRUE;
00978 }
Generated on Sun Feb 24 01:21:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJComboBoxEx.cpp Source File

WinCvs/CJLib/CJLibrary/CJComboBoxEx.cpp

Go to the documentation of this file.
00001 // CJComboBoxEx.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Copied from MFC, Visual C++ 6, to extend functionality to Visual C++ 5
00006 // users, with some ideas taken from Luis Barreira's article 'Classes for new
00007 // IE4 controls' http://www.codeguru.com/controls/ie4_controls_classes.shtml
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:48 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJockey/CJLibrary/CJComboBoxEx.cpp $
00015  *
00016  * $History: CJComboBoxEx.cpp $
00017  *
00018  * *****************  Version 5  *****************
00019  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00020  * Updated in $/CodeJockey/CJLibrary
00021  * Updated copyright and contact information.
00022  *
00023  * *****************  Version 4  *****************
00024  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00025  * Updated in $/CodeJockey/CJLibrary
00026  * Added Unicode compliance, thanks to Barry Burton for his help with
00027  * this.
00028  *
00029  *
00030  * *****************  Version 2  *****************
00031  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00032  * Updated in $/CodeJockey/CJLibrary
00033  *
00034  * *****************  Version 1  *****************
00035  * User: Kirk Stowell Date: 6/25/99    Time: 12:05p
00036  * Created in $/CodeJockey/CJLibrary
00037  * Copied from MFC, Visual C++ 6. Added to extend functionality to Visual
00038  * C++ 5 users.
00039  *
00040  ***************************************************************************/
00042
00043 #include "stdafx.h"
00044 #include "CJComboBoxEx.h"
00045
00046 #ifdef _DEBUG
00047 #define new DEBUG_NEW
00048 #undef THIS_FILE
00049 static char THIS_FILE[] = __FILE__;
00050 #endif
00051
00053 // CCJComboBoxEx
00054
00055 BOOL CCJComboBoxEx::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd,
00056     UINT nID)
00057 {
00058   // initialize common controls
00059 #ifdef _VC_VERSION_5
00060     INITCOMMONCONTROLSEX icex;
00061     icex.dwSize = sizeof(icex);
00062     icex.dwICC = ICC_USEREX_CLASSES;
00063     VERIFY(InitCommonControlsEx(&icex));
00064 #else
00065     VERIFY(AfxDeferRegisterClass(AFX_WNDCOMMCTL_USEREX_REG));
00066 #endif
00067
00068     CWnd* pWnd = this;
00069     return pWnd->Create(WC_COMBOBOXEX, NULL, dwStyle, rect, pParentWnd, nID);
00070 }
00071
00072 int CCJComboBoxEx::DeleteItem(int iIndex)
00073 {
00074     ASSERT(::IsWindow(m_hWnd));
00075     return (int) ::SendMessage(m_hWnd, CBEM_DELETEITEM, (WPARAM) iIndex, 0);
00076 }
00077
00078 BOOL CCJComboBoxEx::GetItem(COMBOBOXEXITEM* pCBItem)
00079 {
00080     ASSERT(::IsWindow(m_hWnd));
00081     ASSERT(pCBItem != NULL);
00082     ASSERT(AfxIsValidAddress(pCBItem, sizeof(COMBOBOXEXITEM)));
00083
00084     return (int) ::SendMessage(m_hWnd, CBEM_GETITEM, 0, (LPARAM) pCBItem);
00085 }
00086
00087 int CCJComboBoxEx::InsertItem(const COMBOBOXEXITEM* pCBItem)
00088 {
00089     ASSERT(::IsWindow(m_hWnd));
00090     ASSERT(pCBItem != NULL);
00091     ASSERT(AfxIsValidAddress(pCBItem, sizeof(COMBOBOXEXITEM), FALSE));
00092
00093     return (int) ::SendMessage(m_hWnd, CBEM_INSERTITEM, 0, (LPARAM) pCBItem);
00094 }
00095
00096 int CCJComboBoxEx::InsertItem(int iItem, UINT nStringID, int iIndent, int iImage, int iSelectedImage, UINT mask)
00097 {
00098     CString strItem;
00099     strItem.LoadString(nStringID);
00100     return InsertItem(iItem, strItem, iIndent, iImage, iSelectedImage, mask);
00101 }
00102
00103 int CCJComboBoxEx::InsertItem(int iItem, LPCTSTR lpszItem, int iIndent, int iImage, int iSelectedImage, UINT mask)
00104 {
00105     COMBOBOXEXITEM cbItem;
00106
00107     cbItem.mask             = mask;
00108     cbItem.iItem            = iItem;
00109     cbItem.pszText          = const_cast<LPTSTR>(lpszItem);
00110     cbItem.iImage           = iImage;
00111     cbItem.iSelectedImage   = iSelectedImage;
00112     cbItem.iIndent          = iIndent;
00113
00114     return InsertItem(&cbItem);
00115 }
00116
00117 BOOL CCJComboBoxEx::SetItem(const COMBOBOXEXITEM* pCBItem)
00118 {
00119     ASSERT(::IsWindow(m_hWnd));
00120     ASSERT(pCBItem != NULL);
00121     ASSERT(AfxIsValidAddress(pCBItem, sizeof(COMBOBOXEXITEM), FALSE));
00122
00123     return (int) ::SendMessage(m_hWnd, CBEM_SETITEM, 0, (LPARAM) pCBItem);
00124 }
00125
00126 CCJComboBoxEx::~CCJComboBoxEx()
00127 {
00128     DestroyWindow();
00129 }
00130
00132
00133 IMPLEMENT_DYNAMIC(CCJComboBoxEx, CComboBox)
00134
00136
Generated on Sun Feb 24 01:21:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJControlBar.cpp Source File

WinCvs/CJLib/CJLibrary/CJControlBar.cpp

Go to the documentation of this file.
00001 // CJControlBar.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 2000/06/26 17:17:16 $
00009  * $Revision: 1.2 $
00010  * $Archive: /CodeJock/CJLibrary/CJControlBar.cpp $
00011  *
00012  * $History: CJControlBar.cpp $
00013  *
00014  * *****************  Version 22  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:18p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Overrode OnEraseBkgnd(...) and OnPaint() to handle flicker free
00018  * drawing. Made additional modifications to load and save bar state
00019  * methods.
00020  *
00021  * Modified resource include for static builds.
00022  *
00023  * Enabled OnInitialUpdate() to be called for view classes added to a
00024  * CCJTabCtrlBar while the control bar is floating.
00025  *
00026  * Fixed potential resource and memory leak problems.
00027  *
00028  * Overloaded EnableFlatLook() method so that the gripper, frame buttons
00029  * and borders can be set flat individually.  Added inline function
00030  * EnableSaveState() which can be used to enable or disable the restore
00031  * bar state.
00032  *
00033  * Fixed bug with save / restore bar state, and with saved bar size
00034  * changing whenever the application starts.
00035  *
00036  * Fixed small initialization bug.
00037  *
00038  * *****************  Version 21  *****************
00039  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00040  * Updated in $/CodeJockey/CJLibrary
00041  * Updated copyright and contact information.
00042  *
00043  * *****************  Version 20  *****************
00044  * User: Kirk Stowell Date: 8/30/99    Time: 12:40a
00045  * Updated in $/CodeJockey/CJLibrary
00046  * Gero Kuehn <gero.kuehn@isc-soft.de> - Added check to see if tooltips
00047  * are valid before setting text.
00048  *
00049  * *****************  Version 19  *****************
00050  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00051  * Updated in $/CodeJockey/CJLibrary
00052  * Added Unicode compliance, thanks to Barry Burton for his help with
00053  * this.
00054  *
00055  *
00056  * *****************  Version 18  *****************
00057  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00058  * Updated in $/CodeJockey/CJLibrary
00059  *
00060  * *****************  Version 17  *****************
00061  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00062  * Updated in $/CodeJockey/CJLibrary
00063  *
00064  * *****************  Version 16  *****************
00065  * User: Kirk Stowell Date: 7/18/99    Time: 10:23p
00066  * Updated in $/CodeJockey/CJLibrary
00067  * Added derived button class to handle control bar caption button
00068  * updates. Cleaned up inline functions, and import/export macro so that
00069  * class will be imported when linked to, and exported at compile time.
00070  * Added save and restore control bar size and state functionality.
00071  *
00072  * *****************  Version 15  *****************
00073  * User: Kirk Stowell Date: 6/11/99    Time: 8:24p
00074  * Updated in $/CodeJockey/CJ60Lib
00075  * Slight modification made to popup menu code.
00076  *
00077  * *****************  Version 14  *****************
00078  * User: Kirk Stowell Date: 6/09/99    Time: 8:33p
00079  * Updated in $/CodeJockey/CJ60Lib
00080  * Ioannhs Stamatopoulos (Yiannhs) [ystamat@mail.datamedia.gr] - Extended
00081  * docking windows, removed ::GetSysColor(...) calls and WM_SYSCOLORCHANGE
00082  * message handler, this is now automatically handled by the base class.
00083  * Added redraw flags to the create method and modified paint and layout
00084  * handlers to reduce flicker and un-necessary command handling. Dragging
00085  * rect now reflects actual control bar docked size. Added "flat" look to
00086  * the control bars, the control bars can now use the classic DevStudio
00087  * look, or use flat gradient gripper, borders and frame buttons. Overall,
00088  * docking windows now handle dragging, docking and floating much better,
00089  * and behave more like DevStudio.
00090  *
00091  * *****************  Version 13  *****************
00092  * User: Kirk Stowell Date: 5/17/99    Time: 8:33p
00093  * Updated in $/CodeJockey/CJ60Lib
00094  * Removed Invalidate() from OnWindowPosChanged(..) and OnEraseBkgnd(..)
00095  * which seemed to cause painting problems.
00096  *
00097  * *****************  Version 12  *****************
00098  * User: Kirk Stowell Date: 5/03/99    Time: 9:52p
00099  * Updated in $/CodeJockey/CJ60Lib
00100  * Changed gripper and button macros to enums. Renamed popup member
00101  * variables to begin with popup, this will be consistent throughout all
00102  * classes. Added m_nPos member variable which can be set to the index of
00103  * the popup menu in the menu resource. Removed windows message handler
00104  * ON_WM_CONTEXTMENU(), and added handlers ON_WM_RBUTTONDOWN(),
00105  * ON_WM_MEASUREITEM(), ON_WM_MENUCHAR() and ON_WM_INITMENUPOPUP() to
00106  * support the CCJMenu popup. Added WS_CLIPSIBLINGS to control bar style.
00107  * Changed OnEraseBkgnd(CDC* pDC) to only draw client area when a child is
00108  * not present.
00109  *
00110  * *****************  Version 11  *****************
00111  * User: Kirk Stowell Date: 4/14/99    Time: 12:54p
00112  * Updated in $/CodeJockey/CJ60Lib
00113  * Modified context menu to use Brent Corkum's BCMenu (CCJMenu).
00114  *
00115  * *****************  Version 10  *****************
00116  * User: Kirk Stowell Date: 4/03/99    Time: 12:52p
00117  * Updated in $/CodeJockey/CJ60Lib
00118  * Added comments and cleaned up code.
00119  *
00120  * *****************  Version 9  *****************
00121  * User: Kirk Stowell Date: 3/13/99    Time: 12:54p
00122  * Updated in $/CodeJockey/CJ60Lib
00123  * Patrick Bergeron [patb@softimage.com] fixed the following bugs:
00124  *
00125  * I had a dialog nested in a CJControlBar. Unfortunately when I tried to
00126  * dock it to the left or right, the bottom part of my dialog would be
00127  * clipped off.
00128  *
00129  * Fix: When in docked mode, ::CalcDynamicLayout needed to return the
00130  * desired size, while taking into account the size of the gripper bar (if
00131  * any). Simply added a simple "+GetMinExt()" Now my dialog's bottom
00132  * doesn't get clipped. Woo-ha.
00133  *
00134  * When nesting a CDialog based window inside a CJControlBar, the 3D rect
00135  * drawn by ::OnEraseBkgnd would be overwritten by the top and left dialog
00136  * borders. The problem was caused by the fact that in the
00137  * ::OnWindowPosChanged() method, the rectangle which is used to move the
00138  * window contains the border. A simple call to rc.DeflateRect(1,1) solved
00139  * this problem.
00140  *
00141  * Added a call to UpdateWindow() in ::OnEraseBkgnd(). This helps with the
00142  * flickering a bit, but I Am not sure this is the correct way to go.
00143  * Incorporate at your own risks.
00144  *
00145  * Added 2 ASSERT()s in ::OnMouseMove(). This was not to fix a bug, but at
00146  * one point I was seeing strange things that lead me to add these
00147  * asserts. They don't do anything bad, so why remove them?
00148  *
00149  * *****************  Version 8  *****************
00150  * User: Kirk Stowell Date: 3/10/99    Time: 12:50p
00151  * Updated in $/CodeJockey/CJ60Lib
00152  * Fixed memory leak with button tooltips.
00153  *
00154  * *****************  Version 7  *****************
00155  * User: Kirk Stowell Date: 3/10/99    Time: 12:48p
00156  * Updated in $/CodeJockey/CJ60Lib
00157  * Added AfxRegisterWndClass() to create method to handle double clicks.
00158  * Thanks to Takehiko Mizoguti [mizoguti@m2.sys.to.casio.co.jp] for some
00159  * thoughts on this.
00160  *
00161  * *****************  Version 6  *****************
00162  * User: Kirk Stowell Date: 2/28/99    Time: 12:47p
00163  * Updated in $/CodeJockey/CJ60Lib
00164  * Calls default wnd proc if no context menu is defined Gonzalo Pereyra
00165  * [persys@adinet.com.uy]
00166  *
00167  * *****************  Version 5  *****************
00168  * User: Kirk Stowell Date: 1/31/99    Time: 12:48p
00169  * Updated in $/CodeJockey/CJ60Lib
00170  * Removed extra line (typo) from OnLButtonUp(). Thanks to Ioannis
00171  * Stamatopoulos (ystamat@mail.datamedia.gr) for pointing this out.
00172  *
00173  * *****************  Version 4  *****************
00174  * User: Kirk Stowell Date: 1/12/99    Time: 12:46p
00175  * Updated in $/CodeJockey/CJ60Lib
00176  * Total class re-write, added multiple/side-by-side controlbar docking.
00177  * No longer uses CSizingControlBar base class.
00178  *
00179  * *****************  Version 3  *****************
00180  * User: Kirk Stowell Date: 11/22/98   Time: 12:47p
00181  * Updated in $/CodeJockey/CJ60Lib
00182  * Modified set cursor to display normal size cursor when static linked.
00183  *
00184  * *****************  Version 2  *****************
00185  * User: Kirk Stowell Date: 10/20/98   Time: 12:45p
00186  * Updated in $/CodeJockey/CJ60Lib
00187  * Fixed problem with gripper and buttons disappearing when docking
00188  * toggled. Overloaded IsFloating() method from base class.
00189  *
00190  * *****************  Version 1  *****************
00191  * User: Kirk Stowell Date: 10/17/98   Time: 12:44p
00192  * Created in $/CodeJockey/CJ60Lib
00193  * Initial re-write and release.
00194  *
00195  ***************************************************************************/
00197
00198 #include "stdafx.h"
00199 #include "CJControlBar.h"
00200 #include "CJDockContext.h"
00201 #include "CJSizeDockBar.h"
00202 #include "CJResource.h"
00203
00204 #ifdef _DEBUG
00205 #define new DEBUG_NEW
00206 #undef THIS_FILE
00207 static char THIS_FILE[] = __FILE__;
00208 #endif
00209
00210 #define GRIP_INTRASPACING       1
00211 #define GRIP_SIZE               3
00212 #define GRIP_START              8
00213 #define TRACK_BORDER_SIZE       4
00214
00215 void CCJCBarButton::DrawButtonIcon(CDC* pDC, UINT nState, CRect& rcItem)
00216 {
00217     UNUSED_ALWAYS( rcItem );
00218
00219     // get the handle to the icon (if any) associated
00220     // with this button.
00221     HICON hIcon = GetIcon();
00222     if( hIcon == NULL ) {
00223         return;
00224     }
00225
00226     CRect rcWnd;
00227     GetWindowRect(&rcWnd);
00228
00229     int left   = (rcWnd.Width()-m_sizeIcon.cx)/2;
00230     int right  = left+m_sizeIcon.cx;
00231     int top    = (rcWnd.Height()-m_sizeIcon.cy)/2;
00232     int bottom = top+m_sizeIcon.cy;
00233
00234     // determine the size of the icon to be drawn.
00235     CRect rc(left,top,right,bottom);
00236
00237     // if the button is selected.
00238     if( nState & ODS_SELECTED )
00239     {
00240         if( m_hPushed ) {
00241             hIcon = m_hPushed;
00242         }
00243         else {
00244             rc.OffsetRect(1,1);
00245         }
00246     }
00247
00248     // draw the icon associated with this button.
00249     pDC->DrawState( rc.TopLeft(), rc.Size(), hIcon, DSS_NORMAL, (HBRUSH)NULL );
00250 }
00251
00253 // CCJControlBar
00254
00255 CCJControlBar::CCJControlBar()
00256 {
00257     m_popupMenuID       = 0;
00258     m_popToolbarID      = 0;
00259     m_nPos              = 0;
00260     m_bToFit            = FALSE;
00261     m_bOkToDrag         = FALSE;
00262     m_bDragging         = FALSE;
00263     m_bMaximized        = FALSE;
00264     m_bUnique           = FALSE;
00265     m_bGripper          = TRUE;
00266     m_bButtons          = TRUE;
00267     m_bFlatGripper      = FALSE;            // Yiannhs Ver 6.06 Start Up With Flat Gripper
00268     m_bFlatBorder       = FALSE;            // Yiannhs Start Up With Flat Border
00269     m_bAutoSave         = TRUE;
00270     m_sizeVert          = CSize(200,100);   // Yiannhs to test different rectangles
00271     m_sizeHorz          = CSize(200,100);
00272     m_sizeFloat         = CSize(200,100);
00273     m_sizeDesired       = CSize(200,100);
00274     m_sizeNormal        = CSize(200,100);
00275     m_cxOffset          = 5;
00276     m_cyOffset          = 3;
00277     m_pChildWnd         = NULL;
00278     m_strSection        = _T("");
00279     m_eAuxIndex         = HIDE_CONTRLBAR;
00280     m_hIcon             = NULL;
00281     m_hAuxIcon          = NULL;
00282     m_eChildBorder      = NONE;
00283     m_nID               = 0;
00284     m_bFloating         = FALSE;
00285
00286     // Create the image list used by frame buttons.
00287     m_ImageList.Create(IDB_BUTTON_IMAGES,
00288         10, 1, RGB(255,255,255));
00289 }
00290
00291 CCJControlBar::~CCJControlBar()
00292 {
00293     // fix potential resource leak - KStowell - 10-22-99.
00294     m_ImageList.DeleteImageList();
00295     _destroyIcon(m_hIcon);
00296     _destroyIcon(m_hAuxIcon);
00297 }
00298
00299 IMPLEMENT_DYNAMIC(CCJControlBar, CControlBar)
00300
00301 BEGIN_MESSAGE_MAP(CCJControlBar, CControlBar)
00302     //{{AFX_MSG_MAP(CCJControlBar)
00303     ON_WM_NCPAINT()
00304     ON_WM_PAINT()
00305     ON_WM_MOUSEMOVE()
00306     ON_WM_SETCURSOR()
00307     ON_WM_LBUTTONUP()
00308     ON_WM_NCHITTEST()
00309     ON_WM_CREATE()
00310     ON_WM_WINDOWPOSCHANGED()
00311     ON_WM_LBUTTONDOWN()
00312     ON_COMMAND(IDC_BUTTON_HIDE, OnButtonClose)
00313     ON_UPDATE_COMMAND_UI(IDC_BUTTON_HIDE, OnUpdateButtonClose)
00314     ON_COMMAND(IDC_BUTTON_MINI, OnButtonMinimize)
00315     ON_UPDATE_COMMAND_UI(IDC_BUTTON_MINI, OnUpdateButtonMinimize)
00316     ON_WM_RBUTTONDOWN()
00317     ON_WM_MEASUREITEM()
00318     ON_WM_MENUCHAR()
00319     ON_WM_INITMENUPOPUP()
00320     ON_WM_ERASEBKGND()
00321     //}}AFX_MSG_MAP
00322 END_MESSAGE_MAP()
00323
00325 // CCJControlBar overrides
00326
00327 void CCJControlBar::EnableFlatLook(BOOL bFlat)
00328 {
00329     EnableFlatLook(bFlat, bFlat, bFlat);
00330 }
00331
00332 void CCJControlBar::EnableFlatLook(BOOL bGripper, BOOL bBorder, BOOL bButtons)
00333 {
00334     ASSERT(::IsWindow(m_hWnd));
00335     m_bFlatGripper = bGripper;
00336     m_bFlatBorder  = bBorder;
00337     m_btnClose.DisableFlatLook( bButtons );
00338     m_btnMinim.DisableFlatLook( bButtons );
00339     Invalidate();
00340 }
00341
00342 BOOL CCJControlBar::Create(CWnd *pParentWnd, UINT nID, LPCTSTR lpszWindowName, CSize sizeDefault, DWORD dwStyle, BOOL bFlatBorders)
00343 {
00344     ASSERT_VALID(pParentWnd);   // must have a parent
00345
00346     // If autosave is enabled, get the previous settings from the registry.
00347     if( m_bAutoSave ) {
00348         LoadBarState(sizeDefault, nID);
00349     }
00350
00351     // Set initial control bar style.
00352     SetBarStyle(dwStyle & CBRS_ALL|CBRS_HIDE_INPLACE|CBRS_SIZE_DYNAMIC|CBRS_FLOAT_MULTI);
00353
00354     dwStyle &= ~CBRS_ALL;
00355     dwStyle |= WS_VISIBLE|WS_CHILD|WS_CLIPSIBLINGS|WS_CLIPCHILDREN;
00356
00357     m_sizeDesired = m_sizeNormal = sizeDefault;
00358     m_sizeHorz = m_sizeVert = m_sizeFloat = sizeDefault; // Yiannhs : Setup the new sizes as well
00359
00360     // Set flat control bar style.
00361     m_bFlatGripper = m_bFlatBorder = bFlatBorders;
00362
00363     // Yiannhs this seems a better way than mine, to register the double clicks class.
00364     // I have just added the redraw flags i was using in ver 6.06
00365     CString wndClass = ::AfxRegisterWndClass(
00366         CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW, 0, ::GetSysColorBrush(COLOR_BTNFACE));
00367
00368     CRect rect( 0, 0, sizeDefault.cx, sizeDefault.cy );
00369     return CWnd::Create( wndClass, lpszWindowName, dwStyle, rect, pParentWnd, nID );
00370 }
00371
00372 BOOL CCJControlBar::PreTranslateMessage(MSG* pMsg)
00373 {
00374     // *** GK/ISC
00375     if (m_bButtons && m_ToolTip.GetSafeHwnd()) {
00376         m_ToolTip.RelayEvent(pMsg);
00377     }
00378     return CControlBar::PreTranslateMessage(pMsg);
00379 }
00380
00381 void CCJControlBar::OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler)
00382 {
00383     UNUSED_ALWAYS(pTarget);
00384     UNUSED_ALWAYS(bDisableIfNoHndler);
00385
00386     if((m_bButtons == FALSE) || IsFloating()) {
00387         return;
00388     }
00389
00390     BOOL            bEnable     = FALSE;
00391     UINT            uIDText     = NULL;
00392     BTN_IMG_INDEX   eAuxIndex   = m_eAuxIndex;
00393
00394     if (IsHorzDocked()) {
00395         if (m_bUnique) {
00396             uIDText   = IDS_EXPAND;
00397             eAuxIndex = MAXI_H_DISABLE;
00398             bEnable   = FALSE;
00399         } else if (!m_bMaximized) {
00400             uIDText   = IDS_EXPAND;
00401             eAuxIndex = MAXI_H_ENABLED;
00402             bEnable   = TRUE;
00403         } else {
00404             uIDText   = IDS_CONTRACT;
00405             eAuxIndex = NORM_H_ENABLED;
00406             bEnable   = TRUE;
00407         }
00408     } else {
00409         if (m_bUnique) {
00410             uIDText   = IDS_EXPAND;
00411             eAuxIndex = MAXI_V_DISABLE;
00412             bEnable   = FALSE;
00413         } else if (!m_bMaximized) {
00414             uIDText   = IDS_EXPAND;
00415             eAuxIndex = MAXI_V_ENABLED;
00416             bEnable   = TRUE;
00417         } else {
00418             uIDText   = IDS_CONTRACT;
00419             eAuxIndex = NORM_V_ENABLED;
00420             bEnable   = TRUE;
00421         }
00422     }
00423
00424     // we are only concerned if the image index has changed.
00425     if(eAuxIndex != m_eAuxIndex) {
00426         m_eAuxIndex = eAuxIndex;
00427
00428         // if the button is a valid window, set the new icon.
00429         if(m_btnMinim.GetSafeHwnd()) {
00430             // fix potential resource leak - KStowell - 10-22-99.
00431             _destroyIcon(m_hAuxIcon);
00432             m_hAuxIcon = m_ImageList.ExtractIcon((int)eAuxIndex);
00433             m_btnMinim.SetIcon(m_hAuxIcon, CSize(10,10));
00434             m_btnMinim.EnableWindow(bEnable);
00435
00436             // if the tooltip control is valid, update the tip text.
00437             if(m_ToolTip.GetSafeHwnd()) {
00438                 m_ToolTip.UpdateTipText(uIDText, &m_btnMinim);
00439             }
00440         }
00441     }
00442 }
00443
00444 CSize CCJControlBar::CalcDynamicLayout(int nLength, DWORD nMode)
00445 {
00446     CSize sizeResult = m_sizeDesired;
00447
00448     //1999-05-19 Yiannhs. Since We Get Here from different Places do some more calculations.
00449     //                    Give Visual Feedback to user.
00450
00451     if( !nLength )
00452     {
00453         CRect rect;
00454         GetWindowRect( rect );
00455         sizeResult = rect.Size();
00456
00457         if( nMode & LM_HORZDOCK )
00458         {
00459             if( !IsHorzDocked() ) {
00460                 sizeResult = m_sizeHorz;
00461             }
00462             else if( nMode & LM_VERTDOCK )
00463             {
00464                 if( !IsVertDocked() ) {
00465                     sizeResult = m_sizeVert;
00466                 }
00467                 else {
00468                     sizeResult = m_sizeFloat;           //Do not check if it is floating. Do it
00469                 }
00470                 return( sizeResult );                   //do not go on
00471             }
00472         }
00473     }
00474     //1999-05-19    Yiannhs
00475
00476     if( IsFloating( ))
00477     {
00478         if (nMode == LM_HORZ) {
00479             if (nLength < 50)
00480                 nLength = 50;
00481             m_sizeDesired.cx = nLength;
00482         }
00483
00484         if (nMode == (LM_LENGTHY | LM_HORZ)) {
00485             if (nLength < 50)
00486                 nLength = 50;
00487             m_sizeDesired.cy = nLength;
00488         }
00489
00490         sizeResult = m_sizeDesired;
00491
00492     }
00493
00494     return sizeResult;
00495 }
00496
00498 // CCJControlBar message handlers
00499
00500 void CCJControlBar::OnNcPaint()
00501 {
00502     EraseNonClient();
00503 }
00504
00505 void CCJControlBar::OnPaint()
00506 {
00507     CPaintDC dc(this); // device context for painting
00508
00509     // Get the client rect.
00510     CRect rcClient;
00511     GetClientRect( &rcClient );
00512
00513     // Create a memory device-context. This is done to help reduce
00514     // screen flicker, since we will paint the entire control to the
00515     // off screen device context first.
00516     CDC memDC;
00517     CBitmap bitmap;
00518     memDC.CreateCompatibleDC(&dc);
00519     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00520     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00521
00522     // repaint the background.
00523     memDC.FillSolidRect( rcClient, afxData.clrBtnFace );
00524     DrawBorders(&memDC, rcClient);
00525
00526     // draw a border around the child area.
00527     if( m_eChildBorder != NONE )
00528     {
00529         CRect rect;
00530         GetChildRect(rect);
00531
00532         if( m_eChildBorder == OUTLINE ) {
00533             memDC.Draw3dRect(rect, afxData.clrWindowFrame, afxData.clrWindowFrame);
00534         } else if( m_eChildBorder == SUNKEN ) {
00535             rect.InflateRect(1,1);
00536             memDC.Draw3dRect(rect, afxData.clrBtnShadow, afxData.clrBtnHilite);
00537             rect.DeflateRect(1,1);
00538             memDC.Draw3dRect(rect, afxData.clrWindowFrame, afxData.clrBtnFace);
00539         } else if( m_eChildBorder == RAISED ) {
00540             rect.InflateRect(1,1);
00541             memDC.Draw3dRect(rect, afxData.clrBtnHilite, afxData.clrWindowFrame);
00542             rect.DeflateRect(1,1);
00543             memDC.Draw3dRect(rect, afxData.clrBtnFace, afxData.clrBtnShadow);
00544         }
00545     }
00546
00547     // copy the memory device context back into the original DC via BitBlt().
00548     dc.BitBlt(rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), &memDC, 0,0, SRCCOPY);
00549
00550     // cleanup resources.
00551     memDC.SelectObject(pOldBitmap);
00552     memDC.DeleteDC();
00553     bitmap.DeleteObject();
00554 }
00555
00556 void CCJControlBar::OnMouseMove(UINT nFlags, CPoint point)
00557 {
00558     HitTest(point);
00559     CRect rectDock;
00560     if( m_bDragging )
00561     {
00562         ASSERT(GetParent() != NULL);
00563
00564         GetParent()->GetClientRect(&rectDock);
00565         ClientToScreen(&rectDock);
00566         ClientToScreen(&point);
00567
00568         CFrameWnd *pFrame=GetDockingFrame();
00569         ASSERT(pFrame != NULL);
00570
00571         pFrame -> ScreenToClient(&point);
00572         pFrame->ScreenToClient(&rectDock);
00573
00574         point.x = point.x>rectDock.right ? rectDock.right:point.x;
00575         point.x = point.x<rectDock.left ? rectDock.left:point.x;
00576         point.y = point.y>rectDock.bottom ? rectDock.bottom:point.y;
00577         point.y = point.y<rectDock.top ? rectDock.top:point.y;
00578
00579         OnInvertTracker(m_rcTrack);
00580         int deltaX = point.x-m_ptCurDrag.x;
00581         int deltaY = point.y-m_ptCurDrag.y;
00582
00583         if(IsVertDocked()) {
00584             m_rcTrack.top += deltaY;
00585             m_rcTrack.bottom += deltaY;
00586         }
00587
00588         else if (IsHorzDocked()) {
00589             m_rcTrack.left += deltaX;
00590             m_rcTrack.right += deltaX;
00591         }
00592
00593         OnInvertTracker(m_rcTrack);
00594         m_ptCurDrag = point;
00595     }
00596
00597     else {
00598         // Yiannhs: Do not let default handler go on, if we have worked with the message
00599         CControlBar::OnMouseMove(nFlags, point);
00600     }
00601 }
00602
00603 BOOL CCJControlBar::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
00604 {
00605     return (!m_bOkToDrag && !m_bDragging)?
00606         CControlBar::OnSetCursor(pWnd, nHitTest, message):FALSE;
00607 }
00608
00609
00610 //1999-05-19    Yiannhs
00611 void CCJControlBar::OnLButtonUp(UINT nFlags, CPoint point)
00612 {
00613     if( m_bDragging )
00614     {
00615         ReleaseCapture();
00616         OnInvertTracker(m_rcTrack);
00617 //1999-05-19 Yiannhs. Moved the statement below
00618         //m_bDragging = FALSE;
00619
00620         // Yiannhs: reduce unnessesary actions. Ok It works
00621  //1999-05-19 Yiannhs. Changed according to the statement above
00622         if( m_ptCurDrag == m_ptStartDrag ) {
00623             m_bDragging = FALSE;
00624             return;
00625         }
00626
00627         if(IsVertDocked()) {
00628             int newHeight = m_rcTrack.top-m_ptStartDrag.y;
00629             m_sizeDesired.cy += newHeight;
00630             m_sizeDesired.cy = m_sizeDesired.cy > GetMinExt() ? m_sizeDesired.cy : GetMinExt();
00631             // Yiannhs: there is a comment in the previous version for change. This is the Line
00632             // This is probably for sizing with many control bars in dock bar
00633             // m_sizeDesired.cy = m_sizeDesired.cy > rectAvail.Height() ? rectAvail.Height() : m_sizeDesired.cy;
00634
00635 //1999-05-19 Yiannhs. Assign unused sizes
00636             m_sizeVert = m_sizeDesired;
00637         }
00638
00639         else { //if (IsHorzDocked()) {  //1999-05-19. Floating control bars do not receive this message
00640
00641             int newWidth = m_rcTrack.left-m_ptStartDrag.x;
00642             m_sizeDesired.cx += newWidth;
00643             m_sizeDesired.cx = m_sizeDesired.cx > GetMinExt() ? m_sizeDesired.cx : GetMinExt();
00644             // Yiannhs: there is a comment in the previous version for change. This is the Line
00645             // This is probably for sizing with many control bars in dock bar
00646             // m_sizeDesired.cx = m_sizeDesired.cx > rectAvail.Width() ? rectAvail.Width() : m_sizeDesired.cx;
00647
00648 //1999-05-19 Yiannhs. Assign unused sizes
00649             m_sizeHorz = m_sizeDesired;
00650         }
00651
00652 //1999-05-19    Yiannhs
00653         //((CCJSizeDockBar *)GetParent())->CalcSizeBarLayout();
00654         //resizing a control bar, means, that the DockBar should be normalized.
00655         //and normalize does the layout
00656         m_sizeNormal = m_sizeDesired;       //set the new normal size here
00657         ((CCJSizeDockBar *)GetParent())->Normalize( this );
00658         m_bDragging = FALSE;        //flag off the drag action now. The movement has been complited
00659                                     //so as I can check it on change position
00660         CRect rc;                   // Now Use The Size of the control bar to fill the right sizes.
00661         GetWindowRect( rc );
00662         if( IsHorzDocked() )
00663             m_sizeNormal.cy = m_sizeHorz.cy = m_sizeDesired.cy = rc.Height();
00664         else
00665             m_sizeNormal.cx = m_sizeVert.cx = m_sizeDesired.cx = rc.Width();
00666 //1999-05-19    Yiannhs
00667
00668     }
00669
00670     else {
00671         // Yiannhs: again don't go to default handler if we have already handled the message
00672         CControlBar::OnLButtonUp(nFlags, point);
00673     }
00674 }
00675
00676 UINT CCJControlBar::OnNcHitTest(CPoint /*point*/)
00677 {
00678     return HTCLIENT;
00679 }
00680
00681 BOOL CCJControlBar::OnEraseBkgnd(CDC* pDC)
00682 {
00683     // KStowell - overridden for flicker-free drawing.
00684     UNUSED_ALWAYS(pDC);
00685     return TRUE;
00686 }
00687
00688 int CCJControlBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
00689 {
00690     if (CControlBar::OnCreate(lpCreateStruct) == -1)
00691         return -1;
00692
00693     if (m_bButtons)
00694     {
00695         if(!m_btnClose.Create(NULL, WS_CHILD | WS_VISIBLE | WS_TABSTOP |
00696             BS_NOTIFY | BS_OWNERDRAW | BS_ICON,
00697             CRect(0,0,0,0), this, IDC_BUTTON_HIDE ))
00698         {
00699             TRACE0( "Unable to create close button\n" );
00700             return -1;
00701         }
00702
00703
00704         if(!m_btnMinim.Create(NULL, WS_CHILD | WS_VISIBLE | WS_TABSTOP |
00705             BS_NOTIFY | BS_OWNERDRAW | BS_ICON,
00706             CRect(0,0,0,0), this, IDC_BUTTON_MINI ))
00707         {
00708             TRACE0( "Unable to create minimize button\n" );
00709             return -1;
00710         }
00711
00712         // Yiannhs Selective flat style interface. The difference is in adding the if statement
00713         if( !m_bFlatBorder && !m_bFlatGripper ) {
00714             m_btnClose.DisableFlatLook();
00715             m_btnMinim.DisableFlatLook();
00716         }
00717
00718         m_hIcon = m_ImageList.ExtractIcon(0);
00719         m_btnClose.SetIcon(m_hIcon, CSize(10,10));
00720
00721         // Create the ToolTip control.
00722         m_ToolTip.Create(this);
00723         m_ToolTip.Activate(TRUE);
00724         m_ToolTip.AddTool (&m_btnClose, IDS_HIDE);
00725         m_ToolTip.AddTool (&m_btnMinim, IDS_EXPAND);
00726     }
00727
00728     return 0;
00729 }
00730
00731 void CCJControlBar::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos)
00732 {
00733     CControlBar::OnWindowPosChanged(lpwndpos);
00734
00735     if (m_bButtons)
00736     {
00737         if (IsFloating())
00738         {
00739             m_btnClose.ShowWindow(SW_HIDE);
00740             m_btnMinim.ShowWindow(SW_HIDE);
00741         }
00742
00743         else
00744         {
00745             m_btnClose.ShowWindow(SW_SHOW);
00746             m_btnMinim.ShowWindow(SW_SHOW);
00747
00748             CRect rcClose(GetButtonRect());
00749             CRect rcMinim(GetButtonRect());
00750
00751             if (IsHorzDocked()) {
00752                 rcMinim.OffsetRect(0,14);
00753             }
00754
00755             else {
00756                 rcClose.OffsetRect(14,0);
00757             }
00758
00759             m_btnClose.MoveWindow(rcClose);
00760             m_btnMinim.MoveWindow(rcMinim);
00761         }
00762     }
00763
00764     //1999-05-19 Yiannhs
00765     //Calculate Extra Size variables
00766     CSize sizeTemp( lpwndpos->cx, lpwndpos->cy );
00767
00768     // save the current size to the registry.
00769     if( m_bAutoSave ) {
00770         SaveBarState(sizeTemp);
00771     }
00772
00773     if( IsFloating() ) {
00774         m_sizeFloat = sizeTemp;
00775     }
00776
00777     else if( !m_bDragging )
00778     {
00779         if( IsHorzDocked() ) {
00780             m_sizeHorz = sizeTemp;
00781         } else {
00782             m_sizeVert = sizeTemp;
00783         }
00784     }
00785
00786     if( m_pChildWnd->GetSafeHwnd( )) {
00787         CRect rc;
00788         GetChildRect(rc);
00789         rc.DeflateRect(1,1);
00790         m_pChildWnd->MoveWindow(rc);
00791     }
00792 }
00793
00794 //1999-05-19 Yiannhs
00795 void CCJControlBar::OnLButtonDown(UINT nFlags, CPoint point)
00796 {
00797     // Yiannhs. When the bar is inside a mdiframe window, and click on area
00798     // the inner child does not cover, the whole area is grayed!!!
00799
00800     if( IsFloating( )) //see Tab ControlBar
00801     {
00802         // If the window is floating, we want to
00803         // bring it up to the top.
00804         SetFocus();
00805         SetWindowPos( NULL, 0,0,0,0,
00806             SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW );
00807         return;
00808     }
00809
00810     if (m_bOkToDrag)
00811     {
00812         CFrameWnd *pFrame=GetDockingFrame();
00813         GetClientRect(m_rcTrack);
00814
00815         if (IsVertDocked()) {
00816             // Yiannhs
00817             m_rcTrack.top = m_rcTrack.bottom - TRACK_BORDER_SIZE -2;
00818             m_rcTrack.bottom-=2;
00819         }
00820 //1999-05-19 Yiannhs. do not call one more function
00821         else { //if (IsHorzDocked()) {
00822             // Yiannhs
00823             m_rcTrack.left = m_rcTrack.right - TRACK_BORDER_SIZE -2;
00824             m_rcTrack.right-=2;
00825         }
00826
00827         ClientToScreen(&m_rcTrack);
00828         pFrame->ScreenToClient(&m_rcTrack);
00829         ClientToScreen(&point);
00830         pFrame->ScreenToClient(&point);
00831
00832         m_ptStartDrag = point;
00833         m_ptCurDrag = point;
00834
00835         SetCapture();
00836         m_bDragging = TRUE;
00837         OnInvertTracker(m_rcTrack);
00838     }
00839
00840     else if (m_pDockBar) {
00841         if (OnToolHitTest(point, NULL) == -1) {
00842             ClientToScreen(&point);
00843 //1999-05-26 Yiannhs
00844 //          Handle the message loop before CDockContext
00845             MSG msg;
00846             ValidateRect( NULL );   //Make sure this control bar will not ask for Paint messages later
00847             HWND    hwnd = NULL;
00848             while (::PeekMessage(&msg, NULL, WM_PAINT, WM_PAINT, PM_REMOVE))
00849             {   //ask for messages in any window of the application, and remove those
00850                 DispatchMessage( &msg );
00851                 if( msg.hwnd != this->m_hWnd ) {
00852                     hwnd = msg.hwnd;    //keep the window which receives paint messages
00853                     break;              //exit the loop
00854                 }
00855             }
00856
00857             if( hwnd ) {    //if a window is getting Paint messages work on it
00858                 ::ValidateRect( hwnd, NULL );   //the window does not need painting
00859                 ::ValidateRect( ::GetParent( hwnd ), NULL );    //Its parent window as well
00860                 while (::PeekMessage(&msg, NULL, WM_PAINT, WM_PAINT, PM_REMOVE)) {
00861                     //work on the Paint messages once more
00862                     ::TranslateMessage( &msg );
00863                     ::DispatchMessage( &msg );
00864                 }
00865             }
00866
00867 //1999-05-26 Yiannhs
00868
00869             ((CCJDockContext*)m_pDockContext)->StartDragDockBar(point);
00870         }
00871     }
00872
00873     // Yiannhs
00874     else {
00875         CControlBar::OnLButtonDown(nFlags, point);
00876     }
00877 }
00878
00879 void CCJControlBar::OnButtonClose()
00880 {
00881     GetDockingFrame()->ShowControlBar(this,FALSE,FALSE);
00882 }
00883
00884 void CCJControlBar::OnUpdateButtonClose(CCmdUI* pCmdUI)
00885 {
00886     pCmdUI->Enable();
00887 }
00888
00889 void CCJControlBar::OnButtonMinimize()
00890 {
00891     if (!m_bMaximized) {
00892         ((CCJSizeDockBar *)GetParent())->Maximize(this);
00893         m_bMaximized = TRUE;
00894     }
00895
00896     else {
00897         ((CCJSizeDockBar *)GetParent())->Normalize(this);
00898         m_bMaximized = FALSE;
00899     }
00900 }
00901
00902 void CCJControlBar::OnUpdateButtonMinimize(CCmdUI* pCmdUI)
00903 {
00904     pCmdUI->Enable();
00905 }
00906
00908 // CCJControlBar operations
00909
00910 void CCJControlBar::EnableDockingOnSizeBar(DWORD dwDockStyle)
00911 {
00912     ASSERT(m_pDockContext == NULL);
00913     m_dwDockStyle = dwDockStyle;
00914
00915     if (m_pDockContext == NULL)
00916         m_pDockContext = new CCJDockContext(this);
00917
00918     if (m_hWndOwner == NULL)
00919         m_hWndOwner = ::GetParent(m_hWnd);
00920 }
00921
00922 void CCJControlBar::Maximize(int size)
00923 {
00924     m_sizeNormal = m_sizeDesired;
00925     if (IsHorzDocked()) {
00926         m_sizeDesired.cx = size;
00927     }
00928
00929     else if (IsVertDocked()) {
00930         m_sizeDesired.cy = size;
00931     }
00932
00933     m_bMaximized = TRUE;
00934 }
00935
00936 void CCJControlBar::Minimize()
00937 {
00938     m_sizeNormal = m_sizeDesired;
00939
00940     if (IsHorzDocked()) {
00941         m_sizeDesired.cx = GetMinExt();
00942     }
00943
00944     else if (IsVertDocked()) {
00945         m_sizeDesired.cy = GetMinExt();
00946     }
00947
00948     m_bMaximized = FALSE;
00949 }
00950
00951 void CCJControlBar::Normalize()
00952 {
00953     if (IsHorzDocked()) {
00954         m_sizeDesired.cx = m_sizeNormal.cx;
00955     }
00956
00957     else if (IsVertDocked()) {
00958         m_sizeDesired.cy = m_sizeNormal.cy;
00959     }
00960
00961     m_bMaximized = FALSE;
00962 }
00963
00964 int CCJControlBar::GetMinExt()
00965 {
00966     int nRet = TRACK_BORDER_SIZE;
00967
00968     if (m_bGripper || m_bButtons) {
00969         nRet += GRIP_START;
00970         nRet += GRIP_SIZE*2;
00971         nRet += GRIP_INTRASPACING*3+2;
00972     }
00973
00974     else
00975         nRet += 2;
00976
00977     return nRet;
00978 }
00979
00980 void CCJControlBar::GetChildRect(CRect &rect)
00981 {
00982     GetClientRect(&rect);
00983
00984     if (IsFloating()) {
00985         rect.DeflateRect(3,3);
00986     } else {
00987         if (IsVertDocked()) {
00988             rect.DeflateRect(m_cxOffset, 0);
00989             rect.top += (GetMinExt()-5);
00990             //Yiannhs: if it is the last bar inside a dockbar, cover the whole space
00991             if( !m_bToFit ) {
00992                 rect.bottom -= (TRACK_BORDER_SIZE + 4);
00993             } else {
00994                 rect.bottom -= 4;
00995             }
00996         } else {
00997             rect.left   += (GetMinExt()-5);
00998             //Yiannhs: if it is the last bar inside a dockbar, cover the whole space
00999             if( !m_bToFit ) {
01000                 rect.right  -= (TRACK_BORDER_SIZE + 4);
01001             } else {
01002                 rect.right  -= 4;
01003             }
01004             rect.DeflateRect(0, m_cxOffset);
01005         }
01006
01007         if( rect.left > rect.right || rect.top > rect.bottom )
01008             rect = CRect(0,0,0,0);
01009     }
01010 }
01011
01012 void CCJControlBar::EraseNonClient()
01013 {
01014     CWindowDC dc(this);
01015
01016     CRect rectClient;
01017     GetClientRect(rectClient);
01018     CRect rectWindow;
01019     GetWindowRect(rectWindow);
01020     ScreenToClient(rectWindow);
01021     rectClient.OffsetRect(-rectWindow.left, -rectWindow.top);
01022
01023     dc.ExcludeClipRect(rectClient);
01024     rectWindow.OffsetRect(-rectWindow.left, -rectWindow.top);
01025 }
01026
01027 void CCJControlBar::DrawBorders(CDC *pDC, CRect &rect)
01028 {
01029     CRect rc;
01030     rc.CopyRect(&rect);
01031
01032     CRect rcTrack;
01033     rcTrack.CopyRect(&rc);
01034
01035     if(IsVertDocked())
01036     {
01037         if (!m_bToFit) {
01038             rcTrack.top = rc.bottom - TRACK_BORDER_SIZE;
01039             rcTrack.top-=2;
01040             rcTrack.bottom-=1;
01041
01042             //Yiannhs flat interface style
01043             if( !m_bFlatBorder )
01044                 pDC->Draw3dRect(rcTrack, afxData.clrBtnHilite, afxData.clrBtnShadow);
01045             else
01046                 pDC->FillSolidRect(rcTrack, afxData.clrBtnFace);
01047         }
01048     }
01049
01050     else if (IsHorzDocked())
01051     {
01052         if (!m_bToFit) {
01053             rcTrack.left = rc.right - TRACK_BORDER_SIZE;
01054             rcTrack.left-=2;
01055             rcTrack.right-=1;
01056
01057             //Yiannhs flat interface style
01058             if( !m_bFlatBorder )
01059                 pDC->Draw3dRect(rcTrack, afxData.clrBtnHilite, afxData.clrBtnShadow);
01060             else
01061                 pDC->FillSolidRect(rcTrack, afxData.clrBtnFace);
01062         }
01063     }
01064
01065     DrawGripper(pDC);
01066 }
01067
01068 void CCJControlBar::HitTest(CPoint &point)
01069 {
01070     CRect rcWin;
01071     GetClientRect(&rcWin);
01072     HCURSOR hCur = ::LoadCursor(NULL,IDC_ARROW);
01073
01074     if( !m_bDragging )
01075     {
01076         if (IsVertDocked()) {
01077             rcWin.top = rcWin.bottom - TRACK_BORDER_SIZE;
01078             m_bOkToDrag = (rcWin.PtInRect(point) && !m_bToFit);
01079             if(m_bOkToDrag) {
01080                 hCur = AfxGetApp()->LoadCursor(IDC_VSPLITBAR);
01081             }
01082         }
01083
01084         else if (IsHorzDocked()) {
01085             rcWin.left = rcWin.right - TRACK_BORDER_SIZE;
01086             m_bOkToDrag = (rcWin.PtInRect(point) && !m_bToFit);
01087             if(m_bOkToDrag) {
01088                 hCur = AfxGetApp()->LoadCursor(IDC_HSPLITBAR);
01089             }
01090         }
01091
01092         SetCursor(hCur);
01093     }
01094 }
01095
01096 void CCJControlBar::OnInvertTracker(const CRect &rect)
01097 {
01098     ASSERT_VALID(this);
01099     ASSERT(!rect.IsRectEmpty());
01100
01101     CDC* pDC = GetDockingFrame()->GetDC();
01102     CBrush* pBrush = CDC::GetHalftoneBrush();
01103     CBrush* pOldBrush = NULL;
01104
01105     if (pBrush != NULL) {
01106         pOldBrush = pDC->SelectObject(pBrush);
01107     }
01108
01109     pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATINVERT);
01110
01111     if (pOldBrush != NULL) {
01112         pDC->SelectObject(pOldBrush);
01113     }
01114     GetDockingFrame()->ReleaseDC(pDC);
01115 }
01116
01117 // Yiannhs this was taken from code in CodeGuru site. Draw gradient flat caption
01118 // still needs some refinement
01119
01120 #define COLOR_WHITE     RGB(255,255,255)
01121 #define COLOR_BLACK     RGB(0,0,0)
01122 #define NCOLORSHADES    64      // this many shades in gradient
01123
01124 void CCJControlBar::DrawGriperCaption( CDC * pDC, LPRECT pRect )        //yiannhs
01125 {
01126     ASSERT( pDC );
01127     ASSERT( pRect );
01128     if (!IsFloating() && m_bGripper)
01129     {
01130         BOOL m_bIsHorz = IsHorzDocked();
01131         CRect TheRect( pRect );
01132         COLORREF clrBG = GetSysColor(COLOR_ACTIVECAPTION); // background color
01133         int cxCap = 0;
01134         int cyCap = 0;
01135         int rx = TheRect.left;
01136         int ry = TheRect.top;
01137         if( !m_bIsHorz ) {
01138             cxCap = TheRect.Width();
01139             cyCap = TheRect.Height();
01140         } else {
01141             cxCap = TheRect.Height();
01142             cyCap = TheRect.Width();
01143             //            rx = TheRect.top;
01144             //            ry = TheRect.left;
01145         }
01146
01147         int r = GetRValue(clrBG);               // red..
01148         int g = GetGValue(clrBG);               // ..green
01149         int b = GetBValue(clrBG);               // ..blue color vals
01150         int w = cxCap;                          // width of area to shade
01151         int xDelta= max(w/NCOLORSHADES,1);      // width of one shade band
01152         int x = xDelta;
01153         CBrush* pOldBrush = NULL;
01154         {
01155             CBrush brush(RGB(0,0,0));
01156             pOldBrush = pDC->SelectObject(&brush);
01157             if( !m_bIsHorz ) {
01158                 pDC->PatBlt(rx, ry, x, cyCap, PATCOPY);
01159             } else {
01160                 pDC->PatBlt(rx, ry, cyCap, x, PATCOPY);
01161             }
01162             pDC->SelectObject(pOldBrush);
01163
01164             // fix potential resource leak - KStowell - 10-21-99
01165             brush.DeleteObject();
01166         }
01167         int w2  = w*w;                                              // w squared
01168         while( x < cxCap ) {                                       // paint bands right to left
01169             //x += xDelta;                                            // next band
01170             int wmx2 = (w-x)*(w-x);                                 // w minus x squared
01171             COLORREF clr = RGB( r-(r*wmx2)/w2, g-(g*wmx2)/w2, b-(b*wmx2)/w2 );
01172             {
01173                 CBrush brush(clr);
01174                 pDC->SelectObject(&brush);
01175                 if( !m_bIsHorz ) {
01176                     pDC->PatBlt(rx+x, ry, xDelta, cyCap, PATCOPY);
01177                 } else {
01178                     pDC->PatBlt(rx, ry+x, cyCap, xDelta, PATCOPY);
01179                 }
01180                 pDC->SelectObject(pOldBrush);
01181
01182                 // fix potential resource leak - KStowell - 10-21-99
01183                 brush.DeleteObject();
01184             }
01185             x += xDelta;
01186         }
01187         {
01188             CBrush brush(clrBG);
01189             pDC->SelectObject(&brush);
01190             if( !m_bIsHorz ) {
01191                 pDC->PatBlt(rx+x, ry, cxCap-x, cyCap, PATCOPY);
01192             }
01193             else {
01194                 pDC->PatBlt(rx, ry+x, cyCap, cxCap-x, PATCOPY);
01195             }
01196
01197             // fix potential resource leak - KStowell - 10-21-99
01198             brush.DeleteObject();
01199         }
01200         pDC->SelectObject(pOldBrush);
01201     }
01202 }//yiannhs new method ends
01203
01204 void CCJControlBar::DrawGripper(CDC *pDC)
01205 {
01206     //Yiannhs. changed to make evaluations on top. Replaced with flat gradient caption
01207     if (!IsFloating() && m_bGripper)
01208     {
01209         // draw the gripper.
01210         CRect pRect(GetGripperRect());
01211
01212         //Yiannhs New Lines
01213         CRect SecondGrip;
01214         SecondGrip.CopyRect( pRect );
01215         //Yiannhs: use the original beveled style gripper
01216         if (IsHorzDocked()) {
01217             SecondGrip.OffsetRect(4,0);
01218         } else {
01219             SecondGrip.OffsetRect(0,4);
01220         }
01221
01222         //Yiannhs Selective Gripper look
01223         if( !m_bFlatGripper ) {
01224
01225             //Yiannhs: also updated to use AfxData
01226             pDC->FillSolidRect( pRect, afxData.clrBtnShadow  );
01227             pDC->Draw3dRect( pRect, afxData.clrBtnHilite, afxData.clrBtnShadow );
01228
01229             pDC->FillSolidRect( SecondGrip, afxData.clrBtnShadow );
01230             pDC->Draw3dRect( SecondGrip, afxData.clrBtnHilite, afxData.clrBtnShadow );
01231
01232         } else {    //Yiannhs: Use Flat Gripper
01233
01234             CRect FlatRect( pRect.left, pRect.top, SecondGrip.right, SecondGrip.bottom);
01235             if (IsHorzDocked()) {
01236                 FlatRect.DeflateRect(-2,0);
01237             } else {
01238                 FlatRect.DeflateRect(0,-2);
01239             }
01240             DrawGriperCaption( pDC, FlatRect );
01241         }
01242     }
01243 }
01244
01245 CRect CCJControlBar::GetButtonRect()
01246 {
01247     CRect rect;
01248     GetClientRect(&rect);
01249     rect.OffsetRect(-rect.left,-rect.top);
01250
01251     if (IsHorzDocked()) {
01252         rect.top     += 3;
01253         rect.bottom = rect.top+12;
01254         rect.left  += 2;
01255         rect.right  = rect.left+12;
01256     }
01257
01258     else {
01259         rect.right -= 19;
01260         rect.left   = rect.right-12;
01261         rect.top   += 3;
01262         rect.bottom = rect.top+12;
01263     }
01264
01265     return rect;
01266 }
01267
01268 CRect CCJControlBar::GetGripperRect()
01269 {
01270     CRect rect;
01271     GetClientRect(&rect);
01272     rect.OffsetRect(-rect.left,-rect.top);
01273
01274     if (IsHorzDocked()) {
01275         rect.DeflateRect(3,3);
01276         rect.left   += 1;
01277         rect.right  = rect.left+3;
01278         rect.bottom -= 1;
01279         rect.top    += m_bButtons?30:1;
01280     }
01281
01282     else {
01283         rect.DeflateRect(4,4);
01284         rect.top     += 2;
01285         rect.bottom  = rect.top+3;
01286         rect.right   -= m_bButtons?30:2;
01287     }
01288
01289     return rect;
01290 }
01291
01292 void CCJControlBar::OnRButtonDown(UINT /*nFlags*/, CPoint point)
01293 {
01294     // No menu was defined...
01295     if (!m_popupMenuID) {
01296         TRACE0( "Warning: No menu resource was associated with CCJControlBar.\n" );
01297     }
01298
01299     else
01300     {
01301         SetCapture();
01302
01303         // Since we are using the main window as the
01304         // parent, we need to convert the point to screen
01305         // coordinates...
01306         CPoint pt = point;
01307         ClientToScreen(&pt);
01308
01309         // Load the popup menu.
01310         VERIFY(m_popupMenu.LoadMenu(m_popupMenuID));
01311         CCJMenu* pPopup = (CCJMenu*)m_popupMenu.GetSubMenu(m_nPos);
01312         ASSERT(pPopup != NULL);
01313
01314         // Load toolbar resource if any for menu icons.
01315         if (m_popToolbarID) {
01316             pPopup->LoadToolbar(m_popToolbarID);
01317         }
01318
01319         //Yiannhs: When right clicking on a floating controlbar, the menu is inactive,
01320         //         this is due to the MiniFrame  apart from being a child is also
01321         //          a Frame Window. and only the main window handles the Bitmap menus
01322         //pWndPopupOwner = GetParentFrame();
01323         CWnd* pWndPopupOwner = GetParentFrame();    //this;
01324         if( IsFloating() )
01325             pWndPopupOwner = pWndPopupOwner->GetParentFrame();
01326
01327         // Display the popup menu, use the main window as its parent.
01328         pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
01329             pt.x, pt.y, pWndPopupOwner);
01330
01331         m_popupMenu.DestroyMenu();
01332
01333         ReleaseCapture();
01334     }
01335 }
01336
01337 void CCJControlBar::OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)
01338 {
01339     if (lpMeasureItemStruct->CtlType == ODT_MENU)
01340     {
01341         if (IsMenu((HMENU)lpMeasureItemStruct->itemID)) {
01342             CMenu* pMenu = CMenu::FromHandle((HMENU)lpMeasureItemStruct->itemID);
01343
01344             if (m_popupMenu.IsMenu(pMenu)) {
01345                 m_popupMenu.MeasureItem(lpMeasureItemStruct);
01346                 return;
01347             }
01348         }
01349     }
01350
01351     CControlBar::OnMeasureItem(nIDCtl, lpMeasureItemStruct);
01352 }
01353
01354 LRESULT CCJControlBar::OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu)
01355 {
01356     if (m_popupMenu.IsMenu(pMenu)) {
01357         return CCJMenu::FindKeyboardShortcut(nChar, nFlags, pMenu);
01358     }
01359
01360     return CControlBar::OnMenuChar(nChar, nFlags, pMenu);
01361 }
01362
01363 void CCJControlBar::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu)
01364 {
01365     CControlBar::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
01366
01367     if(!bSysMenu) {
01368         if (m_popupMenu.IsMenu(pPopupMenu)) {
01369             CCJMenu::UpdateMenu(pPopupMenu);
01370         }
01371     }
01372 }
01373
01374 void CCJControlBar::SaveBarState(CSize& size)
01375 {
01376     int nIndex = 0;
01377     CWinApp* pApp = AfxGetApp();
01378
01379     // attempt to loop through all of the defaults stored in the
01380     // system until we find our control id.
01381     while( TRUE )
01382     {
01383         // start at 0 and search for a match to our control bars
01384         // resource id. If one was not found, return.
01385         m_strSection.Format(_T("Bar State-Bar%d"), nIndex);
01386         int nBarID = pApp->GetProfileInt( m_strSection, _T("BarID"), -1 );
01387
01388         // couldn't find a match, just bail...
01389         if( nBarID == -1 ) {
01390             TRACE1( "Warning: Could not find registry information for control bar ID %d\n", m_nID );
01391             return;
01392         }
01393
01394         // we have a match, read the information that was stored, and
01395         // update the cx and cy variables passed in.
01396         if( nBarID == m_nID )
01397         {
01398             if(IsHorzDocked()) {
01399                 size.cy += TRACK_BORDER_SIZE+2;
01400             } else {
01401                 size.cx += TRACK_BORDER_SIZE;
01402             }
01403             //m_strSection += _T("\\CodeJock"); //JK - removed to fix the Bar savings, replaced by the code below... The fix taken from CodeJock Website Discussion board
01404             m_strSection.Format ( _T("CodeJock Bar State-Bar%d"), nIndex ); //JK
01405
01406             // Write the BarID here in case it needs to be matched up in later revisions    //JK
01407             pApp->WriteProfileInt( m_strSection, _T("BarID"), m_nID );  //JK
01408
01409             pApp->WriteProfileInt( m_strSection, _T("MRUDesiredCX"), size.cx );
01410             pApp->WriteProfileInt( m_strSection, _T("MRUDesiredCY"), size.cy );
01411             pApp->WriteProfileInt( m_strSection, _T("MRUFloating" ), IsFloating() );
01412             return;
01413         }
01414
01415         // increment count.
01416         ++nIndex;
01417     }
01418 }
01419
01420 void CCJControlBar::LoadBarState(CSize& size, int nID)
01421 {
01422     m_nID = nID;
01423     int nIndex = 0;
01424     CWinApp* pApp = AfxGetApp();
01425
01426     // attempt to loop through all of the defaults stored in the
01427     // system until we find our control id.
01428     while( TRUE )
01429     {
01430         // start at 0 and search for a match to our control bars
01431         // resource id. If one was not found, return.
01432         m_strSection.Format(_T("Bar State-Bar%d"), nIndex);
01433         int nBarID = pApp->GetProfileInt( m_strSection, _T("BarID"), -1 );
01434
01435         // couldn't find a match, just bail...
01436         if( nBarID == -1 ) {
01437             TRACE1( "Warning: Could not find registry information for control bar ID %d\n", m_nID );
01438             return;
01439         }
01440
01441         // we have a match, read the information that was stored, and
01442         // update the CRect object that was passed in.
01443         if( nBarID == m_nID ) {
01444             //m_strSection += _T("\\CodeJock"); //JK - removed to fix the Bar savings, replaced by the code below... The fix taken from CodeJock Website Discussion board
01445             m_strSection.Format ( _T("CodeJock Bar State-Bar%d"), nIndex ) ;    //JK
01446
01447             size.cx     = pApp->GetProfileInt( m_strSection, _T("MRUDesiredCX"), size.cx );
01448             size.cy     = pApp->GetProfileInt( m_strSection, _T("MRUDesiredCY"), size.cy );
01449             m_bFloating = pApp->GetProfileInt( m_strSection, _T("MRUFloating" ), m_bFloating );
01450             return;
01451         }
01452
01453         // increment count.
01454         ++nIndex;
01455     }
01456 }
Generated on Sun Feb 24 01:21:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJDateTimeCtrl.cpp Source File

WinCvs/CJLib/CJLibrary/CJDateTimeCtrl.cpp

Go to the documentation of this file.
00001 // CJDateTimeCtrl.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Copied from MFC, Visual C++ 6, to extend functionality to Visual C++ 5
00006 // users, with some ideas taken from Luis Barreira's article 'Classes for new
00007 // IE4 controls' http://www.codeguru.com/controls/ie4_controls_classes.shtml
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:49 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJockey/CJLibrary/CJDateTimeCtrl.cpp $
00015  *
00016  * $History: CJDateTimeCtrl.cpp $
00017  *
00018  * *****************  Version 4  *****************
00019  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00020  * Updated in $/CodeJockey/CJLibrary
00021  * Updated copyright and contact information.
00022  *
00023  * *****************  Version 3  *****************
00024  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00025  * Updated in $/CodeJockey/CJLibrary
00026  * Added Unicode compliance, thanks to Barry Burton for his help with
00027  * this.
00028  *
00029  *
00030  * *****************  Version 2  *****************
00031  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00032  * Updated in $/CodeJockey/CJLibrary
00033  *
00034  * *****************  Version 1  *****************
00035  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00036  * Created in $/CodeJockey/CJLibrary
00037  * Copied from MFC, Visual C++ 6 and vc5 Tech. Preview. Added to extend
00038  * functionality to Visual C++ 5 users.
00039  *
00040  ***************************************************************************/
00042
00043 #include "stdafx.h"
00044 #include "CJDateTimeCtrl.h"
00045 #include <math.h>
00046
00047 #ifdef _DEBUG
00048 #define new DEBUG_NEW
00049 #undef THIS_FILE
00050 static char THIS_FILE[] = __FILE__;
00051 #endif
00052
00054 // Helper functions
00055
00056 static BOOL GetAsSystemTime(const CTime& tm, SYSTEMTIME& timeDest)
00057 {
00058     struct tm* ptm = tm.GetLocalTm(NULL);
00059     if (ptm == NULL)
00060         return FALSE;
00061
00062     timeDest.wYear = (WORD) (1900 + ptm->tm_year);
00063     timeDest.wMonth = (WORD) (1 + ptm->tm_mon);
00064     timeDest.wDay = (WORD) ptm->tm_mday;
00065     timeDest.wHour = (WORD) ptm->tm_hour;
00066     timeDest.wMinute = (WORD) ptm->tm_min;
00067     timeDest.wSecond = (WORD) ptm->tm_sec;
00068     timeDest.wMilliseconds = 0;
00069
00070     return TRUE;
00071 }
00072
00073 static BOOL GetAsSystemTime(const CTime* ptm, SYSTEMTIME& timeDest)
00074 {
00075     return GetAsSystemTime(*ptm, timeDest);
00076 }
00077
00078 // Verifies will fail if the needed buffer size is too large
00079 #define MAX_TIME_BUFFER_SIZE    128         // matches that in timecore.cpp
00080 #define MIN_DATE                (-657434L)  // about year 100
00081 #define MAX_DATE                2958465L    // about year 9999
00082
00083 // Half a second, expressed in days
00084 #define HALF_SECOND  (1.0/172800.0)
00085
00086 // One-based array of days in year at month start
00087 static int nMonthDays[13] =
00088 {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365};
00089
00090 static BOOL TmFromOleDate(DATE dtSrc, struct tm& tmDest)
00091 {
00092     // The legal range does not actually span year 0 to 9999.
00093     if (dtSrc > MAX_DATE || dtSrc < MIN_DATE) // about year 100 to about 9999
00094         return FALSE;
00095
00096     long nDays;             // Number of days since Dec. 30, 1899
00097     long nDaysAbsolute;     // Number of days since 1/1/0
00098     long nSecsInDay;        // Time in seconds since midnight
00099     long nMinutesInDay;     // Minutes in day
00100
00101     long n400Years;         // Number of 400 year increments since 1/1/0
00102     long n400Century;       // Century within 400 year block (0,1,2 or 3)
00103     long n4Years;           // Number of 4 year increments since 1/1/0
00104     long n4Day;             // Day within 4 year block
00105     //  (0 is 1/1/yr1, 1460 is 12/31/yr4)
00106     long n4Yr;              // Year within 4 year block (0,1,2 or 3)
00107     BOOL bLeap4 = TRUE;     // TRUE if 4 year block includes leap year
00108
00109     double dblDate = dtSrc; // tempory serial date
00110
00111     // If a valid date, then this conversion should not overflow
00112     nDays = (long)dblDate;
00113
00114     // Round to the second
00115     dblDate += ((dtSrc > 0.0) ? HALF_SECOND : -HALF_SECOND);
00116
00117     nDaysAbsolute = (long)dblDate + 693959L; // Add days from 1/1/0 to 12/30/1899
00118
00119     dblDate = fabs(dblDate);
00120     nSecsInDay = (long)((dblDate - floor(dblDate)) * 86400.);
00121
00122     // Calculate the day of week (sun=1, mon=2...)
00123     //   -1 because 1/1/0 is Sat.  +1 because we want 1-based
00124     tmDest.tm_wday = (int)((nDaysAbsolute - 1) % 7L) + 1;
00125
00126     // Leap years every 4 yrs except centuries not multiples of 400.
00127     n400Years = (long)(nDaysAbsolute / 146097L);
00128
00129     // Set nDaysAbsolute to day within 400-year block
00130     nDaysAbsolute %= 146097L;
00131
00132     // -1 because first century has extra day
00133     n400Century = (long)((nDaysAbsolute - 1) / 36524L);
00134
00135     // Non-leap century
00136     if (n400Century != 0)
00137     {
00138         // Set nDaysAbsolute to day within century
00139         nDaysAbsolute = (nDaysAbsolute - 1) % 36524L;
00140
00141         // +1 because 1st 4 year increment has 1460 days
00142         n4Years = (long)((nDaysAbsolute + 1) / 1461L);
00143
00144         if (n4Years != 0)
00145             n4Day = (long)((nDaysAbsolute + 1) % 1461L);
00146         else
00147         {
00148             bLeap4 = FALSE;
00149             n4Day = (long)nDaysAbsolute;
00150         }
00151     }
00152     else
00153     {
00154         // Leap century - not special case!
00155         n4Years = (long)(nDaysAbsolute / 1461L);
00156         n4Day = (long)(nDaysAbsolute % 1461L);
00157     }
00158
00159     if (bLeap4)
00160     {
00161         // -1 because first year has 366 days
00162         n4Yr = (n4Day - 1) / 365;
00163
00164         if (n4Yr != 0)
00165             n4Day = (n4Day - 1) % 365;
00166     }
00167     else
00168     {
00169         n4Yr = n4Day / 365;
00170         n4Day %= 365;
00171     }
00172
00173     // n4Day is now 0-based day of year. Save 1-based day of year, year number
00174     tmDest.tm_yday = (int)n4Day + 1;
00175     tmDest.tm_year = n400Years * 400 + n400Century * 100 + n4Years * 4 + n4Yr;
00176
00177     // Handle leap year: before, on, and after Feb. 29.
00178     if (n4Yr == 0 && bLeap4)
00179     {
00180         // Leap Year
00181         if (n4Day == 59)
00182         {
00183             /* Feb. 29 */
00184             tmDest.tm_mon = 2;
00185             tmDest.tm_mday = 29;
00186             goto DoTime;
00187         }
00188
00189         // Pretend it's not a leap year for month/day comp.
00190         if (n4Day >= 60)
00191             --n4Day;
00192     }
00193
00194     // Make n4DaY a 1-based day of non-leap year and compute
00195     //  month/day for everything but Feb. 29.
00196     ++n4Day;
00197
00198     // Month number always >= n/32, so save some loop time */
00199     for (tmDest.tm_mon = (n4Day >> 5) + 1;
00200     n4Day > nMonthDays[tmDest.tm_mon]; tmDest.tm_mon++);
00201
00202     tmDest.tm_mday = (int)(n4Day - nMonthDays[tmDest.tm_mon-1]);
00203
00204 DoTime:
00205     if (nSecsInDay == 0)
00206         tmDest.tm_hour = tmDest.tm_min = tmDest.tm_sec = 0;
00207     else
00208     {
00209         tmDest.tm_sec = (int)nSecsInDay % 60L;
00210         nMinutesInDay = nSecsInDay / 60L;
00211         tmDest.tm_min = (int)nMinutesInDay % 60;
00212         tmDest.tm_hour = (int)nMinutesInDay / 60;
00213     }
00214
00215     return TRUE;
00216 }
00217
00218 static BOOL GetAsSystemTime(const COleDateTime& dtm, SYSTEMTIME& sysTime)
00219 {
00220     BOOL bRetVal = FALSE;
00221     if (dtm.GetStatus() == COleDateTime::valid)
00222     {
00223         struct tm tmTemp;
00224         if (TmFromOleDate(dtm, tmTemp))
00225         {
00226             sysTime.wYear = (WORD) tmTemp.tm_year;
00227             sysTime.wMonth = (WORD) tmTemp.tm_mon;
00228             sysTime.wDayOfWeek = (WORD) tmTemp.tm_wday;
00229             sysTime.wDay = (WORD) tmTemp.tm_mday;
00230             sysTime.wHour = (WORD) tmTemp.tm_hour;
00231             sysTime.wMinute = (WORD) tmTemp.tm_min;
00232             sysTime.wSecond = (WORD) tmTemp.tm_sec;
00233             sysTime.wMilliseconds = 0;
00234
00235             bRetVal = TRUE;
00236         }
00237     }
00238
00239     return bRetVal;
00240 }
00241
00242 static BOOL GetAsSystemTime(const COleDateTime* pdtm, SYSTEMTIME& sysTime)
00243 {
00244     return GetAsSystemTime(*pdtm, sysTime);
00245 }
00246
00248 // CCJDateTimeCtrl
00249
00250 BOOL CCJDateTimeCtrl::Create(DWORD dwStyle, const RECT& rect,
00251                            CWnd* pParentWnd, UINT nID)
00252 {
00253    // initialize common controls
00254 #ifdef _VC_VERSION_5
00255     INITCOMMONCONTROLSEX icex;
00256     icex.dwSize = sizeof(icex);
00257     icex.dwICC = ICC_DATE_CLASSES;
00258     VERIFY(InitCommonControlsEx(&icex));
00259 #else
00260     VERIFY(AfxDeferRegisterClass(AFX_WNDCOMMCTL_DATE_REG));
00261 #endif
00262
00263     CWnd* pWnd = this;
00264     return pWnd->Create(DATETIMEPICK_CLASS, NULL, dwStyle, rect, pParentWnd, nID);
00265 }
00266
00267 DWORD CCJDateTimeCtrl::GetRange(CTime* pMinTime, CTime* pMaxTime) const
00268 {
00269     ASSERT(::IsWindow(m_hWnd));
00270     SYSTEMTIME sysTimes[2];
00271     memset(sysTimes, 0, sizeof(sysTimes));
00272
00273     DWORD dwResult = ::SendMessage(m_hWnd, DTM_GETRANGE, 0, (LPARAM) &sysTimes);
00274
00275     if (pMinTime != NULL)
00276     {
00277         if (dwResult & GDTR_MIN)
00278             *pMinTime = CTime(sysTimes[0]);
00279     }
00280
00281     if (pMaxTime != NULL)
00282     {
00283         if (dwResult & GDTR_MAX)
00284             *pMaxTime = CTime(sysTimes[1]);
00285     }
00286
00287     return dwResult;
00288
00289 }
00290
00291 DWORD CCJDateTimeCtrl::GetRange(COleDateTime* pMinTime,
00292     COleDateTime* pMaxTime) const
00293 {
00294     ASSERT(::IsWindow(m_hWnd));
00295
00296     SYSTEMTIME sysTimes[2];
00297     memset(sysTimes, 0, sizeof(sysTimes));
00298
00299     DWORD dwResult = ::SendMessage(m_hWnd, DTM_GETRANGE, 0, (LPARAM) &sysTimes);
00300     if (pMinTime != NULL)
00301     {
00302         if (dwResult & GDTR_MIN)
00303             *pMinTime = COleDateTime(sysTimes[0]);
00304         else
00305             pMinTime->SetStatus(COleDateTime::null);
00306     }
00307
00308     if (pMaxTime != NULL)
00309     {
00310         if (dwResult & GDTR_MAX)
00311             *pMaxTime = COleDateTime(sysTimes[1]);
00312         else
00313             pMaxTime->SetStatus(COleDateTime::null);
00314     }
00315
00316     return dwResult;
00317 }
00318
00319 BOOL CCJDateTimeCtrl::SetRange(const CTime* pMinTime, const CTime* pMaxTime)
00320 {
00321     ASSERT(::IsWindow(m_hWnd));
00322
00323     SYSTEMTIME sysTimes[2];
00324
00325     WPARAM wFlags = 0;
00326     if (pMinTime != NULL && GetAsSystemTime(pMinTime, sysTimes[0]))
00327         wFlags |= GDTR_MIN;
00328
00329     if (pMaxTime != NULL && GetAsSystemTime(pMaxTime, sysTimes[1]))
00330         wFlags |= GDTR_MAX;
00331
00332     return (BOOL) ::SendMessage(m_hWnd, DTM_SETRANGE, wFlags, (LPARAM) &sysTimes);
00333 }
00334
00335 BOOL CCJDateTimeCtrl::SetRange(const COleDateTime* pMinTime, const COleDateTime* pMaxTime)
00336 {
00337     ASSERT(::IsWindow(m_hWnd));
00338     ASSERT(pMinTime == NULL || pMinTime->GetStatus() != COleDateTime::invalid);
00339     ASSERT(pMaxTime == NULL || pMaxTime->GetStatus() != COleDateTime::invalid);
00340
00341     SYSTEMTIME sysTime[2];
00342
00343     WPARAM wFlags = 0;
00344     if (pMinTime != NULL && pMinTime->GetStatus() != COleDateTime::null)
00345     {
00346         if (GetAsSystemTime(pMinTime, sysTime[0]))
00347             wFlags |= GDTR_MIN;
00348     }
00349
00350     if (pMaxTime != NULL && pMaxTime->GetStatus() != COleDateTime::null)
00351     {
00352         if (GetAsSystemTime(pMaxTime, sysTime[1]))
00353             wFlags |= GDTR_MAX;
00354     }
00355
00356     return (BOOL) ::SendMessage(m_hWnd, DTM_SETRANGE, wFlags, (LPARAM) &sysTime);
00357 }
00358
00359 BOOL CCJDateTimeCtrl::SetTime(LPSYSTEMTIME pTimeNew /* = NULL */)
00360 {
00361     ASSERT(::IsWindow(m_hWnd));
00362     WPARAM wParam = (pTimeNew == NULL) ? GDT_NONE : GDT_VALID;
00363     return (BOOL) ::SendMessage(m_hWnd, DTM_SETSYSTEMTIME,
00364         wParam, (LPARAM) pTimeNew);
00365 }
00366
00367 BOOL CCJDateTimeCtrl::SetTime(const COleDateTime& timeNew)
00368 {
00369     BOOL bRetVal = FALSE;
00370
00371     // make sure the time isn't invalid
00372     ASSERT(timeNew.GetStatus() != COleDateTime::invalid);
00373     ASSERT(::IsWindow(m_hWnd));
00374
00375     SYSTEMTIME sysTime;
00376     WPARAM wParam = GDT_NONE;
00377     if (timeNew.GetStatus() == COleDateTime::valid &&
00378         GetAsSystemTime(timeNew, sysTime))
00379     {
00380         wParam = GDT_VALID;
00381     }
00382
00383     bRetVal = (BOOL) ::SendMessage(m_hWnd,
00384             DTM_SETSYSTEMTIME, wParam, (LPARAM) &sysTime);
00385
00386     return bRetVal;
00387 }
00388
00389 BOOL CCJDateTimeCtrl::SetTime(const CTime* pTimeNew)
00390 {
00391     BOOL bRetVal = FALSE;
00392
00393     // make sure the time isn't invalid
00394     ASSERT(::IsWindow(m_hWnd));
00395
00396     SYSTEMTIME sysTime;
00397     WPARAM wParam = GDT_NONE;
00398     if (pTimeNew != NULL && GetAsSystemTime(pTimeNew, sysTime))
00399     {
00400         wParam = GDT_VALID;
00401     }
00402
00403     bRetVal = (BOOL) ::SendMessage(m_hWnd,
00404             DTM_SETSYSTEMTIME, wParam, (LPARAM) &sysTime);
00405
00406     return bRetVal;
00407 }
00408
00409 BOOL CCJDateTimeCtrl::GetTime(COleDateTime& timeDest) const
00410 {
00411     SYSTEMTIME sysTime;
00412     BOOL bRetVal = TRUE;
00413
00414     LRESULT result = ::SendMessage(m_hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM) &sysTime);
00415     if (result == GDT_VALID)
00416     {
00417         timeDest = COleDateTime(sysTime);
00418         bRetVal = TRUE;
00419         ASSERT(timeDest.GetStatus() == COleDateTime::valid);
00420     }
00421     else if (result == GDT_NONE)
00422     {
00423         timeDest.SetStatus(COleDateTime::null);
00424         bRetVal = TRUE;
00425     }
00426     else
00427         timeDest.SetStatus(COleDateTime::invalid);
00428     return bRetVal;
00429 }
00430
00431 DWORD CCJDateTimeCtrl::GetTime(CTime& timeDest) const
00432 {
00433     SYSTEMTIME sysTime;
00434     DWORD dwResult = (DWORD)
00435         ::SendMessage(m_hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM) &sysTime);
00436
00437     if (dwResult == GDT_VALID)
00438         timeDest = CTime(sysTime);
00439
00440     return dwResult;
00441 }
00442
00443 CCJDateTimeCtrl::~CCJDateTimeCtrl()
00444 {
00445     DestroyWindow();
00446 }
00447
00449 // CCJMonthCalCtrl
00450
00451 BOOL CCJMonthCalCtrl::Create(DWORD dwStyle, const RECT& rect,
00452     CWnd* pParentWnd, UINT nID)
00453 {
00454     // initialize common controls
00455 #ifdef _VC_VERSION_5
00456     INITCOMMONCONTROLSEX icex;
00457     icex.dwSize = sizeof(icex);
00458     icex.dwICC = ICC_DATE_CLASSES;
00459     VERIFY(InitCommonControlsEx(&icex));
00460 #else
00461     VERIFY(AfxDeferRegisterClass(AFX_WNDCOMMCTL_DATE_REG));
00462 #endif
00463
00464     CWnd* pWnd = this;
00465     return pWnd->Create(MONTHCAL_CLASS, NULL, dwStyle, rect, pParentWnd, nID);
00466 }
00467
00468 BOOL CCJMonthCalCtrl::Create(DWORD dwStyle, const POINT& pt,
00469     CWnd* pParentWnd, UINT nID)
00470 {
00471     BOOL bWasVisible = (dwStyle & WS_VISIBLE);
00472     dwStyle &= ~WS_VISIBLE;
00473
00474     CRect rect(pt.x, pt.y, 0, 0);
00475
00476     BOOL bRetVal = FALSE;
00477    if (Create(dwStyle, rect, pParentWnd, nID))
00478     {
00479         if (SizeMinReq())
00480         {
00481             if (bWasVisible)
00482                 ShowWindow(SW_SHOWNA);
00483             bRetVal = TRUE;
00484         }
00485         else
00486             DestroyWindow();
00487     }
00488
00489     return bRetVal;
00490 }
00491
00492 BOOL CCJMonthCalCtrl::SizeMinReq(BOOL bRepaint /* = TRUE */)
00493 {
00494     CRect rect;
00495     BOOL bRetVal = FALSE;
00496     if (GetMinReqRect(rect))
00497     {
00498         DWORD dwFlags = SWP_NOZORDER | SWP_NOREPOSITION | SWP_NOMOVE | SWP_NOACTIVATE;
00499         if (!bRepaint)
00500             dwFlags |= SWP_NOREDRAW;
00501         SetWindowPos(NULL, 0, 0, rect.Width(), rect.Height(), dwFlags);
00502         bRetVal = TRUE;
00503     }
00504
00505     return bRetVal;
00506 }
00507
00508 void CCJMonthCalCtrl::SetToday(const COleDateTime& refTime)
00509 {
00510     ASSERT_VALID(this);
00511
00512     // make sure the time isn't invalid
00513     ASSERT(refTime.GetStatus() != COleDateTime::invalid);
00514     ASSERT(::IsWindow(m_hWnd));
00515
00516     SYSTEMTIME sysTime;
00517     LPSYSTEMTIME pSysTime = NULL;
00518     WPARAM wParam = GDT_NONE;
00519
00520     // if the passed time is null or out of range,
00521     // we'll set the control to NULL
00522
00523     if (GetAsSystemTime(refTime, sysTime))
00524     {
00525         pSysTime = &sysTime;
00526         wParam = GDT_VALID;
00527     }
00528
00529     if (::IsWindow(m_hWnd))
00530         ::SendMessage(m_hWnd, MCM_SETTODAY, wParam, (LPARAM) pSysTime);
00531 }
00532
00533 void CCJMonthCalCtrl::SetToday(const CTime* pDateTime)
00534 {
00535     ASSERT(::IsWindow(m_hWnd));
00536     ASSERT_VALID(this);
00537
00538     // if the passed time is NULL, we'll set the
00539     // control to NULL
00540
00541     WPARAM wParam = GDT_NONE;
00542     LPSYSTEMTIME pSysTime = NULL;
00543     SYSTEMTIME sysTime;
00544
00545     if (pDateTime != NULL && GetAsSystemTime(pDateTime, sysTime))
00546     {
00547         wParam = GDT_VALID;
00548         pSysTime = &sysTime;
00549     }
00550
00551     if (::IsWindow(m_hWnd))
00552         ::SendMessage(m_hWnd, MCM_SETTODAY, wParam, (LPARAM) pSysTime);
00553 }
00554
00555 BOOL CCJMonthCalCtrl::SetCurSel(const COleDateTime& refTime)
00556 {
00557     ASSERT(::IsWindow(m_hWnd));
00558
00559     SYSTEMTIME sysTime;
00560     BOOL bRetVal = FALSE;
00561
00562     // if the passed time is null or out of range,
00563     // we'll set the control to NULL
00564
00565     if (GetAsSystemTime(refTime, sysTime) &&
00566         refTime.GetStatus() == COleDateTime::valid)
00567     {
00568         bRetVal = (BOOL)
00569             ::SendMessage(m_hWnd, MCM_SETCURSEL, 0, (LPARAM) &sysTime);
00570     }
00571
00572     return bRetVal;
00573 }
00574
00575 BOOL CCJMonthCalCtrl::SetCurSel(const CTime& refTime)
00576 {
00577     ASSERT(::IsWindow(m_hWnd));
00578
00579     SYSTEMTIME sysTime;
00580     BOOL bRetVal = FALSE;
00581
00582     if (GetAsSystemTime(refTime, sysTime))
00583     {
00584         bRetVal = (BOOL)
00585             ::SendMessage(m_hWnd, MCM_SETCURSEL, 0, (LPARAM) &sysTime);
00586     }
00587
00588     return bRetVal;
00589 }
00590
00591 BOOL CCJMonthCalCtrl::GetCurSel(COleDateTime& refTime) const
00592 {
00593     ASSERT(::IsWindow(m_hWnd));
00594
00595     // can't use this method on multiple selection controls
00596     ASSERT(!(GetStyle() & MCS_MULTISELECT));
00597
00598     SYSTEMTIME sysTime;
00599     BOOL bResult = (BOOL)
00600         ::SendMessage(m_hWnd, MCM_GETCURSEL, 0, (LPARAM) &sysTime);
00601
00602     if (bResult)
00603         refTime = COleDateTime(sysTime);
00604
00605     return bResult;
00606 }
00607
00608 BOOL CCJMonthCalCtrl::GetToday(COleDateTime& refTime) const
00609 {
00610     ASSERT(::IsWindow(m_hWnd));
00611
00612     // can't use this method on multiple selection controls
00613     ASSERT(!(GetStyle() & MCS_MULTISELECT));
00614
00615     SYSTEMTIME sysTime;
00616     BOOL bResult = (BOOL)
00617         ::SendMessage(m_hWnd, MCM_GETTODAY, 0, (LPARAM) &sysTime);
00618
00619     if (bResult)
00620         refTime = COleDateTime(sysTime);
00621
00622     return bResult;
00623 }
00624
00625 BOOL CCJMonthCalCtrl::GetCurSel(CTime& refTime) const
00626 {
00627     ASSERT(::IsWindow(m_hWnd));
00628
00629     // can't use this method on multiple selection controls
00630     ASSERT(!(GetStyle() & MCS_MULTISELECT));
00631
00632     SYSTEMTIME sysTime;
00633     BOOL bResult = (BOOL)
00634         ::SendMessage(m_hWnd, MCM_GETCURSEL, 0, (LPARAM) &sysTime);
00635
00636     if (bResult)
00637         refTime = CTime(sysTime);
00638
00639     return bResult;
00640 }
00641
00642 BOOL CCJMonthCalCtrl::GetToday(CTime& refTime) const
00643 {
00644     ASSERT(::IsWindow(m_hWnd));
00645
00646     // can't use this method on multiple selection controls
00647     ASSERT(!(GetStyle() & MCS_MULTISELECT));
00648
00649     SYSTEMTIME sysTime;
00650     BOOL bResult = (BOOL)
00651         ::SendMessage(m_hWnd, MCM_GETTODAY, 0, (LPARAM) &sysTime);
00652
00653     if (bResult)
00654         refTime = CTime(sysTime);
00655
00656     return bResult;
00657 }
00658
00659 CCJMonthCalCtrl::~CCJMonthCalCtrl()
00660 {
00661     DestroyWindow();
00662 }
00663
00664 int CCJMonthCalCtrl::GetFirstDayOfWeek(BOOL* pbLocal /* = NULL */) const
00665 {
00666     ASSERT(::IsWindow(m_hWnd));
00667     DWORD dwResult;
00668     dwResult = (DWORD) ::SendMessage(m_hWnd, MCM_GETFIRSTDAYOFWEEK, 0, 0);
00669
00670     // set *pbLocal to reflect if the first day of week
00671     // matches current locale setting
00672
00673     if (pbLocal)
00674         *pbLocal = HIWORD(dwResult);
00675     return LOWORD(dwResult);
00676 }
00677
00678 BOOL CCJMonthCalCtrl::SetFirstDayOfWeek(int iDay, int* lpnOld /* = NULL */)
00679 {
00680     ASSERT(::IsWindow(m_hWnd));
00681     DWORD dwResult;
00682     dwResult = (DWORD) ::SendMessage(m_hWnd, MCM_SETFIRSTDAYOFWEEK, 0, (WPARAM) iDay);
00683
00684     if (lpnOld != NULL)
00685         *lpnOld = LOWORD(dwResult);
00686
00687     return (BOOL) HIWORD(dwResult);
00688 }
00689
00690 BOOL CCJMonthCalCtrl::SetDayState(int nMonths, LPMONTHDAYSTATE pStates)
00691 {
00692     ASSERT(::IsWindow(m_hWnd));
00693     ASSERT(AfxIsValidAddress(pStates, nMonths * sizeof(MONTHDAYSTATE), FALSE));
00694     return (BOOL) ::SendMessage(m_hWnd, MCM_SETDAYSTATE, (WPARAM) nMonths, (LPARAM) pStates);
00695 }
00696
00697 BOOL CCJMonthCalCtrl::SetRange(const COleDateTime* pMinRange,
00698     const COleDateTime* pMaxRange)
00699 {
00700     ASSERT(::IsWindow(m_hWnd));
00701     ASSERT(pMinRange == NULL || pMinRange->GetStatus() != COleDateTime::invalid);
00702     ASSERT(pMaxRange == NULL || pMaxRange->GetStatus() != COleDateTime::invalid);
00703
00704     SYSTEMTIME sysTimes[2];
00705     WPARAM wFlags = 0;
00706
00707     if (pMinRange != NULL && pMinRange->GetStatus() != COleDateTime::null)
00708     {
00709         if (GetAsSystemTime(pMinRange, sysTimes[0]))
00710             wFlags |= GDTR_MIN;
00711     }
00712
00713     if (pMaxRange != NULL && pMaxRange->GetStatus() != COleDateTime::null)
00714     {
00715         if (GetAsSystemTime(pMaxRange, sysTimes[1]))
00716             wFlags |= GDTR_MAX;
00717     }
00718
00719     return (BOOL)
00720         ::SendMessage(m_hWnd, MCM_SETRANGE, wFlags, (LPARAM) &sysTimes);
00721 }
00722
00723 BOOL CCJMonthCalCtrl::SetRange(const LPSYSTEMTIME pMinRange,
00724     const LPSYSTEMTIME pMaxRange)
00725 {
00726     ASSERT(::IsWindow(m_hWnd));
00727
00728     SYSTEMTIME sysTimes[2];
00729     WPARAM wFlags = 0;
00730
00731     if (pMinRange != NULL)
00732     {
00733         memcpy(&sysTimes[0], pMinRange, sizeof(SYSTEMTIME));
00734         wFlags |= GDTR_MIN;
00735     }
00736
00737     if (pMaxRange != NULL)
00738     {
00739         memcpy(&sysTimes[1], pMaxRange, sizeof(SYSTEMTIME));
00740         wFlags |= GDTR_MAX;
00741     }
00742
00743     return (BOOL)
00744         ::SendMessage(m_hWnd, MCM_SETRANGE, wFlags, (LPARAM) &sysTimes);
00745 }
00746
00747 DWORD CCJMonthCalCtrl::GetRange(COleDateTime* pMinRange,
00748     COleDateTime* pMaxRange) const
00749 {
00750     ASSERT(::IsWindow(m_hWnd));
00751
00752     SYSTEMTIME sysTimes[2];
00753     memset(sysTimes, 0, sizeof(sysTimes));
00754
00755     DWORD dwRanges = (DWORD)
00756         ::SendMessage(m_hWnd, MCM_GETRANGE, 0, (LPARAM) &sysTimes);
00757
00758     if (dwRanges & GDTR_MIN && pMinRange)
00759         *pMinRange = COleDateTime(sysTimes[0]);
00760
00761     if (dwRanges & GDTR_MAX && pMaxRange)
00762         *pMaxRange = COleDateTime(sysTimes[1]);
00763
00764     return dwRanges;
00765 }
00766
00767 DWORD CCJMonthCalCtrl::GetRange(LPSYSTEMTIME pMinRange,
00768     LPSYSTEMTIME pMaxRange) const
00769 {
00770     ASSERT(::IsWindow(m_hWnd));
00771
00772     SYSTEMTIME sysTimes[2];
00773     memset(sysTimes, 0, sizeof(sysTimes));
00774
00775     DWORD dwRanges = (DWORD)
00776         ::SendMessage(m_hWnd, MCM_GETRANGE, 0, (LPARAM) &sysTimes);
00777
00778     if (dwRanges & GDTR_MIN && pMinRange)
00779         memcpy(pMinRange, &sysTimes[0], sizeof(SYSTEMTIME));
00780
00781     if (dwRanges & GDTR_MAX && pMaxRange)
00782         memcpy(pMaxRange, &sysTimes[1], sizeof(SYSTEMTIME));
00783
00784     return dwRanges;
00785 }
00786
00787 BOOL CCJMonthCalCtrl::SetRange(const CTime* pMinRange, const CTime* pMaxRange)
00788 {
00789     ASSERT(::IsWindow(m_hWnd));
00790
00791     SYSTEMTIME sysTimes[2];
00792     WPARAM wFlags = 0;
00793     if (pMinRange != NULL && GetAsSystemTime(pMinRange, sysTimes[0]))
00794         wFlags |= GDTR_MIN;
00795
00796     if (pMaxRange != NULL && GetAsSystemTime(pMaxRange, sysTimes[1]))
00797         wFlags |= GDTR_MAX;
00798
00799     return (BOOL)
00800         ::SendMessage(m_hWnd, MCM_SETRANGE, wFlags, (LPARAM) &sysTimes);
00801 }
00802
00803 DWORD CCJMonthCalCtrl::GetRange(CTime* pMinRange, CTime* pMaxRange) const
00804 {
00805     ASSERT(::IsWindow(m_hWnd));
00806
00807     SYSTEMTIME sysTimes[2];
00808     memset(sysTimes, 0, sizeof(sysTimes));
00809
00810     DWORD dwRanges = (DWORD)
00811         ::SendMessage(m_hWnd, MCM_GETRANGE, 0, (LPARAM) &sysTimes);
00812
00813     if (dwRanges & GDTR_MIN && pMinRange)
00814         *pMinRange = CTime(sysTimes[0]);
00815
00816     if (dwRanges & GDTR_MAX && pMaxRange)
00817         *pMaxRange = CTime(sysTimes[1]);
00818
00819     return dwRanges;
00820 }
00821
00822 int CCJMonthCalCtrl::GetMonthRange(COleDateTime& refMinRange,
00823     COleDateTime& refMaxRange, DWORD dwFlags) const
00824 {
00825     ASSERT(::IsWindow(m_hWnd));
00826     ASSERT(dwFlags == GMR_DAYSTATE || dwFlags == GMR_VISIBLE);
00827
00828     SYSTEMTIME sysTimes[2];
00829     memset(sysTimes, 0, sizeof(sysTimes));
00830     int nCount = (int) ::SendMessage(m_hWnd, MCM_GETMONTHRANGE,
00831         (WPARAM) dwFlags, (LPARAM) &sysTimes);
00832
00833     refMinRange = COleDateTime(sysTimes[0]);
00834     refMaxRange = COleDateTime(sysTimes[1]);
00835
00836     return nCount;
00837 }
00838
00839 int CCJMonthCalCtrl::GetMonthRange(LPSYSTEMTIME pMinRange,
00840     LPSYSTEMTIME pMaxRange, DWORD dwFlags) const
00841 {
00842     ASSERT(::IsWindow(m_hWnd));
00843     ASSERT_POINTER(pMinRange, SYSTEMTIME);
00844     ASSERT_POINTER(pMaxRange, SYSTEMTIME);
00845
00846     SYSTEMTIME sysTimes[2];
00847
00848     int nCount = (int) ::SendMessage(m_hWnd, MCM_GETMONTHRANGE,
00849         (WPARAM) dwFlags, (LPARAM) &sysTimes);
00850
00851     memcpy(pMinRange, &sysTimes[0], sizeof(SYSTEMTIME));
00852     memcpy(pMaxRange, &sysTimes[1], sizeof(SYSTEMTIME));
00853
00854     return nCount;
00855 }
00856
00857 int CCJMonthCalCtrl::GetMonthRange(CTime& refMinRange, CTime& refMaxRange,
00858     DWORD dwFlags) const
00859 {
00860     ASSERT(::IsWindow(m_hWnd));
00861     ASSERT(dwFlags == GMR_DAYSTATE || dwFlags == GMR_VISIBLE);
00862
00863     SYSTEMTIME sysTimes[2];
00864     memset(sysTimes, 0, sizeof(sysTimes));
00865     int nCount = (int) ::SendMessage(m_hWnd, MCM_GETMONTHRANGE,
00866         (WPARAM) dwFlags,   (LPARAM) &sysTimes);
00867
00868     refMinRange = CTime(sysTimes[0]);
00869     refMaxRange = CTime(sysTimes[1]);
00870
00871     return nCount;
00872 }
00873
00874 BOOL CCJMonthCalCtrl::GetSelRange(LPSYSTEMTIME pMinRange,
00875     LPSYSTEMTIME pMaxRange) const
00876 {
00877     ASSERT(m_hWnd != NULL);
00878     ASSERT((GetStyle() & MCS_MULTISELECT));
00879
00880     ASSERT_POINTER(pMinRange, SYSTEMTIME);
00881     ASSERT_POINTER(pMaxRange, SYSTEMTIME);
00882
00883     SYSTEMTIME sysTimes[2];
00884     BOOL bReturn = (BOOL) ::SendMessage(m_hWnd, MCM_GETSELRANGE,
00885                                         0, (LPARAM) &sysTimes);
00886
00887     if (bReturn)
00888     {
00889         memcpy(pMinRange, &sysTimes[0], sizeof(SYSTEMTIME));
00890         memcpy(pMaxRange, &sysTimes[1], sizeof(SYSTEMTIME));
00891     }
00892
00893     return bReturn;
00894 }
00895
00896 BOOL CCJMonthCalCtrl::SetSelRange(const LPSYSTEMTIME pMinRange,
00897     const LPSYSTEMTIME pMaxRange)
00898 {
00899     ASSERT(m_hWnd != NULL);
00900     ASSERT((GetStyle() & MCS_MULTISELECT));
00901
00902     ASSERT_POINTER(pMinRange, SYSTEMTIME);
00903     ASSERT_POINTER(pMaxRange, SYSTEMTIME);
00904
00905     SYSTEMTIME sysTimes[2];
00906     memcpy(&sysTimes[0], pMinRange, sizeof(SYSTEMTIME));
00907     memcpy(&sysTimes[1], pMaxRange, sizeof(SYSTEMTIME));
00908
00909     return (BOOL) ::SendMessage(m_hWnd, MCM_SETSELRANGE,
00910         0, (LPARAM) &sysTimes);
00911 }
00912
00913 BOOL CCJMonthCalCtrl::SetSelRange(const COleDateTime& refMinRange,
00914     const COleDateTime& refMaxRange)
00915 {
00916     // control must have multiple select
00917     ASSERT((GetStyle() & MCS_MULTISELECT));
00918     ASSERT(::IsWindow(m_hWnd));
00919
00920     SYSTEMTIME sysTimes[2];
00921     BOOL bResult = FALSE;
00922
00923     if (refMinRange.GetStatus() == COleDateTime::valid &&
00924         refMinRange.GetStatus() == COleDateTime::valid)
00925     {
00926         if (GetAsSystemTime(refMinRange, sysTimes[0]) &&
00927             GetAsSystemTime(refMaxRange, sysTimes[1]))
00928         {
00929             bResult = (BOOL)
00930                 ::SendMessage(m_hWnd, MCM_SETSELRANGE, 0, (LPARAM)sysTimes);
00931         }
00932     }
00933
00934     return bResult;
00935 }
00936
00937 BOOL CCJMonthCalCtrl::GetSelRange(COleDateTime& refMinRange,
00938     COleDateTime& refMaxRange) const
00939 {
00940     // control must have multiple select
00941     ASSERT((GetStyle() & MCS_MULTISELECT));
00942     ASSERT(::IsWindow(m_hWnd));
00943
00944     SYSTEMTIME sysTimes[2];
00945     memset(sysTimes, 0, sizeof(sysTimes));
00946     BOOL bResult = (BOOL)
00947         ::SendMessage(m_hWnd, MCM_GETSELRANGE, 0, (LPARAM) &sysTimes);
00948
00949     if (bResult)
00950     {
00951         refMinRange = COleDateTime(sysTimes[0]);
00952         refMaxRange = COleDateTime(sysTimes[1]);
00953     }
00954     return bResult;
00955 }
00956
00957 BOOL CCJMonthCalCtrl::SetSelRange(const CTime& refMinRange,
00958     const CTime& refMaxRange)
00959 {
00960     // control must have multiple select
00961     ASSERT((GetStyle() & MCS_MULTISELECT));
00962     ASSERT(::IsWindow(m_hWnd));
00963
00964     SYSTEMTIME sysTimes[2];
00965     BOOL bResult = FALSE;
00966
00967     if (GetAsSystemTime(refMinRange, sysTimes[0]) &&
00968         GetAsSystemTime(refMaxRange, sysTimes[1]))
00969     {
00970         bResult = (BOOL)
00971             ::SendMessage(m_hWnd, MCM_SETSELRANGE, 0, (LPARAM)sysTimes);
00972     }
00973
00974     return bResult;
00975 }
00976
00977 BOOL CCJMonthCalCtrl::GetSelRange(CTime& refMinRange, CTime& refMaxRange) const
00978 {
00979     // control must have multiple select
00980     ASSERT((GetStyle() & MCS_MULTISELECT));
00981     ASSERT(::IsWindow(m_hWnd));
00982
00983     SYSTEMTIME sysTimes[2];
00984     memset(sysTimes, 0, sizeof(sysTimes));
00985     BOOL bResult = (BOOL)
00986         ::SendMessage(m_hWnd, MCM_GETSELRANGE, 0, (LPARAM) &sysTimes);
00987
00988     if (bResult)
00989     {
00990         refMinRange = CTime(sysTimes[0]);
00991         refMaxRange = CTime(sysTimes[1]);
00992     }
00993     return bResult;
00994 }
00995
00997 // DDX_ routines
00998
00999 void AFXAPI DDX_CJDateTimeCtrl(CDataExchange* pDX, int nIDC, COleDateTime& value)
01000 {
01001     HWND hWndCtrl = pDX->PrepareCtrl(nIDC);
01002     CCJDateTimeCtrl* pWnd = (CCJDateTimeCtrl*) CWnd::FromHandle(hWndCtrl);
01003
01004     if (pDX->m_bSaveAndValidate)
01005         pWnd->GetTime(value);
01006     else
01007         pWnd->SetTime(value);
01008 }
01009
01010 void AFXAPI DDX_CJDateTimeCtrl(CDataExchange* pDX, int nIDC, CTime& value)
01011 {
01012     HWND hWndCtrl = pDX->PrepareCtrl(nIDC);
01013     CCJDateTimeCtrl* pWnd = (CCJDateTimeCtrl*) CWnd::FromHandle(hWndCtrl);
01014
01015     if (pDX->m_bSaveAndValidate)
01016         pWnd->GetTime(value);
01017     else
01018         pWnd->SetTime(&value);
01019 }
01020
01021 void AFXAPI DDX_CJMonthCalCtrl(CDataExchange* pDX, int nIDC,
01022     COleDateTime& value)
01023 {
01024     HWND hWndCtrl = pDX->PrepareCtrl(nIDC);
01025     CCJMonthCalCtrl* pWnd = (CCJMonthCalCtrl*) CWnd::FromHandle(hWndCtrl);
01026
01027     if (pDX->m_bSaveAndValidate)
01028         pWnd->GetCurSel(value);
01029     else
01030         pWnd->SetCurSel(value);
01031 }
01032
01033 void AFXAPI DDX_CJMonthCalCtrl(CDataExchange* pDX, int nIDC, CTime& value)
01034 {
01035     HWND hWndCtrl = pDX->PrepareCtrl(nIDC);
01036     CCJMonthCalCtrl* pWnd = (CCJMonthCalCtrl*) CWnd::FromHandle(hWndCtrl);
01037
01038     if (pDX->m_bSaveAndValidate)
01039         pWnd->GetCurSel(value);
01040     else
01041         pWnd->SetCurSel(value);
01042 }
01043
01044 void AFXAPI DDV_CJMinMaxDateTime(CDataExchange* pDX, CTime& refValue,
01045     const CTime* pMinRange, const CTime* pMaxRange)
01046 {
01047     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01048
01049     CCJDateTimeCtrl* pWnd =
01050         (CCJDateTimeCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01051
01052     if (!pDX->m_bSaveAndValidate)
01053     {
01054         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01055               (pMaxRange != NULL && *pMaxRange < refValue))
01056         {
01057 #ifdef _DEBUG
01058             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01059             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01060 #endif
01061             return;     // don't stop now
01062         }
01063     }
01064
01065     pWnd->SetRange(pMinRange, pMaxRange);
01066 }
01067
01068 void AFXAPI DDV_CJMinMaxDateTime(CDataExchange* pDX,  COleDateTime& refValue,
01069     const COleDateTime* pMinRange, const COleDateTime* pMaxRange)
01070 {
01071     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01072     CCJDateTimeCtrl* pWnd =
01073         (CCJDateTimeCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01074
01075     if (!pDX->m_bSaveAndValidate)
01076     {
01077         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01078               (pMaxRange != NULL && *pMaxRange < refValue))
01079         {
01080             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01081             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01082             return;     // don't stop now
01083         }
01084     }
01085
01086     pWnd->SetRange(pMinRange, pMaxRange);
01087 }
01088
01089 void AFXAPI DDV_CJMinMaxMonth(CDataExchange* pDX, CTime& refValue,
01090     const CTime* pMinRange, const CTime* pMaxRange)
01091 {
01092     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01093     CCJMonthCalCtrl* pWnd =
01094         (CCJMonthCalCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01095
01096     if (!pDX->m_bSaveAndValidate)
01097     {
01098         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01099               (pMaxRange != NULL && *pMaxRange < refValue))
01100         {
01101 #ifdef _DEBUG
01102             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01103             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01104 #endif
01105             return;     // don't stop now
01106         }
01107     }
01108
01109     pWnd->SetRange(pMinRange, pMaxRange);
01110 }
01111
01112 void AFXAPI DDV_CJMinMaxMonth(CDataExchange* pDX, COleDateTime& refValue,
01113     const COleDateTime* pMinRange, const COleDateTime* pMaxRange)
01114 {
01115     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01116     CCJMonthCalCtrl* pWnd =
01117         (CCJMonthCalCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01118
01119     if (!pDX->m_bSaveAndValidate)
01120     {
01121         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01122               (pMaxRange != NULL && *pMaxRange < refValue))
01123         {
01124 #ifdef _DEBUG
01125             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01126             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01127 #endif
01128             return;     // don't stop now
01129         }
01130     }
01131
01132     pWnd->SetRange(pMinRange, pMaxRange);
01133 }
01134
01136
01137 IMPLEMENT_DYNAMIC(CCJDateTimeCtrl, CWnd)
01138 IMPLEMENT_DYNAMIC(CCJMonthCalCtrl, CWnd)
01139
Generated on Sun Feb 24 01:21:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJDockBar.cpp Source File

WinCvs/CJLib/CJLibrary/CJDockBar.cpp

Go to the documentation of this file.
00001 // CJDockBar.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJockey/CJLibrary/CJDockBar.cpp $
00011  *
00012  * $History: CJDockBar.cpp $
00013  *
00014  * *****************  Version 5  *****************
00015  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00016  * Updated in $/CodeJockey/CJLibrary
00017  * Updated copyright and contact information.
00018  *
00019  * *****************  Version 4  *****************
00020  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00021  * Updated in $/CodeJockey/CJLibrary
00022  *
00023  * *****************  Version 3  *****************
00024  * User: Kirk Stowell Date: 7/18/99    Time: 10:25p
00025  * Updated in $/CodeJockey/CJLibrary
00026  * Added derived button class to handle control bar caption button
00027  * updates. Cleaned up inline functions, and import/export macro so that
00028  * class will be imported when linked to, and exported at compile time.
00029  * Added save and restore control bar size and state functionality.
00030  *
00031  * *****************  Version 2  *****************
00032  * User: Kirk Stowell Date: 4/03/99    Time: 12:53p
00033  * Updated in $/CodeJockey/CJ60Lib
00034  * Added comments and cleaned up code.
00035  *
00036  * *****************  Version 1  *****************
00037  * User: Kirk Stowell Date: 10/17/98   Time: 12:53p
00038  * Created in $/CodeJockey/CJ60Lib
00039  * Initial re-write and release.
00040  *
00041  ***************************************************************************/
00043
00044 #include "stdafx.h"
00045 #include "CJDockBar.h"
00046 #include "CJToolBar.h"
00047
00048 #ifdef _DEBUG
00049 #define new DEBUG_NEW
00050 #undef THIS_FILE
00051 static char THIS_FILE[] = __FILE__;
00052 #endif
00053
00055 // CCJDockBar
00056
00057 CCJDockBar::CCJDockBar()
00058 {
00059     // TODO: add construction code here.
00060 }
00061
00062 CCJDockBar::~CCJDockBar()
00063 {
00064     // TODO: add destruction code here.
00065 }
00066
00067 IMPLEMENT_DYNAMIC(CCJDockBar, CDockBar)
00068
00069 BEGIN_MESSAGE_MAP(CCJDockBar, CDockBar)
00070     //{{AFX_MSG_MAP(CCJDockBar)
00071         // NOTE - the ClassWizard will add and remove mapping macros here.
00072         //    DO NOT EDIT what you see in these blocks of generated code!
00073     //}}AFX_MSG_MAP
00074 END_MESSAGE_MAP()
00075
00077 // CCJDockBar message handlers
00078
00079 CSize CCJDockBar::CalcFixedLayout(BOOL bStretch, BOOL bHorz)
00080 {
00081     ASSERT_VALID(this);
00082
00083     CSize sizeFixed = CControlBar::CalcFixedLayout(bStretch, bHorz);
00084
00085     // get max size
00086     CSize sizeMax;
00087     if (!m_rectLayout.IsRectEmpty())
00088         sizeMax = m_rectLayout.Size();
00089     else
00090     {
00091         CRect rectFrame;
00092         CFrameWnd* pFrame = GetParentFrame();
00093         pFrame->GetClientRect(&rectFrame);
00094         sizeMax = rectFrame.Size();
00095     }
00096
00097     const int NormalcxBorder2=GetSystemMetrics(SM_CYBORDER)*2;
00098     const int NormalcyBorder2=2;
00099     const int AltcxBorder2=0;
00100     const int AltcyBorder2=0;
00101     int cxBorder2=0;
00102     int cyBorder2=0;
00103
00104     // prepare for layout
00105     AFX_SIZEPARENTPARAMS layout;
00106     layout.hDWP = m_bLayoutQuery ?
00107         NULL : ::BeginDeferWindowPos(m_arrBars.GetSize());
00108     CPoint pt(-cxBorder2, -NormalcyBorder2);
00109     int nWidth = 0;
00110
00111     BOOL bWrapped = FALSE;
00112
00113     // layout all the control bars
00114     for (int nPos = 0; nPos < m_arrBars.GetSize(); nPos++)
00115     {
00116         CControlBar* pBar = GetDockedControlBar(nPos);
00117         void* pVoid = m_arrBars[nPos];
00118
00119         if (pBar != NULL)
00120         {
00121             if (pBar->IsVisible())
00122             {
00123                 if(pBar->IsKindOf(RUNTIME_CLASS(CCJToolBar)))
00124                 {
00125                     cxBorder2=AltcxBorder2;
00126                     cyBorder2=AltcyBorder2;
00127                 }
00128                 else
00129                 {
00130                     cxBorder2=NormalcxBorder2;
00131                     cyBorder2=NormalcyBorder2;
00132                 }
00133                 // get ideal rect for bar
00134                 DWORD dwMode = 0;
00135                 if ((pBar->m_dwStyle & CBRS_SIZE_DYNAMIC) &&
00136                     (pBar->m_dwStyle & CBRS_FLOATING))
00137                     dwMode |= LM_HORZ | LM_MRUWIDTH;
00138                 else if (pBar->m_dwStyle & CBRS_ORIENT_HORZ)
00139                     dwMode |= LM_HORZ | LM_HORZDOCK;
00140                 else
00141                     dwMode |=  LM_VERTDOCK;
00142
00143                 CSize sizeBar = pBar->CalcDynamicLayout(-1, dwMode);
00144
00145                 CRect rect(pt, sizeBar);
00146
00147                 // get current rect for bar
00148                 CRect rectBar;
00149                 pBar->GetWindowRect(&rectBar);
00150                 ScreenToClient(&rectBar);
00151
00152                 if (bHorz)
00153                 {
00154                     // Offset Calculated Rect out to Actual
00155                     if (rectBar.left > rect.left && !m_bFloating)
00156                         rect.OffsetRect(rectBar.left - rect.left, 0);
00157
00158                     // If ControlBar goes off the right, then right justify
00159                     if (rect.right > sizeMax.cx && !m_bFloating)
00160                     {
00161                         int x = rect.Width() - cxBorder2;
00162                         x = max(sizeMax.cx - x, pt.x);
00163                         rect.OffsetRect(x - rect.left, 0);
00164                     }
00165
00166                     // If ControlBar has been wrapped, then left justify
00167                     if (bWrapped)
00168                     {
00169                         bWrapped = FALSE;
00170                         rect.OffsetRect(-(rect.left + cxBorder2), 0);
00171                     }
00172                     // If ControlBar is completely invisible, then wrap it
00173                     else if ((rect.left >= (sizeMax.cx - cxBorder2)) &&
00174                         (nPos > 0) && (m_arrBars[nPos - 1] != NULL))
00175                     {
00176                         m_arrBars.InsertAt(nPos, (CObject*)NULL);
00177                         pBar = NULL; pVoid = NULL;
00178                         bWrapped = TRUE;
00179                     }
00180                     if (!bWrapped)
00181                     {
00182                         if (rect != rectBar)
00183                         {
00184                             if (!m_bLayoutQuery &&
00185                                 !(pBar->m_dwStyle & CBRS_FLOATING))
00186                             {
00187                                 pBar->m_pDockContext->m_rectMRUDockPos = rect;
00188                             }
00189                             AfxRepositionWindow(&layout, pBar->m_hWnd, &rect);
00190                         }
00191                         pt.x = rect.left + sizeBar.cx - cxBorder2;
00192                         nWidth = max(nWidth, sizeBar.cy);
00193                     }
00194                 }
00195                 else
00196                 {
00197                     // Offset Calculated Rect out to Actual
00198                     if (rectBar.top > rect.top && !m_bFloating)
00199                         rect.OffsetRect(0, rectBar.top - rect.top);
00200
00201                     // If ControlBar goes off the bottom, then bottom justify
00202                     if (rect.bottom > sizeMax.cy && !m_bFloating)
00203                     {
00204                         int y = rect.Height() - cyBorder2;
00205                         y = max(sizeMax.cy - y, pt.y);
00206                         rect.OffsetRect(0, y - rect.top);
00207                     }
00208
00209                     // If ControlBar has been wrapped, then top justify
00210                     if (bWrapped)
00211                     {
00212                         bWrapped = FALSE;
00213                         rect.OffsetRect(0, -(rect.top + cyBorder2));
00214                     }
00215                     // If ControlBar is completely invisible, then wrap it
00216                     else if ((rect.top >= (sizeMax.cy - cyBorder2)) &&
00217                         (nPos > 0) && (m_arrBars[nPos - 1] != NULL))
00218                     {
00219                         m_arrBars.InsertAt(nPos, (CObject*)NULL);
00220                         pBar = NULL; pVoid = NULL;
00221                         bWrapped = TRUE;
00222                     }
00223                     if (!bWrapped)
00224                     {
00225                         if (rect != rectBar)
00226                         {
00227                             if (!m_bLayoutQuery &&
00228                                 !(pBar->m_dwStyle & CBRS_FLOATING))
00229                             {
00230                                 pBar->m_pDockContext->m_rectMRUDockPos = rect;
00231                             }
00232                             AfxRepositionWindow(&layout, pBar->m_hWnd, &rect);
00233                         }
00234                         pt.y = rect.top + sizeBar.cy - cyBorder2;
00235                         nWidth = max(nWidth, sizeBar.cx);
00236                     }
00237                 }
00238             }
00239             if (!bWrapped)
00240             {
00241                 // handle any delay/show hide for the bar
00242                 pBar->RecalcDelayShow(&layout);
00243             }
00244         }
00245         if (pBar == NULL && pVoid == NULL && nWidth != 0)
00246         {
00247             // end of row because pBar == NULL
00248             if (bHorz)
00249             {
00250                 pt.y += nWidth - cyBorder2;
00251                 sizeFixed.cx = max(sizeFixed.cx, pt.x);
00252                 sizeFixed.cy = max(sizeFixed.cy, pt.y);
00253                 pt.x = -cxBorder2;
00254             }
00255             else
00256             {
00257                 pt.x += nWidth - cxBorder2;
00258                 sizeFixed.cx = max(sizeFixed.cx, pt.x);
00259                 sizeFixed.cy = max(sizeFixed.cy, pt.y);
00260                 pt.y = -cyBorder2;
00261             }
00262             nWidth = 0;
00263         }
00264     }
00265     if (!m_bLayoutQuery)
00266     {
00267         // move and resize all the windows at once!
00268         if (layout.hDWP == NULL || !::EndDeferWindowPos(layout.hDWP))
00269             TRACE0("Warning: DeferWindowPos failed - low system resources.\n");
00270     }
00271
00272     // adjust size for borders on the dock bar itself
00273     CRect rect;
00274     rect.SetRectEmpty();
00275     CalcInsideRect(rect, bHorz);
00276
00277     if ((!bStretch || !bHorz) && sizeFixed.cx != 0)
00278         sizeFixed.cx += -rect.right + rect.left;
00279     if ((!bStretch || bHorz) && sizeFixed.cy != 0)
00280         sizeFixed.cy += -rect.bottom + rect.top;
00281
00282     return sizeFixed;
00283 }
Generated on Sun Feb 24 01:21:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJDockContext.cpp Source File

WinCvs/CJLib/CJLibrary/CJDockContext.cpp

Go to the documentation of this file.
00001 // CJDockContext.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 2001/11/06 15:28:26 $
00009  * $Revision: 1.2 $
00010  * $Archive: /CodeJockey/CJLibrary/CJDockContext.cpp $
00011  *
00012  * $History: CJDockContext.cpp $
00013  *
00014  * *****************  Version 10  *****************
00015  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00016  * Updated in $/CodeJockey/CJLibrary
00017  * Updated copyright and contact information.
00018  *
00019  * *****************  Version 9  *****************
00020  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00021  * Updated in $/CodeJockey/CJLibrary
00022  *
00023  * *****************  Version 8  *****************
00024  * User: Kirk Stowell Date: 7/18/99    Time: 10:25p
00025  * Updated in $/CodeJockey/CJLibrary
00026  * Added vc5 compatiblity
00027  *
00028  * *****************  Version 7  *****************
00029  * User: Kirk Stowell Date: 6/09/99    Time: 8:33p
00030  * Updated in $/CodeJockey/CJ60Lib
00031  * Ioannhs Stamatopoulos (Yiannhs) [ystamat@mail.datamedia.gr] - Extended
00032  * docking windows, removed ::GetSysColor(...) calls and WM_SYSCOLORCHANGE
00033  * message handler, this is now automatically handled by the base class.
00034  * Added redraw flags to the create method and modified paint and layout
00035  * handlers to reduce flicker and un-necessary command handling. Dragging
00036  * rect now reflects actual control bar docked size. Added "flat" look to
00037  * the control bars, the control bars can now use the classic DevStudio
00038  * look, or use flat gradient gripper, borders and frame buttons. Overall,
00039  * docking windows now handle dragging, docking and floating much better,
00040  * and behave more like DevStudio.
00041  *
00042  * *****************  Version 6  *****************
00043  * User: Kirk Stowell Date: 5/12/99    Time: 5:32a
00044  * Updated in $/CodeJockey/CJ60Lib
00045  * Added support for vc5 compatibility
00046  *
00047  * *****************  Version 5  *****************
00048  * User: Kirk Stowell Date: 4/14/99    Time: 12:57p
00049  * Updated in $/CodeJockey/CJ60Lib
00050  * Daniel Harth [danielh@mail.matco.ro] - Added support for diagonal
00051  * sizing.
00052  *
00053  * *****************  Version 4  *****************
00054  * User: Kirk Stowell Date: 4/03/99    Time: 12:56p
00055  * Updated in $/CodeJockey/CJ60Lib
00056  * Added comments and cleaned up code.
00057  *
00058  * *****************  Version 3  *****************
00059  * User: Kirk Stowell Date: 3/10/99    Time: 12:56p
00060  * Updated in $/CodeJockey/CJ60Lib
00061  * Added support for toggle docking.
00062  *
00063  * *****************  Version 2  *****************
00064  * User: Kirk Stowell Date: 3/03/99    Time: 12:54p
00065  * Updated in $/CodeJockey/CJ60Lib
00066  * Scott Killen [s_killen@yahoo.com] - If your frame is not your main
00067  * window in your app, you cannot dock a floating CCJControlBar. Changed
00068  * (CFrameWnd*)AfxGetApp()->m_pMainWnd to (CFrameWnd*)m_pDockSite in
00069  * CanDockDockBar() and DockSizeBar()
00070  *
00071  * *****************  Version 1  *****************
00072  * User: Kirk Stowell Date: 1/12/99    Time: 12:53p
00073  * Created in $/CodeJockey/CJ60Lib
00074  * Initial creation to add side-by-side docking support for CCJControlBar
00075  * class.
00076  *
00077  ***************************************************************************/
00079
00080 #include "stdafx.h"
00081 #include "CJDockContext.h"
00082 #include "CJControlBar.h"
00083 #include "CJSizeDockBar.h"
00084
00085 #ifdef _DEBUG
00086 #define new DEBUG_NEW
00087 #undef THIS_FILE
00088 static char THIS_FILE[] = __FILE__;
00089 #endif
00090
00091 #define HORZF(dw) (dw & CBRS_ORIENT_HORZ)
00092 #define VERTF(dw) (dw & CBRS_ORIENT_VERT)
00093
00094 static void AdjustRectangle(CRect& rect, CPoint pt)
00095 {
00096     int nXOffset = (pt.x < rect.left) ? (pt.x - rect.left) :
00097                     (pt.x > rect.right) ? (pt.x - rect.right) : 0;
00098     int nYOffset = (pt.y < rect.top) ? (pt.y - rect.top) :
00099                     (pt.y > rect.bottom) ? (pt.y - rect.bottom) : 0;
00100     rect.OffsetRect(nXOffset, nYOffset);
00101 }
00102
00104 // CCJDockContext
00105
00106 CCJDockContext::CCJDockContext(CControlBar* pBar) : CDockContext(pBar)
00107 {
00108     // TODO: add construction code here.
00109 }
00110
00111 CCJDockContext::~CCJDockContext()
00112 {
00113     // TODO: add destruction code here.
00114 }
00115
00117
00118 //1999-05-19 Yiannhs
00119 void CCJDockContext::StartDragDockBar(CPoint pt)
00120 {
00121     ASSERT_VALID(m_pBar);
00122     m_bDragging = TRUE;
00123
00124     InitLoop();
00125
00126     if (m_pBar->m_dwStyle & CBRS_SIZE_DYNAMIC)
00127     {
00128         CRect rect;
00129         m_pBar->GetWindowRect(rect);
00130         // Yiannhs setup and the new member
00131         m_ptOrig = m_ptLast = pt;
00132         CSize sizeHorz = m_pBar->CalcDynamicLayout(0, LM_HORZ | LM_HORZDOCK);
00133         CSize sizeVert = m_pBar->CalcDynamicLayout(0, LM_VERTDOCK);
00134         CSize sizeFloat = m_pBar->CalcDynamicLayout(0, LM_HORZ | LM_MRUWIDTH);
00135
00136         m_rectDragHorz = CRect(rect.TopLeft(), sizeHorz);
00137         m_rectDragVert = CRect(rect.TopLeft(), sizeVert);
00138
00139         // calculate frame dragging rectangle
00140         m_rectFrameDragHorz = CRect(rect.TopLeft(), sizeFloat);
00141         m_rectFrameDragVert = CRect(rect.TopLeft(), sizeFloat);
00142
00143         CMiniFrameWnd::CalcBorders(&m_rectFrameDragHorz);
00144         CMiniFrameWnd::CalcBorders(&m_rectFrameDragVert);
00145
00146         m_rectFrameDragHorz.InflateRect(-afxData.cxBorder2, -afxData.cyBorder2);
00147         m_rectFrameDragVert.InflateRect(-afxData.cxBorder2, -afxData.cyBorder2);
00148     }
00149
00150     else if (m_pBar->m_dwStyle & CBRS_SIZE_FIXED)
00151     {
00152         CRect rect;
00153         m_pBar->GetWindowRect(rect);
00154         //Yiannhs setup and the new member
00155         m_ptOrig = m_ptLast = pt;
00156         CSize sizeHorz = m_pBar->CalcDynamicLayout(-1, LM_HORZ | LM_HORZDOCK);
00157         CSize sizeVert = m_pBar->CalcDynamicLayout(-1, LM_VERTDOCK);
00158
00159         m_rectFrameDragHorz = m_rectDragHorz = CRect(rect.TopLeft(), sizeHorz);
00160         m_rectFrameDragVert = m_rectDragVert = CRect(rect.TopLeft(), sizeVert);
00161
00162         CMiniFrameWnd::CalcBorders(&m_rectFrameDragHorz);
00163         CMiniFrameWnd::CalcBorders(&m_rectFrameDragVert);
00164         m_rectFrameDragHorz.InflateRect(-afxData.cxBorder2, -afxData.cyBorder2);
00165         m_rectFrameDragVert.InflateRect(-afxData.cxBorder2, -afxData.cyBorder2);
00166     }
00167
00168     else
00169     {
00170         CRect rect;
00171         m_pBar->GetWindowRect(rect);
00172         //Yiannhs setup and the new member
00173         m_ptOrig = m_ptLast = pt;
00174         BOOL bHorz = HORZF(m_dwStyle);
00175         DWORD dwMode = !bHorz ? (LM_HORZ | LM_HORZDOCK) : LM_VERTDOCK;
00176         CSize size = m_pBar->CalcDynamicLayout(-1, dwMode);
00177
00178         if (bHorz)
00179         {
00180             m_rectDragHorz = rect;
00181             m_rectDragVert = CRect(CPoint(pt.x - rect.Height()/2, rect.top), size);
00182         }
00183
00184         else
00185         {
00186             m_rectDragVert = rect;
00187             m_rectDragHorz = CRect(CPoint(rect.left, pt.y - rect.Width()/2), size);
00188         }
00189
00190         m_rectFrameDragHorz = m_rectDragHorz;
00191         m_rectFrameDragVert = m_rectDragVert;
00192
00193         CMiniFrameWnd::CalcBorders(&m_rectFrameDragHorz);
00194         CMiniFrameWnd::CalcBorders(&m_rectFrameDragVert);
00195         m_rectFrameDragHorz.InflateRect(-afxData.cxBorder2, -afxData.cyBorder2);
00196         m_rectFrameDragVert.InflateRect(-afxData.cxBorder2, -afxData.cyBorder2);
00197     }
00198
00199     AdjustRectangle(m_rectDragHorz, pt);
00200     AdjustRectangle(m_rectDragVert, pt);
00201     AdjustRectangle(m_rectFrameDragHorz, pt);
00202     AdjustRectangle(m_rectFrameDragVert, pt);
00203
00204     m_dwOverDockStyle = CanDockDockBar();
00205     MoveDockBar(pt);
00206     TrackDockBar();
00207 }
00208
00209 DWORD CCJDockContext::CanDockDockBar()
00210 {
00211     BOOL bStyleHorz;
00212     DWORD dwDock = 0;
00213     DWORD dwCurr = 0;
00214
00215     ASSERT(m_dwStyle != 0);
00216     ASSERT_KINDOF(CFrameWnd, m_pDockSite);
00217
00218     bStyleHorz = HORZF(m_dwStyle);
00219     bStyleHorz = m_bFlip ? !bStyleHorz : bStyleHorz;
00220
00221     if (bStyleHorz && HORZF(m_dwDockStyle))
00222     {
00223         dwDock = CanDockDockBar(m_rectDragHorz,
00224             m_dwDockStyle & ~CBRS_ORIENT_VERT);
00225     }
00226
00227     else if (VERTF(m_dwDockStyle))
00228     {
00229         dwDock = CanDockDockBar(m_rectDragVert,
00230             m_dwDockStyle & ~CBRS_ORIENT_HORZ);
00231     }
00232
00233     if (!m_bFlip)
00234     {
00235         if (dwDock == 0 && HORZF(m_dwDockStyle))
00236         {
00237             dwCurr = CanDockDockBar(m_rectDragVert,
00238                 m_dwDockStyle & ~CBRS_ORIENT_VERT);
00239             dwDock = CanDockDockBar(m_rectDragHorz,
00240                 m_dwDockStyle & ~CBRS_ORIENT_VERT);
00241             dwDock = (dwDock == dwCurr) ? dwDock : 0;
00242         }
00243
00244         if (dwDock == 0 && VERTF(m_dwDockStyle))
00245         {
00246             dwCurr = CanDockDockBar(m_rectDragHorz,
00247                 m_dwDockStyle & ~CBRS_ORIENT_HORZ);
00248             dwDock = CanDockDockBar(m_rectDragVert,
00249                 m_dwDockStyle & ~CBRS_ORIENT_HORZ);
00250             dwDock = (dwDock == dwCurr) ? dwDock : 0;
00251         }
00252     }
00253
00254     return dwDock;
00255 }
00256
00257 DWORD CCJDockContext::CanDockDockBar(CRect rect, DWORD dwDockStyle, CDockBar** ppDockBar)
00258 {
00259     CFrameWnd *pFrame = (CFrameWnd*)m_pDockSite;
00260     ASSERT_VALID(pFrame);
00261
00262     dwDockStyle &= CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI;
00263
00264     if (ppDockBar != NULL)
00265         *ppDockBar = NULL;
00266     POSITION pos = pFrame->m_listControlBars.GetHeadPosition();
00267     while (pos != NULL)
00268     {
00269         CCJSizeDockBar* pDockBar = (CCJSizeDockBar*)pFrame->m_listControlBars.GetNext(pos);
00270         if( !pDockBar->IsKindOf(RUNTIME_CLASS(CCJSizeDockBar)) )
00271             continue;
00272         if (pDockBar->IsDockSizeBar() && pDockBar->IsWindowVisible() &&
00273             (pDockBar->m_dwStyle & dwDockStyle & CBRS_ALIGN_ANY) &&
00274             (!pDockBar->m_bFloating ||
00275                 (dwDockStyle & pDockBar->m_dwStyle & CBRS_FLOAT_MULTI)))
00276         {
00277             CRect rectBar;
00278             pDockBar->GetWindowRect(&rectBar);
00279             if (rectBar.Width() == 0)
00280                 rectBar.right++;
00281             if (rectBar.Height() == 0)
00282                 rectBar.bottom++;
00283             if (rectBar.IntersectRect(rectBar, rect))
00284             {
00285                 if (ppDockBar != NULL)
00286                     *ppDockBar = pDockBar;
00287                 return pDockBar->m_dwStyle & dwDockStyle;
00288             }
00289         }
00290     }
00291     return 0;
00292 }
00293
00294 BOOL CCJDockContext::TrackDockBar()
00295 {
00296     if (::GetCapture() != NULL)
00297         return FALSE;
00298     m_pBar->SetCapture();
00299     ASSERT(m_pBar == CWnd::GetCapture());
00300
00301     while (CWnd::GetCapture() == m_pBar)
00302     {
00303         MSG msg;
00304         if (!::GetMessage(&msg, NULL, 0, 0))
00305         {
00306             AfxPostQuitMessage(msg.wParam);
00307             break;
00308         }
00309
00310         switch (msg.message)
00311         {
00312         case WM_LBUTTONUP:
00313             if (m_bDragging)
00314                 EndDragDockBar();
00315             else
00316                 EndResize();
00317             return TRUE;
00318         case WM_MOUSEMOVE:
00319             if (m_bDragging)
00320                 MoveDockBar(msg.pt);
00321             else
00322                 Stretch(msg.pt);
00323             break;
00324         case WM_KEYUP:
00325             if (m_bDragging)
00326                 OnKey((int)msg.wParam, FALSE);
00327             break;
00328         case WM_KEYDOWN:
00329             if (m_bDragging)
00330                 OnKey((int)msg.wParam, TRUE);
00331             if (msg.wParam == VK_ESCAPE)
00332             {
00333                 CancelLoop();
00334                 return FALSE;
00335             }
00336             break;
00337         case WM_RBUTTONDOWN:
00338             CancelLoop();
00339             return FALSE;
00340
00341             // just dispatch rest of the messages
00342         default:
00343             DispatchMessage(&msg);
00344             break;
00345         }
00346     }
00347
00348     CancelLoop();
00349     return FALSE;
00350 }
00351
00352 void CCJDockContext::EndDragDockBar()
00353 {
00354     CancelLoop();
00355     //Yiannhs: reduce some more flickering, and unexpected behaviour in floating bars
00356     //         ok did the expected.
00357     if( m_ptLast == m_ptOrig )
00358         return;
00359
00360     if (m_dwOverDockStyle != 0)
00361     {
00362         CCJSizeDockBar* pDockBar = GetDockBar(m_dwOverDockStyle);
00363         if( pDockBar == NULL ) // John Armstrong
00364             return;
00365
00366         CRect rect = (m_dwOverDockStyle & CBRS_ORIENT_VERT) ?
00367             m_rectDragVert : m_rectDragHorz;
00368
00369         UINT uID = _AfxGetDlgCtrlID(pDockBar->m_hWnd);
00370         m_uMRUDockID = uID;
00371         m_rectMRUDockPos = rect;
00372         pDockBar->ScreenToClient(&m_rectMRUDockPos);
00373         DockSizeBar(m_pBar, pDockBar, &rect);
00374
00375         //yiannhs. after testing the posibilities I think this is the best way
00376         m_pDockSite->RecalcLayout( FALSE );
00377     }
00378
00379     else if ((m_dwStyle & CBRS_SIZE_DYNAMIC) || (HORZF(m_dwStyle) && !m_bFlip) ||
00380         (VERTF(m_dwStyle) && m_bFlip))
00381     {
00382         m_dwMRUFloatStyle = CBRS_ALIGN_TOP | (m_dwDockStyle & CBRS_FLOAT_MULTI);
00383         m_ptMRUFloatPos = m_rectFrameDragHorz.TopLeft();
00384         m_pDockSite->FloatControlBar(m_pBar, m_ptMRUFloatPos, m_dwMRUFloatStyle);
00385
00386         //yiannhs. after testing the posibilities I think this is the best way
00387         m_pDockSite->RecalcLayout( FALSE );
00388     }
00389
00390     else
00391     {
00392         m_dwMRUFloatStyle = CBRS_ALIGN_LEFT | (m_dwDockStyle & CBRS_FLOAT_MULTI);
00393         m_ptMRUFloatPos = m_rectFrameDragVert.TopLeft();
00394         m_pDockSite->FloatControlBar(m_pBar, m_ptMRUFloatPos, m_dwMRUFloatStyle);
00395
00396         //yiannhs. after testing the posibilities I think this is the best way
00397         m_pDockSite->RecalcLayout( FALSE );
00398     }
00399 }
00400
00401 CCJSizeDockBar* CCJDockContext::GetDockBar(DWORD dwOverDockStyle)
00402 {
00403     DWORD dw = 0;
00404     CDockBar* pBar;
00405     if (HORZF(dwOverDockStyle))
00406     {
00407         ASSERT_KINDOF(CFrameWnd, m_pDockSite);
00408         dw = CanDockDockBar(m_rectDragHorz,
00409             dwOverDockStyle & ~CBRS_ORIENT_VERT, &pBar);
00410         ASSERT(dw != 0);
00411         ASSERT(pBar != NULL);
00412         return (CCJSizeDockBar*)pBar;
00413     }
00414
00415     if (VERTF(dwOverDockStyle))
00416     {
00417         dw = CanDockDockBar(m_rectDragVert,
00418             dwOverDockStyle & ~CBRS_ORIENT_HORZ, &pBar);
00419         ASSERT(dw != 0);
00420         ASSERT(pBar != NULL);
00421         return (CCJSizeDockBar*)pBar;
00422     }
00423
00424     return NULL;
00425 }
00426
00427 void CCJDockContext::MoveDockBar(CPoint pt)
00428 {
00429     CPoint ptOffset = pt - m_ptLast;
00430
00431     m_rectDragHorz.OffsetRect(ptOffset);
00432     m_rectFrameDragHorz.OffsetRect(ptOffset);
00433     m_rectDragVert.OffsetRect(ptOffset);
00434     m_rectFrameDragVert.OffsetRect(ptOffset);
00435     m_ptLast = pt;
00436     m_dwOverDockStyle = m_bForceFrame ? 0 : CanDockDockBar();
00437     DrawFocusRect();
00438 }
00439
00440 void CCJDockContext::DockSizeBar(CControlBar * pBar,CCJSizeDockBar *pDockBar, LPRECT lpRect)
00441 {
00442     CFrameWnd *pFrame = (CFrameWnd*)m_pDockSite;
00443     ASSERT_VALID(pFrame);
00444
00445     ASSERT(pBar != NULL);
00446     ASSERT(pBar->m_pDockContext != NULL);
00447
00448     if( pDockBar == NULL )
00449     {
00450         for (int i = 0; i < 4; i++)
00451         {
00452             if ((dwSizeBarMap[i][1] & CBRS_ALIGN_ANY) ==
00453                 (pBar->m_dwStyle & CBRS_ALIGN_ANY))
00454             {
00455                 pDockBar = (CCJSizeDockBar*)pFrame->GetControlBar(dwSizeBarMap[i][0]);
00456                 ASSERT(pDockBar != NULL);
00457                 break;
00458             }
00459         }
00460     }
00461
00462     ASSERT(pDockBar != NULL);
00463     ASSERT(pFrame->m_listControlBars.Find(pBar) != NULL);
00464     ASSERT(pBar->m_pDockSite == pFrame);
00465     ((CCJControlBar*)pBar)->Normalize();
00466     pDockBar->DockControlBar(pBar, lpRect);
00467 }
00468
00469 void CCJDockContext::ToggleDocking()
00470 {
00471     if (m_pBar->IsKindOf(RUNTIME_CLASS(CCJControlBar)))
00472     {
00473         if (m_pBar->IsFloating())
00474         {
00475             // Dock it only if is allowed to be docked
00476             if (m_pBar->m_dwDockStyle & CBRS_ALIGN_ANY)
00477             {
00478                 ASSERT((m_uMRUDockID >= AFX_IDW_DOCKBAR_TOP && m_uMRUDockID <= AFX_IDW_SIZEBAR_BOTTOM) ||
00479                     m_uMRUDockID == 0);
00480
00481                 CRect rect = m_rectMRUDockPos;
00482                 CCJSizeDockBar* pDockBar = NULL;
00483                 if (m_uMRUDockID != 0)
00484                 {
00485                     pDockBar = (CCJSizeDockBar*)m_pDockSite->GetControlBar(m_uMRUDockID);
00486                     pDockBar->ClientToScreen(&rect);
00487                 }
00488
00489                 // dock it at the specified position, RecalcLayout will snap
00490                 DockSizeBar(m_pBar, pDockBar, &rect);
00491                 m_pDockSite->RecalcLayout();
00492             }
00493         }
00494         else
00495         {
00496             CPoint ptFloat = m_ptMRUFloatPos;
00497             if (ptFloat.x < 0 || ptFloat.y < 0)
00498             {
00499                 ptFloat = m_rectMRUDockPos.TopLeft();
00500                 m_pBar->GetParent()->ClientToScreen(&ptFloat);
00501             }
00502             m_pDockSite->FloatControlBar(m_pBar, ptFloat, m_dwMRUFloatStyle);
00503         }
00504     }
00505 }
00506
00508 // CDockContext Resize Operations
00509
00510 #define m_rectRequestedSize     m_rectDragHorz
00511 #define m_rectActualSize        m_rectDragVert
00512 #define m_rectActualFrameSize   m_rectFrameDragHorz
00513 #define m_rectFrameBorders      m_rectFrameDragVert
00514
00515 void CCJDockContext::StartResize(int nHitTest, CPoint pt)
00516 {
00517     ASSERT_VALID(m_pBar);
00518     ASSERT(m_pBar->m_dwStyle & CBRS_SIZE_DYNAMIC);
00519     m_bDragging = FALSE;
00520
00521     InitLoop();
00522
00523     // GetWindowRect returns screen coordinates(not mirrored)
00524     // So if the desktop is mirrored then turn off mirroring
00525     // for the desktop dc so that we draw correct focus rect
00526 #ifndef _VC_VERSION_5
00527
00529 #ifndef LAYOUT_LTR
00530 #define LAYOUT_LTR 0x00000000
00531 #endif
00532
00533     if (m_pDC->GetLayout() & LAYOUT_RTL)
00534         m_pDC->SetLayout(LAYOUT_LTR);
00535 #endif // _VC_VERSION_5
00536
00537     // get true bar size (including borders)
00538     CRect rect;
00539     m_pBar->GetWindowRect(rect);
00540     m_ptLast = pt;
00541     m_nHitTest = nHitTest;
00542
00543     CSize size = m_pBar->CalcDynamicLayout(0, LM_HORZ | LM_MRUWIDTH);
00544     m_rectRequestedSize = CRect(rect.TopLeft(), size);
00545     m_rectActualSize = CRect(rect.TopLeft(), size);
00546     m_rectActualFrameSize = CRect(rect.TopLeft(), size);
00547
00548     // calculate frame rectangle
00549     CMiniFrameWnd::CalcBorders(&m_rectActualFrameSize);
00550     m_rectActualFrameSize.InflateRect(-afxData.cxBorder2, -afxData.cyBorder2);
00551
00552     m_rectFrameBorders = CRect(CPoint(0,0),
00553         m_rectActualFrameSize.Size() - m_rectActualSize.Size());
00554
00555     // initialize tracking state and enter tracking loop
00556     m_dwOverDockStyle = 0;
00557     Stretch(pt);   // call it here to handle special keys
00558     TrackDockBar();
00559 }
00560
00561 void CCJDockContext::Stretch(CPoint pt)
00562 {
00563     CPoint ptOffset = pt - m_ptLast;
00564     CSize size;
00565
00566     // offset all drag rects to new position
00567     if (m_nHitTest != HTTOP && m_nHitTest != HTBOTTOM)
00568     {
00569         if (m_nHitTest == HTLEFT || m_nHitTest == HTTOPLEFT || m_nHitTest == HTBOTTOMLEFT)
00570             m_rectRequestedSize.left += ptOffset.x;
00571         else
00572             m_rectRequestedSize.right += ptOffset.x;
00573         size = m_pBar->CalcDynamicLayout(m_rectRequestedSize.Width(), LM_HORZ);
00574     }
00575
00576     if (m_nHitTest != HTLEFT && m_nHitTest != HTRIGHT)
00577     {
00578         if (m_nHitTest == HTTOP || m_nHitTest == HTTOPLEFT || m_nHitTest == HTTOPRIGHT)
00579             m_rectRequestedSize.top += ptOffset.y;
00580         else
00581             m_rectRequestedSize.bottom += ptOffset.y;
00582         size = m_pBar->CalcDynamicLayout(m_rectRequestedSize.Height(), LM_HORZ|LM_LENGTHY);
00583     }
00584
00585     CRect rectDesk;
00586     HWND hWndDesk = ::GetDesktopWindow();
00587     ::GetWindowRect(hWndDesk, &rectDesk);
00588     CRect rectTemp = m_rectActualFrameSize;
00589
00590     // left, top, top left
00591     if (m_nHitTest == HTLEFT || m_nHitTest == HTTOP || m_nHitTest == HTTOPLEFT)
00592     {
00593         rectTemp.left = rectTemp.right -
00594             (size.cx + m_rectFrameBorders.Width());
00595         rectTemp.top = rectTemp.bottom -
00596             (size.cy + m_rectFrameBorders.Height());
00597         CRect rect;
00598         if (rect.IntersectRect(rectDesk, rectTemp))
00599         {
00600             m_rectActualSize.left = m_rectActualSize.right - size.cx;
00601             m_rectActualSize.top = m_rectActualSize.bottom - size.cy;
00602             m_rectActualFrameSize.left = rectTemp.left;
00603             m_rectActualFrameSize.top = rectTemp.top;
00604         }
00605     } else if (m_nHitTest == HTTOPRIGHT) // top right
00606     {
00607         rectTemp.top = rectTemp.bottom -
00608             (size.cy + m_rectFrameBorders.Height());
00609         rectTemp.right = rectTemp.left +
00610             (size.cx + m_rectFrameBorders.Width());
00611         CRect rect;
00612         if (rect.IntersectRect(rectDesk, rectTemp))
00613         {
00614             m_rectActualSize.left = m_rectActualSize.right - size.cx;
00615             m_rectActualSize.bottom = m_rectActualSize.top + size.cy;
00616             m_rectActualFrameSize.right = rectTemp.right;
00617             m_rectActualFrameSize.top = rectTemp.top;
00618         }
00619     } else if (m_nHitTest == HTBOTTOMLEFT) // bottom left
00620     {
00621         rectTemp.bottom = rectTemp.top +
00622             (size.cy + m_rectFrameBorders.Height());
00623         rectTemp.left = rectTemp.right -
00624             (size.cx + m_rectFrameBorders.Width());
00625         CRect rect;
00626         if (rect.IntersectRect(rectDesk, rectTemp))
00627         {
00628             m_rectActualSize.right = m_rectActualSize.left + size.cx;
00629             m_rectActualSize.top = m_rectActualSize.bottom - size.cy;
00630             m_rectActualFrameSize.left = rectTemp.left;
00631             m_rectActualFrameSize.bottom = rectTemp.bottom;
00632         }
00633     } else// bottom, right, bottom right
00634     {
00635         rectTemp.right = rectTemp.left +
00636             (size.cx + m_rectFrameBorders.Width());
00637         rectTemp.bottom = rectTemp.top +
00638             (size.cy + m_rectFrameBorders.Height());
00639         CRect rect;
00640         if (rect.IntersectRect(rectDesk, rectTemp))
00641         {
00642             m_rectActualSize.right = m_rectActualSize.left + size.cx;
00643             m_rectActualSize.bottom = m_rectActualSize.top + size.cy;
00644             m_rectActualFrameSize.right = rectTemp.right;
00645             m_rectActualFrameSize.bottom = rectTemp.bottom;
00646         }
00647     }
00648     m_ptLast = pt;
00649
00650     // update feedback
00651     DrawFocusRect();
00652 }
Generated on Sun Feb 24 01:21:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJExplorerBar.cpp Source File

WinCvs/CJLib/CJLibrary/CJExplorerBar.cpp

Go to the documentation of this file.
00001 // CJExplorerBar.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/CJLibrary/CJExplorerBar.cpp $
00011  *
00012  * $History: CJExplorerBar.cpp $
00013  *
00014  * *****************  Version 12  *****************
00015  * User: Kirk Stowell Date: 10/25/99   Time: 10:52p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Modified resource include for static builds.
00018  *
00019  * *****************  Version 11  *****************
00020  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00021  * Updated in $/CodeJock/CJLibrary
00022  * Fixed potential resource and memory leak problems.
00023  *
00024  * *****************  Version 10  *****************
00025  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00026  * Updated in $/CodeJockey/CJLibrary
00027  * Updated copyright and contact information.
00028  *
00029  * *****************  Version 9  *****************
00030  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00031  * Updated in $/CodeJockey/CJLibrary
00032  * Added Unicode compliance, thanks to Barry Burton for his help with
00033  * this.
00034  *
00035  *
00036  * *****************  Version 8  *****************
00037  * User: Kirk Stowell Date: 6/23/99    Time: 7:24a
00038  * Updated in $/CodeJockey/CJLibrary
00039  *
00040  * *****************  Version 7  *****************
00041  * User: Kirk Stowell Date: 6/23/99    Time: 2:07a
00042  * Updated in $/CodeJockey/CJLibrary
00043  *
00044  * *****************  Version 6  *****************
00045  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00046  * Updated in $/CodeJockey/CJLibrary
00047  *
00048  * *****************  Version 5  *****************
00049  * User: Kirk Stowell Date: 7/18/99    Time: 10:26p
00050  * Updated in $/CodeJockey/CJLibrary
00051  * Cleaned up caption creation.
00052  *
00053  * *****************  Version 4  *****************
00054  * User: Kirk Stowell Date: 6/09/99    Time: 8:33p
00055  * Updated in $/CodeJockey/CJ60Lib
00056  * Ioannhs Stamatopoulos (Yiannhs) [ystamat@mail.datamedia.gr] - Extended
00057  * docking windows, removed ::GetSysColor(...) calls and WM_SYSCOLORCHANGE
00058  * message handler, this is now automatically handled by the base class.
00059  * Added redraw flags to the create method and modified paint and layout
00060  * handlers to reduce flicker and un-necessary command handling. Dragging
00061  * rect now reflects actual control bar docked size. Added "flat" look to
00062  * the control bars, the control bars can now use the classic DevStudio
00063  * look, or use flat gradient gripper, borders and frame buttons. Overall,
00064  * docking windows now handle dragging, docking and floating much better,
00065  * and behave more like DevStudio.
00066  *
00067  * *****************  Version 3  *****************
00068  * User: Kirk Stowell Date: 4/03/99    Time: 4:23p
00069  * Updated in $/CodeJockey/CJ60Lib
00070  * Added comments and cleaned up code.
00071  *
00072  * *****************  Version 2  *****************
00073  * User: Kirk Stowell Date: 1/31/99    Time: 4:23p
00074  * Updated in $/CodeJockey/CJ60Lib
00075  * Made some cosmetic enhancements to more closely match the windows
00076  * explorer bar.
00077  *
00078  * *****************  Version 1  *****************
00079  * User: Kirk Stowell Date: 1/16/99    Time: 4:22p
00080  * Created in $/CodeJockey/CJ60Lib
00081  * Initial release
00082  *
00083  ***************************************************************************/
00085
00086 #include "stdafx.h"
00087 #include "CJResource.h"
00088 #include "CJExplorerBar.h"
00089
00090 #ifdef _DEBUG
00091 #define new DEBUG_NEW
00092 #undef THIS_FILE
00093 static char THIS_FILE[] = __FILE__;
00094 #endif
00095
00097 // CCJExplorerBar
00098
00099 CCJExplorerBar::CCJExplorerBar()
00100 {
00101     m_hIcon = NULL;
00102     m_strCaption = _T("");
00103 }
00104
00105 CCJExplorerBar::~CCJExplorerBar()
00106 {
00107     // fix potential resource leak - KStowell - 10-22-99.
00108     _destroyIcon(m_hIcon);
00109 }
00110
00111 IMPLEMENT_DYNAMIC(CCJExplorerBar, CCJControlBar)
00112
00113 BEGIN_MESSAGE_MAP(CCJExplorerBar, CCJControlBar)
00114     //{{AFX_MSG_MAP(CCJExplorerBar)
00115     ON_WM_CREATE()
00116     ON_COMMAND(IDC_BAR_BUTTON, OnButtonClose)
00117     ON_UPDATE_COMMAND_UI(IDC_BAR_BUTTON, OnUpdateButtonClose)
00118     ON_WM_WINDOWPOSCHANGED()
00119     ON_WM_ERASEBKGND()
00120     ON_WM_LBUTTONDOWN()
00121     ON_WM_LBUTTONUP()
00122     //}}AFX_MSG_MAP
00123 END_MESSAGE_MAP()
00124
00126 // CCJExplorerBar message handlers
00127
00128 BOOL CCJExplorerBar::Create(CWnd *pParentWnd, UINT nID, LPCTSTR lpszWindowName, CSize sizeDefault, DWORD dwStyle)
00129 {
00130     m_strCaption = lpszWindowName;
00131
00132     if(!CCJControlBar::Create(pParentWnd, nID, lpszWindowName, sizeDefault, dwStyle)) {
00133         return FALSE;
00134     }
00135
00136     ShowFrameControls(FALSE, FALSE);
00137     return TRUE;
00138 }
00139
00140 int CCJExplorerBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
00141 {
00142     if (CCJControlBar::OnCreate(lpCreateStruct) == -1)
00143         return -1;
00144
00145     // Create the caption.
00146     if (!m_Caption.Create(this, m_strCaption))
00147     {
00148         TRACE0( "Unable to create caption.\n" );
00149         return -1;
00150     }
00151
00152     // Create the caption button.
00153     if (!m_CaptionButton.Create(NULL, WS_VISIBLE|BS_ICON|BS_OWNERDRAW|BS_CENTER|BS_VCENTER,
00154         CRect(0,0,0,0), this, IDC_BAR_BUTTON))
00155     {
00156         TRACE0( "Unable to create caption button.\n" );
00157         return -1;
00158     }
00159
00160     // Create the image list used by frame buttons.
00161     CImageList imageList;
00162     imageList.Create(IDB_PUSHPIN, 16, 1, RGB(255,0,255));
00163     m_hIcon = imageList.ExtractIcon(2);
00164
00165     // Associate the button icon
00166     m_CaptionButton.SetIcon(m_hIcon, CSize(16,15));
00167     imageList.DeleteImageList();
00168
00169     return 0;
00170 }
00171
00172 void CCJExplorerBar::OnButtonClose()
00173 {
00174     GetDockingFrame()->ShowControlBar(this, FALSE, FALSE);
00175 }
00176
00177 void CCJExplorerBar::OnUpdateButtonClose(CCmdUI* pCmdUI)
00178 {
00179     pCmdUI->Enable(TRUE);
00180 }
00181
00182 void CCJExplorerBar::GetChildRect(CRect &rect)
00183 {
00184     GetClientRect(&rect);
00185
00186     if (!IsFloating())
00187     {
00188         rect.left   += 1;
00189         rect.right  -= 1;
00190         rect.top    += (IsVertDocked()?26:22);
00191     }
00192
00193     else
00194         rect.DeflateRect(2,2);
00195 }
00196
00197 void CCJExplorerBar::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos)
00198 {
00199     CControlBar::OnWindowPosChanged(lpwndpos);
00200
00201     int nCmdShow = IsFloating() ? SW_HIDE:SW_SHOW;
00202     m_Caption.ShowWindow(nCmdShow);
00203     m_CaptionButton.ShowWindow(nCmdShow);
00204
00205     if (!IsFloating())
00206     {
00207         if (IsVertDocked())
00208         {
00209             m_Caption.MoveWindow(1,4,lpwndpos->cx-1,22);
00210             m_CaptionButton.MoveWindow(CRect(lpwndpos->cx-25,
00211                 7, lpwndpos->cx-5, 24));
00212         }
00213         else
00214         {
00215             m_Caption.MoveWindow(1,0,lpwndpos->cx-1,22);
00216             m_CaptionButton.MoveWindow(CRect(lpwndpos->cx-25,
00217                 3, lpwndpos->cx-5, 20));
00218         }
00219     }
00220
00221     if (m_pChildWnd->GetSafeHwnd())
00222     {
00223         CRect rc;
00224         GetChildRect(rc);
00225         m_pChildWnd->MoveWindow(rc);
00226     }
00227 }
00228
00229 BOOL CCJExplorerBar::OnEraseBkgnd(CDC* pDC)
00230 {
00231     int result = CControlBar::OnEraseBkgnd(pDC);
00232
00233     CRect rect;
00234     GetClientRect(rect);
00235     rect.top+=(IsVertDocked()?3:-1);
00236     rect.bottom += 1;
00237     //Yiannhs This was a side effect of removing the variables
00238     pDC->Draw3dRect(rect, afxData.clrBtnShadow, afxData.clrBtnShadow);
00239     //pDC->Draw3dRect(rect, m_clrBtnShadow, m_clrBtnShadow);
00240     return result;
00241 }
00242
00243 void CCJExplorerBar::OnLButtonDown(UINT /*nFlags*/, CPoint /*point*/)
00244 {
00245     // bypass CCJControlBar.
00246 }
00247
00248 void CCJExplorerBar::OnLButtonUp(UINT /*nFlags*/, CPoint /*point*/)
00249 {
00250     // bypass CCJControlBar.
00251 }
Generated on Sun Feb 24 01:21:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJFlatButton.cpp Source File

WinCvs/CJLib/CJLibrary/CJFlatButton.cpp

Go to the documentation of this file.
00001 // CJFlatButton.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 2000/02/29 22:28:40 $
00009  * $Revision: 1.2 $
00010  * $Archive: /CodeJock/CJLibrary/CJFlatButton.cpp $
00011  *
00012  * $History: CJFlatButton.cpp $
00013  *
00014  * *****************  Version 19  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:00p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Further Updates to OnEraseBkgnd(...) and OnPaint() for flicker free
00018  * drawing.
00019  *
00020  * *****************  Version 18  *****************
00021  * User: Kirk Stowell Date: 10/30/99   Time: 1:47p
00022  * Updated in $/CodeJock/CJLibrary
00023  * Overrode OnEraseBkgnd(...) and made modifications to DrawItem(...) to
00024  * handle flicker free drawing.
00025  *
00026  * *****************  Version 17  *****************
00027  * User: Kirk Stowell Date: 10/25/99   Time: 10:52p
00028  * Updated in $/CodeJock/CJLibrary
00029  * Modified resource include for static builds.
00030  *
00031  * *****************  Version 16  *****************
00032  * User: Kirk Stowell Date: 10/24/99   Time: 4:28p
00033  * Updated in $/CodeJock/CJLibrary
00034  * Added method SetAlternateColors(...) which will allow the user to
00035  * define the "face", "hilight" and "shadow" colors used by the control
00036  * rather than used the system defaults. Thanks to Ronen Magid
00037  * [ronenm@simplement.co.il] for his suggestions.
00038  *
00039  * *****************  Version 15  *****************
00040  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00041  * Updated in $/CodeJock/CJLibrary
00042  * Fixed potential resource and memory leak problems.
00043  *
00044  * *****************  Version 14  *****************
00045  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00046  * Updated in $/CodeJockey/CJLibrary
00047  * Updated copyright and contact information.
00048  *
00049  * *****************  Version 13  *****************
00050  * User: Kirk Stowell Date: 8/29/99    Time: 9:46p
00051  * Updated in $/CodeJockey/CJLibrary
00052  * Fixed bug when the button is pressed 2 times very quickly, the button
00053  * is only pressed once - Stephan Neumann <neumann@dialogs.de>
00054  *
00055  * *****************  Version 12  *****************
00056  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00057  * Updated in $/CodeJockey/CJLibrary
00058  * Added Unicode compliance, thanks to Barry Burton for his help with
00059  * this.
00060  *
00061  *
00062  * *****************  Version 11  *****************
00063  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00064  * Updated in $/CodeJockey/CJLibrary
00065  *
00066  * *****************  Version 10  *****************
00067  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00068  * Updated in $/CodeJockey/CJLibrary
00069  *
00070  * *****************  Version 9  *****************
00071  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00072  * Updated in $/CodeJockey/CJLibrary
00073  *
00074  * *****************  Version 8  *****************
00075  * User: Kirk Stowell Date: 7/25/99    Time: 12:15a
00076  * Updated in $/CodeJockey/CJLibrary
00077  *
00078  * *****************  Version 7  *****************
00079  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00080  * Updated in $/CodeJockey/CJLibrary
00081  *
00082  * *****************  Version 6  *****************
00083  * User: Kirk Stowell Date: 7/18/99    Time: 10:27p
00084  * Updated in $/CodeJockey/CJLibrary
00085  * Cleaned up icon drawing function.
00086  *
00087  * *****************  Version 5  *****************
00088  * User: Kirk Stowell Date: 7/14/99    Time: 9:58p
00089  * Updated in $/CodeJockey/CJLibrary
00090  * Re-wrote class to handle icons, text and bitmaps and added additional
00091  * functionality which was needed by the CCJCaption class.
00092  *
00093  * *****************  Version 4  *****************
00094  * User: Kirk Stowell Date: 4/03/99    Time: 4:23p
00095  * Updated in $/CodeJockey/CJ60Lib
00096  * Added comments and cleaned up code.
00097  *
00098  * *****************  Version 3  *****************
00099  * User: Kirk Stowell Date: 3/13/99    Time: 4:24p
00100  * Updated in $/CodeJockey/CJ60Lib
00101  * Patrick Bergeron [patb@softimage.com] fixed the following bugs:
00102  *
00103  * Moving the cursor over the flat button doesn't raise the button right
00104  * away. We have to wait for the first timer message to arrive, which is a
00105  * bit annoying. It gives the impression that the system isn't very
00106  * responsive. So in the OnMouseMove method, we call OnTimer(1) to force
00107  * the initial update of the button.
00108  *
00109  * Sometimes, a CJFlatButton would stay in a raised state when moving the
00110  * mouse quickly over the client area of a few CJFlatButtons. The reason
00111  * turned out to be the use of a static (ahem, global) variable
00112  * "bPainted". The simple fix for this was to put bPainted as a member
00113  * variable ("m_bPainted") and use this member variable instead.
00114  *
00115  * Flat buttons are now much more responsive and behave correctly in all
00116  * cases.
00117  *
00118  * *****************  Version 2  *****************
00119  * User: Kirk Stowell Date: 10/17/98   Time: 4:24p
00120  * Updated in $/CodeJockey/CJ60Lib
00121  * Code clean up and re-organization, renamed CCJButton to CCJFlatButton.
00122  *
00123  * *****************  Version 1  *****************
00124  * User: Kirk Stowell Date: 10/17/98   Time: 4:23p
00125  * Created in $/CodeJockey/CJ60Lib
00126  * Initial re-write and release.
00127  *
00128  ***************************************************************************/
00130
00131 #include "stdafx.h"
00132 #include "CJFlatButton.h"
00133 #include "CJResource.h"
00134
00135 #ifdef _DEBUG
00136 #define new DEBUG_NEW
00137 #undef THIS_FILE
00138 static char THIS_FILE[] = __FILE__;
00139 #endif
00140
00142 // CCJFlatButton
00143
00144 IMPLEMENT_DYNAMIC(CCJFlatButton, CButton)
00145
00146 CCJFlatButton::CCJFlatButton()
00147 {
00148     m_pFont     = NULL;
00149     m_hPushed   = NULL;
00150     m_bLBtnDown = FALSE;
00151     m_bFlatLook = TRUE;
00152     m_bPainted  = FALSE;
00153     m_bAltColor = FALSE;
00154
00155     m_clrHilite = ::GetSysColor(COLOR_BTNHIGHLIGHT);
00156     m_clrShadow = ::GetSysColor(COLOR_BTNSHADOW);
00157     m_clrDkShad = ::GetSysColor(COLOR_3DDKSHADOW);
00158     m_clrNormal = ::GetSysColor(COLOR_BTNFACE);
00159     m_clrTextGy = ::GetSysColor(COLOR_GRAYTEXT);
00160     m_clrTextNm = ::GetSysColor(COLOR_BTNTEXT);
00161
00162     m_hCursor   = AfxGetApp()->LoadCursor( IDC_HANDCUR );
00163     UpdateFont();
00164 }
00165
00166 CCJFlatButton::~CCJFlatButton()
00167 {
00168     // fix potential resource leak - KStowell - 10-21-99
00169     m_Font.DeleteObject();
00170 }
00171
00172
00173 BEGIN_MESSAGE_MAP(CCJFlatButton, CButton)
00174     //{{AFX_MSG_MAP(CCJFlatButton)
00175     ON_WM_MOUSEMOVE()
00176     ON_WM_LBUTTONDOWN()
00177     ON_WM_LBUTTONUP()
00178     ON_WM_TIMER()
00179     ON_WM_SYSCOLORCHANGE()
00180     ON_WM_SETCURSOR()
00181     ON_WM_LBUTTONDBLCLK()
00182     ON_WM_ERASEBKGND()
00183     ON_WM_PAINT()
00184     //}}AFX_MSG_MAP
00185 END_MESSAGE_MAP()
00186
00188 // CCJFlatButton message handlers
00189
00190 void CCJFlatButton::OnMouseMove(UINT nFlags, CPoint point)
00191 {
00192     if (m_bFlatLook)
00193     {
00194         SetTimer(1, 10, NULL);
00195         OnTimer(1);
00196     }
00197
00198     CButton::OnMouseMove(nFlags, point);
00199 }
00200
00201 void CCJFlatButton::OnLButtonDown(UINT nFlags, CPoint point)
00202 {
00203     m_bLBtnDown = TRUE;
00204     CButton::OnLButtonDown(nFlags, point);
00205 }
00206
00207 void CCJFlatButton::OnLButtonUp(UINT nFlags, CPoint point)
00208 {
00209     m_bLBtnDown = FALSE;
00210     CButton::OnLButtonUp(nFlags, point);
00211 }
00212
00213 void CCJFlatButton::OnTimer(UINT nIDEvent)
00214 {
00215     CRect rcItem;
00216     GetWindowRect(rcItem);
00217
00218     CPoint ptCursor;
00219     GetCursorPos(&ptCursor);
00220
00221     if(( m_bLBtnDown == TRUE ) || ( !rcItem.PtInRect( ptCursor )))
00222     {
00223         KillTimer(1);
00224
00225         if (m_bPainted == TRUE) {
00226             InvalidateRect (NULL);
00227         }
00228
00229         m_bPainted = FALSE;
00230         return;
00231     }
00232
00233     // On mouse over, show raised button.
00234     else if(( m_bFlatLook ) && ( !m_bPainted )) {
00235         CDC* pDC = GetDC();
00236         GetClientRect(rcItem);
00237         pDC->Draw3dRect( rcItem, m_clrHilite, m_clrShadow );
00238         m_bPainted = TRUE;
00239         ReleaseDC(pDC);
00240     }
00241
00242     CButton::OnTimer(nIDEvent);
00243 }
00244
00245 void CCJFlatButton::OnSysColorChange()
00246 {
00247     CButton::OnSysColorChange();
00248
00249     m_clrDkShad = ::GetSysColor(COLOR_3DDKSHADOW);
00250     m_clrTextGy = ::GetSysColor(COLOR_GRAYTEXT);
00251     m_clrTextNm = (m_bAltColor ? m_clrAltTextNm : ::GetSysColor(COLOR_BTNTEXT));
00252     m_clrNormal = (m_bAltColor ? m_clrAltNormal : ::GetSysColor(COLOR_BTNFACE));
00253     m_clrHilite = (m_bAltColor ? m_clrAltHilite : ::GetSysColor(COLOR_BTNHIGHLIGHT));
00254     m_clrShadow = (m_bAltColor ? m_clrAltShadow : ::GetSysColor(COLOR_BTNSHADOW));
00255 }
00256
00257 void CCJFlatButton::SetAlternateColors(COLORREF clrAltNormal, COLORREF clrAltHilite, COLORREF clrAltShadow, COLORREF clrAltTextNm)
00258 {
00259     m_clrNormal = m_clrAltNormal = clrAltNormal;
00260     m_clrHilite = m_clrAltHilite = clrAltHilite;
00261     m_clrShadow = m_clrAltShadow = clrAltShadow;
00262     m_clrTextNm = m_clrAltTextNm = clrAltTextNm;
00263     m_bAltColor = TRUE;
00264 }
00265
00266 void CCJFlatButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
00267 {
00268     ASSERT(lpDrawItemStruct != NULL);
00269
00270     // define some temporary variables.
00271     CDC*  pDC    = CDC::FromHandle( lpDrawItemStruct->hDC );
00272     CRect rcItem = lpDrawItemStruct->rcItem;
00273     int   nState = lpDrawItemStruct->itemState;
00274
00275     // Paint the background.
00276     pDC->FillSolidRect( rcItem, m_clrNormal );
00277
00278     // Draw flat button border.
00279     if( m_bFlatLook ) {
00280         pDC->Draw3dRect( rcItem, (nState & ODS_SELECTED)?m_clrShadow:m_clrNormal,
00281             (nState & ODS_SELECTED)?m_clrHilite:m_clrNormal );
00282     }
00283
00284     // Draw normal border.
00285     else {
00286         pDC->Draw3dRect( rcItem, (nState & ODS_SELECTED)?m_clrDkShad:m_clrHilite,
00287             (nState & ODS_SELECTED)?m_clrHilite:m_clrDkShad);
00288         rcItem.DeflateRect(1,1);
00289         pDC->Draw3dRect( rcItem, (nState & ODS_SELECTED)?m_clrShadow:m_clrNormal,
00290             (nState & ODS_SELECTED)?m_clrNormal:m_clrShadow);
00291     }
00292
00293     // Set the background mode to transparent.
00294     pDC->SetBkMode( TRANSPARENT );
00295
00296     // draw the button text, icon or bitmap.
00297     DrawButtonText(pDC, nState, rcItem);
00298     DrawButtonIcon(pDC, nState, rcItem);
00299     DrawButtonBitmap(pDC, nState, rcItem);
00300 }
00301
00302 void CCJFlatButton::DrawButtonText(CDC* pDC, UINT nState, CRect& rcItem)
00303 {
00304     // Get the window text, return if empty.
00305     CString strWindowText; GetWindowText(strWindowText);
00306     if( strWindowText.IsEmpty( ))
00307         return;
00308
00309     if( m_pFont == NULL ) {
00310         m_pFont = &m_Font;
00311     }
00312
00313     CRect rc = rcItem;
00314     rc.DeflateRect( 2,0 );
00315
00316     // Set the text color and select the button font.
00317     pDC->SetTextColor(( nState & ODS_DISABLED )?m_clrTextGy:m_clrTextNm);
00318     CFont *oldFont = pDC->SelectObject( m_pFont );
00319
00320     // if the button is selected.
00321     if( nState & ODS_SELECTED ) {
00322         rc.OffsetRect(1,1);
00323     }
00324
00325     // draw the text, and select the original font.
00326     pDC->DrawText( strWindowText, -1, rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE );
00327     pDC->SelectObject( oldFont );
00328 }
00329
00330 void CCJFlatButton::DrawButtonIcon(CDC* pDC, UINT nState, CRect& rcItem)
00331 {
00332     UNUSED_ALWAYS( rcItem );
00333
00334     // get the handle to the icon (if any) associated
00335     // with this button.
00336     HICON hIcon = GetIcon();
00337     if( hIcon == NULL ) {
00338         return;
00339     }
00340
00341     CRect rcWnd;
00342     GetWindowRect(&rcWnd);
00343
00344     int left   = (rcWnd.Width()-m_sizeIcon.cx)/2;
00345     int right  = left+m_sizeIcon.cx;
00346     int top    = (rcWnd.Height()-m_sizeIcon.cy)/2;
00347     int bottom = top+m_sizeIcon.cy;
00348
00349     // determine the size of the icon to be drawn.
00350     CRect rc(left,top,right,bottom);
00351
00352     // if the button is selected.
00353     if( nState & ODS_SELECTED )
00354     {
00355         if( m_hPushed ) {
00356             hIcon = m_hPushed;
00357         }
00358         else {
00359             rc.OffsetRect(1,1);
00360         }
00361     }
00362
00363     // draw the icon associated with this button.
00364     pDC->DrawState( rc.TopLeft(), rc.Size(), hIcon,
00365         ( nState & ODS_DISABLED )?DSS_DISABLED:DSS_NORMAL, (HBRUSH)NULL );
00366 }
00367
00368 void CCJFlatButton::DrawButtonBitmap(CDC* pDC, UINT nState, CRect& rcItem)
00369 {
00370     // get the handle to the bitmap (if any) associated
00371     // with this button.
00372     HBITMAP hBitmap = GetBitmap();
00373     if( hBitmap == NULL ) {
00374         return;
00375     }
00376
00377     CRect rc = rcItem;
00378
00379     // if the button is selected.
00380     if( nState & ODS_SELECTED ) {
00381         rcItem.OffsetRect(1,1);
00382     }
00383
00384     // draw the bitmap associated with this button.
00385     pDC->DrawState( rc.TopLeft(), rc.Size(), hBitmap,
00386         ( nState & ODS_DISABLED )?DSS_DISABLED:DSS_NORMAL, (HBRUSH)NULL );
00387 }
00388
00389
00390 BOOL CCJFlatButton::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
00391 {
00392     UNUSED_ALWAYS( pWnd );
00393     UNUSED_ALWAYS( nHitTest );
00394     UNUSED_ALWAYS( message );
00395
00396     ::SetCursor( m_hCursor );
00397
00398     return TRUE;
00399 }
00400
00401 void CCJFlatButton::UpdateFont()
00402 {
00403     m_Font.DeleteObject();
00404     NONCLIENTMETRICS ncm;
00405     ncm.cbSize = sizeof(ncm);
00406     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00407     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00408 }
00409
00410 void CCJFlatButton::OnLButtonDblClk(UINT nFlags, CPoint point)
00411 {
00412     POINT pt;
00413
00414     ::GetCursorPos(&pt);
00415     ::MapWindowPoints(NULL,(HWND)(m_hWnd),&pt,1);
00416     ::SendMessage((HWND)(m_hWnd),WM_LBUTTONDOWN,0,MAKELPARAM(pt.x,pt.y));
00417
00418     CButton::OnLButtonDblClk(nFlags, point);
00419 }
00420
00421 BOOL CCJFlatButton::OnEraseBkgnd(CDC* pDC)
00422 {
00423     // KStowell - overridden for flicker-free drawing.
00424     UNUSED_ALWAYS(pDC);
00425     return TRUE;
00426 }
00427
00428 void CCJFlatButton::OnPaint()
00429 {
00430     CPaintDC dc(this); // device context for painting
00431
00432     // KStowell - Get the client rect.
00433     CRect rcClient, rcClip;
00434     dc.GetClipBox( &rcClip );
00435     GetClientRect( &rcClient );
00436
00437     // KStowell - Create a memory device-context. This is done to help reduce
00438     // screen flicker, since we will paint the entire control to the
00439     // off screen device context first.
00440     CDC memDC;
00441     CBitmap bitmap;
00442     memDC.CreateCompatibleDC(&dc);
00443     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00444     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00445
00446     // KStowell - Repaint the background.
00447     memDC.FillSolidRect(rcClient, m_clrNormal);
00448
00449     // let the control do its default drawing.
00450     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00451
00452     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00453     dc.BitBlt( rcClip.left, rcClip.top, rcClip.Width(), rcClip.Height(), &memDC,
00454         rcClip.left, rcClip.top, SRCCOPY );
00455
00456     // KStowell - Cleanup resources.
00457     memDC.SelectObject(pOldBitmap);
00458     memDC.DeleteDC();
00459     bitmap.DeleteObject();
00460 }
Generated on Sun Feb 24 01:21:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJFlatComboBox.cpp Source File

WinCvs/CJLib/CJLibrary/CJFlatComboBox.cpp

Go to the documentation of this file.
00001 // CJFlatComboBox.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/CJLibrary/CJFlatComboBox.cpp $
00011  *
00012  * $History: CJFlatComboBox.cpp $
00013  *
00014  * *****************  Version 15  *****************
00015  * User: Kirk Stowell Date: 10/30/99   Time: 6:01p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Overrode OnEraseBkgnd(...) and re-wrote OnPaint() to handle flicker
00018  * free drawing.
00019  *
00020  * *****************  Version 14  *****************
00021  * User: Kirk Stowell Date: 10/30/99   Time: 2:14p
00022  * Updated in $/CodeJock/CJLibrary
00023  * Added COLORREF members to class to eliminate continuous calls to
00024  * GetSysColor(...). Overrode OnSysColorChange() to re-initialize COLORREF
00025  * variables.
00026  *
00027  * *****************  Version 13  *****************
00028  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00029  * Updated in $/CodeJockey/CJLibrary
00030  * Updated copyright and contact information.
00031  *
00032  * *****************  Version 12  *****************
00033  * User: Kirk Stowell Date: 8/30/99    Time: 12:50a
00034  * Updated in $/CodeJockey/CJLibrary
00035  * Hiren Patel <hpatel@spss.com> - Added ReleaseDC(pDC) when window is
00036  * disabled.
00037  *
00038  * *****************  Version 11  *****************
00039  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00040  * Updated in $/CodeJockey/CJLibrary
00041  *
00042  * *****************  Version 10  *****************
00043  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00044  * Updated in $/CodeJockey/CJLibrary
00045  *
00046  * *****************  Version 9  *****************
00047  * User: Kirk Stowell Date: 5/17/99    Time: 9:24p
00048  * Updated in $/CodeJockey/CJ60Lib
00049  * Gilberto Botaro [seafox@techno.com.br] - Added code for auto
00050  * completion.
00051  *
00052  * *****************  Version 8  *****************
00053  * User: Kirk Stowell Date: 5/03/99    Time: 10:44p
00054  * Updated in $/CodeJockey/CJ60Lib
00055  * Fixed code ommisions.
00056  *
00057  * *****************  Version 7  *****************
00058  * User: Kirk Stowell Date: 5/03/99    Time: 8:42p
00059  * Updated in $/CodeJockey/CJ60Lib
00060  * Danilo Lax [Danilo_Lax@www2.alpeng.com] - The control is painted flat
00061  * when the mouse leaves the box, even if the control has the focus, now
00062  * checking for the focus in OnTimer(.
00063  *
00064  * Removed, unhandled msgs are processed by
00065  * CComboBox::PreTranslateMessage(pMsg). Used reflected msgs
00066  * BN_GETFOCUS/CBN_KILLFOCUS instead of WM_GETFOCUS/WM_KILLFOCUS.
00067  *
00068  * ::GetFocus() doesn't return CFlatComboBox::m_hWnd, even if the control
00069  * has the focus (don't know why, maybe ::GetFocus() only returns the
00070  * handle to the EditField part of the ComboBox), used flag m_bHasFocus
00071  * instead.
00072  *
00073  * *****************  Version 6  *****************
00074  * User: Kirk Stowell Date: 4/03/99    Time: 4:26p
00075  * Updated in $/CodeJockey/CJ60Lib
00076  * Added comments and cleaned up code.
00077  *
00078  * *****************  Version 5  *****************
00079  * User: Kirk Stowell Date: 1/22/99    Time: 4:26p
00080  * Updated in $/CodeJockey/CJ60Lib
00081  * Fixed accelerator problem reported by YOSH YAMASHITA
00082  * (yosh@muj.biglobe.ne.jp) with Matt Weagle's solution of overloading
00083  * PreTranslateMessage().
00084  *
00085  * *****************  Version 4  *****************
00086  * User: Kirk Stowell Date: 1/02/99    Time: 4:25p
00087  * Updated in $/CodeJockey/CJ60Lib
00088  * Renamed class from CJComboBox to CCJFlatComboBox, changed DRAWSTATE to
00089  * enum, removed method Offset(), and replaced with a direct call to
00090  * ::GetSystemMetrics().
00091  *
00092  * *****************  Version 3  *****************
00093  * User: Kirk Stowell Date: 11/02/98   Time: 4:24p
00094  * Updated in $/CodeJockey/CJ60Lib
00095  * Added OnSetFocus(), OnKillFocus() and modified OnPaint() so the control
00096  * remains beveled until it actually looses focus - (Vachik
00097  * Hovhannissian).
00098  *
00099  * *****************  Version 2  *****************
00100  * User: Kirk Stowell Date: 10/05/98   Time: 4:24p
00101  * Updated in $/CodeJockey/CJ60Lib
00102  * Fixed offset bug to use GetSystemMetrics(), instead of hard coded
00103  * values -
00104  * Todd Brannam (tbrannam@msn.com).
00105  *
00106  * *****************  Version 1  *****************
00107  * User: Kirk Stowell Date: 10/02/98   Time: 4:23p
00108  * Created in $/CodeJockey/CJ60Lib
00109  * First release version.
00110  *
00111  ***************************************************************************/
00113
00114 #include "stdafx.h"
00115 #include "CJFlatComboBox.h"
00116
00117 #ifdef _DEBUG
00118 #define new DEBUG_NEW
00119 #undef THIS_FILE
00120 static char THIS_FILE[] = __FILE__;
00121 #endif
00122
00124 // CCJFlatComboBox
00125
00126 CCJFlatComboBox::CCJFlatComboBox()
00127 {
00128     m_bLBtnDown     = FALSE;
00129     m_bPainted      = FALSE;
00130     m_bHasFocus     = FALSE;
00131     m_bAutoComp     = FALSE;
00132     m_clrHilite     = ::GetSysColor(COLOR_BTNHIGHLIGHT);
00133     m_clrShadow     = ::GetSysColor(COLOR_BTNSHADOW);
00134     m_clrNormal     = ::GetSysColor(COLOR_BTNFACE);
00135 }
00136
00137 CCJFlatComboBox::~CCJFlatComboBox()
00138 {
00139 }
00140
00141 IMPLEMENT_DYNAMIC(CCJFlatComboBox, CComboBox)
00142
00143 BEGIN_MESSAGE_MAP(CCJFlatComboBox, CComboBox)
00144     //{{AFX_MSG_MAP(CCJFlatComboBox)
00145     ON_WM_MOUSEMOVE()
00146     ON_WM_LBUTTONDOWN()
00147     ON_WM_LBUTTONUP()
00148     ON_WM_TIMER()
00149     ON_WM_PAINT()
00150     ON_CONTROL_REFLECT(CBN_SETFOCUS,   OnSetFocus)
00151     ON_CONTROL_REFLECT(CBN_KILLFOCUS,  OnKillFocus)
00152     ON_CONTROL_REFLECT(CBN_EDITUPDATE, OnEditUpdate)
00153     ON_WM_SYSCOLORCHANGE()
00154     ON_WM_ERASEBKGND()
00155     //}}AFX_MSG_MAP
00156 END_MESSAGE_MAP()
00157
00159 // CCJFlatComboBox message handlers
00160
00161 void CCJFlatComboBox::OnMouseMove(UINT nFlags, CPoint point)
00162 {
00163     SetTimer(1,10,NULL);
00164     OnTimer(1);
00165     CComboBox::OnMouseMove(nFlags, point);
00166 }
00167
00168 void CCJFlatComboBox::OnLButtonDown(UINT nFlags, CPoint point)
00169 {
00170     m_bLBtnDown = TRUE;
00171     CComboBox::OnLButtonDown(nFlags, point);
00172 }
00173
00174 void CCJFlatComboBox::OnLButtonUp(UINT nFlags, CPoint point)
00175 {
00176     m_bLBtnDown = FALSE;
00177     Invalidate();
00178     CComboBox::OnLButtonUp(nFlags, point);
00179 }
00180
00181 void CCJFlatComboBox::OnTimer(UINT nIDEvent)
00182 {
00183     UNUSED_ALWAYS(nIDEvent);
00184
00185     if (m_bLBtnDown==TRUE) { // OnLButtonDown, show PRESSED.
00186         KillTimer (1);
00187         if (m_bPainted == TRUE) {
00188             DrawCombo(PRESSED, m_clrShadow, m_clrHilite);
00189             m_bPainted = FALSE;
00190         }
00191     } else if (!PointInRect() && !m_bHasFocus) { // If mouse leaves, show flat.
00192         KillTimer (1);
00193         if (m_bPainted == TRUE) {
00194             DrawCombo(NORMAL, m_clrNormal, m_clrNormal);
00195             m_bPainted = FALSE;
00196         }
00197     } else { // On mouse over, show RAISED.
00198         if (m_bPainted == TRUE) {
00199             return;
00200         } else {
00201             m_bPainted = TRUE;
00202             DrawCombo(RAISED, m_clrShadow, m_clrHilite);
00203         }
00204     }
00205 }
00206
00207 void CCJFlatComboBox::OnPaint()
00208 {
00209     ModifyStyleEx (WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE,
00210         0, SWP_FRAMECHANGED);
00211
00212     CPaintDC dc(this);
00213
00214     // KStowell - Get the client rect.
00215     CRect rcClient;
00216     GetClientRect( &rcClient );
00217
00218     // KStowell - Create a memory device-context. This is done to help reduce
00219     // screen flicker, since we will paint the entire control to the
00220     // off screen device context first.
00221     CDC memDC;
00222     CBitmap bitmap;
00223     memDC.CreateCompatibleDC(&dc);
00224     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00225     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00226
00227     // let the control do its default drawing.
00228     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00229
00230     if (PointInRect() || m_bHasFocus) {
00231         DrawCombo(RAISED, m_clrShadow, m_clrHilite, &memDC);
00232     } else {
00233         DrawCombo(NORMAL, m_clrNormal, m_clrNormal, &memDC);
00234     }
00235
00236     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00237     dc.BitBlt(rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), &memDC, 0,0, SRCCOPY);
00238
00239     // KStowell - Cleanup resources.
00240     memDC.SelectObject(pOldBitmap);
00241     memDC.DeleteDC();
00242     bitmap.DeleteObject();
00243 }
00244
00245 void CCJFlatComboBox::DrawCombo(STATE eState, COLORREF clrTopLeft, COLORREF clrBottomRight, CDC* pDC)
00246 {
00247     CRect rcItem;
00248     GetClientRect(&rcItem);
00249     bool bRelease = false;
00250
00251     // if no device context was passed in, get the device context
00252     // for the CWnd client area ...
00253     if(pDC == NULL) {
00254         pDC = GetDC();
00255         bRelease = true;
00256     }
00257
00258     // Cover up dark 3D shadow.
00259     pDC->Draw3dRect(rcItem, clrTopLeft, clrBottomRight);
00260     rcItem.DeflateRect(1,1);
00261
00262     if (!IsWindowEnabled()) {
00263         pDC->Draw3dRect(rcItem, m_clrHilite, m_clrHilite);
00264     } else {
00265         pDC->Draw3dRect(rcItem, m_clrNormal, m_clrNormal);
00266     }
00267
00268     // Cover up dark 3D shadow on drop arrow.
00269     rcItem.DeflateRect(1,1);
00270     rcItem.left = rcItem.right-::GetSystemMetrics(SM_CXHTHUMB);;
00271     pDC->Draw3dRect(rcItem, m_clrNormal, m_clrNormal);
00272
00273     // Cover up NORMAL 3D shadow on drop arrow.
00274     rcItem.DeflateRect(1,1);
00275     pDC->Draw3dRect(rcItem, m_clrNormal, m_clrNormal);
00276
00277     if (!IsWindowEnabled()) {
00278         if(bRelease == true) {
00279             ReleaseDC(pDC);
00280         }
00281         return;
00282     }
00283
00284     rcItem.InflateRect(0,1);
00285     switch (eState)
00286     {
00287     case NORMAL:
00288         pDC->Draw3dRect(rcItem, m_clrHilite, m_clrHilite);
00289         rcItem.left -= 1;
00290         pDC->Draw3dRect(rcItem, m_clrHilite, m_clrHilite);
00291         break;
00292
00293     case RAISED:
00294         pDC->Draw3dRect(rcItem, m_clrHilite, m_clrShadow);
00295         break;
00296
00297     case PRESSED:
00298         rcItem.OffsetRect(1,1);
00299         pDC->Draw3dRect(rcItem, m_clrShadow, m_clrHilite);
00300         break;
00301     }
00302
00303     // KStowell - cleanup.
00304     if(bRelease == true) {
00305         ReleaseDC(pDC);
00306     }
00307 }
00308
00309 void CCJFlatComboBox::OnSetFocus()
00310 {
00311     m_bHasFocus = TRUE;
00312     DrawCombo(RAISED, m_clrShadow, m_clrHilite);
00313 }
00314
00315 void CCJFlatComboBox::OnKillFocus()
00316 {
00317     m_bHasFocus = FALSE;
00318     DrawCombo(NORMAL, m_clrNormal, m_clrNormal);
00319 }
00320
00321 BOOL CCJFlatComboBox::PreTranslateMessage(MSG* pMsg)
00322 {
00323     if(IsWin95()) // alexander Golde [alex@viona.de]
00324     {
00325         // Make sure that the keystrokes continue to the appropriate handlers
00326         if (pMsg->message == WM_KEYDOWN || pMsg->message==WM_KEYUP)
00327         {
00328             ::TranslateMessage(pMsg);
00329             ::DispatchMessage(pMsg);
00330             return TRUE;
00331         }
00332
00333         // Catch the Alt key so we don't choke if focus
00334         // is going to an owner drawn button
00335         if (pMsg->message == WM_SYSCHAR)
00336             return TRUE;
00337     }
00338
00339     return CComboBox::PreTranslateMessage(pMsg);
00340 }
00341
00342 void CCJFlatComboBox::OnEditUpdate()
00343 {
00344     // if we are not to auto update the text, get outta here
00345     if (!m_bAutoComp)
00346         return;
00347
00348     // Get the text in the edit box
00349     CString str;
00350     GetWindowText(str);
00351     int nLength = str.GetLength();
00352
00353     // Currently selected range
00354     DWORD dwCurSel = GetEditSel();
00355     WORD dStart = LOWORD(dwCurSel);
00356     WORD dEnd   = HIWORD(dwCurSel);
00357
00358     // Search for, and select in, and string in the combo box that is prefixed
00359     // by the text in the edit box
00360     if (SelectString(-1, str) == CB_ERR)
00361     {
00362         SetWindowText(str);     // No text selected, so restore what was there before
00363         if (dwCurSel != CB_ERR)
00364             SetEditSel(dStart, dEnd);   //restore cursor postion
00365     }
00366
00367     // Set the text selection as the additional text that we have added
00368     if (dEnd < nLength && dwCurSel != CB_ERR)
00369         SetEditSel(dStart, dEnd);
00370     else
00371         SetEditSel(nLength, -1);
00372 }
00373
00374 BOOL CCJFlatComboBox::IsWin95()
00375 {
00376     OSVERSIONINFO info;
00377     info.dwOSVersionInfoSize = sizeof(info);
00378     GetVersionEx( &info );
00379     return ((VER_PLATFORM_WIN32_WINDOWS == info.dwPlatformId) && (info.dwMinorVersion == 0));
00380 }
00381
00382 void CCJFlatComboBox::OnSysColorChange()
00383 {
00384     CComboBox::OnSysColorChange();
00385
00386     m_clrHilite = ::GetSysColor(COLOR_BTNHIGHLIGHT);
00387     m_clrShadow = ::GetSysColor(COLOR_BTNSHADOW);
00388     m_clrNormal = ::GetSysColor(COLOR_BTNFACE);
00389 }
00390
00391 BOOL CCJFlatComboBox::OnEraseBkgnd(CDC* pDC)
00392 {
00393     // KStowell - overridden for flicker-free drawing.
00394     UNUSED_ALWAYS(pDC);
00395     return TRUE;
00396 }
Generated on Sun Feb 24 01:21:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJFlatHeaderCtrl.cpp Source File

WinCvs/CJLib/CJLibrary/CJFlatHeaderCtrl.cpp

Go to the documentation of this file.
00001 // CJFlatHeaderCtrl.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/CJLibrary/CJFlatHeaderCtrl.cpp $
00011  *
00012  * $History: CJFlatHeaderCtrl.cpp $
00013  *
00014  * *****************  Version 21  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:01p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Further Updates to OnEraseBkgnd(...) and OnPaint() for flicker free
00018  * drawing.
00019  *
00020  * *****************  Version 20  *****************
00021  * User: Kirk Stowell Date: 10/30/99   Time: 2:11p
00022  * Updated in $/CodeJock/CJLibrary
00023  * Overrode OnPaint(...) for flicker free drawing and fixed bug where
00024  * column is resized and border leaves a trail.
00025  *
00026  * *****************  Version 19  *****************
00027  * User: Kirk Stowell Date: 10/24/99   Time: 7:34p
00028  * Updated in $/CodeJock/CJLibrary
00029  * 1. Fixed bug with flat header control where header items were not drawn
00030  * correctly whenever header items were dragged to a new location. Ioannhs
00031  * Stamatopoulos (Yiannhs) [ystamat@mail.datamedia.gr]
00032  *
00033  * *****************  Version 18  *****************
00034  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00035  * Updated in $/CodeJock/CJLibrary
00036  * Fixed potential resource and memory leak problems.
00037  *
00038  * *****************  Version 17  *****************
00039  * User: Kirk Stowell Date: 10/14/99   Time: 8:23p
00040  * Updated in $/CodeJock/CJLibrary
00041  * Fixed size bug with header control where the end does not display
00042  * correctly.
00043  *
00044  * *****************  Version 16  *****************
00045  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00046  * Updated in $/CodeJockey/CJLibrary
00047  * Updated copyright and contact information.
00048  *
00049  * *****************  Version 15  *****************
00050  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00051  * Updated in $/CodeJockey/CJLibrary
00052  * Added Unicode compliance, thanks to Barry Burton for his help with
00053  * this.
00054  *
00055  *
00056  * *****************  Version 14  *****************
00057  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00058  * Updated in $/CodeJockey/CJLibrary
00059  *
00060  * *****************  Version 13  *****************
00061  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00062  * Updated in $/CodeJockey/CJLibrary
00063  *
00064  * *****************  Version 12  *****************
00065  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00066  * Updated in $/CodeJockey/CJLibrary
00067  *
00068  * *****************  Version 11  *****************
00069  * User: Kirk Stowell Date: 7/25/99    Time: 12:15a
00070  * Updated in $/CodeJockey/CJLibrary
00071  *
00072  * *****************  Version 10  *****************
00073  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00074  * Updated in $/CodeJockey/CJLibrary
00075  *
00076  * *****************  Version 9  *****************
00077  * User: Kirk Stowell Date: 7/18/99    Time: 10:27p
00078  * Updated in $/CodeJockey/CJLibrary
00079  * Added vc5 compatibility.
00080  *
00081  * *****************  Version 8  *****************
00082  * User: Kirk Stowell Date: 6/14/99    Time: 10:43p
00083  * Updated in $/CodeJockey/CJ60Lib
00084  * Cleaned up code to eliminate level 4 compilier warnings.
00085  *
00086  * *****************  Version 7  *****************
00087  * User: Kirk Stowell Date: 5/17/99    Time: 8:00p
00088  * Updated in $/CodeJockey/CJ60Lib
00089  * Added popup menu support and vc5 compatibility.
00090  *
00091  * *****************  Version 6  *****************
00092  * User: Kirk Stowell Date: 5/12/99    Time: 5:32a
00093  * Updated in $/CodeJockey/CJ60Lib
00094  * Added support for vc5 compatibility
00095  *
00096  * *****************  Version 5  *****************
00097  * User: Kirk Stowell Date: 4/15/99    Time: 4:27p
00098  * Updated in $/CodeJockey/CJ60Lib
00099  * Igor Ostriz [iostriz@usa.net] - fixed bug with drag/drop and changing
00100  * column order.
00101  *
00102  * *****************  Version 4  *****************
00103  * User: Kirk Stowell Date: 4/03/99    Time: 4:26p
00104  * Updated in $/CodeJockey/CJ60Lib
00105  * Added comments and cleaned up code.
00106  *
00107  * *****************  Version 3  *****************
00108  * User: Kirk Stowell Date: 2/24/99    Time: 4:26p
00109  * Updated in $/CodeJockey/CJ60Lib
00110  * Fixed repainting problem when header is moved or window is resized. The
00111  * class now uses log font instead of hard coded Tahoma font.
00112  *
00113  * *****************  Version 2  *****************
00114  * User: Kirk Stowell Date: 1/31/99    Time: 4:27p
00115  * Updated in $/CodeJockey/CJ60Lib
00116  * Fixed problem with sort arrow drawn. If hditem has an associated
00117  * bitmap, the arrow is not drawn.
00118  *
00119  * *****************  Version 1  *****************
00120  * User: Kirk Stowell Date: 1/16/99    Time: 4:26p
00121  * Created in $/CodeJockey/CJ60Lib
00122  * Initial release.
00123  *
00124  ***************************************************************************/
00126
00127 #include "stdafx.h"
00128 #include "CJFlatHeaderCtrl.h"
00129
00130 #ifdef _DEBUG
00131 #define new DEBUG_NEW
00132 #undef THIS_FILE
00133 static char THIS_FILE[] = __FILE__;
00134 #endif
00135
00137 // CCJFlatHeaderCtrl
00138
00139 CCJFlatHeaderCtrl::CCJFlatHeaderCtrl()
00140 {
00141     m_nSortCol      = -1;
00142     m_bBoldFont     = FALSE;
00143     m_nOffset       = 6;
00144     m_bLBtnDown     = FALSE;
00145     m_popupMenuID   = 0;
00146     m_popToolbarID  = 0;
00147     m_nPos          = 0;
00148     m_pParentWnd    = NULL;
00149 }
00150
00151 CCJFlatHeaderCtrl::~CCJFlatHeaderCtrl()
00152 {
00153     // fix potential resource leak - KStowell - 10-22-99.
00154     m_Font.DeleteObject();
00155 }
00156
00157 BEGIN_MESSAGE_MAP(CCJFlatHeaderCtrl, CHeaderCtrl)
00158     //{{AFX_MSG_MAP(CCJFlatHeaderCtrl)
00159     ON_WM_PAINT()
00160     ON_WM_RBUTTONDOWN()
00161     ON_WM_MEASUREITEM()
00162     ON_WM_MENUCHAR()
00163     ON_WM_INITMENUPOPUP()
00164     ON_WM_CREATE()
00165     ON_WM_WINDOWPOSCHANGED()
00166     ON_WM_ERASEBKGND()
00167     //}}AFX_MSG_MAP
00168 END_MESSAGE_MAP()
00169
00171 // CCJFlatHeaderCtrl message handlers
00172
00173 void CCJFlatHeaderCtrl::InitializeHeader(bool bBoldFont)
00174 {
00175     m_Font.DeleteObject();
00176     NONCLIENTMETRICS ncm;
00177     ncm.cbSize = sizeof(ncm);
00178     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00179     if(bBoldFont)
00180         ncm.lfMessageFont.lfWeight = 700;
00181     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00182     SetFont(&m_Font);
00183
00184     m_bBoldFont = bBoldFont;
00185 }
00186
00187 int CCJFlatHeaderCtrl::SetSortImage(int nCol, BOOL bAsc)
00188 {
00189     int nPrevCol = m_nSortCol;
00190
00191     m_nSortCol = nCol;
00192     m_bSortAsc = bAsc;
00193
00194     // Change the item to ownder drawn
00195     HD_ITEM hditem;
00196
00197     hditem.mask = HDI_BITMAP | HDI_FORMAT;
00198     GetItem( nCol, &hditem );
00199     if (hditem.hbm == NULL)
00200     {
00201         hditem.fmt |= HDF_OWNERDRAW;
00202         SetItem( nCol, &hditem );
00203
00204         // Invalidate header control so that it gets redrawn
00205         Invalidate();
00206     }
00207
00208     return nPrevCol;
00209 }
00210
00211 void CCJFlatHeaderCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
00212 {
00213     ASSERT(lpDrawItemStruct != NULL);
00214
00215     // define some temporary variables.
00216     CDC*    pDC         = CDC::FromHandle( lpDrawItemStruct->hDC );
00217     CRect   rcItem      = lpDrawItemStruct->rcItem;
00218     CRect   rcIcon      = lpDrawItemStruct->rcItem;
00219     int     nState      = lpDrawItemStruct->itemState;
00220     int     nItemID     = lpDrawItemStruct->itemID;
00221     int     nSavedDC    = pDC->SaveDC();
00222
00223     // Paint the background.
00224     pDC->FillSolidRect(rcItem, afxData.clrBtnFace);
00225     pDC->SetBkMode(TRANSPARENT);
00226
00227     // Set clipping region to limit drawing within column
00228     CRgn rgn;
00229     rgn.CreateRectRgnIndirect( &rcItem );
00230     pDC->SelectObject( &rgn );
00231     rgn.DeleteObject();
00232
00233     // Get the column text and format
00234     TCHAR buf[256];
00235     HD_ITEM hditem;
00236
00237     hditem.mask = HDI_TEXT | HDI_FORMAT;
00238     hditem.pszText = buf;
00239     hditem.cchTextMax = 255;
00240
00241     GetItem( nItemID, &hditem );
00242
00243     // Determine format for drawing column label
00244     UINT uFormat = DT_SINGLELINE | DT_NOPREFIX | DT_NOCLIP
00245         | DT_VCENTER | DT_END_ELLIPSIS ;
00246
00247     if( hditem.fmt & HDF_CENTER) {
00248         uFormat |= DT_CENTER;
00249     } else if( hditem.fmt & HDF_RIGHT) {
00250         uFormat |= DT_RIGHT;
00251     } else {
00252         uFormat |= DT_LEFT;
00253     }
00254
00255     // Adjust the rect if the mouse button is pressed on it
00256     if( nState == ODS_SELECTED ) {
00257         rcItem.left++;
00258         rcItem.top += 2;
00259         rcItem.right++;
00260     }
00261
00262     // Adjust the rect further if Sort arrow is to be displayed
00263     if( nItemID == m_nSortCol ) {
00264         rcItem.right -= 3 * m_nOffset;
00265     }
00266
00267     rcItem.left += m_nOffset;
00268     rcItem.right -= m_nOffset;
00269
00270     // Draw column label
00271     if( rcItem.left < rcItem.right ) {
00272         if (m_bBoldFont) {
00273             CFont* pOldFont = pDC->SelectObject(&m_Font);
00274             pDC->DrawText(buf,-1,rcItem, uFormat);
00275             pDC->SelectObject(pOldFont);
00276         } else {
00277             pDC->DrawText(buf,-1,rcItem, uFormat);
00278         }
00279     }
00280
00281     // Draw the Sort arrow
00282     if( nItemID == m_nSortCol )
00283     {
00284         // Set up pens to use for drawing the triangle
00285         CPen penLite(PS_SOLID, 1, afxData.clrBtnHilite);
00286         CPen penShad(PS_SOLID, 1, afxData.clrBtnShadow);
00287         CPen *pOldPen = pDC->SelectObject( &penLite );
00288
00289         if( m_bSortAsc )
00290         {
00291             // Draw triangle pointing upwards
00292             pDC->MoveTo( rcIcon.right - 2*m_nOffset, m_nOffset-1);
00293             pDC->LineTo( rcIcon.right - 3*m_nOffset/2, rcIcon.bottom - m_nOffset );
00294             pDC->LineTo( rcIcon.right - 5*m_nOffset/2-2, rcIcon.bottom - m_nOffset );
00295             pDC->MoveTo( rcIcon.right - 5*m_nOffset/2-1, rcIcon.bottom - m_nOffset-1 );
00296
00297             pDC->SelectObject( &penShad );
00298             pDC->LineTo( rcIcon.right - 2*m_nOffset, m_nOffset-2);
00299         }
00300         else
00301         {
00302             // Draw triangle pointing downwords
00303             pDC->MoveTo( rcIcon.right - 3*m_nOffset/2, m_nOffset-1);
00304             pDC->LineTo( rcIcon.right - 2*m_nOffset-1, rcIcon.bottom - m_nOffset + 1 );
00305             pDC->MoveTo( rcIcon.right - 2*m_nOffset-1, rcIcon.bottom - m_nOffset );
00306
00307             pDC->SelectObject( &penShad );
00308             pDC->LineTo( rcIcon.right - 5*m_nOffset/2-1, m_nOffset -1 );
00309             pDC->LineTo( rcIcon.right - 3*m_nOffset/2, m_nOffset -1);
00310         }
00311
00312         // Restore the pen
00313         pDC->SelectObject( pOldPen );
00314
00315         // fix potential resource leak - KStowell - 10-21-99
00316         penLite.DeleteObject();
00317         penShad.DeleteObject();
00318     }
00319
00320     // restore the device context
00321     pDC->RestoreDC(nSavedDC);
00322 }
00323
00324 void CCJFlatHeaderCtrl::OnPaint()
00325 {
00326     CPaintDC dc(this); // device context for painting
00327
00328     // KStowell - Get the client rect.
00329     CRect rcClient;
00330     GetClientRect( &rcClient );
00331
00332     // KStowell - Create a memory device-context. This is done to help reduce
00333     // screen flicker, since we will paint the entire control to the
00334     // off screen device context first.
00335     CDC memDC;
00336     CBitmap bitmap;
00337     memDC.CreateCompatibleDC(&dc);
00338     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00339     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00340     memDC.FillSolidRect(rcClient, afxData.clrBtnFace);
00341
00342     // First let the control do its default drawing.
00343     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00344
00345     // KStowell - Repaint the background.
00346     DrawFlatBorder(&memDC);
00347
00348     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00349     dc.BitBlt( rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), &memDC,
00350         rcClient.left, rcClient.top, SRCCOPY );
00351
00352     // KStowell - Cleanup resources.
00353     memDC.SelectObject(pOldBitmap);
00354     memDC.DeleteDC();
00355     bitmap.DeleteObject();
00356 }
00357
00358 void CCJFlatHeaderCtrl::DrawFlatBorder(CDC* pDC)
00359 {
00360     CRect rci;
00361     GetWindowRect(&rci);
00362     ScreenToClient(&rci);
00363
00364     // Cover up thick 3D border.
00365     pDC->Draw3dRect(rci, afxData.clrBtnFace, afxData.clrBtnFace);
00366     rci.DeflateRect(1,1);
00367     pDC->Draw3dRect(rci, afxData.clrBtnFace, afxData.clrBtnFace);
00368
00369     // Draw flat style border around entire header.
00370     rci.InflateRect(1,1);
00371     pDC->Draw3dRect(rci, afxData.clrBtnHilite, afxData.clrBtnShadow);
00372
00373     // Create the pens for further cover-up.
00374     CPen penLite(PS_SOLID, 1, afxData.clrBtnHilite);
00375     CPen penShad(PS_SOLID, 1, afxData.clrBtnShadow);
00376     CPen penFace(PS_SOLID, 1, afxData.clrBtnFace);
00377     CPen *pOldPen = pDC->SelectObject( &penLite );
00378
00379     // Set up the header item struct.
00380     HD_ITEM hdi;
00381     memset (&hdi, 0, sizeof(HD_ITEM));
00382     hdi.fmt  = HDF_STRING | HDF_LEFT | HDF_OWNERDRAW;
00383     hdi.mask = HDI_WIDTH | HDI_TEXT | HDI_FORMAT | HDI_ORDER; // Yiannhs :1999-10-19
00384     int cx = 0;
00385
00386     long j = GetItemCount();    //Yiannhs
00387     long i = 0;                 //Yiannhs
00388
00389     long * ItemOrders = new long[j];    //Yiannhs :1999-10-19
00390     for( i=0; i<j; i++ ) {              //Yiannhs :1999-10-19
00391         GetItem(i, &hdi);               //Yiannhs :1999-10-19
00392         ItemOrders[hdi.iOrder] = i;     //Yiannhs :1999-10-19
00393     }
00394
00395     hdi.fmt  = HDF_STRING | HDF_LEFT | HDF_OWNERDRAW;   //Yiannhs :1999-10-19
00396     hdi.mask = HDI_WIDTH | HDI_TEXT | HDI_FORMAT;       //Yiannhs :1999-10-19
00397
00398     // For each header item found, do further cover up.
00399     for (i = 0; i < j; ++i)
00400     {
00401         GetItem( ItemOrders[i], &hdi);
00402         cx += hdi.cxy;
00403
00404         pDC->SelectObject(&penShad);
00405         pDC->MoveTo(cx, 2);
00406         pDC->LineTo(cx, rci.bottom-2);
00407
00408         pDC->SelectObject(&penLite);
00409         pDC->MoveTo(cx+1, 2);
00410         pDC->LineTo(cx+1, rci.bottom-2);
00411
00412         pDC->SelectObject(&penFace);
00413         pDC->MoveTo(cx-1, 2);
00414         pDC->LineTo(cx-1, rci.bottom-2);
00415
00416         pDC->SelectObject(&penFace);
00417         pDC->MoveTo(cx-2, 2);
00418         pDC->LineTo(cx-2, rci.bottom-2);
00419     }
00420
00421     delete [] ItemOrders; //Yiannhs :1999-10-19
00422
00423     // Restore the pen and release device context.
00424     pDC->SelectObject( pOldPen );
00425
00426     // fix potential resource leak - KStowell - 10-21-99
00427     penLite.DeleteObject();
00428     penShad.DeleteObject();
00429     penFace.DeleteObject();
00430 }
00431
00432 void CCJFlatHeaderCtrl::OnRButtonDown(UINT /*nFlags*/, CPoint point)
00433 {
00434     // No menu was defined...
00435     if (!m_popupMenuID) {
00436         TRACE0( "Warning: No menu resource was associated with CCJTabCtrl.\n" );
00437         return;
00438     }
00439
00440     // Since we are using the main window as the
00441     // parent, we need to convert the point to screen
00442     // coordinates...
00443     CPoint pt = point;
00444     ClientToScreen(&pt);
00445
00446     // Load the popup menu.
00447     VERIFY(m_popupMenu.LoadMenu(m_popupMenuID));
00448     CCJMenu* pPopup = (CCJMenu*)m_popupMenu.GetSubMenu(m_nPos);
00449     ASSERT(pPopup != NULL);
00450
00451     // Load toolbar resource if any for menu icons.
00452     if (m_popToolbarID) {
00453         pPopup->LoadToolbar(m_popToolbarID);
00454     }
00455
00456     // Display the popup menu, use the main window as its parent.
00457     pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
00458         pt.x, pt.y, AfxGetMainWnd());
00459
00460     m_popupMenu.DestroyMenu();
00461 }
00462
00463 void CCJFlatHeaderCtrl::OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)
00464 {
00465     if (lpMeasureItemStruct->CtlType == ODT_MENU)
00466     {
00467         if (IsMenu((HMENU)lpMeasureItemStruct->itemID)) {
00468             CMenu* pMenu = CMenu::FromHandle((HMENU)lpMeasureItemStruct->itemID);
00469
00470             if (m_popupMenu.IsMenu(pMenu)) {
00471                 m_popupMenu.MeasureItem(lpMeasureItemStruct);
00472                 return;
00473             }
00474         }
00475     }
00476
00477     CHeaderCtrl::OnMeasureItem(nIDCtl, lpMeasureItemStruct);
00478 }
00479
00480 LRESULT CCJFlatHeaderCtrl::OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu)
00481 {
00482     if (m_popupMenu.IsMenu(pMenu)) {
00483         return CCJMenu::FindKeyboardShortcut(nChar, nFlags, pMenu);
00484     }
00485
00486     return CHeaderCtrl::OnMenuChar(nChar, nFlags, pMenu);
00487 }
00488
00489 void CCJFlatHeaderCtrl::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu)
00490 {
00491     CHeaderCtrl::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
00492
00493     if(!bSysMenu) {
00494         if (m_popupMenu.IsMenu(pPopupMenu)) {
00495             CCJMenu::UpdateMenu(pPopupMenu);
00496         }
00497     }
00498 }
00499
00500 #ifdef _VC_VERSION_5
00501 BOOL CCJFlatHeaderCtrl::GetOrderArray(LPINT piArray, int iCount /* = -1 */)
00502 {
00503     ASSERT(::IsWindow(m_hWnd));
00504
00505     // if -1 was passed, find the count ourselves
00506
00507     int nCount = iCount;
00508     if (nCount == -1)
00509     {
00510         nCount = GetItemCount();
00511
00512         if (nCount == -1)
00513             return FALSE;
00514     }
00515
00516     ASSERT(AfxIsValidAddress(piArray, iCount * sizeof(int)));
00517
00518     return (BOOL) ::SendMessage(m_hWnd, HDM_GETORDERARRAY,
00519         (WPARAM) iCount, (LPARAM) piArray);
00520 }
00521 #endif // _VC_VERSION_5
00522
00523 void CCJFlatHeaderCtrl::PreSubclassWindow()
00524 {
00525     CHeaderCtrl::PreSubclassWindow();
00526
00527     m_pParentWnd = GetParent();
00528     ASSERT(m_pParentWnd);
00529
00530     ResizeWindow();
00531 }
00532
00533 int CCJFlatHeaderCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
00534 {
00535     if (CHeaderCtrl::OnCreate(lpCreateStruct) == -1)
00536         return -1;
00537
00538     m_pParentWnd = CWnd::FromHandle(lpCreateStruct->hwndParent);
00539     ASSERT(m_pParentWnd);
00540
00541     ResizeWindow();
00542     return 0;
00543 }
00544
00545 void CCJFlatHeaderCtrl::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos)
00546 {
00547     CHeaderCtrl::OnWindowPosChanged(lpwndpos);
00548     ResizeWindow();
00549 }
00550
00551 void CCJFlatHeaderCtrl::ResizeWindow()
00552 {
00553     ASSERT_VALID(this);
00554     ASSERT_VALID(m_pParentWnd);
00555
00556     // Get the client size of the parent window, this will give us the
00557     // actual width of the header we are looking for.
00558     CRect rcParent;
00559     m_pParentWnd->GetClientRect(&rcParent);
00560
00561     // Get the size of the header control, we will need this for the
00562     // height of the header.
00563     CRect rcWnd;
00564     GetWindowRect(&rcWnd);
00565
00566     // Now, resize the window.
00567     SetWindowPos(NULL, 0, 0, rcParent.Width(), rcWnd.Height(),
00568         SWP_NOMOVE|SWP_FRAMECHANGED);
00569 }
00570
00571 BOOL CCJFlatHeaderCtrl::OnEraseBkgnd(CDC* pDC)
00572 {
00573     // KStowell - overridden for flicker-free drawing.
00574     UNUSED_ALWAYS(pDC);
00575     return TRUE;
00576 }
Generated on Sun Feb 24 01:21:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJFlatSplitterWnd.cpp Source File

WinCvs/CJLib/CJLibrary/CJFlatSplitterWnd.cpp

Go to the documentation of this file.
00001 // CJFlatSplitterWnd.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based on the CSplitterWndEx class written by Oleg G. Galkin.
00006 // mailto:OlegGa@vest.msk.ru
00007 // http://www.codeguru.com/splitter/show_hide_static_panes.shtml
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:49 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJock/CJLibrary/CJFlatSplitterWnd.cpp $
00015  *
00016  * $History: CJFlatSplitterWnd.cpp $
00017  *
00018  * *****************  Version 6  *****************
00019  * User: Kirk Stowell Date: 10/14/99   Time: 9:25p
00020  * Updated in $/CodeJock/CJLibrary
00021  * Fixed bug with hiding or showing panes where the incorrect splitter
00022  * control id was used.
00023  *
00024  * *****************  Version 5  *****************
00025  * User: Kirk Stowell Date: 9/13/99    Time: 5:44a
00026  * Updated in $/CodeJockey/CJLibrary
00027  * Fixed assertion when using ReplaceView to display a CFormView derived
00028  * class in a debug build - Tom
00029  *
00030  * *****************  Version 4  *****************
00031  * User: Kirk Stowell Date: 9/13/99    Time: 5:40a
00032  * Updated in $/CodeJockey/CJLibrary
00033  * Fixed bug with GetPane() call in ShowRow() where row and col arguments
00034  * were switched. - Francis
00035  *
00036  * *****************  Version 3  *****************
00037  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00038  * Updated in $/CodeJockey/CJLibrary
00039  * Updated copyright and contact information.
00040  *
00041  * *****************  Version 2  *****************
00042  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00043  * Updated in $/CodeJockey/CJLibrary
00044  *
00045  * *****************  Version 1  *****************
00046  * User: Kirk Stowell Date: 7/14/99    Time: 10:00p
00047  * Created in $/CodeJockey/CJLibrary
00048  * Class added to support flat splitters, removable splitter views and
00049  * view manipulation.
00050  *
00051  ***************************************************************************/
00053
00054 #include "StdAfx.h"
00055 #include "CJFlatSplitterWnd.h"
00056
00057 #ifdef _DEBUG
00058 #define new DEBUG_NEW
00059 #undef THIS_FILE
00060 static char THIS_FILE[] = __FILE__;
00061 #endif
00062
00064 // CCJFlatSplitterWnd
00065
00066 CCJFlatSplitterWnd::CCJFlatSplitterWnd()
00067 {
00068     m_bFlatSplitter = TRUE;
00069     m_nHiddenCol    = -1;
00070     m_nHiddenRow    = -1;
00071 }
00072
00073 CCJFlatSplitterWnd::~CCJFlatSplitterWnd()
00074 {
00075
00076 }
00077
00078 BEGIN_MESSAGE_MAP(CCJFlatSplitterWnd, CSplitterWnd)
00079     //{{AFX_MSG_MAP(CCJFlatSplitterWnd)
00080     ON_WM_PAINT()
00081     //}}AFX_MSG_MAP
00082 END_MESSAGE_MAP()
00083
00085 // CCJFlatSplitterWnd message handlers
00086
00087 void CCJFlatSplitterWnd::OnDrawSplitter(CDC* pDC, ESplitType nType,
00088     const CRect& rectArg)
00089 {
00090     if( m_bFlatSplitter )
00091     {
00092         // if pDC == NULL, then just invalidate
00093         if (pDC == NULL)
00094         {
00095             RedrawWindow(rectArg, NULL, RDW_INVALIDATE|RDW_NOCHILDREN);
00096             return;
00097         }
00098         ASSERT_VALID(pDC);
00099
00100         // otherwise, actually draw
00101         CRect rect = rectArg;
00102         switch (nType)
00103         {
00104         case splitBorder:
00105             ASSERT(afxData.bWin4);
00106             pDC->Draw3dRect(rect, afxData.clrBtnFace, afxData.clrBtnFace);
00107             rect.InflateRect(-CX_BORDER, -CY_BORDER);
00108             pDC->Draw3dRect(rect, afxData.clrBtnShadow, afxData.clrBtnHilite);
00109             return;
00110
00111         case splitIntersection:
00112             ASSERT(!afxData.bWin4);
00113             break;
00114
00115         case splitBox:
00116             if (afxData.bWin4)
00117             {
00118                 pDC->Draw3dRect(rect, afxData.clrBtnFace, afxData.clrWindowFrame);
00119                 rect.InflateRect(-CX_BORDER, -CY_BORDER);
00120                 pDC->Draw3dRect(rect, afxData.clrBtnHilite, afxData.clrBtnShadow);
00121                 rect.InflateRect(-CX_BORDER, -CY_BORDER);
00122                 break;
00123             }
00124             // fall through...
00125         case splitBar:
00126             if (!afxData.bWin4)
00127             {
00128                 pDC->Draw3dRect(rect, afxData.clrBtnHilite, afxData.clrBtnShadow);
00129                 rect.InflateRect(-CX_BORDER, -CY_BORDER);
00130             }
00131             break;
00132
00133         default:
00134             ASSERT(FALSE);  // unknown splitter type
00135         }
00136
00137         // fill the middle
00138         pDC->FillSolidRect(rect, afxData.clrBtnFace);
00139     }
00140
00141     else {
00142         CSplitterWnd::OnDrawSplitter(pDC, nType, rectArg);
00143     }
00144 }
00145
00146 void CCJFlatSplitterWnd::OnPaint()
00147 {
00148     if( m_bFlatSplitter )
00149     {
00150         ASSERT_VALID(this);
00151         CPaintDC dc(this);
00152
00153         CRect rectClient;
00154         GetClientRect(&rectClient);
00155
00156         CRect rectInside;
00157         GetInsideRect(rectInside);
00158         rectInside.InflateRect(4,4);
00159
00160         // draw the splitter boxes
00161         if (m_bHasVScroll && m_nRows < m_nMaxRows)
00162         {
00163             OnDrawSplitter(&dc, splitBox,
00164                 CRect(rectInside.right, rectClient.top,
00165                 rectClient.right, rectClient.top + m_cySplitter));
00166         }
00167
00168         if (m_bHasHScroll && m_nCols < m_nMaxCols)
00169         {
00170             OnDrawSplitter(&dc, splitBox,
00171                 CRect(rectClient.left, rectInside.bottom,
00172                 rectClient.left + m_cxSplitter, rectClient.bottom));
00173         }
00174
00175         // extend split bars to window border (past margins)
00176         DrawAllSplitBars(&dc, rectInside.right, rectInside.bottom);
00177
00178         // draw splitter intersections (inside only)
00179         GetInsideRect(rectInside);
00180         dc.IntersectClipRect(rectInside);
00181         CRect rect;
00182         rect.top = rectInside.top;
00183         for (int row = 0; row < m_nRows - 1; row++)
00184         {
00185             rect.top += m_pRowInfo[row].nCurSize + m_cyBorderShare;
00186             rect.bottom = rect.top + m_cySplitter;
00187             rect.left = rectInside.left;
00188             for (int col = 0; col < m_nCols - 1; col++)
00189             {
00190                 rect.left += m_pColInfo[col].nCurSize + m_cxBorderShare;
00191                 rect.right = rect.left + m_cxSplitter;
00192                 OnDrawSplitter(&dc, splitIntersection, rect);
00193                 rect.left = rect.right + m_cxBorderShare;
00194             }
00195             rect.top = rect.bottom + m_cxBorderShare;
00196         }
00197     }
00198     else {
00199         CSplitterWnd::OnPaint();
00200     }
00201 }
00202
00203 void CCJFlatSplitterWnd::HideRow(int nRowHide)
00204 {
00205     ASSERT_VALID( this );
00206     ASSERT( m_nRows > 1 );
00207     ASSERT( nRowHide < m_nRows );
00208     ASSERT( m_nHiddenRow == -1 );
00209     m_nHiddenRow = nRowHide;
00210
00211     int nActiveRow, nActiveCol;
00212
00213     // if the nRow has an active window -- change it
00214     if( GetActivePane( &nActiveRow, &nActiveCol ) != NULL )
00215     {
00216         if( nActiveRow == nRowHide )
00217         {
00218             if( ++nActiveRow >= m_nRows )
00219                 nActiveRow = 0;
00220             SetActivePane( nActiveRow, nActiveCol );
00221         }
00222     }
00223
00224     // hide all nRow panes.
00225     for( int nCol = 0; nCol < m_nCols; ++nCol )
00226     {
00227         CWnd* pPaneHide = GetPane( nRowHide, nCol );
00228         ASSERT( pPaneHide != NULL );
00229
00230         pPaneHide->ShowWindow( SW_HIDE );
00231         pPaneHide->SetDlgCtrlID( AFX_IDW_PANE_FIRST+nCol + 16*m_nRows );
00232
00233         for( int nRow = nRowHide+1; nRow < m_nRows; ++nRow )
00234         {
00235             CWnd* pPane = GetPane( nRow, nCol );
00236             ASSERT( pPane != NULL );
00237
00238             pPane->SetDlgCtrlID( IdFromRowCol( nRow-1, nCol ));
00239         }
00240     }
00241
00242     m_nRows--;
00243     m_pRowInfo[m_nRows].nCurSize = m_pRowInfo[nRowHide].nCurSize;
00244     RecalcLayout();
00245 }
00246
00247 void CCJFlatSplitterWnd::ShowRow()
00248 {
00249     ASSERT_VALID( this );
00250     ASSERT( m_nRows < m_nMaxRows );
00251     ASSERT( m_nHiddenRow != -1 );
00252
00253     int nShowRow = m_nHiddenRow;
00254     m_nHiddenRow = -1;
00255
00256     int cyNew = m_pRowInfo[m_nRows].nCurSize;
00257     m_nRows++;  // add a nRow
00258
00259     ASSERT( m_nRows == m_nMaxRows );
00260
00261     int nRow;
00262
00263     // Show the hidden nRow
00264     for( int nCol = 0; nCol < m_nCols; ++nCol )
00265     {
00266         CWnd* pPaneShow = GetDlgItem( AFX_IDW_PANE_FIRST+nCol + 16*m_nRows );
00267         ASSERT( pPaneShow != NULL );
00268         pPaneShow->ShowWindow( SW_SHOWNA );
00269
00270         for( nRow = m_nRows - 2; nRow >= nShowRow; --nRow )
00271         {
00272             CWnd* pPane = GetPane( nRow, nCol );
00273             ASSERT( pPane != NULL );
00274             pPane->SetDlgCtrlID( IdFromRowCol( nRow + 1, nCol ));
00275         }
00276
00277         pPaneShow->SetDlgCtrlID( IdFromRowCol( nShowRow, nCol ));
00278     }
00279
00280     // new panes have been created -- recalculate layout
00281     for( nRow = nShowRow+1; nRow < m_nRows; nRow++ )
00282         m_pRowInfo[nRow].nIdealSize = m_pRowInfo[nRow - 1].nCurSize;
00283
00284     m_pRowInfo[nShowRow].nIdealSize = cyNew;
00285     RecalcLayout();
00286 }
00287
00288 void CCJFlatSplitterWnd::HideColumn(int nColHide)
00289 {
00290     ASSERT_VALID( this );
00291     ASSERT( m_nCols > 1 );
00292     ASSERT( nColHide < m_nCols );
00293     ASSERT( m_nHiddenCol == -1 );
00294     m_nHiddenCol = nColHide;
00295
00296     // if the column has an active window -- change it
00297     int nActiveRow, nActiveCol;
00298     if( GetActivePane( &nActiveRow, &nActiveCol ) != NULL )
00299     {
00300         if( nActiveCol == nColHide )
00301         {
00302             if( ++nActiveCol >= m_nCols )
00303                 nActiveCol = 0;
00304             SetActivePane( nActiveRow, nActiveCol );
00305         }
00306     }
00307
00308     // hide all column panes
00309     for( int nRow = 0; nRow < m_nRows; nRow++)
00310     {
00311         CWnd* pPaneHide = GetPane(nRow, nColHide);
00312         ASSERT( pPaneHide != NULL );
00313
00314         pPaneHide->ShowWindow(SW_HIDE);
00315         pPaneHide->SetDlgCtrlID( AFX_IDW_PANE_FIRST+m_nCols + 16*nRow );
00316
00317         for( int nCol = nColHide + 1; nCol < m_nCols; nCol++ )
00318         {
00319             CWnd* pPane = GetPane( nRow, nCol );
00320             ASSERT( pPane != NULL );
00321
00322             pPane->SetDlgCtrlID( IdFromRowCol( nRow, nCol - 1 ));
00323         }
00324     }
00325
00326     m_nCols--;
00327     m_pColInfo[m_nCols].nCurSize = m_pColInfo[nColHide].nCurSize;
00328     RecalcLayout();
00329 }
00330
00331 void CCJFlatSplitterWnd::ShowColumn()
00332 {
00333     ASSERT_VALID( this );
00334     ASSERT( m_nCols < m_nMaxCols );
00335     ASSERT( m_nHiddenCol != -1 );
00336
00337     int nShowCol = m_nHiddenCol;
00338     m_nHiddenCol = -1;
00339
00340     int cxNew = m_pColInfo[m_nCols].nCurSize;
00341     m_nCols++;  // add a column
00342
00343     ASSERT( m_nCols == m_nMaxCols );
00344
00345     int nCol;
00346
00347     // Show the hidden column
00348     for( int nRow = 0; nRow < m_nRows; ++nRow )
00349     {
00350         CWnd* pPaneShow = GetDlgItem( AFX_IDW_PANE_FIRST+m_nCols + 16*nRow );
00351         ASSERT( pPaneShow != NULL );
00352         pPaneShow->ShowWindow( SW_SHOWNA );
00353
00354         for( nCol = m_nCols - 2; nCol >= nShowCol; --nCol )
00355         {
00356             CWnd* pPane = GetPane( nRow, nCol );
00357             ASSERT( pPane != NULL );
00358             pPane->SetDlgCtrlID( IdFromRowCol( nRow, nCol + 1 ));
00359         }
00360
00361         pPaneShow->SetDlgCtrlID( IdFromRowCol( nRow, nShowCol ));
00362     }
00363
00364     // new panes have been created -- recalculate layout
00365     for( nCol = nShowCol+1; nCol < m_nCols; nCol++ )
00366         m_pColInfo[nCol].nIdealSize = m_pColInfo[nCol - 1].nCurSize;
00367
00368     m_pColInfo[nShowCol].nIdealSize = cxNew;
00369     RecalcLayout();
00370 }
00371
00372 BOOL CCJFlatSplitterWnd::ReplaceView(int nRow, int nCol, CRuntimeClass *pViewClass)
00373 {
00374     CView *pView = DYNAMIC_DOWNCAST( CView, GetPane( nRow, nCol ));
00375     ASSERT_KINDOF( CView, pView );
00376
00377     if( pView->IsKindOf( pViewClass ))
00378         return FALSE;
00379
00380     // Get pointer to CDocument object so that it can be used in the creation
00381     // process of the new view
00382     CDocument *pDoc = pView->GetDocument();
00383
00384     int nID = pView->GetDlgCtrlID();
00385     int nWidth, nHeight, nMinWidth, nMinHeight;
00386
00387     GetRowInfo( nRow, nWidth, nMinWidth );
00388     GetColumnInfo( nCol, nHeight, nMinHeight );
00389
00390     // Delete existing view
00391     DeleteView(nRow, nCol);
00392
00393     // Create new view
00394     CCreateContext context;
00395     context.m_pCurrentDoc = pDoc;
00396     CreateView( nRow, nCol, pViewClass, CSize( nWidth, nHeight ), &context );
00397     pView = DYNAMIC_DOWNCAST( CView, GetPane( nRow, nCol ));
00398     ASSERT_KINDOF( CView, pView );
00399
00400     pView->SetDlgCtrlID( nID );
00401
00402     SetRowInfo( nRow, nWidth, nMinWidth );
00403     SetColumnInfo( nCol, nHeight, nMinHeight );
00404     RecalcLayout();
00405
00406     return TRUE;
00407 }
00408
00409 BOOL CCJFlatSplitterWnd::SwitchView(int nRow, int nCol, CView *pNewView)
00410 {
00411     CView *pOldView = DYNAMIC_DOWNCAST( CView, GetPane( nRow, nCol ));
00412     ASSERT_KINDOF( CView, pOldView );
00413
00414     if( pOldView == pNewView )
00415         return FALSE;
00416
00417     int nOldID, nNewID;
00418
00419     nOldID = pOldView->GetDlgCtrlID();
00420     nNewID = pNewView->GetDlgCtrlID();
00421
00422     pOldView->ShowWindow(SW_HIDE);
00423     pNewView->ShowWindow(SW_SHOW);
00424
00425     pOldView->SetDlgCtrlID(nNewID);
00426     pNewView->SetDlgCtrlID(nOldID);
00427
00428     RecalcLayout();
00429
00430     return TRUE;
00431 }
Generated on Sun Feb 24 01:21:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJFlatTabCtrl.cpp Source File

WinCvs/CJLib/CJLibrary/CJFlatTabCtrl.cpp

Go to the documentation of this file.
00001 // FlatTab.cpp : implementation file
00002 //
00003 // Copyright © 1999 Ian Brumby
00004 //
00005 // This source code may be used in compiled form in any way you desire.
00006 // Source file(s) may be redistributed unmodified by any means PROVIDING
00007 // they are not sold for profit without the authors expressed written consent,
00008 // and providing that this notice and the authors name and all copyright
00009 // notices remain intact.
00010 //
00011 // ==========================================================================
00012 // HISTORY:
00013 // ==========================================================================
00014 //          1.4     21 Jul 1999 - Initial release.
00015 //          1.5     30 Aug 1999 - Several enhancements by Phil Baxter
00016 //                  <Phil.Baxter@mrjinx.demon.co.uk>
00017 // ==========================================================================
00018
00019 // Excel uses FF_ROMAN and Font Height = ~(control's height - 4)
00020 // Excel draws its tabs right to left
00021 // Excel has 3DLIGHT highlighting on the left diagonal
00022 // Excel has home/end buttons
00023 // Excel's buttons change width as the control's height changes
00024 //
00026 /****************************************************************************
00027  *
00028  * $Date: 1999/11/30 21:45:49 $
00029  * $Revision: 1.1.1.3 $
00030  * $Archive: /CodeJock/CJLibrary/CJFlatTabCtrl.cpp $
00031  *
00032  * $History: CJFlatTabCtrl.cpp $
00033  *
00034  * *****************  Version 11  *****************
00035  * User: Kirk Stowell Date: 10/26/99   Time: 10:52p
00036  * Updated in $/CodeJock/CJLibrary
00037  * Fixed bug with flat tab where in some cases tabs were not completely
00038  * painted.
00039  *
00040  * *****************  Version 10  *****************
00041  * User: Kirk Stowell Date: 10/25/99   Time: 10:52p
00042  * Updated in $/CodeJock/CJLibrary
00043  * Modified resource include for static builds.
00044  *
00045  * *****************  Version 9  *****************
00046  * User: Kirk Stowell Date: 10/24/99   Time: 12:15a
00047  * Updated in $/CodeJock/CJLibrary
00048  * Fixed minor bug with tab font creation.
00049  *
00050  * *****************  Version 8  *****************
00051  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00052  * Updated in $/CodeJock/CJLibrary
00053  * Fixed potential resource and memory leak problems.
00054  *
00055  * *****************  Version 7  *****************
00056  * User: Kirk Stowell Date: 10/14/99   Time: 11:37p
00057  * Updated in $/CodeJock/CJLibrary
00058  * Fixed bug with flat tab control that would have kept one from disabling
00059  * the l/r arrow buttons, which caused an exception to be thrown. Thanks
00060  * to Ted Crow [crowtc@surge.net] for help with this.
00061  *
00062  * *****************  Version 6  *****************
00063  * User: Kirk Stowell Date: 10/14/99   Time: 12:25p
00064  * Updated in $/CodeJock/CJLibrary
00065  * Added source control history to file header.
00066  *
00067  ***************************************************************************/
00069
00070 #include "stdafx.h"
00071 #include "CJResource.h"
00072 #include "CJFlatTabCtrl.h"
00073
00074 #ifdef _DEBUG
00075 #define new DEBUG_NEW
00076 #undef THIS_FILE
00077 static char THIS_FILE[] = __FILE__;
00078 #endif
00079
00081 // CCJFlatTabCtrl
00082
00083 CCJFlatTabCtrl::CCJFlatTabCtrl()
00084 {
00085     m_bHasArrows          = false;
00086     m_bHasHomeEnd         = false;
00087     m_bTabsOnBottom       = false;
00088     m_iCurSel             = -1;
00089     m_pLeftButton         = NULL;
00090     m_pRightButton        = NULL;
00091     m_pHomeButton         = NULL;
00092     m_pEndButton          = NULL;
00093     m_hLeftArrow          = NULL;
00094     m_hLeftArrowDisabled  = NULL;
00095     m_hRightArrow         = NULL;
00096     m_hRightArrowDisabled = NULL;
00097     m_hHomeArrow          = NULL;
00098     m_hHomeArrowDisabled  = NULL;
00099     m_hEndArrow           = NULL;
00100     m_hEndArrowDisabled   = NULL;
00101     m_iXOffset            = 0;
00102 }
00103
00104 CCJFlatTabCtrl::~CCJFlatTabCtrl()
00105 {
00106     _delete(m_pLeftButton);
00107     _delete(m_pRightButton);
00108     _delete(m_pHomeButton);
00109     _delete(m_pEndButton);
00110
00111     // free HENHMETAFILE handles.
00112     if(m_hLeftArrow) {
00113         ::DeleteEnhMetaFile(m_hLeftArrow);
00114     }
00115     if(m_hLeftArrowDisabled) {
00116         ::DeleteEnhMetaFile(m_hLeftArrowDisabled);
00117     }
00118     if(m_hRightArrow) {
00119         ::DeleteEnhMetaFile(m_hRightArrow);
00120     }
00121     if(m_hRightArrowDisabled) {
00122         ::DeleteEnhMetaFile(m_hRightArrowDisabled);
00123     }
00124     if(m_hHomeArrow) {
00125         ::DeleteEnhMetaFile(m_hHomeArrow);
00126     }
00127     if(m_hHomeArrowDisabled) {
00128         ::DeleteEnhMetaFile(m_hHomeArrowDisabled);
00129     }
00130     if(m_hEndArrow) {
00131         ::DeleteEnhMetaFile(m_hEndArrow);
00132     }
00133     if(m_hEndArrowDisabled) {
00134         ::DeleteEnhMetaFile(m_hEndArrowDisabled);
00135     }
00136     while(!m_TabList.IsEmpty()) {
00137         CString* pItem = m_TabList.RemoveTail();
00138         _delete(pItem);
00139     }
00140     while(!m_TabTipList.IsEmpty()) {
00141         CString* pItem = m_TabTipList.RemoveTail();
00142         _delete(pItem);
00143     }
00144
00145     // fix potential resource leak - KStowell - 10-21-99
00146     m_Font.DeleteObject();
00147     m_BoldFont.DeleteObject();
00148 }
00149
00150 void CCJFlatTabCtrl::CreateTabFont(const int iTabHeight)
00151 {
00152     int iHeight = -(iTabHeight - 6);
00153
00154     m_Font.DeleteObject();
00155     m_Font.CreateFont(iHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
00156         OUT_STROKE_PRECIS, CLIP_STROKE_PRECIS, PROOF_QUALITY, FF_SWISS, NULL);
00157
00158     m_BoldFont.DeleteObject();
00159     m_BoldFont.CreateFont(iHeight, 0, 0, 0, FW_EXTRABOLD, FALSE, FALSE, FALSE, ANSI_CHARSET,
00160         OUT_STROKE_PRECIS, CLIP_STROKE_PRECIS, PROOF_QUALITY, FF_SWISS, NULL);
00161 }
00162
00163 int CCJFlatTabCtrl::GetTabWidth(const int nItem) const
00164 {
00165     CDC dc;
00166     dc.CreateCompatibleDC(NULL);
00167     CFont* pOldFont = dc.SelectObject((CFont*)&m_BoldFont);
00168     CSize size(dc.GetTextExtent(*m_TabList.GetAt(m_TabList.FindIndex(nItem))));
00169
00170     // fix potential resource leak - KStowell - 10-20-99.
00171     dc.SelectObject(pOldFont);
00172     dc.DeleteDC();
00173
00174     return size.cx + m_iClientHeight + (m_iClientHeight / 2);
00175 }
00176
00177 int CCJFlatTabCtrl::GetTotalTabWidth(void) const
00178 {
00179     int iWidth = 0;
00180     for (int i = 0; i < m_TabList.GetCount(); i++)
00181     {
00182         iWidth += GetTabWidth(i);
00183         if (i != m_TabList.GetCount()-1) {
00184             iWidth -= (m_iClientHeight / 2);
00185         }
00186     }
00187     return iWidth + 2;
00188 }
00189
00190 int CCJFlatTabCtrl::GetTotalArrowWidth(void) const
00191 {
00192     int iWidth = 1;
00193     if (m_bHasArrows)
00194         iWidth += 32;
00195     if (m_bHasHomeEnd)
00196         iWidth += 32;
00197     return iWidth;
00198 }
00199
00200 void CCJFlatTabCtrl::InvalidateTabs(void)
00201 {
00202     if (GetSafeHwnd())
00203     {
00204         // invalidate the visible tab area
00205         // to minimise flicker - don't erase the background
00206         CRect rcTabs;
00207
00208         rcTabs.left = GetTotalArrowWidth();
00209         rcTabs.top = 0;
00210         rcTabs.right = rcTabs.left + (m_iTotalTabWidth - m_iXOffset);
00211         rcTabs.bottom = m_iClientHeight;
00212         InvalidateRect(&rcTabs, false);
00213         // invalidate the blank area to the right of the tabs
00214         if (rcTabs.right < m_iClientWidth)
00215         {
00216             rcTabs.left = rcTabs.right;
00217             rcTabs.right = m_iClientWidth;
00218             InvalidateRect(&rcTabs, true);
00219         }
00220     }
00221 }
00222
00223 void CCJFlatTabCtrl::EnableButtons(void)
00224 {
00225     if (m_bHasArrows)  //TCC: ADDED to handle situations where ther are no arrows
00226     {
00227         m_pLeftButton->EnableWindow(m_iXOffset);
00228         if (m_iClientWidth + m_iXOffset < m_iTotalTabWidth + GetTotalArrowWidth() + 1)
00229             m_pRightButton->EnableWindow(true);
00230         else
00231             m_pRightButton->EnableWindow(false);
00232         if (m_bHasHomeEnd)
00233         {
00234             m_pHomeButton->EnableWindow(m_iXOffset);
00235             m_pEndButton->EnableWindow(m_pRightButton->IsWindowEnabled());
00236         }
00237     }
00238 }
00239
00240 int CCJFlatTabCtrl::DrawTab(CDC &dc, const int x, const int y, const int iHeight, bool bSelected, bool bBottom, LPCTSTR lpszTab) const
00241 {
00242     CFont* pOldFont = dc.SelectObject((CFont*)&m_BoldFont);
00243     CSize size(dc.GetTextExtent(lpszTab));
00244     CRect rcText;
00245     rcText.left = iHeight + x - 4;
00246     rcText.top = 2 + y;
00247     rcText.right = size.cx + iHeight + x - 4;
00248     rcText.bottom = size.cy + 2 + y;
00249
00250     int iHalf = iHeight / 2;
00251     int iWidth = iHeight + iHalf;
00252
00253     COLORREF crBack;
00254     COLORREF crFore;
00255     if (bSelected) {
00256         crBack = GetSysColor(COLOR_WINDOW);
00257         crFore = GetSysColor(COLOR_WINDOWTEXT);
00258     } else {
00259         crBack = GetSysColor(COLOR_3DFACE);
00260         crFore = GetSysColor(COLOR_BTNTEXT);
00261     }
00262
00263     CPen penOutline(PS_SOLID, 1, GetSysColor(COLOR_BTNTEXT));
00264     CPen penShadow(PS_SOLID, 1, GetSysColor(COLOR_3DSHADOW));
00265     CBrush brush;
00266     brush.CreateSolidBrush(crBack);
00267
00268     POINT points[4];
00269     points[0].x = x;                     points[0].y = iHeight + y - 1;
00270     points[1].x = iHalf + x;             points[1].y = y;
00271     points[2].x = size.cx + iHeight + x; points[2].y = y;
00272     points[3].x = size.cx + iWidth + x;  points[3].y = iHeight + y - 1;
00273
00274     if (bBottom) {
00275         // swap vertical coordinates
00276         points[0].y = points[1].y;
00277         points[2].y = points[3].y;
00278         points[1].y = points[2].y;
00279         points[3].y = points[0].y;
00280     }
00281
00282     CPen* pOldPen = dc.SelectObject(&penOutline);
00283     dc.SetBkColor(crBack);
00284     CBrush* pOldBrush = dc.SelectObject(&brush);
00285     dc.Polygon(points, 4);
00286     dc.SelectObject(bSelected ? (CFont*)&m_BoldFont : (CFont*)&m_Font);
00287     dc.SetTextColor(crFore);
00288     dc.DrawText(lpszTab, rcText, DT_CENTER);
00289     dc.SelectObject(&penShadow);
00290
00291     if (bSelected) {
00292         dc.MoveTo(iHalf + x + 1, points[1].y);
00293         dc.LineTo(size.cx + iHeight + x, points[1].y);
00294         CPen penBack(PS_SOLID, 1, crBack);
00295         dc.SelectObject(&penBack);
00296         dc.MoveTo(x + 1, points[0].y);
00297         dc.LineTo(size.cx + iWidth + x, points[0].y);
00298     } else {
00299         dc.MoveTo(iHalf + x + 1, points[1].y);
00300         dc.LineTo(size.cx + iHeight + x - 1, points[1].y);
00301         dc.LineTo(size.cx + iWidth + x - 1, points[0].y);
00302     }
00303
00304     // fix potential resource leak - KStowell - 10-21-99
00305     dc.SelectObject(pOldFont);
00306     dc.SelectObject(pOldPen);
00307     dc.SelectObject(pOldBrush);
00308     penOutline.DeleteObject();
00309     penShadow.DeleteObject();
00310     brush.DeleteObject();
00311
00312     return size.cx + iWidth;
00313 }
00314
00315 BOOL CCJFlatTabCtrl::InsertItem(const int nItem, LPCTSTR lpszItem)
00316 {
00317     if (nItem < 0 || nItem > m_TabList.GetCount())
00318         return -1;
00319
00320     // add tab to our list
00321     CString* pItem = new CString;
00322     ASSERT(pItem);
00323
00324     *pItem = lpszItem;
00325     m_TabList.AddTail(pItem);
00326
00327     // PGB - Add the tabs tip text to the list
00328
00329     CString* pTipItem = new CString;
00330     ASSERT(pTipItem);
00331
00332     *pTipItem = lpszItem;
00333     m_TabTipList.AddTail(pTipItem);
00334
00335     //
00336
00337     if (m_TabList.GetCount() == 1)
00338         m_iCurSel = 0;
00339
00340     m_iTotalTabWidth = GetTotalTabWidth();      // PGB - Recalculate the total tab width now we have added a new item
00341
00342     EnableButtons();
00343     InvalidateTabs();
00344
00345     return nItem;
00346 }
00347
00348 BOOL CCJFlatTabCtrl::DeleteItem(int nItem)
00349 {
00350     if (nItem < 0 || nItem >= m_TabList.GetCount())
00351         return FALSE;
00352
00353     POSITION pos = m_TabList.FindIndex(nItem);
00354     ASSERT(pos);
00355
00356     CString* pItem = m_TabList.GetAt(pos);
00357     m_TabList.RemoveAt(pos);
00358     _delete(pItem);
00359
00360     // PGB - Stole the following code from the OnLButtonDown() function
00361     // in order to cause the tab control to show the newly selected item
00362     // after deleting an item from the list
00363
00364     // warn parent that the selection is about to change
00365     int id = GetDlgCtrlID();
00366     NMHDR hdr;
00367     hdr.hwndFrom = m_hWnd;
00368     hdr.idFrom = id;
00369     hdr.code = TCN_SELCHANGING;
00370     if (GetParent()->SendMessage(WM_NOTIFY, id, (LPARAM)&hdr) == 0)
00371     {
00372         if (m_iCurSel >= m_TabList.GetCount())
00373         {
00374             SetCurSel(m_TabList.GetCount() - 1); // PGB - Reset the currently selected tab to the last one in the list
00375             InvalidateTabs();
00376         }
00377
00378         // notify parent that the selection has changed
00379         hdr.hwndFrom = m_hWnd;
00380         hdr.idFrom = id;
00381         hdr.code = TCN_SELCHANGE;
00382         GetParent()->SendMessage(WM_NOTIFY, id, (LPARAM)&hdr);
00383     }
00384
00385     m_iTotalTabWidth = GetTotalTabWidth();      // PGB - Recalculate the total tab width now we have deleted an item
00386
00387     EnableButtons();
00388     InvalidateTabs();
00389
00390     return TRUE;
00391 }
00392
00393 BOOL CCJFlatTabCtrl::DeleteAllItems()
00394 {
00395     while(!m_TabList.IsEmpty()) {
00396         CString* pItem = m_TabList.RemoveTail();
00397         _delete(pItem);
00398     }
00399
00400     while(!m_TabTipList.IsEmpty()) {
00401         CString* pItem = m_TabTipList.RemoveTail();
00402         _delete(pItem);
00403     }
00404
00405     m_iCurSel = -1;                             // PGB - Reset the currently selected tab to -1 as we have no tabs in our list now.
00406
00407     m_iTotalTabWidth = GetTotalTabWidth();      // PGB - Recalculate the total tab width now we have deleted all items
00408
00409     EnableButtons();
00410     InvalidateTabs();
00411
00412     return TRUE;
00413 }
00414
00415 BOOL CCJFlatTabCtrl::GetItemRect(int nItem, LPRECT lpRect)
00416 {
00417     if (nItem < 0 || nItem >= m_TabList.GetCount())
00418         return FALSE;
00419
00420     int x = GetTotalArrowWidth();
00421     for (int i = 0; i < nItem; i++)
00422     {
00423         x += GetTabWidth(i);
00424         if (i != m_TabList.GetCount())
00425             x -= (m_iClientHeight / 2) + 2;
00426     }
00427     lpRect->left = x - m_iXOffset;
00428     lpRect->top = 0;
00429     lpRect->right = lpRect->left + GetTabWidth(nItem);
00430     lpRect->bottom = m_iClientHeight;
00431     return TRUE;
00432 }
00433
00434 int CCJFlatTabCtrl::HitTest(TCHITTESTINFO *pHitTestInfo) const
00435 {
00436     // ignore hits on the buttons
00437     int iHitX = pHitTestInfo->pt.x;
00438     if (iHitX < GetTotalArrowWidth())
00439         return -1;
00440
00441     // check if any tabs were hit
00442     int x = GetTotalArrowWidth() - m_iXOffset;
00443     for (int i = 0; i < m_TabList.GetCount(); i++)
00444     {
00445         int iTabWidth = GetTabWidth(i);
00446         if (i != m_TabList.GetCount())
00447             iTabWidth -= (m_iClientHeight / 2) + 2;
00448         if ((x <= iHitX) && (iHitX <= x + iTabWidth))
00449             return i;
00450         x += iTabWidth;
00451     }
00452
00453     // hit point is right of rightmost tab
00454     return -1;
00455 }
00456
00457 int CCJFlatTabCtrl::SetCurSel(int nItem)
00458 {
00459     if (nItem < 0 || nItem >= m_TabList.GetCount())
00460         return -1;
00461
00462     int iPrevSel = m_iCurSel;
00463     m_iCurSel = nItem;
00464
00465     // test if we need to center on the selected tab
00466     CRect rcItem;
00467     if (GetItemRect(nItem, &rcItem))
00468     {
00469         // test if the tab is off on the left
00470         int iTotalArrowWidth = GetTotalArrowWidth();
00471         rcItem.left -= iTotalArrowWidth;
00472         if (rcItem.left < 0)
00473             m_iXOffset += rcItem.left;
00474         else
00475         {
00476             // test if the tab is off on the right
00477             rcItem.right -= iTotalArrowWidth;
00478             int iTabAreaWidth = m_iClientWidth - iTotalArrowWidth;
00479             if (rcItem.right > iTabAreaWidth)
00480                 m_iXOffset += (rcItem.right - iTabAreaWidth);
00481         }
00482     }
00483
00484     EnableButtons();
00485     InvalidateTabs();
00486
00487     return iPrevSel;
00488 }
00489
00490 BEGIN_MESSAGE_MAP(CCJFlatTabCtrl, CWnd)
00491     //{{AFX_MSG_MAP(CCJFlatTabCtrl)
00492     ON_WM_PAINT()
00493     ON_WM_LBUTTONDOWN()
00494     ON_WM_SIZE()
00495     ON_WM_CREATE()
00496     ON_BN_CLICKED(IDC_LEFTBUTTON, OnLeftArrow)
00497     ON_BN_CLICKED(IDC_RIGHTBUTTON, OnRightArrow)
00498     ON_BN_CLICKED(IDC_HOMEBUTTON, OnHomeArrow)
00499     ON_BN_CLICKED(IDC_ENDBUTTON, OnEndArrow)
00500     //}}AFX_MSG_MAP
00501 END_MESSAGE_MAP()
00502
00504 // CCJFlatTabCtrl message handlers
00505
00506 BOOL CCJFlatTabCtrl::PreCreateWindow(CREATESTRUCT& cs)
00507 {
00508     if (!CWnd::PreCreateWindow(cs))
00509         return FALSE;
00510
00511     cs.lpszClass = AfxRegisterWndClass(CS_DBLCLKS,
00512             ::LoadCursor(NULL, IDC_ARROW), NULL, NULL);
00513
00514     return TRUE;
00515 }
00516
00517 BOOL CCJFlatTabCtrl::PreTranslateMessage(MSG* pMsg)
00518 {
00519     ASSERT_VALID(this);
00520
00521     if (::IsWindow(m_ToolTip.m_hWnd))
00522                                                                                                                                                                                                                                                                                                                                                                                                                            {
00523         if(pMsg->message == WM_MOUSEMOVE && pMsg->hwnd == m_hWnd)
00524         {
00525             CPoint Point(LOWORD(pMsg->lParam), HIWORD(pMsg->lParam));
00526
00527             TCHITTESTINFO test;
00528             test.pt = Point;
00529             int iTab = HitTest(&test);
00530
00531             if (iTab >= 0)
00532             {
00533                 CString strText;
00534
00535                 strText = (LPCTSTR) *m_TabTipList.GetAt(m_TabTipList.FindIndex(iTab));
00536
00537                 TRACE2("Mouse over tab %d : %s\n", iTab, strText);
00538
00539                 m_ToolTip.UpdateTipText(strText, this);
00540                 m_ToolTip.RelayEvent(pMsg);
00541             } else  {
00542                 // VC5 compatibility - Kirk Stowell - 10-21-99
00543                 ::SendMessage(m_ToolTip.m_hWnd, TTM_POP, 0, 0L);
00544             }
00545         }
00546         else {
00547             // VC5 compatibility - Kirk Stowell - 10-21-99
00548             ::SendMessage(m_ToolTip.m_hWnd, TTM_POP, 0, 0L);
00549         }
00550     }
00551
00552     return CWnd::PreTranslateMessage(pMsg);
00553 }
00554
00555 void CCJFlatTabCtrl::OnPaint()
00556 {
00557     CPaintDC dc(this); // device context for painting
00558
00559     CBrush brush;
00560     brush.CreateSysColorBrush(COLOR_3DFACE);
00561     CPen penBlack(PS_SOLID, 1, RGB(0,0,0));
00562
00563     // draw the black line along the left of the control
00564     CPen* pOldPen = dc.SelectObject(&penBlack);
00565     dc.MoveTo(0, 0);
00566     dc.LineTo(0, m_iClientHeight);
00567
00568     // draw the black line along the top/bottom of the control
00569     int iTotalArrowWidth = GetTotalArrowWidth();
00570     int iEndOfTab = iTotalArrowWidth + m_iTotalTabWidth - m_iXOffset;
00571     dc.MoveTo(iEndOfTab, m_bTabsOnBottom ? 0 : m_iClientHeight - 1);
00572     dc.LineTo(m_iClientWidth, m_bTabsOnBottom ? 0 : m_iClientHeight - 1);
00573
00574     // fill the empty background area
00575     int iFillHeight = m_iClientHeight - (m_bTabsOnBottom ? 0 : 1);
00576     CRect rcBack(iEndOfTab, m_bTabsOnBottom ? 1 : 0, m_iClientWidth, iFillHeight);
00577     dc.FillRect(rcBack, &brush);
00578
00579     // create a bitmap of all the tabs
00580     CDC dcMem;
00581     dcMem.CreateCompatibleDC(NULL);
00582     CBitmap bitmap;
00583     bitmap.CreateCompatibleBitmap(&dc, m_iTotalTabWidth, m_iClientHeight);
00584     CBitmap* pOldBitmap = dcMem.SelectObject(&bitmap);
00585     CBrush* pOldBrush = dcMem.SelectObject(&brush);
00586     CRect rc(0, m_bTabsOnBottom ? 1 : 0, m_iTotalTabWidth, iFillHeight);
00587     dcMem.FillRect(rc, &brush);
00588
00589     int iOverlap = (m_iClientHeight / 2) + 2;
00590     int x = 0;
00591     int iSelX = 0;
00592     for (int i = 0; i < m_TabList.GetCount(); i++)
00593     {
00594         if (i != m_iCurSel)
00595             x += DrawTab(dcMem, x, 0, m_iClientHeight, false, m_bTabsOnBottom, *m_TabList.GetAt(m_TabList.FindIndex(i))) - iOverlap;
00596         else
00597         {
00598             iSelX = x;
00599             x += GetTabWidth(i) - iOverlap;
00600         }
00601     }
00602     if (m_iCurSel >= 0)
00603         DrawTab(dcMem, iSelX, 0, m_iClientHeight, true, m_bTabsOnBottom, *m_TabList.GetAt(m_TabList.FindIndex(m_iCurSel)));
00604
00605     // blit the bitmap onto the control
00606     dc.BitBlt(iTotalArrowWidth, 0, m_iClientWidth - iTotalArrowWidth, m_iClientHeight, &dcMem, m_iXOffset, 0, SRCCOPY);
00607
00608     // fix potential resource leak - KStowell - 10-21-99.
00609     dcMem.SelectObject(pOldPen);
00610     dcMem.SelectObject(pOldBitmap);
00611     dcMem.SelectObject(pOldBrush);
00612     dcMem.DeleteDC();
00613     brush.DeleteObject();
00614     penBlack.DeleteObject();
00615     bitmap.DeleteObject();
00616 }
00617
00618 void CCJFlatTabCtrl::OnLButtonDown(UINT nFlags, CPoint point)
00619 {
00620     // TODO: Add your message handler code here and/or call default
00621     TCHITTESTINFO test;
00622     test.pt = point;
00623     int iTab = HitTest(&test);
00624     if ((iTab != -1) && (iTab != m_iCurSel))
00625     {
00626         // warn parent that the selection is about to change
00627         int id = GetDlgCtrlID();
00628         NMHDR hdr;
00629         hdr.hwndFrom = m_hWnd;
00630         hdr.idFrom = id;
00631         hdr.code = TCN_SELCHANGING;
00632         if (GetParent()->SendMessage(WM_NOTIFY, id, (LPARAM)&hdr) == 0)
00633         {
00634             // parent has given permission for the selection to change
00635             SetCurSel(iTab);
00636             InvalidateTabs();
00637
00638             // notify parent that the selection has changed
00639             hdr.hwndFrom = m_hWnd;
00640             hdr.idFrom = id;
00641             hdr.code = TCN_SELCHANGE;
00642             GetParent()->SendMessage(WM_NOTIFY, id, (LPARAM)&hdr);
00643         }
00644     }
00645
00646     CWnd::OnLButtonDown(nFlags, point);
00647 }
00648
00649 void CCJFlatTabCtrl::OnSize(UINT nType, int cx, int cy)
00650 {
00651     CWnd::OnSize(nType, cx, cy);
00652
00653     // TODO: Add your message handler code here
00654     if (m_bHasHomeEnd) {
00655         m_pHomeButton->MoveWindow(1, 0, 16, cy);
00656         m_pLeftButton->MoveWindow(17, 0, 16, cy);
00657         m_pRightButton->MoveWindow(33, 0, 16, cy);
00658         m_pEndButton->MoveWindow(49, 0, 16, cy);
00659     } else {
00660         if (m_bHasArrows) { //TCC: ADDED to handle situations where ther are no arrows
00661             m_pLeftButton->MoveWindow(1, 0, 16, cy);
00662             m_pRightButton->MoveWindow(17, 0, 16, cy);
00663         }
00664     }
00665
00666     m_iClientWidth  = cx;
00667     m_iClientHeight = cy;
00668
00669     CreateTabFont(cy);
00670
00671     m_iTotalTabWidth = GetTotalTabWidth();
00672     EnableButtons();
00673 }
00674
00675 int CCJFlatTabCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
00676 {
00677     if (CWnd::OnCreate(lpCreateStruct) == -1)
00678         return -1;
00679
00680     // TODO: Add your specialized creation code here
00681     if (lpCreateStruct->style & FTS_BOTTOM) {
00682         m_bTabsOnBottom = true;
00683     }
00684
00685     if (lpCreateStruct->style & TCS_TOOLTIPS) {
00686         m_ToolTip.Create(this);
00687         m_ToolTip.Activate(TRUE);
00688         m_ToolTip.AddTool(this, _T("Flat Tab Tool Tip"));
00689         m_ToolTip.SendMessage(TTM_SETMAXTIPWIDTH, 0, SHRT_MAX); // Allow multiline tooltips
00690     }
00691
00692     if (lpCreateStruct->style & FTS_HASARROWS)
00693     {
00694         m_bHasArrows = true;
00695         POINT points[4];
00696         points[0].x = 100; points[0].y = 0;
00697         points[1].x = 0;   points[1].y = 50;
00698         points[2].x = 100; points[2].y = 100;
00699         points[3].x = 100; points[3].y = 0;
00700
00702         // This portion of the code was re-written to help eliminate a nasty resource
00703         // leak. It would seem that the CMetaFileDC was not freeing the GDI resources
00704         // completely whenever CMetaFileDC::CloseEnhanced() was called. This may be due
00705         // to a BUG in MFC or perhaps this class, in any event, this seems to resolve
00706         // the issue. - KStowell - 10-23-99.
00708         HPEN   hPen           = ::CreatePen( PS_SOLID, 1, RGB( 0,0,0 ));
00709         HPEN   hPenDisabled   = ::CreatePen( PS_SOLID, 1, RGB( 128,128,128 ));
00710         HBRUSH hBrush         = ::CreateSolidBrush( RGB( 0,0,0 ));
00711         HBRUSH hBrushDisabled = ::CreateSolidBrush( RGB( 128,128,128 ));;
00712
00713         // create left arrow metafile
00714         HDC hMetaDC      = ::CreateEnhMetaFile( NULL, NULL, NULL, NULL );
00715         HPEN hOldPen     = (HPEN)::SelectObject( hMetaDC, hPen );
00716         HBRUSH hOldBrush = (HBRUSH)::SelectObject( hMetaDC, hBrush );
00717         ::Polygon( hMetaDC, points, 4 );
00718         ::SelectObject( hMetaDC, hOldPen );
00719         ::SelectObject( hMetaDC, hOldBrush );
00720         m_hLeftArrow = ::CloseEnhMetaFile( hMetaDC );
00721
00722         // create disabled left arrow metafile
00723         hMetaDC   = ::CreateEnhMetaFile( NULL, NULL, NULL, NULL );
00724         hOldPen   = (HPEN)::SelectObject( hMetaDC, hPenDisabled );
00725         hOldBrush = (HBRUSH)::SelectObject( hMetaDC, hBrushDisabled );
00726         ::Polygon( hMetaDC, points, 4 );
00727         ::SelectObject( hMetaDC, hOldPen );
00728         ::SelectObject( hMetaDC, hOldBrush );
00729         m_hLeftArrowDisabled = ::CloseEnhMetaFile( hMetaDC );
00730
00731         points[0].x = 0;   points[0].y = 0;
00732         points[1].x = 100; points[1].y = 50;
00733         points[2].x = 0;   points[2].y = 100;
00734         points[3].x = 0;   points[3].y = 0;
00735
00736         // create right arrow metafile
00737         hMetaDC   = ::CreateEnhMetaFile( NULL, NULL, NULL, NULL );
00738         hOldPen   = (HPEN)::SelectObject( hMetaDC, hPen );
00739         hOldBrush = (HBRUSH)::SelectObject( hMetaDC, hBrush );
00740         ::Polygon( hMetaDC, points, 4 );
00741         ::SelectObject( hMetaDC, hOldPen );
00742         ::SelectObject( hMetaDC, hOldBrush );
00743         m_hRightArrow = ::CloseEnhMetaFile( hMetaDC );
00744
00745         // create disabled right arrow metafile
00746         hMetaDC   = ::CreateEnhMetaFile( NULL, NULL, NULL, NULL );
00747         hOldPen   = (HPEN)::SelectObject( hMetaDC, hPenDisabled );
00748         hOldBrush = (HBRUSH)::SelectObject( hMetaDC, hBrushDisabled );
00749         ::Polygon( hMetaDC, points, 4 );
00750         ::SelectObject( hMetaDC, hOldPen );
00751         ::SelectObject( hMetaDC, hOldBrush );
00752         m_hRightArrowDisabled = ::CloseEnhMetaFile( hMetaDC );
00753
00754         CRect rcButton(0, 0, 16, 16);
00755         m_pLeftButton = new CCJMetaFileButton;
00756         m_pLeftButton->Create(NULL, WS_CHILD | WS_VISIBLE | WS_DISABLED | BS_OWNERDRAW, rcButton, this, IDC_LEFTBUTTON);
00757         m_pLeftButton->SetMetaFiles(m_hLeftArrow, 0, 0, m_hLeftArrowDisabled);
00758
00759         m_pRightButton = new CCJMetaFileButton;
00760         m_pRightButton->Create(NULL, WS_CHILD | WS_VISIBLE | WS_DISABLED | BS_OWNERDRAW, rcButton, this, IDC_RIGHTBUTTON);
00761         m_pRightButton->SetMetaFiles(m_hRightArrow, 0, 0, m_hRightArrowDisabled);
00762
00763         if (lpCreateStruct->style & FTS_HASHOMEEND)
00764         {
00765             m_bHasHomeEnd = true;
00766
00767             // Setup the Home arrow button
00768             points[0].x = 100;   points[0].y = 0;
00769             points[1].x = 0;     points[1].y = 50;
00770             points[2].x = 100;   points[2].y = 100;
00771             points[3].x = 100;   points[3].y = 0;
00772
00773             // create right arrow metafile
00774             HDC hMetaDC      = ::CreateEnhMetaFile( NULL, NULL, NULL, NULL );
00775             HPEN hOldPen     = (HPEN)::SelectObject( hMetaDC, hPen );
00776             HBRUSH hOldBrush = (HBRUSH)::SelectObject( hMetaDC, hBrush );
00777             ::Polygon( hMetaDC, points, 4 );
00778             ::MoveToEx( hMetaDC, 0, 0, NULL );
00779             ::LineTo( hMetaDC, 0, 100 );
00780             ::SelectObject( hMetaDC, hOldPen );
00781             ::SelectObject( hMetaDC, hOldBrush );
00782             m_hHomeArrow = ::CloseEnhMetaFile( hMetaDC );
00783
00784             // create disabled right arrow metafile
00785             hMetaDC   = ::CreateEnhMetaFile( NULL, NULL, NULL, NULL );
00786             hOldPen   = (HPEN)::SelectObject( hMetaDC, hPenDisabled );
00787             hOldBrush = (HBRUSH)::SelectObject( hMetaDC, hBrushDisabled );
00788             ::Polygon( hMetaDC, points, 4 );
00789             ::MoveToEx( hMetaDC, 0, 0, NULL );
00790             ::LineTo( hMetaDC, 0, 100 );
00791             ::SelectObject( hMetaDC, hOldPen );
00792             ::SelectObject( hMetaDC, hOldBrush );
00793             m_hHomeArrowDisabled = ::CloseEnhMetaFile( hMetaDC );
00794
00795             m_pHomeButton = new CCJMetaFileButton;
00796             m_pHomeButton->Create(NULL, WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, rcButton, this, IDC_HOMEBUTTON);
00797             m_pHomeButton->SetMetaFiles(m_hHomeArrow, 0, 0, m_hHomeArrowDisabled);
00798
00799             // Setup the End arrow button
00800             points[0].x = 0;   points[0].y = 0;
00801             points[1].x = 100; points[1].y = 50;
00802             points[2].x = 0;   points[2].y = 100;
00803             points[3].x = 0;   points[3].y = 0;
00804
00805             // create right arrow metafile
00806             hMetaDC   = ::CreateEnhMetaFile( NULL, NULL, NULL, NULL );
00807             hOldPen   = (HPEN)::SelectObject( hMetaDC, hPen );
00808             hOldBrush = (HBRUSH)::SelectObject( hMetaDC, hBrush );
00809             ::Polygon( hMetaDC, points, 4 );
00810             ::MoveToEx( hMetaDC, 100, 0, NULL );
00811             ::LineTo( hMetaDC, 100, 100 );
00812             ::SelectObject( hMetaDC, hOldPen );
00813             ::SelectObject( hMetaDC, hOldBrush );
00814             m_hEndArrow = ::CloseEnhMetaFile( hMetaDC );
00815
00816             // create disabled right arrow metafile
00817             hMetaDC   = ::CreateEnhMetaFile( NULL, NULL, NULL, NULL );
00818             hOldPen   = (HPEN)::SelectObject( hMetaDC, hPenDisabled );
00819             hOldBrush = (HBRUSH)::SelectObject( hMetaDC, hBrushDisabled );
00820             ::Polygon( hMetaDC, points, 4 );
00821             ::MoveToEx( hMetaDC, 100, 0, NULL );
00822             ::LineTo( hMetaDC, 100, 100 );
00823             ::SelectObject( hMetaDC, hOldPen );
00824             ::SelectObject( hMetaDC, hOldBrush );
00825             m_hEndArrowDisabled = ::CloseEnhMetaFile( hMetaDC );
00826
00827             m_pEndButton = new CCJMetaFileButton;
00828             m_pEndButton->Create(NULL, WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, rcButton, this, IDC_ENDBUTTON);
00829             m_pEndButton->SetMetaFiles(m_hEndArrow, 0, 0, m_hEndArrowDisabled);
00830
00831             m_pHomeButton->MoveWindow(1, 0, 16, 16);
00832             m_pLeftButton->MoveWindow(17, 0, 16, 16);
00833             m_pRightButton->MoveWindow(33, 0, 16, 16);
00834             m_pEndButton->MoveWindow(49, 0, 16, 16);
00835
00836         } else {
00837             m_pLeftButton->MoveWindow(1, 0, 16, 16);
00838             m_pRightButton->MoveWindow(17, 0, 16, 16);
00839         }
00840
00841         // fix potential resource leak - KStowell - 10-23-99
00842         ::DeleteObject(hPen);
00843         ::DeleteObject(hPenDisabled);
00844         ::DeleteObject(hBrush);
00845         ::DeleteObject(hBrushDisabled);
00846     }
00847
00848     return 0;
00849 }
00850
00851 void CCJFlatTabCtrl::OnLeftArrow()
00852 {
00853     // Move the tabs right, ensuring that we move right by one
00854     // whole tab each time ala Microsoft Access
00855
00856     CPoint Point(GetTotalArrowWidth()+1, 1);
00857
00858     TCHITTESTINFO test;
00859     test.pt = Point;
00860     int iTab = HitTest(&test);
00861
00862     if (iTab != -1)
00863     {
00864         m_iXOffset = 0;
00865         for (int iLoop = 0; iLoop <= iTab - 1; iLoop++)
00866         {
00867             RECT rect;
00868             if (GetItemRect(iLoop, &rect))
00869             {
00870                 m_iXOffset += rect.left;
00871             }
00872         }
00873         m_iXOffset -= GetTotalArrowWidth();
00874
00875         EnableButtons();
00876         InvalidateTabs();
00877     }
00878 }
00879
00880 void CCJFlatTabCtrl::OnRightArrow()
00881 {
00882     // Move the tabs left, ensuring that we move left by one
00883     // whole tab each time ala Microsoft Access
00884
00885     CPoint Point(GetTotalArrowWidth()+1, 1);
00886
00887     TCHITTESTINFO test;
00888     test.pt = Point;
00889     int iTab = HitTest(&test);
00890
00891     if (iTab != -1)
00892     {
00893         m_iXOffset = 0;
00894         for (int iLoop = 0; iLoop <= iTab + 1; iLoop++)
00895         {
00896             RECT rect;
00897             if (GetItemRect(iLoop, &rect))
00898             {
00899                 m_iXOffset += rect.left;
00900             }
00901         }
00902         m_iXOffset -= GetTotalArrowWidth();
00903
00904         EnableButtons();
00905         InvalidateTabs();
00906     }
00907 }
00908
00909 void CCJFlatTabCtrl::OnHomeArrow()
00910 {
00911     // TODO: Add your control notification handler code here
00912     m_iXOffset = 0;
00913     EnableButtons();
00914     InvalidateTabs();
00915 }
00916
00917 void CCJFlatTabCtrl::OnEndArrow()
00918 {
00919     // TODO: Add your control notification handler code here
00920     m_iXOffset = m_iTotalTabWidth + GetTotalArrowWidth() - m_iClientWidth + 1;
00921     EnableButtons();
00922     InvalidateTabs();
00923 }
00924
00925 void CCJFlatTabCtrl::SetTipText(int nItem, LPCTSTR lpszTabTip)
00926 {
00927     if (nItem < m_TabList.GetCount())
00928     {
00929         for (int i = 0; i < m_TabList.GetCount(); i++)
00930         {
00931             if (i == nItem)
00932             {
00933                 CString *pTipItem = m_TabTipList.GetAt(m_TabTipList.FindIndex(nItem));
00934
00935                 *pTipItem = lpszTabTip;
00936
00937                 break;
00938             }
00939         }
00940     }
00941
00942     return;
00943 }
00944
00945 CString CCJFlatTabCtrl::GetTipText(int nItem)
00946 {
00947     CString strText;
00948
00949     if (nItem < m_TabList.GetCount())
00950     {
00951         for (int i = 0; i < m_TabList.GetCount(); i++)
00952         {
00953             if (i == nItem)
00954             {
00955                 strText = *m_TabTipList.GetAt(m_TabTipList.FindIndex(nItem));
00956                 break;
00957             }
00958         }
00959     }
00960
00961     return strText;
00962 }
00963
00964 void CCJFlatTabCtrl::Home()
00965 {
00966     OnHomeArrow();
00967 }
Generated on Sun Feb 24 01:21:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJFontCombo.cpp Source File

WinCvs/CJLib/CJLibrary/CJFontCombo.cpp

Go to the documentation of this file.
00001
00002 // CJFontCombo.cpp : implementation file
00003 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00004 // See ReadMe.txt for TERMS OF USE.
00005 //
00006 // Based on the article 'Owner Drawn Font Selection ComboBox' by Girish Bharadwaj
00007 // http://www.codeguru.com/misc/font_selection_combo.shtml
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:49 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJock/CJLibrary/CJFontCombo.cpp $
00015  *
00016  * $History: CJFontCombo.cpp $
00017  *
00018  * *****************  Version 6  *****************
00019  * User: Kirk Stowell Date: 10/31/99   Time: 11:01p
00020  * Updated in $/CodeJock/CJLibrary
00021  * Overrode OnEraseBkgnd(...) and OnPaint() for flicker free drawing.
00022  *
00023  * *****************  Version 5  *****************
00024  * User: Kirk Stowell Date: 10/26/99   Time: 10:53p
00025  * Updated in $/CodeJock/CJLibrary
00026  * Added the DECLARE_DYNAMIC and IMPLEMENT_DYNAMIC macros to CCJFontCombo
00027  * for access to run-time information.
00028  *
00029  * *****************  Version 4  *****************
00030  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00031  * Updated in $/CodeJockey/CJLibrary
00032  * Updated copyright and contact information.
00033  *
00034  * *****************  Version 3  *****************
00035  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00036  * Updated in $/CodeJockey/CJLibrary
00037  * Added Unicode compliance, thanks to Barry Burton for his help with
00038  * this.
00039  *
00040  *
00041  * *****************  Version 2  *****************
00042  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00043  * Updated in $/CodeJockey/CJLibrary
00044  *
00045  * *****************  Version 1  *****************
00046  * User: Kirk Stowell Date: 7/26/99    Time: 2:11p
00047  * Created in $/CodeJockey/CJLibrary
00048  *
00049  ***************************************************************************/
00051
00052 #include "stdafx.h"
00053 #include "CJFontCombo.h"
00054
00055 #ifdef _DEBUG
00056 #define new DEBUG_NEW
00057 #undef THIS_FILE
00058 static char THIS_FILE[] = __FILE__;
00059 #endif
00060
00062 // CCJFontCombo
00063
00064 CCJFontCombo::CCJFontCombo()
00065 {
00066      m_clrHilight       = ::GetSysColor(COLOR_HIGHLIGHT);
00067      m_clrNormalText    = ::GetSysColor(COLOR_WINDOWTEXT);
00068      m_clrHilightText   = ::GetSysColor(COLOR_HIGHLIGHTTEXT);
00069      m_clrBkgnd         = ::GetSysColor(COLOR_WINDOW);
00070 }
00071
00072 CCJFontCombo::~CCJFontCombo()
00073 {
00074 }
00075
00076 IMPLEMENT_DYNAMIC(CCJFontCombo, CComboBox)
00077
00078 BEGIN_MESSAGE_MAP(CCJFontCombo, CComboBox)
00079     //{{AFX_MSG_MAP(CCJFontCombo)
00080     ON_WM_DESTROY()
00081     ON_WM_CREATE()
00082     ON_WM_ERASEBKGND()
00083     ON_WM_PAINT()
00084     //}}AFX_MSG_MAP
00085 END_MESSAGE_MAP()
00086
00088 // CCJFontCombo message handlers
00089
00090 void CCJFontCombo::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
00091 {
00092     CDC*      pDC      = CDC::FromHandle(lpDrawItemStruct->hDC);
00093     CRect     rect     = lpDrawItemStruct->rcItem;
00094     int       nState   = lpDrawItemStruct->itemState;
00095     int       nItem    = lpDrawItemStruct->itemID;
00096     LPLOGFONT pLogFont = (LPLOGFONT)lpDrawItemStruct->itemData;
00097
00098     pDC->SetBkMode( TRANSPARENT );
00099
00100     if( nState & ODS_SELECTED ) {
00101         pDC->FillSolidRect( rect, m_clrHilight );
00102         pDC->SetTextColor( m_clrHilightText );
00103     }
00104     else {
00105         pDC->FillSolidRect( rect, m_clrBkgnd );
00106         pDC->SetTextColor( m_clrNormalText );
00107     }
00108
00109     if( nItem >= 0 )
00110     {
00111         CString strText;
00112         GetLBText( nItem, strText );
00113
00114         CFont newFont;
00115         pLogFont->lfHeight = 90; //9 point size
00116         pLogFont->lfWidth  = 0;
00117         newFont.CreatePointFontIndirect( pLogFont );
00118
00119         CFont *pOldFont = pDC->SelectObject( &newFont );
00120         pDC->DrawText(strText, rect, DT_LEFT | DT_VCENTER | DT_SINGLELINE);
00121         pDC->SelectObject( pOldFont );
00122         newFont.DeleteObject();
00123     }
00124 }
00125
00126 void CCJFontCombo::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)
00127 {
00128     UNUSED_ALWAYS( lpMeasureItemStruct );
00129 }
00130
00131 void CCJFontCombo::InitializeFonts()
00132 {
00133     // Clear the combobox.
00134      ResetContent();
00135
00136      HDC hDC  = ::GetDC(m_hWnd);
00137      ::EnumFonts( hDC, NULL, (FONTENUMPROC)EnumFontProc, (LPARAM)this );//Enumerate
00138      ::ReleaseDC(m_hWnd, hDC);
00139 }
00140
00141 BOOL CALLBACK CCJFontCombo::EnumFontProc(LPLOGFONT lpLogFont, LPTEXTMETRIC lpTextMetric, short nFontType, LPHANDLE lpData)
00142 {
00143     UNUSED_ALWAYS( lpTextMetric );
00144
00145     if((nFontType == TRUETYPE_FONTTYPE) && (lpLogFont->lfCharSet != SYMBOL_CHARSET))
00146      {
00147          CCJFontCombo* pCombo = (CCJFontCombo*)lpData;
00148          ASSERT(pCombo);
00149
00150          int nIndex = pCombo->AddString(lpLogFont->lfFaceName);
00151          LPLOGFONT pLogFont = new LOGFONT;
00152
00153          ::CopyMemory((PVOID)pLogFont, (CONST VOID*)lpLogFont, (DWORD)sizeof( LOGFONT ));
00154          pCombo->SetItemData( nIndex, (DWORD)pLogFont );
00155      }
00156
00157      return TRUE;
00158 }
00159
00160 void CCJFontCombo::OnDestroy()
00161 {
00162     for( int nIndex = 0; nIndex <  GetCount(); ++nIndex ) {
00163         LPLOGFONT pLogFont = (LPLOGFONT)GetItemData(nIndex);
00164         _delete( pLogFont );
00165     }
00166
00167      CComboBox::OnDestroy();
00168 }
00169
00170 int CCJFontCombo::GetSelFont(LOGFONT& logFont)
00171 {
00172      int nIndex = GetCurSel ();
00173      if(nIndex != LB_ERR)
00174      {
00175         LPLOGFONT pLogFont = (LPLOGFONT)GetItemData(nIndex);
00176         ::CopyMemory((PVOID)&logFont, (CONST VOID*)pLogFont, sizeof(LOGFONT));
00177         return nIndex;
00178      }
00179
00180      return LB_ERR;
00181 }
00182
00183 int CCJFontCombo::OnCreate(LPCREATESTRUCT lpCreateStruct)
00184 {
00185     if (CComboBox::OnCreate(lpCreateStruct) == -1)
00186         return -1;
00187
00188     InitializeFonts();
00189     return 0;
00190 }
00191
00192 void CCJFontCombo::PreSubclassWindow()
00193 {
00194     CComboBox::PreSubclassWindow();
00195     InitializeFonts();
00196 }
00197
00198 BOOL CCJFontCombo::OnEraseBkgnd(CDC* pDC)
00199 {
00200     // KStowell - overridden for flicker-free drawing.
00201     UNUSED_ALWAYS(pDC);
00202     return TRUE;
00203 }
00204
00205 void CCJFontCombo::OnPaint()
00206 {
00207     CPaintDC dc(this); // device context for painting
00208
00209     // KStowell - Get the client rect.
00210     CRect rcClient, rcClip;
00211     dc.GetClipBox( &rcClip );
00212     GetClientRect( &rcClient );
00213
00214     // KStowell - Create a memory device-context. This is done to help reduce
00215     // screen flicker, since we will paint the entire control to the
00216     // off screen device context first.
00217     CDC memDC;
00218     CBitmap bitmap;
00219     memDC.CreateCompatibleDC(&dc);
00220     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00221     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00222
00223     // KStowell - Repaint the background.
00224     memDC.FillSolidRect(rcClient, ::GetSysColor(COLOR_WINDOW));
00225
00226     // let the control do its default drawing.
00227     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00228
00229     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00230     dc.BitBlt( rcClip.left, rcClip.top, rcClip.Width(), rcClip.Height(), &memDC,
00231         rcClip.left, rcClip.top, SRCCOPY );
00232
00233     // KStowell - Cleanup resources.
00234     memDC.SelectObject(pOldBitmap);
00235     memDC.DeleteDC();
00236     bitmap.DeleteObject();
00237 }
Generated on Sun Feb 24 01:21:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJFrameWnd.cpp Source File

WinCvs/CJLib/CJLibrary/CJFrameWnd.cpp

Go to the documentation of this file.
00001 // CJFrameWnd.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/CJLibrary/CJFrameWnd.cpp $
00011  *
00012  * $History: CJFrameWnd.cpp $
00013  *
00014  * *****************  Version 16  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:04p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Minor update to PreCreateWindow(...) for flicker free drawing.
00018  *
00019  * *****************  Version 15  *****************
00020  * User: Kirk Stowell Date: 10/29/99   Time: 12:43a
00021  * Updated in $/CodeJock/CJLibrary
00022  * Overloaded PreCreateWindow(...) for flicker free drawing.
00023  *
00024  * *****************  Version 14  *****************
00025  * User: Kirk Stowell Date: 10/14/99   Time: 6:15p
00026  * Updated in $/CodeJock/CJLibrary
00027  * Fixed bug with a document becomes the active document when the user
00028  * clicks inside a tab in the CCJTabControlBar to perform some operation.
00029  * When closing the application, MFC decides in CFrameWnd::OnClose() to
00030  * check if the 'active' document is modified before checking all other
00031  * documuents. If the active document is not modified and can close its
00032  * frame, it does not check other documents individually and shuts down
00033  * without asking the important 'modified save' questions. To fix this,
00034  * OnClose() was overriden to add a call to "SetActiveView(NULL)" just
00035  * before the base class OnClose is called. This will check all documents
00036  * asking the save question before closing the application. Thanks to
00037  * Simon Clark [spc@otleda.com] for help with this.
00038  *
00039  * *****************  Version 13  *****************
00040  * User: Kirk Stowell Date: 10/14/99   Time: 10:05a
00041  * Updated in $/CodeJock/CJLibrary
00042  * Overrode OnEraseBkgnd(...) to help to eliminate screen flicker.
00043  *
00044  * *****************  Version 12  *****************
00045  * User: Kirk Stowell Date: 9/16/99    Time: 2:35p
00046  * Updated in $/CodeJockey/CJLibrary
00047  * Fixed bug with save / restore bar state, and with saved bar size
00048  * changing whenever the application starts.
00049  *
00050  * *****************  Version 11  *****************
00051  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00052  * Updated in $/CodeJockey/CJLibrary
00053  * Updated copyright and contact information.
00054  *
00055  * *****************  Version 10  *****************
00056  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00057  * Updated in $/CodeJockey/CJLibrary
00058  *
00059  * *****************  Version 9  *****************
00060  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00061  * Updated in $/CodeJockey/CJLibrary
00062  *
00063  * *****************  Version 8  *****************
00064  * User: Kirk Stowell Date: 6/11/99    Time: 8:25p
00065  * Updated in $/CodeJockey/CJ60Lib
00066  * Slight modification made to popup menu code.
00067  *
00068  * *****************  Version 7  *****************
00069  * User: Kirk Stowell Date: 6/09/99    Time: 8:33p
00070  * Updated in $/CodeJockey/CJ60Lib
00071  * Ioannhs Stamatopoulos (Yiannhs) [ystamat@mail.datamedia.gr] - Extended
00072  * docking windows, removed ::GetSysColor(...) calls and WM_SYSCOLORCHANGE
00073  * message handler, this is now automatically handled by the base class.
00074  * Added redraw flags to the create method and modified paint and layout
00075  * handlers to reduce flicker and un-necessary command handling. Dragging
00076  * rect now reflects actual control bar docked size. Added "flat" look to
00077  * the control bars, the control bars can now use the classic DevStudio
00078  * look, or use flat gradient gripper, borders and frame buttons. Overall,
00079  * docking windows now handle dragging, docking and floating much better,
00080  * and behave more like DevStudio.
00081  *
00082  * *****************  Version 6  *****************
00083  * User: Kirk Stowell Date: 5/02/99    Time: 5:23p
00084  * Updated in $/CodeJockey/CJ60Lib
00085  * Further modifications for CCJMenu support.
00086  *
00087  * *****************  Version 5  *****************
00088  * User: Kirk Stowell Date: 5/02/99    Time: 2:18a
00089  * Updated in $/CodeJockey/CJ60Lib
00090  *
00091  * *****************  Version 4  *****************
00092  * User: Kirk Stowell Date: 5/02/99    Time: 2:13a
00093  * Updated in $/CodeJockey/CJ60Lib
00094  * Re-wrote CCJMenu initialization routines with a more cleaner approach.
00095  *
00096  * *****************  Version 3  *****************
00097  * User: Kirk Stowell Date: 4/03/99    Time: 4:47p
00098  * Updated in $/CodeJockey/CJ60Lib
00099  * Added comments and cleaned up code.  Added support for Brent Corkum's
00100  * BCMenu (CCJMenu), which is a replacement for the CCoolMenu class.
00101  *
00102  * *****************  Version 2  *****************
00103  * User: Kirk Stowell Date: 1/12/99    Time: 4:46p
00104  * Updated in $/CodeJockey/CJ60Lib
00105  * Total re-write to add side-by-side docking support for CCJControlBar
00106  * class.
00107  *
00108  * *****************  Version 1  *****************
00109  * User: Kirk Stowell Date: 10/17/98   Time: 4:46p
00110  * Created in $/CodeJockey/CJ60Lib
00111  * Initial re-write and release.
00112  *
00113  ***************************************************************************/
00115
00116 #include "stdafx.h"
00117 #include "CJFrameWnd.h"
00118 #include "CJDockBar.h"
00119 #include "CJSizeDockBar.h"
00120 #include "CJControlBar.h"
00121 #include "CJMiniDockFrameWnd.h"
00122 #include "CJToolBar.h"
00123
00124 #ifdef _DEBUG
00125 #define new DEBUG_NEW
00126 #undef THIS_FILE
00127 static char THIS_FILE[] = __FILE__;
00128 #endif
00129
00131 // CCJFrameWnd
00132
00133 CCJFrameWnd::CCJFrameWnd()
00134 {
00135
00136 }
00137
00138 CCJFrameWnd::~CCJFrameWnd()
00139 {
00140 }
00141
00142 IMPLEMENT_DYNCREATE(CCJFrameWnd, CFrameWnd)
00143
00144 BEGIN_MESSAGE_MAP(CCJFrameWnd, CFrameWnd)
00145     //{{AFX_MSG_MAP(CCJFrameWnd)
00146     ON_WM_MEASUREITEM()
00147     ON_WM_MENUCHAR()
00148     ON_WM_INITMENUPOPUP()
00149     ON_WM_CLOSE()
00150     //}}AFX_MSG_MAP
00151 END_MESSAGE_MAP()
00152
00154 // CCJFrameWnd message handlers
00155
00156 // dwDockBarMap
00157 DWORD CCJFrameWnd::dwDockBarMap[4][2] =
00158 {
00159     { AFX_IDW_DOCKBAR_TOP,      CBRS_TOP    },
00160     { AFX_IDW_DOCKBAR_BOTTOM,   CBRS_BOTTOM },
00161     { AFX_IDW_DOCKBAR_LEFT,     CBRS_LEFT   },
00162     { AFX_IDW_DOCKBAR_RIGHT,    CBRS_RIGHT  },
00163 };
00164
00165 void CCJFrameWnd::DockControlBarLeftOf(CControlBar* Bar, CControlBar* LeftOf)
00166 {
00167     CRect rect;
00168     DWORD dw;
00169     UINT n;
00170
00171     // get MFC to adjust the dimensions of all docked ToolBars
00172     // so that GetWindowRect will be accurate
00173     RecalcLayout(TRUE);
00174
00175     LeftOf->GetWindowRect(&rect);
00176     rect.OffsetRect(1,0);
00177     dw=LeftOf->GetBarStyle();
00178     n = 0;
00179     n = (dw&CBRS_ALIGN_TOP)              ? AFX_IDW_DOCKBAR_TOP      : n;
00180     n = (dw&CBRS_ALIGN_BOTTOM   && n==0) ? AFX_IDW_DOCKBAR_BOTTOM   : n;
00181     n = (dw&CBRS_ALIGN_LEFT     && n==0) ? AFX_IDW_DOCKBAR_LEFT     : n;
00182     n = (dw&CBRS_ALIGN_RIGHT    && n==0) ? AFX_IDW_DOCKBAR_RIGHT    : n;
00183
00184     // When we take the default parameters on rect, DockControlBar will dock
00185     // each Toolbar on a seperate line. By calculating a rectangle, we in effect
00186     // are simulating a Toolbar being dragged to that location and docked.
00187     DockControlBar(Bar,n,&rect);
00188 }
00189
00190 void CCJFrameWnd::EnableDocking(DWORD dwDockStyle)
00191 {
00192     // must be CBRS_ALIGN_XXX or CBRS_FLOAT_MULTI only
00193     ASSERT((dwDockStyle & ~(CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI)) == 0);
00194     CFrameWnd::EnableDocking(dwDockStyle);
00195
00196     for (int i = 0; i < 4; i++) {
00197         if (dwDockBarMap[i][1] & dwDockStyle & CBRS_ALIGN_ANY) {
00198             CDockBar* pDock = (CDockBar*)GetControlBar(dwDockBarMap[i][0]);
00199
00200             // make sure the dock bar is of correct type
00201             if( pDock || !pDock->IsKindOf(RUNTIME_CLASS(CCJDockBar)) ) {
00202                 BOOL bNeedDelete = ! pDock->m_bAutoDelete;
00203                 pDock->m_pDockSite->RemoveControlBar(pDock);
00204                 pDock->m_pDockSite = 0; // avoid problems in destroying the dockbar
00205                 pDock->DestroyWindow();
00206                 if( bNeedDelete )
00207                     delete pDock;
00208                 pDock = 0;
00209             }
00210
00211             if( pDock == 0 ) {
00212                 pDock = new CCJDockBar;
00213                 if (!pDock->Create(this,
00214                     WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_CHILD|WS_VISIBLE |
00215                     dwDockBarMap[i][1], dwDockBarMap[i][0])) {
00216                     AfxThrowResourceException();
00217                 }
00218             }
00219         }
00220     }
00221 }
00222
00223 void CCJFrameWnd::RecalcLayout(BOOL bNotify)
00224 {
00225     CFrameWnd::RecalcLayout(bNotify);
00226     RecalcAllExcept(NULL);
00227 }
00228
00229 // Yiannhs changed this
00230 void CCJFrameWnd::EnableDockingSizeBar(DWORD dwDockStyle, DockFlatBorders FlatFlags )
00231 {
00232     // must be CBRS_ALIGN_XXX or CBRS_FLOAT_MULTI only
00233     ASSERT((dwDockStyle & ~(CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI)) == 0);
00234
00235     m_pFloatingFrameClass = RUNTIME_CLASS(CCJMiniDockFrameWnd);
00236     for (int i = 0; i < 4; i++)
00237     {
00238         if (dwSizeBarMap[i][1] & dwDockStyle & CBRS_ALIGN_ANY)
00239         {
00240             CCJSizeDockBar* pDock = (CCJSizeDockBar*)GetControlBar(dwSizeBarMap[i][0]);
00241             if (pDock == NULL)
00242             {
00243                 pDock = new CCJSizeDockBar;
00244
00245                 if (!pDock->Create(this,
00246                     WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_CHILD|WS_VISIBLE |
00247                         dwSizeBarMap[i][1], dwSizeBarMap[i][0]))
00248                 {
00249                     AfxThrowResourceException();
00250                 }
00251                 //Yiannhs enable Flat Borders For dock Bars
00252                 pDock->FlatBorder( (FlatFlags >> i) & 0x0001 );
00253             }
00254         }
00255     }
00256 }
00257
00258 void CCJFrameWnd::RecalcAllExcept(CCJSizeDockBar *pBar)
00259 {
00260     for (int i = 0; i < 4; i++)
00261     {
00262         CCJSizeDockBar* pDock = (CCJSizeDockBar*)GetControlBar(dwSizeBarMap[i][0]);
00263         if (pDock != NULL && pDock != pBar)
00264         {
00265             pDock->CalcSizeBarLayout();
00266         }
00267     }
00268 }
00269
00270 void CCJFrameWnd::DockSizeBar(CControlBar * pBar,CCJSizeDockBar *pDockBar, LPRECT lpRect)
00271 {
00272     ASSERT(pBar != NULL);
00273     ASSERT(pBar->m_pDockContext != NULL);
00274
00275     if( pDockBar == NULL )
00276     {
00277         for (int i = 0; i < 4; i++)
00278         {
00279             if ((dwSizeBarMap[i][1] & CBRS_ALIGN_ANY) == (pBar->m_dwStyle & CBRS_ALIGN_ANY))
00280             {
00281                 pDockBar = (CCJSizeDockBar*)GetControlBar(dwSizeBarMap[i][0]);
00282                 ASSERT(pDockBar != NULL);
00283
00284                 int nSize = 0;
00285
00286                 switch(i)
00287                 {
00288                 case 0: // horizontal dock
00289                 case 1:
00290                     nSize = ((CCJControlBar*)pBar)->GetHorzSize();
00291                     break;
00292                 case 2: // vertical dock
00293                 case 3:
00294                     nSize = ((CCJControlBar*)pBar)->GetVertSize();
00295                     break;
00296                 }
00297
00298                 pDockBar->SetActualSize( nSize );
00299                 break;
00300             }
00301         }
00302     }
00303
00304     ASSERT(pDockBar != NULL);
00305     ASSERT(m_listControlBars.Find(pBar) != NULL);
00306     ASSERT(pBar->m_pDockSite == this);
00307     ((CCJControlBar*)pBar)->Normalize();
00308     pDockBar->DockControlBar(pBar, lpRect);
00309 }
00310
00311 HMENU CCJFrameWnd::NewMenu(UINT nMenuID, UINT nToolbarID)
00312 {
00313     // Load the menu and toolbar resource.
00314     m_menu.LoadMenu(nMenuID);
00315     if (nToolbarID) {
00316         m_menu.LoadToolbar(nToolbarID);
00317     }
00318
00319     // Detach the menu.
00320     return(m_menu.Detach());
00321 }
00322
00323 HMENU CCJFrameWnd::NewMenu(UINT nMenuID, UINT* nToolbarIDs, int nSize)
00324 {
00325     // Load the menu and toolbar resources.
00326     m_menu.LoadMenu(nMenuID);
00327     if (nToolbarIDs) {
00328         m_menu.LoadToolbars(nToolbarIDs, nSize);
00329     }
00330
00331     // Detach the menu.
00332     return(m_menu.Detach());
00333 }
00334
00335 BOOL CCJFrameWnd::InitializeMenu(UINT nMenuID, UINT nToolBarID/*=NULL*/)
00336 {
00337     ASSERT(nMenuID);     // must be valid.
00338
00339     // Get a pointer to the existing menu, and destroy it.
00340     CMenu* pMenu = GetMenu();
00341     ASSERT_VALID(pMenu);
00342     pMenu->DestroyMenu();
00343
00344     // Set the default menu with the newly created Menu.
00345     m_hMenuDefault = NewMenu(nMenuID, nToolBarID);
00346     SetMenu(CMenu::FromHandle(m_hMenuDefault));
00347
00348     return TRUE;
00349 }
00350
00351 BOOL CCJFrameWnd::InitializeMenu(UINT nMenuID, UINT* nToolbarIDs/*=NULL*/, int nSize/*=NULL*/)
00352 {
00353     ASSERT(nMenuID);     // must be valid.
00354
00355     // Get a pointer to the existing menu, and destroy it.
00356     CMenu* pMenu = GetMenu();
00357     ASSERT_VALID(pMenu);
00358     pMenu->DestroyMenu();
00359
00360     // Set the default menu with the newly created Menu.
00361     m_hMenuDefault = NewMenu(nMenuID, nToolbarIDs, nSize);
00362     SetMenu(CMenu::FromHandle(m_hMenuDefault));
00363
00364     return TRUE;
00365 }
00366
00367 void CCJFrameWnd::OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)
00368 {
00369     if (lpMeasureItemStruct->CtlType == ODT_MENU)
00370     {
00371         if (IsMenu((HMENU)lpMeasureItemStruct->itemID)) {
00372             CMenu* pMenu = CMenu::FromHandle((HMENU)lpMeasureItemStruct->itemID);
00373
00374             if(m_menu.IsMenu(pMenu)) {
00375                 m_menu.MeasureItem(lpMeasureItemStruct);
00376                 return;
00377             }
00378         }
00379     }
00380
00381     CFrameWnd::OnMeasureItem(nIDCtl, lpMeasureItemStruct);
00382 }
00383
00384 LRESULT CCJFrameWnd::OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu)
00385 {
00386     if(m_menu.IsMenu(pMenu)) {
00387         return CCJMenu::FindKeyboardShortcut(nChar, nFlags, pMenu);
00388     }
00389
00390     return CFrameWnd::OnMenuChar(nChar, nFlags, pMenu);
00391 }
00392
00393 void CCJFrameWnd::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu)
00394 {
00395     CFrameWnd::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
00396
00397     if(!bSysMenu)
00398     {
00399         if(m_menu.IsMenu(pPopupMenu)) {
00400             CCJMenu::UpdateMenu(pPopupMenu);
00401         }
00402     }
00403 }
00404
00405 BOOL CCJFrameWnd::PreTranslateMessage(MSG* pMsg)
00406 {
00407     if( m_wndMenuBar.GetSafeHwnd()) {
00408         if( m_wndMenuBar.TranslateFrameMessage(pMsg)) {
00409             return TRUE;
00410         }
00411     }
00412
00413     return CFrameWnd::PreTranslateMessage(pMsg);
00414 }
00415
00416 void CCJFrameWnd::LoadBarState(LPCTSTR lpszProfileName)
00417 {
00418     CCJSizeDockBar::m_bIsDockBar = true;
00419     CFrameWnd::LoadBarState(lpszProfileName);
00420     CCJSizeDockBar::m_bIsDockBar = false;
00421 }
00422
00423 void CCJFrameWnd::SaveBarState(LPCTSTR lpszProfileName) const
00424 {
00425     CCJSizeDockBar::m_bIsDockBar = true;
00426     CFrameWnd::SaveBarState(lpszProfileName);
00427     CCJSizeDockBar::m_bIsDockBar = false;
00428 }
00429
00430 void CCJFrameWnd::OnClose()
00431 {
00432     // Clear active view before close
00433     SetActiveView (NULL);
00434     CFrameWnd::OnClose();
00435 }
00436
00437 // Default implementation.
00438 BOOL CCJFrameWnd::PreCreateWindow(CREATESTRUCT& cs)
00439 {
00440     return CFrameWnd::PreCreateWindow(cs);
00441 }
00442
00444 // Overloaded for flicker-free drawing with no CS_VREDRAW and CS_HREDRAW.
00445 // Override in CMainFrame and call this method, rather than the default. Pass
00446 // in your apps icon resource usually IDR_MAINFRAME.
00447 //
00448 BOOL CCJFrameWnd::PreCreateWindow(CREATESTRUCT& cs, UINT nIconID)
00449 {
00450     // Register wnd class with no redraw, cursor (use default), background
00451     // brush and load your apps icon resource.
00452     cs.lpszClass = AfxRegisterWndClass( 0, NULL, NULL,
00453         AfxGetApp()->LoadIcon(nIconID));
00454     ASSERT(cs.lpszClass);
00455
00456     return CFrameWnd::PreCreateWindow(cs);
00457 }
Generated on Sun Feb 24 01:21:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJHexEdit.cpp Source File

WinCvs/CJLib/CJLibrary/CJHexEdit.cpp

Go to the documentation of this file.
00001 // CJHexEdit.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based on the article "HexEdit Control" by Andreas Saurwein [saurwein@uniwares.com]
00006 // http://www.codeguru.com/editctrl/hexeditctrl.shtml
00007 //
00009 /****************************************************************************
00010  *
00011  * $Date: 1999/11/30 21:45:49 $
00012  * $Revision: 1.1.1.1 $
00013  * $Archive: /CodeJock/CJLibrary/CJHexEdit.cpp $
00014  *
00015  * $History: CJHexEdit.cpp $
00016  *
00017  * *****************  Version 2  *****************
00018  * User: Kirk Stowell Date: 10/30/99   Time: 9:50p
00019  * Updated in $/CodeJock/CJLibrary
00020  *
00021  * *****************  Version 1  *****************
00022  * User: Kirk Stowell Date: 10/30/99   Time: 9:20p
00023  * Created in $/CodeJock/CJLibrary
00024  *
00025  ***************************************************************************/
00027
00028 #include "StdAfx.h"
00029 #include "CJResource.h"
00030 #include "CJHexEdit.h"
00031 #include <ctype.h>
00032 #include <afxole.h>
00033 #include <afxdisp.h>
00034
00035 #ifdef _DEBUG
00036 #define new DEBUG_NEW
00037 #undef THIS_FILE
00038 static char THIS_FILE[] = __FILE__;
00039 #endif
00040
00041 char hextable[16] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
00042 #define TOHEX(a, b) {*b++ = hextable[a >> 4];*b++ = hextable[a&0xf];}
00043
00045 // CCJHexEdit
00046
00047 CCJHexEdit::CCJHexEdit()
00048 {
00049     m_pData         = NULL;     // pointer to data
00050     m_length        = 0;        // length of data
00051     m_length        = 0x40;
00052     m_topindex      = 0;
00053     m_bpr           = 8;        // byte per row
00054     m_lpp           = 1;
00055
00056     m_bShowHex      = TRUE;
00057     m_bShowAscii    = TRUE;
00058     m_bShowAddress  = TRUE;
00059     m_bAddressIsWide= TRUE;     // 4/8 byte address
00060
00061     m_offAddress    = 0;
00062     m_offHex        = 0;
00063     m_offAscii      = 0;
00064
00065     m_bUpdate = TRUE;           // update font info
00066     m_bNoAddressChange = FALSE;
00067     m_currentMode = EDIT_NONE;
00068
00069     m_editPos.x = m_editPos.y = 0;
00070     m_currentAddress = 0;
00071     m_bHalfPage = TRUE;
00072
00073     m_selStart  = 0xffffffff;
00074     m_selEnd    = 0xffffffff;
00075
00076     m_Font.CreateFont(-12, 0,0,0,0,0,0,0,0,0,0,0,0, _T("Courier New"));
00077
00078     AfxOleInit();
00079 }
00080
00081 CCJHexEdit::~CCJHexEdit()
00082 {
00083     m_Font.DeleteObject();
00084 }
00085
00086 IMPLEMENT_DYNAMIC(CCJHexEdit, CEdit)
00087
00088 BEGIN_MESSAGE_MAP(CCJHexEdit, CEdit)
00089     //{{AFX_MSG_MAP(CCJHexEdit)
00090     ON_WM_CHAR()
00091     ON_WM_KILLFOCUS()
00092     ON_WM_PAINT()
00093     ON_WM_SETFOCUS()
00094     ON_WM_VSCROLL()
00095     ON_WM_GETDLGCODE()
00096     ON_WM_ERASEBKGND()
00097     ON_WM_LBUTTONDOWN()
00098     ON_WM_MOUSEMOVE()
00099     ON_WM_LBUTTONUP()
00100     ON_WM_KEYDOWN()
00101     ON_COMMAND(ID_EDIT_CLEAR, OnEditClear)
00102     ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
00103     ON_COMMAND(ID_EDIT_CUT, OnEditCut)
00104     ON_COMMAND(ID_EDIT_PASTE, OnEditPaste)
00105     ON_COMMAND(ID_EDIT_SELECT_ALL, OnEditSelectAll)
00106     ON_COMMAND(ID_EDIT_UNDO, OnEditUndo)
00107     ON_WM_CONTEXTMENU()
00108     ON_WM_HSCROLL()
00109     ON_WM_LBUTTONDBLCLK()
00110     //}}AFX_MSG_MAP
00111 END_MESSAGE_MAP()
00112
00114 // CCJHexEdit message handlers
00115
00116 void CCJHexEdit::OnPaint()
00117 {
00118     CPaintDC dc(this); // device context for painting
00119
00120     // KStowell - Get the client rect.
00121     CRect rcClient;
00122     GetClientRect( &rcClient );
00123
00124     // KStowell - Create a memory device-context. This is done to help reduce
00125     // screen flicker, since we will paint the entire control to the
00126     // off screen device context first.
00127     CDC memDC;
00128     CBitmap bitmap;
00129     memDC.CreateCompatibleDC(&dc);
00130     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00131     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00132
00133     // KStowell - Repaint the background.
00134     memDC.FillSolidRect( rcClient, ::GetSysColor(COLOR_WINDOW) );
00135
00136     ASSERT(m_currentAddress >= 0);
00137     ASSERT(m_topindex >= 0);
00138
00139     CFont* pOldFont = memDC.SelectObject(&m_Font);
00140     int     height      = 0;
00141     int     x,y;
00142     TCHAR   buf[256];
00143
00144     x = rcClient.TopLeft().x;
00145     y = rcClient.TopLeft().y;
00146
00147     memDC.SetBoundsRect(&rcClient, DCB_DISABLE);
00148
00149     if(m_pData)
00150     {
00151         //
00152         // get char dimensions
00153         //
00154         if(m_bUpdate)
00155         {
00156             memDC.GetCharWidth('0', '0', &m_nullWidth);
00157             CSize sz = memDC.GetTextExtent(_T("0"), 1);
00158             m_lineHeight = sz.cy;
00159
00160             m_offHex    = m_bShowAddress ? (m_bAddressIsWide ? m_nullWidth * 9 : m_nullWidth * 5) : 0;
00161             m_offAscii  = m_bShowAddress ? (m_bAddressIsWide ? m_nullWidth * 9 : m_nullWidth * 5) : 0;
00162             m_offAscii += m_bShowHex     ? (m_bpr * 3 * m_nullWidth) : 0;
00163
00164             m_lpp = rcClient.Height() / m_lineHeight;
00165             m_bHalfPage = FALSE;
00166             if(m_lpp * m_bpr > m_length)
00167             {
00168                 m_lpp = (m_length + (m_bpr/2)) / m_bpr ;
00169                 if(m_length % m_bpr != 0)
00170                 {
00171                     m_bHalfPage = TRUE;
00172                     m_lpp++;
00173                 }
00174             }
00175             m_bUpdate = FALSE;
00176             UpdateScrollbars();
00177         }
00178
00179         height = rcClient.Height() / m_lineHeight;
00180         height *= m_lineHeight;
00181
00182         if(m_bShowAddress)
00183         {
00184             TCHAR fmt[8] = {'%','0','8','l','X'};
00185             fmt[2] = m_bAddressIsWide ? '8' : '4';
00186             int w = m_bAddressIsWide ? 8 : 4;
00187             y = 0;
00188             CRect rcd = rcClient;
00189             rcd.TopLeft().x = m_offAddress;
00190             for(int  i = m_topindex; (i < m_length) && (rcd.TopLeft().y < height); i+= m_bpr)
00191             {
00192                 _stprintf(buf, fmt, i);
00193                 memDC.DrawText(buf, w, rcd, DT_LEFT|DT_TOP|DT_SINGLELINE|DT_NOPREFIX);
00194                 rcd.TopLeft().y += m_lineHeight;
00195             }
00196         }
00197         if(m_bShowHex)
00198         {
00199             y = 0;
00200             CRect rcd = rcClient;
00201             rcd.TopLeft().x = x = m_offHex;
00202
00203             if(m_selStart != 0xffffffff && (m_currentMode == EDIT_HIGH || m_currentMode == EDIT_LOW))
00204             {
00205                 int  i;
00206                 int  n = 0;
00207                 int  selStart = m_selStart, selEnd = m_selEnd;
00208                 if(selStart > selEnd)
00209                     selStart ^= selEnd ^= selStart ^= selEnd;
00210
00211                 for(i = m_topindex; (i < selStart) && (y < height); i++)
00212                 {
00213                     LPTSTR p = &buf[0];
00214
00215                     TOHEX(m_pData[i], p);
00216
00217                     *p++ = ' ';
00218                     memDC.TextOut(x, y, buf, 3);
00219                     x += m_nullWidth * 3;
00220                     n++;
00221                     if(n == m_bpr)
00222                     {
00223                         n = 0;
00224                         x = m_offHex;
00225                         y += m_lineHeight;
00226                     }
00227                 }
00228
00229                 memDC.SetTextColor(GetSysColor(COLOR_HIGHLIGHTTEXT));
00230                 memDC.SetBkColor(GetSysColor(COLOR_HIGHLIGHT));
00231                 for(; (i < selEnd) && (i < m_length) && (y < height); i++)
00232                 {
00233                     LPTSTR p = &buf[0];
00234
00235                     TOHEX(m_pData[i], p);
00236
00237                     *p++ = ' ';
00238                     memDC.TextOut(x, y, buf, 3);
00239                     x += m_nullWidth * 3;
00240                     n++;
00241                     if(n == m_bpr)
00242                     {
00243                         n = 0;
00244                         x = m_offHex;
00245                         y += m_lineHeight;
00246                     }
00247                 }
00248                 memDC.SetTextColor(GetSysColor(COLOR_WINDOWTEXT));
00249                 memDC.SetBkColor(GetSysColor(COLOR_WINDOW));
00250                 for(; (i < m_length) && (y < height); i++)
00251                 {
00252                     LPTSTR p = &buf[0];
00253
00254                     TOHEX(m_pData[i], p);
00255
00256                     *p++ = ' ';
00257                     memDC.TextOut(x, y, buf, 3);
00258                     x += m_nullWidth * 3;
00259                     n++;
00260                     if(n == m_bpr)
00261                     {
00262                         n = 0;
00263                         x = m_offHex;
00264                         y += m_lineHeight;
00265                     }
00266                 }
00267             }
00268             else
00269             {
00270                 for(int  i = m_topindex; (i < m_length) && (rcd.TopLeft().y < height);)
00271                 {
00272                     LPTSTR p = &buf[0];
00273
00274                     for(int  n = 0; (n < m_bpr) && (i < m_length); n++)
00275                     {
00276                         TOHEX(m_pData[i], p);
00277                         *p++ = ' ';
00278                         i++;
00279                     }
00280
00281                     while(n < m_bpr)
00282                     {
00283                         *p++ = ' '; *p++ = ' '; *p++ = ' ';
00284                         n++;
00285                     }
00286
00287                     memDC.DrawText(buf, m_bpr*3, rcd, DT_LEFT|DT_TOP|DT_SINGLELINE|DT_NOPREFIX);
00288                     rcd.TopLeft().y += m_lineHeight;
00289                 }
00290             }
00291         }
00292         if(m_bShowAscii)
00293         {
00294             y = 0;
00295             CRect rcd = rcClient;
00296             rcd.TopLeft().x = x = m_offAscii;
00297             if(m_selStart != 0xffffffff && m_currentMode == EDIT_ASCII)
00298             {
00299                 int  i;
00300                 int  n = 0;
00301                 int  selStart = m_selStart, selEnd = m_selEnd;
00302                 if(selStart > selEnd)
00303                     selStart ^= selEnd ^= selStart ^= selEnd;
00304
00305                 for(i = m_topindex; (i < selStart) && (y < height); i++)
00306                 {
00307                     buf[0] = isprint(m_pData[i]) ? m_pData[i] : '.';
00308                     memDC.TextOut(x, y, buf, 1);
00309                     x += m_nullWidth;
00310                     n++;
00311                     if(n == m_bpr)
00312                     {
00313                         n = 0;
00314                         x = m_offAscii;
00315                         y += m_lineHeight;
00316                     }
00317                 }
00318                 memDC.SetTextColor(GetSysColor(COLOR_HIGHLIGHTTEXT));
00319                 memDC.SetBkColor(GetSysColor(COLOR_HIGHLIGHT));
00320                 for(; (i < selEnd) && (y < height); i++)
00321                 {
00322                     buf[0] = isprint(m_pData[i]) ? m_pData[i] : '.';
00323                     memDC.TextOut(x, y, buf, 1);
00324                     x += m_nullWidth;
00325                     n++;
00326                     if(n == m_bpr)
00327                     {
00328                         n = 0;
00329                         x = m_offAscii;
00330                         y += m_lineHeight;
00331                     }
00332                 }
00333                 memDC.SetTextColor(GetSysColor(COLOR_WINDOWTEXT));
00334                 memDC.SetBkColor(GetSysColor(COLOR_WINDOW));
00335                 for(; (i < m_length) && y < height; i++)
00336                 {
00337                     buf[0] = isprint(m_pData[i]) ? m_pData[i] : '.';
00338                     memDC.TextOut(x, y, buf, 1);
00339                     x += m_nullWidth;
00340                     n++;
00341                     if(n == m_bpr)
00342                     {
00343                         n = 0;
00344                         x = m_offAscii;
00345                         y += m_lineHeight;
00346                     }
00347                 }
00348             }
00349             else
00350             {
00351                 for(int  i = m_topindex; (i < m_length) && (rcd.TopLeft().y < height);)
00352                 {
00353                     LPTSTR p = &buf[0];
00354
00355                     for(int  n = 0; (n < m_bpr) && (i < m_length); n++)
00356                     {
00357                         *p++ = isprint(m_pData[i]) ? m_pData[i] : '.';
00358                         i++;
00359                     }
00360
00361                     memDC.DrawText(buf, n, rcd, DT_LEFT|DT_TOP|DT_SINGLELINE|DT_NOPREFIX);
00362                     rcd.TopLeft().y += m_lineHeight;
00363                 }
00364             }
00365         }
00366     }
00367
00368     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00369     dc.BitBlt(rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), &memDC, 0,0, SRCCOPY);
00370
00371     // KStowell - Cleanup resources.
00372     memDC.SelectObject(pOldBitmap);
00373     memDC.SelectObject(pOldFont);
00374     memDC.DeleteDC();
00375     bitmap.DeleteObject();
00376 }
00377
00378 void CCJHexEdit::OnSetFocus(CWnd* pOldWnd)
00379 {
00380     if(m_pData && !IsSelected())
00381     {
00382         if(m_editPos.x == 0 && m_bShowAddress)
00383             CreateAddressCaret();
00384         else
00385             CreateEditCaret();
00386         SetCaretPos(m_editPos);
00387         ShowCaret();
00388     }
00389     CWnd::OnSetFocus(pOldWnd);
00390 }
00391
00392 void CCJHexEdit::OnKillFocus(CWnd* pNewWnd)
00393 {
00394     DestroyCaret();
00395     CWnd::OnKillFocus(pNewWnd);
00396 }
00397
00398 void CCJHexEdit::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
00399 {
00400     UNUSED_ALWAYS(pScrollBar);
00401
00402     if(!m_pData) {
00403         return;
00404     }
00405
00406     int oa = m_topindex;
00407     switch(nSBCode)
00408     {
00409         case SB_LINEDOWN:
00410             if(m_topindex < m_length - m_lpp*m_bpr)
00411             {
00412                 m_topindex += m_bpr;
00413                 RedrawWindow();
00414             }
00415             break;
00416
00417         case SB_LINEUP:
00418             if(m_topindex > 0)
00419             {
00420                 m_topindex -= m_bpr;
00421                 RedrawWindow();
00422             }
00423             break;
00424
00425         case SB_PAGEDOWN:
00426             if(m_topindex < m_length - m_lpp*m_bpr)
00427             {
00428                 m_topindex += m_bpr * m_lpp;
00429                 if(m_topindex > m_length - m_lpp*m_bpr)
00430                     m_topindex = m_length - m_lpp*m_bpr;
00431                 RedrawWindow();
00432             }
00433             break;
00434
00435         case SB_PAGEUP:
00436             if(m_topindex > 0)
00437             {
00438                 m_topindex -= m_bpr * m_lpp;
00439                 if(m_topindex < 0)
00440                     m_topindex = 0;
00441                 RedrawWindow();
00442             }
00443             break;
00444
00445         case SB_THUMBTRACK:
00446             m_topindex = nPos * m_bpr;
00447             RedrawWindow();
00448             break;
00449     }
00450     ::SetScrollPos(this->m_hWnd, SB_VERT, m_topindex / m_bpr, TRUE);
00451     if(!m_bNoAddressChange)
00452         m_currentAddress += (m_topindex - oa);
00453     RepositionCaret(m_currentAddress);
00454 }
00455
00456 BOOL CCJHexEdit::PreCreateWindow(CREATESTRUCT& cs)
00457 {
00458     if(!CEdit::PreCreateWindow(cs)) {
00459         return FALSE;
00460     }
00461
00462     cs.style |= WS_HSCROLL|WS_VSCROLL;
00463     return TRUE;
00464 }
00465
00466 BOOL CCJHexEdit::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
00467 {
00468     if(!CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext)) {
00469         return FALSE;
00470     }
00471
00472     SetFont(&m_Font);
00473     return TRUE;
00474 }
00475
00476 BOOL CCJHexEdit::OnEraseBkgnd(CDC* pDC)
00477 {
00478     // KStowell - overridden for flicker-free drawing.
00479     UNUSED_ALWAYS(pDC);
00480     return TRUE;
00481 }
00482
00483 void CCJHexEdit::OnLButtonDown(UINT nFlags, CPoint point)
00484 {
00485     SetFocus();
00486     if(!m_pData)
00487         return;
00488
00489     if(nFlags & MK_SHIFT)
00490     {
00491         m_selStart = m_currentAddress;
00492     }
00493     CPoint pt = CalcPos(point.x, point.y);
00494     if(pt.x > -1)
00495     {
00496         m_editPos = pt;
00497         pt.x *= m_nullWidth;
00498         pt.y *= m_lineHeight;
00499
00500         if(pt.x == 0 && m_bShowAddress)
00501             CreateAddressCaret();
00502         else
00503             CreateEditCaret();
00504
00505         SetCaretPos(pt);
00506         if(nFlags & MK_SHIFT)
00507         {
00508             m_selEnd = m_currentAddress;
00509             if(m_currentMode == EDIT_HIGH || m_currentMode == EDIT_LOW)
00510                 m_selEnd++;
00511             RedrawWindow();
00512         }
00513     }
00514     if(!(nFlags & MK_SHIFT))
00515     {
00516         if(DragDetect(this->m_hWnd, point))
00517         {
00518             m_selStart = m_currentAddress;
00519             m_selEnd   = m_selStart;
00520             SetCapture();
00521         }
00522         else
00523         {
00524             BOOL bsel = m_selStart != 0xffffffff;
00525
00526             m_selStart = 0xffffffff;
00527             m_selEnd   = 0xffffffff;
00528             if(bsel)
00529                 RedrawWindow();
00530         }
00531     }
00532     if(!IsSelected())
00533     {
00534         ShowCaret();
00535     }
00536 }
00537
00538 CPoint CCJHexEdit::CalcPos(int x, int y)
00539 {
00540     y /= m_lineHeight;
00541     if(y < 0 || y > m_lpp)
00542         return CPoint(-1, -1);
00543
00544     if(y * m_bpr > m_length)
00545         return CPoint(-1, -1);
00546
00547     x += m_nullWidth;
00548     x /= m_nullWidth;
00549
00550     int xp;
00551
00552     if(m_bShowAddress && x <= (m_bAddressIsWide ? 8 : 4))
00553     {
00554         m_currentAddress = m_topindex + (m_bpr * y);
00555         m_currentMode = EDIT_NONE;
00556         return CPoint(0, y);
00557     }
00558
00559     xp = (m_offHex  / m_nullWidth) + m_bpr * 3;
00560     if(m_bShowHex && x < xp)
00561     {
00562         if(x%3)
00563             x--;
00564         m_currentAddress = m_topindex + (m_bpr * y) + (x - (m_offHex  / m_nullWidth)) / 3;
00565         m_currentMode =  ((x%3) & 0x01) ? EDIT_LOW : EDIT_HIGH;
00566         return CPoint(x, y);
00567     }
00568
00569     xp = (m_offAscii  / m_nullWidth) + m_bpr;
00570     if(m_bShowAscii && x < xp)
00571     {
00572         m_currentAddress = m_topindex + (m_bpr * y) + (x - (m_offAscii  / m_nullWidth));
00573         m_currentMode = EDIT_ASCII;
00574         return CPoint(x, y);
00575     }
00576
00577     return CPoint(-1,-1);
00578 }
00579
00580 void CCJHexEdit::CreateAddressCaret()
00581 {
00582     DestroyCaret();
00583     CreateSolidCaret(m_nullWidth * (m_bAddressIsWide ? 8 : 4), m_lineHeight);
00584 }
00585
00586 void CCJHexEdit::CreateEditCaret()
00587 {
00588     DestroyCaret();
00589     CreateSolidCaret(m_nullWidth, m_lineHeight);
00590 }
00591
00592 void CCJHexEdit::OnMouseMove(UINT nFlags, CPoint point)
00593 {
00594     if(!m_pData) {
00595         return;
00596     }
00597
00598     if(nFlags & MK_LBUTTON && m_selStart != 0xffffffff)
00599     {
00600         CRect rc;
00601         GetClientRect(&rc);
00602         if(!rc.PtInRect(point))
00603         {
00604             if(point.y < 0)
00605             {
00606                 OnVScroll(SB_LINEUP, 0, NULL);
00607                 point.y = 0;
00608             }
00609             else if(point.y > rc.Height())
00610             {
00611                 OnVScroll(SB_LINEDOWN, 0, NULL);
00612                 point.y = rc.Height() -1;
00613             }
00614         }
00615
00616         //
00617         // we are selecting
00618         //
00619         int  seo = m_selEnd;
00620         CPoint pt = CalcPos(point.x, point.y);
00621         if(pt.x > -1)
00622         {
00623             m_selEnd = m_currentAddress;
00624             if(m_currentMode == EDIT_HIGH || m_currentMode == EDIT_LOW)
00625                 m_selEnd++;
00626         }
00627         if(IsSelected())
00628             DestroyCaret();
00629
00630         if(seo != m_selEnd)
00631             RedrawWindow();
00632     }
00633 }
00634
00635 void CCJHexEdit::UpdateScrollbars()
00636 {
00637     SCROLLINFO si;
00638
00639     si.cbSize = sizeof(SCROLLINFO);
00640     si.fMask = SIF_ALL;
00641     si.nMin = 0;
00642     si.nMax = (m_length / m_bpr) - 1;
00643     si.nPage = m_lpp;
00644     si.nPos = m_topindex / m_bpr;
00645
00646     ::SetScrollInfo(this->m_hWnd, SB_VERT, &si, TRUE);
00647     if(si.nMax > (int)si.nPage)
00648         ::EnableScrollBar(this->m_hWnd, SB_VERT, ESB_ENABLE_BOTH);
00649
00650     CRect rc;
00651     GetClientRect(&rc);
00652
00653     si.nMin = 0;
00654     si.nMax =((m_bShowAddress ? (m_bAddressIsWide ? 8 : 4) : 0) +
00655               (m_bShowHex ? m_bpr * 3 : 0) +
00656               (m_bShowAscii ? m_bpr : 0) ) * m_nullWidth;
00657     si.nPage = 1;
00658     si.nPos = 0;
00659     ::SetScrollInfo(this->m_hWnd, SB_HORZ, &si, TRUE);
00660 }
00661
00662 void CCJHexEdit::OnLButtonUp(UINT nFlags, CPoint point)
00663 {
00664     if(IsSelected()) {
00665         ReleaseCapture();
00666     }
00667
00668     CWnd::OnLButtonUp(nFlags, point);
00669 }
00670
00671 void CCJHexEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
00672 {
00673     nFlags;nRepCnt;
00674     if(!m_pData)
00675         return;
00676     if(nChar == '\t')
00677         return;
00678     if(GetKeyState(VK_CONTROL) & 0x80000000)
00679     {
00680         switch(nChar)
00681         {
00682             case 0x03:
00683                 if(IsSelected())
00684                     OnEditCopy();
00685                 return;
00686             case 0x16:
00687                 OnEditPaste();
00688                 return;
00689             case 0x18:
00690                 if(IsSelected())
00691                     OnEditCut();
00692                 return;
00693             case 0x1a:
00694                 OnEditUndo();
00695                 return;
00696         }
00697     }
00698
00699     if(nChar == 0x08)
00700     {
00701         if(m_currentAddress > 0)
00702         {
00703             m_currentAddress--;
00704             SelDelete(m_currentAddress, m_currentAddress+1);
00705             RepositionCaret(m_currentAddress);
00706             RedrawWindow();
00707         }
00708         return;
00709     }
00710
00711     SetSel(-1, -1);
00712     switch(m_currentMode)
00713     {
00714         case EDIT_NONE:
00715             return;
00716         case EDIT_HIGH:
00717         case EDIT_LOW:
00718             if((nChar >= '0' && nChar <= '9') || (nChar >= 'a' && nChar <= 'f'))
00719             {
00720                 UINT b = nChar - '0';
00721                 if(b > 9)
00722                     b = 10 + nChar - 'a';
00723
00724                 if(m_currentMode == EDIT_HIGH)
00725                 {
00726                     m_pData[m_currentAddress] = (unsigned char)((m_pData[m_currentAddress] & 0x0f) | (b << 4));
00727                 }
00728                 else
00729                 {
00730                     m_pData[m_currentAddress] = (unsigned char)((m_pData[m_currentAddress] & 0xf0) | b);
00731                 }
00732                 Move(1,0);
00733             }
00734             break;
00735         case EDIT_ASCII:
00736             m_pData[m_currentAddress] = (unsigned char)nChar;
00737             Move(1,0);
00738             break;
00739     }
00740     RedrawWindow();
00741 }
00742
00743 void CCJHexEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
00744 {
00745     nFlags; nRepCnt;
00746
00747     BOOL bShift = GetKeyState(VK_SHIFT) & 0x80000000;
00748     BOOL bac = m_bNoAddressChange;
00749     m_bNoAddressChange = TRUE;
00750     switch(nChar)
00751     {
00752         case VK_DOWN:
00753             if(bShift)
00754             {
00755                 if(!IsSelected())
00756                 {
00757                     m_selStart = m_currentAddress;
00758                 }
00759                 Move(0,1);
00760                 m_selEnd   = m_currentAddress;
00761                 if(m_currentMode == EDIT_HIGH || m_currentMode == EDIT_LOW)
00762                     m_selEnd++;
00763                 RedrawWindow();
00764                 break;
00765             }
00766             else
00767                 SetSel(-1, -1);
00768             Move(0,1);
00769             break;
00770         case VK_UP:
00771             if(bShift)
00772             {
00773                 if(!IsSelected())
00774                 {
00775                     m_selStart = m_currentAddress;
00776                 }
00777                 Move(0,-1);
00778                 m_selEnd   = m_currentAddress;
00779                 RedrawWindow();
00780                 break;
00781             }
00782             else
00783                 SetSel(-1, -1);
00784             Move(0,-1);
00785             break;
00786         case VK_LEFT:
00787             if(bShift)
00788             {
00789                 if(!IsSelected())
00790                 {
00791                     m_selStart = m_currentAddress;
00792                 }
00793                 Move(-1,0);
00794                 m_selEnd   = m_currentAddress;
00795                 RedrawWindow();
00796                 break;
00797             }
00798             else
00799                 SetSel(-1, -1);
00800             Move(-1,0);
00801             break;
00802         case VK_RIGHT:
00803             if(bShift)
00804             {
00805                 if(!IsSelected())
00806                 {
00807                     m_selStart = m_currentAddress;
00808                 }
00809                 Move(1,0);
00810                 m_selEnd   = m_currentAddress;
00811                 if(m_currentMode == EDIT_HIGH || m_currentMode == EDIT_LOW)
00812                     m_selEnd++;
00813                 RedrawWindow();
00814                 break;
00815             }
00816             else
00817                 SetSel(-1, -1);
00818             Move(1,0);
00819             break;
00820         case VK_PRIOR:
00821             if(bShift)
00822             {
00823                 if(!IsSelected())
00824                 {
00825                     m_selStart = m_currentAddress;
00826                 }
00827                 OnVScroll(SB_PAGEUP, 0, NULL);
00828                 Move(0,0);
00829                 m_selEnd   = m_currentAddress;
00830                 RedrawWindow();
00831                 break;
00832             }
00833             else
00834                 SetSel(-1, -1);
00835             OnVScroll(SB_PAGEUP, 0, NULL);
00836             Move(0,0);
00837             break;
00838         case VK_NEXT:
00839             if(bShift)
00840             {
00841                 if(!IsSelected())
00842                 {
00843                     m_selStart = m_currentAddress;
00844                 }
00845                 OnVScroll(SB_PAGEDOWN, 0, NULL);
00846                 Move(0,0);
00847                 m_selEnd   = m_currentAddress;
00848                 RedrawWindow();
00849                 break;
00850             }
00851             else
00852                 SetSel(-1, -1);
00853             OnVScroll(SB_PAGEDOWN, 0, NULL);
00854             Move(0,0);
00855             break;
00856         case VK_HOME:
00857             if(bShift)
00858             {
00859                 if(!IsSelected())
00860                 {
00861                     m_selStart = m_currentAddress;
00862                 }
00863                 if(GetKeyState(VK_CONTROL) & 0x80000000)
00864                 {
00865                     OnVScroll(SB_THUMBTRACK, 0, NULL);
00866                     Move(0,0);
00867                 }
00868                 else
00869                 {
00870                     m_currentAddress /= m_bpr;
00871                     m_currentAddress *= m_bpr;
00872                     Move(0,0);
00873                 }
00874                 m_selEnd   = m_currentAddress;
00875                 RedrawWindow();
00876                 break;
00877             }
00878             else
00879                 SetSel(-1, -1);
00880             if(GetKeyState(VK_CONTROL) & 0x80000000)
00881             {
00882                 OnVScroll(SB_THUMBTRACK, 0, NULL);
00883                 m_currentAddress = 0;
00884                 Move(0,0);
00885             }
00886             else
00887             {
00888                 m_currentAddress /= m_bpr;
00889                 m_currentAddress *= m_bpr;
00890                 Move(0,0);
00891             }
00892             break;
00893         case VK_END:
00894             if(bShift)
00895             {
00896                 if(!IsSelected())
00897                 {
00898                     m_selStart = m_currentAddress;
00899                 }
00900                 if(GetKeyState(VK_CONTROL) & 0x80000000)
00901                 {
00902                     m_currentAddress = m_length-1;
00903                     OnVScroll(SB_THUMBTRACK, ((m_length+(m_bpr/2)) / m_bpr) - m_lpp, NULL);
00904                     Move(0,0);
00905                 }
00906                 else
00907                 {
00908                     m_currentAddress /= m_bpr;
00909                     m_currentAddress *= m_bpr;
00910                     m_currentAddress += m_bpr - 1;
00911                     if(m_currentAddress > m_length)
00912                         m_currentAddress = m_length-1;
00913                     Move(0,0);
00914                 }
00915                 m_selEnd   = m_currentAddress;
00916                 RedrawWindow();
00917                 break;
00918             }
00919             else
00920                 SetSel(-1, -1);
00921             if(GetKeyState(VK_CONTROL) & 0x80000000)
00922             {
00923                 m_currentAddress = m_length-1;
00924                 if(m_bHalfPage)
00925                     OnVScroll(SB_THUMBTRACK, 0, NULL);
00926                 else
00927                     OnVScroll(SB_THUMBTRACK, ((m_length+(m_bpr/2)) / m_bpr) - m_lpp, NULL);
00928                 Move(0,0);
00929             }
00930             else
00931             {
00932                 m_currentAddress /= m_bpr;
00933                 m_currentAddress *= m_bpr;
00934                 m_currentAddress += m_bpr - 1;
00935                 if(m_currentAddress > m_length)
00936                     m_currentAddress = m_length-1;
00937                 Move(0,0);
00938             }
00939             break;
00940         case VK_INSERT:
00941             SelInsert(m_currentAddress, max(1, m_selEnd-m_selStart));
00942             RedrawWindow();
00943             break;
00944         case VK_DELETE:
00945             if(IsSelected())
00946             {
00947                 OnEditClear();
00948             }
00949             else
00950             {
00951                 SelDelete(m_currentAddress, m_currentAddress+1);
00952                 RedrawWindow();
00953             }
00954             break;
00955         case '\t':
00956             switch(m_currentMode)
00957             {
00958                 case EDIT_NONE:
00959                     m_currentMode = EDIT_HIGH;
00960                     break;
00961                 case EDIT_HIGH:
00962                 case EDIT_LOW:
00963                     m_currentMode = EDIT_ASCII;
00964                     break;
00965                 case EDIT_ASCII:
00966                     m_currentMode = EDIT_HIGH;
00967                     break;
00968             }
00969             Move(0,0);
00970             break;
00971
00972     }
00973     m_bNoAddressChange = bac;
00974 }
00975
00976 void CCJHexEdit::Move(int x, int y)
00977 {
00978     switch(m_currentMode)
00979     {
00980         case EDIT_NONE:
00981             return;
00982         case EDIT_HIGH:
00983             if(x != 0)
00984                 m_currentMode = EDIT_LOW;
00985             if(x == -1)
00986                 m_currentAddress --;
00987             m_currentAddress += y* m_bpr;
00988             break;
00989         case EDIT_LOW:
00990             if(x != 0)
00991                 m_currentMode = EDIT_HIGH;
00992             if(x == 1)
00993                 m_currentAddress++;
00994             m_currentAddress += y* m_bpr;
00995             break;
00996         case EDIT_ASCII:
00997             {
00998                 m_currentAddress += x;
00999                 m_currentAddress += y*m_bpr;
01000             }
01001             break;
01002     }
01003     if(m_currentAddress < 0)
01004         m_currentAddress = 0;
01005
01006     if(m_currentAddress >= m_length)
01007     {
01008         m_currentAddress -= x;
01009         m_currentAddress -= y*m_bpr;
01010     }
01011     m_bNoAddressChange = TRUE;
01012     if(m_currentAddress < m_topindex)
01013     {
01014         OnVScroll(SB_LINEUP, 0, NULL);
01015     }
01016     if(m_currentAddress >= m_topindex + m_lpp*m_bpr)
01017     {
01018         OnVScroll(SB_LINEDOWN, 0, NULL);
01019     }
01020     m_bNoAddressChange = FALSE;
01021     //ScrollIntoView(m_currentAddress);
01022     RepositionCaret(m_currentAddress);
01023 }
01024
01025 void CCJHexEdit::SetSel(int s, int e)
01026 {
01027     DestroyCaret();
01028     m_selStart = s;
01029     m_selEnd = e;
01030     RedrawWindow();
01031     if(m_editPos.x == 0 && m_bShowAddress)
01032         CreateAddressCaret();
01033     else
01034         CreateEditCaret();
01035     SetCaretPos(m_editPos);
01036     ShowCaret();
01037 }
01038
01039 void CCJHexEdit::RepositionCaret(int     p)
01040 {
01041     int x, y;
01042
01043     y = (p - m_topindex) / m_bpr;
01044     x = (p - m_topindex) % m_bpr;
01045
01046     switch(m_currentMode)
01047     {
01048         case EDIT_NONE:
01049             CreateAddressCaret();
01050             x = 0;
01051             break;
01052         case EDIT_HIGH:
01053             CreateEditCaret();
01054             x *= m_nullWidth*3;
01055             x += m_offHex;
01056             break;
01057         case EDIT_LOW:
01058             CreateEditCaret();
01059             x *= m_nullWidth*3;
01060             x += m_nullWidth;
01061             x += m_offHex;
01062             break;
01063         case EDIT_ASCII:
01064             CreateEditCaret();
01065             x *= m_nullWidth;
01066             x += m_offAscii;
01067             break;
01068     }
01069     m_editPos.x = x;
01070     m_editPos.y = y*m_lineHeight;
01071     CRect rc;
01072     GetClientRect(&rc);
01073     if(rc.PtInRect(m_editPos))
01074     {
01075         SetCaretPos(m_editPos);
01076         ShowCaret();
01077     }
01078 }
01079
01080 void CCJHexEdit::ScrollIntoView(int p)
01081 {
01082     if(p < m_topindex || p > m_topindex + m_lpp*m_bpr)
01083     {
01084         m_topindex = (p/m_bpr) * m_bpr;
01085         m_topindex -= (m_lpp / 3) * m_bpr;
01086         if(m_topindex < 0)
01087             m_topindex = 0;
01088
01089         UpdateScrollbars();
01090         RedrawWindow();
01091     }
01092 }
01093
01094 void CCJHexEdit::OnContextMenu(CWnd*, CPoint point)
01095 {
01096     if (point.x == -1 && point.y == -1)
01097     {
01098         //keystroke invocation
01099         CRect rect;
01100         GetClientRect(rect);
01101         ClientToScreen(rect);
01102
01103         point = rect.TopLeft();
01104         point.Offset(5, 5);
01105     }
01106
01107     CMenu menu;
01108     VERIFY(menu.LoadMenu(IDR_POPUP_HEX_EDIT));
01109
01110     CMenu* pPopup = menu.GetSubMenu(0);
01111     ASSERT(pPopup != NULL);
01112
01113     pPopup->EnableMenuItem(ID_EDIT_UNDO, MF_GRAYED|MF_DISABLED|MF_BYCOMMAND);
01114     if(!IsSelected())
01115     {
01116         pPopup->EnableMenuItem(ID_EDIT_CLEAR, MF_GRAYED|MF_DISABLED|MF_BYCOMMAND);
01117         pPopup->EnableMenuItem(ID_EDIT_CUT, MF_GRAYED|MF_DISABLED|MF_BYCOMMAND);
01118         pPopup->EnableMenuItem(ID_EDIT_COPY, MF_GRAYED|MF_DISABLED|MF_BYCOMMAND);
01119     }
01120     {
01121         COleDataObject  obj;
01122         if (obj.AttachClipboard())
01123         {
01124             if(
01125                 !obj.IsDataAvailable(CF_TEXT) && !obj.IsDataAvailable((CLIPFORMAT)RegisterClipboardFormat( _T("BinaryData"))))
01126                 pPopup->EnableMenuItem(ID_EDIT_PASTE, MF_GRAYED|MF_DISABLED|MF_BYCOMMAND);
01127         }
01128     }
01129
01130     pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y,
01131         this);
01132 }
01133
01134 void CCJHexEdit::OnEditClear()
01135 {
01136     m_currentAddress = m_selStart;
01137     SelDelete(m_selStart, m_selEnd);
01138     RepositionCaret(m_currentAddress);
01139     RedrawWindow();
01140 }
01141
01142 void CCJHexEdit::OnEditCopy()
01143 {
01144     COleDataSource*     pSource = new COleDataSource();
01145     EmptyClipboard();
01146     if(m_currentMode != EDIT_ASCII)
01147     {
01148         int         dwLen = (m_selEnd-m_selStart);
01149         HGLOBAL     hMemb = ::GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE|GMEM_ZEROINIT, m_selEnd-m_selStart);
01150         HGLOBAL     hMema = ::GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE|GMEM_ZEROINIT, (dwLen) * 3);
01151
01152         if (!hMema)
01153             return;
01154
01155         // copy binary
01156         LPBYTE  p = (BYTE*)::GlobalLock(hMemb);
01157         memcpy(p, m_pData+m_selStart, dwLen);
01158         ::GlobalUnlock(hMemb);
01159
01160         // copy ascii
01161         p = (BYTE*)::GlobalLock(hMema);
01162         for(int  i = 0; i < dwLen;)
01163         {
01164             TOHEX(m_pData[m_selStart+i], p);
01165             *p++ = ' ';
01166             i++;
01167         }
01168
01169         ::GlobalUnlock(hMema);
01170
01171         pSource->CacheGlobalData((CLIPFORMAT)RegisterClipboardFormat( _T("BinaryData")), hMemb);
01172         pSource->CacheGlobalData(CF_TEXT, hMema);
01173     }
01174     else
01175     {
01176         HGLOBAL             hMemb = ::GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE|GMEM_ZEROINIT, m_selEnd-m_selStart);
01177         HGLOBAL             hMema = ::GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE|GMEM_ZEROINIT, m_selEnd-m_selStart);
01178         if (!hMemb || !hMema)
01179             return;
01180
01181         // copy binary
01182         LPBYTE  p = (BYTE*)::GlobalLock(hMemb);
01183         int     dwLen = m_selEnd-m_selStart;
01184
01185         memcpy(p, m_pData+m_selStart, dwLen);
01186         ::GlobalUnlock(hMemb);
01187
01188         // copy ascii
01189         p = (BYTE*)::GlobalLock(hMema);
01190         memcpy(p, m_pData+m_selStart, dwLen);
01191         for(int i = 0; i < dwLen; p++, i++)
01192             if(!isprint(*p))
01193                 *p = '.';
01194         ::GlobalUnlock(hMema);
01195
01196         pSource->CacheGlobalData((CLIPFORMAT)RegisterClipboardFormat( _T("BinaryData")), hMemb);
01197         pSource->CacheGlobalData(CF_TEXT, hMema);
01198     }
01199     pSource->SetClipboard();
01200 }
01201
01202 void CCJHexEdit::OnEditCut()
01203 {
01204     OnEditCopy();
01205     SelDelete(m_selStart, m_selEnd);
01206     RedrawWindow();
01207 }
01208
01209 void CCJHexEdit::OnEditPaste()
01210 {
01211     COleDataObject  obj;
01212     if (obj.AttachClipboard())
01213     {
01214         HGLOBAL hmem = NULL;
01215         if (obj.IsDataAvailable((CLIPFORMAT)RegisterClipboardFormat( _T("BinaryData"))))
01216         {
01217             hmem = obj.GetGlobalData((CLIPFORMAT)RegisterClipboardFormat( _T("BinaryData")));
01218         }
01219         else if (obj.IsDataAvailable(CF_TEXT))
01220         {
01221             hmem = obj.GetGlobalData(CF_TEXT);
01222         }
01223         if(hmem)
01224         {
01225             LPBYTE  p = (BYTE*)::GlobalLock(hmem);
01226             DWORD   dwLen = ::GlobalSize(hmem);
01227             int     insert;
01228             int     oa = m_currentAddress;
01229
01230             NormalizeSel();
01231             if(m_selStart == 0xffffffff)
01232             {
01233                 if(m_currentMode == EDIT_LOW)
01234                     m_currentAddress++;
01235                 insert = m_currentAddress;
01236                 SelInsert(m_currentAddress, dwLen);
01237             }
01238             else
01239             {
01240                 insert = m_selStart;
01241                 SelDelete(m_selStart, m_selEnd);
01242                 SelInsert(insert, dwLen);
01243                 SetSel(-1, -1);
01244             }
01245
01246             memcpy(m_pData+insert, p, dwLen);
01247
01248             m_currentAddress = oa;
01249             RedrawWindow();
01250             ::GlobalUnlock(hmem);
01251         }
01252     }
01253 }
01254
01255 void CCJHexEdit::OnEditSelectAll()
01256 {
01257     m_selStart = 0;
01258     m_selEnd = m_length;
01259     DestroyCaret();
01260     RedrawWindow();
01261 }
01262
01263 void CCJHexEdit::OnEditUndo()
01264 {
01265     // TODO: Add your command handler code here
01266
01267 }
01268
01269 void CCJHexEdit::NormalizeSel()
01270 {
01271     if(m_selStart > m_selEnd)
01272         m_selStart ^= m_selEnd ^= m_selStart ^= m_selEnd;
01273 }
01274
01275 void CCJHexEdit::SelDelete(int s, int e)
01276 {
01277     LPBYTE p = (LPBYTE) malloc(m_length - (e-s)+1);
01278     memcpy(p, m_pData, s);
01279     if(s < m_length-(e-s))
01280         memcpy(p+s, m_pData+e, (m_length -e));
01281
01282     free(m_pData);
01283     SetSel(-1, -1);
01284     m_pData = p;
01285     m_length = m_length-(e-s);
01286     if(m_currentAddress > m_length)
01287     {
01288         m_currentAddress = m_length;
01289         RepositionCaret(m_currentAddress);
01290     }
01291     m_bUpdate = TRUE;
01292 }
01293
01294 void CCJHexEdit::SelInsert(int s, int l)
01295 {
01296     LPBYTE p = (LPBYTE) calloc(m_length + l, 1);
01297     memcpy(p, m_pData, s);
01298     memcpy(p+s+l, m_pData+s, (m_length-s));
01299     free(m_pData);
01300     SetSel(-1, -1);
01301     m_pData = p;
01302     m_length = m_length+l;
01303     m_bUpdate = TRUE;
01304 }
01305
01306 void CCJHexEdit::SetData(LPBYTE p, int len)
01307 {
01308     free(m_pData);
01309
01310     m_pData = (LPBYTE) malloc(len);
01311     memcpy(m_pData, p, len);
01312
01313     SetSel(-1, -1);
01314     m_length = len;
01315     m_currentAddress = 0;
01316     m_editPos.x = m_editPos.y = 0;
01317     m_currentMode = EDIT_HIGH;
01318     m_topindex = 0;
01319     m_bUpdate = TRUE;
01320 }
01321
01322 void CCJHexEdit::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
01323 {
01324     UNUSED_ALWAYS(nSBCode);
01325     UNUSED_ALWAYS(nPos);
01326     UNUSED_ALWAYS(pScrollBar);
01327 }
01328
01329 void CCJHexEdit::OnLButtonDblClk(UINT nFlags, CPoint point)
01330 {
01331     UNUSED_ALWAYS(nFlags);
01332     UNUSED_ALWAYS(point);
01333 }
Generated on Sun Feb 24 01:21:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJHtmlView.cpp Source File

WinCvs/CJLib/CJLibrary/CJHtmlView.cpp

Go to the documentation of this file.
00001 // CJHtmlView.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Copied from MFC, Visual C++ 6, to extend functionality to Visual C++ 5
00006 // users, with some ideas taken from Iuri Apollonio's article 'Doc / View -
00007 // Using HtmlView apart from Tecno Preview' http://www.codeguru.com/doc_view/htmlview.shtml
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:49 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJock/CJLibrary/CJHtmlView.cpp $
00015  *
00016  * $History: CJHtmlView.cpp $
00017  *
00018  * *****************  Version 8  *****************
00019  * User: Kirk Stowell Date: 10/14/99   Time: 10:05a
00020  * Updated in $/CodeJock/CJLibrary
00021  * Overrode OnEraseBkgnd(...) to help to eliminate screen flicker.
00022  *
00023  * *****************  Version 7  *****************
00024  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00025  * Updated in $/CodeJockey/CJLibrary
00026  * Updated copyright and contact information.
00027  *
00028  * *****************  Version 6  *****************
00029  * User: Kirk Stowell Date: 7/31/99    Time: 4:26p
00030  * Updated in $/CodeJockey/CJLibrary
00031  *
00032  * *****************  Version 4  *****************
00033  * User: Kirk Stowell Date: 7/25/99    Time: 1:29a
00034  * Updated in $/CodeJockey/CJLibrary
00035  *
00036  * *****************  Version 3  *****************
00037  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00038  * Updated in $/CodeJockey/CJLibrary
00039  *
00040  * *****************  Version 2  *****************
00041  * User: Kirk Stowell Date: 7/18/99    Time: 10:27p
00042  * Updated in $/CodeJockey/CJLibrary
00043  * Added vc5 compatibility.
00044  *
00045  * *****************  Version 1  *****************
00046  * User: Kirk Stowell Date: 7/14/99    Time: 10:29p
00047  * Created in $/CodeJockey/CJLibrary
00048  * Copied from MFC v6 and techno preview for v5. Added to extend
00049  * functionality to Visual C++ 5.0 users.
00050  *
00051  ***************************************************************************/
00053
00054 #include "StdAfx.h"
00055 #include "CJHtmlView.h"
00056
00057 #ifdef _DEBUG
00058 #define new DEBUG_NEW
00059 #undef THIS_FILE
00060 static char THIS_FILE[] = __FILE__;
00061 #endif
00062
00063 DWORD AFXAPI _AfxRelease(LPUNKNOWN* lplpUnknown)
00064 {
00065     ASSERT(lplpUnknown != NULL);
00066     if (*lplpUnknown != NULL)
00067     {
00068         DWORD dwRef = (*lplpUnknown)->Release();
00069         *lplpUnknown = NULL;
00070         return dwRef;
00071     }
00072     return 0;
00073 }
00074
00075 // helper for reliable and small Release calls
00076 DWORD AFXAPI _AfxRelease(LPUNKNOWN* plpUnknown);
00077 #ifndef _DEBUG
00078 // generate smaller code in release build
00079 #define RELEASE(lpUnk) _AfxRelease((LPUNKNOWN*)&lpUnk)
00080 #else
00081 // generate larger but typesafe code in debug build
00082 #define RELEASE(lpUnk) do \
00083     { if ((lpUnk) != NULL) { (lpUnk)->Release(); (lpUnk) = NULL; } } while (0)
00084 #endif
00085
00087 // CCJHtmlView
00088
00089 BEGIN_MESSAGE_MAP(CCJHtmlView, CFormView)
00090     //{{AFX_MSG_MAP(CCJHtmlView)
00091     ON_WM_SIZE()
00092     ON_WM_PAINT()
00093     ON_WM_DESTROY()
00094     ON_WM_ERASEBKGND()
00095     ON_COMMAND(ID_FILE_PRINT, OnFilePrint)
00096     //}}AFX_MSG_MAP
00097 END_MESSAGE_MAP()
00098
00099 BEGIN_EVENTSINK_MAP(CCJHtmlView, CFormView)
00100     ON_EVENT(CCJHtmlView, AFX_IDW_PANE_FIRST, 102 /* StatusTextChange */, OnStatusTextChange, VTS_BSTR)
00101     ON_EVENT(CCJHtmlView, AFX_IDW_PANE_FIRST, 108 /* ProgressChange */, OnProgressChange, VTS_I4 VTS_I4)
00102     ON_EVENT(CCJHtmlView, AFX_IDW_PANE_FIRST, 105 /* CommandStateChange */, OnCommandStateChange, VTS_I4 VTS_BOOL)
00103     ON_EVENT(CCJHtmlView, AFX_IDW_PANE_FIRST, 106 /* DownloadBegin */, OnDownloadBegin, VTS_NONE)
00104     ON_EVENT(CCJHtmlView, AFX_IDW_PANE_FIRST, 104 /* DownloadComplete */, OnDownloadComplete, VTS_NONE)
00105     ON_EVENT(CCJHtmlView, AFX_IDW_PANE_FIRST, 113 /* TitleChange */, OnTitleChange, VTS_BSTR)
00106     ON_EVENT(CCJHtmlView, AFX_IDW_PANE_FIRST, 252 /* NavigateComplete2 */, NavigateComplete2, VTS_DISPATCH VTS_PVARIANT)
00107     ON_EVENT(CCJHtmlView, AFX_IDW_PANE_FIRST, 250 /* BeforeNavigate2 */, BeforeNavigate2, VTS_DISPATCH VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PBOOL)
00108     ON_EVENT(CCJHtmlView, AFX_IDW_PANE_FIRST, 112 /* PropertyChange */, OnPropertyChange, VTS_BSTR)
00109     ON_EVENT(CCJHtmlView, AFX_IDW_PANE_FIRST, 251 /* NewWindow2 */, OnNewWindow2, VTS_PDISPATCH VTS_PBOOL)
00110     ON_EVENT(CCJHtmlView, AFX_IDW_PANE_FIRST, 259 /* DocumentComplete */, DocumentComplete, VTS_DISPATCH VTS_PVARIANT)
00111     ON_EVENT(CCJHtmlView, AFX_IDW_PANE_FIRST, 253 /* OnQuit */, OnQuit, VTS_NONE)
00112     ON_EVENT(CCJHtmlView, AFX_IDW_PANE_FIRST, 254 /* OnVisible */, OnVisible, VTS_BOOL)
00113     ON_EVENT(CCJHtmlView, AFX_IDW_PANE_FIRST, 255 /* OnToolBar */, OnToolBar, VTS_BOOL)
00114     ON_EVENT(CCJHtmlView, AFX_IDW_PANE_FIRST, 256 /* OnMenuBar */, OnMenuBar, VTS_BOOL)
00115     ON_EVENT(CCJHtmlView, AFX_IDW_PANE_FIRST, 257 /* OnStatusBar */, OnStatusBar, VTS_BOOL)
00116     ON_EVENT(CCJHtmlView, AFX_IDW_PANE_FIRST, 258 /* OnFullScreen */, OnFullScreen, VTS_BOOL)
00117     ON_EVENT(CCJHtmlView, AFX_IDW_PANE_FIRST, 260 /* OnTheaterMode */, OnTheaterMode, VTS_BOOL)
00118 END_EVENTSINK_MAP()
00119
00121 // CCJHtmlView construction/destruction
00122
00123 CCJHtmlView::CCJHtmlView()
00124     : CFormView((LPCTSTR) NULL)
00125 {
00126     m_pBrowserApp = NULL;
00127 }
00128
00129 CCJHtmlView::~CCJHtmlView()
00130 {
00131     if (m_pBrowserApp != NULL)
00132         m_pBrowserApp->Release();
00133 }
00134
00136 // CCJHtmlView drawing
00137
00138 void CCJHtmlView::OnDraw(CDC* /* pDC */)
00139 {
00140     // this class should never do its own drawing;
00141     // the browser control should handle everything
00142
00143     ASSERT(FALSE);
00144 }
00145
00147 // CCJHtmlView printing
00148
00149 void CCJHtmlView::OnFilePrint()
00150 {
00151     // get the HTMLDocument
00152
00153     if (m_pBrowserApp != NULL)
00154     {
00155         LPOLECOMMANDTARGET lpTarget = NULL;
00156         LPDISPATCH lpDisp = GetHtmlDocument();
00157
00158         if (lpDisp != NULL)
00159         {
00160             // the control will handle all printing UI
00161
00162             if (SUCCEEDED(lpDisp->QueryInterface(IID_IOleCommandTarget,
00163                     (LPVOID*) &lpTarget)))
00164             {
00165                 lpTarget->Exec(NULL, OLECMDID_PRINT, 0, NULL, NULL);
00166                 lpTarget->Release();
00167             }
00168             lpDisp->Release();
00169         }
00170     }
00171 }
00172
00174 // CCJHtmlView diagnostics
00175
00176 #ifdef _DEBUG
00177 void CCJHtmlView::AssertValid() const
00178 {
00179     CFormView::AssertValid();
00180 }
00181
00182 void CCJHtmlView::Dump(CDumpContext& dc) const
00183 {
00184     CFormView::Dump(dc);
00185 }
00186 #endif //_DEBUG
00187
00189 // CCJHtmlView message handlers
00190
00191 void CCJHtmlView::OnDestroy()
00192 {
00193     RELEASE(m_pBrowserApp);
00194 }
00195
00196 void CCJHtmlView::OnSize(UINT nType, int cx, int cy)
00197 {
00198     CFormView::OnSize(nType, cx, cy);
00199
00200     if (::IsWindow(m_wndBrowser.m_hWnd))
00201     {
00202         // need to push non-client borders out of the client area
00203         CRect rect;
00204         GetClientRect(rect);
00205         ::AdjustWindowRectEx(rect,
00206             m_wndBrowser.GetStyle(), FALSE, WS_EX_CLIENTEDGE);
00207         m_wndBrowser.SetWindowPos(NULL, rect.left, rect.top,
00208             rect.Width(), rect.Height(), SWP_NOACTIVATE | SWP_NOZORDER);
00209     }
00210 }
00211
00212 void CCJHtmlView::OnPaint()
00213 {
00214     Default();
00215 }
00216
00218 // CCJHtmlView operations
00219
00220 BOOL CCJHtmlView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName,
00221                         DWORD dwStyle, const RECT& rect, CWnd* pParentWnd,
00222                         UINT nID, CCreateContext* pContext)
00223 {
00224     // create the view window itself
00225     m_pCreateContext = pContext;
00226     if (!CView::Create(lpszClassName, lpszWindowName,
00227                 dwStyle, rect, pParentWnd,  nID, pContext))
00228     {
00229         return FALSE;
00230     }
00231
00232     AfxEnableControlContainer();
00233
00234     RECT rectClient;
00235     GetClientRect(&rectClient);
00236
00237     // create the control window
00238     // AFX_IDW_PANE_FIRST is a safe but arbitrary ID
00239     if (!m_wndBrowser.CreateControl(CLSID_WebBrowser, lpszWindowName,
00240                 WS_VISIBLE | WS_CHILD, rectClient, this, AFX_IDW_PANE_FIRST))
00241     {
00242         DestroyWindow();
00243         return FALSE;
00244     }
00245
00246     LPUNKNOWN lpUnk = m_wndBrowser.GetControlUnknown();
00247     HRESULT hr = lpUnk->QueryInterface(IID_IWebBrowser2, (void**) &m_pBrowserApp);
00248     if (!SUCCEEDED(hr))
00249     {
00250         m_pBrowserApp = NULL;
00251         m_wndBrowser.DestroyWindow();
00252         DestroyWindow();
00253         return FALSE;
00254     }
00255
00256     return TRUE;
00257 }
00258
00260 // CCJHtmlView properties
00261
00262 CString CCJHtmlView::GetType() const
00263 {
00264     ASSERT(m_pBrowserApp != NULL);
00265
00266     BSTR bstr;
00267     m_pBrowserApp->get_Type(&bstr);
00268     CString retVal(bstr);
00269     return retVal;
00270 }
00271
00272 long CCJHtmlView::GetLeft() const
00273 {
00274     ASSERT(m_pBrowserApp != NULL);
00275
00276     long result;
00277     m_pBrowserApp->get_Left(&result);
00278     return result;
00279 }
00280
00281
00282 long CCJHtmlView::GetTop() const
00283 {
00284     ASSERT(m_pBrowserApp != NULL);
00285     long result;
00286     m_pBrowserApp->get_Top(&result);
00287     return result;
00288 }
00289
00290 int CCJHtmlView::GetToolBar() const
00291 {
00292     ASSERT(m_pBrowserApp != NULL);
00293     int result;
00294     m_pBrowserApp->get_ToolBar(&result);
00295     return result;
00296 }
00297
00298 long CCJHtmlView::GetHeight() const
00299 {
00300     ASSERT(m_pBrowserApp != NULL);
00301     long result;
00302     m_pBrowserApp->get_Height(&result);
00303     return result;
00304 }
00305
00306 BOOL CCJHtmlView::GetVisible() const
00307 {
00308     ASSERT(m_pBrowserApp != NULL);
00309
00310     VARIANT_BOOL result;
00311     m_pBrowserApp->get_Visible(&result);
00312     return result;
00313 }
00314
00315 CString CCJHtmlView::GetLocationName() const
00316 {
00317     ASSERT(m_pBrowserApp != NULL);
00318
00319     BSTR bstr;
00320     m_pBrowserApp->get_LocationName(&bstr);
00321     CString retVal(bstr);
00322     return retVal;
00323 }
00324
00325 CString CCJHtmlView::GetLocationURL() const
00326 {
00327     ASSERT(m_pBrowserApp != NULL);
00328
00329     BSTR bstr;
00330     m_pBrowserApp->get_LocationURL(&bstr);
00331     CString retVal(bstr);
00332     return retVal;
00333 }
00334
00335 BOOL CCJHtmlView::GetBusy() const
00336 {
00337     ASSERT(m_pBrowserApp != NULL);
00338
00339     VARIANT_BOOL result;
00340     m_pBrowserApp->get_Busy(&result);
00341     return result;
00342 }
00343
00344 READYSTATE CCJHtmlView::GetReadyState() const
00345 {
00346     ASSERT(m_pBrowserApp != NULL);
00347
00348     READYSTATE result;
00349     m_pBrowserApp->get_ReadyState(&result);
00350     return result;
00351 }
00352
00353 BOOL CCJHtmlView::GetOffline() const
00354 {
00355     ASSERT(m_pBrowserApp != NULL);
00356
00357     VARIANT_BOOL result;
00358     m_pBrowserApp->get_Offline(&result);
00359     return result;
00360 }
00361
00362 BOOL CCJHtmlView::GetSilent() const
00363 {
00364     ASSERT(m_pBrowserApp != NULL);
00365
00366     VARIANT_BOOL result;
00367     m_pBrowserApp->get_Silent(&result);
00368     return result;
00369 }
00370
00371 LPDISPATCH CCJHtmlView::GetApplication() const
00372 {
00373     ASSERT(m_pBrowserApp != NULL);
00374
00375     LPDISPATCH result;
00376     m_pBrowserApp->get_Application(&result);
00377     return result;
00378 }
00379
00380
00381 LPDISPATCH CCJHtmlView::GetParentBrowser() const
00382 {
00383     ASSERT(m_pBrowserApp != NULL);
00384
00385     LPDISPATCH result;
00386     m_pBrowserApp->get_Parent(&result);
00387     return result;
00388 }
00389
00390 LPDISPATCH CCJHtmlView::GetContainer() const
00391 {
00392     ASSERT(m_pBrowserApp != NULL);
00393
00394     LPDISPATCH result;
00395     m_pBrowserApp->get_Container(&result);
00396     return result;
00397 }
00398
00399 LPDISPATCH CCJHtmlView::GetHtmlDocument() const
00400 {
00401     ASSERT(m_pBrowserApp != NULL);
00402
00403     LPDISPATCH result;
00404     m_pBrowserApp->get_Document(&result);
00405     return result;
00406 }
00407
00408 BOOL CCJHtmlView::GetTopLevelContainer() const
00409 {
00410     ASSERT(m_pBrowserApp != NULL);
00411
00412     VARIANT_BOOL result;
00413     m_pBrowserApp->get_TopLevelContainer(&result);
00414     return result;
00415 }
00416
00417 BOOL CCJHtmlView::GetMenuBar() const
00418 {
00419     ASSERT(m_pBrowserApp != NULL);
00420
00421     VARIANT_BOOL result;
00422     m_pBrowserApp->get_MenuBar(&result);
00423     return result;
00424 }
00425
00426 BOOL CCJHtmlView::GetFullScreen() const
00427 {
00428     ASSERT(m_pBrowserApp != NULL);
00429
00430     VARIANT_BOOL result;
00431     m_pBrowserApp->get_FullScreen(&result);
00432     return result;
00433 }
00434
00435 BOOL CCJHtmlView::GetStatusBar() const
00436 {
00437     ASSERT(m_pBrowserApp != NULL);
00438
00439     VARIANT_BOOL result;
00440     m_pBrowserApp->get_StatusBar(&result);
00441     return result;
00442 }
00443
00444 OLECMDF CCJHtmlView::QueryStatusWB(OLECMDID cmdID) const
00445 {
00446     ASSERT(m_pBrowserApp != NULL);
00447
00448     OLECMDF result;
00449     m_pBrowserApp->QueryStatusWB(cmdID, &result);
00450     return result;
00451 }
00452
00453 void CCJHtmlView::ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt,
00454     VARIANT* pvaIn, VARIANT* pvaOut)
00455 {
00456     ASSERT(m_pBrowserApp != NULL);
00457
00458     m_pBrowserApp->ExecWB(cmdID, cmdexecopt, pvaIn, pvaOut);
00459 }
00460
00461 BOOL CCJHtmlView::GetRegisterAsBrowser() const
00462 {
00463     ASSERT(m_pBrowserApp != NULL);
00464
00465     VARIANT_BOOL result;
00466     m_pBrowserApp->get_RegisterAsBrowser(&result);
00467     return result;
00468 }
00469
00470 BOOL CCJHtmlView::GetRegisterAsDropTarget() const
00471 {
00472     ASSERT(m_pBrowserApp != NULL);
00473
00474     VARIANT_BOOL result;
00475     m_pBrowserApp->get_RegisterAsDropTarget(&result);
00476     return result;
00477 }
00478
00479 BOOL CCJHtmlView::GetTheaterMode() const
00480 {
00481     ASSERT(m_pBrowserApp != NULL);
00482
00483     VARIANT_BOOL result;
00484     m_pBrowserApp->get_TheaterMode(&result);
00485     return result;
00486 }
00487
00488 BOOL CCJHtmlView::GetAddressBar() const
00489 {
00490     ASSERT(m_pBrowserApp != NULL);
00491
00492     VARIANT_BOOL result;
00493     m_pBrowserApp->get_AddressBar(&result);
00494     return result;
00495 }
00496
00498 // CCJHtmlView operations
00499
00500 BOOL CCJHtmlView::LoadFromResource(LPCTSTR lpszResource)
00501 {
00502     HINSTANCE hInstance = AfxGetResourceHandle();
00503     ASSERT(hInstance != NULL);
00504
00505     CString strResourceURL;
00506     BOOL bRetVal = TRUE;
00507     LPTSTR lpszModule = new TCHAR[_MAX_PATH];
00508
00509     if (GetModuleFileName(hInstance, lpszModule, _MAX_PATH))
00510     {
00511         strResourceURL.Format(_T("res://%s/%s"), lpszModule, lpszResource);
00512         Navigate(strResourceURL, 0, 0, 0);
00513     }
00514     else
00515         bRetVal = FALSE;
00516
00517     delete [] lpszModule;
00518     return bRetVal;
00519 }
00520
00521 BOOL CCJHtmlView::LoadFromResource(UINT nRes)
00522 {
00523     HINSTANCE hInstance = AfxGetResourceHandle();
00524     ASSERT(hInstance != NULL);
00525
00526     CString strResourceURL;
00527     BOOL bRetVal = TRUE;
00528     LPTSTR lpszModule = new TCHAR[_MAX_PATH];
00529
00530     if (GetModuleFileName(hInstance, lpszModule, _MAX_PATH))
00531     {
00532         strResourceURL.Format(_T("res://%s/%d"), lpszModule, nRes);
00533         Navigate(strResourceURL, 0, 0, 0);
00534     }
00535     else
00536         bRetVal = FALSE;
00537
00538     delete [] lpszModule;
00539     return bRetVal;
00540 }
00541
00542 void CCJHtmlView::Navigate(LPCTSTR lpszURL, DWORD dwFlags /* = 0 */,
00543     LPCTSTR lpszTargetFrameName /* = NULL */ ,
00544     LPCTSTR lpszHeaders /* = NULL */, LPVOID lpvPostData /* = NULL */,
00545     DWORD dwPostDataLen /* = 0 */)
00546 {
00547     CString strURL(lpszURL);
00548     BSTR bstrURL = strURL.AllocSysString();
00549
00550     COleSafeArray vPostData;
00551     if (lpvPostData != NULL)
00552     {
00553         if (dwPostDataLen == 0)
00554             dwPostDataLen = lstrlen((LPCTSTR) lpvPostData);
00555
00556         vPostData.CreateOneDim(VT_UI1, dwPostDataLen, lpvPostData);
00557     }
00558
00559     m_pBrowserApp->Navigate(bstrURL,
00560         COleVariant((long) dwFlags, VT_I4),
00561         COleVariant(lpszTargetFrameName, VT_BSTR),
00562         vPostData,
00563         COleVariant(lpszHeaders, VT_BSTR));
00564 }
00565
00566 #ifdef _VC_VERSION_5
00567 void MakeOleVariant(COleVariant &ov, LPCITEMIDLIST pidl)
00568 {
00569     AfxVariantInit(&ov);
00570
00571     if (pidl != NULL)
00572     {
00573         // walk through entries in the list and accumulate their size
00574
00575         UINT cbTotal = 0;
00576         SAFEARRAY *psa = NULL;
00577         LPCITEMIDLIST pidlWalker = pidl;
00578
00579         while (pidlWalker->mkid.cb)
00580         {
00581             cbTotal += pidlWalker->mkid.cb;
00582             pidlWalker = (LPCITEMIDLIST)
00583                 (((LPBYTE)pidlWalker) + pidlWalker->mkid.cb);
00584         }
00585
00586         // add the base structure size
00587         cbTotal += sizeof(ITEMIDLIST);
00588
00589         // get a safe array for them
00590         psa = SafeArrayCreateVector(VT_UI1, 0, cbTotal);
00591
00592         // copy it and set members
00593         if (psa != NULL)
00594         {
00595             memcpy(psa->pvData, (LPBYTE) pidl, cbTotal);
00596             ov.vt = VT_ARRAY | VT_UI1;
00597             ov.parray = psa;
00598         }
00599     }
00600 }
00601 #endif
00602
00603 void CCJHtmlView::Navigate2(LPITEMIDLIST pIDL, DWORD dwFlags /* = 0 */,
00604     LPCTSTR lpszTargetFrameName /* = NULL */)
00605 {
00606     ASSERT(m_pBrowserApp != NULL);
00607
00608 #ifdef _VC_VERSION_5
00609     COleVariant vPIDL;
00610     MakeOleVariant(vPIDL, pIDL);
00611 #else
00612     COleVariant vPIDL(pIDL);
00613 #endif
00614     COleVariant empty;
00615
00616     m_pBrowserApp->Navigate2(vPIDL,
00617         COleVariant((long) dwFlags, VT_I4),
00618         COleVariant(lpszTargetFrameName, VT_BSTR),
00619         empty, empty);
00620 }
00621
00622 void CCJHtmlView::Navigate2(LPCTSTR lpszURL, DWORD dwFlags /* = 0 */,
00623     LPCTSTR lpszTargetFrameName /* = NULL */,
00624     LPCTSTR lpszHeaders /* = NULL */,
00625     LPVOID lpvPostData /* = NULL */, DWORD dwPostDataLen /* = 0 */)
00626 {
00627     ASSERT(m_pBrowserApp != NULL);
00628
00629     COleSafeArray vPostData;
00630     if (lpvPostData != NULL)
00631     {
00632         if (dwPostDataLen == 0)
00633             dwPostDataLen = lstrlen((LPCTSTR) lpvPostData);
00634
00635         vPostData.CreateOneDim(VT_UI1, dwPostDataLen, lpvPostData);
00636     }
00637
00638     COleVariant vURL(lpszURL, VT_BSTR);
00639     COleVariant vHeaders(lpszHeaders, VT_BSTR);
00640     COleVariant vTargetFrameName(lpszTargetFrameName, VT_BSTR);
00641     COleVariant vFlags((long) dwFlags, VT_I4);
00642
00643     m_pBrowserApp->Navigate2(vURL,
00644         vFlags, vTargetFrameName, vPostData, vHeaders);
00645 }
00646
00647 void CCJHtmlView::Navigate2(LPCTSTR lpszURL, DWORD dwFlags,
00648     CByteArray& baPostData, LPCTSTR lpszTargetFrameName /* = NULL */,
00649     LPCTSTR lpszHeaders /* = NULL */)
00650 {
00651     ASSERT(m_pBrowserApp != NULL);
00652
00653     COleVariant vPostData = baPostData;
00654     COleVariant vURL(lpszURL, VT_BSTR);
00655     COleVariant vHeaders(lpszHeaders, VT_BSTR);
00656     COleVariant vTargetFrameName(lpszTargetFrameName, VT_BSTR);
00657     COleVariant vFlags((long) dwFlags, VT_I4);
00658
00659     ASSERT(m_pBrowserApp != NULL);
00660
00661     m_pBrowserApp->Navigate2(vURL, vFlags, vTargetFrameName,
00662         vPostData, vHeaders);
00663 }
00664
00665 void CCJHtmlView::PutProperty(LPCTSTR lpszProperty, const VARIANT& vtValue)
00666 {
00667     ASSERT(m_pBrowserApp != NULL);
00668
00669     CString strProp(lpszProperty);
00670     BSTR bstrProp = strProp.AllocSysString();
00671     m_pBrowserApp->PutProperty(bstrProp, vtValue);
00672     ::SysFreeString(bstrProp);
00673 }
00674
00675 BOOL CCJHtmlView::GetProperty(LPCTSTR lpszProperty, CString& strValue)
00676 {
00677     ASSERT(m_pBrowserApp != NULL);
00678
00679     CString strProperty(lpszProperty);
00680     BSTR bstrProperty = strProperty.AllocSysString();
00681
00682     BOOL bResult = FALSE;
00683     VARIANT vReturn;
00684     vReturn.vt = VT_BSTR;
00685     vReturn.bstrVal = NULL;
00686     HRESULT hr = m_pBrowserApp->GetProperty(bstrProperty, &vReturn);
00687
00688     if (SUCCEEDED(hr))
00689     {
00690         strValue = CString(vReturn.bstrVal);
00691         bResult = TRUE;
00692     }
00693
00694     ::SysFreeString(bstrProperty);
00695     return bResult;
00696 }
00697
00698 COleVariant CCJHtmlView::GetProperty(LPCTSTR lpszProperty)
00699 {
00700     COleVariant result;
00701
00702     static BYTE parms[] =
00703         VTS_BSTR;
00704     m_wndBrowser.InvokeHelper(0x12f, DISPATCH_METHOD,
00705         VT_VARIANT, (void*)&result, parms, lpszProperty);
00706
00707     return result;
00708 }
00709
00710 CString CCJHtmlView::GetFullName() const
00711 {
00712     ASSERT(m_pBrowserApp != NULL);
00713
00714     BSTR bstr;
00715     m_pBrowserApp->get_FullName(&bstr);
00716     CString retVal(bstr);
00717     return retVal;
00718 }
00719
00721 // CCJHtmlView event reflectors
00722
00723 void CCJHtmlView::NavigateComplete2(LPDISPATCH /* pDisp */, VARIANT* URL)
00724 {
00725     ASSERT(V_VT(URL) == VT_BSTR);
00726
00727     USES_CONVERSION;
00728
00729     CString str = OLE2T(V_BSTR(URL));
00730     OnNavigateComplete2(str);
00731 }
00732
00733 void CCJHtmlView::BeforeNavigate2(LPDISPATCH /* pDisp */, VARIANT* URL,
00734         VARIANT* Flags, VARIANT* TargetFrameName,
00735         VARIANT* PostData, VARIANT* Headers, BOOL* Cancel)
00736 {
00737     ASSERT(V_VT(URL) == VT_BSTR);
00738     ASSERT(V_VT(TargetFrameName) == VT_BSTR);
00739     ASSERT(V_VT(PostData) == (VT_VARIANT | VT_BYREF));
00740     ASSERT(V_VT(Headers) == VT_BSTR);
00741     ASSERT(Cancel != NULL);
00742
00743     USES_CONVERSION;
00744
00745     VARIANT* vtPostedData = V_VARIANTREF(PostData);
00746     CByteArray array;
00747     if (V_VT(vtPostedData) & VT_ARRAY)
00748     {
00749         // must be a vector of bytes
00750         ASSERT(vtPostedData->parray->cDims == 1 && vtPostedData->parray->cbElements == 1);
00751
00752         vtPostedData->vt |= VT_UI1;
00753         COleSafeArray safe(vtPostedData);
00754
00755         DWORD dwSize = safe.GetOneDimSize();
00756         LPVOID pVoid;
00757         safe.AccessData(&pVoid);
00758
00759         array.SetSize(dwSize);
00760         LPBYTE lpByte = array.GetData();
00761
00762         memcpy(lpByte, pVoid, dwSize);
00763         safe.UnaccessData();
00764     }
00765     // make real parameters out of the notification
00766
00767     CString strTargetFrameName(V_BSTR(TargetFrameName));
00768     CString strURL = V_BSTR(URL);
00769     CString strHeaders = V_BSTR(Headers);
00770     DWORD nFlags = V_I4(Flags);
00771
00772     // notify the user's class
00773     OnBeforeNavigate2(strURL, nFlags, strTargetFrameName,
00774         array, strHeaders, Cancel);
00775 }
00776
00777 void CCJHtmlView::DocumentComplete(LPDISPATCH pDisp, VARIANT* URL)
00778 {
00779     UNUSED_ALWAYS(pDisp);
00780     ASSERT(V_VT(URL) == VT_BSTR);
00781
00782     CString str(V_BSTR(URL));
00783     OnDocumentComplete(str);
00784 }
00785
00787 // CCJHtmlView Events
00788
00789 void CCJHtmlView::OnProgressChange(long lProgress, long lProgressMax)
00790 {
00791     // user will override to handle this notification
00792     UNUSED_ALWAYS(lProgress);
00793     UNUSED_ALWAYS(lProgressMax);
00794 }
00795
00796 void CCJHtmlView::OnCommandStateChange(long lCommand, BOOL bEnable)
00797 {
00798     // user will override to handle this notification
00799     UNUSED_ALWAYS(lCommand);
00800     UNUSED_ALWAYS(bEnable);
00801 }
00802
00803 void CCJHtmlView::OnDownloadBegin()
00804 {
00805     // user will override to handle this notification
00806 }
00807
00808 void CCJHtmlView::OnDownloadComplete()
00809 {
00810     // user will override to handle this notification
00811 }
00812
00813 void CCJHtmlView::OnTitleChange(LPCTSTR lpszText)
00814 {
00815     // user will override to handle this notification
00816     UNUSED_ALWAYS(lpszText);
00817 }
00818
00819 void CCJHtmlView::OnPropertyChange(LPCTSTR lpszProperty)
00820 {
00821     // user will override to handle this notification
00822     UNUSED_ALWAYS(lpszProperty);
00823 }
00824
00825 void CCJHtmlView::OnNewWindow2(LPDISPATCH* ppDisp, BOOL* bCancel)
00826 {
00827     // default to continuing
00828     bCancel = FALSE;
00829
00830     // user will override to handle this notification
00831     UNUSED_ALWAYS(ppDisp);
00832 }
00833
00834 void CCJHtmlView::OnDocumentComplete(LPCTSTR lpszURL)
00835 {
00836     // user will override to handle this notification
00837     UNUSED_ALWAYS(lpszURL);
00838 }
00839
00840 void CCJHtmlView::OnQuit()
00841 {
00842     // user will override to handle this notification
00843 }
00844
00845 void CCJHtmlView::OnVisible(BOOL bVisible)
00846 {
00847     // user will override to handle this notification
00848     UNUSED_ALWAYS(bVisible);
00849 }
00850
00851 void CCJHtmlView::OnToolBar(BOOL bToolBar)
00852 {
00853     // user will override to handle this notification
00854     UNUSED_ALWAYS(bToolBar);
00855 }
00856
00857 void CCJHtmlView::OnMenuBar(BOOL bMenuBar)
00858 {
00859     // user will override to handle this notification
00860     UNUSED_ALWAYS(bMenuBar);
00861 }
00862
00863 void CCJHtmlView::OnStatusBar(BOOL bStatusBar)
00864 {
00865     // user will override to handle this notification
00866     UNUSED_ALWAYS(bStatusBar);
00867 }
00868
00869 void CCJHtmlView::OnFullScreen(BOOL bFullScreen)
00870 {
00871     // user will override to handle this notification
00872     UNUSED_ALWAYS(bFullScreen);
00873 }
00874
00875 void CCJHtmlView::OnTheaterMode(BOOL bTheaterMode)
00876 {
00877     // user will override to handle this notification
00878     UNUSED_ALWAYS(bTheaterMode);
00879 }
00880
00881 void CCJHtmlView::OnNavigateComplete2(LPCTSTR lpszURL)
00882 {
00883     // user will override to handle this notification
00884     UNUSED_ALWAYS(lpszURL);
00885 }
00886
00887 void CCJHtmlView::OnBeforeNavigate2(LPCTSTR lpszURL, DWORD nFlags,
00888     LPCTSTR lpszTargetFrameName, CByteArray& baPostData,
00889     LPCTSTR lpszHeaders, BOOL* bCancel)
00890 {
00891     // default to continuing
00892     bCancel = FALSE;
00893
00894     // user will override to handle this notification
00895     UNUSED_ALWAYS(lpszURL);
00896     UNUSED_ALWAYS(nFlags);
00897     UNUSED_ALWAYS(lpszTargetFrameName);
00898     UNUSED_ALWAYS(baPostData);
00899     UNUSED_ALWAYS(lpszHeaders);
00900 }
00901
00902 void CCJHtmlView::OnStatusTextChange(LPCTSTR pszText)
00903 {
00904     // try to set the status bar text via the frame
00905
00906     CFrameWnd* pFrame = GetParentFrame();
00907     if (pFrame != NULL)
00908         pFrame->SetMessageText(pszText);
00909 }
00910
00912 // Helps to eliminate screen flicker.
00913
00914 BOOL CCJHtmlView::OnEraseBkgnd(CDC* pDC)
00915 {
00916     CRect rectClient;
00917     GetClientRect( &rectClient );
00918     pDC->ExcludeClipRect( &rectClient );
00919     return CFormView::OnEraseBkgnd(pDC);
00920 }
00921
00923 // Pre-startup code
00924
00925 #ifdef AFX_INIT_SEG
00926 #pragma code_seg(AFX_INIT_SEG)
00927 #endif
00928
00929 IMPLEMENT_DYNCREATE(CCJHtmlView, CFormView)
Generated on Sun Feb 24 01:21:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJHyperLink.cpp Source File

WinCvs/CJLib/CJLibrary/CJHyperLink.cpp

Go to the documentation of this file.
00001 // CJHyperLink.cpp : implementation file
00002 //
00003 // CCJHyperLink static control. Will open the default browser with the given URL
00004 // when the user clicks on the link.
00005 //
00006 // Copyright (C) 1997, 1998 Chris Maunder
00007 // All rights reserved. May not be sold for profit.
00008 //
00009 // Thanks to Pål K. Tønder for auto-size and window caption changes.
00010 //
00011 // "GotoURL" function by Stuart Patterson
00012 // As seen in the August, 1997 Windows Developer's Journal.
00013 // Copyright 1997 by Miller Freeman, Inc. All rights reserved.
00014 // Modified by Chris Maunder to use TCHARs instead of chars.
00015 //
00016 // "Default hand cursor" from Paul DiLascia's Jan 1998 MSJ article.
00017 //
00019 /****************************************************************************
00020  *
00021  * $Date: 1999/11/30 21:45:49 $
00022  * $Revision: 1.1.1.3 $
00023  * $Archive: /CodeJock/CJLibrary/CJHyperLink.cpp $
00024  *
00025  * $History: CJHyperLink.cpp $
00026  *
00027  * *****************  Version 5  *****************
00028  * User: Kirk Stowell Date: 10/14/99   Time: 11:46p
00029  * Updated in $/CodeJock/CJLibrary
00030  * Fixed memory leak caused by not freeing link cursor. Thanks to Matt
00031  * Davies [matt.davies@codehammer.com] for help with this.
00032  *
00033  * *****************  Version 4  *****************
00034  * User: Kirk Stowell Date: 10/14/99   Time: 12:26p
00035  * Updated in $/CodeJock/CJLibrary
00036  * Added source control history to file header.
00037  *
00038  ***************************************************************************/
00040
00041 #include "stdafx.h"
00042 #include "CJHyperLink.h"
00043
00044 #ifdef _DEBUG
00045 #define new DEBUG_NEW
00046 #undef THIS_FILE
00047 static char THIS_FILE[] = __FILE__;
00048 #endif
00049
00050 #define TOOLTIP_ID 1
00051
00053 // CCJHyperLink
00054
00055 CCJHyperLink::CCJHyperLink()
00056 {
00057     m_hLinkCursor       = NULL;                 // No cursor as yet
00058     m_crLinkColor      = RGB(  0,   0, 238);   // Blue
00059     m_crVisitedColor   = RGB( 85,  26, 139);   // Purple
00060     m_crHoverColor     = ::GetSysColor(COLOR_HIGHLIGHT);
00061     m_bOverControl      = FALSE;                // Cursor not yet over control
00062     m_bVisited          = FALSE;                // Hasn't been visited yet.
00063     m_bUnderline        = TRUE;                 // Underline the link?
00064     m_bAdjustToFit      = TRUE;                 // Resize the window to fit the text?
00065     m_strURL.Empty();
00066 }
00067
00068 CCJHyperLink::~CCJHyperLink()
00069 {
00070     m_Font.DeleteObject();
00071     if (m_hLinkCursor) {
00072         DestroyCursor(m_hLinkCursor);
00073     }
00074 }
00075
00076 BEGIN_MESSAGE_MAP(CCJHyperLink, CStatic)
00077     //{{AFX_MSG_MAP(CCJHyperLink)
00078     ON_CONTROL_REFLECT(STN_CLICKED, OnClicked)
00079     ON_WM_CTLCOLOR_REFLECT()
00080     ON_WM_SETCURSOR()
00081     ON_WM_MOUSEMOVE()
00082     //}}AFX_MSG_MAP
00083 END_MESSAGE_MAP()
00084
00086 // CCJHyperLink message handlers
00087
00088 BOOL CCJHyperLink::PreTranslateMessage(MSG* pMsg)
00089 {
00090     m_ToolTip.RelayEvent(pMsg);
00091     return CStatic::PreTranslateMessage(pMsg);
00092 }
00093
00094 void CCJHyperLink::OnClicked()
00095 {
00096     int result = (int)GotoURL(m_strURL, SW_SHOW);
00097     m_bVisited = (result > HINSTANCE_ERROR);
00098     if (!m_bVisited) {
00099         MessageBeep(MB_ICONEXCLAMATION);     // Unable to follow link
00100         ReportError(result);
00101     } else
00102         SetVisited();                        // Repaint to show visited Color
00103 }
00104
00105 HBRUSH CCJHyperLink::CtlColor(CDC* pDC, UINT nCtlColor)
00106 {
00107 #ifdef _DEBUG
00108     ASSERT(nCtlColor == CTLCOLOR_STATIC);
00109 #else
00110     UNUSED_ALWAYS( nCtlColor );
00111 #endif
00112
00113     if (m_bOverControl)
00114         pDC->SetTextColor(m_crHoverColor);
00115     else if (m_bVisited)
00116         pDC->SetTextColor(m_crVisitedColor);
00117     else
00118         pDC->SetTextColor(m_crLinkColor);
00119
00120     // transparent text.
00121     pDC->SetBkMode(TRANSPARENT);
00122     return (HBRUSH)GetStockObject(NULL_BRUSH);
00123 }
00124
00125 void CCJHyperLink::OnMouseMove(UINT nFlags, CPoint point)
00126 {
00127     CStatic::OnMouseMove(nFlags, point);
00128
00129     if (m_bOverControl)        // Cursor is currently over control
00130     {
00131         CRect rect;
00132         GetClientRect(rect);
00133
00134         if (!rect.PtInRect(point))
00135         {
00136             m_bOverControl = FALSE;
00137             ReleaseCapture();
00138             RedrawWindow();
00139             return;
00140         }
00141     }
00142     else                      // Cursor has just moved over control
00143     {
00144         m_bOverControl = TRUE;
00145         RedrawWindow();
00146         SetCapture();
00147     }
00148 }
00149
00150 BOOL CCJHyperLink::OnSetCursor(CWnd* /*pWnd*/, UINT /*nHitTest*/, UINT /*message*/)
00151 {
00152     if (m_hLinkCursor)
00153     {
00154         ::SetCursor(m_hLinkCursor);
00155         return TRUE;
00156     }
00157     return FALSE;
00158 }
00159
00160 void CCJHyperLink::PreSubclassWindow()
00161 {
00162     // We want to get mouse clicks via STN_CLICKED
00163     DWORD dwStyle = GetStyle();
00164     ::SetWindowLong(GetSafeHwnd(), GWL_STYLE, dwStyle | SS_NOTIFY);
00165
00166     // Set the URL as the window text
00167     if (m_strURL.IsEmpty())
00168         GetWindowText(m_strURL);
00169
00170     // Check that the window text isn't empty. If it is, set it as the URL.
00171     CString strWndText;
00172     GetWindowText(strWndText);
00173     if (strWndText.IsEmpty()) {
00174         ASSERT(!m_strURL.IsEmpty());    // Window and URL both NULL. DUH!
00175         SetWindowText(m_strURL);
00176     }
00177
00178     // Create the font
00179     LOGFONT lf;
00180     GetFont()->GetLogFont(&lf);
00181     lf.lfUnderline = (char)m_bUnderline;
00182     m_Font.CreateFontIndirect(&lf);
00183     SetFont(&m_Font);
00184
00185     PositionWindow();        // Adjust size of window to fit URL if necessary
00186     SetDefaultCursor();      // Try and load up a "hand" cursor
00187
00188     // Create the tooltip
00189     CRect rect;
00190     GetClientRect(rect);
00191     m_ToolTip.Create(this);
00192     m_ToolTip.AddTool(this, m_strURL, rect, TOOLTIP_ID);
00193
00194     CStatic::PreSubclassWindow();
00195 }
00196
00198 // CCJHyperLink operations
00199
00200 void CCJHyperLink::SetURL(CString strURL)
00201 {
00202     m_strURL = strURL;
00203
00204     if (::IsWindow(GetSafeHwnd())) {
00205         PositionWindow();
00206         m_ToolTip.UpdateTipText(strURL, this, TOOLTIP_ID);
00207     }
00208 }
00209
00210 CString CCJHyperLink::GetURL() const
00211 {
00212     return m_strURL;
00213 }
00214
00215 void CCJHyperLink::SetColors(COLORREF crLinkColor, COLORREF crVisitedColor,
00216                             COLORREF crHoverColor /* = -1 */)
00217 {
00218     m_crLinkColor    = crLinkColor;
00219     m_crVisitedColor = crVisitedColor;
00220
00221     if (crHoverColor == -1)
00222         m_crHoverColor = ::GetSysColor(COLOR_HIGHLIGHT);
00223     else
00224         m_crHoverColor = crHoverColor;
00225
00226     if (::IsWindow(m_hWnd))
00227         Invalidate();
00228 }
00229
00230 COLORREF CCJHyperLink::GetLinkColor() const
00231 {
00232     return m_crLinkColor;
00233 }
00234
00235 COLORREF CCJHyperLink::GetVisitedColor() const
00236 {
00237     return m_crVisitedColor;
00238 }
00239
00240 COLORREF CCJHyperLink::GetHoverColor() const
00241 {
00242     return m_crHoverColor;
00243 }
00244
00245 void CCJHyperLink::SetVisited(BOOL bVisited /* = TRUE */)
00246 {
00247     m_bVisited = bVisited;
00248
00249     if (::IsWindow(GetSafeHwnd()))
00250         Invalidate();
00251 }
00252
00253 BOOL CCJHyperLink::GetVisited() const
00254 {
00255     return m_bVisited;
00256 }
00257
00258 void CCJHyperLink::SetLinkCursor(HCURSOR hCursor)
00259 {
00260     m_hLinkCursor = hCursor;
00261     if (m_hLinkCursor == NULL)
00262         SetDefaultCursor();
00263 }
00264
00265 HCURSOR CCJHyperLink::GetLinkCursor() const
00266 {
00267     return m_hLinkCursor;
00268 }
00269
00270 void CCJHyperLink::SetUnderline(BOOL bUnderline /* = TRUE */)
00271 {
00272     m_bUnderline = bUnderline;
00273
00274     if (::IsWindow(GetSafeHwnd()))
00275     {
00276         LOGFONT lf;
00277         GetFont()->GetLogFont(&lf);
00278         lf.lfUnderline = (char)m_bUnderline;
00279
00280         m_Font.DeleteObject();
00281         m_Font.CreateFontIndirect(&lf);
00282         SetFont(&m_Font);
00283
00284         Invalidate();
00285     }
00286 }
00287
00288 BOOL CCJHyperLink::GetUnderline() const
00289 {
00290     return m_bUnderline;
00291 }
00292
00293 void CCJHyperLink::SetAutoSize(BOOL bAutoSize /* = TRUE */)
00294 {
00295     m_bAdjustToFit = bAutoSize;
00296
00297     if (::IsWindow(GetSafeHwnd()))
00298         PositionWindow();
00299 }
00300
00301 BOOL CCJHyperLink::GetAutoSize() const
00302 {
00303     return m_bAdjustToFit;
00304 }
00305
00306
00307 // Move and resize the window so that the window is the same size
00308 // as the hyperlink text. This stops the hyperlink cursor being active
00309 // when it is not directly over the text. If the text is left justified
00310 // then the window is merely shrunk, but if it is centred or right
00311 // justified then the window will have to be moved as well.
00312 //
00313 // Suggested by Pål K. Tønder
00314
00315 void CCJHyperLink::PositionWindow()
00316 {
00317     if (!::IsWindow(GetSafeHwnd()) || !m_bAdjustToFit)
00318         return;
00319
00320     // Get the current window position
00321     CRect rect;
00322     GetWindowRect(rect);
00323
00324     CWnd* pParent = GetParent();
00325     if (pParent)
00326         pParent->ScreenToClient(rect);
00327
00328     // Get the size of the window text
00329     CString strWndText;
00330     GetWindowText(strWndText);
00331
00332     CDC* pDC = GetDC();
00333     CFont* pOldFont = pDC->SelectObject(&m_Font);
00334     CSize Extent = pDC->GetTextExtent(strWndText);
00335     pDC->SelectObject(pOldFont);
00336     ReleaseDC(pDC);
00337
00338     // Get the text justification via the window style
00339     DWORD dwStyle = GetStyle();
00340
00341     // Recalc the window size and position based on the text justification
00342     if (dwStyle & SS_CENTERIMAGE)
00343         rect.DeflateRect(0, (rect.Height() - Extent.cy)/2);
00344     else
00345         rect.bottom = rect.top + Extent.cy;
00346
00347     if (dwStyle & SS_CENTER)
00348         rect.DeflateRect((rect.Width() - Extent.cx)/2, 0);
00349     else if (dwStyle & SS_RIGHT)
00350         rect.left  = rect.right - Extent.cx;
00351     else // SS_LEFT = 0, so we can't test for it explicitly
00352         rect.right = rect.left + Extent.cx;
00353
00354     // Move the window
00355     SetWindowPos(NULL, rect.left, rect.top, rect.Width(), rect.Height(), SWP_NOZORDER);
00356 }
00357
00359 // CCJHyperLink implementation
00360
00361 // The following appeared in Paul DiLascia's Jan 1998 MSJ articles.
00362 // It loads a "hand" cursor from the winhlp32.exe module
00363 void CCJHyperLink::SetDefaultCursor()
00364 {
00365     if (m_hLinkCursor == NULL)                // No cursor handle - load our own
00366     {
00367         // Get the windows directory
00368         CString strWndDir;
00369         GetWindowsDirectory(strWndDir.GetBuffer(MAX_PATH), MAX_PATH);
00370         strWndDir.ReleaseBuffer();
00371
00372         strWndDir += _T("\\winhlp32.exe");
00373         // This retrieves cursor #106 from winhlp32.exe, which is a hand pointer
00374         HMODULE hModule = LoadLibrary(strWndDir);
00375         if (hModule) {
00376             HCURSOR hHandCursor = ::LoadCursor(hModule, MAKEINTRESOURCE(106));
00377             if (hHandCursor)
00378                 m_hLinkCursor = CopyCursor(hHandCursor);
00379         }
00380         FreeLibrary(hModule);
00381     }
00382 }
00383
00384 LONG CCJHyperLink::GetRegKey(HKEY key, LPCTSTR subkey, LPTSTR retdata)
00385 {
00386     HKEY hkey;
00387     LONG retval = RegOpenKeyEx(key, subkey, 0, KEY_QUERY_VALUE, &hkey);
00388
00389     if (retval == ERROR_SUCCESS) {
00390         long datasize = MAX_PATH;
00391         TCHAR data[MAX_PATH];
00392         RegQueryValue(hkey, NULL, data, &datasize);
00393         _tcscpy(retdata,data);
00394         RegCloseKey(hkey);
00395     }
00396
00397     return retval;
00398 }
00399
00400 void CCJHyperLink::ReportError(int nError)
00401 {
00402     CString str;
00403     switch (nError) {
00404         case 0:                       str = _T("The operating system is out\nof memory or resources."); break;
00405         case SE_ERR_PNF:              str = _T("The specified path was not found."); break;
00406         case SE_ERR_FNF:              str = _T("The specified file was not found."); break;
00407         case ERROR_BAD_FORMAT:        str = _T("The .EXE file is invalid\n(non-Win32 .EXE or error in .EXE image)."); break;
00408         case SE_ERR_ACCESSDENIED:     str = _T("The operating system denied\naccess to the specified file."); break;
00409         case SE_ERR_ASSOCINCOMPLETE:  str = _T("The filename association is\nincomplete or invalid."); break;
00410         case SE_ERR_DDEBUSY:          str = _T("The DDE transaction could not\nbe completed because other DDE transactions\nwere being processed."); break;
00411         case SE_ERR_DDEFAIL:          str = _T("The DDE transaction failed."); break;
00412         case SE_ERR_DDETIMEOUT:       str = _T("The DDE transaction could not\nbe completed because the request timed out."); break;
00413         case SE_ERR_DLLNOTFOUND:      str = _T("The specified dynamic-link library was not found."); break;
00414         case SE_ERR_NOASSOC:          str = _T("There is no application associated\nwith the given filename extension."); break;
00415         case SE_ERR_OOM:              str = _T("There was not enough memory to complete the operation."); break;
00416         case SE_ERR_SHARE:            str = _T("A sharing violation occurred. ");
00417         default:                      str.Format(_T("Unknown Error (%d) occurred."), nError); break;
00418     }
00419     str = _T("Unable to open hyperlink:\n\n") + str;
00420     AfxMessageBox(str, MB_ICONEXCLAMATION | MB_OK);
00421 }
00422
00423 HINSTANCE CCJHyperLink::GotoURL( LPCTSTR url, int showcmd )
00424 {
00425     TCHAR key[MAX_PATH + MAX_PATH];
00426
00427     // First try ShellExecute()
00428     HINSTANCE result = ShellExecute( NULL, _T("open"), url, NULL, NULL, showcmd );
00429
00430     // If it failed, get the .htm regkey and lookup the program
00431     if((UINT)result <= HINSTANCE_ERROR)
00432     {
00433         if( GetRegKey( HKEY_CLASSES_ROOT, _T(".htm"), key ) == ERROR_SUCCESS )
00434         {
00435             lstrcat( key, _T("\\shell\\open\\command"));
00436
00437             if( GetRegKey( HKEY_CLASSES_ROOT, key, key ) == ERROR_SUCCESS )
00438             {
00439                 LPTSTR pos;
00440
00441                 pos = _tcsstr(key, _T("\"%1\""));
00442
00443                 if( pos == NULL )                       // No quotes found
00444                 {
00445                     pos = _tcsstr( key, _T("%1"));      // Check for %1, without quotes
00446
00447                     if( pos == NULL )                   // No parameter at all...
00448                     {
00449                         pos = key + _tcslen( key ) - 1;
00450                     }
00451                     else
00452                     {
00453                         *pos = _T('\0');                // Remove the parameter
00454                     }
00455                 }
00456                 else
00457                 {
00458                     *pos = _T('\0');                    // Remove the parameter
00459                 }
00460
00461                 lstrcat( pos, _T(" "));
00462                 lstrcat( pos, url );
00463
00464                 PROCESS_INFORMATION pi;
00465
00466                 STARTUPINFO         si;
00467
00468                 ::ZeroMemory( &si, sizeof( si ));
00469
00470                 si.cb = sizeof( si );
00471
00472                 if( ::CreateProcess( NULL,
00473                                      pos,
00474                                      NULL,
00475                                      NULL,
00476                                      FALSE,
00477                                      0,
00478                                      NULL,
00479                                      NULL,
00480                                      &si,
00481                                     &pi ) == FALSE )
00482                 {
00483                     return NULL;
00484                 }
00485
00486                 result = (HINSTANCE) pi.hProcess;
00487             }
00488         }
00489     }
00490
00491     return result;
00492 }
Generated on Sun Feb 24 01:21:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJLibrary.cpp Source File

WinCvs/CJLib/CJLibrary/CJLibrary.cpp

Go to the documentation of this file.
00001 // CJLibrary.cpp : Defines the initialization routines for the DLL.
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/CJLibrary/CJLibrary.cpp $
00011  *
00012  * $History: CJLibrary.cpp $
00013  *
00014  * *****************  Version 8  *****************
00015  * User: Kirk Stowell Date: 10/25/99   Time: 11:02p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Moved check for common control dll to DLL_PROCESS_ATTACH portion of
00018  * DllMain.
00019  *
00020  * *****************  Version 7  *****************
00021  * User: Kirk Stowell Date: 10/14/99   Time: 12:41p
00022  * Updated in $/CodeJock/CJLibrary
00023  * Added source control history to file header.
00024  *
00025  ***************************************************************************/
00027
00028 #include "stdafx.h"
00029 #include <afxdllx.h>
00030 #include "CJToolBar.h"
00031
00032 #ifdef _DEBUG
00033 #define new DEBUG_NEW
00034 #undef THIS_FILE
00035 static char THIS_FILE[] = __FILE__;
00036 #endif
00037
00038
00039 static AFX_EXTENSION_MODULE CJLibraryDLL = { NULL, NULL };
00040
00041 extern "C" int APIENTRY
00042 DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
00043 {
00044     // Remove this if you use lpReserved
00045     UNREFERENCED_PARAMETER(lpReserved);
00046
00047     if (dwReason == DLL_PROCESS_ATTACH)
00048     {
00049         TRACE0("CJLIBRARY.DLL Initializing!\n");
00050
00051         // Extension DLL one-time initialization
00052         if (!AfxInitExtensionModule(CJLibraryDLL, hInstance))
00053             return 0;
00054
00055         // see what version of the common control we are using.
00056         _GetComCtlVersion();
00057         if (_ComCtlVersion < VERSION_IE4) {
00058             ::MessageBox(NULL, _T("Invalid Common Control DLL!\nYou need version 4.70 or higher to use CJLibrary...\nAborting!\n\nCopyright © 1999 CodeJock.com and Copyright © 1998-1999 Kirk W. Stowell, All Rights Reserved\nmailto:kstowell@codejock.com\nhttp://www.codejock.com"), _T("Invalid COMCTL32.DLL"), MB_ICONSTOP);
00059             return 0;
00060         }
00061
00062         // Insert this DLL into the resource chain
00063         // NOTE: If this Extension DLL is being implicitly linked to by
00064         //  an MFC Regular DLL (such as an ActiveX Control)
00065         //  instead of an MFC application, then you will want to
00066         //  remove this line from DllMain and put it in a separate
00067         //  function exported from this Extension DLL.  The Regular DLL
00068         //  that uses this Extension DLL should then explicitly call that
00069         //  function to initialize this Extension DLL.  Otherwise,
00070         //  the CDynLinkLibrary object will not be attached to the
00071         //  Regular DLL's resource chain, and serious problems will
00072         //  result.
00073
00074         new CDynLinkLibrary(CJLibraryDLL);
00075     }
00076     else if (dwReason == DLL_PROCESS_DETACH)
00077     {
00078         TRACE0("CJLIBRARY.DLL Terminating!\n");
00079         // Terminate the library before destructors are called
00080         AfxTermExtensionModule(CJLibraryDLL);
00081     }
00082     return 1;   // ok
00083 }
Generated on Sun Feb 24 01:21:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJListBox.cpp Source File

WinCvs/CJLib/CJLibrary/CJListBox.cpp

Go to the documentation of this file.
00001 // CJListBox.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.1 $
00010  * $Archive: /CodeJock/CJLibrary/CJListBox.cpp $
00011  *
00012  * $History: CJListBox.cpp $
00013  *
00014  * *****************  Version 1  *****************
00015  * User: Kirk Stowell Date: 10/30/99   Time: 9:36p
00016  * Created in $/CodeJock/CJLibrary
00017  *
00018  ***************************************************************************/
00020
00021 #include "StdAfx.h"
00022 #include "CJListBox.h"
00023
00024 #ifdef _DEBUG
00025 #define new DEBUG_NEW
00026 #undef THIS_FILE
00027 static char THIS_FILE[] = __FILE__;
00028 #endif
00029
00031 // CCJListBox
00032
00033 CCJListBox::CCJListBox()
00034 {
00035     // TODO: add construction code here.
00036 }
00037
00038 CCJListBox::~CCJListBox()
00039 {
00040     // TODO: add destruction code here.
00041 }
00042
00043 IMPLEMENT_DYNAMIC(CCJListBox, CListBox)
00044
00045 BEGIN_MESSAGE_MAP(CCJListBox, CListBox)
00046     //{{AFX_MSG_MAP(CCJListBox)
00047     ON_WM_ERASEBKGND()
00048     ON_WM_PAINT()
00049     //}}AFX_MSG_MAP
00050 END_MESSAGE_MAP()
00051
00053 // CCJListBox message handlers
00054
00055 BOOL CCJListBox::OnEraseBkgnd(CDC* pDC)
00056 {
00057     // KStowell - overridden for flicker-free drawing.
00058     UNUSED_ALWAYS(pDC);
00059     return TRUE;
00060 }
00061
00062 void CCJListBox::OnPaint()
00063 {
00064     CPaintDC dc(this); // device context for painting
00065
00066     // KStowell - Get the client rect.
00067     CRect rcClient, rcClip;
00068     dc.GetClipBox( &rcClip );
00069     GetClientRect( &rcClient );
00070
00071     // KStowell - Create a memory device-context. This is done to help reduce
00072     // screen flicker, since we will paint the entire control to the
00073     // off screen device context first.
00074     CDC memDC;
00075     CBitmap bitmap;
00076     memDC.CreateCompatibleDC(&dc);
00077     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00078     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00079
00080     // KStowell - Repaint the background.
00081     memDC.FillSolidRect( rcClient, ::GetSysColor(COLOR_WINDOW) );
00082
00083     // let the control do its default drawing.
00084     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00085
00086     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00087     dc.BitBlt( rcClip.left, rcClip.top, rcClip.Width(), rcClip.Height(), &memDC,
00088         rcClip.left, rcClip.top, SRCCOPY );
00089
00090     // KStowell - Cleanup resources.
00091     memDC.SelectObject(pOldBitmap);
00092     memDC.DeleteDC();
00093     bitmap.DeleteObject();
00094 }
Generated on Sun Feb 24 01:21:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJListCtrl.cpp Source File

WinCvs/CJLib/CJLibrary/CJListCtrl.cpp

Go to the documentation of this file.
00001 // CJListCtrl.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based on the CListView articles from http://www.codeguru.com/listview
00006 //
00008 /****************************************************************************
00009  *
00010  * $Date: 1999/11/30 21:45:49 $
00011  * $Revision: 1.1.1.3 $
00012  * $Archive: /CodeJock/CJLibrary/CJListCtrl.cpp $
00013  *
00014  * $History: CJListCtrl.cpp $
00015  *
00016  * *****************  Version 10  *****************
00017  * User: Kirk Stowell Date: 10/30/99   Time: 1:52p
00018  * Updated in $/CodeJock/CJLibrary
00019  * Overrode OnEraseBkgnd(...) and OnPaint(...) to handle flicker free
00020  * drawing.
00021  *
00022  * *****************  Version 9  *****************
00023  * User: Kirk Stowell Date: 10/25/99   Time: 10:52p
00024  * Updated in $/CodeJock/CJLibrary
00025  * Modified resource include for static builds.
00026  *
00027  * *****************  Version 8  *****************
00028  * User: Kirk Stowell Date: 8/29/99    Time: 11:45p
00029  * Updated in $/CodeJockey/CJLibrary
00030  * Fixed memory lead with header  control allocation.
00031  *
00032  * *****************  Version 7  *****************
00033  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00034  * Updated in $/CodeJockey/CJLibrary
00035  * Added Unicode compliance, thanks to Barry Burton for his help with
00036  * this.
00037  *
00038  *
00039  * *****************  Version 6  *****************
00040  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00041  * Updated in $/CodeJockey/CJLibrary
00042  *
00043  * *****************  Version 5  *****************
00044  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00045  * Updated in $/CodeJockey/CJLibrary
00046  *
00047  * *****************  Version 4  *****************
00048  * User: Kirk Stowell Date: 6/12/99    Time: 2:29a
00049  * Updated in $/CodeJockey/CJ60Lib
00050  * Cleaned up initialization, sorting and column info saving. Removed sort
00051  * functions, which were replaced with the virtual function SortList(...).
00052  * Override this function in your derived class to perform custom sorting.
00053  * See CCJShellList for an implementation of this virtual function.
00054  *
00055  * *****************  Version 3  *****************
00056  * User: Kirk Stowell Date: 4/03/99    Time: 8:38p
00057  * Updated in $/CodeJockey/CJ60Lib
00058  * Added comments and cleaned up code.
00059  *
00060  * *****************  Version 2  *****************
00061  * User: Kirk Stowell Date: 3/03/99    Time: 8:37p
00062  * Updated in $/CodeJockey/CJ60Lib
00063  * Added InitializeFlatHeader() in order to initialize the list control
00064  * manually.
00065  *
00066  * *****************  Version 1  *****************
00067  * User: Kirk Stowell Date: 1/16/99    Time: 8:37p
00068  * Created in $/CodeJockey/CJ60Lib
00069  * Initial release.
00070  *
00071  ***************************************************************************/
00073
00074 #include "stdafx.h"
00075 #include "CJListCtrl.h"
00076 #include "CJFlatHeaderCtrl.h"
00077 #include "CJResource.h"
00078
00079 #ifdef _DEBUG
00080 #define new DEBUG_NEW
00081 #undef THIS_FILE
00082 static char THIS_FILE[] = __FILE__;
00083 #endif
00084
00086 // CCJListCtrl
00087
00088 CCJListCtrl::CCJListCtrl()
00089 {
00090     m_nMinSize      = 0;
00091     m_nMinColWidth  = 50;
00092     m_nMaxColWidth  = 500;
00093     m_nSortedCol    = -1;
00094     m_bAscending    = true;
00095     m_bAutoSave     = false;
00096     m_bNoColSizing  = false;
00097     m_pHeaderCtrl   = NULL;
00098     m_clrText       = ::GetSysColor(COLOR_WINDOWTEXT);
00099     m_clrTextBk     = ::GetSysColor(COLOR_WINDOW);
00100 }
00101
00102 CCJListCtrl::~CCJListCtrl()
00103 {
00104     _delete( m_pHeaderCtrl );
00105 }
00106
00107 IMPLEMENT_DYNAMIC(CCJListCtrl, CListCtrl)
00108
00109 BEGIN_MESSAGE_MAP(CCJListCtrl, CListCtrl)
00110     //{{AFX_MSG_MAP(CCJListCtrl)
00111     ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnCustomDraw)
00112     ON_WM_DESTROY()
00113     ON_WM_ERASEBKGND()
00114     ON_WM_PAINT()
00115     //}}AFX_MSG_MAP
00116 END_MESSAGE_MAP()
00117
00119 // CCJListCtrl message handlers
00120
00121 // Taken from: Copying/Moving Rows in CListCtrl by James Spibey [spib@bigfoot.com].
00122 // http://www.codeguru.com/listview/moving_rows.html
00123 bool CCJListCtrl::MoveRow(int nFrom, int nTo)
00124 {
00125     //Can't move to the same place, or from or to a negative index
00126     if(nFrom == nTo || nFrom < 0 || nTo < 0)
00127         return false;
00128
00129     //First Copy the row to the new location
00130     if(CopyRow(nFrom, nTo))
00131     {
00132         //If we have just inserted a row before
00133         //this one in the list, we need to increment
00134         //our index.
00135         if(nFrom > nTo)
00136             DeleteItem(nFrom + 1);
00137         else
00138             DeleteItem(nFrom);
00139
00140         return true;
00141     }
00142     else
00143         return false;
00144 }
00145
00146 // Taken from: Copying/Moving Rows in CListCtrl by James Spibey [spib@bigfoot.com].
00147 // http://www.codeguru.com/listview/moving_rows.html
00148 bool CCJListCtrl::CopyRow(int nFrom, int nTo)
00149 {
00150     //Can't move to the same place, or from or to a negative index
00151     if(nFrom == nTo || nFrom < 0 || nTo < 0)
00152         return false;
00153
00154     //Copy the row to the new index
00155     InsertItem(nTo, GetItemText(nFrom, 0));
00156
00157     //If row has been inserted before original
00158     //increment the original
00159     if(nFrom > nTo)
00160         nFrom++;
00161
00162     //Loop through subitems
00163     for(int i = 1; i < GetColumnCount(); i++)
00164     {
00165         SetItemText(nTo, i, GetItemText(nFrom, i));
00166     }
00167
00168     return true;
00169 }
00170
00171 // Taken from: Getting the number of columns in report view by Zafir Anjum.
00172 // http://www.codeguru.com/listview/num_cols.shtml
00173 int CCJListCtrl::GetColumnCount() const
00174 {
00175     CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
00176     return pHeader->GetItemCount();
00177 }
00178
00179 // Taken from: Simpler way to do this (using new version of Comctl32.dll) by Vidas [vibal@lrtc.lt].
00180 // http://www.codeguru.com/mfc/comments/6432.shtml
00181 void CCJListCtrl::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult)
00182 {
00183     LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)pNMHDR;
00184
00185     switch(lplvcd->nmcd.dwDrawStage)
00186     {
00187     case CDDS_PREPAINT:
00188         // Request prepaint notifications for each item.
00189         *pResult = CDRF_NOTIFYITEMDRAW;
00190         break;
00191
00192     case CDDS_ITEMPREPAINT: // Requested notification
00193         if(lplvcd->nmcd.dwItemSpec % 2)
00194         {
00195             lplvcd->clrText   = m_clrText;
00196             lplvcd->clrTextBk = m_clrTextBk;
00197         }
00198         *pResult = CDRF_DODEFAULT;
00199         break;
00200     }
00201 }
00202
00203 BOOL CCJListCtrl::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
00204 {
00205     HD_NOTIFY *pHDNotify = (HD_NOTIFY*)lParam;
00206
00207     switch( pHDNotify->hdr.code )
00208     {
00209     // Sorting the list when user clicks on column header by Zafir Anjum.
00210     // http://www.codeguru.com/listview/sort_on_col_click.shtml
00211     case HDN_ITEMCLICKA:
00212     case HDN_ITEMCLICKW:
00213         {
00214             if( pHDNotify->iButton == 0 )
00215             {
00216                 // set the sort order.
00217                 if( pHDNotify->iItem == m_nSortedCol )
00218                     m_bAscending = !m_bAscending;
00219                 else
00220                     m_bAscending = true;
00221
00222                 // save the column index.
00223                 m_nSortedCol = pHDNotify->iItem;
00224
00225                 // virtual call to sort list.
00226                 SortList( m_nSortedCol, m_bAscending );
00227
00228                 // set the sort image in the header control.
00229                 if( m_pHeaderCtrl && m_pHeaderCtrl->GetSafeHwnd( ))
00230                     m_pHeaderCtrl->SetSortImage( m_nSortedCol, m_bAscending );
00231             }
00232         }
00233         break;
00234
00235     // How to force a minimum column width Cees Mechielsen.
00236     // http://www.codeguru.com/mfc/comments/866.shtml
00237     case HDN_ITEMCHANGINGA:
00238     case HDN_ITEMCHANGINGW:
00239     case HDN_ENDTRACK:
00240         {
00241             if( pHDNotify->pitem->mask & HDI_WIDTH &&
00242                 pHDNotify->pitem->cxy < m_nMinSize &&
00243                 pHDNotify->pitem->cxy >= 0 )
00244             {
00245                 pHDNotify->pitem->cxy = m_nMinSize; // Set the column width
00246             }
00247         }
00248         break;
00249
00250     // Prevent CListCtrl column resizing by Zafir Anjum.
00251     // http://www.codeguru.com/listview/no_col_resize.shtml
00252     case HDN_DIVIDERDBLCLICKA:
00253     case HDN_DIVIDERDBLCLICKW:
00254     case HDN_BEGINTRACKW:
00255     case HDN_BEGINTRACKA:
00256         {
00257             if(m_bNoColSizing)
00258             {
00259                 *pResult = TRUE;                // disable tracking
00260                 return TRUE;                    // Processed message
00261             }
00262             break;
00263         }
00264     }
00265
00266     return CListCtrl::OnNotify(wParam, lParam, pResult);
00267 }
00268
00269 bool CCJListCtrl::SortList(int nCol, bool bAscending)
00270 {
00271 #ifdef _DEBUG
00272     TRACE2("Column sort on column index %d, ascending=%d", nCol, bAscending);
00273 #else
00274     UNUSED_ALWAYS( nCol );
00275     UNUSED_ALWAYS( bAscending );
00276 #endif
00277
00278     return true;
00279 }
00280
00281 // Taken from: Adding a column by Zafir Anjum.
00282 // http://www.codeguru.com/listview/add_column.shtml
00283
00284 // AddColumn      - adds column after the right most column
00285 // Returns        - the index of the new column if successful or -1 otherwise.
00286 // lpszColHeading - the column's heading
00287 // nWidth         - Width of the column, in pixels. If this parameter is -1,
00288 //                  the column width is the same as previous column
00289 // nFormat        - the alignment of the column. Can be LVCFMT_LEFT,
00290 //                  LVCFMT_RIGHT, or LVCFMT_CENTER.
00291 int CCJListCtrl::AddColumn(LPCTSTR lpszColHeading, int nWidth/*=-1*/, int nFormat/*=LVCFMT_LEFT*/)
00292 {
00293     CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
00294     int nColumnCount = pHeader->GetItemCount();
00295
00296     if( nWidth == -1 )
00297     {
00298         // The line below return zero for ICON views
00299         //nWidth = GetColumnWidth( nColumnCount - 1 );
00300
00301         // Get the column width of the previous column from header control
00302         HD_ITEM hd_item;
00303         hd_item.mask = HDI_WIDTH;               //indicate that we want the width
00304         pHeader->GetItem( nColumnCount - 1, &hd_item );
00305         nWidth = hd_item.cxy;
00306     }
00307     return InsertColumn( nColumnCount, lpszColHeading, nFormat, nWidth, nColumnCount );
00308 }
00309
00310 bool CCJListCtrl::BuildColumns(int nCols, int* nWidth, int* nColString)
00311 {
00312     for( int i = 0; i < nCols; ++i ) {
00313         CString strTemp; strTemp.LoadString( nColString[i] );
00314         if(AddColumn(strTemp, nWidth[i])==-1)
00315             return false;
00316     }
00317
00318     return true;
00319 }
00320
00321 bool CCJListCtrl::BuildColumns(int nCols, int* nWidth, CString* strColString)
00322 {
00323     for( int i = 0; i < nCols; ++i ) {
00324         if(AddColumn(strColString[i], nWidth[i])==-1)
00325             return false;
00326     }
00327
00328     return true;
00329 }
00330
00331 // Taken from: Detecting column index of the item clicked by Zafir Anjum.
00332 // http://www.codeguru.com/listview/col_index.shtml
00333
00334 // HitTestEx    - Determine the row index and column index for a point
00335 // Returns      - the row index or -1 if point is not over a row
00336 // point        - point to be tested.
00337 // nCol         - to hold the column index
00338 int CCJListCtrl::HitTestEx(CPoint& point, int* nCol) const
00339 {
00340     int colnum = 0;
00341     int row = HitTest( point, NULL );
00342
00343     if( nCol ) *nCol = 0;
00344
00345     // Make sure that the ListView is in LVS_REPORT
00346     if( (GetWindowLong(m_hWnd, GWL_STYLE) & LVS_TYPEMASK) != LVS_REPORT )
00347         return row;
00348
00349     // Get the top and bottom row visible
00350     row = GetTopIndex();
00351     int bottom = row + GetCountPerPage();
00352     if( bottom > GetItemCount() )
00353         bottom = GetItemCount();
00354
00355     // Get the number of columns
00356     CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
00357     int nColumnCount = pHeader->GetItemCount();
00358
00359     // Loop through the visible rows
00360     for( ;row <= bottom;row++)
00361     {
00362         // Get bounding rect of item and check whether point falls in it.
00363         CRect rect;
00364         GetItemRect( row, &rect, LVIR_BOUNDS );
00365         if( rect.PtInRect(point) )
00366         {
00367             // Now find the column
00368             for( colnum = 0; colnum < nColumnCount; colnum++ )
00369             {
00370                 int colwidth = GetColumnWidth(colnum);
00371                 if( point.x >= rect.left
00372                     && point.x <= (rect.left + colwidth ) )
00373                 {
00374                     if( nCol ) *nCol = colnum;
00375                     return row;
00376                 }
00377                 rect.left += colwidth;
00378             }
00379         }
00380     }
00381     return -1;
00382 }
00383
00384 bool CCJListCtrl::SubclassHeader(bool bBoldFont/*=false*/)
00385 {
00386     // allocate memory for the flat header.
00387     m_pHeaderCtrl = new CCJFlatHeaderCtrl;
00388     ASSERT( m_pHeaderCtrl );
00389
00390     // get the window handle to the existing header
00391     // control.
00392     HWND hWnd = GetDlgItem(0)->GetSafeHwnd();
00393     ASSERT( hWnd );
00394
00395     // subclass the flat header control.
00396     if( !m_pHeaderCtrl->SubclassWindow( hWnd ))
00397         return false;
00398
00399     // finish header initialization.
00400     m_pHeaderCtrl->InitializeHeader( bBoldFont );
00401
00402     return true;
00403 }
00404
00405 void CCJListCtrl::AutoSaveColumns(LPCTSTR lpszSection, LPCTSTR lpszEntry, LPCTSTR lpszDefault)
00406 {
00407     m_bAutoSave = true;
00408
00409     // initialize registry strings.
00410     if( lpszSection == NULL ) m_strSection = _T("Settings");
00411     else m_strSection = lpszSection;
00412
00413     if( lpszEntry == NULL ) m_strEntry = _T("Column Info");
00414     else m_strEntry = lpszEntry;
00415
00416     if( lpszDefault == NULL ) m_strDefault = _T("");
00417     else m_strDefault = lpszDefault;
00418
00419     LoadColumnWidths();
00420 }
00421
00422 void CCJListCtrl::SaveColumnWidths()
00423 {
00424     // get a pointer to the header control.
00425     CHeaderCtrl* pHeader = DYNAMIC_DOWNCAST(CHeaderCtrl, GetDlgItem(0));
00426     ASSERT_KINDOF( CHeaderCtrl, pHeader );
00427
00428     CString strValue;
00429     for( int i = 0; i < pHeader->GetItemCount(); ++i )
00430     {
00431         CString strTemp;
00432         strTemp.Format(_T("%d,"), GetColumnWidth( i ));
00433         strValue += strTemp;
00434     }
00435
00436     AfxGetApp()->WriteProfileString( m_strSection, m_strEntry, strValue );
00437 }
00438
00439 void CCJListCtrl::LoadColumnWidths()
00440 {
00441     // get a pointer to the header control.
00442     CHeaderCtrl* pHeader = DYNAMIC_DOWNCAST(CHeaderCtrl, GetDlgItem(0));
00443     ASSERT_KINDOF( CHeaderCtrl, pHeader );
00444
00445     for( int i = 0; i < pHeader->GetItemCount(); ++i )
00446         SetColumnWidth(i);
00447 }
00448
00449 void CCJListCtrl::SetColumnWidth(int nCol)
00450 {
00451     int nWidth = GetStoredWidth( nCol );
00452     if( nWidth > m_nMinColWidth )
00453         CListCtrl::SetColumnWidth( nCol, nWidth );
00454     else
00455         AutoSizeColumn( nCol );
00456 }
00457
00458 int CCJListCtrl::GetStoredWidth(int nCol)
00459 {
00460     // get the value from the registry.
00461     CString strValue = AfxGetApp()->GetProfileString(
00462         m_strSection, m_strEntry, m_strDefault );
00463
00464     // extract the sub string to get the column width.
00465     CString strSubString;
00466     AfxExtractSubString( strSubString, strValue, nCol, _T(','));
00467
00468     // return the width from the registry.
00469     return _ttoi( strSubString );
00470 }
00471
00472 void CCJListCtrl::OnDestroy()
00473 {
00474     if( m_bAutoSave ) SaveColumnWidths();
00475     CListCtrl::OnDestroy();
00476 }
00477
00478 // Taken from: Autosize a column to fit its content by Roger Onslow.
00479 // http://www.codeguru.com/listview/autosize_col.shtml
00480 // If you don't supply a column number, it will resize all columns.
00481 void CCJListCtrl::AutoSizeColumn(int nCol/*=-1*/)
00482 {
00483     // Call this after your list control is filled
00484     SetRedraw( false );
00485
00486     int nMinCol = nCol < 0 ? 0 : nCol;
00487     int nMaxCol = nCol < 0 ? GetColumnCount()-1 : nCol;
00488
00489     for (nCol = nMinCol; nCol <= nMaxCol; nCol++)
00490     {
00491         CListCtrl::SetColumnWidth( nCol, LVSCW_AUTOSIZE );
00492         int wc1 = GetColumnWidth( nCol );
00493
00494         CListCtrl::SetColumnWidth( nCol, LVSCW_AUTOSIZE_USEHEADER );
00495         int wc2 = GetColumnWidth( nCol );
00496         int wc = max( m_nMinColWidth, max( wc1, wc2 ));
00497
00498         if( wc > m_nMaxColWidth )
00499             wc = m_nMaxColWidth;
00500
00501         // set the column width.
00502         CListCtrl::SetColumnWidth( nCol,wc );
00503     }
00504
00505     SetRedraw();
00506 }
00507
00508 BOOL CCJListCtrl::OnEraseBkgnd(CDC* pDC)
00509 {
00510     // KStowell - overridden for flicker-free drawing.
00511     UNUSED_ALWAYS(pDC);
00512     return TRUE;
00513 }
00514
00515 void CCJListCtrl::OnPaint()
00516 {
00517     CPaintDC dc(this); // device context for painting
00518
00519     // KStowell - Get the client rect.
00520     CRect rcClient, rcClip;
00521     dc.GetClipBox( &rcClip );
00522     GetClientRect( &rcClient );
00523
00524     // Exclude the header control from being painted over.
00525     CWnd* pWnd = GetDlgItem(0);
00526     if(pWnd && pWnd->IsWindowVisible()) {
00527         CRect rcItem;
00528         pWnd->GetClientRect(&rcItem);
00529         dc.ExcludeClipRect(&rcItem);
00530     }
00531
00532     // KStowell - Create a memory device-context. This is done to help reduce
00533     // screen flicker, since we will paint the entire control to the
00534     // off screen device context first.
00535     CDC memDC;
00536     CBitmap bitmap;
00537     memDC.CreateCompatibleDC(&dc);
00538     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00539     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00540
00541     // KStowell - Repaint the background.
00542     memDC.FillSolidRect( rcClient, ::GetSysColor(COLOR_WINDOW) );
00543
00544     // let the control do its default drawing.
00545     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00546
00547     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00548     dc.BitBlt( rcClip.left, rcClip.top, rcClip.Width(), rcClip.Height(), &memDC,
00549         rcClip.left, rcClip.top, SRCCOPY );
00550
00551     // KStowell - Cleanup resources.
00552     memDC.SelectObject(pOldBitmap);
00553     memDC.DeleteDC();
00554     bitmap.DeleteObject();
00555 }
Generated on Sun Feb 24 01:21:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJListView.cpp Source File

WinCvs/CJLib/CJLibrary/CJListView.cpp

Go to the documentation of this file.
00001 // CJListView.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based on the CListView articles from http://www.codeguru.com/listview
00006 //
00008 /****************************************************************************
00009  *
00010  * $Date: 1999/11/30 21:45:49 $
00011  * $Revision: 1.1.1.3 $
00012  * $Archive: /CodeJock/CJLibrary/CJListView.cpp $
00013  *
00014  * $History: CJListView.cpp $
00015  *
00016  * *****************  Version 9  *****************
00017  * User: Kirk Stowell Date: 10/30/99   Time: 2:04p
00018  * Updated in $/CodeJock/CJLibrary
00019  * Overrode OnEraseBkgnd(...) for flicker free drawing.
00020  *
00021  * *****************  Version 8  *****************
00022  * User: Kirk Stowell Date: 10/25/99   Time: 10:52p
00023  * Updated in $/CodeJock/CJLibrary
00024  * Modified resource include for static builds.
00025  *
00026  * *****************  Version 7  *****************
00027  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00028  * Updated in $/CodeJockey/CJLibrary
00029  * Added Unicode compliance, thanks to Barry Burton for his help with
00030  * this.
00031  *
00032  *
00033  * *****************  Version 6  *****************
00034  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00035  * Updated in $/CodeJockey/CJLibrary
00036  *
00037  * *****************  Version 5  *****************
00038  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00039  * Updated in $/CodeJockey/CJLibrary
00040  *
00041  * *****************  Version 4  *****************
00042  * User: Kirk Stowell Date: 6/12/99    Time: 2:21a
00043  * Updated in $/CodeJockey/CJ60Lib
00044  * Cleaned up initialization, sorting and column info saving. Removed sort
00045  * functions, which were replaced with the virtual function SortList(...).
00046  * Override this function in your derived class to perform custom sorting.
00047  * See CCJShellList for an implementation of this virtual function.
00048  *
00049  * *****************  Version 3  *****************
00050  * User: Kirk Stowell Date: 4/03/99    Time: 12:06a
00051  * Updated in $/CodeJockey/CJ60Lib
00052  * Added comments and cleaned up code.
00053  *
00054  * *****************  Version 2  *****************
00055  * User: Kirk Stowell Date: 3/03/99    Time: 12:06a
00056  * Updated in $/CodeJockey/CJ60Lib
00057  * Added InitializeFlatHeader() in order to initialize the list control
00058  * manually.
00059  *
00060  * *****************  Version 1  *****************
00061  * User: Kirk Stowell Date: 1/16/99    Time: 12:06a
00062  * Created in $/CodeJockey/CJ60Lib
00063  * Initial release.
00064  *
00065  ***************************************************************************/
00067
00068 #include "stdafx.h"
00069 #include "CJListView.h"
00070 #include "CJFlatHeaderCtrl.h"
00071 #include "CJResource.h"
00072
00073 #ifdef _DEBUG
00074 #define new DEBUG_NEW
00075 #undef THIS_FILE
00076 static char THIS_FILE[] = __FILE__;
00077 #endif
00078
00080 // CCJListView
00081
00082 IMPLEMENT_DYNCREATE(CCJListView, CListView)
00083
00084 CCJListView::CCJListView()
00085 {
00086     m_nMinSize      = 0;
00087     m_nMinColWidth  = 50;
00088     m_nMaxColWidth  = 500;
00089     m_nSortedCol    = -1;
00090     m_bAscending    = true;
00091     m_bAutoSave     = false;
00092     m_bNoColSizing  = false;
00093     m_pHeaderCtrl   = NULL;
00094     m_pListCtrl     = NULL;
00095     m_clrText       = ::GetSysColor(COLOR_WINDOWTEXT);
00096     m_clrTextBk     = ::GetSysColor(COLOR_WINDOW);
00097 }
00098
00099 CCJListView::~CCJListView()
00100 {
00101     _delete( m_pHeaderCtrl );
00102 }
00103
00104
00105 BEGIN_MESSAGE_MAP(CCJListView, CListView)
00106     //{{AFX_MSG_MAP(CCJListView)
00107     ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnCustomDraw)
00108     ON_WM_DESTROY()
00109     ON_WM_ERASEBKGND()
00110     //}}AFX_MSG_MAP
00111 END_MESSAGE_MAP()
00112
00114 // CCJListView drawing
00115
00116 void CCJListView::OnDraw( CDC* pDC )
00117 {
00118     UNUSED_ALWAYS( pDC );
00119 }
00120
00122 // CCJListView diagnostics
00123
00124 #ifdef _DEBUG
00125 void CCJListView::AssertValid() const
00126 {
00127     CListView::AssertValid();
00128 }
00129
00130 void CCJListView::Dump(CDumpContext& dc) const
00131 {
00132     CListView::Dump(dc);
00133 }
00134 #endif //_DEBUG
00135
00137 // CCJListView message handlers
00138
00139 void CCJListView::OnInitialUpdate()
00140 {
00141     CListView::OnInitialUpdate();
00142
00143     // Set a pointer to the list control.
00144     m_pListCtrl = &GetListCtrl();
00145 }
00146
00147 // Taken from: Copying/Moving Rows in CListCtrl by James Spibey [spib@bigfoot.com].
00148 // http://www.codeguru.com/listview/moving_rows.html
00149 bool CCJListView::MoveRow(int nFrom, int nTo)
00150 {
00151     //Can't move to the same place, or from or to a negative index
00152     if(nFrom == nTo || nFrom < 0 || nTo < 0)
00153         return false;
00154
00155     //First Copy the row to the new location
00156     if(CopyRow(nFrom, nTo))
00157     {
00158         //If we have just inserted a row before
00159         //this one in the list, we need to increment
00160         //our index.
00161         if(nFrom > nTo)
00162             m_pListCtrl->DeleteItem(nFrom + 1);
00163         else
00164             m_pListCtrl->DeleteItem(nFrom);
00165
00166         return true;
00167     }
00168     else
00169         return false;
00170 }
00171
00172 // Taken from: Copying/Moving Rows in CListCtrl by James Spibey [spib@bigfoot.com].
00173 // http://www.codeguru.com/listview/moving_rows.html
00174 bool CCJListView::CopyRow(int nFrom, int nTo)
00175 {
00176     //Can't move to the same place, or from or to a negative index
00177     if(nFrom == nTo || nFrom < 0 || nTo < 0)
00178         return false;
00179
00180     //Copy the row to the new index
00181     m_pListCtrl->InsertItem(nTo, m_pListCtrl->GetItemText(nFrom, 0));
00182
00183     //If row has been inserted before original
00184     //increment the original
00185     if(nFrom > nTo)
00186         nFrom++;
00187
00188     //Loop through subitems
00189     for(int i = 1; i < GetColumnCount(); i++)
00190     {
00191         m_pListCtrl->SetItemText(nTo, i, m_pListCtrl->GetItemText(nFrom, i));
00192     }
00193
00194     return true;
00195 }
00196
00197 // Taken from: Getting the number of columns in report view by Zafir Anjum.
00198 // http://www.codeguru.com/listview/num_cols.shtml
00199 int CCJListView::GetColumnCount() const
00200 {
00201     CHeaderCtrl* pHeader = (CHeaderCtrl*)m_pListCtrl->GetDlgItem(0);
00202     return pHeader->GetItemCount();
00203 }
00204
00205 // Taken from: Simpler way to do this (using new version of Comctl32.dll) by Vidas [vibal@lrtc.lt].
00206 // http://www.codeguru.com/mfc/comments/6432.shtml
00207 void CCJListView::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult)
00208 {
00209     LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)pNMHDR;
00210
00211     switch(lplvcd->nmcd.dwDrawStage)
00212     {
00213     case CDDS_PREPAINT:
00214         // Request prepaint notifications for each item.
00215         *pResult = CDRF_NOTIFYITEMDRAW;
00216         break;
00217
00218     case CDDS_ITEMPREPAINT: // Requested notification
00219         if(lplvcd->nmcd.dwItemSpec % 2)
00220         {
00221             lplvcd->clrText   = m_clrText;
00222             lplvcd->clrTextBk = m_clrTextBk;
00223         }
00224         *pResult = CDRF_DODEFAULT;
00225         break;
00226     }
00227 }
00228
00229 BOOL CCJListView::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
00230 {
00231     HD_NOTIFY *pHDNotify = (HD_NOTIFY*)lParam;
00232
00233     switch( pHDNotify->hdr.code )
00234     {
00235     // Sorting the list when user clicks on column header by Zafir Anjum.
00236     // http://www.codeguru.com/listview/sort_on_col_click.shtml
00237     case HDN_ITEMCLICKA:
00238     case HDN_ITEMCLICKW:
00239         {
00240             if( pHDNotify->iButton == 0 )
00241             {
00242                 // set the sort order.
00243                 if( pHDNotify->iItem == m_nSortedCol )
00244                     m_bAscending = !m_bAscending;
00245                 else
00246                     m_bAscending = true;
00247
00248                 // save the column index.
00249                 m_nSortedCol = pHDNotify->iItem;
00250
00251                 // virtual call to sort list.
00252                 SortList( m_nSortedCol, m_bAscending );
00253
00254                 // set the sort image in the header control.
00255                 if( m_pHeaderCtrl && m_pHeaderCtrl->GetSafeHwnd( ))
00256                     m_pHeaderCtrl->SetSortImage( m_nSortedCol, m_bAscending );
00257             }
00258         }
00259         break;
00260
00261     // How to force a minimum column width Cees Mechielsen.
00262     // http://www.codeguru.com/mfc/comments/866.shtml
00263     case HDN_ITEMCHANGINGA:
00264     case HDN_ITEMCHANGINGW:
00265     case HDN_ENDTRACK:
00266         {
00267             if( pHDNotify->pitem->mask & HDI_WIDTH &&
00268                 pHDNotify->pitem->cxy < m_nMinSize &&
00269                 pHDNotify->pitem->cxy >= 0 )
00270             {
00271                 pHDNotify->pitem->cxy = m_nMinSize; // Set the column width
00272             }
00273         }
00274         break;
00275
00276     // Prevent CListCtrl column resizing by Zafir Anjum.
00277     // http://www.codeguru.com/listview/no_col_resize.shtml
00278     case HDN_DIVIDERDBLCLICKA:
00279     case HDN_DIVIDERDBLCLICKW:
00280     case HDN_BEGINTRACKW:
00281     case HDN_BEGINTRACKA:
00282         {
00283             if(m_bNoColSizing)
00284             {
00285                 *pResult = TRUE;                // disable tracking
00286                 return TRUE;                    // Processed message
00287             }
00288             break;
00289         }
00290     }
00291
00292     return CListView::OnNotify(wParam, lParam, pResult);
00293 }
00294
00295 bool CCJListView::SortList(int nCol, bool bAscending)
00296 {
00297 #ifdef _DEBUG
00298     TRACE2("Column sort on column index %d, ascending=%d", nCol, bAscending);
00299 #else
00300     UNUSED_ALWAYS( nCol );
00301     UNUSED_ALWAYS( bAscending );
00302 #endif
00303
00304     return true;
00305 }
00306
00307 // Taken from: Adding a column by Zafir Anjum.
00308 // http://www.codeguru.com/listview/add_column.shtml
00309
00310 // AddColumn      - adds column after the right most column
00311 // Returns        - the index of the new column if successful or -1 otherwise.
00312 // lpszColHeading - the column's heading
00313 // nWidth         - Width of the column, in pixels. If this parameter is -1,
00314 //                  the column width is the same as previous column
00315 // nFormat        - the alignment of the column. Can be LVCFMT_LEFT,
00316 //                  LVCFMT_RIGHT, or LVCFMT_CENTER.
00317 int CCJListView::AddColumn(LPCTSTR lpszColHeading, int nWidth/*=-1*/, int nFormat/*=LVCFMT_LEFT*/)
00318 {
00319     CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
00320     int nColumnCount = pHeader->GetItemCount();
00321
00322     if( nWidth == -1 )
00323     {
00324         // The line below return zero for ICON views
00325         //nWidth = GetColumnWidth( nColumnCount - 1 );
00326
00327         // Get the column width of the previous column from header control
00328         HD_ITEM hd_item;
00329         hd_item.mask = HDI_WIDTH;               //indicate that we want the width
00330         pHeader->GetItem( nColumnCount - 1, &hd_item );
00331         nWidth = hd_item.cxy;
00332     }
00333     return m_pListCtrl->InsertColumn( nColumnCount, lpszColHeading, nFormat, nWidth, nColumnCount );
00334 }
00335
00336 bool CCJListView::BuildColumns(int nCols, int* nWidth, int* nColString)
00337 {
00338     for( int i = 0; i < nCols; ++i ) {
00339         CString strTemp; strTemp.LoadString( nColString[i] );
00340         if(AddColumn(strTemp, nWidth[i])==-1)
00341             return false;
00342     }
00343
00344     return true;
00345 }
00346
00347 bool CCJListView::BuildColumns(int nCols, int* nWidth, CString* strColString)
00348 {
00349     for( int i = 0; i < nCols; ++i ) {
00350         if(AddColumn(strColString[i], nWidth[i])==-1)
00351             return false;
00352     }
00353
00354     return true;
00355 }
00356
00357 // Taken from: Detecting column index of the item clicked by Zafir Anjum.
00358 // http://www.codeguru.com/listview/col_index.shtml
00359
00360 // HitTestEx    - Determine the row index and column index for a point
00361 // Returns      - the row index or -1 if point is not over a row
00362 // point        - point to be tested.
00363 // nCol         - to hold the column index
00364 int CCJListView::HitTestEx(CPoint& point, int* nCol) const
00365 {
00366     int colnum = 0;
00367     int row = m_pListCtrl->HitTest( point, NULL );
00368
00369     if( nCol ) *nCol = 0;
00370
00371     // Make sure that the ListView is in LVS_REPORT
00372     if( (GetWindowLong(m_hWnd, GWL_STYLE) & LVS_TYPEMASK) != LVS_REPORT )
00373         return row;
00374
00375     // Get the top and bottom row visible
00376     row = m_pListCtrl->GetTopIndex();
00377     int bottom = row + m_pListCtrl->GetCountPerPage();
00378     if( bottom > m_pListCtrl->GetItemCount() )
00379         bottom = m_pListCtrl->GetItemCount();
00380
00381     // Get the number of columns
00382     CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
00383     int nColumnCount = pHeader->GetItemCount();
00384
00385     // Loop through the visible rows
00386     for( ;row <= bottom;row++)
00387     {
00388         // Get bounding rect of item and check whether point falls in it.
00389         CRect rect;
00390         m_pListCtrl->GetItemRect( row, &rect, LVIR_BOUNDS );
00391         if( rect.PtInRect(point) )
00392         {
00393             // Now find the column
00394             for( colnum = 0; colnum < nColumnCount; colnum++ )
00395             {
00396                 int colwidth = m_pListCtrl->GetColumnWidth(colnum);
00397                 if( point.x >= rect.left
00398                     && point.x <= (rect.left + colwidth ) )
00399                 {
00400                     if( nCol ) *nCol = colnum;
00401                     return row;
00402                 }
00403                 rect.left += colwidth;
00404             }
00405         }
00406     }
00407     return -1;
00408 }
00409
00410 bool CCJListView::SubclassHeader(bool bBoldFont/*=false*/)
00411 {
00412     // allocate memory for the flat header.
00413     m_pHeaderCtrl = new CCJFlatHeaderCtrl;
00414     ASSERT( m_pHeaderCtrl );
00415
00416     // get the window handle to the existing header
00417     // control.
00418     HWND hWnd = GetDlgItem(0)->GetSafeHwnd();
00419     ASSERT( hWnd );
00420
00421     // subclass the flat header control.
00422     if( !m_pHeaderCtrl->SubclassWindow( hWnd ))
00423         return false;
00424
00425     // finish header initialization.
00426     m_pHeaderCtrl->InitializeHeader( bBoldFont );
00427
00428     return true;
00429 }
00430
00431 void CCJListView::AutoSaveColumns(LPCTSTR lpszSection, LPCTSTR lpszEntry, LPCTSTR lpszDefault)
00432 {
00433     m_bAutoSave = true;
00434
00435     // initialize registry strings.
00436     if( lpszSection == NULL ) m_strSection = _T("Settings");
00437     else m_strSection = lpszSection;
00438
00439     if( lpszEntry == NULL ) m_strEntry = _T("Column Info");
00440     else m_strEntry = lpszEntry;
00441
00442     if( lpszDefault == NULL ) m_strDefault = _T("");
00443     else m_strDefault = lpszDefault;
00444
00445     LoadColumnWidths();
00446 }
00447
00448 void CCJListView::SaveColumnWidths()
00449 {
00450     // get a pointer to the header control.
00451     CHeaderCtrl* pHeader = DYNAMIC_DOWNCAST(CHeaderCtrl, GetDlgItem(0));
00452     ASSERT_KINDOF( CHeaderCtrl, pHeader );
00453
00454     CString strValue;
00455     for( int i = 0; i < pHeader->GetItemCount(); ++i )
00456     {
00457         CString strTemp;
00458         strTemp.Format(_T("%d,"), m_pListCtrl->GetColumnWidth( i ));
00459         strValue += strTemp;
00460     }
00461
00462     AfxGetApp()->WriteProfileString( m_strSection, m_strEntry, strValue );
00463 }
00464
00465 void CCJListView::LoadColumnWidths()
00466 {
00467     // get a pointer to the header control.
00468     CHeaderCtrl* pHeader = DYNAMIC_DOWNCAST(CHeaderCtrl, GetDlgItem(0));
00469     ASSERT_KINDOF( CHeaderCtrl, pHeader );
00470
00471     for( int i = 0; i < pHeader->GetItemCount(); ++i )
00472         SetColumnWidth(i);
00473 }
00474
00475 void CCJListView::SetColumnWidth(int nCol)
00476 {
00477     int nWidth = GetStoredWidth( nCol );
00478     if( nWidth > m_nMinColWidth )
00479         m_pListCtrl->SetColumnWidth( nCol, nWidth );
00480     else
00481         AutoSizeColumn( nCol );
00482 }
00483
00484 int CCJListView::GetStoredWidth(int nCol)
00485 {
00486     // get the value from the registry.
00487     CString strValue = AfxGetApp()->GetProfileString(
00488         m_strSection, m_strEntry, m_strDefault );
00489
00490     // extract the sub string to get the column width.
00491     CString strSubString;
00492     AfxExtractSubString( strSubString, strValue, nCol, _T(','));
00493
00494     // return the width from the registry.
00495     return _ttoi( strSubString );
00496 }
00497
00498 void CCJListView::OnDestroy()
00499 {
00500     if( m_bAutoSave ) SaveColumnWidths();
00501     CListView::OnDestroy();
00502 }
00503
00504 // Taken from: Autosize a column to fit its content by Roger Onslow.
00505 // http://www.codeguru.com/listview/autosize_col.shtml
00506 // If you don't supply a column number, it will resize all columns.
00507 void CCJListView::AutoSizeColumn(int nCol/*=-1*/)
00508 {
00509     // Call this after your list control is filled
00510     SetRedraw( false );
00511
00512     int nMinCol = nCol < 0 ? 0 : nCol;
00513     int nMaxCol = nCol < 0 ? GetColumnCount()-1 : nCol;
00514
00515     for (nCol = nMinCol; nCol <= nMaxCol; nCol++)
00516     {
00517         m_pListCtrl->SetColumnWidth( nCol, LVSCW_AUTOSIZE );
00518         int wc1 = m_pListCtrl->GetColumnWidth( nCol );
00519
00520         m_pListCtrl->SetColumnWidth( nCol, LVSCW_AUTOSIZE_USEHEADER );
00521         int wc2 = m_pListCtrl->GetColumnWidth( nCol );
00522         int wc = max( m_nMinColWidth, max( wc1, wc2 ));
00523
00524         if( wc > m_nMaxColWidth )
00525             wc = m_nMaxColWidth;
00526
00527         // set the column width.
00528         m_pListCtrl->SetColumnWidth( nCol,wc );
00529     }
00530
00531     SetRedraw();
00532 }
00533
00534 BOOL CCJListView::OnEraseBkgnd(CDC* pDC)
00535 {
00536     CRect rectClient;
00537     GetClientRect( &rectClient );
00538     pDC->ExcludeClipRect( &rectClient );
00539     return CListView::OnEraseBkgnd(pDC);
00540 }
Generated on Sun Feb 24 01:21:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJLogoPane.cpp Source File

WinCvs/CJLib/CJLibrary/CJLogoPane.cpp

Go to the documentation of this file.
00001 // CJLogoPane.cpp : implementation file
00002 //
00003 // Copyright © 1999 Pierre MELLINAND
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.1 $
00010  * $Archive: /CodeJock/CJLibrary/CJLogoPane.cpp $
00011  *
00012  * $History: CJLogoPane.cpp $
00013  *
00014  * *****************  Version 1  *****************
00015  * User: Kirk Stowell Date: 10/26/99   Time: 11:08p
00016  * Created in $/CodeJock/CJLibrary
00017  *
00018  ***************************************************************************/
00020
00021 #include "StdAfx.h"
00022 #include "CJLogoPane.h"
00023
00024 #ifdef _DEBUG
00025 #define new DEBUG_NEW
00026 #undef THIS_FILE
00027 static char THIS_FILE[] = __FILE__;
00028 #endif
00029
00031 // CCJLogoPane
00032
00033 CCJLogoPane::CCJLogoPane()
00034 {
00035     SetLogoFont(_T("Arial"));
00036 }
00037
00038 CCJLogoPane::~CCJLogoPane()
00039 {
00040     m_Font.DeleteObject();
00041 }
00042
00043 IMPLEMENT_DYNCREATE(CCJLogoPane, CWnd)
00044
00045 BEGIN_MESSAGE_MAP(CCJLogoPane, CWnd)
00046     //{{AFX_MSG_MAP(CCJLogoPane)
00047     ON_WM_PAINT()
00048     //}}AFX_MSG_MAP
00049 END_MESSAGE_MAP()
00050
00052 // CCJLogoPane message handlers
00053
00054 void CCJLogoPane::SetLogoFont(LPCTSTR lpszFontName, int nHeight/*=24*/,
00055     int nWeight/*=FW_BOLD*/, BOOL bItalic/*=TRUE*/, BOOL bUnderline/*=FALSE*/)
00056 {
00057     if(m_Font.m_hObject) {
00058         m_Font.DeleteObject();
00059     }
00060
00061     m_Font.CreateFont(nHeight, 0, 0, 0, nWeight, (BYTE)bItalic, (BYTE)bUnderline, 0,0,0,0,0,0, lpszFontName);
00062 }
00063
00064 void CCJLogoPane::OnPaint()
00065 {
00066     CPaintDC dc(this); // device context for painting
00067
00068     CRect rect;
00069     GetWindowRect(rect);
00070
00071     dc.SetBkMode(TRANSPARENT);
00072
00073     CFont * OldFont = dc.SelectObject(&m_Font);
00074
00075     // draw text in DC
00076     COLORREF OldColor = dc.SetTextColor(::GetSysColor( COLOR_3DHILIGHT));
00077
00078     rect.right  = rect.Width();
00079     rect.bottom = rect.Height();
00080     rect.left   = rect.top = 0;
00081     dc.FillSolidRect(rect, ::GetSysColor(COLOR_3DFACE));
00082
00083     dc.DrawText( m_strLogoText, rect + CPoint(1,1), DT_SINGLELINE | DT_LEFT | DT_VCENTER);
00084     dc.SetTextColor( ::GetSysColor( COLOR_3DSHADOW));
00085     dc.DrawText( m_strLogoText, rect, DT_SINGLELINE | DT_LEFT | DT_VCENTER);
00086
00087     // restore old text color
00088     dc.SetTextColor( OldColor);
00089     // restore old font
00090     dc.SelectObject(OldFont);
00091 }
00092
00093 BOOL CCJLogoPane::Create(LPCTSTR lpszWindowName, DWORD dwStyle, CWnd* pParentWnd, UINT nID)
00094 {
00095     CString wndClass = ::AfxRegisterWndClass(CS_BYTEALIGNCLIENT);
00096
00097     if(!CWnd::Create(wndClass, lpszWindowName, dwStyle, CRect(0,0,0,0), pParentWnd, nID)) {
00098         return FALSE;
00099     }
00100
00101     m_strLogoText = lpszWindowName;
00102     return TRUE;
00103 }
Generated on Sun Feb 24 01:21:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJMaskEdit.cpp Source File

WinCvs/CJLib/CJLibrary/CJMaskEdit.cpp

Go to the documentation of this file.
00001 // CJMaskEdit.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based on the article "A masked edit control (2)" by Jeremy Davis [jmd@jvf.co.uk]
00006 // http://www.codeguru.com/editctrl/masked_edit2.shtml
00007 //
00009 /****************************************************************************
00010  *
00011  * $Date: 1999/11/30 21:45:49 $
00012  * $Revision: 1.1.1.3 $
00013  * $Archive: /CodeJock/CJLibrary/CJMaskEdit.cpp $
00014  *
00015  * $History: CJMaskEdit.cpp $
00016  *
00017  * *****************  Version 11  *****************
00018  * User: Kirk Stowell Date: 10/30/99   Time: 1:53p
00019  * Updated in $/CodeJock/CJLibrary
00020  * Overrode OnEraseBkgnd(...) and OnPaint(...) to handle flicker free
00021  * drawing.
00022  *
00023  * *****************  Version 10  *****************
00024  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00025  * Updated in $/CodeJock/CJLibrary
00026  * Fixed potential resource and memory leak problems.
00027  *
00028  * *****************  Version 9  *****************
00029  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00030  * Updated in $/CodeJockey/CJLibrary
00031  * Updated copyright and contact information.
00032  *
00033  * *****************  Version 8  *****************
00034  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00035  * Updated in $/CodeJockey/CJLibrary
00036  * Added Unicode compliance, thanks to Barry Burton for his help with
00037  * this.
00038  *
00039  *
00040  * *****************  Version 7  *****************
00041  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00042  * Updated in $/CodeJockey/CJLibrary
00043  *
00044  * *****************  Version 6  *****************
00045  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00046  * Updated in $/CodeJockey/CJLibrary
00047  *
00048  * *****************  Version 5  *****************
00049  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00050  * Updated in $/CodeJockey/CJLibrary
00051  *
00052  * *****************  Version 4  *****************
00053  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00054  * Updated in $/CodeJockey/CJLibrary
00055  *
00056  * *****************  Version 3  *****************
00057  * User: Kirk Stowell Date: 7/25/99    Time: 12:15a
00058  * Updated in $/CodeJockey/CJLibrary
00059  *
00060  * *****************  Version 2  *****************
00061  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00062  * Updated in $/CodeJockey/CJLibrary
00063  *
00064  * *****************  Version 1  *****************
00065  * User: Kirk Stowell Date: 7/19/99    Time: 12:35a
00066  * Created in $/CodeJockey/CJLibrary
00067  * Initial creation and addition to library.
00068  *
00069  ***************************************************************************/
00071
00072 #include "StdAfx.h"
00073 #include "CJMaskEdit.h"
00074
00075 #ifdef _DEBUG
00076 #define new DEBUG_NEW
00077 #undef THIS_FILE
00078 static char THIS_FILE[] = __FILE__;
00079 #endif
00080
00082 // CCJMaskEdit
00083
00084 CCJMaskEdit::CCJMaskEdit()
00085 {
00086     m_bUseMask              = true;
00087     m_bMaskKeyInProgress    = false;
00088     m_strWindowText         = _T("");
00089     m_strMask               = _T("");
00090     m_strLiteral            = _T("");
00091     m_strValid              = _T("");
00092     m_strMaskLiteral        = _T("");
00093 }
00094
00095 CCJMaskEdit::~CCJMaskEdit()
00096 {
00097     // fix potential resource leak - KStowell - 10-22-99.
00098     m_Font.DeleteObject();
00099 }
00100
00101 IMPLEMENT_DYNAMIC(CCJMaskEdit, CEdit)
00102
00103 BEGIN_MESSAGE_MAP(CCJMaskEdit, CEdit)
00104     //{{AFX_MSG_MAP(CCJMaskEdit)
00105     ON_WM_KEYDOWN()
00106     ON_WM_CHAR()
00107     ON_WM_ERASEBKGND()
00108     ON_WM_PAINT()
00109     //}}AFX_MSG_MAP
00110 END_MESSAGE_MAP()
00111
00113 // CCJMaskEdit message handlers
00114
00115 void CCJMaskEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
00116 {
00117     if( m_bUseMask )
00118     {
00119         switch( nChar )
00120         {
00121         case VK_DELETE:
00122         case VK_INSERT: return;
00123         }
00124     }
00125
00126     CEdit::OnKeyDown(nChar, nRepCnt, nFlags);
00127 }
00128
00129 void CCJMaskEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
00130 {
00131     if( !m_bMaskKeyInProgress ) {
00132         if( !CheckChar( nChar )) {
00133             return;
00134         }
00135     }
00136
00137     if( m_bUseMask )
00138     {
00139         int nStartPos;
00140         int nEndPos;
00141         GetSel( nStartPos, nEndPos );
00142
00143         if( isprint( nChar ))
00144         {
00145             SetSel( nStartPos, nEndPos+1 );
00146
00147             Clear();
00148
00149             m_strWindowText.SetAt( nEndPos, static_cast<TCHAR>(nChar));
00150         }
00151         else if( nChar == VK_BACK )
00152         {
00153             if(( nStartPos == nEndPos ) &&
00154                ( nStartPos >= 1 ) &&
00155                ( nStartPos <= m_strWindowText.GetLength( )))
00156             {
00157                 UINT c = 0x20;
00158
00159                 // get the masked literal representation.
00160                 if( m_strMaskLiteral.IsEmpty() == FALSE )
00161                 {
00162                     c = m_strMaskLiteral[ nStartPos - 1 ];
00163                 }
00164
00165                 // backspace the cursor.
00166                 SendMessage( WM_KEYDOWN, VK_LEFT, 0 );
00167
00168                 if( m_strMaskLiteral.IsEmpty() == FALSE )
00169                 {
00170                     // update the char backspacing over.
00171                     SendChar( c );
00172
00173                     // backspace the cursor again.
00174                     SendMessage( WM_KEYDOWN, VK_LEFT, 0 );
00175                 }
00176             }
00177             else
00178             {
00179                 MessageBeep((UINT)-1);
00180             }
00181
00182             return;
00183         }
00184     }
00185
00186     CEdit::OnChar(nChar, nRepCnt, nFlags);
00187
00188     if( !m_bMaskKeyInProgress && m_bUseMask && !m_strLiteral.IsEmpty( ))
00189     {
00190         int nStartPos;
00191         int nEndPos;
00192         GetSel( nStartPos, nEndPos );
00193
00194         // make sure the string is not longer than the mask
00195         if( nEndPos < m_strLiteral.GetLength( ))
00196         {
00197             UINT c = m_strLiteral.GetAt( nEndPos );
00198             if (c != '_') {
00199                 SetSel( nEndPos+1, nEndPos+1 );
00200             }
00201         }
00202     }
00203 }
00204
00205 bool CCJMaskEdit::CheckChar(UINT nChar)
00206 {
00207     // do not use mask
00208     if( !m_bUseMask ) {
00209         return true;
00210     }
00211
00212     // control character, OK
00213     if( !isprint( nChar )) {
00214         return true;
00215     }
00216
00217     // unselect all selections, if any
00218     int nStartPos, nEndPos;
00219     GetSel( nStartPos, nEndPos );
00220     SetSel( -1, 0 );
00221
00222     // advance to the first character input position.
00223     for( nStartPos; nStartPos < m_strLiteral.GetLength(); ++nStartPos )
00224     {
00225         if( m_strLiteral.GetAt( nStartPos ) == '_' ) {
00226             SetSel( nStartPos, nStartPos );
00227             break;
00228         }
00229     }
00230
00231     // check the key against the mask
00232     GetSel( nStartPos, nEndPos );
00233
00234     // make sure the string is not longer than the mask
00235     if( nEndPos >= m_strMask.GetLength( )) {
00236         MessageBeep((UINT)-1);
00237         return false;
00238     }
00239
00240     // check to see if a literal is in this position
00241     UINT c = '_';
00242     if( !m_strLiteral.IsEmpty( )) {
00243         c = m_strLiteral.GetAt( nEndPos );
00244     }
00245
00246     if( c != '_' ) {
00247         SendChar( c );
00248         GetSel( nStartPos, nEndPos );
00249     }
00250
00251     // check the valid string character
00252     if( m_strValid.Find( static_cast<TCHAR>(nChar)) != -1 ) {
00253         return true;
00254     }
00255
00256     if( ProcessMask( nChar, nEndPos ))
00257         return true;
00258
00259     MessageBeep((UINT)-1);
00260     return false;
00261 }
00262
00263 void CCJMaskEdit::SendChar(UINT nChar)
00264 {
00265     m_bMaskKeyInProgress = true;
00266 #ifdef WIN32
00267     AfxCallWndProc(this, m_hWnd, WM_CHAR, nChar, 1);
00268 #else
00269     SendMessage(WM_CHAR, nChar, 1);
00270 #endif
00271     m_bMaskKeyInProgress = false;
00272 }
00273
00274 bool CCJMaskEdit::ProcessMask(UINT nChar, int nEndPos)
00275 {
00276     // check the key against the mask
00277     switch( m_strMask.GetAt( nEndPos ))
00278     {
00279     case '0':       // digit only //completely changed this
00280         {
00281             if( isdigit( nChar )) {
00282                 return true;
00283             }
00284             break;
00285         }
00286     case '9':       // digit or space
00287         {
00288             if( isdigit( nChar )) {
00289                 return true;
00290             }
00291             if( nChar == VK_SPACE ) {
00292                 return true;
00293             }
00294             break;
00295         }
00296     case '#':       // digit or space or '+' or '-'
00297         {
00298             if( isdigit( nChar )) {
00299                 return true;
00300             }
00301             if( nChar == VK_SPACE || nChar == VK_ADD || nChar == VK_SUBTRACT ) {
00302                 return true;
00303             }
00304             break;
00305         }
00306     case 'L':       // alpha only
00307         {
00308             if( isalpha( nChar )) {
00309                 return true;
00310             }
00311             break;
00312         }
00313     case '?':       // alpha or space
00314         {
00315             if( isalpha( nChar )) {
00316                 return true;
00317             }
00318             if( nChar == VK_SPACE ) {
00319                 return true;
00320             }
00321             break;
00322         }
00323     case 'A':       // alpha numeric only
00324         {
00325             if( isalnum( nChar )) {
00326                 return true;
00327             }
00328             break;
00329         }
00330     case 'a':       // alpha numeric or space
00331         {
00332             if( isalnum( nChar )) {
00333                 return true;
00334             }
00335             if( nChar == VK_SPACE ) {
00336                 return true;
00337             }
00338             break;
00339         }
00340     case '&':       // all print character only
00341         {
00342             if( isprint( nChar )) {
00343                 return true;
00344             }
00345             break;
00346         }
00347     case 'H':       // hex digit
00348         {
00349             if( isxdigit( nChar )) {
00350                 return true;
00351             }
00352             break;
00353         }
00354     case 'X':       // hex digit or space
00355         {
00356             if( isxdigit( nChar )) {
00357                 return true;
00358             }
00359             if( nChar == VK_SPACE ) {
00360                 return true;
00361             }
00362             break;
00363         }
00364     }
00365
00366     return false;
00367 }
00368
00369 void CCJMaskEdit::SetEditMask(LPCTSTR lpszMask, LPCTSTR lpszLiteral, LPCTSTR lpszWindowText)
00370 {
00371     ASSERT(lpszMask);
00372     ASSERT(lpszLiteral);
00373     ASSERT(lpszWindowText);
00374
00375     // initialize the mask for the control.
00376     m_strMask        = lpszMask;
00377     m_strLiteral     = lpszLiteral;
00378     m_strWindowText  = lpszWindowText;
00379     m_strMaskLiteral = m_strWindowText;
00380
00381     // set the window text for the control.
00382     SetWindowText( lpszWindowText );
00383
00384     // initialize the font used by the control.
00385     UpdateFont();
00386 }
00387
00389 // DDX for date mask control
00390
00391 void AFXAPI DDX_OleDateTime(CDataExchange* pDX, int nIDC, CCJDateEdit& rControl, COleDateTime& rDateTime)
00392 {
00393     DDX_Control( pDX, nIDC, rControl );
00394
00395     if( pDX->m_bSaveAndValidate ) {
00396         rDateTime = rControl.GetDateTime();
00397     }
00398     else {
00399         rControl.SetDateTime( rDateTime );
00400     }
00401 }
00402
00404 // CCJDateEdit class
00405
00406 IMPLEMENT_DYNAMIC(CCJDateEdit, CCJMaskEdit)
00407
00408 CCJDateEdit::CCJDateEdit()
00409 {
00410     m_bUseMask      = true;
00411     m_strMask       = _T("00/00/0000");
00412     m_strLiteral    = _T("__/__/____");
00413 }
00414
00415 COleDateTime CCJDateEdit::ReadOleDateTime(LPCTSTR lpszData)
00416 {
00417     COleDateTime dt;
00418     dt.ParseDateTime(lpszData);
00419     return dt;
00420 }
00421
00422 void CCJDateEdit::FormatOleDateTime(CString &strData, COleDateTime dt)
00423 {
00424     strData = dt.Format( _T("%d/%m/%Y"));
00425 }
00426
00427 void CCJDateEdit::SetDateTime(COleDateTime& dt)
00428 {
00429     CString strText;
00430     FormatOleDateTime(strText, dt);
00431     m_strWindowText = m_strMaskLiteral = strText;
00432     SetWindowText(strText);
00433 }
00434
00435 void CCJDateEdit::SetDateTime(CString strDate)
00436 {
00437     m_strWindowText = m_strMaskLiteral = strDate;
00438     SetWindowText(strDate);
00439 }
00440
00441 COleDateTime CCJDateEdit::GetDateTime()
00442 {
00443     CString strText;
00444     GetWindowText(strText);
00445     return ReadOleDateTime(strText);
00446 }
00447
00448 CString CCJDateEdit::GetWindowDateTime()
00449 {
00450     CString strText;
00451     GetWindowText(strText);
00452     return strText;
00453 }
00454
00455 bool CCJDateEdit::ProcessMask(UINT nChar, int nEndPos)
00456 {
00457     // check the key against the mask
00458     switch( m_strMask.GetAt( nEndPos ))
00459     {
00460     case '0':       // digit only //completely changed this
00461         {
00462             bool bReturn = true;
00463
00464             if( isdigit( nChar ))
00465             {
00466                 if( nEndPos == 0 )
00467                 {
00468                     if( nChar > '3' ) {
00469                         bReturn = false;
00470                     }
00471                 }
00472                 else if( nEndPos == 1 )
00473                 {
00474                     if( m_strWindowText.GetAt(0) == '3' )
00475                     {
00476                         if( nChar > '1' ) {
00477                             bReturn = false;
00478                         }
00479                     }
00480                 }
00481                 else if( nEndPos == 3 )
00482                 {
00483                     if( nChar > '1' ) {
00484                         bReturn = false;
00485                     }
00486                 }
00487                 else if( nEndPos == 4 )
00488                 {
00489                     if( m_strWindowText.GetAt(3) == '1' )
00490                     {
00491                         if( nChar > '2') {
00492                             bReturn = false;
00493                         }
00494                     }
00495                 }
00496                 return bReturn;
00497             }
00498             break;
00499         }
00500     }
00501
00502     MessageBeep((UINT)-1);
00503     return false;
00504 }
00505
00507 // CCJTimeEdit class
00508
00509 IMPLEMENT_DYNAMIC(CCJTimeEdit, CCJDateEdit)
00510
00511 CCJTimeEdit::CCJTimeEdit()
00512 {
00513     m_bUseMask      = true;
00514     m_strMask       = _T("00:00");
00515     m_strLiteral    = _T("__:__");
00516     m_strHours      = _T("47");
00517     m_strMins       = _T("59");
00518 }
00519
00520 void CCJTimeEdit::FormatOleDateTime(CString &strData, COleDateTime dt)
00521 {
00522     if( dt.m_dt == 0 ) {
00523         strData = "00:00";
00524     }
00525     else {
00526         strData = dt.Format( _T("%H:%M"));
00527     }
00528 }
00529
00530 bool CCJTimeEdit::ProcessMask(UINT nChar, int nEndPos)
00531 {
00532     // check the key against the mask
00533     switch( m_strMask.GetAt( nEndPos ))
00534     {
00535     case '0':       // digit only //completely changed this
00536         {
00537             bool bReturn = true;
00538
00539             if( isdigit( nChar ))
00540             {
00541                 if( nEndPos == 0 )
00542                 {
00543                     if(nChar > (UINT)m_strHours[0]) {
00544                         bReturn = false;
00545                     }
00546                 }
00547                 else if( nEndPos == 1 )
00548                 {
00549                     if(m_strWindowText.GetAt(0) == m_strHours[0])
00550                     {
00551                         if( nChar > (UINT)m_strHours[1] ) {
00552                             bReturn = false;
00553                         }
00554                     }
00555                 }
00556                 else if( nEndPos == 3 )
00557                 {
00558                     if( nChar > (UINT)m_strMins[0] ) {
00559                         bReturn = false;
00560                     }
00561                 }
00562                 else if( nEndPos == 4 )
00563                 {
00564                     if( m_strWindowText.GetAt(3) == m_strMins[0] )
00565                     {
00566                         if( nChar > (UINT)m_strMins[1] ) {
00567                             bReturn = false;
00568                         }
00569                     }
00570                 }
00571                 return bReturn;
00572             }
00573             break;
00574         }
00575     }
00576
00577     MessageBeep((UINT)-1);
00578     return false;
00579 }
00580
00581 void CCJTimeEdit::SetHours(int nHours)
00582 {
00583     m_strHours.Format( _T("%d"), nHours);
00584 }
00585
00586 void CCJTimeEdit::SetMins(int nMins)
00587 {
00588     m_strMins.Format( _T("%d"), nMins);
00589 }
00590
00591 void CCJMaskEdit::UpdateFont()
00592 {
00593     m_Font.DeleteObject();
00594     NONCLIENTMETRICS ncm;
00595     ncm.cbSize = sizeof(ncm);
00596     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00597     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00598     SetFont(&m_Font);
00599 }
00600
00601 BOOL CCJMaskEdit::OnEraseBkgnd(CDC* pDC)
00602 {
00603     // KStowell - overridden for flicker-free drawing.
00604     UNUSED_ALWAYS(pDC);
00605     return TRUE;
00606 }
00607
00608 void CCJMaskEdit::OnPaint()
00609 {
00610     // Use a "Offscreen" DC to fill rect and send to DefWindowProc...
00611     CClientDC memDC(this);
00612
00613     CRect rcClip;
00614     GetClientRect(&rcClip);
00615     memDC.FillSolidRect(rcClip, ::GetSysColor(COLOR_WINDOW));
00616     DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, (LPARAM)0 );
00617
00618     // Default is called for cleanup.
00619     Default();
00620 }
Generated on Sun Feb 24 01:21:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJMDIChildWnd.cpp Source File

WinCvs/CJLib/CJLibrary/CJMDIChildWnd.cpp

Go to the documentation of this file.
00001 // CJMDIChildWnd.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/CJLibrary/CJMDIChildWnd.cpp $
00011  *
00012  * $History: CJMDIChildWnd.cpp $
00013  *
00014  * *****************  Version 6  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:02p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Overrode OnEraseBkgnd(...) for flicker free drawing.
00018  *
00019  * *****************  Version 5  *****************
00020  * User: Kirk Stowell Date: 10/26/99   Time: 10:56p
00021  * Updated in $/CodeJock/CJLibrary
00022  * Added variables to hold menu and toolbar resource ids for use with menu
00023  * bar initialization.
00024  *
00025  * *****************  Version 4  *****************
00026  * User: Kirk Stowell Date: 10/06/99   Time: 6:21a
00027  * Updated in $/CodeJockey/CJLibrary
00028  * Added cool menu support for MDI applications that do not have a
00029  * document/view architecture. Added GetInitializedMenu() to
00030  * CCJMDIChildWnd which will initialize the menu for a given view,  and
00031  * overloaded InitializeMenu() in CCJMDIFrameWnd. Thanks to Golovanov
00032  * Michael [Golovanov@SoftLab.RU] for help with this.
00033  *
00034  * *****************  Version 3  *****************
00035  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00036  * Updated in $/CodeJockey/CJLibrary
00037  * Updated copyright and contact information.
00038  *
00039  * *****************  Version 2  *****************
00040  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00041  * Updated in $/CodeJockey/CJLibrary
00042  *
00043  * *****************  Version 1  *****************
00044  * User: Kirk Stowell Date: 6/26/99    Time: 8:30p
00045  * Created in $/CodeJockey/CJLibrary
00046  * Initial creation. Added to library to allow CCJControlBar and
00047  * CCJToolBar docking.
00048  *
00049  ***************************************************************************/
00051
00052 #include "stdafx.h"
00053 #include "CJMDIChildWnd.h"
00054 #include "CJDockBar.h"
00055 #include "CJSizeDockBar.h"
00056 #include "CJControlBar.h"
00057 #include "CJMiniDockFrameWnd.h"
00058 #include "CJToolBar.h"
00059 #include "CJMDIFrameWnd.h"
00060
00061 #ifdef _DEBUG
00062 #define new DEBUG_NEW
00063 #undef THIS_FILE
00064 static char THIS_FILE[] = __FILE__;
00065 #endif
00066
00068 // CCJMDIChildWnd
00069
00070 IMPLEMENT_DYNCREATE(CCJMDIChildWnd, CMDIChildWnd)
00071
00072 CCJMDIChildWnd::CCJMDIChildWnd()
00073 {
00074     m_hMenu       = NULL;
00075     m_nToolBarIDs = NULL;
00076     m_nMenuID     = 0;
00077     m_nToolBarID  = 0;
00078     m_nCount      = 0;
00079 }
00080
00081 CCJMDIChildWnd::~CCJMDIChildWnd()
00082 {
00083 }
00084
00085
00086 BEGIN_MESSAGE_MAP(CCJMDIChildWnd, CMDIChildWnd)
00087     //{{AFX_MSG_MAP(CCJMDIChildWnd)
00088     ON_WM_ERASEBKGND()
00089     //}}AFX_MSG_MAP
00090 END_MESSAGE_MAP()
00091
00093 // CCJMDIChildWnd message handlers
00094
00095 // dwDockBarMap
00096 DWORD CCJMDIChildWnd::dwDockBarMap[4][2] =
00097 {
00098     { AFX_IDW_DOCKBAR_TOP,      CBRS_TOP    },
00099     { AFX_IDW_DOCKBAR_BOTTOM,   CBRS_BOTTOM },
00100     { AFX_IDW_DOCKBAR_LEFT,     CBRS_LEFT   },
00101     { AFX_IDW_DOCKBAR_RIGHT,    CBRS_RIGHT  },
00102 };
00103
00104 void CCJMDIChildWnd::DockControlBarLeftOf(CControlBar* Bar, CControlBar* LeftOf)
00105 {
00106     CRect rect;
00107     DWORD dw;
00108     UINT n;
00109
00110     // get MFC to adjust the dimensions of all docked ToolBars
00111     // so that GetWindowRect will be accurate
00112     RecalcLayout(TRUE);
00113
00114     LeftOf->GetWindowRect(&rect);
00115     rect.OffsetRect(1,0);
00116     dw=LeftOf->GetBarStyle();
00117     n = 0;
00118     n = (dw&CBRS_ALIGN_TOP)              ? AFX_IDW_DOCKBAR_TOP      : n;
00119     n = (dw&CBRS_ALIGN_BOTTOM   && n==0) ? AFX_IDW_DOCKBAR_BOTTOM   : n;
00120     n = (dw&CBRS_ALIGN_LEFT     && n==0) ? AFX_IDW_DOCKBAR_LEFT     : n;
00121     n = (dw&CBRS_ALIGN_RIGHT    && n==0) ? AFX_IDW_DOCKBAR_RIGHT    : n;
00122
00123     // When we take the default parameters on rect, DockControlBar will dock
00124     // each Toolbar on a seperate line. By calculating a rectangle, we in effect
00125     // are simulating a Toolbar being dragged to that location and docked.
00126     DockControlBar(Bar,n,&rect);
00127 }
00128
00129 void CCJMDIChildWnd::EnableDocking(DWORD dwDockStyle)
00130 {
00131     // must be CBRS_ALIGN_XXX or CBRS_FLOAT_MULTI only
00132     ASSERT((dwDockStyle & ~(CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI)) == 0);
00133     CMDIChildWnd::EnableDocking(dwDockStyle);
00134
00135     for (int i = 0; i < 4; i++) {
00136         if (dwDockBarMap[i][1] & dwDockStyle & CBRS_ALIGN_ANY) {
00137             CDockBar* pDock = (CDockBar*)GetControlBar(dwDockBarMap[i][0]);
00138
00139             // make sure the dock bar is of correct type
00140             if( pDock || !pDock->IsKindOf(RUNTIME_CLASS(CCJDockBar)) ) {
00141                 BOOL bNeedDelete = ! pDock->m_bAutoDelete;
00142                 pDock->m_pDockSite->RemoveControlBar(pDock);
00143                 pDock->m_pDockSite = 0; // avoid problems in destroying the dockbar
00144                 pDock->DestroyWindow();
00145                 if( bNeedDelete )
00146                     delete pDock;
00147                 pDock = 0;
00148             }
00149
00150             if( pDock == 0 ) {
00151                 pDock = new CCJDockBar;
00152                 if (!pDock->Create(this,
00153                     WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_CHILD|WS_VISIBLE |
00154                     dwDockBarMap[i][1], dwDockBarMap[i][0])) {
00155                     AfxThrowResourceException();
00156                 }
00157             }
00158         }
00159     }
00160 }
00161
00162 void CCJMDIChildWnd::RecalcLayout(BOOL bNotify)
00163 {
00164     CMDIChildWnd::RecalcLayout(bNotify);
00165     RecalcAllExcept(NULL);
00166 }
00167
00168 // Yiannhs changed this
00169 void CCJMDIChildWnd::EnableDockingSizeBar(DWORD dwDockStyle, DockFlatBorders FlatFlags )
00170 {
00171     // must be CBRS_ALIGN_XXX or CBRS_FLOAT_MULTI only
00172     ASSERT((dwDockStyle & ~(CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI)) == 0);
00173
00174     m_pFloatingFrameClass = RUNTIME_CLASS(CCJMiniDockFrameWnd);
00175     for (int i = 0; i < 4; i++)
00176     {
00177         if (dwSizeBarMap[i][1] & dwDockStyle & CBRS_ALIGN_ANY)
00178         {
00179             CCJSizeDockBar* pDock = (CCJSizeDockBar*)GetControlBar(dwSizeBarMap[i][0]);
00180             if (pDock == NULL)
00181             {
00182                 pDock = new CCJSizeDockBar;
00183
00184                 if (!pDock->Create(this,
00185                     WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_CHILD|WS_VISIBLE |
00186                         dwSizeBarMap[i][1], dwSizeBarMap[i][0]))
00187                 {
00188                     AfxThrowResourceException();
00189                 }
00190                 //Yiannhs enable Flat Borders For dock Bars
00191                 pDock->FlatBorder( (FlatFlags >> i) & 0x0001 );
00192             }
00193         }
00194     }
00195 }
00196
00197 void CCJMDIChildWnd::RecalcAllExcept(CCJSizeDockBar *pBar)
00198 {
00199     for (int i = 0; i < 4; i++)
00200     {
00201         CCJSizeDockBar* pDock = (CCJSizeDockBar*)GetControlBar(dwSizeBarMap[i][0]);
00202         if (pDock != NULL && pDock != pBar)
00203         {
00204             pDock->CalcSizeBarLayout();
00205         }
00206     }
00207 }
00208
00209 void CCJMDIChildWnd::DockSizeBar(CControlBar * pBar,CCJSizeDockBar *pDockBar, LPRECT lpRect)
00210 {
00211     ASSERT(pBar != NULL);
00212     ASSERT(pBar->m_pDockContext != NULL);
00213
00214     if( pDockBar == NULL )
00215     {
00216         for (int i = 0; i < 4; i++)
00217         {
00218             if ((dwSizeBarMap[i][1] & CBRS_ALIGN_ANY) == (pBar->m_dwStyle & CBRS_ALIGN_ANY))
00219             {
00220                 pDockBar = (CCJSizeDockBar*)GetControlBar(dwSizeBarMap[i][0]);
00221                 ASSERT(pDockBar != NULL);
00222
00223                 int nSize = 0;
00224
00225                 switch(i)
00226                 {
00227                 case 0: // horizontal dock
00228                 case 1:
00229                     nSize = ((CCJControlBar*)pBar)->GetHorzSize();
00230                     break;
00231                 case 2: // vertical dock
00232                 case 3:
00233                     nSize = ((CCJControlBar*)pBar)->GetVertSize();
00234                     break;
00235                 }
00236
00237                 pDockBar->SetActualSize( nSize );
00238                 break;
00239             }
00240         }
00241     }
00242
00243     ASSERT(pDockBar != NULL);
00244     ASSERT(m_listControlBars.Find(pBar) != NULL);
00245     ASSERT(pBar->m_pDockSite == this);
00246     ((CCJControlBar*)pBar)->Normalize();
00247     pDockBar->DockControlBar(pBar, lpRect);
00248 }
00249
00250 HMENU CCJMDIChildWnd::GetInitializedMenu(UINT nMenuID, UINT nToolBarID)
00251 {
00252     if( m_hMenu ) {
00253         return m_hMenu;
00254     }
00255
00256     CCJMDIFrameWnd* pMainFrame = DYNAMIC_DOWNCAST(CCJMDIFrameWnd, GetParentFrame());
00257     if( pMainFrame ) {
00258         pMainFrame->InitializeMenu( &m_hMenu, nMenuID, nToolBarID );
00259         m_nMenuID     = nMenuID;
00260         m_nToolBarID  = nToolBarID;
00261     }
00262
00263     return m_hMenu;
00264 }
00265
00266 HMENU CCJMDIChildWnd::GetInitializedMenu(UINT nMenuID, UINT* nToolbarIDs, int nSize)
00267 {
00268     if( m_hMenu ) {
00269         return m_hMenu;
00270     }
00271
00272     CCJMDIFrameWnd* pMainFrame = DYNAMIC_DOWNCAST(CCJMDIFrameWnd, GetParentFrame());
00273     if( pMainFrame ) {
00274         pMainFrame->InitializeMenu( &m_hMenu, nMenuID, nToolbarIDs, nSize);
00275         m_nMenuID     = nMenuID;
00276         m_nToolBarIDs = nToolbarIDs;
00277         m_nCount      = nSize;
00278     }
00279
00280     return m_hMenu;
00281 }
00282
00283 BOOL CCJMDIChildWnd::OnEraseBkgnd(CDC* pDC)
00284 {
00285     CRect rect;
00286     GetClientRect(&rect);
00287     pDC->ExcludeClipRect(rect);
00288
00289     return CMDIChildWnd::OnEraseBkgnd(pDC);
00290 }
Generated on Sun Feb 24 01:21:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJMDIFrameWnd.cpp Source File

WinCvs/CJLib/CJLibrary/CJMDIFrameWnd.cpp

Go to the documentation of this file.
00001 // CJMDIFrameWnd.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/CJLibrary/CJMDIFrameWnd.cpp $
00011  *
00012  * $History: CJMDIFrameWnd.cpp $
00013  *
00014  * *****************  Version 17  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:04p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Minor update to PreCreateWindow(...) for flicker free drawing.
00018  *
00019  * *****************  Version 16  *****************
00020  * User: Kirk Stowell Date: 10/29/99   Time: 12:43a
00021  * Updated in $/CodeJock/CJLibrary
00022  * Overloaded PreCreateWindow(...) for flicker free drawing.
00023  *
00024  * *****************  Version 15  *****************
00025  * User: Kirk Stowell Date: 10/14/99   Time: 11:55p
00026  * Updated in $/CodeJock/CJLibrary
00027  * Fixed possible access violations in NewMenu methods. Thanks to Gero
00028  * Kuehn [gero.kuehn@isc-soft.de] for help with this.
00029  *
00030  * *****************  Version 14  *****************
00031  * User: Kirk Stowell Date: 10/14/99   Time: 6:15p
00032  * Updated in $/CodeJock/CJLibrary
00033  * Fixed bug with a document becomes the active document when the user
00034  * clicks inside a tab in the CCJTabControlBar to perform some operation.
00035  * When closing the application, MFC decides in CFrameWnd::OnClose() to
00036  * check if the 'active' document is modified before checking all other
00037  * documuents. If the active document is not modified and can close its
00038  * frame, it does not check other documents individually and shuts down
00039  * without asking the important 'modified save' questions. To fix this,
00040  * OnClose() was overriden to add a call to "SetActiveView(NULL)" just
00041  * before the base class OnClose is called. This will check all documents
00042  * asking the save question before closing the application. Thanks to
00043  * Simon Clark [spc@otleda.com] for help with this.
00044  *
00045  * *****************  Version 13  *****************
00046  * User: Kirk Stowell Date: 10/14/99   Time: 10:05a
00047  * Updated in $/CodeJock/CJLibrary
00048  * Overrode OnEraseBkgnd(...) to help to eliminate screen flicker.
00049  *
00050  * *****************  Version 12  *****************
00051  * User: Kirk Stowell Date: 10/06/99   Time: 6:21a
00052  * Updated in $/CodeJockey/CJLibrary
00053  * Added cool menu support for MDI applications that do not have a
00054  * document/view architecture. Added GetInitializedMenu() to
00055  * CCJMDIChildWnd which will initialize the menu for a given view,  and
00056  * overloaded InitializeMenu() in CCJMDIFrameWnd. Thanks to Golovanov
00057  * Michael [Golovanov@SoftLab.RU] for help with this.
00058  *
00059  * *****************  Version 11  *****************
00060  * User: Kirk Stowell Date: 9/16/99    Time: 2:35p
00061  * Updated in $/CodeJockey/CJLibrary
00062  * Fixed bug with save / restore bar state, and with saved bar size
00063  * changing whenever the application starts.
00064  *
00065  * *****************  Version 10  *****************
00066  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00067  * Updated in $/CodeJockey/CJLibrary
00068  * Updated copyright and contact information.
00069  *
00070  * *****************  Version 9  *****************
00071  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00072  * Updated in $/CodeJockey/CJLibrary
00073  *
00074  * *****************  Version 8  *****************
00075  * User: Kirk Stowell Date: 6/11/99    Time: 8:25p
00076  * Updated in $/CodeJockey/CJ60Lib
00077  * Slight modification made to popup menu code.
00078  *
00079  * *****************  Version 7  *****************
00080  * User: Kirk Stowell Date: 6/09/99    Time: 8:33p
00081  * Updated in $/CodeJockey/CJ60Lib
00082  * Ioannhs Stamatopoulos (Yiannhs) [ystamat@mail.datamedia.gr] - Extended
00083  * docking windows, removed ::GetSysColor(...) calls and WM_SYSCOLORCHANGE
00084  * message handler, this is now automatically handled by the base class.
00085  * Added redraw flags to the create method and modified paint and layout
00086  * handlers to reduce flicker and un-necessary command handling. Dragging
00087  * rect now reflects actual control bar docked size. Added "flat" look to
00088  * the control bars, the control bars can now use the classic DevStudio
00089  * look, or use flat gradient gripper, borders and frame buttons. Overall,
00090  * docking windows now handle dragging, docking and floating much better,
00091  * and behave more like DevStudio.
00092  *
00093  * *****************  Version 6  *****************
00094  * User: Kirk Stowell Date: 5/02/99    Time: 5:23p
00095  * Updated in $/CodeJockey/CJ60Lib
00096  * Further modifications for CCJMenu support.
00097  *
00098  * *****************  Version 5  *****************
00099  * User: Kirk Stowell Date: 5/02/99    Time: 2:13a
00100  * Updated in $/CodeJockey/CJ60Lib
00101  * Re-wrote CCJMenu releated methods so that multiple documents can be
00102  * added with associated menu support. Added typedef CList <CCJMenu*,
00103  * CCJMenu*> CMDIMenuList; so that menus pointers are stored in a list and
00104  * not member variables.
00105  *
00106  * *****************  Version 4  *****************
00107  * User: Kirk Stowell Date: 4/25/99    Time: 10:37p
00108  * Updated in $/CodeJockey/CJ60Lib
00109  * Added support for Brent Corkum's BCMenu (CCJMenu), which is a replacement for the
00110  * CCoolMenu class.
00111  *
00112  * *****************  Version 3  *****************
00113  * User: Kirk Stowell Date: 4/03/99    Time: 8:41p
00114  * Updated in $/CodeJockey/CJ60Lib
00115  * Added comments and cleaned up code.
00116  *
00117  * *****************  Version 2  *****************
00118  * User: Kirk Stowell Date: 1/12/99    Time: 8:41p
00119  * Updated in $/CodeJockey/CJ60Lib
00120  * Total re-write to add side-by-side docking support for CCJControlBar
00121  * class.
00122  *
00123  * *****************  Version 1  *****************
00124  * User: Kirk Stowell Date: 10/17/98   Time: 8:41p
00125  * Created in $/CodeJockey/CJ60Lib
00126  * Initial re-write and release.
00127  *
00128  ***************************************************************************/
00130
00131 #include "stdafx.h"
00132 #include "CJMDIFrameWnd.h"
00133 #include "CJDockBar.h"
00134 #include "CJSizeDockBar.h"
00135 #include "CJControlBar.h"
00136 #include "CJMiniDockFrameWnd.h"
00137 #include "CJToolBar.h"
00138
00139 #ifdef _DEBUG
00140 #define new DEBUG_NEW
00141 #undef THIS_FILE
00142 static char THIS_FILE[] = __FILE__;
00143 #endif
00144
00146 // CCJMDIFrameWnd
00147
00148 CCJMDIFrameWnd::CCJMDIFrameWnd()
00149 {
00150
00151 }
00152
00153 CCJMDIFrameWnd::~CCJMDIFrameWnd()
00154 {
00155     // Free up any allocated memory.
00156     while (!m_menuList.IsEmpty()) {
00157         CCJMenu* pMenu = m_menuList.RemoveTail();
00158         _delete(pMenu);
00159     }
00160 }
00161
00162 IMPLEMENT_DYNCREATE(CCJMDIFrameWnd, CMDIFrameWnd)
00163
00164 BEGIN_MESSAGE_MAP(CCJMDIFrameWnd, CMDIFrameWnd)
00165     //{{AFX_MSG_MAP(CCJMDIFrameWnd)
00166     ON_WM_MEASUREITEM()
00167     ON_WM_MENUCHAR()
00168     ON_WM_INITMENUPOPUP()
00169     ON_WM_CLOSE()
00170     //}}AFX_MSG_MAP
00171 END_MESSAGE_MAP()
00172
00174 // CCJMDIFrameWnd message handlers
00175
00176 // dwDockBarMap
00177 DWORD CCJMDIFrameWnd::dwDockBarMap[4][2] =
00178 {
00179     { AFX_IDW_DOCKBAR_TOP,      CBRS_TOP    },
00180     { AFX_IDW_DOCKBAR_BOTTOM,   CBRS_BOTTOM },
00181     { AFX_IDW_DOCKBAR_LEFT,     CBRS_LEFT   },
00182     { AFX_IDW_DOCKBAR_RIGHT,    CBRS_RIGHT  },
00183 };
00184
00185 void CCJMDIFrameWnd::DockControlBarLeftOf(CControlBar* Bar, CControlBar* LeftOf)
00186 {
00187     CRect rect;
00188     DWORD dw;
00189     UINT n;
00190
00191     // get MFC to adjust the dimensions of all docked ToolBars
00192     // so that GetWindowRect will be accurate
00193     RecalcLayout(TRUE);
00194
00195     LeftOf->GetWindowRect(&rect);
00196     rect.OffsetRect(1,0);
00197     dw=LeftOf->GetBarStyle();
00198     n = 0;
00199     n = (dw&CBRS_ALIGN_TOP)              ? AFX_IDW_DOCKBAR_TOP      : n;
00200     n = (dw&CBRS_ALIGN_BOTTOM   && n==0) ? AFX_IDW_DOCKBAR_BOTTOM   : n;
00201     n = (dw&CBRS_ALIGN_LEFT     && n==0) ? AFX_IDW_DOCKBAR_LEFT     : n;
00202     n = (dw&CBRS_ALIGN_RIGHT    && n==0) ? AFX_IDW_DOCKBAR_RIGHT    : n;
00203
00204     // When we take the default parameters on rect, DockControlBar will dock
00205     // each Toolbar on a seperate line. By calculating a rectangle, we in effect
00206     // are simulating a Toolbar being dragged to that location and docked.
00207     DockControlBar(Bar,n,&rect);
00208 }
00209
00210 void CCJMDIFrameWnd::EnableDocking(DWORD dwDockStyle)
00211 {
00212     // must be CBRS_ALIGN_XXX or CBRS_FLOAT_MULTI only
00213     ASSERT((dwDockStyle & ~(CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI)) == 0);
00214     CMDIFrameWnd::EnableDocking(dwDockStyle);
00215
00216     for (int i = 0; i < 4; i++) {
00217         if (dwDockBarMap[i][1] & dwDockStyle & CBRS_ALIGN_ANY) {
00218             CDockBar* pDock = (CDockBar*)GetControlBar(dwDockBarMap[i][0]);
00219
00220             // make sure the dock bar is of correct type
00221             if( pDock || !pDock->IsKindOf(RUNTIME_CLASS(CCJDockBar)) ) {
00222                 BOOL bNeedDelete = ! pDock->m_bAutoDelete;
00223                 pDock->m_pDockSite->RemoveControlBar(pDock);
00224                 pDock->m_pDockSite = 0; // avoid problems in destroying the dockbar
00225                 pDock->DestroyWindow();
00226                 if( bNeedDelete )
00227                     delete pDock;
00228                 pDock = 0;
00229             }
00230
00231             if( pDock == 0 ) {
00232                 pDock = new CCJDockBar;
00233                 if (!pDock->Create(this,
00234                     WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_CHILD|WS_VISIBLE |
00235                     dwDockBarMap[i][1], dwDockBarMap[i][0])) {
00236                     AfxThrowResourceException();
00237                 }
00238             }
00239         }
00240     }
00241 }
00242
00243 void CCJMDIFrameWnd::RecalcLayout(BOOL bNotify)
00244 {
00245     CMDIFrameWnd::RecalcLayout(bNotify);
00246     RecalcAllExcept(NULL);
00247 }
00248
00249 // Yiannhs changed this
00250 void CCJMDIFrameWnd::EnableDockingSizeBar(DWORD dwDockStyle, DockFlatBorders FlatFlags )
00251 {
00252     // must be CBRS_ALIGN_XXX or CBRS_FLOAT_MULTI only
00253     ASSERT((dwDockStyle & ~(CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI)) == 0);
00254
00255     m_pFloatingFrameClass = RUNTIME_CLASS(CCJMiniDockFrameWnd);
00256     for (int i = 0; i < 4; i++)
00257     {
00258         if (dwSizeBarMap[i][1] & dwDockStyle & CBRS_ALIGN_ANY)
00259         {
00260             CCJSizeDockBar* pDock = (CCJSizeDockBar*)GetControlBar(dwSizeBarMap[i][0]);
00261             if (pDock == NULL)
00262             {
00263                 pDock = new CCJSizeDockBar;
00264
00265                 if (!pDock->Create(this,
00266                     WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_CHILD|WS_VISIBLE |
00267                         dwSizeBarMap[i][1], dwSizeBarMap[i][0]))
00268                 {
00269                     AfxThrowResourceException();
00270                 }
00271                 //Yiannhs enable Flat Borders For dock Bars
00272                 pDock->FlatBorder( (FlatFlags >> i) & 0x0001 );
00273             }
00274         }
00275     }
00276 }
00277
00278 void CCJMDIFrameWnd::RecalcAllExcept(CCJSizeDockBar *pBar)
00279 {
00280     for (int i = 0; i < 4; i++)
00281     {
00282         CCJSizeDockBar* pDock = (CCJSizeDockBar*)GetControlBar(dwSizeBarMap[i][0]);
00283         if (pDock != NULL && pDock != pBar)
00284         {
00285             pDock->CalcSizeBarLayout();
00286         }
00287     }
00288 }
00289
00290 void CCJMDIFrameWnd::DockSizeBar(CControlBar * pBar,CCJSizeDockBar *pDockBar, LPRECT lpRect)
00291 {
00292     ASSERT(pBar != NULL);
00293     ASSERT(pBar->m_pDockContext != NULL);
00294
00295     if( pDockBar == NULL )
00296     {
00297         for (int i = 0; i < 4; i++)
00298         {
00299             if ((dwSizeBarMap[i][1] & CBRS_ALIGN_ANY) == (pBar->m_dwStyle & CBRS_ALIGN_ANY))
00300             {
00301                 pDockBar = (CCJSizeDockBar*)GetControlBar(dwSizeBarMap[i][0]);
00302                 ASSERT(pDockBar != NULL);
00303
00304                 int nSize = 0;
00305
00306                 switch(i)
00307                 {
00308                 case 0: // horizontal dock
00309                 case 1:
00310                     nSize = ((CCJControlBar*)pBar)->GetHorzSize();
00311                     break;
00312                 case 2: // vertical dock
00313                 case 3:
00314                     nSize = ((CCJControlBar*)pBar)->GetVertSize();
00315                     break;
00316                 }
00317
00318                 pDockBar->SetActualSize( nSize );
00319                 break;
00320             }
00321         }
00322     }
00323
00324     ASSERT(pDockBar != NULL);
00325     ASSERT(m_listControlBars.Find(pBar) != NULL);
00326     ASSERT(pBar->m_pDockSite == this);
00327     ((CCJControlBar*)pBar)->Normalize();
00328     pDockBar->DockControlBar(pBar, lpRect);
00329 }
00330
00331 HMENU CCJMDIFrameWnd::NewMenu(UINT nMenuID, UINT nToolbarID)
00332 {
00333     // Allocate a new CCJMenu object.
00334     CCJMenu* pMenu = new CCJMenu;
00335     if( pMenu == NULL ) {
00336         return NULL;
00337     }
00338
00339     // Load the menu and toolbar resource.
00340     pMenu->LoadMenu(nMenuID);
00341     if (nToolbarID) {
00342         pMenu->LoadToolbar(nToolbarID);
00343     }
00344
00345     // Add the menu to the CList object.
00346     m_menuList.AddTail(pMenu);
00347
00348     // Detach the menu.
00349     return(pMenu->Detach());
00350 }
00351
00352 HMENU CCJMDIFrameWnd::NewMenu(UINT nMenuID, UINT* nToolbarIDs, int nSize)
00353 {
00354     // Allocate a new CCJMenu object.
00355     CCJMenu* pMenu = new CCJMenu;
00356     if( pMenu == NULL ) {
00357         return NULL;
00358     }
00359
00360     // Load the menu and toolbar resources.
00361     pMenu->LoadMenu(nMenuID);
00362     if (nToolbarIDs) {
00363         pMenu->LoadToolbars(nToolbarIDs, nSize);
00364     }
00365
00366     // Add the menu to the CList object.
00367     m_menuList.AddTail(pMenu);
00368
00369     // Detach the menu.
00370     return(pMenu->Detach());
00371 }
00372
00373 BOOL CCJMDIFrameWnd::InitializeMenu(CMultiDocTemplate* pDocTemplate, UINT nMenuID, UINT nToolBarID/*=NULL*/, UINT nDefaultMenuID/*=NULL*/)
00374 {
00375     ASSERT(nMenuID);            // must be valid.
00376
00377     // If no menus have been created yet, set the frame default,
00378     // this is the menu that is displayed when no views are active.
00379     if (m_menuList.IsEmpty()) {
00380         ASSERT(nDefaultMenuID != 0);
00381         m_hMenuDefault = NewMenu(nDefaultMenuID, nToolBarID);
00382         OnUpdateFrameMenu(m_hMenuDefault);
00383     }
00384     // Create the Doc/View menu. ONLY if there is a template passed.
00385     if( pDocTemplate )
00386     {
00387         ASSERT_VALID(pDocTemplate); // must be valid.
00388         pDocTemplate->m_hMenuShared = NewMenu(nMenuID, nToolBarID);
00389     }
00390     return TRUE;
00391 }
00392
00393 BOOL CCJMDIFrameWnd::InitializeMenu(CMultiDocTemplate* pDocTemplate, UINT nMenuID, UINT* nToolbarIDs/*=NULL*/, int nSize/*=NULL*/, UINT nDefaultMenuID/*=NULL*/)
00394 {
00395     ASSERT(nMenuID);            // must be valid.
00396
00397     // If no menus have been created yet, set the frame default,
00398     // this is the menu that is displayed when no views are active.
00399     if (m_menuList.IsEmpty()) {
00400         ASSERT(nDefaultMenuID != 0);
00401         m_hMenuDefault = NewMenu(nDefaultMenuID, nToolbarIDs, nSize);
00402         OnUpdateFrameMenu(m_hMenuDefault);
00403     }
00404     // Create the Doc/View menu. ONLY if there is a template passed.
00405     if( pDocTemplate )
00406     {
00407         ASSERT_VALID(pDocTemplate); // must be valid.
00408         pDocTemplate->m_hMenuShared = NewMenu(nMenuID, nToolbarIDs, nSize);
00409     }
00410
00411     return TRUE;
00412 }
00413
00414 BOOL CCJMDIFrameWnd::InitializeMenu( HMENU* phMenu, UINT nMenuID, UINT nToolbarID/*=NULL*/)
00415 {
00416     if( !phMenu ) {
00417         return FALSE;
00418     }
00419
00420     ASSERT(nMenuID);            // must be valid.
00421     *phMenu = NewMenu( nMenuID, nToolbarID );
00422
00423     return (BOOL)(*phMenu != NULL);
00424 }
00425
00426 BOOL CCJMDIFrameWnd::InitializeMenu( HMENU* phMenu, UINT nMenuID, UINT* nToolbarIDs/*=NULL*/, int nSize/*=NULL*/)
00427 {
00428     if( !phMenu ) {
00429         return FALSE;
00430     }
00431
00432     ASSERT(nMenuID);            // must be valid.
00433     *phMenu = NewMenu(nMenuID, nToolbarIDs, nSize);
00434
00435     return (BOOL)(*phMenu != NULL);
00436 }
00437
00438 void CCJMDIFrameWnd::OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)
00439 {
00440     if (lpMeasureItemStruct->CtlType == ODT_MENU)
00441     {
00442         if (IsMenu((HMENU)lpMeasureItemStruct->itemID)) {
00443             CMenu* pMenu = CMenu::FromHandle((HMENU)lpMeasureItemStruct->itemID);
00444
00445             // Loop through all menus in list.
00446             for (POSITION pos = m_menuList.GetHeadPosition(); pos; m_menuList.GetNext(pos))
00447             {
00448                 CCJMenu* pListMenu = m_menuList.GetAt(pos);
00449
00450                 if(pListMenu->IsMenu(pMenu)) {
00451                     pListMenu->MeasureItem(lpMeasureItemStruct);
00452                     return;
00453                 }
00454             }
00455         }
00456     }
00457
00458     CMDIFrameWnd::OnMeasureItem(nIDCtl, lpMeasureItemStruct);
00459 }
00460
00461 LRESULT CCJMDIFrameWnd::OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu)
00462 {
00463     // Loop through all menus in list.
00464     for (POSITION pos = m_menuList.GetHeadPosition(); pos; m_menuList.GetNext(pos))
00465     {
00466         CCJMenu* pListMenu = m_menuList.GetAt(pos);
00467
00468         if(pListMenu->IsMenu(pMenu)) {
00469             return CCJMenu::FindKeyboardShortcut(nChar, nFlags, pMenu);
00470         }
00471     }
00472
00473     return CMDIFrameWnd::OnMenuChar(nChar, nFlags, pMenu);
00474 }
00475
00476 void CCJMDIFrameWnd::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu)
00477 {
00478     CMDIFrameWnd::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
00479
00480     if(!bSysMenu)
00481     {
00482         // Loop through all menus in list.
00483         for (POSITION pos = m_menuList.GetHeadPosition(); pos; m_menuList.GetNext(pos))
00484         {
00485             CCJMenu* pListMenu = m_menuList.GetAt(pos);
00486
00487             if(pListMenu->IsMenu(pPopupMenu)) {
00488                 CCJMenu::UpdateMenu(pPopupMenu);
00489                 break;
00490             }
00491         }
00492     }
00493 }
00494
00495 void CCJMDIFrameWnd::LoadBarState(LPCTSTR lpszProfileName)
00496 {
00497     CCJSizeDockBar::m_bIsDockBar = true;
00498     CFrameWnd::LoadBarState(lpszProfileName);
00499     CCJSizeDockBar::m_bIsDockBar = false;
00500 }
00501
00502 void CCJMDIFrameWnd::SaveBarState(LPCTSTR lpszProfileName) const
00503 {
00504     CCJSizeDockBar::m_bIsDockBar = true;
00505     CFrameWnd::SaveBarState(lpszProfileName);
00506     CCJSizeDockBar::m_bIsDockBar = false;
00507 }
00508
00509 void CCJMDIFrameWnd::OnClose()
00510 {
00511     // Clear active view before close
00512     SetActiveView (NULL);
00513     CMDIFrameWnd::OnClose();
00514 }
00515
00516 // Default implementation.
00517 BOOL CCJMDIFrameWnd::PreCreateWindow(CREATESTRUCT& cs)
00518 {
00519     return CMDIFrameWnd::PreCreateWindow(cs);
00520 }
00521
00523 // Overloaded for flicker-free drawing with no CS_VREDRAW and CS_HREDRAW.
00524 // Override in CMainFrame and call this method, rather than the default. Pass
00525 // in your apps icon resource usually IDR_MAINFRAME.
00526 //
00527 BOOL CCJMDIFrameWnd::PreCreateWindow(CREATESTRUCT& cs, UINT nIconID)
00528 {
00529     // Register wnd class with no redraw, cursor (use default), background
00530     // brush and load your apps icon resource.
00531     cs.lpszClass = AfxRegisterWndClass( 0, NULL, NULL,
00532         AfxGetApp()->LoadIcon(nIconID));
00533     ASSERT(cs.lpszClass);
00534
00535     return CMDIFrameWnd::PreCreateWindow(cs);
00536 }
Generated on Sun Feb 24 01:21:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJMemFile.cpp Source File

WinCvs/CJLib/CJLibrary/CJMemFile.cpp

Go to the documentation of this file.
00001 // CJMemFile.cpp: implementation of Maxallion's CCJMemFile class.
00002 //
00003 // Copyright © 1999 Maxallion
00004 // mailto:XFile@maxallion.8m.com
00005 // ICQ# 32304418
00006 //
00007 // CXFile - Extended Memory File - Beta - w/o a lot of error checking
00008 // - Is used like a normal CFile or CStdioFile or CMemFile object
00009 // - String Functions : ReadString, WriteString
00010 // - Loads physical files into memory on creation and saves them back to disk on destruction
00011 // - Can duplicate itself to other CFile derived objects
00012 // - Has a Search function
00013 // - can be read-accessed like an array
00014 //
00015 // OVERLOADED OPERATORS:
00016 // = Imports from another file or sets file Position
00017 // += Appends another file
00018 // [] reads a byte like an array
00019 //
00021 /****************************************************************************
00022  *
00023  * $Date: 1999/11/30 21:45:49 $
00024  * $Revision: 1.1.1.1 $
00025  * $Archive: /CodeJock/CJLibrary/CJMemFile.cpp $
00026  *
00027  * $History: CJMemFile.cpp $
00028  *
00029  * *****************  Version 2  *****************
00030  * User: Kirk Stowell Date: 10/24/99   Time: 3:06a
00031  * Updated in $/CodeJock/CJLibrary
00032  * Added UNICODE modifications.
00033  *
00034  * *****************  Version 1  *****************
00035  * User: Kirk Stowell Date: 10/24/99   Time: 3:01a
00036  * Created in $/CodeJock/CJLibrary
00037  * Initial creation.
00038  *
00039  ***************************************************************************/
00041
00042 #include "stdafx.h"
00043 #include "CJMemFile.h"
00044
00045 #ifdef _DEBUG
00046 #undef THIS_FILE
00047 static char THIS_FILE[]=__FILE__;
00048 #define new DEBUG_NEW
00049 #endif
00050
00052 // Construction/Destruction
00054
00055 CCJMemFile::CCJMemFile( UINT nGrowBytes)
00056 {
00057     // Modified default constructor
00058
00059     m_File.m_hFile = NULL;
00060     m_bOpen = false;
00061     m_uiOpenFlags = 0;
00062     CMemFile::CMemFile(nGrowBytes);
00063 }
00064
00065 CCJMemFile::CCJMemFile( BYTE* lpBuffer, UINT nBufferSize, UINT nGrowBytes )
00066 {
00067     // Modified default constructor
00068
00069     m_File.m_hFile = NULL;
00070     m_bOpen = false;
00071     m_uiOpenFlags = 0;
00072     CMemFile::CMemFile(lpBuffer,nBufferSize, nGrowBytes );
00073 }
00074
00075 CCJMemFile::CCJMemFile(LPCTSTR lpszFilename, UINT uiOpenFlags)
00076 {
00077     // CFile compatible constructor
00078
00079     m_File.m_hFile = NULL;
00080     m_bOpen = false;
00081     m_uiOpenFlags = uiOpenFlags;
00082     Open(lpszFilename,uiOpenFlags);
00083 }
00084
00085 CCJMemFile::~CCJMemFile()
00086 {
00087     if (m_bOpen)
00088         Close();
00089     m_File.m_hFile = NULL;
00090     m_uiOpenFlags = 0;
00091     CMemFile::~CMemFile();
00092 }
00093
00094 // Implementation
00095
00096 BOOL CCJMemFile::ReadString(CString& rString)
00097 {
00098     // Readstring Beta Version
00099
00100     rString.Empty();
00101     char ch;
00102
00103     bool bFound = false;
00104     while (GetPosition() < GetLength())
00105     {
00106         Read(&ch,1);
00107
00108         bFound = (ch == '\x0D');
00109         if (bFound || (ch == '\x0'))
00110             break;
00111         else
00112             rString = rString + ch;
00113     }
00114     if (bFound)
00115     {
00116         Read(&ch,1);
00117         if (ch != '\x0A')
00118             Seek(-1,current);
00119     }
00120
00121     if (rString.GetLength() > 0)
00122         return true;
00123     return false;
00124 }
00125
00126 void CCJMemFile::WriteString( LPCTSTR lpsz )
00127 {
00128     // WriteString Beta Version
00129
00130     if (_tcslen(lpsz) > 0)
00131     {
00132         for (UINT iCount = 0; iCount < _tcslen(lpsz); iCount++)
00133             if ((lpsz[iCount] != '\x0D') && (lpsz[iCount] != '\x00'))
00134                 Write(&lpsz[iCount],1);
00135     }
00136     char ch = '\x0D';
00137     Write(&ch,1);
00138     ch = '\x0A';
00139     Write(&ch,1);
00140
00141 }
00142
00143 bool CCJMemFile::Duplicate(CFile *fDuplicate)
00144 {
00145     // Standard Copy Routine
00146
00147     BYTE *pbData = new BYTE[1024];
00148     DWORD dwPos = GetPosition();
00149     SeekToBegin();
00150     fDuplicate->SetLength(0);
00151     while (GetPosition() < GetLength())
00152     {
00153         DWORD dwRead = Read(pbData,1024);
00154         fDuplicate->Write(pbData,dwRead);
00155     }
00156     Seek(dwPos,fDuplicate->begin);
00157     delete pbData;
00158     return true;
00159 }
00160
00161 bool CCJMemFile::Duplicate(CString strDup)
00162 {
00163     // Duplicate With CString compatibility
00164
00165     CFile file(strDup,CFile::modeCreate | CFile::modeWrite);
00166     bool bResult = Duplicate(&file);
00167     file.Close();
00168     return bResult;
00169 }
00170
00171 bool CCJMemFile::Open(CString strFilename, UINT uiOpenFlags,CFileException *pError)
00172 {
00173     // CFile compatible Open
00174
00175     if (m_File.m_hFile != NULL)
00176         return false;
00177     if (m_File.Open(strFilename,uiOpenFlags,pError))
00178     {
00179         m_uiOpenFlags = uiOpenFlags;
00180         Load();
00181         m_bOpen = true;
00182         return true;
00183     }
00184     else
00185         return false;
00186 }
00187
00188 bool CCJMemFile::Save()
00189 {
00190     if (m_File.m_hFile == NULL)
00191         return false;
00192     CString str;
00193
00194     // Check if the physical file has write access
00195     if (!(m_uiOpenFlags & modeWrite) && !(m_uiOpenFlags & modeReadWrite))
00196     {
00197         return false;
00198     }
00199
00200     DWORD dwPos = GetPosition();
00201     DWORD dwLength = 1024;
00202     BYTE *pData = new BYTE[dwLength];
00203     if (pData == NULL)
00204         return false;
00205     SeekToBegin();
00206     m_File.SetLength(0);
00207     while (GetPosition() < GetLength())
00208     {
00209         DWORD dwRead = Read(pData,dwLength);
00210         m_File.Write(pData,dwRead);
00211     }
00212     Seek(dwPos,begin);
00213     delete pData;
00214     m_File.Flush();
00215     return true;
00216 }
00217
00218 bool CCJMemFile::Load()
00219 {
00220     if (m_File.m_hFile == NULL)
00221         return false;
00222
00223     DWORD dwLength = 1024;
00224     BYTE *pData = new BYTE[dwLength];
00225     if (pData == NULL)
00226         return false;
00227     SeekToBegin();
00228     SetLength(0);
00229     m_File.SeekToBegin();
00230     while (m_File.GetPosition() < m_File.GetLength())
00231     {
00232         DWORD dwRead = m_File.Read(pData,dwLength);
00233         Write(pData,dwRead);
00234     }
00235
00236     delete pData;
00237     return true;
00238 }
00239
00240
00241 void CCJMemFile::Close()
00242 {
00243     if ((m_File.m_hFile != NULL) && m_bOpen)
00244     {
00245         m_bOpen = false;
00246         Save();
00247         m_File.Close();
00248         m_File.m_hFile = NULL;
00249     }
00250 }
00251
00252 void CCJMemFile::Flush()
00253 {
00254     CMemFile::Flush();
00255     Save();
00256 }
00257
00258 bool CCJMemFile::Discard()
00259 {
00260     return Load();
00261 }
00262
00263 bool CCJMemFile::Import(CFile *fImp)
00264 {
00265     if ((fImp == NULL) || (fImp->m_hFile == NULL))
00266         return false;
00267
00268     DWORD dwLength = 1024;
00269     BYTE *pData = new BYTE[dwLength];
00270     if (pData == NULL)
00271         return false;
00272     SeekToBegin();
00273     SetLength(0);
00274     fImp->SeekToBegin();
00275     while (fImp->GetPosition() < fImp->GetLength())
00276     {
00277         DWORD dwRead = fImp->Read(pData,dwLength);
00278         Write(pData,dwRead);
00279     }
00280
00281     delete pData;
00282     return true;
00283 }
00284
00285 bool CCJMemFile::Append(CFile *fApp)
00286 {
00287     if ((fApp == NULL) || (fApp->m_hFile == NULL))
00288         return false;
00289
00290     DWORD dwLength = 1024;
00291     BYTE *pData = new BYTE[dwLength];
00292     if (pData == NULL)
00293         return false;
00294     SeekToEnd();
00295     fApp->SeekToBegin();
00296     while (fApp->GetPosition() < fApp->GetLength())
00297     {
00298         DWORD dwRead = fApp->Read(pData,dwLength);
00299         Write(pData,dwRead);
00300     }
00301
00302     delete pData;
00303     return true;
00304 }
00305
00306 DWORD CCJMemFile::Insert(CFile *fSrc, DWORD dwSourcePos, DWORD dwDestPos, DWORD dwBytes)
00307 {
00308     if (dwBytes == 0)
00309         return 0;
00310
00311     CCJMemFile fPreIns;
00312     CCJMemFile fIns;
00313     CCJMemFile fPostIns;
00314     CCJMemFile fComplete;
00315
00316     Extract(&fPreIns,0,dwDestPos); // Extract Data BEFORE insertion point
00317     Extract(&fPostIns,dwDestPos,GetLength() - dwDestPos); // Extract Data AFTER intertion point
00318
00319     // Extract the "to be inserted" Data from the (fSrc) Source file
00320     {
00321         DWORD dwLength = 1024;
00322         DWORD dwCounter = 0;
00323         BYTE *pData = new BYTE[dwLength];
00324         if (pData == NULL)
00325             return 0;
00326         fSrc->Seek(dwSourcePos,begin);
00327
00328         while (((fSrc->GetPosition() - dwSourcePos) < dwBytes) && (fSrc->GetPosition() < fSrc->GetLength()) )
00329         {
00330             DWORD dwRead = fSrc->Read(pData,dwLength);
00331             if (dwCounter + dwRead > dwSourcePos + dwBytes)
00332                 dwRead = dwBytes - dwCounter;
00333             fIns.Write(pData,dwRead);
00334             dwCounter += dwRead;
00335         }
00336         delete pData;
00337     } // Finished Extraction
00338
00339
00340     fComplete += &fPreIns; // Append BEFORE Data
00341     fComplete += &fIns; // Append the "to be inserted" Data
00342     fComplete += &fPostIns;  // Append the AFTER Data
00343
00344     *this = &fComplete; // Copy completed File
00345
00346     return fIns.GetLength();
00347 }
00348
00349 DWORD CCJMemFile::Insert(CString strSrc, DWORD dwSourcePos, DWORD dwDestPos, DWORD dwBytes)
00350 {
00351     CFile file(strSrc,CFile::modeRead);
00352     DWORD dwResult = Insert(&file, dwSourcePos, dwDestPos, dwBytes);
00353     file.Close();
00354     return dwResult;
00355 }
00356
00357 DWORD CCJMemFile::Extract(CFile *fDest, DWORD dwStartPos, DWORD dwBytes)
00358 {
00359     if (dwBytes == 0)
00360         return 0;
00361     DWORD dwPos = GetPosition();
00362     DWORD dwLength = 1024;
00363     DWORD dwCounter = 0;
00364     BYTE *pData = new BYTE[dwLength];
00365     if (pData == NULL)
00366         return 0;
00367     Seek(dwStartPos,begin);
00368
00369     while (((GetPosition() - dwStartPos) < dwBytes) && (GetPosition() < GetLength()) )
00370     {
00371         DWORD dwRead = Read(pData,dwLength);
00372         if (dwCounter + dwRead > dwStartPos + dwBytes)
00373             dwRead = dwBytes - dwCounter;
00374         fDest->Write(pData,dwRead);
00375         dwCounter += dwRead;
00376     }
00377     Seek(dwPos,begin);
00378     delete pData;
00379     fDest->Flush();
00380     return dwCounter;
00381
00382 }
00383
00384 DWORD CCJMemFile::Extract(CString strDest, DWORD dwStartPos, DWORD dwBytes)
00385 {
00386     CFile file(strDest,CFile::modeCreate | CFile::modeWrite);
00387     DWORD dwResult = Extract(&file,dwStartPos,dwBytes);
00388     file.Close();
00389     return dwResult;
00390 }
00391
00392 // Overloaded Operators
00393
00394 void CCJMemFile::operator =(CFile *fDup)
00395 {
00396     Import(fDup);
00397 }
00398
00399 void CCJMemFile::operator =(CString strDup)
00400 {
00401     CFile file;
00402     if (file.Open(strDup,CFile::modeRead))
00403     {
00404         Import(&file);
00405         file.Close();
00406     }
00407 }
00408
00409 void CCJMemFile::operator =(DWORD dwFilePos)
00410 {
00411     Seek(dwFilePos,begin);
00412 }
00413
00414
00415 void CCJMemFile::operator +=(CFile *fApp)
00416 {
00417     Append(fApp);
00418 }
00419
00420 void CCJMemFile::operator +=(CString strApp)
00421 {
00422     CFile file;
00423     if (file.Open(strApp,CFile::modeRead))
00424     {
00425         Append(&file);
00426         file.Close();
00427     }
00428 }
00429
00430 // Indexing Operators
00431
00432 BYTE CCJMemFile::operator [](DWORD dwFilePos)
00433 {
00434     if (dwFilePos > GetLength() -1)
00435         return 0;
00436
00437     BYTE bTemp;
00438     Seek(dwFilePos,begin);
00439     Read(&bTemp,sizeof(BYTE));
00440     return bTemp;
00441 }
00442
00443 LONG CCJMemFile::FindData(void* pData, DWORD dwDataLen, LONG lStartPos)
00444 {
00445     BYTE* pBytes = (BYTE*)pData;
00446
00447
00448     Seek(lStartPos,begin);
00449
00450     bool bFoundAll = false;
00451     LONG lPos = -1;
00452
00453     while ((!bFoundAll) && (GetPosition() < GetLength()))
00454     {
00455         bool bFoundFirst = false;
00456
00457         while ((!bFoundFirst) && (GetPosition() < GetLength()))
00458         {
00459             lPos = GetPosition();
00460             BYTE read;
00461             Read(&read,1);
00462             if (read != pBytes[0])
00463                 continue;
00464
00465             bFoundFirst = true;
00466             break;
00467         }
00468
00469         //Hier Die Restlichen Bytes (dwDataLen -1) vergleichen
00470
00471         DWORD i = 1;
00472         bool bFound = true;
00473
00474         while ((i < dwDataLen) && (GetPosition() < GetLength()) && bFoundFirst)
00475         {
00476             BYTE read;
00477             Read(&read,1);
00478             if (read == pBytes[i++])
00479                 continue;
00480
00481             bFound = false;
00482             Seek(lPos+1,begin);
00483             break;
00484         }
00485
00486         bFoundAll = bFound && bFoundFirst;
00487     }
00488
00489     lPos = bFoundAll ? lPos : -1;
00490 //  while (bFound && (iPos < strSeek.GetLength())
00491 //  {
00492 //  }
00493     return lPos;
00494 }
Generated on Sun Feb 24 01:21:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJMenu.cpp Source File

WinCvs/CJLib/CJLibrary/CJMenu.cpp

Go to the documentation of this file.
00001 //*************************************************************************
00002 // CCJMenu.cpp : implementation file
00003 // Version : 2.5
00004 // Date : October 18, 1999
00005 // Author : Brent Corkum
00006 //
00007 // Portions of code supplied by:
00008 // Ben Ashley,Girish Bharadwaj,Jean-Edouard Lachand-Robert,
00009 // Robert Edward Caldecott,Kenny Goers,Leonardo Zide,
00010 // Stefan Kuhr, Reiner Jung
00011 //
00012 // Bug Fixes:
00013 // Stefan Kuhr,Martin Vladic,Kim Yoo Chul
00014 //
00015 // You are free to use/modify this code but leave this header intact.
00016 //
00018 /****************************************************************************
00019  *
00020  * $Date: 1999/11/30 21:45:49 $
00021  * $Revision: 1.1.1.3 $
00022  * $Archive: /CodeJock/CJLibrary/CJMenu.cpp $
00023  *
00024  * $History: CJMenu.cpp $
00025  *
00026  * *****************  Version 6  *****************
00027  * User: Kirk Stowell Date: 10/24/99   Time: 2:09a
00028  * Updated in $/CodeJock/CJLibrary
00029  * Upgraded to version 2.5 of BCMenu
00030  *
00031  * *****************  Version 5  *****************
00032  * User: Kirk Stowell Date: 10/14/99   Time: 12:41p
00033  * Updated in $/CodeJock/CJLibrary
00034  * Added source control history to file header.
00035  *
00036  ***************************************************************************/
00038
00039 #include "stdafx.h"        // Standard windows header file
00040 #include "CJMenu.h"        // CCJMenu class declaration
00041 #include <afxpriv.h>       //SK: makes A2W and other spiffy AFX macros work
00042
00043 #ifdef _DEBUG
00044 #define new DEBUG_NEW
00045 #undef THIS_FILE
00046 static char THIS_FILE[] = __FILE__;
00047 #endif
00048
00049 #define GAP 1
00050 #ifndef OBM_CHECK
00051 #define OBM_CHECK 32760 // from winuser.h
00052 #endif
00053
00054 #if _MFC_VER <0x400
00055 #error This code does not work on Versions of MFC prior to 4.0
00056 #endif
00057
00058 static CPINFO CPInfo;
00059
00060 enum Win32Type{
00061     Win32s,
00062     Windoze95,
00063     WinNT3,
00064     WinNT4orHigher
00065 };
00066
00067
00068 Win32Type IsShellType()
00069 {
00070     Win32Type  ShellType;
00071     DWORD winVer;
00072     OSVERSIONINFO *osvi;
00073
00074     winVer=GetVersion();
00075     if(winVer<0x80000000){/*NT */
00076         ShellType=WinNT3;
00077         osvi= (OSVERSIONINFO *)malloc(sizeof(OSVERSIONINFO));
00078         if (osvi!=NULL){
00079             memset(osvi,0,sizeof(OSVERSIONINFO));
00080             osvi->dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
00081             GetVersionEx(osvi);
00082             if (osvi->dwMajorVersion>=4L)
00083                 ShellType=WinNT4orHigher;//yup, it is NT 4 or higher!
00084             free(osvi);
00085         }
00086     }
00087     else if  (LOBYTE(LOWORD(winVer))<4)
00088         ShellType=Win32s;/*Win32s*/
00089     else
00090         ShellType=Windoze95;/*Windoze95*/
00091     return ShellType;
00092 }
00093
00094 static Win32Type g_Shell=IsShellType();
00095
00096 void CCJMenuData::SetAnsiString(LPCSTR szAnsiString)
00097 {
00098     USES_CONVERSION;
00099     SetWideString(A2W(szAnsiString));  //SK:  see MFC Tech Note 059
00100 }
00101
00102 CString CCJMenuData::GetString(void)//returns the menu text in ANSI or UNICODE
00103 //depending on the MFC-Version we are using
00104 {
00105     CString strText;
00106     if (m_szMenuText)
00107     {
00108 #ifdef UNICODE
00109         strText = m_szMenuText;
00110 #else
00111         USES_CONVERSION;
00112         strText=W2A(m_szMenuText);     //SK:  see MFC Tech Note 059
00113 #endif
00114     }
00115     return strText;
00116 }
00117
00118 CTypedPtrArray<CPtrArray, HMENU> CCJMenu::m_AllSubMenus;  // Stores list of all sub-menus
00119
00120 /*===============================================================================
00121  CCJMenu::CCJMenu()
00122  TCMeny::~CCJMenu()
00123  -----------------
00124
00125  Constructor and Destructor.
00126 ===============================================================================*/
00127
00128 CCJMenu::CCJMenu()
00129 {
00130     disable_old_style=FALSE;
00131     m_iconX = 16;            // Icon sizes default to 16 x 16
00132     m_iconY = 15;            // ...
00133     m_selectcheck = -1;
00134     m_unselectcheck = -1;
00135     checkmaps=NULL;
00136     checkmapsshare=FALSE;
00137     // set the color used for the transparent background in all bitmaps
00138     m_bitmapBackground=RGB(192,192,192); //gray
00139     m_bitmapBackgroundFlag=FALSE;
00140     GetCPInfo(CP_ACP,&CPInfo);
00141 }
00142
00143
00144 CCJMenu::~CCJMenu()
00145 {
00146     DestroyMenu();
00147 }
00148
00149 BOOL CCJMenu::IsNewShell ()
00150 {
00151     return (Windoze95==g_Shell || WinNT4orHigher==g_Shell);
00152 }
00153
00154
00155 CCJMenuData::~CCJMenuData()
00156 {
00157     if(bitmap)
00158         delete(bitmap);
00159
00160     delete[] m_szMenuText; //Need not check for NULL because ANSI X3J16 allows "delete NULL"
00161 }
00162
00163
00164 void CCJMenuData::SetWideString(const wchar_t *szWideString)
00165 {
00166     delete[] m_szMenuText;//Need not check for NULL because ANSI X3J16 allows "delete NULL"
00167
00168     if (szWideString)
00169     {
00170         m_szMenuText = new wchar_t[sizeof(wchar_t)*(wcslen(szWideString)+1)];
00171         if (m_szMenuText)
00172             wcscpy(m_szMenuText,szWideString);
00173     }
00174     else
00175         m_szMenuText=NULL;//set to NULL so we need not bother about dangling non-NULL Ptrs
00176 }
00177
00178 BOOL CCJMenu::IsMenu(CMenu *submenu)
00179 {
00180     int m;
00181     int numSubMenus = m_AllSubMenus.GetUpperBound();
00182     for(m=0;m<=numSubMenus;++m){
00183         if(submenu->m_hMenu==m_AllSubMenus[m])return(TRUE);
00184     }
00185     return(FALSE);
00186 }
00187
00188 BOOL CCJMenu::IsMenu(HMENU submenu)
00189 {
00190     int m;
00191     int numSubMenus = m_AllSubMenus.GetUpperBound();
00192     for(m=0;m<=numSubMenus;++m){
00193         if(submenu==m_AllSubMenus[m])return(TRUE);
00194     }
00195     return(FALSE);
00196 }
00197
00198 BOOL CCJMenu::DestroyMenu()
00199 {
00200     // Destroy Sub menus:
00201     int m,n;
00202     int numAllSubMenus = m_AllSubMenus.GetUpperBound();
00203     for(n = numAllSubMenus; n>= 0; n--){
00204         if(m_AllSubMenus[n]==this->m_hMenu)m_AllSubMenus.RemoveAt(n);
00205     }
00206     int numSubMenus = m_SubMenus.GetUpperBound();
00207     for(m = numSubMenus; m >= 0; m--){
00208         numAllSubMenus = m_AllSubMenus.GetUpperBound();
00209         for(n = numAllSubMenus; n>= 0; n--){
00210             if(m_AllSubMenus[n]==m_SubMenus[m])m_AllSubMenus.RemoveAt(n);
00211         }
00212         delete((CCJMenu *)FromHandle(m_SubMenus[m]));
00213     }
00214     m_SubMenus.RemoveAll();
00215     // Destroy menu data
00216     int numItems = m_MenuList.GetUpperBound();
00217     for(m = 0; m <= numItems; m++)delete(m_MenuList[m]);
00218     m_MenuList.RemoveAll();
00219     if(checkmaps&&!checkmapsshare){
00220         delete checkmaps;
00221         checkmaps=NULL;
00222     }
00223     // Call base-class implementation last:
00224     return(CMenu::DestroyMenu());
00225 };
00226
00227
00229 //
00230 // CCJMenu message handlers
00231
00232
00233 /*
00234 ==========================================================================
00235 void CCJMenu::DrawItem(LPDRAWITEMSTRUCT)
00236 ---------------------------------------
00237
00238   Called by the framework when a particular item needs to be drawn.  We
00239   overide this to draw the menu item in a custom-fashion, including icons
00240   and the 3D rectangle bar.
00241   ==========================================================================
00242 */
00243
00244
00245 void CCJMenu::DrawItem (LPDRAWITEMSTRUCT lpDIS)
00246 {
00247     ASSERT(lpDIS != NULL);
00248     CDC* pDC = CDC::FromHandle(lpDIS->hDC);
00249     CRect rect;
00250     UINT state = (((CCJMenuData*)(lpDIS->itemData))->nFlags);
00251     if(state & MF_SEPARATOR){
00252         rect.CopyRect(&lpDIS->rcItem);
00253         rect.top+=rect.Height()>>1;
00254         pDC->DrawEdge(&rect,EDGE_ETCHED,BF_TOP);
00255     }
00256     else{
00257         CRect rect2;
00258         BOOL standardflag=FALSE,selectedflag=FALSE,disableflag=FALSE;
00259         BOOL checkflag=FALSE;
00260         COLORREF crText = GetSysColor(COLOR_MENUTEXT);
00261         COLORREF m_clrBack=GetSysColor(COLOR_MENU);
00262         CBrush m_brBackground,m_brSelect;
00263         CPen m_penBack;
00264         int x0,y0,dy;
00265         int nIconNormal=-1,xoffset=-1;
00266         CImageList *bitmap=NULL;
00267         CFont m_fontMenu;
00268         LOGFONT m_lf;
00269
00270         // set some colors and the font
00271         m_penBack.CreatePen (PS_SOLID,0,GetSysColor(COLOR_MENU));
00272         m_brBackground.CreateSolidBrush(GetSysColor(COLOR_MENU));
00273         m_brSelect.CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT));
00274         ZeroMemory ((PVOID) &m_lf,sizeof (LOGFONT));
00275         NONCLIENTMETRICS nm;
00276         nm.cbSize = sizeof (NONCLIENTMETRICS);
00277         VERIFY (SystemParametersInfo(SPI_GETNONCLIENTMETRICS,nm.cbSize,&nm,0));
00278         m_lf =  nm.lfMenuFont;
00279         m_fontMenu.CreateFontIndirect (&m_lf);
00280
00281         // draw the colored rectangle portion
00282
00283         rect.CopyRect(&lpDIS->rcItem);
00284         rect2=rect;
00285
00286         // draw the up/down/focused/disabled state
00287
00288         UINT action = lpDIS->itemAction;
00289         UINT state = lpDIS->itemState;
00290         CString strText;
00291         LOGFONT lf;
00292         lf = m_lf;
00293
00294         CFont dispFont;
00295         CFont *pFont=NULL;
00296
00297         if(lpDIS->itemData != NULL){
00298             nIconNormal = (((CCJMenuData*)(lpDIS->itemData))->menuIconNormal);
00299             xoffset = (((CCJMenuData*)(lpDIS->itemData))->xoffset);
00300             bitmap = (((CCJMenuData*)(lpDIS->itemData))->bitmap);
00301             strText = ((CCJMenuData*) (lpDIS->itemData))->GetString();
00302
00303             if(state&ODS_CHECKED && nIconNormal<0){
00304                 if(state&ODS_SELECTED && m_selectcheck>0)checkflag=TRUE;
00305                 else if(m_unselectcheck>0) checkflag=TRUE;
00306             }
00307             else if(nIconNormal != -1){
00308                 standardflag=TRUE;
00309                 if(state&ODS_SELECTED && !(state&ODS_GRAYED))selectedflag=TRUE;
00310                 else if(state&ODS_GRAYED) disableflag=TRUE;
00311             }
00312         }
00313         else{
00314             strText.Empty();
00315         }
00316
00317         if(state&ODS_SELECTED){ // draw the down edges
00318
00319             CPen *pOldPen = pDC->SelectObject (&m_penBack);
00320
00321             // You need only Text highlight and thats what you get
00322
00323             if(checkflag||standardflag||selectedflag||disableflag||state&ODS_CHECKED)
00324                 rect2.SetRect(rect.left+m_iconX+4+GAP,rect.top,rect.right,rect.bottom);
00325             pDC->FillRect (rect2,&m_brSelect);
00326
00327             pDC->SelectObject (pOldPen);
00328             if((HFONT)dispFont != NULL)dispFont.DeleteObject ();
00329             dispFont.CreateFontIndirect (&lf);
00330             crText = GetSysColor(COLOR_HIGHLIGHTTEXT);
00331         }
00332         else {
00333             CPen *pOldPen = pDC->SelectObject (&m_penBack);
00334             pDC->FillRect (rect,&m_brBackground);
00335             pDC->SelectObject (pOldPen);
00336
00337             // draw the up edges
00338
00339             pDC->Draw3dRect (rect,m_clrBack,m_clrBack);
00340             if ((HFONT)dispFont != NULL) dispFont.DeleteObject ();
00341             dispFont.CreateFontIndirect (&lf); //Normal
00342         }
00343
00344         // draw the text if there is any
00345         //We have to paint the text only if the image is nonexistant
00346
00347         dy = (rect.Height()-4-m_iconY)/2;
00348         dy = dy<0 ? 0 : dy;
00349
00350         if(checkflag||standardflag||selectedflag||disableflag){
00351             rect2.SetRect(rect.left+1,rect.top+1+dy,rect.left+m_iconX+3,
00352                 rect.top+m_iconY+3+dy);
00353             pDC->Draw3dRect (rect2,m_clrBack,m_clrBack);
00354             if(checkflag && checkmaps){
00355                 pDC->FillRect (rect2,&m_brBackground);
00356                 rect2.SetRect(rect.left,rect.top+dy,rect.left+m_iconX+4,
00357                     rect.top+m_iconY+4+dy);
00358
00359                 pDC->Draw3dRect (rect2,m_clrBack,m_clrBack);
00360                 CPoint ptImage(rect.left+2,rect.top+2+dy);
00361
00362                 if(state&ODS_SELECTED)checkmaps->Draw(pDC,1,ptImage,ILD_TRANSPARENT);
00363                 else checkmaps->Draw(pDC,0,ptImage,ILD_TRANSPARENT);
00364             }
00365             else if(disableflag){
00366                 if(!selectedflag){
00367                     CBitmap bitmapstandard;
00368                     GetBitmapFromImageList(pDC,bitmap,xoffset,bitmapstandard);
00369                     rect2.SetRect(rect.left,rect.top+dy,rect.left+m_iconX+4,
00370                         rect.top+m_iconY+4+dy);
00371                     pDC->Draw3dRect (rect2,m_clrBack,m_clrBack);
00372                     if(disable_old_style)
00373                         DitherBlt(lpDIS->hDC,rect.left+2,rect.top+2+dy,m_iconX,m_iconY,
00374                         (HBITMAP)(bitmapstandard),0,0);
00375                     else
00376                         DitherBlt2(pDC,rect.left+2,rect.top+2+dy,m_iconX,m_iconY,
00377                         bitmapstandard,0,0);
00378                     bitmapstandard.DeleteObject();
00379                 }
00380             }
00381             else if(selectedflag){
00382                 pDC->FillRect (rect2,&m_brBackground);
00383                 rect2.SetRect(rect.left,rect.top+dy,rect.left+m_iconX+4,
00384                     rect.top+m_iconY+4+dy);
00385                 if (IsNewShell()){
00386                     if(state&ODS_CHECKED)
00387                         pDC->Draw3dRect(rect2,GetSysColor(COLOR_3DSHADOW),
00388                         GetSysColor(COLOR_3DHILIGHT));
00389                     else
00390                         pDC->Draw3dRect(rect2,GetSysColor(COLOR_3DHILIGHT),
00391                         GetSysColor(COLOR_3DSHADOW));
00392                 }
00393                 CPoint ptImage(rect.left+2,rect.top+2+dy);
00394                 if(bitmap)bitmap->Draw(pDC,xoffset,ptImage,ILD_TRANSPARENT);
00395             }
00396             else{
00397                 if(state&ODS_CHECKED){
00398                     CBrush brush;
00399                     COLORREF col =GetSysColor(COLOR_3DLIGHT);
00400                     brush.CreateSolidBrush(col);
00401                     pDC->FillRect(rect2,&brush);
00402                     brush.DeleteObject();
00403                     rect2.SetRect(rect.left,rect.top+dy,rect.left+m_iconX+4,
00404                         rect.top+m_iconY+4+dy);
00405                     if (IsNewShell())
00406                         pDC->Draw3dRect(rect2,GetSysColor(COLOR_3DSHADOW),
00407                         GetSysColor(COLOR_3DHILIGHT));
00408                 }
00409                 else{
00410                     pDC->FillRect (rect2,&m_brBackground);
00411                     rect2.SetRect(rect.left,rect.top+dy,rect.left+m_iconX+4,
00412                         rect.top+m_iconY+4+dy);
00413                     pDC->Draw3dRect (rect2,m_clrBack,m_clrBack);
00414                 }
00415                 CPoint ptImage(rect.left+2,rect.top+2+dy);
00416                 if(bitmap)bitmap->Draw(pDC,xoffset,ptImage,ILD_TRANSPARENT);
00417             }
00418         }
00419         if(nIconNormal<0 && state&ODS_CHECKED && !checkflag){
00420             rect2.SetRect(rect.left+1,rect.top+2+dy,rect.left+m_iconX+1,
00421                 rect.top+m_iconY+2+dy);
00422             CMenuItemInfo info;
00423             info.fMask = MIIM_CHECKMARKS;
00424             ::GetMenuItemInfo((HMENU)lpDIS->hwndItem,lpDIS->itemID,
00425                 MF_BYCOMMAND, &info);
00426             if(state&ODS_CHECKED || info.hbmpUnchecked) {
00427                 Draw3DCheckmark(pDC, rect2, state&ODS_SELECTED,
00428                     state&ODS_CHECKED ? info.hbmpChecked :
00429                 info.hbmpUnchecked);
00430             }
00431         }
00432
00433         //This is needed always so that we can have the space for check marks
00434
00435         x0=rect.left;y0=rect.top;
00436         rect.left = rect.left + m_iconX + 8 + GAP;
00437
00438         if(!strText.IsEmpty()){
00439
00440             CRect rectt(rect.left,rect.top-1,rect.right,rect.bottom-1);
00441
00442             //   Find tabs
00443
00444             CString leftStr,rightStr;
00445             leftStr.Empty();rightStr.Empty();
00446             int tablocr=strText.ReverseFind(_T('\t'));
00447             if(tablocr!=-1){
00448                 rightStr=strText.Mid(tablocr+1);
00449                 leftStr=strText.Left(strText.Find(_T('\t')));
00450                 rectt.right-=m_iconX;
00451             }
00452             else leftStr=strText;
00453
00454             int iOldMode = pDC->GetBkMode();
00455             pDC->SetBkMode( TRANSPARENT);
00456
00457             // Draw the text in the correct colour:
00458
00459             UINT nFormat  = DT_LEFT|DT_SINGLELINE|DT_VCENTER;
00460             UINT nFormatr = DT_RIGHT|DT_SINGLELINE|DT_VCENTER;
00461             if(!(lpDIS->itemState & ODS_GRAYED)){
00462                 pDC->SetTextColor(crText);
00463                 pDC->DrawText (leftStr,rectt,nFormat);
00464                 if(tablocr!=-1) pDC->DrawText (rightStr,rectt,nFormatr);
00465             }
00466             else{
00467
00468                 // Draw the disabled text
00469                 if(!(state & ODS_SELECTED)){
00470                     RECT offset = *rectt;
00471                     offset.left+=1;
00472                     offset.right+=1;
00473                     offset.top+=1;
00474                     offset.bottom+=1;
00475                     pDC->SetTextColor(GetSysColor(COLOR_BTNHILIGHT));
00476                     pDC->DrawText(leftStr,&offset, nFormat);
00477                     if(tablocr!=-1) pDC->DrawText (rightStr,&offset,nFormatr);
00478                     pDC->SetTextColor(GetSysColor(COLOR_GRAYTEXT));
00479                     pDC->DrawText(leftStr,rectt, nFormat);
00480                     if(tablocr!=-1) pDC->DrawText (rightStr,rectt,nFormatr);
00481                 }
00482                 else{
00483                     // And the standard Grey text:
00484                     pDC->SetTextColor(m_clrBack);
00485                     pDC->DrawText(leftStr,rectt, nFormat);
00486                     if(tablocr!=-1) pDC->DrawText (rightStr,rectt,nFormatr);
00487                 }
00488             }
00489             pFont = pDC->SelectObject (&dispFont);
00490             pDC->SetBkMode( iOldMode );
00491             pDC->SelectObject (pFont); //set it to the old font
00492         }
00493
00494         m_penBack.DeleteObject();
00495         m_brBackground.DeleteObject();
00496         m_fontMenu.DeleteObject();
00497         m_brSelect.DeleteObject();
00498         dispFont.DeleteObject ();
00499   }
00500 }
00501
00502 BOOL CCJMenu::GetBitmapFromImageList(CDC* pDC,CImageList *imglist,int nIndex,CBitmap &bmp)
00503 {
00504     HICON hIcon = imglist->ExtractIcon(nIndex);
00505     CDC dc;
00506     dc.CreateCompatibleDC(pDC);
00507     bmp.CreateCompatibleBitmap(pDC,m_iconX,m_iconY);
00508     CBitmap* pOldBmp = dc.SelectObject(&bmp);
00509     CBrush brush ;
00510     brush.CreateSolidBrush(GetSysColor(COLOR_MENU));
00511     ::DrawIconEx(
00512         dc.GetSafeHdc(),
00513         0,
00514         0,
00515         hIcon,
00516         m_iconX,
00517         m_iconY,
00518         0,
00519         (HBRUSH)brush,
00520         DI_NORMAL
00521         );
00522     dc.SelectObject( pOldBmp );
00523     dc.DeleteDC();
00524     // the icon is not longer needed
00525     DestroyIcon(hIcon);
00526     return(TRUE);
00527 }
00528
00529 /*
00530 ==========================================================================
00531 void CCJMenu::MeasureItem(LPMEASUREITEMSTRUCT)
00532 ---------------------------------------------
00533
00534   Called by the framework when it wants to know what the width and height
00535   of our item will be.  To accomplish this we provide the width of the
00536   icon plus the width of the menu text, and then the height of the icon.
00537
00538 ==========================================================================
00539 */
00540
00541 void CCJMenu::MeasureItem( LPMEASUREITEMSTRUCT lpMIS )
00542 {
00543     UINT state = (((CCJMenuData*)(lpMIS->itemData))->nFlags);
00544     if(state & MF_SEPARATOR){
00545         lpMIS->itemWidth = 0;
00546         lpMIS->itemHeight = GetSystemMetrics(SM_CYMENU)>>1;
00547     }
00548     else{
00549         CFont m_fontMenu;
00550         LOGFONT m_lf;
00551         ZeroMemory ((PVOID) &m_lf,sizeof (LOGFONT));
00552         NONCLIENTMETRICS nm;
00553         nm.cbSize = sizeof (NONCLIENTMETRICS);
00554         VERIFY(SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
00555             nm.cbSize,&nm,0));
00556         m_lf =  nm.lfMenuFont;
00557         m_fontMenu.CreateFontIndirect (&m_lf);
00558
00559         // Obtain the width of the text:
00560         CWnd *pWnd = AfxGetMainWnd();            // Get main window
00561         CDC *pDC = pWnd->GetDC();              // Get device context
00562         CFont* pFont=NULL;    // Select menu font in...
00563
00564         if (IsNewShell())
00565             pFont = pDC->SelectObject (&m_fontMenu);// Select menu font in...
00566
00567         //Get pointer to text SK
00568         const wchar_t *lpstrText = ((CCJMenuData*)(lpMIS->itemData))->GetWideString();//SK: we use const to prevent misuse
00569
00570
00571         SIZE size;
00572
00573         if (Win32s!=g_Shell)
00574             VERIFY(::GetTextExtentPoint32W(pDC->m_hDC,lpstrText,
00575             wcslen(lpstrText),&size)); //SK should also work on 95
00576 #ifndef UNICODE //can't be UNICODE for Win32s
00577         else{//it's Win32suckx
00578             RECT rect;
00579             rect.left=rect.top=0;
00580             size.cy=DrawText(pDC->m_hDC,(LPCTSTR)lpstrText,
00581                 wcslen(lpstrText),&rect,
00582                 DT_SINGLELINE|DT_LEFT|DT_VCENTER|DT_CALCRECT);
00583             //+3 makes at least three pixels space to the menu border
00584             size.cx=rect.right-rect.left+3;
00585             size.cx += 3*(size.cx/wcslen(lpstrText));
00586         }
00587 #endif
00588
00589         CSize t = CSize(size);
00590         if(IsNewShell())
00591             pDC->SelectObject (pFont);  // Select old font in
00592         AfxGetMainWnd()->ReleaseDC(pDC);  // Release the DC
00593
00594         // Set width and height:
00595
00596         lpMIS->itemWidth = m_iconX + t.cx + m_iconX + GAP;
00597         int temp = GetSystemMetrics(SM_CYMENU);
00598         lpMIS->itemHeight = temp>m_iconY+4 ? temp : m_iconY+4;
00599         m_fontMenu.DeleteObject();
00600     }
00601 }
00602
00603 void CCJMenu::SetIconSize (int width, int height)
00604 {
00605     m_iconX = width;
00606     m_iconY = height;
00607 }
00608
00609 BOOL CCJMenu::AppendODMenuA(LPCSTR lpstrText,UINT nFlags,UINT nID,
00610                             int nIconNormal)
00611 {
00612     USES_CONVERSION;
00613     return AppendODMenuW(A2W(lpstrText),nFlags,nID,nIconNormal);//SK: See MFC Tech Note 059
00614 }
00615
00616
00617 BOOL CCJMenu::AppendODMenuW(wchar_t *lpstrText,UINT nFlags,UINT nID,
00618                             int nIconNormal)
00619 {
00620     // Add the MF_OWNERDRAW flag if not specified:
00621     if(!nID)nFlags=MF_SEPARATOR|MF_OWNERDRAW;
00622     else if(!(nFlags & MF_OWNERDRAW))nFlags |= MF_OWNERDRAW;
00623
00624     if(nFlags & MF_POPUP){
00625         m_AllSubMenus.Add((HMENU)nID);
00626         m_SubMenus.Add((HMENU)nID);
00627     }
00628
00629     CCJMenuData *mdata = new CCJMenuData;
00630     m_MenuList.Add(mdata);
00631     mdata->SetWideString(lpstrText);    //SK: modified for dynamic allocation
00632
00633     mdata->menuIconNormal = nIconNormal;
00634     mdata->xoffset=-1;
00635     if(nIconNormal>=0){
00636         mdata->xoffset=0;
00637         LoadFromToolBar(nID,nIconNormal,mdata->xoffset);
00638         if(mdata->bitmap)mdata->bitmap->DeleteImageList();
00639         else mdata->bitmap=new(CImageList);
00640         mdata->bitmap->Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1);
00641         if(!AddBitmapToImageList(mdata->bitmap,nIconNormal)){
00642             mdata->bitmap->DeleteImageList();
00643             delete mdata->bitmap;
00644             mdata->bitmap=NULL;
00645             mdata->menuIconNormal = nIconNormal = -1;
00646             mdata->xoffset = -1;
00647         }
00648     }
00649     mdata->nFlags = nFlags;
00650     mdata->nID = nID;
00651     return(CMenu::AppendMenu(nFlags, nID, (LPCTSTR)mdata));
00652 }
00653
00654 BOOL CCJMenu::AppendODMenuA(LPCSTR lpstrText,UINT nFlags,UINT nID,
00655                             CImageList *il,int xoffset)
00656 {
00657     USES_CONVERSION;
00658     return AppendODMenuW(A2W(lpstrText),nFlags,nID,il,xoffset);
00659 }
00660
00661 BOOL CCJMenu::AppendODMenuW(wchar_t *lpstrText,UINT nFlags,UINT nID,
00662                             CImageList *il,int xoffset)
00663 {
00664     // Add the MF_OWNERDRAW flag if not specified:
00665     if(!nID)nFlags=MF_SEPARATOR|MF_OWNERDRAW;
00666     else if(!(nFlags & MF_OWNERDRAW))nFlags |= MF_OWNERDRAW;
00667
00668     if(nFlags & MF_POPUP){
00669         m_AllSubMenus.Add((HMENU)nID);
00670         m_SubMenus.Add((HMENU)nID);
00671     }
00672
00673     CCJMenuData *mdata = new CCJMenuData;
00674     m_MenuList.Add(mdata);
00675     mdata->SetWideString(lpstrText);    //SK: modified for dynamic allocation
00676
00677     if(il){
00678         mdata->menuIconNormal = 0;
00679         mdata->xoffset=xoffset;
00680         if(mdata->bitmap)mdata->bitmap->Detach();
00681         else mdata->bitmap=new(CImageList);
00682         mdata->bitmap->Attach(ImageList_Duplicate(il->m_hImageList));
00683     }
00684     else{
00685         mdata->menuIconNormal = -1;
00686         mdata->xoffset = -1;
00687     }
00688     mdata->nFlags = nFlags;
00689     mdata->nID = nID;
00690     return(CMenu::AppendMenu(nFlags, nID, (LPCTSTR)mdata));
00691 }
00692
00693 BOOL CCJMenu::InsertODMenuA(UINT nPosition,LPCSTR lpstrText,UINT nFlags,UINT nID,
00694                             int nIconNormal)
00695 {
00696     USES_CONVERSION;
00697     return InsertODMenuW(nPosition,A2W(lpstrText),nFlags,nID,nIconNormal);
00698 }
00699
00700
00701 BOOL CCJMenu::InsertODMenuW(UINT nPosition,wchar_t *lpstrText,UINT nFlags,UINT nID,
00702                             int nIconNormal)
00703 {
00704     // Add the MF_OWNERDRAW flag if not specified:
00705     if(!nID)nFlags=MF_SEPARATOR|MF_OWNERDRAW;
00706     else if(!(nFlags & MF_OWNERDRAW))nFlags |= MF_OWNERDRAW;
00707
00708     if(nFlags & MF_POPUP){
00709         m_AllSubMenus.Add((HMENU)nID);
00710         m_SubMenus.InsertAt(nPosition,(HMENU)nID);
00711     }
00712
00713     CCJMenuData *mdata = new CCJMenuData;
00714     m_MenuList.InsertAt(nPosition,mdata);
00715     mdata->SetWideString(lpstrText);    //SK: modified for dynamic allocation
00716
00717     mdata->menuIconNormal = nIconNormal;
00718     mdata->xoffset=-1;
00719     if(nIconNormal>=0){
00720         mdata->xoffset=0;
00721         LoadFromToolBar(nID,nIconNormal,mdata->xoffset);
00722         if(mdata->bitmap)mdata->bitmap->DeleteImageList();
00723         else mdata->bitmap=new(CImageList);
00724         mdata->bitmap->Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1);
00725         if(!AddBitmapToImageList(mdata->bitmap,nIconNormal)){
00726             mdata->bitmap->DeleteImageList();
00727             delete mdata->bitmap;
00728             mdata->bitmap=NULL;
00729             mdata->menuIconNormal = nIconNormal = -1;
00730             mdata->xoffset = -1;
00731         }
00732     }
00733     mdata->nFlags = nFlags;
00734     mdata->nID = nID;
00735     return(CMenu::InsertMenu(nPosition,nFlags,nID,(LPCTSTR)mdata));
00736 }
00737
00738 BOOL CCJMenu::InsertODMenuA(UINT nPosition,LPCSTR lpstrText,UINT nFlags,UINT nID,
00739                             CImageList *il,int xoffset)
00740 {
00741     USES_CONVERSION;
00742     return InsertODMenuW(nPosition,A2W(lpstrText),nFlags,nID,il,xoffset);
00743 }
00744
00745 BOOL CCJMenu::InsertODMenuW(UINT nPosition,wchar_t *lpstrText,UINT nFlags,UINT nID,
00746                             CImageList *il,int xoffset)
00747 {
00748     // Add the MF_OWNERDRAW flag if not specified:
00749     if(!nID)nFlags=MF_SEPARATOR|MF_OWNERDRAW;
00750     else if(!(nFlags & MF_OWNERDRAW))nFlags |= MF_OWNERDRAW;
00751
00752     if(nFlags & MF_POPUP){
00753         m_AllSubMenus.Add((HMENU)nID);
00754         m_SubMenus.InsertAt(nPosition,(HMENU)nID);
00755     }
00756
00757     CCJMenuData *mdata = new CCJMenuData;
00758     m_MenuList.InsertAt(nPosition,mdata);
00759     mdata->SetWideString(lpstrText);    //SK: modified for dynamic allocation
00760
00761     if(il){
00762         mdata->menuIconNormal = 0;
00763         mdata->xoffset=xoffset;
00764         if(mdata->bitmap)mdata->bitmap->Detach();
00765         else mdata->bitmap=new(CImageList);
00766         mdata->bitmap->Attach(ImageList_Duplicate(il->m_hImageList));
00767     }
00768     else{
00769         mdata->menuIconNormal = -1;
00770         mdata->xoffset = -1;
00771     }
00772     mdata->nFlags = nFlags;
00773     mdata->nID = nID;
00774     return(CMenu::InsertMenu(nPosition,nFlags,nID,(LPCTSTR)mdata));
00775 }
00776
00777 BOOL CCJMenu::ModifyODMenuA(const char * lpstrText,UINT nID,int nIconNormal)
00778 {
00779     USES_CONVERSION;
00780     return ModifyODMenuW(A2W(lpstrText),nID,nIconNormal);//SK: see MFC Tech Note 059
00781 }
00782
00783 BOOL CCJMenu::ModifyODMenuW(wchar_t *lpstrText,UINT nID,int nIconNormal)
00784 {
00785     int nLoc;
00786     CCJMenuData *mdata;
00787
00788     // Find the old CCJMenuData structure:
00789     CCJMenu *psubmenu = FindMenuOption(nID,nLoc);
00790     if(psubmenu && nLoc>=0)mdata = psubmenu->m_MenuList[nLoc];
00791     else{
00792         // Create a new CCJMenuData structure:
00793         mdata = new CCJMenuData;
00794         m_MenuList.Add(mdata);
00795     }
00796
00797     ASSERT(mdata);
00798     if(lpstrText)
00799         mdata->SetWideString(lpstrText);  //SK: modified for dynamic allocation
00800     mdata->menuIconNormal = nIconNormal;
00801     mdata->xoffset=-1;
00802     if(nIconNormal>=0){
00803         mdata->xoffset=0;
00804         LoadFromToolBar(nID,nIconNormal,mdata->xoffset);
00805         if(mdata->bitmap)mdata->bitmap->DeleteImageList();
00806         else mdata->bitmap=new CImageList;
00807         mdata->bitmap->Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1);
00808         if(!AddBitmapToImageList(mdata->bitmap,nIconNormal)){
00809             mdata->bitmap->DeleteImageList();
00810             delete mdata->bitmap;
00811             mdata->bitmap=NULL;
00812             mdata->menuIconNormal = nIconNormal = -1;
00813             mdata->xoffset = -1;
00814         }
00815     }
00816     mdata->nFlags = MF_BYCOMMAND | MF_OWNERDRAW;
00817     mdata->nID = nID;
00818     return (CMenu::ModifyMenu(nID,mdata->nFlags,nID,(LPCTSTR)mdata));
00819 }
00820
00821 BOOL CCJMenu::ModifyODMenuA(const char * lpstrText,UINT nID,CImageList *il,int xoffset)
00822 {
00823     USES_CONVERSION;
00824     return ModifyODMenuW(A2W(lpstrText),nID,il,xoffset);
00825 }
00826
00827 BOOL CCJMenu::ModifyODMenuW(wchar_t *lpstrText,UINT nID,CImageList *il,int xoffset)
00828 {
00829     int nLoc;
00830     CCJMenuData *mdata;
00831
00832     // Find the old CCJMenuData structure:
00833     CCJMenu *psubmenu = FindMenuOption(nID,nLoc);
00834     if(psubmenu && nLoc>=0)mdata = psubmenu->m_MenuList[nLoc];
00835     else{
00836         // Create a new CCJMenuData structure:
00837         mdata = new CCJMenuData;
00838         m_MenuList.Add(mdata);
00839     }
00840
00841     ASSERT(mdata);
00842     if(lpstrText)
00843         mdata->SetWideString(lpstrText);  //SK: modified for dynamic allocation
00844     if(il){
00845         mdata->menuIconNormal = 0;
00846         mdata->xoffset=xoffset;
00847         if(mdata->bitmap)mdata->bitmap->Detach();
00848         else mdata->bitmap=new(CImageList);
00849         mdata->bitmap->Attach(ImageList_Duplicate(il->m_hImageList));
00850     }
00851     else{
00852         mdata->menuIconNormal = -1;
00853         mdata->xoffset = -1;
00854     }
00855     mdata->nFlags = MF_BYCOMMAND | MF_OWNERDRAW;
00856     mdata->nID = nID;
00857     return (CMenu::ModifyMenu(nID,mdata->nFlags,nID,(LPCTSTR)mdata));
00858 }
00859
00860 BOOL CCJMenu::ModifyODMenuA(const char * lpstrText,UINT nID,CBitmap *bmp)
00861 {
00862     USES_CONVERSION;
00863     return ModifyODMenuW(A2W(lpstrText),nID,bmp);
00864 }
00865
00866 BOOL CCJMenu::ModifyODMenuW(wchar_t *lpstrText,UINT nID,CBitmap *bmp)
00867 {
00868     if(bmp){
00869         CImageList temp;
00870         temp.Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1);
00871         if(m_bitmapBackgroundFlag)temp.Add(bmp,m_bitmapBackground);
00872         else temp.Add(bmp,GetSysColor(COLOR_3DFACE));
00873         return ModifyODMenuW(lpstrText,nID,&temp,0);
00874     }
00875     return ModifyODMenuW(lpstrText,nID,NULL,0);
00876 }
00877
00878
00879 BOOL CCJMenu::ModifyODMenuA(const char *lpstrText,const char *OptionText,
00880                             int nIconNormal)
00881 {
00882     USES_CONVERSION;
00883     return ModifyODMenuW(A2W(lpstrText),A2W(OptionText),nIconNormal);//SK: see MFC  Tech Note 059
00884 }
00885
00886 BOOL CCJMenu::ModifyODMenuW(wchar_t *lpstrText,wchar_t *OptionText,
00887                             int nIconNormal)
00888 {
00889     CCJMenuData *mdata;
00890
00891     // Find the old CCJMenuData structure:
00892     CString junk=OptionText;
00893     mdata=FindMenuOption(OptionText);
00894     if(mdata){
00895         if(lpstrText)
00896             mdata->SetWideString(lpstrText);//SK: modified for dynamic allocation
00897         mdata->menuIconNormal = nIconNormal;
00898         mdata->xoffset=-1;
00899         if(nIconNormal>=0){
00900             mdata->xoffset=0;
00901             if(mdata->bitmap)mdata->bitmap->DeleteImageList();
00902             else mdata->bitmap=new(CImageList);
00903             mdata->bitmap->Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1);
00904             if(!AddBitmapToImageList(mdata->bitmap,nIconNormal)){
00905                 mdata->bitmap->DeleteImageList();
00906                 delete mdata->bitmap;
00907                 mdata->bitmap=NULL;
00908                 mdata->menuIconNormal = nIconNormal = -1;
00909                 mdata->xoffset = -1;
00910             }
00911         }
00912         return(TRUE);
00913     }
00914     return(FALSE);
00915 }
00916
00917 CCJMenuData *CCJMenu::NewODMenu(UINT pos,UINT nFlags,UINT nID,CString string)
00918 {
00919     CCJMenuData *mdata;
00920
00921     mdata = new CCJMenuData;
00922     mdata->menuIconNormal = -1;
00923     mdata->xoffset=-1;
00924 #ifdef UNICODE
00925     mdata->SetWideString((LPCTSTR)string);//SK: modified for dynamic allocation
00926 #else
00927     mdata->SetAnsiString(string);
00928 #endif
00929     mdata->nFlags = nFlags;
00930     mdata->nID = nID;
00931
00932     if(nFlags & MF_POPUP)m_AllSubMenus.Add((HMENU)nID);
00933
00934     if (nFlags&MF_OWNERDRAW){
00935         ASSERT(!(nFlags&MF_STRING));
00936         ModifyMenu(pos,nFlags,nID,(LPCTSTR)mdata);
00937     }
00938     else if (nFlags&MF_STRING){
00939         ASSERT(!(nFlags&MF_OWNERDRAW));
00940         ModifyMenu(pos,nFlags,nID,mdata->GetString());
00941     }
00942     else{
00943         ASSERT(nFlags&MF_SEPARATOR);
00944         ModifyMenu(pos,nFlags,nID);
00945     }
00946
00947     return(mdata);
00948 };
00949
00950 BOOL CCJMenu::LoadToolbars(const UINT *arID,int n)
00951 {
00952     ASSERT(arID);
00953     BOOL returnflag=TRUE;
00954     for(int i=0;i<n;++i){
00955         if(!LoadToolbar(arID[i]))returnflag=FALSE;
00956     }
00957     return(returnflag);
00958 }
00959
00960 BOOL CCJMenu::LoadToolbar(UINT nToolBar)
00961 {
00962     UINT nID;
00963     BOOL returnflag=FALSE;
00964     CToolBar bar;
00965
00966     bar.Create(AfxGetMainWnd());
00967     if(bar.LoadToolBar(nToolBar)){
00968         for(int i=0;i<bar.GetCount();++i){
00969             nID = bar.GetItemID(i);
00970             if(nID && GetMenuState(nID, MF_BYCOMMAND)
00971                 !=0xFFFFFFFF){
00972                 ModifyODMenu(NULL,nID,nToolBar);
00973             }
00974         }
00975         returnflag=TRUE;
00976     }
00977     return(returnflag);
00978 }
00979
00980 BOOL CCJMenu::LoadFromToolBar(UINT nID,UINT nToolBar,int& xoffset)
00981 {
00982     int xset,offset;
00983     UINT nStyle;
00984     BOOL returnflag=FALSE;
00985     CToolBar bar;
00986
00987     bar.Create(AfxGetMainWnd());
00988     if(bar.LoadToolBar(nToolBar)){
00989         offset=bar.CommandToIndex(nID);
00990         if(offset>=0){
00991             bar.GetButtonInfo(offset,nID,nStyle,xset);
00992             if(xset>0)xoffset=xset;
00993             returnflag=TRUE;
00994         }
00995     }
00996     return(returnflag);
00997 }
00998
00999 CCJMenu *CCJMenu::FindMenuOption(int nId,int& nLoc)
01000 {
01001     int i;
01002     CCJMenu *psubmenu,*pgoodmenu;
01003
01004     for(i=0;i<(int)(GetMenuItemCount());++i){
01005 #ifdef _CPPRTTI
01006         psubmenu=dynamic_cast<CCJMenu *>(GetSubMenu(i));
01007 #else
01008         psubmenu=(CCJMenu *)GetSubMenu(i);
01009 #endif
01010         if(psubmenu){
01011             pgoodmenu=psubmenu->FindMenuOption(nId,nLoc);
01012             if(pgoodmenu)return(pgoodmenu);
01013         }
01014         else if(nId==(int)GetMenuItemID(i)){
01015             nLoc=i;
01016             return(this);
01017         }
01018     }
01019     nLoc = -1;
01020     return(NULL);
01021 }
01022
01023 CCJMenuData *CCJMenu::FindMenuOption(wchar_t *lpstrText)
01024 {
01025     int i,j;
01026     CCJMenu *psubmenu;
01027     CCJMenuData *pmenulist;
01028
01029     for(i=0;i<(int)(GetMenuItemCount());++i){
01030 #ifdef _CPPRTTI
01031         psubmenu=dynamic_cast<CCJMenu *>(GetSubMenu(i));
01032 #else
01033         psubmenu=(CCJMenu *)GetSubMenu(i);
01034 #endif
01035         if(psubmenu){
01036             pmenulist=psubmenu->FindMenuOption(lpstrText);
01037             if(pmenulist)return(pmenulist);
01038         }
01039         else{
01040             const wchar_t *szWide;//SK: we use const to prevent misuse of this Ptr
01041             for(j=0;j<=m_MenuList.GetUpperBound();++j){
01042                 szWide = m_MenuList[j]->GetWideString ();
01043                 if(szWide && !wcscmp(lpstrText,szWide))//SK: modified for dynamic allocation
01044                     return(m_MenuList[j]);
01045             }
01046         }
01047     }
01048     return(NULL);
01049 }
01050
01051
01052 BOOL CCJMenu::LoadMenu(int nResource)
01053 {
01054     return(CCJMenu::LoadMenu(MAKEINTRESOURCE(nResource)));
01055 };
01056
01057 BOOL CCJMenu::LoadMenu(LPCTSTR lpszResourceName)
01058 {
01059     TRACE(_T(
01060         "IMPORTANT:Use CCJMenu::DestroyMenu to destroy Loaded Menu's\n"));
01061     ASSERT_VALID(this);
01062     ASSERT(lpszResourceName != NULL);
01063
01064     // Find the Menu Resource:
01065     HINSTANCE m_hInst = AfxFindResourceHandle(lpszResourceName,RT_MENU);
01066     HRSRC hRsrc = ::FindResource(m_hInst,lpszResourceName,RT_MENU);
01067     if(hRsrc == NULL)return FALSE;
01068
01069     // Get size of resource:
01070
01071     DWORD dwSize = SizeofResource(NULL, hRsrc);
01072
01073     // Load the Menu Resource:
01074
01075     HGLOBAL hGlobal = LoadResource(m_hInst, hRsrc);
01076     if(hGlobal == NULL)return FALSE;
01077
01078     // Attempt to create us as a menu...
01079
01080     if(!CMenu::CreateMenu())return FALSE;
01081
01082     // Get Item template Header, and calculate offset of MENUITEMTEMPLATES
01083
01084     MENUITEMTEMPLATEHEADER *pTpHdr=
01085         (MENUITEMTEMPLATEHEADER*)LockResource(hGlobal);
01086     BYTE* pTp=(BYTE*)pTpHdr +
01087         (sizeof(MENUITEMTEMPLATEHEADER) + pTpHdr->offset);
01088
01089
01090     // Variables needed during processing of Menu Item Templates:
01091
01092     int j=0;
01093     CCJMenuData*  pData = NULL;              // New OD Menu Item Data
01094     WORD    dwFlags = 0;              // Flags of the Menu Item
01095     WORD    dwID  = 0;              // ID of the Menu Item
01096     UINT    uFlags;                  // Actual Flags.
01097     wchar_t *szCaption=NULL;
01098     int      nLen   = 0;                // Length of caption
01099     CTypedPtrArray<CPtrArray, CCJMenu*>  m_Stack;    // Popup menu stack
01100     CArray<BOOL,BOOL>  m_StackEnd;    // Popup menu stack
01101     m_Stack.Add(this);                  // Add it to this...
01102     m_StackEnd.Add(FALSE);
01103
01104     do{
01105         // Obtain Flags and (if necessary), the ID...
01106         memcpy(&dwFlags, pTp, sizeof(WORD));pTp+=sizeof(WORD);// Obtain Flags
01107         if(!(dwFlags & MF_POPUP)){
01108             memcpy(&dwID, pTp, sizeof(WORD)); // Obtain ID
01109             pTp+=sizeof(WORD);
01110         }
01111         else dwID = 0;
01112
01113         uFlags = (UINT)dwFlags; // Remove MF_END from the flags that will
01114         if(uFlags & MF_END) // be passed to the Append(OD)Menu functions.
01115             uFlags -= MF_END;
01116
01117         // Obtain Caption (and length)
01118
01119         nLen = 0;
01120         char *ch = (char*)pTp;
01121         szCaption=new wchar_t[wcslen((wchar_t *)pTp)+1];
01122         wcscpy(szCaption,(wchar_t *)pTp);
01123         pTp=&pTp[(wcslen((wchar_t *)pTp)+1)*sizeof(wchar_t)];//modified SK
01124
01125         // Handle popup menus first....
01126
01127         //WideCharToMultiByte
01128         if(dwFlags & MF_POPUP){
01129             if(dwFlags & MF_END)m_StackEnd.SetAt(m_Stack.GetUpperBound(),TRUE);
01130             CCJMenu* pSubMenu = new CCJMenu;
01131             pSubMenu->m_unselectcheck=m_unselectcheck;
01132             pSubMenu->m_selectcheck=m_selectcheck;
01133             pSubMenu->checkmaps=checkmaps;
01134             pSubMenu->checkmapsshare=TRUE;
01135             pSubMenu->CreatePopupMenu();
01136
01137             // Append it to the top of the stack:
01138
01139             m_Stack[m_Stack.GetUpperBound()]->AppendODMenuW(szCaption,uFlags,
01140                 (UINT)pSubMenu->m_hMenu, -1);
01141             m_Stack.Add(pSubMenu);
01142             m_StackEnd.Add(FALSE);
01143         }
01144         else {
01145             m_Stack[m_Stack.GetUpperBound()]->AppendODMenuW(szCaption, uFlags,
01146                 dwID, -1);
01147             if(dwFlags & MF_END)m_StackEnd.SetAt(m_Stack.GetUpperBound(),TRUE);
01148             j = m_Stack.GetUpperBound();
01149             while(j>=0 && m_StackEnd.GetAt(j)){
01150                 m_Stack[m_Stack.GetUpperBound()]->InsertSpaces();
01151                 m_Stack.RemoveAt(j);
01152                 m_StackEnd.RemoveAt(j);
01153                 --j;
01154             }
01155         }
01156
01157         delete[] szCaption;
01158     }while(m_Stack.GetUpperBound() != -1);
01159
01160     for(int i=0;i<(int)GetMenuItemCount();++i){
01161         CString str=m_MenuList[i]->GetString();
01162
01163         if(GetSubMenu(i)){
01164             m_MenuList[i]->nFlags=MF_POPUP|MF_BYPOSITION;
01165             ModifyMenu(i,MF_POPUP|MF_BYPOSITION,
01166                 (UINT)GetSubMenu(i)->m_hMenu,str);
01167         }
01168         else{
01169             m_MenuList[i]->nFlags=MF_STRING|MF_BYPOSITION;
01170             ModifyMenu(i,MF_STRING|MF_BYPOSITION,m_MenuList[i]->nID,str);
01171         }
01172     }
01173
01174     return(TRUE);
01175 }
01176
01177 void CCJMenu::InsertSpaces(void)
01178 {
01179     int i,j,numitems,maxlength;
01180     CString string,newstring;
01181     CSize t;
01182     CFont m_fontMenu;
01183     LOGFONT m_lf;
01184
01185     ZeroMemory ((PVOID) &m_lf,sizeof (LOGFONT));
01186     NONCLIENTMETRICS nm;
01187     nm.cbSize = sizeof (NONCLIENTMETRICS);
01188     VERIFY (SystemParametersInfo (SPI_GETNONCLIENTMETRICS,nm.cbSize,&nm,0));
01189     m_lf =  nm.lfMenuFont;
01190     m_fontMenu.CreateFontIndirect (&m_lf);
01191
01192     CWnd *pWnd = AfxGetMainWnd();
01193     CDC *pDC = pWnd->GetDC();
01194     CFont* pFont = pDC->SelectObject (&m_fontMenu);
01195
01196     numitems=GetMenuItemCount();
01197     maxlength = -1;
01198     for(i=0;i<numitems;++i){
01199         string=m_MenuList[i]->GetString();
01200         j=string.Find((char)9);
01201         newstring.Empty();
01202         if(j!=-1)newstring=string.Left(j);
01203         else newstring=string;
01204         newstring+=_T(" ");//SK: modified for Unicode correctness.
01205         LPCTSTR lpstrText = (LPCTSTR)newstring;
01206         t=pDC->GetTextExtent(lpstrText,_tcslen(lpstrText));
01207         if(t.cx>maxlength)maxlength = t.cx;
01208     }
01209     for(i=0;i<numitems;++i){
01210         string=m_MenuList[i]->GetString();
01211         j=string.Find((char)9);
01212         if(j!=-1){
01213             newstring.Empty();
01214             newstring=string.Left(j);
01215             LPCTSTR lpstrText = (LPCTSTR)(newstring);
01216             t=pDC->GetTextExtent(lpstrText,_tcslen(lpstrText));
01217             while(t.cx<maxlength){
01218                 newstring+=_T(' ');//SK: modified for Unicode correctness
01219                 LPCTSTR lpstrText = (LPCTSTR)(newstring);
01220                 t=pDC->GetTextExtent(lpstrText,_tcslen(lpstrText));
01221             }
01222             newstring+=string.Mid(j);
01223 #ifdef UNICODE
01224             m_MenuList[i]->SetWideString(newstring);//SK: modified for dynamic allocation
01225 #else
01226             m_MenuList[i]->SetAnsiString(newstring);
01227 #endif
01228         }
01229     }
01230     pDC->SelectObject (pFont);              // Select old font in
01231     AfxGetMainWnd()->ReleaseDC(pDC);       // Release the DC
01232     m_fontMenu.DeleteObject();
01233 }
01234
01235 void CCJMenu::LoadCheckmarkBitmap(int unselect, int select)
01236 {
01237     if(unselect>0 && select>0){
01238         m_selectcheck=select;
01239         m_unselectcheck=unselect;
01240         if(checkmaps)checkmaps->DeleteImageList();
01241         else checkmaps=new(CImageList);
01242         checkmaps->Create(m_iconX,m_iconY,ILC_MASK,2,1);
01243         BOOL flag1=AddBitmapToImageList(checkmaps,unselect);
01244         BOOL flag2=AddBitmapToImageList(checkmaps,select);
01245         if(!flag1||!flag2){
01246             checkmaps->DeleteImageList();
01247             delete checkmaps;
01248             checkmaps=NULL;
01249         }
01250     }
01251 }
01252
01253 //--------------------------------------------------------------------------
01254 //[18.06.99 rj]
01255 BOOL CCJMenu::GetMenuText(UINT id, CString& string, UINT nFlags/*= MF_BYPOSITION*/)
01256 {
01257     BOOL returnflag=FALSE;
01258
01259     if(MF_BYPOSITION&nFlags){
01260         UINT numMenuItems = m_MenuList.GetUpperBound();
01261         if(id<=numMenuItems){
01262             string=m_MenuList[id]->GetString();
01263             returnflag=TRUE;
01264         }
01265     }
01266     else{
01267         int uiLoc;
01268         CCJMenu* pMenu = FindMenuOption(id,uiLoc);
01269         if(NULL!=pMenu) returnflag = pMenu->GetMenuText(uiLoc,string);
01270     }
01271     return(returnflag);
01272 }
01273
01274
01275 void CCJMenu::DrawRadioDot(CDC *pDC,int x,int y,COLORREF color)
01276 {
01277     CRect rcDot(x,y,x+6,y+6);
01278     CBrush brush;
01279     CPen pen;
01280     brush.CreateSolidBrush(color);
01281     pen.CreatePen(PS_SOLID,0,color);
01282     CBrush *pOldBrush=pDC->SelectObject(&brush);
01283     CPen *pOldPen=pDC->SelectObject(&pen);
01284     pDC->Ellipse(&rcDot);
01285     pDC->SelectObject(pOldBrush);
01286     pDC->SelectObject(pOldPen);
01287     pen.DeleteObject();
01288     brush.DeleteObject();
01289 }
01290
01291 void CCJMenu::DrawCheckMark(CDC* pDC,int x,int y,COLORREF color)
01292 {
01293     pDC->SetPixel(x,y+2,color);
01294     pDC->SetPixel(x,y+3,color);
01295     pDC->SetPixel(x,y+4,color);
01296
01297     pDC->SetPixel(x+1,y+3,color);
01298     pDC->SetPixel(x+1,y+4,color);
01299     pDC->SetPixel(x+1,y+5,color);
01300
01301     pDC->SetPixel(x+2,y+4,color);
01302     pDC->SetPixel(x+2,y+5,color);
01303     pDC->SetPixel(x+2,y+6,color);
01304
01305     pDC->SetPixel(x+3,y+3,color);
01306     pDC->SetPixel(x+3,y+4,color);
01307     pDC->SetPixel(x+3,y+5,color);
01308
01309     pDC->SetPixel(x+4,y+2,color);
01310     pDC->SetPixel(x+4,y+3,color);
01311     pDC->SetPixel(x+4,y+4,color);
01312
01313     pDC->SetPixel(x+5,y+1,color);
01314     pDC->SetPixel(x+5,y+2,color);
01315     pDC->SetPixel(x+5,y+3,color);
01316
01317     pDC->SetPixel(x+6,y,color);
01318     pDC->SetPixel(x+6,y+1,color);
01319     pDC->SetPixel(x+6,y+2,color);
01320 }
01321
01322 CCJMenuData *CCJMenu::FindMenuList(UINT nID)
01323 {
01324     for(int i=0;i<=m_MenuList.GetUpperBound();++i){
01325         if(m_MenuList[i]->nID==nID && !m_MenuList[i]->syncflag){
01326             m_MenuList[i]->syncflag=1;
01327             return(m_MenuList[i]);
01328         }
01329     }
01330     return(NULL);
01331 }
01332
01333 void CCJMenu::InitializeMenuList(int value)
01334 {
01335     for(int i=0;i<=m_MenuList.GetUpperBound();++i)
01336         m_MenuList[i]->syncflag=value;
01337 }
01338
01339 void CCJMenu::DeleteMenuList(void)
01340 {
01341     for(int i=0;i<=m_MenuList.GetUpperBound();++i){
01342         if(!m_MenuList[i]->syncflag){
01343             delete m_MenuList[i];
01344         }
01345     }
01346 }
01347
01348 void CCJMenu::SynchronizeMenu(void)
01349 {
01350     CTypedPtrArray<CPtrArray, CCJMenuData*> temp;
01351     CCJMenuData *mdata;
01352     CString string;
01353     UINT submenu,nID=0,state,j;
01354
01355     InitializeMenuList(0);
01356     for(j=0;j<GetMenuItemCount();++j){
01357         mdata=NULL;
01358         state=GetMenuState(j,MF_BYPOSITION);
01359         if(state&MF_POPUP){
01360             submenu=(UINT)GetSubMenu(j)->m_hMenu;
01361             mdata=FindMenuList(submenu);
01362             GetMenuString(j,string,MF_BYPOSITION);
01363             if(!mdata)mdata=NewODMenu(j,
01364                 (state&0xFF)|MF_BYPOSITION|MF_POPUP|MF_OWNERDRAW,submenu,string);
01365             else if(string.GetLength()>0)
01366 #ifdef UNICODE
01367                 mdata->SetWideString(string);  //SK: modified for dynamic allocation
01368 #else
01369             mdata->SetAnsiString(string);
01370 #endif
01371         }
01372         else if(state&MF_SEPARATOR){
01373             mdata=FindMenuList(0);
01374             if(!mdata)mdata=NewODMenu(j,
01375                 state|MF_BYPOSITION|MF_SEPARATOR|MF_OWNERDRAW,0,_T(""));//SK: modified for Unicode correctness
01376             else ModifyMenu(j,mdata->nFlags,nID,(LPCTSTR)mdata);
01377         }
01378         else{
01379             nID=GetMenuItemID(j);
01380             mdata=FindMenuList(nID);
01381             GetMenuString(j,string,MF_BYPOSITION);
01382             if(!mdata)mdata=NewODMenu(j,state|MF_BYPOSITION|MF_OWNERDRAW,
01383                 nID,string);
01384             else{
01385                 mdata->nFlags=state|MF_BYPOSITION|MF_OWNERDRAW;
01386                 if(string.GetLength()>0)
01387 #ifdef UNICODE
01388                     mdata->SetWideString(string);//SK: modified for dynamic allocation
01389 #else
01390                 mdata->SetAnsiString(string);
01391 #endif
01392
01393                 ModifyMenu(j,mdata->nFlags,nID,(LPCTSTR)mdata);
01394             }
01395         }
01396         if(mdata)temp.Add(mdata);
01397     }
01398     DeleteMenuList();
01399     m_MenuList.RemoveAll();
01400     m_MenuList.Append(temp);
01401     temp.RemoveAll();
01402 }
01403
01404 void CCJMenu::UpdateMenu(CMenu *pmenu)
01405 {
01406 #ifdef _CPPRTTI
01407     CCJMenu *psubmenu = dynamic_cast<CCJMenu *>(pmenu);
01408 #else
01409     CCJMenu *psubmenu = (CCJMenu *)pmenu;
01410 #endif
01411     if(psubmenu)psubmenu->SynchronizeMenu();
01412 }
01413
01414 LRESULT CCJMenu::FindKeyboardShortcut(UINT nChar, UINT nFlags,
01415                                       CMenu *pMenu)
01416 {
01417 #ifdef _CPPRTTI
01418     CCJMenu *pCCJMenu = dynamic_cast<CCJMenu *>(pMenu);
01419 #else
01420     CCJMenu *pCCJMenu = (CCJMenu *)pMenu;
01421 #endif
01422     if(pCCJMenu && nFlags&MF_POPUP){
01423         CString key(_T('&'),2);//SK: modified for Unicode correctness
01424         key.SetAt(1,(TCHAR)nChar);
01425         key.MakeLower();
01426         CString menutext;
01427         int menusize = (int)pCCJMenu->GetMenuItemCount();
01428         if(menusize!=(pCCJMenu->m_MenuList.GetUpperBound()+1))
01429             pCCJMenu->SynchronizeMenu();
01430         for(int i=0;i<menusize;++i){
01431             if(pCCJMenu->GetMenuText(i,menutext)){
01432                 menutext.MakeLower();
01433                 if(menutext.Find(key)>=0)return(MAKELRESULT(i,2));
01434             }
01435         }
01436     }
01437     return(0);
01438 }
01439
01440 void CCJMenu::DitherBlt (HDC hdcDest, int nXDest, int nYDest, int nWidth,
01441                          int nHeight, HBITMAP hbm, int nXSrc, int nYSrc)
01442 {
01443     ASSERT(hdcDest && hbm);
01444     ASSERT(nWidth > 0 && nHeight > 0);
01445
01446     // Create a generic DC for all BitBlts
01447     HDC hDC = CreateCompatibleDC(hdcDest);
01448     ASSERT(hDC);
01449
01450     if (hDC)
01451     {
01452         // Create a DC for the monochrome DIB section
01453         HDC bwDC = CreateCompatibleDC(hDC);
01454         ASSERT(bwDC);
01455
01456         if (bwDC)
01457         {
01458             // Create the monochrome DIB section with a black and white palette
01459             struct {
01460                 BITMAPINFOHEADER bmiHeader;
01461                 RGBQUAD      bmiColors[2];
01462             } RGBBWBITMAPINFO = {
01463
01464                 {    // a BITMAPINFOHEADER
01465                     sizeof(BITMAPINFOHEADER),  // biSize
01466                         nWidth,         // biWidth;
01467                         nHeight,        // biHeight;
01468                         1,            // biPlanes;
01469                         1,            // biBitCount
01470                         BI_RGB,         // biCompression;
01471                         0,            // biSizeImage;
01472                         0,            // biXPelsPerMeter;
01473                         0,            // biYPelsPerMeter;
01474                         0,            // biClrUsed;
01475                         0            // biClrImportant;
01476                 },
01477                 {
01478                     { 0x00, 0x00, 0x00, 0x00 }, { 0xFF, 0xFF, 0xFF, 0x00 }
01479                     }
01480             };
01481             VOID *pbitsBW;
01482             HBITMAP hbmBW = CreateDIBSection(bwDC,
01483                 (LPBITMAPINFO)&RGBBWBITMAPINFO, DIB_RGB_COLORS, &pbitsBW, NULL, 0);
01484             ASSERT(hbmBW);
01485
01486             if (hbmBW)
01487             {
01488                 // Attach the monochrome DIB section and the bitmap to the DCs
01489                 HBITMAP olddib = (HBITMAP)SelectObject(bwDC, hbmBW);
01490                 HBITMAP hdcolddib = (HBITMAP)SelectObject(hDC, hbm);
01491
01492                 // BitBlt the bitmap into the monochrome DIB section
01493                 BitBlt(bwDC, 0, 0, nWidth, nHeight, hDC, nXSrc, nYSrc, SRCCOPY);
01494
01495                 // Paint the destination rectangle in gray
01496                 FillRect(hdcDest, CRect(nXDest, nYDest, nXDest + nWidth, nYDest +
01497                     nHeight), GetSysColorBrush((IsNewShell())?COLOR_3DFACE:COLOR_MENU));
01498                 //SK: looks better on the old shell
01499                 // BitBlt the black bits in the monochrome bitmap into COLOR_3DHILIGHT
01500                 // bits in the destination DC
01501                 // The magic ROP comes from the Charles Petzold's book
01502                 HBRUSH hb = CreateSolidBrush(GetSysColor(COLOR_3DHILIGHT));
01503                 HBRUSH oldBrush = (HBRUSH)SelectObject(hdcDest, hb);
01504                 BitBlt(hdcDest,nXDest+1,nYDest+1,nWidth,nHeight,bwDC,0,0,0xB8074A);
01505
01506                 // BitBlt the black bits in the monochrome bitmap into COLOR_3DSHADOW
01507                 // bits in the destination DC
01508                 hb = CreateSolidBrush(GetSysColor(COLOR_3DSHADOW));
01509                 DeleteObject(SelectObject(hdcDest, hb));
01510                 BitBlt(hdcDest, nXDest, nYDest, nWidth, nHeight,bwDC,0,0,0xB8074A);
01511                 DeleteObject(SelectObject(hdcDest, oldBrush));
01512                 VERIFY(DeleteObject(SelectObject(bwDC, olddib)));
01513                 SelectObject(hDC, hdcolddib);
01514             }
01515
01516             VERIFY(DeleteDC(bwDC));
01517         }
01518
01519         VERIFY(DeleteDC(hDC));
01520     }
01521 }
01522
01523 BOOL CCJMenu::AddBitmapToImageList(CImageList *bmplist,UINT nResourceID)
01524 {
01525     BOOL bReturn=TRUE;
01526
01527     HBITMAP hbmp=LoadSysColorBitmap(nResourceID);
01528     if(hbmp){
01529         CBitmap bmp;
01530         bmp.Attach(hbmp);
01531         if(m_bitmapBackgroundFlag) bmplist->Add(&bmp,m_bitmapBackground);
01532         else bmplist->Add(&bmp,GetSysColor(COLOR_3DFACE));
01533         bmp.Detach();
01534         DeleteObject(hbmp);
01535         bReturn=TRUE;
01536     }
01537     else bReturn = FALSE;
01538     return(bReturn);
01539 }
01540
01541 void CCJMenu::SetBitmapBackground(COLORREF color)
01542 {
01543     m_bitmapBackground=color;
01544     m_bitmapBackgroundFlag=TRUE;
01545 }
01546
01547 void CCJMenu::UnSetBitmapBackground(void)
01548 {
01549     m_bitmapBackgroundFlag=FALSE;
01550 }
01551
01552 // Given a toolbar, append all the options from it to this menu
01553 // Passed a ptr to the toolbar object and the toolbar ID
01554 // Author : Robert Edward Caldecott
01555 void CCJMenu::AddFromToolBar(CToolBar* pToolBar, int nResourceID)
01556 {
01557     for (int i = 0; i < pToolBar->GetCount(); i++) {
01558         UINT nID = pToolBar->GetItemID(i);
01559         // See if this toolbar option
01560         // appears as a command on this
01561         // menu or is a separator
01562         if (nID == 0 || GetMenuState(nID, MF_BYCOMMAND) == 0xFFFFFFFF)
01563             continue; // Item doesn't exist
01564         UINT nStyle;
01565         int nImage;
01566         // Get the toolbar button info
01567         pToolBar->GetButtonInfo(i, nID, nStyle, nImage);
01568         // OK, we have the command ID of the toolbar
01569         // option, and the tollbar bitmap offset
01570         int nLoc;
01571         CCJMenuData* pData;
01572         CCJMenu *pSubMenu = FindMenuOption(nID, nLoc);
01573         if (pSubMenu && nLoc >= 0)pData = pSubMenu->m_MenuList[nLoc];
01574         else {
01575             // Create a new CCJMenuData structure
01576             pData = new CCJMenuData;
01577             m_MenuList.Add(pData);
01578         }
01579         // Set some default structure members
01580         pData->menuIconNormal = nResourceID;
01581         pData->nID = nID;
01582         pData->nFlags =  MF_BYCOMMAND | MF_OWNERDRAW;
01583         pData->xoffset = nImage;
01584         if (pData->bitmap)pData->bitmap->DeleteImageList();
01585         else pData->bitmap = new CImageList;
01586         pData->bitmap->Create(m_iconX, m_iconY,ILC_COLORDDB|ILC_MASK, 1, 1);
01587
01588         if(!AddBitmapToImageList(pData->bitmap, nResourceID)){
01589             pData->bitmap->DeleteImageList();
01590             delete pData->bitmap;
01591             pData->bitmap=NULL;
01592             pData->menuIconNormal = -1;
01593             pData->xoffset = -1;
01594         }
01595
01596         // Modify our menu
01597         ModifyMenu(nID,pData->nFlags,nID,(LPCTSTR)pData);
01598     }
01599 }
01600
01601 BOOL CCJMenu::Draw3DCheckmark(CDC *dc, const CRect& rc,
01602                               BOOL bSelected, HBITMAP hbmCheck)
01603 {
01604     CRect rcDest = rc;
01605     CBrush brush;
01606     COLORREF col=GetSysColor((bSelected||!IsNewShell())?COLOR_MENU:COLOR_3DLIGHT);//SK: Looks better on the old shell
01607     brush.CreateSolidBrush(col);
01608     dc->FillRect(rcDest,&brush);
01609     brush.DeleteObject();
01610     if (IsNewShell()) //SK: looks better on the old shell
01611         dc->DrawEdge(&rcDest, BDR_SUNKENOUTER, BF_RECT);
01612     if (!hbmCheck)DrawCheckMark(dc,rc.left+4,rc.top+4,GetSysColor(COLOR_MENUTEXT));
01613     else DrawRadioDot(dc,rc.left+5,rc.top+4,GetSysColor(COLOR_MENUTEXT));
01614     return TRUE;
01615 }
01616
01617 void CCJMenu::DitherBlt2(CDC *drawdc, int nXDest, int nYDest, int nWidth,
01618                          int nHeight, CBitmap &bmp, int nXSrc, int nYSrc)
01619 {
01620     // create a monochrome memory DC
01621     CDC ddc;
01622     ddc.CreateCompatibleDC(0);
01623     CBitmap bwbmp;
01624     bwbmp.CreateCompatibleBitmap(&ddc, nWidth, nHeight);
01625     CBitmap * pddcOldBmp = ddc.SelectObject(&bwbmp);
01626
01627     CDC dc;
01628     dc.CreateCompatibleDC(0);
01629     CBitmap * pdcOldBmp = dc.SelectObject(&bmp);
01630
01631     // build a mask
01632     ddc.PatBlt(0, 0, nWidth, nHeight, WHITENESS);
01633     dc.SetBkColor(GetSysColor(COLOR_BTNFACE));
01634     ddc.BitBlt(0, 0, nWidth, nHeight, &dc, nXSrc,nYSrc, SRCCOPY);
01635     dc.SetBkColor(GetSysColor(COLOR_BTNHILIGHT));
01636     ddc.BitBlt(0, 0, nWidth, nHeight, &dc, nXSrc,nYSrc, SRCPAINT);
01637
01638     // Copy the image from the toolbar into the memory DC
01639     // and draw it (grayed) back into the toolbar.
01640     dc.FillSolidRect(0,0, nWidth, nHeight, GetSysColor((IsNewShell())?COLOR_3DFACE:COLOR_MENU));
01641     //SK: Looks better on the old shell
01642     dc.SetBkColor(RGB(0, 0, 0));
01643     dc.SetTextColor(RGB(255, 255, 255));
01644     CBrush brShadow, brHilight;
01645     brHilight.CreateSolidBrush(GetSysColor(COLOR_BTNHILIGHT));
01646     brShadow.CreateSolidBrush(GetSysColor(COLOR_BTNSHADOW));
01647     CBrush * pOldBrush = dc.SelectObject(&brHilight);
01648     dc.BitBlt(0,0, nWidth, nHeight, &ddc, 0, 0, 0x00E20746L);
01649     drawdc->BitBlt(nXDest+1,nYDest+1,nWidth, nHeight, &dc,0,0,SRCCOPY);
01650     dc.BitBlt(1,1, nWidth, nHeight, &ddc, 0, 0, 0x00E20746L);
01651     dc.SelectObject(&brShadow);
01652     dc.BitBlt(0,0, nWidth, nHeight, &ddc, 0, 0, 0x00E20746L);
01653     drawdc->BitBlt(nXDest,nYDest,nWidth, nHeight, &dc,0,0,SRCCOPY);
01654     // reset DCs
01655     ddc.SelectObject(pddcOldBmp);
01656     ddc.DeleteDC();
01657     dc.SelectObject(pOldBrush);
01658     dc.SelectObject(pdcOldBmp);
01659     dc.DeleteDC();
01660
01661     brShadow.DeleteObject();
01662     brHilight.DeleteObject();
01663     bwbmp.DeleteObject();
01664 }
01665
01666 void CCJMenu::SetDisableOldStyle(void)
01667 {
01668     disable_old_style=TRUE;
01669 }
01670
01671 void CCJMenu::UnSetDisableOldStyle(void)
01672 {
01673     disable_old_style=FALSE;
01674 }
01675
01676 BOOL CCJMenu::GetDisableOldStyle(void)
01677 {
01678     return(disable_old_style);
01679 }
01680
01681
01682 HBITMAP CCJMenu::LoadSysColorBitmap(int nResourceId)
01683 {
01684     HINSTANCE hInst =
01685         AfxFindResourceHandle(MAKEINTRESOURCE(nResourceId),RT_BITMAP);
01686     HRSRC hRsrc =
01687         ::FindResource(hInst,MAKEINTRESOURCE(nResourceId),RT_BITMAP);
01688     if (hRsrc == NULL)
01689         return NULL;
01690     return AfxLoadSysColorBitmap(hInst, hRsrc, FALSE);
01691 }
01692
01693 BOOL CCJMenu::RemoveMenu(UINT uiId,UINT nFlags)
01694 {
01695     if(MF_BYPOSITION&nFlags){
01696         CCJMenu* pSubMenu = (CCJMenu*) GetSubMenu(uiId);
01697         if(NULL==pSubMenu){
01698             UINT uiCommandId = GetMenuItemID(uiId);
01699             for(int i=0;i<m_MenuList.GetSize(); i++){
01700                 if(m_MenuList[i]->nID==uiCommandId){
01701                     delete m_MenuList.GetAt(i);
01702                     m_MenuList.RemoveAt(i);
01703                     break;
01704                 }
01705             }
01706         }
01707         else{
01708             int numSubMenus = m_SubMenus.GetUpperBound();
01709             for(int m = numSubMenus; m >= 0; m--){
01710                 if(m_SubMenus[m]==pSubMenu->m_hMenu){
01711                     int numAllSubMenus = m_AllSubMenus.GetUpperBound();
01712                     for(int n = numAllSubMenus; n>= 0; n--){
01713                         if(m_AllSubMenus[n]==m_SubMenus[m])m_AllSubMenus.RemoveAt(n);
01714                     }
01715                     m_SubMenus.RemoveAt(m);
01716                 }
01717             }
01718             int num = pSubMenu->GetMenuItemCount();
01719             for(int i=num-1;i>=0;--i)pSubMenu->RemoveMenu(i,MF_BYPOSITION);
01720             for(i=m_MenuList.GetUpperBound();i>=0;i--){
01721                 if(m_MenuList[i]->nID==(UINT)pSubMenu->m_hMenu){
01722                     delete m_MenuList.GetAt(i);
01723                     m_MenuList.RemoveAt(i);
01724                     break;
01725                 }
01726             }
01727             delete pSubMenu;
01728         }
01729     }
01730     else{
01731         int iPosition =0;
01732         CCJMenu* pMenu = FindMenuOption(uiId,iPosition);
01733         if(pMenu)pMenu->RemoveMenu(iPosition,MF_BYPOSITION);
01734     }
01735     return CMenu::RemoveMenu(uiId,nFlags);
01736 }
01737
01738 BOOL CCJMenu::DeleteMenu(UINT uiId,UINT nFlags)
01739 {
01740     if(MF_BYPOSITION&nFlags){
01741         CCJMenu* pSubMenu = (CCJMenu*) GetSubMenu(uiId);
01742         if(NULL==pSubMenu){
01743             UINT uiCommandId = GetMenuItemID(uiId);
01744             for(int i=0;i<m_MenuList.GetSize(); i++){
01745                 if(m_MenuList[i]->nID==uiCommandId){
01746                     delete m_MenuList.GetAt(i);
01747                     m_MenuList.RemoveAt(i);
01748                     break;
01749                 }
01750             }
01751         }
01752         else{
01753             int numSubMenus = m_SubMenus.GetUpperBound();
01754             for(int m = numSubMenus; m >= 0; m--){
01755                 if(m_SubMenus[m]==pSubMenu->m_hMenu){
01756                     int numAllSubMenus = m_AllSubMenus.GetUpperBound();
01757                     for(int n = numAllSubMenus; n>= 0; n--){
01758                         if(m_AllSubMenus[n]==m_SubMenus[m])m_AllSubMenus.RemoveAt(n);
01759                     }
01760                     m_SubMenus.RemoveAt(m);
01761                 }
01762             }
01763             int num = pSubMenu->GetMenuItemCount();
01764             for(int i=num-1;i>=0;--i)pSubMenu->DeleteMenu(i,MF_BYPOSITION);
01765             for(i=m_MenuList.GetUpperBound();i>=0;i--){
01766                 if(m_MenuList[i]->nID==(UINT)pSubMenu->m_hMenu){
01767                     delete m_MenuList.GetAt(i);
01768                     m_MenuList.RemoveAt(i);
01769                     break;
01770                 }
01771             }
01772             delete pSubMenu;
01773         }
01774     }
01775     else{
01776         int iPosition =0;
01777         CCJMenu* pMenu = FindMenuOption(uiId,iPosition);
01778         if(pMenu)pMenu->DeleteMenu(iPosition,MF_BYPOSITION);
01779     }
01780     return CMenu::DeleteMenu(uiId,nFlags);
01781 }
01782
01783
01784 BOOL CCJMenu::AppendMenuA(UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,int nIconNormal)
01785 {
01786     USES_CONVERSION;
01787     return AppendMenuW(nFlags,nIDNewItem,A2W(lpszNewItem),nIconNormal);
01788 }
01789
01790 BOOL CCJMenu::AppendMenuW(UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,int nIconNormal)
01791 {
01792     return AppendODMenuW(lpszNewItem,nFlags,nIDNewItem,nIconNormal);
01793 }
01794
01795 BOOL CCJMenu::AppendMenuA(UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,CImageList *il,int xoffset)
01796 {
01797     USES_CONVERSION;
01798     return AppendMenuW(nFlags,nIDNewItem,A2W(lpszNewItem),il,xoffset);
01799 }
01800
01801 BOOL CCJMenu::AppendMenuW(UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,CImageList *il,int xoffset)
01802 {
01803     return AppendODMenuW(lpszNewItem,nFlags,nIDNewItem,il,xoffset);
01804 }
01805
01806 BOOL CCJMenu::AppendMenuA(UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,CBitmap *bmp)
01807 {
01808     USES_CONVERSION;
01809     return AppendMenuW(nFlags,nIDNewItem,A2W(lpszNewItem),bmp);
01810 }
01811
01812 BOOL CCJMenu::AppendMenuW(UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,CBitmap *bmp)
01813 {
01814     if(bmp){
01815         CImageList temp;
01816         temp.Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1);
01817         if(m_bitmapBackgroundFlag)temp.Add(bmp,m_bitmapBackground);
01818         else temp.Add(bmp,GetSysColor(COLOR_3DFACE));
01819         return AppendODMenuW(lpszNewItem,nFlags,nIDNewItem,&temp,0);
01820     }
01821     return AppendODMenuW(lpszNewItem,nFlags,nIDNewItem,NULL,0);
01822 }
01823
01824 BOOL CCJMenu::InsertMenuA(UINT nPosition,UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,int nIconNormal)
01825 {
01826     USES_CONVERSION;
01827     return InsertMenuW(nPosition,nFlags,nIDNewItem,A2W(lpszNewItem),nIconNormal);
01828 }
01829
01830 BOOL CCJMenu::InsertMenuW(UINT nPosition,UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,int nIconNormal)
01831 {
01832     return InsertODMenuW(nPosition,lpszNewItem,nFlags,nIDNewItem,nIconNormal);
01833 }
01834
01835 BOOL CCJMenu::InsertMenuA(UINT nPosition,UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,CImageList *il,int xoffset)
01836 {
01837     USES_CONVERSION;
01838     return InsertMenuW(nPosition,nFlags,nIDNewItem,A2W(lpszNewItem),il,xoffset);
01839 }
01840
01841 BOOL CCJMenu::InsertMenuW(UINT nPosition,UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,CImageList *il,int xoffset)
01842 {
01843     return InsertODMenuW(nPosition,lpszNewItem,nFlags,nIDNewItem,il,xoffset);
01844 }
01845
01846 BOOL CCJMenu::InsertMenuA(UINT nPosition,UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,CBitmap *bmp)
01847 {
01848     USES_CONVERSION;
01849     return InsertMenuW(nPosition,nFlags,nIDNewItem,A2W(lpszNewItem),bmp);
01850 }
01851
01852 BOOL CCJMenu::InsertMenuW(UINT nPosition,UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,CBitmap *bmp)
01853 {
01854     if(bmp){
01855         CImageList temp;
01856         temp.Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1);
01857         if(m_bitmapBackgroundFlag)temp.Add(bmp,m_bitmapBackground);
01858         else temp.Add(bmp,GetSysColor(COLOR_3DFACE));
01859         return InsertODMenuW(nPosition,lpszNewItem,nFlags,nIDNewItem,&temp,0);
01860     }
01861     return InsertODMenuW(nPosition,lpszNewItem,nFlags,nIDNewItem,NULL,0);
01862 }
01863
01864 //--------------------------------------------------------------------------
01865 //[21.06.99 rj]
01866 CCJMenu* CCJMenu::AppendODPopupMenuW(wchar_t *lpstrText)
01867 {
01868     CCJMenu* pSubMenu = new CCJMenu;
01869     pSubMenu->m_unselectcheck=m_unselectcheck;
01870     pSubMenu->m_selectcheck=m_selectcheck;
01871     pSubMenu->checkmaps=checkmaps;
01872     pSubMenu->checkmapsshare=TRUE;
01873     pSubMenu->CreatePopupMenu();
01874     AppendODMenuW(lpstrText,MF_POPUP,(UINT)pSubMenu->m_hMenu, -1);
01875     return pSubMenu;
01876 }
01877
01878 //--------------------------------------------------------------------------
01879 //[21.06.99 rj]
01880 CCJMenu* CCJMenu::AppendODPopupMenuA(LPCSTR lpstrText)
01881 {
01882     USES_CONVERSION;
01883     return AppendODPopupMenuW(A2W(lpstrText));
01884 }
01885
01886
01887
01888 //*************************************************************************
Generated on Sun Feb 24 01:21:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJMenuBar.cpp Source File

WinCvs/CJLib/CJLibrary/CJMenuBar.cpp

Go to the documentation of this file.
00001 // CJMenuBar.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based on the code written by Paul DiLascia for MSJ.
00006 //
00008 /****************************************************************************
00009  *
00010  * $Date: 1999/11/30 21:45:49 $
00011  * $Revision: 1.1.1.3 $
00012  * $Archive: /CodeJock/CJLibrary/CJMenuBar.cpp $
00013  *
00014  * $History: CJMenuBar.cpp $
00015  *
00016  * *****************  Version 11  *****************
00017  * User: Kirk Stowell Date: 10/24/99   Time: 9:12p
00018  * Updated in $/CodeJock/CJLibrary
00019  * Fixed potential resource and memory leak problems.
00020  *
00021  * *****************  Version 10  *****************
00022  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00023  * Updated in $/CodeJockey/CJLibrary
00024  * Updated copyright and contact information.
00025  *
00026  * *****************  Version 9  *****************
00027  * User: Kirk Stowell Date: 8/29/99    Time: 9:36p
00028  * Updated in $/CodeJockey/CJLibrary
00029  * Fixed bug with left arrow tracking - Tim Lewis <timlewis@home.com>
00030  *
00031  * *****************  Version 8  *****************
00032  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00033  * Updated in $/CodeJockey/CJLibrary
00034  * Added Unicode compliance, thanks to Barry Burton for his help with
00035  * this.
00036  *
00037  *
00038  * *****************  Version 7  *****************
00039  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00040  * Updated in $/CodeJockey/CJLibrary
00041  *
00042  * *****************  Version 6  *****************
00043  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00044  * Updated in $/CodeJockey/CJLibrary
00045  *
00046  * *****************  Version 5  *****************
00047  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00048  * Updated in $/CodeJockey/CJLibrary
00049  *
00050  * *****************  Version 4  *****************
00051  * User: Kirk Stowell Date: 7/25/99    Time: 12:15a
00052  * Updated in $/CodeJockey/CJLibrary
00053  *
00054  * *****************  Version 3  *****************
00055  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00056  * Updated in $/CodeJockey/CJLibrary
00057  *
00058  * *****************  Version 2  *****************
00059  * User: Kirk Stowell Date: 7/18/99    Time: 10:28p
00060  * Updated in $/CodeJockey/CJLibrary
00061  * Further cleanup to handle CCJMenu class.
00062  *
00063  * *****************  Version 1  *****************
00064  * User: Kirk Stowell Date: 7/15/99    Time: 12:34a
00065  * Created in $/CodeJockey/CJLibrary
00066  * Initial creation. Extended the original class written by Paul DiLascia
00067  * for MSJ. Class uses CCJMenu and fixes some bugs with the original
00068  * class.
00069  *
00070  ***************************************************************************/
00072
00073 #include "stdafx.h"
00074 #include "CJMenuBar.h"
00075 #include "CJMenu.h"        // CCJMenu class declaration
00076
00077 #ifdef _DEBUG
00078 #define new DEBUG_NEW
00079 #undef THIS_FILE
00080 static char THIS_FILE[] = __FILE__;
00081 #endif
00082
00084 // CCJMenuBar
00085
00086 CCJMenuBar::CCJMenuBar()
00087 {
00088     m_iTrackingState        = TRACK_NONE;   // initial state: not tracking
00089     m_iPopupTracking        = -1;
00090     m_iNewPopup             = -1;           // invalid
00091     m_bAutoRemoveFrameMenu  = TRUE;         // set frame's menu to NULL
00092 }
00093
00094 CCJMenuBar::~CCJMenuBar()
00095 {
00096     // fix potential resource leak - KStowell - 10-15-99
00097     m_Font.DeleteObject();
00098 }
00099
00100 IMPLEMENT_DYNAMIC(CCJMenuBar, CCJToolBar)
00101
00102 BEGIN_MESSAGE_MAP(CCJMenuBar, CCJToolBar)
00103     //{{AFX_MSG_MAP(CCJMenuBar)
00104     ON_WM_LBUTTONDOWN()
00105     ON_WM_MOUSEMOVE()
00106     ON_WM_SIZE()
00107     ON_UPDATE_COMMAND_UI_RANGE(0, 256, OnUpdateMenuButton)
00108     //}}AFX_MSG_MAP
00109 END_MESSAGE_MAP()
00110
00111 BOOL CCJMenuBar::Create(CWnd* pParentWnd, DWORD dwStyle, UINT nID)
00112 {
00113     return CreateEx(pParentWnd, NULL, dwStyle,
00114         CRect(m_cxLeftBorder, m_cyTopBorder, m_cxRightBorder, m_cyBottomBorder), nID);
00115 }
00116
00117 BOOL CCJMenuBar::CreateEx(CWnd* pParentWnd, DWORD dwCtrlStyle, DWORD dwStyle, CRect rcBorders, UINT nID)
00118 {
00119     if( !CCJToolBar::CreateEx( pParentWnd, dwCtrlStyle, dwStyle, rcBorders, nID))
00120         return FALSE;
00121
00122     UpdateFont();
00123     m_frameHook.Install(this, *pParentWnd);
00124
00125     SetWindowText(_T("Menu Bar"));
00126     return TRUE;
00127 }
00128
00130 // CCJMenuBar message handlers
00131 CSize CCJMenuBar::CalcFixedLayout(BOOL bStretch, BOOL bHorz)
00132 {
00133     if( m_bInReBar ) {
00134         return CCJToolBar::CalcFixedLayout(bStretch, bHorz);
00135     }
00136
00137     else
00138     {
00139         CSize size = CCJToolBar::CalcFixedLayout(bStretch, bHorz);
00140         CRect rcClient;
00141         GetParentFrame()->GetClientRect(&rcClient);
00142
00143         if( bHorz ) {
00144             size.cx = rcClient.Width();
00145         }
00146         else {
00147             size.cy = rcClient.Height();
00148         }
00149
00150         return size;
00151     }
00152 }
00153
00155 // Set menu bar font from current system menu font
00156 //
00157 void CCJMenuBar::UpdateFont()
00158 {
00159     m_Font.DeleteObject();
00160     NONCLIENTMETRICS ncm;
00161     ncm.cbSize = sizeof(ncm);
00162     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00163     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMenuFont));
00164     SetFont(&m_Font);
00165 }
00166
00168 // The reason for having this is so MFC won't automatically disable
00169 // the menu buttons. Assumes < 256 top-level menu items. The ID of
00170 // the ith menu button is i. IOW, the index and ID are the same.
00171 //
00172 void CCJMenuBar::OnUpdateMenuButton(CCmdUI* pCmdUI)
00173 {
00174     ASSERT_VALID(this);
00175     if (IsValidButton(pCmdUI->m_nID))
00176         pCmdUI->Enable(TRUE);
00177 }
00178
00180 // Recompute layout of menu bar
00181 //
00182 void CCJMenuBar::RecomputeMenuLayout()
00183 {
00184     SetWindowPos(NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOACTIVATE |
00185         SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
00186 }
00187
00189 // Make frame recalculate control bar sizes after menu change
00190 //
00191 void CCJMenuBar::RecomputeToolbarSize()
00192 {
00193     // Force toolbar to recompute size
00194     CFrameWnd* pFrame = (CFrameWnd*)GetParentFrame();
00195     ASSERT_VALID(pFrame);
00196     ASSERT(pFrame->IsFrameWnd());
00197     pFrame->RecalcLayout();
00198
00199     // floating frame
00200     pFrame = GetParentFrame();
00201     if (pFrame->IsKindOf(RUNTIME_CLASS(CMiniFrameWnd)))
00202         pFrame->RecalcLayout();
00203 }
00204
00206 // Set tracking state: none, button, or popup
00207 //
00208 void CCJMenuBar::SetTrackingState(TRACKINGSTATE iState, int iButton)
00209 {
00210     ASSERT_VALID(this);
00211     if (iState != m_iTrackingState) {
00212         if (iState == TRACK_NONE)
00213             iButton = -1;
00214
00215         SetHotItem(iButton);                     // could be none (-1)
00216
00217         if (iState==TRACK_POPUP) {
00218             // set related state stuff
00219             m_bEscapeWasPressed = FALSE;     // assume Esc key not pressed
00220             m_bProcessRightArrow =           // assume left/right arrow..
00221                 m_bProcessLeftArrow = TRUE; // ..will move to prev/next popup
00222             m_iPopupTracking = iButton;  // which popup I'm tracking
00223         }
00224         m_iTrackingState = iState;
00225     }
00226 }
00227
00229 // Toggle state from home state to button-tracking and back
00230 //
00231 void CCJMenuBar::ToggleTrackButtonMode()
00232 {
00233     ASSERT_VALID(this);
00234     if (m_iTrackingState == TRACK_NONE || m_iTrackingState == TRACK_BUTTON) {
00235         SetTrackingState(m_iTrackingState == TRACK_NONE ?
00236             TRACK_BUTTON : TRACK_NONE, 0);
00237     }
00238 }
00239
00241 // Get button index before/after a given button
00242 //
00243 int CCJMenuBar::GetNextOrPrevButton(int iButton, BOOL bPrev)
00244 {
00245     ASSERT_VALID(this);
00246     if (bPrev) {
00247         iButton--;
00248         if (iButton <0)
00249             iButton = GetButtonCount() - 1;
00250     } else {
00251         iButton++;
00252         if (iButton >= GetButtonCount())
00253             iButton = 0;
00254     }
00255     return iButton;
00256 }
00257
00259 // This is to correct a bug in the system toolbar control: TB_HITTEST only
00260 // looks at the buttons, not the size of the window. So it returns a button
00261 // hit even if that button is totally outside the size of the window!
00262 //
00263 int CCJMenuBar::HitTest(CPoint p) const
00264 {
00265     int iHit = CCJToolBar::HitTest(p);
00266     if (iHit>0) {
00267         CRect rc;
00268         GetClientRect(&rc);
00269         if (!rc.PtInRect(p)) // if point is outside window
00270             iHit = -1;          // can't be a hit!
00271     }
00272     return iHit;
00273 }
00274
00276 // Load menu from resource
00277 //
00278
00279 BOOL CCJMenuBar::LoadMenu(UINT nID)
00280 {
00281     CFrameWnd* pFrame = GetParentFrame();
00282     ASSERT_VALID(pFrame);
00283
00284     pFrame->GetMenu()->DestroyMenu();
00285     pFrame->SetMenu(NULL);
00286
00287     CMenu menu;
00288     menu.LoadMenu(nID);
00289     m_nMenuID = nID;
00290
00291     // delete existing buttons
00292     int nCount = GetButtonCount();
00293     while (nCount--) {
00294         VERIFY(DeleteButton(0));
00295     }
00296
00297     DWORD dwStyle = GetStyle();
00298     BOOL bModifyStyle = ModifyStyle(0, TBSTYLE_FLAT|TBSTYLE_TRANSPARENT);
00299
00300     SetImageList(NULL);
00301     UINT nMenuItems = menu.GetMenuItemCount();
00302
00303     for( UINT i = 0; i < nMenuItems; i++ )
00304     {
00305         CString strName;
00306         if( menu.GetMenuString(i, strName, MF_BYPOSITION ))
00307         {
00308             TBBUTTON tbb;
00309             memset( &tbb, 0, sizeof( TBBUTTON ));
00310             tbb.idCommand = menu.GetMenuItemID(i);
00311
00312             // Because the toolbar is too brain-damaged to know if it already has
00313             // a string, and is also too brain-dead to even let you delete strings,
00314             // I have to determine if each string has been added already. Otherwise
00315             // in a MDI app, as the menus are repeatedly switched between doc and
00316             // no-doc menus, I will keep adding strings until somebody runs out of
00317             // memory. Sheesh!
00318             //
00319             int iString = -1;
00320             for (int j=0; j<m_arStrings.GetSize(); j++) {
00321                 if (m_arStrings[j] == strName) {
00322                     iString = j; // found it
00323                     break;
00324                 }
00325             }
00326             if (iString <0) {
00327                 // string not found: add it
00328                 iString = AddStrings(strName);
00329                 m_arStrings.SetAtGrow(iString, strName);
00330             }
00331
00332             tbb.iString = iString;
00333             tbb.fsState = TBSTATE_ENABLED;
00334             tbb.fsStyle = TBSTYLE_AUTOSIZE;
00335             tbb.iBitmap = -1;
00336             tbb.idCommand = i;
00337             VERIFY(AddButtons(1, &tbb));
00338         }
00339     }
00340
00341     if( bModifyStyle ) {
00342         SetWindowLong(m_hWnd, GWL_STYLE, dwStyle);
00343     }
00344
00345     if( ::IsMenu( menu )) {
00346         AutoSize();                              // size buttons
00347         RecomputeToolbarSize();              // and menubar itself
00348     }
00349
00350     menu.DestroyMenu();
00351     return TRUE;
00352 }
00353
00355 // Handle mouse click: if clicked on button, press it
00356 // and go into main menu loop.
00357 //
00358 void CCJMenuBar::OnLButtonDown(UINT nFlags, CPoint pt)
00359 {
00360     ASSERT_VALID(this);
00361     int iButton = HitTest(pt);
00362     if (iButton >= 0 && iButton<GetButtonCount()) // if mouse is over a button:
00363         TrackPopup(iButton);                                 //   track it
00364     else                                                         // otherwise:
00365         CCJToolBar::OnLButtonDown(nFlags, pt);   //   pass it on...
00366 }
00367
00369 // Handle mouse movement
00370 //
00371 void CCJMenuBar::OnMouseMove(UINT nFlags, CPoint pt)
00372 {
00373     ASSERT_VALID(this);
00374
00375     if (m_iTrackingState==TRACK_BUTTON) {
00376
00377         // In button-tracking state, ignore mouse-over to non-button area.
00378         // Normally, the toolbar would de-select the hot item in this case.
00379         //
00380         // Only change the hot item if the mouse has actually moved.
00381         // This is necessary to avoid a bug where the user moves to a different
00382         // button from the one the mouse is over, and presses arrow-down to get
00383         // the menu, then Esc to cancel it. Without this code, the button will
00384         // jump to wherever the mouse is--not right.
00385
00386         int iHot = HitTest(pt);
00387         if (IsValidButton(iHot) && pt != m_ptMouse)
00388             SetHotItem(iHot);
00389         return;          // don't let toolbar get it
00390     }
00391     m_ptMouse = pt; // remember point
00392     CCJToolBar::OnMouseMove(nFlags, pt);
00393 }
00394
00396 // Window was resized: need to recompute layout
00397 //
00398 void CCJMenuBar::OnSize(UINT nType, int cx, int cy)
00399 {
00400     CCJToolBar::OnSize(nType, cx, cy);
00401     RecomputeMenuLayout();
00402 }
00403
00405 // Bar style changed: eg, moved from left to right dock or floating
00406 //
00407 void CCJMenuBar::OnBarStyleChange(DWORD dwOldStyle, DWORD dwNewStyle)
00408 {
00409     CCJToolBar::OnBarStyleChange(dwOldStyle, dwNewStyle);
00410     RecomputeMenuLayout();
00411 }
00412
00414 // When user selects a new menu item, note whether it has a submenu
00415 // and/or parent menu, so I know whether right/left arrow should
00416 // move to the next popup.
00417 //
00418 void CCJMenuBar::OnMenuSelect(HMENU hmenu, UINT iItem)
00419 {
00420     if (m_iTrackingState > 0) {
00421         // process right-arrow if item is NOT a submenu
00422         m_bProcessRightArrow = (::GetSubMenu(hmenu, iItem) == NULL);
00423         // process left-arrow if curent menu is one I'm tracking
00424         m_bProcessLeftArrow = TRUE;
00425     }
00426 }
00427
00428 // globals--yuk! But no other way using windows hooks.
00429 //
00430 static CCJMenuBar*  g_pMenuBar = NULL;
00431 static HHOOK        g_hMsgHook = NULL;
00432
00434 // Menu filter hook just passes to virtual CCJMenuBar function
00435 //
00436 LRESULT CALLBACK
00437 CCJMenuBar::MenuInputFilter(int code, WPARAM wp, LPARAM lp)
00438 {
00439     return (code==MSGF_MENU && g_pMenuBar &&
00440         g_pMenuBar->OnMenuInput(*((MSG*)lp))) ? TRUE
00441         : CallNextHookEx(g_hMsgHook, code, wp, lp);
00442 }
00443
00445 // Handle menu input event: Look for left/right to change popup menu,
00446 // mouse movement over over a different menu button for "hot" popup effect.
00447 // Returns TRUE if message handled (to eat it).
00448 //
00449 BOOL CCJMenuBar::OnMenuInput(MSG& m)
00450 {
00451     ASSERT_VALID(this);
00452     ASSERT(m_iTrackingState == TRACK_POPUP); // sanity check
00453     int msg = m.message;
00454
00455     if (msg==WM_KEYDOWN) {
00456         // handle left/right-arow.
00457         TCHAR vkey = static_cast<TCHAR>(m.wParam);
00458
00459         if ((vkey == VK_LEFT  && m_bProcessLeftArrow) ||
00460             (vkey == VK_RIGHT && m_bProcessRightArrow)) {
00461
00462             CancelMenuAndTrackNewOne(
00463                 GetNextOrPrevButton(m_iPopupTracking, vkey==VK_LEFT));
00464             return TRUE; // eat it
00465
00466         } else if (vkey == VK_ESCAPE) {
00467             m_bEscapeWasPressed = TRUE;  // (menu will abort itself)
00468         }
00469
00470     } else if (msg==WM_MOUSEMOVE || msg==WM_LBUTTONDOWN) {
00471         // handle mouse move or click
00472         CPoint pt = m.lParam;
00473         ScreenToClient(&pt);
00474
00475         if (msg == WM_MOUSEMOVE) {
00476             if (pt != m_ptMouse) {
00477                 int iButton = HitTest(pt);
00478                 if (IsValidButton(iButton) && iButton != m_iPopupTracking) {
00479                     // user moved mouse over a different button: track its popup
00480                     CancelMenuAndTrackNewOne(iButton);
00481                 }
00482                 m_ptMouse = pt;
00483             }
00484
00485         } else if (msg == WM_LBUTTONDOWN) {
00486             if (HitTest(pt) == m_iPopupTracking) {
00487                 // user clicked on same button I am tracking: cancel menu
00488                 CancelMenuAndTrackNewOne(-1);
00489                 return TRUE; // eat it
00490             }
00491         }
00492     }
00493     return FALSE; // not handled
00494 }
00495
00497 // Cancel the current popup menu by posting WM_CANCELMODE, and track a new
00498 // menu. iNewPopup is which new popup to track (-1 to quit).
00499 //
00500 void CCJMenuBar::CancelMenuAndTrackNewOne(int iNewPopup)
00501 {
00502     ASSERT_VALID(this);
00503     if (iNewPopup != m_iPopupTracking) {
00504         GetParentFrame()->PostMessage(WM_CANCELMODE); // quit menu loop
00505         m_iNewPopup = iNewPopup;                     // go to this popup (-1 = quit)
00506     }
00507 }
00508
00510 // Track the popup submenu associated with the i'th button in the menu bar.
00511 // This fn actually goes into a loop, tracking different menus until the user
00512 // selects a command or exits the menu.
00513 //
00514 void CCJMenuBar::TrackPopup(int iButton)
00515 {
00516     ASSERT_VALID(this);
00517
00518     m_popupMenu.LoadMenu(m_nMenuID);
00519     m_popupMenu.LoadToolbar(m_nMenuID);
00520     ASSERT(::IsMenu(m_popupMenu));
00521
00522     while (iButton >= 0) {                   // while user selects another menu
00523
00524         m_iNewPopup = -1;                        // assume quit after this
00525         PressButton(iButton, TRUE);      // press the button
00526         UpdateWindow();                      // and force repaint now
00527
00528         // post a simulated arrow-down into the message stream
00529         // so TrackPopupMenu will read it and move to the first item
00530         GetParentFrame()->PostMessage(WM_KEYDOWN, VK_DOWN, 1);
00531         GetParentFrame()->PostMessage(WM_KEYUP, VK_DOWN, 1);
00532
00533         SetTrackingState(TRACK_POPUP, iButton); // enter tracking state
00534
00535         // Need to install a hook to trap menu input in order to make
00536         // left/right-arrow keys and "hot" mouse tracking work.
00537         //
00538         ASSERT(g_pMenuBar == NULL);
00539         g_pMenuBar = this;
00540         ASSERT(g_hMsgHook == NULL);
00541         g_hMsgHook = SetWindowsHookEx(WH_MSGFILTER,
00542             MenuInputFilter, NULL, ::GetCurrentThreadId());
00543
00544         // get submenu and display it beneath button
00545         TPMPARAMS tpm;
00546         CRect rcButton;
00547         GetRect(iButton, rcButton);
00548         ClientToScreen(&rcButton);
00549         CPoint pt = ComputeMenuTrackPoint(rcButton, tpm);
00550
00551         CCJMenu* pPopupMenu = (CCJMenu*)m_popupMenu.GetSubMenu(iButton);
00552         pPopupMenu->TrackPopupMenu( TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_VERTICAL,
00553             pt.x, pt.y, GetParentFrame());
00554
00555         // uninstall hook.
00556         ::UnhookWindowsHookEx(g_hMsgHook);
00557         g_hMsgHook = NULL;
00558         g_pMenuBar = NULL;
00559
00560         PressButton(iButton, FALSE);     // un-press button
00561         UpdateWindow();                  // and force repaint now
00562
00563         // If the user exited the menu loop by pressing Escape,
00564         // return to track-button state; otherwise normal non-tracking state.
00565         SetTrackingState(m_bEscapeWasPressed ?
00566             TRACK_BUTTON : TRACK_NONE, iButton);
00567
00568         // If the user moved mouse to a new top-level popup (eg from File to
00569         // Edit button), I will have posted a WM_CANCELMODE to quit
00570         // the first popup, and set m_iNewPopup to the new menu to show.
00571         // Otherwise, m_iNewPopup will be -1 as set above.
00572         // So just set iButton to the next popup menu and keep looping...
00573         iButton = m_iNewPopup;
00574     }
00575
00576     // fix potential resource leak - KStowell - 10-15-99
00577     m_popupMenu.DestroyMenu();
00578 }
00579
00581 // Given button rectangle, compute point and "exclude rect" for
00582 // TrackPopupMenu, based on current docking style, so that the menu will
00583 // appear always inside the window.
00584 //
00585 CPoint CCJMenuBar::ComputeMenuTrackPoint(const CRect& rcButn, TPMPARAMS& tpm)
00586 {
00587     tpm.cbSize = sizeof(tpm);
00588     DWORD dwStyle = m_dwStyle;
00589     CPoint pt;
00590     CRect& rcExclude = (CRect&)tpm.rcExclude;
00591     rcExclude = rcButn;
00592     ::GetWindowRect(::GetDesktopWindow(), &rcExclude);
00593
00594     switch (dwStyle & CBRS_ALIGN_ANY) {
00595     case CBRS_ALIGN_BOTTOM:
00596         pt = CPoint(rcButn.left, rcButn.top);
00597         rcExclude.top = rcButn.top;
00598         break;
00599
00600     case CBRS_ALIGN_LEFT:
00601         pt = CPoint(rcButn.right, rcButn.top);
00602         rcExclude.right = rcButn.right;
00603         break;
00604
00605     case CBRS_ALIGN_RIGHT:
00606         pt = CPoint(rcButn.left, rcButn.top);
00607         rcExclude.left = rcButn.left;
00608         break;
00609
00610     default: // case CBRS_ALIGN_TOP:
00611         pt = CPoint(rcButn.left, rcButn.bottom);
00612         break;
00613     }
00614     return pt;
00615 }
00616
00618 // This function translates special menu keys and mouse actions.
00619 // You must call it from your frame's PreTranslateMessage.
00620 //
00621 BOOL CCJMenuBar::TranslateFrameMessage(MSG* pMsg)
00622 {
00623     ASSERT_VALID(this);
00624     ASSERT(pMsg);
00625     UINT msg = pMsg->message;
00626     if (WM_LBUTTONDOWN <= msg && msg <= WM_MOUSELAST) {
00627         if (pMsg->hwnd != m_hWnd && m_iTrackingState > 0) {
00628             // user clicked outside menu bar: exit tracking mode
00629             SetTrackingState(TRACK_NONE);
00630         }
00631
00632     } else if (msg==WM_SYSKEYDOWN || msg==WM_SYSKEYUP || msg==WM_KEYDOWN) {
00633
00634         TCHAR vkey = static_cast<TCHAR>(pMsg->wParam);  // get virt key
00635
00636         BOOL  bAlt = HIWORD(pMsg->lParam) & KF_ALTDOWN;     // Alt key down
00637
00638         if (vkey==VK_MENU ||
00639             (vkey==VK_F10 && !((GetKeyState(VK_SHIFT) & 0x80000000) ||
00640                                (GetKeyState(VK_CONTROL) & 0x80000000) || bAlt))) {
00641
00642             // key is VK_MENU or F10 with no alt/ctrl/shift: toggle menu mode
00643             if (msg==WM_SYSKEYUP) {
00644                 ToggleTrackButtonMode();
00645             }
00646             return TRUE;
00647
00648         } else if ((msg==WM_SYSKEYDOWN || msg==WM_KEYDOWN)) {
00649             if (m_iTrackingState == TRACK_BUTTON) {
00650                 // I am tracking: handle left/right/up/down/space/Esc
00651                 switch (vkey) {
00652                 case VK_LEFT:
00653                 case VK_RIGHT:
00654                     // left or right-arrow: change hot button if tracking buttons
00655                     SetHotItem(GetNextOrPrevButton(GetHotItem(), vkey==VK_LEFT));
00656                     return TRUE;
00657
00658                 case VK_SPACE:  // (personally, I like SPACE to enter menu too)
00659                 case VK_UP:
00660                 case VK_DOWN:
00661                     // up or down-arrow: move into current menu, if any
00662                     TrackPopup(GetHotItem());
00663                     return TRUE;
00664
00665                 case VK_ESCAPE:
00666                     // escape key: exit tracking mode
00667                     SetTrackingState(TRACK_NONE);
00668                     return TRUE;
00669                 }
00670             }
00671
00672             // Handle alphanumeric key: invoke menu. Note that Alt-X
00673             // chars come through as WM_SYSKEYDOWN, plain X as WM_KEYDOWN.
00674             if ((bAlt || m_iTrackingState == TRACK_BUTTON) && isalnum(vkey)) {
00675                 // Alt-X, or else X while in tracking mode
00676                 UINT nID;
00677                 if (MapAccelerator(vkey, nID)) {
00678                     TrackPopup(nID);     // found menu mnemonic: track it
00679                     return TRUE;         // handled
00680                 } else if (m_iTrackingState==TRACK_BUTTON && !bAlt) {
00681                     MessageBeep(0);
00682                     return TRUE;
00683                 }
00684             }
00685
00686             // Default for any key not handled so far: return to no-menu state
00687             if (m_iTrackingState > 0) {
00688                 SetTrackingState(TRACK_NONE);
00689             }
00690         }
00691     }
00692     return FALSE; // not handled, pass along
00693 }
00694
00695 #ifdef _DEBUG
00696 void CCJMenuBar::AssertValid() const
00697 {
00698     CCJToolBar::AssertValid();
00699     ASSERT(TRACK_NONE<=m_iTrackingState && m_iTrackingState<=TRACK_POPUP);
00700     m_frameHook.AssertValid();
00701 }
00702
00703 void CCJMenuBar::Dump(CDumpContext& dc) const
00704 {
00705     CCJToolBar::Dump(dc);
00706 }
00707 #endif
00708
00710 // CCJMenuBarFrameHook is used to trap menu-related messages sent to the owning
00711 // frame. The same class is also used to trap messages sent to the MDI client
00712 // window in an MDI app. I should really use two classes for this,
00713 // but it uses less code to chare the same class. Note however: there
00714 // are two different INSTANCES of CCJMenuBarFrameHook in CCJMenuBar: one for
00715 // the frame and one for the MDI client window.
00716 //
00717 CCJMenuBarFrameHook::CCJMenuBarFrameHook()
00718 {
00719 }
00720
00721 CCJMenuBarFrameHook::~CCJMenuBarFrameHook()
00722 {
00723     HookWindow((HWND)NULL); // (unhook)
00724 }
00725
00727 // Install hook to trap window messages sent to frame or MDI client.
00728 //
00729 BOOL CCJMenuBarFrameHook::Install(CCJMenuBar* pMenuBar, HWND hWndToHook)
00730 {
00731     ASSERT_VALID(pMenuBar);
00732     m_pMenuBar = pMenuBar;
00733     return HookWindow(hWndToHook);
00734 }
00735
00737 // Trap frame/MDI client messages specific to menubar.
00738 //
00739 LRESULT CCJMenuBarFrameHook::WindowProc(UINT msg, WPARAM wp, LPARAM lp)
00740 {
00741     CCJMenuBar& mb = *m_pMenuBar;
00742
00743     switch (msg) {
00744     // The following messages are trapped for the frame window
00745     case WM_SYSCOLORCHANGE:
00746         mb.UpdateFont();
00747         break;
00748
00749     case WM_MENUSELECT:
00750         mb.OnMenuSelect((HMENU)lp, (UINT)LOWORD(wp));
00751         break;
00752     }
00753     return CSubclassWnd::WindowProc(msg, wp, lp);
00754 }
Generated on Sun Feb 24 01:21:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJMetaFileButton.cpp Source File

WinCvs/CJLib/CJLibrary/CJMetaFileButton.cpp

Go to the documentation of this file.
00001 // CJMetaFileButton.cpp : implementation file
00002 //
00003 // Copyright © 1999 Ian Brumby
00004 //
00005 // This source code may be used in compiled form in any way you desire.
00006 // Source file(s) may be redistributed unmodified by any means PROVIDING
00007 // they are not sold for profit without the authors expressed written consent,
00008 // and providing that this notice and the authors name and all copyright
00009 // notices remain intact.
00010 //
00011 // ==========================================================================
00012 // HISTORY:
00013 // ==========================================================================
00014 //          1.20    21 Apr 1999 - Initial release.
00015 // ==========================================================================
00017 /****************************************************************************
00018  *
00019  * $Date: 1999/11/30 21:45:49 $
00020  * $Revision: 1.1.1.2 $
00021  * $Archive: /CodeJock/CJLibrary/CJMetaFileButton.cpp $
00022  *
00023  * $History: CJMetaFileButton.cpp $
00024  *
00025  * *****************  Version 6  *****************
00026  * User: Kirk Stowell Date: 10/31/99   Time: 11:04p
00027  * Updated in $/CodeJock/CJLibrary
00028  * Overrode OnEraseBkgnd(...) and OnPaint() for flicker free drawing.
00029  *
00030  * *****************  Version 5  *****************
00031  * User: Kirk Stowell Date: 10/25/99   Time: 10:52p
00032  * Updated in $/CodeJock/CJLibrary
00033  * Modified resource include for static builds.
00034  *
00035  * *****************  Version 4  *****************
00036  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00037  * Updated in $/CodeJock/CJLibrary
00038  * Fixed potential resource and memory leak problems.
00039  *
00040  * *****************  Version 3  *****************
00041  * User: Kirk Stowell Date: 10/14/99   Time: 12:41p
00042  * Updated in $/CodeJock/CJLibrary
00043  * Added source control history to file header.
00044  *
00045  ***************************************************************************/
00047
00048 #include "stdafx.h"
00049 #include "CJResource.h"
00050 #include "CJMetaFileButton.h"
00051
00052 #ifdef _DEBUG
00053 #define new DEBUG_NEW
00054 #undef THIS_FILE
00055 static char THIS_FILE[] = __FILE__;
00056 #endif
00057
00059 // CCJMetaFileButton
00060
00061 CCJMetaFileButton::CCJMetaFileButton()
00062 {
00063 }
00064
00065 CCJMetaFileButton::~CCJMetaFileButton()
00066 {
00067 }
00068
00069 void CCJMetaFileButton::SetMetaFiles(HENHMETAFILE hMetaFile,
00070     HENHMETAFILE hMetaFileSel, HENHMETAFILE hMetaFileFocus, HENHMETAFILE hMetaFileDisabled)
00071 {
00072     m_hEnhMetaFile         = hMetaFile;
00073     m_hEnhMetaFileSel      = hMetaFileSel;
00074     m_hEnhMetaFileFocus    = hMetaFileFocus;
00075     m_hEnhMetaFileDisabled = hMetaFileDisabled;
00076 }
00077
00078
00079 BEGIN_MESSAGE_MAP(CCJMetaFileButton, CButton)
00080     //{{AFX_MSG_MAP(CCJMetaFileButton)
00081     ON_WM_LBUTTONDBLCLK()
00082     ON_WM_ERASEBKGND()
00083     ON_WM_PAINT()
00084     //}}AFX_MSG_MAP
00085 END_MESSAGE_MAP()
00086
00088 // CCJMetaFileButton message handlers
00089
00090 void CCJMetaFileButton::OnLButtonDblClk(UINT nFlags, CPoint point)
00091 {
00092     // Fix for the double click problem with owner drawn buttons
00093     POINT pt;
00094     ::GetCursorPos(&pt);
00095     ::MapWindowPoints(NULL, (HWND)(m_hWnd), &pt, 1);
00096     ::SendMessage((HWND)(m_hWnd), WM_LBUTTONDOWN, 0, MAKELPARAM(pt.x, pt.y));
00097     CButton::OnLButtonDblClk(nFlags, point);
00098 }
00099
00100 void CCJMetaFileButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
00101 {
00102     ASSERT(lpDrawItemStruct != NULL);
00103
00104     // define some temporary variables.
00105     CDC*  pDC    = CDC::FromHandle( lpDrawItemStruct->hDC );
00106     CRect rcItem = lpDrawItemStruct->rcItem;
00107     int   nState = lpDrawItemStruct->itemState;
00108
00109     // Paint the background.
00110     pDC->FillSolidRect(rcItem, ::GetSysColor(COLOR_3DFACE));
00111
00112     // draw 3D button outline
00113     CPen penOutline(PS_SOLID, 1, GetSysColor(COLOR_BTNTEXT));
00114     CPen penLight(PS_SOLID, 1, GetSysColor(COLOR_BTNHIGHLIGHT));
00115     CPen penDark(PS_SOLID, 1, GetSysColor(COLOR_BTNSHADOW));
00116     CPen* pOldPen = NULL;
00117
00118     if (nState & ODS_SELECTED)
00119     {
00120         pOldPen = pDC->SelectObject(&penDark);
00121         pDC->MoveTo(0, rcItem.bottom - 1);
00122         pDC->LineTo(0, 1);
00123         pDC->LineTo(rcItem.right - 1, 1);
00124     }
00125     else
00126     {
00127         pOldPen = pDC->SelectObject(&penLight);
00128         pDC->MoveTo(0, rcItem.bottom - 2);
00129         pDC->LineTo(0, 1);
00130         pDC->LineTo(rcItem.right - 2, 1);
00131         pDC->SelectObject(&penDark);
00132         pDC->MoveTo(0, rcItem.bottom - 1);
00133         pDC->LineTo(rcItem.right - 2, rcItem.bottom - 1);
00134         pDC->LineTo(rcItem.right - 2, 0);
00135         pDC->MoveTo(1, rcItem.bottom - 2);
00136         pDC->LineTo(rcItem.right - 3, rcItem.bottom - 2);
00137         pDC->LineTo(rcItem.right - 3, 1);
00138     }
00139     pDC->SelectObject(&penOutline);
00140     pDC->MoveTo(0, 0);
00141     pDC->LineTo(rcItem.right - 1, 0);
00142     pDC->LineTo(rcItem.right - 1, rcItem.bottom);
00143
00144     HENHMETAFILE hMetaFile = m_hEnhMetaFile;
00145     if ((nState & ODS_SELECTED) && m_hEnhMetaFileSel != NULL)
00146         hMetaFile = m_hEnhMetaFileSel;
00147     else if ((nState & ODS_FOCUS) && m_hEnhMetaFileFocus != NULL)
00148         hMetaFile = m_hEnhMetaFileFocus;   // third image for focused
00149     else if ((nState & ODS_DISABLED) && m_hEnhMetaFileDisabled != NULL)
00150         hMetaFile = m_hEnhMetaFileDisabled;   // last image for disabled
00151
00152     ASSERT(hMetaFile != NULL);
00153
00154     CRect rcBounds(5,4,0,0);
00155     int iButtonHeight = rcItem.Height();
00156     if (iButtonHeight > 15)
00157         iButtonHeight = 15;
00158     else if (iButtonHeight < 11)
00159         iButtonHeight = 11;
00160     int iArrowWidth = (iButtonHeight / 2) - 3;
00161     rcBounds.right = rcBounds.left + iArrowWidth - 1;
00162     rcBounds.bottom = rcBounds.top + (iArrowWidth * 2) - 2;
00163
00164     if (nState & ODS_SELECTED)
00165         rcBounds += CPoint(1, 1);
00166     pDC->PlayMetaFile(hMetaFile, rcBounds);
00167
00168     // fix potential resource leak - KStowell - 10-21-99
00169     pDC->SelectObject(pOldPen);
00170     penOutline.DeleteObject();
00171     penLight.DeleteObject();
00172     penDark.DeleteObject();
00173 }
00174
00175 BOOL CCJMetaFileButton::OnEraseBkgnd(CDC* pDC)
00176 {
00177     // KStowell - overridden for flicker-free drawing.
00178     UNUSED_ALWAYS(pDC);
00179     return TRUE;
00180 }
00181
00182 void CCJMetaFileButton::OnPaint()
00183 {
00184     CPaintDC dc(this); // device context for painting
00185
00186     // KStowell - Get the client rect.
00187     CRect rcClient, rcClip;
00188     dc.GetClipBox( &rcClip );
00189     GetClientRect( &rcClient );
00190
00191     // KStowell - Create a memory device-context. This is done to help reduce
00192     // screen flicker, since we will paint the entire control to the
00193     // off screen device context first.
00194     CDC memDC;
00195     CBitmap bitmap;
00196     memDC.CreateCompatibleDC(&dc);
00197     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00198     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00199
00200     // KStowell - Repaint the background.
00201     memDC.FillSolidRect( rcClient, ::GetSysColor(COLOR_WINDOW) );
00202
00203     // let the control do its default drawing.
00204     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00205
00206     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00207     dc.BitBlt( rcClip.left, rcClip.top, rcClip.Width(), rcClip.Height(), &memDC,
00208         rcClip.left, rcClip.top, SRCCOPY );
00209
00210     // KStowell - Cleanup resources.
00211     memDC.SelectObject(pOldBitmap);
00212     memDC.DeleteDC();
00213     bitmap.DeleteObject();
00214 }
Generated on Sun Feb 24 01:21:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJMiniDockFrameWnd.cpp Source File

WinCvs/CJLib/CJLibrary/CJMiniDockFrameWnd.cpp

Go to the documentation of this file.
00001 // CJMiniDockFrameWnd.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJockey/CJLibrary/CJMiniDockFrameWnd.cpp $
00011  *
00012  * $History: CJMiniDockFrameWnd.cpp $
00013  *
00014  * *****************  Version 7  *****************
00015  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00016  * Updated in $/CodeJockey/CJLibrary
00017  * Updated copyright and contact information.
00018  *
00019  * *****************  Version 6  *****************
00020  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00021  * Updated in $/CodeJockey/CJLibrary
00022  *
00023  * *****************  Version 5  *****************
00024  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00025  * Updated in $/CodeJockey/CJLibrary
00026  *
00027  * *****************  Version 4  *****************
00028  * User: Kirk Stowell Date: 6/09/99    Time: 8:33p
00029  * Updated in $/CodeJockey/CJ60Lib
00030  * Ioannhs Stamatopoulos (Yiannhs) [ystamat@mail.datamedia.gr] - Extended
00031  * docking windows, removed ::GetSysColor(...) calls and WM_SYSCOLORCHANGE
00032  * message handler, this is now automatically handled by the base class.
00033  * Added redraw flags to the create method and modified paint and layout
00034  * handlers to reduce flicker and un-necessary command handling. Dragging
00035  * rect now reflects actual control bar docked size. Added "flat" look to
00036  * the control bars, the control bars can now use the classic DevStudio
00037  * look, or use flat gradient gripper, borders and frame buttons. Overall,
00038  * docking windows now handle dragging, docking and floating much better,
00039  * and behave more like DevStudio.
00040  *
00041  * *****************  Version 3  *****************
00042  * User: Kirk Stowell Date: 4/14/99    Time: 10:40p
00043  * Updated in $/CodeJockey/CJ60Lib
00044  * Daniel Harth [danielh@mail.matco.ro] - Added support for diagonal
00045  * sizing.
00046  *
00047  * *****************  Version 2  *****************
00048  * User: Kirk Stowell Date: 4/03/99    Time: 10:39p
00049  * Updated in $/CodeJockey/CJ60Lib
00050  * Added comments and cleaned up code.
00051  *
00052  * *****************  Version 1  *****************
00053  * User: Kirk Stowell Date: 1/16/99    Time: 10:39p
00054  * Created in $/CodeJockey/CJ60Lib
00055  * Initial release.
00056  *
00057  ***************************************************************************/
00059
00060 #include "stdafx.h"
00061 #include "CJMiniDockFrameWnd.h"
00062 #include "CJDockContext.h"
00063 #include "CJSizeDockBar.h"
00064 #include "CJControlBar.h"
00065
00066 #ifdef _DEBUG
00067 #define new DEBUG_NEW
00068 #undef THIS_FILE
00069 static char THIS_FILE[] = __FILE__;
00070 #endif
00071
00073 // CCJMiniDockFrameWnd
00074
00075 CCJMiniDockFrameWnd::CCJMiniDockFrameWnd()
00076 {
00077     // TODO: add construction code here.
00078 }
00079
00080 CCJMiniDockFrameWnd::~CCJMiniDockFrameWnd()
00081 {
00082     // TODO: add destruction code here.
00083 }
00084
00085 IMPLEMENT_DYNCREATE(CCJMiniDockFrameWnd, CMiniDockFrameWnd)
00086
00087 BEGIN_MESSAGE_MAP(CCJMiniDockFrameWnd, CMiniDockFrameWnd)
00088     //{{AFX_MSG_MAP(CCJMiniDockFrameWnd)
00089     ON_WM_NCLBUTTONDOWN()
00090     ON_WM_NCLBUTTONDBLCLK()
00091     ON_WM_ERASEBKGND()
00092     ON_WM_MBUTTONDBLCLK()
00093     //}}AFX_MSG_MAP
00094 END_MESSAGE_MAP()
00095
00097 // CCJMiniDockFrameWnd message handlers
00098
00099 void CCJMiniDockFrameWnd::OnNcLButtonDown(UINT nHitTest, CPoint point)
00100 {
00101     CCJSizeDockBar *pSizeBar = (CCJSizeDockBar*)&m_wndDockBar;
00102
00103     if (nHitTest == HTCAPTION)
00104     {
00105         ActivateTopParent();
00106         if ((m_wndDockBar.m_dwStyle & CBRS_FLOAT_MULTI) == 0)
00107         {
00108             int nPos = 1;
00109             CControlBar* pBar = NULL;
00110             while(pBar == NULL && nPos < m_wndDockBar.m_arrBars.GetSize())
00111                 pBar = pSizeBar->GetDockedSizeBar(nPos++);
00112             ASSERT(pBar != NULL);
00113             ASSERT_KINDOF(CControlBar, pBar);
00114             ASSERT(pBar->m_pDockContext != NULL);
00115
00116             if (!pBar->IsKindOf(RUNTIME_CLASS(CCJControlBar))) {
00117                 CMiniDockFrameWnd::OnNcLButtonDown(nHitTest,point);
00118                 return;
00119             }
00120
00121             //Yiannhs: This has to be fixed!! when the bar is floating
00122             //         and is over a visible dockbar, it arranges it inside
00123             //         the dock bar and does not drag, by just clicking on the caption
00124             ((CCJDockContext *)pBar->m_pDockContext)->StartDragDockBar(point);
00125             pBar->SetFocus();
00126             return;
00127         }
00128     }
00129
00130     else if (nHitTest >= HTSIZEFIRST && nHitTest <= HTSIZELAST)
00131     {
00132         ActivateTopParent();
00133         int nPos = 1;
00134         CControlBar* pBar = NULL;
00135         while(pBar == NULL && nPos < m_wndDockBar.m_arrBars.GetSize())
00136             pBar = pSizeBar->GetDockedSizeBar(nPos++);
00137
00138         ASSERT(pBar != NULL);
00139         ASSERT_KINDOF(CControlBar, pBar);
00140         ASSERT(pBar->m_pDockContext != NULL);
00141         ASSERT((m_wndDockBar.m_dwStyle & CBRS_FLOAT_MULTI) == 0);
00142
00143         if (!pBar->IsKindOf(RUNTIME_CLASS(CCJControlBar))) {
00144             CMiniDockFrameWnd::OnNcLButtonDown(nHitTest,point);
00145             return;
00146         }
00147
00148         pBar->m_pDockContext->StartResize(nHitTest, point);
00149         return;
00150     }
00151
00152     else {  //Yiannhs
00153         CMiniFrameWnd::OnNcLButtonDown(nHitTest, point);
00154     }
00155 }
00156
00157 void CCJMiniDockFrameWnd::OnNcLButtonDblClk(UINT nHitTest, CPoint /*point*/)
00158 {
00159     if (nHitTest == HTCAPTION)
00160     {
00161         ActivateTopParent();
00162         CCJSizeDockBar * m_pSizeBar = (CCJSizeDockBar *)&m_wndDockBar;
00163
00164         if ((m_pSizeBar->m_dwStyle & CBRS_FLOAT_MULTI) == 0)
00165         {
00166             int nPos = 1;
00167             CControlBar* pBar = NULL;
00168             while(pBar == NULL && nPos < m_pSizeBar->m_arrBars.GetSize())
00169                 pBar = m_pSizeBar->GetDockedSizeBar(nPos++);
00170
00171             ASSERT(pBar != NULL);
00172             ASSERT_KINDOF(CControlBar, pBar);
00173             ASSERT(pBar->m_pDockContext != NULL);
00174
00175             if (pBar->IsKindOf(RUNTIME_CLASS(CCJControlBar)))
00176                 pBar->m_pDockContext->ToggleDocking();
00177
00178             return;
00179         }
00180     }
00181 }
00182
00183 BOOL CCJMiniDockFrameWnd::Create(CWnd* pParent, DWORD dwBarStyle)
00184 {
00185     // Let the base class do all the work.
00186     if (!CMiniDockFrameWnd::Create(pParent, dwBarStyle))
00187         return FALSE;
00188
00189     // remove the MFS_4THICKFRAME style to allow diagonal
00190     // resizing.
00191     ModifyStyle(MFS_4THICKFRAME, 0);
00192
00193     return TRUE;
00194 }
Generated on Sun Feb 24 01:21:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJOutlookBar.cpp Source File

WinCvs/CJLib/CJLibrary/CJOutlookBar.cpp

Go to the documentation of this file.
00001 // CJOutlookBar.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/CJLibrary/CJOutlookBar.cpp $
00011  *
00012  * $History: CJOutlookBar.cpp $
00013  *
00014  * *****************  Version 11  *****************
00015  * User: Kirk Stowell Date: 10/30/99   Time: 2:03p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Added COLORREF members to class to eliminate continuous calls to
00018  * GetSysColor(...). Overrode OnSysColorChange() to re-initialize COLORREF
00019  * variables.
00020  *
00021  * *****************  Version 10  *****************
00022  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00023  * Updated in $/CodeJock/CJLibrary
00024  * Fixed potential resource and memory leak problems.
00025  *
00026  * *****************  Version 9  *****************
00027  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00028  * Updated in $/CodeJockey/CJLibrary
00029  * Updated copyright and contact information.
00030  *
00031  * *****************  Version 8  *****************
00032  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00033  * Updated in $/CodeJockey/CJLibrary
00034  *
00035  * *****************  Version 7  *****************
00036  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00037  * Updated in $/CodeJockey/CJLibrary
00038  *
00039  * *****************  Version 6  *****************
00040  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00041  * Updated in $/CodeJockey/CJLibrary
00042  *
00043  * *****************  Version 5  *****************
00044  * User: Kirk Stowell Date: 6/14/99    Time: 10:44p
00045  * Updated in $/CodeJockey/CJ60Lib
00046  * Cleaned up code to eliminate level 4 compilier warnings.
00047  *
00048  * *****************  Version 4  *****************
00049  * User: Kirk Stowell Date: 4/03/99    Time: 10:43p
00050  * Updated in $/CodeJockey/CJ60Lib
00051  * Added comments and cleaned up code.
00052  *
00053  * *****************  Version 3  *****************
00054  * User: Kirk Stowell Date: 3/03/99    Time: 10:43p
00055  * Updated in $/CodeJockey/CJ60Lib
00056  * Changed images list's to pointer vars passed into class.
00057  *
00058  * *****************  Version 2  *****************
00059  * User: Kirk Stowell Date: 2/24/99    Time: 10:42p
00060  * Updated in $/CodeJockey/CJ60Lib
00061  * Christopher Brown (Allknowing@earthlink.net) some modifications to
00062  * correct icon resource leak, and eliminate screen flicker.
00063  *
00064  * *****************  Version 1  *****************
00065  * User: Kirk Stowell Date: 10/17/98   Time: 10:42p
00066  * Created in $/CodeJockey/CJ60Lib
00067  * Initial re-write and release.
00068  *
00069  ***************************************************************************/
00071
00072 #include "stdafx.h"
00073 #include "CJOutlookBar.h"
00074
00075 #ifdef _DEBUG
00076 #define new DEBUG_NEW
00077 #undef THIS_FILE
00078 static char THIS_FILE[] = __FILE__;
00079 #endif
00080
00082 // CCJOutlookBar
00083
00084 CCJOutlookBar::CCJOutlookBar()
00085 {
00086     m_bLBDown           = false;
00087     m_bHilight          = true;
00088     m_pImageListLarge   = NULL;
00089     m_pImageListSmall   = NULL;
00090     m_pOwner            = NULL;
00091     m_clrHilite         = ::GetSysColor(COLOR_BTNHIGHLIGHT);
00092     m_clrShadow         = ::GetSysColor(COLOR_BTNSHADOW);
00093     m_clrDkShad         = ::GetSysColor(COLOR_3DDKSHADOW);
00094     m_clrNormal         = ::GetSysColor(COLOR_BTNFACE);
00095     m_clrTextNm         = ::GetSysColor(COLOR_WINDOW);
00096
00097     UpdateFont();
00098 }
00099
00100 CCJOutlookBar::~CCJOutlookBar()
00101 {
00102     // fix potential resource leak - KStowell - 10-22-99.
00103     m_Font.DeleteObject();
00104 }
00105
00106 IMPLEMENT_DYNAMIC(CCJOutlookBar, CListBox)
00107
00108 BEGIN_MESSAGE_MAP(CCJOutlookBar, CListBox)
00109     //{{AFX_MSG_MAP(CCJOutlookBar)
00110     ON_WM_ERASEBKGND()
00111     ON_WM_LBUTTONDOWN()
00112     ON_WM_LBUTTONUP()
00113     ON_WM_MOUSEMOVE()
00114     ON_WM_TIMER()
00115     ON_WM_PAINT()
00116     ON_WM_SYSCOLORCHANGE()
00117     //}}AFX_MSG_MAP
00118 END_MESSAGE_MAP()
00119
00121 // CCJOutlookBar message handlers
00122
00123 // Checks mouse movement, sets point member, sets timer.
00124 void CCJOutlookBar::OnMouseMove(UINT nFlags, CPoint point)
00125 {
00126     m_point = point;
00127     SetTimer (1, 10, NULL);
00128     CListBox::OnMouseMove(nFlags, point);
00129 }
00130
00131 // Sets bLBDown member to true, and sets current selection
00132 void CCJOutlookBar::OnLButtonDown(UINT nFlags, CPoint point)
00133 {
00134     m_bLBDown = true;
00135     SetCurSel(GetCurSel());
00136     CListBox::OnLButtonDown(nFlags, point);
00137 }
00138
00139 // Sets bLBDown member to false, and sets current selection
00140 void CCJOutlookBar::OnLButtonUp(UINT nFlags, CPoint point)
00141 {
00142     m_bLBDown = false;
00143     int nIndex = GetCurSel();
00144     SetCurSel(nIndex);
00145
00146     ASSERT(m_pOwner);
00147     m_pOwner->SendMessage(OBN_SELENDOK, (LPARAM)nIndex, (WPARAM)GetDlgCtrlID());
00148
00149     CListBox::OnLButtonUp(nFlags, point);
00150 }
00151
00152 // Sets the hilite flag based on cursor position.
00153 void CCJOutlookBar::OnTimer(UINT /*nIDEvent*/)
00154 {
00155     BOOL   bOutSide;
00156     CRect  rItem;
00157     CRect  rWindow;
00158     CPoint pt;
00159     int    nIndex;
00160
00161     // Get the rect of the current window,
00162     // get the current cursor position.
00163     GetWindowRect (rWindow);
00164     GetCursorPos (&pt);
00165
00166     // If the mouse is in the rect of this window,
00167     // set hilite flag to true, get the item that
00168     // the mouse is over.
00169     if (rWindow.PtInRect (pt)) {
00170         m_bHilight = true;
00171         nIndex = ItemFromPoint (m_point, bOutSide);
00172
00173         if (nIndex != GetCurSel() && !bOutSide) {
00174             SetCurSel( nIndex );
00175         }
00176     }
00177
00178     // If the mouse is not in the rect of
00179     // this window, kill the timer, set hilite flag
00180     // to false, and return.
00181     else {
00182         m_bHilight = false;
00183         if( !m_bLBDown ) {
00184           SetCurSel (-1);
00185         }
00186         KillTimer(1);
00187     }
00188 }
00189
00191 // Initial draw routine, draws button on mouse over,
00192 // on mouse press, and on mouse out.
00193
00194 void CCJOutlookBar::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
00195 {
00196     CDC*            pDC = CDC::FromHandle( lpDrawItemStruct->hDC );
00197     CRect           rcItem(lpDrawItemStruct->rcItem);
00198     CRect           rClient(rcItem);
00199     CRect           rText;
00200     CPoint          Pt(((rcItem.Width() - 32) /2 ), rcItem.top + 15);
00201     CContentItems   pContents = m_pContents[ lpDrawItemStruct->itemID ];
00202     HICON           hIcon = m_pImageListLarge->ExtractIcon( pContents.GetImageID());
00203
00204     pDC->SetBkColor(m_clrShadow);
00205
00206     // deflate the client rect, and set up item and
00207     // text rect's.
00208     rClient.DeflateRect( 8, 5 );
00209     rcItem.CopyRect( rClient );
00210     rText.CopyRect( rClient );
00211     rText.top += 45;
00212     rText.bottom += 10;
00213
00214     // set the text color to white, and background mode
00215     // to transparent.
00216     pDC->SetTextColor( m_clrTextNm );
00217     pDC->SetBkMode( TRANSPARENT );
00218     CFont* pOldFont = pDC->SelectObject(&m_Font);
00219
00220     // draw the button icon and text.
00221     if( lpDrawItemStruct->itemAction& ODA_DRAWENTIRE ) {
00222         pDC->DrawIcon( Pt, hIcon );
00223         pDC->DrawText( pContents.GetText(), rText, DT_CENTER | DT_WORDBREAK );
00224     }
00225
00226     // if the left mouse button is pressed, offset
00227     // the button icon.
00228     if( m_bLBDown ) {
00229         Pt.x += 2;
00230         Pt.y += 2;
00231         rcItem.OffsetRect( 2, 2 );
00232     }
00233
00234     // deflate the button rect, and move up.
00235     rcItem.DeflateRect( 4, 16 );
00236     rcItem.top -= 8;
00237
00238     // Draw the button icon and text, if the mouse is over the
00239     // button, draw the 3d rect, either pressed,
00240     // or not pressed depending on left mouse button.
00241     if(( lpDrawItemStruct->itemState& ODS_SELECTED ) &&
00242         ( lpDrawItemStruct->itemAction& ( ODA_SELECT | ODA_DRAWENTIRE ))) {
00243
00244         rcItem.left = ( rcItem.Width()/2 )-5;
00245         rcItem.right = rcItem.left+37;
00246
00247         if( m_bHilight ) {
00248             if( m_bLBDown ) {
00249               pDC->Draw3dRect( rcItem, m_clrDkShad, m_clrNormal );
00250             } else {
00251               pDC->Draw3dRect( rcItem, m_clrNormal, m_clrDkShad );
00252             }
00253         }
00254
00255         pDC->DrawIcon( Pt, hIcon );
00256         pDC->DrawText( pContents.GetText(), rText, DT_CENTER | DT_WORDBREAK );
00257     }
00258
00259     if( !( lpDrawItemStruct->itemState& ODS_SELECTED ) &&
00260         ( lpDrawItemStruct->itemAction& ODA_SELECT )) {
00261         pDC->FillSolidRect( rClient, m_clrShadow );
00262         pDC->DrawIcon(Pt, hIcon);
00263         pDC->DrawText(pContents.GetText(), rText, DT_CENTER|DT_WORDBREAK);
00264     }
00265
00266     // To avoid ugly resource leaks that will
00267     // eventually TRASH the system, call DestroyIcon().
00268     // To reproduce bug, try resizing the window for a
00269     // good minute. Christopher Brown
00270
00271     ::DestroyIcon( hIcon );
00272     pDC->SelectObject(pOldFont);
00273 }
00274
00276 // Sets item height
00277
00278 void CCJOutlookBar::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)
00279 {
00280     lpMeasureItemStruct->itemHeight = 70;
00281 }
00282
00284 // Sets the background color.
00285
00286 BOOL CCJOutlookBar::OnEraseBkgnd(CDC* pDC)
00287 {
00288     // KStowell - overridden for flicker-free drawing.
00289     UNUSED_ALWAYS(pDC);
00290     return TRUE;
00291 }
00292
00293 void CCJOutlookBar::OnPaint()
00294 {
00295     // Christopher Brown
00296     // Use a "Offscreen" DC to fill rect and
00297     // send to DefWindowProc...
00298     CClientDC memDC(this); // Henrik E. Rasmussen
00299
00300     CRect rcClip;
00301     memDC.GetClipBox(&rcClip);
00302     memDC.FillSolidRect(rcClip, m_clrShadow);
00303     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, (LPARAM)0 );
00304
00305     // Default is called for cleanup.
00306     Default();
00307 }
00308
00309 void CCJOutlookBar::UpdateFont()
00310 {
00311     m_Font.DeleteObject();
00312     NONCLIENTMETRICS ncm;
00313     ncm.cbSize = sizeof(ncm);
00314     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00315     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00316 }
00317
00318 void CCJOutlookBar::OnSysColorChange()
00319 {
00320     CListBox::OnSysColorChange();
00321
00322     m_clrHilite = ::GetSysColor(COLOR_BTNHIGHLIGHT);
00323     m_clrShadow = ::GetSysColor(COLOR_BTNSHADOW);
00324     m_clrDkShad = ::GetSysColor(COLOR_3DDKSHADOW);
00325     m_clrNormal = ::GetSysColor(COLOR_BTNFACE);
00326     m_clrTextNm = ::GetSysColor(COLOR_WINDOW);
00327 }
Generated on Sun Feb 24 01:21:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJPagerCtrl.cpp Source File

WinCvs/CJLib/CJLibrary/CJPagerCtrl.cpp

Go to the documentation of this file.
00001 // CJPagerCtrl.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJockey/CJLibrary/CJPagerCtrl.cpp $
00011  *
00012  * $History: CJPagerCtrl.cpp $
00013  *
00014  * *****************  Version 7  *****************
00015  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00016  * Updated in $/CodeJockey/CJLibrary
00017  * Updated copyright and contact information.
00018  *
00019  * *****************  Version 6  *****************
00020  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00021  * Updated in $/CodeJockey/CJLibrary
00022  *
00023  * *****************  Version 5  *****************
00024  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00025  * Updated in $/CodeJockey/CJLibrary
00026  *
00027  * *****************  Version 4  *****************
00028  * User: Kirk Stowell Date: 6/14/99    Time: 10:44p
00029  * Updated in $/CodeJockey/CJ60Lib
00030  * Cleaned up code to eliminate level 4 compilier warnings.
00031  *
00032  * *****************  Version 3  *****************
00033  * User: Kirk Stowell Date: 4/03/99    Time: 10:45p
00034  * Updated in $/CodeJockey/CJ60Lib
00035  * Added comments and cleaned up code.
00036  *
00037  * *****************  Version 2  *****************
00038  * User: Kirk Stowell Date: 1/02/99    Time: 10:44p
00039  * Updated in $/CodeJockey/CJ60Lib
00040  * Cleaned up class source, wrapped all pager messages.
00041  *
00042  * *****************  Version 1  *****************
00043  * User: Kirk Stowell Date: 10/02/98   Time: 10:44p
00044  * Created in $/CodeJockey/CJ60Lib
00045  * First release version.
00046  *
00047  ***************************************************************************/
00049
00050 #include "stdafx.h"
00051 #include "CJPagerCtrl.h"
00052
00053 #ifdef _DEBUG
00054 #define new DEBUG_NEW
00055 #undef THIS_FILE
00056 static char THIS_FILE[] = __FILE__;
00057 #endif
00058
00060 // CCJPagerCtrl
00061
00062 CCJPagerCtrl::CCJPagerCtrl()
00063 {
00064    // initialize common controls
00065     INITCOMMONCONTROLSEX icex;
00066     icex.dwSize = sizeof(icex);
00067     icex.dwICC = ICC_PAGESCROLLER_CLASS;
00068     VERIFY(InitCommonControlsEx(&icex));
00069 }
00070
00071 CCJPagerCtrl::~CCJPagerCtrl()
00072 {
00073 }
00074
00075 IMPLEMENT_DYNAMIC(CCJPagerCtrl, CWnd)
00076
00077 BEGIN_MESSAGE_MAP(CCJPagerCtrl, CWnd)
00078     //{{AFX_MSG_MAP(CCJPagerCtrl)
00079     ON_NOTIFY_REFLECT_EX(PGN_SCROLL, OnPagerScroll)
00080     ON_NOTIFY_REFLECT_EX(PGN_CALCSIZE, OnPagerCalcSize)
00081     //}}AFX_MSG_MAP
00082 END_MESSAGE_MAP()
00083
00084 BOOL CCJPagerCtrl::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID)
00085 {
00086     CWnd* pWnd = this;
00087     return pWnd->Create(WC_PAGESCROLLER, NULL, dwStyle, rect, pParentWnd, nID);
00088 }
00089
00091 // CCJPagerCtrl message handlers
00092
00093 BOOL CCJPagerCtrl::OnPagerCalcSize(NMPGCALCSIZE* pNMPGCalcSize, LRESULT* pResult)
00094 {
00095     switch(pNMPGCalcSize->dwFlag)
00096     {
00097     case PGF_CALCWIDTH:
00098         pNMPGCalcSize->iWidth = m_nWidth;
00099         break;
00100
00101     case PGF_CALCHEIGHT:
00102         pNMPGCalcSize->iHeight = m_nHeight;
00103         break;
00104     }
00105
00106     *pResult = 0;
00107     return FALSE;   // Let parent handle message
00108 }
00109
00110 BOOL CCJPagerCtrl::OnPagerScroll(NMPGSCROLL* /*pNMPGScroll*/, LRESULT* pResult)
00111 {
00112     *pResult = 0;
00113     return FALSE;   // Let parent handle message
00114 }
Generated on Sun Feb 24 01:21:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJReBar.cpp Source File

WinCvs/CJLib/CJLibrary/CJReBar.cpp

Go to the documentation of this file.
00001 // CJReBar.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Copied from MFC, Visual C++ 6, to extend functionality to Visual C++ 5
00006 // users, with some ideas taken from Luis Barreira's article 'Classes for new IE4 controls'
00007 // http://www.codeguru.com/controls/ie4_controls_classes.shtml
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:49 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJockey/CJLibrary/CJReBar.cpp $
00015  *
00016  * $History: CJReBar.cpp $
00017  *
00018  * *****************  Version 8  *****************
00019  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00020  * Updated in $/CodeJockey/CJLibrary
00021  * Updated copyright and contact information.
00022  *
00023  * *****************  Version 7  *****************
00024  * User: Kirk Stowell Date: 7/31/99    Time: 4:26p
00025  * Updated in $/CodeJockey/CJLibrary
00026  *
00027  * *****************  Version 5  *****************
00028  * User: Kirk Stowell Date: 6/23/99    Time: 12:13a
00029  * Updated in $/CodeJockey/CJLibrary
00030  *
00031  * *****************  Version 4  *****************
00032  * User: Kirk Stowell Date: 7/25/99    Time: 12:51a
00033  * Updated in $/CodeJockey/CJLibrary
00034  *
00035  * *****************  Version 3  *****************
00036  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00037  * Updated in $/CodeJockey/CJLibrary
00038  *
00039  * *****************  Version 2  *****************
00040  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00041  * Updated in $/CodeJockey/CJLibrary
00042  *
00043  * *****************  Version 1  *****************
00044  * User: Kirk Stowell Date: 7/14/99    Time: 10:29p
00045  * Created in $/CodeJockey/CJLibrary
00046  * Copied from MFC v6 and techno preview for v5. Added to extend
00047  * functionality to Visual C++ 5.0 users.
00048  *
00049  ***************************************************************************/
00051
00052 #include "stdafx.h"
00053 #include "CJReBar.h"
00054 #include "CJToolBar.h"
00055
00056 #ifdef _DEBUG
00057 #define new DEBUG_NEW
00058 #undef THIS_FILE
00059 static char THIS_FILE[] = __FILE__;
00060 #endif
00061
00062 #define _CjxGetDlgCtrlID(hWnd)          ((UINT)(WORD)::GetDlgCtrlID(hWnd))
00063
00064 static HWND _CjxChildWindowFromPoint(HWND hWnd, POINT pt)
00065 {
00066   ASSERT(hWnd != NULL);
00067
00068   // check child windows
00069   ::ClientToScreen(hWnd, &pt);
00070   HWND hWndChild = ::GetWindow(hWnd, GW_CHILD);
00071   for (; hWndChild != NULL; hWndChild = ::GetWindow(hWndChild, GW_HWNDNEXT))
00072   {
00073     if (_CjxGetDlgCtrlID(hWndChild) != (WORD)-1 &&
00074       (::GetWindowLong(hWndChild, GWL_STYLE) & WS_VISIBLE))
00075     {
00076       // see if point hits the child window
00077       CRect rect;
00078       ::GetWindowRect(hWndChild, rect);
00079       if (rect.PtInRect(pt))
00080         return hWndChild;
00081     }
00082   }
00083
00084   return NULL;    // not found
00085 }
00086
00088 // CCJReBar
00089
00090 BEGIN_MESSAGE_MAP(CCJReBar, CCJToolBarBase)
00091     //{{AFX_MSG_MAP(CCJReBar)
00092     ON_WM_NCCREATE()
00093     ON_WM_PAINT()
00094     ON_WM_NCCALCSIZE()
00095     ON_WM_ERASEBKGND()
00096     ON_WM_NCPAINT()
00097     ON_NOTIFY_REFLECT(RBN_HEIGHTCHANGE, OnHeightChange)
00098     ON_NOTIFY_REFLECT(RBN_ENDDRAG, OnHeightChange)
00099     ON_MESSAGE(RB_SHOWBAND, OnShowBand)
00100     ON_MESSAGE_VOID(WM_RECALCPARENT, OnRecalcParent)
00101     //}}AFX_MSG_MAP
00102 END_MESSAGE_MAP()
00103
00104 CCJReBar::CCJReBar()
00105 {
00106     SetBorders();
00107 }
00108
00109 void CCJReBar::OnRecalcParent()
00110 {
00111     CFrameWnd* pFrameWnd = GetParentFrame();
00112     ASSERT(pFrameWnd != NULL);
00113     pFrameWnd->RecalcLayout();
00114 }
00115
00116 void CCJReBar::OnHeightChange(NMHDR* /*pNMHDR*/, LRESULT* pResult)
00117 {
00118     CFrameWnd* pFrameWnd = GetParentFrame();
00119     if (pFrameWnd != NULL)
00120         pFrameWnd->RecalcLayout();
00121     *pResult = 0;
00122 }
00123
00124 LRESULT CCJReBar::OnShowBand(WPARAM wParam, LPARAM)
00125 {
00126     LRESULT lResult = Default();
00127     if (lResult)
00128     {
00129         // keep window visible state in sync with band visible state
00130         REBARBANDINFO rbBand;
00131         rbBand.cbSize = sizeof(rbBand);
00132         rbBand.fMask = RBBIM_CHILD|RBBIM_STYLE;
00133         VERIFY(DefWindowProc(RB_GETBANDINFO, wParam, (LPARAM)&rbBand));
00134         CCJToolBarBase* pBar = DYNAMIC_DOWNCAST(CCJToolBarBase, CWnd::FromHandlePermanent(rbBand.hwndChild));
00135         BOOL bWindowVisible;
00136         if (pBar != NULL)
00137             bWindowVisible = pBar->IsVisible();
00138         else
00139             bWindowVisible =  (::GetWindowLong(rbBand.hwndChild, GWL_STYLE) & WS_VISIBLE) != 0;
00140         BOOL bBandVisible = (rbBand.fStyle & RBBS_HIDDEN) == 0;
00141         if (bWindowVisible != bBandVisible)
00142             VERIFY(::ShowWindow(rbBand.hwndChild, bBandVisible ? SW_SHOW : SW_HIDE));
00143     }
00144     return lResult;
00145 }
00146
00147 BOOL CCJReBar::_AddBar(CWnd* pBar, REBARBANDINFO* pRBBI)
00148 {
00149     ASSERT_VALID(this);
00150     ASSERT(::IsWindow(m_hWnd));
00151     ASSERT(pBar != NULL);
00152     ASSERT(::IsWindow(pBar->m_hWnd));
00153
00154     pRBBI->cbSize = sizeof(REBARBANDINFO);
00155     pRBBI->fMask |= RBBIM_CHILD | RBBIM_CHILDSIZE;
00156     pRBBI->hwndChild = pBar->m_hWnd;
00157
00158     CSize size;
00159     CCJToolBarBase* pTemp = DYNAMIC_DOWNCAST(CCJToolBarBase, pBar);
00160     if (pTemp != NULL)
00161     {
00162         pTemp->m_bInReBar = true;
00163         size = pTemp->CalcFixedLayout(FALSE, m_dwStyle & CBRS_ORIENT_HORZ);
00164     }
00165     else
00166     {
00167         CRect rect;
00168         pBar->GetWindowRect(&rect);
00169         size = rect.Size();
00170     }
00171     //WINBUG: COMCTL32.DLL is off by 4 pixels in its sizing logic.  Whatever
00172     //  is specified as the minimum size, the system rebar will allow that band
00173     //  to be 4 actual pixels smaller!  That's why we add 4 to the size here.
00174     pRBBI->cxMinChild = size.cx + 4;
00175     pRBBI->cyMinChild = size.cy;
00176     BOOL bResult = (BOOL)DefWindowProc(RB_INSERTBAND, (WPARAM)-1, (LPARAM)pRBBI);
00177
00178     CFrameWnd* pFrameWnd = GetParentFrame();
00179     if (pFrameWnd != NULL)
00180         pFrameWnd->RecalcLayout();
00181
00182     return bResult;
00183 }
00184
00185 BOOL CCJReBar::AddBar(CWnd* pBar, LPCTSTR pszText, CBitmap* pbmp, DWORD dwStyle)
00186 {
00187     REBARBANDINFO rbBand;
00188     rbBand.fMask = RBBIM_STYLE;
00189     rbBand.fStyle = dwStyle;
00190     if (pszText != NULL)
00191     {
00192         rbBand.fMask |= RBBIM_TEXT;
00193         rbBand.lpText = const_cast<LPTSTR>(pszText);
00194     }
00195     if (pbmp != NULL)
00196     {
00197         rbBand.fMask |= RBBIM_BACKGROUND;
00198         rbBand.hbmBack = (HBITMAP)*pbmp;
00199     }
00200     return _AddBar(pBar, &rbBand);
00201 }
00202
00203 BOOL CCJReBar::AddBar(CWnd* pBar, COLORREF clrFore, COLORREF clrBack, LPCTSTR pszText, DWORD dwStyle)
00204 {
00205     REBARBANDINFO rbBand;
00206     rbBand.fMask = RBBIM_STYLE | RBBIM_COLORS;
00207     rbBand.fStyle = dwStyle;
00208     rbBand.clrFore = clrFore;
00209     rbBand.clrBack = clrBack;
00210     if (pszText != NULL)
00211     {
00212         rbBand.fMask |= RBBIM_TEXT;
00213         rbBand.lpText = const_cast<LPTSTR>(pszText);
00214     }
00215     return _AddBar(pBar, &rbBand);
00216 }
00217
00218 CSize CCJReBar::CalcFixedLayout(BOOL bStretch, BOOL bHorz)
00219 {
00220     ASSERT_VALID(this);
00221     ASSERT(::IsWindow(m_hWnd));
00222
00223     // the union of the band rectangles is the total bounding rect
00224     int nCount = DefWindowProc(RB_GETBANDCOUNT, 0, 0);
00225     REBARBANDINFO rbBand;
00226     rbBand.cbSize = sizeof(rbBand);
00227     int nTemp;
00228
00229     // sync up hidden state of the bands
00230     for (nTemp = nCount; nTemp--; )
00231     {
00232         rbBand.fMask = RBBIM_CHILD|RBBIM_STYLE;
00233         VERIFY(DefWindowProc(RB_GETBANDINFO, nTemp, (LPARAM)&rbBand));
00234         CCJToolBarBase* pBar = DYNAMIC_DOWNCAST(CCJToolBarBase, CWnd::FromHandlePermanent(rbBand.hwndChild));
00235         BOOL bWindowVisible;
00236         if (pBar != NULL)
00237             bWindowVisible = pBar->IsVisible();
00238         else
00239             bWindowVisible =  (::GetWindowLong(rbBand.hwndChild, GWL_STYLE) & WS_VISIBLE) != 0;
00240         BOOL bBandVisible = (rbBand.fStyle & RBBS_HIDDEN) == 0;
00241         if (bWindowVisible != bBandVisible)
00242             VERIFY(DefWindowProc(RB_SHOWBAND, nTemp, bWindowVisible));
00243     }
00244
00245     // determine bounding rect of all visible bands
00246     CRect rectBound; rectBound.SetRectEmpty();
00247     for (nTemp = nCount; nTemp--; )
00248     {
00249         rbBand.fMask = RBBIM_STYLE;
00250         VERIFY(DefWindowProc(RB_GETBANDINFO, nTemp, (LPARAM)&rbBand));
00251         if ((rbBand.fStyle & RBBS_HIDDEN) == 0)
00252         {
00253             CRect rect;
00254             VERIFY(DefWindowProc(RB_GETRECT, nTemp, (LPARAM)&rect));
00255             rectBound |= rect;
00256         }
00257     }
00258
00259     // add borders as part of bounding rect
00260     if (!rectBound.IsRectEmpty())
00261     {
00262         CRect rect; rect.SetRectEmpty();
00263         CalcInsideRect(rect, bHorz);
00264         rectBound.right -= rect.Width();
00265         rectBound.bottom -= rect.Height();
00266     }
00267
00268     return CSize((bHorz && bStretch) ? 32767 : rectBound.Width(),
00269         (!bHorz && bStretch) ? 32767 : rectBound.Height());
00270 }
00271
00272 CSize CCJReBar::CalcDynamicLayout(int /*nLength*/, DWORD dwMode)
00273 {
00274     if (dwMode & LM_HORZDOCK)
00275         ASSERT(dwMode & LM_HORZ);
00276     return CalcFixedLayout(dwMode & LM_STRETCH, dwMode & LM_HORZ);
00277 }
00278
00279 BOOL CCJReBar::Create(CWnd* pParentWnd, DWORD dwCtrlStyle, DWORD dwStyle, UINT nID)
00280 {
00281     ASSERT_VALID(pParentWnd);   // must have a parent
00282     ASSERT (!((dwStyle & CBRS_SIZE_FIXED) && (dwStyle & CBRS_SIZE_DYNAMIC)));
00283
00284     // save the style
00285     m_dwStyle = (dwStyle & CBRS_ALL);
00286     if (nID == AFX_IDW_REBAR)
00287         m_dwStyle |= CBRS_HIDE_INPLACE;
00288
00289     dwStyle &= ~CBRS_ALL;
00290     dwStyle |= CCS_NOPARENTALIGN|CCS_NOMOVEY|CCS_NODIVIDER|CCS_NORESIZE|RBS_VARHEIGHT;
00291     dwStyle |= dwCtrlStyle;
00292
00293     // initialize common controls
00294 #if _MSC_VER >= 1200
00295     VERIFY(AfxDeferRegisterClass(AFX_WNDCOMMCTL_COOL_REG));
00296 #else
00297     INITCOMMONCONTROLSEX icex;
00298     icex.dwSize = sizeof(icex);
00299     icex.dwICC = ICC_COOL_CLASSES;
00300     VERIFY(InitCommonControlsEx(&icex));
00301 #endif
00302
00303     _GetComCtlVersion();
00304     ASSERT(_ComCtlVersion != -1);
00305
00306     // create the HWND
00307     CRect rect; rect.SetRectEmpty();
00308     if (!CWnd::Create(REBARCLASSNAME, NULL, dwStyle, rect, pParentWnd, nID))
00309         return FALSE;
00310
00311     // Note: Parent must resize itself for control bar to be resized
00312     m_bInReBar = true;
00313
00314     return TRUE;
00315 }
00316
00317 void CCJReBar::OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHandler)
00318 {
00319     UpdateDialogControls(pTarget, bDisableIfNoHandler);
00320 }
00321
00322 BOOL CCJReBar::OnNcCreate(LPCREATESTRUCT lpCreateStruct)
00323 {
00324     if (!CCJToolBarBase::OnNcCreate(lpCreateStruct))
00325         return FALSE;
00326
00327     // if the owner was set before the rebar was created, set it now
00328     if (m_hWndOwner != NULL)
00329         DefWindowProc(RB_SETPARENT, (WPARAM)m_hWndOwner, 0);
00330
00331     return TRUE;
00332 }
00333
00334 BOOL CCJReBar::OnEraseBkgnd(CDC*)
00335 {
00336     return (BOOL)Default();
00337 }
00338
00339 void CCJReBar::OnNcCalcSize(BOOL /*bCalcValidRects*/, NCCALCSIZE_PARAMS* lpncsp)
00340 {
00341     // calculate border space (will add to top/bottom, subtract from right/bottom)
00342     CRect rect; rect.SetRectEmpty();
00343     BOOL bHorz = (m_dwStyle & CBRS_ORIENT_HORZ) != 0;
00344     CCJToolBarBase::CalcInsideRect(rect, bHorz);
00345
00346     // adjust non-client area for border space
00347     lpncsp->rgrc[0].left += rect.left;
00348     lpncsp->rgrc[0].top += rect.top;
00349     lpncsp->rgrc[0].right += rect.right;
00350     lpncsp->rgrc[0].bottom += rect.bottom;
00351 }
00352
00353 void CCJReBar::OnNcPaint()
00354 {
00355     EraseNonClient();
00356 }
00357
00358 void CCJReBar::OnPaint()
00359 {
00360     Default();
00361 }
00362
00363 int CCJReBar::OnToolHitTest(CPoint point, TOOLINFO* pTI) const
00364 {
00365     ASSERT_VALID(this);
00366     ASSERT(::IsWindow(m_hWnd));
00367
00368     HWND hWndChild = _CjxChildWindowFromPoint(m_hWnd, point);
00369     CWnd* pWnd = CWnd::FromHandlePermanent(hWndChild);
00370     if (pWnd == NULL)
00371         return CCJToolBarBase::OnToolHitTest(point, pTI);
00372
00373     ASSERT(pWnd->m_hWnd == hWndChild);
00374     return pWnd->OnToolHitTest(point, pTI);
00375 }
00376
00377 LRESULT CCJReBar::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
00378 {
00379     // special handling for certain messages (forwarding to owner/parent)
00380     switch (message)
00381     {
00382     case WM_POPMESSAGESTRING:
00383     case WM_SETMESSAGESTRING:
00384         return GetOwner()->SendMessage(message, wParam, lParam);
00385     }
00386     return CCJToolBarBase::WindowProc(message, wParam, lParam);
00387 }
00388
00389 #ifdef AFX_INIT_SEG
00390 #pragma code_seg(AFX_INIT_SEG)
00391 #endif
00392
00393 IMPLEMENT_DYNAMIC(CCJReBar, CCJToolBarBase)
00394
Generated on Sun Feb 24 01:21:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJReBarCtrl.cpp Source File

WinCvs/CJLib/CJLibrary/CJReBarCtrl.cpp

Go to the documentation of this file.
00001 // CJReBarCtrl.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Copied from MFC, Visual C++ 6, to extend functionality to Visual C++ 5
00006 // users, with some ideas taken from Luis Barreira's article 'Classes for new IE4 controls'
00007 // http://www.codeguru.com/controls/ie4_controls_classes.shtml
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:49 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJockey/CJLibrary/CJReBarCtrl.cpp $
00015  *
00016  * $History: CJReBarCtrl.cpp $
00017  *
00018  * *****************  Version 6  *****************
00019  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00020  * Updated in $/CodeJockey/CJLibrary
00021  * Updated copyright and contact information.
00022  *
00023  * *****************  Version 5  *****************
00024  * User: Kirk Stowell Date: 7/31/99    Time: 4:26p
00025  * Updated in $/CodeJockey/CJLibrary
00026  *
00027  * *****************  Version 3  *****************
00028  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00029  * Updated in $/CodeJockey/CJLibrary
00030  *
00031  * *****************  Version 2  *****************
00032  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00033  * Updated in $/CodeJockey/CJLibrary
00034  *
00035  * *****************  Version 1  *****************
00036  * User: Kirk Stowell Date: 7/14/99    Time: 10:29p
00037  * Created in $/CodeJockey/CJLibrary
00038  * Copied from MFC v6 and techno preview for v5. Added to extend
00039  * functionality to Visual C++ 5.0 users.
00040  *
00041  ***************************************************************************/
00043
00044 #include "stdafx.h"
00045 #include "CJReBarCtrl.h"
00046
00047 #ifdef _DEBUG
00048 #define new DEBUG_NEW
00049 #undef THIS_FILE
00050 static char THIS_FILE[] = __FILE__;
00051 #endif
00052
00054 // CCJReBarCtrl
00055
00056 CCJReBarCtrl::CCJReBarCtrl()
00057 {
00058 }
00059
00060 BOOL CCJReBarCtrl::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd,
00061                         UINT nID)
00062 {
00063     // initialize common controls
00064 #if _MSC_VER >= 1200
00065     VERIFY(AfxDeferRegisterClass(AFX_WNDCOMMCTL_COOL_REG));
00066 #else
00067     INITCOMMONCONTROLSEX icex;
00068     icex.dwSize = sizeof(icex);
00069     icex.dwICC = ICC_COOL_CLASSES;
00070     VERIFY(InitCommonControlsEx(&icex));
00071 #endif
00072
00073     CWnd* pWnd = this;
00074     return pWnd->Create(REBARCLASSNAME, NULL, dwStyle, rect, pParentWnd, nID);
00075 }
00076
00077 CImageList* CCJReBarCtrl::GetImageList() const
00078 {
00079   REBARINFO rbi;
00080   rbi.cbSize = sizeof(rbi);
00081   rbi.fMask = RBIM_IMAGELIST;
00082   return GetBarInfo(&rbi) ? CImageList::FromHandle(rbi.himl) : NULL;
00083 }
00084
00085 BOOL CCJReBarCtrl::SetImageList(CImageList* pImageList)
00086 {
00087   REBARINFO rbi;
00088   rbi.cbSize = sizeof(rbi);
00089   rbi.fMask = RBIM_IMAGELIST;
00090   rbi.himl = (HIMAGELIST)pImageList->GetSafeHandle();
00091   return SetBarInfo(&rbi);
00092 }
00093
00094 BOOL CCJReBarCtrl::GetColorScheme(COLORSCHEME* lpcs)
00095 {
00096   lpcs->dwSize = sizeof(COLORSCHEME);
00097   return SendMessage(RB_GETCOLORSCHEME, 0, (LPARAM)lpcs);
00098 }
00099
00100 void CCJReBarCtrl::SetColorScheme(const COLORSCHEME* lpcs)
00101 {
00102   ((COLORSCHEME*)lpcs)->dwSize = sizeof(COLORSCHEME);
00103   SendMessage(RB_SETCOLORSCHEME, 0, (LPARAM)lpcs);
00104 }
00105
00107
00108 IMPLEMENT_DYNAMIC(CCJReBarCtrl, CWnd)
00109
Generated on Sun Feb 24 01:21:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJShell.cpp Source File

WinCvs/CJLib/CJLibrary/CJShell.cpp

Go to the documentation of this file.
00001 // CJShell.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based upon the MFCENUM example. MFCENUM is a companion sample application
00006 // for Chapter 14 in "Programming the Windows 95 User Interface" by Nancy Cluts,
00007 // available in the Microsoft(R) Development Library.
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 2001/10/30 17:06:40 $
00013  * $Revision: 1.2 $
00014  * $Archive: /CodeJock/CJLibrary/CJShell.cpp $
00015  *
00016  * $History: CJShell.cpp $
00017  *
00018  * *****************  Version 10  *****************
00019  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00020  * Updated in $/CodeJock/CJLibrary
00021  * Fixed potential resource and memory leak problems.
00022  *
00023  * *****************  Version 9  *****************
00024  * User: Kirk Stowell Date: 10/14/99   Time: 10:25a
00025  * Updated in $/CodeJock/CJLibrary
00026  * Added four new shell methods which deal with PIDL's including a new
00027  * version of an Explorer context menu called DoExplorerMenu(...) which
00028  * can be used in place of the existing DoTheMenuThing(...) method.
00029  *
00030  * *****************  Version 8  *****************
00031  * User: Kirk Stowell Date: 9/13/99    Time: 5:52a
00032  * Updated in $/CodeJockey/CJLibrary
00033  * Fixed build errors which occured with UNICODE builds.
00034  *
00035  * *****************  Version 7  *****************
00036  * User: Kirk Stowell Date: 8/31/99    Time: 4:39a
00037  * Updated in $/CodeJockey/CJLibrary
00038  * Updated copyright and contact information.
00039  *
00040  * *****************  Version 6  *****************
00041  * User: Kirk Stowell Date: 7/31/99    Time: 4:26p
00042  * Updated in $/CodeJockey/CJLibrary
00043  *
00044  * *****************  Version 4  *****************
00045  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00046  * Updated in $/CodeJockey/CJLibrary
00047  *
00048  * *****************  Version 3  *****************
00049  * User: Kirk Stowell Date: 6/11/99    Time: 10:06p
00050  * Updated in $/CodeJockey/CJ60Lib
00051  * Renamed class from CCJShellFile to CCJShell.
00052  *
00053  * *****************  Version 2  *****************
00054  * User: Kirk Stowell Date: 5/02/99    Time: 3:38p
00055  * Updated in $/CodeJockey/CJ60Lib
00056  * Added version macro  _WIN32_IE, you will need to have at IE4 or greater
00057  * installed to use this class. This will ensure that the version of
00058  * SHELL32.DLL is compatible.
00059  *
00060  * *****************  Version 1  *****************
00061  * User: Kirk Stowell Date: 3/19/99    Time: 11:01p
00062  * Created in $/CodeJockey/CJ60Lib
00063  * Initial re-write and release.
00064  *
00065  ***************************************************************************/
00067
00068 #include "StdAfx.h"
00069 #include "CJShell.h"
00070
00071 #if _WIN32_IE >= 0x0400 // Need to have at IE4 or greater installed.
00072
00074 // CCJShell
00075
00076 CCJShell::CCJShell(LPCTSTR lpszFileName)
00077 {
00078     m_strFileName = lpszFileName;
00079     SplitPath(m_strFileName, m_szDrive, m_szDir, m_szFname, m_szExt);
00080 }
00081
00082 CCJShell::~CCJShell()
00083 {
00084 }
00085
00086 int CALLBACK CCJShell::BrowseCtrlCallback(HWND hwnd, UINT uMsg, LPARAM /*lParam*/, LPARAM lpData)
00087 {
00088     CCJShell* pCJShellInfo = (CCJShell*)lpData;
00089
00090     if (pCJShellInfo->m_strSelDir.IsEmpty())
00091         return FALSE;
00092
00093     switch (uMsg)
00094     {
00095     case BFFM_INITIALIZED:
00096         ::SendMessage(hwnd, BFFM_SETSELECTION, TRUE,
00097             (LPARAM)(LPCTSTR)pCJShellInfo->m_strSelDir);
00098         break;
00099
00100     case BFFM_SELCHANGED:
00101         break;
00102     }
00103
00104     return FALSE;
00105 }
00106
00107 BOOL CCJShell::BrowseForFolder(CWnd *pParentWnd)
00108 {
00109     ASSERT(pParentWnd);
00110
00111     LPMALLOC pMalloc;
00112     if (::SHGetMalloc(&pMalloc)!= NOERROR)
00113         return FALSE;
00114
00115     BROWSEINFO bInfo;
00116     LPITEMIDLIST pidl;
00117     ZeroMemory ( (PVOID) &bInfo,sizeof (BROWSEINFO));
00118
00119     if (!m_strInitDir.IsEmpty ())
00120     {
00121         OLECHAR       olePath[MAX_PATH];
00122         ULONG         chEaten;
00123         ULONG         dwAttributes;
00124         HRESULT       hr;
00125         LPSHELLFOLDER pDesktopFolder;
00126         //
00127         // Get a pointer to the Desktop's IShellFolder interface.
00128         //
00129         if (SUCCEEDED(SHGetDesktopFolder(&pDesktopFolder)))
00130         {
00131             //
00132             // IShellFolder::ParseDisplayName requires the file name be in Unicode.
00133             //
00134 #if defined( _UNICODE )
00135             _tcsncpy( olePath, m_strInitDir, MAX_PATH );
00136 #else
00137             MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, m_strInitDir,
00138                                  -1, olePath, MAX_PATH);
00139 #endif
00140             //
00141             // Convert the path to an ITEMIDLIST.
00142             //
00143             hr = pDesktopFolder->ParseDisplayName(NULL,
00144                 NULL,
00145                 olePath,
00146                 &chEaten,
00147                 &pidl,
00148                 &dwAttributes);
00149             if (FAILED(hr))
00150             {
00151                 pMalloc ->Free (pidl);
00152                 pMalloc ->Release ();
00153                 // fix potential memory leak - KStowell 10-22-99
00154                 pDesktopFolder ->Release ();
00155                 return FALSE;
00156             }
00157             bInfo.pidlRoot = pidl;
00158             // fix potential memory leak - KStowell 10-22-99
00159             pDesktopFolder ->Release ();
00160         }
00161     }
00162
00163     bInfo.hwndOwner      = pParentWnd->GetSafeHwnd();
00164     bInfo.pszDisplayName = m_strPath.GetBuffer (MAX_PATH);
00165     bInfo.lpszTitle      = (m_strTitle.IsEmpty()) ? _T("Open"):m_strTitle;
00166     bInfo.ulFlags        = BIF_RETURNFSANCESTORS|BIF_RETURNONLYFSDIRS;
00167     bInfo.lpfn           = BrowseCtrlCallback;  // address of callback function
00168     bInfo.lParam         = (LPARAM)this;        // pass address of object to callback function
00169
00170     if ((pidl = ::SHBrowseForFolder(&bInfo)) == NULL)
00171     {
00172         return FALSE;
00173     }
00174     m_strPath.ReleaseBuffer();
00175     m_iImageIndex = bInfo.iImage;
00176
00177     if (::SHGetPathFromIDList(pidl,m_strPath.GetBuffer(MAX_PATH)) == FALSE)
00178     {
00179         pMalloc ->Free(pidl);
00180         pMalloc ->Release();
00181         return FALSE;
00182     }
00183
00184     m_strPath.ReleaseBuffer();
00185
00186     pMalloc ->Free(pidl);
00187     pMalloc ->Release();
00188
00189     return TRUE;
00190 }
00191
00192 void CCJShell::GetSystemImageList(CImageList *pSmallList, CImageList *pLargeList)
00193 {
00194     ASSERT(pSmallList);
00195     ASSERT(pLargeList);
00196
00197     //image list setup
00198     SHFILEINFO  ssfi, lsfi;
00199
00200     // Get a handle to the system small icon list
00201     HIMAGELIST hSystemSmallImageList = (HIMAGELIST)
00202         ::SHGetFileInfo((LPCTSTR)_T("C:\\"), 0, &ssfi,
00203         sizeof(SHFILEINFO), SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
00204
00205     // Attach it to the small image list
00206     // DON'T FORGET TO PUT pSmallList->Detach(); in your destructor
00207     pSmallList->Attach(hSystemSmallImageList);
00208
00209     // Get a handle to the system large icon list
00210     HIMAGELIST hSystemLargeImageList =  (HIMAGELIST)
00211         ::SHGetFileInfo((LPCTSTR)_T("C:\\"), 0, &lsfi,
00212         sizeof(SHFILEINFO), SHGFI_SYSICONINDEX | SHGFI_ICON);
00213
00214     // Attach it to the large image list
00215     // DON'T FORGET TO PUT pLargeList->Detach(); in your destructor
00216     pLargeList->Attach(hSystemLargeImageList);
00217 }
00218
00219 CString CCJShell::GetFileName(LPCTSTR lpszFileName/*=NULL*/)
00220 {
00221     // Parse the file path.
00222     if (lpszFileName != NULL) {
00223         SplitPath(lpszFileName, m_szDrive, m_szDir, m_szFname, m_szExt);
00224     }
00225
00226     // Just return the file name + extension.
00227     CString str; str.Format(_T("%s%s"), m_szFname, m_szExt);
00228     return str;
00229 }
00230
00231 CString CCJShell::GetFileDrive(LPCTSTR lpszFileName/*=NULL*/)
00232 {
00233     // Parse the file path.
00234     if (lpszFileName != NULL) {
00235         SplitPath(lpszFileName, m_szDrive, m_szDir, m_szFname, m_szExt);
00236     }
00237
00238     return m_szDrive;
00239 }
00240
00241 CString CCJShell::GetRoot(LPCTSTR lpszFileName/*=NULL*/)
00242 {
00243     // Parse the file path.
00244     if (lpszFileName != NULL) {
00245         SplitPath(lpszFileName, m_szDrive, m_szDir, m_szFname, m_szExt);
00246     }
00247
00248     // Just return the file name + extension.
00249     CString str; str.Format(_T("%s%s"), m_szDrive, m_szDir);
00250     return str;
00251 }
00252
00253 CString CCJShell::GetFileTitle(LPCTSTR lpszFileName/*=NULL*/)
00254 {
00255     // Parse the file path.
00256     if (lpszFileName != NULL) {
00257         SplitPath(lpszFileName, m_szDrive, m_szDir, m_szFname, m_szExt);
00258     }
00259
00260     return m_szFname;
00261 }
00262
00263 CString CCJShell::GetFileExt(LPCTSTR lpszFileName/*=NULL*/)
00264 {
00265     // Parse the file path.
00266     if (lpszFileName != NULL) {
00267         SplitPath(lpszFileName, m_szDrive, m_szDir, m_szFname, m_szExt);
00268     }
00269
00270     return m_szExt;
00271 }
00272
00273 CString CCJShell::GetFileType(LPCTSTR lpszFileName/*=NULL*/)
00274 {
00275     SHFILEINFO  sfi;
00276
00277     ::SHGetFileInfo((lpszFileName==NULL)?m_strFileName:lpszFileName,
00278         0, &sfi, sizeof(SHFILEINFO), SHGFI_TYPENAME);
00279
00280    return sfi.szTypeName;
00281 }
00282
00283 CString CCJShell::GetDisplayName(LPCTSTR lpszFileName/*=NULL*/)
00284 {
00285     SHFILEINFO sfi;
00286
00287     ::SHGetFileInfo((lpszFileName==NULL)?m_strFileName:lpszFileName,
00288         0, &sfi, sizeof(SHFILEINFO), SHGFI_DISPLAYNAME);
00289
00290     return sfi.szDisplayName;
00291 }
00292
00293 int CCJShell::GetIconIndex(LPCTSTR lpszFileName/*=NULL*/, UINT uFlags/*=SHGFI_SMALLICON*/)
00294 {
00295     SHFILEINFO sfi;
00296
00297     ::SHGetFileInfo((lpszFileName==NULL)?m_strFileName:lpszFileName,
00298         0, &sfi, sizeof(SHFILEINFO), SHGFI_SYSICONINDEX | uFlags);
00299
00300     return sfi.iIcon;
00301 }
00302
00303 BOOL CCJShell::Exist(LPCTSTR lpszFileName/*=NULL*/)
00304 {
00305     WIN32_FIND_DATA fd;
00306     HANDLE hFind = FindFirstFile( (lpszFileName==NULL)?m_strFileName:lpszFileName, &fd );
00307
00308     if ( hFind != INVALID_HANDLE_VALUE )
00309         FindClose( hFind );
00310
00311     return (hFind != INVALID_HANDLE_VALUE);
00312 }
00313
00314 CString CCJShell::GetLastWriteTime(CTime *pTime)
00315 {
00316     if (!pTime)
00317         return _T("");
00318
00319     CString strTime;
00320
00321     // Format the date time string.
00322     strTime.Format( _T("%.2d/%.2d/%d %.2d:%.2d"), pTime->GetMonth(), pTime->GetDay(),
00323         pTime->GetYear(), pTime->GetHour(), pTime->GetSecond());
00324
00325     return strTime;
00326 }
00327
00328 CString CCJShell::GetFileSizeString(LPCTSTR lpszFileSize)
00329 {
00330     CString strFileSize(lpszFileSize);
00331
00332     UINT nSize = _ttoi(strFileSize);
00333     if (nSize == 0) return _T("0KB");
00334
00335     nSize /= 1000;
00336     if (nSize == 0) return _T("1KB");
00337
00338     strFileSize.Format(_T("%dKB"), nSize);
00339     return strFileSize;
00340 }
00341
00342 //
00343 // FUNCTIONS THAT DEAL WITH PIDLs
00344 //
00345
00346 LPITEMIDLIST CCJShell::Next(LPCITEMIDLIST pidl)
00347 {
00348    LPSTR lpMem=(LPSTR)pidl;
00349
00350    lpMem+=pidl->mkid.cb;
00351
00352    return (LPITEMIDLIST)lpMem;
00353 }
00354
00355 UINT CCJShell::GetSize(LPCITEMIDLIST pidl)
00356 {
00357     UINT cbTotal = 0;
00358     if (pidl)
00359     {
00360         cbTotal += sizeof(pidl->mkid.cb);       // Null terminator
00361         while (pidl->mkid.cb)
00362         {
00363             cbTotal += pidl->mkid.cb;
00364             pidl = Next(pidl);
00365         }
00366     }
00367
00368     return cbTotal;
00369 }
00370
00371 LPITEMIDLIST CCJShell::Create(UINT cbSize)
00372 {
00373     LPMALLOC lpMalloc;
00374     HRESULT  hr;
00375     LPITEMIDLIST pidl=NULL;
00376
00377     hr=SHGetMalloc(&lpMalloc);
00378
00379     if (FAILED(hr))
00380        return 0;
00381
00382     pidl=(LPITEMIDLIST)lpMalloc->Alloc(cbSize);
00383
00384     if (pidl)
00385         memset(pidl, 0, cbSize);      // zero-init for external task   alloc
00386
00387     if (lpMalloc) lpMalloc->Release();
00388
00389     return pidl;
00390 }
00391
00392 LPITEMIDLIST CCJShell::ConcatPidls(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
00393 {
00394     LPITEMIDLIST pidlNew;
00395     UINT cb1;
00396     UINT cb2;
00397
00398     if (pidl1)  //May be NULL
00399        cb1 = GetSize(pidl1) - sizeof(pidl1->mkid.cb);
00400     else
00401        cb1 = 0;
00402
00403     cb2 = GetSize(pidl2);
00404
00405     pidlNew = Create(cb1 + cb2);
00406     if (pidlNew)
00407     {
00408         if (pidl1)
00409            memcpy(pidlNew, pidl1, cb1);
00410         memcpy(((LPSTR)pidlNew) + cb1, pidl2, cb2);
00411     }
00412     return pidlNew;
00413 }
00414
00415 LPITEMIDLIST CCJShell::CopyITEMID(LPMALLOC lpMalloc, LPITEMIDLIST lpi)
00416 {
00417    LPITEMIDLIST lpiTemp;
00418
00419    lpiTemp=(LPITEMIDLIST)lpMalloc->Alloc(lpi->mkid.cb+sizeof(lpi->mkid.cb));
00420    CopyMemory((PVOID)lpiTemp, (CONST VOID *)lpi, lpi->mkid.cb+sizeof(lpi->mkid.cb));
00421
00422    return lpiTemp;
00423 }
00424
00425 BOOL CCJShell::GetName( LPSHELLFOLDER lpsf, LPITEMIDLIST lpi, DWORD dwFlags, LPTSTR lpFriendlyName )
00426 {
00427    BOOL   bSuccess=TRUE;
00428    STRRET str;
00429
00430    if (NOERROR==lpsf->GetDisplayNameOf(lpi,dwFlags, &str))
00431    {
00432       switch (str.uType)
00433       {
00434          case STRRET_WSTR:
00435 #if defined( _UNICODE )
00436             _tcscpy( lpFriendlyName, str.pOleStr );
00437 #else
00438             WideCharToMultiByte(CP_ACP,                 // CodePage
00439                                 0,                     // dwFlags
00440                                 str.pOleStr,            // lpWideCharStr
00441                                 -1,                     // cchWideChar
00442                                 lpFriendlyName,         // lpMultiByteStr
00443                                 MAX_PATH,
00444                                 //sizeof(lpFriendlyName), // cchMultiByte, wrong. sizeof on a pointer, psk, psk
00445                                 NULL,                   // lpDefaultChar,
00446                                 NULL);                  // lpUsedDefaultChar
00447 #endif
00448              break;
00449
00450          case STRRET_OFFSET:
00451 #if defined( _UNICODE )
00452             MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, (LPSTR)lpi+str.uOffset,
00453                 -1, lpFriendlyName, MAX_PATH);
00454 #else
00455              _tcscpy(lpFriendlyName, (LPSTR)lpi+str.uOffset);
00456 #endif
00457             break;
00458
00459          case STRRET_CSTR:
00460 #if defined( _UNICODE )
00461             MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, str.cStr,
00462                 -1, lpFriendlyName, MAX_PATH);
00463 #else
00464              _tcscpy(lpFriendlyName, (LPSTR)str.cStr);
00465 #endif
00466              break;
00467
00468          default:
00469              bSuccess = FALSE;
00470              break;
00471       }
00472    }
00473    else
00474       bSuccess = FALSE;
00475
00476    return bSuccess;
00477 }
00478
00479 LPITEMIDLIST CCJShell::GetFullyQualPidl(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi)
00480 {
00481    TCHAR szBuff[MAX_PATH];
00482    OLECHAR szOleChar[MAX_PATH];
00483    LPSHELLFOLDER lpsfDeskTop;
00484    LPITEMIDLIST  lpifq;
00485    ULONG ulEaten, ulAttribs;
00486    HRESULT hr;
00487
00488     if( GetName(lpsf, lpi, SHGDN_FORPARSING, szBuff) == FALSE ) {
00489         return NULL;
00490     }
00491
00492    hr=SHGetDesktopFolder(&lpsfDeskTop);
00493
00494    if (FAILED(hr))
00495       return NULL;
00496
00497 #if defined( _UNICODE )
00498    hr=lpsfDeskTop->ParseDisplayName(NULL, NULL, szOleChar, &ulEaten,
00499         &lpifq, &ulAttribs );
00500 #else
00501    MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, szBuff,
00502         -1, (USHORT*)szOleChar, sizeof(szOleChar));
00503
00504    hr=lpsfDeskTop->ParseDisplayName(NULL, NULL, szOleChar, &ulEaten,
00505         &lpifq, &ulAttribs );
00506 #endif
00507
00508    lpsfDeskTop->Release();
00509
00510    if (FAILED(hr))
00511       return NULL;
00512
00513    return lpifq;
00514 }
00515
00516 BOOL CCJShell::DoTheMenuThing(HWND hwnd, LPSHELLFOLDER lpsfParent,
00517      LPITEMIDLIST  lpi, LPPOINT lppt)
00518 {
00519     LPCONTEXTMENU lpcm;
00520     HRESULT       hr;
00521     TCHAR          szTemp[64];
00522     CMINVOKECOMMANDINFO cmi;
00523     int                 idCmd;
00524     CMenu               menu;
00525     BOOL                bSuccess=TRUE;
00526
00527     hr=lpsfParent->GetUIObjectOf(hwnd,
00528         1,  //Number of objects to get attributes of
00529         (const struct _ITEMIDLIST **)&lpi,
00530         IID_IContextMenu,
00531         0,
00532         (LPVOID *)&lpcm);
00533     if (SUCCEEDED(hr))
00534     {
00535        if (menu.CreatePopupMenu())
00536        {
00537           hr=lpcm->QueryContextMenu(menu, 0, 1, 0x7fff, CMF_EXPLORE);
00538           if (SUCCEEDED(hr))
00539           {
00540              idCmd=menu.TrackPopupMenu(
00541                 TPM_LEFTALIGN | TPM_RETURNCMD | TPM_RIGHTBUTTON,
00542                 lppt->x, lppt->y, CWnd::FromHandle(hwnd) );
00543
00544              if (idCmd)
00545              {
00546                 cmi.cbSize       = sizeof(CMINVOKECOMMANDINFO);
00547                 cmi.fMask        = 0;
00548                 cmi.hwnd         = hwnd;
00549                 cmi.lpVerb       = (LPCSTR)MAKEINTRESOURCE(idCmd-1);
00550                 cmi.lpParameters = NULL;
00551                 cmi.lpDirectory  = NULL;
00552                 cmi.nShow        = SW_SHOWNORMAL;
00553                 cmi.dwHotKey     = 0;
00554                 cmi.hIcon        = NULL;
00555
00556                 hr=lpcm->InvokeCommand(&cmi);
00557
00558                 if (!SUCCEEDED(hr))
00559                 {
00560                    wsprintf(szTemp, _T("InvokeCommand failed. hr=%lx"), hr);
00561                    AfxMessageBox(szTemp);
00562                 }
00563                 else
00564                 {
00565                     ::SendMessage(hwnd, WM_SHELL_NOTIFY,
00566                         NM_SH_SHELLMENU, (LPARAM)0);
00567                 }
00568              }
00569
00570           }
00571           else
00572              bSuccess = FALSE;
00573        }
00574        else
00575           bSuccess = FALSE;
00576
00577        lpcm->Release();
00578     }
00579     else
00580     {
00581        wsprintf(szTemp, _T("GetUIObjectOf failed! hr=%lx"), hr);
00582        AfxMessageBox(szTemp );
00583        bSuccess = FALSE;
00584     }
00585     return bSuccess;
00586 }
00587
00588 int CCJShell::GetIcon(LPITEMIDLIST lpi, UINT uFlags)
00589 {
00590     SHFILEINFO    sfi;
00591
00592     SHGetFileInfo((LPCTSTR)lpi, 0, &sfi,
00593         sizeof(SHFILEINFO), uFlags);
00594
00595     return sfi.iIcon;
00596 }
00597
00598 void CCJShell::GetNormalAndSelectedIcons(LPITEMIDLIST lpifq, LPTV_ITEM lptvitem)
00599 {
00600    //Note that we don't check the return value here because if GetIcon()
00601    //fails, then we're in big trouble...
00602
00603    lptvitem->iImage = GetIcon(lpifq, SHGFI_PIDL |
00604                               SHGFI_SYSICONINDEX |
00605                               SHGFI_SMALLICON);
00606
00607    lptvitem->iSelectedImage = GetIcon(lpifq, SHGFI_PIDL |
00608                                       SHGFI_SYSICONINDEX |
00609                                       SHGFI_SMALLICON |
00610                                       SHGFI_OPENICON);
00611
00612    return;
00613 }
00614
00615 LONG CCJShell::GetRegKey(HKEY key, LPCTSTR subkey, LPTSTR retdata)
00616 {
00617     HKEY hkey;
00618     LONG retval = RegOpenKeyEx(key, subkey, 0, KEY_QUERY_VALUE, &hkey);
00619
00620     if (retval == ERROR_SUCCESS) {
00621         long datasize = MAX_PATH;
00622         TCHAR data[MAX_PATH];
00623         RegQueryValue(hkey, NULL, data, &datasize);
00624         _tcscpy(retdata,data);
00625         RegCloseKey(hkey);
00626     }
00627
00628     return retval;
00629 }
00630
00631 HINSTANCE CCJShell::ShellExec(LPCTSTR lpszExec, int nShow)
00632 {
00633     TCHAR key[MAX_PATH + MAX_PATH];
00634
00635     // First try ShellExecute()
00636     HINSTANCE result = ShellExecute(NULL, _T("open"), lpszExec, NULL,NULL, nShow);
00637
00638     // If it failed, get the .htm regkey and lookup the program
00639     if ((UINT)result <= HINSTANCE_ERROR) {
00640
00641         if (GetRegKey(HKEY_CLASSES_ROOT, _T(".htm"), key) == ERROR_SUCCESS) {
00642             lstrcat(key, _T("\\shell\\open\\command"));
00643
00644             if (GetRegKey(HKEY_CLASSES_ROOT,key,key) == ERROR_SUCCESS) {
00645                 TCHAR *pos;
00646                 pos = _tcsstr(key, _T("\"%1\""));
00647                 if (pos == NULL) {                     // No quotes found
00648                     pos = _tcsstr(key, _T("%1"));       // Check for %1, without quotes
00649                     if (pos == NULL)                   // No parameter at all...
00650                         pos = key+_tcslen(key)-1;
00651                     else
00652                         *pos = _T('\0');                   // Remove the parameter
00653                 }
00654                 else
00655                     *pos = _T('\0');                       // Remove the parameter
00656
00657                 lstrcat(pos, _T(" "));
00658                 lstrcat(pos, lpszExec);
00659                 PROCESS_INFORMATION pi;
00660
00661                 STARTUPINFO         si;
00662
00663                 ::ZeroMemory( &si, sizeof( si ));
00664
00665                 si.cb = sizeof( si );
00666
00667                 if( ::CreateProcess( NULL,
00668                                      pos,
00669                                      NULL,
00670                                      NULL,
00671                                      FALSE,
00672                                      0,
00673                                      NULL,
00674                                      NULL,
00675                                      &si,
00676                                     &pi ) == FALSE )
00677                 {
00678                     return NULL;
00679                 }
00680
00681                 result = (HINSTANCE) pi.hProcess;
00682             }
00683         }
00684     }
00685
00686     return result;
00687 }
00688
00689 void CCJShell::SplitPath(CString strFileName, char* szDrive, char* szDir, char* szFile, char* szExt)
00690 {
00691 #if defined( _UNICODE )
00692     char szFileName[ MAX_PATH ];
00693     ::WideCharToMultiByte( CP_ACP, 0, strFileName, -1,
00694         szFileName, MAX_PATH, NULL, NULL );
00695     _splitpath( szFileName, szDrive, szDir, szFile, szExt );
00696 #else
00697     _splitpath( strFileName, szDrive, szDir, szFile, szExt );
00698 #endif
00699 }
00700
00702 // New Context menu functions
00704
00705 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00706 //
00707 //  FUNCTION:       DuplicateItem
00708 //
00709 //  DESCRIPTION:    Makes a copy of the next item in an item ID list.
00710 //
00711 //  INPUT:          pMalloc = Pointer to an IMalloc interface.
00712 //                  pidl    = Pointer to an item ID list.
00713 //
00714 //  RETURNS:        Pointer to an ITEMIDLIST containing the copied item ID.
00715 //
00716 //  NOTES:          It is the caller's responsibility to free the memory
00717 //                  allocated by this function when the item ID is no longer
00718 //                  needed. Example:
00719 //
00720 //                    pidlItem = DuplicateItem (pMalloc, pidl);
00721 //                      .
00722 //                      .
00723 //                      .
00724 //                    pMalloc->Free (pMalloc, pidlItem);
00725 //
00726 //                  Failure to free the ITEMIDLIST will result in memory
00727 //                  leaks.
00728 //
00729 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00730
00731 LPITEMIDLIST CCJShell::DuplicateItem (LPMALLOC pMalloc, LPITEMIDLIST pidl)
00732 {
00733     USHORT nLen;
00734     LPITEMIDLIST pidlNew;
00735
00736     nLen = pidl->mkid.cb;
00737     if (nLen == 0)
00738         return NULL;
00739
00740     pidlNew = (LPITEMIDLIST) pMalloc->Alloc (nLen + sizeof (USHORT));
00741     if (pidlNew == NULL)
00742         return NULL;
00743
00744     CopyMemory (pidlNew, pidl, nLen);
00745     *((USHORT*) (((LPBYTE) pidlNew) + nLen)) = 0;
00746
00747     return pidlNew;
00748 }
00749
00750 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00751 //
00752 //  FUNCTION:       GetNextItem
00753 //
00754 //  DESCRIPTION:    Finds the next item in an item ID list.
00755 //
00756 //  INPUT:          pidl = Pointer to an item ID list.
00757 //
00758 //  RETURNS:        Pointer to the next item.
00759 //
00760 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00761
00762 LPITEMIDLIST CCJShell::GetNextItem (LPITEMIDLIST pidl)
00763 {
00764     USHORT nLen;
00765
00766     if ((nLen = pidl->mkid.cb) == 0)
00767         return NULL;
00768
00769     return (LPITEMIDLIST) (((LPBYTE) pidl) + nLen);
00770 }
00771
00772 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00773 //
00774 //  FUNCTION:       GetItemCount
00775 //
00776 //  DESCRIPTION:    Computes the number of item IDs in an item ID list.
00777 //
00778 //  INPUT:          pidl = Pointer to an item ID list.
00779 //
00780 //  RETURNS:        Number of item IDs in the list.
00781 //
00782 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00783
00784 UINT CCJShell::GetItemCount (LPITEMIDLIST pidl)
00785 {
00786     USHORT nLen;
00787     UINT nCount;
00788
00789     nCount = 0;
00790     while ((nLen = pidl->mkid.cb) != 0) {
00791         pidl = GetNextItem (pidl);
00792         nCount++;
00793     }
00794     return nCount;
00795 }
00796
00797 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00798 //
00799 //  FUNCTION:       DoExplorerMenu
00800 //
00801 //  DESCRIPTION:    Given a path name to a file or folder object, displays
00802 //                  the shell's context menu for that object and executes
00803 //                  the menu command (if any) selected by the user.
00804 //
00805 //  INPUT:          hwnd    = Handle of the window in which the menu will be
00806 //                            displayed.
00807 //
00808 //                  pszPath = Pointer to an ANSI or Unicode string
00809 //                            specifying the path to the object.
00810 //
00811 //                  point   = x and y coordinates of the point where the
00812 //                            menu's upper left corner should be located, in
00813 //                            client coordinates relative to hwnd.
00814 //
00815 //  RETURNS:        TRUE if successful, FALSE if not.
00816 //
00817 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00818
00819 BOOL CCJShell::DoExplorerMenu (HWND hwnd, LPCTSTR pszPath, POINT point)
00820 {
00821     LPMALLOC pMalloc;
00822     LPSHELLFOLDER psfFolder, psfNextFolder;
00823     LPITEMIDLIST pidlMain, pidlItem, pidlNextItem, *ppidl;
00824     LPCONTEXTMENU pContextMenu;
00825     CMINVOKECOMMANDINFO ici;
00826     ULONG ulCount, ulAttr;
00827     TCHAR tchPath[MAX_PATH];
00828     WCHAR wchPath[MAX_PATH];
00829     UINT nCount, nCmd;
00830     BOOL bResult;
00831     HMENU hMenu;
00832
00833     //
00834     // Make sure the file name is fully qualified and in Unicode format.
00835     //
00836     GetFullPathName (pszPath, sizeof (tchPath) / sizeof (TCHAR), tchPath, NULL);
00837
00838 #if defined( _UNICODE )
00839     _tcscpy( wchPath, tchPath );
00840 #else
00841     MultiByteToWideChar (CP_ACP, 0, pszPath, -1, wchPath,
00842         sizeof (wchPath) / sizeof (WCHAR));
00843 #endif
00844
00845     //
00846     // Get pointers to the shell's IMalloc interface and the desktop's
00847     // IShellFolder interface.
00848     //
00849     bResult = FALSE;
00850
00851     if (!SUCCEEDED (SHGetMalloc (&pMalloc)))
00852         return bResult;
00853
00854     if (!SUCCEEDED (SHGetDesktopFolder (&psfFolder))) {
00855         pMalloc->Release();
00856         return bResult;
00857     }
00858
00859     //
00860     // Convert the path name into a pointer to an item ID list (pidl).
00861     //
00862     if (SUCCEEDED (psfFolder->ParseDisplayName (hwnd,
00863         NULL, wchPath, &ulCount, &pidlMain, &ulAttr)) && (pidlMain != NULL))
00864     {
00865         nCount = GetItemCount (pidlMain);
00866
00867         if (nCount) // nCount must be > 0
00868         {
00869             //
00870             // Initialize psfFolder with a pointer to the IShellFolder
00871             // interface of the folder that contains the item whose context
00872             // menu we're after, and initialize pidlItem with a pointer to
00873             // the item's item ID. If nCount > 1, this requires us to walk
00874             // the list of item IDs stored in pidlMain and bind to each
00875             // subfolder referenced in the list.
00876             //
00877             pidlItem = pidlMain;
00878
00879             while (nCount)
00880             {
00881                 --nCount;
00882
00883                 //
00884                 // Create a 1-item item ID list for the next item in pidlMain.
00885                 //
00886                 pidlNextItem = DuplicateItem (pMalloc, pidlItem);
00887                 if (pidlNextItem == NULL) {
00888                     pMalloc->Free (pidlMain);
00889                     psfFolder->Release();
00890                     pMalloc->Release();
00891                     return bResult;
00892                 }
00893
00894                 //
00895                 // Bind to the folder specified in the new item ID list.
00896                 //
00897                 if (!SUCCEEDED (psfFolder->BindToObject (
00898                     pidlNextItem, NULL, IID_IShellFolder, (LPVOID*)&psfNextFolder))) {
00899                     pMalloc->Free (pidlNextItem);
00900                     pMalloc->Free (pidlMain);
00901                     psfFolder->Release ();
00902                     pMalloc->Release ();
00903                     return bResult;
00904                 }
00905
00906                 //
00907                 // Release the IShellFolder pointer to the parent folder
00908                 // and set psfFolder equal to the IShellFolder pointer for
00909                 // the current folder.
00910                 //
00911                 psfFolder->Release ();
00912                 psfFolder = psfNextFolder;
00913
00914                 //
00915                 // Release the storage for the 1-item item ID list we created
00916                 // just a moment ago and initialize pidlItem so that it points
00917                 // to the next item in pidlMain.
00918                 //
00919                 pMalloc->Free (pidlNextItem);
00920                 pidlItem = GetNextItem (pidlItem);
00921             }
00922
00923             //
00924             // Get a pointer to the item's IContextMenu interface and call
00925             // IContextMenu::QueryContextMenu to initialize a context menu.
00926             //
00927             ppidl = &pidlItem;
00928             if (SUCCEEDED (psfFolder->GetUIObjectOf (
00929                 hwnd, 1, (const struct _ITEMIDLIST **)ppidl, IID_IContextMenu, NULL, (LPVOID*)&pContextMenu))) {
00930
00931                 hMenu = CreatePopupMenu ();
00932                 if (SUCCEEDED (pContextMenu->QueryContextMenu (
00933                     hMenu, 0, 1, 0x7FFF, CMF_EXPLORE))) {
00934
00935                     //
00936                     // Display the context menu.
00937                     //
00938                     nCmd = TrackPopupMenu (hMenu, TPM_LEFTALIGN |
00939                         TPM_LEFTBUTTON | TPM_RIGHTBUTTON | TPM_RETURNCMD,
00940                         point.x, point.y, 0, hwnd, NULL);
00941
00942                     //
00943                     // If a command was selected from the menu, execute it.
00944                     //
00945                     if (nCmd) {
00946                         ici.cbSize          = sizeof (CMINVOKECOMMANDINFO);
00947                         ici.fMask           = 0;
00948                         ici.hwnd            = hwnd;
00949                         ici.lpVerb          = (LPCSTR)MAKEINTRESOURCE (nCmd - 1);
00950                         ici.lpParameters    = NULL;
00951                         ici.lpDirectory     = NULL;
00952                         ici.nShow           = SW_SHOWNORMAL;
00953                         ici.dwHotKey        = 0;
00954                         ici.hIcon           = NULL;
00955
00956                         if (SUCCEEDED (
00957                             pContextMenu->InvokeCommand (&ici)))
00958                             bResult = TRUE;
00959                     }
00960                 }
00961                 DestroyMenu (hMenu);
00962                 pContextMenu->Release ();
00963             }
00964         }
00965         pMalloc->Free (pidlMain);
00966     }
00967
00968     //
00969     // Clean up and return.
00970     //
00971     psfFolder->Release ();
00972     pMalloc->Release ();
00973
00974     return bResult;
00975 }
00976
00977 #endif // (_WIN32_IE >= 0x0400)
Generated on Sun Feb 24 01:21:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJShellList.cpp Source File

WinCvs/CJLib/CJLibrary/CJShellList.cpp

Go to the documentation of this file.
00001 // CJShellList.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based upon the MFCENUM example. MFCENUM is a companion sample application
00006 // for Chapter 14 in "Programming the Windows 95 User Interface" by Nancy Cluts,
00007 // available in the Microsoft(R) Development Library.
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:49 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJock/CJLibrary/CJShellList.cpp $
00015  *
00016  * $History: CJShellList.cpp $
00017  *
00018  * *****************  Version 14  *****************
00019  * User: Kirk Stowell Date: 10/30/99   Time: 7:13p
00020  * Updated in $/CodeJock/CJLibrary
00021  * Fixed bug where the list has been sorted, then the directory changes
00022  * and the sorting is lost.
00023  *
00024  * *****************  Version 13  *****************
00025  * User: Kirk Stowell Date: 10/25/99   Time: 10:52p
00026  * Updated in $/CodeJock/CJLibrary
00027  * Modified resource include for static builds.
00028  *
00029  * *****************  Version 12  *****************
00030  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00031  * Updated in $/CodeJock/CJLibrary
00032  * Fixed potential resource and memory leak problems.
00033  *
00034  * *****************  Version 11  *****************
00035  * User: Kirk Stowell Date: 10/14/99   Time: 10:38a
00036  * Updated in $/CodeJock/CJLibrary
00037  * Fixed memory leaks that were associated with PIDL and
00038  * FindFirstFile(...) operations. Removed hideous "goto" statements in
00039  * code. Fixed validation logic and replaced the calls to
00040  * DoTheMenuThing(...) with DoExplorerMenu(...).
00041  *
00042  * *****************  Version 10  *****************
00043  * User: Kirk Stowell Date: 9/13/99    Time: 5:52a
00044  * Updated in $/CodeJockey/CJLibrary
00045  * Fixed build errors which occured with UNICODE builds.
00046  *
00047  * *****************  Version 9  *****************
00048  * User: Kirk Stowell Date: 8/31/99    Time: 4:39a
00049  * Updated in $/CodeJockey/CJLibrary
00050  * Updated copyright and contact information.
00051  *
00052  * *****************  Version 8  *****************
00053  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00054  * Updated in $/CodeJockey/CJLibrary
00055  *
00056  * *****************  Version 7  *****************
00057  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00058  * Updated in $/CodeJockey/CJLibrary
00059  *
00060  * *****************  Version 6  *****************
00061  * User: Kirk Stowell Date: 6/12/99    Time: 3:00a
00062  * Updated in $/CodeJockey/CJ60Lib
00063  * Cleaned up image list, view initialization and sorting to use base
00064  * class virtual function SortList(...).
00065  *
00066  * *****************  Version 5  *****************
00067  * User: Kirk Stowell Date: 5/12/99    Time: 5:32a
00068  * Updated in $/CodeJockey/CJ60Lib
00069  * Added support for vc5 compatibility
00070  *
00071  * *****************  Version 4  *****************
00072  * User: Kirk Stowell Date: 5/12/99    Time: 1:41a
00073  * Updated in $/CodeJockey/CJ60Lib
00074  * Added wait cursor for lengthly processing.
00075  *
00076  * *****************  Version 3  *****************
00077  * User: Kirk Stowell Date: 5/02/99    Time: 3:38p
00078  * Updated in $/CodeJockey/CJ60Lib
00079  * Added version macro  _WIN32_IE, you will need to have at IE4 or greater
00080  * installed to use this class. This will ensure that the version of
00081  * SHELL32.DLL is compatible.
00082  *
00083  * *****************  Version 2  *****************
00084  * User: Kirk Stowell Date: 5/02/99    Time: 2:05a
00085  * Updated in $/CodeJockey/CJ60Lib
00086  * Added flag m_bBuildingList, set to true whenever the list is refreshed
00087  * or initialized.
00088  *
00089  * *****************  Version 1  *****************
00090  * User: Kirk Stowell Date: 3/19/99    Time: 11:03p
00091  * Created in $/CodeJockey/CJ60Lib
00092  * Initial release.
00093  *
00094  ***************************************************************************/
00096
00097 #include "stdafx.h"
00098 #include "CJResource.h"
00099 #include "CJShellTree.h"
00100 #include "CJShellList.h"
00101 #include "CJSortClass.h"
00102
00103 #ifdef _DEBUG
00104 #define new DEBUG_NEW
00105 #undef THIS_FILE
00106 static char THIS_FILE[] = __FILE__;
00107 #endif
00108
00109 #if _WIN32_IE >= 0x0400 // Need to have at IE4 or greater installed.
00110
00112 // CCJShellList
00113
00114 CCJShellList::CCJShellList()
00115 {
00116     m_pTreeCtrl         = NULL;
00117     m_bBuildingList     = FALSE;
00118     m_bShowHidden       = FALSE;
00119 }
00120
00121 CCJShellList::~CCJShellList()
00122 {
00123
00124 }
00125
00126 IMPLEMENT_DYNAMIC(CCJShellList, CCJListCtrl)
00127
00128 BEGIN_MESSAGE_MAP(CCJShellList, CCJListCtrl)
00129     //{{AFX_MSG_MAP(CCJShellList)
00130     ON_NOTIFY_REFLECT(NM_RCLICK, OnRclick)
00131     ON_NOTIFY_REFLECT(LVN_DELETEITEM, OnDeleteitem)
00132     ON_NOTIFY_REFLECT(LVN_GETDISPINFO, OnGetdispinfo)
00133     ON_NOTIFY_REFLECT(NM_DBLCLK, OnRclick)
00134     //}}AFX_MSG_MAP
00135     ON_MESSAGE(WM_SHELL_NOTIFY, OnShellNotify)
00136 END_MESSAGE_MAP()
00137
00139 // CCJShellList message handlers
00140
00141 static DATA_TYPE m_arrColType[] =
00142 {
00143     DT_STRING,      // col 0 sort type string
00144     DT_INT,         // col 1 sort type int
00145     DT_STRING,      // col 2 sort type string
00146     DT_DATETIME     // col 3 sort type date / time
00147 };
00148
00149 bool CCJShellList::SortList( int nCol, bool bAscending )
00150 {
00151     CCJSortClass csc( this, nCol );
00152     csc.Sort( bAscending, m_arrColType[nCol] );
00153     return true;
00154 }
00155
00156 void CCJShellList::OnRclick(NMHDR* pNMHDR, LRESULT* pResult)
00157 {
00158     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
00159     POINT pt;
00160     LV_HITTESTINFO lvhti;
00161     LV_ITEM        lvi;
00162     LPLVITEMDATA   lplvid;  //Long pointer to ListView item data
00163
00164     ::GetCursorPos((LPPOINT)&pt);
00165     ::ScreenToClient(GetSafeHwnd(), &pt);
00166     lvhti.pt=pt;
00167     HitTest(&lvhti);
00168     if (lvhti.flags & LVHT_ONITEM)
00169     {
00170         ::ClientToScreen(GetSafeHwnd(), &pt);
00171         lvi.mask = LVIF_PARAM;
00172         lvi.iItem = lvhti.iItem;
00173         lvi.iSubItem = 0;
00174
00175         if (!GetItem(&lvi))
00176             return;
00177
00178         lplvid=(LPLVITEMDATA)lvi.lParam;
00179
00180         switch (pNMListView->hdr.code)
00181         {
00182         case NM_RCLICK:
00183             {
00184                 CString strFolderPath;
00185                 m_pTreeCtrl->GetSelectedFolderPath(strFolderPath);
00186                 m_shell.DoExplorerMenu(GetSafeHwnd(), strFolderPath, pt);
00187                 break;
00188             }
00189         case NM_DBLCLK:
00190             {
00191                 CString strFolderPath;
00192                 m_pTreeCtrl->GetSelectedFolderPath(strFolderPath);
00193
00194                 if (strFolderPath.GetAt(strFolderPath.GetLength()-1) != '\\')
00195                     strFolderPath += "\\";
00196
00197                 strFolderPath += GetItemText(pNMListView->iItem, 0);
00198
00199                 if ((lplvid->ulAttribs & SFGAO_FOLDER) == SFGAO_FOLDER) {
00200                     m_pTreeCtrl->TunnelTree(strFolderPath);
00201                 }
00202                 else {
00203                     m_shell.ShellExec(strFolderPath, SW_SHOW);
00204                 }
00205             }
00206             break;
00207         }
00208     }
00209
00210     *pResult = 0;
00211 }
00212
00213 void CCJShellList::OnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult)
00214 {
00215     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
00216     HRESULT        hr;
00217     LPMALLOC       lpMalloc;
00218     LPLVITEMDATA   lplvid = (LPLVITEMDATA)pNMListView->lParam;
00219
00220     if (lplvid)
00221     {
00222         //Let's free the memory for the ListView item data...
00223         hr=SHGetMalloc(&lpMalloc);
00224         if (FAILED(hr)) {
00225             return;
00226         }
00227
00228         lplvid->lpsfParent->Release();
00229         lpMalloc->Free(lplvid->lpi);
00230         lpMalloc->Free(lplvid);
00231         lpMalloc->Release();
00232     }
00233
00234     *pResult = 0;
00235 }
00236
00237 void CCJShellList::OnGetdispinfo(NMHDR* pNMHDR, LRESULT* pResult)
00238 {
00239     LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR;
00240     LPLVITEMDATA   lplvid;  //Long pointer to ListView item data
00241     LPTVITEMDATA   lptvid;  //Long pointer to TreeView item data
00242
00243     lplvid = (LPLVITEMDATA)pDispInfo->item.lParam;
00244
00245     if ((pDispInfo) &&(pDispInfo->item.mask & LVIF_IMAGE))
00246     {
00247         ASSERT(m_pTreeCtrl); // Must have a buddy window.
00248
00249         TV_ITEM tvi;
00250         HTREEITEM hti;
00251
00252         hti = m_pTreeCtrl->GetSelectedItem();
00253         tvi.mask = TVIF_PARAM;
00254         tvi.hItem = hti;
00255
00256         m_pTreeCtrl->GetItem(&tvi);
00257
00258         lptvid=(LPTVITEMDATA)tvi.lParam;
00259
00260         pDispInfo->item.iImage = m_shell.GetIcon(m_shell.ConcatPidls(lptvid->lpifq, lplvid->lpi),
00261             SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
00262
00263         if (lplvid->ulAttribs & SFGAO_LINK)
00264         {
00265             pDispInfo->item.mask |= LVIF_STATE;
00266             pDispInfo->item.stateMask = LVIS_OVERLAYMASK;
00267             pDispInfo->item.state = INDEXTOOVERLAYMASK(2);
00268         }
00269         if (pDispInfo->item.mask & LVIF_TEXT)
00270             m_shell.GetName(lplvid->lpsfParent, lplvid->lpi, SHGDN_NORMAL, pDispInfo->item.pszText);
00271     }
00272
00273     *pResult = 0;
00274 }
00275
00276 BOOL CCJShellList::InitSystemImageLists()
00277 {
00278     SHFILEINFO sfi;
00279
00280     HIMAGELIST himlSmall = (HIMAGELIST)::SHGetFileInfo( _T("C:\\"), 0, &sfi,
00281         sizeof(SHFILEINFO), SHGFI_SYSICONINDEX | SHGFI_SMALLICON );
00282
00283     HIMAGELIST himlLarge = (HIMAGELIST)::SHGetFileInfo( _T("C:\\"), 0, &sfi,
00284         sizeof(SHFILEINFO), SHGFI_SYSICONINDEX | SHGFI_LARGEICON );
00285
00286     if( himlSmall && himlLarge ) {
00287         SetImageList( CImageList::FromHandle( himlSmall ), LVSIL_SMALL  );
00288         SetImageList( CImageList::FromHandle( himlLarge ), LVSIL_NORMAL );
00289         return TRUE;
00290     }
00291
00292     return FALSE;
00293 }
00294
00295 BOOL CCJShellList::PopulateListView(LPTVITEMDATA lptvid, LPSHELLFOLDER lpsf)
00296 {
00297     m_bBuildingList = TRUE;
00298     CWaitCursor wait;   // display wait cursor
00299     SetRedraw(FALSE);
00300
00301     // If no image list is defined yet...
00302     if( GetImageList( LVSIL_NORMAL ) == NULL ) {
00303         if( !InitSystemImageLists( )) {
00304             return FALSE;
00305         }
00306     }
00307
00308     // Clear the list control.
00309     DeleteAllItems();
00310
00311     // Initialize the list control.
00312     if ( !InitListViewItems( lptvid, lpsf )) {
00313         m_bBuildingList = FALSE;
00314         return FALSE;
00315     }
00316
00317     // if the list has been previously sorted, sort the
00318     // new contents based upon last sort.
00319     if( m_nSortedCol != -1 ) {
00320         SortList( m_nSortedCol, m_bAscending );
00321     }
00322
00323     m_bBuildingList = FALSE;
00324     SetRedraw();
00325     return TRUE;
00326 }
00327
00328 BOOL CCJShellList::InitListViewItems(LPTVITEMDATA lptvid, LPSHELLFOLDER lpsf)
00329 {
00330     int          iCtr;
00331     HRESULT      hr;
00332     LPMALLOC     lpMalloc;
00333     LPITEMIDLIST lpifqThisItem=NULL;
00334     LPITEMIDLIST lpi=NULL;
00335     LPENUMIDLIST lpe=NULL;
00336     LPLVITEMDATA lplvid;
00337     ULONG        ulFetched, ulAttrs;
00338     HWND         hwnd=::GetParent(GetSafeHwnd());
00339
00340     hr=SHGetMalloc(&lpMalloc);
00341     if (FAILED(hr))
00342        return FALSE;
00343
00344     if (SUCCEEDED(hr))
00345     {
00346         DWORD dwFlags = SHCONTF_FOLDERS | SHCONTF_NONFOLDERS;
00347         if( m_bShowHidden )
00348             dwFlags |= SHCONTF_INCLUDEHIDDEN;
00349         hr=lpsf->EnumObjects( hwnd, dwFlags, &lpe );
00350
00351         if (SUCCEEDED(hr))
00352         {
00353             iCtr = 0;
00354
00355             while (S_OK==lpe->Next(1, &lpi, &ulFetched))
00356             {
00357                 //OK, let's get some memory for our ITEMDATA struct
00358                 lplvid = (LPLVITEMDATA)lpMalloc->Alloc(sizeof(LVITEMDATA));
00359                 if (!lplvid)
00360                 {
00361                     if (lpe) {
00362                         lpe->Release();
00363                     }
00364                     if (lpi && lpMalloc) {
00365                         lpMalloc->Free(lpi);
00366                     }
00367                     if (lpifqThisItem && lpMalloc) {
00368                         lpMalloc->Free(lpifqThisItem);
00369                     }
00370                     if (lpMalloc) {
00371                         lpMalloc->Release();
00372                     }
00373                     return FALSE;
00374                 }
00375
00376                 //Note that since we are interested in the display attributes as well as
00377                 //the other attributes, we need to set ulAttrs to SFGAO_DISPLAYATTRMASK
00378                 //before calling GetAttributesOf();
00379
00380                 ulAttrs=SFGAO_DISPLAYATTRMASK;
00381
00382                 lpsf->GetAttributesOf(1, (const struct _ITEMIDLIST **)&lpi, &ulAttrs);
00383                 lplvid->ulAttribs=ulAttrs;
00384
00385                 lpifqThisItem=m_shell.ConcatPidls(lptvid->lpifq, lpi);
00386
00387                 lplvid->lpsfParent=lpsf;
00388                 lpsf->AddRef();
00389
00390                 //Now, make a copy of the ITEMIDLIST
00391                 lplvid->lpi=m_shell.CopyITEMID(lpMalloc, lpi);
00392
00393                 TCHAR szBuff[256];
00394                 if( m_shell.GetName(lpsf, lpi, SHGDN_NORMAL, szBuff) == FALSE )
00395                 {
00396                     if (lpe) {
00397                         lpe->Release();
00398                     }
00399                     if (lpi && lpMalloc) {
00400                         lpMalloc->Free(lpi);
00401                     }
00402                     if (lpifqThisItem && lpMalloc) {
00403                         lpMalloc->Free(lpifqThisItem);
00404                     }
00405                     if(lplvid && lpMalloc) {
00406                         lplvid->lpsfParent->Release();
00407                         lpMalloc->Free(lplvid->lpi);
00408                         lpMalloc->Free(lplvid);
00409                     }
00410                     if (lpMalloc) {
00411                         lpMalloc->Release();
00412                     }
00413                     return FALSE;
00414                 }
00415
00416                 // Add the item to the listview
00417                 int nIndex = InsertListItem(szBuff);
00418                 if (nIndex != -1)
00419                     SetItemData(nIndex, (LPARAM)lplvid);
00420
00421                 lpMalloc->Free(lpifqThisItem);
00422                 lpMalloc->Free(lpi);  //Finally, free the pidl that the shell gave us...
00423
00424                 lpifqThisItem=0;
00425                 lpi=0;
00426             }
00427         }
00428     }
00429
00430     if (lpe) {
00431         lpe->Release();
00432     }
00433     if (lpMalloc) {
00434         lpMalloc->Release();
00435     }
00436
00437     return TRUE;
00438 }
00439
00440 int CALLBACK CCJShellList::ListViewCompareProc(LPARAM lparam1, LPARAM lparam2, LPARAM /*lparamSort*/)
00441 {
00442     LPLVITEMDATA lplvid1=(LPLVITEMDATA)lparam1;
00443     LPLVITEMDATA lplvid2=(LPLVITEMDATA)lparam2;
00444     HRESULT   hr;
00445
00446     hr = lplvid1->lpsfParent->CompareIDs(0,lplvid1->lpi,lplvid2->lpi);
00447
00448     if (FAILED(hr))
00449         return 0;
00450
00451     return (hr);
00452 }
00453
00454 void CCJShellList::RefreshList()
00455 {
00456     LPTVITEMDATA    lptvid;  //Long pointer to TreeView item data
00457     LPSHELLFOLDER   lpsf2=NULL;
00458     HTREEITEM       hItem = m_pTreeCtrl->GetSelectedItem();
00459     HRESULT         hr;
00460
00461     if( hItem != NULL )
00462     {
00463         lptvid=(LPTVITEMDATA)m_pTreeCtrl->GetItemData(hItem);
00464
00465         if (lptvid && lptvid->lpsfParent && lptvid->lpi)
00466         {
00467             hr=lptvid->lpsfParent->BindToObject(lptvid->lpi,
00468                 0,IID_IShellFolder,(LPVOID *)&lpsf2);
00469
00470             if (SUCCEEDED(hr))
00471             {
00472                 PopulateListView(lptvid,lpsf2);
00473             }
00474         }
00475     }
00476 }
00477
00478 long CCJShellList::OnShellNotify(WPARAM wParam, LPARAM /*lParam*/)
00479 {
00480     switch (wParam)
00481     {
00482     case NM_SH_SHELLMENU:
00483         RefreshList();
00484         break;
00485     }
00486
00487     return 0;
00488 }
00489
00490 int CCJShellList::InsertListItem(CString strFileName, BOOL bParse/*=TRUE*/)
00491 {
00492     WIN32_FIND_DATA FindData;
00493     memset (&FindData, 0, sizeof(WIN32_FIND_DATA));
00494
00495     CString strFolderPath;
00496
00497     if (bParse)
00498     {
00499         m_pTreeCtrl->GetSelectedFolderPath(strFolderPath);
00500
00501         if (strFolderPath.IsEmpty())
00502             return -1;
00503
00504         if (strFolderPath.GetAt(strFolderPath.GetLength()-1) != '\\')
00505             strFolderPath += "\\";
00506
00507         strFolderPath += strFileName;
00508     }
00509
00510     else
00511     {
00512         strFolderPath = strFileName;
00513     }
00514
00515     // First see if the original file exists.
00516     HANDLE hFind = FindFirstFile(strFolderPath, &FindData);
00517
00518     if ( hFind == INVALID_HANDLE_VALUE ) {
00519         strFolderPath += _T(".pif");
00520         hFind = FindFirstFile(strFolderPath, &FindData);
00521     }
00522
00523     if ( hFind != INVALID_HANDLE_VALUE )
00524     {
00525         // close the specified search handle, fixes memory leak.
00526         FindClose(hFind);
00527
00528         CString strBuff;
00529         strBuff.Format(_T("%d"), FindData.nFileSizeLow);
00530
00531         // Add the item to the listview
00532         int nIndex = InsertItem(GetItemCount(),
00533             m_shell.GetDisplayName(strFolderPath), m_shell.GetIconIndex(strFolderPath));
00534
00535         if (nIndex == -1)
00536             return -1;
00537
00538         if (strBuff.Compare(_T("0")))
00539         {
00540             SetItem(nIndex, 1, LVIF_TEXT | LVIF_STATE, m_shell.GetFileSizeString(strBuff),
00541                 0, INDEXTOSTATEIMAGEMASK(1), LVIS_STATEIMAGEMASK, NULL);
00542         }
00543
00544         strBuff = m_shell.GetFileType(strFolderPath);
00545
00546         SetItem(nIndex, 2, LVIF_TEXT | LVIF_STATE, strBuff,
00547             0, INDEXTOSTATEIMAGEMASK(1), LVIS_STATEIMAGEMASK, NULL);
00548         CTime time( FindData.ftLastWriteTime );
00549         strBuff = m_shell.GetLastWriteTime( &time );
00550
00551         SetItem(nIndex, 3, LVIF_TEXT | LVIF_STATE, strBuff,
00552             0, INDEXTOSTATEIMAGEMASK(1), LVIS_STATEIMAGEMASK, NULL);
00553
00554         return nIndex;
00555     }
00556
00557     return -1;
00558 }
00559
00560 void CCJShellList::BuildDefaultColumns()
00561 {
00562     // build the columns used with this control.
00563     int nCols = 4;
00564     int nWidth[] = { 150, 80, 80, 80 };
00565     int nColString[] = { IDS_NAME, IDS_SIZE, IDS_TYPE, IDS_MODIFIED };
00566
00567     BuildColumns(nCols, nWidth, nColString);
00568 }
00569
00570 #endif // (_WIN32_IE >= 0x0400)
Generated on Sun Feb 24 01:21:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJShellTree.cpp Source File

WinCvs/CJLib/CJLibrary/CJShellTree.cpp

Go to the documentation of this file.
00001 // CJShellTree.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based upon the MFCENUM example. MFCENUM is a companion sample application
00006 // for Chapter 14 in "Programming the Windows 95 User Interface" by Nancy Cluts,
00007 // available in the Microsoft(R) Development Library.
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 2000/03/01 21:24:34 $
00013  * $Revision: 1.2 $
00014  * $Archive: /CodeJock/CJLibrary/CJShellTree.cpp $
00015  *
00016  * $History: CJShellTree.cpp $
00017  *
00018  * *****************  Version 11  *****************
00019  * User: Kirk Stowell Date: 10/30/99   Time: 1:59p
00020  * Updated in $/CodeJock/CJLibrary
00021  * Changed base class from CTreeCtrl to CCJTreeCtrl for flicker free
00022  * drawing.
00023  *
00024  * *****************  Version 10  *****************
00025  * User: Kirk Stowell Date: 9/13/99    Time: 5:52a
00026  * Updated in $/CodeJockey/CJLibrary
00027  * Fixed build errors which occured with UNICODE builds.
00028  *
00029  * *****************  Version 9  *****************
00030  * User: Kirk Stowell Date: 8/31/99    Time: 4:39a
00031  * Updated in $/CodeJockey/CJLibrary
00032  * Updated copyright and contact information.
00033  *
00034  * *****************  Version 8  *****************
00035  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00036  * Updated in $/CodeJockey/CJLibrary
00037  *
00038  * *****************  Version 7  *****************
00039  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00040  * Updated in $/CodeJockey/CJLibrary
00041  *
00042  * *****************  Version 6  *****************
00043  * User: Kirk Stowell Date: 6/11/99    Time: 10:14p
00044  * Updated in $/CodeJockey/CJ60Lib
00045  * Cleaned up system image list initialization.
00046  *
00047  * *****************  Version 5  *****************
00048  * User: Kirk Stowell Date: 5/12/99    Time: 5:32a
00049  * Updated in $/CodeJockey/CJ60Lib
00050  * Added support for vc5 compatibility
00051  *
00052  * *****************  Version 4  *****************
00053  * User: Kirk Stowell Date: 5/12/99    Time: 1:41a
00054  * Updated in $/CodeJockey/CJ60Lib
00055  * Added wait cursor for lengthly processing.
00056  *
00057  * *****************  Version 3  *****************
00058  * User: Kirk Stowell Date: 5/02/99    Time: 3:38p
00059  * Updated in $/CodeJockey/CJ60Lib
00060  * Added version macro  _WIN32_IE, you will need to have at IE4 or greater
00061  * installed to use this class. This will ensure that the version of
00062  * SHELL32.DLL is compatible.
00063  *
00064  * *****************  Version 2  *****************
00065  * User: Kirk Stowell Date: 3/19/99    Time: 11:05p
00066  * Updated in $/CodeJockey/CJ60Lib
00067  * Initial re-write and release.
00068  *
00069  * *****************  Version 1  *****************
00070  * User: Kirk Stowell Date: 2/24/99    Time: 11:05p
00071  * Created in $/CodeJockey/CJ60Lib
00072  * Overloaded PopulateTree(LPCTSTR lpszPath) in the class CCJShellTree to
00073  * fill the tree based upon path. Takehiko Mizoguti
00074  * [mizoguti@m2.sys.to.casio.co.jp]
00075  *
00076  ***************************************************************************/
00078
00079 #include "stdafx.h"
00080 #include "CJShellTree.h"
00081 #include "CJShellList.h"
00082 #include "CJShell.h"
00083 #include "CJFlatComboBox.h"
00084 #include <direct.h>
00085
00086 #ifdef _DEBUG
00087 #define new DEBUG_NEW
00088 #undef THIS_FILE
00089 static char THIS_FILE[] = __FILE__;
00090 #endif
00091
00092 #if _WIN32_IE >= 0x0400 // Need to have at IE4 or greater installed.
00093 #include <Shlwapi.h>
00094
00096 // CCJShellTree
00097
00098 CCJShellTree::CCJShellTree()
00099 {
00100     m_pListCtrl     = NULL;
00101     m_pComboBox     = NULL;
00102     m_bRefresh      = false;
00103     m_bOutaHere     = false;
00104     m_htiCurrent    = NULL;
00105 }
00106
00107 CCJShellTree::~CCJShellTree()
00108 {
00109 }
00110
00111 IMPLEMENT_DYNAMIC(CCJShellTree, CCJTreeCtrl)
00112
00113 BEGIN_MESSAGE_MAP(CCJShellTree, CCJTreeCtrl)
00114     //{{AFX_MSG_MAP(CCJShellTree)
00115     ON_NOTIFY_REFLECT(NM_RCLICK, OnRclick)
00116     ON_NOTIFY_REFLECT(TVN_DELETEITEM, OnDeleteitem)
00117     ON_NOTIFY_REFLECT(TVN_SELCHANGED, OnSelchanged)
00118     ON_NOTIFY_REFLECT(TVN_ITEMEXPANDING, OnItemexpanding)
00119     ON_WM_DESTROY()
00120     ON_WM_CREATE()
00121     //}}AFX_MSG_MAP
00122 END_MESSAGE_MAP()
00123
00125 // CCJShellTree message handlers
00126
00127 void CCJShellTree::OnFill(bool bRefresh/*=false*/)
00128 {
00129     LPSHELLFOLDER lpsf=NULL;
00130     HRESULT hr;
00131     TV_SORTCB      tvscb;
00132
00133     m_bRefresh = bRefresh;
00134
00135     // Get a pointer to the desktop folder.
00136     hr=SHGetDesktopFolder(&lpsf);
00137
00138     if (SUCCEEDED(hr))
00139     {
00140         // Initialize the tree view to be empty.
00141         DeleteAllItems();
00142
00143         // Fill in the tree view from the root.
00144         FillTreeView(lpsf,
00145             NULL,
00146             TVI_ROOT);
00147         // Release the folder pointer.
00148         lpsf->Release();
00149     }
00150     tvscb.hParent     = TVI_ROOT;
00151     tvscb.lParam      = 0;
00152     tvscb.lpfnCompare = TreeViewCompareProc;
00153
00154     // Sort the items in the tree view
00155     SortChildrenCB(&tvscb/*, FALSE*/);
00156
00157     Expand(GetRootItem(), TVE_EXPAND);
00158 }
00159
00160 void CCJShellTree::FillTreeView(LPSHELLFOLDER lpsf, LPITEMIDLIST  lpifq, HTREEITEM hParent)
00161 {
00162     TV_ITEM         tvi;                          // TreeView Item.
00163     TV_INSERTSTRUCT tvins;                        // TreeView Insert Struct.
00164     HTREEITEM       hPrev = NULL;                 // Previous Item Added.
00165     LPENUMIDLIST    lpe=0;
00166     LPITEMIDLIST    lpi=0, lpifqThisItem=0;
00167     LPTVITEMDATA    lptvid=0;
00168     LPMALLOC        lpMalloc=0;
00169     ULONG           ulFetched;
00170     HRESULT         hr;
00171     TCHAR           szBuff[MAX_PATH];
00172     HWND            hwnd=GetParent()->GetSafeHwnd();
00173
00174     hr=SHGetMalloc(&lpMalloc);
00175     if (FAILED(hr))
00176        return;
00177
00178     // Hourglass on!
00179
00180     SetCapture();
00181     CWaitCursor wait;   // display wait cursor
00182
00183     if (SUCCEEDED(hr))
00184     {
00185         SetRedraw(FALSE);
00186
00187         hr=lpsf->EnumObjects(hwnd,
00188             SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &lpe);
00189
00190         if (SUCCEEDED(hr))
00191         {
00192             while (S_OK==lpe->Next(1, &lpi, &ulFetched))
00193             {
00194                 //Create a fully qualified path to the current item
00195                 //The SH* shell api's take a fully qualified path pidl,
00196                 //(see GetIcon above where I call SHGetFileInfo) whereas the
00197                 //interface methods take a relative path pidl.
00198
00199                 ULONG ulAttrs = SFGAO_HASSUBFOLDER | SFGAO_FOLDER;
00200
00201                 lpsf->GetAttributesOf(1, (const struct _ITEMIDLIST **)&lpi, &ulAttrs);
00202
00203                 if (ulAttrs & (SFGAO_HASSUBFOLDER | SFGAO_FOLDER))
00204                 {
00205                    //We need this next if statement so that we don't add things like
00206                    //the MSN to our tree.  MSN is not a folder, but according to the
00207                    //shell is has subfolders....
00208
00209                    if (ulAttrs & SFGAO_FOLDER)
00210                    {
00211                       tvi.mask            = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE |
00212                                             TVIF_PARAM;
00213
00214                       if (ulAttrs & SFGAO_HASSUBFOLDER)
00215                       {
00216                          //This item has sub-folders, so let's put the + in the TreeView.
00217                          //The first time the user clicks on the item, we'll populate the
00218                          //sub-folders then.
00219
00220                          tvi.cChildren=1;
00221                          tvi.mask |= TVIF_CHILDREN;
00222                       }
00223
00224                       //OK, let's get some memory for our ITEMDATA struct
00225
00226                       lptvid = (LPTVITEMDATA)lpMalloc->Alloc(sizeof(TVITEMDATA));
00227                       if (!lptvid)
00228                          goto Done;
00229
00230                       //Now get the friendly name that we'll put in the treeview...
00231
00232                       if( m_shell.GetName(lpsf, lpi, SHGDN_NORMAL, szBuff) == FALSE ) {
00233                          goto Done;
00234                       }
00235
00236                       tvi.pszText    = szBuff;
00237                       tvi.cchTextMax = MAX_PATH;
00238
00239                       lpifqThisItem=m_shell.ConcatPidls(lpifq, lpi);
00240
00241                       //Now, make a copy of the ITEMIDLIST
00242
00243                       lptvid->lpi=m_shell.CopyITEMID(lpMalloc, lpi);
00244
00245                       m_shell.GetNormalAndSelectedIcons(lpifqThisItem, &tvi);
00246
00247                       lptvid->lpsfParent=lpsf;    //Store the parent folders SF
00248                       lpsf->AddRef();
00249
00250                       //So, you ask, what's the story here?  Why do we have 2
00251                       //functions that apparently do the same thing?  Well,
00252                       //ParseDisplayName() (used in GetFullyQualPidl) does not
00253                       //work well for non-file system objects such as the My
00254                       //Computer and Net Hood.  So, since we know that these
00255                       //guys will only show up when we are enumerating the root
00256                       //of the namespace (as identified by an hParent of TVI_ROOT),
00257                       //we special case this here.  You *could* use ConcatPidls()
00258                       //in ALL cases, but the GetFullyQualPidl() is shown for
00259                       //demonstration purposes, since it's the more intuative way.
00260
00261 //Commented out for now, since we need ConcatPidls for *any* non-file system object.
00262 //This includes things like Control Panel, et al.
00263
00264 //                      if (hParent==TVI_ROOT)
00265                          lptvid->lpifq=m_shell.ConcatPidls(lpifq, lpi);
00266 //                      else
00267 //                         lptvid->lpifq=GetFullyQualPidl(lpsf, lpi);
00268
00269                       tvi.lParam = (LPARAM)lptvid;
00270
00271                       // Populate the TreeVeiw Insert Struct
00272                       // The item is the one filled above.
00273                       // Insert it after the last item inserted at this level.
00274                       // And indicate this is a root entry.
00275
00276                       tvins.item         = tvi;
00277                       tvins.hInsertAfter = hPrev;
00278                       tvins.hParent      = hParent;
00279
00280                       // Add the item to the tree
00281
00282                       hPrev = InsertItem(&tvins);
00283                    }
00284
00285                    lpMalloc->Free(lpifqThisItem);
00286                    lpifqThisItem=0;
00287                 }
00288
00289                 lpMalloc->Free(lpi);  //Finally, free the pidl that the shell gave us...
00290                 lpi=0;
00291             }
00292         }
00293
00294     }
00295     else {
00296         SetRedraw();
00297         return;
00298     }
00299
00300 Done:
00301
00302     // Hourglass off!
00303
00304     ReleaseCapture();
00305
00306     if (lpe)  lpe->Release();
00307
00308     //The following 2 if statements will only be TRUE if we got here on an
00309     //error condition from the "goto" statement.  Otherwise, we free this memory
00310     //at the end of the while loop above.
00311     if (lpi && lpMalloc)           lpMalloc->Free(lpi);
00312     if (lpifqThisItem && lpMalloc) lpMalloc->Free(lpifqThisItem);
00313
00314     if (lpMalloc) lpMalloc->Release();
00315     SetRedraw();
00316 }
00317
00318 void CCJShellTree::OnRclick(NMHDR* /*pNMHDR*/, LRESULT* pResult)
00319 {
00320     *pResult = 0;
00321
00322     POINT           pt;
00323     LPTVITEMDATA    lptvid;  //Long pointer to TreeView item data
00324     static char     szBuff[MAX_PATH];
00325     TV_HITTESTINFO  tvhti;
00326     TV_ITEM         tvi;
00327
00328     ::GetCursorPos((LPPOINT)&pt);
00329     ::ScreenToClient(m_hWnd, &pt);
00330     tvhti.pt=pt;
00331     HitTest(&tvhti);
00332     SelectItem(tvhti.hItem);
00333     if (tvhti.flags & TVHT_ONITEMLABEL)
00334     {
00335         ::ClientToScreen(m_hWnd, &pt);
00336         tvi.mask=TVIF_PARAM;
00337         tvi.hItem=tvhti.hItem;
00338
00339         if (!GetItem(&tvi))
00340             return;
00341
00342         lptvid=(LPTVITEMDATA)tvi.lParam;
00343
00344         m_shell.DoTheMenuThing(::GetParent(m_hWnd),
00345             lptvid->lpsfParent, lptvid->lpi, &pt);
00346     }
00347 }
00348
00349 void CCJShellTree::OnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult)
00350 {
00351     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00352     *pResult = 0;
00353
00354     HRESULT        hr;
00355     LPMALLOC       lpMalloc;
00356     LPTVITEMDATA   lptvid;  //Long pointer to TreeView item data
00357
00358     //Let's free the memory for the TreeView item data...
00359     hr=SHGetMalloc(&lpMalloc);
00360     if (FAILED(hr))
00361         return;
00362
00363     lptvid=(LPTVITEMDATA)pNMTreeView->itemOld.lParam;
00364     lptvid->lpsfParent->Release();
00365     lpMalloc->Free(lptvid->lpi);
00366     lpMalloc->Free(lptvid->lpifq);
00367     lpMalloc->Free(lptvid);
00368     lpMalloc->Release();
00369 }
00370
00371 void CCJShellTree::OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult)
00372 {
00373     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00374     LPTVITEMDATA    lptvid;  //Long pointer to TreeView item data
00375     LPSHELLFOLDER   lpsf2=NULL;
00376     HRESULT         hr;
00377
00378     SetRedraw(FALSE);
00379     //Do this only if we are not exiting the application...
00380     if (!m_bOutaHere)
00381     {
00382         lptvid=(LPTVITEMDATA)pNMTreeView->itemNew.lParam;
00383         if (lptvid)
00384         {
00385             hr=lptvid->lpsfParent->BindToObject(lptvid->lpi,
00386                 0,IID_IShellFolder,(LPVOID *)&lpsf2);
00387
00388             if (SUCCEEDED(hr) && (m_bRefresh == false))
00389             {
00390                 // get the current directory.
00391                 CString strFolderPath;
00392                 GetSelectedFolderPath(strFolderPath);
00393
00394                 // get a handle to the currently selected item and set the
00395                 // working directory.
00396                 m_htiCurrent = pNMTreeView->itemNew.hItem;
00397                 SetCurrentDirectory( strFolderPath );
00398
00399                 if (m_pListCtrl->GetSafeHwnd())
00400                 {
00401                     m_pListCtrl->PopulateListView(lptvid,lpsf2);
00402                     lpsf2->Release();
00403                 }
00404                 if( m_pComboBox->GetSafeHwnd( ))
00405                 {
00406                     int nFound = m_pComboBox->FindString(-1, strFolderPath);
00407                     if (nFound == CB_ERR) {
00408                         m_pComboBox->SetCurSel( m_pComboBox->AddString( strFolderPath ));
00409                     }
00410                     else {
00411                         m_pComboBox->SetCurSel(nFound);
00412                     }
00413                 }
00414             }
00415         }
00416     }
00417
00418     SetRedraw();
00419     *pResult = 0;
00420 }
00421
00422 void CCJShellTree::OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult)
00423 {
00424     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00425     *pResult = 0;
00426
00427     LPTVITEMDATA   lptvid;  //Long pointer to TreeView item data
00428     HRESULT        hr;
00429     LPSHELLFOLDER  lpsf2=NULL;
00430     static char    szBuff[MAX_PATH];
00431     TV_SORTCB      tvscb;
00432
00433     if ((pNMTreeView->itemNew.state & TVIS_EXPANDEDONCE))
00434         return;
00435
00436     SetRedraw(FALSE);
00437     lptvid=(LPTVITEMDATA)pNMTreeView->itemNew.lParam;
00438     if (lptvid)
00439     {
00440         hr=lptvid->lpsfParent->BindToObject(lptvid->lpi,
00441             0, IID_IShellFolder,(LPVOID *)&lpsf2);
00442
00443         if (SUCCEEDED(hr))
00444         {
00445             FillTreeView(lpsf2,
00446                 lptvid->lpifq,
00447                 pNMTreeView->itemNew.hItem);
00448         }
00449
00450         tvscb.hParent     = pNMTreeView->itemNew.hItem;
00451         tvscb.lParam      = 0;
00452         tvscb.lpfnCompare = TreeViewCompareProc;
00453
00454         SortChildrenCB(&tvscb/*, FALSE*/);
00455     }
00456     SetRedraw();
00457 }
00458
00459 int CALLBACK CCJShellTree::TreeViewCompareProc(LPARAM lparam1, LPARAM lparam2, LPARAM /*lparamSort*/)
00460 {
00461     LPTVITEMDATA lptvid1=(LPTVITEMDATA)lparam1;
00462     LPTVITEMDATA lptvid2=(LPTVITEMDATA)lparam2;
00463     HRESULT   hr;
00464
00465     hr = lptvid1->lpsfParent->CompareIDs(0, lptvid1->lpi, lptvid2->lpi);
00466
00467     if (FAILED(hr))
00468        return 0;
00469
00470     return (short)SCODE_CODE(GetScode(hr));
00471 }
00472
00473 BOOL CCJShellTree::InitSystemImageLists()
00474 {
00475     SHFILEINFO sfi;
00476
00477     HIMAGELIST hImageList = (HIMAGELIST)::SHGetFileInfo( _T("C:\\"), 0, &sfi,
00478         sizeof(SHFILEINFO), SHGFI_SYSICONINDEX | SHGFI_SMALLICON );
00479
00480     if( hImageList ) {
00481         SetImageList( CImageList::FromHandle( hImageList ), TVSIL_NORMAL  );
00482         return TRUE;
00483     }
00484
00485     return FALSE;
00486 }
00487
00488 void CCJShellTree::OnDestroy()
00489 {
00490     m_bOutaHere = false;
00491     CCJTreeCtrl::OnDestroy();
00492 }
00493
00494 void CCJShellTree::TunnelTree(CString strFindPath)
00495 {
00496     HTREEITEM subNode = GetRootItem();
00497     CString szPathHop;
00498     char drive[_MAX_DRIVE];
00499     char dir[_MAX_DIR];
00500     char fname[_MAX_FNAME];
00501     char ext[_MAX_EXT];
00502     char delimiter[]="\\";
00503
00504     m_bRefresh = false;
00505
00506     if(!m_shell.Exist(strFindPath))
00507     {
00508         if (strFindPath.GetLength() == 3)
00509         {
00510         }
00511
00512         else
00513         {
00514             MessageBox(strFindPath,_T("Folder not found"),MB_ICONERROR);
00515             return;
00516         }
00517     }
00518
00519     if(strFindPath.ReverseFind(_T('\\')) != strFindPath.GetLength()-1)
00520     {
00521         strFindPath += _T("\\");
00522     }
00523
00524     m_shell.SplitPath(strFindPath,drive,dir,fname,ext);
00525
00526     //search the drive first
00527     szPathHop=drive;
00528     subNode=GetChildItem(subNode);
00529
00530     if(subNode)
00531     {
00532         if(SearchTree(subNode,szPathHop, CCJShellTree::type_drive))
00533         {
00534             SetRedraw(FALSE);
00535             //break down subfolders and search
00536             char *p=strtok(dir,delimiter);
00537             while(p)
00538             {
00539                 subNode = GetSelectedItem();
00540                 Expand(subNode, TVE_EXPAND);
00541                 subNode = GetChildItem(subNode);
00542
00543                 if(SearchTree(subNode,p,CCJShellTree::type_folder))
00544                     p=strtok(NULL,delimiter);
00545                 else
00546                     p=NULL;
00547             }
00548             SetRedraw();
00549         }
00550     }
00551 }
00552
00553 BOOL CCJShellTree::SearchTree(HTREEITEM treeNode, CString szSearchName, FindAttribs attr)
00554 {
00555     LPTVITEMDATA    lptvid;  //Long pointer to TreeView item data
00556     LPSHELLFOLDER   lpsf2=NULL;
00557     char    drive[_MAX_DRIVE];
00558     char    dir[_MAX_DIR];
00559     char    fname[_MAX_FNAME];
00560     char    ext[_MAX_EXT];
00561     BOOL    bRet=FALSE;
00562     HRESULT hr;
00563     CString strCompare;
00564
00565     szSearchName.MakeUpper();
00566     while(treeNode && bRet==FALSE)
00567     {
00568         lptvid=(LPTVITEMDATA)GetItemData(treeNode);
00569         if (lptvid && lptvid->lpsfParent && lptvid->lpi)
00570         {
00571             hr=lptvid->lpsfParent->BindToObject(lptvid->lpi,
00572                 0,IID_IShellFolder,(LPVOID *)&lpsf2);
00573             if (SUCCEEDED(hr))
00574             {
00575                 ULONG ulAttrs = SFGAO_FILESYSTEM;
00576                 lptvid->lpsfParent->GetAttributesOf(1, (const struct _ITEMIDLIST **)&lptvid->lpi, &ulAttrs);
00577                 if (ulAttrs & (SFGAO_FILESYSTEM))
00578                 {
00579                     if(SHGetPathFromIDList(lptvid->lpifq,strCompare.GetBuffer(MAX_PATH)))
00580                     {
00581                         switch(attr)
00582                         {
00583                         case type_drive:
00584                             m_shell.SplitPath(strCompare,drive,dir,fname,ext);
00585                             strCompare=drive;
00586                             break;
00587                         case type_folder:
00588                             strCompare = GetItemText(treeNode);
00589                             break;
00590                         }
00591                         strCompare.MakeUpper();
00592                         if(strCompare == szSearchName)
00593                         {
00594                             EnsureVisible(treeNode);
00595                             SelectItem(treeNode);
00596                             bRet=TRUE;
00597                         }
00598                     }
00599                 }
00600                 lpsf2->Release();
00601             }
00602         }
00603         treeNode = GetNextSiblingItem(treeNode);
00604     }
00605     return bRet;
00606 }
00607
00608 BOOL CCJShellTree::GetSelectedFolderPath(CString &strFolderPath)
00609 {
00610     LPTVITEMDATA    lptvid;  //Long pointer to TreeView item data
00611     LPSHELLFOLDER   lpsf2=NULL;
00612     static TCHAR    szBuff[MAX_PATH];
00613     HTREEITEM       hItem = GetSelectedItem();
00614     HRESULT         hr;
00615     BOOL            bRet=FALSE;
00616
00617     if( hItem != NULL )
00618     {
00619         lptvid=(LPTVITEMDATA)GetItemData(hItem);
00620
00621         if (lptvid && lptvid->lpsfParent && lptvid->lpi)
00622         {
00623             hr=lptvid->lpsfParent->BindToObject(lptvid->lpi,
00624                 0,IID_IShellFolder,(LPVOID *)&lpsf2);
00625
00626             if (SUCCEEDED(hr))
00627             {
00628                 ULONG ulAttrs = SFGAO_FOLDER;
00629
00630                 // Determine what type of object we have.
00631                 lptvid->lpsfParent->GetAttributesOf(1,
00632                     (const struct _ITEMIDLIST **)&lptvid->lpi, &ulAttrs);
00633
00634                 if (ulAttrs & (SFGAO_FOLDER))
00635                 {
00636                     if(SHGetPathFromIDList(lptvid->lpifq,szBuff)){
00637                         strFolderPath = szBuff;
00638                         bRet = TRUE;
00639                     }
00640                 }
00641             }
00642
00643         }
00644         if(lpsf2)
00645             lpsf2->Release();
00646     }
00647
00648     return bRet;
00649 }
00650
00651 BOOL CCJShellTree::GetFolderItemPath(HTREEITEM hItem, CString &strFolderPath)
00652 {
00653     LPTVITEMDATA    lptvid;  //Long pointer to TreeView item data
00654     LPSHELLFOLDER   lpsf2=NULL;
00655     static TCHAR    szBuff[MAX_PATH];
00656     HRESULT         hr;
00657     BOOL            bRet=FALSE;
00658
00659     lptvid=(LPTVITEMDATA)GetItemData(hItem);
00660
00661     if (lptvid && lptvid->lpsfParent && lptvid->lpi)
00662     {
00663         hr=lptvid->lpsfParent->BindToObject(lptvid->lpi,
00664             0,IID_IShellFolder,(LPVOID *)&lpsf2);
00665
00666         if (SUCCEEDED(hr))
00667         {
00668             ULONG ulAttrs = SFGAO_FILESYSTEM;
00669
00670             // Determine what type of object we have.
00671             lptvid->lpsfParent->GetAttributesOf(1, (const struct _ITEMIDLIST **)&lptvid->lpi, &ulAttrs);
00672
00673             if (ulAttrs & (SFGAO_FILESYSTEM))
00674             {
00675                 if(SHGetPathFromIDList(lptvid->lpifq,szBuff)){
00676                     strFolderPath = szBuff;
00677                     bRet = TRUE;
00678                 }
00679             }
00680         }
00681
00682         if(lpsf2)
00683             lpsf2->Release();
00684     }
00685
00686     return bRet;
00687 }
00688
00689 void CCJShellTree::PopulateTree(LPCTSTR lpszPath)
00690 {
00691     LPSHELLFOLDER lpsf=NULL,lpsf2=NULL;
00692     LPITEMIDLIST  lpi=NULL;
00693     HRESULT hr;
00694     TV_SORTCB      tvscb;
00695     LPTSTR          lpFolder = (LPTSTR)lpszPath;
00696     LPTSTR          lpNextFolder;
00697     TCHAR           strPath[_MAX_PATH];
00698
00699     LPMALLOC pMalloc;
00700     if (::SHGetMalloc(&pMalloc) == NOERROR)
00701     {
00702
00703         // Get a pointer to the desktop folder.
00704         hr=SHGetDesktopFolder(&lpsf);
00705
00706         if (SUCCEEDED(hr))
00707         {
00708             USES_CONVERSION;
00709
00710             // Initialize the tree view to be empty.
00711             DeleteAllItems();
00712
00713             do{
00714
00715                 // Get the Next Component
00716                 lpNextFolder = PathFindNextComponent( lpFolder );
00717                 if( lpNextFolder && *lpNextFolder ){
00718                     memcpy( strPath, lpFolder, ( lpNextFolder - lpFolder ) );
00719                     strPath[lpNextFolder - lpFolder] = _T('\0');
00720                 }
00721                 else{
00722                     _tcscpy( strPath, lpFolder );
00723                     lpNextFolder = NULL;
00724                 }
00725
00726                 // Get ShellFolder Pidl
00727                 ULONG eaten;
00728                 hr = lpsf->ParseDisplayName( NULL, NULL, T2OLE(strPath), &eaten, &lpi, NULL );
00729                 if( FAILED( hr ) ){
00730                     break;
00731                 }
00732                 hr=lpsf->BindToObject(lpi, 0, IID_IShellFolder,(LPVOID *)&lpsf2);
00733                 if( FAILED( hr ) ){
00734                     break;
00735                 }
00736
00737                 pMalloc->Free( lpi );
00738
00739                 // Release the Parent Folder pointer.
00740                 lpsf->Release();
00741
00742                 // Chenge Folder Info
00743                 lpsf = lpsf2;
00744                 lpFolder = lpNextFolder;
00745             }
00746             while( lpNextFolder );
00747
00748             FillTreeView(lpsf,NULL,TVI_ROOT);
00749
00750         }
00751     }
00752     tvscb.hParent     = TVI_ROOT;
00753     tvscb.lParam      = 0;
00754     tvscb.lpfnCompare = TreeViewCompareProc;
00755
00756     // Sort the items in the tree view
00757     SortChildrenCB(&tvscb/*, FALSE*/);
00758
00759     HTREEITEM hItem;
00760     hItem = GetRootItem();
00761     Expand(hItem,TVE_EXPAND);
00762     Select(GetRootItem(),TVGN_CARET);
00763 }
00764
00765 int CCJShellTree::OnCreate(LPCREATESTRUCT lpCreateStruct)
00766 {
00767     if (CCJTreeCtrl::OnCreate(lpCreateStruct) == -1)
00768         return -1;
00769
00770     // Attach the system image list, and build the tree.
00771     InitSystemImageLists();
00772     OnFill();
00773
00774     return 0;
00775 }
00776
00777 BOOL CCJShellTree::PreCreateWindow(CREATESTRUCT& cs)
00778 {
00779     if( !CCJTreeCtrl::PreCreateWindow(cs))
00780         return FALSE;
00781
00782     cs.style |= TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_SHOWSELALWAYS;
00783
00784     return TRUE;
00785 }
00786
00787 #endif // (_WIN32_IE >= 0x0400)
Generated on Sun Feb 24 01:21:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJSizeDockBar.cpp Source File

WinCvs/CJLib/CJLibrary/CJSizeDockBar.cpp

Go to the documentation of this file.
00001 // CJSizeDockBar.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/CJLibrary/CJSizeDockBar.cpp $
00011  *
00012  * $History: CJSizeDockBar.cpp $
00013  *
00014  * *****************  Version 12  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:14p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Minor update to tracker.
00018  *
00019  * *****************  Version 11  *****************
00020  * User: Kirk Stowell Date: 10/29/99   Time: 12:44a
00021  * Updated in $/CodeJock/CJLibrary
00022  * Added static member variable CCJSizeDockBar::m_bIsDockBar used for save
00023  * and restore bar state.
00024  *
00025  * *****************  Version 10  *****************
00026  * User: Kirk Stowell Date: 10/15/99   Time: 1:28a
00027  * Updated in $/CodeJock/CJLibrary
00028  * Fixed bug with just clicking on the sizing tracker and the control bar
00029  * resizing one pixel to the left or right. The bar will only be sized if
00030  * the cursor has changed its location.
00031  *
00032  * *****************  Version 9  *****************
00033  * User: Kirk Stowell Date: 9/16/99    Time: 2:35p
00034  * Updated in $/CodeJockey/CJLibrary
00035  * Fixed bug with save / restore bar state, and with saved bar size
00036  * changing whenever the application starts.
00037  *
00038  * *****************  Version 8  *****************
00039  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00040  * Updated in $/CodeJockey/CJLibrary
00041  * Updated copyright and contact information.
00042  *
00043  * *****************  Version 7  *****************
00044  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00045  * Updated in $/CodeJockey/CJLibrary
00046  *
00047  * *****************  Version 6  *****************
00048  * User: Kirk Stowell Date: 7/18/99    Time: 10:29p
00049  * Updated in $/CodeJockey/CJLibrary
00050  * Added vc5 compatibility.
00051  *
00052  * *****************  Version 5  *****************
00053  * User: Kirk Stowell Date: 6/09/99    Time: 8:33p
00054  * Updated in $/CodeJockey/CJ60Lib
00055  * Ioannhs Stamatopoulos (Yiannhs) [ystamat@mail.datamedia.gr] - Extended
00056  * docking windows, removed ::GetSysColor(...) calls and WM_SYSCOLORCHANGE
00057  * message handler, this is now automatically handled by the base class.
00058  * Added redraw flags to the create method and modified paint and layout
00059  * handlers to reduce flicker and un-necessary command handling. Dragging
00060  * rect now reflects actual control bar docked size. Added "flat" look to
00061  * the control bars, the control bars can now use the classic DevStudio
00062  * look, or use flat gradient gripper, borders and frame buttons. Overall,
00063  * docking windows now handle dragging, docking and floating much better,
00064  * and behave more like DevStudio.
00065  *
00066  * *****************  Version 4  *****************
00067  * User: Kirk Stowell Date: 4/14/99    Time: 11:07p
00068  * Updated in $/CodeJockey/CJ60Lib
00069  * Changed CFrameWnd *pFrame = (CFrameWnd*)AfxGetApp()->m_pMainWnd; to
00070  * CFrameWnd *pFrame = GetParentFrame(); see line 432.
00071  *
00072  * *****************  Version 3  *****************
00073  * User: Kirk Stowell Date: 4/03/99    Time: 11:06p
00074  * Updated in $/CodeJockey/CJ60Lib
00075  * Added comments and cleaned up code.
00076  *
00077  * *****************  Version 2  *****************
00078  * User: Kirk Stowell Date: 1/29/99    Time: 11:06p
00079  * Updated in $/CodeJockey/CJ60Lib
00080  * Made some cosmetic enhancements to more closely match DevStudio docking
00081  * windows.
00082  *
00083  * *****************  Version 1  *****************
00084  * User: Kirk Stowell Date: 1/12/99    Time: 11:06p
00085  * Created in $/CodeJockey/CJ60Lib
00086  * Initial release to add side-by-side docking support for CCJControlBar
00087  * class.
00088  *
00089  ***************************************************************************/
00091
00092 #include "stdafx.h"
00093 #include "CJSizeDockBar.h"
00094 #include "CJControlBar.h"
00095 #include "CJToolBar.h"
00096 #include "CJResource.h"
00097
00098 #ifdef _DEBUG
00099 #define new DEBUG_NEW
00100 #undef THIS_FILE
00101 static char THIS_FILE[] = __FILE__;
00102 #endif
00103
00104 #define TRACK_BORDER_SIZE       4
00105
00106 bool CCJSizeDockBar::m_bIsDockBar = false;
00107
00109 // CCJSizeDockBar
00110
00111 CCJSizeDockBar::CCJSizeDockBar()
00112 {
00113     m_cxLeftBorder      = 0;
00114     m_cyTopBorder       = 0;
00115     m_cxRightBorder     = 0;
00116     m_cyBottomBorder    = 0;
00117     m_iActualSize       = 100;
00118     m_iSafeSpace        = 25;
00119     m_bOkToDrag         = FALSE;
00120     m_bDragging         = FALSE;
00121     m_bAutoDelete       = TRUE;
00122     m_bFlatBorder       = TRUE;     //Yiannhs v6.06 for Docking bar flat border
00123     m_ptCurrent         = CPoint(0,0);
00124 }
00125
00126 CCJSizeDockBar::~CCJSizeDockBar()
00127 {
00128     // TODO: add destruction code here.
00129 }
00130
00131 IMPLEMENT_DYNAMIC(CCJSizeDockBar, CDockBar)
00132
00133 BEGIN_MESSAGE_MAP(CCJSizeDockBar, CDockBar)
00134     //{{AFX_MSG_MAP(CCJSizeDockBar)
00135     ON_WM_NCPAINT()
00136     ON_WM_NCCALCSIZE()
00137     ON_WM_SETCURSOR()
00138     ON_WM_NCHITTEST()
00139     ON_WM_NCLBUTTONDOWN()
00140     ON_WM_LBUTTONUP()
00141     ON_WM_MOUSEMOVE()
00142     //}}AFX_MSG_MAP
00143 END_MESSAGE_MAP()
00144
00146 // CCJSizeDockBar overrides
00147
00148 CSize CCJSizeDockBar::CalcDynamicLayout(int /*nLength*/, DWORD nMode)
00149 {
00150     int ActualSize = 0;
00151     for(int i=0;i<= m_arrBars.GetUpperBound();++i)
00152     {
00153         CCJControlBar *pBar = (CCJControlBar *)GetDockedControlBar(i);
00154         if (pBar != NULL && pBar->IsVisible())
00155         {
00156             ActualSize = m_iActualSize;
00157             break;
00158         }
00159     }
00160
00161     int cx=0,cy=0;
00162     if (nMode & LM_VERTDOCK) {
00163         cx = ActualSize ;
00164         cy = 32767;
00165     }
00166
00167     if (nMode & LM_HORZDOCK) {
00168         cx= 32767;
00169         cy = ActualSize;
00170     }
00171
00172     //Yiannhs. Use selective layout. Since the dock bar does not calculate the bar sizes yet
00173     if( !m_bLayoutQuery )
00174         CalcSizeBarLayout();
00175
00176     return CSize(cx,cy);
00177 }
00178
00179 void CCJSizeDockBar::DoPaint(CDC *pDC)
00180 {
00181     CDockBar::DoPaint(pDC);
00182 }
00183
00184 void CCJSizeDockBar::OnInvertTracker(const CRect& rect)
00185 {
00186     ASSERT_VALID(this);
00187     ASSERT(!rect.IsRectEmpty());
00188
00189     CDC* pDC = GetDockingFrame()->GetDC();
00190     CBrush* pBrush = CDC::GetHalftoneBrush();
00191     CBrush* pOldBrush = NULL;
00192
00193     if (pBrush != NULL) {
00194         pOldBrush = pDC->SelectObject(pBrush);
00195     }
00196
00197     pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATINVERT);
00198
00199     if (pOldBrush != NULL) {
00200         pDC->SelectObject(pOldBrush);
00201     }
00202     GetDockingFrame()->ReleaseDC(pDC);
00203 }
00204
00205 void CCJSizeDockBar::HitTest(const CPoint & point)
00206 {
00207     UINT nID = ((UINT)(WORD)::GetDlgCtrlID(m_hWnd));
00208     CRect rcWin;
00209     GetWindowRect(&rcWin);
00210     HCURSOR hCur = NULL;
00211
00212     //Yiannhs: Check the if statements, and change of variable TRackBorder size
00213     if (nID == AFX_IDW_SIZEBAR_LEFT || nID == AFX_IDW_SIZEBAR_RIGHT ) {
00214         //we are sure the DOCK bar is vertical
00215         if( nID == AFX_IDW_SIZEBAR_LEFT )
00216             rcWin.left = rcWin.right - TRACK_BORDER_SIZE;
00217         else
00218             rcWin.right = rcWin.left + TRACK_BORDER_SIZE;
00219
00220         if( rcWin.PtInRect(point) )
00221             hCur = AfxGetApp()->LoadCursor(IDC_HSPLITBAR);
00222
00223     } else {
00224         //The DOCK bar is horizontal
00225         if (nID == AFX_IDW_SIZEBAR_TOP)
00226             rcWin.top = rcWin.bottom - TRACK_BORDER_SIZE;
00227         else
00228             rcWin.bottom = rcWin.top + TRACK_BORDER_SIZE;
00229
00230         if( rcWin.PtInRect(point) )
00231             hCur = AfxGetApp()->LoadCursor(IDC_VSPLITBAR);
00232     }
00233
00234     if( hCur )
00235         SetCursor(hCur);
00236
00237     m_bOkToDrag = BOOL((long)hCur);
00238 }
00239
00241 // CCJSizeDockBar message handlers
00242
00243 void CCJSizeDockBar::OnNcPaint()
00244 {
00245     EraseNonClient();
00246 }
00247
00248 void CCJSizeDockBar::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp)
00249 {
00250     UINT nID = ((UINT)(WORD)::GetDlgCtrlID(m_hWnd));
00251     //Yiannhs changed the tracksize variable
00252     if (nID == AFX_IDW_SIZEBAR_LEFT) {
00253         m_cyBottomBorder += TRACK_BORDER_SIZE;
00254         CDockBar::OnNcCalcSize(bCalcValidRects, lpncsp);
00255         m_cyBottomBorder -= TRACK_BORDER_SIZE;
00256     }
00257
00258     else if (nID == AFX_IDW_SIZEBAR_TOP) {
00259         m_cyBottomBorder += TRACK_BORDER_SIZE;
00260         CDockBar::OnNcCalcSize(bCalcValidRects, lpncsp);
00261         m_cyBottomBorder -= TRACK_BORDER_SIZE;
00262     }
00263
00264     else if (nID == AFX_IDW_SIZEBAR_RIGHT) {
00265         m_cyTopBorder += TRACK_BORDER_SIZE;
00266         CDockBar::OnNcCalcSize(bCalcValidRects, lpncsp);
00267         m_cyTopBorder -= TRACK_BORDER_SIZE;
00268     }
00269
00270     else if (nID == AFX_IDW_SIZEBAR_BOTTOM) {
00271         m_cyTopBorder += TRACK_BORDER_SIZE;
00272         CDockBar::OnNcCalcSize(bCalcValidRects, lpncsp);
00273         m_cyTopBorder -= TRACK_BORDER_SIZE;
00274     }
00275 }
00276
00277 BOOL CCJSizeDockBar::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
00278 {
00279     return (nHitTest == HTCLIENT)?
00280         CDockBar::OnSetCursor(pWnd, nHitTest, message):FALSE;
00281 }
00282
00283 UINT CCJSizeDockBar::OnNcHitTest(CPoint point)
00284 {
00285     HitTest(point);
00286     return (m_bOkToDrag)?HTBORDER:CDockBar::OnNcHitTest(point);
00287 }
00288
00289 void CCJSizeDockBar::OnNcLButtonDown(UINT nHitTest, CPoint point)
00290 {
00291     // save the current cursor postion.
00292     m_ptCurrent = point;
00293     ScreenToClient(&m_ptCurrent);
00294
00295     if( m_bOkToDrag )
00296     {
00297         UINT nID = ((UINT)(WORD)::GetDlgCtrlID(m_hWnd));
00298         CFrameWnd *pFrame=GetDockingFrame();
00299         GetWindowRect(m_rcTrack);
00300
00301         //Yiannhs changed tracsize variable
00302         if (nID == AFX_IDW_SIZEBAR_LEFT)
00303             m_rcTrack.left = m_rcTrack.right - TRACK_BORDER_SIZE;
00304
00305         else if (nID == AFX_IDW_SIZEBAR_TOP)
00306             m_rcTrack.top = m_rcTrack.bottom - TRACK_BORDER_SIZE;
00307
00308         else if (nID == AFX_IDW_SIZEBAR_RIGHT)
00309             m_rcTrack.right = m_rcTrack.left + TRACK_BORDER_SIZE;
00310
00311         else if (nID == AFX_IDW_SIZEBAR_BOTTOM)
00312             m_rcTrack.bottom = m_rcTrack.top + TRACK_BORDER_SIZE;
00313
00314         pFrame->ScreenToClient(&m_rcTrack);
00315         pFrame->ScreenToClient(&point);
00316
00317         m_ptStartDrag = point;
00318         m_ptCurDrag = point;
00319
00320         SetCapture();
00321         m_bDragging = TRUE;
00322         OnInvertTracker(m_rcTrack);
00323
00324     } else {
00325         //Yiannhs
00326         CDockBar::OnNcLButtonDown(nHitTest, point);
00327     }
00328 }
00329
00330 void CCJSizeDockBar::OnLButtonUp(UINT nFlags, CPoint point)
00331 {
00332     if( m_ptCurrent == point ) {
00333         ReleaseCapture();
00334         m_bDragging = FALSE;
00335         OnInvertTracker(m_rcTrack);
00336         CDockBar::OnLButtonUp(nFlags, point);
00337     }
00338
00339     else if( m_bDragging )
00340     {
00341         CRect rectWin;
00342         CRect rectAvail;
00343         GetWindowRect(&rectWin);
00344         ReleaseCapture();
00345         m_bDragging = FALSE;
00346         OnInvertTracker(m_rcTrack);
00347         GetAvailableRect(rectAvail);
00348         UINT nID = ((UINT)(WORD)::GetDlgCtrlID(m_hWnd));
00349
00350         if (nID == AFX_IDW_SIZEBAR_LEFT ) {
00351             int maxWidth = rectAvail.Width()-m_iSafeSpace;
00352             int newWidth = m_rcTrack.left-m_ptStartDrag.x;
00353             m_iActualSize = newWidth>maxWidth ? maxWidth: newWidth;
00354             m_iActualSize += rectWin.Width();
00355         }
00356
00357         else if (nID == AFX_IDW_SIZEBAR_TOP) {
00358             int maxHeight = rectAvail.Height()-m_iSafeSpace;
00359             int newHeight = m_rcTrack.top-m_ptStartDrag.y;
00360             m_iActualSize = newHeight>maxHeight ? maxHeight : newHeight;
00361             m_iActualSize += rectWin.Height();
00362         }
00363
00364         else if (nID == AFX_IDW_SIZEBAR_RIGHT) {
00365             int maxWidth = rectAvail.Width()-m_iSafeSpace;
00366             int newWidth = m_ptStartDrag.x-m_rcTrack.left;
00367             m_iActualSize = newWidth>maxWidth ? maxWidth: newWidth;
00368             m_iActualSize += rectWin.Width();
00369         }
00370
00371         else if (nID == AFX_IDW_SIZEBAR_BOTTOM) {
00372             int maxHeight = rectAvail.Height()-m_iSafeSpace;
00373             int newHeight = m_ptStartDrag.y-m_rcTrack.top;
00374             m_iActualSize = newHeight>maxHeight ? maxHeight : newHeight;
00375             m_iActualSize += rectWin.Height();
00376         }
00377
00378         if(m_iActualSize< TRACK_BORDER_SIZE )
00379             m_iActualSize = TRACK_BORDER_SIZE;
00380
00381         GetDockingFrame()->RecalcLayout();
00382         RecalcAllExcept(NULL);
00383
00384     } else {
00385         //Yiannhs
00386         CDockBar::OnLButtonUp(nFlags, point);
00387     }
00388 }
00389
00390 void CCJSizeDockBar::OnMouseMove(UINT nFlags, CPoint point)
00391 {
00392     if( m_bDragging )
00393     {
00394         CRect rectWin;
00395         GetWindowRect(&rectWin);
00396         CRect rectAvail;
00397         GetAvailableRect(rectAvail);
00398         CFrameWnd *pFrame=GetDockingFrame();
00399         ClientToScreen(&point);
00400         pFrame->ScreenToClient(&point);
00401         UINT nID = ((UINT)(WORD)::GetDlgCtrlID(m_hWnd));
00402
00403         if (nID == AFX_IDW_SIZEBAR_LEFT) {
00404             point.x = point.x > rectAvail.right ? rectAvail.right : point.x;
00405             point.x = point.x < TRACK_BORDER_SIZE ? TRACK_BORDER_SIZE : point.x;
00406         }
00407
00408         else if (nID == AFX_IDW_SIZEBAR_TOP) {
00409             point.y = point.y > rectAvail.bottom ? rectAvail.bottom : point.y;
00410             point.y = point.y < TRACK_BORDER_SIZE ? TRACK_BORDER_SIZE : point.y;
00411         }
00412
00413         else if (nID == AFX_IDW_SIZEBAR_RIGHT) {
00414             point.x = point.x < rectAvail.left ? rectAvail.left:point.x;
00415             point.x = point.x > rectAvail.right + m_iActualSize - TRACK_BORDER_SIZE ?
00416                                 rectAvail.right - TRACK_BORDER_SIZE + m_iActualSize : point.x;
00417         }
00418
00419         else if (nID == AFX_IDW_SIZEBAR_BOTTOM) {
00420             point.y = point.y < rectAvail.top ? rectAvail.top : point.y;
00421             point.y = point.y > rectAvail.bottom + m_iActualSize - TRACK_BORDER_SIZE ?
00422                                 rectAvail.bottom - TRACK_BORDER_SIZE + m_iActualSize : point.y;
00423         }
00424
00425         int deltaX = point.x - m_ptCurDrag.x;
00426         int deltaY = point.y - m_ptCurDrag.y;
00427
00428         m_ptCurDrag = point;
00429
00430         if (nID == AFX_IDW_SIZEBAR_LEFT || nID == AFX_IDW_SIZEBAR_RIGHT && deltaX)
00431         {
00432             OnInvertTracker(m_rcTrack);
00433             m_rcTrack.left+=deltaX;
00434             m_rcTrack.right+=deltaX;
00435             OnInvertTracker(m_rcTrack);
00436         }
00437
00438         else if( nID == AFX_IDW_SIZEBAR_TOP || nID == AFX_IDW_SIZEBAR_BOTTOM && deltaY)
00439         {
00440             OnInvertTracker(m_rcTrack);
00441             m_rcTrack.top+=deltaY;
00442             m_rcTrack.bottom+=deltaY;
00443             OnInvertTracker(m_rcTrack);
00444         }
00445
00446     } else {
00447         //Yiannhs
00448         CDockBar::OnMouseMove(nFlags, point);
00449     }
00450 }
00451
00453 // CCJControlBar operations
00454
00455 void CCJSizeDockBar::GetAvailableRect(CRect &rect)
00456 {
00457     GetDockingFrame()->GetClientRect(&rect);
00458     GetDockingFrame()->RepositionBars(0xffff, 0xffff, AFX_IDW_PANE_FIRST,reposQuery,
00459         &rect, &rect, TRUE);
00460 }
00461
00462 BOOL CCJSizeDockBar::IsLastControlBar(int index)
00463 {
00464     for( int i=index; i<m_arrBars.GetSize(); ++i)
00465     {
00466         CCJControlBar *pOther = (CCJControlBar *)GetDockedControlBar(i);
00467         if (pOther != NULL && pOther->IsVisible())
00468         {
00469             return FALSE;
00470         }
00471     }
00472
00473     return TRUE;
00474 }
00475
00476 CCJControlBar* CCJSizeDockBar::GetDockedSizeBar(int nPos)
00477 {
00478     return (CCJControlBar*)GetDockedControlBar(nPos);
00479 }
00480
00481 void CCJSizeDockBar::RecalcAllExcept(CCJSizeDockBar *pBar)
00482 {
00483     CFrameWnd *pFrame = GetParentFrame();
00484     ASSERT_VALID(pFrame);
00485
00486     for (int i = 0; i < 4; i++)
00487     {
00488         CCJSizeDockBar* pDock = (CCJSizeDockBar*)pFrame->GetControlBar(dwSizeBarMap[i][0]);
00489         if (pDock != NULL && pDock != pBar) {
00490             pDock->CalcSizeBarLayout();
00491         }
00492     }
00493 }
00494
00495 void CCJSizeDockBar::DrawBorders(CDC *pDC, CRect &rect)
00496 {
00497     int cxBorderLeft    = 0;
00498     int cxBorderRight   = 0;
00499     int cyBorderTop     = 0;
00500     int cyBorderBottom  = 0;
00501
00502     CRect rc;
00503     rc.CopyRect(&rect);
00504
00505     //Yiannhs: i've replaced color variables with the afxdata ones.
00506     if (m_dwStyle & CBRS_BORDER_TOP) {
00507         pDC->FillSolidRect(rc.left, rc.top, rc.Width(), 1, afxData.clrBtnShadow);
00508         pDC->FillSolidRect(rc.left, rc.top+1, rc.Width(), 1, afxData.clrBtnHilite);
00509         cyBorderTop+=2;
00510     }
00511
00512     if (m_dwStyle & CBRS_BORDER_BOTTOM) {
00513         pDC->FillSolidRect(rc.left, rc.bottom-1, rc.Width(), 1, afxData.clrBtnHilite);
00514         pDC->FillSolidRect(rc.left, rc.bottom-2, rc.Width(), 1, afxData.clrBtnShadow);
00515         cyBorderBottom+=2;
00516     }
00517
00518     if (m_dwStyle & CBRS_BORDER_LEFT) {
00519         pDC->FillSolidRect(rc.left, rc.top, 1, rc.Height(), afxData.clrBtnShadow);
00520         pDC->FillSolidRect(rc.left+1, rc.top, 1, rc.Height(), afxData.clrBtnHilite);
00521         cxBorderLeft+=2;
00522     }
00523
00524     if (m_dwStyle & CBRS_BORDER_RIGHT) {
00525         pDC->FillSolidRect(rc.right-2, rc.top, 1, rc.Height(), afxData.clrBtnShadow);
00526         pDC->FillSolidRect(rc.right-1, rc.top, 1, rc.Height(), afxData.clrBtnHilite);
00527         cxBorderRight+=2;
00528     }
00529
00530     UINT nID = ((UINT)(WORD)::GetDlgCtrlID(m_hWnd));
00531
00532     CRect rcTrack;
00533     rcTrack.CopyRect(&rc);
00534
00535     if (nID == AFX_IDW_SIZEBAR_LEFT) {
00536         rcTrack.left    = rc.right - TRACK_BORDER_SIZE;
00537         rcTrack.right  += 1;
00538         rcTrack.top    += 1;
00539         rcTrack.bottom -= 1;
00540         //Yiannhs moved below
00541         cxBorderRight = TRACK_BORDER_SIZE;
00542     }
00543
00544     else if (nID == AFX_IDW_SIZEBAR_TOP) {
00545         rcTrack.top = rc.bottom - TRACK_BORDER_SIZE;
00546         rcTrack.bottom+=1;
00547         //Yiannhs moved below
00548         cyBorderBottom = TRACK_BORDER_SIZE;
00549     }
00550
00551     else if (nID == AFX_IDW_SIZEBAR_RIGHT) {
00552         rcTrack.right   = rc.left + TRACK_BORDER_SIZE;
00553         rcTrack.left   -= 1;
00554         rcTrack.top    += 1;
00555         rcTrack.bottom -= 1;
00556         //Yiannhs moved below
00557         cxBorderLeft = TRACK_BORDER_SIZE;
00558     }
00559
00560     else if (nID == AFX_IDW_SIZEBAR_BOTTOM) {
00561         rcTrack.bottom = rc.top + TRACK_BORDER_SIZE;
00562         rcTrack.top-=1;
00563         //Yiannhs moved below
00564         cyBorderTop = TRACK_BORDER_SIZE;
00565     }
00566
00567     //Yiannhs Moved these here. in one place. The optimizer may do this, but lets help it.
00568     pDC->FillSolidRect(rcTrack, afxData.clrBtnFace);
00569     if( !m_bFlatBorder )    //Yiannhs handle flat borders
00570         pDC->Draw3dRect(rcTrack, afxData.clrBtnHilite, afxData.clrBtnShadow);
00571
00572     rect.left   += cxBorderLeft;
00573     rect.right  -= cxBorderRight;
00574     rect.top    += cyBorderTop;
00575     rect.bottom -= cyBorderBottom;
00576 }
00577
00578 void CCJSizeDockBar::EraseNonClient()
00579 {
00580     CWindowDC dc(this);
00581     CRect rectClient;
00582     GetClientRect(rectClient);
00583     CRect rectWindow;
00584     GetWindowRect(rectWindow);
00585     ScreenToClient(rectWindow);
00586     rectClient.OffsetRect(-rectWindow.left, -rectWindow.top);
00587     dc.ExcludeClipRect(rectClient);
00588     rectWindow.OffsetRect(-rectWindow.left, -rectWindow.top);
00589     DrawBorders(&dc, rectWindow);
00590 }
00591
00592
00593 //1999-05-18    Yiannhs
00594 void CCJSizeDockBar::CalcSizeBarLayout()
00595 {
00596     //Yiannhs: It is necessary to set all Control bars in one row.
00597     //         till now multiple rows are not handled
00598     int VisCount = GetDockedVisibleCount();
00599     if( !VisCount )
00600         return;      //Yiannhs v6.07 moved this on top
00601
00602     AFX_SIZEPARENTPARAMS layout;
00603     layout.hDWP = ::BeginDeferWindowPos( m_arrBars.GetSize( ));
00604     CRect rectAvail;
00605     GetClientRect(&rectAvail);
00606
00607     int nCount = 0;
00608     int lastLeft = 0;
00609     int lastTop = 0;
00610
00611     for (int i = 0; i < m_arrBars.GetSize(); i++)
00612     {
00613         CCJControlBar* pBar = STATIC_DOWNCAST(CCJControlBar, (CObject*)GetDockedControlBar(i));
00614         if (pBar != NULL && pBar->IsVisible())
00615         {
00616             if(!pBar->IsKindOf(RUNTIME_CLASS(CCJControlBar)))
00617                 continue;
00618
00619             CRect rectBar;
00620             ++nCount;
00621             pBar->GetWindowRect(&rectBar);
00622             pBar->m_bUnique = FALSE;        //Yiannhs ok in Ver 6.07
00623             ScreenToClient(&rectBar);
00624             CSize sizeIdeal = pBar->CalcDynamicLayout(-1, 0);
00625
00626             //Yiannhs  moved [if] code at the begining. It helps make these calculations near the top
00627             //         for checking the size of the last control bars
00628             int bIsLast = IsLastControlBar(i+1);
00629             pBar->m_bToFit = bIsLast;           //check fitting is setup here
00630             if( bIsLast && nCount == 1 ) {
00631                 pBar->m_bUnique = TRUE;
00632             }
00633
00635             //  so it is not completely hidden
00636             if( rectBar.right >= rectAvail.right && !bIsLast )
00637                 sizeIdeal.cx -= (sizeIdeal.cx / 4);
00638             if( rectBar.bottom >= rectAvail.bottom && !bIsLast )
00639                 sizeIdeal.cy -= (sizeIdeal.cy / 4);
00640
00641             //Yiannhs: The Dock bar is either horizontally or vertically docked itself.
00642             //         So are the ControlBars enclosed inside it. Since the control bars
00643             //         are docked, and Sizing dockbar does not derive from CCJControlBar
00644             //         we may be a bit more clever.
00645             if( m_dwStyle & CBRS_ORIENT_HORZ ) {//use some default data members
00646                 //horizontal;
00647                 rectBar.left = lastLeft;
00648                 rectBar.top = 0;
00649                 rectBar.bottom = rectAvail.Height();
00650                 rectBar.right = rectBar.left + sizeIdeal.cx;
00651
00652                 if( rectBar.left > lastLeft )
00653                     rectBar.left = lastLeft;
00654
00655                 lastLeft = rectBar.right;
00656                 if ( bIsLast ) {    //Yiannhs
00657                     rectBar.right = rectAvail.right;
00658                 }
00659
00660             } else if( m_dwStyle & CBRS_ORIENT_VERT ) {
00661                 //Vertical
00662                 rectBar.top = lastTop;
00663                 rectBar.left = 0;
00664                 rectBar.right = rectAvail.Width();
00665                 rectBar.bottom = rectBar.top + sizeIdeal.cy;
00666
00667                 if (rectBar.top > lastTop)
00668                     rectBar.top = lastTop;
00669
00670                 lastTop = rectBar.bottom;
00671                 if ( bIsLast ) {    //Yiannhs
00672                     rectBar.bottom = rectAvail.bottom;
00673                 }
00674             }
00675
00676             AfxRepositionWindow( &layout, pBar->m_hWnd, &rectBar );
00677         }
00678     }
00679
00680     // move and resize all the windows at once!
00681     if( layout.hDWP == NULL || !::EndDeferWindowPos( layout.hDWP ))
00682         TRACE0("Warning: DeferWindowPos failed - low system resources.\n");
00683 }
00684
00685 void CCJSizeDockBar::Maximize(CCJControlBar* pBar)
00686 {
00687     int iExt=0;
00688     CRect rectAvail;
00689     GetClientRect(rectAvail);
00690
00691     for (int i=0; i<m_arrBars.GetSize(); ++i)
00692     {
00693         CCJControlBar *pBarDock = (CCJControlBar *)GetDockedControlBar(i);
00694         if (pBarDock && pBarDock->IsVisible() && pBarDock != pBar) {
00695             pBarDock->Minimize();
00696             iExt += pBarDock->GetMinExt();
00697         }
00698     }
00699
00700     if (pBar->IsLeftDocked() || pBar->IsRightDocked()) {
00701         iExt = rectAvail.Height()-iExt;
00702     }
00703
00704     if (pBar->IsTopDocked() || pBar->IsBottomDocked()) {
00705         iExt = rectAvail.Width()-iExt;
00706     }
00707
00708     pBar->Maximize(iExt);
00709
00710     //1999-05-26 Yiannhs
00711     //do not care too much about flickering when maximizing controlbars
00712     CalcSizeBarLayout();
00713
00714     for (i=0; i<m_arrBars.GetSize(); ++i)
00715     {
00716         CCJControlBar *pBarDock = (CCJControlBar *)GetDockedControlBar(i);
00717         if (pBarDock && pBarDock->IsVisible() ) {
00718             pBarDock->InvalidateRect(NULL, TRUE);
00719             pBarDock->UpdateWindow();
00720         }
00721     }
00722     //1999-05-26 Yiannhs
00723 }
00724
00725 void CCJSizeDockBar::Normalize(CCJControlBar *)
00726 {
00727     for( int i=0; i<m_arrBars.GetSize(); ++i) {
00728         CCJControlBar *pBarDock = (CCJControlBar*)GetDockedControlBar(i);
00729         if (pBarDock && pBarDock->IsVisible())
00730             pBarDock->Normalize();
00731     }
00732
00733
00734     //1999-05-26 Yiannhs
00735     //do not care too much about flickering when maximizing controlbars
00736
00737     CalcSizeBarLayout();
00738
00739     for (i=0; i<m_arrBars.GetSize(); ++i)
00740     {
00741         CCJControlBar *pBarDock = (CCJControlBar *)GetDockedControlBar(i);
00742         if (pBarDock && pBarDock->IsVisible() ) {
00743             pBarDock->InvalidateRect(NULL, TRUE);
00744             pBarDock->UpdateWindow();
00745         }
00746     }
00747     //1999-05-26 Yiannhs
00748 }
Generated on Sun Feb 24 01:21:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJSortClass.cpp Source File

WinCvs/CJLib/CJLibrary/CJSortClass.cpp

Go to the documentation of this file.
00001 // Copyright (c) Iuri Apollonio 1998
00002 // Use & modify as you want & need, and leave those 3 lines.
00003 // http://www.codeguru.com
00004 // class extended by Max Poliashenko.
00005 //
00006 // CJSortClass.cpp: implementation of the CCJSortClass class.
00007 //
00009 /****************************************************************************
00010  *
00011  * $Date: 1999/11/30 21:45:49 $
00012  * $Revision: 1.1.1.3 $
00013  * $Archive: /CodeJock/CJLibrary/CJSortClass.cpp $
00014  *
00015  * $History: CJSortClass.cpp $
00016  *
00017  * *****************  Version 4  *****************
00018  * User: Kirk Stowell Date: 10/14/99   Time: 12:19p
00019  * Updated in $/CodeJock/CJLibrary
00020  * Fixed assertion bug with constructior.
00021  *
00022  ***************************************************************************/
00024
00025 #include "stdafx.h"
00026 #include "CJSortClass.h"
00027
00028 #ifdef _DEBUG
00029 #undef THIS_FILE
00030 static char THIS_FILE[]=__FILE__;
00031 #define new DEBUG_NEW
00032 #endif
00033
00035 // Construction/Destruction
00037
00038 CCJSortClass::CCJSortClass(CListCtrl* pWnd, const int nCol)
00039 {
00040     ASSERT(pWnd);
00041     m_pWnd = pWnd;
00042
00043     int nCount = m_pWnd->GetItemCount();
00044     DWORD dwData;
00045     CString strItemText;
00046
00047     // replace Item data with pointer to CSortItem structure
00048     for (int i = 0; i < nCount; i++)
00049     {
00050         dwData = m_pWnd->GetItemData(i); // save current data to restore it later
00051         strItemText = m_pWnd->GetItemText(i, nCol);
00052         m_pWnd->SetItemData(i, (DWORD) new CSortItem(dwData, strItemText));
00053     }
00054 }
00055
00056 CCJSortClass::~CCJSortClass()
00057 {
00058     ASSERT(m_pWnd);
00059     int nCount = m_pWnd->GetItemCount();
00060     CSortItem * pItem;
00061     for (int i = 0; i < nCount; i++)
00062     {
00063         pItem = (CSortItem *) m_pWnd->GetItemData(i);
00064         ASSERT(pItem);
00065         m_pWnd->SetItemData(i, pItem->m_dwData);
00066         delete pItem;
00067     }
00068 }
00069
00070 void CCJSortClass::Sort(bool bAsc, DATA_TYPE eType)
00071 {
00072     long lParamSort = eType;
00073
00074     // if lParamSort positive - ascending sort order, negative - descending
00075     if (!bAsc)
00076         lParamSort *= -1;
00077
00078     m_pWnd->SortItems(Compare, lParamSort);
00079 }
00080
00081 int CALLBACK CCJSortClass::Compare(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
00082 {
00083     CSortItem* item1 = (CSortItem *) lParam1;
00084     CSortItem* item2 = (CSortItem *) lParam2;
00085
00086     ASSERT(item1 && item2);
00087
00088     // restore data type and sort order from lParamSort
00089     // if lParamSort positive - ascending sort order, negative - descending
00090     short     sOrder = lParamSort < 0 ? (short) -1 : (short) 1;
00091
00092     DATA_TYPE eType  = (DATA_TYPE) (lParamSort * sOrder); // get rid of sign
00093
00094     // declare typed buffers
00095     COleDateTime t1, t2;
00096
00097     switch (eType)
00098     {
00099     case DT_INT:
00100         return ( _ttol( item1->m_strItemText ) - _ttol( item2->m_strItemText )) * sOrder;
00101
00102     case DT_DEC:
00103 #ifdef _UNICODE
00104         {
00105             char szText1[ 256 ];
00106             char szText2[ 256 ];
00107
00108             WideCharToMultiByte( CP_ACP,
00109                                  0,
00110                                  item1->m_strItemText,
00111                                  -1,
00112                                  szText1,
00113                                  255,
00114                                  NULL,
00115                                  NULL );
00116
00117             WideCharToMultiByte( CP_ACP,
00118                                  0,
00119                                  item2->m_strItemText,
00120                                  -1,
00121                                  szText2,
00122                                  255,
00123                                  NULL,
00124                                  NULL );
00125
00126
00127             return ( atof( szText1 ) < atof( szText2 ) ? -1 : 1) * sOrder;
00128         }
00129 #else
00130         return ( atof ( item1->m_strItemText ) < atof( item2->m_strItemText ) ? -1 : 1) * sOrder;
00131 #endif
00132
00133     case DT_DATETIME:
00134         if( t1.ParseDateTime( item1->m_strItemText ) && t2.ParseDateTime( item2->m_strItemText ))
00135         {
00136             return (t1 < t2 ? -1 : 1 ) * sOrder;
00137         }
00138         return 0;
00139
00140     case DT_STRING:
00141         return item1->m_strItemText.CompareNoCase( item2->m_strItemText ) * sOrder;
00142
00143     default:
00144         ASSERT("Error: attempt to sort a column without type.");
00145         return 0;
00146     }
00147 }
Generated on Sun Feb 24 01:21:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJStatusBar.cpp Source File

WinCvs/CJLib/CJLibrary/CJStatusBar.cpp

Go to the documentation of this file.
00001 // CJStatusBar.cpp : implementation file
00002 //
00003 // Copyright © 1999 Pierre MELLINAND
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.1 $
00010  * $Archive: /CodeJock/CJLibrary/CJStatusBar.cpp $
00011  *
00012  * $History: CJStatusBar.cpp $
00013  *
00014  * *****************  Version 2  *****************
00015  * User: Kirk Stowell Date: 10/30/99   Time: 1:58p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Minor fix for UNICODE builds.
00018  *
00019  * *****************  Version 1  *****************
00020  * User: Kirk Stowell Date: 10/26/99   Time: 11:08p
00021  * Created in $/CodeJock/CJLibrary
00022  *
00023  ***************************************************************************/
00025
00026 #include "StdAfx.h"
00027 #include "CJStatusBar.h"
00028
00029 #ifdef _DEBUG
00030 #define new DEBUG_NEW
00031 #undef THIS_FILE
00032 static char THIS_FILE[] = __FILE__;
00033 #endif
00034
00036 // CCJStatusBarPaneControlInfo
00037
00038 CCJStatusBarPaneControlInfo::CCJStatusBarPaneControlInfo()
00039 {
00040     m_pWnd        = NULL;
00041     m_bAutodelete = TRUE;
00042     m_nPaneID     = 0;
00043 }
00044
00045 CCJStatusBarPaneControlInfo::~CCJStatusBarPaneControlInfo()
00046 {
00047     // TODO: add destruction code here.
00048 }
00049
00050 IMPLEMENT_DYNCREATE(CCJStatusBarPaneControlInfo, CObject)
00051
00053 // CCJStatusBarPane
00054
00055 CCJStatusBarPane::CCJStatusBarPane()
00056 {
00057     // TODO: add construction code here.
00058 }
00059
00060 CCJStatusBarPane::CCJStatusBarPane(CCJStatusBarPane& rPane)
00061 {
00062     m_nID     = rPane.m_nID;
00063     m_cxText  = rPane.m_cxText;
00064     m_nStyle  = rPane.m_nStyle;
00065     m_nFlags  = rPane.m_nFlags;
00066     m_strText = rPane.m_strText;
00067 }
00068
00069 CCJStatusBarPane::~CCJStatusBarPane()
00070 {
00071     // TODO: add destruction code here.
00072 }
00073
00074 CCJStatusBarPane& CCJStatusBarPane::operator=(CCJStatusBarPane& rPane)
00075 {
00076     m_nID     = rPane.m_nID;
00077     m_cxText  = rPane.m_cxText;
00078     m_nStyle  = rPane.m_nStyle;
00079     m_nFlags  = rPane.m_nFlags;
00080     m_strText = rPane.m_strText;
00081     return *this;
00082 }
00083
00085 // CCJStatusBar
00086
00087 CCJStatusBar::CCJStatusBar()
00088 {
00089     // TODO: add construction code here.
00090 }
00091
00092 CCJStatusBar::~CCJStatusBar()
00093 {
00094     for( int i = 0; i < m_aPans.GetSize(); i++ )
00095     {
00096         if( m_aPans[i]->m_pWnd && ::IsWindow(m_aPans[i]->m_pWnd->m_hWnd) )
00097             m_aPans[i]->m_pWnd->CloseWindow();
00098         if( m_aPans[i]->m_bAutodelete )
00099         {
00100             delete m_aPans[i]->m_pWnd;
00101         }
00102         delete m_aPans[i];
00103     }
00104 }
00105
00106 IMPLEMENT_DYNCREATE(CCJStatusBar, CStatusBar)
00107
00108 BEGIN_MESSAGE_MAP(CCJStatusBar, CStatusBar)
00109     //{{AFX_MSG_MAP(CCJStatusBar)
00110     ON_WM_SIZE()
00111     //}}AFX_MSG_MAP
00112 END_MESSAGE_MAP()
00113
00115 // CCJStatusBar message handlers
00116
00117 void CCJStatusBar::OnSize(UINT nType, int cx, int cy)
00118 {
00119     CStatusBar::OnSize(nType, cx, cy);
00120     PositionControls();
00121 }
00122
00123 void CCJStatusBar::PositionControls()
00124 {
00125     int h,v,s;
00126     GetStatusBarCtrl( ).GetBorders( h, v, s ) ;
00127
00128
00129     for(int i = 0; i < m_aPans.GetSize(); i++ )
00130     {
00131         CRect rect;
00132
00133         int index = CommandToIndex( m_aPans[i]->m_nPaneID );
00134         GetItemRect(index,rect);
00135         if( GetPaneStyle(index) & SBPS_NOBORDERS == SBPS_NOBORDERS)
00136             m_aPans[i]->m_pWnd->MoveWindow(rect);
00137         else
00138         {
00139             rect.top+=v;
00140             rect.bottom-=v;
00141             rect.left+=h+s;
00142             rect.right-=(h+s);
00143             m_aPans[i]->m_pWnd->MoveWindow(rect);
00144         }
00145
00146     }
00147 }
00148
00149 CCJStatusBarPaneControlInfo * CCJStatusBar::GetPanControl(int nPaneID)
00150 {
00151     for(int i = 0; i < m_aPans.GetSize(); i++ )
00152     {
00153         if( m_aPans[i]->m_nPaneID == nPaneID )
00154             return m_aPans[i];
00155     }
00156     return NULL;
00157 }
00158
00159 BOOL CCJStatusBar::AddControl(CWnd * pWnd, int paneID, BOOL bAutodeleteControl)
00160 {
00161
00162     CCJStatusBarPaneControlInfo * pPanInfo = GetPanControl(paneID);
00163     if( pPanInfo )
00164         return FALSE;
00165
00166     int idx = CommandToIndex( paneID ) ;
00167     if( idx == -1 )
00168         return FALSE;
00169
00170     CCJStatusBarPaneControlInfo * pPan = new CCJStatusBarPaneControlInfo;
00171     pPan->m_nPaneID =  paneID;
00172     pPan->m_pWnd    =  pWnd;
00173     pPan->m_bAutodelete = bAutodeleteControl;
00174
00175     m_aPans.Add(pPan);
00176     PositionControls();
00177     Invalidate(TRUE);
00178     return TRUE;
00179 }
00180
00181 void CCJStatusBar::SetPaneWidth(int index, int cxWidth)
00182 {
00183     UINT nID,nStyle;
00184     int width;
00185     GetPaneInfo(index,nID,nStyle,width);
00186     SetPaneInfo(index,nID,nStyle,cxWidth);
00187 }
00188
00189 BOOL CCJStatusBar::GetStatusPane(int nIndex, CCJStatusBarPane & rPane)
00190 {
00191     if( nIndex < m_nCount  && nIndex >= 0 )
00192     {
00193         GetPaneInfo( nIndex,  rPane.m_nID, rPane.m_nStyle, rPane.m_cxText ) ;
00194         GetPaneText( nIndex , rPane.m_strText );
00195         return TRUE;
00196     }
00197     return FALSE;
00198 }
00199
00200 BOOL CCJStatusBar::AddIndicator( int position, UINT paneID )
00201 {
00202     CArray<CCJStatusBarPane,CCJStatusBarPane> arPanes;
00203
00204     CCJStatusBarPane statusPane;
00205     int i;
00206
00207     i = 0;
00208     while( GetStatusPane(i,statusPane) )
00209     {
00210         arPanes.Add( statusPane );
00211         i++;
00212     }
00213     if( position < 0 )
00214         position = 0;
00215     if( position > arPanes.GetSize() )
00216         position = arPanes.GetSize()-1;
00217
00218     for(i = 0; i < arPanes.GetSize(); i ++ )
00219     {
00220         if( paneID == arPanes[i].m_nID )
00221         {
00222             TRACE0( "CCJStatusBar::AddIndicator(): Pane ID already exists \n" );
00223             return FALSE;
00224         }
00225     }
00226
00227     CCJStatusBarPane new_statusPane;
00228     new_statusPane.m_nID = paneID;
00229     if( arPanes.GetSize() )
00230         arPanes.InsertAt(position,new_statusPane);
00231     else
00232         arPanes.Add(new_statusPane);
00233
00234     UINT * pIndicators = new UINT[arPanes.GetSize()];
00235     for(i=0;i<arPanes.GetSize();i++)
00236         pIndicators[i]=arPanes[i].m_nID;
00237
00238     SetRedraw(FALSE);
00239     SetIndicators(pIndicators,arPanes.GetSize());
00240
00241     // Replace infos of indicators ..
00242     for(i = 0; i < arPanes.GetSize(); i++ )
00243     {
00244         if( arPanes[i].m_nID != paneID )
00245         {
00246             SetPaneInfo(i,arPanes[i].m_nID,arPanes[i].m_nStyle,arPanes[i].m_cxText);
00247             SetPaneText(i,arPanes[i].m_strText);
00248         }
00249         else
00250         {
00251             SetPaneWidth(i,50);
00252             SetPaneText(i,arPanes[i].m_strText);
00253         }
00254
00255     }
00256
00257     delete [] pIndicators;
00258     SetRedraw(TRUE);
00259     PositionControls();
00260     Invalidate(TRUE);
00261     return TRUE;
00262 }
00263
00264 void CCJStatusBar::RemovePane(int nPaneID)
00265 {
00266     SetRedraw(FALSE);
00267     CWnd * pwnd = NULL;
00268     for( int i = 0; i < m_aPans.GetSize(); i++ )
00269     {
00270         if( m_aPans[i]->m_nPaneID == nPaneID )
00271         {
00272             if( m_aPans[i]->m_bAutodelete )
00273                 pwnd = m_aPans[i]->m_pWnd;
00274             delete m_aPans[i];
00275             m_aPans.RemoveAt(i);
00276             break;
00277         }
00278     }
00279     if( pwnd )
00280     {
00281         pwnd->DestroyWindow();
00282         delete pwnd;
00283     }
00284
00285     CArray<CCJStatusBarPane,CCJStatusBarPane> arPanes;
00286     CCJStatusBarPane statusPane;
00287     i = 0;
00288     while( GetStatusPane(i,statusPane) )
00289     {
00290         if( statusPane.m_nID != (UINT)nPaneID )
00291             arPanes.Add( statusPane );
00292         i++;
00293     }
00294     // Now remove the indicator
00295     UINT * pIndicators = new UINT[arPanes.GetSize()];
00296     for(i=0;i<arPanes.GetSize();i++)
00297         pIndicators[i]=arPanes[i].m_nID;
00298     SetIndicators(pIndicators,arPanes.GetSize());
00299
00300     // Replace infos of indicators ..
00301     for(i = 0; i < arPanes.GetSize(); i++ )
00302     {
00303         SetPaneInfo(i,arPanes[i].m_nID,arPanes[i].m_nStyle,arPanes[i].m_cxText);
00304         SetPaneText(i,arPanes[i].m_strText);
00305     }
00306
00307     delete [] pIndicators;
00308     SetRedraw(TRUE);
00309     PositionControls();
00310     Invalidate(TRUE);
00311 }
Generated on Sun Feb 24 01:21:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJTabCtrl.cpp Source File

WinCvs/CJLib/CJLibrary/CJTabCtrl.cpp

Go to the documentation of this file.
00001 // CJTabCtrl.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/CJLibrary/CJTabCtrl.cpp $
00011  *
00012  * $History: CJTabCtrl.cpp $
00013  *
00014  * *****************  Version 15  *****************
00015  * User: Kirk Stowell Date: 10/30/99   Time: 1:58p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Overrode OnEraseBkgnd(...) and OnPaint() for flicker free drawing.
00018  *
00019  * *****************  Version 14  *****************
00020  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00021  * Updated in $/CodeJock/CJLibrary
00022  * Fixed potential resource and memory leak problems.
00023  *
00024  * *****************  Version 13  *****************
00025  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00026  * Updated in $/CodeJockey/CJLibrary
00027  * Updated copyright and contact information.
00028  *
00029  * *****************  Version 12  *****************
00030  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00031  * Updated in $/CodeJockey/CJLibrary
00032  * Added Unicode compliance, thanks to Barry Burton for his help with
00033  * this.
00034  *
00035  *
00036  * *****************  Version 11  *****************
00037  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00038  * Updated in $/CodeJockey/CJLibrary
00039  *
00040  * *****************  Version 10  *****************
00041  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00042  * Updated in $/CodeJockey/CJLibrary
00043  *
00044  * *****************  Version 9  *****************
00045  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00046  * Updated in $/CodeJockey/CJLibrary
00047  *
00048  * *****************  Version 8  *****************
00049  * User: Kirk Stowell Date: 7/25/99    Time: 12:15a
00050  * Updated in $/CodeJockey/CJLibrary
00051  *
00052  * *****************  Version 7  *****************
00053  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00054  * Updated in $/CodeJockey/CJLibrary
00055  *
00056  * *****************  Version 6  *****************
00057  * User: Kirk Stowell Date: 7/14/99    Time: 9:44p
00058  * Updated in $/CodeJockey/CJLibrary
00059  * Added _DYNAMIC macros for access to the CObject::IsKindOf to determine
00060  * the class object at runtime. Thanks to Sid Price
00061  * [sidprice@softtools.com] for suggesting this.
00062  *
00063  * *****************  Version 5  *****************
00064  * User: Kirk Stowell Date: 6/14/99    Time: 10:45p
00065  * Updated in $/CodeJockey/CJ60Lib
00066  * Cleaned up code to eliminate level 4 compilier warnings.
00067  *
00068  * *****************  Version 4  *****************
00069  * User: Kirk Stowell Date: 5/17/99    Time: 8:01p
00070  * Updated in $/CodeJockey/CJ60Lib
00071  * Changed popup menu parent from GetParentFrame() to  AfxGetMainWnd()
00072  *
00073  * *****************  Version 3  *****************
00074  * User: Kirk Stowell Date: 5/11/99    Time: 9:33p
00075  * Updated in $/CodeJockey/CJ60Lib
00076  * Renamed popup menu resource id to m_popupMenuID to be consistent with
00077  * other classes.  Added member variable m_popToolbarID to contain the
00078  * toolbar resource to be used for popup menus  and m_nPos to contain the
00079  * index of the submenu in the menu resource. Added
00080  * CCJTabCtrl::Create(...) to simplify the creation process, and to set
00081  * the tab font.  Cleaned up OnRButtonDown(..) message handler which
00082  * activates the popup menu. Modified SetMenuID(...) to accept the index
00083  * of the popup menu in the menu resource.
00084  *
00085  * *****************  Version 2  *****************
00086  * User: Kirk Stowell Date: 5/02/99    Time: 5:25p
00087  * Updated in $/CodeJockey/CJ60Lib
00088  * Removed class from CCJTabCtrlBar files into its own files. Added popup
00089  * menu support for CCJMenu.
00090  *
00091  * *****************  Version 1  *****************
00092  * User: Kirk Stowell Date: 5/02/99    Time: 4:33p
00093  * Created in $/CodeJockey/CJ60Lib
00094  *
00095  ***************************************************************************/
00097
00098 #include "StdAfx.h"
00099 #include "CJTabCtrl.h"
00100
00101 #ifdef _DEBUG
00102 #define new DEBUG_NEW
00103 #undef THIS_FILE
00104 static char THIS_FILE[] = __FILE__;
00105 #endif
00106
00108 // CCJTabCtrl
00109
00110 CCJTabCtrl::CCJTabCtrl()
00111 {
00112     m_popupMenuID   = 0;
00113     m_popToolbarID  = 0;
00114     m_nPos          = 0;
00115 }
00116
00117 CCJTabCtrl::~CCJTabCtrl()
00118 {
00119     // fix potential resource leak - KStowell - 10-22-99.
00120     m_Font.DeleteObject();
00121 }
00122
00123 IMPLEMENT_DYNAMIC(CCJTabCtrl, CTabCtrl)
00124
00125 BEGIN_MESSAGE_MAP(CCJTabCtrl, CTabCtrl)
00126     //{{AFX_MSG_MAP(CCJTabCtrl)
00127     ON_WM_RBUTTONDOWN()
00128     ON_WM_MEASUREITEM()
00129     ON_WM_MENUCHAR()
00130     ON_WM_INITMENUPOPUP()
00131     ON_WM_ERASEBKGND()
00132     ON_WM_PAINT()
00133     //}}AFX_MSG_MAP
00134 END_MESSAGE_MAP()
00135
00137 // CCJTabCtrl message handlers
00138
00139 void CCJTabCtrl::OnRButtonDown(UINT /*nFlags*/, CPoint point)
00140 {
00141     // No menu was defined...
00142     if (!m_popupMenuID) {
00143         TRACE0( "Warning: No menu resource was associated with CCJTabCtrl.\n" );
00144     }
00145
00146     else
00147     {
00148         // Since we are using the main window as the
00149         // parent, we need to convert the point to screen
00150         // coordinates...
00151         CPoint pt = point;
00152         ClientToScreen(&pt);
00153
00154         // Load the popup menu.
00155         VERIFY(m_popupMenu.LoadMenu(m_popupMenuID));
00156         CCJMenu* pPopup = (CCJMenu*)m_popupMenu.GetSubMenu(m_nPos);
00157         ASSERT(pPopup != NULL);
00158
00159         // Load toolbar resource if any for menu icons.
00160         if (m_popToolbarID) {
00161             pPopup->LoadToolbar(m_popToolbarID);
00162         }
00163
00164         // Display the popup menu, use the main window as its parent.
00165         pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
00166             pt.x, pt.y, AfxGetMainWnd());
00167
00168         m_popupMenu.DestroyMenu();
00169     }
00170 }
00171
00172 void CCJTabCtrl::OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)
00173 {
00174     if (lpMeasureItemStruct->CtlType == ODT_MENU)
00175     {
00176         if (IsMenu((HMENU)lpMeasureItemStruct->itemID)) {
00177             CMenu* pMenu = CMenu::FromHandle((HMENU)lpMeasureItemStruct->itemID);
00178
00179             if (m_popupMenu.IsMenu(pMenu)) {
00180                 m_popupMenu.MeasureItem(lpMeasureItemStruct);
00181                 return;
00182             }
00183         }
00184     }
00185
00186     CTabCtrl::OnMeasureItem(nIDCtl, lpMeasureItemStruct);
00187 }
00188
00189 LRESULT CCJTabCtrl::OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu)
00190 {
00191     if (m_popupMenu.IsMenu(pMenu)) {
00192         return CCJMenu::FindKeyboardShortcut(nChar, nFlags, pMenu);
00193     }
00194
00195     return CTabCtrl::OnMenuChar(nChar, nFlags, pMenu);
00196 }
00197
00198 void CCJTabCtrl::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu)
00199 {
00200     CTabCtrl::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
00201
00202     if(!bSysMenu) {
00203         if (m_popupMenu.IsMenu(pPopupMenu)) {
00204             CCJMenu::UpdateMenu(pPopupMenu);
00205         }
00206     }
00207 }
00208
00209 BOOL CCJTabCtrl::Create(CWnd* pParentWnd, UINT nID, DWORD dwStyle, const CRect& rect)
00210 {
00211     if (!CTabCtrl::Create(dwStyle, rect, pParentWnd, nID))
00212         return FALSE;
00213
00214     UpdateFont();
00215     return TRUE;
00216 }
00217
00218 BOOL CCJTabCtrl::OnEraseBkgnd(CDC* pDC)
00219 {
00220     // KStowell - overridden for flicker-free drawing.
00221     UNUSED_ALWAYS(pDC);
00222     return TRUE;
00223 }
00224
00225 void CCJTabCtrl::UpdateFont()
00226 {
00227     m_Font.DeleteObject();
00228     NONCLIENTMETRICS ncm;
00229     ncm.cbSize = sizeof(ncm);
00230     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00231     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00232     SetFont(&m_Font);
00233 }
00234
00235 void CCJTabCtrl::OnPaint()
00236 {
00237     CPaintDC dc(this); // device context for painting
00238
00239
00240     // KStowell - Get the client rect.
00241     CRect rcClient;
00242     GetClientRect( &rcClient );
00243
00244     // KStowell - Create a memory device-context. This is done to help reduce
00245     // screen flicker, since we will paint the entire control to the
00246     // off screen device context first.
00247     CDC memDC;
00248     CBitmap bitmap;
00249     memDC.CreateCompatibleDC(&dc);
00250     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00251     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00252
00253     // KStowell - Repaint the background.
00254     memDC.FillSolidRect( rcClient, afxData.clrBtnFace );
00255
00256     // let the control do its default drawing.
00257     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00258
00259     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00260     dc.BitBlt(rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), &memDC, 0,0, SRCCOPY);
00261
00262     // KStowell - Cleanup resources.
00263     memDC.SelectObject(pOldBitmap);
00264     memDC.DeleteDC();
00265     bitmap.DeleteObject();
00266 }
Generated on Sun Feb 24 01:21:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJTabCtrlBar.cpp Source File

WinCvs/CJLib/CJLibrary/CJTabCtrlBar.cpp

Go to the documentation of this file.
00001 // CJTabCtrlBar.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/CJLibrary/CJTabCtrlBar.cpp $
00011  *
00012  * $History: CJTabCtrlBar.cpp $
00013  *
00014  * *****************  Version 22  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:29p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Enabled OnInitialUpdate() to be called for tab views added to
00018  * CCJTabCtrlBar whenever the control bar is floating.
00019  *
00020  * Fixed potential resource and memory leak problems.
00021  *
00022  * Fixed problems with AddView(...) setting the wrong view index to
00023  * active.
00024  *
00025  * Added  EnableToolTips method which enables and disables the tooltips.
00026  * Thanks to Phil Baxter for help with this.
00027  *
00028  * Fixed problem with dangling pointer in DeleteView. Thanks to Gero Kuehn
00029  * [gero.kuehn@isc-soft.de] for help with this.
00030  *
00031  * Fixed potential bug with CCJTabControlBar returning image index, fixed
00032  * bug with GetTabFromPoint(...) returning invalid index.
00033  *
00034  * Made class methods virtual for inhertance purposes.
00035  *
00036  * *****************  Version 20  *****************
00037  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00038  * Updated in $/CodeJockey/CJLibrary
00039  * Updated copyright and contact information.
00040  *
00041  * *****************  Version 19  *****************
00042  * User: Kirk Stowell Date: 8/30/99    Time: 12:46a
00043  * Updated in $/CodeJockey/CJLibrary
00044  * Gero Kuehn <gero.kuehn@isc-soft.de> - Added fixes for tab view
00045  * activation and removal.
00046  *
00047  * *****************  Version 18  *****************
00048  * User: Kirk Stowell Date: 8/29/99    Time: 9:54p
00049  * Updated in $/CodeJockey/CJLibrary
00050  * Fixed debug assert when adding a view with no associated document.
00051  *
00052  * *****************  Version 17  *****************
00053  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00054  * Updated in $/CodeJockey/CJLibrary
00055  * Added Unicode compliance, thanks to Barry Burton for his help with
00056  * this.
00057  *
00058  *
00059  * *****************  Version 16  *****************
00060  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00061  * Updated in $/CodeJockey/CJLibrary
00062  *
00063  * *****************  Version 15  *****************
00064  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00065  * Updated in $/CodeJockey/CJLibrary
00066  *
00067  * *****************  Version 14  *****************
00068  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00069  * Updated in $/CodeJockey/CJLibrary
00070  *
00071  * *****************  Version 13  *****************
00072  * User: Kirk Stowell Date: 7/14/99    Time: 9:43p
00073  * Updated in $/CodeJockey/CJLibrary
00074  * Added _DYNAMIC macros for access to the CObject::IsKindOf to determine
00075  * the class object at runtime. Added method GetTabFromPoint which returns
00076  * the tab index based upon cursor position. Thanks to Sid Price
00077  * [sidprice@softtools.com] for suggesting this.
00078  *
00079  * *****************  Version 12  *****************
00080  * User: Kirk Stowell Date: 6/11/99    Time: 10:17p
00081  * Updated in $/CodeJockey/CJ60Lib
00082  * Minor modifications to fix level 4 compilier warnings.
00083  *
00084  * *****************  Version 11  *****************
00085  * User: Kirk Stowell Date: 5/17/99    Time: 9:07p
00086  * Updated in $/CodeJockey/CJ60Lib
00087  * Paul [RowingWolf@aol.com] - Added the following support methods:
00088  * void SetActiveView(CView* pUserView)
00089  * void AssociateImageIndexWithRuntimeClass(int nIndex, CRuntimeClass*
00090  * pRuntimeClass)
00091  * void AssociateImageIndexWithRuntimeClass(int nIndex, LPCTSTR
00092  * lpszRuntimeClassName)
00093  * short GetImageIndexFromRuntimeClass(CRuntimeClass* pRuntimeClass)
00094  * BOOL RemoveAllTabs().
00095  *
00096  * *****************  Version 10  *****************
00097  * User: Kirk Stowell Date: 5/12/99    Time: 5:32a
00098  * Updated in $/CodeJockey/CJ60Lib
00099  * Added support for vc5 compatibility
00100  *
00101  * *****************  Version 9  *****************
00102  * User: Kirk Stowell Date: 5/11/99    Time: 10:02p
00103  * Updated in $/CodeJockey/CJ60Lib
00104  * After much frustration, a class re-write. Fixed many of the issues with
00105  * painting, invalid pointers and memory leaks. Added document support for
00106  * views associated with the tab control.
00107  *
00108  * *****************  Version 8  *****************
00109  * User: Kirk Stowell Date: 4/14/99    Time: 11:53p
00110  * Updated in $/CodeJockey/CJ60Lib
00111  * Added context popupMenu for CJTabCtrl to use Brent Corkum's BCMenu (CCJMenu).
00112  *
00113  * *****************  Version 7  *****************
00114  * User: Kirk Stowell Date: 4/03/99    Time: 11:52p
00115  * Updated in $/CodeJockey/CJ60Lib
00116  * Added comments and cleaned up code, modified AddView(...) to allow a
00117  * CDocument to be associated with the view added to the tab control.
00118  *
00119  * *****************  Version 6  *****************
00120  * User: Kirk Stowell Date: 3/14/99    Time: 11:51p
00121  * Updated in $/CodeJockey/CJ60Lib
00122  * Gonzalo Pereyra [ persys@adinet.com.uy ] - I wanted to trap NM_RETURN
00123  * notifications in my CTreeView Class. I couldn't... It turns out that
00124  * CControlbar::PreTranslateMessage() will eat all dialog messages...It
00125  * will never get dispatched to my window. So I Overrided it in :
00126  * CCJTabCtrlBar::PreTranslateMessage(). this will allow for message
00127  * reflection and we will get NM_RETURN. I don't know if this a good
00128  * solution but for now , it works.
00129  *
00130  * *****************  Version 5  *****************
00131  * User: Kirk Stowell Date: 2/24/99    Time: 11:49p
00132  * Updated in $/CodeJockey/CJ60Lib
00133  * Phil Baxter [pgb@mrjinx.demon.co.uk] - Fixed the following problems
00134  * when tabs are added after creation:
00135  * 1. The tab was created, but the view that was showing on the tab was
00136  * not visible.
00137  * 2. Get an assertion when the AddView function attempts to perform the
00138  * AddTool function.
00139  * 3. When a new view is added, although you set it to be the active view,
00140  * it isn't raised to the top of the stack in the display.
00141  * 4. The Tab name as stored in the TCB_ITEM structure is now a CString,
00142  * this removes the 32 byte limit that it previously had.
00143  * 5. New methods for obtaining the name as stored in the TCB_ITEM
00144  * structure.
00145  * 6. New Methods for deleting a view from the control, this removes the
00146  * view entirely including its  associated tab.
00147  * 7. Some minor fixes around assertions when trying to manipulate the
00148  * control when it has not had any tabs created.
00149  * 8. Added two new member functions:
00150  * void SetViewToolTip(int nView, LPCTSTR lpszLabel);
00151  * void SetViewToolTip(CRuntimeClass *pViewClass, LPCTSTR lpszLabel);
00152  *
00153  * *****************  Version 4  *****************
00154  * User: Kirk Stowell Date: 1/31/99    Time: 11:48p
00155  * Updated in $/CodeJockey/CJ60Lib
00156  * Commented out 2 calls to SetActiveView(). This somewhat fixes the
00157  * problem with CTRL+TAB in activatation of MDI child windows, however if
00158  * you click inside the view, this breaks CTRL+TAB again, will look at
00159  * this when I get some free time. Thanks to Pierre Guimont
00160  * (Pierre_Guimont@mitel.com) for pointing this out.
00161  *
00162  * Added m_TabCtrl.GetRowCount() as per Rashid Thadha
00163  * rashidt@consort.co.uk) request.
00164  *
00165  * *****************  Version 3  *****************
00166  * User: Kirk Stowell Date: 1/17/99    Time: 11:46p
00167  * Updated in $/CodeJockey/CJ60Lib
00168  * Added helper class CCJTabCtrl to eliminate re-painting problems such as
00169  * when the app is minimized then restored.
00170  *
00171  * *****************  Version 2  *****************
00172  * User: Kirk Stowell Date: 1/03/99    Time: 11:46p
00173  * Updated in $/CodeJockey/CJ60Lib
00174  * Application freezing bug fixed by
00175  * LiangYiBin.Donald(mailto:lybd@yahoo.com)
00176  *
00177  * *****************  Version 1  *****************
00178  * User: Kirk Stowell Date: 10/17/98   Time: 11:45p
00179  * Created in $/CodeJockey/CJ60Lib
00180  * Initial re-write and release.
00181  *
00182  ***************************************************************************/
00184
00185 #include "stdafx.h"
00186 #include "CJTabCtrlBar.h"
00187 #include "CJResource.h"
00188
00189 #ifdef _DEBUG
00190 #define new DEBUG_NEW
00191 #undef THIS_FILE
00192 static char THIS_FILE[] = __FILE__;
00193 #endif
00194
00196 // CCJTabCtrlBar
00197
00198 CCJTabCtrlBar::CCJTabCtrlBar()
00199 {
00200     m_nActiveTab        = 0;
00201     m_nNextToolTipId    = 0;
00202     m_bToolTipsEnabled  = TRUE;
00203 }
00204
00205 CCJTabCtrlBar::~CCJTabCtrlBar()
00206 {
00207     while(!m_viewList.IsEmpty())
00208     {
00209         TCB_ITEM *pMember = m_viewList.RemoveHead();
00210         _delete(pMember);
00211     }
00212 }
00213
00214 IMPLEMENT_DYNAMIC(CCJTabCtrlBar, CCJControlBar)
00215
00216 BEGIN_MESSAGE_MAP(CCJTabCtrlBar, CCJControlBar)
00217     //{{AFX_MSG_MAP(CCJTabCtrlBar)
00218     ON_WM_CREATE()
00219     ON_WM_WINDOWPOSCHANGED()
00220     ON_NOTIFY(TCN_SELCHANGE, IDC_TAB_CONTROL, OnTabSelChange)
00221     //}}AFX_MSG_MAP
00222 END_MESSAGE_MAP()
00223
00225 // CCJTabCtrlBar message handlers
00226
00227 void CCJTabCtrlBar::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos)
00228 {
00229     // Get a pointer to the parent frame.
00230     CFrameWnd* pFrame = GetParentFrame();
00231     ASSERT(pFrame != NULL);
00232
00233     POSITION pos = m_viewList.GetHeadPosition();
00234     while( pos != NULL )
00235     {
00236         // Get the item for this position.
00237         TCB_ITEM *pItem = (TCB_ITEM*)m_viewList.GetNext(pos);
00238         ASSERT(pItem != NULL);
00239
00240         // To avoid mainwindow freezing, we must
00241         // deativate the view, it's not visible now.
00242         if (pFrame->GetActiveView() == pItem->pWnd) {
00243             pFrame->SetActiveView(NULL);
00244         }
00245
00246         // Resize the tab view.
00247         SizeTabView(pItem->pWnd);
00248     }
00249
00250     CCJControlBar::OnWindowPosChanged(lpwndpos);
00251 }
00252
00253 int CCJTabCtrlBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
00254 {
00255     if (CCJControlBar::OnCreate(lpCreateStruct) == -1)
00256         return -1;
00257
00258     // Create the Tab Control
00259     if (!m_TabCtrl.Create(this, IDC_TAB_CONTROL))
00260     {
00261         TRACE0( "Unable to create tab control bar\n" );
00262         return -1;
00263     }
00264
00265     // Associate the child window.
00266     SetChild(&m_TabCtrl);
00267
00268     return 0;
00269 }
00270
00271 BOOL CCJTabCtrlBar::PreTranslateMessage(MSG* pMsg)
00272 {
00273     if (pMsg->message == WM_KEYDOWN)
00274     {
00275         switch (pMsg->wParam)
00276         {
00277         case VK_RETURN:
00278             m_pActiveView->SendMessage(pMsg->message,
00279                 pMsg->wParam, pMsg->lParam);
00280             return TRUE;
00281         }
00282     }
00283
00284     return CCJControlBar::PreTranslateMessage(pMsg);
00285 }
00286
00287 void CCJTabCtrlBar::OnTabSelChange(NMHDR* /*pNMHDR*/, LRESULT* /*pResult*/)
00288 {
00289     SetActiveView(m_TabCtrl.GetCurSel());
00290 }
00291
00292 void CCJTabCtrlBar::GetChildRect(CRect &rect)
00293 {
00294     CCJControlBar::GetChildRect(rect);
00295
00296     if (IsFloating()) {
00297         rect.DeflateRect(2,2);
00298     }
00299 }
00300
00301 BOOL CCJTabCtrlBar::CreateTabView(CRuntimeClass *pViewClass, CDocument *pDocument, CCreateContext *pContext)
00302 {
00303     CWnd* pWnd = NULL;
00304
00305     // if no context specified, generate one
00306     // from the currently selected client if possible...
00307     if (pContext == NULL)
00308     {
00309         CCreateContext context;
00310
00311         context.m_pNewViewClass     = pViewClass;
00312         context.m_pCurrentDoc       = pDocument;
00313         context.m_pNewDocTemplate   = pDocument?pDocument->GetDocTemplate() : NULL;
00314         context.m_pLastView         = GetParentFrame()->GetActiveView();
00315         context.m_pCurrentFrame     = GetParentFrame();
00316
00317         pContext = &context;
00318     }
00319
00320     TRY
00321     {
00322         // Create the object.
00323         pWnd = DYNAMIC_DOWNCAST(CWnd, pViewClass->CreateObject());
00324         if (!pWnd) AfxThrowMemoryException();
00325     }
00326     CATCH_ALL(e)
00327     {
00328         TRACE0( "Out of memory creating a view.\n" );
00329         // Note: DELETE_EXCEPTION(e) not required
00330         return FALSE;
00331     }
00332     END_CATCH_ALL
00333
00334     ASSERT_KINDOF(CWnd, pWnd);
00335     ASSERT(pWnd->m_hWnd == NULL); // not yet created.
00336
00337     // Create with the right size and position
00338     if (!pWnd->Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
00339         CRect(0,0,0,0), this, 0, pContext))
00340     {
00341         TRACE0( "Warning: couldn't create client pane for view.\n" );
00342         // pWnd will be cleaned up by PostNcDestroy
00343         return FALSE;
00344     }
00345
00346     // Set the newly create view as the active view.
00347     m_pActiveView = DYNAMIC_DOWNCAST(CView, pWnd);
00348     ASSERT_KINDOF(CView, m_pActiveView);
00349
00350     // If we were floating last, call OnInitialUpdate for the view
00351     // since CMiniDockFrameWnd does not do this for us.
00352     if( m_bFloating && m_pActiveView ) {
00353         m_pActiveView->OnInitialUpdate();
00354     }
00355
00356     return TRUE;
00357 }
00358
00359 TCB_ITEM* CCJTabCtrlBar::CreateTabListItem(LPCTSTR lpszLabel)
00360 {
00361     // Allocate a new TCB_ITEM object.
00362     TCB_ITEM* pMember = new TCB_ITEM;
00363
00364     pMember->pWnd           = m_pActiveView;
00365     pMember->szTabLabel     = lpszLabel;
00366     pMember->szToolTipLabel = lpszLabel;
00367     pMember->uiToolTipId    = m_nNextToolTipId++;
00368
00369     // Add the new TCB_ITEM to the tab item list.
00370     m_viewList.AddTail(pMember);
00371
00372     // Create the ToolTip for the tab.
00373     AddToolTip(pMember, lpszLabel);
00374
00375     return pMember;
00376 }
00377
00378 CToolTipCtrl* CCJTabCtrlBar::GetToolTip()
00379 {
00380     // Get a pointer to the tab control's CToolTipCtrl.
00381 #ifdef _VC_VERSION_5
00382     CToolTipCtrl* pToolTip = m_TabCtrl.GetTooltips();
00383     ASSERT(pToolTip != NULL);
00384 #else
00385     CToolTipCtrl* pToolTip = m_TabCtrl.GetToolTips();
00386     ASSERT(pToolTip != NULL);
00387 #endif // _VC_VERSION_5
00388
00389     return pToolTip;
00390 }
00391
00392 void CCJTabCtrlBar::AddToolTip(TCB_ITEM *pMember, LPCTSTR lpszLabel)
00393 {
00394     // Get the tool tips for the tab control.
00395     CToolTipCtrl* pToolTip = GetToolTip();
00396
00397     // Add the tool tip.
00398     if( pMember->uiToolTipId == 0 ) {
00399         pToolTip->AddTool( &m_TabCtrl, lpszLabel,
00400             NULL, pMember->uiToolTipId );
00401     }
00402     else {
00403         pToolTip->AddTool( &m_TabCtrl, lpszLabel,
00404             CRect(0,0,0,0), pMember->uiToolTipId );
00405     }
00406 }
00407
00408 void CCJTabCtrlBar::ResetToolTips(CToolTipCtrl* pToolTip)
00409 {
00410     if (pToolTip)
00411     {
00412         int nIndex = 0;
00413         POSITION pos;
00414         for( pos = m_viewList.GetHeadPosition(); pos; m_viewList.GetNext(pos) )
00415         {
00416             // Get the next item in the list.
00417             TCB_ITEM* pMember = m_viewList.GetAt( pos );
00418
00419             // Update the tooltip for the view
00420             pMember->uiToolTipId = nIndex;
00421             pToolTip->UpdateTipText( pMember->szToolTipLabel, &m_TabCtrl,
00422                 pMember->uiToolTipId );
00423
00424             nIndex++;
00425         }
00426
00427         m_nNextToolTipId = ( nIndex == 0 )?1:nIndex;
00428     }
00429 }
00430
00431 BOOL CCJTabCtrlBar::AddView(LPCTSTR lpszLabel, CRuntimeClass *pViewClass,
00432     CDocument* pDoc/*=NULL*/, UINT nIndex/*=-1*/, CCreateContext *pContext/*=NULL*/)
00433 {
00434     OverkillAssert(pViewClass);
00435
00436     // Create the view to be associate with tab.
00437     if (!CreateTabView(pViewClass, pDoc, pContext))
00438         return FALSE;
00439
00440     // Create the tab list item.
00441     if (CreateTabListItem(lpszLabel) == NULL)
00442         return FALSE;
00443
00444     // Since the tool tip count has changed,
00445     // re-initialize the tooltips.
00446     ResetToolTips(GetToolTip());
00447
00448     int nViews = ( nIndex == -1 )?m_viewList.GetCount():nIndex;
00449     if( nViews != 1 ) {
00450         m_pActiveView->EnableWindow(FALSE);
00451         m_pActiveView->ShowWindow(SW_HIDE);
00452     }
00453
00454     // Insert the new tab item.
00455     TC_ITEM tci;
00456     tci.mask    = TCIF_TEXT | TCIF_IMAGE;
00457     tci.pszText = (LPTSTR)(LPCTSTR)lpszLabel;
00458     tci.iImage  = nViews-1;
00459     m_TabCtrl.InsertItem(m_viewList.GetCount()-1, &tci);
00460
00461     // Resize the tab view.
00462     SizeTabView(m_pActiveView);
00463
00464     return TRUE;
00465 }
00466
00467 void CCJTabCtrlBar::SizeTabView(CWnd *pWnd)
00468 {
00469     // Get the new window size.
00470     CRect rcChild;
00471     GetChildRect(rcChild);
00472     rcChild.DeflateRect(3,3);
00473     rcChild.bottom -= (21 * m_TabCtrl.GetRowCount());
00474
00475     // Resize the window.
00476     pWnd->MoveWindow(rcChild);
00477     pWnd->SetWindowPos(NULL, 0,0,0,0,
00478         SWP_NOSIZE|SWP_NOMOVE);
00479 }
00480
00481 void CCJTabCtrlBar::OverkillAssert(CRuntimeClass *pViewClass)
00482 {
00483 #ifdef _DEBUG
00484     ASSERT_VALID(this);
00485     ASSERT(pViewClass != NULL);
00486     ASSERT(pViewClass->IsDerivedFrom(RUNTIME_CLASS(CWnd)));
00487     ASSERT(AfxIsValidAddress(pViewClass, sizeof(CRuntimeClass), FALSE));
00488 #else
00489     UNUSED_ALWAYS( pViewClass );
00490 #endif
00491 }
00492
00493 void CCJTabCtrlBar::RemoveListItem(POSITION pos)
00494 {
00495     if( pos != NULL )
00496     {
00497         // remove the page from internal list
00498         TCB_ITEM *pMember = m_viewList.GetAt(pos);
00499         ASSERT(pMember);
00500
00501         // And delete the member window, freeing our stored
00502         // values relating to it
00503         if (pMember->pWnd != NULL) {
00504             pMember->pWnd->DestroyWindow();
00505             pMember->pWnd = NULL;
00506         }
00507
00508         // Remove from list and free memory.
00509         m_viewList.RemoveAt(pos);
00510         _delete(pMember);
00511     }
00512 }
00513
00514 void CCJTabCtrlBar::DeleteView(int nView)
00515 {
00516     ASSERT_VALID( this );
00517     ASSERT(( nView >= 0 ) && (m_TabCtrl.GetItemCount() > nView));
00518
00519     TRACE2("***DeleteView: %d ( /%d )\n", nView,m_viewList.GetCount());
00520
00521     // Now find the view we want to delete and remove it
00522     POSITION pos = m_viewList.FindIndex(nView);
00523     if( pos != NULL )
00524     {
00525         CView *pOldActiveView;
00526         pOldActiveView = m_pActiveView;
00527
00528         // Ensure that we get no dangling pointers
00529         // DO NOT (RE-)MOVE THIS CODE ! Gero Kuehn [gero.kuehn@isc-soft.de]
00530         if(GetParentFrame()->GetActiveView() == DYNAMIC_DOWNCAST( CView, m_viewList.GetAt(pos)->pWnd))
00531             GetParentFrame()->SetActiveView( NULL , FALSE);
00532
00533         // Remove item from list, and free memory.
00534         RemoveListItem( pos );
00535
00536         // Remove it from the tab control
00537         m_TabCtrl.DeleteItem(nView);
00538
00539         // Finally, if we have just deleted the active view, reset the
00540         // active tab to be the first view in the list
00541         if (nView == m_nActiveTab)
00542         {
00543             m_nActiveTab = -1;
00544             m_pActiveView = NULL; // Gero Kuehn [gero.kuehn@isc-soft.de]
00545         }
00546         else
00547         {
00548             // ** GK/ISC
00549             if((m_nActiveTab - 1)>=0) {
00550                 SetActiveView(m_nActiveTab - 1);
00551             }
00552         }
00553
00554         // Reset the tooltips for the views we have left...
00555         ResetToolTips(GetToolTip());
00556     }
00557 }
00558
00559 void CCJTabCtrlBar::DeleteView(CRuntimeClass *pViewClass)
00560 {
00561     OverkillAssert(pViewClass);
00562
00563     int nIndex = 0;
00564     for( POSITION pos = m_viewList.GetHeadPosition(); pos; m_viewList.GetNext( pos ))
00565     {
00566         TCB_ITEM *pMember = m_viewList.GetAt(pos);
00567         ASSERT(pMember);
00568
00569         if (pMember->pWnd->IsKindOf(pViewClass)) {
00570             DeleteView(nIndex);
00571             return;
00572         }
00573         nIndex++;
00574     }
00575 }
00576
00577 void CCJTabCtrlBar::RemoveView(int nView)
00578 {
00579     ASSERT_VALID( this );
00580     ASSERT(( nView >= 0 ) && (m_TabCtrl.GetItemCount() > nView));
00581     RemoveListItem( m_viewList.FindIndex( nView ));
00582 }
00583
00584 void CCJTabCtrlBar::SetViewToolTip(int nView, LPCTSTR lpszLabel)
00585 {
00586     ASSERT_VALID(this);
00587     ASSERT(( nView >= 0 ) && (m_TabCtrl.GetItemCount() > nView));
00588
00589     // Find the view we want to change the tooltip for and
00590     // reset its tooltip text
00591     POSITION pos = m_viewList.FindIndex( nView );
00592     if( pos != NULL )
00593     {
00594         // Get the private data for the view
00595         TCB_ITEM *pMember = m_viewList.GetAt(pos);
00596
00597         // Reset the tooltip text to the new value
00598         pMember->szToolTipLabel = lpszLabel;
00599
00600         // Update the tooltip for the view
00601         GetToolTip()->UpdateTipText( pMember->szToolTipLabel,
00602             &m_TabCtrl, pMember->uiToolTipId );
00603     }
00604 }
00605
00606 void CCJTabCtrlBar::SetViewToolTip(CRuntimeClass *pViewClass, LPCTSTR lpszLabel)
00607 {
00608     OverkillAssert(pViewClass);
00609
00610     int nIndex=0;
00611     for (POSITION pos=m_viewList.GetHeadPosition(); pos; m_viewList.GetNext(pos))
00612     {
00613         TCB_ITEM *pMember=m_viewList.GetAt(pos);
00614         if (pMember->pWnd->IsKindOf(pViewClass))
00615         {
00616             SetViewToolTip(nIndex, lpszLabel);
00617             break;
00618         }
00619         nIndex++;
00620     }
00621     return;
00622 }
00623
00624 CView* CCJTabCtrlBar::GetView(int nView)
00625 {
00626     ASSERT_VALID(this);
00627     ASSERT(( nView >= 0 ) && ( m_TabCtrl.GetItemCount() > nView ));
00628
00629     if( nView != -1 )
00630     {
00631         POSITION pos = m_viewList.FindIndex( nView );
00632         if( pos != NULL )
00633         {
00634             TCB_ITEM* pMember = m_viewList.GetAt( pos );
00635             return ( pMember )?(CView*)pMember->pWnd:NULL;
00636         }
00637
00638         return NULL;
00639     }
00640
00641     return NULL;
00642 }
00643
00644 CView* CCJTabCtrlBar::GetView(CRuntimeClass *pViewClass)
00645 {
00646     OverkillAssert(pViewClass);
00647
00648     for( POSITION pos = m_viewList.GetHeadPosition(); pos; m_viewList.GetNext( pos ))
00649     {
00650         TCB_ITEM *pMember = m_viewList.GetAt( pos );
00651         if( pMember->pWnd->IsKindOf( pViewClass )) {
00652             return (CView*)pMember->pWnd;
00653         }
00654     }
00655     return NULL;
00656 }
00657
00658 LPCTSTR CCJTabCtrlBar::GetViewName(int nView)
00659 {
00660     ASSERT_VALID(this);
00661     ASSERT(( nView >= 0 ) && ( m_TabCtrl.GetItemCount() > nView ));
00662
00663     if( nView != -1 )
00664     {
00665         POSITION pos = m_viewList.FindIndex( nView );
00666         if( pos != NULL )
00667         {
00668             TCB_ITEM* pMember = m_viewList.GetAt( pos );
00669             return ( pMember )?(LPCTSTR)pMember->szTabLabel:NULL;
00670         }
00671
00672         return NULL;
00673     }
00674
00675     return NULL;
00676 }
00677
00678 LPCTSTR CCJTabCtrlBar::GetViewName(CRuntimeClass *pViewClass)
00679 {
00680     OverkillAssert(pViewClass);
00681
00682     for( POSITION pos = m_viewList.GetHeadPosition(); pos; m_viewList.GetNext( pos ))
00683     {
00684         TCB_ITEM *pMember = m_viewList.GetAt( pos );
00685         if( pMember->pWnd->IsKindOf( pViewClass )) {
00686             return (LPCTSTR)pMember->szTabLabel;
00687         }
00688     }
00689     return NULL;
00690 }
00691
00692 void CCJTabCtrlBar::SetActiveView(int nView)
00693 {
00694     ASSERT_VALID(this);
00695     ASSERT(( nView >= 0 ) && ( m_TabCtrl.GetItemCount() > nView ));
00696
00697     if(( nView != -1 ) && ( nView != m_nActiveTab ))
00698     {
00699         POSITION pos = m_viewList.FindIndex( nView );
00700         if( pos != NULL )
00701         {
00702             // Hide the old view we are changing.
00703             // GK/ISC
00704             POSITION oldPos = NULL;
00705             if( m_nActiveTab >= 0) {
00706                 oldPos = m_viewList.FindIndex( m_nActiveTab );
00707             }
00708
00709             if( oldPos )
00710             {
00711                 TCB_ITEM* pOldItem = m_viewList.GetAt( oldPos );
00712                 pOldItem->pWnd->EnableWindow(FALSE);
00713                 pOldItem->pWnd->ShowWindow(SW_HIDE);
00714             }
00715
00716             // Show the newly selected view.
00717             TCB_ITEM* pMember = m_viewList.GetAt( pos );
00718             pMember->pWnd->EnableWindow(TRUE);
00719             pMember->pWnd->ShowWindow(SW_SHOW);
00720             pMember->pWnd->SetFocus();
00721
00722             // select the tab (if tab programmatically changed)
00723             m_nActiveTab = nView;
00724             m_TabCtrl.SetCurSel( m_nActiveTab );
00725
00726             // Set the active view.
00727             m_pActiveView = DYNAMIC_DOWNCAST( CView, pMember->pWnd );
00728             ASSERT_KINDOF( CView, m_pActiveView );
00729             GetParentFrame()->SetActiveView( m_pActiveView );
00730         }
00731     }
00732 }
00733
00734 void CCJTabCtrlBar::SetActiveView(CRuntimeClass *pViewClass)
00735 {
00736     OverkillAssert(pViewClass);
00737
00738     int nView = 0;
00739     for (POSITION pos=m_viewList.GetHeadPosition(); pos; m_viewList.GetNext(pos))
00740     {
00741         TCB_ITEM *pMember=m_viewList.GetAt(pos);
00742         if (pMember->pWnd->IsKindOf(pViewClass))
00743         {
00744             //first hide old first view
00745             m_pActiveView->EnableWindow(FALSE);
00746             m_pActiveView->ShowWindow(SW_HIDE);
00747
00748             // set new active view
00749             m_pActiveView = (CView*)pMember->pWnd;
00750
00751             // enable, show, set focus to new view
00752             m_pActiveView->EnableWindow(TRUE);
00753             m_pActiveView->ShowWindow(SW_SHOW);
00754             m_pActiveView->SetFocus();
00755
00756             m_nActiveTab = nView;
00757
00758             // select the tab
00759             m_TabCtrl.SetCurSel(m_nActiveTab);
00760
00761             break;
00762         }
00763         nView++;
00764     }
00765 }
00766
00767 void CCJTabCtrlBar::SetActiveView(CView* pUserView)
00768 {
00769     // Walk through the tabs
00770     for (POSITION pos=m_viewList.GetHeadPosition(); pos; m_viewList.GetNext(pos))
00771     {
00772         // Get the tab's view
00773         CView* pTabView = (CView *)(m_viewList.GetAt(pos)->pWnd);
00774
00775         // Does the tab view match the requested view?
00776         if (pTabView == pUserView)
00777         {
00778             // Change the active view
00779             m_pActiveView = pTabView;
00780             ((CFrameWnd *)GetParent())->SetActiveView((CView *)m_pActiveView);
00781         }
00782     }
00783 }
00784
00785 void CCJTabCtrlBar::AssociateImageIndexWithRuntimeClass(int nIndex, CRuntimeClass* pRuntimeClass)
00786 {
00787     CString szClassName(pRuntimeClass->m_lpszClassName);
00788     m_ClassNameToImageIndexMap[szClassName] = (short*)nIndex;
00789 }
00790
00791 void CCJTabCtrlBar::AssociateImageIndexWithRuntimeClass(int nIndex, LPCTSTR lpszRuntimeClassName)
00792 {
00793     CString szClassName(lpszRuntimeClassName);
00794     m_ClassNameToImageIndexMap[szClassName] = (short*)nIndex;
00795 }
00796
00797 short CCJTabCtrlBar::GetImageIndexFromRuntimeClass(CRuntimeClass* pRuntimeClass)
00798 {
00799     ASSERT(m_ClassNameToImageIndexMap.GetCount() > 0);
00800     CString szClassName(pRuntimeClass->m_lpszClassName);
00801
00802     // Look for class name
00803     short* psValue;
00804     if (FALSE == m_ClassNameToImageIndexMap.Lookup(szClassName, (void*&)psValue))
00805         return -1;
00806
00807     // return the de-referenced pointer.
00808     return *psValue;
00809
00810 }
00811
00812 BOOL CCJTabCtrlBar::RemoveAllTabs()
00813 {
00814     // Itterate the tab views
00815     while(!m_viewList.IsEmpty())
00816     {
00817         RemoveView(0);  // Remove the view from the bar
00818         m_TabCtrl.DeleteItem(0);
00819     }
00820     m_pActiveView = NULL;
00821     ((CFrameWnd *)GetParent())->SetActiveView(NULL);
00822     Invalidate();
00823     return TRUE;
00824 }
00825
00826 int CCJTabCtrlBar::GetTabFromPoint(CPoint point)
00827 {
00828     TCHITTESTINFO tch;
00829     memset(&tch, 0, sizeof(TCHITTESTINFO));
00830
00831     if( point == CPoint(0,0) ) {
00832         CPoint pt;
00833         GetCursorPos(&pt);
00834         ScreenToClient(&pt);
00835         tch.pt = pt;
00836     } else {
00837         tch.pt = point;
00838     }
00839
00840     int iTab = m_TabCtrl.HitTest(&tch);
00841
00842     if( iTab != -1 ) {
00843         m_nPointTab = iTab ;
00844     }
00845
00846     return iTab;
00847 }
00848
00849 BOOL CCJTabCtrlBar::EnableToolTips(BOOL bEnable)
00850 {
00851     BOOL bPrev = m_bToolTipsEnabled;
00852
00853     m_bToolTipsEnabled = bEnable;
00854
00855     // Get the tool tips for the tab control.
00856     CToolTipCtrl* pToolTip = GetToolTip();
00857
00858     if (pToolTip)
00859         pToolTip->Activate(m_bToolTipsEnabled);
00860     else
00861         m_bToolTipsEnabled = bPrev;
00862
00863     return bPrev;
00864 }
00865
Generated on Sun Feb 24 01:21:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJTabView.cpp Source File

WinCvs/CJLib/CJLibrary/CJTabView.cpp

Go to the documentation of this file.
00001 // CJTabView.cpp: implementation file
00002 //
00003 // Copyright © 1999 Mike Manzo
00004 // mailto:mmanzo@ieee.org
00005 //
00007 /****************************************************************************
00008  *
00009  * $Date: 1999/11/30 21:45:49 $
00010  * $Revision: 1.1.1.3 $
00011  * $Archive: /CodeJock/CJLibrary/CJTabView.cpp $
00012  *
00013  * $History: CJTabView.cpp $
00014  *
00015  * *****************  Version 13  *****************
00016  * User: Kirk Stowell Date: 10/30/99   Time: 1:57p
00017  * Updated in $/CodeJock/CJLibrary
00018  * Overrode OnEraseBkgnd(...) for flicker free drawing.
00019  *
00020  * *****************  Version 12  *****************
00021  * User: Kirk Stowell Date: 10/24/99   Time: 3:15a
00022  * Updated in $/CodeJock/CJLibrary
00023  *
00024  * *****************  Version 11  *****************
00025  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00026  * Updated in $/CodeJock/CJLibrary
00027  * Fixed potential resource and memory leak problems.
00028  *
00029  * *****************  Version 10  *****************
00030  * User: Kirk Stowell Date: 10/14/99   Time: 12:41p
00031  * Updated in $/CodeJock/CJLibrary
00032  * Added source control history to file header.
00033  *
00034  ***************************************************************************/
00036
00037 #include "stdafx.h"
00038 #include "CJTabView.h"
00039
00040 #ifdef _DEBUG
00041 #define new DEBUG_NEW
00042 #undef THIS_FILE
00043 static char THIS_FILE[] = __FILE__;
00044 #endif
00045
00047 // CCJTabView
00048 IMPLEMENT_DYNCREATE(CCJTabView, CCtrlView)
00049
00050 CCJTabView::CCJTabView() : CCtrlView(_T("SysTabControl32"),
00051     TCS_TOOLTIPS | WS_VISIBLE | WS_CHILD | WS_BORDER)
00052 {
00053     m_pTabCtrl = (CTabCtrl*) this;
00054     m_nActiveTab = 0;
00055 }
00056
00057 CCJTabView::~CCJTabView()
00058 {
00059     while(!m_views.IsEmpty()) {
00060         CTV_ITEM *pMember=m_views.RemoveTail();
00061         _delete(pMember);
00062     }
00063
00064     // fix potential resource leak - KStowell - 10-22-99.
00065     m_TabFont.DeleteObject();
00066 }
00067
00068 BEGIN_MESSAGE_MAP(CCJTabView, CCtrlView)
00069     //{{AFX_MSG_MAP(CCJTabView)
00070     ON_WM_WINDOWPOSCHANGED()
00071     ON_NOTIFY_REFLECT(TCN_SELCHANGE, OnSelchange)
00072     ON_WM_CREATE()
00073     ON_WM_ERASEBKGND()
00074     //}}AFX_MSG_MAP
00075 END_MESSAGE_MAP()
00076
00077
00079 // CCJTabView message handlers
00080 void CCJTabView::GetChildRect(CRect &rect)
00081 {
00082     m_pTabCtrl->GetClientRect(&rect);
00083 }
00084
00085 CView* CCJTabView::GetView(int nView)
00086 {
00087     ASSERT_VALID(this);
00088     ASSERT(nView >= 0);
00089
00090     if (nView!=-1) {
00091         CTV_ITEM *pMember=m_views.GetAt(m_views.FindIndex(nView));
00092         return (CView*)pMember->pWnd;
00093     }
00094     else
00095         return NULL;
00096 }
00097
00098 CView* CCJTabView::GetView(CRuntimeClass *pViewClass)
00099 {
00100     ASSERT_VALID(this);
00101     ASSERT(pViewClass != NULL);
00102     ASSERT(pViewClass->IsDerivedFrom(RUNTIME_CLASS(CWnd)));
00103     ASSERT(AfxIsValidAddress(pViewClass, sizeof(CRuntimeClass), FALSE));
00104
00105     for (POSITION pos=m_views.GetHeadPosition(); pos; m_views.GetNext(pos)) {
00106         CTV_ITEM *pMember=m_views.GetAt(pos);
00107         if (pMember->pWnd->IsKindOf(pViewClass)) {
00108             return (CView*)pMember->pWnd;
00109         }
00110     }
00111     return NULL;
00112 }
00113
00114 BOOL CCJTabView::ModifyTabStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags)
00115 {
00116     DWORD dwCurrentStyle = GetStyle();
00117
00118     // We are in horizontal mode...go vertical
00119     if ((dwAdd & TCS_VERTICAL) && !(dwCurrentStyle & TCS_VERTICAL)) {
00120         // Get the log font.
00121         NONCLIENTMETRICS ncm;
00122         ncm.cbSize = sizeof(NONCLIENTMETRICS);
00123         VERIFY(::SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
00124             sizeof(NONCLIENTMETRICS), &ncm, 0));
00125         // fix potential resource leak - KStowell - 10-22-99.
00126         m_TabFont.DeleteObject();
00127         ncm.lfMessageFont.lfOrientation = (dwAdd & TCS_RIGHT) ? 2700 : 900;
00128         ncm.lfMessageFont.lfEscapement  = (dwAdd & TCS_RIGHT) ? 2700 : 900;
00129         m_TabFont.CreateFontIndirect(&ncm.lfMessageFont);
00130         m_pTabCtrl->SetFont(&m_TabFont);
00131     }
00132     // We are in vertical mode....go horizontal
00133     else if ((dwCurrentStyle & TCS_VERTICAL) && !(dwAdd & TCS_VERTICAL)) {
00134         // Get the log font.
00135         NONCLIENTMETRICS ncm;
00136         ncm.cbSize = sizeof(NONCLIENTMETRICS);
00137         VERIFY(::SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
00138             sizeof(NONCLIENTMETRICS), &ncm, 0));
00139         // fix potential resource leak - KStowell - 10-22-99.
00140         m_TabFont.DeleteObject();
00141         ncm.lfMessageFont.lfOrientation = 0;
00142         ncm.lfMessageFont.lfEscapement  = 0;
00143         m_TabFont.CreateFontIndirect(&ncm.lfMessageFont);
00144         m_pTabCtrl->SetFont(&m_TabFont);
00145     }
00146
00147     return m_pTabCtrl->ModifyStyle(dwRemove, dwAdd, nFlags);
00148 }
00149
00150 // Determine where the views should be placed in the tab...
00151 void CCJTabView::CalcViewRect(CRect* pRect)
00152 {
00153     GetChildRect((*pRect));
00154     DWORD dwStyle = GetStyle();
00155
00156     if ((dwStyle & TCS_BOTTOM) && !(dwStyle & TCS_VERTICAL)) {      // Bottom
00157         (*pRect).top    += TABVIEW_BORDER;
00158         (*pRect).left   += TABVIEW_BORDER;
00159         (*pRect).right  -= TABVIEW_BORDER;
00160         (*pRect).bottom -= 26;
00161     }
00162     else if ((dwStyle & TCS_RIGHT) && (dwStyle & TCS_VERTICAL)) {   // Right
00163         (*pRect).top    += TABVIEW_BORDER;
00164         (*pRect).left   += TABVIEW_BORDER;
00165         (*pRect).right  -= 26;
00166         (*pRect).bottom -= TABVIEW_BORDER;
00167     }
00168     else if (dwStyle & TCS_VERTICAL) {                              // Left
00169         (*pRect).top    += TABVIEW_BORDER;
00170         (*pRect).left   += 26;
00171         (*pRect).right  -= TABVIEW_BORDER;
00172         (*pRect).bottom -= TABVIEW_BORDER;
00173     }
00174     else {                                                          // Top
00175         (*pRect).top    += 26;
00176         (*pRect).left   += TABVIEW_BORDER;
00177         (*pRect).right  -= TABVIEW_BORDER;
00178         (*pRect).bottom -= TABVIEW_BORDER;
00179     }
00180 }
00181
00182 void CCJTabView::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos)
00183 {
00184     CRect rcChild;
00185     CWnd *pWnd;
00186
00187     CalcViewRect(&rcChild);
00188     for (POSITION pos=m_views.GetHeadPosition(); pos; m_views.GetNext(pos)) {
00189         pWnd = m_views.GetAt(pos)->pWnd;
00190         pWnd->MoveWindow(rcChild);
00191     }
00192
00193     // *** LiangYiBin.Donald
00194     if( lpwndpos->flags & SWP_HIDEWINDOW ) {
00195         CFrameWnd* pFrame = GetParentFrame();
00196         POSITION pos = m_views.GetHeadPosition();
00197         while ( pos != NULL ) {
00198             // check whether the views in the controlbar are focused
00199             CTV_ITEM *pItem = (CTV_ITEM *) m_views.GetNext(pos);
00200             if ( pFrame != NULL && pFrame->GetActiveView() == pItem->pWnd ) {
00201                 // To avoid mainwindow freezing, we must deativate the view,
00202                 // because it's not visible now.
00203                 pFrame->SetActiveView(NULL);
00204             }
00205         }
00206     }
00207
00208     CCtrlView::OnWindowPosChanged(lpwndpos);
00209 }
00210
00211 void CCJTabView::RemoveView(int nView)
00212 {
00213     ASSERT_VALID(this);
00214     ASSERT(nView >= 0);
00215
00216     // remove the page from internal list
00217     m_views.RemoveAt(m_views.FindIndex(nView));
00218 }
00219
00220 void CCJTabView::SetActiveView(CRuntimeClass *pViewClass)
00221 {
00222     ASSERT_VALID(this);
00223     ASSERT(pViewClass != NULL);
00224     ASSERT(pViewClass->IsDerivedFrom(RUNTIME_CLASS(CWnd)));
00225     ASSERT(AfxIsValidAddress(pViewClass, sizeof(CRuntimeClass), FALSE));
00226
00227     int nNewTab = 0;
00228     for (POSITION pos=m_views.GetHeadPosition(); pos; m_views.GetNext(pos)) {
00229         CTV_ITEM *pMember=m_views.GetAt(pos);
00230         if (pMember->pWnd->IsKindOf(pViewClass)) {
00231             //first hide old first view
00232             m_pActiveView->EnableWindow(FALSE);
00233             m_pActiveView->ShowWindow(SW_HIDE);
00234
00235             // set new active view
00236             m_pActiveView = (CView*)pMember->pWnd;
00237             // enable, show, set focus to new view
00238             m_pActiveView->EnableWindow(TRUE);
00239             m_pActiveView->ShowWindow(SW_SHOW);
00240             m_pActiveView->SetFocus();
00241
00242             // *** LiangYiBin.Donald
00243             //((CFrameWnd *)GetParent())->SetActiveView(m_pActiveView);
00244             //GetParentFrame()->SetActiveView(m_pActiveView);
00245
00246             m_nActiveTab = nNewTab;
00247             // select the tab
00248             m_pTabCtrl->SetCurSel(m_nActiveTab);
00249
00250             break;
00251         }
00252         nNewTab++;
00253     }
00254 }
00255
00256 void CCJTabView::SetActiveView(int nNewTab)
00257 {
00258     ASSERT_VALID(this);
00259     ASSERT(nNewTab >= 0);
00260
00261     if (nNewTab!=-1 && nNewTab!=m_nActiveTab) {
00262         CTV_ITEM *newMember=m_views.GetAt(m_views.FindIndex(nNewTab));
00263         CTV_ITEM *oldMember=NULL;
00264
00265         if (m_nActiveTab!=-1) {
00266             oldMember=m_views.GetAt(m_views.FindIndex(m_nActiveTab));
00267             oldMember->pWnd->EnableWindow(FALSE);
00268             oldMember->pWnd->ShowWindow(SW_HIDE);
00269         }
00270         newMember->pWnd->EnableWindow(TRUE);
00271         newMember->pWnd->ShowWindow(SW_SHOW);
00272         newMember->pWnd->SetFocus();
00273
00274         m_pActiveView = (CView *)newMember->pWnd;
00275
00276         m_nActiveTab = nNewTab;
00277         // select the tab (if tab programmatically changed)
00278         m_pTabCtrl->SetCurSel(m_nActiveTab);
00279     }
00280 }
00281
00282 CImageList* CCJTabView::SetTabImageList(CImageList *pImageList)
00283 {
00284     return m_pTabCtrl->SetImageList (pImageList);
00285 }
00286
00287 BOOL CCJTabView::AddView(LPCTSTR lpszLabel, CRuntimeClass *pViewClass, CDocument* pDoc/*=NULL*/, CCreateContext *pContext/*=NULL*/)
00288 {
00289
00290 #ifdef _DEBUG
00291     ASSERT_VALID(this);
00292     ASSERT(pViewClass != NULL);
00293     ASSERT(pViewClass->IsDerivedFrom(RUNTIME_CLASS(CWnd)));
00294     ASSERT(AfxIsValidAddress(pViewClass, sizeof(CRuntimeClass), FALSE));
00295 #endif
00296
00297     CCreateContext context;
00298     if (pContext == NULL)
00299     {
00300         context.m_pCurrentDoc       = pDoc;
00301         context.m_pCurrentFrame     = GetParentFrame();
00302         context.m_pLastView         = NULL;
00303         context.m_pNewDocTemplate   = NULL;
00304         context.m_pNewViewClass     = pViewClass;
00305         pContext = &context;
00306     }
00307
00308     CWnd* pWnd;
00309     TRY {
00310         pWnd = (CWnd*)pViewClass->CreateObject();
00311         if (pWnd == NULL)
00312             AfxThrowMemoryException();
00313     }
00314     CATCH_ALL(e) {
00315         TRACE0( "Out of memory creating a view.\n" );
00316         // Note: DELETE_EXCEPTION(e) not required
00317         return FALSE;
00318     }
00319     END_CATCH_ALL
00320
00321     ASSERT_KINDOF(CWnd, pWnd);
00322     ASSERT(pWnd->m_hWnd == NULL);       // not yet created
00323
00324     DWORD dwStyle = AFX_WS_DEFAULT_VIEW;
00325     CRect rect;
00326
00327     // Create with the right size and position
00328     if (!pWnd->Create(NULL, NULL, dwStyle, rect, this, 0, pContext))
00329     {
00330         TRACE0( "Warning: couldn't create client pane for view.\n" );
00331         // pWnd will be cleaned up by PostNcDestroy
00332         return FALSE;
00333     }
00334     m_pActiveView = (CView*) pWnd;
00335
00336     CTV_ITEM* pMember = new CTV_ITEM;
00337
00338     pMember->pWnd = pWnd;
00339
00340     _tcscpy( pMember->szLabel, lpszLabel );
00341
00342     m_views.AddTail(pMember);
00343
00344     // ToolTip support for tabs.
00345     if((m_views.GetCount()-1)==0) {
00346         m_pToolTip->AddTool( m_pTabCtrl, lpszLabel,
00347             NULL, m_views.GetCount()-1 );
00348     }
00349     else {
00350         m_pToolTip->AddTool( m_pTabCtrl, lpszLabel,
00351             CRect(0,0,0,0), m_views.GetCount()-1 );
00352     }
00353
00354     int nViews = m_views.GetCount();
00355     if (nViews != 1) {
00356         pWnd->EnableWindow(FALSE);
00357         pWnd->ShowWindow(SW_HIDE);
00358     }
00359
00360     TC_ITEM tci;
00361     tci.mask = TCIF_TEXT | TCIF_IMAGE;
00362     tci.pszText = (LPTSTR)(LPCTSTR)lpszLabel;
00363     tci.iImage = nViews-1;
00364     m_pTabCtrl->InsertItem(nViews, &tci);
00365
00366     CRect rcChild;
00367     CalcViewRect(&rcChild);
00368     m_pActiveView->MoveWindow(rcChild);
00369
00370     return TRUE;
00371 }
00372
00373 // Used for tab change notifications
00374 void CCJTabView::OnSelchange(NMHDR* /*pNMHDR*/, LRESULT* pResult)
00375 {
00376     SetActiveView(m_pTabCtrl->GetCurSel());
00377
00378     *pResult = 0;
00379 }
00380
00381 int CCJTabView::OnCreate(LPCREATESTRUCT lpCreateStruct)
00382 {
00383     if (CCtrlView::OnCreate(lpCreateStruct) == -1)
00384         return -1;
00385
00386     ASSERT(m_pTabCtrl);         // Should already be constructed
00387
00389     // Fixed bug with set parent and modifystyle which would cause the
00390     // application to lock up. - Kevin [klussier@redcreek.com].
00392     m_pTabCtrl->SetParent(CWnd::FromHandle(lpCreateStruct->hwndParent));
00393     m_pTabCtrl->ModifyStyleEx(WS_EX_NOPARENTNOTIFY, 0);
00394
00395     // Get the log font.
00396     NONCLIENTMETRICS ncm;
00397     ncm.cbSize = sizeof(NONCLIENTMETRICS);
00398     VERIFY(::SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
00399         sizeof(NONCLIENTMETRICS), &ncm, 0));
00400     m_TabFont.CreateFontIndirect(&ncm.lfMessageFont);
00401     m_pTabCtrl->SetFont(&m_TabFont);
00402
00403 #ifdef _VC_VERSION_5
00404     m_pToolTip = m_pTabCtrl->GetTooltips();
00405     m_pTabCtrl->SetTooltips(m_pToolTip);
00406 #else
00407     m_pToolTip = m_pTabCtrl->GetToolTips();
00408     m_pTabCtrl->SetToolTips(m_pToolTip);
00409 #endif // _VC_VERSION_5
00410
00411     return 0;
00412 }
00413
00414 BOOL CCJTabView::OnEraseBkgnd(CDC* pDC)
00415 {
00416     CView *pView = GetActiveView();
00417     if ( pView )
00418     {
00419         // Exclude the embedded views
00420         // area from the erase - Andy
00421         CRect rectClient;
00422         pView->GetWindowRect( &rectClient );
00423         ScreenToClient( &rectClient );
00424         pDC->ExcludeClipRect( &rectClient );
00425     }
00426     return CCtrlView::OnEraseBkgnd(pDC);
00427 }
Generated on Sun Feb 24 01:21:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJToolBar.cpp Source File

WinCvs/CJLib/CJLibrary/CJToolBar.cpp

Go to the documentation of this file.
00001 // CJToolBar.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/CJLibrary/CJToolBar.cpp $
00011  *
00012  * $History: CJToolBar.cpp $
00013  *
00014  * *****************  Version 18  *****************
00015  * User: Kirk Stowell Date: 10/30/99   Time: 1:56p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Removed Invalidate() calls from OnWindowPosChanging(...) to eliminate
00018  * screen flicker.
00019  *
00020  * *****************  Version 17  *****************
00021  * User: Kirk Stowell Date: 10/26/99   Time: 10:51p
00022  * Updated in $/CodeJock/CJLibrary
00023  * Added CCJFontCombo to the list of controls that can be inserted into a
00024  * CCJToolBar.
00025  *
00026  * *****************  Version 16  *****************
00027  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00028  * Updated in $/CodeJock/CJLibrary
00029  * Fixed potential resource and memory leak problems.
00030  *
00031  * *****************  Version 15  *****************
00032  * User: Kirk Stowell Date: 9/13/99    Time: 5:45a
00033  * Updated in $/CodeJockey/CJLibrary
00034  * Fixed initialization bug (small).
00035  *
00036  * *****************  Version 14  *****************
00037  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00038  * Updated in $/CodeJockey/CJLibrary
00039  * Updated copyright and contact information.
00040  *
00041  * *****************  Version 13  *****************
00042  * User: Kirk Stowell Date: 8/30/99    Time: 12:06a
00043  * Updated in $/CodeJockey/CJLibrary
00044  * Added support for CCJComboBoxEx control.
00045  *
00046  * *****************  Version 12  *****************
00047  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00048  * Updated in $/CodeJockey/CJLibrary
00049  * Added Unicode compliance, thanks to Barry Burton for his help with
00050  * this.
00051  *
00052  *
00053  * *****************  Version 10  *****************
00054  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00055  * Updated in $/CodeJockey/CJLibrary
00056  *
00057  * *****************  Version 6  *****************
00058  * User: Kirk Stowell Date: 7/18/99    Time: 10:20p
00059  * Updated in $/CodeJockey/CJLibrary
00060  * Re-wrote toolbar class for vc5 compatibility. Added customization based
00061  * on the "Customizable toolbar" article by Doug Keith -
00062  * http://www.codeguru.com/toolbar/customizable_tb.shtml.
00063  *
00064  * Cleaned up inline functions, and import/export macro so that class will
00065  * be imported when linked to, and exported at compile time.
00066  *
00067  * *****************  Version 5  *****************
00068  * User: Kirk Stowell Date: 4/03/99    Time: 11:44p
00069  * Updated in $/CodeJockey/CJ60Lib
00070  * Added comments and cleaned up code.
00071  *
00072  * *****************  Version 4  *****************
00073  * User: Kirk Stowell Date: 3/13/99    Time: 11:43p
00074  * Updated in $/CodeJockey/CJ60Lib
00075  * Changed class to handle both Office and DevStudio style to toolbars. To
00076  * use Office toolbars, use the CreateEx() method, otherwise your toolbars
00077  * will look like DevStudio.
00078  *
00079  * *****************  Version 3  *****************
00080  * User: Kirk Stowell Date: 12/14/98   Time: 11:42p
00081  * Updated in $/CodeJockey/CJ60Lib
00082  * Changed class to derive from Paul DiLascia's CToolBar, this class
00083  * adds gripper and control insertion.
00084  *
00085  * *****************  Version 2  *****************
00086  * User: Kirk Stowell Date: 11/02/98   Time: 11:41p
00087  * Updated in $/CodeJockey/CJ60Lib
00088  * Fixed bug with DrawNoGripper() method - (Christian Skovdal Andersen).
00089  *
00090  * *****************  Version 1  *****************
00091  * User: Kirk Stowell Date: 10/17/98   Time: 11:41p
00092  * Created in $/CodeJockey/CJ60Lib
00093  * Initial re-write and release.
00094  *
00095  ***************************************************************************/
00097
00098 #include "stdafx.h"
00099 #include "CJToolBar.h"
00100 #include "CJFlatComboBox.h"
00101 #include "CJComboBoxEx.h"
00102 #include "CJFontCombo.h"
00103 #include "CJMenu.h"        // CCJMenu class declaration
00104
00105 #ifdef _DEBUG
00106 #define new DEBUG_NEW
00107 #undef THIS_FILE
00108 static char THIS_FILE[] = __FILE__;
00109 #endif
00110
00111 #define IDC_CUSTOMIZE_BAR   0xFF
00112
00113 /*
00114 DIBs use RGBQUAD format:
00115 0xbb 0xgg 0xrr 0x00
00116
00117   Reasonably efficient code to convert a COLORREF into an
00118   RGBQUAD is byte-order-dependent, so we need different
00119   code depending on the byte order we're targeting.
00120 */
00121 #define _RGB_TO_RGBQUAD(r,g,b)   (RGB(b,g,r))
00122 #define _CLR_TO_RGBQUAD(clr)     (RGB(GetBValue(clr), GetGValue(clr), GetRValue(clr)))
00123
00124 struct CJX_COLORMAP
00125 {
00126     // use DWORD instead of RGBQUAD so we can compare two RGBQUADs easily
00127     DWORD rgbqFrom;
00128     int iSysColorTo;
00129 };
00130
00131 const CJX_COLORMAP _sysColorMap[] =
00132 {
00133     // mapping from color in DIB to system color
00134     { _RGB_TO_RGBQUAD(0x00, 0x00, 0x00),  COLOR_BTNTEXT },       // black
00135     { _RGB_TO_RGBQUAD(0x80, 0x80, 0x80),  COLOR_BTNSHADOW },     // dark gray
00136     { _RGB_TO_RGBQUAD(0xC0, 0xC0, 0xC0),  COLOR_BTNFACE },       // bright gray
00137     { _RGB_TO_RGBQUAD(0xFF, 0xFF, 0xFF),  COLOR_BTNHIGHLIGHT }   // white
00138 };
00139
00140 HBITMAP AFXAPI
00141 _LoadSysColorBitmap(HINSTANCE hInst, HRSRC hRsrc, BOOL bMono)
00142 {
00143     HGLOBAL hglb;
00144     if ((hglb = LoadResource(hInst, hRsrc)) == NULL)
00145         return NULL;
00146
00147     LPBITMAPINFOHEADER lpBitmap = (LPBITMAPINFOHEADER)LockResource(hglb);
00148     if (lpBitmap == NULL)
00149         return NULL;
00150
00151     // make copy of BITMAPINFOHEADER so we can modify the color table
00152     const int nColorTableSize = 16;
00153     UINT nSize = lpBitmap->biSize + nColorTableSize * sizeof(RGBQUAD);
00154     LPBITMAPINFOHEADER lpBitmapInfo = (LPBITMAPINFOHEADER)::malloc(nSize);
00155     if (lpBitmapInfo == NULL)
00156         return NULL;
00157     memcpy(lpBitmapInfo, lpBitmap, nSize);
00158
00159     // color table is in RGBQUAD DIB format
00160     DWORD* pColorTable =
00161         (DWORD*)(((LPBYTE)lpBitmapInfo) + (UINT)lpBitmapInfo->biSize);
00162
00163     for (int iColor = 0; iColor < nColorTableSize; iColor++)
00164     {
00165         // look for matching RGBQUAD color in original
00166         for (int i = 0; i < _countof(_sysColorMap); i++)
00167         {
00168             if (pColorTable[iColor] == _sysColorMap[i].rgbqFrom)
00169             {
00170                 if (bMono)
00171                 {
00172                     // all colors except text become white
00173                     if (_sysColorMap[i].iSysColorTo != COLOR_BTNTEXT)
00174                         pColorTable[iColor] = _RGB_TO_RGBQUAD(255, 255, 255);
00175                 }
00176                 else
00177                     pColorTable[iColor] =
00178                     _CLR_TO_RGBQUAD(::GetSysColor(_sysColorMap[i].iSysColorTo));
00179                 break;
00180             }
00181         }
00182     }
00183
00184     int nWidth = (int)lpBitmapInfo->biWidth;
00185     int nHeight = (int)lpBitmapInfo->biHeight;
00186     HDC hDCScreen = ::GetDC(NULL);
00187     HBITMAP hbm = ::CreateCompatibleBitmap(hDCScreen, nWidth, nHeight);
00188
00189     if (hbm != NULL)
00190     {
00191         HDC hDCGlyphs = ::CreateCompatibleDC(hDCScreen);
00192         HBITMAP hbmOld = (HBITMAP)::SelectObject(hDCGlyphs, hbm);
00193
00194         LPBYTE lpBits;
00195         lpBits = (LPBYTE)(lpBitmap + 1);
00196         lpBits += (1 << (lpBitmapInfo->biBitCount)) * sizeof(RGBQUAD);
00197
00198         StretchDIBits(hDCGlyphs, 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight,
00199             lpBits, (LPBITMAPINFO)lpBitmapInfo, DIB_RGB_COLORS, SRCCOPY);
00200         SelectObject(hDCGlyphs, hbmOld);
00201         ::DeleteDC(hDCGlyphs);
00202     }
00203     ::ReleaseDC(NULL, hDCScreen);
00204
00205     // free copy of bitmap info struct and resource itself
00206     ::free(lpBitmapInfo);
00207     ::FreeResource(hglb);
00208
00209     return hbm;
00210 }
00211
00212 #ifdef AFX_INIT_SEG
00213 #pragma code_seg(AFX_INIT_SEG)
00214 #endif
00215
00216 struct AFX_DLLVERSIONINFO
00217 {
00218     DWORD cbSize;
00219     DWORD dwMajorVersion;                   // Major version
00220     DWORD dwMinorVersion;                   // Minor version
00221     DWORD dwBuildNumber;                    // Build number
00222     DWORD dwPlatformID;                     // DLLVER_PLATFORM_*
00223 };
00224
00225 typedef HRESULT (CALLBACK* AFX_DLLGETVERSIONPROC)(AFX_DLLVERSIONINFO *);
00226
00227 int _ComCtlVersion = -1;
00228
00229 DWORD AFXAPI _GetComCtlVersion()
00230 {
00231     // return cached version if already determined...
00232     if (_ComCtlVersion != -1)
00233         return _ComCtlVersion;
00234
00235     // otherwise determine comctl32.dll version via DllGetVersion
00236     HINSTANCE hInst = ::GetModuleHandleA("COMCTL32.DLL");
00237     ASSERT(hInst != NULL);
00238     AFX_DLLGETVERSIONPROC pfn;
00239     pfn = (AFX_DLLGETVERSIONPROC)GetProcAddress(hInst, "DllGetVersion");
00240     DWORD dwVersion = VERSION_WIN4;
00241     if (pfn != NULL)
00242     {
00243         AFX_DLLVERSIONINFO dvi;
00244         memset(&dvi, 0, sizeof(dvi));
00245         dvi.cbSize = sizeof(dvi);
00246         HRESULT hr = (*pfn)(&dvi);
00247         if (SUCCEEDED(hr))
00248         {
00249             ASSERT(dvi.dwMajorVersion <= 0xFFFF);
00250             ASSERT(dvi.dwMinorVersion <= 0xFFFF);
00251             dwVersion = MAKELONG(dvi.dwMinorVersion, dvi.dwMajorVersion);
00252         }
00253     }
00254     _ComCtlVersion = dwVersion;
00255     return dwVersion;
00256 }
00257
00258 struct CJX_CONTROLPOS {
00259     int             nIndex;
00260     int             nID;
00261     CRect           rectOldPos;
00262 } ;
00263
00264 int _dropDownWidth = -1;
00265
00266 int AFXAPI _GetDropDownWidth()
00267 {
00268     // return cached version if already determined...
00269     if (_dropDownWidth != -1)
00270         return _dropDownWidth;
00271
00272     // otherwise calculate it...
00273     HDC hDC = GetDC(NULL);
00274     ASSERT(hDC != NULL);
00275     HFONT hFont;
00276     if ((hFont = ::CreateFont(GetSystemMetrics(SM_CYMENUCHECK), 0, 0, 0,
00277         FW_NORMAL, 0, 0, 0, SYMBOL_CHARSET, 0, 0, 0, 0, _T("Marlett"))) != NULL)
00278     {
00279         HFONT hOldFont = (HFONT)::SelectObject(hDC, hFont);
00280
00281         VERIFY(GetCharWidth(hDC, '6', '6', &_dropDownWidth));
00282
00283         // fix potential resource leak - KStowell - 10-21-99
00284         if (hFont != NULL) {
00285             ::SelectObject(hDC, hOldFont);
00286             ::DeleteObject(hFont);
00287         }
00288     }
00289
00290     ::ReleaseDC(NULL, hDC);
00291     ASSERT(_dropDownWidth != -1);
00292     return _dropDownWidth;
00293 }
00294
00296 // CCJToolBar
00297
00298 int CCJToolBar::m_nBarNumber = 0;
00299
00300 CCJToolBar::CCJToolBar()
00301 {
00302     m_bShowDropArrow = false;
00303     m_pControls      = NULL;
00304     m_pDropButtons   = NULL;        // list of drop-down buttons
00305     m_nButtons       = 0;
00306     m_pBarInfo       = NULL;
00307     m_hKeyRoot       = HKEY_CURRENT_USER;
00308
00309     // get a pointer to the application.
00310     CWinApp* pApp = AfxGetApp();
00311     ASSERT( pApp );
00312
00313     ++m_nBarNumber;
00314     m_strValueName.Format( _T("CJToolBar %d"), m_nBarNumber );
00315     m_strSubKey.Format( _T("Software\\%s\\%s\\Settings"),
00316         pApp->m_pszRegistryKey, pApp->m_pszProfileName );
00317
00318     // initialize state
00319     m_pStringMap = NULL;
00320     m_hRsrcImageWell = NULL;
00321     m_hInstImageWell = NULL;
00322     m_hbmImageWell = NULL;
00323     m_bDelayedButtonLayout = TRUE;
00324
00325     // default image sizes
00326     m_sizeImage.cx = 16;
00327     m_sizeImage.cy = 15;
00328
00329     // default button sizes
00330     m_sizeButton.cx = 23;
00331     m_sizeButton.cy = 22;
00332
00333     // top and bottom borders are 1 larger than default for ease of grabbing
00334     m_cyTopBorder = 3;
00335     m_cyBottomBorder = 3;
00336     m_bExStyle = false;
00337 }
00338
00339 CCJToolBar::~CCJToolBar()
00340 {
00341     AfxDeleteObject((HGDIOBJ*)&m_hbmImageWell);
00342     delete m_pStringMap;
00343
00344     m_nCount = 0;
00345
00346     while (m_pDropButtons)
00347     {
00348         DROPDOWNBUTTON* pnext = m_pDropButtons->next;
00349         delete m_pDropButtons;
00350         m_pDropButtons = pnext;
00351     }
00352
00353     if( m_pControls ) {
00354         for( POSITION pos = m_pControls->GetHeadPosition() ; pos ; ) {
00355             delete m_pControls->GetNext(pos);
00356         }
00357         delete m_pControls;
00358     }
00359 }
00360
00361 BOOL CCJToolBar::Create(CWnd* pParentWnd, DWORD dwStyle, UINT nID)
00362 {
00363     return CreateEx(pParentWnd, NULL, dwStyle,
00364         CRect(m_cxLeftBorder, m_cyTopBorder, m_cxRightBorder, m_cyBottomBorder), nID);
00365 }
00366
00367 BOOL CCJToolBar::CreateEx(CWnd* pParentWnd, DWORD dwCtrlStyle, DWORD dwStyle, CRect rcBorders, UINT nID)
00368 {
00369     ASSERT_VALID(pParentWnd);   // must have a parent
00370     ASSERT (!((dwStyle & CBRS_SIZE_FIXED) && (dwStyle & CBRS_SIZE_DYNAMIC)));
00371
00372     // KStowell - bool for drawing office style gripper.
00373     if( dwCtrlStyle != NULL )
00374         m_bExStyle = true;
00375
00376     SetBorders(rcBorders);
00377
00378     // save the style
00379     m_dwStyle = (dwStyle & CBRS_ALL)|( dwStyle & CBRS_GRIPPER );
00380     if (nID == AFX_IDW_TOOLBAR)
00381         m_dwStyle |= CBRS_HIDE_INPLACE;
00382
00383     dwStyle &= ~CBRS_ALL;
00384     dwStyle |= CCS_NOPARENTALIGN|CCS_NOMOVEY|CCS_NODIVIDER|CCS_NORESIZE;
00385     dwStyle |= dwCtrlStyle;
00386
00387     // initialize common controls
00388
00389 #ifdef _VC_VERSION_5
00390
00391     INITCOMMONCONTROLSEX icex;
00392     icex.dwSize = sizeof(icex);
00393     icex.dwICC = ICC_BAR_CLASSES;
00394     VERIFY(InitCommonControlsEx(&icex));
00395
00396 #else
00397
00398     VERIFY(AfxDeferRegisterClass(AFX_WNDCOMMCTL_BAR_REG));
00399
00400 #endif
00401
00402     _GetComCtlVersion();
00403     ASSERT(_ComCtlVersion != -1);
00404     _GetDropDownWidth();
00405     ASSERT(_dropDownWidth != -1);
00406
00407     // create the HWND
00408     CRect rect; rect.SetRectEmpty();
00409     if (!CWnd::Create(TOOLBARCLASSNAME, NULL, dwStyle, rect, pParentWnd, nID))
00410         return FALSE;
00411
00412     // sync up the sizes
00413     SetSizes(m_sizeButton, m_sizeImage);
00414
00415     // Note: Parent must resize itself for control bar to be resized
00416
00417     return TRUE;
00418 }
00419
00420 BOOL CCJToolBar::PreCreateWindow(CREATESTRUCT& cs)
00421 {
00422     if( !CCJToolBarBase::PreCreateWindow(cs))
00423         return FALSE;
00424
00425     cs.style |= TBSTYLE_TRANSPARENT|TBSTYLE_FLAT;
00426
00427     return TRUE;
00428 }
00429
00431 // 1999 Kirk Stowell - Inserts a control into the toolbar at the given button id.
00432 //
00433 CWnd* CCJToolBar::InsertControl( CRuntimeClass* pClass, LPCTSTR lpszWindowName, CRect& rect, UINT nID, DWORD dwStyle )
00434 {
00435     CWnd *pCtrl = NULL;
00436
00437     if( pClass->IsDerivedFrom( RUNTIME_CLASS( CCJComboBoxEx ))) // CCJComboBoxEx control.
00438     {
00439         pCtrl = new CCJComboBoxEx;
00440
00441         ASSERT_VALID( pCtrl );
00442
00443         if(((CCJComboBoxEx*)pCtrl)->Create( WS_CHILD|WS_VISIBLE|dwStyle, rect, this, nID ) == FALSE )
00444         {
00445             delete pCtrl;
00446             return NULL;
00447         }
00448     }
00449     else if( pClass->IsDerivedFrom( RUNTIME_CLASS( CCJFlatComboBox )))  // CCJFlatComboBox control.
00450     {
00451         pCtrl = new CCJFlatComboBox;
00452
00453         ASSERT_VALID( pCtrl );
00454
00455         if(((CCJFlatComboBox*)pCtrl)->Create( WS_CHILD|WS_VISIBLE|dwStyle, rect, this, nID ) == FALSE )
00456         {
00457             delete pCtrl;
00458             return NULL;
00459         }
00460     }
00461     else if( pClass->IsDerivedFrom( RUNTIME_CLASS( CCJFontCombo ))) // CCJFontCombo control.
00462     {
00463         pCtrl = new CCJFontCombo;
00464
00465         ASSERT_VALID( pCtrl );
00466
00467         if(((CCJFontCombo*)pCtrl)->Create( WS_CHILD|WS_VISIBLE|dwStyle, rect, this, nID ) == FALSE )
00468         {
00469             delete pCtrl;
00470             return NULL;
00471         }
00472     }
00473     else if( pClass->IsDerivedFrom( RUNTIME_CLASS( CComboBox )))    // CComboBox control.
00474     {
00475         pCtrl = new CComboBox;
00476
00477         ASSERT_VALID( pCtrl );
00478
00479         if(((CComboBox*)pCtrl)->Create( WS_CHILD|WS_VISIBLE|dwStyle, rect, this, nID ) == FALSE )
00480         {
00481             delete pCtrl;
00482             return NULL;
00483         }
00484     }
00485     else if( pClass->IsDerivedFrom( RUNTIME_CLASS( CEdit )))        // CEdit control.
00486     {
00487         pCtrl = new CEdit;
00488
00489         ASSERT_VALID( pCtrl );
00490
00491         if(((CEdit*)pCtrl)->Create( WS_CHILD|WS_VISIBLE|dwStyle, rect, this, nID ) == FALSE )
00492         {
00493             delete pCtrl;
00494             return NULL;
00495         }
00496     }
00497     else if( pClass->IsDerivedFrom( RUNTIME_CLASS( CButton )))      // CButton control.
00498     {
00499         pCtrl = new CButton;
00500
00501         ASSERT_VALID( pCtrl );
00502
00503         if(((CButton*)pCtrl)->Create( lpszWindowName, WS_CHILD|WS_VISIBLE|dwStyle, rect, this, nID ) == FALSE )
00504         {
00505             delete pCtrl;
00506             return NULL;
00507         }
00508     }
00509     else if( pClass->IsDerivedFrom( RUNTIME_CLASS( CWnd )))         // CWnd object.
00510     {
00511         pCtrl = new CWnd;
00512
00513         ASSERT_VALID( pCtrl );
00514
00515 #ifdef _UNICODE
00516         TCHAR szClassName[ 256 ];
00517
00518         MultiByteToWideChar( CP_ACP,
00519                              MB_PRECOMPOSED,
00520                              pClass->m_lpszClassName,
00521                              -1,
00522                              szClassName,
00523                              255 );
00524
00525         if(((CWnd*)pCtrl)->Create( szClassName, lpszWindowName, WS_CHILD|WS_VISIBLE|dwStyle, rect, this, nID ) == FALSE )
00526         {
00527             delete pCtrl;
00528             return NULL;
00529         }
00530 #else
00531         if(((CWnd*)pCtrl)->Create( pClass->m_lpszClassName, lpszWindowName, WS_CHILD|WS_VISIBLE|dwStyle, rect, this, nID ) == FALSE )
00532         {
00533             delete pCtrl;
00534             return NULL;
00535         }
00536 #endif
00537     }
00538     else                                                            // An invalid object was passed in
00539     {
00540         ASSERT( FALSE );
00541         return NULL;
00542     }
00543
00544     // if our object list has not been allocated, do it now...
00545     if( m_pControls == NULL )
00546     {
00547         m_pControls = new CObList();
00548         ASSERT( m_pControls );
00549     }
00550
00551     // we have to remember this control, so we can delete it later
00552     m_pControls->AddTail( pCtrl );
00553
00554     return InsertControl( pCtrl, rect, nID );
00555 }
00556
00557 CWnd* CCJToolBar::InsertControl(CWnd* pCtrl, CRect & rect, UINT nID)
00558 {
00559     ASSERT_VALID( pCtrl );
00560
00561     // make sure the id is valid, and set the button
00562     // style for a seperator.
00563     ASSERT( CommandToIndex( nID ) >= 0 );
00564     SetButtonInfo( CommandToIndex( nID ), nID, TBBS_SEPARATOR, rect.Width());
00565
00566     // insert the control into the toolbar.
00567     GetItemRect( CommandToIndex(nID), &rect );
00568     pCtrl->SetWindowPos(0, rect.left, rect.top, 0, 0,
00569         SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOCOPYBITS );
00570     pCtrl->SetFont( GetFont( ));
00571     pCtrl->ShowWindow( SW_SHOW );
00572
00573     return pCtrl;
00574 }
00575
00577 // 1997 Microsoft Systems Journal - Written by Paul DiLascia.
00578 // call to add drop-down menus to toolbar buttons.
00579 //
00580 BOOL CCJToolBar::AddDropDownButton(UINT nIDButton, UINT nIDMenu, BOOL bArrow)
00581 {
00582     ASSERT_VALID(this);
00583
00584     DROPDOWNBUTTON* pb = FindDropDownButton(nIDButton);
00585     if (!pb) {
00586         pb = new DROPDOWNBUTTON;
00587         ASSERT(pb);
00588         pb->next = m_pDropButtons;
00589         m_pDropButtons = pb;
00590     }
00591     pb->idButton = nIDButton;
00592     pb->idMenu   = nIDMenu;
00593
00594     int iButton = CommandToIndex(nIDButton);
00595
00596     DWORD dwStyle = GetButtonStyle(iButton);
00597     dwStyle |= TBSTYLE_DROPDOWN;
00598     SetButtonStyle(iButton, dwStyle);
00599
00600     if (bArrow)
00601         SetExtendedStyle(TBSTYLE_EX_DRAWDDARROWS);
00602
00603     return TRUE;
00604 }
00605
00607 // 1997 Microsoft Systems Journal - Written by Paul DiLascia.
00608 // Find buttons structure for given ID
00609 //
00610 DROPDOWNBUTTON* CCJToolBar::FindDropDownButton(UINT nID)
00611 {
00612     for (DROPDOWNBUTTON* pb = m_pDropButtons; pb; pb = pb->next) {
00613         if (pb->idButton == nID)
00614             return pb;
00615     }
00616     return NULL;
00617 }
00618
00620 // 1997 Microsoft Systems Journal - Written by Paul DiLascia.
00621 // Message handler for TBN_DROPDOWN. Default is to display the
00622 // specified menu at the right place. You can override to generate dynamic menus
00623 //
00624 // Args:
00625 //      - NMTOOLBAR struct from TBN_DROPDOWN
00626 //      - command id of button
00627 //      - point to display menu at
00628 //
00629 void CCJToolBar::OnToolBarBtnDropDown(NMHDR* pNMHDR, LRESULT* pRes)
00630 {
00631     UNUSED_ALWAYS( pRes );
00632
00633     const NMTOOLBAR& nmtb = *(NMTOOLBAR*)pNMHDR;
00634
00635     // get location of button
00636     CRect rc;
00637     GetRect(nmtb.iItem, rc);
00638     ClientToScreen(&rc);
00639
00640     // call virtual function to display dropdown menu
00641     OnDropDownButton(nmtb, nmtb.iItem, rc);
00642 }
00643
00645 // 1997 Microsoft Systems Journal - Written by Paul DiLascia.
00646 // Virtual fn you can override to hand drop-down button
00647 // events with more friendly args
00648 //
00649 void CCJToolBar::OnDropDownButton(const NMTOOLBAR& nmtb, UINT nID, CRect rc)
00650 {
00651     UNUSED_ALWAYS( nID );
00652
00653     DROPDOWNBUTTON* pb = FindDropDownButton(nmtb.iItem);
00654     if (pb && pb->idMenu) {
00655
00656         // load and display popup menu
00657         CCJMenu menu;
00658         VERIFY(menu.LoadMenu(pb->idMenu));
00659         CCJMenu* pPopup = (CCJMenu*)menu.GetSubMenu(0);
00660         ASSERT(pPopup);
00661         pPopup->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_VERTICAL,
00662             rc.left, rc.bottom, GetParentFrame(), &rc);
00663     }
00664 }
00665
00667 // 1997 Microsoft Systems Journal - Written by Paul DiLascia.
00668 // Now toolbar has really moved: repaint area beneath old position
00669 //
00670 void CCJToolBar::OnWindowPosChanged(WINDOWPOS* lpwndpos)
00671 {
00672     CCJToolBarBase::OnWindowPosChanged(lpwndpos);
00673     if (!(lpwndpos->flags & SWP_NOMOVE)) {   // if moved:
00674         InvalidateOldPos(m_rcOldPos);        // invalidate area of old position
00675
00676         // Now paint my non-client area at the new location.
00677         // Without this, you will still have a partial display bug (try it!)
00678         SendMessage(WM_NCPAINT);
00679     }
00680 }
00681
00683 // 1997 Microsoft Systems Journal - Written by Paul DiLascia.
00684 // Invalidate toolbar rectangle. Because flat toolbars are transparent,
00685 // this requires invalidating parent and all siblings that intersect the
00686 // rectangle.
00687 //
00688 void CCJToolBar::InvalidateOldPos(const CRect& rcInvalid)
00689 {
00690     // make parent paint the area beneath rectangle
00691     CWnd* pParent = GetParent();        // parent (dock bar/frame) window
00692     ASSERT_VALID(pParent);              // check
00693     CRect rc( rcInvalid );              // copy rectangle
00694     pParent->ScreenToClient(&rc);       // convert to parent client coords
00695     pParent->InvalidateRect(&rc);       // invalidate
00696
00697     // now do same for each sibling too
00698     for (CWnd* pSib = pParent->GetWindow(GW_CHILD);
00699           pSib;
00700           pSib=pSib->GetNextWindow(GW_HWNDNEXT)) {
00701
00702         CRect rc;                                       // window rect of sibling
00703         pSib->GetWindowRect(&rc);                   // ...
00704         if (rc.IntersectRect(rc, rcInvalid)) {  // if intersects invalid rect
00705             pSib->ScreenToClient(&rc);              // convert to sibling coords
00706             pSib->InvalidateRect(&rc);              // invalidate
00707             pSib->SendMessage(WM_NCPAINT);      // nonclient area too!
00708         }
00709     }
00710 }
00711
00713 // 1997 Microsoft Systems Journal - Written by Paul DiLascia.
00714 // This is the all-important function that gets the true size of a button,
00715 // instead of using m_sizeButton. And it's virtual, so you can override if
00716 // my algorithm doesn't work, as will surely be the case in some circumstances.
00717 //
00718 CSize CCJToolBar::GetButtonSize(TBBUTTON* pData, int iButton)
00719 {
00720     ASSERT(_ComCtlVersion > 0);
00721
00722     // Get the actual size of the button, not what's in m_sizeButton.
00723     // Make sure to do SendMessage instead of calling MFC's GetItemRect,
00724     // which has all sorts of bad side-effects! (Go ahead, take a look at it.)
00725     //
00726     CRect rc;
00727     SendMessage(TB_GETITEMRECT, iButton, (LPARAM)&rc);
00728     CSize sz = rc.Size();
00729
00731     // Now must do special case for various versions of comctl32.dll,
00732     //
00733     DWORD dwStyle = pData[iButton].fsStyle;
00734     if ((pData[iButton].fsState & TBSTATE_WRAP)) {
00735         if (dwStyle & TBSTYLE_SEP) {
00736             // this is the last separator in the row (eg vertically docked)
00737             // fudge the height, and ignore the width. TB_GETITEMRECT will return
00738             // size = (8 x 22) even for a separator in vertical toolbar
00739             //
00740             if (_ComCtlVersion <= VERSION_IE3)
00741                 sz.cy -= 3;     // empircally good fudge factor
00742             else if (_ComCtlVersion != VERSION_IE4)
00743                 sz.cy = sz.cx;
00744             sz.cx = 0;          // separator takes no width if it's the last one
00745
00746         } else if (dwStyle & TBSTYLE_DROPDOWN && ( m_bShowDropArrow == false )) {
00747             // ignore width of dropdown
00748             sz.cx = 0;
00749         }
00750     }
00751     return sz;
00752 }
00753
00754 // This function saves the state (visible buttons, toolbar position, etc.)
00755 // of the toolbar, using the registry key provided to the Create(...) function.
00756 void CCJToolBar::SaveState()
00757 {
00758     // if there is an associated registry subkey
00759     if (m_strSubKey.GetLength())
00760     {
00761         // save the toolbar state to the registry
00762         GetToolBarCtrl().SaveState( m_hKeyRoot, m_strSubKey, m_strValueName );
00763     }
00764 }
00765
00766 // This function restores the state (visible buttons, toolbar position, etc.)
00767 // of the toolbar, using the registry key provided to the Create(...) function.
00768 void CCJToolBar::RestoreState()
00769 {
00770     // if there is an associated registry subkey
00771     if (m_strSubKey.GetLength())
00772     {
00773         // restore the toolbar state from the registry
00774         GetToolBarCtrl().RestoreState( m_hKeyRoot, m_strSubKey, m_strValueName );
00775     }
00776 }
00777
00778 // This function is called when the user begins dragging a toolbar
00779 // button or when the customization dialog is being populated with
00780 // toolbar information.  Basically, *pResult should be populated with
00781 // your answer to the question, "is the user allowed to delete this
00782 // button?".
00783 void CCJToolBar::OnToolBarQueryDelete(NMHDR *pNMHDR, LRESULT *pResult)
00784 {
00785     UNUSED_ALWAYS( pNMHDR );
00786
00787     // if we're not floating - user can delete anything
00788     *pResult = !IsFloating();
00789 }
00790
00791 // This function is called when the user begins dragging a toolbar
00792 // button or when the customization dialog is being populated with
00793 // toolbar information.  Basically, *pResult should be populated with
00794 // your answer to the question, "is the user allowed to insert a
00795 // button to the left of this one?".
00796 void CCJToolBar::OnToolBarQueryInsert(NMHDR *pNMHDR, LRESULT *pResult)
00797 {
00798     UNUSED_ALWAYS( pNMHDR );
00799
00800     // if we're not floating - user can insert anywhere
00801     *pResult = !IsFloating();
00802 }
00803
00804 // This function is called whenever the user makes a change to the
00805 // layout of the toolbar.  Calling the mainframe's RecalcLayout forces
00806 // the toolbar to repaint itself.
00807 void CCJToolBar::OnToolBarChange(NMHDR *pNMHDR, LRESULT *pResult)
00808 {
00809     UNUSED_ALWAYS( pNMHDR );
00810     UNUSED_ALWAYS( pResult );
00811
00812     // force the frame window to recalculate the size
00813     GetParentFrame()->RecalcLayout();
00814 }
00815
00816 // This function is called when the user begins dragging a toolbar button.
00817 void CCJToolBar::OnToolBarBeginDrag(NMHDR *pNMHDR, LRESULT *pResult)
00818 {
00819     UNUSED_ALWAYS( pNMHDR );
00820     UNUSED_ALWAYS( pResult );
00821 }
00822
00823 // This function is called when the user has completed a dragging operation.
00824 void CCJToolBar::OnToolBarEndDrag(NMHDR *pNMHDR, LRESULT *pResult)
00825 {
00826     UNUSED_ALWAYS( pNMHDR );
00827     UNUSED_ALWAYS( pResult );
00828 }
00829
00830 // This function is called when the user initially calls up the toolbar
00831 // customization dialog box.
00832 void CCJToolBar::OnToolBarBeginAdjust(NMHDR *pNMHDR, LRESULT *pResult)
00833 {
00834     UNUSED_ALWAYS( pNMHDR );
00835     UNUSED_ALWAYS( pResult );
00836 }
00837
00838 // This function is called when the user clicks on the help button on the
00839 // toolbar customization dialog box.
00840 void CCJToolBar::OnToolBarCustomHelp(NMHDR *pNMHDR, LRESULT *pResult)
00841 {
00842     UNUSED_ALWAYS( pNMHDR );
00843     UNUSED_ALWAYS( pResult );
00844 }
00845
00846 // This function is called when the user dismisses the toolbar customization
00847 // dialog box.
00848 void CCJToolBar::OnToolBarEndAdjust(NMHDR *pNMHDR, LRESULT *pResult)
00849 {
00850     UNUSED_ALWAYS( pNMHDR );
00851     UNUSED_ALWAYS( pResult );
00852
00853     // save the state of the toolbar for reinitialization
00854     SaveState();
00855 }
00856
00857 // This function is called to populate the toolbar customization dialog box
00858 // with information regarding all of the possible toolbar buttons.
00859 void CCJToolBar::OnToolBarGetButtonInfo(NMHDR *pNMHDR, LRESULT *pResult)
00860 {
00861     UNUSED_ALWAYS( pResult );
00862
00863     TBNOTIFY* tbStruct;     // data needed by customize dialog box
00864
00865     // init the pointer
00866     tbStruct = (TBNOTIFY *)pNMHDR;
00867
00868     // if the index is valid
00869     if (0 <= tbStruct->iItem && tbStruct->iItem < m_nButtons)
00870     {
00871         // copy the stored button structure
00872         tbStruct->tbButton = m_pBarInfo[tbStruct->iItem].tbButton;
00873
00874         // copy the text for the button label in the dialog
00875         _tcscpy( tbStruct->pszText, m_pBarInfo[tbStruct->iItem].btnText );
00876
00877         // indicate valid data was sent
00878         *pResult = TRUE;
00879     }
00880
00881     // else there is no button for this index
00882     else
00883     {
00884         *pResult = FALSE;
00885     }
00886 }
00887
00888 // This function is called when the user clicks on the reset button on the
00889 // toolbar customization dialog box.
00890 void CCJToolBar::OnToolBarReset(NMHDR *pNMHDR, LRESULT *pResult)
00891 {
00892     UNUSED_ALWAYS( pNMHDR );
00893     UNUSED_ALWAYS( pResult );
00894
00895     // restore the toolbar to the way it was before entering customization
00896     RestoreState();
00897 }
00898
00899 void CCJToolBar::OnDestroy()
00900 {
00901     // save the current state of the toolbar
00902     SaveState();
00903
00904     CCJToolBarBase::OnDestroy();
00905 }
00906
00907 void CCJToolBar::OnRButtonDown(UINT nFlags, CPoint point)
00908 {
00909     if( m_pBarInfo )
00910     {
00911         CPoint pt( point );
00912         ClientToScreen( &pt );
00913
00914         // load and display popup menu
00915         CCJMenu popupMenu;
00916         VERIFY(popupMenu.CreatePopupMenu( ));
00917         popupMenu.InsertMenu(0, MF_BYPOSITION, IDC_CUSTOMIZE_BAR, _T("&Customize..."));
00918         int nResult = popupMenu.TrackPopupMenu(
00919             TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_VERTICAL|TPM_RETURNCMD,
00920             pt.x, pt.y, this );
00921
00922         if( nResult == IDC_CUSTOMIZE_BAR )
00923         {
00924             // open the customization dialog.
00925             GetToolBarCtrl().Customize();
00926         }
00927     }
00928
00929     else {
00930         CCJToolBarBase::OnRButtonDown(nFlags, point);
00931     }
00932 }
00933
00935 // The remainder of this class is mostly copied straight from MFC ( vc6 ),
00936 // except for the modifications which are commented...
00938
00940 // CCJToolBar
00941
00942 BOOL CCJToolBar::OnNcCreate(LPCREATESTRUCT lpCreateStruct)
00943 {
00944     // If the toolbar is inside a ReBar, we need to make the parent frame
00945     // the owner so it will get notifications.
00946     CWnd* pParent = GetParent();
00947     ASSERT(pParent);
00948     TCHAR classname[64];
00949     GetClassName(pParent->m_hWnd, classname, _countof(classname));
00950     if (_tcscmp(classname, REBARCLASSNAME)==0)
00951     {
00952         CFrameWnd* pFrame = GetParentFrame();
00953         ASSERT_VALID(pFrame);
00954         SetOwner(pFrame);
00955         m_bInReBar = true;
00956         m_bExStyle = false;
00957     }
00958
00959     if (!CCJToolBarBase::OnNcCreate(lpCreateStruct))
00960         return FALSE;
00961
00962     // if the owner was set before the toolbar was created, set it now
00963     if (m_hWndOwner != NULL)
00964         DefWindowProc(TB_SETPARENT, (WPARAM)m_hWndOwner, 0);
00965
00966     DefWindowProc(TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
00967     return TRUE;
00968 }
00969
00970 void CCJToolBar::SetOwner(CWnd* pOwnerWnd)
00971 {
00972     ASSERT_VALID(this);
00973     if (m_hWnd != NULL)
00974     {
00975         ASSERT(::IsWindow(m_hWnd));
00976         DefWindowProc(TB_SETPARENT, (WPARAM)pOwnerWnd->GetSafeHwnd(), 0);
00977     }
00978     CCJToolBarBase::SetOwner(pOwnerWnd);
00979 }
00980
00981 void CCJToolBar::SetSizes(SIZE sizeButton, SIZE sizeImage)
00982 {
00983     ASSERT_VALID(this);
00984
00985     // sizes must be non-zero and positive
00986     ASSERT(sizeButton.cx > 0 && sizeButton.cy > 0);
00987     ASSERT(sizeImage.cx > 0 && sizeImage.cy > 0);
00988
00989     // button must be big enough to hold image
00990     //   + 7 pixels on x
00991     //   + 6 pixels on y
00992     ASSERT(sizeButton.cx >= sizeImage.cx + 7);
00993     ASSERT(sizeButton.cy >= sizeImage.cy + 6);
00994
00995     if (::IsWindow(m_hWnd))
00996     {
00997         // set the sizes via TB_SETBITMAPSIZE and TB_SETBUTTONSIZE
00998         VERIFY(SendMessage(TB_SETBITMAPSIZE, 0, MAKELONG(sizeImage.cx, sizeImage.cy)));
00999         VERIFY(SendMessage(TB_SETBUTTONSIZE, 0, MAKELONG(sizeButton.cx, sizeButton.cy)));
01000
01001         Invalidate();   // just to be nice if called when toolbar is visible
01002     }
01003     else
01004     {
01005         // just set our internal values for later
01006         m_sizeButton = sizeButton;
01007         m_sizeImage = sizeImage;
01008     }
01009 }
01010
01011 void CCJToolBar::SetHeight(int cyHeight)
01012 {
01013     ASSERT_VALID(this);
01014
01015     int nHeight = cyHeight;
01016     if (m_dwStyle & CBRS_BORDER_TOP)
01017         cyHeight -= afxData.cyBorder2;
01018     if (m_dwStyle & CBRS_BORDER_BOTTOM)
01019         cyHeight -= afxData.cyBorder2;
01020     m_cyBottomBorder = (cyHeight - m_sizeButton.cy) / 2;
01021     // if there is an extra pixel, m_cyTopBorder will get it
01022     m_cyTopBorder = cyHeight - m_sizeButton.cy - m_cyBottomBorder;
01023     if (m_cyTopBorder < 0)
01024     {
01025         TRACE1("Warning: CCJToolBar::SetHeight(%d) is smaller than button.\n",
01026             nHeight);
01027         m_cyBottomBorder += m_cyTopBorder;
01028         m_cyTopBorder = 0;  // will clip at bottom
01029     }
01030
01031     // recalculate the non-client region
01032     SetWindowPos(NULL, 0, 0, 0, 0,
01033         SWP_DRAWFRAME|SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|SWP_NOZORDER);
01034     Invalidate();   // just to be nice if called when toolbar is visible
01035 }
01036
01037 struct CToolBarData
01038 {
01039     WORD wVersion;
01040     WORD wWidth;
01041     WORD wHeight;
01042     WORD wItemCount;
01043     //WORD aItems[wItemCount]
01044
01045     WORD* items()
01046         { return (WORD*)(this+1); }
01047 };
01048
01049 BOOL CCJToolBar::LoadToolBar(LPCTSTR lpszResourceName, TOOLBARINFO* pBarInfo)
01050 {
01051     ASSERT_VALID(this);
01052     ASSERT(lpszResourceName != NULL);
01053
01054     // determine location of the bitmap in resource fork
01055     HINSTANCE hInst = AfxFindResourceHandle(lpszResourceName, RT_TOOLBAR);
01056     HRSRC hRsrc = ::FindResource(hInst, lpszResourceName, RT_TOOLBAR);
01057     if (hRsrc == NULL)
01058         return FALSE;
01059
01060     HGLOBAL hGlobal = LoadResource(hInst, hRsrc);
01061     if (hGlobal == NULL)
01062         return FALSE;
01063
01064     CToolBarData* pData = (CToolBarData*)LockResource(hGlobal);
01065     if (pData == NULL)
01066         return FALSE;
01067     ASSERT(pData->wVersion == 1);
01068
01069     UINT* pItems = new UINT[pData->wItemCount];
01070     for (int i = 0; i < pData->wItemCount; i++)
01071         pItems[i] = pData->items()[i];
01072     BOOL bResult = SetButtons(pItems, pData->wItemCount);
01073     delete[] pItems;
01074
01075     if (bResult)
01076     {
01077         // set new sizes of the buttons
01078         CSize sizeImage(pData->wWidth, pData->wHeight);
01079         CSize sizeButton(pData->wWidth + 7, pData->wHeight + 7);
01080         SetSizes(sizeButton, sizeImage);
01081
01082         // load bitmap now that sizes are known by the toolbar control
01083         bResult = LoadBitmap(lpszResourceName);
01084     }
01085
01086     UnlockResource(hGlobal);
01087     FreeResource(hGlobal);
01088
01089     // is the toolbar is customizable?
01090     if(( pBarInfo ) && ( bResult )) {
01091         m_pBarInfo = pBarInfo;
01092         m_nButtons = GetToolBarCtrl().GetButtonCount();
01093
01094         // modify the style to include adjustable
01095         ModifyStyle(0, CCS_ADJUSTABLE);
01096         RestoreState();
01097     }
01098
01099
01100     return bResult;
01101 }
01102
01103 BOOL CCJToolBar::LoadBitmap(LPCTSTR lpszResourceName)
01104 {
01105     ASSERT_VALID(this);
01106     ASSERT(lpszResourceName != NULL);
01107
01108     // determine location of the bitmap in resource fork
01109     HINSTANCE hInstImageWell = AfxFindResourceHandle(lpszResourceName, RT_BITMAP);
01110     HRSRC hRsrcImageWell = ::FindResource(hInstImageWell, lpszResourceName, RT_BITMAP);
01111     if (hRsrcImageWell == NULL)
01112         return FALSE;
01113
01114     // load the bitmap
01115     HBITMAP hbmImageWell;
01116     hbmImageWell = _LoadSysColorBitmap(hInstImageWell, hRsrcImageWell);
01117
01118     // tell common control toolbar about the new bitmap
01119     if (!AddReplaceBitmap(hbmImageWell))
01120         return FALSE;
01121
01122     // remember the resource handles so the bitmap can be recolored if necessary
01123     m_hInstImageWell = hInstImageWell;
01124     m_hRsrcImageWell = hRsrcImageWell;
01125     return TRUE;
01126 }
01127
01128 BOOL CCJToolBar::SetBitmap(HBITMAP hbmImageWell)
01129 {
01130     ASSERT_VALID(this);
01131     ASSERT(hbmImageWell != NULL);
01132
01133     // the caller must manage changing system colors
01134     m_hInstImageWell = NULL;
01135     m_hRsrcImageWell = NULL;
01136
01137     // tell common control toolbar about the new bitmap
01138     return AddReplaceBitmap(hbmImageWell);
01139 }
01140
01141 BOOL CCJToolBar::AddReplaceBitmap(HBITMAP hbmImageWell)
01142 {
01143     // need complete bitmap size to determine number of images
01144     BITMAP bitmap;
01145     VERIFY(::GetObject(hbmImageWell, sizeof(BITMAP), &bitmap));
01146
01147     // add the bitmap to the common control toolbar
01148     BOOL bResult;
01149     if (m_hbmImageWell == NULL)
01150     {
01151         TBADDBITMAP addBitmap;
01152         addBitmap.hInst = NULL; // makes TBADDBITMAP::nID behave a HBITMAP
01153         addBitmap.nID = (UINT)hbmImageWell;
01154         bResult =  DefWindowProc(TB_ADDBITMAP,
01155             bitmap.bmWidth / m_sizeImage.cx, (LPARAM)&addBitmap) == 0;
01156     }
01157     else
01158     {
01159         TBREPLACEBITMAP replaceBitmap;
01160         replaceBitmap.hInstOld = NULL;
01161         replaceBitmap.nIDOld = (UINT)m_hbmImageWell;
01162         replaceBitmap.hInstNew = NULL;
01163         replaceBitmap.nIDNew = (UINT)hbmImageWell;
01164         replaceBitmap.nButtons = bitmap.bmWidth / m_sizeImage.cx;
01165         bResult = (BOOL)DefWindowProc(TB_REPLACEBITMAP, 0,
01166             (LPARAM)&replaceBitmap);
01167     }
01168     // remove old bitmap, if present
01169     if (bResult)
01170     {
01171         AfxDeleteObject((HGDIOBJ*)&m_hbmImageWell);
01172         m_hbmImageWell = hbmImageWell;
01173     }
01174
01175     return bResult;
01176 }
01177
01178 BOOL CCJToolBar::SetButtons(const UINT* lpIDArray, int nIDCount)
01179 {
01180     ASSERT_VALID(this);
01181     ASSERT(nIDCount >= 1);  // must be at least one of them
01182     ASSERT(lpIDArray == NULL ||
01183         AfxIsValidAddress(lpIDArray, sizeof(UINT) * nIDCount, FALSE));
01184
01185     // delete all existing buttons
01186     int nCount = (int)DefWindowProc(TB_BUTTONCOUNT, 0, 0);
01187     while (nCount--)
01188         VERIFY(DefWindowProc(TB_DELETEBUTTON, 0, 0));
01189
01190     TBBUTTON button; memset(&button, 0, sizeof(TBBUTTON));
01191     button.iString = -1;
01192     if (lpIDArray != NULL)
01193     {
01194         // add new buttons to the common control
01195         int iImage = 0;
01196         for (int i = 0; i < nIDCount; i++)
01197         {
01198             button.fsState = TBSTATE_ENABLED;
01199             if ((button.idCommand = *lpIDArray++) == 0)
01200             {
01201                 // separator
01202                 button.fsStyle = TBSTYLE_SEP;
01203                 // width of separator includes 8 pixel overlap
01204                 ASSERT(_ComCtlVersion != -1);
01205                 if ((GetStyle() & TBSTYLE_FLAT) || _ComCtlVersion == VERSION_IE4)
01206                     button.iBitmap = 6;
01207                 else
01208                     button.iBitmap = 8;
01209             }
01210             else
01211             {
01212                 // a command button with image
01213                 button.fsStyle = TBSTYLE_BUTTON;
01214                 button.iBitmap = iImage++;
01215             }
01216             if (!DefWindowProc(TB_ADDBUTTONS, 1, (LPARAM)&button))
01217                 return FALSE;
01218         }
01219     }
01220     else
01221     {
01222         // add 'blank' buttons
01223         button.fsState = TBSTATE_ENABLED;
01224         for (int i = 0; i < nIDCount; i++)
01225         {
01226             ASSERT(button.fsStyle == TBSTYLE_BUTTON);
01227             if (!DefWindowProc(TB_ADDBUTTONS, 1, (LPARAM)&button))
01228                 return FALSE;
01229         }
01230     }
01231     m_nCount = (int)DefWindowProc(TB_BUTTONCOUNT, 0, 0);
01232     m_bDelayedButtonLayout = TRUE;
01233
01234     return TRUE;
01235 }
01236
01237 #ifdef AFX_CORE3_SEG
01238 #pragma code_seg(AFX_CORE3_SEG)
01239 #endif
01240
01242 // CCJToolBar attribute access
01243
01244 void CCJToolBar::GetButton(int nIndex, TBBUTTON* pButton) const
01245 {
01246     CCJToolBar* pBar = (CCJToolBar*)this;
01247     VERIFY(pBar->DefWindowProc(TB_GETBUTTON, nIndex, (LPARAM)pButton));
01248     // TBSTATE_ENABLED == TBBS_DISABLED so invert it
01249     pButton->fsState ^= TBSTATE_ENABLED;
01250 }
01251
01252 void CCJToolBar::SetButton(int nIndex, TBBUTTON* pButton)
01253 {
01254     // get original button state
01255     TBBUTTON button;
01256     VERIFY(DefWindowProc(TB_GETBUTTON, nIndex, (LPARAM)&button));
01257
01258     // prepare for old/new button comparsion
01259     button.bReserved[0] = 0;
01260     button.bReserved[1] = 0;
01261     // TBSTATE_ENABLED == TBBS_DISABLED so invert it
01262     pButton->fsState ^= TBSTATE_ENABLED;
01263     pButton->bReserved[0] = 0;
01264     pButton->bReserved[1] = 0;
01265
01266     // nothing to do if they are the same
01267     if (memcmp(pButton, &button, sizeof(TBBUTTON)) != 0)
01268     {
01269         // don't redraw everything while setting the button
01270         DWORD dwStyle = GetStyle();
01271         ModifyStyle(WS_VISIBLE, 0);
01272         VERIFY(DefWindowProc(TB_DELETEBUTTON, nIndex, 0));
01273         VERIFY(DefWindowProc(TB_INSERTBUTTON, nIndex, (LPARAM)pButton));
01274         ModifyStyle(0, dwStyle & WS_VISIBLE);
01275
01276         // invalidate appropriate parts
01277         if (((pButton->fsStyle ^ button.fsStyle) & TBSTYLE_SEP) ||
01278             ((pButton->fsStyle & TBSTYLE_SEP) && pButton->iBitmap != button.iBitmap))
01279         {
01280             // changing a separator
01281             Invalidate();
01282         }
01283         else
01284         {
01285             // invalidate just the button
01286             CRect rect;
01287             if (DefWindowProc(TB_GETITEMRECT, nIndex, (LPARAM)&rect))
01288                 InvalidateRect(rect);
01289         }
01290     }
01291 }
01292
01293 int CCJToolBar::CommandToIndex(UINT nIDFind) const
01294 {
01295     ASSERT_VALID(this);
01296     ASSERT(::IsWindow(m_hWnd));
01297
01298     CCJToolBar* pBar = (CCJToolBar*)this;
01299     return (int)pBar->DefWindowProc(TB_COMMANDTOINDEX, nIDFind, 0);
01300 }
01301
01302 UINT CCJToolBar::GetItemID(int nIndex) const
01303 {
01304     ASSERT_VALID(this);
01305     ASSERT(::IsWindow(m_hWnd));
01306
01307     TBBUTTON button;
01308     GetButton(nIndex, &button);
01309     return button.idCommand;
01310 }
01311
01312 void CCJToolBar::GetItemRect(int nIndex, LPRECT lpRect) const
01313 {
01314     ASSERT_VALID(this);
01315     ASSERT(::IsWindow(m_hWnd));
01316
01317     // handle any delayed layout
01318     if (m_bDelayedButtonLayout)
01319         ((CCJToolBar*)this)->Layout();
01320
01321     // now it is safe to get the item rectangle
01322     CCJToolBar* pBar = (CCJToolBar*)this;
01323     if (!pBar->DefWindowProc(TB_GETITEMRECT, nIndex, (LPARAM)lpRect))
01324         SetRectEmpty(lpRect);
01325 }
01326
01327 void CCJToolBar::Layout()
01328 {
01329     ASSERT(m_bDelayedButtonLayout);
01330
01331     m_bDelayedButtonLayout = FALSE;
01332
01333     BOOL bHorz = (m_dwStyle & CBRS_ORIENT_HORZ) != 0;
01334     if ((m_dwStyle & CBRS_FLOATING) && (m_dwStyle & CBRS_SIZE_DYNAMIC))
01335         ((CCJToolBar*)this)->CalcDynamicLayout(0, LM_HORZ | LM_MRUWIDTH | LM_COMMIT);
01336     else if (bHorz)
01337         ((CCJToolBar*)this)->CalcDynamicLayout(0, LM_HORZ | LM_HORZDOCK | LM_COMMIT);
01338     else
01339         ((CCJToolBar*)this)->CalcDynamicLayout(0, LM_VERTDOCK | LM_COMMIT);
01340 }
01341
01342 UINT CCJToolBar::GetButtonStyle(int nIndex) const
01343 {
01344     ASSERT_VALID(this);
01345     ASSERT(::IsWindow(m_hWnd));
01346
01347     TBBUTTON button;
01348     GetButton(nIndex, &button);
01349     return MAKELONG(button.fsStyle, button.fsState);
01350 }
01351
01352 void CCJToolBar::SetButtonStyle(int nIndex, UINT nStyle)
01353 {
01354     ASSERT_VALID(this);
01355     ASSERT(::IsWindow(m_hWnd));
01356
01357     TBBUTTON button;
01358     GetButton(nIndex, &button);
01359     if (button.fsStyle != (BYTE)LOWORD(nStyle) || button.fsState != (BYTE)HIWORD(nStyle))
01360     {
01361         button.fsStyle = (BYTE)LOWORD(nStyle);
01362         button.fsState = (BYTE)HIWORD(nStyle);
01363         SetButton(nIndex, &button);
01364         m_bDelayedButtonLayout = TRUE;
01365     }
01366 }
01367
01368 #define CX_OVERLAP  0
01369
01370 CSize CCJToolBar::CalcSize(TBBUTTON* pData, int nCount)
01371 {
01372     ASSERT(pData != NULL && nCount > 0);
01373
01374     CPoint cur(0,0);
01375     CSize sizeResult(0,0);
01376     int cyTallestOnRow = 0;
01377
01378     for (int i = 0; i < nCount; i++)
01379     {
01380         if (pData[i].fsState & TBSTATE_HIDDEN)
01381             continue;
01382
01383         // **PD**
01384         // Load actual size of button into a local variable
01385         // called m_sizeButton. C++ will use this instead of
01386         // CToolBar::m_sizeButton.
01387         //
01388         CSize m_sizeButton = GetButtonSize(pData, i);
01389
01390         // **PD**
01391         // I also changed the logic below to be more correct.
01392         cyTallestOnRow = max(cyTallestOnRow, m_sizeButton.cy);
01393         sizeResult.cx = max(cur.x + m_sizeButton.cx, sizeResult.cx);
01394         sizeResult.cy = max(cur.y + m_sizeButton.cy, sizeResult.cy);
01395
01396         cur.x += m_sizeButton.cx - CX_OVERLAP;
01397
01398         if (pData[i].fsState & TBSTATE_WRAP)
01399         {
01400             cur.x = 0;
01401             cur.y += cyTallestOnRow;
01402             cyTallestOnRow = 0;
01403             if (pData[i].fsStyle & TBSTYLE_SEP)
01404                 cur.y += m_sizeButton.cy;
01405         }
01406     }
01407     return sizeResult;
01408 }
01409
01410 int CCJToolBar::WrapToolBar(TBBUTTON* pData, int nCount, int nWidth)
01411 {
01412     ASSERT(pData != NULL && nCount > 0);
01413
01414     int nResult = 0;
01415     int x = 0;
01416     for (int i = 0; i < nCount; i++)
01417     {
01418         pData[i].fsState &= ~TBSTATE_WRAP;
01419
01420         if (pData[i].fsState & TBSTATE_HIDDEN)
01421             continue;
01422
01423         int dx, dxNext;
01424
01425         // **PD**
01426         // Load actual size of button into a local variable
01427         // called m_sizeButton. C++ will use this instead of
01428         // CToolBar::m_sizeButton.
01429         //
01430         CSize m_sizeButton = GetButtonSize(pData, i);
01431
01432         dx = m_sizeButton.cx;
01433         dxNext = dx - CX_OVERLAP;
01434
01435         if (x + dx > nWidth)
01436         {
01437             BOOL bFound = FALSE;
01438             for (int j = i; j >= 0  &&  !(pData[j].fsState & TBSTATE_WRAP); j--)
01439             {
01440                 // Find last separator that isn't hidden
01441                 // a separator that has a command ID is not
01442                 // a separator, but a custom control.
01443                 if ((pData[j].fsStyle & TBSTYLE_SEP) &&
01444                     (pData[j].idCommand == 0) &&
01445                     !(pData[j].fsState & TBSTATE_HIDDEN))
01446                 {
01447                     bFound = TRUE; i = j; x = 0;
01448                     pData[j].fsState |= TBSTATE_WRAP;
01449                     nResult++;
01450                     break;
01451                 }
01452             }
01453             if (!bFound)
01454             {
01455                 for (int j = i - 1; j >= 0 && !(pData[j].fsState & TBSTATE_WRAP); j--)
01456                 {
01457                     // Never wrap anything that is hidden,
01458                     // or any custom controls
01459                     if ((pData[j].fsState & TBSTATE_HIDDEN) ||
01460                         ((pData[j].fsStyle & TBSTYLE_SEP) &&
01461                         (pData[j].idCommand != 0)))
01462                         continue;
01463
01464                     bFound = TRUE; i = j; x = 0;
01465                     pData[j].fsState |= TBSTATE_WRAP;
01466                     nResult++;
01467                     break;
01468                 }
01469                 if (!bFound)
01470                     x += dxNext;
01471             }
01472         }
01473         else
01474             x += dxNext;
01475     }
01476     return nResult + 1;
01477 }
01478
01479 void CCJToolBar::SizeToolBar(TBBUTTON* pData, int nCount, int nLength, BOOL bVert)
01480 {
01481     ASSERT(pData != NULL && nCount > 0);
01482
01483     if (!bVert)
01484     {
01485         int nMin, nMax, nTarget, nCurrent, nMid;
01486
01487         // Wrap ToolBar as specified
01488         nMax = nLength;
01489         nTarget = WrapToolBar(pData, nCount, nMax);
01490
01491         // Wrap ToolBar vertically
01492         nMin = 0;
01493         nCurrent = WrapToolBar(pData, nCount, nMin);
01494
01495         if (nCurrent != nTarget)
01496         {
01497             while (nMin < nMax)
01498             {
01499                 nMid = (nMin + nMax) / 2;
01500                 nCurrent = WrapToolBar(pData, nCount, nMid);
01501
01502                 if (nCurrent == nTarget)
01503                     nMax = nMid;
01504                 else
01505                 {
01506                     if (nMin == nMid)
01507                     {
01508                         WrapToolBar(pData, nCount, nMax);
01509                         break;
01510                     }
01511                     nMin = nMid;
01512                 }
01513             }
01514         }
01515         CSize size = CalcSize(pData, nCount);
01516         WrapToolBar(pData, nCount, size.cx);
01517     }
01518     else
01519     {
01520         CSize sizeMax, sizeMin, sizeMid;
01521
01522         // Wrap ToolBar vertically
01523         WrapToolBar(pData, nCount, 0);
01524         sizeMin = CalcSize(pData, nCount);
01525
01526         // Wrap ToolBar horizontally
01527         WrapToolBar(pData, nCount, 32767);
01528         sizeMax = CalcSize(pData, nCount);
01529
01530         while (sizeMin.cx < sizeMax.cx)
01531         {
01532             sizeMid.cx = (sizeMin.cx + sizeMax.cx) / 2;
01533             WrapToolBar(pData, nCount, sizeMid.cx);
01534             sizeMid = CalcSize(pData, nCount);
01535
01536             if (nLength < sizeMid.cy)
01537             {
01538                 if (sizeMin == sizeMid)
01539                 {
01540                     WrapToolBar(pData, nCount, sizeMax.cx);
01541                     return;
01542                 }
01543                 sizeMin = sizeMid;
01544             }
01545             else if (nLength > sizeMid.cy)
01546                 sizeMax = sizeMid;
01547             else
01548                 return;
01549         }
01550     }
01551 }
01552
01553 CSize CCJToolBar::CalcLayout(DWORD dwMode, int nLength)
01554 {
01555     ASSERT_VALID(this);
01556     ASSERT(::IsWindow(m_hWnd));
01557     if (dwMode & LM_HORZDOCK)
01558         ASSERT(dwMode & LM_HORZ);
01559
01560     int nCount;
01561     TBBUTTON* pData = NULL;
01562     CSize sizeResult(0,0);
01563
01564     //BLOCK: Load Buttons
01565     {
01566         nCount = DefWindowProc(TB_BUTTONCOUNT, 0, 0);
01567         if (nCount != 0)
01568         {
01569             int i;
01570             pData = new TBBUTTON[nCount];
01571             for (i = 0; i < nCount; i++)
01572                 GetButton(i, &pData[i]);
01573         }
01574     }
01575
01576     if (nCount > 0)
01577     {
01578         if (!(m_dwStyle & CBRS_SIZE_FIXED))
01579         {
01580             BOOL bDynamic = m_dwStyle & CBRS_SIZE_DYNAMIC;
01581
01582             if (bDynamic && (dwMode & LM_MRUWIDTH))
01583                 SizeToolBar(pData, nCount, m_nMRUWidth);
01584             else if (bDynamic && (dwMode & LM_HORZDOCK))
01585                 SizeToolBar(pData, nCount, 32767);
01586             else if (bDynamic && (dwMode & LM_VERTDOCK))
01587                 SizeToolBar(pData, nCount, 0);
01588             else if (bDynamic && (nLength != -1))
01589             {
01590                 CRect rect; rect.SetRectEmpty();
01591                 CalcInsideRect(rect, (dwMode & LM_HORZ));
01592                 BOOL bVert = (dwMode & LM_LENGTHY);
01593                 int nLen = nLength + (bVert ? rect.Height() : rect.Width());
01594
01595                 SizeToolBar(pData, nCount, nLen, bVert);
01596             }
01597             else if (bDynamic && (m_dwStyle & CBRS_FLOATING))
01598                 SizeToolBar(pData, nCount, m_nMRUWidth);
01599             else
01600                 SizeToolBar(pData, nCount, (dwMode & LM_HORZ) ? 32767 : 0);
01601         }
01602
01603         sizeResult = CalcSize(pData, nCount);
01604
01605         if (dwMode & LM_COMMIT)
01606         {
01607             CJX_CONTROLPOS* pControl = NULL;
01608             int nControlCount = 0;
01609             BOOL bIsDelayed = m_bDelayedButtonLayout;
01610             m_bDelayedButtonLayout = FALSE;
01611
01612             for (int i = 0; i < nCount; i++)
01613                 if ((pData[i].fsStyle & TBSTYLE_SEP) && (pData[i].idCommand != 0))
01614                     nControlCount++;
01615
01616             if (nControlCount > 0)
01617             {
01618                 pControl = new CJX_CONTROLPOS[nControlCount];
01619                 nControlCount = 0;
01620
01621                 for(int i = 0; i < nCount; i++)
01622                 {
01623                     if ((pData[i].fsStyle & TBSTYLE_SEP) && (pData[i].idCommand != 0))
01624                     {
01625                         pControl[nControlCount].nIndex = i;
01626                         pControl[nControlCount].nID = pData[i].idCommand;
01627
01628                         CRect rect;
01629                         GetItemRect(i, &rect);
01630                         ClientToScreen(&rect);
01631                         pControl[nControlCount].rectOldPos = rect;
01632
01633                         nControlCount++;
01634                     }
01635                 }
01636             }
01637
01638             if ((m_dwStyle & CBRS_FLOATING) && (m_dwStyle & CBRS_SIZE_DYNAMIC))
01639                 m_nMRUWidth = sizeResult.cx;
01640             for (i = 0; i < nCount; i++)
01641                 SetButton(i, &pData[i]);
01642
01643             if (nControlCount > 0)
01644             {
01645                 for (int i = 0; i < nControlCount; i++)
01646                 {
01647                     CWnd* pWnd = GetDlgItem(pControl[i].nID);
01648                     if (pWnd != NULL)
01649                     {
01650                         CRect rect;
01651                         pWnd->GetWindowRect(&rect);
01652                         CPoint pt = rect.TopLeft() - pControl[i].rectOldPos.TopLeft();
01653                         GetItemRect(pControl[i].nIndex, &rect);
01654                         pt = rect.TopLeft() + pt;
01655                         pWnd->SetWindowPos(NULL, pt.x, pt.y, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER);
01656                     }
01657                 }
01658                 delete[] pControl;
01659             }
01660             m_bDelayedButtonLayout = bIsDelayed;
01661         }
01662         delete[] pData;
01663     }
01664
01665     //BLOCK: Adjust Margins
01666     {
01667         CRect rect; rect.SetRectEmpty();
01668         CalcInsideRect(rect, (dwMode & LM_HORZ));
01669         sizeResult.cy -= rect.Height();
01670         sizeResult.cx -= rect.Width();
01671
01672         CSize size = CCJToolBarBase::CalcFixedLayout((dwMode & LM_STRETCH), (dwMode & LM_HORZ));
01673         sizeResult.cx = max(sizeResult.cx, size.cx);
01674         sizeResult.cy = max(sizeResult.cy, size.cy);
01675     }
01676     return sizeResult;
01677 }
01678
01679 CSize CCJToolBar::CalcFixedLayout(BOOL bStretch, BOOL bHorz)
01680 {
01681     DWORD dwMode = bStretch ? LM_STRETCH : 0;
01682     dwMode |= bHorz ? LM_HORZ : 0;
01683
01684     return CalcLayout(dwMode);
01685 }
01686
01687 CSize CCJToolBar::CalcDynamicLayout(int nLength, DWORD dwMode)
01688 {
01689     if ((nLength == -1) && !(dwMode & LM_MRUWIDTH) && !(dwMode & LM_COMMIT) &&
01690         ((dwMode & LM_HORZDOCK) || (dwMode & LM_VERTDOCK)))
01691     {
01692         return CalcFixedLayout(dwMode & LM_STRETCH, dwMode & LM_HORZDOCK);
01693     }
01694     return CalcLayout(dwMode, nLength);
01695 }
01696
01697 void CCJToolBar::GetButtonInfo(int nIndex, UINT& nID, UINT& nStyle, int& iImage) const
01698 {
01699     ASSERT_VALID(this);
01700     ASSERT(::IsWindow(m_hWnd));
01701
01702     TBBUTTON button;
01703     GetButton(nIndex, &button);
01704     nID = button.idCommand;
01705     nStyle = MAKELONG(button.fsStyle, button.fsState);
01706     iImage = button.iBitmap;
01707 }
01708
01709 void CCJToolBar::SetButtonInfo(int nIndex, UINT nID, UINT nStyle, int iImage)
01710 {
01711     ASSERT_VALID(this);
01712
01713     TBBUTTON button;
01714     GetButton(nIndex, &button);
01715     TBBUTTON save;
01716     memcpy(&save, &button, sizeof(save));
01717     button.idCommand = nID;
01718     button.iBitmap = iImage;
01719     button.fsStyle = (BYTE)LOWORD(nStyle);
01720     button.fsState = (BYTE)HIWORD(nStyle);
01721     if (memcmp(&save, &button, sizeof(save)) != 0)
01722     {
01723         SetButton(nIndex, &button);
01724         m_bDelayedButtonLayout = TRUE;
01725     }
01726 }
01727
01728 int CCJToolBar::OnToolHitTest(CPoint point, TOOLINFO* pTI) const
01729 {
01730     ASSERT_VALID(this);
01731     ASSERT(::IsWindow(m_hWnd));
01732
01733     // check child windows first by calling CCJToolBarBase
01734     int nHit = CCJToolBarBase::OnToolHitTest(point, pTI);
01735     if (nHit != -1)
01736         return nHit;
01737
01738     // now hit test against CCJToolBar buttons
01739     CCJToolBar* pBar = (CCJToolBar*)this;
01740     int nButtons = (int)pBar->DefWindowProc(TB_BUTTONCOUNT, 0, 0);
01741     for (int i = 0; i < nButtons; i++)
01742     {
01743         CRect rect;
01744         TBBUTTON button;
01745         if (pBar->DefWindowProc(TB_GETITEMRECT, i, (LPARAM)&rect))
01746         {
01747             ++rect.bottom;
01748             ++rect.right;
01749             if (rect.PtInRect(point) &&
01750                 pBar->DefWindowProc(TB_GETBUTTON, i, (LPARAM)&button) &&
01751                 !(button.fsStyle & TBSTYLE_SEP))
01752             {
01753                 int nHit = GetItemID(i);
01754                 if (pTI != NULL && pTI->cbSize >= sizeof(AFX_OLDTOOLINFO))
01755                 {
01756                     pTI->hwnd = m_hWnd;
01757                     pTI->rect = rect;
01758                     pTI->uId = nHit;
01759                     pTI->lpszText = LPSTR_TEXTCALLBACK;
01760                 }
01761                 // found matching rect, return the ID of the button
01762                 return nHit != 0 ? nHit : -1;
01763             }
01764         }
01765     }
01766     return -1;
01767 }
01768
01769 BOOL CCJToolBar::SetButtonText(int nIndex, LPCTSTR lpszText)
01770 {
01771     // attempt to lookup string index in map
01772     int nString = -1;
01773     void* p;
01774     if (m_pStringMap != NULL && m_pStringMap->Lookup(lpszText, p))
01775         nString = (int)p;
01776
01777     // add new string if not already in map
01778     if (nString == -1)
01779     {
01780         // initialize map if necessary
01781         if (m_pStringMap == NULL)
01782             m_pStringMap = new CMapStringToPtr;
01783
01784         // add new string to toolbar list
01785         CString strTemp(lpszText, lstrlen(lpszText)+1);
01786         nString = (int)DefWindowProc(TB_ADDSTRING, 0, (LPARAM)(LPCTSTR)strTemp);
01787         if (nString == -1)
01788             return FALSE;
01789
01790         // cache string away in string map
01791         m_pStringMap->SetAt(lpszText, (void*)nString);
01792         ASSERT(m_pStringMap->Lookup(lpszText, p));
01793     }
01794
01795     // change the toolbar button description
01796     TBBUTTON button;
01797     GetButton(nIndex, &button);
01798     button.iString = nString;
01799     SetButton(nIndex, &button);
01800
01801     return TRUE;
01802 }
01803
01804 CString CCJToolBar::GetButtonText(int nIndex) const
01805 {
01806     CString strResult;
01807     GetButtonText(nIndex, strResult);
01808     return strResult;
01809 }
01810
01811 void CCJToolBar::GetButtonText(int nIndex, CString& rString) const
01812 {
01813     if (m_pStringMap != NULL)
01814     {
01815         // get button information (need button.iString)
01816         TBBUTTON button;
01817         GetButton(nIndex, &button);
01818
01819         // look in map for matching iString
01820         POSITION pos = m_pStringMap->GetStartPosition();
01821         CString str; void* p;
01822         while (pos)
01823         {
01824             m_pStringMap->GetNextAssoc(pos, str, p);
01825             if ((int)p == button.iString)
01826             {
01827                 rString = str;
01828                 return;
01829             }
01830         }
01831     }
01832     rString.Empty();
01833 }
01834
01836 // CCJToolBar message handlers
01837
01838 BEGIN_MESSAGE_MAP(CCJToolBar, CCJToolBarBase)
01839     //{{AFX_MSG_MAP(CCJToolBar)
01840     ON_WM_NCHITTEST()
01841     ON_WM_NCPAINT()
01842     ON_WM_PAINT()
01843     ON_WM_NCCALCSIZE()
01844     ON_WM_WINDOWPOSCHANGING()
01845     ON_WM_WINDOWPOSCHANGED()
01846     ON_WM_SYSCOLORCHANGE()
01847     ON_MESSAGE(TB_SETBUTTONSIZE, OnSetButtonSize)
01848     ON_MESSAGE(TB_SETBITMAPSIZE, OnSetBitmapSize)
01849     ON_WM_NCCREATE()
01850     ON_WM_ERASEBKGND()
01851     ON_WM_DESTROY()
01852     ON_WM_RBUTTONDOWN()
01853     ON_MESSAGE(WM_SETTINGCHANGE, OnPreserveZeroBorderHelper)
01854     //}}AFX_MSG_MAP
01855     ON_MESSAGE(WM_SETFONT, OnPreserveZeroBorderHelper)
01856     ON_NOTIFY_REFLECT(TBN_DROPDOWN,      OnToolBarBtnDropDown)
01857     ON_NOTIFY_REFLECT(TBN_BEGINADJUST,   OnToolBarBeginAdjust)
01858     ON_NOTIFY_REFLECT(TBN_BEGINDRAG,     OnToolBarBeginDrag)
01859     ON_NOTIFY_REFLECT(TBN_CUSTHELP,      OnToolBarCustomHelp)
01860     ON_NOTIFY_REFLECT(TBN_ENDADJUST,     OnToolBarEndAdjust)
01861     ON_NOTIFY_REFLECT(TBN_ENDDRAG,       OnToolBarEndDrag)
01862     ON_NOTIFY_REFLECT(TBN_GETBUTTONINFO, OnToolBarGetButtonInfo)
01863     ON_NOTIFY_REFLECT(TBN_QUERYDELETE,   OnToolBarQueryDelete)
01864     ON_NOTIFY_REFLECT(TBN_QUERYINSERT,   OnToolBarQueryInsert)
01865     ON_NOTIFY_REFLECT(TBN_RESET,         OnToolBarReset)
01866     ON_NOTIFY_REFLECT(TBN_TOOLBARCHANGE, OnToolBarChange)
01867 END_MESSAGE_MAP()
01868
01870 // Override to avoid MFC in case I'm inside a ReBar
01871 //
01872 BOOL CCJToolBar::OnEraseBkgnd(CDC*)
01873 {
01874     return (BOOL)Default();
01875 }
01876
01877 UINT CCJToolBar::OnNcHitTest(CPoint)
01878 {
01879     return HTCLIENT;
01880 }
01881
01883 // Calcluate size of client area. Adds room for grippers
01884 //
01885 void CCJToolBar::OnNcCalcSize(BOOL /*bCalcValidRects*/, NCCALCSIZE_PARAMS* lpncsp)
01886 {
01887     // calculate border space (will add to top/bottom, subtract from right/bottom)
01888     CRect rect; rect.SetRectEmpty();
01889     BOOL bHorz = (m_dwStyle & CBRS_ORIENT_HORZ) != 0;
01890     CCJToolBarBase::CalcInsideRect(rect, bHorz);
01891     ASSERT(_ComCtlVersion != -1);
01892     ASSERT(_ComCtlVersion >= VERSION_IE4 || rect.top >= 2);
01893
01894     // adjust non-client area for border space
01895     lpncsp->rgrc[0].left += rect.left;
01896     lpncsp->rgrc[0].top += rect.top;
01897     // previous versions of COMCTL32.DLL had a built-in 2 pixel border
01898     if (_ComCtlVersion < VERSION_IE4)
01899         lpncsp->rgrc[0].top -= 2;
01900     lpncsp->rgrc[0].right += rect.right;
01901     lpncsp->rgrc[0].bottom += rect.bottom;
01902 }
01903
01905 // **PD**
01906 // Part 2 of correction for MFC is to recalculate everything when the bar
01907 // goes from docked to undocked because the AdjustSize calculation happens
01908 // when the bar is in the old state, and thus wrong. After the bar is
01909 // docked/undocked, I'll recalculate with the new style and commit the change.
01910 //
01911 void CCJToolBar::OnBarStyleChange(DWORD dwOldStyle, DWORD dwNewStyle)
01912 {
01913     // a dynamically resizeable toolbar can not have the CBRS_FLOAT_MULTI
01914     ASSERT(!((dwNewStyle & CBRS_SIZE_DYNAMIC) &&
01915         (m_dwDockStyle & CBRS_FLOAT_MULTI)));
01916
01917     // a toolbar can not be both dynamic and fixed in size
01918     ASSERT (!((dwNewStyle & CBRS_SIZE_FIXED) &&
01919         (dwNewStyle & CBRS_SIZE_DYNAMIC)));
01920
01921     // CBRS_SIZE_DYNAMIC can not be disabled once it has been enabled
01922     ASSERT (((dwOldStyle & CBRS_SIZE_DYNAMIC) == 0) ||
01923         ((dwNewStyle & CBRS_SIZE_DYNAMIC) != 0));
01924
01925     if (m_hWnd != NULL &&
01926         ((dwOldStyle & CBRS_BORDER_ANY) != (dwNewStyle & CBRS_BORDER_ANY)))
01927     {
01928         // recalc non-client area when border styles change
01929         SetWindowPos(NULL, 0, 0, 0, 0,
01930             SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_DRAWFRAME);
01931     }
01932     m_bDelayedButtonLayout = TRUE;
01933
01934     if (dwOldStyle != dwNewStyle) {
01935         DWORD dwMode = 0;
01936         if ((dwNewStyle & CBRS_SIZE_DYNAMIC) && (dwNewStyle & CBRS_FLOATING))
01937             dwMode = LM_HORZ | LM_MRUWIDTH;
01938         else if (dwNewStyle & CBRS_ORIENT_HORZ)
01939             dwMode = LM_HORZ | LM_HORZDOCK;
01940         else
01941             dwMode =  LM_VERTDOCK;
01942
01943         CalcDynamicLayout(-1, dwMode | LM_COMMIT);
01944     }
01945 }
01946
01947 void CCJToolBar::OnNcPaint()
01948 {
01949     EraseNonClient();
01950 }
01951
01952 void CCJToolBar::OnWindowPosChanging(LPWINDOWPOS lpwndpos)
01953 {
01954     // not necessary to invalidate the borders
01955     DWORD dwStyle = m_dwStyle;
01956     m_dwStyle &= ~(CBRS_BORDER_ANY);
01957     CCJToolBarBase::OnWindowPosChanging(lpwndpos);
01958     m_dwStyle = dwStyle;
01959 }
01960
01961 void CCJToolBar::OnPaint()
01962 {
01963     if (m_bDelayedButtonLayout)
01964         Layout();
01965
01966     Default();
01967 }
01968
01969 LRESULT CCJToolBar::OnSetButtonSize(WPARAM, LPARAM lParam)
01970 {
01971     return OnSetSizeHelper(m_sizeButton, lParam);
01972 }
01973
01974 LRESULT CCJToolBar::OnSetBitmapSize(WPARAM, LPARAM lParam)
01975 {
01976     return OnSetSizeHelper(m_sizeImage, lParam);
01977 }
01978
01979 LRESULT CCJToolBar::OnSetSizeHelper(CSize& size, LPARAM lParam)
01980 {
01981     //WINBUG: The IE4 version of COMCTL32.DLL supports a zero border, but
01982     //  only if TBSTYLE_TRANSPARENT is on during the the TB_SETBITMAPSIZE
01983     //  and/or TB_SETBUTTONSIZE messages.  In order to enable this feature
01984     //  all the time (so we get consistent border behavior, dependent only
01985     //  on the version of COMCTL32.DLL) we turn on TBSTYLE_TRANSPARENT
01986     //  whenever these messages go through.  It would be nice that in a
01987     //  future version, the system toolbar would just allow you to set
01988     //  the top and left borders to anything you please.
01989
01990     BOOL bModify = FALSE;
01991     ASSERT(_ComCtlVersion != -1);
01992     DWORD dwStyle = 0;
01993     if (_ComCtlVersion >= VERSION_IE4)
01994     {
01995         dwStyle = GetStyle();
01996         bModify = ModifyStyle(0, TBSTYLE_TRANSPARENT|TBSTYLE_FLAT);
01997     }
01998
01999     LRESULT lResult = Default();
02000     if (lResult)
02001         size = lParam;
02002
02003     if (bModify)
02004         SetWindowLong(m_hWnd, GWL_STYLE, dwStyle);
02005
02006     return lResult;
02007 }
02008
02009 LRESULT CCJToolBar::OnPreserveZeroBorderHelper(WPARAM, LPARAM lParam)
02010 {
02011     UNUSED_ALWAYS( lParam );
02012
02013     BOOL bModify = FALSE;
02014     ASSERT(_ComCtlVersion != -1);
02015     DWORD dwStyle = 0;
02016     if (_ComCtlVersion >= VERSION_IE4)
02017     {
02018         dwStyle = GetStyle();
02019         bModify = ModifyStyle(0, TBSTYLE_TRANSPARENT|TBSTYLE_FLAT);
02020     }
02021
02022     LRESULT lResult = Default();
02023
02024     if (bModify)
02025         SetWindowLong(m_hWnd, GWL_STYLE, dwStyle);
02026
02027     return lResult;
02028 }
02029
02030 void CCJToolBar::OnSysColorChange()
02031 {
02032     // re-color bitmap for toolbar
02033     if (m_hInstImageWell != NULL && m_hbmImageWell != NULL)
02034     {
02035         HBITMAP hbmNew;
02036         hbmNew = _LoadSysColorBitmap(m_hInstImageWell, m_hRsrcImageWell);
02037         if (hbmNew != NULL)
02038             AddReplaceBitmap(hbmNew);
02039     }
02040 }
02041
02043 // CCJToolBar idle update through CCJToolCmdUI class
02044
02045 class CCJToolCmdUI : public CCmdUI        // class private to this file !
02046 {
02047 public: // re-implementations only
02048     virtual void Enable(BOOL bOn);
02049     virtual void SetCheck(int nCheck);
02050     virtual void SetText(LPCTSTR lpszText);
02051 };
02052
02053 void CCJToolCmdUI::Enable(BOOL bOn)
02054 {
02055     m_bEnableChanged = TRUE;
02056     CCJToolBar* pToolBar = (CCJToolBar*)m_pOther;
02057     ASSERT(pToolBar != NULL);
02058     ASSERT_KINDOF(CCJToolBar, pToolBar);
02059     ASSERT(m_nIndex < m_nIndexMax);
02060
02061     UINT nNewStyle = pToolBar->GetButtonStyle(m_nIndex) & ~TBBS_DISABLED;
02062     if (!bOn)
02063     {
02064         nNewStyle |= TBBS_DISABLED;
02065         // WINBUG: If a button is currently pressed and then is disabled
02066         // COMCTL32.DLL does not unpress the button, even after the mouse
02067         // button goes up!  We work around this bug by forcing TBBS_PRESSED
02068         // off when a button is disabled.
02069         nNewStyle &= ~TBBS_PRESSED;
02070     }
02071     ASSERT(!(nNewStyle & TBBS_SEPARATOR));
02072     pToolBar->SetButtonStyle(m_nIndex, nNewStyle);
02073 }
02074
02075 void CCJToolCmdUI::SetCheck(int nCheck)
02076 {
02077     ASSERT(nCheck >= 0 && nCheck <= 2); // 0=>off, 1=>on, 2=>indeterminate
02078     CCJToolBar* pToolBar = (CCJToolBar*)m_pOther;
02079     ASSERT(pToolBar != NULL);
02080     ASSERT_KINDOF(CCJToolBar, pToolBar);
02081     ASSERT(m_nIndex < m_nIndexMax);
02082
02083     UINT nNewStyle = pToolBar->GetButtonStyle(m_nIndex) &
02084                 ~(TBBS_CHECKED | TBBS_INDETERMINATE);
02085     if (nCheck == 1)
02086         nNewStyle |= TBBS_CHECKED;
02087     else if (nCheck == 2)
02088         nNewStyle |= TBBS_INDETERMINATE;
02089     ASSERT(!(nNewStyle & TBBS_SEPARATOR));
02090     pToolBar->SetButtonStyle(m_nIndex, nNewStyle | TBBS_CHECKBOX);
02091 }
02092
02093 void CCJToolCmdUI::SetText(LPCTSTR)
02094 {
02095     // ignore it
02096 }
02097
02098 void CCJToolBar::OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler)
02099 {
02100     CCJToolCmdUI state;
02101     state.m_pOther = this;
02102
02103     state.m_nIndexMax = (UINT)DefWindowProc(TB_BUTTONCOUNT, 0, 0);
02104     for (state.m_nIndex = 0; state.m_nIndex < state.m_nIndexMax; state.m_nIndex++)
02105     {
02106         // get buttons state
02107         TBBUTTON button;
02108         GetButton(state.m_nIndex, &button);
02109         state.m_nID = button.idCommand;
02110
02111         // ignore separators
02112         if (!(button.fsStyle & TBSTYLE_SEP))
02113         {
02114             // allow reflections
02115             if (CWnd::OnCmdMsg(0,
02116                 MAKELONG((int)CN_UPDATE_COMMAND_UI, WM_COMMAND+WM_REFLECT_BASE),
02117                 &state, NULL))
02118                 continue;
02119
02120             // allow the toolbar itself to have update handlers
02121             if (CWnd::OnCmdMsg(state.m_nID, CN_UPDATE_COMMAND_UI, &state, NULL))
02122                 continue;
02123
02124             // allow the owner to process the update
02125             state.DoUpdate(pTarget, bDisableIfNoHndler);
02126         }
02127     }
02128
02129     // update the dialog controls added to the toolbar
02130     UpdateDialogControls(pTarget, bDisableIfNoHndler);
02131 }
02132
02134 // CCJToolBar diagnostics
02135
02136 #ifdef _DEBUG
02137 void CCJToolBar::AssertValid() const
02138 {
02139     // Note: CCJToolBarBase::AssertValid is not called because it checks for
02140     //  m_nCount and m_pData to be in sync, which they are not in CCJToolBar.
02141
02142 #ifndef _VC_VERSION_5
02143     ASSERT(m_hbmImageWell == NULL ||
02144         ( afxData.bWin95 || ::GetObjectType(m_hbmImageWell) == OBJ_BITMAP));
02145 #else
02146     ASSERT(m_hbmImageWell == NULL ||
02147         ( ::GetObjectType(m_hbmImageWell) == OBJ_BITMAP));
02148 #endif
02149
02150     if (m_hInstImageWell != NULL && m_hbmImageWell != NULL)
02151         ASSERT(m_hRsrcImageWell != NULL);
02152 }
02153
02154 void CCJToolBar::Dump(CDumpContext& dc) const
02155 {
02156     CCJToolBarBase::Dump(dc);
02157
02158     dc << "m_hbmImageWell = " << (UINT)m_hbmImageWell;
02159     dc << "\nm_hInstImageWell = " << (UINT)m_hInstImageWell;
02160     dc << "\nm_hRsrcImageWell = " << (UINT)m_hRsrcImageWell;
02161     dc << "\nm_sizeButton = " << m_sizeButton;
02162     dc << "\nm_sizeImage = " << m_sizeImage;
02163
02164     if (dc.GetDepth() > 0)
02165     {
02166         CCJToolBar* pBar = (CCJToolBar*)this;
02167         int nCount = pBar->DefWindowProc(TB_BUTTONCOUNT, 0, 0);
02168         for (int i = 0; i < nCount; i++)
02169         {
02170             TBBUTTON button;
02171             GetButton(i, &button);
02172             dc << "\ntoolbar button[" << i << "] = {";
02173             dc << "\n\tnID = " << button.idCommand;
02174             dc << "\n\tnStyle = " << MAKELONG(button.fsStyle, button.fsState);
02175             if (button.fsStyle & TBSTYLE_SEP)
02176                 dc << "\n\tiImage (separator width) = " << button.iBitmap;
02177             else
02178                 dc <<"\n\tiImage (bitmap image index) = " << button.iBitmap;
02179             dc << "\n}";
02180         }
02181     }
02182
02183     dc << "\n";
02184 }
02185 #endif
02186
02187 #ifdef AFX_INIT_SEG
02188 #pragma code_seg(AFX_INIT_SEG)
02189 #endif
02190
02191 IMPLEMENT_DYNAMIC(CCJToolBar, CCJToolBarBase)
02192
Generated on Sun Feb 24 01:21:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJToolBarBase.cpp Source File

WinCvs/CJLib/CJLibrary/CJToolBarBase.cpp

Go to the documentation of this file.
00001 // CJToolBarBase.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Copied from MFC, Visual C++ 6, to extend functionality to Visual C++ 5
00006 // users, with some ideas taken from Luis Barreira's article 'Classes for new IE4 controls'
00007 // http://www.codeguru.com/controls/ie4_controls_classes.shtml
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:49 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJockey/CJLibrary/CJToolBarBase.cpp $
00015  *
00016  * $History: CJToolBarBase.cpp $
00017  *
00018  * *****************  Version 5  *****************
00019  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00020  * Updated in $/CodeJockey/CJLibrary
00021  * Updated copyright and contact information.
00022  *
00023  * *****************  Version 4  *****************
00024  * User: Kirk Stowell Date: 7/28/99    Time: 12:38a
00025  * Updated in $/CodeJockey/CJLibrary
00026  * Final pass for release 6.08.
00027  *
00028  * *****************  Version 3  *****************
00029  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00030  * Updated in $/CodeJockey/CJLibrary
00031  *
00032  * *****************  Version 2  *****************
00033  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00034  * Updated in $/CodeJockey/CJLibrary
00035  *
00036  * *****************  Version 1  *****************
00037  * User: Kirk Stowell Date: 7/14/99    Time: 10:29p
00038  * Created in $/CodeJockey/CJLibrary
00039  * Copied from MFC v6 and techno preview for v5. Added to extend
00040  * functionality to Visual C++ 5.0 users.
00041  *
00042  ***************************************************************************/
00043
00044 #include "stdafx.h"
00045 #include "CJToolBarBase.h"
00046
00047 #ifdef _DEBUG
00048 #define new DEBUG_NEW
00049 #undef THIS_FILE
00050 static char THIS_FILE[] = __FILE__;
00051 #endif
00052
00054 // CCJToolBarBase
00055
00056 CCJToolBarBase::CCJToolBarBase()
00057 {
00058     m_bInReBar = false;
00059     m_bExStyle = false;
00060 }
00061
00062 CCJToolBarBase::~CCJToolBarBase()
00063 {
00064
00065 }
00066
00067 BEGIN_MESSAGE_MAP(CCJToolBarBase, CControlBar)
00068     //{{AFX_MSG_MAP(CCJToolBarBase)
00069     ON_WM_PAINT()
00070     ON_WM_WINDOWPOSCHANGING()
00071     //}}AFX_MSG_MAP
00072 END_MESSAGE_MAP()
00073
00074 void CCJToolBarBase::SetBorders(int cxLeft, int cyTop, int cxRight, int cyBottom)
00075 {
00076     ASSERT(cxLeft >= 0);
00077     ASSERT(cyTop >= 0);
00078     ASSERT(cxRight >= 0);
00079     ASSERT(cyBottom >= 0);
00080
00081     m_cxLeftBorder = cxLeft;
00082     m_cyTopBorder = cyTop;
00083     m_cxRightBorder = cxRight;
00084     m_cyBottomBorder = cyBottom;
00085 }
00086
00087 LRESULT CCJToolBarBase::WindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam)
00088 {
00089     ASSERT_VALID(this);
00090
00091     LRESULT lResult;
00092     switch (nMsg)
00093     {
00094     case WM_NOTIFY:
00095     case WM_COMMAND:
00096     case WM_DRAWITEM:
00097     case WM_MEASUREITEM:
00098     case WM_DELETEITEM:
00099     case WM_COMPAREITEM:
00100     case WM_VKEYTOITEM:
00101     case WM_CHARTOITEM:
00102         // send these messages to the owner if not handled
00103         if (OnWndMsg(nMsg, wParam, lParam, &lResult))
00104             return lResult;
00105         else
00106         {
00107             // try owner next
00108             lResult = GetOwner()->SendMessage(nMsg, wParam, lParam);
00109
00110             // special case for TTN_NEEDTEXTA and TTN_NEEDTEXTW
00111             if(nMsg == WM_NOTIFY)
00112             {
00113                 NMHDR* pNMHDR = (NMHDR*)lParam;
00114                 if (pNMHDR->code == TTN_NEEDTEXTA || pNMHDR->code == TTN_NEEDTEXTW)
00115                 {
00116                     TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR;
00117                     TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR;
00118                     if ((pNMHDR->code == TTN_NEEDTEXTA && (!pTTTA->lpszText || !*pTTTA->lpszText)) ||
00119                         (pNMHDR->code == TTN_NEEDTEXTW && (!pTTTW->lpszText || !*pTTTW->lpszText)))
00120                     {
00121                         // not handled by owner, so let bar itself handle it
00122                         lResult = CWnd::WindowProc(nMsg, wParam, lParam);
00123                     }
00124                 }
00125             }
00126             return lResult;
00127         }
00128     }
00129
00130     // otherwise, just handle in default way
00131     lResult = CWnd::WindowProc(nMsg, wParam, lParam);
00132     return lResult;
00133 }
00134
00135 void CCJToolBarBase::OnWindowPosChanging(LPWINDOWPOS lpWndPos)
00136 {
00137     // WINBUG: We call DefWindowProc here instead of CWnd::OnWindowPosChanging
00138     //  (which calls CWnd::Default, which calls through the super wndproc)
00139     //  because certain control bars that are system implemented (such as
00140     //  CToolBar with TBSTYLE_FLAT) do not implement WM_WINDOWPOSCHANGING
00141     //  correctly, causing repaint problems.  This code bypasses that whole
00142     //  mess.
00143     ::DefWindowProc(m_hWnd, WM_WINDOWPOSCHANGING, 0, (LPARAM)lpWndPos);
00144
00145     if (lpWndPos->flags & SWP_NOSIZE)
00146         return;
00147
00148     // invalidate borders on the right
00149     CRect rect;
00150     GetWindowRect(&rect);
00151     CSize sizePrev = rect.Size();
00152     int cx = lpWndPos->cx;
00153     int cy = lpWndPos->cy;
00154     if (cx != sizePrev.cx && (m_dwStyle & CBRS_BORDER_RIGHT))
00155     {
00156         rect.SetRect(cx-afxData.cxBorder2, 0, cx, cy);
00157         InvalidateRect(&rect);
00158         rect.SetRect(sizePrev.cx-afxData.cxBorder2, 0, sizePrev.cx, cy);
00159         InvalidateRect(&rect);
00160     }
00161
00162     // invalidate borders on the bottom
00163     if (cy != sizePrev.cy && (m_dwStyle & CBRS_BORDER_BOTTOM))
00164     {
00165         rect.SetRect(0, cy-afxData.cyBorder2, cx, cy);
00166         InvalidateRect(&rect);
00167         rect.SetRect(0, sizePrev.cy-afxData.cyBorder2, cx, sizePrev.cy);
00168         InvalidateRect(&rect);
00169     }
00170 }
00171
00172 void CCJToolBarBase::OnPaint()
00173 {
00174     // background is already filled in gray
00175     CPaintDC dc(this);
00176
00177     // erase background now
00178     if (IsVisible())
00179         DoPaint(&dc);       // delegate to paint helper
00180 }
00181
00182 void CCJToolBarBase::EraseNonClient()
00183 {
00184     // get window DC that is clipped to the non-client area
00185     CWindowDC dc(this);
00186     CRect rectClient;
00187     GetClientRect(rectClient);
00188     CRect rectWindow;
00189     GetWindowRect(rectWindow);
00190     ScreenToClient(rectWindow);
00191     rectClient.OffsetRect(-rectWindow.left, -rectWindow.top);
00192     dc.ExcludeClipRect(rectClient);
00193
00194     // draw borders in non-client area
00195     rectWindow.OffsetRect(-rectWindow.left, -rectWindow.top);
00196     DrawBorders(&dc, rectWindow);
00197
00198     // erase parts not drawn
00199     dc.IntersectClipRect(rectWindow);
00200     SendMessage(WM_ERASEBKGND, (WPARAM)dc.m_hDC);
00201
00202     // draw gripper in non-client area
00203     DrawGripper(&dc, rectWindow);
00204 }
00205
00206 void CCJToolBarBase::DoPaint(CDC* pDC)
00207 {
00208     ASSERT_VALID(this);
00209     ASSERT_VALID(pDC);
00210
00211     // paint inside client area
00212     CRect rect;
00213     GetClientRect(rect);
00214     DrawBorders(pDC, rect);
00215     DrawGripper(pDC, rect);
00216 }
00217
00218 void CCJToolBarBase::DrawBorders(CDC* pDC, CRect& rect)
00219 {
00220     ASSERT_VALID(this);
00221     ASSERT_VALID(pDC);
00222
00223     DWORD dwStyle = m_dwStyle;
00224     if (!(dwStyle & CBRS_BORDER_ANY))
00225         return;
00226
00227     // prepare for dark lines
00228     ASSERT(rect.top == 0 && rect.left == 0);
00229     if(m_bInReBar)
00230     {
00231         CRect rect1, rect2;
00232         rect1 = rect;
00233         rect2 = rect;
00234         COLORREF clr = afxData.bWin4 ? afxData.clrBtnShadow : afxData.clrWindowFrame;
00235
00236         // draw dark line one pixel back/up
00237         if (dwStyle & CBRS_BORDER_3D)
00238         {
00239             rect1.right -= CX_BORDER;
00240             rect1.bottom -= CY_BORDER;
00241         }
00242         if (dwStyle & CBRS_BORDER_TOP)
00243             rect2.top += afxData.cyBorder2;
00244         if (dwStyle & CBRS_BORDER_BOTTOM)
00245             rect2.bottom -= afxData.cyBorder2;
00246
00247         // draw left and top
00248         if (dwStyle & CBRS_BORDER_LEFT)
00249             pDC->FillSolidRect(0, rect2.top, CX_BORDER, rect2.Height(), clr);
00250         if (dwStyle & CBRS_BORDER_TOP)
00251             pDC->FillSolidRect(0, 0, rect.right, CY_BORDER, clr);
00252
00253         // draw right and bottom
00254         if (dwStyle & CBRS_BORDER_RIGHT)
00255             pDC->FillSolidRect(rect1.right, rect2.top, -CX_BORDER, rect2.Height(), clr);
00256         if (dwStyle & CBRS_BORDER_BOTTOM)
00257             pDC->FillSolidRect(0, rect1.bottom, rect.right, -CY_BORDER, clr);
00258
00259         if (dwStyle & CBRS_BORDER_3D)
00260         {
00261             // prepare for hilite lines
00262             clr = afxData.clrBtnHilite;
00263
00264             // draw left and top
00265             if (dwStyle & CBRS_BORDER_LEFT)
00266                 pDC->FillSolidRect(1, rect2.top, CX_BORDER, rect2.Height(), clr);
00267             if (dwStyle & CBRS_BORDER_TOP)
00268                 pDC->FillSolidRect(0, 1, rect.right, CY_BORDER, clr);
00269
00270             // draw right and bottom
00271             if (dwStyle & CBRS_BORDER_RIGHT)
00272                 pDC->FillSolidRect(rect.right, rect2.top, -CX_BORDER, rect2.Height(), clr);
00273             if (dwStyle & CBRS_BORDER_BOTTOM)
00274                 pDC->FillSolidRect(0, rect.bottom, rect.right, -CY_BORDER, clr);
00275         }
00276
00277         if (dwStyle & CBRS_BORDER_LEFT)
00278             rect.left += afxData.cxBorder2;
00279         if (dwStyle & CBRS_BORDER_TOP)
00280             rect.top += afxData.cyBorder2;
00281         if (dwStyle & CBRS_BORDER_RIGHT)
00282             rect.right -= afxData.cxBorder2;
00283         if (dwStyle & CBRS_BORDER_BOTTOM)
00284             rect.bottom -= afxData.cyBorder2;
00285     }
00286     else
00287     {
00288         if(dwStyle & CBRS_BORDER_RIGHT) {
00289             pDC->FillSolidRect(rect.right-1, 0, rect.right, rect.bottom, afxData.clrBtnShadow);
00290             rect.right--;
00291         }
00292         if(dwStyle & CBRS_BORDER_BOTTOM) {
00293             pDC->FillSolidRect(0, rect.bottom-1, rect.right, rect.bottom, afxData.clrBtnShadow);
00294             rect.bottom--;
00295         }
00296         if(dwStyle & CBRS_BORDER_TOP) {
00297             pDC->FillSolidRect(0, 0, rect.right, 1, afxData.clrBtnHilite);
00298             rect.top++;
00299         }
00300         if(dwStyle & CBRS_BORDER_LEFT) {
00301             pDC->FillSolidRect(0, 0, 1, rect.bottom, afxData.clrBtnHilite);
00302             rect.left++;
00303         }
00304     }
00305 }
00306
00307 #define CX_GRIPPER          3
00308 #define CY_GRIPPER          3
00309 #define CX_BORDER_GRIPPER   2
00310 #define CY_BORDER_GRIPPER   2
00311
00312 void CCJToolBarBase::DrawGripper(CDC* pDC, const CRect& rect)
00313 {
00314     // if we are floating return.
00315     if( m_dwStyle & CBRS_FLOATING ) {
00316         return;
00317     }
00318
00319     // if we are to draw the extended "office" style gripper.
00320     if(( m_dwStyle & CBRS_GRIPPER ) && ( m_bExStyle == true ))
00321     {
00322         // draw the gripper in the border
00323         if (m_dwStyle & CBRS_ORIENT_HORZ)
00324         {
00325             // Draw the first gripper.
00326             pDC->Draw3dRect( rect.left+3, rect.top+2, 3, rect.Height()-4,
00327                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00328
00329             pDC->SetPixel( rect.left+3, rect.top+2+rect.Height()-5,
00330                 afxData.clrBtnHilite);
00331
00332             // Draw the second gripper.
00333             pDC->Draw3dRect( rect.left+6, rect.top+2, 3, rect.Height()-4,
00334                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00335
00336             pDC->SetPixel( rect.left+6, rect.top+2+rect.Height()-5,
00337                 afxData.clrBtnHilite);
00338         }
00339         else
00340         {
00341             // Draw the first gripper.
00342             pDC->Draw3dRect( rect.left+2, rect.top+3, rect.Width()-4, 3,
00343                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00344
00345             pDC->SetPixel( rect.left+2+rect.Width()-5, rect.top+3,
00346                 afxData.clrBtnHilite);
00347
00348             // Draw the second gripper.
00349             pDC->Draw3dRect( rect.left+2, rect.top+6, rect.Width()-4, 3,
00350                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00351
00352             pDC->SetPixel( rect.left+2+rect.Width()-5, rect.top+6,
00353                 afxData.clrBtnHilite);
00354         }
00355
00356         GdiFlush();
00357     }
00358
00359     // if we are to draw the "ReBar" style gripper.
00360     else
00361     if(( m_dwStyle & CBRS_GRIPPER ) && ( m_bInReBar == true ))
00362     {
00363         // draw the gripper in the border
00364         if (m_dwStyle & CBRS_ORIENT_HORZ)
00365         {
00366             // Draw the first gripper.
00367             pDC->Draw3dRect( rect.left+CX_BORDER_GRIPPER, rect.top+m_cyTopBorder,
00368                 CX_GRIPPER, rect.Height()-m_cyTopBorder-m_cyBottomBorder,
00369                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00370         }
00371         else
00372         {
00373             // Draw the first gripper.
00374             pDC->Draw3dRect( rect.left+m_cyTopBorder, rect.top+CY_BORDER_GRIPPER,
00375                 rect.Width()-m_cyTopBorder-m_cyBottomBorder, CY_GRIPPER,
00376                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00377         }
00378
00379         GdiFlush();
00380     }
00381
00382     // by default, we will draw the "visual studio" style gripper.
00383     else
00384     if( m_dwStyle & CBRS_GRIPPER )
00385     {
00386         // draw the gripper in the border
00387         if (m_dwStyle & CBRS_ORIENT_HORZ)
00388         {
00389             // Draw the first gripper.
00390             pDC->Draw3dRect( rect.left+1, rect.top+2, 3, rect.Height()-4,
00391                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00392
00393             // Draw the second gripper.
00394             pDC->Draw3dRect( rect.left+5, rect.top+2, 3, rect.Height()-4,
00395                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00396         }
00397         else
00398         {
00399             // Draw the first gripper.
00400             pDC->Draw3dRect( rect.left+2, rect.top+1, rect.Width()-4, 3,
00401                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00402
00403             // Draw the second gripper.
00404             pDC->Draw3dRect( rect.left+2, rect.top+5, rect.Width()-4, 3,
00405                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00406         }
00407
00408         GdiFlush();
00409     }
00410 }
00411
00412 // input CRect should be client rectangle size
00413 void CCJToolBarBase::CalcInsideRect(CRect& rect, BOOL bHorz) const
00414 {
00415     ASSERT_VALID(this);
00416     DWORD dwStyle = m_dwStyle;
00417
00418     if (dwStyle & CBRS_BORDER_LEFT)
00419         rect.left += afxData.cxBorder2;
00420     if (dwStyle & CBRS_BORDER_TOP)
00421         rect.top += afxData.cyBorder2;
00422     if (dwStyle & CBRS_BORDER_RIGHT)
00423         rect.right -= afxData.cxBorder2;
00424     if (dwStyle & CBRS_BORDER_BOTTOM)
00425         rect.bottom -= afxData.cyBorder2;
00426
00427     // inset the top and bottom.
00428     if (bHorz)
00429     {
00430         rect.left += m_cxLeftBorder;
00431         rect.top += m_cyTopBorder;
00432         rect.right -= m_cxRightBorder;
00433         rect.bottom -= m_cyBottomBorder;
00434         if ((m_dwStyle & (CBRS_GRIPPER|CBRS_FLOATING)) == CBRS_GRIPPER)
00435         {
00436             rect.left += CX_BORDER_GRIPPER+CX_GRIPPER+CX_BORDER_GRIPPER;
00437
00438             if( m_bExStyle == true ) {
00439                 rect.left += CX_GRIPPER;
00440             }
00441
00442             if(( m_bExStyle == false ) && ( m_bInReBar == false )) {
00443                 rect.left -= CX_BORDER_GRIPPER+CX_GRIPPER;
00444             }
00445         }
00446     }
00447     else
00448     {
00449         rect.left += m_cyTopBorder;
00450         rect.top += m_cxLeftBorder;
00451         rect.right -= m_cyBottomBorder;
00452         rect.bottom -= m_cxRightBorder;
00453         if ((m_dwStyle & (CBRS_GRIPPER|CBRS_FLOATING)) == CBRS_GRIPPER)
00454         {
00455             rect.top += CY_BORDER_GRIPPER+CY_GRIPPER+CY_BORDER_GRIPPER;
00456
00457             if( m_bExStyle == true ) {
00458                 rect.top += CY_GRIPPER;
00459             }
00460
00461             if(( m_bExStyle == false ) && ( m_bInReBar == false )) {
00462                 rect.top -= CY_BORDER_GRIPPER+CY_GRIPPER;
00463             }
00464         }
00465     }
00466 }
00467
00469
00470 IMPLEMENT_DYNAMIC(CCJToolBarBase, CControlBar)
00471
Generated on Sun Feb 24 01:21:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJToolBarCtrl.cpp Source File

WinCvs/CJLib/CJLibrary/CJToolBarCtrl.cpp

Go to the documentation of this file.
00001 // CJToolBarCtrl.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Copied from MFC, Visual C++ 6, to extend functionality to Visual C++ 5
00006 // users, with some ideas taken from Luis Barreira's article 'Classes for new IE4 controls'
00007 // http://www.codeguru.com/controls/ie4_controls_classes.shtml
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:49 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJockey/CJLibrary/CJToolBarCtrl.cpp $
00015  *
00016  * $History: CJToolBarCtrl.cpp $
00017  *
00018  * *****************  Version 5  *****************
00019  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00020  * Updated in $/CodeJockey/CJLibrary
00021  * Updated copyright and contact information.
00022  *
00023  * *****************  Version 4  *****************
00024  * User: Kirk Stowell Date: 7/28/99    Time: 12:38a
00025  * Updated in $/CodeJockey/CJLibrary
00026  * Final pass for release 6.08.
00027  *
00028  * *****************  Version 3  *****************
00029  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00030  * Updated in $/CodeJockey/CJLibrary
00031  *
00032  * *****************  Version 2  *****************
00033  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00034  * Updated in $/CodeJockey/CJLibrary
00035  *
00036  * *****************  Version 1  *****************
00037  * User: Kirk Stowell Date: 7/14/99    Time: 10:29p
00038  * Created in $/CodeJockey/CJLibrary
00039  * Copied from MFC v6 and techno preview for v5. Added to extend
00040  * functionality to Visual C++ 5.0 users.
00041  *
00042  ***************************************************************************/
00043
00044 #include "stdafx.h"
00045 #include "CJToolBarCtrl.h"
00046
00047 #ifdef _DEBUG
00048 #define new DEBUG_NEW
00049 #undef THIS_FILE
00050 static char THIS_FILE[] = __FILE__;
00051 #endif
00052
00054 // CCJToolBarCtrl
00055
00056 CCJToolBarCtrl::~CCJToolBarCtrl()
00057 {
00058   DestroyWindow();
00059 }
00060
00061
00062 BEGIN_MESSAGE_MAP(CCJToolBarCtrl, CToolBarCtrl)
00063   //{{AFX_MSG_MAP(CCJToolBarCtrl)
00064   ON_WM_CREATE()
00065   //}}AFX_MSG_MAP
00066 END_MESSAGE_MAP()
00067
00069 // CCJToolBarCtrl message handlers
00070
00071 CCJToolBarCtrl::CCJToolBarCtrl()
00072 {
00073   // initialize common controls
00074   INITCOMMONCONTROLSEX icex;
00075   icex.dwSize = sizeof(icex);
00076   icex.dwICC = ICC_BAR_CLASSES;
00077   VERIFY(InitCommonControlsEx(&icex));
00078 }
00079
00080 BOOL CCJToolBarCtrl::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd,
00081                             UINT nID)
00082 {
00083   CWnd* pWnd = this;
00084   BOOL bCreated = pWnd->Create(TOOLBARCLASSNAME, NULL, dwStyle, rect, pParentWnd, nID);
00085
00086   return bCreated;
00087 }
00088
00089 int CCJToolBarCtrl::OnCreate(LPCREATESTRUCT lpcs)
00090 {
00091   if (CWnd::OnCreate(lpcs) == -1)
00092     return -1;
00093   SetButtonStructSize(sizeof(TBBUTTON));
00094   return 0;
00095 }
00096
00097 HRESULT CCJToolBarCtrl::GetDropTarget(IDropTarget** ppDropTarget) const
00098 {
00099   ASSERT(::IsWindow(m_hWnd));
00100   ASSERT(ppDropTarget);
00101   return (HRESULT) ::SendMessage(m_hWnd, TB_GETOBJECT, (WPARAM)&IID_IDropTarget, (LPARAM)ppDropTarget);
00102 }
Generated on Sun Feb 24 01:21:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJTreeCtrl.cpp Source File

WinCvs/CJLib/CJLibrary/CJTreeCtrl.cpp

Go to the documentation of this file.
00001 // CJTreeCtrl.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based on the CTreeView articles from http://www.codeguru.com/treeview
00006 //
00008 /****************************************************************************
00009  *
00010  * $Date: 1999/11/30 21:45:49 $
00011  * $Revision: 1.1.1.3 $
00012  * $Archive: /CodeJock/CJLibrary/CJTreeCtrl.cpp $
00013  *
00014  * $History: CJTreeCtrl.cpp $
00015  *
00016  * *****************  Version 6  *****************
00017  * User: Kirk Stowell Date: 10/30/99   Time: 1:54p
00018  * Updated in $/CodeJock/CJLibrary
00019  * Overrode OnEraseBkgnd(...) to handle flicker free drawing.
00020  *
00021  * *****************  Version 5  *****************
00022  * User: Kirk Stowell Date: 10/25/99   Time: 10:52p
00023  * Updated in $/CodeJock/CJLibrary
00024  * 21. Fixed bug with CCJTreeCtrl where searching for a string in the tree
00025  * and this string is currently selected, the method will return NULL.
00026  * Fixed bug where tree control item font was changed to a smaller font
00027  * than the previous font, part of the old font would still show.
00028  *
00029  * *****************  Version 4  *****************
00030  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00031  * Updated in $/CodeJock/CJLibrary
00032  * Fixed potential resource and memory leak problems.
00033  *
00034  * *****************  Version 3  *****************
00035  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00036  * Updated in $/CodeJockey/CJLibrary
00037  *
00038  * *****************  Version 2  *****************
00039  * User: Kirk Stowell Date: 6/23/99    Time: 12:06a
00040  * Updated in $/CodeJockey/CJLibrary
00041  *
00042  * *****************  Version 1  *****************
00043  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00044  * Created in $/CodeJockey/CJLibrary
00045  * Initial creation.
00046  *
00047  ***************************************************************************/
00049
00050 #include "stdafx.h"
00051 #include "CJResource.h"
00052 #include "CJTreeCtrl.h"
00053
00054 #ifdef _DEBUG
00055 #define new DEBUG_NEW
00056 #undef THIS_FILE
00057 static char THIS_FILE[] = __FILE__;
00058 #endif
00059
00061 // CCJTreeCtrl
00062
00063 CCJTreeCtrl::CCJTreeCtrl()
00064 {
00065     m_hItemFirstSel = NULL;
00066     m_dwDragStart   = NULL;
00067     m_bMultiSelect = FALSE;
00068 }
00069
00070 CCJTreeCtrl::~CCJTreeCtrl()
00071 {
00072 }
00073
00074 IMPLEMENT_DYNAMIC(CCJTreeCtrl, CTreeCtrl)
00075
00076 BEGIN_MESSAGE_MAP(CCJTreeCtrl, CTreeCtrl)
00077     //{{AFX_MSG_MAP(CCJTreeCtrl)
00078     ON_WM_PAINT()
00079     ON_WM_LBUTTONDOWN()
00080     ON_WM_ERASEBKGND()
00081     //}}AFX_MSG_MAP
00082 END_MESSAGE_MAP()
00083
00085 // CCJTreeCtrl message handlers
00086
00087 // Taken from: Get next item in outline by Zafir Anjum.
00088 // http://www.codeguru.com/treeview/get_next.shtml
00089
00090 // GetNextItem  - Get next item as if outline was completely expanded
00091 // Returns      - The item immediately below the reference item
00092 // hItem        - The reference item
00093 HTREEITEM CCJTreeCtrl::GetNextItem( HTREEITEM hItem )
00094 {
00095     HTREEITEM hti = NULL;
00096
00097     if (ItemHasChildren(hItem))
00098         hti = GetChildItem(hItem);
00099
00100     if (hti == NULL) {
00101         while ((hti = GetNextSiblingItem(hItem)) == NULL) {
00102             if ((hItem = GetParentItem(hItem)) == NULL)
00103                 return NULL;
00104         }
00105     }
00106     return hti;
00107 }
00108
00109 // Taken from: Get previous item in outline by Zafir Anjum.
00110 // http://www.codeguru.com/treeview/get_prev.shtml
00111
00112 // GetPrevItem  - Get previous item as if outline was completely expanded
00113 // Returns      - The item immediately above the reference item
00114 // hItem        - The reference item
00115 HTREEITEM CCJTreeCtrl::GetPrevItem( HTREEITEM hItem )
00116 {
00117     HTREEITEM       hti;
00118
00119     hti = GetPrevSiblingItem(hItem);
00120     if( hti == NULL )
00121         hti = GetParentItem(hItem);
00122     else
00123         hti = GetLastItem(hti);
00124     return hti;
00125 }
00126
00127 // Taken from: Get last item in branch by Zafir Anjum.
00128 // http://www.codeguru.com/treeview/get_last.shtml
00129
00130 // GetLastItem  - Gets last item in the branch
00131 // Returns      - Last item
00132 // hItem        - Node identifying the branch. NULL will
00133 //                return the last item in outine
00134 HTREEITEM CCJTreeCtrl::GetLastItem( HTREEITEM hItem )
00135 {
00136     //  Temporary used variable
00137     HTREEITEM   htiNext;
00138
00139     if( hItem == NULL ) {
00140         // Get the last item at the top level
00141         hItem = GetRootItem();
00142     }
00143
00144     while( ItemHasChildren( hItem ) != NULL ) {
00145         //  Find the last child of hItem
00146         htiNext = GetChildItem( hItem );
00147         while( htiNext != NULL ) {
00148             hItem = htiNext;
00149             htiNext = GetNextSiblingItem( htiNext );
00150         }
00151     }
00152
00153     return hItem;
00154
00155 }
00156
00157 // Taken from: Finding an item by Zafir Anjum.
00158 // http://www.codeguru.com/treeview/find_item.shtml
00159
00160 // FindItem     - Finds an item that contains the search string
00161 // Returns      - Handle to the item or NULL
00162 // str          - String to search for
00163 // bCaseSensitive   - Should the search be case sensitive
00164 // bDownDir     - Search direction - TRUE for down
00165 // bWholeWord       - True if search should match whole words
00166 // hItem        - Item to start searching from. NULL for
00167 //          - currently selected item
00168 HTREEITEM CCJTreeCtrl::FindItem(LPCTSTR lpszSearch,
00169                 BOOL bCaseSensitive /*= FALSE*/,
00170                 BOOL bDownDir /*= TRUE*/,
00171                 BOOL bWholeWord /*= FALSE*/,
00172                 HTREEITEM hItem /*= NULL*/)
00173 {
00174     CString str = lpszSearch;
00175
00176     int lenSearchStr = str.GetLength();
00177     if( lenSearchStr == 0 ) return NULL;
00178
00179     // For the first pass, set the current item equal to the selection
00180     HTREEITEM htiSel = hItem ? hItem : GetSelectedItem();
00181     HTREEITEM htiCur = htiSel;
00182     CString sSearch = str;
00183
00184     // make sure it ends if we started with no selection
00185     if(( htiCur == NULL ) && ( htiSel != NULL ))
00186     {
00187         if( bDownDir )
00188             htiCur = GetRootItem();
00189         else
00190             htiCur = GetLastItem( NULL );
00191     }
00192
00193     if( !bCaseSensitive )
00194         sSearch.MakeLower();
00195
00196     // For the first pass only, we check to see if it
00197     // is the item we're looking for.
00198     BOOL bFirstPass = TRUE;
00199
00200     while( htiCur && (htiCur != htiSel || bFirstPass) )
00201     {
00202         bFirstPass = FALSE;
00203
00204         CString sItemText = GetItemText( htiCur );
00205         if( !bCaseSensitive )
00206             sItemText.MakeLower();
00207
00208         int n;
00209         while( (n = sItemText.Find( sSearch )) != -1 )
00210         {
00211             // Search string found
00212             if( bWholeWord )
00213             {
00214                 // Check preceding char
00215                 if( n != 0 )
00216                 {
00217                     if( isalpha(sItemText[n-1]) ||
00218                             sItemText[n-1] == '_' ){
00219                         // Not whole word
00220                         sItemText = sItemText.Right(
00221                             sItemText.GetLength() - n -
00222                             lenSearchStr );
00223                         continue;
00224                     }
00225                 }
00226
00227                 // Check succeeding char
00228                 if( sItemText.GetLength() > n + lenSearchStr
00229                     && ( isalpha(sItemText[n+lenSearchStr]) ||
00230                     sItemText[n+lenSearchStr] == '_' ) )
00231                 {
00232                     // Not whole word
00233                     sItemText = sItemText.Right( sItemText.GetLength()
00234                             - n - sSearch.GetLength() );
00235                     continue;
00236                 }
00237             }
00238
00239             if( IsFindValid( htiCur ) )
00240                 return htiCur;
00241             else break;
00242         }
00243
00244
00245         htiCur = bDownDir ? GetNextItem( htiCur ) : GetPrevItem( htiCur );
00246         if( htiCur == NULL )
00247         {
00248             if( bDownDir )  htiCur = GetRootItem();
00249             else htiCur = GetLastItem( NULL );
00250         }
00251     }
00252     return NULL;
00253 }
00254
00255 // Taken from: Finding an item by Zafir Anjum.
00256 // http://www.codeguru.com/treeview/find_item.shtml
00257
00258 // IsFindValid  - Virtual function used by FindItem to allow this
00259 //        function to filter the result of FindItem
00260 // Returns  - True if item matches the criteria
00261 // Arg      - Handle of the item
00262 BOOL CCJTreeCtrl::IsFindValid( HTREEITEM )
00263 {
00264     return TRUE;
00265 }
00266
00267 BOOL CCJTreeCtrl::PreCreateWindow(CREATESTRUCT& cs)
00268 {
00269     if( !CTreeCtrl::PreCreateWindow(cs))
00270         return FALSE;
00271
00272     cs.style |= TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_SHOWSELALWAYS;
00273
00274     return TRUE;
00275 }
00276
00277 // Taken from: Setting color and font attribute for individual items by Zafir Anjum.
00278 // http://www.codeguru.com/treeview/item_color_font.shtml
00279
00280 void CCJTreeCtrl::SetItemFont(HTREEITEM hItem, LOGFONT& logfont)
00281 {
00282     Color_Font cf;
00283     if( !m_mapColorFont.Lookup( hItem, cf ) )
00284         cf.color = (COLORREF)-1;
00285     cf.logfont = logfont;
00286     m_mapColorFont[hItem] = cf;
00287 }
00288
00289 void CCJTreeCtrl::SetItemBold(HTREEITEM hItem, BOOL bBold)
00290 {
00291     SetItemState( hItem, bBold ? TVIS_BOLD: 0, TVIS_BOLD );
00292 }
00293
00294 void CCJTreeCtrl::SetItemColor(HTREEITEM hItem, COLORREF color)
00295 {
00296     Color_Font cf;
00297     if( !m_mapColorFont.Lookup( hItem, cf ) )
00298         cf.logfont.lfFaceName[0] = '\0';
00299     cf.color = color;
00300     m_mapColorFont[hItem] = cf;
00301 }
00302
00303 BOOL CCJTreeCtrl::GetItemFont(HTREEITEM hItem, LOGFONT * plogfont)
00304 {
00305     Color_Font cf;
00306     if( !m_mapColorFont.Lookup( hItem, cf ) )
00307         return FALSE;
00308     if( cf.logfont.lfFaceName[0] == '\0' )
00309         return FALSE;
00310     *plogfont = cf.logfont;
00311     return TRUE;
00312
00313 }
00314
00315 BOOL CCJTreeCtrl::GetItemBold(HTREEITEM hItem)
00316 {
00317     return GetItemState( hItem, TVIS_BOLD ) & TVIS_BOLD;
00318 }
00319
00320 COLORREF CCJTreeCtrl::GetItemColor(HTREEITEM hItem)
00321 {
00322     // Returns (COLORREF)-1 if color was not set
00323     Color_Font cf;
00324     if( !m_mapColorFont.Lookup( hItem, cf ) )
00325         return (COLORREF)-1;
00326     return cf.color;
00327
00328 }
00329
00330 void CCJTreeCtrl::OnPaint()
00331 {
00332     CPaintDC dc(this);
00333
00334     // Create a memory DC compatible with the paint DC
00335     CDC memDC;
00336     memDC.CreateCompatibleDC( &dc );
00337
00338     CRect rcClip, rcClient;
00339     dc.GetClipBox( &rcClip );
00340     GetClientRect(&rcClient);
00341
00342     // Select a compatible bitmap into the memory DC
00343     CBitmap bitmap;
00344     bitmap.CreateCompatibleBitmap( &dc, rcClient.Width(), rcClient.Height() );
00345     CBitmap* pOldBitmap = memDC.SelectObject( &bitmap );
00346
00347     // Set clip region to be same as that in paint DC
00348     CRgn rgn;
00349     rgn.CreateRectRgnIndirect( &rcClip );
00350     memDC.SelectClipRgn(&rgn);
00351     rgn.DeleteObject();
00352
00353     // First let the control do its default drawing.
00354     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00355
00356     HTREEITEM hItem = GetFirstVisibleItem();
00357
00358     int n = GetVisibleCount()+1;
00359     while( hItem && n--)
00360     {
00361         CRect rect;
00362
00363         // Do not meddle with selected items or drop highlighted items
00364         UINT selflag = TVIS_DROPHILITED | TVIS_SELECTED;
00365         Color_Font cf;
00366
00367         if ( !(GetItemState( hItem, selflag ) & selflag )
00368             && m_mapColorFont.Lookup( hItem, cf ))
00369         {
00370             CFont *pFontDC;
00371             CFont fontDC;
00372             LOGFONT logfont;
00373
00374             if( cf.logfont.lfFaceName[0] != '\0' )
00375             {
00376                 logfont = cf.logfont;
00377             }
00378             else
00379             {
00380                 // No font specified, so use window font
00381                 CFont *pFont = GetFont();
00382                 pFont->GetLogFont( &logfont );
00383             }
00384
00385             CString sItem = GetItemText( hItem );
00386             GetItemRect( hItem, &rect, TRUE );
00387
00388             // cover up over old font.
00389             CFont* pOldFont = memDC.SelectObject(GetFont());
00390             memDC.SetTextColor(::GetSysColor( COLOR_WINDOW ));
00391             memDC.SetBkColor( GetSysColor( COLOR_WINDOW ) );
00392             memDC.TextOut( rect.left+2, rect.top+1, sItem );
00393             memDC.SelectObject(pOldFont);
00394
00395             if( GetItemBold( hItem ) )
00396                 logfont.lfWeight = 700;
00397             fontDC.CreateFontIndirect( &logfont );
00398             pFontDC = memDC.SelectObject( &fontDC );
00399
00400             if( cf.color != (COLORREF)-1 )
00401                 memDC.SetTextColor( cf.color );
00402
00403             memDC.SetBkColor( GetSysColor( COLOR_WINDOW ) );
00404             memDC.TextOut( rect.left+2, rect.top+1, sItem );
00405
00406             memDC.SelectObject( pFontDC );
00407
00408             // fix potential resource leak - KStowell - 10-22-99.
00409             fontDC.DeleteObject();
00410         }
00411         hItem = GetNextVisibleItem( hItem );
00412     }
00413
00414
00415     dc.BitBlt( rcClip.left, rcClip.top, rcClip.Width(), rcClip.Height(), &memDC,
00416         rcClip.left, rcClip.top, SRCCOPY );
00417
00418     // fix potential resource leak - KStowell - 10-21-99
00419     memDC.SelectObject( pOldBitmap );
00420     memDC.DeleteDC();
00421     bitmap.DeleteObject();
00422 }
00423
00424 // Taken from: Allowing multiple selection by Zafir Anjum.
00425 // http://www.codeguru.com/treeview/multiple_sel.shtml
00426
00427 void CCJTreeCtrl::OnLButtonDown(UINT nFlags, CPoint point)
00428 {
00429     if(m_bMultiSelect)
00430     {
00431         // Set focus to control if key strokes are needed.
00432         // Focus is not automatically given to control on lbuttondown
00433
00434         m_dwDragStart = GetTickCount();
00435
00436         if(nFlags & MK_CONTROL )
00437         {
00438             // Control key is down
00439             UINT flag;
00440             HTREEITEM hItem = HitTest( point, &flag );
00441             if( hItem )
00442             {
00443                 // Toggle selection state
00444                 UINT uNewSelState =
00445                     GetItemState(hItem, TVIS_SELECTED) & TVIS_SELECTED ?
00446                     0 : TVIS_SELECTED;
00447
00448                 // Get old selected (focus) item and state
00449                 HTREEITEM hItemOld = GetSelectedItem();
00450                 UINT uOldSelState  = hItemOld ?
00451                     GetItemState(hItemOld, TVIS_SELECTED) : 0;
00452
00453                 // Select new item
00454                 if( GetSelectedItem() == hItem )
00455                     SelectItem( NULL );     // to prevent edit
00456                 CTreeCtrl::OnLButtonDown(nFlags, point);
00457
00458                 // Set proper selection (highlight) state for new item
00459                 SetItemState(hItem, uNewSelState,  TVIS_SELECTED);
00460
00461                 // Restore state of old selected item
00462                 if (hItemOld && hItemOld != hItem)
00463                     SetItemState(hItemOld, uOldSelState, TVIS_SELECTED);
00464
00465                 m_hItemFirstSel = NULL;
00466
00467                 return;
00468             }
00469         }
00470         else if(nFlags & MK_SHIFT)
00471         {
00472             // Shift key is down
00473             UINT flag;
00474             HTREEITEM hItem = HitTest( point, &flag );
00475
00476             // Initialize the reference item if this is the first shift selection
00477             if( !m_hItemFirstSel )
00478                 m_hItemFirstSel = GetSelectedItem();
00479
00480             // Select new item
00481             if( GetSelectedItem() == hItem )
00482                 SelectItem( NULL );         // to prevent edit
00483             CTreeCtrl::OnLButtonDown(nFlags, point);
00484
00485             if( m_hItemFirstSel )
00486             {
00487                 SelectItems( m_hItemFirstSel, hItem );
00488                 return;
00489             }
00490         }
00491         else
00492         {
00493             // Normal - remove all selection and let default
00494             // handler do the rest
00495             ClearSelection();
00496             m_hItemFirstSel = NULL;
00497         }
00498     }
00499
00500     CTreeCtrl::OnLButtonDown(nFlags, point);
00501 }
00502
00503 void CCJTreeCtrl::ClearSelection()
00504 {
00505     if(m_bMultiSelect)
00506     {
00507         // This can be time consuming for very large trees
00508         // and is called every time the user does a normal selection
00509         // If performance is an issue, it may be better to maintain
00510         // a list of selected items
00511         for ( HTREEITEM hItem=GetRootItem(); hItem!=NULL; hItem=GetNextItem( hItem ) )
00512             if ( GetItemState( hItem, TVIS_SELECTED ) & TVIS_SELECTED )
00513                 SetItemState( hItem, 0, TVIS_SELECTED );
00514     }
00515 }
00516
00517 // SelectItems  - Selects items from hItemFrom to hItemTo. Does not
00518 //      - select child item if parent is collapsed. Removes
00519 //      - selection from all other items
00520 // hItemFrom    - item to start selecting from
00521 // hItemTo  - item to end selection at.
00522 BOOL CCJTreeCtrl::SelectItems(HTREEITEM hItemFrom, HTREEITEM hItemTo)
00523 {
00524     if(m_bMultiSelect)
00525     {
00526         HTREEITEM hItem = GetRootItem();
00527
00528         // Clear selection upto the first item
00529         while ( hItem && hItem!=hItemFrom && hItem!=hItemTo )
00530         {
00531             hItem = GetNextVisibleItem( hItem );
00532             SetItemState( hItem, 0, TVIS_SELECTED );
00533         }
00534
00535         if ( !hItem )
00536             return FALSE;   // Item is not visible
00537
00538         SelectItem( hItemTo );
00539
00540         // Rearrange hItemFrom and hItemTo so that hItemFirst is at top
00541         if( hItem == hItemTo )
00542         {
00543             hItemTo = hItemFrom;
00544             hItemFrom = hItem;
00545         }
00546
00547
00548         // Go through remaining visible items
00549         BOOL bSelect = TRUE;
00550         while ( hItem )
00551         {
00552             // Select or remove selection depending on whether item
00553             // is still within the range.
00554             SetItemState( hItem, bSelect ? TVIS_SELECTED : 0, TVIS_SELECTED );
00555
00556             // Do we need to start removing items from selection
00557             if( hItem == hItemTo )
00558                 bSelect = FALSE;
00559
00560             hItem = GetNextVisibleItem( hItem );
00561         }
00562
00563         return TRUE;
00564     }
00565
00566     return FALSE;
00567 }
00568
00569 HTREEITEM CCJTreeCtrl::GetFirstSelectedItem()
00570 {
00571     if(m_bMultiSelect)
00572     {
00573         for ( HTREEITEM hItem = GetRootItem(); hItem!=NULL; hItem = GetNextItem( hItem ) )
00574             if ( GetItemState( hItem, TVIS_SELECTED ) & TVIS_SELECTED )
00575                 return hItem;
00576     }
00577
00578     return NULL;
00579 }
00580
00581 HTREEITEM CCJTreeCtrl::GetNextSelectedItem(HTREEITEM hItem)
00582 {
00583     if(m_bMultiSelect)
00584     {
00585         for ( hItem = GetNextItem( hItem ); hItem!=NULL; hItem = GetNextItem( hItem ) )
00586             if ( GetItemState( hItem, TVIS_SELECTED ) & TVIS_SELECTED )
00587                 return hItem;
00588     }
00589
00590     return NULL;
00591 }
00592
00593 HTREEITEM CCJTreeCtrl::GetPrevSelectedItem(HTREEITEM hItem)
00594 {
00595     if(m_bMultiSelect)
00596     {
00597         for ( hItem = GetPrevItem( hItem ); hItem!=NULL; hItem = GetPrevItem( hItem ) )
00598             if ( GetItemState( hItem, TVIS_SELECTED ) & TVIS_SELECTED )
00599                 return hItem;
00600     }
00601
00602     return NULL;
00603 }
00604
00605 BOOL CCJTreeCtrl::OnEraseBkgnd(CDC* pDC)
00606 {
00607     // KStowell - overridden for flicker-free drawing.
00608     UNUSED_ALWAYS(pDC);
00609     return TRUE;
00610 }
Generated on Sun Feb 24 01:21:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/CJWindowPlacement.cpp Source File

WinCvs/CJLib/CJLibrary/CJWindowPlacement.cpp

Go to the documentation of this file.
00001 // CJWindowPlacement.cpp : implementation file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/CJLibrary/CJWindowPlacement.cpp $
00011  *
00012  * $History: CJWindowPlacement.cpp $
00013  *
00014  * *****************  Version 7  *****************
00015  * User: Kirk Stowell Date: 10/25/99   Time: 10:52p
00016  * Updated in $/CodeJock/CJLibrary
00017  * Modified resource include for static builds.
00018  *
00019  * *****************  Version 6  *****************
00020  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00021  * Updated in $/CodeJockey/CJLibrary
00022  * Updated copyright and contact information.
00023  *
00024  * *****************  Version 5  *****************
00025  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00026  * Updated in $/CodeJockey/CJLibrary
00027  * Added Unicode compliance, thanks to Barry Burton for his help with
00028  * this.
00029  *
00030  *
00031  * *****************  Version 4  *****************
00032  * User: Kirk Stowell Date: 7/25/99    Time: 12:30a
00033  * Updated in $/CodeJockey/CJLibrary
00034  *
00035  * *****************  Version 3  *****************
00036  * User: Kirk Stowell Date: 6/11/99    Time: 10:15p
00037  * Updated in $/CodeJockey/CJ60Lib
00038  * Modified LoadWindowPos(...) to allow registry names to be directly
00039  * passed in.
00040  *
00041  * *****************  Version 2  *****************
00042  * User: Kirk Stowell Date: 6/11/99    Time: 9:41p
00043  * Updated in $/CodeJockey/CJ60Lib
00044  * Initial creation.
00045  *
00046  * *****************  Version 1  *****************
00047  * User: Kirk Stowell Date: 6/01/99    Time: 9:29p
00048  * Created in $/CodeJockey/CJ60Lib
00049  *
00050  ***************************************************************************/
00052
00053 #include "StdAfx.h"
00054 #include "CJResource.h"
00055 #include "CJWindowPlacement.h"
00056
00058 // CCJWindowPlacement
00059
00060 CCJWindowPlacement::CCJWindowPlacement()
00061 {
00062     length                  = sizeof( WINDOWPLACEMENT );
00063     flags                   = NULL;
00064     showCmd                 = SW_SHOWMAXIMIZED;
00065     ptMinPosition.x         = 0;
00066     ptMinPosition.y         = 0;
00067     ptMaxPosition.x         = 0;
00068     ptMaxPosition.y         = 0;
00069     rcNormalPosition.left   = 0;
00070     rcNormalPosition.top    = 0;
00071     rcNormalPosition.right  = 0;
00072     rcNormalPosition.bottom = 0;
00073 }
00074
00075 CCJWindowPlacement::~CCJWindowPlacement()
00076 {
00077 }
00078
00080
00081 void CCJWindowPlacement::SaveWindowPos(CFrameWnd *pFrameWnd)
00082 {
00083     ASSERT_VALID( pFrameWnd ); // must be valid.
00084
00085     // Get the current window position.
00086     pFrameWnd->GetWindowPlacement( this );
00087
00088     // Save position to registry.
00089     CString strBuffer;
00090     strBuffer.Format( m_strFormat,
00091         flags,
00092         showCmd,
00093         ptMinPosition.x,
00094         ptMinPosition.y,
00095         ptMaxPosition.x,
00096         ptMaxPosition.y,
00097         rcNormalPosition.left,
00098         rcNormalPosition.top,
00099         rcNormalPosition.right,
00100         rcNormalPosition.bottom);
00101
00102     AfxGetApp()->WriteProfileString( m_strSection, m_strWndPos, strBuffer );
00103 }
00104
00105 BOOL CCJWindowPlacement::LoadWindowPos( CFrameWnd* pFrameWnd, LPCTSTR lpszFormat/*=NULL*/, LPCTSTR lpszSection/*=NULL*/, LPCTSTR lpszWndPos/*=NULL*/ )
00106 {
00107     ASSERT_VALID( pFrameWnd ); // must be valid.
00108
00109     // load the strings for the registry.
00110     if( lpszFormat == NULL )
00111         m_strFormat.LoadString( IDS_WIN_PLACEMENT );
00112     else
00113         m_strFormat = lpszFormat;
00114
00115     if( lpszSection == NULL )
00116         m_strSection.LoadString( IDS_SETTINGS );
00117     else
00118         m_strSection = lpszSection;
00119
00120     if( lpszWndPos == NULL )
00121         m_strWndPos.LoadString( IDS_WNDPOS  );
00122     else
00123         m_strWndPos = lpszWndPos;
00124
00125     // Load the previous window placement settings.
00126     CString strBuffer = AfxGetApp()->GetProfileString( m_strSection, m_strWndPos, NULL );
00127
00128     int nRead = _stscanf( strBuffer, m_strFormat,
00129         &flags,
00130         &showCmd,
00131         &ptMinPosition.x,
00132         &ptMinPosition.y,
00133         &ptMaxPosition.x,
00134         &ptMaxPosition.y,
00135         &rcNormalPosition.left,
00136         &rcNormalPosition.top,
00137         &rcNormalPosition.right,
00138         &rcNormalPosition.bottom);
00139
00140     // Set the window position.
00141     if( nRead == 10 )
00142     {
00143         pFrameWnd->SetWindowPlacement( this );
00144         pFrameWnd->ShowWindow( showCmd );
00145         pFrameWnd->UpdateWindow();
00146         return TRUE;
00147     }
00148
00149     return FALSE;
00150 }
Generated on Sun Feb 24 01:21:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/GfxGroupEdit.cpp Source File

WinCvs/CJLib/CJLibrary/GfxGroupEdit.cpp

Go to the documentation of this file.
00001 // Copyright (c) Iuri Apollonio 1998
00002 // Use & modify as you want & need, and leave those 4 lines.
00003 // Strongly based on article "Inplace edit control" of Mario Contestabile and "Editable subitems" of Zafir
00004 // http://www.codeguru.com
00005 //
00006 // GfxGroupEdit.cpp : implementation file
00007 //
00009 /****************************************************************************
00010  *
00011  * $Date: 1999/11/30 21:45:49 $
00012  * $Revision: 1.1.1.2 $
00013  * $Archive: /CodeJock/CJLibrary/GfxGroupEdit.cpp $
00014  *
00015  * $History: GfxGroupEdit.cpp $
00016  *
00017  * *****************  Version 4  *****************
00018  * User: Kirk Stowell Date: 10/14/99   Time: 12:41p
00019  * Updated in $/CodeJock/CJLibrary
00020  * Added source control history to file header.
00021  *
00022  ***************************************************************************/
00024
00025 #include "stdafx.h"
00026 #include "GfxGroupEdit.h"
00027 #include "GfxOutBarCtrl.h"
00028
00029 #ifdef _DEBUG
00030 #define new DEBUG_NEW
00031 #undef THIS_FILE
00032 static char THIS_FILE[] = __FILE__;
00033 #endif
00034
00036 // CGfxGroupEdit
00037
00038 CGfxGroupEdit::CGfxGroupEdit()
00039 {
00040     bEscapeKey = FALSE;
00041     iIndex = -1;
00042     msgSend = NM_OB_ONGROUPENDEDIT;
00043     bNoDown = false;
00044 }
00045
00046 CGfxGroupEdit::~CGfxGroupEdit()
00047 {
00048 }
00049
00050
00051 BEGIN_MESSAGE_MAP(CGfxGroupEdit, CEdit)
00052     //{{AFX_MSG_MAP(CGfxGroupEdit)
00053     ON_WM_KILLFOCUS()
00054     ON_WM_CREATE()
00055     ON_WM_CHAR()
00056     //}}AFX_MSG_MAP
00057 END_MESSAGE_MAP()
00058
00060 // CGfxGroupEdit message handlers
00061
00062 void CGfxGroupEdit::OnKillFocus(CWnd* /*pNewWnd*/)
00063 {
00064     PostMessage(WM_CLOSE, 0, 0);
00065     if (!bEscapeKey)
00066     {
00067         GetWindowText(text);
00068         if (text != "") GetOwner()->SendMessage(WM_OUTBAR_NOTIFY, msgSend, (LPARAM) this);
00069     }
00070 }
00071
00072 BOOL CGfxGroupEdit::PreTranslateMessage(MSG* pMsg)
00073 {
00074     if (pMsg->wParam == VK_RETURN)
00075     {
00076         PostMessage(WM_CLOSE, 0, 0);
00077         return TRUE;
00078     }
00079     else if (pMsg->wParam == VK_ESCAPE)
00080     {
00081         PostMessage(WM_CLOSE, 0, 0);
00082         return bEscapeKey = TRUE;
00083     }
00084
00085     return CEdit::PreTranslateMessage(pMsg);
00086 }
00087
00088 void CGfxGroupEdit::PostNcDestroy()
00089 {
00090     CEdit::PostNcDestroy();
00091     delete this;
00092 }
00093
00094 int CGfxGroupEdit::OnCreate(LPCREATESTRUCT lpCreateStruct)
00095 {
00096     if (CEdit::OnCreate(lpCreateStruct) == -1)
00097         return -1;
00098
00099     SendMessage(WM_SETFONT,(WPARAM) GetStockObject(DEFAULT_GUI_FONT),MAKELPARAM(TRUE,0));
00100     return 0;
00101 }
00102
00103 void CGfxGroupEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
00104 {
00105     if (msgSend == NM_OB_ONGROUPENDEDIT)
00106     {
00107         CEdit::OnChar(nChar, nRepCnt, nFlags);
00108         return;
00109     }
00110
00111     if (nChar == VK_ESCAPE || nChar == VK_RETURN)
00112     {
00113         if (nChar == VK_ESCAPE) bEscapeKey = TRUE;
00114         GetParent()->SetFocus();
00115         return;
00116     }
00117     CEdit::OnChar(nChar, nRepCnt, nFlags);
00118     CString str;
00119     CRect rect, parentrect;
00120     GetClientRect(&rect);
00121     GetParent()->GetClientRect(&parentrect);
00122     ClientToScreen(&rect);
00123     GetParent()->ScreenToClient(&rect);
00124     GetWindowText(str);
00125     CWindowDC dc(this);
00126     CFont *pFont = GetParent()->GetFont();
00127     CFont *pFontDC = dc.SelectObject(pFont);
00128     CRect szrc(rect);
00129     szrc.bottom = szrc.top;
00130
00131     if (bNoDown == true)
00132     {
00133         dc.DrawText(str, szrc, DT_CALCRECT);
00134         if (szrc.right >= parentrect.right - 1) rect.right = parentrect.right - 1;
00135         else rect.right = szrc.right;
00136         MoveWindow(&rect);
00137         return;
00138     }
00139
00140     dc.DrawText(str, szrc, DT_WORDBREAK|DT_CENTER|DT_CALCRECT);
00141     dc.SelectObject(pFontDC);
00142     CSize size = szrc.Size();
00143
00144     if (size.cx > rect.Width())
00145     {
00146         if (size.cx + rect.left < parentrect.right) rect.right = rect.left + size.cx;
00147         else rect.right = parentrect.right;
00148         MoveWindow(&rect);
00149     }
00150     else if (size.cy > rect.Height())
00151     {
00152         if (size.cy + rect.bottom < parentrect.bottom) rect.bottom = rect.top + size.cy;
00153         else rect.bottom = parentrect.bottom;
00154         MoveWindow(&rect);
00155     }
00156 }
Generated on Sun Feb 24 01:21:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/GfxOutBarCtrl.cpp Source File

WinCvs/CJLib/CJLibrary/GfxOutBarCtrl.cpp

Go to the documentation of this file.
00001 // Copyright (c) Iuri Apollonio 1998
00002 // Use & modify as you want & need, and leave those 3 lines.
00003 // http://www.codeguru.com
00004 //
00005 // GfxOutBarCtrl.cpp : implementation file
00006 //
00008 /****************************************************************************
00009  *
00010  * $Date: 1999/11/30 21:45:49 $
00011  * $Revision: 1.1.1.3 $
00012  * $Archive: /CodeJock/CJLibrary/GfxOutBarCtrl.cpp $
00013  *
00014  * $History: GfxOutBarCtrl.cpp $
00015  *
00016  * *****************  Version 9  *****************
00017  * User: Kirk Stowell Date: 10/25/99   Time: 10:54p
00018  * Updated in $/CodeJock/CJLibrary
00019  * Added resource includes for static builds, type cast popup menu calls
00020  * to call CMenu base class.
00021  *
00022  * *****************  Version 8  *****************
00023  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00024  * Updated in $/CodeJock/CJLibrary
00025  * Fixed potential resource and memory leak problems.
00026  *
00027  * *****************  Version 7  *****************
00028  * User: Kirk Stowell Date: 10/14/99   Time: 12:41p
00029  * Updated in $/CodeJock/CJLibrary
00030  * Added source control history to file header.
00031  *
00032  ***************************************************************************/
00034
00035 #include "stdafx.h"
00036 #include "CJResource.h"
00037 #include "GfxOutBarCtrl.h"
00038 #include "GfxGroupEdit.h"
00039
00040 #include "CJMenu.h"        // CCJMenu class declaration
00041
00042 #ifdef _DEBUG
00043 #define new DEBUG_NEW
00044 #undef THIS_FILE
00045 static char THIS_FILE[] = __FILE__;
00046 #endif
00047
00049 // CGfxOutBarCtrl
00050
00051 IMPLEMENT_DYNCREATE(CGfxOutBarCtrl, CWnd)
00052
00053 CGfxOutBarCtrl::CGfxOutBarCtrl()
00054 {
00055     crBackGroundColor   = ::GetSysColor(COLOR_3DSHADOW);//RGB(0,128,128);//
00056     crBackGroundColor1  = ::GetSysColor(COLOR_3DSHADOW);
00057     crTextColor         = ::GetSysColor(COLOR_WINDOW);
00058     cr3dFace            = ::GetSysColor(COLOR_3DFACE);
00059     crLightBorder       = ::GetSysColor(COLOR_3DLIGHT);
00060     crHilightBorder     = ::GetSysColor(COLOR_3DHILIGHT);
00061     crShadowBorder      = ::GetSysColor(COLOR_3DSHADOW);
00062     crDkShadowBorder    = ::GetSysColor(COLOR_3DDKSHADOW);
00063
00064     pBlackPen = new CPen(PS_SOLID, 1, RGB(0,0,0));
00065
00066     iFolderHeight = 22;
00067
00068     dwFlags = fDragItems|fEditGroups|fEditItems|fRemoveGroups|fRemoveItems|fAddGroups|fAnimation|fSelHighlight;
00069
00070     iSelFolder = 0;
00071
00072     iLastFolderHighlighted = -1;
00073     iLastSelectedFolder = -1;
00074
00075     pLargeImageList = NULL;
00076     pSmallImageList = NULL;
00077
00078     iFirstItem = 0;
00079
00080     xSmallIconLabelOffset = 4;
00081     yLargeIconLabelOffset = 3;
00082
00083     ySmallIconSpacing = 10;
00084     yLargeIconSpacing = 8;
00085
00086     xLeftMargin = 5;
00087     yTopMargin = 5;
00088
00089     bUpArrow = bDownArrow = false;
00090
00091     hHandCursor = AfxGetApp()->LoadCursor(IDC_HANDCUR);
00092     rcUpArrow = rcDownArrow = CRect(0,0,0,0);
00093
00094     bUpPressed = bDownPressed = false;
00095
00096     bLooping = false;
00097
00098     iLastItemHighlighted = -1;
00099     bPressedHighlight = false;
00100
00101     iLastDragItemDraw = -1;
00102
00103     lAnimationTickCount = 10;
00104
00105     hDragCursor = AfxGetApp()->LoadCursor(IDC_DRAGGING);
00106     hNoDragCursor = AfxGetApp()->LoadCursor(IDC_NODRAGGING);
00107
00108     iLastSel = -1;
00109     iSelAnimCount = 0;
00110
00111     iSelAnimTiming = 0;
00112
00113     m_strRemoveItem.LoadString(IDS_REMOVEITEM);
00114     m_strRenameItem.LoadString(IDS_RENAMEITEM);
00115 }
00116
00117 CGfxOutBarCtrl::~CGfxOutBarCtrl()
00118 {
00119     for (int t = 0; t < arFolder.GetSize(); t++)
00120     {
00121         if (arFolder.GetAt(t)) delete (CBarFolder*) arFolder.GetAt(t);
00122     }
00123
00124     arFolder.RemoveAll();
00125
00126     delete pBlackPen;
00127 }
00128
00129
00130 BEGIN_MESSAGE_MAP(CGfxOutBarCtrl, CWnd)
00131     //{{AFX_MSG_MAP(CGfxOutBarCtrl)
00132     ON_WM_CREATE()
00133     ON_WM_TIMER()
00134     ON_WM_PAINT()
00135     ON_WM_ERASEBKGND()
00136     ON_WM_MOUSEMOVE()
00137     ON_WM_LBUTTONDOWN()
00138     ON_WM_SETCURSOR()
00139     ON_WM_SIZE()
00140     ON_WM_RBUTTONDOWN()
00141     ON_COMMAND(ID_GFX_LARGEICON, OnGfxLargeicon)
00142     ON_UPDATE_COMMAND_UI(ID_GFX_LARGEICON, OnUpdateGfxLargeicon)
00143     ON_COMMAND(ID_GFX_SMALLICON, OnGfxSmallicon)
00144     ON_UPDATE_COMMAND_UI(ID_GFX_SMALLICON, OnUpdateGfxSmallicon)
00145     ON_COMMAND(ID_GFX_REMOVEITEM, OnGfxRemoveitem)
00146     ON_UPDATE_COMMAND_UI(ID_GFX_REMOVEITEM, OnUpdateGfxRemoveitem)
00147     ON_COMMAND(ID_GFX_RENAMEITEM, OnGfxRenameitem)
00148     ON_UPDATE_COMMAND_UI(ID_GFX_RENAMEITEM, OnUpdateGfxRenameitem)
00149     ON_WM_SYSCOLORCHANGE()
00150     //}}AFX_MSG_MAP
00151     ON_MESSAGE(WM_OUTBAR_NOTIFY, OnEndLabelEdit)
00152 END_MESSAGE_MAP()
00153
00154
00156 // CGfxOutBarCtrl message handlers
00157
00158 long CGfxOutBarCtrl::OnEndLabelEdit(WPARAM wParam, LPARAM lParam)
00159 {
00160     if (wParam == NM_OB_ONGROUPENDEDIT)
00161     {
00162         CGfxGroupEdit* pEdit = (CGfxGroupEdit*) lParam;
00163
00164         OUTBAR_INFO ob;
00165
00166         ob.index = pEdit->iIndex;
00167         ob.cText = (LPCTSTR) pEdit->text;
00168
00169         if (GetOwner()->SendMessage(WM_OUTBAR_NOTIFY, NM_OB_ONGROUPENDEDIT, (LPARAM) &ob))
00170         {
00171             SetFolderText(pEdit->iIndex, pEdit->text);
00172             CRect rc;
00173             GetFolderRect(pEdit->iIndex, rc);
00174             InvalidateRect(rc, false);
00175         }
00176     }
00177
00178     if (wParam == NM_OB_ONLABELENDEDIT)
00179     {
00180         CGfxGroupEdit * pEdit = (CGfxGroupEdit *) lParam;
00181         OUTBAR_INFO ob;
00182         ob.index = pEdit->iIndex;
00183         ob.cText = pEdit->text;
00184
00185         if (GetOwner()->SendMessage(WM_OUTBAR_NOTIFY, NM_OB_ONLABELENDEDIT, (LPARAM) &ob))
00186         {
00187             SetItemText(pEdit->iIndex, pEdit->text);
00188             CRect rc;
00189             GetInsideRect(rc);
00190             InvalidateRect(rc, true);
00191         }
00192     }
00193
00194     return 0;
00195 }
00196
00197 void CGfxOutBarCtrl::SetFolderText( const int index, LPCTSTR text )
00198 {
00199     ASSERT(index >= 0 && index < GetFolderCount());
00200
00201     CBarFolder* pbf = (CBarFolder *) arFolder.GetAt(index);
00202
00203     if( pbf->cName )
00204     {
00205         delete [] pbf->cName;
00206         pbf->cName = NULL;
00207     }
00208
00209     pbf->cName = new TCHAR[ _tcslen( text ) + 1 ];
00210
00211     _tcscpy( pbf->cName, text );
00212 }
00213
00214 void CGfxOutBarCtrl::SetItemText( const int index, LPCTSTR text )
00215 {
00216     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
00217
00218     CBarFolder* pbf = (CBarFolder*) arFolder.GetAt(iSelFolder);
00219
00220     CBarItem*   pi  = (CBarItem*) pbf->arItems.GetAt(index);
00221
00222     if (pi->cItem)
00223     {
00224         delete [] pi->cItem;
00225         pi->cItem = NULL;
00226     }
00227
00228     pi->cItem = new TCHAR[ _tcslen( text ) + 1 ];
00229
00230     _tcscpy( pi->cItem, text );
00231 }
00232
00233 BOOL CGfxOutBarCtrl::Create(DWORD dwStyle, const RECT & rect, CWnd * pParentWnd, UINT nID, const DWORD dwFlag)
00234 {
00235     dwFlags = dwFlag;
00236     return CWnd::CreateEx(WS_EX_STATICEDGE, NULL, NULL, dwStyle|WS_CHILD, rect, pParentWnd, nID);
00237     //GFXOUTBARCTRL_CLASSNAME
00238 }
00239
00240 bool CGfxOutBarCtrl::IsSmallIconView() const
00241 {
00242     return dwFlags&fSmallIcon;
00243 }
00244
00245 void CGfxOutBarCtrl::SetSmallIconView(const bool bSet)
00246 {
00247     iFirstItem = 0;
00248
00249     if (bSet)
00250     {
00251         if (!IsSmallIconView())
00252         {
00253             dwFlags |= fSmallIcon;
00254             CRect rc;
00255             GetInsideRect(rc);
00256             InvalidateRect(rc, false);
00257         }
00258     }
00259     else
00260     {
00261         if (IsSmallIconView())
00262         {
00263             dwFlags &= ~fSmallIcon;
00264             CRect rc;
00265             GetInsideRect(rc);
00266             InvalidateRect(rc, false);
00267         }
00268     }
00269 }
00270
00271 DWORD CGfxOutBarCtrl::GetFlag() const
00272 {
00273     return dwFlags;
00274 }
00275
00276 void CGfxOutBarCtrl::ModifyFlag(const DWORD & dwRemove, const DWORD & dwAdd, const UINT redraw)
00277 {
00278     if (dwRemove)   dwFlags &= ~(dwRemove);
00279     if (dwAdd)      dwFlags |= dwAdd;
00280
00281     if (GetSafeHwnd())
00282     {
00283         if (redraw != 0) SetWindowPos(0,0,0,0,0,SWP_NOZORDER|SWP_NOSIZE|SWP_NOMOVE|redraw);
00284         else Invalidate();
00285     }
00286 }
00287
00288 int CGfxOutBarCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
00289 {
00290     if (CWnd::OnCreate(lpCreateStruct) == -1)
00291         return -1;
00292
00293     // TODO: Add your specialized creation code here
00294
00295     return 0;
00296 }
00297
00298 void CGfxOutBarCtrl::OnTimer(UINT nIDEvent)
00299 {
00300     if (nIDEvent == 1)
00301     {
00302         CPoint pt(GetMessagePos());
00303
00304         ScreenToClient(&pt);
00305
00306         CRect rc;
00307         GetClientRect(&rc);
00308         if (!(rc.PtInRect(pt)))
00309         {
00310             HighlightFolder(-1);
00311             HighlightItem(-1);
00312             KillTimer(1);
00313         }
00314     }
00315     else if (nIDEvent == 3 && iLastSel >= 0)
00316     {
00317         iSelAnimCount ++;
00318         if (iSelAnimCount > 10) iSelAnimCount = -1;
00319         if (iSelAnimCount == 0)
00320             DrawAnimItem(-1, 1, iLastSel);
00321         if (iSelAnimCount == 1)
00322             DrawAnimItem(0, 0, iLastSel);
00323         if (iSelAnimCount == 2)
00324             DrawAnimItem(1, 1, iLastSel);
00325         if (iSelAnimCount == 3)
00326             DrawAnimItem(0, 0, iLastSel);
00327     }
00328     CWnd::OnTimer(nIDEvent);
00329 }
00330
00331 void CGfxOutBarCtrl::DrawAnimItem(const int xoffset, const int yoffset, const int index)
00332 {
00333     CImageList * ima = GetFolderImageList(iSelFolder, IsSmallIconView());
00334
00335     CRect rc, irc;
00336     GetInsideRect(irc);
00337     GetItemRect(iSelFolder, iLastSel, rc);
00338
00339     if (iLastSel >= iFirstItem && irc.bottom > rc.bottom && irc.top < rc.top)
00340     {
00341         ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
00342         CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
00343
00344         ASSERT(index >= 0 && index < pbf->GetItemCount());
00345         CBarItem * pi = (CBarItem *) pbf->arItems.GetAt(index);
00346
00347         ASSERT(pi && ima);
00348
00349         CClientDC dc(this);
00350
00351         if (IsSmallIconView())
00352         {
00353             if (ima)
00354             {
00355                 IMAGEINFO ii;
00356                 ima->GetImageInfo(pi->iImageIndex, &ii);
00357                 CSize szImage = CRect(ii.rcImage).Size();
00358                 CPoint pt;
00359                 pt.x = rc.left + 2;
00360                 pt.y = rc.top + (rc.Height() - szImage.cy) / 2;
00361
00362                 CRect rcBck(pt.x-1, pt.y-1, pt.x + szImage.cx+2, pt.y + szImage.cy+2);
00363                 dc.FillSolidRect(rcBck, crBackGroundColor);
00364
00365                 pt.x += xoffset;
00366                 pt.y += yoffset;
00367
00368                 ima->Draw(&dc, pi->iImageIndex, pt, ILD_NORMAL);
00369
00370             }
00371         }
00372         else
00373         {
00374             if (ima)
00375             {
00376                 IMAGEINFO ii;
00377                 ima->GetImageInfo(pi->iImageIndex, &ii);
00378                 CSize szImage = CRect(ii.rcImage).Size();
00379                 CPoint pt;
00380                 pt.x = rc.left + (rc.Width() - szImage.cx) / 2;
00381                 pt.y = rc.top;
00382
00383                 CRect rcBck(pt.x-1, pt.y-1, pt.x + szImage.cx+2, pt.y + szImage.cy+2);
00384                 dc.FillSolidRect(rcBck, crBackGroundColor);
00385
00386                 pt.x += xoffset;
00387                 pt.y += yoffset;
00388
00389                 ima->Draw(&dc, pi->iImageIndex, pt, ILD_NORMAL);
00390             }
00391         }
00392     }
00393 }
00394
00395 void CGfxOutBarCtrl::OnPaint()
00396 {
00397     CRect clientRc;
00398     GetClientRect(&clientRc);
00399     CPaintDC dc(this);
00400     CDC memDC;
00401     memDC.CreateCompatibleDC(&dc);
00402     CBitmap bmp;
00403     bmp.CreateCompatibleBitmap(&dc, clientRc.Width(), clientRc.Height());
00404     CBitmap * obmp = memDC.SelectObject(&bmp);
00405
00406     CDC * pDC = &memDC;
00407
00408     CRect rc;
00409     GetInsideRect(rc);
00410     if (!GetFolderChild()) pDC->FillSolidRect(rc, crBackGroundColor);
00411
00412
00413     int max = arFolder.GetSize();
00414     CRect frc;
00415     for (int t = 0; t < max; t++)
00416     {
00417         GetFolderRect(t, frc);
00418         DrawFolder(pDC, t, frc, false);
00419     }
00420     if (!GetFolderChild())
00421     {
00422         int f,l;
00423         GetVisibleRange(iSelFolder, f,l);
00424         rcUpArrow.SetRect(0,0,GetSystemMetrics(SM_CXVSCROLL), GetSystemMetrics(SM_CXVSCROLL));
00425         rcDownArrow = rcUpArrow;
00426         rcUpArrow.OffsetRect(rc.right - 5 - GetSystemMetrics(SM_CXVSCROLL), rc.top +5);
00427         rcDownArrow.OffsetRect(rc.right - 5 - GetSystemMetrics(SM_CXVSCROLL), rc.bottom - 5 - GetSystemMetrics(SM_CXVSCROLL));
00428
00429         if (f > 0)
00430         {
00431             if (bUpPressed) pDC->DrawFrameControl(rcUpArrow, DFC_SCROLL, DFCS_SCROLLUP|DFCS_PUSHED);
00432             else pDC->DrawFrameControl(rcUpArrow, DFC_SCROLL, DFCS_SCROLLUP);
00433             bUpArrow = true;
00434             pDC->ExcludeClipRect(rcUpArrow);
00435         }
00436         else bUpArrow = false;
00437
00438         if (l < GetItemCount() - 1)
00439         {
00440             if (bDownPressed) pDC->DrawFrameControl(rcDownArrow, DFC_SCROLL, DFCS_SCROLLDOWN|DFCS_PUSHED);
00441             else pDC->DrawFrameControl(rcDownArrow, DFC_SCROLL, DFCS_SCROLLDOWN);
00442             bDownArrow = true;
00443             pDC->ExcludeClipRect(rcDownArrow);
00444         }
00445         else bDownArrow = false;
00446
00447         PaintItems(pDC, iSelFolder, rc);
00448     }
00449
00450     dc.BitBlt(clientRc.left, clientRc.top, clientRc.Width(), clientRc.Height(), &memDC, 0,0, SRCCOPY);
00451
00452     memDC.SelectObject(obmp);
00453
00454     if (iLastFolderHighlighted >= 0)
00455     {
00456         int i = iLastFolderHighlighted;
00457         iLastFolderHighlighted = -1;
00458         HighlightFolder(i);
00459     }
00460     if (iLastItemHighlighted >= 0)
00461     {
00462         int i = iLastItemHighlighted;
00463         iLastItemHighlighted = -1;
00464         HighlightItem(i, bPressedHighlight);
00465     }
00466
00467     // fix potential resource leak - KStowell - 10-21-99
00468     memDC.DeleteDC();
00469     bmp.DeleteObject();
00470 }
00471
00472 BOOL CGfxOutBarCtrl::OnEraseBkgnd(CDC* /*pDC*/)
00473 {
00474     return true;
00475 }
00476
00477 bool CGfxOutBarCtrl::GetFolderRect(const int iIndex, CRect & rect) const
00478 {
00479     int max = arFolder.GetSize();
00480     ASSERT(iIndex >= 0 && iIndex < max);
00481
00482     if (iIndex >= 0 && iIndex < max)
00483     {
00484         CRect rc;
00485         GetClientRect(rc);
00486         if (iIndex > iSelFolder)
00487             rect.SetRect(rc.left, rc.bottom - ((max - iIndex)) * iFolderHeight, rc.right,
00488             rc.bottom - (max - iIndex - 1) * iFolderHeight);
00489         else
00490             rect.SetRect(rc.left, rc.top + iIndex * iFolderHeight - 1, rc.right,
00491             rc.top + (1 + iIndex) * iFolderHeight - 1);
00492         return true;
00493     }
00494     return false;
00495 }
00496
00497 void CGfxOutBarCtrl::GetItemRect(const int iFolder, const int iIndex, CRect & rect)
00498 {
00499     CRect rc;
00500     GetInsideRect(rc);
00501     int top = rc.top;
00502     CSize sz(0,0);
00503     int y = 0;
00504     for (int t = 0; t < iIndex; t++)
00505     {
00506         sz = GetItemSize(iFolder, t, ircAll);
00507         top += sz.cy;
00508
00509         if (IsSmallIconView())
00510         {
00511             top += ySmallIconSpacing;
00512         }
00513         else
00514         {
00515             top += yLargeIconSpacing;
00516         }
00517         if (t == iFirstItem - 1) y = top - rc.top;
00518     }
00519     sz = GetItemSize(iFolder, iIndex, ircAll);
00520     rect.SetRect(rc.left, top, rc.left + sz.cx, top + sz.cy);
00521
00522     rect.top -= y;
00523     rect.bottom -= y;
00524
00525     rect.left += xLeftMargin;
00526     rect.top  += yTopMargin;
00527     rect.bottom += yTopMargin;
00528
00529     if (!IsSmallIconView())
00530     {
00531         rect.left = rc.left;
00532         rect.right = rc.right;
00533     }
00534 }
00535
00536 void CGfxOutBarCtrl::DrawFolder(CDC * pDC, const int iIdx, CRect rect, const bool bSelected)
00537 {
00538     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iIdx);
00539
00540     if (!bSelected)
00541     {
00542         CPen pn1(PS_SOLID, 1, crBackGroundColor1);
00543         CPen * op = pDC->SelectObject(&pn1);
00544         pDC->MoveTo(rect.left, rect.top);
00545         pDC->LineTo(rect.right, rect.top);
00546         pDC->SelectObject(op);
00547
00548         // fix potential resource leak - KStowell - 10-21-99
00549         pn1.DeleteObject();
00550
00551         rect.top ++;
00552
00553         pDC->Draw3dRect(rect, crHilightBorder, crBackGroundColor1);
00554         rect.InflateRect(-1,-1);
00555         pDC->FillSolidRect(rect, cr3dFace);
00556         int obk = pDC->SetBkMode(TRANSPARENT);
00557         CFont * of = pDC->SelectObject(CFont::FromHandle((HFONT)GetStockObject(DEFAULT_GUI_FONT)));
00558         pDC->DrawText(CString(pbf->cName), rect, DT_CENTER|DT_VCENTER|DT_SINGLELINE);
00559         pDC->SetBkMode(obk);
00560         pDC->SelectObject(of);
00561     }
00562     else
00563     {
00564         CPen pn1(PS_SOLID, 1, crBackGroundColor1);
00565         CPen * op = pDC->SelectObject(&pn1);
00566         pDC->MoveTo(rect.left+1, rect.top);
00567         pDC->LineTo(rect.right, rect.top);
00568         pDC->SelectObject(op);
00569
00570         // fix potential resource leak - KStowell - 10-21-99
00571         pn1.DeleteObject();
00572
00573         rect.top ++;
00574
00575         pDC->Draw3dRect(rect, crDkShadowBorder, crHilightBorder);
00576         rect.InflateRect(-1,-1);
00577         pDC->Draw3dRect(rect, crBackGroundColor1, cr3dFace);
00578         rect.InflateRect(-1,-1);
00579
00580         pDC->FillSolidRect(rect, cr3dFace);
00581
00582         int obk = pDC->SetBkMode(TRANSPARENT);
00583         CFont * of = pDC->SelectObject(CFont::FromHandle((HFONT)GetStockObject(DEFAULT_GUI_FONT)));
00584         pDC->DrawText(CString(pbf->cName), rect, DT_CENTER|DT_VCENTER|DT_SINGLELINE);
00585         pDC->SetBkMode(obk);
00586         pDC->SelectObject(of);
00587     }
00588 }
00589
00590 int CGfxOutBarCtrl::AddFolder( LPCTSTR cFolderName, const DWORD exData )
00591 {
00592     CBarFolder* pbf = new CBarFolder(cFolderName, exData);
00593
00594     ASSERT(pbf);
00595
00596     arFolder.Add((void *)pbf);
00597
00598     return arFolder.GetSize() - 1;
00599 }
00600
00601 CGfxOutBarCtrl::CBarFolder::CBarFolder( LPCTSTR name, DWORD exData)
00602 {
00603     cName  = NULL;
00604     dwData = exData;
00605
00606     if( name )
00607     {
00608         cName = new TCHAR[ _tcslen( name ) + 1 ];
00609
00610         ASSERT(cName);
00611
00612         _tcscpy( cName, name );
00613     }
00614
00615     pLargeImageList = NULL;
00616     pSmallImageList = NULL;
00617     pChild          = NULL;
00618 }
00619
00620 CGfxOutBarCtrl::CBarFolder::~CBarFolder()
00621 {
00622     if (cName) delete [] cName;
00623     for (int t = 0; t < arItems.GetSize(); t++)
00624         if (arItems.GetAt(t)) delete (CBarFolder*) arItems.GetAt(t);
00625
00626     arItems.RemoveAll();
00627 }
00628
00629 void CGfxOutBarCtrl::GetInsideRect(CRect & rect) const
00630 {
00631     GetClientRect(rect);
00632     if (arFolder.GetSize() > 0)
00633     {
00634         int max = arFolder.GetSize();
00635         rect.top += iFolderHeight * (iSelFolder + 1) - 1;//+ 2;
00636         rect.bottom -= (max - iSelFolder - 1)*iFolderHeight;
00637         return;
00638     }
00639 }
00640
00641 void CGfxOutBarCtrl::OnMouseMove(UINT nFlags, CPoint point)
00642 {
00643     int index, ht = HitTestEx(point, index);
00644
00645     if (ht != htFolder && iLastFolderHighlighted >= 0) HighlightFolder(-1);
00646     if (ht != htItem   && iLastItemHighlighted   >= 0) HighlightItem(-1);
00647
00648     if (ht == htFolder)
00649     {
00650         HighlightFolder(index);
00651         SetTimer(1,100,NULL);
00652     }
00653     else if (ht == htItem)
00654     {
00655         HighlightItem(index);
00656         SetTimer(1,100,NULL);
00657     }
00658
00659     CWnd::OnMouseMove(nFlags, point);
00660 }
00661
00662 int CGfxOutBarCtrl::HitTestEx(const CPoint & point, int &index)
00663 {
00664     if (bUpArrow && rcUpArrow.PtInRect(point)) return htUpScroll;
00665     if (bDownArrow && rcDownArrow.PtInRect(point)) return htDownScroll;
00666
00667     int max = arFolder.GetSize(), t;
00668
00669     CRect rc;
00670     for (t = 0; t < max; t++)
00671     {
00672         GetFolderRect(t, rc);
00673         if (rc.PtInRect(point))
00674         {
00675             index = t;
00676             return htFolder;
00677         }
00678     }
00679     GetInsideRect(rc);
00680     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
00681     max = pbf->GetItemCount();
00682     for (t = iFirstItem; t < max; t++)
00683     {
00684         CRect itemRc;
00685         if (!IsSmallIconView())
00686         {
00687             GetIconRect(iSelFolder, t, itemRc);
00688             if (itemRc.PtInRect(point))
00689             {
00690                 index = t;
00691                 return htItem;
00692             }
00693             else if (itemRc.top > rc.bottom) break;
00694             GetLabelRect(iSelFolder, t, itemRc);
00695             itemRc.top -= yLargeIconLabelOffset;
00696
00697             if (itemRc.PtInRect(point))
00698             {
00699                 index = t;
00700                 return htItem;
00701             }
00702             else if (itemRc.top > rc.bottom) break;
00703         }
00704         else
00705         {
00706             GetItemRect(iSelFolder, t, itemRc);
00707             if (itemRc.PtInRect(point))
00708             {
00709                 index = t;
00710                 return htItem;
00711             }
00712             else if (itemRc.top > rc.bottom) break;
00713         }
00714     }
00715     return htNothing;
00716 }
00717
00718 void CGfxOutBarCtrl::HighlightFolder(const int index)
00719 {
00720     CWnd * pf = GetFocus();
00721     if (pf != NULL && pf != this && IsChild(pf)) return;
00722
00723     if (iLastFolderHighlighted == index) return;
00724
00725     if (iLastFolderHighlighted >= 0)
00726     {
00727         CRect rc;
00728         if (GetFolderRect(iLastFolderHighlighted, rc))
00729         {
00730             CClientDC dc(this);
00731             CPen pn(PS_SOLID, 1, crBackGroundColor1);//crShadowBorder);
00732             CPen * op = dc.SelectObject(&pn);
00733             dc.MoveTo(rc.left, rc.bottom-1);
00734             dc.LineTo(rc.right-1, rc.bottom-1);
00735             dc.LineTo(rc.right-1, rc.top);
00736             CPen pn1(PS_SOLID, 1, cr3dFace);
00737             dc.SelectObject(&pn1);
00738             dc.MoveTo(rc.left+1, rc.bottom-2);
00739             dc.LineTo(rc.right-2, rc.bottom-2);
00740             dc.LineTo(rc.right-2, rc.top+1);
00741             dc.SelectObject(op);
00742
00743             // fix potential resource leak - KStowell - 10-21-99
00744             pn.DeleteObject();
00745         }
00746     }
00747     iLastFolderHighlighted = index;
00748     if (iLastFolderHighlighted >= 0)
00749     {
00750         CRect rc;
00751         if (GetFolderRect(iLastFolderHighlighted, rc))
00752         {
00753             CClientDC dc(this);
00754             CPen pn(PS_SOLID, 1, crDkShadowBorder);
00755             CPen * op = dc.SelectObject(&pn);
00756             dc.MoveTo(rc.left, rc.bottom-1);
00757             dc.LineTo(rc.right-1, rc.bottom-1);
00758             dc.LineTo(rc.right-1, rc.top);
00759             CPen pn1(PS_SOLID, 1, crBackGroundColor1);
00760             dc.SelectObject(&pn1);
00761             dc.MoveTo(rc.left+1, rc.bottom-2);
00762             dc.LineTo(rc.right-2, rc.bottom-2);
00763             dc.LineTo(rc.right-2, rc.top+1);
00764             dc.SelectObject(op);
00765
00766             // fix potential resource leak - KStowell - 10-21-99
00767             pn.DeleteObject();
00768         }
00769     }
00770 }
00771
00772 void CGfxOutBarCtrl::OnLButtonDown(UINT nFlags, CPoint point)
00773 {
00774     if (GetFocus() != this) SetFocus();
00775
00776     int index, ht = HitTestEx(point, index);
00777     iLastDragItemDrawType = -1;
00778
00779     CRect inRc;
00780     GetInsideRect(inRc);
00781
00782     if (ht == htFolder)
00783     {
00784         bool bHigh = true;
00785         CRect rc;
00786         GetFolderRect(index, rc);
00787
00788         if (::GetCapture() == NULL)
00789         {
00790             SetCapture();
00791             ASSERT(this == GetCapture());
00792             CClientDC dc(this);
00793             DrawFolder(&dc, index, rc, true);
00794             AfxLockTempMaps();
00795             for (;;)
00796             {
00797                 MSG msg;
00798                 VERIFY(::GetMessage(&msg, NULL, 0, 0));
00799
00800                 if (CWnd::GetCapture() != this) break;
00801
00802                 switch (msg.message)
00803                 {
00804                 case WM_MOUSEMOVE:
00805                     {
00806                         CPoint pt(msg.lParam);
00807                         int idx, ht1 = HitTestEx(pt, idx);
00808                         if (ht1 == htFolder && idx == index)
00809                         {
00810                             if (!bHigh)
00811                             {
00812                                 DrawFolder(&dc, index, rc, true);
00813                                 bHigh = true;
00814                             }
00815                         }
00816                         else
00817                         {
00818                             if (bHigh)
00819                             {
00820                                 DrawFolder(&dc, index, rc, false);
00821                                 bHigh = false;
00822                             }
00823                         }
00824                     }
00825                     break;
00826
00827                 case WM_LBUTTONUP:
00828                     {
00829                         if (bHigh)
00830                         {
00831                             DrawFolder(&dc, index, rc, false);
00832                             bHigh = false;
00833                         }
00834                         CPoint pt(msg.lParam);
00835                         int idx, ht1 = HitTestEx(pt, idx);
00836                         if (ht1 == htFolder && idx != iSelFolder)
00837                             SetSelFolder(idx);
00838                     }
00839
00840                     goto ExitLoop2;
00841
00842                 case WM_KEYDOWN:
00843                     if (msg.wParam != VK_ESCAPE)
00844                         break;
00845
00846                 default:
00847                     DispatchMessage(&msg);
00848                     break;
00849                 }
00850             }
00851
00852         ExitLoop2:
00853             ReleaseCapture();
00854             AfxUnlockTempMaps(FALSE);
00855         }
00856         if (bHigh) InvalidateRect(rc, false);
00857     }
00858     else iLastSelectedFolder = -1;
00859
00860     if (ht == htItem)
00861     {
00862         iLastDragItemDraw = -1;
00863         bool bHigh = true, bDragging = false;
00864         CRect rc;
00865         GetItemRect(iSelFolder, index, rc);
00866
00867         HCURSOR hCur = GetCursor();
00868
00869         if (::GetCapture() == NULL)
00870         {
00871             SetCapture();
00872             ASSERT(this == GetCapture());
00873             CClientDC dc(this);
00874             HighlightItem(index, true);
00875             AfxLockTempMaps();
00876             for (;;)
00877             {
00878                 MSG msg;
00879                 VERIFY(::GetMessage(&msg, NULL, 0, 0));
00880
00881                 if (CWnd::GetCapture() != this) break;
00882
00883                 switch (msg.message)
00884                 {
00885                 case WM_MOUSEMOVE:
00886                     {
00887                         CPoint pt(msg.lParam);
00888                         int idx, ht1 = HitTestEx(pt, idx);
00889                         if (bDragging)
00890                         {
00891                             if (ht1 == htItem)
00892                             {
00893                                 DrawDragArrow(&dc, index, idx);
00894                                 SetCursor(hDragCursor);
00895                                 hCur = hDragCursor;
00896                             }
00897                             else
00898                             {
00899                                 CRect rcItem;
00900                                 GetItemRect(iSelFolder, GetItemCount() - 1, rcItem);
00901                                 if (pt.y > rcItem.bottom && pt.y < inRc.bottom)
00902                                 {
00903                                     DrawDragArrow(&dc, index, GetItemCount());
00904                                     SetCursor(hDragCursor);
00905                                     hCur = hDragCursor;
00906                                 }
00907                                 else
00908                                 {
00909                                     DrawDragArrow(&dc, index, -1);
00910                                     SetCursor(hNoDragCursor);
00911                                     hCur = hNoDragCursor;
00912                                 }
00913                             }
00914                         }
00915                         else
00916                         {
00917                             if (ht1 == htItem && idx == index)
00918                             {
00919                                 if (!bHigh)
00920                                 {
00921                                     HighlightItem(index, true);
00922                                     bHigh = true;
00923                                     bPressedHighlight = true;
00924                                 }
00925                             }
00926                             else
00927                             {
00928                                 if (ht1 == htItem)
00929                                 {
00930                                     if (bHigh)
00931                                     {
00932                                         HighlightItem(index, false);
00933                                         bHigh = false;
00934                                         bPressedHighlight = false;
00935                                     }
00936                                 }
00937                                 else
00938                                 {
00939                                     if (dwFlags&fDragItems)
00940                                     {
00941                                         HighlightItem(index, true);
00942                                         bHigh = true;
00943                                         bDragging = true;
00944
00945                                         SetCursor(hDragCursor);
00946                                         hCur = hDragCursor;
00947
00948                                         bPressedHighlight = true;
00949                                     }
00950                                 }
00951                             }
00952                         }
00953                     }
00954                     break;
00955
00956                 case WM_SETCURSOR:
00957                     SetCursor(hCur);
00958                     break;
00959
00960                 case WM_LBUTTONUP:
00961                     {
00962                         if (bHigh)
00963                         {
00964                             HighlightItem(-1);
00965                             bHigh = false;
00966                         }
00967                         CPoint pt(msg.lParam);
00968                         int idx, ht1 = HitTestEx(pt, idx);
00969                         if (!bDragging)
00970                         {
00971                             if (ht1 == htItem && idx == index)
00972                             {
00973                                 if (iSelAnimTiming > 0 && index != iLastSel && iLastSel >= 0)
00974                                 {
00975                                     DrawAnimItem(0, 0, iLastSel);
00976                                 }
00977
00978                                 if (dwFlags&fSelHighlight && iLastSel >= 0)
00979                                 {
00980                                     CRect rc;
00981                                     GetIconRect(iSelFolder, iLastSel, rc);
00982                                     rc.InflateRect(1,1);
00983                                     InvalidateRect(rc);
00984                                 }
00985
00986                                 iLastSel = index;
00987
00988                                 if (dwFlags&fSelHighlight && iLastSel >= 0)
00989                                 {
00990                                     CRect rc;
00991                                     GetIconRect(iSelFolder, iLastSel, rc);
00992                                     rc.InflateRect(1,1);
00993                                     InvalidateRect(rc);
00994                                 }
00995
00996                                 GetOwner()->SendMessage(WM_OUTBAR_NOTIFY, NM_OB_ITEMCLICK, idx);
00997                             }
00998                         }
00999                         else
01000                         {
01001                             if (ht1 == htItem)
01002                             {
01003                                 if (idx != index)
01004                                 {
01005                                     OUTBAR_INFO ob;
01006                                     ob.iDragFrom = iSelFolder;
01007                                     ob.iDragTo = index;
01008                                     if (GetOwner()->SendMessage(WM_OUTBAR_NOTIFY, NM_OB_DRAGITEM, (LPARAM) &ob))
01009                                     {
01010                                         CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
01011                                         CBarItem * piFrom = (CBarItem *) pbf->arItems.GetAt(index);
01012                                         pbf->arItems.RemoveAt(index);
01013                                         if (idx > index) idx --;
01014                                         pbf->arItems.InsertAt(idx, piFrom);
01015                                     }
01016                                 }
01017                             }
01018                             else
01019                             {
01020                                 CRect rcItem;
01021                                 GetItemRect(iSelFolder, GetItemCount() - 1, rcItem);
01022                                 if (pt.y > rcItem.bottom && pt.y < inRc.bottom)
01023                                 {
01024                                     OUTBAR_INFO ob;
01025                                     ob.iDragFrom = iSelFolder;
01026                                     ob.iDragTo = index;
01027                                     if (GetOwner()->SendMessage(WM_OUTBAR_NOTIFY, NM_OB_DRAGITEM, (LPARAM) &ob))
01028                                     {
01029                                         CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
01030                                         CBarItem * piFrom = (CBarItem *) pbf->arItems.GetAt(index);
01031                                         pbf->arItems.RemoveAt(index);
01032                                         pbf->arItems.Add((void *) piFrom);
01033                                     }
01034                                 }
01035                             }
01036                         }
01037                     }
01038
01039                     goto ExitLoop4;
01040
01041                 default:
01042                     DispatchMessage(&msg);
01043                     break;
01044                 }
01045             }
01046
01047         ExitLoop4:
01048             ReleaseCapture();
01049             AfxUnlockTempMaps(FALSE);
01050             if (bDragging)
01051             {
01052                 Invalidate();
01053             }
01054         }
01055         bPressedHighlight = false;
01056         if (bHigh) InvalidateRect(rc, false);
01057     }
01058     else iLastItemHighlighted = -1;
01059
01060     if (ht == htDownScroll)
01061     {
01062         bLooping = true;
01063         bool bHigh = true;
01064
01065         if (::GetCapture() == NULL)
01066         {
01067             SetCapture();
01068             ASSERT(this == GetCapture());
01069             CClientDC dc(this);
01070             dc.DrawFrameControl(rcDownArrow, DFC_SCROLL, DFCS_SCROLLDOWN|DFCS_PUSHED);
01071             SetTimer(2,300,NULL);
01072             AfxLockTempMaps();
01073             for (;;)
01074             {
01075                 MSG msg;
01076                 VERIFY(::GetMessage(&msg, NULL, 0, 0));
01077
01078                 if (CWnd::GetCapture() != this) break;
01079
01080                 switch (msg.message)
01081                 {
01082                 case WM_MOUSEMOVE:
01083                     {
01084                         CPoint pt(msg.lParam);
01085                         if (rcDownArrow.PtInRect(pt))
01086                         {
01087                             if (bHigh == false)
01088                             {
01089                                 dc.DrawFrameControl(rcDownArrow, DFC_SCROLL, DFCS_SCROLLDOWN|DFCS_PUSHED);
01090                                 bHigh = true;
01091                                 bDownArrow = true;
01092                                 bDownPressed = true;
01093                             }
01094                         }
01095                         else
01096                         {
01097                             if (bHigh == true)
01098                             {
01099                                 dc.DrawFrameControl(rcDownArrow, DFC_SCROLL, DFCS_SCROLLDOWN);
01100                                 bHigh = false;
01101                                 bDownArrow = false;
01102                                 bDownPressed = false;
01103                             }
01104                         }
01105                     }
01106                     break;
01107
01108                 case WM_LBUTTONUP:
01109                     {
01110                         if (bHigh)
01111                         {
01112                             dc.DrawFrameControl(rcDownArrow, DFC_SCROLL, DFCS_SCROLLDOWN);
01113                             bHigh = false;
01114                         }
01115                         bDownArrow = false;
01116                         CPoint pt(msg.lParam);
01117                         if (rcDownArrow.PtInRect(pt))
01118                         {
01119                             CRect itrc;
01120                             GetItemRect(iSelFolder, GetItemCount() - 1, itrc);
01121                             CRect crc;
01122                             GetInsideRect(crc);
01123                             if (itrc.bottom > crc.bottom)
01124                             {
01125                                 iFirstItem ++;
01126                                 InvalidateRect(crc, true);
01127                             }
01128                         }
01129                     }
01130                     goto ExitLoop3;
01131
01132
01133                 case WM_TIMER:
01134                     {
01135                         if (msg.wParam == 2)
01136                         {
01137                             if (bHigh)
01138                             {
01139                                 CPoint pt(msg.pt);
01140                                 ScreenToClient(&pt);
01141                                 if (rcDownArrow.PtInRect(pt))
01142                                 {
01143                                     bDownPressed = true;
01144                                     CRect itrc;
01145                                     GetItemRect(iSelFolder, GetItemCount() - 1, itrc);
01146                                     CRect crc;
01147                                     GetInsideRect(crc);
01148                                     if (itrc.bottom > crc.bottom)
01149                                     {
01150                                         iFirstItem ++;
01151                                         InvalidateRect(crc, true);
01152                                     }
01153                                     else goto ExitLoop3;
01154                                 }
01155                                 else bDownPressed = false;
01156                             }
01157                         }
01158                         break;
01159                     }
01160
01161                 case WM_KEYDOWN:
01162                     if (msg.wParam != VK_ESCAPE)
01163                         break;
01164
01165                 default:
01166                     DispatchMessage(&msg);
01167                     break;
01168                 }
01169             }
01170
01171         ExitLoop3:
01172             KillTimer(2);
01173             ReleaseCapture();
01174             AfxUnlockTempMaps(FALSE);
01175             bLooping = false;
01176             bDownPressed = false;
01177             bDownArrow = false;
01178             CRect crc;
01179             GetInsideRect(crc);
01180             InvalidateRect(crc, true);
01181         }
01182     }
01183
01184     if (ht == htUpScroll)
01185     {
01186         bLooping = true;
01187         bool bHigh = true;
01188
01189         if (::GetCapture() == NULL)
01190         {
01191             SetCapture();
01192             ASSERT(this == GetCapture());
01193             CClientDC dc(this);
01194             dc.DrawFrameControl(rcUpArrow, DFC_SCROLL, DFCS_SCROLLUP|DFCS_PUSHED);
01195             SetTimer(2,300,NULL);
01196             AfxLockTempMaps();
01197             for (;;)
01198             {
01199                 MSG msg;
01200                 VERIFY(::GetMessage(&msg, NULL, 0, 0));
01201
01202                 if (CWnd::GetCapture() != this) break;
01203
01204                 switch (msg.message)
01205                 {
01206                 case WM_MOUSEMOVE:
01207                     {
01208                         CPoint pt(msg.lParam);
01209                         if (rcUpArrow.PtInRect(pt))
01210                         {
01211                             if (bHigh == false)
01212                             {
01213                                 dc.DrawFrameControl(rcUpArrow, DFC_SCROLL, DFCS_SCROLLUP|DFCS_PUSHED);
01214                                 bHigh = true;
01215                                 bUpArrow = true;
01216                                 bUpPressed = true;
01217                             }
01218                         }
01219                         else
01220                         {
01221                             if (bHigh == true)
01222                             {
01223                                 dc.DrawFrameControl(rcUpArrow, DFC_SCROLL, DFCS_SCROLLUP);
01224                                 bHigh = false;
01225                                 bUpArrow = false;
01226                                 bUpPressed = false;
01227                             }
01228                         }
01229                     }
01230                     break;
01231
01232                 case WM_LBUTTONUP:
01233                     {
01234                         if (bHigh)
01235                         {
01236                             dc.DrawFrameControl(rcUpArrow, DFC_SCROLL, DFCS_SCROLLUP);
01237                             bHigh = false;
01238                         }
01239                         bUpArrow = false;
01240                         CPoint pt(msg.lParam);
01241                         if (rcUpArrow.PtInRect(pt))
01242                         {
01243                             if (iFirstItem > 0 )
01244                             {
01245                                 iFirstItem --;
01246                                 CRect crc;
01247                                 GetInsideRect(crc);
01248                                 InvalidateRect(crc, true);
01249                             }
01250                         }
01251                     }
01252
01253                     goto ExitLoop;
01254
01255                 case WM_TIMER:
01256                     {
01257                         if (msg.wParam == 2)
01258                         {
01259                             if (bHigh)
01260                             {
01261                                 CPoint pt(msg.pt);
01262                                 ScreenToClient(&pt);
01263                                 if (rcUpArrow.PtInRect(pt))
01264                                 {
01265                                     bUpPressed = true;
01266                                     if (iFirstItem > 0)
01267                                     {
01268                                         iFirstItem --;
01269                                         CRect crc;
01270                                         GetInsideRect(crc);
01271                                         InvalidateRect(crc, true);
01272                                     }
01273                                     else goto ExitLoop;
01274                                 }
01275                                 else bUpPressed = false;
01276                             }
01277                         }
01278                         break;
01279                     }
01280                 case WM_KEYDOWN:
01281                     if (msg.wParam != VK_ESCAPE) break;
01282
01283                 default:
01284                     DispatchMessage(&msg);
01285                     break;
01286                 }
01287             }
01288
01289         ExitLoop:
01290             KillTimer(2);
01291             ReleaseCapture();
01292             AfxUnlockTempMaps(FALSE);
01293             bLooping = false;
01294             bUpPressed = false;
01295             bUpArrow = false;
01296             CRect crc;
01297             GetInsideRect(crc);
01298             InvalidateRect(crc, true);
01299         }
01300     }
01301
01302     CWnd::OnLButtonDown(nFlags, point);
01303 }
01304
01305
01306 int CGfxOutBarCtrl::InsertItem(const int folder, const int index, LPCTSTR text, const int image, const DWORD exData)
01307 {
01308     ASSERT(folder >= 0 && folder < GetFolderCount());
01309
01310     CBarFolder* pbf = (CBarFolder*) arFolder.GetAt(folder);
01311
01312     return pbf->InsertItem(index, text, image, exData);
01313 }
01314
01315 int CGfxOutBarCtrl::GetItemCount() const
01316 {
01317     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
01318     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
01319     return  pbf->GetItemCount();
01320 }
01321
01322 void CGfxOutBarCtrl::SetSelFolder(const int index)
01323 {
01324     ASSERT(index >= 0 && index < GetFolderCount());
01325 //  if (index == iSelFolder) return;
01326
01327     CWnd * pc = GetFolderChild();
01328     if (pc) pc->ShowWindow(SW_HIDE);
01329
01330     if (index != iSelFolder)
01331     {
01332         if (dwFlags&fAnimation && lAnimationTickCount >= 0) AnimateFolderScroll(iSelFolder, index);
01333     }
01334
01335     iSelFolder = index;
01336     iFirstItem = 0;
01337     iLastSel = -1;
01338
01339     pc = GetFolderChild();
01340     if (pc)
01341     {
01342         CRect rc;
01343         GetInsideRect(rc);
01344         pc->MoveWindow(rc);
01345         pc->ShowWindow(SW_SHOW);
01346     }
01347
01348     GetOwner()->SendMessage(WM_OUTBAR_NOTIFY, NM_FOLDERCHANGE, (LPARAM) iSelFolder);
01349
01350     Invalidate();
01351 }
01352
01353 int CGfxOutBarCtrl::GetFolderCount() const
01354 {
01355     return arFolder.GetSize();
01356 }
01357
01358 int CGfxOutBarCtrl::GetSelFolder() const
01359 {
01360     return iSelFolder;
01361 }
01362
01363 void CGfxOutBarCtrl::RemoveFolder(const int index)
01364 {
01365     ASSERT(index >= 0 && index < GetFolderCount());
01366     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(index);
01367     delete pbf;
01368     arFolder.RemoveAt(index);
01369     if (iSelFolder >= index) iSelFolder = index - 1;
01370     if (iSelFolder < 0 && GetFolderCount() > 0) iSelFolder = 0;
01371     Invalidate();
01372 }
01373
01374 int CGfxOutBarCtrl::CBarFolder::InsertItem(int index, LPCTSTR text, const int image, const DWORD exData)
01375 {
01376     if (index < 0 || index > GetItemCount()) index = GetItemCount();
01377
01378     int c = GetItemCount();
01379
01380     CBarItem* pbf = new CBarItem(text, image, exData);
01381
01382     ASSERT(pbf);
01383
01384     if( index < GetItemCount())
01385     {
01386         arItems.InsertAt(index, (void *) pbf);
01387     }
01388     else
01389     {
01390         arItems.Add((void *) pbf);
01391     }
01392
01393     c = GetItemCount();
01394
01395     return index;
01396 }
01397
01398 int CGfxOutBarCtrl::GetCountPerPage() const
01399 {
01400     return 0;
01401 }
01402
01403 CImageList * CGfxOutBarCtrl::SetImageList(CImageList * pImageList, int nImageList)
01404 {
01405     CImageList * o = NULL;
01406     if (nImageList == fSmallIcon)
01407     {
01408         o = pSmallImageList;
01409         pSmallImageList = pImageList;
01410     }
01411     else if (nImageList == fLargeIcon)
01412     {
01413         o = pLargeImageList;
01414         pLargeImageList = pImageList;
01415     }
01416     return o;
01417 }
01418
01419 CImageList * CGfxOutBarCtrl::GetImageList(CImageList* /*pImageList*/, int nImageList)
01420 {
01421     if (nImageList == fSmallIcon) return pSmallImageList;
01422     else if (nImageList == fLargeIcon) return pLargeImageList;
01423     return NULL;
01424 }
01425
01426 CImageList * CGfxOutBarCtrl::SetFolderImageList(const int folder, CImageList * pImageList, int nImageList)
01427 {
01428     ASSERT(folder >= 0 && folder < GetFolderCount());
01429     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(folder);
01430     CImageList * o = NULL;
01431     if (nImageList == fSmallIcon)
01432     {
01433         o = pbf->pSmallImageList;
01434         pbf->pSmallImageList = pImageList;
01435     }
01436     else if (nImageList == fLargeIcon)
01437     {
01438         o = pbf->pLargeImageList;
01439         pbf->pLargeImageList = pImageList;
01440     }
01441     return o;
01442 }
01443
01444 CGfxOutBarCtrl::CBarItem::CBarItem( LPCTSTR name, const int image, DWORD exData )
01445 {
01446     cItem       = NULL;
01447     iImageIndex = image;
01448     dwData      = exData;
01449
01450     if( name )
01451     {
01452         cItem = new TCHAR[ _tcslen( name ) + 1 ];
01453
01454         ASSERT(cItem);
01455
01456         _tcscpy( cItem, name );
01457     }
01458 }
01459
01460 CGfxOutBarCtrl::CBarItem::~CBarItem()
01461 {
01462     if (cItem) delete [] cItem;
01463 }
01464
01465 int CGfxOutBarCtrl::CBarFolder::GetItemCount()
01466 {
01467     return arItems.GetSize();
01468 }
01469
01470 void CGfxOutBarCtrl::PaintItems(CDC * pDC, const int iFolder, CRect rc)
01471 {
01472     ASSERT(iFolder >= 0 && iFolder < GetFolderCount());
01473     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iFolder);
01474     int max = pbf->GetItemCount(), t;
01475     CRect irc;
01476     GetInsideRect(irc);
01477     int isdc = pDC->SaveDC();
01478     CRgn itemRegion;
01479     itemRegion.CreateRectRgnIndirect(&irc);
01480     pDC->SelectClipRgn(&itemRegion);
01481     itemRegion.DeleteObject();
01482     for (t = iFirstItem; t < max; t++)
01483     {
01484         CRect itemRc;
01485         GetItemRect(iFolder, t, itemRc);
01486         if (itemRc.top > rc.bottom) break;
01487         else DrawItem(pDC, iFolder, itemRc, t);
01488     }
01489     pDC->RestoreDC(isdc);
01490 }
01491
01492
01493 CSize CGfxOutBarCtrl::GetItemSize(const int iFolder, const int index, const int type)
01494 {
01495     ASSERT(iFolder >= 0 && iFolder < GetFolderCount());
01496     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iFolder);
01497
01498     ASSERT(index >= 0 && index < pbf->GetItemCount());
01499     CBarItem * pi = (CBarItem *) pbf->arItems.GetAt(index);
01500
01501     CSize szImage(0,0);
01502     CSize szLabel(0,0);
01503     CSize szAll(0,0);
01504
01505     if (pi->iImageIndex >= 0)
01506     {
01507         if (type != ircLabel)
01508         {
01509             CImageList * il = GetFolderImageList(iFolder, IsSmallIconView());
01510             ASSERT(il);
01511             if (il)
01512             {
01513                 IMAGEINFO ii;
01514                 il->GetImageInfo(pi->iImageIndex, &ii);
01515                 szImage = CRect(ii.rcImage).Size();
01516             }
01517         }
01518     }
01519     if (pi->cItem)
01520     {
01521         if (type != ircIcon)
01522         {
01523             CClientDC dc(this);
01524             CFont * oft = (CFont *) dc.SelectObject(CFont::FromHandle((HFONT)GetStockObject(DEFAULT_GUI_FONT)));
01525             if (IsSmallIconView())
01526             {
01527                 szLabel = dc.GetTextExtent(pi->cItem, lstrlen(pi->cItem));
01528             }
01529             else
01530             {
01531                 CRect rc;
01532                 GetInsideRect(rc);
01533                 rc.bottom = rc.top;
01534                 dc.DrawText(pi->cItem, lstrlen(pi->cItem), rc, DT_CALCRECT|DT_CENTER|DT_WORDBREAK);
01535                 szLabel = rc.Size();
01536             }
01537             dc.SelectObject(oft);
01538         }
01539     }
01540     if (IsSmallIconView())
01541     {
01542         if (type == ircIcon) szAll = szImage;
01543         else if (type == ircLabel) szAll = szLabel;
01544         else if (type == ircAll) szAll = CSize(szImage.cx + szLabel.cx + xSmallIconLabelOffset, szImage.cy > szLabel.cy ? szImage.cy : szLabel.cy);
01545     }
01546     else
01547     {
01548         if (type == ircIcon) szAll = szImage;
01549         else if (type == ircLabel) szAll = szLabel;
01550         else if (type == ircAll)
01551         {
01552             szAll = CSize(szImage.cx > szLabel.cx ? szImage.cx : szLabel.cx, szLabel.cy + szImage.cy + yLargeIconLabelOffset + yLargeIconSpacing);
01553         }
01554     }
01555     return szAll;
01556 }
01557
01558 CImageList * CGfxOutBarCtrl::GetFolderImageList(const int index, const bool bSmall) const
01559 {
01560     ASSERT(index >= 0 && index < GetFolderCount());
01561     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(index);
01562     if (bSmall)
01563     {
01564         if (pbf->pSmallImageList) return pbf->pSmallImageList; else return pSmallImageList;
01565     }
01566     if (pbf->pLargeImageList) return pbf->pLargeImageList; else return pLargeImageList;
01567 }
01568
01569 void CGfxOutBarCtrl::DrawItem(CDC * pDC, const int iFolder, CRect rc, const int index, const bool bOnlyImage)
01570 {
01571     CImageList * ima = GetFolderImageList(iFolder, IsSmallIconView());
01572
01573     ASSERT(iFolder >= 0 && iFolder < GetFolderCount());
01574     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iFolder);
01575
01576     ASSERT(index >= 0 && index < pbf->GetItemCount());
01577     CBarItem * pi = (CBarItem *) pbf->arItems.GetAt(index);
01578
01579     ASSERT(pi && ima);
01580
01581     CFont * oft = (CFont *) pDC->SelectObject(CFont::FromHandle((HFONT)GetStockObject(DEFAULT_GUI_FONT)));
01582     COLORREF ocr = pDC->SetTextColor(crTextColor);
01583     int obk = pDC->SetBkMode(TRANSPARENT);
01584
01585     if (IsSmallIconView())
01586     {
01587         if (ima)
01588         {
01589             IMAGEINFO ii;
01590             ima->GetImageInfo(pi->iImageIndex, &ii);
01591             CSize szImage = CRect(ii.rcImage).Size();
01592             CPoint pt;
01593             pt.x = rc.left + 2;
01594             pt.y = rc.top + (rc.Height() - szImage.cy) / 2;
01595             ima->Draw(pDC, pi->iImageIndex, pt, ILD_NORMAL);
01596
01597             if (!bOnlyImage)
01598             {
01599                 rc.left += szImage.cx + xSmallIconLabelOffset;
01600                 pDC->TextOut(rc.left, rc.top, CString(pi->cItem));
01601             }
01602
01603         }
01604     }
01605     else
01606     {
01607         if (ima)
01608         {
01609             IMAGEINFO ii;
01610             ima->GetImageInfo(pi->iImageIndex, &ii);
01611             CSize szImage = CRect(ii.rcImage).Size();
01612             CPoint pt;
01613             pt.x = rc.left + (rc.Width() - szImage.cx) / 2;
01614             pt.y = rc.top;// + (rc.Height() - szImage.cy) / 2;
01615             ima->Draw(pDC, pi->iImageIndex, pt, ILD_NORMAL);
01616             if (!bOnlyImage)
01617             {
01618                 rc.top += szImage.cy + yLargeIconLabelOffset;
01619                 pDC->DrawText(pi->cItem, lstrlen(pi->cItem), rc, DT_CENTER|DT_WORDBREAK);
01620             }
01621         }
01622     }
01623
01624     if (dwFlags&fSelHighlight && iLastSel == index && iLastSel >= 0)
01625     {
01626         CRect rc;
01627         GetIconRect(iSelFolder, iLastSel, rc);
01628         rc.InflateRect(1,1);
01629         pDC->Draw3dRect(rc, crDkShadowBorder, cr3dFace);
01630     }
01631
01632     pDC->SetTextColor(ocr);
01633     pDC->SelectObject(oft);
01634     pDC->SetBkMode(obk);
01635
01636 }
01637
01638
01639 BOOL CGfxOutBarCtrl::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
01640 {
01641     CPoint pt(GetMessagePos());
01642     ScreenToClient(&pt);
01643     int index, ht = HitTestEx(pt, index);
01644     if (ht == htFolder)
01645     {
01646         SetCursor(hHandCursor);
01647         return true;
01648     }
01649
01650     return CWnd::OnSetCursor(pWnd, nHitTest, message);
01651 }
01652
01653 void CGfxOutBarCtrl::GetVisibleRange(const int iFolder, int & first, int & last)
01654 {
01655     first = iFirstItem;
01656     CRect rc;
01657     GetInsideRect(rc);
01658
01659     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iFolder);
01660     int max = pbf->GetItemCount(), t;
01661     for (t = iFirstItem; t < max; t++)
01662     {
01663         CRect itemRc;
01664         GetItemRect(iFolder, t, itemRc);
01665         if (itemRc.bottom > rc.bottom)
01666         {
01667             last = t - 1;
01668             break;
01669         }
01670         else last = t;
01671     }
01672 }
01673
01674 void CGfxOutBarCtrl::OnSize(UINT nType, int cx, int cy)
01675 {
01676     bUpArrow = bDownArrow = false;
01677
01678     CWnd::OnSize(nType, cx, cy);
01679
01680     int t, max = GetFolderCount();
01681     CRect rc;
01682     GetInsideRect(rc);
01683
01684     for (t = 0; t < max; t++)
01685     {
01686         CWnd * pc = GetFolderChild(t);
01687         if (pc) pc->SetWindowPos(0, rc.left, rc.top, rc.Width(), rc.Height(), SWP_NOZORDER);
01688     }
01689 }
01690
01691 void CGfxOutBarCtrl::HighlightItem(const int index, const bool bPressed)
01692 {
01693     CWnd * pf = GetFocus();
01694     if (pf != NULL && pf != this && IsChild(pf)) return;
01695
01696     static bool bOldPressed = false;
01697     if (iLastItemHighlighted == index && bOldPressed == bPressed) return;
01698
01699     bOldPressed = bPressed;
01700
01701     CClientDC dc(this);
01702
01703     CRect irc;
01704     GetInsideRect(irc);
01705     int isdc = dc.SaveDC();
01706     CRgn itemRegion;
01707     itemRegion.CreateRectRgnIndirect(&irc);
01708     dc.SelectClipRgn(&itemRegion);
01709     itemRegion.DeleteObject();
01710
01711
01712     if (iLastItemHighlighted >= 0 && IsValidItem(iLastItemHighlighted))
01713     {
01714         CRect rc;
01715         GetIconRect(iSelFolder, iLastItemHighlighted, rc);
01716         rc.InflateRect(1,1);
01717         dc.Draw3dRect(rc, crBackGroundColor, crBackGroundColor);
01718     }
01719     if (iSelAnimTiming > 0 && index == iLastSel)
01720     {
01721         iLastItemHighlighted = -1;
01722         return;
01723     }
01724     if (dwFlags&fSelHighlight && iLastSel == index)
01725     {
01726         iLastItemHighlighted = -1;
01727         return;
01728     }
01729
01730     iLastItemHighlighted = index;
01731     if (iLastItemHighlighted >= 0 && IsValidItem(iLastItemHighlighted))
01732     {
01733         CRect rc;
01734         GetIconRect(iSelFolder, iLastItemHighlighted, rc);
01735         rc.InflateRect(1,1);
01736         if (bPressed)
01737             dc.Draw3dRect(rc, crDkShadowBorder, cr3dFace);
01738         else
01739             dc.Draw3dRect(rc, cr3dFace, crDkShadowBorder);
01740     }
01741     dc.RestoreDC(isdc);
01742     GetOwner()->SendMessage(WM_OUTBAR_NOTIFY,NM_OB_ITEMHOVER,index);
01743 }
01744
01745 void CGfxOutBarCtrl::GetIconRect(const int iFolder, const int iIndex, CRect & rect)
01746 {
01747     CRect rc;
01748     GetInsideRect(rc);
01749     int top = rc.top;
01750     CSize sz(0,0);
01751     int y = 0;
01752     int spacing = IsSmallIconView() ? ySmallIconSpacing : yLargeIconSpacing;
01753
01754     for (int t = 0; t < iIndex; t++)
01755     {
01756         sz = GetItemSize(iFolder, t, ircAll);
01757         top += sz.cy;
01758         top += spacing;
01759         if (t == iFirstItem - 1) y = top - rc.top;
01760     }
01761     top += spacing;
01762
01763     sz = GetItemSize(iFolder, iIndex, ircIcon);
01764     if (IsSmallIconView())
01765     {
01766         rect.SetRect(rc.left, top, rc.left + sz.cx, top + sz.cy);
01767         rect.left += xLeftMargin + 2;
01768         rect.right += xLeftMargin + 2;
01769         rect.top -= yTopMargin;
01770         rect.bottom -= yTopMargin;
01771
01772         rect.top -= y;
01773         rect.bottom -= y;
01774     }
01775     else
01776     {
01777         rect.SetRect(rc.left + (rc.Width() - sz.cx)/2, top, rc.left + (rc.Width() - sz.cx)/2 + sz.cx, top + sz.cy);
01778         rect.top -= y + 3;
01779         rect.bottom -= y + 2;
01780     }
01781 }
01782
01783 void CGfxOutBarCtrl::GetLabelRect(const int iFolder, const int iIndex, CRect & rect)
01784 {
01785     CRect rc;
01786     GetInsideRect(rc);
01787     int top = rc.top;
01788     CSize sz(0,0);
01789     int y = 0;
01790     int spacing = IsSmallIconView() ? ySmallIconSpacing : yLargeIconSpacing;
01791
01792     for (int t = 0; t < iIndex; t++)
01793     {
01794         sz = GetItemSize(iFolder, t, ircAll);
01795         top += sz.cy;
01796         top += spacing;
01797         if (t == iFirstItem - 1) y = top - rc.top;
01798     }
01799     top += spacing;
01800
01801     sz = GetItemSize(iFolder, iIndex, ircAll);
01802
01803     CSize szLabel = GetItemSize(iFolder, iIndex, ircLabel);
01804
01805     if (IsSmallIconView())
01806     {
01807         rect.SetRect(rc.left, top, rc.left + sz.cx, top + sz.cy);
01808         rect.left += xLeftMargin + 2;
01809         rect.right += xLeftMargin + 2;
01810         rect.top  += yTopMargin - 5;
01811         rect.bottom += yTopMargin - 5;
01812     }
01813     else
01814     {
01815         rect.SetRect(rc.left + (rc.Width() - sz.cx)/2, top, rc.left + (rc.Width() - sz.cx)/2 + sz.cx, top + sz.cy);
01816         rect.top -= y + 3;
01817         rect.bottom -= y + 2;
01818
01819         rect.bottom -=  yLargeIconSpacing;
01820         rect.top    = rect.bottom - szLabel.cy;
01821     }
01822 }
01823
01824
01825 void CGfxOutBarCtrl::StartGroupEdit(const int index)
01826 {
01827     CGfxGroupEdit * pEdit = new CGfxGroupEdit;
01828     pEdit->iIndex = index;
01829     CRect rc;
01830     GetFolderRect(index, rc);
01831     rc.InflateRect(-2,-2);
01832     pEdit->Create(WS_CHILD|WS_VISIBLE|ES_CENTER|ES_MULTILINE,rc,this,1);
01833     pEdit->msgSend = NM_OB_ONGROUPENDEDIT;
01834     pEdit->ModifyStyleEx(0, WS_EX_CLIENTEDGE, SWP_FRAMECHANGED);
01835     ASSERT(index >= 0 && index < GetFolderCount());
01836     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(index);
01837     pEdit->SetWindowText(pbf->cName);
01838     pEdit->SetFocus();
01839 }
01840
01841 void CGfxOutBarCtrl::StartItemEdit(const int index)
01842 {
01843     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
01844     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
01845     ASSERT(index >= 0 && index < pbf->GetItemCount());
01846     CBarItem * pi = (CBarItem *) pbf->arItems.GetAt(index);
01847
01848     CGfxGroupEdit * pEdit = new CGfxGroupEdit;
01849     pEdit->iIndex = index;
01850     CRect rc, crc;
01851     GetLabelRect(iSelFolder, index, rc);
01852     GetInsideRect(crc);
01853
01854     DWORD dwFlag = WS_CHILD|WS_VISIBLE|WS_BORDER;
01855
01856     if (!IsSmallIconView())
01857     {
01858         rc.left = crc.left + 5;
01859         rc.right = crc.right - 5;
01860         rc.bottom += 5;
01861         dwFlag |= ES_CENTER|ES_MULTILINE;
01862     }
01863     else
01864     {
01865         CRect irc;
01866         GetIconRect(iSelFolder, index, irc);
01867         dwFlag |= ES_AUTOHSCROLL;
01868         rc.OffsetRect(irc.Width()+1, -6);
01869         pEdit->bNoDown = true;
01870     }
01871
01872     pEdit->Create(dwFlag, rc, this, 1);
01873     pEdit->msgSend = NM_OB_ONLABELENDEDIT;
01874
01875     pEdit->SetWindowText(pi->cItem);
01876     pEdit->SetFocus();
01877
01878 }
01879
01880 void CGfxOutBarCtrl::OnRButtonDown(UINT nFlags, CPoint point)
01881 {
01882     iHitInternal1 = HitTestEx(point, iHitInternal2);
01883
01884     SetCapture();
01885
01886     CPoint pt = point;
01887     ClientToScreen(&pt);
01888
01889     // Load the popup menu.
01890     VERIFY(m_popupMenu.LoadMenu(IDR_GFXOUTBAR));
01891     CCJMenu* pPopup = (CCJMenu*)m_popupMenu.GetSubMenu(0);
01892     ASSERT(pPopup != NULL);
01893
01894     // Load toolbar resource if any for menu icons.
01895     pPopup->LoadToolbar(IDR_GFXOUTBAR);
01896
01897     if (iHitInternal1 == htItem)
01898     {
01899         if (dwFlags&fRemoveItems || dwFlags&fEditItems)
01900         {
01901             pPopup->AppendMenu(MF_SEPARATOR);
01902             if (dwFlags&fRemoveItems)
01903                 ((CMenu*)pPopup)->AppendMenu(MF_STRING, ID_GFX_REMOVEITEM, m_strRemoveItem);
01904
01905             if (dwFlags&fEditItems)
01906                 ((CMenu*)pPopup)->AppendMenu(MF_STRING, ID_GFX_RENAMEITEM, m_strRenameItem);
01907         }
01908     }
01909     else if (iHitInternal1 == htFolder)
01910     {
01911         if (dwFlags&fRemoveGroups || dwFlags&fEditGroups)
01912         {
01913             ((CMenu*)pPopup)->AppendMenu(MF_SEPARATOR);
01914
01915             if (dwFlags&fRemoveGroups)
01916                 ((CMenu*)pPopup)->AppendMenu(MF_STRING, ID_GFX_REMOVEITEM, m_strRemoveItem);
01917
01918             if (dwFlags&fEditGroups)
01919                 ((CMenu*)pPopup)->AppendMenu(MF_STRING, ID_GFX_RENAMEITEM, m_strRenameItem);
01920         }
01921     }
01922
01923     // Display the popup menu, use the main window as its parent.
01924     pPopup->TrackPopupMenu( TPM_LEFTALIGN | TPM_RIGHTBUTTON,
01925         pt.x, pt.y, this );
01926
01927     m_popupMenu.DestroyMenu();
01928     ReleaseCapture();
01929
01930     CWnd::OnRButtonDown(nFlags, point);
01931 }
01932
01933 void CGfxOutBarCtrl::OnGfxLargeicon()
01934 {
01935     SetSmallIconView(false);
01936     Invalidate();
01937 }
01938
01939 void CGfxOutBarCtrl::OnUpdateGfxLargeicon(CCmdUI* pCmdUI)
01940 {
01941     pCmdUI->Enable(IsSmallIconView());
01942 }
01943
01944 void CGfxOutBarCtrl::OnGfxSmallicon()
01945 {
01946     SetSmallIconView(true);
01947     Invalidate();
01948 }
01949
01950 void CGfxOutBarCtrl::OnUpdateGfxSmallicon(CCmdUI* pCmdUI)
01951 {
01952     pCmdUI->Enable(!IsSmallIconView());
01953 }
01954
01955 void CGfxOutBarCtrl::OnGfxRemoveitem()
01956 {
01957     if (iHitInternal1 == htFolder)
01958     {
01959         RemoveFolder(iHitInternal2);
01960     }
01961     else if (iHitInternal1 == htItem)
01962     {
01963         RemoveItem(iHitInternal2);
01964     }
01965 }
01966
01967 void CGfxOutBarCtrl::OnUpdateGfxRemoveitem(CCmdUI* /*pCmdUI*/)
01968 {
01969
01970 }
01971
01972 void CGfxOutBarCtrl::OnGfxRenameitem()
01973 {
01974     if (iHitInternal1 == htFolder)
01975     {
01976         StartGroupEdit(iHitInternal2);
01977     }
01978     else if (iHitInternal1 == htItem)
01979     {
01980         StartItemEdit(iHitInternal2);
01981     }
01982 }
01983
01984 void CGfxOutBarCtrl::OnUpdateGfxRenameitem(CCmdUI* /*pCmdUI*/)
01985 {
01986 }
01987
01988 void CGfxOutBarCtrl::RemoveItem(const int index)
01989 {
01990     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
01991     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
01992     ASSERT(index >= 0 && index < pbf->GetItemCount());
01993     if (IsValidItem(index))
01994     {
01995         CBarItem * i = (CBarItem *) pbf->arItems.GetAt(index);
01996         delete i;
01997
01998         pbf->arItems.RemoveAt(index);
01999         CRect rc;
02000         GetInsideRect(rc);
02001         InvalidateRect(rc);
02002     }
02003 }
02004
02005 bool CGfxOutBarCtrl::IsValidItem(const int index) const
02006 {
02007     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
02008     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
02009     return (index >= 0 && index < pbf->GetItemCount());
02010 }
02011
02012 DWORD CGfxOutBarCtrl::GetItemData(const int index) const
02013 {
02014     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
02015     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
02016     if (IsValidItem(index))
02017     {
02018         CBarItem * i = (CBarItem *) pbf->arItems.GetAt(index);
02019         return i->dwData;
02020     }
02021     return 0;
02022 }
02023
02024 int CGfxOutBarCtrl::GetItemImage(const int index) const
02025 {
02026     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
02027     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
02028     if (IsValidItem(index))
02029     {
02030         CBarItem * i = (CBarItem *) pbf->arItems.GetAt(index);
02031         return i->iImageIndex;
02032     }
02033     return 0;
02034 }
02035
02036 void CGfxOutBarCtrl::SetItemData(const int index, const DWORD dwData)
02037 {
02038     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
02039     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
02040     if (IsValidItem(index))
02041     {
02042         CBarItem * i = (CBarItem *) pbf->arItems.GetAt(index);
02043         i->dwData = dwData;
02044     }
02045 }
02046
02047 void CGfxOutBarCtrl::SetItemImage(const int index, const int iImage)
02048 {
02049     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
02050     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
02051     if (IsValidItem(index))
02052     {
02053         CBarItem * i = (CBarItem *) pbf->arItems.GetAt(index);
02054         i->iImageIndex = iImage;
02055     }
02056 }
02057
02058 void CGfxOutBarCtrl::DrawDragArrow(CDC * pDC, const int /*iFrom*/, const int iTo)
02059 {
02060     if (iTo == iLastDragItemDraw) return;
02061     CRect rc1;
02062     if (iLastDragItemDraw >= 0)
02063     {
02064         GetDragItemRect(iLastDragItemDraw, rc1);
02065         if (iLastDragItemDrawType == 0) rc1.bottom = rc1.top + 5;
02066         else if (iLastDragItemDrawType == 1) { rc1.top -= 4; rc1.bottom = rc1.top + 9; }
02067         else if (iLastDragItemDrawType == 2) { rc1.top -= 4; rc1.bottom = rc1.top + 5; }
02068         InvalidateRect(rc1, true);
02069         UpdateWindow();
02070     }
02071     iLastDragItemDraw = iTo;
02072
02073     if (iLastDragItemDraw >= 0)
02074     {
02075         iLastDragItemDrawType = GetDragItemRect(iLastDragItemDraw, rc1);
02076
02077         CPen * op = pDC->SelectObject(pBlackPen);
02078
02079         pDC->MoveTo(rc1.left, rc1.top);
02080         pDC->LineTo(rc1.right, rc1.top);
02081
02082         if (iLastDragItemDrawType != 2)
02083         {
02084             pDC->MoveTo(rc1.left, rc1.top+1);
02085             pDC->LineTo(rc1.left + 7, rc1.top+1);
02086             pDC->MoveTo(rc1.left, rc1.top+2);
02087             pDC->LineTo(rc1.left + 5, rc1.top+2);
02088             pDC->MoveTo(rc1.left, rc1.top+3);
02089             pDC->LineTo(rc1.left + 3, rc1.top+3);
02090             pDC->MoveTo(rc1.left, rc1.top+4);
02091             pDC->LineTo(rc1.left + 1, rc1.top+4);
02092
02093             pDC->MoveTo(rc1.right-1, rc1.top+1);
02094             pDC->LineTo(rc1.right - 7, rc1.top+1);
02095             pDC->MoveTo(rc1.right-1, rc1.top+2);
02096             pDC->LineTo(rc1.right - 5, rc1.top+2);
02097             pDC->MoveTo(rc1.right-1, rc1.top+3);
02098             pDC->LineTo(rc1.right - 3, rc1.top+3);
02099         }
02100         if (iLastDragItemDrawType != 0)
02101         {
02102             pDC->MoveTo(rc1.left, rc1.top-1);
02103             pDC->LineTo(rc1.left + 7, rc1.top-1);
02104             pDC->MoveTo(rc1.left, rc1.top-2);
02105             pDC->LineTo(rc1.left + 5, rc1.top-2);
02106             pDC->MoveTo(rc1.left, rc1.top-3);
02107             pDC->LineTo(rc1.left + 3, rc1.top-3);
02108             pDC->MoveTo(rc1.left, rc1.top-4);
02109             pDC->LineTo(rc1.left + 1, rc1.top-4);
02110
02111             pDC->MoveTo(rc1.right-1, rc1.top-1);
02112             pDC->LineTo(rc1.right - 7, rc1.top-1);
02113             pDC->MoveTo(rc1.right-1, rc1.top-2);
02114             pDC->LineTo(rc1.right - 5, rc1.top-2);
02115             pDC->MoveTo(rc1.right-1, rc1.top-3);
02116             pDC->LineTo(rc1.right - 3, rc1.top-3);
02117             pDC->MoveTo(rc1.right-1, rc1.top-4);
02118             pDC->LineTo(rc1.right - 1, rc1.top-4);
02119         }
02120
02121         pDC->SelectObject(op);
02122     }
02123 }
02124
02125 int CGfxOutBarCtrl::GetDragItemRect(const int index, CRect & rect)
02126 {
02127     CRect rc, crc;
02128     GetInsideRect(crc);
02129     crc.InflateRect(-2, 0);
02130
02131     GetItemRect(iSelFolder, index < GetItemCount() ? index : index - 1, rc);
02132     int line = 0;
02133     if (index < GetItemCount())
02134     {
02135         line = rc.top - 4;
02136     }
02137     else
02138     {
02139         line = rc.bottom + 6;
02140     }
02141     int tpe;
02142     if (index == 0)
02143     {
02144         rect.SetRect(crc.left, line+2, crc.right, line + 7);
02145         tpe = 0;
02146     }
02147     else if (index < GetItemCount())
02148     {
02149         rect.SetRect(crc.left, line - 9, crc.right, line);
02150         tpe = 1;
02151         if (IsSmallIconView())
02152         {
02153             rect.top += 8;
02154             rect.bottom += 8;
02155         }
02156     }
02157     else
02158     {
02159         rect.SetRect(crc.left, line, crc.right, line + 5);
02160         tpe = 2;
02161     }
02162     return tpe;
02163 }
02164
02165
02166 void CGfxOutBarCtrl::AnimateFolderScroll(const int iFrom, const int iTo)
02167 {
02168     ASSERT(iFrom >= 0 && iFrom < GetFolderCount());
02169     ASSERT(iTo >= 0 && iTo < GetFolderCount());
02170
02171     CRect rc, rc1, frc, frc1;
02172     GetInsideRect(rc);
02173     rc1.SetRect(0,0,rc.Width(),rc.Height());
02174     GetFolderRect(iTo, frc);
02175     frc1 = frc;
02176
02177     CClientDC dc(this);
02178     CDC memDC;
02179     memDC.CreateCompatibleDC(&dc);
02180     CBitmap bmpFrom, bmpTo;
02181     bmpFrom.CreateCompatibleBitmap(&dc, rc1.Width(), rc1.Height() + frc.Height() * 2);
02182     bmpTo.CreateCompatibleBitmap(&dc, rc1.Width(), rc1.Height() + frc.Height() * 2);
02183     CDC * pDC = &memDC;
02184
02185     CWnd * pWnd1 = GetFolderChild(iFrom);
02186     CWnd * pWnd2 = GetFolderChild(iTo);
02187
02188     CBitmap * obmp = pDC->SelectObject(&bmpFrom);
02189     if (iTo > iFrom)
02190     {
02191         rc1.bottom += frc.Height() * 2;
02192         pDC->FillSolidRect(rc1, crBackGroundColor);
02193         if (pWnd1)
02194         {
02195             BOOL bPrev = pWnd1->ShowWindow(SW_SHOW);
02196             pWnd1->SendMessage(WM_ERASEBKGND, (WPARAM) pDC->GetSafeHdc(), (LPARAM) 0);
02197             pWnd1->SendMessage(WM_PAINT, (WPARAM) pDC->GetSafeHdc(), (LPARAM) 0);
02198             if (!bPrev) pWnd1->ShowWindow(SW_HIDE);
02199         }
02200         else PaintItems(pDC, iFrom, rc1);
02201
02202         pDC->SelectObject(&bmpTo);
02203         frc.SetRect(0,0,frc.Width(),frc.Height());
02204         rc1.SetRect(0,frc.Height(),rc.Width(), rc.Height()+frc.Height() * 2);
02205         pDC->FillSolidRect(rc1, crBackGroundColor);
02206
02207         if (pWnd2)
02208         {
02209             CPoint ovpt = pDC->SetViewportOrg(0, frc.Height());
02210             BOOL bPrev = pWnd2->ShowWindow(SW_SHOW);
02211             pWnd2->SendMessage(WM_ERASEBKGND, (WPARAM) pDC->GetSafeHdc(), (LPARAM) 0);
02212             pWnd2->SendMessage(WM_PAINT, (WPARAM) pDC->GetSafeHdc(), (LPARAM) 0);
02213             if (!bPrev) pWnd2->ShowWindow(SW_HIDE);
02214             pDC->SetViewportOrg(ovpt);
02215         }
02216         else PaintItems(pDC, iTo, rc1);
02217         DrawFolder(pDC, iTo, frc, false);
02218     }
02219     else
02220     {
02221         frc.SetRect(0,0,frc.Width(),frc.Height());
02222         rc1.top += frc.Height();
02223         rc1.bottom += frc.Height() * 2;
02224         pDC->FillSolidRect(rc1, crBackGroundColor);
02225         if (pWnd1)
02226         {
02227             CPoint ovpt = pDC->SetViewportOrg(0, frc.Height());
02228             BOOL bPrev = pWnd1->ShowWindow(SW_SHOW);
02229             pWnd1->SendMessage(WM_ERASEBKGND, (WPARAM) pDC->GetSafeHdc(), (LPARAM) 0);
02230             pWnd1->SendMessage(WM_PAINT, (WPARAM) pDC->GetSafeHdc(), (LPARAM) 0);
02231             if (!bPrev) pWnd1->ShowWindow(SW_HIDE);
02232             pDC->SetViewportOrg(ovpt);
02233         }
02234         else PaintItems(pDC, iFrom, rc1);
02235
02236         DrawFolder(pDC, iFrom, frc, false);
02237
02238         pDC->SelectObject(&bmpTo);
02239         rc1.SetRect(0,0,rc.Width(), rc.Height() + frc.Height() * 2);
02240         pDC->FillSolidRect(rc1, crBackGroundColor);
02241
02242         if (pWnd2)
02243         {
02244             BOOL bPrev = pWnd2->ShowWindow(SW_SHOW);
02245             pWnd2->SendMessage(WM_ERASEBKGND, (WPARAM) pDC->GetSafeHdc(), (LPARAM) 0);
02246             pWnd2->SendMessage(WM_PAINT, (WPARAM) pDC->GetSafeHdc(), (LPARAM) 0);
02247             if (!bPrev) pWnd2->ShowWindow(SW_HIDE);
02248         }
02249         else PaintItems(pDC, iTo, rc1);
02250     }
02251
02252     if (iTo > iFrom)
02253     {
02254         CRect rcFrom, rcTo;
02255         GetFolderRect(iFrom, rcFrom);
02256         GetFolderRect(iTo, rcTo);
02257         int fh = rcFrom.Height();
02258         for (int y = rcTo.top - fh; y > rcFrom.bottom; y -= fh)
02259         {
02260             pDC->SelectObject(&bmpFrom);
02261             dc.BitBlt(rc.left, rcFrom.bottom + 1, rc.Width(), y - rcFrom.bottom - 1, pDC, 0,fh, SRCCOPY);
02262             pDC->SelectObject(&bmpTo);
02263             dc.BitBlt(rc.left, y, rc.Width(), rc.bottom - y + fh, pDC, 0,0, SRCCOPY);
02264             Sleep(lAnimationTickCount);
02265         }
02266     }
02267     else
02268     {
02269         CRect rcFrom, rcTo;
02270         GetFolderRect(iFrom, rcFrom);
02271         int fh = rcFrom.Height();
02272         rcTo.SetRect(rc.left, rc.bottom, rc.right, rc.bottom - fh);
02273         for (int y = rcFrom.top + 1; y < rcTo.top - fh; y += fh)
02274         {
02275             pDC->SelectObject(&bmpTo);
02276             dc.BitBlt(rc.left, rcFrom.top, rc.Width(), y - rcFrom.top - 1, pDC, 0, fh*2, SRCCOPY);
02277             pDC->SelectObject(&bmpFrom);
02278             dc.BitBlt(rc.left, y, rc.Width(), rc.bottom - y, pDC, 0,0, SRCCOPY);
02279             Sleep(lAnimationTickCount);
02280         }
02281     }
02282
02283     pDC->SelectObject(obmp);
02284     // fix potential resource leak - KStowell - 10-21-99
02285     memDC.DeleteDC();
02286     bmpFrom.DeleteObject();
02287     bmpTo.DeleteObject();
02288 }
02289
02290
02291
02292
02293 CString CGfxOutBarCtrl::GetItemText(const int index)
02294 {
02295     CString item;
02296
02297     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
02298     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
02299     if (IsValidItem(index))
02300     {
02301         CBarItem * pi = (CBarItem *) pbf->arItems.GetAt(index);
02302         if (pi->cItem) item = pi->cItem;
02303     }
02304     return item;
02305 }
02306
02307 int CGfxOutBarCtrl::AddFolderBar( LPCTSTR pFolder, CWnd* pSon, const DWORD exData )
02308 {
02309     CBarFolder* pbf = new CBarFolder( pFolder, exData );
02310
02311     ASSERT( pbf );
02312
02313     pbf->pChild = pSon;
02314
02315     arFolder.Add((void*) pbf);
02316
02317     return arFolder.GetSize() - 1;
02318 }
02319
02320 CWnd * CGfxOutBarCtrl::GetFolderChild(int iFolder)
02321 {
02322     if (GetFolderCount())
02323     {
02324         if (iFolder < 0) iFolder = iSelFolder;
02325
02326         CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iFolder);
02327         return pbf->pChild;
02328     }
02329     return NULL;
02330 }
02331
02332 DWORD CGfxOutBarCtrl::GetFolderData(int iFolder)
02333 {
02334     if (iFolder < 0) iFolder = iSelFolder;
02335     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iFolder);
02336     return pbf->dwData;
02337 }
02338
02339 void CGfxOutBarCtrl::SetAnimSelHighlight(const int iTime)
02340 {
02341     if (iTime <= 0) KillTimer(3);
02342     else SetTimer(3, iTime, NULL);
02343     iSelAnimTiming = iTime;
02344 }
02345
02346 void CGfxOutBarCtrl::OnSysColorChange()
02347 {
02348     // TODO: Add your message handler code here
02349     crBackGroundColor   = ::GetSysColor(COLOR_3DSHADOW);//RGB(0,128,128);//
02350     crBackGroundColor1  = ::GetSysColor(COLOR_3DSHADOW);
02351     crTextColor         = ::GetSysColor(COLOR_WINDOW);
02352     cr3dFace            = ::GetSysColor(COLOR_3DFACE);
02353     crLightBorder       = ::GetSysColor(COLOR_3DLIGHT);
02354     crHilightBorder     = ::GetSysColor(COLOR_3DHILIGHT);
02355     crShadowBorder      = ::GetSysColor(COLOR_3DSHADOW);
02356     crDkShadowBorder    = ::GetSysColor(COLOR_3DDKSHADOW);
02357
02358     CWnd::OnSysColorChange();
02359 }
Generated on Sun Feb 24 01:21:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/GfxSplitterWnd.cpp Source File

WinCvs/CJLib/CJLibrary/GfxSplitterWnd.cpp

Go to the documentation of this file.
00001 // Copyright (c) Iuri Apollonio 1998
00002 // Use & modify as you want & need, and leave those 3 lines.
00003 // http://www.codeguru.com
00004 //
00005 // GfxSplitterWnd.cpp: implementation of the CGfxSplitterWnd class.
00006 //
00008 /****************************************************************************
00009  *
00010  * $Date: 1999/11/30 21:45:49 $
00011  * $Revision: 1.1.1.2 $
00012  * $Archive: /CodeJock/CJLibrary/GfxSplitterWnd.cpp $
00013  *
00014  * $History: GfxSplitterWnd.cpp $
00015  *
00016  * *****************  Version 5  *****************
00017  * User: Kirk Stowell Date: 10/31/99   Time: 11:14p
00018  * Updated in $/CodeJock/CJLibrary
00019  * Modified tracker to use halftone brush so that it is more consistent
00020  * with other controls.
00021  *
00022  * *****************  Version 4  *****************
00023  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00024  * Updated in $/CodeJock/CJLibrary
00025  * Fixed potential resource and memory leak problems.
00026  *
00027  * *****************  Version 3  *****************
00028  * User: Kirk Stowell Date: 10/14/99   Time: 12:41p
00029  * Updated in $/CodeJock/CJLibrary
00030  * Added source control history to file header.
00031  *
00032  ***************************************************************************/
00034
00035 #include "stdafx.h"
00036 #include "GfxSplitterWnd.h"
00037
00038 #ifdef _DEBUG
00039 #undef THIS_FILE
00040 static char THIS_FILE[]=__FILE__;
00041 #define new DEBUG_NEW
00042 #endif
00043
00044 #define CX_BORDER   1
00045 #define CY_BORDER   1
00046
00047 #include <afxpriv.h>
00048
00049 static BOOL bNotWin4;
00050
00052 // Construction/Destruction
00054
00055 BEGIN_MESSAGE_MAP(CGfxSplitterWnd, CSplitterWnd)
00056     //{{AFX_MSG_MAP(CGfxSplitterWnd)
00057     ON_WM_ERASEBKGND()
00058     ON_WM_PAINT()
00059     //}}AFX_MSG_MAP
00060 END_MESSAGE_MAP()
00061
00062 CGfxSplitterWnd::CGfxSplitterWnd()
00063 {
00064     m_cxBorder = 0;
00065     m_cyBorder = 0;
00066     m_cxSplitter = m_cySplitter = 2 + 2;
00067     m_cxSplitterGap = m_cySplitterGap = 2 + 2;
00068
00069
00070     DWORD dwVersion = ::GetVersion();
00071     BOOL bWin4 = (BYTE)dwVersion >= 4;
00072     bNotWin4 = 1 - bWin4;   // for convenience
00073
00074     m_upBorder = 5;
00075     bWhiteLine = false;
00076 }
00077
00078 CGfxSplitterWnd::~CGfxSplitterWnd()
00079 {
00080
00081 }
00082
00083 void CGfxSplitterWnd::OnDrawSplitter(CDC* pDC, ESplitType nType, const CRect& rectArg)
00084 {
00085     if (pDC == NULL)
00086     {
00087         RedrawWindow(rectArg, NULL, RDW_INVALIDATE|RDW_NOCHILDREN);
00088         return;
00089     }
00090     ASSERT_VALID(pDC);
00091     CRect rect = rectArg;
00092     switch (nType)
00093     {
00094     case splitBorder:
00095         return;
00096     case splitBox:
00097         pDC->Draw3dRect(rect, GetSysColor(COLOR_3DFACE), GetSysColor(COLOR_WINDOWFRAME));
00098         rect.InflateRect(-CX_BORDER, -CY_BORDER);
00099         pDC->Draw3dRect(rect, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNSHADOW));
00100         rect.InflateRect(-CX_BORDER, -CY_BORDER);
00101         break;
00102     }
00103
00104     COLORREF clr = GetSysColor(COLOR_3DFACE);
00105     pDC->FillSolidRect(rect, clr);
00106 }
00107
00108 void CGfxSplitterWnd::OnInvertTracker(const CRect & rect)
00109 {
00110     ASSERT_VALID(this);
00111     ASSERT(!rect.IsRectEmpty());
00112     ASSERT((GetStyle() & WS_CLIPCHILDREN) == 0);
00113
00114     CDC* pDC = GetDC();
00115     CBrush* pBrush = CDC::GetHalftoneBrush();
00116     CBrush* pOldBrush = NULL;
00117
00118     if (pBrush != NULL) {
00119         pOldBrush = pDC->SelectObject(pBrush);
00120     }
00121
00122     pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATINVERT);
00123
00124     if (pOldBrush != NULL) {
00125         pDC->SelectObject(pOldBrush);
00126     }
00127     ReleaseDC(pDC);
00128 }
00129
00130 // repositions client area of specified window
00131 // assumes everything has WS_BORDER or is inset like it does
00132 //  (includes scroll bars)
00133 static void AFXAPI DeferClientPos(AFX_SIZEPARENTPARAMS* lpLayout,
00134     CWnd* pWnd, int x, int y, int cx, int cy, BOOL bScrollBar)
00135 {
00136     ASSERT(pWnd != NULL);
00137     ASSERT(pWnd->m_hWnd != NULL);
00138
00139     if (bScrollBar)
00140     {
00141         // if there is enough room, draw scroll bar without border
00142         // if there is not enough room, set the WS_BORDER bit so that
00143         //   we will at least get a proper border drawn
00144         BOOL bNeedBorder = (cx <= CX_BORDER || cy <= CY_BORDER);
00145         pWnd->ModifyStyle(bNeedBorder ? 0 : WS_BORDER,
00146             bNeedBorder ? WS_BORDER : 0);
00147     }
00148     CRect rect(x, y, x+cx, y+cy);
00149
00150     // adjust for border size (even if zero client size)
00151
00152     // adjust for 3d border (splitter windows have implied border)
00153     if ((pWnd->GetExStyle() & WS_EX_CLIENTEDGE) ||
00154           pWnd->IsKindOf(RUNTIME_CLASS(CSplitterWnd)))
00155         rect.InflateRect(CX_BORDER*2, CY_BORDER*2);
00156
00157     // first check if the new rectangle is the same as the current
00158     CRect rectOld;
00159     pWnd->GetWindowRect(rectOld);
00160     pWnd->GetParent()->ScreenToClient(&rectOld);
00161     if (rect != rectOld)
00162         AfxRepositionWindow(lpLayout, pWnd->m_hWnd, rect);
00163 }
00164
00165
00166 static void AFXAPI LayoutRowCol(CSplitterWnd::CRowColInfo* pInfoArray,
00167     int nMax, int nSize, int nSizeSplitter)
00168 {
00169     ASSERT(pInfoArray != NULL);
00170     ASSERT(nMax > 0);
00171     ASSERT(nSizeSplitter > 0);
00172
00173     CSplitterWnd::CRowColInfo* pInfo;
00174     int i;
00175
00176     if (nSize < 0)
00177         nSize = 0;  // if really too small, layout as zero size
00178
00179     // start with ideal sizes
00180     for (i = 0, pInfo = pInfoArray; i < nMax-1; i++, pInfo++)
00181     {
00182         if (pInfo->nIdealSize < pInfo->nMinSize)
00183             pInfo->nIdealSize = 0;      // too small to see
00184         pInfo->nCurSize = pInfo->nIdealSize;
00185     }
00186     pInfo->nCurSize = INT_MAX;  // last row/column takes the rest
00187
00188     for (i = 0, pInfo = pInfoArray; i < nMax; i++, pInfo++)
00189     {
00190         ASSERT(nSize >= 0);
00191         if (nSize == 0)
00192         {
00193             // no more room (set pane to be invisible)
00194             pInfo->nCurSize = 0;
00195             continue;       // don't worry about splitters
00196         }
00197         else if (nSize < pInfo->nMinSize && i != 0)
00198         {
00199             // additional panes below the recommended minimum size
00200             //   aren't shown and the size goes to the previous pane
00201             pInfo->nCurSize = 0;
00202
00203             // previous pane already has room for splitter + border
00204             //   add remaining size and remove the extra border
00205             ASSERT(CX_BORDER*2 == CY_BORDER*2);
00206             (pInfo-1)->nCurSize += nSize + CX_BORDER*2;
00207             nSize = 0;
00208         }
00209         else
00210         {
00211             // otherwise we can add the second pane
00212             ASSERT(nSize > 0);
00213             if (pInfo->nCurSize == 0)
00214             {
00215                 // too small to see
00216                 if (i != 0)
00217                     pInfo->nCurSize = 0;
00218             }
00219             else if (nSize < pInfo->nCurSize)
00220             {
00221                 // this row/col won't fit completely - make as small as possible
00222                 pInfo->nCurSize = nSize;
00223                 nSize = 0;
00224             }
00225             else
00226             {
00227                 // can fit everything
00228                 nSize -= pInfo->nCurSize;
00229             }
00230         }
00231
00232         // see if we should add a splitter
00233         ASSERT(nSize >= 0);
00234         if (i != nMax - 1)
00235         {
00236             // should have a splitter
00237             if (nSize > nSizeSplitter)
00238             {
00239                 nSize -= nSizeSplitter; // leave room for splitter + border
00240                 ASSERT(nSize > 0);
00241             }
00242             else
00243             {
00244                 // not enough room - add left over less splitter size
00245                 ASSERT(CX_BORDER*2 == CY_BORDER*2);
00246                 pInfo->nCurSize += nSize;
00247                 if (pInfo->nCurSize > (nSizeSplitter - CX_BORDER*2))
00248                     pInfo->nCurSize -= (nSizeSplitter - CY_BORDER*2);
00249                 nSize = 0;
00250             }
00251         }
00252     }
00253     ASSERT(nSize == 0); // all space should be allocated
00254 }
00255
00256 void CGfxSplitterWnd::RecalcLayout()
00257 {
00258     ASSERT_VALID(this);
00259     ASSERT(m_nRows > 0 && m_nCols > 0); // must have at least one pane
00260
00261     CRect rectClient;
00262     GetClientRect(rectClient);
00263     rectClient.InflateRect(-m_cxBorder, -m_cyBorder);
00264     rectClient.top += m_upBorder;
00265
00266     CRect rectInside;
00267     GetInsideRect(rectInside);
00268
00269     // layout columns (restrict to possible sizes)
00270     LayoutRowCol(m_pColInfo, m_nCols, rectInside.Width(), m_cxSplitterGap);
00271     LayoutRowCol(m_pRowInfo, m_nRows, rectInside.Height(), m_cySplitterGap);
00272
00273     // adjust the panes (and optionally scroll bars)
00274
00275     // give the hint for the maximum number of HWNDs
00276     AFX_SIZEPARENTPARAMS layout;
00277     layout.hDWP = ::BeginDeferWindowPos((m_nCols + 1) * (m_nRows + 1) + 1);
00278
00279     // size of scrollbars
00280     int cx = (rectClient.right - rectInside.right - bNotWin4);// - afxData.bNotWin4;
00281     int cy = (rectClient.bottom - rectInside.bottom - bNotWin4);// - afxData.bNotWin4;
00282
00283     // reposition size box
00284     if (m_bHasHScroll && m_bHasVScroll)
00285     {
00286         CWnd* pScrollBar = GetDlgItem(AFX_IDW_SIZE_BOX);
00287         ASSERT(pScrollBar != NULL);
00288
00289         // fix style if necessary
00290         BOOL bSizingParent = (GetSizingParent() != NULL);
00291         // modifyStyle returns TRUE if style changes
00292         if (pScrollBar->ModifyStyle(SBS_SIZEGRIP|SBS_SIZEBOX,
00293                 bSizingParent ? SBS_SIZEGRIP : SBS_SIZEBOX))
00294             pScrollBar->Invalidate();
00295         pScrollBar->EnableWindow(bSizingParent);
00296
00297         // reposition the size box
00298         DeferClientPos(&layout, pScrollBar,
00299             rectInside.right + bNotWin4,
00300             rectInside.bottom + bNotWin4, cx, cy, TRUE);
00301     }
00302
00303     // reposition scroll bars
00304     if (m_bHasHScroll)
00305     {
00306         int cxSplitterBox = m_cxSplitter + bNotWin4;// split box bigger
00307         int x = rectClient.left;
00308         int y = rectInside.bottom + bNotWin4;
00309         for (int col = 0; col < m_nCols; col++)
00310         {
00311             CWnd* pScrollBar = GetDlgItem(AFX_IDW_HSCROLL_FIRST + col);
00312             ASSERT(pScrollBar != NULL);
00313             int cx = m_pColInfo[col].nCurSize;
00314             if (col == 0 && m_nCols < m_nMaxCols)
00315                 x += cxSplitterBox, cx -= cxSplitterBox;
00316             DeferClientPos(&layout, pScrollBar, x, y, cx, cy, TRUE);
00317             x += cx + m_cxSplitterGap;
00318         }
00319     }
00320
00321     if (m_bHasVScroll)
00322     {
00323         int cySplitterBox = m_cySplitter + bNotWin4;// split box bigger
00324         int x = rectInside.right + bNotWin4;
00325         int y = rectClient.top;
00326         for (int row = 0; row < m_nRows; row++)
00327         {
00328             CWnd* pScrollBar = GetDlgItem(AFX_IDW_VSCROLL_FIRST + row);
00329             ASSERT(pScrollBar != NULL);
00330             int cy = m_pRowInfo[row].nCurSize;
00331             if (row == 0 && m_nRows < m_nMaxRows)
00332                 y += cySplitterBox, cy -= cySplitterBox;
00333             DeferClientPos(&layout, pScrollBar, x, y, cx, cy, TRUE);
00334             y += cy + m_cySplitterGap;
00335         }
00336     }
00337
00338     //BLOCK: Reposition all the panes
00339     {
00340         int x = rectClient.left;
00341         for (int col = 0; col < m_nCols; col++)
00342         {
00343             int cx = m_pColInfo[col].nCurSize;
00344             int y = rectClient.top;
00345             for (int row = 0; row < m_nRows; row++)
00346             {
00347                 int cy = m_pRowInfo[row].nCurSize;
00348                 CWnd* pWnd = GetPane(row, col);
00349                 DeferClientPos(&layout, pWnd, x, y, cx, cy, FALSE);
00350                 y += cy + m_cySplitterGap;
00351             }
00352             x += cx + m_cxSplitterGap;
00353         }
00354     }
00355
00356     // move and resize all the windows at once!
00357     if (layout.hDWP == NULL || !::EndDeferWindowPos(layout.hDWP))
00358         TRACE0("Warning: DeferWindowPos failed - low system resources.\n");
00359
00360     // invalidate all the splitter bars (with NULL pDC)
00361     DrawAllSplitBars(NULL, rectInside.right, rectInside.bottom);
00362 }
00363
00364 void CGfxSplitterWnd::GetInsideRect(CRect& rect) const
00365 {
00366     CSplitterWnd::GetInsideRect(rect);
00367     rect.top += m_upBorder;
00368 /*  ASSERT_VALID(this);
00369
00370     GetClientRect(rect);
00371     ASSERT(rect.left == 0 && rect.top == 0);
00372
00373     // subtract space for 3d borders
00374     rect.InflateRect(-m_cxBorder, -m_cyBorder);
00375     rect.top += m_upBorder;
00376
00377     // subtract scrollbar clearance
00378     if (m_bHasVScroll)
00379         rect.right -= GetSystemMetrics(SM_CXVSCROLL);
00380     if (m_bHasHScroll)
00381         rect.bottom -= GetSystemMetrics(SM_CYHSCROLL);*/
00382 }
00383
00384 BOOL CGfxSplitterWnd::OnEraseBkgnd(CDC* pDC)
00385 {
00386 //  return CSplitterWnd::OnEraseBkgnd(pDC);
00387
00388     CRect rectClient;
00389     GetClientRect(rectClient);
00390     rectClient.InflateRect(-m_cxBorder, -m_cyBorder);
00391     rectClient.bottom = rectClient.top + m_upBorder;
00392     pDC->FillSolidRect(rectClient, GetSysColor(COLOR_3DFACE));
00393     return true;
00394 }
00395
00396 void CGfxSplitterWnd::OnPaint()
00397 {
00398     CSplitterWnd::OnPaint();
00399     if (bWhiteLine)
00400     {
00401         CClientDC dc(this);
00402         CRect rectClient;
00403         GetClientRect(rectClient);
00404         CPen pn(PS_SOLID, 1, GetSysColor(COLOR_3DSHADOW));
00405         CPen * op = dc.SelectObject(&pn);
00406         dc.MoveTo(rectClient.left, rectClient.top);
00407         dc.LineTo(rectClient.right, rectClient.top);
00408         CPen pn1(PS_SOLID, 1, GetSysColor(COLOR_3DHILIGHT));
00409         dc.SelectObject(&pn1);
00410         dc.MoveTo(rectClient.left, rectClient.top+1);
00411         dc.LineTo(rectClient.right, rectClient.top+1);
00412         dc.SelectObject(op);
00413
00414         // fix potential resource leak - KStowell - 10-21-99
00415         pn.DeleteObject();
00416         pn1.DeleteObject();
00417     }
00418 }
Generated on Sun Feb 24 01:21:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TbEdit.cpp File Reference

WinCvs/TbEdit.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "TbEdit.h"

Include dependency graph for TbEdit.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TbEdit.h File Reference

WinCvs/TbEdit.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CTbEdit

Defines

#define | AFX_TBEDIT_H__AEA5EC19_1292_4A30_93EA_E209A6BAE000__INCLUDED_

Define Documentation

#define AFX_TBEDIT_H__AEA5EC19_1292_4A30_93EA_E209A6BAE000__INCLUDED_

Definition at line 2 of file TbEdit.h.

Generated on Sun Feb 24 01:23:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TipDlg.cpp File Reference

WinCvs/TipDlg.cpp File Reference

#include "stdafx.h"
#include "resource.h"
#include <winreg.h>
#include <sys\stat.h>
#include <sys\types.h>
#include "wincvs.h"
#include "CPStr.h"
#include "TextBinary.h"

Include dependency graph for TipDlg.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | MAX_BUFLEN 1000

Variables

const TCHAR | szSection [] = _T("Tip")
const TCHAR | szIntFilePos [] = _T("FilePos")
const TCHAR | szTimeStamp [] = _T("TimeStamp")
const TCHAR | szIntStartup [] = _T("StartUp")

Define Documentation

#define MAX_BUFLEN 1000

Definition at line 22 of file TipDlg.cpp.

Referenced by CTipDlg::GetNextTipString.

Variable Documentation

const TCHAR szIntFilePos[] = _T("FilePos") [static]

Definition at line 25 of file TipDlg.cpp.

Referenced by CTipDlg::CTipDlg, and CTipDlg::~CTipDlg.

const TCHAR szIntStartup[] = _T("StartUp") [static]

Definition at line 27 of file TipDlg.cpp.

Referenced by CTipDlg::CTipDlg, and CTipDlg::OnOK.

const TCHAR szSection[] = _T("Tip") [static]

Definition at line 24 of file TipDlg.cpp.

Referenced by CTipDlg::CTipDlg, CTipDlg::OnOK, and CTipDlg::~CTipDlg.

const TCHAR szTimeStamp[] = _T("TimeStamp") [static]

Definition at line 26 of file TipDlg.cpp.

Referenced by CTipDlg::CTipDlg.

Generated on Sun Feb 24 01:23:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TipDlg.h File Reference

WinCvs/TipDlg.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CTipDlg

Defines

#define | TIPDLG_H_INCLUDED_

Define Documentation

#define TIPDLG_H_INCLUDED_

Definition at line 2 of file TipDlg.h.

Generated on Sun Feb 24 01:23:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ToolbarCombo.cpp File Reference

WinCvs/ToolbarCombo.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "ToolbarCombo.h"

Include dependency graph for ToolbarCombo.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ToolbarCombo.h File Reference

WinCvs/ToolbarCombo.h File Reference

#include "BrowseViewModel.h"
#include "tbedit.h"

Include dependency graph for ToolbarCombo.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CToolbarCombo

Defines

#define | AFX_TOOLBARCOMBO_H__3AE857F3_B4BD_11D4_8200_005004D6EF6C__INCLUDED_

Define Documentation

#define AFX_TOOLBARCOMBO_H__3AE857F3_B4BD_11D4_8200_005004D6EF6C__INCLUDED_

Definition at line 2 of file ToolbarCombo.h.

Generated on Sun Feb 24 01:23:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


version_fu.h File Reference

WinCvs/version_fu.h File Reference

Go to the source code of this file.

Defines

#define | PP_PASTE(x) #x
#define | PP_STRINGIZE(x) PP_PASTE(x)
#define | WINCVS_FILEVERSION WINCVS_FILE_MAJOR,WINCVS_FILE_MINOR,WINCVS_FILE_PATCHLEVEL,WINCVS_BUILD
#define | CVSNTDOS_FILEVERSION CVSNTDOS_FILE_MAJOR,CVSNTDOS_FILE_MINOR,CVSNTDOS_FILE_PATCHLEVEL,CVSNTDOS_BUILD
#define | WINCVS_PRODUCTVERSION WINCVS_PRODUCT_MAJOR,WINCVS_PRODUCT_MINOR,WINCVS_PRODUCT_PATCHLEVEL,WINCVS_BUILD
#define | WCVS_UNICODE_BUILD_STRING_PREFIX
#define | WCVS_PATCHED_FLAG 0
#define | WCVS_SPECIAL_BUILD_STRING_PREFIX
#define | WCVS_SPECIAL_BUILD_STRING
#define | WCVS_SPECIAL_BUILD_FLAG 0
#define | WCVS_PRIVATE_BUILD_STRING_PREFIX "Local "
#define | WCVS_PRIVATE_BUILD_STRING WCVS_PRIVATE_BUILD_STRING_PREFIX "build"
#define | WCVS_PRIVATE_BUILD_FLAG VS_FF_PRIVATEBUILD
#define | WCVS_PRERELEASE_BUILD_STRING_PREFIX "Prerelease "
#define | WCVS_PRERELEASE_FLAG VS_FF_PRERELEASE
#define | WCVS_DEBUG_BUILD_STRING_PREFIX
#define | WCVS_DEBUG_FLAG 0
#define | WINCVS_FILEVERSION_STRING PP_STRINGIZE(WINCVS_FILE_MAJOR.WINCVS_FILE_MINOR.WINCVS_FILE_PATCHLEVEL.WINCVS_BUILD) " " WCVS_PRERELEASE_BUILD_STRING_PREFIX "(" WCVS_PRIVATE_BUILD_STRING_PREFIX WCVS_SPECIAL_BUILD_STRING_PREFIX WCVS_UNICODE_BUILD_STRING_PREFIX WCVS_DEBUG_BUILD_STRING_PREFIX PP_STRINGIZE(Build WINCVS_BUILD) ")"
#define | CVSNTDOS_FILEVERSION_STRING PP_STRINGIZE(CVSNTDOS_FILE_MAJOR.CVSNTDOS_FILE_MINOR.CVSNTDOS_FILE_PATCHLEVEL.CVSNTDOS_BUILD) " " WCVS_PRERELEASE_BUILD_STRING_PREFIX "(" WCVS_PRIVATE_BUILD_STRING_PREFIX WCVS_SPECIAL_BUILD_STRING_PREFIX WCVS_UNICODE_BUILD_STRING_PREFIX WCVS_DEBUG_BUILD_STRING_PREFIX PP_STRINGIZE(Build CVSNTDOS_BUILD) ")"
#define | WINCVS_PRODUCTVERSION_STRING PP_STRINGIZE(WINCVS_FILE_MAJOR.WINCVS_FILE_MINOR.WINCVS_FILE_PATCHLEVEL.WINCVS_BUILD) " " WCVS_PRERELEASE_BUILD_STRING_PREFIX "(" WCVS_PRIVATE_BUILD_STRING_PREFIX WCVS_SPECIAL_BUILD_STRING_PREFIX WCVS_UNICODE_BUILD_STRING_PREFIX WCVS_DEBUG_BUILD_STRING_PREFIX PP_STRINGIZE(Build WINCVS_BUILD) ")"

Define Documentation

#define CVSNTDOS_FILEVERSION CVSNTDOS_FILE_MAJOR,CVSNTDOS_FILE_MINOR,CVSNTDOS_FILE_PATCHLEVEL,CVSNTDOS_BUILD

Definition at line 223 of file version_fu.h.

#define CVSNTDOS_FILEVERSION_STRING PP_STRINGIZE(CVSNTDOS_FILE_MAJOR.CVSNTDOS_FILE_MINOR.CVSNTDOS_FILE_PATCHLEVEL.CVSNTDOS_BUILD) " " WCVS_PRERELEASE_BUILD_STRING_PREFIX "(" WCVS_PRIVATE_BUILD_STRING_PREFIX WCVS_SPECIAL_BUILD_STRING_PREFIX WCVS_UNICODE_BUILD_STRING_PREFIX WCVS_DEBUG_BUILD_STRING_PREFIX PP_STRINGIZE(Build CVSNTDOS_BUILD) ")"

Definition at line 301 of file version_fu.h.

#define PP_PASTE ( x ) #x

Definition at line 219 of file version_fu.h.

#define PP_STRINGIZE ( x ) PP_PASTE(x)

Definition at line 220 of file version_fu.h.

#define WCVS_DEBUG_BUILD_STRING_PREFIX

Definition at line 293 of file version_fu.h.

#define WCVS_DEBUG_FLAG 0

Definition at line 294 of file version_fu.h.

#define WCVS_PATCHED_FLAG 0

Definition at line 235 of file version_fu.h.

#define WCVS_PRERELEASE_BUILD_STRING_PREFIX "Prerelease "

Definition at line 284 of file version_fu.h.

#define WCVS_PRERELEASE_FLAG VS_FF_PRERELEASE

Definition at line 286 of file version_fu.h.

#define WCVS_PRIVATE_BUILD_FLAG VS_FF_PRIVATEBUILD

Definition at line 259 of file version_fu.h.

#define WCVS_PRIVATE_BUILD_STRING WCVS_PRIVATE_BUILD_STRING_PREFIX "build"

Definition at line 258 of file version_fu.h.

#define WCVS_PRIVATE_BUILD_STRING_PREFIX "Local "

Definition at line 256 of file version_fu.h.

#define WCVS_SPECIAL_BUILD_FLAG 0

Definition at line 245 of file version_fu.h.

#define WCVS_SPECIAL_BUILD_STRING

Definition at line 244 of file version_fu.h.

#define WCVS_SPECIAL_BUILD_STRING_PREFIX

Definition at line 243 of file version_fu.h.

#define WCVS_UNICODE_BUILD_STRING_PREFIX

Definition at line 229 of file version_fu.h.

#define WINCVS_FILEVERSION WINCVS_FILE_MAJOR,WINCVS_FILE_MINOR,WINCVS_FILE_PATCHLEVEL,WINCVS_BUILD

Definition at line 222 of file version_fu.h.

#define WINCVS_FILEVERSION_STRING PP_STRINGIZE(WINCVS_FILE_MAJOR.WINCVS_FILE_MINOR.WINCVS_FILE_PATCHLEVEL.WINCVS_BUILD) " " WCVS_PRERELEASE_BUILD_STRING_PREFIX "(" WCVS_PRIVATE_BUILD_STRING_PREFIX WCVS_SPECIAL_BUILD_STRING_PREFIX WCVS_UNICODE_BUILD_STRING_PREFIX WCVS_DEBUG_BUILD_STRING_PREFIX PP_STRINGIZE(Build WINCVS_BUILD) ")"

Definition at line 300 of file version_fu.h.

#define WINCVS_PRODUCTVERSION WINCVS_PRODUCT_MAJOR,WINCVS_PRODUCT_MINOR,WINCVS_PRODUCT_PATCHLEVEL,WINCVS_BUILD

Definition at line 224 of file version_fu.h.

#define WINCVS_PRODUCTVERSION_STRING PP_STRINGIZE(WINCVS_FILE_MAJOR.WINCVS_FILE_MINOR.WINCVS_FILE_PATCHLEVEL.WINCVS_BUILD) " " WCVS_PRERELEASE_BUILD_STRING_PREFIX "(" WCVS_PRIVATE_BUILD_STRING_PREFIX WCVS_SPECIAL_BUILD_STRING_PREFIX WCVS_UNICODE_BUILD_STRING_PREFIX WCVS_DEBUG_BUILD_STRING_PREFIX PP_STRINGIZE(Build WINCVS_BUILD) ")"

Definition at line 303 of file version_fu.h.

Generated on Sun Feb 24 01:23:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


version_no.h File Reference

WinCvs/version_no.h File Reference

Go to the source code of this file.

Defines

#define | WINCVS_FILE_MAJOR 1
#define | WINCVS_FILE_MINOR 3
#define | WINCVS_FILE_PATCHLEVEL 7
#define | WINCVS_PRODUCT_MAJOR 1
#define | WINCVS_PRODUCT_MINOR 3
#define | WINCVS_PRODUCT_PATCHLEVEL 7
#define | CVSNTDOS_FILE_MAJOR 1
#define | CVSNTDOS_FILE_MINOR 11
#define | CVSNTDOS_FILE_PATCHLEVEL 1
#define | WINCVS_BUILD 1
#define | CVSNTDOS_BUILD 1
#define | WINCVS_BETA_RELEASE
#define | WINCVS_PRIVATE_BUILD "Local"
#define | WINCVS_OFFICIAL_DISTRIBUTION

Define Documentation

#define CVSNTDOS_BUILD 1

Definition at line 45 of file version_no.h.

#define CVSNTDOS_FILE_MAJOR 1

Definition at line 37 of file version_no.h.

#define CVSNTDOS_FILE_MINOR 11

Definition at line 38 of file version_no.h.

#define CVSNTDOS_FILE_PATCHLEVEL 1

Definition at line 39 of file version_no.h.

#define WINCVS_BETA_RELEASE

Definition at line 58 of file version_no.h.

#define WINCVS_BUILD 1

Definition at line 44 of file version_no.h.

#define WINCVS_FILE_MAJOR 1

Definition at line 29 of file version_no.h.

#define WINCVS_FILE_MINOR 3

Definition at line 30 of file version_no.h.

#define WINCVS_FILE_PATCHLEVEL 7

Definition at line 31 of file version_no.h.

#define WINCVS_OFFICIAL_DISTRIBUTION

Definition at line 60 of file version_no.h.

#define WINCVS_PRIVATE_BUILD "Local"

Definition at line 59 of file version_no.h.

#define WINCVS_PRODUCT_MAJOR 1

Definition at line 33 of file version_no.h.

#define WINCVS_PRODUCT_MINOR 3

Definition at line 34 of file version_no.h.

#define WINCVS_PRODUCT_PATCHLEVEL 7

Definition at line 35 of file version_no.h.

Generated on Sun Feb 24 01:23:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Win32wstring.hpp File Reference

WinCvs/Win32wstring.hpp File Reference

#include <string>
#include <windows.h>

Include dependency graph for Win32wstring.hpp:

Include dependency graph

Go to the source code of this file.

Compounds

class Win32wstring

Generated on Sun Feb 24 01:23:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


wincvs.cpp File Reference

WinCvs/wincvs.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "MainFrm.h"
#include "wincvsDoc.h"
#include "GraphDoc.h"
#include "LogFrm.h"
#include "GraphFrm.h"
#include "wincvsView.h"
#include "GraphView.h"
#include "WinCvsBrowser.h"
#include "BrowseFileView.h"
#include "AppGlue.h"
#include "CvsPrefs.h"
#include "AppConsole.h"
#include "Splash.h"
#include "TextBinary.h"
#include "MacrosSetup.h"
#include "MultiString.h"
#include "CvsCommands.h"
#include "Authen.h"
#include "TclGlue.h"
#include "PythonGlue.h"
#include "BrowserBar.h"
#include "FileTraversal.h"
#include "MakeSurePathExists.h"
#include "cvsgui_process.h"
#include "CVSTrace.h"
#include "CVS_Coworker_i.h"
#include "CVS_Coworker_i.c"
#include "CVSCoworker.h"

Include dependency graph for wincvs.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | CAboutDlg
class | CLogoutThread

Defines

#define | DEBUG_MESSAGE(S) 0

Functions

IMPLEMENT_DYNAMIC (CLogoutThread, CWinThread)
bool | IsValidHandle (HANDLE handle)
bool | TrimRight (char *szValue, bool bTest=false)
Trim the trailing spaces if the bTest is true false then return: true if it was trimmed, false if not trimmed if bTest is true then the return: true is there are trailing spaces, false if not. More...

void AFXAPI | DDV_CheckPathExists (CDataExchange *pDX, int nIDC, CString &value, bool promptForCreation)
Check the path is valid and prompt to create if not (depending on the promptForCreation parameter). More...

void AFXAPI | DDV_CheckCVSROOT (CDataExchange *pDX, CString &value)
Check whether the CVSROOT entered is valid, correct if not... More...

void AFXAPI | DDX_ComboMString (CDataExchange *pDX, int nIDC, CSmartComboBox &combo)
Note:
If pDX passed as NULL then the combo is populated.
 More...

void AFXAPI | DDV_MinChars (CDataExchange *pDX, CString const &value, int nChars)
Verify the entry has at least nChars characters. More...

bool | MatchToken (LPCTSTR sLine, LPCTSTR sToken)

Variables

CCVS_CoworkerModule _Module
CLogoutThread * | sLogout = 0L
CWincvsApp theApp
const CLSID | clsid

Define Documentation

#define DEBUG_MESSAGE ( S ) 0

Definition at line 1289 of file wincvs.cpp.

Referenced by CWincvsApp::InitATL.

Function Documentation

void AFXAPI DDV_CheckCVSROOT | ( | CDataExchange * | pDX,
 |  | CString & | value
 | ) |

Check whether the CVSROOT entered is valid, correct if not...

Definition at line 881 of file wincvs.cpp.

References TrimRight.

00882 {
00883     //check after the trailing white spaces - often an unwanted result of copy-paste
00884     if( pDX->m_bSaveAndValidate &&
00885         TrimRight(value.GetBuffer(value.GetLength()+1), true) )
00886     {
00887         value.ReleaseBuffer();
00888
00889         if( AfxMessageBox("The CVSROOT value contains the trailing spaces. Do you want to trim them?", MB_ICONQUESTION | MB_YESNO) == IDYES )
00890         {
00891             TrimRight(value.GetBuffer(value.GetLength()+1));
00892             value.ReleaseBuffer();
00893         }
00894     }
00895 }

void AFXAPI DDV_CheckPathExists | ( | CDataExchange * | pDX,
 |  | int | nIDC,
 |  | CString & | value,
 |  | bool | promptForCreation
 | ) |

Check the path is valid and prompt to create if not (depending on the promptForCreation parameter).

Definition at line 859 of file wincvs.cpp.

References CompatMakeSurePathExists, and CStr.

00860 {
00861     if( pDX->m_bSaveAndValidate )
00862     {
00863         if( !CompatMakeSurePathExists(value, false) )
00864         {
00865             if( CStr(value).endsWith(kPathDelimiter) )
00866             {
00867                 value.TrimRight(kPathDelimiter);
00868             }
00869
00870             if( !CompatMakeSurePathExists(value, promptForCreation) )
00871             {
00872                 AfxMessageBox("Cannot find folder: " + value);
00873                 pDX->PrepareEditCtrl(nIDC);
00874                 pDX->Fail();
00875             }
00876         }
00877     }
00878 }

void AFXAPI DDV_MinChars | ( | CDataExchange * | pDX,
 |  | CString const & | value,
 |  | int | nChars
 | ) |

Verify the entry has at least nChars characters.

Definition at line 934 of file wincvs.cpp.

References ASSERT.

00935 {
00936     ASSERT(nChars > 0);        // allow them something
00937     if (pDX->m_bSaveAndValidate && value.GetLength() < nChars)
00938     {
00939         TCHAR szT[255];
00940         wsprintf(szT, _T("Please enter more than %d character"), nChars);
00941         CString prompt;
00942         AfxMessageBox(szT, MB_ICONEXCLAMATION, AFX_IDP_PARSE_STRING_SIZE);
00943         prompt.Empty(); // exception prep
00944         pDX->Fail();
00945     }
00946 }

void AFXAPI DDX_ComboMString | ( | CDataExchange * | pDX,
 |  | int | nIDC,
 |  | CSmartComboBox & | combo
 | ) |

Note:
If pDX passed as NULL then the combo is populated.

Definition at line 898 of file wincvs.cpp.

References ASSERT, USmartCombo::GetItems, TMString< UStr >::GetList, TMString< UStr >::Insert, and NULL.

00899 {
00900     CMString* mstr = combo.GetItems();
00901     ASSERT(mstr != NULL);
00902
00903     if( mstr )
00904     {
00905         if( !pDX || !pDX->m_bSaveAndValidate )
00906         {
00907             CString strOldText;
00908             combo.GetWindowText(strOldText);
00909
00910             combo.ResetContent();
00911
00912             const vector<CStr> & list = mstr->GetList();
00913             vector<CStr>::const_iterator i;
00914             for(i = list.begin(); i != list.end(); ++i)
00915             {
00916                 combo.AddString(*i);
00917             }
00918
00919             combo.SetWindowText(strOldText);
00920         }
00921         else
00922         {
00923             CString value;
00924             DDX_CBString(pDX, nIDC, value);
00925             if( !value.IsEmpty() )
00926             {
00927                 mstr->Insert(value);
00928             }
00929         }
00930     }
00931 }

IMPLEMENT_DYNAMIC | ( | CLogoutThread | ,
 |  | CWinThread |
 | ) |

bool IsValidHandle ( HANDLE handle )

Definition at line 244 of file wincvs.cpp.

References FALSE, and NULL.

Referenced by CWincvsApp::InitInstance.

00245 {
00246     HANDLE dupedHandle = NULL;
00247
00248     /*
00249      * GetFileType() returns FILE_TYPE_UNKNOWN for invalid handles.
00250      */
00251
00252     if( GetFileType(handle) == FILE_TYPE_UNKNOWN )
00253     {
00254         if( !DuplicateHandle(GetCurrentProcess(),
00255             handle,
00256             GetCurrentProcess(),
00257             &dupedHandle,
00258             0,
00259             FALSE,
00260             DUPLICATE_SAME_ACCESS) )
00261         {
00262             /*
00263             * Unable to make a duplicate. It's definately invalid at this point
00264             */
00265
00266             return false;
00267         }
00268
00269         /*
00270         * Use structured exception handling (Win32 SEH) to protect the close
00271         * of this duped handle which might throw EXCEPTION_INVALID_HANDLE.
00272         */
00273         __try
00274         {
00275             CloseHandle(dupedHandle);
00276         }
00277         __except (EXCEPTION_EXECUTE_HANDLER)
00278         {
00279             /*
00280             * Definately an invalid handle.  So, therefore, the original
00281             * is invalid also.
00282             */
00283
00284             return false;
00285         }
00286     }
00287
00288     return true;
00289 }

bool MatchToken | ( | LPCTSTR | sLine,
 |  | LPCTSTR | sToken
 | ) | [inline, static]

Definition at line 1266 of file wincvs.cpp.

Referenced by CWincvsApp::InitATL.

01267 {
01268     int n = _tcslen(sToken);
01269     if (0 != _tcsnicmp(sLine,sToken,n)) {
01270         return false;
01271     }
01272     LPCTSTR p = sLine + n;
01273     return ((!*p) || (0 != _tcschr(_T(" \t"),*p)));
01274 }

bool TrimRight | ( | char * | szValue,
 |  | bool | bTest = false
 | ) |

Trim the trailing spaces if the bTest is true false then return: true if it was trimmed, false if not trimmed if bTest is true then the return: true is there are trailing spaces, false if not.

Definition at line 820 of file wincvs.cpp.

References NULL.

Referenced by DDV_CheckCVSROOT.

00821 {
00822     bool bRes = false;
00823
00824     char* pszPos = szValue;
00825     char* pszLastSpacePos = NULL;
00826
00827     //locate last white space
00828     while( *pszPos != '\0' )
00829     {
00830         if( isspace(*pszPos) )
00831         {
00832             if( pszLastSpacePos == NULL )
00833             {
00834                 pszLastSpacePos = pszPos;
00835             }
00836         }
00837         else
00838         {
00839             pszLastSpacePos = NULL;
00840         }
00841
00842         pszPos++;
00843     }
00844
00845     //and cut it off
00846     if( pszLastSpacePos )
00847     {
00848         if( !bTest )
00849         {
00850             *pszLastSpacePos = '\0';
00851         }
00852         bRes = true;
00853     }
00854
00855     return bRes;
00856 }

Variable Documentation

CCVS_CoworkerModule _Module

Definition at line 63 of file wincvs.cpp.

const CLSID clsid [static]

Initial value:

{ 0xd2d77dc2, 0x8299, 0x11d1, { 0x89, 0x49, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0 } }

Definition at line 230 of file wincvs.cpp.

CLogoutThread* sLogout = 0L [static]

Definition at line 175 of file wincvs.cpp.

CWincvsApp theApp

Definition at line 224 of file wincvs.cpp.

Generated on Sun Feb 24 01:24:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


wincvs.h File Reference

WinCvs/wincvs.h File Reference

#include "resource.h"
#include "MultiString.h"
#include "SmartComboBox.h"

Include dependency graph for wincvs.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CWincvsApp

Defines

#define | AFX_WINCVS_H__D2D77DC7_8299_11D1_8949_444553540000__INCLUDED_

Functions

void AFXAPI | DDV_CheckPathExists (CDataExchange *pDX, int nIDC, CString &value, bool promptForCreation=true)
Check the path is valid and prompt to create if not (depending on the promptForCreation parameter). More...

void AFXAPI | DDV_MinChars (CDataExchange *pDX, CString const &value, int nChars)
Verify the entry has at least nChars characters. More...

void AFXAPI | DDV_CheckCVSROOT (CDataExchange *pDX, CString &value)
Check whether the CVSROOT entered is valid, correct if not... More...

void AFXAPI | DDX_ComboMString (CDataExchange *pDX, int nIDC, CSmartComboBox &combo)
Note:
If pDX passed as NULL then the combo is populated.
 More...

Define Documentation

#define AFX_WINCVS_H__D2D77DC7_8299_11D1_8949_444553540000__INCLUDED_

Definition at line 25 of file wincvs.h.

Function Documentation

void AFXAPI DDV_CheckCVSROOT | ( | CDataExchange * | pDX,
 |  | CString & | value
 | ) |

Check whether the CVSROOT entered is valid, correct if not...

Definition at line 881 of file wincvs.cpp.

Referenced by CGetPrefs_CVSROOT::DoDataExchange.

00882 {
00883     //check after the trailing white spaces - often an unwanted result of copy-paste
00884     if( pDX->m_bSaveAndValidate &&
00885         TrimRight(value.GetBuffer(value.GetLength()+1), true) )
00886     {
00887         value.ReleaseBuffer();
00888
00889         if( AfxMessageBox("The CVSROOT value contains the trailing spaces. Do you want to trim them?", MB_ICONQUESTION | MB_YESNO) == IDYES )
00890         {
00891             TrimRight(value.GetBuffer(value.GetLength()+1));
00892             value.ReleaseBuffer();
00893         }
00894     }
00895 }

void AFXAPI DDV_CheckPathExists | ( | CDataExchange * | pDX,
 |  | int | nIDC,
 |  | CString & | value,
 |  | bool | promptForCreation = true
 | ) |

Check the path is valid and prompt to create if not (depending on the promptForCreation parameter).

Definition at line 859 of file wincvs.cpp.

Referenced by CCmdLine_MAIN::DoDataExchange, CImport_OPTIONS::DoDataExchange, CGetPrefs_WINCVS::DoDataExchange, and CCheckout_MAIN::DoDataExchange.

00860 {
00861     if( pDX->m_bSaveAndValidate )
00862     {
00863         if( !CompatMakeSurePathExists(value, false) )
00864         {
00865             if( CStr(value).endsWith(kPathDelimiter) )
00866             {
00867                 value.TrimRight(kPathDelimiter);
00868             }
00869
00870             if( !CompatMakeSurePathExists(value, promptForCreation) )
00871             {
00872                 AfxMessageBox("Cannot find folder: " + value);
00873                 pDX->PrepareEditCtrl(nIDC);
00874                 pDX->Fail();
00875             }
00876         }
00877     }
00878 }

void AFXAPI DDV_MinChars | ( | CDataExchange * | pDX,
 |  | CString const & | value,
 |  | int | nChars
 | ) |

Verify the entry has at least nChars characters.

Definition at line 934 of file wincvs.cpp.

Referenced by CUpdateMerge::DoDataExchange, CUpdateSticky::DoDataExchange, CTag_MAIN::DoDataExchange, CRtag_OPTIONS::DoDataExchange, CRtag_MAIN::DoDataExchange, CLogFilters::DoDataExchange, CCmdLine_MAIN::DoDataExchange, CImport_MAIN::DoDataExchange, GetValue::DoDataExchange, CGetPrefs_CVSROOT::DoDataExchange, CDiff_MAIN::DoDataExchange, CCommit_OPTIONS::DoDataExchange, CCheckout_OPTIONS::DoDataExchange, CCheckout_MAIN::DoDataExchange, and CAnnotate_MAIN::DoDataExchange.

00935 {
00936     ASSERT(nChars > 0);        // allow them something
00937     if (pDX->m_bSaveAndValidate && value.GetLength() < nChars)
00938     {
00939         TCHAR szT[255];
00940         wsprintf(szT, _T("Please enter more than %d character"), nChars);
00941         CString prompt;
00942         AfxMessageBox(szT, MB_ICONEXCLAMATION, AFX_IDP_PARSE_STRING_SIZE);
00943         prompt.Empty(); // exception prep
00944         pDX->Fail();
00945     }
00946 }

void AFXAPI DDX_ComboMString | ( | CDataExchange * | pDX,
 |  | int | nIDC,
 |  | CSmartComboBox & | combo
 | ) |

Note:
If pDX passed as NULL then the combo is populated.

Definition at line 898 of file wincvs.cpp.

Referenced by CUpdateMerge::DoDataExchange, CUpdateSticky::DoDataExchange, CTag_MAIN::DoDataExchange, CRtag_OPTIONS::DoDataExchange, CRtag_MAIN::DoDataExchange, CLogFilters::DoDataExchange, CCmdLine_MAIN::DoDataExchange, CImport_MAIN::DoDataExchange, CGetPrefs_CVSROOT::DoDataExchange, CDiff_MAIN::DoDataExchange, CCommit_OPTIONS::DoDataExchange, CCommit_MAIN::DoDataExchange, CCheckout_OPTIONS::DoDataExchange, CCheckout_MAIN::DoDataExchange, CAnnotate_MAIN::DoDataExchange, CDiff_MAIN::OnCheck1, CDiff_MAIN::OnCheck2, and CAnnotate_MAIN::OnIsdate.

00899 {
00900     CMString* mstr = combo.GetItems();
00901     ASSERT(mstr != NULL);
00902
00903     if( mstr )
00904     {
00905         if( !pDX || !pDX->m_bSaveAndValidate )
00906         {
00907             CString strOldText;
00908             combo.GetWindowText(strOldText);
00909
00910             combo.ResetContent();
00911
00912             const vector<CStr> & list = mstr->GetList();
00913             vector<CStr>::const_iterator i;
00914             for(i = list.begin(); i != list.end(); ++i)
00915             {
00916                 combo.AddString(*i);
00917             }
00918
00919             combo.SetWindowText(strOldText);
00920         }
00921         else
00922         {
00923             CString value;
00924             DDX_CBString(pDX, nIDC, value);
00925             if( !value.IsEmpty() )
00926             {
00927                 mstr->Insert(value);
00928             }
00929         }
00930     }
00931 }

Generated on Sun Feb 24 01:24:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


wincvs.odl File Reference

WinCvs/wincvs.odl File Reference

Go to the source code of this file.

Namespaces

namespace Wincvs

Generated on Sun Feb 24 01:24:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


wincvs_winutil.cpp File Reference

WinCvs/wincvs_winutil.cpp File Reference

#include "stdafx.h"
#include "wincvs_winutil.h"
#include "MultiString.h"
#include "wincvs.h"
#include "MainFrm.h"
#include "CustomizeMenus.h"
#include "CvsPrefs.h"
#include "TextBinary.h"

Include dependency graph for wincvs_winutil.cpp:

Include dependency graph

Go to the source code of this file.

Functions

CWnd * | FindNextSiblingWindow (CWnd *pWnd, BOOL CheckTabStop)
CWnd * | FindNextChildWindow (CWnd *pWnd, BOOL CheckTabStop)
CWnd * | GetNextParentWindow (CWnd *pWnd)
CWnd * | FindPrevSiblingWindow (CWnd *pWnd, BOOL CheckTabStop)
CWnd * | GetPrevParentWindow (CWnd *pWnd)
CWnd * | GetEndOfDecendantWindow (CWnd *pWnd)
BOOL | IsTargetWindow (CWnd *pWnd, BOOL CheckTabStop)
CWnd * | FindNextWindow (CWnd *pWnd, BOOL CheckTabStop)
CWnd * | FindPrevWindow (CWnd *pWnd, BOOL CheckTabStop)
void | updateUIMenu (CMenu *pMyMenu, CView *pThis)
CMenu * | GetSubCMenu (int nStartId, CView *pThis)
CMenu * | _GetMenuEntryRecurs (CMenu *menu, int nStartId, int &pos)
CMenu * | GetMenuEntry (int nStartId, int &pos)
CMMenuString | gFilesMenu (99,"P_FilesMenu", sDefFilesMenu)
CMMenuString | gBrowserMenu (99,"P_BrowserMenu", sDefBrowserMenu)
CMenu * | GetCustomMenu (int whichmenu, CView *pThis)
void | CustomizeMenus (int whichmenu)
bool | FormatMenuString (int cmd, CString &str)

Variables

char * | sDefBrowserMenu []
char * | sDefFilesMenu []

Function Documentation

CMenu* _GetMenuEntryRecurs | ( | CMenu * | menu,
 |  | int | nStartId,
 |  | int & | pos
 | ) |

Definition at line 275 of file wincvs_winutil.cpp.

Referenced by GetMenuEntry.

00276 {
00277     if(menu == 0L)
00278         return 0l;
00279
00280     int iPos;
00281     for (iPos = 0; iPos < menu->GetMenuItemCount(); iPos++)
00282     {
00283         UINT id = menu->GetMenuItemID(iPos);
00284         if(id == nStartId)
00285         {
00286             pos = iPos;
00287             return menu;
00288         }
00289
00290         if(id == (UINT)-1)
00291         {
00292             CMenu *res = _GetMenuEntryRecurs(menu->GetSubMenu(iPos), nStartId, pos);
00293             if(res != 0L)
00294                 return res;
00295         }
00296     }
00297
00298     return 0L;
00299 }

void CustomizeMenus ( int whichmenu )

Definition at line 475 of file wincvs_winutil.cpp.

References ASSERT, kCustomBrowserMenu, and kCustomFilesMenu.

00476 {
00477     CMMenuString *multiMenu;
00478
00479     switch(whichmenu)
00480     {
00481     case kCustomBrowserMenu:
00482         multiMenu = &gBrowserMenu;
00483         break;
00484     case kCustomFilesMenu:
00485         multiMenu = &gFilesMenu;
00486         break;
00487     default:
00488         ASSERT(0);
00489         return;
00490     }
00491
00492     CCustomizeMenus custom(multiMenu);
00493     if(custom.DoModal() == IDOK)
00494     {
00495         gCvsPrefs.save();
00496     }
00497 }

CWnd * FindNextChildWindow | ( | CWnd * | pWnd,
 |  | BOOL | CheckTabStop
 | ) |

Definition at line 106 of file wincvs_winutil.cpp.

References FindNextSiblingWindow, IsTargetWindow, and NULL.

Referenced by FindNextSiblingWindow, and FindNextWindow.

00107 {
00108     if (pWnd)
00109     {
00110         CWnd* pChildWnd = pWnd->GetTopWindow();
00111         while (pChildWnd)
00112         {
00113             if (IsTargetWindow(pChildWnd, CheckTabStop))
00114                 return pChildWnd;
00115             CWnd* pSiblingWnd = FindNextSiblingWindow(pChildWnd, CheckTabStop);
00116             if (pSiblingWnd)
00117                 return pSiblingWnd;
00118             pChildWnd = pChildWnd->GetTopWindow();
00119         }
00120     }
00121     return NULL;
00122 }

CWnd * FindNextSiblingWindow | ( | CWnd * | pWnd,
 |  | BOOL | CheckTabStop
 | ) |

Definition at line 88 of file wincvs_winutil.cpp.

References FindNextChildWindow, IsTargetWindow, and NULL.

Referenced by FindNextChildWindow, and FindNextWindow.

00089 {
00090     if (pWnd)
00091     {
00092         CWnd* pSiblingWnd = pWnd->GetNextWindow();
00093         while (pSiblingWnd)
00094         {
00095             if (IsTargetWindow(pSiblingWnd, CheckTabStop))
00096                 return pSiblingWnd;
00097             CWnd* pChildWnd = FindNextChildWindow(pSiblingWnd, CheckTabStop);
00098             if (pChildWnd)
00099                 return pChildWnd;
00100             pSiblingWnd = pSiblingWnd->GetNextWindow();
00101         }
00102     }
00103     return NULL;
00104 }

CWnd* FindNextWindow | ( | CWnd * | pWnd,
 |  | BOOL | CheckTabStop
 | ) |

Definition at line 35 of file wincvs_winutil.cpp.

References FindNextChildWindow, FindNextSiblingWindow, and GetNextParentWindow.

00036 {
00037     ASSERT_VALID(pWnd);
00038     if (pWnd)
00039     {
00040         CWnd* pNextWnd;
00041         pNextWnd = FindNextChildWindow(pWnd, CheckTabStop);
00042         if (pNextWnd)
00043             return pNextWnd;
00044
00045         pNextWnd = FindNextSiblingWindow(pWnd, CheckTabStop);
00046         if (pNextWnd)
00047             return pNextWnd;
00048
00049         CWnd* pParentWnd = GetNextParentWindow(pWnd);
00050         while ((pParentWnd) && (pNextWnd != pWnd))
00051         {
00052             pNextWnd = FindNextChildWindow(pParentWnd, CheckTabStop);
00053             if (pNextWnd)
00054                 return pNextWnd;
00055             pParentWnd = GetNextParentWindow(pParentWnd);
00056         }
00057     }
00058     return pWnd;
00059 }

CWnd * FindPrevSiblingWindow | ( | CWnd * | pWnd,
 |  | BOOL | CheckTabStop
 | ) |

Definition at line 163 of file wincvs_winutil.cpp.

References IsTargetWindow, and NULL.

Referenced by FindPrevWindow.

00164 {
00165     if (pWnd)
00166     {
00167         CWnd* pSiblingWnd = pWnd->GetWindow(GW_HWNDPREV);
00168         while (pSiblingWnd)
00169         {
00170             if (IsTargetWindow(pSiblingWnd, CheckTabStop))
00171                 return pSiblingWnd;
00172             pSiblingWnd = pSiblingWnd->GetWindow(GW_HWNDPREV);
00173         }
00174     }
00175     return NULL;
00176 }

CWnd* FindPrevWindow | ( | CWnd * | pWnd,
 |  | BOOL | CheckTabStop
 | ) |

Definition at line 124 of file wincvs_winutil.cpp.

References FindPrevSiblingWindow, GetEndOfDecendantWindow, GetPrevParentWindow, IsTargetWindow, and NULL.

00125 {
00126     ASSERT_VALID(pWnd);
00127     if (pWnd)
00128     {
00129         CWnd* pWndCrntLevel = pWnd;
00130         while (TRUE)
00131         {
00132             CWnd* pFoundWnd;
00133             pFoundWnd = FindPrevSiblingWindow(pWndCrntLevel, CheckTabStop);
00134             if (pFoundWnd)
00135                 return pFoundWnd;
00136             pWndCrntLevel = GetPrevParentWindow(pWndCrntLevel);
00137             if (!pWndCrntLevel)
00138             {
00139                 pFoundWnd = GetEndOfDecendantWindow(pWnd->GetParentFrame());
00140                 if (IsTargetWindow(pFoundWnd, CheckTabStop))
00141                     return pFoundWnd;
00142                 pWndCrntLevel = pFoundWnd;
00143             }
00144         }
00145     }
00146     return NULL;
00147 }

bool FormatMenuString | ( | int | cmd,
 |  | CString & | str
 | ) |

Definition at line 499 of file wincvs_winutil.cpp.

References CStr, ID_VIEW_EDITSELDEF, SplitPath, and TRUE.

00500 {
00501     bool res = false;
00502
00503     switch(cmd)
00504     {
00505     case ID_VIEW_EDITSELDEF:
00506         {
00507             CString viever("default viewer");
00508             if( gCvsPrefs.Viewer() != 0L )
00509             {
00510                 CStr uppath, folder;
00511                 SplitPath(gCvsPrefs.Viewer(), uppath, folder);
00512
00513                 viever = folder.empty() ? (uppath.empty() ? gCvsPrefs.Viewer() : uppath) : folder;
00514                 if( viever.Find(" ") > -1 )
00515                 {
00516                     viever = "\"" + viever + "\"";
00517                 }
00518             }
00519             str = "View &with " + viever;
00520
00521         }
00522         res = TRUE;
00523         break;
00524
00525     default:
00526         break;
00527     }
00528
00529     return res;
00530 }

CMMenuString gBrowserMenu | ( | 99 | ,
 |  | "P_BrowserMenu" | ,
 |  | sDefBrowserMenu |
 | ) | [static]

CMenu* GetCustomMenu | ( | int | whichmenu,
 |  | CView * | pThis
 | ) |

Definition at line 414 of file wincvs_winutil.cpp.

References ASSERT, CustInvertTable::cmd, CustGetByKey, FormatMenuString, CMMenuString::GetList, ID_CUST_FILES_MENU, ID_CUST_FOLDER_MENU, kCustomBrowserMenu, kCustomFilesMenu, CustInvertTable::title, updateUIMenu, and VERIFY.

00415 {
00416     CMMenuString *multiMenu;
00417
00418     switch(whichmenu)
00419     {
00420     case kCustomBrowserMenu:
00421         multiMenu = &gBrowserMenu;
00422         break;
00423     case kCustomFilesMenu:
00424         multiMenu = &gFilesMenu;
00425         break;
00426     default:
00427         ASSERT(0);
00428         return 0L;
00429     }
00430
00431     CMenu *res = new CMenu;
00432     VERIFY(res->CreatePopupMenu());
00433
00434     std::vector<UStr> & list = multiMenu->GetList();
00435     std::vector<UStr>::iterator i;
00436
00437     for(i = list.begin(); i != list.end(); ++i)
00438     {
00439         const CustInvertTable *tab = CustGetByKey(*i);
00440         if(tab == 0L)
00441         {
00442             TRACE1("Hum... was '%s' an old command ? Removing it...",
00443                 (const char *)*i);
00444             list.erase(i);
00445             i = list.begin();
00446         }
00447     }
00448
00449     for(i = list.begin(); i != list.end(); ++i)
00450     {
00451         const CustInvertTable *tab = CustGetByKey(*i);
00452
00453         if(tab->cmd == ID_SEPARATOR)
00454         {
00455             res->AppendMenu(MF_SEPARATOR);
00456         }
00457         else
00458         {
00459             CString str = tab->title;
00460             FormatMenuString(tab->cmd, str);
00461             res->AppendMenu(MF_STRING, tab->cmd, str);
00462         }
00463     }
00464
00465     res->AppendMenu(MF_SEPARATOR);
00466     res->AppendMenu(MF_STRING, whichmenu == kCustomFilesMenu ?
00467         ID_CUST_FILES_MENU : ID_CUST_FOLDER_MENU,
00468         CString("Customize this menu..."));
00469
00470     updateUIMenu(res, pThis);
00471
00472     return res;
00473 }

CWnd * GetEndOfDecendantWindow ( CWnd * pWnd )

Definition at line 178 of file wincvs_winutil.cpp.

Referenced by FindPrevWindow.

00179 {
00180     CWnd* pTmpWnd = pWnd;
00181     CWnd* pPreTmpWnd;
00182     while (pTmpWnd)
00183     {
00184         pPreTmpWnd = pTmpWnd;
00185         pTmpWnd = pTmpWnd->GetWindow(GW_CHILD);
00186         if (pTmpWnd)
00187         {
00188             pPreTmpWnd = pTmpWnd;
00189             pTmpWnd = pTmpWnd->GetWindow(GW_HWNDLAST);
00190         }
00191     }
00192     return pPreTmpWnd;
00193 }

CMenu* GetMenuEntry | ( | int | nStartId,
 |  | int & | pos
 | ) |

Definition at line 301 of file wincvs_winutil.cpp.

References _GetMenuEntryRecurs, and ASSERT.

00302 {
00303     CMenu* pTopMenu = AfxGetMainWnd()->GetMenu();
00304     ASSERT(pTopMenu != 0L);
00305
00306     return _GetMenuEntryRecurs(pTopMenu, nStartId, pos);
00307 }

CWnd * GetNextParentWindow ( CWnd * pWnd )

Definition at line 61 of file wincvs_winutil.cpp.

References FALSE, NULL, and TRUE.

Referenced by FindNextWindow.

00062 {
00063     if (pWnd)
00064     {
00065         if (pWnd->IsKindOf(RUNTIME_CLASS(CFrameWnd)))
00066             return pWnd->GetTopWindow();
00067
00068         CFrameWnd* pFrameWnd = pWnd->GetParentFrame();
00069         ASSERT_VALID(pFrameWnd);
00070         CWnd* pParentWnd = pWnd->GetParent();
00071         ASSERT_VALID(pParentWnd);
00072
00073         CWnd* pCrntWnd;
00074         BOOL bFound = FALSE;
00075         while ((!bFound) && (pParentWnd != pFrameWnd))
00076         {
00077             pCrntWnd = pParentWnd->GetNextWindow();
00078             if (pCrntWnd)
00079                 bFound = TRUE;
00080             else
00081                 pParentWnd = pParentWnd->GetParent();
00082         }
00083         return (bFound) ? pCrntWnd : pParentWnd->GetTopWindow();
00084     }
00085     return NULL;
00086 }

CWnd * GetPrevParentWindow ( CWnd * pWnd )

Definition at line 149 of file wincvs_winutil.cpp.

References NULL.

Referenced by FindPrevWindow.

00150 {
00151     if (pWnd)
00152     {
00153         if (!pWnd->IsKindOf(RUNTIME_CLASS(CFrameWnd)))
00154         {
00155             CWnd* pParentWnd = pWnd->GetParent();
00156             ASSERT_VALID(pParentWnd);
00157             return pParentWnd;
00158         }
00159     }
00160     return NULL;
00161 }

CMenu* GetSubCMenu | ( | int | nStartId,
 |  | CView * | pThis
 | ) |

Definition at line 248 of file wincvs_winutil.cpp.

References ASSERT, NULL, and updateUIMenu.

00249 {
00250     CMenu* pTopMenu = AfxGetMainWnd()->GetMenu();
00251     ASSERT(pTopMenu != 0L);
00252     if(pTopMenu == 0L)
00253         return NULL;
00254
00255     CMenu* pMyMenu=NULL;
00256     int iPos;
00257     for (iPos = pTopMenu->GetMenuItemCount()-1; iPos >= 0; iPos--)
00258     {
00259         CMenu* pMenu = pTopMenu->GetSubMenu(iPos);
00260         if (pMenu && pMenu->GetMenuItemID(0) == nStartId)
00261         {
00262             pMyMenu = pMenu;
00263             break;
00264         }
00265     }
00266     ASSERT(pMyMenu != 0L);
00267     if(pMyMenu == 0L)
00268         return NULL;
00269
00270     updateUIMenu(pMyMenu, pThis);
00271
00272     return pMyMenu;
00273 }

CMMenuString gFilesMenu | ( | 99 | ,
 |  | "P_FilesMenu" | ,
 |  | sDefFilesMenu |
 | ) | [static]

BOOL IsTargetWindow | ( | CWnd * | pWnd,
 |  | BOOL | CheckTabStop
 | ) | [inline]

Definition at line 27 of file wincvs_winutil.cpp.

Referenced by FindNextChildWindow, FindNextSiblingWindow, FindPrevSiblingWindow, and FindPrevWindow.

00028 {
00029     return ((!CheckTabStop) || (WS_TABSTOP & pWnd->GetStyle()));
00030 }

void updateUIMenu | ( | CMenu * | pMyMenu,
 |  | CView * | pThis
 | ) | [static]

Definition at line 195 of file wincvs_winutil.cpp.

References ASSERT, FALSE, NULL, and TRUE.

Referenced by GetCustomMenu, and GetSubCMenu.

00196 {
00197     CCmdUI state;
00198     state.m_pMenu = pMyMenu;
00199
00200     state.m_nIndexMax = pMyMenu->GetMenuItemCount();
00201     for (state.m_nIndex = 0; state.m_nIndex < state.m_nIndexMax;
00202       state.m_nIndex++)
00203     {
00204         state.m_nID = pMyMenu->GetMenuItemID(state.m_nIndex);
00205         if (state.m_nID == 0)
00206             continue; // menu separator or invalid cmd - ignore it
00207
00208         ASSERT(state.m_pOther == NULL);
00209         ASSERT(state.m_pMenu != NULL);
00210         if (state.m_nID == (UINT)-1)
00211         {
00212             // possibly a popup menu, route to first item of that popup
00213             state.m_pSubMenu = pMyMenu->GetSubMenu(state.m_nIndex);
00214             if (state.m_pSubMenu == NULL ||
00215                 (state.m_nID = state.m_pSubMenu->GetMenuItemID(0)) == 0 ||
00216                 state.m_nID == (UINT)-1)
00217             {
00218                 continue;       // first item of popup can't be routed to
00219             }
00220             state.DoUpdate(pThis, FALSE);    // popups are never auto disabled
00221         }
00222         else
00223         {
00224             // normal menu item
00225             // Auto enable/disable if frame window has 'm_bAutoMenuEnable'
00226             //    set and command is _not_ a system command.
00227             state.m_pSubMenu = NULL;
00228             state.DoUpdate(pThis, TRUE);
00229         }
00230
00231 #   if 0 /* ??? */
00232         // adjust for menu deletions and additions
00233         UINT nCount = pMyMenu->GetMenuItemCount();
00234         if (nCount < state.m_nIndexMax)
00235         {
00236             state.m_nIndex -= (state.m_nIndexMax - nCount);
00237             while (state.m_nIndex < nCount &&
00238                 pMyMenu->GetMenuItemID(state.m_nIndex) == state.m_nID)
00239             {
00240                 state.m_nIndex++;
00241             }
00242         }
00243         state.m_nIndexMax = nCount;
00244 #   endif
00245     }
00246 }

Variable Documentation

char* sDefBrowserMenu[]

Initial value:

{
    "ID_VIEW_UPDATE",
    "ID_VIEW_COMMIT",
    "ID_SEPARATOR",
    "ID_VIEW_EXPLORE",
    "ID_VIEW_QUERYUPDATE",
    "ID_VIEW_RELOAD",
    "ID_SEPARATOR",
    "ID_VIEW_IMPORT",
    "ID_VIEW_CHECKOUT",
    0L
}

Definition at line 377 of file wincvs_winutil.cpp.

char* sDefFilesMenu[]

Initial value:

{
    "ID_VIEW_UPDATE",
    "ID_VIEW_COMMIT",
    "ID_SEPARATOR",
    "ID_VIEW_EXPLORE",
    "ID_VIEW_QUERYUPDATE",
    "ID_VIEW_RELOAD",
    "ID_SEPARATOR",
    "ID_VIEW_EDITSEL",
    "ID_VIEW_EDITSELDEF",
    "ID_SEPARATOR",
    "ID_VIEW_DIFF",
    "ID_VIEW_LOG",
    "ID_VIEW_STATUS",
    "ID_VIEW_GRAPH",
    "ID_QUERY_ANNOTATE",
    0L
}

Definition at line 391 of file wincvs_winutil.cpp.

Generated on Sun Feb 24 01:24:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


wincvs_winutil.h File Reference

WinCvs/wincvs_winutil.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CWndRedrawMngr
CWndRedrawManager supports efficient drawing of CWnd based windows,. More...

Enumerations

enum {
kCustomBrowserMenu,
kCustomFilesMenu
}

Functions

CWnd * | FindNextWindow (CWnd *pWnd, BOOL CheckTabStop=TRUE)
CWnd * | FindPrevWindow (CWnd *pWnd, BOOL CheckTabStop=TRUE)
CMenu * | GetSubCMenu (int nStartId, CView *pThis)
CMenu * | GetMenuEntry (int nStartId, int &pos)
CMenu * | GetCustomMenu (int whichmenu, CView *pThis)
void | CustomizeMenus (int whichmenu)
bool | FormatMenuString (int cmd, CString &str)

Enumeration Type Documentation

anonymous enum

Enumeration values:
kCustomBrowserMenu
kCustomFilesMenu

Definition at line 13 of file wincvs_winutil.h.

00014 {
00015     kCustomBrowserMenu,
00016     kCustomFilesMenu
00017 };

Function Documentation

void CustomizeMenus ( int whichmenu )

Definition at line 475 of file wincvs_winutil.cpp.

Referenced by CWinCvsBrowser::OnCustomize, and CBrowseFileView::OnCustomize.

00476 {
00477     CMMenuString *multiMenu;
00478
00479     switch(whichmenu)
00480     {
00481     case kCustomBrowserMenu:
00482         multiMenu = &gBrowserMenu;
00483         break;
00484     case kCustomFilesMenu:
00485         multiMenu = &gFilesMenu;
00486         break;
00487     default:
00488         ASSERT(0);
00489         return;
00490     }
00491
00492     CCustomizeMenus custom(multiMenu);
00493     if(custom.DoModal() == IDOK)
00494     {
00495         gCvsPrefs.save();
00496     }
00497 }

CWnd* FindNextWindow | ( | CWnd * | pWnd,
 |  | BOOL | CheckTabStop = TRUE
 | ) |

Definition at line 35 of file wincvs_winutil.cpp.

References FALSE.

00036 {
00037     ASSERT_VALID(pWnd);
00038     if (pWnd)
00039     {
00040         CWnd* pNextWnd;
00041         pNextWnd = FindNextChildWindow(pWnd, CheckTabStop);
00042         if (pNextWnd)
00043             return pNextWnd;
00044
00045         pNextWnd = FindNextSiblingWindow(pWnd, CheckTabStop);
00046         if (pNextWnd)
00047             return pNextWnd;
00048
00049         CWnd* pParentWnd = GetNextParentWindow(pWnd);
00050         while ((pParentWnd) && (pNextWnd != pWnd))
00051         {
00052             pNextWnd = FindNextChildWindow(pParentWnd, CheckTabStop);
00053             if (pNextWnd)
00054                 return pNextWnd;
00055             pParentWnd = GetNextParentWindow(pParentWnd);
00056         }
00057     }
00058     return pWnd;
00059 }

CWnd* FindPrevWindow | ( | CWnd * | pWnd,
 |  | BOOL | CheckTabStop = TRUE
 | ) |

Definition at line 124 of file wincvs_winutil.cpp.

00125 {
00126     ASSERT_VALID(pWnd);
00127     if (pWnd)
00128     {
00129         CWnd* pWndCrntLevel = pWnd;
00130         while (TRUE)
00131         {
00132             CWnd* pFoundWnd;
00133             pFoundWnd = FindPrevSiblingWindow(pWndCrntLevel, CheckTabStop);
00134             if (pFoundWnd)
00135                 return pFoundWnd;
00136             pWndCrntLevel = GetPrevParentWindow(pWndCrntLevel);
00137             if (!pWndCrntLevel)
00138             {
00139                 pFoundWnd = GetEndOfDecendantWindow(pWnd->GetParentFrame());
00140                 if (IsTargetWindow(pFoundWnd, CheckTabStop))
00141                     return pFoundWnd;
00142                 pWndCrntLevel = pFoundWnd;
00143             }
00144         }
00145     }
00146     return NULL;
00147 }

bool FormatMenuString | ( | int | cmd,
 |  | CString & | str
 | ) |

Definition at line 499 of file wincvs_winutil.cpp.

Referenced by GetCustomMenu, and CBrowseFileView::OnUpdateViewEditseldef.

00500 {
00501     bool res = false;
00502
00503     switch(cmd)
00504     {
00505     case ID_VIEW_EDITSELDEF:
00506         {
00507             CString viever("default viewer");
00508             if( gCvsPrefs.Viewer() != 0L )
00509             {
00510                 CStr uppath, folder;
00511                 SplitPath(gCvsPrefs.Viewer(), uppath, folder);
00512
00513                 viever = folder.empty() ? (uppath.empty() ? gCvsPrefs.Viewer() : uppath) : folder;
00514                 if( viever.Find(" ") > -1 )
00515                 {
00516                     viever = "\"" + viever + "\"";
00517                 }
00518             }
00519             str = "View &with " + viever;
00520
00521         }
00522         res = TRUE;
00523         break;
00524
00525     default:
00526         break;
00527     }
00528
00529     return res;
00530 }

CMenu* GetCustomMenu | ( | int | whichmenu,
 |  | CView * | pThis
 | ) |

Definition at line 414 of file wincvs_winutil.cpp.

00415 {
00416     CMMenuString *multiMenu;
00417
00418     switch(whichmenu)
00419     {
00420     case kCustomBrowserMenu:
00421         multiMenu = &gBrowserMenu;
00422         break;
00423     case kCustomFilesMenu:
00424         multiMenu = &gFilesMenu;
00425         break;
00426     default:
00427         ASSERT(0);
00428         return 0L;
00429     }
00430
00431     CMenu *res = new CMenu;
00432     VERIFY(res->CreatePopupMenu());
00433
00434     std::vector<UStr> & list = multiMenu->GetList();
00435     std::vector<UStr>::iterator i;
00436
00437     for(i = list.begin(); i != list.end(); ++i)
00438     {
00439         const CustInvertTable *tab = CustGetByKey(*i);
00440         if(tab == 0L)
00441         {
00442             TRACE1("Hum... was '%s' an old command ? Removing it...",
00443                 (const char *)*i);
00444             list.erase(i);
00445             i = list.begin();
00446         }
00447     }
00448
00449     for(i = list.begin(); i != list.end(); ++i)
00450     {
00451         const CustInvertTable *tab = CustGetByKey(*i);
00452
00453         if(tab->cmd == ID_SEPARATOR)
00454         {
00455             res->AppendMenu(MF_SEPARATOR);
00456         }
00457         else
00458         {
00459             CString str = tab->title;
00460             FormatMenuString(tab->cmd, str);
00461             res->AppendMenu(MF_STRING, tab->cmd, str);
00462         }
00463     }
00464
00465     res->AppendMenu(MF_SEPARATOR);
00466     res->AppendMenu(MF_STRING, whichmenu == kCustomFilesMenu ?
00467         ID_CUST_FILES_MENU : ID_CUST_FOLDER_MENU,
00468         CString("Customize this menu..."));
00469
00470     updateUIMenu(res, pThis);
00471
00472     return res;
00473 }

CMenu* GetMenuEntry | ( | int | nStartId,
 |  | int & | pos
 | ) |

Definition at line 301 of file wincvs_winutil.cpp.

Referenced by cvsgui_GetTopMacroAdminMenu, and cvsgui_GetTopMacroSelectionMenu.

00302 {
00303     CMenu* pTopMenu = AfxGetMainWnd()->GetMenu();
00304     ASSERT(pTopMenu != 0L);
00305
00306     return _GetMenuEntryRecurs(pTopMenu, nStartId, pos);
00307 }

CMenu* GetSubCMenu | ( | int | nStartId,
 |  | CView * | pThis
 | ) |

Definition at line 248 of file wincvs_winutil.cpp.

00249 {
00250     CMenu* pTopMenu = AfxGetMainWnd()->GetMenu();
00251     ASSERT(pTopMenu != 0L);
00252     if(pTopMenu == 0L)
00253         return NULL;
00254
00255     CMenu* pMyMenu=NULL;
00256     int iPos;
00257     for (iPos = pTopMenu->GetMenuItemCount()-1; iPos >= 0; iPos--)
00258     {
00259         CMenu* pMenu = pTopMenu->GetSubMenu(iPos);
00260         if (pMenu && pMenu->GetMenuItemID(0) == nStartId)
00261         {
00262             pMyMenu = pMenu;
00263             break;
00264         }
00265     }
00266     ASSERT(pMyMenu != 0L);
00267     if(pMyMenu == 0L)
00268         return NULL;
00269
00270     updateUIMenu(pMyMenu, pThis);
00271
00272     return pMyMenu;
00273 }

Generated on Sun Feb 24 01:24:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvsBrowser.cpp File Reference

WinCvs/WinCvsBrowser.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "MainFrm.h"
#include "WinCvsBrowser.h"
#include "FileTraversal.h"
#include "AppConsole.h"
#include "CvsPrefs.h"
#include "CvsCommands.h"
#include "BrowseFileView.h"
#include "TclGlue.h"
#include "MacrosSetup.h"
#include "wincvs_winutil.h"
#include "PythonGlue.h"
#include "umain.h"
#include "resource.h"

Include dependency graph for WinCvsBrowser.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | TBrowserFill
class | TBrowserFillDummy

Enumerations

enum {
kIconFolderClosed,
kIconFolderOpened,
kIconFolderCVSClosed,
kIconFolderCVSOpened,
kIconFolderIgnoreClosed,
kIconFolderIgnoreOpened,
kIconFolderIgnoreLost
}

Functions

void | SetIcon (CTreeCtrl &treeCtrl, HTREEITEM item, bool hasCvsInfos, bool expand, EntnodeData *data=0L)
void | onIgnoreChanged (CObject *obj)

Variables

const int | WM_RESETVIEW = WM_APP + 12
const char * | gDummyFile = "@@@dummy file@@@"

Enumeration Type Documentation

anonymous enum

Enumeration values:
kIconFolderClosed
kIconFolderOpened
kIconFolderCVSClosed
kIconFolderCVSOpened
kIconFolderIgnoreClosed
kIconFolderIgnoreOpened
kIconFolderIgnoreLost

Definition at line 32 of file WinCvsBrowser.cpp.

00033 {
00034     kIconFolderClosed,
00035     kIconFolderOpened,
00036     kIconFolderCVSClosed,
00037     kIconFolderCVSOpened,
00038     kIconFolderIgnoreClosed,
00039     kIconFolderIgnoreOpened,
00040     kIconFolderIgnoreLost
00041 };

Function Documentation

void onIgnoreChanged ( CObject * obj ) [static]

Definition at line 947 of file WinCvsBrowser.cpp.

Referenced by CWinCvsBrowser::OnInitialUpdate.

00948 {
00949     ((CWinCvsBrowser *)obj)->OnIgnoreChanged();
00950 }

void SetIcon | ( | CTreeCtrl & | treeCtrl,
 |  | HTREEITEM | item,
 |  | bool | hasCvsInfos,
 |  | bool | expand,
 |  | EntnodeData * | data = 0L
 | ) | [static]

Definition at line 237 of file WinCvsBrowser.cpp.

References kIconFolderClosed, kIconFolderCVSClosed, kIconFolderCVSOpened, kIconFolderIgnoreClosed, kIconFolderIgnoreOpened, kIconFolderOpened, and VERIFY.

Referenced by CCJBrowseButton::Create, TBrowserFill::ExitDirectory, TBrowserFillDummy::ExitDirectory, TBrowserFill::OnDirectory, and CCJFlatButton::SetIcon.

00239 {
00240     TV_ITEM pItem;
00241     pItem.hItem = item;
00242     pItem.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
00243     VERIFY(treeCtrl.GetItem(&pItem));
00244
00245     int newImage;
00246     if(data == 0L)
00247     {
00248         if(expand)
00249             newImage = hasCvsInfos ? kIconFolderCVSOpened : kIconFolderOpened;
00250         else
00251             newImage = hasCvsInfos ? kIconFolderCVSClosed : kIconFolderClosed;
00252     }
00253     else
00254     {
00255         if(expand)
00256         {
00257             if(data->IsIgnored())
00258                 newImage = kIconFolderIgnoreOpened;
00259             else if(data->IsUnknown())
00260                 newImage = kIconFolderOpened;
00261             else
00262                 newImage = kIconFolderCVSOpened;
00263         }
00264         else
00265         {
00266             if(data->IsIgnored())
00267                 newImage = kIconFolderIgnoreClosed;
00268             else if(data->IsUnknown())
00269                 newImage = kIconFolderClosed;
00270             else
00271                 newImage = kIconFolderCVSClosed;
00272         }
00273     }
00274
00275     if(pItem.iImage != newImage)
00276     {
00277         pItem.iImage = newImage;
00278         pItem.iSelectedImage = newImage;
00279         pItem.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
00280         treeCtrl.SetItem(&pItem);
00281     }
00282 }

Variable Documentation

const char* gDummyFile = "@@@dummy file@@@" [static]

Definition at line 114 of file WinCvsBrowser.cpp.

Referenced by TBrowserFillDummy::ExitDirectory.

const int WM_RESETVIEW = WM_APP + 12 [static]

Definition at line 30 of file WinCvsBrowser.cpp.

Referenced by CWinCvsBrowser::OnIgnoreChanged.

Generated on Sun Feb 24 01:24:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvsBrowser.h File Reference

WinCvs/WinCvsBrowser.h File Reference

#include <afxcview.h>
#include "CPStr.h"

Include dependency graph for WinCvsBrowser.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CWinCvsBrowser::CSelectionChangeNotifier
class | CWinCvsBrowser

Defines

#define | AFX_WINCVSBROWSER_H__144A4971_CAB4_11D1_BC80_000000000000__INCLUDED_

Define Documentation

#define AFX_WINCVSBROWSER_H__144A4971_CAB4_11D1_BC80_000000000000__INCLUDED_

Definition at line 2 of file WinCvsBrowser.h.

Generated on Sun Feb 24 01:24:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvsDebug.cpp File Reference

WinCvs/WinCvsDebug.cpp File Reference

#include "stdafx.h"
#include "WinCvsDebug.h"

Include dependency graph for WinCvsDebug.cpp:

Include dependency graph

Go to the source code of this file.

Functions

unsigned long | GetWinCvsDebugMask (bool clear_mask)
void | SetWinCvsDebugMask (unsigned long umask)
void | AppendWinCvsDebugMask (unsigned long umask)
void | SetWinCvsDebugMaskBit (unsigned char bit, bool val)
bool | GetWinCvsDebugMaskBit (unsigned char bit, bool clear_mask)

Variables

unsigned long | wincvs_debug_mask = 0L

Function Documentation

void AppendWinCvsDebugMask ( unsigned long umask )

Definition at line 46 of file WinCvsDebug.cpp.

References wincvs_debug_mask.

00047 {
00048     wincvs_debug_mask = wincvs_debug_mask | umask;
00049 }

unsigned long GetWinCvsDebugMask ( bool clear_mask )

Definition at line 33 of file WinCvsDebug.cpp.

References wcvsdbg_one_shot, and wincvs_debug_mask.

00034 {
00035     unsigned long retval = wincvs_debug_mask;
00036     if ( clear_mask && (wincvs_debug_mask & wcvsdbg_one_shot) )
00037         wincvs_debug_mask = wcvsdbg_one_shot;
00038     return retval;
00039 }

bool GetWinCvsDebugMaskBit | ( | unsigned char | bit,
 |  | bool | clear_mask
 | ) |

Definition at line 67 of file WinCvsDebug.cpp.

References wcvsdbg_one_shot, wcvsdbg_one_shot_bit, and wincvs_debug_mask.

00068 {
00069     bool retval = (wincvs_debug_mask & (1 << bit)) != 0;
00070     if ( clear_mask && (wincvs_debug_mask & wcvsdbg_one_shot) && (bit != wcvsdbg_one_shot_bit) )
00071     {
00072         wincvs_debug_mask = wincvs_debug_mask & ~(1 << bit);
00073     }
00074     return retval;
00075 }

void SetWinCvsDebugMask ( unsigned long umask )

Definition at line 41 of file WinCvsDebug.cpp.

References wincvs_debug_mask.

00042 {
00043     wincvs_debug_mask = umask;
00044 }

void SetWinCvsDebugMaskBit | ( | unsigned char | bit,
 |  | bool | val
 | ) |

Definition at line 51 of file WinCvsDebug.cpp.

References wincvs_debug_mask.

00052 {
00053     if (bit > sizeof(wincvs_debug_mask) * 8)
00054     {
00055         return;
00056     }
00057     if (val)
00058     {
00059         wincvs_debug_mask = wincvs_debug_mask | 1 << bit;
00060     }
00061     else
00062     {
00063         wincvs_debug_mask = wincvs_debug_mask & ~(1 << bit);
00064     }
00065 }

Variable Documentation

unsigned long wincvs_debug_mask = 0L [static]

Definition at line 30 of file WinCvsDebug.cpp.

Referenced by AppendWinCvsDebugMask, GetWinCvsDebugMask, GetWinCvsDebugMaskBit, SetWinCvsDebugMask, and SetWinCvsDebugMaskBit.

Generated on Sun Feb 24 01:24:03 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvsDebug.h File Reference

WinCvs/WinCvsDebug.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | WINCVSDEBUG_H_INCLUDED

Enumerations

enum wcvs_debug_mask_bits {
wcvsdbg_one_shot_bit = 0,
wcvsdbg_verbose_bit,
wcvsdbg_trace_dst_checks_bit,
wcvsdbg_trace_modified_checks_bit,
wcvsdbg_trace_stat_bit
}
enum wcvs_debug_mask_flags {
wcvsdbg_one_shot = 1L << wcvsdbg_one_shot_bit,
wcvsdbg_verbose = 1L << wcvsdbg_verbose_bit,
wcvsdbg_trace_dst_checks = 1L << wcvsdbg_trace_dst_checks_bit,
wcvsdbg_trace_modified_checks = 1L << wcvsdbg_trace_modified_checks_bit,
wcvsdbg_trace_stat = 1L << wcvsdbg_trace_stat_bit
}

Functions

unsigned long | GetWinCvsDebugMask (bool clear_mask=true)
bool | GetWinCvsDebugMaskBit (unsigned char bit, bool clear_mask=true)
void | SetWinCvsDebugMask (unsigned long umask)
void | AppendWinCvsDebugMask (unsigned long umask)
void | SetWinCvsDebugMaskBit (unsigned char bit, bool val)

Define Documentation

#define WINCVSDEBUG_H_INCLUDED

Definition at line 27 of file WinCvsDebug.h.

Enumeration Type Documentation

enum wcvs_debug_mask_bits

Enumeration values:
wcvsdbg_one_shot_bit
wcvsdbg_verbose_bit
wcvsdbg_trace_dst_checks_bit
wcvsdbg_trace_modified_checks_bit
wcvsdbg_trace_stat_bit

Definition at line 29 of file WinCvsDebug.h.

00030 {
00031     wcvsdbg_one_shot_bit = 0,
00032     wcvsdbg_verbose_bit,
00033     wcvsdbg_trace_dst_checks_bit,
00034     wcvsdbg_trace_modified_checks_bit,
00035     wcvsdbg_trace_stat_bit
00036 };

enum wcvs_debug_mask_flags

Enumeration values:
wcvsdbg_one_shot
wcvsdbg_verbose
wcvsdbg_trace_dst_checks
wcvsdbg_trace_modified_checks
wcvsdbg_trace_stat

Definition at line 38 of file WinCvsDebug.h.

00039 {
00040     wcvsdbg_one_shot = 1L << wcvsdbg_one_shot_bit,
00041     wcvsdbg_verbose = 1L << wcvsdbg_verbose_bit,
00042     wcvsdbg_trace_dst_checks = 1L << wcvsdbg_trace_dst_checks_bit,
00043     wcvsdbg_trace_modified_checks = 1L << wcvsdbg_trace_modified_checks_bit,
00044     wcvsdbg_trace_stat = 1L << wcvsdbg_trace_stat_bit
00045 };

Function Documentation

void AppendWinCvsDebugMask ( unsigned long umask )

Definition at line 46 of file WinCvsDebug.cpp.

Referenced by FileTraverse.

00047 {
00048     wincvs_debug_mask = wincvs_debug_mask | umask;
00049 }

unsigned long GetWinCvsDebugMask ( bool clear_mask = true )

Definition at line 33 of file WinCvsDebug.cpp.

References wcvsdbg_trace_dst_checks_bit, wcvsdbg_trace_modified_checks_bit, and wcvsdbg_trace_stat_bit.

Referenced by FileTraverse, and tclGetDebugMaskProc.

00034 {
00035     unsigned long retval = wincvs_debug_mask;
00036     if ( clear_mask && (wincvs_debug_mask & wcvsdbg_one_shot) )
00037         wincvs_debug_mask = wcvsdbg_one_shot;
00038     return retval;
00039 }

bool GetWinCvsDebugMaskBit | ( | unsigned char | bit,
 |  | bool | clear_mask = true
 | ) |

Definition at line 67 of file WinCvsDebug.cpp.

Referenced by Entries_SetVisited, FileTimeToUnixTime, and tclGetDebugMaskProc.

00068 {
00069     bool retval = (wincvs_debug_mask & (1 << bit)) != 0;
00070     if ( clear_mask && (wincvs_debug_mask & wcvsdbg_one_shot) && (bit != wcvsdbg_one_shot_bit) )
00071     {
00072         wincvs_debug_mask = wincvs_debug_mask & ~(1 << bit);
00073     }
00074     return retval;
00075 }

void SetWinCvsDebugMask ( unsigned long umask )

Definition at line 41 of file WinCvsDebug.cpp.

References wcvsdbg_trace_dst_checks, wcvsdbg_trace_dst_checks_bit, wcvsdbg_trace_modified_checks, wcvsdbg_trace_modified_checks_bit, wcvsdbg_trace_stat, wcvsdbg_trace_stat_bit, wcvsdbg_verbose, and wcvsdbg_verbose_bit.

Referenced by FileTraverse, and tclSetDebugMaskProc.

00042 {
00043     wincvs_debug_mask = umask;
00044 }

void SetWinCvsDebugMaskBit | ( | unsigned char | bit,
 |  | bool | val
 | ) |

Definition at line 51 of file WinCvsDebug.cpp.

Referenced by tclSetDebugMaskProc.

00052 {
00053     if (bit > sizeof(wincvs_debug_mask) * 8)
00054     {
00055         return;
00056     }
00057     if (val)
00058     {
00059         wincvs_debug_mask = wincvs_debug_mask | 1 << bit;
00060     }
00061     else
00062     {
00063         wincvs_debug_mask = wincvs_debug_mask & ~(1 << bit);
00064     }
00065 }

Generated on Sun Feb 24 01:24:03 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


wincvsDoc.cpp File Reference

WinCvs/wincvsDoc.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include <afxrich.h>
#include "wincvsDoc.h"
#include "CvsCommands.h"
#include "GetPrefs.h"
#include "Authen.h"
#include "CvsPrefs.h"
#include "AppConsole.h"
#include "PromptFiles.h"
#include "WinCvsBrowser.h"
#include "TclGlue.h"
#include "PythonGlue.h"
#include "MacrosSetup.h"
#include "cvsgui_process.h"

Include dependency graph for wincvsDoc.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | _afxRichEditCookie

Functions

DWORD CALLBACK | EditStreamCallBack (DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)

Variables

const IID | IID_IWincvs

Function Documentation

DWORD CALLBACK EditStreamCallBack | ( | DWORD | dwCookie,
 |  | LPBYTE | pbBuff,
 |  | LONG | cb,
 |  | LONG * | pcb
 | ) |

Definition at line 156 of file wincvsDoc.cpp.

References _afxRichEditCookie::m_ar, and _afxRichEditCookie::m_dwError.

Referenced by CWincvsDoc::Serialize.

00157 {
00158     _afxRichEditCookie* pCookie = (_afxRichEditCookie*)dwCookie;
00159     CArchive& ar = pCookie->m_ar;
00160     ar.Flush();
00161     DWORD dw = 0;
00162     *pcb = cb;
00163     TRY
00164     {
00165         if (ar.IsStoring())
00166             ar.GetFile()->WriteHuge(pbBuff, cb);
00167         else
00168             *pcb = ar.GetFile()->ReadHuge(pbBuff, cb);
00169     }
00170     CATCH(CFileException, e)
00171     {
00172         *pcb = 0;
00173         pCookie->m_dwError = (DWORD)e->m_cause;
00174         dw = 1;
00175     }
00176     AND_CATCH_ALL(e)
00177     {
00178         *pcb = 0;
00179         pCookie->m_dwError = (DWORD)CFileException::generic;
00180         dw = 1;
00181     }
00182     END_CATCH_ALL
00183     return dw;
00184 }

Variable Documentation

const IID IID_IWincvs [static]

Initial value:

{ 0xd2d77dc4, 0x8299, 0x11d1, { 0x89, 0x49, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0 } }

Definition at line 102 of file wincvsDoc.cpp.

Generated on Sun Feb 24 01:24:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


wincvsDoc.h File Reference

WinCvs/wincvsDoc.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CWincvsDoc

Defines

#define | AFX_WINCVSDOC_H__D2D77DCE_8299_11D1_8949_444553540000__INCLUDED_

Define Documentation

#define AFX_WINCVSDOC_H__D2D77DCE_8299_11D1_8949_444553540000__INCLUDED_

Definition at line 26 of file wincvsDoc.h.

Generated on Sun Feb 24 01:24:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


wincvsView.cpp File Reference

WinCvs/wincvsView.cpp File Reference

#include "stdafx.h"
#include <atlconv.h>
#include "wincvs.h"
#include "wincvsDoc.h"
#include "wincvsView.h"
#include "wincvs_winutil.h"
#include "MainFrm.h"
#include "Persistent.h"
#include "CvsPrefs.h"
#include "AppGlue.h"
#include "TclGlue.h"
#include "PythonGlue.h"

Include dependency graph for wincvsView.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | CCharFormat

Functions

CPersistentT< CCharFormat > | gViewFont ("P_ViewFont", CCharFormat(), kNoClass)

Function Documentation

CPersistentT<CCharFormat> gViewFont | ( | "P_ViewFont" | ,
 |  | CCharFormat() | ,
 |  | kNoClass |
 | ) | [static]

Generated on Sun Feb 24 01:24:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


wincvsView.h File Reference

WinCvs/wincvsView.h File Reference

#include <afxrich.h>
#include "AppConsole.h"

Include dependency graph for wincvsView.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCvsThreadLock
class | CWincvsView

Defines

#define | AFX_WINCVSVIEW_H__D2D77DD0_8299_11D1_8949_444553540000__INCLUDED_
#define | MAX_CHAR_BY_LINE 1024

Define Documentation

#define AFX_WINCVSVIEW_H__D2D77DD0_8299_11D1_8949_444553540000__INCLUDED_

Definition at line 26 of file wincvsView.h.

#define MAX_CHAR_BY_LINE 1024

Definition at line 101 of file wincvsView.h.

Referenced by CWincvsView::OutConsole.

Generated on Sun Feb 24 01:24:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJBrowseEdit.cpp File Reference

WinCvs/CJLib/CJLibrary/CJBrowseEdit.cpp File Reference

#include "stdafx.h"
#include "CJBrowseEdit.h"
#include "CJShell.h"
#include "CJMenu.h"
#include "CJResource.h"

Include dependency graph for CJBrowseEdit.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJCaption.cpp File Reference

WinCvs/CJLib/CJLibrary/CJCaption.cpp File Reference

#include "StdAfx.h"
#include "CJResource.h"
#include "CJCaption.h"
#include "CJCaptionPopupWnd.h"

Include dependency graph for CJCaption.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJCaptionPopupWnd.cpp File Reference

WinCvs/CJLib/CJLibrary/CJCaptionPopupWnd.cpp File Reference

#include "stdafx.h"
#include "CJResource.h"
#include "CJCaptionPopupWnd.h"

Include dependency graph for CJCaptionPopupWnd.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJColorPicker.cpp File Reference

WinCvs/CJLib/CJLibrary/CJColorPicker.cpp File Reference

#include "stdafx.h"
#include "CJColorPopup.h"
#include "CJColorPicker.h"
#include "CJResource.h"

Include dependency graph for CJColorPicker.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void AFXAPI DDX_CJColorPicker (CDataExchange *pDX, int nIDC, COLORREF &crColor)

Function Documentation

void AFXAPI DDX_CJColorPicker | ( | CDataExchange * | pDX,
 |  | int | nIDC,
 |  | COLORREF & | crColor
 | ) |

Definition at line 80 of file CJColorPicker.cpp.

References ASSERT, DDX_CJColorPicker, CCJColorPicker::GetColor, NULL, and CCJColorPicker::SetColor.

Referenced by DDX_CJColorPicker.

00081 {
00082     HWND hWndCtrl = pDX->PrepareCtrl(nIDC);
00083     ASSERT (hWndCtrl != NULL);
00084
00085     CCJColorPicker* pColorPicker = (CCJColorPicker*) CWnd::FromHandle(hWndCtrl);
00086     if (pDX->m_bSaveAndValidate)
00087     {
00088         crColor = pColorPicker->GetColor();
00089     }
00090     else // initializing
00091     {
00092         pColorPicker->SetColor(crColor);
00093     }
00094 }

Generated on Sun Feb 24 01:23:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJColorPopup.cpp File Reference

WinCvs/CJLib/CJLibrary/CJColorPopup.cpp File Reference

#include "stdafx.h"
#include <math.h>
#include "CJColorPicker.h"
#include "CJColorPopup.h"
#include "CJResource.h"

Include dependency graph for CJColorPopup.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | DEFAULT_BOX_VALUE -3
#define | CUSTOM_BOX_VALUE -2
#define | INVALID_Color -1
#define | MAX_ColorS 100
#define | NUM_COLUMNS 10

Define Documentation

#define CUSTOM_BOX_VALUE -2

Definition at line 76 of file CJColorPopup.cpp.

Referenced by CCJColorPopup::ChangeSelection, CCJColorPopup::DrawCell, CCJColorPopup::EndSelection, CCJColorPopup::FindCellFromColor, CCJColorPopup::GetCellRect, CCJColorPopup::GetColumn, CCJColorPopup::GetIndex, CCJColorPopup::GetRow, CCJColorPopup::OnKeyDown, CCJColorPopup::OnMouseMove, and CCJColorPopup::OnPaint.

#define DEFAULT_BOX_VALUE -3

Definition at line 75 of file CJColorPopup.cpp.

Referenced by CCJColorPopup::ChangeSelection, CCJColorPopup::DrawCell, CCJColorPopup::FindCellFromColor, CCJColorPopup::GetCellRect, CCJColorPopup::GetColumn, CCJColorPopup::GetIndex, CCJColorPopup::GetRow, CCJColorPopup::OnKeyDown, CCJColorPopup::OnMouseMove, and CCJColorPopup::OnPaint.

#define INVALID_Color -1

Definition at line 77 of file CJColorPopup.cpp.

Referenced by CCJColorPopup::ChangeSelection, CCJColorPopup::FindCellFromColor, CCJColorPopup::GetColumn, CCJColorPopup::GetIndex, CCJColorPopup::GetRow, CCJColorPopup::Initialise, CCJColorPopup::OnKeyDown, and CCJColorPopup::OnMouseMove.

#define MAX_ColorS 100

Definition at line 79 of file CJColorPopup.cpp.

Referenced by CCJColorPopup::Initialise.

#define NUM_COLUMNS 10

Definition at line 80 of file CJColorPopup.cpp.

Referenced by CCJColorPopup::SetWindowSize.

Generated on Sun Feb 24 01:23:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJComboBoxEx.cpp File Reference

WinCvs/CJLib/CJLibrary/CJComboBoxEx.cpp File Reference

#include "stdafx.h"
#include "CJComboBoxEx.h"

Include dependency graph for CJComboBoxEx.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJControlBar.cpp File Reference

WinCvs/CJLib/CJLibrary/CJControlBar.cpp File Reference

#include "stdafx.h"
#include "CJControlBar.h"
#include "CJDockContext.h"
#include "CJSizeDockBar.h"
#include "CJResource.h"

Include dependency graph for CJControlBar.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | GRIP_INTRASPACING 1
#define | GRIP_SIZE 3
#define | GRIP_START 8
#define | TRACK_BORDER_SIZE 4
#define | COLOR_WHITE RGB(255,255,255)
#define | COLOR_BLACK RGB(0,0,0)
#define | NCOLORSHADES 64

Define Documentation

#define COLOR_BLACK RGB(0,0,0)

Definition at line 1121 of file CJControlBar.cpp.

#define COLOR_WHITE RGB(255,255,255)

Definition at line 1120 of file CJControlBar.cpp.

#define GRIP_INTRASPACING 1

Definition at line 210 of file CJControlBar.cpp.

Referenced by CCJControlBar::GetMinExt.

#define GRIP_SIZE 3

Definition at line 211 of file CJControlBar.cpp.

Referenced by CCJControlBar::GetMinExt.

#define GRIP_START 8

Definition at line 212 of file CJControlBar.cpp.

Referenced by CCJControlBar::GetMinExt.

#define NCOLORSHADES 64

Definition at line 1122 of file CJControlBar.cpp.

Referenced by CCJControlBar::DrawGriperCaption.

#define TRACK_BORDER_SIZE 4

Definition at line 213 of file CJControlBar.cpp.

Referenced by CCJControlBar::DrawBorders, CCJControlBar::GetChildRect, CCJControlBar::GetMinExt, CCJControlBar::HitTest, CCJControlBar::OnLButtonDown, and CCJControlBar::SaveBarState.

Generated on Sun Feb 24 01:23:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJDateTimeCtrl.cpp File Reference

WinCvs/CJLib/CJLibrary/CJDateTimeCtrl.cpp File Reference

#include "stdafx.h"
#include "CJDateTimeCtrl.h"
#include <math.h>

Include dependency graph for CJDateTimeCtrl.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | MAX_TIME_BUFFER_SIZE 128
#define | MIN_DATE (-657434L)
#define | MAX_DATE 2958465L
#define | HALF_SECOND (1.0/172800.0)

Functions

BOOL | GetAsSystemTime (const CTime &tm, SYSTEMTIME &timeDest)
BOOL | GetAsSystemTime (const CTime *ptm, SYSTEMTIME &timeDest)
BOOL | TmFromOleDate (DATE dtSrc, struct tm &tmDest)
BOOL | GetAsSystemTime (const COleDateTime &dtm, SYSTEMTIME &sysTime)
BOOL | GetAsSystemTime (const COleDateTime *pdtm, SYSTEMTIME &sysTime)
void AFXAPI | DDX_CJDateTimeCtrl (CDataExchange *pDX, int nIDC, COleDateTime &value)
void AFXAPI | DDX_CJDateTimeCtrl (CDataExchange *pDX, int nIDC, CTime &value)
void AFXAPI | DDX_CJMonthCalCtrl (CDataExchange *pDX, int nIDC, COleDateTime &value)
void AFXAPI | DDX_CJMonthCalCtrl (CDataExchange *pDX, int nIDC, CTime &value)
void AFXAPI | DDV_CJMinMaxDateTime (CDataExchange *pDX, CTime &refValue, const CTime *pMinRange, const CTime *pMaxRange)
void AFXAPI | DDV_CJMinMaxDateTime (CDataExchange *pDX, COleDateTime &refValue, const COleDateTime *pMinRange, const COleDateTime *pMaxRange)
void AFXAPI | DDV_CJMinMaxMonth (CDataExchange *pDX, CTime &refValue, const CTime *pMinRange, const CTime *pMaxRange)
void AFXAPI | DDV_CJMinMaxMonth (CDataExchange *pDX, COleDateTime &refValue, const COleDateTime *pMinRange, const COleDateTime *pMaxRange)

Variables

int | nMonthDays [13]

Define Documentation

#define HALF_SECOND (1.0/172800.0)

Definition at line 84 of file CJDateTimeCtrl.cpp.

Referenced by TmFromOleDate.

#define MAX_DATE 2958465L

Definition at line 81 of file CJDateTimeCtrl.cpp.

Referenced by TmFromOleDate.

#define MAX_TIME_BUFFER_SIZE 128

Definition at line 79 of file CJDateTimeCtrl.cpp.

#define MIN_DATE (-657434L)

Definition at line 80 of file CJDateTimeCtrl.cpp.

Referenced by TmFromOleDate.

Function Documentation

void AFXAPI DDV_CJMinMaxDateTime | ( | CDataExchange * | pDX,
 |  | COleDateTime & | refValue,
 |  | const COleDateTime * | pMinRange,
 |  | const COleDateTime * | pMaxRange
 | ) |

Definition at line 1068 of file CJDateTimeCtrl.cpp.

References ASSERT, NULL, and CCJDateTimeCtrl::SetRange.

01070 {
01071     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01072     CCJDateTimeCtrl* pWnd =
01073         (CCJDateTimeCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01074
01075     if (!pDX->m_bSaveAndValidate)
01076     {
01077         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01078               (pMaxRange != NULL && *pMaxRange < refValue))
01079         {
01080             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01081             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01082             return;     // don't stop now
01083         }
01084     }
01085
01086     pWnd->SetRange(pMinRange, pMaxRange);
01087 }

void AFXAPI DDV_CJMinMaxDateTime | ( | CDataExchange * | pDX,
 |  | CTime & | refValue,
 |  | const CTime * | pMinRange,
 |  | const CTime * | pMaxRange
 | ) |

Definition at line 1044 of file CJDateTimeCtrl.cpp.

References ASSERT, NULL, and CCJDateTimeCtrl::SetRange.

01046 {
01047     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01048
01049     CCJDateTimeCtrl* pWnd =
01050         (CCJDateTimeCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01051
01052     if (!pDX->m_bSaveAndValidate)
01053     {
01054         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01055               (pMaxRange != NULL && *pMaxRange < refValue))
01056         {
01057 #ifdef _DEBUG
01058             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01059             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01060 #endif
01061             return;     // don't stop now
01062         }
01063     }
01064
01065     pWnd->SetRange(pMinRange, pMaxRange);
01066 }

void AFXAPI DDV_CJMinMaxMonth | ( | CDataExchange * | pDX,
 |  | COleDateTime & | refValue,
 |  | const COleDateTime * | pMinRange,
 |  | const COleDateTime * | pMaxRange
 | ) |

Definition at line 1112 of file CJDateTimeCtrl.cpp.

References ASSERT, NULL, and CCJMonthCalCtrl::SetRange.

01114 {
01115     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01116     CCJMonthCalCtrl* pWnd =
01117         (CCJMonthCalCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01118
01119     if (!pDX->m_bSaveAndValidate)
01120     {
01121         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01122               (pMaxRange != NULL && *pMaxRange < refValue))
01123         {
01124 #ifdef _DEBUG
01125             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01126             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01127 #endif
01128             return;     // don't stop now
01129         }
01130     }
01131
01132     pWnd->SetRange(pMinRange, pMaxRange);
01133 }

void AFXAPI DDV_CJMinMaxMonth | ( | CDataExchange * | pDX,
 |  | CTime & | refValue,
 |  | const CTime * | pMinRange,
 |  | const CTime * | pMaxRange
 | ) |

Definition at line 1089 of file CJDateTimeCtrl.cpp.

References ASSERT, NULL, and CCJMonthCalCtrl::SetRange.

01091 {
01092     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01093     CCJMonthCalCtrl* pWnd =
01094         (CCJMonthCalCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01095
01096     if (!pDX->m_bSaveAndValidate)
01097     {
01098         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01099               (pMaxRange != NULL && *pMaxRange < refValue))
01100         {
01101 #ifdef _DEBUG
01102             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01103             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01104 #endif
01105             return;     // don't stop now
01106         }
01107     }
01108
01109     pWnd->SetRange(pMinRange, pMaxRange);
01110 }

void AFXAPI DDX_CJDateTimeCtrl | ( | CDataExchange * | pDX,
 |  | int | nIDC,
 |  | CTime & | value
 | ) |

Definition at line 1010 of file CJDateTimeCtrl.cpp.

References CCJDateTimeCtrl::GetTime, and CCJDateTimeCtrl::SetTime.

01011 {
01012     HWND hWndCtrl = pDX->PrepareCtrl(nIDC);
01013     CCJDateTimeCtrl* pWnd = (CCJDateTimeCtrl*) CWnd::FromHandle(hWndCtrl);
01014
01015     if (pDX->m_bSaveAndValidate)
01016         pWnd->GetTime(value);
01017     else
01018         pWnd->SetTime(&value);
01019 }

void AFXAPI DDX_CJDateTimeCtrl | ( | CDataExchange * | pDX,
 |  | int | nIDC,
 |  | COleDateTime & | value
 | ) |

Definition at line 999 of file CJDateTimeCtrl.cpp.

References CCJDateTimeCtrl::GetTime, and CCJDateTimeCtrl::SetTime.

01000 {
01001     HWND hWndCtrl = pDX->PrepareCtrl(nIDC);
01002     CCJDateTimeCtrl* pWnd = (CCJDateTimeCtrl*) CWnd::FromHandle(hWndCtrl);
01003
01004     if (pDX->m_bSaveAndValidate)
01005         pWnd->GetTime(value);
01006     else
01007         pWnd->SetTime(value);
01008 }

void AFXAPI DDX_CJMonthCalCtrl | ( | CDataExchange * | pDX,
 |  | int | nIDC,
 |  | CTime & | value
 | ) |

Definition at line 1033 of file CJDateTimeCtrl.cpp.

References CCJMonthCalCtrl::GetCurSel, and CCJMonthCalCtrl::SetCurSel.

01034 {
01035     HWND hWndCtrl = pDX->PrepareCtrl(nIDC);
01036     CCJMonthCalCtrl* pWnd = (CCJMonthCalCtrl*) CWnd::FromHandle(hWndCtrl);
01037
01038     if (pDX->m_bSaveAndValidate)
01039         pWnd->GetCurSel(value);
01040     else
01041         pWnd->SetCurSel(value);
01042 }

void AFXAPI DDX_CJMonthCalCtrl | ( | CDataExchange * | pDX,
 |  | int | nIDC,
 |  | COleDateTime & | value
 | ) |

Definition at line 1021 of file CJDateTimeCtrl.cpp.

References CCJMonthCalCtrl::GetCurSel, and CCJMonthCalCtrl::SetCurSel.

01023 {
01024     HWND hWndCtrl = pDX->PrepareCtrl(nIDC);
01025     CCJMonthCalCtrl* pWnd = (CCJMonthCalCtrl*) CWnd::FromHandle(hWndCtrl);
01026
01027     if (pDX->m_bSaveAndValidate)
01028         pWnd->GetCurSel(value);
01029     else
01030         pWnd->SetCurSel(value);
01031 }

BOOL GetAsSystemTime | ( | const COleDateTime * | pdtm,
 |  | SYSTEMTIME & | sysTime
 | ) | [static]

Definition at line 242 of file CJDateTimeCtrl.cpp.

Referenced by GetAsSystemTime, CCJMonthCalCtrl::SetCurSel, CCJMonthCalCtrl::SetRange, CCJDateTimeCtrl::SetRange, CCJMonthCalCtrl::SetSelRange, CCJDateTimeCtrl::SetTime, and CCJMonthCalCtrl::SetToday.

00243 {
00244     return GetAsSystemTime(*pdtm, sysTime);
00245 }

BOOL GetAsSystemTime | ( | const COleDateTime & | dtm,
 |  | SYSTEMTIME & | sysTime
 | ) | [static]

Definition at line 218 of file CJDateTimeCtrl.cpp.

References FALSE, TmFromOleDate, and TRUE.

00219 {
00220     BOOL bRetVal = FALSE;
00221     if (dtm.GetStatus() == COleDateTime::valid)
00222     {
00223         struct tm tmTemp;
00224         if (TmFromOleDate(dtm, tmTemp))
00225         {
00226             sysTime.wYear = (WORD) tmTemp.tm_year;
00227             sysTime.wMonth = (WORD) tmTemp.tm_mon;
00228             sysTime.wDayOfWeek = (WORD) tmTemp.tm_wday;
00229             sysTime.wDay = (WORD) tmTemp.tm_mday;
00230             sysTime.wHour = (WORD) tmTemp.tm_hour;
00231             sysTime.wMinute = (WORD) tmTemp.tm_min;
00232             sysTime.wSecond = (WORD) tmTemp.tm_sec;
00233             sysTime.wMilliseconds = 0;
00234
00235             bRetVal = TRUE;
00236         }
00237     }
00238
00239     return bRetVal;
00240 }

BOOL GetAsSystemTime | ( | const CTime * | ptm,
 |  | SYSTEMTIME & | timeDest
 | ) | [static]

Definition at line 73 of file CJDateTimeCtrl.cpp.

References GetAsSystemTime.

00074 {
00075     return GetAsSystemTime(*ptm, timeDest);
00076 }

BOOL GetAsSystemTime | ( | const CTime & | tm,
 |  | SYSTEMTIME & | timeDest
 | ) | [static]

Definition at line 56 of file CJDateTimeCtrl.cpp.

References FALSE, NULL, and TRUE.

00057 {
00058     struct tm* ptm = tm.GetLocalTm(NULL);
00059     if (ptm == NULL)
00060         return FALSE;
00061
00062     timeDest.wYear = (WORD) (1900 + ptm->tm_year);
00063     timeDest.wMonth = (WORD) (1 + ptm->tm_mon);
00064     timeDest.wDay = (WORD) ptm->tm_mday;
00065     timeDest.wHour = (WORD) ptm->tm_hour;
00066     timeDest.wMinute = (WORD) ptm->tm_min;
00067     timeDest.wSecond = (WORD) ptm->tm_sec;
00068     timeDest.wMilliseconds = 0;
00069
00070     return TRUE;
00071 }

BOOL TmFromOleDate | ( | DATE | dtSrc,
 |  | struct tm & | tmDest
 | ) | [static]

Definition at line 90 of file CJDateTimeCtrl.cpp.

References FALSE, HALF_SECOND, MAX_DATE, MIN_DATE, nMonthDays, and TRUE.

Referenced by GetAsSystemTime.

00091 {
00092     // The legal range does not actually span year 0 to 9999.
00093     if (dtSrc > MAX_DATE || dtSrc < MIN_DATE) // about year 100 to about 9999
00094         return FALSE;
00095
00096     long nDays;             // Number of days since Dec. 30, 1899
00097     long nDaysAbsolute;     // Number of days since 1/1/0
00098     long nSecsInDay;        // Time in seconds since midnight
00099     long nMinutesInDay;     // Minutes in day
00100
00101     long n400Years;         // Number of 400 year increments since 1/1/0
00102     long n400Century;       // Century within 400 year block (0,1,2 or 3)
00103     long n4Years;           // Number of 4 year increments since 1/1/0
00104     long n4Day;             // Day within 4 year block
00105     //  (0 is 1/1/yr1, 1460 is 12/31/yr4)
00106     long n4Yr;              // Year within 4 year block (0,1,2 or 3)
00107     BOOL bLeap4 = TRUE;     // TRUE if 4 year block includes leap year
00108
00109     double dblDate = dtSrc; // tempory serial date
00110
00111     // If a valid date, then this conversion should not overflow
00112     nDays = (long)dblDate;
00113
00114     // Round to the second
00115     dblDate += ((dtSrc > 0.0) ? HALF_SECOND : -HALF_SECOND);
00116
00117     nDaysAbsolute = (long)dblDate + 693959L; // Add days from 1/1/0 to 12/30/1899
00118
00119     dblDate = fabs(dblDate);
00120     nSecsInDay = (long)((dblDate - floor(dblDate)) * 86400.);
00121
00122     // Calculate the day of week (sun=1, mon=2...)
00123     //   -1 because 1/1/0 is Sat.  +1 because we want 1-based
00124     tmDest.tm_wday = (int)((nDaysAbsolute - 1) % 7L) + 1;
00125
00126     // Leap years every 4 yrs except centuries not multiples of 400.
00127     n400Years = (long)(nDaysAbsolute / 146097L);
00128
00129     // Set nDaysAbsolute to day within 400-year block
00130     nDaysAbsolute %= 146097L;
00131
00132     // -1 because first century has extra day
00133     n400Century = (long)((nDaysAbsolute - 1) / 36524L);
00134
00135     // Non-leap century
00136     if (n400Century != 0)
00137     {
00138         // Set nDaysAbsolute to day within century
00139         nDaysAbsolute = (nDaysAbsolute - 1) % 36524L;
00140
00141         // +1 because 1st 4 year increment has 1460 days
00142         n4Years = (long)((nDaysAbsolute + 1) / 1461L);
00143
00144         if (n4Years != 0)
00145             n4Day = (long)((nDaysAbsolute + 1) % 1461L);
00146         else
00147         {
00148             bLeap4 = FALSE;
00149             n4Day = (long)nDaysAbsolute;
00150         }
00151     }
00152     else
00153     {
00154         // Leap century - not special case!
00155         n4Years = (long)(nDaysAbsolute / 1461L);
00156         n4Day = (long)(nDaysAbsolute % 1461L);
00157     }
00158
00159     if (bLeap4)
00160     {
00161         // -1 because first year has 366 days
00162         n4Yr = (n4Day - 1) / 365;
00163
00164         if (n4Yr != 0)
00165             n4Day = (n4Day - 1) % 365;
00166     }
00167     else
00168     {
00169         n4Yr = n4Day / 365;
00170         n4Day %= 365;
00171     }
00172
00173     // n4Day is now 0-based day of year. Save 1-based day of year, year number
00174     tmDest.tm_yday = (int)n4Day + 1;
00175     tmDest.tm_year = n400Years * 400 + n400Century * 100 + n4Years * 4 + n4Yr;
00176
00177     // Handle leap year: before, on, and after Feb. 29.
00178     if (n4Yr == 0 && bLeap4)
00179     {
00180         // Leap Year
00181         if (n4Day == 59)
00182         {
00183             /* Feb. 29 */
00184             tmDest.tm_mon = 2;
00185             tmDest.tm_mday = 29;
00186             goto DoTime;
00187         }
00188
00189         // Pretend it's not a leap year for month/day comp.
00190         if (n4Day >= 60)
00191             --n4Day;
00192     }
00193
00194     // Make n4DaY a 1-based day of non-leap year and compute
00195     //  month/day for everything but Feb. 29.
00196     ++n4Day;
00197
00198     // Month number always >= n/32, so save some loop time */
00199     for (tmDest.tm_mon = (n4Day >> 5) + 1;
00200     n4Day > nMonthDays[tmDest.tm_mon]; tmDest.tm_mon++);
00201
00202     tmDest.tm_mday = (int)(n4Day - nMonthDays[tmDest.tm_mon-1]);
00203
00204 DoTime:
00205     if (nSecsInDay == 0)
00206         tmDest.tm_hour = tmDest.tm_min = tmDest.tm_sec = 0;
00207     else
00208     {
00209         tmDest.tm_sec = (int)nSecsInDay % 60L;
00210         nMinutesInDay = nSecsInDay / 60L;
00211         tmDest.tm_min = (int)nMinutesInDay % 60;
00212         tmDest.tm_hour = (int)nMinutesInDay / 60;
00213     }
00214
00215     return TRUE;
00216 }

Variable Documentation

int nMonthDays[13] [static]

Initial value:

{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}

Definition at line 87 of file CJDateTimeCtrl.cpp.

Referenced by TmFromOleDate.

Generated on Sun Feb 24 01:23:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJDockBar.cpp File Reference

WinCvs/CJLib/CJLibrary/CJDockBar.cpp File Reference

#include "stdafx.h"
#include "CJDockBar.h"
#include "CJToolBar.h"

Include dependency graph for CJDockBar.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJDockContext.cpp File Reference

WinCvs/CJLib/CJLibrary/CJDockContext.cpp File Reference

#include "stdafx.h"
#include "CJDockContext.h"
#include "CJControlBar.h"
#include "CJSizeDockBar.h"

Include dependency graph for CJDockContext.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | HORZF(dw) (dw & CBRS_ORIENT_HORZ)
#define | VERTF(dw) (dw & CBRS_ORIENT_VERT)
#define | m_rectRequestedSize m_rectDragHorz
#define | m_rectActualSize m_rectDragVert
#define | m_rectActualFrameSize m_rectFrameDragHorz
#define | m_rectFrameBorders m_rectFrameDragVert

Functions

void | AdjustRectangle (CRect &rect, CPoint pt)

Define Documentation

#define HORZF ( dw ) (dw & CBRS_ORIENT_HORZ)

Definition at line 91 of file CJDockContext.cpp.

Referenced by CCJDockContext::CanDockDockBar, CCJDockContext::EndDragDockBar, CCJDockContext::GetDockBar, and CCJDockContext::StartDragDockBar.

#define m_rectActualFrameSize m_rectFrameDragHorz

Definition at line 512 of file CJDockContext.cpp.

Referenced by CCJDockContext::StartResize, and CCJDockContext::Stretch.

#define m_rectActualSize m_rectDragVert

Definition at line 511 of file CJDockContext.cpp.

Referenced by CCJDockContext::StartResize, and CCJDockContext::Stretch.

#define m_rectFrameBorders m_rectFrameDragVert

Definition at line 513 of file CJDockContext.cpp.

Referenced by CCJDockContext::StartResize, and CCJDockContext::Stretch.

#define m_rectRequestedSize m_rectDragHorz

Definition at line 510 of file CJDockContext.cpp.

Referenced by CCJDockContext::StartResize, and CCJDockContext::Stretch.

#define VERTF ( dw ) (dw & CBRS_ORIENT_VERT)

Definition at line 92 of file CJDockContext.cpp.

Referenced by CCJDockContext::CanDockDockBar, CCJDockContext::EndDragDockBar, and CCJDockContext::GetDockBar.

Function Documentation

void AdjustRectangle | ( | CRect & | rect,
 |  | CPoint | pt
 | ) | [static]

Definition at line 94 of file CJDockContext.cpp.

Referenced by CCJDockContext::StartDragDockBar.

00095 {
00096     int nXOffset = (pt.x < rect.left) ? (pt.x - rect.left) :
00097                     (pt.x > rect.right) ? (pt.x - rect.right) : 0;
00098     int nYOffset = (pt.y < rect.top) ? (pt.y - rect.top) :
00099                     (pt.y > rect.bottom) ? (pt.y - rect.bottom) : 0;
00100     rect.OffsetRect(nXOffset, nYOffset);
00101 }

Generated on Sun Feb 24 01:23:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJExplorerBar.cpp File Reference

WinCvs/CJLib/CJLibrary/CJExplorerBar.cpp File Reference

#include "stdafx.h"
#include "CJResource.h"
#include "CJExplorerBar.h"

Include dependency graph for CJExplorerBar.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJFlatButton.cpp File Reference

WinCvs/CJLib/CJLibrary/CJFlatButton.cpp File Reference

#include "stdafx.h"
#include "CJFlatButton.h"
#include "CJResource.h"

Include dependency graph for CJFlatButton.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJFlatComboBox.cpp File Reference

WinCvs/CJLib/CJLibrary/CJFlatComboBox.cpp File Reference

#include "stdafx.h"
#include "CJFlatComboBox.h"

Include dependency graph for CJFlatComboBox.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJFlatHeaderCtrl.cpp File Reference

WinCvs/CJLib/CJLibrary/CJFlatHeaderCtrl.cpp File Reference

#include "stdafx.h"
#include "CJFlatHeaderCtrl.h"

Include dependency graph for CJFlatHeaderCtrl.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJFlatSplitterWnd.cpp File Reference

WinCvs/CJLib/CJLibrary/CJFlatSplitterWnd.cpp File Reference

#include "StdAfx.h"
#include "CJFlatSplitterWnd.h"

Include dependency graph for CJFlatSplitterWnd.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJFlatTabCtrl.cpp File Reference

WinCvs/CJLib/CJLibrary/CJFlatTabCtrl.cpp File Reference

#include "stdafx.h"
#include "CJResource.h"
#include "CJFlatTabCtrl.h"

Include dependency graph for CJFlatTabCtrl.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJFontCombo.cpp File Reference

WinCvs/CJLib/CJLibrary/CJFontCombo.cpp File Reference

#include "stdafx.h"
#include "CJFontCombo.h"

Include dependency graph for CJFontCombo.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJFrameWnd.cpp File Reference

WinCvs/CJLib/CJLibrary/CJFrameWnd.cpp File Reference

#include "stdafx.h"
#include "CJFrameWnd.h"
#include "CJDockBar.h"
#include "CJSizeDockBar.h"
#include "CJControlBar.h"
#include "CJMiniDockFrameWnd.h"
#include "CJToolBar.h"

Include dependency graph for CJFrameWnd.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:03 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJHexEdit.cpp File Reference

WinCvs/CJLib/CJLibrary/CJHexEdit.cpp File Reference

#include "StdAfx.h"
#include "CJResource.h"
#include "CJHexEdit.h"
#include <ctype.h>
#include <afxole.h>
#include <afxdisp.h>

Include dependency graph for CJHexEdit.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | TOHEX(a, b) {*b++ = hextable[a >> 4];*b++ = hextable[a&0xf];}

Variables

char | hextable [16] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}

Define Documentation

#define TOHEX | ( | a,
 |  | b | ) | {*b++ = hextable[a >> 4];*b++ = hextable[a&0xf];}

Definition at line 42 of file CJHexEdit.cpp.

Referenced by CCJHexEdit::OnEditCopy, and CCJHexEdit::OnPaint.

Variable Documentation

char hextable[16] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}

Definition at line 41 of file CJHexEdit.cpp.

Generated on Sun Feb 24 01:23:03 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJHtmlView.cpp File Reference

WinCvs/CJLib/CJLibrary/CJHtmlView.cpp File Reference

#include "StdAfx.h"
#include "CJHtmlView.h"

Include dependency graph for CJHtmlView.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | RELEASE(lpUnk) _AfxRelease((LPUNKNOWN*)&lpUnk)

Functions

DWORD AFXAPI | _AfxRelease (LPUNKNOWN *lplpUnknown)
void | MakeOleVariant (COleVariant &ov, LPCITEMIDLIST pidl)

Define Documentation

#define RELEASE ( lpUnk ) _AfxRelease((LPUNKNOWN*)&lpUnk)

Definition at line 79 of file CJHtmlView.cpp.

Referenced by CCJHtmlView::OnDestroy.

Function Documentation

DWORD AFXAPI _AfxRelease ( LPUNKNOWN * plpUnknown )

Definition at line 63 of file CJHtmlView.cpp.

References ASSERT, and NULL.

00064 {
00065     ASSERT(lplpUnknown != NULL);
00066     if (*lplpUnknown != NULL)
00067     {
00068         DWORD dwRef = (*lplpUnknown)->Release();
00069         *lplpUnknown = NULL;
00070         return dwRef;
00071     }
00072     return 0;
00073 }

void MakeOleVariant | ( | COleVariant & | ov,
 |  | LPCITEMIDLIST | pidl
 | ) |

Definition at line 567 of file CJHtmlView.cpp.

References NULL.

Referenced by CCJHtmlView::Navigate2.

00568 {
00569     AfxVariantInit(&ov);
00570
00571     if (pidl != NULL)
00572     {
00573         // walk through entries in the list and accumulate their size
00574
00575         UINT cbTotal = 0;
00576         SAFEARRAY *psa = NULL;
00577         LPCITEMIDLIST pidlWalker = pidl;
00578
00579         while (pidlWalker->mkid.cb)
00580         {
00581             cbTotal += pidlWalker->mkid.cb;
00582             pidlWalker = (LPCITEMIDLIST)
00583                 (((LPBYTE)pidlWalker) + pidlWalker->mkid.cb);
00584         }
00585
00586         // add the base structure size
00587         cbTotal += sizeof(ITEMIDLIST);
00588
00589         // get a safe array for them
00590         psa = SafeArrayCreateVector(VT_UI1, 0, cbTotal);
00591
00592         // copy it and set members
00593         if (psa != NULL)
00594         {
00595             memcpy(psa->pvData, (LPBYTE) pidl, cbTotal);
00596             ov.vt = VT_ARRAY | VT_UI1;
00597             ov.parray = psa;
00598         }
00599     }
00600 }

Generated on Sun Feb 24 01:23:03 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJHyperLink.cpp File Reference

WinCvs/CJLib/CJLibrary/CJHyperLink.cpp File Reference

#include "stdafx.h"
#include "CJHyperLink.h"

Include dependency graph for CJHyperLink.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define TOOLTIP_ID 1

Define Documentation

#define TOOLTIP_ID 1

Definition at line 50 of file CJHyperLink.cpp.

Referenced by CCJHyperLink::PreSubclassWindow, and CCJHyperLink::SetURL.

Generated on Sun Feb 24 01:23:03 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJLibrary.cpp File Reference

WinCvs/CJLib/CJLibrary/CJLibrary.cpp File Reference

#include "stdafx.h"
#include <afxdllx.h>
#include "CJToolBar.h"

Include dependency graph for CJLibrary.cpp:

Include dependency graph

Go to the source code of this file.

Functions

int APIENTRY | DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)

Variables

AFX_EXTENSION_MODULE | CJLibraryDLL = { NULL, NULL }

Function Documentation

int APIENTRY DllMain | ( | HINSTANCE | hInstance,
 |  | DWORD | dwReason,
 |  | LPVOID | lpReserved
 | ) |

Definition at line 42 of file CJLibrary.cpp.

References _GetComCtlVersion, CJLibraryDLL, NULL, and VERSION_IE4.

00043 {
00044     // Remove this if you use lpReserved
00045     UNREFERENCED_PARAMETER(lpReserved);
00046
00047     if (dwReason == DLL_PROCESS_ATTACH)
00048     {
00049         TRACE0("CJLIBRARY.DLL Initializing!\n");
00050
00051         // Extension DLL one-time initialization
00052         if (!AfxInitExtensionModule(CJLibraryDLL, hInstance))
00053             return 0;
00054
00055         // see what version of the common control we are using.
00056         _GetComCtlVersion();
00057         if (_ComCtlVersion < VERSION_IE4) {
00058             ::MessageBox(NULL, _T("Invalid Common Control DLL!\nYou need version 4.70 or higher to use CJLibrary...\nAborting!\n\nCopyright © 1999 CodeJock.com and Copyright © 1998-1999 Kirk W. Stowell, All Rights Reserved\nmailto:kstowell@codejock.com\nhttp://www.codejock.com"), _T("Invalid COMCTL32.DLL"), MB_ICONSTOP);
00059             return 0;
00060         }
00061
00062         // Insert this DLL into the resource chain
00063         // NOTE: If this Extension DLL is being implicitly linked to by
00064         //  an MFC Regular DLL (such as an ActiveX Control)
00065         //  instead of an MFC application, then you will want to
00066         //  remove this line from DllMain and put it in a separate
00067         //  function exported from this Extension DLL.  The Regular DLL
00068         //  that uses this Extension DLL should then explicitly call that
00069         //  function to initialize this Extension DLL.  Otherwise,
00070         //  the CDynLinkLibrary object will not be attached to the
00071         //  Regular DLL's resource chain, and serious problems will
00072         //  result.
00073
00074         new CDynLinkLibrary(CJLibraryDLL);
00075     }
00076     else if (dwReason == DLL_PROCESS_DETACH)
00077     {
00078         TRACE0("CJLIBRARY.DLL Terminating!\n");
00079         // Terminate the library before destructors are called
00080         AfxTermExtensionModule(CJLibraryDLL);
00081     }
00082     return 1;   // ok
00083 }

Variable Documentation

AFX_EXTENSION_MODULE CJLibraryDLL = { NULL, NULL } [static]

Definition at line 39 of file CJLibrary.cpp.

Referenced by DllMain.

Generated on Sun Feb 24 01:23:03 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJListBox.cpp File Reference

WinCvs/CJLib/CJLibrary/CJListBox.cpp File Reference

#include "StdAfx.h"
#include "CJListBox.h"

Include dependency graph for CJListBox.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:03 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJListCtrl.cpp File Reference

WinCvs/CJLib/CJLibrary/CJListCtrl.cpp File Reference

#include "stdafx.h"
#include "CJListCtrl.h"
#include "CJFlatHeaderCtrl.h"
#include "CJResource.h"

Include dependency graph for CJListCtrl.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJListView.cpp File Reference

WinCvs/CJLib/CJLibrary/CJListView.cpp File Reference

#include "stdafx.h"
#include "CJListView.h"
#include "CJFlatHeaderCtrl.h"
#include "CJResource.h"

Include dependency graph for CJListView.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJLogoPane.cpp File Reference

WinCvs/CJLib/CJLibrary/CJLogoPane.cpp File Reference

#include "StdAfx.h"
#include "CJLogoPane.h"

Include dependency graph for CJLogoPane.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJMaskEdit.cpp File Reference

WinCvs/CJLib/CJLibrary/CJMaskEdit.cpp File Reference

#include "StdAfx.h"
#include "CJMaskEdit.h"

Include dependency graph for CJMaskEdit.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void AFXAPI DDX_OleDateTime (CDataExchange *pDX, int nIDC, CCJDateEdit &rControl, COleDateTime &rDateTime)

Function Documentation

void AFXAPI DDX_OleDateTime | ( | CDataExchange * | pDX,
 |  | int | nIDC,
 |  | CCJDateEdit & | rControl,
 |  | COleDateTime & | rDateTime
 | ) |

Definition at line 391 of file CJMaskEdit.cpp.

References CCJDateEdit::GetDateTime, and CCJDateEdit::SetDateTime.

00392 {
00393     DDX_Control( pDX, nIDC, rControl );
00394
00395     if( pDX->m_bSaveAndValidate ) {
00396         rDateTime = rControl.GetDateTime();
00397     }
00398     else {
00399         rControl.SetDateTime( rDateTime );
00400     }
00401 }

Generated on Sun Feb 24 01:23:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJMDIChildWnd.cpp File Reference

WinCvs/CJLib/CJLibrary/CJMDIChildWnd.cpp File Reference

#include "stdafx.h"
#include "CJMDIChildWnd.h"
#include "CJDockBar.h"
#include "CJSizeDockBar.h"
#include "CJControlBar.h"
#include "CJMiniDockFrameWnd.h"
#include "CJToolBar.h"
#include "CJMDIFrameWnd.h"

Include dependency graph for CJMDIChildWnd.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJMDIFrameWnd.cpp File Reference

WinCvs/CJLib/CJLibrary/CJMDIFrameWnd.cpp File Reference

#include "stdafx.h"
#include "CJMDIFrameWnd.h"
#include "CJDockBar.h"
#include "CJSizeDockBar.h"
#include "CJControlBar.h"
#include "CJMiniDockFrameWnd.h"
#include "CJToolBar.h"

Include dependency graph for CJMDIFrameWnd.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJMemFile.cpp File Reference

WinCvs/CJLib/CJLibrary/CJMemFile.cpp File Reference

#include "stdafx.h"
#include "CJMemFile.h"

Include dependency graph for CJMemFile.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJMenu.cpp File Reference

WinCvs/CJLib/CJLibrary/CJMenu.cpp File Reference

#include "stdafx.h"
#include "CJMenu.h"
#include <afxpriv.h>

Include dependency graph for CJMenu.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | GAP 1
#define | OBM_CHECK 32760

Enumerations

enum Win32Type {
Win32s,
Windoze95,
WinNT3,
WinNT4orHigher
}

Functions

Win32Type IsShellType ()

Variables

CPINFO | CPInfo
Win32Type | g_Shell = IsShellType()

Define Documentation

#define GAP 1

Definition at line 49 of file CJMenu.cpp.

Referenced by CCJMenu::DrawItem, and CCJMenu::MeasureItem.

#define OBM_CHECK 32760

Definition at line 51 of file CJMenu.cpp.

Enumeration Type Documentation

enum Win32Type

Enumeration values:
Win32s
Windoze95
WinNT3
WinNT4orHigher

Definition at line 60 of file CJMenu.cpp.

Referenced by IsShellType.

00060               {
00061     Win32s,
00062     Windoze95,
00063     WinNT3,
00064     WinNT4orHigher
00065 };

Function Documentation

Win32Type IsShellType ( )

Definition at line 68 of file CJMenu.cpp.

References free, malloc, NULL, Win32s, Win32Type, Windoze95, WinNT3, and WinNT4orHigher.

00069 {
00070     Win32Type  ShellType;
00071     DWORD winVer;
00072     OSVERSIONINFO *osvi;
00073
00074     winVer=GetVersion();
00075     if(winVer<0x80000000){/*NT */
00076         ShellType=WinNT3;
00077         osvi= (OSVERSIONINFO *)malloc(sizeof(OSVERSIONINFO));
00078         if (osvi!=NULL){
00079             memset(osvi,0,sizeof(OSVERSIONINFO));
00080             osvi->dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
00081             GetVersionEx(osvi);
00082             if (osvi->dwMajorVersion>=4L)
00083                 ShellType=WinNT4orHigher;//yup, it is NT 4 or higher!
00084             free(osvi);
00085         }
00086     }
00087     else if  (LOBYTE(LOWORD(winVer))<4)
00088         ShellType=Win32s;/*Win32s*/
00089     else
00090         ShellType=Windoze95;/*Windoze95*/
00091     return ShellType;
00092 }

Variable Documentation

CPINFO CPInfo [static]

Definition at line 58 of file CJMenu.cpp.

Referenced by CCJMenu::CCJMenu.

Win32Type g_Shell = IsShellType() [static]

Definition at line 94 of file CJMenu.cpp.

Referenced by CCJMenu::IsNewShell, and CCJMenu::MeasureItem.

Generated on Sun Feb 24 01:23:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJMenuBar.cpp File Reference

WinCvs/CJLib/CJLibrary/CJMenuBar.cpp File Reference

#include "stdafx.h"
#include "CJMenuBar.h"
#include "CJMenu.h"

Include dependency graph for CJMenuBar.cpp:

Include dependency graph

Go to the source code of this file.

Variables

CCJMenuBar * | g_pMenuBar = NULL
HHOOK | g_hMsgHook = NULL

Variable Documentation

HHOOK g_hMsgHook = NULL [static]

Definition at line 431 of file CJMenuBar.cpp.

Referenced by CCJMenuBar::MenuInputFilter, and CCJMenuBar::TrackPopup.

CCJMenuBar* g_pMenuBar = NULL [static]

Definition at line 430 of file CJMenuBar.cpp.

Generated on Sun Feb 24 01:23:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJMetaFileButton.cpp File Reference

WinCvs/CJLib/CJLibrary/CJMetaFileButton.cpp File Reference

#include "stdafx.h"
#include "CJResource.h"
#include "CJMetaFileButton.h"

Include dependency graph for CJMetaFileButton.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJMiniDockFrameWnd.cpp File Reference

WinCvs/CJLib/CJLibrary/CJMiniDockFrameWnd.cpp File Reference

#include "stdafx.h"
#include "CJMiniDockFrameWnd.h"
#include "CJDockContext.h"
#include "CJSizeDockBar.h"
#include "CJControlBar.h"

Include dependency graph for CJMiniDockFrameWnd.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJOutlookBar.cpp File Reference

WinCvs/CJLib/CJLibrary/CJOutlookBar.cpp File Reference

#include "stdafx.h"
#include "CJOutlookBar.h"

Include dependency graph for CJOutlookBar.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJPagerCtrl.cpp File Reference

WinCvs/CJLib/CJLibrary/CJPagerCtrl.cpp File Reference

#include "stdafx.h"
#include "CJPagerCtrl.h"

Include dependency graph for CJPagerCtrl.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJReBar.cpp File Reference

WinCvs/CJLib/CJLibrary/CJReBar.cpp File Reference

#include "stdafx.h"
#include "CJReBar.h"
#include "CJToolBar.h"

Include dependency graph for CJReBar.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | _CjxGetDlgCtrlID(hWnd) ((UINT)(WORD)::GetDlgCtrlID(hWnd))

Functions

HWND | _CjxChildWindowFromPoint (HWND hWnd, POINT pt)

Define Documentation

#define _CjxGetDlgCtrlID ( hWnd ) ((UINT)(WORD)::GetDlgCtrlID(hWnd))

Definition at line 62 of file CJReBar.cpp.

Referenced by _CjxChildWindowFromPoint.

Function Documentation

HWND _CjxChildWindowFromPoint | ( | HWND | hWnd,
 |  | POINT | pt
 | ) | [static]

Definition at line 64 of file CJReBar.cpp.

References _CjxGetDlgCtrlID, ASSERT, and NULL.

Referenced by CCJReBar::OnToolHitTest.

00065 {
00066   ASSERT(hWnd != NULL);
00067
00068   // check child windows
00069   ::ClientToScreen(hWnd, &pt);
00070   HWND hWndChild = ::GetWindow(hWnd, GW_CHILD);
00071   for (; hWndChild != NULL; hWndChild = ::GetWindow(hWndChild, GW_HWNDNEXT))
00072   {
00073     if (_CjxGetDlgCtrlID(hWndChild) != (WORD)-1 &&
00074       (::GetWindowLong(hWndChild, GWL_STYLE) & WS_VISIBLE))
00075     {
00076       // see if point hits the child window
00077       CRect rect;
00078       ::GetWindowRect(hWndChild, rect);
00079       if (rect.PtInRect(pt))
00080         return hWndChild;
00081     }
00082   }
00083
00084   return NULL;    // not found
00085 }

Generated on Sun Feb 24 01:23:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJReBarCtrl.cpp File Reference

WinCvs/CJLib/CJLibrary/CJReBarCtrl.cpp File Reference

#include "stdafx.h"
#include "CJReBarCtrl.h"

Include dependency graph for CJReBarCtrl.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJShell.cpp File Reference

WinCvs/CJLib/CJLibrary/CJShell.cpp File Reference

#include "StdAfx.h"
#include "CJShell.h"

Include dependency graph for CJShell.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJShellList.cpp File Reference

WinCvs/CJLib/CJLibrary/CJShellList.cpp File Reference

#include "stdafx.h"
#include "CJResource.h"
#include "CJShellTree.h"
#include "CJShellList.h"
#include "CJSortClass.h"

Include dependency graph for CJShellList.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJShellTree.cpp File Reference

WinCvs/CJLib/CJLibrary/CJShellTree.cpp File Reference

#include "stdafx.h"
#include "CJShellTree.h"
#include "CJShellList.h"
#include "CJShell.h"
#include "CJFlatComboBox.h"
#include <direct.h>

Include dependency graph for CJShellTree.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJSizeDockBar.cpp File Reference

WinCvs/CJLib/CJLibrary/CJSizeDockBar.cpp File Reference

#include "stdafx.h"
#include "CJSizeDockBar.h"
#include "CJControlBar.h"
#include "CJToolBar.h"
#include "CJResource.h"

Include dependency graph for CJSizeDockBar.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define TRACK_BORDER_SIZE 4

Define Documentation

#define TRACK_BORDER_SIZE 4

Definition at line 104 of file CJSizeDockBar.cpp.

Referenced by CCJSizeDockBar::DrawBorders, CCJSizeDockBar::HitTest, CCJSizeDockBar::OnLButtonUp, CCJSizeDockBar::OnMouseMove, CCJSizeDockBar::OnNcCalcSize, and CCJSizeDockBar::OnNcLButtonDown.

Generated on Sun Feb 24 01:23:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJSortClass.cpp File Reference

WinCvs/CJLib/CJLibrary/CJSortClass.cpp File Reference

#include "stdafx.h"
#include "CJSortClass.h"

Include dependency graph for CJSortClass.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJStatusBar.cpp File Reference

WinCvs/CJLib/CJLibrary/CJStatusBar.cpp File Reference

#include "StdAfx.h"
#include "CJStatusBar.h"

Include dependency graph for CJStatusBar.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJTabCtrl.cpp File Reference

WinCvs/CJLib/CJLibrary/CJTabCtrl.cpp File Reference

#include "StdAfx.h"
#include "CJTabCtrl.h"

Include dependency graph for CJTabCtrl.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJTabCtrlBar.cpp File Reference

WinCvs/CJLib/CJLibrary/CJTabCtrlBar.cpp File Reference

#include "stdafx.h"
#include "CJTabCtrlBar.h"
#include "CJResource.h"

Include dependency graph for CJTabCtrlBar.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJTabView.cpp File Reference

WinCvs/CJLib/CJLibrary/CJTabView.cpp File Reference

#include "stdafx.h"
#include "CJTabView.h"

Include dependency graph for CJTabView.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJToolBar.cpp File Reference

WinCvs/CJLib/CJLibrary/CJToolBar.cpp File Reference

#include "stdafx.h"
#include "CJToolBar.h"
#include "CJFlatComboBox.h"
#include "CJComboBoxEx.h"
#include "CJFontCombo.h"
#include "CJMenu.h"

Include dependency graph for CJToolBar.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

struct | AFX_DLLVERSIONINFO
class | CCJToolCmdUI
struct | CJX_COLORMAP
struct | CJX_CONTROLPOS
struct | CToolBarData

Defines

#define | IDC_CUSTOMIZE_BAR 0xFF
#define | _RGB_TO_RGBQUAD(r, g, b) (RGB(b,g,r))
#define | _CLR_TO_RGBQUAD(clr) (RGB(GetBValue(clr), GetGValue(clr), GetRValue(clr)))
#define | CX_OVERLAP 0

Typedefs

typedef HRESULT(CALLBACK * | AFX_DLLGETVERSIONPROC )(AFX_DLLVERSIONINFO *)

Functions

HBITMAP AFXAPI | _LoadSysColorBitmap (HINSTANCE hInst, HRSRC hRsrc, BOOL bMono)
DWORD AFXAPI | _GetComCtlVersion ()
int AFXAPI | _GetDropDownWidth ()

Variables

const CJX_COLORMAP | _sysColorMap []
int | _ComCtlVersion = -1
int | _dropDownWidth = -1

Define Documentation

#define _CLR_TO_RGBQUAD ( clr ) (RGB(GetBValue(clr), GetGValue(clr), GetRValue(clr)))

Definition at line 122 of file CJToolBar.cpp.

Referenced by _LoadSysColorBitmap.

#define _RGB_TO_RGBQUAD | ( | r,
 |  | g,
 |  | b | ) | (RGB(b,g,r))

Definition at line 121 of file CJToolBar.cpp.

Referenced by _LoadSysColorBitmap.

#define CX_OVERLAP 0

Definition at line 1368 of file CJToolBar.cpp.

Referenced by CCJToolBar::CalcSize, and CCJToolBar::WrapToolBar.

#define IDC_CUSTOMIZE_BAR 0xFF

Definition at line 111 of file CJToolBar.cpp.

Referenced by CCJToolBar::OnRButtonDown.

Typedef Documentation

typedef HRESULT(CALLBACK* AFX_DLLGETVERSIONPROC)(AFX_DLLVERSIONINFO *)

Definition at line 225 of file CJToolBar.cpp.

Referenced by _GetComCtlVersion.

Function Documentation

DWORD AFXAPI _GetComCtlVersion ( )

Definition at line 229 of file CJToolBar.cpp.

References _ComCtlVersion, AFX_DLLGETVERSIONPROC, ASSERT, AFX_DLLVERSIONINFO::cbSize, AFX_DLLVERSIONINFO::dwMajorVersion, AFX_DLLVERSIONINFO::dwMinorVersion, NULL, and VERSION_WIN4.

Referenced by CCJReBar::Create, CCJToolBar::CreateEx, and DllMain.

00230 {
00231     // return cached version if already determined...
00232     if (_ComCtlVersion != -1)
00233         return _ComCtlVersion;
00234
00235     // otherwise determine comctl32.dll version via DllGetVersion
00236     HINSTANCE hInst = ::GetModuleHandleA("COMCTL32.DLL");
00237     ASSERT(hInst != NULL);
00238     AFX_DLLGETVERSIONPROC pfn;
00239     pfn = (AFX_DLLGETVERSIONPROC)GetProcAddress(hInst, "DllGetVersion");
00240     DWORD dwVersion = VERSION_WIN4;
00241     if (pfn != NULL)
00242     {
00243         AFX_DLLVERSIONINFO dvi;
00244         memset(&dvi, 0, sizeof(dvi));
00245         dvi.cbSize = sizeof(dvi);
00246         HRESULT hr = (*pfn)(&dvi);
00247         if (SUCCEEDED(hr))
00248         {
00249             ASSERT(dvi.dwMajorVersion <= 0xFFFF);
00250             ASSERT(dvi.dwMinorVersion <= 0xFFFF);
00251             dwVersion = MAKELONG(dvi.dwMinorVersion, dvi.dwMajorVersion);
00252         }
00253     }
00254     _ComCtlVersion = dwVersion;
00255     return dwVersion;
00256 }

int AFXAPI _GetDropDownWidth ( )

Definition at line 266 of file CJToolBar.cpp.

References _dropDownWidth, ASSERT, NULL, and VERIFY.

Referenced by CCJToolBar::CreateEx.

00267 {
00268     // return cached version if already determined...
00269     if (_dropDownWidth != -1)
00270         return _dropDownWidth;
00271
00272     // otherwise calculate it...
00273     HDC hDC = GetDC(NULL);
00274     ASSERT(hDC != NULL);
00275     HFONT hFont;
00276     if ((hFont = ::CreateFont(GetSystemMetrics(SM_CYMENUCHECK), 0, 0, 0,
00277         FW_NORMAL, 0, 0, 0, SYMBOL_CHARSET, 0, 0, 0, 0, _T("Marlett"))) != NULL)
00278     {
00279         HFONT hOldFont = (HFONT)::SelectObject(hDC, hFont);
00280
00281         VERIFY(GetCharWidth(hDC, '6', '6', &_dropDownWidth));
00282
00283         // fix potential resource leak - KStowell - 10-21-99
00284         if (hFont != NULL) {
00285             ::SelectObject(hDC, hOldFont);
00286             ::DeleteObject(hFont);
00287         }
00288     }
00289
00290     ::ReleaseDC(NULL, hDC);
00291     ASSERT(_dropDownWidth != -1);
00292     return _dropDownWidth;
00293 }

HBITMAP AFXAPI _LoadSysColorBitmap | ( | HINSTANCE | hInst,
 |  | HRSRC | hRsrc,
 |  | BOOL | bMono
 | ) |

Definition at line 141 of file CJToolBar.cpp.

References _CLR_TO_RGBQUAD, _RGB_TO_RGBQUAD, CJX_COLORMAP::iSysColorTo, NULL, and CJX_COLORMAP::rgbqFrom.

00142 {
00143     HGLOBAL hglb;
00144     if ((hglb = LoadResource(hInst, hRsrc)) == NULL)
00145         return NULL;
00146
00147     LPBITMAPINFOHEADER lpBitmap = (LPBITMAPINFOHEADER)LockResource(hglb);
00148     if (lpBitmap == NULL)
00149         return NULL;
00150
00151     // make copy of BITMAPINFOHEADER so we can modify the color table
00152     const int nColorTableSize = 16;
00153     UINT nSize = lpBitmap->biSize + nColorTableSize * sizeof(RGBQUAD);
00154     LPBITMAPINFOHEADER lpBitmapInfo = (LPBITMAPINFOHEADER)::malloc(nSize);
00155     if (lpBitmapInfo == NULL)
00156         return NULL;
00157     memcpy(lpBitmapInfo, lpBitmap, nSize);
00158
00159     // color table is in RGBQUAD DIB format
00160     DWORD* pColorTable =
00161         (DWORD*)(((LPBYTE)lpBitmapInfo) + (UINT)lpBitmapInfo->biSize);
00162
00163     for (int iColor = 0; iColor < nColorTableSize; iColor++)
00164     {
00165         // look for matching RGBQUAD color in original
00166         for (int i = 0; i < _countof(_sysColorMap); i++)
00167         {
00168             if (pColorTable[iColor] == _sysColorMap[i].rgbqFrom)
00169             {
00170                 if (bMono)
00171                 {
00172                     // all colors except text become white
00173                     if (_sysColorMap[i].iSysColorTo != COLOR_BTNTEXT)
00174                         pColorTable[iColor] = _RGB_TO_RGBQUAD(255, 255, 255);
00175                 }
00176                 else
00177                     pColorTable[iColor] =
00178                     _CLR_TO_RGBQUAD(::GetSysColor(_sysColorMap[i].iSysColorTo));
00179                 break;
00180             }
00181         }
00182     }
00183
00184     int nWidth = (int)lpBitmapInfo->biWidth;
00185     int nHeight = (int)lpBitmapInfo->biHeight;
00186     HDC hDCScreen = ::GetDC(NULL);
00187     HBITMAP hbm = ::CreateCompatibleBitmap(hDCScreen, nWidth, nHeight);
00188
00189     if (hbm != NULL)
00190     {
00191         HDC hDCGlyphs = ::CreateCompatibleDC(hDCScreen);
00192         HBITMAP hbmOld = (HBITMAP)::SelectObject(hDCGlyphs, hbm);
00193
00194         LPBYTE lpBits;
00195         lpBits = (LPBYTE)(lpBitmap + 1);
00196         lpBits += (1 << (lpBitmapInfo->biBitCount)) * sizeof(RGBQUAD);
00197
00198         StretchDIBits(hDCGlyphs, 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight,
00199             lpBits, (LPBITMAPINFO)lpBitmapInfo, DIB_RGB_COLORS, SRCCOPY);
00200         SelectObject(hDCGlyphs, hbmOld);
00201         ::DeleteDC(hDCGlyphs);
00202     }
00203     ::ReleaseDC(NULL, hDCScreen);
00204
00205     // free copy of bitmap info struct and resource itself
00206     ::free(lpBitmapInfo);
00207     ::FreeResource(hglb);
00208
00209     return hbm;
00210 }

Variable Documentation

int _ComCtlVersion = -1

Definition at line 227 of file CJToolBar.cpp.

Referenced by _GetComCtlVersion, CCJToolBar::CreateEx, CCJToolBar::GetButtonSize, CCJToolBar::OnNcCalcSize, CCJToolBar::OnPreserveZeroBorderHelper, CCJToolBar::OnSetSizeHelper, and CCJToolBar::SetButtons.

int _dropDownWidth = -1

Definition at line 264 of file CJToolBar.cpp.

Referenced by _GetDropDownWidth, and CCJToolBar::CreateEx.

const CJX_COLORMAP _sysColorMap[]

Initial value:

{

    { (RGB( 0x00 , 0x00 , 0x00 )),  COLOR_BTNTEXT },
    { (RGB( 0x80 , 0x80 , 0x80 )),  COLOR_BTNSHADOW },
    { (RGB( 0xC0 , 0xC0 , 0xC0 )),  COLOR_BTNFACE },
    { (RGB( 0xFF , 0xFF , 0xFF )),  COLOR_BTNHIGHLIGHT }
}

Definition at line 131 of file CJToolBar.cpp.

Generated on Sun Feb 24 01:23:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJToolBarBase.cpp File Reference

WinCvs/CJLib/CJLibrary/CJToolBarBase.cpp File Reference

#include "stdafx.h"
#include "CJToolBarBase.h"

Include dependency graph for CJToolBarBase.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | CX_GRIPPER 3
#define | CY_GRIPPER 3
#define | CX_BORDER_GRIPPER 2
#define | CY_BORDER_GRIPPER 2

Define Documentation

#define CX_BORDER_GRIPPER 2

Definition at line 309 of file CJToolBarBase.cpp.

Referenced by CCJToolBarBase::CalcInsideRect, and CCJToolBarBase::DrawGripper.

#define CX_GRIPPER 3

Definition at line 307 of file CJToolBarBase.cpp.

Referenced by CCJToolBarBase::CalcInsideRect, and CCJToolBarBase::DrawGripper.

#define CY_BORDER_GRIPPER 2

Definition at line 310 of file CJToolBarBase.cpp.

Referenced by CCJToolBarBase::CalcInsideRect, and CCJToolBarBase::DrawGripper.

#define CY_GRIPPER 3

Definition at line 308 of file CJToolBarBase.cpp.

Referenced by CCJToolBarBase::CalcInsideRect, and CCJToolBarBase::DrawGripper.

Generated on Sun Feb 24 01:23:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJToolBarCtrl.cpp File Reference

WinCvs/CJLib/CJLibrary/CJToolBarCtrl.cpp File Reference

#include "stdafx.h"
#include "CJToolBarCtrl.h"

Include dependency graph for CJToolBarCtrl.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJTreeCtrl.cpp File Reference

WinCvs/CJLib/CJLibrary/CJTreeCtrl.cpp File Reference

#include "stdafx.h"
#include "CJResource.h"
#include "CJTreeCtrl.h"

Include dependency graph for CJTreeCtrl.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJWindowPlacement.cpp File Reference

WinCvs/CJLib/CJLibrary/CJWindowPlacement.cpp File Reference

#include "StdAfx.h"
#include "CJResource.h"
#include "CJWindowPlacement.h"

Include dependency graph for CJWindowPlacement.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GfxGroupEdit.cpp File Reference

WinCvs/CJLib/CJLibrary/GfxGroupEdit.cpp File Reference

#include "stdafx.h"
#include "GfxGroupEdit.h"
#include "GfxOutBarCtrl.h"

Include dependency graph for GfxGroupEdit.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GfxOutBarCtrl.cpp File Reference

WinCvs/CJLib/CJLibrary/GfxOutBarCtrl.cpp File Reference

#include "stdafx.h"
#include "CJResource.h"
#include "GfxOutBarCtrl.h"
#include "GfxGroupEdit.h"
#include "CJMenu.h"

Include dependency graph for GfxOutBarCtrl.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GfxSplitterWnd.cpp File Reference

WinCvs/CJLib/CJLibrary/GfxSplitterWnd.cpp File Reference

#include "stdafx.h"
#include "GfxSplitterWnd.h"
#include <afxpriv.h>

Include dependency graph for GfxSplitterWnd.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | CX_BORDER 1
#define | CY_BORDER 1

Functions

void AFXAPI | DeferClientPos (AFX_SIZEPARENTPARAMS *lpLayout, CWnd *pWnd, int x, int y, int cx, int cy, BOOL bScrollBar)
void AFXAPI | LayoutRowCol (CSplitterWnd::CRowColInfo *pInfoArray, int nMax, int nSize, int nSizeSplitter)

Variables

BOOL | bNotWin4

Define Documentation

#define CX_BORDER 1

Definition at line 44 of file GfxSplitterWnd.cpp.

Referenced by DeferClientPos, CCJToolBarBase::DrawBorders, LayoutRowCol, CGfxSplitterWnd::OnDrawSplitter, and CCJFlatSplitterWnd::OnDrawSplitter.

#define CY_BORDER 1

Definition at line 45 of file GfxSplitterWnd.cpp.

Referenced by DeferClientPos, CCJToolBarBase::DrawBorders, LayoutRowCol, CGfxSplitterWnd::OnDrawSplitter, and CCJFlatSplitterWnd::OnDrawSplitter.

Function Documentation

void AFXAPI DeferClientPos | ( | AFX_SIZEPARENTPARAMS * | lpLayout,
 |  | CWnd * | pWnd,
 |  | int | x,
 |  | int | y,
 |  | int | cx,
 |  | int | cy,
 |  | BOOL | bScrollBar
 | ) | [static]

Definition at line 133 of file GfxSplitterWnd.cpp.

References ASSERT, CX_BORDER, CY_BORDER, and NULL.

Referenced by CGfxSplitterWnd::RecalcLayout.

00135 {
00136     ASSERT(pWnd != NULL);
00137     ASSERT(pWnd->m_hWnd != NULL);
00138
00139     if (bScrollBar)
00140     {
00141         // if there is enough room, draw scroll bar without border
00142         // if there is not enough room, set the WS_BORDER bit so that
00143         //   we will at least get a proper border drawn
00144         BOOL bNeedBorder = (cx <= CX_BORDER || cy <= CY_BORDER);
00145         pWnd->ModifyStyle(bNeedBorder ? 0 : WS_BORDER,
00146             bNeedBorder ? WS_BORDER : 0);
00147     }
00148     CRect rect(x, y, x+cx, y+cy);
00149
00150     // adjust for border size (even if zero client size)
00151
00152     // adjust for 3d border (splitter windows have implied border)
00153     if ((pWnd->GetExStyle() & WS_EX_CLIENTEDGE) ||
00154           pWnd->IsKindOf(RUNTIME_CLASS(CSplitterWnd)))
00155         rect.InflateRect(CX_BORDER*2, CY_BORDER*2);
00156
00157     // first check if the new rectangle is the same as the current
00158     CRect rectOld;
00159     pWnd->GetWindowRect(rectOld);
00160     pWnd->GetParent()->ScreenToClient(&rectOld);
00161     if (rect != rectOld)
00162         AfxRepositionWindow(lpLayout, pWnd->m_hWnd, rect);
00163 }

void AFXAPI LayoutRowCol | ( | CSplitterWnd::CRowColInfo * | pInfoArray,
 |  | int | nMax,
 |  | int | nSize,
 |  | int | nSizeSplitter
 | ) | [static]

Definition at line 166 of file GfxSplitterWnd.cpp.

References ASSERT, CX_BORDER, CY_BORDER, and NULL.

Referenced by CGfxSplitterWnd::RecalcLayout.

00168 {
00169     ASSERT(pInfoArray != NULL);
00170     ASSERT(nMax > 0);
00171     ASSERT(nSizeSplitter > 0);
00172
00173     CSplitterWnd::CRowColInfo* pInfo;
00174     int i;
00175
00176     if (nSize < 0)
00177         nSize = 0;  // if really too small, layout as zero size
00178
00179     // start with ideal sizes
00180     for (i = 0, pInfo = pInfoArray; i < nMax-1; i++, pInfo++)
00181     {
00182         if (pInfo->nIdealSize < pInfo->nMinSize)
00183             pInfo->nIdealSize = 0;      // too small to see
00184         pInfo->nCurSize = pInfo->nIdealSize;
00185     }
00186     pInfo->nCurSize = INT_MAX;  // last row/column takes the rest
00187
00188     for (i = 0, pInfo = pInfoArray; i < nMax; i++, pInfo++)
00189     {
00190         ASSERT(nSize >= 0);
00191         if (nSize == 0)
00192         {
00193             // no more room (set pane to be invisible)
00194             pInfo->nCurSize = 0;
00195             continue;       // don't worry about splitters
00196         }
00197         else if (nSize < pInfo->nMinSize && i != 0)
00198         {
00199             // additional panes below the recommended minimum size
00200             //   aren't shown and the size goes to the previous pane
00201             pInfo->nCurSize = 0;
00202
00203             // previous pane already has room for splitter + border
00204             //   add remaining size and remove the extra border
00205             ASSERT(CX_BORDER*2 == CY_BORDER*2);
00206             (pInfo-1)->nCurSize += nSize + CX_BORDER*2;
00207             nSize = 0;
00208         }
00209         else
00210         {
00211             // otherwise we can add the second pane
00212             ASSERT(nSize > 0);
00213             if (pInfo->nCurSize == 0)
00214             {
00215                 // too small to see
00216                 if (i != 0)
00217                     pInfo->nCurSize = 0;
00218             }
00219             else if (nSize < pInfo->nCurSize)
00220             {
00221                 // this row/col won't fit completely - make as small as possible
00222                 pInfo->nCurSize = nSize;
00223                 nSize = 0;
00224             }
00225             else
00226             {
00227                 // can fit everything
00228                 nSize -= pInfo->nCurSize;
00229             }
00230         }
00231
00232         // see if we should add a splitter
00233         ASSERT(nSize >= 0);
00234         if (i != nMax - 1)
00235         {
00236             // should have a splitter
00237             if (nSize > nSizeSplitter)
00238             {
00239                 nSize -= nSizeSplitter; // leave room for splitter + border
00240                 ASSERT(nSize > 0);
00241             }
00242             else
00243             {
00244                 // not enough room - add left over less splitter size
00245                 ASSERT(CX_BORDER*2 == CY_BORDER*2);
00246                 pInfo->nCurSize += nSize;
00247                 if (pInfo->nCurSize > (nSizeSplitter - CX_BORDER*2))
00248                     pInfo->nCurSize -= (nSizeSplitter - CY_BORDER*2);
00249                 nSize = 0;
00250             }
00251         }
00252     }
00253     ASSERT(nSize == 0); // all space should be allocated
00254 }

Variable Documentation

BOOL bNotWin4 [static]

Definition at line 49 of file GfxSplitterWnd.cpp.

Referenced by CGfxSplitterWnd::CGfxSplitterWnd, and CGfxSplitterWnd::RecalcLayout.

Generated on Sun Feb 24 01:23:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Resource.h File Reference

WinCvs/CJLib/CJLibrary/Resource.h File Reference

Go to the source code of this file.

Generated on Sun Feb 24 01:23:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/Resource.h Source File

WinCvs/CJLib/CJLibrary/Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Visual C++ generated include file.
00003 // Used by CJLIBRARY.RC
00004 //
00005
00006 // Next default values for new objects
00007 //
00008 #ifdef APSTUDIO_INVOKED
00009 #ifndef APSTUDIO_READONLY_SYMBOLS
00010
00011 #define _APS_NEXT_RESOURCE_VALUE        129
00012 #define _APS_NEXT_COMMAND_VALUE         32771
00013 #define _APS_NEXT_CONTROL_VALUE         1000
00014 #define _APS_NEXT_SYMED_VALUE           101
00015 #endif
00016 #endif
Generated on Sun Feb 24 01:21:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


StdAfx.cpp File Reference

WinCvs/CJLib/CJLibrary/StdAfx.cpp File Reference

#include "stdafx.h"

Include dependency graph for StdAfx.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:22:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/StdAfx.cpp Source File

WinCvs/CJLib/CJLibrary/StdAfx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  CJLibrary.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004 //
00005 // Copyright © 1999 CodeJock.com and
00006 // Copyright © 1998-1999 Kirk W. Stowell, All Rights Reserved.
00007 //
00008 // mailto:kstowell@codejock.com
00009 // http://www.codejock.com
00010 //
00011 // Not to be used or distributed without proper registration.
00012 //
00014 /****************************************************************************
00015  *
00016  * $Date: 1999/11/30 21:45:49 $
00017  * $Revision: 1.1.1.3 $
00018  * $Archive: /CodeJockey/CJLibrary/StdAfx.cpp $
00019  *
00020  * $History: StdAfx.cpp $
00021  *
00022  * *****************  Version 4  *****************
00023  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00024  * Updated in $/CodeJockey/CJLibrary
00025  * Updated copyright and contact information.
00026  *
00027  * *****************  Version 3  *****************
00028  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00029  * Updated in $/CodeJockey/CJLibrary
00030  *
00031  * *****************  Version 2  *****************
00032  * User: Kirk Stowell Date: 7/25/99    Time: 12:15a
00033  * Updated in $/CodeJockey/CJLibrary
00034  *
00035  * *****************  Version 1  *****************
00036  * User: Kirk Stowell Date: 6/23/99    Time: 12:05a
00037  * Created in $/CodeJockey/CJLibrary
00038  *
00039  ***************************************************************************/
00041
00042 #include "stdafx.h"
Generated on Sun Feb 24 01:21:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


StdAfx.h File Reference

WinCvs/CJLib/CJLibrary/StdAfx.h File Reference

#include <afxwin.h>
#include <afxext.h>
#include <afxole.h>
#include <afxodlgs.h>
#include <afxdisp.h>
#include <afxdb.h>
#include <afxdao.h>
#include <afxcmn.h>
#include <afxtempl.h>
#include <afxpriv.h>
#include <..\src\afximpl.h>

Include dependency graph for StdAfx.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | AFX_STDAFX_H__F235A078_2921_11D3_8733_000000000000__INCLUDED_
#define | VC_EXTRALEAN
#define | _VC_VERSION_5
#define | _CJXLIB_INLINE inline
#define | _CJX_EXT_CLASS
#define | _delete(p) {if(p){delete p;p=NULL;}}
#define | _destroyIcon(h) {if(h){::DestroyIcon(h);h=NULL;}}

Define Documentation

#define _CJX_EXT_CLASS

Definition at line 77 of file StdAfx.h.

#define _CJXLIB_INLINE inline

Definition at line 70 of file StdAfx.h.

#define _delete ( p ) {if(p){delete p;p=NULL;}}

Definition at line 91 of file StdAfx.h.

Referenced by CCJFlatTabCtrl::DeleteAllItems, CCJFlatTabCtrl::DeleteItem, CCJCaption::KillChildWindow, CCJCaption::OnCaptButton, CCJFontCombo::OnDestroy, CCJCaption::OnPushPinCancel, CCJTabCtrlBar::RemoveListItem, CCJFlatTabCtrl::~CCJFlatTabCtrl, CCJListCtrl::~CCJListCtrl, CCJListView::~CCJListView, CCJMDIFrameWnd::~CCJMDIFrameWnd, CCJTabCtrlBar::~CCJTabCtrlBar, and CCJTabView::~CCJTabView.

#define _destroyIcon ( h ) {if(h){::DestroyIcon(h);h=NULL;}}

Definition at line 92 of file StdAfx.h.

Referenced by CCJControlBar::OnUpdateCmdUI, CCJBrowseButton::~CCJBrowseButton, CCJCaptionPopupWnd::~CCJCaptionPopupWnd, CCJControlBar::~CCJControlBar, and CCJExplorerBar::~CCJExplorerBar.

#define _VC_VERSION_5

Definition at line 66 of file StdAfx.h.

#define AFX_STDAFX_H__F235A078_2921_11D3_8733_000000000000__INCLUDED_

Definition at line 30 of file StdAfx.h.

#define VC_EXTRALEAN

Definition at line 36 of file StdAfx.h.

Generated on Sun Feb 24 01:22:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/StdAfx.h Source File

WinCvs/CJLib/CJLibrary/StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //  or project specific include files that are used frequently, but
00003 //      are changed infrequently
00004 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00005 // See ReadMe.txt for TERMS OF USE.
00006 //
00008 /****************************************************************************
00009  *
00010  * $Date: 1999/11/30 21:45:49 $
00011  * $Revision: 1.1.1.3 $
00012  * $Archive: /CodeJock/CJLibrary/StdAfx.h $
00013  *
00014  * $History: StdAfx.h $
00015  *
00016  * *****************  Version 9  *****************
00017  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00018  * Updated in $/CodeJock/CJLibrary
00019  * Fixed potential resource and memory leak problems.
00020  *
00021  * *****************  Version 8  *****************
00022  * User: Kirk Stowell Date: 10/14/99   Time: 12:41p
00023  * Updated in $/CodeJock/CJLibrary
00024  * Added source control history to file header.
00025  *
00026  ***************************************************************************/
00028
00029 #if !defined(AFX_STDAFX_H__F235A078_2921_11D3_8733_000000000000__INCLUDED_)
00030 #define AFX_STDAFX_H__F235A078_2921_11D3_8733_000000000000__INCLUDED_
00031
00032 #if _MSC_VER >= 1000
00033 #pragma once
00034 #endif // _MSC_VER >= 1000
00035
00036 #define VC_EXTRALEAN        // Exclude rarely-used stuff from Windows headers
00037
00038 #ifdef _UNICODE
00039 #define UNICODE
00040 #endif
00041
00042 #include <afxwin.h>         // MFC core and standard components
00043 #include <afxext.h>         // MFC extensions
00044
00045 #ifndef _AFX_NO_OLE_SUPPORT
00046 #include <afxole.h>         // MFC OLE classes
00047 #include <afxodlgs.h>       // MFC OLE dialog classes
00048 #include <afxdisp.h>        // MFC OLE automation classes
00049 #endif // _AFX_NO_OLE_SUPPORT
00050
00051
00052 #ifndef _AFX_NO_DB_SUPPORT
00053 #include <afxdb.h>          // MFC ODBC database classes
00054 #endif // _AFX_NO_DB_SUPPORT
00055
00056 #ifndef _AFX_NO_DAO_SUPPORT
00057 #include <afxdao.h>         // MFC DAO database classes
00058 #endif // _AFX_NO_DAO_SUPPORT
00059
00060 #ifndef _AFX_NO_AFXCMN_SUPPORT
00061 #include <afxcmn.h>         // MFC support for Windows Common Controls
00062 #endif // _AFX_NO_AFXCMN_SUPPORT
00063
00064
00065 #if _MSC_VER < 1200
00066 #define _VC_VERSION_5
00067 #endif  // _VC_VERSION_5
00068
00069 #ifndef _CJXLIB_INLINE
00070 #define _CJXLIB_INLINE inline
00071 #endif // _AFXCMN_INLINE
00072
00073 #ifndef _CJX_EXT_CLASS
00074 #ifdef _AFXDLL
00075 #define _CJX_EXT_CLASS  AFX_CLASS_EXPORT // Always export CJLibrary files...
00076 #else
00077 #define _CJX_EXT_CLASS  // not used with static builds.
00078 #endif
00079 #endif // _CJX_EXT_CLASS
00080
00081 #ifndef __AFXTEMPL_H__
00082 #include <afxtempl.h>
00083 #endif
00084
00085 #ifndef __AFXPRIV_H__
00086 #include <afxpriv.h>
00087 #endif
00088
00089 #include <..\src\afximpl.h>
00090
00091 #define _delete(p){if(p){delete p;p=NULL;}}
00092 #define _destroyIcon(h){if(h){::DestroyIcon(h);h=NULL;}}
00093
00094 //{{AFX_INSERT_LOCATION}}
00095 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00096
00097 #endif // !defined(AFX_STDAFX_H__F235A078_2921_11D3_8733_000000000000__INCLUDED_)
Generated on Sun Feb 24 01:21:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/CJLibrary/Subclass.cpp Source File

WinCvs/CJLib/CJLibrary/Subclass.cpp

Go to the documentation of this file.
00001
00002 // Copyright 1998 Paul DiLascia
00003 // If this code works, it was written by Paul DiLascia.
00004 // If not, I don't know who wrote it.
00005 //
00006 // CSubclassWnd is a generic class for hooking another window's messages.
00007 //
00009 /****************************************************************************
00010  *
00011  * $Date: 1999/11/30 21:45:49 $
00012  * $Revision: 1.1.1.2 $
00013  * $Archive: /CodeJock/CJLibrary/Subclass.cpp $
00014  *
00015  * $History: Subclass.cpp $
00016  *
00017  * *****************  Version 2  *****************
00018  * User: Kirk Stowell Date: 10/14/99   Time: 12:41p
00019  * Updated in $/CodeJock/CJLibrary
00020  * Added source control history to file header.
00021  *
00022  ***************************************************************************/
00024
00025 #include "StdAfx.h"
00026 #include "Subclass.h"
00027
00028 #ifdef _DEBUG
00029 #define new DEBUG_NEW
00030 #undef THIS_FILE
00031 static char THIS_FILE[] = __FILE__;
00032 #endif
00033
00035 // The message hook map is derived from CMapPtrToPtr, which associates
00036 // a pointer with another pointer. It maps an HWND to a CSubclassWnd, like
00037 // the way MFC's internal maps map HWND's to CWnd's. The first CSubclassWnd
00038 // attached to a window is stored in the map; all other CSubclassWnd's for that
00039 // window are then chained via CSubclassWnd::m_pNext.
00040 //
00041 class CSubclassWndMap : private CMapPtrToPtr {
00042 public:
00043     CSubclassWndMap();
00044     ~CSubclassWndMap();
00045     static CSubclassWndMap& GetHookMap();
00046     void Add(HWND hwnd, CSubclassWnd* pSubclassWnd);
00047     void Remove(CSubclassWnd* pSubclassWnd);
00048     void RemoveAll(HWND hwnd);
00049     CSubclassWnd* Lookup(HWND hwnd);
00050 };
00051
00052 // This trick is used so the hook map isn't
00053 // instantiated until someone actually requests it.
00054 //
00055 #define theHookMap  (CSubclassWndMap::GetHookMap())
00056
00057 IMPLEMENT_DYNAMIC(CSubclassWnd, CWnd);
00058
00059 CSubclassWnd::CSubclassWnd()
00060 {
00061     m_pNext = NULL;
00062     m_pOldWndProc = NULL;
00063     m_hWnd  = NULL;
00064 }
00065
00066 CSubclassWnd::~CSubclassWnd()
00067 {
00068     if (m_hWnd)
00069         HookWindow((HWND)NULL);     // unhook window
00070 }
00071
00073 // Hook a window.
00074 // This installs a new window proc that directs messages to the CSubclassWnd.
00075 // pWnd=NULL to remove.
00076 //
00077 BOOL CSubclassWnd::HookWindow(HWND hwnd)
00078 {
00079     ASSERT_VALID(this);
00080     if (hwnd) {
00081         // Hook the window
00082         ASSERT(m_hWnd==NULL);
00083         ASSERT(::IsWindow(hwnd));
00084         theHookMap.Add(hwnd, this);         // Add to map of hooks
00085
00086     } else if (m_hWnd) {
00087         // Unhook the window
00088         theHookMap.Remove(this);                // Remove from map
00089         m_pOldWndProc = NULL;
00090     }
00091     m_hWnd = hwnd;
00092     return TRUE;
00093 }
00094
00096 // Window proc-like virtual function which specific CSubclassWnds will
00097 // override to do stuff. Default passes the message to the next hook;
00098 // the last hook passes the message to the original window.
00099 // You MUST call this at the end of your WindowProc if you want the real
00100 // window to get the message. This is just like CWnd::WindowProc, except that
00101 // a CSubclassWnd is not a window.
00102 //
00103 LRESULT CSubclassWnd::WindowProc(UINT msg, WPARAM wp, LPARAM lp)
00104 {
00105 //  ASSERT_VALID(this);  // removed for speed
00106     ASSERT(m_pOldWndProc);
00107     return m_pNext ? m_pNext->WindowProc(msg, wp, lp) :
00108         ::CallWindowProc(m_pOldWndProc, m_hWnd, msg, wp, lp);
00109 }
00110
00112 // Like calling base class WindowProc, but with no args, so individual
00113 // message handlers can do the default thing. Like CWnd::Default
00114 //
00115 LRESULT CSubclassWnd::Default()
00116 {
00117     // MFC stores current MSG in thread state
00118     MSG& curMsg = AfxGetThreadState()->m_lastSentMsg;
00119     // Note: must explicitly call CSubclassWnd::WindowProc to avoid infinte
00120     // recursion on virtual function
00121     return CSubclassWnd::WindowProc(curMsg.message, curMsg.wParam, curMsg.lParam);
00122 }
00123
00124 #ifdef _DEBUG
00125 void CSubclassWnd::AssertValid() const
00126 {
00127     CObject::AssertValid();
00128     ASSERT(m_hWnd==NULL || ::IsWindow(m_hWnd));
00129     if (m_hWnd) {
00130         for (CSubclassWnd* p = theHookMap.Lookup(m_hWnd); p; p=p->m_pNext) {
00131             if (p==this)
00132                 break;
00133         }
00134         ASSERT(p); // should have found it!
00135     }
00136 }
00137
00138 void CSubclassWnd::Dump(CDumpContext& dc) const
00139 {
00140     CObject::Dump(dc);
00141 }
00142
00143 #endif
00144
00146 // Subclassed window proc for message hooks. Replaces AfxWndProc (or whatever
00147 // else was there before.)
00148 //
00149 LRESULT CALLBACK
00150 HookWndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
00151 {
00152 #ifdef _USRDLL
00153     // If this is a DLL, need to set up MFC state
00154     AFX_MANAGE_STATE(AfxGetStaticModuleState());
00155 #endif
00156
00157     // Set up MFC message state just in case anyone wants it
00158     // This is just like AfxCallWindowProc, but we can't use that because
00159     // a CSubclassWnd is not a CWnd.
00160     //
00161     MSG& curMsg = AfxGetThreadState()->m_lastSentMsg;
00162     MSG  oldMsg = curMsg;   // save for nesting
00163     curMsg.hwnd     = hwnd;
00164     curMsg.message = msg;
00165     curMsg.wParam  = wp;
00166     curMsg.lParam  = lp;
00167
00168     // Get hook object for this window. Get from hook map
00169     CSubclassWnd* pSubclassWnd = theHookMap.Lookup(hwnd);
00170     ASSERT(pSubclassWnd);
00171
00172     LRESULT lr;
00173     if (msg==WM_NCDESTROY) {
00174         // Window is being destroyed: unhook all hooks (for this window)
00175         // and pass msg to orginal window proc
00176         //
00177         WNDPROC wndproc = pSubclassWnd->m_pOldWndProc;
00178         theHookMap.RemoveAll(hwnd);
00179         lr = ::CallWindowProc(wndproc, hwnd, msg, wp, lp);
00180
00181     } else {
00182         // pass to msg hook
00183         lr = pSubclassWnd->WindowProc(msg, wp, lp);
00184     }
00185     curMsg = oldMsg;            // pop state
00186     return lr;
00187 }
00188
00190 // CSubclassWndMap implementation
00191 //
00192 CSubclassWndMap::CSubclassWndMap()
00193 {
00194 }
00195
00196 CSubclassWndMap::~CSubclassWndMap()
00197 {
00198 // This assert bombs when posting WM_QUIT, so I've deleted it.
00199 //  ASSERT(IsEmpty());  // all hooks should be removed!
00200 }
00201
00203 // Get the one and only global hook map
00204 //
00205 CSubclassWndMap& CSubclassWndMap::GetHookMap()
00206 {
00207     // By creating theMap here, C++ doesn't instantiate it until/unless
00208     // it's ever used! This is a good trick to use in C++, to
00209     // instantiate/initialize a static object the first time it's used.
00210     //
00211     static CSubclassWndMap theMap;
00212     return theMap;
00213 }
00214
00216 // Add hook to map; i.e., associate hook with window
00217 //
00218 void CSubclassWndMap::Add(HWND hwnd, CSubclassWnd* pSubclassWnd)
00219 {
00220     ASSERT(hwnd && ::IsWindow(hwnd));
00221
00222     // Add to front of list
00223     pSubclassWnd->m_pNext = Lookup(hwnd);
00224     SetAt(hwnd, pSubclassWnd);
00225
00226     if (pSubclassWnd->m_pNext==NULL) {
00227         // If this is the first hook added, subclass the window
00228         pSubclassWnd->m_pOldWndProc =
00229             (WNDPROC)SetWindowLong(hwnd, GWL_WNDPROC, (DWORD)HookWndProc);
00230
00231     } else {
00232         // just copy wndproc from next hook
00233         pSubclassWnd->m_pOldWndProc = pSubclassWnd->m_pNext->m_pOldWndProc;
00234     }
00235     ASSERT(pSubclassWnd->m_pOldWndProc);
00236 }
00237
00239 // Remove hook from map
00240 //
00241 void CSubclassWndMap::Remove(CSubclassWnd* pUnHook)
00242 {
00243     HWND hwnd = pUnHook->m_hWnd;
00244     ASSERT(hwnd && ::IsWindow(hwnd));
00245
00246     CSubclassWnd* pHook = Lookup(hwnd);
00247     ASSERT(pHook);
00248     if (pHook==pUnHook) {
00249         // hook to remove is the one in the hash table: replace w/next
00250         if (pHook->m_pNext)
00251             SetAt(hwnd, pHook->m_pNext);
00252         else {
00253             // This is the last hook for this window: restore wnd proc
00254             RemoveKey(hwnd);
00255             SetWindowLong(hwnd, GWL_WNDPROC, (DWORD)pHook->m_pOldWndProc);
00256         }
00257     } else {
00258         // Hook to remove is in the middle: just remove from linked list
00259         while (pHook->m_pNext!=pUnHook)
00260             pHook = pHook->m_pNext;
00261         ASSERT(pHook && pHook->m_pNext==pUnHook);
00262         pHook->m_pNext = pUnHook->m_pNext;
00263     }
00264 }
00265
00267 // Remove all the hooks for a window
00268 //
00269 void CSubclassWndMap::RemoveAll(HWND hwnd)
00270 {
00271     CSubclassWnd* pSubclassWnd;
00272     while ((pSubclassWnd = Lookup(hwnd))!=NULL)
00273         pSubclassWnd->HookWindow((HWND)NULL);   // (unhook)
00274 }
00275
00277 // Find first hook associate with window
00278 //
00279 CSubclassWnd* CSubclassWndMap::Lookup(HWND hwnd)
00280 {
00281     CSubclassWnd* pFound = NULL;
00282     if (!CMapPtrToPtr::Lookup(hwnd, (void*&)pFound))
00283         return NULL;
00284     ASSERT_KINDOF(CSubclassWnd, pFound);
00285     return pFound;
00286 }
00287
Generated on Sun Feb 24 01:21:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJBrowseEdit.h Source File

WinCvs/CJLib/Include/CJBrowseEdit.h

Go to the documentation of this file.
00001 // CJCJBrowseEdit.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/Include/CJBrowseEdit.h $
00011  *
00012  * $History: CJBrowseEdit.h $
00013  *
00014  * *****************  Version 9  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:35p
00016  * Updated in $/CodeJock/Include
00017  * Modified resource include for static builds.
00018  *
00019  * Fixed potential resource and memory leak problems.
00020  *
00021  * Made class methods virtual for inheritance purposes.
00022  *
00023  * *****************  Version 8  *****************
00024  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00025  * Updated in $/CodeJockey/Include
00026  * Updated copyright and contact information.
00027  *
00028  * *****************  Version 7  *****************
00029  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00030  * Updated in $/CodeJockey/Include
00031  *
00032  * *****************  Version 6  *****************
00033  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00034  * Updated in $/CodeJockey/Include
00035  *
00036  * *****************  Version 5  *****************
00037  * User: Kirk Stowell Date: 7/18/99    Time: 10:17p
00038  * Updated in $/CodeJockey/Include
00039  * Cleaned up inline functions, and import/export macro so that class will
00040  * be imported when linked to, and exported at compile time.
00041  *
00042  * *****************  Version 4  *****************
00043  * User: Kirk Stowell Date: 6/25/99    Time: 11:03a
00044  * Updated in $/CodeJockey/Include
00045  * Chaned image list color mask and export macros.
00046  *
00047  * *****************  Version 3  *****************
00048  * User: Kirk Stowell Date: 6/14/99    Time: 10:41p
00049  * Updated in $/CodeJockey/Include
00050  * Cleaned up control and pointer initialization, creation and activation.
00051  * Added support for CCJMenu popup.
00052  *
00053  * *****************  Version 2  *****************
00054  * User: Kirk Stowell Date: 4/03/99    Time: 10:54p
00055  * Updated in $/CodeJockey/Include
00056  * Added comments and cleaned up code.
00057  *
00058  * *****************  Version 1  *****************
00059  * User: Kirk Stowell Date: 1/16/99    Time: 10:53p
00060  * Created in $/CodeJockey/Include
00061  * Initial release.
00062  *
00063  ***************************************************************************/
00065
00066 #ifndef __CJBROWSEEDIT_H__
00067 #define __CJBROWSEEDIT_H__
00068
00069 #if _MSC_VER >= 1000
00070 #pragma once
00071 #endif // _MSC_VER >= 1000
00072
00073 // holds the current search style for the control.
00074 typedef enum BROWSE_TYPE {
00075     BT_DIRECTORY = 1,
00076     BT_FILE      = 2,
00077     BT_POPUPMENU = 3
00078 };
00079
00080 // CCJBrowseButton is a CButton derived class which is used by
00081 // the CCJBrowseEdit class.
00082 class _CJX_EXT_CLASS CCJBrowseButton : public CButton
00083 {
00084
00085 public:
00086
00087     // Default constructor
00088     //
00089     CCJBrowseButton();
00090
00091     // Virtual destructor
00092     //
00093     virtual ~CCJBrowseButton();
00094
00095 public:
00096
00097     BOOL            m_bOpenFileDialog;  // TRUE for open file dialog, FALSE for
00098                                         // save as see SetDlgOpenFile(...)
00099     CString         m_strDefExt;
00100     CString         m_strFileName;
00101     DWORD           m_dwFlags;
00102     CString         m_strFilter;
00103     CString         m_strTitle;
00104     CWnd*           m_pParentWnd;   // parent of edit control.
00105
00106 protected:
00107
00108     UINT            m_nID;          // resource id for push button
00109     CWnd*           m_pEditWnd;     // edit control.
00110     CFont           m_Font;         // button font
00111     BROWSE_TYPE     m_eType;        // search type
00112     UINT            m_nMenu;        // popup menu id
00113     UINT            m_nSubMenuIndx; // index of popup submenu.
00114     HICON           m_hIcon;        // handle to button icon.
00115
00116 public:
00117     virtual void UpdateFont();
00118
00119     // returns an unused resource id for use by the control
00120     //
00121     virtual UINT GetNextID(
00122         // window to search for availiable resource ids
00123         CWnd* pWnd) const;
00124
00125 // Overrides
00126     // ClassWizard generated virtual function overrides
00127     //{{AFX_VIRTUAL(CCJBrowseButton)
00128     public:
00129     virtual BOOL Create(CWnd* pWnd, BROWSE_TYPE eType, UINT nMenu, UINT nSubMenuIndx);
00130     //}}AFX_VIRTUAL
00131
00132     // Generated message map functions
00133 protected:
00134
00135     //{{AFX_MSG(CCJBrowseButton)
00136     afx_msg void OnClicked();
00137     //}}AFX_MSG
00138
00139     DECLARE_MESSAGE_MAP()
00140 };
00141
00142 // CCJBrowseEdit is a CEdit derived class which has a push button associated
00143 // with it. It can be used to search for directories, files or activate a
00144 // popup menu
00145 class _CJX_EXT_CLASS CCJBrowseEdit : public CEdit
00146 {
00147 public:
00148
00149     // Default constructor
00150     //
00151     CCJBrowseEdit();
00152
00153     // Virtual destructor
00154     //
00155     virtual ~CCJBrowseEdit();
00156
00157 protected:
00158
00159     CCJBrowseButton     m_btnBrowse;    // push button
00160     BROWSE_TYPE         m_eType;        // search type
00161     UINT                m_nMenu;        // popup menu id
00162     UINT                m_nSubMenuIndx; // index of popup submenu.
00163
00164 public:
00165
00166     // this member function will initialize the control to
00167     // default values.
00168     //
00169     virtual void InitializeControl();
00170
00171     // Set to TRUE to construct a File Open dialog box or
00172     // FALSE to construct a File Save As dialog box
00173     //
00174     virtual void SetDlgOpenFile(BOOL bOpenFileDialog);
00175
00176     // this member function sets the default extension for the file
00177     // open dialog.
00178     //
00179     virtual void SetDlgDefExt(LPCTSTR strDefExt);
00180
00181     // this member funciton sets the default file name for the file
00182     // open dialog.
00183     //
00184     virtual void SetDlgFileName(LPCTSTR strFileName);
00185
00186     // this member function sets the style flags for the file
00187     // open dialog.
00188     //
00189     virtual void SetDlgStyle(DWORD dwFlags);
00190
00191     // this member function sets the file filter for the file
00192     // open dialog.
00193     //
00194     virtual void SetDlgFilter(LPCTSTR strFilter);
00195
00196     // this member function sets the owner for the file
00197     // open dialog
00198     //
00199     virtual void SetDlgOwner(CWnd* pParentWnd);
00200
00201     // this member function sets the title for the directory
00202     // dialog
00203     //
00204     virtual void SetDlgTitle(LPCTSTR strTitle);
00205
00206     // this member function sets the current search type
00207     // for the control
00208     //
00209     virtual void SetSearchType(
00210         // type of search to perform - BT_FILE, BT_DIRECTORY, BT_POPUPMENU
00211         BROWSE_TYPE eType,
00212         // if eType is a popup menu, resource id of menu.
00213         UINT nMenu = 0,
00214         // index of submenu to display.
00215         int nSubMenuIndx = 0);
00216
00217 // Overrides
00218     // ClassWizard generated virtual function overrides
00219     //{{AFX_VIRTUAL(CCJBrowseEdit)
00220     protected:
00221     virtual void PreSubclassWindow();
00222     //}}AFX_VIRTUAL
00223
00224     // Generated message map functions
00225 protected:
00226     //{{AFX_MSG(CCJBrowseEdit)
00227     afx_msg void OnEnable(BOOL bEnable);
00228     afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
00229     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00230     //}}AFX_MSG
00231
00232     DECLARE_MESSAGE_MAP()
00233 };
00234
00236 //  Inline Functions
00238
00239 _CJXLIB_INLINE UINT CCJBrowseButton::GetNextID(CWnd* pWnd) const
00240     { for(UINT nID=32767; nID!=1; --nID){if(!pWnd->GetDlgItem(nID)){return nID;}}return 0; }
00241
00242 _CJXLIB_INLINE void CCJBrowseEdit::SetDlgOpenFile(BOOL bOpenFileDialog=TRUE)
00243     { m_btnBrowse.m_bOpenFileDialog = bOpenFileDialog; }
00244
00245 _CJXLIB_INLINE void CCJBrowseEdit::SetDlgDefExt(LPCTSTR strDefExt=NULL)
00246     { m_btnBrowse.m_strDefExt = strDefExt; }
00247
00248 _CJXLIB_INLINE void CCJBrowseEdit::SetDlgFileName(LPCTSTR strFileName=NULL)
00249     { m_btnBrowse.m_strFileName = strFileName; }
00250
00251 _CJXLIB_INLINE void CCJBrowseEdit::SetDlgStyle(DWORD dwFlags=OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT)
00252     { m_btnBrowse.m_dwFlags = dwFlags; }
00253
00254 _CJXLIB_INLINE void CCJBrowseEdit::SetDlgFilter(LPCTSTR strFilter=NULL)
00255     { m_btnBrowse.m_strFilter = strFilter; }
00256
00257 _CJXLIB_INLINE void CCJBrowseEdit::SetDlgOwner(CWnd* pParentWnd=NULL)
00258     { m_btnBrowse.m_pParentWnd = pParentWnd; }
00259
00260 _CJXLIB_INLINE void CCJBrowseEdit::SetDlgTitle(LPCTSTR strTitle=NULL)
00261     { m_btnBrowse.m_strTitle = strTitle; }
00262
00263 _CJXLIB_INLINE void CCJBrowseEdit::SetSearchType(BROWSE_TYPE eType, UINT nMenu, int nSubMenuIndx)
00264     { m_eType = eType; m_nMenu = nMenu; m_nSubMenuIndx = nSubMenuIndx; }
00265
00267
00268 //{{AFX_INSERT_LOCATION}}
00269 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00270
00271 #endif // __CJBROWSEEDIT_H__
Generated on Sun Feb 24 01:21:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJCaption.h Source File

WinCvs/CJLib/Include/CJCaption.h

Go to the documentation of this file.
00001 // CJCaption.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/Include/CJCaption.h $
00011  *
00012  * $History: CJCaption.h $
00013  *
00014  * *****************  Version 15  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:41p
00016  * Updated in $/CodeJock/Include
00017  * Updated OnEraseBkgnd(...) and OnPaint() for flicker free drawing.
00018  *
00019  * Fixed bug when popup window is closed, the mainframe resizes and then
00020  * the popup is reopened and pushpin is pressed, the child will not be
00021  * correctly sized and positioned. Added changes to handle flicker free
00022  * drawing of the control window.
00023  *
00024  * Modified resource include for static builds.
00025  *
00026  * Fixed the bug where the icon on the right hand side of the bar doesn't
00027  * clip when you resize the bar to almost nothing. Added method
00028  * SetTextStyle(...) to set the CDC:: DrawText(...) text styles to be user
00029  * defined. Thanks to Adrian for help with this.
00030  *
00031  * Fixed potential resource and memory leak problems.
00032  *
00033  * Fixed small bug with UNICODE display placing unwanted character at the
00034  * end of the string.
00035  *
00036  * Made class methods virtual for inheritance purposes.
00037  *
00038  * *****************  Version 14  *****************
00039  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00040  * Updated in $/CodeJockey/Include
00041  * Updated copyright and contact information.
00042  *
00043  * *****************  Version 13  *****************
00044  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00045  * Updated in $/CodeJockey/Include
00046  *
00047  * *****************  Version 12  *****************
00048  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00049  * Updated in $/CodeJockey/Include
00050  *
00051  * *****************  Version 11  *****************
00052  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00053  * Updated in $/CodeJockey/Include
00054  *
00055  * *****************  Version 10  *****************
00056  * User: Kirk Stowell Date: 7/25/99    Time: 12:15a
00057  * Updated in $/CodeJockey/Include
00058  *
00059  * *****************  Version 9  *****************
00060  * User: Kirk Stowell Date: 7/24/99    Time: 9:32p
00061  * Updated in $/CodeJockey/Include
00062  *
00063  * *****************  Version 5  *****************
00064  * User: Kirk Stowell Date: 5/17/99    Time: 8:13p
00065  * Updated in $/CodeJockey/Include
00066  * Fixed painting bug with border, cleaned up inline methods.
00067  *
00068  * *****************  Version 4  *****************
00069  * User: Kirk Stowell Date: 4/03/99    Time: 12:36p
00070  * Updated in $/Code Jockey/Include
00071  * Added comments and cleaned up code.
00072  *
00073  * *****************  Version 3  *****************
00074  * User: Kirk Stowell Date: 3/03/99    Time: 12:27p
00075  * Updated in $/CodeJockey/Include
00076  * Added further functionality to class so that you can define text size,
00077  * text color, border size, border and background color. Basically to
00078  * create a look similar to Outlook's Captions.
00079  *
00080  * *****************  Version 2  *****************
00081  * User: Kirk Stowell Date: 2/01/99    Time: 12:28p
00082  * Updated in $/CodeJockey/Include
00083  * Made some cosmetic fixes.
00084  *
00085  * *****************  Version 1  *****************
00086  * User: Kirk Stowell Date: 1/16/99    Time: 12:27p
00087  * Created in $/CodeJockey/Include
00088  * Initial first release.
00089  *
00090  ***************************************************************************/
00092
00093 #ifndef __CJCAPTION_H__
00094 #define __CJCAPTION_H__
00095
00096 #if _MSC_VER >= 1000
00097 #pragma once
00098 #endif // _MSC_VER >= 1000
00099
00100 #include "CJFlatButton.h"
00101
00102 // CCJCaptionButton is a CCJFlatButton derived class which is used by
00103 // the CCJCaption class to activate a CCJCaptionPopupWnd window.
00104 class _CJX_EXT_CLASS CCJCaptionButton : public CCJFlatButton
00105 {
00106 public:
00107
00108     virtual BOOL SetButtonStyle(CFont* pFont, COLORREF clrBackground, COLORREF clrFont);
00109
00110 // Overrides
00111     // ClassWizard generated virtual function overrides
00112     //{{AFX_VIRTUAL(CCJCaptionButton)
00113     virtual void DrawButtonText(CDC* pDC, UINT nState, CRect& rcItem);
00114     //}}AFX_VIRTUAL
00115
00116 // Generated message map functions
00117 protected:
00118     //{{AFX_MSG(CCJCaptionButton)
00119     afx_msg void OnSysColorChange();
00120     //}}AFX_MSG
00121
00122     DECLARE_MESSAGE_MAP()
00123 };
00124
00125 class CCJCaptionPopupWnd;
00126
00127 #define WS_EX_FLATEDGE  0x01
00128
00129 // CCJCaption is a CStatic derived class which is simular to the
00130 // caption or info bars that are seen in Microsoft Outlook
00131 class _CJX_EXT_CLASS CCJCaption : public CStatic
00132 {
00133 public:
00134
00135     // Default constructor.
00136     //
00137     CCJCaption();
00138
00139     // Virtual destructor
00140     //
00141     virtual ~CCJCaption();
00142
00143 protected:
00144
00145     COLORREF            m_clrBtnHilite; // set to system color COLOR_BTNHILIGHT
00146     COLORREF            m_clrBtnShadow; // set to system color COLOR_BTNSHADOW
00147     COLORREF            m_clrBtnFace;   // set to system color COLOR_BTNFACE
00148     COLORREF            m_clrBorder;    // user defined border color
00149     COLORREF            m_clrBackgnd;   // user defined background color
00150     COLORREF            m_clrFont;      // user defined font color
00151     int                 m_nBorder;      // size in pixels for the caption border
00152     CFont*              m_pFont;        // user defined font pointer, default value NULL
00153     CFont               m_Font;         // default font created by control if m_pFont is NULL
00154     HICON               m_hIcon;        // user defined icon handle, default value NULL
00155     CString             m_strWindText;  // text that will be displayed in caption.
00156     int                 m_cx;           // icon width.
00157     int                 m_cy;           // icon height.
00158     int                 m_nOffset;
00159
00160     CWnd*               m_pChildWnd;
00161     CWnd*               m_pNotifyWnd;
00162     CCJCaptionButton    m_CaptionButton;
00163     CCJCaptionPopupWnd* m_pWndPopDown;
00164     CRect               m_rcChild;
00165     DWORD               m_dwExStyle;
00166     CRect               m_rcClient;
00167     DWORD               m_dwTextStyle;
00168
00169 public:
00170
00171     // Call this member function to set the caption bar border, background and
00172     // font colors.
00173     //
00174     virtual void SetCaptionColors(
00175         // A COLORREF value for the new border color.
00176         COLORREF clrBorder,
00177         // A COLORREF value for the new background color.
00178         COLORREF clrBackground,
00179         // A COLORREF value for the new font color.
00180         COLORREF clrFont);
00181
00182     // Call this function to modify the caption style. You can use this member function
00183     // to set the border size that is drawn around the caption banner, the font that the
00184     // caption will use, the caption text and icon to be displayed.
00185     //
00186     virtual void ModifyCaptionStyle(
00187         // Specifies size in pixels of the banner border.
00188         int nBorderSize,
00189         // Specifies the new caption font.
00190         CFont* pFont=NULL,
00191         // Address of a null-terminated string specifying the new caption text.
00192         LPCTSTR lpszWindText=NULL,
00193         // Handle of the icon to be drawn in the caption.
00194         HICON hIcon=NULL);
00195
00196     virtual void SetChildWindow(CWnd* pChild, CWnd* pNotifyWnd);
00197     virtual void KillChildWindow();
00198
00199     virtual void DrawCaptionBack(CDC* pDC, CRect& rcItem);
00200     virtual void DrawCaptionText(CDC* pDC, CRect& rcItem);
00201     virtual void DrawCaptionIcon(CDC* pDC, CRect& rcItem);
00202
00203 public:
00204     virtual void UpdateFont();
00205     virtual void UpdateCaption(LPCTSTR lpszWindowText, HICON hIcon);
00206     virtual void UpdateCaptionBack(CDC* pDC, CRect& rcItem);
00207     virtual void UpdateCaptionText(CDC* pDC, CRect& rcItem);
00208     virtual void SetTextStyle(DWORD dwStyle);
00209
00210 // Overrides
00211     // ClassWizard generated virtual function overrides
00212     //{{AFX_VIRTUAL(CCJCaption)
00213     public:
00214     virtual BOOL Create(CWnd* pParentWnd, LPCTSTR lpszWindowName, DWORD dwExStyle=WS_EX_FLATEDGE, DWORD dwStyle=WS_VISIBLE|SS_CENTER|SS_CENTERIMAGE, const CRect& rect=CRect(0,0,0,0), UINT nID = 0xffff);
00215     //}}AFX_VIRTUAL
00216
00217     // Generated message map functions
00218
00219 protected:
00220     //{{AFX_MSG(CCJCaption)
00221     afx_msg void OnPaint();
00222     afx_msg void OnSysColorChange();
00223     afx_msg void OnSize(UINT nType, int cx, int cy);
00224     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00225     //}}AFX_MSG
00226     afx_msg void OnCaptButton();
00227     afx_msg void OnPushPinButton(UINT lParam, LONG wParam);
00228     afx_msg void OnPushPinCancel(UINT lParam, LONG wParam);
00229
00230     DECLARE_MESSAGE_MAP()
00231 };
00232
00234 //  Inline Functions
00236
00237 _CJXLIB_INLINE void CCJCaption::SetTextStyle(DWORD dwStyle)
00238     { m_dwTextStyle = dwStyle; }
00239
00240 _CJXLIB_INLINE void CCJCaption::SetCaptionColors(COLORREF clrBorder, COLORREF clrBackground, COLORREF clrFont)
00241     { ASSERT(::IsWindow(m_hWnd)); m_clrBorder = clrBorder; m_clrBackgnd = clrBackground; m_clrFont = clrFont; }
00242
00244
00245 //{{AFX_INSERT_LOCATION}}
00246 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00247
00248 #endif // __CJCAPTION_H__
00249
Generated on Sun Feb 24 01:21:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJCaptionPopupWnd.h Source File

WinCvs/CJLib/Include/CJCaptionPopupWnd.h

Go to the documentation of this file.
00001 // CJCaptionPopupWnd.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/Include/CJCaptionPopupWnd.h $
00011  *
00012  * $History: CJCaptionPopupWnd.h $
00013  *
00014  * *****************  Version 5  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:44p
00016  * Updated in $/CodeJock/Include
00017  * Modified resource include for static builds.
00018  *
00019  * Fixed potential resource and memory leak problems.
00020  *
00021  * *****************  Version 4  *****************
00022  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00023  * Updated in $/CodeJockey/Include
00024  * Updated copyright and contact information.
00025  *
00026  * *****************  Version 3  *****************
00027  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00028  * Updated in $/CodeJockey/Include
00029  *
00030  * *****************  Version 2  *****************
00031  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00032  * Updated in $/CodeJockey/Include
00033  *
00034  * *****************  Version 1  *****************
00035  * User: Kirk Stowell Date: 7/14/99    Time: 9:46p
00036  * Created in $/CodeJockey/Include
00037  * Initial creation. Added popup class as a helper class for the
00038  * CCJCaption class. This class is used to display a popup window which
00039  * contains a child CWnd derived object.
00040  *
00041  ***************************************************************************/
00043
00044 #ifndef __CJCAPTIONPOPUPWND_H__
00045 #define __CJCAPTIONPOPUPWND_H__
00046
00047 #if _MSC_VER > 1000
00048 #pragma once
00049 #endif // _MSC_VER > 1000
00050
00052 // CCJCaptionPopupWnd window
00053
00054 #include "CJCaption.h"
00055 #include "CJFlatButton.h"
00056
00057 // caption popup window messages
00058 #define CM_ONPUSHPINBUTTON   WM_USER + 1001        // push pin clicked.
00059 #define CM_ONPUSHPINCANCEL   WM_USER + 1002        // push pin clicked.
00060
00061 // CCJCaptionPopupWnd is a CWnd derived class which is used by
00062 // the CCJCaption class to display a popup child window simular to Outlook
00063 class _CJX_EXT_CLASS CCJCaptionPopupWnd : public CWnd
00064 {
00065 // Construction
00066 public:
00067     CCJCaptionPopupWnd();
00068
00069 // Attributes
00070 public:
00071     CWnd*           m_pParentWnd;
00072     CWnd*           m_pChildWnd;
00073     CWnd*           m_pChildParent;
00074 protected:
00075     CCJCaption      m_Caption;
00076     CCJFlatButton   m_CaptionButton;
00077     HICON           m_hIconOn;      // handle to normal button icon.
00078     HICON           m_hIconOff;     // handle to pressed button icon.
00079
00080 // Operations
00081 public:
00082
00083 // Overrides
00084     // ClassWizard generated virtual function overrides
00085     //{{AFX_VIRTUAL(CCJCaptionPopupWnd)
00086     public:
00087     virtual BOOL Create(const CRect& rect, CWnd* pParentWnd, CWnd* pChildWnd);
00088     //}}AFX_VIRTUAL
00089
00090 // Implementation
00091 public:
00092     virtual ~CCJCaptionPopupWnd();
00093
00094     // Generated message map functions
00095 protected:
00096     //{{AFX_MSG(CCJCaptionPopupWnd)
00097     afx_msg void OnDestroy();
00098     afx_msg void OnCaptButton();
00099     afx_msg void OnPaint();
00100     afx_msg void OnTimer(UINT nIDEvent);
00101     //}}AFX_MSG
00102     DECLARE_MESSAGE_MAP()
00103 };
00104
00106
00107 //{{AFX_INSERT_LOCATION}}
00108 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00109
00110 #endif // !defined(__CJCAPTIONPOPUPWND_H__)
Generated on Sun Feb 24 01:21:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJColorPicker.h Source File

WinCvs/CJLib/Include/CJColorPicker.h

Go to the documentation of this file.
00001 #ifndef __CJCOLORPICKER_H__
00002 #define __CJCOLORPICKER_H__
00003
00004 #if _MSC_VER >= 1000
00005 #pragma once
00006 #endif // _MSC_VER >= 1000
00007
00008 // CJColorPicker.h : header file
00009 //
00010 // Written by Chris Maunder (chrismaunder@codeguru.com)
00011 // Extended by Alexander Bischofberger (bischofb@informatik.tu-muenchen.de)
00012 // Copyright (c) 1998.
00013 //
00014 // This code may be used in compiled form in any way you desire. This
00015 // file may be redistributed unmodified by any means PROVIDING it is
00016 // not sold for profit without the authors written consent, and
00017 // providing that this notice and the authors name is included. If
00018 // the source code in  this file is used in any commercial application
00019 // then a simple email would be nice.
00020 //
00021 // This file is provided "as is" with no expressed or implied warranty.
00022 // The author accepts no liability if it causes any damage whatsoever.
00023 // It's free - so you get what you pay for.
00024 //
00026 /****************************************************************************
00027  *
00028  * $Date: 1999/11/30 21:45:49 $
00029  * $Revision: 1.1.1.3 $
00030  * $Archive: /CodeJock/Include/CJColorPicker.h $
00031  *
00032  * $History: CJColorPicker.h $
00033  *
00034  * *****************  Version 6  *****************
00035  * User: Kirk Stowell Date: 10/31/99   Time: 11:50p
00036  * Updated in $/CodeJock/Include
00037  * Overrode OnEraseBkgnd(...), OnPaint() and made modifications to
00038  * DrawItem(...) for flicker free drawing.
00039  *
00040  * Modified resource include for static builds.
00041  *
00042  * Added method CheckTextColor(...) which tests if the intensity of the
00043  * color is greater as 128. If the intensity < 128 => color is dark, so
00044  * the text must be light. Stephane Routelous
00045  * [routelous@cad-cam-concept.de]
00046  *
00047  * Fixed potential resource and memory leak problems.
00048  *
00049  * Removed un-necessary calls to GetParent(), a call is made only once at
00050  * initialization, to ensure we are working with a valid handle.
00051  *
00052  * Made class methods virtual for inheritance purposes.
00053  *
00054  * *****************  Version 5  *****************
00055  * User: Kirk Stowell Date: 10/14/99   Time: 12:22p
00056  * Updated in $/CodeJock/Include
00057  * Added source control history to file header.
00058  *
00059  ***************************************************************************/
00061
00062 #include "CJColorPopup.h"
00063
00065 // CCJColorPicker window
00066
00067 void AFXAPI DDX_CJColorPicker(CDataExchange *pDX, int nIDC, COLORREF& crColor);
00068
00070 // CCJColorPicker window
00071
00072 #define CP_MODE_TEXT 1  // edit text Color
00073 #define CP_MODE_BK   2  // edit background Color (default)
00074
00075 class _CJX_EXT_CLASS CCJColorPicker : public CButton
00076 {
00077 // Construction
00078 public:
00079     CCJColorPicker();
00080     DECLARE_DYNCREATE(CCJColorPicker);
00081
00082 // Attributes
00083 public:
00084     virtual COLORREF GetColor();
00085     virtual void     SetColor(COLORREF crColor);
00086
00087     virtual void     SetDefaultText(LPCTSTR szDefaultText);
00088     virtual void     SetCustomText(LPCTSTR szCustomText);
00089
00090     virtual void     SetTrackSelection(BOOL bTracking = TRUE)  { m_bTrackSelection = bTracking; }
00091     virtual BOOL     GetTrackSelection()                       { return m_bTrackSelection; }
00092
00093     virtual void     SetSelectionMode(UINT nMode)              { m_nSelectionMode = nMode; }
00094     virtual UINT     GetSelectionMode()                        { return m_nSelectionMode; };
00095
00096     virtual void     SetBkColor(COLORREF crColorBk);
00097     virtual COLORREF GetBkColor()                             { return m_crColorBk; }
00098
00099     virtual void     SetTextColor(COLORREF crColorText);
00100     virtual COLORREF GetTextColor()                           { return m_crColorText;}
00101
00102     virtual void     CheckTextColor(COLORREF crColor);
00103
00104 // Operations
00105 public:
00106
00107 // Overrides
00108     // ClassWizard generated virtual function overrides
00109     //{{AFX_VIRTUAL(CCJColorPicker)
00110     public:
00111     virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
00112     protected:
00113     virtual void PreSubclassWindow();
00114     //}}AFX_VIRTUAL
00115
00116 // Implementation
00117 public:
00118     virtual ~CCJColorPicker();
00119
00120 protected:
00121     void SetWindowSize();
00122
00123 // protected attributes
00124 protected:
00125     BOOL     m_bActive,                // Is the dropdown active?
00126              m_bTrackSelection;        // track Color changes?
00127     COLORREF m_crColorBk;
00128     COLORREF m_crColorText;
00129     UINT     m_nSelectionMode;
00130     CRect    m_ArrowRect;
00131     CString  m_strDefaultText;
00132     CString  m_strCustomText;
00133     bool     m_bLBtnDown;
00134     CWnd*    m_pParentWnd;              // holds a pointer to the parent window.
00135
00136     // Generated message map functions
00137 protected:
00138     //{{AFX_MSG(CCJColorPicker)
00139     afx_msg BOOL OnClicked();
00140     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00141     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00142     afx_msg void OnPaint();
00143     //}}AFX_MSG
00144     afx_msg LONG OnSelEndOK(UINT lParam, LONG wParam);
00145     afx_msg LONG OnSelEndCancel(UINT lParam, LONG wParam);
00146     afx_msg LONG OnSelChange(UINT lParam, LONG wParam);
00147
00148     DECLARE_MESSAGE_MAP()
00149 };
00150
00152
00153 //{{AFX_INSERT_LOCATION}}
00154 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00155
00156 #endif // !defined(__CJCOLORPICKER_H__)
Generated on Sun Feb 24 01:21:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJColorPopup.h Source File

WinCvs/CJLib/Include/CJColorPopup.h

Go to the documentation of this file.
00001 #ifndef __CJCOLORPOPUP_H__
00002 #define __CJCOLORPOPUP_H__
00003
00004 #if _MSC_VER >= 1000
00005 #pragma once
00006 #endif // _MSC_VER >= 1000
00007
00008 // CJColorPopup.h : header file
00009 //
00010 // Written by Chris Maunder (chrismaunder@codeguru.com)
00011 // Extended by Alexander Bischofberger (bischofb@informatik.tu-muenchen.de)
00012 // Copyright (c) 1998.
00013 //
00014 // This code may be used in compiled form in any way you desire. This
00015 // file may be redistributed unmodified by any means PROVIDING it is
00016 // not sold for profit without the authors written consent, and
00017 // providing that this notice and the authors name is included. If
00018 // the source code in  this file is used in any commercial application
00019 // then a simple email would be nice.
00020 //
00021 // This file is provided "as is" with no expressed or implied warranty.
00022 // The author accepts no liability if it causes any damage whatsoever.
00023 // It's free - so you get what you pay for.
00024 //
00026 /****************************************************************************
00027  *
00028  * $Date: 1999/11/30 21:45:49 $
00029  * $Revision: 1.1.1.2 $
00030  * $Archive: /CodeJock/Include/CJColorPopup.h $
00031  *
00032  * $History: CJColorPopup.h $
00033  *
00034  * *****************  Version 7  *****************
00035  * User: Kirk Stowell Date: 10/31/99   Time: 11:53p
00036  * Updated in $/CodeJock/Include
00037  * Overrode OnEraseBkgnd(...) and made modifications to OnPaint(...) to
00038  * handle flicker free drawing.
00039  *
00040  * Modified resource include for static builds.
00041  *
00042  * Fixed potential resource and memory leak problems.
00043  *
00044  * Made class methods virtual for inheritance purposes.
00045  *
00046  * *****************  Version 6  *****************
00047  * User: Kirk Stowell Date: 10/14/99   Time: 12:23p
00048  * Updated in $/CodeJock/Include
00049  * Added source control history to file header.
00050  *
00051  ***************************************************************************/
00053
00054 // CCJColorPopup messages
00055 #define CPN_SELCHANGE        WM_USER + 1001        // Color Picker Selection change
00056 #define CPN_DROPDOWN         WM_USER + 1002        // Color Picker drop down
00057 #define CPN_CLOSEUP          WM_USER + 1003        // Color Picker close up
00058 #define CPN_SELENDOK         WM_USER + 1004        // Color Picker end OK
00059 #define CPN_SELENDCANCEL     WM_USER + 1005        // Color Picker end (cancelled)
00060
00061 // forward declaration
00062 class CColorPicker;
00063
00064 // To hold the Colors and their names
00065 typedef struct {
00066     COLORREF crColor;
00067     TCHAR    *szName;
00068 } ColorTableEntry;
00069
00071 // CCJColorPopup window
00072
00073 class _CJX_EXT_CLASS CCJColorPopup : public CWnd
00074 {
00075 // Construction
00076 public:
00077     CCJColorPopup();
00078     CCJColorPopup(CPoint p, COLORREF crColor, CWnd* pParentWnd,
00079                  LPCTSTR szDefaultText = NULL, LPCTSTR szCustomText = NULL);
00080     virtual void Initialise();
00081
00082 // Attributes
00083 public:
00084
00085 // Operations
00086 public:
00087     virtual BOOL Create(CPoint p, COLORREF crColor, CWnd* pParentWnd,
00088                 LPCTSTR szDefaultText = NULL, LPCTSTR szCustomText = NULL);
00089
00090 // Overrides
00091     // ClassWizard generated virtual function overrides
00092     //{{AFX_VIRTUAL(CCJColorPopup)
00093     public:
00094     virtual BOOL PreTranslateMessage(MSG* pMsg);
00095     //}}AFX_VIRTUAL
00096
00097 // Implementation
00098 public:
00099     virtual void UpdateFont();
00100     virtual ~CCJColorPopup();
00101
00102 protected:
00103     virtual BOOL GetCellRect(int nIndex, const LPRECT& rect);
00104     virtual void FindCellFromColor(COLORREF crColor);
00105     virtual void SetWindowSize();
00106     virtual void CreateToolTips();
00107     virtual void ChangeSelection(int nIndex);
00108     virtual void EndSelection(int nMessage);
00109     virtual void DrawCell(CDC* pDC, int nIndex);
00110
00111     virtual COLORREF GetColor(int nIndex)              { return m_crColors[nIndex].crColor; }
00112     virtual LPCTSTR GetColorName(int nIndex)           { return m_crColors[nIndex].szName; }
00113     virtual int  GetIndex(int row, int col) const;
00114     virtual int  GetRow(int nIndex) const;
00115     virtual int  GetColumn(int nIndex) const;
00116
00117 // protected attributes
00118 protected:
00119     static ColorTableEntry m_crColors[];
00120     int            m_nNumColors;
00121     int            m_nNumColumns, m_nNumRows;
00122     int            m_nBoxSize, m_nMargin;
00123     int            m_nCurrentSel;
00124     int            m_nChosenColorSel;
00125     CString        m_strDefaultText;
00126     CString        m_strCustomText;
00127     CRect          m_CustomTextRect, m_DefaultTextRect, m_WindowRect;
00128     CFont          m_Font;
00129     CPalette       m_Palette;
00130     COLORREF       m_crInitialColor, m_crColor;
00131     CToolTipCtrl   m_ToolTip;
00132     CWnd*          m_pParent;
00133
00134     // Generated message map functions
00135 protected:
00136     //{{AFX_MSG(CCJColorPopup)
00137     afx_msg void OnNcDestroy();
00138     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00139     afx_msg void OnPaint();
00140     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00141     afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00142     afx_msg BOOL OnQueryNewPalette();
00143     afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
00144     afx_msg void OnKillFocus(CWnd* pNewWnd);
00145     afx_msg void OnActivateApp(BOOL bActive, HTASK hTask);
00146     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00147     //}}AFX_MSG
00148     DECLARE_MESSAGE_MAP()
00149 };
00150
00152
00153 //{{AFX_INSERT_LOCATION}}
00154 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00155
00156 #endif // !defined(__CJCOLORPOPUP_H__)
Generated on Sun Feb 24 01:21:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJComboBoxEx.h Source File

WinCvs/CJLib/Include/CJComboBoxEx.h

Go to the documentation of this file.
00001 // CJComboBoxEx.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Copied from MFC, Visual C++ 6, to extend functionality to Visual C++ 5
00006 // users, with some ideas taken from Luis Barreira's article 'Classes for new
00007 // IE4 controls' http://www.codeguru.com/controls/ie4_controls_classes.shtml
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:49 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJockey/Include/CJComboBoxEx.h $
00015  *
00016  * $History: CJComboBoxEx.h $
00017  *
00018  * *****************  Version 6  *****************
00019  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00020  * Updated in $/CodeJockey/Include
00021  * Updated copyright and contact information.
00022  *
00023  * *****************  Version 5  *****************
00024  * User: Kirk Stowell Date: 7/28/99    Time: 12:39a
00025  * Updated in $/CodeJockey/Include
00026  * Final pass for release 6.08.
00027  *
00028  * *****************  Version 4  *****************
00029  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00030  * Updated in $/CodeJockey/Include
00031  *
00032  * *****************  Version 3  *****************
00033  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00034  * Updated in $/CodeJockey/Include
00035  *
00036  * *****************  Version 2  *****************
00037  * User: Kirk Stowell Date: 7/18/99    Time: 10:17p
00038  * Updated in $/CodeJockey/Include
00039  * Cleaned up inline functions, and import/export macro so that class will
00040  * be imported when linked to, and exported at compile time.
00041  *
00042  * *****************  Version 1  *****************
00043  * User: Kirk Stowell Date: 6/25/99    Time: 12:05p
00044  * Created in $/CodeJockey/Include
00045  * Copied from MFC, Visual C++ 6. Added to extend functionality to Visual
00046  * C++ 5 users.
00047  *
00048  ***************************************************************************/
00050
00051 #ifndef __CJCOMBOBOXEX_H__
00052 #define __CJCOMBOBOXEX_H__
00053
00054 // The CCJComboBoxEx class extends the combo box control by providing support
00055 // for image lists. By using CCJComboBoxEx to create combo box controls, you no
00056 // longer need to implement your own image drawing code. Instead, use CCJComboBoxEx
00057 // to access images from an image list.
00058 class _CJX_EXT_CLASS CCJComboBoxEx : public CComboBox
00059 {
00060     DECLARE_DYNAMIC(CCJComboBoxEx)
00061
00062 // Construction / destruction
00063 public:
00064
00065     // Constructs a CCJComboBoxEx object
00066     //
00067     CCJComboBoxEx();
00068
00069     // Destroys a CCJCombboBoxEx object
00070     //
00071     virtual ~CCJComboBoxEx();
00072
00073 // Initialization
00074 public:
00075
00076     // Creates the combo box and attaches it to the CCJComboBoxEx object.
00077     //
00078     BOOL Create(
00079         // Specifies the combination of combo box styles
00080         // applied to the combo box.
00081         DWORD dwStyle,
00082         // A reference to a CRect object orRECT structure, which
00083         // is the position and size of the combo box
00084         const RECT& rect,
00085         // A pointer to a CWnd object that is the parent window of
00086         // the combo box (usually a CDialog). It must not be NULL
00087         CWnd* pParentWnd,
00088         // Specifies the combo box’s control ID.
00089         UINT nID);
00090
00091 // Operators
00092 public:
00093
00094     // Removes an item from a ComboBoxEx control.
00095     // Returns the number of items remaining in the control. If iIndex
00096     // is invalid, the function returns CB_ERR.
00097     //
00098     int DeleteItem(
00099         // Zero-based index of the item to be removed.
00100         int iIndex);
00101
00102     // Retrieves item information for a given ComboBoxEx item
00103     // Returns nonzero if the operation was successful; otherwise 0.
00104     //
00105     BOOL GetItem(
00106         // A pointer to aCOMBOBOXEXITEM structure that will receive
00107         // the item information.
00108         COMBOBOXEXITEM* pCBItem);
00109
00110     // Inserts a new item in a ComboBoxEx control.
00111     // Returns the index at which the new item was inserted if
00112     // successful; otherwise -1
00113     int InsertItem(
00114         // A pointer to aCOMBOBOXEXITEM structure that will receive the
00115         // item information. This structure contains callback flag values for the item.
00116         const COMBOBOXEXITEM* pCBItem);
00117
00118     // Inserts a new item in a ComboBoxEx control.
00119     // Returns the index at which the new item was inserted if
00120     // successful; otherwise -1
00121     int InsertItem(
00122         // item index.
00123         int iItem,
00124         // string resource.
00125         UINT nStringID,
00126         // ammount (in pixels) image is to be indented.
00127         int iIndent=0,
00128         // image index.
00129         int iImage=0,
00130         // selected image index.
00131         int iSelectedImage=0,
00132         // style mask.
00133         UINT mask=CBEIF_TEXT|CBEIF_IMAGE|CBEIF_SELECTEDIMAGE|CBEIF_INDENT);
00134
00135     // Inserts a new item in a ComboBoxEx control.
00136     // Returns the index at which the new item was inserted if
00137     // successful; otherwise -1
00138     int InsertItem(
00139         // item index.
00140         int iItem,
00141         // item string.
00142         LPCTSTR lpszItem,
00143         // ammount (in pixels) image is to be indented.
00144         int iIndent=0,
00145         // image index.
00146         int iImage=0,
00147         // selected image index.
00148         int iSelectedImage=0,
00149         // style mask.
00150         UINT mask=CBEIF_TEXT|CBEIF_IMAGE|CBEIF_SELECTEDIMAGE|CBEIF_INDENT);
00151
00152     // Sets the attributes for an item in a ComboBoxEx control.
00153     // Returns nonzero if the operation was successful; otherwise 0.
00154     //
00155     BOOL SetItem(
00156         // A pointer to aCOMBOBOXEXITEM structure that will receive the
00157         // item information
00158         const COMBOBOXEXITEM* pCBItem);
00159
00160 // Atrributes
00161 public:
00162
00163     // Retrieves the extended styles that are in use for a ComboBoxEx
00164     // control. Returns the DWORD value that contains the extended styles
00165     // that are used for the combo box control.
00166     //
00167     DWORD GetExtendedStyle() const;
00168
00169     // Sets extended styles within a ComboBoxEx control.
00170     // Returns a DWORD value that contains the extended styles previously
00171     // used for the control.
00172     //
00173     DWORD SetExtendedStyle(
00174         // A DWORD value that indicates which styles in dwExStyles are to
00175         // be affected. Only the extended styles in dwExMask will be changed.
00176         // All other styles will be maintained as is. If this parameter is
00177         // zero, then all of the styles in dwExStyles will be affected
00178         DWORD dwExMask,
00179         // A DWORD value that contains the combo box control extended styles
00180         // to set for the control
00181         DWORD dwExStyles);
00182
00183     // Determines if the user has changed the contents of the ComboBoxEx
00184     // edit control by typing.
00185     // Returns nonzero if the user has typed in the control's
00186     // edit box; otherwise 0.
00187     BOOL HasEditChanged();
00188
00189     // Retrieves the handle to the edit control portion of a ComboBoxEx
00190     // control. Returns a pointer to a CEdit object.
00191     //
00192     CEdit* GetEditCtrl();
00193
00194     // Retrieves a pointer to the child combo box control.
00195     // Returns a pointer to a CComboBox object.
00196     //
00197     CComboBox* GetComboBoxCtrl();
00198
00199     // Retrieves a pointer to the image list assigned to a ComboBoxEx
00200     // control. Returns a pointer to a CImageList object. If it fails,
00201     // this member function returns NULL.
00202     //
00203     CImageList* GetImageList() const;
00204
00205     // Sets an image list for a ComboBoxEx control.
00206     // Returns a pointer to a CImageList object containing the images
00207     // previously used by the CCJComboBoxEx control. NULL if no image list
00208     //was previously set.
00209     //
00210     CImageList* SetImageList(
00211         // A pointer to a CImageList object containing the images to use with
00212         // the CCJComboBoxEx control.
00213         CImageList* pImageList);
00214
00215 // Un-supported
00216 public:
00217
00218     // Un-supported base class message.
00219     //
00220     int Dir(UINT attr, LPCTSTR lpszWildCard);
00221
00222     // Un-supported base class message.
00223     //
00224     int FindString(int nIndexStart, LPCTSTR lpszFind) const;
00225
00226     // Un-supported base class message.
00227     //
00228     int AddString(LPCTSTR lpszString);
00229
00230     // Un-supported base class message.
00231     //
00232     BOOL SetEditSel(int nStartChar, int nEndChar);
00233
00234     // Un-supported base class message.
00235     //
00236     int InsertString(int nIndex, LPCTSTR lpszString);
00237 };
00238
00240 //  Inline Functions
00242
00243 _CJXLIB_INLINE CCJComboBoxEx::CCJComboBoxEx()
00244     { }
00245 _CJXLIB_INLINE DWORD CCJComboBoxEx::GetExtendedStyle() const
00246     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, CBEM_GETEXTENDEDSTYLE, 0, 0); }
00247 _CJXLIB_INLINE DWORD CCJComboBoxEx::SetExtendedStyle(DWORD dwExMask, DWORD dwExStyles)
00248     { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, CBEM_SETEXTENDEDSTYLE, (DWORD) dwExMask, (LPARAM) dwExStyles); }
00249 _CJXLIB_INLINE BOOL CCJComboBoxEx::HasEditChanged()
00250     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, CBEM_HASEDITCHANGED, 0, 0); }
00251 _CJXLIB_INLINE CEdit* CCJComboBoxEx::GetEditCtrl()
00252     { ASSERT(::IsWindow(m_hWnd)); return (CEdit*) CEdit::FromHandle((HWND) ::SendMessage(m_hWnd, CBEM_GETEDITCONTROL, 0, 0)); }
00253 _CJXLIB_INLINE CComboBox* CCJComboBoxEx::GetComboBoxCtrl()
00254     { ASSERT(::IsWindow(m_hWnd)); return (CComboBox*) CComboBox::FromHandle((HWND) ::SendMessage(m_hWnd, CBEM_GETCOMBOCONTROL, 0, 0)); }
00255 _CJXLIB_INLINE CImageList* CCJComboBoxEx::SetImageList(CImageList* pImageList)
00256     { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, CBEM_SETIMAGELIST, 0, (LPARAM)pImageList->GetSafeHandle())); }
00257 _CJXLIB_INLINE CImageList* CCJComboBoxEx::GetImageList() const
00258     { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, CBEM_GETIMAGELIST, 0, 0)); }
00259
00260 // While CCJComboBoxEx derives from CComboBox, there are some
00261 // CB_messages the underlying ComboBoxEx control doesn't support.
00262
00263 _CJXLIB_INLINE int CCJComboBoxEx::Dir(UINT attr, LPCTSTR lpszWildCard)
00264     { UNUSED_ALWAYS(attr); UNUSED_ALWAYS(lpszWildCard); ASSERT(FALSE); return CB_ERR; }
00265 _CJXLIB_INLINE int CCJComboBoxEx::FindString(int nIndexStart, LPCTSTR lpszFind) const
00266     { UNUSED_ALWAYS(nIndexStart); UNUSED_ALWAYS(lpszFind); ASSERT(FALSE); return CB_ERR; }
00267 _CJXLIB_INLINE int CCJComboBoxEx::AddString(LPCTSTR lpszString)
00268     { UNUSED_ALWAYS(lpszString); ASSERT(FALSE); return CB_ERR; }
00269 _CJXLIB_INLINE BOOL CCJComboBoxEx::SetEditSel(int nStartChar, int nEndChar)
00270     { UNUSED_ALWAYS(nStartChar); UNUSED_ALWAYS(nEndChar); ASSERT(FALSE); return FALSE; }
00271 _CJXLIB_INLINE int CCJComboBoxEx::InsertString(int nIndex, LPCTSTR lpszString)
00272     { UNUSED_ALWAYS(nIndex); UNUSED_ALWAYS(lpszString); ASSERT(FALSE); return CB_ERR; }
00273
00274 #endif //__CJCOMBOBOXEX_H__
00275
Generated on Sun Feb 24 01:21:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJControlBar.h Source File

WinCvs/CJLib/Include/CJControlBar.h

Go to the documentation of this file.
00001 // CJControlBar.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/Include/CJControlBar.h $
00011  *
00012  * $History: CJControlBar.h $
00013  *
00014  * *****************  Version 19  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:21p
00016  * Updated in $/CodeJock/Include
00017  * Overrode OnEraseBkgnd(...) and OnPaint() to handle flicker free
00018  * drawing. Made additional modifications to load and save bar state
00019  * methods.
00020  *
00021  * Modified resource include for static builds.
00022  *
00023  * Enabled OnInitialUpdate() to be called for view classes added to a
00024  * CCJTabCtrlBar while the control bar is floating.
00025  *
00026  * Fixed potential resource and memory leak problems.
00027  *
00028  * Overloaded EnableFlatLook() method so that the gripper, frame buttons
00029  * and borders can be set flat individually.  Added inline function
00030  * EnableSaveState() which can be used to enable or disable the restore
00031  * bar state.
00032  *
00033  * Fixed bug with save / restore bar state, and with saved bar size
00034  * changing whenever the application starts.
00035  *
00036  * Fixed small initialization bug.
00037  *
00038  * Made class methods virtual for inheritence purposes.
00039  *
00040  * *****************  Version 18  *****************
00041  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00042  * Updated in $/CodeJockey/Include
00043  * Updated copyright and contact information.
00044  *
00045  * *****************  Version 17  *****************
00046  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00047  * Updated in $/CodeJockey/Include
00048  *
00049  * *****************  Version 16  *****************
00050  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00051  * Updated in $/CodeJockey/Include
00052  *
00053  * *****************  Version 15  *****************
00054  * User: Kirk Stowell Date: 7/18/99    Time: 10:18p
00055  * Updated in $/CodeJockey/Include
00056  * Added derived button class to handle control bar caption button
00057  * updates. Cleaned up inline functions, and import/export macro so that
00058  * class will be imported when linked to, and exported at compile time.
00059  *
00060  * *****************  Version 14  *****************
00061  * User: Kirk Stowell Date: 6/11/99    Time: 8:24p
00062  * Updated in $/CodeJockey/Include
00063  * Slight modification made to popup menu code.
00064  *
00065  * *****************  Version 13  *****************
00066  * User: Kirk Stowell Date: 6/09/99    Time: 8:33p
00067  * Updated in $/CodeJockey/Include
00068  * Ioannhs Stamatopoulos (Yiannhs) [ystamat@mail.datamedia.gr] - Extended
00069  * docking windows, removed ::GetSysColor(...) calls and WM_SYSCOLORCHANGE
00070  * message handler, this is now automatically handled by the base class.
00071  * Added redraw flags to the create method and modified paint and layout
00072  * handlers to reduce flicker and un-necessary command handling. Dragging
00073  * rect now reflects actual control bar docked size. Added "flat" look to
00074  * the control bars, the control bars can now use the classic DevStudio
00075  * look, or use flat gradient gripper, borders and frame buttons. Overall,
00076  * docking windows now handle dragging, docking and floating much better,
00077  * and behave more like DevStudio.
00078  *
00079  * *****************  Version 12  *****************
00080  * User: Kirk Stowell Date: 5/03/99    Time: 9:52p
00081  * Updated in $/CodeJockey/Include
00082  * Changed gripper and button macros to enums. Renamed popup member
00083  * variables to begin with popup, this will be consistent throughout all
00084  * classes. Added m_nPos member variable which can be set to the index of
00085  * the popup menu in the menu resource. Removed windows message handler
00086  * ON_WM_CONTEXTMENU(), and added handlers ON_WM_RBUTTONDOWN(),
00087  * ON_WM_MEASUREITEM(), ON_WM_MENUCHAR() and ON_WM_INITMENUPOPUP() to
00088  * support the CCJMenu popup. Added WS_CLIPSIBLINGS to control bar style.
00089  * Changed OnEraseBkgnd(CDC* pDC) to only draw client area when a child is
00090  * not present.
00091  *
00092  * *****************  Version 11  *****************
00093  * User: Kirk Stowell Date: 4/14/99    Time: 12:54p
00094  * Updated in $/CodeJockey/Include
00095  * Modified context menu to use Brent Corkum's BCMenu (CCJMenu).
00096  *
00097  * *****************  Version 10  *****************
00098  * User: Kirk Stowell Date: 4/03/99    Time: 12:52p
00099  * Updated in $/CodeJockey/Include
00100  * Added comments and cleaned up code.
00101  *
00102  * *****************  Version 9  *****************
00103  * User: Kirk Stowell Date: 3/13/99    Time: 12:54p
00104  * Updated in $/CodeJockey/Include
00105  * Patrick Bergeron [patb@softimage.com] fixed the following bugs:
00106  *
00107  * I had a dialog nested in a CJControlBar. Unfortunately when I tried to
00108  * dock it to the left or right, the bottom part of my dialog would be
00109  * clipped off.
00110  *
00111  * Fix: When in docked mode, ::CalcDynamicLayout needed to return the
00112  * desired size, while taking into account the size of the gripper bar (if
00113  * any). Simply added a simple "+GetMinExt()" Now my dialog's bottom
00114  * doesn't get clipped. Woo-ha.
00115  *
00116  * When nesting a CDialog based window inside a CJControlBar, the 3D rect
00117  * drawn by ::OnEraseBkgnd would be overwritten by the top and left dialog
00118  * borders. The problem was caused by the fact that in the
00119  * ::OnWindowPosChanged() method, the rectangle which is used to move the
00120  * window contains the border. A simple call to rc.DeflateRect(1,1) solved
00121  * this problem.
00122  *
00123  * Added a call to UpdateWindow() in ::OnEraseBkgnd(). This helps with the
00124  * flickering a bit, but I Am not sure this is the correct way to go.
00125  * Incorporate at your own risks.
00126  *
00127  * Added 2 ASSERT()s in ::OnMouseMove(). This was not to fix a bug, but at
00128  * one point I was seeing strange things that lead me to add these
00129  * asserts. They don't do anything bad, so why remove them?
00130  *
00131  * *****************  Version 8  *****************
00132  * User: Kirk Stowell Date: 3/10/99    Time: 12:50p
00133  * Updated in $/CodeJockey/Include
00134  * Fixed memory leak with button tooltips.
00135  *
00136  * *****************  Version 7  *****************
00137  * User: Kirk Stowell Date: 3/10/99    Time: 12:48p
00138  * Updated in $/CodeJockey/Include
00139  * Added AfxRegisterWndClass() to create method to handle double clicks.
00140  * Thanks to Takehiko Mizoguti [mizoguti@m2.sys.to.casio.co.jp] for some
00141  * thoughts on this.
00142  *
00143  * *****************  Version 6  *****************
00144  * User: Kirk Stowell Date: 2/28/99    Time: 12:47p
00145  * Updated in $/CodeJockey/Include
00146  * Calls default wnd proc if no context menu is defined Gonzalo Pereyra
00147  * [persys@adinet.com.uy]
00148  *
00149  * *****************  Version 5  *****************
00150  * User: Kirk Stowell Date: 1/31/99    Time: 12:48p
00151  * Updated in $/CodeJockey/Include
00152  * Removed extra line (typo) from OnLButtonUp(). Thanks to Ioannis
00153  * Stamatopoulos (ystamat@mail.datamedia.gr) for pointing this out.
00154  *
00155  * *****************  Version 4  *****************
00156  * User: Kirk Stowell Date: 1/12/99    Time: 12:46p
00157  * Updated in $/CodeJockey/Include
00158  * Total class re-write, added multiple/side-by-side controlbar docking.
00159  * No longer uses CSizingControlBar base class.
00160  *
00161  * *****************  Version 3  *****************
00162  * User: Kirk Stowell Date: 11/22/98   Time: 12:47p
00163  * Updated in $/CodeJockey/Include
00164  * Modified set cursor to display normal size cursor when static linked.
00165  *
00166  * *****************  Version 2  *****************
00167  * User: Kirk Stowell Date: 10/20/98   Time: 12:45p
00168  * Updated in $/CodeJockey/Include
00169  * Fixed problem with gripper and buttons disappearing when docking
00170  * toggled. Overloaded IsFloating() method from base class.
00171  *
00172  * *****************  Version 1  *****************
00173  * User: Kirk Stowell Date: 10/17/98   Time: 12:44p
00174  * Created in $/CodeJockey/Include
00175  * Initial re-write and release.
00176  *
00177  ***************************************************************************/
00179
00180 #ifndef __CJCONTROLBAR_H__
00181 #define __CJCONTROLBAR_H__
00182
00183 #if _MSC_VER >= 1000
00184 #pragma once
00185 #endif // _MSC_VER >= 1000
00186
00187 #include "CJFlatButton.h"
00188 #include "CJMenu.h"        // CCJMenu class declaration
00189
00190 // CCJCBarButton is a CCJFlatButton derived class which is used by
00191 // the CCJControlBar class.
00192 class _CJX_EXT_CLASS CCJCBarButton : public CCJFlatButton
00193 {
00194 protected:
00195     virtual void DrawButtonIcon(CDC* pDC, UINT nState, CRect& rcItem);
00196 };
00197
00198 typedef enum { HIDE_CONTRLBAR,
00199     MAXI_H_DISABLE, MAXI_H_ENABLED, MAXI_V_DISABLE, MAXI_V_ENABLED,
00200     NORM_H_DISABLE, NORM_H_ENABLED, NORM_V_DISABLE, NORM_V_ENABLED
00201 } BTN_IMG_INDEX;
00202
00203 typedef enum { NONE, OUTLINE, SUNKEN, RAISED } CHILD_BORDER;
00204
00205 // CCJControlBar is a CControlBar derived class which is simular to
00206 // the sizing / docking windows that are seen in Developer Studio.
00207 class _CJX_EXT_CLASS CCJControlBar : public CControlBar
00208 {
00209     DECLARE_DYNAMIC(CCJControlBar)
00210
00211 public:
00212
00213     // Default constructor
00214     //
00215     CCJControlBar();
00216
00217     // Virtual destructor
00218     //
00219     virtual ~CCJControlBar();
00220
00221 public:
00222
00223     BOOL            m_bUnique;              // used by CCJControlBar and CCJSizeDockBar,
00224                                             // set to true when the controlbar is the
00225                                             // only one docked on any given side.
00226
00227     BOOL            m_bToFit;               // used by CCJControlBar and CCJSizeDockBar,
00228                                             // to determine border layouts depending on bar
00229                                             // state.
00230
00231     CHILD_BORDER    m_eChildBorder;         // determines if a border should be drawn around the child area.
00232
00233 protected:
00234
00235     int             m_cxOffset;             // used to offset the horizontal client area
00236                                             // to allow room for the caption when docked.
00237
00238     int             m_cyOffset;             // used to offset the vertical client area to
00239                                             // allow room for the caption when docked.
00240
00241     BTN_IMG_INDEX   m_eAuxIndex;            // used to determine which button icon to
00242                                             // display when the control bar is minimized
00243                                             // or maximized depending on which side docked.
00244
00245     UINT            m_popToolbarID;         // popup menu toolbar resource id, associates
00246                                             // toolbar icons with the popup menu.
00247
00248     UINT            m_popupMenuID;          // popup menu resource id
00249     CCJMenu         m_popupMenu;            // popup menu
00250     int             m_nPos;                 // index of the pop-up menu contained in the menu
00251
00252     BOOL            m_bOkToDrag;            // used to determine if a drag operation
00253                                             // should occur.
00254
00255     BOOL            m_bMaximized;           // used to determine if the control bar has
00256                                             // been maximized.
00257
00258     BOOL            m_bDragging;            // set to TRUE when a drag operation is in
00259                                             // process.
00260
00261
00262     BOOL            m_bButtons;             // user defined flag, set to TRUE if the
00263                                             // control bar should display buttons.
00264
00265     CRect           m_rcTrack;              // used to determine rect of the tracker window.
00266     CSize           m_sizeDesired;          // the desired size of the control bar.
00267     CSize           m_sizeNormal;           // normal size of the control bar.
00268     CSize           m_sizeVert;             // vertical size
00269     CSize           m_sizeHorz;             // horizontal size
00270     CSize           m_sizeFloat;            // float size
00271     CPoint          m_ptCurDrag;            // cursor location during a drag operation.
00272     CPoint          m_ptStartDrag;          // cursor starting point during a drag operation.
00273
00274     CWnd*           m_pChildWnd;            // CWnd pointer which is contains child window
00275                                             // that is displayed in the control bar, see
00276                                             // SetChild(CWnd* pWnd).
00277
00278     CImageList      m_ImageList;            // contains the caption control buttons images.
00279     CCJCBarButton   m_btnClose;             // close button used in caption area.
00280     CCJCBarButton   m_btnMinim;             // minimize button used in the caption area.
00281     CToolTipCtrl    m_ToolTip;              // tooltip used for caption buttons.
00282
00283     BOOL            m_bGripper;             // user defined flag, set to TRUE if a
00284                                             // gripper should be drawn in the control
00285                                             // bar, see ShowFrameControls(...).
00286     BOOL            m_bFlatGripper;         // user defined flag, set to TRUE if for a flat
00287                                             // Gripper look
00288     BOOL            m_bFlatBorder;          // user defined flag, set to TRUE if for a flat
00289                                             // Border look
00290     CString         m_strSection;           // used by the control bar for registry entries.
00291     bool            m_bAutoSave;            // true to restore size and position true by default.
00292     HICON           m_hIcon;                // handle to close button icon.
00293     HICON           m_hAuxIcon;             // handle to auxiliary button icon.
00294     int             m_nID;                  // holds the resource id for this control.
00295     BOOL            m_bFloating;            // true if the control bar was floating when last destroyed.
00296
00297 public:
00298
00299     // this member function is called to enable/disable size and
00300     // position at startup.
00301     //
00302     virtual void EnableSaveState(bool bAutoSave=true);
00303
00304     // this member function is used to create a sizing / docking control bar.
00305     //
00306     virtual BOOL Create(
00307         // the parent window.
00308         CWnd* pParentWnd,
00309         // The ID of the control bar.
00310         UINT nID,
00311         // Points to a null-terminated character string that contains the
00312         // control bar title.
00313         LPCTSTR lpszWindowName = NULL,
00314         // The default size the control bar is to be.
00315         CSize sizeDefault = CSize(200,100),
00316         // Specifies the window style attributes.
00317         DWORD dwStyle = CBRS_LEFT,
00318         // TRUE for flat style control bars.
00319         BOOL bFlatBorders = FALSE);
00320
00321     // this member function is called by the control bar, and
00322     // can be overloaded in derived classes to return the rect
00323     // for the child window associated with the control bar.
00324     //
00325     virtual void GetChildRect(
00326         // reference to a CRect object which contains the size of
00327         // the child window associated with the control bar.
00328         CRect &rect);
00329
00330     // this member function is called by the control bar to
00331     // determine the minimum size of the control bar should be
00332     // when miminized or maximized.
00333     //
00334     virtual int GetMinExt();
00335
00336     // this member function returns TRUE if the control
00337     // bar is docked on the left.
00338     //
00339     virtual BOOL IsLeftDocked() const;
00340
00341     // this member function returns TRUE if the control
00342     // bar is docked on the right.
00343     //
00344     virtual BOOL IsRightDocked() const;
00345
00346     // this member function returns TRUE if the control
00347     // bar is docked on the top.
00348     //
00349     virtual BOOL IsTopDocked() const;
00350
00351     // this member function returns TRUE if the control
00352     // bar is docked on the bottom.
00353     //
00354     virtual BOOL IsBottomDocked() const;
00355
00356     // this member function returns TRUE if the control
00357     // bar is docked horizontal.
00358     //
00359     virtual BOOL IsHorzDocked() const;
00360
00361     // this member function returns TRUE if the control
00362     // bar is docked vertical.
00363     //
00364     virtual BOOL IsVertDocked() const;
00365
00366     // this member function returns TRUE if the control
00367     // bar is currently floating.
00368     //
00369     virtual BOOL IsFloating() const;
00370
00371     // this member function is called by the control bar
00372     // to set the normal size the control bar should be.
00373     //
00374     virtual void SetNormalSize(const CSize &cs);
00375
00376     // this member function is called by the control bar
00377     // to return the control bar to its normal size.
00378     //
00379     virtual void Normalize();
00380
00381     // this member function is called by the control bar
00382     // to minimize the control bar.
00383     //
00384     virtual void Minimize();
00385
00386     // this member function is called by the control bar
00387     // to maximize the control bar.
00388     //
00389     virtual void Maximize(int size);
00390
00391     // this member function is to be called after creation to enable
00392     // docking on the control bar.
00393     //
00394     virtual void EnableDockingOnSizeBar(
00395         // Specifies which sides of the frame window can serve as docking sites
00396         // for control bars. It can be one or more of the following:
00397         //
00398         // CBRS_ALIGN_TOP   Allows docking at the top of the client area.
00399         // CBRS_ALIGN_BOTTOM   Allows docking at the bottom of the client area.
00400         // CBRS_ALIGN_LEFT   Allows docking on the left side of the client area.
00401         // CBRS_ALIGN_RIGHT   Allows docking on the right side of the client area.
00402         // CBRS_ALIGN_ANY   Allows docking on any side of the client area.
00403         DWORD dwDockStyle);
00404
00405     // this member function is used to show / hide the frame controls
00406     // for the control bar.
00407     //
00408     virtual void ShowFrameControls(
00409         // set to FALSE to hide the gripper.
00410         BOOL bGripper = TRUE,
00411         // set to FALSE to hide the frame buttons.
00412         BOOL bButtons = TRUE);
00413
00414     // this member function is used to set the resource id for the popup menu used.
00415     //
00416     virtual void SetMenuID(UINT popupMenuID, UINT popToolbarID=0, int nPos=0);
00417
00418     // this member function returns the resource id of the context menu used.
00419     //
00420     virtual UINT GetMenuID();
00421
00422     virtual void EnableFlatLook(BOOL bFlat=TRUE);
00423
00424     virtual void EnableFlatLook(BOOL bGripper, BOOL bBorder, BOOL bButtons);
00425
00426     // this member function is used to determine the width when docked vertical.
00427     //
00428     virtual int GetVertSize();
00429
00430     // this member function is used to determine the height when docked horizontal
00431     //
00432     virtual int GetHorzSize();
00433
00434 protected:
00435
00436     // this member function is called by the control bar to caluclate
00437     // the size of the gripper in the caption area.
00438     //
00439     virtual CRect GetGripperRect();
00440
00441     // this member function is called by the control bar to calculate the
00442     // size of the buttons used in the caption area.
00443     //
00444     virtual CRect GetButtonRect();
00445
00446     // this member function is called by the control bar to draw
00447     // the gripper in the caption area.
00448     //
00449     virtual void DrawGripper(CDC* pDC);
00450
00451     // this member function is used to associate a child window
00452     // that is to be displayed in the control bar.
00453     //
00454     virtual void SetChild(CWnd* pWnd);
00455
00456     // this member function is called by the control bar
00457     // during resizing of splitters.
00458     //
00459     virtual void OnInvertTracker(const CRect& rect);
00460
00461     // this member function is called by the control bar
00462     // to determine cursor position
00463     // for drag operations.
00464     //
00465     virtual void HitTest(CPoint &point);
00466
00467     // this member function is called by the control bar
00468     // to draw its borders.
00469     //
00470     virtual void DrawBorders(CDC *pDC, CRect &rect);
00471
00472     // this member function is called by the control bar
00473     // to perform paint operations.
00474     //
00475     virtual void EraseNonClient();
00476
00477     // this member function is used to draw the new flat style control bar.
00478     //
00479     virtual void DrawGriperCaption( CDC * pDC, LPRECT pRect );
00480
00481     virtual void LoadBarState(CSize& size, int nID);
00482
00483     virtual void SaveBarState(CSize& size);
00484
00485 // Overrides
00486     // ClassWizard generated virtual function overrides
00487     //{{AFX_VIRTUAL(CCJControlBar)
00488     public:
00489     virtual BOOL PreTranslateMessage(MSG* pMsg);
00490     virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
00491     virtual CSize CalcDynamicLayout(int nLength, DWORD nMode);
00492     //}}AFX_VIRTUAL
00493
00494 // Generated message map functions
00495 protected:
00496     //{{AFX_MSG(CCJControlBar)
00497     afx_msg void OnNcPaint();
00498     afx_msg void OnPaint();
00499     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00500     afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
00501     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00502     afx_msg UINT OnNcHitTest(CPoint point);
00503     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00504     afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
00505     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00506     afx_msg void OnButtonClose();
00507     afx_msg void OnUpdateButtonClose(CCmdUI* pCmdUI);
00508     afx_msg void OnButtonMinimize();
00509     afx_msg void OnUpdateButtonMinimize(CCmdUI* pCmdUI);
00510     afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00511     afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
00512     afx_msg LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu);
00513     afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
00514     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00515     //}}AFX_MSG
00516     DECLARE_MESSAGE_MAP()
00517 };
00518
00519 #define AFX_IDW_SIZEBAR_LEFT    AFX_IDW_DOCKBAR_LEFT    + 4
00520 #define AFX_IDW_SIZEBAR_RIGHT   AFX_IDW_DOCKBAR_RIGHT   + 5
00521 #define AFX_IDW_SIZEBAR_TOP     AFX_IDW_DOCKBAR_TOP     + 6
00522 #define AFX_IDW_SIZEBAR_BOTTOM  AFX_IDW_DOCKBAR_BOTTOM  + 7
00523
00524 const DWORD dwSizeBarMap[4][2] =
00525 {
00526     { AFX_IDW_SIZEBAR_TOP,      CBRS_TOP    },
00527     { AFX_IDW_SIZEBAR_BOTTOM,   CBRS_BOTTOM },
00528     { AFX_IDW_SIZEBAR_LEFT,     CBRS_LEFT   },
00529     { AFX_IDW_SIZEBAR_RIGHT,    CBRS_RIGHT  },
00530 };
00531
00533 //  Inline Functions
00535
00536 _CJXLIB_INLINE void CCJControlBar::EnableSaveState(bool bAutoSave)
00537     { ASSERT(::IsWindow(m_hWnd)); m_bAutoSave = bAutoSave; }
00538
00539 _CJXLIB_INLINE int CCJControlBar::GetVertSize()
00540     { ASSERT(::IsWindow(m_hWnd)); return m_sizeDesired.cx; }
00541
00542 _CJXLIB_INLINE int CCJControlBar::GetHorzSize()
00543     { ASSERT(::IsWindow(m_hWnd)); return m_sizeDesired.cy; }
00544
00545 _CJXLIB_INLINE UINT CCJControlBar::GetMenuID()
00546     { ASSERT(::IsWindow(m_hWnd)); return m_popupMenuID; }
00547
00548 _CJXLIB_INLINE void CCJControlBar::SetMenuID(UINT popupMenuID, UINT popToolbarID, int nPos)
00549     { ASSERT(::IsWindow(m_hWnd)); m_popupMenuID=popupMenuID; m_popToolbarID=popToolbarID; m_nPos=nPos; }
00550
00551 _CJXLIB_INLINE void CCJControlBar::ShowFrameControls(BOOL bGripper, BOOL bButtons)
00552     { ASSERT(::IsWindow(m_hWnd)); m_bGripper=bGripper; m_bButtons=bButtons; }
00553
00554 _CJXLIB_INLINE void CCJControlBar::SetNormalSize(const CSize &cs)
00555     { ASSERT(::IsWindow(m_hWnd)); m_sizeDesired=m_sizeNormal=cs; }
00556
00557 _CJXLIB_INLINE BOOL CCJControlBar::IsVertDocked() const
00558     { ASSERT(::IsWindow(m_hWnd)); return (IsLeftDocked() || IsRightDocked()); }
00559
00560 _CJXLIB_INLINE BOOL CCJControlBar::IsHorzDocked() const
00561     { ASSERT(::IsWindow(m_hWnd)); return (IsTopDocked() || IsBottomDocked()); }
00562
00563 _CJXLIB_INLINE BOOL CCJControlBar::IsBottomDocked() const
00564     { ASSERT(::IsWindow(m_hWnd)); return (GetParent()->GetDlgCtrlID()==AFX_IDW_SIZEBAR_BOTTOM); }
00565
00566 _CJXLIB_INLINE BOOL CCJControlBar::IsTopDocked() const
00567     { ASSERT(::IsWindow(m_hWnd)); return (GetParent()->GetDlgCtrlID()==AFX_IDW_SIZEBAR_TOP); }
00568
00569 _CJXLIB_INLINE BOOL CCJControlBar::IsRightDocked() const
00570     { ASSERT(::IsWindow(m_hWnd)); return (GetParent()->GetDlgCtrlID()==AFX_IDW_SIZEBAR_RIGHT); }
00571
00572 _CJXLIB_INLINE BOOL CCJControlBar::IsLeftDocked() const
00573     { ASSERT(::IsWindow(m_hWnd)); return (GetParent()->GetDlgCtrlID()==AFX_IDW_SIZEBAR_LEFT); }
00574
00575 _CJXLIB_INLINE BOOL CCJControlBar::IsFloating() const
00576     { ASSERT(::IsWindow(m_hWnd)); return (!IsHorzDocked() && !IsVertDocked()); }
00577
00578 _CJXLIB_INLINE void CCJControlBar::SetChild(CWnd *pWnd)
00579     { ASSERT(::IsWindow(m_hWnd)); m_pChildWnd=pWnd; }
00580
00582
00583 //{{AFX_INSERT_LOCATION}}
00584 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00585
00586 #endif // __CJCONTROLBAR_H__
00587
Generated on Sun Feb 24 01:21:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJDateTimeCtrl.h Source File

WinCvs/CJLib/Include/CJDateTimeCtrl.h

Go to the documentation of this file.
00001 // CJDateTimeCtrl.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Copied from MFC, Visual C++ 6, to extend functionality to Visual C++ 5
00006 // users, with some ideas taken from Luis Barreira's article 'Classes for new
00007 // IE4 controls' http://www.codeguru.com/controls/ie4_controls_classes.shtml
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:49 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJockey/Include/CJDateTimeCtrl.h $
00015  *
00016  * $History: CJDateTimeCtrl.h $
00017  *
00018  * *****************  Version 7  *****************
00019  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00020  * Updated in $/CodeJockey/Include
00021  * Updated copyright and contact information.
00022  *
00023  * *****************  Version 6  *****************
00024  * User: Kirk Stowell Date: 7/31/99    Time: 4:27p
00025  * Updated in $/CodeJockey/Include
00026  *
00027  * *****************  Version 4  *****************
00028  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00029  * Updated in $/CodeJockey/Include
00030  *
00031  * *****************  Version 3  *****************
00032  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00033  * Updated in $/CodeJockey/Include
00034  *
00035  * *****************  Version 2  *****************
00036  * User: Kirk Stowell Date: 7/18/99    Time: 10:17p
00037  * Updated in $/CodeJockey/Include
00038  * Cleaned up inline functions, and import/export macro so that class will
00039  * be imported when linked to, and exported at compile time.
00040  *
00041  * *****************  Version 1  *****************
00042  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00043  * Created in $/CodeJockey/Include
00044  * Copied from MFC, Visual C++ 6 and vc5 Tech. Preview. Added to extend
00045  * functionality to Visual C++ 5 users.
00046  *
00047  ***************************************************************************/
00049
00050 #ifndef __CJDATETIMECTRL_H__
00051 #define __CJDATETIMECTRL_H__
00052
00053
00054 class CCJMonthCalCtrl;
00055
00056 // A CCJDateTimeCtrl object encapsulates the functionality of a date and time picker
00057 // control. The date and time picker control (DTP control) provides a simple interface
00058 // to exchange date and time information with a user. This interface contains fields,
00059 // each of which displays a part of the date and time information stored in the control.
00060 // The user can change the information stored in the control by changing the content of
00061 // the string in a given field. The user can move from field to field using the mouse or
00062 // the keyboard.
00063 class _CJX_EXT_CLASS CCJDateTimeCtrl : public CWnd
00064 {
00065     DECLARE_DYNAMIC(CCJDateTimeCtrl)
00066
00067 // Construction / destruction
00068 public:
00069
00070     // Constructs a CDateTimeCtrl object.
00071     //
00072     CCJDateTimeCtrl();
00073
00074     // Destroys a CDateTimeCtrl object.
00075     //
00076     virtual ~CCJDateTimeCtrl();
00077
00078 // Initialization
00079 public:
00080
00081     // Creates the date and time picker control and attaches it to the
00082     // CDateTimeCtrl object. Returns nonzero if creation was successful;
00083     // otherwise 0.
00084     //
00085     BOOL Create(
00086         // Specifies the combination of date time control styles. SeeDate
00087         // and Time Picker Control Styles in the Platform SDK for more information
00088         //about date and time picker styles.
00089         DWORD dwStyle,
00090         // A reference to aRECT structure, which is the position and size of the
00091         // date and time picker control.
00092         const RECT& rect,
00093         // A pointer to a CWnd object that is the parent window of the date and
00094         // time picker control. It must not be NULL.
00095         CWnd* pParentWnd,
00096         // Specifies the date and time picker control's control ID.
00097         UINT nID);
00098
00099 // Attributes
00100 public:
00101
00102     // Retrieves the color for a given portion of the month calendar within the
00103     // date and time picker control. Returns a COLORREF value that represents the
00104     // color setting for the specified portion of the month calendar control if
00105     // successful. The function returns -1 if unsuccessful.
00106     //
00107     COLORREF GetMonthCalColor(
00108         // An int value specifying which color area of the month calendar to
00109         // retrieve. For a list of values, see the iColor parameter for
00110         // SetMonthCalColor.
00111         int iColor) const;
00112
00113     // Sets the color for a given portion of the month calendar within a date
00114     // and time picker control. Returns a COLORREF value that represents the
00115     // previous color setting for the specified portion of the month calendar
00116     // control if successful. Otherwise, the message returns -1.
00117     //
00118     COLORREF SetMonthCalColor(
00119         // int value specifying which area of the month calendar control to set.
00120         // This value can be one of the following.
00121         //
00122         // Value                Meaning
00123         // MCSC_BACKGROUND      Set the background color displayed between months.
00124         // MCSC_MONTHBK         Set the background color displayed within a month.
00125         // MCSC_TEXT            Set the color used to display text within a month.
00126         // MCSC_TITLEBK         Set the background color displayed in the calendar's title.
00127         // MCSC_TITLETEXT       Set the color used to display text within the calendar's title.
00128         // MCSC_TRAILINGTEXT    Set the color used to display header and trailing-day text. Header and trailing days are the days from the previous and following months that appear on the current calendar.
00129         int iColor,
00130         // A COLORREF value representing the color that will be set for the specified
00131         // area of the month calendar.
00132         COLORREF ref);
00133
00134     // Sets the display of a date and time picker control based on a given format string.
00135     // Returns nonzero if successful; otherwise 0.
00136     //
00137     BOOL SetFormat(
00138         // A pointer to a zero-terminated format string that defines the desired display.
00139         // Setting this parameter to NULL will reset the control to the default format
00140         // string for the current style.
00141         LPCTSTR pstrFormat);
00142
00143     // Retrieves the date and time picker's child month calendar control.
00144     // Returns a pointer to a CMonthCalCtrl object, or NULL if unsuccessful or if
00145     // the window is not visible.
00146     //
00147     CCJMonthCalCtrl* GetMonthCalCtrl() const;
00148
00149     // Retrieves the font currently used by the date and time picker control's child
00150     // month calendar control. Returns a pointer to a CFont object, or NULL if unsuccessful.
00151     //
00152     CFont* GetMonthCalFont() const;
00153
00154     // Sets the font to be used by the date and time picker control's child month
00155     // calendar control.
00156     void SetMonthCalFont(
00157         // Handle to the font that will be set.
00158         HFONT hFont,
00159         // Specifies whether the control should be redrawn immediately upon setting the
00160         // font. Setting this parameter to TRUE causes the control to redraw itself.
00161         BOOL bRedraw = TRUE);
00162
00163     // Sets the minimum and maximum allowable system times for a date and time
00164     // picker control. Returns nonzero if successful; otherwise 0.
00165     //
00166     BOOL SetRange(
00167         // A pointer to a COleDateTime object containing the
00168         // earliest time allowed in the CDateTimeCtrl object.
00169         const COleDateTime* pMinRange,
00170         // A pointer to a COleDateTime object containing the
00171         // latest time allowed in the CDateTimeCtrl object.
00172         const COleDateTime* pMaxRange);
00173
00174     // Sets the minimum and maximum allowable system times for a date and time
00175     // picker control. Returns nonzero if successful; otherwise 0.
00176     //
00177     BOOL SetRange(
00178         // A pointer to a CTime object containing the
00179         // earliest time allowed in the CDateTimeCtrl object.
00180         const CTime* pMinRange,
00181         // A pointer to a CTime object containing the
00182         // latest time allowed in the CDateTimeCtrl object.
00183         const CTime* pMaxRange);
00184
00185     // Retrieves the current minimum and maximum allowable system times for a date
00186     // and time picker control. Returns a DWORD value containing flags that indicate
00187     // which ranges are set.
00188     //
00189     DWORD GetRange(
00190         // A pointer to a COleDateTime object containing the
00191         // earliest time allowed in the CDateTimeCtrl object.
00192         COleDateTime* pMinRange,
00193         // A pointer to a COleDateTime object containing the
00194         // latest time allowed in the CDateTimeCtrl object.
00195         COleDateTime* pMaxRange) const;
00196
00197     // Retrieves the current minimum and maximum allowable system times for a date
00198     // and time picker control. Returns a DWORD value containing flags that indicate
00199     // which ranges are set.
00200     //
00201     DWORD GetRange(
00202         // A pointer to a CTime object containing the
00203         // earliest time allowed in the CDateTimeCtrl object.
00204         CTime* pMinRange,
00205         // A pointer to a CTime object containing the
00206         // latest time allowed in the CDateTimeCtrl object.
00207         CTime* pMaxRange) const;
00208
00209 // Operations
00210 public:
00211
00212     // Sets the time in a date and time picker control. Returns nonzero if successful;
00213     // otherwise 0.
00214     //
00215     BOOL SetTime(
00216         // A pointer to a CTime object containing the time to which the control will be set.
00217         const CTime* pTimeNew);
00218
00219     // Sets the time in a date and time picker control. Returns nonzero if successful;
00220     // otherwise 0.
00221     //
00222     BOOL SetTime(
00223         // A reference to a COleDateTime object containing the to which the control
00224         // will be set.
00225         const COleDateTime& timeNew);
00226
00227     // Sets the time in a date and time picker control. Returns nonzero if successful;
00228     // otherwise 0.
00229     //
00230     BOOL SetTime(
00231         // A pointer to a SYSTEMTIME structure containing the time to which the control
00232         // will be set.
00233         LPSYSTEMTIME pTimeNew = NULL);
00234
00235     // Retrieves the currently selected time from a date and time picker control and
00236     // places it in a specified SYSTEMTIME structure. Returns a DWORD value equal to
00237     // the dwFlag member set in theNMDATETIMECHANGE structure
00238     //
00239     DWORD GetTime(
00240         // a reference to a CTime object that will receive the system time information
00241         CTime& timeDest) const;
00242
00243     // Retrieves the currently selected time from a date and time picker control and
00244     // places it in a specified SYSTEMTIME structure. Returns nonzero if the time is
00245     // successfully written to the COleDateTime object; otherwise 0.
00246     //
00247     BOOL GetTime(
00248         // a reference to a COleDateTime object that will receive the system
00249         // time information
00250         COleDateTime& timeDest) const;
00251
00252     // Retrieves the currently selected time from a date and time picker control and
00253     // places it in a specified SYSTEMTIME structure. Returns a DWORD value equal to
00254     // the dwFlag member set in theNMDATETIMECHANGE structure
00255     //
00256     DWORD GetTime(
00257         // A pointer to theSYSTEMTIME structure to receive the system time information.
00258         // Must not be NULL.
00259         LPSYSTEMTIME pTimeDest) const;
00260 };
00261
00262 // A CCJMonthCalCtrl object encapsulates the functionality of a month calendar control.
00263 // The month calendar control provides the user with a simple calendar interface, from
00264 // which the user can select a date.
00265 class _CJX_EXT_CLASS CCJMonthCalCtrl : public CWnd
00266 {
00267   DECLARE_DYNAMIC(CCJMonthCalCtrl)
00268
00269
00270 // Construction / destruction
00271 public:
00272
00273     // Constructs a CCJMonthCalCtrl object.
00274     //
00275     CCJMonthCalCtrl();
00276
00277     // Destroys a CCJMonthCalCtrl object.
00278     //
00279     virtual ~CCJMonthCalCtrl();
00280
00281 // Initialization
00282 public:
00283
00284     // Creates a month calendar control and attaches it to the CMonthCalCtrl object.
00285     // Returns nonzero if initialization was successful; otherwise 0.
00286     //
00287     BOOL Create(
00288         // Specifies the combination of Windows styles applied to the month
00289         // calendar control. SeeMonth Calendar Control Styles in the Platform
00290         // SDK for more information about the styles.
00291         DWORD dwStyle,
00292         // A reference to aRECT structure. Contains the position and size of
00293         // the month calendar control
00294         const RECT& rect,
00295         // A pointer to a CWnd object that is the parent window of the month
00296         // calendar control. It must not be NULL.
00297         CWnd* pParentWnd,
00298         // Specifies the month calendar control’s control ID.
00299         UINT nID);
00300
00301     // Creates a month calendar control and attaches it to the CMonthCalCtrl object.
00302     // Returns nonzero if initialization was successful; otherwise 0.
00303     //
00304     BOOL Create(
00305         // Specifies the combination of Windows styles applied to the month
00306         // calendar control. SeeMonth Calendar Control Styles in the Platform
00307         // SDK for more information about the styles.
00308         DWORD dwStyle,
00309         // A reference to aPOINT structure that identifies the location of
00310         // the month calendar control
00311         const POINT& pt,
00312         // A pointer to a CWnd object that is the parent window of the month
00313         // calendar control. It must not be NULL.
00314         CWnd* pParentWnd,
00315         // Specifies the month calendar control’s control ID.
00316         UINT nID);
00317
00318 //Attributes
00319 public:
00320
00321     // Retrieves the minimum size required to show a full month in a month calendar
00322     // control. Returns nonzero and lpRect receives the applicable bounding information.
00323     // If unsuccessful, the member function returns 0.
00324     //
00325     BOOL GetMinReqRect(
00326         // A pointer to aRECT structure that will receive bounding rectangle information.
00327         // This parameter must be a valid address and cannot be NULL.
00328         RECT* pRect) const;
00329
00330     // Sets the scroll rate for a month calendar control. Returns the previous scroll
00331     // rate. If the scroll rate has not been previously set, the return value is 0.
00332     //
00333     int SetMonthDelta(
00334         // The number of months to be set as the control's scroll rate. If this value
00335         // is zero, the month delta is reset to the default, which is the number of
00336         // months displayed in the control.
00337         int iDelta);
00338
00339     // Retrieves the scroll rate for a month calendar control. Returns The scroll rate
00340     // for the month calendar control. The scroll rate is the number of months that the
00341     // control moves its display when the user clicks a scroll button once.
00342     //
00343     int GetMonthDelta() const;
00344
00345     // Sets the day of week to be displayed in the leftmost column of the calendar.
00346     // Returns nonzero if the previous first day of the week is set to a value other
00347     // than that of LOCALE_IFIRSTDAYOFWEEK, which is the day indicated in the control
00348     // panel setting. Otherwise, this function returns 0.
00349     BOOL SetFirstDayOfWeek(
00350         // An integer value representing which day is to be set as the first day of
00351         // the week. This value must be one of the day numbers. See GetFirstDayOfWeek
00352         // for a description of the day numbers.
00353         int iDay,
00354         // A pointer to an integer indicating the first day of the week previously set.
00355         int* lpnOld = NULL);
00356
00357     // Gets the first day of the week to be displayed in the leftmost column of the
00358     // calendar. Returns an integer value that represents the first day of the week.
00359     // The days of the week are represented as integers, as follows.
00360     //
00361     // Value    Day of the Week
00362     // 0        Monday
00363     // 1        Tuesday
00364     // 2        Wednesday
00365     // 3        Thursday
00366     // 4        Friday
00367     // 5        Saturday
00368     // 6        Sunday
00369     //
00370     int GetFirstDayOfWeek(
00371         // A pointer to a BOOL value. If the value is non-zero, the control's setting
00372         // does not match the setting in the control panel.
00373         BOOL* pbLocal = NULL) const;
00374
00375     // Gets the color of a specified area of a month calendar control. Returns a COLORREF
00376     // value specifying the color associated with the portion of the month calendar
00377     // control, if successful. Otherwise, this member function returns -1.
00378     //
00379     COLORREF GetColor(
00380         // The region of the month calendar control from which the color is retrieved.
00381         // For a list of values, see the nRegion parameter of  SetColor.
00382         int nRegion) const;
00383
00384     // Sets the color of a specified area of a month calendar control. Returns a COLORREF
00385     // value that represents the previous color setting for the specified portion of the
00386     // month calendar control, if successful. Otherwise this message returns -1.
00387     //
00388     COLORREF SetColor(
00389         // An integer value specifying which month calendar color to set. This value can be one of the following.
00390         //
00391         // Value                Meaning
00392         // MCSC_BACKGROUND      The background color displayed between months.
00393         // MCSC_MONTHBK         The background color displayed within the month.
00394         // MCSC_TEXT            The color used to display text within a month.
00395         // MCSC_TITLEBK         The background color displayed in the calendar's title.
00396         // MCSC_TITLETEXT       The color used to display text within the calendar's title.
00397         // MCSC_TRAILINGTEXT    The color used to display header and trailing-day text. Header and trailing days are the days from the previous and following months that appear on the current calendar.
00398         //
00399         int nRegion,
00400         // A COLORREF value for the new color setting for the specified portion of the
00401         // month calendar control
00402         COLORREF ref);
00403
00404 // Operations
00405 public:
00406
00407     // Repaints the month calendar control to its minimum, one-month size. Returns
00408     // nonzero if the month calendar control is sized to its minimum; otherwise 0.
00409     //
00410     BOOL SizeMinReq(
00411         // Specifies whether the control is to be repainted. By default, TRUE.
00412         // If FALSE, no repainting occurs.
00413         BOOL bRepaint = TRUE);
00414
00415     // Sets the calendar control for the current day.
00416     //
00417     void SetToday(
00418         // A reference to a COleDateTime object that contains the current date.
00419         const COleDateTime& refDateTime);
00420
00421     // Sets the calendar control for the current day.
00422     //
00423     void SetToday(
00424         // A pointer to a CTime object containing the current date information.
00425         const CTime* pDateTime);
00426
00427     // Sets the calendar control for the current day.
00428     //
00429     void SetToday(
00430         // A pointer to aSYSTEMTIME structure that contains the current date information.
00431         const LPSYSTEMTIME pDateTime);
00432
00433     // Retrieves the date information for the date specified as "today" for a month
00434     // calendar control. Returns nonzero if successful; otherwise 0.
00435     //
00436     BOOL GetToday(
00437         // A reference to a CTime object indicating the current day.
00438         CTime& refTime) const;
00439
00440     // Retrieves the date information for the date specified as "today" for a month
00441     // calendar control. Returns nonzero if successful; otherwise 0.
00442     //
00443     BOOL GetToday(
00444         // A reference to a COleDateTime object indicating the current day.
00445         COleDateTime& refDateTime) const;
00446
00447     // Retrieves the date information for the date specified as "today" for a month
00448     // calendar control. Returns nonzero if successful; otherwise 0.
00449     //
00450     BOOL GetToday(
00451         // A pointer to aSYSTEMTIME structure that will receive the date information.
00452         // This parameter must be a valid address and cannot be NULL.
00453         LPSYSTEMTIME pDateTime) const;
00454
00455     // Retrieves the system time as indicated by the currently-selected date. Returns
00456     // nonzero if successful; otherwize 0.
00457     //
00458     BOOL GetCurSel(
00459         // A pointer to aSYSTEMTIME structure that will receive the currently-selected
00460         // date information. This parameter must be a valid address and cannot be NULL.
00461         LPSYSTEMTIME pDateTime) const;
00462
00463     // Retrieves the system time as indicated by the currently-selected date. Returns
00464     // nonzero if successful; otherwize 0.
00465     //
00466     BOOL GetCurSel(
00467         // A reference to a CTime object. Receives the current time.
00468         CTime& refDateTime) const;
00469
00470     // Retrieves the system time as indicated by the currently-selected date. Returns
00471     // nonzero if successful; otherwize 0.
00472     //
00473     BOOL GetCurSel(
00474         // A reference to a COleDateTime object. Receives the current time.
00475         COleDateTime& refDateTime) const;
00476
00477     // Sets the currently-selected date for a month calendar control. Returns
00478     // nonzero if successful; otherwise 0.
00479     //
00480     BOOL SetCurSel(
00481         // Pointer to aSYSTEMTIME structure that contains the date to be set
00482         // as the current selection.
00483         const LPSYSTEMTIME pDateTime);
00484
00485     // Sets the currently-selected date for a month calendar control. Returns
00486     // nonzero if successful; otherwise 0.
00487     //
00488     BOOL SetCurSel(
00489         // A reference to a CTime object indicating the currently-selected
00490         // month calendar control.
00491         const CTime& refDateTime);
00492
00493     // Sets the currently-selected date for a month calendar control. Returns
00494     // nonzero if successful; otherwise 0.
00495     //
00496     BOOL SetCurSel(
00497         // A reference to a COleDateTime indicating the currently-selected month
00498         // calendar control.
00499         const COleDateTime& refDateTime);
00500
00501     // Sets the display for days in a month calendar control. Returns nonzero
00502     // if successful; otherwise 0.
00503     //
00504     BOOL SetDayState(
00505         // Value indicating how many elements are in the array that pStates
00506         // points to.
00507         int nMonths,
00508         // A pointer to aMONTHDAYSTATE array of values that define how the month
00509         // calendar control will draw each day in its display. The MONTHDAYSTATE
00510         // data type is a bit field, where each bit (1 through 31) represents the
00511         // state of a day in a month. If a bit is on, the corresponding day will be
00512         // displayed in bold; otherwise it will be displayed with no emphasis.
00513         LPMONTHDAYSTATE pStates);
00514
00515     // Sets the maximum number of days that can be selected in a month
00516     // calendar control. Returns nonzero if successful; otherwise 0.
00517     //
00518     BOOL SetMaxSelCount(
00519         //
00520         int nMax);
00521
00522     // Retrieves the current maximum number of days that can be selected
00523     // in a month calendar control. Returns an integer value that represents
00524     // the total number of days that can be selected for the control.
00525     //
00526     int GetMaxSelCount() const;
00527
00528     // Sets the minimum and maximum allowable dates for a month calendar control.
00529     // Returns nonzero if successful; otherwise 0.
00530     //
00531     BOOL SetRange(
00532         // A pointer to a COleDateTime object containing the date at the lowest
00533         // end of the range.
00534         const COleDateTime* pMinRange,
00535         // A pointer to a COleDateTime object containing the date at the highest
00536         // end of the range.
00537         const COleDateTime* pMaxRange);
00538
00539     // Sets the minimum and maximum allowable dates for a month calendar control.
00540     // Returns nonzero if successful; otherwise 0.
00541     //
00542     BOOL SetRange(
00543         // A pointer to a CTime object containing the date at the lowest
00544         // end of the range.
00545         const CTime* pMinRange,
00546         // A pointer to a CTime object containing the date at the highest
00547         // end of the range.
00548         const CTime* pMaxRange);
00549
00550     // Sets the minimum and maximum allowable dates for a month calendar control.
00551     // Returns nonzero if successful; otherwise 0.
00552     //
00553     BOOL SetRange(
00554         // A pointer to a SYSTEMTIME structure containing the date at the lowest
00555         // end of the range.
00556         const LPSYSTEMTIME pMinRange,
00557         // A pointer to a SYSTEMTIME structure containing the date at the highest
00558         // end of the range.
00559         const LPSYSTEMTIME pMaxRange);
00560
00561     // Retrieves the current minimum and maximum dates set in a month calendar control.
00562     // Returns A DWORD that can be zero (no limits are set) or a combination of the
00563     // following values that specify limit information.
00564     //
00565     // Value        Meaning
00566     // GDTR_MAX     A maximum limit is set for the control;
00567     //              pMaxRange is valid and contains the applicable date information.
00568     // GDTR_MIN     A minimum limit is set for the control;
00569     //              pMinRange is valid and contains the applicable date information.
00570     //
00571     DWORD GetRange(
00572         // A pointer to a COleDateTime object containing the date at the lowest end
00573         // of the range.
00574         COleDateTime* pMinRange,
00575         // A pointer to a COleDateTime object containing the date at the highest end
00576         // of the range.
00577         COleDateTime* pMaxRange) const;
00578
00579     // Retrieves the current minimum and maximum dates set in a month calendar control.
00580     // Returns A DWORD that can be zero (no limits are set) or a combination of the
00581     // following values that specify limit information.
00582     //
00583     // Value        Meaning
00584     // GDTR_MAX     A maximum limit is set for the control;
00585     //              pMaxRange is valid and contains the applicable date information.
00586     // GDTR_MIN     A minimum limit is set for the control;
00587     //              pMinRange is valid and contains the applicable date information.
00588     //
00589     DWORD GetRange(
00590         // A pointer to a CTime object containing the date at the lowest end of the range.
00591         CTime* pMinRange,
00592         // A pointer to a CTime object containing the date at the highest end of the range.
00593         CTime* pMaxRange) const;
00594
00595     // Retrieves the current minimum and maximum dates set in a month calendar control.
00596     // Returns A DWORD that can be zero (no limits are set) or a combination of the
00597     // following values that specify limit information.
00598     //
00599     // Value        Meaning
00600     // GDTR_MAX     A maximum limit is set for the control;
00601     //              pMaxRange is valid and contains the applicable date information.
00602     // GDTR_MIN     A minimum limit is set for the control;
00603     //              pMinRange is valid and contains the applicable date information.
00604     //
00605     DWORD GetRange(
00606         // A pointer to a SYSTEMTIME structure containing the date at the
00607         // lowest end of the range.
00608         LPSYSTEMTIME pMinRange,
00609         // A pointer to a COleDateTime object, a CTime object, orSYSTEMTIME structure
00610         // containing the date at the highest end of the range.
00611         LPSYSTEMTIME pMaxRange) const;
00612
00613     // Retrieves date information representing the high and low limits of a month
00614     // calendar control's display. Returns An integer that represents the range,
00615     // in months, spanned by the two limits indicated by refMinRange and
00616     // refMaxRange.
00617     //
00618     int GetMonthRange(
00619         // A reference to a COleDateTime object containing the minimum date allowed.
00620         COleDateTime& refMinRange,
00621         // A reference to a COleDateTime object containing the maximum date allowed.
00622         COleDateTime& refMaxRange,
00623         // Value specifying the scope of the range limits to be retrieved. This value must be one of the following.
00624         //
00625         // Value            Meaning
00626         // GMR_DAYSTATE     Include preceding and trailing months of visible range that are only partially displayed.
00627         // GMR_VISIBLE      Include only those months that are entirely displayed.
00628         DWORD dwFlags) const;
00629
00630     // Retrieves date information representing the high and low limits of a month
00631     // calendar control's display. Returns An integer that represents the range,
00632     // in months, spanned by the two limits indicated by refMinRange and
00633     // refMaxRange.
00634     //
00635     int GetMonthRange(
00636         // A reference to a CTime object containing the minimum date allowed.
00637         CTime& refMinRange,
00638         // A reference to a CTime object containing the maximum date allowed.
00639         CTime& refMaxRange,
00640         // Value specifying the scope of the range limits to be retrieved. This value must be one of the following.
00641         //
00642         // Value            Meaning
00643         // GMR_DAYSTATE     Include preceding and trailing months of visible range that are only partially displayed.
00644         // GMR_VISIBLE      Include only those months that are entirely displayed.
00645         DWORD dwFlags) const;
00646
00647     // Retrieves date information representing the high and low limits of a month
00648     // calendar control's display. Returns An integer that represents the range,
00649     // in months, spanned by the two limits indicated by pMinRange and pMaxRange.
00650     //
00651     int GetMonthRange(
00652         // A pointer to aSYSTEMTIME structure containing the date at the lowest
00653         // end of the range.
00654         LPSYSTEMTIME pMinRange,
00655         // A pointer to a SYSTEMTIME structure containing the date at the highest
00656         // end of the range.
00657         LPSYSTEMTIME pMaxRange,
00658         // Value specifying the scope of the range limits to be retrieved. This value must be one of the following.
00659         //
00660         // Value            Meaning
00661         // GMR_DAYSTATE     Include preceding and trailing months of visible range that are only partially displayed.
00662         // GMR_VISIBLE      Include only those months that are entirely displayed.
00663         DWORD dwFlags) const;
00664
00665     // Sets the selection for a month calendar control to a given date range.
00666     // Returns nonzero if successful; otherwise 0.
00667     //
00668     BOOL SetSelRange(
00669         // A pointer to a COleDateTime object containing the date at the lowest
00670         // end of the range.
00671         const COleDateTime& pMinRange,
00672         // A pointer to a COleDateTime object containing the date at the highest
00673         // end of the range.
00674         const COleDateTime& pMaxRange);
00675
00676     // Sets the selection for a month calendar control to a given date range.
00677     // Returns nonzero if successful; otherwise 0.
00678     //
00679     BOOL SetSelRange(
00680         // A pointer to a CTime object containing the date at the lowest
00681         // end of the range.
00682         const CTime& pMinRange,
00683         // A pointer to a CTime object containing the date at the highest
00684         // end of the range.
00685         const CTime& pMaxRange);
00686
00687     // Sets the selection for a month calendar control to a given date range.
00688     // Returns nonzero if successful; otherwise 0.
00689     //
00690     BOOL SetSelRange(
00691         // A pointer to a SYSTEMTIME structure containing the date at the lowest
00692         // end of the range.
00693         const LPSYSTEMTIME pMinRange,
00694         // A pointer to a SYSTEMTIME structure containing the date at the highest
00695         // end of the range.
00696         const LPSYSTEMTIME pMaxRange);
00697
00698     // Retrieves date information representing the upper and lower limits of
00699     // the date range currently selected by the user. Returns nonzero if successful;
00700     // otherwise 0.
00701     //
00702     BOOL GetSelRange(
00703         // A reference to a COleDateTime object containing the minimum date allowed.
00704         COleDateTime& refMinRange,
00705         // A reference to a COleDateTime object containing the maximum date allowed.
00706         COleDateTime& refMaxRange) const;
00707
00708     // Retrieves date information representing the upper and lower limits of
00709     // the date range currently selected by the user. Returns nonzero if successful;
00710     // otherwise 0.
00711     //
00712     BOOL GetSelRange(
00713         // A reference to a CTime object containing the minimum date allowed.
00714         CTime& refMinRange,
00715         // A reference to a CTime object containing the maximum date allowed.
00716         CTime& refMaxRange) const;
00717
00718     // Retrieves date information representing the upper and lower limits of
00719     // the date range currently selected by the user. Returns nonzero if successful;
00720     // otherwise 0.
00721     //
00722     BOOL GetSelRange(
00723         // A pointer to aSYSTEMTIME structure containing the date at the lowest
00724         // end of the range.
00725         LPSYSTEMTIME pMinRange,
00726         // A pointer to a SYSTEMTIME structure containing the date at the highest
00727         // end of the range.
00728         LPSYSTEMTIME pMaxRange) const;
00729
00730     // Determines which portion of a month calendar control is at a given point on
00731     // the screen. Returns A DWORD value. Equal to the uHit member of the MCHITTESTINFO
00732     // structure.
00733     //
00734     DWORD HitTest(
00735         // A pointer to aMCHITTESTINFO structure containing hit testing points for the
00736         // month calendar control.
00737         PMCHITTESTINFO pMCHitTest);
00738 };
00739
00741 // Standard Dialog Data Exchange routines
00743
00744 void AFXAPI DDX_CJDateTimeCtrl(CDataExchange* pDX, int nIDC, COleDateTime& value);
00745 void AFXAPI DDX_CJDateTimeCtrl(CDataExchange* pDX, int nIDC, CTime& value);
00746 void AFXAPI DDX_CJMonthCalCtrl(CDataExchange* pDX, int nIDC, COleDateTime& value);
00747 void AFXAPI DDX_CJMonthCalCtrl(CDataExchange* pDX, int nIDC, CTime& value);
00748
00750 // Standard Dialog Data Validation routines
00752
00753 void AFXAPI DDV_CJMinMaxDateTime(CDataExchange* pDX, CTime& refValue, const CTime* pMinRange, const CTime* pMaxRange);
00754 void AFXAPI DDV_CJMinMaxDateTime(CDataExchange* pDX,  COleDateTime& refValue, const COleDateTime* pMinRange, const COleDateTime* pMaxRange);
00755 void AFXAPI DDV_CJMinMaxMonth(CDataExchange* pDX, CTime& refValue, const CTime* pMinRange, const CTime* pMaxRange);
00756 void AFXAPI DDV_CJMinMaxMonth(CDataExchange* pDX, COleDateTime& refValue, const COleDateTime* pMinRange, const COleDateTime* pMaxRange);
00757
00759 //  Inline Functions
00761
00762 //CJDateTimeCtrl
00763 _CJXLIB_INLINE CCJDateTimeCtrl::CCJDateTimeCtrl()
00764     { }
00765 _CJXLIB_INLINE CFont* CCJDateTimeCtrl::GetMonthCalFont() const
00766     { ASSERT(::IsWindow(m_hWnd)); return CFont::FromHandle((HFONT) ::SendMessage(m_hWnd, DTM_GETMCFONT, 0, 0)); }
00767 _CJXLIB_INLINE CCJMonthCalCtrl* CCJDateTimeCtrl::GetMonthCalCtrl() const
00768     { ASSERT(::IsWindow(m_hWnd)); return (CCJMonthCalCtrl*) CWnd::FromHandle((HWND) ::SendMessage(m_hWnd, DTM_GETMONTHCAL, 0, 0)); }
00769 _CJXLIB_INLINE void CCJDateTimeCtrl::SetMonthCalFont(HFONT hFont, BOOL bRedraw /* = TRUE */)
00770     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, DTM_SETMCFONT, (WPARAM) hFont, MAKELONG(bRedraw, 0)); }
00771 _CJXLIB_INLINE COLORREF CCJDateTimeCtrl::SetMonthCalColor(int iColor, COLORREF ref)
00772     { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, DTM_SETMCCOLOR, (WPARAM) iColor, (LPARAM) ref); }
00773 _CJXLIB_INLINE DWORD CCJDateTimeCtrl::GetTime(LPSYSTEMTIME pTimeDest) const
00774     { ASSERT(::IsWindow(m_hWnd)); ASSERT(pTimeDest != NULL); return (DWORD) ::SendMessage(m_hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM) pTimeDest); }
00775 _CJXLIB_INLINE COLORREF CCJDateTimeCtrl::GetMonthCalColor(int iColor) const
00776     { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, DTM_GETMCCOLOR, (WPARAM) iColor, 0); }
00777 _CJXLIB_INLINE BOOL CCJDateTimeCtrl::SetFormat(LPCTSTR pstrFormat)
00778     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, DTM_SETFORMAT, 0, (LPARAM) pstrFormat); }
00779
00780 //CCJMonthCalCtrl
00781 _CJXLIB_INLINE CCJMonthCalCtrl::CCJMonthCalCtrl()
00782     { }
00783 _CJXLIB_INLINE DWORD CCJMonthCalCtrl::HitTest(PMCHITTESTINFO pMCHitTest)
00784     { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, MCM_HITTEST, 0, (LPARAM) pMCHitTest); }
00785 _CJXLIB_INLINE BOOL CCJMonthCalCtrl::GetMinReqRect(RECT* pRect) const
00786     { ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_GETMINREQRECT, 0, (LPARAM) pRect); }
00787 _CJXLIB_INLINE int CCJMonthCalCtrl::SetMonthDelta(int iDelta)
00788     { ASSERT(m_hWnd != NULL); return (int) ::SendMessage(m_hWnd, MCM_SETMONTHDELTA, (WPARAM) iDelta, 0); }
00789 _CJXLIB_INLINE int CCJMonthCalCtrl::GetMonthDelta() const
00790     { ASSERT(m_hWnd != NULL); return (int) ::SendMessage(m_hWnd, MCM_GETMONTHDELTA, 0, 0); }
00791 _CJXLIB_INLINE COLORREF CCJMonthCalCtrl::GetColor(int nRegion) const
00792     { ASSERT(m_hWnd != NULL); return (COLORREF) ::SendMessage(m_hWnd, MCM_GETCOLOR, (WPARAM) nRegion, 0); }
00793 _CJXLIB_INLINE COLORREF CCJMonthCalCtrl::SetColor(int nRegion, COLORREF ref)
00794     { ASSERT(m_hWnd != NULL); return (COLORREF) ::SendMessage(m_hWnd, MCM_SETCOLOR, (WPARAM) nRegion, (LPARAM) ref); }
00795 _CJXLIB_INLINE BOOL CCJMonthCalCtrl::SetMaxSelCount(int nMax)
00796     { ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_SETMAXSELCOUNT, nMax, 0); }
00797 _CJXLIB_INLINE int CCJMonthCalCtrl::GetMaxSelCount() const
00798     { ASSERT(m_hWnd != NULL); return (int) ::SendMessage(m_hWnd, MCM_GETMAXSELCOUNT, 0, 0); }
00799 _CJXLIB_INLINE void CCJMonthCalCtrl::SetToday(const LPSYSTEMTIME pDateTime)
00800     { ASSERT(m_hWnd != NULL); ::SendMessage(m_hWnd, MCM_SETTODAY, 0, (LPARAM) pDateTime); }
00801 _CJXLIB_INLINE BOOL CCJMonthCalCtrl::GetToday(LPSYSTEMTIME pDateTime) const
00802     { ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_GETTODAY, 0, (LPARAM) pDateTime); }
00803 _CJXLIB_INLINE BOOL CCJMonthCalCtrl::SetCurSel(const LPSYSTEMTIME pDateTime)
00804     { ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_SETCURSEL, 0, (LPARAM) pDateTime); }
00805 _CJXLIB_INLINE BOOL CCJMonthCalCtrl::GetCurSel(LPSYSTEMTIME pDateTime) const
00806     { ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_GETCURSEL, 0, (LPARAM) pDateTime); }
00807
00808 #endif //__CJDATETIMECTRL_H__
00809
Generated on Sun Feb 24 01:21:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJDockBar.h Source File

WinCvs/CJLib/Include/CJDockBar.h

Go to the documentation of this file.
00001 // CJDockBar.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJockey/Include/CJDockBar.h $
00011  *
00012  * $History: CJDockBar.h $
00013  *
00014  * *****************  Version 5  *****************
00015  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00016  * Updated in $/CodeJockey/Include
00017  * Updated copyright and contact information.
00018  *
00019  * *****************  Version 4  *****************
00020  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00021  * Updated in $/CodeJockey/Include
00022  *
00023  * *****************  Version 3  *****************
00024  * User: Kirk Stowell Date: 7/18/99    Time: 10:17p
00025  * Updated in $/CodeJockey/Include
00026  * Cleaned up inline functions, and import/export macro so that class will
00027  * be imported when linked to, and exported at compile time.
00028  *
00029  * *****************  Version 2  *****************
00030  * User: Kirk Stowell Date: 4/03/99    Time: 12:53p
00031  * Updated in $/CodeJockey/Include
00032  * Added comments and cleaned up code.
00033  *
00034  * *****************  Version 1  *****************
00035  * User: Kirk Stowell Date: 10/17/98   Time: 12:53p
00036  * Created in $/CodeJockey/CJ60Lib
00037  * Initial re-write and release.
00038  *
00039  ***************************************************************************/
00041
00042 #ifndef __CJDOCKBAR_H__
00043 #define __CJDOCKBAR_H__
00044
00045 #if _MSC_VER >= 1000
00046 #pragma once
00047 #endif // _MSC_VER >= 1000
00048
00049 // CCJDockBar is a CDockBar derived class used by CCJFrameWnd and CCJMDIFrameWnd
00050 // to offset CCJToolBars to allow 3D borders.
00051 class _CJX_EXT_CLASS CCJDockBar : public CDockBar
00052 {
00053     DECLARE_DYNAMIC(CCJDockBar)
00054
00055 public:
00056
00057     // Default constructor
00058     //
00059     CCJDockBar();
00060
00061     // Virtual destructor
00062     //
00063     virtual ~CCJDockBar();
00064
00065 // Overrides
00066     // ClassWizard generated virtual function overrides
00067     //{{AFX_VIRTUAL(CCJDockBar)
00068     public:
00069     virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
00070     //}}AFX_VIRTUAL
00071
00072 // Generated message map functions
00073 protected:
00074     //{{AFX_MSG(CCJDockBar)
00075         // NOTE - the ClassWizard will add and remove member functions here.
00076         //    DO NOT EDIT what you see in these blocks of generated code !
00077     //}}AFX_MSG
00078     DECLARE_MESSAGE_MAP()
00079 };
00080
00082
00083 //{{AFX_INSERT_LOCATION}}
00084 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00085
00086 #endif // __CJDOCKBAR_H__
00087
Generated on Sun Feb 24 01:21:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJDockContext.h Source File

WinCvs/CJLib/Include/CJDockContext.h

Go to the documentation of this file.
00001 // CJDockContext.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJockey/Include/CJDockContext.h $
00011  *
00012  * $History: CJDockContext.h $
00013  *
00014  * *****************  Version 9  *****************
00015  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00016  * Updated in $/CodeJockey/Include
00017  * Updated copyright and contact information.
00018  *
00019  * *****************  Version 8  *****************
00020  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00021  * Updated in $/CodeJockey/Include
00022  *
00023  * *****************  Version 7  *****************
00024  * User: Kirk Stowell Date: 7/18/99    Time: 10:17p
00025  * Updated in $/CodeJockey/Include
00026  * Cleaned up inline functions, and import/export macro so that class will
00027  * be imported when linked to, and exported at compile time.
00028  *
00029  * *****************  Version 6  *****************
00030  * User: Kirk Stowell Date: 6/09/99    Time: 8:33p
00031  * Updated in $/CodeJockey/Include
00032  * Ioannhs Stamatopoulos (Yiannhs) [ystamat@mail.datamedia.gr] - Extended
00033  * docking windows, removed ::GetSysColor(...) calls and WM_SYSCOLORCHANGE
00034  * message handler, this is now automatically handled by the base class.
00035  * Added redraw flags to the create method and modified paint and layout
00036  * handlers to reduce flicker and un-necessary command handling. Dragging
00037  * rect now reflects actual control bar docked size. Added "flat" look to
00038  * the control bars, the control bars can now use the classic DevStudio
00039  * look, or use flat gradient gripper, borders and frame buttons. Overall,
00040  * docking windows now handle dragging, docking and floating much better,
00041  * and behave more like DevStudio.
00042  *
00043  * *****************  Version 5  *****************
00044  * User: Kirk Stowell Date: 4/14/99    Time: 12:57p
00045  * Updated in $/CodeJockey/Include
00046  * Daniel Harth [danielh@mail.matco.ro] - Added support for diagonal
00047  * sizing.
00048  *
00049  * *****************  Version 4  *****************
00050  * User: Kirk Stowell Date: 4/03/99    Time: 12:56p
00051  * Updated in $/CodeJockey/Include
00052  * Added comments and cleaned up code.
00053  *
00054  * *****************  Version 3  *****************
00055  * User: Kirk Stowell Date: 3/10/99    Time: 12:56p
00056  * Updated in $/CodeJockey/Include
00057  * Added support for toggle docking.
00058  *
00059  * *****************  Version 2  *****************
00060  * User: Kirk Stowell Date: 3/03/99    Time: 12:54p
00061  * Updated in $/CodeJockey/Include
00062  * Scott Killen [s_killen@yahoo.com] - If your frame is not your main
00063  * window in your app, you cannot dock a floating CCJControlBar. Changed
00064  * (CFrameWnd*)AfxGetApp()->m_pMainWnd to (CFrameWnd*)m_pDockSite in
00065  * CanDockDockBar() and DockSizeBar()
00066  *
00067  * *****************  Version 1  *****************
00068  * User: Kirk Stowell Date: 1/12/99    Time: 12:53p
00069  * Created in $/CodeJockey/Include
00070  * Initial creation to add side-by-side docking support for CCJControlBar
00071  * class.
00072  *
00073  ***************************************************************************/
00075
00076 #ifndef __CJDOCKCONTEXT_H__
00077 #define __CJDOCKCONTEXT_H__
00078
00079 #if _MSC_VER >= 1000
00080 #pragma once
00081 #endif // _MSC_VER >= 1000
00082
00083 // class forwards
00084 class CCJSizeDockBar;
00085 class CCJControlBar;
00086
00087 // CCJDockContext is a CDockContext derived class which is used by
00088 // CCJControlBar and CCJMiniDockFrameWnd for docking / sizing control bars.
00089 class _CJX_EXT_CLASS CCJDockContext : public CDockContext
00090 {
00091 public:
00092
00093     // Default constructor
00094     //
00095     CCJDockContext(CControlBar* pBar);
00096
00097     // Virtual destructor
00098     //
00099     virtual ~CCJDockContext();
00100
00101 public:
00102
00103     CPoint      m_ptOrig; // Yiannhs: trying to handle some extra use
00104
00105 public:
00106
00107     // this member function is called by CCJDockContext when a drag
00108     // operation completes.
00109     //
00110     void EndDragDockBar();
00111
00112     // this member function is called by CCJDockContext during a
00113     // drag process.
00114     //
00115     void MoveDockBar(CPoint pt);
00116
00117     // this member function is called by CCJControlBar and CCJMiniDockFrameWnd
00118     // whenever a drag operation begins.
00119     //
00120     void StartDragDockBar(CPoint pt);
00121
00122     // this member function is called by CCJDockContext to determine
00123     // wether a control bar is dockable.
00124     //
00125     DWORD CanDockDockBar();
00126
00127     // this member function is called by CCJDockContext to determine
00128     // wether a control bar is dockable.
00129     //
00130     DWORD CanDockDockBar(CRect rect, DWORD dwDockStyle, CDockBar** ppDockBar = NULL);
00131
00132     // this member function is called by CCJDockContext
00133     // whenever a drag operation begins.
00134     //
00135     BOOL TrackDockBar();
00136
00137     // this member function is called by CCJDockContext
00138     // and returns a CCJSizeDock bar pointer.
00139     //
00140     CCJSizeDockBar* GetDockBar(DWORD dwOverDockStyle);
00141
00142     // this member function is used by the framework to dock a
00143     // control bar.
00144     //
00145     void DockSizeBar(CControlBar *,CCJSizeDockBar* =NULL,LPRECT =NULL);
00146
00147     // this member function is used to toggle the docked state of
00148     // a control bar.
00149     //
00150     virtual void ToggleDocking();
00151
00152     // this member function is called to enable diagonal sizing
00153     // for the control bar.
00154     //
00155     void Stretch(CPoint pt);
00156     virtual void StartResize(int nHitTest, CPoint pt);
00157 };
00158
00160
00161 #endif // __CJDOCKCONTEXT_H__
Generated on Sun Feb 24 01:21:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJExplorerBar.h Source File

WinCvs/CJLib/Include/CJExplorerBar.h

Go to the documentation of this file.
00001 // CJExplorerBar.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:49 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/Include/CJExplorerBar.h $
00011  *
00012  * $History: CJExplorerBar.h $
00013  *
00014  * *****************  Version 8  *****************
00015  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00016  * Updated in $/CodeJock/Include
00017  * Fixed potential resource and memory leak problems.
00018  *
00019  * *****************  Version 7  *****************
00020  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00021  * Updated in $/CodeJockey/Include
00022  * Updated copyright and contact information.
00023  *
00024  * *****************  Version 6  *****************
00025  * User: Kirk Stowell Date: 6/23/99    Time: 7:23a
00026  * Updated in $/CodeJockey/Include
00027  *
00028  * *****************  Version 5  *****************
00029  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00030  * Updated in $/CodeJockey/Include
00031  *
00032  * *****************  Version 4  *****************
00033  * User: Kirk Stowell Date: 7/18/99    Time: 10:17p
00034  * Updated in $/CodeJockey/Include
00035  * Cleaned up inline functions, and import/export macro so that class will
00036  * be imported when linked to, and exported at compile time.
00037  *
00038  * *****************  Version 3  *****************
00039  * User: Kirk Stowell Date: 4/03/99    Time: 4:23p
00040  * Updated in $/CodeJockey/Include
00041  * Added comments and cleaned up code.
00042  *
00043  * *****************  Version 2  *****************
00044  * User: Kirk Stowell Date: 1/31/99    Time: 4:23p
00045  * Updated in $/CodeJockey/Include
00046  * Made some cosmetic enhancements to more closely match the windows
00047  * explorer bar.
00048  *
00049  * *****************  Version 1  *****************
00050  * User: Kirk Stowell Date: 1/16/99    Time: 4:22p
00051  * Created in $/CodeJockey/Include
00052  * Initial release
00053  *
00054  ***************************************************************************/
00056
00057 #ifndef __CJEXPLORERBAR_H__
00058 #define __CJEXPLORERBAR_H__
00059
00060 #if _MSC_VER >= 1000
00061 #pragma once
00062 #endif // _MSC_VER >= 1000
00063
00064 #include "CJControlBar.h"
00065 #include "CJCaption.h"
00066
00067 // CCJExplorerBar is a CCJControlBar derived class which is simular
00068 // to the explorer bar that is seen in Windows or Internet Explorer.
00069 class _CJX_EXT_CLASS CCJExplorerBar : public CCJControlBar
00070 {
00071     DECLARE_DYNAMIC(CCJExplorerBar)
00072
00073 public:
00074
00075     // Default constructor
00076     //
00077     CCJExplorerBar();
00078
00079     // Virtual destructor
00080     //
00081     virtual ~CCJExplorerBar();
00082
00083 protected:
00084
00085     CCJCaption      m_Caption;          // frame caption contains
00086     CCJFlatButton   m_CaptionButton;    // close button located on frame
00087     CString         m_strCaption;       // text that is displayed in the caption
00088     HICON           m_hIcon;            // handle to button icon.
00089
00090 public:
00091
00092     // this member function is used to create an explorer bar
00093     //
00094     virtual BOOL Create(
00095         // the parent window.
00096         CWnd* pParentWnd,
00097         // The ID of the control bar.
00098         UINT nID,
00099         // Points to a null-terminated character string that contains the
00100         // control bar title.
00101         LPCTSTR lpszWindowName = NULL,
00102         // The default size the control bar is to be.
00103         CSize sizeDefault = CSize(200,100),
00104         // Specifies the window style attributes.
00105         DWORD dwStyle = CBRS_LEFT);
00106
00107     // this member function is called by the control bar, and
00108     // can be overloaded in derived classes to return the rect
00109     // for the child window associated with the control bar.
00110     //
00111     virtual void GetChildRect(
00112         // reference to a CRect object which contains the size of
00113         // the child window associated with the control bar.
00114         CRect &rect);
00115
00116 // Overrides
00117     // ClassWizard generated virtual function overrides
00118     //{{AFX_VIRTUAL(CCJExplorerBar)
00119     //}}AFX_VIRTUAL
00120
00121 // Generated message map functions
00122 protected:
00123     //{{AFX_MSG(CCJExplorerBar)
00124     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00125     afx_msg void OnButtonClose();
00126     afx_msg void OnUpdateButtonClose(CCmdUI* pCmdUI);
00127     afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
00128     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00129     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00130     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00131     //}}AFX_MSG
00132     DECLARE_MESSAGE_MAP()
00133 };
00134
00136
00137 //{{AFX_INSERT_LOCATION}}
00138 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00139
00140 #endif // __CJEXPLORERBAR_H__
00141
Generated on Sun Feb 24 01:21:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJFlatButton.h Source File

WinCvs/CJLib/Include/CJFlatButton.h

Go to the documentation of this file.
00001 // CJFlatButton.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 2000/02/29 22:28:40 $
00009  * $Revision: 1.2 $
00010  * $Archive: /CodeJock/Include/CJFlatButton.h $
00011  *
00012  * $History: CJFlatButton.h $
00013  *
00014  * *****************  Version 17  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:00p
00016  * Updated in $/CodeJock/Include
00017  * Further Updates to OnEraseBkgnd(...) and OnPaint() for flicker free
00018  * drawing.
00019  *
00020  * *****************  Version 16  *****************
00021  * User: Kirk Stowell Date: 10/30/99   Time: 2:25p
00022  * Updated in $/CodeJock/Include
00023  * Overrode OnEraseBkgnd(...) and made modifications to DrawItem(...) to
00024  * handle flicker free drawing.
00025  *
00026  * *****************  Version 15  *****************
00027  * User: Kirk Stowell Date: 10/26/99   Time: 10:39p
00028  * Updated in $/CodeJock/Include
00029  * Made class methods virtual for inheritance purposes.
00030  *
00031  * *****************  Version 14  *****************
00032  * User: Kirk Stowell Date: 10/24/99   Time: 4:28p
00033  * Updated in $/CodeJock/Include
00034  * Added method SetAlternateColors(...) which will allow the user to
00035  * define the "face", "hilight" and "shadow" colors used by the control
00036  * rather than used the system defaults. Thanks to Ronen Magid
00037  * [ronenm@simplement.co.il] for his suggestions.
00038  *
00039  * *****************  Version 13  *****************
00040  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00041  * Updated in $/CodeJock/Include
00042  * Fixed potential resource and memory leak problems.
00043  *
00044  * *****************  Version 12  *****************
00045  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00046  * Updated in $/CodeJockey/Include
00047  * Updated copyright and contact information.
00048  *
00049  * *****************  Version 11  *****************
00050  * User: Kirk Stowell Date: 8/29/99    Time: 9:46p
00051  * Updated in $/CodeJockey/Include
00052  * Fixed bug when the button is pressed 2 times very quickly, the button
00053  * is only pressed once - Stephan Neumann <neumann@dialogs.de>
00054  *
00055  * *****************  Version 10  *****************
00056  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00057  * Updated in $/CodeJockey/Include
00058  *
00059  * *****************  Version 9  *****************
00060  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00061  * Updated in $/CodeJockey/Include
00062  *
00063  * *****************  Version 8  *****************
00064  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00065  * Updated in $/CodeJockey/Include
00066  *
00067  * *****************  Version 7  *****************
00068  * User: Kirk Stowell Date: 7/18/99    Time: 10:17p
00069  * Updated in $/CodeJockey/Include
00070  * Cleaned up inline functions, and import/export macro so that class will
00071  * be imported when linked to, and exported at compile time.
00072  *
00073  * *****************  Version 6  *****************
00074  * User: Kirk Stowell Date: 7/14/99    Time: 9:58p
00075  * Updated in $/CodeJockey/Include
00076  * Re-wrote class to handle icons, text and bitmaps and added additional
00077  * functionality which was needed by the CCJCaption class.
00078  *
00079  * *****************  Version 5  *****************
00080  * User: Kirk Stowell Date: 6/09/99    Time: 8:45p
00081  * Updated in $/CodeJockey/Include
00082  * cleaned up _CJXLIB_INLINE functions, added validation assert.
00083  *
00084  * *****************  Version 4  *****************
00085  * User: Kirk Stowell Date: 4/03/99    Time: 4:23p
00086  * Updated in $/CodeJockey/Include
00087  * Added comments and cleaned up code.
00088  *
00089  * *****************  Version 3  *****************
00090  * User: Kirk Stowell Date: 3/13/99    Time: 4:24p
00091  * Updated in $/CodeJockey/Include
00092  * Patrick Bergeron [patb@softimage.com] fixed the following bugs:
00093  *
00094  * Moving the cursor over the flat button doesn't raise the button right
00095  * away. We have to wait for the first timer message to arrive, which is a
00096  * bit annoying. It gives the impression that the system isn't very
00097  * responsive. So in the OnMouseMove method, we call OnTimer(1) to force
00098  * the initial update of the button.
00099  *
00100  * Sometimes, a CJFlatButton would stay in a raised state when moving the
00101  * mouse quickly over the client area of a few CJFlatButtons. The reason
00102  * turned out to be the use of a static (ahem, global) variable
00103  * "bPainted". The simple fix for this was to put bPainted as a member
00104  * variable ("m_bPainted") and use this member variable instead.
00105  *
00106  * Flat buttons are now much more responsive and behave correctly in all
00107  * cases.
00108  *
00109  * *****************  Version 2  *****************
00110  * User: Kirk Stowell Date: 10/17/98   Time: 4:24p
00111  * Updated in $/CodeJockey/Include
00112  * Code clean up and re-organization, renamed CCJButton to CCJFlatButton.
00113  *
00114  * *****************  Version 1  *****************
00115  * User: Kirk Stowell Date: 10/17/98   Time: 4:23p
00116  * Created in $/CodeJockey/Include
00117  * Initial re-write and release.
00118  *
00119  ***************************************************************************/
00121
00122 #ifndef __CJFLATBUTTON_H__
00123 #define __CJFLATBUTTON_H__
00124
00125 #if _MSC_VER > 1000
00126 #pragma once
00127 #endif // _MSC_VER > 1000
00128
00129 // CCJFlatButton is a CButton derived class used to create flat buttons.
00130 // this class can only be used with the BS_OWNERDRAW style bit set.
00131 class _CJX_EXT_CLASS CCJFlatButton : public CButton
00132 {
00133     DECLARE_DYNAMIC(CCJFlatButton)
00134
00135 public:
00136
00137     // Default constructor
00138     //
00139     CCJFlatButton();
00140
00141     // Virtual destructor
00142     //
00143     virtual ~CCJFlatButton();
00144
00145 protected:
00146
00147     BOOL        m_bMouseOver;
00148     BOOL        m_bLBtnDown;    // true if left mouse button is pressed
00149     BOOL        m_bFlatLook;    // true for flat buttons see DisableFlatLook()
00150     CSize       m_sizeIcon;     // size of the icon if any associated with the button
00151     COLORREF    m_clrHilite;    // set to ::GetSysColor(COLOR_BTNHIGHLIGHT)
00152     COLORREF    m_clrShadow;    // set to ::GetSysColor(COLOR_BTNSHADOW)
00153     COLORREF    m_clrDkShad;    // set to ::GetSysColor(COLOR_3DDKSHADOW)
00154     COLORREF    m_clrNormal;    // set to ::GetSysColor(COLOR_BTNFACE)
00155     COLORREF    m_clrTextGy;    // set to ::GetSysColor(COLOR_GRAYTEXT)
00156     COLORREF    m_clrTextNm;    // set to ::GetSysColor(COLOR_BTNTEXT)
00157     COLORREF    m_clrAltNormal; // user defined replacement for face color.
00158     COLORREF    m_clrAltHilite; // user defined replacement for hilite color.
00159     COLORREF    m_clrAltShadow; // user defined replacement for shadow color.
00160     COLORREF    m_clrAltTextNm; // user defined replacement for text color.
00161     BOOL        m_bAltColor;    // TRUE if user defined colors are used.
00162     BOOL        m_bPainted;     // used during paint operations
00163     HICON       m_hPushed;
00164     CFont*      m_pFont;
00165     CFont       m_Font;         // default font created by control if m_pFont is NULL
00166     HCURSOR     m_hCursor;
00167
00168 public:
00169
00170     virtual void SetButtonFont(CFont* pFont);
00171
00172     // this method will allow the user to define the default colors for the background
00173     // shadow and hilight colors for the button.
00174     //
00175     virtual void SetAlternateColors(COLORREF clrAltNormal, COLORREF clrAltHilite, COLORREF clrAltShadow, COLORREF clrAltTextNm);
00176
00177     // this member function is used to disable or enable the flat
00178     // look for the button
00179     //
00180     virtual void DisableFlatLook(
00181         // set to true to disable the flat look.
00182         BOOL bDisable = FALSE);
00183
00184     // this memeber function is used to associate an icon with the
00185     // flat button.
00186     //
00187     virtual void SetIcon(
00188         // handle to icon to be associated with button.
00189         HICON hIcon,
00190         // desired size of the icon, must be smaller than
00191         // button size for best results.
00192         CSize size);
00193
00194     // this memeber function is used to associate an icon with the
00195     // flat button.
00196     //
00197     virtual void SetIcon(
00198         // handle to icon to be associated with button.
00199         HICON hIcon,
00200         // handle of the pushed icon to be associated with button.
00201         HICON hPushed,
00202         // desired size of the icon, must be smaller than
00203         // button size for best results.
00204         CSize size);
00205
00206 protected:
00207
00208     // these memeber functions are called by the control during paint
00209     // operations.
00210     //
00211     virtual void DrawButtonIcon(CDC* pDC, UINT nState, CRect& rcItem);
00212     virtual void DrawButtonText(CDC* pDC, UINT nState, CRect& rcItem);
00213     virtual void DrawButtonBitmap(CDC* pDC, UINT nState, CRect& rcItem);
00214
00215     // used by the control to initialize the default font.
00216     //
00217     virtual void UpdateFont();
00218
00219 // Overrides
00220     // ClassWizard generated virtual function overrides
00221     //{{AFX_VIRTUAL(CCJFlatButton)
00222     public:
00223     virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
00224     //}}AFX_VIRTUAL
00225
00226     // Generated message map functions
00227 protected:
00228     //{{AFX_MSG(CCJFlatButton)
00229     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00230     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00231     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00232     afx_msg void OnTimer(UINT nIDEvent);
00233     afx_msg void OnSysColorChange();
00234     afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
00235     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00236     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00237     afx_msg void OnPaint();
00238     //}}AFX_MSG
00239
00240     DECLARE_MESSAGE_MAP()
00241 };
00242
00244 //  Inline Functions
00246
00247 _CJXLIB_INLINE void CCJFlatButton::DisableFlatLook(BOOL bDisable)
00248     { ASSERT(::IsWindow(m_hWnd)); m_bFlatLook = bDisable; Invalidate(); }
00249
00250 _CJXLIB_INLINE void CCJFlatButton::SetIcon(HICON hIcon, CSize size)
00251     { ASSERT(::IsWindow(m_hWnd)); m_sizeIcon = size; CButton::SetIcon(hIcon); }
00252
00253 _CJXLIB_INLINE void CCJFlatButton::SetIcon(HICON hIcon, HICON hPushed, CSize size)
00254     { ASSERT(::IsWindow(m_hWnd)); m_hPushed = hPushed; SetIcon(hIcon, size); }
00255
00256 _CJXLIB_INLINE void CCJFlatButton::SetButtonFont(CFont *pFont)
00257     { ASSERT(::IsWindow(m_hWnd)); m_pFont = pFont; }
00258
00260
00261 //{{AFX_INSERT_LOCATION}}
00262 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00263
00264 #endif // __CJFLATBUTTON_H__
Generated on Sun Feb 24 01:21:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJFlatComboBox.h Source File

WinCvs/CJLib/Include/CJFlatComboBox.h

Go to the documentation of this file.
00001 // CJFlatComboBox.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:51 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/Include/CJFlatComboBox.h $
00011  *
00012  * $History: CJFlatComboBox.h $
00013  *
00014  * *****************  Version 17  *****************
00015  * User: Kirk Stowell Date: 10/30/99   Time: 6:01p
00016  * Updated in $/CodeJock/Include
00017  * Overrode OnEraseBkgnd(...) and re-wrote OnPaint() to handle flicker
00018  * free drawing.
00019  *
00020  * *****************  Version 16  *****************
00021  * User: Kirk Stowell Date: 10/30/99   Time: 2:24p
00022  * Updated in $/CodeJock/Include
00023  * Added COLORREF members to class to eliminate continuous calls to
00024  * GetSysColor(...). Overrode OnSysColorChange() to re-initialize COLORREF
00025  * variables.
00026  *
00027  * *****************  Version 15  *****************
00028  * User: Kirk Stowell Date: 10/26/99   Time: 10:39p
00029  * Updated in $/CodeJock/Include
00030  * Made class methods virtual for inheritance purposes.
00031  *
00032  * *****************  Version 14  *****************
00033  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00034  * Updated in $/CodeJockey/Include
00035  * Updated copyright and contact information.
00036  *
00037  * *****************  Version 13  *****************
00038  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00039  * Updated in $/CodeJockey/Include
00040  *
00041  * *****************  Version 12  *****************
00042  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00043  * Updated in $/CodeJockey/Include
00044  *
00045  * *****************  Version 11  *****************
00046  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00047  * Updated in $/CodeJockey/Include
00048  *
00049  * *****************  Version 10  *****************
00050  * User: Kirk Stowell Date: 7/18/99    Time: 10:17p
00051  * Updated in $/CodeJockey/Include
00052  * Cleaned up inline functions, and import/export macro so that class will
00053  * be imported when linked to, and exported at compile time.
00054  *
00055  * *****************  Version 9  *****************
00056  * User: Kirk Stowell Date: 5/17/99    Time: 9:24p
00057  * Updated in $/CodeJockey/Include
00058  * Gilberto Botaro [seafox@techno.com.br] - Added code for auto
00059  * completion.
00060  *
00061  * *****************  Version 8  *****************
00062  * User: Kirk Stowell Date: 5/03/99    Time: 10:44p
00063  * Updated in $/CodeJockey/Include
00064  * Fixed code ommisions.
00065  *
00066  * *****************  Version 7  *****************
00067  * User: Kirk Stowell Date: 5/03/99    Time: 8:42p
00068  * Updated in $/CodeJockey/Include
00069  * Danilo Lax [Danilo_Lax@www2.alpeng.com] - The control is painted flat
00070  * when the mouse leaves the box, even if the control has the focus, now
00071  * checking for the focus in OnTimer(.
00072  *
00073  * Removed, unhandled msgs are processed by
00074  * CComboBox::PreTranslateMessage(pMsg). Used reflected msgs
00075  * BN_GETFOCUS/CBN_KILLFOCUS instead of WM_GETFOCUS/WM_KILLFOCUS.
00076  *
00077  * ::GetFocus() doesn't return CFlatComboBox::m_hWnd, even if the control
00078  * has the focus (don't know why, maybe ::GetFocus() only returns the
00079  * handle to the EditField part of the ComboBox), used flag m_bHasFocus
00080  * instead.
00081  *
00082  * *****************  Version 6  *****************
00083  * User: Kirk Stowell Date: 4/03/99    Time: 4:26p
00084  * Updated in $/CodeJockey/Include
00085  * Added comments and cleaned up code.
00086  *
00087  * *****************  Version 5  *****************
00088  * User: Kirk Stowell Date: 1/22/99    Time: 4:26p
00089  * Updated in $/CodeJockey/Include
00090  * Fixed accelerator problem reported by YOSH YAMASHITA
00091  * (yosh@muj.biglobe.ne.jp) with Matt Weagle's solution of overloading
00092  * PreTranslateMessage().
00093  *
00094  * *****************  Version 4  *****************
00095  * User: Kirk Stowell Date: 1/02/99    Time: 4:25p
00096  * Updated in $/CodeJockey/Include
00097  * Renamed class from CJComboBox to CCJFlatComboBox, changed DRAWSTATE to
00098  * enum, removed method Offset(), and replaced with a direct call to
00099  * ::GetSystemMetrics().
00100  *
00101  * *****************  Version 3  *****************
00102  * User: Kirk Stowell Date: 11/02/98   Time: 4:24p
00103  * Updated in $/CodeJockey/Include
00104  * Added OnSetFocus(), OnKillFocus() and modified OnPaint() so the control
00105  * remains beveled until it actually looses focus - (Vachik
00106  * Hovhannissian).
00107  *
00108  * *****************  Version 2  *****************
00109  * User: Kirk Stowell Date: 10/05/98   Time: 4:24p
00110  * Updated in $/CodeJockey/Include
00111  * Fixed offset bug to use GetSystemMetrics(), instead of hard coded
00112  * values -
00113  * Todd Brannam (tbrannam@msn.com).
00114  *
00115  * *****************  Version 1  *****************
00116  * User: Kirk Stowell Date: 10/02/98   Time: 4:23p
00117  * Created in $/CodeJockey/Include
00118  * First release version.
00119  *
00120  ***************************************************************************/
00122
00123 #ifndef __CJFLATCOMBOBOX_H__
00124 #define __CJFLATCOMBOBOX_H__
00125
00126 #if _MSC_VER > 1000
00127 #pragma once
00128 #endif // _MSC_VER > 1000
00129
00130 // CCJFlatComboBox is a CComboBox derived class which is simular to
00131 // the flat combobox as seen in the Microsoft office products.
00132 class _CJX_EXT_CLASS CCJFlatComboBox : public CComboBox
00133 {
00134     DECLARE_DYNAMIC(CCJFlatComboBox)
00135
00136 public:
00137
00138     // Default constructor
00139     //
00140     CCJFlatComboBox();
00141
00142     // Virtual destructor
00143     //
00144     virtual ~CCJFlatComboBox();
00145
00146 protected:
00147
00148     // enum used to determine the state the combo box should be
00149     //
00150     enum STATE { NORMAL = 1, RAISED = 2, PRESSED = 3 };
00151
00152     BOOL        m_bLBtnDown;        // TRUE if left mouse button is pressed
00153     BOOL        m_bPainted;         // used during paint operations
00154     BOOL        m_bHasFocus;        // TRUE if control has focus
00155     BOOL        m_bAutoComp;        // Used by Autocompleting.
00156     COLORREF    m_clrHilite;        // set to ::GetSysColor(COLOR_BTNHIGHLIGHT)
00157     COLORREF    m_clrShadow;        // set to ::GetSysColor(COLOR_BTNSHADOW)
00158     COLORREF    m_clrNormal;        // set to ::GetSysColor(COLOR_BTNFACE)
00159
00160 public:
00161     BOOL IsWin95();
00162
00163     // Call this member function to enable auto completion.
00164     //
00165     virtual void EnableAutoCompletion(BOOL bEnable=TRUE);
00166
00167     // This member function determines if the mouse is within
00168     // the controls rect.
00169     //
00170     virtual BOOL PointInRect();
00171
00172 protected:
00173
00174     // this member function is called by the combo box whenever a paint
00175     // operation should occur.
00176     //
00177     virtual void DrawCombo(STATE eState, COLORREF clrTopLeft, COLORREF clrBottomRight, CDC* pDC=NULL);
00178
00179 // Overrides
00180     // ClassWizard generated virtual function overrides
00181     //{{AFX_VIRTUAL(CCJFlatComboBox)
00182     public:
00183     virtual BOOL PreTranslateMessage(MSG* pMsg);
00184     //}}AFX_VIRTUAL
00185
00186     // Generated message map functions
00187 protected:
00188     //{{AFX_MSG(CCJFlatComboBox)
00189     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00190     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00191     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00192     afx_msg void OnTimer(UINT nIDEvent);
00193     afx_msg void OnPaint();
00194     afx_msg void OnSetFocus();
00195     afx_msg void OnKillFocus();
00196     afx_msg void OnEditUpdate();
00197     afx_msg void OnSysColorChange();
00198     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00199     //}}AFX_MSG
00200
00201     DECLARE_MESSAGE_MAP()
00202 };
00203
00205 //  Inline Functions
00207
00208 _CJXLIB_INLINE void CCJFlatComboBox::EnableAutoCompletion(BOOL bEnable/*=TRUE*/)
00209     { ASSERT(::IsWindow(m_hWnd)); m_bAutoComp = bEnable; }
00210
00211 _CJXLIB_INLINE BOOL CCJFlatComboBox::PointInRect()
00212     { ASSERT(::IsWindow(m_hWnd)); CPoint pt; GetCursorPos(&pt); CRect rcItem; GetWindowRect(&rcItem); return rcItem.PtInRect(pt); }
00213
00214 //{{AFX_INSERT_LOCATION}}
00215 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00216
00217 #endif // __CJCOMBOBOX_H__
Generated on Sun Feb 24 01:21:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJFlatHeaderCtrl.h Source File

WinCvs/CJLib/Include/CJFlatHeaderCtrl.h

Go to the documentation of this file.
00001 // CJFlatHeaderCtrl.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 2002/01/05 16:46:43 $
00009  * $Revision: 1.2 $
00010  * $Archive: /CodeJock/Include/CJFlatHeaderCtrl.h $
00011  *
00012  * $History: CJFlatHeaderCtrl.h $
00013  *
00014  * *****************  Version 16  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:01p
00016  * Updated in $/CodeJock/Include
00017  * Further Updates to OnEraseBkgnd(...) and OnPaint() for flicker free
00018  * drawing.
00019  *
00020  * *****************  Version 15  *****************
00021  * User: Kirk Stowell Date: 10/30/99   Time: 2:23p
00022  * Updated in $/CodeJock/Include
00023  * Overrode OnPaint(...) for flicker free drawing and fixed bug where
00024  * column is resized and border leaves a trail.
00025  *
00026  * *****************  Version 14  *****************
00027  * User: Kirk Stowell Date: 10/26/99   Time: 10:39p
00028  * Updated in $/CodeJock/Include
00029  * Made class methods virtual for inheritance purposes.
00030  *
00031  * *****************  Version 13  *****************
00032  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00033  * Updated in $/CodeJock/Include
00034  * Fixed potential resource and memory leak problems.
00035  *
00036  * *****************  Version 12  *****************
00037  * User: Kirk Stowell Date: 10/14/99   Time: 8:23p
00038  * Updated in $/CodeJock/Include
00039  * Fixed size bug with header control where the end does not display
00040  * correctly.
00041  *
00042  * *****************  Version 11  *****************
00043  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00044  * Updated in $/CodeJockey/Include
00045  * Updated copyright and contact information.
00046  *
00047  * *****************  Version 10  *****************
00048  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00049  * Updated in $/CodeJockey/Include
00050  *
00051  * *****************  Version 9  *****************
00052  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00053  * Updated in $/CodeJockey/Include
00054  *
00055  * *****************  Version 8  *****************
00056  * User: Kirk Stowell Date: 7/18/99    Time: 10:17p
00057  * Updated in $/CodeJockey/Include
00058  * Cleaned up inline functions, and import/export macro so that class will
00059  * be imported when linked to, and exported at compile time.
00060  *
00061  * *****************  Version 7  *****************
00062  * User: Kirk Stowell Date: 6/14/99    Time: 10:43p
00063  * Updated in $/CodeJockey/Include
00064  * Cleaned up code to eliminate level 4 compilier warnings.
00065  *
00066  * *****************  Version 6  *****************
00067  * User: Kirk Stowell Date: 5/17/99    Time: 8:00p
00068  * Updated in $/CodeJockey/Include
00069  * Added popup menu support and vc5 compatibility.
00070  *
00071  * *****************  Version 5  *****************
00072  * User: Kirk Stowell Date: 4/15/99    Time: 4:27p
00073  * Updated in $/CodeJockey/Include
00074  * Igor Ostriz [iostriz@usa.net] - fixed bug with drag/drop and changing
00075  * column order.
00076  *
00077  * *****************  Version 4  *****************
00078  * User: Kirk Stowell Date: 4/03/99    Time: 4:26p
00079  * Updated in $/CodeJockey/Include
00080  * Added comments and cleaned up code.
00081  *
00082  * *****************  Version 3  *****************
00083  * User: Kirk Stowell Date: 2/24/99    Time: 4:26p
00084  * Updated in $/CodeJockey/Include
00085  * Fixed repainting problem when header is moved or window is resized. The
00086  * class now uses log font instead of hard coded Tahoma font.
00087  *
00088  * *****************  Version 2  *****************
00089  * User: Kirk Stowell Date: 1/31/99    Time: 4:27p
00090  * Updated in $/CodeJockey/Include
00091  * Fixed problem with sort arrow drawn. If hditem has an associated
00092  * bitmap, the arrow is not drawn.
00093  *
00094  * *****************  Version 1  *****************
00095  * User: Kirk Stowell Date: 1/16/99    Time: 4:26p
00096  * Created in $/CodeJockey/Include
00097  * Initial release.
00098  *
00099  ***************************************************************************/
00101
00102 #ifndef __CJFLATHEADERCTRL_H__
00103 #define __CJFLATHEADERCTRL_H__
00104
00105 #if _MSC_VER >= 1000
00106 #pragma once
00107 #endif // _MSC_VER >= 1000
00108
00109 #include "CJMenu.h"        // CCJMenu class declaration
00110
00111 // CCJFlatHeaderCtrl is a CHeaderCtrl derived class which is simular
00112 // to the listbox flat header controls seen in Visual Studio and Outlook.
00113 class _CJX_EXT_CLASS CCJFlatHeaderCtrl : public CHeaderCtrl
00114 {
00115
00116 public:
00117
00118     // Default constructor
00119     //
00120     CCJFlatHeaderCtrl();
00121
00122     // Virtual destructor
00123     //
00124     virtual ~CCJFlatHeaderCtrl();
00125
00126 protected:
00127     UINT    m_popToolbarID; // popup menu toolbar resource id, associates
00128                             // toolbar icons with the popup menu.
00129
00130     UINT    m_popupMenuID;  // popup menu resource id
00131     CCJMenu m_popupMenu;    // popup menu
00132     int     m_nPos;         // index of the pop-up menu contained in the menu
00133     BOOL    m_bBoldFont;    // true for bold fonts see SetFontBold(...)
00134     BOOL    m_bLBtnDown;    // true if left mouse button is pressed
00135     BOOL    m_bSortAsc;     // used when column is pressed to draw sort arrow.
00136     CFont   m_Font;         // font the header will use
00137     int     m_nOffset;      // ammount to offset the sort arrow.
00138     int     m_nSortCol;     // last column pressed during sort.
00139     CWnd*   m_pParentWnd;   // holds a pointer to the parent window.
00140     CRect   m_rcOldSize;
00141
00142 public:
00143
00144     // this member function is called to associate a menu and toolbar
00145     // resource with the context menu.
00146     //
00147     virtual void SetMenuID(UINT popupMenuID, UINT popToolbarID=0, int nPos=0);
00148
00149     // this member function returns the menu resource associated with
00150     // the tab control.
00151     //
00152     virtual UINT GetMenuID();
00153
00154     // this member function must be called after creation to initialize the
00155     // font the header will use.
00156     //
00157     virtual void InitializeHeader(bool bBoldFont);
00158
00159     // this member function can be used to toggle the font from bold to
00160     // normal.
00161     //
00162     virtual void SetFontBold(BOOL bBoldFont = TRUE);
00163
00164     // this member function is called by the header during sort
00165     // operations
00166     //
00167     virtual int SetSortImage( int nCol, BOOL bAsc );
00168
00169 protected:
00170
00171     // this member function is called by the header during paint
00172     // operations.
00173     //
00174     virtual void DrawFlatBorder(CDC* pDC);
00175     virtual void ResizeWindow();
00176
00177 #ifdef _VC_VERSION_5
00178     // this member function was added for vc5 support. It returns the number
00179     // of columns currently in the header.
00180     //
00181     virtual int GetItemCount() const;
00182     virtual BOOL GetOrderArray(LPINT piArray, int iCount= -1);
00183 #endif
00184
00185 // Overrides
00186     // ClassWizard generated virtual function overrides
00187     //{{AFX_VIRTUAL(CCJFlatHeaderCtrl)
00188     public:
00189     virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
00190     protected:
00191     virtual void PreSubclassWindow();
00192     //}}AFX_VIRTUAL
00193
00194     // Generated message map functions
00195 protected:
00196     //{{AFX_MSG(CCJFlatHeaderCtrl)
00197     afx_msg void OnPaint();
00198     afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00199     afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
00200     afx_msg LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu);
00201     afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
00202     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00203     afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
00204     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00205     //}}AFX_MSG
00206
00207     DECLARE_MESSAGE_MAP()
00208 };
00209
00211 //  Inline Functions
00213
00214 _CJXLIB_INLINE void CCJFlatHeaderCtrl::SetMenuID(UINT popupMenuID, UINT popToolbarID, int nPos)
00215     { ASSERT(::IsWindow(m_hWnd)); m_popupMenuID=popupMenuID; m_popToolbarID=popToolbarID; m_nPos=nPos; }
00216
00217 _CJXLIB_INLINE UINT CCJFlatHeaderCtrl::GetMenuID()
00218     { ASSERT(::IsWindow(m_hWnd)); return m_popupMenuID; }
00219
00220 _CJXLIB_INLINE void CCJFlatHeaderCtrl::SetFontBold(BOOL bBoldFont)
00221     { ASSERT(::IsWindow(m_hWnd)); m_bBoldFont = bBoldFont; }
00222
00223 #ifdef _VC_VERSION_5
00224 _CJXLIB_INLINE int CCJFlatHeaderCtrl::GetItemCount() const
00225     { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, HDM_GETITEMCOUNT, 0, 0L); }
00226 #endif
00227
00229
00230 //{{AFX_INSERT_LOCATION}}
00231 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00232
00233 #endif // __CJFLATHEADERCTRL_H__
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJFlatSplitterWnd.h Source File

WinCvs/CJLib/Include/CJFlatSplitterWnd.h

Go to the documentation of this file.
00001 // CJFlatSplitterWnd.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based on the CSplitterWndEx class written by Oleg G. Galkin.
00006 // mailto:OlegGa@vest.msk.ru
00007 // http://www.codeguru.com/splitter/show_hide_static_panes.shtml
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:51 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJock/Include/CJFlatSplitterWnd.h $
00015  *
00016  * $History: CJFlatSplitterWnd.h $
00017  *
00018  * *****************  Version 5  *****************
00019  * User: Kirk Stowell Date: 10/26/99   Time: 10:39p
00020  * Updated in $/CodeJock/Include
00021  * Made class methods virtual for inheritance purposes.
00022  *
00023  * *****************  Version 4  *****************
00024  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00025  * Updated in $/CodeJockey/Include
00026  * Updated copyright and contact information.
00027  *
00028  * *****************  Version 3  *****************
00029  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00030  * Updated in $/CodeJockey/Include
00031  *
00032  * *****************  Version 2  *****************
00033  * User: Kirk Stowell Date: 7/18/99    Time: 10:17p
00034  * Updated in $/CodeJockey/Include
00035  * Cleaned up inline functions, and import/export macro so that class will
00036  * be imported when linked to, and exported at compile time.
00037  *
00038  * *****************  Version 1  *****************
00039  * User: Kirk Stowell Date: 7/14/99    Time: 10:00p
00040  * Created in $/CodeJockey/Include
00041  * Class added to support flat splitters, removable splitter views and
00042  * view manipulation.
00043  *
00044  ***************************************************************************/
00046
00047 #ifndef __CJFLATSPLITTERWND_H__
00048 #define __CJFLATSPLITTERWND_H__
00049
00050 #if _MSC_VER >= 1000
00051 #pragma once
00052 #endif // _MSC_VER >= 1000
00053
00054 // CCJFlatSplitterWnd is a CSplitterWnd derived class which adds the ability
00055 // to hide and show splitter panes, based upon its index, and
00056 // to draw flat splitter windows simular to Oultook.
00057 class _CJX_EXT_CLASS CCJFlatSplitterWnd : public CSplitterWnd
00058 {
00059 public:
00060
00061     // Default constructor
00062     //
00063     CCJFlatSplitterWnd();
00064
00065     // Virtual destructor
00066     //
00067     virtual ~CCJFlatSplitterWnd();
00068
00069 protected:
00070
00071     int     m_nHiddenCol;       // Index of the hidden column.
00072     int     m_nHiddenRow;       // Index of the hidden row.
00073     BOOL    m_bFlatSplitter;    // true if the SPLS_FLATEDGE style was used during creation.
00074
00075 public:
00076
00077     // call this member function to enable or disable flat splitters.
00078     //
00079     virtual void DisableFlatStyle(BOOL bDisable=TRUE);
00080
00081     // this member function is called to switch, or swap a splitter
00082     // view with another.
00083     //
00084     virtual BOOL SwitchView(int nRow, int nCol, CView *pNewView);
00085
00086     // this member function is called to replace an existing splitter
00087     // view with another.
00088     //
00089     virtual BOOL ReplaceView(int nRow, int nCol, CRuntimeClass *pViewClass);
00090
00091     // this member function is called to show the column that was
00092     // previously hidden.
00093     //
00094     virtual void ShowColumn();
00095
00096     // this member function will hide a column based upon its index.
00097     //
00098     virtual void HideColumn(int nColHide);
00099
00100     // this member function is called to show the row that was
00101     // previously hidden.
00102     //
00103     virtual void ShowRow();
00104
00105     // this member function will hide a row based upon its index.
00106     //
00107     virtual void HideRow(int nRowHide);
00108
00109 // Overrides
00110     // ClassWizard generated virtual function overrides
00111     //{{AFX_VIRTUAL(CCJFlatSplitterWnd)
00112     virtual void OnDrawSplitter(CDC* pDC, ESplitType nType, const CRect& rect);
00113     //}}AFX_VIRTUAL
00114
00115 // Generated message map functions
00116 protected:
00117     //{{AFX_MSG(CCJFlatSplitterWnd)
00118     afx_msg void OnPaint();
00119     //}}AFX_MSG
00120     DECLARE_MESSAGE_MAP()
00121 };
00122
00124
00125 _CJXLIB_INLINE void CCJFlatSplitterWnd::DisableFlatStyle(BOOL bDisable)
00126     { m_bFlatSplitter = !bDisable; }
00127
00128 //{{AFX_INSERT_LOCATION}}
00129 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00130
00131 #endif // __CJFLATSPLITTERWND_H__
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJFlatTabCtrl.h Source File

WinCvs/CJLib/Include/CJFlatTabCtrl.h

Go to the documentation of this file.
00001 // FlatTab.h : header file
00002 //
00003 // Copyright © 1999 Ian Brumby
00004 //
00005 // This source code may be used in compiled form in any way you desire.
00006 // Source file(s) may be redistributed unmodified by any means PROVIDING
00007 // they are not sold for profit without the authors expressed written consent,
00008 // and providing that this notice and the authors name and all copyright
00009 // notices remain intact.
00010 //
00011 // ==========================================================================
00012 // HISTORY:
00013 // ==========================================================================
00014 //          1.4     21 Jul 1999 - Initial release.
00015 //          1.5     30 Aug 1999 - Several enhancements by Phil Baxter
00016 //                  <Phil.Baxter@mrjinx.demon.co.uk>
00017 // ==========================================================================
00018
00019 // Excel uses FF_ROMAN and Font Height = ~(control's height - 4)
00020 // Excel draws its tabs right to left
00021 // Excel has 3DLIGHT highlighting on the left diagonal
00022 // Excel has home/end buttons
00023 // Excel's buttons change width as the control's height changes
00024 //
00026 /****************************************************************************
00027  *
00028  * $Date: 1999/11/30 21:45:51 $
00029  * $Revision: 1.1.1.3 $
00030  * $Archive: /CodeJock/Include/CJFlatTabCtrl.h $
00031  *
00032  * $History: CJFlatTabCtrl.h $
00033  *
00034  * *****************  Version 8  *****************
00035  * User: Kirk Stowell Date: 10/26/99   Time: 10:40p
00036  * Updated in $/CodeJock/Include
00037  * Made class methods virtual for inheritance purposes.
00038  *
00039  * *****************  Version 7  *****************
00040  * User: Kirk Stowell Date: 10/24/99   Time: 12:15a
00041  * Updated in $/CodeJock/Include
00042  * Fixed minor bug with tab font creation.
00043  *
00044  * *****************  Version 6  *****************
00045  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00046  * Updated in $/CodeJock/Include
00047  * Fixed potential resource and memory leak problems.
00048  *
00049  * *****************  Version 5  *****************
00050  * User: Kirk Stowell Date: 10/14/99   Time: 12:25p
00051  * Updated in $/CodeJock/Include
00052  * Added source control history to file header.
00053  *
00054  ***************************************************************************/
00056
00057 #ifndef __CCJFLATTABCTRL_H__
00058 #define __CCJFLATTABCTRL_H__
00059
00060 #if _MSC_VER > 1000
00061 #pragma once
00062 #endif // _MSC_VER > 1000
00063
00064 #include <afxtempl.h>
00065 #include "CJMetaFileButton.h"
00066
00067 // control styles
00068 #define FTS_BOTTOM              0x0002
00069 #define FTS_HASARROWS           0x0004
00070 #define FTS_HASHOMEEND          0x0008 // Must be used with FTS_HASARROWS
00071
00072 typedef CList <CString*, CString*> CTabList;
00073
00074 // CCJFlatTabCtrl is a CWnd derived class which is used to create a flat tab
00075 // control simular to DevStudio.
00076 class _CJX_EXT_CLASS CCJFlatTabCtrl : public CWnd
00077 {
00078
00079 // Construction
00080 public:
00081     CCJFlatTabCtrl();
00082
00083 // Attributes
00084 public:
00085
00086 // Operations
00087 public:
00088
00089     virtual BOOL InsertItem(const int nItem, LPCTSTR lpszItem);
00090     virtual BOOL DeleteItem(int nItem);
00091     virtual BOOL DeleteAllItems();
00092     virtual BOOL GetItemRect(int nItem, LPRECT lpRect);
00093     virtual int HitTest(TCHITTESTINFO *pHitTestInfo) const;
00094     virtual int GetCurSel() const {return m_iCurSel;}
00095     virtual int SetCurSel(int nItem);
00096     virtual int GetItemCount() const { return m_TabList.GetCount(); }
00097     virtual void SetTipText(int nItem, LPCTSTR lpszTabTip);
00098     virtual CString GetTipText(int nItem);
00099     virtual void Home();
00100
00101 // Overrides
00102     // ClassWizard generated virtual function overrides
00103     //{{AFX_VIRTUAL(CCJFlatTabCtrl)
00104     protected:
00105     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00106     virtual BOOL PreTranslateMessage(MSG* pMsg);
00107     //}}AFX_VIRTUAL
00108
00109 // Implementation
00110 public:
00111     virtual ~CCJFlatTabCtrl();
00112
00113     // Generated message map functions
00114 protected:
00115     //{{AFX_MSG(CCJFlatTabCtrl)
00116     afx_msg void OnPaint();
00117     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00118     afx_msg void OnSize(UINT nType, int cx, int cy);
00119     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00120     afx_msg void OnLeftArrow();
00121     afx_msg void OnRightArrow();
00122     afx_msg void OnHomeArrow();
00123     afx_msg void OnEndArrow();
00124     //}}AFX_MSG
00125     DECLARE_MESSAGE_MAP()
00126
00127 private:
00128
00129     void CreateTabFont(const int iTabHeight);
00130     int GetTabWidth(const int nItem) const;
00131     int GetTotalArrowWidth(void) const;
00132     int GetTotalTabWidth(void) const;
00133     void InvalidateTabs(void);
00134     void EnableButtons(void);
00135     int DrawTab(CDC &dc, const int x, const int y, const int iHeight, bool bSelected, bool bBottom, LPCTSTR lpszTab) const;
00136
00137     bool m_bHasArrows;
00138     bool m_bHasHomeEnd;
00139     bool m_bTabsOnBottom;
00140     int m_iCurSel;
00141     int m_iClientWidth;
00142     int m_iClientHeight;
00143     int m_iTotalTabWidth;
00144     int m_iXOffset;
00145     CTabList m_TabList;
00146     CTabList m_TabTipList;
00147     CFont m_Font;
00148     CFont m_BoldFont;
00149     CCJMetaFileButton *m_pLeftButton;
00150     CCJMetaFileButton *m_pRightButton;
00151     CCJMetaFileButton *m_pHomeButton;
00152     CCJMetaFileButton *m_pEndButton;
00153     HENHMETAFILE m_hLeftArrow;
00154     HENHMETAFILE m_hLeftArrowDisabled;
00155     HENHMETAFILE m_hRightArrow;
00156     HENHMETAFILE m_hRightArrowDisabled;
00157     HENHMETAFILE m_hHomeArrow;
00158     HENHMETAFILE m_hHomeArrowDisabled;
00159     HENHMETAFILE m_hEndArrow;
00160     HENHMETAFILE m_hEndArrowDisabled;
00161
00162     CToolTipCtrl        m_ToolTip;
00163 };
00164
00166
00167 //{{AFX_INSERT_LOCATION}}
00168 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00169
00170 #endif // __CCJFLATTABCTRL_H__
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJFontCombo.h Source File

WinCvs/CJLib/Include/CJFontCombo.h

Go to the documentation of this file.
00001
00002 // CJFontCombo.h : header file
00003 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00004 // See ReadMe.txt for TERMS OF USE.
00005 //
00006 // Based on the article 'Owner Drawn Font Selection ComboBox' by Girish Bharadwaj
00007 // http://www.codeguru.com/misc/font_selection_combo.shtml
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:51 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJock/Include/CJFontCombo.h $
00015  *
00016  * $History: CJFontCombo.h $
00017  *
00018  * *****************  Version 4  *****************
00019  * User: Kirk Stowell Date: 10/31/99   Time: 11:01p
00020  * Updated in $/CodeJock/Include
00021  * Overrode OnEraseBkgnd(...) and OnPaint() for flicker free drawing.
00022  *
00023  * *****************  Version 3  *****************
00024  * User: Kirk Stowell Date: 10/26/99   Time: 10:41p
00025  * Updated in $/CodeJock/Include
00026  * Made class methods virtual for inheritance purposes. Added the
00027  * DECLARE_DYNAMIC and IMPLEMENT_DYNAMIC macros to CCJFontCombo for access
00028  * to run-time information
00029  *
00030  * *****************  Version 2  *****************
00031  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00032  * Updated in $/CodeJockey/Include
00033  * Updated copyright and contact information.
00034  *
00035  * *****************  Version 1  *****************
00036  * User: Kirk Stowell Date: 7/26/99    Time: 2:11p
00037  * Created in $/CodeJockey/Include
00038  *
00039  ***************************************************************************/
00041
00042 #ifndef __CJFONTCOMBO_H__
00043 #define __CJFONTCOMBO_H__
00044
00045 #if _MSC_VER >= 1000
00046 #pragma once
00047 #endif // _MSC_VER >= 1000
00048
00050 // CCJFontCombo window
00051 class _CJX_EXT_CLASS CCJFontCombo : public CComboBox
00052 {
00053     DECLARE_DYNAMIC(CCJFontCombo)
00054
00055 // Construction
00056 public:
00057      CCJFontCombo();
00058
00059 // Attributes
00060 protected:
00061
00062     COLORREF    m_clrHilight;
00063     COLORREF    m_clrNormalText;
00064     COLORREF    m_clrHilightText;
00065     COLORREF    m_clrBkgnd;
00066
00067 // Operations
00068 public:
00069
00070     virtual int GetSelFont(LOGFONT& logFont);
00071     virtual void SetHilightColors(COLORREF clrHilight,COLORREF clrHilightText);
00072     virtual void SetNormalColors(COLORREF clrBkgnd,COLORREF clrNormalText);
00073     static BOOL CALLBACK EnumFontProc(LPLOGFONT lpLogFont, LPTEXTMETRIC lpTextMetric, short nFontType, LPHANDLE lpData);
00074
00075 protected:
00076
00077     virtual void InitializeFonts();
00078
00079 // Overrides
00080     // ClassWizard generated virtual function overrides
00081     //{{AFX_VIRTUAL(CCJFontCombo)
00082     public:
00083     virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
00084     virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
00085     protected:
00086     virtual void PreSubclassWindow();
00087     //}}AFX_VIRTUAL
00088
00089 // Implementation
00090 public:
00091      virtual ~CCJFontCombo();
00092
00093 // Generated message map functions
00094 protected:
00095
00096     //{{AFX_MSG(CCJFontCombo)
00097     afx_msg void OnDestroy();
00098     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00099     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00100     afx_msg void OnPaint();
00101     //}}AFX_MSG
00102     DECLARE_MESSAGE_MAP()
00103 };
00104
00106 //  Inline Functions
00108
00109 _CJXLIB_INLINE void CCJFontCombo::SetHilightColors( COLORREF clrHilight, COLORREF clrHilightText )
00110     { m_clrHilight = clrHilight; m_clrHilightText = clrHilightText; };
00111
00112 _CJXLIB_INLINE void CCJFontCombo::SetNormalColors( COLORREF clrBkgnd, COLORREF clrNormalText )
00113     { m_clrNormalText = clrNormalText; m_clrBkgnd = clrBkgnd; };
00114
00116
00117 //{{AFX_INSERT_LOCATION}}
00118 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00119
00120 #endif // __CJFONTCOMBO_H__
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJFrameWnd.h Source File

WinCvs/CJLib/Include/CJFrameWnd.h

Go to the documentation of this file.
00001 // CJFrameWnd.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:51 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/Include/CJFrameWnd.h $
00011  *
00012  * $History: CJFrameWnd.h $
00013  *
00014  * *****************  Version 16  *****************
00015  * User: Kirk Stowell Date: 10/29/99   Time: 12:43a
00016  * Updated in $/CodeJock/Include
00017  * Overloaded PreCreateWindow(...) for flicker free drawing.
00018  *
00019  * *****************  Version 15  *****************
00020  * User: Kirk Stowell Date: 10/26/99   Time: 10:41p
00021  * Updated in $/CodeJock/Include
00022  * Made class methods virtual for inheritance purposes.
00023  *
00024  * *****************  Version 14  *****************
00025  * User: Kirk Stowell Date: 10/14/99   Time: 6:15p
00026  * Updated in $/CodeJock/Include
00027  * Fixed bug with a document becomes the active document when the user
00028  * clicks inside a tab in the CCJTabControlBar to perform some operation.
00029  * When closing the application, MFC decides in CFrameWnd::OnClose() to
00030  * check if the 'active' document is modified before checking all other
00031  * documuents. If the active document is not modified and can close its
00032  * frame, it does not check other documents individually and shuts down
00033  * without asking the important 'modified save' questions. To fix this,
00034  * OnClose() was overriden to add a call to "SetActiveView(NULL)" just
00035  * before the base class OnClose is called. This will check all documents
00036  * asking the save question before closing the application. Thanks to
00037  * Simon Clark [spc@otleda.com] for help with this.
00038  *
00039  * *****************  Version 13  *****************
00040  * User: Kirk Stowell Date: 10/14/99   Time: 10:05a
00041  * Updated in $/CodeJock/Include
00042  * Overrode OnEraseBkgnd(...) to help to eliminate screen flicker.
00043  *
00044  * *****************  Version 12  *****************
00045  * User: Kirk Stowell Date: 9/16/99    Time: 2:35p
00046  * Updated in $/CodeJockey/Include
00047  * Fixed bug with save / restore bar state, and with saved bar size
00048  * changing whenever the application starts.
00049  *
00050  * *****************  Version 11  *****************
00051  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00052  * Updated in $/CodeJockey/Include
00053  * Updated copyright and contact information.
00054  *
00055  * *****************  Version 10  *****************
00056  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00057  * Updated in $/CodeJockey/Include
00058  *
00059  * *****************  Version 9  *****************
00060  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00061  * Updated in $/CodeJockey/Include
00062  *
00063  * *****************  Version 8  *****************
00064  * User: Kirk Stowell Date: 7/18/99    Time: 10:17p
00065  * Updated in $/CodeJockey/Include
00066  * Cleaned up inline functions, and import/export macro so that class will
00067  * be imported when linked to, and exported at compile time.
00068  *
00069  * *****************  Version 7  *****************
00070  * User: Kirk Stowell Date: 6/11/99    Time: 8:25p
00071  * Updated in $/CodeJockey/Include
00072  * Slight modification made to popup menu code.
00073  *
00074  * *****************  Version 6  *****************
00075  * User: Kirk Stowell Date: 6/09/99    Time: 8:33p
00076  * Updated in $/CodeJockey/Include
00077  * Ioannhs Stamatopoulos (Yiannhs) [ystamat@mail.datamedia.gr] - Extended
00078  * docking windows, removed ::GetSysColor(...) calls and WM_SYSCOLORCHANGE
00079  * message handler, this is now automatically handled by the base class.
00080  * Added redraw flags to the create method and modified paint and layout
00081  * handlers to reduce flicker and un-necessary command handling. Dragging
00082  * rect now reflects actual control bar docked size. Added "flat" look to
00083  * the control bars, the control bars can now use the classic DevStudio
00084  * look, or use flat gradient gripper, borders and frame buttons. Overall,
00085  * docking windows now handle dragging, docking and floating much better,
00086  * and behave more like DevStudio.
00087  *
00088  * *****************  Version 5  *****************
00089  * User: Kirk Stowell Date: 5/02/99    Time: 2:18a
00090  * Updated in $/CodeJockey/Include
00091  *
00092  * *****************  Version 4  *****************
00093  * User: Kirk Stowell Date: 5/02/99    Time: 2:13a
00094  * Updated in $/CodeJockey/Include
00095  * Re-wrote CCJMenu initialization routines with a more cleaner approach.
00096  *
00097  * *****************  Version 3  *****************
00098  * User: Kirk Stowell Date: 4/03/99    Time: 4:47p
00099  * Updated in $/CodeJockey/Include
00100  * Added comments and cleaned up code.  Added support for Brent Corkum's
00101  * BCMenu (CCJMenu), which is a replacement for the CCoolMenu class.
00102  *
00103  * *****************  Version 2  *****************
00104  * User: Kirk Stowell Date: 1/12/99    Time: 4:46p
00105  * Updated in $/CodeJockey/Include
00106  * Total re-write to add side-by-side docking support for CCJControlBar
00107  * class.
00108  *
00109  * *****************  Version 1  *****************
00110  * User: Kirk Stowell Date: 10/17/98   Time: 4:46p
00111  * Created in $/CodeJockey/Include
00112  * Initial re-write and release.
00113  *
00114  ***************************************************************************/
00116
00117 #ifndef __CJFRAMEWND_H__
00118 #define __CJFRAMEWND_H__
00119
00120 #if _MSC_VER >= 1000
00121 #pragma once
00122 #endif // _MSC_VER >= 1000
00123
00124 #include "CJMenuBar.h"
00125 #include "CJMenu.h"
00126
00127 // class forwards
00128 class CCJSizeDockBar;
00129
00130 // CCJFrameWnd is a CFrameWnd derived class which is used to
00131 // reposition toolbar layout for 3D effect, in addition to docking
00132 // methods for CCJToolBar and CCJControlBar class
00133 class _CJX_EXT_CLASS CCJFrameWnd : public CFrameWnd
00134 {
00135     DECLARE_DYNCREATE(CCJFrameWnd)
00136
00137 public:
00138
00139     // Default constructor
00140     //
00141     CCJFrameWnd();
00142
00143     // Virtual destructor
00144     //
00145     virtual ~CCJFrameWnd();
00146
00147 protected:
00148
00149     static DWORD    dwDockBarMap[4][2]; // array used for docking masks
00150     CCJMenu         m_menu;             // SDI frame menu.
00151     CCJMenuBar      m_wndMenuBar;       // menu bar
00152
00153     // Yiannhs to parameterize and the dock bar border
00154     enum DockFlatBorders {
00155         brdrAllRaised       = 0x0000,
00156         brdrFlatTop         = 0x0001,
00157         brdrFlatBottom      = 0x0002,
00158         brdrFlatLeft        = 0x0004,
00159         brdrFlatRight       = 0x0008,
00160         brdrFlatVertical    = 0x0003,
00161         brdrFlatHorizontal  = 0x000C,
00162         brdrFlatAll         = 0x000F
00163     };
00164
00165 protected:
00166
00167     // this member function is called by the framework to associate
00168     // toolbar resources with the frame menu
00169     //
00170     virtual HMENU NewMenu(
00171         // resource id for menu
00172         UINT nMenuID,
00173         // array of toolbar resource ids
00174         UINT* nToolbarIDs = NULL,
00175         // size of array.
00176         int nSize = 0);
00177
00178     // this member function is called by the framework to associate
00179     // a toolbar resource with the frame menu
00180     //
00181     virtual HMENU NewMenu(
00182         // resource id for menu
00183         UINT nMenuID,
00184         // toolbar resource
00185         UINT nToolbarID = NULL);
00186
00187 public:
00188
00189     virtual void LoadBarState(LPCTSTR lpszProfileName);
00190     virtual void SaveBarState(LPCTSTR lpszProfileName) const;
00191
00192     // this member function is called to initialize the CCJMenu
00193     //
00194     virtual BOOL InitializeMenu(
00195         // resource id for menu
00196         UINT nMenuID,
00197         // array of toolbar resource ids
00198         UINT* nToolbarIDs = NULL,
00199         // size of array.
00200         int nSize = 0);
00201
00202     // this member function is called to initialize the Menu
00203     //
00204     virtual BOOL InitializeMenu(
00205         // resource id for menu
00206         UINT nMenuID,
00207         // toolbar resource
00208         UINT nToolbarID = NULL);
00209
00210     // this member function is called to calculate the size of
00211     // a CCJControlBar
00212     //
00213     virtual void RecalcAllExcept(CCJSizeDockBar *pBar);
00214
00215     // this member function enables docking for standard
00216     // toolbar and control bars
00217     //
00218     virtual void EnableDocking(DWORD dwDockStyle);
00219
00220     // this member function enables docking for CCJControl bars only
00221     //
00222     virtual void EnableDockingSizeBar(
00223         // Specifies which sides of the frame window can serve as docking sites
00224         // for control bars. It can be one or more of the following:
00225         //
00226         // CBRS_ALIGN_TOP   Allows docking at the top of the client area.
00227         // CBRS_ALIGN_BOTTOM   Allows docking at the bottom of the client area.
00228         // CBRS_ALIGN_LEFT   Allows docking on the left side of the client area.
00229         // CBRS_ALIGN_RIGHT   Allows docking on the right side of the client area.
00230         // CBRS_ALIGN_ANY   Allows docking on any side of the client area.
00231         DWORD dwDockStyle,
00232         // enum for flat border styles.
00233         DockFlatBorders FlatFlags = brdrAllRaised );
00234
00235     // this member function will dock a CCJControlBar
00236     //
00237     virtual void DockSizeBar(
00238         // toolbar to dock
00239         CControlBar* pBar,
00240         // dockbar object usually NULL
00241         CCJSizeDockBar* pDockBar=NULL,
00242         // initial size usually NULL
00243         LPRECT lpRect=NULL);
00244
00245     // this memeber function will dock the control bar passed in
00246     // as the first argument, and dock the control bar that is passed in
00247     // as the second argument to the left of the first one.
00248     //
00249     virtual void DockControlBarLeftOf(
00250         // control bar to dock to the right of
00251         CControlBar* Bar,
00252         // already docked control bar
00253         CControlBar* LeftOf);
00254
00255 // Overrides
00256     // ClassWizard generated virtual function overrides
00257     //{{AFX_VIRTUAL(CCJFrameWnd)
00258     public:
00259     virtual void RecalcLayout(BOOL bNotify = TRUE);
00260     virtual BOOL PreTranslateMessage(MSG* pMsg);
00261     protected:
00262     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00263     virtual BOOL PreCreateWindow(CREATESTRUCT& cs, UINT nIconID);
00264     //}}AFX_VIRTUAL
00265
00266 // Generated message map functions
00267 protected:
00268     //{{AFX_MSG(CCJFrameWnd)
00269     afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
00270     afx_msg LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu);
00271     afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
00272     afx_msg void OnClose();
00273     //}}AFX_MSG
00274     DECLARE_MESSAGE_MAP()
00275 };
00276
00278
00279 //{{AFX_INSERT_LOCATION}}
00280 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00281
00282 #endif // __CJFRAMEWND_H__
00283
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJHexEdit.h Source File

WinCvs/CJLib/Include/CJHexEdit.h

Go to the documentation of this file.
00001 // CJHexEdit.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based on the article "HexEdit Control" by Andreas Saurwein [saurwein@uniwares.com]
00006 // http://www.codeguru.com/editctrl/hexeditctrl.shtml
00007 //
00009 /****************************************************************************
00010  *
00011  * $Date: 1999/11/30 21:45:51 $
00012  * $Revision: 1.1.1.1 $
00013  * $Archive: /CodeJock/Include/CJHexEdit.h $
00014  *
00015  * $History: CJHexEdit.h $
00016  *
00017  * *****************  Version 1  *****************
00018  * User: Kirk Stowell Date: 10/30/99   Time: 9:20p
00019  * Created in $/CodeJock/Include
00020  *
00021  ***************************************************************************/
00023
00024 #ifndef __CJHEXEDIT_H__
00025 #define __CJHEXEDIT_H__
00026
00027 #if _MSC_VER >= 1000
00028 #pragma once
00029 #endif // _MSC_VER >= 1000
00030
00031 // CCJHexEdit is a CEdit derived class which allows editing in hex
00032 // display format.
00033 class _CJX_EXT_CLASS CCJHexEdit : public CEdit
00034 {
00035     DECLARE_DYNAMIC(CCJHexEdit)
00036
00037 // Construction
00038 public:
00039     CCJHexEdit();
00040
00041 // Attributes
00042 public:
00043
00044     enum EDITMODE{ EDIT_NONE, EDIT_ASCII, EDIT_HIGH, EDIT_LOW } ;
00045
00046     LPBYTE      m_pData;            // pointer to data
00047     int         m_length;           // length of data
00048     int         m_topindex;         // offset of first visible byte on screen
00049     int         m_currentAddress;   // address under cursor
00050     EDITMODE    m_currentMode;      // current editing mode: address/hex/ascii
00051     int         m_selStart;         // start address of selection
00052     int         m_selEnd;           // end address of selection
00053     int         m_bpr;              // byte per row
00054     int         m_lpp;              // lines per page
00055     BOOL        m_bShowAddress;
00056     BOOL        m_bShowAscii;
00057     BOOL        m_bShowHex;
00058     BOOL        m_bAddressIsWide;
00059     BOOL        m_bNoAddressChange; // internally used
00060     BOOL        m_bHalfPage;
00061     CFont       m_Font;
00062     int         m_lineHeight;
00063     int         m_nullWidth;
00064     BOOL        m_bUpdate;
00065     int         m_offHex;
00066     int         m_offAscii;
00067     int         m_offAddress;
00068     CPoint      m_editPos;
00069
00070 // Operations
00071 public:
00072
00073     virtual int     GetData(LPBYTE p, int len);
00074     virtual void    SetData(LPBYTE p, int len);
00075     virtual CSize   GetSel(void);
00076     virtual void    SetSel(int s, int e);
00077     virtual void    SetBPR(int bpr);
00078     virtual void    SetOptions(BOOL a, BOOL h, BOOL c, BOOL w);
00079
00080 protected:
00081
00082     virtual void    ScrollIntoView(int p);
00083     virtual void    RepositionCaret(int p);
00084     virtual void    Move(int x, int y);
00085     virtual BOOL    IsSelected(void);
00086     virtual void    UpdateScrollbars(void);
00087     virtual void    CreateEditCaret(void);
00088     virtual void    CreateAddressCaret(void);
00089     virtual CPoint  CalcPos(int x, int y);
00090     virtual void    SelInsert(int s, int l);
00091     virtual void    SelDelete(int s, int e);
00092     virtual void    NormalizeSel(void);
00093
00094 // Overrides
00095     // ClassWizard generated virtual function overrides
00096     //{{AFX_VIRTUAL(CCJHexEdit)
00097     public:
00098     virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
00099     protected:
00100     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00101     //}}AFX_VIRTUAL
00102
00103 // Implementation
00104 public:
00105     virtual ~CCJHexEdit();
00106
00107 // Generated message map functions
00108 protected:
00109     //{{AFX_MSG(CCJHexEdit)
00110     afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
00111     afx_msg void OnKillFocus(CWnd* pNewWnd);
00112     afx_msg void OnPaint();
00113     afx_msg void OnSetFocus(CWnd* pOldWnd);
00114     afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
00115     afx_msg UINT OnGetDlgCode();
00116     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00117     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00118     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00119     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00120     afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00121     afx_msg void OnEditClear();
00122     afx_msg void OnEditCopy();
00123     afx_msg void OnEditCut();
00124     afx_msg void OnEditPaste();
00125     afx_msg void OnEditSelectAll();
00126     afx_msg void OnEditUndo();
00127     afx_msg void OnContextMenu(CWnd*, CPoint point);
00128     afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
00129     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00130     //}}AFX_MSG
00131     DECLARE_MESSAGE_MAP()
00132 };
00133
00135 //  Inline Functions
00137
00138 _CJXLIB_INLINE UINT CCJHexEdit::OnGetDlgCode()
00139     { return DLGC_WANTALLKEYS; }
00140
00141 _CJXLIB_INLINE void CCJHexEdit::SetOptions(BOOL a, BOOL h, BOOL c, BOOL w)
00142     { m_bShowHex = h; m_bShowAscii = c; m_bShowAddress = a; m_bAddressIsWide = w; m_bUpdate = TRUE; }
00143
00144 _CJXLIB_INLINE void CCJHexEdit::SetBPR(int bpr)
00145     { m_bpr = bpr; m_bUpdate = TRUE; }
00146
00147 _CJXLIB_INLINE BOOL CCJHexEdit::IsSelected()
00148     { return m_selStart != 0xffffffff; }
00149
00150 _CJXLIB_INLINE CSize CCJHexEdit::GetSel()
00151     { return CSize(m_selStart, m_selEnd); }
00152
00153 _CJXLIB_INLINE int CCJHexEdit::GetData(LPBYTE p, int len)
00154     { memcpy(p, m_pData, min(len, m_length)); return m_length; }
00155
00157
00158 //{{AFX_INSERT_LOCATION}}
00159 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00160
00161 #endif // __CJHEXEDIT_H__
00162
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJHtmlView.h Source File

WinCvs/CJLib/Include/CJHtmlView.h

Go to the documentation of this file.
00001 // CJHtmlView.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Copied from MFC, Visual C++ 6, to extend functionality to Visual C++ 5
00006 // users, with some ideas taken from Iuri Apollonio's article 'Doc / View -
00007 // Using HtmlView apart from Tecno Preview' http://www.codeguru.com/doc_view/htmlview.shtml
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:51 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJock/Include/CJHtmlView.h $
00015  *
00016  * $History: CJHtmlView.h $
00017  *
00018  * *****************  Version 9  *****************
00019  * User: Kirk Stowell Date: 11/01/99   Time: 8:53p
00020  * Updated in $/CodeJock/Include
00021  *
00022  * *****************  Version 8  *****************
00023  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00024  * Updated in $/CodeJockey/Include
00025  * Updated copyright and contact information.
00026  *
00027  * *****************  Version 7  *****************
00028  * User: Kirk Stowell Date: 7/31/99    Time: 4:27p
00029  * Updated in $/CodeJockey/Include
00030  *
00031  * *****************  Version 5  *****************
00032  * User: Kirk Stowell Date: 7/25/99    Time: 1:29a
00033  * Updated in $/CodeJockey/Include
00034  *
00035  * *****************  Version 4  *****************
00036  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00037  * Updated in $/CodeJockey/Include
00038  *
00039  * *****************  Version 3  *****************
00040  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00041  * Updated in $/CodeJockey/Include
00042  *
00043  * *****************  Version 2  *****************
00044  * User: Kirk Stowell Date: 7/18/99    Time: 10:17p
00045  * Updated in $/CodeJockey/Include
00046  * Cleaned up inline functions, and import/export macro so that class will
00047  * be imported when linked to, and exported at compile time.
00048  *
00049  * *****************  Version 1  *****************
00050  * User: Kirk Stowell Date: 7/14/99    Time: 10:29p
00051  * Created in $/CodeJockey/Include
00052  * Copied from MFC v6 and techno preview for v5. Added to extend
00053  * functionality to Visual C++ 5.0 users.
00054  *
00055  ***************************************************************************/
00057
00058 #ifndef __CJHTMLVIEW_H__
00059 #define __CJHTMLVIEW_H__
00060
00061 #include <docobj.h>
00062 #include <shlobj.h>
00063 #include <exdisp.h>
00064 #include <afxconv.h>
00065
00066 #if _MSC_VER >= 1000
00067 #pragma once
00068 #endif // _MSC_VER >= 1000
00069
00070 // The CCJHtmlView class provides the functionality of the WebBrowser control
00071 // within the context of MFC's document/view architecture. The WebBrowser control
00072 // is a window in which the user can browse sites on the World Wide Web, as well
00073 // as folders in the local file system and on a network. The WebBrowser control
00074 // supports hyperlinking, Uniform Resource Locator (URL) navigation, and maintains
00075 // a history list.
00076 class _CJX_EXT_CLASS CCJHtmlView : public CFormView
00077 {
00078     DECLARE_DYNCREATE(CCJHtmlView)
00079     DECLARE_EVENTSINK_MAP()
00080
00081 protected: // create from serialization only
00082
00083     CCJHtmlView();
00084
00085     virtual ~CCJHtmlView();
00086
00087 // Attributes
00088 public:
00089
00090     CString GetType() const;
00091     long GetLeft() const;
00092     void SetLeft(long nNewValue);
00093     long GetTop() const;
00094     void SetTop(long nNewValue);
00095     long GetHeight() const;
00096     void SetHeight(long nNewValue);
00097     void SetVisible(BOOL bNewValue);
00098     BOOL GetVisible() const;
00099     CString GetLocationName() const;
00100     READYSTATE GetReadyState() const;
00101     BOOL GetOffline() const;
00102     void SetOffline(BOOL bNewValue);
00103     BOOL GetSilent() const;
00104     void SetSilent(BOOL bNewValue);
00105     BOOL GetTopLevelContainer() const;
00106     CString GetLocationURL() const;
00107     BOOL GetBusy() const;
00108     LPDISPATCH GetApplication() const;
00109     LPDISPATCH GetParentBrowser() const;
00110     LPDISPATCH GetContainer() const;
00111     LPDISPATCH GetHtmlDocument() const;
00112     CString GetFullName() const;
00113     int GetToolBar() const;
00114     void SetToolBar(int nNewValue);
00115     BOOL GetMenuBar() const;
00116     void SetMenuBar(BOOL bNewValue);
00117     BOOL GetFullScreen() const;
00118     void SetFullScreen(BOOL bNewValue);
00119     OLECMDF QueryStatusWB(OLECMDID cmdID) const;
00120     BOOL GetRegisterAsBrowser() const;
00121     void SetRegisterAsBrowser(BOOL bNewValue);
00122     BOOL GetRegisterAsDropTarget() const;
00123     void SetRegisterAsDropTarget(BOOL bNewValue);
00124     BOOL GetTheaterMode() const;
00125     void SetTheaterMode(BOOL bNewValue);
00126     BOOL GetAddressBar() const;
00127     void SetAddressBar(BOOL bNewValue);
00128     BOOL GetStatusBar() const;
00129     void SetStatusBar(BOOL bNewValue);
00130
00131 // Operations
00132 public:
00133
00134     void GoBack();
00135     void GoForward();
00136     void GoHome();
00137     void GoSearch();
00138     void Navigate(LPCTSTR URL, DWORD dwFlags = 0,
00139         LPCTSTR lpszTargetFrameName = NULL,
00140         LPCTSTR lpszHeaders = NULL, LPVOID lpvPostData = NULL,
00141         DWORD dwPostDataLen = 0);
00142     void Navigate2(LPITEMIDLIST pIDL, DWORD dwFlags = 0,
00143         LPCTSTR lpszTargetFrameName = NULL);
00144     void Navigate2(LPCTSTR lpszURL, DWORD dwFlags = 0,
00145         LPCTSTR lpszTargetFrameName = NULL, LPCTSTR lpszHeaders = NULL,
00146         LPVOID lpvPostData = NULL, DWORD dwPostDataLen = 0);
00147     void Navigate2(LPCTSTR lpszURL, DWORD dwFlags,
00148         CByteArray& baPostedData,
00149         LPCTSTR lpszTargetFrameName = NULL, LPCTSTR lpszHeader = NULL);
00150     void Refresh();
00151     void Refresh2(int nLevel);
00152     void Stop();
00153     void PutProperty(LPCTSTR lpszProperty, const VARIANT& vtValue);
00154     void PutProperty(LPCTSTR lpszPropertyName, double dValue);
00155     void PutProperty(LPCTSTR lpszPropertyName, LPCTSTR lpszValue);
00156     void PutProperty(LPCTSTR lpszPropertyName, long lValue);
00157     void PutProperty(LPCTSTR lpszPropertyName, short nValue);
00158     BOOL GetProperty(LPCTSTR lpszProperty, CString& strValue);
00159     COleVariant GetProperty(LPCTSTR lpszProperty);
00160     void ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, VARIANT* pvaIn,
00161         VARIANT* pvaOut);
00162     BOOL LoadFromResource(LPCTSTR lpszResource);
00163     BOOL LoadFromResource(UINT nRes);
00164
00165 // Overrides
00166 public:
00167
00168     // ClassWizard generated virtual function overrides
00169     //{{AFX_VIRTUAL(CCJHtmlView)
00170     public:
00171     virtual void OnDraw(CDC* pDC);
00172     virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
00173     virtual void OnNavigateComplete2(LPCTSTR strURL);
00174     virtual void OnBeforeNavigate2(LPCTSTR lpszURL, DWORD nFlags, LPCTSTR lpszTargetFrameName, CByteArray& baPostedData, LPCTSTR lpszHeaders, BOOL* pbCancel);
00175     virtual void OnStatusTextChange(LPCTSTR lpszText);
00176     virtual void OnProgressChange(long nProgress, long nProgressMax);
00177     virtual void OnCommandStateChange(long nCommand, BOOL bEnable);
00178     virtual void OnDownloadBegin();
00179     virtual void OnDownloadComplete();
00180     virtual void OnTitleChange(LPCTSTR lpszText);
00181     virtual void OnPropertyChange(LPCTSTR lpszProperty);
00182     virtual void OnNewWindow2(LPDISPATCH* ppDisp, BOOL* Cancel);
00183     virtual void OnDocumentComplete(LPCTSTR lpszURL);
00184     virtual void OnQuit();
00185     virtual void OnVisible(BOOL bVisible);
00186     virtual void OnToolBar(BOOL bToolBar);
00187     virtual void OnMenuBar(BOOL bMenuBar);
00188     virtual void OnStatusBar(BOOL bStatusBar);
00189     virtual void OnFullScreen(BOOL bFullScreen);
00190     virtual void OnTheaterMode(BOOL bTheaterMode);
00191     protected:
00192     virtual void NavigateComplete2(LPDISPATCH pDisp, VARIANT* URL);
00193     virtual void BeforeNavigate2(LPDISPATCH pDisp, VARIANT* URL, VARIANT* Flags, VARIANT* TargetFrameName, VARIANT* PostData, VARIANT* Headers,   BOOL* Cancel);
00194     virtual void DocumentComplete(LPDISPATCH pDisp, VARIANT* URL);
00195     //}}AFX_VIRTUAL
00196
00197 // Implementation
00198 public:
00199
00200     CWnd m_wndBrowser;
00201
00202 #ifdef _DEBUG
00203     virtual void AssertValid() const;
00204     virtual void Dump(CDumpContext& dc) const;
00205 #endif
00206
00207 protected:
00208
00209     IWebBrowser2* m_pBrowserApp;
00210
00211 // Generated message map functions
00212 protected:
00213     //{{AFX_MSG(CCJHtmlView)
00214     afx_msg void OnSize(UINT nType, int cx, int cy);
00215     afx_msg void OnPaint();
00216     afx_msg void OnDestroy();
00217     afx_msg void OnFilePrint();
00218     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00219     //}}AFX_MSG
00220     DECLARE_MESSAGE_MAP()
00221 };
00222
00224 // Inline functions
00226
00227 _CJXLIB_INLINE void CCJHtmlView::SetRegisterAsBrowser(BOOL bNewValue)
00228     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_RegisterAsBrowser((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }
00229
00230 _CJXLIB_INLINE void CCJHtmlView::SetRegisterAsDropTarget(BOOL bNewValue)
00231     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_RegisterAsDropTarget((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }
00232
00233 _CJXLIB_INLINE void CCJHtmlView::SetTheaterMode(BOOL bNewValue)
00234     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_TheaterMode((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }
00235
00236 _CJXLIB_INLINE void CCJHtmlView::SetVisible(BOOL bNewValue)
00237     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Visible((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }
00238
00239 _CJXLIB_INLINE void CCJHtmlView::SetMenuBar(BOOL bNewValue)
00240     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_MenuBar((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }
00241
00242 _CJXLIB_INLINE void CCJHtmlView::SetToolBar(int nNewValue)
00243     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_ToolBar(nNewValue); }
00244
00245 _CJXLIB_INLINE void CCJHtmlView::SetOffline(BOOL bNewValue)
00246     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Offline((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }
00247
00248 _CJXLIB_INLINE void CCJHtmlView::SetSilent(BOOL bNewValue)
00249     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Silent((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }
00250
00251 _CJXLIB_INLINE void CCJHtmlView::GoBack()
00252     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoBack(); }
00253
00254 _CJXLIB_INLINE void CCJHtmlView::GoForward()
00255     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoForward(); }
00256
00257 _CJXLIB_INLINE void CCJHtmlView::GoHome()
00258     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoHome(); }
00259
00260 _CJXLIB_INLINE void CCJHtmlView::GoSearch()
00261     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoSearch(); }
00262
00263 _CJXLIB_INLINE void CCJHtmlView::Refresh()
00264     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->Refresh(); }
00265
00266 _CJXLIB_INLINE void CCJHtmlView::Refresh2(int nLevel)
00267     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->Refresh2(COleVariant((long) nLevel, VT_I4)); }
00268
00269 _CJXLIB_INLINE void CCJHtmlView::Stop()
00270     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->Stop(); }
00271
00272 _CJXLIB_INLINE void CCJHtmlView::SetFullScreen(BOOL bNewValue)
00273     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_FullScreen((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }
00274
00275 _CJXLIB_INLINE void CCJHtmlView::SetAddressBar(BOOL bNewValue)
00276     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_AddressBar((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }
00277
00278 _CJXLIB_INLINE void CCJHtmlView::SetHeight(long nNewValue)
00279     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Height(nNewValue); }
00280
00281 _CJXLIB_INLINE void CCJHtmlView::PutProperty(LPCTSTR lpszPropertyName, long lValue)
00282     { ASSERT(m_pBrowserApp != NULL); ASSERT(m_pBrowserApp != NULL); PutProperty(lpszPropertyName, COleVariant(lValue, VT_UI4)); }
00283
00284 _CJXLIB_INLINE void CCJHtmlView::PutProperty(LPCTSTR lpszPropertyName, short nValue)
00285     { ASSERT(m_pBrowserApp != NULL); ASSERT(m_pBrowserApp != NULL); PutProperty(lpszPropertyName, COleVariant(nValue, VT_UI2)); }
00286
00287 _CJXLIB_INLINE void CCJHtmlView::PutProperty(LPCTSTR lpszPropertyName, LPCTSTR lpszValue)
00288     { ASSERT(m_pBrowserApp != NULL); ASSERT(m_pBrowserApp != NULL); PutProperty(lpszPropertyName, COleVariant(lpszValue, VT_BSTR)); }
00289
00290 _CJXLIB_INLINE void CCJHtmlView::PutProperty(LPCTSTR lpszPropertyName, double dValue)
00291     { ASSERT(m_pBrowserApp != NULL); ASSERT(m_pBrowserApp != NULL); PutProperty(lpszPropertyName, COleVariant(dValue)); }
00292
00293 _CJXLIB_INLINE void CCJHtmlView::SetTop(long nNewValue)
00294     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Top(nNewValue); }
00295
00296 _CJXLIB_INLINE void CCJHtmlView::SetLeft(long nNewValue)
00297     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Left(nNewValue); }
00298
00299 _CJXLIB_INLINE void CCJHtmlView::SetStatusBar(BOOL bNewValue)
00300     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_StatusBar((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }
00301
00303
00304 //{{AFX_INSERT_LOCATION}}
00305 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00306
00307 #endif // __CJHTMLVIEW_H__
00308
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJHyperLink.h Source File

WinCvs/CJLib/Include/CJHyperLink.h

Go to the documentation of this file.
00001 // CJHyperLink.h : header file
00002 //
00003 //
00004 // CJHyperLink static control. Will open the default browser with the given URL
00005 // when the user clicks on the link.
00006 //
00007 // Copyright Chris Maunder, 1997
00008 // Feel free to use and distribute. May not be sold for profit.
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:51 $
00013  * $Revision: 1.1.1.2 $
00014  * $Archive: /CodeJock/Include/CJHyperLink.h $
00015  *
00016  * $History: CJHyperLink.h $
00017  *
00018  * *****************  Version 6  *****************
00019  * User: Kirk Stowell Date: 10/26/99   Time: 10:42p
00020  * Updated in $/CodeJock/Include
00021  * Made class methods virtual for inheritance purposes.
00022  *
00023  * *****************  Version 5  *****************
00024  * User: Kirk Stowell Date: 10/14/99   Time: 12:26p
00025  * Updated in $/CodeJock/Include
00026  * Added source control history to file header.
00027  *
00028  ***************************************************************************/
00030
00031 #ifndef __CJHYPERLINK_H__
00032 #define __CJHYPERLINK_H__
00033
00034 #if _MSC_VER >= 1000
00035 #pragma once
00036 #endif // _MSC_VER >= 1000
00037
00038 // A CStatic derived classc will open the default browser with the
00039 // given URL when the user clicks on the link.
00040 class _CJX_EXT_CLASS CCJHyperLink : public CStatic
00041 {
00042 // Construction/destruction
00043 public:
00044     CCJHyperLink();
00045     virtual ~CCJHyperLink();
00046
00047 // Attributes
00048 public:
00049
00050 // Operations
00051 public:
00052
00053     virtual void SetURL(CString strURL);
00054     virtual CString GetURL() const;
00055
00056     virtual void SetColors(COLORREF crLinkColor, COLORREF crVisitedColor,
00057                     COLORREF crHoverColor = -1);
00058     virtual COLORREF GetLinkColor() const;
00059     virtual COLORREF GetVisitedColor() const;
00060     virtual COLORREF GetHoverColor() const;
00061
00062     virtual void SetVisited(BOOL bVisited = TRUE);
00063     virtual BOOL GetVisited() const;
00064
00065     virtual void SetLinkCursor(HCURSOR hCursor);
00066     virtual HCURSOR GetLinkCursor() const;
00067
00068     virtual void SetUnderline(BOOL bUnderline = TRUE);
00069     virtual BOOL GetUnderline() const;
00070
00071     virtual void SetAutoSize(BOOL bAutoSize = TRUE);
00072     virtual BOOL GetAutoSize() const;
00073
00074     virtual HINSTANCE GotoURL(LPCTSTR url, int showcmd);
00075
00076 // Overrides
00077     // ClassWizard generated virtual function overrides
00078     //{{AFX_VIRTUAL(CCJHyperLink)
00079     public:
00080     virtual BOOL PreTranslateMessage(MSG* pMsg);
00081     protected:
00082     virtual void PreSubclassWindow();
00083     //}}AFX_VIRTUAL
00084
00085 // Implementation
00086 protected:
00087     virtual void ReportError(int nError);
00088     virtual LONG GetRegKey(HKEY key, LPCTSTR subkey, LPTSTR retdata);
00089     virtual void PositionWindow();
00090     virtual void SetDefaultCursor();
00091
00092 // Protected attributes
00093 protected:
00094     COLORREF m_crLinkColor, m_crVisitedColor;     // Hyperlink Colors
00095     COLORREF m_crHoverColor;                       // Hover Color
00096     BOOL     m_bOverControl;                        // cursor over control?
00097     BOOL     m_bVisited;                            // Has it been visited?
00098     BOOL     m_bUnderline;                          // underline hyperlink?
00099     BOOL     m_bAdjustToFit;                        // Adjust window size to fit text?
00100     CString  m_strURL;                              // hyperlink URL
00101     CFont    m_Font;                                // Underline font if necessary
00102     HCURSOR  m_hLinkCursor;                         // Cursor for hyperlink
00103     CToolTipCtrl m_ToolTip;                         // The tooltip
00104
00105     // Generated message map functions
00106 protected:
00107     //{{AFX_MSG(CCJHyperLink)
00108     afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
00109     afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
00110     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00111     //}}AFX_MSG
00112     afx_msg void OnClicked();
00113     DECLARE_MESSAGE_MAP()
00114 };
00115
00117
00118 //{{AFX_INSERT_LOCATION}}
00119 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00120
00121 #endif // __CJHYPERLINK_H__
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJLibrary.h Source File

WinCvs/CJLib/Include/CJLibrary.h

Go to the documentation of this file.
00001 // CJLibrary.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:51 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/Include/CJLibrary.h $
00011  *
00012  * $History: CJLibrary.h $
00013  *
00014  * *****************  Version 15  *****************
00015  * User: Kirk Stowell Date: 10/30/99   Time: 9:39p
00016  * Updated in $/CodeJock/Include
00017  * Added includes for CJHexEdit and CJListBox.
00018  *
00019  * *****************  Version 14  *****************
00020  * User: Kirk Stowell Date: 10/26/99   Time: 10:57p
00021  * Updated in $/CodeJock/Include
00022  * Added includes for CCJMemFile, CCJStatusBar and CCJLogoPane.
00023  *
00024  * *****************  Version 13  *****************
00025  * User: Kirk Stowell Date: 10/14/99   Time: 7:22p
00026  * Updated in $/CodeJock/Include
00027  * Updated for 6.09 release.
00028  *
00029  * *****************  Version 12  *****************
00030  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00031  * Updated in $/CodeJockey/Include
00032  * Updated copyright and contact information.
00033  *
00034  * *****************  Version 11  *****************
00035  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00036  * Updated in $/CodeJockey/Include
00037  * Added Unicode compliance, thanks to Barry Burton for his help with
00038  * this.
00039  *
00040  *
00041  * *****************  Version 9  *****************
00042  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00043  * Updated in $/CodeJockey/Include
00044  *
00045  * *****************  Version 8  *****************
00046  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00047  * Updated in $/CodeJockey/Include
00048  *
00049  * *****************  Version 7  *****************
00050  * User: Kirk Stowell Date: 7/25/99    Time: 12:15a
00051  * Updated in $/CodeJockey/Include
00052  *
00053  * *****************  Version 6  *****************
00054  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00055  * Updated in $/CodeJockey/Include
00056  *
00057  * *****************  Version 5  *****************
00058  * User: Kirk Stowell Date: 7/18/99    Time: 10:19p
00059  * Updated in $/CodeJockey/Include
00060  * Cleaned up import/export macro so that class will be imported when
00061  * linked to, and exported at compile time.
00062  *
00063  * *****************  Version 4  *****************
00064  * User: Kirk Stowell Date: 7/14/99    Time: 10:18p
00065  * Updated in $/CodeJockey/Include
00066  * Added additional class header files.
00067  *
00068  * *****************  Version 3  *****************
00069  * User: Kirk Stowell Date: 6/26/99    Time: 8:32p
00070  * Updated in $/CodeJockey/Include
00071  * Added include for class CCJMDIChildWnd.
00072  *
00073  * *****************  Version 2  *****************
00074  * User: Kirk Stowell Date: 6/25/99    Time: 12:04p
00075  * Updated in $/CodeJockey/Include
00076  * Newly added file which supports CJLibrary includes for both Visual C++
00077  * 5 and 6
00078  *
00079  ***************************************************************************/
00081
00082 #ifndef __CJLIBRARY_H__
00083 #define __CJLIBRARY_H__
00084
00085 #if _MSC_VER >= 1000
00086 #pragma once
00087 #endif // _MSC_VER >= 1000
00088
00089 #if _MSC_VER < 1200
00090 #define _VC_VERSION_5
00091 #endif
00092
00093 #ifndef _CJX_EXT_CLASS
00094 #ifdef _AFXDLL
00095 #define _CJX_EXT_CLASS  AFX_CLASS_IMPORT // Always import CJLibrary files...
00096 #else
00097 #define _CJX_EXT_CLASS  // not used with static builds.
00098 #endif
00099 #endif // _CJX_EXT_CLASS
00100
00101 #ifndef _CJXLIB_INLINE
00102 #define _CJXLIB_INLINE inline
00103 #endif // _CJXLIB_INLINE
00104
00105 #ifndef __AFXTEMPL_H__
00106 #include <afxtempl.h>
00107 #endif
00108
00109 #ifndef __AFXPRIV_H__
00110 #include <afxpriv.h>
00111 #endif
00112
00113 #include <..\src\afximpl.h>
00114
00115 #ifndef __CJBROWSEEDIT_H__
00116 #include "CJBrowseEdit.h"
00117 #endif
00118
00119 #ifndef __CJCAPTION_H__
00120 #include "CJCaption.h"
00121 #endif
00122
00123 #ifndef __CJCAPTIONPOPUPWND_H__
00124 #include "CJCaptionPopupWnd.h"
00125 #endif
00126
00127 #ifndef __CJCOLORPICKER_H__
00128 #include "CJColorPicker.h"
00129 #endif
00130
00131 #ifndef __CJCOLORPOPUP_H__
00132 #include "CJColorPopup.h"
00133 #endif
00134
00135 #ifndef __CJCOMBOBOXEX_H__
00136 #include "CJComboBoxEx.h"
00137 #endif
00138
00139 #ifndef __CJCONTROLBAR_H__
00140 #include "CJControlBar.h"
00141 #endif
00142
00143 #ifndef __CJDATETIMECTRL_H__
00144 #include "CJDateTimeCtrl.h"
00145 #endif
00146
00147 #ifndef __CJDOCKBAR_H__
00148 #include "CJDockBar.h"
00149 #endif
00150
00151 #ifndef __CJDOCKCONTEXT_H__
00152 #include "CJDockContext.h"
00153 #endif
00154
00155 #ifndef __CJEXPLORERBAR_H__
00156 #include "CJExplorerBar.h"
00157 #endif
00158
00159 #ifndef __CJFLATBUTTON_H__
00160 #include "CJFlatButton.h"
00161 #endif
00162
00163 #ifndef __CJFLATCOMBOBOX_H__
00164 #include "CJFlatComboBox.h"
00165 #endif
00166
00167 #ifndef __CJFLATHEADERCTRL_H__
00168 #include "CJFlatHeaderCtrl.h"
00169 #endif
00170
00171 #ifndef __CJFLATSPLITTERWND_H__
00172 #include "CJFlatSplitterWnd.h"
00173 #endif
00174
00175 #ifndef __CCJFLATTABCTRL_H__
00176 #include "CJFlatTabCtrl.h"
00177 #endif
00178
00179 #ifndef __CJFONTCOMBO_H__
00180 #include "CJFontCombo.h"
00181 #endif
00182
00183 #ifndef __CJFRAMEWND_H__
00184 #include "CJFrameWnd.h"
00185 #endif
00186
00187 #ifndef __CJHEXEDIT_H__
00188 #include "CJHexEdit.h"
00189 #endif
00190
00191 #ifndef __CJHTMLVIEW_H__
00192 #include "CJHtmlView.h"
00193 #endif
00194
00195 #ifndef __CJHYPERLINK_H__
00196 #include "CJHyperLink.h"
00197 #endif
00198
00199 #ifndef __CJLISTBOX_H__
00200 #include "CJListBox.h"
00201 #endif
00202
00203 #ifndef __CJLISTCTRL_H__
00204 #include "CJListCtrl.h"
00205 #endif
00206
00207 #ifndef __CJLISTVIEW_H__
00208 #include "CJListView.h"
00209 #endif
00210
00211 #ifndef __CJLOGOPANE_H__
00212 #include "CJLogoPane.h"
00213 #endif
00214
00215 #ifndef __CJMASKEDIT_H__
00216 #include "CJMaskEdit.h"
00217 #endif
00218
00219 #ifndef __CJMDICHILDWND_H__
00220 #include "CJMDIChildWnd.h"
00221 #endif
00222
00223 #ifndef __CJMDIFRAMEWND_H__
00224 #include "CJMDIFrameWnd.h"
00225 #endif
00226
00227 #ifndef __CJMEMFILE_H__
00228 #include "CJMemFile.h"
00229 #endif
00230
00231 #ifndef __CJMENU_H__
00232 #include "CJMenu.h"        // CCJMenu class declaration
00233 #endif
00234
00235 #ifndef __CJMENUBAR_H__
00236 #include "CJMenuBar.h"
00237 #endif
00238
00239 #ifndef __CJMETAFILEBUTTON_H__
00240 #include "CJMetaFileButton.h"
00241 #endif
00242
00243 #ifndef __CJMINIDOCKFRAMEWND_H__
00244 #include "CJMiniDockFrameWnd.h"
00245 #endif
00246
00247 #ifndef __CJOUTLOOKBAR_H__
00248 #include "CJOutlookBar.h"
00249 #endif
00250
00251 #ifndef __CJPAGERCTRL_H__
00252 #include "CJPagerCtrl.h"
00253 #endif
00254
00255 #ifndef __CJREBAR_H__
00256 #include "CJReBar.h"
00257 #endif
00258
00259 #ifndef __CJREBARCTRL_H__
00260 #include "CJReBarCtrl.h"
00261 #endif
00262
00263 #ifndef __CJSHELL_H__
00264 #include "CJShell.h"
00265 #endif
00266
00267 #ifndef __CJSHELLLIST_H__
00268 #include "CJShellList.h"
00269 #endif
00270
00271 #ifndef __CJSHELLTREE_H__
00272 #include "CJShellTree.h"
00273 #endif
00274
00275 #ifndef __CJSIZEDOCKBAR_H__
00276 #include "CJSizeDockBar.h"
00277 #endif
00278
00279 #ifndef __CJSORTCLASS_H__
00280 #include "CJSortClass.h"
00281 #endif
00282
00283 #ifndef __CJSTATUSBAR_H__
00284 #include "CJStatusBar.h"
00285 #endif
00286
00287 #ifndef __CJTABCTRL_H__
00288 #include "CJTabCtrl.h"
00289 #endif
00290
00291 #ifndef __CJTABCTRLBAR_H__
00292 #include "CJTabCtrlBar.h"
00293 #endif
00294
00295 #ifndef __CJTABVIEW_H__
00296 #include "CJTabView.h"
00297 #endif
00298
00299 #ifndef __CJTOOLBAR_H__
00300 #include "CJToolBar.h"
00301 #endif
00302
00303 #ifndef __CCJTOOLBARBASE_H__
00304 #include "CJToolBarBase.h"
00305 #endif
00306
00307 #ifndef __CJTOOLBARCTRL_H__
00308 #include "CJToolBarCtrl.h"
00309 #endif
00310
00311 #ifndef __CJTREECTRL_H__
00312 #include "CJTreeCtrl.h"
00313 #endif
00314
00315 #ifndef __CJWINDOWPLACEMENT_H__
00316 #include "CJWindowPlacement.h"
00317 #endif
00318
00319 #ifndef __GFXGROUPEDIT_H__
00320 #include "GfxGroupEdit.h"
00321 #endif
00322
00323 #ifndef __GFXOUTBARCTRL_H__
00324 #include "GfxOutBarCtrl.h"
00325 #endif
00326
00327 #ifndef __GFXSPLITTERWND_H__
00328 #include "GfxSplitterWnd.h"
00329 #endif
00330
00331 #define _delete(p){if(p){delete p;p=NULL;}}
00332
00333 #ifdef _AFXDLL
00334     #ifdef _DEBUG
00335         #if defined(_UNICODE)
00336             #define _CJX_COMMENT "CJ609Libud.lib"
00337             #define _CJX_MESSAGE "Automatically linking with CJ609Libud.dll"
00338         #else
00339             #define _CJX_COMMENT "CJ609Libd.lib"
00340             #define _CJX_MESSAGE "Automatically linking with CJ609Libd.dll"
00341         #endif
00342     #else
00343         #if defined(_UNICODE)
00344             #define _CJX_COMMENT "CJ609Libu.lib"
00345             #define _CJX_MESSAGE "Automatically linking with CJ609Libu.dll"
00346         #else
00347             #define _CJX_COMMENT "CJ609Lib.lib"
00348             #define _CJX_MESSAGE "Automatically linking with CJ609Lib.dll"
00349         #endif
00350     #endif
00351 #else
00352     #ifdef _DEBUG
00353         #if defined(_UNICODE)
00354             #define _CJX_COMMENT "CJ609LibStaticud.lib"
00355             #define _CJX_MESSAGE "Automatically linking with CJ609LibStaticud.lib"
00356         #else
00357             #define _CJX_COMMENT "CJ609LibStaticd.lib"
00358             #define _CJX_MESSAGE "Automatically linking with CJ609LibStaticd.lib"
00359         #endif
00360     #else
00361         #if defined(_UNICODE)
00362             #define _CJX_COMMENT "CJ609LibStaticu.lib"
00363             #define _CJX_MESSAGE "Automatically linking with CJ609LibStaticu.lib"
00364         #else
00365             #define _CJX_COMMENT "CJ609LibStatic.lib"
00366             #define _CJX_MESSAGE "Automatically linking with CJ609LibStatic.lib"
00367         #endif
00368     #endif
00369 #endif
00370
00371 #pragma comment(lib, _CJX_COMMENT)
00372 #pragma message(_CJX_MESSAGE)
00373
00374 #endif // __CJLIBRARY_H__
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJListBox.h Source File

WinCvs/CJLib/Include/CJListBox.h

Go to the documentation of this file.
00001 // CJListBox.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:51 $
00009  * $Revision: 1.1.1.1 $
00010  * $Archive: /CodeJock/Include/CJListBox.h $
00011  *
00012  * $History: CJListBox.h $
00013  *
00014  * *****************  Version 1  *****************
00015  * User: Kirk Stowell Date: 10/30/99   Time: 9:36p
00016  * Created in $/CodeJock/Include
00017  *
00018  ***************************************************************************/
00020
00021 #ifndef __CJLISTBOX_H__
00022 #define __CJLISTBOX_H__
00023
00024 #if _MSC_VER >= 1000
00025 #pragma once
00026 #endif // _MSC_VER >= 1000
00027
00028 // CCJListBox is a CListBox derived class which creates a
00029 // flicker free listbox control.
00030 class _CJX_EXT_CLASS CCJListBox : public CListBox
00031 {
00032     DECLARE_DYNAMIC(CCJListBox)
00033
00034 // Construction
00035 public:
00036     CCJListBox();
00037
00038 // Attributes
00039 public:
00040
00041 // Operations
00042 public:
00043
00044 // Overrides
00045     // ClassWizard generated virtual function overrides
00046     //{{AFX_VIRTUAL(CCJListBox)
00047     //}}AFX_VIRTUAL
00048
00049 // Implementation
00050 public:
00051     virtual ~CCJListBox();
00052
00053 // Generated message map functions
00054 protected:
00055     //{{AFX_MSG(CCJListBox)
00056     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00057     afx_msg void OnPaint();
00058     //}}AFX_MSG
00059     DECLARE_MESSAGE_MAP()
00060 };
00061
00063
00064 //{{AFX_INSERT_LOCATION}}
00065 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00066
00067 #endif // __CJLISTBOX_H__
00068
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJListCtrl.h Source File

WinCvs/CJLib/Include/CJListCtrl.h

Go to the documentation of this file.
00001 // CJListCtrl.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based on the CListView articles from http://www.codeguru.com/listview
00006 //
00008 /****************************************************************************
00009  *
00010  * $Date: 1999/11/30 21:45:51 $
00011  * $Revision: 1.1.1.2 $
00012  * $Archive: /CodeJock/Include/CJListCtrl.h $
00013  *
00014  * $History: CJListCtrl.h $
00015  *
00016  * *****************  Version 10  *****************
00017  * User: Kirk Stowell Date: 10/30/99   Time: 7:13p
00018  * Updated in $/CodeJock/Include
00019  * Made m_bAscending protected rather than private for access in derived
00020  * classes.
00021  *
00022  * *****************  Version 9  *****************
00023  * User: Kirk Stowell Date: 10/30/99   Time: 2:22p
00024  * Updated in $/CodeJock/Include
00025  * Overrode OnPaint() and  OnEraseBkgnd(...) for flicker free drawing.
00026  *
00027  * *****************  Version 8  *****************
00028  * User: Kirk Stowell Date: 10/26/99   Time: 10:42p
00029  * Updated in $/CodeJock/Include
00030  * Made class methods virtual for inheritance purposes.
00031  *
00032  * *****************  Version 7  *****************
00033  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00034  * Updated in $/CodeJockey/Include
00035  *
00036  * *****************  Version 6  *****************
00037  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00038  * Updated in $/CodeJockey/Include
00039  *
00040  * *****************  Version 5  *****************
00041  * User: Kirk Stowell Date: 7/18/99    Time: 10:14p
00042  * Updated in $/CodeJockey/Include
00043  * Cleaned up inline functions, and import/export macro so that class will
00044  * be imported when linked to, and exported at compile time.
00045  *
00046  * *****************  Version 4  *****************
00047  * User: Kirk Stowell Date: 6/12/99    Time: 3:15a
00048  * Updated in $/CodeJockey/Include
00049  * Cleaned up initialization, sorting and column info saving. Removed sort
00050  * functions, which were replaced with the virtual function SortList(...).
00051  * Override this function in your derived class to perform custom sorting.
00052  * See CCJShellList for an implementation of this virtual function.
00053  *
00054  * *****************  Version 3  *****************
00055  * User: Kirk Stowell Date: 4/03/99    Time: 8:38p
00056  * Updated in $/CodeJockey/Include
00057  * Added comments and cleaned up code.
00058  *
00059  * *****************  Version 2  *****************
00060  * User: Kirk Stowell Date: 3/03/99    Time: 8:37p
00061  * Updated in $/CodeJockey/Include
00062  * Added InitializeFlatHeader() in order to initialize the list control
00063  * manually.
00064  *
00065  * *****************  Version 1  *****************
00066  * User: Kirk Stowell Date: 1/16/99    Time: 8:37p
00067  * Created in $/CodeJockey/Include
00068  * Initial release.
00069  *
00070  ***************************************************************************/
00072
00073 #ifndef __CJLISTCTRL_H__
00074 #define __CJLISTCTRL_H__
00075
00076 #if _MSC_VER > 1000
00077 #pragma once
00078 #endif // _MSC_VER > 1000
00079
00080 class CCJFlatHeaderCtrl;
00081
00082 // CCJListCtrl is a CListCtrl derived class which implements a
00083 // flat header and generic sorting routines.
00084 class _CJX_EXT_CLASS CCJListCtrl : public CListCtrl
00085 {
00086     DECLARE_DYNAMIC(CCJListCtrl)
00087
00088 public:
00089
00090     // Default constructor
00091     //
00092     CCJListCtrl();
00093
00094     // Virtual destructor
00095     //
00096     virtual ~CCJListCtrl();
00097
00098 protected:
00099
00100     int                 m_nMinColWidth;     // minimum width for columns
00101     int                 m_nMaxColWidth;     // maximum width for columns
00102     int                 m_nSortedCol;       // index of currently selected column
00103     CCJFlatHeaderCtrl*  m_pHeaderCtrl;      // points to subclassed flat header control.
00104     CString             m_strSection;       // registry section name.
00105     CString             m_strEntry;         // registry entry name.
00106     CString             m_strDefault;       // registry default value.
00107     CListCtrl*          m_pListCtrl;        // points to the list control associated with this view.
00108     COLORREF            m_clrText;          // RGB value for row text color.
00109     COLORREF            m_clrTextBk;        // RGB value for row text background color.
00110     bool                m_bNoColSizing;     // if true, column sizing is disabled.
00111     int                 m_nMinSize;         // if set, columns will have a minimum size requirement.
00112     bool                m_bAscending;       // flag to determine sorting order
00113
00114 private:
00115
00116     bool                m_bAutoSave;        // true if saving column widths.
00117
00118 // Operations
00119 public:
00120
00121     // this member function will return the column width stored in the registry.
00122     //
00123     virtual int GetStoredWidth(int nCol);
00124
00125     // this member function will automatically size a given column.
00126     //
00127     virtual void AutoSizeColumn(int nCol=-1);
00128
00129     // this member function will set the column width from the
00130     // registry settings.
00131     //
00132     virtual void SetColumnWidth(int nCol);
00133
00134     // this member function loads column widths from the registry.
00135     //
00136     virtual void LoadColumnWidths();
00137
00138     // this member function saves column widths to the registry.
00139     //
00140     virtual void SaveColumnWidths();
00141
00142     // this member function will initialize the autosave feature. If called
00143     // column widths will be saved to system registry when the list control
00144     // window is destroyed.
00145     //
00146     virtual void AutoSaveColumns(
00147         // registry section name, if NULL the default is "Settings".
00148         LPCTSTR lpszSection=NULL,
00149         // registry entry name, if NULL the default is "Column Info".
00150         LPCTSTR lpszEntry=NULL,
00151         // registry default value, if NULL the default id "".
00152         LPCTSTR lpszDefault=NULL);
00153
00154     // call this member function to subclass the the flat header control.
00155     //
00156     virtual bool SubclassHeader(bool bBoldFont=false);
00157
00158     // override this member function in your derived class to
00159     // peform custom sort routines.
00160     //
00161     virtual bool SortList(
00162         // passed in from control, index of column clicked.
00163         int nCol,
00164         // passed in from control, true if sort order should be ascending.
00165         bool bAscending );
00166
00167     // this member function is called to set extended styles for the list
00168     // control ie: LVS_EX_FULLROWSELECT, LVS_EX_GRIDLINES, LVS_EX_HEADERDRAGDROP.
00169     //
00170     virtual void SetExtendedStyle( DWORD dwExStyle );
00171
00172     // this member function is called to return the list control extended style.
00173     //
00174     virtual DWORD GetExtendedStyle();
00175
00176     // call this member function to enable/disable column sizing
00177     //
00178     virtual void DisableColumnSizing(bool bDisable);
00179
00180     // call this member function to set a minimum column size
00181     //
00182     virtual void SetMinimumColSize(int nSize);
00183
00184     // call this member function to determine the row index and column index for a point.
00185     // returns the row index or -1 if point is not over a row.
00186     //
00187     virtual int HitTestEx(
00188         // point to be tested.
00189         CPoint &point,
00190         // to hold the column index
00191         int *col) const;
00192
00193     // adds column after the right most column.
00194     //
00195     virtual int AddColumn(
00196         // the column's heading
00197         LPCTSTR lpszColHeading,
00198         // Width of the column, in pixels. If this parameter is -1,
00199         // the column width is the same as previous column
00200         int nWidth = -1,
00201         // the alignment of the column. Can be LVCFMT_LEFT,
00202         // LVCFMT_RIGHT, or LVCFMT_CENTER.
00203         int nFormat=LVCFMT_LEFT);
00204
00205     // this member function will build the columns for the list control. Returns
00206     // false if an error occured.
00207     //
00208     virtual bool BuildColumns(
00209         // number of columns the list control contains
00210         int nCols,
00211         // int array containing the column widths
00212         int* nWidth,
00213         // CString array containing the string for each column
00214         CString* strColString );
00215
00216     // this member function will build the columns for the list control. Returns
00217     // false if an error occured.
00218     //
00219     virtual bool BuildColumns(
00220         // number of columns the list control contains
00221         int nCols,
00222         // int array containing the column widths
00223         int* nWidth,
00224         // int array containing the  string resource id for each column
00225         int* nColString );
00226
00227     // sets the row text and background colors.
00228     virtual void SetRowColors(COLORREF clrText, COLORREF clrTextBk);
00229
00230     // returns the number of columns in the list.
00231     virtual int GetColumnCount() const;
00232
00233     // copies a row to a new location.
00234     //
00235     virtual bool CopyRow(int nFrom, int nTo);
00236
00237     // moves a row to a new location.
00238     //
00239     virtual bool MoveRow(int nFrom, int nTo);
00240
00241 // Overrides
00242     // ClassWizard generated virtual function overrides
00243     //{{AFX_VIRTUAL(CCJListCtrl)
00244     protected:
00245     virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
00246     //}}AFX_VIRTUAL
00247
00248     // Generated message map functions
00249 protected:
00250     //{{AFX_MSG(CCJListCtrl)
00251     afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult);
00252     afx_msg void OnDestroy();
00253     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00254     afx_msg void OnPaint();
00255     //}}AFX_MSG
00256
00257     DECLARE_MESSAGE_MAP()
00258 };
00259
00261 //  Inline Functions
00263
00264 _CJXLIB_INLINE DWORD CCJListCtrl::GetExtendedStyle()
00265     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); }
00266
00267 _CJXLIB_INLINE void CCJListCtrl::SetExtendedStyle(DWORD dwExStyle)
00268     { ASSERT(::IsWindow(m_hWnd)); SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, GetExtendedStyle()|dwExStyle); }
00269
00270 _CJXLIB_INLINE void CCJListCtrl::SetRowColors(COLORREF clrText, COLORREF clrTextBk)
00271     { m_clrText = clrText; m_clrTextBk = clrTextBk; }
00272
00273 _CJXLIB_INLINE void CCJListCtrl::SetMinimumColSize(int nSize)
00274     { m_nMinSize = nSize; }
00275
00276 _CJXLIB_INLINE void CCJListCtrl::DisableColumnSizing(bool bDisable)
00277     { m_bNoColSizing = bDisable; }
00278
00280
00281 //{{AFX_INSERT_LOCATION}}
00282 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00283
00284 #endif // __CJLISTCTRL_H__
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJListView.h Source File

WinCvs/CJLib/Include/CJListView.h

Go to the documentation of this file.
00001 // CJListView.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based on the CListView articles from http://www.codeguru.com/listview
00006 //
00008 /****************************************************************************
00009  *
00010  * $Date: 1999/11/30 21:45:51 $
00011  * $Revision: 1.1.1.2 $
00012  * $Archive: /CodeJock/Include/CJListView.h $
00013  *
00014  * $History: CJListView.h $
00015  *
00016  * *****************  Version 10  *****************
00017  * User: Kirk Stowell Date: 10/30/99   Time: 2:22p
00018  * Updated in $/CodeJock/Include
00019  * Overrode OnEraseBkgnd(...) for flicker free drawing.
00020  *
00021  * *****************  Version 9  *****************
00022  * User: Kirk Stowell Date: 10/26/99   Time: 10:42p
00023  * Updated in $/CodeJock/Include
00024  * Made class methods virtual for inheritance purposes.
00025  *
00026  * *****************  Version 8  *****************
00027  * User: Kirk Stowell Date: 7/31/99    Time: 4:27p
00028  * Updated in $/CodeJockey/Include
00029  *
00030  * *****************  Version 7  *****************
00031  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00032  * Updated in $/CodeJockey/Include
00033  *
00034  * *****************  Version 6  *****************
00035  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00036  * Updated in $/CodeJockey/Include
00037  *
00038  * *****************  Version 5  *****************
00039  * User: Kirk Stowell Date: 7/18/99    Time: 10:14p
00040  * Updated in $/CodeJockey/Include
00041  * Cleaned up inline functions, and import/export macro so that class will
00042  * be imported when linked to, and exported at compile time.
00043  *
00044  * *****************  Version 4  *****************
00045  * User: Kirk Stowell Date: 6/12/99    Time: 2:12a
00046  * Updated in $/CodeJockey/Include
00047  * Cleaned up initialization, sorting and column info saving. Removed sort
00048  * functions, which were replaced with the virtual function SortList(...).
00049  * Override this function in your derived class to perform custom sorting.
00050  * See CCJShellList for an implementation of this virtual function.
00051  *
00052  * *****************  Version 3  *****************
00053  * User: Kirk Stowell Date: 4/03/99    Time: 12:06a
00054  * Updated in $/CodeJockey/Include
00055  * Added comments and cleaned up code.
00056  *
00057  * *****************  Version 2  *****************
00058  * User: Kirk Stowell Date: 3/03/99    Time: 12:06a
00059  * Updated in $/CodeJockey/Include
00060  * Added InitializeFlatHeader() in order to initialize the list control
00061  * manually.
00062  *
00063  * *****************  Version 1  *****************
00064  * User: Kirk Stowell Date: 1/16/99    Time: 12:06a
00065  * Created in $/CodeJockey/Include
00066  * Initial release.
00067  *
00068  ***************************************************************************/
00070
00071 #ifndef __CJLISTVIEW_H__
00072 #define __CJLISTVIEW_H__
00073
00074 #if _MSC_VER >= 1000
00075 #pragma once
00076 #endif // _MSC_VER >= 1000
00077
00078 #include <afxcview.h>
00079 class CCJFlatHeaderCtrl;
00080
00081 // CCJListView is a CListView derived class which implements a
00082 // flat header and generic sorting routines.
00083 class _CJX_EXT_CLASS CCJListView : public CListView
00084 {
00085     DECLARE_DYNCREATE(CCJListView)
00086
00087 public:
00088
00089     // Default constructor
00090     //
00091     CCJListView();
00092
00093     // Virtual destructor
00094     //
00095     virtual ~CCJListView();
00096
00097 protected:
00098
00099     int                 m_nMinColWidth;     // minimum width for columns
00100     int                 m_nMaxColWidth;     // maximum width for columns
00101     int                 m_nSortedCol;       // index of currently selected column
00102     CCJFlatHeaderCtrl*  m_pHeaderCtrl;      // points to subclassed flat header control.
00103     CString             m_strSection;       // registry section name.
00104     CString             m_strEntry;         // registry entry name.
00105     CString             m_strDefault;       // registry default value.
00106     CListCtrl*          m_pListCtrl;        // points to the list control associated with this view.
00107     COLORREF            m_clrText;          // RGB value for row text color.
00108     COLORREF            m_clrTextBk;        // RGB value for row text background color.
00109     bool                m_bNoColSizing;     // if true, column sizing is disabled.
00110     int                 m_nMinSize;         // if set, columns will have a minimum size requirement.
00111
00112 private:
00113
00114     bool                m_bAutoSave;        // true if saving column widths.
00115     bool                m_bAscending;       // flag to determine sorting order
00116
00117 // Operations
00118 public:
00119
00120     // this member function will return the column width stored in the registry.
00121     //
00122     virtual int GetStoredWidth(int nCol);
00123
00124     // this member function will automatically size a given column.
00125     //
00126     virtual void AutoSizeColumn(int nCol=-1);
00127
00128     // this member function will set the column width from the
00129     // registry settings.
00130     //
00131     virtual void SetColumnWidth(int nCol);
00132
00133     // this member function loads column widths from the registry.
00134     //
00135     virtual void LoadColumnWidths();
00136
00137     // this member function saves column widths to the registry.
00138     //
00139     virtual void SaveColumnWidths();
00140
00141     // this member function will initialize the autosave feature. If called
00142     // column widths will be saved to system registry when the list control
00143     // window is destroyed.
00144     //
00145     virtual void AutoSaveColumns(
00146         // registry section name, if NULL the default is "Settings".
00147         LPCTSTR lpszSection=NULL,
00148         // registry entry name, if NULL the default is "Column Info".
00149         LPCTSTR lpszEntry=NULL,
00150         // registry default value, if NULL the default id "".
00151         LPCTSTR lpszDefault=NULL);
00152
00153     // call this member function to subclass the the flat header control.
00154     //
00155     virtual bool SubclassHeader(bool bBoldFont=false);
00156
00157     // override this member function in your derived class to
00158     // peform custom sort routines.
00159     //
00160     virtual bool SortList(
00161         // passed in from control, index of column clicked.
00162         int nCol,
00163         // passed in from control, true if sort order should be ascending.
00164         bool bAscending );
00165
00166     // this member function is called to set extended styles for the list
00167     // control ie: LVS_EX_FULLROWSELECT, LVS_EX_GRIDLINES, LVS_EX_HEADERDRAGDROP.
00168     //
00169     virtual void SetExtendedStyle( DWORD dwExStyle );
00170
00171     // this member function is called to return the list control extended style.
00172     //
00173     virtual DWORD GetExtendedStyle();
00174
00175     // call this member function to enable/disable column sizing
00176     //
00177     virtual void DisableColumnSizing(bool bDisable);
00178
00179     // call this member function to set a minimum column size
00180     //
00181     virtual void SetMinimumColSize(int nSize);
00182
00183     // call this member function to determine the row index and column index for a point.
00184     // returns the row index or -1 if point is not over a row.
00185     //
00186     virtual int HitTestEx(
00187         // point to be tested.
00188         CPoint &point,
00189         // to hold the column index
00190         int *col) const;
00191
00192     // adds column after the right most column.
00193     //
00194     virtual int AddColumn(
00195         // the column's heading
00196         LPCTSTR lpszColHeading,
00197         // Width of the column, in pixels. If this parameter is -1,
00198         // the column width is the same as previous column
00199         int nWidth = -1,
00200         // the alignment of the column. Can be LVCFMT_LEFT,
00201         // LVCFMT_RIGHT, or LVCFMT_CENTER.
00202         int nFormat=LVCFMT_LEFT);
00203
00204     // this member function will build the columns for the list control. Returns
00205     // false if an error occured.
00206     //
00207     virtual bool BuildColumns(
00208         // number of columns the list control contains
00209         int nCols,
00210         // int array containing the column widths
00211         int* nWidth,
00212         // CString array containing the string for each column
00213         CString* strColString );
00214
00215     // this member function will build the columns for the list control. Returns
00216     // false if an error occured.
00217     //
00218     virtual bool BuildColumns(
00219         // number of columns the list control contains
00220         int nCols,
00221         // int array containing the column widths
00222         int* nWidth,
00223         // int array containing the  string resource id for each column
00224         int* nColString );
00225
00226     // sets the row text and background colors.
00227     virtual void SetRowColors(COLORREF clrText, COLORREF clrTextBk);
00228
00229     // returns the number of columns in the list.
00230     virtual int GetColumnCount() const;
00231
00232     // copies a row to a new location.
00233     //
00234     virtual bool CopyRow(int nFrom, int nTo);
00235
00236     // moves a row to a new location.
00237     //
00238     virtual bool MoveRow(int nFrom, int nTo);
00239
00240 // Overrides
00241     // ClassWizard generated virtual function overrides
00242     //{{AFX_VIRTUAL(CCJListView)
00243     public:
00244     virtual void OnInitialUpdate();
00245     protected:
00246     virtual void OnDraw(CDC* pDC);      // overridden to draw this view
00247     virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
00248     //}}AFX_VIRTUAL
00249
00250 // Implementation
00251 protected:
00252 #ifdef _DEBUG
00253     virtual void AssertValid() const;
00254     virtual void Dump(CDumpContext& dc) const;
00255 #endif
00256
00257     // Generated message map functions
00258 protected:
00259     //{{AFX_MSG(CCJListView)
00260     afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult);
00261     afx_msg void OnDestroy();
00262     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00263     //}}AFX_MSG
00264     DECLARE_MESSAGE_MAP()
00265 };
00266
00268 //  Inline Functions
00270
00271 _CJXLIB_INLINE DWORD CCJListView::GetExtendedStyle()
00272     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); }
00273
00274 _CJXLIB_INLINE void CCJListView::SetExtendedStyle(DWORD dwExStyle)
00275     { ASSERT(::IsWindow(m_hWnd)); SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, GetExtendedStyle()|dwExStyle); }
00276
00277 _CJXLIB_INLINE void CCJListView::SetRowColors(COLORREF clrText, COLORREF clrTextBk)
00278     { m_clrText = clrText; m_clrTextBk = clrTextBk; }
00279
00280 _CJXLIB_INLINE void CCJListView::SetMinimumColSize(int nSize)
00281     { m_nMinSize = nSize; }
00282
00283 _CJXLIB_INLINE void CCJListView::DisableColumnSizing(bool bDisable)
00284     { m_bNoColSizing = bDisable; }
00285
00287
00288 //{{AFX_INSERT_LOCATION}}
00289 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00290
00291 #endif // __CJLISTVIEW_H__
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJLogoPane.h Source File

WinCvs/CJLib/Include/CJLogoPane.h

Go to the documentation of this file.
00001 // CJLogoPane.h : header file
00002 //
00003 // Copyright © 1999 Pierre MELLINAND
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:51 $
00009  * $Revision: 1.1.1.1 $
00010  * $Archive: /CodeJock/Include/CJLogoPane.h $
00011  *
00012  * $History: CJLogoPane.h $
00013  *
00014  * *****************  Version 1  *****************
00015  * User: Kirk Stowell Date: 10/26/99   Time: 11:08p
00016  * Created in $/CodeJock/Include
00017  *
00018  ***************************************************************************/
00020
00021 #ifndef __CJLOGOPANE_H__
00022 #define __CJLOGOPANE_H__
00023
00024 #if _MSC_VER >= 1000
00025 #pragma once
00026 #endif // _MSC_VER >= 1000
00027
00029 // CCJLogoPane class
00030
00031 class _CJX_EXT_CLASS CCJLogoPane : public CWnd
00032 {
00033     DECLARE_DYNCREATE(CCJLogoPane)
00034
00035 // Construction
00036 public:
00037     CCJLogoPane();
00038
00039 // Attributes
00040 public:
00041     CString m_strLogoText;
00042     CFont   m_Font;
00043
00044 // Operations
00045 public:
00046     virtual void    SetLogoText(LPCTSTR lpszLogoText);
00047     virtual CString GetLogoText();
00048     virtual void    SetLogoFont(LPCTSTR lpszFontName, int nHeight=24, int nWeight=FW_BOLD, BOOL bItalic=TRUE, BOOL bUnderline=FALSE);
00049
00050 // Overrides
00051     // ClassWizard generated virtual function overrides
00052     //{{AFX_VIRTUAL(CCJLogoPane)
00053     public:
00054     virtual BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle, CWnd* pParentWnd, UINT nID);
00055     //}}AFX_VIRTUAL
00056
00057 // Implementation
00058 public:
00059     virtual ~CCJLogoPane();
00060
00061 // Generated message map functions
00062 protected:
00063     //{{AFX_MSG(CCJLogoPane)
00064     afx_msg void OnPaint();
00065     //}}AFX_MSG
00066     DECLARE_MESSAGE_MAP()
00067 };
00068
00070 //  Inline Functions
00072
00073 _CJXLIB_INLINE void CCJLogoPane::SetLogoText(LPCTSTR lpszLogoText)
00074     { m_strLogoText = lpszLogoText; }
00075
00076 _CJXLIB_INLINE CString CCJLogoPane::GetLogoText()
00077     { return m_strLogoText; }
00078
00080
00081 //{{AFX_INSERT_LOCATION}}
00082 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00083
00084 #endif // __CJLOGOPANE_H__
00085
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJMaskEdit.h Source File

WinCvs/CJLib/Include/CJMaskEdit.h

Go to the documentation of this file.
00001 // CJMaskEdit.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based on the article "A masked edit control (2)" by Jeremy Davis [jmd@jvf.co.uk]
00006 // http://www.codeguru.com/editctrl/masked_edit2.shtml
00007 //
00009 /****************************************************************************
00010  *
00011  * $Date: 1999/11/30 21:45:51 $
00012  * $Revision: 1.1.1.3 $
00013  * $Archive: /CodeJock/Include/CJMaskEdit.h $
00014  *
00015  * $History: CJMaskEdit.h $
00016  *
00017  * *****************  Version 7  *****************
00018  * User: Kirk Stowell Date: 10/30/99   Time: 2:21p
00019  * Updated in $/CodeJock/Include
00020  * Overrode OnPaint() and  OnEraseBkgnd(...) for flicker free drawing.
00021  *
00022  * *****************  Version 6  *****************
00023  * User: Kirk Stowell Date: 10/26/99   Time: 10:44p
00024  * Updated in $/CodeJock/Include
00025  * Made class methods virtual for inheritance purposes.
00026  *
00027  * *****************  Version 5  *****************
00028  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00029  * Updated in $/CodeJockey/Include
00030  * Updated copyright and contact information.
00031  *
00032  * *****************  Version 4  *****************
00033  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00034  * Updated in $/CodeJockey/Include
00035  *
00036  * *****************  Version 3  *****************
00037  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00038  * Updated in $/CodeJockey/Include
00039  *
00040  * *****************  Version 2  *****************
00041  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00042  * Updated in $/CodeJockey/Include
00043  *
00044  * *****************  Version 1  *****************
00045  * User: Kirk Stowell Date: 7/19/99    Time: 12:35a
00046  * Created in $/CodeJockey/Include
00047  * Initial creation and addition to library.
00048  *
00049  ***************************************************************************/
00051
00052 #ifndef __CJMASKEDIT_H__
00053 #define __CJMASKEDIT_H__
00054
00055 #if _MSC_VER >= 1000
00056 #pragma once
00057 #endif // _MSC_VER >= 1000
00058
00059 // CCJMaskEdit is a CEdit derived class which allows text masking to be
00060 // applied to the control to format it for special editing restrictions.
00061 class _CJX_EXT_CLASS CCJMaskEdit : public CEdit
00062 {
00063     DECLARE_DYNAMIC(CCJMaskEdit)
00064
00065 // Construction
00066 public:
00067     CCJMaskEdit();
00068
00069 // Attributes
00070 public:
00071
00072     bool        m_bUseMask;             // true to use edit mask.
00073     bool        m_bMaskKeyInProgress;   // true when
00074     CString     m_strWindowText;        // buffer that holds the actual edit text.
00075     CString     m_strMask;              // buffer that holds the actual edit mask value.
00076     CString     m_strLiteral;
00077     CString     m_strValid;
00078     CString     m_strMaskLiteral;
00079     CFont       m_Font;                 // font used by masked edit control.
00080
00081 // Operations
00082 public:
00083
00084     virtual void SetEditMask(LPCTSTR lpszMask, LPCTSTR lpszLiteral, LPCTSTR lpszWindowText);
00085     virtual void SendChar(UINT nChar);
00086     virtual bool CheckChar(UINT nChar);
00087
00088 // Overrides
00089     // ClassWizard generated virtual function overrides
00090     //{{AFX_VIRTUAL(CCJMaskEdit)
00091     //}}AFX_VIRTUAL
00092
00093     virtual bool ProcessMask(UINT nChar, int nEndPos);
00094
00095 // Implementation
00096 public:
00097     virtual void UpdateFont();
00098     virtual ~CCJMaskEdit();
00099
00100     // Generated message map functions
00101 protected:
00102     //{{AFX_MSG(CCJMaskEdit)
00103     afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00104     afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
00105     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00106     afx_msg void OnPaint();
00107     //}}AFX_MSG
00108
00109     DECLARE_MESSAGE_MAP()
00110 };
00111
00112 // CCJDateEdit is a CCJMaskEdit derived class which is specifically
00113 // geared toward editing date fields.
00114 class _CJX_EXT_CLASS CCJDateEdit : public CCJMaskEdit
00115 {
00116     DECLARE_DYNAMIC(CCJDateEdit)
00117
00118 // Construction
00119 public:
00120     CCJDateEdit();
00121
00122     virtual void SetDateTime(COleDateTime& dt);
00123     virtual void SetDateTime(CString strDate);
00124     virtual COleDateTime GetDateTime();
00125     virtual CString GetWindowDateTime();
00126     virtual COleDateTime ReadOleDateTime(LPCTSTR lpszData);
00127
00128     virtual bool ProcessMask(UINT nChar, int nEndPos);
00129     virtual void FormatOleDateTime(CString& strData, COleDateTime dt);
00130 };
00131
00132 // CCJTimeEdit is a CCJDateEdit derived class which is specifically geared
00133 // toward editing time fields.
00134 class _CJX_EXT_CLASS CCJTimeEdit : public CCJDateEdit
00135 {
00136     DECLARE_DYNAMIC(CCJTimeEdit)
00137
00138 // Construction
00139 public:
00140     CCJTimeEdit();
00141
00142     CString     m_strHours;
00143     CString     m_strMins;
00144
00145     virtual void SetHours(int nHours);
00146     virtual void SetMins(int nMins);
00147
00148     virtual bool ProcessMask(UINT nChar, int nEndPos);
00149     virtual void FormatOleDateTime(CString& strData, COleDateTime dt);
00150 };
00151
00153 // DDX for date mask control
00154
00155 void AFXAPI DDX_OleDateTime(CDataExchange* pDX, int nIDC, CCJDateEdit& rControl, COleDateTime& rDateTime);
00156
00158
00159 //{{AFX_INSERT_LOCATION}}
00160 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00161
00162 #endif // __CJMASKEDIT_H__
00163
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJMDIChildWnd.h Source File

WinCvs/CJLib/Include/CJMDIChildWnd.h

Go to the documentation of this file.
00001 // CJMDIChildWnd.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:51 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/Include/CJMDIChildWnd.h $
00011  *
00012  * $History: CJMDIChildWnd.h $
00013  *
00014  * *****************  Version 7  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:02p
00016  * Updated in $/CodeJock/Include
00017  * Overrode OnEraseBkgnd(...) for flicker free drawing.
00018  *
00019  * *****************  Version 6  *****************
00020  * User: Kirk Stowell Date: 10/26/99   Time: 10:44p
00021  * Updated in $/CodeJock/Include
00022  * Made class methods virtual for inheritance purposes.
00023  *
00024  * *****************  Version 5  *****************
00025  * User: Kirk Stowell Date: 10/06/99   Time: 6:21a
00026  * Updated in $/CodeJockey/Include
00027  * Added cool menu support for MDI applications that do not have a
00028  * document/view architecture. Added GetInitializedMenu() to
00029  * CCJMDIChildWnd which will initialize the menu for a given view,  and
00030  * overloaded InitializeMenu() in CCJMDIFrameWnd. Thanks to Golovanov
00031  * Michael [Golovanov@SoftLab.RU] for help with this.
00032  *
00033  * *****************  Version 4  *****************
00034  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00035  * Updated in $/CodeJockey/Include
00036  * Updated copyright and contact information.
00037  *
00038  * *****************  Version 3  *****************
00039  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00040  * Updated in $/CodeJockey/Include
00041  *
00042  * *****************  Version 2  *****************
00043  * User: Kirk Stowell Date: 7/18/99    Time: 10:14p
00044  * Updated in $/CodeJockey/Include
00045  * Cleaned up inline functions, and import/export macro so that class will
00046  * be imported when linked to, and exported at compile time.
00047  *
00048  * *****************  Version 1  *****************
00049  * User: Kirk Stowell Date: 6/26/99    Time: 8:30p
00050  * Created in $/CodeJockey/Include
00051  * Initial creation. Added to library to allow CCJControlBar and
00052  * CCJToolBar docking.
00053  *
00054  ***************************************************************************/
00056
00057 #ifndef __CJMDICHILDWND_H__
00058 #define __CJMDICHILDWND_H__
00059
00060 #if _MSC_VER > 1000
00061 #pragma once
00062 #endif // _MSC_VER > 1000
00063
00064 // class forwards
00065 class CCJSizeDockBar;
00066
00067 // The CCJMDIChildWnd class provides the functionality of a Windows multiple
00068 // document interface (MDI) child window, along with members for managing the
00069 // window. This class extends the standard CMDIChildWnd class to allow CCJControlBar
00070 // and CCJToolBar docking.
00071 class _CJX_EXT_CLASS CCJMDIChildWnd : public CMDIChildWnd
00072 {
00073     DECLARE_DYNCREATE(CCJMDIChildWnd)
00074
00075 // Construction / destruction
00076 public:
00077
00078     // Constructs a CCJMDIChildWnd object
00079     //
00080     CCJMDIChildWnd();
00081
00082     // Destroys a CCJMDIChildWnd object
00083     //
00084     virtual ~CCJMDIChildWnd();
00085
00086     virtual HMENU GetInitializedMenu(
00087         UINT nMenuID,
00088         UINT nToolBarID);
00089
00090     virtual HMENU GetInitializedMenu(
00091         UINT nMenuID,
00092         UINT* nToolbarIDs,
00093         int nSize);
00094
00095     virtual UINT GetMenuID();
00096     virtual UINT GetToolBarID();
00097     virtual UINT* GetToolBarIDs(int& nCount);
00098     virtual void SetResourceIDs(UINT nMenuID, UINT nToolBarID);
00099     virtual void SetResourceIDs(UINT nMenuID, UINT* nToolBarIDs, int nCount);
00100
00101 protected:
00102
00103     HMENU   m_hMenu;
00104     UINT    m_nMenuID;
00105     UINT    m_nToolBarID;
00106     UINT*   m_nToolBarIDs;
00107     int     m_nCount;
00108
00109     static DWORD dwDockBarMap[4][2];    // array used for docking masks
00110
00111     // Yiannhs to parameterize and the dock bar border
00112     enum DockFlatBorders {
00113         brdrAllRaised       = 0x0000,
00114         brdrFlatTop         = 0x0001,
00115         brdrFlatBottom      = 0x0002,
00116         brdrFlatLeft        = 0x0004,
00117         brdrFlatRight       = 0x0008,
00118         brdrFlatVertical    = 0x0003,
00119         brdrFlatHorizontal  = 0x000C,
00120         brdrFlatAll         = 0x000F
00121     };
00122
00123     // This member function is called to calculate the size of
00124     // a CCJControlBar
00125     //
00126     virtual void RecalcAllExcept(CCJSizeDockBar *pBar);
00127
00128     // This member function enables docking for standard
00129     // toolbar and control bars
00130     //
00131     virtual void EnableDocking(DWORD dwDockStyle);
00132
00133     // This member function enables docking for CCJControl bars only
00134     //
00135     virtual void EnableDockingSizeBar(
00136         // Specifies which sides of the frame window can serve as docking sites
00137         // for control bars. It can be one or more of the following:
00138         //
00139         // CBRS_ALIGN_TOP   Allows docking at the top of the client area.
00140         // CBRS_ALIGN_BOTTOM   Allows docking at the bottom of the client area.
00141         // CBRS_ALIGN_LEFT   Allows docking on the left side of the client area.
00142         // CBRS_ALIGN_RIGHT   Allows docking on the right side of the client area.
00143         // CBRS_ALIGN_ANY   Allows docking on any side of the client area.
00144         DWORD dwDockStyle,
00145         // enum for flat border styles.
00146         DockFlatBorders FlatFlags = brdrAllRaised );
00147
00148     // This member function will dock a CCJControlBar
00149     //
00150     virtual void DockSizeBar(
00151         // toolbar to dock
00152         CControlBar* pBar,
00153         // dockbar object usually NULL
00154         CCJSizeDockBar* pDockBar=NULL,
00155         // initial size usually NULL
00156         LPRECT lpRect=NULL);
00157
00158     // This memeber function will dock the control bar passed in
00159     // as the first argument, and dock the control bar that is passed in
00160     // as the second argument to the left of the first one.
00161     //
00162     virtual void DockControlBarLeftOf(
00163         // control bar to dock to the right of
00164         CControlBar* Bar,
00165         // already docked control bar
00166         CControlBar* LeftOf);
00167
00168 // Overrides
00169     // ClassWizard generated virtual function overrides
00170     //{{AFX_VIRTUAL(CCJMDIChildWnd)
00171     public:
00172     virtual void RecalcLayout(BOOL bNotify = TRUE);
00173     //}}AFX_VIRTUAL
00174
00175 // Implementation
00176 protected:
00177     // Generated message map functions
00178     //{{AFX_MSG(CCJMDIChildWnd)
00179     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00180     //}}AFX_MSG
00181     DECLARE_MESSAGE_MAP()
00182 };
00183
00185 // Inline functions
00187
00188 _CJXLIB_INLINE UINT CCJMDIChildWnd::GetMenuID()
00189     { return m_nMenuID; }
00190
00191 _CJXLIB_INLINE UINT CCJMDIChildWnd::GetToolBarID()
00192     { return m_nToolBarID; }
00193
00194 _CJXLIB_INLINE UINT* CCJMDIChildWnd::GetToolBarIDs(int& nCount)
00195     { nCount = m_nCount; return m_nToolBarIDs; }
00196
00197 _CJXLIB_INLINE void CCJMDIChildWnd::SetResourceIDs(UINT nMenuID, UINT nToolBarID)
00198     { m_nMenuID = nMenuID; m_nToolBarID = nToolBarID; }
00199
00200 _CJXLIB_INLINE void CCJMDIChildWnd::SetResourceIDs(UINT nMenuID, UINT* nToolBarIDs, int nCount)
00201     { m_nMenuID = nMenuID; m_nToolBarIDs = nToolBarIDs; m_nCount = nCount; }
00202
00204
00205 //{{AFX_INSERT_LOCATION}}
00206 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00207
00208 #endif // __CJMDICHILDWND_H__
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJMDIFrameWnd.h Source File

WinCvs/CJLib/Include/CJMDIFrameWnd.h

Go to the documentation of this file.
00001 // CJMDIFrameWnd.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 2002/01/05 16:46:43 $
00009  * $Revision: 1.2 $
00010  * $Archive: /CodeJock/Include/CJMDIFrameWnd.h $
00011  *
00012  * $History: CJMDIFrameWnd.h $
00013  *
00014  * *****************  Version 17  *****************
00015  * User: Kirk Stowell Date: 10/29/99   Time: 12:43a
00016  * Updated in $/CodeJock/Include
00017  * Overloaded PreCreateWindow(...) for flicker free drawing.
00018  *
00019  * *****************  Version 16  *****************
00020  * User: Kirk Stowell Date: 10/27/99   Time: 12:06a
00021  * Updated in $/CodeJock/Include
00022  *
00023  * *****************  Version 15  *****************
00024  * User: Kirk Stowell Date: 10/26/99   Time: 10:58p
00025  * Updated in $/CodeJock/Include
00026  * Added menu bar and made class members virtual for inheritance purposes.
00027  *
00028  * *****************  Version 14  *****************
00029  * User: Kirk Stowell Date: 10/14/99   Time: 6:15p
00030  * Updated in $/CodeJock/Include
00031  * Fixed bug with a document becomes the active document when the user
00032  * clicks inside a tab in the CCJTabControlBar to perform some operation.
00033  * When closing the application, MFC decides in CFrameWnd::OnClose() to
00034  * check if the 'active' document is modified before checking all other
00035  * documuents. If the active document is not modified and can close its
00036  * frame, it does not check other documents individually and shuts down
00037  * without asking the important 'modified save' questions. To fix this,
00038  * OnClose() was overriden to add a call to "SetActiveView(NULL)" just
00039  * before the base class OnClose is called. This will check all documents
00040  * asking the save question before closing the application. Thanks to
00041  * Simon Clark [spc@otleda.com] for help with this.
00042  *
00043  * *****************  Version 13  *****************
00044  * User: Kirk Stowell Date: 10/14/99   Time: 10:05a
00045  * Updated in $/CodeJock/Include
00046  * Overrode OnEraseBkgnd(...) to help to eliminate screen flicker.
00047  *
00048  * *****************  Version 12  *****************
00049  * User: Kirk Stowell Date: 10/06/99   Time: 6:21a
00050  * Updated in $/CodeJockey/Include
00051  * Added cool menu support for MDI applications that do not have a
00052  * document/view architecture. Added GetInitializedMenu() to
00053  * CCJMDIChildWnd which will initialize the menu for a given view,  and
00054  * overloaded InitializeMenu() in CCJMDIFrameWnd. Thanks to Golovanov
00055  * Michael [Golovanov@SoftLab.RU] for help with this.
00056  *
00057  * *****************  Version 11  *****************
00058  * User: Kirk Stowell Date: 9/16/99    Time: 2:35p
00059  * Updated in $/CodeJockey/Include
00060  * Fixed bug with save / restore bar state, and with saved bar size
00061  * changing whenever the application starts.
00062  *
00063  * *****************  Version 10  *****************
00064  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00065  * Updated in $/CodeJockey/Include
00066  * Updated copyright and contact information.
00067  *
00068  * *****************  Version 9  *****************
00069  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00070  * Updated in $/CodeJockey/Include
00071  *
00072  * *****************  Version 8  *****************
00073  * User: Kirk Stowell Date: 7/18/99    Time: 10:13p
00074  * Updated in $/CodeJockey/Include
00075  * Cleaned up inline functions, and import/export macro so that class will
00076  * be imported when linked to, and exported at compile time.
00077  *
00078  * *****************  Version 7  *****************
00079  * User: Kirk Stowell Date: 6/11/99    Time: 8:25p
00080  * Updated in $/CodeJockey/Include
00081  * Slight modification made to popup menu code.
00082  *
00083  * *****************  Version 6  *****************
00084  * User: Kirk Stowell Date: 6/09/99    Time: 8:33p
00085  * Updated in $/CodeJockey/Include
00086  * Ioannhs Stamatopoulos (Yiannhs) [ystamat@mail.datamedia.gr] - Extended
00087  * docking windows, removed ::GetSysColor(...) calls and WM_SYSCOLORCHANGE
00088  * message handler, this is now automatically handled by the base class.
00089  * Added redraw flags to the create method and modified paint and layout
00090  * handlers to reduce flicker and un-necessary command handling. Dragging
00091  * rect now reflects actual control bar docked size. Added "flat" look to
00092  * the control bars, the control bars can now use the classic DevStudio
00093  * look, or use flat gradient gripper, borders and frame buttons. Overall,
00094  * docking windows now handle dragging, docking and floating much better,
00095  * and behave more like DevStudio.
00096  *
00097  * *****************  Version 5  *****************
00098  * User: Kirk Stowell Date: 5/02/99    Time: 2:13a
00099  * Updated in $/CodeJockey/Include
00100  * Re-wrote CCJMenu releated methods so that multiple documents can be
00101  * added with associated menu support. Added typedef CList <CCJMenu*,
00102  * CCJMenu*> CMDIMenuList; so that menus pointers are stored in a list and
00103  * not member variables.
00104  *
00105  * *****************  Version 4  *****************
00106  * User: Kirk Stowell Date: 4/25/99    Time: 10:37p
00107  * Updated in $/CodeJockey/Include
00108  * Added support for Brent Corkum's BCMenu (CCJMenu), which is a replacement for the
00109  * CCoolMenu class.
00110  *
00111  * *****************  Version 3  *****************
00112  * User: Kirk Stowell Date: 4/03/99    Time: 8:41p
00113  * Updated in $/CodeJockey/Include
00114  * Added comments and cleaned up code.
00115  *
00116  * *****************  Version 2  *****************
00117  * User: Kirk Stowell Date: 1/12/99    Time: 8:41p
00118  * Updated in $/CodeJockey/Include
00119  * Total re-write to add side-by-side docking support for CCJControlBar
00120  * class.
00121  *
00122  * *****************  Version 1  *****************
00123  * User: Kirk Stowell Date: 10/17/98   Time: 8:41p
00124  * Created in $/CodeJockey/Include
00125  * Initial re-write and release.
00126  *
00127  ***************************************************************************/
00129
00130 #ifndef __CJMDIFRAMEWND_H__
00131 #define __CJMDIFRAMEWND_H__
00132
00133 #if _MSC_VER >= 1000
00134 #pragma once
00135 #endif // _MSC_VER >= 1000
00136
00137 #include "CJMenuBar.h"
00138 #include "CJMenu.h"
00139
00140 // template list used to store menu objects.
00141 typedef CList <CCJMenu*, CCJMenu*> CMDIMenuList;
00142
00143 // class forwards
00144 class CCJSizeDockBar;
00145
00146 // CCJMDIFrameWnd is a CMDIFrameWnd derived class which is used to
00147 // reposition toolbar layout for 3D effect, in addition to docking
00148 // methods for CCJToolBar and CCJControlBar class
00149 class _CJX_EXT_CLASS CCJMDIFrameWnd : public CMDIFrameWnd
00150 {
00151     DECLARE_DYNCREATE(CCJMDIFrameWnd)
00152
00153 public:
00154
00155     // Default constructor
00156     //
00157     CCJMDIFrameWnd();
00158
00159     // Virtual destructor
00160     //
00161     virtual ~CCJMDIFrameWnd();
00162
00163 protected:
00164
00165     static DWORD    dwDockBarMap[4][2]; // array used for docking masks
00166     CMDIMenuList    m_menuList;         // template used to store associated menus.
00167     CCJMenuBar      m_wndMenuBar;       // menu bar
00168
00169     // Yiannhs to parameterize and the dock bar border
00170     enum DockFlatBorders {
00171         brdrAllRaised       = 0x0000,
00172         brdrFlatTop         = 0x0001,
00173         brdrFlatBottom      = 0x0002,
00174         brdrFlatLeft        = 0x0004,
00175         brdrFlatRight       = 0x0008,
00176         brdrFlatVertical    = 0x0003,
00177         brdrFlatHorizontal  = 0x000C,
00178         brdrFlatAll         = 0x000F
00179     };
00180
00181 protected:
00182
00183     // This member function is called by the framework to associate
00184     // toolbar resources with the frame menu
00185     //
00186     virtual HMENU NewMenu(
00187         // resource id for menu
00188         UINT nMenuID,
00189         // array of toolbar resource ids
00190         UINT* nToolbarIDs = NULL,
00191         // size of array.
00192         int nSize = 0);
00193
00194     // This member function is called by the framework to associate
00195     // a toolbar resource with the frame menu
00196     //
00197     virtual HMENU NewMenu(
00198         // resource id for menu
00199         UINT nMenuID,
00200         // toolbar resource
00201         UINT nToolbarID = NULL);
00202
00203 public:
00204
00205     virtual void LoadBarState(LPCTSTR lpszProfileName);
00206     virtual void SaveBarState(LPCTSTR lpszProfileName) const;
00207
00208     // This member function is called to initialize the CCJMenu
00209     //
00210     virtual BOOL InitializeMenu(
00211         // points to the document template for your app
00212         CMultiDocTemplate* pDocTemplate,
00213         // resource id for menu
00214         UINT nMenuID,
00215         // array of toolbar resource ids
00216         UINT* nToolbarIDs = NULL,
00217         // size of array.
00218         int nSize = 0,
00219         // resource id for default menu, for subsequent calls,
00220         // default menu is ignored.
00221         UINT nDefaultMenuID = NULL);
00222
00223     // This member function is called to initialize the Menu
00224     //
00225     virtual BOOL InitializeMenu(
00226         // points to the document template for your app
00227         CMultiDocTemplate* pDocTemplate,
00228         // resource id for menu
00229         UINT nMenuID,
00230         // toolbar resource
00231         UINT nToolbarID = NULL,
00232         // resource id for default menu, for subsequent calls,
00233         // default menu is ignored.
00234         UINT nDefaultMenuID = NULL);
00235
00236     virtual BOOL InitializeMenu(
00237         HMENU* phMenu,
00238         UINT nMenuID,
00239         UINT nToolbarID = NULL );
00240
00241     virtual BOOL InitializeMenu(
00242         HMENU* phMenu,
00243         UINT nMenuID,
00244         UINT* nToolbarIDs = NULL ,
00245         int nSize = NULL );
00246
00247     // This member function is called to calculate the size of
00248     // a CCJControlBar
00249     //
00250     virtual void RecalcAllExcept(CCJSizeDockBar *pBar);
00251
00252     // This member function enables docking for standard
00253     // toolbar and control bars
00254     //
00255     virtual void EnableDocking(DWORD dwDockStyle);
00256
00257     // This member function enables docking for CCJControl bars only
00258     //
00259     virtual void EnableDockingSizeBar(
00260         // Specifies which sides of the frame window can serve as docking sites
00261         // for control bars. It can be one or more of the following:
00262         //
00263         // CBRS_ALIGN_TOP   Allows docking at the top of the client area.
00264         // CBRS_ALIGN_BOTTOM   Allows docking at the bottom of the client area.
00265         // CBRS_ALIGN_LEFT   Allows docking on the left side of the client area.
00266         // CBRS_ALIGN_RIGHT   Allows docking on the right side of the client area.
00267         // CBRS_ALIGN_ANY   Allows docking on any side of the client area.
00268         DWORD dwDockStyle,
00269         // enum for flat border styles.
00270         DockFlatBorders FlatFlags = brdrAllRaised );
00271
00272     // This member function will dock a CCJControlBar
00273     //
00274     virtual void DockSizeBar(
00275         // toolbar to dock
00276         CControlBar* pBar,
00277         // dockbar object usually NULL
00278         CCJSizeDockBar* pDockBar=NULL,
00279         // initial size usually NULL
00280         LPRECT lpRect=NULL);
00281
00282     // This memeber function will dock the control bar passed in
00283     // as the first argument, and dock the control bar that is passed in
00284     // as the second argument to the left of the first one.
00285     //
00286     virtual void DockControlBarLeftOf(
00287         // control bar to dock to the right of
00288         CControlBar* Bar,
00289         // already docked control bar
00290         CControlBar* LeftOf);
00291
00292 // Overrides
00293     // ClassWizard generated virtual function overrides
00294     //{{AFX_VIRTUAL(CCJMDIFrameWnd)
00295     public:
00296     virtual void RecalcLayout(BOOL bNotify = TRUE);
00297     protected:
00298     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00299     virtual BOOL PreCreateWindow(CREATESTRUCT& cs, UINT nIconID);
00300     //}}AFX_VIRTUAL
00301
00302 // Generated message map functions
00303 protected:
00304     //{{AFX_MSG(CCJMDIFrameWnd)
00305     afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
00306     afx_msg LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu);
00307     afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
00308     afx_msg void OnClose();
00309     //}}AFX_MSG
00310     DECLARE_MESSAGE_MAP()
00311 };
00312
00314
00315 //{{AFX_INSERT_LOCATION}}
00316 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00317
00318 #endif // __CJMDIFRAMEWND_H__
00319
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJMemFile.h Source File

WinCvs/CJLib/Include/CJMemFile.h

Go to the documentation of this file.
00001 // CJMemFile.h: interface for the CCJMemFile class.
00002 //
00003 // Copyright © 1999 Maxallion
00004 // mailto:XFile@maxallion.8m.com
00005 // ICQ# 32304418
00006 //
00007 // CCJMemFile - Extended Memory File - Beta - w/o a lot of error checking
00008 // - Is used like a normal CFile or CStdioFile or CMemFile object
00009 // - String Functions : ReadString, WriteString
00010 // - Loads physical files into memory on creation and saves them back to disk on destruction
00011 // - Can duplicate itself to other CFile derived objects
00012 // - Has a Search function
00013 // - can be read-accessed like an array
00014 //
00015 // OVERLOADED OPERATORS:
00016 // = Imports from another file or sets file Position
00017 // += Appends another file
00018 // [] reads a byte like an array
00019 //
00021 /****************************************************************************
00022  *
00023  * $Date: 1999/11/30 21:45:51 $
00024  * $Revision: 1.1.1.1 $
00025  * $Archive: /CodeJock/Include/CJMemFile.h $
00026  *
00027  * $History: CJMemFile.h $
00028  *
00029  * *****************  Version 1  *****************
00030  * User: Kirk Stowell Date: 10/24/99   Time: 3:01a
00031  * Created in $/CodeJock/Include
00032  * Initial creation.
00033  *
00034  ***************************************************************************/
00036
00037 #ifndef __CJMEMFILE_H__
00038 #define __CJMEMFILE_H__
00039
00040 #if _MSC_VER > 1000
00041 #pragma once
00042 #endif // _MSC_VER > 1000
00043
00044 class _CJX_EXT_CLASS CCJMemFile : public CMemFile
00045 {
00046 private:
00047     CFileException* m_pError;
00048     CFile m_File;
00049     UINT m_uiOpenFlags;
00050     bool m_bOpen;
00051
00052 public:
00053     CCJMemFile( UINT nGrowBytes = 1024 );
00054     CCJMemFile( BYTE* lpBuffer, UINT nBufferSize, UINT nGrowBytes = 0 );
00055     CCJMemFile(LPCTSTR lpstFilename, UINT uiOpenFlags);
00056     virtual ~CCJMemFile();
00057
00058 protected:
00059     // Load() loads the file into Memory
00060     virtual bool Load();
00061
00062     // Save() saves the file to Disk
00063     virtual bool Save();
00064
00065     // Import() imports the data of a CFile derived object (operator = )
00066     virtual bool Import(CFile *fImp);
00067
00068     // Appends a CFile derived object to the file (operator += )
00069     virtual bool Append(CFile *fApp);
00070
00071 public:
00072     // Flush() saves the memory to disk
00073     virtual void Flush();
00074
00075     // Open(...) opens and loads a physical File into memory
00076     virtual bool Open(CString strFilename, UINT uiOpenFlags, CFileException *pError = NULL);
00077
00078     // Close() saves the contents of the memory to the disk and closes it.
00079     virtual void Close();
00080
00081     // ReadString(...) reads a string
00082     virtual BOOL ReadString(CString& rString);
00083
00084     // WriteString(...) appends a string
00085     virtual void WriteString( LPCTSTR lpsz );
00086
00087     // Duplicate(...) Duplicates the CCJMemFile to a CFile derived class
00088     virtual bool Duplicate(CFile *fDuplicate);
00089     virtual bool Duplicate(CString strDup);
00090
00091     // Discard() discards all changes to file since Open() or last Flush()
00092     virtual bool Discard();
00093
00094     // Insert(...) inserts any File and returns the length of actual copied bytes
00095     virtual DWORD Insert(CFile* fSrc, DWORD dwSourcePos, DWORD dwDestPos, DWORD dwBytes);
00096     virtual DWORD Insert(CString strSrc, DWORD dwSourcePos, DWORD dwDestPos, DWORD dwBytes);
00097
00098     // Extract(...) Extracts bytes to a file and returns the length of actual copied bytes
00099     virtual DWORD Extract(CFile *fDest,DWORD dwStartPos, DWORD dwBytes);
00100     virtual DWORD Extract(CString strDest, DWORD dwStartPos, DWORD dwBytes);
00101
00102     // Find(...) Finds data in the file
00103     LONG FindData(void* pData, DWORD dwDataLen, LONG lStartPos);
00104
00105 // Overloaded Operators
00106 public:
00107     // Importing Operators
00108     void operator =( CFile *fDup);
00109     void operator =( CString strDup);
00110
00111     // Positioning
00112     void operator =( DWORD dwFilePos);
00113
00114     // Appending operators
00115     void operator +=( CFile *fApp);
00116     void operator +=( CString strApp);
00117
00118     // Indexing Operators
00119     BYTE operator [](DWORD dwFilePos);
00120
00121
00122 };
00123
00124 #endif // !defined(__CJMEMFILE_H__)
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJMenu.h Source File

WinCvs/CJLib/Include/CJMenu.h

Go to the documentation of this file.
00001 //*************************************************************************
00002 // CJMenu.h : header file
00003 // Version : 2.5
00004 // Date : October 18, 1999
00005 // Author : Brent Corkum
00006 //
00007 // Portions of code supplied by:
00008 // Ben Ashley,Girish Bharadwaj,Jean-Edouard Lachand-Robert,
00009 // Robert Edward Caldecott,Kenny Goers,Leonardo Zide,
00010 // Stefan Kuhr, Reiner Jung
00011 //
00012 // Bug Fixes:
00013 // Stefan Kuhr,Martin Vladic,Kim Yoo Chul
00014 //
00015 // You are free to use/modify this code but leave this header intact.
00016 //
00018 /****************************************************************************
00019  *
00020  * $Date: 2002/01/05 16:46:43 $
00021  * $Revision: 1.2 $
00022  * $Archive: /CodeJock/Include/CJMenu.h $
00023  *
00024  * $History: CJMenu.h $
00025  *
00026  * *****************  Version 6  *****************
00027  * User: Kirk Stowell Date: 10/24/99   Time: 2:09a
00028  * Updated in $/CodeJock/Include
00029  * Upgraded to version 2.5 of BCMenu
00030  *
00031  * *****************  Version 5  *****************
00032  * User: Kirk Stowell Date: 10/14/99   Time: 12:41p
00033  * Updated in $/CodeJock/Include
00034  * Added source control history to file header.
00035  *
00036  ***************************************************************************/
00038
00039 #ifndef __CJMENU_H__
00040 #define __CJMENU_H__
00041
00042 #include <afxtempl.h>
00043
00044 // CCJMenuData class. Fill this class structure to define a single menu item:
00045
00046 class _CJX_EXT_CLASS CCJMenuData
00047 {
00048     wchar_t *m_szMenuText;
00049 public:
00050     CCJMenuData () {menuIconNormal=-1;xoffset=-1;bitmap=NULL;
00051     nFlags=0;nID=0;syncflag=0;m_szMenuText=NULL;};
00052     void SetAnsiString(LPCSTR szAnsiString);
00053     void SetWideString(const wchar_t *szWideString);
00054     const wchar_t *GetWideString(void) {return m_szMenuText;};
00055     ~CCJMenuData ();
00056     CString GetString(void);//returns the menu text in ANSI or UNICODE
00057     int xoffset;
00058     int menuIconNormal;
00059     UINT nFlags,nID,syncflag;
00060     CImageList *bitmap;
00061 };
00062
00063 //struct CMenuItemInfo : public MENUITEMINFO {
00064 struct _CJX_EXT_CLASS CMenuItemInfo : public
00065 //MENUITEMINFO
00066 #ifndef UNICODE   //SK: this fixes warning C4097: typedef-name 'MENUITEMINFO' used as synonym for class-name 'tagMENUITEMINFOA'
00067 tagMENUITEMINFOA
00068 #else
00069 tagMENUITEMINFOW
00070 #endif
00071     {
00072     CMenuItemInfo()
00073     { memset(this, 0, sizeof(MENUITEMINFO));
00074       cbSize = sizeof(MENUITEMINFO);
00075     }
00076 };
00077
00078 typedef enum {Normal,TextOnly} HIGHLIGHTSTYLE;
00079
00080 #ifndef UNICODE
00081 #define AppendMenu AppendMenuA
00082 #define InsertMenu InsertMenuA
00083 #define InsertODMenu InsertODMenuA
00084 #define AppendODMenu AppendODMenuA
00085 #define AppendODPopupMenu AppendODPopupMenuA
00086 #define ModifyODMenu ModifyODMenuA
00087 #else
00088 #define AppendMenu AppendMenuW
00089 #define InsertMenu InsertMenuW
00090 #define InsertODMenu InsertODMenuW
00091 #define AppendODMenu AppendODMenuW
00092 #define ModifyODMenu ModifyODMenuW
00093 #define AppendODPopupMenu AppendODPopupMenuW
00094 #endif
00095
00096 class _CJX_EXT_CLASS CCJMenu : public CMenu  // Derived from CMenu
00097 {
00098     // Construction
00099 public:
00100     CCJMenu();
00101
00102     // Attributes
00103 protected:
00104     CTypedPtrArray<CPtrArray, CCJMenuData*> m_MenuList;  // Stores list of menu items
00105
00106     // When loading an owner-drawn menu using a Resource, CCJMenu must keep track of
00107     // the popup menu's that it creates. Warning, this list *MUST* be destroyed
00108     // last item first :)
00109     CTypedPtrArray<CPtrArray, HMENU>  m_SubMenus;  // Stores list of sub-menus
00110
00111     // Stores a list of all CCJMenu's ever created
00112     static CTypedPtrArray<CPtrArray, HMENU>  m_AllSubMenus;
00113
00114     // Operations
00115 public:
00116     // Overrides
00117     // ClassWizard generated virtual function overrides
00118     //{{AFX_VIRTUAL(CCustomMenu)
00119     //}}AFX_VIRTUAL
00120     // Implementation
00121 public:
00122     static BOOL IsNewShell(void);
00123     void SetBitmapBackground(COLORREF color);
00124     void SetDisableOldStyle(void);
00125     void UnSetDisableOldStyle(void);
00126     BOOL GetDisableOldStyle(void);
00127     void UnSetBitmapBackground(void);
00128     BOOL AddBitmapToImageList(CImageList *list,UINT nResourceID);
00129     BOOL LoadFromToolBar(UINT nID,UINT nToolBar,int& xoffset);
00130     void InsertSpaces(void);
00131     static LRESULT FindKeyboardShortcut(UINT nChar,UINT nFlags,CMenu *pMenu);
00132     static void UpdateMenu(CMenu *pmenu);
00133     static BOOL IsMenu(CMenu *submenu);
00134     static BOOL IsMenu(HMENU submenu);
00135     void DrawCheckMark(CDC *pDC,int x,int y,COLORREF color);
00136     void DrawRadioDot(CDC *pDC,int x,int y,COLORREF color);
00137     CCJMenu *FindMenuOption(int nId,int& nLoc);
00138     CCJMenuData *FindMenuOption(wchar_t *lpstrText);
00139     BOOL GetMenuText(UINT id,CString &string,UINT nFlags = MF_BYPOSITION );
00140     CImageList *checkmaps;
00141     BOOL checkmapsshare;
00142     int m_selectcheck;
00143     int m_unselectcheck;
00144     void LoadCheckmarkBitmap(int unselect,int select);
00145     void DitherBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth,
00146         int nHeight, HBITMAP hbm, int nXSrc, int nYSrc);
00147     void DitherBlt2(CDC *drawdc, int nXDest, int nYDest, int nWidth,
00148         int nHeight, CBitmap &bmp, int nXSrc, int nYSrc);
00149     static HBITMAP LoadSysColorBitmap(int nResourceId);
00150     BOOL GetBitmapFromImageList(CDC* pDC,CImageList *imglist,int nIndex,CBitmap &bmp);
00151
00152     virtual ~CCJMenu();  // Virtual Destructor
00153     // Drawing:
00154     virtual void DrawItem( LPDRAWITEMSTRUCT);  // Draw an item
00155     virtual void MeasureItem( LPMEASUREITEMSTRUCT );  // Measure an item
00156
00157     // Customizing:
00158
00159     void SetIconSize (int, int);  // Set icon size
00160
00161     BOOL AppendODMenuA(LPCSTR lpstrText,
00162         UINT nFlags = MF_OWNERDRAW,
00163         UINT nID = 0,
00164         int nIconNormal = -1);
00165
00166     BOOL AppendODMenuW(wchar_t *lpstrText,
00167         UINT nFlags = MF_OWNERDRAW,
00168         UINT nID = 0,
00169         int nIconNormal = -1);
00170
00171     BOOL AppendODMenuA(LPCSTR lpstrText,
00172         UINT nFlags,
00173         UINT nID,
00174         CImageList *il,
00175         int xoffset);
00176
00177     BOOL AppendODMenuW(wchar_t *lpstrText,
00178         UINT nFlags,
00179         UINT nID,
00180         CImageList *il,
00181         int xoffset);
00182
00183     BOOL AppendMenu( UINT nFlags, UINT nIDNewItem = 0, LPCTSTR lpszNewItem = NULL )
00184         { return CMenu::AppendMenu( nFlags, nIDNewItem, lpszNewItem ); }
00185
00186     BOOL AppendMenu( UINT nFlags, UINT nIDNewItem, const CBitmap* pBmp )
00187         { return CMenu::AppendMenu( nFlags, nIDNewItem, pBmp ); }
00188
00189     BOOL InsertODMenuA(UINT nPosition,
00190         LPCSTR lpstrText,
00191         UINT nFlags = MF_OWNERDRAW,
00192         UINT nID = 0,
00193         int nIconNormal = -1);
00194
00195     BOOL InsertODMenuW(UINT nPosition,
00196         wchar_t *lpstrText,
00197         UINT nFlags = MF_OWNERDRAW,
00198         UINT nID = 0,
00199         int nIconNormal = -1);
00200
00201     BOOL InsertODMenuA(UINT nPosition,
00202         LPCSTR lpstrText,
00203         UINT nFlags,
00204         UINT nID,
00205         CImageList *il,
00206         int xoffset);
00207
00208     BOOL InsertODMenuW(UINT nPosition,
00209         wchar_t *lpstrText,
00210         UINT nFlags,
00211         UINT nID,
00212         CImageList *il,
00213         int xoffset);
00214
00215     BOOL ModifyODMenuA(const char *lpstrText,UINT nID=0,int nIconNormal=-1);
00216     BOOL ModifyODMenuA(const char *lpstrText,UINT nID,CImageList *il,int xoffset);
00217     BOOL ModifyODMenuA(const char *lpstrText,UINT nID,CBitmap *bmp);
00218     BOOL ModifyODMenuA(const char *lpstrText,const char *OptionText,int nIconNormal);
00219     BOOL ModifyODMenuW(wchar_t *lpstrText,UINT nID=0,int nIconNormal=-1);
00220     BOOL ModifyODMenuW(wchar_t *lpstrText,UINT nID,CImageList *il,int xoffset);
00221     BOOL ModifyODMenuW(wchar_t *lpstrText,UINT nID,CBitmap *bmp);
00222     BOOL ModifyODMenuW(wchar_t *lpstrText,wchar_t *OptionText,int nIconNormal);
00223     CCJMenuData *NewODMenu(UINT pos,UINT nFlags,UINT nID,CString string);
00224     void SynchronizeMenu(void);
00225     void InitializeMenuList(int value);
00226     void DeleteMenuList(void);
00227     CCJMenuData *FindMenuList(UINT nID);
00228     virtual BOOL LoadMenu(LPCTSTR lpszResourceName);  // Load a menu
00229     virtual BOOL LoadMenu(int nResource);  // ...
00230     void AddFromToolBar(CToolBar* pToolBar, int nResourceID);
00231     BOOL Draw3DCheckmark(CDC *dc, const CRect& rc,BOOL bSelected,
00232         HBITMAP hbmCheck);
00233     BOOL LoadToolbar(UINT nToolBar);
00234     BOOL LoadToolbars(const UINT *arID,int n);
00235
00236     // new overrides for dynamic menu's
00237     BOOL    RemoveMenu(UINT uiId,UINT nFlags);
00238     BOOL    DeleteMenu(UINT uiId,UINT nFlags);
00239     BOOL  AppendMenuA(UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,int nIconNormal=-1);
00240     BOOL  AppendMenuA(UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,CImageList *il,int xoffset);
00241     BOOL  AppendMenuA(UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,CBitmap *bmp);
00242     BOOL  AppendMenuW(UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,int nIconNormal=-1);
00243     BOOL  AppendMenuW(UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,CImageList *il,int xoffset);
00244     BOOL  AppendMenuW(UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,CBitmap *bmp);
00245     BOOL  InsertMenuA(UINT nPosition,UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,int nIconNormal=-1);
00246     BOOL  InsertMenuA(UINT nPosition,UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,CImageList *il,int xoffset);
00247     BOOL  InsertMenuA(UINT nPosition,UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,CBitmap *bmp);
00248     BOOL  InsertMenuW(UINT nPosition,UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,int nIconNormal=-1);
00249     BOOL  InsertMenuW(UINT nPosition,UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,CImageList *il,int xoffset);
00250     BOOL  InsertMenuW(UINT nPosition,UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,CBitmap *bmp);
00251     CCJMenu* AppendODPopupMenuA(LPCSTR lpstrText);
00252     CCJMenu* AppendODPopupMenuW(wchar_t *lpstrText);
00253
00254     // Destoying:
00255
00256     virtual BOOL DestroyMenu();
00257
00258     // Generated message map functions
00259 protected:
00260     int m_iconX,m_iconY;
00261     COLORREF m_bitmapBackground;
00262     BOOL m_bitmapBackgroundFlag;
00263     BOOL disable_old_style;
00264 };
00265
00266 #endif
00267
00268 //*************************************************************************
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJMenuBar.h Source File

WinCvs/CJLib/Include/CJMenuBar.h

Go to the documentation of this file.
00001 // CJMenuBar.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based on the code written by Paul DiLascia for MSJ.
00006 //
00008 /****************************************************************************
00009  *
00010  * $Date: 1999/11/30 21:45:51 $
00011  * $Revision: 1.1.1.3 $
00012  * $Archive: /CodeJockey/Include/CJMenuBar.h $
00013  *
00014  * $History: CJMenuBar.h $
00015  *
00016  * *****************  Version 5  *****************
00017  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00018  * Updated in $/CodeJockey/Include
00019  * Updated copyright and contact information.
00020  *
00021  * *****************  Version 4  *****************
00022  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00023  * Updated in $/CodeJockey/Include
00024  *
00025  * *****************  Version 3  *****************
00026  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00027  * Updated in $/CodeJockey/Include
00028  *
00029  * *****************  Version 2  *****************
00030  * User: Kirk Stowell Date: 7/18/99    Time: 10:13p
00031  * Updated in $/CodeJockey/Include
00032  * Cleaned up inline functions, and import/export macro so that class will
00033  * be imported when linked to, and exported at compile time.
00034  *
00035  * *****************  Version 1  *****************
00036  * User: Kirk Stowell Date: 7/15/99    Time: 12:34a
00037  * Created in $/CodeJockey/Include
00038  * Initial creation. Extended the original class written by Paul DiLascia
00039  * for MSJ. Class uses CCJMenu and fixes some bugs with the original
00040  * class.
00041  *
00042  ***************************************************************************/
00044
00045 #ifndef __CJMENUBAR_H__
00046 #define __CJMENUBAR_H__
00047
00048 #if _MSC_VER > 1000
00049 #pragma once
00050 #endif // _MSC_VER > 1000
00051
00052 #include "CJToolBar.h"
00053 #include "CJMenu.h"        // CCJMenu class declaration
00054 #include "Subclass.h"
00055
00057 // CCJMenuBar uses this private class to intercept messages on behalf
00058 // of its owning frame, as well as the MDI client window. Conceptually,
00059 // these should be two different hooks, but I want to save code.
00060 //
00061 class _CJX_EXT_CLASS CCJMenuBarFrameHook : public CSubclassWnd {
00062 protected:
00063    friend class CCJMenuBar;
00064    CCJMenuBar* m_pMenuBar;
00065    CCJMenuBarFrameHook();
00066    ~CCJMenuBarFrameHook();
00067    BOOL Install(CCJMenuBar* pMenuBar, HWND hWndToHook);
00068    virtual LRESULT WindowProc(UINT msg, WPARAM wp, LPARAM lp);
00069 };
00070
00071 typedef enum TRACKINGSTATE { // menubar has three states:
00072     TRACK_NONE = 0,   // * normal, not tracking anything
00073     TRACK_BUTTON,     // * tracking buttons (F10/Alt mode)
00074     TRACK_POPUP       // * tracking popups
00075 };
00076
00078 // CCJMenuBar implements an Office 97-style menu bar. Use it the way you would
00079 // a CToolBar, only you need not call LoadToolbar. All you have to do is
00080 //
00081 // * Create the CCJMenuBar from your OnCreate or OnCreateBands handler.
00082 //
00083 // * Call LoadMenu to load a menu. This will set your frame's menu to NULL.
00084 //
00085 // * Implemenent your frame's PreTranslateMessage function, to call
00086 //   CCJMenuBar::TranslateFrameMessage.
00087 //
00088 class _CJX_EXT_CLASS CCJMenuBar : public CCJToolBar
00089 {
00090     DECLARE_DYNAMIC(CCJMenuBar)
00091 // Construction
00092 public:
00093     CCJMenuBar();
00094     virtual ~CCJMenuBar();
00095
00096     virtual BOOL Create(CWnd* pParentWnd,
00097         DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP,
00098         UINT nID = AFX_IDW_TOOLBAR);
00099
00100     virtual BOOL CreateEx(CWnd* pParentWnd, DWORD dwCtrlStyle = TBSTYLE_FLAT,
00101         DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP,
00102         CRect rcBorders = CRect(0, 0, 0, 0),
00103         UINT nID = AFX_IDW_TOOLBAR);
00104
00105 // Attributes
00106 public:
00107
00108     BOOL                m_bAutoRemoveFrameMenu; // set frame's menu to NULL
00109
00110 protected:
00111
00112     friend class CCJMenuBarFrameHook;
00113
00114     CCJMenuBarFrameHook m_frameHook;            // hooks frame window messages
00115     CStringArray        m_arStrings;            // array of menu item names
00116     int                 m_nMenuID;              // menu resource id.
00117     CCJMenu             m_popupMenu;            // the menu.
00118
00119     // menu tracking stuff:
00120     int                 m_iPopupTracking;       // which popup I'm tracking if any
00121     int                 m_iNewPopup;            // next menu to track
00122     BOOL                m_bProcessRightArrow;   // process l/r arrow keys?
00123     BOOL                m_bProcessLeftArrow;    // ...
00124     BOOL                m_bEscapeWasPressed;    // user pressed escape to exit menu
00125     CPoint              m_ptMouse;              // mouse location when tracking popup
00126     HMENU               m_hMenuTracking;        // current popup I'm tracking
00127     CFont               m_Font;                 // menu font.
00128
00129     TRACKINGSTATE       m_iTrackingState;       // current tracking state
00130
00131 // Operations
00132 public:
00133
00134     BOOL LoadMenu(UINT nID);
00135     CCJMenu* GetMenu(); // get current menu
00136     TRACKINGSTATE GetTrackingState(int& iPopup);
00137     static BOOL bTRACE;                      // set TRUE to see TRACE msgs
00138
00139 protected:
00140
00141     // helpers
00142     void RecomputeToolbarSize();
00143     void RecomputeMenuLayout();
00144     void UpdateFont();
00145     int GetNextOrPrevButton(int iButton, BOOL bPrev);
00146     void SetTrackingState(TRACKINGSTATE iState, int iButton=-1);
00147     void TrackPopup(int iButton);
00148     void ToggleTrackButtonMode();
00149     void CancelMenuAndTrackNewOne(int iButton);
00150     void OnMenuSelect(HMENU hmenu, UINT nItemID);
00151     CPoint ComputeMenuTrackPoint(const CRect& rcButn, TPMPARAMS& tpm);
00152     BOOL IsValidButton(int iButton) const;
00153     int HitTest(CPoint p) const;
00154
00155 #ifdef _DEBUG
00156     virtual void AssertValid() const;
00157     virtual void Dump(CDumpContext& dc) const;
00158 #endif
00159
00160 public:
00161 // Overrides
00162     // ClassWizard generated virtual function overrides
00163     //{{AFX_VIRTUAL(CCJMenuBar)
00164     public:
00165     virtual BOOL TranslateFrameMessage(MSG* pMsg);
00166     protected:
00167     virtual BOOL OnMenuInput(MSG& m);    // handle popup menu input
00168     virtual void OnBarStyleChange(DWORD dwOldStyle, DWORD dwNewStyle);
00169     virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
00170     //}}AFX_VIRTUAL
00171
00172 // Implementation
00173 public:
00174
00175     // Generated message map functions
00176 protected:
00177     //{{AFX_MSG(CCJMenuBar)
00178     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00179     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00180     afx_msg void OnSize(UINT nType, int cx, int cy);
00181     afx_msg void OnUpdateMenuButton(CCmdUI* pCmdUI);
00182     //}}AFX_MSG
00183     DECLARE_MESSAGE_MAP()
00184
00185     static LRESULT CALLBACK MenuInputFilter(int code, WPARAM wp, LPARAM lp);
00186 };
00187
00189 //  Inline Functions
00191
00192 _CJXLIB_INLINE BOOL CCJMenuBar::IsValidButton(int iButton) const
00193     { return 0 <= iButton && iButton < GetButtonCount(); }
00194
00195 _CJXLIB_INLINE CCJMenu* CCJMenuBar::GetMenu()
00196     { return &m_popupMenu; }
00197
00198 _CJXLIB_INLINE TRACKINGSTATE CCJMenuBar::GetTrackingState(int& iPopup)
00199     { iPopup = m_iPopupTracking; return m_iTrackingState; }
00200
00201 //{{AFX_INSERT_LOCATION}}
00202 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00203
00204 #endif // __CJMENUBAR_H__
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJMetaFileButton.h Source File

WinCvs/CJLib/Include/CJMetaFileButton.h

Go to the documentation of this file.
00001 // CJMetaFileButton.h : header file
00002 //
00003 // Copyright © 1999 Ian Brumby
00004 //
00005 // This source code may be used in compiled form in any way you desire.
00006 // Source file(s) may be redistributed unmodified by any means PROVIDING
00007 // they are not sold for profit without the authors expressed written consent,
00008 // and providing that this notice and the authors name and all copyright
00009 // notices remain intact.
00010 //
00011 // ==========================================================================
00012 // HISTORY:
00013 // ==========================================================================
00014 //          1.20    21 Apr 1999 - Initial release.
00015 // ==========================================================================
00016 //
00018 /****************************************************************************
00019  *
00020  * $Date: 1999/11/30 21:45:51 $
00021  * $Revision: 1.1.1.2 $
00022  * $Archive: /CodeJock/Include/CJMetaFileButton.h $
00023  *
00024  * $History: CJMetaFileButton.h $
00025  *
00026  * *****************  Version 6  *****************
00027  * User: Kirk Stowell Date: 10/31/99   Time: 11:04p
00028  * Updated in $/CodeJock/Include
00029  * Overrode OnEraseBkgnd(...) and OnPaint() for flicker free drawing.
00030  *
00031  * *****************  Version 5  *****************
00032  * User: Kirk Stowell Date: 10/26/99   Time: 10:45p
00033  * Updated in $/CodeJock/Include
00034  * Made class methods virtual for inheritance purposes.
00035  *
00036  * *****************  Version 4  *****************
00037  * User: Kirk Stowell Date: 10/14/99   Time: 12:41p
00038  * Updated in $/CodeJock/Include
00039  * Added source control history to file header.
00040  *
00041  ***************************************************************************/
00043
00044 #ifndef __CJMETAFILEBUTTON_H__
00045 #define __CJMETAFILEBUTTON_H__
00046
00047 #if _MSC_VER > 1000
00048 #pragma once
00049 #endif // _MSC_VER > 1000
00050
00051 // CCJMetaFileButton is a CButton derived class which is used by
00052 // the CCJFlatTabCtrl class.
00053 class _CJX_EXT_CLASS CCJMetaFileButton : public CButton
00054 {
00055 // Construction
00056 public:
00057     CCJMetaFileButton();
00058
00059 // Attributes
00060 public:
00061
00062 // Operations
00063 public:
00064     virtual void SetMetaFiles(HENHMETAFILE hMetaFile,
00065         HENHMETAFILE hMetaFileSel = NULL,
00066         HENHMETAFILE hMetaFileFocus = NULL,
00067         HENHMETAFILE hMetaFileDisabled = NULL);
00068
00069 // Overrides
00070     // ClassWizard generated virtual function overrides
00071     //{{AFX_VIRTUAL(CCJMetaFileButton)
00072     public:
00073     virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
00074     //}}AFX_VIRTUAL
00075
00076 // Implementation
00077 public:
00078     virtual ~CCJMetaFileButton();
00079
00080     // Generated message map functions
00081 protected:
00082     //{{AFX_MSG(CCJMetaFileButton)
00083     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00084     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00085     afx_msg void OnPaint();
00086     //}}AFX_MSG
00087     DECLARE_MESSAGE_MAP()
00088
00089 private:
00090     HENHMETAFILE m_hEnhMetaFile;
00091     HENHMETAFILE m_hEnhMetaFileSel;
00092     HENHMETAFILE m_hEnhMetaFileFocus;
00093     HENHMETAFILE m_hEnhMetaFileDisabled;
00094 };
00095
00097
00098 //{{AFX_INSERT_LOCATION}}
00099 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00100
00101 #endif // __CJMETAFILEBUTTON_H__
Generated on Sun Feb 24 01:21:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJMiniDockFrameWnd.h Source File

WinCvs/CJLib/Include/CJMiniDockFrameWnd.h

Go to the documentation of this file.
00001 // CJMiniDockFrameWnd.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:51 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJockey/Include/CJMiniDockFrameWnd.h $
00011  *
00012  * $History: CJMiniDockFrameWnd.h $
00013  *
00014  * *****************  Version 7  *****************
00015  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00016  * Updated in $/CodeJockey/Include
00017  * Updated copyright and contact information.
00018  *
00019  * *****************  Version 6  *****************
00020  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00021  * Updated in $/CodeJockey/Include
00022  *
00023  * *****************  Version 5  *****************
00024  * User: Kirk Stowell Date: 7/18/99    Time: 10:13p
00025  * Updated in $/CodeJockey/Include
00026  * Cleaned up inline functions, and import/export macro so that class will
00027  * be imported when linked to, and exported at compile time.
00028  *
00029  * *****************  Version 4  *****************
00030  * User: Kirk Stowell Date: 6/14/99    Time: 10:46p
00031  * Updated in $/CodeJockey/Include
00032  * Cleaned up code to eliminate level 4 compilier warnings.
00033  *
00034  * *****************  Version 3  *****************
00035  * User: Kirk Stowell Date: 4/14/99    Time: 10:40p
00036  * Updated in $/CodeJockey/Include
00037  * Daniel Harth [danielh@mail.matco.ro] - Added support for diagonal
00038  * sizing.
00039  *
00040  * *****************  Version 2  *****************
00041  * User: Kirk Stowell Date: 4/03/99    Time: 10:39p
00042  * Updated in $/CodeJockey/Include
00043  * Added comments and cleaned up code.
00044  *
00045  * *****************  Version 1  *****************
00046  * User: Kirk Stowell Date: 1/16/99    Time: 10:39p
00047  * Created in $/CodeJockey/Include
00048  * Initial release.
00049  *
00050  ***************************************************************************/
00052
00053 #ifndef __CJMINIDOCKFRAMEWND_H__
00054 #define __CJMINIDOCKFRAMEWND_H__
00055
00056 #if _MSC_VER >= 1000
00057 #pragma once
00058 #endif // _MSC_VER >= 1000
00059
00060 // CCJMiniDockFrameWnd is a CMiniDockFrameWnd class which is used to
00061 // handle docking for the CCJControlBar class.
00062 class _CJX_EXT_CLASS CCJMiniDockFrameWnd : public CMiniDockFrameWnd
00063 {
00064     DECLARE_DYNCREATE(CCJMiniDockFrameWnd)
00065
00066 public:
00067
00068     // Default constructor
00069     //
00070     CCJMiniDockFrameWnd();
00071
00072     // Virtual destructor
00073     //
00074     virtual ~CCJMiniDockFrameWnd();
00075
00076 protected:
00077
00078     // make CDockBar a friend to this class for access to member data
00079     //
00080     friend class CDockBar;
00081
00082 // Overrides
00083     // ClassWizard generated virtual function overrides
00084     //{{AFX_VIRTUAL(CCJMiniDockFrameWnd)
00085     public:
00086     virtual BOOL Create(CWnd* pParent, DWORD dwBarStyle);
00087     //}}AFX_VIRTUAL
00088
00089 // Generated message map functions
00090 protected:
00091     //{{AFX_MSG(CCJMiniDockFrameWnd)
00092     afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
00093     afx_msg void OnNcLButtonDblClk(UINT nHitTest, CPoint point);
00094     //}}AFX_MSG
00095     DECLARE_MESSAGE_MAP()
00096 };
00097
00099
00100 //{{AFX_INSERT_LOCATION}}
00101 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00102
00103 #endif // __CJMINIDOCKFRAMEWND_H__
00104
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJOutlookBar.h Source File

WinCvs/CJLib/Include/CJOutlookBar.h

Go to the documentation of this file.
00001 // CJOutlookBar.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:51 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/Include/CJOutlookBar.h $
00011  *
00012  * $History: CJOutlookBar.h $
00013  *
00014  * *****************  Version 11  *****************
00015  * User: Kirk Stowell Date: 10/30/99   Time: 2:19p
00016  * Updated in $/CodeJock/Include
00017  * Added COLORREF members to class to eliminate continuous calls to
00018  * GetSysColor(...). Overrode OnSysColorChange() to re-initialize COLORREF
00019  * variables.
00020  *
00021  * *****************  Version 10  *****************
00022  * User: Kirk Stowell Date: 10/26/99   Time: 10:45p
00023  * Updated in $/CodeJock/Include
00024  * Made class methods virtual for inheritance purposes.
00025  *
00026  * *****************  Version 9  *****************
00027  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00028  * Updated in $/CodeJockey/Include
00029  * Updated copyright and contact information.
00030  *
00031  * *****************  Version 8  *****************
00032  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00033  * Updated in $/CodeJockey/Include
00034  *
00035  * *****************  Version 7  *****************
00036  * User: Kirk Stowell Date: 7/25/99    Time: 3:16a
00037  * Updated in $/CodeJockey/Include
00038  * Added ResetContent() thanks to Hiren Patel [hpatel@spss.com] for
00039  * pointing this out.
00040  *
00041  * *****************  Version 6  *****************
00042  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00043  * Updated in $/CodeJockey/Include
00044  *
00045  * *****************  Version 5  *****************
00046  * User: Kirk Stowell Date: 7/18/99    Time: 10:13p
00047  * Updated in $/CodeJockey/Include
00048  * Cleaned up inline functions, and import/export macro so that class will
00049  * be imported when linked to, and exported at compile time.
00050  *
00051  * *****************  Version 4  *****************
00052  * User: Kirk Stowell Date: 4/03/99    Time: 10:43p
00053  * Updated in $/CodeJockey/Include
00054  * Added comments and cleaned up code.
00055  *
00056  * *****************  Version 3  *****************
00057  * User: Kirk Stowell Date: 3/03/99    Time: 10:43p
00058  * Updated in $/CodeJockey/Include
00059  * Changed images list's to pointer vars passed into class.
00060  *
00061  * *****************  Version 2  *****************
00062  * User: Kirk Stowell Date: 2/24/99    Time: 10:42p
00063  * Updated in $/CodeJockey/Include
00064  * Christopher Brown (Allknowing@earthlink.net) some modifications to
00065  * correct icon resource leak, and eliminate screen flicker.
00066  *
00067  * *****************  Version 1  *****************
00068  * User: Kirk Stowell Date: 10/17/98   Time: 10:42p
00069  * Created in $/CodeJockey/Include
00070  * Initial re-write and release.
00071  *
00072  ***************************************************************************/
00074
00075 #ifndef __CJOUTLOOKBAR_H__
00076 #define __CJOUTLOOKBAR_H__
00077
00078 #if _MSC_VER >= 1000
00079 #pragma once
00080 #endif // _MSC_VER >= 1000
00081
00082 // CContentItems is a utility class used as a Container for
00083 // CJOutlookBar menu items.
00084 class _CJX_EXT_CLASS CContentItems
00085 {
00086 public:
00087
00088     // non-default constructor used to initialize
00089     // member data
00090     //
00091     CContentItems(UINT nID, CString str);
00092
00093 protected:
00094
00095     UINT    m_nImageID; // index of menu item
00096     CString m_csText;   // text of menu item
00097
00098 public:
00099
00100     // overloaded operator which copies a CContentItem object
00101     //
00102     void operator = (CContentItems& pItems);
00103
00104     // returns the index of a menu item
00105     //
00106     virtual UINT GetImageID();
00107
00108     // returns the text of a menu item
00109     //
00110     virtual CString GetText();
00111 };
00112
00113 // CJOutlookBar is a CListBox derived class which simulates a control simular
00114 // to the Outlook bar as seen in Outlook, can only be used with the
00115 // LBS_OWNERDRAWVARIABLE style bit set. very generic
00116 class _CJX_EXT_CLASS CCJOutlookBar : public CListBox
00117 {
00118     DECLARE_DYNAMIC(CCJOutlookBar)
00119
00120 public:
00121
00122     // Default constructor
00123     //
00124     CCJOutlookBar();
00125
00126     // Virtual destructor
00127     //
00128     virtual ~CCJOutlookBar();
00129
00130 protected:
00131
00132     CWnd*           m_pOwner;           // points to the parent window for this control see SetOwner(...)
00133     CPoint          m_point;            // holds the cursor position
00134     CImageList*     m_pImageListLarge;  // points to the small image list for this control see SetImageLists(...)
00135     CImageList*     m_pImageListSmall;  // points to the large image list for this control see SetImageLists(...)
00136     CContentItems*  m_pContents;        // points to a CContentItem array see SetItems(...)
00137     int             m_nNumItems;        // number of menu items in this control see SetItems(...)
00138     int             m_nIndex;           // currently selected menu index
00139     bool            m_bHilight;         // true when menu item is selected
00140     bool            m_bLBDown;          // true when left mouse button is pressed
00141     CFont           m_Font;             // font used by the control.
00142     COLORREF        m_clrHilite;        // set to ::GetSysColor(COLOR_BTNHIGHLIGHT)
00143     COLORREF        m_clrShadow;        // set to ::GetSysColor(COLOR_BTNSHADOW)
00144     COLORREF        m_clrDkShad;        // set to ::GetSysColor(COLOR_3DDKSHADOW)
00145     COLORREF        m_clrNormal;        // set to ::GetSysColor(COLOR_BTNFACE)
00146     COLORREF        m_clrTextNm;        // set to ::GetSysColor(COLOR_WINDOW)
00147
00148 public:
00149
00150     // sets the large and small image lists for the control. currently
00151     // only large image list is implemented
00152     //
00153     virtual void SetImageLists(CImageList* pImageListSmall=NULL, CImageList* pImageListLarge=NULL);
00154
00155     // sets the CContentItem array and m_nNumItems member variables
00156     //
00157     virtual void SetItems(CContentItems* pItems, int nNumItems);
00158
00159     // sets the window that will receive messages from this control
00160     //
00161     virtual void SetOwner(CWnd* pWnd);
00162
00163     // called by the control to initialize the controls font.
00164     //
00165     virtual void UpdateFont();
00166
00167
00168 // Overrides
00169     // ClassWizard generated virtual function overrides
00170     //{{AFX_VIRTUAL(CCJOutlookBar)
00171     public:
00172     virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
00173     virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
00174     //}}AFX_VIRTUAL
00175
00176 // Generated message map functions
00177 protected:
00178     //{{AFX_MSG(CCJOutlookBar)
00179     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00180     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00181     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00182     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00183     afx_msg void OnTimer(UINT nIDEvent);
00184     afx_msg void OnPaint();
00185     afx_msg void OnSysColorChange();
00186     //}}AFX_MSG
00187     DECLARE_MESSAGE_MAP()
00188 };
00189
00191 //  Inline Functions for CContentItems
00193
00194 _CJXLIB_INLINE CContentItems::CContentItems( UINT nID, CString str )
00195     { m_nImageID = nID; m_csText = str; }
00196
00197 _CJXLIB_INLINE CString CContentItems::GetText()
00198     { return m_csText; }
00199
00200 _CJXLIB_INLINE UINT CContentItems::GetImageID()
00201     { return m_nImageID; }
00202
00203 _CJXLIB_INLINE void CContentItems::operator = ( CContentItems& pItems )
00204     { m_nImageID = pItems.m_nImageID; m_csText = pItems.m_csText; }
00205
00207 //  Inline Functions for CCJOutlookBar
00209
00210 _CJXLIB_INLINE void CCJOutlookBar::SetImageLists(CImageList* pImageListSmall, CImageList* pImageListLarge)
00211     { m_pImageListLarge = pImageListLarge; m_pImageListSmall = pImageListSmall; }
00212
00213 _CJXLIB_INLINE void CCJOutlookBar::SetItems(CContentItems * pItems, int nNumItems)
00214     { m_pContents = pItems; m_nNumItems = nNumItems; ResetContent(); for (int i = 0; i < nNumItems; ++i) AddString(m_pContents[i].GetText()); }
00215
00216 _CJXLIB_INLINE void CCJOutlookBar::SetOwner(CWnd* pWnd)
00217     { m_pOwner = pWnd; }
00218
00219 #define OBN_SELENDOK    (WM_USER + 1)   // for message handler
00220 #define OB_CYBUTTON     70              // average button height
00221
00223
00224 //{{AFX_INSERT_LOCATION}}
00225 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00226
00227 #endif // __CJOUTLOOKBAR_H__
00228
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJPagerCtrl.h Source File

WinCvs/CJLib/Include/CJPagerCtrl.h

Go to the documentation of this file.
00001 // CJPagerCtrl.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:51 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJockey/Include/CJPagerCtrl.h $
00011  *
00012  * $History: CJPagerCtrl.h $
00013  *
00014  * *****************  Version 7  *****************
00015  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00016  * Updated in $/CodeJockey/Include
00017  * Updated copyright and contact information.
00018  *
00019  * *****************  Version 6  *****************
00020  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00021  * Updated in $/CodeJockey/Include
00022  *
00023  * *****************  Version 5  *****************
00024  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00025  * Updated in $/CodeJockey/Include
00026  *
00027  * *****************  Version 4  *****************
00028  * User: Kirk Stowell Date: 7/18/99    Time: 10:13p
00029  * Updated in $/CodeJockey/Include
00030  * Cleaned up inline functions, and import/export macro so that class will
00031  * be imported when linked to, and exported at compile time.
00032  *
00033  * *****************  Version 3  *****************
00034  * User: Kirk Stowell Date: 4/03/99    Time: 10:45p
00035  * Updated in $/CodeJockey/Include
00036  * Added comments and cleaned up code.
00037  *
00038  * *****************  Version 2  *****************
00039  * User: Kirk Stowell Date: 1/02/99    Time: 10:44p
00040  * Updated in $/CodeJockey/Include
00041  * Cleaned up class source, wrapped all pager messages.
00042  *
00043  * *****************  Version 1  *****************
00044  * User: Kirk Stowell Date: 10/02/98   Time: 10:44p
00045  * Created in $/CodeJockey/Include
00046  * First release version.
00047  *
00048  ***************************************************************************/
00050
00051 #ifndef __CJPAGERCTRL_H__
00052 #define __CJPAGERCTRL_H__
00053
00054 #if _MSC_VER >= 1000
00055 #pragma once
00056 #endif // _MSC_VER >= 1000
00057
00058 // CCJPagerCtrl is a CWnd derived class which wraps the windows
00059 // Pager common control.
00060 class _CJX_EXT_CLASS CCJPagerCtrl : public CWnd
00061 {
00062     DECLARE_DYNAMIC(CCJPagerCtrl)
00063 public:
00064
00065     // Default constructor
00066     //
00067     CCJPagerCtrl();
00068
00069     // Virtual destructor
00070     //
00071     virtual ~CCJPagerCtrl();
00072
00073 protected:
00074
00075     int m_nWidth;   // user defined scroll width see SetScrollArea(...)
00076     int m_nHeight;  // user defined scroll height see SetScrollArea(...)
00077
00078 public:
00079
00080     // this member function sets the scroll area for the
00081     // pager
00082     //
00083     void SetScrollArea (int nWidth, int nHeight);
00084
00086     // CPagerCtrl class wrappers.
00088
00089     // Sets the contained window for the pager control
00090     //
00091     void SetChild(
00092         // Handle to the window to be contained.
00093         HWND hwndChild);
00094
00095     // Forces the pager control to recalculate the size of the
00096     // contained window
00097     //
00098     void RecalcSize();
00099
00100     // Enables or disables mouse forwarding for the pager control
00101     //
00102     void ForwardMouse(
00103         // BOOL value that determines if mouse forwarding is enabled
00104         // or disabled. If this value is nonzero, mouse forwarding is
00105         // enabled. If this value is zero, mouse forwarding is disabled.
00106         BOOL bForward);
00107
00108     // Sets the current background color for the pager control
00109     //
00110     COLORREF SetBkColor(
00111         // COLORREF value that contains the new background
00112         // color of the pager control
00113         COLORREF clr);
00114
00115     // Retrieves the current background color for the pager control
00116     //
00117     COLORREF GetBkColor();
00118
00119     // Sets the current border size for the pager control
00120     //
00121     int SetBorder(
00122         // INT value that contains the new size of the
00123         // border, in pixels
00124         int iBorder);
00125
00126     // Retrieves the current border size for the pager control
00127     //
00128     int GetBorder();
00129
00130     // Sets the scroll position for the pager control
00131     //
00132     int SetPos(
00133         // INT value that contains the new scroll position, in pixels
00134         int iPos);
00135
00136     // Retrieves the current scroll position of the pager control
00137     //
00138     int GetPos();
00139
00140     // Sets the current button size for the pager control
00141     //
00142     int SetButtonSize(
00143         // INT value that contains the new button size, in pixels
00144         int iSize);
00145
00146     // Retrieves the current button size for the pager control
00147     //
00148     int GetButtonSize();
00149
00150     // Retrieves the state of the specified button in a pager control
00151     //
00152     DWORD GetButtonState(
00153         // Indicates which button to retrieve the state for
00154         int iButton);
00155
00156     // Retrieves a pager control's IDropTarget interface pointer
00157     //
00158     void GetDropTarget(
00159         // Address of an IDropTarget pointer that receives the
00160         // interface pointer
00161         IDropTarget **ppdt);
00162
00163 // Overrides
00164     // ClassWizard generated virtual function overrides
00165     //{{AFX_VIRTUAL(CCJPagerCtrl)
00166     public:
00167     virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
00168     //}}AFX_VIRTUAL
00169
00170     // Generated message map functions
00171 protected:
00172     //{{AFX_MSG(CCJPagerCtrl)
00173     virtual BOOL OnPagerScroll(NMPGSCROLL* pNMPGScroll, LRESULT * pResult);
00174     virtual BOOL OnPagerCalcSize(NMPGCALCSIZE * pNMPGCalcSize, LRESULT* pResult);
00175     //}}AFX_MSG
00176     DECLARE_MESSAGE_MAP()
00177 };
00178
00180 //  Inline Functions
00182
00183 _CJXLIB_INLINE void CCJPagerCtrl::SetScrollArea (int nWidth, int nHeight)
00184     { ASSERT(::IsWindow(m_hWnd)); m_nWidth  = nWidth; m_nHeight = nHeight; }
00185
00186 _CJXLIB_INLINE void CCJPagerCtrl::SetChild(HWND hwndChild)
00187     { ASSERT(::IsWindow(m_hWnd)); Pager_SetChild(m_hWnd, hwndChild); }
00188
00189 _CJXLIB_INLINE void CCJPagerCtrl::RecalcSize()
00190     { ASSERT(::IsWindow(m_hWnd)); Pager_RecalcSize(m_hWnd); }
00191
00192 _CJXLIB_INLINE void CCJPagerCtrl::ForwardMouse(BOOL bForward)
00193     { ASSERT(::IsWindow(m_hWnd)); Pager_ForwardMouse(m_hWnd, bForward); }
00194
00195 _CJXLIB_INLINE COLORREF CCJPagerCtrl::SetBkColor(COLORREF clr)
00196     { ASSERT(::IsWindow(m_hWnd)); return Pager_SetBkColor(m_hWnd, clr); }
00197
00198 _CJXLIB_INLINE COLORREF CCJPagerCtrl::GetBkColor()
00199     { ASSERT(::IsWindow(m_hWnd)); return Pager_GetBkColor(m_hWnd); }
00200
00201 _CJXLIB_INLINE int CCJPagerCtrl::SetBorder(int iBorder)
00202     { ASSERT(::IsWindow(m_hWnd)); return Pager_SetBorder(m_hWnd, iBorder); }
00203
00204 _CJXLIB_INLINE int CCJPagerCtrl::GetBorder()
00205     { ASSERT(::IsWindow(m_hWnd)); return Pager_GetBorder(m_hWnd); }
00206
00207 _CJXLIB_INLINE int CCJPagerCtrl::SetPos(int iPos)
00208     { ASSERT(::IsWindow(m_hWnd)); return Pager_SetPos(m_hWnd, iPos); }
00209
00210 _CJXLIB_INLINE int CCJPagerCtrl::GetPos()
00211     { ASSERT(::IsWindow(m_hWnd)); return Pager_GetPos(m_hWnd); }
00212
00213 _CJXLIB_INLINE int CCJPagerCtrl::SetButtonSize(int iSize)
00214     { ASSERT(::IsWindow(m_hWnd)); return Pager_SetButtonSize(m_hWnd, iSize); }
00215
00216 _CJXLIB_INLINE int CCJPagerCtrl::GetButtonSize()
00217     { ASSERT(::IsWindow(m_hWnd)); return Pager_GetButtonSize(m_hWnd); }
00218
00219 _CJXLIB_INLINE DWORD CCJPagerCtrl::GetButtonState(int iButton)
00220     { ASSERT(::IsWindow(m_hWnd)); return Pager_GetButtonState(m_hWnd, iButton); }
00221
00222 _CJXLIB_INLINE void CCJPagerCtrl::GetDropTarget(IDropTarget **ppdt)
00223     { ASSERT(::IsWindow(m_hWnd)); Pager_GetDropTarget(m_hWnd, ppdt); }
00224
00225 #ifndef PGM_SETCHILD
00226 #error CJPagerCtrl requires a newer version of the SDK than you have!
00227 #error Please update your SDK files.
00228 #endif
00229
00231
00232 //{{AFX_INSERT_LOCATION}}
00233 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00234
00235 #endif // __CJPAGERCTRL_H__
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJReBar.h Source File

WinCvs/CJLib/Include/CJReBar.h

Go to the documentation of this file.
00001 // CJReBar.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Copied from MFC, Visual C++ 6, to extend functionality to Visual C++ 5
00006 // users, with some ideas taken from Luis Barreira's article 'Classes for new IE4 controls'
00007 // http://www.codeguru.com/controls/ie4_controls_classes.shtml
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:51 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJockey/Include/CJReBar.h $
00015  *
00016  * $History: CJReBar.h $
00017  *
00018  * *****************  Version 8  *****************
00019  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00020  * Updated in $/CodeJockey/Include
00021  * Updated copyright and contact information.
00022  *
00023  * *****************  Version 7  *****************
00024  * User: Kirk Stowell Date: 7/31/99    Time: 4:27p
00025  * Updated in $/CodeJockey/Include
00026  *
00027  * *****************  Version 5  *****************
00028  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00029  * Updated in $/CodeJockey/Include
00030  *
00031  * *****************  Version 4  *****************
00032  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00033  * Updated in $/CodeJockey/Include
00034  *
00035  * *****************  Version 3  *****************
00036  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00037  * Updated in $/CodeJockey/Include
00038  *
00039  * *****************  Version 2  *****************
00040  * User: Kirk Stowell Date: 7/18/99    Time: 10:13p
00041  * Updated in $/CodeJockey/Include
00042  * Cleaned up inline functions, and import/export macro so that class will
00043  * be imported when linked to, and exported at compile time.
00044  *
00045  * *****************  Version 1  *****************
00046  * User: Kirk Stowell Date: 7/14/99    Time: 10:29p
00047  * Created in $/CodeJockey/Include
00048  * Copied from MFC v6 and techno preview for v5. Added to extend
00049  * functionality to Visual C++ 5.0 users.
00050  *
00051  ***************************************************************************/
00053
00054 #ifndef __CJREBAR_H__
00055 #define __CJREBAR_H__
00056
00057 #include "CJToolBarBase.h"
00058
00059 #ifdef _VC_VERSION_5
00060 #define AFX_IDW_REBAR       0xE804  // COMCTL32 "rebar" Bar
00061 #define AFX_IDW_DIALOGBAR   0xE805  // CDialogBar
00062 #endif // _VC_VERSION_5
00063
00065
00066 class CCJReBarCtrl;
00067
00068 // A CCJReBar object is a control bar that provides layout, persistence, and state
00069 // information for rebar controls.
00070 class _CJX_EXT_CLASS CCJReBar : public CCJToolBarBase
00071 {
00072     DECLARE_DYNAMIC(CCJReBar)
00073
00074 // Construction
00075 public:
00076     CCJReBar();
00077     BOOL Create(CWnd* pParentWnd, DWORD dwCtrlStyle = RBS_BANDBORDERS,
00078         DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_TOP,
00079         UINT nID = AFX_IDW_REBAR);
00080
00081 // Attributes
00082 public:
00083     // for direct access to the underlying common control
00084     CCJReBarCtrl& GetReBarCtrl() const;
00085
00086 // Operations
00087 public:
00088     BOOL AddBar(CWnd* pBar, LPCTSTR pszText = NULL, CBitmap* pbmp = NULL,
00089         DWORD dwStyle = RBBS_GRIPPERALWAYS | RBBS_FIXEDBMP);
00090     BOOL AddBar(CWnd* pBar, COLORREF clrFore, COLORREF clrBack,
00091         LPCTSTR pszText = NULL, DWORD dwStyle = RBBS_GRIPPERALWAYS);
00092
00093 // Implementation
00094     virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
00095     virtual int OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
00096     virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
00097     virtual CSize CalcDynamicLayout(int nLength, DWORD nMode);
00098 #ifdef _DEBUG
00099     void EnableDocking(DWORD dwDockStyle);
00100 #endif
00101
00102 protected:
00103     virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
00104     BOOL _AddBar(CWnd* pBar, REBARBANDINFO* pRBBI);
00105
00106     //{{AFX_MSG(CCJReBar)
00107     afx_msg BOOL OnNcCreate(LPCREATESTRUCT);
00108     afx_msg void OnPaint();
00109     afx_msg void OnHeightChange(NMHDR* pNMHDR, LRESULT* pResult);
00110     afx_msg void OnNcPaint();
00111     afx_msg void OnNcCalcSize(BOOL, NCCALCSIZE_PARAMS*);
00112     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00113     afx_msg LRESULT OnShowBand(WPARAM wParam, LPARAM lParam);
00114     afx_msg void OnRecalcParent();
00115     //}}AFX_MSG
00116     DECLARE_MESSAGE_MAP()
00117 };
00118
00120 // Inline functions
00122
00123 _CJXLIB_INLINE CCJReBarCtrl& CCJReBar::GetReBarCtrl() const
00124     { return *(CCJReBarCtrl*)this; }
00125
00126 #endif //__CJREBAR_H__
00127
00129
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJReBarCtrl.h Source File

WinCvs/CJLib/Include/CJReBarCtrl.h

Go to the documentation of this file.
00001 // CJReBarCtrl.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Copied from MFC, Visual C++ 6, to extend functionality to Visual C++ 5
00006 // users, with some ideas taken from Luis Barreira's article 'Classes for new IE4 controls'
00007 // http://www.codeguru.com/controls/ie4_controls_classes.shtml
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:51 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJockey/Include/CJReBarCtrl.h $
00015  *
00016  * $History: CJReBarCtrl.h $
00017  *
00018  * *****************  Version 7  *****************
00019  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00020  * Updated in $/CodeJockey/Include
00021  * Updated copyright and contact information.
00022  *
00023  * *****************  Version 6  *****************
00024  * User: Kirk Stowell Date: 7/31/99    Time: 4:27p
00025  * Updated in $/CodeJockey/Include
00026  *
00027  * *****************  Version 4  *****************
00028  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00029  * Updated in $/CodeJockey/Include
00030  *
00031  * *****************  Version 3  *****************
00032  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00033  * Updated in $/CodeJockey/Include
00034  *
00035  * *****************  Version 2  *****************
00036  * User: Kirk Stowell Date: 7/18/99    Time: 10:13p
00037  * Updated in $/CodeJockey/Include
00038  * Cleaned up inline functions, and import/export macro so that class will
00039  * be imported when linked to, and exported at compile time.
00040  *
00041  * *****************  Version 1  *****************
00042  * User: Kirk Stowell Date: 7/14/99    Time: 10:29p
00043  * Created in $/CodeJockey/Include
00044  * Copied from MFC v6 and techno preview for v5. Added to extend
00045  * functionality to Visual C++ 5.0 users.
00046  *
00047  ***************************************************************************/
00049
00050 #ifndef __CJREBARCTRL_H__
00051 #define __CJREBARCTRL_H__
00052
00054
00055   class CImageList;
00056   class CToolTipCtrl;
00057
00058 // The CCJReBarCtrl class encapsulates the functionality of a rebar control,
00059 // which is a container for a child window. The application in which the rebar
00060 // control resides assigns the child window contained by the rebar control to the
00061 // rebar band. The child window is usually another common control.
00062 class _CJX_EXT_CLASS CCJReBarCtrl : public CWnd
00063 {
00064   DECLARE_DYNAMIC(CCJReBarCtrl)
00065
00066 // Construction
00067 public:
00068   CCJReBarCtrl();
00069   BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
00070
00071 // Attributes
00072 public:
00073   UINT GetBandCount() const;
00074   BOOL GetBandInfo(UINT uBand, REBARBANDINFO* prbbi) const;
00075   UINT GetBarHeight() const;
00076   BOOL GetBarInfo(REBARINFO* prbi) const;
00077   COLORREF GetBkColor() const;
00078   IDropTarget* GetDropTarget() const;
00079   BOOL GetRect(UINT uBand, LPRECT prc) const;
00080   UINT GetRowCount() const;
00081   UINT GetRowHeight(UINT uRow) const;
00082   COLORREF GetTextColor() const;
00083   CToolTipCtrl* GetToolTips() const;
00084   int IDToIndex(UINT uBandID) const;
00085   BOOL SetBandInfo(UINT uBand, REBARBANDINFO* prbbi);
00086   BOOL SetBarInfo(REBARINFO* prbi);
00087   COLORREF SetBkColor(COLORREF clr);
00088   CWnd* SetOwner(CWnd* pWnd);
00089   COLORREF SetTextColor(COLORREF clr);
00090   void SetToolTips(CToolTipCtrl* pToolTip);
00091   CImageList* GetImageList() const;
00092   BOOL SetImageList(CImageList* pImageList);
00093   void GetBandBorders(UINT uBand, LPRECT prc) const;
00094   CPalette* GetPalette() const;
00095   CPalette* SetPalette(HPALETTE hPal);
00096   BOOL GetColorScheme(COLORSCHEME* lpcs);
00097   void SetColorScheme(const COLORSCHEME* lpcs);
00098
00099 // Operations
00100 public:
00101   void BeginDrag(UINT uBand, DWORD dwPos = (DWORD)-1);
00102   BOOL DeleteBand(UINT uBand);
00103   void DragMove(DWORD dwPos = (DWORD)-1);
00104   void EndDrag();
00105   int HitTest(RBHITTESTINFO* prbht);
00106   BOOL InsertBand(UINT uIndex, REBARBANDINFO* prbbi);
00107   void MaximizeBand(UINT uBand);
00108   void MinimizeBand(UINT uBand);
00109   BOOL ShowBand(UINT uBand, BOOL fShow = TRUE);
00110   BOOL SizeToRect(CRect& rect);
00111   BOOL MoveBand(UINT uFrom, UINT uTo);
00112 };
00113
00115 //  Inline Functions
00117
00118 _CJXLIB_INLINE UINT CCJReBarCtrl::GetBandCount() const
00119     { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, RB_GETBANDCOUNT, 0, 0L); }
00120
00121 _CJXLIB_INLINE BOOL CCJReBarCtrl::GetBandInfo(UINT uBand, REBARBANDINFO* prbbi) const
00122     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_GETBANDINFO, uBand, (LPARAM)prbbi); }
00123
00124 _CJXLIB_INLINE UINT CCJReBarCtrl::GetBarHeight() const
00125     { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, RB_GETBARHEIGHT, 0, 0L); }
00126
00127 _CJXLIB_INLINE BOOL CCJReBarCtrl::GetBarInfo(REBARINFO* prbi) const
00128     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_GETBARINFO, 0, (LPARAM)prbi); }
00129
00130 _CJXLIB_INLINE COLORREF CCJReBarCtrl::GetBkColor() const
00131     { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, RB_GETBKCOLOR, 0, 0L); }
00132
00133 _CJXLIB_INLINE IDropTarget* CCJReBarCtrl::GetDropTarget() const
00134     { ASSERT(::IsWindow(m_hWnd)); IDropTarget* pdt; ::SendMessage(m_hWnd, RB_GETDROPTARGET, 0, (LPARAM)&pdt); return pdt; }
00135
00136 _CJXLIB_INLINE BOOL CCJReBarCtrl::GetRect(UINT uBand, LPRECT prc) const
00137     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_GETRECT, uBand, (LPARAM)prc); }
00138
00139 _CJXLIB_INLINE UINT CCJReBarCtrl::GetRowCount() const
00140     { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, RB_GETROWCOUNT, 0, 0L); }
00141
00142 _CJXLIB_INLINE UINT CCJReBarCtrl::GetRowHeight(UINT uRow) const
00143     { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, RB_GETROWHEIGHT, uRow, 0L); }
00144
00145 _CJXLIB_INLINE COLORREF CCJReBarCtrl::GetTextColor() const
00146     { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, RB_GETTEXTCOLOR, 0, 0L); }
00147
00148 _CJXLIB_INLINE CToolTipCtrl* CCJReBarCtrl::GetToolTips() const
00149     { ASSERT(::IsWindow(m_hWnd)); return (CToolTipCtrl*)CWnd::FromHandle((HWND)::SendMessage(m_hWnd, RB_GETTOOLTIPS, 0, 0L)); }
00150
00151 _CJXLIB_INLINE int CCJReBarCtrl::IDToIndex(UINT uBandID) const
00152     { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, RB_IDTOINDEX, uBandID, 0L); }
00153
00154 _CJXLIB_INLINE BOOL CCJReBarCtrl::SetBandInfo(UINT uBand, REBARBANDINFO* prbbi)
00155     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_SETBANDINFO, uBand, (LPARAM)prbbi); }
00156
00157 _CJXLIB_INLINE BOOL CCJReBarCtrl::SetBarInfo(REBARINFO* prbi)
00158     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_SETBARINFO, 0, (LPARAM)prbi); }
00159
00160 _CJXLIB_INLINE COLORREF CCJReBarCtrl::SetBkColor(COLORREF clr)
00161     { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, RB_SETBKCOLOR, 0, (LPARAM)clr); }
00162
00163 _CJXLIB_INLINE CWnd* CCJReBarCtrl::SetOwner(CWnd* pWnd)
00164     { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle((HWND)::SendMessage(m_hWnd, RB_SETPARENT, (WPARAM)pWnd->m_hWnd, 0L)); }
00165
00166 _CJXLIB_INLINE COLORREF CCJReBarCtrl::SetTextColor(COLORREF clr)
00167     { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, RB_SETTEXTCOLOR, 0, (LPARAM)clr); }
00168
00169 _CJXLIB_INLINE void CCJReBarCtrl::SetToolTips(CToolTipCtrl* pToolTip)
00170     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_SETTOOLTIPS, (WPARAM)pToolTip->m_hWnd, 0L); }
00171
00172 _CJXLIB_INLINE void CCJReBarCtrl::GetBandBorders(UINT uBand, LPRECT prc) const
00173     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_GETBANDBORDERS, uBand, (LPARAM)prc); }
00174
00175 _CJXLIB_INLINE CPalette* CCJReBarCtrl::GetPalette() const
00176     { ASSERT(::IsWindow(m_hWnd)); return CPalette::FromHandle((HPALETTE)::SendMessage(m_hWnd, RB_GETPALETTE, 0, 0L)); }
00177
00178 _CJXLIB_INLINE CPalette* CCJReBarCtrl::SetPalette(HPALETTE hPal)
00179     { ASSERT(::IsWindow(m_hWnd)); return CPalette::FromHandle((HPALETTE)::SendMessage(m_hWnd, RB_SETPALETTE, 0, (LPARAM)hPal)); }
00180
00181 _CJXLIB_INLINE void CCJReBarCtrl::BeginDrag(UINT uBand, DWORD dwPos)
00182     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_BEGINDRAG, uBand, dwPos); }
00183
00184 _CJXLIB_INLINE BOOL CCJReBarCtrl::DeleteBand(UINT uBand)
00185     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_DELETEBAND, uBand, 0L); }
00186
00187 _CJXLIB_INLINE void CCJReBarCtrl::DragMove(DWORD dwPos)
00188     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_DRAGMOVE, 0, dwPos); }
00189
00190 _CJXLIB_INLINE void CCJReBarCtrl::EndDrag()
00191     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_ENDDRAG, 0, 0L); }
00192
00193 _CJXLIB_INLINE int CCJReBarCtrl::HitTest(RBHITTESTINFO* prbht)
00194     { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, RB_HITTEST, 0, (LPARAM)prbht); }
00195
00196 _CJXLIB_INLINE BOOL CCJReBarCtrl::InsertBand(UINT uIndex, REBARBANDINFO* prbbi)
00197     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_INSERTBAND, uIndex, (LPARAM)prbbi); }
00198
00199 _CJXLIB_INLINE void CCJReBarCtrl::MaximizeBand(UINT uBand)
00200     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_MAXIMIZEBAND, uBand, 0L); }
00201
00202 _CJXLIB_INLINE void CCJReBarCtrl::MinimizeBand(UINT uBand)
00203     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_MINIMIZEBAND, uBand, 0L); }
00204
00205 _CJXLIB_INLINE BOOL CCJReBarCtrl::ShowBand(UINT uBand, BOOL fShow)
00206     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_SHOWBAND, uBand, fShow); }
00207
00208 _CJXLIB_INLINE BOOL CCJReBarCtrl::SizeToRect(CRect& rect)
00209     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_SIZETORECT, 0, (LPARAM)&rect); }
00210
00211 _CJXLIB_INLINE BOOL CCJReBarCtrl::MoveBand(UINT uFrom, UINT uTo)
00212     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_MOVEBAND, uFrom, uTo); }
00213
00214 #endif //__CJREBARCTRL_H__
00215
00217
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJResource.h Source File

WinCvs/CJLib/Include/CJResource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by CJResource.rc
00004 //
00005 #define IDR_POPUP_HEX_EDIT              103
00006 #define IDS_HIDE                        5000
00007 #define IDC_NODRAGGING                  5001
00008 #define IDS_NAME                        5001
00009 #define IDS_EXPAND                      5002
00010 #define IDC_DRAGGING                    5003
00011 #define IDS_SIZE                        5003
00012 #define IDS_CONTRACT                    5004
00013 #define IDC_HANDCUR                     5005
00014 #define IDS_TYPE                        5005
00015 #define IDB_BUTTON_IMAGES               5006
00016 #define IDS_MODIFIED                    5006
00017 #define IDC_TAB_CONTROL                 5007
00018 #define IDS_REGKEY                      5007
00019 #define IDR_CBAR_POPUP                  5008
00020 #define IDS_INVALID_VER                 5008
00021 #define IDC_URL_CODEJOCKEY              5009
00022 #define IDS_WIN_PLACEMENT               5009
00023 #define IDB_BTN_EXPLORER                5010
00024 #define IDS_COLOR_AUTO                  5010
00025 #define IDM_CBAR_MENU                   5011
00026 #define IDS_COLOR_CUST                  5011
00027 #define IDC_BUTTON_HIDE                 5012
00028 #define IDS_SECTION                     5012
00029 #define IDC_BUTTON_MINI                 5013
00030 #define IDS_ENTRY                       5013
00031 #define IDC_BAR_BUTTON                  5014
00032 #define IDS_REMOVEITEM                  5014
00033 #define IDC_BAR_CAPTION                 5015
00034 #define IDS_RENAMEITEM                  5015
00035 #define IDB_BTN_ARROW                   5016
00036 #define ID_GFX_LARGEICON                5017
00037 #define ID_GFX_SMALLICON                5018
00038 #define ID_GFX_REMOVEITEM               5019
00039 #define IDC_VSPLITBAR                   5020
00040 #define ID_GFX_RENAMEITEM               5021
00041 #define IDC_HSPLITBAR                   5022
00042 #define IDR_GFXOUTBAR                   5023
00043 #define IDR_POPUP_TOOLBAR               5024
00044 #define IDS_SETTINGS                    5025
00045 #define IDS_TBAR_SETTINGS               5026
00046 #define ID_POPUP_CUSTOMIZE              5027
00047 #define IDS_WNDPOS                      5028
00048 #define IDC_CAPT_BUTTON                 5029
00049 #define IDB_PUSHPIN                     5030
00050 #define IDC_LEFTBUTTON                  5031
00051 #define IDC_RIGHTBUTTON                 5032
00052 #define IDC_HOMEBUTTON                  5033
00053 #define IDC_ENDBUTTON                   5034
00054
00055 // Next default values for new objects
00056 //
00057 #ifdef APSTUDIO_INVOKED
00058 #ifndef APSTUDIO_READONLY_SYMBOLS
00059 #define _APS_NEXT_RESOURCE_VALUE        5032
00060 #define _APS_NEXT_COMMAND_VALUE         32773
00061 #define _APS_NEXT_CONTROL_VALUE         5030
00062 #define _APS_NEXT_SYMED_VALUE           101
00063 #endif
00064 #endif
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJShell.h Source File

WinCvs/CJLib/Include/CJShell.h

Go to the documentation of this file.
00001 // CJShell.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based upon the MFCENUM example. MFCENUM is a companion sample application
00006 // for Chapter 14 in "Programming the Windows 95 User Interface" by Nancy Cluts,
00007 // available in the Microsoft(R) Development Library.
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:51 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJock/Include/CJShell.h $
00015  *
00016  * $History: CJShell.h $
00017  *
00018  * *****************  Version 13  *****************
00019  * User: Kirk Stowell Date: 10/26/99   Time: 10:46p
00020  * Updated in $/CodeJock/Include
00021  * Made class methods virtual for inheritance purposes.
00022  *
00023  * *****************  Version 12  *****************
00024  * User: Kirk Stowell Date: 10/24/99   Time: 12:01a
00025  * Updated in $/CodeJock/Include
00026  * Fixed potential resource and memory leak problems.
00027  *
00028  * *****************  Version 11  *****************
00029  * User: Kirk Stowell Date: 10/14/99   Time: 10:25a
00030  * Updated in $/CodeJock/Include
00031  * Added four new shell methods which deal with PIDL's including a new
00032  * version of an Explorer context menu called DoExplorerMenu(...) which
00033  * can be used in place of the existing DoTheMenuThing(...) method.
00034  *
00035  * *****************  Version 10  *****************
00036  * User: Kirk Stowell Date: 9/13/99    Time: 5:52a
00037  * Updated in $/CodeJockey/Include
00038  * Fixed build errors which occured with UNICODE builds.
00039  *
00040  * *****************  Version 9  *****************
00041  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00042  * Updated in $/CodeJockey/Include
00043  * Updated copyright and contact information.
00044  *
00045  * *****************  Version 8  *****************
00046  * User: Kirk Stowell Date: 8/29/99    Time: 9:14p
00047  * Updated in $/CodeJockey/Include
00048  * Added Unicode compliance, thanks to Barry Burton for his help with
00049  * this.
00050  *
00051  *
00052  * *****************  Version 5  *****************
00053  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00054  * Updated in $/CodeJockey/Include
00055  *
00056  * *****************  Version 4  *****************
00057  * User: Kirk Stowell Date: 7/18/99    Time: 10:13p
00058  * Updated in $/CodeJockey/Include
00059  * Cleaned up inline functions, and import/export macro so that class will
00060  * be imported when linked to, and exported at compile time.
00061  *
00062  * *****************  Version 3  *****************
00063  * User: Kirk Stowell Date: 6/11/99    Time: 10:06p
00064  * Updated in $/CodeJockey/Include
00065  * Renamed class from CCJShellFile to CCJShell.
00066  *
00067  * *****************  Version 2  *****************
00068  * User: Kirk Stowell Date: 5/02/99    Time: 3:38p
00069  * Updated in $/CodeJockey/Include
00070  * Added version macro  _WIN32_IE, you will need to have at IE4 or greater
00071  * installed to use this class. This will ensure that the version of
00072  * SHELL32.DLL is compatible.
00073  *
00074  * *****************  Version 1  *****************
00075  * User: Kirk Stowell Date: 3/19/99    Time: 11:01p
00076  * Created in $/CodeJockey/Include
00077  * Initial re-write and release.
00078  *
00079  ***************************************************************************/
00081
00082 #ifndef __CJSHELL_H__
00083 #define __CJSHELL_H__
00084
00085 #if _WIN32_IE >= 0x0400 // Need to have at IE4 or greater installed.
00086
00087 #if _MSC_VER > 1000
00088 #pragma once
00089 #endif // _MSC_VER > 1000
00090
00091 #include <shlobj.h>
00092
00093 #define WM_SHELL_NOTIFY     WM_USER + 1
00094 #define NM_SH_SHELLMENU     1
00095
00096 // helper struct that holds list item data
00097 typedef struct tagLVID
00098 {
00099    LPSHELLFOLDER lpsfParent;
00100    LPITEMIDLIST  lpi;
00101    ULONG         ulAttribs;
00102 } LVITEMDATA, *LPLVITEMDATA;
00103
00104 // helper struct that holds tree item data
00105 typedef struct tagTVID
00106 {
00107    LPSHELLFOLDER lpsfParent;
00108    LPITEMIDLIST  lpi;
00109    LPITEMIDLIST  lpifq;
00110 } TVITEMDATA, *LPTVITEMDATA;
00111
00112 // CCJShell class is used to perform shell file operations
00113 class _CJX_EXT_CLASS CCJShell
00114 {
00115
00116 public:
00117
00118     // Default constructor
00119     //
00120     CCJShell(LPCTSTR lpszFileName=NULL);
00121
00122     // Virtual destructor
00123     //
00124     virtual ~CCJShell();
00125
00126 public:
00127
00128     int         m_iImageIndex;  // index into system image list
00129     CString     m_strPath;      // full file path used with BrowseForFolder(...)
00130     CString     m_strInitDir;   // start directory used with BrowseForFolder(...)
00131     CString     m_strSelDir;    // selected directory used with BrowseForFolder(...)
00132     CString     m_strTitle;     // dialog title used with BrowseForFolder(...)
00133
00134 protected:
00135
00136     CString     m_strFileName;          // contains the full path to a file or folder
00137     char        m_szDrive[_MAX_DRIVE];  // contains the drive letter
00138     char        m_szDir[_MAX_DIR];      // contains the directory string
00139     char        m_szFname[_MAX_FNAME];  // contains the file name minus path and ext
00140     char        m_szExt[_MAX_EXT];      // contains the file extension
00141
00142 public:
00143     virtual void SplitPath(CString strFileName, char* szDrive, char* szDir, char* szFile, char* szExt);
00144
00145     // this member function is used to retrieve a key from the registry
00146     //
00147     virtual LONG GetRegKey(HKEY key, LPCTSTR subkey, LPTSTR retdata);
00148
00149     // this member funciont is used to perform execute command
00150     //
00151     virtual HINSTANCE ShellExec(LPCTSTR lpszExec, int nShow);
00152
00153     // this member function returns the size of the file formatted in KB.
00154     //
00155     virtual CString GetFileSizeString(
00156         // a string containing the system file size
00157         LPCTSTR lpszFileSize);
00158
00159     // this member function returns a formatted string for the last
00160     // time file was written to.
00161     //
00162     virtual CString GetLastWriteTime(
00163         // points to a CTime object
00164         CTime* pTime);
00165
00166     // retrieves the path only of the current filename. if the filename
00167     // is "c:\incoming\hello.txt", this function returns "c:"
00168     //
00169     virtual CString GetFileDrive(
00170         // full path of file name to parse
00171         LPCTSTR lpszFileName=NULL);
00172
00173     // this member function determines whether a file or directory exists.
00174     //
00175     virtual BOOL Exist(
00176         // full path of file or directory name
00177         LPCTSTR lpszFileName=NULL);
00178
00179     // this member function returns the icon index of the file or folder
00180     //
00181     virtual int GetIconIndex(
00182         // full path of file or directory name.
00183         LPCTSTR lpszFileName=NULL,
00184         // can be large or small icon
00185         UINT uFlags=SHGFI_SMALLICON);
00186
00187     // this member function returns the system display name for the file.
00188     //
00189     virtual CString GetDisplayName(
00190         // full path of file or directory name.
00191         LPCTSTR lpszFileName=NULL);
00192
00193     // this member function returns the system description for the file.
00194     //
00195     virtual CString GetFileType(
00196         // full path of file or directory name.
00197         LPCTSTR lpszFileName=NULL);
00198
00199     // this member function retrieves the file extension. if the filename is
00200     // "c:\incoming\hello.txt", this function returns "txt".
00201     //
00202     virtual CString GetFileExt(
00203         // full path of file or directory name.
00204         LPCTSTR lpszFileName=NULL);
00205
00206     // this member function retrieves the title of the filename excluding
00207     // the path and extension. if the filename is "c:\incoming\hello.txt",
00208     // this function returns "hello".
00209     //
00210     virtual CString GetFileTitle(
00211         // full path of file or directory name.
00212         LPCTSTR lpszFileName=NULL);
00213
00214     // this member function retrieves the path only of the current filename.
00215     // if the filename is "c:\incoming\hello.txt", this function returns "c:\incoming\".
00216     //
00217     virtual CString GetRoot(
00218         // full path of file or directory name.
00219         LPCTSTR lpszFileName=NULL);
00220
00221     // this member function retrieves current filename minus the path if the
00222     // filename is "c:\incoming\hello.txt", this function returns "hello.txt".
00223     //
00224     virtual CString GetFileName(
00225         // full path of file or directory name.
00226         LPCTSTR lpszFileName=NULL);
00227
00228     // this member function returns the system image list for small and large icons.
00229     // if you use this method, you must call CImageList::Detach() for both
00230     // image lists
00231     //
00232     virtual void GetSystemImageList(
00233         // points to a CImageList object that contains small icons
00234         CImageList* pSmallList,
00235         // points to a CImageList object that contains large icons
00236         CImageList* pLargeList);
00237
00238     // this member function displays browse for folder dialog.
00239     //
00240     virtual BOOL BrowseForFolder(
00241         // points to the parent window
00242         CWnd* pParentWnd);
00243
00244     // callback function for the BrowseForFolder method.
00245     //
00246     static int CALLBACK BrowseCtrlCallback(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
00247
00248 // FUNCTIONS THAT DEAL WITH PIDLs
00249
00250     // this member function gets the next PIDL in the list
00251     //
00252     virtual LPITEMIDLIST Next(LPCITEMIDLIST pidl);
00253
00254     // this member function gets the size of the PIDL
00255     //
00256     virtual UINT GetSize(LPCITEMIDLIST pidl);
00257
00258     // this member function allocates a PIDL
00259     //
00260     virtual LPITEMIDLIST Create(UINT cbSize);
00261
00262     // this member function concatenates two PIDLs
00263     //
00264     virtual LPITEMIDLIST ConcatPidls(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
00265
00266     // this member function copies the ITEMID
00267     //
00268     virtual LPITEMIDLIST CopyITEMID(LPMALLOC lpMalloc, LPITEMIDLIST lpi);
00269
00270     // this member function gets the friendly name for the folder
00271     //
00272     virtual BOOL GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi, DWORD dwFlags, LPTSTR lpFriendlyName);
00273
00274     // this member function gets the Fully qualified Pidls for the folder
00275     //
00276     virtual LPITEMIDLIST GetFullyQualPidl(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi);
00277
00278     // this member function Displays a popup context menu, given a parent shell folder,
00279     // relative item id and screen location. returns TRUE on success, FALSE on failure
00280     //
00281     virtual BOOL DoTheMenuThing(
00282         // parent window handle
00283         HWND hwnd,
00284         // pointer to parent shell folder
00285         LPSHELLFOLDER lpsfParent,
00286         // pointer to item id that is relative to lpsfParent
00287         LPITEMIDLIST lpi,
00288         // screen location of where to popup the menu
00289         LPPOINT lppt);
00290
00291     // this member function gets the index for the current icon. Index is
00292     // index into system image list. returns icon index for current item.
00293     //
00294     virtual int GetIcon(
00295         // fully qualified item id list for current item.
00296         LPITEMIDLIST lpi,
00297         // flags for SHGetFileInfo()
00298         UINT uFlags);
00299
00300     // this member function gets the index for the normal and
00301     // selected icons for the current item.
00302     //
00303     virtual void GetNormalAndSelectedIcons(
00304         // fully qualified item id list for current item.
00305         LPITEMIDLIST lpifq,
00306         // pointer to treeview item we are about to add to the tree.
00307         LPTV_ITEM lptvitem);
00308
00309     // Makes a copy of the next item in an item ID list. Returns pointer to
00310     // an ITEMIDLIST containing the copied item ID.
00311     //
00312     virtual LPITEMIDLIST DuplicateItem (
00313         // Pointer to an IMalloc interface.
00314         LPMALLOC pMalloc,
00315         // Pointer to an item ID list.
00316         LPITEMIDLIST pidl);
00317
00318     // Finds the next item in an item ID list. Returns pointer to the next item.
00319     //
00320     virtual LPITEMIDLIST GetNextItem (
00321         // Pointer to an item ID list.
00322         LPITEMIDLIST pidl);
00323
00324     // Computes the number of item IDs in an item ID list. Returns number
00325     // of item IDs in the list.
00326     virtual UINT GetItemCount (
00327         // Pointer to an item ID list.
00328         LPITEMIDLIST pidl);
00329
00330     // Given a path name to a file or folder object, displays the shell's context
00331     // menu for that object and executes the menu command (if any) selected by the user.
00332     //
00333     virtual BOOL DoExplorerMenu (
00334         // Handle of the window in which the menu will be displayed.
00335         HWND hwnd,
00336         // Pointer to an ANSI or Unicode string specifying the path to the object.
00337         LPCTSTR pszPath,
00338         // x and y coordinates of the point where the menu's upper left corner should be
00339         // located, in client coordinates relative to hwnd.
00340         POINT point);
00341 };
00342
00344
00345 #endif // _WIN32_IE >= 0x0400
00346 #endif // __CJSHELL_H__
00347
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJShellList.h Source File

WinCvs/CJLib/Include/CJShellList.h

Go to the documentation of this file.
00001 // CJShellList.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based upon the MFCENUM example. MFCENUM is a companion sample application
00006 // for Chapter 14 in "Programming the Windows 95 User Interface" by Nancy Cluts,
00007 // available in the Microsoft(R) Development Library.
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:51 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJock/Include/CJShellList.h $
00015  *
00016  * $History: CJShellList.h $
00017  *
00018  * *****************  Version 9  *****************
00019  * User: Kirk Stowell Date: 10/26/99   Time: 10:46p
00020  * Updated in $/CodeJock/Include
00021  * Made class methods virtual for inheritance purposes.
00022  *
00023  * *****************  Version 8  *****************
00024  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00025  * Updated in $/CodeJockey/Include
00026  * Updated copyright and contact information.
00027  *
00028  * *****************  Version 7  *****************
00029  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00030  * Updated in $/CodeJockey/Include
00031  *
00032  * *****************  Version 6  *****************
00033  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00034  * Updated in $/CodeJockey/Include
00035  *
00036  * *****************  Version 5  *****************
00037  * User: Kirk Stowell Date: 7/18/99    Time: 10:13p
00038  * Updated in $/CodeJockey/Include
00039  * Cleaned up inline functions, and import/export macro so that class will
00040  * be imported when linked to, and exported at compile time.
00041  *
00042  * *****************  Version 4  *****************
00043  * User: Kirk Stowell Date: 6/12/99    Time: 3:00a
00044  * Updated in $/CodeJockey/Include
00045  * Cleaned up image list, view initialization and sorting to use base
00046  * class virtual function SortList(...).
00047  *
00048  * *****************  Version 3  *****************
00049  * User: Kirk Stowell Date: 5/02/99    Time: 3:38p
00050  * Updated in $/CodeJockey/Include
00051  * Added version macro  _WIN32_IE, you will need to have at IE4 or greater
00052  * installed to use this class. This will ensure that the version of
00053  * SHELL32.DLL is compatible.
00054  *
00055  * *****************  Version 2  *****************
00056  * User: Kirk Stowell Date: 5/02/99    Time: 2:05a
00057  * Updated in $/CodeJockey/Include
00058  * Added flag m_bBuildingList, set to true whenever the list is refreshed
00059  * or initialized.
00060  *
00061  * *****************  Version 1  *****************
00062  * User: Kirk Stowell Date: 3/19/99    Time: 11:03p
00063  * Created in $/CodeJockey/Include
00064  * Initial release.
00065  *
00066  ***************************************************************************/
00068
00069 #ifndef __CJSHELLLIST_H__
00070 #define __CJSHELLLIST_H__
00071
00072 #if _WIN32_IE >= 0x0400 // Need to have at IE4 or greater installed.
00073
00074 #if _MSC_VER > 1000
00075 #pragma once
00076 #endif // _MSC_VER > 1000
00077
00078 #include "CJShell.h"
00079 #include "CJListCtrl.h"
00080
00081 // class forwards
00082 class CCJShellTree;
00083
00084 // CCJShellList is a CCJListCtrl derived class which is used to display
00085 // system files and folders, typically associated with a CCJShellTree object
00086 class _CJX_EXT_CLASS CCJShellList : public CCJListCtrl
00087 {
00088     DECLARE_DYNAMIC(CCJShellList)
00089
00090 public:
00091
00092     // Default constructor
00093     //
00094     CCJShellList();
00095
00096     // Virtual destructor
00097     //
00098     virtual ~CCJShellList();
00099
00100 public:
00101
00102     CCJShell        m_shell;            // used for shell operations
00103     CCJShellTree*   m_pTreeCtrl;        // points to a CCJShellTree that is associated with this control
00104     BOOL            m_bBuildingList;
00105     BOOL            m_bShowHidden;
00106
00107 public:
00108     virtual void BuildDefaultColumns();
00109
00110     // this member function rebuilds the current directory list.
00111     //
00112     virtual void RefreshList();
00113
00114     // call this member function to associate a CCJShellTree object with
00115     // this control
00116     //
00117     virtual void AssociateTree(CCJShellTree *pTreeCtrl);
00118
00119     // this member function is called to initialize the system image list
00120     // used by the list control
00121     //
00122     virtual BOOL InitSystemImageLists();
00123
00124     // this member function is called to initialize the list control items
00125     //
00126     virtual BOOL InitListViewItems(
00127         // Pointer to TreeView item data
00128         LPTVITEMDATA lptvid,
00129         // Pointer to parent shell folder
00130         LPSHELLFOLDER lpsf);
00131
00132     // this member function is called to actually populate the list control
00133     // items
00134     //
00135     virtual BOOL PopulateListView(LPTVITEMDATA lptvid, LPSHELLFOLDER lpsf);
00136
00137     // this member function is called to insert a single item into the
00138     // list control
00139     //
00140     virtual int InsertListItem(CString strFileName, BOOL bParse=TRUE);
00141
00142     // Callback routine for sorting list
00143     //
00144     static int CALLBACK ListViewCompareProc(LPARAM, LPARAM, LPARAM);
00145
00146     // override this member function in your derived class to
00147     // peform custom sort routines.
00148     //
00149     virtual bool SortList(
00150         // passed in from control, index of column clicked.
00151         int nCol,
00152         // passed in from control, true if sort order should be ascending.
00153         bool bAscending );
00154
00155 // Overrides
00156     // ClassWizard generated virtual function overrides
00157     //{{AFX_VIRTUAL(CCJShellList)
00158     //}}AFX_VIRTUAL
00159
00160     // Generated message map functions
00161 protected:
00162     //{{AFX_MSG(CCJShellList)
00163     afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
00164     afx_msg void OnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult);
00165     afx_msg void OnGetdispinfo(NMHDR* pNMHDR, LRESULT* pResult);
00166     //}}AFX_MSG
00167     afx_msg long OnShellNotify(WPARAM wParam, LPARAM lParam);
00168
00169     DECLARE_MESSAGE_MAP()
00170 };
00171
00173 //  Inline Functions
00175
00176 _CJXLIB_INLINE void CCJShellList::AssociateTree(CCJShellTree *pTreeCtrl)
00177     { ASSERT( pTreeCtrl ); m_pTreeCtrl = pTreeCtrl; }
00178
00180
00181 //{{AFX_INSERT_LOCATION}}
00182 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00183
00184 #endif // _WIN32_IE >= 0x0400
00185 #endif // __CJSHELLLIST_H__
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJShellTree.h Source File

WinCvs/CJLib/Include/CJShellTree.h

Go to the documentation of this file.
00001 // CJShellTree.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based upon the MFCENUM example. MFCENUM is a companion sample application
00006 // for Chapter 14 in "Programming the Windows 95 User Interface" by Nancy Cluts,
00007 // available in the Microsoft(R) Development Library.
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:51 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJock/Include/CJShellTree.h $
00015  *
00016  * $History: CJShellTree.h $
00017  *
00018  * *****************  Version 10  *****************
00019  * User: Kirk Stowell Date: 10/30/99   Time: 2:19p
00020  * Updated in $/CodeJock/Include
00021  * Changed base class from CTreeCtrl to CCJTreeCtrl for flicker free
00022  * drawing.
00023  *
00024  * *****************  Version 9  *****************
00025  * User: Kirk Stowell Date: 10/26/99   Time: 10:47p
00026  * Updated in $/CodeJock/Include
00027  * Made class methods virtual for inheritance purposes.
00028  *
00029  * *****************  Version 8  *****************
00030  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00031  * Updated in $/CodeJockey/Include
00032  * Updated copyright and contact information.
00033  *
00034  * *****************  Version 7  *****************
00035  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00036  * Updated in $/CodeJockey/Include
00037  *
00038  * *****************  Version 6  *****************
00039  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00040  * Updated in $/CodeJockey/Include
00041  *
00042  * *****************  Version 5  *****************
00043  * User: Kirk Stowell Date: 7/18/99    Time: 10:13p
00044  * Updated in $/CodeJockey/Include
00045  * Cleaned up inline functions, and import/export macro so that class will
00046  * be imported when linked to, and exported at compile time.
00047  *
00048  * *****************  Version 4  *****************
00049  * User: Kirk Stowell Date: 6/11/99    Time: 10:14p
00050  * Updated in $/CodeJockey/Include
00051  * Cleaned up system image list initialization.
00052  *
00053  * *****************  Version 3  *****************
00054  * User: Kirk Stowell Date: 5/02/99    Time: 3:38p
00055  * Updated in $/CodeJockey/Include
00056  * Added version macro  _WIN32_IE, you will need to have at IE4 or greater
00057  * installed to use this class. This will ensure that the version of
00058  * SHELL32.DLL is compatible.
00059  *
00060  * *****************  Version 2  *****************
00061  * User: Kirk Stowell Date: 3/19/99    Time: 11:05p
00062  * Updated in $/CodeJockey/Include
00063  * Initial re-write and release.
00064  *
00065  * *****************  Version 1  *****************
00066  * User: Kirk Stowell Date: 2/24/99    Time: 11:05p
00067  * Created in $/CodeJockey/Include
00068  * Overloaded PopulateTree(LPCTSTR lpszPath) in the class CCJShellTree to
00069  * fill the tree based upon path. Takehiko Mizoguti
00070  * [mizoguti@m2.sys.to.casio.co.jp]
00071  *
00072  ***************************************************************************/
00074
00075 #ifndef __CJSHELLTREE_H__
00076 #define __CJSHELLTREE_H__
00077
00078 #if _WIN32_IE >= 0x0400 // Need to have at IE4 or greater installed.
00079
00080 #if _MSC_VER > 1000
00081 #pragma once
00082 #endif // _MSC_VER > 1000
00083
00084 #include "CJShell.h"
00085 #include "CJTreeCtrl.h"
00086
00087 // class forwards
00088 class CCJShellList;
00089
00090 // CCJShellTree is a CCJTreeCtrl derived class which is used to display
00091 // system files and folders, typically associated with a CCJShellList object
00092 class _CJX_EXT_CLASS CCJShellTree : public CCJTreeCtrl
00093 {
00094     DECLARE_DYNAMIC(CCJShellTree)
00095
00096 public:
00097
00098     // Default constructor
00099     //
00100     CCJShellTree();
00101
00102     // Virtual destructor
00103     //
00104     virtual ~CCJShellTree();
00105
00106 public:
00107
00108     CCJShell        m_shell;        // used for shell operations
00109     CCJShellList*   m_pListCtrl;    // CCJShellList that is associated with this control
00110     CComboBox*      m_pComboBox;    // CComboBox that is associated with this control see AssociateCombo(...)
00111     bool            m_bRefresh;     // true when the control is to be refreshed
00112     bool            m_bOutaHere;    // true when the control is destroyed
00113     HTREEITEM       m_htiCurrent;   // currently selected tree item
00114
00115     // enumeration that holds the type of object folder or drive
00116     //
00117     enum FindAttribs { type_drive, type_folder };
00118
00119 public:
00120
00121     // this member function obtains a handle to the system image
00122     // list and attaches it to the tree control. DO NOT DELETE the imagelist
00123     //
00124     virtual BOOL InitSystemImageLists();
00125
00126     // this member function fills a branch of the TreeView control. Given the
00127     // shell folder, enumerate the subitems of this folder,
00128     // and add the appropriate items to the tree.
00129     //
00130     // This function enumerates the items in the folder identifed by lpsf.
00131     // Note that since we are filling the left hand pane, we will only add
00132     // items that are folders and/or have sub-folders.  We *could* put all
00133     // items in here if we wanted, but that's not the intent.
00134     //
00135     virtual void FillTreeView(
00136         // pointer to shell folder that we want to enumerate items
00137         LPSHELLFOLDER lpsf,
00138         // fully qualified item id list to the item that we are enumerating
00139         // items for.  In other words, this is the PIDL to the item
00140         // identified by the lpsf parameter.
00141         LPITEMIDLIST lpifq,
00142         // parent node
00143         HTREEITEM hParent);
00144
00145     // this member function processes the File.Fill/RefreshTree command
00146     //
00147     virtual void OnFill(
00148         // true when refreshing tree
00149         bool bRefresh=false);
00150
00151     // this member function populates tree based upon path. this method was
00152     // written by Takehiko Mizoguti [mizoguti@m2.sys.to.casio.co.jp]
00153     //
00154     virtual void PopulateTree(
00155         // path to populate
00156         LPCTSTR lpszPath);
00157
00158     // this member function will "tunnel" the tree to find the specified path.
00159     // this will only work when the OnFill(...) method is used to populate the tree
00160     // written by Selom Ofori [sofori@chat.carleton.ca]
00161     //
00162     virtual void TunnelTree(
00163         // path to find
00164         CString szFindPath);
00165
00166     // this member function is used to associate a CComboBox object with the
00167     // control. whenever the path changes, the combo is updated.
00168     //
00169     virtual void AssociateCombo(
00170         // combo box to associate
00171         CComboBox *pComboBox);
00172
00173     // this member function is used to associate a CCJShellList object with the
00174     // control. whenever the path changes, the list is updated.
00175     //
00176     virtual void AssociateList(
00177         // list control to associate
00178         CCJShellList *pListCtrl);
00179
00180     // this member function retrieves the path of a folder item, does not have
00181     // to be selected. Pass a CString object that will hold the folder path.
00182     // If the path is not in the filesystem(eg MyComputer)
00183     // or none is selected it returns FALSE.
00184     //
00185     virtual BOOL GetFolderItemPath(
00186         // tree item to get path for
00187         HTREEITEM hItem,
00188         // reference to a CString object to contain folder path
00189         CString &strFolderPath);
00190
00191     // this member function retrieves the path of a folder item, does not have
00192     // to be selected. Pass a CString object that will hold the folder path.
00193     // If the path is not in the filesystem(eg MyComputer)
00194     // or none is selected it returns FALSE.
00195     // written by Selom Ofori [sofori@chat.carleton.ca]
00196     //
00197     virtual BOOL GetSelectedFolderPath(
00198         // reference to a CString object to contain folder path
00199         CString &strFolderPath);
00200
00201     // this member function searchs the tree for a specified folder
00202     // written by Selom Ofori [sofori@chat.carleton.ca]
00203     //
00204     virtual BOOL SearchTree(
00205         // tree item to begin search from
00206         HTREEITEM treeNode,
00207         // string to search for
00208         CString szSearchName,
00209         // looking for folder or drive
00210         FindAttribs attr);
00211
00212     // Callback routine for sorting tree
00213     //
00214     static int CALLBACK TreeViewCompareProc(LPARAM lparam1, LPARAM lparam2, LPARAM lparamSort);
00215
00216 // Overrides
00217     // ClassWizard generated virtual function overrides
00218     //{{AFX_VIRTUAL(CCJShellTree)
00219     protected:
00220     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00221     //}}AFX_VIRTUAL
00222
00223     // Generated message map functions
00224 protected:
00225     //{{AFX_MSG(CCJShellTree)
00226     afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
00227     afx_msg void OnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult);
00228     afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
00229     afx_msg void OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult);
00230     afx_msg void OnDestroy();
00231     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00232     //}}AFX_MSG
00233
00234     DECLARE_MESSAGE_MAP()
00235 };
00236
00238 //  Inline Functions
00240
00241 _CJXLIB_INLINE void CCJShellTree::AssociateList(CCJShellList *pListCtrl)
00242     { ASSERT( pListCtrl != NULL ); m_pListCtrl = pListCtrl; }
00243
00244 _CJXLIB_INLINE void CCJShellTree::AssociateCombo(CComboBox *pComboBox)
00245     { ASSERT( pComboBox != NULL );  m_pComboBox = pComboBox; }
00246
00248
00249 //{{AFX_INSERT_LOCATION}}
00250 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00251
00252 #endif // _WIN32_IE >= 0x0400
00253 #endif // __CJSHELLTREE_H__
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJSizeDockBar.h Source File

WinCvs/CJLib/Include/CJSizeDockBar.h

Go to the documentation of this file.
00001 // CJSizeDockBar.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:51 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/Include/CJSizeDockBar.h $
00011  *
00012  * $History: CJSizeDockBar.h $
00013  *
00014  * *****************  Version 12  *****************
00015  * User: Kirk Stowell Date: 10/29/99   Time: 12:44a
00016  * Updated in $/CodeJock/Include
00017  * Added static member variable CCJSizeDockBar::m_bIsDockBar used for save
00018  * and restore bar state.
00019  *
00020  * *****************  Version 11  *****************
00021  * User: Kirk Stowell Date: 10/14/99   Time: 2:55p
00022  * Updated in $/CodeJock/Include
00023  * Fixed bug with just clicking on the sizing tracker and the control bar
00024  * resizing one pixel to the left or right. The bar will only be sized if
00025  * the cursor has changed its location.
00026  *
00027  * *****************  Version 10  *****************
00028  * User: Kirk Stowell Date: 9/16/99    Time: 2:35p
00029  * Updated in $/CodeJockey/Include
00030  * Fixed bug with save / restore bar state, and with saved bar size
00031  * changing whenever the application starts.
00032  *
00033  * *****************  Version 9  *****************
00034  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00035  * Updated in $/CodeJockey/Include
00036  * Updated copyright and contact information.
00037  *
00038  * *****************  Version 8  *****************
00039  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00040  * Updated in $/CodeJockey/Include
00041  *
00042  * *****************  Version 7  *****************
00043  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00044  * Updated in $/CodeJockey/Include
00045  *
00046  * *****************  Version 6  *****************
00047  * User: Kirk Stowell Date: 7/18/99    Time: 10:13p
00048  * Updated in $/CodeJockey/Include
00049  * Cleaned up inline functions, and import/export macro so that class will
00050  * be imported when linked to, and exported at compile time.
00051  *
00052  * *****************  Version 5  *****************
00053  * User: Kirk Stowell Date: 6/09/99    Time: 10:25p
00054  * Updated in $/CodeJockey/Include
00055  * Ioannhs Stamatopoulos (Yiannhs) [ystamat@mail.datamedia.gr] - Extended
00056  * docking windows, removed ::GetSysColor(...) calls and WM_SYSCOLORCHANGE
00057  * message handler, this is now automatically handled by the base class.
00058  * Added redraw flags to the create method and modified paint and layout
00059  * handlers to reduce flicker and un-necessary command handling. Dragging
00060  * rect now reflects actual control bar docked size. Added "flat" look to
00061  * the control bars, the control bars can now use the classic DevStudio
00062  * look, or use flat gradient gripper, borders and frame buttons. Overall,
00063  * docking windows now handle dragging, docking and floating much better,
00064  * and behave more like DevStudio.
00065  *
00066  * *****************  Version 4  *****************
00067  * User: Kirk Stowell Date: 4/14/99    Time: 11:07p
00068  * Updated in $/CodeJockey/Include
00069  * Changed CFrameWnd *pFrame = (CFrameWnd*)AfxGetApp()->m_pMainWnd; to
00070  * CFrameWnd *pFrame = GetParentFrame(); see line 432.
00071  *
00072  * *****************  Version 3  *****************
00073  * User: Kirk Stowell Date: 4/03/99    Time: 11:06p
00074  * Updated in $/CodeJockey/Include
00075  * Added comments and cleaned up code.
00076  *
00077  * *****************  Version 2  *****************
00078  * User: Kirk Stowell Date: 1/29/99    Time: 11:06p
00079  * Updated in $/CodeJockey/Include
00080  * Made some cosmetic enhancements to more closely match DevStudio docking
00081  * windows.
00082  *
00083  * *****************  Version 1  *****************
00084  * User: Kirk Stowell Date: 1/12/99    Time: 11:06p
00085  * Created in $/CodeJockey/Include
00086  * Initial release to add side-by-side docking support for CCJControlBar
00087  * class.
00088  *
00089  ***************************************************************************/
00091
00092 #ifndef __CJSIZEDOCKBAR_H__
00093 #define __CJSIZEDOCKBAR_H__
00094
00095 #if _MSC_VER >= 1000
00096 #pragma once
00097 #endif // _MSC_VER >= 1000
00098
00099 // class forwards
00100 class CCJControlBar;
00101
00102 // CCJSizeDockBar is a CDockBar derived class which is used by the framework
00103 // to handle CCJControlBar's.
00104 class _CJX_EXT_CLASS CCJSizeDockBar : public CDockBar
00105 {
00106     DECLARE_DYNAMIC(CCJSizeDockBar)
00107
00108 public:
00109
00110     // Default constructor
00111     //
00112     CCJSizeDockBar();
00113
00114     // Virtual destructor
00115     //
00116     virtual ~CCJSizeDockBar();
00117
00118     static bool m_bIsDockBar;
00119
00120 protected:
00121
00122     int         m_iSafeSpace;           // dockbar offset when docked
00123
00124     int         m_iActualSize;          // actual size of the dockbar
00125
00126     BOOL        m_bDragging;            // set to TRUE when a drag operation is in
00127                                         // process.
00128
00129     BOOL        m_bOkToDrag;            // used to determine if a drag operation
00130                                         // should occur.
00131
00132     CRect       m_rcTrack;              // used to determine rect of the tracker window.
00133     CPoint      m_ptCurDrag;            // cursor location during a drag operation.
00134     CPoint      m_ptStartDrag;          // cursor starting point during a drag operation.
00135
00136     HCURSOR     m_curHSplitBar;         // handle of the cursor to be displayed when
00137                                         // the mouse passes over a horizontal splitter.
00138
00139     HCURSOR     m_curVSplitBar;         // handle of the cursor to be displayed when
00140                                         // the mouse passes over a vertical splitter.
00141
00142     BOOL        m_bFlatBorder;          // set to TRUE for flat border.
00143     CPoint      m_ptCurrent;            // holds the current cursor position.
00144
00145 public:
00146
00147     // this member function is called by the control bar
00148     // to return the control bar to its normal size.
00149     //
00150     void Normalize(CCJControlBar*);
00151
00152     // this member function is called by the control bar
00153     // to maximize the control bar.
00154     //
00155     void Maximize(CCJControlBar*);
00156
00157     // This member function is called to recalculate the
00158     // CCJControlBar docked layout
00159     //
00160     void CalcSizeBarLayout();
00161
00162     // This member function is called to set the size
00163     // of a CCJControlBar
00164     //
00165     void SetActualSize(int iSize);
00166
00167     // this member function is called by the control bar
00168     // to perform paint operations.
00169     //
00170     void EraseNonClient();
00171
00172     // this member function is called by the control bar
00173     // to draw its borders.
00174     //
00175     void DrawBorders(CDC *pDC,CRect& rect);
00176
00177     // This member function is called to recalculate the
00178     // CCJControlBar docked layout
00179     //
00180     void RecalcAllExcept(CCJSizeDockBar *pBar);
00181
00182     // this member function returns a pointer to a CCJControlBar
00183     // object based upon docked position
00184     //
00185     CCJControlBar* GetDockedSizeBar(int nPos);
00186
00187     // this member function is used to initialize flat borders.
00188     //
00189     void FlatBorder( BOOL bFlat = TRUE );
00190
00191 protected:
00192
00193     // this member function is called to determine if there
00194     // are any additional control bars left.
00195     //
00196     BOOL IsLastControlBar(int index);
00197
00198     // this member function returns the size for a docked
00199     // control bar
00200     //
00201     void GetAvailableRect(CRect &rect);
00202
00203 // Overrides
00204     // ClassWizard generated virtual function overrides
00205     //{{AFX_VIRTUAL(CCJSizeDockBar)
00206     public:
00207     virtual CSize CalcDynamicLayout(int nLength, DWORD nMode);
00208     virtual void DoPaint(CDC *pDC);
00209     virtual BOOL IsDockBar() const;
00210     virtual BOOL IsDockSizeBar() const;
00211     virtual void OnInvertTracker(const CRect&);
00212     virtual void HitTest(const CPoint& point);
00213     //}}AFX_VIRTUAL
00214
00215 // Generated message map functions
00216 protected:
00217     //{{AFX_MSG(CCJSizeDockBar)
00218     afx_msg void OnNcPaint();
00219     afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
00220     afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
00221     afx_msg UINT OnNcHitTest(CPoint point);
00222     afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
00223     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00224     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00225     //}}AFX_MSG
00226     DECLARE_MESSAGE_MAP()
00227 };
00228
00230 //  Inline Functions
00232
00233 _CJXLIB_INLINE BOOL CCJSizeDockBar::IsDockBar() const
00234     { return m_bIsDockBar; }
00235
00236 _CJXLIB_INLINE BOOL CCJSizeDockBar::IsDockSizeBar() const
00237     { return TRUE; }
00238
00239 _CJXLIB_INLINE void CCJSizeDockBar::SetActualSize(int iSize)
00240     { m_iActualSize=iSize; }
00241
00242 _CJXLIB_INLINE void CCJSizeDockBar::FlatBorder( BOOL bFlat )
00243     { if(m_bFlatBorder!=bFlat){m_bFlatBorder=bFlat;InvalidateRect(NULL,FALSE);UpdateWindow();}}
00244
00246
00247 //{{AFX_INSERT_LOCATION}}
00248 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00249
00250 #endif // __CJSIZEDOCKBAR_H__
00251
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJSortClass.h Source File

WinCvs/CJLib/Include/CJSortClass.h

Go to the documentation of this file.
00001 // Copyright (c) Iuri Apollonio 1998
00002 // Use & modify as you want & need, and leave those 3 lines.
00003 // http://www.codeguru.com
00004 // class extended by Max Poliashenko.
00005
00006 // CJSortClass.h: interface for the CCJSortClass class.
00007 //
00009 /****************************************************************************
00010  *
00011  * $Date: 1999/11/30 21:45:51 $
00012  * $Revision: 1.1.1.2 $
00013  * $Archive: /CodeJock/Include/CJSortClass.h $
00014  *
00015  * $History: CJSortClass.h $
00016  *
00017  * *****************  Version 5  *****************
00018  * User: Kirk Stowell Date: 10/26/99   Time: 10:47p
00019  * Updated in $/CodeJock/Include
00020  * Made class methods virtual for inheritance purposes.
00021  *
00022  * *****************  Version 4  *****************
00023  * User: Kirk Stowell Date: 10/14/99   Time: 12:20p
00024  * Updated in $/CodeJock/Include
00025  * Added source control history to file header.
00026  *
00027  ***************************************************************************/
00029
00030 #ifndef __CJSORTCLASS_H__
00031 #define __CJSORTCLASS_H__
00032
00033 #if _MSC_VER > 1000
00034 #pragma once
00035 #endif // _MSC_VER > 1000
00036
00037 // enumeration data type for sorting
00038 typedef enum DATA_TYPE
00039 {
00040     DT_INT = 1,     // sort type int
00041     DT_STRING,      // sort type string
00042     DT_DATETIME,    // sort type date / time
00043     DT_DEC          // sort type decimal
00044 };
00045
00046 // This class will sort a List control by a column of text, integer, float or
00047 // date/time type. It could be easily extended for other data types.
00048 class _CJX_EXT_CLASS CCJSortClass
00049 {
00050
00051 public:
00052
00053     // Default constructor
00054     //
00055     CCJSortClass(CListCtrl* pWnd, const int nCol);
00056
00057     // Virtual destructor
00058     //
00059     virtual ~CCJSortClass();
00060
00061 public:
00062
00063     // this member function is call to peform the actual sort
00064     // proceedure.
00065     //
00066     virtual void Sort(bool bAsc, DATA_TYPE eType);
00067
00068 protected:
00069
00070     CListCtrl* m_pWnd;  // pointer to the CListCtrl object to peform sort on
00071
00072     // this callback member function is called to compare to data items
00073     // during sorting operations
00074     //
00075     static int CALLBACK Compare(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
00076
00077     // helper struct used during sorting operations
00078     //
00079     struct CSortItem
00080     {
00081         CSortItem(const DWORD dwData, const CString &strItemText);
00082         DWORD   m_dwData;
00083         CString m_strItemText;
00084     };
00085 };
00086
00088 //  Inline Functions
00090
00091 _CJXLIB_INLINE CCJSortClass::CSortItem::CSortItem(const DWORD dwData, const CString & strItemText)
00092     { m_dwData  = dwData; m_strItemText = strItemText; }
00093
00094 #endif // __CJSORTCLASS_H__
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJStatusBar.h Source File

WinCvs/CJLib/Include/CJStatusBar.h

Go to the documentation of this file.
00001 // CJStatusBar.h : header file
00002 //
00003 // Copyright © 1999 Pierre MELLINAND
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:51 $
00009  * $Revision: 1.1.1.1 $
00010  * $Archive: /CodeJock/Include/CJStatusBar.h $
00011  *
00012  * $History: CJStatusBar.h $
00013  *
00014  * *****************  Version 1  *****************
00015  * User: Kirk Stowell Date: 10/26/99   Time: 11:08p
00016  * Created in $/CodeJock/Include
00017  *
00018  ***************************************************************************/
00020
00021 #ifndef __CJSTATUSBAR_H__
00022 #define __CJSTATUSBAR_H__
00023
00024 #if _MSC_VER >= 1000
00025 #pragma once
00026 #endif // _MSC_VER >= 1000
00027
00029 // CCJStatusBarPaneControlInfo class
00030
00031 class _CJX_EXT_CLASS CCJStatusBarPaneControlInfo : public CObject
00032 {
00033     DECLARE_DYNCREATE(CCJStatusBarPaneControlInfo)
00034
00035 // Construction
00036 public:
00037     CCJStatusBarPaneControlInfo();
00038     virtual ~CCJStatusBarPaneControlInfo();
00039
00040 // Attributes
00041 public:
00042     CWnd*   m_pWnd;
00043     int     m_nPaneID;
00044     BOOL    m_bAutodelete;
00045 };
00046
00048 // CCJStatusBarPane class
00049
00050 class _CJX_EXT_CLASS CCJStatusBarPane : public CObject
00051 {
00052 // Construction
00053 public:
00054     CCJStatusBarPane();
00055     CCJStatusBarPane (CCJStatusBarPane& rPane);
00056     virtual ~CCJStatusBarPane();
00057
00058 // Attributes
00059 public:
00060     UINT    m_nID;
00061     int     m_cxText;
00062     UINT    m_nStyle;
00063     UINT    m_nFlags;
00064     CString m_strText;
00065
00066 // Operations
00067 public:
00068     CCJStatusBarPane& operator=(CCJStatusBarPane& rPane);
00069 };
00070
00072 // CCJStatusBar class
00073
00074 class _CJX_EXT_CLASS CCJStatusBar : public CStatusBar
00075 {
00076     DECLARE_DYNCREATE(CCJStatusBar)
00077
00078 // Construction
00079 public:
00080     CCJStatusBar();
00081     virtual ~CCJStatusBar();
00082
00083 // Attributes
00084 private:
00085     CArray<CCJStatusBarPaneControlInfo*, CCJStatusBarPaneControlInfo*>  m_aPans;
00086
00087 // Operations
00088 public:
00089     virtual void PositionControls();
00090     virtual CCJStatusBarPaneControlInfo* GetPanControl(int nPaneID);
00091     virtual BOOL AddControl(CWnd * pWnd, int nPaneID, BOOL bAutodeleteControl = TRUE );
00092     virtual void SetPaneWidth(int index, int cxWidth);
00093     virtual BOOL AddIndicator( int position, UINT paneID);
00094     virtual BOOL GetStatusPane(int nIndex, CCJStatusBarPane & xfxpane);
00095     virtual void RemovePane(int nPaneID);
00096
00097 // Overrides
00098     // ClassWizard generated virtual function overrides
00099     //{{AFX_VIRTUAL(CCJStatusBar)
00100     //}}AFX_VIRTUAL
00101
00102 // Implementation
00103 public:
00104
00105 // Generated message map functions
00106 protected:
00107     //{{AFX_MSG(CCJStatusBar)
00108     afx_msg void OnSize(UINT nType, int cx, int cy);
00109     //}}AFX_MSG
00110     DECLARE_MESSAGE_MAP()
00111 };
00112
00114
00115 //{{AFX_INSERT_LOCATION}}
00116 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00117
00118 #endif // __CJSTATUSBAR_H__
00119
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJTabCtrl.h Source File

WinCvs/CJLib/Include/CJTabCtrl.h

Go to the documentation of this file.
00001 // CJTabCtrl.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:51 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/Include/CJTabCtrl.h $
00011  *
00012  * $History: CJTabCtrl.h $
00013  *
00014  * *****************  Version 11  *****************
00015  * User: Kirk Stowell Date: 10/30/99   Time: 2:18p
00016  * Updated in $/CodeJock/Include
00017  * OverrodeOnEraseBkgnd(...) and OnPaint() for flicker free drawing.
00018  *
00019  * *****************  Version 10  *****************
00020  * User: Kirk Stowell Date: 10/26/99   Time: 10:48p
00021  * Updated in $/CodeJock/Include
00022  * Made class methods virtual for inheritance purposes.
00023  *
00024  * *****************  Version 9  *****************
00025  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00026  * Updated in $/CodeJockey/Include
00027  * Updated copyright and contact information.
00028  *
00029  * *****************  Version 8  *****************
00030  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00031  * Updated in $/CodeJockey/Include
00032  *
00033  * *****************  Version 7  *****************
00034  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00035  * Updated in $/CodeJockey/Include
00036  *
00037  * *****************  Version 6  *****************
00038  * User: Kirk Stowell Date: 7/18/99    Time: 10:13p
00039  * Updated in $/CodeJockey/Include
00040  * Cleaned up inline functions, and import/export macro so that class will
00041  * be imported when linked to, and exported at compile time.
00042  *
00043  * *****************  Version 5  *****************
00044  * User: Kirk Stowell Date: 7/14/99    Time: 9:44p
00045  * Updated in $/CodeJockey/Include
00046  * Added _DYNAMIC macros for access to the CObject::IsKindOf to determine
00047  * the class object at runtime. Thanks to Sid Price
00048  * [sidprice@softtools.com] for suggesting this.
00049  *
00050  * *****************  Version 4  *****************
00051  * User: Kirk Stowell Date: 6/14/99    Time: 10:47p
00052  * Updated in $/CodeJockey/Include
00053  * Cleaned up code to eliminate level 4 compilier warnings.
00054  *
00055  * *****************  Version 3  *****************
00056  * User: Kirk Stowell Date: 5/11/99    Time: 9:33p
00057  * Updated in $/CodeJockey/Include
00058  * Renamed popup menu resource id to m_popupMenuID to be consistent with
00059  * other classes.  Added member variable m_popToolbarID to contain the
00060  * toolbar resource to be used for popup menus  and m_nPos to contain the
00061  * index of the submenu in the menu resource. Added
00062  * CCJTabCtrl::Create(...) to simplify the creation process, and to set
00063  * the tab font.  Cleaned up OnRButtonDown(..) message handler which
00064  * activates the popup menu. Modified SetMenuID(...) to accept the index
00065  * of the popup menu in the menu resource.
00066  *
00067  * *****************  Version 2  *****************
00068  * User: Kirk Stowell Date: 5/02/99    Time: 5:25p
00069  * Updated in $/CodeJockey/Include
00070  * Removed class from CCJTabCtrlBar files into its own files. Added popup
00071  * menu support for CCJMenus.
00072  *
00073  * *****************  Version 1  *****************
00074  * User: Kirk Stowell Date: 5/02/99    Time: 4:34p
00075  * Created in $/CodeJockey/Include
00076  *
00077  ***************************************************************************/
00079
00080 #ifndef __CJTABCTRL_H__
00081 #define __CJTABCTRL_H__
00082
00083 #if _MSC_VER >= 1000
00084 #pragma once
00085 #endif // _MSC_VER >= 1000
00086
00087 #include "CJMenu.h"        // CCJMenu class declaration
00088
00089 // CCJTabCtrl is a CTabCtrl derived class which is used by CCJTabCtrl
00090 // to help fix problems with repainting in the tab control
00091 class _CJX_EXT_CLASS CCJTabCtrl : public CTabCtrl
00092 {
00093     DECLARE_DYNAMIC(CCJTabCtrl)
00094
00095 public:
00096
00097     // Default constructor
00098     //
00099     CCJTabCtrl();
00100
00101     // Virtual destructor
00102     //
00103     virtual ~CCJTabCtrl();
00104
00105 public:
00106
00107     UINT            m_popToolbarID; // popup menu toolbar resource id, associates
00108                                     // toolbar icons with the popup menu.
00109
00110     UINT            m_popupMenuID;  // popup menu resource id
00111     CCJMenu         m_popupMenu;    // popup menu
00112     int             m_nPos;         // index of the pop-up menu contained in the menu
00113     CFont           m_Font;         // font used by tab control.
00114
00115 public:
00116     virtual void UpdateFont();
00117
00118     // this member function is called to associate a menu and toolbar
00119     // resource with the context menu.
00120     //
00121     virtual void SetMenuID(UINT popupMenuID, UINT popToolbarID=0, int nPos=0);
00122
00123     // this member function returns the menu resource associated with
00124     // the tab control.
00125     //
00126     virtual UINT GetMenuID();
00127
00128 // Overrides
00129     // ClassWizard generated virtual function overrides
00130     //{{AFX_VIRTUAL(CCJTabCtrl)
00131     public:
00132     virtual BOOL Create(CWnd* pParentWnd, UINT nID=AFX_IDC_TAB_CONTROL, DWORD dwStyle=WS_VISIBLE|WS_CHILD|TCS_BOTTOM|TCS_TOOLTIPS|WS_CLIPSIBLINGS|WS_CLIPCHILDREN, const CRect& rect=CRect(0,0,0,0));
00133     //}}AFX_VIRTUAL
00134
00135 // Generated message map functions
00136 protected:
00137     //{{AFX_MSG(CCJTabCtrl)
00138     afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00139     afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
00140     afx_msg LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu);
00141     afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
00142     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00143     afx_msg void OnPaint();
00144     //}}AFX_MSG
00145     DECLARE_MESSAGE_MAP()
00146 };
00147
00149 //  Inline Functions
00151
00152 _CJXLIB_INLINE void CCJTabCtrl::SetMenuID(UINT popupMenuID, UINT popToolbarID, int nPos)
00153     { m_popupMenuID = popupMenuID; m_popToolbarID = popToolbarID; m_nPos = nPos; }
00154
00155 _CJXLIB_INLINE UINT CCJTabCtrl::GetMenuID()
00156     { return m_popupMenuID; }
00157
00159
00160 //{{AFX_INSERT_LOCATION}}
00161 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00162
00163 #endif // __CJTABCTRL_H__
00164
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJTabCtrlBar.h Source File

WinCvs/CJLib/Include/CJTabCtrlBar.h

Go to the documentation of this file.
00001 // CJTabCtrlBar.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:51 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/Include/CJTabCtrlBar.h $
00011  *
00012  * $History: CJTabCtrlBar.h $
00013  *
00014  * *****************  Version 16  *****************
00015  * User: Kirk Stowell Date: 10/31/99   Time: 11:29p
00016  * Updated in $/CodeJock/Include
00017  * Enabled OnInitialUpdate() to be called for tab views added to
00018  * CCJTabCtrlBar whenever the control bar is floating.
00019  *
00020  * Fixed potential resource and memory leak problems.
00021  *
00022  * Fixed problems with AddView(...) setting the wrong view index to
00023  * active.
00024  *
00025  * Added  EnableToolTips method which enables and disables the tooltips.
00026  * Thanks to Phil Baxter for help with this.
00027  *
00028  * Fixed problem with dangling pointer in DeleteView. Thanks to Gero Kuehn
00029  * [gero.kuehn@isc-soft.de] for help with this.
00030  *
00031  * Fixed potential bug with CCJTabControlBar returning image index, fixed
00032  * bug with GetTabFromPoint(...) returning invalid index.
00033  *
00034  * Made class methods virtual for inhertance purposes.
00035  *
00036  * *****************  Version 14  *****************
00037  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00038  * Updated in $/CodeJockey/Include
00039  * Updated copyright and contact information.
00040  *
00041  * *****************  Version 13  *****************
00042  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00043  * Updated in $/CodeJockey/Include
00044  *
00045  * *****************  Version 12  *****************
00046  * User: Kirk Stowell Date: 7/18/99    Time: 10:11p
00047  * Updated in $/CodeJockey/Include
00048  * Cleaned up inline functions, and import/export macro so that class will
00049  * be imported when linked to, and exported at compile time.
00050  *
00051  * *****************  Version 11  *****************
00052  * User: Kirk Stowell Date: 7/14/99    Time: 9:43p
00053  * Updated in $/CodeJockey/Include
00054  * Added _DYNAMIC macros for access to the CObject::IsKindOf to determine
00055  * the class object at runtime. Added method GetTabFromPoint which returns
00056  * the tab index based upon cursor position. Thanks to Sid Price
00057  * [sidprice@softtools.com] for suggesting this.
00058  *
00059  * *****************  Version 10  *****************
00060  * User: Kirk Stowell Date: 5/17/99    Time: 9:07p
00061  * Updated in $/CodeJockey/Include
00062  * Paul [RowingWolf@aol.com] - Added the following support methods:
00063  * void SetActiveView(CView* pUserView)
00064  * void AssociateImageIndexWithRuntimeClass(int nIndex, CRuntimeClass*
00065  * pRuntimeClass)
00066  * void AssociateImageIndexWithRuntimeClass(int nIndex, LPCTSTR
00067  * lpszRuntimeClassName)
00068  * short GetImageIndexFromRuntimeClass(CRuntimeClass* pRuntimeClass)
00069  * BOOL RemoveAllTabs().
00070  *
00071  * *****************  Version 9  *****************
00072  * User: Kirk Stowell Date: 5/11/99    Time: 10:02p
00073  * Updated in $/CodeJockey/Include
00074  * After much frustration, a class re-write. Fixed many of the issues with
00075  * painting, invalid pointers and memory leaks. Added document support for
00076  * views associated with the tab control.
00077  *
00078  * *****************  Version 8  *****************
00079  * User: Kirk Stowell Date: 4/14/99    Time: 11:53p
00080  * Updated in $/CodeJockey/Include
00081  * Added context popupMenu for CJTabCtrl to use Brent Corkum's BCMenu.
00082  *
00083  * *****************  Version 7  *****************
00084  * User: Kirk Stowell Date: 4/03/99    Time: 11:52p
00085  * Updated in $/CodeJockey/Include
00086  * Added comments and cleaned up code, modified AddView(...) to allow a
00087  * CDocument to be associated with the view added to the tab control.
00088  *
00089  * *****************  Version 6  *****************
00090  * User: Kirk Stowell Date: 3/14/99    Time: 11:51p
00091  * Updated in $/CodeJockey/Include
00092  * Gonzalo Pereyra [ persys@adinet.com.uy ] - I wanted to trap NM_RETURN
00093  * notifications in my CTreeView Class. I couldn't... It turns out that
00094  * CControlbar::PreTranslateMessage() will eat all dialog messages...It
00095  * will never get dispatched to my window. So I Overrided it in :
00096  * CCJTabCtrlBar::PreTranslateMessage(). this will allow for message
00097  * reflection and we will get NM_RETURN. I don't know if this a good
00098  * solution but for now , it works.
00099  *
00100  * *****************  Version 5  *****************
00101  * User: Kirk Stowell Date: 2/24/99    Time: 11:49p
00102  * Updated in $/CodeJockey/Include
00103  * Phil Baxter [pgb@mrjinx.demon.co.uk] - Fixed the following problems
00104  * when tabs are added after creation:
00105  * 1. The tab was created, but the view that was showing on the tab was
00106  * not visible.
00107  * 2. Get an assertion when the AddView function attempts to perform the
00108  * AddTool function.
00109  * 3. When a new view is added, although you set it to be the active view,
00110  * it isn't raised to the top of the stack in the display.
00111  * 4. The Tab name as stored in the TCB_ITEM structure is now a CString,
00112  * this removes the 32 byte limit that it previously had.
00113  * 5. New methods for obtaining the name as stored in the TCB_ITEM
00114  * structure.
00115  * 6. New Methods for deleting a view from the control, this removes the
00116  * view entirely including its  associated tab.
00117  * 7. Some minor fixes around assertions when trying to manipulate the
00118  * control when it has not had any tabs created.
00119  * 8. Added two new member functions:
00120  * void SetViewToolTip(int nView, LPCTSTR lpszLabel);
00121  * void SetViewToolTip(CRuntimeClass *pViewClass, LPCTSTR lpszLabel);
00122  *
00123  * *****************  Version 4  *****************
00124  * User: Kirk Stowell Date: 1/31/99    Time: 11:48p
00125  * Updated in $/CodeJockey/Include
00126  * Commented out 2 calls to SetActiveView(). This somewhat fixes the
00127  * problem with CTRL+TAB in activatation of MDI child windows, however if
00128  * you click inside the view, this breaks CTRL+TAB again, will look at
00129  * this when I get some free time. Thanks to Pierre Guimont
00130  * (Pierre_Guimont@mitel.com) for pointing this out.
00131  *
00132  * Added m_TabCtrl.GetRowCount() as per Rashid Thadha
00133  * rashidt@consort.co.uk) request.
00134  *
00135  * *****************  Version 3  *****************
00136  * User: Kirk Stowell Date: 1/17/99    Time: 11:46p
00137  * Updated in $/CodeJockey/Include
00138  * Added helper class CCJTabCtrl to eliminate re-painting problems such as
00139  * when the app is minimized then restored.
00140  *
00141  * *****************  Version 2  *****************
00142  * User: Kirk Stowell Date: 1/03/99    Time: 11:46p
00143  * Updated in $/CodeJockey/Include
00144  * Application freezing bug fixed by
00145  * LiangYiBin.Donald(mailto:lybd@yahoo.com)
00146  *
00147  * *****************  Version 1  *****************
00148  * User: Kirk Stowell Date: 10/17/98   Time: 11:45p
00149  * Created in $/CodeJockey/Include
00150  * Initial re-write and release.
00151  *
00152  ***************************************************************************/
00154
00155 #ifndef __CJTABCTRLBAR_H__
00156 #define __CJTABCTRLBAR_H__
00157
00158 #if _MSC_VER >= 1000
00159 #pragma once
00160 #endif // _MSC_VER >= 1000
00161
00162 #include <afxtempl.h>
00163 #include "CJControlBar.h"
00164 #include "CJTabCtrl.h"
00165
00166 // helper struct used by CCJTabCtrlBar
00167 typedef struct tagTCB_ITEM
00168 {
00169     CWnd    *pWnd;          // this points to the window associated with a tab
00170     CString szTabLabel;     // label for the tab
00171     CString szToolTipLabel; // tooltip text for the tab
00172     UINT    uiToolTipId;    // resource id for tooltip
00173 } TCB_ITEM;
00174
00175 // class forwards
00176 class CCJTabCtrl;
00177
00178 // template list used to contain tab information
00179 typedef CList <TCB_ITEM *,TCB_ITEM *> CTabViews;
00180
00181 // CCJTabCtrlBar is a CCJControl bar derived class which implements a
00182 // tabbed window simular to VisualStudio's workspace window.
00183 class _CJX_EXT_CLASS CCJTabCtrlBar : public CCJControlBar
00184 {
00185     DECLARE_DYNAMIC(CCJTabCtrlBar)
00186
00187 public:
00188
00189     // Default constructor
00190     //
00191     CCJTabCtrlBar();
00192
00193     // Virtual destructor
00194     //
00195     virtual ~CCJTabCtrlBar();
00196
00197 protected:
00198
00199     int             m_nPointTab;                // tab index set from GetTabFromPoint(...)
00200     int             m_nActiveTab;               // currently selected tab
00201     int             m_nNextToolTipId;           // tooltip resource id
00202     CView*          m_pActiveView;              // this points to the active view
00203     CTabViews       m_viewList;                 // template list containing tab information
00204     CCJTabCtrl      m_TabCtrl;                  // tab control
00205     CMapStringToPtr m_ClassNameToImageIndexMap; // Map class name to the image index
00206     BOOL            m_bToolTipsEnabled;         // TRUE if tooltips are enabled.
00207
00208 public:
00209
00210     // this member function is called to add a view to the tab control
00211     //
00212     virtual BOOL AddView(
00213         // tab text
00214         LPCTSTR lpszLabel,
00215         // CView object associated with tab
00216         CRuntimeClass *pViewClass,
00217         // CDocument associated with view
00218         CDocument* pDoc = NULL,
00219         // index of tab to add
00220         UINT nIndex=-1,
00221         // create context for view
00222         CCreateContext *pContext = NULL);
00223
00224     // this member function will remove a view based on its index
00225     //
00226     virtual void RemoveView(int nView);
00227
00228     // this member function will set a view active
00229     // based on index
00230     //
00231     virtual void SetActiveView(int nView);
00232
00233     // this member function will set a view active
00234     // based on a CView object
00235     //
00236     virtual void SetActiveView(CRuntimeClass *pViewClass);
00237
00238     // this member function returns a pointer to the
00239     // active view in the tab control
00240     //
00241     virtual CView* GetActiveView();
00242
00243     // this member function returns a pointer to a view
00244     // based on its index
00245     //
00246     virtual CView* GetView(int nView);
00247
00248     // this member function returns a pointer to a view
00249     // based on a CView object
00250     //
00251     virtual CView* GetView(CRuntimeClass *pViewClass);
00252
00253     // this member function initializes the image list
00254     // for the tab control
00255     //
00256     virtual CImageList* SetTabImageList(CImageList *pImageList);
00257
00258     // this member function will modify the style for the
00259     // tab control associated with this control.
00260     //
00261     virtual BOOL ModifyTabStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags=0);
00262
00263     // this member function will return the name for a view
00264     // based on index
00265     virtual LPCTSTR GetViewName(int nView);
00266
00267     // this member function will return the name for a view
00268     // based upon a CView object
00269     //
00270     virtual LPCTSTR GetViewName(CRuntimeClass *pViewClass);
00271
00272     // this member function will delete a view based upon
00273     // its index
00274     virtual void DeleteView(int nView);
00275
00276     // this member function will delete a view based upon
00277     // a CView object
00278     virtual void DeleteView(CRuntimeClass *pViewClass);
00279
00280     // this member function will set the tooltip for a peticular view
00281     // in the tab control based on its index
00282     //
00283     virtual void SetViewToolTip(int nView, LPCTSTR lpszLabel);
00284
00285     // this member function will set the tooltip for a peticular view
00286     //  in the tab control based on a CView object
00287     //
00288     virtual void SetViewToolTip(CRuntimeClass *pViewClass, LPCTSTR lpszLabel);
00289
00290     // this member function is called by the control bar, and
00291     // can be overloaded in derived classes to return the rect
00292     // for the child window associated with the control bar.
00293     //
00294     virtual void GetChildRect(
00295         // reference to a CRect object which contains the size of
00296         // the child window associated with the control bar.
00297         CRect &rect);
00298
00299     // this member function is used to set the resource id for the popup menu used
00300     // by the tab control.
00301     //
00302     virtual void SetTabMenuID(
00303         // id for the tab control popup menu
00304         UINT popupMenuID,
00305         // id for toolbar resource associated with popup
00306         UINT popToolbarID=0,
00307         // index position in menu resource
00308         int nPos=0);
00309
00310     // Use this member function to set the active view to the specified view -- this
00311     // provides more user control than the other SetActiveView()'s
00312     //
00313     virtual void SetActiveView(CView* pUserView);
00314
00315     // Use this member function to map the image index to the class name,
00316     // and allows the image to be set based on the view's runtime class type
00317     //
00318     virtual void AssociateImageIndexWithRuntimeClass(int nIndex, CRuntimeClass* pRuntimeClass);
00319
00320     // Use this member function to map the image index to the class name,
00321     // and allows the image to be set based on the name of the view's runtime class name
00322     //
00323     void AssociateImageIndexWithRuntimeClass(int nIndex, LPCTSTR lpszRuntimeClassName);
00324
00325     // Use this member function to clear out all the tabs, but the user MUST
00326     // take care of the views themselves
00327     //
00328     virtual BOOL RemoveAllTabs();
00329
00330     // call this member function to retrieve the tab index from
00331     // current cursor position.
00332     virtual int GetTabFromPoint(
00333         // Pointer to a CPoint object that contains the cursor
00334         // screen coordinates. Use default for current cursor position.
00335         CPoint point = CPoint(0,0));
00336
00337 protected:
00338
00339     // This member function returns the image associated with a runtime class, and
00340     // indicates which image will be displayed with the associated view class
00341     //
00342     virtual short GetImageIndexFromRuntimeClass(CRuntimeClass* pRuntimeClass);
00343
00344     // This member function is used by the tab control bar to remove an item from the
00345     // view list.
00346     //
00347     virtual void RemoveListItem(POSITION pos);
00348
00349     // This member function is used by the tab control bar to simply to perform
00350     // debug assertion validation.
00351     //
00352     virtual void OverkillAssert(CRuntimeClass *pViewClass);
00353
00354     // This member function is called by the tab control bar to resize the
00355     // tab control window.
00356     //
00357     virtual void SizeTabView(CWnd* pWnd);
00358
00359     // This member function is used by the tab control bar to return a pointer
00360     // to the tooltip control associated with this control.
00361     //
00362     virtual CToolTipCtrl* GetToolTip();
00363
00364     // This member function is used by the tab control bar to add a
00365     // tooltip to a tab.
00366     //
00367     virtual void AddToolTip(TCB_ITEM* pMember, LPCTSTR lpszLabel);
00368
00369     // This member function is used by the tab control bar to reset the tooltip control.
00370     //
00371     virtual void ResetToolTips(CToolTipCtrl* pToolTip);
00372
00373     // This member function is used by the control bar to create a tab item.
00374     //
00375     virtual TCB_ITEM* CreateTabListItem(LPCTSTR lpszLabel);
00376
00377     // This member function is used by the control bar to create a view to
00378     // be associated with a tab control item.
00379     //
00380     virtual BOOL CreateTabView(CRuntimeClass *pViewClass, CDocument *pDocument, CCreateContext *pContext);
00381
00382     // This member function enables / disables tooltips
00383     //
00384     virtual BOOL EnableToolTips(BOOL bEnable);
00385
00386 // Overrides
00387 public:
00388     // ClassWizard generated virtual function overrides
00389     //{{AFX_VIRTUAL(CCJTabCtrlBar)
00390     public:
00391     virtual BOOL PreTranslateMessage(MSG* pMsg);
00392     //}}AFX_VIRTUAL
00393
00394 // Generated message map functions
00395 protected:
00396     //{{AFX_MSG(CCJTabCtrlBar)
00397     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00398     afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
00399     afx_msg void OnTabSelChange(NMHDR* pNMHDR, LRESULT* pResult) ;
00400     //}}AFX_MSG
00401
00402     DECLARE_MESSAGE_MAP()
00403 };
00404
00406 //  Inline Functions
00408
00409 _CJXLIB_INLINE void CCJTabCtrlBar::SetTabMenuID(UINT popupMenuID, UINT popToolbarID, int nPos)
00410     { m_TabCtrl.SetMenuID(popupMenuID, popToolbarID, nPos); }
00411
00412 _CJXLIB_INLINE CView* CCJTabCtrlBar::GetActiveView()
00413     { return m_pActiveView; }
00414
00415 _CJXLIB_INLINE CImageList* CCJTabCtrlBar::SetTabImageList(CImageList *pImageList)
00416     { return m_TabCtrl.SetImageList (pImageList); }
00417
00418 _CJXLIB_INLINE BOOL CCJTabCtrlBar::ModifyTabStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags)
00419     { return m_TabCtrl.ModifyStyle(dwRemove, dwAdd, nFlags); }
00420
00422
00423 //{{AFX_INSERT_LOCATION}}
00424 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00425
00426 #endif // __CJTABCTRLBAR_H__
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJTabView.h Source File

WinCvs/CJLib/Include/CJTabView.h

Go to the documentation of this file.
00001 // CJTabView.h: interface for the CCJTabView class.
00002 //
00003 // Copyright © 1999 Mike Manzo
00004 // mailto:mmanzo@ieee.org
00005 //
00007 /****************************************************************************
00008  *
00009  * $Date: 1999/11/30 21:45:51 $
00010  * $Revision: 1.1.1.3 $
00011  * $Archive: /CodeJock/Include/CJTabView.h $
00012  *
00013  * $History: CJTabView.h $
00014  *
00015  * *****************  Version 10  *****************
00016  * User: Kirk Stowell Date: 10/30/99   Time: 2:17p
00017  * Updated in $/CodeJock/Include
00018  * Overrode OnEraseBkgnd(...) for flicker free drawing.
00019  *
00020  * *****************  Version 9  *****************
00021  * User: Kirk Stowell Date: 10/26/99   Time: 10:48p
00022  * Updated in $/CodeJock/Include
00023  * Made class methods virtual for inheritance purposes.
00024  *
00025  * *****************  Version 8  *****************
00026  * User: Kirk Stowell Date: 10/24/99   Time: 3:15a
00027  * Updated in $/CodeJock/Include
00028  *
00029  * *****************  Version 7  *****************
00030  * User: Kirk Stowell Date: 10/14/99   Time: 12:41p
00031  * Updated in $/CodeJock/Include
00032  * Added source control history to file header.
00033  *
00034  ***************************************************************************/
00036
00037 #ifndef __CJTABVIEW_H__
00038 #define __CJTABVIEW_H__
00039
00040 #if _MSC_VER > 1000
00041 #pragma once
00042 #endif // _MSC_VER > 1000
00043 // CJTabView.h : header file
00044 //
00045
00046 typedef struct tagCTV_ITEM
00047 {
00048     CWnd *pWnd;
00049     TCHAR szLabel[32];
00050 } CTV_ITEM;
00051
00052 #define TABVIEW_BORDER 3
00053
00054 // template list used to contain tab information
00055 typedef CList <CTV_ITEM*, CTV_ITEM *> CListViews;
00056
00057 // CCJTabView is a CCtrlView derived class which can be used to
00058 // create a view that contains a tab control
00059 class _CJX_EXT_CLASS CCJTabView : public CCtrlView
00060 {
00061     DECLARE_DYNCREATE(CCJTabView)
00062
00063 protected:
00064
00065     // Default constructor
00066     //
00067     CCJTabView();
00068
00069     // Virtual destructor
00070     //
00071     virtual ~CCJTabView();
00072
00073 protected:
00074
00075     CView*          m_pActiveView;  // pointer to the active view
00076     int             m_nActiveTab;   // index of the active tab
00077     CTabCtrl*       m_pTabCtrl;     // pointer to the tab control
00078     CToolTipCtrl*   m_pToolTip;     // pointer to the tooltip control
00079     CFont           m_TabFont;      // font used by tab control
00080     CListViews      m_views;        // template list containing tab information
00081
00082 public:
00083
00084     // this member function is called to add a view to the tab control
00085     //
00086     virtual BOOL AddView(
00087         // tab text
00088         LPCTSTR lpszLabel,
00089         // CView object associated with tab
00090         CRuntimeClass *pViewClass,
00091         // CDocument associated with view
00092         CDocument* pDoc = NULL,
00093         // create context for view
00094         CCreateContext *pContext = NULL);
00095
00096     // this member function will modify the style for the
00097     // tab control associated with this control.
00098     //
00099     virtual BOOL ModifyTabStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags=0);
00100
00101     // this member function will set a view active
00102     // based on a CView object
00103     //
00104     virtual void SetActiveView(CRuntimeClass *pViewClass);
00105
00106     // this member function will set a view active
00107     // based on index
00108     //
00109     virtual void SetActiveView(int nNewTab);
00110
00111     // this member function will remove a view based on its index
00112     //
00113     virtual void RemoveView(int nView);
00114
00115     // this member function returns a pointer to a view
00116     // based on a CView object
00117     //
00118     virtual CView* GetView(CRuntimeClass *pViewClass);
00119
00120     // this member function returns a pointer to a view
00121     // based on its index
00122     //
00123     virtual CView* GetView(int nView);
00124
00125     // this member function returns a pointer to the
00126     // active view in the tab control
00127     //
00128     virtual CView* GetActiveView();
00129
00130     // this member function initializes the image list
00131     // for the tab control
00132     //
00133     virtual CImageList* SetTabImageList(CImageList *pImageList);
00134
00135     // this member function returns a pointer to the
00136     // tab control associated with this control
00137     //
00138     virtual CTabCtrl* GetTabCtrl();
00139
00140     // this member function is called by the view, and
00141     // can be overloaded in derived classes to return the rect
00142     // for the child window associated with the control bar.
00143     //
00144     virtual void GetChildRect(
00145         // reference to a CRect object which contains the size of
00146         // the child window associated with the control bar.
00147         CRect &rect);
00148
00149 private:
00150
00151     void CalcViewRect(CRect* pRect);
00152
00153 // Overrides
00154     // ClassWizard generated virtual function overrides
00155     //{{AFX_VIRTUAL(CCJTabView)
00156     //}}AFX_VIRTUAL
00157
00158     // Generated message map functions
00159 protected:
00160     //{{AFX_MSG(CCJTabView)
00161     afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
00162     afx_msg void OnSelchange(NMHDR* pNMHDR, LRESULT* pResult);
00163     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00164     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00165     //}}AFX_MSG
00166     DECLARE_MESSAGE_MAP()
00167 };
00168
00170 //  Inline Functions
00172
00173 _CJXLIB_INLINE CTabCtrl* CCJTabView::GetTabCtrl()
00174     { return m_pTabCtrl; }
00175
00176 _CJXLIB_INLINE CView* CCJTabView::GetActiveView()
00177     { return m_pActiveView; }
00178
00180
00181 //{{AFX_INSERT_LOCATION}}
00182 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00183
00184 #endif // __CJTABVIEW_H__
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJToolBar.h Source File

WinCvs/CJLib/Include/CJToolBar.h

Go to the documentation of this file.
00001 // CJToolBar.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:51 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJockey/Include/CJToolBar.h $
00011  *
00012  * $History: CJToolBar.h $
00013  *
00014  * *****************  Version 12  *****************
00015  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00016  * Updated in $/CodeJockey/Include
00017  * Updated copyright and contact information.
00018  *
00019  * *****************  Version 11  *****************
00020  * User: Kirk Stowell Date: 7/31/99    Time: 4:27p
00021  * Updated in $/CodeJockey/Include
00022  *
00023  * *****************  Version 10  *****************
00024  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00025  * Updated in $/CodeJockey/Include
00026  *
00027  * *****************  Version 6  *****************
00028  * User: Kirk Stowell Date: 7/18/99    Time: 10:20p
00029  * Updated in $/CodeJockey/Include
00030  * Re-wrote toolbar class for vc5 compatibility. Added customization based
00031  * on the "Customizable toolbar" article by Doug Keith -
00032  * http://www.codeguru.com/toolbar/customizable_tb.shtml.
00033  *
00034  * Cleaned up inline functions, and import/export macro so that class will
00035  * be imported when linked to, and exported at compile time.
00036  *
00037  * *****************  Version 5  *****************
00038  * User: Kirk Stowell Date: 4/03/99    Time: 11:44p
00039  * Updated in $/CodeJockey/Include
00040  * Added comments and cleaned up code.
00041  *
00042  * *****************  Version 4  *****************
00043  * User: Kirk Stowell Date: 3/13/99    Time: 11:43p
00044  * Updated in $/CodeJockey/Include
00045  * Changed class to handle both Office and DevStudio style to toolbars. To
00046  * use Office toolbars, use the CreateEx() method, otherwise your toolbars
00047  * will look like DevStudio.
00048  *
00049  * *****************  Version 3  *****************
00050  * User: Kirk Stowell Date: 12/14/98   Time: 11:42p
00051  * Updated in $/CodeJockey/Include
00052  * Changed class to derive from Paul DiLascia's CFlatToolBar, this class
00053  * adds gripper and control insertion.
00054  *
00055  * *****************  Version 2  *****************
00056  * User: Kirk Stowell Date: 11/02/98   Time: 11:41p
00057  * Updated in $/CodeJockey/Include
00058  * Fixed bug with DrawNoGripper() method - (Christian Skovdal Andersen).
00059  *
00060  * *****************  Version 1  *****************
00061  * User: Kirk Stowell Date: 10/17/98   Time: 11:41p
00062  * Created in $/CodeJockey/Include
00063  * Initial re-write and release.
00064  *
00065  ***************************************************************************/
00067
00068 #ifndef __CJTOOLBAR_H__
00069 #define __CJTOOLBAR_H__
00070
00071 #include "CJToolBarBase.h"
00072 #include "CJToolBarCtrl.h"
00073
00075
00076 // for determining version of COMCTL32.DLL
00077 #define VERSION_WIN4    MAKELONG(0, 4)
00078 #define VERSION_IE3     MAKELONG(70, 4)
00079 #define VERSION_IE4     MAKELONG(71, 4)
00080 #define VERSION_IE401   MAKELONG(72, 4)
00081
00082 extern int _ComCtlVersion;
00083 DWORD   AFXAPI _GetComCtlVersion();
00084 HBITMAP AFXAPI _LoadSysColorBitmap(HINSTANCE hInst, HRSRC hRsrc, BOOL bMono = FALSE);
00085
00086 // One of these for each drop-down button
00087 struct DROPDOWNBUTTON {
00088     DROPDOWNBUTTON* next;
00089     UINT            idButton;       // command ID of button
00090     UINT            idMenu;         // popup menu to display
00091 } ;
00092
00093 struct TOOLBARINFO {
00094     TBBUTTON         tbButton;      // information regarding the button
00095     LPCTSTR          btnText;       // text for the button
00096 };
00097
00098 class CCJToolBarCtrl;
00099
00100
00101 // CCJToolBar is a CCJToolBarBase derived class which Allows the
00102 // creation of toolbars simular to VisualStudio, Microsoft Office or Internet Explorer
00103 class _CJX_EXT_CLASS CCJToolBar : public CCJToolBarBase
00104 {
00105     DECLARE_DYNAMIC(CCJToolBar)
00106
00107 public:
00108
00109     // Default constructor
00110     //
00111     CCJToolBar();
00112
00113     // Virtual destructor
00114     //
00115     virtual ~CCJToolBar();
00116
00117 protected:
00118
00119     TOOLBARINFO*        m_pBarInfo;             // points to a TOOLBARINFO array used for toolbar customization.
00120     CObList*            m_pControls;            // CObject pointer list which contains controls added to the toolbar
00121     bool                m_bShowDropArrow;       // true to display a drop arrow when docked vertical
00122     HRSRC               m_hRsrcImageWell;       // handle to loaded resource for image well
00123     HINSTANCE           m_hInstImageWell;       // instance handle to load image well from
00124     HBITMAP             m_hbmImageWell;         // contains color mapped button images
00125     BOOL                m_bDelayedButtonLayout; // used to manage when button layout should be done
00126     CRect               m_rcOldPos;             // used when toolbar is moved
00127     int                 m_nButtons;             // used for customization
00128     HKEY                m_hKeyRoot;             // used for customization, holds registry key.
00129     CString             m_strSubKey;            // used for customization, holds registry subkey name.
00130     CString             m_strValueName;         // used for customization, holds registry value.
00131     static int          m_nBarNumber;           // used for customization, holds bar number for restoration.
00132     CSize               m_sizeImage;            // current image size
00133     CSize               m_sizeButton;           // current button size
00134     DROPDOWNBUTTON*     m_pDropButtons;         // list of dropdown button/menu pairs
00135     CMapStringToPtr*    m_pStringMap;           // used as CMapStringToUInt
00136
00137 public:
00138
00139     virtual BOOL Create(CWnd* pParentWnd,
00140         DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP,
00141         UINT nID = AFX_IDW_TOOLBAR);
00142
00143     virtual BOOL CreateEx(CWnd* pParentWnd, DWORD dwCtrlStyle = TBSTYLE_FLAT,
00144         DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP,
00145         CRect rcBorders = CRect(0, 0, 0, 0),
00146         UINT nID = AFX_IDW_TOOLBAR);
00147
00148     // this member function is called to insert a control into the toolbar
00149     // and returns a pointer to the newly inserted control
00150     //
00151     CWnd* InsertControl(
00152         // CRuntimeClass of the control to be inserted.
00153         CRuntimeClass* pClass,
00154         // window title ( if any ) of the control
00155         LPCTSTR lpszWindowName,
00156         // size of the control to be inserted
00157         CRect& rect,
00158         // resource id of the button where the control is to be placed
00159         UINT nID,
00160         // style flags for the control
00161         DWORD dwStyle );
00162
00163     CWnd* InsertControl(
00164         // points to already created control to be inserted.
00165         CWnd* pCtrl,
00166         // size of the control to be inserted
00167         CRect& rect,
00168         // resource id of the button where the control is to be placed
00169         UINT nID);
00170
00171     // call to add drop-down buttons
00172     BOOL AddDropDownButton(
00173         // resource id for toolbar button
00174         UINT nIDButton,
00175         // resource id of dropdown menu to be associated with button.
00176         UINT nIDMenu,
00177         // if the button is to have a drop arrow
00178         BOOL bArrow=TRUE);
00179
00180     // Find buttons structure for given ID
00181     DROPDOWNBUTTON* FindDropDownButton(
00182         // id of button to find.
00183         UINT nID);
00184
00185     // silly function to fake out compiler with const-ness
00186     LRESULT SendMessageC(UINT m, WPARAM wp=0, LPARAM lp=0) const;
00187
00188     void SetSizes(SIZE sizeButton, SIZE sizeImage);
00189
00190     // button size should be bigger than image
00191     void SetHeight(int cyHeight);
00192
00193     // call after SetSizes, height overrides bitmap size
00194     BOOL LoadToolBar(LPCTSTR lpszResourceName, TOOLBARINFO* pBarInfo=NULL);
00195     BOOL LoadToolBar(UINT nIDResource, TOOLBARINFO* pBarInfo=NULL);
00196
00197     BOOL LoadBitmap(LPCTSTR lpszResourceName);
00198     BOOL LoadBitmap(UINT nIDResource);
00199     BOOL SetBitmap(HBITMAP hbmImageWell);
00200
00201     // lpIDArray can be NULL to allocate empty buttons
00202     BOOL SetButtons(const UINT* lpIDArray, int nIDCount);
00203
00204     // standard control bar things
00205     int CommandToIndex(UINT nIDFind) const;
00206     UINT GetItemID(int nIndex) const;
00207     UINT GetButtonStyle(int nIndex) const;
00208     void SetButtonStyle(int nIndex, UINT nStyle);
00209
00210     void SaveState();
00211     void RestoreState();
00212
00213     // for changing button info
00214     void GetButtonInfo(int nIndex, UINT& nID, UINT& nStyle, int& iImage) const;
00215     void SetButtonInfo(int nIndex, UINT nID, UINT nStyle, int iImage);
00216     BOOL SetButtonText(int nIndex, LPCTSTR lpszText);
00217     CString GetButtonText(int nIndex) const;
00218     void GetButtonText(int nIndex, CString& rString) const;
00219
00220     // for direct access to the underlying common control
00221     CCJToolBarCtrl& GetToolBarCtrl() const;
00222
00223     void SetOwner(CWnd* pOwnerWnd);
00224     BOOL AddReplaceBitmap(HBITMAP hbmImageWell);
00225
00226     void GetButton(int nIndex, TBBUTTON* pButton) const;
00227     void SetButton(int nIndex, TBBUTTON* pButton);
00228
00229     // Wrappers that are not in MFC but should be;
00230     // I copied these from CToolBarCtrl
00231     BOOL EnableButton(int nID, BOOL bEnable);
00232     BOOL CheckButton(int nID, BOOL bCheck);
00233     BOOL PressButton(int nID, BOOL bPress);
00234     BOOL HideButton(int nID, BOOL bHide);
00235     BOOL Indeterminate(int nID, BOOL bIndeterminate);
00236     BOOL IsButtonEnabled(int nID) const;
00237     BOOL IsButtonChecked(int nID) const;
00238     BOOL IsButtonPressed(int nID) const;
00239     BOOL IsButtonHidden(int nID) const;
00240     BOOL IsButtonIndeterminate(int nID) const;
00241     BOOL SetState(int nID, UINT nState);
00242     int GetState(int nID) const;
00243     BOOL AddButtons(int nNumButtons, LPTBBUTTON lpButtons);
00244     BOOL InsertButton(int nIndex, LPTBBUTTON lpButton);
00245     BOOL DeleteButton(int nIndex);
00246     int GetButtonCount() const;
00247     void Customize();
00248     int AddStrings(LPCTSTR lpszStrings);
00249     void SetButtonStructSize(int nSize);
00250     BOOL SetButtonSize(CSize sz);
00251     BOOL SetBitmapSize(CSize sz);
00252     void AutoSize();
00253     CToolTipCtrl* GetToolTips() const;
00254     void SetToolTips(CToolTipCtrl* pTip);
00255     void SetRows(int nRows, BOOL bLarger, LPRECT lpRect);
00256     int GetRows() const;
00257     BOOL SetCmdID(int nIndex, UINT nID);
00258     UINT GetBitmapFlags() const;
00259
00260     // Wrappers for some of the newer messages--not complete
00261     BOOL SetIndent(int indent);
00262     HIMAGELIST GetImageList() const;
00263     HIMAGELIST SetImageList(HIMAGELIST hImgList);
00264     int GetBitmap(UINT nIdButton) const;
00265     DWORD SetExtendedStyle(DWORD dwStyle);
00266     BOOL GetRect(UINT nIdButton, RECT& rc) const;
00267     DWORD GetToolbarStyle() const;
00268     void SetToolbarStyle(DWORD dwStyle);
00269     int HitTest(CPoint p) const;
00270     int  GetHotItem() const;
00271     void SetHotItem(int iHot);
00272     BOOL MapAccelerator(TCHAR ch, UINT& nID) const;
00273     CSize GetPadding() const;
00274     CSize SetPadding(CSize sz);
00275
00276     // Implementation
00277 public:
00278
00279 #ifdef _DEBUG
00280     virtual void AssertValid() const;
00281     virtual void Dump(CDumpContext& dc) const;
00282 #endif
00283
00284 protected:
00285
00286     // implementation helpers
00287     CSize CalcLayout(DWORD nMode, int nLength = -1);
00288     CSize CalcSize(TBBUTTON* pData, int nCount);
00289     int WrapToolBar(TBBUTTON* pData, int nCount, int nWidth);
00290     void SizeToolBar(TBBUTTON* pData, int nCount, int nLength, BOOL bVert = FALSE);
00291     void Layout(); // called for for delayed button layout
00292
00293 public:
00294
00295 // Overrides
00296     // ClassWizard generated virtual function overrides
00297     //{{AFX_VIRTUAL(CCJToolBar)
00298     public:
00299     virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
00300     virtual CSize CalcDynamicLayout(int nLength, DWORD nMode);
00301     virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
00302     virtual void OnBarStyleChange(DWORD dwOldStyle, DWORD dwNewStyle);
00303     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00304     virtual int OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
00305     virtual void GetItemRect(int nIndex, LPRECT lpRect) const;
00306     //}}AFX_VIRTUAL
00307
00308     // helpers
00309     virtual void InvalidateOldPos(const CRect& rcInvalid);
00310     virtual CSize GetButtonSize(TBBUTTON* pData, int iButton);
00311
00312     // override to do your own weird drop-down buttons
00313     virtual void OnDropDownButton(const NMTOOLBAR& nmtb, UINT nID, CRect rc);
00314
00315 // Generated message map functions
00316 protected:
00317
00318     LRESULT OnSetSizeHelper(CSize& size, LPARAM lParam);
00319
00320     //{{AFX_MSG(CCJToolBar)
00321     afx_msg UINT OnNcHitTest(CPoint);
00322     afx_msg void OnNcPaint();
00323     afx_msg void OnPaint();
00324     afx_msg void OnNcCalcSize(BOOL, NCCALCSIZE_PARAMS*);
00325     afx_msg void OnWindowPosChanging(LPWINDOWPOS);
00326     afx_msg void OnWindowPosChanged(WINDOWPOS* lpwndpos);
00327     afx_msg void OnSysColorChange();
00328     afx_msg LRESULT OnSetButtonSize(WPARAM, LPARAM);
00329     afx_msg LRESULT OnSetBitmapSize(WPARAM, LPARAM);
00330     afx_msg BOOL OnNcCreate(LPCREATESTRUCT);
00331     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00332     afx_msg void OnDestroy();
00333     afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00334     //}}AFX_MSG
00335
00336     afx_msg void OnToolBarBtnDropDown(NMHDR* pNMHDR, LRESULT* pResult);
00337     afx_msg void OnToolBarQueryDelete(NMHDR *pNMHDR, LRESULT *pResult);
00338     afx_msg void OnToolBarQueryInsert(NMHDR *pNMHDR, LRESULT *pResult);
00339     afx_msg void OnToolBarChange(NMHDR *pNMHDR, LRESULT *pResult);
00340     afx_msg void OnToolBarBeginDrag(NMHDR *pNMHDR, LRESULT *pResult);
00341     afx_msg void OnToolBarEndDrag(NMHDR *pNMHDR, LRESULT *pResult);
00342     afx_msg void OnToolBarBeginAdjust(NMHDR *pNMHDR, LRESULT *pResult);
00343     afx_msg void OnToolBarCustomHelp(NMHDR *pNMHDR, LRESULT *pResult);
00344     afx_msg void OnToolBarEndAdjust(NMHDR *pNMHDR, LRESULT *pResult);
00345     afx_msg void OnToolBarGetButtonInfo(NMHDR *pNMHDR, LRESULT *pResult);
00346     afx_msg void OnToolBarReset(NMHDR *pNMHDR, LRESULT *pResult);
00347     afx_msg LRESULT OnPreserveZeroBorderHelper(WPARAM, LPARAM);
00348     DECLARE_MESSAGE_MAP()
00349 };
00350
00352 // inline functions
00354
00355 _CJXLIB_INLINE CCJToolBarCtrl& CCJToolBar::GetToolBarCtrl() const
00356     { ASSERT(::IsWindow(m_hWnd)); return *(CCJToolBarCtrl*)this; }
00357
00358 _CJXLIB_INLINE BOOL CCJToolBar::LoadBitmap(UINT nIDResource)
00359     { return LoadBitmap(MAKEINTRESOURCE(nIDResource)); }
00360
00361 _CJXLIB_INLINE BOOL CCJToolBar::LoadToolBar(UINT nIDResource, TOOLBARINFO* pBarInfo)
00362     { return LoadToolBar(MAKEINTRESOURCE(nIDResource), pBarInfo); }
00363
00364 _CJXLIB_INLINE LRESULT CCJToolBar::SendMessageC(UINT m, WPARAM wp, LPARAM lp) const
00365     { ASSERT(::IsWindow(m_hWnd)); return ((CCJToolBar*)this)->SendMessage(m, wp, lp); }
00366
00367 _CJXLIB_INLINE BOOL CCJToolBar::EnableButton(int nID, BOOL bEnable)
00368     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_ENABLEBUTTON, nID, MAKELPARAM(bEnable, 0)); }
00369
00370 _CJXLIB_INLINE BOOL CCJToolBar::CheckButton(int nID, BOOL bCheck)
00371     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_CHECKBUTTON, nID, MAKELPARAM(bCheck, 0)); }
00372
00373 _CJXLIB_INLINE BOOL CCJToolBar::PressButton(int nID, BOOL bPress)
00374     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_PRESSBUTTON, nID, MAKELPARAM(bPress, 0)); }
00375
00376 _CJXLIB_INLINE BOOL CCJToolBar::HideButton(int nID, BOOL bHide)
00377     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_HIDEBUTTON, nID, MAKELPARAM(bHide, 0)); }
00378
00379 _CJXLIB_INLINE BOOL CCJToolBar::Indeterminate(int nID, BOOL bIndeterminate)
00380     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_INDETERMINATE, nID, MAKELPARAM(bIndeterminate, 0)); }
00381
00382 _CJXLIB_INLINE BOOL CCJToolBar::IsButtonEnabled(int nID) const
00383     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_ISBUTTONENABLED, nID); }
00384
00385 _CJXLIB_INLINE BOOL CCJToolBar::IsButtonChecked(int nID) const
00386     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_ISBUTTONCHECKED, nID); }
00387
00388 _CJXLIB_INLINE BOOL CCJToolBar::IsButtonPressed(int nID) const
00389     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_ISBUTTONPRESSED, nID); }
00390
00391 _CJXLIB_INLINE BOOL CCJToolBar::IsButtonHidden(int nID) const
00392     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_ISBUTTONHIDDEN, nID); }
00393
00394 _CJXLIB_INLINE BOOL CCJToolBar::IsButtonIndeterminate(int nID) const
00395     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_ISBUTTONINDETERMINATE, nID); }
00396
00397 _CJXLIB_INLINE BOOL CCJToolBar::SetState(int nID, UINT nState)
00398     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_SETSTATE, nID, MAKELPARAM(nState, 0)); }
00399
00400 _CJXLIB_INLINE int CCJToolBar::GetState(int nID) const
00401     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_GETSTATE, nID); }
00402
00403 _CJXLIB_INLINE BOOL CCJToolBar::AddButtons(int nNumButtons, LPTBBUTTON lpButtons)
00404     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_ADDBUTTONS, nNumButtons, (LPARAM)lpButtons); }
00405
00406 _CJXLIB_INLINE BOOL CCJToolBar::InsertButton(int nIndex, LPTBBUTTON lpButton)
00407     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_INSERTBUTTON, nIndex, (LPARAM)lpButton); }
00408
00409 _CJXLIB_INLINE BOOL CCJToolBar::DeleteButton(int nIndex)
00410     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_DELETEBUTTON, nIndex); }
00411
00412 _CJXLIB_INLINE int CCJToolBar::GetButtonCount() const
00413     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_BUTTONCOUNT); }
00414
00415 _CJXLIB_INLINE void CCJToolBar::Customize()
00416     { ASSERT(::IsWindow(m_hWnd)); SendMessage(TB_CUSTOMIZE, 0, 0L); }
00417
00418 _CJXLIB_INLINE int CCJToolBar::AddStrings(LPCTSTR lpszStrings)
00419     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_ADDSTRING, 0, (LPARAM)lpszStrings); }
00420
00421 _CJXLIB_INLINE void CCJToolBar::SetButtonStructSize(int nSize)
00422     { ASSERT(::IsWindow(m_hWnd)); SendMessage(TB_BUTTONSTRUCTSIZE, nSize); }
00423
00424 _CJXLIB_INLINE BOOL CCJToolBar::SetButtonSize(CSize sz)
00425     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_SETBUTTONSIZE, 0, MAKELPARAM(sz.cx, sz.cy)); }
00426
00427 _CJXLIB_INLINE BOOL CCJToolBar::SetBitmapSize(CSize sz)
00428     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_SETBITMAPSIZE, 0, MAKELPARAM(sz.cx, sz.cy)); }
00429
00430 _CJXLIB_INLINE void CCJToolBar::AutoSize()
00431     { ASSERT(::IsWindow(m_hWnd)); SendMessage(TB_AUTOSIZE); }
00432
00433 _CJXLIB_INLINE CToolTipCtrl* CCJToolBar::GetToolTips() const
00434     { ASSERT(::IsWindow(m_hWnd)); return (CToolTipCtrl*)CWnd::FromHandle((HWND)SendMessageC(TB_GETTOOLTIPS)); }
00435
00436 _CJXLIB_INLINE void CCJToolBar::SetToolTips(CToolTipCtrl* pTip)
00437     { ASSERT(::IsWindow(m_hWnd)); SendMessage(TB_SETTOOLTIPS, (WPARAM)pTip->m_hWnd); }
00438
00439 _CJXLIB_INLINE void CCJToolBar::SetRows(int nRows, BOOL bLarger, LPRECT lpRect)
00440     { ASSERT(::IsWindow(m_hWnd)); SendMessage(TB_SETROWS, MAKELPARAM(nRows, bLarger), (LPARAM)lpRect); }
00441
00442 _CJXLIB_INLINE int CCJToolBar::GetRows() const
00443     { ASSERT(::IsWindow(m_hWnd)); return (int) SendMessageC(TB_GETROWS); }
00444
00445 _CJXLIB_INLINE BOOL CCJToolBar::SetCmdID(int nIndex, UINT nID)
00446     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_SETCMDID, nIndex, nID); }
00447
00448 _CJXLIB_INLINE UINT CCJToolBar::GetBitmapFlags() const
00449     { ASSERT(::IsWindow(m_hWnd)); return (UINT) SendMessageC(TB_GETBITMAPFLAGS); }
00450
00451 // Wrappers for some of the newer messages--not complete
00452 _CJXLIB_INLINE BOOL CCJToolBar::SetIndent(int indent)
00453     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_SETINDENT, indent); }
00454
00455 _CJXLIB_INLINE HIMAGELIST CCJToolBar::GetImageList() const
00456     { ASSERT(::IsWindow(m_hWnd)); return (HIMAGELIST)SendMessageC(TB_GETIMAGELIST); }
00457
00458 _CJXLIB_INLINE HIMAGELIST CCJToolBar::SetImageList(HIMAGELIST hImgList)
00459     { ASSERT(::IsWindow(m_hWnd)); return (HIMAGELIST)SendMessage(TB_SETIMAGELIST, 0, (LPARAM)hImgList); }
00460
00461 _CJXLIB_INLINE int CCJToolBar::GetBitmap(UINT nIdButton) const
00462     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_GETBITMAP, nIdButton); }
00463
00464 _CJXLIB_INLINE DWORD CCJToolBar::SetExtendedStyle(DWORD dwStyle)
00465     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_SETEXTENDEDSTYLE, 0, dwStyle); }
00466
00467 _CJXLIB_INLINE BOOL CCJToolBar::GetRect(UINT nIdButton, RECT& rc) const
00468     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_GETRECT, nIdButton, (LPARAM)&rc); }
00469
00470 _CJXLIB_INLINE DWORD CCJToolBar::GetToolbarStyle() const
00471     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_GETSTYLE); }
00472
00473 _CJXLIB_INLINE void CCJToolBar::SetToolbarStyle(DWORD dwStyle)
00474     { ASSERT(::IsWindow(m_hWnd)); SendMessage(TB_SETSTYLE, 0, dwStyle); }
00475
00476 _CJXLIB_INLINE int CCJToolBar::HitTest(CPoint p) const
00477     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_HITTEST, 0, (LPARAM)&p); }
00478
00479 _CJXLIB_INLINE int CCJToolBar:: GetHotItem() const
00480     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_GETHOTITEM); }
00481
00482 _CJXLIB_INLINE void CCJToolBar::SetHotItem(int iHot)
00483     { ASSERT(::IsWindow(m_hWnd)); SendMessage(TB_SETHOTITEM, iHot); }
00484
00485 _CJXLIB_INLINE BOOL CCJToolBar::MapAccelerator(TCHAR ch, UINT& nID) const
00486     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_MAPACCELERATOR, (WPARAM)ch, (LPARAM)&nID); }
00487
00488 _CJXLIB_INLINE CSize CCJToolBar::GetPadding() const
00489     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_GETPADDING); }
00490
00491 _CJXLIB_INLINE CSize CCJToolBar::SetPadding(CSize sz)
00492     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_SETPADDING, 0, MAKELPARAM(sz.cx,sz.cy)); }
00493
00494 // Styles for toolbar buttons
00495 #define TBBS_BUTTON     MAKELONG(TBSTYLE_BUTTON, 0) // this entry is button
00496 #define TBBS_SEPARATOR  MAKELONG(TBSTYLE_SEP, 0)    // this entry is a separator
00497 #define TBBS_CHECKBOX   MAKELONG(TBSTYLE_CHECK, 0)  // this is an auto check button
00498 #define TBBS_GROUP      MAKELONG(TBSTYLE_GROUP, 0)  // marks the start of a group
00499 #define TBBS_CHECKGROUP (TBBS_GROUP|TBBS_CHECKBOX)  // normal use of TBBS_GROUP
00500 #define TBBS_DROPDOWN   MAKELONG(TBSTYLE_DROPDOWN, 0) // drop down style
00501 #define TBBS_AUTOSIZE   MAKELONG(TBSTYLE_AUTOSIZE, 0) // autocalc button width
00502 #define TBBS_NOPREFIX   MAKELONG(TBSTYLE_NOPREFIX, 0) // no accel prefix for this button
00503
00504 // styles for display states
00505 #define TBBS_CHECKED    MAKELONG(0, TBSTATE_CHECKED)    // button is checked/down
00506 #define TBBS_PRESSED    MAKELONG(0, TBSTATE_PRESSED)    // button is being depressed
00507 #define TBBS_DISABLED   MAKELONG(0, TBSTATE_ENABLED)    // button is disabled
00508 #define TBBS_INDETERMINATE  MAKELONG(0, TBSTATE_INDETERMINATE)  // third state
00509 #define TBBS_HIDDEN     MAKELONG(0, TBSTATE_HIDDEN) // button is hidden
00510 #define TBBS_WRAPPED    MAKELONG(0, TBSTATE_WRAP)   // button is wrapped at this point
00511 #define TBBS_ELLIPSES   MAKELONG(0, TBSTATE_ELIPSES)
00512 #define TBBS_MARKED     MAKELONG(0, TBSTATE_MARKED)
00513
00514 #endif //__TBCTL_H__
00515
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJToolBarBase.h Source File

WinCvs/CJLib/Include/CJToolBarBase.h

Go to the documentation of this file.
00001 // CJToolBarBase.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Copied from MFC, Visual C++ 6, to extend functionality to Visual C++ 5
00006 // users, with some ideas taken from Luis Barreira's article 'Classes for new IE4 controls'
00007 // http://www.codeguru.com/controls/ie4_controls_classes.shtml
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:51 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJockey/Include/CJToolBarBase.h $
00015  *
00016  * $History: CJToolBarBase.h $
00017  *
00018  * *****************  Version 8  *****************
00019  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00020  * Updated in $/CodeJockey/Include
00021  * Updated copyright and contact information.
00022  *
00023  * *****************  Version 7  *****************
00024  * User: Kirk Stowell Date: 7/31/99    Time: 4:27p
00025  * Updated in $/CodeJockey/Include
00026  *
00027  * *****************  Version 5  *****************
00028  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00029  * Updated in $/CodeJockey/Include
00030  *
00031  * *****************  Version 4  *****************
00032  * User: Kirk Stowell Date: 7/25/99    Time: 12:12a
00033  * Updated in $/CodeJockey/Include
00034  *
00035  * *****************  Version 3  *****************
00036  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00037  * Updated in $/CodeJockey/Include
00038  *
00039  * *****************  Version 2  *****************
00040  * User: Kirk Stowell Date: 7/18/99    Time: 10:10p
00041  * Updated in $/CodeJockey/Include
00042  * Cleaned up inline functions, and import/export macro so that class will
00043  * be imported when linked to, and exported at compile time.
00044  *
00045  * *****************  Version 1  *****************
00046  * User: Kirk Stowell Date: 7/14/99    Time: 10:29p
00047  * Created in $/CodeJockey/Include
00048  * Copied from MFC v6 and techno preview for v5. Added to extend
00049  * functionality to Visual C++ 5.0 users.
00050  *
00051  ***************************************************************************/
00053
00054 #ifndef __CCJTOOLBARBASE_H__
00055 #define __CCJTOOLBARBASE_H__
00056
00057 #ifdef _VC_VERSION_5
00058 typedef struct tagAFX_OLDTOOLINFO
00059 {
00060     UINT cbSize;
00061     UINT uFlags;
00062     HWND hwnd;
00063     UINT uId;
00064     RECT rect;
00065     HINSTANCE hinst;
00066     LPTSTR lpszText;
00067 } AFX_OLDTOOLINFO;
00068
00069 #define CBRS_GRIPPER                    0x00400000L
00070 #endif // _VC_VERSION_5
00071
00072 // CCJToolBarBase is a CControlBar derived class whis is used
00073 // by the CCJToolBar class.
00074 class _CJX_EXT_CLASS CCJToolBarBase : public CControlBar
00075 {
00076     DECLARE_DYNAMIC(CCJToolBarBase)
00077         // Construction
00078 protected:
00079     CCJToolBarBase();
00080
00081 // Attributes
00082     // getting and setting border space
00083     void SetBorders(LPCRECT lpRect);
00084     void SetBorders(int cxLeft = 0, int cyTop = 0, int cxRight = 0, int cyBottom = 0);
00085     CRect GetBorders() const;
00086
00087 // Implementation
00088 public:
00089     bool    m_bInReBar; // true if rebar is parent.
00090     bool    m_bExStyle; // true if created with the CreateEx style.
00091
00092     virtual ~CCJToolBarBase();
00093     virtual void DoPaint(CDC* pDC);
00094     void DrawGripper(CDC* pDC, const CRect& rect);
00095
00096     // implementation helpers
00097     virtual LRESULT WindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam);
00098     void CalcInsideRect(CRect& rect, BOOL bHorz) const; // adjusts borders etc
00099     void EraseNonClient();
00100     void DrawBorders(CDC* pDC, CRect& rect);
00101
00102     //{{AFX_MSG(CCJToolBarBase)
00103     afx_msg void OnPaint();
00104     afx_msg void OnWindowPosChanging(LPWINDOWPOS lpWndPos);
00105     //}}AFX_MSG
00106     DECLARE_MESSAGE_MAP()
00107 };
00108
00110 // inline functions
00112
00113 _CJXLIB_INLINE void CCJToolBarBase::SetBorders(LPCRECT lpRect)
00114     { SetBorders(lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); }
00115
00116 #endif //__CCJTOOLBARBASE_H__
00117
00119
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJToolBarCtrl.h Source File

WinCvs/CJLib/Include/CJToolBarCtrl.h

Go to the documentation of this file.
00001 // CJToolBarCtrl.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Copied from MFC, Visual C++ 6, to extend functionality to Visual C++ 5
00006 // users, with some ideas taken from Luis Barreira's article 'Classes for new IE4 controls'
00007 // http://www.codeguru.com/controls/ie4_controls_classes.shtml
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:51 $
00013  * $Revision: 1.1.1.3 $
00014  * $Archive: /CodeJockey/Include/CJToolBarCtrl.h $
00015  *
00016  * $History: CJToolBarCtrl.h $
00017  *
00018  * *****************  Version 8  *****************
00019  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00020  * Updated in $/CodeJockey/Include
00021  * Updated copyright and contact information.
00022  *
00023  * *****************  Version 7  *****************
00024  * User: Kirk Stowell Date: 7/31/99    Time: 4:27p
00025  * Updated in $/CodeJockey/Include
00026  *
00027  * *****************  Version 5  *****************
00028  * User: Kirk Stowell Date: 7/25/99    Time: 10:00p
00029  * Updated in $/CodeJockey/Include
00030  *
00031  * *****************  Version 4  *****************
00032  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00033  * Updated in $/CodeJockey/Include
00034  *
00035  * *****************  Version 3  *****************
00036  * User: Kirk Stowell Date: 6/23/99    Time: 12:33a
00037  * Updated in $/CodeJockey/Include
00038  *
00039  * *****************  Version 2  *****************
00040  * User: Kirk Stowell Date: 7/18/99    Time: 10:10p
00041  * Updated in $/CodeJockey/Include
00042  * Cleaned up inline functions, and import/export macro so that class will
00043  * be imported when linked to, and exported at compile time.
00044  *
00045  * *****************  Version 1  *****************
00046  * User: Kirk Stowell Date: 7/14/99    Time: 10:29p
00047  * Created in $/CodeJockey/Include
00048  * Copied from MFC v6 and techno preview for v5. Added to extend
00049  * functionality to Visual C++ 5.0 users.
00050  *
00051  ***************************************************************************/
00052
00053 #ifndef __CJTOOLBARCTRL_H__
00054 #define __CJTOOLBARCTRL_H__
00055
00056 // The CCJToolBarCtrl class provides the functionality of the Windows toolbar
00057 // common control. This control (and therefore the CCJToolBarCtrl class) is available
00058 // only to programs running under Windows 95 and Windows NT version 3.51 and later.
00059 class _CJX_EXT_CLASS CCJToolBarCtrl : public CToolBarCtrl
00060 {
00061 // Construction
00062 public:
00063   CCJToolBarCtrl();
00064   BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
00065
00066 // Attributes
00067 public:
00068     DWORD GetButtonSize() const;
00069     CImageList* GetDisabledImageList() const;
00070     CImageList* GetHotImageList() const;
00071     CImageList* GetImageList() const;
00072     DWORD GetStyle() const;
00073     int GetMaxTextRows() const;
00074     BOOL IsButtonHighlighted(int nID) const;
00075     BOOL SetButtonWidth(int cxMin, int cxMax);
00076     CImageList* SetDisabledImageList(CImageList* pImageList);
00077     CImageList* SetHotImageList(CImageList* pImageList);
00078     CImageList* SetImageList(CImageList* pImageList);
00079     HRESULT GetDropTarget(IDropTarget** ppDropTarget) const;;
00080     BOOL SetIndent(int iIndent);
00081     BOOL SetMaxTextRows(int iMaxRows);
00082     void SetStyle(DWORD dwStyle);
00083     BOOL GetButtonInfo(int nID, TBBUTTONINFO* ptbbi) const;
00084     BOOL SetButtonInfo(int nID, TBBUTTONINFO* ptbbi);
00085     DWORD SetDrawTextFlags(DWORD dwMask, DWORD dwDTFlags);
00086     BOOL GetAnchorHighlight() const;
00087     BOOL SetAnchorHighlight(BOOL fAnchor = TRUE);
00088     int GetHotItem() const;
00089     int SetHotItem(int nHot);
00090     void GetInsertMark(TBINSERTMARK* ptbim) const;
00091     void SetInsertMark(TBINSERTMARK* ptbim);
00092     BOOL GetMaxSize(LPSIZE pSize) const;
00093     BOOL InsertMarkHitTest(LPPOINT ppt, LPTBINSERTMARK ptbim) const;
00094     DWORD GetExtendedStyle() const;
00095     DWORD SetExtendedStyle(DWORD dwExStyle);
00096     COLORREF GetInsertMarkColor() const;
00097     COLORREF SetInsertMarkColor(COLORREF clrNew);
00098
00099 // Operations
00100 public:
00101     BOOL MapAccelerator(TCHAR chAccel, UINT* pIDBtn);
00102     BOOL MarkButton(int nID, BOOL bHighlight = TRUE);
00103     BOOL MoveButton(UINT nOldPos, UINT nNewPos);
00104     int HitTest(LPPOINT ppt) const;
00105
00106 // Overrides
00107     // ClassWizard generated virtual function overrides
00108     //{{AFX_VIRTUAL(CCJToolBarCtrl)
00109     //}}AFX_VIRTUAL
00110
00111 // Implementation
00112 public:
00113     virtual ~CCJToolBarCtrl();
00114
00115     // Generated message map functions
00116 protected:
00117     //{{AFX_MSG(CCJToolBarCtrl)
00118     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00119     //}}AFX_MSG
00120
00121     DECLARE_MESSAGE_MAP()
00122 };
00123
00125 // inline functions
00127
00128 _CJXLIB_INLINE DWORD CCJToolBarCtrl::GetButtonSize() const
00129     { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_GETBUTTONSIZE, 0, 0L); }
00130
00131 _CJXLIB_INLINE CImageList* CCJToolBarCtrl::GetDisabledImageList() const
00132     { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, TB_GETDISABLEDIMAGELIST, 0, 0)); }
00133
00134 _CJXLIB_INLINE CImageList* CCJToolBarCtrl::GetHotImageList() const
00135     { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, TB_GETHOTIMAGELIST, 0, 0)); }
00136
00137 _CJXLIB_INLINE CImageList* CCJToolBarCtrl::GetImageList() const
00138     { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, TB_GETIMAGELIST, 0, 0)); }
00139
00140 _CJXLIB_INLINE DWORD CCJToolBarCtrl::GetStyle() const
00141     { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_GETSTYLE, 0, 0L); }
00142
00143 _CJXLIB_INLINE int CCJToolBarCtrl::GetMaxTextRows() const
00144     { ASSERT(::IsWindow(m_hWnd)); return (INT) ::SendMessage(m_hWnd, TB_GETTEXTROWS, 0, 0L); }
00145
00146 _CJXLIB_INLINE BOOL CCJToolBarCtrl::IsButtonHighlighted(int nID) const
00147     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONHIGHLIGHTED, nID, 0); }
00148
00149 _CJXLIB_INLINE BOOL CCJToolBarCtrl::SetButtonWidth(int cxMin, int cxMax)
00150     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETBUTTONWIDTH, 0, MAKELPARAM(cxMin, cxMax)); }
00151
00152 _CJXLIB_INLINE CImageList* CCJToolBarCtrl::SetDisabledImageList(CImageList* pImageList)
00153     { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, TB_SETDISABLEDIMAGELIST, 0, (LPARAM)pImageList->GetSafeHandle())); }
00154
00155 _CJXLIB_INLINE CImageList* CCJToolBarCtrl::SetHotImageList(CImageList* pImageList)
00156     { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, TB_SETHOTIMAGELIST, 0, (LPARAM)pImageList->GetSafeHandle())); }
00157
00158 _CJXLIB_INLINE CImageList* CCJToolBarCtrl::SetImageList(CImageList* pImageList)
00159     { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, TB_SETIMAGELIST, 0, (LPARAM)pImageList->GetSafeHandle())); }
00160
00161 _CJXLIB_INLINE BOOL CCJToolBarCtrl::SetIndent(int iIndent)
00162     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETINDENT, iIndent, 0L); }
00163
00164 _CJXLIB_INLINE BOOL CCJToolBarCtrl::SetMaxTextRows(int iMaxRows)
00165     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETMAXTEXTROWS, iMaxRows, 0L); }
00166
00167 _CJXLIB_INLINE void CCJToolBarCtrl::SetStyle(DWORD dwStyle)
00168     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_SETSTYLE, 0, dwStyle); }
00169
00170 _CJXLIB_INLINE BOOL CCJToolBarCtrl::GetButtonInfo(int nID, TBBUTTONINFO* ptbbi) const
00171     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_GETBUTTONINFO, nID, (LPARAM)ptbbi); }
00172
00173 _CJXLIB_INLINE BOOL CCJToolBarCtrl::SetButtonInfo(int nID, TBBUTTONINFO* ptbbi)
00174     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETBUTTONINFO, nID, (LPARAM)ptbbi); }
00175
00176 _CJXLIB_INLINE DWORD CCJToolBarCtrl::SetDrawTextFlags(DWORD dwMask, DWORD dwDTFlags)
00177     { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_SETDRAWTEXTFLAGS, dwMask, dwDTFlags); }
00178
00179 _CJXLIB_INLINE BOOL CCJToolBarCtrl::GetAnchorHighlight() const
00180     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_GETANCHORHIGHLIGHT, 0, 0); }
00181
00182 _CJXLIB_INLINE BOOL CCJToolBarCtrl::SetAnchorHighlight(BOOL fAnchor)
00183     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETANCHORHIGHLIGHT, fAnchor, 0); }
00184
00185 _CJXLIB_INLINE int CCJToolBarCtrl::GetHotItem() const
00186     { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_GETHOTITEM, 0, 0); }
00187
00188 _CJXLIB_INLINE int CCJToolBarCtrl::SetHotItem(int nHot)
00189     { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_SETHOTITEM, nHot, 0); }
00190
00191 _CJXLIB_INLINE void CCJToolBarCtrl::GetInsertMark(TBINSERTMARK* ptbim) const
00192     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_GETINSERTMARK, 0, (LPARAM)ptbim); }
00193
00194 _CJXLIB_INLINE void CCJToolBarCtrl::SetInsertMark(TBINSERTMARK* ptbim)
00195     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_SETINSERTMARK, 0, (LPARAM)ptbim); }
00196
00197 _CJXLIB_INLINE BOOL CCJToolBarCtrl::GetMaxSize(LPSIZE pSize) const
00198     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_GETMAXSIZE, 0, (LPARAM)pSize); }
00199
00200 _CJXLIB_INLINE BOOL CCJToolBarCtrl::InsertMarkHitTest(LPPOINT ppt, LPTBINSERTMARK ptbim) const
00201     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_INSERTMARKHITTEST, (WPARAM)ppt, (LPARAM)ptbim); }
00202
00203 _CJXLIB_INLINE DWORD CCJToolBarCtrl::GetExtendedStyle() const
00204     { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_GETEXTENDEDSTYLE, 0, 0L); }
00205
00206 _CJXLIB_INLINE DWORD CCJToolBarCtrl::SetExtendedStyle(DWORD dwExStyle)
00207     { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_SETEXTENDEDSTYLE, 0, dwExStyle); }
00208
00209 _CJXLIB_INLINE COLORREF CCJToolBarCtrl::GetInsertMarkColor() const
00210     { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, TB_GETINSERTMARKCOLOR, 0, 0); }
00211
00212 _CJXLIB_INLINE COLORREF CCJToolBarCtrl::SetInsertMarkColor(COLORREF clrNew)
00213     { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, TB_SETINSERTMARKCOLOR, 0, (LPARAM) clrNew); }
00214
00215 _CJXLIB_INLINE BOOL CCJToolBarCtrl::MapAccelerator(TCHAR chAccel, UINT* pIDBtn)
00216     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_MAPACCELERATOR, (WPARAM)chAccel, (LPARAM)pIDBtn); }
00217
00218 _CJXLIB_INLINE BOOL CCJToolBarCtrl::MarkButton(int nID, BOOL bHighlight)
00219     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_MARKBUTTON, nID, MAKELPARAM(bHighlight, 0)); }
00220
00221 _CJXLIB_INLINE BOOL CCJToolBarCtrl::MoveButton(UINT nOldPos, UINT nNewPos)
00222     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_MOVEBUTTON, nOldPos, nNewPos); }
00223
00224 _CJXLIB_INLINE int CCJToolBarCtrl::HitTest(LPPOINT ppt) const
00225     { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_HITTEST, 0, (LPARAM)ppt); }
00226
00227 #endif //__CJTOOLBARCTRL_H__
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJTreeCtrl.h Source File

WinCvs/CJLib/Include/CJTreeCtrl.h

Go to the documentation of this file.
00001 // CJTreeCtrl.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00005 // Based on the CTreeView articles from http://www.codeguru.com/treeview
00006 //
00008 /****************************************************************************
00009  *
00010  * $Date: 1999/11/30 21:45:51 $
00011  * $Revision: 1.1.1.2 $
00012  * $Archive: /CodeJock/Include/CJTreeCtrl.h $
00013  *
00014  * $History: CJTreeCtrl.h $
00015  *
00016  * *****************  Version 6  *****************
00017  * User: Kirk Stowell Date: 10/30/99   Time: 2:17p
00018  * Updated in $/CodeJock/Include
00019  * Overrode OnEraseBkgnd(...) for flicker free drawing.
00020  *
00021  * *****************  Version 5  *****************
00022  * User: Kirk Stowell Date: 10/26/99   Time: 10:49p
00023  * Updated in $/CodeJock/Include
00024  * Made class methods virtual for inheritance purposes.
00025  *
00026  * *****************  Version 4  *****************
00027  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00028  * Updated in $/CodeJockey/Include
00029  *
00030  * *****************  Version 3  *****************
00031  * User: Kirk Stowell Date: 7/25/99    Time: 12:15a
00032  * Updated in $/CodeJockey/Include
00033  *
00034  * *****************  Version 2  *****************
00035  * User: Kirk Stowell Date: 6/23/99    Time: 12:09a
00036  * Updated in $/CodeJockey/Include
00037  *
00038  * *****************  Version 1  *****************
00039  * User: Kirk Stowell Date: 6/23/99    Time: 12:04a
00040  * Created in $/CodeJockey/Include
00041  * Initial creation.
00042  *
00043  ***************************************************************************/
00045
00046 #ifndef __CJTREECTRL_H__
00047 #define __CJTREECTRL_H__
00048
00049 #if _MSC_VER >= 1000
00050 #pragma once
00051 #endif // _MSC_VER >= 1000
00052
00053 #include <afxtempl.h>
00054
00055 // CCJTreeCtrl is a CTreeCtrl derived class which extends the base class to add
00056 // additional functionality and enhancements.
00057 class _CJX_EXT_CLASS CCJTreeCtrl : public CTreeCtrl
00058 {
00059     DECLARE_DYNAMIC(CCJTreeCtrl)
00060
00061 public:
00062
00063     // Default constructor
00064     //
00065     CCJTreeCtrl();
00066
00067     // Virtual destructor
00068     //
00069     virtual ~CCJTreeCtrl();
00070
00071 protected:
00072
00073     HTREEITEM   m_hItemFirstSel;    // first selected item in a multi selection tree control.
00074     DWORD       m_dwDragStart;      // the number of milliseconds that have elapsed since the system was started.
00075     BOOL        m_bMultiSelect;     // TRUE for a multiselection tree control.
00076
00077     struct Color_Font { COLORREF color; LOGFONT logfont; };
00078     CMap< void*, void*, Color_Font, Color_Font& > m_mapColorFont ;
00079
00080 public:
00081
00082     // Call this function to retrieve the tree view item that has the specified
00083     // relationship, indicated by the nCode parameter, to hItem.
00084     // Returns The handle of the next item if successful; otherwise NULL.
00085     virtual HTREEITEM GetNextItem(
00086         // Handle of a tree item.
00087         HTREEITEM hItem,
00088         // A flag indicating the type of relation to hItem. This flag can be one of the
00089         // following values:
00090         // TVGN_CARET   Retrieves the currently selected item.
00091         // TVGN_CHILD   Retrieves the first child item. The hItem parameter must be NULL.
00092         // TVGN_DROPHILITE   Retrieves the item that is the target of a drag-and-drop operation.
00093         // TVGN_FIRSTVISIBLE   Retrieves the first visible item.
00094         // TVGN_NEXT   Retrieves the next sibling item.
00095         // TVGN_NEXTVISIBLE   Retrieves the next visible item that follows the specified item.
00096         // TVGN_PARENT   Retrieves the parent of the specified item.
00097         // TVGN_PREVIOUS   Retrieves the previous sibling item.
00098         // TVGN_PREVIOUSVISIBLE   Retrieves the first visible item that precedes the specified item.
00099         // TVGN_ROOT   Retrieves the first child item of the root item of which the specified item is a part.
00100         UINT nCode );
00101
00102     // Get next item as if outline was completely expanded
00103     // Returns the item immediately below the reference item.
00104     //
00105     virtual HTREEITEM GetNextItem(
00106         // The reference item
00107         HTREEITEM hItem );
00108
00109     // Get previous item as if outline was completely expanded.
00110     // Returns the item immediately above the reference item.
00111     //
00112     virtual HTREEITEM GetPrevItem(
00113         // The reference item
00114         HTREEITEM hItem );
00115
00116     // Gets last item in the branch, returns the last item.
00117     //
00118     virtual HTREEITEM GetLastItem(
00119         // Node identifying the branch. NULL will return the last item in outine.
00120         HTREEITEM hItem );
00121
00122     // Returns the previously selected tree item in a multi selection tree control.
00123     //
00124     virtual HTREEITEM GetPrevSelectedItem(
00125         // The reference item.
00126         HTREEITEM hItem );
00127
00128     // Returns the next selected item in a multi selection tree control.
00129     virtual HTREEITEM GetNextSelectedItem(
00130         // The reference item.
00131         HTREEITEM hItem );
00132
00133     // Returns the first selected item in a multi selection tree control.
00134     //
00135     virtual HTREEITEM GetFirstSelectedItem();
00136
00137     // Returns the RGB text value for the referenced tree item.
00138     // Returns (COLORREF)-1 if color was not set.
00139     //
00140     virtual COLORREF GetItemColor(
00141         // The reference item
00142         HTREEITEM hItem);
00143
00144     // Clears all selections from multi selection tree control.
00145     //
00146     virtual void ClearSelection();
00147
00148     // sets the font for the reference tree item.
00149     //
00150     virtual void SetItemFont(
00151         // The reference item
00152         HTREEITEM hItem,
00153         // new font for tree item.
00154         LOGFONT& logfont);
00155
00156     // sets the font to bold for the refernece tree item.
00157     //
00158     virtual void SetItemBold(
00159         // The reference item
00160         HTREEITEM hItem,
00161         // TRUE for bold font.
00162         BOOL bBold=TRUE);
00163
00164     // Sets the text color for the tree item.
00165     //
00166     virtual void SetItemColor(
00167         // The reference item
00168         HTREEITEM hItem,
00169         // RGB value for the tree items text.
00170         COLORREF color);
00171
00172     // enables multi selection tree control.
00173     //
00174     virtual void EnableMultiSelect(
00175         // TRUE for multi selection tree control.
00176         BOOL bMultiSelect=TRUE);
00177
00178     // returns the current font used by the tree item.
00179     //
00180     virtual BOOL GetItemFont(
00181         // The reference item
00182         HTREEITEM hItem,
00183         // item font.
00184         LOGFONT * plogfont);
00185
00186     // returns TRUE if the tree item has a bold font.
00187     virtual BOOL GetItemBold(
00188         // The reference item
00189         HTREEITEM hItem);
00190
00191     // Selects items from hItemFrom to hItemTo in a multi selection tree control.
00192     // Does not select child item if parent is collapsed. Removes selection from
00193     // all other items.
00194     //
00195     virtual BOOL SelectItems(
00196         // item to start selecting from.
00197         HTREEITEM hItemFrom,
00198         // item to end selection at.
00199         HTREEITEM hItemTo);
00200
00201     // Finds an item that contains the search string, returns the handle
00202     // to the item or NULL.
00203     //
00204     virtual HTREEITEM FindItem(
00205         // String to search for.
00206         LPCTSTR lpszSearch,
00207         // Should the search be case sensitive.
00208         BOOL bCaseSensitive = FALSE,
00209         // Search direction - TRUE for down.
00210         BOOL bDownDir = TRUE,
00211         // True if search should match whole words.
00212         BOOL bWholeWord = FALSE,
00213         // Item to start searching from. NULL for currently selected item.
00214         HTREEITEM hItem = NULL);
00215
00216 protected:
00217
00218     // Virtual function used by FindItem to allow this function to filter the
00219     // result of FindItem returns TRUE if item matches the criteria.
00220     //
00221     virtual BOOL IsFindValid(
00222         // Handle of the item
00223         HTREEITEM hti);
00224
00225 // Overrides
00226     // ClassWizard generated virtual function overrides
00227     //{{AFX_VIRTUAL(CCJTreeCtrl)
00228     protected:
00229     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00230     //}}AFX_VIRTUAL
00231
00232     // Generated message map functions
00233 protected:
00234     //{{AFX_MSG(CCJTreeCtrl)
00235     afx_msg void OnPaint();
00236     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00237     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00238     //}}AFX_MSG
00239
00240     DECLARE_MESSAGE_MAP()
00241 };
00242
00244 //  Inline Functions
00246
00247 _CJXLIB_INLINE HTREEITEM CCJTreeCtrl::GetNextItem( HTREEITEM hItem, UINT nCode )
00248     { return CTreeCtrl::GetNextItem( hItem, nCode ); }
00249
00250 _CJXLIB_INLINE void CCJTreeCtrl::EnableMultiSelect(BOOL bMultiSelect)
00251     { m_bMultiSelect = bMultiSelect; }
00252
00254
00255 //{{AFX_INSERT_LOCATION}}
00256 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00257
00258 #endif // __CJTREECTRL_H__
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/CJWindowPlacement.h Source File

WinCvs/CJLib/Include/CJWindowPlacement.h

Go to the documentation of this file.
00001 // CJWindowPlacement.h : header file
00002 // Copyright © 1998-1999 CodeJock.com, All Rights Reserved.
00003 // See ReadMe.txt for TERMS OF USE.
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:51 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/Include/CJWindowPlacement.h $
00011  *
00012  * $History: CJWindowPlacement.h $
00013  *
00014  * *****************  Version 7  *****************
00015  * User: Kirk Stowell Date: 10/26/99   Time: 10:49p
00016  * Updated in $/CodeJock/Include
00017  * Made class methods virtual for inheritance purposes.
00018  *
00019  * *****************  Version 6  *****************
00020  * User: Kirk Stowell Date: 8/31/99    Time: 1:11a
00021  * Updated in $/CodeJockey/Include
00022  * Updated copyright and contact information.
00023  *
00024  * *****************  Version 5  *****************
00025  * User: Kirk Stowell Date: 7/25/99    Time: 12:42a
00026  * Updated in $/CodeJockey/Include
00027  *
00028  * *****************  Version 4  *****************
00029  * User: Kirk Stowell Date: 7/18/99    Time: 10:09p
00030  * Updated in $/CodeJockey/Include
00031  * Cleaned up inline functions, and import/export macro so that class will
00032  * be imported when linked to, and exported at compile time.
00033  *
00034  * *****************  Version 3  *****************
00035  * User: Kirk Stowell Date: 6/11/99    Time: 10:15p
00036  * Updated in $/CodeJockey/Include
00037  * Modified LoadWindowPos(...) to allow registry names to be directly
00038  * passed in.
00039  *
00040  * *****************  Version 2  *****************
00041  * User: Kirk Stowell Date: 6/11/99    Time: 9:41p
00042  * Updated in $/CodeJockey/Include
00043  * Initial creation.
00044  *
00045  * *****************  Version 1  *****************
00046  * User: Kirk Stowell Date: 6/01/99    Time: 9:30p
00047  * Created in $/CodeJockey/Include
00048  *
00049  ***************************************************************************/
00051
00052 #ifndef __CJWINDOWPLACEMENT_H__
00053 #define __CJWINDOWPLACEMENT_H__
00054
00055 // CCJWindowPlacement is a WINDOWPLACEMENT derived class which is used to
00056 // save and restore your applications window position.
00057 class _CJX_EXT_CLASS CCJWindowPlacement : public WINDOWPLACEMENT
00058 {
00059 public:
00060
00061     // Default constructor
00062     //
00063     CCJWindowPlacement();
00064
00065     // Virtual destructor
00066     //
00067     virtual ~CCJWindowPlacement();
00068
00069 private:
00070
00071     CString     m_strFormat;    // format string for registry settings.
00072     CString     m_strSection;   // registry section name.
00073     CString     m_strWndPos;    // registry entry name.
00074
00075 public:
00076
00077     // call this member function to load your applications previously saved
00078     // window position. To use, add a member variable to your CWinApp derived
00079     // class ie: CCJWindowPlacement m_wndPlacement; then replace the call
00080     // to pMainFrame->ShowWindow(...) with m_wndPlacement.LoadWindowPos( pMainFrame );
00081     //
00082     virtual BOOL LoadWindowPos( CFrameWnd* pFrameWnd, LPCTSTR lpszFormat=NULL, LPCTSTR lpszSection=NULL, LPCTSTR lpszWndPos=NULL );
00083
00084     // call this member function to save your applications window position. To
00085     // use, add the ON_WM_CLOSE message handler to your CFrameWnd derived class,
00086     // then make a call to theApp.m_wndPlacement.SaveWindowPos( this ); just before
00087     // you call the base class OnClose().
00088     //
00089     virtual void SaveWindowPos( CFrameWnd* pFrameWnd );
00090 };
00091
00093
00094 #endif // __CJWINDOWPLACEMENT_H__
00095
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/GfxGroupEdit.h Source File

WinCvs/CJLib/Include/GfxGroupEdit.h

Go to the documentation of this file.
00001 // Copyright (c) Iuri Apollonio 1998
00002 // Use & modify as you want & need, and leave those 4 lines.
00003 // Strongly based on article "Inplace edit control" of Mario Contestabile and "Editable subitems" of Zafir
00004 // http://www.codeguru.com
00005 //
00007 /****************************************************************************
00008  *
00009  * $Date: 1999/11/30 21:45:51 $
00010  * $Revision: 1.1.1.2 $
00011  * $Archive: /CodeJock/Include/GfxGroupEdit.h $
00012  *
00013  * $History: GfxGroupEdit.h $
00014  *
00015  * *****************  Version 3  *****************
00016  * User: Kirk Stowell Date: 10/14/99   Time: 12:41p
00017  * Updated in $/CodeJock/Include
00018  * Added source control history to file header.
00019  *
00020  ***************************************************************************/
00022
00023 #ifndef __GFXGROUPEDIT_H__
00024 #define __GFXGROUPEDIT_H__
00025
00026 #if _MSC_VER >= 1000
00027 #pragma once
00028 #endif // _MSC_VER >= 1000
00029 // GfxGroupEdit.h : header file
00030 //
00031
00033 // CGfxGroupEdit window
00034
00035 class _CJX_EXT_CLASS CGfxGroupEdit : public CEdit
00036 {
00037 // Construction
00038 public:
00039     CGfxGroupEdit();
00040
00041 // Attributes
00042 public:
00043     BOOL    bEscapeKey;
00044     CString text;
00045     WPARAM  msgSend;
00046     bool    bNoDown;
00047
00048 // Operations
00049 public:
00050
00051 // Overrides
00052     // ClassWizard generated virtual function overrides
00053     //{{AFX_VIRTUAL(CGfxGroupEdit)
00054     public:
00055     virtual BOOL PreTranslateMessage(MSG* pMsg);
00056     protected:
00057     virtual void PostNcDestroy();
00058     //}}AFX_VIRTUAL
00059
00060 // Implementation
00061 public:
00062     int iIndex;
00063     virtual ~CGfxGroupEdit();
00064
00065     // Generated message map functions
00066 protected:
00067     //{{AFX_MSG(CGfxGroupEdit)
00068     afx_msg void OnKillFocus(CWnd* pNewWnd);
00069     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00070     afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
00071     //}}AFX_MSG
00072
00073     DECLARE_MESSAGE_MAP()
00074 };
00075
00077
00078 //{{AFX_INSERT_LOCATION}}
00079 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00080
00081 #endif // __GFXGROUPEDIT_H__
Generated on Sun Feb 24 01:21:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/GfxOutBarCtrl.h Source File

WinCvs/CJLib/Include/GfxOutBarCtrl.h

Go to the documentation of this file.
00001 // Copyright (c) Iuri Apollonio 1998
00002 // Use & modify as you want & need, and leave those 3 lines.
00003 // http://www.codeguru.com
00004 //
00006 /****************************************************************************
00007  *
00008  * $Date: 1999/11/30 21:45:51 $
00009  * $Revision: 1.1.1.3 $
00010  * $Archive: /CodeJock/Include/GfxOutBarCtrl.h $
00011  *
00012  * $History: GfxOutBarCtrl.h $
00013  *
00014  * *****************  Version 6  *****************
00015  * User: Kirk Stowell Date: 10/26/99   Time: 10:50p
00016  * Updated in $/CodeJock/Include
00017  * Made class methods virtual for inheritance purposes.
00018  *
00019  * *****************  Version 5  *****************
00020  * User: Kirk Stowell Date: 10/14/99   Time: 12:41p
00021  * Updated in $/CodeJock/Include
00022  * Added source control history to file header.
00023  *
00024  ***************************************************************************/
00026
00027 #ifndef __GFXOUTBARCTRL_H__
00028 #define __GFXOUTBARCTRL_H__
00029
00030 #if _MSC_VER >= 1000
00031 #pragma once
00032 #endif // _MSC_VER >= 1000
00033 // GfxOutBarCtrl.h : header file
00034 //
00035
00037 // CGfxOutBarCtrl window
00038
00039 #include <afxcoll.h>
00040 #include "CJMenu.h"        // CCJMenu class declaration
00041
00042 #define WM_OUTBAR_NOTIFY        WM_USER + 1
00043 #define NM_OB_ITEMCLICK         1
00044 #define NM_OB_ONLABELENDEDIT    2
00045 #define NM_OB_ONGROUPENDEDIT    3
00046 #define NM_OB_DRAGITEM          4
00047 #define NM_FOLDERCHANGE         5
00048 #define NM_OB_ITEMHOVER         6
00049
00050 struct OUTBAR_INFO
00051 {
00052     int     index;
00053     int     iDragFrom;
00054     int     iDragTo;
00055
00056     LPCTSTR cText;
00057 };
00058
00059 class _CJX_EXT_CLASS CGfxOutBarCtrl : public CWnd
00060 {
00061 // Construction
00062     DECLARE_DYNCREATE(CGfxOutBarCtrl)
00063 public:
00064     CGfxOutBarCtrl();
00065
00066     enum {  fSmallIcon = 1 << 0, fLargeIcon = 1 << 1, fEditGroups = 1 << 2, fEditItems = 1 << 3,
00067             fRemoveGroups = 1 << 4, fRemoveItems = 1 << 5, fAddGroups = 1 << 6,
00068             fDragItems = 1 << 7, fAnimation = 1 << 8, fSelHighlight = 1 << 9 };
00069
00070     enum { ircIcon = 1, ircLabel = 2, ircAll = 3 };
00071
00072 // Attributes
00073 public:
00074     COLORREF    crBackGroundColor, crBackGroundColor1;
00075     COLORREF    crTextColor;
00076     COLORREF    cr3dFace, crLightBorder, crHilightBorder, crShadowBorder, crDkShadowBorder;
00077     int         iFolderHeight;
00078
00079     int         xSmallIconLabelOffset, yLargeIconLabelOffset;
00080     int         ySmallIconSpacing, yLargeIconSpacing;
00081
00082     int         xLeftMargin, yTopMargin;
00083     bool        bUpArrow, bDownArrow, bUpPressed, bDownPressed;
00084     CRect       rcUpArrow, rcDownArrow;
00085     bool        bLooping;
00086
00087     int         iHitInternal1, iHitInternal2;
00088
00089     long        lAnimationTickCount;
00090
00091     int         iLastSel, iSelAnimTiming;
00092     int         iSelAnimCount;
00093
00094
00095     DWORD       dwFlags;
00096
00097     CPtrArray   arFolder;
00098
00099     int         iLastFolderHighlighted;
00100     int         iLastSelectedFolder;
00101     int         iFirstItem;
00102
00103     int         iLastItemHighlighted;
00104     bool        bPressedHighlight;
00105
00106     int         iLastDragItemDraw, iLastDragItemDrawType;
00107
00108     class CBarItem
00109     {
00110     public:
00111         CBarItem( LPCTSTR name, const int image, DWORD exData);
00112         virtual  ~CBarItem();
00113         int             iImageIndex;
00114         LPTSTR          cItem;
00115         DWORD           dwData;
00116     };
00117
00118     class CBarFolder
00119     {
00120     public:
00121         CBarFolder( LPCTSTR name, DWORD exData);
00122         virtual  ~CBarFolder();
00123         int GetItemCount();
00124         int InsertItem( int index, LPCTSTR text, const int image, const DWORD exData);
00125         LPTSTR          cName;
00126         DWORD           dwData;
00127         CImageList *    pLargeImageList;
00128         CImageList *    pSmallImageList;
00129         CPtrArray       arItems;
00130         CWnd *          pChild;
00131     };
00132
00133     int iSelFolder;
00134
00135     CImageList *    pLargeImageList;
00136     CImageList *    pSmallImageList;
00137
00138     HCURSOR         hHandCursor;
00139     HCURSOR         hDragCursor;
00140     HCURSOR         hNoDragCursor;
00141
00142     CPen *          pBlackPen;
00143
00144     CCJMenu         m_popupMenu;    // popup menu fix...07-29-1999 - KStowell
00145     CString         m_strRemoveItem;
00146     CString         m_strRenameItem;
00147
00148 // Operations
00149 public:
00150     enum { htNothing = -1, htFolder, htItem, htUpScroll, htDownScroll};
00151
00152 // Overrides
00153     // ClassWizard generated virtual function overrides
00154     //{{AFX_VIRTUAL(CGfxOutBarCtrl)
00155     //}}AFX_VIRTUAL
00156
00157 // Implementation
00158 public:
00159     virtual void DrawAnimItem(const int xoffset, const int yoffset, const int index);
00160     virtual void SetAnimSelHighlight(const int iTime);
00161     virtual DWORD GetFolderData(int iFolder = -1);
00162     virtual CWnd * GetFolderChild(int iFolder = -1);
00163     virtual int AddFolderBar(LPCTSTR pFolder, CWnd * pSon, const DWORD exData = 0);
00164     virtual CString GetItemText(const int index);
00165     virtual void SetAnimationTickCount(const long value) { lAnimationTickCount = value; };
00166     virtual long GetAnimationTickCount() { return lAnimationTickCount; };
00167
00168     virtual void AnimateFolderScroll(const int iFrom, const int iTo);
00169     virtual int GetDragItemRect(const int index, CRect &rect);
00170     virtual void DrawDragArrow(CDC * pDC, const int iFrom, const int iTo);
00171     virtual void SetItemImage(const int index, const int iImage);
00172     virtual void SetItemData(const int index, const DWORD dwData);
00173     virtual int  GetItemImage(const int index) const;
00174     virtual DWORD GetItemData(const int index) const;
00175     virtual bool IsValidItem(const int index) const;
00176     virtual void RemoveItem(const int index);
00177     virtual void SetItemText(const int index, LPCTSTR text);
00178     virtual void StartItemEdit(const int index);
00179     virtual void SetFolderText(const int index, LPCTSTR text);
00180     virtual void StartGroupEdit(const int index);
00181     virtual void GetLabelRect(const int iFolder, const int iIndex, CRect &rect);
00182     virtual void GetIconRect(const int iFolder, const int iIndex, CRect &rect);
00183     virtual void HighlightItem(const int index, const bool bPressed = false);
00184     virtual void GetVisibleRange(const int iFolder, int &first, int &last);
00185     virtual void DrawItem(CDC * pDC, const int iFolder, CRect rc, const int index, const bool bOnlyImage = false);
00186     virtual CImageList * GetFolderImageList(const int index, const bool bSmall) const;
00187     virtual CSize GetItemSize(const int iFolder, const int index, const int type);
00188     virtual void PaintItems(CDC * pDC, const int iFolder, CRect rc);
00189     virtual CImageList * GetImageList(CImageList * pImageList, int nImageList);
00190     virtual CImageList * SetFolderImageList(const int folder, CImageList * pImageList, int nImageList);
00191     virtual CImageList * SetImageList(CImageList * pImageList, int nImageList);
00192     virtual int GetCountPerPage() const;
00193     virtual void RemoveFolder(const int index);
00194     virtual int GetSelFolder() const;
00195     virtual int GetFolderCount() const;
00196     virtual void SetSelFolder(const int index);
00197     virtual int GetItemCount() const;
00198     virtual int InsertItem(const int folder, const int index, LPCTSTR text, const int image = -1, const DWORD exData = 0);
00199     virtual void HighlightFolder(const int index);
00200     virtual int HitTestEx(const CPoint &point, int &index);
00201     virtual void GetInsideRect(CRect &rect) const;
00202     virtual int AddFolder(LPCTSTR cFolderName, const DWORD exData);
00203     virtual void GetItemRect(const int iFolder, const int iIndex, CRect &rect);
00204     virtual bool GetFolderRect(const int iIndex, CRect &rect) const;
00205     virtual void ModifyFlag(const DWORD &dwRemove, const DWORD &dwAdd, const UINT redraw = 0);
00206     virtual DWORD GetFlag() const;
00207     virtual void SetSmallIconView(const bool bSet);
00208     virtual bool IsSmallIconView() const;
00209     virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd * pParentWnd, UINT nID, const DWORD dwFlag = fDragItems|fEditGroups|fEditItems|fRemoveGroups|fRemoveItems|fAddGroups|fAnimation|fSelHighlight);
00210     virtual ~CGfxOutBarCtrl();
00211
00212     // Generated message map functions
00213 protected:
00214     void DrawFolder(CDC * pDC, const int iIdx, CRect rect, const bool bSelected);
00215     //{{AFX_MSG(CGfxOutBarCtrl)
00216     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00217     afx_msg void OnTimer(UINT nIDEvent);
00218     afx_msg void OnPaint();
00219     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00220     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00221     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00222     afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
00223     afx_msg void OnSize(UINT nType, int cx, int cy);
00224     afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00225     afx_msg void OnGfxLargeicon();
00226     afx_msg void OnUpdateGfxLargeicon(CCmdUI* pCmdUI);
00227     afx_msg void OnGfxSmallicon();
00228     afx_msg void OnUpdateGfxSmallicon(CCmdUI* pCmdUI);
00229     afx_msg void OnGfxRemoveitem();
00230     afx_msg void OnUpdateGfxRemoveitem(CCmdUI* pCmdUI);
00231     afx_msg void OnGfxRenameitem();
00232     afx_msg void OnUpdateGfxRenameitem(CCmdUI* pCmdUI);
00233     afx_msg void OnSysColorChange();
00234     //}}AFX_MSG
00235     afx_msg long OnEndLabelEdit(WPARAM wParam, LPARAM lParam);
00236     DECLARE_MESSAGE_MAP()
00237 };
00238
00240
00241 //{{AFX_INSERT_LOCATION}}
00242 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00243
00244 #endif // __GFXOUTBARCTRL_H__
Generated on Sun Feb 24 01:21:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/GfxSplitterWnd.h Source File

WinCvs/CJLib/Include/GfxSplitterWnd.h

Go to the documentation of this file.
00001 // Copyright (c) Iuri Apollonio 1998
00002 // Use & modify as you want & need, and leave those 3 lines.
00003 // http://www.codeguru.com
00004 //
00005 // GfxSplitterWnd.h: interface for the CGfxSplitterWnd class.
00006 //
00008 /****************************************************************************
00009  *
00010  * $Date: 1999/11/30 21:45:51 $
00011  * $Revision: 1.1.1.2 $
00012  * $Archive: /CodeJock/Include/GfxSplitterWnd.h $
00013  *
00014  * $History: GfxSplitterWnd.h $
00015  *
00016  * *****************  Version 4  *****************
00017  * User: Kirk Stowell Date: 10/26/99   Time: 10:50p
00018  * Updated in $/CodeJock/Include
00019  * Made class methods virtual for inheritance purposes.
00020  *
00021  * *****************  Version 3  *****************
00022  * User: Kirk Stowell Date: 10/14/99   Time: 12:41p
00023  * Updated in $/CodeJock/Include
00024  * Added source control history to file header.
00025  *
00026  ***************************************************************************/
00028
00029 #ifndef __GFXSPLITTERWND_H__
00030 #define __GFXSPLITTERWND_H__
00031
00032 #if _MSC_VER >= 1000
00033 #pragma once
00034 #endif // _MSC_VER >= 1000
00035
00036 class _CJX_EXT_CLASS CGfxSplitterWnd : public CSplitterWnd
00037 {
00038 public:
00039     int m_upBorder;
00040     bool bWhiteLine;
00041     CGfxSplitterWnd();
00042     virtual ~CGfxSplitterWnd();
00043     virtual void OnDrawSplitter(CDC* pDC, ESplitType nType, const CRect& rectArg);
00044     virtual void OnInvertTracker(const CRect & rect);
00045
00046     virtual void RecalcLayout();
00047 protected:
00048     virtual void GetInsideRect(CRect& rect) const;
00049     // Generated message map functions
00050     //{{AFX_MSG(CGfxSplitterWnd)
00051     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00052     afx_msg void OnPaint();
00053     //}}AFX_MSG
00054     DECLARE_MESSAGE_MAP()
00055 };
00056
00057 #endif // __GFXSPLITTERWND_H__
Generated on Sun Feb 24 01:21:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CJLib/Include/Subclass.h Source File

WinCvs/CJLib/Include/Subclass.h

Go to the documentation of this file.
00001 #ifndef _SUBCLASSW_H
00002 #define _SUBCLASSW_H
00003
00005 // Copyright 1998 Paul DiLascia
00006 // If this code works, it was written by Paul DiLascia.
00007 // If not, I don't know who wrote it.
00008 //
00010 /****************************************************************************
00011  *
00012  * $Date: 1999/11/30 21:45:51 $
00013  * $Revision: 1.1.1.2 $
00014  * $Archive: /CodeJock/Include/Subclass.h $
00015  *
00016  * $History: Subclass.h $
00017  *
00018  * *****************  Version 4  *****************
00019  * User: Kirk Stowell Date: 10/26/99   Time: 10:50p
00020  * Updated in $/CodeJock/Include
00021  * Made class methods virtual for inheritance purposes.
00022  *
00023  * *****************  Version 3  *****************
00024  * User: Kirk Stowell Date: 10/14/99   Time: 12:41p
00025  * Updated in $/CodeJock/Include
00026  * Added source control history to file header.
00027  *
00028  ***************************************************************************/
00030
00032 // Generic class to hook messages on behalf of a CWnd.
00033 // Once hooked, all messages go to CSubclassWnd::WindowProc before going
00034 // to the window. Specific subclasses can trap messages and do something.
00035 //
00036 // To use:
00037 //
00038 // * Derive a class from CSubclassWnd.
00039 //
00040 // * Override CSubclassWnd::WindowProc to handle messages. Make sure you call
00041 //   CSubclassWnd::WindowProc if you don't handle the message, or your
00042 //   window will never get messages. If you write seperate message handlers,
00043 //   you can call Default() to pass the message to the window.
00044 //
00045 // * Instantiate your derived class somewhere and call HookWindow(pWnd)
00046 //   to hook your window, AFTER it has been created.
00047 //    To unhook, call HookWindow(NULL).
00048 //
00049 // This is a very important class, crucial to many of the widgets Window
00050 // widgets implemented in PixieLib. To see how it works, look at the HOOK
00051 // sample program.
00052 //
00053 class _CJX_EXT_CLASS CSubclassWnd : public CObject {
00054 public:
00055     DECLARE_DYNAMIC(CSubclassWnd);
00056     CSubclassWnd();
00057     ~CSubclassWnd();
00058
00059     // Subclass a window. Hook(NULL) to unhook (automatic on WM_NCDESTROY)
00060     virtual BOOL    HookWindow(HWND  hwnd);
00061     virtual BOOL    HookWindow(CWnd* pWnd)  { return HookWindow(pWnd->GetSafeHwnd()); }
00062     virtual BOOL    IsHooked()                  { return m_hWnd!=NULL; }
00063
00064     friend LRESULT CALLBACK HookWndProc(HWND, UINT, WPARAM, LPARAM);
00065     friend class CSubclassWndMap;
00066
00067 #ifdef _DEBUG
00068     virtual void AssertValid() const;
00069     virtual void Dump(CDumpContext& dc) const;
00070 #endif
00071
00072 protected:
00073     HWND                m_hWnd;             // the window hooked
00074     WNDPROC         m_pOldWndProc;      // ..and original window proc
00075     CSubclassWnd*   m_pNext;                // next in chain of hooks for this window
00076
00077     // Override this to handle messages in specific handlers
00078     virtual LRESULT WindowProc(UINT msg, WPARAM wp, LPARAM lp);
00079     virtual LRESULT Default();              // call this at the end of handler fns
00080 };
00081
00082 #endif // _SUBCLASSW_H
00083
Generated on Sun Feb 24 01:21:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Subclass.cpp File Reference

WinCvs/CJLib/CJLibrary/Subclass.cpp File Reference

#include "StdAfx.h"
#include "Subclass.h"

Include dependency graph for Subclass.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | CSubclassWndMap

Defines

#define | theHookMap (CSubclassWndMap::GetHookMap())

Functions

IMPLEMENT_DYNAMIC (CSubclassWnd, CWnd)
LRESULT CALLBACK | HookWndProc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)

Define Documentation

#define theHookMap (CSubclassWndMap::GetHookMap())

Definition at line 55 of file Subclass.cpp.

Referenced by CSubclassWnd::HookWindow, and HookWndProc.

Function Documentation

LRESULT CALLBACK HookWndProc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wp,
 |  | LPARAM | lp
 | ) |

Definition at line 150 of file Subclass.cpp.

References ASSERT, CSubclassWnd::m_pOldWndProc, theHookMap, and CSubclassWnd::WindowProc.

Referenced by CSubclassWndMap::Add.

00151 {
00152 #ifdef _USRDLL
00153     // If this is a DLL, need to set up MFC state
00154     AFX_MANAGE_STATE(AfxGetStaticModuleState());
00155 #endif
00156
00157     // Set up MFC message state just in case anyone wants it
00158     // This is just like AfxCallWindowProc, but we can't use that because
00159     // a CSubclassWnd is not a CWnd.
00160     //
00161     MSG& curMsg = AfxGetThreadState()->m_lastSentMsg;
00162     MSG  oldMsg = curMsg;   // save for nesting
00163     curMsg.hwnd     = hwnd;
00164     curMsg.message = msg;
00165     curMsg.wParam  = wp;
00166     curMsg.lParam  = lp;
00167
00168     // Get hook object for this window. Get from hook map
00169     CSubclassWnd* pSubclassWnd = theHookMap.Lookup(hwnd);
00170     ASSERT(pSubclassWnd);
00171
00172     LRESULT lr;
00173     if (msg==WM_NCDESTROY) {
00174         // Window is being destroyed: unhook all hooks (for this window)
00175         // and pass msg to orginal window proc
00176         //
00177         WNDPROC wndproc = pSubclassWnd->m_pOldWndProc;
00178         theHookMap.RemoveAll(hwnd);
00179         lr = ::CallWindowProc(wndproc, hwnd, msg, wp, lp);
00180
00181     } else {
00182         // pass to msg hook
00183         lr = pSubclassWnd->WindowProc(msg, wp, lp);
00184     }
00185     curMsg = oldMsg;            // pop state
00186     return lr;
00187 }

IMPLEMENT_DYNAMIC | ( | CSubclassWnd | ,
 |  | CWnd |
 | ) |

Generated on Sun Feb 24 01:23:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJBrowseEdit.h File Reference

WinCvs/CJLib/Include/CJBrowseEdit.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCJBrowseButton
class | CCJBrowseEdit

Enumerations

enum BROWSE_TYPE {
BT_DIRECTORY = 1,
BT_FILE = 2,
BT_POPUPMENU = 3
}

Enumeration Type Documentation

enum BROWSE_TYPE

Enumeration values:
BT_DIRECTORY
BT_FILE
BT_POPUPMENU

Definition at line 74 of file CJBrowseEdit.h.

Referenced by CCJBrowseButton::Create, and CCJBrowseEdit::SetSearchType.

00074                          {
00075     BT_DIRECTORY = 1,
00076     BT_FILE      = 2,
00077     BT_POPUPMENU = 3
00078 };

Generated on Sun Feb 24 01:23:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJCaption.h File Reference

WinCvs/CJLib/Include/CJCaption.h File Reference

#include "CJFlatButton.h"

Include dependency graph for CJCaption.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCJCaption
class | CCJCaptionButton

Defines

#define | WS_EX_FLATEDGE 0x01

Define Documentation

#define WS_EX_FLATEDGE 0x01

Definition at line 127 of file CJCaption.h.

Referenced by CCJCaptionPopupWnd::Create, CCJCaption::Create, and CCJCaption::DrawCaptionBack.

Generated on Sun Feb 24 01:23:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJCaptionPopupWnd.h File Reference

WinCvs/CJLib/Include/CJCaptionPopupWnd.h File Reference

#include "CJCaption.h"
#include "CJFlatButton.h"

Include dependency graph for CJCaptionPopupWnd.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCJCaptionPopupWnd

Defines

#define | CM_ONPUSHPINBUTTON WM_USER + 1001
#define | CM_ONPUSHPINCANCEL WM_USER + 1002

Define Documentation

#define CM_ONPUSHPINBUTTON WM_USER + 1001

Definition at line 58 of file CJCaptionPopupWnd.h.

Referenced by CCJCaptionPopupWnd::OnCaptButton, and CCJCaption::OnPushPinButton.

#define CM_ONPUSHPINCANCEL WM_USER + 1002

Definition at line 59 of file CJCaptionPopupWnd.h.

Referenced by CCJCaption::OnPushPinCancel, and CCJCaptionPopupWnd::OnTimer.

Generated on Sun Feb 24 01:23:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJColorPicker.h File Reference

WinCvs/CJLib/Include/CJColorPicker.h File Reference

#include "CJColorPopup.h"

Include dependency graph for CJColorPicker.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCJColorPicker

Defines

#define | CP_MODE_TEXT 1
#define | CP_MODE_BK 2

Functions

void AFXAPI | DDX_CJColorPicker (CDataExchange *pDX, int nIDC, COLORREF &crColor)

Define Documentation

#define CP_MODE_BK 2

Definition at line 73 of file CJColorPicker.h.

Referenced by CCJColorPicker::CCJColorPicker.

#define CP_MODE_TEXT 1

Definition at line 72 of file CJColorPicker.h.

Referenced by CCJColorPicker::GetColor, and CCJColorPicker::SetColor.

Function Documentation

void AFXAPI DDX_CJColorPicker | ( | CDataExchange * | pDX,
 |  | int | nIDC,
 |  | COLORREF & | crColor
 | ) |

Definition at line 80 of file CJColorPicker.cpp.

00081 {
00082     HWND hWndCtrl = pDX->PrepareCtrl(nIDC);
00083     ASSERT (hWndCtrl != NULL);
00084
00085     CCJColorPicker* pColorPicker = (CCJColorPicker*) CWnd::FromHandle(hWndCtrl);
00086     if (pDX->m_bSaveAndValidate)
00087     {
00088         crColor = pColorPicker->GetColor();
00089     }
00090     else // initializing
00091     {
00092         pColorPicker->SetColor(crColor);
00093     }
00094 }

Generated on Sun Feb 24 01:23:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJColorPopup.h File Reference

WinCvs/CJLib/Include/CJColorPopup.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCJColorPopup
struct | ColorTableEntry

Defines

#define | CPN_SELCHANGE WM_USER + 1001
#define | CPN_DROPDOWN WM_USER + 1002
#define | CPN_CLOSEUP WM_USER + 1003
#define | CPN_SELENDOK WM_USER + 1004
#define | CPN_SELENDCANCEL WM_USER + 1005

Define Documentation

#define CPN_CLOSEUP WM_USER + 1003

Definition at line 57 of file CJColorPopup.h.

Referenced by CCJColorPicker::OnSelEndCancel, and CCJColorPicker::OnSelEndOK.

#define CPN_DROPDOWN WM_USER + 1002

Definition at line 56 of file CJColorPopup.h.

Referenced by CCJColorPicker::OnClicked.

#define CPN_SELCHANGE WM_USER + 1001

Definition at line 55 of file CJColorPopup.h.

Referenced by CCJColorPopup::ChangeSelection, CCJColorPicker::OnSelChange, and CCJColorPicker::OnSelEndOK.

#define CPN_SELENDCANCEL WM_USER + 1005

Definition at line 59 of file CJColorPopup.h.

Referenced by CCJColorPopup::EndSelection, CCJColorPopup::OnActivateApp, CCJColorPopup::OnKeyDown, CCJColorPopup::OnLButtonUp, and CCJColorPicker::OnSelEndCancel.

#define CPN_SELENDOK WM_USER + 1004

Definition at line 58 of file CJColorPopup.h.

Referenced by CCJColorPopup::OnKeyDown, CCJColorPopup::OnLButtonUp, and CCJColorPicker::OnSelEndOK.

Generated on Sun Feb 24 01:23:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJComboBoxEx.h File Reference

WinCvs/CJLib/Include/CJComboBoxEx.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJComboBoxEx

Generated on Sun Feb 24 01:23:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJControlBar.h File Reference

WinCvs/CJLib/Include/CJControlBar.h File Reference

#include "CJFlatButton.h"
#include "CJMenu.h"

Include dependency graph for CJControlBar.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCJCBarButton
class | CCJControlBar

Defines

#define | AFX_IDW_SIZEBAR_LEFT AFX_IDW_DOCKBAR_LEFT + 4
#define | AFX_IDW_SIZEBAR_RIGHT AFX_IDW_DOCKBAR_RIGHT + 5
#define | AFX_IDW_SIZEBAR_TOP AFX_IDW_DOCKBAR_TOP + 6
#define | AFX_IDW_SIZEBAR_BOTTOM AFX_IDW_DOCKBAR_BOTTOM + 7

Enumerations

enum BTN_IMG_INDEX {
HIDE_CONTRLBAR,
MAXI_H_DISABLE,
MAXI_H_ENABLED,
MAXI_V_DISABLE,
MAXI_V_ENABLED,
NORM_H_DISABLE,
NORM_H_ENABLED,
NORM_V_DISABLE,
NORM_V_ENABLED
}
enum CHILD_BORDER {
NONE,
OUTLINE,
SUNKEN,
RAISED
}

Variables

const DWORD | dwSizeBarMap [4][2]

Define Documentation

#define AFX_IDW_SIZEBAR_BOTTOM AFX_IDW_DOCKBAR_BOTTOM + 7

Definition at line 522 of file CJControlBar.h.

Referenced by CCJSizeDockBar::DrawBorders, CCJControlBar::IsBottomDocked, CCJSizeDockBar::OnLButtonUp, CCJSizeDockBar::OnMouseMove, CCJSizeDockBar::OnNcCalcSize, CCJSizeDockBar::OnNcLButtonDown, and CCJDockContext::ToggleDocking.

#define AFX_IDW_SIZEBAR_LEFT AFX_IDW_DOCKBAR_LEFT + 4

Definition at line 519 of file CJControlBar.h.

Referenced by CCJSizeDockBar::DrawBorders, CCJSizeDockBar::HitTest, CCJControlBar::IsLeftDocked, CCJSizeDockBar::OnLButtonUp, CCJSizeDockBar::OnMouseMove, CCJSizeDockBar::OnNcCalcSize, and CCJSizeDockBar::OnNcLButtonDown.

#define AFX_IDW_SIZEBAR_RIGHT AFX_IDW_DOCKBAR_RIGHT + 5

Definition at line 520 of file CJControlBar.h.

Referenced by CCJSizeDockBar::DrawBorders, CCJSizeDockBar::HitTest, CCJControlBar::IsRightDocked, CCJSizeDockBar::OnLButtonUp, CCJSizeDockBar::OnMouseMove, CCJSizeDockBar::OnNcCalcSize, and CCJSizeDockBar::OnNcLButtonDown.

#define AFX_IDW_SIZEBAR_TOP AFX_IDW_DOCKBAR_TOP + 6

Definition at line 521 of file CJControlBar.h.

Referenced by CCJSizeDockBar::DrawBorders, CCJSizeDockBar::HitTest, CCJControlBar::IsTopDocked, CCJSizeDockBar::OnLButtonUp, CCJSizeDockBar::OnMouseMove, CCJSizeDockBar::OnNcCalcSize, and CCJSizeDockBar::OnNcLButtonDown.

Enumeration Type Documentation

enum BTN_IMG_INDEX

Enumeration values:
HIDE_CONTRLBAR
MAXI_H_DISABLE
MAXI_H_ENABLED
MAXI_V_DISABLE
MAXI_V_ENABLED
NORM_H_DISABLE
NORM_H_ENABLED
NORM_V_DISABLE
NORM_V_ENABLED

Definition at line 198 of file CJControlBar.h.

Referenced by CCJControlBar::OnUpdateCmdUI.

00198              { HIDE_CONTRLBAR,
00199     MAXI_H_DISABLE, MAXI_H_ENABLED, MAXI_V_DISABLE, MAXI_V_ENABLED,
00200     NORM_H_DISABLE, NORM_H_ENABLED, NORM_V_DISABLE, NORM_V_ENABLED
00201 } BTN_IMG_INDEX;

enum CHILD_BORDER

Enumeration values:
NONE
OUTLINE
SUNKEN
RAISED

Definition at line 203 of file CJControlBar.h.

00203 { NONE, OUTLINE, SUNKEN, RAISED } CHILD_BORDER;

Variable Documentation

const DWORD dwSizeBarMap[4][2]

Initial value:

{
    {  AFX_IDW_DOCKBAR_TOP + 6 ,      CBRS_TOP    },
    {  AFX_IDW_DOCKBAR_BOTTOM + 7 ,   CBRS_BOTTOM },
    {  AFX_IDW_DOCKBAR_LEFT + 4 ,     CBRS_LEFT   },
    {  AFX_IDW_DOCKBAR_RIGHT + 5 ,    CBRS_RIGHT  },
}

Definition at line 524 of file CJControlBar.h.

Referenced by CCJMDIFrameWnd::DockSizeBar, CCJMDIChildWnd::DockSizeBar, CCJFrameWnd::DockSizeBar, CCJDockContext::DockSizeBar, CCJMDIFrameWnd::EnableDockingSizeBar, CCJMDIChildWnd::EnableDockingSizeBar, CCJFrameWnd::EnableDockingSizeBar, CCJSizeDockBar::RecalcAllExcept, CCJMDIFrameWnd::RecalcAllExcept, CCJMDIChildWnd::RecalcAllExcept, and CCJFrameWnd::RecalcAllExcept.

Generated on Sun Feb 24 01:23:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJDateTimeCtrl.h File Reference

WinCvs/CJLib/Include/CJDateTimeCtrl.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCJDateTimeCtrl
class | CCJMonthCalCtrl

Functions

void AFXAPI | DDX_CJDateTimeCtrl (CDataExchange *pDX, int nIDC, COleDateTime &value)
void AFXAPI | DDX_CJDateTimeCtrl (CDataExchange *pDX, int nIDC, CTime &value)
void AFXAPI | DDX_CJMonthCalCtrl (CDataExchange *pDX, int nIDC, COleDateTime &value)
void AFXAPI | DDX_CJMonthCalCtrl (CDataExchange *pDX, int nIDC, CTime &value)
void AFXAPI | DDV_CJMinMaxDateTime (CDataExchange *pDX, CTime &refValue, const CTime *pMinRange, const CTime *pMaxRange)
void AFXAPI | DDV_CJMinMaxDateTime (CDataExchange *pDX, COleDateTime &refValue, const COleDateTime *pMinRange, const COleDateTime *pMaxRange)
void AFXAPI | DDV_CJMinMaxMonth (CDataExchange *pDX, CTime &refValue, const CTime *pMinRange, const CTime *pMaxRange)
void AFXAPI | DDV_CJMinMaxMonth (CDataExchange *pDX, COleDateTime &refValue, const COleDateTime *pMinRange, const COleDateTime *pMaxRange)

Function Documentation

void AFXAPI DDV_CJMinMaxDateTime | ( | CDataExchange * | pDX,
 |  | COleDateTime & | refValue,
 |  | const COleDateTime * | pMinRange,
 |  | const COleDateTime * | pMaxRange
 | ) |

Definition at line 1068 of file CJDateTimeCtrl.cpp.

01070 {
01071     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01072     CCJDateTimeCtrl* pWnd =
01073         (CCJDateTimeCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01074
01075     if (!pDX->m_bSaveAndValidate)
01076     {
01077         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01078               (pMaxRange != NULL && *pMaxRange < refValue))
01079         {
01080             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01081             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01082             return;     // don't stop now
01083         }
01084     }
01085
01086     pWnd->SetRange(pMinRange, pMaxRange);
01087 }

void AFXAPI DDV_CJMinMaxDateTime | ( | CDataExchange * | pDX,
 |  | CTime & | refValue,
 |  | const CTime * | pMinRange,
 |  | const CTime * | pMaxRange
 | ) |

void AFXAPI DDV_CJMinMaxMonth | ( | CDataExchange * | pDX,
 |  | COleDateTime & | refValue,
 |  | const COleDateTime * | pMinRange,
 |  | const COleDateTime * | pMaxRange
 | ) |

Definition at line 1112 of file CJDateTimeCtrl.cpp.

01114 {
01115     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01116     CCJMonthCalCtrl* pWnd =
01117         (CCJMonthCalCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01118
01119     if (!pDX->m_bSaveAndValidate)
01120     {
01121         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01122               (pMaxRange != NULL && *pMaxRange < refValue))
01123         {
01124 #ifdef _DEBUG
01125             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01126             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01127 #endif
01128             return;     // don't stop now
01129         }
01130     }
01131
01132     pWnd->SetRange(pMinRange, pMaxRange);
01133 }

void AFXAPI DDV_CJMinMaxMonth | ( | CDataExchange * | pDX,
 |  | CTime & | refValue,
 |  | const CTime * | pMinRange,
 |  | const CTime * | pMaxRange
 | ) |

void AFXAPI DDX_CJDateTimeCtrl | ( | CDataExchange * | pDX,
 |  | int | nIDC,
 |  | CTime & | value
 | ) |

Definition at line 1010 of file CJDateTimeCtrl.cpp.

01011 {
01012     HWND hWndCtrl = pDX->PrepareCtrl(nIDC);
01013     CCJDateTimeCtrl* pWnd = (CCJDateTimeCtrl*) CWnd::FromHandle(hWndCtrl);
01014
01015     if (pDX->m_bSaveAndValidate)
01016         pWnd->GetTime(value);
01017     else
01018         pWnd->SetTime(&value);
01019 }

void AFXAPI DDX_CJDateTimeCtrl | ( | CDataExchange * | pDX,
 |  | int | nIDC,
 |  | COleDateTime & | value
 | ) |

void AFXAPI DDX_CJMonthCalCtrl | ( | CDataExchange * | pDX,
 |  | int | nIDC,
 |  | CTime & | value
 | ) |

Definition at line 1033 of file CJDateTimeCtrl.cpp.

01034 {
01035     HWND hWndCtrl = pDX->PrepareCtrl(nIDC);
01036     CCJMonthCalCtrl* pWnd = (CCJMonthCalCtrl*) CWnd::FromHandle(hWndCtrl);
01037
01038     if (pDX->m_bSaveAndValidate)
01039         pWnd->GetCurSel(value);
01040     else
01041         pWnd->SetCurSel(value);
01042 }

void AFXAPI DDX_CJMonthCalCtrl | ( | CDataExchange * | pDX,
 |  | int | nIDC,
 |  | COleDateTime & | value
 | ) |

Generated on Sun Feb 24 01:23:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJDockBar.h File Reference

WinCvs/CJLib/Include/CJDockBar.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJDockBar

Generated on Sun Feb 24 01:23:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJDockContext.h File Reference

WinCvs/CJLib/Include/CJDockContext.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJDockContext

Generated on Sun Feb 24 01:23:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJExplorerBar.h File Reference

WinCvs/CJLib/Include/CJExplorerBar.h File Reference

#include "CJControlBar.h"
#include "CJCaption.h"

Include dependency graph for CJExplorerBar.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJExplorerBar

Generated on Sun Feb 24 01:23:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJFlatButton.h File Reference

WinCvs/CJLib/Include/CJFlatButton.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJFlatButton

Generated on Sun Feb 24 01:23:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJFlatComboBox.h File Reference

WinCvs/CJLib/Include/CJFlatComboBox.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJFlatComboBox

Generated on Sun Feb 24 01:23:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJFlatHeaderCtrl.h File Reference

WinCvs/CJLib/Include/CJFlatHeaderCtrl.h File Reference

#include "CJMenu.h"

Include dependency graph for CJFlatHeaderCtrl.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJFlatHeaderCtrl

Generated on Sun Feb 24 01:23:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJFlatSplitterWnd.h File Reference

WinCvs/CJLib/Include/CJFlatSplitterWnd.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJFlatSplitterWnd

Generated on Sun Feb 24 01:23:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJFlatTabCtrl.h File Reference

WinCvs/CJLib/Include/CJFlatTabCtrl.h File Reference

#include <afxtempl.h>
#include "CJMetaFileButton.h"

Include dependency graph for CJFlatTabCtrl.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCJFlatTabCtrl

Defines

#define | FTS_BOTTOM 0x0002
#define | FTS_HASARROWS 0x0004
#define | FTS_HASHOMEEND 0x0008

Typedefs

typedef CList< CString *,
CString * > 		CTabList

Define Documentation

#define FTS_BOTTOM 0x0002

Definition at line 68 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl::OnCreate.

#define FTS_HASARROWS 0x0004

Definition at line 69 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl::OnCreate.

#define FTS_HASHOMEEND 0x0008

Definition at line 70 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl::OnCreate.

Typedef Documentation

typedef CList<CString*, CString*> CTabList

Definition at line 72 of file CJFlatTabCtrl.h.

Generated on Sun Feb 24 01:23:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJFontCombo.h File Reference

WinCvs/CJLib/Include/CJFontCombo.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJFontCombo

Generated on Sun Feb 24 01:23:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJFrameWnd.h File Reference

WinCvs/CJLib/Include/CJFrameWnd.h File Reference

#include "CJMenuBar.h"
#include "CJMenu.h"

Include dependency graph for CJFrameWnd.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJFrameWnd

Generated on Sun Feb 24 01:23:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJHexEdit.h File Reference

WinCvs/CJLib/Include/CJHexEdit.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJHexEdit

Generated on Sun Feb 24 01:23:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJHtmlView.h File Reference

WinCvs/CJLib/Include/CJHtmlView.h File Reference

#include <docobj.h>
#include <shlobj.h>
#include <exdisp.h>
#include <afxconv.h>

Include dependency graph for CJHtmlView.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJHtmlView

Generated on Sun Feb 24 01:23:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJHyperLink.h File Reference

WinCvs/CJLib/Include/CJHyperLink.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJHyperLink

Generated on Sun Feb 24 01:23:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJLibrary.h File Reference

WinCvs/CJLib/Include/CJLibrary.h File Reference

#include <afxtempl.h>
#include <afxpriv.h>
#include <..\src\afximpl.h>
#include "CJBrowseEdit.h"
#include "CJCaption.h"
#include "CJCaptionPopupWnd.h"
#include "CJColorPicker.h"
#include "CJComboBoxEx.h"
#include "CJControlBar.h"
#include "CJDateTimeCtrl.h"
#include "CJDockBar.h"
#include "CJDockContext.h"
#include "CJExplorerBar.h"
#include "CJFlatComboBox.h"
#include "CJFlatHeaderCtrl.h"
#include "CJFlatSplitterWnd.h"
#include "CJFlatTabCtrl.h"
#include "CJFontCombo.h"
#include "CJFrameWnd.h"
#include "CJHexEdit.h"
#include "CJHtmlView.h"
#include "CJHyperLink.h"
#include "CJListBox.h"
#include "CJListCtrl.h"
#include "CJListView.h"
#include "CJLogoPane.h"
#include "CJMaskEdit.h"
#include "CJMDIChildWnd.h"
#include "CJMDIFrameWnd.h"
#include "CJMemFile.h"
#include "CJMiniDockFrameWnd.h"
#include "CJOutlookBar.h"
#include "CJPagerCtrl.h"
#include "CJReBar.h"
#include "CJReBarCtrl.h"
#include "CJShell.h"
#include "CJShellList.h"
#include "CJShellTree.h"
#include "CJSizeDockBar.h"
#include "CJSortClass.h"
#include "CJStatusBar.h"
#include "CJTabCtrl.h"
#include "CJTabCtrlBar.h"
#include "CJTabView.h"
#include "CJTreeCtrl.h"
#include "CJWindowPlacement.h"
#include "GfxGroupEdit.h"
#include "GfxOutBarCtrl.h"
#include "GfxSplitterWnd.h"

Include dependency graph for CJLibrary.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | _VC_VERSION_5
#define | _CJX_EXT_CLASS
#define | _CJXLIB_INLINE inline
#define | _delete(p) {if(p){delete p;p=NULL;}}
#define | _CJX_COMMENT "CJ609LibStatic.lib"
#define | _CJX_MESSAGE "Automatically linking with CJ609LibStatic.lib"

Define Documentation

#define _CJX_COMMENT "CJ609LibStatic.lib"

Definition at line 365 of file CJLibrary.h.

#define _CJX_EXT_CLASS

Definition at line 97 of file CJLibrary.h.

#define _CJX_MESSAGE "Automatically linking with CJ609LibStatic.lib"

Definition at line 366 of file CJLibrary.h.

#define _CJXLIB_INLINE inline

Definition at line 102 of file CJLibrary.h.

#define _delete ( p ) {if(p){delete p;p=NULL;}}

Definition at line 331 of file CJLibrary.h.

#define _VC_VERSION_5

Definition at line 90 of file CJLibrary.h.

Generated on Sun Feb 24 01:23:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJListBox.h File Reference

WinCvs/CJLib/Include/CJListBox.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJListBox

Generated on Sun Feb 24 01:23:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJListCtrl.h File Reference

WinCvs/CJLib/Include/CJListCtrl.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJListCtrl

Generated on Sun Feb 24 01:23:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJListView.h File Reference

WinCvs/CJLib/Include/CJListView.h File Reference

#include <afxcview.h>

Include dependency graph for CJListView.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJListView

Generated on Sun Feb 24 01:23:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJLogoPane.h File Reference

WinCvs/CJLib/Include/CJLogoPane.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJLogoPane

Generated on Sun Feb 24 01:23:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJMaskEdit.h File Reference

WinCvs/CJLib/Include/CJMaskEdit.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCJDateEdit
class | CCJMaskEdit
class | CCJTimeEdit

Functions

void AFXAPI | DDX_OleDateTime (CDataExchange *pDX, int nIDC, CCJDateEdit &rControl, COleDateTime &rDateTime)

Function Documentation

void AFXAPI DDX_OleDateTime | ( | CDataExchange * | pDX,
 |  | int | nIDC,
 |  | CCJDateEdit & | rControl,
 |  | COleDateTime & | rDateTime
 | ) |

Definition at line 391 of file CJMaskEdit.cpp.

00392 {
00393     DDX_Control( pDX, nIDC, rControl );
00394
00395     if( pDX->m_bSaveAndValidate ) {
00396         rDateTime = rControl.GetDateTime();
00397     }
00398     else {
00399         rControl.SetDateTime( rDateTime );
00400     }
00401 }

Generated on Sun Feb 24 01:23:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJMDIChildWnd.h File Reference

WinCvs/CJLib/Include/CJMDIChildWnd.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJMDIChildWnd

Generated on Sun Feb 24 01:23:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJMDIFrameWnd.h File Reference

WinCvs/CJLib/Include/CJMDIFrameWnd.h File Reference

#include "CJMenuBar.h"
#include "CJMenu.h"

Include dependency graph for CJMDIFrameWnd.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJMDIFrameWnd

Typedefs

typedef CList< CCJMenu *,
CCJMenu * > 		CMDIMenuList

Typedef Documentation

typedef CList<CCJMenu*, CCJMenu*> CMDIMenuList

Definition at line 141 of file CJMDIFrameWnd.h.

Referenced by CMainFrame::GetMenuList.

Generated on Sun Feb 24 01:23:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJMemFile.h File Reference

WinCvs/CJLib/Include/CJMemFile.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJMemFile

Generated on Sun Feb 24 01:23:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJMenu.h File Reference

WinCvs/CJLib/Include/CJMenu.h File Reference

#include <afxtempl.h>

Include dependency graph for CJMenu.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCJMenu
class | CCJMenuData
struct | CMenuItemInfo

Defines

#define | AppendMenu AppendMenuA
#define | InsertMenu InsertMenuA
#define | InsertODMenu InsertODMenuA
#define | AppendODMenu AppendODMenuA
#define | AppendODPopupMenu AppendODPopupMenuA
#define | ModifyODMenu ModifyODMenuA

Enumerations

enum HIGHLIGHTSTYLE {
Normal,
TextOnly
}

Define Documentation

#define AppendMenu AppendMenuA

Definition at line 81 of file CJMenu.h.

Referenced by CColorMenu::AppendColorMenuItem, CCJMenu::AppendMenuA, and CCJMenu::AppendODMenuW.

#define AppendODMenu AppendODMenuA

Definition at line 84 of file CJMenu.h.

#define AppendODPopupMenu AppendODPopupMenuA

Definition at line 85 of file CJMenu.h.

#define InsertMenu InsertMenuA

Definition at line 82 of file CJMenu.h.

Referenced by CCJMenu::InsertODMenuW.

#define InsertODMenu InsertODMenuA

Definition at line 83 of file CJMenu.h.

#define ModifyODMenu ModifyODMenuA

Definition at line 86 of file CJMenu.h.

Referenced by CCJMenu::LoadToolbar.

Enumeration Type Documentation

enum HIGHLIGHTSTYLE

Enumeration values:
Normal
TextOnly

Definition at line 78 of file CJMenu.h.

00078 {Normal,TextOnly} HIGHLIGHTSTYLE;

Generated on Sun Feb 24 01:23:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJMenuBar.h File Reference

WinCvs/CJLib/Include/CJMenuBar.h File Reference

#include "CJToolBar.h"
#include "CJMenu.h"
#include "Subclass.h"

Include dependency graph for CJMenuBar.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCJMenuBar
class | CCJMenuBarFrameHook

Enumerations

enum TRACKINGSTATE {
TRACK_NONE = 0,
TRACK_BUTTON,
TRACK_POPUP
}

Enumeration Type Documentation

enum TRACKINGSTATE

Enumeration values:
TRACK_NONE
TRACK_BUTTON
TRACK_POPUP

Definition at line 71 of file CJMenuBar.h.

Referenced by CCJMenuBar::GetTrackingState, and CCJMenuBar::SetTrackingState.

00071                            { // menubar has three states:
00072     TRACK_NONE = 0,   // * normal, not tracking anything
00073     TRACK_BUTTON,     // * tracking buttons (F10/Alt mode)
00074     TRACK_POPUP       // * tracking popups
00075 };

Generated on Sun Feb 24 01:23:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJMetaFileButton.h File Reference

WinCvs/CJLib/Include/CJMetaFileButton.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJMetaFileButton

Generated on Sun Feb 24 01:23:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJMiniDockFrameWnd.h File Reference

WinCvs/CJLib/Include/CJMiniDockFrameWnd.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJMiniDockFrameWnd

Generated on Sun Feb 24 01:23:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJOutlookBar.h File Reference

WinCvs/CJLib/Include/CJOutlookBar.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCJOutlookBar
class | CContentItems

Defines

#define | OBN_SELENDOK (WM_USER + 1)
#define | OB_CYBUTTON 70

Define Documentation

#define OB_CYBUTTON 70

Definition at line 220 of file CJOutlookBar.h.

#define OBN_SELENDOK (WM_USER + 1)

Definition at line 219 of file CJOutlookBar.h.

Referenced by CCJOutlookBar::OnLButtonUp.

Generated on Sun Feb 24 01:23:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJPagerCtrl.h File Reference

WinCvs/CJLib/Include/CJPagerCtrl.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJPagerCtrl

Generated on Sun Feb 24 01:23:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJReBar.h File Reference

WinCvs/CJLib/Include/CJReBar.h File Reference

#include "CJToolBarBase.h"

Include dependency graph for CJReBar.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJReBar

Generated on Sun Feb 24 01:23:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJReBarCtrl.h File Reference

WinCvs/CJLib/Include/CJReBarCtrl.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJReBarCtrl

Generated on Sun Feb 24 01:23:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJResource.h File Reference

WinCvs/CJLib/Include/CJResource.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | IDR_POPUP_HEX_EDIT 103
#define | IDS_HIDE 5000
#define | IDC_NODRAGGING 5001
#define | IDS_NAME 5001
#define | IDS_EXPAND 5002
#define | IDC_DRAGGING 5003
#define | IDS_SIZE 5003
#define | IDS_CONTRACT 5004
#define | IDC_HANDCUR 5005
#define | IDS_TYPE 5005
#define | IDB_BUTTON_IMAGES 5006
#define | IDS_MODIFIED 5006
#define | IDC_TAB_CONTROL 5007
#define | IDS_REGKEY 5007
#define | IDR_CBAR_POPUP 5008
#define | IDS_INVALID_VER 5008
#define | IDC_URL_CODEJOCKEY 5009
#define | IDS_WIN_PLACEMENT 5009
#define | IDB_BTN_EXPLORER 5010
#define | IDS_COLOR_AUTO 5010
#define | IDM_CBAR_MENU 5011
#define | IDS_COLOR_CUST 5011
#define | IDC_BUTTON_HIDE 5012
#define | IDS_SECTION 5012
#define | IDC_BUTTON_MINI 5013
#define | IDS_ENTRY 5013
#define | IDC_BAR_BUTTON 5014
#define | IDS_REMOVEITEM 5014
#define | IDC_BAR_CAPTION 5015
#define | IDS_RENAMEITEM 5015
#define | IDB_BTN_ARROW 5016
#define | ID_GFX_LARGEICON 5017
#define | ID_GFX_SMALLICON 5018
#define | ID_GFX_REMOVEITEM 5019
#define | IDC_VSPLITBAR 5020
#define | ID_GFX_RENAMEITEM 5021
#define | IDC_HSPLITBAR 5022
#define | IDR_GFXOUTBAR 5023
#define | IDR_POPUP_TOOLBAR 5024
#define | IDS_SETTINGS 5025
#define | IDS_TBAR_SETTINGS 5026
#define | ID_POPUP_CUSTOMIZE 5027
#define | IDS_WNDPOS 5028
#define | IDC_CAPT_BUTTON 5029
#define | IDB_PUSHPIN 5030
#define | IDC_LEFTBUTTON 5031
#define | IDC_RIGHTBUTTON 5032
#define | IDC_HOMEBUTTON 5033
#define | IDC_ENDBUTTON 5034

Define Documentation

#define ID_GFX_LARGEICON 5017

Definition at line 36 of file CJResource.h.

#define ID_GFX_REMOVEITEM 5019

Definition at line 38 of file CJResource.h.

Referenced by CGfxOutBarCtrl::OnRButtonDown.

#define ID_GFX_RENAMEITEM 5021

Definition at line 40 of file CJResource.h.

Referenced by CGfxOutBarCtrl::OnRButtonDown.

#define ID_GFX_SMALLICON 5018

Definition at line 37 of file CJResource.h.

#define ID_POPUP_CUSTOMIZE 5027

Definition at line 46 of file CJResource.h.

#define IDB_BTN_ARROW 5016

Definition at line 35 of file CJResource.h.

Referenced by CCJBrowseButton::Create.

#define IDB_BTN_EXPLORER 5010

Definition at line 23 of file CJResource.h.

#define IDB_BUTTON_IMAGES 5006

Definition at line 15 of file CJResource.h.

Referenced by CCJControlBar::CCJControlBar.

#define IDB_PUSHPIN 5030

Definition at line 49 of file CJResource.h.

Referenced by CCJCaptionPopupWnd::Create, and CCJExplorerBar::OnCreate.

#define IDC_BAR_BUTTON 5014

Definition at line 31 of file CJResource.h.

Referenced by CCJExplorerBar::OnCreate.

#define IDC_BAR_CAPTION 5015

Definition at line 33 of file CJResource.h.

#define IDC_BUTTON_HIDE 5012

Definition at line 27 of file CJResource.h.

Referenced by CCJControlBar::OnCreate.

#define IDC_BUTTON_MINI 5013

Definition at line 29 of file CJResource.h.

Referenced by CCJControlBar::OnCreate.

#define IDC_CAPT_BUTTON 5029

Definition at line 48 of file CJResource.h.

Referenced by CCJCaptionPopupWnd::Create, and CCJCaption::Create.

#define IDC_DRAGGING 5003

Definition at line 10 of file CJResource.h.

Referenced by CGfxOutBarCtrl::CGfxOutBarCtrl.

#define IDC_ENDBUTTON 5034

Definition at line 53 of file CJResource.h.

Referenced by CCJFlatTabCtrl::OnCreate.

#define IDC_HANDCUR 5005

Definition at line 13 of file CJResource.h.

Referenced by CCJFlatButton::CCJFlatButton, and CGfxOutBarCtrl::CGfxOutBarCtrl.

#define IDC_HOMEBUTTON 5033

Definition at line 52 of file CJResource.h.

Referenced by CCJFlatTabCtrl::OnCreate.

#define IDC_HSPLITBAR 5022

Definition at line 41 of file CJResource.h.

Referenced by CCJSizeDockBar::HitTest, and CCJControlBar::HitTest.

#define IDC_LEFTBUTTON 5031

Definition at line 50 of file CJResource.h.

Referenced by CCJFlatTabCtrl::OnCreate.

#define IDC_NODRAGGING 5001

Definition at line 7 of file CJResource.h.

Referenced by CGfxOutBarCtrl::CGfxOutBarCtrl.

#define IDC_RIGHTBUTTON 5032

Definition at line 51 of file CJResource.h.

Referenced by CCJFlatTabCtrl::OnCreate.

#define IDC_TAB_CONTROL 5007

Definition at line 17 of file CJResource.h.

Referenced by CCJTabCtrlBar::OnCreate.

#define IDC_URL_CODEJOCKEY 5009

Definition at line 21 of file CJResource.h.

#define IDC_VSPLITBAR 5020

Definition at line 39 of file CJResource.h.

Referenced by CCJSizeDockBar::HitTest, and CCJControlBar::HitTest.

#define IDM_CBAR_MENU 5011

Definition at line 25 of file CJResource.h.

#define IDR_CBAR_POPUP 5008

Definition at line 19 of file CJResource.h.

#define IDR_GFXOUTBAR 5023

Definition at line 42 of file CJResource.h.

Referenced by CGfxOutBarCtrl::OnRButtonDown.

#define IDR_POPUP_HEX_EDIT 103

Definition at line 5 of file CJResource.h.

Referenced by CCJHexEdit::OnContextMenu.

#define IDR_POPUP_TOOLBAR 5024

Definition at line 43 of file CJResource.h.

#define IDS_COLOR_AUTO 5010

Definition at line 24 of file CJResource.h.

Referenced by CCJColorPicker::CCJColorPicker, and CCJColorPopup::CCJColorPopup.

#define IDS_COLOR_CUST 5011

Definition at line 26 of file CJResource.h.

Referenced by CCJColorPicker::CCJColorPicker, and CCJColorPopup::CCJColorPopup.

#define IDS_CONTRACT 5004

Definition at line 12 of file CJResource.h.

Referenced by CCJControlBar::OnUpdateCmdUI.

#define IDS_ENTRY 5013

Definition at line 30 of file CJResource.h.

#define IDS_EXPAND 5002

Definition at line 9 of file CJResource.h.

Referenced by CCJControlBar::OnCreate, and CCJControlBar::OnUpdateCmdUI.

#define IDS_HIDE 5000

Definition at line 6 of file CJResource.h.

Referenced by CCJControlBar::OnCreate.

#define IDS_INVALID_VER 5008

Definition at line 20 of file CJResource.h.

#define IDS_MODIFIED 5006

Definition at line 16 of file CJResource.h.

#define IDS_NAME 5001

Definition at line 8 of file CJResource.h.

#define IDS_REGKEY 5007

Definition at line 18 of file CJResource.h.

#define IDS_REMOVEITEM 5014

Definition at line 32 of file CJResource.h.

Referenced by CGfxOutBarCtrl::CGfxOutBarCtrl.

#define IDS_RENAMEITEM 5015

Definition at line 34 of file CJResource.h.

Referenced by CGfxOutBarCtrl::CGfxOutBarCtrl.

#define IDS_SECTION 5012

Definition at line 28 of file CJResource.h.

#define IDS_SETTINGS 5025

Definition at line 44 of file CJResource.h.

Referenced by CCJWindowPlacement::LoadWindowPos.

#define IDS_SIZE 5003

Definition at line 11 of file CJResource.h.

#define IDS_TBAR_SETTINGS 5026

Definition at line 45 of file CJResource.h.

#define IDS_TYPE 5005

Definition at line 14 of file CJResource.h.

#define IDS_WIN_PLACEMENT 5009

Definition at line 22 of file CJResource.h.

Referenced by CCJWindowPlacement::LoadWindowPos.

#define IDS_WNDPOS 5028

Definition at line 47 of file CJResource.h.

Referenced by CCJWindowPlacement::LoadWindowPos.

Generated on Sun Feb 24 01:23:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJShell.h File Reference

WinCvs/CJLib/Include/CJShell.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJShellList.h File Reference

WinCvs/CJLib/Include/CJShellList.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJShellTree.h File Reference

WinCvs/CJLib/Include/CJShellTree.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJSizeDockBar.h File Reference

WinCvs/CJLib/Include/CJSizeDockBar.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJSizeDockBar

Generated on Sun Feb 24 01:23:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJSortClass.h File Reference

WinCvs/CJLib/Include/CJSortClass.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCJSortClass
struct | CCJSortClass::CSortItem

Enumerations

enum DATA_TYPE {
DT_INT = 1,
DT_STRING,
DT_DATETIME,
DT_DEC
}

Enumeration Type Documentation

enum DATA_TYPE

Enumeration values:
DT_INT
DT_STRING
DT_DATETIME
DT_DEC

Definition at line 38 of file CJSortClass.h.

Referenced by CCJSortClass::Compare, and CCJSortClass::Sort.

00039 {
00040     DT_INT = 1,     // sort type int
00041     DT_STRING,      // sort type string
00042     DT_DATETIME,    // sort type date / time
00043     DT_DEC          // sort type decimal
00044 };

Generated on Sun Feb 24 01:23:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJStatusBar.h File Reference

WinCvs/CJLib/Include/CJStatusBar.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCJStatusBar
class | CCJStatusBarPane
class | CCJStatusBarPaneControlInfo

Generated on Sun Feb 24 01:23:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJTabCtrl.h File Reference

WinCvs/CJLib/Include/CJTabCtrl.h File Reference

#include "CJMenu.h"

Include dependency graph for CJTabCtrl.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJTabCtrl

Generated on Sun Feb 24 01:23:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJTabCtrlBar.h File Reference

WinCvs/CJLib/Include/CJTabCtrlBar.h File Reference

#include <afxtempl.h>
#include "CJControlBar.h"
#include "CJTabCtrl.h"

Include dependency graph for CJTabCtrlBar.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCJTabCtrlBar
struct | tagTCB_ITEM

Typedefs

typedef tagTCB_ITEM | TCB_ITEM
typedef CList< TCB_ITEM *,
TCB_ITEM * > 		CTabViews

Typedef Documentation

typedef CList<TCB_ITEM *,TCB_ITEM *> CTabViews

Definition at line 179 of file CJTabCtrlBar.h.

typedef struct tagTCB_ITEM TCB_ITEM

Generated on Sun Feb 24 01:23:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJTabView.h File Reference

WinCvs/CJLib/Include/CJTabView.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCJTabView
struct | tagCTV_ITEM

Defines

#define | TABVIEW_BORDER 3

Typedefs

typedef tagCTV_ITEM | CTV_ITEM
typedef CList< CTV_ITEM *,
CTV_ITEM * > 		CListViews

Define Documentation

#define TABVIEW_BORDER 3

Definition at line 52 of file CJTabView.h.

Referenced by CCJTabView::CalcViewRect.

Typedef Documentation

typedef CList<CTV_ITEM*, CTV_ITEM *> CListViews

Definition at line 55 of file CJTabView.h.

typedef struct tagCTV_ITEM CTV_ITEM

Generated on Sun Feb 24 01:23:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJToolBar.h File Reference

WinCvs/CJLib/Include/CJToolBar.h File Reference

#include "CJToolBarBase.h"
#include "CJToolBarCtrl.h"

Include dependency graph for CJToolBar.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCJToolBar
struct | DROPDOWNBUTTON
struct | TOOLBARINFO

Defines

#define | VERSION_WIN4 MAKELONG(0, 4)
#define | VERSION_IE3 MAKELONG(70, 4)
#define | VERSION_IE4 MAKELONG(71, 4)
#define | VERSION_IE401 MAKELONG(72, 4)
#define | TBBS_BUTTON MAKELONG(TBSTYLE_BUTTON, 0)
#define | TBBS_SEPARATOR MAKELONG(TBSTYLE_SEP, 0)
#define | TBBS_CHECKBOX MAKELONG(TBSTYLE_CHECK, 0)
#define | TBBS_GROUP MAKELONG(TBSTYLE_GROUP, 0)
#define | TBBS_CHECKGROUP (TBBS_GROUP|TBBS_CHECKBOX)
#define | TBBS_DROPDOWN MAKELONG(TBSTYLE_DROPDOWN, 0)
#define | TBBS_AUTOSIZE MAKELONG(TBSTYLE_AUTOSIZE, 0)
#define | TBBS_NOPREFIX MAKELONG(TBSTYLE_NOPREFIX, 0)
#define | TBBS_CHECKED MAKELONG(0, TBSTATE_CHECKED)
#define | TBBS_PRESSED MAKELONG(0, TBSTATE_PRESSED)
#define | TBBS_DISABLED MAKELONG(0, TBSTATE_ENABLED)
#define | TBBS_INDETERMINATE MAKELONG(0, TBSTATE_INDETERMINATE)
#define | TBBS_HIDDEN MAKELONG(0, TBSTATE_HIDDEN)
#define | TBBS_WRAPPED MAKELONG(0, TBSTATE_WRAP)
#define | TBBS_ELLIPSES MAKELONG(0, TBSTATE_ELIPSES)
#define | TBBS_MARKED MAKELONG(0, TBSTATE_MARKED)

Functions

DWORD AFXAPI | _GetComCtlVersion ()
HBITMAP AFXAPI | _LoadSysColorBitmap (HINSTANCE hInst, HRSRC hRsrc, BOOL bMono=FALSE)

Variables

int | _ComCtlVersion

Define Documentation

#define TBBS_AUTOSIZE MAKELONG(TBSTYLE_AUTOSIZE, 0)

Definition at line 501 of file CJToolBar.h.

#define TBBS_BUTTON MAKELONG(TBSTYLE_BUTTON, 0)

Definition at line 495 of file CJToolBar.h.

Referenced by UToolbar::RebuildBar.

#define TBBS_CHECKBOX MAKELONG(TBSTYLE_CHECK, 0)

Definition at line 497 of file CJToolBar.h.

Referenced by UToolbar::RebuildBar, and CCJToolCmdUI::SetCheck.

#define TBBS_CHECKED MAKELONG(0, TBSTATE_CHECKED)

Definition at line 505 of file CJToolBar.h.

Referenced by CCJToolCmdUI::SetCheck.

#define TBBS_CHECKGROUP (TBBS_GROUP|TBBS_CHECKBOX)

Definition at line 499 of file CJToolBar.h.

#define TBBS_DISABLED MAKELONG(0, TBSTATE_ENABLED)

Definition at line 507 of file CJToolBar.h.

Referenced by CCJToolCmdUI::Enable.

#define TBBS_DROPDOWN MAKELONG(TBSTYLE_DROPDOWN, 0)

Definition at line 500 of file CJToolBar.h.

#define TBBS_ELLIPSES MAKELONG(0, TBSTATE_ELIPSES)

Definition at line 511 of file CJToolBar.h.

#define TBBS_GROUP MAKELONG(TBSTYLE_GROUP, 0)

Definition at line 498 of file CJToolBar.h.

#define TBBS_HIDDEN MAKELONG(0, TBSTATE_HIDDEN)

Definition at line 509 of file CJToolBar.h.

#define TBBS_INDETERMINATE MAKELONG(0, TBSTATE_INDETERMINATE)

Definition at line 508 of file CJToolBar.h.

Referenced by CCJToolCmdUI::SetCheck.

#define TBBS_MARKED MAKELONG(0, TBSTATE_MARKED)

Definition at line 512 of file CJToolBar.h.

#define TBBS_NOPREFIX MAKELONG(TBSTYLE_NOPREFIX, 0)

Definition at line 502 of file CJToolBar.h.

#define TBBS_PRESSED MAKELONG(0, TBSTATE_PRESSED)

Definition at line 506 of file CJToolBar.h.

Referenced by CCJToolCmdUI::Enable.

#define TBBS_SEPARATOR MAKELONG(TBSTYLE_SEP, 0)

Definition at line 496 of file CJToolBar.h.

Referenced by CCJToolCmdUI::Enable, CCJToolBar::InsertControl, CMainFrame::OnCreate, UToolbar::RebuildBar, and CCJToolCmdUI::SetCheck.

#define TBBS_WRAPPED MAKELONG(0, TBSTATE_WRAP)

Definition at line 510 of file CJToolBar.h.

#define VERSION_IE3 MAKELONG(70, 4)

Definition at line 78 of file CJToolBar.h.

Referenced by CCJToolBar::GetButtonSize.

#define VERSION_IE4 MAKELONG(71, 4)

Definition at line 79 of file CJToolBar.h.

Referenced by DllMain, CCJToolBar::GetButtonSize, CCJToolBar::OnNcCalcSize, CCJToolBar::OnPreserveZeroBorderHelper, CCJToolBar::OnSetSizeHelper, and CCJToolBar::SetButtons.

#define VERSION_IE401 MAKELONG(72, 4)

Definition at line 80 of file CJToolBar.h.

#define VERSION_WIN4 MAKELONG(0, 4)

Definition at line 77 of file CJToolBar.h.

Referenced by _GetComCtlVersion.

Function Documentation

DWORD AFXAPI _GetComCtlVersion ( )

Definition at line 229 of file CJToolBar.cpp.

References FALSE.

00230 {
00231     // return cached version if already determined...
00232     if (_ComCtlVersion != -1)
00233         return _ComCtlVersion;
00234
00235     // otherwise determine comctl32.dll version via DllGetVersion
00236     HINSTANCE hInst = ::GetModuleHandleA("COMCTL32.DLL");
00237     ASSERT(hInst != NULL);
00238     AFX_DLLGETVERSIONPROC pfn;
00239     pfn = (AFX_DLLGETVERSIONPROC)GetProcAddress(hInst, "DllGetVersion");
00240     DWORD dwVersion = VERSION_WIN4;
00241     if (pfn != NULL)
00242     {
00243         AFX_DLLVERSIONINFO dvi;
00244         memset(&dvi, 0, sizeof(dvi));
00245         dvi.cbSize = sizeof(dvi);
00246         HRESULT hr = (*pfn)(&dvi);
00247         if (SUCCEEDED(hr))
00248         {
00249             ASSERT(dvi.dwMajorVersion <= 0xFFFF);
00250             ASSERT(dvi.dwMinorVersion <= 0xFFFF);
00251             dwVersion = MAKELONG(dvi.dwMinorVersion, dvi.dwMajorVersion);
00252         }
00253     }
00254     _ComCtlVersion = dwVersion;
00255     return dwVersion;
00256 }

HBITMAP AFXAPI _LoadSysColorBitmap | ( | HINSTANCE | hInst,
 |  | HRSRC | hRsrc,
 |  | BOOL | bMono = FALSE
 | ) |

Definition at line 141 of file CJToolBar.cpp.

References NULL, and TRUE.

Referenced by CCJToolBar::LoadBitmap, and CCJToolBar::OnSysColorChange.

00142 {
00143     HGLOBAL hglb;
00144     if ((hglb = LoadResource(hInst, hRsrc)) == NULL)
00145         return NULL;
00146
00147     LPBITMAPINFOHEADER lpBitmap = (LPBITMAPINFOHEADER)LockResource(hglb);
00148     if (lpBitmap == NULL)
00149         return NULL;
00150
00151     // make copy of BITMAPINFOHEADER so we can modify the color table
00152     const int nColorTableSize = 16;
00153     UINT nSize = lpBitmap->biSize + nColorTableSize * sizeof(RGBQUAD);
00154     LPBITMAPINFOHEADER lpBitmapInfo = (LPBITMAPINFOHEADER)::malloc(nSize);
00155     if (lpBitmapInfo == NULL)
00156         return NULL;
00157     memcpy(lpBitmapInfo, lpBitmap, nSize);
00158
00159     // color table is in RGBQUAD DIB format
00160     DWORD* pColorTable =
00161         (DWORD*)(((LPBYTE)lpBitmapInfo) + (UINT)lpBitmapInfo->biSize);
00162
00163     for (int iColor = 0; iColor < nColorTableSize; iColor++)
00164     {
00165         // look for matching RGBQUAD color in original
00166         for (int i = 0; i < _countof(_sysColorMap); i++)
00167         {
00168             if (pColorTable[iColor] == _sysColorMap[i].rgbqFrom)
00169             {
00170                 if (bMono)
00171                 {
00172                     // all colors except text become white
00173                     if (_sysColorMap[i].iSysColorTo != COLOR_BTNTEXT)
00174                         pColorTable[iColor] = _RGB_TO_RGBQUAD(255, 255, 255);
00175                 }
00176                 else
00177                     pColorTable[iColor] =
00178                     _CLR_TO_RGBQUAD(::GetSysColor(_sysColorMap[i].iSysColorTo));
00179                 break;
00180             }
00181         }
00182     }
00183
00184     int nWidth = (int)lpBitmapInfo->biWidth;
00185     int nHeight = (int)lpBitmapInfo->biHeight;
00186     HDC hDCScreen = ::GetDC(NULL);
00187     HBITMAP hbm = ::CreateCompatibleBitmap(hDCScreen, nWidth, nHeight);
00188
00189     if (hbm != NULL)
00190     {
00191         HDC hDCGlyphs = ::CreateCompatibleDC(hDCScreen);
00192         HBITMAP hbmOld = (HBITMAP)::SelectObject(hDCGlyphs, hbm);
00193
00194         LPBYTE lpBits;
00195         lpBits = (LPBYTE)(lpBitmap + 1);
00196         lpBits += (1 << (lpBitmapInfo->biBitCount)) * sizeof(RGBQUAD);
00197
00198         StretchDIBits(hDCGlyphs, 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight,
00199             lpBits, (LPBITMAPINFO)lpBitmapInfo, DIB_RGB_COLORS, SRCCOPY);
00200         SelectObject(hDCGlyphs, hbmOld);
00201         ::DeleteDC(hDCGlyphs);
00202     }
00203     ::ReleaseDC(NULL, hDCScreen);
00204
00205     // free copy of bitmap info struct and resource itself
00206     ::free(lpBitmapInfo);
00207     ::FreeResource(hglb);
00208
00209     return hbm;
00210 }

Variable Documentation

int _ComCtlVersion

Definition at line 82 of file CJToolBar.h.

Generated on Sun Feb 24 01:23:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJToolBarBase.h File Reference

WinCvs/CJLib/Include/CJToolBarBase.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJToolBarBase

Generated on Sun Feb 24 01:23:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJToolBarCtrl.h File Reference

WinCvs/CJLib/Include/CJToolBarCtrl.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJToolBarCtrl

Generated on Sun Feb 24 01:23:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJTreeCtrl.h File Reference

WinCvs/CJLib/Include/CJTreeCtrl.h File Reference

#include <afxtempl.h>

Include dependency graph for CJTreeCtrl.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CCJTreeCtrl
struct | CCJTreeCtrl::Color_Font

Generated on Sun Feb 24 01:23:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJWindowPlacement.h File Reference

WinCvs/CJLib/Include/CJWindowPlacement.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CCJWindowPlacement

Generated on Sun Feb 24 01:23:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GfxGroupEdit.h File Reference

WinCvs/CJLib/Include/GfxGroupEdit.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CGfxGroupEdit

Generated on Sun Feb 24 01:23:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GfxOutBarCtrl.h File Reference

WinCvs/CJLib/Include/GfxOutBarCtrl.h File Reference

#include <afxcoll.h>
#include "CJMenu.h"

Include dependency graph for GfxOutBarCtrl.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CGfxOutBarCtrl::CBarFolder
class | CGfxOutBarCtrl::CBarItem
class | CGfxOutBarCtrl
struct | OUTBAR_INFO

Defines

#define | WM_OUTBAR_NOTIFY WM_USER + 1
#define | NM_OB_ITEMCLICK 1
#define | NM_OB_ONLABELENDEDIT 2
#define | NM_OB_ONGROUPENDEDIT 3
#define | NM_OB_DRAGITEM 4
#define | NM_FOLDERCHANGE 5
#define | NM_OB_ITEMHOVER 6

Define Documentation

#define NM_FOLDERCHANGE 5

Definition at line 47 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl::SetSelFolder.

#define NM_OB_DRAGITEM 4

Definition at line 46 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl::OnLButtonDown.

#define NM_OB_ITEMCLICK 1

Definition at line 43 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl::OnLButtonDown.

#define NM_OB_ITEMHOVER 6

Definition at line 48 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl::HighlightItem.

#define NM_OB_ONGROUPENDEDIT 3

Definition at line 45 of file GfxOutBarCtrl.h.

Referenced by CGfxGroupEdit::CGfxGroupEdit, CGfxGroupEdit::OnChar, CGfxOutBarCtrl::OnEndLabelEdit, and CGfxOutBarCtrl::StartGroupEdit.

#define NM_OB_ONLABELENDEDIT 2

Definition at line 44 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl::OnEndLabelEdit, and CGfxOutBarCtrl::StartItemEdit.

#define WM_OUTBAR_NOTIFY WM_USER + 1

Definition at line 42 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl::HighlightItem, CGfxOutBarCtrl::OnEndLabelEdit, CGfxGroupEdit::OnKillFocus, CGfxOutBarCtrl::OnLButtonDown, and CGfxOutBarCtrl::SetSelFolder.

Generated on Sun Feb 24 01:23:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GfxSplitterWnd.h File Reference

WinCvs/CJLib/Include/GfxSplitterWnd.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CGfxSplitterWnd

Generated on Sun Feb 24 01:23:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Subclass.h File Reference

WinCvs/CJLib/Include/Subclass.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CSubclassWnd

Generated on Sun Feb 24 01:23:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


cvs_coworker.h File Reference

WinCvs/CoWorker/cvs_coworker.h File Reference

#include "rpc.h"
#include "rpcndr.h"
#include "windows.h"
#include "ole2.h"
#include "oaidl.h"
#include "ocidl.h"

Include dependency graph for cvs_coworker.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | __REQUIRED_RPCNDR_H_VERSION__ 440

Typedefs

typedef interface ICvsCoworker | ICvsCoworker
typedef CvsCoworker | CvsCoworker
typedef enum CvsOption | CvsOption
typedef enum CvsCommand | CvsCommand

Enumerations

enum CvsOption {
cvsOptionCompareContents = 1,
cvsOptionCompareChecksum = 2,
cvsOptionCompareTimestamp = 3
}
enum CvsCommand {
cvsCommandUpdate = 0,
cvsCommandCheckout = 1,
cvsCommandCheckin = 2,
cvsCommandUncheckout = 3,
cvsCommandAdd = 4,
cvsCommandRemove = 5,
cvsCommandDiff = 6,
cvsCommandHistory = 7,
cvsCommandRename = 8,
cvsCommandProperties = 9,
cvsCommandOptions = 10
}

Functions

void __RPC_FAR *__RPC_USER | MIDL_user_allocate (size_t)
void __RPC_USER | MIDL_user_free (void __RPC_FAR *)
virtual HRESULT STDMETHODCALLTYPE | GetErrorMessage (int handle, int iError, int cbErrorBuffer, unsigned char __RPC_FAR *sErrorBuffer)=0
virtual HRESULT STDMETHODCALLTYPE | OpenProject (int __RPC_FAR *pHandle, const unsigned char __RPC_FAR *sUsername, const unsigned char __RPC_FAR *sProjectName, const unsigned char __RPC_FAR *sProjectHome)=0
virtual HRESULT STDMETHODCALLTYPE | GetProject (int __RPC_FAR *pHandle, const unsigned char __RPC_FAR *sUsername, int cbProjectNameBuffer, unsigned char __RPC_FAR *sProjectName, int cbProjectHomeBuffer, unsigned char __RPC_FAR *sProjectHome, BOOL bAllowPathChange, BOOL bAllowNewProject, BOOL __RPC_FAR *pbNewProject)=0
virtual HRESULT STDMETHODCALLTYPE | UpdateFiles (int handle, const unsigned char __RPC_FAR *sFilenames, BOOL bDirectories, BOOL bRecurse)=0
virtual HRESULT STDMETHODCALLTYPE | CheckoutFiles (int handle, const unsigned char __RPC_FAR *sFilenames)=0
virtual HRESULT STDMETHODCALLTYPE | CheckinFiles (int handle, const unsigned char __RPC_FAR *sFilenames, BOOL bKeepCheckedOut)=0
virtual HRESULT STDMETHODCALLTYPE | UncheckoutFiles (int handle, const unsigned char __RPC_FAR *sFilenames)=0
virtual HRESULT STDMETHODCALLTYPE | AddFiles (int handle, const unsigned char __RPC_FAR *sOptionsAndFilenames, const unsigned char __RPC_FAR *sComment)=0
virtual HRESULT STDMETHODCALLTYPE | RemoveFiles (int handle, const unsigned char __RPC_FAR *sFilenames)=0
virtual HRESULT STDMETHODCALLTYPE | RenameFile (int handle, const unsigned char __RPC_FAR *sOldFilename, const unsigned char __RPC_FAR *sNewFilename)=0
virtual HRESULT STDMETHODCALLTYPE | DiffFile (int handle, const unsigned char __RPC_FAR *sFilename, BOOL bIgnoreCase, BOOL bIgnoreBlanks)=0
virtual HRESULT STDMETHODCALLTYPE | ShowFileHistory (int handle, const unsigned char __RPC_FAR *sFilenames)=0
virtual HRESULT STDMETHODCALLTYPE | ShowFileProperties (int handle, const unsigned char __RPC_FAR *sFilename)=0
virtual HRESULT STDMETHODCALLTYPE | ShowUserInterface (int handle, const unsigned char __RPC_FAR *sFilenames)=0
virtual HRESULT STDMETHODCALLTYPE | HasAdvancedOptionsForCommand (int handle, CvsCommand command, BOOL __RPC_FAR *pbAdvancedOptions)=0
virtual HRESULT STDMETHODCALLTYPE | ShowAdvancedOptionsForCommand (int handle, CvsCommand command)=0
virtual HRESULT STDMETHODCALLTYPE | GetFileChanges (int handle, int cbFilenameBuffer, unsigned char __RPC_FAR *sFilenameBuffer)=0
virtual HRESULT STDMETHODCALLTYPE | GetFilesToAdd (int handle, int cbFilenamesBuffer, unsigned char __RPC_FAR *sFilenamesBuffer)=0
virtual HRESULT STDMETHODCALLTYPE | CloseProject (int handle)=0
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetLastError_Proxy (ICvsCoworker __RPC_FAR *This, int handle, int __RPC_FAR *piError)
void __RPC_STUB | ICvsCoworker_GetLastError_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetErrorMessage_Proxy (ICvsCoworker __RPC_FAR *This, int handle, int iError, int cbErrorBuffer, unsigned char __RPC_FAR *sErrorBuffer)
void __RPC_STUB | ICvsCoworker_GetErrorMessage_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_OpenProject_Proxy (ICvsCoworker __RPC_FAR *This, int __RPC_FAR *pHandle, const unsigned char __RPC_FAR *sUsername, const unsigned char __RPC_FAR *sProjectName, const unsigned char __RPC_FAR *sProjectHome)
void __RPC_STUB | ICvsCoworker_OpenProject_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetProject_Proxy (ICvsCoworker __RPC_FAR *This, int __RPC_FAR *pHandle, const unsigned char __RPC_FAR *sUsername, int cbProjectNameBuffer, unsigned char __RPC_FAR *sProjectName, int cbProjectHomeBuffer, unsigned char __RPC_FAR *sProjectHome, BOOL bAllowPathChange, BOOL bAllowNewProject, BOOL __RPC_FAR *pbNewProject)
void __RPC_STUB | ICvsCoworker_GetProject_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_UpdateFiles_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames, BOOL bDirectories, BOOL bRecurse)
void __RPC_STUB | ICvsCoworker_UpdateFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_CheckoutFiles_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames)
void __RPC_STUB | ICvsCoworker_CheckoutFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_CheckinFiles_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames, BOOL bKeepCheckedOut)
void __RPC_STUB | ICvsCoworker_CheckinFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_UncheckoutFiles_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames)
void __RPC_STUB | ICvsCoworker_UncheckoutFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_AddFiles_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sOptionsAndFilenames, const unsigned char __RPC_FAR *sComment)
void __RPC_STUB | ICvsCoworker_AddFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_RemoveFiles_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames)
void __RPC_STUB | ICvsCoworker_RemoveFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_RenameFile_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sOldFilename, const unsigned char __RPC_FAR *sNewFilename)
void __RPC_STUB | ICvsCoworker_RenameFile_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_DiffFile_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilename, BOOL bIgnoreCase, BOOL bIgnoreBlanks)
void __RPC_STUB | ICvsCoworker_DiffFile_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowFileHistory_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames)
void __RPC_STUB | ICvsCoworker_ShowFileHistory_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowFileProperties_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilename)
void __RPC_STUB | ICvsCoworker_ShowFileProperties_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowUserInterface_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames)
void __RPC_STUB | ICvsCoworker_ShowUserInterface_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_HasAdvancedOptionsForCommand_Proxy (ICvsCoworker __RPC_FAR *This, int handle, CvsCommand command, BOOL __RPC_FAR *pbAdvancedOptions)
void __RPC_STUB | ICvsCoworker_HasAdvancedOptionsForCommand_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy (ICvsCoworker __RPC_FAR *This, int handle, CvsCommand command)
void __RPC_STUB | ICvsCoworker_ShowAdvancedOptionsForCommand_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetFileChanges_Proxy (ICvsCoworker __RPC_FAR *This, int handle, int cbFilenameBuffer, unsigned char __RPC_FAR *sFilenameBuffer)
void __RPC_STUB | ICvsCoworker_GetFileChanges_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetFilesToAdd_Proxy (ICvsCoworker __RPC_FAR *This, int handle, int cbFilenamesBuffer, unsigned char __RPC_FAR *sFilenamesBuffer)
void __RPC_STUB | ICvsCoworker_GetFilesToAdd_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_CloseProject_Proxy (ICvsCoworker __RPC_FAR *This, int handle)
void __RPC_STUB | ICvsCoworker_CloseProject_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
class | DECLSPEC_UUID ("10E5359D-F454-11D2-B442-0080C6F9179D") CvsCoworker

Variables

RPC_IF_HANDLE | __MIDL_itf_cvs_coworker_0000_v0_0_c_ifspec
RPC_IF_HANDLE | __MIDL_itf_cvs_coworker_0000_v0_0_s_ifspec
EXTERN_C const IID | IID_ICvsCoworker
ICvsCoworker __pad0__
ICvsCoworker int __RPC_FAR * | piError = 0
EXTERN_C const IID | LIBID_CVS_COWORKERLib
EXTERN_C const CLSID | CLSID_CvsCoworker

Define Documentation

#define __REQUIRED_RPCNDR_H_VERSION__ 440

Definition at line 16 of file cvs_coworker.h.

Typedef Documentation

typedef enum CvsCommand CvsCommand

Referenced by ICvsCoworker_GetErrorMessage_Proxy, ICvsCoworker_GetErrorMessage_Stub, ICvsCoworker_GetProject_Proxy, and ICvsCoworker_GetProject_Stub.

typedef class CvsCoworker CvsCoworker

Definition at line 50 of file cvs_coworker.h.

typedef enum CvsOption CvsOption

typedef interface ICvsCoworker ICvsCoworker

Definition at line 42 of file cvs_coworker.h.

Referenced by ICvsCoworker_GetErrorMessage_Stub, ICvsCoworker_GetProject_Proxy, ICvsCoworker_GetProject_Stub, ICvsCoworker_OpenProject_Proxy, and ICvsCoworker_OpenProject_Stub.

Enumeration Type Documentation

enum CvsCommand

Enumeration values:
cvsCommandUpdate
cvsCommandCheckout
cvsCommandCheckin
cvsCommandUncheckout
cvsCommandAdd
cvsCommandRemove
cvsCommandDiff
cvsCommandHistory
cvsCommandRename
cvsCommandProperties
cvsCommandOptions

Definition at line 76 of file cvs_coworker.h.

00077     {   cvsCommandUpdate    = 0,
00078     cvsCommandCheckout  = 1,
00079     cvsCommandCheckin   = 2,
00080     cvsCommandUncheckout    = 3,
00081     cvsCommandAdd   = 4,
00082     cvsCommandRemove    = 5,
00083     cvsCommandDiff  = 6,
00084     cvsCommandHistory   = 7,
00085     cvsCommandRename    = 8,
00086     cvsCommandProperties    = 9,
00087     cvsCommandOptions   = 10
00088     }   CvsCommand;

enum CvsOption

Enumeration values:
cvsOptionCompareContents
cvsOptionCompareChecksum
cvsOptionCompareTimestamp

Definition at line 69 of file cvs_coworker.h.

00070     {   cvsOptionCompareContents    = 1,
00071     cvsOptionCompareChecksum    = 2,
00072     cvsOptionCompareTimestamp   = 3
00073     }   CvsOption;

Function Documentation

virtual HRESULT STDMETHODCALLTYPE AddFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sOptionsAndFilenames,
 |  | const unsigned char __RPC_FAR * | sComment
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE CheckinFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames,
 |  | BOOL | bKeepCheckedOut
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE CheckoutFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE CloseProject ( int handle ) [pure virtual]

Referenced by ICvsCoworker_OpenProject_Proxy.

class DECLSPEC_UUID ( "10E5359D-F454-11D2-B442-0080C6F9179D" )

virtual HRESULT STDMETHODCALLTYPE DiffFile | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilename,
 |  | BOOL | bIgnoreCase,
 |  | BOOL | bIgnoreBlanks
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE GetErrorMessage | ( | int | handle,
 |  | int | iError,
 |  | int | cbErrorBuffer,
 |  | unsigned char __RPC_FAR * | sErrorBuffer
 | ) | [pure virtual]

virtual HRESULT STDMETHODCALLTYPE GetFileChanges | ( | int | handle,
 |  | int | cbFilenameBuffer,
 |  | unsigned char __RPC_FAR * | sFilenameBuffer
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE GetFilesToAdd | ( | int | handle,
 |  | int | cbFilenamesBuffer,
 |  | unsigned char __RPC_FAR * | sFilenamesBuffer
 | ) | [pure virtual]

Referenced by ICvsCoworker_OpenProject_Proxy.

virtual HRESULT STDMETHODCALLTYPE GetProject | ( | int __RPC_FAR * | pHandle,
 |  | const unsigned char __RPC_FAR * | sUsername,
 |  | int | cbProjectNameBuffer,
 |  | unsigned char __RPC_FAR * | sProjectName,
 |  | int | cbProjectHomeBuffer,
 |  | unsigned char __RPC_FAR * | sProjectHome,
 |  | BOOL | bAllowPathChange,
 |  | BOOL | bAllowNewProject,
 |  | BOOL __RPC_FAR * | pbNewProject
 | ) | [pure virtual]

virtual HRESULT STDMETHODCALLTYPE HasAdvancedOptionsForCommand | ( | int | handle,
 |  | CvsCommand | command,
 |  | BOOL __RPC_FAR * | pbAdvancedOptions
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

HRESULT STDMETHODCALLTYPE ICvsCoworker_AddFiles_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sOptionsAndFilenames,
 |  | const unsigned char __RPC_FAR * | sComment
 | ) |

Definition at line 1306 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

01311 {
01312
01313     HRESULT _RetVal;
01314
01315     RPC_MESSAGE _RpcMessage;
01316
01317     MIDL_STUB_MESSAGE _StubMsg;
01318
01319     RpcTryExcept
01320         {
01321         NdrProxyInitialize(
01322                       ( void __RPC_FAR *  )This,
01323                       ( PRPC_MESSAGE  )&_RpcMessage,
01324                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01325                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01326                       11);
01327
01328
01329
01330         if(!sOptionsAndFilenames)
01331             {
01332             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01333             }
01334         if(!sComment)
01335             {
01336             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01337             }
01338         RpcTryFinally
01339             {
01340
01341             _StubMsg.BufferLength = 4U + 12U + 13U;
01342             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01343                                            (unsigned char __RPC_FAR *)sOptionsAndFilenames,
01344                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01345
01346             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01347                                            (unsigned char __RPC_FAR *)sComment,
01348                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01349
01350             NdrProxyGetBuffer(This, &_StubMsg);
01351             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01352
01353             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01354                                          (unsigned char __RPC_FAR *)sOptionsAndFilenames,
01355                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01356
01357             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01358                                          (unsigned char __RPC_FAR *)sComment,
01359                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01360
01361             NdrProxySendReceive(This, &_StubMsg);
01362
01363             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01364                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01365
01366             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01367
01368             }
01369         RpcFinally
01370             {
01371             NdrProxyFreeBuffer(This, &_StubMsg);
01372
01373             }
01374         RpcEndFinally
01375
01376         }
01377     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01378         {
01379         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01380         }
01381     RpcEndExcept
01382     return _RetVal;
01383 }

void __RPC_STUB ICvsCoworker_AddFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1385 of file CVS_Coworker_p.c.

01390 {
01391     HRESULT _RetVal;
01392     MIDL_STUB_MESSAGE _StubMsg;
01393     int handle;
01394     const unsigned char __RPC_FAR *sComment;
01395     const unsigned char __RPC_FAR *sOptionsAndFilenames;
01396
01397 NdrStubInitialize(
01398                      _pRpcMessage,
01399                      &_StubMsg,
01400                      &Object_StubDesc,
01401                      _pRpcChannelBuffer);
01402     ( unsigned char __RPC_FAR * )sOptionsAndFilenames = 0;
01403     ( unsigned char __RPC_FAR * )sComment = 0;
01404     RpcTryFinally
01405         {
01406         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01407             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01408
01409         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01410
01411         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01412                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sOptionsAndFilenames,
01413                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01414                                        (unsigned char)0 );
01415
01416         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01417                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sComment,
01418                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01419                                        (unsigned char)0 );
01420
01421
01422         *_pdwStubPhase = STUB_CALL_SERVER;
01423         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> AddFiles(
01424             (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01425             handle,
01426             sOptionsAndFilenames,
01427             sComment);
01428
01429         *_pdwStubPhase = STUB_MARSHAL;
01430
01431         _StubMsg.BufferLength = 4U;
01432         _StubMsg.BufferLength += 16;
01433
01434         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01435         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01436
01437         }
01438     RpcFinally
01439         {
01440         }
01441     RpcEndFinally
01442     _pRpcMessage->BufferLength =
01443         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01444
01445 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckinFiles_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames,
 |  | BOOL | bKeepCheckedOut
 | ) |

Definition at line 1055 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

01060 {
01061
01062     HRESULT _RetVal;
01063
01064     RPC_MESSAGE _RpcMessage;
01065
01066     MIDL_STUB_MESSAGE _StubMsg;
01067
01068     RpcTryExcept
01069         {
01070         NdrProxyInitialize(
01071                       ( void __RPC_FAR *  )This,
01072                       ( PRPC_MESSAGE  )&_RpcMessage,
01073                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01074                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01075                       9);
01076
01077
01078
01079         if(!sFilenames)
01080             {
01081             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01082             }
01083         RpcTryFinally
01084             {
01085
01086             _StubMsg.BufferLength = 4U + 12U + 11U;
01087             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01088                                            (unsigned char __RPC_FAR *)sFilenames,
01089                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01090
01091             NdrProxyGetBuffer(This, &_StubMsg);
01092             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01093
01094             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01095                                          (unsigned char __RPC_FAR *)sFilenames,
01096                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01097
01098             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01099             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bKeepCheckedOut;
01100
01101             NdrProxySendReceive(This, &_StubMsg);
01102
01103             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01104                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] );
01105
01106             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01107
01108             }
01109         RpcFinally
01110             {
01111             NdrProxyFreeBuffer(This, &_StubMsg);
01112
01113             }
01114         RpcEndFinally
01115
01116         }
01117     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01118         {
01119         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01120         }
01121     RpcEndExcept
01122     return _RetVal;
01123 }

void __RPC_STUB ICvsCoworker_CheckinFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1125 of file CVS_Coworker_p.c.

01130 {
01131     HRESULT _RetVal;
01132     MIDL_STUB_MESSAGE _StubMsg;
01133     BOOL bKeepCheckedOut;
01134     int handle;
01135     const unsigned char __RPC_FAR *sFilenames;
01136
01137 NdrStubInitialize(
01138                      _pRpcMessage,
01139                      &_StubMsg,
01140                      &Object_StubDesc,
01141                      _pRpcChannelBuffer);
01142     ( unsigned char __RPC_FAR * )sFilenames = 0;
01143     RpcTryFinally
01144         {
01145         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01146             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] );
01147
01148         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01149
01150         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01151                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01152                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01153                                        (unsigned char)0 );
01154
01155         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01156         bKeepCheckedOut = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
01157
01158
01159         *_pdwStubPhase = STUB_CALL_SERVER;
01160         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CheckinFiles(
01161                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01162                 handle,
01163                 sFilenames,
01164                 bKeepCheckedOut);
01165
01166         *_pdwStubPhase = STUB_MARSHAL;
01167
01168         _StubMsg.BufferLength = 4U;
01169         _StubMsg.BufferLength += 16;
01170
01171         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01172         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01173
01174         }
01175     RpcFinally
01176         {
01177         }
01178     RpcEndFinally
01179     _pRpcMessage->BufferLength =
01180         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01181
01182 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckoutFiles_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) |

Definition at line 934 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

00938 {
00939
00940     HRESULT _RetVal;
00941
00942     RPC_MESSAGE _RpcMessage;
00943
00944     MIDL_STUB_MESSAGE _StubMsg;
00945
00946     RpcTryExcept
00947         {
00948         NdrProxyInitialize(
00949                       ( void __RPC_FAR *  )This,
00950                       ( PRPC_MESSAGE  )&_RpcMessage,
00951                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00952                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00953                       8);
00954
00955
00956
00957         if(!sFilenames)
00958             {
00959             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00960             }
00961         RpcTryFinally
00962             {
00963
00964             _StubMsg.BufferLength = 4U + 12U;
00965             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00966                                            (unsigned char __RPC_FAR *)sFilenames,
00967                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00968
00969             NdrProxyGetBuffer(This, &_StubMsg);
00970             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
00971
00972             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00973                                          (unsigned char __RPC_FAR *)sFilenames,
00974                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00975
00976             NdrProxySendReceive(This, &_StubMsg);
00977
00978             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00979                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
00980
00981             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00982
00983             }
00984         RpcFinally
00985             {
00986             NdrProxyFreeBuffer(This, &_StubMsg);
00987
00988             }
00989         RpcEndFinally
00990
00991         }
00992     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00993         {
00994         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00995         }
00996     RpcEndExcept
00997     return _RetVal;
00998 }

void __RPC_STUB ICvsCoworker_CheckoutFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1000 of file CVS_Coworker_p.c.

01005 {
01006     HRESULT _RetVal;
01007     MIDL_STUB_MESSAGE _StubMsg;
01008     int handle;
01009     const unsigned char __RPC_FAR *sFilenames;
01010
01011 NdrStubInitialize(
01012                      _pRpcMessage,
01013                      &_StubMsg,
01014                      &Object_StubDesc,
01015                      _pRpcChannelBuffer);
01016     ( unsigned char __RPC_FAR * )sFilenames = 0;
01017     RpcTryFinally
01018         {
01019         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01020             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01021
01022         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01023
01024         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01025                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01026                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01027                                        (unsigned char)0 );
01028
01029
01030         *_pdwStubPhase = STUB_CALL_SERVER;
01031         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CheckoutFiles(
01032                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01033                  handle,
01034                  sFilenames);
01035
01036         *_pdwStubPhase = STUB_MARSHAL;
01037
01038         _StubMsg.BufferLength = 4U;
01039         _StubMsg.BufferLength += 16;
01040
01041         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01042         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01043
01044         }
01045     RpcFinally
01046         {
01047         }
01048     RpcEndFinally
01049     _pRpcMessage->BufferLength =
01050         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01051
01052 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_CloseProject_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle
 | ) |

Definition at line 2749 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

02752 {
02753
02754     HRESULT _RetVal;
02755
02756     RPC_MESSAGE _RpcMessage;
02757
02758     MIDL_STUB_MESSAGE _StubMsg;
02759
02760     RpcTryExcept
02761         {
02762         NdrProxyInitialize(
02763                       ( void __RPC_FAR *  )This,
02764                       ( PRPC_MESSAGE  )&_RpcMessage,
02765                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02766                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02767                       22);
02768
02769
02770
02771         RpcTryFinally
02772             {
02773
02774             _StubMsg.BufferLength = 4U;
02775             NdrProxyGetBuffer(This, &_StubMsg);
02776             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02777
02778             NdrProxySendReceive(This, &_StubMsg);
02779
02780             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02781                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[146] );
02782
02783             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02784
02785             }
02786         RpcFinally
02787             {
02788             NdrProxyFreeBuffer(This, &_StubMsg);
02789
02790             }
02791         RpcEndFinally
02792
02793         }
02794     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02795         {
02796         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02797         }
02798     RpcEndExcept
02799     return _RetVal;
02800 }

void __RPC_STUB ICvsCoworker_CloseProject_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2802 of file CVS_Coworker_p.c.

02807 {
02808     HRESULT _RetVal;
02809     MIDL_STUB_MESSAGE _StubMsg;
02810     int handle;
02811
02812 NdrStubInitialize(
02813                      _pRpcMessage,
02814                      &_StubMsg,
02815                      &Object_StubDesc,
02816                      _pRpcChannelBuffer);
02817     RpcTryFinally
02818         {
02819         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02820             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[146] );
02821
02822         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02823
02824
02825         *_pdwStubPhase = STUB_CALL_SERVER;
02826         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CloseProject((ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,handle);
02827
02828         *_pdwStubPhase = STUB_MARSHAL;
02829
02830         _StubMsg.BufferLength = 4U;
02831         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02832         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02833
02834         }
02835     RpcFinally
02836         {
02837         }
02838     RpcEndFinally
02839     _pRpcMessage->BufferLength =
02840         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02841
02842 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_DiffFile_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilename,
 |  | BOOL | bIgnoreCase,
 |  | BOOL | bIgnoreBlanks
 | ) |

Definition at line 1711 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

01717 {
01718
01719     HRESULT _RetVal;
01720
01721     RPC_MESSAGE _RpcMessage;
01722
01723     MIDL_STUB_MESSAGE _StubMsg;
01724
01725     RpcTryExcept
01726         {
01727         NdrProxyInitialize(
01728                       ( void __RPC_FAR *  )This,
01729                       ( PRPC_MESSAGE  )&_RpcMessage,
01730                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01731                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01732                       14);
01733
01734
01735
01736         if(!sFilename)
01737             {
01738             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01739             }
01740         RpcTryFinally
01741             {
01742
01743             _StubMsg.BufferLength = 4U + 12U + 11U + 7U;
01744             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01745                                            (unsigned char __RPC_FAR *)sFilename,
01746                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01747
01748             NdrProxyGetBuffer(This, &_StubMsg);
01749             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01750
01751             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01752                                          (unsigned char __RPC_FAR *)sFilename,
01753                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01754
01755             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01756             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bIgnoreCase;
01757
01758             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bIgnoreBlanks;
01759
01760             NdrProxySendReceive(This, &_StubMsg);
01761
01762             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01763                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
01764
01765             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01766
01767             }
01768         RpcFinally
01769             {
01770             NdrProxyFreeBuffer(This, &_StubMsg);
01771
01772             }
01773         RpcEndFinally
01774
01775         }
01776     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01777         {
01778         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01779         }
01780     RpcEndExcept
01781     return _RetVal;
01782 }

void __RPC_STUB ICvsCoworker_DiffFile_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1784 of file CVS_Coworker_p.c.

01789 {
01790     HRESULT _RetVal;
01791     MIDL_STUB_MESSAGE _StubMsg;
01792     BOOL bIgnoreBlanks;
01793     BOOL bIgnoreCase;
01794     int handle;
01795     const unsigned char __RPC_FAR *sFilename;
01796
01797 NdrStubInitialize(
01798                      _pRpcMessage,
01799                      &_StubMsg,
01800                      &Object_StubDesc,
01801                      _pRpcChannelBuffer);
01802     ( unsigned char __RPC_FAR * )sFilename = 0;
01803     RpcTryFinally
01804         {
01805         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01806             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
01807
01808         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01809
01810         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01811                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilename,
01812                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01813                                        (unsigned char)0 );
01814
01815         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01816         bIgnoreCase = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
01817
01818         bIgnoreBlanks = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
01819
01820
01821         *_pdwStubPhase = STUB_CALL_SERVER;
01822         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> DiffFile(
01823             (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01824             handle,
01825             sFilename,
01826             bIgnoreCase,
01827             bIgnoreBlanks);
01828
01829         *_pdwStubPhase = STUB_MARSHAL;
01830
01831         _StubMsg.BufferLength = 4U;
01832         _StubMsg.BufferLength += 16;
01833
01834         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01835         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01836
01837         }
01838     RpcFinally
01839         {
01840         }
01841     RpcEndFinally
01842     _pRpcMessage->BufferLength =
01843         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01844
01845 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetErrorMessage_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | int | iError,
 |  | int | cbErrorBuffer,
 |  | unsigned char __RPC_FAR * | sErrorBuffer
 | ) |

Definition at line 181 of file CVS_Coworker_p.c.

References CvsCommand.

Referenced by CINTERFACE_PROXY_VTABLE.

00187 {
00188
00189     HRESULT _RetVal;
00190
00191     RPC_MESSAGE _RpcMessage;
00192
00193     MIDL_STUB_MESSAGE _StubMsg;
00194
00195     RpcTryExcept
00196         {
00197         NdrProxyInitialize(
00198                       ( void __RPC_FAR *  )This,
00199                       ( PRPC_MESSAGE  )&_RpcMessage,
00200                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00201                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00202                       4);
00203
00204
00205
00206         if(!sErrorBuffer)
00207             {
00208             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00209             }
00210         RpcTryFinally
00211             {
00212
00213             _StubMsg.BufferLength = 4U + 4U + 4U;
00214             NdrProxyGetBuffer(This, &_StubMsg);
00215             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
00216
00217             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = iError;
00218
00219             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbErrorBuffer;
00220
00221             NdrProxySendReceive(This, &_StubMsg);
00222
00223             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00224                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] );
00225
00226             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00227                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sErrorBuffer,
00228                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10],
00229                                            (unsigned char)0 );
00230
00231             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00232             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00233
00234             }
00235         RpcFinally
00236             {
00237             NdrProxyFreeBuffer(This, &_StubMsg);
00238
00239             }
00240         RpcEndFinally
00241
00242         }
00243     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00244         {
00245         _StubMsg.MaxCount = cbErrorBuffer;
00246
00247         NdrClearOutParameters(
00248                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00249                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[6],
00250                          ( void __RPC_FAR * )sErrorBuffer);
00251         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00252         }
00253     RpcEndExcept
00254     return _RetVal;
00255 }

void __RPC_STUB ICvsCoworker_GetErrorMessage_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 257 of file CVS_Coworker_p.c.

References AddFiles, CheckinFiles, CheckoutFiles, CvsCommand, DiffFile, GetFileChanges, HasAdvancedOptionsForCommand, ICvsCoworker, RemoveFiles, RenameFile, ShowAdvancedOptionsForCommand, ShowFileHistory, ShowFileProperties, ShowUserInterface, UncheckoutFiles, and UpdateFiles.

00262 {
00263     HRESULT _RetVal;
00264     MIDL_STUB_MESSAGE _StubMsg;
00265     int cbErrorBuffer;
00266     int handle;
00267     int iError;
00268     unsigned char __RPC_FAR *sErrorBuffer;
00269
00270 NdrStubInitialize(
00271                      _pRpcMessage,
00272                      &_StubMsg,
00273                      &Object_StubDesc,
00274                      _pRpcChannelBuffer);
00275     ( unsigned char __RPC_FAR * )sErrorBuffer = 0;
00276     RpcTryFinally
00277         {
00278         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00279             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] );
00280
00281         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00282
00283         iError = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00284
00285         cbErrorBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00286
00287         if(cbErrorBuffer * 1 < 0)
00288             {
00289             RpcRaiseException(RPC_X_INVALID_BOUND);
00290             }
00291         sErrorBuffer = NdrAllocate(&_StubMsg,cbErrorBuffer * 1);
00292
00293         *_pdwStubPhase = STUB_CALL_SERVER;
00294         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetErrorMessage(
00295                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00296                    handle,
00297                    iError,
00298                    cbErrorBuffer,
00299                    sErrorBuffer);
00300
00301         *_pdwStubPhase = STUB_MARSHAL;
00302
00303         _StubMsg.BufferLength = 12U + 11U;
00304         _StubMsg.MaxCount = cbErrorBuffer;
00305
00306         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00307                                        (unsigned char __RPC_FAR *)sErrorBuffer,
00308                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10] );
00309
00310         _StubMsg.BufferLength += 16;
00311
00312         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00313         _StubMsg.MaxCount = cbErrorBuffer;
00314
00315         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00316                                      (unsigned char __RPC_FAR *)sErrorBuffer,
00317                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10] );
00318
00319         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00320         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00321
00322         }
00323     RpcFinally
00324         {
00325         _StubMsg.MaxCount = cbErrorBuffer;
00326
00327         NdrPointerFree( &_StubMsg,
00328                         (unsigned char __RPC_FAR *)sErrorBuffer,
00329                         &__MIDL_TypeFormatString.Format[6] );
00330
00331         }
00332     RpcEndFinally
00333     _pRpcMessage->BufferLength =
00334         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00335
00336 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFileChanges_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | int | cbFilenameBuffer,
 |  | unsigned char __RPC_FAR * | sFilenameBuffer
 | ) |

Definition at line 2447 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

02452 {
02453
02454     HRESULT _RetVal;
02455
02456     RPC_MESSAGE _RpcMessage;
02457
02458     MIDL_STUB_MESSAGE _StubMsg;
02459
02460     RpcTryExcept
02461         {
02462         NdrProxyInitialize(
02463                       ( void __RPC_FAR *  )This,
02464                       ( PRPC_MESSAGE  )&_RpcMessage,
02465                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02466                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02467                       20);
02468
02469
02470
02471         if(!sFilenameBuffer)
02472             {
02473             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02474             }
02475         RpcTryFinally
02476             {
02477
02478             _StubMsg.BufferLength = 4U + 4U;
02479             NdrProxyGetBuffer(This, &_StubMsg);
02480             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02481
02482             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbFilenameBuffer;
02483
02484             NdrProxySendReceive(This, &_StubMsg);
02485
02486             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02487                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[126] );
02488
02489             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02490                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenameBuffer,
02491                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48],
02492                                            (unsigned char)0 );
02493
02494             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02495             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02496
02497             }
02498         RpcFinally
02499             {
02500             NdrProxyFreeBuffer(This, &_StubMsg);
02501
02502             }
02503         RpcEndFinally
02504
02505         }
02506     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02507         {
02508         _StubMsg.MaxCount = cbFilenameBuffer;
02509
02510         NdrClearOutParameters(
02511                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02512                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[44],
02513                          ( void __RPC_FAR * )sFilenameBuffer);
02514         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02515         }
02516     RpcEndExcept
02517     return _RetVal;
02518 }

void __RPC_STUB ICvsCoworker_GetFileChanges_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2520 of file CVS_Coworker_p.c.

02525 {
02526     HRESULT _RetVal;
02527     MIDL_STUB_MESSAGE _StubMsg;
02528     int cbFilenameBuffer;
02529     int handle;
02530     unsigned char __RPC_FAR *sFilenameBuffer;
02531
02532 NdrStubInitialize(
02533                      _pRpcMessage,
02534                      &_StubMsg,
02535                      &Object_StubDesc,
02536                      _pRpcChannelBuffer);
02537     ( unsigned char __RPC_FAR * )sFilenameBuffer = 0;
02538     RpcTryFinally
02539         {
02540         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02541             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[126] );
02542
02543         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02544
02545         cbFilenameBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02546
02547         if(cbFilenameBuffer * 1 < 0)
02548             {
02549             RpcRaiseException(RPC_X_INVALID_BOUND);
02550             }
02551         sFilenameBuffer = NdrAllocate(&_StubMsg,cbFilenameBuffer * 1);
02552
02553         *_pdwStubPhase = STUB_CALL_SERVER;
02554         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetFileChanges(
02555                   (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02556                   handle,
02557                   cbFilenameBuffer,
02558                   sFilenameBuffer);
02559
02560         *_pdwStubPhase = STUB_MARSHAL;
02561
02562         _StubMsg.BufferLength = 12U + 11U;
02563         _StubMsg.MaxCount = cbFilenameBuffer;
02564
02565         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02566                                        (unsigned char __RPC_FAR *)sFilenameBuffer,
02567                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48] );
02568
02569         _StubMsg.BufferLength += 16;
02570
02571         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02572         _StubMsg.MaxCount = cbFilenameBuffer;
02573
02574         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02575                                      (unsigned char __RPC_FAR *)sFilenameBuffer,
02576                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48] );
02577
02578         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02579         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02580
02581         }
02582     RpcFinally
02583         {
02584         _StubMsg.MaxCount = cbFilenameBuffer;
02585
02586         NdrPointerFree( &_StubMsg,
02587                         (unsigned char __RPC_FAR *)sFilenameBuffer,
02588                         &__MIDL_TypeFormatString.Format[44] );
02589
02590         }
02591     RpcEndFinally
02592     _pRpcMessage->BufferLength =
02593         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02594
02595 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFilesToAdd_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | int | cbFilenamesBuffer,
 |  | unsigned char __RPC_FAR * | sFilenamesBuffer
 | ) |

Definition at line 2598 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

02603 {
02604
02605     HRESULT _RetVal;
02606
02607     RPC_MESSAGE _RpcMessage;
02608
02609     MIDL_STUB_MESSAGE _StubMsg;
02610
02611     RpcTryExcept
02612         {
02613         NdrProxyInitialize(
02614                       ( void __RPC_FAR *  )This,
02615                       ( PRPC_MESSAGE  )&_RpcMessage,
02616                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02617                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02618                       21);
02619
02620
02621
02622         if(!sFilenamesBuffer)
02623             {
02624             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02625             }
02626         RpcTryFinally
02627             {
02628
02629             _StubMsg.BufferLength = 4U + 4U;
02630             NdrProxyGetBuffer(This, &_StubMsg);
02631             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02632
02633             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbFilenamesBuffer;
02634
02635             NdrProxySendReceive(This, &_StubMsg);
02636
02637             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02638                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[136] );
02639
02640             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02641                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenamesBuffer,
02642                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58],
02643                                            (unsigned char)0 );
02644
02645             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02646             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02647
02648             }
02649         RpcFinally
02650             {
02651             NdrProxyFreeBuffer(This, &_StubMsg);
02652
02653             }
02654         RpcEndFinally
02655
02656         }
02657     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02658         {
02659         _StubMsg.MaxCount = cbFilenamesBuffer;
02660
02661         NdrClearOutParameters(
02662                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02663                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[54],
02664                          ( void __RPC_FAR * )sFilenamesBuffer);
02665         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02666         }
02667     RpcEndExcept
02668     return _RetVal;
02669 }

void __RPC_STUB ICvsCoworker_GetFilesToAdd_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2671 of file CVS_Coworker_p.c.

02676 {
02677     HRESULT _RetVal;
02678     MIDL_STUB_MESSAGE _StubMsg;
02679     int cbFilenamesBuffer;
02680     int handle;
02681     unsigned char __RPC_FAR *sFilenamesBuffer;
02682
02683 NdrStubInitialize(
02684                      _pRpcMessage,
02685                      &_StubMsg,
02686                      &Object_StubDesc,
02687                      _pRpcChannelBuffer);
02688     ( unsigned char __RPC_FAR * )sFilenamesBuffer = 0;
02689     RpcTryFinally
02690         {
02691         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02692             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[136] );
02693
02694         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02695
02696         cbFilenamesBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02697
02698         if(cbFilenamesBuffer * 1 < 0)
02699             {
02700             RpcRaiseException(RPC_X_INVALID_BOUND);
02701             }
02702         sFilenamesBuffer = NdrAllocate(&_StubMsg,cbFilenamesBuffer * 1);
02703
02704         *_pdwStubPhase = STUB_CALL_SERVER;
02705         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetFilesToAdd(
02706                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02707                  handle,
02708                  cbFilenamesBuffer,
02709                  sFilenamesBuffer);
02710
02711         *_pdwStubPhase = STUB_MARSHAL;
02712
02713         _StubMsg.BufferLength = 12U + 11U;
02714         _StubMsg.MaxCount = cbFilenamesBuffer;
02715
02716         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02717                                        (unsigned char __RPC_FAR *)sFilenamesBuffer,
02718                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58] );
02719
02720         _StubMsg.BufferLength += 16;
02721
02722         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02723         _StubMsg.MaxCount = cbFilenamesBuffer;
02724
02725         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02726                                      (unsigned char __RPC_FAR *)sFilenamesBuffer,
02727                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58] );
02728
02729         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02730         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02731
02732         }
02733     RpcFinally
02734         {
02735         _StubMsg.MaxCount = cbFilenamesBuffer;
02736
02737         NdrPointerFree( &_StubMsg,
02738                         (unsigned char __RPC_FAR *)sFilenamesBuffer,
02739                         &__MIDL_TypeFormatString.Format[54] );
02740
02741         }
02742     RpcEndFinally
02743     _pRpcMessage->BufferLength =
02744         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02745
02746 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetLastError_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | int __RPC_FAR * | piError
 | ) |

Definition at line 65 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

00069 {
00070
00071     HRESULT _RetVal;
00072
00073     RPC_MESSAGE _RpcMessage;
00074
00075     MIDL_STUB_MESSAGE _StubMsg;
00076
00077     RpcTryExcept
00078         {
00079         NdrProxyInitialize(
00080                       ( void __RPC_FAR *  )This,
00081                       ( PRPC_MESSAGE  )&_RpcMessage,
00082                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00083                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00084                       3);
00085
00086
00087
00088         if(!piError)
00089             {
00090             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00091             }
00092         RpcTryFinally
00093             {
00094
00095             _StubMsg.BufferLength = 4U;
00096             NdrProxyGetBuffer(This, &_StubMsg);
00097             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
00098
00099             NdrProxySendReceive(This, &_StubMsg);
00100
00101             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00102                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
00103
00104             *piError = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00105
00106             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00107
00108             }
00109         RpcFinally
00110             {
00111             NdrProxyFreeBuffer(This, &_StubMsg);
00112
00113             }
00114         RpcEndFinally
00115
00116         }
00117     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00118         {
00119         NdrClearOutParameters(
00120                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00121                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00122                          ( void __RPC_FAR * )piError);
00123         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00124         }
00125     RpcEndExcept
00126     return _RetVal;
00127 }

void __RPC_STUB ICvsCoworker_GetLastError_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 129 of file CVS_Coworker_p.c.

00134 {
00135     int _M0;
00136     HRESULT _RetVal;
00137     MIDL_STUB_MESSAGE _StubMsg;
00138     int handle;
00139     int __RPC_FAR *piError;
00140
00141 NdrStubInitialize(
00142                      _pRpcMessage,
00143                      &_StubMsg,
00144                      &Object_StubDesc,
00145                      _pRpcChannelBuffer);
00146     ( int __RPC_FAR * )piError = 0;
00147     RpcTryFinally
00148         {
00149         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00150             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
00151
00152         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00153
00154         piError = &_M0;
00155
00156         *_pdwStubPhase = STUB_CALL_SERVER;
00157         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetLastError(
00158                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00159                 handle,
00160                 piError);
00161
00162         *_pdwStubPhase = STUB_MARSHAL;
00163
00164         _StubMsg.BufferLength = 4U + 4U;
00165         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00166         *(( int __RPC_FAR * )_StubMsg.Buffer)++ = *piError;
00167
00168         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00169
00170         }
00171     RpcFinally
00172         {
00173         }
00174     RpcEndFinally
00175     _pRpcMessage->BufferLength =
00176         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00177
00178 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetProject_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int __RPC_FAR * | pHandle,
 |  | const unsigned char __RPC_FAR * | sUsername,
 |  | int | cbProjectNameBuffer,
 |  | unsigned char __RPC_FAR * | sProjectName,
 |  | int | cbProjectHomeBuffer,
 |  | unsigned char __RPC_FAR * | sProjectHome,
 |  | BOOL | bAllowPathChange,
 |  | BOOL | bAllowNewProject,
 |  | BOOL __RPC_FAR * | pbNewProject
 | ) |

Definition at line 511 of file CVS_Coworker_p.c.

References CvsCommand, and ICvsCoworker.

Referenced by CINTERFACE_PROXY_VTABLE.

00522 {
00523
00524     HRESULT _RetVal;
00525
00526     RPC_MESSAGE _RpcMessage;
00527
00528     MIDL_STUB_MESSAGE _StubMsg;
00529
00530     RpcTryExcept
00531         {
00532         NdrProxyInitialize(
00533                       ( void __RPC_FAR *  )This,
00534                       ( PRPC_MESSAGE  )&_RpcMessage,
00535                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00536                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00537                       6);
00538
00539
00540
00541         if(!pHandle)
00542             {
00543             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00544             }
00545         if(!sUsername)
00546             {
00547             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00548             }
00549         if(!sProjectName)
00550             {
00551             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00552             }
00553         if(!sProjectHome)
00554             {
00555             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00556             }
00557         if(!pbNewProject)
00558             {
00559             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00560             }
00561         RpcTryFinally
00562             {
00563
00564             _StubMsg.BufferLength = 1U + 7U + 12U + 11U + 13U + 11U + 7U;
00565             _StubMsg.MaxCount = cbProjectNameBuffer;
00566
00567             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00568                                            (unsigned char __RPC_FAR *)sProjectName,
00569                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00570
00571             _StubMsg.MaxCount = cbProjectHomeBuffer;
00572
00573             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00574                                            (unsigned char __RPC_FAR *)sProjectHome,
00575                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00576
00577             NdrProxyGetBuffer(This, &_StubMsg);
00578             *(( unsigned char __RPC_FAR * )_StubMsg.Buffer)++ = *sUsername;
00579
00580             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00581             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbProjectNameBuffer;
00582
00583             _StubMsg.MaxCount = cbProjectNameBuffer;
00584
00585             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00586                                          (unsigned char __RPC_FAR *)sProjectName,
00587                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00588
00589             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00590             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbProjectHomeBuffer;
00591
00592             _StubMsg.MaxCount = cbProjectHomeBuffer;
00593
00594             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00595                                          (unsigned char __RPC_FAR *)sProjectHome,
00596                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00597
00598             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00599             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bAllowPathChange;
00600
00601             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bAllowNewProject;
00602
00603             NdrProxySendReceive(This, &_StubMsg);
00604
00605             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00606                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[38] );
00607
00608             *pHandle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00609
00610             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00611                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectName,
00612                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28],
00613                                            (unsigned char)0 );
00614
00615             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00616                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectHome,
00617                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38],
00618                                            (unsigned char)0 );
00619
00620             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00621             *pbNewProject = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00622
00623             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00624
00625             }
00626         RpcFinally
00627             {
00628             NdrProxyFreeBuffer(This, &_StubMsg);
00629
00630             }
00631         RpcEndFinally
00632
00633         }
00634     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00635         {
00636         NdrClearOutParameters(
00637                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00638                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00639                          ( void __RPC_FAR * )pHandle);
00640         _StubMsg.MaxCount = cbProjectNameBuffer;
00641
00642         NdrClearOutParameters(
00643                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00644                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[24],
00645                          ( void __RPC_FAR * )sProjectName);
00646         _StubMsg.MaxCount = cbProjectHomeBuffer;
00647
00648         NdrClearOutParameters(
00649                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00650                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[34],
00651                          ( void __RPC_FAR * )sProjectHome);
00652         NdrClearOutParameters(
00653                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00654                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00655                          ( void __RPC_FAR * )pbNewProject);
00656         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00657         }
00658     RpcEndExcept
00659     return _RetVal;
00660 }

void __RPC_STUB ICvsCoworker_GetProject_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 662 of file CVS_Coworker_p.c.

References CvsCommand, and ICvsCoworker.

00667 {
00668     int _M14;
00669     BOOL _M15;
00670     HRESULT _RetVal;
00671     MIDL_STUB_MESSAGE _StubMsg;
00672     BOOL bAllowNewProject;
00673     BOOL bAllowPathChange;
00674     int cbProjectHomeBuffer;
00675     int cbProjectNameBuffer;
00676     int __RPC_FAR *pHandle;
00677     BOOL __RPC_FAR *pbNewProject;
00678     unsigned char __RPC_FAR *sProjectHome;
00679     unsigned char __RPC_FAR *sProjectName;
00680     const unsigned char __RPC_FAR *sUsername;
00681
00682 NdrStubInitialize(
00683                      _pRpcMessage,
00684                      &_StubMsg,
00685                      &Object_StubDesc,
00686                      _pRpcChannelBuffer);
00687     ( int __RPC_FAR * )pHandle = 0;
00688     ( unsigned char __RPC_FAR * )sUsername = 0;
00689     ( unsigned char __RPC_FAR * )sProjectName = 0;
00690     ( unsigned char __RPC_FAR * )sProjectHome = 0;
00691     ( BOOL __RPC_FAR * )pbNewProject = 0;
00692     RpcTryFinally
00693         {
00694         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00695             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[38] );
00696
00697         sUsername = ( unsigned char __RPC_FAR * )_StubMsg.Buffer;
00698         _StubMsg.Buffer += sizeof( unsigned char  );
00699
00700         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00701         cbProjectNameBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00702
00703         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00704                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectName,
00705                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28],
00706                                        (unsigned char)0 );
00707
00708         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00709         cbProjectHomeBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00710
00711         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00712                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectHome,
00713                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38],
00714                                        (unsigned char)0 );
00715
00716         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00717         bAllowPathChange = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00718
00719         bAllowNewProject = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00720
00721         pHandle = &_M14;
00722         pbNewProject = &_M15;
00723
00724         *_pdwStubPhase = STUB_CALL_SERVER;
00725         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetProject(
00726               (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00727               pHandle,
00728               sUsername,
00729               cbProjectNameBuffer,
00730               sProjectName,
00731               cbProjectHomeBuffer,
00732               sProjectHome,
00733               bAllowPathChange,
00734               bAllowNewProject,
00735               pbNewProject);
00736
00737         *_pdwStubPhase = STUB_MARSHAL;
00738
00739         _StubMsg.BufferLength = 4U + 12U + 13U + 11U + 7U;
00740         _StubMsg.MaxCount = cbProjectNameBuffer;
00741
00742         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00743                                        (unsigned char __RPC_FAR *)sProjectName,
00744                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00745
00746         _StubMsg.MaxCount = cbProjectHomeBuffer;
00747
00748         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00749                                        (unsigned char __RPC_FAR *)sProjectHome,
00750                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00751
00752         _StubMsg.BufferLength += 16;
00753
00754         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00755         *(( int __RPC_FAR * )_StubMsg.Buffer)++ = *pHandle;
00756
00757         _StubMsg.MaxCount = cbProjectNameBuffer;
00758
00759         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00760                                      (unsigned char __RPC_FAR *)sProjectName,
00761                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00762
00763         _StubMsg.MaxCount = cbProjectHomeBuffer;
00764
00765         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00766                                      (unsigned char __RPC_FAR *)sProjectHome,
00767                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00768
00769         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00770         *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = *pbNewProject;
00771
00772         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00773
00774         }
00775     RpcFinally
00776         {
00777         _StubMsg.MaxCount = cbProjectNameBuffer;
00778
00779         NdrPointerFree( &_StubMsg,
00780                         (unsigned char __RPC_FAR *)sProjectName,
00781                         &__MIDL_TypeFormatString.Format[24] );
00782
00783         _StubMsg.MaxCount = cbProjectHomeBuffer;
00784
00785         NdrPointerFree( &_StubMsg,
00786                         (unsigned char __RPC_FAR *)sProjectHome,
00787                         &__MIDL_TypeFormatString.Format[34] );
00788
00789         }
00790     RpcEndFinally
00791     _pRpcMessage->BufferLength =
00792         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00793
00794 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_HasAdvancedOptionsForCommand_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | CvsCommand | command,
 |  | BOOL __RPC_FAR * | pbAdvancedOptions
 | ) |

Definition at line 2211 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

02216 {
02217
02218     HRESULT _RetVal;
02219
02220     RPC_MESSAGE _RpcMessage;
02221
02222     MIDL_STUB_MESSAGE _StubMsg;
02223
02224     RpcTryExcept
02225         {
02226         NdrProxyInitialize(
02227                       ( void __RPC_FAR *  )This,
02228                       ( PRPC_MESSAGE  )&_RpcMessage,
02229                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02230                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02231                       18);
02232
02233
02234
02235         if(!pbAdvancedOptions)
02236             {
02237             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02238             }
02239         RpcTryFinally
02240             {
02241
02242             _StubMsg.BufferLength = 4U + 2U;
02243             NdrProxyGetBuffer(This, &_StubMsg);
02244             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02245
02246             NdrSimpleTypeMarshall(
02247                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02248                          ( unsigned char __RPC_FAR * )&command,
02249                          13);
02250             NdrProxySendReceive(This, &_StubMsg);
02251
02252             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02253                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[110] );
02254
02255             *pbAdvancedOptions = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
02256
02257             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02258
02259             }
02260         RpcFinally
02261             {
02262             NdrProxyFreeBuffer(This, &_StubMsg);
02263
02264             }
02265         RpcEndFinally
02266
02267         }
02268     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02269         {
02270         NdrClearOutParameters(
02271                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02272                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
02273                          ( void __RPC_FAR * )pbAdvancedOptions);
02274         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02275         }
02276     RpcEndExcept
02277     return _RetVal;
02278 }

void __RPC_STUB ICvsCoworker_HasAdvancedOptionsForCommand_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2280 of file CVS_Coworker_p.c.

02285 {
02286     BOOL _M42;
02287     HRESULT _RetVal;
02288     MIDL_STUB_MESSAGE _StubMsg;
02289     CvsCommand command;
02290     int handle;
02291     BOOL __RPC_FAR *pbAdvancedOptions;
02292
02293 NdrStubInitialize(
02294                      _pRpcMessage,
02295                      &_StubMsg,
02296                      &Object_StubDesc,
02297                      _pRpcChannelBuffer);
02298     ( BOOL __RPC_FAR * )pbAdvancedOptions = 0;
02299     RpcTryFinally
02300         {
02301         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02302             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[110] );
02303
02304         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02305
02306         NdrSimpleTypeUnmarshall(
02307                            ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02308                            ( unsigned char __RPC_FAR * )&command,
02309                            13);
02310         pbAdvancedOptions = &_M42;
02311
02312         *_pdwStubPhase = STUB_CALL_SERVER;
02313         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> HasAdvancedOptionsForCommand(
02314                                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02315                                 handle,
02316                                 command,
02317                                 pbAdvancedOptions);
02318
02319         *_pdwStubPhase = STUB_MARSHAL;
02320
02321         _StubMsg.BufferLength = 4U + 4U;
02322         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02323         *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = *pbAdvancedOptions;
02324
02325         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02326
02327         }
02328     RpcFinally
02329         {
02330         }
02331     RpcEndFinally
02332     _pRpcMessage->BufferLength =
02333         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02334
02335 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_OpenProject_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int __RPC_FAR * | pHandle,
 |  | const unsigned char __RPC_FAR * | sUsername,
 |  | const unsigned char __RPC_FAR * | sProjectName,
 |  | const unsigned char __RPC_FAR * | sProjectHome
 | ) |

Definition at line 339 of file CVS_Coworker_p.c.

References CloseProject, GetFilesToAdd, and ICvsCoworker.

Referenced by CINTERFACE_PROXY_VTABLE.

00345 {
00346
00347     HRESULT _RetVal;
00348
00349     RPC_MESSAGE _RpcMessage;
00350
00351     MIDL_STUB_MESSAGE _StubMsg;
00352
00353     RpcTryExcept
00354         {
00355         NdrProxyInitialize(
00356                       ( void __RPC_FAR *  )This,
00357                       ( PRPC_MESSAGE  )&_RpcMessage,
00358                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00359                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00360                       5);
00361
00362
00363
00364         if(!pHandle)
00365             {
00366             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00367             }
00368         if(!sUsername)
00369             {
00370             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00371             }
00372         if(!sProjectName)
00373             {
00374             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00375             }
00376         if(!sProjectHome)
00377             {
00378             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00379             }
00380         RpcTryFinally
00381             {
00382
00383             _StubMsg.BufferLength = 12U + 13U + 13U;
00384             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00385                                            (unsigned char __RPC_FAR *)sUsername,
00386                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00387
00388             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00389                                            (unsigned char __RPC_FAR *)sProjectName,
00390                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00391
00392             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00393                                            (unsigned char __RPC_FAR *)sProjectHome,
00394                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00395
00396             NdrProxyGetBuffer(This, &_StubMsg);
00397             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00398                                          (unsigned char __RPC_FAR *)sUsername,
00399                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00400
00401             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00402                                          (unsigned char __RPC_FAR *)sProjectName,
00403                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00404
00405             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00406                                          (unsigned char __RPC_FAR *)sProjectHome,
00407                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00408
00409             NdrProxySendReceive(This, &_StubMsg);
00410
00411             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00412                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[20] );
00413
00414             *pHandle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00415
00416             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00417
00418             }
00419         RpcFinally
00420             {
00421             NdrProxyFreeBuffer(This, &_StubMsg);
00422
00423             }
00424         RpcEndFinally
00425
00426         }
00427     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00428         {
00429         NdrClearOutParameters(
00430                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00431                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00432                          ( void __RPC_FAR * )pHandle);
00433         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00434         }
00435     RpcEndExcept
00436     return _RetVal;
00437 }

void __RPC_STUB ICvsCoworker_OpenProject_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 439 of file CVS_Coworker_p.c.

References ICvsCoworker, and piError.

00444 {
00445     int _M9;
00446     HRESULT _RetVal;
00447     MIDL_STUB_MESSAGE _StubMsg;
00448     int __RPC_FAR *pHandle;
00449     const unsigned char __RPC_FAR *sProjectHome;
00450     const unsigned char __RPC_FAR *sProjectName;
00451     const unsigned char __RPC_FAR *sUsername;
00452
00453 NdrStubInitialize(
00454                      _pRpcMessage,
00455                      &_StubMsg,
00456                      &Object_StubDesc,
00457                      _pRpcChannelBuffer);
00458     ( int __RPC_FAR * )pHandle = 0;
00459     ( unsigned char __RPC_FAR * )sUsername = 0;
00460     ( unsigned char __RPC_FAR * )sProjectName = 0;
00461     ( unsigned char __RPC_FAR * )sProjectHome = 0;
00462     RpcTryFinally
00463         {
00464         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00465             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[20] );
00466
00467         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00468                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sUsername,
00469                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00470                                        (unsigned char)0 );
00471
00472         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00473                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectName,
00474                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00475                                        (unsigned char)0 );
00476
00477         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00478                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectHome,
00479                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00480                                        (unsigned char)0 );
00481
00482         pHandle = &_M9;
00483
00484         *_pdwStubPhase = STUB_CALL_SERVER;
00485         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> OpenProject(
00486                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00487                pHandle,
00488                sUsername,
00489                sProjectName,
00490                sProjectHome);
00491
00492         *_pdwStubPhase = STUB_MARSHAL;
00493
00494         _StubMsg.BufferLength = 4U + 4U;
00495         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00496         *(( int __RPC_FAR * )_StubMsg.Buffer)++ = *pHandle;
00497
00498         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00499
00500         }
00501     RpcFinally
00502         {
00503         }
00504     RpcEndFinally
00505     _pRpcMessage->BufferLength =
00506         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00507
00508 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_RemoveFiles_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) |

Definition at line 1448 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

01452 {
01453
01454     HRESULT _RetVal;
01455
01456     RPC_MESSAGE _RpcMessage;
01457
01458     MIDL_STUB_MESSAGE _StubMsg;
01459
01460     RpcTryExcept
01461         {
01462         NdrProxyInitialize(
01463                       ( void __RPC_FAR *  )This,
01464                       ( PRPC_MESSAGE  )&_RpcMessage,
01465                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01466                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01467                       12);
01468
01469
01470
01471         if(!sFilenames)
01472             {
01473             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01474             }
01475         RpcTryFinally
01476             {
01477
01478             _StubMsg.BufferLength = 4U + 12U;
01479             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01480                                            (unsigned char __RPC_FAR *)sFilenames,
01481                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01482
01483             NdrProxyGetBuffer(This, &_StubMsg);
01484             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01485
01486             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01487                                          (unsigned char __RPC_FAR *)sFilenames,
01488                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01489
01490             NdrProxySendReceive(This, &_StubMsg);
01491
01492             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01493                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01494
01495             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01496
01497             }
01498         RpcFinally
01499             {
01500             NdrProxyFreeBuffer(This, &_StubMsg);
01501
01502             }
01503         RpcEndFinally
01504
01505         }
01506     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01507         {
01508         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01509         }
01510     RpcEndExcept
01511     return _RetVal;
01512 }

void __RPC_STUB ICvsCoworker_RemoveFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1514 of file CVS_Coworker_p.c.

01519 {
01520     HRESULT _RetVal;
01521     MIDL_STUB_MESSAGE _StubMsg;
01522     int handle;
01523     const unsigned char __RPC_FAR *sFilenames;
01524
01525 NdrStubInitialize(
01526                      _pRpcMessage,
01527                      &_StubMsg,
01528                      &Object_StubDesc,
01529                      _pRpcChannelBuffer);
01530     ( unsigned char __RPC_FAR * )sFilenames = 0;
01531     RpcTryFinally
01532         {
01533         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01534             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01535
01536         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01537
01538         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01539                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01540                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01541                                        (unsigned char)0 );
01542
01543
01544         *_pdwStubPhase = STUB_CALL_SERVER;
01545         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> RemoveFiles(
01546                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01547                handle,
01548                sFilenames);
01549
01550         *_pdwStubPhase = STUB_MARSHAL;
01551
01552         _StubMsg.BufferLength = 4U;
01553         _StubMsg.BufferLength += 16;
01554
01555         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01556         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01557
01558         }
01559     RpcFinally
01560         {
01561         }
01562     RpcEndFinally
01563     _pRpcMessage->BufferLength =
01564         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01565
01566 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_RenameFile_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sOldFilename,
 |  | const unsigned char __RPC_FAR * | sNewFilename
 | ) |

Definition at line 1569 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

01574 {
01575
01576     HRESULT _RetVal;
01577
01578     RPC_MESSAGE _RpcMessage;
01579
01580     MIDL_STUB_MESSAGE _StubMsg;
01581
01582     RpcTryExcept
01583         {
01584         NdrProxyInitialize(
01585                       ( void __RPC_FAR *  )This,
01586                       ( PRPC_MESSAGE  )&_RpcMessage,
01587                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01588                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01589                       13);
01590
01591
01592
01593         if(!sOldFilename)
01594             {
01595             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01596             }
01597         if(!sNewFilename)
01598             {
01599             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01600             }
01601         RpcTryFinally
01602             {
01603
01604             _StubMsg.BufferLength = 4U + 12U + 13U;
01605             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01606                                            (unsigned char __RPC_FAR *)sOldFilename,
01607                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01608
01609             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01610                                            (unsigned char __RPC_FAR *)sNewFilename,
01611                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01612
01613             NdrProxyGetBuffer(This, &_StubMsg);
01614             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01615
01616             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01617                                          (unsigned char __RPC_FAR *)sOldFilename,
01618                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01619
01620             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01621                                          (unsigned char __RPC_FAR *)sNewFilename,
01622                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01623
01624             NdrProxySendReceive(This, &_StubMsg);
01625
01626             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01627                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01628
01629             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01630
01631             }
01632         RpcFinally
01633             {
01634             NdrProxyFreeBuffer(This, &_StubMsg);
01635
01636             }
01637         RpcEndFinally
01638
01639         }
01640     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01641         {
01642         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01643         }
01644     RpcEndExcept
01645     return _RetVal;
01646 }

void __RPC_STUB ICvsCoworker_RenameFile_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1648 of file CVS_Coworker_p.c.

01653 {
01654     HRESULT _RetVal;
01655     MIDL_STUB_MESSAGE _StubMsg;
01656     int handle;
01657     const unsigned char __RPC_FAR *sNewFilename;
01658     const unsigned char __RPC_FAR *sOldFilename;
01659
01660 NdrStubInitialize(
01661                      _pRpcMessage,
01662                      &_StubMsg,
01663                      &Object_StubDesc,
01664                      _pRpcChannelBuffer);
01665     ( unsigned char __RPC_FAR * )sOldFilename = 0;
01666     ( unsigned char __RPC_FAR * )sNewFilename = 0;
01667     RpcTryFinally
01668         {
01669         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01670             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01671
01672         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01673
01674         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01675                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sOldFilename,
01676                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01677                                        (unsigned char)0 );
01678
01679         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01680                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sNewFilename,
01681                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01682                                        (unsigned char)0 );
01683
01684
01685         *_pdwStubPhase = STUB_CALL_SERVER;
01686         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> RenameFile(
01687               (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01688               handle,
01689               sOldFilename,
01690               sNewFilename);
01691
01692         *_pdwStubPhase = STUB_MARSHAL;
01693
01694         _StubMsg.BufferLength = 4U;
01695         _StubMsg.BufferLength += 16;
01696
01697         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01698         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01699
01700         }
01701     RpcFinally
01702         {
01703         }
01704     RpcEndFinally
01705     _pRpcMessage->BufferLength =
01706         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01707
01708 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | CvsCommand | command
 | ) |

Definition at line 2338 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

02342 {
02343
02344     HRESULT _RetVal;
02345
02346     RPC_MESSAGE _RpcMessage;
02347
02348     MIDL_STUB_MESSAGE _StubMsg;
02349
02350     RpcTryExcept
02351         {
02352         NdrProxyInitialize(
02353                       ( void __RPC_FAR *  )This,
02354                       ( PRPC_MESSAGE  )&_RpcMessage,
02355                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02356                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02357                       19);
02358
02359
02360
02361         RpcTryFinally
02362             {
02363
02364             _StubMsg.BufferLength = 4U + 2U;
02365             NdrProxyGetBuffer(This, &_StubMsg);
02366             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02367
02368             NdrSimpleTypeMarshall(
02369                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02370                          ( unsigned char __RPC_FAR * )&command,
02371                          13);
02372             NdrProxySendReceive(This, &_StubMsg);
02373
02374             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02375                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[120] );
02376
02377             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02378
02379             }
02380         RpcFinally
02381             {
02382             NdrProxyFreeBuffer(This, &_StubMsg);
02383
02384             }
02385         RpcEndFinally
02386
02387         }
02388     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02389         {
02390         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02391         }
02392     RpcEndExcept
02393     return _RetVal;
02394 }

void __RPC_STUB ICvsCoworker_ShowAdvancedOptionsForCommand_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2396 of file CVS_Coworker_p.c.

02401 {
02402     HRESULT _RetVal;
02403     MIDL_STUB_MESSAGE _StubMsg;
02404     CvsCommand command;
02405     int handle;
02406
02407 NdrStubInitialize(
02408                      _pRpcMessage,
02409                      &_StubMsg,
02410                      &Object_StubDesc,
02411                      _pRpcChannelBuffer);
02412     RpcTryFinally
02413         {
02414         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02415             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[120] );
02416
02417         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02418
02419         NdrSimpleTypeUnmarshall(
02420                            ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02421                            ( unsigned char __RPC_FAR * )&command,
02422                            13);
02423
02424         *_pdwStubPhase = STUB_CALL_SERVER;
02425         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowAdvancedOptionsForCommand(
02426                                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02427                                  handle,
02428                                  command);
02429
02430         *_pdwStubPhase = STUB_MARSHAL;
02431
02432         _StubMsg.BufferLength = 4U;
02433         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02434         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02435
02436         }
02437     RpcFinally
02438         {
02439         }
02440     RpcEndFinally
02441     _pRpcMessage->BufferLength =
02442         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02443
02444 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileHistory_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) |

Definition at line 1848 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

01852 {
01853
01854     HRESULT _RetVal;
01855
01856     RPC_MESSAGE _RpcMessage;
01857
01858     MIDL_STUB_MESSAGE _StubMsg;
01859
01860     RpcTryExcept
01861         {
01862         NdrProxyInitialize(
01863                       ( void __RPC_FAR *  )This,
01864                       ( PRPC_MESSAGE  )&_RpcMessage,
01865                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01866                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01867                       15);
01868
01869
01870
01871         if(!sFilenames)
01872             {
01873             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01874             }
01875         RpcTryFinally
01876             {
01877
01878             _StubMsg.BufferLength = 4U + 12U;
01879             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01880                                            (unsigned char __RPC_FAR *)sFilenames,
01881                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01882
01883             NdrProxyGetBuffer(This, &_StubMsg);
01884             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01885
01886             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01887                                          (unsigned char __RPC_FAR *)sFilenames,
01888                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01889
01890             NdrProxySendReceive(This, &_StubMsg);
01891
01892             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01893                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01894
01895             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01896
01897             }
01898         RpcFinally
01899             {
01900             NdrProxyFreeBuffer(This, &_StubMsg);
01901
01902             }
01903         RpcEndFinally
01904
01905         }
01906     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01907         {
01908         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01909         }
01910     RpcEndExcept
01911     return _RetVal;
01912 }

void __RPC_STUB ICvsCoworker_ShowFileHistory_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1914 of file CVS_Coworker_p.c.

01919 {
01920     HRESULT _RetVal;
01921     MIDL_STUB_MESSAGE _StubMsg;
01922     int handle;
01923     const unsigned char __RPC_FAR *sFilenames;
01924
01925 NdrStubInitialize(
01926                      _pRpcMessage,
01927                      &_StubMsg,
01928                      &Object_StubDesc,
01929                      _pRpcChannelBuffer);
01930     ( unsigned char __RPC_FAR * )sFilenames = 0;
01931     RpcTryFinally
01932         {
01933         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01934             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01935
01936         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01937
01938         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01939                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01940                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01941                                        (unsigned char)0 );
01942
01943
01944         *_pdwStubPhase = STUB_CALL_SERVER;
01945         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowFileHistory(
01946                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01947                    handle,
01948                    sFilenames);
01949
01950         *_pdwStubPhase = STUB_MARSHAL;
01951
01952         _StubMsg.BufferLength = 4U;
01953         _StubMsg.BufferLength += 16;
01954
01955         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01956         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01957
01958         }
01959     RpcFinally
01960         {
01961         }
01962     RpcEndFinally
01963     _pRpcMessage->BufferLength =
01964         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01965
01966 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileProperties_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilename
 | ) |

Definition at line 1969 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

01973 {
01974
01975     HRESULT _RetVal;
01976
01977     RPC_MESSAGE _RpcMessage;
01978
01979     MIDL_STUB_MESSAGE _StubMsg;
01980
01981     RpcTryExcept
01982         {
01983         NdrProxyInitialize(
01984                       ( void __RPC_FAR *  )This,
01985                       ( PRPC_MESSAGE  )&_RpcMessage,
01986                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01987                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01988                       16);
01989
01990
01991
01992         if(!sFilename)
01993             {
01994             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01995             }
01996         RpcTryFinally
01997             {
01998
01999             _StubMsg.BufferLength = 4U + 12U;
02000             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02001                                            (unsigned char __RPC_FAR *)sFilename,
02002                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02003
02004             NdrProxyGetBuffer(This, &_StubMsg);
02005             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02006
02007             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02008                                          (unsigned char __RPC_FAR *)sFilename,
02009                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02010
02011             NdrProxySendReceive(This, &_StubMsg);
02012
02013             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02014                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02015
02016             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02017
02018             }
02019         RpcFinally
02020             {
02021             NdrProxyFreeBuffer(This, &_StubMsg);
02022
02023             }
02024         RpcEndFinally
02025
02026         }
02027     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02028         {
02029         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02030         }
02031     RpcEndExcept
02032     return _RetVal;
02033 }

void __RPC_STUB ICvsCoworker_ShowFileProperties_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2035 of file CVS_Coworker_p.c.

02040 {
02041     HRESULT _RetVal;
02042     MIDL_STUB_MESSAGE _StubMsg;
02043     int handle;
02044     const unsigned char __RPC_FAR *sFilename;
02045
02046 NdrStubInitialize(
02047                      _pRpcMessage,
02048                      &_StubMsg,
02049                      &Object_StubDesc,
02050                      _pRpcChannelBuffer);
02051     ( unsigned char __RPC_FAR * )sFilename = 0;
02052     RpcTryFinally
02053         {
02054         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02055             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02056
02057         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02058
02059         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02060                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilename,
02061                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02062                                        (unsigned char)0 );
02063
02064
02065         *_pdwStubPhase = STUB_CALL_SERVER;
02066         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowFileProperties(
02067                       (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02068                       handle,
02069                       sFilename);
02070
02071         *_pdwStubPhase = STUB_MARSHAL;
02072
02073         _StubMsg.BufferLength = 4U;
02074         _StubMsg.BufferLength += 16;
02075
02076         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02077         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02078
02079         }
02080     RpcFinally
02081         {
02082         }
02083     RpcEndFinally
02084     _pRpcMessage->BufferLength =
02085         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02086
02087 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowUserInterface_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) |

Definition at line 2090 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

02094 {
02095
02096     HRESULT _RetVal;
02097
02098     RPC_MESSAGE _RpcMessage;
02099
02100     MIDL_STUB_MESSAGE _StubMsg;
02101
02102     RpcTryExcept
02103         {
02104         NdrProxyInitialize(
02105                       ( void __RPC_FAR *  )This,
02106                       ( PRPC_MESSAGE  )&_RpcMessage,
02107                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02108                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02109                       17);
02110
02111
02112
02113         if(!sFilenames)
02114             {
02115             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02116             }
02117         RpcTryFinally
02118             {
02119
02120             _StubMsg.BufferLength = 4U + 12U;
02121             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02122                                            (unsigned char __RPC_FAR *)sFilenames,
02123                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02124
02125             NdrProxyGetBuffer(This, &_StubMsg);
02126             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02127
02128             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02129                                          (unsigned char __RPC_FAR *)sFilenames,
02130                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02131
02132             NdrProxySendReceive(This, &_StubMsg);
02133
02134             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02135                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02136
02137             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02138
02139             }
02140         RpcFinally
02141             {
02142             NdrProxyFreeBuffer(This, &_StubMsg);
02143
02144             }
02145         RpcEndFinally
02146
02147         }
02148     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02149         {
02150         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02151         }
02152     RpcEndExcept
02153     return _RetVal;
02154 }

void __RPC_STUB ICvsCoworker_ShowUserInterface_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2156 of file CVS_Coworker_p.c.

02161 {
02162     HRESULT _RetVal;
02163     MIDL_STUB_MESSAGE _StubMsg;
02164     int handle;
02165     const unsigned char __RPC_FAR *sFilenames;
02166
02167 NdrStubInitialize(
02168                      _pRpcMessage,
02169                      &_StubMsg,
02170                      &Object_StubDesc,
02171                      _pRpcChannelBuffer);
02172     ( unsigned char __RPC_FAR * )sFilenames = 0;
02173     RpcTryFinally
02174         {
02175         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02176             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02177
02178         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02179
02180         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02181                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
02182                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02183                                        (unsigned char)0 );
02184
02185
02186         *_pdwStubPhase = STUB_CALL_SERVER;
02187         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowUserInterface(
02188                      (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02189                      handle,
02190                      sFilenames);
02191
02192         *_pdwStubPhase = STUB_MARSHAL;
02193
02194         _StubMsg.BufferLength = 4U;
02195         _StubMsg.BufferLength += 16;
02196
02197         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02198         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02199
02200         }
02201     RpcFinally
02202         {
02203         }
02204     RpcEndFinally
02205     _pRpcMessage->BufferLength =
02206         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02207
02208 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_UncheckoutFiles_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) |

Definition at line 1185 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

01189 {
01190
01191     HRESULT _RetVal;
01192
01193     RPC_MESSAGE _RpcMessage;
01194
01195     MIDL_STUB_MESSAGE _StubMsg;
01196
01197     RpcTryExcept
01198         {
01199         NdrProxyInitialize(
01200                       ( void __RPC_FAR *  )This,
01201                       ( PRPC_MESSAGE  )&_RpcMessage,
01202                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01203                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01204                       10);
01205
01206
01207
01208         if(!sFilenames)
01209             {
01210             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01211             }
01212         RpcTryFinally
01213             {
01214
01215             _StubMsg.BufferLength = 4U + 12U;
01216             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01217                                            (unsigned char __RPC_FAR *)sFilenames,
01218                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01219
01220             NdrProxyGetBuffer(This, &_StubMsg);
01221             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01222
01223             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01224                                          (unsigned char __RPC_FAR *)sFilenames,
01225                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01226
01227             NdrProxySendReceive(This, &_StubMsg);
01228
01229             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01230                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01231
01232             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01233
01234             }
01235         RpcFinally
01236             {
01237             NdrProxyFreeBuffer(This, &_StubMsg);
01238
01239             }
01240         RpcEndFinally
01241
01242         }
01243     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01244         {
01245         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01246         }
01247     RpcEndExcept
01248     return _RetVal;
01249 }

void __RPC_STUB ICvsCoworker_UncheckoutFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1251 of file CVS_Coworker_p.c.

01256 {
01257     HRESULT _RetVal;
01258     MIDL_STUB_MESSAGE _StubMsg;
01259     int handle;
01260     const unsigned char __RPC_FAR *sFilenames;
01261
01262 NdrStubInitialize(
01263                      _pRpcMessage,
01264                      &_StubMsg,
01265                      &Object_StubDesc,
01266                      _pRpcChannelBuffer);
01267     ( unsigned char __RPC_FAR * )sFilenames = 0;
01268     RpcTryFinally
01269         {
01270         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01271             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01272
01273         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01274
01275         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01276                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01277                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01278                                        (unsigned char)0 );
01279
01280
01281         *_pdwStubPhase = STUB_CALL_SERVER;
01282         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> UncheckoutFiles(
01283                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01284                    handle,
01285                    sFilenames);
01286
01287         *_pdwStubPhase = STUB_MARSHAL;
01288
01289         _StubMsg.BufferLength = 4U;
01290         _StubMsg.BufferLength += 16;
01291
01292         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01293         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01294
01295         }
01296     RpcFinally
01297         {
01298         }
01299     RpcEndFinally
01300     _pRpcMessage->BufferLength =
01301         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01302
01303 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_UpdateFiles_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames,
 |  | BOOL | bDirectories,
 |  | BOOL | bRecurse
 | ) |

Definition at line 797 of file CVS_Coworker_p.c.

Referenced by CINTERFACE_PROXY_VTABLE.

00803 {
00804
00805     HRESULT _RetVal;
00806
00807     RPC_MESSAGE _RpcMessage;
00808
00809     MIDL_STUB_MESSAGE _StubMsg;
00810
00811     RpcTryExcept
00812         {
00813         NdrProxyInitialize(
00814                       ( void __RPC_FAR *  )This,
00815                       ( PRPC_MESSAGE  )&_RpcMessage,
00816                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00817                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00818                       7);
00819
00820
00821
00822         if(!sFilenames)
00823             {
00824             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00825             }
00826         RpcTryFinally
00827             {
00828
00829             _StubMsg.BufferLength = 4U + 12U + 11U + 7U;
00830             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00831                                            (unsigned char __RPC_FAR *)sFilenames,
00832                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00833
00834             NdrProxyGetBuffer(This, &_StubMsg);
00835             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
00836
00837             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00838                                          (unsigned char __RPC_FAR *)sFilenames,
00839                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00840
00841             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00842             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bDirectories;
00843
00844             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bRecurse;
00845
00846             NdrProxySendReceive(This, &_StubMsg);
00847
00848             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00849                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
00850
00851             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00852
00853             }
00854         RpcFinally
00855             {
00856             NdrProxyFreeBuffer(This, &_StubMsg);
00857
00858             }
00859         RpcEndFinally
00860
00861         }
00862     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00863         {
00864         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00865         }
00866     RpcEndExcept
00867     return _RetVal;
00868 }

void __RPC_STUB ICvsCoworker_UpdateFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 870 of file CVS_Coworker_p.c.

00875 {
00876     HRESULT _RetVal;
00877     MIDL_STUB_MESSAGE _StubMsg;
00878     BOOL bDirectories;
00879     BOOL bRecurse;
00880     int handle;
00881     const unsigned char __RPC_FAR *sFilenames;
00882
00883 NdrStubInitialize(
00884                      _pRpcMessage,
00885                      &_StubMsg,
00886                      &Object_StubDesc,
00887                      _pRpcChannelBuffer);
00888     ( unsigned char __RPC_FAR * )sFilenames = 0;
00889     RpcTryFinally
00890         {
00891         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00892             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
00893
00894         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00895
00896         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00897                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
00898                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00899                                        (unsigned char)0 );
00900
00901         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00902         bDirectories = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00903
00904         bRecurse = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00905
00906
00907         *_pdwStubPhase = STUB_CALL_SERVER;
00908         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> UpdateFiles(
00909                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00910                handle,
00911                sFilenames,
00912                bDirectories,
00913                bRecurse);
00914
00915         *_pdwStubPhase = STUB_MARSHAL;
00916
00917         _StubMsg.BufferLength = 4U;
00918         _StubMsg.BufferLength += 16;
00919
00920         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00921         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00922
00923         }
00924     RpcFinally
00925         {
00926         }
00927     RpcEndFinally
00928     _pRpcMessage->BufferLength =
00929         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00930
00931 }

void __RPC_FAR* __RPC_USER MIDL_user_allocate ( size_t )

void __RPC_USER MIDL_user_free ( void __RPC_FAR * )

virtual HRESULT STDMETHODCALLTYPE OpenProject | ( | int __RPC_FAR * | pHandle,
 |  | const unsigned char __RPC_FAR * | sUsername,
 |  | const unsigned char __RPC_FAR * | sProjectName,
 |  | const unsigned char __RPC_FAR * | sProjectHome
 | ) | [pure virtual]

virtual HRESULT STDMETHODCALLTYPE RemoveFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE RenameFile | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sOldFilename,
 |  | const unsigned char __RPC_FAR * | sNewFilename
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE ShowAdvancedOptionsForCommand | ( | int | handle,
 |  | CvsCommand | command
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE ShowFileHistory | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE ShowFileProperties | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilename
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE ShowUserInterface | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE UncheckoutFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE UpdateFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames,
 |  | BOOL | bDirectories,
 |  | BOOL | bRecurse
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

Variable Documentation

RPC_IF_HANDLE __MIDL_itf_cvs_coworker_0000_v0_0_c_ifspec

Definition at line 92 of file cvs_coworker.h.

RPC_IF_HANDLE __MIDL_itf_cvs_coworker_0000_v0_0_s_ifspec

Definition at line 93 of file cvs_coworker.h.

ICvsCoworker __pad0__

Definition at line 111 of file cvs_coworker.h.

EXTERN_C const CLSID CLSID_CvsCoworker

Definition at line 733 of file cvs_coworker.h.

EXTERN_C const IID IID_ICvsCoworker

Definition at line 102 of file cvs_coworker.h.

EXTERN_C const IID LIBID_CVS_COWORKERLib

Definition at line 731 of file cvs_coworker.h.

ICvsCoworker int __RPC_FAR* piError = 0

Definition at line 112 of file cvs_coworker.h.

Referenced by ICvsCoworker_OpenProject_Stub.

Generated on Sun Feb 24 01:23:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CoWorker/cvs_coworker.h Source File

WinCvs/CoWorker/cvs_coworker.h

Go to the documentation of this file.
00001 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
00002
00003
00004 /* File created by MIDL compiler version 5.01.0164 */
00005 /* at Tue May 25 19:23:37 1999
00006  */
00007 /* Compiler settings for cvs_coworker.idl:
00008     Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext
00009     error checks: allocation ref bounds_check enum stub_data
00010 */
00011 //@@MIDL_FILE_HEADING(  )
00012
00013
00014 /* verify that the <rpcndr.h> version is high enough to compile this file*/
00015 #ifndef __REQUIRED_RPCNDR_H_VERSION__
00016 #define __REQUIRED_RPCNDR_H_VERSION__ 440
00017 #endif
00018
00019 #include "rpc.h"
00020 #include "rpcndr.h"
00021
00022 #ifndef __RPCNDR_H_VERSION__
00023 #error this stub requires an updated version of <rpcndr.h>
00024 #endif // __RPCNDR_H_VERSION__
00025
00026 #ifndef COM_NO_WINDOWS_H
00027 #include "windows.h"
00028 #include "ole2.h"
00029 #endif /*COM_NO_WINDOWS_H*/
00030
00031 #ifndef __cvs_coworker_h__
00032 #define __cvs_coworker_h__
00033
00034 #ifdef __cplusplus
00035 extern "C"{
00036 #endif
00037
00038 /* Forward Declarations */
00039
00040 #ifndef __ICvsCoworker_FWD_DEFINED__
00041 #define __ICvsCoworker_FWD_DEFINED__
00042 typedef interface ICvsCoworker ICvsCoworker;
00043 #endif  /* __ICvsCoworker_FWD_DEFINED__ */
00044
00045
00046 #ifndef __CvsCoworker_FWD_DEFINED__
00047 #define __CvsCoworker_FWD_DEFINED__
00048
00049 #ifdef __cplusplus
00050 typedef class CvsCoworker CvsCoworker;
00051 #else
00052 typedef struct CvsCoworker CvsCoworker;
00053 #endif /* __cplusplus */
00054
00055 #endif  /* __CvsCoworker_FWD_DEFINED__ */
00056
00057
00058 /* header files for imported files */
00059 #include "oaidl.h"
00060 #include "ocidl.h"
00061
00062 void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
00063 void __RPC_USER MIDL_user_free( void __RPC_FAR * );
00064
00065 /* interface __MIDL_itf_cvs_coworker_0000 */
00066 /* [local] */
00067
00068 typedef /* [helpstring][uuid] */
00069 enum CvsOption
00070     {   cvsOptionCompareContents    = 1,
00071     cvsOptionCompareChecksum    = 2,
00072     cvsOptionCompareTimestamp   = 3
00073     }   CvsOption;
00074
00075 typedef /* [helpstring][uuid] */
00076 enum CvsCommand
00077     {   cvsCommandUpdate    = 0,
00078     cvsCommandCheckout  = 1,
00079     cvsCommandCheckin   = 2,
00080     cvsCommandUncheckout    = 3,
00081     cvsCommandAdd   = 4,
00082     cvsCommandRemove    = 5,
00083     cvsCommandDiff  = 6,
00084     cvsCommandHistory   = 7,
00085     cvsCommandRename    = 8,
00086     cvsCommandProperties    = 9,
00087     cvsCommandOptions   = 10
00088     }   CvsCommand;
00089
00090
00091
00092 extern RPC_IF_HANDLE __MIDL_itf_cvs_coworker_0000_v0_0_c_ifspec;
00093 extern RPC_IF_HANDLE __MIDL_itf_cvs_coworker_0000_v0_0_s_ifspec;
00094
00095 #ifndef __ICvsCoworker_INTERFACE_DEFINED__
00096 #define __ICvsCoworker_INTERFACE_DEFINED__
00097
00098 /* interface ICvsCoworker */
00099 /* [unique][helpstring][oleautomation][uuid][object] */
00100
00101
00102 EXTERN_C const IID IID_ICvsCoworker;
00103
00104 #if defined(__cplusplus) && !defined(CINTERFACE)
00105
00106     MIDL_INTERFACE("10E5359C-F454-11D2-B442-0080C6F9179D")
00107     ICvsCoworker : public IUnknown
00108     {
00109     public:
00110         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetLastError(
00111             /* [in] */ int handle,
00112             /* [out] */ int __RPC_FAR *piError) = 0;
00113
00114         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetErrorMessage(
00115             /* [in] */ int handle,
00116             /* [in] */ int iError,
00117             /* [in] */ int cbErrorBuffer,
00118             /* [size_is][string][out] */ unsigned char __RPC_FAR *sErrorBuffer) = 0;
00119
00120         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE OpenProject(
00121             /* [out] */ int __RPC_FAR *pHandle,
00122             /* [string][in] */ const unsigned char __RPC_FAR *sUsername,
00123             /* [string][in] */ const unsigned char __RPC_FAR *sProjectName,
00124             /* [string][in] */ const unsigned char __RPC_FAR *sProjectHome) = 0;
00125
00126         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetProject(
00127             /* [out] */ int __RPC_FAR *pHandle,
00128             /* [in] */ const unsigned char __RPC_FAR *sUsername,
00129             /* [in] */ int cbProjectNameBuffer,
00130             /* [size_is][string][out][in] */ unsigned char __RPC_FAR *sProjectName,
00131             /* [in] */ int cbProjectHomeBuffer,
00132             /* [size_is][string][out][in] */ unsigned char __RPC_FAR *sProjectHome,
00133             /* [in] */ BOOL bAllowPathChange,
00134             /* [in] */ BOOL bAllowNewProject,
00135             /* [out] */ BOOL __RPC_FAR *pbNewProject) = 0;
00136
00137         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE UpdateFiles(
00138             /* [in] */ int handle,
00139             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames,
00140             /* [in] */ BOOL bDirectories,
00141             /* [in] */ BOOL bRecurse) = 0;
00142
00143         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CheckoutFiles(
00144             /* [in] */ int handle,
00145             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames) = 0;
00146
00147         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CheckinFiles(
00148             /* [in] */ int handle,
00149             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames,
00150             /* [in] */ BOOL bKeepCheckedOut) = 0;
00151
00152         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE UncheckoutFiles(
00153             /* [in] */ int handle,
00154             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames) = 0;
00155
00156         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AddFiles(
00157             /* [in] */ int handle,
00158             /* [string][in] */ const unsigned char __RPC_FAR *sOptionsAndFilenames,
00159             /* [string][in] */ const unsigned char __RPC_FAR *sComment) = 0;
00160
00161         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RemoveFiles(
00162             /* [in] */ int handle,
00163             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames) = 0;
00164
00165         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RenameFile(
00166             /* [in] */ int handle,
00167             /* [string][in] */ const unsigned char __RPC_FAR *sOldFilename,
00168             /* [string][in] */ const unsigned char __RPC_FAR *sNewFilename) = 0;
00169
00170         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE DiffFile(
00171             /* [in] */ int handle,
00172             /* [string][in] */ const unsigned char __RPC_FAR *sFilename,
00173             /* [in] */ BOOL bIgnoreCase,
00174             /* [in] */ BOOL bIgnoreBlanks) = 0;
00175
00176         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ShowFileHistory(
00177             /* [in] */ int handle,
00178             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames) = 0;
00179
00180         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ShowFileProperties(
00181             /* [in] */ int handle,
00182             /* [string][in] */ const unsigned char __RPC_FAR *sFilename) = 0;
00183
00184         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ShowUserInterface(
00185             /* [in] */ int handle,
00186             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames) = 0;
00187
00188         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE HasAdvancedOptionsForCommand(
00189             /* [in] */ int handle,
00190             /* [in] */ CvsCommand command,
00191             /* [retval][out] */ BOOL __RPC_FAR *pbAdvancedOptions) = 0;
00192
00193         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ShowAdvancedOptionsForCommand(
00194             /* [in] */ int handle,
00195             /* [in] */ CvsCommand command) = 0;
00196
00197         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetFileChanges(
00198             /* [in] */ int handle,
00199             /* [in] */ int cbFilenameBuffer,
00200             /* [size_is][string][out] */ unsigned char __RPC_FAR *sFilenameBuffer) = 0;
00201
00202         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetFilesToAdd(
00203             /* [in] */ int handle,
00204             /* [in] */ int cbFilenamesBuffer,
00205             /* [size_is][string][out] */ unsigned char __RPC_FAR *sFilenamesBuffer) = 0;
00206
00207         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CloseProject(
00208             /* [in] */ int handle) = 0;
00209
00210     };
00211
00212 #else   /* C style interface */
00213
00214     typedef struct ICvsCoworkerVtbl
00215     {
00216         BEGIN_INTERFACE
00217
00218         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
00219             ICvsCoworker __RPC_FAR * This,
00220             /* [in] */ REFIID riid,
00221             /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
00222
00223         ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
00224             ICvsCoworker __RPC_FAR * This);
00225
00226         ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
00227             ICvsCoworker __RPC_FAR * This);
00228
00229         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetLastError )(
00230             ICvsCoworker __RPC_FAR * This,
00231             /* [in] */ int handle,
00232             /* [out] */ int __RPC_FAR *piError);
00233
00234         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetErrorMessage )(
00235             ICvsCoworker __RPC_FAR * This,
00236             /* [in] */ int handle,
00237             /* [in] */ int iError,
00238             /* [in] */ int cbErrorBuffer,
00239             /* [size_is][string][out] */ unsigned char __RPC_FAR *sErrorBuffer);
00240
00241         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *OpenProject )(
00242             ICvsCoworker __RPC_FAR * This,
00243             /* [out] */ int __RPC_FAR *pHandle,
00244             /* [string][in] */ const unsigned char __RPC_FAR *sUsername,
00245             /* [string][in] */ const unsigned char __RPC_FAR *sProjectName,
00246             /* [string][in] */ const unsigned char __RPC_FAR *sProjectHome);
00247
00248         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetProject )(
00249             ICvsCoworker __RPC_FAR * This,
00250             /* [out] */ int __RPC_FAR *pHandle,
00251             /* [in] */ const unsigned char __RPC_FAR *sUsername,
00252             /* [in] */ int cbProjectNameBuffer,
00253             /* [size_is][string][out][in] */ unsigned char __RPC_FAR *sProjectName,
00254             /* [in] */ int cbProjectHomeBuffer,
00255             /* [size_is][string][out][in] */ unsigned char __RPC_FAR *sProjectHome,
00256             /* [in] */ BOOL bAllowPathChange,
00257             /* [in] */ BOOL bAllowNewProject,
00258             /* [out] */ BOOL __RPC_FAR *pbNewProject);
00259
00260         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *UpdateFiles )(
00261             ICvsCoworker __RPC_FAR * This,
00262             /* [in] */ int handle,
00263             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames,
00264             /* [in] */ BOOL bDirectories,
00265             /* [in] */ BOOL bRecurse);
00266
00267         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CheckoutFiles )(
00268             ICvsCoworker __RPC_FAR * This,
00269             /* [in] */ int handle,
00270             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00271
00272         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CheckinFiles )(
00273             ICvsCoworker __RPC_FAR * This,
00274             /* [in] */ int handle,
00275             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames,
00276             /* [in] */ BOOL bKeepCheckedOut);
00277
00278         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *UncheckoutFiles )(
00279             ICvsCoworker __RPC_FAR * This,
00280             /* [in] */ int handle,
00281             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00282
00283         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *AddFiles )(
00284             ICvsCoworker __RPC_FAR * This,
00285             /* [in] */ int handle,
00286             /* [string][in] */ const unsigned char __RPC_FAR *sOptionsAndFilenames,
00287             /* [string][in] */ const unsigned char __RPC_FAR *sComment);
00288
00289         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *RemoveFiles )(
00290             ICvsCoworker __RPC_FAR * This,
00291             /* [in] */ int handle,
00292             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00293
00294         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *RenameFile )(
00295             ICvsCoworker __RPC_FAR * This,
00296             /* [in] */ int handle,
00297             /* [string][in] */ const unsigned char __RPC_FAR *sOldFilename,
00298             /* [string][in] */ const unsigned char __RPC_FAR *sNewFilename);
00299
00300         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *DiffFile )(
00301             ICvsCoworker __RPC_FAR * This,
00302             /* [in] */ int handle,
00303             /* [string][in] */ const unsigned char __RPC_FAR *sFilename,
00304             /* [in] */ BOOL bIgnoreCase,
00305             /* [in] */ BOOL bIgnoreBlanks);
00306
00307         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *ShowFileHistory )(
00308             ICvsCoworker __RPC_FAR * This,
00309             /* [in] */ int handle,
00310             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00311
00312         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *ShowFileProperties )(
00313             ICvsCoworker __RPC_FAR * This,
00314             /* [in] */ int handle,
00315             /* [string][in] */ const unsigned char __RPC_FAR *sFilename);
00316
00317         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *ShowUserInterface )(
00318             ICvsCoworker __RPC_FAR * This,
00319             /* [in] */ int handle,
00320             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00321
00322         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *HasAdvancedOptionsForCommand )(
00323             ICvsCoworker __RPC_FAR * This,
00324             /* [in] */ int handle,
00325             /* [in] */ CvsCommand command,
00326             /* [retval][out] */ BOOL __RPC_FAR *pbAdvancedOptions);
00327
00328         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *ShowAdvancedOptionsForCommand )(
00329             ICvsCoworker __RPC_FAR * This,
00330             /* [in] */ int handle,
00331             /* [in] */ CvsCommand command);
00332
00333         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetFileChanges )(
00334             ICvsCoworker __RPC_FAR * This,
00335             /* [in] */ int handle,
00336             /* [in] */ int cbFilenameBuffer,
00337             /* [size_is][string][out] */ unsigned char __RPC_FAR *sFilenameBuffer);
00338
00339         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetFilesToAdd )(
00340             ICvsCoworker __RPC_FAR * This,
00341             /* [in] */ int handle,
00342             /* [in] */ int cbFilenamesBuffer,
00343             /* [size_is][string][out] */ unsigned char __RPC_FAR *sFilenamesBuffer);
00344
00345         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CloseProject )(
00346             ICvsCoworker __RPC_FAR * This,
00347             /* [in] */ int handle);
00348
00349         END_INTERFACE
00350     } ICvsCoworkerVtbl;
00351
00352     interface ICvsCoworker
00353     {
00354         CONST_VTBL struct ICvsCoworkerVtbl __RPC_FAR *lpVtbl;
00355     };
00356
00357
00358
00359 #ifdef COBJMACROS
00360
00361
00362 #define ICvsCoworker_QueryInterface(This,riid,ppvObject)    \
00363     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
00364
00365 #define ICvsCoworker_AddRef(This)   \
00366     (This)->lpVtbl -> AddRef(This)
00367
00368 #define ICvsCoworker_Release(This)  \
00369     (This)->lpVtbl -> Release(This)
00370
00371
00372 #define ICvsCoworker_GetLastError(This,handle,piError)  \
00373     (This)->lpVtbl -> GetLastError(This,handle,piError)
00374
00375 #define ICvsCoworker_GetErrorMessage(This,handle,iError,cbErrorBuffer,sErrorBuffer) \
00376     (This)->lpVtbl -> GetErrorMessage(This,handle,iError,cbErrorBuffer,sErrorBuffer)
00377
00378 #define ICvsCoworker_OpenProject(This,pHandle,sUsername,sProjectName,sProjectHome)  \
00379     (This)->lpVtbl -> OpenProject(This,pHandle,sUsername,sProjectName,sProjectHome)
00380
00381 #define ICvsCoworker_GetProject(This,pHandle,sUsername,cbProjectNameBuffer,sProjectName,cbProjectHomeBuffer,sProjectHome,bAllowPathChange,bAllowNewProject,pbNewProject)    \
00382     (This)->lpVtbl -> GetProject(This,pHandle,sUsername,cbProjectNameBuffer,sProjectName,cbProjectHomeBuffer,sProjectHome,bAllowPathChange,bAllowNewProject,pbNewProject)
00383
00384 #define ICvsCoworker_UpdateFiles(This,handle,sFilenames,bDirectories,bRecurse)  \
00385     (This)->lpVtbl -> UpdateFiles(This,handle,sFilenames,bDirectories,bRecurse)
00386
00387 #define ICvsCoworker_CheckoutFiles(This,handle,sFilenames)  \
00388     (This)->lpVtbl -> CheckoutFiles(This,handle,sFilenames)
00389
00390 #define ICvsCoworker_CheckinFiles(This,handle,sFilenames,bKeepCheckedOut)   \
00391     (This)->lpVtbl -> CheckinFiles(This,handle,sFilenames,bKeepCheckedOut)
00392
00393 #define ICvsCoworker_UncheckoutFiles(This,handle,sFilenames)    \
00394     (This)->lpVtbl -> UncheckoutFiles(This,handle,sFilenames)
00395
00396 #define ICvsCoworker_AddFiles(This,handle,sOptionsAndFilenames,sComment)    \
00397     (This)->lpVtbl -> AddFiles(This,handle,sOptionsAndFilenames,sComment)
00398
00399 #define ICvsCoworker_RemoveFiles(This,handle,sFilenames)    \
00400     (This)->lpVtbl -> RemoveFiles(This,handle,sFilenames)
00401
00402 #define ICvsCoworker_RenameFile(This,handle,sOldFilename,sNewFilename)  \
00403     (This)->lpVtbl -> RenameFile(This,handle,sOldFilename,sNewFilename)
00404
00405 #define ICvsCoworker_DiffFile(This,handle,sFilename,bIgnoreCase,bIgnoreBlanks)  \
00406     (This)->lpVtbl -> DiffFile(This,handle,sFilename,bIgnoreCase,bIgnoreBlanks)
00407
00408 #define ICvsCoworker_ShowFileHistory(This,handle,sFilenames)    \
00409     (This)->lpVtbl -> ShowFileHistory(This,handle,sFilenames)
00410
00411 #define ICvsCoworker_ShowFileProperties(This,handle,sFilename)  \
00412     (This)->lpVtbl -> ShowFileProperties(This,handle,sFilename)
00413
00414 #define ICvsCoworker_ShowUserInterface(This,handle,sFilenames)  \
00415     (This)->lpVtbl -> ShowUserInterface(This,handle,sFilenames)
00416
00417 #define ICvsCoworker_HasAdvancedOptionsForCommand(This,handle,command,pbAdvancedOptions)    \
00418     (This)->lpVtbl -> HasAdvancedOptionsForCommand(This,handle,command,pbAdvancedOptions)
00419
00420 #define ICvsCoworker_ShowAdvancedOptionsForCommand(This,handle,command) \
00421     (This)->lpVtbl -> ShowAdvancedOptionsForCommand(This,handle,command)
00422
00423 #define ICvsCoworker_GetFileChanges(This,handle,cbFilenameBuffer,sFilenameBuffer)   \
00424     (This)->lpVtbl -> GetFileChanges(This,handle,cbFilenameBuffer,sFilenameBuffer)
00425
00426 #define ICvsCoworker_GetFilesToAdd(This,handle,cbFilenamesBuffer,sFilenamesBuffer)  \
00427     (This)->lpVtbl -> GetFilesToAdd(This,handle,cbFilenamesBuffer,sFilenamesBuffer)
00428
00429 #define ICvsCoworker_CloseProject(This,handle)  \
00430     (This)->lpVtbl -> CloseProject(This,handle)
00431
00432 #endif /* COBJMACROS */
00433
00434
00435 #endif  /* C style interface */
00436
00437
00438
00439 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetLastError_Proxy(
00440     ICvsCoworker __RPC_FAR * This,
00441     /* [in] */ int handle,
00442     /* [out] */ int __RPC_FAR *piError);
00443
00444
00445 void __RPC_STUB ICvsCoworker_GetLastError_Stub(
00446     IRpcStubBuffer *This,
00447     IRpcChannelBuffer *_pRpcChannelBuffer,
00448     PRPC_MESSAGE _pRpcMessage,
00449     DWORD *_pdwStubPhase);
00450
00451
00452 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetErrorMessage_Proxy(
00453     ICvsCoworker __RPC_FAR * This,
00454     /* [in] */ int handle,
00455     /* [in] */ int iError,
00456     /* [in] */ int cbErrorBuffer,
00457     /* [size_is][string][out] */ unsigned char __RPC_FAR *sErrorBuffer);
00458
00459
00460 void __RPC_STUB ICvsCoworker_GetErrorMessage_Stub(
00461     IRpcStubBuffer *This,
00462     IRpcChannelBuffer *_pRpcChannelBuffer,
00463     PRPC_MESSAGE _pRpcMessage,
00464     DWORD *_pdwStubPhase);
00465
00466
00467 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_OpenProject_Proxy(
00468     ICvsCoworker __RPC_FAR * This,
00469     /* [out] */ int __RPC_FAR *pHandle,
00470     /* [string][in] */ const unsigned char __RPC_FAR *sUsername,
00471     /* [string][in] */ const unsigned char __RPC_FAR *sProjectName,
00472     /* [string][in] */ const unsigned char __RPC_FAR *sProjectHome);
00473
00474
00475 void __RPC_STUB ICvsCoworker_OpenProject_Stub(
00476     IRpcStubBuffer *This,
00477     IRpcChannelBuffer *_pRpcChannelBuffer,
00478     PRPC_MESSAGE _pRpcMessage,
00479     DWORD *_pdwStubPhase);
00480
00481
00482 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetProject_Proxy(
00483     ICvsCoworker __RPC_FAR * This,
00484     /* [out] */ int __RPC_FAR *pHandle,
00485     /* [in] */ const unsigned char __RPC_FAR *sUsername,
00486     /* [in] */ int cbProjectNameBuffer,
00487     /* [size_is][string][out][in] */ unsigned char __RPC_FAR *sProjectName,
00488     /* [in] */ int cbProjectHomeBuffer,
00489     /* [size_is][string][out][in] */ unsigned char __RPC_FAR *sProjectHome,
00490     /* [in] */ BOOL bAllowPathChange,
00491     /* [in] */ BOOL bAllowNewProject,
00492     /* [out] */ BOOL __RPC_FAR *pbNewProject);
00493
00494
00495 void __RPC_STUB ICvsCoworker_GetProject_Stub(
00496     IRpcStubBuffer *This,
00497     IRpcChannelBuffer *_pRpcChannelBuffer,
00498     PRPC_MESSAGE _pRpcMessage,
00499     DWORD *_pdwStubPhase);
00500
00501
00502 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_UpdateFiles_Proxy(
00503     ICvsCoworker __RPC_FAR * This,
00504     /* [in] */ int handle,
00505     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames,
00506     /* [in] */ BOOL bDirectories,
00507     /* [in] */ BOOL bRecurse);
00508
00509
00510 void __RPC_STUB ICvsCoworker_UpdateFiles_Stub(
00511     IRpcStubBuffer *This,
00512     IRpcChannelBuffer *_pRpcChannelBuffer,
00513     PRPC_MESSAGE _pRpcMessage,
00514     DWORD *_pdwStubPhase);
00515
00516
00517 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckoutFiles_Proxy(
00518     ICvsCoworker __RPC_FAR * This,
00519     /* [in] */ int handle,
00520     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00521
00522
00523 void __RPC_STUB ICvsCoworker_CheckoutFiles_Stub(
00524     IRpcStubBuffer *This,
00525     IRpcChannelBuffer *_pRpcChannelBuffer,
00526     PRPC_MESSAGE _pRpcMessage,
00527     DWORD *_pdwStubPhase);
00528
00529
00530 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckinFiles_Proxy(
00531     ICvsCoworker __RPC_FAR * This,
00532     /* [in] */ int handle,
00533     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames,
00534     /* [in] */ BOOL bKeepCheckedOut);
00535
00536
00537 void __RPC_STUB ICvsCoworker_CheckinFiles_Stub(
00538     IRpcStubBuffer *This,
00539     IRpcChannelBuffer *_pRpcChannelBuffer,
00540     PRPC_MESSAGE _pRpcMessage,
00541     DWORD *_pdwStubPhase);
00542
00543
00544 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_UncheckoutFiles_Proxy(
00545     ICvsCoworker __RPC_FAR * This,
00546     /* [in] */ int handle,
00547     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00548
00549
00550 void __RPC_STUB ICvsCoworker_UncheckoutFiles_Stub(
00551     IRpcStubBuffer *This,
00552     IRpcChannelBuffer *_pRpcChannelBuffer,
00553     PRPC_MESSAGE _pRpcMessage,
00554     DWORD *_pdwStubPhase);
00555
00556
00557 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_AddFiles_Proxy(
00558     ICvsCoworker __RPC_FAR * This,
00559     /* [in] */ int handle,
00560     /* [string][in] */ const unsigned char __RPC_FAR *sOptionsAndFilenames,
00561     /* [string][in] */ const unsigned char __RPC_FAR *sComment);
00562
00563
00564 void __RPC_STUB ICvsCoworker_AddFiles_Stub(
00565     IRpcStubBuffer *This,
00566     IRpcChannelBuffer *_pRpcChannelBuffer,
00567     PRPC_MESSAGE _pRpcMessage,
00568     DWORD *_pdwStubPhase);
00569
00570
00571 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_RemoveFiles_Proxy(
00572     ICvsCoworker __RPC_FAR * This,
00573     /* [in] */ int handle,
00574     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00575
00576
00577 void __RPC_STUB ICvsCoworker_RemoveFiles_Stub(
00578     IRpcStubBuffer *This,
00579     IRpcChannelBuffer *_pRpcChannelBuffer,
00580     PRPC_MESSAGE _pRpcMessage,
00581     DWORD *_pdwStubPhase);
00582
00583
00584 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_RenameFile_Proxy(
00585     ICvsCoworker __RPC_FAR * This,
00586     /* [in] */ int handle,
00587     /* [string][in] */ const unsigned char __RPC_FAR *sOldFilename,
00588     /* [string][in] */ const unsigned char __RPC_FAR *sNewFilename);
00589
00590
00591 void __RPC_STUB ICvsCoworker_RenameFile_Stub(
00592     IRpcStubBuffer *This,
00593     IRpcChannelBuffer *_pRpcChannelBuffer,
00594     PRPC_MESSAGE _pRpcMessage,
00595     DWORD *_pdwStubPhase);
00596
00597
00598 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_DiffFile_Proxy(
00599     ICvsCoworker __RPC_FAR * This,
00600     /* [in] */ int handle,
00601     /* [string][in] */ const unsigned char __RPC_FAR *sFilename,
00602     /* [in] */ BOOL bIgnoreCase,
00603     /* [in] */ BOOL bIgnoreBlanks);
00604
00605
00606 void __RPC_STUB ICvsCoworker_DiffFile_Stub(
00607     IRpcStubBuffer *This,
00608     IRpcChannelBuffer *_pRpcChannelBuffer,
00609     PRPC_MESSAGE _pRpcMessage,
00610     DWORD *_pdwStubPhase);
00611
00612
00613 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileHistory_Proxy(
00614     ICvsCoworker __RPC_FAR * This,
00615     /* [in] */ int handle,
00616     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00617
00618
00619 void __RPC_STUB ICvsCoworker_ShowFileHistory_Stub(
00620     IRpcStubBuffer *This,
00621     IRpcChannelBuffer *_pRpcChannelBuffer,
00622     PRPC_MESSAGE _pRpcMessage,
00623     DWORD *_pdwStubPhase);
00624
00625
00626 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileProperties_Proxy(
00627     ICvsCoworker __RPC_FAR * This,
00628     /* [in] */ int handle,
00629     /* [string][in] */ const unsigned char __RPC_FAR *sFilename);
00630
00631
00632 void __RPC_STUB ICvsCoworker_ShowFileProperties_Stub(
00633     IRpcStubBuffer *This,
00634     IRpcChannelBuffer *_pRpcChannelBuffer,
00635     PRPC_MESSAGE _pRpcMessage,
00636     DWORD *_pdwStubPhase);
00637
00638
00639 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowUserInterface_Proxy(
00640     ICvsCoworker __RPC_FAR * This,
00641     /* [in] */ int handle,
00642     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00643
00644
00645 void __RPC_STUB ICvsCoworker_ShowUserInterface_Stub(
00646     IRpcStubBuffer *This,
00647     IRpcChannelBuffer *_pRpcChannelBuffer,
00648     PRPC_MESSAGE _pRpcMessage,
00649     DWORD *_pdwStubPhase);
00650
00651
00652 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_HasAdvancedOptionsForCommand_Proxy(
00653     ICvsCoworker __RPC_FAR * This,
00654     /* [in] */ int handle,
00655     /* [in] */ CvsCommand command,
00656     /* [retval][out] */ BOOL __RPC_FAR *pbAdvancedOptions);
00657
00658
00659 void __RPC_STUB ICvsCoworker_HasAdvancedOptionsForCommand_Stub(
00660     IRpcStubBuffer *This,
00661     IRpcChannelBuffer *_pRpcChannelBuffer,
00662     PRPC_MESSAGE _pRpcMessage,
00663     DWORD *_pdwStubPhase);
00664
00665
00666 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy(
00667     ICvsCoworker __RPC_FAR * This,
00668     /* [in] */ int handle,
00669     /* [in] */ CvsCommand command);
00670
00671
00672 void __RPC_STUB ICvsCoworker_ShowAdvancedOptionsForCommand_Stub(
00673     IRpcStubBuffer *This,
00674     IRpcChannelBuffer *_pRpcChannelBuffer,
00675     PRPC_MESSAGE _pRpcMessage,
00676     DWORD *_pdwStubPhase);
00677
00678
00679 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFileChanges_Proxy(
00680     ICvsCoworker __RPC_FAR * This,
00681     /* [in] */ int handle,
00682     /* [in] */ int cbFilenameBuffer,
00683     /* [size_is][string][out] */ unsigned char __RPC_FAR *sFilenameBuffer);
00684
00685
00686 void __RPC_STUB ICvsCoworker_GetFileChanges_Stub(
00687     IRpcStubBuffer *This,
00688     IRpcChannelBuffer *_pRpcChannelBuffer,
00689     PRPC_MESSAGE _pRpcMessage,
00690     DWORD *_pdwStubPhase);
00691
00692
00693 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFilesToAdd_Proxy(
00694     ICvsCoworker __RPC_FAR * This,
00695     /* [in] */ int handle,
00696     /* [in] */ int cbFilenamesBuffer,
00697     /* [size_is][string][out] */ unsigned char __RPC_FAR *sFilenamesBuffer);
00698
00699
00700 void __RPC_STUB ICvsCoworker_GetFilesToAdd_Stub(
00701     IRpcStubBuffer *This,
00702     IRpcChannelBuffer *_pRpcChannelBuffer,
00703     PRPC_MESSAGE _pRpcMessage,
00704     DWORD *_pdwStubPhase);
00705
00706
00707 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_CloseProject_Proxy(
00708     ICvsCoworker __RPC_FAR * This,
00709     /* [in] */ int handle);
00710
00711
00712 void __RPC_STUB ICvsCoworker_CloseProject_Stub(
00713     IRpcStubBuffer *This,
00714     IRpcChannelBuffer *_pRpcChannelBuffer,
00715     PRPC_MESSAGE _pRpcMessage,
00716     DWORD *_pdwStubPhase);
00717
00718
00719
00720 #endif  /* __ICvsCoworker_INTERFACE_DEFINED__ */
00721
00722
00723
00724 #ifndef __CVS_COWORKERLib_LIBRARY_DEFINED__
00725 #define __CVS_COWORKERLib_LIBRARY_DEFINED__
00726
00727 /* library CVS_COWORKERLib */
00728 /* [helpstring][version][uuid] */
00729
00730
00731 EXTERN_C const IID LIBID_CVS_COWORKERLib;
00732
00733 EXTERN_C const CLSID CLSID_CvsCoworker;
00734
00735 #ifdef __cplusplus
00736
00737 class DECLSPEC_UUID("10E5359D-F454-11D2-B442-0080C6F9179D")
00738 CvsCoworker;
00739 #endif
00740 #endif /* __CVS_COWORKERLib_LIBRARY_DEFINED__ */
00741
00742 /* Additional Prototypes for ALL interfaces */
00743
00744 /* end of Additional Prototypes */
00745
00746 #ifdef __cplusplus
00747 }
00748 #endif
00749
00750 #endif
Generated on Sun Feb 24 01:21:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CoWorker/CVS_Coworker.idl Source File

WinCvs/CoWorker/CVS_Coworker.idl

Go to the documentation of this file.
00001 //
00002 // CVS_Coworker.idl : IDL source for CVS_Coworker
00003 //
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (CVS_Coworker.tlb) and marshalling code.
00006
00007 import "oaidl.idl";
00008 import "ocidl.idl";
00009
00010 typedef
00011 [
00012     uuid(10E5359F-F454-11D2-B442-0080C6F9179D),
00013     helpstring("CVS compare option"),
00014 ]
00015 enum CvsOption {
00016     // IsFileDifferent() options
00017     [helpstring("Compare contents")]        cvsOptionCompareContents    = 1,
00018     [helpstring("Compare checksum")]        cvsOptionCompareChecksum    = 2,
00019     [helpstring("Compare timestamp")]       cvsOptionCompareTimestamp   = 3
00020 } CvsOption;
00021
00022 typedef
00023 [
00024     uuid(10E5359E-F454-11D2-B442-0080C6F9179D),
00025     helpstring("CVS commands"),
00026 ]
00027 enum CvsCommand {
00028     // HasAdvancedOptionsForCommand() options
00029     [helpstring("Command update")]          cvsCommandUpdate        = 0,
00030     [helpstring("Command checkout")]        cvsCommandCheckout      = 1,
00031     [helpstring("Command checkin")]         cvsCommandCheckin       = 2,
00032     [helpstring("Command uncheckout")]      cvsCommandUncheckout        = 3,
00033     [helpstring("Command add")]         cvsCommandAdd           = 4,
00034     [helpstring("Command remove")]          cvsCommandRemove        = 5,
00035     [helpstring("Command diff")]            cvsCommandDiff          = 6,
00036     [helpstring("Command history")]         cvsCommandHistory       = 7,
00037     [helpstring("Command rename")]          cvsCommandRename        = 8,
00038     [helpstring("Command properties")]      cvsCommandProperties        = 9,
00039     [helpstring("Command options")]         cvsCommandOptions       = 10
00040 } CvsCommand;
00041
00042 [
00043     object,
00044     uuid(10E5359C-F454-11D2-B442-0080C6F9179D),
00045     oleautomation,
00046     helpstring("ICvsCoworker Interface"),
00047     pointer_default(unique)
00048 ]
00049 interface ICvsCoworker : IUnknown
00050 {
00051     [helpstring("method GetLastError")]
00052     HRESULT GetLastError(
00053         [in] int handle,
00054         [out] int* piError
00055         );
00056     [helpstring("method GetErrorMessage")]
00057     HRESULT GetErrorMessage(
00058         [in] int handle,
00059         [in] int iError,
00060         [in] int cbErrorBuffer,
00061         [out, string, size_is(cbErrorBuffer)] char* sErrorBuffer
00062         );
00063     [helpstring("method OpenProject")]
00064     HRESULT OpenProject(
00065         [out] int* pHandle,
00066         [in, string] const char* sUsername,
00067         [in, string] const char* sProjectName,
00068         [in, string] const char* sProjectHome
00069         );
00070     [helpstring("method GetProject")]
00071     HRESULT GetProject(
00072         [out] int* pHandle,
00073         [in] const char* sUsername,
00074         [in] int cbProjectNameBuffer,
00075         [in, out, string, size_is(cbProjectNameBuffer)] char* sProjectName,
00076         [in] int cbProjectHomeBuffer,
00077         [in, out, string, size_is(cbProjectHomeBuffer)] char* sProjectHome,
00078         [in] BOOL bAllowPathChange,
00079         [in] BOOL bAllowNewProject,
00080         [out] BOOL* pbNewProject
00081         );
00082     [helpstring("method UpdateFiles")]
00083     HRESULT UpdateFiles(
00084         [in] int handle,
00085         [in, string] const char* sFilenames,
00086         [in] BOOL bDirectories,
00087         [in] BOOL bRecurse
00088         );
00089     [helpstring("method CheckoutFiles")]
00090     HRESULT CheckoutFiles(
00091         [in] int handle,
00092         [in, string] const char* sFilenames
00093         );
00094     [helpstring("method CheckinFiles")]
00095     HRESULT CheckinFiles(
00096         [in] int handle,
00097         [in, string] const char* sFilenames,
00098         [in] BOOL bKeepCheckedOut
00099         );
00100     [helpstring("method UncheckoutFiles")]
00101     HRESULT UncheckoutFiles(
00102         [in] int handle,
00103         [in, string] const char* sFilenames
00104         );
00105     [helpstring("method AddFiles")]
00106     HRESULT AddFiles(
00107         [in] int handle,
00108         [in, string] const char* sOptionsAndFilenames,
00109         [in, string] const char* sComment
00110         );
00111     [helpstring("method RemoveFiles")]
00112     HRESULT RemoveFiles(
00113         [in] int handle,
00114         [in, string] const char* sFilenames
00115         );
00116     [helpstring("method RenameFile")]
00117     HRESULT RenameFile(
00118         [in] int handle,
00119         [in, string] const char* sOldFilename,
00120         [in, string] const char* sNewFilename
00121         );
00122     [helpstring("method DiffFile")]
00123     HRESULT DiffFile(
00124         [in] int handle,
00125         [in, string] const char* sFilename,
00126         [in] BOOL bIgnoreCase,
00127         [in] BOOL bIgnoreBlanks
00128         );
00129     [helpstring("method ShowFileHistory")]
00130     HRESULT ShowFileHistory(
00131         [in] int handle,
00132         [in, string] const char* sFilenames
00133         );
00134     [helpstring("method ShowFileProperties")]
00135     HRESULT ShowFileProperties(
00136         [in] int handle,
00137         [in, string] const char* sFilename
00138         );
00139     [helpstring("method ShowUserInterface")]
00140     HRESULT ShowUserInterface(
00141         [in] int handle,
00142         [in, string] const char* sFilenames
00143         );
00144     [helpstring("method HasAdvancedOptionsForCommand")]
00145     HRESULT HasAdvancedOptionsForCommand(
00146         [in] int handle,
00147         [in] CvsCommand command,
00148         [out, retval] BOOL* pbAdvancedOptions
00149         );
00150     [helpstring("method ShowAdvancedOptionsForCommand")]
00151     HRESULT ShowAdvancedOptionsForCommand(
00152         [in] int handle,
00153         [in] CvsCommand command
00154         );
00155     [helpstring("method GetFileChanges")]
00156     HRESULT GetFileChanges(
00157         [in] int handle,
00158         [in] int cbFilenameBuffer,
00159         [out, string, size_is(cbFilenameBuffer)] char* sFilenameBuffer);
00160     [helpstring("method GetFilesToAdd")]
00161     HRESULT GetFilesToAdd(
00162         [in] int handle,
00163         [in] int cbFilenamesBuffer,
00164         [out, string, size_is(cbFilenamesBuffer)] char* sFilenamesBuffer
00165         );
00166     [helpstring("method CloseProject")]
00167     HRESULT CloseProject([in] int handle);
00168 };
00169
00170 [
00171     uuid(10E53590-F454-11D2-B442-0080C6F9179D),
00172     version(1.0),
00173     helpstring("CVS_Coworker 1.0 Type Library")
00174 ]
00175 library CVS_COWORKERLib
00176 {
00177     importlib("stdole32.tlb");
00178     importlib("stdole2.tlb");
00179
00180     [
00181         uuid(10E5359D-F454-11D2-B442-0080C6F9179D),
00182         helpstring("CvsCoworker Class")
00183     ]
00184     coclass CvsCoworker
00185     {
00186         [default] interface ICvsCoworker;
00187     };
00188 };
Generated on Sun Feb 24 01:21:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CVS_Coworker.idl File Reference

WinCvs/CoWorker/CVS_Coworker.idl File Reference

Go to the source code of this file.

Namespaces

namespace | CVS_COWORKERLib

Compounds

interface | ICvsCoworker

Typedefs

typedef enum CvsOption | CvsOption
typedef enum CvsCommand | CvsCommand

Enumerations

enum CvsOption {
cvsOptionCompareContents = 1,
cvsOptionCompareChecksum = 2,
cvsOptionCompareTimestamp = 3
}
enum CvsCommand {
cvsCommandUpdate = 0,
cvsCommandCheckout = 1,
cvsCommandCheckin = 2,
cvsCommandUncheckout = 3,
cvsCommandAdd = 4,
cvsCommandRemove = 5,
cvsCommandDiff = 6,
cvsCommandHistory = 7,
cvsCommandRename = 8,
cvsCommandProperties = 9,
cvsCommandOptions = 10
}

Typedef Documentation

typedef enum CvsCommand CvsCommand

typedef enum CvsOption CvsOption

Enumeration Type Documentation

enum CvsCommand

Enumeration values:
cvsCommandUpdate
cvsCommandCheckout
cvsCommandCheckin
cvsCommandUncheckout
cvsCommandAdd
cvsCommandRemove
cvsCommandDiff
cvsCommandHistory
cvsCommandRename
cvsCommandProperties
cvsCommandOptions

Definition at line 27 of file CVS_Coworker.idl.

00027                 {
00028     // HasAdvancedOptionsForCommand() options
00029     [helpstring("Command update")]          cvsCommandUpdate        = 0,
00030     [helpstring("Command checkout")]        cvsCommandCheckout      = 1,
00031     [helpstring("Command checkin")]         cvsCommandCheckin       = 2,
00032     [helpstring("Command uncheckout")]      cvsCommandUncheckout        = 3,
00033     [helpstring("Command add")]         cvsCommandAdd           = 4,
00034     [helpstring("Command remove")]          cvsCommandRemove        = 5,
00035     [helpstring("Command diff")]            cvsCommandDiff          = 6,
00036     [helpstring("Command history")]         cvsCommandHistory       = 7,
00037     [helpstring("Command rename")]          cvsCommandRename        = 8,
00038     [helpstring("Command properties")]      cvsCommandProperties        = 9,
00039     [helpstring("Command options")]         cvsCommandOptions       = 10
00040 } CvsCommand;

enum CvsOption

Enumeration values:
cvsOptionCompareContents
cvsOptionCompareChecksum
cvsOptionCompareTimestamp

Definition at line 15 of file CVS_Coworker.idl.

00015                {
00016     // IsFileDifferent() options
00017     [helpstring("Compare contents")]        cvsOptionCompareContents    = 1,
00018     [helpstring("Compare checksum")]        cvsOptionCompareChecksum    = 2,
00019     [helpstring("Compare timestamp")]       cvsOptionCompareTimestamp   = 3
00020 } CvsOption;

Generated on Sun Feb 24 01:23:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CVS_Coworker_i.c File Reference

WinCvs/CoWorker/CVS_Coworker_i.c File Reference

Go to the source code of this file.

Compounds

struct | _IID

Typedefs

typedef _IID | IID
typedef IID | CLSID

Variables

const IID | IID_ICvsCoworker = {0x10E5359C,0xF454,0x11D2,{0xB4,0x42,0x00,0x80,0xC6,0xF9,0x17,0x9D}}
const IID | LIBID_CVS_COWORKERLib = {0x10E53590,0xF454,0x11D2,{0xB4,0x42,0x00,0x80,0xC6,0xF9,0x17,0x9D}}
const CLSID | CLSID_CvsCoworker = {0x10E5359D,0xF454,0x11D2,{0xB4,0x42,0x00,0x80,0xC6,0xF9,0x17,0x9D}}

Typedef Documentation

typedef IID CLSID

Definition at line 35 of file CVS_Coworker_i.c.

typedef struct _IID IID

Variable Documentation

const CLSID CLSID_CvsCoworker = {0x10E5359D,0xF454,0x11D2,{0xB4,0x42,0x00,0x80,0xC6,0xF9,0x17,0x9D}}

Definition at line 44 of file CVS_Coworker_i.c.

const IID IID_ICvsCoworker = {0x10E5359C,0xF454,0x11D2,{0xB4,0x42,0x00,0x80,0xC6,0xF9,0x17,0x9D}}

Definition at line 38 of file CVS_Coworker_i.c.

const IID LIBID_CVS_COWORKERLib = {0x10E53590,0xF454,0x11D2,{0xB4,0x42,0x00,0x80,0xC6,0xF9,0x17,0x9D}}

Definition at line 41 of file CVS_Coworker_i.c.

Generated on Sun Feb 24 01:23:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CoWorker/CVS_Coworker_i.c Source File

WinCvs/CoWorker/CVS_Coworker_i.c

Go to the documentation of this file.
00001 /* this file contains the actual definitions of */
00002 /* the IIDs and CLSIDs */
00003
00004 /* link this file in with the server and any clients */
00005
00006
00007 /* File created by MIDL compiler version 5.01.0164 */
00008 /* at Tue May 25 19:23:37 1999
00009  */
00010 /* Compiler settings for cvs_coworker.idl:
00011     Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext
00012     error checks: allocation ref bounds_check enum stub_data
00013 */
00014 //@@MIDL_FILE_HEADING(  )
00015 #ifdef __cplusplus
00016 extern "C"{
00017 #endif
00018
00019
00020 #ifndef __IID_DEFINED__
00021 #define __IID_DEFINED__
00022
00023 typedef struct _IID
00024 {
00025     unsigned long x;
00026     unsigned short s1;
00027     unsigned short s2;
00028     unsigned char  c[8];
00029 } IID;
00030
00031 #endif // __IID_DEFINED__
00032
00033 #ifndef CLSID_DEFINED
00034 #define CLSID_DEFINED
00035 typedef IID CLSID;
00036 #endif // CLSID_DEFINED
00037
00038 const IID IID_ICvsCoworker = {0x10E5359C,0xF454,0x11D2,{0xB4,0x42,0x00,0x80,0xC6,0xF9,0x17,0x9D}};
00039
00040
00041 const IID LIBID_CVS_COWORKERLib = {0x10E53590,0xF454,0x11D2,{0xB4,0x42,0x00,0x80,0xC6,0xF9,0x17,0x9D}};
00042
00043
00044 const CLSID CLSID_CvsCoworker = {0x10E5359D,0xF454,0x11D2,{0xB4,0x42,0x00,0x80,0xC6,0xF9,0x17,0x9D}};
00045
00046
00047 #ifdef __cplusplus
00048 }
00049 #endif
00050
Generated on Sun Feb 24 01:21:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CoWorker/CVS_Coworker_i.h Source File

WinCvs/CoWorker/CVS_Coworker_i.h

Go to the documentation of this file.
00001 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
00002
00003
00004 /* File created by MIDL compiler version 5.01.0164 */
00005 /* at Tue May 25 17:48:18 1999
00006  */
00007 /* Compiler settings for E:\cvsscc\coworker1\CVS_Coworker.idl:
00008     Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
00009     error checks: allocation ref bounds_check enum stub_data
00010 */
00011 //@@MIDL_FILE_HEADING(  )
00012
00013
00014 /* verify that the <rpcndr.h> version is high enough to compile this file*/
00015 #ifndef __REQUIRED_RPCNDR_H_VERSION__
00016 #define __REQUIRED_RPCNDR_H_VERSION__ 440
00017 #endif
00018
00019 #include "rpc.h"
00020 #include "rpcndr.h"
00021
00022 #ifndef __RPCNDR_H_VERSION__
00023 #error this stub requires an updated version of <rpcndr.h>
00024 #endif // __RPCNDR_H_VERSION__
00025
00026 #ifndef COM_NO_WINDOWS_H
00027 #include "windows.h"
00028 #include "ole2.h"
00029 #endif /*COM_NO_WINDOWS_H*/
00030
00031 #ifndef __CVS_Coworker_i_h__
00032 #define __CVS_Coworker_i_h__
00033
00034 #ifdef __cplusplus
00035 extern "C"{
00036 #endif
00037
00038 /* Forward Declarations */
00039
00040 #ifndef __ICvsCoworker_FWD_DEFINED__
00041 #define __ICvsCoworker_FWD_DEFINED__
00042 typedef interface ICvsCoworker ICvsCoworker;
00043 #endif  /* __ICvsCoworker_FWD_DEFINED__ */
00044
00045
00046 #ifndef __CvsCoworker_FWD_DEFINED__
00047 #define __CvsCoworker_FWD_DEFINED__
00048
00049 #ifdef __cplusplus
00050 typedef class CvsCoworker CvsCoworker;
00051 #else
00052 typedef struct CvsCoworker CvsCoworker;
00053 #endif /* __cplusplus */
00054
00055 #endif  /* __CvsCoworker_FWD_DEFINED__ */
00056
00057
00058 /* header files for imported files */
00059 #include "oaidl.h"
00060 #include "ocidl.h"
00061
00062 void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
00063 void __RPC_USER MIDL_user_free( void __RPC_FAR * );
00064
00065 /* interface __MIDL_itf_CVS_Coworker_0000 */
00066 /* [local] */
00067
00068 typedef /* [helpstring][uuid] */
00069 enum CvsOption
00070     {   cvsOptionCompareContents    = 1,
00071     cvsOptionCompareChecksum    = 2,
00072     cvsOptionCompareTimestamp   = 3
00073     }   CvsOption;
00074
00075 typedef /* [helpstring][uuid] */
00076 enum CvsCommand
00077     {   cvsCommandUpdate    = 0,
00078     cvsCommandCheckout  = 1,
00079     cvsCommandCheckin   = 2,
00080     cvsCommandUncheckout    = 3,
00081     cvsCommandAdd   = 4,
00082     cvsCommandRemove    = 5,
00083     cvsCommandDiff  = 6,
00084     cvsCommandHistory   = 7,
00085     cvsCommandRename    = 8,
00086     cvsCommandProperties    = 9,
00087     cvsCommandOptions   = 10
00088     }   CvsCommand;
00089
00090
00091
00092 extern RPC_IF_HANDLE __MIDL_itf_CVS_Coworker_0000_v0_0_c_ifspec;
00093 extern RPC_IF_HANDLE __MIDL_itf_CVS_Coworker_0000_v0_0_s_ifspec;
00094
00095 #ifndef __ICvsCoworker_INTERFACE_DEFINED__
00096 #define __ICvsCoworker_INTERFACE_DEFINED__
00097
00098 /* interface ICvsCoworker */
00099 /* [unique][helpstring][oleautomation][uuid][object] */
00100
00101
00102 EXTERN_C const IID IID_ICvsCoworker;
00103
00104 #if defined(__cplusplus) && !defined(CINTERFACE)
00105
00106     MIDL_INTERFACE("10E5359C-F454-11D2-B442-0080C6F9179D")
00107     ICvsCoworker : public IUnknown
00108     {
00109     public:
00110         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetLastError(
00111             /* [in] */ int handle,
00112             /* [out] */ int __RPC_FAR *piError) = 0;
00113
00114         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetErrorMessage(
00115             /* [in] */ int handle,
00116             /* [in] */ int iError,
00117             /* [in] */ int cbErrorBuffer,
00118             /* [size_is][string][out] */ unsigned char __RPC_FAR *sErrorBuffer) = 0;
00119
00120         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE OpenProject(
00121             /* [out] */ int __RPC_FAR *pHandle,
00122             /* [string][in] */ const unsigned char __RPC_FAR *sUsername,
00123             /* [string][in] */ const unsigned char __RPC_FAR *sProjectName,
00124             /* [string][in] */ const unsigned char __RPC_FAR *sProjectHome) = 0;
00125
00126         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetProject(
00127             /* [out] */ int __RPC_FAR *pHandle,
00128             /* [in] */ const unsigned char __RPC_FAR *sUsername,
00129             /* [in] */ int cbProjectNameBuffer,
00130             /* [size_is][string][out][in] */ unsigned char __RPC_FAR *sProjectName,
00131             /* [in] */ int cbProjectHomeBuffer,
00132             /* [size_is][string][out][in] */ unsigned char __RPC_FAR *sProjectHome,
00133             /* [in] */ BOOL bAllowPathChange,
00134             /* [in] */ BOOL bAllowNewProject,
00135             /* [out] */ BOOL __RPC_FAR *pbNewProject) = 0;
00136
00137         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE UpdateFiles(
00138             /* [in] */ int handle,
00139             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames,
00140             /* [in] */ BOOL bDirectories,
00141             /* [in] */ BOOL bRecurse) = 0;
00142
00143         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CheckoutFiles(
00144             /* [in] */ int handle,
00145             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames) = 0;
00146
00147         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CheckinFiles(
00148             /* [in] */ int handle,
00149             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames,
00150             /* [in] */ BOOL bKeepCheckedOut) = 0;
00151
00152         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE UncheckoutFiles(
00153             /* [in] */ int handle,
00154             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames) = 0;
00155
00156         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AddFiles(
00157             /* [in] */ int handle,
00158             /* [string][in] */ const unsigned char __RPC_FAR *sOptionsAndFilenames,
00159             /* [string][in] */ const unsigned char __RPC_FAR *sComment) = 0;
00160
00161         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RemoveFiles(
00162             /* [in] */ int handle,
00163             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames) = 0;
00164
00165         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RenameFile(
00166             /* [in] */ int handle,
00167             /* [string][in] */ const unsigned char __RPC_FAR *sOldFilename,
00168             /* [string][in] */ const unsigned char __RPC_FAR *sNewFilename) = 0;
00169
00170         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE DiffFile(
00171             /* [in] */ int handle,
00172             /* [string][in] */ const unsigned char __RPC_FAR *sFilename,
00173             /* [in] */ BOOL bIgnoreCase,
00174             /* [in] */ BOOL bIgnoreBlanks) = 0;
00175
00176         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ShowFileHistory(
00177             /* [in] */ int handle,
00178             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames) = 0;
00179
00180         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ShowFileProperties(
00181             /* [in] */ int handle,
00182             /* [string][in] */ const unsigned char __RPC_FAR *sFilename) = 0;
00183
00184         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ShowUserInterface(
00185             /* [in] */ int handle,
00186             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames) = 0;
00187
00188         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE HasAdvancedOptionsForCommand(
00189             /* [in] */ int handle,
00190             /* [in] */ CvsCommand command,
00191             /* [retval][out] */ BOOL __RPC_FAR *pbAdvancedOptions) = 0;
00192
00193         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ShowAdvancedOptionsForCommand(
00194             /* [in] */ int handle,
00195             /* [in] */ CvsCommand command) = 0;
00196
00197         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetFileChanges(
00198             /* [in] */ int handle,
00199             /* [in] */ int cbFilenameBuffer,
00200             /* [size_is][string][out] */ unsigned char __RPC_FAR *sFilenameBuffer) = 0;
00201
00202         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetFilesToAdd(
00203             /* [in] */ int handle,
00204             /* [in] */ int cbFilenamesBuffer,
00205             /* [size_is][string][out] */ unsigned char __RPC_FAR *sFilenamesBuffer) = 0;
00206
00207         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CloseProject(
00208             /* [in] */ int handle) = 0;
00209
00210     };
00211
00212 #else   /* C style interface */
00213
00214     typedef struct ICvsCoworkerVtbl
00215     {
00216         BEGIN_INTERFACE
00217
00218         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
00219             ICvsCoworker __RPC_FAR * This,
00220             /* [in] */ REFIID riid,
00221             /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
00222
00223         ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
00224             ICvsCoworker __RPC_FAR * This);
00225
00226         ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
00227             ICvsCoworker __RPC_FAR * This);
00228
00229         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetLastError )(
00230             ICvsCoworker __RPC_FAR * This,
00231             /* [in] */ int handle,
00232             /* [out] */ int __RPC_FAR *piError);
00233
00234         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetErrorMessage )(
00235             ICvsCoworker __RPC_FAR * This,
00236             /* [in] */ int handle,
00237             /* [in] */ int iError,
00238             /* [in] */ int cbErrorBuffer,
00239             /* [size_is][string][out] */ unsigned char __RPC_FAR *sErrorBuffer);
00240
00241         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *OpenProject )(
00242             ICvsCoworker __RPC_FAR * This,
00243             /* [out] */ int __RPC_FAR *pHandle,
00244             /* [string][in] */ const unsigned char __RPC_FAR *sUsername,
00245             /* [string][in] */ const unsigned char __RPC_FAR *sProjectName,
00246             /* [string][in] */ const unsigned char __RPC_FAR *sProjectHome);
00247
00248         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetProject )(
00249             ICvsCoworker __RPC_FAR * This,
00250             /* [out] */ int __RPC_FAR *pHandle,
00251             /* [in] */ const unsigned char __RPC_FAR *sUsername,
00252             /* [in] */ int cbProjectNameBuffer,
00253             /* [size_is][string][out][in] */ unsigned char __RPC_FAR *sProjectName,
00254             /* [in] */ int cbProjectHomeBuffer,
00255             /* [size_is][string][out][in] */ unsigned char __RPC_FAR *sProjectHome,
00256             /* [in] */ BOOL bAllowPathChange,
00257             /* [in] */ BOOL bAllowNewProject,
00258             /* [out] */ BOOL __RPC_FAR *pbNewProject);
00259
00260         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *UpdateFiles )(
00261             ICvsCoworker __RPC_FAR * This,
00262             /* [in] */ int handle,
00263             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames,
00264             /* [in] */ BOOL bDirectories,
00265             /* [in] */ BOOL bRecurse);
00266
00267         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CheckoutFiles )(
00268             ICvsCoworker __RPC_FAR * This,
00269             /* [in] */ int handle,
00270             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00271
00272         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CheckinFiles )(
00273             ICvsCoworker __RPC_FAR * This,
00274             /* [in] */ int handle,
00275             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames,
00276             /* [in] */ BOOL bKeepCheckedOut);
00277
00278         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *UncheckoutFiles )(
00279             ICvsCoworker __RPC_FAR * This,
00280             /* [in] */ int handle,
00281             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00282
00283         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *AddFiles )(
00284             ICvsCoworker __RPC_FAR * This,
00285             /* [in] */ int handle,
00286             /* [string][in] */ const unsigned char __RPC_FAR *sOptionsAndFilenames,
00287             /* [string][in] */ const unsigned char __RPC_FAR *sComment);
00288
00289         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *RemoveFiles )(
00290             ICvsCoworker __RPC_FAR * This,
00291             /* [in] */ int handle,
00292             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00293
00294         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *RenameFile )(
00295             ICvsCoworker __RPC_FAR * This,
00296             /* [in] */ int handle,
00297             /* [string][in] */ const unsigned char __RPC_FAR *sOldFilename,
00298             /* [string][in] */ const unsigned char __RPC_FAR *sNewFilename);
00299
00300         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *DiffFile )(
00301             ICvsCoworker __RPC_FAR * This,
00302             /* [in] */ int handle,
00303             /* [string][in] */ const unsigned char __RPC_FAR *sFilename,
00304             /* [in] */ BOOL bIgnoreCase,
00305             /* [in] */ BOOL bIgnoreBlanks);
00306
00307         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *ShowFileHistory )(
00308             ICvsCoworker __RPC_FAR * This,
00309             /* [in] */ int handle,
00310             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00311
00312         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *ShowFileProperties )(
00313             ICvsCoworker __RPC_FAR * This,
00314             /* [in] */ int handle,
00315             /* [string][in] */ const unsigned char __RPC_FAR *sFilename);
00316
00317         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *ShowUserInterface )(
00318             ICvsCoworker __RPC_FAR * This,
00319             /* [in] */ int handle,
00320             /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00321
00322         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *HasAdvancedOptionsForCommand )(
00323             ICvsCoworker __RPC_FAR * This,
00324             /* [in] */ int handle,
00325             /* [in] */ CvsCommand command,
00326             /* [retval][out] */ BOOL __RPC_FAR *pbAdvancedOptions);
00327
00328         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *ShowAdvancedOptionsForCommand )(
00329             ICvsCoworker __RPC_FAR * This,
00330             /* [in] */ int handle,
00331             /* [in] */ CvsCommand command);
00332
00333         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetFileChanges )(
00334             ICvsCoworker __RPC_FAR * This,
00335             /* [in] */ int handle,
00336             /* [in] */ int cbFilenameBuffer,
00337             /* [size_is][string][out] */ unsigned char __RPC_FAR *sFilenameBuffer);
00338
00339         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetFilesToAdd )(
00340             ICvsCoworker __RPC_FAR * This,
00341             /* [in] */ int handle,
00342             /* [in] */ int cbFilenamesBuffer,
00343             /* [size_is][string][out] */ unsigned char __RPC_FAR *sFilenamesBuffer);
00344
00345         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CloseProject )(
00346             ICvsCoworker __RPC_FAR * This,
00347             /* [in] */ int handle);
00348
00349         END_INTERFACE
00350     } ICvsCoworkerVtbl;
00351
00352     interface ICvsCoworker
00353     {
00354         CONST_VTBL struct ICvsCoworkerVtbl __RPC_FAR *lpVtbl;
00355     };
00356
00357
00358
00359 #ifdef COBJMACROS
00360
00361
00362 #define ICvsCoworker_QueryInterface(This,riid,ppvObject)    \
00363     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
00364
00365 #define ICvsCoworker_AddRef(This)   \
00366     (This)->lpVtbl -> AddRef(This)
00367
00368 #define ICvsCoworker_Release(This)  \
00369     (This)->lpVtbl -> Release(This)
00370
00371
00372 #define ICvsCoworker_GetLastError(This,handle,piError)  \
00373     (This)->lpVtbl -> GetLastError(This,handle,piError)
00374
00375 #define ICvsCoworker_GetErrorMessage(This,handle,iError,cbErrorBuffer,sErrorBuffer) \
00376     (This)->lpVtbl -> GetErrorMessage(This,handle,iError,cbErrorBuffer,sErrorBuffer)
00377
00378 #define ICvsCoworker_OpenProject(This,pHandle,sUsername,sProjectName,sProjectHome)  \
00379     (This)->lpVtbl -> OpenProject(This,pHandle,sUsername,sProjectName,sProjectHome)
00380
00381 #define ICvsCoworker_GetProject(This,pHandle,sUsername,cbProjectNameBuffer,sProjectName,cbProjectHomeBuffer,sProjectHome,bAllowPathChange,bAllowNewProject,pbNewProject)    \
00382     (This)->lpVtbl -> GetProject(This,pHandle,sUsername,cbProjectNameBuffer,sProjectName,cbProjectHomeBuffer,sProjectHome,bAllowPathChange,bAllowNewProject,pbNewProject)
00383
00384 #define ICvsCoworker_UpdateFiles(This,handle,sFilenames,bDirectories,bRecurse)  \
00385     (This)->lpVtbl -> UpdateFiles(This,handle,sFilenames,bDirectories,bRecurse)
00386
00387 #define ICvsCoworker_CheckoutFiles(This,handle,sFilenames)  \
00388     (This)->lpVtbl -> CheckoutFiles(This,handle,sFilenames)
00389
00390 #define ICvsCoworker_CheckinFiles(This,handle,sFilenames,bKeepCheckedOut)   \
00391     (This)->lpVtbl -> CheckinFiles(This,handle,sFilenames,bKeepCheckedOut)
00392
00393 #define ICvsCoworker_UncheckoutFiles(This,handle,sFilenames)    \
00394     (This)->lpVtbl -> UncheckoutFiles(This,handle,sFilenames)
00395
00396 #define ICvsCoworker_AddFiles(This,handle,sOptionsAndFilenames,sComment)    \
00397     (This)->lpVtbl -> AddFiles(This,handle,sOptionsAndFilenames,sComment)
00398
00399 #define ICvsCoworker_RemoveFiles(This,handle,sFilenames)    \
00400     (This)->lpVtbl -> RemoveFiles(This,handle,sFilenames)
00401
00402 #define ICvsCoworker_RenameFile(This,handle,sOldFilename,sNewFilename)  \
00403     (This)->lpVtbl -> RenameFile(This,handle,sOldFilename,sNewFilename)
00404
00405 #define ICvsCoworker_DiffFile(This,handle,sFilename,bIgnoreCase,bIgnoreBlanks)  \
00406     (This)->lpVtbl -> DiffFile(This,handle,sFilename,bIgnoreCase,bIgnoreBlanks)
00407
00408 #define ICvsCoworker_ShowFileHistory(This,handle,sFilenames)    \
00409     (This)->lpVtbl -> ShowFileHistory(This,handle,sFilenames)
00410
00411 #define ICvsCoworker_ShowFileProperties(This,handle,sFilename)  \
00412     (This)->lpVtbl -> ShowFileProperties(This,handle,sFilename)
00413
00414 #define ICvsCoworker_ShowUserInterface(This,handle,sFilenames)  \
00415     (This)->lpVtbl -> ShowUserInterface(This,handle,sFilenames)
00416
00417 #define ICvsCoworker_HasAdvancedOptionsForCommand(This,handle,command,pbAdvancedOptions)    \
00418     (This)->lpVtbl -> HasAdvancedOptionsForCommand(This,handle,command,pbAdvancedOptions)
00419
00420 #define ICvsCoworker_ShowAdvancedOptionsForCommand(This,handle,command) \
00421     (This)->lpVtbl -> ShowAdvancedOptionsForCommand(This,handle,command)
00422
00423 #define ICvsCoworker_GetFileChanges(This,handle,cbFilenameBuffer,sFilenameBuffer)   \
00424     (This)->lpVtbl -> GetFileChanges(This,handle,cbFilenameBuffer,sFilenameBuffer)
00425
00426 #define ICvsCoworker_GetFilesToAdd(This,handle,cbFilenamesBuffer,sFilenamesBuffer)  \
00427     (This)->lpVtbl -> GetFilesToAdd(This,handle,cbFilenamesBuffer,sFilenamesBuffer)
00428
00429 #define ICvsCoworker_CloseProject(This,handle)  \
00430     (This)->lpVtbl -> CloseProject(This,handle)
00431
00432 #endif /* COBJMACROS */
00433
00434
00435 #endif  /* C style interface */
00436
00437
00438
00439 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetLastError_Proxy(
00440     ICvsCoworker __RPC_FAR * This,
00441     /* [in] */ int handle,
00442     /* [out] */ int __RPC_FAR *piError);
00443
00444
00445 void __RPC_STUB ICvsCoworker_GetLastError_Stub(
00446     IRpcStubBuffer *This,
00447     IRpcChannelBuffer *_pRpcChannelBuffer,
00448     PRPC_MESSAGE _pRpcMessage,
00449     DWORD *_pdwStubPhase);
00450
00451
00452 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetErrorMessage_Proxy(
00453     ICvsCoworker __RPC_FAR * This,
00454     /* [in] */ int handle,
00455     /* [in] */ int iError,
00456     /* [in] */ int cbErrorBuffer,
00457     /* [size_is][string][out] */ unsigned char __RPC_FAR *sErrorBuffer);
00458
00459
00460 void __RPC_STUB ICvsCoworker_GetErrorMessage_Stub(
00461     IRpcStubBuffer *This,
00462     IRpcChannelBuffer *_pRpcChannelBuffer,
00463     PRPC_MESSAGE _pRpcMessage,
00464     DWORD *_pdwStubPhase);
00465
00466
00467 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_OpenProject_Proxy(
00468     ICvsCoworker __RPC_FAR * This,
00469     /* [out] */ int __RPC_FAR *pHandle,
00470     /* [string][in] */ const unsigned char __RPC_FAR *sUsername,
00471     /* [string][in] */ const unsigned char __RPC_FAR *sProjectName,
00472     /* [string][in] */ const unsigned char __RPC_FAR *sProjectHome);
00473
00474
00475 void __RPC_STUB ICvsCoworker_OpenProject_Stub(
00476     IRpcStubBuffer *This,
00477     IRpcChannelBuffer *_pRpcChannelBuffer,
00478     PRPC_MESSAGE _pRpcMessage,
00479     DWORD *_pdwStubPhase);
00480
00481
00482 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetProject_Proxy(
00483     ICvsCoworker __RPC_FAR * This,
00484     /* [out] */ int __RPC_FAR *pHandle,
00485     /* [in] */ const unsigned char __RPC_FAR *sUsername,
00486     /* [in] */ int cbProjectNameBuffer,
00487     /* [size_is][string][out][in] */ unsigned char __RPC_FAR *sProjectName,
00488     /* [in] */ int cbProjectHomeBuffer,
00489     /* [size_is][string][out][in] */ unsigned char __RPC_FAR *sProjectHome,
00490     /* [in] */ BOOL bAllowPathChange,
00491     /* [in] */ BOOL bAllowNewProject,
00492     /* [out] */ BOOL __RPC_FAR *pbNewProject);
00493
00494
00495 void __RPC_STUB ICvsCoworker_GetProject_Stub(
00496     IRpcStubBuffer *This,
00497     IRpcChannelBuffer *_pRpcChannelBuffer,
00498     PRPC_MESSAGE _pRpcMessage,
00499     DWORD *_pdwStubPhase);
00500
00501
00502 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_UpdateFiles_Proxy(
00503     ICvsCoworker __RPC_FAR * This,
00504     /* [in] */ int handle,
00505     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames,
00506     /* [in] */ BOOL bDirectories,
00507     /* [in] */ BOOL bRecurse);
00508
00509
00510 void __RPC_STUB ICvsCoworker_UpdateFiles_Stub(
00511     IRpcStubBuffer *This,
00512     IRpcChannelBuffer *_pRpcChannelBuffer,
00513     PRPC_MESSAGE _pRpcMessage,
00514     DWORD *_pdwStubPhase);
00515
00516
00517 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckoutFiles_Proxy(
00518     ICvsCoworker __RPC_FAR * This,
00519     /* [in] */ int handle,
00520     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00521
00522
00523 void __RPC_STUB ICvsCoworker_CheckoutFiles_Stub(
00524     IRpcStubBuffer *This,
00525     IRpcChannelBuffer *_pRpcChannelBuffer,
00526     PRPC_MESSAGE _pRpcMessage,
00527     DWORD *_pdwStubPhase);
00528
00529
00530 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckinFiles_Proxy(
00531     ICvsCoworker __RPC_FAR * This,
00532     /* [in] */ int handle,
00533     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames,
00534     /* [in] */ BOOL bKeepCheckedOut);
00535
00536
00537 void __RPC_STUB ICvsCoworker_CheckinFiles_Stub(
00538     IRpcStubBuffer *This,
00539     IRpcChannelBuffer *_pRpcChannelBuffer,
00540     PRPC_MESSAGE _pRpcMessage,
00541     DWORD *_pdwStubPhase);
00542
00543
00544 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_UncheckoutFiles_Proxy(
00545     ICvsCoworker __RPC_FAR * This,
00546     /* [in] */ int handle,
00547     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00548
00549
00550 void __RPC_STUB ICvsCoworker_UncheckoutFiles_Stub(
00551     IRpcStubBuffer *This,
00552     IRpcChannelBuffer *_pRpcChannelBuffer,
00553     PRPC_MESSAGE _pRpcMessage,
00554     DWORD *_pdwStubPhase);
00555
00556
00557 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_AddFiles_Proxy(
00558     ICvsCoworker __RPC_FAR * This,
00559     /* [in] */ int handle,
00560     /* [string][in] */ const unsigned char __RPC_FAR *sOptionsAndFilenames,
00561     /* [string][in] */ const unsigned char __RPC_FAR *sComment);
00562
00563
00564 void __RPC_STUB ICvsCoworker_AddFiles_Stub(
00565     IRpcStubBuffer *This,
00566     IRpcChannelBuffer *_pRpcChannelBuffer,
00567     PRPC_MESSAGE _pRpcMessage,
00568     DWORD *_pdwStubPhase);
00569
00570
00571 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_RemoveFiles_Proxy(
00572     ICvsCoworker __RPC_FAR * This,
00573     /* [in] */ int handle,
00574     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00575
00576
00577 void __RPC_STUB ICvsCoworker_RemoveFiles_Stub(
00578     IRpcStubBuffer *This,
00579     IRpcChannelBuffer *_pRpcChannelBuffer,
00580     PRPC_MESSAGE _pRpcMessage,
00581     DWORD *_pdwStubPhase);
00582
00583
00584 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_RenameFile_Proxy(
00585     ICvsCoworker __RPC_FAR * This,
00586     /* [in] */ int handle,
00587     /* [string][in] */ const unsigned char __RPC_FAR *sOldFilename,
00588     /* [string][in] */ const unsigned char __RPC_FAR *sNewFilename);
00589
00590
00591 void __RPC_STUB ICvsCoworker_RenameFile_Stub(
00592     IRpcStubBuffer *This,
00593     IRpcChannelBuffer *_pRpcChannelBuffer,
00594     PRPC_MESSAGE _pRpcMessage,
00595     DWORD *_pdwStubPhase);
00596
00597
00598 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_DiffFile_Proxy(
00599     ICvsCoworker __RPC_FAR * This,
00600     /* [in] */ int handle,
00601     /* [string][in] */ const unsigned char __RPC_FAR *sFilename,
00602     /* [in] */ BOOL bIgnoreCase,
00603     /* [in] */ BOOL bIgnoreBlanks);
00604
00605
00606 void __RPC_STUB ICvsCoworker_DiffFile_Stub(
00607     IRpcStubBuffer *This,
00608     IRpcChannelBuffer *_pRpcChannelBuffer,
00609     PRPC_MESSAGE _pRpcMessage,
00610     DWORD *_pdwStubPhase);
00611
00612
00613 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileHistory_Proxy(
00614     ICvsCoworker __RPC_FAR * This,
00615     /* [in] */ int handle,
00616     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00617
00618
00619 void __RPC_STUB ICvsCoworker_ShowFileHistory_Stub(
00620     IRpcStubBuffer *This,
00621     IRpcChannelBuffer *_pRpcChannelBuffer,
00622     PRPC_MESSAGE _pRpcMessage,
00623     DWORD *_pdwStubPhase);
00624
00625
00626 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileProperties_Proxy(
00627     ICvsCoworker __RPC_FAR * This,
00628     /* [in] */ int handle,
00629     /* [string][in] */ const unsigned char __RPC_FAR *sFilename);
00630
00631
00632 void __RPC_STUB ICvsCoworker_ShowFileProperties_Stub(
00633     IRpcStubBuffer *This,
00634     IRpcChannelBuffer *_pRpcChannelBuffer,
00635     PRPC_MESSAGE _pRpcMessage,
00636     DWORD *_pdwStubPhase);
00637
00638
00639 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowUserInterface_Proxy(
00640     ICvsCoworker __RPC_FAR * This,
00641     /* [in] */ int handle,
00642     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames);
00643
00644
00645 void __RPC_STUB ICvsCoworker_ShowUserInterface_Stub(
00646     IRpcStubBuffer *This,
00647     IRpcChannelBuffer *_pRpcChannelBuffer,
00648     PRPC_MESSAGE _pRpcMessage,
00649     DWORD *_pdwStubPhase);
00650
00651
00652 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_HasAdvancedOptionsForCommand_Proxy(
00653     ICvsCoworker __RPC_FAR * This,
00654     /* [in] */ int handle,
00655     /* [in] */ CvsCommand command,
00656     /* [retval][out] */ BOOL __RPC_FAR *pbAdvancedOptions);
00657
00658
00659 void __RPC_STUB ICvsCoworker_HasAdvancedOptionsForCommand_Stub(
00660     IRpcStubBuffer *This,
00661     IRpcChannelBuffer *_pRpcChannelBuffer,
00662     PRPC_MESSAGE _pRpcMessage,
00663     DWORD *_pdwStubPhase);
00664
00665
00666 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy(
00667     ICvsCoworker __RPC_FAR * This,
00668     /* [in] */ int handle,
00669     /* [in] */ CvsCommand command);
00670
00671
00672 void __RPC_STUB ICvsCoworker_ShowAdvancedOptionsForCommand_Stub(
00673     IRpcStubBuffer *This,
00674     IRpcChannelBuffer *_pRpcChannelBuffer,
00675     PRPC_MESSAGE _pRpcMessage,
00676     DWORD *_pdwStubPhase);
00677
00678
00679 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFileChanges_Proxy(
00680     ICvsCoworker __RPC_FAR * This,
00681     /* [in] */ int handle,
00682     /* [in] */ int cbFilenameBuffer,
00683     /* [size_is][string][out] */ unsigned char __RPC_FAR *sFilenameBuffer);
00684
00685
00686 void __RPC_STUB ICvsCoworker_GetFileChanges_Stub(
00687     IRpcStubBuffer *This,
00688     IRpcChannelBuffer *_pRpcChannelBuffer,
00689     PRPC_MESSAGE _pRpcMessage,
00690     DWORD *_pdwStubPhase);
00691
00692
00693 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFilesToAdd_Proxy(
00694     ICvsCoworker __RPC_FAR * This,
00695     /* [in] */ int handle,
00696     /* [in] */ int cbFilenamesBuffer,
00697     /* [size_is][string][out] */ unsigned char __RPC_FAR *sFilenamesBuffer);
00698
00699
00700 void __RPC_STUB ICvsCoworker_GetFilesToAdd_Stub(
00701     IRpcStubBuffer *This,
00702     IRpcChannelBuffer *_pRpcChannelBuffer,
00703     PRPC_MESSAGE _pRpcMessage,
00704     DWORD *_pdwStubPhase);
00705
00706
00707 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_CloseProject_Proxy(
00708     ICvsCoworker __RPC_FAR * This,
00709     /* [in] */ int handle);
00710
00711
00712 void __RPC_STUB ICvsCoworker_CloseProject_Stub(
00713     IRpcStubBuffer *This,
00714     IRpcChannelBuffer *_pRpcChannelBuffer,
00715     PRPC_MESSAGE _pRpcMessage,
00716     DWORD *_pdwStubPhase);
00717
00718
00719
00720 #endif  /* __ICvsCoworker_INTERFACE_DEFINED__ */
00721
00722
00723
00724 #ifndef __CVS_COWORKERLib_LIBRARY_DEFINED__
00725 #define __CVS_COWORKERLib_LIBRARY_DEFINED__
00726
00727 /* library CVS_COWORKERLib */
00728 /* [helpstring][version][uuid] */
00729
00730
00731 EXTERN_C const IID LIBID_CVS_COWORKERLib;
00732
00733 EXTERN_C const CLSID CLSID_CvsCoworker;
00734
00735 #ifdef __cplusplus
00736
00737 class DECLSPEC_UUID("10E5359D-F454-11D2-B442-0080C6F9179D")
00738 CvsCoworker;
00739 #endif
00740 #endif /* __CVS_COWORKERLib_LIBRARY_DEFINED__ */
00741
00742 /* Additional Prototypes for ALL interfaces */
00743
00744 /* end of Additional Prototypes */
00745
00746 #ifdef __cplusplus
00747 }
00748 #endif
00749
00750 #endif
Generated on Sun Feb 24 01:21:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CVS_Coworker_i.h File Reference

WinCvs/CoWorker/CVS_Coworker_i.h File Reference

#include "rpc.h"
#include "rpcndr.h"
#include "windows.h"
#include "ole2.h"
#include "oaidl.h"
#include "ocidl.h"

Include dependency graph for CVS_Coworker_i.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | __REQUIRED_RPCNDR_H_VERSION__ 440

Typedefs

typedef interface ICvsCoworker | ICvsCoworker
typedef CvsCoworker | CvsCoworker
typedef enum CvsOption | CvsOption
typedef enum CvsCommand | CvsCommand

Enumerations

enum CvsOption {
cvsOptionCompareContents = 1,
cvsOptionCompareChecksum = 2,
cvsOptionCompareTimestamp = 3
}
enum CvsCommand {
cvsCommandUpdate = 0,
cvsCommandCheckout = 1,
cvsCommandCheckin = 2,
cvsCommandUncheckout = 3,
cvsCommandAdd = 4,
cvsCommandRemove = 5,
cvsCommandDiff = 6,
cvsCommandHistory = 7,
cvsCommandRename = 8,
cvsCommandProperties = 9,
cvsCommandOptions = 10
}

Functions

void __RPC_FAR *__RPC_USER | MIDL_user_allocate (size_t)
void __RPC_USER | MIDL_user_free (void __RPC_FAR *)
virtual HRESULT STDMETHODCALLTYPE | GetErrorMessage (int handle, int iError, int cbErrorBuffer, unsigned char __RPC_FAR *sErrorBuffer)=0
virtual HRESULT STDMETHODCALLTYPE | OpenProject (int __RPC_FAR *pHandle, const unsigned char __RPC_FAR *sUsername, const unsigned char __RPC_FAR *sProjectName, const unsigned char __RPC_FAR *sProjectHome)=0
virtual HRESULT STDMETHODCALLTYPE | GetProject (int __RPC_FAR *pHandle, const unsigned char __RPC_FAR *sUsername, int cbProjectNameBuffer, unsigned char __RPC_FAR *sProjectName, int cbProjectHomeBuffer, unsigned char __RPC_FAR *sProjectHome, BOOL bAllowPathChange, BOOL bAllowNewProject, BOOL __RPC_FAR *pbNewProject)=0
virtual HRESULT STDMETHODCALLTYPE | UpdateFiles (int handle, const unsigned char __RPC_FAR *sFilenames, BOOL bDirectories, BOOL bRecurse)=0
virtual HRESULT STDMETHODCALLTYPE | CheckoutFiles (int handle, const unsigned char __RPC_FAR *sFilenames)=0
virtual HRESULT STDMETHODCALLTYPE | CheckinFiles (int handle, const unsigned char __RPC_FAR *sFilenames, BOOL bKeepCheckedOut)=0
virtual HRESULT STDMETHODCALLTYPE | UncheckoutFiles (int handle, const unsigned char __RPC_FAR *sFilenames)=0
virtual HRESULT STDMETHODCALLTYPE | AddFiles (int handle, const unsigned char __RPC_FAR *sOptionsAndFilenames, const unsigned char __RPC_FAR *sComment)=0
virtual HRESULT STDMETHODCALLTYPE | RemoveFiles (int handle, const unsigned char __RPC_FAR *sFilenames)=0
virtual HRESULT STDMETHODCALLTYPE | RenameFile (int handle, const unsigned char __RPC_FAR *sOldFilename, const unsigned char __RPC_FAR *sNewFilename)=0
virtual HRESULT STDMETHODCALLTYPE | DiffFile (int handle, const unsigned char __RPC_FAR *sFilename, BOOL bIgnoreCase, BOOL bIgnoreBlanks)=0
virtual HRESULT STDMETHODCALLTYPE | ShowFileHistory (int handle, const unsigned char __RPC_FAR *sFilenames)=0
virtual HRESULT STDMETHODCALLTYPE | ShowFileProperties (int handle, const unsigned char __RPC_FAR *sFilename)=0
virtual HRESULT STDMETHODCALLTYPE | ShowUserInterface (int handle, const unsigned char __RPC_FAR *sFilenames)=0
virtual HRESULT STDMETHODCALLTYPE | HasAdvancedOptionsForCommand (int handle, CvsCommand command, BOOL __RPC_FAR *pbAdvancedOptions)=0
virtual HRESULT STDMETHODCALLTYPE | ShowAdvancedOptionsForCommand (int handle, CvsCommand command)=0
virtual HRESULT STDMETHODCALLTYPE | GetFileChanges (int handle, int cbFilenameBuffer, unsigned char __RPC_FAR *sFilenameBuffer)=0
virtual HRESULT STDMETHODCALLTYPE | GetFilesToAdd (int handle, int cbFilenamesBuffer, unsigned char __RPC_FAR *sFilenamesBuffer)=0
virtual HRESULT STDMETHODCALLTYPE | CloseProject (int handle)=0
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetLastError_Proxy (ICvsCoworker __RPC_FAR *This, int handle, int __RPC_FAR *piError)
void __RPC_STUB | ICvsCoworker_GetLastError_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetErrorMessage_Proxy (ICvsCoworker __RPC_FAR *This, int handle, int iError, int cbErrorBuffer, unsigned char __RPC_FAR *sErrorBuffer)
void __RPC_STUB | ICvsCoworker_GetErrorMessage_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_OpenProject_Proxy (ICvsCoworker __RPC_FAR *This, int __RPC_FAR *pHandle, const unsigned char __RPC_FAR *sUsername, const unsigned char __RPC_FAR *sProjectName, const unsigned char __RPC_FAR *sProjectHome)
void __RPC_STUB | ICvsCoworker_OpenProject_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetProject_Proxy (ICvsCoworker __RPC_FAR *This, int __RPC_FAR *pHandle, const unsigned char __RPC_FAR *sUsername, int cbProjectNameBuffer, unsigned char __RPC_FAR *sProjectName, int cbProjectHomeBuffer, unsigned char __RPC_FAR *sProjectHome, BOOL bAllowPathChange, BOOL bAllowNewProject, BOOL __RPC_FAR *pbNewProject)
void __RPC_STUB | ICvsCoworker_GetProject_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_UpdateFiles_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames, BOOL bDirectories, BOOL bRecurse)
void __RPC_STUB | ICvsCoworker_UpdateFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_CheckoutFiles_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames)
void __RPC_STUB | ICvsCoworker_CheckoutFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_CheckinFiles_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames, BOOL bKeepCheckedOut)
void __RPC_STUB | ICvsCoworker_CheckinFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_UncheckoutFiles_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames)
void __RPC_STUB | ICvsCoworker_UncheckoutFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_AddFiles_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sOptionsAndFilenames, const unsigned char __RPC_FAR *sComment)
void __RPC_STUB | ICvsCoworker_AddFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_RemoveFiles_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames)
void __RPC_STUB | ICvsCoworker_RemoveFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_RenameFile_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sOldFilename, const unsigned char __RPC_FAR *sNewFilename)
void __RPC_STUB | ICvsCoworker_RenameFile_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_DiffFile_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilename, BOOL bIgnoreCase, BOOL bIgnoreBlanks)
void __RPC_STUB | ICvsCoworker_DiffFile_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowFileHistory_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames)
void __RPC_STUB | ICvsCoworker_ShowFileHistory_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowFileProperties_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilename)
void __RPC_STUB | ICvsCoworker_ShowFileProperties_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowUserInterface_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames)
void __RPC_STUB | ICvsCoworker_ShowUserInterface_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_HasAdvancedOptionsForCommand_Proxy (ICvsCoworker __RPC_FAR *This, int handle, CvsCommand command, BOOL __RPC_FAR *pbAdvancedOptions)
void __RPC_STUB | ICvsCoworker_HasAdvancedOptionsForCommand_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy (ICvsCoworker __RPC_FAR *This, int handle, CvsCommand command)
void __RPC_STUB | ICvsCoworker_ShowAdvancedOptionsForCommand_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetFileChanges_Proxy (ICvsCoworker __RPC_FAR *This, int handle, int cbFilenameBuffer, unsigned char __RPC_FAR *sFilenameBuffer)
void __RPC_STUB | ICvsCoworker_GetFileChanges_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetFilesToAdd_Proxy (ICvsCoworker __RPC_FAR *This, int handle, int cbFilenamesBuffer, unsigned char __RPC_FAR *sFilenamesBuffer)
void __RPC_STUB | ICvsCoworker_GetFilesToAdd_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_CloseProject_Proxy (ICvsCoworker __RPC_FAR *This, int handle)
void __RPC_STUB | ICvsCoworker_CloseProject_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
class | DECLSPEC_UUID ("10E5359D-F454-11D2-B442-0080C6F9179D") CvsCoworker

Variables

RPC_IF_HANDLE | __MIDL_itf_CVS_Coworker_0000_v0_0_c_ifspec
RPC_IF_HANDLE | __MIDL_itf_CVS_Coworker_0000_v0_0_s_ifspec
EXTERN_C const IID | IID_ICvsCoworker
ICvsCoworker __pad1__
ICvsCoworker int __RPC_FAR * | piError = 0
EXTERN_C const IID | LIBID_CVS_COWORKERLib
EXTERN_C const CLSID | CLSID_CvsCoworker

Define Documentation

#define __REQUIRED_RPCNDR_H_VERSION__ 440

Definition at line 16 of file CVS_Coworker_i.h.

Typedef Documentation

typedef enum CvsCommand CvsCommand

Referenced by ICvsCoworker_GetErrorMessage_Proxy, ICvsCoworker_GetErrorMessage_Stub, ICvsCoworker_GetProject_Proxy, and ICvsCoworker_GetProject_Stub.

typedef class CvsCoworker CvsCoworker

Definition at line 50 of file CVS_Coworker_i.h.

typedef enum CvsOption CvsOption

typedef interface ICvsCoworker ICvsCoworker

Definition at line 42 of file CVS_Coworker_i.h.

Referenced by ICvsCoworker_GetErrorMessage_Stub, ICvsCoworker_GetProject_Proxy, ICvsCoworker_GetProject_Stub, ICvsCoworker_OpenProject_Proxy, and ICvsCoworker_OpenProject_Stub.

Enumeration Type Documentation

enum CvsCommand

Enumeration values:
cvsCommandUpdate
cvsCommandCheckout
cvsCommandCheckin
cvsCommandUncheckout
cvsCommandAdd
cvsCommandRemove
cvsCommandDiff
cvsCommandHistory
cvsCommandRename
cvsCommandProperties
cvsCommandOptions

Definition at line 76 of file CVS_Coworker_i.h.

00077     {   cvsCommandUpdate    = 0,
00078     cvsCommandCheckout  = 1,
00079     cvsCommandCheckin   = 2,
00080     cvsCommandUncheckout    = 3,
00081     cvsCommandAdd   = 4,
00082     cvsCommandRemove    = 5,
00083     cvsCommandDiff  = 6,
00084     cvsCommandHistory   = 7,
00085     cvsCommandRename    = 8,
00086     cvsCommandProperties    = 9,
00087     cvsCommandOptions   = 10
00088     }   CvsCommand;

enum CvsOption

Enumeration values:
cvsOptionCompareContents
cvsOptionCompareChecksum
cvsOptionCompareTimestamp

Definition at line 69 of file CVS_Coworker_i.h.

00070     {   cvsOptionCompareContents    = 1,
00071     cvsOptionCompareChecksum    = 2,
00072     cvsOptionCompareTimestamp   = 3
00073     }   CvsOption;

Function Documentation

virtual HRESULT STDMETHODCALLTYPE AddFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sOptionsAndFilenames,
 |  | const unsigned char __RPC_FAR * | sComment
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE CheckinFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames,
 |  | BOOL | bKeepCheckedOut
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE CheckoutFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE CloseProject ( int handle ) [pure virtual]

Referenced by ICvsCoworker_OpenProject_Proxy.

class DECLSPEC_UUID ( "10E5359D-F454-11D2-B442-0080C6F9179D" )

virtual HRESULT STDMETHODCALLTYPE DiffFile | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilename,
 |  | BOOL | bIgnoreCase,
 |  | BOOL | bIgnoreBlanks
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE GetErrorMessage | ( | int | handle,
 |  | int | iError,
 |  | int | cbErrorBuffer,
 |  | unsigned char __RPC_FAR * | sErrorBuffer
 | ) | [pure virtual]

virtual HRESULT STDMETHODCALLTYPE GetFileChanges | ( | int | handle,
 |  | int | cbFilenameBuffer,
 |  | unsigned char __RPC_FAR * | sFilenameBuffer
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE GetFilesToAdd | ( | int | handle,
 |  | int | cbFilenamesBuffer,
 |  | unsigned char __RPC_FAR * | sFilenamesBuffer
 | ) | [pure virtual]

Referenced by ICvsCoworker_OpenProject_Proxy.

virtual HRESULT STDMETHODCALLTYPE GetProject | ( | int __RPC_FAR * | pHandle,
 |  | const unsigned char __RPC_FAR * | sUsername,
 |  | int | cbProjectNameBuffer,
 |  | unsigned char __RPC_FAR * | sProjectName,
 |  | int | cbProjectHomeBuffer,
 |  | unsigned char __RPC_FAR * | sProjectHome,
 |  | BOOL | bAllowPathChange,
 |  | BOOL | bAllowNewProject,
 |  | BOOL __RPC_FAR * | pbNewProject
 | ) | [pure virtual]

virtual HRESULT STDMETHODCALLTYPE HasAdvancedOptionsForCommand | ( | int | handle,
 |  | CvsCommand | command,
 |  | BOOL __RPC_FAR * | pbAdvancedOptions
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

HRESULT STDMETHODCALLTYPE ICvsCoworker_AddFiles_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sOptionsAndFilenames,
 |  | const unsigned char __RPC_FAR * | sComment
 | ) |

Definition at line 1306 of file CVS_Coworker_p.c.

01311 {
01312
01313     HRESULT _RetVal;
01314
01315     RPC_MESSAGE _RpcMessage;
01316
01317     MIDL_STUB_MESSAGE _StubMsg;
01318
01319     RpcTryExcept
01320         {
01321         NdrProxyInitialize(
01322                       ( void __RPC_FAR *  )This,
01323                       ( PRPC_MESSAGE  )&_RpcMessage,
01324                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01325                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01326                       11);
01327
01328
01329
01330         if(!sOptionsAndFilenames)
01331             {
01332             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01333             }
01334         if(!sComment)
01335             {
01336             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01337             }
01338         RpcTryFinally
01339             {
01340
01341             _StubMsg.BufferLength = 4U + 12U + 13U;
01342             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01343                                            (unsigned char __RPC_FAR *)sOptionsAndFilenames,
01344                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01345
01346             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01347                                            (unsigned char __RPC_FAR *)sComment,
01348                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01349
01350             NdrProxyGetBuffer(This, &_StubMsg);
01351             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01352
01353             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01354                                          (unsigned char __RPC_FAR *)sOptionsAndFilenames,
01355                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01356
01357             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01358                                          (unsigned char __RPC_FAR *)sComment,
01359                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01360
01361             NdrProxySendReceive(This, &_StubMsg);
01362
01363             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01364                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01365
01366             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01367
01368             }
01369         RpcFinally
01370             {
01371             NdrProxyFreeBuffer(This, &_StubMsg);
01372
01373             }
01374         RpcEndFinally
01375
01376         }
01377     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01378         {
01379         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01380         }
01381     RpcEndExcept
01382     return _RetVal;
01383 }

void __RPC_STUB ICvsCoworker_AddFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1385 of file CVS_Coworker_p.c.

01390 {
01391     HRESULT _RetVal;
01392     MIDL_STUB_MESSAGE _StubMsg;
01393     int handle;
01394     const unsigned char __RPC_FAR *sComment;
01395     const unsigned char __RPC_FAR *sOptionsAndFilenames;
01396
01397 NdrStubInitialize(
01398                      _pRpcMessage,
01399                      &_StubMsg,
01400                      &Object_StubDesc,
01401                      _pRpcChannelBuffer);
01402     ( unsigned char __RPC_FAR * )sOptionsAndFilenames = 0;
01403     ( unsigned char __RPC_FAR * )sComment = 0;
01404     RpcTryFinally
01405         {
01406         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01407             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01408
01409         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01410
01411         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01412                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sOptionsAndFilenames,
01413                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01414                                        (unsigned char)0 );
01415
01416         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01417                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sComment,
01418                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01419                                        (unsigned char)0 );
01420
01421
01422         *_pdwStubPhase = STUB_CALL_SERVER;
01423         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> AddFiles(
01424             (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01425             handle,
01426             sOptionsAndFilenames,
01427             sComment);
01428
01429         *_pdwStubPhase = STUB_MARSHAL;
01430
01431         _StubMsg.BufferLength = 4U;
01432         _StubMsg.BufferLength += 16;
01433
01434         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01435         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01436
01437         }
01438     RpcFinally
01439         {
01440         }
01441     RpcEndFinally
01442     _pRpcMessage->BufferLength =
01443         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01444
01445 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckinFiles_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames,
 |  | BOOL | bKeepCheckedOut
 | ) |

Definition at line 1055 of file CVS_Coworker_p.c.

01060 {
01061
01062     HRESULT _RetVal;
01063
01064     RPC_MESSAGE _RpcMessage;
01065
01066     MIDL_STUB_MESSAGE _StubMsg;
01067
01068     RpcTryExcept
01069         {
01070         NdrProxyInitialize(
01071                       ( void __RPC_FAR *  )This,
01072                       ( PRPC_MESSAGE  )&_RpcMessage,
01073                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01074                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01075                       9);
01076
01077
01078
01079         if(!sFilenames)
01080             {
01081             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01082             }
01083         RpcTryFinally
01084             {
01085
01086             _StubMsg.BufferLength = 4U + 12U + 11U;
01087             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01088                                            (unsigned char __RPC_FAR *)sFilenames,
01089                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01090
01091             NdrProxyGetBuffer(This, &_StubMsg);
01092             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01093
01094             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01095                                          (unsigned char __RPC_FAR *)sFilenames,
01096                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01097
01098             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01099             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bKeepCheckedOut;
01100
01101             NdrProxySendReceive(This, &_StubMsg);
01102
01103             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01104                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] );
01105
01106             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01107
01108             }
01109         RpcFinally
01110             {
01111             NdrProxyFreeBuffer(This, &_StubMsg);
01112
01113             }
01114         RpcEndFinally
01115
01116         }
01117     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01118         {
01119         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01120         }
01121     RpcEndExcept
01122     return _RetVal;
01123 }

void __RPC_STUB ICvsCoworker_CheckinFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1125 of file CVS_Coworker_p.c.

01130 {
01131     HRESULT _RetVal;
01132     MIDL_STUB_MESSAGE _StubMsg;
01133     BOOL bKeepCheckedOut;
01134     int handle;
01135     const unsigned char __RPC_FAR *sFilenames;
01136
01137 NdrStubInitialize(
01138                      _pRpcMessage,
01139                      &_StubMsg,
01140                      &Object_StubDesc,
01141                      _pRpcChannelBuffer);
01142     ( unsigned char __RPC_FAR * )sFilenames = 0;
01143     RpcTryFinally
01144         {
01145         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01146             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] );
01147
01148         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01149
01150         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01151                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01152                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01153                                        (unsigned char)0 );
01154
01155         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01156         bKeepCheckedOut = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
01157
01158
01159         *_pdwStubPhase = STUB_CALL_SERVER;
01160         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CheckinFiles(
01161                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01162                 handle,
01163                 sFilenames,
01164                 bKeepCheckedOut);
01165
01166         *_pdwStubPhase = STUB_MARSHAL;
01167
01168         _StubMsg.BufferLength = 4U;
01169         _StubMsg.BufferLength += 16;
01170
01171         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01172         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01173
01174         }
01175     RpcFinally
01176         {
01177         }
01178     RpcEndFinally
01179     _pRpcMessage->BufferLength =
01180         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01181
01182 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckoutFiles_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) |

Definition at line 934 of file CVS_Coworker_p.c.

00938 {
00939
00940     HRESULT _RetVal;
00941
00942     RPC_MESSAGE _RpcMessage;
00943
00944     MIDL_STUB_MESSAGE _StubMsg;
00945
00946     RpcTryExcept
00947         {
00948         NdrProxyInitialize(
00949                       ( void __RPC_FAR *  )This,
00950                       ( PRPC_MESSAGE  )&_RpcMessage,
00951                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00952                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00953                       8);
00954
00955
00956
00957         if(!sFilenames)
00958             {
00959             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00960             }
00961         RpcTryFinally
00962             {
00963
00964             _StubMsg.BufferLength = 4U + 12U;
00965             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00966                                            (unsigned char __RPC_FAR *)sFilenames,
00967                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00968
00969             NdrProxyGetBuffer(This, &_StubMsg);
00970             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
00971
00972             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00973                                          (unsigned char __RPC_FAR *)sFilenames,
00974                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00975
00976             NdrProxySendReceive(This, &_StubMsg);
00977
00978             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00979                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
00980
00981             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00982
00983             }
00984         RpcFinally
00985             {
00986             NdrProxyFreeBuffer(This, &_StubMsg);
00987
00988             }
00989         RpcEndFinally
00990
00991         }
00992     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00993         {
00994         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00995         }
00996     RpcEndExcept
00997     return _RetVal;
00998 }

void __RPC_STUB ICvsCoworker_CheckoutFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1000 of file CVS_Coworker_p.c.

01005 {
01006     HRESULT _RetVal;
01007     MIDL_STUB_MESSAGE _StubMsg;
01008     int handle;
01009     const unsigned char __RPC_FAR *sFilenames;
01010
01011 NdrStubInitialize(
01012                      _pRpcMessage,
01013                      &_StubMsg,
01014                      &Object_StubDesc,
01015                      _pRpcChannelBuffer);
01016     ( unsigned char __RPC_FAR * )sFilenames = 0;
01017     RpcTryFinally
01018         {
01019         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01020             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01021
01022         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01023
01024         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01025                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01026                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01027                                        (unsigned char)0 );
01028
01029
01030         *_pdwStubPhase = STUB_CALL_SERVER;
01031         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CheckoutFiles(
01032                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01033                  handle,
01034                  sFilenames);
01035
01036         *_pdwStubPhase = STUB_MARSHAL;
01037
01038         _StubMsg.BufferLength = 4U;
01039         _StubMsg.BufferLength += 16;
01040
01041         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01042         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01043
01044         }
01045     RpcFinally
01046         {
01047         }
01048     RpcEndFinally
01049     _pRpcMessage->BufferLength =
01050         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01051
01052 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_CloseProject_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle
 | ) |

Definition at line 2749 of file CVS_Coworker_p.c.

02752 {
02753
02754     HRESULT _RetVal;
02755
02756     RPC_MESSAGE _RpcMessage;
02757
02758     MIDL_STUB_MESSAGE _StubMsg;
02759
02760     RpcTryExcept
02761         {
02762         NdrProxyInitialize(
02763                       ( void __RPC_FAR *  )This,
02764                       ( PRPC_MESSAGE  )&_RpcMessage,
02765                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02766                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02767                       22);
02768
02769
02770
02771         RpcTryFinally
02772             {
02773
02774             _StubMsg.BufferLength = 4U;
02775             NdrProxyGetBuffer(This, &_StubMsg);
02776             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02777
02778             NdrProxySendReceive(This, &_StubMsg);
02779
02780             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02781                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[146] );
02782
02783             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02784
02785             }
02786         RpcFinally
02787             {
02788             NdrProxyFreeBuffer(This, &_StubMsg);
02789
02790             }
02791         RpcEndFinally
02792
02793         }
02794     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02795         {
02796         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02797         }
02798     RpcEndExcept
02799     return _RetVal;
02800 }

void __RPC_STUB ICvsCoworker_CloseProject_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2802 of file CVS_Coworker_p.c.

02807 {
02808     HRESULT _RetVal;
02809     MIDL_STUB_MESSAGE _StubMsg;
02810     int handle;
02811
02812 NdrStubInitialize(
02813                      _pRpcMessage,
02814                      &_StubMsg,
02815                      &Object_StubDesc,
02816                      _pRpcChannelBuffer);
02817     RpcTryFinally
02818         {
02819         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02820             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[146] );
02821
02822         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02823
02824
02825         *_pdwStubPhase = STUB_CALL_SERVER;
02826         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CloseProject((ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,handle);
02827
02828         *_pdwStubPhase = STUB_MARSHAL;
02829
02830         _StubMsg.BufferLength = 4U;
02831         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02832         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02833
02834         }
02835     RpcFinally
02836         {
02837         }
02838     RpcEndFinally
02839     _pRpcMessage->BufferLength =
02840         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02841
02842 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_DiffFile_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilename,
 |  | BOOL | bIgnoreCase,
 |  | BOOL | bIgnoreBlanks
 | ) |

Definition at line 1711 of file CVS_Coworker_p.c.

01717 {
01718
01719     HRESULT _RetVal;
01720
01721     RPC_MESSAGE _RpcMessage;
01722
01723     MIDL_STUB_MESSAGE _StubMsg;
01724
01725     RpcTryExcept
01726         {
01727         NdrProxyInitialize(
01728                       ( void __RPC_FAR *  )This,
01729                       ( PRPC_MESSAGE  )&_RpcMessage,
01730                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01731                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01732                       14);
01733
01734
01735
01736         if(!sFilename)
01737             {
01738             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01739             }
01740         RpcTryFinally
01741             {
01742
01743             _StubMsg.BufferLength = 4U + 12U + 11U + 7U;
01744             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01745                                            (unsigned char __RPC_FAR *)sFilename,
01746                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01747
01748             NdrProxyGetBuffer(This, &_StubMsg);
01749             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01750
01751             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01752                                          (unsigned char __RPC_FAR *)sFilename,
01753                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01754
01755             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01756             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bIgnoreCase;
01757
01758             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bIgnoreBlanks;
01759
01760             NdrProxySendReceive(This, &_StubMsg);
01761
01762             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01763                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
01764
01765             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01766
01767             }
01768         RpcFinally
01769             {
01770             NdrProxyFreeBuffer(This, &_StubMsg);
01771
01772             }
01773         RpcEndFinally
01774
01775         }
01776     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01777         {
01778         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01779         }
01780     RpcEndExcept
01781     return _RetVal;
01782 }

void __RPC_STUB ICvsCoworker_DiffFile_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1784 of file CVS_Coworker_p.c.

01789 {
01790     HRESULT _RetVal;
01791     MIDL_STUB_MESSAGE _StubMsg;
01792     BOOL bIgnoreBlanks;
01793     BOOL bIgnoreCase;
01794     int handle;
01795     const unsigned char __RPC_FAR *sFilename;
01796
01797 NdrStubInitialize(
01798                      _pRpcMessage,
01799                      &_StubMsg,
01800                      &Object_StubDesc,
01801                      _pRpcChannelBuffer);
01802     ( unsigned char __RPC_FAR * )sFilename = 0;
01803     RpcTryFinally
01804         {
01805         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01806             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
01807
01808         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01809
01810         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01811                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilename,
01812                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01813                                        (unsigned char)0 );
01814
01815         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01816         bIgnoreCase = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
01817
01818         bIgnoreBlanks = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
01819
01820
01821         *_pdwStubPhase = STUB_CALL_SERVER;
01822         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> DiffFile(
01823             (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01824             handle,
01825             sFilename,
01826             bIgnoreCase,
01827             bIgnoreBlanks);
01828
01829         *_pdwStubPhase = STUB_MARSHAL;
01830
01831         _StubMsg.BufferLength = 4U;
01832         _StubMsg.BufferLength += 16;
01833
01834         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01835         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01836
01837         }
01838     RpcFinally
01839         {
01840         }
01841     RpcEndFinally
01842     _pRpcMessage->BufferLength =
01843         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01844
01845 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetErrorMessage_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | int | iError,
 |  | int | cbErrorBuffer,
 |  | unsigned char __RPC_FAR * | sErrorBuffer
 | ) |

Definition at line 181 of file CVS_Coworker_p.c.

References CvsCommand.

00187 {
00188
00189     HRESULT _RetVal;
00190
00191     RPC_MESSAGE _RpcMessage;
00192
00193     MIDL_STUB_MESSAGE _StubMsg;
00194
00195     RpcTryExcept
00196         {
00197         NdrProxyInitialize(
00198                       ( void __RPC_FAR *  )This,
00199                       ( PRPC_MESSAGE  )&_RpcMessage,
00200                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00201                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00202                       4);
00203
00204
00205
00206         if(!sErrorBuffer)
00207             {
00208             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00209             }
00210         RpcTryFinally
00211             {
00212
00213             _StubMsg.BufferLength = 4U + 4U + 4U;
00214             NdrProxyGetBuffer(This, &_StubMsg);
00215             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
00216
00217             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = iError;
00218
00219             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbErrorBuffer;
00220
00221             NdrProxySendReceive(This, &_StubMsg);
00222
00223             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00224                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] );
00225
00226             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00227                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sErrorBuffer,
00228                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10],
00229                                            (unsigned char)0 );
00230
00231             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00232             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00233
00234             }
00235         RpcFinally
00236             {
00237             NdrProxyFreeBuffer(This, &_StubMsg);
00238
00239             }
00240         RpcEndFinally
00241
00242         }
00243     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00244         {
00245         _StubMsg.MaxCount = cbErrorBuffer;
00246
00247         NdrClearOutParameters(
00248                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00249                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[6],
00250                          ( void __RPC_FAR * )sErrorBuffer);
00251         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00252         }
00253     RpcEndExcept
00254     return _RetVal;
00255 }

void __RPC_STUB ICvsCoworker_GetErrorMessage_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 257 of file CVS_Coworker_p.c.

References AddFiles, CheckinFiles, CheckoutFiles, CvsCommand, DiffFile, GetFileChanges, HasAdvancedOptionsForCommand, ICvsCoworker, RemoveFiles, RenameFile, ShowAdvancedOptionsForCommand, ShowFileHistory, ShowFileProperties, ShowUserInterface, UncheckoutFiles, and UpdateFiles.

00262 {
00263     HRESULT _RetVal;
00264     MIDL_STUB_MESSAGE _StubMsg;
00265     int cbErrorBuffer;
00266     int handle;
00267     int iError;
00268     unsigned char __RPC_FAR *sErrorBuffer;
00269
00270 NdrStubInitialize(
00271                      _pRpcMessage,
00272                      &_StubMsg,
00273                      &Object_StubDesc,
00274                      _pRpcChannelBuffer);
00275     ( unsigned char __RPC_FAR * )sErrorBuffer = 0;
00276     RpcTryFinally
00277         {
00278         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00279             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] );
00280
00281         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00282
00283         iError = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00284
00285         cbErrorBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00286
00287         if(cbErrorBuffer * 1 < 0)
00288             {
00289             RpcRaiseException(RPC_X_INVALID_BOUND);
00290             }
00291         sErrorBuffer = NdrAllocate(&_StubMsg,cbErrorBuffer * 1);
00292
00293         *_pdwStubPhase = STUB_CALL_SERVER;
00294         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetErrorMessage(
00295                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00296                    handle,
00297                    iError,
00298                    cbErrorBuffer,
00299                    sErrorBuffer);
00300
00301         *_pdwStubPhase = STUB_MARSHAL;
00302
00303         _StubMsg.BufferLength = 12U + 11U;
00304         _StubMsg.MaxCount = cbErrorBuffer;
00305
00306         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00307                                        (unsigned char __RPC_FAR *)sErrorBuffer,
00308                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10] );
00309
00310         _StubMsg.BufferLength += 16;
00311
00312         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00313         _StubMsg.MaxCount = cbErrorBuffer;
00314
00315         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00316                                      (unsigned char __RPC_FAR *)sErrorBuffer,
00317                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10] );
00318
00319         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00320         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00321
00322         }
00323     RpcFinally
00324         {
00325         _StubMsg.MaxCount = cbErrorBuffer;
00326
00327         NdrPointerFree( &_StubMsg,
00328                         (unsigned char __RPC_FAR *)sErrorBuffer,
00329                         &__MIDL_TypeFormatString.Format[6] );
00330
00331         }
00332     RpcEndFinally
00333     _pRpcMessage->BufferLength =
00334         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00335
00336 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFileChanges_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | int | cbFilenameBuffer,
 |  | unsigned char __RPC_FAR * | sFilenameBuffer
 | ) |

Definition at line 2447 of file CVS_Coworker_p.c.

02452 {
02453
02454     HRESULT _RetVal;
02455
02456     RPC_MESSAGE _RpcMessage;
02457
02458     MIDL_STUB_MESSAGE _StubMsg;
02459
02460     RpcTryExcept
02461         {
02462         NdrProxyInitialize(
02463                       ( void __RPC_FAR *  )This,
02464                       ( PRPC_MESSAGE  )&_RpcMessage,
02465                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02466                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02467                       20);
02468
02469
02470
02471         if(!sFilenameBuffer)
02472             {
02473             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02474             }
02475         RpcTryFinally
02476             {
02477
02478             _StubMsg.BufferLength = 4U + 4U;
02479             NdrProxyGetBuffer(This, &_StubMsg);
02480             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02481
02482             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbFilenameBuffer;
02483
02484             NdrProxySendReceive(This, &_StubMsg);
02485
02486             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02487                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[126] );
02488
02489             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02490                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenameBuffer,
02491                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48],
02492                                            (unsigned char)0 );
02493
02494             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02495             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02496
02497             }
02498         RpcFinally
02499             {
02500             NdrProxyFreeBuffer(This, &_StubMsg);
02501
02502             }
02503         RpcEndFinally
02504
02505         }
02506     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02507         {
02508         _StubMsg.MaxCount = cbFilenameBuffer;
02509
02510         NdrClearOutParameters(
02511                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02512                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[44],
02513                          ( void __RPC_FAR * )sFilenameBuffer);
02514         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02515         }
02516     RpcEndExcept
02517     return _RetVal;
02518 }

void __RPC_STUB ICvsCoworker_GetFileChanges_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2520 of file CVS_Coworker_p.c.

02525 {
02526     HRESULT _RetVal;
02527     MIDL_STUB_MESSAGE _StubMsg;
02528     int cbFilenameBuffer;
02529     int handle;
02530     unsigned char __RPC_FAR *sFilenameBuffer;
02531
02532 NdrStubInitialize(
02533                      _pRpcMessage,
02534                      &_StubMsg,
02535                      &Object_StubDesc,
02536                      _pRpcChannelBuffer);
02537     ( unsigned char __RPC_FAR * )sFilenameBuffer = 0;
02538     RpcTryFinally
02539         {
02540         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02541             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[126] );
02542
02543         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02544
02545         cbFilenameBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02546
02547         if(cbFilenameBuffer * 1 < 0)
02548             {
02549             RpcRaiseException(RPC_X_INVALID_BOUND);
02550             }
02551         sFilenameBuffer = NdrAllocate(&_StubMsg,cbFilenameBuffer * 1);
02552
02553         *_pdwStubPhase = STUB_CALL_SERVER;
02554         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetFileChanges(
02555                   (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02556                   handle,
02557                   cbFilenameBuffer,
02558                   sFilenameBuffer);
02559
02560         *_pdwStubPhase = STUB_MARSHAL;
02561
02562         _StubMsg.BufferLength = 12U + 11U;
02563         _StubMsg.MaxCount = cbFilenameBuffer;
02564
02565         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02566                                        (unsigned char __RPC_FAR *)sFilenameBuffer,
02567                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48] );
02568
02569         _StubMsg.BufferLength += 16;
02570
02571         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02572         _StubMsg.MaxCount = cbFilenameBuffer;
02573
02574         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02575                                      (unsigned char __RPC_FAR *)sFilenameBuffer,
02576                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48] );
02577
02578         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02579         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02580
02581         }
02582     RpcFinally
02583         {
02584         _StubMsg.MaxCount = cbFilenameBuffer;
02585
02586         NdrPointerFree( &_StubMsg,
02587                         (unsigned char __RPC_FAR *)sFilenameBuffer,
02588                         &__MIDL_TypeFormatString.Format[44] );
02589
02590         }
02591     RpcEndFinally
02592     _pRpcMessage->BufferLength =
02593         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02594
02595 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFilesToAdd_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | int | cbFilenamesBuffer,
 |  | unsigned char __RPC_FAR * | sFilenamesBuffer
 | ) |

Definition at line 2598 of file CVS_Coworker_p.c.

02603 {
02604
02605     HRESULT _RetVal;
02606
02607     RPC_MESSAGE _RpcMessage;
02608
02609     MIDL_STUB_MESSAGE _StubMsg;
02610
02611     RpcTryExcept
02612         {
02613         NdrProxyInitialize(
02614                       ( void __RPC_FAR *  )This,
02615                       ( PRPC_MESSAGE  )&_RpcMessage,
02616                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02617                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02618                       21);
02619
02620
02621
02622         if(!sFilenamesBuffer)
02623             {
02624             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02625             }
02626         RpcTryFinally
02627             {
02628
02629             _StubMsg.BufferLength = 4U + 4U;
02630             NdrProxyGetBuffer(This, &_StubMsg);
02631             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02632
02633             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbFilenamesBuffer;
02634
02635             NdrProxySendReceive(This, &_StubMsg);
02636
02637             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02638                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[136] );
02639
02640             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02641                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenamesBuffer,
02642                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58],
02643                                            (unsigned char)0 );
02644
02645             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02646             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02647
02648             }
02649         RpcFinally
02650             {
02651             NdrProxyFreeBuffer(This, &_StubMsg);
02652
02653             }
02654         RpcEndFinally
02655
02656         }
02657     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02658         {
02659         _StubMsg.MaxCount = cbFilenamesBuffer;
02660
02661         NdrClearOutParameters(
02662                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02663                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[54],
02664                          ( void __RPC_FAR * )sFilenamesBuffer);
02665         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02666         }
02667     RpcEndExcept
02668     return _RetVal;
02669 }

void __RPC_STUB ICvsCoworker_GetFilesToAdd_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2671 of file CVS_Coworker_p.c.

02676 {
02677     HRESULT _RetVal;
02678     MIDL_STUB_MESSAGE _StubMsg;
02679     int cbFilenamesBuffer;
02680     int handle;
02681     unsigned char __RPC_FAR *sFilenamesBuffer;
02682
02683 NdrStubInitialize(
02684                      _pRpcMessage,
02685                      &_StubMsg,
02686                      &Object_StubDesc,
02687                      _pRpcChannelBuffer);
02688     ( unsigned char __RPC_FAR * )sFilenamesBuffer = 0;
02689     RpcTryFinally
02690         {
02691         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02692             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[136] );
02693
02694         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02695
02696         cbFilenamesBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02697
02698         if(cbFilenamesBuffer * 1 < 0)
02699             {
02700             RpcRaiseException(RPC_X_INVALID_BOUND);
02701             }
02702         sFilenamesBuffer = NdrAllocate(&_StubMsg,cbFilenamesBuffer * 1);
02703
02704         *_pdwStubPhase = STUB_CALL_SERVER;
02705         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetFilesToAdd(
02706                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02707                  handle,
02708                  cbFilenamesBuffer,
02709                  sFilenamesBuffer);
02710
02711         *_pdwStubPhase = STUB_MARSHAL;
02712
02713         _StubMsg.BufferLength = 12U + 11U;
02714         _StubMsg.MaxCount = cbFilenamesBuffer;
02715
02716         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02717                                        (unsigned char __RPC_FAR *)sFilenamesBuffer,
02718                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58] );
02719
02720         _StubMsg.BufferLength += 16;
02721
02722         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02723         _StubMsg.MaxCount = cbFilenamesBuffer;
02724
02725         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02726                                      (unsigned char __RPC_FAR *)sFilenamesBuffer,
02727                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58] );
02728
02729         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02730         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02731
02732         }
02733     RpcFinally
02734         {
02735         _StubMsg.MaxCount = cbFilenamesBuffer;
02736
02737         NdrPointerFree( &_StubMsg,
02738                         (unsigned char __RPC_FAR *)sFilenamesBuffer,
02739                         &__MIDL_TypeFormatString.Format[54] );
02740
02741         }
02742     RpcEndFinally
02743     _pRpcMessage->BufferLength =
02744         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02745
02746 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetLastError_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | int __RPC_FAR * | piError
 | ) |

Definition at line 65 of file CVS_Coworker_p.c.

00069 {
00070
00071     HRESULT _RetVal;
00072
00073     RPC_MESSAGE _RpcMessage;
00074
00075     MIDL_STUB_MESSAGE _StubMsg;
00076
00077     RpcTryExcept
00078         {
00079         NdrProxyInitialize(
00080                       ( void __RPC_FAR *  )This,
00081                       ( PRPC_MESSAGE  )&_RpcMessage,
00082                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00083                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00084                       3);
00085
00086
00087
00088         if(!piError)
00089             {
00090             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00091             }
00092         RpcTryFinally
00093             {
00094
00095             _StubMsg.BufferLength = 4U;
00096             NdrProxyGetBuffer(This, &_StubMsg);
00097             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
00098
00099             NdrProxySendReceive(This, &_StubMsg);
00100
00101             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00102                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
00103
00104             *piError = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00105
00106             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00107
00108             }
00109         RpcFinally
00110             {
00111             NdrProxyFreeBuffer(This, &_StubMsg);
00112
00113             }
00114         RpcEndFinally
00115
00116         }
00117     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00118         {
00119         NdrClearOutParameters(
00120                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00121                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00122                          ( void __RPC_FAR * )piError);
00123         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00124         }
00125     RpcEndExcept
00126     return _RetVal;
00127 }

void __RPC_STUB ICvsCoworker_GetLastError_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 129 of file CVS_Coworker_p.c.

00134 {
00135     int _M0;
00136     HRESULT _RetVal;
00137     MIDL_STUB_MESSAGE _StubMsg;
00138     int handle;
00139     int __RPC_FAR *piError;
00140
00141 NdrStubInitialize(
00142                      _pRpcMessage,
00143                      &_StubMsg,
00144                      &Object_StubDesc,
00145                      _pRpcChannelBuffer);
00146     ( int __RPC_FAR * )piError = 0;
00147     RpcTryFinally
00148         {
00149         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00150             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
00151
00152         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00153
00154         piError = &_M0;
00155
00156         *_pdwStubPhase = STUB_CALL_SERVER;
00157         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetLastError(
00158                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00159                 handle,
00160                 piError);
00161
00162         *_pdwStubPhase = STUB_MARSHAL;
00163
00164         _StubMsg.BufferLength = 4U + 4U;
00165         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00166         *(( int __RPC_FAR * )_StubMsg.Buffer)++ = *piError;
00167
00168         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00169
00170         }
00171     RpcFinally
00172         {
00173         }
00174     RpcEndFinally
00175     _pRpcMessage->BufferLength =
00176         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00177
00178 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetProject_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int __RPC_FAR * | pHandle,
 |  | const unsigned char __RPC_FAR * | sUsername,
 |  | int | cbProjectNameBuffer,
 |  | unsigned char __RPC_FAR * | sProjectName,
 |  | int | cbProjectHomeBuffer,
 |  | unsigned char __RPC_FAR * | sProjectHome,
 |  | BOOL | bAllowPathChange,
 |  | BOOL | bAllowNewProject,
 |  | BOOL __RPC_FAR * | pbNewProject
 | ) |

Definition at line 511 of file CVS_Coworker_p.c.

References CvsCommand, and ICvsCoworker.

00522 {
00523
00524     HRESULT _RetVal;
00525
00526     RPC_MESSAGE _RpcMessage;
00527
00528     MIDL_STUB_MESSAGE _StubMsg;
00529
00530     RpcTryExcept
00531         {
00532         NdrProxyInitialize(
00533                       ( void __RPC_FAR *  )This,
00534                       ( PRPC_MESSAGE  )&_RpcMessage,
00535                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00536                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00537                       6);
00538
00539
00540
00541         if(!pHandle)
00542             {
00543             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00544             }
00545         if(!sUsername)
00546             {
00547             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00548             }
00549         if(!sProjectName)
00550             {
00551             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00552             }
00553         if(!sProjectHome)
00554             {
00555             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00556             }
00557         if(!pbNewProject)
00558             {
00559             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00560             }
00561         RpcTryFinally
00562             {
00563
00564             _StubMsg.BufferLength = 1U + 7U + 12U + 11U + 13U + 11U + 7U;
00565             _StubMsg.MaxCount = cbProjectNameBuffer;
00566
00567             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00568                                            (unsigned char __RPC_FAR *)sProjectName,
00569                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00570
00571             _StubMsg.MaxCount = cbProjectHomeBuffer;
00572
00573             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00574                                            (unsigned char __RPC_FAR *)sProjectHome,
00575                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00576
00577             NdrProxyGetBuffer(This, &_StubMsg);
00578             *(( unsigned char __RPC_FAR * )_StubMsg.Buffer)++ = *sUsername;
00579
00580             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00581             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbProjectNameBuffer;
00582
00583             _StubMsg.MaxCount = cbProjectNameBuffer;
00584
00585             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00586                                          (unsigned char __RPC_FAR *)sProjectName,
00587                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00588
00589             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00590             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbProjectHomeBuffer;
00591
00592             _StubMsg.MaxCount = cbProjectHomeBuffer;
00593
00594             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00595                                          (unsigned char __RPC_FAR *)sProjectHome,
00596                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00597
00598             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00599             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bAllowPathChange;
00600
00601             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bAllowNewProject;
00602
00603             NdrProxySendReceive(This, &_StubMsg);
00604
00605             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00606                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[38] );
00607
00608             *pHandle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00609
00610             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00611                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectName,
00612                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28],
00613                                            (unsigned char)0 );
00614
00615             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00616                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectHome,
00617                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38],
00618                                            (unsigned char)0 );
00619
00620             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00621             *pbNewProject = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00622
00623             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00624
00625             }
00626         RpcFinally
00627             {
00628             NdrProxyFreeBuffer(This, &_StubMsg);
00629
00630             }
00631         RpcEndFinally
00632
00633         }
00634     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00635         {
00636         NdrClearOutParameters(
00637                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00638                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00639                          ( void __RPC_FAR * )pHandle);
00640         _StubMsg.MaxCount = cbProjectNameBuffer;
00641
00642         NdrClearOutParameters(
00643                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00644                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[24],
00645                          ( void __RPC_FAR * )sProjectName);
00646         _StubMsg.MaxCount = cbProjectHomeBuffer;
00647
00648         NdrClearOutParameters(
00649                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00650                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[34],
00651                          ( void __RPC_FAR * )sProjectHome);
00652         NdrClearOutParameters(
00653                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00654                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00655                          ( void __RPC_FAR * )pbNewProject);
00656         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00657         }
00658     RpcEndExcept
00659     return _RetVal;
00660 }

void __RPC_STUB ICvsCoworker_GetProject_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 662 of file CVS_Coworker_p.c.

References CvsCommand, and ICvsCoworker.

00667 {
00668     int _M14;
00669     BOOL _M15;
00670     HRESULT _RetVal;
00671     MIDL_STUB_MESSAGE _StubMsg;
00672     BOOL bAllowNewProject;
00673     BOOL bAllowPathChange;
00674     int cbProjectHomeBuffer;
00675     int cbProjectNameBuffer;
00676     int __RPC_FAR *pHandle;
00677     BOOL __RPC_FAR *pbNewProject;
00678     unsigned char __RPC_FAR *sProjectHome;
00679     unsigned char __RPC_FAR *sProjectName;
00680     const unsigned char __RPC_FAR *sUsername;
00681
00682 NdrStubInitialize(
00683                      _pRpcMessage,
00684                      &_StubMsg,
00685                      &Object_StubDesc,
00686                      _pRpcChannelBuffer);
00687     ( int __RPC_FAR * )pHandle = 0;
00688     ( unsigned char __RPC_FAR * )sUsername = 0;
00689     ( unsigned char __RPC_FAR * )sProjectName = 0;
00690     ( unsigned char __RPC_FAR * )sProjectHome = 0;
00691     ( BOOL __RPC_FAR * )pbNewProject = 0;
00692     RpcTryFinally
00693         {
00694         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00695             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[38] );
00696
00697         sUsername = ( unsigned char __RPC_FAR * )_StubMsg.Buffer;
00698         _StubMsg.Buffer += sizeof( unsigned char  );
00699
00700         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00701         cbProjectNameBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00702
00703         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00704                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectName,
00705                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28],
00706                                        (unsigned char)0 );
00707
00708         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00709         cbProjectHomeBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00710
00711         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00712                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectHome,
00713                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38],
00714                                        (unsigned char)0 );
00715
00716         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00717         bAllowPathChange = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00718
00719         bAllowNewProject = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00720
00721         pHandle = &_M14;
00722         pbNewProject = &_M15;
00723
00724         *_pdwStubPhase = STUB_CALL_SERVER;
00725         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetProject(
00726               (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00727               pHandle,
00728               sUsername,
00729               cbProjectNameBuffer,
00730               sProjectName,
00731               cbProjectHomeBuffer,
00732               sProjectHome,
00733               bAllowPathChange,
00734               bAllowNewProject,
00735               pbNewProject);
00736
00737         *_pdwStubPhase = STUB_MARSHAL;
00738
00739         _StubMsg.BufferLength = 4U + 12U + 13U + 11U + 7U;
00740         _StubMsg.MaxCount = cbProjectNameBuffer;
00741
00742         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00743                                        (unsigned char __RPC_FAR *)sProjectName,
00744                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00745
00746         _StubMsg.MaxCount = cbProjectHomeBuffer;
00747
00748         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00749                                        (unsigned char __RPC_FAR *)sProjectHome,
00750                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00751
00752         _StubMsg.BufferLength += 16;
00753
00754         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00755         *(( int __RPC_FAR * )_StubMsg.Buffer)++ = *pHandle;
00756
00757         _StubMsg.MaxCount = cbProjectNameBuffer;
00758
00759         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00760                                      (unsigned char __RPC_FAR *)sProjectName,
00761                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00762
00763         _StubMsg.MaxCount = cbProjectHomeBuffer;
00764
00765         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00766                                      (unsigned char __RPC_FAR *)sProjectHome,
00767                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00768
00769         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00770         *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = *pbNewProject;
00771
00772         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00773
00774         }
00775     RpcFinally
00776         {
00777         _StubMsg.MaxCount = cbProjectNameBuffer;
00778
00779         NdrPointerFree( &_StubMsg,
00780                         (unsigned char __RPC_FAR *)sProjectName,
00781                         &__MIDL_TypeFormatString.Format[24] );
00782
00783         _StubMsg.MaxCount = cbProjectHomeBuffer;
00784
00785         NdrPointerFree( &_StubMsg,
00786                         (unsigned char __RPC_FAR *)sProjectHome,
00787                         &__MIDL_TypeFormatString.Format[34] );
00788
00789         }
00790     RpcEndFinally
00791     _pRpcMessage->BufferLength =
00792         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00793
00794 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_HasAdvancedOptionsForCommand_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | CvsCommand | command,
 |  | BOOL __RPC_FAR * | pbAdvancedOptions
 | ) |

Definition at line 2211 of file CVS_Coworker_p.c.

02216 {
02217
02218     HRESULT _RetVal;
02219
02220     RPC_MESSAGE _RpcMessage;
02221
02222     MIDL_STUB_MESSAGE _StubMsg;
02223
02224     RpcTryExcept
02225         {
02226         NdrProxyInitialize(
02227                       ( void __RPC_FAR *  )This,
02228                       ( PRPC_MESSAGE  )&_RpcMessage,
02229                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02230                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02231                       18);
02232
02233
02234
02235         if(!pbAdvancedOptions)
02236             {
02237             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02238             }
02239         RpcTryFinally
02240             {
02241
02242             _StubMsg.BufferLength = 4U + 2U;
02243             NdrProxyGetBuffer(This, &_StubMsg);
02244             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02245
02246             NdrSimpleTypeMarshall(
02247                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02248                          ( unsigned char __RPC_FAR * )&command,
02249                          13);
02250             NdrProxySendReceive(This, &_StubMsg);
02251
02252             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02253                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[110] );
02254
02255             *pbAdvancedOptions = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
02256
02257             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02258
02259             }
02260         RpcFinally
02261             {
02262             NdrProxyFreeBuffer(This, &_StubMsg);
02263
02264             }
02265         RpcEndFinally
02266
02267         }
02268     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02269         {
02270         NdrClearOutParameters(
02271                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02272                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
02273                          ( void __RPC_FAR * )pbAdvancedOptions);
02274         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02275         }
02276     RpcEndExcept
02277     return _RetVal;
02278 }

void __RPC_STUB ICvsCoworker_HasAdvancedOptionsForCommand_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2280 of file CVS_Coworker_p.c.

02285 {
02286     BOOL _M42;
02287     HRESULT _RetVal;
02288     MIDL_STUB_MESSAGE _StubMsg;
02289     CvsCommand command;
02290     int handle;
02291     BOOL __RPC_FAR *pbAdvancedOptions;
02292
02293 NdrStubInitialize(
02294                      _pRpcMessage,
02295                      &_StubMsg,
02296                      &Object_StubDesc,
02297                      _pRpcChannelBuffer);
02298     ( BOOL __RPC_FAR * )pbAdvancedOptions = 0;
02299     RpcTryFinally
02300         {
02301         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02302             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[110] );
02303
02304         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02305
02306         NdrSimpleTypeUnmarshall(
02307                            ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02308                            ( unsigned char __RPC_FAR * )&command,
02309                            13);
02310         pbAdvancedOptions = &_M42;
02311
02312         *_pdwStubPhase = STUB_CALL_SERVER;
02313         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> HasAdvancedOptionsForCommand(
02314                                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02315                                 handle,
02316                                 command,
02317                                 pbAdvancedOptions);
02318
02319         *_pdwStubPhase = STUB_MARSHAL;
02320
02321         _StubMsg.BufferLength = 4U + 4U;
02322         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02323         *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = *pbAdvancedOptions;
02324
02325         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02326
02327         }
02328     RpcFinally
02329         {
02330         }
02331     RpcEndFinally
02332     _pRpcMessage->BufferLength =
02333         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02334
02335 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_OpenProject_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int __RPC_FAR * | pHandle,
 |  | const unsigned char __RPC_FAR * | sUsername,
 |  | const unsigned char __RPC_FAR * | sProjectName,
 |  | const unsigned char __RPC_FAR * | sProjectHome
 | ) |

Definition at line 339 of file CVS_Coworker_p.c.

References CloseProject, GetFilesToAdd, and ICvsCoworker.

00345 {
00346
00347     HRESULT _RetVal;
00348
00349     RPC_MESSAGE _RpcMessage;
00350
00351     MIDL_STUB_MESSAGE _StubMsg;
00352
00353     RpcTryExcept
00354         {
00355         NdrProxyInitialize(
00356                       ( void __RPC_FAR *  )This,
00357                       ( PRPC_MESSAGE  )&_RpcMessage,
00358                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00359                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00360                       5);
00361
00362
00363
00364         if(!pHandle)
00365             {
00366             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00367             }
00368         if(!sUsername)
00369             {
00370             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00371             }
00372         if(!sProjectName)
00373             {
00374             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00375             }
00376         if(!sProjectHome)
00377             {
00378             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00379             }
00380         RpcTryFinally
00381             {
00382
00383             _StubMsg.BufferLength = 12U + 13U + 13U;
00384             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00385                                            (unsigned char __RPC_FAR *)sUsername,
00386                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00387
00388             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00389                                            (unsigned char __RPC_FAR *)sProjectName,
00390                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00391
00392             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00393                                            (unsigned char __RPC_FAR *)sProjectHome,
00394                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00395
00396             NdrProxyGetBuffer(This, &_StubMsg);
00397             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00398                                          (unsigned char __RPC_FAR *)sUsername,
00399                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00400
00401             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00402                                          (unsigned char __RPC_FAR *)sProjectName,
00403                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00404
00405             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00406                                          (unsigned char __RPC_FAR *)sProjectHome,
00407                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00408
00409             NdrProxySendReceive(This, &_StubMsg);
00410
00411             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00412                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[20] );
00413
00414             *pHandle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00415
00416             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00417
00418             }
00419         RpcFinally
00420             {
00421             NdrProxyFreeBuffer(This, &_StubMsg);
00422
00423             }
00424         RpcEndFinally
00425
00426         }
00427     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00428         {
00429         NdrClearOutParameters(
00430                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00431                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00432                          ( void __RPC_FAR * )pHandle);
00433         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00434         }
00435     RpcEndExcept
00436     return _RetVal;
00437 }

void __RPC_STUB ICvsCoworker_OpenProject_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 439 of file CVS_Coworker_p.c.

References ICvsCoworker, and piError.

00444 {
00445     int _M9;
00446     HRESULT _RetVal;
00447     MIDL_STUB_MESSAGE _StubMsg;
00448     int __RPC_FAR *pHandle;
00449     const unsigned char __RPC_FAR *sProjectHome;
00450     const unsigned char __RPC_FAR *sProjectName;
00451     const unsigned char __RPC_FAR *sUsername;
00452
00453 NdrStubInitialize(
00454                      _pRpcMessage,
00455                      &_StubMsg,
00456                      &Object_StubDesc,
00457                      _pRpcChannelBuffer);
00458     ( int __RPC_FAR * )pHandle = 0;
00459     ( unsigned char __RPC_FAR * )sUsername = 0;
00460     ( unsigned char __RPC_FAR * )sProjectName = 0;
00461     ( unsigned char __RPC_FAR * )sProjectHome = 0;
00462     RpcTryFinally
00463         {
00464         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00465             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[20] );
00466
00467         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00468                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sUsername,
00469                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00470                                        (unsigned char)0 );
00471
00472         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00473                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectName,
00474                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00475                                        (unsigned char)0 );
00476
00477         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00478                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectHome,
00479                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00480                                        (unsigned char)0 );
00481
00482         pHandle = &_M9;
00483
00484         *_pdwStubPhase = STUB_CALL_SERVER;
00485         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> OpenProject(
00486                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00487                pHandle,
00488                sUsername,
00489                sProjectName,
00490                sProjectHome);
00491
00492         *_pdwStubPhase = STUB_MARSHAL;
00493
00494         _StubMsg.BufferLength = 4U + 4U;
00495         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00496         *(( int __RPC_FAR * )_StubMsg.Buffer)++ = *pHandle;
00497
00498         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00499
00500         }
00501     RpcFinally
00502         {
00503         }
00504     RpcEndFinally
00505     _pRpcMessage->BufferLength =
00506         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00507
00508 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_RemoveFiles_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) |

Definition at line 1448 of file CVS_Coworker_p.c.

01452 {
01453
01454     HRESULT _RetVal;
01455
01456     RPC_MESSAGE _RpcMessage;
01457
01458     MIDL_STUB_MESSAGE _StubMsg;
01459
01460     RpcTryExcept
01461         {
01462         NdrProxyInitialize(
01463                       ( void __RPC_FAR *  )This,
01464                       ( PRPC_MESSAGE  )&_RpcMessage,
01465                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01466                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01467                       12);
01468
01469
01470
01471         if(!sFilenames)
01472             {
01473             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01474             }
01475         RpcTryFinally
01476             {
01477
01478             _StubMsg.BufferLength = 4U + 12U;
01479             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01480                                            (unsigned char __RPC_FAR *)sFilenames,
01481                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01482
01483             NdrProxyGetBuffer(This, &_StubMsg);
01484             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01485
01486             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01487                                          (unsigned char __RPC_FAR *)sFilenames,
01488                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01489
01490             NdrProxySendReceive(This, &_StubMsg);
01491
01492             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01493                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01494
01495             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01496
01497             }
01498         RpcFinally
01499             {
01500             NdrProxyFreeBuffer(This, &_StubMsg);
01501
01502             }
01503         RpcEndFinally
01504
01505         }
01506     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01507         {
01508         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01509         }
01510     RpcEndExcept
01511     return _RetVal;
01512 }

void __RPC_STUB ICvsCoworker_RemoveFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1514 of file CVS_Coworker_p.c.

01519 {
01520     HRESULT _RetVal;
01521     MIDL_STUB_MESSAGE _StubMsg;
01522     int handle;
01523     const unsigned char __RPC_FAR *sFilenames;
01524
01525 NdrStubInitialize(
01526                      _pRpcMessage,
01527                      &_StubMsg,
01528                      &Object_StubDesc,
01529                      _pRpcChannelBuffer);
01530     ( unsigned char __RPC_FAR * )sFilenames = 0;
01531     RpcTryFinally
01532         {
01533         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01534             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01535
01536         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01537
01538         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01539                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01540                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01541                                        (unsigned char)0 );
01542
01543
01544         *_pdwStubPhase = STUB_CALL_SERVER;
01545         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> RemoveFiles(
01546                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01547                handle,
01548                sFilenames);
01549
01550         *_pdwStubPhase = STUB_MARSHAL;
01551
01552         _StubMsg.BufferLength = 4U;
01553         _StubMsg.BufferLength += 16;
01554
01555         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01556         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01557
01558         }
01559     RpcFinally
01560         {
01561         }
01562     RpcEndFinally
01563     _pRpcMessage->BufferLength =
01564         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01565
01566 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_RenameFile_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sOldFilename,
 |  | const unsigned char __RPC_FAR * | sNewFilename
 | ) |

Definition at line 1569 of file CVS_Coworker_p.c.

01574 {
01575
01576     HRESULT _RetVal;
01577
01578     RPC_MESSAGE _RpcMessage;
01579
01580     MIDL_STUB_MESSAGE _StubMsg;
01581
01582     RpcTryExcept
01583         {
01584         NdrProxyInitialize(
01585                       ( void __RPC_FAR *  )This,
01586                       ( PRPC_MESSAGE  )&_RpcMessage,
01587                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01588                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01589                       13);
01590
01591
01592
01593         if(!sOldFilename)
01594             {
01595             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01596             }
01597         if(!sNewFilename)
01598             {
01599             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01600             }
01601         RpcTryFinally
01602             {
01603
01604             _StubMsg.BufferLength = 4U + 12U + 13U;
01605             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01606                                            (unsigned char __RPC_FAR *)sOldFilename,
01607                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01608
01609             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01610                                            (unsigned char __RPC_FAR *)sNewFilename,
01611                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01612
01613             NdrProxyGetBuffer(This, &_StubMsg);
01614             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01615
01616             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01617                                          (unsigned char __RPC_FAR *)sOldFilename,
01618                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01619
01620             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01621                                          (unsigned char __RPC_FAR *)sNewFilename,
01622                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01623
01624             NdrProxySendReceive(This, &_StubMsg);
01625
01626             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01627                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01628
01629             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01630
01631             }
01632         RpcFinally
01633             {
01634             NdrProxyFreeBuffer(This, &_StubMsg);
01635
01636             }
01637         RpcEndFinally
01638
01639         }
01640     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01641         {
01642         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01643         }
01644     RpcEndExcept
01645     return _RetVal;
01646 }

void __RPC_STUB ICvsCoworker_RenameFile_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1648 of file CVS_Coworker_p.c.

01653 {
01654     HRESULT _RetVal;
01655     MIDL_STUB_MESSAGE _StubMsg;
01656     int handle;
01657     const unsigned char __RPC_FAR *sNewFilename;
01658     const unsigned char __RPC_FAR *sOldFilename;
01659
01660 NdrStubInitialize(
01661                      _pRpcMessage,
01662                      &_StubMsg,
01663                      &Object_StubDesc,
01664                      _pRpcChannelBuffer);
01665     ( unsigned char __RPC_FAR * )sOldFilename = 0;
01666     ( unsigned char __RPC_FAR * )sNewFilename = 0;
01667     RpcTryFinally
01668         {
01669         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01670             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01671
01672         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01673
01674         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01675                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sOldFilename,
01676                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01677                                        (unsigned char)0 );
01678
01679         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01680                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sNewFilename,
01681                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01682                                        (unsigned char)0 );
01683
01684
01685         *_pdwStubPhase = STUB_CALL_SERVER;
01686         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> RenameFile(
01687               (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01688               handle,
01689               sOldFilename,
01690               sNewFilename);
01691
01692         *_pdwStubPhase = STUB_MARSHAL;
01693
01694         _StubMsg.BufferLength = 4U;
01695         _StubMsg.BufferLength += 16;
01696
01697         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01698         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01699
01700         }
01701     RpcFinally
01702         {
01703         }
01704     RpcEndFinally
01705     _pRpcMessage->BufferLength =
01706         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01707
01708 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | CvsCommand | command
 | ) |

Definition at line 2338 of file CVS_Coworker_p.c.

02342 {
02343
02344     HRESULT _RetVal;
02345
02346     RPC_MESSAGE _RpcMessage;
02347
02348     MIDL_STUB_MESSAGE _StubMsg;
02349
02350     RpcTryExcept
02351         {
02352         NdrProxyInitialize(
02353                       ( void __RPC_FAR *  )This,
02354                       ( PRPC_MESSAGE  )&_RpcMessage,
02355                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02356                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02357                       19);
02358
02359
02360
02361         RpcTryFinally
02362             {
02363
02364             _StubMsg.BufferLength = 4U + 2U;
02365             NdrProxyGetBuffer(This, &_StubMsg);
02366             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02367
02368             NdrSimpleTypeMarshall(
02369                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02370                          ( unsigned char __RPC_FAR * )&command,
02371                          13);
02372             NdrProxySendReceive(This, &_StubMsg);
02373
02374             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02375                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[120] );
02376
02377             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02378
02379             }
02380         RpcFinally
02381             {
02382             NdrProxyFreeBuffer(This, &_StubMsg);
02383
02384             }
02385         RpcEndFinally
02386
02387         }
02388     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02389         {
02390         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02391         }
02392     RpcEndExcept
02393     return _RetVal;
02394 }

void __RPC_STUB ICvsCoworker_ShowAdvancedOptionsForCommand_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2396 of file CVS_Coworker_p.c.

02401 {
02402     HRESULT _RetVal;
02403     MIDL_STUB_MESSAGE _StubMsg;
02404     CvsCommand command;
02405     int handle;
02406
02407 NdrStubInitialize(
02408                      _pRpcMessage,
02409                      &_StubMsg,
02410                      &Object_StubDesc,
02411                      _pRpcChannelBuffer);
02412     RpcTryFinally
02413         {
02414         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02415             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[120] );
02416
02417         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02418
02419         NdrSimpleTypeUnmarshall(
02420                            ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02421                            ( unsigned char __RPC_FAR * )&command,
02422                            13);
02423
02424         *_pdwStubPhase = STUB_CALL_SERVER;
02425         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowAdvancedOptionsForCommand(
02426                                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02427                                  handle,
02428                                  command);
02429
02430         *_pdwStubPhase = STUB_MARSHAL;
02431
02432         _StubMsg.BufferLength = 4U;
02433         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02434         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02435
02436         }
02437     RpcFinally
02438         {
02439         }
02440     RpcEndFinally
02441     _pRpcMessage->BufferLength =
02442         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02443
02444 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileHistory_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) |

Definition at line 1848 of file CVS_Coworker_p.c.

01852 {
01853
01854     HRESULT _RetVal;
01855
01856     RPC_MESSAGE _RpcMessage;
01857
01858     MIDL_STUB_MESSAGE _StubMsg;
01859
01860     RpcTryExcept
01861         {
01862         NdrProxyInitialize(
01863                       ( void __RPC_FAR *  )This,
01864                       ( PRPC_MESSAGE  )&_RpcMessage,
01865                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01866                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01867                       15);
01868
01869
01870
01871         if(!sFilenames)
01872             {
01873             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01874             }
01875         RpcTryFinally
01876             {
01877
01878             _StubMsg.BufferLength = 4U + 12U;
01879             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01880                                            (unsigned char __RPC_FAR *)sFilenames,
01881                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01882
01883             NdrProxyGetBuffer(This, &_StubMsg);
01884             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01885
01886             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01887                                          (unsigned char __RPC_FAR *)sFilenames,
01888                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01889
01890             NdrProxySendReceive(This, &_StubMsg);
01891
01892             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01893                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01894
01895             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01896
01897             }
01898         RpcFinally
01899             {
01900             NdrProxyFreeBuffer(This, &_StubMsg);
01901
01902             }
01903         RpcEndFinally
01904
01905         }
01906     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01907         {
01908         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01909         }
01910     RpcEndExcept
01911     return _RetVal;
01912 }

void __RPC_STUB ICvsCoworker_ShowFileHistory_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1914 of file CVS_Coworker_p.c.

01919 {
01920     HRESULT _RetVal;
01921     MIDL_STUB_MESSAGE _StubMsg;
01922     int handle;
01923     const unsigned char __RPC_FAR *sFilenames;
01924
01925 NdrStubInitialize(
01926                      _pRpcMessage,
01927                      &_StubMsg,
01928                      &Object_StubDesc,
01929                      _pRpcChannelBuffer);
01930     ( unsigned char __RPC_FAR * )sFilenames = 0;
01931     RpcTryFinally
01932         {
01933         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01934             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01935
01936         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01937
01938         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01939                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01940                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01941                                        (unsigned char)0 );
01942
01943
01944         *_pdwStubPhase = STUB_CALL_SERVER;
01945         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowFileHistory(
01946                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01947                    handle,
01948                    sFilenames);
01949
01950         *_pdwStubPhase = STUB_MARSHAL;
01951
01952         _StubMsg.BufferLength = 4U;
01953         _StubMsg.BufferLength += 16;
01954
01955         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01956         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01957
01958         }
01959     RpcFinally
01960         {
01961         }
01962     RpcEndFinally
01963     _pRpcMessage->BufferLength =
01964         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01965
01966 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileProperties_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilename
 | ) |

Definition at line 1969 of file CVS_Coworker_p.c.

01973 {
01974
01975     HRESULT _RetVal;
01976
01977     RPC_MESSAGE _RpcMessage;
01978
01979     MIDL_STUB_MESSAGE _StubMsg;
01980
01981     RpcTryExcept
01982         {
01983         NdrProxyInitialize(
01984                       ( void __RPC_FAR *  )This,
01985                       ( PRPC_MESSAGE  )&_RpcMessage,
01986                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01987                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01988                       16);
01989
01990
01991
01992         if(!sFilename)
01993             {
01994             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01995             }
01996         RpcTryFinally
01997             {
01998
01999             _StubMsg.BufferLength = 4U + 12U;
02000             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02001                                            (unsigned char __RPC_FAR *)sFilename,
02002                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02003
02004             NdrProxyGetBuffer(This, &_StubMsg);
02005             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02006
02007             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02008                                          (unsigned char __RPC_FAR *)sFilename,
02009                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02010
02011             NdrProxySendReceive(This, &_StubMsg);
02012
02013             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02014                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02015
02016             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02017
02018             }
02019         RpcFinally
02020             {
02021             NdrProxyFreeBuffer(This, &_StubMsg);
02022
02023             }
02024         RpcEndFinally
02025
02026         }
02027     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02028         {
02029         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02030         }
02031     RpcEndExcept
02032     return _RetVal;
02033 }

void __RPC_STUB ICvsCoworker_ShowFileProperties_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2035 of file CVS_Coworker_p.c.

02040 {
02041     HRESULT _RetVal;
02042     MIDL_STUB_MESSAGE _StubMsg;
02043     int handle;
02044     const unsigned char __RPC_FAR *sFilename;
02045
02046 NdrStubInitialize(
02047                      _pRpcMessage,
02048                      &_StubMsg,
02049                      &Object_StubDesc,
02050                      _pRpcChannelBuffer);
02051     ( unsigned char __RPC_FAR * )sFilename = 0;
02052     RpcTryFinally
02053         {
02054         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02055             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02056
02057         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02058
02059         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02060                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilename,
02061                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02062                                        (unsigned char)0 );
02063
02064
02065         *_pdwStubPhase = STUB_CALL_SERVER;
02066         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowFileProperties(
02067                       (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02068                       handle,
02069                       sFilename);
02070
02071         *_pdwStubPhase = STUB_MARSHAL;
02072
02073         _StubMsg.BufferLength = 4U;
02074         _StubMsg.BufferLength += 16;
02075
02076         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02077         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02078
02079         }
02080     RpcFinally
02081         {
02082         }
02083     RpcEndFinally
02084     _pRpcMessage->BufferLength =
02085         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02086
02087 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowUserInterface_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) |

Definition at line 2090 of file CVS_Coworker_p.c.

02094 {
02095
02096     HRESULT _RetVal;
02097
02098     RPC_MESSAGE _RpcMessage;
02099
02100     MIDL_STUB_MESSAGE _StubMsg;
02101
02102     RpcTryExcept
02103         {
02104         NdrProxyInitialize(
02105                       ( void __RPC_FAR *  )This,
02106                       ( PRPC_MESSAGE  )&_RpcMessage,
02107                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02108                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02109                       17);
02110
02111
02112
02113         if(!sFilenames)
02114             {
02115             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02116             }
02117         RpcTryFinally
02118             {
02119
02120             _StubMsg.BufferLength = 4U + 12U;
02121             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02122                                            (unsigned char __RPC_FAR *)sFilenames,
02123                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02124
02125             NdrProxyGetBuffer(This, &_StubMsg);
02126             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02127
02128             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02129                                          (unsigned char __RPC_FAR *)sFilenames,
02130                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02131
02132             NdrProxySendReceive(This, &_StubMsg);
02133
02134             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02135                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02136
02137             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02138
02139             }
02140         RpcFinally
02141             {
02142             NdrProxyFreeBuffer(This, &_StubMsg);
02143
02144             }
02145         RpcEndFinally
02146
02147         }
02148     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02149         {
02150         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02151         }
02152     RpcEndExcept
02153     return _RetVal;
02154 }

void __RPC_STUB ICvsCoworker_ShowUserInterface_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2156 of file CVS_Coworker_p.c.

02161 {
02162     HRESULT _RetVal;
02163     MIDL_STUB_MESSAGE _StubMsg;
02164     int handle;
02165     const unsigned char __RPC_FAR *sFilenames;
02166
02167 NdrStubInitialize(
02168                      _pRpcMessage,
02169                      &_StubMsg,
02170                      &Object_StubDesc,
02171                      _pRpcChannelBuffer);
02172     ( unsigned char __RPC_FAR * )sFilenames = 0;
02173     RpcTryFinally
02174         {
02175         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02176             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02177
02178         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02179
02180         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02181                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
02182                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02183                                        (unsigned char)0 );
02184
02185
02186         *_pdwStubPhase = STUB_CALL_SERVER;
02187         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowUserInterface(
02188                      (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02189                      handle,
02190                      sFilenames);
02191
02192         *_pdwStubPhase = STUB_MARSHAL;
02193
02194         _StubMsg.BufferLength = 4U;
02195         _StubMsg.BufferLength += 16;
02196
02197         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02198         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02199
02200         }
02201     RpcFinally
02202         {
02203         }
02204     RpcEndFinally
02205     _pRpcMessage->BufferLength =
02206         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02207
02208 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_UncheckoutFiles_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) |

Definition at line 1185 of file CVS_Coworker_p.c.

01189 {
01190
01191     HRESULT _RetVal;
01192
01193     RPC_MESSAGE _RpcMessage;
01194
01195     MIDL_STUB_MESSAGE _StubMsg;
01196
01197     RpcTryExcept
01198         {
01199         NdrProxyInitialize(
01200                       ( void __RPC_FAR *  )This,
01201                       ( PRPC_MESSAGE  )&_RpcMessage,
01202                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01203                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01204                       10);
01205
01206
01207
01208         if(!sFilenames)
01209             {
01210             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01211             }
01212         RpcTryFinally
01213             {
01214
01215             _StubMsg.BufferLength = 4U + 12U;
01216             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01217                                            (unsigned char __RPC_FAR *)sFilenames,
01218                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01219
01220             NdrProxyGetBuffer(This, &_StubMsg);
01221             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01222
01223             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01224                                          (unsigned char __RPC_FAR *)sFilenames,
01225                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01226
01227             NdrProxySendReceive(This, &_StubMsg);
01228
01229             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01230                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01231
01232             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01233
01234             }
01235         RpcFinally
01236             {
01237             NdrProxyFreeBuffer(This, &_StubMsg);
01238
01239             }
01240         RpcEndFinally
01241
01242         }
01243     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01244         {
01245         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01246         }
01247     RpcEndExcept
01248     return _RetVal;
01249 }

void __RPC_STUB ICvsCoworker_UncheckoutFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1251 of file CVS_Coworker_p.c.

01256 {
01257     HRESULT _RetVal;
01258     MIDL_STUB_MESSAGE _StubMsg;
01259     int handle;
01260     const unsigned char __RPC_FAR *sFilenames;
01261
01262 NdrStubInitialize(
01263                      _pRpcMessage,
01264                      &_StubMsg,
01265                      &Object_StubDesc,
01266                      _pRpcChannelBuffer);
01267     ( unsigned char __RPC_FAR * )sFilenames = 0;
01268     RpcTryFinally
01269         {
01270         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01271             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01272
01273         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01274
01275         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01276                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01277                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01278                                        (unsigned char)0 );
01279
01280
01281         *_pdwStubPhase = STUB_CALL_SERVER;
01282         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> UncheckoutFiles(
01283                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01284                    handle,
01285                    sFilenames);
01286
01287         *_pdwStubPhase = STUB_MARSHAL;
01288
01289         _StubMsg.BufferLength = 4U;
01290         _StubMsg.BufferLength += 16;
01291
01292         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01293         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01294
01295         }
01296     RpcFinally
01297         {
01298         }
01299     RpcEndFinally
01300     _pRpcMessage->BufferLength =
01301         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01302
01303 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_UpdateFiles_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames,
 |  | BOOL | bDirectories,
 |  | BOOL | bRecurse
 | ) |

Definition at line 797 of file CVS_Coworker_p.c.

00803 {
00804
00805     HRESULT _RetVal;
00806
00807     RPC_MESSAGE _RpcMessage;
00808
00809     MIDL_STUB_MESSAGE _StubMsg;
00810
00811     RpcTryExcept
00812         {
00813         NdrProxyInitialize(
00814                       ( void __RPC_FAR *  )This,
00815                       ( PRPC_MESSAGE  )&_RpcMessage,
00816                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00817                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00818                       7);
00819
00820
00821
00822         if(!sFilenames)
00823             {
00824             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00825             }
00826         RpcTryFinally
00827             {
00828
00829             _StubMsg.BufferLength = 4U + 12U + 11U + 7U;
00830             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00831                                            (unsigned char __RPC_FAR *)sFilenames,
00832                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00833
00834             NdrProxyGetBuffer(This, &_StubMsg);
00835             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
00836
00837             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00838                                          (unsigned char __RPC_FAR *)sFilenames,
00839                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00840
00841             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00842             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bDirectories;
00843
00844             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bRecurse;
00845
00846             NdrProxySendReceive(This, &_StubMsg);
00847
00848             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00849                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
00850
00851             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00852
00853             }
00854         RpcFinally
00855             {
00856             NdrProxyFreeBuffer(This, &_StubMsg);
00857
00858             }
00859         RpcEndFinally
00860
00861         }
00862     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00863         {
00864         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00865         }
00866     RpcEndExcept
00867     return _RetVal;
00868 }

void __RPC_STUB ICvsCoworker_UpdateFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 870 of file CVS_Coworker_p.c.

00875 {
00876     HRESULT _RetVal;
00877     MIDL_STUB_MESSAGE _StubMsg;
00878     BOOL bDirectories;
00879     BOOL bRecurse;
00880     int handle;
00881     const unsigned char __RPC_FAR *sFilenames;
00882
00883 NdrStubInitialize(
00884                      _pRpcMessage,
00885                      &_StubMsg,
00886                      &Object_StubDesc,
00887                      _pRpcChannelBuffer);
00888     ( unsigned char __RPC_FAR * )sFilenames = 0;
00889     RpcTryFinally
00890         {
00891         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00892             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
00893
00894         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00895
00896         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00897                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
00898                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00899                                        (unsigned char)0 );
00900
00901         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00902         bDirectories = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00903
00904         bRecurse = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00905
00906
00907         *_pdwStubPhase = STUB_CALL_SERVER;
00908         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> UpdateFiles(
00909                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00910                handle,
00911                sFilenames,
00912                bDirectories,
00913                bRecurse);
00914
00915         *_pdwStubPhase = STUB_MARSHAL;
00916
00917         _StubMsg.BufferLength = 4U;
00918         _StubMsg.BufferLength += 16;
00919
00920         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00921         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00922
00923         }
00924     RpcFinally
00925         {
00926         }
00927     RpcEndFinally
00928     _pRpcMessage->BufferLength =
00929         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00930
00931 }

void __RPC_FAR* __RPC_USER MIDL_user_allocate ( size_t )

void __RPC_USER MIDL_user_free ( void __RPC_FAR * )

virtual HRESULT STDMETHODCALLTYPE OpenProject | ( | int __RPC_FAR * | pHandle,
 |  | const unsigned char __RPC_FAR * | sUsername,
 |  | const unsigned char __RPC_FAR * | sProjectName,
 |  | const unsigned char __RPC_FAR * | sProjectHome
 | ) | [pure virtual]

virtual HRESULT STDMETHODCALLTYPE RemoveFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE RenameFile | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sOldFilename,
 |  | const unsigned char __RPC_FAR * | sNewFilename
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE ShowAdvancedOptionsForCommand | ( | int | handle,
 |  | CvsCommand | command
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE ShowFileHistory | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE ShowFileProperties | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilename
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE ShowUserInterface | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE UncheckoutFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

virtual HRESULT STDMETHODCALLTYPE UpdateFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames,
 |  | BOOL | bDirectories,
 |  | BOOL | bRecurse
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub.

Variable Documentation

RPC_IF_HANDLE __MIDL_itf_CVS_Coworker_0000_v0_0_c_ifspec

Definition at line 92 of file CVS_Coworker_i.h.

RPC_IF_HANDLE __MIDL_itf_CVS_Coworker_0000_v0_0_s_ifspec

Definition at line 93 of file CVS_Coworker_i.h.

ICvsCoworker __pad1__

Definition at line 111 of file CVS_Coworker_i.h.

EXTERN_C const CLSID CLSID_CvsCoworker

Definition at line 733 of file CVS_Coworker_i.h.

EXTERN_C const IID IID_ICvsCoworker

Definition at line 102 of file CVS_Coworker_i.h.

EXTERN_C const IID LIBID_CVS_COWORKERLib

Definition at line 731 of file CVS_Coworker_i.h.

ICvsCoworker int __RPC_FAR* piError = 0

Definition at line 112 of file CVS_Coworker_i.h.

Referenced by ICvsCoworker_OpenProject_Stub.

Generated on Sun Feb 24 01:23:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CVS_Coworker_p.c File Reference

WinCvs/CoWorker/CVS_Coworker_p.c File Reference

#include "rpcproxy.h"
#include "cvs_coworker.h"

Include dependency graph for CVS_Coworker_p.c:

Include dependency graph

Go to the source code of this file.

Compounds

struct | _MIDL_PROC_FORMAT_STRING
struct | _MIDL_TYPE_FORMAT_STRING

Defines

#define | __REQUIRED_RPCPROXY_H_VERSION__ 440
#define | TYPE_FORMAT_STRING_SIZE 65
#define | PROC_FORMAT_STRING_SIZE 151
#define | _cvs_coworker_CHECK_IID(n) IID_GENERIC_CHECK_IID( _cvs_coworker, pIID, n)

Typedefs

typedef _MIDL_TYPE_FORMAT_STRING | MIDL_TYPE_FORMAT_STRING
typedef _MIDL_PROC_FORMAT_STRING | MIDL_PROC_FORMAT_STRING

Functions

HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetLastError_Proxy (ICvsCoworker __RPC_FAR *This, int handle, int __RPC_FAR *piError)
void __RPC_STUB | ICvsCoworker_GetLastError_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetErrorMessage_Proxy (ICvsCoworker __RPC_FAR *This, int handle, int iError, int cbErrorBuffer, unsigned char __RPC_FAR *sErrorBuffer)
void __RPC_STUB | ICvsCoworker_GetErrorMessage_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_OpenProject_Proxy (ICvsCoworker __RPC_FAR *This, int __RPC_FAR *pHandle, const unsigned char __RPC_FAR *sUsername, const unsigned char __RPC_FAR *sProjectName, const unsigned char __RPC_FAR *sProjectHome)
void __RPC_STUB | ICvsCoworker_OpenProject_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetProject_Proxy (ICvsCoworker __RPC_FAR *This, int __RPC_FAR *pHandle, const unsigned char __RPC_FAR *sUsername, int cbProjectNameBuffer, unsigned char __RPC_FAR *sProjectName, int cbProjectHomeBuffer, unsigned char __RPC_FAR *sProjectHome, BOOL bAllowPathChange, BOOL bAllowNewProject, BOOL __RPC_FAR *pbNewProject)
void __RPC_STUB | ICvsCoworker_GetProject_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_UpdateFiles_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames, BOOL bDirectories, BOOL bRecurse)
void __RPC_STUB | ICvsCoworker_UpdateFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_CheckoutFiles_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames)
void __RPC_STUB | ICvsCoworker_CheckoutFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_CheckinFiles_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames, BOOL bKeepCheckedOut)
void __RPC_STUB | ICvsCoworker_CheckinFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_UncheckoutFiles_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames)
void __RPC_STUB | ICvsCoworker_UncheckoutFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_AddFiles_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sOptionsAndFilenames, const unsigned char __RPC_FAR *sComment)
void __RPC_STUB | ICvsCoworker_AddFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_RemoveFiles_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames)
void __RPC_STUB | ICvsCoworker_RemoveFiles_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_RenameFile_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sOldFilename, const unsigned char __RPC_FAR *sNewFilename)
void __RPC_STUB | ICvsCoworker_RenameFile_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_DiffFile_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilename, BOOL bIgnoreCase, BOOL bIgnoreBlanks)
void __RPC_STUB | ICvsCoworker_DiffFile_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowFileHistory_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames)
void __RPC_STUB | ICvsCoworker_ShowFileHistory_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowFileProperties_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilename)
void __RPC_STUB | ICvsCoworker_ShowFileProperties_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowUserInterface_Proxy (ICvsCoworker __RPC_FAR *This, int handle, const unsigned char __RPC_FAR *sFilenames)
void __RPC_STUB | ICvsCoworker_ShowUserInterface_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_HasAdvancedOptionsForCommand_Proxy (ICvsCoworker __RPC_FAR *This, int handle, CvsCommand command, BOOL __RPC_FAR *pbAdvancedOptions)
void __RPC_STUB | ICvsCoworker_HasAdvancedOptionsForCommand_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy (ICvsCoworker __RPC_FAR *This, int handle, CvsCommand command)
void __RPC_STUB | ICvsCoworker_ShowAdvancedOptionsForCommand_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetFileChanges_Proxy (ICvsCoworker __RPC_FAR *This, int handle, int cbFilenameBuffer, unsigned char __RPC_FAR *sFilenameBuffer)
void __RPC_STUB | ICvsCoworker_GetFileChanges_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_GetFilesToAdd_Proxy (ICvsCoworker __RPC_FAR *This, int handle, int cbFilenamesBuffer, unsigned char __RPC_FAR *sFilenamesBuffer)
void __RPC_STUB | ICvsCoworker_GetFilesToAdd_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ICvsCoworker_CloseProject_Proxy (ICvsCoworker __RPC_FAR *This, int handle)
void __RPC_STUB | ICvsCoworker_CloseProject_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
const | CINTERFACE_PROXY_VTABLE (23) _ICvsCoworkerProxyVtbl=
int __stdcall | _cvs_coworker_IID_Lookup (const IID *pIID, int *pIndex)

Variables

const MIDL_TYPE_FORMAT_STRING | __MIDL_TypeFormatString
const MIDL_PROC_FORMAT_STRING | __MIDL_ProcFormatString
const MIDL_STUB_DESC | Object_StubDesc
const PRPC_STUB_FUNCTION | ICvsCoworker_table []
const CInterfaceStubVtbl | _ICvsCoworkerStubVtbl
const CInterfaceProxyVtbl * | _cvs_coworker_ProxyVtblList []
const CInterfaceStubVtbl * | _cvs_coworker_StubVtblList []
PCInterfaceName const | _cvs_coworker_InterfaceNamesList []
const ExtendedProxyFileInfo | cvs_coworker_ProxyFileInfo

Define Documentation

#define __REQUIRED_RPCPROXY_H_VERSION__ 440

Definition at line 16 of file CVS_Coworker_p.c.

#define _cvs_coworker_CHECK_IID ( n ) IID_GENERIC_CHECK_IID( _cvs_coworker, pIID, n)

Definition at line 3279 of file CVS_Coworker_p.c.

Referenced by _cvs_coworker_IID_Lookup.

#define PROC_FORMAT_STRING_SIZE 151

Definition at line 29 of file CVS_Coworker_p.c.

#define TYPE_FORMAT_STRING_SIZE 65

Definition at line 28 of file CVS_Coworker_p.c.

Typedef Documentation

typedef struct _MIDL_PROC_FORMAT_STRING MIDL_PROC_FORMAT_STRING

typedef struct _MIDL_TYPE_FORMAT_STRING MIDL_TYPE_FORMAT_STRING

Function Documentation

int __stdcall _cvs_coworker_IID_Lookup | ( | const IID * | pIID,
 |  | int * | pIndex
 | ) |

Definition at line 3281 of file CVS_Coworker_p.c.

References _cvs_coworker_CHECK_IID.

03282 {
03283
03284     if(!_cvs_coworker_CHECK_IID(0))
03285         {
03286         *pIndex = 0;
03287         return 1;
03288         }
03289
03290     return 0;
03291 }

const CINTERFACE_PROXY_VTABLE ( 23 )

Definition at line 2869 of file CVS_Coworker_p.c.

References ICvsCoworker_AddFiles_Proxy, ICvsCoworker_CheckinFiles_Proxy, ICvsCoworker_CheckoutFiles_Proxy, ICvsCoworker_CloseProject_Proxy, ICvsCoworker_DiffFile_Proxy, ICvsCoworker_GetErrorMessage_Proxy, ICvsCoworker_GetFileChanges_Proxy, ICvsCoworker_GetFilesToAdd_Proxy, ICvsCoworker_GetLastError_Proxy, ICvsCoworker_GetProject_Proxy, ICvsCoworker_HasAdvancedOptionsForCommand_Proxy, ICvsCoworker_OpenProject_Proxy, ICvsCoworker_RemoveFiles_Proxy, ICvsCoworker_RenameFile_Proxy, ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy, ICvsCoworker_ShowFileHistory_Proxy, ICvsCoworker_ShowFileProperties_Proxy, ICvsCoworker_ShowUserInterface_Proxy, ICvsCoworker_UncheckoutFiles_Proxy, and ICvsCoworker_UpdateFiles_Proxy.

02870 {
02871     &IID_ICvsCoworker,
02872     IUnknown_QueryInterface_Proxy,
02873     IUnknown_AddRef_Proxy,
02874     IUnknown_Release_Proxy ,
02875     ICvsCoworker_GetLastError_Proxy ,
02876     ICvsCoworker_GetErrorMessage_Proxy ,
02877     ICvsCoworker_OpenProject_Proxy ,
02878     ICvsCoworker_GetProject_Proxy ,
02879     ICvsCoworker_UpdateFiles_Proxy ,
02880     ICvsCoworker_CheckoutFiles_Proxy ,
02881     ICvsCoworker_CheckinFiles_Proxy ,
02882     ICvsCoworker_UncheckoutFiles_Proxy ,
02883     ICvsCoworker_AddFiles_Proxy ,
02884     ICvsCoworker_RemoveFiles_Proxy ,
02885     ICvsCoworker_RenameFile_Proxy ,
02886     ICvsCoworker_DiffFile_Proxy ,
02887     ICvsCoworker_ShowFileHistory_Proxy ,
02888     ICvsCoworker_ShowFileProperties_Proxy ,
02889     ICvsCoworker_ShowUserInterface_Proxy ,
02890     ICvsCoworker_HasAdvancedOptionsForCommand_Proxy ,
02891     ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy ,
02892     ICvsCoworker_GetFileChanges_Proxy ,
02893     ICvsCoworker_GetFilesToAdd_Proxy ,
02894     ICvsCoworker_CloseProject_Proxy
02895 };

HRESULT STDMETHODCALLTYPE ICvsCoworker_AddFiles_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sOptionsAndFilenames,
 |  | const unsigned char __RPC_FAR * | sComment
 | ) |

Definition at line 1306 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_FORMAT_STRING::Format.

01311 {
01312
01313     HRESULT _RetVal;
01314
01315     RPC_MESSAGE _RpcMessage;
01316
01317     MIDL_STUB_MESSAGE _StubMsg;
01318
01319     RpcTryExcept
01320         {
01321         NdrProxyInitialize(
01322                       ( void __RPC_FAR *  )This,
01323                       ( PRPC_MESSAGE  )&_RpcMessage,
01324                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01325                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01326                       11);
01327
01328
01329
01330         if(!sOptionsAndFilenames)
01331             {
01332             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01333             }
01334         if(!sComment)
01335             {
01336             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01337             }
01338         RpcTryFinally
01339             {
01340
01341             _StubMsg.BufferLength = 4U + 12U + 13U;
01342             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01343                                            (unsigned char __RPC_FAR *)sOptionsAndFilenames,
01344                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01345
01346             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01347                                            (unsigned char __RPC_FAR *)sComment,
01348                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01349
01350             NdrProxyGetBuffer(This, &_StubMsg);
01351             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01352
01353             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01354                                          (unsigned char __RPC_FAR *)sOptionsAndFilenames,
01355                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01356
01357             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01358                                          (unsigned char __RPC_FAR *)sComment,
01359                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01360
01361             NdrProxySendReceive(This, &_StubMsg);
01362
01363             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01364                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01365
01366             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01367
01368             }
01369         RpcFinally
01370             {
01371             NdrProxyFreeBuffer(This, &_StubMsg);
01372
01373             }
01374         RpcEndFinally
01375
01376         }
01377     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01378         {
01379         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01380         }
01381     RpcEndExcept
01382     return _RetVal;
01383 }

void __RPC_STUB ICvsCoworker_AddFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1385 of file CVS_Coworker_p.c.

References AddFiles, _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_FORMAT_STRING::Format.

01390 {
01391     HRESULT _RetVal;
01392     MIDL_STUB_MESSAGE _StubMsg;
01393     int handle;
01394     const unsigned char __RPC_FAR *sComment;
01395     const unsigned char __RPC_FAR *sOptionsAndFilenames;
01396
01397 NdrStubInitialize(
01398                      _pRpcMessage,
01399                      &_StubMsg,
01400                      &Object_StubDesc,
01401                      _pRpcChannelBuffer);
01402     ( unsigned char __RPC_FAR * )sOptionsAndFilenames = 0;
01403     ( unsigned char __RPC_FAR * )sComment = 0;
01404     RpcTryFinally
01405         {
01406         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01407             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01408
01409         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01410
01411         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01412                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sOptionsAndFilenames,
01413                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01414                                        (unsigned char)0 );
01415
01416         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01417                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sComment,
01418                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01419                                        (unsigned char)0 );
01420
01421
01422         *_pdwStubPhase = STUB_CALL_SERVER;
01423         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> AddFiles(
01424             (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01425             handle,
01426             sOptionsAndFilenames,
01427             sComment);
01428
01429         *_pdwStubPhase = STUB_MARSHAL;
01430
01431         _StubMsg.BufferLength = 4U;
01432         _StubMsg.BufferLength += 16;
01433
01434         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01435         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01436
01437         }
01438     RpcFinally
01439         {
01440         }
01441     RpcEndFinally
01442     _pRpcMessage->BufferLength =
01443         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01444
01445 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckinFiles_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames,
 |  | BOOL | bKeepCheckedOut
 | ) |

Definition at line 1055 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_FORMAT_STRING::Format.

01060 {
01061
01062     HRESULT _RetVal;
01063
01064     RPC_MESSAGE _RpcMessage;
01065
01066     MIDL_STUB_MESSAGE _StubMsg;
01067
01068     RpcTryExcept
01069         {
01070         NdrProxyInitialize(
01071                       ( void __RPC_FAR *  )This,
01072                       ( PRPC_MESSAGE  )&_RpcMessage,
01073                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01074                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01075                       9);
01076
01077
01078
01079         if(!sFilenames)
01080             {
01081             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01082             }
01083         RpcTryFinally
01084             {
01085
01086             _StubMsg.BufferLength = 4U + 12U + 11U;
01087             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01088                                            (unsigned char __RPC_FAR *)sFilenames,
01089                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01090
01091             NdrProxyGetBuffer(This, &_StubMsg);
01092             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01093
01094             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01095                                          (unsigned char __RPC_FAR *)sFilenames,
01096                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01097
01098             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01099             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bKeepCheckedOut;
01100
01101             NdrProxySendReceive(This, &_StubMsg);
01102
01103             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01104                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] );
01105
01106             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01107
01108             }
01109         RpcFinally
01110             {
01111             NdrProxyFreeBuffer(This, &_StubMsg);
01112
01113             }
01114         RpcEndFinally
01115
01116         }
01117     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01118         {
01119         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01120         }
01121     RpcEndExcept
01122     return _RetVal;
01123 }

void __RPC_STUB ICvsCoworker_CheckinFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1125 of file CVS_Coworker_p.c.

References CheckinFiles, _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_FORMAT_STRING::Format.

01130 {
01131     HRESULT _RetVal;
01132     MIDL_STUB_MESSAGE _StubMsg;
01133     BOOL bKeepCheckedOut;
01134     int handle;
01135     const unsigned char __RPC_FAR *sFilenames;
01136
01137 NdrStubInitialize(
01138                      _pRpcMessage,
01139                      &_StubMsg,
01140                      &Object_StubDesc,
01141                      _pRpcChannelBuffer);
01142     ( unsigned char __RPC_FAR * )sFilenames = 0;
01143     RpcTryFinally
01144         {
01145         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01146             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] );
01147
01148         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01149
01150         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01151                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01152                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01153                                        (unsigned char)0 );
01154
01155         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01156         bKeepCheckedOut = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
01157
01158
01159         *_pdwStubPhase = STUB_CALL_SERVER;
01160         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CheckinFiles(
01161                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01162                 handle,
01163                 sFilenames,
01164                 bKeepCheckedOut);
01165
01166         *_pdwStubPhase = STUB_MARSHAL;
01167
01168         _StubMsg.BufferLength = 4U;
01169         _StubMsg.BufferLength += 16;
01170
01171         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01172         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01173
01174         }
01175     RpcFinally
01176         {
01177         }
01178     RpcEndFinally
01179     _pRpcMessage->BufferLength =
01180         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01181
01182 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckoutFiles_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) |

Definition at line 934 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_FORMAT_STRING::Format.

00938 {
00939
00940     HRESULT _RetVal;
00941
00942     RPC_MESSAGE _RpcMessage;
00943
00944     MIDL_STUB_MESSAGE _StubMsg;
00945
00946     RpcTryExcept
00947         {
00948         NdrProxyInitialize(
00949                       ( void __RPC_FAR *  )This,
00950                       ( PRPC_MESSAGE  )&_RpcMessage,
00951                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00952                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00953                       8);
00954
00955
00956
00957         if(!sFilenames)
00958             {
00959             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00960             }
00961         RpcTryFinally
00962             {
00963
00964             _StubMsg.BufferLength = 4U + 12U;
00965             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00966                                            (unsigned char __RPC_FAR *)sFilenames,
00967                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00968
00969             NdrProxyGetBuffer(This, &_StubMsg);
00970             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
00971
00972             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00973                                          (unsigned char __RPC_FAR *)sFilenames,
00974                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00975
00976             NdrProxySendReceive(This, &_StubMsg);
00977
00978             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00979                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
00980
00981             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00982
00983             }
00984         RpcFinally
00985             {
00986             NdrProxyFreeBuffer(This, &_StubMsg);
00987
00988             }
00989         RpcEndFinally
00990
00991         }
00992     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00993         {
00994         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00995         }
00996     RpcEndExcept
00997     return _RetVal;
00998 }

void __RPC_STUB ICvsCoworker_CheckoutFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1000 of file CVS_Coworker_p.c.

References CheckoutFiles, _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_FORMAT_STRING::Format.

01005 {
01006     HRESULT _RetVal;
01007     MIDL_STUB_MESSAGE _StubMsg;
01008     int handle;
01009     const unsigned char __RPC_FAR *sFilenames;
01010
01011 NdrStubInitialize(
01012                      _pRpcMessage,
01013                      &_StubMsg,
01014                      &Object_StubDesc,
01015                      _pRpcChannelBuffer);
01016     ( unsigned char __RPC_FAR * )sFilenames = 0;
01017     RpcTryFinally
01018         {
01019         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01020             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01021
01022         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01023
01024         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01025                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01026                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01027                                        (unsigned char)0 );
01028
01029
01030         *_pdwStubPhase = STUB_CALL_SERVER;
01031         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CheckoutFiles(
01032                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01033                  handle,
01034                  sFilenames);
01035
01036         *_pdwStubPhase = STUB_MARSHAL;
01037
01038         _StubMsg.BufferLength = 4U;
01039         _StubMsg.BufferLength += 16;
01040
01041         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01042         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01043
01044         }
01045     RpcFinally
01046         {
01047         }
01048     RpcEndFinally
01049     _pRpcMessage->BufferLength =
01050         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01051
01052 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_CloseProject_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle
 | ) |

Definition at line 2749 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format.

02752 {
02753
02754     HRESULT _RetVal;
02755
02756     RPC_MESSAGE _RpcMessage;
02757
02758     MIDL_STUB_MESSAGE _StubMsg;
02759
02760     RpcTryExcept
02761         {
02762         NdrProxyInitialize(
02763                       ( void __RPC_FAR *  )This,
02764                       ( PRPC_MESSAGE  )&_RpcMessage,
02765                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02766                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02767                       22);
02768
02769
02770
02771         RpcTryFinally
02772             {
02773
02774             _StubMsg.BufferLength = 4U;
02775             NdrProxyGetBuffer(This, &_StubMsg);
02776             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02777
02778             NdrProxySendReceive(This, &_StubMsg);
02779
02780             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02781                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[146] );
02782
02783             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02784
02785             }
02786         RpcFinally
02787             {
02788             NdrProxyFreeBuffer(This, &_StubMsg);
02789
02790             }
02791         RpcEndFinally
02792
02793         }
02794     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02795         {
02796         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02797         }
02798     RpcEndExcept
02799     return _RetVal;
02800 }

void __RPC_STUB ICvsCoworker_CloseProject_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2802 of file CVS_Coworker_p.c.

References CloseProject, and _MIDL_PROC_FORMAT_STRING::Format.

02807 {
02808     HRESULT _RetVal;
02809     MIDL_STUB_MESSAGE _StubMsg;
02810     int handle;
02811
02812 NdrStubInitialize(
02813                      _pRpcMessage,
02814                      &_StubMsg,
02815                      &Object_StubDesc,
02816                      _pRpcChannelBuffer);
02817     RpcTryFinally
02818         {
02819         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02820             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[146] );
02821
02822         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02823
02824
02825         *_pdwStubPhase = STUB_CALL_SERVER;
02826         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CloseProject((ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,handle);
02827
02828         *_pdwStubPhase = STUB_MARSHAL;
02829
02830         _StubMsg.BufferLength = 4U;
02831         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02832         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02833
02834         }
02835     RpcFinally
02836         {
02837         }
02838     RpcEndFinally
02839     _pRpcMessage->BufferLength =
02840         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02841
02842 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_DiffFile_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilename,
 |  | BOOL | bIgnoreCase,
 |  | BOOL | bIgnoreBlanks
 | ) |

Definition at line 1711 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_FORMAT_STRING::Format.

01717 {
01718
01719     HRESULT _RetVal;
01720
01721     RPC_MESSAGE _RpcMessage;
01722
01723     MIDL_STUB_MESSAGE _StubMsg;
01724
01725     RpcTryExcept
01726         {
01727         NdrProxyInitialize(
01728                       ( void __RPC_FAR *  )This,
01729                       ( PRPC_MESSAGE  )&_RpcMessage,
01730                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01731                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01732                       14);
01733
01734
01735
01736         if(!sFilename)
01737             {
01738             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01739             }
01740         RpcTryFinally
01741             {
01742
01743             _StubMsg.BufferLength = 4U + 12U + 11U + 7U;
01744             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01745                                            (unsigned char __RPC_FAR *)sFilename,
01746                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01747
01748             NdrProxyGetBuffer(This, &_StubMsg);
01749             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01750
01751             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01752                                          (unsigned char __RPC_FAR *)sFilename,
01753                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01754
01755             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01756             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bIgnoreCase;
01757
01758             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bIgnoreBlanks;
01759
01760             NdrProxySendReceive(This, &_StubMsg);
01761
01762             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01763                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
01764
01765             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01766
01767             }
01768         RpcFinally
01769             {
01770             NdrProxyFreeBuffer(This, &_StubMsg);
01771
01772             }
01773         RpcEndFinally
01774
01775         }
01776     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01777         {
01778         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01779         }
01780     RpcEndExcept
01781     return _RetVal;
01782 }

void __RPC_STUB ICvsCoworker_DiffFile_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1784 of file CVS_Coworker_p.c.

References DiffFile, _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_FORMAT_STRING::Format.

01789 {
01790     HRESULT _RetVal;
01791     MIDL_STUB_MESSAGE _StubMsg;
01792     BOOL bIgnoreBlanks;
01793     BOOL bIgnoreCase;
01794     int handle;
01795     const unsigned char __RPC_FAR *sFilename;
01796
01797 NdrStubInitialize(
01798                      _pRpcMessage,
01799                      &_StubMsg,
01800                      &Object_StubDesc,
01801                      _pRpcChannelBuffer);
01802     ( unsigned char __RPC_FAR * )sFilename = 0;
01803     RpcTryFinally
01804         {
01805         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01806             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
01807
01808         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01809
01810         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01811                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilename,
01812                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01813                                        (unsigned char)0 );
01814
01815         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01816         bIgnoreCase = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
01817
01818         bIgnoreBlanks = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
01819
01820
01821         *_pdwStubPhase = STUB_CALL_SERVER;
01822         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> DiffFile(
01823             (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01824             handle,
01825             sFilename,
01826             bIgnoreCase,
01827             bIgnoreBlanks);
01828
01829         *_pdwStubPhase = STUB_MARSHAL;
01830
01831         _StubMsg.BufferLength = 4U;
01832         _StubMsg.BufferLength += 16;
01833
01834         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01835         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01836
01837         }
01838     RpcFinally
01839         {
01840         }
01841     RpcEndFinally
01842     _pRpcMessage->BufferLength =
01843         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01844
01845 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetErrorMessage_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | int | iError,
 |  | int | cbErrorBuffer,
 |  | unsigned char __RPC_FAR * | sErrorBuffer
 | ) |

Definition at line 181 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_FORMAT_STRING::Format.

00187 {
00188
00189     HRESULT _RetVal;
00190
00191     RPC_MESSAGE _RpcMessage;
00192
00193     MIDL_STUB_MESSAGE _StubMsg;
00194
00195     RpcTryExcept
00196         {
00197         NdrProxyInitialize(
00198                       ( void __RPC_FAR *  )This,
00199                       ( PRPC_MESSAGE  )&_RpcMessage,
00200                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00201                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00202                       4);
00203
00204
00205
00206         if(!sErrorBuffer)
00207             {
00208             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00209             }
00210         RpcTryFinally
00211             {
00212
00213             _StubMsg.BufferLength = 4U + 4U + 4U;
00214             NdrProxyGetBuffer(This, &_StubMsg);
00215             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
00216
00217             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = iError;
00218
00219             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbErrorBuffer;
00220
00221             NdrProxySendReceive(This, &_StubMsg);
00222
00223             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00224                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] );
00225
00226             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00227                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sErrorBuffer,
00228                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10],
00229                                            (unsigned char)0 );
00230
00231             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00232             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00233
00234             }
00235         RpcFinally
00236             {
00237             NdrProxyFreeBuffer(This, &_StubMsg);
00238
00239             }
00240         RpcEndFinally
00241
00242         }
00243     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00244         {
00245         _StubMsg.MaxCount = cbErrorBuffer;
00246
00247         NdrClearOutParameters(
00248                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00249                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[6],
00250                          ( void __RPC_FAR * )sErrorBuffer);
00251         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00252         }
00253     RpcEndExcept
00254     return _RetVal;
00255 }

void __RPC_STUB ICvsCoworker_GetErrorMessage_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 257 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and GetErrorMessage.

00262 {
00263     HRESULT _RetVal;
00264     MIDL_STUB_MESSAGE _StubMsg;
00265     int cbErrorBuffer;
00266     int handle;
00267     int iError;
00268     unsigned char __RPC_FAR *sErrorBuffer;
00269
00270 NdrStubInitialize(
00271                      _pRpcMessage,
00272                      &_StubMsg,
00273                      &Object_StubDesc,
00274                      _pRpcChannelBuffer);
00275     ( unsigned char __RPC_FAR * )sErrorBuffer = 0;
00276     RpcTryFinally
00277         {
00278         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00279             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] );
00280
00281         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00282
00283         iError = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00284
00285         cbErrorBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00286
00287         if(cbErrorBuffer * 1 < 0)
00288             {
00289             RpcRaiseException(RPC_X_INVALID_BOUND);
00290             }
00291         sErrorBuffer = NdrAllocate(&_StubMsg,cbErrorBuffer * 1);
00292
00293         *_pdwStubPhase = STUB_CALL_SERVER;
00294         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetErrorMessage(
00295                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00296                    handle,
00297                    iError,
00298                    cbErrorBuffer,
00299                    sErrorBuffer);
00300
00301         *_pdwStubPhase = STUB_MARSHAL;
00302
00303         _StubMsg.BufferLength = 12U + 11U;
00304         _StubMsg.MaxCount = cbErrorBuffer;
00305
00306         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00307                                        (unsigned char __RPC_FAR *)sErrorBuffer,
00308                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10] );
00309
00310         _StubMsg.BufferLength += 16;
00311
00312         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00313         _StubMsg.MaxCount = cbErrorBuffer;
00314
00315         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00316                                      (unsigned char __RPC_FAR *)sErrorBuffer,
00317                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10] );
00318
00319         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00320         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00321
00322         }
00323     RpcFinally
00324         {
00325         _StubMsg.MaxCount = cbErrorBuffer;
00326
00327         NdrPointerFree( &_StubMsg,
00328                         (unsigned char __RPC_FAR *)sErrorBuffer,
00329                         &__MIDL_TypeFormatString.Format[6] );
00330
00331         }
00332     RpcEndFinally
00333     _pRpcMessage->BufferLength =
00334         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00335
00336 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFileChanges_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | int | cbFilenameBuffer,
 |  | unsigned char __RPC_FAR * | sFilenameBuffer
 | ) |

Definition at line 2447 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_FORMAT_STRING::Format.

02452 {
02453
02454     HRESULT _RetVal;
02455
02456     RPC_MESSAGE _RpcMessage;
02457
02458     MIDL_STUB_MESSAGE _StubMsg;
02459
02460     RpcTryExcept
02461         {
02462         NdrProxyInitialize(
02463                       ( void __RPC_FAR *  )This,
02464                       ( PRPC_MESSAGE  )&_RpcMessage,
02465                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02466                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02467                       20);
02468
02469
02470
02471         if(!sFilenameBuffer)
02472             {
02473             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02474             }
02475         RpcTryFinally
02476             {
02477
02478             _StubMsg.BufferLength = 4U + 4U;
02479             NdrProxyGetBuffer(This, &_StubMsg);
02480             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02481
02482             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbFilenameBuffer;
02483
02484             NdrProxySendReceive(This, &_StubMsg);
02485
02486             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02487                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[126] );
02488
02489             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02490                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenameBuffer,
02491                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48],
02492                                            (unsigned char)0 );
02493
02494             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02495             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02496
02497             }
02498         RpcFinally
02499             {
02500             NdrProxyFreeBuffer(This, &_StubMsg);
02501
02502             }
02503         RpcEndFinally
02504
02505         }
02506     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02507         {
02508         _StubMsg.MaxCount = cbFilenameBuffer;
02509
02510         NdrClearOutParameters(
02511                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02512                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[44],
02513                          ( void __RPC_FAR * )sFilenameBuffer);
02514         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02515         }
02516     RpcEndExcept
02517     return _RetVal;
02518 }

void __RPC_STUB ICvsCoworker_GetFileChanges_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2520 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and GetFileChanges.

02525 {
02526     HRESULT _RetVal;
02527     MIDL_STUB_MESSAGE _StubMsg;
02528     int cbFilenameBuffer;
02529     int handle;
02530     unsigned char __RPC_FAR *sFilenameBuffer;
02531
02532 NdrStubInitialize(
02533                      _pRpcMessage,
02534                      &_StubMsg,
02535                      &Object_StubDesc,
02536                      _pRpcChannelBuffer);
02537     ( unsigned char __RPC_FAR * )sFilenameBuffer = 0;
02538     RpcTryFinally
02539         {
02540         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02541             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[126] );
02542
02543         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02544
02545         cbFilenameBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02546
02547         if(cbFilenameBuffer * 1 < 0)
02548             {
02549             RpcRaiseException(RPC_X_INVALID_BOUND);
02550             }
02551         sFilenameBuffer = NdrAllocate(&_StubMsg,cbFilenameBuffer * 1);
02552
02553         *_pdwStubPhase = STUB_CALL_SERVER;
02554         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetFileChanges(
02555                   (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02556                   handle,
02557                   cbFilenameBuffer,
02558                   sFilenameBuffer);
02559
02560         *_pdwStubPhase = STUB_MARSHAL;
02561
02562         _StubMsg.BufferLength = 12U + 11U;
02563         _StubMsg.MaxCount = cbFilenameBuffer;
02564
02565         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02566                                        (unsigned char __RPC_FAR *)sFilenameBuffer,
02567                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48] );
02568
02569         _StubMsg.BufferLength += 16;
02570
02571         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02572         _StubMsg.MaxCount = cbFilenameBuffer;
02573
02574         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02575                                      (unsigned char __RPC_FAR *)sFilenameBuffer,
02576                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48] );
02577
02578         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02579         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02580
02581         }
02582     RpcFinally
02583         {
02584         _StubMsg.MaxCount = cbFilenameBuffer;
02585
02586         NdrPointerFree( &_StubMsg,
02587                         (unsigned char __RPC_FAR *)sFilenameBuffer,
02588                         &__MIDL_TypeFormatString.Format[44] );
02589
02590         }
02591     RpcEndFinally
02592     _pRpcMessage->BufferLength =
02593         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02594
02595 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFilesToAdd_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | int | cbFilenamesBuffer,
 |  | unsigned char __RPC_FAR * | sFilenamesBuffer
 | ) |

Definition at line 2598 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_FORMAT_STRING::Format.

02603 {
02604
02605     HRESULT _RetVal;
02606
02607     RPC_MESSAGE _RpcMessage;
02608
02609     MIDL_STUB_MESSAGE _StubMsg;
02610
02611     RpcTryExcept
02612         {
02613         NdrProxyInitialize(
02614                       ( void __RPC_FAR *  )This,
02615                       ( PRPC_MESSAGE  )&_RpcMessage,
02616                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02617                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02618                       21);
02619
02620
02621
02622         if(!sFilenamesBuffer)
02623             {
02624             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02625             }
02626         RpcTryFinally
02627             {
02628
02629             _StubMsg.BufferLength = 4U + 4U;
02630             NdrProxyGetBuffer(This, &_StubMsg);
02631             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02632
02633             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbFilenamesBuffer;
02634
02635             NdrProxySendReceive(This, &_StubMsg);
02636
02637             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02638                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[136] );
02639
02640             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02641                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenamesBuffer,
02642                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58],
02643                                            (unsigned char)0 );
02644
02645             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02646             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02647
02648             }
02649         RpcFinally
02650             {
02651             NdrProxyFreeBuffer(This, &_StubMsg);
02652
02653             }
02654         RpcEndFinally
02655
02656         }
02657     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02658         {
02659         _StubMsg.MaxCount = cbFilenamesBuffer;
02660
02661         NdrClearOutParameters(
02662                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02663                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[54],
02664                          ( void __RPC_FAR * )sFilenamesBuffer);
02665         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02666         }
02667     RpcEndExcept
02668     return _RetVal;
02669 }

void __RPC_STUB ICvsCoworker_GetFilesToAdd_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2671 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and GetFilesToAdd.

02676 {
02677     HRESULT _RetVal;
02678     MIDL_STUB_MESSAGE _StubMsg;
02679     int cbFilenamesBuffer;
02680     int handle;
02681     unsigned char __RPC_FAR *sFilenamesBuffer;
02682
02683 NdrStubInitialize(
02684                      _pRpcMessage,
02685                      &_StubMsg,
02686                      &Object_StubDesc,
02687                      _pRpcChannelBuffer);
02688     ( unsigned char __RPC_FAR * )sFilenamesBuffer = 0;
02689     RpcTryFinally
02690         {
02691         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02692             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[136] );
02693
02694         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02695
02696         cbFilenamesBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02697
02698         if(cbFilenamesBuffer * 1 < 0)
02699             {
02700             RpcRaiseException(RPC_X_INVALID_BOUND);
02701             }
02702         sFilenamesBuffer = NdrAllocate(&_StubMsg,cbFilenamesBuffer * 1);
02703
02704         *_pdwStubPhase = STUB_CALL_SERVER;
02705         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetFilesToAdd(
02706                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02707                  handle,
02708                  cbFilenamesBuffer,
02709                  sFilenamesBuffer);
02710
02711         *_pdwStubPhase = STUB_MARSHAL;
02712
02713         _StubMsg.BufferLength = 12U + 11U;
02714         _StubMsg.MaxCount = cbFilenamesBuffer;
02715
02716         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02717                                        (unsigned char __RPC_FAR *)sFilenamesBuffer,
02718                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58] );
02719
02720         _StubMsg.BufferLength += 16;
02721
02722         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02723         _StubMsg.MaxCount = cbFilenamesBuffer;
02724
02725         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02726                                      (unsigned char __RPC_FAR *)sFilenamesBuffer,
02727                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58] );
02728
02729         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02730         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02731
02732         }
02733     RpcFinally
02734         {
02735         _StubMsg.MaxCount = cbFilenamesBuffer;
02736
02737         NdrPointerFree( &_StubMsg,
02738                         (unsigned char __RPC_FAR *)sFilenamesBuffer,
02739                         &__MIDL_TypeFormatString.Format[54] );
02740
02741         }
02742     RpcEndFinally
02743     _pRpcMessage->BufferLength =
02744         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02745
02746 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetLastError_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | int __RPC_FAR * | piError
 | ) |

Definition at line 65 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_FORMAT_STRING::Format.

00069 {
00070
00071     HRESULT _RetVal;
00072
00073     RPC_MESSAGE _RpcMessage;
00074
00075     MIDL_STUB_MESSAGE _StubMsg;
00076
00077     RpcTryExcept
00078         {
00079         NdrProxyInitialize(
00080                       ( void __RPC_FAR *  )This,
00081                       ( PRPC_MESSAGE  )&_RpcMessage,
00082                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00083                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00084                       3);
00085
00086
00087
00088         if(!piError)
00089             {
00090             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00091             }
00092         RpcTryFinally
00093             {
00094
00095             _StubMsg.BufferLength = 4U;
00096             NdrProxyGetBuffer(This, &_StubMsg);
00097             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
00098
00099             NdrProxySendReceive(This, &_StubMsg);
00100
00101             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00102                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
00103
00104             *piError = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00105
00106             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00107
00108             }
00109         RpcFinally
00110             {
00111             NdrProxyFreeBuffer(This, &_StubMsg);
00112
00113             }
00114         RpcEndFinally
00115
00116         }
00117     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00118         {
00119         NdrClearOutParameters(
00120                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00121                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00122                          ( void __RPC_FAR * )piError);
00123         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00124         }
00125     RpcEndExcept
00126     return _RetVal;
00127 }

void __RPC_STUB ICvsCoworker_GetLastError_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 129 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format.

00134 {
00135     int _M0;
00136     HRESULT _RetVal;
00137     MIDL_STUB_MESSAGE _StubMsg;
00138     int handle;
00139     int __RPC_FAR *piError;
00140
00141 NdrStubInitialize(
00142                      _pRpcMessage,
00143                      &_StubMsg,
00144                      &Object_StubDesc,
00145                      _pRpcChannelBuffer);
00146     ( int __RPC_FAR * )piError = 0;
00147     RpcTryFinally
00148         {
00149         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00150             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
00151
00152         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00153
00154         piError = &_M0;
00155
00156         *_pdwStubPhase = STUB_CALL_SERVER;
00157         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetLastError(
00158                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00159                 handle,
00160                 piError);
00161
00162         *_pdwStubPhase = STUB_MARSHAL;
00163
00164         _StubMsg.BufferLength = 4U + 4U;
00165         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00166         *(( int __RPC_FAR * )_StubMsg.Buffer)++ = *piError;
00167
00168         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00169
00170         }
00171     RpcFinally
00172         {
00173         }
00174     RpcEndFinally
00175     _pRpcMessage->BufferLength =
00176         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00177
00178 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_GetProject_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int __RPC_FAR * | pHandle,
 |  | const unsigned char __RPC_FAR * | sUsername,
 |  | int | cbProjectNameBuffer,
 |  | unsigned char __RPC_FAR * | sProjectName,
 |  | int | cbProjectHomeBuffer,
 |  | unsigned char __RPC_FAR * | sProjectHome,
 |  | BOOL | bAllowPathChange,
 |  | BOOL | bAllowNewProject,
 |  | BOOL __RPC_FAR * | pbNewProject
 | ) |

Definition at line 511 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_FORMAT_STRING::Format.

00522 {
00523
00524     HRESULT _RetVal;
00525
00526     RPC_MESSAGE _RpcMessage;
00527
00528     MIDL_STUB_MESSAGE _StubMsg;
00529
00530     RpcTryExcept
00531         {
00532         NdrProxyInitialize(
00533                       ( void __RPC_FAR *  )This,
00534                       ( PRPC_MESSAGE  )&_RpcMessage,
00535                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00536                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00537                       6);
00538
00539
00540
00541         if(!pHandle)
00542             {
00543             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00544             }
00545         if(!sUsername)
00546             {
00547             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00548             }
00549         if(!sProjectName)
00550             {
00551             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00552             }
00553         if(!sProjectHome)
00554             {
00555             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00556             }
00557         if(!pbNewProject)
00558             {
00559             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00560             }
00561         RpcTryFinally
00562             {
00563
00564             _StubMsg.BufferLength = 1U + 7U + 12U + 11U + 13U + 11U + 7U;
00565             _StubMsg.MaxCount = cbProjectNameBuffer;
00566
00567             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00568                                            (unsigned char __RPC_FAR *)sProjectName,
00569                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00570
00571             _StubMsg.MaxCount = cbProjectHomeBuffer;
00572
00573             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00574                                            (unsigned char __RPC_FAR *)sProjectHome,
00575                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00576
00577             NdrProxyGetBuffer(This, &_StubMsg);
00578             *(( unsigned char __RPC_FAR * )_StubMsg.Buffer)++ = *sUsername;
00579
00580             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00581             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbProjectNameBuffer;
00582
00583             _StubMsg.MaxCount = cbProjectNameBuffer;
00584
00585             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00586                                          (unsigned char __RPC_FAR *)sProjectName,
00587                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00588
00589             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00590             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbProjectHomeBuffer;
00591
00592             _StubMsg.MaxCount = cbProjectHomeBuffer;
00593
00594             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00595                                          (unsigned char __RPC_FAR *)sProjectHome,
00596                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00597
00598             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00599             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bAllowPathChange;
00600
00601             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bAllowNewProject;
00602
00603             NdrProxySendReceive(This, &_StubMsg);
00604
00605             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00606                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[38] );
00607
00608             *pHandle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00609
00610             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00611                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectName,
00612                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28],
00613                                            (unsigned char)0 );
00614
00615             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00616                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectHome,
00617                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38],
00618                                            (unsigned char)0 );
00619
00620             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00621             *pbNewProject = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00622
00623             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00624
00625             }
00626         RpcFinally
00627             {
00628             NdrProxyFreeBuffer(This, &_StubMsg);
00629
00630             }
00631         RpcEndFinally
00632
00633         }
00634     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00635         {
00636         NdrClearOutParameters(
00637                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00638                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00639                          ( void __RPC_FAR * )pHandle);
00640         _StubMsg.MaxCount = cbProjectNameBuffer;
00641
00642         NdrClearOutParameters(
00643                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00644                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[24],
00645                          ( void __RPC_FAR * )sProjectName);
00646         _StubMsg.MaxCount = cbProjectHomeBuffer;
00647
00648         NdrClearOutParameters(
00649                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00650                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[34],
00651                          ( void __RPC_FAR * )sProjectHome);
00652         NdrClearOutParameters(
00653                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00654                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00655                          ( void __RPC_FAR * )pbNewProject);
00656         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00657         }
00658     RpcEndExcept
00659     return _RetVal;
00660 }

void __RPC_STUB ICvsCoworker_GetProject_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 662 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and GetProject.

00667 {
00668     int _M14;
00669     BOOL _M15;
00670     HRESULT _RetVal;
00671     MIDL_STUB_MESSAGE _StubMsg;
00672     BOOL bAllowNewProject;
00673     BOOL bAllowPathChange;
00674     int cbProjectHomeBuffer;
00675     int cbProjectNameBuffer;
00676     int __RPC_FAR *pHandle;
00677     BOOL __RPC_FAR *pbNewProject;
00678     unsigned char __RPC_FAR *sProjectHome;
00679     unsigned char __RPC_FAR *sProjectName;
00680     const unsigned char __RPC_FAR *sUsername;
00681
00682 NdrStubInitialize(
00683                      _pRpcMessage,
00684                      &_StubMsg,
00685                      &Object_StubDesc,
00686                      _pRpcChannelBuffer);
00687     ( int __RPC_FAR * )pHandle = 0;
00688     ( unsigned char __RPC_FAR * )sUsername = 0;
00689     ( unsigned char __RPC_FAR * )sProjectName = 0;
00690     ( unsigned char __RPC_FAR * )sProjectHome = 0;
00691     ( BOOL __RPC_FAR * )pbNewProject = 0;
00692     RpcTryFinally
00693         {
00694         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00695             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[38] );
00696
00697         sUsername = ( unsigned char __RPC_FAR * )_StubMsg.Buffer;
00698         _StubMsg.Buffer += sizeof( unsigned char  );
00699
00700         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00701         cbProjectNameBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00702
00703         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00704                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectName,
00705                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28],
00706                                        (unsigned char)0 );
00707
00708         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00709         cbProjectHomeBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00710
00711         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00712                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectHome,
00713                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38],
00714                                        (unsigned char)0 );
00715
00716         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00717         bAllowPathChange = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00718
00719         bAllowNewProject = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00720
00721         pHandle = &_M14;
00722         pbNewProject = &_M15;
00723
00724         *_pdwStubPhase = STUB_CALL_SERVER;
00725         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetProject(
00726               (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00727               pHandle,
00728               sUsername,
00729               cbProjectNameBuffer,
00730               sProjectName,
00731               cbProjectHomeBuffer,
00732               sProjectHome,
00733               bAllowPathChange,
00734               bAllowNewProject,
00735               pbNewProject);
00736
00737         *_pdwStubPhase = STUB_MARSHAL;
00738
00739         _StubMsg.BufferLength = 4U + 12U + 13U + 11U + 7U;
00740         _StubMsg.MaxCount = cbProjectNameBuffer;
00741
00742         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00743                                        (unsigned char __RPC_FAR *)sProjectName,
00744                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00745
00746         _StubMsg.MaxCount = cbProjectHomeBuffer;
00747
00748         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00749                                        (unsigned char __RPC_FAR *)sProjectHome,
00750                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00751
00752         _StubMsg.BufferLength += 16;
00753
00754         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00755         *(( int __RPC_FAR * )_StubMsg.Buffer)++ = *pHandle;
00756
00757         _StubMsg.MaxCount = cbProjectNameBuffer;
00758
00759         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00760                                      (unsigned char __RPC_FAR *)sProjectName,
00761                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00762
00763         _StubMsg.MaxCount = cbProjectHomeBuffer;
00764
00765         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00766                                      (unsigned char __RPC_FAR *)sProjectHome,
00767                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00768
00769         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00770         *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = *pbNewProject;
00771
00772         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00773
00774         }
00775     RpcFinally
00776         {
00777         _StubMsg.MaxCount = cbProjectNameBuffer;
00778
00779         NdrPointerFree( &_StubMsg,
00780                         (unsigned char __RPC_FAR *)sProjectName,
00781                         &__MIDL_TypeFormatString.Format[24] );
00782
00783         _StubMsg.MaxCount = cbProjectHomeBuffer;
00784
00785         NdrPointerFree( &_StubMsg,
00786                         (unsigned char __RPC_FAR *)sProjectHome,
00787                         &__MIDL_TypeFormatString.Format[34] );
00788
00789         }
00790     RpcEndFinally
00791     _pRpcMessage->BufferLength =
00792         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00793
00794 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_HasAdvancedOptionsForCommand_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | CvsCommand | command,
 |  | BOOL __RPC_FAR * | pbAdvancedOptions
 | ) |

Definition at line 2211 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_FORMAT_STRING::Format.

02216 {
02217
02218     HRESULT _RetVal;
02219
02220     RPC_MESSAGE _RpcMessage;
02221
02222     MIDL_STUB_MESSAGE _StubMsg;
02223
02224     RpcTryExcept
02225         {
02226         NdrProxyInitialize(
02227                       ( void __RPC_FAR *  )This,
02228                       ( PRPC_MESSAGE  )&_RpcMessage,
02229                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02230                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02231                       18);
02232
02233
02234
02235         if(!pbAdvancedOptions)
02236             {
02237             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02238             }
02239         RpcTryFinally
02240             {
02241
02242             _StubMsg.BufferLength = 4U + 2U;
02243             NdrProxyGetBuffer(This, &_StubMsg);
02244             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02245
02246             NdrSimpleTypeMarshall(
02247                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02248                          ( unsigned char __RPC_FAR * )&command,
02249                          13);
02250             NdrProxySendReceive(This, &_StubMsg);
02251
02252             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02253                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[110] );
02254
02255             *pbAdvancedOptions = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
02256
02257             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02258
02259             }
02260         RpcFinally
02261             {
02262             NdrProxyFreeBuffer(This, &_StubMsg);
02263
02264             }
02265         RpcEndFinally
02266
02267         }
02268     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02269         {
02270         NdrClearOutParameters(
02271                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02272                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
02273                          ( void __RPC_FAR * )pbAdvancedOptions);
02274         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02275         }
02276     RpcEndExcept
02277     return _RetVal;
02278 }

void __RPC_STUB ICvsCoworker_HasAdvancedOptionsForCommand_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2280 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, and HasAdvancedOptionsForCommand.

02285 {
02286     BOOL _M42;
02287     HRESULT _RetVal;
02288     MIDL_STUB_MESSAGE _StubMsg;
02289     CvsCommand command;
02290     int handle;
02291     BOOL __RPC_FAR *pbAdvancedOptions;
02292
02293 NdrStubInitialize(
02294                      _pRpcMessage,
02295                      &_StubMsg,
02296                      &Object_StubDesc,
02297                      _pRpcChannelBuffer);
02298     ( BOOL __RPC_FAR * )pbAdvancedOptions = 0;
02299     RpcTryFinally
02300         {
02301         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02302             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[110] );
02303
02304         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02305
02306         NdrSimpleTypeUnmarshall(
02307                            ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02308                            ( unsigned char __RPC_FAR * )&command,
02309                            13);
02310         pbAdvancedOptions = &_M42;
02311
02312         *_pdwStubPhase = STUB_CALL_SERVER;
02313         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> HasAdvancedOptionsForCommand(
02314                                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02315                                 handle,
02316                                 command,
02317                                 pbAdvancedOptions);
02318
02319         *_pdwStubPhase = STUB_MARSHAL;
02320
02321         _StubMsg.BufferLength = 4U + 4U;
02322         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02323         *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = *pbAdvancedOptions;
02324
02325         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02326
02327         }
02328     RpcFinally
02329         {
02330         }
02331     RpcEndFinally
02332     _pRpcMessage->BufferLength =
02333         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02334
02335 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_OpenProject_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int __RPC_FAR * | pHandle,
 |  | const unsigned char __RPC_FAR * | sUsername,
 |  | const unsigned char __RPC_FAR * | sProjectName,
 |  | const unsigned char __RPC_FAR * | sProjectHome
 | ) |

Definition at line 339 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_FORMAT_STRING::Format.

00345 {
00346
00347     HRESULT _RetVal;
00348
00349     RPC_MESSAGE _RpcMessage;
00350
00351     MIDL_STUB_MESSAGE _StubMsg;
00352
00353     RpcTryExcept
00354         {
00355         NdrProxyInitialize(
00356                       ( void __RPC_FAR *  )This,
00357                       ( PRPC_MESSAGE  )&_RpcMessage,
00358                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00359                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00360                       5);
00361
00362
00363
00364         if(!pHandle)
00365             {
00366             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00367             }
00368         if(!sUsername)
00369             {
00370             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00371             }
00372         if(!sProjectName)
00373             {
00374             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00375             }
00376         if(!sProjectHome)
00377             {
00378             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00379             }
00380         RpcTryFinally
00381             {
00382
00383             _StubMsg.BufferLength = 12U + 13U + 13U;
00384             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00385                                            (unsigned char __RPC_FAR *)sUsername,
00386                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00387
00388             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00389                                            (unsigned char __RPC_FAR *)sProjectName,
00390                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00391
00392             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00393                                            (unsigned char __RPC_FAR *)sProjectHome,
00394                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00395
00396             NdrProxyGetBuffer(This, &_StubMsg);
00397             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00398                                          (unsigned char __RPC_FAR *)sUsername,
00399                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00400
00401             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00402                                          (unsigned char __RPC_FAR *)sProjectName,
00403                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00404
00405             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00406                                          (unsigned char __RPC_FAR *)sProjectHome,
00407                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00408
00409             NdrProxySendReceive(This, &_StubMsg);
00410
00411             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00412                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[20] );
00413
00414             *pHandle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00415
00416             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00417
00418             }
00419         RpcFinally
00420             {
00421             NdrProxyFreeBuffer(This, &_StubMsg);
00422
00423             }
00424         RpcEndFinally
00425
00426         }
00427     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00428         {
00429         NdrClearOutParameters(
00430                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00431                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00432                          ( void __RPC_FAR * )pHandle);
00433         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00434         }
00435     RpcEndExcept
00436     return _RetVal;
00437 }

void __RPC_STUB ICvsCoworker_OpenProject_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 439 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and OpenProject.

00444 {
00445     int _M9;
00446     HRESULT _RetVal;
00447     MIDL_STUB_MESSAGE _StubMsg;
00448     int __RPC_FAR *pHandle;
00449     const unsigned char __RPC_FAR *sProjectHome;
00450     const unsigned char __RPC_FAR *sProjectName;
00451     const unsigned char __RPC_FAR *sUsername;
00452
00453 NdrStubInitialize(
00454                      _pRpcMessage,
00455                      &_StubMsg,
00456                      &Object_StubDesc,
00457                      _pRpcChannelBuffer);
00458     ( int __RPC_FAR * )pHandle = 0;
00459     ( unsigned char __RPC_FAR * )sUsername = 0;
00460     ( unsigned char __RPC_FAR * )sProjectName = 0;
00461     ( unsigned char __RPC_FAR * )sProjectHome = 0;
00462     RpcTryFinally
00463         {
00464         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00465             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[20] );
00466
00467         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00468                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sUsername,
00469                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00470                                        (unsigned char)0 );
00471
00472         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00473                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectName,
00474                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00475                                        (unsigned char)0 );
00476
00477         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00478                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectHome,
00479                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00480                                        (unsigned char)0 );
00481
00482         pHandle = &_M9;
00483
00484         *_pdwStubPhase = STUB_CALL_SERVER;
00485         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> OpenProject(
00486                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00487                pHandle,
00488                sUsername,
00489                sProjectName,
00490                sProjectHome);
00491
00492         *_pdwStubPhase = STUB_MARSHAL;
00493
00494         _StubMsg.BufferLength = 4U + 4U;
00495         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00496         *(( int __RPC_FAR * )_StubMsg.Buffer)++ = *pHandle;
00497
00498         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00499
00500         }
00501     RpcFinally
00502         {
00503         }
00504     RpcEndFinally
00505     _pRpcMessage->BufferLength =
00506         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00507
00508 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_RemoveFiles_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) |

Definition at line 1448 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_FORMAT_STRING::Format.

01452 {
01453
01454     HRESULT _RetVal;
01455
01456     RPC_MESSAGE _RpcMessage;
01457
01458     MIDL_STUB_MESSAGE _StubMsg;
01459
01460     RpcTryExcept
01461         {
01462         NdrProxyInitialize(
01463                       ( void __RPC_FAR *  )This,
01464                       ( PRPC_MESSAGE  )&_RpcMessage,
01465                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01466                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01467                       12);
01468
01469
01470
01471         if(!sFilenames)
01472             {
01473             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01474             }
01475         RpcTryFinally
01476             {
01477
01478             _StubMsg.BufferLength = 4U + 12U;
01479             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01480                                            (unsigned char __RPC_FAR *)sFilenames,
01481                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01482
01483             NdrProxyGetBuffer(This, &_StubMsg);
01484             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01485
01486             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01487                                          (unsigned char __RPC_FAR *)sFilenames,
01488                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01489
01490             NdrProxySendReceive(This, &_StubMsg);
01491
01492             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01493                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01494
01495             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01496
01497             }
01498         RpcFinally
01499             {
01500             NdrProxyFreeBuffer(This, &_StubMsg);
01501
01502             }
01503         RpcEndFinally
01504
01505         }
01506     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01507         {
01508         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01509         }
01510     RpcEndExcept
01511     return _RetVal;
01512 }

void __RPC_STUB ICvsCoworker_RemoveFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1514 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and RemoveFiles.

01519 {
01520     HRESULT _RetVal;
01521     MIDL_STUB_MESSAGE _StubMsg;
01522     int handle;
01523     const unsigned char __RPC_FAR *sFilenames;
01524
01525 NdrStubInitialize(
01526                      _pRpcMessage,
01527                      &_StubMsg,
01528                      &Object_StubDesc,
01529                      _pRpcChannelBuffer);
01530     ( unsigned char __RPC_FAR * )sFilenames = 0;
01531     RpcTryFinally
01532         {
01533         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01534             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01535
01536         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01537
01538         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01539                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01540                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01541                                        (unsigned char)0 );
01542
01543
01544         *_pdwStubPhase = STUB_CALL_SERVER;
01545         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> RemoveFiles(
01546                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01547                handle,
01548                sFilenames);
01549
01550         *_pdwStubPhase = STUB_MARSHAL;
01551
01552         _StubMsg.BufferLength = 4U;
01553         _StubMsg.BufferLength += 16;
01554
01555         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01556         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01557
01558         }
01559     RpcFinally
01560         {
01561         }
01562     RpcEndFinally
01563     _pRpcMessage->BufferLength =
01564         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01565
01566 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_RenameFile_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sOldFilename,
 |  | const unsigned char __RPC_FAR * | sNewFilename
 | ) |

Definition at line 1569 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_FORMAT_STRING::Format.

01574 {
01575
01576     HRESULT _RetVal;
01577
01578     RPC_MESSAGE _RpcMessage;
01579
01580     MIDL_STUB_MESSAGE _StubMsg;
01581
01582     RpcTryExcept
01583         {
01584         NdrProxyInitialize(
01585                       ( void __RPC_FAR *  )This,
01586                       ( PRPC_MESSAGE  )&_RpcMessage,
01587                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01588                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01589                       13);
01590
01591
01592
01593         if(!sOldFilename)
01594             {
01595             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01596             }
01597         if(!sNewFilename)
01598             {
01599             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01600             }
01601         RpcTryFinally
01602             {
01603
01604             _StubMsg.BufferLength = 4U + 12U + 13U;
01605             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01606                                            (unsigned char __RPC_FAR *)sOldFilename,
01607                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01608
01609             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01610                                            (unsigned char __RPC_FAR *)sNewFilename,
01611                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01612
01613             NdrProxyGetBuffer(This, &_StubMsg);
01614             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01615
01616             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01617                                          (unsigned char __RPC_FAR *)sOldFilename,
01618                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01619
01620             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01621                                          (unsigned char __RPC_FAR *)sNewFilename,
01622                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01623
01624             NdrProxySendReceive(This, &_StubMsg);
01625
01626             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01627                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01628
01629             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01630
01631             }
01632         RpcFinally
01633             {
01634             NdrProxyFreeBuffer(This, &_StubMsg);
01635
01636             }
01637         RpcEndFinally
01638
01639         }
01640     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01641         {
01642         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01643         }
01644     RpcEndExcept
01645     return _RetVal;
01646 }

void __RPC_STUB ICvsCoworker_RenameFile_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1648 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and RenameFile.

01653 {
01654     HRESULT _RetVal;
01655     MIDL_STUB_MESSAGE _StubMsg;
01656     int handle;
01657     const unsigned char __RPC_FAR *sNewFilename;
01658     const unsigned char __RPC_FAR *sOldFilename;
01659
01660 NdrStubInitialize(
01661                      _pRpcMessage,
01662                      &_StubMsg,
01663                      &Object_StubDesc,
01664                      _pRpcChannelBuffer);
01665     ( unsigned char __RPC_FAR * )sOldFilename = 0;
01666     ( unsigned char __RPC_FAR * )sNewFilename = 0;
01667     RpcTryFinally
01668         {
01669         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01670             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01671
01672         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01673
01674         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01675                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sOldFilename,
01676                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01677                                        (unsigned char)0 );
01678
01679         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01680                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sNewFilename,
01681                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01682                                        (unsigned char)0 );
01683
01684
01685         *_pdwStubPhase = STUB_CALL_SERVER;
01686         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> RenameFile(
01687               (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01688               handle,
01689               sOldFilename,
01690               sNewFilename);
01691
01692         *_pdwStubPhase = STUB_MARSHAL;
01693
01694         _StubMsg.BufferLength = 4U;
01695         _StubMsg.BufferLength += 16;
01696
01697         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01698         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01699
01700         }
01701     RpcFinally
01702         {
01703         }
01704     RpcEndFinally
01705     _pRpcMessage->BufferLength =
01706         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01707
01708 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | CvsCommand | command
 | ) |

Definition at line 2338 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format.

02342 {
02343
02344     HRESULT _RetVal;
02345
02346     RPC_MESSAGE _RpcMessage;
02347
02348     MIDL_STUB_MESSAGE _StubMsg;
02349
02350     RpcTryExcept
02351         {
02352         NdrProxyInitialize(
02353                       ( void __RPC_FAR *  )This,
02354                       ( PRPC_MESSAGE  )&_RpcMessage,
02355                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02356                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02357                       19);
02358
02359
02360
02361         RpcTryFinally
02362             {
02363
02364             _StubMsg.BufferLength = 4U + 2U;
02365             NdrProxyGetBuffer(This, &_StubMsg);
02366             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02367
02368             NdrSimpleTypeMarshall(
02369                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02370                          ( unsigned char __RPC_FAR * )&command,
02371                          13);
02372             NdrProxySendReceive(This, &_StubMsg);
02373
02374             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02375                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[120] );
02376
02377             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02378
02379             }
02380         RpcFinally
02381             {
02382             NdrProxyFreeBuffer(This, &_StubMsg);
02383
02384             }
02385         RpcEndFinally
02386
02387         }
02388     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02389         {
02390         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02391         }
02392     RpcEndExcept
02393     return _RetVal;
02394 }

void __RPC_STUB ICvsCoworker_ShowAdvancedOptionsForCommand_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2396 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, and ShowAdvancedOptionsForCommand.

02401 {
02402     HRESULT _RetVal;
02403     MIDL_STUB_MESSAGE _StubMsg;
02404     CvsCommand command;
02405     int handle;
02406
02407 NdrStubInitialize(
02408                      _pRpcMessage,
02409                      &_StubMsg,
02410                      &Object_StubDesc,
02411                      _pRpcChannelBuffer);
02412     RpcTryFinally
02413         {
02414         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02415             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[120] );
02416
02417         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02418
02419         NdrSimpleTypeUnmarshall(
02420                            ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02421                            ( unsigned char __RPC_FAR * )&command,
02422                            13);
02423
02424         *_pdwStubPhase = STUB_CALL_SERVER;
02425         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowAdvancedOptionsForCommand(
02426                                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02427                                  handle,
02428                                  command);
02429
02430         *_pdwStubPhase = STUB_MARSHAL;
02431
02432         _StubMsg.BufferLength = 4U;
02433         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02434         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02435
02436         }
02437     RpcFinally
02438         {
02439         }
02440     RpcEndFinally
02441     _pRpcMessage->BufferLength =
02442         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02443
02444 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileHistory_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) |

Definition at line 1848 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_FORMAT_STRING::Format.

01852 {
01853
01854     HRESULT _RetVal;
01855
01856     RPC_MESSAGE _RpcMessage;
01857
01858     MIDL_STUB_MESSAGE _StubMsg;
01859
01860     RpcTryExcept
01861         {
01862         NdrProxyInitialize(
01863                       ( void __RPC_FAR *  )This,
01864                       ( PRPC_MESSAGE  )&_RpcMessage,
01865                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01866                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01867                       15);
01868
01869
01870
01871         if(!sFilenames)
01872             {
01873             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01874             }
01875         RpcTryFinally
01876             {
01877
01878             _StubMsg.BufferLength = 4U + 12U;
01879             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01880                                            (unsigned char __RPC_FAR *)sFilenames,
01881                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01882
01883             NdrProxyGetBuffer(This, &_StubMsg);
01884             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01885
01886             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01887                                          (unsigned char __RPC_FAR *)sFilenames,
01888                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01889
01890             NdrProxySendReceive(This, &_StubMsg);
01891
01892             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01893                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01894
01895             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01896
01897             }
01898         RpcFinally
01899             {
01900             NdrProxyFreeBuffer(This, &_StubMsg);
01901
01902             }
01903         RpcEndFinally
01904
01905         }
01906     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01907         {
01908         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01909         }
01910     RpcEndExcept
01911     return _RetVal;
01912 }

void __RPC_STUB ICvsCoworker_ShowFileHistory_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1914 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and ShowFileHistory.

01919 {
01920     HRESULT _RetVal;
01921     MIDL_STUB_MESSAGE _StubMsg;
01922     int handle;
01923     const unsigned char __RPC_FAR *sFilenames;
01924
01925 NdrStubInitialize(
01926                      _pRpcMessage,
01927                      &_StubMsg,
01928                      &Object_StubDesc,
01929                      _pRpcChannelBuffer);
01930     ( unsigned char __RPC_FAR * )sFilenames = 0;
01931     RpcTryFinally
01932         {
01933         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01934             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01935
01936         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01937
01938         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01939                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01940                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01941                                        (unsigned char)0 );
01942
01943
01944         *_pdwStubPhase = STUB_CALL_SERVER;
01945         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowFileHistory(
01946                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01947                    handle,
01948                    sFilenames);
01949
01950         *_pdwStubPhase = STUB_MARSHAL;
01951
01952         _StubMsg.BufferLength = 4U;
01953         _StubMsg.BufferLength += 16;
01954
01955         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01956         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01957
01958         }
01959     RpcFinally
01960         {
01961         }
01962     RpcEndFinally
01963     _pRpcMessage->BufferLength =
01964         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01965
01966 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileProperties_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilename
 | ) |

Definition at line 1969 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_FORMAT_STRING::Format.

01973 {
01974
01975     HRESULT _RetVal;
01976
01977     RPC_MESSAGE _RpcMessage;
01978
01979     MIDL_STUB_MESSAGE _StubMsg;
01980
01981     RpcTryExcept
01982         {
01983         NdrProxyInitialize(
01984                       ( void __RPC_FAR *  )This,
01985                       ( PRPC_MESSAGE  )&_RpcMessage,
01986                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01987                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01988                       16);
01989
01990
01991
01992         if(!sFilename)
01993             {
01994             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01995             }
01996         RpcTryFinally
01997             {
01998
01999             _StubMsg.BufferLength = 4U + 12U;
02000             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02001                                            (unsigned char __RPC_FAR *)sFilename,
02002                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02003
02004             NdrProxyGetBuffer(This, &_StubMsg);
02005             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02006
02007             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02008                                          (unsigned char __RPC_FAR *)sFilename,
02009                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02010
02011             NdrProxySendReceive(This, &_StubMsg);
02012
02013             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02014                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02015
02016             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02017
02018             }
02019         RpcFinally
02020             {
02021             NdrProxyFreeBuffer(This, &_StubMsg);
02022
02023             }
02024         RpcEndFinally
02025
02026         }
02027     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02028         {
02029         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02030         }
02031     RpcEndExcept
02032     return _RetVal;
02033 }

void __RPC_STUB ICvsCoworker_ShowFileProperties_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2035 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and ShowFileProperties.

02040 {
02041     HRESULT _RetVal;
02042     MIDL_STUB_MESSAGE _StubMsg;
02043     int handle;
02044     const unsigned char __RPC_FAR *sFilename;
02045
02046 NdrStubInitialize(
02047                      _pRpcMessage,
02048                      &_StubMsg,
02049                      &Object_StubDesc,
02050                      _pRpcChannelBuffer);
02051     ( unsigned char __RPC_FAR * )sFilename = 0;
02052     RpcTryFinally
02053         {
02054         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02055             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02056
02057         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02058
02059         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02060                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilename,
02061                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02062                                        (unsigned char)0 );
02063
02064
02065         *_pdwStubPhase = STUB_CALL_SERVER;
02066         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowFileProperties(
02067                       (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02068                       handle,
02069                       sFilename);
02070
02071         *_pdwStubPhase = STUB_MARSHAL;
02072
02073         _StubMsg.BufferLength = 4U;
02074         _StubMsg.BufferLength += 16;
02075
02076         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02077         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02078
02079         }
02080     RpcFinally
02081         {
02082         }
02083     RpcEndFinally
02084     _pRpcMessage->BufferLength =
02085         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02086
02087 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowUserInterface_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) |

Definition at line 2090 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_FORMAT_STRING::Format.

02094 {
02095
02096     HRESULT _RetVal;
02097
02098     RPC_MESSAGE _RpcMessage;
02099
02100     MIDL_STUB_MESSAGE _StubMsg;
02101
02102     RpcTryExcept
02103         {
02104         NdrProxyInitialize(
02105                       ( void __RPC_FAR *  )This,
02106                       ( PRPC_MESSAGE  )&_RpcMessage,
02107                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02108                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02109                       17);
02110
02111
02112
02113         if(!sFilenames)
02114             {
02115             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02116             }
02117         RpcTryFinally
02118             {
02119
02120             _StubMsg.BufferLength = 4U + 12U;
02121             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02122                                            (unsigned char __RPC_FAR *)sFilenames,
02123                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02124
02125             NdrProxyGetBuffer(This, &_StubMsg);
02126             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02127
02128             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02129                                          (unsigned char __RPC_FAR *)sFilenames,
02130                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02131
02132             NdrProxySendReceive(This, &_StubMsg);
02133
02134             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02135                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02136
02137             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02138
02139             }
02140         RpcFinally
02141             {
02142             NdrProxyFreeBuffer(This, &_StubMsg);
02143
02144             }
02145         RpcEndFinally
02146
02147         }
02148     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02149         {
02150         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02151         }
02152     RpcEndExcept
02153     return _RetVal;
02154 }

void __RPC_STUB ICvsCoworker_ShowUserInterface_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 2156 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and ShowUserInterface.

02161 {
02162     HRESULT _RetVal;
02163     MIDL_STUB_MESSAGE _StubMsg;
02164     int handle;
02165     const unsigned char __RPC_FAR *sFilenames;
02166
02167 NdrStubInitialize(
02168                      _pRpcMessage,
02169                      &_StubMsg,
02170                      &Object_StubDesc,
02171                      _pRpcChannelBuffer);
02172     ( unsigned char __RPC_FAR * )sFilenames = 0;
02173     RpcTryFinally
02174         {
02175         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02176             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02177
02178         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02179
02180         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02181                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
02182                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02183                                        (unsigned char)0 );
02184
02185
02186         *_pdwStubPhase = STUB_CALL_SERVER;
02187         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowUserInterface(
02188                      (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02189                      handle,
02190                      sFilenames);
02191
02192         *_pdwStubPhase = STUB_MARSHAL;
02193
02194         _StubMsg.BufferLength = 4U;
02195         _StubMsg.BufferLength += 16;
02196
02197         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02198         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02199
02200         }
02201     RpcFinally
02202         {
02203         }
02204     RpcEndFinally
02205     _pRpcMessage->BufferLength =
02206         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02207
02208 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_UncheckoutFiles_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) |

Definition at line 1185 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_FORMAT_STRING::Format.

01189 {
01190
01191     HRESULT _RetVal;
01192
01193     RPC_MESSAGE _RpcMessage;
01194
01195     MIDL_STUB_MESSAGE _StubMsg;
01196
01197     RpcTryExcept
01198         {
01199         NdrProxyInitialize(
01200                       ( void __RPC_FAR *  )This,
01201                       ( PRPC_MESSAGE  )&_RpcMessage,
01202                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01203                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01204                       10);
01205
01206
01207
01208         if(!sFilenames)
01209             {
01210             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01211             }
01212         RpcTryFinally
01213             {
01214
01215             _StubMsg.BufferLength = 4U + 12U;
01216             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01217                                            (unsigned char __RPC_FAR *)sFilenames,
01218                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01219
01220             NdrProxyGetBuffer(This, &_StubMsg);
01221             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01222
01223             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01224                                          (unsigned char __RPC_FAR *)sFilenames,
01225                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01226
01227             NdrProxySendReceive(This, &_StubMsg);
01228
01229             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01230                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01231
01232             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01233
01234             }
01235         RpcFinally
01236             {
01237             NdrProxyFreeBuffer(This, &_StubMsg);
01238
01239             }
01240         RpcEndFinally
01241
01242         }
01243     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01244         {
01245         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01246         }
01247     RpcEndExcept
01248     return _RetVal;
01249 }

void __RPC_STUB ICvsCoworker_UncheckoutFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 1251 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and UncheckoutFiles.

01256 {
01257     HRESULT _RetVal;
01258     MIDL_STUB_MESSAGE _StubMsg;
01259     int handle;
01260     const unsigned char __RPC_FAR *sFilenames;
01261
01262 NdrStubInitialize(
01263                      _pRpcMessage,
01264                      &_StubMsg,
01265                      &Object_StubDesc,
01266                      _pRpcChannelBuffer);
01267     ( unsigned char __RPC_FAR * )sFilenames = 0;
01268     RpcTryFinally
01269         {
01270         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01271             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01272
01273         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01274
01275         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01276                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01277                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01278                                        (unsigned char)0 );
01279
01280
01281         *_pdwStubPhase = STUB_CALL_SERVER;
01282         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> UncheckoutFiles(
01283                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01284                    handle,
01285                    sFilenames);
01286
01287         *_pdwStubPhase = STUB_MARSHAL;
01288
01289         _StubMsg.BufferLength = 4U;
01290         _StubMsg.BufferLength += 16;
01291
01292         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01293         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01294
01295         }
01296     RpcFinally
01297         {
01298         }
01299     RpcEndFinally
01300     _pRpcMessage->BufferLength =
01301         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01302
01303 }

HRESULT STDMETHODCALLTYPE ICvsCoworker_UpdateFiles_Proxy | ( | ICvsCoworker __RPC_FAR * | This,
 |  | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames,
 |  | BOOL | bDirectories,
 |  | BOOL | bRecurse
 | ) |

Definition at line 797 of file CVS_Coworker_p.c.

References _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_FORMAT_STRING::Format.

00803 {
00804
00805     HRESULT _RetVal;
00806
00807     RPC_MESSAGE _RpcMessage;
00808
00809     MIDL_STUB_MESSAGE _StubMsg;
00810
00811     RpcTryExcept
00812         {
00813         NdrProxyInitialize(
00814                       ( void __RPC_FAR *  )This,
00815                       ( PRPC_MESSAGE  )&_RpcMessage,
00816                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00817                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00818                       7);
00819
00820
00821
00822         if(!sFilenames)
00823             {
00824             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00825             }
00826         RpcTryFinally
00827             {
00828
00829             _StubMsg.BufferLength = 4U + 12U + 11U + 7U;
00830             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00831                                            (unsigned char __RPC_FAR *)sFilenames,
00832                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00833
00834             NdrProxyGetBuffer(This, &_StubMsg);
00835             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
00836
00837             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00838                                          (unsigned char __RPC_FAR *)sFilenames,
00839                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00840
00841             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00842             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bDirectories;
00843
00844             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bRecurse;
00845
00846             NdrProxySendReceive(This, &_StubMsg);
00847
00848             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00849                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
00850
00851             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00852
00853             }
00854         RpcFinally
00855             {
00856             NdrProxyFreeBuffer(This, &_StubMsg);
00857
00858             }
00859         RpcEndFinally
00860
00861         }
00862     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00863         {
00864         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00865         }
00866     RpcEndExcept
00867     return _RetVal;
00868 }

void __RPC_STUB ICvsCoworker_UpdateFiles_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

Definition at line 870 of file CVS_Coworker_p.c.

References _MIDL_TYPE_FORMAT_STRING::Format, _MIDL_PROC_FORMAT_STRING::Format, and UpdateFiles.

00875 {
00876     HRESULT _RetVal;
00877     MIDL_STUB_MESSAGE _StubMsg;
00878     BOOL bDirectories;
00879     BOOL bRecurse;
00880     int handle;
00881     const unsigned char __RPC_FAR *sFilenames;
00882
00883 NdrStubInitialize(
00884                      _pRpcMessage,
00885                      &_StubMsg,
00886                      &Object_StubDesc,
00887                      _pRpcChannelBuffer);
00888     ( unsigned char __RPC_FAR * )sFilenames = 0;
00889     RpcTryFinally
00890         {
00891         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00892             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
00893
00894         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00895
00896         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00897                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
00898                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00899                                        (unsigned char)0 );
00900
00901         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00902         bDirectories = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00903
00904         bRecurse = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00905
00906
00907         *_pdwStubPhase = STUB_CALL_SERVER;
00908         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> UpdateFiles(
00909                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00910                handle,
00911                sFilenames,
00912                bDirectories,
00913                bRecurse);
00914
00915         *_pdwStubPhase = STUB_MARSHAL;
00916
00917         _StubMsg.BufferLength = 4U;
00918         _StubMsg.BufferLength += 16;
00919
00920         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00921         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00922
00923         }
00924     RpcFinally
00925         {
00926         }
00927     RpcEndFinally
00928     _pRpcMessage->BufferLength =
00929         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00930
00931 }

Variable Documentation

const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString

Definition at line 3266 of file CVS_Coworker_p.c.

const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString

Definition at line 3425 of file CVS_Coworker_p.c.

PCInterfaceName const _cvs_coworker_InterfaceNamesList[]

Initial value:

{
    "ICvsCoworker",
    0
}

Definition at line 3272 of file CVS_Coworker_p.c.

const CInterfaceProxyVtbl* _cvs_coworker_ProxyVtblList[]

Initial value:

{
    ( CInterfaceProxyVtbl *) &_ICvsCoworkerProxyVtbl,
    0
}

Definition at line 3260 of file CVS_Coworker_p.c.

const CInterfaceStubVtbl* _cvs_coworker_StubVtblList[]

Initial value:

{
    ( CInterfaceStubVtbl *) &_ICvsCoworkerStubVtbl,
    0
}

Definition at line 3266 of file CVS_Coworker_p.c.

const CInterfaceStubVtbl _ICvsCoworkerStubVtbl

Initial value:

{
    &IID_ICvsCoworker,
    0,
    23,
    &ICvsCoworker_table[-3],
    CStdStubBuffer_METHODS
}

Definition at line 2922 of file CVS_Coworker_p.c.

const ExtendedProxyFileInfo cvs_coworker_ProxyFileInfo

Initial value:

{
    (PCInterfaceProxyVtblList *) & _cvs_coworker_ProxyVtblList,
    (PCInterfaceStubVtblList *) & _cvs_coworker_StubVtblList,
    (const PCInterfaceName * ) & _cvs_coworker_InterfaceNamesList,
    0,
    & _cvs_coworker_IID_Lookup,
    1,
    1,
    0,
    0,
    0,
    0
}

Definition at line 3293 of file CVS_Coworker_p.c.

const PRPC_STUB_FUNCTION ICvsCoworker_table[] [static]

Initial value:

{
    ICvsCoworker_GetLastError_Stub,
    ICvsCoworker_GetErrorMessage_Stub,
    ICvsCoworker_OpenProject_Stub,
    ICvsCoworker_GetProject_Stub,
    ICvsCoworker_UpdateFiles_Stub,
    ICvsCoworker_CheckoutFiles_Stub,
    ICvsCoworker_CheckinFiles_Stub,
    ICvsCoworker_UncheckoutFiles_Stub,
    ICvsCoworker_AddFiles_Stub,
    ICvsCoworker_RemoveFiles_Stub,
    ICvsCoworker_RenameFile_Stub,
    ICvsCoworker_DiffFile_Stub,
    ICvsCoworker_ShowFileHistory_Stub,
    ICvsCoworker_ShowFileProperties_Stub,
    ICvsCoworker_ShowUserInterface_Stub,
    ICvsCoworker_HasAdvancedOptionsForCommand_Stub,
    ICvsCoworker_ShowAdvancedOptionsForCommand_Stub,
    ICvsCoworker_GetFileChanges_Stub,
    ICvsCoworker_GetFilesToAdd_Stub,
    ICvsCoworker_CloseProject_Stub
}

Definition at line 2898 of file CVS_Coworker_p.c.

const MIDL_STUB_DESC Object_StubDesc

Initial value:

    {
    0,
    NdrOleAllocate,
    NdrOleFree,
    0,
    0,
    0,
    0,
    0,
    __MIDL_TypeFormatString.Format,
    1,
    0x10001,
    0,
    0x50100a4,
    0,
    0,
    0,
    1,
    0,
    0,
    0
    }

Definition at line 3613 of file CVS_Coworker_p.c.

Referenced by ICvsCoworker_AddFiles_Proxy, ICvsCoworker_AddFiles_Stub, ICvsCoworker_CheckinFiles_Proxy, ICvsCoworker_CheckinFiles_Stub, ICvsCoworker_CheckoutFiles_Proxy, ICvsCoworker_CheckoutFiles_Stub, ICvsCoworker_CloseProject_Proxy, ICvsCoworker_CloseProject_Stub, ICvsCoworker_DiffFile_Proxy, ICvsCoworker_DiffFile_Stub, ICvsCoworker_GetErrorMessage_Proxy, ICvsCoworker_GetErrorMessage_Stub, ICvsCoworker_GetFileChanges_Proxy, ICvsCoworker_GetFileChanges_Stub, ICvsCoworker_GetFilesToAdd_Proxy, ICvsCoworker_GetFilesToAdd_Stub, ICvsCoworker_GetLastError_Proxy, ICvsCoworker_GetLastError_Stub, ICvsCoworker_GetProject_Proxy, ICvsCoworker_GetProject_Stub, ICvsCoworker_HasAdvancedOptionsForCommand_Proxy, ICvsCoworker_HasAdvancedOptionsForCommand_Stub, ICvsCoworker_OpenProject_Proxy, ICvsCoworker_OpenProject_Stub, ICvsCoworker_RemoveFiles_Proxy, ICvsCoworker_RemoveFiles_Stub, ICvsCoworker_RenameFile_Proxy, ICvsCoworker_RenameFile_Stub, ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy, ICvsCoworker_ShowAdvancedOptionsForCommand_Stub, ICvsCoworker_ShowFileHistory_Proxy, ICvsCoworker_ShowFileHistory_Stub, ICvsCoworker_ShowFileProperties_Proxy, ICvsCoworker_ShowFileProperties_Stub, ICvsCoworker_ShowUserInterface_Proxy, ICvsCoworker_ShowUserInterface_Stub, ICvsCoworker_UncheckoutFiles_Proxy, ICvsCoworker_UncheckoutFiles_Stub, ICvsCoworker_UpdateFiles_Proxy, and ICvsCoworker_UpdateFiles_Stub.

Generated on Sun Feb 24 01:23:40 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CoWorker/CVS_Coworker_p.c Source File

WinCvs/CoWorker/CVS_Coworker_p.c

Go to the documentation of this file.
00001 /* this ALWAYS GENERATED file contains the proxy stub code */
00002
00003
00004 /* File created by MIDL compiler version 5.01.0164 */
00005 /* at Tue May 25 19:23:37 1999
00006  */
00007 /* Compiler settings for cvs_coworker.idl:
00008     Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext
00009     error checks: allocation ref bounds_check enum stub_data
00010 */
00011 //@@MIDL_FILE_HEADING(  )
00012
00013
00014 /* verify that the <rpcproxy.h> version is high enough to compile this file*/
00015 #ifndef __REDQ_RPCPROXY_H_VERSION__
00016 #define __REQUIRED_RPCPROXY_H_VERSION__ 440
00017 #endif
00018
00019
00020 #include "rpcproxy.h"
00021 #ifndef __RPCPROXY_H_VERSION__
00022 #error this stub requires an updated version of <rpcproxy.h>
00023 #endif // __RPCPROXY_H_VERSION__
00024
00025
00026 #include "cvs_coworker.h"
00027
00028 #define TYPE_FORMAT_STRING_SIZE   65
00029 #define PROC_FORMAT_STRING_SIZE   151
00030
00031 typedef struct _MIDL_TYPE_FORMAT_STRING
00032     {
00033     short          Pad;
00034     unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];
00035     } MIDL_TYPE_FORMAT_STRING;
00036
00037 typedef struct _MIDL_PROC_FORMAT_STRING
00038     {
00039     short          Pad;
00040     unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];
00041     } MIDL_PROC_FORMAT_STRING;
00042
00043
00044 extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
00045 extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
00046
00047
00048 /* Standard interface: __MIDL_itf_cvs_coworker_0000, ver. 0.0,
00049    GUID={0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} */
00050
00051
00052 /* Object interface: IUnknown, ver. 0.0,
00053    GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
00054
00055
00056 /* Object interface: ICvsCoworker, ver. 0.0,
00057    GUID={0x10E5359C,0xF454,0x11D2,{0xB4,0x42,0x00,0x80,0xC6,0xF9,0x17,0x9D}} */
00058
00059
00060 extern const MIDL_STUB_DESC Object_StubDesc;
00061
00062
00063 #pragma code_seg(".orpc")
00064
00065 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetLastError_Proxy(
00066     ICvsCoworker __RPC_FAR * This,
00067     /* [in] */ int handle,
00068     /* [out] */ int __RPC_FAR *piError)
00069 {
00070
00071     HRESULT _RetVal;
00072
00073     RPC_MESSAGE _RpcMessage;
00074
00075     MIDL_STUB_MESSAGE _StubMsg;
00076
00077     RpcTryExcept
00078         {
00079         NdrProxyInitialize(
00080                       ( void __RPC_FAR *  )This,
00081                       ( PRPC_MESSAGE  )&_RpcMessage,
00082                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00083                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00084                       3);
00085
00086
00087
00088         if(!piError)
00089             {
00090             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00091             }
00092         RpcTryFinally
00093             {
00094
00095             _StubMsg.BufferLength = 4U;
00096             NdrProxyGetBuffer(This, &_StubMsg);
00097             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
00098
00099             NdrProxySendReceive(This, &_StubMsg);
00100
00101             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00102                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
00103
00104             *piError = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00105
00106             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00107
00108             }
00109         RpcFinally
00110             {
00111             NdrProxyFreeBuffer(This, &_StubMsg);
00112
00113             }
00114         RpcEndFinally
00115
00116         }
00117     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00118         {
00119         NdrClearOutParameters(
00120                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00121                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00122                          ( void __RPC_FAR * )piError);
00123         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00124         }
00125     RpcEndExcept
00126     return _RetVal;
00127 }
00128
00129 void __RPC_STUB ICvsCoworker_GetLastError_Stub(
00130     IRpcStubBuffer *This,
00131     IRpcChannelBuffer *_pRpcChannelBuffer,
00132     PRPC_MESSAGE _pRpcMessage,
00133     DWORD *_pdwStubPhase)
00134 {
00135     int _M0;
00136     HRESULT _RetVal;
00137     MIDL_STUB_MESSAGE _StubMsg;
00138     int handle;
00139     int __RPC_FAR *piError;
00140
00141 NdrStubInitialize(
00142                      _pRpcMessage,
00143                      &_StubMsg,
00144                      &Object_StubDesc,
00145                      _pRpcChannelBuffer);
00146     ( int __RPC_FAR * )piError = 0;
00147     RpcTryFinally
00148         {
00149         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00150             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
00151
00152         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00153
00154         piError = &_M0;
00155
00156         *_pdwStubPhase = STUB_CALL_SERVER;
00157         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetLastError(
00158                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00159                 handle,
00160                 piError);
00161
00162         *_pdwStubPhase = STUB_MARSHAL;
00163
00164         _StubMsg.BufferLength = 4U + 4U;
00165         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00166         *(( int __RPC_FAR * )_StubMsg.Buffer)++ = *piError;
00167
00168         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00169
00170         }
00171     RpcFinally
00172         {
00173         }
00174     RpcEndFinally
00175     _pRpcMessage->BufferLength =
00176         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00177
00178 }
00179
00180
00181 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetErrorMessage_Proxy(
00182     ICvsCoworker __RPC_FAR * This,
00183     /* [in] */ int handle,
00184     /* [in] */ int iError,
00185     /* [in] */ int cbErrorBuffer,
00186     /* [size_is][string][out] */ unsigned char __RPC_FAR *sErrorBuffer)
00187 {
00188
00189     HRESULT _RetVal;
00190
00191     RPC_MESSAGE _RpcMessage;
00192
00193     MIDL_STUB_MESSAGE _StubMsg;
00194
00195     RpcTryExcept
00196         {
00197         NdrProxyInitialize(
00198                       ( void __RPC_FAR *  )This,
00199                       ( PRPC_MESSAGE  )&_RpcMessage,
00200                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00201                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00202                       4);
00203
00204
00205
00206         if(!sErrorBuffer)
00207             {
00208             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00209             }
00210         RpcTryFinally
00211             {
00212
00213             _StubMsg.BufferLength = 4U + 4U + 4U;
00214             NdrProxyGetBuffer(This, &_StubMsg);
00215             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
00216
00217             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = iError;
00218
00219             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbErrorBuffer;
00220
00221             NdrProxySendReceive(This, &_StubMsg);
00222
00223             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00224                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] );
00225
00226             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00227                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sErrorBuffer,
00228                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10],
00229                                            (unsigned char)0 );
00230
00231             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00232             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00233
00234             }
00235         RpcFinally
00236             {
00237             NdrProxyFreeBuffer(This, &_StubMsg);
00238
00239             }
00240         RpcEndFinally
00241
00242         }
00243     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00244         {
00245         _StubMsg.MaxCount = cbErrorBuffer;
00246
00247         NdrClearOutParameters(
00248                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00249                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[6],
00250                          ( void __RPC_FAR * )sErrorBuffer);
00251         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00252         }
00253     RpcEndExcept
00254     return _RetVal;
00255 }
00256
00257 void __RPC_STUB ICvsCoworker_GetErrorMessage_Stub(
00258     IRpcStubBuffer *This,
00259     IRpcChannelBuffer *_pRpcChannelBuffer,
00260     PRPC_MESSAGE _pRpcMessage,
00261     DWORD *_pdwStubPhase)
00262 {
00263     HRESULT _RetVal;
00264     MIDL_STUB_MESSAGE _StubMsg;
00265     int cbErrorBuffer;
00266     int handle;
00267     int iError;
00268     unsigned char __RPC_FAR *sErrorBuffer;
00269
00270 NdrStubInitialize(
00271                      _pRpcMessage,
00272                      &_StubMsg,
00273                      &Object_StubDesc,
00274                      _pRpcChannelBuffer);
00275     ( unsigned char __RPC_FAR * )sErrorBuffer = 0;
00276     RpcTryFinally
00277         {
00278         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00279             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] );
00280
00281         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00282
00283         iError = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00284
00285         cbErrorBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00286
00287         if(cbErrorBuffer * 1 < 0)
00288             {
00289             RpcRaiseException(RPC_X_INVALID_BOUND);
00290             }
00291         sErrorBuffer = NdrAllocate(&_StubMsg,cbErrorBuffer * 1);
00292
00293         *_pdwStubPhase = STUB_CALL_SERVER;
00294         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetErrorMessage(
00295                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00296                    handle,
00297                    iError,
00298                    cbErrorBuffer,
00299                    sErrorBuffer);
00300
00301         *_pdwStubPhase = STUB_MARSHAL;
00302
00303         _StubMsg.BufferLength = 12U + 11U;
00304         _StubMsg.MaxCount = cbErrorBuffer;
00305
00306         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00307                                        (unsigned char __RPC_FAR *)sErrorBuffer,
00308                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10] );
00309
00310         _StubMsg.BufferLength += 16;
00311
00312         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00313         _StubMsg.MaxCount = cbErrorBuffer;
00314
00315         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00316                                      (unsigned char __RPC_FAR *)sErrorBuffer,
00317                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10] );
00318
00319         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00320         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00321
00322         }
00323     RpcFinally
00324         {
00325         _StubMsg.MaxCount = cbErrorBuffer;
00326
00327         NdrPointerFree( &_StubMsg,
00328                         (unsigned char __RPC_FAR *)sErrorBuffer,
00329                         &__MIDL_TypeFormatString.Format[6] );
00330
00331         }
00332     RpcEndFinally
00333     _pRpcMessage->BufferLength =
00334         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00335
00336 }
00337
00338
00339 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_OpenProject_Proxy(
00340     ICvsCoworker __RPC_FAR * This,
00341     /* [out] */ int __RPC_FAR *pHandle,
00342     /* [string][in] */ const unsigned char __RPC_FAR *sUsername,
00343     /* [string][in] */ const unsigned char __RPC_FAR *sProjectName,
00344     /* [string][in] */ const unsigned char __RPC_FAR *sProjectHome)
00345 {
00346
00347     HRESULT _RetVal;
00348
00349     RPC_MESSAGE _RpcMessage;
00350
00351     MIDL_STUB_MESSAGE _StubMsg;
00352
00353     RpcTryExcept
00354         {
00355         NdrProxyInitialize(
00356                       ( void __RPC_FAR *  )This,
00357                       ( PRPC_MESSAGE  )&_RpcMessage,
00358                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00359                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00360                       5);
00361
00362
00363
00364         if(!pHandle)
00365             {
00366             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00367             }
00368         if(!sUsername)
00369             {
00370             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00371             }
00372         if(!sProjectName)
00373             {
00374             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00375             }
00376         if(!sProjectHome)
00377             {
00378             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00379             }
00380         RpcTryFinally
00381             {
00382
00383             _StubMsg.BufferLength = 12U + 13U + 13U;
00384             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00385                                            (unsigned char __RPC_FAR *)sUsername,
00386                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00387
00388             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00389                                            (unsigned char __RPC_FAR *)sProjectName,
00390                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00391
00392             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00393                                            (unsigned char __RPC_FAR *)sProjectHome,
00394                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00395
00396             NdrProxyGetBuffer(This, &_StubMsg);
00397             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00398                                          (unsigned char __RPC_FAR *)sUsername,
00399                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00400
00401             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00402                                          (unsigned char __RPC_FAR *)sProjectName,
00403                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00404
00405             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00406                                          (unsigned char __RPC_FAR *)sProjectHome,
00407                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00408
00409             NdrProxySendReceive(This, &_StubMsg);
00410
00411             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00412                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[20] );
00413
00414             *pHandle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00415
00416             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00417
00418             }
00419         RpcFinally
00420             {
00421             NdrProxyFreeBuffer(This, &_StubMsg);
00422
00423             }
00424         RpcEndFinally
00425
00426         }
00427     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00428         {
00429         NdrClearOutParameters(
00430                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00431                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00432                          ( void __RPC_FAR * )pHandle);
00433         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00434         }
00435     RpcEndExcept
00436     return _RetVal;
00437 }
00438
00439 void __RPC_STUB ICvsCoworker_OpenProject_Stub(
00440     IRpcStubBuffer *This,
00441     IRpcChannelBuffer *_pRpcChannelBuffer,
00442     PRPC_MESSAGE _pRpcMessage,
00443     DWORD *_pdwStubPhase)
00444 {
00445     int _M9;
00446     HRESULT _RetVal;
00447     MIDL_STUB_MESSAGE _StubMsg;
00448     int __RPC_FAR *pHandle;
00449     const unsigned char __RPC_FAR *sProjectHome;
00450     const unsigned char __RPC_FAR *sProjectName;
00451     const unsigned char __RPC_FAR *sUsername;
00452
00453 NdrStubInitialize(
00454                      _pRpcMessage,
00455                      &_StubMsg,
00456                      &Object_StubDesc,
00457                      _pRpcChannelBuffer);
00458     ( int __RPC_FAR * )pHandle = 0;
00459     ( unsigned char __RPC_FAR * )sUsername = 0;
00460     ( unsigned char __RPC_FAR * )sProjectName = 0;
00461     ( unsigned char __RPC_FAR * )sProjectHome = 0;
00462     RpcTryFinally
00463         {
00464         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00465             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[20] );
00466
00467         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00468                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sUsername,
00469                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00470                                        (unsigned char)0 );
00471
00472         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00473                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectName,
00474                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00475                                        (unsigned char)0 );
00476
00477         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00478                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectHome,
00479                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00480                                        (unsigned char)0 );
00481
00482         pHandle = &_M9;
00483
00484         *_pdwStubPhase = STUB_CALL_SERVER;
00485         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> OpenProject(
00486                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00487                pHandle,
00488                sUsername,
00489                sProjectName,
00490                sProjectHome);
00491
00492         *_pdwStubPhase = STUB_MARSHAL;
00493
00494         _StubMsg.BufferLength = 4U + 4U;
00495         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00496         *(( int __RPC_FAR * )_StubMsg.Buffer)++ = *pHandle;
00497
00498         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00499
00500         }
00501     RpcFinally
00502         {
00503         }
00504     RpcEndFinally
00505     _pRpcMessage->BufferLength =
00506         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00507
00508 }
00509
00510
00511 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetProject_Proxy(
00512     ICvsCoworker __RPC_FAR * This,
00513     /* [out] */ int __RPC_FAR *pHandle,
00514     /* [in] */ const unsigned char __RPC_FAR *sUsername,
00515     /* [in] */ int cbProjectNameBuffer,
00516     /* [size_is][string][out][in] */ unsigned char __RPC_FAR *sProjectName,
00517     /* [in] */ int cbProjectHomeBuffer,
00518     /* [size_is][string][out][in] */ unsigned char __RPC_FAR *sProjectHome,
00519     /* [in] */ BOOL bAllowPathChange,
00520     /* [in] */ BOOL bAllowNewProject,
00521     /* [out] */ BOOL __RPC_FAR *pbNewProject)
00522 {
00523
00524     HRESULT _RetVal;
00525
00526     RPC_MESSAGE _RpcMessage;
00527
00528     MIDL_STUB_MESSAGE _StubMsg;
00529
00530     RpcTryExcept
00531         {
00532         NdrProxyInitialize(
00533                       ( void __RPC_FAR *  )This,
00534                       ( PRPC_MESSAGE  )&_RpcMessage,
00535                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00536                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00537                       6);
00538
00539
00540
00541         if(!pHandle)
00542             {
00543             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00544             }
00545         if(!sUsername)
00546             {
00547             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00548             }
00549         if(!sProjectName)
00550             {
00551             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00552             }
00553         if(!sProjectHome)
00554             {
00555             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00556             }
00557         if(!pbNewProject)
00558             {
00559             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00560             }
00561         RpcTryFinally
00562             {
00563
00564             _StubMsg.BufferLength = 1U + 7U + 12U + 11U + 13U + 11U + 7U;
00565             _StubMsg.MaxCount = cbProjectNameBuffer;
00566
00567             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00568                                            (unsigned char __RPC_FAR *)sProjectName,
00569                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00570
00571             _StubMsg.MaxCount = cbProjectHomeBuffer;
00572
00573             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00574                                            (unsigned char __RPC_FAR *)sProjectHome,
00575                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00576
00577             NdrProxyGetBuffer(This, &_StubMsg);
00578             *(( unsigned char __RPC_FAR * )_StubMsg.Buffer)++ = *sUsername;
00579
00580             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00581             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbProjectNameBuffer;
00582
00583             _StubMsg.MaxCount = cbProjectNameBuffer;
00584
00585             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00586                                          (unsigned char __RPC_FAR *)sProjectName,
00587                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00588
00589             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00590             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbProjectHomeBuffer;
00591
00592             _StubMsg.MaxCount = cbProjectHomeBuffer;
00593
00594             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00595                                          (unsigned char __RPC_FAR *)sProjectHome,
00596                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00597
00598             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00599             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bAllowPathChange;
00600
00601             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bAllowNewProject;
00602
00603             NdrProxySendReceive(This, &_StubMsg);
00604
00605             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00606                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[38] );
00607
00608             *pHandle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00609
00610             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00611                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectName,
00612                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28],
00613                                            (unsigned char)0 );
00614
00615             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00616                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectHome,
00617                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38],
00618                                            (unsigned char)0 );
00619
00620             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00621             *pbNewProject = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00622
00623             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00624
00625             }
00626         RpcFinally
00627             {
00628             NdrProxyFreeBuffer(This, &_StubMsg);
00629
00630             }
00631         RpcEndFinally
00632
00633         }
00634     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00635         {
00636         NdrClearOutParameters(
00637                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00638                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00639                          ( void __RPC_FAR * )pHandle);
00640         _StubMsg.MaxCount = cbProjectNameBuffer;
00641
00642         NdrClearOutParameters(
00643                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00644                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[24],
00645                          ( void __RPC_FAR * )sProjectName);
00646         _StubMsg.MaxCount = cbProjectHomeBuffer;
00647
00648         NdrClearOutParameters(
00649                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00650                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[34],
00651                          ( void __RPC_FAR * )sProjectHome);
00652         NdrClearOutParameters(
00653                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00654                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
00655                          ( void __RPC_FAR * )pbNewProject);
00656         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00657         }
00658     RpcEndExcept
00659     return _RetVal;
00660 }
00661
00662 void __RPC_STUB ICvsCoworker_GetProject_Stub(
00663     IRpcStubBuffer *This,
00664     IRpcChannelBuffer *_pRpcChannelBuffer,
00665     PRPC_MESSAGE _pRpcMessage,
00666     DWORD *_pdwStubPhase)
00667 {
00668     int _M14;
00669     BOOL _M15;
00670     HRESULT _RetVal;
00671     MIDL_STUB_MESSAGE _StubMsg;
00672     BOOL bAllowNewProject;
00673     BOOL bAllowPathChange;
00674     int cbProjectHomeBuffer;
00675     int cbProjectNameBuffer;
00676     int __RPC_FAR *pHandle;
00677     BOOL __RPC_FAR *pbNewProject;
00678     unsigned char __RPC_FAR *sProjectHome;
00679     unsigned char __RPC_FAR *sProjectName;
00680     const unsigned char __RPC_FAR *sUsername;
00681
00682 NdrStubInitialize(
00683                      _pRpcMessage,
00684                      &_StubMsg,
00685                      &Object_StubDesc,
00686                      _pRpcChannelBuffer);
00687     ( int __RPC_FAR * )pHandle = 0;
00688     ( unsigned char __RPC_FAR * )sUsername = 0;
00689     ( unsigned char __RPC_FAR * )sProjectName = 0;
00690     ( unsigned char __RPC_FAR * )sProjectHome = 0;
00691     ( BOOL __RPC_FAR * )pbNewProject = 0;
00692     RpcTryFinally
00693         {
00694         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00695             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[38] );
00696
00697         sUsername = ( unsigned char __RPC_FAR * )_StubMsg.Buffer;
00698         _StubMsg.Buffer += sizeof( unsigned char  );
00699
00700         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00701         cbProjectNameBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00702
00703         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00704                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectName,
00705                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28],
00706                                        (unsigned char)0 );
00707
00708         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00709         cbProjectHomeBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00710
00711         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00712                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sProjectHome,
00713                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38],
00714                                        (unsigned char)0 );
00715
00716         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00717         bAllowPathChange = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00718
00719         bAllowNewProject = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00720
00721         pHandle = &_M14;
00722         pbNewProject = &_M15;
00723
00724         *_pdwStubPhase = STUB_CALL_SERVER;
00725         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetProject(
00726               (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00727               pHandle,
00728               sUsername,
00729               cbProjectNameBuffer,
00730               sProjectName,
00731               cbProjectHomeBuffer,
00732               sProjectHome,
00733               bAllowPathChange,
00734               bAllowNewProject,
00735               pbNewProject);
00736
00737         *_pdwStubPhase = STUB_MARSHAL;
00738
00739         _StubMsg.BufferLength = 4U + 12U + 13U + 11U + 7U;
00740         _StubMsg.MaxCount = cbProjectNameBuffer;
00741
00742         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00743                                        (unsigned char __RPC_FAR *)sProjectName,
00744                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00745
00746         _StubMsg.MaxCount = cbProjectHomeBuffer;
00747
00748         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00749                                        (unsigned char __RPC_FAR *)sProjectHome,
00750                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00751
00752         _StubMsg.BufferLength += 16;
00753
00754         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00755         *(( int __RPC_FAR * )_StubMsg.Buffer)++ = *pHandle;
00756
00757         _StubMsg.MaxCount = cbProjectNameBuffer;
00758
00759         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00760                                      (unsigned char __RPC_FAR *)sProjectName,
00761                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
00762
00763         _StubMsg.MaxCount = cbProjectHomeBuffer;
00764
00765         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00766                                      (unsigned char __RPC_FAR *)sProjectHome,
00767                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] );
00768
00769         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00770         *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = *pbNewProject;
00771
00772         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00773
00774         }
00775     RpcFinally
00776         {
00777         _StubMsg.MaxCount = cbProjectNameBuffer;
00778
00779         NdrPointerFree( &_StubMsg,
00780                         (unsigned char __RPC_FAR *)sProjectName,
00781                         &__MIDL_TypeFormatString.Format[24] );
00782
00783         _StubMsg.MaxCount = cbProjectHomeBuffer;
00784
00785         NdrPointerFree( &_StubMsg,
00786                         (unsigned char __RPC_FAR *)sProjectHome,
00787                         &__MIDL_TypeFormatString.Format[34] );
00788
00789         }
00790     RpcEndFinally
00791     _pRpcMessage->BufferLength =
00792         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00793
00794 }
00795
00796
00797 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_UpdateFiles_Proxy(
00798     ICvsCoworker __RPC_FAR * This,
00799     /* [in] */ int handle,
00800     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames,
00801     /* [in] */ BOOL bDirectories,
00802     /* [in] */ BOOL bRecurse)
00803 {
00804
00805     HRESULT _RetVal;
00806
00807     RPC_MESSAGE _RpcMessage;
00808
00809     MIDL_STUB_MESSAGE _StubMsg;
00810
00811     RpcTryExcept
00812         {
00813         NdrProxyInitialize(
00814                       ( void __RPC_FAR *  )This,
00815                       ( PRPC_MESSAGE  )&_RpcMessage,
00816                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00817                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00818                       7);
00819
00820
00821
00822         if(!sFilenames)
00823             {
00824             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00825             }
00826         RpcTryFinally
00827             {
00828
00829             _StubMsg.BufferLength = 4U + 12U + 11U + 7U;
00830             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00831                                            (unsigned char __RPC_FAR *)sFilenames,
00832                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00833
00834             NdrProxyGetBuffer(This, &_StubMsg);
00835             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
00836
00837             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00838                                          (unsigned char __RPC_FAR *)sFilenames,
00839                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00840
00841             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00842             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bDirectories;
00843
00844             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bRecurse;
00845
00846             NdrProxySendReceive(This, &_StubMsg);
00847
00848             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00849                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
00850
00851             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00852
00853             }
00854         RpcFinally
00855             {
00856             NdrProxyFreeBuffer(This, &_StubMsg);
00857
00858             }
00859         RpcEndFinally
00860
00861         }
00862     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00863         {
00864         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00865         }
00866     RpcEndExcept
00867     return _RetVal;
00868 }
00869
00870 void __RPC_STUB ICvsCoworker_UpdateFiles_Stub(
00871     IRpcStubBuffer *This,
00872     IRpcChannelBuffer *_pRpcChannelBuffer,
00873     PRPC_MESSAGE _pRpcMessage,
00874     DWORD *_pdwStubPhase)
00875 {
00876     HRESULT _RetVal;
00877     MIDL_STUB_MESSAGE _StubMsg;
00878     BOOL bDirectories;
00879     BOOL bRecurse;
00880     int handle;
00881     const unsigned char __RPC_FAR *sFilenames;
00882
00883 NdrStubInitialize(
00884                      _pRpcMessage,
00885                      &_StubMsg,
00886                      &Object_StubDesc,
00887                      _pRpcChannelBuffer);
00888     ( unsigned char __RPC_FAR * )sFilenames = 0;
00889     RpcTryFinally
00890         {
00891         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00892             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
00893
00894         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
00895
00896         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
00897                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
00898                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
00899                                        (unsigned char)0 );
00900
00901         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
00902         bDirectories = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00903
00904         bRecurse = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
00905
00906
00907         *_pdwStubPhase = STUB_CALL_SERVER;
00908         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> UpdateFiles(
00909                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
00910                handle,
00911                sFilenames,
00912                bDirectories,
00913                bRecurse);
00914
00915         *_pdwStubPhase = STUB_MARSHAL;
00916
00917         _StubMsg.BufferLength = 4U;
00918         _StubMsg.BufferLength += 16;
00919
00920         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
00921         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
00922
00923         }
00924     RpcFinally
00925         {
00926         }
00927     RpcEndFinally
00928     _pRpcMessage->BufferLength =
00929         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
00930
00931 }
00932
00933
00934 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckoutFiles_Proxy(
00935     ICvsCoworker __RPC_FAR * This,
00936     /* [in] */ int handle,
00937     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames)
00938 {
00939
00940     HRESULT _RetVal;
00941
00942     RPC_MESSAGE _RpcMessage;
00943
00944     MIDL_STUB_MESSAGE _StubMsg;
00945
00946     RpcTryExcept
00947         {
00948         NdrProxyInitialize(
00949                       ( void __RPC_FAR *  )This,
00950                       ( PRPC_MESSAGE  )&_RpcMessage,
00951                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
00952                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
00953                       8);
00954
00955
00956
00957         if(!sFilenames)
00958             {
00959             RpcRaiseException(RPC_X_NULL_REF_POINTER);
00960             }
00961         RpcTryFinally
00962             {
00963
00964             _StubMsg.BufferLength = 4U + 12U;
00965             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
00966                                            (unsigned char __RPC_FAR *)sFilenames,
00967                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00968
00969             NdrProxyGetBuffer(This, &_StubMsg);
00970             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
00971
00972             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
00973                                          (unsigned char __RPC_FAR *)sFilenames,
00974                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
00975
00976             NdrProxySendReceive(This, &_StubMsg);
00977
00978             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
00979                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
00980
00981             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
00982
00983             }
00984         RpcFinally
00985             {
00986             NdrProxyFreeBuffer(This, &_StubMsg);
00987
00988             }
00989         RpcEndFinally
00990
00991         }
00992     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
00993         {
00994         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
00995         }
00996     RpcEndExcept
00997     return _RetVal;
00998 }
00999
01000 void __RPC_STUB ICvsCoworker_CheckoutFiles_Stub(
01001     IRpcStubBuffer *This,
01002     IRpcChannelBuffer *_pRpcChannelBuffer,
01003     PRPC_MESSAGE _pRpcMessage,
01004     DWORD *_pdwStubPhase)
01005 {
01006     HRESULT _RetVal;
01007     MIDL_STUB_MESSAGE _StubMsg;
01008     int handle;
01009     const unsigned char __RPC_FAR *sFilenames;
01010
01011 NdrStubInitialize(
01012                      _pRpcMessage,
01013                      &_StubMsg,
01014                      &Object_StubDesc,
01015                      _pRpcChannelBuffer);
01016     ( unsigned char __RPC_FAR * )sFilenames = 0;
01017     RpcTryFinally
01018         {
01019         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01020             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01021
01022         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01023
01024         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01025                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01026                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01027                                        (unsigned char)0 );
01028
01029
01030         *_pdwStubPhase = STUB_CALL_SERVER;
01031         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CheckoutFiles(
01032                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01033                  handle,
01034                  sFilenames);
01035
01036         *_pdwStubPhase = STUB_MARSHAL;
01037
01038         _StubMsg.BufferLength = 4U;
01039         _StubMsg.BufferLength += 16;
01040
01041         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01042         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01043
01044         }
01045     RpcFinally
01046         {
01047         }
01048     RpcEndFinally
01049     _pRpcMessage->BufferLength =
01050         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01051
01052 }
01053
01054
01055 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_CheckinFiles_Proxy(
01056     ICvsCoworker __RPC_FAR * This,
01057     /* [in] */ int handle,
01058     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames,
01059     /* [in] */ BOOL bKeepCheckedOut)
01060 {
01061
01062     HRESULT _RetVal;
01063
01064     RPC_MESSAGE _RpcMessage;
01065
01066     MIDL_STUB_MESSAGE _StubMsg;
01067
01068     RpcTryExcept
01069         {
01070         NdrProxyInitialize(
01071                       ( void __RPC_FAR *  )This,
01072                       ( PRPC_MESSAGE  )&_RpcMessage,
01073                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01074                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01075                       9);
01076
01077
01078
01079         if(!sFilenames)
01080             {
01081             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01082             }
01083         RpcTryFinally
01084             {
01085
01086             _StubMsg.BufferLength = 4U + 12U + 11U;
01087             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01088                                            (unsigned char __RPC_FAR *)sFilenames,
01089                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01090
01091             NdrProxyGetBuffer(This, &_StubMsg);
01092             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01093
01094             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01095                                          (unsigned char __RPC_FAR *)sFilenames,
01096                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01097
01098             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01099             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bKeepCheckedOut;
01100
01101             NdrProxySendReceive(This, &_StubMsg);
01102
01103             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01104                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] );
01105
01106             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01107
01108             }
01109         RpcFinally
01110             {
01111             NdrProxyFreeBuffer(This, &_StubMsg);
01112
01113             }
01114         RpcEndFinally
01115
01116         }
01117     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01118         {
01119         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01120         }
01121     RpcEndExcept
01122     return _RetVal;
01123 }
01124
01125 void __RPC_STUB ICvsCoworker_CheckinFiles_Stub(
01126     IRpcStubBuffer *This,
01127     IRpcChannelBuffer *_pRpcChannelBuffer,
01128     PRPC_MESSAGE _pRpcMessage,
01129     DWORD *_pdwStubPhase)
01130 {
01131     HRESULT _RetVal;
01132     MIDL_STUB_MESSAGE _StubMsg;
01133     BOOL bKeepCheckedOut;
01134     int handle;
01135     const unsigned char __RPC_FAR *sFilenames;
01136
01137 NdrStubInitialize(
01138                      _pRpcMessage,
01139                      &_StubMsg,
01140                      &Object_StubDesc,
01141                      _pRpcChannelBuffer);
01142     ( unsigned char __RPC_FAR * )sFilenames = 0;
01143     RpcTryFinally
01144         {
01145         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01146             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] );
01147
01148         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01149
01150         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01151                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01152                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01153                                        (unsigned char)0 );
01154
01155         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01156         bKeepCheckedOut = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
01157
01158
01159         *_pdwStubPhase = STUB_CALL_SERVER;
01160         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CheckinFiles(
01161                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01162                 handle,
01163                 sFilenames,
01164                 bKeepCheckedOut);
01165
01166         *_pdwStubPhase = STUB_MARSHAL;
01167
01168         _StubMsg.BufferLength = 4U;
01169         _StubMsg.BufferLength += 16;
01170
01171         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01172         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01173
01174         }
01175     RpcFinally
01176         {
01177         }
01178     RpcEndFinally
01179     _pRpcMessage->BufferLength =
01180         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01181
01182 }
01183
01184
01185 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_UncheckoutFiles_Proxy(
01186     ICvsCoworker __RPC_FAR * This,
01187     /* [in] */ int handle,
01188     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames)
01189 {
01190
01191     HRESULT _RetVal;
01192
01193     RPC_MESSAGE _RpcMessage;
01194
01195     MIDL_STUB_MESSAGE _StubMsg;
01196
01197     RpcTryExcept
01198         {
01199         NdrProxyInitialize(
01200                       ( void __RPC_FAR *  )This,
01201                       ( PRPC_MESSAGE  )&_RpcMessage,
01202                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01203                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01204                       10);
01205
01206
01207
01208         if(!sFilenames)
01209             {
01210             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01211             }
01212         RpcTryFinally
01213             {
01214
01215             _StubMsg.BufferLength = 4U + 12U;
01216             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01217                                            (unsigned char __RPC_FAR *)sFilenames,
01218                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01219
01220             NdrProxyGetBuffer(This, &_StubMsg);
01221             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01222
01223             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01224                                          (unsigned char __RPC_FAR *)sFilenames,
01225                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01226
01227             NdrProxySendReceive(This, &_StubMsg);
01228
01229             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01230                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01231
01232             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01233
01234             }
01235         RpcFinally
01236             {
01237             NdrProxyFreeBuffer(This, &_StubMsg);
01238
01239             }
01240         RpcEndFinally
01241
01242         }
01243     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01244         {
01245         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01246         }
01247     RpcEndExcept
01248     return _RetVal;
01249 }
01250
01251 void __RPC_STUB ICvsCoworker_UncheckoutFiles_Stub(
01252     IRpcStubBuffer *This,
01253     IRpcChannelBuffer *_pRpcChannelBuffer,
01254     PRPC_MESSAGE _pRpcMessage,
01255     DWORD *_pdwStubPhase)
01256 {
01257     HRESULT _RetVal;
01258     MIDL_STUB_MESSAGE _StubMsg;
01259     int handle;
01260     const unsigned char __RPC_FAR *sFilenames;
01261
01262 NdrStubInitialize(
01263                      _pRpcMessage,
01264                      &_StubMsg,
01265                      &Object_StubDesc,
01266                      _pRpcChannelBuffer);
01267     ( unsigned char __RPC_FAR * )sFilenames = 0;
01268     RpcTryFinally
01269         {
01270         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01271             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01272
01273         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01274
01275         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01276                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01277                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01278                                        (unsigned char)0 );
01279
01280
01281         *_pdwStubPhase = STUB_CALL_SERVER;
01282         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> UncheckoutFiles(
01283                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01284                    handle,
01285                    sFilenames);
01286
01287         *_pdwStubPhase = STUB_MARSHAL;
01288
01289         _StubMsg.BufferLength = 4U;
01290         _StubMsg.BufferLength += 16;
01291
01292         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01293         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01294
01295         }
01296     RpcFinally
01297         {
01298         }
01299     RpcEndFinally
01300     _pRpcMessage->BufferLength =
01301         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01302
01303 }
01304
01305
01306 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_AddFiles_Proxy(
01307     ICvsCoworker __RPC_FAR * This,
01308     /* [in] */ int handle,
01309     /* [string][in] */ const unsigned char __RPC_FAR *sOptionsAndFilenames,
01310     /* [string][in] */ const unsigned char __RPC_FAR *sComment)
01311 {
01312
01313     HRESULT _RetVal;
01314
01315     RPC_MESSAGE _RpcMessage;
01316
01317     MIDL_STUB_MESSAGE _StubMsg;
01318
01319     RpcTryExcept
01320         {
01321         NdrProxyInitialize(
01322                       ( void __RPC_FAR *  )This,
01323                       ( PRPC_MESSAGE  )&_RpcMessage,
01324                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01325                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01326                       11);
01327
01328
01329
01330         if(!sOptionsAndFilenames)
01331             {
01332             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01333             }
01334         if(!sComment)
01335             {
01336             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01337             }
01338         RpcTryFinally
01339             {
01340
01341             _StubMsg.BufferLength = 4U + 12U + 13U;
01342             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01343                                            (unsigned char __RPC_FAR *)sOptionsAndFilenames,
01344                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01345
01346             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01347                                            (unsigned char __RPC_FAR *)sComment,
01348                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01349
01350             NdrProxyGetBuffer(This, &_StubMsg);
01351             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01352
01353             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01354                                          (unsigned char __RPC_FAR *)sOptionsAndFilenames,
01355                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01356
01357             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01358                                          (unsigned char __RPC_FAR *)sComment,
01359                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01360
01361             NdrProxySendReceive(This, &_StubMsg);
01362
01363             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01364                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01365
01366             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01367
01368             }
01369         RpcFinally
01370             {
01371             NdrProxyFreeBuffer(This, &_StubMsg);
01372
01373             }
01374         RpcEndFinally
01375
01376         }
01377     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01378         {
01379         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01380         }
01381     RpcEndExcept
01382     return _RetVal;
01383 }
01384
01385 void __RPC_STUB ICvsCoworker_AddFiles_Stub(
01386     IRpcStubBuffer *This,
01387     IRpcChannelBuffer *_pRpcChannelBuffer,
01388     PRPC_MESSAGE _pRpcMessage,
01389     DWORD *_pdwStubPhase)
01390 {
01391     HRESULT _RetVal;
01392     MIDL_STUB_MESSAGE _StubMsg;
01393     int handle;
01394     const unsigned char __RPC_FAR *sComment;
01395     const unsigned char __RPC_FAR *sOptionsAndFilenames;
01396
01397 NdrStubInitialize(
01398                      _pRpcMessage,
01399                      &_StubMsg,
01400                      &Object_StubDesc,
01401                      _pRpcChannelBuffer);
01402     ( unsigned char __RPC_FAR * )sOptionsAndFilenames = 0;
01403     ( unsigned char __RPC_FAR * )sComment = 0;
01404     RpcTryFinally
01405         {
01406         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01407             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01408
01409         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01410
01411         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01412                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sOptionsAndFilenames,
01413                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01414                                        (unsigned char)0 );
01415
01416         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01417                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sComment,
01418                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01419                                        (unsigned char)0 );
01420
01421
01422         *_pdwStubPhase = STUB_CALL_SERVER;
01423         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> AddFiles(
01424             (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01425             handle,
01426             sOptionsAndFilenames,
01427             sComment);
01428
01429         *_pdwStubPhase = STUB_MARSHAL;
01430
01431         _StubMsg.BufferLength = 4U;
01432         _StubMsg.BufferLength += 16;
01433
01434         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01435         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01436
01437         }
01438     RpcFinally
01439         {
01440         }
01441     RpcEndFinally
01442     _pRpcMessage->BufferLength =
01443         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01444
01445 }
01446
01447
01448 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_RemoveFiles_Proxy(
01449     ICvsCoworker __RPC_FAR * This,
01450     /* [in] */ int handle,
01451     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames)
01452 {
01453
01454     HRESULT _RetVal;
01455
01456     RPC_MESSAGE _RpcMessage;
01457
01458     MIDL_STUB_MESSAGE _StubMsg;
01459
01460     RpcTryExcept
01461         {
01462         NdrProxyInitialize(
01463                       ( void __RPC_FAR *  )This,
01464                       ( PRPC_MESSAGE  )&_RpcMessage,
01465                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01466                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01467                       12);
01468
01469
01470
01471         if(!sFilenames)
01472             {
01473             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01474             }
01475         RpcTryFinally
01476             {
01477
01478             _StubMsg.BufferLength = 4U + 12U;
01479             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01480                                            (unsigned char __RPC_FAR *)sFilenames,
01481                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01482
01483             NdrProxyGetBuffer(This, &_StubMsg);
01484             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01485
01486             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01487                                          (unsigned char __RPC_FAR *)sFilenames,
01488                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01489
01490             NdrProxySendReceive(This, &_StubMsg);
01491
01492             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01493                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01494
01495             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01496
01497             }
01498         RpcFinally
01499             {
01500             NdrProxyFreeBuffer(This, &_StubMsg);
01501
01502             }
01503         RpcEndFinally
01504
01505         }
01506     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01507         {
01508         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01509         }
01510     RpcEndExcept
01511     return _RetVal;
01512 }
01513
01514 void __RPC_STUB ICvsCoworker_RemoveFiles_Stub(
01515     IRpcStubBuffer *This,
01516     IRpcChannelBuffer *_pRpcChannelBuffer,
01517     PRPC_MESSAGE _pRpcMessage,
01518     DWORD *_pdwStubPhase)
01519 {
01520     HRESULT _RetVal;
01521     MIDL_STUB_MESSAGE _StubMsg;
01522     int handle;
01523     const unsigned char __RPC_FAR *sFilenames;
01524
01525 NdrStubInitialize(
01526                      _pRpcMessage,
01527                      &_StubMsg,
01528                      &Object_StubDesc,
01529                      _pRpcChannelBuffer);
01530     ( unsigned char __RPC_FAR * )sFilenames = 0;
01531     RpcTryFinally
01532         {
01533         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01534             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01535
01536         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01537
01538         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01539                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01540                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01541                                        (unsigned char)0 );
01542
01543
01544         *_pdwStubPhase = STUB_CALL_SERVER;
01545         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> RemoveFiles(
01546                (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01547                handle,
01548                sFilenames);
01549
01550         *_pdwStubPhase = STUB_MARSHAL;
01551
01552         _StubMsg.BufferLength = 4U;
01553         _StubMsg.BufferLength += 16;
01554
01555         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01556         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01557
01558         }
01559     RpcFinally
01560         {
01561         }
01562     RpcEndFinally
01563     _pRpcMessage->BufferLength =
01564         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01565
01566 }
01567
01568
01569 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_RenameFile_Proxy(
01570     ICvsCoworker __RPC_FAR * This,
01571     /* [in] */ int handle,
01572     /* [string][in] */ const unsigned char __RPC_FAR *sOldFilename,
01573     /* [string][in] */ const unsigned char __RPC_FAR *sNewFilename)
01574 {
01575
01576     HRESULT _RetVal;
01577
01578     RPC_MESSAGE _RpcMessage;
01579
01580     MIDL_STUB_MESSAGE _StubMsg;
01581
01582     RpcTryExcept
01583         {
01584         NdrProxyInitialize(
01585                       ( void __RPC_FAR *  )This,
01586                       ( PRPC_MESSAGE  )&_RpcMessage,
01587                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01588                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01589                       13);
01590
01591
01592
01593         if(!sOldFilename)
01594             {
01595             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01596             }
01597         if(!sNewFilename)
01598             {
01599             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01600             }
01601         RpcTryFinally
01602             {
01603
01604             _StubMsg.BufferLength = 4U + 12U + 13U;
01605             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01606                                            (unsigned char __RPC_FAR *)sOldFilename,
01607                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01608
01609             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01610                                            (unsigned char __RPC_FAR *)sNewFilename,
01611                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01612
01613             NdrProxyGetBuffer(This, &_StubMsg);
01614             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01615
01616             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01617                                          (unsigned char __RPC_FAR *)sOldFilename,
01618                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01619
01620             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01621                                          (unsigned char __RPC_FAR *)sNewFilename,
01622                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01623
01624             NdrProxySendReceive(This, &_StubMsg);
01625
01626             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01627                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01628
01629             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01630
01631             }
01632         RpcFinally
01633             {
01634             NdrProxyFreeBuffer(This, &_StubMsg);
01635
01636             }
01637         RpcEndFinally
01638
01639         }
01640     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01641         {
01642         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01643         }
01644     RpcEndExcept
01645     return _RetVal;
01646 }
01647
01648 void __RPC_STUB ICvsCoworker_RenameFile_Stub(
01649     IRpcStubBuffer *This,
01650     IRpcChannelBuffer *_pRpcChannelBuffer,
01651     PRPC_MESSAGE _pRpcMessage,
01652     DWORD *_pdwStubPhase)
01653 {
01654     HRESULT _RetVal;
01655     MIDL_STUB_MESSAGE _StubMsg;
01656     int handle;
01657     const unsigned char __RPC_FAR *sNewFilename;
01658     const unsigned char __RPC_FAR *sOldFilename;
01659
01660 NdrStubInitialize(
01661                      _pRpcMessage,
01662                      &_StubMsg,
01663                      &Object_StubDesc,
01664                      _pRpcChannelBuffer);
01665     ( unsigned char __RPC_FAR * )sOldFilename = 0;
01666     ( unsigned char __RPC_FAR * )sNewFilename = 0;
01667     RpcTryFinally
01668         {
01669         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01670             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[98] );
01671
01672         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01673
01674         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01675                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sOldFilename,
01676                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01677                                        (unsigned char)0 );
01678
01679         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01680                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sNewFilename,
01681                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01682                                        (unsigned char)0 );
01683
01684
01685         *_pdwStubPhase = STUB_CALL_SERVER;
01686         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> RenameFile(
01687               (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01688               handle,
01689               sOldFilename,
01690               sNewFilename);
01691
01692         *_pdwStubPhase = STUB_MARSHAL;
01693
01694         _StubMsg.BufferLength = 4U;
01695         _StubMsg.BufferLength += 16;
01696
01697         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01698         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01699
01700         }
01701     RpcFinally
01702         {
01703         }
01704     RpcEndFinally
01705     _pRpcMessage->BufferLength =
01706         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01707
01708 }
01709
01710
01711 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_DiffFile_Proxy(
01712     ICvsCoworker __RPC_FAR * This,
01713     /* [in] */ int handle,
01714     /* [string][in] */ const unsigned char __RPC_FAR *sFilename,
01715     /* [in] */ BOOL bIgnoreCase,
01716     /* [in] */ BOOL bIgnoreBlanks)
01717 {
01718
01719     HRESULT _RetVal;
01720
01721     RPC_MESSAGE _RpcMessage;
01722
01723     MIDL_STUB_MESSAGE _StubMsg;
01724
01725     RpcTryExcept
01726         {
01727         NdrProxyInitialize(
01728                       ( void __RPC_FAR *  )This,
01729                       ( PRPC_MESSAGE  )&_RpcMessage,
01730                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01731                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01732                       14);
01733
01734
01735
01736         if(!sFilename)
01737             {
01738             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01739             }
01740         RpcTryFinally
01741             {
01742
01743             _StubMsg.BufferLength = 4U + 12U + 11U + 7U;
01744             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01745                                            (unsigned char __RPC_FAR *)sFilename,
01746                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01747
01748             NdrProxyGetBuffer(This, &_StubMsg);
01749             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01750
01751             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01752                                          (unsigned char __RPC_FAR *)sFilename,
01753                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01754
01755             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01756             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bIgnoreCase;
01757
01758             *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = bIgnoreBlanks;
01759
01760             NdrProxySendReceive(This, &_StubMsg);
01761
01762             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01763                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
01764
01765             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01766
01767             }
01768         RpcFinally
01769             {
01770             NdrProxyFreeBuffer(This, &_StubMsg);
01771
01772             }
01773         RpcEndFinally
01774
01775         }
01776     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01777         {
01778         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01779         }
01780     RpcEndExcept
01781     return _RetVal;
01782 }
01783
01784 void __RPC_STUB ICvsCoworker_DiffFile_Stub(
01785     IRpcStubBuffer *This,
01786     IRpcChannelBuffer *_pRpcChannelBuffer,
01787     PRPC_MESSAGE _pRpcMessage,
01788     DWORD *_pdwStubPhase)
01789 {
01790     HRESULT _RetVal;
01791     MIDL_STUB_MESSAGE _StubMsg;
01792     BOOL bIgnoreBlanks;
01793     BOOL bIgnoreCase;
01794     int handle;
01795     const unsigned char __RPC_FAR *sFilename;
01796
01797 NdrStubInitialize(
01798                      _pRpcMessage,
01799                      &_StubMsg,
01800                      &Object_StubDesc,
01801                      _pRpcChannelBuffer);
01802     ( unsigned char __RPC_FAR * )sFilename = 0;
01803     RpcTryFinally
01804         {
01805         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01806             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[68] );
01807
01808         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01809
01810         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01811                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilename,
01812                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01813                                        (unsigned char)0 );
01814
01815         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
01816         bIgnoreCase = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
01817
01818         bIgnoreBlanks = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
01819
01820
01821         *_pdwStubPhase = STUB_CALL_SERVER;
01822         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> DiffFile(
01823             (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01824             handle,
01825             sFilename,
01826             bIgnoreCase,
01827             bIgnoreBlanks);
01828
01829         *_pdwStubPhase = STUB_MARSHAL;
01830
01831         _StubMsg.BufferLength = 4U;
01832         _StubMsg.BufferLength += 16;
01833
01834         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01835         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01836
01837         }
01838     RpcFinally
01839         {
01840         }
01841     RpcEndFinally
01842     _pRpcMessage->BufferLength =
01843         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01844
01845 }
01846
01847
01848 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileHistory_Proxy(
01849     ICvsCoworker __RPC_FAR * This,
01850     /* [in] */ int handle,
01851     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames)
01852 {
01853
01854     HRESULT _RetVal;
01855
01856     RPC_MESSAGE _RpcMessage;
01857
01858     MIDL_STUB_MESSAGE _StubMsg;
01859
01860     RpcTryExcept
01861         {
01862         NdrProxyInitialize(
01863                       ( void __RPC_FAR *  )This,
01864                       ( PRPC_MESSAGE  )&_RpcMessage,
01865                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01866                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01867                       15);
01868
01869
01870
01871         if(!sFilenames)
01872             {
01873             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01874             }
01875         RpcTryFinally
01876             {
01877
01878             _StubMsg.BufferLength = 4U + 12U;
01879             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
01880                                            (unsigned char __RPC_FAR *)sFilenames,
01881                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01882
01883             NdrProxyGetBuffer(This, &_StubMsg);
01884             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
01885
01886             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
01887                                          (unsigned char __RPC_FAR *)sFilenames,
01888                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
01889
01890             NdrProxySendReceive(This, &_StubMsg);
01891
01892             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01893                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01894
01895             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
01896
01897             }
01898         RpcFinally
01899             {
01900             NdrProxyFreeBuffer(This, &_StubMsg);
01901
01902             }
01903         RpcEndFinally
01904
01905         }
01906     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
01907         {
01908         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
01909         }
01910     RpcEndExcept
01911     return _RetVal;
01912 }
01913
01914 void __RPC_STUB ICvsCoworker_ShowFileHistory_Stub(
01915     IRpcStubBuffer *This,
01916     IRpcChannelBuffer *_pRpcChannelBuffer,
01917     PRPC_MESSAGE _pRpcMessage,
01918     DWORD *_pdwStubPhase)
01919 {
01920     HRESULT _RetVal;
01921     MIDL_STUB_MESSAGE _StubMsg;
01922     int handle;
01923     const unsigned char __RPC_FAR *sFilenames;
01924
01925 NdrStubInitialize(
01926                      _pRpcMessage,
01927                      &_StubMsg,
01928                      &Object_StubDesc,
01929                      _pRpcChannelBuffer);
01930     ( unsigned char __RPC_FAR * )sFilenames = 0;
01931     RpcTryFinally
01932         {
01933         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
01934             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
01935
01936         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
01937
01938         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
01939                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
01940                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
01941                                        (unsigned char)0 );
01942
01943
01944         *_pdwStubPhase = STUB_CALL_SERVER;
01945         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowFileHistory(
01946                    (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
01947                    handle,
01948                    sFilenames);
01949
01950         *_pdwStubPhase = STUB_MARSHAL;
01951
01952         _StubMsg.BufferLength = 4U;
01953         _StubMsg.BufferLength += 16;
01954
01955         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
01956         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
01957
01958         }
01959     RpcFinally
01960         {
01961         }
01962     RpcEndFinally
01963     _pRpcMessage->BufferLength =
01964         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
01965
01966 }
01967
01968
01969 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowFileProperties_Proxy(
01970     ICvsCoworker __RPC_FAR * This,
01971     /* [in] */ int handle,
01972     /* [string][in] */ const unsigned char __RPC_FAR *sFilename)
01973 {
01974
01975     HRESULT _RetVal;
01976
01977     RPC_MESSAGE _RpcMessage;
01978
01979     MIDL_STUB_MESSAGE _StubMsg;
01980
01981     RpcTryExcept
01982         {
01983         NdrProxyInitialize(
01984                       ( void __RPC_FAR *  )This,
01985                       ( PRPC_MESSAGE  )&_RpcMessage,
01986                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
01987                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
01988                       16);
01989
01990
01991
01992         if(!sFilename)
01993             {
01994             RpcRaiseException(RPC_X_NULL_REF_POINTER);
01995             }
01996         RpcTryFinally
01997             {
01998
01999             _StubMsg.BufferLength = 4U + 12U;
02000             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02001                                            (unsigned char __RPC_FAR *)sFilename,
02002                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02003
02004             NdrProxyGetBuffer(This, &_StubMsg);
02005             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02006
02007             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02008                                          (unsigned char __RPC_FAR *)sFilename,
02009                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02010
02011             NdrProxySendReceive(This, &_StubMsg);
02012
02013             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02014                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02015
02016             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02017
02018             }
02019         RpcFinally
02020             {
02021             NdrProxyFreeBuffer(This, &_StubMsg);
02022
02023             }
02024         RpcEndFinally
02025
02026         }
02027     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02028         {
02029         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02030         }
02031     RpcEndExcept
02032     return _RetVal;
02033 }
02034
02035 void __RPC_STUB ICvsCoworker_ShowFileProperties_Stub(
02036     IRpcStubBuffer *This,
02037     IRpcChannelBuffer *_pRpcChannelBuffer,
02038     PRPC_MESSAGE _pRpcMessage,
02039     DWORD *_pdwStubPhase)
02040 {
02041     HRESULT _RetVal;
02042     MIDL_STUB_MESSAGE _StubMsg;
02043     int handle;
02044     const unsigned char __RPC_FAR *sFilename;
02045
02046 NdrStubInitialize(
02047                      _pRpcMessage,
02048                      &_StubMsg,
02049                      &Object_StubDesc,
02050                      _pRpcChannelBuffer);
02051     ( unsigned char __RPC_FAR * )sFilename = 0;
02052     RpcTryFinally
02053         {
02054         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02055             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02056
02057         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02058
02059         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02060                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilename,
02061                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02062                                        (unsigned char)0 );
02063
02064
02065         *_pdwStubPhase = STUB_CALL_SERVER;
02066         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowFileProperties(
02067                       (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02068                       handle,
02069                       sFilename);
02070
02071         *_pdwStubPhase = STUB_MARSHAL;
02072
02073         _StubMsg.BufferLength = 4U;
02074         _StubMsg.BufferLength += 16;
02075
02076         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02077         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02078
02079         }
02080     RpcFinally
02081         {
02082         }
02083     RpcEndFinally
02084     _pRpcMessage->BufferLength =
02085         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02086
02087 }
02088
02089
02090 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowUserInterface_Proxy(
02091     ICvsCoworker __RPC_FAR * This,
02092     /* [in] */ int handle,
02093     /* [string][in] */ const unsigned char __RPC_FAR *sFilenames)
02094 {
02095
02096     HRESULT _RetVal;
02097
02098     RPC_MESSAGE _RpcMessage;
02099
02100     MIDL_STUB_MESSAGE _StubMsg;
02101
02102     RpcTryExcept
02103         {
02104         NdrProxyInitialize(
02105                       ( void __RPC_FAR *  )This,
02106                       ( PRPC_MESSAGE  )&_RpcMessage,
02107                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02108                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02109                       17);
02110
02111
02112
02113         if(!sFilenames)
02114             {
02115             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02116             }
02117         RpcTryFinally
02118             {
02119
02120             _StubMsg.BufferLength = 4U + 12U;
02121             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02122                                            (unsigned char __RPC_FAR *)sFilenames,
02123                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02124
02125             NdrProxyGetBuffer(This, &_StubMsg);
02126             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02127
02128             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02129                                          (unsigned char __RPC_FAR *)sFilenames,
02130                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18] );
02131
02132             NdrProxySendReceive(This, &_StubMsg);
02133
02134             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02135                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02136
02137             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02138
02139             }
02140         RpcFinally
02141             {
02142             NdrProxyFreeBuffer(This, &_StubMsg);
02143
02144             }
02145         RpcEndFinally
02146
02147         }
02148     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02149         {
02150         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02151         }
02152     RpcEndExcept
02153     return _RetVal;
02154 }
02155
02156 void __RPC_STUB ICvsCoworker_ShowUserInterface_Stub(
02157     IRpcStubBuffer *This,
02158     IRpcChannelBuffer *_pRpcChannelBuffer,
02159     PRPC_MESSAGE _pRpcMessage,
02160     DWORD *_pdwStubPhase)
02161 {
02162     HRESULT _RetVal;
02163     MIDL_STUB_MESSAGE _StubMsg;
02164     int handle;
02165     const unsigned char __RPC_FAR *sFilenames;
02166
02167 NdrStubInitialize(
02168                      _pRpcMessage,
02169                      &_StubMsg,
02170                      &Object_StubDesc,
02171                      _pRpcChannelBuffer);
02172     ( unsigned char __RPC_FAR * )sFilenames = 0;
02173     RpcTryFinally
02174         {
02175         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02176             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[80] );
02177
02178         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02179
02180         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02181                                        (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenames,
02182                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[18],
02183                                        (unsigned char)0 );
02184
02185
02186         *_pdwStubPhase = STUB_CALL_SERVER;
02187         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowUserInterface(
02188                      (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02189                      handle,
02190                      sFilenames);
02191
02192         *_pdwStubPhase = STUB_MARSHAL;
02193
02194         _StubMsg.BufferLength = 4U;
02195         _StubMsg.BufferLength += 16;
02196
02197         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02198         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02199
02200         }
02201     RpcFinally
02202         {
02203         }
02204     RpcEndFinally
02205     _pRpcMessage->BufferLength =
02206         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02207
02208 }
02209
02210
02211 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_HasAdvancedOptionsForCommand_Proxy(
02212     ICvsCoworker __RPC_FAR * This,
02213     /* [in] */ int handle,
02214     /* [in] */ CvsCommand command,
02215     /* [retval][out] */ BOOL __RPC_FAR *pbAdvancedOptions)
02216 {
02217
02218     HRESULT _RetVal;
02219
02220     RPC_MESSAGE _RpcMessage;
02221
02222     MIDL_STUB_MESSAGE _StubMsg;
02223
02224     RpcTryExcept
02225         {
02226         NdrProxyInitialize(
02227                       ( void __RPC_FAR *  )This,
02228                       ( PRPC_MESSAGE  )&_RpcMessage,
02229                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02230                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02231                       18);
02232
02233
02234
02235         if(!pbAdvancedOptions)
02236             {
02237             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02238             }
02239         RpcTryFinally
02240             {
02241
02242             _StubMsg.BufferLength = 4U + 2U;
02243             NdrProxyGetBuffer(This, &_StubMsg);
02244             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02245
02246             NdrSimpleTypeMarshall(
02247                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02248                          ( unsigned char __RPC_FAR * )&command,
02249                          13);
02250             NdrProxySendReceive(This, &_StubMsg);
02251
02252             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02253                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[110] );
02254
02255             *pbAdvancedOptions = *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++;
02256
02257             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02258
02259             }
02260         RpcFinally
02261             {
02262             NdrProxyFreeBuffer(This, &_StubMsg);
02263
02264             }
02265         RpcEndFinally
02266
02267         }
02268     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02269         {
02270         NdrClearOutParameters(
02271                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02272                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[2],
02273                          ( void __RPC_FAR * )pbAdvancedOptions);
02274         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02275         }
02276     RpcEndExcept
02277     return _RetVal;
02278 }
02279
02280 void __RPC_STUB ICvsCoworker_HasAdvancedOptionsForCommand_Stub(
02281     IRpcStubBuffer *This,
02282     IRpcChannelBuffer *_pRpcChannelBuffer,
02283     PRPC_MESSAGE _pRpcMessage,
02284     DWORD *_pdwStubPhase)
02285 {
02286     BOOL _M42;
02287     HRESULT _RetVal;
02288     MIDL_STUB_MESSAGE _StubMsg;
02289     CvsCommand command;
02290     int handle;
02291     BOOL __RPC_FAR *pbAdvancedOptions;
02292
02293 NdrStubInitialize(
02294                      _pRpcMessage,
02295                      &_StubMsg,
02296                      &Object_StubDesc,
02297                      _pRpcChannelBuffer);
02298     ( BOOL __RPC_FAR * )pbAdvancedOptions = 0;
02299     RpcTryFinally
02300         {
02301         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02302             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[110] );
02303
02304         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02305
02306         NdrSimpleTypeUnmarshall(
02307                            ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02308                            ( unsigned char __RPC_FAR * )&command,
02309                            13);
02310         pbAdvancedOptions = &_M42;
02311
02312         *_pdwStubPhase = STUB_CALL_SERVER;
02313         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> HasAdvancedOptionsForCommand(
02314                                 (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02315                                 handle,
02316                                 command,
02317                                 pbAdvancedOptions);
02318
02319         *_pdwStubPhase = STUB_MARSHAL;
02320
02321         _StubMsg.BufferLength = 4U + 4U;
02322         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02323         *(( BOOL __RPC_FAR * )_StubMsg.Buffer)++ = *pbAdvancedOptions;
02324
02325         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02326
02327         }
02328     RpcFinally
02329         {
02330         }
02331     RpcEndFinally
02332     _pRpcMessage->BufferLength =
02333         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02334
02335 }
02336
02337
02338 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy(
02339     ICvsCoworker __RPC_FAR * This,
02340     /* [in] */ int handle,
02341     /* [in] */ CvsCommand command)
02342 {
02343
02344     HRESULT _RetVal;
02345
02346     RPC_MESSAGE _RpcMessage;
02347
02348     MIDL_STUB_MESSAGE _StubMsg;
02349
02350     RpcTryExcept
02351         {
02352         NdrProxyInitialize(
02353                       ( void __RPC_FAR *  )This,
02354                       ( PRPC_MESSAGE  )&_RpcMessage,
02355                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02356                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02357                       19);
02358
02359
02360
02361         RpcTryFinally
02362             {
02363
02364             _StubMsg.BufferLength = 4U + 2U;
02365             NdrProxyGetBuffer(This, &_StubMsg);
02366             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02367
02368             NdrSimpleTypeMarshall(
02369                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02370                          ( unsigned char __RPC_FAR * )&command,
02371                          13);
02372             NdrProxySendReceive(This, &_StubMsg);
02373
02374             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02375                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[120] );
02376
02377             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02378
02379             }
02380         RpcFinally
02381             {
02382             NdrProxyFreeBuffer(This, &_StubMsg);
02383
02384             }
02385         RpcEndFinally
02386
02387         }
02388     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02389         {
02390         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02391         }
02392     RpcEndExcept
02393     return _RetVal;
02394 }
02395
02396 void __RPC_STUB ICvsCoworker_ShowAdvancedOptionsForCommand_Stub(
02397     IRpcStubBuffer *This,
02398     IRpcChannelBuffer *_pRpcChannelBuffer,
02399     PRPC_MESSAGE _pRpcMessage,
02400     DWORD *_pdwStubPhase)
02401 {
02402     HRESULT _RetVal;
02403     MIDL_STUB_MESSAGE _StubMsg;
02404     CvsCommand command;
02405     int handle;
02406
02407 NdrStubInitialize(
02408                      _pRpcMessage,
02409                      &_StubMsg,
02410                      &Object_StubDesc,
02411                      _pRpcChannelBuffer);
02412     RpcTryFinally
02413         {
02414         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02415             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[120] );
02416
02417         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02418
02419         NdrSimpleTypeUnmarshall(
02420                            ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02421                            ( unsigned char __RPC_FAR * )&command,
02422                            13);
02423
02424         *_pdwStubPhase = STUB_CALL_SERVER;
02425         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ShowAdvancedOptionsForCommand(
02426                                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02427                                  handle,
02428                                  command);
02429
02430         *_pdwStubPhase = STUB_MARSHAL;
02431
02432         _StubMsg.BufferLength = 4U;
02433         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02434         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02435
02436         }
02437     RpcFinally
02438         {
02439         }
02440     RpcEndFinally
02441     _pRpcMessage->BufferLength =
02442         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02443
02444 }
02445
02446
02447 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFileChanges_Proxy(
02448     ICvsCoworker __RPC_FAR * This,
02449     /* [in] */ int handle,
02450     /* [in] */ int cbFilenameBuffer,
02451     /* [size_is][string][out] */ unsigned char __RPC_FAR *sFilenameBuffer)
02452 {
02453
02454     HRESULT _RetVal;
02455
02456     RPC_MESSAGE _RpcMessage;
02457
02458     MIDL_STUB_MESSAGE _StubMsg;
02459
02460     RpcTryExcept
02461         {
02462         NdrProxyInitialize(
02463                       ( void __RPC_FAR *  )This,
02464                       ( PRPC_MESSAGE  )&_RpcMessage,
02465                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02466                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02467                       20);
02468
02469
02470
02471         if(!sFilenameBuffer)
02472             {
02473             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02474             }
02475         RpcTryFinally
02476             {
02477
02478             _StubMsg.BufferLength = 4U + 4U;
02479             NdrProxyGetBuffer(This, &_StubMsg);
02480             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02481
02482             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbFilenameBuffer;
02483
02484             NdrProxySendReceive(This, &_StubMsg);
02485
02486             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02487                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[126] );
02488
02489             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02490                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenameBuffer,
02491                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48],
02492                                            (unsigned char)0 );
02493
02494             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02495             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02496
02497             }
02498         RpcFinally
02499             {
02500             NdrProxyFreeBuffer(This, &_StubMsg);
02501
02502             }
02503         RpcEndFinally
02504
02505         }
02506     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02507         {
02508         _StubMsg.MaxCount = cbFilenameBuffer;
02509
02510         NdrClearOutParameters(
02511                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02512                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[44],
02513                          ( void __RPC_FAR * )sFilenameBuffer);
02514         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02515         }
02516     RpcEndExcept
02517     return _RetVal;
02518 }
02519
02520 void __RPC_STUB ICvsCoworker_GetFileChanges_Stub(
02521     IRpcStubBuffer *This,
02522     IRpcChannelBuffer *_pRpcChannelBuffer,
02523     PRPC_MESSAGE _pRpcMessage,
02524     DWORD *_pdwStubPhase)
02525 {
02526     HRESULT _RetVal;
02527     MIDL_STUB_MESSAGE _StubMsg;
02528     int cbFilenameBuffer;
02529     int handle;
02530     unsigned char __RPC_FAR *sFilenameBuffer;
02531
02532 NdrStubInitialize(
02533                      _pRpcMessage,
02534                      &_StubMsg,
02535                      &Object_StubDesc,
02536                      _pRpcChannelBuffer);
02537     ( unsigned char __RPC_FAR * )sFilenameBuffer = 0;
02538     RpcTryFinally
02539         {
02540         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02541             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[126] );
02542
02543         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02544
02545         cbFilenameBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02546
02547         if(cbFilenameBuffer * 1 < 0)
02548             {
02549             RpcRaiseException(RPC_X_INVALID_BOUND);
02550             }
02551         sFilenameBuffer = NdrAllocate(&_StubMsg,cbFilenameBuffer * 1);
02552
02553         *_pdwStubPhase = STUB_CALL_SERVER;
02554         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetFileChanges(
02555                   (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02556                   handle,
02557                   cbFilenameBuffer,
02558                   sFilenameBuffer);
02559
02560         *_pdwStubPhase = STUB_MARSHAL;
02561
02562         _StubMsg.BufferLength = 12U + 11U;
02563         _StubMsg.MaxCount = cbFilenameBuffer;
02564
02565         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02566                                        (unsigned char __RPC_FAR *)sFilenameBuffer,
02567                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48] );
02568
02569         _StubMsg.BufferLength += 16;
02570
02571         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02572         _StubMsg.MaxCount = cbFilenameBuffer;
02573
02574         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02575                                      (unsigned char __RPC_FAR *)sFilenameBuffer,
02576                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48] );
02577
02578         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02579         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02580
02581         }
02582     RpcFinally
02583         {
02584         _StubMsg.MaxCount = cbFilenameBuffer;
02585
02586         NdrPointerFree( &_StubMsg,
02587                         (unsigned char __RPC_FAR *)sFilenameBuffer,
02588                         &__MIDL_TypeFormatString.Format[44] );
02589
02590         }
02591     RpcEndFinally
02592     _pRpcMessage->BufferLength =
02593         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02594
02595 }
02596
02597
02598 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_GetFilesToAdd_Proxy(
02599     ICvsCoworker __RPC_FAR * This,
02600     /* [in] */ int handle,
02601     /* [in] */ int cbFilenamesBuffer,
02602     /* [size_is][string][out] */ unsigned char __RPC_FAR *sFilenamesBuffer)
02603 {
02604
02605     HRESULT _RetVal;
02606
02607     RPC_MESSAGE _RpcMessage;
02608
02609     MIDL_STUB_MESSAGE _StubMsg;
02610
02611     RpcTryExcept
02612         {
02613         NdrProxyInitialize(
02614                       ( void __RPC_FAR *  )This,
02615                       ( PRPC_MESSAGE  )&_RpcMessage,
02616                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02617                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02618                       21);
02619
02620
02621
02622         if(!sFilenamesBuffer)
02623             {
02624             RpcRaiseException(RPC_X_NULL_REF_POINTER);
02625             }
02626         RpcTryFinally
02627             {
02628
02629             _StubMsg.BufferLength = 4U + 4U;
02630             NdrProxyGetBuffer(This, &_StubMsg);
02631             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02632
02633             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = cbFilenamesBuffer;
02634
02635             NdrProxySendReceive(This, &_StubMsg);
02636
02637             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02638                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[136] );
02639
02640             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
02641                                            (unsigned char __RPC_FAR * __RPC_FAR *)&sFilenamesBuffer,
02642                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58],
02643                                            (unsigned char)0 );
02644
02645             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02646             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02647
02648             }
02649         RpcFinally
02650             {
02651             NdrProxyFreeBuffer(This, &_StubMsg);
02652
02653             }
02654         RpcEndFinally
02655
02656         }
02657     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02658         {
02659         _StubMsg.MaxCount = cbFilenamesBuffer;
02660
02661         NdrClearOutParameters(
02662                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02663                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[54],
02664                          ( void __RPC_FAR * )sFilenamesBuffer);
02665         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02666         }
02667     RpcEndExcept
02668     return _RetVal;
02669 }
02670
02671 void __RPC_STUB ICvsCoworker_GetFilesToAdd_Stub(
02672     IRpcStubBuffer *This,
02673     IRpcChannelBuffer *_pRpcChannelBuffer,
02674     PRPC_MESSAGE _pRpcMessage,
02675     DWORD *_pdwStubPhase)
02676 {
02677     HRESULT _RetVal;
02678     MIDL_STUB_MESSAGE _StubMsg;
02679     int cbFilenamesBuffer;
02680     int handle;
02681     unsigned char __RPC_FAR *sFilenamesBuffer;
02682
02683 NdrStubInitialize(
02684                      _pRpcMessage,
02685                      &_StubMsg,
02686                      &Object_StubDesc,
02687                      _pRpcChannelBuffer);
02688     ( unsigned char __RPC_FAR * )sFilenamesBuffer = 0;
02689     RpcTryFinally
02690         {
02691         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02692             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[136] );
02693
02694         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02695
02696         cbFilenamesBuffer = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02697
02698         if(cbFilenamesBuffer * 1 < 0)
02699             {
02700             RpcRaiseException(RPC_X_INVALID_BOUND);
02701             }
02702         sFilenamesBuffer = NdrAllocate(&_StubMsg,cbFilenamesBuffer * 1);
02703
02704         *_pdwStubPhase = STUB_CALL_SERVER;
02705         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetFilesToAdd(
02706                  (ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,
02707                  handle,
02708                  cbFilenamesBuffer,
02709                  sFilenamesBuffer);
02710
02711         *_pdwStubPhase = STUB_MARSHAL;
02712
02713         _StubMsg.BufferLength = 12U + 11U;
02714         _StubMsg.MaxCount = cbFilenamesBuffer;
02715
02716         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
02717                                        (unsigned char __RPC_FAR *)sFilenamesBuffer,
02718                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58] );
02719
02720         _StubMsg.BufferLength += 16;
02721
02722         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02723         _StubMsg.MaxCount = cbFilenamesBuffer;
02724
02725         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
02726                                      (unsigned char __RPC_FAR *)sFilenamesBuffer,
02727                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[58] );
02728
02729         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
02730         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02731
02732         }
02733     RpcFinally
02734         {
02735         _StubMsg.MaxCount = cbFilenamesBuffer;
02736
02737         NdrPointerFree( &_StubMsg,
02738                         (unsigned char __RPC_FAR *)sFilenamesBuffer,
02739                         &__MIDL_TypeFormatString.Format[54] );
02740
02741         }
02742     RpcEndFinally
02743     _pRpcMessage->BufferLength =
02744         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02745
02746 }
02747
02748
02749 /* [helpstring] */ HRESULT STDMETHODCALLTYPE ICvsCoworker_CloseProject_Proxy(
02750     ICvsCoworker __RPC_FAR * This,
02751     /* [in] */ int handle)
02752 {
02753
02754     HRESULT _RetVal;
02755
02756     RPC_MESSAGE _RpcMessage;
02757
02758     MIDL_STUB_MESSAGE _StubMsg;
02759
02760     RpcTryExcept
02761         {
02762         NdrProxyInitialize(
02763                       ( void __RPC_FAR *  )This,
02764                       ( PRPC_MESSAGE  )&_RpcMessage,
02765                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
02766                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
02767                       22);
02768
02769
02770
02771         RpcTryFinally
02772             {
02773
02774             _StubMsg.BufferLength = 4U;
02775             NdrProxyGetBuffer(This, &_StubMsg);
02776             *(( int __RPC_FAR * )_StubMsg.Buffer)++ = handle;
02777
02778             NdrProxySendReceive(This, &_StubMsg);
02779
02780             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02781                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[146] );
02782
02783             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
02784
02785             }
02786         RpcFinally
02787             {
02788             NdrProxyFreeBuffer(This, &_StubMsg);
02789
02790             }
02791         RpcEndFinally
02792
02793         }
02794     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
02795         {
02796         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
02797         }
02798     RpcEndExcept
02799     return _RetVal;
02800 }
02801
02802 void __RPC_STUB ICvsCoworker_CloseProject_Stub(
02803     IRpcStubBuffer *This,
02804     IRpcChannelBuffer *_pRpcChannelBuffer,
02805     PRPC_MESSAGE _pRpcMessage,
02806     DWORD *_pdwStubPhase)
02807 {
02808     HRESULT _RetVal;
02809     MIDL_STUB_MESSAGE _StubMsg;
02810     int handle;
02811
02812 NdrStubInitialize(
02813                      _pRpcMessage,
02814                      &_StubMsg,
02815                      &Object_StubDesc,
02816                      _pRpcChannelBuffer);
02817     RpcTryFinally
02818         {
02819         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
02820             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[146] );
02821
02822         handle = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
02823
02824
02825         *_pdwStubPhase = STUB_CALL_SERVER;
02826         _RetVal = (((ICvsCoworker*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CloseProject((ICvsCoworker *) ((CStdStubBuffer *)This)->pvServerObject,handle);
02827
02828         *_pdwStubPhase = STUB_MARSHAL;
02829
02830         _StubMsg.BufferLength = 4U;
02831         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
02832         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
02833
02834         }
02835     RpcFinally
02836         {
02837         }
02838     RpcEndFinally
02839     _pRpcMessage->BufferLength =
02840         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
02841
02842 }
02843
02844
02845 static const MIDL_STUB_DESC Object_StubDesc =
02846     {
02847     0,
02848     NdrOleAllocate,
02849     NdrOleFree,
02850     0,
02851     0,
02852     0,
02853     0,
02854     0,
02855     __MIDL_TypeFormatString.Format,
02856     1, /* -error bounds_check flag */
02857     0x10001, /* Ndr library version */
02858     0,
02859     0x50100a4, /* MIDL Version 5.1.164 */
02860     0,
02861     0,
02862     0,  /* notify & notify_flag routine table */
02863     1,  /* Flags */
02864     0,  /* Reserved3 */
02865     0,  /* Reserved4 */
02866     0   /* Reserved5 */
02867     };
02868
02869 const CINTERFACE_PROXY_VTABLE(23) _ICvsCoworkerProxyVtbl =
02870 {
02871     &IID_ICvsCoworker,
02872     IUnknown_QueryInterface_Proxy,
02873     IUnknown_AddRef_Proxy,
02874     IUnknown_Release_Proxy ,
02875     ICvsCoworker_GetLastError_Proxy ,
02876     ICvsCoworker_GetErrorMessage_Proxy ,
02877     ICvsCoworker_OpenProject_Proxy ,
02878     ICvsCoworker_GetProject_Proxy ,
02879     ICvsCoworker_UpdateFiles_Proxy ,
02880     ICvsCoworker_CheckoutFiles_Proxy ,
02881     ICvsCoworker_CheckinFiles_Proxy ,
02882     ICvsCoworker_UncheckoutFiles_Proxy ,
02883     ICvsCoworker_AddFiles_Proxy ,
02884     ICvsCoworker_RemoveFiles_Proxy ,
02885     ICvsCoworker_RenameFile_Proxy ,
02886     ICvsCoworker_DiffFile_Proxy ,
02887     ICvsCoworker_ShowFileHistory_Proxy ,
02888     ICvsCoworker_ShowFileProperties_Proxy ,
02889     ICvsCoworker_ShowUserInterface_Proxy ,
02890     ICvsCoworker_HasAdvancedOptionsForCommand_Proxy ,
02891     ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy ,
02892     ICvsCoworker_GetFileChanges_Proxy ,
02893     ICvsCoworker_GetFilesToAdd_Proxy ,
02894     ICvsCoworker_CloseProject_Proxy
02895 };
02896
02897
02898 static const PRPC_STUB_FUNCTION ICvsCoworker_table[] =
02899 {
02900     ICvsCoworker_GetLastError_Stub,
02901     ICvsCoworker_GetErrorMessage_Stub,
02902     ICvsCoworker_OpenProject_Stub,
02903     ICvsCoworker_GetProject_Stub,
02904     ICvsCoworker_UpdateFiles_Stub,
02905     ICvsCoworker_CheckoutFiles_Stub,
02906     ICvsCoworker_CheckinFiles_Stub,
02907     ICvsCoworker_UncheckoutFiles_Stub,
02908     ICvsCoworker_AddFiles_Stub,
02909     ICvsCoworker_RemoveFiles_Stub,
02910     ICvsCoworker_RenameFile_Stub,
02911     ICvsCoworker_DiffFile_Stub,
02912     ICvsCoworker_ShowFileHistory_Stub,
02913     ICvsCoworker_ShowFileProperties_Stub,
02914     ICvsCoworker_ShowUserInterface_Stub,
02915     ICvsCoworker_HasAdvancedOptionsForCommand_Stub,
02916     ICvsCoworker_ShowAdvancedOptionsForCommand_Stub,
02917     ICvsCoworker_GetFileChanges_Stub,
02918     ICvsCoworker_GetFilesToAdd_Stub,
02919     ICvsCoworker_CloseProject_Stub
02920 };
02921
02922 const CInterfaceStubVtbl _ICvsCoworkerStubVtbl =
02923 {
02924     &IID_ICvsCoworker,
02925     0,
02926     23,
02927     &ICvsCoworker_table[-3],
02928     CStdStubBuffer_METHODS
02929 };
02930
02931 #pragma data_seg(".rdata")
02932
02933 #if !defined(__RPC_WIN32__)
02934 #error  Invalid build platform for this stub.
02935 #endif
02936
02937 static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
02938     {
02939         0,
02940         {
02941             0x4e,       /* FC_IN_PARAM_BASETYPE */
02942             0x8,        /* FC_LONG */
02943 /*  2 */
02944             0x51,       /* FC_OUT_PARAM */
02945 #ifndef _ALPHA_
02946             0x1,        /* x86, MIPS & PPC Stack size = 1 */
02947 #else
02948             0x2,        /* Alpha Stack size = 2 */
02949 #endif
02950 /*  4 */    NdrFcShort( 0x2 ),  /* Type Offset=2 */
02951 /*  6 */    0x53,       /* FC_RETURN_PARAM_BASETYPE */
02952             0x8,        /* FC_LONG */
02953 /*  8 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
02954             0x8,        /* FC_LONG */
02955 /* 10 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
02956             0x8,        /* FC_LONG */
02957 /* 12 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
02958             0x8,        /* FC_LONG */
02959 /* 14 */
02960             0x51,       /* FC_OUT_PARAM */
02961 #ifndef _ALPHA_
02962             0x1,        /* x86, MIPS & PPC Stack size = 1 */
02963 #else
02964             0x2,        /* Alpha Stack size = 2 */
02965 #endif
02966 /* 16 */    NdrFcShort( 0x6 ),  /* Type Offset=6 */
02967 /* 18 */    0x53,       /* FC_RETURN_PARAM_BASETYPE */
02968             0x8,        /* FC_LONG */
02969 /* 20 */
02970             0x51,       /* FC_OUT_PARAM */
02971 #ifndef _ALPHA_
02972             0x1,        /* x86, MIPS & PPC Stack size = 1 */
02973 #else
02974             0x2,        /* Alpha Stack size = 2 */
02975 #endif
02976 /* 22 */    NdrFcShort( 0x2 ),  /* Type Offset=2 */
02977 /* 24 */
02978             0x4d,       /* FC_IN_PARAM */
02979 #ifndef _ALPHA_
02980             0x1,        /* x86, MIPS & PPC Stack size = 1 */
02981 #else
02982             0x2,        /* Alpha Stack size = 2 */
02983 #endif
02984 /* 26 */    NdrFcShort( 0x10 ), /* Type Offset=16 */
02985 /* 28 */
02986             0x4d,       /* FC_IN_PARAM */
02987 #ifndef _ALPHA_
02988             0x1,        /* x86, MIPS & PPC Stack size = 1 */
02989 #else
02990             0x2,        /* Alpha Stack size = 2 */
02991 #endif
02992 /* 30 */    NdrFcShort( 0x10 ), /* Type Offset=16 */
02993 /* 32 */
02994             0x4d,       /* FC_IN_PARAM */
02995 #ifndef _ALPHA_
02996             0x1,        /* x86, MIPS & PPC Stack size = 1 */
02997 #else
02998             0x2,        /* Alpha Stack size = 2 */
02999 #endif
03000 /* 34 */    NdrFcShort( 0x10 ), /* Type Offset=16 */
03001 /* 36 */    0x53,       /* FC_RETURN_PARAM_BASETYPE */
03002             0x8,        /* FC_LONG */
03003 /* 38 */
03004             0x51,       /* FC_OUT_PARAM */
03005 #ifndef _ALPHA_
03006             0x1,        /* x86, MIPS & PPC Stack size = 1 */
03007 #else
03008             0x2,        /* Alpha Stack size = 2 */
03009 #endif
03010 /* 40 */    NdrFcShort( 0x2 ),  /* Type Offset=2 */
03011 /* 42 */
03012             0x4d,       /* FC_IN_PARAM */
03013 #ifndef _ALPHA_
03014             0x1,        /* x86, MIPS & PPC Stack size = 1 */
03015 #else
03016             0x2,        /* Alpha Stack size = 2 */
03017 #endif
03018 /* 44 */    NdrFcShort( 0x14 ), /* Type Offset=20 */
03019 /* 46 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03020             0x8,        /* FC_LONG */
03021 /* 48 */
03022             0x50,       /* FC_IN_OUT_PARAM */
03023 #ifndef _ALPHA_
03024             0x1,        /* x86, MIPS & PPC Stack size = 1 */
03025 #else
03026             0x2,        /* Alpha Stack size = 2 */
03027 #endif
03028 /* 50 */    NdrFcShort( 0x18 ), /* Type Offset=24 */
03029 /* 52 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03030             0x8,        /* FC_LONG */
03031 /* 54 */
03032             0x50,       /* FC_IN_OUT_PARAM */
03033 #ifndef _ALPHA_
03034             0x1,        /* x86, MIPS & PPC Stack size = 1 */
03035 #else
03036             0x2,        /* Alpha Stack size = 2 */
03037 #endif
03038 /* 56 */    NdrFcShort( 0x22 ), /* Type Offset=34 */
03039 /* 58 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03040             0x8,        /* FC_LONG */
03041 /* 60 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03042             0x8,        /* FC_LONG */
03043 /* 62 */
03044             0x51,       /* FC_OUT_PARAM */
03045 #ifndef _ALPHA_
03046             0x1,        /* x86, MIPS & PPC Stack size = 1 */
03047 #else
03048             0x2,        /* Alpha Stack size = 2 */
03049 #endif
03050 /* 64 */    NdrFcShort( 0x2 ),  /* Type Offset=2 */
03051 /* 66 */    0x53,       /* FC_RETURN_PARAM_BASETYPE */
03052             0x8,        /* FC_LONG */
03053 /* 68 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03054             0x8,        /* FC_LONG */
03055 /* 70 */
03056             0x4d,       /* FC_IN_PARAM */
03057 #ifndef _ALPHA_
03058             0x1,        /* x86, MIPS & PPC Stack size = 1 */
03059 #else
03060             0x2,        /* Alpha Stack size = 2 */
03061 #endif
03062 /* 72 */    NdrFcShort( 0x10 ), /* Type Offset=16 */
03063 /* 74 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03064             0x8,        /* FC_LONG */
03065 /* 76 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03066             0x8,        /* FC_LONG */
03067 /* 78 */    0x53,       /* FC_RETURN_PARAM_BASETYPE */
03068             0x8,        /* FC_LONG */
03069 /* 80 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03070             0x8,        /* FC_LONG */
03071 /* 82 */
03072             0x4d,       /* FC_IN_PARAM */
03073 #ifndef _ALPHA_
03074             0x1,        /* x86, MIPS & PPC Stack size = 1 */
03075 #else
03076             0x2,        /* Alpha Stack size = 2 */
03077 #endif
03078 /* 84 */    NdrFcShort( 0x10 ), /* Type Offset=16 */
03079 /* 86 */    0x53,       /* FC_RETURN_PARAM_BASETYPE */
03080             0x8,        /* FC_LONG */
03081 /* 88 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03082             0x8,        /* FC_LONG */
03083 /* 90 */
03084             0x4d,       /* FC_IN_PARAM */
03085 #ifndef _ALPHA_
03086             0x1,        /* x86, MIPS & PPC Stack size = 1 */
03087 #else
03088             0x2,        /* Alpha Stack size = 2 */
03089 #endif
03090 /* 92 */    NdrFcShort( 0x10 ), /* Type Offset=16 */
03091 /* 94 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03092             0x8,        /* FC_LONG */
03093 /* 96 */    0x53,       /* FC_RETURN_PARAM_BASETYPE */
03094             0x8,        /* FC_LONG */
03095 /* 98 */    0x4e,       /* FC_IN_PARAM_BASETYPE */
03096             0x8,        /* FC_LONG */
03097 /* 100 */
03098             0x4d,       /* FC_IN_PARAM */
03099 #ifndef _ALPHA_
03100             0x1,        /* x86, MIPS & PPC Stack size = 1 */
03101 #else
03102             0x2,        /* Alpha Stack size = 2 */
03103 #endif
03104 /* 102 */   NdrFcShort( 0x10 ), /* Type Offset=16 */
03105 /* 104 */
03106             0x4d,       /* FC_IN_PARAM */
03107 #ifndef _ALPHA_
03108             0x1,        /* x86, MIPS & PPC Stack size = 1 */
03109 #else
03110             0x2,        /* Alpha Stack size = 2 */
03111 #endif
03112 /* 106 */   NdrFcShort( 0x10 ), /* Type Offset=16 */
03113 /* 108 */   0x53,       /* FC_RETURN_PARAM_BASETYPE */
03114             0x8,        /* FC_LONG */
03115 /* 110 */   0x4e,       /* FC_IN_PARAM_BASETYPE */
03116             0x8,        /* FC_LONG */
03117 /* 112 */   0x4e,       /* FC_IN_PARAM_BASETYPE */
03118             0xd,        /* FC_ENUM16 */
03119 /* 114 */
03120             0x51,       /* FC_OUT_PARAM */
03121 #ifndef _ALPHA_
03122             0x1,        /* x86, MIPS & PPC Stack size = 1 */
03123 #else
03124             0x2,        /* Alpha Stack size = 2 */
03125 #endif
03126 /* 116 */   NdrFcShort( 0x2 ),  /* Type Offset=2 */
03127 /* 118 */   0x53,       /* FC_RETURN_PARAM_BASETYPE */
03128             0x8,        /* FC_LONG */
03129 /* 120 */   0x4e,       /* FC_IN_PARAM_BASETYPE */
03130             0x8,        /* FC_LONG */
03131 /* 122 */   0x4e,       /* FC_IN_PARAM_BASETYPE */
03132             0xd,        /* FC_ENUM16 */
03133 /* 124 */   0x53,       /* FC_RETURN_PARAM_BASETYPE */
03134             0x8,        /* FC_LONG */
03135 /* 126 */   0x4e,       /* FC_IN_PARAM_BASETYPE */
03136             0x8,        /* FC_LONG */
03137 /* 128 */   0x4e,       /* FC_IN_PARAM_BASETYPE */
03138             0x8,        /* FC_LONG */
03139 /* 130 */
03140             0x51,       /* FC_OUT_PARAM */
03141 #ifndef _ALPHA_
03142             0x1,        /* x86, MIPS & PPC Stack size = 1 */
03143 #else
03144             0x2,        /* Alpha Stack size = 2 */
03145 #endif
03146 /* 132 */   NdrFcShort( 0x2c ), /* Type Offset=44 */
03147 /* 134 */   0x53,       /* FC_RETURN_PARAM_BASETYPE */
03148             0x8,        /* FC_LONG */
03149 /* 136 */   0x4e,       /* FC_IN_PARAM_BASETYPE */
03150             0x8,        /* FC_LONG */
03151 /* 138 */   0x4e,       /* FC_IN_PARAM_BASETYPE */
03152             0x8,        /* FC_LONG */
03153 /* 140 */
03154             0x51,       /* FC_OUT_PARAM */
03155 #ifndef _ALPHA_
03156             0x1,        /* x86, MIPS & PPC Stack size = 1 */
03157 #else
03158             0x2,        /* Alpha Stack size = 2 */
03159 #endif
03160 /* 142 */   NdrFcShort( 0x36 ), /* Type Offset=54 */
03161 /* 144 */   0x53,       /* FC_RETURN_PARAM_BASETYPE */
03162             0x8,        /* FC_LONG */
03163 /* 146 */   0x4e,       /* FC_IN_PARAM_BASETYPE */
03164             0x8,        /* FC_LONG */
03165 /* 148 */   0x53,       /* FC_RETURN_PARAM_BASETYPE */
03166             0x8,        /* FC_LONG */
03167
03168             0x0
03169         }
03170     };
03171
03172 static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
03173     {
03174         0,
03175         {
03176             NdrFcShort( 0x0 ),  /* 0 */
03177 /*  2 */
03178             0x11, 0xc,  /* FC_RP [alloced_on_stack] [simple_pointer] */
03179 /*  4 */    0x8,        /* FC_LONG */
03180             0x5c,       /* FC_PAD */
03181 /*  6 */
03182             0x11, 0x0,  /* FC_RP */
03183 /*  8 */    NdrFcShort( 0x2 ),  /* Offset= 2 (10) */
03184 /* 10 */
03185             0x22,       /* FC_C_CSTRING */
03186             0x44,       /* FC_STRING_SIZED */
03187 /* 12 */    0x28,       /* Corr desc:  parameter, FC_LONG */
03188             0x0,        /*  */
03189 #ifndef _ALPHA_
03190 /* 14 */    NdrFcShort( 0xc ),  /* x86, MIPS, PPC Stack size/offset = 12 */
03191 #else
03192             NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
03193 #endif
03194 /* 16 */
03195             0x11, 0x8,  /* FC_RP [simple_pointer] */
03196 /* 18 */
03197             0x22,       /* FC_C_CSTRING */
03198             0x5c,       /* FC_PAD */
03199 /* 20 */
03200             0x11, 0x8,  /* FC_RP [simple_pointer] */
03201 /* 22 */    0x2,        /* FC_CHAR */
03202             0x5c,       /* FC_PAD */
03203 /* 24 */
03204             0x11, 0x0,  /* FC_RP */
03205 /* 26 */    NdrFcShort( 0x2 ),  /* Offset= 2 (28) */
03206 /* 28 */
03207             0x22,       /* FC_C_CSTRING */
03208             0x44,       /* FC_STRING_SIZED */
03209 /* 30 */    0x28,       /* Corr desc:  parameter, FC_LONG */
03210             0x0,        /*  */
03211 #ifndef _ALPHA_
03212 /* 32 */    NdrFcShort( 0xc ),  /* x86, MIPS, PPC Stack size/offset = 12 */
03213 #else
03214             NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
03215 #endif
03216 /* 34 */
03217             0x11, 0x0,  /* FC_RP */
03218 /* 36 */    NdrFcShort( 0x2 ),  /* Offset= 2 (38) */
03219 /* 38 */
03220             0x22,       /* FC_C_CSTRING */
03221             0x44,       /* FC_STRING_SIZED */
03222 /* 40 */    0x28,       /* Corr desc:  parameter, FC_LONG */
03223             0x0,        /*  */
03224 #ifndef _ALPHA_
03225 /* 42 */    NdrFcShort( 0x14 ), /* x86, MIPS, PPC Stack size/offset = 20 */
03226 #else
03227             NdrFcShort( 0x28 ), /* Alpha Stack size/offset = 40 */
03228 #endif
03229 /* 44 */
03230             0x11, 0x0,  /* FC_RP */
03231 /* 46 */    NdrFcShort( 0x2 ),  /* Offset= 2 (48) */
03232 /* 48 */
03233             0x22,       /* FC_C_CSTRING */
03234             0x44,       /* FC_STRING_SIZED */
03235 /* 50 */    0x28,       /* Corr desc:  parameter, FC_LONG */
03236             0x0,        /*  */
03237 #ifndef _ALPHA_
03238 /* 52 */    NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
03239 #else
03240             NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
03241 #endif
03242 /* 54 */
03243             0x11, 0x0,  /* FC_RP */
03244 /* 56 */    NdrFcShort( 0x2 ),  /* Offset= 2 (58) */
03245 /* 58 */
03246             0x22,       /* FC_C_CSTRING */
03247             0x44,       /* FC_STRING_SIZED */
03248 /* 60 */    0x28,       /* Corr desc:  parameter, FC_LONG */
03249             0x0,        /*  */
03250 #ifndef _ALPHA_
03251 /* 62 */    NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
03252 #else
03253             NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
03254 #endif
03255
03256             0x0
03257         }
03258     };
03259
03260 const CInterfaceProxyVtbl * _cvs_coworker_ProxyVtblList[] =
03261 {
03262     ( CInterfaceProxyVtbl *) &_ICvsCoworkerProxyVtbl,
03263     0
03264 };
03265
03266 const CInterfaceStubVtbl * _cvs_coworker_StubVtblList[] =
03267 {
03268     ( CInterfaceStubVtbl *) &_ICvsCoworkerStubVtbl,
03269     0
03270 };
03271
03272 PCInterfaceName const _cvs_coworker_InterfaceNamesList[] =
03273 {
03274     "ICvsCoworker",
03275     0
03276 };
03277
03278
03279 #define _cvs_coworker_CHECK_IID(n)  IID_GENERIC_CHECK_IID( _cvs_coworker, pIID, n)
03280
03281 int __stdcall _cvs_coworker_IID_Lookup( const IID * pIID, int * pIndex )
03282 {
03283
03284     if(!_cvs_coworker_CHECK_IID(0))
03285         {
03286         *pIndex = 0;
03287         return 1;
03288         }
03289
03290     return 0;
03291 }
03292
03293 const ExtendedProxyFileInfo cvs_coworker_ProxyFileInfo =
03294 {
03295     (PCInterfaceProxyVtblList *) & _cvs_coworker_ProxyVtblList,
03296     (PCInterfaceStubVtblList *) & _cvs_coworker_StubVtblList,
03297     (const PCInterfaceName * ) & _cvs_coworker_InterfaceNamesList,
03298     0, // no delegation
03299     & _cvs_coworker_IID_Lookup,
03300     1,
03301     1,
03302     0, /* table of [async_uuid] interfaces */
03303     0, /* Filler1 */
03304     0, /* Filler2 */
03305     0  /* Filler3 */
03306 };
Generated on Sun Feb 24 01:21:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CoWorker/CvsCoworker.cpp Source File

WinCvs/CoWorker/CvsCoworker.cpp

Go to the documentation of this file.
00001 //
00002 // CvsCoworker.cpp : Implementation of CvsCoworker
00003 //
00004 //  This module is mostly boilerplate: dispatching from a single instance
00005 //  handle-based interface to method calls on object based context.
00006 //  In other words, you are unlikely to want to change this file.
00007 //
00008
00009 #include "stdafx.h"
00010 #include "CVS_Coworker_i.h"
00011 #include "CvsTrace.h"
00012 #include "CvsCoworkerErrors.h"
00013 #include "CvsCoworker.h"
00014 #include "CvsProject.h"
00015 #include "CvsFilenames.h"
00016
00017 //
00018 //  Common bit of code,
00019 //
00020
00021 #ifdef NDEBUG
00022 #define CATCH_EXCEPTIONS(FN) \
00023 catch (...) {} return S_FALSE;
00024 #else
00025 #define CATCH_EXCEPTIONS(FN) \
00026 catch (const char* e) { qTRACE(("*EXCEPTION from " #FN "() : %s",e)); } \
00027 catch (...) { qTRACE(("*EXCEPTION from " #FN "()")); } return S_FALSE;
00028 #endif
00029
00030 //
00031 //  Copy a string into a fixed length buffer.
00032 //
00033
00034 static inline void CopyString(char* s1,const char* s2,int n)
00035 {
00036     ASSERT(s1);
00037     ASSERT(s2);
00038     ASSERT(0<n);
00039     strncpy(s1,s2,n);
00040     s1[n-1] = 0;
00041 }
00042
00043 static inline void CopyString(unsigned char* s1,const char* s2,int n)
00044 {
00045     CopyString((char*)s1,s2,n);
00046 }
00047
00049 // CvsCoworker
00050
00051 STDMETHODIMP CvsCoworker::InterfaceSupportsErrorInfo(REFIID riid)
00052 {
00053     qTRACE_FN(CvsCoworker::InterfaceSupportsErrorInfo);
00054     static const IID* arr[] = {
00055         &IID_ICvsCoworker,
00056         0
00057     };
00058     for (int i=0; arr[i]; ++i) {
00059         if (::ATL::InlineIsEqualGUID(*arr[i],riid)) {   //Jerzy[6/13/2001] - fix according to Q243298 at MSDN
00060             return S_OK;
00061         }
00062     }
00063     return S_FALSE;
00064 }
00065
00066 STDMETHODIMP CvsCoworker::GetLastError(
00067     int handle,
00068     int* piError
00069     )
00070 {
00071     ASSERT(piError);
00072     *piError = 0;
00073     CvsProject* pProject = CvsProject::FindProject(handle);
00074     if (!pProject) {
00075         return CVS_E_FAILED_PROJECT_INVALID;
00076     }
00077     *piError = pProject->getLastError();
00078     return S_OK;
00079 }
00080
00081 STDMETHODIMP CvsCoworker::GetErrorMessage(
00082     int handle,
00083     int iError,
00084     int cbErrorBuffer,
00085     unsigned char *sErrorBuffer
00086     )
00087 {
00088     LOG_API_FN(GetErrorMessage);
00089     LOG_API_N(iError);
00090     ASSERT(sErrorBuffer);
00091     ASSERT(0 < cbErrorBuffer);
00092     if (sErrorBuffer) {
00093         *sErrorBuffer = 0;
00094     }
00095     CvsProject* pProject = CvsProject::FindProject(handle);
00096     if (!pProject) {
00097         return CVS_E_FAILED_PROJECT_INVALID;
00098     }
00099     CvsString sError;
00100     if (!pProject->getErrorMessage(iError,sError)) {
00101         return S_FALSE;
00102     }
00103     CopyString(sErrorBuffer,sError,cbErrorBuffer);
00104     LOG_API_S(sErrorBuffer);
00105     return S_OK;
00106 }
00107
00108 STDMETHODIMP CvsCoworker::GetProject(
00109     int *pHandle,
00110     const unsigned char *sUsername,
00111     int cbProjectNameBuffer,
00112     unsigned char *sProjectNameBuffer,
00113     int cbProjectHomeBuffer,
00114     unsigned char *sProjectHomeBuffer,
00115     BOOL bAllowPathChange,
00116     BOOL bAllowNewProject,
00117     BOOL *pbNewProject
00118     )
00119 {
00120     LOG_API_FN(GetProject);
00121     LOG_API_S(sUsername);
00122     LOG_API_S(sProjectNameBuffer);
00123     LOG_API_S(sProjectHomeBuffer);
00124     LOG_API_N(bAllowPathChange);
00125     LOG_API_N(bAllowNewProject);
00126     ASSERT(pHandle);
00127     ASSERT(sUsername);
00128     ASSERT(0 < cbProjectNameBuffer);
00129     ASSERT(sProjectNameBuffer);
00130     ASSERT(0 < cbProjectHomeBuffer);
00131     ASSERT(sProjectHomeBuffer);
00132     ASSERT(pbNewProject);
00133     try {
00134         *pHandle = 0;
00135         *pbNewProject = false;
00136         CvsProject* pProject = new CvsProject;
00137         *pHandle = pProject->getProjectHandle();
00138         bool bOK = pProject->getProject(
00139             (char*)sUsername,
00140             (char*)sProjectNameBuffer,
00141             (char*)sProjectHomeBuffer,
00142             bAllowPathChange,
00143             bAllowNewProject,
00144             *pbNewProject
00145             );
00146         CopyString(sProjectNameBuffer,pProject->getProjectName(),cbProjectNameBuffer);
00147         CopyString(sProjectHomeBuffer,pProject->getProjectHome(),cbProjectHomeBuffer);
00148         LOG_API_N(bOK);
00149         LOG_API_S(sProjectNameBuffer);
00150         LOG_API_S(sProjectHomeBuffer);
00151         if (!bOK) {
00152             return CVS_E_FAILED_OPEN_PROJECT;
00153         }
00154         return S_OK;
00155     }
00156     CATCH_EXCEPTIONS(GetProject);
00157 }
00158
00159 STDMETHODIMP CvsCoworker::OpenProject(
00160     int* pHandle,
00161     const unsigned char *sUsername,
00162     const unsigned char *sProjectName,
00163     const unsigned char *sProjectHome
00164     )
00165 {
00166     LOG_API_FN(OpenProject);
00167     LOG_API_S(sUsername);
00168     LOG_API_S(sProjectName);
00169     LOG_API_S(sProjectHome);
00170     ASSERT(pHandle);
00171     ASSERT(sUsername);
00172     ASSERT(sProjectName);
00173     ASSERT(sProjectHome);
00174     try {
00175         *pHandle = 0;
00176         CvsProject* pProject = new CvsProject;
00177         *pHandle = pProject->getProjectHandle();
00178         bool bOK = pProject->openProject(
00179             (const char*)sUsername,
00180             (const char*)sProjectName,
00181             (const char*)sProjectHome
00182             );
00183         LOG_API_N(bOK);
00184         if (!bOK) {
00185             return CVS_E_FAILED_OPEN_PROJECT;
00186         }
00187         return S_OK;
00188     }
00189     CATCH_EXCEPTIONS(OpenProject);
00190 }
00191
00192 // Standard preamble for mapping a handle to an class instance.
00193 #define PREAMBLE(H) \
00194 CvsProject* pProject = CvsProject::FindProject(handle); \
00195 ASSERT(pProject); \
00196 if (!pProject) { return CVS_E_FAILED_PROJECT_INVALID; }
00197
00198 STDMETHODIMP CvsCoworker::CloseProject(
00199     int handle
00200     )
00201 {
00202     LOG_API_FN(CloseProject);
00203     PREAMBLE(handle);
00204     try {
00205         bool bOK = pProject->closeProject();
00206         LOG_API_N(bOK);
00207         if (!bOK) {
00208             return CVS_E_FAILED_CLOSE_PROJECT;
00209         }
00210         return S_OK;
00211     }
00212     CATCH_EXCEPTIONS(CloseProject);
00213 }
00214
00215 STDMETHODIMP CvsCoworker::UpdateFiles(
00216     int handle,
00217     const unsigned char *sFilenames,
00218     BOOL bDirectories,
00219     BOOL bRecurse
00220     )
00221 {
00222     LOG_API_FN(UpdateFiles);
00223     LOG_API_S(sFilenames);
00224     LOG_API_N(bDirectories);
00225     LOG_API_N(bRecurse);
00226     ASSERT(sFilenames);
00227     PREAMBLE(handle);
00228     try {
00229         bool bOK = pProject->updateFiles(
00230             CvsFilenames(sFilenames),
00231             bDirectories,
00232             bRecurse
00233             );
00234         LOG_API_N(bOK);
00235         if (!bOK) {
00236             return CVS_E_FAILED;
00237         }
00238         return S_OK;
00239     }
00240     CATCH_EXCEPTIONS(UpdateFiles);
00241 }
00242
00243 STDMETHODIMP CvsCoworker::CheckoutFiles(
00244     int handle,
00245     const unsigned char *sFilenames
00246     )
00247 {
00248     LOG_API_FN(CheckoutFiles);
00249     LOG_API_S(sFilenames);
00250     ASSERT(sFilenames);
00251     PREAMBLE(handle);
00252     try {
00253         bool bOK = pProject->checkoutFiles(
00254             CvsFilenames(sFilenames)
00255             );
00256         LOG_API_N(bOK);
00257         if (!bOK) {
00258             return CVS_E_FAILED;
00259         }
00260         return S_OK;
00261     }
00262     CATCH_EXCEPTIONS(CheckoutFiles);
00263 }
00264
00265 STDMETHODIMP CvsCoworker::CheckinFiles(
00266     int handle,
00267     const unsigned char *sFilenames,
00268     BOOL bKeepCheckedOut
00269     )
00270 {
00271     LOG_API_FN(CheckinFiles);
00272     LOG_API_S(sFilenames);
00273     LOG_API_N(bKeepCheckedOut);
00274     ASSERT(sFilenames);
00275     PREAMBLE(handle);
00276     try {
00277         bool bOK = pProject->checkinFiles(
00278             CvsFilenames(sFilenames),
00279             bKeepCheckedOut
00280             );
00281         LOG_API_N(bOK);
00282         if (!bOK) {
00283             return CVS_E_FAILED;
00284         }
00285         return S_OK;
00286     }
00287     CATCH_EXCEPTIONS(CheckinFiles);
00288 }
00289
00290 STDMETHODIMP CvsCoworker::UncheckoutFiles(
00291     int handle,
00292     const unsigned char *sFilenames
00293     )
00294 {
00295     LOG_API_FN(UncheckoutFiles);
00296     LOG_API_S(sFilenames);
00297     ASSERT(sFilenames);
00298     PREAMBLE(handle);
00299     try {
00300         bool bOK = pProject->uncheckoutFiles(
00301             CvsFilenames(sFilenames)
00302             );
00303         LOG_API_N(bOK);
00304         if (!bOK) {
00305             return CVS_E_FAILED;
00306         }
00307         return S_OK;
00308     }
00309     CATCH_EXCEPTIONS(UncheckoutFiles);
00310 }
00311
00312 STDMETHODIMP CvsCoworker::AddFiles(
00313     int handle,
00314     const unsigned char* sOptionsAndFilenames,
00315     const unsigned char* sComment
00316     )
00317 {
00318     LOG_API_FN(AddFiles);
00319     LOG_API_S(sOptionsAndFilenames);
00320     LOG_API_S(sComment);
00321     ASSERT(sOptionsAndFilenames);
00322     PREAMBLE(handle);
00323     try {
00324         bool bOK = pProject->addFiles(
00325             CvsFilenames(sOptionsAndFilenames),
00326             (const char*)sComment
00327             );
00328         LOG_API_N(bOK);
00329         if (!bOK) {
00330             return CVS_E_FAILED;
00331         }
00332         return S_OK;
00333     }
00334     CATCH_EXCEPTIONS(AddFiles);
00335 }
00336
00337 STDMETHODIMP CvsCoworker::RemoveFiles(
00338     int handle,
00339     const unsigned char *sFilenames
00340     )
00341 {
00342     LOG_API_FN(RemoveFiles);
00343     LOG_API_S(sFilenames);
00344     ASSERT(sFilenames);
00345     PREAMBLE(handle);
00346     try {
00347         bool bOK = pProject->removeFiles(
00348             CvsFilenames(sFilenames)
00349             );
00350         LOG_API_N(bOK);
00351         if (!bOK) {
00352             return CVS_E_FAILED;
00353         }
00354         return S_OK;
00355     }
00356     CATCH_EXCEPTIONS(RemoveFiles);
00357 }
00358
00359 STDMETHODIMP CvsCoworker::RenameFile(
00360     int handle,
00361     const unsigned char *sOldFilename,
00362     const unsigned char *sNewFilename
00363     )
00364 {
00365     LOG_API_FN(RenameFiles);
00366     LOG_API_S(sOldFilename);
00367     LOG_API_S(sNewFilename);
00368     ASSERT(sOldFilename);
00369     ASSERT(sNewFilename);
00370     PREAMBLE(handle);
00371     try {
00372         bool bOK = pProject->renameFile(
00373             (const char*)sOldFilename,
00374             (const char*)sNewFilename
00375             );
00376         LOG_API_N(bOK);
00377         if (!bOK) {
00378             return CVS_E_FAILED;
00379         }
00380         return S_OK;
00381     }
00382     CATCH_EXCEPTIONS(RenameFile);
00383 }
00384
00385 STDMETHODIMP CvsCoworker::DiffFile(
00386     int handle,
00387     const unsigned char *sFilename,
00388     BOOL bIgnoreCase,
00389     BOOL bIgnoreWhitespace
00390     )
00391 {
00392     LOG_API_FN(DiffFiles);
00393     LOG_API_S(sFilename);
00394     LOG_API_N(bIgnoreCase);
00395     LOG_API_N(bIgnoreWhitespace);
00396     ASSERT(sFilename);
00397     PREAMBLE(handle);
00398     try {
00399         bool bOK = pProject->diffFile(
00400             (const char*)sFilename,
00401             bIgnoreCase,
00402             bIgnoreWhitespace
00403             );
00404         LOG_API_N(bOK);
00405         if (!bOK) {
00406             return CVS_E_FAILED;
00407         }
00408         return S_OK;
00409     }
00410     CATCH_EXCEPTIONS(DiffFile);
00411 }
00412
00413 STDMETHODIMP CvsCoworker::ShowFileHistory(
00414     int handle,
00415     const unsigned char *sFilenames
00416     )
00417 {
00418     LOG_API_FN(ShowFileHistory);
00419     LOG_API_S(sFilenames);
00420     ASSERT(sFilenames);
00421     PREAMBLE(handle);
00422     try {
00423         bool bOK = pProject->showFileHistory(
00424             CvsFilenames(sFilenames)
00425             );
00426         LOG_API_N(bOK);
00427         if (!bOK) {
00428             return CVS_E_FAILED;
00429         }
00430         return S_OK;
00431     }
00432     CATCH_EXCEPTIONS(ShowFileHistory);
00433 }
00434
00435 STDMETHODIMP CvsCoworker::ShowFileProperties(
00436     int handle,
00437     const unsigned char *sFilename
00438     )
00439 {
00440     LOG_API_FN(ShowFileProperties);
00441     LOG_API_S(sFilename);
00442     ASSERT(sFilename);
00443     PREAMBLE(handle);
00444     try {
00445         bool bOK = pProject->showFileProperties(
00446             (const char*)sFilename
00447             );
00448         LOG_API_N(bOK);
00449         if (!bOK) {
00450             return CVS_E_FAILED;
00451         }
00452         return S_OK;
00453     }
00454     CATCH_EXCEPTIONS(ShowFileProperties);
00455 }
00456
00457 STDMETHODIMP CvsCoworker::ShowUserInterface(
00458     int handle,
00459     const unsigned char *sFilenames
00460     )
00461 {
00462     LOG_API_FN(ShowUserInterface);
00463     LOG_API_S(sFilenames);
00464     ASSERT(sFilenames);
00465     PREAMBLE(handle);
00466     try {
00467         bool bOK = pProject->showUserInterface(
00468             CvsFilenames(sFilenames)
00469             );
00470         LOG_API_N(bOK);
00471         if (!bOK) {
00472             return CVS_E_FAILED;
00473         }
00474         return S_OK;
00475     }
00476     CATCH_EXCEPTIONS(ShowUserInterface);
00477 }
00478
00479 STDMETHODIMP CvsCoworker::HasAdvancedOptionsForCommand(
00480     int handle,
00481     CvsCommand command,
00482     BOOL *pbAdvancedOptions
00483     )
00484 {
00485     LOG_API_FN(HasAdvancedOptionsForCommand);
00486     LOG_API_N(command);
00487     ASSERT(pbAdvancedOptions);
00488     PREAMBLE(handle);
00489     try {
00490         bool bOK = pProject->hasAdvancedOptionsForCommand(
00491             command,
00492             *pbAdvancedOptions
00493             );
00494         LOG_API_N(bOK);
00495         LOG_API_N(*pbAdvancedOptions);
00496         if (!bOK) {
00497             return CVS_E_FAILED;
00498         }
00499         return S_OK;
00500     }
00501     CATCH_EXCEPTIONS(HasAdvancedOptionsForCommand);
00502 }
00503
00504 STDMETHODIMP CvsCoworker::ShowAdvancedOptionsForCommand(
00505     int handle,
00506     CvsCommand command
00507     )
00508 {
00509     LOG_API_FN(ShowAdvancedOptionsForCommand);
00510     LOG_API_N(command);
00511     PREAMBLE(handle);
00512     try {
00513         bool bOK = pProject->showAdvancedOptionsForCommand(
00514             command
00515             );
00516         LOG_API_N(bOK);
00517         if (!bOK) {
00518             return CVS_E_FAILED;
00519         }
00520         return S_OK;
00521     }
00522     CATCH_EXCEPTIONS(ShowAdvancedOptionsForCommand);
00523 }
00524
00525 STDMETHODIMP CvsCoworker::GetFileChanges(
00526     int handle,
00527     int cbFilenameBuffer,
00528     unsigned char *sFilenameBuffer
00529     )
00530 {
00531     LOG_API_FN(GetFileChanges);
00532     ASSERT(0<cbFilenameBuffer);
00533     ASSERT(sFilenameBuffer);
00534     PREAMBLE(handle);
00535     CvsString sFilename;
00536     try {
00537         bool bOK = pProject->getFileChanges(
00538             sFilename
00539             );
00540         CopyString(sFilenameBuffer,sFilename,cbFilenameBuffer);
00541         LOG_API_N(bOK);
00542         LOG_API_S(sFilenameBuffer);
00543         if (!bOK) {
00544             return CVS_E_FAILED;
00545         }
00546         return S_OK;
00547     }
00548     CATCH_EXCEPTIONS(GetFileChanges);
00549 }
00550
00551 STDMETHODIMP CvsCoworker::GetFilesToAdd(
00552     int handle,
00553     int cbFilenamesBuffer,
00554     unsigned char *sFilenamesBuffer
00555     )
00556 {
00557     LOG_API_FN(GetFilesToAdd);
00558     ASSERT(0<cbFilenamesBuffer);
00559     ASSERT(sFilenamesBuffer);
00560     PREAMBLE(handle);
00561     CvsString sFilenames;
00562     try {
00563         bool bOK = pProject->getFilesToAdd(
00564             sFilenames
00565             );
00566         CopyString(sFilenamesBuffer,sFilenames,cbFilenamesBuffer);
00567         LOG_API_N(bOK);
00568         LOG_API_S(sFilenamesBuffer);
00569         if (!bOK) {
00570             return CVS_E_FAILED;
00571         }
00572         return S_OK;
00573     }
00574     CATCH_EXCEPTIONS(GetFilesToAdd);
00575 }
Generated on Sun Feb 24 01:21:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CoWorker/CvsCoworker.h Source File

WinCvs/CoWorker/CvsCoworker.h

Go to the documentation of this file.
00001 // CvsCoworker.h : Declaration of the CvsCoworker
00002
00003 #ifndef __CVSCOWORKER_H_
00004 #define __CVSCOWORKER_H_
00005
00006 #include "resource.h"       // main symbols
00007
00009 // CvsCoworker
00010 class ATL_NO_VTABLE CvsCoworker :
00011     public CComObjectRootEx<CComSingleThreadModel>,
00012     public CComCoClass<CvsCoworker, &CLSID_CvsCoworker>,
00013     public ISupportErrorInfo,
00014     public ICvsCoworker
00015 {
00016 public:
00017     CvsCoworker()
00018     {
00019         qTRACE_FN(CvsCoworker);
00020     }
00021
00022 DECLARE_REGISTRY_RESOURCEID(IDR_CVSCOWORKER)
00023 DECLARE_NOT_AGGREGATABLE(CvsCoworker)
00024
00025 DECLARE_PROTECT_FINAL_CONSTRUCT()
00026
00027 BEGIN_COM_MAP(CvsCoworker)
00028     COM_INTERFACE_ENTRY(ICvsCoworker)
00029     COM_INTERFACE_ENTRY(ISupportErrorInfo)
00030 END_COM_MAP()
00031
00032 // ISupportsErrorInfo
00033     STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00034
00035 // ICvsCoworker
00036 public:
00037     STDMETHOD(GetErrorMessage)(
00038             int handle,
00039             int iError,
00040             int cbErrorBuffer,
00041             unsigned char* sError
00042             );
00043     STDMETHOD(GetLastError)(
00044             int handle,
00045             int* piError
00046             );
00047     STDMETHOD(OpenProject)(
00048             int* pHandle,
00049             const unsigned char* sUsername,
00050             const unsigned char* sProjectName,
00051             const unsigned char* sProjectHome
00052             );
00053     STDMETHOD(GetProject)(
00054             int* pHandle,
00055             const unsigned char* sUsername,
00056             int cbProjectNameBuffer,
00057             unsigned char* sProjectName,
00058             int cbProjectHomeBuffer,
00059             unsigned char* sProjectHome,
00060             BOOL bAllowPathChange,
00061             BOOL bAllowNewProject,
00062             BOOL* pbNewProject
00063             );
00064     STDMETHOD(CloseProject)(
00065             int handle
00066             );
00067     STDMETHOD(UpdateFiles)(
00068             int handle,
00069             const unsigned char* sFilenames,
00070             BOOL bDirectories,
00071             BOOL bRecurse
00072             );
00073     STDMETHOD(CheckoutFiles)(
00074             int handle,
00075             const unsigned char* sFilenames
00076             );
00077     STDMETHOD(CheckinFiles)(
00078             int handle,
00079             const unsigned char* sFilenames,
00080             BOOL bKeepCheckedOut
00081             );
00082     STDMETHOD(UncheckoutFiles)(
00083             int handle,
00084             const unsigned char* sFilenames
00085             );
00086     STDMETHOD(AddFiles)(
00087             int handle,
00088             const unsigned char* sOptionsAndFilenames,
00089             const unsigned char* sComment
00090             );
00091     STDMETHOD(RemoveFiles)(
00092             int handle,
00093             const unsigned char* sFilenames
00094             );
00095     STDMETHOD(RenameFile)(
00096             int handle,
00097             const unsigned char* sOldFilename,
00098             const unsigned char* sNewFilename
00099             );
00100     STDMETHOD(DiffFile)(
00101             int handle,
00102             const unsigned char* sFilename,
00103             BOOL bIgnoreCase,
00104             BOOL bIgnoreWhitespace
00105             );
00106     STDMETHOD(ShowFileHistory)(
00107             int handle,
00108             const unsigned char* sFilenames
00109             );
00110     STDMETHOD(ShowFileProperties)(
00111             int handle,
00112             const unsigned char* sFilename
00113             );
00114     STDMETHOD(ShowUserInterface)(
00115             int handle,
00116             const unsigned char* sFilenames
00117             );
00118     STDMETHOD(HasAdvancedOptionsForCommand)(
00119             int handle,
00120             CvsCommand command,
00121             BOOL* pbAdvancedOptions
00122             );
00123     STDMETHOD(ShowAdvancedOptionsForCommand)(
00124             int handle,
00125             CvsCommand command
00126             );
00127     STDMETHOD(GetFileChanges)(
00128             int handle,
00129             int cbFilenameBuffer,
00130             unsigned char* sFilenameBuffer
00131             );
00132     STDMETHOD(GetFilesToAdd)(
00133             int handle,
00134             int cbFilenamesBuffer,
00135             unsigned char* sFilenamesBuffer
00136             );
00137 };
00138
00139 #endif //__CVSCOWORKER_H_
Generated on Sun Feb 24 01:21:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CoWorker/CvsCoworkerErrors.h Source File

WinCvs/CoWorker/CvsCoworkerErrors.h

Go to the documentation of this file.
00001 #ifndef _CVSCOWORKERERROR_H_
00002 #define _CVSCOWORKERERROR_H_
00003
00004 //
00005 //  Likely errors to be returned from coworker API.
00006 //  Will expand or shrink this list as needed.
00007 //
00008
00009 // Returns from OpenProject()
00010 #define CVS_E_FAILED_OPEN_PROJECT           MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,100)
00011 #define CVS_E_FAILED_OPEN_DISALLOWED        MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,101)
00012 #define CVS_E_FAILED_OPEN_INVALID_USER      MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,102)
00013 #define CVS_E_FAILED_OPEN_CREATE            MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,103)
00014 #define CVS_E_FAILED_OPEN_BAD_PATH          MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,104)
00015
00016 // Returns from CloseProject()
00017 #define CVS_E_FAILED_CLOSE_PROJECT          MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,200)
00018
00019 // Returns from UpdateFiles()
00020 #define CVS_E_FAILED_UPDATE_FILES           MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,300)
00021 #define CVS_E_FAILED_UPDATE_DISALLOWED      MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,301)
00022 #define CVS_E_FAILED_UPDATE_NOT_IN_CVS      MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,302)
00023
00024 // Return from CheckoutFiles()
00025 #define CVS_E_FAILED_CHECKOUT_FILES         MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,400)
00026 #define CVS_E_FAILED_CHECKOUT_DISALLOWED    MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,401)
00027 #define CVS_E_FAILED_CHECKOUT_NOT_IN_CVS    MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,402)
00028
00029 // Return from CheckinFiles()
00030 #define CVS_E_FAILED_CHECKIN_FILES          MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,500)
00031 #define CVS_E_FAILED_CHECKIN_DISALLOWED     MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,501)
00032 #define CVS_E_FAILED_CHECKIN_NOT_IN_CVS     MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,502)
00033 #define CVS_E_FAILED_CHECKIN_NEED_UPDATE    MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,503)
00034
00035 // Returns common to many functions.
00036 #define CVS_E_FAILED_PROJECT_INVALID        MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,9900)
00037 #define CVS_E_FAILED                        MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,9901)
00038
00039 #endif
00040
Generated on Sun Feb 24 01:21:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CoWorker/CvsFilenames.cpp Source File

WinCvs/CoWorker/CvsFilenames.cpp

Go to the documentation of this file.
00001 // CvsFilenames.cpp: implementation of the CvsFilenames class.
00002 //
00004
00005 #include "stdafx.h"
00006 #include "CvsTrace.h"
00007 #include "CvsFilenames.h"
00008
00010 // Construction/Destruction
00012
00013 CvsFilenames::CvsFilenames(const unsigned char* sFilenames)
00014 :   m_sBuffer((const char*)sFilenames),
00015     m_nFilenames(0),
00016     m_arrayOffsetName(0)
00017 {
00018     qTRACE_FN(CvsFilenames);
00019     qTRACE(("* strlen(sFilenames) = %d",strlen((const char*)sFilenames)));
00020
00021     char* sBase = m_sBuffer.getBuffer();
00022
00023     // count \n separators
00024     int nNames = 0;
00025     char* sName = sBase;
00026     for (;;) {
00027         char* s = strchr(sName,'\n');
00028         if (!s) break;
00029         ++nNames;
00030         sName = s + 1;
00031     }
00032
00033     qTRACE(("* found %d names",nNames));
00034
00035     // set name offsets and replace \n with \0
00036     m_arrayOffsetName = new int[nNames];
00037     int iName = 0;
00038     sName = sBase;
00039     for (;;) {
00040         char* s = strchr(sName,'\n');
00041         if (!s) break;
00042         m_arrayOffsetName[iName++] = (int)(sName - sBase);
00043         *s++ = 0;
00044         sName = s;
00045     }
00046     ASSERT(iName == nNames);
00047     ASSERT((0 == iName) || !*sName);
00048 }
00049
00050 CvsFilenames::~CvsFilenames()
00051 {
00052     delete [] m_arrayOffsetName;
00053 }
00054
00055 //
00056 //
00057 //
00058
00059 const char* CvsFilenames::getFilename(int i)
00060 {
00061     if ((i < 0) || (m_nFilenames <= i)) return "";
00062     int iOffset = m_arrayOffsetName[i];
00063     ASSERT(0 <= iOffset);
00064     ASSERT(iOffset < m_sBuffer.getBufferMax());
00065     const char* p = m_sBuffer;
00066     return p + iOffset;
00067 }
00068
00069 //
00070 //
00071 //
00072
00073 bool CvsFilenames::getOptionsAndFilename(int i,CvsString& sOptions,CvsString& sFilename)
00074 {
00075     if ((i < 0) || (m_nFilenames <= i)) {
00076         sOptions.strcpy("");
00077         sFilename.strcpy("");
00078         return false;
00079     }
00080     int iOffset = m_arrayOffsetName[i];
00081     ASSERT(0 <= iOffset);
00082     ASSERT(iOffset < m_sBuffer.getBufferMax());
00083     const char* pBase = m_sBuffer + iOffset;
00084     const char* pTab  = strchr(pBase,'\t');
00085     if (pTab) {
00086         sOptions.strncpy(pBase,(int)(pTab - pBase));
00087         sFilename.strcpy(pTab+1);
00088     } else {
00089         sOptions.strcpy("");
00090         sFilename.strcpy(pBase);
00091     }
00092     return true;
00093 }
Generated on Sun Feb 24 01:21:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CoWorker/CvsFilenames.h Source File

WinCvs/CoWorker/CvsFilenames.h

Go to the documentation of this file.
00001 // CvsFilenames.h: interface for the CvsFilenames class.
00002 //
00004
00005 #if !defined(AFX_CVSFILENAMES_H__582FF616_FAA5_11D2_B442_0080C6F9179D__INCLUDED_)
00006 #define AFX_CVSFILENAMES_H__582FF616_FAA5_11D2_B442_0080C6F9179D__INCLUDED_
00007
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011
00012 #include "CvsString.h"
00013
00014 class CvsFilenames
00015 {
00016 public:
00017     CvsFilenames(const unsigned char*);
00018     ~CvsFilenames();
00019 public:
00020     bool getOptionsAndFilename(int i,CvsString&,CvsString&);
00021     const char* getFilename(int);
00022     int getNumberOfFilenames() { return m_nFilenames; }
00023 protected:
00024     CvsString m_sBuffer;
00025     int m_nFilenames;
00026     int* m_arrayOffsetName;
00027 };
00028
00029 #endif // !defined(AFX_CVSFILENAMES_H__582FF616_FAA5_11D2_B442_0080C6F9179D__INCLUDED_)
Generated on Sun Feb 24 01:21:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CoWorker/CvsProject.cpp Source File

WinCvs/CoWorker/CvsProject.cpp

Go to the documentation of this file.
00001 // CvsProject.cpp: implementation of the CvsProject class.
00002 //
00004
00005 #include "stdafx.h"
00006 #include "CVS_Coworker_i.h"
00007 #include "CvsTrace.h"
00008 #include "CvsProject.h"
00009
00010 // Unique project number counter.
00011 static int g_hNextProject = 1000;
00012
00013 // Global list of projects.
00014 static CvsProject* g_pProjects;
00015
00017 // Construction/Destruction
00019
00020 CvsProject::CvsProject()
00021 :   m_hProject(g_hNextProject++),
00022     m_pNextProject(g_pProjects),
00023     m_iLastError(0)
00024 {
00025     g_pProjects = this;
00026 }
00027
00028 CvsProject::~CvsProject()
00029 {
00030     ASSERT(!m_pNextProject);
00031     // Not freed immediately for error catching.
00032 }
00033
00034 //
00035 //  Access to global list of projects.
00036 //
00037
00038 CvsProject* CvsProject::FindProject(int h)
00039 {
00040     CvsProject* pProject = g_pProjects;
00041     while (pProject) {
00042         if (h == pProject->getProjectHandle()) {
00043             return pProject;
00044         }
00045         pProject = pProject->m_pNextProject;
00046     }
00047     return 0;
00048 }
00049
00050 //
00051 //  Error reporting
00052 //
00053
00054 bool CvsProject::getErrorMessage(int iError,CvsString& sError)
00055 {
00056     // TODO: Add your implementation code here
00057     sError = "No error";
00058     return true;
00059 }
00060
00061 //
00062 //  Implementation of CVS coworker operations.
00063 //
00064
00065 bool CvsProject::getProject(
00066     const char* sUsername,
00067     const char* sProjectName,
00068     const char* sProjectHome,
00069     BOOL bAllowPathChange,
00070     BOOL bAllowNewProject,
00071     BOOL& bNewProject
00072     )
00073 {
00074     m_sUsername     = sUsername;
00075     m_sProjectName  = sProjectName;
00076     m_sProjectHome  = sProjectHome;
00077     // TODO: Add your implementation code here
00078     return false;
00079 }
00080
00081 bool CvsProject::openProject(
00082     const char* sUsername,
00083     const char* sProjectName,
00084     const char* sProjectHome
00085     )
00086 {
00087     m_sUsername     = sUsername;
00088     m_sProjectName  = sProjectName;
00089     m_sProjectHome  = sProjectHome;
00090     // TODO: Add your implementation code here
00091     return true;
00092 }
00093
00094 bool CvsProject::closeProject()
00095 {
00096     // TODO: Add your implementation code here
00097     return true;
00098 }
00099
00100 bool CvsProject::updateFiles(
00101     CvsFilenames& filenames,
00102     BOOL bDirectories,
00103     BOOL bRecurse
00104     )
00105 {
00106     // TODO: Add your implementation code here
00107     return true;
00108 }
00109
00110 bool CvsProject::checkoutFiles(
00111     CvsFilenames& filenames
00112     )
00113 {
00114     // TODO: Add your implementation code here
00115     return true;
00116 }
00117
00118 bool CvsProject::checkinFiles(
00119     CvsFilenames& filenames,
00120     BOOL bKeepCheckedOut
00121     )
00122 {
00123     // TODO: Add your implementation code here
00124     return true;
00125 }
00126
00127 bool CvsProject::uncheckoutFiles(
00128     CvsFilenames& filenames
00129     )
00130 {
00131     // TODO: Add your implementation code here
00132     return true;
00133 }
00134
00135 bool CvsProject::addFiles(
00136     CvsFilenames& sOptionsAndFilenames,
00137     const char* sComment
00138     )
00139 {
00140     // TODO: Add your implementation code here
00141     return true;
00142 }
00143
00144 bool CvsProject::removeFiles(
00145     CvsFilenames& filenames
00146     )
00147 {
00148     // TODO: Add your implementation code here
00149     return true;
00150 }
00151
00152 bool CvsProject::renameFile(
00153     const char* sOldFilename,
00154     const char* sNewFilename
00155     )
00156 {
00157     // TODO: Add your implementation code here
00158     return true;
00159 }
00160
00161 bool CvsProject::diffFile(
00162     const char* sFilename,
00163     BOOL bIgnoreCase,
00164     BOOL bIgnoreWhitespace
00165     )
00166 {
00167     // TODO: Add your implementation code here
00168     return true;
00169 }
00170
00171 bool CvsProject::isFileDifferent(
00172     const char* sFilename,
00173     CvsOption option,
00174     BOOL& bFileIsDifferent
00175     )
00176 {
00177     bFileIsDifferent = false;
00178     // TODO: Add your implementation code here
00179     return true;
00180 }
00181
00182 bool CvsProject::showFileHistory(
00183     CvsFilenames& filenames
00184     )
00185 {
00186     // TODO: Add your implementation code here
00187     return true;
00188 }
00189
00190 bool CvsProject::showFileProperties(
00191     const char* sFilename
00192     )
00193 {
00194     // TODO: Add your implementation code here
00195     return true;
00196 }
00197
00198 bool CvsProject::showUserInterface(
00199     CvsFilenames& filenames
00200     )
00201 {
00202     CWnd* pMainWnd = AfxGetMainWnd();
00203     if (pMainWnd) {
00204         pMainWnd->ShowWindow(SW_SHOWDEFAULT);
00205     }
00206     CWinApp* pApp = AfxGetApp();
00207     if (pApp) {
00208          // TBD
00209     }
00210     // TODO: Add your implementation code here
00211     return true;
00212 }
00213
00214 bool CvsProject::hasAdvancedOptionsForCommand(
00215     CvsCommand command,
00216     BOOL& bAdvancedOptions
00217     )
00218 {
00219     // TODO: Add your implementation code here
00220     return true;
00221 }
00222
00223 bool CvsProject::showAdvancedOptionsForCommand(
00224     CvsCommand command
00225     )
00226 {
00227     // TODO: Add your implementation code here
00228     return true;
00229 }
00230
00231 bool CvsProject::getFileChanges(
00232     CvsString& sFilenames
00233     )
00234 {
00235     // TODO: Add your implementation code here
00236     return true;
00237 }
00238
00239 bool CvsProject::getFilesToAdd(
00240     CvsString& sFilenames
00241     )
00242 {
00243     // TODO: Add your implementation code here
00244     return true;
00245 }
Generated on Sun Feb 24 01:21:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CoWorker/CvsProject.h Source File

WinCvs/CoWorker/CvsProject.h

Go to the documentation of this file.
00001 // CvsProject.h: interface for the CvsProject class.
00002 //
00004
00005 #if !defined(AFX_CVSPROJECT_H__582FF611_FAA5_11D2_B442_0080C6F9179D__INCLUDED_)
00006 #define AFX_CVSPROJECT_H__582FF611_FAA5_11D2_B442_0080C6F9179D__INCLUDED_
00007
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011
00012 #include "CvsString.h"
00013 #include "CvsFilenames.h"
00014 //#include "CVS_Coworker.h"
00015
00016 //
00017 //  Context for a Project.
00018 //
00019
00020 class CvsProject
00021 {
00022 public:
00023     CvsProject();
00024     ~CvsProject();
00025 public:
00026     int getProjectHandle() { return m_hProject; }
00027     int getLastError() { return m_iLastError; }
00028     const char* getProjectName() { return m_sProjectName; }
00029     const char* getProjectHome() { return m_sProjectHome; }
00030 public:
00031     static CvsProject* FindProject(int);
00032 public:
00033     bool getErrorMessage(int,CvsString&);
00034 public:
00035     bool getFilesToAdd(CvsString&);
00036     bool getFileChanges(CvsString&);
00037     bool showAdvancedOptionsForCommand(CvsCommand);
00038     bool hasAdvancedOptionsForCommand(CvsCommand,BOOL&);
00039     bool showUserInterface(CvsFilenames&);
00040     bool showFileProperties(const char*);
00041     bool showFileHistory(CvsFilenames&);
00042     bool isFileDifferent(const char*,CvsOption,BOOL&);
00043     bool diffFile(const char*,BOOL,BOOL);
00044     bool renameFile(const char*,const char*);
00045     bool removeFiles(CvsFilenames&);
00046     bool addFiles(CvsFilenames&,const char*);
00047     bool uncheckoutFiles(CvsFilenames&);
00048     bool checkinFiles(CvsFilenames&,BOOL);
00049     bool checkoutFiles(CvsFilenames&);
00050     bool updateFiles(CvsFilenames&,BOOL,BOOL);
00051     bool getProject(const char*,const char*,const char*,BOOL,BOOL,BOOL&);
00052     bool openProject(const char*,const char*,const char*);
00053     bool closeProject();
00054 protected:
00055     CvsProject*     m_pNextProject;
00056     int             m_hProject;
00057     int             m_iLastError;
00058     CvsString       m_sProjectName;
00059     CvsString       m_sProjectHome;
00060     CvsString       m_sUsername;
00061 };
00062
00063 #endif // !defined(AFX_CVSPROJECT_H__582FF611_FAA5_11D2_B442_0080C6F9179D__INCLUDED_)
Generated on Sun Feb 24 01:21:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CoWorker/CvsString.cpp Source File

WinCvs/CoWorker/CvsString.cpp

Go to the documentation of this file.
00001 #include "stdafx.h"
00002 #include "CvsTrace.h"
00003 #include "CvsString.h"
00004
00005 //
00006 //  Keep a list of 256 byte buffers to recycle.
00007 //
00008
00009 enum {
00010     cbQuanta    = 256,
00011     cBOB        = 0xA5,
00012     cEOB        = 0xA6
00013 };
00014
00015 static char* g_pListOfFreeBuffers;
00016
00017 //
00018 //
00019 //
00020
00021 inline static void CheckBuffer(const char* pBuffer,int cbBuffer = cbQuanta)
00022 {
00023     ASSERT(pBuffer);
00024     ASSERT(cBOB == (255&*(pBuffer-1)));
00025     ASSERT(cEOB == (255&*(pBuffer+cbBuffer)));
00026 }
00027
00028 //
00029 //
00030 //
00031
00032 void CvsString::recycle(char* p,int cb)
00033 {
00034     CheckBuffer(p,cb);
00035     --p;
00036     if (cbQuanta == cb) {
00037         *(char**)p = g_pListOfFreeBuffers;
00038         g_pListOfFreeBuffers = p;
00039         qTRACE(("* recycle %08lx (%d bytes)",(int)p,cb));
00040     } else {
00041         delete p;
00042         qTRACE(("* recycle %08lx (%d bytes) DELETE",(int)p,cb));
00043     }
00044 }
00045
00046 //
00047 //
00048 //
00049
00050 CvsString::~CvsString()
00051 {
00052     if (m_sBuffer) {
00053         char* p = m_sBuffer;
00054         m_sBuffer = 0;
00055         recycle(p,m_cbBufferMax);
00056     }
00057 }
00058
00059 //
00060 //  Upsize the string buffer to at least the given size.
00061 //
00062
00063 void CvsString::resize(int cbNew)
00064 {
00065     char* sOld      = m_sBuffer;
00066     int cbOld       = m_cbBufferMax;
00067
00068     // upsize to 256 byte quanta
00069     cbNew = (cbNew+255)&~255;
00070
00071     char* pNew = g_pListOfFreeBuffers;
00072     if ((cbQuanta == cbNew) && pNew) {
00073         qTRACE(("* resize %08lx (%d bytes) RECYCLED",(int)pNew,cbNew));
00074         g_pListOfFreeBuffers = *(char**)pNew;
00075         *pNew++         = (char)cBOB;
00076     } else {
00077         pNew = new char[cbNew+2];
00078         qTRACE(("* resize %08lx (%d bytes) NEW",(int)pNew,cbNew));
00079         *pNew++         = (char)cBOB;
00080         *(pNew+cbNew)   = (char)cEOB;
00081     }
00082     memset(pNew,0,cbNew);
00083     CheckBuffer(pNew,cbNew);
00084
00085     m_cbBufferMax   = cbNew;
00086     m_sBuffer       = pNew;
00087
00088     if (sOld) {
00089         ASSERT(cbOld <= cbNew);
00090         memcpy(m_sBuffer,sOld,cbOld);
00091         recycle(sOld,cbOld);
00092     }
00093 }
Generated on Sun Feb 24 01:21:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CoWorker/CvsString.h Source File

WinCvs/CoWorker/CvsString.h

Go to the documentation of this file.
00001 #ifndef _CVSSTRING_H_
00002 #define _CVSSTRING_H_
00003
00004 //
00005 //  Thin wrapper around a char* string.
00006 //  Allocates exactly as much space as is needed.
00007 //
00008
00009 class CvsString
00010 {
00011 public:
00012     void requireSize(int);
00013 protected:
00014     void resize(int);
00015     static void recycle(char*,int);
00016 public:
00017     int strlen() const { return ::strlen(m_sBuffer); }
00018     void strcpy(const char*);
00019     void strncpy(const char*,int);
00020     void strcat(const char*);
00021 public:
00022     // Assignable access to characters within the string.
00023     // An index outside the string returns a reference to a junk character.
00024     char& operator[] (int i) {
00025         if ((i < 0) || ((int)strlen() <= i)) { static char c; return c; }
00026         return m_sBuffer[i];
00027     }
00028 public:
00029     CvsString& operator = (const char* s) { strcpy(s); return *this; }
00030     CvsString& operator = (const CvsString& s) { strcpy(s); return *this; }
00031     CvsString& operator += (const char* s) { strcat(s); return *this; }
00032     CvsString operator + (const char* s) const { CvsString v(m_sBuffer); v.strcat(s); return v; }
00033 public:
00034     int operator == (const char* s) const { return 0 == strcmp(m_sBuffer,s); }
00035 public:
00036     operator const char*() const { return m_sBuffer; }
00037 public:
00038     int   getBufferMax() const { return m_cbBufferMax; }
00039     char* getBuffer()    { return m_sBuffer; }
00040 public:
00041     CvsString() : m_sBuffer(0), m_cbBufferMax(0) { strcpy(""); }
00042     CvsString(const char* s) : m_sBuffer(0), m_cbBufferMax(0) { strcpy(s); }
00043     CvsString(const CvsString& s) : m_sBuffer(0), m_cbBufferMax(0) { strcpy(s); }
00044     ~CvsString();
00045 protected:
00046     char* m_sBuffer;
00047     int   m_cbBufferMax;
00048 };
00049
00050 //
00051 //  Upsize the string buffer to at least the given size.
00052 //
00053
00054 inline void CvsString::requireSize(int cbNew)
00055 {
00056     if (m_cbBufferMax < cbNew) {
00057         resize(cbNew);
00058     }
00059 }
00060
00061 //
00062 //  Copy the given string into this string.
00063 //
00064
00065 inline void CvsString::strcpy(const char* s)
00066 {
00067     requireSize(::strlen(s)+1);
00068     ::strcpy(m_sBuffer,s);
00069 }
00070
00071 //
00072 //  Copy the given string into this string.
00073 //
00074
00075 inline void CvsString::strncpy(const char* s,int n)
00076 {
00077     requireSize(n+1);
00078     ::strncpy(m_sBuffer,s,n);
00079     m_sBuffer[n] = 0;
00080 }
00081
00082 //
00083 //  Concatenate the given string onto this string.
00084 //
00085
00086 inline void CvsString::strcat(const char* s)
00087 {
00088     requireSize(strlen()+::strlen(s)+1);
00089     ::strcat(m_sBuffer,s);
00090 }
00091
00092 #endif
Generated on Sun Feb 24 01:21:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CoWorker/CvsTrace.cpp Source File

WinCvs/CoWorker/CvsTrace.cpp

Go to the documentation of this file.
00001 #include "stdafx.h"
00002 #include "CvsTrace.h"
00003 #include "AppConsole.h"
00004 #include <time.h>
00005
00006 #ifdef _DEBUG
00007 #define new DEBUG_NEW
00008 #undef THIS_FILE
00009 static char THIS_FILE[] = __FILE__;
00010 #endif
00011
00012 //
00013 //
00014 //
00015
00016 static const char* g_sFilter = "*<>Aa";
00017 static BOOL g_bLogUnbuffered = FALSE;
00018
00019 void LogSetFilter(const char* s)
00020 {
00021     g_sFilter = strdup(s);
00022 }
00023
00024 static inline int InFilter(char c) {
00025     return 0 != strchr(g_sFilter,c);
00026 }
00027
00028 //
00029 //  Important!
00030 //
00031 //  If using for a Win16 DLL, the log file cannot be owned by the DLL.
00032 //
00033
00034 static HANDLE g_hLogFile = INVALID_HANDLE_VALUE;
00035
00036 #define IS_LOGGING() \
00037     (true)
00038
00039 //
00040 //
00041 //
00042
00043 static inline char* AddPrefix(char* p)
00044 {
00045     // add line break
00046     *p++ = '\n';
00047     return p;
00048 }
00049
00050 //
00051 //  Log file support
00052 //
00053
00054 static void LogWrite(const char* s)
00055 {
00056     // skip if not logging
00057     if (IS_LOGGING()) {
00058         cvs_outstr(s,strlen(s));
00059     }
00060 }
00061
00062 //
00063 //
00064 //
00065
00066 void LogInitialize(LPCSTR sFileName)
00067 {
00068     if ('!' == *sFileName) {
00069         g_bLogUnbuffered = TRUE;
00070         ++sFileName;
00071     }
00072     time_t t = time(0);
00073     LogWrite(ctime(&t));
00074 }
00075
00076 void LogCleanup(void)
00077 {
00078 }
00079
00080 //
00081 //
00082 //
00083
00084 static unsigned g_nLevel = 0;
00085
00086 static inline char* AddIndent(char* p)
00087 {
00088     for (int n = 31 & g_nLevel; 0<n; --n) {
00089         *p++ = ' ';
00090         *p++ = ' ';
00091     }
00092     return p;
00093 }
00094
00095 void LogString(const char* s,const char* sValue)
00096 {
00097     // skip if not logging
00098     if (!IS_LOGGING()) {
00099         return;
00100     }
00101     if (256 < strlen(sValue)) {
00102         LogBuffer(s,sValue,strlen(sValue));
00103         return;
00104     }
00105     // omit if not in filter
00106     if (!InFilter(*s++)) {
00107         return;
00108     }
00109     char sBuffer[1000];
00110     char* p = AddPrefix(sBuffer);
00111         // insert leading spaces as required
00112     if (' ' == *s) { ++s; p = AddIndent(p); }
00113     // format the arguments
00114     wsprintf(p,"%s : \"%s\"",s,sValue);
00115     ASSERT(strlen((const char*)sBuffer)<sizeof(sBuffer));
00116     // drop into log file
00117     LogWrite(sBuffer);
00118 }
00119
00120 void __cdecl Log_printf(const char* s,...)
00121 {
00122     // skip if not logging
00123     if (!IS_LOGGING()) {
00124         return;
00125     }
00126     // omit if not in filter
00127     if (!InFilter(*s++)) {
00128         return;
00129     }
00130     char sBuffer[1000];
00131     char* p = AddPrefix(sBuffer);
00132         // insert leading spaces as required
00133     if (' ' == *s) { ++s; p = AddIndent(p); }
00134     // format the arguments
00135     va_list a;
00136     va_start(a,s);
00137     wvsprintf(p,s,a);
00138     va_end(a);
00139     ASSERT(strlen((const char*)sBuffer)<sizeof(sBuffer));
00140     // drop into log file
00141     LogWrite(sBuffer);
00142 }
00143
00144 static const char sHex[] = "0123456789ABCDEF";
00145
00146 void LogBuffer(const char* sName,const char* sBuffer,unsigned cbBuffer)
00147 {
00148     // skip if not logging
00149     if (!IS_LOGGING()) {
00150         return;
00151     }
00152     // omit if not in filter
00153     if (!InFilter(*sName++)) {
00154         return;
00155     }
00156     // mark start of buffer
00157     Log_printf("*[BUFFER %s (%u bytes)]",sName,cbBuffer);
00158     // dump contents of buffer
00159     for (unsigned i=0; i<cbBuffer;) {
00160         char sLine[256];
00161         char* s1 = sLine;
00162         wsprintf(s1,"\n%05x:",i);
00163         s1 += strlen(s1);
00164         memset(s1,' ',50);
00165         char* s2 = s1 + 50;
00166         while (i<cbBuffer) {
00167             unsigned b = *(unsigned char*)(sBuffer+i);
00168             ++s1;
00169             *s1++ = sHex[15&(b>>4)];
00170             *s1++ = sHex[15&b];
00171             *s2++ = (char)(((31<b) && (b<127)) ? b : '.');
00172             ++i;
00173             if (!(15&i)) break;
00174         }
00175         *s2 = 0;
00176         LogWrite(sLine);
00177     }
00178     // mark end of buffer
00179     Log_printf("*[END BUFFER %s]",sName);
00180 }
00181
00182 //
00183 //
00184 //
00185
00186 static const char* g_sCurrent = "(BASE)";
00187
00188 CvsTrace::CvsTrace(const char* s)
00189 :   m_sOuter(0)
00190 {
00191     // skip if not logging
00192     if (!IS_LOGGING()) {
00193         return;
00194     }
00195     Log_printf("> > %s",s);
00196     {
00197         m_sOuter = g_sCurrent;
00198         g_sCurrent = s;
00199         ++g_nLevel;
00200     }
00201 }
00202
00203 CvsTrace::~CvsTrace()
00204 {
00205     // skip if not logging
00206     if (!IS_LOGGING()) {
00207         return;
00208     }
00209     const char* s;
00210     {
00211         --g_nLevel;
00212         s = g_sCurrent;
00213         g_sCurrent = m_sOuter;
00214     }
00215     Log_printf("< < %s",s);
00216 }
Generated on Sun Feb 24 01:21:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CoWorker/CvsTrace.h Source File

WinCvs/CoWorker/CvsTrace.h

Go to the documentation of this file.
00001 //
00002 //  Trace log and assertions.
00003 //
00004
00005 #ifndef _TRACE_H_
00006 #define _TRACE_H_
00007
00008 //
00009 //  for trace/logging
00010 //
00011
00012 #ifdef __cplusplus
00013 extern "C" {
00014 #endif
00015
00016 void LogSetFilter(const char*);
00017 void LogInitialize(LPCSTR);
00018 void LogCleanup(void);
00019 void LogAttach(HFILE,LPCSTR);
00020 void LogBuffer(const char*,const char*,unsigned);
00021
00022 void __cdecl Log_printf(const char*,...);
00023 void LogString(const char*,const char*);
00024
00025 #ifdef __cplusplus
00026 };
00027 #endif
00028
00029 #ifdef __cplusplus
00030
00031 class CvsTrace {
00032 public:
00033     CvsTrace(const char*);
00034     ~CvsTrace();
00035 private:
00036     const char* m_sOuter;
00037 };
00038
00039 #endif
00040
00041 //
00042 //  Logging calls always compiled into release.
00043 //
00044
00045 #define LOG_API_FN(FN) \
00046 CvsTrace _fn_(#FN)
00047
00048 #define LOG_API_S(S) \
00049 if (S) { LogString("A " #S,(const char*)(S)); }
00050
00051 #define LOG_API_X(X) \
00052 /*if (X)*/ { Log_printf("A " #X " : 0x%lx",(long)(X)); }
00053
00054 #define LOG_API_N(N) \
00055 /*if (N)*/ { Log_printf("A " #N " : %lu",(long)(N)); }
00056
00057 //
00058 //  Trace calls only compiled into DEBUG version.
00059 //
00060
00061 #ifdef NDEBUG
00062 #define qTRACE_FN(FN)
00063 #define qTRACE(L)
00064 #define LOG_BUFFER(A,B,N)
00065 #else
00066 #define qTRACE_FN(FN)       CvsTrace _fn_(#FN)
00067 #define qTRACE(L)           Log_printf L
00068 #define LOG_BUFFER(A,B,N)   LogBuffer(A,B,N)
00069 #endif
00070
00071 #define qTRACE_S(S) \
00072 if (S) { qTRACE(("a " #S " : \"%s\"",(S))); }
00073
00074 #define qTRACE_X(X) \
00075 /*if (X)*/ { qTRACE(("a " #X " : 0x%lx",(long)(X))); }
00076
00077 #define qTRACE_N(N) \
00078 /*if (N)*/ { qTRACE(("a " #N " : %lu",(long)(N))); }
00079
00080 //
00081 //  for debugging
00082 //
00083
00084 #undef ASSERT
00085 #undef VERIFY
00086
00087 #ifdef NDEBUG
00088 #define ASSERT(X)
00089 #define VERIFY(X)   (X)
00090 #else
00091 #define ASSERT(X)   if (!(X)) { __Assert(__FILE__,__LINE__,#X); DebugBreak(); } else 0
00092 #define VERIFY(X)   if (!(X)) { __Assert(__FILE__,__LINE__,#X); DebugBreak(); } else 0
00093
00094 #ifdef _M_IX86
00095 #define DebugBreak()    __asm { int 3 }
00096 #endif
00097
00098 static void __Assert(const char* sFile,unsigned iLine,const char* sExpression)
00099 {
00100     Log_printf("*%s:%u ASSERT FAILED: %s",sFile,iLine,sExpression);
00101 }
00102 #endif
00103
00104 #endif
Generated on Sun Feb 24 01:21:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsCoworker.cpp File Reference

WinCvs/CoWorker/CvsCoworker.cpp File Reference

#include "stdafx.h"
#include "CVS_Coworker_i.h"
#include "CvsTrace.h"
#include "CvsCoworkerErrors.h"
#include "CvsCoworker.h"
#include "CvsProject.h"
#include "CvsFilenames.h"

Include dependency graph for CvsCoworker.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | CATCH_EXCEPTIONS(FN)
#define | PREAMBLE(H)

Functions

void | CopyString (char *s1, const char *s2, int n)
void | CopyString (unsigned char *s1, const char *s2, int n)

Define Documentation

#define CATCH_EXCEPTIONS ( FN )

Value:

catch (const char* e) { qTRACE(("*EXCEPTION from " #FN "() : %s",e)); } \
catch (...) { qTRACE(("*EXCEPTION from " #FN "()")); } return S_FALSE;

Definition at line 25 of file CvsCoworker.cpp.

Referenced by CvsCoworker::AddFiles, CvsCoworker::CheckinFiles, CvsCoworker::CheckoutFiles, CvsCoworker::CloseProject, CvsCoworker::DiffFile, CvsCoworker::GetFileChanges, CvsCoworker::GetFilesToAdd, CvsCoworker::GetProject, CvsCoworker::HasAdvancedOptionsForCommand, CvsCoworker::OpenProject, CvsCoworker::RemoveFiles, CvsCoworker::RenameFile, CvsCoworker::ShowAdvancedOptionsForCommand, CvsCoworker::ShowFileHistory, CvsCoworker::ShowFileProperties, CvsCoworker::ShowUserInterface, CvsCoworker::UncheckoutFiles, and CvsCoworker::UpdateFiles.

#define PREAMBLE ( H )

Value:

CvsProject* pProject = CvsProject::FindProject(handle); \
ASSERT(pProject); \
if (!pProject) { return CVS_E_FAILED_PROJECT_INVALID; }

Definition at line 193 of file CvsCoworker.cpp.

Referenced by CvsCoworker::AddFiles, CvsCoworker::CheckinFiles, CvsCoworker::CheckoutFiles, CvsCoworker::CloseProject, CvsCoworker::DiffFile, CvsCoworker::GetFileChanges, CvsCoworker::GetFilesToAdd, CvsCoworker::HasAdvancedOptionsForCommand, CvsCoworker::RemoveFiles, CvsCoworker::RenameFile, CvsCoworker::ShowAdvancedOptionsForCommand, CvsCoworker::ShowFileHistory, CvsCoworker::ShowFileProperties, CvsCoworker::ShowUserInterface, CvsCoworker::UncheckoutFiles, and CvsCoworker::UpdateFiles.

Function Documentation

void CopyString | ( | unsigned char * | s1,
 |  | const char * | s2,
 |  | int | n
 | ) | [inline, static]

Definition at line 43 of file CvsCoworker.cpp.

Referenced by CvsCoworker::GetErrorMessage, CvsCoworker::GetFileChanges, CvsCoworker::GetFilesToAdd, and CvsCoworker::GetProject.

00044 {
00045     CopyString((char*)s1,s2,n);
00046 }

void CopyString | ( | char * | s1,
 |  | const char * | s2,
 |  | int | n
 | ) | [inline, static]

Definition at line 34 of file CvsCoworker.cpp.

References ASSERT.

00035 {
00036     ASSERT(s1);
00037     ASSERT(s2);
00038     ASSERT(0<n);
00039     strncpy(s1,s2,n);
00040     s1[n-1] = 0;
00041 }

Generated on Sun Feb 24 01:23:42 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsCoworker.h File Reference

WinCvs/CoWorker/CvsCoworker.h File Reference

#include "resource.h"

Include dependency graph for CvsCoworker.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CvsCoworker

Generated on Sun Feb 24 01:23:42 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsCoworkerErrors.h File Reference

WinCvs/CoWorker/CvsCoworkerErrors.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define | CVS_E_FAILED_OPEN_PROJECT MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,100)
#define | CVS_E_FAILED_OPEN_DISALLOWED MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,101)
#define | CVS_E_FAILED_OPEN_INVALID_USER MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,102)
#define | CVS_E_FAILED_OPEN_CREATE MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,103)
#define | CVS_E_FAILED_OPEN_BAD_PATH MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,104)
#define | CVS_E_FAILED_CLOSE_PROJECT MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,200)
#define | CVS_E_FAILED_UPDATE_FILES MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,300)
#define | CVS_E_FAILED_UPDATE_DISALLOWED MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,301)
#define | CVS_E_FAILED_UPDATE_NOT_IN_CVS MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,302)
#define | CVS_E_FAILED_CHECKOUT_FILES MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,400)
#define | CVS_E_FAILED_CHECKOUT_DISALLOWED MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,401)
#define | CVS_E_FAILED_CHECKOUT_NOT_IN_CVS MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,402)
#define | CVS_E_FAILED_CHECKIN_FILES MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,500)
#define | CVS_E_FAILED_CHECKIN_DISALLOWED MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,501)
#define | CVS_E_FAILED_CHECKIN_NOT_IN_CVS MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,502)
#define | CVS_E_FAILED_CHECKIN_NEED_UPDATE MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,503)
#define | CVS_E_FAILED_PROJECT_INVALID MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,9900)
#define | CVS_E_FAILED MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,9901)

Define Documentation

#define CVS_E_FAILED MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,9901)

Definition at line 37 of file CvsCoworkerErrors.h.

Referenced by CvsCoworker::AddFiles, CvsCoworker::CheckinFiles, CvsCoworker::CheckoutFiles, CvsCoworker::DiffFile, CvsCoworker::GetFileChanges, CvsCoworker::GetFilesToAdd, CvsCoworker::HasAdvancedOptionsForCommand, CvsCoworker::RemoveFiles, CvsCoworker::RenameFile, CvsCoworker::ShowAdvancedOptionsForCommand, CvsCoworker::ShowFileHistory, CvsCoworker::ShowFileProperties, CvsCoworker::ShowUserInterface, CvsCoworker::UncheckoutFiles, and CvsCoworker::UpdateFiles.

#define CVS_E_FAILED_CHECKIN_DISALLOWED MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,501)

Definition at line 31 of file CvsCoworkerErrors.h.

#define CVS_E_FAILED_CHECKIN_FILES MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,500)

Definition at line 30 of file CvsCoworkerErrors.h.

#define CVS_E_FAILED_CHECKIN_NEED_UPDATE MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,503)

Definition at line 33 of file CvsCoworkerErrors.h.

#define CVS_E_FAILED_CHECKIN_NOT_IN_CVS MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,502)

Definition at line 32 of file CvsCoworkerErrors.h.

#define CVS_E_FAILED_CHECKOUT_DISALLOWED MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,401)

Definition at line 26 of file CvsCoworkerErrors.h.

#define CVS_E_FAILED_CHECKOUT_FILES MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,400)

Definition at line 25 of file CvsCoworkerErrors.h.

#define CVS_E_FAILED_CHECKOUT_NOT_IN_CVS MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,402)

Definition at line 27 of file CvsCoworkerErrors.h.

#define CVS_E_FAILED_CLOSE_PROJECT MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,200)

Definition at line 17 of file CvsCoworkerErrors.h.

Referenced by CvsCoworker::CloseProject.

#define CVS_E_FAILED_OPEN_BAD_PATH MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,104)

Definition at line 14 of file CvsCoworkerErrors.h.

#define CVS_E_FAILED_OPEN_CREATE MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,103)

Definition at line 13 of file CvsCoworkerErrors.h.

#define CVS_E_FAILED_OPEN_DISALLOWED MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,101)

Definition at line 11 of file CvsCoworkerErrors.h.

#define CVS_E_FAILED_OPEN_INVALID_USER MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,102)

Definition at line 12 of file CvsCoworkerErrors.h.

#define CVS_E_FAILED_OPEN_PROJECT MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,100)

Definition at line 10 of file CvsCoworkerErrors.h.

Referenced by CvsCoworker::GetProject, and CvsCoworker::OpenProject.

#define CVS_E_FAILED_PROJECT_INVALID MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,9900)

Definition at line 36 of file CvsCoworkerErrors.h.

Referenced by CvsCoworker::GetErrorMessage, and CvsCoworker::GetLastError.

#define CVS_E_FAILED_UPDATE_DISALLOWED MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,301)

Definition at line 21 of file CvsCoworkerErrors.h.

#define CVS_E_FAILED_UPDATE_FILES MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,300)

Definition at line 20 of file CvsCoworkerErrors.h.

#define CVS_E_FAILED_UPDATE_NOT_IN_CVS MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,302)

Definition at line 22 of file CvsCoworkerErrors.h.

Generated on Sun Feb 24 01:23:42 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsFilenames.cpp File Reference

WinCvs/CoWorker/CvsFilenames.cpp File Reference

#include "stdafx.h"
#include "CvsTrace.h"
#include "CvsFilenames.h"

Include dependency graph for CvsFilenames.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Sun Feb 24 01:23:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsFilenames.h File Reference

WinCvs/CoWorker/CvsFilenames.h File Reference

#include "CvsString.h"

Include dependency graph for CvsFilenames.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CvsFilenames

Defines

#define | AFX_CVSFILENAMES_H__582FF616_FAA5_11D2_B442_0080C6F9179D__INCLUDED_

Define Documentation

#define AFX_CVSFILENAMES_H__582FF616_FAA5_11D2_B442_0080C6F9179D__INCLUDED_

Definition at line 6 of file CvsFilenames.h.

Generated on Sun Feb 24 01:23:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsProject.cpp File Reference

WinCvs/CoWorker/CvsProject.cpp File Reference

#include "stdafx.h"
#include "CVS_Coworker_i.h"
#include "CvsTrace.h"
#include "CvsProject.h"

Include dependency graph for CvsProject.cpp:

Include dependency graph

Go to the source code of this file.

Variables

int g_hNextProject = 1000
CvsProject * g_pProjects

Variable Documentation

int g_hNextProject = 1000 [static]

Definition at line 11 of file CvsProject.cpp.

Referenced by CvsProject::CvsProject.

CvsProject* g_pProjects [static]

Definition at line 14 of file CvsProject.cpp.

Generated on Sun Feb 24 01:23:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsProject.h File Reference

WinCvs/CoWorker/CvsProject.h File Reference

#include "CvsString.h"
#include "CvsFilenames.h"

Include dependency graph for CvsProject.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CvsProject

Defines

#define | AFX_CVSPROJECT_H__582FF611_FAA5_11D2_B442_0080C6F9179D__INCLUDED_

Define Documentation

#define AFX_CVSPROJECT_H__582FF611_FAA5_11D2_B442_0080C6F9179D__INCLUDED_

Definition at line 6 of file CvsProject.h.

Generated on Sun Feb 24 01:23:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsString.cpp File Reference

WinCvs/CoWorker/CvsString.cpp File Reference

#include "stdafx.h"
#include "CvsTrace.h"
#include "CvsString.h"

Include dependency graph for CvsString.cpp:

Include dependency graph

Go to the source code of this file.

Enumerations

enum {
cbQuanta = 256,
cBOB = 0xA5,
cEOB = 0xA6
}

Functions

void | CheckBuffer (const char *pBuffer, int cbBuffer=cbQuanta)

Variables

char * | g_pListOfFreeBuffers

Enumeration Type Documentation

anonymous enum

Enumeration values:
cbQuanta
cBOB
cEOB

Definition at line 9 of file CvsString.cpp.

00009      {
00010     cbQuanta    = 256,
00011     cBOB        = 0xA5,
00012     cEOB        = 0xA6
00013 };

Function Documentation

void CheckBuffer | ( | const char * | pBuffer,
 |  | int | cbBuffer = cbQuanta
 | ) | [inline, static]

Definition at line 21 of file CvsString.cpp.

References ASSERT, cBOB, cbQuanta, and cEOB.

Referenced by CvsString::recycle, and CvsString::resize.

00022 {
00023     ASSERT(pBuffer);
00024     ASSERT(cBOB == (255&*(pBuffer-1)));
00025     ASSERT(cEOB == (255&*(pBuffer+cbBuffer)));
00026 }

Variable Documentation

char* g_pListOfFreeBuffers [static]

Definition at line 15 of file CvsString.cpp.

Referenced by CvsString::recycle, and CvsString::resize.

Generated on Sun Feb 24 01:23:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsString.h File Reference

WinCvs/CoWorker/CvsString.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class CvsString

Generated on Sun Feb 24 01:23:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsTrace.cpp File Reference

WinCvs/CoWorker/CvsTrace.cpp File Reference

#include "stdafx.h"
#include "CvsTrace.h"
#include "AppConsole.h"
#include <time.h>

Include dependency graph for CvsTrace.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | IS_LOGGING() (true)

Functions

void | LogSetFilter (const char *s)
int | InFilter (char c)
char * | AddPrefix (char *p)
void | LogWrite (const char *s)
void | LogInitialize (LPCSTR sFileName)
void | LogCleanup (void)
char * | AddIndent (char *p)
void | LogString (const char *s, const char *sValue)
void __cdecl | Log_printf (const char *s,...)
void | LogBuffer (const char *sName, const char *sBuffer, unsigned cbBuffer)

Variables

const char * | g_sFilter = "*<>Aa"
BOOL | g_bLogUnbuffered = FALSE
HANDLE | g_hLogFile = INVALID_HANDLE_VALUE
unsigned | g_nLevel = 0
const char | sHex [] = "0123456789ABCDEF"
const char * | g_sCurrent = "(BASE)"

Define Documentation

#define IS_LOGGING ( ) (true)

Definition at line 36 of file CvsTrace.cpp.

Referenced by CvsTrace::CvsTrace, Log_printf, LogBuffer, LogString, LogWrite, and CvsTrace::~CvsTrace.

Function Documentation

char* AddIndent ( char * p ) [inline, static]

Definition at line 86 of file CvsTrace.cpp.

References g_nLevel.

Referenced by Log_printf, and LogString.

00087 {
00088     for (int n = 31 & g_nLevel; 0<n; --n) {
00089         *p++ = ' ';
00090         *p++ = ' ';
00091     }
00092     return p;
00093 }

char* AddPrefix ( char * p ) [inline, static]

Definition at line 43 of file CvsTrace.cpp.

Referenced by Log_printf, and LogString.

00044 {
00045     // add line break
00046     *p++ = '\n';
00047     return p;
00048 }

int InFilter ( char c ) [inline, static]

Definition at line 24 of file CvsTrace.cpp.

References g_sFilter.

Referenced by Log_printf, LogBuffer, and LogString.

00024                                    {
00025     return 0 != strchr(g_sFilter,c);
00026 }

void __cdecl Log_printf | ( | const char * | s,
 |  | ... |
 | ) |

Definition at line 120 of file CvsTrace.cpp.

References AddIndent, AddPrefix, ASSERT, InFilter, IS_LOGGING, and LogWrite.

00121 {
00122     // skip if not logging
00123     if (!IS_LOGGING()) {
00124         return;
00125     }
00126     // omit if not in filter
00127     if (!InFilter(*s++)) {
00128         return;
00129     }
00130     char sBuffer[1000];
00131     char* p = AddPrefix(sBuffer);
00132         // insert leading spaces as required
00133     if (' ' == *s) { ++s; p = AddIndent(p); }
00134     // format the arguments
00135     va_list a;
00136     va_start(a,s);
00137     wvsprintf(p,s,a);
00138     va_end(a);
00139     ASSERT(strlen((const char*)sBuffer)<sizeof(sBuffer));
00140     // drop into log file
00141     LogWrite(sBuffer);
00142 }

void LogBuffer | ( | const char * | sName,
 |  | const char * | sBuffer,
 |  | unsigned | cbBuffer
 | ) |

Definition at line 146 of file CvsTrace.cpp.

References InFilter, IS_LOGGING, Log_printf, LogWrite, and sHex.

00147 {
00148     // skip if not logging
00149     if (!IS_LOGGING()) {
00150         return;
00151     }
00152     // omit if not in filter
00153     if (!InFilter(*sName++)) {
00154         return;
00155     }
00156     // mark start of buffer
00157     Log_printf("*[BUFFER %s (%u bytes)]",sName,cbBuffer);
00158     // dump contents of buffer
00159     for (unsigned i=0; i<cbBuffer;) {
00160         char sLine[256];
00161         char* s1 = sLine;
00162         wsprintf(s1,"\n%05x:",i);
00163         s1 += strlen(s1);
00164         memset(s1,' ',50);
00165         char* s2 = s1 + 50;
00166         while (i<cbBuffer) {
00167             unsigned b = *(unsigned char*)(sBuffer+i);
00168             ++s1;
00169             *s1++ = sHex[15&(b>>4)];
00170             *s1++ = sHex[15&b];
00171             *s2++ = (char)(((31<b) && (b<127)) ? b : '.');
00172             ++i;
00173             if (!(15&i)) break;
00174         }
00175         *s2 = 0;
00176         LogWrite(sLine);
00177     }
00178     // mark end of buffer
00179     Log_printf("*[END BUFFER %s]",sName);
00180 }

void LogCleanup ( void )

Definition at line 76 of file CvsTrace.cpp.

Referenced by CWincvsApp::ExitInstance.

00077 {
00078 }

void LogInitialize ( LPCSTR sFileName )

Definition at line 66 of file CvsTrace.cpp.

References g_bLogUnbuffered, LogWrite, and TRUE.

00067 {
00068     if ('!' == *sFileName) {
00069         g_bLogUnbuffered = TRUE;
00070         ++sFileName;
00071     }
00072     time_t t = time(0);
00073     LogWrite(ctime(&t));
00074 }

void LogSetFilter ( const char * s )

Definition at line 19 of file CvsTrace.cpp.

References g_sFilter, and strdup.

00020 {
00021     g_sFilter = strdup(s);
00022 }

void LogString | ( | const char * | s,
 |  | const char * | sValue
 | ) |

Definition at line 95 of file CvsTrace.cpp.

References AddIndent, AddPrefix, ASSERT, InFilter, IS_LOGGING, LogBuffer, and LogWrite.

00096 {
00097     // skip if not logging
00098     if (!IS_LOGGING()) {
00099         return;
00100     }
00101     if (256 < strlen(sValue)) {
00102         LogBuffer(s,sValue,strlen(sValue));
00103         return;
00104     }
00105     // omit if not in filter
00106     if (!InFilter(*s++)) {
00107         return;
00108     }
00109     char sBuffer[1000];
00110     char* p = AddPrefix(sBuffer);
00111         // insert leading spaces as required
00112     if (' ' == *s) { ++s; p = AddIndent(p); }
00113     // format the arguments
00114     wsprintf(p,"%s : \"%s\"",s,sValue);
00115     ASSERT(strlen((const char*)sBuffer)<sizeof(sBuffer));
00116     // drop into log file
00117     LogWrite(sBuffer);
00118 }

void LogWrite ( const char * s ) [static]

Definition at line 54 of file CvsTrace.cpp.

References cvs_outstr, and IS_LOGGING.

Referenced by Log_printf, LogBuffer, LogInitialize, and LogString.

00055 {
00056     // skip if not logging
00057     if (IS_LOGGING()) {
00058         cvs_outstr(s,strlen(s));
00059     }
00060 }

Variable Documentation

BOOL g_bLogUnbuffered = FALSE [static]

Definition at line 17 of file CvsTrace.cpp.

Referenced by LogInitialize.

HANDLE g_hLogFile = INVALID_HANDLE_VALUE [static]

Definition at line 34 of file CvsTrace.cpp.

unsigned g_nLevel = 0 [static]

Definition at line 84 of file CvsTrace.cpp.

Referenced by AddIndent, CvsTrace::CvsTrace, and CvsTrace::~CvsTrace.

const char* g_sCurrent = "(BASE)" [static]

Definition at line 186 of file CvsTrace.cpp.

Referenced by CvsTrace::CvsTrace, and CvsTrace::~CvsTrace.

const char* g_sFilter = "*<>Aa" [static]

Definition at line 16 of file CvsTrace.cpp.

Referenced by InFilter, and LogSetFilter.

const char sHex[] = "0123456789ABCDEF" [static]

Definition at line 144 of file CvsTrace.cpp.

Referenced by LogBuffer.

Generated on Sun Feb 24 01:23:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsTrace.h File Reference

WinCvs/CoWorker/CvsTrace.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class | CvsTrace

Defines

#define | LOG_API_FN(FN) CvsTrace _fn_(#FN)
#define | LOG_API_S(S) if (S) { LogString("A " #S,(const char*)(S)); }
#define | LOG_API_X(X) { Log_printf("A " #X " : 0x%lx",(long)(X)); }
#define | LOG_API_N(N) { Log_printf("A " #N " : %lu",(long)(N)); }
#define | qTRACE_FN(FN) CvsTrace _fn_(#FN)
#define | qTRACE(L) Log_printf L
#define | LOG_BUFFER(A, B, N) LogBuffer(A,B,N)
#define | qTRACE_S(S) if (S) { qTRACE(("a " #S " : \"%s\"",(S))); }
#define | qTRACE_X(X) { qTRACE(("a " #X " : 0x%lx",(long)(X))); }
#define | qTRACE_N(N) { qTRACE(("a " #N " : %lu",(long)(N))); }
#define | ASSERT(X) if (!(X)) { __Assert(__FILE__,__LINE__,#X); DebugBreak(); } else 0
#define | VERIFY(X) if (!(X)) { __Assert(__FILE__,__LINE__,#X); DebugBreak(); } else 0

Functions

void | LogSetFilter (const char *)
void | LogInitialize (LPCSTR)
void | LogCleanup (void)
void | LogAttach (HFILE, LPCSTR)
void | LogBuffer (const char *, const char *, unsigned)
void __cdecl | Log_printf (const char *,...)
void | LogString (const char *, const char *)
void | __Assert (const char *sFile, unsigned iLine, const char *sExpression)

Define Documentation

#define ASSERT ( X ) if (!(X)) { __Assert(__FILE__,__LINE__,#X); DebugBreak(); } else 0

Definition at line 91 of file CvsTrace.h.

Referenced by CCJReBar::_AddBar, _AfxRelease, _CjxChildWindowFromPoint, _GetComCtlVersion, _GetDropDownWidth, _statcore, CSubclassWndMap::Add, CCJToolBar::AddButtons, CCJToolBar::AddDropDownButton, CvsCoworker::AddFiles, CGfxOutBarCtrl::AddFolder, CGfxOutBarCtrl::AddFolderBar, CCJComboBoxEx::AddString, CCJToolBar::AddStrings, CCJTabView::AddView, CGfxOutBarCtrl::AnimateFolderScroll, CCJToolBar::AutoSize, CCJHtmlView::BeforeNavigate2, CCJReBarCtrl::BeginDrag, CCJReBar::CalcDynamicLayout, CCJReBar::CalcFixedLayout, CCJToolBar::CalcLayout, CCJToolBar::CalcSize, CCJDockContext::CanDockDockBar, CGfxOutBarCtrl::CBarFolder::CBarFolder, CGfxOutBarCtrl::CBarItem::CBarItem, CCharFormat::CCharFormat, CCJSortClass::CCJSortClass, CCJToolBar::CCJToolBar, CheckBuffer, CCJToolBar::CheckButton, CvsCoworker::CheckinFiles, CvsCoworker::CheckoutFiles, CCJToolBar::CommandToIndex, CCJSortClass::Compare, CompareTargetDate, CopyString, CCJReBar::Create, CCJColorPopup::Create, CCJCaptionPopupWnd::Create, CCJBrowseButton::Create, CCJToolBar::CreateEx, CCJTabCtrlBar::CreateTabView, CCJHyperLink::CtlColor, CCJToolBar::Customize, CustomizeMenus, CvsFilenames::CvsFilenames, CWndRedrawMngr::CWndRedrawMngr, DDV_CJMinMaxDateTime, DDV_CJMinMaxMonth, DDV_MinChars, DDX_CJColorPicker, DDX_ComboMString, DeferClientPos, CWinCvsBrowser::DeleteAllItems, UCvsFolders::DeleteAllItems, CCJReBarCtrl::DeleteBand, CCJToolBar::DeleteButton, CCJFlatTabCtrl::DeleteItem, CCJComboBoxEx::DeleteItem, CCJTabCtrlBar::DeleteView, CHistComboBoxEx::DelKeyTest, CSmartComboBox::DelKeyTest, CvsCoworker::DiffFile, CCJComboBoxEx::Dir, CCJFlatButton::DisableFlatLook, CCJMenu::DitherBlt, CCJMDIFrameWnd::DockSizeBar, CCJMDIChildWnd::DockSizeBar, CCJFrameWnd::DockSizeBar, CCJDockContext::DockSizeBar, CCJHtmlView::DocumentComplete, CCJReBarCtrl::DragMove, CGfxOutBarCtrl::DrawAnimItem, CCJToolBarBase::DrawBorders, CCJControlBar::DrawGriperCaption, CGfxOutBarCtrl::DrawItem, CCJMetaFileButton::DrawItem, CCJMenu::DrawItem, CCJFlatHeaderCtrl::DrawItem, CCJFlatButton::DrawItem, CCJColorPicker::DrawItem, DrawNode, CCJToolCmdUI::Enable, CCJFlatComboBox::EnableAutoCompletion, CCJToolBar::EnableButton, CCJMDIFrameWnd::EnableDocking, CCJMDIChildWnd::EnableDocking, CCJFrameWnd::EnableDocking, CCJControlBar::EnableDockingOnSizeBar, CCJMDIFrameWnd::EnableDockingSizeBar, CCJMDIChildWnd::EnableDockingSizeBar, CCJFrameWnd::EnableDockingSizeBar, CCJControlBar::EnableFlatLook, CCJControlBar::EnableSaveState, CCJReBarCtrl::EndDrag, TBrowserFill::EnterDirectory, CCJFontCombo::EnumFontProc, CCJHtmlView::ExecWB, CCJComboBoxEx::FindString, CCJPagerCtrl::ForwardMouse, CCJHtmlView::GetAddressBar, CCJToolBarCtrl::GetAnchorHighlight, CCJHtmlView::GetApplication, CCJReBarCtrl::GetBandBorders, CCJReBarCtrl::GetBandCount, CCJReBarCtrl::GetBandInfo, CCJReBarCtrl::GetBarHeight, CCJReBarCtrl::GetBarInfo, CCJToolBar::GetBitmap, CCJToolBar::GetBitmapFlags, CCJReBarCtrl::GetBkColor, CCJPagerCtrl::GetBkColor, CCJPagerCtrl::GetBorder, CCJHtmlView::GetBusy, CCJToolBar::GetButtonCount, CCJToolBarCtrl::GetButtonInfo, CCJToolBar::GetButtonInfo, CCJToolBarCtrl::GetButtonSize, CCJPagerCtrl::GetButtonSize, CCJToolBar::GetButtonSize, CCJPagerCtrl::GetButtonState, CCJToolBar::GetButtonStyle, CCJMonthCalCtrl::GetColor, CCJComboBoxEx::GetComboBoxCtrl, CCJHtmlView::GetContainer, CCJMonthCalCtrl::GetCurSel, GetCustomMenu, CCJToolBarCtrl::GetDisabledImageList, CCJDockContext::GetDockBar, CWincvsApp::GetDocument, CCJReBarCtrl::GetDropTarget, CCJPagerCtrl::GetDropTarget, CCJToolBarCtrl::GetDropTarget, CCJComboBoxEx::GetEditCtrl, CMainFrame::GetEnvMainThread, CvsCoworker::GetErrorMessage, CCJToolBarCtrl::GetExtendedStyle, CCJListView::GetExtendedStyle, CCJListCtrl::GetExtendedStyle, CCJComboBoxEx::GetExtendedStyle, CvsCoworker::GetFileChanges, CvsFilenames::getFilename, CvsCoworker::GetFilesToAdd, CCJMonthCalCtrl::GetFirstDayOfWeek, CGfxOutBarCtrl::GetFolderImageList, CGfxOutBarCtrl::GetFolderRect, CCJHtmlView::GetFullName, CCJHtmlView::GetFullScreen, CCJHtmlView::GetHeight, CCJControlBar::GetHorzSize, CCJToolBarCtrl::GetHotImageList, CCJToolBarCtrl::GetHotItem, CCJToolBar::GetHotItem, CCJHtmlView::GetHtmlDocument, CCJTabCtrlBar::GetImageIndexFromRuntimeClass, CCJToolBarCtrl::GetImageList, CCJToolBar::GetImageList, CCJComboBoxEx::GetImageList, CCJToolBarCtrl::GetInsertMark, CCJToolBarCtrl::GetInsertMarkColor, CCJComboBoxEx::GetItem, CGfxOutBarCtrl::GetItemCount, CGfxOutBarCtrl::GetItemData, CCJToolBar::GetItemID, CGfxOutBarCtrl::GetItemImage, CCJToolBar::GetItemRect, CGfxOutBarCtrl::GetItemSize, CGfxOutBarCtrl::GetItemText, CvsCoworker::GetLastError, CCJHtmlView::GetLeft, CCJHtmlView::GetLocationName, CCJHtmlView::GetLocationURL, CCJMonthCalCtrl::GetMaxSelCount, CCJToolBarCtrl::GetMaxSize, CCJToolBarCtrl::GetMaxTextRows, CCJHtmlView::GetMenuBar, GetMenuEntry, CCJFlatHeaderCtrl::GetMenuID, CCJControlBar::GetMenuID, CCJMonthCalCtrl::GetMinReqRect, CCJDateTimeCtrl::GetMonthCalColor, CCJDateTimeCtrl::GetMonthCalCtrl, CCJDateTimeCtrl::GetMonthCalFont, CCJMonthCalCtrl::GetMonthDelta, CCJMonthCalCtrl::GetMonthRange, CCJHtmlView::GetOffline, CvsFilenames::getOptionsAndFilename, CCJToolBar::GetPadding, CCJReBarCtrl::GetPalette, CCJHtmlView::GetParentBrowser, CCJPagerCtrl::GetPos, CvsCoworker::GetProject, CCJHtmlView::GetProperty, CCJMonthCalCtrl::GetRange, CCJDateTimeCtrl::GetRange, CCJHtmlView::GetReadyState, CCJToolBar::GetRect, CCJReBarCtrl::GetRect, CCJHtmlView::GetRegisterAsBrowser, CCJHtmlView::GetRegisterAsDropTarget, CCJReBarCtrl::GetRowCount, CCJReBarCtrl::GetRowHeight, CCJToolBar::GetRows, CCJMonthCalCtrl::GetSelRange, CCJHtmlView::GetSilent, CCJToolBar::GetState, CCJHtmlView::GetStatusBar, CCJToolBarCtrl::GetStyle, GetSubCMenu, CCJReBarCtrl::GetTextColor, CCJHtmlView::GetTheaterMode, CCJDateTimeCtrl::GetTime, GetTimeZoneBias, CCJMonthCalCtrl::GetToday, CCJHtmlView::GetToolBar, CCJToolBar::GetToolBarCtrl, CCJToolBar::GetToolbarStyle, CCJTabCtrlBar::GetToolTip, CCJToolBar::GetToolTips, CCJReBarCtrl::GetToolTips, CCJHtmlView::GetTop, CCJHtmlView::GetTopLevelContainer, CCJHtmlView::GetType, CCJControlBar::GetVertSize, CCJTabView::GetView, CCJTabCtrlBar::GetView, CCJTabCtrlBar::GetViewName, CCJHtmlView::GetVisible, CCJHtmlView::GoBack, CCJHtmlView::GoForward, CCJHtmlView::GoHome, CCJHtmlView::GoSearch, CvsCoworker::HasAdvancedOptionsForCommand, CCJComboBoxEx::HasEditChanged, CCJToolBar::HideButton, CCJFlatSplitterWnd::HideColumn, CCJFlatSplitterWnd::HideRow, CCJToolBarCtrl::HitTest, CCJToolBar::HitTest, CCJReBarCtrl::HitTest, CCJMonthCalCtrl::HitTest, CSubclassWnd::HookWindow, HookWndProc, CCJReBarCtrl::IDToIndex, CCJToolBar::Indeterminate, CCJColorPopup::Initialise, CCJMDIFrameWnd::InitializeMenu, CCJFrameWnd::InitializeMenu, CCJReBarCtrl::InsertBand, CCJToolBar::InsertButton, CCJToolBar::InsertControl, CGfxOutBarCtrl::CBarFolder::InsertItem, CGfxOutBarCtrl::InsertItem, CCJFlatTabCtrl::InsertItem, CCJComboBoxEx::InsertItem, CCJToolBarCtrl::InsertMarkHitTest, CCJComboBoxEx::InsertString, CCJControlBar::IsBottomDocked, CCJToolBar::IsButtonChecked, CCJToolBar::IsButtonEnabled, CCJToolBar::IsButtonHidden, CCJToolBarCtrl::IsButtonHighlighted, CCJToolBar::IsButtonIndeterminate, CCJToolBar::IsButtonPressed, IsDST, CCJControlBar::IsFloating, CCJControlBar::IsHorzDocked, CCJControlBar::IsLeftDocked, CCJControlBar::IsRightDocked, CCJControlBar::IsTopDocked, CGfxOutBarCtrl::IsValidItem, CCJControlBar::IsVertDocked, CCJToolBar::Layout, LayoutRowCol, CCJToolBar::LoadBitmap, CCJHtmlView::LoadFromResource, CCJMenu::LoadMenu, CCJToolBar::LoadToolBar, CCJMenu::LoadToolbars, Log_printf, LogString, CCJToolBarCtrl::MapAccelerator, CCJToolBar::MapAccelerator, CCJToolBarCtrl::MarkButton, CCJReBarCtrl::MaximizeBand, CCJReBarCtrl::MinimizeBand, CCJCaption::ModifyCaptionStyle, CCJMenu::ModifyODMenuW, CCJReBarCtrl::MoveBand, CCJToolBarCtrl::MoveButton, CCJHtmlView::Navigate2, CCJHtmlView::NavigateComplete2, CCJMenu::NewODMenu, CHistComboBoxEx::NewRoot, CMainFrame::OnActivate, CCJToolBar::OnBarStyleChange, CCJBrowseButton::OnClicked, UCvsFolders::OnCmdAdd, UCvsFolders::OnCmdCommit, UCvsFolders::OnCmdDiff, UCvsFolders::OnCmdEdit, UCvsFolders::OnCmdEditors, UCvsFolders::OnCmdExplore, UCvsFolders::OnCmdLock, UCvsFolders::OnCmdLog, UCvsFolders::OnCmdQueryUpdate, UCvsFolders::OnCmdRelease, UCvsFolders::OnCmdStatus, UCvsFolders::OnCmdTagBranch, UCvsFolders::OnCmdTagDelete, UCvsFolders::OnCmdTagNew, UCvsFolders::OnCmdUnedit, UCvsFolders::OnCmdUnlock, UCvsFolders::OnCmdUpdate, UCvsFolders::OnCmdWatchers, UCvsFolders::OnCmdWatchOff, UCvsFolders::OnCmdWatchOn, CCJHexEdit::OnContextMenu, CMainFrame::OnCreate, CCJTabView::OnCreate, CCJFlatHeaderCtrl::OnCreate, CCJHtmlView::OnDraw, CCJFlatSplitterWnd::OnDrawSplitter, CCJToolBar::OnDropDownButton, CGraphView::OnGraphChangelogmessage, CGraphView::OnGraphSetdescription, CGraphView::OnGraphSetstate, CTag_MAIN::OnInitDialog, CRtag_OPTIONS::OnInitDialog, CRtag_MAIN::OnInitDialog, CAdminOptionDlg::OnInitDialog, CMainFrame::OnInitMenu, CGraphView::OnInitMenuPopup, CGfxSplitterWnd::OnInvertTracker, CCJSizeDockBar::OnInvertTracker, CCJControlBar::OnInvertTracker, CGfxOutBarCtrl::OnLButtonDown, CCJOutlookBar::OnLButtonUp, CCJMenuBar::OnMenuInput, CCJControlBar::OnMouseMove, CCJToolBar::OnNcCalcSize, CCJToolBar::OnNcCreate, CCJMiniDockFrameWnd::OnNcLButtonDblClk, CCJMiniDockFrameWnd::OnNcLButtonDown, CCJHexEdit::OnPaint, CCJToolBar::OnPreserveZeroBorderHelper, CGfxOutBarCtrl::OnRButtonDown, CCJTabCtrl::OnRButtonDown, CCJFlatHeaderCtrl::OnRButtonDown, CCJControlBar::OnRButtonDown, CCJReBar::OnRecalcParent, CCJToolBar::OnSetSizeHelper, CMainFrame::OnSysCommand, UToolbar::OnTbButton, UToolbar::OnTbCheckBtn, UToolbar::OnTbDropDown, UToolbar::OnTbSeparator, CCJToolBar::OnToolHitTest, CCJReBar::OnToolHitTest, UCvsFolders::OnTreeSelecting, CCJTabCtrlBar::OnWindowPosChanged, CvsCoworker::OpenProject, CCJTabCtrlBar::OverkillAssert, CGfxOutBarCtrl::PaintItems, CCJFlatComboBox::PointInRect, CCJMDIFrameWnd::PreCreateWindow, CCJFrameWnd::PreCreateWindow, CCJToolBar::PressButton, CCJHyperLink::PreSubclassWindow, CCJFlatHeaderCtrl::PreSubclassWindow, CCJHtmlView::PutProperty, CWincvsView::QueryAcceptData, CCJHtmlView::QueryStatusWB, UToolbar::RebuildBar, CGfxSplitterWnd::RecalcLayout, CCJPagerCtrl::RecalcSize, CCJMenuBar::RecomputeToolbarSize, CCJHtmlView::Refresh, CCJHtmlView::Refresh2, CSubclassWndMap::Remove, CvsCoworker::RemoveFiles, CGfxOutBarCtrl::RemoveFolder, CGfxOutBarCtrl::RemoveItem, CCJTabCtrlBar::RemoveListItem, CCJTabView::RemoveView, CCJTabCtrlBar::RemoveView, CvsCoworker::RenameFile, CvsString::resize, CCJToolBar::SendMessageC, CCJTabView::SetActiveView, CCJTabCtrlBar::SetActiveView, CCJHtmlView::SetAddressBar, CCJToolBarCtrl::SetAnchorHighlight, CCJReBarCtrl::SetBandInfo, CCJReBarCtrl::SetBarInfo, CCJToolBar::SetBitmap, CCJToolBar::SetBitmapSize, CCJReBarCtrl::SetBkColor, CCJPagerCtrl::SetBkColor, CCJPagerCtrl::SetBorder, CCJToolBarBase::SetBorders, CCJFlatButton::SetButtonFont, CCJToolBarCtrl::SetButtonInfo, CCJToolBar::SetButtons, CCJToolBar::SetButtonSize, CCJPagerCtrl::SetButtonSize, CCJToolBar::SetButtonStructSize, CCJToolBar::SetButtonStyle, CCJToolBar::SetButtonText, CCJToolBarCtrl::SetButtonWidth, CCJCaption::SetCaptionColors, CCJToolCmdUI::SetCheck, CCJPagerCtrl::SetChild, CCJControlBar::SetChild, CCJCaption::SetChildWindow, CCJToolBar::SetCmdID, CCJMonthCalCtrl::SetColor, CCJMonthCalCtrl::SetCurSel, CCJMonthCalCtrl::SetDayState, CCJToolBarCtrl::SetDisabledImageList, CCJToolBarCtrl::SetDrawTextFlags, CCJMaskEdit::SetEditMask, CCJComboBoxEx::SetEditSel, CCJToolBarCtrl::SetExtendedStyle, CCJToolBar::SetExtendedStyle, CCJListView::SetExtendedStyle, CCJListCtrl::SetExtendedStyle, CCJComboBoxEx::SetExtendedStyle, CCJMonthCalCtrl::SetFirstDayOfWeek, CGfxOutBarCtrl::SetFolderImageList, CGfxOutBarCtrl::SetFolderText, CCJFlatHeaderCtrl::SetFontBold, CCJDateTimeCtrl::SetFormat, CCJHtmlView::SetFullScreen, CCJHtmlView::SetHeight, CCJToolBarCtrl::SetHotImageList, CCJToolBarCtrl::SetHotItem, CCJToolBar::SetHotItem, CCJFlatButton::SetIcon, CCJToolBarCtrl::SetImageList, CCJToolBar::SetImageList, CCJComboBoxEx::SetImageList, CCJToolBarCtrl::SetIndent, CCJToolBar::SetIndent, CCJToolBarCtrl::SetInsertMark, CCJToolBarCtrl::SetInsertMarkColor, CCJComboBoxEx::SetItem, CGfxOutBarCtrl::SetItemData, CGfxOutBarCtrl::SetItemImage, CGfxOutBarCtrl::SetItemText, CCJHtmlView::SetLeft, CCJMonthCalCtrl::SetMaxSelCount, CCJToolBarCtrl::SetMaxTextRows, CCJHtmlView::SetMenuBar, CCJFlatHeaderCtrl::SetMenuID, CCJControlBar::SetMenuID, CCJDateTimeCtrl::SetMonthCalColor, CCJDateTimeCtrl::SetMonthCalFont, CCJMonthCalCtrl::SetMonthDelta, CCJControlBar::SetNormalSize, CCJHtmlView::SetOffline, CCJReBarCtrl::SetOwner, CCJToolBar::SetOwner, CCJToolBar::SetPadding, CCJReBarCtrl::SetPalette, CCJPagerCtrl::SetPos, CCJMonthCalCtrl::SetRange, CCJDateTimeCtrl::SetRange, CCJHtmlView::SetRegisterAsBrowser, CCJHtmlView::SetRegisterAsDropTarget, CCJToolBar::SetRows, CCJPagerCtrl::SetScrollArea, CGfxOutBarCtrl::SetSelFolder, CCJMonthCalCtrl::SetSelRange, CCJHtmlView::SetSilent, CCJToolBar::SetSizes, CCJToolBar::SetState, CCJHtmlView::SetStatusBar, CCJToolBarCtrl::SetStyle, CCJReBarCtrl::SetTextColor, CCJHtmlView::SetTheaterMode, CCJDateTimeCtrl::SetTime, CCJMonthCalCtrl::SetToday, CCJHtmlView::SetToolBar, CCJToolBar::SetToolbarStyle, UCmdUI::SetTooltip, CCJToolBar::SetToolTips, CCJReBarCtrl::SetToolTips, CCJHtmlView::SetTop, CCJTabCtrlBar::SetViewToolTip, CCJHtmlView::SetVisible, CCJReBarCtrl::ShowBand, CCJFlatSplitterWnd::ShowColumn, CvsCoworker::ShowFileHistory, CvsCoworker::ShowFileProperties, CCJControlBar::ShowFrameControls, CCJFlatSplitterWnd::ShowRow, CvsCoworker::ShowUserInterface, CCJToolBar::SizeToolBar, CCJReBarCtrl::SizeToRect, CGfxOutBarCtrl::StartGroupEdit, CGfxOutBarCtrl::StartItemEdit, CCJDockContext::StartResize, CCJHtmlView::Stop, CCJListView::SubclassHeader, CCJListCtrl::SubclassHeader, TestBuffer, CCJDockContext::ToggleDocking, CCJDockContext::TrackDockBar, CCJMenuBar::TrackPopup, CCJMenuBar::TranslateFrameMessage, UMakeBitmap, UMenuAddToggle, CvsCoworker::UncheckoutFiles, CCJCaption::UpdateCaption, CvsCoworker::UpdateFiles, updateUIMenu, UWinPseudoWindowProc, CSubclassWnd::WindowProc, CCJToolBar::WrapToolBar, CCJSortClass::~CCJSortClass, CSplashWnd::~CSplashWnd, and CvsProject::~CvsProject.

#define LOG_API_FN ( FN ) CvsTrace _fn_(#FN)

Definition at line 45 of file CvsTrace.h.

Referenced by CvsCoworker::AddFiles, CvsCoworker::CheckinFiles, CvsCoworker::CheckoutFiles, CvsCoworker::CloseProject, CvsCoworker::DiffFile, CvsCoworker::GetErrorMessage, CvsCoworker::GetFileChanges, CvsCoworker::GetFilesToAdd, CvsCoworker::GetProject, CvsCoworker::HasAdvancedOptionsForCommand, CvsCoworker::OpenProject, CvsCoworker::RemoveFiles, CvsCoworker::RenameFile, CvsCoworker::ShowAdvancedOptionsForCommand, CvsCoworker::ShowFileHistory, CvsCoworker::ShowFileProperties, CvsCoworker::ShowUserInterface, CvsCoworker::UncheckoutFiles, and CvsCoworker::UpdateFiles.

#define LOG_API_N ( N ) { Log_printf("A " #N " : %lu",(long)(N)); }

Definition at line 54 of file CvsTrace.h.

Referenced by CvsCoworker::AddFiles, CvsCoworker::CheckinFiles, CvsCoworker::CheckoutFiles, CvsCoworker::CloseProject, CvsCoworker::DiffFile, CvsCoworker::GetErrorMessage, CvsCoworker::GetFileChanges, CvsCoworker::GetFilesToAdd, CvsCoworker::GetProject, CvsCoworker::HasAdvancedOptionsForCommand, CvsCoworker::OpenProject, CvsCoworker::RemoveFiles, CvsCoworker::RenameFile, CvsCoworker::ShowAdvancedOptionsForCommand, CvsCoworker::ShowFileHistory, CvsCoworker::ShowFileProperties, CvsCoworker::ShowUserInterface, CvsCoworker::UncheckoutFiles, and CvsCoworker::UpdateFiles.

#define LOG_API_S ( S ) if (S) { LogString("A " #S,(const char*)(S)); }

Definition at line 48 of file CvsTrace.h.

Referenced by CvsCoworker::AddFiles, CvsCoworker::CheckinFiles, CvsCoworker::CheckoutFiles, CvsCoworker::DiffFile, CvsCoworker::GetErrorMessage, CvsCoworker::GetFileChanges, CvsCoworker::GetFilesToAdd, CvsCoworker::GetProject, CvsCoworker::OpenProject, CvsCoworker::RemoveFiles, CvsCoworker::RenameFile, CvsCoworker::ShowFileHistory, CvsCoworker::ShowFileProperties, CvsCoworker::ShowUserInterface, CvsCoworker::UncheckoutFiles, and CvsCoworker::UpdateFiles.

#define LOG_API_X ( X ) { Log_printf("A " #X " : 0x%lx",(long)(X)); }

Definition at line 51 of file CvsTrace.h.

#define LOG_BUFFER | ( | A,
 |  | B,
 |  | N | ) | LogBuffer(A,B,N)

Definition at line 68 of file CvsTrace.h.

#define qTRACE ( L ) Log_printf L

Definition at line 67 of file CvsTrace.h.

Referenced by CvsFilenames::CvsFilenames, CvsString::recycle, and CvsString::resize.

#define qTRACE_FN ( FN ) CvsTrace _fn_(#FN)

Definition at line 66 of file CvsTrace.h.

Referenced by CvsCoworker::CvsCoworker, CvsFilenames::CvsFilenames, and CvsCoworker::InterfaceSupportsErrorInfo.

#define qTRACE_N ( N ) { qTRACE(("a " #N " : %lu",(long)(N))); }

Definition at line 77 of file CvsTrace.h.

#define qTRACE_S ( S ) if (S) { qTRACE(("a " #S " : \"%s\"",(S))); }

Definition at line 71 of file CvsTrace.h.

#define qTRACE_X ( X ) { qTRACE(("a " #X " : 0x%lx",(long)(X))); }

Definition at line 74 of file CvsTrace.h.

#define VERIFY ( X ) if (!(X)) { __Assert(__FILE__,__LINE__,#X); DebugBreak(); } else 0

Definition at line 92 of file CvsTrace.h.

Referenced by _GetDropDownWidth, CCJToolBar::AddReplaceBitmap, CColorMenu::AppendColorMenuItem, CCJReBar::CalcFixedLayout, CCJPagerCtrl::CCJPagerCtrl, CCJToolBarCtrl::CCJToolBarCtrl, CColorMenu::CColorMenu, CCJReBarCtrl::Create, CCJReBar::Create, CCJMonthCalCtrl::Create, CCJDateTimeCtrl::Create, CCJComboBoxEx::Create, CBrowserBar::Create, CCJToolBar::CreateEx, CWinCvsBrowser::DeleteAllItems, CCJMenu::DitherBlt, CCJMenu::DrawItem, CColorMenu::DrawItem, CCJToolBar::GetButton, GetCustomMenu, CToolbarCombo::GetItemText, CCJFlatHeaderCtrl::InitializeHeader, CWincvsApp::InitInstance, CCJMenu::InsertSpaces, CCJMenuBar::LoadMenu, CCJMenu::MeasureItem, CCJTabView::ModifyTabStyle, CCustomizeMenus::OnAdd, CCJBrowseButton::OnClicked, CCJHexEdit::OnContextMenu, CCJTabView::OnCreate, CCJToolBar::OnDropDownButton, UWidget::OnGetSliderProperty, CWinCvsBrowser::OnInitialUpdate, CGfxOutBarCtrl::OnLButtonDown, UWidget::OnListAddSel, UWidget::OnListDelRow, UWidget::OnListResetAll, UWidget::OnListSetColTitle, UWidget::OnListSetColWidth, CCustomizeMenus::OnMove, CGfxOutBarCtrl::OnRButtonDown, CCJToolBar::OnRButtonDown, CCJTabCtrl::OnRButtonDown, CCJFlatHeaderCtrl::OnRButtonDown, CCJControlBar::OnRButtonDown, CCustomizeMenus::OnRemove, UWidget::OnSetSliderProperty, CCJReBar::OnShowBand, UToolbar::OnTbInit, UToolbar::RebuildBar, CWinCvsBrowser::ResetBrowser, CWinCvsBrowser::ResetView, CBrowseFileView::ResetView, CWinCvsBrowser::RetrievePath, CCJToolBar::SetButton, CCJToolBar::SetButtons, SetIcon, CCJToolBar::SetSizes, CWinCvsBrowser::StepToLocation, CWinCvsBrowser::StoreExpanded, UMenuAddButton, UMenuAddPulldown, UMenuAddSeparator, UMenuAddToggle, UMenuCount, UMenuDelete, UMenuDeleteByCmd, CCJTabCtrl::UpdateFont, CCJOutlookBar::UpdateFont, CCJMenuBar::UpdateFont, CCJMaskEdit::UpdateFont, CCJFlatButton::UpdateFont, CCJColorPopup::UpdateFont, CCJCaption::UpdateFont, CCJBrowseButton::UpdateFont, and UWinPseudoWindowProc.

Function Documentation

void __Assert | ( | const char * | sFile,
 |  | unsigned | iLine,
 |  | const char * | sExpression
 | ) | [static]

Definition at line 98 of file CvsTrace.h.

References Log_printf.

00099 {
00100     Log_printf("*%s:%u ASSERT FAILED: %s",sFile,iLine,sExpression);
00101 }

void __cdecl Log_printf | ( | const char * | ,
 |  | ... |
 | ) |

Definition at line 120 of file CvsTrace.cpp.

Referenced by __Assert, CvsTrace::CvsTrace, LogBuffer, and CvsTrace::~CvsTrace.

00121 {
00122     // skip if not logging
00123     if (!IS_LOGGING()) {
00124         return;
00125     }
00126     // omit if not in filter
00127     if (!InFilter(*s++)) {
00128         return;
00129     }
00130     char sBuffer[1000];
00131     char* p = AddPrefix(sBuffer);
00132         // insert leading spaces as required
00133     if (' ' == *s) { ++s; p = AddIndent(p); }
00134     // format the arguments
00135     va_list a;
00136     va_start(a,s);
00137     wvsprintf(p,s,a);
00138     va_end(a);
00139     ASSERT(strlen((const char*)sBuffer)<sizeof(sBuffer));
00140     // drop into log file
00141     LogWrite(sBuffer);
00142 }

void LogAttach | ( | HFILE | ,
 |  | LPCSTR |
 | ) |

void LogBuffer | ( | const char * | ,
 |  | const char * | ,
 |  | unsigned |
 | ) |

Definition at line 146 of file CvsTrace.cpp.

Referenced by LogString.

00147 {
00148     // skip if not logging
00149     if (!IS_LOGGING()) {
00150         return;
00151     }
00152     // omit if not in filter
00153     if (!InFilter(*sName++)) {
00154         return;
00155     }
00156     // mark start of buffer
00157     Log_printf("*[BUFFER %s (%u bytes)]",sName,cbBuffer);
00158     // dump contents of buffer
00159     for (unsigned i=0; i<cbBuffer;) {
00160         char sLine[256];
00161         char* s1 = sLine;
00162         wsprintf(s1,"\n%05x:",i);
00163         s1 += strlen(s1);
00164         memset(s1,' ',50);
00165         char* s2 = s1 + 50;
00166         while (i<cbBuffer) {
00167             unsigned b = *(unsigned char*)(sBuffer+i);
00168             ++s1;
00169             *s1++ = sHex[15&(b>>4)];
00170             *s1++ = sHex[15&b];
00171             *s2++ = (char)(((31<b) && (b<127)) ? b : '.');
00172             ++i;
00173             if (!(15&i)) break;
00174         }
00175         *s2 = 0;
00176         LogWrite(sLine);
00177     }
00178     // mark end of buffer
00179     Log_printf("*[END BUFFER %s]",sName);
00180 }

void LogCleanup ( void )

Definition at line 76 of file CvsTrace.cpp.

00077 {
00078 }

void LogInitialize ( LPCSTR )

Definition at line 66 of file CvsTrace.cpp.

00067 {
00068     if ('!' == *sFileName) {
00069         g_bLogUnbuffered = TRUE;
00070         ++sFileName;
00071     }
00072     time_t t = time(0);
00073     LogWrite(ctime(&t));
00074 }

void LogSetFilter ( const char * )

Definition at line 19 of file CvsTrace.cpp.

00020 {
00021     g_sFilter = strdup(s);
00022 }

void LogString | ( | const char * | ,
 |  | const char * |
 | ) |

Definition at line 95 of file CvsTrace.cpp.

00096 {
00097     // skip if not logging
00098     if (!IS_LOGGING()) {
00099         return;
00100     }
00101     if (256 < strlen(sValue)) {
00102         LogBuffer(s,sValue,strlen(sValue));
00103         return;
00104     }
00105     // omit if not in filter
00106     if (!InFilter(*s++)) {
00107         return;
00108     }
00109     char sBuffer[1000];
00110     char* p = AddPrefix(sBuffer);
00111         // insert leading spaces as required
00112     if (' ' == *s) { ++s; p = AddIndent(p); }
00113     // format the arguments
00114     wsprintf(p,"%s : \"%s\"",s,sValue);
00115     ASSERT(strlen((const char*)sBuffer)<sizeof(sBuffer));
00116     // drop into log file
00117     LogWrite(sBuffer);
00118 }

Generated on Sun Feb 24 01:23:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


dlldata.c File Reference

WinCvs/CoWorker/dlldata.c File Reference

#include <rpcproxy.h>

Include dependency graph for dlldata.c:

Include dependency graph

Go to the source code of this file.

Functions

PROXYFILE_LIST_START REFERENCE_PROXY_FILE (cvs_coworker)

Function Documentation

PROXYFILE_LIST_START REFERENCE_PROXY_FILE ( cvs_coworker )

Generated on Sun Feb 24 01:23:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/CoWorker/dlldata.c Source File

WinCvs/CoWorker/dlldata.c

Go to the documentation of this file.
00001 /*********************************************************
00002    DllData file -- generated by MIDL compiler
00003
00004         DO NOT ALTER THIS FILE
00005
00006    This file is regenerated by MIDL on every IDL file compile.
00007
00008    To completely reconstruct this file, delete it and rerun MIDL
00009    on all the IDL files in this DLL, specifying this file for the
00010    /dlldata command line option
00011
00012 *********************************************************/
00013
00014
00015 #include <rpcproxy.h>
00016
00017 #ifdef __cplusplus
00018 extern "C"   {
00019 #endif
00020
00021 EXTERN_PROXY_FILE( cvs_coworker )
00022
00023
00024 PROXYFILE_LIST_START
00025 /* Start of list */
00026   REFERENCE_PROXY_FILE( cvs_coworker ),
00027 /* End of list */
00028 PROXYFILE_LIST_END
00029
00030
00031 DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
00032
00033 #ifdef __cplusplus
00034 }  /*extern "C" */
00035 #endif
00036
00037 /* end of generated dlldata file */
Generated on Sun Feb 24 01:21:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WinCvs/res/resrc1.h Source File

WinCvs/res/resrc1.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by wincvs2.rc
00004 //
00005
00006 // Next default values for new objects
00007 //
00008 #ifdef APSTUDIO_INVOKED
00009 #ifndef APSTUDIO_READONLY_SYMBOLS
00010 #define _APS_3D_CONTROLS                     1
00011 #define _APS_NEXT_RESOURCE_VALUE        131
00012 #define _APS_NEXT_COMMAND_VALUE         32790
00013 #define _APS_NEXT_CONTROL_VALUE         1008
00014 #define _APS_NEXT_SYMED_VALUE           101
00015 #endif
00016 #endif
Generated on Sun Feb 24 01:21:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


resrc1.h File Reference

WinCvs/res/resrc1.h File Reference

Go to the source code of this file.

Generated on Sun Feb 24 01:23:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Annotated Index

WinCvs Source Compound List

Here are the classes, structs, unions and interfaces with brief descriptions:
_afxRichEditCookie |
_CvsProcess |
_dircontents |
_dirdesc |
_frameRec |
_IID |
_MIDL_PROC_FORMAT_STRING |
_MIDL_TYPE_FORMAT_STRING |
_WireHandler |
_WireMessage |
CAboutDlg |
AddBinCvsArgs |
AddCvsArgs |
AddUnicodeCvsArgs |
CAdminOptionDlg |
AFX_DLLVERSIONINFO |
CAllHandlers |
CAllTargets |
CAnnotate_MAIN |
ansiAttrCvt |
ansiAttrCvt::AnsiSeq |
AREF |
aref |
CAskYesNo |
Authen | Authentication class
UAuthen_Gserver |
UAuthen_Kserver |
UAuthen_Pserver |
UAuthen_Rhosts |
UAuthen_SSH |
AuthenGserver |
AuthenKserver |
AuthenLocal |
AuthenModel | Authentication model class
AuthenNtserver |
AuthenPserver |
AuthenRhosts |
CAuthenSetUp |
AuthenSSH |
awidget |
CBarConsole |
CBrowseFileView |
CBrowserBar |
UBrush |
CBuffer |
CButton |
CCharFormat |
CCheckout_MAIN |
CCheckout_OPTIONS |
CCJBrowseButton |
CCJBrowseEdit |
CCJCaption |
CCJCaptionButton |
CCJCaptionPopupWnd |
CCJCBarButton |
CCJColorPicker |
CCJColorPopup |
CCJComboBoxEx |
CCJControlBar |
CCJDateEdit |
CCJDateTimeCtrl |
CCJDockBar |
CCJDockContext |
CCJExplorerBar |
CCJFlatButton |
CCJFlatComboBox |
CCJFlatHeaderCtrl |
CCJFlatSplitterWnd |
CCJFlatTabCtrl |
CCJFontCombo |
CCJFrameWnd |
CCJHexEdit |
CCJHtmlView |
CCJHyperLink |
CCJListBox |
CCJListCtrl |
CCJListView |
CCJLogoPane |
CCJMaskEdit |
CCJMDIChildWnd |
CCJMDIFrameWnd |
CCJMemFile |
CCJMenu |
CCJMenuBar |
CCJMenuBarFrameHook |
CCJMenuData |
CCJMetaFileButton |
CCJMiniDockFrameWnd |
CCJMonthCalCtrl |
CCJOutlookBar |
CCJPagerCtrl |
CCJReBar |
CCJReBarCtrl |
CCJShellTree |
CCJSizeDockBar |
CCJSortClass |
CCJSortClass::CSortItem |
CCJStatusBar |
CCJStatusBarPane |
CCJStatusBarPaneControlInfo |
CCJTabCtrl |
CCJTabCtrlBar |
CCJTabView |
CCJTimeEdit |
CCJToolBar |
CCJToolBarBase |
CCJToolBarCtrl |
CCJToolCmdUI |
CCJTreeCtrl |
CCJTreeCtrl::Color_Font |
CCJWindowPlacement |
CCmdLine_MAIN |
UCmdTarget |
UCmdUI |
CCmdUI |
UCOLOR |
UColor | Portable color definition
CColorConsole |
CColorMenu |
CColorStatic |
CComboBox |
CComboBoxEx |
CComCoClass |
CCommit_MAIN |
CCommit_OPTIONS |
CComModule |
CComObjectRootEx |
CContentItems |
CControlBar |
CCtrlView |
CCustInvertTable |
CCustomizeMenus |
CCVS_CoworkerModule |
CCVSAlert |
UCvsApp |
UCvsConsole |
CCvsConsole |
UCvsFiles |
UCvsFolders |
UCvsFrame |
UCvsGraph |
UCvsMenubar |
CCvsStatusBar |
CCvsThreadLock |
UCvsToolbar |
UDC |
CDestroyThreadLock |
CDialog |
CDiff_MAIN |
direct |
CDockBar |
CDockContext |
CDocument |
DROPDOWNBUTTON |
CDummyClass |
CDummyInit |
DYN_LIST |
CDynToolBar |
CEdit |
UEditMessage |
CEditorMonDlg |
ENTNODE |
EntnodeData |
EntnodeFile |
EntnodeFolder |
EntnodePath |
CExploreBar |
FileEntry |
CFillPyEntries |
CFillTclEntries |
CFindSettings |
CFormView |
CFrameWnd |
garbyRec |
GetPassword |
CGetPrefs_CVSCMD_DIALOGS |
CGetPrefs_CVSROOT |
CGetPrefs_GLOBALS |
CGetPrefs_WINCVS |
GetValue |
CGfxGroupEdit |
CGfxOutBarCtrl |
CGfxOutBarCtrl::CBarFolder |
CGfxOutBarCtrl::CBarItem |
CGfxSplitterWnd |
GPT_CONSOLE |
GPT_GETENV |
GPT_QUIT |
CGraphConsole |
CGraphDoc |
CGraphFrame |
CGraphOptDlg |
CGraphRectTracker |
CGraphView |
CHARFORMAT |
CHeaderCtrl |
CHistComboBoxEx |
ICvsCoworker |
ICvsCoworker |
CImport_MAIN |
CImport_OPTIONS |
CImportEntry |
CImportFilterDlg |
ImportReport |
CImportWarning |
CInit_MAIN |
irciiAttrCvt |
ISupportErrorInfo |
IUnknown |
Wincvs::IWincvs |
CJX_COLORMAP |
CJX_CONTROLPOS |
CKeyString |
KiColumn |
KiColumnModel |
KiFilterModel |
KiIgnoreModel |
KiRecursionModel |
KiSelectionHandler |
KoAddBinaryHandler |
KoAddHandler |
KoAddUnicodeHandler |
KoAnnotateHandler |
KoBranchTagHandler |
KoColumnContext |
KoCommitHandler |
KoConflictColumn |
KoCreateTagHandler |
KoDateColumn |
KoDeleteTagHandler |
KoDiffHandler |
KoEditHandler |
KoEditorsHandler |
KoFileRemoveHandler |
KoFilterModel |
KoForceEditHandler |
KoGraphHandler |
KoIgnoreModel |
KoLockHandler |
KoLogHandler |
KoMoveToTrashHandler |
KoNameColumn |
KoOptionColumn |
KoPathColumn |
KoQueryUpdateHandler |
KoRecursionModel |
KoRecursiveModel |
KoRegularModel |
KoReleaseHandler |
KoReservedEditHandler |
KoRevisionColumn |
KoStatusColumn |
KoStatusHandler |
KoTagColumn |
KoTraversalContext |
KoUneditHandler |
KoUnlockHandler |
KoUpdateHandler |
KoUpdateMoveToTrashHandler |
KoWatcher |
KoWatchersHandler |
KoWatchOffHandler |
KoWatchOnHandler |
LAttachment |
LBevelButton |
LCommander |
ULIST_INFO |
ULIST_INSERT |
CListBox |
CListCtrl |
CListView |
LListener |
LMainPseudoAttachment |
CLogFilters |
CLogFrame |
CLogMain |
CLogNodeData |
CLogoutThread |
LOutlineItem |
LOutlineTable |
LPane |
LPeriodical |
LPlaceHolder |
LPseudoDrawAttachment |
LPseudoWinAttachment |
LSReport |
UMacAppMenu |
CMacBinItem |
MACBINMAP |
MACBINMAPENTRIES |
MacBinMaps |
CMacBinTable |
CMacroEntry |
CMacroSet |
MacroTraversal |
CMainFrame |
CMapPtrToPtr |
CMDIChildWnd |
CMDIFrameWnd |
CMemFile |
CMenu |
UMenu |
CMenuItemInfo |
UMessageMapFunctions |
CMiniDockFrameWnd |
mircAttrCvt |
CMMenuString |
CMPString |
CMsg |
UMSGMAP |
UMSGMAP_ENTRY |
CMString |
MultiFiles |
MultiFilesEntry |
CMyShellTree |
CNoPython |
NotificationManager |
NotificationManager::Node |
CObject |
UObject |
ColorTableEntry |
ControlCvsArgs |
option |
COptionalPropertySheet |
OUTBAR_INFO |
PCPStr |
PCStr |
UPen |
CPersistent |
CPersistent::CPersistentEntry |
CPersistentBool |
CPersistentInt |
CPersistentT< T > |
UPoint |
UPOINT |
poolRec |
UPPMenu |
CProgress |
CProgressDialog |
UPromptMessage |
CPropertyPage |
CPropertySheet |
CPseudoButton |
UPseudoCmdStatusWrapper |
CPseudoDlg |
CPseudoDraw |
UPseudoFakePane |
CPseudoItem |
CPseudoList |
UPseudoPageHider |
UPseudoPlaceHolder |
CPseudoRotButton |
UPseudoRotButton |
CPseudoToggle |
UPStr | Up to 255 characters pascal and C string
PyAutoObject< T > |
PyCmdUI |
PyCmdUI::obj_t |
PyColorConsole |
PyColorConsole::obj_t |
PyContainer |
CPyCvsConsole |
PyCvsEntry |
PyCvsEntry::obj_t |
PyMenuMgr |
PyMenuMgr::obj_t |
PyPersistent |
PyPersistent::obj_t |
PyRegistry |
CPython_Interp |
CPyThreadState |
URect |
URECT |
CRectTracker |
CRecursionLock |
CReleaseDlg |
RemoveCvsArgs |
ReportConflict |
ReportWarning |
CRevisionConsole |
CRichEditView |
CRtag_MAIN |
CRtag_OPTIONS |
URuntimeClass |
USaveSettings |
CScrollView |
USemaphore |
USize |
USIZE |
USLIDER |
USmartCombo | This is an abstract class for Smart Combo Box (CSmartComboBox)
CSmartComboBox | This is a Smart Combo Box class(CSmartComboBox)
CSortHeaderCtrl |
CSortList< T > |
CSortParam |
CSplashWnd |
CSplitterWnd |
CStackThreadLock |
CStatic |
CStaticAllocT< T > |
CStatusBar |
UStr | C string class
CStreamConsole |
CSubclassWnd |
CSubclassWndMap |
CTabCtrl |
TAdorner |
CTag_MAIN |
tagCTV_ITEM |
tagMENUITEMINFOA |
tagTCB_ITEM |
UTB_BUTTON |
UTB_DROPDOWN |
UTB_INIT |
CTbEdit |
TBehavior |
TbEntry |
TbEntryButton |
TbEntryChkButton |
TbEntryDropDown |
TbEntrySeparator |
TBrowserFill |
TBrowserFillDummy |
TBuggyPopup |
CTcl_Interp |
CTCLBrowserEnt |
CTCLCvsConsole |
CTCP2Parse |
CTCP2Parse::RGBColor |
TEditText |
CTempToggleBool |
TGraph |
TGraphCmdStatus |
TGraphDelCmd |
TGraphRectSelect |
TGraphSelNonSig |
TIconButton |
TIconCheckBox |
TIconPopup |
UTimer | Used by the UWidget class to implement timers/repeaters
CTipDlg |
TMPersistent< T > |
CTmpFiles |
TMString< T > |
UToolbar |
CToolbarCombo |
CToolBarCtrl |
CToolBarData |
TOOLBARINFO |
TPopup |
TPseudoAppBehavior |
TPseudoCustomView |
TPseudoDoubleNumberText |
TPseudoIconButton |
TPseudoIconCheckBox |
TPseudoIconPopup |
TPseudoRotateIconButton |
TPseudoScrollBar |
TPseudoTextListView |
TPseudoWinAdorner |
TPseudoWinBehavior |
TraversalReport |
UTREE_INFO |
UTREE_INSERT |
CTreeCtrl |
CTreeView |
TScrollBar |
TTextListView |
CTurnOffDispatching |
TView |
TViewFill |
CUpdateMain |
CUpdateMerge |
CUpdateSticky |
CustInvertTable |
vector |
CView |
CViewInfo |
CvsArgs |
CvsCoworker |
CvsFilenames |
CvsPrefs |
CvsProcessCallbacks |
CvsProject |
CvsString |
CvsTrace |
UWaitCursor |
UWidget | This is the pseudo widget class
Win32wstring |
CWinApp |
CWincvsApp |
CWinCvsBrowser |
CWinCvsBrowser::CSelectionChangeNotifier |
CWincvsDoc |
CWincvsView |
WINDOWPLACEMENT |
WININFO |
CWinLogBranchData |
CWinLogData |
CWinLogHeaderData |
CWinLogRevData |
CWinLogTagData |
CWinPlacement |
CWinThread |
CWnd |
CWndRedrawMngr | CWndRedrawManager supports efficient drawing of CWnd based windows,
wnt_stat |
wstring |
Generated on Sun Feb 24 01:24:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


_afxRichEditCookie Class Reference

Collaboration diagram for _afxRichEditCookie:

[legend]
List of all members.

Public Methods

_afxRichEditCookie (CArchive &ar)

Public Attributes

CArchive & | m_ar
DWORD | m_dwError

Constructor & Destructor Documentation

_afxRichEditCookie::_afxRichEditCookie ( CArchive & ar ) [inline]

Definition at line 152 of file wincvsDoc.cpp.

References m_ar, and m_dwError.

00152 : m_ar(ar) {m_dwError=0;}

Member Data Documentation

CArchive& _afxRichEditCookie::m_ar

Definition at line 150 of file wincvsDoc.cpp.

Referenced by _afxRichEditCookie, and EditStreamCallBack.

DWORD _afxRichEditCookie::m_dwError

Definition at line 151 of file wincvsDoc.cpp.

Referenced by _afxRichEditCookie, and EditStreamCallBack.

The documentation for this class was generated from the following file:
  • WinCvs/wincvsDoc.cpp
Generated on Sun Feb 24 01:24:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


_CvsProcess Struct Reference

#include <cvsgui_process.h>

Collaboration diagram for _CvsProcess:

[legend]
List of all members.

Public Attributes

unsigned int | open: 1
unsigned int | destroy: 1
unsigned int | starting: 1
pid_t pid
char ** | args
int | argc
pipe_t my_read
pipe_t my_write
pipe_t his_read
pipe_t his_write
pipe_t pstdin
pipe_t pstdout
pipe_t pstderr
char | write_buffer [512]
int | write_buffer_index
CvsProcessCallbacks * callbacks
HANDLE | threads [4]
DWORD | threadsID [4]

Member Data Documentation

int _CvsProcess::argc

Definition at line 51 of file cvsgui_process.h.

Referenced by cvs_process_destroy, cvs_process_new, and cvs_process_open.

char** _CvsProcess::args

Definition at line 50 of file cvsgui_process.h.

Referenced by cvs_process_destroy, cvs_process_new, and cvs_process_open.

CvsProcessCallbacks* _CvsProcess::callbacks

Definition at line 59 of file cvsgui_process.h.

Referenced by cvs_process_handle_message, cvs_process_new, cvs_process_open, GetChldError, and GetChldOutput.

unsigned int _CvsProcess::destroy

Definition at line 45 of file cvsgui_process.h.

Referenced by cvs_process_destroy, and cvs_process_new.

pipe_t _CvsProcess::his_read

Definition at line 54 of file cvsgui_process.h.

Referenced by cvs_process_close, cvs_process_new, and cvs_process_open.

pipe_t _CvsProcess::his_write

Definition at line 54 of file cvsgui_process.h.

Referenced by cvs_process_close, cvs_process_new, and cvs_process_open.

pipe_t _CvsProcess::my_read

Definition at line 53 of file cvsgui_process.h.

Referenced by cvs_process_close, cvs_process_new, cvs_process_open, cvs_process_recv_message, and ServeProtocol.

pipe_t _CvsProcess::my_write

Definition at line 53 of file cvsgui_process.h.

Referenced by cvs_process_close, cvs_process_handle_message, cvs_process_new, and cvs_process_open.

unsigned int _CvsProcess::open

Definition at line 44 of file cvsgui_process.h.

Referenced by cvs_process_close, cvs_process_new, cvs_process_open, cvs_process_recv_message, and ServeProtocol.

pid_t _CvsProcess::pid

Definition at line 49 of file cvsgui_process.h.

Referenced by cvs_process_close, cvs_process_new, cvs_process_open, and WaitChld.

pipe_t _CvsProcess::pstderr

Definition at line 55 of file cvsgui_process.h.

Referenced by cvs_process_close, cvs_process_new, cvs_process_open, and GetChldError.

pipe_t _CvsProcess::pstdin

Definition at line 55 of file cvsgui_process.h.

Referenced by cvs_process_close, cvs_process_new, and cvs_process_open.

pipe_t _CvsProcess::pstdout

Definition at line 55 of file cvsgui_process.h.

Referenced by cvs_process_close, cvs_process_new, cvs_process_open, and GetChldOutput.

unsigned int _CvsProcess::starting

Definition at line 47 of file cvsgui_process.h.

Referenced by cvs_process_close, cvs_process_new, cvs_process_open, and ServeProtocol.

HANDLE _CvsProcess::threads[4]

Definition at line 61 of file cvsgui_process.h.

Referenced by cvs_process_close, cvs_process_destroy, cvs_process_new, and cvs_process_open.

DWORD _CvsProcess::threadsID[4]

Definition at line 62 of file cvsgui_process.h.

Referenced by cvs_process_close, cvs_process_destroy, cvs_process_new, and cvs_process_open.

char _CvsProcess::write_buffer[ 512 ]

Definition at line 57 of file cvsgui_process.h.

Referenced by cvs_process_pop, and cvs_process_push.

int _CvsProcess::write_buffer_index

Definition at line 58 of file cvsgui_process.h.

Referenced by cvs_process_new, cvs_process_pop, and cvs_process_push.

The documentation for this struct was generated from the following file:
  • common/cvsgui_process.h
Generated on Sun Feb 24 01:24:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


_dircontents Struct Reference

#include <ndir.h>

Collaboration diagram for _dircontents:

[legend]
List of all members.

Public Attributes

char * | _d_entry
_dircontents * | _d_next

Member Data Documentation

char* _dircontents::_d_entry

Definition at line 49 of file ndir.h.

Referenced by free_dircontents, and opendir.

struct _dircontents* _dircontents::_d_next

Definition at line 50 of file ndir.h.

Referenced by free_dircontents, opendir, and seekdir.

The documentation for this struct was generated from the following file:
  • WinCvs/ndir.h
Generated on Sun Feb 24 01:24:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


_dirdesc Struct Reference

#include <ndir.h>

Collaboration diagram for _dirdesc:

[legend]
List of all members.

Public Attributes

int | dd_id
long | dd_loc
_dircontents * dd_contents
_dircontents * dd_cp

Member Data Documentation

struct _dircontents* _dirdesc::dd_contents

Definition at line 57 of file ndir.h.

Referenced by closedir, and seekdir.

struct _dircontents* _dirdesc::dd_cp

Definition at line 58 of file ndir.h.

Referenced by seekdir.

int _dirdesc::dd_id

Definition at line 55 of file ndir.h.

long _dirdesc::dd_loc

Definition at line 56 of file ndir.h.

Referenced by seekdir, and telldir.

The documentation for this struct was generated from the following file:
  • WinCvs/ndir.h
Generated on Sun Feb 24 01:24:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


_frameRec Struct Reference

Collaboration diagram for _frameRec:

[legend]
List of all members.

Public Attributes

void * | entry
_frameRec * | next

Member Data Documentation

void* _frameRec::entry

Definition at line 267 of file dll_garbage.c.

Referenced by poolAlloc, poolFree, and poolRemove.

struct _frameRec* _frameRec::next

Definition at line 272 of file dll_garbage.c.

Referenced by poolAlloc, poolFree, and poolRemove.

The documentation for this struct was generated from the following file:
  • common/dll_garbage.c
Generated on Sun Feb 24 01:24:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


_IID Struct Reference

Collaboration diagram for _IID:

[legend]
List of all members.

Public Attributes

unsigned long | x
unsigned short | s1
unsigned short | s2
unsigned char | c [8]

Member Data Documentation

unsigned char _IID::c

Definition at line 55 of file CVS_Coworker_i.c.

unsigned short _IID::s1

Definition at line 53 of file CVS_Coworker_i.c.

unsigned short _IID::s2

Definition at line 54 of file CVS_Coworker_i.c.

unsigned long _IID::x

Definition at line 52 of file CVS_Coworker_i.c.

The documentation for this struct was generated from the following files:
  • WinCvs/CoWorker/CVS_Coworker_i.c
  • WinCvs/CVS_Coworker_i.c
Generated on Sun Feb 24 01:24:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


_MIDL_PROC_FORMAT_STRING Struct Reference

Collaboration diagram for _MIDL_PROC_FORMAT_STRING:

[legend]
List of all members.

Public Attributes

short | Pad
unsigned char | Format [151]

Member Data Documentation

unsigned char _MIDL_PROC_FORMAT_STRING::Format

Definition at line 50 of file CVS_Coworker_p.c.

Referenced by ICvsCoworker_AddFiles_Proxy, ICvsCoworker_AddFiles_Stub, ICvsCoworker_CheckinFiles_Proxy, ICvsCoworker_CheckinFiles_Stub, ICvsCoworker_CheckoutFiles_Proxy, ICvsCoworker_CheckoutFiles_Stub, ICvsCoworker_CloseProject_Proxy, ICvsCoworker_CloseProject_Stub, ICvsCoworker_DiffFile_Proxy, ICvsCoworker_DiffFile_Stub, ICvsCoworker_GetErrorMessage_Proxy, ICvsCoworker_GetErrorMessage_Stub, ICvsCoworker_GetFileChanges_Proxy, ICvsCoworker_GetFileChanges_Stub, ICvsCoworker_GetFilesToAdd_Proxy, ICvsCoworker_GetFilesToAdd_Stub, ICvsCoworker_GetLastError_Proxy, ICvsCoworker_GetLastError_Stub, ICvsCoworker_GetProject_Proxy, ICvsCoworker_GetProject_Stub, ICvsCoworker_HasAdvancedOptionsForCommand_Proxy, ICvsCoworker_HasAdvancedOptionsForCommand_Stub, ICvsCoworker_OpenProject_Proxy, ICvsCoworker_OpenProject_Stub, ICvsCoworker_RemoveFiles_Proxy, ICvsCoworker_RemoveFiles_Stub, ICvsCoworker_RenameFile_Proxy, ICvsCoworker_RenameFile_Stub, ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy, ICvsCoworker_ShowAdvancedOptionsForCommand_Stub, ICvsCoworker_ShowFileHistory_Proxy, ICvsCoworker_ShowFileHistory_Stub, ICvsCoworker_ShowFileProperties_Proxy, ICvsCoworker_ShowFileProperties_Stub, ICvsCoworker_ShowUserInterface_Proxy, ICvsCoworker_ShowUserInterface_Stub, ICvsCoworker_UncheckoutFiles_Proxy, ICvsCoworker_UncheckoutFiles_Stub, ICvsCoworker_UpdateFiles_Proxy, and ICvsCoworker_UpdateFiles_Stub.

short _MIDL_PROC_FORMAT_STRING::Pad

Definition at line 49 of file CVS_Coworker_p.c.

The documentation for this struct was generated from the following files:
  • WinCvs/CoWorker/CVS_Coworker_p.c
  • WinCvs/CVS_Coworker_p.c
Generated on Sun Feb 24 01:24:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


_MIDL_TYPE_FORMAT_STRING Struct Reference

Collaboration diagram for _MIDL_TYPE_FORMAT_STRING:

[legend]
List of all members.

Public Attributes

short | Pad
unsigned char | Format [65]

Member Data Documentation

unsigned char _MIDL_TYPE_FORMAT_STRING::Format

Definition at line 44 of file CVS_Coworker_p.c.

Referenced by ICvsCoworker_AddFiles_Proxy, ICvsCoworker_AddFiles_Stub, ICvsCoworker_CheckinFiles_Proxy, ICvsCoworker_CheckinFiles_Stub, ICvsCoworker_CheckoutFiles_Proxy, ICvsCoworker_CheckoutFiles_Stub, ICvsCoworker_DiffFile_Proxy, ICvsCoworker_DiffFile_Stub, ICvsCoworker_GetErrorMessage_Proxy, ICvsCoworker_GetErrorMessage_Stub, ICvsCoworker_GetFileChanges_Proxy, ICvsCoworker_GetFileChanges_Stub, ICvsCoworker_GetFilesToAdd_Proxy, ICvsCoworker_GetFilesToAdd_Stub, ICvsCoworker_GetLastError_Proxy, ICvsCoworker_GetProject_Proxy, ICvsCoworker_GetProject_Stub, ICvsCoworker_HasAdvancedOptionsForCommand_Proxy, ICvsCoworker_OpenProject_Proxy, ICvsCoworker_OpenProject_Stub, ICvsCoworker_RemoveFiles_Proxy, ICvsCoworker_RemoveFiles_Stub, ICvsCoworker_RenameFile_Proxy, ICvsCoworker_RenameFile_Stub, ICvsCoworker_ShowFileHistory_Proxy, ICvsCoworker_ShowFileHistory_Stub, ICvsCoworker_ShowFileProperties_Proxy, ICvsCoworker_ShowFileProperties_Stub, ICvsCoworker_ShowUserInterface_Proxy, ICvsCoworker_ShowUserInterface_Stub, ICvsCoworker_UncheckoutFiles_Proxy, ICvsCoworker_UncheckoutFiles_Stub, ICvsCoworker_UpdateFiles_Proxy, and ICvsCoworker_UpdateFiles_Stub.

short _MIDL_TYPE_FORMAT_STRING::Pad

Definition at line 43 of file CVS_Coworker_p.c.

The documentation for this struct was generated from the following files:
  • WinCvs/CoWorker/CVS_Coworker_p.c
  • WinCvs/CVS_Coworker_p.c
Generated on Sun Feb 24 01:24:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


_WireHandler Struct Reference

Collaboration diagram for _WireHandler:

[legend]
List of all members.

Public Attributes

guint32 type
WireReadFunc read_func
WireWriteFunc write_func
WireDestroyFunc destroy_func

Member Data Documentation

WireDestroyFunc _WireHandler::destroy_func

Definition at line 85 of file cvsgui_wire.cpp.

Referenced by wire_destroy, and wire_register.

WireReadFunc _WireHandler::read_func

Definition at line 83 of file cvsgui_wire.cpp.

Referenced by wire_read_msg, and wire_register.

guint32 _WireHandler::type

Definition at line 82 of file cvsgui_wire.cpp.

Referenced by wire_register.

WireWriteFunc _WireHandler::write_func

Definition at line 84 of file cvsgui_wire.cpp.

Referenced by wire_register, and wire_write_msg.

The documentation for this struct was generated from the following file:
  • common/cvsgui_wire.cpp
Generated on Sun Feb 24 01:24:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


_WireMessage Struct Reference

#include <cvsgui_wire.h>

Collaboration diagram for _WireMessage:

[legend]
List of all members.

Public Attributes

guint32 type
gpointer data

Member Data Documentation

gpointer _WireMessage::data

Definition at line 91 of file cvsgui_wire.h.

Referenced by _gp_console_destroy, _gp_console_read, _gp_console_write, _gp_getenv_destroy, _gp_getenv_read, _gp_getenv_write, _gp_quit_destroy, _gp_quit_read, _gp_quit_write, cvs_process_handle_message, gp_console_write, gp_getenv_read, gp_getenv_write, and gp_quit_write.

guint32 _WireMessage::type

Definition at line 90 of file cvsgui_wire.h.

Referenced by cvs_process_handle_message, gp_console_write, gp_getenv_read, gp_getenv_write, gp_quit_write, wire_destroy, wire_read_msg, and wire_write_msg.

The documentation for this struct was generated from the following file:
  • common/cvsgui_wire.h
Generated on Sun Feb 24 01:24:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CAboutDlg Class Reference

Inheritance diagram for CAboutDlg:

[legend]
Collaboration diagram for CAboutDlg:

[legend]
List of all members.

Public Types

enum | { IDD = 100 }

Public Methods

CAboutDlg ()

Public Attributes

CString | m_vers
CCJHyperLink m_url

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
virtual BOOL | OnInitDialog ()

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 647 of file wincvs.cpp.

00647 { IDD = IDD_ABOUTBOX };

Constructor & Destructor Documentation

CAboutDlg::CAboutDlg ( )

Definition at line 666 of file wincvs.cpp.

References CStr, CWincvsApp::GetAppVersion, and m_vers.

00666                      : CDialog(CAboutDlg::IDD)
00667 {
00668     //{{AFX_DATA_INIT(CAboutDlg)
00669     m_vers = _T("WinCvs ");
00670     //}}AFX_DATA_INIT
00671
00672     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00673     CStr vers;
00674
00675     if(app->GetAppVersion(vers))
00676     {
00677         m_vers = vers;
00678     }
00679 }

Member Function Documentation

void CAboutDlg::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 691 of file wincvs.cpp.

References IDC_WINCVSURL, IDC_WINCVSVER, m_url, and m_vers.

00692 {
00693     CDialog::DoDataExchange(pDX);
00694     //{{AFX_DATA_MAP(CAboutDlg)
00695     DDX_Control(pDX, IDC_WINCVSURL, m_url);
00696     DDX_Text(pDX, IDC_WINCVSVER, m_vers);
00697     //}}AFX_DATA_MAP
00698 }

BOOL CAboutDlg::OnInitDialog ( ) [protected, virtual]

Definition at line 681 of file wincvs.cpp.

References m_url, CCJHyperLink::SetURL, and TRUE.

00682 {
00683     CDialog::OnInitDialog();
00684
00685     m_url.SetURL(_T("http://www.cvsgui.org"));
00686
00687     return TRUE;  // return TRUE unless you set the focus to a control
00688                   // EXCEPTION: OCX Property Pages should return FALSE
00689 }

Member Data Documentation

CCJHyperLink CAboutDlg::m_url

Definition at line 649 of file wincvs.cpp.

Referenced by DoDataExchange, and OnInitDialog.

CString CAboutDlg::m_vers

Definition at line 648 of file wincvs.cpp.

Referenced by CAboutDlg, and DoDataExchange.

The documentation for this class was generated from the following file:
  • WinCvs/wincvs.cpp
Generated on Sun Feb 24 01:24:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AddBinCvsArgs Class Reference

Inheritance diagram for AddBinCvsArgs:

[legend]
Collaboration diagram for AddBinCvsArgs:

[legend]
List of all members.

Protected Methods

virtual kTextBinTYPE | FileIsType (const char *arg, const char *dir, const FSSpec *spec=0L)
virtual const char * | TypeDesc ()

Member Function Documentation

virtual kTextBinTYPE AddBinCvsArgs::FileIsType | ( | const char * | arg,
 |  | const char * | dir,
 |  | const FSSpec * | spec = 0L
 | ) | [inline, protected, virtual]

Implements ControlCvsArgs.

Definition at line 1250 of file CvsCommands.cpp.

References FileIsBinary, kTextBinTYPE, and UFSSpec.

01251     {
01252         return FileIsBinary(arg, dir, spec);
01253     }

virtual const char* AddBinCvsArgs::TypeDesc ( ) [inline, protected, virtual]

Implements ControlCvsArgs.

Definition at line 1255 of file CvsCommands.cpp.

01256     {
01257         return "binary";
01258     }

The documentation for this class was generated from the following file:
  • common/CvsCommands.cpp
Generated on Sun Feb 24 01:24:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AddCvsArgs Class Reference

Inheritance diagram for AddCvsArgs:

[legend]
Collaboration diagram for AddCvsArgs:

[legend]
List of all members.

Protected Methods

virtual kTextBinTYPE | FileIsType (const char *arg, const char *dir, const FSSpec *spec=0L)
virtual const char * | TypeDesc ()

Member Function Documentation

virtual kTextBinTYPE AddCvsArgs::FileIsType | ( | const char * | arg,
 |  | const char * | dir,
 |  | const FSSpec * | spec = 0L
 | ) | [inline, protected, virtual]

Implements ControlCvsArgs.

Definition at line 1208 of file CvsCommands.cpp.

References FileIsText, kTextBinTYPE, and UFSSpec.

01209     {
01210         return FileIsText(arg, dir, spec);
01211     }

virtual const char* AddCvsArgs::TypeDesc ( ) [inline, protected, virtual]

Implements ControlCvsArgs.

Definition at line 1213 of file CvsCommands.cpp.

01214     {
01215         return "TEXT";
01216     }

The documentation for this class was generated from the following file:
  • common/CvsCommands.cpp
Generated on Sun Feb 24 01:24:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AddUnicodeCvsArgs Class Reference

Inheritance diagram for AddUnicodeCvsArgs:

[legend]
Collaboration diagram for AddUnicodeCvsArgs:

[legend]
List of all members.

Protected Methods

virtual kTextBinTYPE | FileIsType (const char *arg, const char *dir, const FSSpec *spec=0L)
virtual const char * | TypeDesc ()

Member Function Documentation

virtual kTextBinTYPE AddUnicodeCvsArgs::FileIsType | ( | const char * | arg,
 |  | const char * | dir,
 |  | const FSSpec * | spec = 0L
 | ) | [inline, protected, virtual]

Implements ControlCvsArgs.

Definition at line 1293 of file CvsCommands.cpp.

References FileIsUnicode, kTextBinTYPE, and UFSSpec.

01294     {
01295         return FileIsUnicode(arg, dir, spec);
01296     }

virtual const char* AddUnicodeCvsArgs::TypeDesc ( ) [inline, protected, virtual]

Implements ControlCvsArgs.

Definition at line 1298 of file CvsCommands.cpp.

01299     {
01300         return "Unicode";
01301     }

The documentation for this class was generated from the following file:
  • common/CvsCommands.cpp
Generated on Sun Feb 24 01:24:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CAdminOptionDlg Class Reference

#include <AdminOptionDlg.h>

Inheritance diagram for CAdminOptionDlg:

[legend]
Collaboration diagram for CAdminOptionDlg:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_ADMINOPTION }

Public Methods

CAdminOptionDlg (kAdminOptionDlgType type, CWnd *pParent=NULL)

Public Attributes

CString | m_optionString

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
virtual BOOL | OnInitDialog ()

Private Attributes

kAdminOptionDlgType m_type
BOOL | m_singeLine
CString | m_title
CString | m_optionDescription

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 59 of file AdminOptionDlg.h.

00059 { IDD = IDD_ADMINOPTION };

Constructor & Destructor Documentation

CAdminOptionDlg::CAdminOptionDlg | ( | kAdminOptionDlgType | type,
 |  | CWnd * | pParent = NULL
 | ) |

Definition at line 43 of file AdminOptionDlg.cpp.

References FALSE, kAdminOptionDlgType, m_optionString, m_singeLine, and m_type.

00045     : CDialog(CAdminOptionDlg::IDD, pParent)
00046 {
00047     //{{AFX_DATA_INIT(CAdminOptionDlg)
00048     //}}AFX_DATA_INIT
00049
00050     m_optionString = _T("");
00051     m_type = type;
00052     m_singeLine = FALSE;
00053 }

Member Function Documentation

void CAdminOptionDlg::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 56 of file AdminOptionDlg.cpp.

References IDC_OPTIONSTRING, IDC_OPTIONSTRING_SL, kSetState, m_optionString, m_singeLine, and m_type.

00057 {
00058     CDialog::DoDataExchange(pDX);
00059     //{{AFX_DATA_MAP(CAdminOptionDlg)
00060     //}}AFX_DATA_MAP
00061
00062     DDX_Text(pDX, m_singeLine ? IDC_OPTIONSTRING_SL : IDC_OPTIONSTRING, m_optionString);
00063
00064     if( pDX->m_bSaveAndValidate )
00065     {
00066         if( kSetState == m_type && m_optionString.Find(" ") > -1 )
00067         {
00068             AfxMessageBox( "State can't contain the spaces.", MB_ICONSTOP );
00069             pDX->Fail();
00070         }
00071     }
00072 }

BOOL CAdminOptionDlg::OnInitDialog ( ) [protected, virtual]

Definition at line 83 of file AdminOptionDlg.cpp.

References ASSERT, FALSE, IDC_OPTIONSTRING, IDC_OPTIONSTRING_SL, kChangeLog, kSetDescription, kSetState, m_optionDescription, m_optionString, m_singeLine, m_title, NULL, and TRUE.

00084 {
00085     //set the title and description
00086     switch( m_type )
00087     {
00088     case kChangeLog:
00089         m_title = "Change log message";
00090         m_optionDescription = "&Log message:";
00091         break;
00092     case kSetState:
00093         m_title = "Set state";
00094         m_optionDescription = "&State:";
00095         m_singeLine = TRUE;
00096         break;
00097     case kSetDescription:
00098         m_title = "Set Description";
00099         m_optionDescription = "&Description";
00100         break;
00101     default:
00102         ASSERT(FALSE); //unknown type
00103         return FALSE;
00104     }
00105
00106     //hide the unneccessary controls and re-position the window if neccessary
00107     GetDlgItem(m_singeLine ? IDC_OPTIONSTRING : IDC_OPTIONSTRING_SL)->EnableWindow(FALSE);
00108     GetDlgItem(m_singeLine ? IDC_OPTIONSTRING : IDC_OPTIONSTRING_SL)->ShowWindow(SW_HIDE);
00109     if( m_singeLine )
00110     {
00111         CRect rectSingleLine;
00112         CRect rectMultiLine;
00113         GetDlgItem(IDC_OPTIONSTRING_SL)->GetWindowRect(rectSingleLine);
00114         GetDlgItem(IDC_OPTIONSTRING)->GetWindowRect(rectMultiLine);
00115         int diff = rectMultiLine.Height() - rectSingleLine.Height();
00116
00117         CRect rect;
00118         GetWindowRect(rect);
00119         SetWindowPos(NULL, 0, 0, rect.Width(), rect.Height() - diff, SWP_NOMOVE | SWP_NOZORDER);
00120         GetDlgItem(IDC_OPTIONDESC)->GetWindowRect(rect);
00121         GetDlgItem(IDC_OPTIONDESC)->SetWindowPos(NULL, 0, 0, rect.Width(), rect.Height() - diff, SWP_NOMOVE | SWP_NOZORDER);
00122         GetDlgItem(IDOK)->GetWindowRect(rect);
00123         ScreenToClient(rect);
00124         rect.OffsetRect(0, -diff);
00125         GetDlgItem(IDOK)->MoveWindow(rect);
00126         GetDlgItem(IDCANCEL)->GetWindowRect(rect);
00127         ScreenToClient(rect);
00128         rect.OffsetRect(0, -diff);
00129         GetDlgItem(IDCANCEL)->MoveWindow(rect);
00130     }
00131
00132     //fix the line endings
00133     m_optionString.Replace("\n", "\r\n");
00134
00135     CDialog::OnInitDialog();
00136
00137     if( !m_title.IsEmpty() )
00138     {
00139         SetWindowText(m_title);
00140     }
00141
00142     if( !m_optionDescription.IsEmpty() )
00143     {
00144         GetDlgItem(IDC_OPTIONDESC)->SetWindowText(m_optionDescription);
00145     }
00146
00147     return TRUE;  // return TRUE unless you set the focus to a control
00148                   // EXCEPTION: OCX Property Pages should return FALSE
00149 }

Member Data Documentation

CString CAdminOptionDlg::m_optionDescription [private]

Definition at line 85 of file AdminOptionDlg.h.

Referenced by OnInitDialog.

CString CAdminOptionDlg::m_optionString

Definition at line 79 of file AdminOptionDlg.h.

Referenced by CAdminOptionDlg, CompatGetAdminOptions, DoDataExchange, and OnInitDialog.

BOOL CAdminOptionDlg::m_singeLine [private]

Definition at line 82 of file AdminOptionDlg.h.

Referenced by CAdminOptionDlg, DoDataExchange, and OnInitDialog.

CString CAdminOptionDlg::m_title [private]

Definition at line 84 of file AdminOptionDlg.h.

Referenced by OnInitDialog.

kAdminOptionDlgType CAdminOptionDlg::m_type [private]

Definition at line 81 of file AdminOptionDlg.h.

Referenced by CAdminOptionDlg, and DoDataExchange.

The documentation for this class was generated from the following files:
  • common/AdminOptionDlg.h
  • common/AdminOptionDlg.cpp
Generated on Sun Feb 24 01:24:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AFX_DLLVERSIONINFO Struct Reference

Collaboration diagram for AFX_DLLVERSIONINFO:

[legend]
List of all members.

Public Attributes

DWORD | cbSize
DWORD | dwMajorVersion
DWORD | dwMinorVersion
DWORD | dwBuildNumber
DWORD | dwPlatformID

Member Data Documentation

DWORD AFX_DLLVERSIONINFO::cbSize

Definition at line 218 of file CJToolBar.cpp.

Referenced by _GetComCtlVersion.

DWORD AFX_DLLVERSIONINFO::dwBuildNumber

Definition at line 221 of file CJToolBar.cpp.

DWORD AFX_DLLVERSIONINFO::dwMajorVersion

Definition at line 219 of file CJToolBar.cpp.

Referenced by _GetComCtlVersion.

DWORD AFX_DLLVERSIONINFO::dwMinorVersion

Definition at line 220 of file CJToolBar.cpp.

Referenced by _GetComCtlVersion.

DWORD AFX_DLLVERSIONINFO::dwPlatformID

Definition at line 222 of file CJToolBar.cpp.

The documentation for this struct was generated from the following file:
  • WinCvs/CJLib/CJLibrary/CJToolBar.cpp
Generated on Sun Feb 24 01:24:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CAllHandlers Struct Reference

Collaboration diagram for CAllHandlers:

[legend]
List of all members.

Public Methods

CAllHandlers ()
~CAllHandlers ()

Public Attributes

std::map< guint32, WireHandler * > wire_ht

Constructor & Destructor Documentation

CAllHandlers::CAllHandlers ( ) [inline]

Definition at line 96 of file cvsgui_wire.cpp.

00096 {}

CAllHandlers::~CAllHandlers ( ) [inline]

Definition at line 97 of file cvsgui_wire.cpp.

References free, STD_STL, and wire_ht.

00098     {
00099         STD_STL map<guint32, WireHandler *>::iterator i;
00100         for(i = wire_ht.begin(); i != wire_ht.end(); ++i)
00101         {
00102             WireHandler *handler = (*i).second;
00103             free(handler);
00104         }
00105     }

Member Data Documentation

std:: map<guint32, WireHandler *> CAllHandlers::wire_ht

Definition at line 107 of file cvsgui_wire.cpp.

Referenced by wire_destroy, wire_read_msg, wire_register, wire_write_msg, and ~CAllHandlers.

The documentation for this struct was generated from the following file:
  • common/cvsgui_wire.cpp
Generated on Sun Feb 24 01:24:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CAllTargets Class Reference

Collaboration diagram for CAllTargets:

[legend]
List of all members.

Public Methods

CAllTargets ()
~CAllTargets ()
std::map< int, UCmdTarget * > & | Get (void)
const std::map< int, UCmdTarget * > & | Get (void) const

Protected Attributes

std::map< int, UCmdTarget * > | targets

Constructor & Destructor Documentation

CAllTargets::CAllTargets ( ) [inline]

Definition at line 88 of file uevent.cpp.

00088 {}

CAllTargets::~CAllTargets ( ) [inline]

Definition at line 89 of file uevent.cpp.

References STD, and targets.

00090     {
00091         // delete the remaining widgets at exit.
00092         // we don't make a loop because the widget gets
00093         // removed from the map when calling the destructor.
00094         STD map<int, UCmdTarget *>::iterator i;
00095         while(targets.size() != 0)
00096         {
00097             i = targets.begin();
00098             delete (*i).second;
00099         }
00100     }

Member Function Documentation

const std:: map<int, UCmdTarget *>& CAllTargets::Get ( void ) const [inline]

Definition at line 103 of file uevent.cpp.

References STD, and targets.

00103 { return targets; }

std:: map<int, UCmdTarget *>& CAllTargets::Get ( void ) [inline]

Definition at line 102 of file uevent.cpp.

References STD, and targets.

Referenced by UCmdTarget::UCmdTarget, UEventGetTargets, UEventGiveTime, UEventNotifyMessage, UEventQueryWidget, UEventRemoveWidID, UEventSendMessage, and UEventSendMessageExt.

00102 { return targets; }

Member Data Documentation

std:: map<int, UCmdTarget *> CAllTargets::targets [protected]

Definition at line 105 of file uevent.cpp.

Referenced by Get, and ~CAllTargets.

The documentation for this class was generated from the following file:
  • rf/uevent.cpp
Generated on Sun Feb 24 01:24:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CAnnotate_MAIN Class Reference

#include <AnnotateDlg.h>

Inheritance diagram for CAnnotate_MAIN:

[legend]
Collaboration diagram for CAnnotate_MAIN:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_ANNOTATE_MAIN }

Public Methods

CAnnotate_MAIN (const char *rev, bool isDate)
CAnnotate_MAIN ()
~CAnnotate_MAIN ()

Public Attributes

CSmartComboBox m_revCombo
BOOL | m_hasRev
BOOL | m_isDate
BOOL | m_force
BOOL | m_noRecurse
CString | m_strRev

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnSpecifyRev ()
afx_msg void | OnIsdate ()

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 60 of file AnnotateDlg.h.

00060 { IDD = IDD_ANNOTATE_MAIN };

Constructor & Destructor Documentation

CAnnotate_MAIN::CAnnotate_MAIN | ( | const char * | rev,
 |  | bool | isDate
 | ) |

Definition at line 77 of file AnnotateDlg.cpp.

References FALSE, m_force, m_hasRev, m_isDate, m_noRecurse, m_revCombo, m_strRev, and USmartCombo::SetItems.

00078     : CPropertyPage(CAnnotate_MAIN::IDD)
00079 {
00080     m_hasRev = FALSE;
00081     m_isDate = isDate;
00082     m_strRev = rev;
00083     m_force = FALSE;
00084     m_noRecurse = FALSE;
00085
00086     m_revCombo.SetItems(m_isDate ? &gDateNames : &gRevNames);
00087 }

CAnnotate_MAIN::CAnnotate_MAIN ( )

Definition at line 66 of file AnnotateDlg.cpp.

References FALSE, m_force, m_hasRev, m_isDate, m_noRecurse, and m_strRev.

00066                                : CPropertyPage(CAnnotate_MAIN::IDD)
00067 {
00068     //{{AFX_DATA_INIT(CAnnotate_MAIN)
00069     m_hasRev = FALSE;
00070     m_isDate = FALSE;
00071     m_force = FALSE;
00072     m_noRecurse = FALSE;
00073     m_strRev = _T("");
00074     //}}AFX_DATA_INIT
00075 }

CAnnotate_MAIN::~CAnnotate_MAIN ( )

Definition at line 89 of file AnnotateDlg.cpp.

00090 {
00091 }

Member Function Documentation

void CAnnotate_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 93 of file AnnotateDlg.cpp.

References DDV_MinChars, DDX_ComboMString, IDC_COMBO_REV, IDC_FORCE, IDC_ISDATE, IDC_NORECURS, IDC_SPECIFY_REV, m_force, m_hasRev, m_isDate, m_noRecurse, m_revCombo, m_strRev, and OnSpecifyRev.

00094 {
00095     CPropertyPage::DoDataExchange(pDX);
00096     //{{AFX_DATA_MAP(CAnnotate_MAIN)
00097     DDX_Control(pDX, IDC_COMBO_REV, m_revCombo);
00098     DDX_Check(pDX, IDC_SPECIFY_REV, m_hasRev);
00099     DDX_Check(pDX, IDC_ISDATE, m_isDate);
00100     DDX_Check(pDX, IDC_FORCE, m_force);
00101     DDX_Check(pDX, IDC_NORECURS, m_noRecurse);
00102     DDX_CBString(pDX, IDC_COMBO_REV, m_strRev);
00103     //}}AFX_DATA_MAP
00104
00105     if( m_hasRev )
00106     {
00107         DDV_MinChars(pDX, m_strRev, 1);
00108     }
00109
00110     DDX_ComboMString(pDX, IDC_COMBO_REV, m_revCombo);
00111
00112     if( !pDX->m_bSaveAndValidate )
00113     {
00114         OnSpecifyRev();
00115     }
00116 }

void CAnnotate_MAIN::OnIsdate ( ) [protected]

Definition at line 143 of file AnnotateDlg.cpp.

References DDX_ComboMString, IDC_COMBO_REV, IDC_ISDATE, m_revCombo, NULL, and USmartCombo::SetItems.

00144 {
00145     CButton* btnIsDate = (CButton*)GetDlgItem(IDC_ISDATE);
00146     BOOL isDate = btnIsDate->GetCheck();
00147
00148     m_revCombo.SetItems(isDate ? &gDateNames : &gRevNames);
00149     DDX_ComboMString(NULL, IDC_COMBO_REV, m_revCombo);
00150 }

void CAnnotate_MAIN::OnSpecifyRev ( ) [protected]

Definition at line 129 of file AnnotateDlg.cpp.

References IDC_COMBO_REV, IDC_FORCE, IDC_ISDATE, and IDC_SPECIFY_REV.

Referenced by DoDataExchange.

00130 {
00131     CButton* btnHasRev = (CButton*)GetDlgItem(IDC_SPECIFY_REV);
00132     CWnd* wndIsDate = GetDlgItem(IDC_ISDATE);
00133     CWnd* wndRev = GetDlgItem(IDC_COMBO_REV);
00134     CWnd* wndForce = GetDlgItem(IDC_FORCE);
00135
00136     BOOL bEnable = btnHasRev->GetCheck();
00137
00138     wndIsDate->EnableWindow(bEnable);
00139     wndRev->EnableWindow(bEnable);
00140     wndForce->EnableWindow(bEnable);
00141 }

Member Data Documentation

BOOL CAnnotate_MAIN::m_force

Definition at line 64 of file AnnotateDlg.h.

Referenced by CAnnotate_MAIN, CompatGetAnnotate, and DoDataExchange.

BOOL CAnnotate_MAIN::m_hasRev

Definition at line 62 of file AnnotateDlg.h.

Referenced by CAnnotate_MAIN, CompatGetAnnotate, and DoDataExchange.

BOOL CAnnotate_MAIN::m_isDate

Definition at line 63 of file AnnotateDlg.h.

Referenced by CAnnotate_MAIN, CompatGetAnnotate, and DoDataExchange.

BOOL CAnnotate_MAIN::m_noRecurse

Definition at line 65 of file AnnotateDlg.h.

Referenced by CAnnotate_MAIN, CompatGetAnnotate, and DoDataExchange.

CSmartComboBox CAnnotate_MAIN::m_revCombo

Definition at line 61 of file AnnotateDlg.h.

Referenced by CAnnotate_MAIN, DoDataExchange, and OnIsdate.

CString CAnnotate_MAIN::m_strRev

Definition at line 66 of file AnnotateDlg.h.

Referenced by CAnnotate_MAIN, CompatGetAnnotate, and DoDataExchange.

The documentation for this class was generated from the following files:
  • common/AnnotateDlg.h
  • common/AnnotateDlg.cpp
Generated on Sun Feb 24 01:24:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ansiAttrCvt Class Reference

#include <CTCP2Parse.hpp>

Inheritance diagram for ansiAttrCvt:

[legend]
Collaboration diagram for ansiAttrCvt:

[legend]
List of all members.

Public Methods

void | ansi2ctcp (std::string *in)

Private Methods

void | do_m ()
void | do_C ()

Private Attributes

int | pos
int | bold
int | underline
int | reverse
int | blink
int | italic
std::string * | _in
AnsiSeq * _seq

Static Private Attributes

const char * | escSeq = "\033\133"
const char * | fgColorMap [16]
const char * | bgColorMap [8]

Member Function Documentation

void ansiAttrCvt::ansi2ctcp ( std::string * in )

Definition at line 636 of file CTCP2Parse.cpp.

References _in, _seq, blink, bold, do_C, do_m, escSeq, INVALID_SEQUENCE, italic, pos, reverse, ansiAttrCvt::AnsiSeq::seq, underline, and ansiAttrCvt::AnsiSeq::verb.

Referenced by CTCP2Parse::ParseIt.

00637 {
00638     bold = underline = reverse = blink = italic = 0;
00639     _in = in;
00640
00641     pos = in->find(escSeq);
00642
00643     while (pos != std::string::npos)
00644     {
00645         _seq = new AnsiSeq(in, pos);
00646
00647         switch (_seq->verb())
00648         {
00649         case INVALID_SEQUENCE:
00650             break;
00651
00652         case 'm':       // set graphic mode
00653             do_m();
00654             break;
00655         case 'C':       // move cursor right
00656             do_C();
00657             break;
00658         case 'f':       // move to cursor position
00659         case 'H':       //          "
00660         case 'A':       // move cursor up
00661         case 'B':       // move cursor down
00662         case 'D':       // move cursor left
00663         case 's':       // save cursor position
00664         case 'u':       // restore cursor position
00665         case 'J':       // erase display and goto home
00666         case 'K':       // erase line
00667         case 'h':       // set display mode
00668         case 'l':       // reset display mode
00669         default:
00670             std::string errmsg(std::string ("[ansi error: '") + _seq->seq() +
00671                 "' sequence unsupported]");
00672             in->insert(pos, errmsg);
00673             pos += errmsg.length();
00674         }
00675         delete _seq;
00676         pos = in->find(escSeq, pos);
00677     }
00678 };

void ansiAttrCvt::do_C ( ) [private]

Definition at line 868 of file CTCP2Parse.cpp.

References _in, _seq, ansiAttrCvt::AnsiSeq::param, ansiAttrCvt::AnsiSeq::paramc, and pos.

Referenced by ansi2ctcp.

00869 {
00870     for (int i = 0; i < _seq->param(_seq->paramc() - 1); i++)
00871         _in->insert(pos++, " ");
00872 }

void ansiAttrCvt::do_m ( ) [private]

Definition at line 711 of file CTCP2Parse.cpp.

References _in, _seq, ANSI_SGM_BC_BLK, ANSI_SGM_BC_BLU, ANSI_SGM_BC_CYN, ANSI_SGM_BC_DEFAULT, ANSI_SGM_BC_GRN, ANSI_SGM_BC_MAG, ANSI_SGM_BC_RED, ANSI_SGM_BC_WHT, ANSI_SGM_BC_YEL, ANSI_SGM_FC_BLK, ANSI_SGM_FC_BLU, ANSI_SGM_FC_CYN, ANSI_SGM_FC_DEFAULT, ANSI_SGM_FC_GRN, ANSI_SGM_FC_MAG, ANSI_SGM_FC_RED, ANSI_SGM_FC_WHT, ANSI_SGM_FC_YEL, ANSI_SGM_TA_BLINK, ANSI_SGM_TA_BLINK_OFF, ANSI_SGM_TA_BOLD, ANSI_SGM_TA_CONSEAL, ANSI_SGM_TA_FAINT, ANSI_SGM_TA_ITALIC, ANSI_SGM_TA_ITALIC_OFF, ANSI_SGM_TA_NORMAL, ANSI_SGM_TA_RESET, ANSI_SGM_TA_REV, ANSI_SGM_TA_REV_OFF, ANSI_SGM_TA_ULINE, ANSI_SGM_TA_ULINE_OFF, bgColorMap, blink, bold, CCTCP2, fgColorMap, italic, ansiAttrCvt::AnsiSeq::param, ansiAttrCvt::AnsiSeq::paramc, pos, reverse, and underline.

Referenced by ansi2ctcp.

00712 {
00713     int i;
00714     for (i = 0; i < _seq->paramc(); i++)
00715     {
00716         switch (_seq->param(i))
00717         {
00718         // reset
00719         case ANSI_SGM_TA_RESET:
00720             bold = underline = reverse = blink = 0;
00721             _in->insert(pos, std::string("") + CCTCP2 + 'N' + CCTCP2);
00722             pos += 3;
00723             break;
00724
00725         // bold intensity
00726         case ANSI_SGM_TA_BOLD:
00727             if (!bold) bold = 1;
00728             break;
00729
00730         // bold intensity
00731         case ANSI_SGM_TA_FAINT:
00732             // TODO: what do I do for this ???
00733             break;
00734
00735         // bold + faint off (normal intensity)
00736         case ANSI_SGM_TA_NORMAL:
00737             if (bold) bold = 0;
00738             break;
00739
00740         // standout (italic)
00741         case ANSI_SGM_TA_ITALIC:
00742             if (!italic)
00743             {
00744                 italic = 1;
00745                 _in->insert(pos, std::string("") + CCTCP2 + "I+" + CCTCP2);
00746                 pos += 4;       // consume the additions
00747             }
00748             break;
00749
00750         // standout (italic) off
00751         case ANSI_SGM_TA_ITALIC_OFF:
00752             if (italic)
00753             {
00754                 italic = 0;
00755                 _in->insert(pos, std::string("") + CCTCP2 + "I-" + CCTCP2);
00756                 pos += 4;       // consume the additions
00757             }
00758             break;
00759
00760         // underline
00761         case ANSI_SGM_TA_ULINE:
00762             if (!underline)
00763             {
00764                 underline = 1;
00765                 _in->insert(pos, std::string("") + CCTCP2 + "U+" + CCTCP2);
00766                 pos += 4;       // consume the additions
00767             }
00768             break;
00769
00770         // underline off
00771         case ANSI_SGM_TA_ULINE_OFF:
00772             if (underline)
00773             {
00774                 underline = 0;
00775                 _in->insert(pos, std::string("") + CCTCP2 + "U-" + CCTCP2);
00776                 pos += 4;       // consume the additions
00777             }
00778             break;
00779
00780         // blink
00781         case ANSI_SGM_TA_BLINK:
00782             if (!blink)
00783             {
00784                 blink = 1;
00785                 _in->insert(pos, std::string("") + CCTCP2 + "K+" + CCTCP2);
00786                 pos += 4;   // consume additions.
00787             }
00788             break;
00789
00790         // blink off
00791         case ANSI_SGM_TA_BLINK_OFF:
00792             if (blink)
00793             {
00794                 blink = 0;
00795                 _in->insert(pos, std::string("") + CCTCP2 + "K-" + CCTCP2);
00796                 pos += 4;   // consume additions.
00797             }
00798             break;
00799
00800         // reverse
00801         case ANSI_SGM_TA_REV:
00802             if (!reverse)
00803             {
00804                 reverse = 1;
00805                 _in->insert(pos, std::string("") + CCTCP2 + "V+" + CCTCP2);
00806                 pos += 4;   // consume the additions
00807             }
00808             break;
00809
00810         // reverse off
00811         case ANSI_SGM_TA_REV_OFF:
00812             if (reverse)
00813             {
00814                 reverse = 0;
00815                 _in->insert(pos, std::string("") + CCTCP2 + "V-" + CCTCP2);
00816                 pos += 4;   // consume the additions
00817             }
00818             break;
00819
00820         // concealed
00821         case ANSI_SGM_TA_CONSEAL:
00822             // TODO: wtf is this?  make foreground same color as back?
00823             break;
00824
00825         case ANSI_SGM_FC_BLK:
00826         case ANSI_SGM_FC_RED:
00827         case ANSI_SGM_FC_GRN:
00828         case ANSI_SGM_FC_YEL:
00829         case ANSI_SGM_FC_BLU:
00830         case ANSI_SGM_FC_MAG:
00831         case ANSI_SGM_FC_CYN:
00832         case ANSI_SGM_FC_WHT:
00833             _in->insert(pos, std::string("") + CCTCP2 +
00834                 fgColorMap[_seq->param(i) - 30 + (bold ? 8 : 0)] +
00835                 CCTCP2);
00836             pos += 5;       // consume the additions
00837             break;
00838
00839         case ANSI_SGM_FC_DEFAULT:
00840             _in->insert(pos, std::string("") + CCTCP2 + "C.-" + CCTCP2);
00841             pos += 5;       // consume the additions
00842             break;
00843
00844         case ANSI_SGM_BC_BLK:
00845         case ANSI_SGM_BC_RED:
00846         case ANSI_SGM_BC_GRN:
00847         case ANSI_SGM_BC_YEL:
00848         case ANSI_SGM_BC_BLU:
00849         case ANSI_SGM_BC_MAG:
00850         case ANSI_SGM_BC_CYN:
00851         case ANSI_SGM_BC_WHT:
00852             _in->insert(pos, std::string("") +
00853                 CCTCP2 + bgColorMap[_seq->param(i) - 40] + CCTCP2);
00854             pos += 5;       // consume the additions
00855             break;
00856
00857         case ANSI_SGM_BC_DEFAULT:
00858             _in->insert(pos, std::string("") + CCTCP2 + "C-." + CCTCP2);
00859             pos += 5;       // consume the additions
00860             break;
00861
00862         }
00863     }
00864 }

Member Data Documentation

std::string* ansiAttrCvt::_in [private]

Definition at line 74 of file CTCP2Parse.hpp.

Referenced by ansi2ctcp, do_C, and do_m.

AnsiSeq* ansiAttrCvt::_seq [private]

Definition at line 94 of file CTCP2Parse.hpp.

Referenced by ansi2ctcp, do_C, and do_m.

const char * ansiAttrCvt::bgColorMap [static, private]

Initial value:

 {
    "C-0",
    "C-4",
    "C-2",
    "C-6",
    "C-1",
    "C-5",
    "C-3",
    "C-7"
}

Definition at line 699 of file CTCP2Parse.cpp.

Referenced by do_m.

int ansiAttrCvt::blink [private]

Definition at line 72 of file CTCP2Parse.hpp.

Referenced by ansi2ctcp, and do_m.

int ansiAttrCvt::bold [private]

Definition at line 72 of file CTCP2Parse.hpp.

Referenced by ansi2ctcp, and do_m.

const char * ansiAttrCvt::escSeq = "\033\133" [static, private]

Definition at line 633 of file CTCP2Parse.cpp.

Referenced by ansi2ctcp.

const char * ansiAttrCvt::fgColorMap [static, private]

Initial value:

 {
    "C0-",
    "C4-",
    "C2-",
    "C6-",
    "C1-",
    "C5-",
    "C3-",
    "C7-",
    "C8-",
    "CC-",
    "CA-",
    "CE-",
    "C9-",
    "CD-",
    "CB-",
    "CF-"
}

Definition at line 680 of file CTCP2Parse.cpp.

Referenced by do_m.

int ansiAttrCvt::italic [private]

Definition at line 72 of file CTCP2Parse.hpp.

Referenced by ansi2ctcp, and do_m.

int ansiAttrCvt::pos [private]

Definition at line 71 of file CTCP2Parse.hpp.

Referenced by ansi2ctcp, do_C, and do_m.

int ansiAttrCvt::reverse [private]

Definition at line 72 of file CTCP2Parse.hpp.

Referenced by ansi2ctcp, and do_m.

int ansiAttrCvt::underline [private]

Definition at line 72 of file CTCP2Parse.hpp.

Referenced by ansi2ctcp, and do_m.

The documentation for this class was generated from the following files:
  • common/CTCP2Parse.hpp
  • common/CTCP2Parse.cpp
Generated on Sun Feb 24 01:24:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ansiAttrCvt::AnsiSeq Class Reference

Collaboration diagram for ansiAttrCvt::AnsiSeq:

[legend]
List of all members.

Public Methods

AnsiSeq (std::string *in, int pos)
~AnsiSeq ()
char | verb ()
const char * | seq ()
int | paramc ()
int | param (int index)

Private Attributes

std::string * | _seq
std::vector< int > | _params
char | _verb

Static Private Attributes

const char * | _notOf = "1234567890=;"

Constructor & Destructor Documentation

ansiAttrCvt::AnsiSeq::AnsiSeq | ( | std::string * | in,
 |  | int | pos
 | ) |

Definition at line 555 of file CTCP2Parse.cpp.

References _notOf, _params, _seq, _verb, and INVALID_SEQUENCE.

00556     : _seq(0), _verb(0)
00557 {
00558     int verbPos;
00559     int seqLen;
00560     int pos1, pos2;
00561
00562     verbPos = in->find_first_not_of(_notOf, pos + 2);
00563
00564     if (verbPos == std::string::npos || in->at(verbPos) == '\033')
00565     {
00566         _verb = INVALID_SEQUENCE;
00567         in->replace(pos, 2, "");
00568         return;
00569     }
00570
00571     seqLen = verbPos - pos - 1;
00572
00573     // get a copy of the ansi sequence without the "esc["
00574     _seq = new std::string(in->substr(pos + 2, seqLen));
00575
00576     // remove it from the original, now that we have the needed info
00577     in->replace(pos, verbPos - pos + 1, "");
00578
00579     // set the verb
00580     _verb = _seq->at(seqLen - 1);
00581
00582     for (pos1 = 0, pos2 = 0; pos2 < seqLen; pos2++)
00583     {
00584         if (_seq->at(pos2) != ';' && pos2 < (seqLen - 1)) continue;
00585         _params.push_back(atoi(_seq->substr(pos1, pos2 - pos1).c_str()));
00586         pos1 = pos2 + 1;
00587     }
00588
00589 }

ansiAttrCvt::AnsiSeq::~AnsiSeq ( )

Definition at line 592 of file CTCP2Parse.cpp.

References _seq.

00593 {
00594     if (_seq) delete _seq;
00595 }

Member Function Documentation

int ansiAttrCvt::AnsiSeq::param ( int index ) [inline]

Definition at line 91 of file CTCP2Parse.hpp.

Referenced by ansiAttrCvt::do_C, and ansiAttrCvt::do_m.

00091 { return _params[index]; }

int ansiAttrCvt::AnsiSeq::paramc ( ) [inline]

Definition at line 90 of file CTCP2Parse.hpp.

Referenced by ansiAttrCvt::do_C, and ansiAttrCvt::do_m.

00090 { return _params.size(); }

const char* ansiAttrCvt::AnsiSeq::seq ( ) [inline]

Definition at line 89 of file CTCP2Parse.hpp.

References _seq.

Referenced by ansiAttrCvt::ansi2ctcp.

00089 { return _seq->c_str(); }

char ansiAttrCvt::AnsiSeq::verb ( ) [inline]

Definition at line 88 of file CTCP2Parse.hpp.

References _verb.

Referenced by ansiAttrCvt::ansi2ctcp.

00088 { return _verb; }

Member Data Documentation

const char * ansiAttrCvt::AnsiSeq::_notOf = "1234567890=;" [static, private]

Definition at line 553 of file CTCP2Parse.cpp.

Referenced by AnsiSeq.

std::vector<int> ansiAttrCvt::AnsiSeq::_params [private]

Definition at line 80 of file CTCP2Parse.hpp.

Referenced by AnsiSeq.

std::string* ansiAttrCvt::AnsiSeq::_seq [private]

Definition at line 79 of file CTCP2Parse.hpp.

Referenced by AnsiSeq, seq, and ~AnsiSeq.

char ansiAttrCvt::AnsiSeq::_verb [private]

Definition at line 81 of file CTCP2Parse.hpp.

Referenced by AnsiSeq, and verb.

The documentation for this class was generated from the following files:
  • common/CTCP2Parse.hpp
  • common/CTCP2Parse.cpp
Generated on Sun Feb 24 01:24:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AREF Struct Reference

Collaboration diagram for AREF:

[legend]
List of all members.

Public Attributes

int | cnt
HBITMAP | bitmap

Member Data Documentation

HBITMAP AREF::bitmap

Definition at line 95 of file utoolbar.cpp.

Referenced by aref::aref, aref::operator HBITMAP, and aref::UnRef.

int AREF::cnt

Definition at line 94 of file utoolbar.cpp.

Referenced by aref::aref, aref::Ref, and aref::UnRef.

The documentation for this struct was generated from the following file:
  • rf/utoolbar.cpp
Generated on Sun Feb 24 01:24:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


aref Class Reference

Collaboration diagram for aref:

[legend]
List of all members.

Public Methods

aref ()
aref (HBITMAP b)
aref (const aref &src)
virtual | ~aref ()
AREF * | Ref (void) const
AREF * | UnRef (void) const
aref & | operator= (const aref &src)
operator HBITMAP ()

Protected Attributes

AREF * ref

Constructor & Destructor Documentation

aref::aref ( ) [inline]

Definition at line 101 of file utoolbar.cpp.

References ref.

00101            : ref(0L)
00102     {
00103     }

aref::aref ( HBITMAP b ) [inline]

Definition at line 104 of file utoolbar.cpp.

References AREF::bitmap, AREF::cnt, NEW, and ref.

00105     {
00106         ref = NEW AREF;
00107         ref->cnt = 1;
00108         ref->bitmap = b;
00109     }

aref::aref ( const aref & src ) [inline]

Definition at line 110 of file utoolbar.cpp.

References Ref, and ref.

00111     {
00112         ref = src.Ref();
00113     }

virtual aref::~aref ( ) [inline, virtual]

Definition at line 114 of file utoolbar.cpp.

References UnRef.

00115     {
00116         UnRef();
00117     }

Member Function Documentation

aref::operator HBITMAP ( ) [inline]

Definition at line 143 of file utoolbar.cpp.

References AREF::bitmap, and ref.

00144     {
00145         return ref != 0L ? ref->bitmap : 0L;
00146     }

aref& aref::operator= ( const aref & src ) [inline]

Definition at line 137 of file utoolbar.cpp.

References Ref, ref, and UnRef.

00138     {
00139         UnRef();
00140         ref = src.Ref();
00141         return *this;
00142     }

AREF* aref::Ref ( void ) const [inline]

Definition at line 118 of file utoolbar.cpp.

References AREF::cnt, and ref.

Referenced by aref, and operator=.

00119     {
00120         if(ref != 0L)
00121             ref->cnt++;
00122         return ref;
00123     }

AREF* aref::UnRef ( void ) const [inline]

Definition at line 124 of file utoolbar.cpp.

References AREF::bitmap, AREF::cnt, and ref.

Referenced by operator=, and ~aref.

00125     {
00126         if(ref != 0L && --ref->cnt == 0)
00127         {
00128 #ifdef WIN32
00129             if(ref->bitmap != 0L)
00130                 ::DeleteObject(ref->bitmap);
00131 #endif
00132             delete ref;
00133             ((aref *)this)->ref = 0L;
00134         }
00135         return ref;
00136     }

Member Data Documentation

AREF* aref::ref [protected]

Definition at line 148 of file utoolbar.cpp.

Referenced by aref, operator HBITMAP, operator=, Ref, and UnRef.

The documentation for this class was generated from the following file:
  • rf/utoolbar.cpp
Generated on Sun Feb 24 01:24:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CAskYesNo Class Reference

#include <AskYesNo.h>

Inheritance diagram for CAskYesNo:

[legend]
Collaboration diagram for CAskYesNo:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_YESNO }

Public Methods

CAskYesNo (CWnd *pParent=NULL)

Public Attributes

CString | m_passwd

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 56 of file AskYesNo.h.

00056 { IDD = IDD_YESNO };

Constructor & Destructor Documentation

CAskYesNo::CAskYesNo ( CWnd * pParent = NULL )

Definition at line 55 of file AskYesNo.cpp.

00056     : CDialog(CAskYesNo::IDD, pParent)
00057 {
00058     //{{AFX_DATA_INIT(CAskYesNo)
00059     //}}AFX_DATA_INIT
00060 }

Member Function Documentation

void CAskYesNo::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 63 of file AskYesNo.cpp.

00064 {
00065     CDialog::DoDataExchange(pDX);
00066     //{{AFX_DATA_MAP(CAskYesNo)
00067     //}}AFX_DATA_MAP
00068 }

Member Data Documentation

CString CAskYesNo::m_passwd

Definition at line 57 of file AskYesNo.h.

The documentation for this class was generated from the following files:
  • common/AskYesNo.h
  • common/AskYesNo.cpp
Generated on Sun Feb 24 01:24:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Authen Class Reference

Authentication class. More...

#include "common/Authen.h"

List of all members.

Public Methods

Authen ()
AuthenKind | kind (void)
const char * | kindstr (void)
void | setkind (AuthenKind newkind)
const char * | token (void)

Static Public Methods

const char * | kindToToken (AuthenKind k)
AuthenKind | tokenToKind (const char *t)
short | kindToNum (AuthenKind k)
AuthenKind | numToKind (short num)
bool | parse_cvsroot (const char *CVSroot, UStr &theMethod, UStr &theUser, UStr &theHost, UStr &thePath)
const char * | token (AuthenKind k)
const char * | skiptoken (const char *cvsroot)

Detailed Description

Authentication class.

Definition at line 46 of file Authen.h.

Constructor & Destructor Documentation

Authen::Authen ( ) [inline]

Definition at line 49 of file Authen.h.

00049 {}

Member Function Documentation

AuthenKind Authen::kind ( void )

Definition at line 69 of file Authen.cpp.

References AuthenKind.

Referenced by kindstr, kindToNum, kindToToken, and token.

00070 {
00071     return gAuthenKind;
00072 }

const char * Authen::kindstr ( void )

Definition at line 79 of file Authen.cpp.

References CStr, gserver, kind, kserver, local, ntserver, pserver, rhosts, and ssh.

00080 {
00081     static CStr res;
00082
00083     switch( kind() )
00084     {
00085     default:
00086     case rhosts:
00087         res = ".rhosts authentication";
00088         break;
00089     case pserver:
00090         res = "password authentication";
00091         break;
00092     case kserver:
00093         res = "kerberos authentication";
00094         break;
00095     case local:
00096         res = "local mounted directory";
00097         break;
00098     case ssh:
00099         res = "ssh authentication";
00100         break;
00101     case ntserver:
00102         res = "NT server services";
00103         break;
00104     case gserver:
00105         res = "GSSAPI authentication";
00106         break;
00107     }
00108
00109     if( kind() == pserver && gCvsPrefs.UseProxy() )
00110     {
00111         res << " using a proxy";
00112     }
00113
00114     return res;
00115 }

short Authen::kindToNum ( AuthenKind k ) [static]

Definition at line 191 of file Authen.cpp.

References AuthenKind, AuthenModel::GetAllInstances, AuthenModel::GetKind, and kind.

Referenced by CGetPrefs_CVSROOT::DoDataExchange.

00192 {
00193     std::vector<AuthenModel *> & allInstances = AuthenModel::GetAllInstances();
00194     std::vector<AuthenModel *>::const_iterator i;
00195     int cnt = 0;
00196     for(i = allInstances.begin(); i != allInstances.end(); ++i, cnt++)
00197     {
00198         AuthenModel *model = *i;
00199         if(model->GetKind() == kind)
00200             return cnt;
00201     }
00202
00203     return 0;
00204 }

const char * Authen::kindToToken ( AuthenKind k ) [static]

Definition at line 170 of file Authen.cpp.

References AuthenKind, AuthenModel::GetInstance, AuthenModel::GetToken, and kind.

Referenced by CPersistent::SaveAllSettings.

00171 {
00172     AuthenModel *model = AuthenModel::GetInstance(kind);
00173     return model->GetToken();
00174 }

AuthenKind Authen::numToKind ( short num ) [static]

Definition at line 206 of file Authen.cpp.

References AuthenKind, AuthenModel::GetAllInstances, AuthenModel::GetKind, and local.

Referenced by CGetPrefs_CVSROOT::OnSelchangeAuthen.

00207 {
00208     std::vector<AuthenModel *> & allInstances = AuthenModel::GetAllInstances();
00209     std::vector<AuthenModel *>::const_iterator i;
00210     int cnt = 0;
00211     for(i = allInstances.begin(); i != allInstances.end(); ++i, cnt++)
00212     {
00213         AuthenModel *model = *i;
00214         if(cnt == num)
00215             return model->GetKind();
00216     }
00217
00218     return local;
00219 }

bool Authen::parse_cvsroot | ( | const char * | CVSroot,
 |  | UStr & | theMethod,
 |  | UStr & | theUser,
 |  | UStr & | theHost,
 |  | UStr & | thePath
 | ) | [static]

Definition at line 221 of file Authen.cpp.

References NULL.

Referenced by CGetPrefs_CVSROOT::FillFields.

00222 {
00223     char *p;
00224     UStr copyroot(CVSroot);
00225     char *cvsroot_copy = copyroot;
00226
00227     theMethod = "";
00228     theUser = "";
00229     theHost = "";
00230     thePath = "";
00231
00232     if (*cvsroot_copy == ':')
00233     {
00234         char *method = ++cvsroot_copy;
00235         bool have_semicolon;
00236
00237         /* Access method specified, as in
00238         * "cvs -d :pserver:user@host:/path",
00239         * "cvs -d :local:e:\path",
00240         * "cvs -d :kserver:user@host:/path", or
00241         * "cvs -d :fork:/path".
00242         * We need to get past that part of CVSroot before parsing the
00243         * rest of it.
00244         */
00245
00246         if (! (p = strchr (method, ':')))
00247             return false;
00248
00249         p = strpbrk (method, ":;#");
00250         if (p == 0L)
00251             return false;
00252
00253         have_semicolon = (*p == ';' || *p == '#');
00254         *p = '\0';
00255         cvsroot_copy = ++p;
00256
00257         theMethod = method;
00258
00259         while (have_semicolon)
00260         {
00261             /* More elaborate implementation would allow multiple
00262             semicolons, for example:
00263
00264             :server;rsh=34;command=cvs-1.6:
00265
00266             we will allow
00267             :server;port=22;proxy=www-proxy;proxyport=8080:
00268
00269             we will also allow # as well as ; as a separator to
00270             avoid having to quote the root in a shell.
00271             */
00272             /* FIXME: lots of error conditions should be better handled,
00273             e.g. garbage after the number or no valid number.
00274
00275             Would be nice to have testcases for some of these cases
00276             including the error cases.  */
00277             p = strpbrk (cvsroot_copy, ":;#");
00278             if (p == NULL)
00279                 return false;
00280
00281             /* pick up more options if we have them */
00282             have_semicolon = (*p == ';' || *p == '#');
00283             *p = '\0';
00284
00285             cvsroot_copy = ++p;
00286         }
00287     }
00288
00289     if (theMethod != "local")
00290     {
00291         /* Check to see if there is a username in the string. */
00292
00293         if ((p = strchr (cvsroot_copy, '@')) != NULL)
00294         {
00295             *p = '\0';
00296             theUser = cvsroot_copy;
00297             cvsroot_copy = ++p;
00298         }
00299
00300         if ((p = strchr (cvsroot_copy, ':')) != NULL)
00301         {
00302             *p = '\0';
00303             theHost = cvsroot_copy;
00304             cvsroot_copy = ++p;
00305         }
00306     }
00307
00308     thePath = cvsroot_copy;
00309
00310     return true;
00311 }

void Authen::setkind ( AuthenKind newkind )

Definition at line 74 of file Authen.cpp.

References AuthenKind.

00075 {
00076     gAuthenKind = newkind;
00077 }

const char * Authen::skiptoken ( const char * cvsroot ) [static]

Definition at line 162 of file Authen.cpp.

References NULL.

Referenced by CvsCmdCheckoutModule, CvsCmdInit, CGetPrefs_CVSROOT::FillFields, glue_getenv, and CvsArgs::reset.

00163 {
00164     const char *secondColon;
00165     if(cvsroot[0] != ':' || (secondColon = strchr(cvsroot + 1, ':')) == NULL)
00166         return cvsroot;
00167     return secondColon + 1;
00168 }

const char * Authen::token ( AuthenKind k ) [static]

Definition at line 122 of file Authen.cpp.

References AuthenKind, CStr, gserver, kserver, local, ntserver, pserver, rhosts, and ssh.

00123 {
00124     static CStr res;
00125
00126     switch( kind )
00127     {
00128     default :
00129     case rhosts:
00130         res = "";
00131         break;
00132     case pserver :
00133         res = ":pserver";
00134         if(gCvsPrefs.UseProxy())
00135         {
00136             res << ";proxy=";
00137             res << gCvsPrefs.ProxyHost();
00138             res << ";proxyport=";
00139             res << gCvsPrefs.ProxyPort();
00140         }
00141         res << ':';
00142         break;
00143     case kserver:
00144         res = ":kserver:";
00145         break;
00146     case local:
00147         res = ":local:";
00148         break;
00149     case ssh: res = ":ext:";
00150         break;
00151     case ntserver:
00152         res = ":ntserver:";
00153         break;
00154     case gserver:
00155         res = ":gserver:";
00156         break;
00157     }
00158
00159     return res;
00160 }

const char * Authen::token ( void )

Definition at line 117 of file Authen.cpp.

References kind.

Referenced by CGetPrefs_CVSROOT::FillFields, and tokenToKind.

00118 {
00119     return Authen::token(kind());
00120 }

AuthenKind Authen::tokenToKind ( const char * t ) [static]

Definition at line 176 of file Authen.cpp.

References AuthenKind, cvs_err, AuthenModel::GetAllInstances, AuthenModel::GetKind, AuthenModel::GetToken, local, and token.

Referenced by _loadPersistentSettings.

00177 {
00178     std::vector<AuthenModel *> & allInstances = AuthenModel::GetAllInstances();
00179     std::vector<AuthenModel *>::const_iterator i;
00180     for(i = allInstances.begin(); i != allInstances.end(); ++i)
00181     {
00182         AuthenModel *model = *i;
00183         if(strcmp(model->GetToken(), token) == 0)
00184             return model->GetKind();
00185     }
00186
00187     cvs_err("Unknown authentication kind '%s'\n", token);
00188     return local;
00189 }

The documentation for this class was generated from the following files:
  • common/Authen.h
  • common/Authen.cpp
Generated on Sun Feb 24 01:24:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UAuthen_Gserver Class Reference

Inheritance diagram for UAuthen_Gserver:

[legend]
Collaboration diagram for UAuthen_Gserver:

[legend]
List of all members.

Public Types

enum {
kOK = EV_COMMAND_START,
kCancel,
kCheckEncrypt
}

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UAuthen_Gserver ()
virtual | ~UAuthen_Gserver ()
virtual void | DoDataExchange (bool fill)
while modaling, allows to fill/read the dialog content.
  • fill says if it expects to fill or read the dialog content.
 More...

Static Public Methods

const URuntimeClass * | rtUAuthen_Gserver (void)

Protected Methods

virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Static Protected Attributes

const URuntimeClass | classUAuthen_Gserver
const UMSGMAP | messageMap = { UWidget ::GetThisMessageMap(), & UAuthen_Gserver ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Member Enumeration Documentation

anonymous enum

Enumeration values:
kOK
kCancel
kCheckEncrypt

Definition at line 1559 of file Authen.cpp.

01560     {
01561         kOK = EV_COMMAND_START, // 0
01562         kCancel,                // 1
01563         kCheckEncrypt           // 2
01564     };

Constructor & Destructor Documentation

UAuthen_Gserver::UAuthen_Gserver ( )

Definition at line 1577 of file Authen.cpp.

01577                                  : UWidget(::UEventGetWidID())
01578 {
01579 }

virtual UAuthen_Gserver::~UAuthen_Gserver ( ) [inline, virtual]

Definition at line 1557 of file Authen.cpp.

01557 {}

Member Function Documentation

const URuntimeClass * UAuthen_Gserver::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1572 of file Authen.cpp.

void UAuthen_Gserver::DoDataExchange ( bool fill ) [virtual]

while modaling, allows to fill/read the dialog content.

  • fill says if it expects to fill or read the dialog content.

Reimplemented from UWidget.

Definition at line 1582 of file Authen.cpp.

References EV_QUERYSTATE, EV_SETSTATE, UCmdTarget::GetWidID, kCheckEncrypt, UEventSendMessage, and UMAKEINT.

01583 {
01584     if( fill )
01585     {
01586         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckEncrypt, gCvsPrefs.EncryptCommunication()), 0L);
01587     }
01588     else
01589     {
01590         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckEncrypt, 0L);
01591         gCvsPrefs.SetEncryptCommunication(state);
01592     }
01593 }

const UMSGMAP * UAuthen_Gserver::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1574 of file Authen.cpp.

const UMSGMAP * UAuthen_Gserver::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 1574 of file Authen.cpp.

const URuntimeClass * UAuthen_Gserver::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 1572 of file Authen.cpp.

const UMSGMAP * UAuthen_Gserver::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1574 of file Authen.cpp.

const URuntimeClass * UAuthen_Gserver::rtUAuthen_Gserver ( void ) [static]

Definition at line 1572 of file Authen.cpp.

Member Data Documentation

const UMSGMAP_ENTRY UAuthen_Gserver::_messageEntries [static, private]

Initial value:

   {
{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }   }

Reimplemented from UWidget.

Definition at line 1574 of file Authen.cpp.

const URuntimeClass UAuthen_Gserver::classUAuthen_Gserver [static, protected]

const UMSGMAP UAuthen_Gserver::messageMap = { UWidget ::GetThisMessageMap(), & UAuthen_Gserver ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Definition at line 1574 of file Authen.cpp.

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Sun Feb 24 01:24:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UAuthen_Kserver Class Reference

Inheritance diagram for UAuthen_Kserver:

[legend]
Collaboration diagram for UAuthen_Kserver:

[legend]
List of all members.

Public Types

enum {
kOK = EV_COMMAND_START,
kCancel,
kCheckPort,
kEditPort
}

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UAuthen_Kserver ()
virtual | ~UAuthen_Kserver ()
virtual void | DoDataExchange (bool fill)
while modaling, allows to fill/read the dialog content.
  • fill says if it expects to fill or read the dialog content.
 More...

Static Public Methods

const URuntimeClass * | rtUAuthen_Kserver (void)

Protected Methods

int | OnCheckPort (void)
virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Protected Attributes

int | m_port

Static Protected Attributes

const URuntimeClass | classUAuthen_Kserver
const UMSGMAP | messageMap = { UWidget ::GetThisMessageMap(), & UAuthen_Kserver ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Member Enumeration Documentation

anonymous enum

Enumeration values:
kOK
kCancel
kCheckPort
kEditPort

Definition at line 1417 of file Authen.cpp.

01418     {
01419         kOK = EV_COMMAND_START, // 0
01420         kCancel,            // 1
01421         kCheckPort,         // 2
01422         kEditPort           // 3
01423     };

Constructor & Destructor Documentation

UAuthen_Kserver::UAuthen_Kserver ( )

Definition at line 1441 of file Authen.cpp.

01441                                  : UWidget(::UEventGetWidID())
01442 {
01443 }

virtual UAuthen_Kserver::~UAuthen_Kserver ( ) [inline, virtual]

Definition at line 1415 of file Authen.cpp.

01415 {}

Member Function Documentation

const URuntimeClass * UAuthen_Kserver::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1435 of file Authen.cpp.

void UAuthen_Kserver::DoDataExchange ( bool fill ) [virtual]

while modaling, allows to fill/read the dialog content.

  • fill says if it expects to fill or read the dialog content.

Reimplemented from UWidget.

Definition at line 1453 of file Authen.cpp.

References EV_ENABLECMD, EV_GETINTEGER, EV_QUERYSTATE, EV_SETINTEGER, EV_SETSTATE, UCmdTarget::GetWidID, kCheckPort, kEditPort, m_port, UEventSendMessage, and UMAKEINT.

01454 {
01455     if(fill)
01456     {
01457         m_port = gCvsPrefs.KserverPort();
01458
01459         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, m_port != -1), 0L);
01460         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kEditPort, m_port == -1 ? 0 : m_port), 0L);
01461         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckPort, m_port != -1), 0L);
01462     }
01463     else
01464     {
01465         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01466         int value = UEventSendMessage(GetWidID(), EV_GETINTEGER, kEditPort, 0L);
01467         gCvsPrefs.SetKserverPort(state ? value : -1);
01468     }
01469 }

const UMSGMAP * UAuthen_Kserver::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1437 of file Authen.cpp.

const UMSGMAP * UAuthen_Kserver::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 1437 of file Authen.cpp.

const URuntimeClass * UAuthen_Kserver::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 1435 of file Authen.cpp.

const UMSGMAP * UAuthen_Kserver::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1437 of file Authen.cpp.

int UAuthen_Kserver::OnCheckPort ( void ) [protected]

Definition at line 1445 of file Authen.cpp.

References EV_ENABLECMD, EV_QUERYSTATE, UCmdTarget::GetWidID, kCheckPort, kEditPort, UEventSendMessage, and UMAKEINT.

01446 {
01447     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01448     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, state), 0L);
01449
01450     return 0;
01451 }

const URuntimeClass * UAuthen_Kserver::rtUAuthen_Kserver ( void ) [static]

Definition at line 1435 of file Authen.cpp.

Member Data Documentation

const UMSGMAP_ENTRY UAuthen_Kserver::_messageEntries [static, private]

Initial value:

   {
    { EV_CMD, epi_V, UMSG_RANGE,  kCheckPort ,  kCheckPort ,   (UPMSG)(int (UCmdTarget::*)(void))& UAuthen_Kserver::OnCheckPort  },
{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }   }

Reimplemented from UWidget.

Definition at line 1437 of file Authen.cpp.

const URuntimeClass UAuthen_Kserver::classUAuthen_Kserver [static, protected]

int UAuthen_Kserver::m_port [protected]

Definition at line 1428 of file Authen.cpp.

Referenced by DoDataExchange.

const UMSGMAP UAuthen_Kserver::messageMap = { UWidget ::GetThisMessageMap(), & UAuthen_Kserver ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Definition at line 1437 of file Authen.cpp.

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Sun Feb 24 01:24:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UAuthen_Pserver Class Reference

Inheritance diagram for UAuthen_Pserver:

[legend]
Collaboration diagram for UAuthen_Pserver:

[legend]
List of all members.

Public Types

enum {
kOK = EV_COMMAND_START,
kCancel,
kCheckPort,
kEditPort,
kCheckProxy,
kNameProxy,
kEditProxy
}

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UAuthen_Pserver ()
virtual | ~UAuthen_Pserver ()
virtual void | DoDataExchange (bool fill)
while modaling, allows to fill/read the dialog content.
  • fill says if it expects to fill or read the dialog content.
 More...

Static Public Methods

const URuntimeClass * | rtUAuthen_Pserver (void)

Protected Methods

int | OnCheckPort (void)
int | OnCheckProxy (void)
virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Protected Attributes

int | m_port
int | m_pport
UStr m_pname

Static Protected Attributes

const URuntimeClass | classUAuthen_Pserver
const UMSGMAP | messageMap = { UWidget ::GetThisMessageMap(), & UAuthen_Pserver ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Member Enumeration Documentation

anonymous enum

Enumeration values:
kOK
kCancel
kCheckPort
kEditPort
kCheckProxy
kNameProxy
kEditProxy

Definition at line 1008 of file Authen.cpp.

01009     {
01010         kOK = EV_COMMAND_START, // 0
01011         kCancel,            // 1
01012         kCheckPort,         // 2
01013         kEditPort,          // 3
01014         kCheckProxy,        // 4
01015         kNameProxy,         // 5
01016         kEditProxy          // 6
01017     };

Constructor & Destructor Documentation

UAuthen_Pserver::UAuthen_Pserver ( )

Definition at line 1039 of file Authen.cpp.

01039                                  : UWidget(::UEventGetWidID())
01040 {
01041 }

virtual UAuthen_Pserver::~UAuthen_Pserver ( ) [inline, virtual]

Definition at line 1006 of file Authen.cpp.

01006 {}

Member Function Documentation

const URuntimeClass * UAuthen_Pserver::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1032 of file Authen.cpp.

void UAuthen_Pserver::DoDataExchange ( bool fill ) [virtual]

while modaling, allows to fill/read the dialog content.

  • fill says if it expects to fill or read the dialog content.

Reimplemented from UWidget.

Definition at line 1060 of file Authen.cpp.

References EV_ENABLECMD, EV_GETINTEGER, EV_GETTEXT, EV_QUERYSTATE, EV_SETINTEGER, EV_SETSTATE, EV_SETTEXT, UCmdTarget::GetWidID, kCheckPort, kCheckProxy, kEditPort, kEditProxy, kNameProxy, m_pname, m_port, m_pport, UEventSendMessage, and UMAKEINT.

01061 {
01062     if(fill)
01063     {
01064         m_port = gCvsPrefs.PserverPort();
01065
01066         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, m_port != -1), 0L);
01067         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kEditPort, m_port == -1 ? 2401 : m_port), 0L);
01068         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckPort, m_port != -1), 0L);
01069
01070         m_pport = gCvsPrefs.ProxyPort();
01071         m_pname = gCvsPrefs.ProxyHost();
01072         bool useProxy = gCvsPrefs.UseProxy();
01073         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditProxy, useProxy), 0L);
01074         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kNameProxy, useProxy), 0L);
01075         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kEditProxy, m_pport), 0L);
01076         UEventSendMessage(GetWidID(), EV_SETTEXT, kNameProxy, (void *)(const char *)m_pname);
01077         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckProxy, useProxy), 0L);
01078     }
01079     else
01080     {
01081         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01082         int value = UEventSendMessage(GetWidID(), EV_GETINTEGER, kEditPort, 0L);
01083         gCvsPrefs.SetPserverPort(state ? value : -1);
01084
01085         state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckProxy, 0L);
01086         value = UEventSendMessage(GetWidID(), EV_GETINTEGER, kEditProxy, 0L);
01087         UEventSendMessage(GetWidID(), EV_GETTEXT, kNameProxy, &m_pname);
01088         gCvsPrefs.SetUseProxy(state != 0);
01089         if(state != 0)
01090         {
01091             gCvsPrefs.SetProxyHost(m_pname);
01092             gCvsPrefs.SetProxyPort(value);
01093         }
01094     }
01095 }

const UMSGMAP * UAuthen_Pserver::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1034 of file Authen.cpp.

const UMSGMAP * UAuthen_Pserver::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 1034 of file Authen.cpp.

const URuntimeClass * UAuthen_Pserver::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 1032 of file Authen.cpp.

const UMSGMAP * UAuthen_Pserver::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1034 of file Authen.cpp.

int UAuthen_Pserver::OnCheckPort ( void ) [protected]

Definition at line 1043 of file Authen.cpp.

References EV_ENABLECMD, EV_QUERYSTATE, UCmdTarget::GetWidID, kCheckPort, kEditPort, UEventSendMessage, and UMAKEINT.

01044 {
01045     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01046     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, state), 0L);
01047
01048     return 0;
01049 }

int UAuthen_Pserver::OnCheckProxy ( void ) [protected]

Definition at line 1051 of file Authen.cpp.

References EV_ENABLECMD, EV_QUERYSTATE, UCmdTarget::GetWidID, kCheckProxy, kEditProxy, kNameProxy, UEventSendMessage, and UMAKEINT.

01052 {
01053     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckProxy, 0L);
01054     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kNameProxy, state), 0L);
01055     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditProxy, state), 0L);
01056
01057     return 0;
01058 }

const URuntimeClass * UAuthen_Pserver::rtUAuthen_Pserver ( void ) [static]

Definition at line 1032 of file Authen.cpp.

Member Data Documentation

const UMSGMAP_ENTRY UAuthen_Pserver::_messageEntries [static, private]

Initial value:

   {
    { EV_CMD, epi_V, UMSG_RANGE,  kCheckPort ,  kCheckPort ,   (UPMSG)(int (UCmdTarget::*)(void))& UAuthen_Pserver::OnCheckPort  },
    { EV_CMD, epi_V, UMSG_RANGE,  kCheckProxy ,  kCheckProxy ,   (UPMSG)(int (UCmdTarget::*)(void))& UAuthen_Pserver::OnCheckProxy  },
{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }   }

Reimplemented from UWidget.

Definition at line 1034 of file Authen.cpp.

const URuntimeClass UAuthen_Pserver::classUAuthen_Pserver [static, protected]

UStr UAuthen_Pserver::m_pname [protected]

Definition at line 1024 of file Authen.cpp.

Referenced by DoDataExchange.

int UAuthen_Pserver::m_port [protected]

Definition at line 1022 of file Authen.cpp.

Referenced by DoDataExchange.

int UAuthen_Pserver::m_pport [protected]

Definition at line 1023 of file Authen.cpp.

Referenced by DoDataExchange.

const UMSGMAP UAuthen_Pserver::messageMap = { UWidget ::GetThisMessageMap(), & UAuthen_Pserver ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Definition at line 1034 of file Authen.cpp.

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Sun Feb 24 01:24:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UAuthen_Rhosts Class Reference

Inheritance diagram for UAuthen_Rhosts:

[legend]
Collaboration diagram for UAuthen_Rhosts:

[legend]
List of all members.

Public Types

enum {
kOK = EV_COMMAND_START,
kCancel,
kCheckPort,
kEditPort,
kCheckRSHName,
kEditRSHName,
kCheckServerName,
kEditServerName
}

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UAuthen_Rhosts ()
virtual | ~UAuthen_Rhosts ()
virtual void | DoDataExchange (bool fill)
while modaling, allows to fill/read the dialog content.
  • fill says if it expects to fill or read the dialog content.
 More...

Static Public Methods

const URuntimeClass * | rtUAuthen_Rhosts (void)

Protected Methods

int | OnCheckPort (void)
int | OnCheckRshName (void)
int | OnCheckServerName (void)
virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Protected Attributes

int | m_port
UStr m_rshname
UStr m_servername

Static Protected Attributes

const URuntimeClass | classUAuthen_Rhosts
const UMSGMAP | messageMap = { UWidget ::GetThisMessageMap(), & UAuthen_Rhosts ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Member Enumeration Documentation

anonymous enum

Enumeration values:
kOK
kCancel
kCheckPort
kEditPort
kCheckRSHName
kEditRSHName
kCheckServerName
kEditServerName

Definition at line 1197 of file Authen.cpp.

01198     {
01199         kOK = EV_COMMAND_START, // 0
01200         kCancel,            // 1
01201         kCheckPort,         // 2
01202         kEditPort,          // 3
01203         kCheckRSHName,      // 4
01204         kEditRSHName,       // 5
01205         kCheckServerName,   // 6
01206         kEditServerName     // 7
01207     };

Constructor & Destructor Documentation

UAuthen_Rhosts::UAuthen_Rhosts ( )

Definition at line 1231 of file Authen.cpp.

01231                                : UWidget(::UEventGetWidID())
01232 {
01233 }

virtual UAuthen_Rhosts::~UAuthen_Rhosts ( ) [inline, virtual]

Definition at line 1195 of file Authen.cpp.

01195 {}

Member Function Documentation

const URuntimeClass * UAuthen_Rhosts::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1223 of file Authen.cpp.

void UAuthen_Rhosts::DoDataExchange ( bool fill ) [virtual]

while modaling, allows to fill/read the dialog content.

  • fill says if it expects to fill or read the dialog content.

Reimplemented from UWidget.

Definition at line 1259 of file Authen.cpp.

References UStr::c_str, UStr::empty, EV_ENABLECMD, EV_GETINTEGER, EV_GETTEXT, EV_QUERYSTATE, EV_SETINTEGER, EV_SETSTATE, EV_SETTEXT, UCmdTarget::GetWidID, kCheckPort, kCheckRSHName, kCheckServerName, kEditPort, kEditRSHName, kEditServerName, m_port, m_rshname, m_servername, UEventSendMessage, and UMAKEINT.

01260 {
01261     if(fill)
01262     {
01263         m_port = gCvsPrefs.RhostPort();
01264         m_rshname = gCvsPrefs.RshName();
01265         m_servername = gCvsPrefs.ServerName();
01266
01267         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, m_port != -1), 0L);
01268         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kEditPort, m_port == -1 ? 0 : m_port), 0L);
01269         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckPort, m_port != -1), 0L);
01270
01271         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditRSHName, !m_rshname.empty()), 0L);
01272         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditRSHName, (void *)m_rshname.c_str());
01273         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRSHName, !m_rshname.empty()), 0L);
01274
01275         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditServerName, !m_servername.empty()), 0L);
01276         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditServerName, (void *)m_servername.c_str());
01277         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckServerName, !m_servername.empty()), 0L);
01278     }
01279     else
01280     {
01281         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01282         int value = UEventSendMessage(GetWidID(), EV_GETINTEGER, kEditPort, 0L);
01283         gCvsPrefs.SetRhostPort(state ? value : -1);
01284
01285         state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRSHName, 0L);
01286         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditRSHName, &m_rshname);
01287         gCvsPrefs.SetRshName(state ? m_rshname.c_str() : "");
01288
01289         state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckServerName, 0L);
01290         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditServerName, &m_servername);
01291         gCvsPrefs.SetServerName(state ? m_servername.c_str() : "");
01292     }
01293 }

const UMSGMAP * UAuthen_Rhosts::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1225 of file Authen.cpp.

const UMSGMAP * UAuthen_Rhosts::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 1225 of file Authen.cpp.

const URuntimeClass * UAuthen_Rhosts::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 1223 of file Authen.cpp.

const UMSGMAP * UAuthen_Rhosts::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1225 of file Authen.cpp.

int UAuthen_Rhosts::OnCheckPort ( void ) [protected]

Definition at line 1235 of file Authen.cpp.

References EV_ENABLECMD, EV_QUERYSTATE, UCmdTarget::GetWidID, kCheckPort, kEditPort, UEventSendMessage, and UMAKEINT.

01236 {
01237     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01238     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, state), 0L);
01239
01240     return 0;
01241 }

int UAuthen_Rhosts::OnCheckRshName ( void ) [protected]

Definition at line 1243 of file Authen.cpp.

References EV_ENABLECMD, EV_QUERYSTATE, UCmdTarget::GetWidID, kCheckRSHName, kEditRSHName, UEventSendMessage, and UMAKEINT.

01244 {
01245     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRSHName, 0L);
01246     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditRSHName, state), 0L);
01247
01248     return 0;
01249 }

int UAuthen_Rhosts::OnCheckServerName ( void ) [protected]

Definition at line 1251 of file Authen.cpp.

References EV_ENABLECMD, EV_QUERYSTATE, UCmdTarget::GetWidID, kCheckServerName, kEditServerName, UEventSendMessage, and UMAKEINT.

01252 {
01253     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckServerName, 0L);
01254     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditServerName, state), 0L);
01255
01256     return 0;
01257 }

const URuntimeClass * UAuthen_Rhosts::rtUAuthen_Rhosts ( void ) [static]

Definition at line 1223 of file Authen.cpp.

Member Data Documentation

const UMSGMAP_ENTRY UAuthen_Rhosts::_messageEntries [static, private]

Initial value:

   {
    { EV_CMD, epi_V, UMSG_RANGE,  kCheckPort ,  kCheckPort ,   (UPMSG)(int (UCmdTarget::*)(void))& UAuthen_Rhosts::OnCheckPort  },
    { EV_CMD, epi_V, UMSG_RANGE,  kCheckRSHName ,  kCheckRSHName ,   (UPMSG)(int (UCmdTarget::*)(void))& UAuthen_Rhosts::OnCheckRshName  },
    { EV_CMD, epi_V, UMSG_RANGE,  kCheckServerName ,  kCheckServerName ,   (UPMSG)(int (UCmdTarget::*)(void))& UAuthen_Rhosts::OnCheckServerName  },
{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }   }

Reimplemented from UWidget.

Definition at line 1225 of file Authen.cpp.

const URuntimeClass UAuthen_Rhosts::classUAuthen_Rhosts [static, protected]

int UAuthen_Rhosts::m_port [protected]

Definition at line 1212 of file Authen.cpp.

Referenced by DoDataExchange.

UStr UAuthen_Rhosts::m_rshname [protected]

Definition at line 1213 of file Authen.cpp.

Referenced by DoDataExchange.

UStr UAuthen_Rhosts::m_servername [protected]

Definition at line 1214 of file Authen.cpp.

Referenced by DoDataExchange.

const UMSGMAP UAuthen_Rhosts::messageMap = { UWidget ::GetThisMessageMap(), & UAuthen_Rhosts ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Definition at line 1225 of file Authen.cpp.

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Sun Feb 24 01:24:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UAuthen_SSH Class Reference

Inheritance diagram for UAuthen_SSH:

[legend]
Collaboration diagram for UAuthen_SSH:

[legend]
List of all members.

Public Types

enum {
kOK = EV_COMMAND_START,
kCancel,
kRSACheck,
kRSAEdit,
kRSABtn,
kSSHCheck,
kSSHName,
kOptionsText,
kOptionsCheck,
kOptionsEdit,
kSSHBtn
}

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UAuthen_SSH ()
virtual | ~UAuthen_SSH ()
virtual void | DoDataExchange (bool fill)
while modaling, allows to fill/read the dialog content.
  • fill says if it expects to fill or read the dialog content.
 More...

Static Public Methods

const URuntimeClass * | rtUAuthen_SSH (void)

Protected Methods

int | OnCheckRSA (void)
int | OnBtnRSA (void)
int | OnCheckName (void)
int | OnBtnName (void)
int | OnCheckOptions (void)
virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Protected Attributes

bool | m_rsaidentity
UStr m_rsaidentityfile
UStr m_options

Static Protected Attributes

const URuntimeClass | classUAuthen_SSH
const UMSGMAP | messageMap = { UWidget ::GetThisMessageMap(), & UAuthen_SSH ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Member Enumeration Documentation

anonymous enum

Enumeration values:
kOK
kCancel
kRSACheck
kRSAEdit
kRSABtn
kSSHCheck
kSSHName
kOptionsText
kOptionsCheck
kOptionsEdit
kSSHBtn

Definition at line 676 of file Authen.cpp.

00677     {
00678         kOK = EV_COMMAND_START, // 0
00679         kCancel,            // 1
00680         kRSACheck,          // 2
00681         kRSAEdit,           // 3
00682         kRSABtn,            // 4
00683         kSSHCheck,          // 5
00684         kSSHName,           // 6
00685         kOptionsText,       // 7
00686         kOptionsCheck,      // 8
00687         kOptionsEdit,       // 9
00688         kSSHBtn,            // 10
00689     };

Constructor & Destructor Documentation

UAuthen_SSH::UAuthen_SSH ( )

Definition at line 717 of file Authen.cpp.

00717                          : UWidget(::UEventGetWidID())
00718 {
00719 }

virtual UAuthen_SSH::~UAuthen_SSH ( ) [inline, virtual]

Definition at line 674 of file Authen.cpp.

00674 {}

Member Function Documentation

const URuntimeClass * UAuthen_SSH::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 707 of file Authen.cpp.

void UAuthen_SSH::DoDataExchange ( bool fill ) [virtual]

while modaling, allows to fill/read the dialog content.

  • fill says if it expects to fill or read the dialog content.

Reimplemented from UWidget.

Definition at line 795 of file Authen.cpp.

References UStr::c_str, USmartCombo::DefaultFeature, UStr::empty, EV_COMBO_APPEND, EV_COMBO_RESETALL, EV_GETTEXT, EV_QUERYSTATE, EV_SETSTATE, EV_SETTEXT, EV_SMARTCOMBO_SETFEATURE, EV_SMARTCOMBO_SETITEMS, AuthenSSH::gCurRsaIdentity, TMString< UStr >::GetList, UCmdTarget::GetWidID, AuthenSSH::gRsaIdentity, AuthenSSH::gRsaIdentityFile, AuthenSSH::gSSHName, AuthenSSH::gSSHOptions, TMString< UStr >::Insert, kOptionsCheck, kOptionsEdit, kOptionsText, kRSACheck, kRSAEdit, kSSHCheck, kSSHName, TMString< UStr >::list_t, m_rsaidentity, m_rsaidentityfile, OnCheckName, OnCheckOptions, OnCheckRSA, AuthenSSH::RsaIdentityFile, UEventSendMessage, and UMAKEINT.

00796 {
00797     if(fill)
00798     {
00799         m_rsaidentity = AuthenSSH::gRsaIdentity;
00800         m_rsaidentityfile = AuthenSSH::RsaIdentityFile();
00801         UStr helpMsg = "* Some Cygwin/OpenSSH options :\n"
00802             "-v : Verbose mode\n"
00803             "-C : Request compression\n"
00804             "-1 : Forces ssh to try protocol version 1 only\n"
00805             "-2 : Forces ssh to try protocol version 2 only\n"
00806             "-4 : Forces ssh to try protocol version 2 only\n"
00807             "-6 : Forces ssh to use IPv6 addresses only";
00808
00809         UEventSendMessage(GetWidID(), EV_SETTEXT, kOptionsText, (void *)helpMsg.c_str());
00810
00811         UEventSendMessage(GetWidID(), EV_SMARTCOMBO_SETFEATURE, kRSAEdit, (void*)USmartCombo::DefaultFeature);
00812         UEventSendMessage(GetWidID(), EV_SMARTCOMBO_SETITEMS, kRSAEdit, (void*)&AuthenSSH::gRsaIdentityFile);
00813
00814         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kRSAEdit, 0L);
00815         const CMString::list_t & rsastrings = AuthenSSH::gRsaIdentityFile.GetList();
00816         CMString::list_t::const_iterator i;
00817         for(i = rsastrings.begin(); i != rsastrings.end(); ++i)
00818         {
00819             UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kRSAEdit,
00820                 (void *)(const char *)*i);
00821         }
00822
00823         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kRSACheck, m_rsaidentity), 0L);
00824         UEventSendMessage(GetWidID(), EV_SETTEXT, kRSAEdit, (void *)m_rsaidentityfile.c_str());
00825
00826         if(!AuthenSSH::gSSHName.empty())
00827         {
00828             UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kSSHCheck, 1), 0L);
00829             UEventSendMessage(GetWidID(), EV_SETTEXT, kSSHName, (void *)AuthenSSH::gSSHName.c_str());
00830         }
00831
00832         if(!AuthenSSH::gSSHOptions.empty())
00833         {
00834             UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kOptionsCheck, 1), 0L);
00835             UEventSendMessage(GetWidID(), EV_SETTEXT, kOptionsEdit, (void *)AuthenSSH::gSSHOptions.c_str());
00836         }
00837
00838         OnCheckRSA();
00839         OnCheckName();
00840         OnCheckOptions();
00841     }
00842     else
00843     {
00844         AuthenSSH::gRsaIdentity = m_rsaidentity;
00845         if(m_rsaidentity)
00846         {
00847             UEventSendMessage(GetWidID(), EV_GETTEXT, kRSAEdit, &m_rsaidentityfile);
00848             AuthenSSH::gRsaIdentityFile.Insert(m_rsaidentityfile);
00849             AuthenSSH::gCurRsaIdentity = m_rsaidentityfile;
00850         }
00851
00852         if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kSSHCheck, 0L))
00853             UEventSendMessage(GetWidID(), EV_GETTEXT, kSSHName, &AuthenSSH::gSSHName);
00854         else
00855             AuthenSSH::gSSHName = "";
00856
00857         if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kOptionsCheck, 0L))
00858             UEventSendMessage(GetWidID(), EV_GETTEXT, kOptionsEdit, &AuthenSSH::gSSHOptions);
00859         else
00860             AuthenSSH::gSSHOptions = "";
00861     }
00862 }

const UMSGMAP * UAuthen_SSH::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 709 of file Authen.cpp.

const UMSGMAP * UAuthen_SSH::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 709 of file Authen.cpp.

const URuntimeClass * UAuthen_SSH::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 707 of file Authen.cpp.

const UMSGMAP * UAuthen_SSH::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 709 of file Authen.cpp.

int UAuthen_SSH::OnBtnName ( void ) [protected]

Definition at line 769 of file Authen.cpp.

References MultiFiles::add, CvsArgs::Argv, BrowserGetMultiFiles, UStr::c_str, UStr::endsWith, EV_SETTEXT, UCmdTarget::GetWidID, kSSHName, MultiFiles::next, and UEventSendMessage.

00770 {
00771     MultiFiles mf;
00772 #ifdef WIN32
00773     if(!BrowserGetMultiFiles("Select SSH :", mf, "Executable Files (*.exe)|*.exe|All Files (*.*)|*.*||"))
00774         return 0;
00775 #else
00776     if(!BrowserGetMultiFiles("Select SSH :", mf))
00777         return 0;
00778 #endif
00779
00780     CvsArgs args(false);
00781     mf.next();
00782     const char *dir = mf.add(args);
00783     char * const *argv = args.Argv();
00784     UStr fullpath;
00785     fullpath = dir;
00786     if(!fullpath.endsWith(kPathDelimiter))
00787         fullpath << kPathDelimiter;
00788     fullpath << argv[0];
00789
00790     UEventSendMessage(GetWidID(), EV_SETTEXT, kSSHName, (void *)fullpath.c_str());
00791
00792     return 0;
00793 }

int UAuthen_SSH::OnBtnRSA ( void ) [protected]

Definition at line 748 of file Authen.cpp.

References MultiFiles::add, CvsArgs::Argv, BrowserGetMultiFiles, UStr::c_str, UStr::endsWith, EV_SETTEXT, UCmdTarget::GetWidID, kRSAEdit, MultiFiles::next, and UEventSendMessage.

00749 {
00750     MultiFiles mf;
00751     if(!BrowserGetMultiFiles("Select a RSA identity :", mf))
00752         return 0;
00753
00754     CvsArgs args(false);
00755     mf.next();
00756     const char *dir = mf.add(args);
00757     char * const *argv = args.Argv();
00758     UStr fullpath;
00759     fullpath = dir;
00760     if(!fullpath.endsWith(kPathDelimiter))
00761         fullpath << kPathDelimiter;
00762     fullpath << argv[0];
00763
00764     UEventSendMessage(GetWidID(), EV_SETTEXT, kRSAEdit, (void *)fullpath.c_str());
00765
00766     return 0;
00767 }

int UAuthen_SSH::OnCheckName ( void ) [protected]

Definition at line 730 of file Authen.cpp.

References EV_ENABLECMD, EV_QUERYSTATE, UCmdTarget::GetWidID, kSSHBtn, kSSHCheck, kSSHName, UEventSendMessage, and UMAKEINT.

Referenced by DoDataExchange.

00731 {
00732     bool state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kSSHCheck, 0L) != 0;
00733     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kSSHName, state), 0L);
00734     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kSSHBtn, state), 0L);
00735
00736     return 0;
00737 }

int UAuthen_SSH::OnCheckOptions ( void ) [protected]

Definition at line 739 of file Authen.cpp.

References EV_ENABLECMD, EV_QUERYSTATE, UCmdTarget::GetWidID, kOptionsCheck, kOptionsEdit, kOptionsText, UEventSendMessage, and UMAKEINT.

Referenced by DoDataExchange.

00740 {
00741     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kOptionsCheck, 0L);
00742     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kOptionsEdit, state), 0L);
00743     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kOptionsText, state), 0L);
00744
00745     return 0;
00746 }

int UAuthen_SSH::OnCheckRSA ( void ) [protected]

Definition at line 721 of file Authen.cpp.

References EV_ENABLECMD, EV_QUERYSTATE, UCmdTarget::GetWidID, kRSABtn, kRSACheck, kRSAEdit, m_rsaidentity, UEventSendMessage, and UMAKEINT.

Referenced by DoDataExchange.

00722 {
00723     m_rsaidentity = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRSACheck, 0L) != 0;
00724     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kRSAEdit, m_rsaidentity), 0L);
00725     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kRSABtn, m_rsaidentity), 0L);
00726
00727     return 0;
00728 }

const URuntimeClass * UAuthen_SSH::rtUAuthen_SSH ( void ) [static]

Definition at line 707 of file Authen.cpp.

Member Data Documentation

const UMSGMAP_ENTRY UAuthen_SSH::_messageEntries [static, private]

Initial value:

   {
    { EV_CMD, epi_V, UMSG_RANGE,  kRSACheck ,  kRSACheck ,   (UPMSG)(int (UCmdTarget::*)(void))& UAuthen_SSH::OnCheckRSA  },
    { EV_CMD, epi_V, UMSG_RANGE,  kRSABtn ,  kRSABtn ,   (UPMSG)(int (UCmdTarget::*)(void))& UAuthen_SSH::OnBtnRSA  },
    { EV_CMD, epi_V, UMSG_RANGE,  kSSHCheck ,  kSSHCheck ,   (UPMSG)(int (UCmdTarget::*)(void))& UAuthen_SSH::OnCheckName  },
    { EV_CMD, epi_V, UMSG_RANGE,  kSSHBtn ,  kSSHBtn ,   (UPMSG)(int (UCmdTarget::*)(void))& UAuthen_SSH::OnBtnName  },
    { EV_CMD, epi_V, UMSG_RANGE,  kOptionsCheck ,  kOptionsCheck ,   (UPMSG)(int (UCmdTarget::*)(void))& UAuthen_SSH::OnCheckOptions  },
{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }   }

Reimplemented from UWidget.

Definition at line 709 of file Authen.cpp.

const URuntimeClass UAuthen_SSH::classUAuthen_SSH [static, protected]

UStr UAuthen_SSH::m_options [protected]

Definition at line 696 of file Authen.cpp.

bool UAuthen_SSH::m_rsaidentity [protected]

Definition at line 694 of file Authen.cpp.

Referenced by DoDataExchange, and OnCheckRSA.

UStr UAuthen_SSH::m_rsaidentityfile [protected]

Definition at line 695 of file Authen.cpp.

Referenced by DoDataExchange.

const UMSGMAP UAuthen_SSH::messageMap = { UWidget ::GetThisMessageMap(), & UAuthen_SSH ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Definition at line 709 of file Authen.cpp.

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Sun Feb 24 01:24:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AuthenGserver Class Reference

Inheritance diagram for AuthenGserver:

[legend]
Collaboration diagram for AuthenGserver:

[legend]
List of all members.

Public Methods

AuthenGserver ()
virtual | ~AuthenGserver ()
virtual AuthenKind | GetKind (void) const
virtual const char * | GetToken (void) const
virtual bool | HasSettings (void) const
virtual bool | HasHost (void) const
virtual void | DoSettings (void)
virtual void | GetSettingsDesc (UStr &desc)
virtual const char * | OnGetEnv (char *env)

Constructor & Destructor Documentation

AuthenGserver::AuthenGserver ( ) [inline]

Definition at line 1524 of file Authen.cpp.

01524 {}

virtual AuthenGserver::~AuthenGserver ( ) [inline, virtual]

Definition at line 1525 of file Authen.cpp.

01525 {}

Member Function Documentation

void AuthenGserver::DoSettings ( void ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1595 of file Authen.cpp.

References UWidget::DoModal, and IDD_GSERVER.

01596 {
01597     UAuthen_Gserver *dlg = new UAuthen_Gserver();
01598
01599     try
01600     {
01601 #if WIN32
01602         dlg->DoModal(IDD_GSERVER);
01603 #endif
01604     }
01605     catch(...)
01606     {
01607     }
01608
01609     delete dlg;
01610 }

virtual AuthenKind AuthenGserver::GetKind ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1527 of file Authen.cpp.

References AuthenKind, and gserver.

01527 { return gserver; }

void AuthenGserver::GetSettingsDesc ( UStr & desc ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1539 of file Authen.cpp.

01540 {
01541     if( gCvsPrefs.EncryptCommunication() )
01542         desc << "Encryption turned on";
01543     else
01544         desc << "Encryption turned off";
01545 }

virtual const char* AuthenGserver::GetToken ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1528 of file Authen.cpp.

01528 { return "gserver"; }

virtual bool AuthenGserver::HasHost ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1531 of file Authen.cpp.

01531 { return true; }

virtual bool AuthenGserver::HasSettings ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1530 of file Authen.cpp.

01530 { return true; }

const char * AuthenGserver::OnGetEnv ( char * env ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1547 of file Authen.cpp.

01548 {
01549     return 0L;
01550 }

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Sun Feb 24 01:24:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AuthenKserver Class Reference

Inheritance diagram for AuthenKserver:

[legend]
Collaboration diagram for AuthenKserver:

[legend]
List of all members.

Public Methods

AuthenKserver ()
virtual | ~AuthenKserver ()
virtual AuthenKind | GetKind (void) const
virtual const char * | GetToken (void) const
virtual bool | HasSettings (void) const
virtual bool | HasHost (void) const
virtual bool | HasUser (void) const
virtual void | DoSettings (void)
virtual void | GetSettingsDesc (UStr &desc)
virtual const char * | OnGetEnv (char *env)

Constructor & Destructor Documentation

AuthenKserver::AuthenKserver ( ) [inline]

Definition at line 1394 of file Authen.cpp.

01394 {}

virtual AuthenKserver::~AuthenKserver ( ) [inline, virtual]

Definition at line 1395 of file Authen.cpp.

01395 {}

Member Function Documentation

void AuthenKserver::DoSettings ( void ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1471 of file Authen.cpp.

References UWidget::DoModal.

01472 {
01473     UAuthen_Kserver *dlg = new UAuthen_Kserver();
01474
01475     try
01476     {
01477 #if qMacCvsPP
01478         dlg->DoModal(3003);
01479 #endif
01480     }
01481     catch(...)
01482     {
01483     }
01484
01485     delete dlg;
01486 }

virtual AuthenKind AuthenKserver::GetKind ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1397 of file Authen.cpp.

References AuthenKind, and kserver.

01397 { return kserver; }

void AuthenKserver::GetSettingsDesc ( UStr & desc ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1488 of file Authen.cpp.

01489 {
01490     if(gCvsPrefs.KserverPort() == -1)
01491         desc << "Using default port";
01492     else
01493         desc << "Using port " << gCvsPrefs.KserverPort();
01494 }

virtual const char* AuthenKserver::GetToken ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1398 of file Authen.cpp.

01398 { return "kserver"; }

virtual bool AuthenKserver::HasHost ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1401 of file Authen.cpp.

01401 { return true; }

virtual bool AuthenKserver::HasSettings ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1400 of file Authen.cpp.

01400 { return true; }

virtual bool AuthenKserver::HasUser ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1402 of file Authen.cpp.

01402 { return true; }

const char * AuthenKserver::OnGetEnv ( char * env ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1496 of file Authen.cpp.

01497 {
01498     return 0L;
01499 }

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Sun Feb 24 01:24:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AuthenLocal Class Reference

Inheritance diagram for AuthenLocal:

[legend]
Collaboration diagram for AuthenLocal:

[legend]
List of all members.

Public Methods

AuthenLocal ()
virtual | ~AuthenLocal ()
virtual AuthenKind | GetKind (void) const
virtual const char * | GetToken (void) const

Constructor & Destructor Documentation

AuthenLocal::AuthenLocal ( ) [inline]

Definition at line 375 of file Authen.cpp.

00375 {}

virtual AuthenLocal::~AuthenLocal ( ) [inline, virtual]

Definition at line 376 of file Authen.cpp.

00376 {}

Member Function Documentation

virtual AuthenKind AuthenLocal::GetKind ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 378 of file Authen.cpp.

References AuthenKind, and local.

00378 { return local; }

virtual const char* AuthenLocal::GetToken ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 379 of file Authen.cpp.

00379 { return "local"; }

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Sun Feb 24 01:24:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AuthenModel Class Reference

Authentication model class. More...

#include "common/Authen.h"

Inheritance diagram for AuthenModel:

[legend]
Collaboration diagram for AuthenModel:

[legend]
List of all members.

Public Methods

AuthenModel ()
virtual | ~AuthenModel ()
virtual AuthenKind | GetKind (void) const=0
virtual const char * | GetToken (void) const=0
virtual bool | HasSettings (void) const
virtual bool | HasHost (void) const
virtual bool | HasUser (void) const
virtual void | DoSettings (void)
virtual void | GetSettingsDesc (UStr &desc)
virtual const char * | OnGetEnv (char *env)
virtual void | OnSetupEnv (void)
virtual void | OnRestoreEnv (void)

Static Public Methods

std::vector< AuthenModel * > & | GetAllInstances (void)
AuthenModel * | GetInstance (AuthenKind k)

Static Protected Attributes

std::vector< AuthenModel * > * | m_instances = 0L

Detailed Description

Authentication model class.

Definition at line 72 of file Authen.h.

Constructor & Destructor Documentation

AuthenModel::AuthenModel ( )

Definition at line 315 of file Authen.cpp.

References m_instances.

00316 {
00317     if(m_instances == 0L)
00318     {
00319         m_instances = new std::vector<AuthenModel *>;
00320         if(m_instances == 0L)
00321             throw std::bad_alloc();
00322     }
00323
00324     m_instances->push_back(this);
00325 }

AuthenModel::~AuthenModel ( ) [virtual]

Definition at line 327 of file Authen.cpp.

References m_instances.

00328 {
00329     std::vector<AuthenModel *>::iterator i;
00330     i = std::find(m_instances->begin(), m_instances->end(), this);
00331     if(i != m_instances->end())
00332         m_instances->erase(i);
00333
00334     if(m_instances->empty())
00335         delete m_instances;
00336 }

Member Function Documentation

virtual void AuthenModel::DoSettings ( void ) [inline, virtual]

Reimplemented in AuthenSSH.

Definition at line 88 of file Authen.h.

Referenced by CGetPrefs_CVSROOT::OnSettings.

00088 {}

std::vector< AuthenModel * > & AuthenModel::GetAllInstances ( void ) [static]

Definition at line 338 of file Authen.cpp.

References m_instances.

Referenced by CGetPrefs_CVSROOT::DoDataExchange, GetInstance, glue_getenv, Authen::kindToNum, Authen::numToKind, and Authen::tokenToKind.

00339 {
00340     return *AuthenModel::m_instances;
00341 }

AuthenModel * AuthenModel::GetInstance ( AuthenKind k ) [static]

Definition at line 343 of file Authen.cpp.

References AuthenKind, cvs_err, GetAllInstances, GetKind, and local.

Referenced by CAuthenSetUp::CAuthenSetUp, CGetPrefs_CVSROOT::DoDataExchange, glue_getenv, Authen::kindToToken, CGetPrefs_CVSROOT::OnChangeFields, CGetPrefs_CVSROOT::OnSelchangeAuthen, CGetPrefs_CVSROOT::OnSettings, and CAuthenSetUp::~CAuthenSetUp.

00344 {
00345     std::vector<AuthenModel *> & allInstances = GetAllInstances();
00346     std::vector<AuthenModel *>::const_iterator i;
00347     for(i = allInstances.begin(); i != allInstances.end(); ++i)
00348     {
00349         AuthenModel *model = *i;
00350         if(model->GetKind() == k)
00351             return model;
00352     }
00353
00354     // default to local
00355     cvs_err("Unknown authentication kind %d\n", k);
00356     return GetInstance(local);
00357 }

virtual AuthenKind AuthenModel::GetKind ( void ) const [pure virtual]

Implemented in AuthenLocal.

Referenced by GetInstance, Authen::kindToNum, Authen::numToKind, and Authen::tokenToKind.

virtual void AuthenModel::GetSettingsDesc ( UStr & desc ) [inline, virtual]

Reimplemented in AuthenSSH.

Definition at line 89 of file Authen.h.

Referenced by CGetPrefs_CVSROOT::OnSelchangeAuthen, and CGetPrefs_CVSROOT::OnSettings.

00089 { desc = ""; }

virtual const char* AuthenModel::GetToken ( void ) const [pure virtual]

Implemented in AuthenLocal.

Referenced by Authen::kindToToken, and Authen::tokenToKind.

virtual bool AuthenModel::HasHost ( void ) const [inline, virtual]

Reimplemented in AuthenSSH.

Definition at line 85 of file Authen.h.

Referenced by CGetPrefs_CVSROOT::OnChangeFields, and CGetPrefs_CVSROOT::OnSelchangeAuthen.

00085 { return false; }

virtual bool AuthenModel::HasSettings ( void ) const [inline, virtual]

Reimplemented in AuthenSSH.

Definition at line 84 of file Authen.h.

Referenced by CGetPrefs_CVSROOT::OnSelchangeAuthen.

00084 { return false; }

virtual bool AuthenModel::HasUser ( void ) const [inline, virtual]

Reimplemented in AuthenSSH.

Definition at line 86 of file Authen.h.

Referenced by CGetPrefs_CVSROOT::OnChangeFields, and CGetPrefs_CVSROOT::OnSelchangeAuthen.

00086 { return false; }

virtual const char* AuthenModel::OnGetEnv ( char * env ) [inline, virtual]

Reimplemented in AuthenSSH.

Definition at line 91 of file Authen.h.

Referenced by glue_getenv.

00091 { return 0L; }

void AuthenModel::OnRestoreEnv ( void ) [virtual]

Reimplemented in AuthenSSH.

Definition at line 367 of file Authen.cpp.

Referenced by AuthenRhosts::OnRestoreEnv, AuthenPserver::OnRestoreEnv, AuthenSSH::OnRestoreEnv, and CAuthenSetUp::~CAuthenSetUp.

00368 {
00369     putenv("HOME=");
00370 }

void AuthenModel::OnSetupEnv ( void ) [virtual]

Reimplemented in AuthenSSH.

Definition at line 359 of file Authen.cpp.

Referenced by CAuthenSetUp::CAuthenSetUp, AuthenRhosts::OnSetupEnv, AuthenPserver::OnSetupEnv, and AuthenSSH::OnSetupEnv.

00360 {
00361     static UStr home;
00362     home = "HOME=";
00363     home << gCvsPrefs.Home();
00364     putenv(home);
00365 }

Member Data Documentation

std::vector< AuthenModel * > * AuthenModel::m_instances = 0L [static, protected]

Definition at line 313 of file Authen.cpp.

Referenced by AuthenModel, GetAllInstances, and ~AuthenModel.

The documentation for this class was generated from the following files:
  • common/Authen.h
  • common/Authen.cpp
Generated on Sun Feb 24 01:24:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AuthenNtserver Class Reference

Inheritance diagram for AuthenNtserver:

[legend]
Collaboration diagram for AuthenNtserver:

[legend]
List of all members.

Public Methods

AuthenNtserver ()
virtual | ~AuthenNtserver ()
virtual AuthenKind | GetKind (void) const
virtual const char * | GetToken (void) const
virtual bool | HasSettings (void) const
virtual bool | HasHost (void) const
virtual const char * | OnGetEnv (char *env)

Constructor & Destructor Documentation

AuthenNtserver::AuthenNtserver ( ) [inline]

Definition at line 1504 of file Authen.cpp.

01504 {}

virtual AuthenNtserver::~AuthenNtserver ( ) [inline, virtual]

Definition at line 1505 of file Authen.cpp.

01505 {}

Member Function Documentation

virtual AuthenKind AuthenNtserver::GetKind ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1507 of file Authen.cpp.

References AuthenKind, and ntserver.

01507 { return ntserver; }

virtual const char* AuthenNtserver::GetToken ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1508 of file Authen.cpp.

01508 { return "ntserver"; }

virtual bool AuthenNtserver::HasHost ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1511 of file Authen.cpp.

01511 { return true; }

virtual bool AuthenNtserver::HasSettings ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1510 of file Authen.cpp.

01510 { return false; }

const char * AuthenNtserver::OnGetEnv ( char * env ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1516 of file Authen.cpp.

01517 {
01518     return 0L;
01519 }

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Sun Feb 24 01:24:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AuthenPserver Class Reference

Inheritance diagram for AuthenPserver:

[legend]
Collaboration diagram for AuthenPserver:

[legend]
List of all members.

Public Methods

AuthenPserver ()
virtual | ~AuthenPserver ()
virtual AuthenKind | GetKind (void) const
virtual const char * | GetToken (void) const
virtual bool | HasSettings (void) const
virtual bool | HasHost (void) const
virtual bool | HasUser (void) const
virtual void | DoSettings (void)
virtual void | GetSettingsDesc (UStr &desc)
virtual const char * | OnGetEnv (char *env)
virtual void | OnSetupEnv (void)
virtual void | OnRestoreEnv (void)

Constructor & Destructor Documentation

AuthenPserver::AuthenPserver ( ) [inline]

Definition at line 982 of file Authen.cpp.

00982 {}

virtual AuthenPserver::~AuthenPserver ( ) [inline, virtual]

Definition at line 983 of file Authen.cpp.

00983 {}

Member Function Documentation

void AuthenPserver::DoSettings ( void ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1097 of file Authen.cpp.

References UWidget::DoModal, and IDD_PSERVER.

01098 {
01099     UAuthen_Pserver *dlg = new UAuthen_Pserver();
01100
01101     try
01102     {
01103 #if qMacCvsPP
01104         dlg->DoModal(3002);
01105 #endif
01106 #ifdef WIN32
01107         dlg->DoModal(IDD_PSERVER);
01108 #endif
01109     }
01110     catch(...)
01111     {
01112     }
01113
01114     delete dlg;
01115 }

virtual AuthenKind AuthenPserver::GetKind ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 985 of file Authen.cpp.

References AuthenKind, and pserver.

00985 { return pserver; }

void AuthenPserver::GetSettingsDesc ( UStr & desc ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1117 of file Authen.cpp.

01118 {
01119     if(gCvsPrefs.PserverPort() == -1)
01120         desc << "Using default port and ";
01121     else
01122         desc << "Using port " << gCvsPrefs.PserverPort() << " and ";
01123
01124     if(!gCvsPrefs.UseProxy())
01125         desc << "no proxy";
01126     else
01127         desc << "using proxy host " << gCvsPrefs.ProxyHost() << " with port " << gCvsPrefs.ProxyPort();
01128 }

virtual const char* AuthenPserver::GetToken ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 986 of file Authen.cpp.

00986 { return "pserver"; }

virtual bool AuthenPserver::HasHost ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 989 of file Authen.cpp.

00989 { return true; }

virtual bool AuthenPserver::HasSettings ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 988 of file Authen.cpp.

00988 { return true; }

virtual bool AuthenPserver::HasUser ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 990 of file Authen.cpp.

00990 { return true; }

const char * AuthenPserver::OnGetEnv ( char * env ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1152 of file Authen.cpp.

01153 {
01154     if(strcmp(env, "CVS_PSERVER_PORT") == 0)
01155     {
01156         if(gCvsPrefs.PserverPort() != -1)
01157         {
01158             static char port[10];
01159             sprintf(port, "%d", gCvsPrefs.PserverPort());
01160             return port;
01161         }
01162
01163         return 0L;
01164     }
01165     return 0L;
01166 }

void AuthenPserver::OnRestoreEnv ( void ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1145 of file Authen.cpp.

References AuthenModel::OnRestoreEnv.

01146 {
01147     AuthenModel::OnRestoreEnv();
01148
01149     putenv("CVS_PSERVER_PORT=");
01150 }

void AuthenPserver::OnSetupEnv ( void ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1130 of file Authen.cpp.

References AuthenModel::OnSetupEnv.

01131 {
01132     AuthenModel::OnSetupEnv();
01133
01134     static UStr options;
01135
01136     if(gCvsPrefs.PserverPort() != -1)
01137     {
01138         options = "CVS_PSERVER_PORT=";
01139         options << gCvsPrefs.PserverPort();
01140         putenv(options);
01141     }
01142
01143 }

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Sun Feb 24 01:24:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AuthenRhosts Class Reference

Inheritance diagram for AuthenRhosts:

[legend]
Collaboration diagram for AuthenRhosts:

[legend]
List of all members.

Public Methods

AuthenRhosts ()
virtual | ~AuthenRhosts ()
virtual AuthenKind | GetKind (void) const
virtual const char * | GetToken (void) const
virtual bool | HasSettings (void) const
virtual bool | HasHost (void) const
virtual bool | HasUser (void) const
virtual void | DoSettings (void)
virtual void | GetSettingsDesc (UStr &desc)
virtual const char * | OnGetEnv (char *env)
virtual void | OnSetupEnv (void)
virtual void | OnRestoreEnv (void)

Constructor & Destructor Documentation

AuthenRhosts::AuthenRhosts ( ) [inline]

Definition at line 1171 of file Authen.cpp.

01171 {}

virtual AuthenRhosts::~AuthenRhosts ( ) [inline, virtual]

Definition at line 1172 of file Authen.cpp.

01172 {}

Member Function Documentation

void AuthenRhosts::DoSettings ( void ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1295 of file Authen.cpp.

References UWidget::DoModal, and IDD_RSH.

01296 {
01297     UAuthen_Rhosts *dlg = new UAuthen_Rhosts();
01298
01299     try
01300     {
01301 #if qMacCvsPP
01302         dlg->DoModal(3001);
01303 #endif
01304 #if WIN32
01305         dlg->DoModal(IDD_RSH);
01306 #endif
01307     }
01308     catch(...)
01309     {
01310     }
01311
01312     delete dlg;
01313 }

virtual AuthenKind AuthenRhosts::GetKind ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1174 of file Authen.cpp.

References AuthenKind, and rhosts.

01174 { return rhosts; }

void AuthenRhosts::GetSettingsDesc ( UStr & desc ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1315 of file Authen.cpp.

01316 {
01317     if(gCvsPrefs.RhostPort() == -1)
01318         desc << "Using default port and ";
01319     else
01320         desc << "Using port " << gCvsPrefs.RhostPort() << " and ";
01321
01322     if(gCvsPrefs.RshName() == 0L)
01323         desc << "default shell name";
01324     else
01325         desc << "shell named " << gCvsPrefs.RshName();
01326 }

virtual const char* AuthenRhosts::GetToken ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1175 of file Authen.cpp.

01175 { return "rhosts"; }

virtual bool AuthenRhosts::HasHost ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1178 of file Authen.cpp.

01178 { return true; }

virtual bool AuthenRhosts::HasSettings ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1177 of file Authen.cpp.

01177 { return true; }

virtual bool AuthenRhosts::HasUser ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1179 of file Authen.cpp.

01179 { return true; }

const char * AuthenRhosts::OnGetEnv ( char * env ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1367 of file Authen.cpp.

01368 {
01369     if(strcmp(env, "CVS_RSH") == 0)
01370     {
01371         return (char *)gCvsPrefs.RshName();
01372     }
01373     else if(strcmp(env, "CVS_RCMD_PORT") == 0)
01374     {
01375         if(gCvsPrefs.RhostPort() != -1)
01376         {
01377             static char port[10];
01378             sprintf(port, "%d", gCvsPrefs.RhostPort());
01379             return port;
01380         }
01381
01382         return 0L;
01383     }
01384     else if(strcmp(env, "CVS_SERVER") == 0)
01385     {
01386         return (char *)gCvsPrefs.ServerName();
01387     }
01388     return 0L;
01389 }

void AuthenRhosts::OnRestoreEnv ( void ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1358 of file Authen.cpp.

References AuthenModel::OnRestoreEnv.

01359 {
01360     AuthenModel::OnRestoreEnv();
01361
01362     putenv("CVS_RSH=");
01363     putenv("CVS_RCMD_PORT=");
01364     putenv("CVS_SERVER=");
01365 }

void AuthenRhosts::OnSetupEnv ( void ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1328 of file Authen.cpp.

References AuthenModel::OnSetupEnv.

01329 {
01330     AuthenModel::OnSetupEnv();
01331
01332     static UStr rsh;
01333     static UStr port;
01334     static UStr server;
01335
01336     if(gCvsPrefs.RshName() != 0L)
01337     {
01338         rsh = "CVS_RSH=";
01339         rsh << gCvsPrefs.RshName();
01340         putenv(rsh);
01341     }
01342
01343     if(gCvsPrefs.RhostPort() != -1)
01344     {
01345         port = "CVS_RCMD_PORT=";
01346         port << gCvsPrefs.RhostPort();
01347         putenv(port);
01348     }
01349
01350     if(gCvsPrefs.ServerName() != 0L)
01351     {
01352         server = "CVS_SERVER=";
01353         server << gCvsPrefs.ServerName();
01354         putenv(server);
01355     }
01356 }

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Sun Feb 24 01:24:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CAuthenSetUp Class Reference

List of all members.

Public Methods

CAuthenSetUp ()
~CAuthenSetUp ()

Constructor & Destructor Documentation

CAuthenSetUp::CAuthenSetUp ( ) [inline]

Definition at line 428 of file AppGlue.cpp.

References AuthenModel::GetInstance, and AuthenModel::OnSetupEnv.

00429     {
00430         AuthenModel *curModel = AuthenModel::GetInstance(gAuthen.kind());
00431         if(curModel != 0L)
00432             curModel->OnSetupEnv();
00433     }

CAuthenSetUp::~CAuthenSetUp ( ) [inline]

Definition at line 435 of file AppGlue.cpp.

References AuthenModel::GetInstance, and AuthenModel::OnRestoreEnv.

00436     {
00437         AuthenModel *curModel = AuthenModel::GetInstance(gAuthen.kind());
00438         if(curModel != 0L)
00439             curModel->OnRestoreEnv();
00440     }

The documentation for this class was generated from the following file:
  • common/AppGlue.cpp
Generated on Sun Feb 24 01:24:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


AuthenSSH Class Reference

Inheritance diagram for AuthenSSH:

[legend]
Collaboration diagram for AuthenSSH:

[legend]
List of all members.

Public Methods

AuthenSSH ()
virtual | ~AuthenSSH ()
virtual AuthenKind | GetKind (void) const
virtual const char * | GetToken (void) const
virtual bool | HasSettings (void) const
virtual bool | HasHost (void) const
virtual bool | HasUser (void) const
virtual void | DoSettings (void)
virtual void | GetSettingsDesc (UStr &desc)
virtual const char * | OnGetEnv (char *env)
virtual void | OnSetupEnv (void)
virtual void | OnRestoreEnv (void)

Static Public Methods

const char * | RsaIdentityFile (void)

Static Public Attributes

PCStr gSSHName
PCStr gSSHOptions
CPersistentBool gRsaIdentity
CMString gRsaIdentityFile
PCStr gCurRsaIdentity

Constructor & Destructor Documentation

AuthenSSH::AuthenSSH ( ) [inline]

Definition at line 613 of file Authen.cpp.

00613 {}

virtual AuthenSSH::~AuthenSSH ( ) [inline, virtual]

Definition at line 614 of file Authen.cpp.

00614 {}

Member Function Documentation

void AuthenSSH::DoSettings ( void ) [virtual]

Reimplemented from AuthenModel.

Definition at line 864 of file Authen.cpp.

References UWidget::DoModal, and IDD_SSH.

00865 {
00866     UAuthen_SSH *dlg = new UAuthen_SSH();
00867
00868     try
00869     {
00870 #ifdef WIN32
00871         dlg->DoModal(IDD_SSH);
00872 #endif
00873     }
00874     catch(...)
00875     {
00876     }
00877
00878     delete dlg;
00879 }

virtual AuthenKind AuthenSSH::GetKind ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 616 of file Authen.cpp.

References AuthenKind, and ssh.

00616 { return ssh; }

void AuthenSSH::GetSettingsDesc ( UStr & desc ) [virtual]

Reimplemented from AuthenModel.

Definition at line 881 of file Authen.cpp.

References UStr::c_str, UStr::empty, gRsaIdentity, gSSHOptions, and RsaIdentityFile.

00882 {
00883     if(!gSSHOptions.empty())
00884     {
00885         desc << "Using ";
00886         desc << gSSHOptions.c_str();
00887         desc << " ";
00888     }
00889
00890     if((bool)gRsaIdentity)
00891     {
00892         if(gSSHOptions.empty())
00893             desc << "Using ";
00894         desc << "-i ";
00895         desc << RsaIdentityFile();
00896     }
00897 }

virtual const char* AuthenSSH::GetToken ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 617 of file Authen.cpp.

00617 { return "ssh"; }

virtual bool AuthenSSH::HasHost ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 620 of file Authen.cpp.

00620 { return true; }

virtual bool AuthenSSH::HasSettings ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 619 of file Authen.cpp.

00619 { return true; }

virtual bool AuthenSSH::HasUser ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 621 of file Authen.cpp.

00621 { return true; }

const char * AuthenSSH::OnGetEnv ( char * env ) [virtual]

Reimplemented from AuthenModel.

Definition at line 940 of file Authen.cpp.

References UStr::c_str, UStr::empty, gRsaIdentity, gSSHName, gSSHOptions, and RsaIdentityFile.

00941 {
00942     if(strcmp(env, "CVS_RSH") == 0)
00943     {
00944         return gSSHName.empty() ? "ssh" : (char *)gSSHName.c_str();
00945     }
00946     else if( strcmp(env, "CVS_RSA_OPTIONS") == 0)
00947     {
00948         return gSSHOptions.empty() ? 0L : (char *)gSSHOptions.c_str();
00949     }
00950     else if( strcmp(env, "CVS_RSA_IDENTITY") == 0 && (bool)gRsaIdentity)
00951     {
00952         const char *tmp = RsaIdentityFile();
00953         if( tmp && *tmp )
00954         {
00955 #ifdef WIN32
00956             while( *tmp && iswspace( *tmp ) )
00957 #else
00958             while( *tmp && isspace( *tmp ) )
00959 #endif
00960                 tmp++;
00961
00962             return *tmp ? (char *)tmp : 0L;
00963         }
00964         return 0L;
00965     }
00966     return 0L;
00967 }

void AuthenSSH::OnRestoreEnv ( void ) [virtual]

Reimplemented from AuthenModel.

Definition at line 931 of file Authen.cpp.

References AuthenModel::OnRestoreEnv.

00932 {
00933     AuthenModel::OnRestoreEnv();
00934
00935     putenv("CVS_RSH=");
00936     putenv("CVS_RSA_OPTIONS=");
00937     putenv("CVS_RSA_IDENTITY=");
00938 }

void AuthenSSH::OnSetupEnv ( void ) [virtual]

Reimplemented from AuthenModel.

Definition at line 899 of file Authen.cpp.

References UStr::c_str, UStr::empty, gRsaIdentity, gSSHName, gSSHOptions, AuthenModel::OnSetupEnv, and RsaIdentityFile.

00900 {
00901     AuthenModel::OnSetupEnv();
00902
00903     static UStr rsh;
00904     static UStr options;
00905     static UStr identity;
00906
00907     rsh = "CVS_RSH=";
00908
00909     if(gSSHName.empty())
00910         rsh << "ssh";
00911     else
00912         rsh << gSSHName.c_str();
00913
00914     putenv(rsh);
00915
00916     if(!gSSHOptions.empty())
00917     {
00918         options = "CVS_RSA_OPTIONS=";
00919         options << gSSHOptions.c_str();
00920         putenv(options);
00921     }
00922
00923     if((bool)gRsaIdentity)
00924     {
00925         identity = "CVS_RSA_IDENTITY=";
00926         identity << RsaIdentityFile();
00927         putenv(identity);
00928     }
00929 }

const char * AuthenSSH::RsaIdentityFile ( void ) [static]

Definition at line 646 of file Authen.cpp.

References UStr::empty, gCurRsaIdentity, getenv, TMString< UStr >::GetList, gRsaIdentityFile, MAX_PATH, and NULL.

Referenced by UAuthen_SSH::DoDataExchange, GetSettingsDesc, OnGetEnv, and OnSetupEnv.

00647 {
00648     if(gRsaIdentityFile.GetList().size() != 0)
00649         gCurRsaIdentity = gRsaIdentityFile.GetList()[0];
00650
00651 #ifdef WIN32
00652     // Fill in a default value, if one empty slot
00653     if( gCurRsaIdentity.empty())
00654     {
00655         char *env = getenv( "HOME" );
00656         if(env != 0L )
00657         {
00658             char default_identity_folder[] = ".ssh/identity";
00659             char default_identity[ MAX_PATH ];
00660             _makepath( default_identity, NULL, env, default_identity_folder, NULL );
00661             gCurRsaIdentity = default_identity;
00662         }
00663     }
00664 #endif
00665
00666     return gCurRsaIdentity.empty() ? 0L : (const char *)gCurRsaIdentity;
00667 }

Member Data Documentation

PCStr AuthenSSH::gCurRsaIdentity [static]

Referenced by UAuthen_SSH::DoDataExchange, and RsaIdentityFile.

CPersistentBool AuthenSSH::gRsaIdentity [static]

Referenced by UAuthen_SSH::DoDataExchange, GetSettingsDesc, OnGetEnv, and OnSetupEnv.

CMString AuthenSSH::gRsaIdentityFile [static]

Referenced by UAuthen_SSH::DoDataExchange, and RsaIdentityFile.

PCStr AuthenSSH::gSSHName [static]

Referenced by UAuthen_SSH::DoDataExchange, OnGetEnv, and OnSetupEnv.

PCStr AuthenSSH::gSSHOptions [static]

Referenced by UAuthen_SSH::DoDataExchange, GetSettingsDesc, OnGetEnv, and OnSetupEnv.

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Sun Feb 24 01:24:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


awidget Class Reference

Collaboration diagram for awidget:

[legend]
List of all members.

Public Methods

awidget (HBITMAP b, int c, const char *t, UTB_VAR v)
awidget ()
awidget (const awidget &src)
virtual | ~awidget ()
awidget & | operator= (const awidget &src)

Public Attributes

aref bitmap
int | cmd
char * | tooltip
UTB_VAR var

Constructor & Destructor Documentation

awidget::awidget | ( | HBITMAP | b,
 |  | int | c,
 |  | const char * | t,
 |  | UTB_VAR | v
 | ) | [inline]

Definition at line 154 of file utoolbar.cpp.

References bitmap, cmd, strdup, tooltip, UTB_VAR, and var.

00154                                                         :
00155         bitmap(b), cmd(c), tooltip(0L), var(v)
00156     {
00157         if(t != 0L)
00158             tooltip = strdup(t);
00159     }

awidget::awidget ( ) [inline]

Definition at line 160 of file utoolbar.cpp.

References bitmap, cmd, and tooltip.

00160               : bitmap(0L), cmd(0), tooltip(0L)
00161     {
00162     }

awidget::awidget ( const awidget & src ) [inline]

Definition at line 163 of file utoolbar.cpp.

00164     {
00165         *this = src;
00166     }

virtual awidget::~awidget ( ) [inline, virtual]

Definition at line 168 of file utoolbar.cpp.

References free, and tooltip.

00169     {
00170         if(tooltip != 0L)
00171             free(tooltip);
00172     }

Member Function Documentation

awidget& awidget::operator= ( const awidget & src ) [inline]

Definition at line 174 of file utoolbar.cpp.

References bitmap, cmd, strdup, tooltip, and var.

00175     {
00176         bitmap = src.bitmap;
00177         cmd = src.cmd;
00178         var = src.var;
00179         tooltip = src.tooltip != 0L ? strdup(src.tooltip) : 0L;
00180
00181         return *this;
00182     }

Member Data Documentation

aref awidget::bitmap

Definition at line 183 of file utoolbar.cpp.

Referenced by awidget, CColorMenu::DrawItem, operator=, and UToolbar::RebuildBar.

int awidget::cmd

Definition at line 184 of file utoolbar.cpp.

Referenced by awidget, UToolbar::OnUpdateUI, operator=, UToolbar::RebuildBar, and WININFO::Search.

char* awidget::tooltip

Definition at line 185 of file utoolbar.cpp.

Referenced by awidget, UToolbar::OnSetTooltip, operator=, and ~awidget.

UTB_VAR awidget::var

Definition at line 186 of file utoolbar.cpp.

Referenced by awidget, operator=, and UToolbar::RebuildBar.

The documentation for this class was generated from the following file:
  • rf/utoolbar.cpp
Generated on Sun Feb 24 01:24:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CBarConsole Class Reference

#include <ConsoleBar.h>

Inheritance diagram for CBarConsole:

[legend]
Collaboration diagram for CBarConsole:

[legend]
List of all members.

Public Methods

CBarConsole ()
virtual | ~CBarConsole ()

Public Attributes

CWincvsView * m_view

Protected Methods

afx_msg int | OnCreate (LPCREATESTRUCT lpCreateStruct)

Constructor & Destructor Documentation

CBarConsole::CBarConsole ( )

Definition at line 39 of file ConsoleBar.cpp.

00039                          : m_view(0L)
00040 {
00041     // TODO: add construction code here.
00042 }

CBarConsole::~CBarConsole ( ) [virtual]

Definition at line 44 of file ConsoleBar.cpp.

00045 {
00046     // TODO: add destruction code here.
00047 }

Member Function Documentation

int CBarConsole::OnCreate ( LPCREATESTRUCT lpCreateStruct ) [protected]

Reimplemented from CCJControlBar.

Definition at line 58 of file ConsoleBar.cpp.

References m_view, NULL, CCJControlBar::OnCreate, and CCJControlBar::SetChild.

00059 {
00060     if (CCJControlBar::OnCreate(lpCreateStruct) == -1)
00061         return -1;
00062
00063     m_view = (CWincvsView *)RUNTIME_CLASS(CWincvsView)->CreateObject();
00064     if(m_view == 0L)
00065     {
00066         TRACE0("Failed to create view for CBarConsole\n");
00067         return -1;
00068     }
00069
00070     // TODO: Add your specialized creation code here
00071     if (!m_view->Create(NULL, "",WS_CHILD | WS_VISIBLE | WS_BORDER,
00072         CRect(0,0,0,0), this, 0/*IDC_LIST_CTRL_2*/))
00073     {
00074         TRACE0("Failed to create view for CMyBarLeft\n");
00075         return -1;
00076     }
00077
00078     SetChild(m_view);
00079
00080     return 0;
00081 }

Member Data Documentation

CWincvsView* CBarConsole::m_view

Definition at line 45 of file ConsoleBar.h.

Referenced by CMainFrame::GetConsoleView, and OnCreate.

The documentation for this class was generated from the following files:
  • WinCvs/ConsoleBar.h
  • WinCvs/ConsoleBar.cpp
Generated on Sun Feb 24 01:24:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CBrowseFileView Class Reference

#include <BrowseFileView.h>

Inheritance diagram for CBrowseFileView:

[legend]
Collaboration diagram for CBrowseFileView:

[legend]
List of all members.

Public Methods

void | OnFilteringChanged ()
void | ResetView (const char *path, bool notifyBrowser=false, const char *selectFile=0L)
void | ResetView (bool notifyBrowser=false, const char *selectFile=0L)
void | CheckChanges (void)
void | Resort (void)
void | InvalidateView (void)
CFrameWnd * GetMainFrame ()
void | ProcessSelectionCommand (KiSelectionHandler *handler)
void | SaveColumns ()
bool | LoadColumns ()
KiColumnModel * | GetColumnModel () const
void | AddColumns ()
void | DeleteColumns ()
virtual BOOL | PreCreateWindow (CREATESTRUCT &cs)
virtual | ~CBrowseFileView ()
BOOL | SetViewType (DWORD dwViewType)
DWORD | GetViewType ()
const UStr & | GetPath () const

Static Public Methods

int | GetImageForEntry (EntnodeData *data)

Protected Methods

CBrowseFileView ()
bool | DisableCommon (bool bCheckSelection=true)
virtual void | OnInitialUpdate ()
virtual void | OnBeginPrinting (CDC *pDC, CPrintInfo *pInfo)
virtual BOOL | OnPreparePrinting (CPrintInfo *pInfo)
virtual void | OnPrint (CDC *pDC, CPrintInfo *pInfo)
void | GetEntriesModTime (time_t &newEntriesMod, time_t &newEntriesLogMod)
void | EditSel (EntnodeData *data, bool useDefault=false)
void | DoDrag ()
void | SetRecursive (bool isRecursive)
afx_msg void | OnViewSmallIcons ()
afx_msg void | OnViewList ()
afx_msg void | OnViewFullRowDetails ()
afx_msg void | OnUpdateViewSmallIcons (CCmdUI *pCmdUI)
afx_msg void | OnUpdateViewAdd (CCmdUI *pCmdUI)
afx_msg void | OnUpdateViewAddB (CCmdUI *pCmdUI)
afx_msg void | OnUpdateViewUpdate (CCmdUI *pCmdUI)
afx_msg void | OnUpdateViewRelease (CCmdUI *pCmdUI)
afx_msg void | OnUpdateViewRmv (CCmdUI *pCmdUI)
afx_msg void | OnUpdateViewGraph (CCmdUI *pCmdUI)
afx_msg void | OnUpdateViewList (CCmdUI *pCmdUI)
afx_msg void | OnUpdateViewEditseldef (CCmdUI *pCmdUI)
afx_msg void | OnUpdateViewFullRowDetails (CCmdUI *pCmdUI)
afx_msg void | OnLButtonDown (UINT nFlags, CPoint point)
afx_msg void | OnLButtonDblClk (UINT nFlags, CPoint point)
afx_msg void | OnColumnclick (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnViewAdd ()
afx_msg void | OnViewAddb ()
afx_msg void | OnViewCommit ()
afx_msg void | OnViewRmv ()
afx_msg void | OnViewUpdate ()
afx_msg void | OnViewQueryUpdate ()
afx_msg void | OnUpdateViewReload (CCmdUI *pCmdUI)
afx_msg void | OnViewReload ()
afx_msg void | OnKeydown (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnViewUpone ()
afx_msg void | OnUpdateViewUpone (CCmdUI *pCmdUI)
afx_msg void | OnViewTrash ()
afx_msg void | OnUpdateViewTrash (CCmdUI *pCmdUI)
afx_msg void | OnViewDiff ()
afx_msg void | OnViewLog ()
afx_msg void | OnViewGraph ()
afx_msg void | OnViewStatus ()
afx_msg void | OnViewUnlock ()
afx_msg void | OnViewWatchOn ()
afx_msg void | OnViewWatchOff ()
afx_msg void | OnViewEdit ()
afx_msg void | OnViewUnedit ()
afx_msg void | OnViewWatchers ()
afx_msg void | OnViewEditors ()
afx_msg void | OnViewRelease ()
afx_msg void | OnViewTagNew ()
afx_msg void | OnViewTagDelete ()
afx_msg void | OnViewTagBranch ()
afx_msg void | OnRButtonDown (UINT nFlags, CPoint point)
afx_msg void | OnViewExplore ()
afx_msg void | OnUpdateViewExplore (CCmdUI *pCmdUI)
afx_msg void | OnTimer (UINT nIDEvent)
afx_msg void | OnViewEditsel ()
afx_msg void | OnViewEditseldef ()
afx_msg void | OnViewCheckout ()
afx_msg void | OnUpdateViewCheckout (CCmdUI *pCmdUI)
afx_msg void | OnViewImport ()
afx_msg void | OnUpdateViewImport (CCmdUI *pCmdUI)
afx_msg void | OnBegindrag (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnBeginrdrag (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg BOOL | OnSetCursor (CWnd *pWnd, UINT nHitTest, UINT message)
afx_msg void | OnDeleteitem (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnDestroy ()
afx_msg void | OnUpdateQueryAnnotate (CCmdUI *pCmdUI)
afx_msg void | OnQueryAnnotate ()
afx_msg void | OnEditSelectAll ()
afx_msg void | OnViewReservededit ()
afx_msg void | OnViewForceedit ()
afx_msg void | OnViewAddu ()
afx_msg void | OnUpdateMacro (CCmdUI *pCmdUI)
afx_msg BOOL | OnMacro (UINT nID)
afx_msg void | OnUpdateCustomize (CCmdUI *pCmdUI)
afx_msg BOOL | OnCustomize (UINT nID)
afx_msg LRESULT | OnFileChange (WPARAM, LPARAM)
afx_msg LRESULT | OnResetView (WPARAM, LPARAM)
void | SetFullRowSel (BOOL bFullRowSel)

Protected Attributes

CSortHeaderCtrl m_ctrlHeader
UStr m_path
time_t | m_entriesMod
time_t | m_entriesLogMod
int | m_sort
bool | m_ascendant
KiColumnModel * m_modelColumns
bool | m_checkChanges
int | m_numberOfLines
int | m_numberByPages
int | m_numberOfPages
int | m_heightOfLines
bool | m_isRecursive
KoWatcher * m_watch
bool | m_isResetViewLocked
bool | m_isFilesChange
UINT | m_uiFilechangeTimer
bool | m_isResetViewPending

Static Protected Attributes

CImageList | m_SmallImageList
CImageList | m_StateImageList

Constructor & Destructor Documentation

CBrowseFileView::CBrowseFileView ( ) [protected]

Definition at line 394 of file BrowseFileView.cpp.

References m_ascendant, m_entriesLogMod, m_entriesMod, m_sort, NULL, and SetRecursive.

00395 : m_checkChanges(false)
00396 , m_watch(NULL)
00397 , m_isResetViewLocked(false)
00398 , m_isFilesChange(false)
00399 , m_isResetViewPending(false)
00400 , m_uiFilechangeTimer(0)
00401 {
00402     m_sort = (int)gFileViewSort;
00403     SetRecursive(false);
00404     m_ascendant = (bool)gFileViewSortAsc;
00405     m_entriesMod = 0;
00406     m_entriesLogMod = 0;
00407 }

CBrowseFileView::~CBrowseFileView ( ) [virtual]

Definition at line 409 of file BrowseFileView.cpp.

References m_ascendant, and m_sort.

00410 {
00411     gFileViewSortAsc = m_ascendant;
00412     gFileViewSort = m_sort;
00413 }

Member Function Documentation

void CBrowseFileView::AddColumns ( )

Definition at line 549 of file BrowseFileView.cpp.

References KiColumnModel::GetAt, GetColumnModel, KiColumnModel::GetCount, and KiColumn::GetSetupData.

Referenced by OnInitialUpdate, and ResetView.

00550 {
00551     KiColumnModel* model = GetColumnModel();
00552     int columnCount = model->GetCount();
00553     CListCtrl& listCtrl = GetListCtrl();
00554     for(int i = 0; i<columnCount; i++)
00555     {
00556         LV_COLUMN lvc;
00557         model->GetAt(i)->GetSetupData(&lvc);
00558         lvc.iSubItem = i;
00559         lvc.mask |= LVCF_SUBITEM;
00560         listCtrl.InsertColumn(i,&lvc);
00561     }
00562 }

void CBrowseFileView::CheckChanges ( void ) [inline]

Definition at line 92 of file BrowseFileView.h.

References m_checkChanges.

Referenced by CWincvsApp::IdleCvsProgress.

00092 { m_checkChanges = true; }

void CBrowseFileView::DeleteColumns ( )

Definition at line 564 of file BrowseFileView.cpp.

References GetColumnModel, and KiColumnModel::GetCount.

Referenced by ResetView.

00565 {
00566     KiColumnModel* model = GetColumnModel();
00567     int columnCount = model->GetCount();
00568     CListCtrl& listCtrl = GetListCtrl();
00569     for(int i = 0; i<columnCount; i++)
00570     {
00571         listCtrl.DeleteColumn(0);
00572     }
00573 }

bool CBrowseFileView::DisableCommon ( bool bCheckSelection = true ) [protected]

Definition at line 894 of file BrowseFileView.cpp.

References CWincvsApp::gCvsRunning.

Referenced by OnRButtonDown, OnUpdateMacro, OnUpdateQueryAnnotate, OnUpdateViewAdd, OnUpdateViewAddB, OnUpdateViewCheckout, OnUpdateViewEditseldef, OnUpdateViewExplore, OnUpdateViewGraph, OnUpdateViewImport, OnUpdateViewRelease, OnUpdateViewRmv, OnUpdateViewTrash, and OnUpdateViewUpdate.

00895 {
00896     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00897     CListCtrl& ListCtrl = GetListCtrl();
00898     bool bCommon = app->gCvsRunning || gCvsPrefs.empty();
00899     bool bSelection = ListCtrl.GetSelectedCount() == 0 || this != CWnd::GetFocus();
00900
00901     return bCheckSelection ? bCommon || bSelection : bCommon;
00902 }

void CBrowseFileView::DoDrag ( ) [protected]

Definition at line 1808 of file BrowseFileView.cpp.

References ENT_SUBDIR, FALSE, EntnodeData::GetFullPathName, EntnodeData::GetType, and NULL.

Referenced by OnBegindrag, and OnBeginrdrag.

01809 {
01810     CListCtrl& ListCtrl = GetListCtrl();
01811     int nItem=-1;
01812     int nSize = 0;
01813     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01814     {
01815         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01816         if(data->GetType()!=ENT_SUBDIR)
01817         {
01818             UStr buf;
01819             const char* fullpath = data->GetFullPathName(buf);
01820             nSize += strlen(fullpath) + 1;
01821         }
01822     }
01823     if(nSize>0)
01824     {
01825         HGLOBAL hMem = GlobalAlloc(GMEM_FIXED, sizeof(DROPFILES)+nSize+1);
01826         if(hMem!=NULL)
01827         {
01828             DROPFILES& df = *reinterpret_cast<DROPFILES*>(hMem);
01829             df.pFiles = sizeof(DROPFILES);
01830             df.fNC = FALSE;
01831             df.pt.x = df.pt.y = 0;
01832             df.fWide = FALSE;
01833
01834             nItem=-1;
01835             int Offset = sizeof(DROPFILES);
01836             while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01837             {
01838                 EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01839                 if(data->GetType()!=ENT_SUBDIR)
01840                 {
01841                     UStr buf;
01842                     const char* fullpath = data->GetFullPathName(buf);
01843                     int len = strlen(fullpath) + 1;
01844                     memcpy(reinterpret_cast<BYTE*>(hMem)+Offset, fullpath, len);
01845                     Offset+=len;
01846                 }
01847             }
01848             reinterpret_cast<BYTE*>(hMem)[Offset]=0;
01849
01850             COleDataSource ds;
01851             ds.CacheGlobalData( CF_HDROP, hMem );
01852             ds.DoDragDrop( DROPEFFECT_COPY );
01853         }
01854     }
01855 }

void CBrowseFileView::EditSel | ( | EntnodeData * | data,
 |  | bool | useDefault = false
 | ) | [protected]

Definition at line 848 of file BrowseFileView.cpp.

References cvs_err, ENT_SUBDIR, EntnodeData::GetFullPathName, EntnodeData::GetType, LaunchViewer, ResetView, and stat.

Referenced by OnKeydown, OnLButtonDblClk, OnViewEditsel, and OnViewEditseldef.

00849 {
00850     UStr buf;
00851     const char* fullpath = data->GetFullPathName(buf);
00852     if(data->GetType() == ENT_SUBDIR)
00853     {
00854         struct stat st;
00855         if (stat(fullpath, &st) != 0 && errno == ENOENT)
00856         {
00857             // Assume we're looking at directory previously in CVS,
00858             // but not currently in the filesystem.
00859             // If we ever run across another case (permissions perhaps)
00860             // then you might want to add code here.
00861             cvs_err("'%s' is not accessible\n", (char*)fullpath);
00862         }
00863         else
00864         {
00865             ResetView(fullpath, true);
00866             gCvsPrefs.SetLastWorkingDir(fullpath);
00867         }
00868     }
00869     else
00870     {
00871         LaunchViewer(fullpath, useDefault);
00872     }
00873 }

KiColumnModel* CBrowseFileView::GetColumnModel ( ) const [inline]

Definition at line 120 of file BrowseFileView.h.

References m_modelColumns.

Referenced by AddColumns, DeleteColumns, TViewFill::InitItem, OnColumnclick, OnPrint, ResetView, and Resort.

00121     {
00122         return m_modelColumns;
00123     }

void CBrowseFileView::GetEntriesModTime | ( | time_t & | newEntriesMod,
 |  | time_t & | newEntriesLogMod
 | ) | [protected]

Definition at line 575 of file BrowseFileView.cpp.

References m_path, and stat.

Referenced by OnTimer, and ResetView.

00577 {
00578     newEntriesMod = 0;
00579     newEntriesLogMod = 0;
00580     if(chdir(m_path) != 0)
00581         return;
00582     if(chdir("CVS") != 0)
00583         return;
00584
00585     struct stat sb;
00586     if (stat("Entries", &sb) != -1)
00587         newEntriesMod = sb.st_mtime;
00588     if (stat("Entries.log", &sb) != -1)
00589         newEntriesLogMod = sb.st_mtime;
00590     chdir(m_path);
00591 }

int CBrowseFileView::GetImageForEntry ( EntnodeData * data ) [static]

Definition at line 428 of file BrowseFileView.cpp.

References ENT_FILE, EntnodeData::GetConflict, EntnodeData::GetType, EntnodeData::IsIgnored, EntnodeData::IsRemoved, EntnodeData::IsUnknown, EntnodeData::IsUnmodified, kFileIconBinaryAdded, kFileIconUnicode, kFileIconUnicodeAdded, kFileIconUnicodeMod, EntnodeFile::kOption, and EntnodeFile::kVN.

Referenced by TViewFill::OnDirectory, TViewFill::OnFile, and CWinLogRevData::UpdateSelf.

00429 {
00430     int result;
00431     if(data->GetType() == ENT_FILE)
00432     {
00433         const char *info = 0L;
00434         if(data->IsIgnored())
00435         {
00436             result = kFileIconIgnored;
00437         }
00438         else if(data->IsUnknown())
00439         {
00440             result = kFileIconUnknown;
00441         }
00442         else if(data->GetConflict() != 0L)
00443         {
00444             result = kFileIconConflict;
00445         }
00446         else if(data->IsRemoved())
00447         {
00448             result = kFileIconRemoved;
00449         }
00450         else if((info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-kb") == 0)
00451         {
00452             const char* vn = (*data)[EntnodeFile::kVN];
00453             bool isAdded = vn && (strcmp(vn, "0") == 0);
00454
00455             result = data->IsUnmodified() ? kFileIconBinary :
00456                 isAdded ? kFileIconBinaryAdded : kFileIconBinaryMod;
00457         }
00458         else if((info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-ku") == 0)
00459         {
00460             const char* vn = (*data)[EntnodeFile::kVN];
00461             bool isAdded = vn && (strcmp(vn, "0") == 0);
00462
00463             result = data->IsUnmodified() ? kFileIconUnicode :
00464                 isAdded ? kFileIconUnicodeAdded : kFileIconUnicodeMod;
00465         }
00466         else
00467         {
00468             const char* vn = (*data)[EntnodeFile::kVN];
00469             bool isAdded = vn && (strcmp(vn, "0") == 0);
00470
00471             result = data->IsUnmodified() ? kFileIconText :
00472                 isAdded ? kFileIconAdded : kFileIconTextMod;
00473         }
00474     }
00475     else
00476     {
00477         if(data->IsIgnored())
00478         {
00479             result = kFolderIconIgnored;
00480         }
00481         else if(data->IsUnknown())
00482         {
00483             result = kFolderIconUnknown;
00484         }
00485         else
00486         {
00487             result = kFolderIcon;
00488         }
00489     }
00490
00491     return result;
00492 }

CFrameWnd* CBrowseFileView::GetMainFrame ( ) [inline]

Definition at line 107 of file BrowseFileView.h.

00107 { return GetRoutingFrame(); }

const UStr& CBrowseFileView::GetPath ( ) const [inline]

Definition at line 288 of file BrowseFileView.h.

References CStr, and m_path.

Referenced by CWincvsApp::InitInstance, OnPrint, ProcessSelectionCommand, and Resort.

00288 { return m_path; };

DWORD CBrowseFileView::GetViewType ( )

Definition at line 805 of file BrowseFileView.cpp.

Referenced by OnUpdateViewFullRowDetails, OnUpdateViewList, OnUpdateViewSmallIcons, OnViewFullRowDetails, OnViewList, and OnViewSmallIcons.

00806 {
00807     return(GetStyle() & LVS_TYPEMASK);
00808 }

void CBrowseFileView::InvalidateView ( void )

Definition at line 415 of file BrowseFileView.cpp.

References m_entriesMod.

00416 {
00417     m_entriesMod = 0;
00418 }

bool CBrowseFileView::LoadColumns ( )

Definition at line 1921 of file BrowseFileView.cpp.

References m_ctrlHeader.

Referenced by OnInitialUpdate.

01922 {
01923     CString widths = AfxGetApp()->GetProfileString("FileDetailView", "Column Widths");
01924     CString orders  = AfxGetApp()->GetProfileString("FileDetailView", "Column Order");
01925     if (widths.IsEmpty() || orders.IsEmpty())
01926     {
01927         return false;
01928     }
01929
01930     int count = m_ctrlHeader.GetItemCount();
01931     int order[128];
01932     for (int i = 0; i < count; ++i)
01933     {
01934         CString strSubString;
01935         AfxExtractSubString( strSubString, widths, i, _T(' '));
01936         int width =  _ttoi( strSubString );
01937         GetListCtrl().SetColumnWidth(i, width);
01938
01939         AfxExtractSubString( strSubString, orders, i, _T(' '));
01940         order[i] =  _ttoi( strSubString );
01941     }
01942     m_ctrlHeader.SetOrderArray(count, order);
01943
01944     return true;
01945 }

void CBrowseFileView::OnBegindrag | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 1857 of file BrowseFileView.cpp.

References DoDrag.

01858 {
01859     DoDrag();
01860     *pResult = 0;
01861 }

void CBrowseFileView::OnBeginPrinting | ( | CDC * | pDC,
 |  | CPrintInfo * | pInfo
 | ) | [protected, virtual]

Definition at line 1600 of file BrowseFileView.cpp.

References m_heightOfLines, m_numberByPages, m_numberOfLines, and m_numberOfPages.

01601 {
01602     CListView::OnBeginPrinting(pDC, pInfo);
01603
01604     int nPageHeight = pDC->GetDeviceCaps(VERTRES);
01605     TEXTMETRIC tm;
01606     pDC->GetTextMetrics(&tm);
01607
01608     // compute the bounds
01609     CListCtrl& ListCtrl = GetListCtrl();
01610     m_numberOfLines = ListCtrl.GetItemCount();
01611     m_heightOfLines = 2 * tm.tmHeight;
01612     m_numberByPages = nPageHeight / m_heightOfLines;
01613     m_numberOfPages = m_numberOfLines / m_numberByPages + 1;
01614
01615     pInfo->SetMaxPage(m_numberOfPages);
01616 }

void CBrowseFileView::OnBeginrdrag | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 1863 of file BrowseFileView.cpp.

References DoDrag.

01864 {
01865     DoDrag();
01866     *pResult = 0;
01867 }

void CBrowseFileView::OnColumnclick | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 1117 of file BrowseFileView.cpp.

References KiColumnModel::GetAt, GetColumnModel, KiColumn::IsDefaultAscending, m_ascendant, m_sort, and Resort.

01118 {
01119     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
01120     CListCtrl& ListCtrl = GetListCtrl();
01121
01122     if(pNMListView->iSubItem == m_sort)
01123         m_ascendant = !m_ascendant;
01124     else
01125     {
01126         m_ascendant = true;
01127         m_sort = pNMListView->iSubItem;
01128         KiColumnModel* model = GetColumnModel();
01129         m_ascendant = model->GetAt(m_sort)->IsDefaultAscending();
01130     }
01131
01132     Resort();
01133     *pResult = 0;
01134 }

BOOL CBrowseFileView::OnCustomize ( UINT nID ) [protected]

Definition at line 1449 of file BrowseFileView.cpp.

References CustomizeMenus, ID_CUST_FILES_MENU, kCustomBrowserMenu, kCustomFilesMenu, and TRUE.

01450 {
01451     CustomizeMenus(nID == ID_CUST_FILES_MENU ? kCustomFilesMenu : kCustomBrowserMenu);
01452     return TRUE;
01453 }

void CBrowseFileView::OnDeleteitem | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 1969 of file BrowseFileView.cpp.

References EntnodeData::UnRef.

01970 {
01971     NM_LISTVIEW* p = (NM_LISTVIEW*)pNMHDR;
01972     if (p->lParam)
01973     {
01974         EntnodeData* data = (EntnodeData*)(LPVOID)p->lParam;
01975         data->UnRef();
01976     }
01977     *pResult = 0;
01978 }

void CBrowseFileView::OnDestroy ( ) [protected]

Definition at line 1869 of file BrowseFileView.cpp.

References NotificationManager::CheckOut, CWincvsApp::GetFilterModel, CWincvsApp::GetIgnoreModel, KiIgnoreModel::GetNotificationManager, KiRecursionModel::GetNotificationManager, KiFilterModel::GetNotificationManager, CWincvsApp::GetRecursionModel, m_uiFilechangeTimer, m_watch, NULL, SaveColumns, and KoWatcher::SignalTerminate.

01870 {
01871     SaveColumns();
01872     if(m_watch)
01873     {
01874         m_watch->SignalTerminate();
01875         m_watch = NULL;
01876     }
01877
01878     // unregister notifications
01879     if (CWincvsApp* app = (CWincvsApp *)AfxGetApp())
01880     {
01881         app->GetFilterModel()->GetNotificationManager()->CheckOut(this);
01882         app->GetRecursionModel()->GetNotificationManager()->CheckOut(this);
01883         app->GetIgnoreModel()->GetNotificationManager()->CheckOut(this);
01884     }
01885
01886     //kill the timer
01887     if( m_uiFilechangeTimer )
01888     {
01889         KillTimer(m_uiFilechangeTimer);
01890     }
01891
01892     CListView::OnDestroy();
01893 }

void CBrowseFileView::OnEditSelectAll ( ) [protected]

Definition at line 2019 of file BrowseFileView.cpp.

References ENT_FILE, and EntnodeData::GetType.

02020 {
02021     CListCtrl& ListCtrl = GetListCtrl();
02022
02023     for( int nIndex = 0; nIndex < ListCtrl.GetItemCount(); nIndex++ )
02024     {
02025         EntnodeData *data = (EntnodeData*)ListCtrl.GetItemData(nIndex);
02026         if( data->GetType() == ENT_FILE )
02027         {
02028             ListCtrl.SetItemState(nIndex, LVIS_SELECTED, LVIS_SELECTED);
02029         }
02030     }
02031
02032     if( ListCtrl.GetSelectedCount() )
02033     {
02034         ListCtrl.SetFocus();
02035     }
02036 }

LRESULT CBrowseFileView::OnFileChange | ( | WPARAM | ,
 |  | LPARAM |
 | ) | [protected]

Definition at line 1583 of file BrowseFileView.cpp.

References m_isFilesChange.

01584 {
01585     m_isFilesChange = true;
01586     return 0;
01587 }

void CBrowseFileView::OnFilteringChanged ( )

Definition at line 1960 of file BrowseFileView.cpp.

References m_isResetViewPending, and WM_RESETVIEW.

01961 {
01962     if (!m_isResetViewPending)
01963     {
01964         m_isResetViewPending = true;
01965         PostMessage(WM_RESETVIEW);
01966     }
01967 }

void CBrowseFileView::OnInitialUpdate ( ) [protected, virtual]

Definition at line 505 of file BrowseFileView.cpp.

References AddColumns, NotificationManager::CheckIn, cvs_err, FILECHANGE_TIMER, CWincvsApp::GetFilterModel, CWincvsApp::GetIgnoreModel, KiIgnoreModel::GetNotificationManager, KiRecursionModel::GetNotificationManager, KiFilterModel::GetNotificationManager, CWincvsApp::GetRecursionModel, IDB_SMALLICONS, IDR_STATEICONS, KoTraversalContext::IsRecursive, LoadColumns, m_ctrlHeader, m_SmallImageList, m_StateImageList, m_uiFilechangeTimer, onFilteringChanged, SetFullRowSel, SetRecursive, and TRUE.

00506 {
00507     CListView::OnInitialUpdate();
00508
00509     CListCtrl& ListCtrl = GetListCtrl();
00510
00511     // Replace standard header with sort header
00512     if (HWND hWnd = ListView_GetHeader(ListCtrl.m_hWnd))
00513     {
00514         m_ctrlHeader.SubclassWindow(hWnd);
00515     }
00516     ListCtrl.SetExtendedStyle(LVS_EX_HEADERDRAGDROP);
00517
00518 // set image lists
00519     if(m_SmallImageList.m_hImageList == 0L)
00520         m_SmallImageList.Create(IDB_SMALLICONS, 16, 1, RGB(255, 255, 255));
00521     if(m_StateImageList.m_hImageList == 0L)
00522         m_StateImageList.Create(IDR_STATEICONS, 16, 1, RGB(255, 0, 0));
00523
00524     ListCtrl.SetImageList(&m_SmallImageList, LVSIL_SMALL);
00525     ListCtrl.SetImageList(&m_StateImageList, LVSIL_STATE);
00526
00527     KoTraversalContext context(this);
00528     SetRecursive(context.IsRecursive());
00529     AddColumns();
00530     SetFullRowSel(TRUE);
00531
00532     LoadColumns();
00533
00534     // register for notifications on filter change
00535     if (CWincvsApp* app = (CWincvsApp *)AfxGetApp())
00536     {
00537         app->GetFilterModel()->GetNotificationManager()->CheckIn(this, onFilteringChanged);
00538         app->GetRecursionModel()->GetNotificationManager()->CheckIn(this, onFilteringChanged);
00539         app->GetIgnoreModel()->GetNotificationManager()->CheckIn(this, onFilteringChanged);
00540     }
00541
00542     m_uiFilechangeTimer = SetTimer(FILECHANGE_TIMER, 200, 0L);
00543     if( 0L == m_uiFilechangeTimer )
00544     {
00545         cvs_err("Can't start the file change notification timer.\n");
00546     }
00547 }

void CBrowseFileView::OnKeydown | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 1226 of file BrowseFileView.cpp.

References EditSel, ENT_SUBDIR, CWincvsApp::gCvsRunning, EntnodeData::GetFullPathName, EntnodeData::GetType, OnViewUpone, and ResetView.

01227 {
01228     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01229     if(app->gCvsRunning)
01230         return;
01231
01232     CListCtrl& ListCtrl = GetListCtrl();
01233     LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pNMHDR;
01234
01235     if(pLVKeyDow->wVKey == VK_BACK)
01236     {
01237         OnViewUpone();
01238     }
01239     else if(pLVKeyDow->wVKey == VK_RETURN && ListCtrl.GetSelectedCount() == 1)
01240     {
01241         int nItem = -1;
01242         if((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01243         {
01244             EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01245             if(data->GetType() == ENT_SUBDIR)
01246             {
01247                 UStr buf;
01248                 const char* fullpath = data->GetFullPathName(buf);
01249                 ResetView(fullpath, true);
01250             }
01251             else
01252             {
01253                 EditSel(data);
01254             }
01255         }
01256     }
01257
01258     *pResult = 0;
01259 }

void CBrowseFileView::OnLButtonDblClk | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 875 of file BrowseFileView.cpp.

References EditSel, and CWincvsApp::gCvsRunning.

00876 {
00877     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00878     if(app->gCvsRunning)
00879         return;
00880
00881     CListCtrl& ListCtrl = GetListCtrl();
00882
00883     UINT pFlags;
00884     int nItem = ListCtrl.HitTest(point, &pFlags);
00885     if(nItem != -1)
00886     {
00887         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
00888         EditSel(data);
00889     }
00890
00891     CListView::OnLButtonDblClk(nFlags, point);
00892 }

void CBrowseFileView::OnLButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 843 of file BrowseFileView.cpp.

00844 {
00845     CListView::OnLButtonDown(nFlags, point);
00846 }

BOOL CBrowseFileView::OnMacro ( UINT nID ) [protected]

Definition at line 1460 of file BrowseFileView.cpp.

References PyDoPython, and WINCMD_to_UCMD.

01461 {
01462     PyDoPython(WINCMD_to_UCMD(nID));
01463
01464     return 1;
01465 }

BOOL CBrowseFileView::OnPreparePrinting ( CPrintInfo * pInfo ) [protected, virtual]

Definition at line 1618 of file BrowseFileView.cpp.

References TRUE.

01619 {
01620     BOOL res = DoPreparePrinting(pInfo);
01621     if(!res)
01622         return res;
01623
01624     return TRUE;
01625 }

void CBrowseFileView::OnPrint | ( | CDC * | pDC,
 |  | CPrintInfo * | pInfo
 | ) | [protected, virtual]

Definition at line 1627 of file BrowseFileView.cpp.

References KiColumnModel::GetAt, GetColumnModel, KiColumnModel::GetCount, GetPath, KiColumn::GetText, kSpc, m_heightOfLines, and m_numberByPages.

01628 {
01629     if (!pDC->IsPrinting())
01630         return;
01631
01632     // now compute the first item to draw
01633     CListCtrl& ListCtrl = GetListCtrl();
01634     int nFirstItem = -1;
01635     int numToIgnore = m_numberByPages * (pInfo->m_nCurPage - 1);
01636     while(numToIgnore-- && (nFirstItem = ListCtrl.GetNextItem(nFirstItem, LVNI_ALL)) != -1)
01637     {
01638     }
01639
01640     TEXTMETRIC tm;
01641     pDC->GetTextMetrics(&tm);
01642
01643     int nItem = nFirstItem, n = 0;
01644     int horz = pInfo->m_rectDraw.Width();
01645     int vert = pInfo->m_rectDraw.Height();
01646     // measure for each column
01647     KiColumnModel* model = GetColumnModel();
01648     int columnCount = model->GetCount();
01649     std::vector<int> widths(columnCount, 0);
01650     int totalwidth = 0;
01651     int j;
01652     KoColumnContext context(GetPath());
01653     while(n++ < m_numberByPages && (nItem = ListCtrl.GetNextItem(nItem, LVNI_ALL)) != -1)
01654     {
01655         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01656         for(j = 0; j < columnCount; j++)
01657         {
01658             TCHAR buffer[256];
01659             model->GetAt(j)->GetText(&context, data, buffer, 256);
01660             int width = pDC->GetTextExtent(buffer, _tcslen(buffer)).cx + kSpc;
01661             widths[j] = max(widths[j], width);
01662         }
01663     }
01664
01665     for(j = 0; j < columnCount; j++)
01666     {
01667         totalwidth += widths[j];
01668     }
01669
01670     for(j = 0; j < columnCount; j++)
01671     {
01672         widths[j] += (horz - totalwidth) / columnCount;
01673     }
01674
01675     // compute the margins
01676     for(j = columnCount - 1; j >= 0; j--)
01677     {
01678         int margin = 0;
01679         for(int i = j - 1; i >= 0; i--)
01680         {
01681             margin += widths[i];
01682         }
01683         widths[j] = margin;
01684     }
01685     // now print
01686     nItem = nFirstItem;
01687     n = 0;
01688     CPoint off = pInfo->m_rectDraw.TopLeft();
01689     while(n++ < m_numberByPages && (nItem = ListCtrl.GetNextItem(nItem, LVNI_ALL)) != -1)
01690     {
01691         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01692         for(j = 0; j < columnCount; j++)
01693         {
01694             const char *info = (*data)[j];
01695             if(info == 0L)
01696                 continue;
01697
01698             CPoint where = off;
01699             where.x += widths[j];
01700             CString s(info);
01701             CRect r(0,0,0,0);
01702             pDC->DrawText(s, -1, &r, DT_CALCRECT);
01703             r.OffsetRect(where);
01704             pDC->DrawText(s, -1, &r, DT_CENTER);
01705         }
01706         off += CPoint(0, m_heightOfLines);
01707     }
01708     //CListView::OnPrint(pDC, pInfo);
01709 }

void CBrowseFileView::OnQueryAnnotate ( ) [protected]

Definition at line 2013 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

02014 {
02015     KoAnnotateHandler handler;
02016     ProcessSelectionCommand(&handler);
02017 }

void CBrowseFileView::OnRButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 1401 of file BrowseFileView.cpp.

References DisableCommon, and kCustomFilesMenu.

01402 {
01403     CListView::OnRButtonDown(nFlags, point);
01404
01405     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01406     CListCtrl& ListCtrl = GetListCtrl();
01407
01408     if(DisableCommon())
01409         return;
01410
01411     UINT pFlags;
01412     int testItem = ListCtrl.HitTest(point, &pFlags);
01413     if(testItem == -1)
01414         return;
01415
01416     if(ListCtrl.GetItemState(testItem, LVIS_SELECTED) == 0)
01417         return;
01418
01419     if(pFlags & (LVHT_ONITEMICON|LVHT_ONITEMLABEL|LVHT_ONITEMSTATEICON) == 0)
01420         return;
01421
01422     CMenu* pMyMenu=::GetCustomMenu(kCustomFilesMenu,this);
01423     if (pMyMenu)
01424     {
01425         ClientToScreen(&point);
01426         pMyMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON, point.x, point.y, this);
01427         delete pMyMenu;
01428     }
01429 }

LRESULT CBrowseFileView::OnResetView | ( | WPARAM | ,
 |  | LPARAM |
 | ) | [protected]

Definition at line 1980 of file BrowseFileView.cpp.

References NULL, and ResetView.

01981 {
01982     ResetView(false, NULL);
01983     return 0;
01984 }

BOOL CBrowseFileView::OnSetCursor | ( | CWnd * | pWnd,
 |  | UINT | nHitTest,
 |  | UINT | message
 | ) | [protected]

Definition at line 1947 of file BrowseFileView.cpp.

References CWincvsApp::gCvsRunning, and TRUE.

01948 {
01949     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01950     if(app->gCvsRunning)
01951     {
01952         SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
01953         return TRUE;
01954     }
01955
01956     return CListView::OnSetCursor(pWnd, nHitTest, message);
01957 }

void CBrowseFileView::OnTimer ( UINT nIDEvent ) [protected]

Definition at line 1546 of file BrowseFileView.cpp.

References CWincvsApp::gCvsRunning, GetEntriesModTime, m_checkChanges, m_entriesLogMod, m_entriesMod, m_uiFilechangeTimer, and ResetView.

01547 {
01548     if (nIDEvent == m_uiFilechangeTimer)
01549     {
01550         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01551         if(!app->gCvsRunning)
01552         {
01553             // cvs command finished
01554             if( m_checkChanges )
01555             {
01556                 // Refresh the directory tree and file view
01557                 m_checkChanges = false;
01558                 ResetView(true);
01559
01560                 return;
01561             }
01562
01563             // file change
01564             if (m_isFilesChange )
01565             {
01566                 ResetView();
01567             }
01568
01569             // check if we need to reload
01570             time_t newEntriesMod;
01571             time_t newEntriesLogMod;
01572             GetEntriesModTime(newEntriesMod, newEntriesLogMod);
01573             if (m_entriesMod != newEntriesMod || m_entriesLogMod != newEntriesLogMod)
01574             {
01575                 ResetView();
01576             }
01577         }
01578         return;
01579     }
01580     CListView::OnTimer(nIDEvent);
01581 }

void CBrowseFileView::OnUpdateCustomize ( CCmdUI * pCmdUI ) [protected]

Definition at line 1455 of file BrowseFileView.cpp.

References TRUE.

01456 {
01457     pCmdUI->Enable(TRUE);
01458 }

void CBrowseFileView::OnUpdateMacro ( CCmdUI * pCmdUI ) [protected]

Definition at line 1467 of file BrowseFileView.cpp.

References DisableCommon, FALSE, UCmdUI::pCmdUI, PyAppendCache, PyDoCmdUI, PyIsUICacheValid, and WINCMD_to_UCMD.

01468 {
01469     if(DisableCommon(false))
01470     {
01471         pCmdUI->Enable(FALSE);
01472         return;
01473     }
01474
01475     // fill the cache with current selection
01476     if(!PyIsUICacheValid())
01477     {
01478         CListCtrl& ListCtrl = GetListCtrl();
01479         int nItem = -1;
01480         while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01481         {
01482             EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01483             PyAppendCache(data);
01484         }
01485     }
01486
01487     UCmdUI ucmdui(WINCMD_to_UCMD(pCmdUI->m_nID));
01488     ucmdui.pCmdUI = pCmdUI;
01489     PyDoCmdUI(&ucmdui);
01490 }

void CBrowseFileView::OnUpdateQueryAnnotate ( CCmdUI * pCmdUI ) [protected]

Definition at line 1986 of file BrowseFileView.cpp.

References DisableCommon, ENT_SUBDIR, FALSE, EntnodeData::GetType, EntnodeData::IsUnknown, and TRUE.

01987 {
01988     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01989     CListCtrl& ListCtrl = GetListCtrl();
01990
01991     if(DisableCommon())
01992     {
01993         pCmdUI->Enable(FALSE);
01994         return;
01995     }
01996
01997     int nItem = -1;
01998     BOOL res = TRUE;
01999
02000     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
02001     {
02002         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
02003         if(data->IsUnknown() || data->GetType() == ENT_SUBDIR)
02004         {
02005             res = FALSE;
02006             break;
02007         }
02008     }
02009
02010     pCmdUI->Enable(res);
02011 }

void CBrowseFileView::OnUpdateViewAdd ( CCmdUI * pCmdUI ) [protected]

Definition at line 940 of file BrowseFileView.cpp.

References DisableCommon, ENT_FILE, FALSE, EntnodeData::GetType, EntnodeData::IsMissing, EntnodeData::IsRemoved, EntnodeData::IsUnknown, and TRUE.

00941 {
00942     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00943     CListCtrl& ListCtrl = GetListCtrl();
00944
00945     if(DisableCommon())
00946     {
00947         pCmdUI->Enable(FALSE);
00948         return;
00949     }
00950
00951     int nItem = -1;
00952     BOOL res = TRUE;
00953     int numFiles = 0;
00954     int numFolders = 0;
00955
00956     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
00957     {
00958         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
00959         if(!(data->IsUnknown() || (data->IsRemoved() && data->IsMissing())))
00960         {
00961             res = FALSE;
00962             break;
00963         }
00964         if(data->GetType() == ENT_FILE)
00965         {
00966             numFiles++;
00967         }
00968         else
00969             numFolders++;
00970
00971         if((numFiles != 0 && numFolders != 0) || numFolders > 1)
00972         {
00973             res = FALSE;
00974             break;
00975         }
00976     }
00977
00978     pCmdUI->Enable(res);
00979 }

void CBrowseFileView::OnUpdateViewAddB ( CCmdUI * pCmdUI ) [protected]

Definition at line 981 of file BrowseFileView.cpp.

References DisableCommon, ENT_FILE, FALSE, EntnodeData::GetType, EntnodeData::IsMissing, EntnodeData::IsRemoved, EntnodeData::IsUnknown, and TRUE.

00982 {
00983     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00984     CListCtrl& ListCtrl = GetListCtrl();
00985
00986     if(DisableCommon())
00987     {
00988         pCmdUI->Enable(FALSE);
00989         return;
00990     }
00991
00992     int nItem = -1;
00993     BOOL res = TRUE;
00994
00995     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
00996     {
00997         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
00998         if(data->GetType() != ENT_FILE)
00999         {
01000             res = FALSE;
01001             break;
01002         }
01003         if(!(data->IsUnknown() || (data->IsRemoved() && data->IsMissing())))
01004         {
01005             res = FALSE;
01006             break;
01007         }
01008     }
01009
01010     pCmdUI->Enable(res);
01011 }

void CBrowseFileView::OnUpdateViewCheckout ( CCmdUI * pCmdUI ) [protected]

Definition at line 1774 of file BrowseFileView.cpp.

References DisableCommon, FALSE, and TRUE.

01775 {
01776     if(DisableCommon(false))
01777     {
01778         pCmdUI->Enable(FALSE);
01779         return;
01780     }
01781     pCmdUI->Enable(TRUE);
01782     pCmdUI->SetText("Chec&kout module...");
01783 }

void CBrowseFileView::OnUpdateViewEditseldef ( CCmdUI * pCmdUI ) [protected]

Definition at line 1737 of file BrowseFileView.cpp.

References DisableCommon, ENT_SUBDIR, FALSE, FormatMenuString, EntnodeData::GetType, EntnodeData::IsMissing, and TRUE.

01738 {
01739     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01740     CListCtrl& ListCtrl = GetListCtrl();
01741     if(DisableCommon())
01742     {
01743         pCmdUI->Enable(FALSE);
01744         return;
01745     }
01746
01747     int nItem = -1;
01748     BOOL res = TRUE;
01749
01750     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01751     {
01752         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01753         if(data->GetType() == ENT_SUBDIR || data->IsMissing())
01754         {
01755             res = FALSE;
01756             break;
01757         }
01758     }
01759
01760     CString str;
01761     if( FormatMenuString(pCmdUI->m_nID, str) && pCmdUI->m_pParentMenu )
01762     {
01763         pCmdUI->SetText(str);
01764     }
01765
01766     pCmdUI->Enable(res);
01767 }

void CBrowseFileView::OnUpdateViewExplore ( CCmdUI * pCmdUI ) [protected]

Definition at line 1519 of file BrowseFileView.cpp.

References DisableCommon, FALSE, EntnodeData::IsMissing, and TRUE.

01520 {
01521     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01522     CListCtrl& ListCtrl = GetListCtrl();
01523     if(DisableCommon())
01524     {
01525         pCmdUI->Enable(FALSE);
01526         return;
01527     }
01528
01529     int nItem = -1;
01530     int numItem = 0;
01531     BOOL res = TRUE;
01532
01533     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01534     {
01535         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01536         if(data->IsMissing() || ++numItem > 1)
01537         {
01538             res = FALSE;
01539             break;
01540         }
01541     }
01542
01543     pCmdUI->Enable(res);
01544 }

void CBrowseFileView::OnUpdateViewFullRowDetails ( CCmdUI * pCmdUI ) [protected]

Definition at line 838 of file BrowseFileView.cpp.

References GetViewType.

00839 {
00840     pCmdUI->SetCheck(GetViewType() == LVS_REPORT);
00841 }

void CBrowseFileView::OnUpdateViewGraph ( CCmdUI * pCmdUI ) [protected]

Definition at line 1052 of file BrowseFileView.cpp.

References DisableCommon, ENT_SUBDIR, FALSE, EntnodeData::GetType, EntnodeData::IsUnknown, and TRUE.

01053 {
01054     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01055     CListCtrl& ListCtrl = GetListCtrl();
01056
01057     if(DisableCommon())
01058     {
01059         pCmdUI->Enable(FALSE);
01060         return;
01061     }
01062
01063     int nItem = -1;
01064     BOOL res = TRUE;
01065
01066     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01067     {
01068         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01069         if(data->IsUnknown() || data->GetType() == ENT_SUBDIR)
01070         {
01071             res = FALSE;
01072             break;
01073         }
01074     }
01075
01076     pCmdUI->Enable(res);
01077 }

void CBrowseFileView::OnUpdateViewImport ( CCmdUI * pCmdUI ) [protected]

Definition at line 1790 of file BrowseFileView.cpp.

References DisableCommon, FALSE, and TRUE.

01791 {
01792     if(DisableCommon())
01793     {
01794         pCmdUI->Enable(FALSE);
01795         return;
01796     }
01797     pCmdUI->Enable(TRUE);
01798     pCmdUI->SetText("&Import module...");
01799 }

void CBrowseFileView::OnUpdateViewList ( CCmdUI * pCmdUI ) [protected]

Definition at line 833 of file BrowseFileView.cpp.

References GetViewType.

00834 {
00835     pCmdUI->SetCheck(GetViewType() == LVS_LIST);
00836 }

void CBrowseFileView::OnUpdateViewRelease ( CCmdUI * pCmdUI ) [protected]

Definition at line 904 of file BrowseFileView.cpp.

References DisableCommon, ENT_SUBDIR, FALSE, EntnodeData::GetType, EntnodeData::IsUnknown, and TRUE.

00905 {
00906     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00907     CListCtrl& ListCtrl = GetListCtrl();
00908
00909     if(DisableCommon())
00910     {
00911         pCmdUI->Enable(FALSE);
00912         return;
00913     }
00914
00915     int nItem = -1;
00916     BOOL res = TRUE;
00917     int numFiles = 0;
00918     int numFolders = 0;
00919
00920     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
00921     {
00922         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
00923         if(data->IsUnknown() || data->GetType() != ENT_SUBDIR)
00924         {
00925             res = FALSE;
00926             break;
00927         }
00928         numFolders++;
00929
00930         if(numFolders > 1)
00931         {
00932             res = FALSE;
00933             break;
00934         }
00935     }
00936
00937     pCmdUI->Enable(res);
00938 }

void CBrowseFileView::OnUpdateViewReload ( CCmdUI * pCmdUI ) [protected]

Definition at line 1215 of file BrowseFileView.cpp.

References CWincvsApp::gCvsRunning.

01216 {
01217     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01218     pCmdUI->Enable(!app->gCvsRunning);
01219 }

void CBrowseFileView::OnUpdateViewRmv ( CCmdUI * pCmdUI ) [protected]

Definition at line 1079 of file BrowseFileView.cpp.

References DisableCommon, ENT_SUBDIR, FALSE, EntnodeData::GetType, EntnodeData::IsRemoved, EntnodeData::IsUnknown, and TRUE.

01080 {
01081     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01082     CListCtrl& ListCtrl = GetListCtrl();
01083
01084     if(DisableCommon())
01085     {
01086         pCmdUI->Enable(FALSE);
01087         return;
01088     }
01089
01090     int nItem = -1;
01091     BOOL res = TRUE;
01092
01093     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01094     {
01095         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01096         if(data->IsUnknown() || data->IsRemoved() || data->GetType() == ENT_SUBDIR)
01097         {
01098             res = FALSE;
01099             break;
01100         }
01101     }
01102
01103     pCmdUI->Enable(res);
01104 }

void CBrowseFileView::OnUpdateViewSmallIcons ( CCmdUI * pCmdUI ) [protected]

Definition at line 828 of file BrowseFileView.cpp.

References GetViewType.

00829 {
00830     pCmdUI->SetCheck(GetViewType() == LVS_SMALLICON);
00831 }

void CBrowseFileView::OnUpdateViewTrash ( CCmdUI * pCmdUI ) [protected]

Definition at line 1306 of file BrowseFileView.cpp.

References DisableCommon, KoUpdateMoveToTrashHandler::IsEnabled, and ProcessSelectionCommand.

01307 {
01308     bool enabled = !DisableCommon();
01309     if(enabled)
01310     {
01311         KoUpdateMoveToTrashHandler handler;
01312         ProcessSelectionCommand(&handler);
01313         enabled = handler.IsEnabled();
01314     }
01315     pCmdUI->Enable(enabled);
01316 }

void CBrowseFileView::OnUpdateViewUpdate ( CCmdUI * pCmdUI ) [protected]

Definition at line 1013 of file BrowseFileView.cpp.

References DisableCommon, ENT_FILE, FALSE, EntnodeData::GetType, EntnodeData::IsUnknown, and TRUE.

01014 {
01015     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01016     CListCtrl& ListCtrl = GetListCtrl();
01017
01018     if(DisableCommon())
01019     {
01020         pCmdUI->Enable(FALSE);
01021         return;
01022     }
01023
01024     int nItem = -1;
01025     BOOL res = TRUE;
01026     int numFiles = 0;
01027     int numFolders = 0;
01028
01029     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01030     {
01031         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01032         if(data->IsUnknown())
01033         {
01034             res = FALSE;
01035             break;
01036         }
01037         if(data->GetType() == ENT_FILE)
01038             numFiles++;
01039         else
01040             numFolders++;
01041
01042         if((numFiles != 0 && numFolders != 0) || numFolders > 1)
01043         {
01044             res = FALSE;
01045             break;
01046         }
01047     }
01048
01049     pCmdUI->Enable(res);
01050 }

void CBrowseFileView::OnUpdateViewUpone ( CCmdUI * pCmdUI ) [protected]

Definition at line 1294 of file BrowseFileView.cpp.

References CWincvsApp::gCvsRunning, GetRoot, IsSamePath, and m_path.

01295 {
01296     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01297     pCmdUI->Enable(!app->gCvsRunning && !IsSamePath(m_path, GetRoot()));
01298 }

void CBrowseFileView::OnViewAdd ( ) [protected]

Definition at line 1173 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01174 {
01175     KoAddHandler handler;
01176     ProcessSelectionCommand(&handler);
01177 }

void CBrowseFileView::OnViewAddb ( ) [protected]

Definition at line 1179 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01180 {
01181     KoAddBinaryHandler handler;
01182     ProcessSelectionCommand(&handler);
01183 }

void CBrowseFileView::OnViewAddu ( ) [protected]

Definition at line 1185 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01186 {
01187     KoAddUnicodeHandler handler;
01188     ProcessSelectionCommand(&handler);
01189 }

void CBrowseFileView::OnViewCheckout ( ) [protected]

Definition at line 1769 of file BrowseFileView.cpp.

References CvsCmdCheckoutModule.

01770 {
01771     CvsCmdCheckoutModule();
01772 }

void CBrowseFileView::OnViewCommit ( ) [protected]

Definition at line 1191 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01192 {
01193     KoCommitHandler handler;
01194     ProcessSelectionCommand(&handler);
01195 }

void CBrowseFileView::OnViewDiff ( ) [protected]

Definition at line 1318 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01319 {
01320     KoDiffHandler handler;
01321     ProcessSelectionCommand(&handler);
01322 }

void CBrowseFileView::OnViewEdit ( ) [protected]

Definition at line 1360 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01361 {
01362     KoEditHandler handler;
01363     ProcessSelectionCommand(&handler);
01364 }

void CBrowseFileView::OnViewEditors ( ) [protected]

Definition at line 1395 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01396 {
01397     KoEditorsHandler handler;
01398     ProcessSelectionCommand(&handler);
01399 }

void CBrowseFileView::OnViewEditsel ( ) [protected]

Definition at line 1711 of file BrowseFileView.cpp.

References EditSel.

01712 {
01713     CListCtrl& ListCtrl = GetListCtrl();
01714     int nItem = -1;
01715
01716     // first add the folders
01717     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01718     {
01719         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01720         EditSel(data);
01721     }
01722 }

void CBrowseFileView::OnViewEditseldef ( ) [protected]

Definition at line 1724 of file BrowseFileView.cpp.

References EditSel.

01725 {
01726     CListCtrl& ListCtrl = GetListCtrl();
01727     int nItem = -1;
01728
01729     // first add the folders
01730     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01731     {
01732         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01733         EditSel(data, true);
01734     }
01735 }

void CBrowseFileView::OnViewExplore ( ) [protected]

Definition at line 1492 of file BrowseFileView.cpp.

References cvs_err, ENT_SUBDIR, EntnodeData::GetFullPathName, EntnodeData::GetType, and m_path.

01493 {
01494     const char* fullpath = m_path;
01495
01496     CListCtrl& ListCtrl = GetListCtrl();
01497     int nItem = -1;
01498
01499     // first add the folders
01500     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01501     {
01502         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01503         if(data->GetType() == ENT_SUBDIR)
01504         {
01505             UStr buf;
01506             fullpath = data->GetFullPathName(buf);
01507             break;
01508         }
01509     }
01510
01511     HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), "explore", fullpath,
01512             0L, 0L, SW_SHOWDEFAULT);
01513     if((long)hInst < 32)
01514     {
01515         cvs_err("Unable to explore '%s' (error %d)\n", (char *)m_path, GetLastError());
01516     }
01517 }

void CBrowseFileView::OnViewForceedit ( ) [protected]

Definition at line 1372 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01373 {
01374     KoForceEditHandler handler;
01375     ProcessSelectionCommand(&handler);
01376 }

void CBrowseFileView::OnViewFullRowDetails ( ) [protected]

Definition at line 822 of file BrowseFileView.cpp.

References GetViewType, and SetViewType.

00823 {
00824     if (GetViewType() != LVS_REPORT)
00825         SetViewType(LVS_REPORT);
00826 }

void CBrowseFileView::OnViewGraph ( ) [protected]

Definition at line 1330 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01331 {
01332     KoGraphHandler handler;
01333     ProcessSelectionCommand(&handler);
01334 }

void CBrowseFileView::OnViewImport ( ) [protected]

Definition at line 1785 of file BrowseFileView.cpp.

References CvsCmdImportModule.

01786 {
01787     CvsCmdImportModule();
01788 }

void CBrowseFileView::OnViewList ( ) [protected]

Definition at line 816 of file BrowseFileView.cpp.

References GetViewType, and SetViewType.

00817 {
00818     if (GetViewType() != LVS_LIST)
00819         SetViewType(LVS_LIST);
00820 }

void CBrowseFileView::OnViewLog ( ) [protected]

Definition at line 1324 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01325 {
01326     KoLogHandler handler;
01327     ProcessSelectionCommand(&handler);
01328 }

void CBrowseFileView::OnViewQueryUpdate ( ) [protected]

Definition at line 1209 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01210 {
01211     KoQueryUpdateHandler handler;
01212     ProcessSelectionCommand(&handler);
01213 }

void CBrowseFileView::OnViewRelease ( ) [protected]

Definition at line 1383 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01384 {
01385     KoReleaseHandler handler;
01386     ProcessSelectionCommand(&handler);
01387 }

void CBrowseFileView::OnViewReload ( ) [protected]

Definition at line 1221 of file BrowseFileView.cpp.

References ResetView.

01222 {
01223     ResetView(true);
01224 }

void CBrowseFileView::OnViewReservededit ( ) [protected]

Definition at line 1366 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01367 {
01368     KoReservedEditHandler handler;
01369     ProcessSelectionCommand(&handler);
01370 }

void CBrowseFileView::OnViewRmv ( ) [protected]

Definition at line 1197 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01198 {
01199     KoFileRemoveHandler handler;
01200     ProcessSelectionCommand(&handler);
01201 }

void CBrowseFileView::OnViewSmallIcons ( ) [protected]

Definition at line 810 of file BrowseFileView.cpp.

References GetViewType, and SetViewType.

00811 {
00812     if (GetViewType() != LVS_SMALLICON)
00813         SetViewType(LVS_SMALLICON);
00814 }

void CBrowseFileView::OnViewStatus ( ) [protected]

Definition at line 1336 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01337 {
01338     KoStatusHandler handler;
01339     ProcessSelectionCommand(&handler);
01340 }

void CBrowseFileView::OnViewTagBranch ( ) [protected]

Definition at line 1443 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01444 {
01445     KoBranchTagHandler handler;
01446     ProcessSelectionCommand(&handler);
01447 }

void CBrowseFileView::OnViewTagDelete ( ) [protected]

Definition at line 1437 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01438 {
01439     KoDeleteTagHandler handler;
01440     ProcessSelectionCommand(&handler);
01441 }

void CBrowseFileView::OnViewTagNew ( ) [protected]

Definition at line 1431 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01432 {
01433     KoCreateTagHandler handler;
01434     ProcessSelectionCommand(&handler);
01435 }

void CBrowseFileView::OnViewTrash ( ) [protected]

Definition at line 1300 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01301 {
01302     KoMoveToTrashHandler handler;
01303     ProcessSelectionCommand(&handler);
01304 }

void CBrowseFileView::OnViewUnedit ( ) [protected]

Definition at line 1377 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01378 {
01379     KoUneditHandler handler;
01380     ProcessSelectionCommand(&handler);
01381 }

void CBrowseFileView::OnViewUnlock ( ) [protected]

Definition at line 1342 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01343 {
01344     KoUnlockHandler handler;
01345     ProcessSelectionCommand(&handler);
01346 }

void CBrowseFileView::OnViewUpdate ( ) [protected]

Definition at line 1203 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01204 {
01205     KoUpdateHandler handler;
01206     ProcessSelectionCommand(&handler);
01207 }

void CBrowseFileView::OnViewUpone ( ) [protected]

Definition at line 1280 of file BrowseFileView.cpp.

References GetRoot, IsSamePath, m_path, and ResetView.

Referenced by OnKeydown.

01281 {
01282     if(!IsSamePath(m_path, GetRoot()) && chdir(m_path) == 0 && chdir("..") == 0)
01283     {
01284         char newpath[1024];
01285         getcwd(newpath, 1023);
01286         ResetView(newpath, true);
01287     }
01288     else
01289     {
01290         MessageBeep(MB_ICONHAND);
01291     }
01292 }

void CBrowseFileView::OnViewWatchers ( ) [protected]

Definition at line 1389 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01390 {
01391     KoWatchersHandler handler;
01392     ProcessSelectionCommand(&handler);
01393 }

void CBrowseFileView::OnViewWatchOff ( ) [protected]

Definition at line 1354 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01355 {
01356     KoWatchOffHandler handler;
01357     ProcessSelectionCommand(&handler);
01358 }

void CBrowseFileView::OnViewWatchOn ( ) [protected]

Definition at line 1348 of file BrowseFileView.cpp.

References ProcessSelectionCommand.

01349 {
01350     KoWatchOnHandler handler;
01351     ProcessSelectionCommand(&handler);
01352 }

BOOL CBrowseFileView::PreCreateWindow ( CREATESTRUCT & cs ) [virtual]

Definition at line 420 of file BrowseFileView.cpp.

00421 {
00422     cs.style |= WS_TABSTOP | LVS_SHOWSELALWAYS | LVS_REPORT;
00423     cs.dwExStyle |= LVS_EX_FULLROWSELECT;
00424
00425     return CListView::PreCreateWindow(cs);
00426 }

void CBrowseFileView::ProcessSelectionCommand ( KiSelectionHandler * handler )

Definition at line 1136 of file BrowseFileView.cpp.

References ENT_SUBDIR, EntnodeData::GetFullPathName, GetPath, EntnodeData::GetType, UStr::length, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, KiSelectionHandler::OnFiles, and KiSelectionHandler::OnFolder.

Referenced by OnQueryAnnotate, OnUpdateViewTrash, OnViewAdd, OnViewAddb, OnViewAddu, OnViewCommit, OnViewDiff, OnViewEdit, OnViewEditors, OnViewForceedit, OnViewGraph, OnViewLog, OnViewQueryUpdate, OnViewRelease, OnViewReservededit, OnViewRmv, OnViewStatus, OnViewTagBranch, OnViewTagDelete, OnViewTagNew, OnViewTrash, OnViewUnedit, OnViewUnlock, OnViewUpdate, OnViewWatchers, OnViewWatchOff, and OnViewWatchOn.

01137 {
01138     CListCtrl& ListCtrl = GetListCtrl();
01139     int nItem = -1;
01140     int pathLen = GetPath().length();
01141
01142     MultiFiles mf;
01143
01144     // first add the folders
01145     mf.newdir(GetPath());
01146
01147     //  process selection
01148     while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
01149     {
01150         EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
01151         UStr buf;
01152         const char* fullpath = data->GetFullPathName(buf);
01153         if(data->GetType() == ENT_SUBDIR)
01154         {
01155             handler->OnFolder(fullpath);
01156         }
01157         else
01158         {
01159             const char* fn = data->GetFullPathName(buf) + pathLen;
01160             if (*fn == '\\')
01161             {
01162                 fn++;
01163             }
01164             mf.newfile(fn);
01165         }
01166     }
01167     if(mf.NumFiles() != 0)
01168     {
01169         handler->OnFiles(&mf);
01170     }
01171 }

void CBrowseFileView::ResetView | ( | bool | notifyBrowser = false,
 |  | const char * | selectFile = 0L
 | ) |

Definition at line 609 of file BrowseFileView.cpp.

References CvsArgs::add, AddColumns, CvsArgs::Argc, CvsArgs::Argv, DeleteColumns, ENT_SUBDIR, FALSE, FileTraverse, KiColumnModel::GetAt, CWincvsApp::GetBrowserView, GetColumnModel, KiColumnModel::GetCount, GetEntriesModTime, EntnodeData::GetFullPathName, EntnodeData::GetType, KoTraversalContext::IsRecursive, kTraversal, m_entriesLogMod, m_entriesMod, m_isFilesChange, m_isRecursive, m_isResetViewLocked, m_isResetViewPending, m_path, m_sort, m_watch, NULL, CvsArgs::reset, CWinCvsBrowser::ResetView, Resort, SetRecursive, KoWatcher::SignalStartWatch, stricmp, and VERIFY.

00610 {
00611     // no outstanding request to reset the view any more
00612     m_isResetViewPending = false;
00613
00614     if (m_isResetViewLocked)
00615     {
00616         // no recursion
00617         return;
00618     }
00619     CRecursionLock recursionLock(m_isResetViewLocked);
00620
00621     // reset dirty indicators
00622     m_isFilesChange = false;
00623     GetEntriesModTime(m_entriesMod, m_entriesLogMod);
00624
00625     CWaitCursor doWait;
00626
00627     bool bPartialOK = true;
00628
00629     CListCtrl& ListCtrl = GetListCtrl();
00630     int i;
00631
00632     // get the selection to later try to restore it
00633     CvsArgs selection(false);
00634     if (!selectFile)
00635     {
00636         int nItem = -1;
00637         UStr buf;
00638         while((nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1)
00639         {
00640             EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
00641             selection.add(data->GetFullPathName(buf));
00642         }
00643     }
00644
00645     // delete all items
00646     VERIFY( ListCtrl.DeleteAllItems() );
00647
00648     // make sure columns are ok
00649     KoTraversalContext context(this);
00650     if ((context.IsRecursive() && !m_isRecursive) || (!context.IsRecursive() && m_isRecursive))
00651     {
00652
00653         KiColumnModel* oldModel = GetColumnModel();
00654         int oldCount = oldModel->GetCount();
00655         const KiColumn* oldColumn = (0 <= m_sort && m_sort < oldCount) ? oldModel->GetAt(m_sort) : NULL;
00656         DeleteColumns();
00657         SetRecursive(context.IsRecursive());
00658         AddColumns();
00659         if (oldColumn == NULL)
00660         {
00661             m_sort = 0;
00662         }
00663         else
00664         {
00665             KiColumnModel* newModel = GetColumnModel();
00666             int newCount = newModel->GetCount();
00667             int sort = -1;
00668             for (int pos = 0; pos < newCount && sort == -1; pos++)
00669             {
00670                 if (newModel->GetAt(pos) == oldColumn)
00671                 {
00672                     sort = pos;
00673                 }
00674             }
00675             m_sort = (sort >= 0) ? sort : 0;
00676         }
00677     }
00678
00679     // refetch all items
00680     TViewFill traverse(&context);
00681     kTraversal res = FileTraverse(m_path, traverse);
00682
00683     //JK - find the file for selection
00684     if( selectFile != 0L )
00685     {
00686         int count = ListCtrl.GetItemCount();
00687         for (int i = 0; i < count; i++)
00688         {
00689             EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(i);
00690
00691             //files only
00692             if(data->GetType() == ENT_SUBDIR)
00693                 continue;
00694
00695             UStr buf;
00696             const char* currentFile = data->GetFullPathName(buf);
00697             if( stricmp( selectFile, currentFile) == 0 )
00698             {
00699                 selection.reset(false); //we don't want any other selection
00700                 selection.add(currentFile);
00701                 bPartialOK = FALSE;
00702                 break;
00703             }
00704         }
00705     }
00706
00707     Resort();
00708
00709     // now restore the selection
00710     int argc = selection.Argc();
00711     char * const *argv = selection.Argv();
00712     bool isFirst = true;
00713     bool focusSet = false;
00714     int count = ListCtrl.GetItemCount();
00715     //If there are no selections, then skip the looping
00716     if( argc )
00717     {
00718         for (int nItem = 0; nItem < count; nItem++)
00719         {
00720             EntnodeData *data = (EntnodeData *)ListCtrl.GetItemData(nItem);
00721             UStr buf;
00722             const char* currentFile = data->GetFullPathName(buf);
00723             for(i = 0; i < argc; i++)
00724             {
00725                 const char* fn = argv[i];
00726                 if (stricmp(fn, currentFile) == 0)
00727                 {
00728                     VERIFY( ListCtrl.SetItemState(nItem, LVIS_SELECTED, LVIS_SELECTED) );
00729                     if(isFirst)
00730                     {
00731                         isFirst = false;
00732                         if( !bPartialOK )
00733                         {
00734                             //move to the bottom first, so the selection will be on top
00735                             ListCtrl.EnsureVisible(ListCtrl.GetItemCount()-1 , bPartialOK);
00736                         }
00737                         //make sure the first selected file is visible
00738                         VERIFY( ListCtrl.EnsureVisible(nItem, bPartialOK/*TRUE*/) );
00739                         VERIFY( focusSet = (ListCtrl.SetItemState(nItem, LVIS_FOCUSED, LVIS_FOCUSED)!=0) );
00740                     }
00741                     break;
00742                 }
00743             }
00744         }
00745     }
00746
00747     if( !focusSet && ListCtrl.GetItemCount())
00748     {
00749         //VERIFY( ListCtrl.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED) );
00750         VERIFY( focusSet = (ListCtrl.SetItemState(0, LVIS_FOCUSED, LVIS_FOCUSED)!=0) );
00751     }
00752
00753     if(notifyBrowser)
00754     {
00755         // notify the tree
00756         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00757         if( app )
00758         {
00759             app->GetBrowserView()->ResetView(true);
00760         }
00761     }
00762
00763     // start monitoring file changes
00764     if (!m_watch)
00765     {
00766         m_watch = new KoWatcher(m_hWnd);
00767     }
00768     m_watch->SignalStartWatch(m_path, m_isRecursive);
00769 }

void CBrowseFileView::ResetView | ( | const char * | path,
 |  | bool | notifyBrowser = false,
 |  | const char * | selectFile = 0L
 | ) |

Definition at line 771 of file BrowseFileView.cpp.

References CWincvsApp::GetBrowserView, CWincvsApp::GetDocument, m_path, and CWinCvsBrowser::StepToLocation.

Referenced by EditSel, CWincvsApp::InitInstance, CWinCvsBrowser::NotifySelectionChange, CMainFrame::OnDropFiles, OnKeydown, OnResetView, CMyShellTree::OnSelchanged, OnTimer, OnViewReload, OnViewUpone, and CWinCvsBrowser::ResetView.

00772 {
00773     m_path = path;
00774     ResetView(false, selectFile);
00775     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00776     app->GetDocument()->SetTitle(m_path);
00777
00778     if(notifyBrowser)
00779     {
00780         // notify the tree
00781         app->GetBrowserView()->StepToLocation(path);
00782     }
00783 }

void CBrowseFileView::Resort ( void )

Definition at line 1106 of file BrowseFileView.cpp.

References KiColumnModel::GetAt, GetColumnModel, GetPath, m_ascendant, m_ctrlHeader, m_sort, and CSortHeaderCtrl::SetSortImage.

Referenced by OnColumnclick, and ResetView.

01107 {
01108     CListCtrl& ListCtrl = GetListCtrl();
01109     KoColumnContext context(GetPath());
01110     KiColumnModel* model = GetColumnModel();
01111     CSortParam sortParam(m_ascendant, true, model->GetAt(m_sort), model->GetAt(0), &context);
01112     m_ctrlHeader.SetSortImage(m_sort, m_ascendant);
01113
01114     ListCtrl.SortItems( _Compare, (LPARAM)&sortParam);
01115 }

void CBrowseFileView::SaveColumns ( )

Definition at line 1895 of file BrowseFileView.cpp.

References m_ctrlHeader, and NULL.

Referenced by OnDestroy.

01896 {
01897     AfxGetApp()->WriteProfileString("FileDetailView", NULL, NULL);
01898
01899     char buffer[2048];
01900     char* cp = buffer;
01901     int count = m_ctrlHeader.GetItemCount();
01902     for (int i = 0; i < count; ++i)
01903     {
01904         int width = GetListCtrl().GetColumnWidth(i);
01905         cp += sprintf(cp, "%d ", width);
01906     }
01907     AfxGetApp()->WriteProfileString("FileDetailView", "Column Widths", buffer);
01908
01909     int order[128];
01910     if (m_ctrlHeader.GetOrderArray(order, count))
01911     {
01912         cp = buffer;
01913         for (int i = 0; i < count; ++i)
01914         {
01915             cp += sprintf(cp, "%d ", order[i]);
01916         }
01917         AfxGetApp()->WriteProfileString("FileDetailView", "Column Order", buffer);
01918     }
01919 }

void CBrowseFileView::SetFullRowSel ( BOOL bFullRowSel ) [protected]

Definition at line 1589 of file BrowseFileView.cpp.

Referenced by OnInitialUpdate.

01590 {
01591     CListCtrl& ListCtrl = GetListCtrl();
01592     DWORD dwExStyle = ListView_GetExtendedListViewStyle(ListCtrl.m_hWnd);
01593     if (bFullRowSel)
01594         (dwExStyle |= LVS_EX_FULLROWSELECT);
01595     else
01596         (dwExStyle &= ~LVS_EX_FULLROWSELECT);
01597     ListView_SetExtendedListViewStyle(ListCtrl.m_hWnd, dwExStyle);
01598 }

void CBrowseFileView::SetRecursive ( bool isRecursive ) [protected]

Definition at line 494 of file BrowseFileView.cpp.

References KiColumnModel::GetRecursiveModel, KiColumnModel::GetRegularModel, m_isRecursive, and m_modelColumns.

Referenced by CBrowseFileView, OnInitialUpdate, and ResetView.

00495 {
00496     m_isRecursive = isRecursive;
00497     m_modelColumns = (m_isRecursive) ? KiColumnModel::GetRecursiveModel() : KiColumnModel::GetRegularModel();
00498 }

BOOL CBrowseFileView::SetViewType ( DWORD dwViewType )

Definition at line 800 of file BrowseFileView.cpp.

Referenced by OnViewFullRowDetails, OnViewList, and OnViewSmallIcons.

00801 {
00802     return(ModifyStyle(LVS_TYPEMASK,dwViewType & LVS_TYPEMASK));
00803 }

Member Data Documentation

bool CBrowseFileView::m_ascendant [protected]

Definition at line 167 of file BrowseFileView.h.

Referenced by CBrowseFileView, OnColumnclick, Resort, and ~CBrowseFileView.

bool CBrowseFileView::m_checkChanges [protected]

Definition at line 173 of file BrowseFileView.h.

Referenced by CheckChanges, and OnTimer.

CSortHeaderCtrl CBrowseFileView::m_ctrlHeader [protected]

Definition at line 157 of file BrowseFileView.h.

Referenced by LoadColumns, OnInitialUpdate, Resort, and SaveColumns.

time_t CBrowseFileView::m_entriesLogMod [protected]

Definition at line 163 of file BrowseFileView.h.

Referenced by CBrowseFileView, OnTimer, and ResetView.

time_t CBrowseFileView::m_entriesMod [protected]

Definition at line 162 of file BrowseFileView.h.

Referenced by CBrowseFileView, InvalidateView, OnTimer, and ResetView.

int CBrowseFileView::m_heightOfLines [protected]

Definition at line 178 of file BrowseFileView.h.

Referenced by OnBeginPrinting, and OnPrint.

bool CBrowseFileView::m_isFilesChange [protected]

Definition at line 190 of file BrowseFileView.h.

Referenced by OnFileChange, and ResetView.

bool CBrowseFileView::m_isRecursive [protected]

Definition at line 181 of file BrowseFileView.h.

Referenced by ResetView, and SetRecursive.

bool CBrowseFileView::m_isResetViewLocked [protected]

Definition at line 187 of file BrowseFileView.h.

Referenced by ResetView.

bool CBrowseFileView::m_isResetViewPending [protected]

Definition at line 196 of file BrowseFileView.h.

Referenced by OnFilteringChanged, and ResetView.

KiColumnModel* CBrowseFileView::m_modelColumns [protected]

Definition at line 170 of file BrowseFileView.h.

Referenced by GetColumnModel, and SetRecursive.

int CBrowseFileView::m_numberByPages [protected]

Definition at line 176 of file BrowseFileView.h.

Referenced by OnBeginPrinting, and OnPrint.

int CBrowseFileView::m_numberOfLines [protected]

Definition at line 175 of file BrowseFileView.h.

Referenced by OnBeginPrinting.

int CBrowseFileView::m_numberOfPages [protected]

Definition at line 177 of file BrowseFileView.h.

Referenced by OnBeginPrinting.

UStr CBrowseFileView::m_path [protected]

Definition at line 160 of file BrowseFileView.h.

Referenced by GetEntriesModTime, GetPath, OnUpdateViewUpone, OnViewExplore, OnViewUpone, and ResetView.

CImageList CBrowseFileView::m_SmallImageList [static, protected]

Definition at line 170 of file BrowseFileView.cpp.

Referenced by OnInitialUpdate.

int CBrowseFileView::m_sort [protected]

Definition at line 165 of file BrowseFileView.h.

Referenced by CBrowseFileView, OnColumnclick, ResetView, Resort, and ~CBrowseFileView.

CImageList CBrowseFileView::m_StateImageList [static, protected]

Definition at line 171 of file BrowseFileView.cpp.

Referenced by OnInitialUpdate.

UINT CBrowseFileView::m_uiFilechangeTimer [protected]

Definition at line 193 of file BrowseFileView.h.

Referenced by OnDestroy, OnInitialUpdate, and OnTimer.

KoWatcher* CBrowseFileView::m_watch [protected]

Definition at line 184 of file BrowseFileView.h.

Referenced by OnDestroy, and ResetView.

The documentation for this class was generated from the following files:
  • WinCvs/BrowseFileView.h
  • WinCvs/BrowseFileView.cpp
Generated on Sun Feb 24 01:24:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CBrowserBar Class Reference

#include <BrowserBar.h>

Inheritance diagram for CBrowserBar:

[legend]
Collaboration diagram for CBrowserBar:

[legend]
List of all members.

Public Methods

virtual | ~CBrowserBar ()
CWinCvsBrowser * GetBrowserView ()
virtual BOOL | Create (LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID, CCreateContext *pContext=NULL)

Protected Methods

CBrowserBar ()
virtual void | OnDraw (CDC *pDC)
afx_msg void | OnWindowPosChanged (WINDOWPOS FAR *lpwndpos)
afx_msg void | OnDestroy ()
afx_msg void | OnPaint ()

Protected Attributes

CWinCvsBrowser * m_browser

Constructor & Destructor Documentation

CBrowserBar::~CBrowserBar ( ) [virtual]

Definition at line 23 of file BrowserBar.cpp.

00024 {
00025 }

CBrowserBar::CBrowserBar ( ) [protected]

Definition at line 19 of file BrowserBar.cpp.

00019                          : m_browser(0L)
00020 {
00021 }

Member Function Documentation

BOOL CBrowserBar::Create | ( | LPCTSTR | lpszClassName,
 |  | LPCTSTR | lpszWindowName,
 |  | DWORD | dwStyle,
 |  | const RECT & | rect,
 |  | CWnd * | pParentWnd,
 |  | UINT | nID,
 |  | CCreateContext * | pContext = NULL
 | ) | [virtual]

Definition at line 62 of file BrowserBar.cpp.

References CWinCvsBrowser::Create, FALSE, m_browser, TRUE, and VERIFY.

00063 {
00064     BOOL res = CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
00065     if(!res)
00066         return FALSE;
00067
00068     m_browser = (CWinCvsBrowser *)RUNTIME_CLASS(CWinCvsBrowser)->CreateObject();
00069     VERIFY(m_browser->Create(0L, "", WS_CHILD | WS_VISIBLE | WS_TABSTOP, CRect(0,0,0,0), this, 0));
00070
00071     return TRUE;
00072 }

CWinCvsBrowser* CBrowserBar::GetBrowserView ( void ) [inline]

Definition at line 29 of file BrowserBar.h.

References m_browser.

Referenced by CMainFrame::GetBrowserView.

00029 { return m_browser; }

void CBrowserBar::OnDestroy ( ) [protected]

Definition at line 85 of file BrowserBar.cpp.

References m_browser.

00086 {
00087     if(m_browser)
00088         m_browser->DestroyWindow();
00089
00090     CView::OnDestroy();
00091 }

void CBrowserBar::OnDraw ( CDC * pDC ) [protected, virtual]

Definition at line 57 of file BrowserBar.cpp.

00058 {
00059     CDocument* pDoc = GetDocument();
00060 }

void CBrowserBar::OnPaint ( ) [protected]

Definition at line 93 of file BrowserBar.cpp.

00094 {
00095     CPaintDC dc(this); // device context for painting
00096
00097     CRect r;
00098     GetClientRect(&r);
00099     CBrush brush(GetSysColor(COLOR_WINDOW));
00100     dc.FillRect(r, &brush);
00101 }

void CBrowserBar::OnWindowPosChanged ( WINDOWPOS FAR * lpwndpos ) [protected]

Definition at line 74 of file BrowserBar.cpp.

References m_browser, and NULL.

00075 {
00076     CView::OnWindowPosChanged(wp);
00077
00078     //m_browser->SetWindowPos(NULL, wp->x, wp->y, wp->cx, wp->cy, SWP_NOZORDER);
00079     CRect r;
00080     GetClientRect(&r);
00081     if(m_browser != 0L)
00082         m_browser->SetWindowPos(NULL, r.left, r.top, r.Width(), r.Height(), SWP_NOZORDER);
00083 }

Member Data Documentation

CWinCvsBrowser* CBrowserBar::m_browser [protected]

Definition at line 47 of file BrowserBar.h.

Referenced by Create, GetBrowserView, OnDestroy, and OnWindowPosChanged.

The documentation for this class was generated from the following files:
  • WinCvs/BrowserBar.h
  • WinCvs/BrowserBar.cpp
Generated on Sun Feb 24 01:24:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UBrush Class Reference

#include <udraw.h>

List of all members.

Public Methods

UBrush ()
~UBrush ()
bool | DeleteObject (void)
bool | CreateSolidBrush (UCOLORREF crColor)

Friends

class | UDC

Constructor & Destructor Documentation

UBrush::UBrush ( )

Definition at line 437 of file udraw.cpp.

00439     : m_set(false)
00440 #endif
00441 {
00442 }

UBrush::~UBrush ( )

Definition at line 444 of file udraw.cpp.

References DeleteObject.

00445 {
00446     DeleteObject();
00447 }

Member Function Documentation

bool UBrush::CreateSolidBrush ( UCOLORREF crColor )

Definition at line 469 of file udraw.cpp.

References DeleteObject, UCOLORREF, UGetBValue, UGetGValue, and UGetRValue.

Referenced by DrawNode.

00470 {
00471     bool res = false;
00472
00473 #if qGTK
00474     DeleteObject();
00475     GdkColormap *cmap = gdk_colormap_get_system();
00476     if(cmap != 0L)
00477     {
00478         m_col.red = UGetRValue(crColor) << 8;
00479         m_col.green = UGetGValue(crColor) << 8;
00480         m_col.blue = UGetBValue(crColor) << 8;
00481         if(gdk_color_alloc(cmap, &m_col))
00482             m_set = true;
00483     }
00484     res = m_set;
00485 #endif
00486     return res;
00487 }

bool UBrush::DeleteObject ( void )

Definition at line 449 of file udraw.cpp.

Referenced by CreateSolidBrush, DrawNode, and ~UBrush.

00450 {
00451     bool res = false;
00452 #if qGTK
00453     if(m_set)
00454     {
00455         m_set = false;
00456         GdkColormap *cmap = gdk_colormap_get_system();
00457         if(cmap != 0L)
00458         {
00459             gdk_colormap_free_colors(cmap, &m_col, 1);
00460             res = true;
00461         }
00462     }
00463     else
00464         res = true;
00465 #endif
00466     return res;
00467 }

Friends And Related Function Documentation

friend class UDC [friend]

Definition at line 497 of file udraw.h.

The documentation for this class was generated from the following files:
  • rf/udraw.h
  • rf/udraw.cpp
Generated on Sun Feb 24 01:24:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CBuffer Class Reference

Collaboration diagram for CBuffer:

[legend]
List of all members.

Public Methods

CBuffer ()
void | append (const char *ptr, size_t s)
size_t | size () const
operator char * (void) const

Protected Attributes

size_t | m_curSize
CStaticAllocT< char > | m_buf

Constructor & Destructor Documentation

CBuffer::CBuffer ( ) [inline]

Definition at line 461 of file PythonGlue.cpp.

References m_curSize.

00461               : m_curSize(0)
00462     {
00463     }

Member Function Documentation

void CBuffer::append | ( | const char * | ptr,
 |  | size_t | s
 | ) | [inline]

Definition at line 465 of file PythonGlue.cpp.

References CStaticAllocT< char >::AdjustSize, m_buf, m_curSize, and CStaticAllocT< char >::size.

Referenced by CPyCvsConsole::cvs_err, and CPyCvsConsole::cvs_out.

00466     {
00467         if((s + m_curSize) > m_buf.size())
00468         {
00469             size_t step = s > 1024 ? s : 1024;
00470             m_buf.AdjustSize(m_buf.size() + step);
00471         }
00472 #ifdef WIN32
00473         char *tmp = (char *)m_buf + m_curSize;
00474         size_t incs = 0;
00475         while(s--)
00476         {
00477             char c = *ptr++;
00478             if(c == '\r')
00479                 continue;
00480             *tmp++ = c;
00481             incs++;
00482         }
00483         m_curSize += incs;
00484 #elif defined(macintosh)
00485         char *tmp = (char *)m_buf + m_curSize;
00486         size_t cnt = s;
00487         while(cnt--)
00488         {
00489             char c = *ptr++;
00490             if(c == '\r')
00491                 c = '\n';
00492             *tmp++ = c;
00493         }
00494         m_curSize += s;
00495 #else
00496         memcpy((char *)m_buf + m_curSize, ptr, s * sizeof(char));
00497         m_curSize += s;
00498 #endif
00499     }

CBuffer::operator char * ( void ) const [inline]

Definition at line 502 of file PythonGlue.cpp.

References m_buf.

00502 { return m_buf; }

size_t CBuffer::size ( ) const [inline]

Definition at line 501 of file PythonGlue.cpp.

References m_curSize.

Referenced by cvsgui_RunCvs.

00501 { return m_curSize; }

Member Data Documentation

CStaticAllocT<char> CBuffer::m_buf [protected]

Definition at line 506 of file PythonGlue.cpp.

Referenced by append, and operator char *.

size_t CBuffer::m_curSize [protected]

Definition at line 505 of file PythonGlue.cpp.

Referenced by append, CBuffer, and size.

The documentation for this class was generated from the following file:
  • common/PythonGlue.cpp
Generated on Sun Feb 24 01:24:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CButton Class Reference

Inheritance diagram for CButton:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJColorPicker.h
Generated on Sun Feb 24 01:24:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCharFormat Class Reference

Inheritance diagram for CCharFormat:

[legend]
Collaboration diagram for CCharFormat:

[legend]
List of all members.

Public Methods

CCharFormat ()
CCharFormat (const CHARFORMAT &newf)
operator CHARFORMAT & ()

Constructor & Destructor Documentation

CCharFormat::CCharFormat ( ) [inline]

Definition at line 50 of file wincvsView.cpp.

References ASSERT.

00051     {
00052         USES_CONVERSION;
00053         CString strDefFont = _T("Courier New");
00054         //VERIFY(strDefFont.LoadString(IDS_DEFFONT));
00055         cbSize = sizeof(CHARFORMAT);
00056         dwMask = CFM_BOLD|CFM_ITALIC|CFM_UNDERLINE|CFM_STRIKEOUT|CFM_SIZE|
00057             CFM_COLOR|CFM_OFFSET|CFM_PROTECTED;
00058         dwEffects = CFE_AUTOCOLOR;
00059         yHeight = 200; //10pt
00060         yOffset = 0;
00061         crTextColor = RGB(0, 0, 0);
00062         bCharSet = 0;
00063         bPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
00064         ASSERT(strDefFont.GetLength() < LF_FACESIZE);
00065         lstrcpynA(szFaceName, T2A((LPTSTR) (LPCTSTR) strDefFont), LF_FACESIZE);
00066         dwMask |= CFM_FACE;
00067     }

CCharFormat::CCharFormat ( const CHARFORMAT & newf ) [inline]

Definition at line 68 of file wincvsView.cpp.

00069     {
00070         *(CHARFORMAT *)this = newf;
00071     }

Member Function Documentation

CCharFormat::operator CHARFORMAT & ( ) [inline]

Definition at line 72 of file wincvsView.cpp.

00073     {
00074         return *(CHARFORMAT *)this;
00075     }

The documentation for this class was generated from the following file:
  • WinCvs/wincvsView.cpp
Generated on Sun Feb 24 01:24:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCheckout_MAIN Class Reference

#include <CheckoutDlg.h>

Inheritance diagram for CCheckout_MAIN:

[legend]
Collaboration diagram for CCheckout_MAIN:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_CHECKOUT_MAIN }

Public Methods

CCheckout_MAIN ()
CCheckout_MAIN (const char *modname, const char *path)
~CCheckout_MAIN ()

Public Attributes

CEdit m_editPath
CSmartComboBox m_moduleCombo
CString | m_moduleName
CString | m_path
BOOL | m_noRecurse
BOOL | m_stdout
BOOL | m_overrideCheckoutDir
CString | m_checkoutDir

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnBtnPath ()
afx_msg void | OnCheckOverridecheckoutdir ()

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 60 of file CheckoutDlg.h.

00060 { IDD = IDD_CHECKOUT_MAIN };

Constructor & Destructor Documentation

CCheckout_MAIN::CCheckout_MAIN ( )

Definition at line 91 of file CheckoutDlg.cpp.

00091                                : CPropertyPage(CCheckout_MAIN::IDD)
00092 {
00093 }

CCheckout_MAIN::CCheckout_MAIN | ( | const char * | modname,
 |  | const char * | path
 | ) |

Definition at line 69 of file CheckoutDlg.cpp.

References FALSE, CWincvsApp::GetRoot, m_checkoutDir, m_moduleCombo, m_moduleName, m_noRecurse, m_overrideCheckoutDir, m_path, m_stdout, and USmartCombo::SetItems.

00069                                                                       :
00070     CPropertyPage(CCheckout_MAIN::IDD)
00071 {
00072     //{{AFX_DATA_INIT(CCheckout_MAIN)
00073     m_noRecurse = FALSE;
00074     m_stdout = FALSE;
00075     m_overrideCheckoutDir = FALSE;
00076     m_checkoutDir = _T("");
00077     //}}AFX_DATA_INIT
00078
00079     m_moduleName = modname;
00080     m_path = path;
00081     if( m_path.IsEmpty() )
00082     {
00083         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00084         if( 0L != app )
00085             m_path = app->GetRoot();
00086     }
00087
00088     m_moduleCombo.SetItems(&gOldModules);
00089 }

CCheckout_MAIN::~CCheckout_MAIN ( )

Definition at line 95 of file CheckoutDlg.cpp.

00096 {
00097 }

Member Function Documentation

void CCheckout_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 99 of file CheckoutDlg.cpp.

References DDV_CheckPathExists, DDV_MinChars, DDX_ComboMString, IDC_CHECK_OVERRIDECHECKOUTDIR, IDC_EDIT_CHECKOUTDIR, IDC_MODNAME, IDC_NORECURS, IDC_PATH, IDC_STDOUT, m_checkoutDir, m_editPath, m_moduleCombo, m_moduleName, m_noRecurse, m_overrideCheckoutDir, m_path, m_stdout, and OnCheckOverridecheckoutdir.

00100 {
00101     CPropertyPage::DoDataExchange(pDX);
00102
00103     //{{AFX_DATA_MAP(CCheckout_MAIN)
00104     DDX_Control(pDX, IDC_PATH, m_editPath);
00105     DDX_Control(pDX, IDC_MODNAME, m_moduleCombo);
00106     DDX_Text(pDX, IDC_MODNAME, m_moduleName);
00107     DDX_Text(pDX, IDC_PATH, m_path);
00108     DDX_Check(pDX, IDC_NORECURS, m_noRecurse);
00109     DDX_Check(pDX, IDC_STDOUT, m_stdout);
00110     DDX_Check(pDX, IDC_CHECK_OVERRIDECHECKOUTDIR, m_overrideCheckoutDir);
00111     DDX_Text(pDX, IDC_EDIT_CHECKOUTDIR, m_checkoutDir);
00112     //}}AFX_DATA_MAP
00113
00114     DDV_MinChars(pDX, m_moduleName, 1);
00115     DDX_ComboMString(pDX, IDC_MODNAME, m_moduleCombo);
00116     DDV_CheckPathExists(pDX, IDC_PATH, m_path);
00117
00118     if( !pDX->m_bSaveAndValidate )
00119     {
00120         //see if we are overriding the checkout directory
00121         OnCheckOverridecheckoutdir();
00122     }
00123 }

void CCheckout_MAIN::OnBtnPath ( ) [protected]

Definition at line 136 of file CheckoutDlg.cpp.

References BrowserGetDirectory, m_editPath, m_path, MAX_PATH, and NULL.

00137 {
00138     // copy controls to member variables, then update those and finally refresh controls
00139     TCHAR path[_MAX_PATH];
00140     m_editPath.GetWindowText(path, _MAX_PATH);
00141     BOOL selected = BrowserGetDirectory("Select a directory to checkout :", path, MAX_PATH, IsWindow(this->m_hWnd) ? this : NULL );
00142     if (selected)
00143     {
00144         m_path = path;
00145         m_editPath.SetWindowText(path);
00146     }
00147 }

void CCheckout_MAIN::OnCheckOverridecheckoutdir ( ) [protected]

Definition at line 149 of file CheckoutDlg.cpp.

References IDC_CHECK_OVERRIDECHECKOUTDIR, IDC_EDIT_CHECKOUTDIR, and IDC_MODNAME.

Referenced by DoDataExchange.

00150 {
00151     CButton* but = (CButton *)GetDlgItem(IDC_CHECK_OVERRIDECHECKOUTDIR);
00152     CWnd* wnd = GetDlgItem(IDC_EDIT_CHECKOUTDIR);
00153     BOOL enableCheckoutDir = but->GetCheck() == 1;
00154
00155     wnd->EnableWindow(enableCheckoutDir);
00156     if( enableCheckoutDir )
00157     {
00158         CString strCheckoutDir;
00159         wnd->GetWindowText(strCheckoutDir);
00160         if( strCheckoutDir.IsEmpty() )
00161         {
00162             CString strModuleName;
00163             if( GetDlgItemText(IDC_MODNAME, strModuleName) )
00164             {
00165                 wnd->SetWindowText(strModuleName);
00166                 GotoDlgCtrl(wnd);
00167             }
00168         }
00169     }
00170 }

Member Data Documentation

CString CCheckout_MAIN::m_checkoutDir

Definition at line 68 of file CheckoutDlg.h.

Referenced by CCheckout_MAIN, CompatGetCheckout, and DoDataExchange.

CEdit CCheckout_MAIN::m_editPath

Definition at line 61 of file CheckoutDlg.h.

Referenced by DoDataExchange, and OnBtnPath.

CSmartComboBox CCheckout_MAIN::m_moduleCombo

Definition at line 62 of file CheckoutDlg.h.

Referenced by CCheckout_MAIN, and DoDataExchange.

CString CCheckout_MAIN::m_moduleName

Definition at line 63 of file CheckoutDlg.h.

Referenced by CCheckout_MAIN, CompatGetCheckout, and DoDataExchange.

BOOL CCheckout_MAIN::m_noRecurse

Definition at line 65 of file CheckoutDlg.h.

Referenced by CCheckout_MAIN, CompatGetCheckout, and DoDataExchange.

BOOL CCheckout_MAIN::m_overrideCheckoutDir

Definition at line 67 of file CheckoutDlg.h.

Referenced by CCheckout_MAIN, CompatGetCheckout, and DoDataExchange.

CString CCheckout_MAIN::m_path

Definition at line 64 of file CheckoutDlg.h.

Referenced by CCheckout_MAIN, CompatGetCheckout, DoDataExchange, and OnBtnPath.

BOOL CCheckout_MAIN::m_stdout

Definition at line 66 of file CheckoutDlg.h.

Referenced by CCheckout_MAIN, CompatGetCheckout, and DoDataExchange.

The documentation for this class was generated from the following files:
  • common/CheckoutDlg.h
  • common/CheckoutDlg.cpp
Generated on Sun Feb 24 01:24:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCheckout_OPTIONS Class Reference

#include <CheckoutDlg.h>

Inheritance diagram for CCheckout_OPTIONS:

[legend]
Collaboration diagram for CCheckout_OPTIONS:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_CHECKOUT_OPTIONS }

Public Methods

CCheckout_OPTIONS (const char *rev, const char *date)
CCheckout_OPTIONS ()
~CCheckout_OPTIONS ()

Public Attributes

CSmartComboBox m_revCombo
CSmartComboBox m_dateCombo
CString | m_date
CString | m_rev
BOOL | m_hasDate
BOOL | m_match
BOOL | m_hasRev
BOOL | m_export
BOOL | m_forceRoot

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnDate ()
afx_msg void | OnRev ()

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 102 of file CheckoutDlg.h.

00102 { IDD = IDD_CHECKOUT_OPTIONS };

Constructor & Destructor Documentation

CCheckout_OPTIONS::CCheckout_OPTIONS | ( | const char * | rev,
 |  | const char * | date
 | ) |

Definition at line 174 of file CheckoutDlg.cpp.

References FALSE, m_date, m_dateCombo, m_export, m_forceRoot, m_hasDate, m_hasRev, m_match, m_rev, m_revCombo, and USmartCombo::SetItems.

00174                                                                       : CPropertyPage(CCheckout_OPTIONS::IDD)
00175 {
00176     //{{AFX_DATA_INIT(CCheckout_OPTIONS)
00177     m_date = date;
00178     m_rev = rev;
00179     m_hasDate = FALSE;
00180     m_match = FALSE;
00181     m_hasRev = FALSE;
00182     m_export = FALSE;
00183     m_forceRoot = FALSE;
00184     //}}AFX_DATA_INIT
00185
00186     m_revCombo.SetItems(&gRevNames);
00187     m_dateCombo.SetItems(&gDateNames);
00188 }

CCheckout_OPTIONS::CCheckout_OPTIONS ( )

Definition at line 190 of file CheckoutDlg.cpp.

00190                                      : CPropertyPage(CCheckout_OPTIONS::IDD)
00191 {
00192 }

CCheckout_OPTIONS::~CCheckout_OPTIONS ( )

Definition at line 194 of file CheckoutDlg.cpp.

00195 {
00196 }

Member Function Documentation

void CCheckout_OPTIONS::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 198 of file CheckoutDlg.cpp.

References DDV_MinChars, DDX_ComboMString, IDC_COMBODATE, IDC_COMBOREV, IDC_DATE, IDC_EXPORT, IDC_FORCEROOT, IDC_MATCH, IDC_REV, m_date, m_dateCombo, m_export, m_forceRoot, m_hasDate, m_hasRev, m_match, m_rev, m_revCombo, OnDate, and OnRev.

00199 {
00200     CPropertyPage::DoDataExchange(pDX);
00201     //{{AFX_DATA_MAP(CCheckout_OPTIONS)
00202     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00203     DDX_Control(pDX, IDC_COMBODATE, m_dateCombo);
00204     DDX_CBString(pDX, IDC_COMBODATE, m_date);
00205     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00206     DDX_Check(pDX, IDC_DATE, m_hasDate);
00207     DDX_Check(pDX, IDC_MATCH, m_match);
00208     DDX_Check(pDX, IDC_REV, m_hasRev);
00209     DDX_Check(pDX, IDC_EXPORT, m_export);
00210     DDX_Check(pDX, IDC_FORCEROOT, m_forceRoot);
00211     //}}AFX_DATA_MAP
00212
00213     if( m_hasRev )
00214     {
00215         DDV_MinChars(pDX, m_rev, 1);
00216     }
00217
00218     if( m_hasDate )
00219     {
00220         DDV_MinChars(pDX, m_date, 1);
00221     }
00222
00223     if( !pDX->m_bSaveAndValidate )
00224     {
00225         OnDate();
00226         OnRev();
00227     }
00228
00229     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00230     DDX_ComboMString(pDX, IDC_COMBODATE, m_dateCombo);
00231 }

void CCheckout_OPTIONS::OnDate ( ) [protected]

Definition at line 244 of file CheckoutDlg.cpp.

References IDC_COMBODATE, and IDC_DATE.

Referenced by DoDataExchange.

00245 {
00246     CButton* but = (CButton *)GetDlgItem(IDC_DATE);
00247     CWnd* wnd = GetDlgItem(IDC_COMBODATE);
00248     wnd->EnableWindow(but->GetCheck() == 1);
00249 }

void CCheckout_OPTIONS::OnRev ( ) [protected]

Definition at line 251 of file CheckoutDlg.cpp.

References IDC_COMBOREV, and IDC_REV.

Referenced by DoDataExchange.

00252 {
00253     CButton* but = (CButton *)GetDlgItem(IDC_REV);
00254     CWnd* wnd = GetDlgItem(IDC_COMBOREV);
00255     wnd->EnableWindow(but->GetCheck() == 1);
00256 }

Member Data Documentation

CString CCheckout_OPTIONS::m_date

Definition at line 105 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS, CompatGetCheckout, and DoDataExchange.

CSmartComboBox CCheckout_OPTIONS::m_dateCombo

Definition at line 104 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS, and DoDataExchange.

BOOL CCheckout_OPTIONS::m_export

Definition at line 110 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS, CompatGetCheckout, and DoDataExchange.

BOOL CCheckout_OPTIONS::m_forceRoot

Definition at line 111 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS, CompatGetCheckout, and DoDataExchange.

BOOL CCheckout_OPTIONS::m_hasDate

Definition at line 107 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS, CompatGetCheckout, and DoDataExchange.

BOOL CCheckout_OPTIONS::m_hasRev

Definition at line 109 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS, CompatGetCheckout, and DoDataExchange.

BOOL CCheckout_OPTIONS::m_match

Definition at line 108 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS, CompatGetCheckout, and DoDataExchange.

CString CCheckout_OPTIONS::m_rev

Definition at line 106 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS, CompatGetCheckout, and DoDataExchange.

CSmartComboBox CCheckout_OPTIONS::m_revCombo

Definition at line 103 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS, and DoDataExchange.

The documentation for this class was generated from the following files:
  • common/CheckoutDlg.h
  • common/CheckoutDlg.cpp
Generated on Sun Feb 24 01:24:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJBrowseButton Class Reference

#include <CJBrowseEdit.h>

Inheritance diagram for CCJBrowseButton:

[legend]
Collaboration diagram for CCJBrowseButton:

[legend]
List of all members.

Public Methods

CCJBrowseButton ()
virtual | ~CCJBrowseButton ()
virtual void | UpdateFont ()
virtual UINT | GetNextID (CWnd *pWnd) const
virtual BOOL | Create (CWnd *pWnd, BROWSE_TYPE eType, UINT nMenu, UINT nSubMenuIndx)

Public Attributes

BOOL | m_bOpenFileDialog
CString | m_strDefExt
CString | m_strFileName
DWORD | m_dwFlags
CString | m_strFilter
CString | m_strTitle
CWnd * m_pParentWnd

Protected Methods

afx_msg void | OnClicked ()

Protected Attributes

UINT | m_nID
CWnd * m_pEditWnd
CFont | m_Font
BROWSE_TYPE m_eType
UINT | m_nMenu
UINT | m_nSubMenuIndx
HICON | m_hIcon

Constructor & Destructor Documentation

CCJBrowseButton::CCJBrowseButton ( )

Definition at line 105 of file CJBrowseEdit.cpp.

References NULL.

00106 {
00107     m_pParentWnd = NULL;
00108     m_pEditWnd   = NULL;
00109     m_hIcon      = NULL;
00110 }

CCJBrowseButton::~CCJBrowseButton ( ) [virtual]

Definition at line 112 of file CJBrowseEdit.cpp.

References _destroyIcon, m_Font, and m_hIcon.

00113 {
00114     // fix potential resource leak - KStowell - 10-22-99.
00115     m_Font.DeleteObject();
00116     _destroyIcon(m_hIcon);
00117 }

Member Function Documentation

BOOL CCJBrowseButton::Create | ( | CWnd * | pWnd,
 |  | BROWSE_TYPE | eType,
 |  | UINT | nMenu,
 |  | UINT | nSubMenuIndx
 | ) | [virtual]

Definition at line 125 of file CJBrowseEdit.cpp.

References ASSERT, BROWSE_TYPE, BT_DIRECTORY, BT_FILE, BT_POPUPMENU, FALSE, GetNextID, IDB_BTN_ARROW, m_eType, m_hIcon, m_nMenu, m_nSubMenuIndx, m_pEditWnd, m_pParentWnd, NULL, SetIcon, TRUE, and UpdateFont.

Referenced by CCJBrowseEdit::InitializeControl.

00126 {
00127     ASSERT( eType );
00128     ASSERT_VALID( pWnd );
00129     ASSERT_VALID( pWnd->GetParent() );
00130
00131     m_pEditWnd      = pWnd;
00132     m_pParentWnd    = m_pEditWnd->GetParent();
00133     m_eType         = eType;
00134     m_nMenu         = nMenu;
00135     m_nSubMenuIndx  = nSubMenuIndx;
00136
00137     CRect rc;
00138     m_pEditWnd->GetWindowRect( &rc );
00139     m_pEditWnd->SetWindowPos( NULL, 0, 0, rc.Width()-23, rc.Height(), SWP_NOZORDER|SWP_NOMOVE );
00140     m_pParentWnd->ScreenToClient( &rc );
00141     rc.left = rc.right-18;
00142
00143     DWORD dwStyle = WS_VISIBLE|WS_CHILD|WS_TABSTOP|BS_CENTER|BS_VCENTER;
00144
00145     // if this is a browse for directory or file edit control.
00146     if(( m_eType == BT_DIRECTORY ) || ( m_eType == BT_FILE ))
00147     {
00148         if( !CButton::Create(_T("..."), dwStyle, rc, m_pParentWnd, GetNextID( m_pParentWnd )))
00149         {
00150             TRACE0( "Failed to create browse edit browse button.\n" );
00151             return FALSE;
00152         }
00153
00154         // set the tab order and font, enable the window based on parent's state.
00155         SetWindowPos( m_pEditWnd, 0,0,0,0, SWP_NOSIZE|SWP_NOMOVE );
00156         EnableWindow( m_pEditWnd->IsWindowEnabled( ));
00157         UpdateFont();
00158
00159         return TRUE;
00160     }
00161
00162     // if this is a popup menu edit control.
00163     else if( m_eType == BT_POPUPMENU )
00164     {
00165         if( !CButton::Create( NULL, dwStyle|BS_ICON, rc, m_pParentWnd, GetNextID( m_pParentWnd )))
00166         {
00167             TRACE0( "Failed to create browse edit browse button.\n" );
00168             return FALSE;
00169         }
00170
00171         // set the tab order and font, enable the window based on parent's state.
00172         SetWindowPos( m_pEditWnd, 0,0,0,0, SWP_NOSIZE|SWP_NOMOVE );
00173         EnableWindow( m_pEditWnd->IsWindowEnabled( ));
00174         UpdateFont();
00175
00176         // create the icon arrow that is displayed on the button.
00177         CImageList imageList;
00178         CBitmap    bitmap;
00179
00180         bitmap.LoadBitmap( IDB_BTN_ARROW );
00181         imageList.Create( 15, 17, ILC_COLORDDB|ILC_MASK, 1, 1 );
00182         imageList.Add( &bitmap, RGB( 255,0,255 ));
00183
00184         // set the icon and free resources.
00185         // fix potential resource leak - KStowell - 10-22-99.
00186         m_hIcon = imageList.ExtractIcon( 0 );
00187         SetIcon(m_hIcon);
00188         imageList.Detach();
00189         bitmap.DeleteObject();
00190
00191         return TRUE;
00192     }
00193
00194     return FALSE;
00195 }

_CJXLIB_INLINE UINT CCJBrowseButton::GetNextID ( CWnd * pWnd ) const [virtual]

Definition at line 239 of file CJBrowseEdit.h.

Referenced by Create.

00240     { for(UINT nID=32767; nID!=1; --nID){if(!pWnd->GetDlgItem(nID)){return nID;}}return 0; }

void CCJBrowseButton::OnClicked ( ) [protected]

Definition at line 197 of file CJBrowseEdit.cpp.

References ASSERT, BT_DIRECTORY, BT_FILE, BT_POPUPMENU, m_bOpenFileDialog, m_dwFlags, m_eType, m_nMenu, m_nSubMenuIndx, m_pEditWnd, m_pParentWnd, m_strDefExt, m_strFileName, m_strFilter, m_strTitle, NULL, and VERIFY.

00198 {
00199     if( m_eType == BT_DIRECTORY )
00200     {
00201         CCJShell sfi;
00202         sfi.m_strTitle = m_strTitle;
00203
00204         if( sfi.BrowseForFolder( m_pParentWnd ) == IDOK ) {
00205             m_pEditWnd->SetWindowText( sfi.m_strPath );
00206         }
00207     }
00208
00209     else if( m_eType == BT_FILE )
00210     {
00211         CFileDialog dlg( m_bOpenFileDialog, m_strDefExt, m_strFileName,
00212             m_dwFlags, m_strFilter, m_pParentWnd );
00213
00214         if( dlg.DoModal() == IDOK ) {
00215             m_pEditWnd->SetWindowText( dlg.GetPathName( ));
00216         }
00217     }
00218
00219     else if( m_eType == BT_POPUPMENU )
00220     {
00221         ASSERT( m_nMenu != 0 );
00222         SetState( true );
00223
00224         CRect rc;
00225         GetWindowRect( &rc );
00226
00227         CMenu menu;
00228         VERIFY( menu.LoadMenu( m_nMenu ));
00229
00230         CCJMenu* pPopup = (CCJMenu*)menu.GetSubMenu( m_nSubMenuIndx );
00231         ASSERT( pPopup != NULL );
00232
00233         pPopup->TrackPopupMenu( TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_VERTICAL,
00234             rc.right, rc.top, m_pParentWnd, &rc );
00235
00236         // Return the button state to normal.
00237         SetState( false );
00238     }
00239 }

void CCJBrowseButton::UpdateFont ( ) [virtual]

Definition at line 241 of file CJBrowseEdit.cpp.

References m_Font, and VERIFY.

Referenced by Create.

00242 {
00243     m_Font.DeleteObject();
00244     NONCLIENTMETRICS ncm;
00245     ncm.cbSize = sizeof(ncm);
00246     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00247     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00248     SetFont(&m_Font);
00249 }

Member Data Documentation

BOOL CCJBrowseButton::m_bOpenFileDialog

Definition at line 97 of file CJBrowseEdit.h.

Referenced by OnClicked, and CCJBrowseEdit::SetDlgOpenFile.

DWORD CCJBrowseButton::m_dwFlags

Definition at line 101 of file CJBrowseEdit.h.

Referenced by OnClicked, and CCJBrowseEdit::SetDlgStyle.

BROWSE_TYPE CCJBrowseButton::m_eType [protected]

Definition at line 111 of file CJBrowseEdit.h.

Referenced by Create, and OnClicked.

CFont CCJBrowseButton::m_Font [protected]

Definition at line 110 of file CJBrowseEdit.h.

Referenced by UpdateFont, and ~CCJBrowseButton.

HICON CCJBrowseButton::m_hIcon [protected]

Definition at line 114 of file CJBrowseEdit.h.

Referenced by Create, and ~CCJBrowseButton.

UINT CCJBrowseButton::m_nID [protected]

Definition at line 108 of file CJBrowseEdit.h.

UINT CCJBrowseButton::m_nMenu [protected]

Definition at line 112 of file CJBrowseEdit.h.

Referenced by Create, and OnClicked.

UINT CCJBrowseButton::m_nSubMenuIndx [protected]

Definition at line 113 of file CJBrowseEdit.h.

Referenced by Create, and OnClicked.

CWnd* CCJBrowseButton::m_pEditWnd [protected]

Definition at line 109 of file CJBrowseEdit.h.

Referenced by Create, and OnClicked.

CWnd* CCJBrowseButton::m_pParentWnd

Definition at line 104 of file CJBrowseEdit.h.

Referenced by Create, OnClicked, and CCJBrowseEdit::SetDlgOwner.

CString CCJBrowseButton::m_strDefExt

Definition at line 99 of file CJBrowseEdit.h.

Referenced by OnClicked, and CCJBrowseEdit::SetDlgDefExt.

CString CCJBrowseButton::m_strFileName

Definition at line 100 of file CJBrowseEdit.h.

Referenced by OnClicked, and CCJBrowseEdit::SetDlgFileName.

CString CCJBrowseButton::m_strFilter

Definition at line 102 of file CJBrowseEdit.h.

Referenced by OnClicked, and CCJBrowseEdit::SetDlgFilter.

CString CCJBrowseButton::m_strTitle

Definition at line 103 of file CJBrowseEdit.h.

Referenced by OnClicked, and CCJBrowseEdit::SetDlgTitle.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJBrowseEdit.h
  • WinCvs/CJLib/CJLibrary/CJBrowseEdit.cpp
Generated on Sun Feb 24 01:24:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJBrowseEdit Class Reference

#include <CJBrowseEdit.h>

Inheritance diagram for CCJBrowseEdit:

[legend]
Collaboration diagram for CCJBrowseEdit:

[legend]
List of all members.

Public Methods

CCJBrowseEdit ()
virtual | ~CCJBrowseEdit ()
virtual void | InitializeControl ()
virtual void | SetDlgOpenFile (BOOL bOpenFileDialog)
virtual void | SetDlgDefExt (LPCTSTR strDefExt)
virtual void | SetDlgFileName (LPCTSTR strFileName)
virtual void | SetDlgStyle (DWORD dwFlags)
virtual void | SetDlgFilter (LPCTSTR strFilter)
virtual void | SetDlgOwner (CWnd *pParentWnd)
virtual void | SetDlgTitle (LPCTSTR strTitle)
virtual void | SetSearchType (BROWSE_TYPE eType, UINT nMenu=0, int nSubMenuIndx=0)

Protected Methods

virtual void | PreSubclassWindow ()
afx_msg void | OnEnable (BOOL bEnable)
afx_msg void | OnShowWindow (BOOL bShow, UINT nStatus)
afx_msg int | OnCreate (LPCREATESTRUCT lpCreateStruct)

Protected Attributes

CCJBrowseButton m_btnBrowse
BROWSE_TYPE m_eType
UINT | m_nMenu
UINT | m_nSubMenuIndx

Constructor & Destructor Documentation

CCJBrowseEdit::CCJBrowseEdit ( )

Definition at line 254 of file CJBrowseEdit.cpp.

References BT_DIRECTORY.

00254                              : m_eType( BT_DIRECTORY ), m_nMenu( (UINT)-1 )
00255 {
00256
00257 }

CCJBrowseEdit::~CCJBrowseEdit ( ) [virtual]

Definition at line 259 of file CJBrowseEdit.cpp.

00260 {
00261 }

Member Function Documentation

void CCJBrowseEdit::InitializeControl ( ) [virtual]

Definition at line 305 of file CJBrowseEdit.cpp.

References CCJBrowseButton::Create, m_btnBrowse, m_eType, m_nMenu, m_nSubMenuIndx, SetDlgDefExt, SetDlgFileName, SetDlgFilter, SetDlgOpenFile, SetDlgOwner, SetDlgStyle, and SetDlgTitle.

Referenced by OnCreate, and PreSubclassWindow.

00306 {
00307     // create the browse button associated with this control.
00308     if( m_btnBrowse.Create( this, m_eType, m_nMenu, m_nSubMenuIndx ))
00309     {
00310         // initialize some defaults
00311         SetDlgOpenFile();
00312         SetDlgDefExt( _T( "*.*" ));
00313         SetDlgFileName();
00314         SetDlgStyle( OFN_HIDEREADONLY|OFN_FILEMUSTEXIST|OFN_EXPLORER );
00315         SetDlgFilter( _T( "All Files (*.*)|*.*||" ));
00316         SetDlgOwner( GetParent( ));
00317         SetDlgTitle( _T( "Select Folder" ));
00318     }
00319 }

int CCJBrowseEdit::OnCreate ( LPCREATESTRUCT lpCreateStruct ) [protected]

Definition at line 294 of file CJBrowseEdit.cpp.

References InitializeControl.

00295 {
00296     if (CEdit::OnCreate(lpCreateStruct) == -1)
00297         return -1;
00298
00299     // initialize control to defaults.
00300     InitializeControl();
00301
00302     return 0;
00303 }

void CCJBrowseEdit::OnEnable ( BOOL bEnable ) [protected]

Definition at line 274 of file CJBrowseEdit.cpp.

References m_btnBrowse.

00275 {
00276     CEdit::OnEnable(bEnable);
00277     m_btnBrowse.EnableWindow(bEnable);
00278 }

void CCJBrowseEdit::OnShowWindow | ( | BOOL | bShow,
 |  | UINT | nStatus
 | ) | [protected]

Definition at line 280 of file CJBrowseEdit.cpp.

References m_btnBrowse.

00281 {
00282     CEdit::OnShowWindow( bShow, nStatus );
00283     m_btnBrowse.ShowWindow( bShow?SW_SHOW:SW_HIDE );
00284 }

void CCJBrowseEdit::PreSubclassWindow ( ) [protected, virtual]

Definition at line 286 of file CJBrowseEdit.cpp.

References InitializeControl.

00287 {
00288     CEdit::PreSubclassWindow();
00289
00290     // initialize control to defaults.
00291     InitializeControl();
00292 }

_CJXLIB_INLINE void CCJBrowseEdit::SetDlgDefExt ( LPCTSTR strDefExt ) [virtual]

Definition at line 245 of file CJBrowseEdit.h.

References m_btnBrowse, CCJBrowseButton::m_strDefExt, and NULL.

Referenced by InitializeControl.

00246     { m_btnBrowse.m_strDefExt = strDefExt; }

_CJXLIB_INLINE void CCJBrowseEdit::SetDlgFileName ( LPCTSTR strFileName ) [virtual]

Definition at line 248 of file CJBrowseEdit.h.

References m_btnBrowse, CCJBrowseButton::m_strFileName, and NULL.

Referenced by InitializeControl.

00249     { m_btnBrowse.m_strFileName = strFileName; }

_CJXLIB_INLINE void CCJBrowseEdit::SetDlgFilter ( LPCTSTR strFilter ) [virtual]

Definition at line 254 of file CJBrowseEdit.h.

References m_btnBrowse, CCJBrowseButton::m_strFilter, and NULL.

Referenced by InitializeControl.

00255     { m_btnBrowse.m_strFilter = strFilter; }

_CJXLIB_INLINE void CCJBrowseEdit::SetDlgOpenFile ( BOOL bOpenFileDialog ) [virtual]

Definition at line 242 of file CJBrowseEdit.h.

References CCJBrowseButton::m_bOpenFileDialog, m_btnBrowse, and TRUE.

Referenced by InitializeControl.

00243     { m_btnBrowse.m_bOpenFileDialog = bOpenFileDialog; }

_CJXLIB_INLINE void CCJBrowseEdit::SetDlgOwner ( CWnd * pParentWnd ) [virtual]

Definition at line 257 of file CJBrowseEdit.h.

References m_btnBrowse, CCJBrowseButton::m_pParentWnd, and NULL.

Referenced by InitializeControl.

00258     { m_btnBrowse.m_pParentWnd = pParentWnd; }

_CJXLIB_INLINE void CCJBrowseEdit::SetDlgStyle ( DWORD dwFlags ) [virtual]

Definition at line 251 of file CJBrowseEdit.h.

References m_btnBrowse, and CCJBrowseButton::m_dwFlags.

Referenced by InitializeControl.

00252     { m_btnBrowse.m_dwFlags = dwFlags; }

_CJXLIB_INLINE void CCJBrowseEdit::SetDlgTitle ( LPCTSTR strTitle ) [virtual]

Definition at line 260 of file CJBrowseEdit.h.

References m_btnBrowse, CCJBrowseButton::m_strTitle, and NULL.

Referenced by InitializeControl.

00261     { m_btnBrowse.m_strTitle = strTitle; }

_CJXLIB_INLINE void CCJBrowseEdit::SetSearchType | ( | BROWSE_TYPE | eType,
 |  | UINT | nMenu = 0,
 |  | int | nSubMenuIndx = 0
 | ) | [virtual]

Definition at line 263 of file CJBrowseEdit.h.

References BROWSE_TYPE, m_eType, m_nMenu, and m_nSubMenuIndx.

00264     { m_eType = eType; m_nMenu = nMenu; m_nSubMenuIndx = nSubMenuIndx; }

Member Data Documentation

CCJBrowseButton CCJBrowseEdit::m_btnBrowse [protected]

Definition at line 159 of file CJBrowseEdit.h.

Referenced by InitializeControl, OnEnable, OnShowWindow, SetDlgDefExt, SetDlgFileName, SetDlgFilter, SetDlgOpenFile, SetDlgOwner, SetDlgStyle, and SetDlgTitle.

BROWSE_TYPE CCJBrowseEdit::m_eType [protected]

Definition at line 160 of file CJBrowseEdit.h.

Referenced by InitializeControl, and SetSearchType.

UINT CCJBrowseEdit::m_nMenu [protected]

Definition at line 161 of file CJBrowseEdit.h.

Referenced by InitializeControl, and SetSearchType.

UINT CCJBrowseEdit::m_nSubMenuIndx [protected]

Definition at line 162 of file CJBrowseEdit.h.

Referenced by InitializeControl, and SetSearchType.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJBrowseEdit.h
  • WinCvs/CJLib/CJLibrary/CJBrowseEdit.cpp
Generated on Sun Feb 24 01:24:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJCaption Class Reference

#include <CJCaption.h>

Inheritance diagram for CCJCaption:

[legend]
Collaboration diagram for CCJCaption:

[legend]
List of all members.

Public Methods

CCJCaption ()
virtual | ~CCJCaption ()
virtual void | SetCaptionColors (COLORREF clrBorder, COLORREF clrBackground, COLORREF clrFont)
virtual void | ModifyCaptionStyle (int nBorderSize, CFont *pFont=NULL, LPCTSTR lpszWindText=NULL, HICON hIcon=NULL)
virtual void | SetChildWindow (CWnd *pChild, CWnd *pNotifyWnd)
virtual void | KillChildWindow ()
virtual void | DrawCaptionBack (CDC *pDC, CRect &rcItem)
virtual void | DrawCaptionText (CDC *pDC, CRect &rcItem)
virtual void | DrawCaptionIcon (CDC *pDC, CRect &rcItem)
virtual void | UpdateFont ()
virtual void | UpdateCaption (LPCTSTR lpszWindowText, HICON hIcon)
virtual void | UpdateCaptionBack (CDC *pDC, CRect &rcItem)
virtual void | UpdateCaptionText (CDC *pDC, CRect &rcItem)
virtual void | SetTextStyle (DWORD dwStyle)
virtual BOOL | Create (CWnd *pParentWnd, LPCTSTR lpszWindowName, DWORD dwExStyle=0x01, DWORD dwStyle=WS_VISIBLE|SS_CENTER|SS_CENTERIMAGE, const CRect &rect=CRect(0, 0, 0, 0), UINT nID=0xffff)

Protected Methods

afx_msg void | OnPaint ()
afx_msg void | OnSysColorChange ()
afx_msg void | OnSize (UINT nType, int cx, int cy)
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)
afx_msg void | OnCaptButton ()
afx_msg void | OnPushPinButton (UINT lParam, LONG wParam)
afx_msg void | OnPushPinCancel (UINT lParam, LONG wParam)

Protected Attributes

COLORREF | m_clrBtnHilite
COLORREF | m_clrBtnShadow
COLORREF | m_clrBtnFace
COLORREF | m_clrBorder
COLORREF | m_clrBackgnd
COLORREF | m_clrFont
int | m_nBorder
CFont * | m_pFont
CFont | m_Font
HICON | m_hIcon
CString | m_strWindText
int | m_cx
int | m_cy
int | m_nOffset
CWnd * m_pChildWnd
CWnd * m_pNotifyWnd
CCJCaptionButton m_CaptionButton
CCJCaptionPopupWnd * m_pWndPopDown
CRect | m_rcChild
DWORD | m_dwExStyle
CRect | m_rcClient
DWORD | m_dwTextStyle

Constructor & Destructor Documentation

CCJCaption::CCJCaption ( )

Definition at line 193 of file CJCaption.cpp.

References m_clrBackgnd, m_clrBorder, m_clrBtnFace, m_clrBtnHilite, m_clrBtnShadow, m_clrFont, m_cx, m_cy, m_hIcon, m_nBorder, m_pChildWnd, m_pFont, m_pNotifyWnd, m_pWndPopDown, m_strWindText, NULL, and SetTextStyle.

00194 {
00195     m_strWindText   = _T("");
00196     m_pNotifyWnd    = NULL;
00197     m_pWndPopDown   = NULL;
00198     m_pChildWnd     = NULL;
00199     m_cx            = ::GetSystemMetrics(SM_CXSMICON);
00200     m_cy            = ::GetSystemMetrics(SM_CYSMICON);
00201     m_clrBtnHilite  = ::GetSysColor(COLOR_BTNHILIGHT);
00202     m_clrBtnShadow  = ::GetSysColor(COLOR_BTNSHADOW);
00203     m_clrBtnFace    = ::GetSysColor(COLOR_BTNFACE);
00204     m_clrFont       = ::GetSysColor(COLOR_WINDOWTEXT);
00205     m_clrBorder     = ::GetSysColor(COLOR_BTNFACE);
00206     m_clrBackgnd    = ::GetSysColor(COLOR_BTNFACE);
00207     m_nBorder       = 0;
00208     m_pFont         = NULL;
00209     m_hIcon         = NULL;
00210
00211     SetTextStyle( DT_SINGLELINE|DT_END_ELLIPSIS );
00212 }

CCJCaption::~CCJCaption ( ) [virtual]

Definition at line 214 of file CJCaption.cpp.

References m_Font.

00215 {
00216     // fix potential resource leak - KStowell - 10-22-99.
00217     m_Font.DeleteObject();
00218 }

Member Function Documentation

BOOL CCJCaption::Create | ( | CWnd * | pParentWnd,
 |  | LPCTSTR | lpszWindowName,
 |  | DWORD | dwExStyle = 0x01,
 |  | DWORD | dwStyle = WS_VISIBLE|SS_CENTER|SS_CENTERIMAGE,
 |  | const CRect & | rect = CRect(0, 0, 0, 0),
 |  | UINT | nID = 0xffff
 | ) | [virtual]

Definition at line 355 of file CJCaption.cpp.

References FALSE, IDC_CAPT_BUTTON, m_CaptionButton, m_clrBackgnd, m_clrFont, m_dwExStyle, m_pFont, m_strWindText, NULL, CCJCaptionButton::SetButtonStyle, TRUE, UpdateFont, and WS_EX_FLATEDGE.

Referenced by CCJCaptionPopupWnd::Create, and CCJExplorerBar::OnCreate.

00356 {
00357     // Let the base class create the control.
00358     if( !CStatic::Create( NULL, dwStyle, rect, pParentWnd, nID ))
00359     {
00360         TRACE(_T("Unable to create caption.\n"));
00361         return FALSE;
00362     }
00363
00364     UpdateFont();
00365
00366     // save the style.
00367     if( dwExStyle & WS_EX_FLATEDGE ) {
00368         m_dwExStyle = dwExStyle;
00369     }
00370
00371     else {
00372         ModifyStyleEx( 0, dwExStyle );
00373     }
00374
00375     // Save the window text.
00376     m_strWindText = lpszWindowName;
00377
00378     // Create the button to be used with child window.
00379     if( !m_CaptionButton.Create( m_strWindText, BS_ICON|BS_OWNERDRAW|BS_VCENTER,
00380         CRect(0,0,0,0), this, IDC_CAPT_BUTTON ))
00381     {
00382         TRACE0( "Unable to create caption button.\n" );
00383         return FALSE;
00384     }
00385
00386     // set the button font and colors.
00387     m_CaptionButton.SetButtonStyle( m_pFont, m_clrBackgnd, m_clrFont );
00388
00389     return TRUE;
00390 }

void CCJCaption::DrawCaptionBack | ( | CDC * | pDC,
 |  | CRect & | rcItem
 | ) | [virtual]

Definition at line 270 of file CJCaption.cpp.

References m_clrBackgnd, m_clrBtnFace, m_clrBtnHilite, m_clrBtnShadow, m_dwExStyle, m_nBorder, and WS_EX_FLATEDGE.

Referenced by OnPaint.

00271 {
00272     CRect rc = rcItem;
00273
00274     // Set the background mode to transparent.
00275     pDC->SetBkMode( TRANSPARENT );
00276
00277     // repaint the background.
00278     pDC->FillSolidRect( rc, m_clrBtnFace );
00279
00280     // draw the caption border.
00281     if( m_dwExStyle & WS_EX_FLATEDGE ) {
00282         pDC->Draw3dRect(rc, m_clrBtnHilite, m_clrBtnShadow);
00283     }
00284
00285     // draw the caption banner border.
00286     if( m_nBorder != 0 ) {
00287         rc.DeflateRect( m_nBorder, m_nBorder );
00288         pDC->FillSolidRect(rc, m_clrBackgnd);
00289     }
00290 }

void CCJCaption::DrawCaptionIcon | ( | CDC * | pDC,
 |  | CRect & | rcItem
 | ) | [virtual]

Definition at line 320 of file CJCaption.cpp.

References m_cx, m_cy, m_hIcon, m_nBorder, and NULL.

Referenced by OnPaint, and UpdateCaption.

00321 {
00322     // If no icon was defined, just return.
00323     if( m_hIcon == NULL )
00324         return;
00325
00326     CRect rc = rcItem;
00327     rc.left = ( rc.right - m_cx )-( m_nBorder + 2 );
00328
00329     // stop the icon at the left hand border
00330     if (rc.left < m_nBorder) {
00331         rc.left = m_nBorder;
00332     }
00333
00334     rc.top = ( rcItem.Height() - m_cy )/2;
00335     rc.right = rc.left + m_cx;
00336     rc.bottom = rc.top + m_cy;
00337
00338     // Only draw the icon if it will fit into the space between the borders
00339     if (rc.right < rcItem.right - m_nBorder) {
00340         // draw the icon associated with the caption.
00341         ::DrawIconEx( pDC->GetSafeHdc(), rc.left, rc.top, m_hIcon,
00342             rc.Width(), rc.Height(), NULL, (HBRUSH)NULL, DI_NORMAL);
00343     }
00344 }

void CCJCaption::DrawCaptionText | ( | CDC * | pDC,
 |  | CRect & | rcItem
 | ) | [virtual]

Definition at line 292 of file CJCaption.cpp.

References m_clrFont, m_cx, m_dwTextStyle, m_Font, m_nBorder, m_pFont, m_strWindText, and NULL.

Referenced by OnPaint, and UpdateCaptionText.

00293 {
00294     // if the caption text is empty, return.
00295     if( m_strWindText.IsEmpty( ))
00296         return;
00297
00298     if( m_pFont == NULL ) {
00299         m_pFont = &m_Font;
00300     }
00301
00302     CRect rc = rcItem;
00303     rc.OffsetRect( 10,0 );
00304
00305     // Set the text color and select the caption font.
00306     pDC->SetTextColor( m_clrFont );
00307     CFont* oldFont = pDC->SelectObject( m_pFont );
00308
00309     // get the height of the text to be displayed.
00310     int cy = pDC->DrawText( m_strWindText, -1, rc, DT_SINGLELINE|DT_CALCRECT );
00311     rc.top = (rcItem.Height()-cy)/2;
00312     rc.bottom = rc.top+cy;
00313     rc.right  = rcItem.right-(m_cx + m_nBorder);
00314
00315     // draw the text, and select the original font.
00316     pDC->DrawText( m_strWindText, rc, m_dwTextStyle );
00317     pDC->SelectObject( oldFont );
00318 }

void CCJCaption::KillChildWindow ( ) [virtual]

Definition at line 436 of file CJCaption.cpp.

References _delete, FALSE, m_CaptionButton, and m_pWndPopDown.

Referenced by OnPushPinButton.

00437 {
00438     m_CaptionButton.SetState(FALSE);
00439     m_CaptionButton.ModifyStyle( WS_VISIBLE, 0 );
00440     m_pWndPopDown->DestroyWindow();
00441     _delete( m_pWndPopDown );
00442 }

void CCJCaption::ModifyCaptionStyle | ( | int | nBorderSize,
 |  | CFont * | pFont = NULL,
 |  | LPCTSTR | lpszWindText = NULL,
 |  | HICON | hIcon = NULL
 | ) | [virtual]

Definition at line 392 of file CJCaption.cpp.

References ASSERT, m_CaptionButton, m_clrBackgnd, m_clrFont, m_hIcon, m_nBorder, m_pFont, m_strWindText, and CCJCaptionButton::SetButtonStyle.

00393 {
00394     ASSERT(::IsWindow(m_hWnd));
00395
00396     if( nBorderSize ) {
00397         m_nBorder = nBorderSize;
00398     }
00399
00400     if( pFont ) {
00401         m_pFont = pFont;
00402         m_CaptionButton.SetButtonStyle( m_pFont, m_clrBackgnd, m_clrFont );
00403     }
00404
00405     if( lpszWindText ) {
00406         m_strWindText = lpszWindText;
00407     }
00408
00409     if( hIcon ) {
00410         m_hIcon = hIcon;
00411     }
00412
00413     Invalidate();
00414 }

void CCJCaption::OnCaptButton ( ) [protected]

Definition at line 467 of file CJCaption.cpp.

References _delete, CCJCaptionPopupWnd::Create, m_CaptionButton, m_pChildWnd, m_pWndPopDown, m_rcChild, and TRUE.

00468 {
00469     CRect rc;
00470     m_CaptionButton.GetWindowRect(&rc);
00471     rc.right  = rc.left + m_rcChild.Width();
00472     rc.top    = rc.bottom;
00473     rc.bottom = rc.top + m_rcChild.Height();
00474
00475     //if window is already present delete it
00476     _delete( m_pWndPopDown );
00477
00478     // Get the class name and create the window
00479     m_pWndPopDown = new CCJCaptionPopupWnd;
00480     m_pWndPopDown->Create( rc, this, m_pChildWnd );
00481     m_pChildWnd->ShowWindow(SW_SHOW);
00482     m_CaptionButton.SetState(TRUE);
00483 }

BOOL CCJCaption::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 584 of file CJCaption.cpp.

References TRUE.

00585 {
00586     // KStowell - overridden for flicker-free drawing.
00587     UNUSED_ALWAYS(pDC);
00588     return TRUE;
00589 }

void CCJCaption::OnPaint ( ) [protected]

Definition at line 235 of file CJCaption.cpp.

References DrawCaptionBack, DrawCaptionIcon, DrawCaptionText, and m_clrBtnFace.

00236 {
00237     CPaintDC dc(this); // device context for painting
00238
00239     // KStowell - Get the client rect.
00240     CRect rcClient;
00241     GetClientRect( &rcClient );
00242
00243     // KStowell - Create a memory device-context. This is done to help reduce
00244     // screen flicker, since we will paint the entire control to the
00245     // off screen device context first.
00246     CDC memDC;
00247     CBitmap bitmap;
00248     memDC.CreateCompatibleDC(&dc);
00249     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00250     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00251     memDC.FillSolidRect( rcClient, m_clrBtnFace );
00252
00253     // First let the control do its default drawing.
00254     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00255
00256     // draw the backgound, text and icon.
00257     DrawCaptionBack( &memDC, rcClient );
00258     DrawCaptionText( &memDC, rcClient );
00259     DrawCaptionIcon( &memDC, rcClient );
00260
00261     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00262     dc.BitBlt(rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), &memDC, 0,0, SRCCOPY);
00263
00264     // KStowell - Cleanup resources.
00265     memDC.SelectObject(pOldBitmap);
00266     memDC.DeleteDC();
00267     bitmap.DeleteObject();
00268 }

void CCJCaption::OnPushPinButton | ( | UINT | lParam,
 |  | LONG | wParam
 | ) | [protected]

Definition at line 485 of file CJCaption.cpp.

References CM_ONPUSHPINBUTTON, KillChildWindow, m_nOffset, m_pChildWnd, m_pNotifyWnd, and m_rcChild.

00486 {
00487     UNUSED_ALWAYS( lParam );
00488     UNUSED_ALWAYS( wParam );
00489
00490     KillChildWindow();
00491     m_pNotifyWnd->SendMessage(CM_ONPUSHPINBUTTON, 0, 0);
00492     m_pChildWnd->GetParent()->GetClientRect(&m_rcChild);
00493     if(m_nOffset>0) {
00494         m_rcChild.top += m_nOffset;
00495     }
00496     m_pChildWnd->MoveWindow(m_rcChild);
00497     Invalidate();
00498 }

void CCJCaption::OnPushPinCancel | ( | UINT | lParam,
 |  | LONG | wParam
 | ) | [protected]

Definition at line 500 of file CJCaption.cpp.

References _delete, CM_ONPUSHPINCANCEL, FALSE, m_CaptionButton, m_pNotifyWnd, and m_pWndPopDown.

00501 {
00502     UNUSED_ALWAYS( lParam );
00503     UNUSED_ALWAYS( wParam );
00504
00505     m_CaptionButton.SetState(FALSE);
00506     m_pWndPopDown->DestroyWindow();
00507
00508     _delete( m_pWndPopDown );
00509
00510     m_pNotifyWnd->SendMessage(CM_ONPUSHPINCANCEL, 0, 0);
00511 }

void CCJCaption::OnSize | ( | UINT | nType,
 |  | int | cx,
 |  | int | cy
 | ) | [protected]

Definition at line 444 of file CJCaption.cpp.

References m_CaptionButton, m_nBorder, m_pFont, and m_strWindText.

00445 {
00446     CStatic::OnSize(nType, cx, cy);
00447
00448     if( m_CaptionButton.GetSafeHwnd())
00449     {
00450         CDC* pDC = GetDC();
00451         CFont* pOldFont = pDC->SelectObject(m_pFont);
00452
00453         TEXTMETRIC tm;
00454         pDC->GetTextMetrics(&tm);
00455
00456         CSize size = pDC->GetTextExtent(m_strWindText, m_strWindText.GetLength());
00457         size.cx += tm.tmAveCharWidth+21;
00458         pDC->SelectObject(pOldFont);
00459         ReleaseDC(pDC);
00460
00461         CRect rc( 0, 0, size.cx, cy );
00462         rc.DeflateRect(m_nBorder+1, m_nBorder+1);
00463         m_CaptionButton.MoveWindow(rc);
00464     }
00465 }

void CCJCaption::OnSysColorChange ( ) [protected]

Definition at line 346 of file CJCaption.cpp.

References m_clrBtnFace, m_clrBtnHilite, and m_clrBtnShadow.

00347 {
00348     CStatic::OnSysColorChange();
00349
00350     m_clrBtnHilite = ::GetSysColor(COLOR_BTNHILIGHT);
00351     m_clrBtnShadow = ::GetSysColor(COLOR_BTNSHADOW);
00352     m_clrBtnFace   = ::GetSysColor(COLOR_BTNFACE);
00353 }

_CJXLIB_INLINE void CCJCaption::SetCaptionColors | ( | COLORREF | clrBorder,
 |  | COLORREF | clrBackground,
 |  | COLORREF | clrFont
 | ) | [virtual]

Definition at line 240 of file CJCaption.h.

References ASSERT, m_clrBackgnd, m_clrBorder, and m_clrFont.

00241     { ASSERT(::IsWindow(m_hWnd)); m_clrBorder = clrBorder; m_clrBackgnd = clrBackground; m_clrFont = clrFont; }

void CCJCaption::SetChildWindow | ( | CWnd * | pChild,
 |  | CWnd * | pNotifyWnd
 | ) | [virtual]

Definition at line 416 of file CJCaption.cpp.

References ASSERT, m_CaptionButton, m_nOffset, m_pChildWnd, m_pNotifyWnd, m_rcChild, and NULL.

00417 {
00418     ASSERT( pChild != NULL );       // must be valid.
00419     ASSERT( pNotifyWnd != NULL );   // must be valid.
00420
00421     // save window pointers, and show caption button.
00422     m_pChildWnd  = pChild;
00423     m_pNotifyWnd = pNotifyWnd;
00424
00425     // set the size of the child window.
00426     m_pChildWnd->GetWindowRect(&m_rcChild);
00427
00428     CRect rcClient;
00429     m_pChildWnd->GetParent()->GetClientRect(&rcClient);
00430     m_nOffset = rcClient.Height()-m_rcChild.Height();
00431
00432     m_CaptionButton.ModifyStyle( 0, WS_VISIBLE );
00433     Invalidate();
00434 }

_CJXLIB_INLINE void CCJCaption::SetTextStyle ( DWORD dwStyle ) [virtual]

Definition at line 237 of file CJCaption.h.

References m_dwTextStyle.

Referenced by CCJCaption.

00238     { m_dwTextStyle = dwStyle; }

void CCJCaption::UpdateCaption | ( | LPCTSTR | lpszWindowText,
 |  | HICON | hIcon
 | ) | [virtual]

Definition at line 513 of file CJCaption.cpp.

References ASSERT, DrawCaptionIcon, m_hIcon, m_strWindText, UpdateCaptionBack, and UpdateCaptionText.

00514 {
00515     ASSERT(::IsWindow(m_hWnd));
00516
00517     CRect rcClient;
00518     GetClientRect(&rcClient);
00519     CDC* pDC = GetDC();
00520
00521     UpdateCaptionBack(pDC, rcClient);
00522
00523     if( lpszWindowText )
00524     {
00525         m_strWindText = lpszWindowText;
00526         UpdateCaptionText(pDC, rcClient);
00527     }
00528
00529     if( hIcon ) {
00530         m_hIcon = hIcon;
00531         DrawCaptionIcon( pDC, rcClient );
00532     }
00533
00534     ReleaseDC(pDC);
00535 }

void CCJCaption::UpdateCaptionBack | ( | CDC * | pDC,
 |  | CRect & | rcItem
 | ) | [virtual]

Definition at line 537 of file CJCaption.cpp.

References m_clrBackgnd, m_clrBtnFace, and m_nBorder.

Referenced by UpdateCaption.

00538 {
00539     CRect rc = rcItem;
00540
00541     // Set the background mode to transparent.
00542     pDC->SetBkMode( TRANSPARENT );
00543
00544     rc.DeflateRect(1,1);
00545     // repaint the background.
00546     pDC->FillSolidRect( rc, m_clrBtnFace );
00547
00548     // draw the caption banner border.
00549     if( m_nBorder != 0 ) {
00550         rc.DeflateRect( m_nBorder-1, m_nBorder-1 );
00551         pDC->FillSolidRect(rc, m_clrBackgnd);
00552     }
00553 }

void CCJCaption::UpdateCaptionText | ( | CDC * | pDC,
 |  | CRect & | rcItem
 | ) | [virtual]

Definition at line 555 of file CJCaption.cpp.

References DrawCaptionText, m_CaptionButton, m_nBorder, m_pFont, and m_strWindText.

Referenced by UpdateCaption.

00556 {
00557     CFont* pOldFont = pDC->SelectObject(m_pFont);
00558
00559     TEXTMETRIC tm;
00560     pDC->GetTextMetrics(&tm);
00561
00562     CSize size = pDC->GetTextExtent(m_strWindText, m_strWindText.GetLength());
00563     size.cx += tm.tmAveCharWidth+21;
00564     pDC->SelectObject(pOldFont);
00565
00566     CRect rc( 0, 0, size.cx, rcItem.Height() );
00567     rc.DeflateRect(m_nBorder+1, m_nBorder+1);
00568     m_CaptionButton.MoveWindow(rc);
00569     m_CaptionButton.SetWindowText(m_strWindText);
00570
00571     DrawCaptionText( pDC, rcItem );
00572 }

void CCJCaption::UpdateFont ( ) [virtual]

Definition at line 574 of file CJCaption.cpp.

References m_Font, m_pFont, and VERIFY.

Referenced by Create.

00575 {
00576     m_Font.DeleteObject();
00577     NONCLIENTMETRICS ncm;
00578     ncm.cbSize = sizeof(ncm);
00579     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00580     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00581     m_pFont = &m_Font;
00582 }

Member Data Documentation

CCJCaptionButton CCJCaption::m_CaptionButton [protected]

Definition at line 162 of file CJCaption.h.

Referenced by Create, KillChildWindow, ModifyCaptionStyle, OnCaptButton, OnPushPinCancel, OnSize, SetChildWindow, and UpdateCaptionText.

COLORREF CCJCaption::m_clrBackgnd [protected]

Definition at line 149 of file CJCaption.h.

Referenced by CCJCaption, Create, DrawCaptionBack, ModifyCaptionStyle, SetCaptionColors, and UpdateCaptionBack.

COLORREF CCJCaption::m_clrBorder [protected]

Definition at line 148 of file CJCaption.h.

Referenced by CCJCaption, and SetCaptionColors.

COLORREF CCJCaption::m_clrBtnFace [protected]

Definition at line 147 of file CJCaption.h.

Referenced by CCJCaption, DrawCaptionBack, OnPaint, OnSysColorChange, and UpdateCaptionBack.

COLORREF CCJCaption::m_clrBtnHilite [protected]

Definition at line 145 of file CJCaption.h.

Referenced by CCJCaption, DrawCaptionBack, and OnSysColorChange.

COLORREF CCJCaption::m_clrBtnShadow [protected]

Definition at line 146 of file CJCaption.h.

Referenced by CCJCaption, DrawCaptionBack, and OnSysColorChange.

COLORREF CCJCaption::m_clrFont [protected]

Definition at line 150 of file CJCaption.h.

Referenced by CCJCaption, Create, DrawCaptionText, ModifyCaptionStyle, and SetCaptionColors.

int CCJCaption::m_cx [protected]

Definition at line 156 of file CJCaption.h.

Referenced by CCJCaption, DrawCaptionIcon, and DrawCaptionText.

int CCJCaption::m_cy [protected]

Definition at line 157 of file CJCaption.h.

Referenced by CCJCaption, and DrawCaptionIcon.

DWORD CCJCaption::m_dwExStyle [protected]

Definition at line 165 of file CJCaption.h.

Referenced by Create, and DrawCaptionBack.

DWORD CCJCaption::m_dwTextStyle [protected]

Definition at line 167 of file CJCaption.h.

Referenced by DrawCaptionText, and SetTextStyle.

CFont CCJCaption::m_Font [protected]

Definition at line 153 of file CJCaption.h.

Referenced by DrawCaptionText, UpdateFont, and ~CCJCaption.

HICON CCJCaption::m_hIcon [protected]

Definition at line 154 of file CJCaption.h.

Referenced by CCJCaption, DrawCaptionIcon, ModifyCaptionStyle, and UpdateCaption.

int CCJCaption::m_nBorder [protected]

Definition at line 151 of file CJCaption.h.

Referenced by CCJCaption, DrawCaptionBack, DrawCaptionIcon, DrawCaptionText, ModifyCaptionStyle, OnSize, UpdateCaptionBack, and UpdateCaptionText.

int CCJCaption::m_nOffset [protected]

Definition at line 158 of file CJCaption.h.

Referenced by OnPushPinButton, and SetChildWindow.

CWnd* CCJCaption::m_pChildWnd [protected]

Definition at line 160 of file CJCaption.h.

Referenced by CCJCaption, OnCaptButton, OnPushPinButton, and SetChildWindow.

CFont* CCJCaption::m_pFont [protected]

Definition at line 152 of file CJCaption.h.

Referenced by CCJCaption, Create, DrawCaptionText, ModifyCaptionStyle, OnSize, UpdateCaptionText, and UpdateFont.

CWnd* CCJCaption::m_pNotifyWnd [protected]

Definition at line 161 of file CJCaption.h.

Referenced by CCJCaption, OnPushPinButton, OnPushPinCancel, and SetChildWindow.

CCJCaptionPopupWnd* CCJCaption::m_pWndPopDown [protected]

Definition at line 163 of file CJCaption.h.

Referenced by CCJCaption, KillChildWindow, OnCaptButton, and OnPushPinCancel.

CRect CCJCaption::m_rcChild [protected]

Definition at line 164 of file CJCaption.h.

Referenced by OnCaptButton, OnPushPinButton, and SetChildWindow.

CRect CCJCaption::m_rcClient [protected]

Definition at line 166 of file CJCaption.h.

CString CCJCaption::m_strWindText [protected]

Definition at line 155 of file CJCaption.h.

Referenced by CCJCaption, Create, DrawCaptionText, ModifyCaptionStyle, OnSize, UpdateCaption, and UpdateCaptionText.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJCaption.h
  • WinCvs/CJLib/CJLibrary/CJCaption.cpp
Generated on Sun Feb 24 01:24:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJCaptionButton Class Reference

#include <CJCaption.h>

Inheritance diagram for CCJCaptionButton:

[legend]
Collaboration diagram for CCJCaptionButton:

[legend]
List of all members.

Public Methods

virtual BOOL | SetButtonStyle (CFont *pFont, COLORREF clrBackground, COLORREF clrFont)
virtual void | DrawButtonText (CDC *pDC, UINT nState, CRect &rcItem)

Protected Methods

afx_msg void | OnSysColorChange ()

Member Function Documentation

void CCJCaptionButton::DrawButtonText | ( | CDC * | pDC,
 |  | UINT | nState,
 |  | CRect & | rcItem
 | ) | [virtual]

Reimplemented from CCJFlatButton.

Definition at line 135 of file CJCaption.cpp.

References CCJFlatButton::m_clrTextNm, CCJFlatButton::m_Font, CCJFlatButton::m_pFont, NULL, and TRUE.

00136 {
00137     // Get the window text, return if empty.
00138     CString strWindowText; GetWindowText(strWindowText);
00139     if( strWindowText.IsEmpty( ))
00140         return;
00141
00142     if( m_pFont == NULL ) {
00143         m_pFont = &m_Font;
00144     }
00145
00146     CRect rc = rcItem;
00147     rc.DeflateRect( 5,0 );
00148
00149     // Set the text color and select the button font.
00150     pDC->SetTextColor(( nState & ODS_DISABLED )?m_clrTextGy:m_clrTextNm);
00151     CFont *oldFont = pDC->SelectObject( m_pFont );
00152
00153     // get the height of the text to be displayed.
00154     int cy = pDC->DrawText( strWindowText, -1, rc, DT_SINGLELINE|DT_CALCRECT );
00155     rc.top = (rcItem.Height()-cy)/2;
00156
00157     // draw the text, and select the original font.
00158     pDC->DrawState( rc.TopLeft(), strWindowText.GetLength(), strWindowText,
00159         ( nState & ODS_DISABLED )?DSS_DISABLED:DSS_NORMAL, TRUE, 0, (HBRUSH)NULL );
00160
00161     // Set up pen to use for drawing the triangle
00162     CPen pen(PS_SOLID, 1, m_clrTextNm);
00163     CPen *pOldPen = pDC->SelectObject( &pen );
00164
00165     // get the client rect.
00166     CRect rcWnd;
00167     GetClientRect(&rcWnd);
00168
00169     // initialize coordinates for triangle.
00170     int x1 = rcWnd.right-11;
00171     int x2 = rcWnd.right-6;
00172     int y1 = rcWnd.bottom-7;
00173     int y2 = rcWnd.bottom-5;
00174
00175     // draw the triangle.
00176     pDC->MoveTo( x1, y1 );
00177     pDC->LineTo( x2, y1 );
00178     pDC->MoveTo( x1+1, y1+1 );
00179     pDC->LineTo( x2-1, y1+1 );
00180     pDC->SetPixel( x1+2, y2, m_clrTextNm );
00181
00182     // restore old pen and font.
00183     pDC->SelectObject( oldFont );
00184     pDC->SelectObject( pOldPen );
00185
00186     // fix potential resource leak - KStowell - 10-21-99
00187     pen.DeleteObject();
00188 }

afx_msg void CCJCaptionButton::OnSysColorChange ( ) [protected]

Reimplemented from CCJFlatButton.

BOOL CCJCaptionButton::SetButtonStyle | ( | CFont * | pFont,
 |  | COLORREF | clrBackground,
 |  | COLORREF | clrFont
 | ) | [virtual]

Definition at line 128 of file CJCaption.cpp.

References CCJFlatButton::SetAlternateColors, and TRUE.

Referenced by CCJCaption::Create, and CCJCaption::ModifyCaptionStyle.

00129 {
00130     m_pFont = pFont;
00131     SetAlternateColors(clrBackground, m_clrHilite, m_clrDkShad, clrFont);
00132     return TRUE;
00133 }

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJCaption.h
  • WinCvs/CJLib/CJLibrary/CJCaption.cpp
Generated on Sun Feb 24 01:24:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJCaptionPopupWnd Class Reference

#include <CJCaptionPopupWnd.h>

Inheritance diagram for CCJCaptionPopupWnd:

[legend]
Collaboration diagram for CCJCaptionPopupWnd:

[legend]
List of all members.

Public Methods

CCJCaptionPopupWnd ()
virtual BOOL | Create (const CRect &rect, CWnd *pParentWnd, CWnd *pChildWnd)
virtual | ~CCJCaptionPopupWnd ()

Public Attributes

CWnd * m_pParentWnd
CWnd * m_pChildWnd
CWnd * m_pChildParent

Protected Methods

afx_msg void | OnDestroy ()
afx_msg void | OnCaptButton ()
afx_msg void | OnPaint ()
afx_msg void | OnTimer (UINT nIDEvent)

Protected Attributes

CCJCaption m_Caption
CCJFlatButton m_CaptionButton
HICON | m_hIconOn
HICON | m_hIconOff

Constructor & Destructor Documentation

CCJCaptionPopupWnd::CCJCaptionPopupWnd ( )

Definition at line 60 of file CJCaptionPopupWnd.cpp.

References m_hIconOff, m_hIconOn, m_pChildParent, m_pChildWnd, m_pParentWnd, and NULL.

00061 {
00062     m_pChildWnd     = NULL;
00063     m_pChildParent  = NULL;
00064     m_pParentWnd    = NULL;
00065     m_hIconOn       = NULL;
00066     m_hIconOff      = NULL;
00067 }

CCJCaptionPopupWnd::~CCJCaptionPopupWnd ( ) [virtual]

Definition at line 69 of file CJCaptionPopupWnd.cpp.

References _destroyIcon, m_hIconOff, and m_hIconOn.

00070 {
00071     // fix potential resource leak - KStowell - 10-22-99.
00072     _destroyIcon(m_hIconOn);
00073     _destroyIcon(m_hIconOff);
00074     DestroyWindow();
00075 }

Member Function Documentation

BOOL CCJCaptionPopupWnd::Create | ( | const CRect & | rect,
 |  | CWnd * | pParentWnd,
 |  | CWnd * | pChildWnd
 | ) | [virtual]

Definition at line 89 of file CJCaptionPopupWnd.cpp.

References ASSERT, CCJCaption::Create, FALSE, IDB_PUSHPIN, IDC_CAPT_BUTTON, m_Caption, m_CaptionButton, m_hIconOff, m_hIconOn, m_pChildParent, m_pChildWnd, m_pParentWnd, NULL, CCJFlatButton::SetIcon, TRUE, and WS_EX_FLATEDGE.

Referenced by CCJCaption::OnCaptButton.

00090 {
00091     ASSERT(pParentWnd != NULL); // must be valid.
00092     m_pParentWnd = pParentWnd;
00093
00094     ASSERT(pChildWnd  != NULL); // must be valid.
00095     m_pChildWnd = pChildWnd;
00096
00097     // register the wnd class.
00098     CString wndClass = ::AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW,
00099         0, ::GetSysColorBrush(COLOR_BTNFACE));
00100
00101     // define the styles for this window.
00102     DWORD dwStyleEx = WS_EX_TOOLWINDOW;
00103     DWORD dwStyle   = WS_VISIBLE|WS_POPUP|WS_DLGFRAME;
00104
00105     // call the base class for creation.
00106     if( !CWnd::CreateEx( dwStyleEx, wndClass, _T(""), dwStyle, rect.left, rect.top,
00107         rect.Width(), rect.Height(), pParentWnd->GetSafeHwnd(), 0, NULL ))
00108     {
00109         TRACE0( "Failed to create caption popdown window.\n" );
00110         return FALSE;
00111     }
00112
00113     // set the child windows parent to this popup window, save
00114     // the previous parent, since we need to reset this when the
00115     // window is destroyed.
00116     m_pChildParent = m_pChildWnd->SetParent(this);
00117     ASSERT(m_pChildParent != NULL);
00118
00119     // define the caption and client rect.
00120     CRect rcClient;
00121     GetClientRect(&rcClient);
00122     rcClient.DeflateRect(2,2);
00123     CRect rcCapt( rcClient );
00124
00125     // move the window to fit the client area of this window.
00126     rcClient.top += 19;
00127     m_pChildWnd->MoveWindow(rcClient);
00128
00129     // define the size for the push pin caption.
00130     rcCapt.bottom = rcCapt.top + 19;
00131
00132     // Create the caption.
00133     if( !m_Caption.Create( this, _T( "Click push pin to keep open" ), WS_EX_FLATEDGE,
00134         WS_VISIBLE|SS_CENTER|SS_CENTERIMAGE, rcCapt ))
00135     {
00136         TRACE0( "Unable to create caption.\n" );
00137         return FALSE;
00138     }
00139
00140     // define the size for the caption button.
00141     CRect rcButton( rcCapt );
00142     rcButton.DeflateRect(2,2);
00143     rcButton.left = rcButton.right - 16;
00144
00145     // Create the caption button.
00146     if( !m_CaptionButton.Create( NULL, WS_VISIBLE|BS_ICON|BS_OWNERDRAW|BS_CENTER|BS_VCENTER,
00147         rcButton, this, IDC_CAPT_BUTTON ))
00148     {
00149         TRACE0( "Unable to create caption button.\n" );
00150         return FALSE;
00151     }
00152
00153     CImageList imageList;
00154     imageList.Create(IDB_PUSHPIN, 16, 1, RGB(255,0,255));
00155
00156     // Associate the button icon
00157     m_hIconOff = imageList.ExtractIcon(0);
00158     m_hIconOn  = imageList.ExtractIcon(1);
00159     m_CaptionButton.SetIcon(m_hIconOff, m_hIconOn, CSize(16,15));
00160     imageList.DeleteImageList();
00161
00162     // start the timer after everything has been initialized.
00163     SetTimer(1, 10, NULL);
00164
00165     return TRUE;
00166 }

void CCJCaptionPopupWnd::OnCaptButton ( ) [protected]

Definition at line 175 of file CJCaptionPopupWnd.cpp.

References CM_ONPUSHPINBUTTON, and m_pParentWnd.

00176 {
00177     // send message to parent control that push pin button was pressed.
00178     m_pParentWnd->SendMessage(CM_ONPUSHPINBUTTON, 0, 0);
00179 }

void CCJCaptionPopupWnd::OnDestroy ( ) [protected]

Definition at line 168 of file CJCaptionPopupWnd.cpp.

References m_pChildParent, and m_pChildWnd.

00169 {
00170     // set the child window's parent back it's original parent.
00171     m_pChildWnd->SetParent(m_pChildParent);
00172     CWnd::OnDestroy();
00173 }

void CCJCaptionPopupWnd::OnPaint ( ) [protected]

Definition at line 181 of file CJCaptionPopupWnd.cpp.

00182 {
00183     CPaintDC dc(this); // device context for painting
00184
00185     CRect rc;
00186     GetClientRect(&rc);
00187     rc.DeflateRect(1,1);
00188
00189     // draw a border for the client area.
00190     dc.Draw3dRect( rc, ::GetSysColor(COLOR_BTNSHADOW),
00191         ::GetSysColor(COLOR_BTNHILIGHT));
00192 }

void CCJCaptionPopupWnd::OnTimer ( UINT nIDEvent ) [protected]

Definition at line 194 of file CJCaptionPopupWnd.cpp.

References CM_ONPUSHPINCANCEL, m_Caption, m_CaptionButton, m_pChildWnd, and m_pParentWnd.

00195 {
00196     UNUSED_ALWAYS( nIDEvent );
00197
00198     // get a handle to the window which currently
00199     // has the input focus...
00200     HWND hWnd_HasFocus      = GetFocus()->GetSafeHwnd();
00201
00202     // get a handle to the caption, caption button, child window
00203     // and popup window...
00204     HWND hWnd_Caption       = m_Caption.GetSafeHwnd();
00205     HWND hWnd_CaptionButton = m_CaptionButton.GetSafeHwnd();
00206     HWND hWnd_Popup         = GetSafeHwnd();
00207     HWND hWnd_PopupChild    = m_pChildWnd->GetSafeHwnd();
00208
00209     // check to see if the window that has input focus is part
00210     // of the caption popup window, if not, send a message
00211     // to the parent control.
00212     if(( hWnd_HasFocus != hWnd_Caption ) &&
00213        ( hWnd_HasFocus != hWnd_CaptionButton ) &&
00214        ( hWnd_HasFocus != hWnd_Popup ) &&
00215        ( hWnd_HasFocus != hWnd_PopupChild ))
00216     {
00217         // send message to parent control that our popup window
00218         // has lost input focus.
00219         m_pParentWnd->SendMessage(CM_ONPUSHPINCANCEL, 0, 0);
00220     }
00221 }

Member Data Documentation

CCJCaption CCJCaptionPopupWnd::m_Caption [protected]

Definition at line 75 of file CJCaptionPopupWnd.h.

Referenced by Create, and OnTimer.

CCJFlatButton CCJCaptionPopupWnd::m_CaptionButton [protected]

Definition at line 76 of file CJCaptionPopupWnd.h.

Referenced by Create, and OnTimer.

HICON CCJCaptionPopupWnd::m_hIconOff [protected]

Definition at line 78 of file CJCaptionPopupWnd.h.

Referenced by CCJCaptionPopupWnd, Create, and ~CCJCaptionPopupWnd.

HICON CCJCaptionPopupWnd::m_hIconOn [protected]

Definition at line 77 of file CJCaptionPopupWnd.h.

Referenced by CCJCaptionPopupWnd, Create, and ~CCJCaptionPopupWnd.

CWnd* CCJCaptionPopupWnd::m_pChildParent

Definition at line 73 of file CJCaptionPopupWnd.h.

Referenced by CCJCaptionPopupWnd, Create, and OnDestroy.

CWnd* CCJCaptionPopupWnd::m_pChildWnd

Definition at line 72 of file CJCaptionPopupWnd.h.

Referenced by CCJCaptionPopupWnd, Create, OnDestroy, and OnTimer.

CWnd* CCJCaptionPopupWnd::m_pParentWnd

Definition at line 71 of file CJCaptionPopupWnd.h.

Referenced by CCJCaptionPopupWnd, Create, OnCaptButton, and OnTimer.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJCaptionPopupWnd.h
  • WinCvs/CJLib/CJLibrary/CJCaptionPopupWnd.cpp
Generated on Sun Feb 24 01:24:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJCBarButton Class Reference

#include <CJControlBar.h>

Inheritance diagram for CCJCBarButton:

[legend]
Collaboration diagram for CCJCBarButton:

[legend]
List of all members.

Protected Methods

virtual void DrawButtonIcon (CDC *pDC, UINT nState, CRect &rcItem)

Member Function Documentation

void CCJCBarButton::DrawButtonIcon | ( | CDC * | pDC,
 |  | UINT | nState,
 |  | CRect & | rcItem
 | ) | [protected, virtual]

Reimplemented from CCJFlatButton.

Definition at line 215 of file CJControlBar.cpp.

References GetIcon, and NULL.

00216 {
00217     UNUSED_ALWAYS( rcItem );
00218
00219     // get the handle to the icon (if any) associated
00220     // with this button.
00221     HICON hIcon = GetIcon();
00222     if( hIcon == NULL ) {
00223         return;
00224     }
00225
00226     CRect rcWnd;
00227     GetWindowRect(&rcWnd);
00228
00229     int left   = (rcWnd.Width()-m_sizeIcon.cx)/2;
00230     int right  = left+m_sizeIcon.cx;
00231     int top    = (rcWnd.Height()-m_sizeIcon.cy)/2;
00232     int bottom = top+m_sizeIcon.cy;
00233
00234     // determine the size of the icon to be drawn.
00235     CRect rc(left,top,right,bottom);
00236
00237     // if the button is selected.
00238     if( nState & ODS_SELECTED )
00239     {
00240         if( m_hPushed ) {
00241             hIcon = m_hPushed;
00242         }
00243         else {
00244             rc.OffsetRect(1,1);
00245         }
00246     }
00247
00248     // draw the icon associated with this button.
00249     pDC->DrawState( rc.TopLeft(), rc.Size(), hIcon, DSS_NORMAL, (HBRUSH)NULL );
00250 }

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJControlBar.h
  • WinCvs/CJLib/CJLibrary/CJControlBar.cpp
Generated on Sun Feb 24 01:24:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJColorPicker Class Reference

#include <CJColorPicker.h>

Inheritance diagram for CCJColorPicker:

[legend]
Collaboration diagram for CCJColorPicker:

[legend]
List of all members.

Public Methods

CCJColorPicker ()
DECLARE_DYNCREATE (CCJColorPicker)
virtual COLORREF | GetColor ()
virtual void | SetColor (COLORREF crColor)
virtual void | SetDefaultText (LPCTSTR szDefaultText)
virtual void | SetCustomText (LPCTSTR szCustomText)
virtual void | SetTrackSelection (BOOL bTracking=TRUE)
virtual BOOL | GetTrackSelection ()
virtual void | SetSelectionMode (UINT nMode)
virtual UINT | GetSelectionMode ()
virtual void | SetBkColor (COLORREF crColorBk)
virtual COLORREF | GetBkColor ()
virtual void | SetTextColor (COLORREF crColorText)
virtual COLORREF | GetTextColor ()
virtual void | CheckTextColor (COLORREF crColor)
virtual void | DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct)
virtual | ~CCJColorPicker ()

Protected Methods

virtual void | PreSubclassWindow ()
void | SetWindowSize ()
afx_msg BOOL | OnClicked ()
afx_msg int | OnCreate (LPCREATESTRUCT lpCreateStruct)
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)
afx_msg void | OnPaint ()
afx_msg LONG | OnSelEndOK (UINT lParam, LONG wParam)
afx_msg LONG | OnSelEndCancel (UINT lParam, LONG wParam)
afx_msg LONG | OnSelChange (UINT lParam, LONG wParam)

Protected Attributes

BOOL | m_bActive
BOOL | m_bTrackSelection
COLORREF | m_crColorBk
COLORREF | m_crColorText
UINT | m_nSelectionMode
CRect | m_ArrowRect
CString | m_strDefaultText
CString | m_strCustomText
bool | m_bLBtnDown
CWnd * m_pParentWnd

Constructor & Destructor Documentation

CCJColorPicker::CCJColorPicker ( )

Definition at line 99 of file CJColorPicker.cpp.

References CP_MODE_BK, FALSE, IDS_COLOR_AUTO, IDS_COLOR_CUST, m_bActive, m_bTrackSelection, m_nSelectionMode, m_pParentWnd, m_strCustomText, m_strDefaultText, NULL, SetBkColor, and SetTextColor.

00100 {
00101     SetBkColor(GetSysColor(COLOR_3DFACE));
00102     SetTextColor(GetSysColor(COLOR_BTNTEXT));
00103
00104     m_bTrackSelection = FALSE;
00105     m_nSelectionMode = CP_MODE_BK;
00106     m_bActive = FALSE;
00107
00108 // 1999-06-11 begin mods KStowell
00109     m_strDefaultText.LoadString( IDS_COLOR_AUTO );
00110     m_strCustomText.LoadString( IDS_COLOR_CUST );
00111 // 1999-06-11 end mods KStowell
00112
00113 // 10-14-1999 - Kirk Stowell
00114     m_pParentWnd = NULL;
00115 }

CCJColorPicker::~CCJColorPicker ( ) [virtual]

Definition at line 117 of file CJColorPicker.cpp.

00118 {
00119 }

Member Function Documentation

void CCJColorPicker::CheckTextColor ( COLORREF crColor ) [virtual]

Definition at line 420 of file CJColorPicker.cpp.

References SetTextColor.

Referenced by OnSelChange, OnSelEndCancel, OnSelEndOK, and SetBkColor.

00421 {
00422     int R = GetRValue(crColor);
00423     int G = GetGValue(crColor);
00424     int B = GetBValue(crColor);
00425
00426     double Intensity = .299 * R + .587 * G + .114 * B ;
00427
00428     if ( Intensity >= 127 ) {
00429         SetTextColor(RGB(0,0,0));
00430     } else {
00431         SetTextColor(RGB(255,255,255));
00432     }
00433 }

CCJColorPicker::DECLARE_DYNCREATE ( CCJColorPicker )

void CCJColorPicker::DrawItem ( LPDRAWITEMSTRUCT lpDrawItemStruct ) [virtual]

Definition at line 230 of file CJColorPicker.cpp.

References ASSERT, m_bActive, m_crColorBk, m_crColorText, NULL, and TRUE.

00231 {
00232     ASSERT(lpDrawItemStruct != NULL);
00233
00234     // define some temporary variables.
00235     CDC*    pDC         = CDC::FromHandle( lpDrawItemStruct->hDC );
00236     CRect   rcItem      = lpDrawItemStruct->rcItem;
00237     int     nState      = lpDrawItemStruct->itemState;
00238     DWORD   dwState     = EDGE_RAISED;
00239     DWORD   dwArrow     = DFCS_SCROLLDOWN;
00240
00241     // Paint the background.
00242     pDC->FillSolidRect(rcItem, ::GetSysColor(COLOR_3DFACE));
00243
00244     // set display flags based on state.
00245     if((nState & ODS_SELECTED) || (m_bActive == TRUE)) {
00246         dwState = EDGE_SUNKEN;
00247         dwArrow = DFCS_SCROLLDOWN|DFCS_PUSHED;
00248     }
00249     if(nState & ODS_DISABLED) {
00250         dwArrow = DFCS_SCROLLDOWN|DFCS_INACTIVE;
00251     }
00252
00253     // Draw the drop arrow.
00254     CRect rcArrow( rcItem );
00255     rcArrow.left = rcArrow.Width()-::GetSystemMetrics( SM_CXHTHUMB );
00256     pDC->DrawFrameControl( &rcArrow, DFC_SCROLL, dwArrow );
00257     pDC->Draw3dRect( rcArrow, ::GetSysColor( COLOR_3DFACE ), ::GetSysColor( COLOR_3DFACE ));
00258     rcArrow.DeflateRect( 1,1 );
00259     pDC->Draw3dRect( rcArrow, ::GetSysColor( COLOR_3DFACE ), ::GetSysColor( COLOR_3DFACE ));
00260
00261     if((nState & ODS_SELECTED) || (m_bActive == TRUE))
00262         rcArrow.OffsetRect( 1,1 );
00263
00264     // draw the seperator line.
00265     CPen penShadow( PS_SOLID, 1, ::GetSysColor( COLOR_3DSHADOW  ));
00266     CPen* pOldPen = pDC->SelectObject( &penShadow );
00267     pDC->MoveTo( rcArrow.left-1, rcArrow.top+2 );
00268     pDC->LineTo( rcArrow.left-1, rcArrow.bottom-2 );
00269
00270     CPen penHilite( PS_SOLID, 1, ::GetSysColor( COLOR_3DHILIGHT ));
00271     pDC->SelectObject( &penHilite );
00272     pDC->MoveTo( rcArrow.left, rcArrow.top+2 );
00273     pDC->LineTo( rcArrow.left, rcArrow.bottom-2 );
00274
00275     // draw the control border.
00276     pDC->DrawEdge( rcItem, dwState, BF_RECT );
00277
00278     // draw the focus rect.
00279     rcItem.DeflateRect( 2, 2 );
00280     pDC->Draw3dRect( rcItem, ::GetSysColor( COLOR_3DFACE ), ::GetSysColor( COLOR_3DFACE ) );
00281     if( nState & ODS_FOCUS ) {
00282         pDC->DrawFocusRect( rcItem );
00283     }
00284
00285     // draw the color box.
00286     if((nState & ODS_SELECTED) || (m_bActive == TRUE))
00287         rcItem.OffsetRect( 1,1 );
00288
00289     rcItem.DeflateRect( 2, 2 );
00290     rcItem.right = rcArrow.left-4;
00291
00292     CBrush brush( ((nState & ODS_DISABLED) || m_crColorBk == CLR_DEFAULT)?
00293         ::GetSysColor(COLOR_3DFACE) : m_crColorBk);
00294     CBrush* pOldBrush = (CBrush*)pDC->SelectObject( &brush );
00295     pDC->SelectStockObject(( nState & ODS_DISABLED )?WHITE_PEN:BLACK_PEN );
00296     pDC->Rectangle( rcItem );
00297
00298     // Draw the window text (if any)
00299     CString strText;
00300     GetWindowText(strText);
00301     if (strText.GetLength())
00302     {
00303         pDC->SetBkMode(TRANSPARENT);
00304         if (nState & ODS_DISABLED)
00305         {
00306             rcItem.OffsetRect(1,1);
00307             pDC->SetTextColor(::GetSysColor(COLOR_3DHILIGHT));
00308             pDC->DrawText(strText, rcItem, DT_CENTER|DT_SINGLELINE|DT_VCENTER);
00309             rcItem.OffsetRect(-1,-1);
00310             pDC->SetTextColor(::GetSysColor(COLOR_3DSHADOW));
00311             pDC->DrawText(strText, rcItem, DT_CENTER|DT_SINGLELINE|DT_VCENTER);
00312         }
00313         else
00314         {
00315             pDC->SetTextColor((m_crColorText == CLR_DEFAULT)? 0 : m_crColorText);
00316             pDC->DrawText(strText, rcItem, DT_CENTER|DT_SINGLELINE|DT_VCENTER);
00317         }
00318     }
00319
00320     // fix potential resource leak - KStowell - 10-21-99
00321     pDC->SelectObject( pOldPen );
00322     pDC->SelectObject( pOldBrush );
00323     brush.DeleteObject();
00324     penHilite.DeleteObject();
00325     penHilite.DeleteObject();
00326 }

virtual COLORREF CCJColorPicker::GetBkColor ( ) [inline, virtual]

Definition at line 97 of file CJColorPicker.h.

Referenced by GetColor.

00097 { return m_crColorBk; }

COLORREF CCJColorPicker::GetColor ( ) [virtual]

Definition at line 342 of file CJColorPicker.cpp.

References CP_MODE_TEXT, GetBkColor, GetTextColor, and m_nSelectionMode.

Referenced by DDX_CJColorPicker, OnClicked, and OnSelEndOK.

00343 {
00344     return (m_nSelectionMode == CP_MODE_TEXT)?
00345         GetTextColor(): GetBkColor();
00346 }

virtual UINT CCJColorPicker::GetSelectionMode ( ) [inline, virtual]

Definition at line 94 of file CJColorPicker.h.

00094 { return m_nSelectionMode; };

virtual COLORREF CCJColorPicker::GetTextColor ( ) [inline, virtual]

Definition at line 100 of file CJColorPicker.h.

Referenced by GetColor.

00100 { return m_crColorText;}

virtual BOOL CCJColorPicker::GetTrackSelection ( ) [inline, virtual]

Definition at line 91 of file CJColorPicker.h.

00091 { return m_bTrackSelection; }

BOOL CCJColorPicker::OnClicked ( ) [protected]

Definition at line 206 of file CJColorPicker.cpp.

References CPN_DROPDOWN, GetColor, m_bActive, m_pParentWnd, m_strCustomText, m_strDefaultText, and TRUE.

00207 {
00208     m_bActive = TRUE;
00209
00210     CRect rect;
00211     GetWindowRect(rect);
00212     new CCJColorPopup(CPoint(rect.left, rect.bottom),    // Point to display popup
00213                      GetColor(),                       // Selected Color
00214                      this,                              // parent
00215                      m_strDefaultText,                  // "Default" text area
00216                      m_strCustomText);                  // Custom Text
00217
00218     // 10-14-1999 - Kirk Stowell - Removed redundant calls to GetParent().
00219     if (m_pParentWnd) {
00220         m_pParentWnd->SendMessage(CPN_DROPDOWN, (LPARAM)GetColor(), (WPARAM) GetDlgCtrlID());
00221     }
00222
00223     // Docs say I should return FALSE to stop the parent also getting the message.
00224     // HA! What a joke.
00225
00226     return TRUE;
00227 }

int CCJColorPicker::OnCreate ( LPCREATESTRUCT lpCreateStruct ) [protected]

Definition at line 196 of file CJColorPicker.cpp.

References SetWindowSize.

00197 {
00198     if (CButton::OnCreate(lpCreateStruct) == -1)
00199         return -1;
00200
00201     SetWindowSize();    // resize appropriately
00202     return 0;
00203 }

BOOL CCJColorPicker::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 435 of file CJColorPicker.cpp.

References TRUE.

00436 {
00437     // overridden for flicker-free drawing.
00438     UNUSED_ALWAYS(pDC);
00439     return TRUE;
00440 }

void CCJColorPicker::OnPaint ( ) [protected]

Definition at line 442 of file CJColorPicker.cpp.

00443 {
00444     CPaintDC dc(this); // device context for painting
00445
00446     // KStowell - Get the client rect.
00447     CRect rcClient, rcClip;
00448     dc.GetClipBox( &rcClip );
00449     GetClientRect( &rcClient );
00450
00451     // KStowell - Create a memory device-context. This is done to help reduce
00452     // screen flicker, since we will paint the entire control to the
00453     // off screen device context first.
00454     CDC memDC;
00455     CBitmap bitmap;
00456     memDC.CreateCompatibleDC(&dc);
00457     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00458     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00459
00460     // KStowell - Repaint the background.
00461     memDC.FillSolidRect( rcClient, ::GetSysColor(COLOR_WINDOW) );
00462
00463     // let the control do its default drawing.
00464     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00465
00466     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00467     dc.BitBlt( rcClip.left, rcClip.top, rcClip.Width(), rcClip.Height(), &memDC,
00468         rcClip.left, rcClip.top, SRCCOPY );
00469
00470     // KStowell - Cleanup resources.
00471     memDC.SelectObject(pOldBitmap);
00472     memDC.DeleteDC();
00473     bitmap.DeleteObject();
00474 }

LONG CCJColorPicker::OnSelChange | ( | UINT | lParam,
 |  | LONG | wParam
 | ) | [protected]

Definition at line 179 of file CJColorPicker.cpp.

References CheckTextColor, CPN_SELCHANGE, m_pParentWnd, SetColor, and TRUE.

00180 {
00181     if (m_bTrackSelection) {
00182         SetColor((COLORREF) lParam);
00183         //BEGIN SRO
00184         CheckTextColor((COLORREF) lParam);
00185         //END SRO
00186     }
00187
00188     // 10-14-1999 - Kirk Stowell - Removed redundant calls to GetParent().
00189     if (m_pParentWnd) {
00190         m_pParentWnd->SendMessage(CPN_SELCHANGE, lParam, (WPARAM) GetDlgCtrlID());
00191     }
00192
00193     return TRUE;
00194 }

LONG CCJColorPicker::OnSelEndCancel | ( | UINT | lParam,
 |  | LONG | wParam
 | ) | [protected]

Definition at line 162 of file CJColorPicker.cpp.

References CheckTextColor, CPN_CLOSEUP, CPN_SELENDCANCEL, FALSE, m_bActive, m_pParentWnd, SetColor, and TRUE.

00163 {
00164     m_bActive = FALSE;
00165     SetColor((COLORREF) lParam);
00166     //BEGIN SRO
00167     CheckTextColor((COLORREF) lParam);
00168     //END SRO
00169
00170     // 10-14-1999 - Kirk Stowell - Removed redundant calls to GetParent().
00171     if (m_pParentWnd) {
00172         m_pParentWnd->SendMessage(CPN_CLOSEUP, lParam, (WPARAM) GetDlgCtrlID());
00173         m_pParentWnd->SendMessage(CPN_SELENDCANCEL, lParam, (WPARAM) GetDlgCtrlID());
00174     }
00175
00176     return TRUE;
00177 }

LONG CCJColorPicker::OnSelEndOK | ( | UINT | lParam,
 |  | LONG | wParam
 | ) | [protected]

Definition at line 138 of file CJColorPicker.cpp.

References CheckTextColor, CPN_CLOSEUP, CPN_SELCHANGE, CPN_SELENDOK, FALSE, GetColor, m_bActive, m_pParentWnd, SetColor, and TRUE.

00139 {
00140     COLORREF crNewColor = (COLORREF) lParam;
00141     m_bActive = FALSE;
00142     SetColor(crNewColor);
00143     //BEGIN SRO
00144     CheckTextColor(crNewColor);
00145     //END SRO
00146
00147     // 10-14-1999 - Kirk Stowell - Removed redundant calls to GetParent().
00148     if (m_pParentWnd) {
00149         m_pParentWnd->SendMessage(CPN_CLOSEUP, lParam, (WPARAM) GetDlgCtrlID());
00150         m_pParentWnd->SendMessage(CPN_SELENDOK, lParam, (WPARAM) GetDlgCtrlID());
00151     }
00152
00153     if (crNewColor != GetColor()) {
00154         if (m_pParentWnd) {
00155             m_pParentWnd->SendMessage(CPN_SELCHANGE, lParam, (WPARAM) GetDlgCtrlID());
00156         }
00157     }
00158
00159     return TRUE;
00160 }

void CCJColorPicker::PreSubclassWindow ( ) [protected, virtual]

Definition at line 332 of file CJColorPicker.cpp.

References SetWindowSize.

00333 {
00334     ModifyStyle(0, BS_OWNERDRAW);        // Make it owner drawn
00335     CButton::PreSubclassWindow();
00336     SetWindowSize();                     // resize appropriately
00337 }

void CCJColorPicker::SetBkColor ( COLORREF crColorBk ) [virtual]

Definition at line 354 of file CJColorPicker.cpp.

References CheckTextColor, and m_crColorBk.

Referenced by CCJColorPicker, and SetColor.

00355 {
00356     m_crColorBk = crColorBk;
00357
00358     //BEGIN SRO
00359     CheckTextColor(crColorBk);
00360     //END SRO
00361
00362     if (IsWindow(m_hWnd)) RedrawWindow();
00363 }

void CCJColorPicker::SetColor ( COLORREF crColor ) [virtual]

Definition at line 348 of file CJColorPicker.cpp.

References CP_MODE_TEXT, m_nSelectionMode, SetBkColor, and SetTextColor.

Referenced by DDX_CJColorPicker, OnSelChange, OnSelEndCancel, and OnSelEndOK.

00349 {
00350     (m_nSelectionMode == CP_MODE_TEXT)?
00351         SetTextColor(crColor): SetBkColor(crColor);
00352 }

void CCJColorPicker::SetCustomText ( LPCTSTR szCustomText ) [virtual]

Definition at line 376 of file CJColorPicker.cpp.

References m_strCustomText.

00377 {
00378     m_strCustomText = (szCustomText)? szCustomText : _T("");
00379 }

void CCJColorPicker::SetDefaultText ( LPCTSTR szDefaultText ) [virtual]

Definition at line 371 of file CJColorPicker.cpp.

References m_strDefaultText.

00372 {
00373     m_strDefaultText = (szDefaultText)? szDefaultText : _T("");
00374 }

virtual void CCJColorPicker::SetSelectionMode ( UINT nMode ) [inline, virtual]

Definition at line 93 of file CJColorPicker.h.

00093 { m_nSelectionMode = nMode; }

void CCJColorPicker::SetTextColor ( COLORREF crColorText ) [virtual]

Definition at line 365 of file CJColorPicker.cpp.

References m_crColorText.

Referenced by CCJColorPicker, CheckTextColor, and SetColor.

00366 {
00367     m_crColorText = crColorText;
00368     if (IsWindow(m_hWnd)) RedrawWindow();
00369 }

virtual void CCJColorPicker::SetTrackSelection ( BOOL bTracking = TRUE ) [inline, virtual]

Definition at line 90 of file CJColorPicker.h.

References TRUE.

00090 { m_bTrackSelection = bTracking; }

void CCJColorPicker::SetWindowSize ( ) [protected]

Definition at line 384 of file CJColorPicker.cpp.

References m_ArrowRect, m_pParentWnd, and TRUE.

Referenced by OnCreate, and PreSubclassWindow.

00385 {
00386     // 10-14-1999 - Kirk Stowell - Added to help reduce flicker, we only need to make
00387     // a call to GetParent() once at initialization.
00388     m_pParentWnd = GetParent();
00389
00390     // Get size dimensions of edges
00391     CSize MarginSize(::GetSystemMetrics(SM_CXEDGE), ::GetSystemMetrics(SM_CYEDGE));
00392
00393     // Get size of dropdown arrow
00394     int nArrowWidth = max(::GetSystemMetrics(SM_CXHTHUMB), 5*MarginSize.cx);
00395     int nArrowHeight = max(::GetSystemMetrics(SM_CYVTHUMB), 5*MarginSize.cy);
00396     CSize ArrowSize(max(nArrowWidth, nArrowHeight), max(nArrowWidth, nArrowHeight));
00397
00398     // Get window size
00399     CRect rect;
00400     GetWindowRect(rect);
00401
00402     if (m_pParentWnd) {
00403         m_pParentWnd->ScreenToClient(rect);
00404     }
00405
00406     // Set window size at least as wide as 2 arrows, and as high as arrow + margins
00407     int nWidth = max(rect.Width(), 2*ArrowSize.cx + 2*MarginSize.cx);
00408     MoveWindow(rect.left, rect.top, nWidth, ArrowSize.cy+2*MarginSize.cy, TRUE);
00409
00410     // Get the new coords of this window
00411     GetWindowRect(rect);
00412     ScreenToClient(rect);
00413
00414     // Get the rect where the arrow goes, and convert to client coords.
00415     m_ArrowRect.SetRect(rect.right - ArrowSize.cx - MarginSize.cx,
00416                         rect.top + MarginSize.cy, rect.right - MarginSize.cx,
00417                         rect.bottom - MarginSize.cy);
00418 }

Member Data Documentation

CRect CCJColorPicker::m_ArrowRect [protected]

Definition at line 130 of file CJColorPicker.h.

Referenced by SetWindowSize.

BOOL CCJColorPicker::m_bActive [protected]

Definition at line 125 of file CJColorPicker.h.

Referenced by CCJColorPicker, DrawItem, OnClicked, OnSelEndCancel, and OnSelEndOK.

bool CCJColorPicker::m_bLBtnDown [protected]

Definition at line 133 of file CJColorPicker.h.

BOOL CCJColorPicker::m_bTrackSelection [protected]

Definition at line 125 of file CJColorPicker.h.

Referenced by CCJColorPicker.

COLORREF CCJColorPicker::m_crColorBk [protected]

Definition at line 127 of file CJColorPicker.h.

Referenced by DrawItem, and SetBkColor.

COLORREF CCJColorPicker::m_crColorText [protected]

Definition at line 128 of file CJColorPicker.h.

Referenced by DrawItem, and SetTextColor.

UINT CCJColorPicker::m_nSelectionMode [protected]

Definition at line 129 of file CJColorPicker.h.

Referenced by CCJColorPicker, GetColor, and SetColor.

CWnd* CCJColorPicker::m_pParentWnd [protected]

Definition at line 134 of file CJColorPicker.h.

Referenced by CCJColorPicker, OnClicked, OnSelChange, OnSelEndCancel, OnSelEndOK, and SetWindowSize.

CString CCJColorPicker::m_strCustomText [protected]

Definition at line 132 of file CJColorPicker.h.

Referenced by CCJColorPicker, OnClicked, and SetCustomText.

CString CCJColorPicker::m_strDefaultText [protected]

Definition at line 131 of file CJColorPicker.h.

Referenced by CCJColorPicker, OnClicked, and SetDefaultText.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJColorPicker.h
  • WinCvs/CJLib/CJLibrary/CJColorPicker.cpp
Generated on Sun Feb 24 01:24:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJColorPopup Class Reference

#include <CJColorPopup.h>

Inheritance diagram for CCJColorPopup:

[legend]
Collaboration diagram for CCJColorPopup:

[legend]
List of all members.

Public Methods

CCJColorPopup ()
CCJColorPopup (CPoint p, COLORREF crColor, CWnd *pParentWnd, LPCTSTR szDefaultText=NULL, LPCTSTR szCustomText=NULL)
virtual void | Initialise ()
virtual BOOL | Create (CPoint p, COLORREF crColor, CWnd *pParentWnd, LPCTSTR szDefaultText=NULL, LPCTSTR szCustomText=NULL)
virtual BOOL | PreTranslateMessage (MSG *pMsg)
virtual void | UpdateFont ()
virtual | ~CCJColorPopup ()

Protected Methods

virtual BOOL | GetCellRect (int nIndex, const LPRECT &rect)
virtual void | FindCellFromColor (COLORREF crColor)
virtual void | SetWindowSize ()
virtual void | CreateToolTips ()
virtual void | ChangeSelection (int nIndex)
virtual void | EndSelection (int nMessage)
virtual void | DrawCell (CDC *pDC, int nIndex)
virtual COLORREF | GetColor (int nIndex)
virtual LPCTSTR | GetColorName (int nIndex)
virtual int | GetIndex (int row, int col) const
virtual int | GetRow (int nIndex) const
virtual int | GetColumn (int nIndex) const
afx_msg void | OnNcDestroy ()
afx_msg void | OnLButtonUp (UINT nFlags, CPoint point)
afx_msg void | OnPaint ()
afx_msg void | OnMouseMove (UINT nFlags, CPoint point)
afx_msg void | OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags)
afx_msg BOOL | OnQueryNewPalette ()
afx_msg void | OnPaletteChanged (CWnd *pFocusWnd)
afx_msg void | OnKillFocus (CWnd *pNewWnd)
afx_msg void | OnActivateApp (BOOL bActive, HTASK hTask)
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)

Protected Attributes

int | m_nNumColors
int | m_nNumColumns
int | m_nNumRows
int | m_nBoxSize
int | m_nMargin
int | m_nCurrentSel
int | m_nChosenColorSel
CString | m_strDefaultText
CString | m_strCustomText
CRect | m_CustomTextRect
CRect | m_DefaultTextRect
CRect | m_WindowRect
CFont | m_Font
CPalette | m_Palette
COLORREF | m_crInitialColor
COLORREF | m_crColor
CToolTipCtrl | m_ToolTip
CWnd * m_pParent

Static Protected Attributes

ColorTableEntry m_crColors []

Constructor & Destructor Documentation

CCJColorPopup::CCJColorPopup ( )

Definition at line 133 of file CJColorPopup.cpp.

References Initialise.

00134 {
00135     Initialise();
00136 }

CCJColorPopup::CCJColorPopup | ( | CPoint | p,
 |  | COLORREF | crColor,
 |  | CWnd * | pParentWnd,
 |  | LPCTSTR | szDefaultText = NULL,
 |  | LPCTSTR | szCustomText = NULL
 | ) |

Definition at line 138 of file CJColorPopup.cpp.

References Create, IDS_COLOR_AUTO, IDS_COLOR_CUST, Initialise, m_crColor, m_crInitialColor, m_pParent, m_strCustomText, m_strDefaultText, and NULL.

00141 {
00142     Initialise();
00143
00144     m_crColor       = m_crInitialColor = crColor;
00145     m_pParent        = pParentWnd;
00146
00147 // 1999-06-11 begin mods KStowell
00148     if( szDefaultText == NULL )
00149         m_strDefaultText.LoadString( IDS_COLOR_AUTO );
00150     else
00151         m_strDefaultText = szDefaultText;
00152
00153     if( szCustomText == NULL )
00154         m_strCustomText.LoadString( IDS_COLOR_CUST );
00155     else
00156         m_strCustomText = szCustomText;
00157 // 1999-06-11 end mods KStowell
00158
00159     CCJColorPopup::Create(p, crColor, pParentWnd, szDefaultText, szCustomText);
00160 }

CCJColorPopup::~CCJColorPopup ( ) [virtual]

Definition at line 202 of file CJColorPopup.cpp.

References m_Font, and m_Palette.

00203 {
00204     m_Font.DeleteObject();
00205     m_Palette.DeleteObject();
00206 }

Member Function Documentation

void CCJColorPopup::ChangeSelection ( int nIndex ) [protected, virtual]

Definition at line 743 of file CJColorPopup.cpp.

References CPN_SELCHANGE, CUSTOM_BOX_VALUE, DEFAULT_BOX_VALUE, DrawCell, GetColor, INVALID_Color, m_crColor, m_crInitialColor, m_nCurrentSel, m_nNumColors, and m_pParent.

Referenced by OnKeyDown, and OnMouseMove.

00744 {
00745     CClientDC dc(this);        // device context for drawing
00746
00747     if (nIndex > m_nNumColors)
00748         nIndex = CUSTOM_BOX_VALUE;
00749
00750     if ((m_nCurrentSel >= 0 && m_nCurrentSel < m_nNumColors) ||
00751         m_nCurrentSel == CUSTOM_BOX_VALUE || m_nCurrentSel == DEFAULT_BOX_VALUE)
00752     {
00753         // Set Current selection as invalid and redraw old selection (this way
00754         // the old selection will be drawn unselected)
00755         int OldSel = m_nCurrentSel;
00756         m_nCurrentSel = INVALID_Color;
00757         DrawCell(&dc, OldSel);
00758     }
00759
00760     // Set the current selection as row/col and draw (it will be drawn selected)
00761     m_nCurrentSel = nIndex;
00762     DrawCell(&dc, m_nCurrentSel);
00763
00764     // Store the current Color
00765     if (m_nCurrentSel == CUSTOM_BOX_VALUE)
00766         m_pParent->SendMessage(CPN_SELCHANGE, (WPARAM) m_crInitialColor, 0);
00767     else if (m_nCurrentSel == DEFAULT_BOX_VALUE)
00768     {
00769         m_crColor = CLR_DEFAULT;
00770         m_pParent->SendMessage(CPN_SELCHANGE, (WPARAM) CLR_DEFAULT, 0);
00771     }
00772     else
00773     {
00774         m_crColor = GetColor(m_nCurrentSel);
00775         m_pParent->SendMessage(CPN_SELCHANGE, (WPARAM) m_crColor, 0);
00776     }
00777 }

BOOL CCJColorPopup::Create | ( | CPoint | p,
 |  | COLORREF | crColor,
 |  | CWnd * | pParentWnd,
 |  | LPCTSTR | szDefaultText = NULL,
 |  | LPCTSTR | szCustomText = NULL
 | ) | [virtual]

Definition at line 208 of file CJColorPopup.cpp.

References ASSERT, CreateToolTips, FALSE, FindCellFromColor, m_crColor, m_crInitialColor, m_pParent, m_strCustomText, m_strDefaultText, NULL, SetWindowSize, TRUE, and UpdateFont.

Referenced by CCJColorPopup.

00211 {
00212     ASSERT(pParentWnd && ::IsWindow(pParentWnd->GetSafeHwnd()));
00213     ASSERT(pParentWnd->IsKindOf(RUNTIME_CLASS(CCJColorPicker)));
00214
00215     m_pParent  = pParentWnd;
00216     m_crColor = m_crInitialColor = crColor;
00217
00218     // Get the class name and create the window
00219     CString szClassName = AfxRegisterWndClass(CS_CLASSDC|CS_SAVEBITS|CS_HREDRAW|CS_VREDRAW,
00220                                               0,
00221                                               (HBRUSH) (COLOR_BTNFACE+1),
00222                                               0);
00223
00224     if (!CWnd::CreateEx(0, szClassName, _T(""), WS_VISIBLE|WS_POPUP,
00225                         p.x, p.y, 100, 100, // size updated soon
00226                         pParentWnd->GetSafeHwnd(), 0, NULL))
00227         return FALSE;
00228
00229     UpdateFont();
00230
00231     // Store the Custom text
00232     if (szCustomText != NULL)
00233         m_strCustomText = szCustomText;
00234
00235     // Store the Default Area text
00236     if (szDefaultText != NULL)
00237         m_strDefaultText = szDefaultText;
00238
00239     // Set the window size
00240     SetWindowSize();
00241
00242     // Create the tooltips
00243     CreateToolTips();
00244
00245     // Find which cell (if any) corresponds to the initial Color
00246     FindCellFromColor(crColor);
00247
00248     // Capture all mouse events for the life of this window
00249     SetCapture();
00250
00251     return TRUE;
00252 }

void CCJColorPopup::CreateToolTips ( ) [protected, virtual]

Definition at line 729 of file CJColorPopup.cpp.

References GetCellRect, GetColorName, m_nNumColors, and m_ToolTip.

Referenced by Create.

00730 {
00731     // Create the tool tip
00732     if (!m_ToolTip.Create(this)) return;
00733
00734     // Add a tool for each cell
00735     for (int i = 0; i < m_nNumColors; i++)
00736     {
00737         CRect rect;
00738         if (!GetCellRect(i, rect)) continue;
00739             m_ToolTip.AddTool(this, GetColorName(i), rect, 1);
00740     }
00741 }

void CCJColorPopup::DrawCell | ( | CDC * | pDC,
 |  | int | nIndex
 | ) | [protected, virtual]

Definition at line 802 of file CJColorPopup.cpp.

References CUSTOM_BOX_VALUE, DEFAULT_BOX_VALUE, FALSE, GetCellRect, GetColor, m_CustomTextRect, m_DefaultTextRect, m_Font, m_nChosenColorSel, m_nCurrentSel, m_nMargin, m_Palette, m_strCustomText, m_strDefaultText, and NULL.

Referenced by ChangeSelection, and OnPaint.

00803 {
00804     // For the Custom Text area
00805     if (m_strCustomText.GetLength() && nIndex == CUSTOM_BOX_VALUE)
00806     {
00807         // The extent of the actual text button
00808         CRect TextButtonRect = m_CustomTextRect;
00809         TextButtonRect.top += 2*m_nMargin;
00810
00811         // Fill background
00812         pDC->FillSolidRect(TextButtonRect, ::GetSysColor(COLOR_3DFACE));
00813
00814         // Draw horizontal line
00815         pDC->FillSolidRect(m_CustomTextRect.left+2*m_nMargin, m_CustomTextRect.top,
00816                            m_CustomTextRect.Width()-4*m_nMargin, 1, ::GetSysColor(COLOR_3DSHADOW));
00817         pDC->FillSolidRect(m_CustomTextRect.left+2*m_nMargin, m_CustomTextRect.top+1,
00818                            m_CustomTextRect.Width()-4*m_nMargin, 1, ::GetSysColor(COLOR_3DHILIGHT));
00819
00820         TextButtonRect.DeflateRect(1,1);
00821
00822         // fill background
00823         if (m_nChosenColorSel == nIndex && m_nCurrentSel != nIndex)
00824             pDC->FillSolidRect(TextButtonRect, ::GetSysColor(COLOR_3DLIGHT));
00825         else
00826             pDC->FillSolidRect(TextButtonRect, ::GetSysColor(COLOR_3DFACE));
00827
00828         // Draw button
00829         if (m_nCurrentSel == nIndex)
00830             pDC->DrawEdge(TextButtonRect, BDR_RAISEDINNER, BF_RECT);
00831         else if (m_nChosenColorSel == nIndex)
00832             pDC->DrawEdge(TextButtonRect, BDR_SUNKENOUTER, BF_RECT);
00833
00834         // Draw custom text
00835         CFont *pOldFont = (CFont*) pDC->SelectObject(&m_Font);
00836         pDC->SetBkMode(TRANSPARENT);
00837         pDC->DrawText(m_strCustomText, TextButtonRect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
00838         pDC->SelectObject(pOldFont);
00839
00840         return;
00841     }
00842
00843     // For the Default Text area
00844     if (m_strDefaultText.GetLength() && nIndex == DEFAULT_BOX_VALUE)
00845     {
00846         // Fill background
00847         pDC->FillSolidRect(m_DefaultTextRect, ::GetSysColor(COLOR_3DFACE));
00848
00849         // The extent of the actual text button
00850         CRect TextButtonRect = m_DefaultTextRect;
00851         TextButtonRect.DeflateRect(1,1);
00852
00853         // fill background
00854         if (m_nChosenColorSel == nIndex && m_nCurrentSel != nIndex)
00855             pDC->FillSolidRect(TextButtonRect, ::GetSysColor(COLOR_3DLIGHT));
00856         else
00857             pDC->FillSolidRect(TextButtonRect, ::GetSysColor(COLOR_3DFACE));
00858
00859         // Draw thin line around text
00860         CRect LineRect = TextButtonRect;
00861         LineRect.DeflateRect(2*m_nMargin,2*m_nMargin);
00862         CPen pen(PS_SOLID, 1, ::GetSysColor(COLOR_3DSHADOW));
00863         CPen* pOldPen = pDC->SelectObject(&pen);
00864         pDC->SelectStockObject(NULL_BRUSH);
00865         pDC->Rectangle(LineRect);
00866         pDC->SelectObject(pOldPen);
00867
00868         // Draw button
00869         if (m_nCurrentSel == nIndex)
00870             pDC->DrawEdge(TextButtonRect, BDR_RAISEDINNER, BF_RECT);
00871         else if (m_nChosenColorSel == nIndex)
00872             pDC->DrawEdge(TextButtonRect, BDR_SUNKENOUTER, BF_RECT);
00873
00874         // Draw custom text
00875         CFont *pOldFont = (CFont*) pDC->SelectObject(&m_Font);
00876         pDC->SetBkMode(TRANSPARENT);
00877         pDC->DrawText(m_strDefaultText, TextButtonRect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
00878         pDC->SelectObject(pOldFont);
00879
00880         // fix potential resource leak - KStowell - 10-21-99
00881         pen.DeleteObject();
00882         return;
00883     }
00884
00885     CRect rect;
00886     if (!GetCellRect(nIndex, rect)) return;
00887
00888     // Select and realize the palette
00889     CPalette* pOldPalette = NULL;
00890     if (pDC->GetDeviceCaps(RASTERCAPS) & RC_PALETTE)
00891     {
00892         pOldPalette = pDC->SelectPalette(&m_Palette, FALSE);
00893         pDC->RealizePalette();
00894     }
00895
00896     // fill background
00897     if (m_nChosenColorSel == nIndex && m_nCurrentSel != nIndex)
00898         pDC->FillSolidRect(rect, ::GetSysColor(COLOR_3DHILIGHT));
00899     else
00900         pDC->FillSolidRect(rect, ::GetSysColor(COLOR_3DFACE));
00901
00902     // Draw button
00903     if (m_nCurrentSel == nIndex)
00904         pDC->DrawEdge(rect, BDR_RAISEDINNER, BF_RECT);
00905     else if (m_nChosenColorSel == nIndex)
00906         pDC->DrawEdge(rect, BDR_SUNKENOUTER, BF_RECT);
00907
00908     CBrush brush(PALETTERGB(GetRValue(GetColor(nIndex)),
00909                             GetGValue(GetColor(nIndex)),
00910                             GetBValue(GetColor(nIndex)) ));
00911     CPen   pen;
00912     pen.CreatePen(PS_SOLID, 1, ::GetSysColor(COLOR_3DSHADOW));
00913
00914     CBrush* pOldBrush = (CBrush*) pDC->SelectObject(&brush);
00915     CPen*   pOldPen   = (CPen*)   pDC->SelectObject(&pen);
00916
00917     // Draw the cell Color
00918     rect.DeflateRect(m_nMargin+1, m_nMargin+1);
00919     pDC->Rectangle(rect);
00920
00921     // restore DC and cleanup
00922     pDC->SelectObject(pOldBrush);
00923     pDC->SelectObject(pOldPen);
00924     brush.DeleteObject();
00925     pen.DeleteObject();
00926
00927     if (pOldPalette && pDC->GetDeviceCaps(RASTERCAPS) & RC_PALETTE)
00928         pDC->SelectPalette(pOldPalette, FALSE);
00929 }

void CCJColorPopup::EndSelection ( int nMessage ) [protected, virtual]

Definition at line 779 of file CJColorPopup.cpp.

References CPN_SELENDCANCEL, CUSTOM_BOX_VALUE, m_crColor, m_crInitialColor, m_nCurrentSel, and m_pParent.

Referenced by OnActivateApp, OnKeyDown, and OnLButtonUp.

00780 {
00781     ReleaseCapture();
00782
00783     // If custom text selected, perform a custom Color selection
00784     if (nMessage != CPN_SELENDCANCEL && m_nCurrentSel == CUSTOM_BOX_VALUE)
00785     {
00786         CColorDialog dlg(m_crInitialColor, CC_FULLOPEN | CC_ANYCOLOR, this);
00787
00788         if (dlg.DoModal() == IDOK)
00789             m_crColor = dlg.GetColor();
00790         else
00791             nMessage = CPN_SELENDCANCEL;
00792     }
00793
00794     if (nMessage == CPN_SELENDCANCEL)
00795         m_crColor = m_crInitialColor;
00796
00797     m_pParent->SendMessage(nMessage, (WPARAM) m_crColor, 0);
00798
00799     DestroyWindow();
00800 }

void CCJColorPopup::FindCellFromColor ( COLORREF crColor ) [protected, virtual]

Definition at line 577 of file CJColorPopup.cpp.

References CUSTOM_BOX_VALUE, DEFAULT_BOX_VALUE, GetColor, INVALID_Color, m_nChosenColorSel, m_nNumColors, m_strCustomText, and m_strDefaultText.

Referenced by Create.

00578 {
00579     if (crColor == CLR_DEFAULT && m_strDefaultText.GetLength())
00580     {
00581         m_nChosenColorSel = DEFAULT_BOX_VALUE;
00582         return;
00583     }
00584
00585     for (int i = 0; i < m_nNumColors; i++)
00586     {
00587         if (GetColor(i) == crColor)
00588         {
00589             m_nChosenColorSel = i;
00590             return;
00591         }
00592     }
00593
00594     if (m_strCustomText.GetLength())
00595         m_nChosenColorSel = CUSTOM_BOX_VALUE;
00596     else
00597         m_nChosenColorSel = INVALID_Color;
00598 }

BOOL CCJColorPopup::GetCellRect | ( | int | nIndex,
 |  | const LPRECT & | rect
 | ) | [protected, virtual]

Definition at line 601 of file CJColorPopup.cpp.

References CUSTOM_BOX_VALUE, DEFAULT_BOX_VALUE, FALSE, GetColumn, GetRow, m_CustomTextRect, m_DefaultTextRect, m_nBoxSize, m_nMargin, m_nNumColors, m_strDefaultText, and TRUE.

Referenced by CreateToolTips, and DrawCell.

00602 {
00603     if (nIndex == CUSTOM_BOX_VALUE)
00604     {
00605         ::SetRect(rect,
00606                   m_CustomTextRect.left,  m_CustomTextRect.top,
00607                   m_CustomTextRect.right, m_CustomTextRect.bottom);
00608         return TRUE;
00609     }
00610     else if (nIndex == DEFAULT_BOX_VALUE)
00611     {
00612         ::SetRect(rect,
00613                   m_DefaultTextRect.left,  m_DefaultTextRect.top,
00614                   m_DefaultTextRect.right, m_DefaultTextRect.bottom);
00615         return TRUE;
00616     }
00617
00618     if (nIndex < 0 || nIndex >= m_nNumColors)
00619         return FALSE;
00620
00621     rect->left = GetColumn(nIndex) * m_nBoxSize + m_nMargin;
00622     rect->top  = GetRow(nIndex) * m_nBoxSize + m_nMargin;
00623
00624     // Move everything down if we are displaying a default text area
00625     if (m_strDefaultText.GetLength())
00626         rect->top += (m_nMargin + m_DefaultTextRect.Height());
00627
00628     rect->right = rect->left + m_nBoxSize;
00629     rect->bottom = rect->top + m_nBoxSize;
00630
00631     return TRUE;
00632 }

virtual COLORREF CCJColorPopup::GetColor ( int nIndex ) [inline, protected, virtual]

Definition at line 111 of file CJColorPopup.h.

Referenced by ChangeSelection, DrawCell, and FindCellFromColor.

00111 { return m_crColors[nIndex].crColor; }

virtual LPCTSTR CCJColorPopup::GetColorName ( int nIndex ) [inline, protected, virtual]

Definition at line 112 of file CJColorPopup.h.

Referenced by CreateToolTips.

00112 { return m_crColors[nIndex].szName; }

int CCJColorPopup::GetColumn ( int nIndex ) const [protected, virtual]

Definition at line 565 of file CJColorPopup.cpp.

References CUSTOM_BOX_VALUE, DEFAULT_BOX_VALUE, INVALID_Color, m_nNumColors, m_nNumColumns, m_strCustomText, and m_strDefaultText.

Referenced by GetCellRect, and OnKeyDown.

00566 {
00567     if (nIndex == CUSTOM_BOX_VALUE && m_strCustomText.GetLength())
00568         return CUSTOM_BOX_VALUE;
00569     else if (nIndex == DEFAULT_BOX_VALUE && m_strDefaultText.GetLength())
00570         return DEFAULT_BOX_VALUE;
00571     else if (nIndex < 0 || nIndex >= m_nNumColors)
00572         return INVALID_Color;
00573     else
00574         return nIndex % m_nNumColumns;
00575 }

int CCJColorPopup::GetIndex | ( | int | row,
 |  | int | col
 | ) | const [protected, virtual]

Definition at line 536 of file CJColorPopup.cpp.

References CUSTOM_BOX_VALUE, DEFAULT_BOX_VALUE, INVALID_Color, m_nNumColors, m_nNumColumns, m_nNumRows, m_strCustomText, and m_strDefaultText.

Referenced by OnKeyDown, and OnMouseMove.

00537 {
00538     if ((row == CUSTOM_BOX_VALUE || col == CUSTOM_BOX_VALUE) && m_strCustomText.GetLength())
00539         return CUSTOM_BOX_VALUE;
00540     else if ((row == DEFAULT_BOX_VALUE || col == DEFAULT_BOX_VALUE) && m_strDefaultText.GetLength())
00541         return DEFAULT_BOX_VALUE;
00542     else if (row < 0 || col < 0 || row >= m_nNumRows || col >= m_nNumColumns)
00543         return INVALID_Color;
00544     else
00545     {
00546         if (row*m_nNumColumns + col >= m_nNumColors)
00547             return INVALID_Color;
00548         else
00549             return row*m_nNumColumns + col;
00550     }
00551 }

int CCJColorPopup::GetRow ( int nIndex ) const [protected, virtual]

Definition at line 553 of file CJColorPopup.cpp.

References CUSTOM_BOX_VALUE, DEFAULT_BOX_VALUE, INVALID_Color, m_nNumColors, m_nNumColumns, m_strCustomText, and m_strDefaultText.

Referenced by GetCellRect, and OnKeyDown.

00554 {
00555     if (nIndex == CUSTOM_BOX_VALUE && m_strCustomText.GetLength())
00556         return CUSTOM_BOX_VALUE;
00557     else if (nIndex == DEFAULT_BOX_VALUE && m_strDefaultText.GetLength())
00558         return DEFAULT_BOX_VALUE;
00559     else if (nIndex < 0 || nIndex >= m_nNumColors)
00560         return INVALID_Color;
00561     else
00562         return nIndex / m_nNumColumns;
00563 }

void CCJColorPopup::Initialise ( ) [virtual]

Definition at line 162 of file CJColorPopup.cpp.

References ASSERT, INVALID_Color, m_crColor, m_crColors, m_crInitialColor, m_nBoxSize, m_nChosenColorSel, m_nCurrentSel, m_nMargin, m_nNumColors, m_nNumColumns, m_nNumRows, m_Palette, m_pParent, MAX_ColorS, and NULL.

Referenced by CCJColorPopup.

00163 {
00164     m_nNumColors       = sizeof(m_crColors)/sizeof(ColorTableEntry);
00165     ASSERT(m_nNumColors <= MAX_ColorS);
00166     if (m_nNumColors > MAX_ColorS)
00167         m_nNumColors = MAX_ColorS;
00168
00169     m_nNumColumns       = 0;
00170     m_nNumRows          = 0;
00171     m_nBoxSize          = 18;
00172     m_nMargin           = ::GetSystemMetrics(SM_CXEDGE);
00173     m_nCurrentSel       = INVALID_Color;
00174     m_nChosenColorSel  = INVALID_Color;
00175     m_pParent           = NULL;
00176     m_crColor          = m_crInitialColor = RGB(0,0,0);
00177
00178     // Idiot check: Make sure the Color square is at least 5 x 5;
00179     if (m_nBoxSize - 2*m_nMargin - 2 < 5) m_nBoxSize = 5 + 2*m_nMargin + 2;
00180
00181     // Create the palette
00182     struct {
00183         LOGPALETTE    LogPalette;
00184         PALETTEENTRY  PalEntry[MAX_ColorS];
00185     } pal;
00186
00187     LOGPALETTE* pLogPalette = (LOGPALETTE*) &pal;
00188     pLogPalette->palVersion    = 0x300;
00189     pLogPalette->palNumEntries = (WORD) m_nNumColors;
00190
00191     for (int i = 0; i < m_nNumColors; i++)
00192     {
00193         pLogPalette->palPalEntry[i].peRed   = GetRValue(m_crColors[i].crColor);
00194         pLogPalette->palPalEntry[i].peGreen = GetGValue(m_crColors[i].crColor);
00195         pLogPalette->palPalEntry[i].peBlue  = GetBValue(m_crColors[i].crColor);
00196         pLogPalette->palPalEntry[i].peFlags = 0;
00197     }
00198
00199     m_Palette.CreatePalette(pLogPalette);
00200 }

void CCJColorPopup::OnActivateApp | ( | BOOL | bActive,
 |  | HTASK | hTask
 | ) | [protected]

Definition at line 954 of file CJColorPopup.cpp.

References CPN_SELENDCANCEL, and EndSelection.

00955 {
00956     CWnd::OnActivateApp(bActive, hTask);
00957
00958     // If Deactivating App, cancel this selection
00959     if (!bActive)
00960          EndSelection(CPN_SELENDCANCEL);
00961 }

BOOL CCJColorPopup::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 973 of file CJColorPopup.cpp.

References TRUE.

00974 {
00975     // KStowell - overridden for flicker-free drawing.
00976     UNUSED_ALWAYS(pDC);
00977     return TRUE;
00978 }

void CCJColorPopup::OnKeyDown | ( | UINT | nChar,
 |  | UINT | nRepCnt,
 |  | UINT | nFlags
 | ) | [protected]

Definition at line 280 of file CJColorPopup.cpp.

References ChangeSelection, CPN_SELENDCANCEL, CPN_SELENDOK, CUSTOM_BOX_VALUE, DEFAULT_BOX_VALUE, EndSelection, GetColumn, GetIndex, GetRow, INVALID_Color, m_crColor, m_crInitialColor, m_nCurrentSel, m_nNumColors, m_nNumColumns, m_strCustomText, and m_strDefaultText.

00281 {
00282     int row = GetRow(m_nCurrentSel),
00283         col = GetColumn(m_nCurrentSel);
00284
00285     if (nChar == VK_DOWN)
00286     {
00287         if (row == DEFAULT_BOX_VALUE)
00288             row = col = 0;
00289         else if (row == CUSTOM_BOX_VALUE)
00290         {
00291             if (m_strDefaultText.GetLength())
00292                 row = col = DEFAULT_BOX_VALUE;
00293             else
00294                 row = col = 0;
00295         }
00296         else
00297         {
00298             row++;
00299             if (GetIndex(row,col) < 0)
00300             {
00301                 if (m_strCustomText.GetLength())
00302                     row = col = CUSTOM_BOX_VALUE;
00303                 else if (m_strDefaultText.GetLength())
00304                     row = col = DEFAULT_BOX_VALUE;
00305                 else
00306                     row = col = 0;
00307             }
00308         }
00309         ChangeSelection(GetIndex(row, col));
00310     }
00311
00312     if (nChar == VK_UP)
00313     {
00314         if (row == DEFAULT_BOX_VALUE)
00315         {
00316             if (m_strCustomText.GetLength())
00317                 row = col = CUSTOM_BOX_VALUE;
00318             else
00319            {
00320                 row = GetRow(m_nNumColors-1);
00321                 col = GetColumn(m_nNumColors-1);
00322             }
00323         }
00324         else if (row == CUSTOM_BOX_VALUE)
00325         {
00326             row = GetRow(m_nNumColors-1);
00327             col = GetColumn(m_nNumColors-1);
00328         }
00329         else if (row > 0) row--;
00330         else /* row == 0 */
00331         {
00332             if (m_strDefaultText.GetLength())
00333                 row = col = DEFAULT_BOX_VALUE;
00334             else if (m_strCustomText.GetLength())
00335                 row = col = CUSTOM_BOX_VALUE;
00336             else
00337             {
00338                 row = GetRow(m_nNumColors-1);
00339                 col = GetColumn(m_nNumColors-1);
00340             }
00341         }
00342         ChangeSelection(GetIndex(row, col));
00343     }
00344
00345     if (nChar == VK_RIGHT)
00346     {
00347         if (row == DEFAULT_BOX_VALUE)
00348             row = col = 0;
00349         else if (row == CUSTOM_BOX_VALUE)
00350         {
00351             if (m_strDefaultText.GetLength())
00352                 row = col = DEFAULT_BOX_VALUE;
00353             else
00354                 row = col = 0;
00355         }
00356         else if (col < m_nNumColumns-1)
00357             col++;
00358         else
00359         {
00360             col = 0; row++;
00361         }
00362
00363         if (GetIndex(row,col) == INVALID_Color)
00364         {
00365             if (m_strCustomText.GetLength())
00366                 row = col = CUSTOM_BOX_VALUE;
00367             else if (m_strDefaultText.GetLength())
00368                 row = col = DEFAULT_BOX_VALUE;
00369             else
00370                 row = col = 0;
00371         }
00372
00373         ChangeSelection(GetIndex(row, col));
00374     }
00375
00376     if (nChar == VK_LEFT)
00377     {
00378         if (row == DEFAULT_BOX_VALUE)
00379         {
00380             if (m_strCustomText.GetLength())
00381                 row = col = CUSTOM_BOX_VALUE;
00382             else
00383            {
00384                 row = GetRow(m_nNumColors-1);
00385                 col = GetColumn(m_nNumColors-1);
00386             }
00387         }
00388         else if (row == CUSTOM_BOX_VALUE)
00389         {
00390             row = GetRow(m_nNumColors-1);
00391             col = GetColumn(m_nNumColors-1);
00392         }
00393         else if (col > 0) col--;
00394         else /* col == 0 */
00395         {
00396             if (row > 0) { row--; col = m_nNumColumns-1; }
00397             else
00398             {
00399                 if (m_strDefaultText.GetLength())
00400                     row = col = DEFAULT_BOX_VALUE;
00401                 else if (m_strCustomText.GetLength())
00402                     row = col = CUSTOM_BOX_VALUE;
00403                 else
00404                 {
00405                     row = GetRow(m_nNumColors-1);
00406                     col = GetColumn(m_nNumColors-1);
00407                 }
00408             }
00409         }
00410         ChangeSelection(GetIndex(row, col));
00411     }
00412
00413     if (nChar == VK_ESCAPE)
00414     {
00415         m_crColor = m_crInitialColor;
00416         EndSelection(CPN_SELENDCANCEL);
00417         return;
00418     }
00419
00420     if (nChar == VK_RETURN || nChar == VK_SPACE)
00421     {
00422         EndSelection(CPN_SELENDOK);
00423         return;
00424     }
00425
00426     CWnd::OnKeyDown(nChar, nRepCnt, nFlags);
00427 }

void CCJColorPopup::OnKillFocus ( CWnd * pNewWnd ) [protected]

Definition at line 945 of file CJColorPopup.cpp.

00946 {
00947     CWnd::OnKillFocus(pNewWnd);
00948
00949     ReleaseCapture();
00950     //DestroyWindow(); - causes crash when Custom Color dialog appears.
00951 }

void CCJColorPopup::OnLButtonUp | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 520 of file CJColorPopup.cpp.

References CPN_SELENDCANCEL, CPN_SELENDOK, EndSelection, and m_WindowRect.

00521 {
00522     CWnd::OnLButtonUp(nFlags, point);
00523
00524     DWORD pos = GetMessagePos();
00525     point = CPoint(LOWORD(pos), HIWORD(pos));
00526
00527     if (m_WindowRect.PtInRect(point))
00528         EndSelection(CPN_SELENDOK);
00529     else
00530         EndSelection(CPN_SELENDCANCEL);
00531 }

void CCJColorPopup::OnMouseMove | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 481 of file CJColorPopup.cpp.

References ChangeSelection, CUSTOM_BOX_VALUE, DEFAULT_BOX_VALUE, GetIndex, INVALID_Color, m_CustomTextRect, m_DefaultTextRect, m_nBoxSize, m_nCurrentSel, m_nMargin, m_nNumColors, m_strCustomText, and m_strDefaultText.

00482 {
00483     int nNewSelection = INVALID_Color;
00484
00485     // Translate points to be relative raised window edge
00486     point.x -= m_nMargin;
00487     point.y -= m_nMargin;
00488
00489     // First check we aren't in text box
00490     if (m_strCustomText.GetLength() && m_CustomTextRect.PtInRect(point))
00491         nNewSelection = CUSTOM_BOX_VALUE;
00492     else if (m_strDefaultText.GetLength() && m_DefaultTextRect.PtInRect(point))
00493         nNewSelection = DEFAULT_BOX_VALUE;
00494     else
00495     {
00496         // Take into account text box
00497         if (m_strDefaultText.GetLength())
00498             point.y -= m_DefaultTextRect.Height();
00499
00500         // Get the row and column
00501         nNewSelection = GetIndex(point.y / m_nBoxSize, point.x / m_nBoxSize);
00502
00503         // In range? If not, default and exit
00504         if (nNewSelection < 0 || nNewSelection >= m_nNumColors)
00505         {
00506             CWnd::OnMouseMove(nFlags, point);
00507             return;
00508         }
00509     }
00510
00511     // OK - we have the row and column of the current selection (may be CUSTOM_BOX_VALUE)
00512     // Has the row/col selection changed? If yes, then redraw old and new cells.
00513     if (nNewSelection != m_nCurrentSel)
00514         ChangeSelection(nNewSelection);
00515
00516     CWnd::OnMouseMove(nFlags, point);
00517 }

void CCJColorPopup::OnNcDestroy ( ) [protected]

Definition at line 430 of file CJColorPopup.cpp.

00431 {
00432     CWnd::OnNcDestroy();
00433     delete this;
00434 }

void CCJColorPopup::OnPaint ( ) [protected]

Definition at line 436 of file CJColorPopup.cpp.

References CUSTOM_BOX_VALUE, DEFAULT_BOX_VALUE, DrawCell, m_nNumColors, m_strCustomText, and m_strDefaultText.

00437 {
00438     CPaintDC dc(this); // device context for painting
00439
00440     // KStowell - Get the client rect for this control.
00441     CRect rcClient;
00442     GetClientRect(&rcClient);
00443
00444     // KStowell - Create a memory device-context. This is done to help reduce
00445     // screen flicker, since we will paint the entire control to the
00446     // off screen device context first.
00447     CDC memDC;
00448     memDC.CreateCompatibleDC(&dc);
00449     CBitmap bitmap;
00450     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00451     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00452     memDC.FillSolidRect(rcClient, ::GetSysColor(COLOR_BTNFACE));
00453
00454     // Draw the Default Area text
00455     if (m_strDefaultText.GetLength())
00456         DrawCell(&memDC, DEFAULT_BOX_VALUE);
00457
00458     // Draw Color cells
00459     for (int i = 0; i < m_nNumColors; i++)
00460         DrawCell(&memDC, i);
00461
00462     // Draw custom text
00463     if (m_strCustomText.GetLength())
00464         DrawCell(&memDC, CUSTOM_BOX_VALUE);
00465
00466     // Draw raised window edge (ex-window style WS_EX_WINDOWEDGE is sposed to do this,
00467     // but for some reason isn't
00468     CRect rect;
00469     GetClientRect(rect);
00470     memDC.DrawEdge(rect, EDGE_RAISED, BF_RECT);
00471
00472     // KStowell - copy the memory device context back into the original DC via BitBlt().
00473     dc.BitBlt(rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), &memDC, 0,0, SRCCOPY);
00474
00475     // KStowell - cleanup.
00476     memDC.SelectObject(pOldBitmap);
00477     memDC.DeleteDC();
00478     bitmap.DeleteObject();
00479 }

void CCJColorPopup::OnPaletteChanged ( CWnd * pFocusWnd ) [protected]

Definition at line 937 of file CJColorPopup.cpp.

00938 {
00939     CWnd::OnPaletteChanged(pFocusWnd);
00940
00941     if (pFocusWnd->GetSafeHwnd() != GetSafeHwnd())
00942         Invalidate();
00943 }

BOOL CCJColorPopup::OnQueryNewPalette ( ) [protected]

Definition at line 931 of file CJColorPopup.cpp.

00932 {
00933     Invalidate();
00934     return CWnd::OnQueryNewPalette();
00935 }

BOOL CCJColorPopup::PreTranslateMessage ( MSG * pMsg ) [virtual]

Definition at line 273 of file CJColorPopup.cpp.

References m_ToolTip.

00274 {
00275     m_ToolTip.RelayEvent(pMsg);
00276     return CWnd::PreTranslateMessage(pMsg);
00277 }

void CCJColorPopup::SetWindowSize ( ) [protected, virtual]

Definition at line 635 of file CJColorPopup.cpp.

References m_CustomTextRect, m_DefaultTextRect, m_Font, m_nBoxSize, m_nMargin, m_nNumColors, m_nNumColumns, m_nNumRows, m_pParent, m_strCustomText, m_strDefaultText, m_WindowRect, NUM_COLUMNS, and TRUE.

Referenced by Create.

00636 {
00637     CSize TextSize;
00638
00639     // If we are showing a custom or default text area, get the font and text size.
00640     if (m_strCustomText.GetLength() || m_strDefaultText.GetLength())
00641     {
00642         CClientDC dc(this);
00643         CFont* pOldFont = (CFont*) dc.SelectObject(&m_Font);
00644
00645         // Get the size of the custom text (if there IS custom text)
00646         TextSize = CSize(0,0);
00647         if (m_strCustomText.GetLength())
00648             TextSize = dc.GetTextExtent(m_strCustomText);
00649
00650         // Get the size of the default text (if there IS default text)
00651         if (m_strDefaultText.GetLength())
00652         {
00653             CSize DefaultSize = dc.GetTextExtent(m_strDefaultText);
00654             if (DefaultSize.cx > TextSize.cx) TextSize.cx = DefaultSize.cx;
00655             if (DefaultSize.cy > TextSize.cy) TextSize.cy = DefaultSize.cy;
00656         }
00657
00658         dc.SelectObject(pOldFont);
00659         TextSize += CSize(2*m_nMargin,2*m_nMargin);
00660
00661         // Add even more space to draw the horizontal line
00662         TextSize.cy += 2*m_nMargin + 2;
00663     }
00664
00665     // Get the number of columns and rows
00666     //m_nNumColumns = (int) sqrt((double)m_nNumColors);    // for a square window (yuk)
00667     m_nNumColumns = NUM_COLUMNS;
00668     m_nNumRows = m_nNumColors / m_nNumColumns;
00669     if (m_nNumColors % m_nNumColumns) m_nNumRows++;
00670
00671     // Get the current window position, and set the new size
00672     CRect rect;
00673     GetWindowRect(rect);
00674
00675     m_WindowRect.SetRect(rect.left, rect.top,
00676                          rect.left + m_nNumColumns*m_nBoxSize + 2*m_nMargin,
00677                          rect.top  + m_nNumRows*m_nBoxSize + 2*m_nMargin);
00678
00679     // if custom text, then expand window if necessary, and set text width as
00680     // window width
00681     if (m_strDefaultText.GetLength())
00682     {
00683         if (TextSize.cx > m_WindowRect.Width())
00684             m_WindowRect.right = m_WindowRect.left + TextSize.cx;
00685         TextSize.cx = m_WindowRect.Width()-2*m_nMargin;
00686
00687         // Work out the text area
00688         m_DefaultTextRect.SetRect(m_nMargin, m_nMargin,
00689                                   m_nMargin+TextSize.cx, 2*m_nMargin+TextSize.cy);
00690         m_WindowRect.bottom += m_DefaultTextRect.Height() + 2*m_nMargin;
00691     }
00692
00693     // if custom text, then expand window if necessary, and set text width as
00694     // window width
00695     if (m_strCustomText.GetLength())
00696     {
00697         if (TextSize.cx > m_WindowRect.Width())
00698             m_WindowRect.right = m_WindowRect.left + TextSize.cx;
00699         TextSize.cx = m_WindowRect.Width()-2*m_nMargin;
00700
00701         // Work out the text area
00702         m_CustomTextRect.SetRect(m_nMargin, m_WindowRect.Height(),
00703                                  m_nMargin+TextSize.cx,
00704                                  m_WindowRect.Height()+m_nMargin+TextSize.cy);
00705         m_WindowRect.bottom += m_CustomTextRect.Height() + 2*m_nMargin;
00706    }
00707
00708     // Need to check it'll fit on screen: Too far right?
00709     CSize ScreenSize(::GetSystemMetrics(SM_CXSCREEN), ::GetSystemMetrics(SM_CYSCREEN));
00710     if (m_WindowRect.right > ScreenSize.cx)
00711         m_WindowRect.OffsetRect(-(m_WindowRect.right - ScreenSize.cx), 0);
00712
00713     // Too far left?
00714     if (m_WindowRect.left < 0)
00715         m_WindowRect.OffsetRect( -m_WindowRect.left, 0);
00716
00717     // Bottom falling out of screen?
00718     if (m_WindowRect.bottom > ScreenSize.cy)
00719     {
00720         CRect ParentRect;
00721         m_pParent->GetWindowRect(ParentRect);
00722         m_WindowRect.OffsetRect(0, -(ParentRect.Height() + m_WindowRect.Height()));
00723     }
00724
00725     // Set the window size and position
00726     MoveWindow(m_WindowRect, TRUE);
00727 }

void CCJColorPopup::UpdateFont ( ) [virtual]

Definition at line 963 of file CJColorPopup.cpp.

References m_Font, and VERIFY.

Referenced by Create.

00964 {
00965     m_Font.DeleteObject();
00966     NONCLIENTMETRICS ncm;
00967     ncm.cbSize = sizeof(ncm);
00968     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00969     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00970     SetFont(&m_Font);
00971 }

Member Data Documentation

COLORREF CCJColorPopup::m_crColor [protected]

Definition at line 130 of file CJColorPopup.h.

Referenced by CCJColorPopup, ChangeSelection, Create, EndSelection, Initialise, and OnKeyDown.

ColorTableEntry CCJColorPopup::m_crColors [static, protected]

Definition at line 82 of file CJColorPopup.cpp.

Referenced by Initialise.

COLORREF CCJColorPopup::m_crInitialColor [protected]

Definition at line 130 of file CJColorPopup.h.

Referenced by CCJColorPopup, ChangeSelection, Create, EndSelection, Initialise, and OnKeyDown.

CRect CCJColorPopup::m_CustomTextRect [protected]

Definition at line 127 of file CJColorPopup.h.

Referenced by DrawCell, GetCellRect, OnMouseMove, and SetWindowSize.

CRect CCJColorPopup::m_DefaultTextRect [protected]

Definition at line 127 of file CJColorPopup.h.

Referenced by DrawCell, GetCellRect, OnMouseMove, and SetWindowSize.

CFont CCJColorPopup::m_Font [protected]

Definition at line 128 of file CJColorPopup.h.

Referenced by DrawCell, SetWindowSize, UpdateFont, and ~CCJColorPopup.

int CCJColorPopup::m_nBoxSize [protected]

Definition at line 122 of file CJColorPopup.h.

Referenced by GetCellRect, Initialise, OnMouseMove, and SetWindowSize.

int CCJColorPopup::m_nChosenColorSel [protected]

Definition at line 124 of file CJColorPopup.h.

Referenced by DrawCell, FindCellFromColor, and Initialise.

int CCJColorPopup::m_nCurrentSel [protected]

Definition at line 123 of file CJColorPopup.h.

Referenced by ChangeSelection, DrawCell, EndSelection, Initialise, OnKeyDown, and OnMouseMove.

int CCJColorPopup::m_nMargin [protected]

Definition at line 122 of file CJColorPopup.h.

Referenced by DrawCell, GetCellRect, Initialise, OnMouseMove, and SetWindowSize.

int CCJColorPopup::m_nNumColors [protected]

Definition at line 120 of file CJColorPopup.h.

Referenced by ChangeSelection, CreateToolTips, FindCellFromColor, GetCellRect, GetColumn, GetIndex, GetRow, Initialise, OnKeyDown, OnMouseMove, OnPaint, and SetWindowSize.

int CCJColorPopup::m_nNumColumns [protected]

Definition at line 121 of file CJColorPopup.h.

Referenced by GetColumn, GetIndex, GetRow, Initialise, OnKeyDown, and SetWindowSize.

int CCJColorPopup::m_nNumRows [protected]

Definition at line 121 of file CJColorPopup.h.

Referenced by GetIndex, Initialise, and SetWindowSize.

CPalette CCJColorPopup::m_Palette [protected]

Definition at line 129 of file CJColorPopup.h.

Referenced by DrawCell, Initialise, and ~CCJColorPopup.

CWnd* CCJColorPopup::m_pParent [protected]

Definition at line 132 of file CJColorPopup.h.

Referenced by CCJColorPopup, ChangeSelection, Create, EndSelection, Initialise, and SetWindowSize.

CString CCJColorPopup::m_strCustomText [protected]

Definition at line 126 of file CJColorPopup.h.

Referenced by CCJColorPopup, Create, DrawCell, FindCellFromColor, GetColumn, GetIndex, GetRow, OnKeyDown, OnMouseMove, OnPaint, and SetWindowSize.

CString CCJColorPopup::m_strDefaultText [protected]

Definition at line 125 of file CJColorPopup.h.

Referenced by CCJColorPopup, Create, DrawCell, FindCellFromColor, GetCellRect, GetColumn, GetIndex, GetRow, OnKeyDown, OnMouseMove, OnPaint, and SetWindowSize.

CToolTipCtrl CCJColorPopup::m_ToolTip [protected]

Definition at line 131 of file CJColorPopup.h.

Referenced by CreateToolTips, and PreTranslateMessage.

CRect CCJColorPopup::m_WindowRect [protected]

Definition at line 127 of file CJColorPopup.h.

Referenced by OnLButtonUp, and SetWindowSize.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJColorPopup.h
  • WinCvs/CJLib/CJLibrary/CJColorPopup.cpp
Generated on Sun Feb 24 01:24:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJComboBoxEx Class Reference

#include <CJComboBoxEx.h>

Inheritance diagram for CCJComboBoxEx:

[legend]
Collaboration diagram for CCJComboBoxEx:

[legend]
List of all members.

Public Methods

CCJComboBoxEx ()
virtual | ~CCJComboBoxEx ()
BOOL | Create (DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID)
int | DeleteItem (int iIndex)
BOOL | GetItem (COMBOBOXEXITEM *pCBItem)
int | InsertItem (const COMBOBOXEXITEM *pCBItem)
int | InsertItem (int iItem, UINT nStringID, int iIndent=0, int iImage=0, int iSelectedImage=0, UINT mask=CBEIF_TEXT|CBEIF_IMAGE|CBEIF_SELECTEDIMAGE|CBEIF_INDENT)
int | InsertItem (int iItem, LPCTSTR lpszItem, int iIndent=0, int iImage=0, int iSelectedImage=0, UINT mask=CBEIF_TEXT|CBEIF_IMAGE|CBEIF_SELECTEDIMAGE|CBEIF_INDENT)
BOOL | SetItem (const COMBOBOXEXITEM *pCBItem)
DWORD | GetExtendedStyle () const
DWORD | SetExtendedStyle (DWORD dwExMask, DWORD dwExStyles)
BOOL | HasEditChanged ()
CEdit * GetEditCtrl ()
CComboBox * GetComboBoxCtrl ()
CImageList * | GetImageList () const
CImageList * | SetImageList (CImageList *pImageList)
int | Dir (UINT attr, LPCTSTR lpszWildCard)
int | FindString (int nIndexStart, LPCTSTR lpszFind) const
int | AddString (LPCTSTR lpszString)
BOOL | SetEditSel (int nStartChar, int nEndChar)
int | InsertString (int nIndex, LPCTSTR lpszString)

Constructor & Destructor Documentation

_CJXLIB_INLINE CCJComboBoxEx::CCJComboBoxEx ( )

Definition at line 243 of file CJComboBoxEx.h.

00244     { }

CCJComboBoxEx::~CCJComboBoxEx ( ) [virtual]

Definition at line 126 of file CJComboBoxEx.cpp.

00127 {
00128     DestroyWindow();
00129 }

Member Function Documentation

_CJXLIB_INLINE int CCJComboBoxEx::AddString ( LPCTSTR lpszString )

Definition at line 267 of file CJComboBoxEx.h.

References ASSERT, and FALSE.

00268     { UNUSED_ALWAYS(lpszString); ASSERT(FALSE); return CB_ERR; }

BOOL CCJComboBoxEx::Create | ( | DWORD | dwStyle,
 |  | const RECT & | rect,
 |  | CWnd * | pParentWnd,
 |  | UINT | nID
 | ) |

Definition at line 55 of file CJComboBoxEx.cpp.

References NULL, and VERIFY.

00057 {
00058   // initialize common controls
00059 #ifdef _VC_VERSION_5
00060     INITCOMMONCONTROLSEX icex;
00061     icex.dwSize = sizeof(icex);
00062     icex.dwICC = ICC_USEREX_CLASSES;
00063     VERIFY(InitCommonControlsEx(&icex));
00064 #else
00065     VERIFY(AfxDeferRegisterClass(AFX_WNDCOMMCTL_USEREX_REG));
00066 #endif
00067
00068     CWnd* pWnd = this;
00069     return pWnd->Create(WC_COMBOBOXEX, NULL, dwStyle, rect, pParentWnd, nID);
00070 }

int CCJComboBoxEx::DeleteItem ( int iIndex )

Definition at line 72 of file CJComboBoxEx.cpp.

References ASSERT.

00073 {
00074     ASSERT(::IsWindow(m_hWnd));
00075     return (int) ::SendMessage(m_hWnd, CBEM_DELETEITEM, (WPARAM) iIndex, 0);
00076 }

_CJXLIB_INLINE int CCJComboBoxEx::Dir | ( | UINT | attr,
 |  | LPCTSTR | lpszWildCard
 | ) |

Definition at line 263 of file CJComboBoxEx.h.

References ASSERT, and FALSE.

00264     { UNUSED_ALWAYS(attr); UNUSED_ALWAYS(lpszWildCard); ASSERT(FALSE); return CB_ERR; }

_CJXLIB_INLINE int CCJComboBoxEx::FindString | ( | int | nIndexStart,
 |  | LPCTSTR | lpszFind
 | ) | const

Definition at line 265 of file CJComboBoxEx.h.

References ASSERT, and FALSE.

00266     { UNUSED_ALWAYS(nIndexStart); UNUSED_ALWAYS(lpszFind); ASSERT(FALSE); return CB_ERR; }

_CJXLIB_INLINE CComboBox * CCJComboBoxEx::GetComboBoxCtrl ( )

Definition at line 253 of file CJComboBoxEx.h.

References ASSERT.

00254     { ASSERT(::IsWindow(m_hWnd)); return (CComboBox*) CComboBox::FromHandle((HWND) ::SendMessage(m_hWnd, CBEM_GETCOMBOCONTROL, 0, 0)); }

_CJXLIB_INLINE CEdit * CCJComboBoxEx::GetEditCtrl ( )

Definition at line 251 of file CJComboBoxEx.h.

References ASSERT.

00252     { ASSERT(::IsWindow(m_hWnd)); return (CEdit*) CEdit::FromHandle((HWND) ::SendMessage(m_hWnd, CBEM_GETEDITCONTROL, 0, 0)); }

_CJXLIB_INLINE DWORD CCJComboBoxEx::GetExtendedStyle ( ) const

Definition at line 245 of file CJComboBoxEx.h.

References ASSERT.

00246     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, CBEM_GETEXTENDEDSTYLE, 0, 0); }

_CJXLIB_INLINE CImageList * CCJComboBoxEx::GetImageList ( ) const

Definition at line 257 of file CJComboBoxEx.h.

References ASSERT.

00258     { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, CBEM_GETIMAGELIST, 0, 0)); }

BOOL CCJComboBoxEx::GetItem ( COMBOBOXEXITEM * pCBItem )

Definition at line 78 of file CJComboBoxEx.cpp.

References ASSERT, and NULL.

00079 {
00080     ASSERT(::IsWindow(m_hWnd));
00081     ASSERT(pCBItem != NULL);
00082     ASSERT(AfxIsValidAddress(pCBItem, sizeof(COMBOBOXEXITEM)));
00083
00084     return (int) ::SendMessage(m_hWnd, CBEM_GETITEM, 0, (LPARAM) pCBItem);
00085 }

_CJXLIB_INLINE BOOL CCJComboBoxEx::HasEditChanged ( )

Definition at line 249 of file CJComboBoxEx.h.

References ASSERT.

00250     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, CBEM_HASEDITCHANGED, 0, 0); }

int CCJComboBoxEx::InsertItem | ( | int | iItem,
 |  | LPCTSTR | lpszItem,
 |  | int | iIndent = 0,
 |  | int | iImage = 0,
 |  | int | iSelectedImage = 0,
 |  | UINT | mask = CBEIF_TEXT|CBEIF_IMAGE|CBEIF_SELECTEDIMAGE|CBEIF_INDENT
 | ) |

Definition at line 103 of file CJComboBoxEx.cpp.

References InsertItem.

00104 {
00105     COMBOBOXEXITEM cbItem;
00106
00107     cbItem.mask             = mask;
00108     cbItem.iItem            = iItem;
00109     cbItem.pszText          = const_cast<LPTSTR>(lpszItem);
00110     cbItem.iImage           = iImage;
00111     cbItem.iSelectedImage   = iSelectedImage;
00112     cbItem.iIndent          = iIndent;
00113
00114     return InsertItem(&cbItem);
00115 }

int CCJComboBoxEx::InsertItem | ( | int | iItem,
 |  | UINT | nStringID,
 |  | int | iIndent = 0,
 |  | int | iImage = 0,
 |  | int | iSelectedImage = 0,
 |  | UINT | mask = CBEIF_TEXT|CBEIF_IMAGE|CBEIF_SELECTEDIMAGE|CBEIF_INDENT
 | ) |

Definition at line 96 of file CJComboBoxEx.cpp.

References InsertItem.

00097 {
00098     CString strItem;
00099     strItem.LoadString(nStringID);
00100     return InsertItem(iItem, strItem, iIndent, iImage, iSelectedImage, mask);
00101 }

int CCJComboBoxEx::InsertItem ( const COMBOBOXEXITEM * pCBItem )

Definition at line 87 of file CJComboBoxEx.cpp.

References ASSERT, FALSE, and NULL.

Referenced by InsertItem.

00088 {
00089     ASSERT(::IsWindow(m_hWnd));
00090     ASSERT(pCBItem != NULL);
00091     ASSERT(AfxIsValidAddress(pCBItem, sizeof(COMBOBOXEXITEM), FALSE));
00092
00093     return (int) ::SendMessage(m_hWnd, CBEM_INSERTITEM, 0, (LPARAM) pCBItem);
00094 }

_CJXLIB_INLINE int CCJComboBoxEx::InsertString | ( | int | nIndex,
 |  | LPCTSTR | lpszString
 | ) |

Definition at line 271 of file CJComboBoxEx.h.

References ASSERT, and FALSE.

00272     { UNUSED_ALWAYS(nIndex); UNUSED_ALWAYS(lpszString); ASSERT(FALSE); return CB_ERR; }

_CJXLIB_INLINE BOOL CCJComboBoxEx::SetEditSel | ( | int | nStartChar,
 |  | int | nEndChar
 | ) |

Definition at line 269 of file CJComboBoxEx.h.

References ASSERT, and FALSE.

00270     { UNUSED_ALWAYS(nStartChar); UNUSED_ALWAYS(nEndChar); ASSERT(FALSE); return FALSE; }

_CJXLIB_INLINE DWORD CCJComboBoxEx::SetExtendedStyle | ( | DWORD | dwExMask,
 |  | DWORD | dwExStyles
 | ) |

Definition at line 247 of file CJComboBoxEx.h.

References ASSERT.

00248     { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, CBEM_SETEXTENDEDSTYLE, (DWORD) dwExMask, (LPARAM) dwExStyles); }

_CJXLIB_INLINE CImageList * CCJComboBoxEx::SetImageList ( CImageList * pImageList )

Definition at line 255 of file CJComboBoxEx.h.

References ASSERT.

00256     { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, CBEM_SETIMAGELIST, 0, (LPARAM)pImageList->GetSafeHandle())); }

BOOL CCJComboBoxEx::SetItem ( const COMBOBOXEXITEM * pCBItem )

Definition at line 117 of file CJComboBoxEx.cpp.

References ASSERT, FALSE, and NULL.

00118 {
00119     ASSERT(::IsWindow(m_hWnd));
00120     ASSERT(pCBItem != NULL);
00121     ASSERT(AfxIsValidAddress(pCBItem, sizeof(COMBOBOXEXITEM), FALSE));
00122
00123     return (int) ::SendMessage(m_hWnd, CBEM_SETITEM, 0, (LPARAM) pCBItem);
00124 }

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJComboBoxEx.h
  • WinCvs/CJLib/CJLibrary/CJComboBoxEx.cpp
Generated on Sun Feb 24 01:24:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJControlBar Class Reference

#include <CJControlBar.h>

Inheritance diagram for CCJControlBar:

[legend]
Collaboration diagram for CCJControlBar:

[legend]
List of all members.

Public Methods

CCJControlBar ()
virtual | ~CCJControlBar ()
virtual void | EnableSaveState (bool bAutoSave=true)
virtual BOOL | Create (CWnd *pParentWnd, UINT nID, LPCTSTR lpszWindowName=NULL, CSize sizeDefault=CSize(200, 100), DWORD dwStyle=CBRS_LEFT, BOOL bFlatBorders=FALSE)
virtual void | GetChildRect (CRect &rect)
virtual int | GetMinExt ()
virtual BOOL | IsLeftDocked () const
virtual BOOL | IsRightDocked () const
virtual BOOL | IsTopDocked () const
virtual BOOL | IsBottomDocked () const
virtual BOOL | IsHorzDocked () const
virtual BOOL | IsVertDocked () const
virtual BOOL | IsFloating () const
virtual void | SetNormalSize (const CSize &cs)
virtual void | Normalize ()
virtual void | Minimize ()
virtual void | Maximize (int size)
virtual void | EnableDockingOnSizeBar (DWORD dwDockStyle)
virtual void | ShowFrameControls (BOOL bGripper=TRUE, BOOL bButtons=TRUE)
virtual void | SetMenuID (UINT popupMenuID, UINT popToolbarID=0, int nPos=0)
virtual UINT | GetMenuID ()
virtual void | EnableFlatLook (BOOL bFlat=TRUE)
virtual void | EnableFlatLook (BOOL bGripper, BOOL bBorder, BOOL bButtons)
virtual int | GetVertSize ()
virtual int | GetHorzSize ()
virtual BOOL | PreTranslateMessage (MSG *pMsg)
virtual void | OnUpdateCmdUI (CFrameWnd *pTarget, BOOL bDisableIfNoHndler)
virtual CSize | CalcDynamicLayout (int nLength, DWORD nMode)

Public Attributes

BOOL | m_bUnique
BOOL | m_bToFit
CHILD_BORDER m_eChildBorder

Protected Methods

virtual CRect | GetGripperRect ()
virtual CRect | GetButtonRect ()
virtual void | DrawGripper (CDC *pDC)
virtual void | SetChild (CWnd *pWnd)
virtual void | OnInvertTracker (const CRect &rect)
virtual void | HitTest (CPoint &point)
virtual void | DrawBorders (CDC *pDC, CRect &rect)
virtual void | EraseNonClient ()
virtual void | DrawGriperCaption (CDC *pDC, LPRECT pRect)
virtual void | LoadBarState (CSize &size, int nID)
virtual void | SaveBarState (CSize &size)
afx_msg void | OnNcPaint ()
afx_msg void | OnPaint ()
afx_msg void | OnMouseMove (UINT nFlags, CPoint point)
afx_msg BOOL | OnSetCursor (CWnd *pWnd, UINT nHitTest, UINT message)
afx_msg void | OnLButtonUp (UINT nFlags, CPoint point)
afx_msg UINT | OnNcHitTest (CPoint point)
afx_msg int | OnCreate (LPCREATESTRUCT lpCreateStruct)
afx_msg void | OnWindowPosChanged (WINDOWPOS FAR *lpwndpos)
afx_msg void | OnLButtonDown (UINT nFlags, CPoint point)
afx_msg void | OnButtonClose ()
afx_msg void | OnUpdateButtonClose (CCmdUI *pCmdUI)
afx_msg void | OnButtonMinimize ()
afx_msg void | OnUpdateButtonMinimize (CCmdUI *pCmdUI)
afx_msg void | OnRButtonDown (UINT nFlags, CPoint point)
afx_msg void | OnMeasureItem (int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)
afx_msg LRESULT | OnMenuChar (UINT nChar, UINT nFlags, CMenu *pMenu)
afx_msg void | OnInitMenuPopup (CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu)
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)

Protected Attributes

int | m_cxOffset
int | m_cyOffset
BTN_IMG_INDEX m_eAuxIndex
UINT | m_popToolbarID
UINT | m_popupMenuID
CCJMenu m_popupMenu
int | m_nPos
BOOL | m_bOkToDrag
BOOL | m_bMaximized
BOOL | m_bDragging
BOOL | m_bButtons
CRect | m_rcTrack
CSize | m_sizeDesired
CSize | m_sizeNormal
CSize | m_sizeVert
CSize | m_sizeHorz
CSize | m_sizeFloat
CPoint | m_ptCurDrag
CPoint | m_ptStartDrag
CWnd * m_pChildWnd
CImageList | m_ImageList
CCJCBarButton m_btnClose
CCJCBarButton m_btnMinim
CToolTipCtrl | m_ToolTip
BOOL | m_bGripper
BOOL | m_bFlatGripper
BOOL | m_bFlatBorder
CString | m_strSection
bool | m_bAutoSave
HICON | m_hIcon
HICON | m_hAuxIcon
int | m_nID
BOOL | m_bFloating

Constructor & Destructor Documentation

CCJControlBar::CCJControlBar ( )

Definition at line 255 of file CJControlBar.cpp.

References FALSE, HIDE_CONTRLBAR, IDB_BUTTON_IMAGES, m_bAutoSave, m_bButtons, m_bDragging, m_bFlatBorder, m_bFlatGripper, m_bFloating, m_bGripper, m_bMaximized, m_bOkToDrag, m_bToFit, m_bUnique, m_cxOffset, m_cyOffset, m_eAuxIndex, m_eChildBorder, m_hAuxIcon, m_hIcon, m_ImageList, m_nID, m_nPos, m_pChildWnd, m_popToolbarID, m_popupMenuID, m_sizeDesired, m_sizeFloat, m_sizeHorz, m_sizeNormal, m_sizeVert, m_strSection, NONE, NULL, and TRUE.

00256 {
00257     m_popupMenuID       = 0;
00258     m_popToolbarID      = 0;
00259     m_nPos              = 0;
00260     m_bToFit            = FALSE;
00261     m_bOkToDrag         = FALSE;
00262     m_bDragging         = FALSE;
00263     m_bMaximized        = FALSE;
00264     m_bUnique           = FALSE;
00265     m_bGripper          = TRUE;
00266     m_bButtons          = TRUE;
00267     m_bFlatGripper      = FALSE;            // Yiannhs Ver 6.06 Start Up With Flat Gripper
00268     m_bFlatBorder       = FALSE;            // Yiannhs Start Up With Flat Border
00269     m_bAutoSave         = TRUE;
00270     m_sizeVert          = CSize(200,100);   // Yiannhs to test different rectangles
00271     m_sizeHorz          = CSize(200,100);
00272     m_sizeFloat         = CSize(200,100);
00273     m_sizeDesired       = CSize(200,100);
00274     m_sizeNormal        = CSize(200,100);
00275     m_cxOffset          = 5;
00276     m_cyOffset          = 3;
00277     m_pChildWnd         = NULL;
00278     m_strSection        = _T("");
00279     m_eAuxIndex         = HIDE_CONTRLBAR;
00280     m_hIcon             = NULL;
00281     m_hAuxIcon          = NULL;
00282     m_eChildBorder      = NONE;
00283     m_nID               = 0;
00284     m_bFloating         = FALSE;
00285
00286     // Create the image list used by frame buttons.
00287     m_ImageList.Create(IDB_BUTTON_IMAGES,
00288         10, 1, RGB(255,255,255));
00289 }

CCJControlBar::~CCJControlBar ( ) [virtual]

Definition at line 291 of file CJControlBar.cpp.

References _destroyIcon, m_hAuxIcon, m_hIcon, and m_ImageList.

00292 {
00293     // fix potential resource leak - KStowell - 10-22-99.
00294     m_ImageList.DeleteImageList();
00295     _destroyIcon(m_hIcon);
00296     _destroyIcon(m_hAuxIcon);
00297 }

Member Function Documentation

CSize CCJControlBar::CalcDynamicLayout | ( | int | nLength,
 |  | DWORD | nMode
 | ) | [virtual]

Definition at line 444 of file CJControlBar.cpp.

References IsFloating, IsHorzDocked, IsVertDocked, m_sizeDesired, m_sizeFloat, m_sizeHorz, and m_sizeVert.

Referenced by CCJSizeDockBar::CalcSizeBarLayout.

00445 {
00446     CSize sizeResult = m_sizeDesired;
00447
00448     //1999-05-19 Yiannhs. Since We Get Here from different Places do some more calculations.
00449     //                    Give Visual Feedback to user.
00450
00451     if( !nLength )
00452     {
00453         CRect rect;
00454         GetWindowRect( rect );
00455         sizeResult = rect.Size();
00456
00457         if( nMode & LM_HORZDOCK )
00458         {
00459             if( !IsHorzDocked() ) {
00460                 sizeResult = m_sizeHorz;
00461             }
00462             else if( nMode & LM_VERTDOCK )
00463             {
00464                 if( !IsVertDocked() ) {
00465                     sizeResult = m_sizeVert;
00466                 }
00467                 else {
00468                     sizeResult = m_sizeFloat;           //Do not check if it is floating. Do it
00469                 }
00470                 return( sizeResult );                   //do not go on
00471             }
00472         }
00473     }
00474     //1999-05-19    Yiannhs
00475
00476     if( IsFloating( ))
00477     {
00478         if (nMode == LM_HORZ) {
00479             if (nLength < 50)
00480                 nLength = 50;
00481             m_sizeDesired.cx = nLength;
00482         }
00483
00484         if (nMode == (LM_LENGTHY | LM_HORZ)) {
00485             if (nLength < 50)
00486                 nLength = 50;
00487             m_sizeDesired.cy = nLength;
00488         }
00489
00490         sizeResult = m_sizeDesired;
00491
00492     }
00493
00494     return sizeResult;
00495 }

BOOL CCJControlBar::Create | ( | CWnd * | pParentWnd,
 |  | UINT | nID,
 |  | LPCTSTR | lpszWindowName = NULL,
 |  | CSize | sizeDefault = CSize(200, 100),
 |  | DWORD | dwStyle = CBRS_LEFT,
 |  | BOOL | bFlatBorders = FALSE
 | ) | [virtual]

Definition at line 342 of file CJControlBar.cpp.

References LoadBarState, m_bFlatBorder, m_bFlatGripper, m_sizeDesired, m_sizeFloat, m_sizeHorz, m_sizeNormal, and m_sizeVert.

Referenced by CCJExplorerBar::Create, and CMainFrame::InitializeDockingWindows.

00343 {
00344     ASSERT_VALID(pParentWnd);   // must have a parent
00345
00346     // If autosave is enabled, get the previous settings from the registry.
00347     if( m_bAutoSave ) {
00348         LoadBarState(sizeDefault, nID);
00349     }
00350
00351     // Set initial control bar style.
00352     SetBarStyle(dwStyle & CBRS_ALL|CBRS_HIDE_INPLACE|CBRS_SIZE_DYNAMIC|CBRS_FLOAT_MULTI);
00353
00354     dwStyle &= ~CBRS_ALL;
00355     dwStyle |= WS_VISIBLE|WS_CHILD|WS_CLIPSIBLINGS|WS_CLIPCHILDREN;
00356
00357     m_sizeDesired = m_sizeNormal = sizeDefault;
00358     m_sizeHorz = m_sizeVert = m_sizeFloat = sizeDefault; // Yiannhs : Setup the new sizes as well
00359
00360     // Set flat control bar style.
00361     m_bFlatGripper = m_bFlatBorder = bFlatBorders;
00362
00363     // Yiannhs this seems a better way than mine, to register the double clicks class.
00364     // I have just added the redraw flags i was using in ver 6.06
00365     CString wndClass = ::AfxRegisterWndClass(
00366         CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW, 0, ::GetSysColorBrush(COLOR_BTNFACE));
00367
00368     CRect rect( 0, 0, sizeDefault.cx, sizeDefault.cy );
00369     return CWnd::Create( wndClass, lpszWindowName, dwStyle, rect, pParentWnd, nID );
00370 }

void CCJControlBar::DrawBorders | ( | CDC * | pDC,
 |  | CRect & | rect
 | ) | [protected, virtual]

Definition at line 1027 of file CJControlBar.cpp.

References DrawGripper, IsHorzDocked, IsVertDocked, m_bFlatBorder, m_bToFit, and TRACK_BORDER_SIZE.

Referenced by OnPaint.

01028 {
01029     CRect rc;
01030     rc.CopyRect(&rect);
01031
01032     CRect rcTrack;
01033     rcTrack.CopyRect(&rc);
01034
01035     if(IsVertDocked())
01036     {
01037         if (!m_bToFit) {
01038             rcTrack.top = rc.bottom - TRACK_BORDER_SIZE;
01039             rcTrack.top-=2;
01040             rcTrack.bottom-=1;
01041
01042             //Yiannhs flat interface style
01043             if( !m_bFlatBorder )
01044                 pDC->Draw3dRect(rcTrack, afxData.clrBtnHilite, afxData.clrBtnShadow);
01045             else
01046                 pDC->FillSolidRect(rcTrack, afxData.clrBtnFace);
01047         }
01048     }
01049
01050     else if (IsHorzDocked())
01051     {
01052         if (!m_bToFit) {
01053             rcTrack.left = rc.right - TRACK_BORDER_SIZE;
01054             rcTrack.left-=2;
01055             rcTrack.right-=1;
01056
01057             //Yiannhs flat interface style
01058             if( !m_bFlatBorder )
01059                 pDC->Draw3dRect(rcTrack, afxData.clrBtnHilite, afxData.clrBtnShadow);
01060             else
01061                 pDC->FillSolidRect(rcTrack, afxData.clrBtnFace);
01062         }
01063     }
01064
01065     DrawGripper(pDC);
01066 }

void CCJControlBar::DrawGriperCaption | ( | CDC * | pDC,
 |  | LPRECT | pRect
 | ) | [protected, virtual]

Definition at line 1124 of file CJControlBar.cpp.

References ASSERT, NCOLORSHADES, and NULL.

Referenced by DrawGripper.

01125 {
01126     ASSERT( pDC );
01127     ASSERT( pRect );
01128     if (!IsFloating() && m_bGripper)
01129     {
01130         BOOL m_bIsHorz = IsHorzDocked();
01131         CRect TheRect( pRect );
01132         COLORREF clrBG = GetSysColor(COLOR_ACTIVECAPTION); // background color
01133         int cxCap = 0;
01134         int cyCap = 0;
01135         int rx = TheRect.left;
01136         int ry = TheRect.top;
01137         if( !m_bIsHorz ) {
01138             cxCap = TheRect.Width();
01139             cyCap = TheRect.Height();
01140         } else {
01141             cxCap = TheRect.Height();
01142             cyCap = TheRect.Width();
01143             //            rx = TheRect.top;
01144             //            ry = TheRect.left;
01145         }
01146
01147         int r = GetRValue(clrBG);               // red..
01148         int g = GetGValue(clrBG);               // ..green
01149         int b = GetBValue(clrBG);               // ..blue color vals
01150         int w = cxCap;                          // width of area to shade
01151         int xDelta= max(w/NCOLORSHADES,1);      // width of one shade band
01152         int x = xDelta;
01153         CBrush* pOldBrush = NULL;
01154         {
01155             CBrush brush(RGB(0,0,0));
01156             pOldBrush = pDC->SelectObject(&brush);
01157             if( !m_bIsHorz ) {
01158                 pDC->PatBlt(rx, ry, x, cyCap, PATCOPY);
01159             } else {
01160                 pDC->PatBlt(rx, ry, cyCap, x, PATCOPY);
01161             }
01162             pDC->SelectObject(pOldBrush);
01163
01164             // fix potential resource leak - KStowell - 10-21-99
01165             brush.DeleteObject();
01166         }
01167         int w2  = w*w;                                              // w squared
01168         while( x < cxCap ) {                                       // paint bands right to left
01169             //x += xDelta;                                            // next band
01170             int wmx2 = (w-x)*(w-x);                                 // w minus x squared
01171             COLORREF clr = RGB( r-(r*wmx2)/w2, g-(g*wmx2)/w2, b-(b*wmx2)/w2 );
01172             {
01173                 CBrush brush(clr);
01174                 pDC->SelectObject(&brush);
01175                 if( !m_bIsHorz ) {
01176                     pDC->PatBlt(rx+x, ry, xDelta, cyCap, PATCOPY);
01177                 } else {
01178                     pDC->PatBlt(rx, ry+x, cyCap, xDelta, PATCOPY);
01179                 }
01180                 pDC->SelectObject(pOldBrush);
01181
01182                 // fix potential resource leak - KStowell - 10-21-99
01183                 brush.DeleteObject();
01184             }
01185             x += xDelta;
01186         }
01187         {
01188             CBrush brush(clrBG);
01189             pDC->SelectObject(&brush);
01190             if( !m_bIsHorz ) {
01191                 pDC->PatBlt(rx+x, ry, cxCap-x, cyCap, PATCOPY);
01192             }
01193             else {
01194                 pDC->PatBlt(rx, ry+x, cyCap, cxCap-x, PATCOPY);
01195             }
01196
01197             // fix potential resource leak - KStowell - 10-21-99
01198             brush.DeleteObject();
01199         }
01200         pDC->SelectObject(pOldBrush);
01201     }
01202 }//yiannhs new method ends

void CCJControlBar::DrawGripper ( CDC * pDC ) [protected, virtual]

Definition at line 1204 of file CJControlBar.cpp.

References DrawGriperCaption, GetGripperRect, IsFloating, IsHorzDocked, m_bFlatGripper, and m_bGripper.

Referenced by DrawBorders.

01205 {
01206     //Yiannhs. changed to make evaluations on top. Replaced with flat gradient caption
01207     if (!IsFloating() && m_bGripper)
01208     {
01209         // draw the gripper.
01210         CRect pRect(GetGripperRect());
01211
01212         //Yiannhs New Lines
01213         CRect SecondGrip;
01214         SecondGrip.CopyRect( pRect );
01215         //Yiannhs: use the original beveled style gripper
01216         if (IsHorzDocked()) {
01217             SecondGrip.OffsetRect(4,0);
01218         } else {
01219             SecondGrip.OffsetRect(0,4);
01220         }
01221
01222         //Yiannhs Selective Gripper look
01223         if( !m_bFlatGripper ) {
01224
01225             //Yiannhs: also updated to use AfxData
01226             pDC->FillSolidRect( pRect, afxData.clrBtnShadow  );
01227             pDC->Draw3dRect( pRect, afxData.clrBtnHilite, afxData.clrBtnShadow );
01228
01229             pDC->FillSolidRect( SecondGrip, afxData.clrBtnShadow );
01230             pDC->Draw3dRect( SecondGrip, afxData.clrBtnHilite, afxData.clrBtnShadow );
01231
01232         } else {    //Yiannhs: Use Flat Gripper
01233
01234             CRect FlatRect( pRect.left, pRect.top, SecondGrip.right, SecondGrip.bottom);
01235             if (IsHorzDocked()) {
01236                 FlatRect.DeflateRect(-2,0);
01237             } else {
01238                 FlatRect.DeflateRect(0,-2);
01239             }
01240             DrawGriperCaption( pDC, FlatRect );
01241         }
01242     }
01243 }

void CCJControlBar::EnableDockingOnSizeBar ( DWORD dwDockStyle ) [virtual]

Definition at line 910 of file CJControlBar.cpp.

References ASSERT, and NULL.

Referenced by CMainFrame::InitializeDockingWindows.

00911 {
00912     ASSERT(m_pDockContext == NULL);
00913     m_dwDockStyle = dwDockStyle;
00914
00915     if (m_pDockContext == NULL)
00916         m_pDockContext = new CCJDockContext(this);
00917
00918     if (m_hWndOwner == NULL)
00919         m_hWndOwner = ::GetParent(m_hWnd);
00920 }

void CCJControlBar::EnableFlatLook | ( | BOOL | bGripper,
 |  | BOOL | bBorder,
 |  | BOOL | bButtons
 | ) | [virtual]

Definition at line 332 of file CJControlBar.cpp.

References ASSERT, CCJFlatButton::DisableFlatLook, m_bFlatBorder, m_bFlatGripper, m_btnClose, and m_btnMinim.

00333 {
00334     ASSERT(::IsWindow(m_hWnd));
00335     m_bFlatGripper = bGripper;
00336     m_bFlatBorder  = bBorder;
00337     m_btnClose.DisableFlatLook( bButtons );
00338     m_btnMinim.DisableFlatLook( bButtons );
00339     Invalidate();
00340 }

void CCJControlBar::EnableFlatLook ( BOOL bFlat = TRUE ) [virtual]

Definition at line 327 of file CJControlBar.cpp.

00328 {
00329     EnableFlatLook(bFlat, bFlat, bFlat);
00330 }

_CJXLIB_INLINE void CCJControlBar::EnableSaveState ( bool bAutoSave = true ) [virtual]

Definition at line 536 of file CJControlBar.h.

References ASSERT, and m_bAutoSave.

00537     { ASSERT(::IsWindow(m_hWnd)); m_bAutoSave = bAutoSave; }

void CCJControlBar::EraseNonClient ( ) [protected, virtual]

Definition at line 1012 of file CJControlBar.cpp.

Referenced by OnNcPaint.

01013 {
01014     CWindowDC dc(this);
01015
01016     CRect rectClient;
01017     GetClientRect(rectClient);
01018     CRect rectWindow;
01019     GetWindowRect(rectWindow);
01020     ScreenToClient(rectWindow);
01021     rectClient.OffsetRect(-rectWindow.left, -rectWindow.top);
01022
01023     dc.ExcludeClipRect(rectClient);
01024     rectWindow.OffsetRect(-rectWindow.left, -rectWindow.top);
01025 }

CRect CCJControlBar::GetButtonRect ( ) [protected, virtual]

Definition at line 1245 of file CJControlBar.cpp.

References IsHorzDocked.

Referenced by OnWindowPosChanged.

01246 {
01247     CRect rect;
01248     GetClientRect(&rect);
01249     rect.OffsetRect(-rect.left,-rect.top);
01250
01251     if (IsHorzDocked()) {
01252         rect.top     += 3;
01253         rect.bottom = rect.top+12;
01254         rect.left  += 2;
01255         rect.right  = rect.left+12;
01256     }
01257
01258     else {
01259         rect.right -= 19;
01260         rect.left   = rect.right-12;
01261         rect.top   += 3;
01262         rect.bottom = rect.top+12;
01263     }
01264
01265     return rect;
01266 }

void CCJControlBar::GetChildRect ( CRect & rect ) [virtual]

Reimplemented in CCJExplorerBar.

Definition at line 980 of file CJControlBar.cpp.

References GetMinExt, IsFloating, IsVertDocked, m_bToFit, m_cxOffset, and TRACK_BORDER_SIZE.

Referenced by CCJTabCtrlBar::GetChildRect, OnPaint, and OnWindowPosChanged.

00981 {
00982     GetClientRect(&rect);
00983
00984     if (IsFloating()) {
00985         rect.DeflateRect(3,3);
00986     } else {
00987         if (IsVertDocked()) {
00988             rect.DeflateRect(m_cxOffset, 0);
00989             rect.top += (GetMinExt()-5);
00990             //Yiannhs: if it is the last bar inside a dockbar, cover the whole space
00991             if( !m_bToFit ) {
00992                 rect.bottom -= (TRACK_BORDER_SIZE + 4);
00993             } else {
00994                 rect.bottom -= 4;
00995             }
00996         } else {
00997             rect.left   += (GetMinExt()-5);
00998             //Yiannhs: if it is the last bar inside a dockbar, cover the whole space
00999             if( !m_bToFit ) {
01000                 rect.right  -= (TRACK_BORDER_SIZE + 4);
01001             } else {
01002                 rect.right  -= 4;
01003             }
01004             rect.DeflateRect(0, m_cxOffset);
01005         }
01006
01007         if( rect.left > rect.right || rect.top > rect.bottom )
01008             rect = CRect(0,0,0,0);
01009     }
01010 }

CRect CCJControlBar::GetGripperRect ( ) [protected, virtual]

Definition at line 1268 of file CJControlBar.cpp.

References IsHorzDocked, and m_bButtons.

Referenced by DrawGripper.

01269 {
01270     CRect rect;
01271     GetClientRect(&rect);
01272     rect.OffsetRect(-rect.left,-rect.top);
01273
01274     if (IsHorzDocked()) {
01275         rect.DeflateRect(3,3);
01276         rect.left   += 1;
01277         rect.right  = rect.left+3;
01278         rect.bottom -= 1;
01279         rect.top    += m_bButtons?30:1;
01280     }
01281
01282     else {
01283         rect.DeflateRect(4,4);
01284         rect.top     += 2;
01285         rect.bottom  = rect.top+3;
01286         rect.right   -= m_bButtons?30:2;
01287     }
01288
01289     return rect;
01290 }

_CJXLIB_INLINE int CCJControlBar::GetHorzSize ( ) [virtual]

Definition at line 542 of file CJControlBar.h.

References ASSERT, and m_sizeDesired.

00543     { ASSERT(::IsWindow(m_hWnd)); return m_sizeDesired.cy; }

_CJXLIB_INLINE UINT CCJControlBar::GetMenuID ( ) [virtual]

Definition at line 545 of file CJControlBar.h.

References ASSERT, and m_popupMenuID.

00546     { ASSERT(::IsWindow(m_hWnd)); return m_popupMenuID; }

int CCJControlBar::GetMinExt ( ) [virtual]

Definition at line 964 of file CJControlBar.cpp.

References GRIP_INTRASPACING, GRIP_SIZE, GRIP_START, m_bButtons, m_bGripper, and TRACK_BORDER_SIZE.

Referenced by GetChildRect, CCJSizeDockBar::Maximize, Minimize, and OnLButtonUp.

00965 {
00966     int nRet = TRACK_BORDER_SIZE;
00967
00968     if (m_bGripper || m_bButtons) {
00969         nRet += GRIP_START;
00970         nRet += GRIP_SIZE*2;
00971         nRet += GRIP_INTRASPACING*3+2;
00972     }
00973
00974     else
00975         nRet += 2;
00976
00977     return nRet;
00978 }

_CJXLIB_INLINE int CCJControlBar::GetVertSize ( ) [virtual]

Definition at line 539 of file CJControlBar.h.

References ASSERT, and m_sizeDesired.

00540     { ASSERT(::IsWindow(m_hWnd)); return m_sizeDesired.cx; }

void CCJControlBar::HitTest ( CPoint & point ) [protected, virtual]

Definition at line 1068 of file CJControlBar.cpp.

References IDC_HSPLITBAR, IDC_VSPLITBAR, IsHorzDocked, IsVertDocked, m_bDragging, m_bOkToDrag, m_bToFit, NULL, and TRACK_BORDER_SIZE.

Referenced by OnMouseMove.

01069 {
01070     CRect rcWin;
01071     GetClientRect(&rcWin);
01072     HCURSOR hCur = ::LoadCursor(NULL,IDC_ARROW);
01073
01074     if( !m_bDragging )
01075     {
01076         if (IsVertDocked()) {
01077             rcWin.top = rcWin.bottom - TRACK_BORDER_SIZE;
01078             m_bOkToDrag = (rcWin.PtInRect(point) && !m_bToFit);
01079             if(m_bOkToDrag) {
01080                 hCur = AfxGetApp()->LoadCursor(IDC_VSPLITBAR);
01081             }
01082         }
01083
01084         else if (IsHorzDocked()) {
01085             rcWin.left = rcWin.right - TRACK_BORDER_SIZE;
01086             m_bOkToDrag = (rcWin.PtInRect(point) && !m_bToFit);
01087             if(m_bOkToDrag) {
01088                 hCur = AfxGetApp()->LoadCursor(IDC_HSPLITBAR);
01089             }
01090         }
01091
01092         SetCursor(hCur);
01093     }
01094 }

_CJXLIB_INLINE BOOL CCJControlBar::IsBottomDocked ( ) const [virtual]

Definition at line 563 of file CJControlBar.h.

References AFX_IDW_SIZEBAR_BOTTOM, and ASSERT.

Referenced by IsHorzDocked, and CCJSizeDockBar::Maximize.

00564     { ASSERT(::IsWindow(m_hWnd)); return (GetParent()->GetDlgCtrlID()==AFX_IDW_SIZEBAR_BOTTOM); }

_CJXLIB_INLINE BOOL CCJControlBar::IsFloating ( ) const [virtual]

Definition at line 575 of file CJControlBar.h.

References ASSERT, IsHorzDocked, and IsVertDocked.

Referenced by CalcDynamicLayout, DrawGripper, CCJTabCtrlBar::GetChildRect, CCJExplorerBar::GetChildRect, GetChildRect, OnLButtonDown, OnRButtonDown, OnUpdateCmdUI, CCJExplorerBar::OnWindowPosChanged, OnWindowPosChanged, and SaveBarState.

00576     { ASSERT(::IsWindow(m_hWnd)); return (!IsHorzDocked() && !IsVertDocked()); }

_CJXLIB_INLINE BOOL CCJControlBar::IsHorzDocked ( ) const [virtual]

Definition at line 560 of file CJControlBar.h.

References ASSERT, IsBottomDocked, and IsTopDocked.

Referenced by CalcDynamicLayout, DrawBorders, DrawGripper, GetButtonRect, GetGripperRect, HitTest, IsFloating, Maximize, Minimize, Normalize, OnLButtonUp, OnMouseMove, OnUpdateCmdUI, OnWindowPosChanged, and SaveBarState.

00561     { ASSERT(::IsWindow(m_hWnd)); return (IsTopDocked() || IsBottomDocked()); }

_CJXLIB_INLINE BOOL CCJControlBar::IsLeftDocked ( ) const [virtual]

Definition at line 572 of file CJControlBar.h.

References AFX_IDW_SIZEBAR_LEFT, and ASSERT.

Referenced by IsVertDocked, and CCJSizeDockBar::Maximize.

00573     { ASSERT(::IsWindow(m_hWnd)); return (GetParent()->GetDlgCtrlID()==AFX_IDW_SIZEBAR_LEFT); }

_CJXLIB_INLINE BOOL CCJControlBar::IsRightDocked ( ) const [virtual]

Definition at line 569 of file CJControlBar.h.

References AFX_IDW_SIZEBAR_RIGHT, and ASSERT.

Referenced by IsVertDocked, and CCJSizeDockBar::Maximize.

00570     { ASSERT(::IsWindow(m_hWnd)); return (GetParent()->GetDlgCtrlID()==AFX_IDW_SIZEBAR_RIGHT); }

_CJXLIB_INLINE BOOL CCJControlBar::IsTopDocked ( ) const [virtual]

Definition at line 566 of file CJControlBar.h.

References AFX_IDW_SIZEBAR_TOP, and ASSERT.

Referenced by IsHorzDocked, and CCJSizeDockBar::Maximize.

00567     { ASSERT(::IsWindow(m_hWnd)); return (GetParent()->GetDlgCtrlID()==AFX_IDW_SIZEBAR_TOP); }

_CJXLIB_INLINE BOOL CCJControlBar::IsVertDocked ( ) const [virtual]

Definition at line 557 of file CJControlBar.h.

References ASSERT, IsLeftDocked, and IsRightDocked.

Referenced by CalcDynamicLayout, DrawBorders, CCJExplorerBar::GetChildRect, GetChildRect, HitTest, IsFloating, Maximize, Minimize, Normalize, CCJExplorerBar::OnEraseBkgnd, OnLButtonDown, OnLButtonUp, OnMouseMove, and CCJExplorerBar::OnWindowPosChanged.

00558     { ASSERT(::IsWindow(m_hWnd)); return (IsLeftDocked() || IsRightDocked()); }

void CCJControlBar::LoadBarState | ( | CSize & | size,
 |  | int | nID
 | ) | [protected, virtual]

Definition at line 1420 of file CJControlBar.cpp.

References m_bFloating, m_nID, and m_strSection.

Referenced by Create.

01421 {
01422     m_nID = nID;
01423     int nIndex = 0;
01424     CWinApp* pApp = AfxGetApp();
01425
01426     // attempt to loop through all of the defaults stored in the
01427     // system until we find our control id.
01428     while( TRUE )
01429     {
01430         // start at 0 and search for a match to our control bars
01431         // resource id. If one was not found, return.
01432         m_strSection.Format(_T("Bar State-Bar%d"), nIndex);
01433         int nBarID = pApp->GetProfileInt( m_strSection, _T("BarID"), -1 );
01434
01435         // couldn't find a match, just bail...
01436         if( nBarID == -1 ) {
01437             TRACE1( "Warning: Could not find registry information for control bar ID %d\n", m_nID );
01438             return;
01439         }
01440
01441         // we have a match, read the information that was stored, and
01442         // update the CRect object that was passed in.
01443         if( nBarID == m_nID ) {
01444             //m_strSection += _T("\\CodeJock"); //JK - removed to fix the Bar savings, replaced by the code below... The fix taken from CodeJock Website Discussion board
01445             m_strSection.Format ( _T("CodeJock Bar State-Bar%d"), nIndex ) ;    //JK
01446
01447             size.cx     = pApp->GetProfileInt( m_strSection, _T("MRUDesiredCX"), size.cx );
01448             size.cy     = pApp->GetProfileInt( m_strSection, _T("MRUDesiredCY"), size.cy );
01449             m_bFloating = pApp->GetProfileInt( m_strSection, _T("MRUFloating" ), m_bFloating );
01450             return;
01451         }
01452
01453         // increment count.
01454         ++nIndex;
01455     }
01456 }

void CCJControlBar::Maximize ( int size ) [virtual]

Definition at line 922 of file CJControlBar.cpp.

References IsHorzDocked, IsVertDocked, m_bMaximized, m_sizeDesired, m_sizeNormal, and TRUE.

Referenced by CCJSizeDockBar::Maximize.

00923 {
00924     m_sizeNormal = m_sizeDesired;
00925     if (IsHorzDocked()) {
00926         m_sizeDesired.cx = size;
00927     }
00928
00929     else if (IsVertDocked()) {
00930         m_sizeDesired.cy = size;
00931     }
00932
00933     m_bMaximized = TRUE;
00934 }

void CCJControlBar::Minimize ( ) [virtual]

Definition at line 936 of file CJControlBar.cpp.

References FALSE, GetMinExt, IsHorzDocked, IsVertDocked, m_bMaximized, m_sizeDesired, and m_sizeNormal.

Referenced by CCJSizeDockBar::Maximize.

00937 {
00938     m_sizeNormal = m_sizeDesired;
00939
00940     if (IsHorzDocked()) {
00941         m_sizeDesired.cx = GetMinExt();
00942     }
00943
00944     else if (IsVertDocked()) {
00945         m_sizeDesired.cy = GetMinExt();
00946     }
00947
00948     m_bMaximized = FALSE;
00949 }

void CCJControlBar::Normalize ( ) [virtual]

Definition at line 951 of file CJControlBar.cpp.

References FALSE, IsHorzDocked, IsVertDocked, m_bMaximized, m_sizeDesired, and m_sizeNormal.

Referenced by CCJSizeDockBar::Normalize.

00952 {
00953     if (IsHorzDocked()) {
00954         m_sizeDesired.cx = m_sizeNormal.cx;
00955     }
00956
00957     else if (IsVertDocked()) {
00958         m_sizeDesired.cy = m_sizeNormal.cy;
00959     }
00960
00961     m_bMaximized = FALSE;
00962 }

void CCJControlBar::OnButtonClose ( ) [protected]

Reimplemented in CCJExplorerBar.

Definition at line 879 of file CJControlBar.cpp.

References FALSE.

00880 {
00881     GetDockingFrame()->ShowControlBar(this,FALSE,FALSE);
00882 }

void CCJControlBar::OnButtonMinimize ( ) [protected]

Definition at line 889 of file CJControlBar.cpp.

References FALSE, m_bMaximized, and TRUE.

00890 {
00891     if (!m_bMaximized) {
00892         ((CCJSizeDockBar *)GetParent())->Maximize(this);
00893         m_bMaximized = TRUE;
00894     }
00895
00896     else {
00897         ((CCJSizeDockBar *)GetParent())->Normalize(this);
00898         m_bMaximized = FALSE;
00899     }
00900 }

int CCJControlBar::OnCreate ( LPCREATESTRUCT lpCreateStruct ) [protected]

Reimplemented in CCJExplorerBar.

Definition at line 688 of file CJControlBar.cpp.

References CCJFlatButton::DisableFlatLook, IDC_BUTTON_HIDE, IDC_BUTTON_MINI, IDS_EXPAND, IDS_HIDE, m_bFlatBorder, m_bFlatGripper, m_btnClose, m_btnMinim, m_hIcon, m_ImageList, m_ToolTip, NULL, CCJFlatButton::SetIcon, and TRUE.

Referenced by CBarConsole::OnCreate, CCJTabCtrlBar::OnCreate, and CCJExplorerBar::OnCreate.

00689 {
00690     if (CControlBar::OnCreate(lpCreateStruct) == -1)
00691         return -1;
00692
00693     if (m_bButtons)
00694     {
00695         if(!m_btnClose.Create(NULL, WS_CHILD | WS_VISIBLE | WS_TABSTOP |
00696             BS_NOTIFY | BS_OWNERDRAW | BS_ICON,
00697             CRect(0,0,0,0), this, IDC_BUTTON_HIDE ))
00698         {
00699             TRACE0( "Unable to create close button\n" );
00700             return -1;
00701         }
00702
00703
00704         if(!m_btnMinim.Create(NULL, WS_CHILD | WS_VISIBLE | WS_TABSTOP |
00705             BS_NOTIFY | BS_OWNERDRAW | BS_ICON,
00706             CRect(0,0,0,0), this, IDC_BUTTON_MINI ))
00707         {
00708             TRACE0( "Unable to create minimize button\n" );
00709             return -1;
00710         }
00711
00712         // Yiannhs Selective flat style interface. The difference is in adding the if statement
00713         if( !m_bFlatBorder && !m_bFlatGripper ) {
00714             m_btnClose.DisableFlatLook();
00715             m_btnMinim.DisableFlatLook();
00716         }
00717
00718         m_hIcon = m_ImageList.ExtractIcon(0);
00719         m_btnClose.SetIcon(m_hIcon, CSize(10,10));
00720
00721         // Create the ToolTip control.
00722         m_ToolTip.Create(this);
00723         m_ToolTip.Activate(TRUE);
00724         m_ToolTip.AddTool (&m_btnClose, IDS_HIDE);
00725         m_ToolTip.AddTool (&m_btnMinim, IDS_EXPAND);
00726     }
00727
00728     return 0;
00729 }

BOOL CCJControlBar::OnEraseBkgnd ( CDC * pDC ) [protected]

Reimplemented in CCJExplorerBar.

Definition at line 681 of file CJControlBar.cpp.

References TRUE.

00682 {
00683     // KStowell - overridden for flicker-free drawing.
00684     UNUSED_ALWAYS(pDC);
00685     return TRUE;
00686 }

void CCJControlBar::OnInitMenuPopup | ( | CMenu * | pPopupMenu,
 |  | UINT | nIndex,
 |  | BOOL | bSysMenu
 | ) | [protected]

Definition at line 1363 of file CJControlBar.cpp.

References CCJMenu::IsMenu, m_popupMenu, and CCJMenu::UpdateMenu.

01364 {
01365     CControlBar::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
01366
01367     if(!bSysMenu) {
01368         if (m_popupMenu.IsMenu(pPopupMenu)) {
01369             CCJMenu::UpdateMenu(pPopupMenu);
01370         }
01371     }
01372 }

void CCJControlBar::OnInvertTracker ( const CRect & rect ) [protected, virtual]

Definition at line 1096 of file CJControlBar.cpp.

References ASSERT, and NULL.

Referenced by OnLButtonDown, OnLButtonUp, and OnMouseMove.

01097 {
01098     ASSERT_VALID(this);
01099     ASSERT(!rect.IsRectEmpty());
01100
01101     CDC* pDC = GetDockingFrame()->GetDC();
01102     CBrush* pBrush = CDC::GetHalftoneBrush();
01103     CBrush* pOldBrush = NULL;
01104
01105     if (pBrush != NULL) {
01106         pOldBrush = pDC->SelectObject(pBrush);
01107     }
01108
01109     pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATINVERT);
01110
01111     if (pOldBrush != NULL) {
01112         pDC->SelectObject(pOldBrush);
01113     }
01114     GetDockingFrame()->ReleaseDC(pDC);
01115 }

void CCJControlBar::OnLButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Reimplemented in CCJExplorerBar.

Definition at line 795 of file CJControlBar.cpp.

References IsFloating, IsVertDocked, m_bDragging, m_ptCurDrag, m_ptStartDrag, m_rcTrack, NULL, OnInvertTracker, TRACK_BORDER_SIZE, and TRUE.

00796 {
00797     // Yiannhs. When the bar is inside a mdiframe window, and click on area
00798     // the inner child does not cover, the whole area is grayed!!!
00799
00800     if( IsFloating( )) //see Tab ControlBar
00801     {
00802         // If the window is floating, we want to
00803         // bring it up to the top.
00804         SetFocus();
00805         SetWindowPos( NULL, 0,0,0,0,
00806             SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW );
00807         return;
00808     }
00809
00810     if (m_bOkToDrag)
00811     {
00812         CFrameWnd *pFrame=GetDockingFrame();
00813         GetClientRect(m_rcTrack);
00814
00815         if (IsVertDocked()) {
00816             // Yiannhs
00817             m_rcTrack.top = m_rcTrack.bottom - TRACK_BORDER_SIZE -2;
00818             m_rcTrack.bottom-=2;
00819         }
00820 //1999-05-19 Yiannhs. do not call one more function
00821         else { //if (IsHorzDocked()) {
00822             // Yiannhs
00823             m_rcTrack.left = m_rcTrack.right - TRACK_BORDER_SIZE -2;
00824             m_rcTrack.right-=2;
00825         }
00826
00827         ClientToScreen(&m_rcTrack);
00828         pFrame->ScreenToClient(&m_rcTrack);
00829         ClientToScreen(&point);
00830         pFrame->ScreenToClient(&point);
00831
00832         m_ptStartDrag = point;
00833         m_ptCurDrag = point;
00834
00835         SetCapture();
00836         m_bDragging = TRUE;
00837         OnInvertTracker(m_rcTrack);
00838     }
00839
00840     else if (m_pDockBar) {
00841         if (OnToolHitTest(point, NULL) == -1) {
00842             ClientToScreen(&point);
00843 //1999-05-26 Yiannhs
00844 //          Handle the message loop before CDockContext
00845             MSG msg;
00846             ValidateRect( NULL );   //Make sure this control bar will not ask for Paint messages later
00847             HWND    hwnd = NULL;
00848             while (::PeekMessage(&msg, NULL, WM_PAINT, WM_PAINT, PM_REMOVE))
00849             {   //ask for messages in any window of the application, and remove those
00850                 DispatchMessage( &msg );
00851                 if( msg.hwnd != this->m_hWnd ) {
00852                     hwnd = msg.hwnd;    //keep the window which receives paint messages
00853                     break;              //exit the loop
00854                 }
00855             }
00856
00857             if( hwnd ) {    //if a window is getting Paint messages work on it
00858                 ::ValidateRect( hwnd, NULL );   //the window does not need painting
00859                 ::ValidateRect( ::GetParent( hwnd ), NULL );    //Its parent window as well
00860                 while (::PeekMessage(&msg, NULL, WM_PAINT, WM_PAINT, PM_REMOVE)) {
00861                     //work on the Paint messages once more
00862                     ::TranslateMessage( &msg );
00863                     ::DispatchMessage( &msg );
00864                 }
00865             }
00866
00867 //1999-05-26 Yiannhs
00868
00869             ((CCJDockContext*)m_pDockContext)->StartDragDockBar(point);
00870         }
00871     }
00872
00873     // Yiannhs
00874     else {
00875         CControlBar::OnLButtonDown(nFlags, point);
00876     }
00877 }

void CCJControlBar::OnLButtonUp | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Reimplemented in CCJExplorerBar.

Definition at line 611 of file CJControlBar.cpp.

References FALSE, GetMinExt, IsHorzDocked, IsVertDocked, m_bDragging, m_ptCurDrag, m_ptStartDrag, m_rcTrack, m_sizeDesired, m_sizeHorz, m_sizeNormal, m_sizeVert, and OnInvertTracker.

00612 {
00613     if( m_bDragging )
00614     {
00615         ReleaseCapture();
00616         OnInvertTracker(m_rcTrack);
00617 //1999-05-19 Yiannhs. Moved the statement below
00618         //m_bDragging = FALSE;
00619
00620         // Yiannhs: reduce unnessesary actions. Ok It works
00621  //1999-05-19 Yiannhs. Changed according to the statement above
00622         if( m_ptCurDrag == m_ptStartDrag ) {
00623             m_bDragging = FALSE;
00624             return;
00625         }
00626
00627         if(IsVertDocked()) {
00628             int newHeight = m_rcTrack.top-m_ptStartDrag.y;
00629             m_sizeDesired.cy += newHeight;
00630             m_sizeDesired.cy = m_sizeDesired.cy > GetMinExt() ? m_sizeDesired.cy : GetMinExt();
00631             // Yiannhs: there is a comment in the previous version for change. This is the Line
00632             // This is probably for sizing with many control bars in dock bar
00633             // m_sizeDesired.cy = m_sizeDesired.cy > rectAvail.Height() ? rectAvail.Height() : m_sizeDesired.cy;
00634
00635 //1999-05-19 Yiannhs. Assign unused sizes
00636             m_sizeVert = m_sizeDesired;
00637         }
00638
00639         else { //if (IsHorzDocked()) {  //1999-05-19. Floating control bars do not receive this message
00640
00641             int newWidth = m_rcTrack.left-m_ptStartDrag.x;
00642             m_sizeDesired.cx += newWidth;
00643             m_sizeDesired.cx = m_sizeDesired.cx > GetMinExt() ? m_sizeDesired.cx : GetMinExt();
00644             // Yiannhs: there is a comment in the previous version for change. This is the Line
00645             // This is probably for sizing with many control bars in dock bar
00646             // m_sizeDesired.cx = m_sizeDesired.cx > rectAvail.Width() ? rectAvail.Width() : m_sizeDesired.cx;
00647
00648 //1999-05-19 Yiannhs. Assign unused sizes
00649             m_sizeHorz = m_sizeDesired;
00650         }
00651
00652 //1999-05-19    Yiannhs
00653         //((CCJSizeDockBar *)GetParent())->CalcSizeBarLayout();
00654         //resizing a control bar, means, that the DockBar should be normalized.
00655         //and normalize does the layout
00656         m_sizeNormal = m_sizeDesired;       //set the new normal size here
00657         ((CCJSizeDockBar *)GetParent())->Normalize( this );
00658         m_bDragging = FALSE;        //flag off the drag action now. The movement has been complited
00659                                     //so as I can check it on change position
00660         CRect rc;                   // Now Use The Size of the control bar to fill the right sizes.
00661         GetWindowRect( rc );
00662         if( IsHorzDocked() )
00663             m_sizeNormal.cy = m_sizeHorz.cy = m_sizeDesired.cy = rc.Height();
00664         else
00665             m_sizeNormal.cx = m_sizeVert.cx = m_sizeDesired.cx = rc.Width();
00666 //1999-05-19    Yiannhs
00667
00668     }
00669
00670     else {
00671         // Yiannhs: again don't go to default handler if we have already handled the message
00672         CControlBar::OnLButtonUp(nFlags, point);
00673     }
00674 }

void CCJControlBar::OnMeasureItem | ( | int | nIDCtl,
 |  | LPMEASUREITEMSTRUCT | lpMeasureItemStruct
 | ) | [protected]

Definition at line 1337 of file CJControlBar.cpp.

References CCJMenu::IsMenu, m_popupMenu, and CCJMenu::MeasureItem.

01338 {
01339     if (lpMeasureItemStruct->CtlType == ODT_MENU)
01340     {
01341         if (IsMenu((HMENU)lpMeasureItemStruct->itemID)) {
01342             CMenu* pMenu = CMenu::FromHandle((HMENU)lpMeasureItemStruct->itemID);
01343
01344             if (m_popupMenu.IsMenu(pMenu)) {
01345                 m_popupMenu.MeasureItem(lpMeasureItemStruct);
01346                 return;
01347             }
01348         }
01349     }
01350
01351     CControlBar::OnMeasureItem(nIDCtl, lpMeasureItemStruct);
01352 }

LRESULT CCJControlBar::OnMenuChar | ( | UINT | nChar,
 |  | UINT | nFlags,
 |  | CMenu * | pMenu
 | ) | [protected]

Definition at line 1354 of file CJControlBar.cpp.

References CCJMenu::FindKeyboardShortcut, CCJMenu::IsMenu, and m_popupMenu.

01355 {
01356     if (m_popupMenu.IsMenu(pMenu)) {
01357         return CCJMenu::FindKeyboardShortcut(nChar, nFlags, pMenu);
01358     }
01359
01360     return CControlBar::OnMenuChar(nChar, nFlags, pMenu);
01361 }

void CCJControlBar::OnMouseMove | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 556 of file CJControlBar.cpp.

References ASSERT, HitTest, IsHorzDocked, IsVertDocked, m_ptCurDrag, m_rcTrack, NULL, and OnInvertTracker.

00557 {
00558     HitTest(point);
00559     CRect rectDock;
00560     if( m_bDragging )
00561     {
00562         ASSERT(GetParent() != NULL);
00563
00564         GetParent()->GetClientRect(&rectDock);
00565         ClientToScreen(&rectDock);
00566         ClientToScreen(&point);
00567
00568         CFrameWnd *pFrame=GetDockingFrame();
00569         ASSERT(pFrame != NULL);
00570
00571         pFrame -> ScreenToClient(&point);
00572         pFrame->ScreenToClient(&rectDock);
00573
00574         point.x = point.x>rectDock.right ? rectDock.right:point.x;
00575         point.x = point.x<rectDock.left ? rectDock.left:point.x;
00576         point.y = point.y>rectDock.bottom ? rectDock.bottom:point.y;
00577         point.y = point.y<rectDock.top ? rectDock.top:point.y;
00578
00579         OnInvertTracker(m_rcTrack);
00580         int deltaX = point.x-m_ptCurDrag.x;
00581         int deltaY = point.y-m_ptCurDrag.y;
00582
00583         if(IsVertDocked()) {
00584             m_rcTrack.top += deltaY;
00585             m_rcTrack.bottom += deltaY;
00586         }
00587
00588         else if (IsHorzDocked()) {
00589             m_rcTrack.left += deltaX;
00590             m_rcTrack.right += deltaX;
00591         }
00592
00593         OnInvertTracker(m_rcTrack);
00594         m_ptCurDrag = point;
00595     }
00596
00597     else {
00598         // Yiannhs: Do not let default handler go on, if we have worked with the message
00599         CControlBar::OnMouseMove(nFlags, point);
00600     }
00601 }

UINT CCJControlBar::OnNcHitTest ( CPoint point ) [protected]

Definition at line 676 of file CJControlBar.cpp.

00677 {
00678     return HTCLIENT;
00679 }

void CCJControlBar::OnNcPaint ( ) [protected]

Definition at line 500 of file CJControlBar.cpp.

References EraseNonClient.

00501 {
00502     EraseNonClient();
00503 }

void CCJControlBar::OnPaint ( ) [protected]

Definition at line 505 of file CJControlBar.cpp.

References DrawBorders, GetChildRect, m_eChildBorder, NONE, OUTLINE, RAISED, and SUNKEN.

00506 {
00507     CPaintDC dc(this); // device context for painting
00508
00509     // Get the client rect.
00510     CRect rcClient;
00511     GetClientRect( &rcClient );
00512
00513     // Create a memory device-context. This is done to help reduce
00514     // screen flicker, since we will paint the entire control to the
00515     // off screen device context first.
00516     CDC memDC;
00517     CBitmap bitmap;
00518     memDC.CreateCompatibleDC(&dc);
00519     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00520     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00521
00522     // repaint the background.
00523     memDC.FillSolidRect( rcClient, afxData.clrBtnFace );
00524     DrawBorders(&memDC, rcClient);
00525
00526     // draw a border around the child area.
00527     if( m_eChildBorder != NONE )
00528     {
00529         CRect rect;
00530         GetChildRect(rect);
00531
00532         if( m_eChildBorder == OUTLINE ) {
00533             memDC.Draw3dRect(rect, afxData.clrWindowFrame, afxData.clrWindowFrame);
00534         } else if( m_eChildBorder == SUNKEN ) {
00535             rect.InflateRect(1,1);
00536             memDC.Draw3dRect(rect, afxData.clrBtnShadow, afxData.clrBtnHilite);
00537             rect.DeflateRect(1,1);
00538             memDC.Draw3dRect(rect, afxData.clrWindowFrame, afxData.clrBtnFace);
00539         } else if( m_eChildBorder == RAISED ) {
00540             rect.InflateRect(1,1);
00541             memDC.Draw3dRect(rect, afxData.clrBtnHilite, afxData.clrWindowFrame);
00542             rect.DeflateRect(1,1);
00543             memDC.Draw3dRect(rect, afxData.clrBtnFace, afxData.clrBtnShadow);
00544         }
00545     }
00546
00547     // copy the memory device context back into the original DC via BitBlt().
00548     dc.BitBlt(rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), &memDC, 0,0, SRCCOPY);
00549
00550     // cleanup resources.
00551     memDC.SelectObject(pOldBitmap);
00552     memDC.DeleteDC();
00553     bitmap.DeleteObject();
00554 }

void CCJControlBar::OnRButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 1292 of file CJControlBar.cpp.

References ASSERT, CCJMenu::DestroyMenu, IsFloating, CCJMenu::LoadMenu, CCJMenu::LoadToolbar, m_nPos, m_popToolbarID, m_popupMenu, m_popupMenuID, NULL, and VERIFY.

01293 {
01294     // No menu was defined...
01295     if (!m_popupMenuID) {
01296         TRACE0( "Warning: No menu resource was associated with CCJControlBar.\n" );
01297     }
01298
01299     else
01300     {
01301         SetCapture();
01302
01303         // Since we are using the main window as the
01304         // parent, we need to convert the point to screen
01305         // coordinates...
01306         CPoint pt = point;
01307         ClientToScreen(&pt);
01308
01309         // Load the popup menu.
01310         VERIFY(m_popupMenu.LoadMenu(m_popupMenuID));
01311         CCJMenu* pPopup = (CCJMenu*)m_popupMenu.GetSubMenu(m_nPos);
01312         ASSERT(pPopup != NULL);
01313
01314         // Load toolbar resource if any for menu icons.
01315         if (m_popToolbarID) {
01316             pPopup->LoadToolbar(m_popToolbarID);
01317         }
01318
01319         //Yiannhs: When right clicking on a floating controlbar, the menu is inactive,
01320         //         this is due to the MiniFrame  apart from being a child is also
01321         //          a Frame Window. and only the main window handles the Bitmap menus
01322         //pWndPopupOwner = GetParentFrame();
01323         CWnd* pWndPopupOwner = GetParentFrame();    //this;
01324         if( IsFloating() )
01325             pWndPopupOwner = pWndPopupOwner->GetParentFrame();
01326
01327         // Display the popup menu, use the main window as its parent.
01328         pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
01329             pt.x, pt.y, pWndPopupOwner);
01330
01331         m_popupMenu.DestroyMenu();
01332
01333         ReleaseCapture();
01334     }
01335 }

BOOL CCJControlBar::OnSetCursor | ( | CWnd * | pWnd,
 |  | UINT | nHitTest,
 |  | UINT | message
 | ) | [protected]

Definition at line 603 of file CJControlBar.cpp.

References FALSE, m_bDragging, and m_bOkToDrag.

00604 {
00605     return (!m_bOkToDrag && !m_bDragging)?
00606         CControlBar::OnSetCursor(pWnd, nHitTest, message):FALSE;
00607 }

void CCJControlBar::OnUpdateButtonClose ( CCmdUI * pCmdUI ) [protected]

Reimplemented in CCJExplorerBar.

Definition at line 884 of file CJControlBar.cpp.

00885 {
00886     pCmdUI->Enable();
00887 }

void CCJControlBar::OnUpdateButtonMinimize ( CCmdUI * pCmdUI ) [protected]

Definition at line 902 of file CJControlBar.cpp.

00903 {
00904     pCmdUI->Enable();
00905 }

void CCJControlBar::OnUpdateCmdUI | ( | CFrameWnd * | pTarget,
 |  | BOOL | bDisableIfNoHndler
 | ) | [virtual]

Definition at line 381 of file CJControlBar.cpp.

References _destroyIcon, BTN_IMG_INDEX, FALSE, IDS_CONTRACT, IDS_EXPAND, IsFloating, IsHorzDocked, m_bButtons, m_bMaximized, m_btnMinim, m_eAuxIndex, m_hAuxIcon, m_ImageList, m_ToolTip, MAXI_H_DISABLE, MAXI_H_ENABLED, MAXI_V_DISABLE, MAXI_V_ENABLED, NORM_H_ENABLED, NORM_V_ENABLED, NULL, CCJFlatButton::SetIcon, and TRUE.

00382 {
00383     UNUSED_ALWAYS(pTarget);
00384     UNUSED_ALWAYS(bDisableIfNoHndler);
00385
00386     if((m_bButtons == FALSE) || IsFloating()) {
00387         return;
00388     }
00389
00390     BOOL            bEnable     = FALSE;
00391     UINT            uIDText     = NULL;
00392     BTN_IMG_INDEX   eAuxIndex   = m_eAuxIndex;
00393
00394     if (IsHorzDocked()) {
00395         if (m_bUnique) {
00396             uIDText   = IDS_EXPAND;
00397             eAuxIndex = MAXI_H_DISABLE;
00398             bEnable   = FALSE;
00399         } else if (!m_bMaximized) {
00400             uIDText   = IDS_EXPAND;
00401             eAuxIndex = MAXI_H_ENABLED;
00402             bEnable   = TRUE;
00403         } else {
00404             uIDText   = IDS_CONTRACT;
00405             eAuxIndex = NORM_H_ENABLED;
00406             bEnable   = TRUE;
00407         }
00408     } else {
00409         if (m_bUnique) {
00410             uIDText   = IDS_EXPAND;
00411             eAuxIndex = MAXI_V_DISABLE;
00412             bEnable   = FALSE;
00413         } else if (!m_bMaximized) {
00414             uIDText   = IDS_EXPAND;
00415             eAuxIndex = MAXI_V_ENABLED;
00416             bEnable   = TRUE;
00417         } else {
00418             uIDText   = IDS_CONTRACT;
00419             eAuxIndex = NORM_V_ENABLED;
00420             bEnable   = TRUE;
00421         }
00422     }
00423
00424     // we are only concerned if the image index has changed.
00425     if(eAuxIndex != m_eAuxIndex) {
00426         m_eAuxIndex = eAuxIndex;
00427
00428         // if the button is a valid window, set the new icon.
00429         if(m_btnMinim.GetSafeHwnd()) {
00430             // fix potential resource leak - KStowell - 10-22-99.
00431             _destroyIcon(m_hAuxIcon);
00432             m_hAuxIcon = m_ImageList.ExtractIcon((int)eAuxIndex);
00433             m_btnMinim.SetIcon(m_hAuxIcon, CSize(10,10));
00434             m_btnMinim.EnableWindow(bEnable);
00435
00436             // if the tooltip control is valid, update the tip text.
00437             if(m_ToolTip.GetSafeHwnd()) {
00438                 m_ToolTip.UpdateTipText(uIDText, &m_btnMinim);
00439             }
00440         }
00441     }
00442 }

void CCJControlBar::OnWindowPosChanged ( WINDOWPOS FAR * lpwndpos ) [protected]

Reimplemented in CCJExplorerBar.

Definition at line 731 of file CJControlBar.cpp.

References GetButtonRect, GetChildRect, IsFloating, IsHorzDocked, m_bDragging, m_btnClose, m_btnMinim, m_pChildWnd, m_sizeFloat, m_sizeHorz, m_sizeVert, and SaveBarState.

Referenced by CCJTabCtrlBar::OnWindowPosChanged.

00732 {
00733     CControlBar::OnWindowPosChanged(lpwndpos);
00734
00735     if (m_bButtons)
00736     {
00737         if (IsFloating())
00738         {
00739             m_btnClose.ShowWindow(SW_HIDE);
00740             m_btnMinim.ShowWindow(SW_HIDE);
00741         }
00742
00743         else
00744         {
00745             m_btnClose.ShowWindow(SW_SHOW);
00746             m_btnMinim.ShowWindow(SW_SHOW);
00747
00748             CRect rcClose(GetButtonRect());
00749             CRect rcMinim(GetButtonRect());
00750
00751             if (IsHorzDocked()) {
00752                 rcMinim.OffsetRect(0,14);
00753             }
00754
00755             else {
00756                 rcClose.OffsetRect(14,0);
00757             }
00758
00759             m_btnClose.MoveWindow(rcClose);
00760             m_btnMinim.MoveWindow(rcMinim);
00761         }
00762     }
00763
00764     //1999-05-19 Yiannhs
00765     //Calculate Extra Size variables
00766     CSize sizeTemp( lpwndpos->cx, lpwndpos->cy );
00767
00768     // save the current size to the registry.
00769     if( m_bAutoSave ) {
00770         SaveBarState(sizeTemp);
00771     }
00772
00773     if( IsFloating() ) {
00774         m_sizeFloat = sizeTemp;
00775     }
00776
00777     else if( !m_bDragging )
00778     {
00779         if( IsHorzDocked() ) {
00780             m_sizeHorz = sizeTemp;
00781         } else {
00782             m_sizeVert = sizeTemp;
00783         }
00784     }
00785
00786     if( m_pChildWnd->GetSafeHwnd( )) {
00787         CRect rc;
00788         GetChildRect(rc);
00789         rc.DeflateRect(1,1);
00790         m_pChildWnd->MoveWindow(rc);
00791     }
00792 }

BOOL CCJControlBar::PreTranslateMessage ( MSG * pMsg ) [virtual]

Reimplemented in CCJTabCtrlBar.

Definition at line 372 of file CJControlBar.cpp.

References m_bButtons, and m_ToolTip.

Referenced by CCJTabCtrlBar::PreTranslateMessage.

00373 {
00374     // *** GK/ISC
00375     if (m_bButtons && m_ToolTip.GetSafeHwnd()) {
00376         m_ToolTip.RelayEvent(pMsg);
00377     }
00378     return CControlBar::PreTranslateMessage(pMsg);
00379 }

void CCJControlBar::SaveBarState ( CSize & size ) [protected, virtual]

Definition at line 1374 of file CJControlBar.cpp.

References IsFloating, IsHorzDocked, m_nID, m_strSection, and TRACK_BORDER_SIZE.

Referenced by OnWindowPosChanged.

01375 {
01376     int nIndex = 0;
01377     CWinApp* pApp = AfxGetApp();
01378
01379     // attempt to loop through all of the defaults stored in the
01380     // system until we find our control id.
01381     while( TRUE )
01382     {
01383         // start at 0 and search for a match to our control bars
01384         // resource id. If one was not found, return.
01385         m_strSection.Format(_T("Bar State-Bar%d"), nIndex);
01386         int nBarID = pApp->GetProfileInt( m_strSection, _T("BarID"), -1 );
01387
01388         // couldn't find a match, just bail...
01389         if( nBarID == -1 ) {
01390             TRACE1( "Warning: Could not find registry information for control bar ID %d\n", m_nID );
01391             return;
01392         }
01393
01394         // we have a match, read the information that was stored, and
01395         // update the cx and cy variables passed in.
01396         if( nBarID == m_nID )
01397         {
01398             if(IsHorzDocked()) {
01399                 size.cy += TRACK_BORDER_SIZE+2;
01400             } else {
01401                 size.cx += TRACK_BORDER_SIZE;
01402             }
01403             //m_strSection += _T("\\CodeJock"); //JK - removed to fix the Bar savings, replaced by the code below... The fix taken from CodeJock Website Discussion board
01404             m_strSection.Format ( _T("CodeJock Bar State-Bar%d"), nIndex ); //JK
01405
01406             // Write the BarID here in case it needs to be matched up in later revisions    //JK
01407             pApp->WriteProfileInt( m_strSection, _T("BarID"), m_nID );  //JK
01408
01409             pApp->WriteProfileInt( m_strSection, _T("MRUDesiredCX"), size.cx );
01410             pApp->WriteProfileInt( m_strSection, _T("MRUDesiredCY"), size.cy );
01411             pApp->WriteProfileInt( m_strSection, _T("MRUFloating" ), IsFloating() );
01412             return;
01413         }
01414
01415         // increment count.
01416         ++nIndex;
01417     }
01418 }

_CJXLIB_INLINE void CCJControlBar::SetChild ( CWnd * pWnd ) [protected, virtual]

Definition at line 578 of file CJControlBar.h.

References ASSERT.

Referenced by CBarConsole::OnCreate, and CCJTabCtrlBar::OnCreate.

00579     { ASSERT(::IsWindow(m_hWnd)); m_pChildWnd=pWnd; }

_CJXLIB_INLINE void CCJControlBar::SetMenuID | ( | UINT | popupMenuID,
 |  | UINT | popToolbarID = 0,
 |  | int | nPos = 0
 | ) | [virtual]

Definition at line 548 of file CJControlBar.h.

References ASSERT, m_nPos, m_popToolbarID, and m_popupMenuID.

00549     { ASSERT(::IsWindow(m_hWnd)); m_popupMenuID=popupMenuID; m_popToolbarID=popToolbarID; m_nPos=nPos; }

_CJXLIB_INLINE void CCJControlBar::SetNormalSize ( const CSize & cs ) [virtual]

Definition at line 554 of file CJControlBar.h.

References ASSERT, m_sizeDesired, and m_sizeNormal.

00555     { ASSERT(::IsWindow(m_hWnd)); m_sizeDesired=m_sizeNormal=cs; }

_CJXLIB_INLINE void CCJControlBar::ShowFrameControls | ( | BOOL | bGripper = TRUE,
 |  | BOOL | bButtons = TRUE
 | ) | [virtual]

Definition at line 551 of file CJControlBar.h.

References ASSERT, m_bButtons, and m_bGripper.

Referenced by CCJExplorerBar::Create.

00552     { ASSERT(::IsWindow(m_hWnd)); m_bGripper=bGripper; m_bButtons=bButtons; }

Member Data Documentation

bool CCJControlBar::m_bAutoSave [protected]

Definition at line 291 of file CJControlBar.h.

Referenced by CCJControlBar, and EnableSaveState.

BOOL CCJControlBar::m_bButtons [protected]

Definition at line 262 of file CJControlBar.h.

Referenced by CCJControlBar, GetGripperRect, GetMinExt, OnUpdateCmdUI, PreTranslateMessage, and ShowFrameControls.

BOOL CCJControlBar::m_bDragging [protected]

Definition at line 258 of file CJControlBar.h.

Referenced by CCJControlBar, HitTest, OnLButtonDown, OnLButtonUp, OnSetCursor, and OnWindowPosChanged.

BOOL CCJControlBar::m_bFlatBorder [protected]

Definition at line 288 of file CJControlBar.h.

Referenced by CCJControlBar, Create, DrawBorders, EnableFlatLook, and OnCreate.

BOOL CCJControlBar::m_bFlatGripper [protected]

Definition at line 286 of file CJControlBar.h.

Referenced by CCJControlBar, Create, DrawGripper, EnableFlatLook, and OnCreate.

BOOL CCJControlBar::m_bFloating [protected]

Definition at line 295 of file CJControlBar.h.

Referenced by CCJControlBar, CCJTabCtrlBar::CreateTabView, and LoadBarState.

BOOL CCJControlBar::m_bGripper [protected]

Definition at line 283 of file CJControlBar.h.

Referenced by CCJControlBar, DrawGripper, GetMinExt, and ShowFrameControls.

BOOL CCJControlBar::m_bMaximized [protected]

Definition at line 255 of file CJControlBar.h.

Referenced by CCJControlBar, Maximize, Minimize, Normalize, OnButtonMinimize, and OnUpdateCmdUI.

BOOL CCJControlBar::m_bOkToDrag [protected]

Definition at line 252 of file CJControlBar.h.

Referenced by CCJControlBar, HitTest, and OnSetCursor.

CCJCBarButton CCJControlBar::m_btnClose [protected]

Definition at line 279 of file CJControlBar.h.

Referenced by EnableFlatLook, OnCreate, and OnWindowPosChanged.

CCJCBarButton CCJControlBar::m_btnMinim [protected]

Definition at line 280 of file CJControlBar.h.

Referenced by EnableFlatLook, OnCreate, OnUpdateCmdUI, and OnWindowPosChanged.

BOOL CCJControlBar::m_bToFit

Definition at line 227 of file CJControlBar.h.

Referenced by CCJSizeDockBar::CalcSizeBarLayout, CCJControlBar, DrawBorders, GetChildRect, and HitTest.

BOOL CCJControlBar::m_bUnique

Definition at line 223 of file CJControlBar.h.

Referenced by CCJSizeDockBar::CalcSizeBarLayout, and CCJControlBar.

int CCJControlBar::m_cxOffset [protected]

Definition at line 235 of file CJControlBar.h.

Referenced by CCJControlBar, and GetChildRect.

int CCJControlBar::m_cyOffset [protected]

Definition at line 238 of file CJControlBar.h.

Referenced by CCJControlBar.

BTN_IMG_INDEX CCJControlBar::m_eAuxIndex [protected]

Definition at line 241 of file CJControlBar.h.

Referenced by CCJControlBar, and OnUpdateCmdUI.

CHILD_BORDER CCJControlBar::m_eChildBorder

Definition at line 231 of file CJControlBar.h.

Referenced by CCJControlBar, and OnPaint.

HICON CCJControlBar::m_hAuxIcon [protected]

Definition at line 293 of file CJControlBar.h.

Referenced by CCJControlBar, OnUpdateCmdUI, and ~CCJControlBar.

HICON CCJControlBar::m_hIcon [protected]

Reimplemented in CCJExplorerBar.

Definition at line 292 of file CJControlBar.h.

Referenced by CCJControlBar, OnCreate, and ~CCJControlBar.

CImageList CCJControlBar::m_ImageList [protected]

Definition at line 278 of file CJControlBar.h.

Referenced by CCJControlBar, OnCreate, OnUpdateCmdUI, and ~CCJControlBar.

int CCJControlBar::m_nID [protected]

Definition at line 294 of file CJControlBar.h.

Referenced by CCJControlBar, LoadBarState, and SaveBarState.

int CCJControlBar::m_nPos [protected]

Definition at line 250 of file CJControlBar.h.

Referenced by CCJControlBar, OnRButtonDown, and SetMenuID.

CWnd* CCJControlBar::m_pChildWnd [protected]

Definition at line 274 of file CJControlBar.h.

Referenced by CCJControlBar, CCJExplorerBar::OnWindowPosChanged, and OnWindowPosChanged.

UINT CCJControlBar::m_popToolbarID [protected]

Definition at line 245 of file CJControlBar.h.

Referenced by CCJControlBar, OnRButtonDown, and SetMenuID.

CCJMenu CCJControlBar::m_popupMenu [protected]

Definition at line 249 of file CJControlBar.h.

Referenced by OnInitMenuPopup, OnMeasureItem, OnMenuChar, and OnRButtonDown.

UINT CCJControlBar::m_popupMenuID [protected]

Definition at line 248 of file CJControlBar.h.

Referenced by CCJControlBar, GetMenuID, OnRButtonDown, and SetMenuID.

CPoint CCJControlBar::m_ptCurDrag [protected]

Definition at line 271 of file CJControlBar.h.

Referenced by OnLButtonDown, OnLButtonUp, and OnMouseMove.

CPoint CCJControlBar::m_ptStartDrag [protected]

Definition at line 272 of file CJControlBar.h.

Referenced by OnLButtonDown, and OnLButtonUp.

CRect CCJControlBar::m_rcTrack [protected]

Definition at line 265 of file CJControlBar.h.

Referenced by OnLButtonDown, OnLButtonUp, and OnMouseMove.

CSize CCJControlBar::m_sizeDesired [protected]

Definition at line 266 of file CJControlBar.h.

Referenced by CalcDynamicLayout, CCJControlBar, Create, GetHorzSize, GetVertSize, Maximize, Minimize, Normalize, OnLButtonUp, and SetNormalSize.

CSize CCJControlBar::m_sizeFloat [protected]

Definition at line 270 of file CJControlBar.h.

Referenced by CalcDynamicLayout, CCJControlBar, Create, and OnWindowPosChanged.

CSize CCJControlBar::m_sizeHorz [protected]

Definition at line 269 of file CJControlBar.h.

Referenced by CalcDynamicLayout, CCJControlBar, Create, OnLButtonUp, and OnWindowPosChanged.

CSize CCJControlBar::m_sizeNormal [protected]

Definition at line 267 of file CJControlBar.h.

Referenced by CCJControlBar, Create, Maximize, Minimize, Normalize, OnLButtonUp, and SetNormalSize.

CSize CCJControlBar::m_sizeVert [protected]

Definition at line 268 of file CJControlBar.h.

Referenced by CalcDynamicLayout, CCJControlBar, Create, OnLButtonUp, and OnWindowPosChanged.

CString CCJControlBar::m_strSection [protected]

Definition at line 290 of file CJControlBar.h.

Referenced by CCJControlBar, LoadBarState, and SaveBarState.

CToolTipCtrl CCJControlBar::m_ToolTip [protected]

Definition at line 281 of file CJControlBar.h.

Referenced by OnCreate, OnUpdateCmdUI, and PreTranslateMessage.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJControlBar.h
  • WinCvs/CJLib/CJLibrary/CJControlBar.cpp
Generated on Sun Feb 24 01:24:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJDateEdit Class Reference

#include <CJMaskEdit.h>

Inheritance diagram for CCJDateEdit:

[legend]
Collaboration diagram for CCJDateEdit:

[legend]
List of all members.

Public Methods

CCJDateEdit ()
virtual void | SetDateTime (COleDateTime &dt)
virtual void | SetDateTime (CString strDate)
virtual COleDateTime | GetDateTime ()
virtual CString | GetWindowDateTime ()
virtual COleDateTime | ReadOleDateTime (LPCTSTR lpszData)
virtual bool | ProcessMask (UINT nChar, int nEndPos)
virtual void | FormatOleDateTime (CString &strData, COleDateTime dt)

Constructor & Destructor Documentation

CCJDateEdit::CCJDateEdit ( )

Definition at line 408 of file CJMaskEdit.cpp.

References CCJMaskEdit::m_bUseMask, CCJMaskEdit::m_strLiteral, and CCJMaskEdit::m_strMask.

00409 {
00410     m_bUseMask      = true;
00411     m_strMask       = _T("00/00/0000");
00412     m_strLiteral    = _T("__/__/____");
00413 }

Member Function Documentation

void CCJDateEdit::FormatOleDateTime | ( | CString & | strData,
 |  | COleDateTime | dt
 | ) | [virtual]

Reimplemented in CCJTimeEdit.

Definition at line 422 of file CJMaskEdit.cpp.

Referenced by SetDateTime.

00423 {
00424     strData = dt.Format( _T("%d/%m/%Y"));
00425 }

COleDateTime CCJDateEdit::GetDateTime ( ) [virtual]

Definition at line 441 of file CJMaskEdit.cpp.

References ReadOleDateTime.

Referenced by DDX_OleDateTime.

00442 {
00443     CString strText;
00444     GetWindowText(strText);
00445     return ReadOleDateTime(strText);
00446 }

CString CCJDateEdit::GetWindowDateTime ( ) [virtual]

Definition at line 448 of file CJMaskEdit.cpp.

00449 {
00450     CString strText;
00451     GetWindowText(strText);
00452     return strText;
00453 }

bool CCJDateEdit::ProcessMask | ( | UINT | nChar,
 |  | int | nEndPos
 | ) | [virtual]

Reimplemented from CCJMaskEdit.

Reimplemented in CCJTimeEdit.

Definition at line 455 of file CJMaskEdit.cpp.

References CCJMaskEdit::m_strMask, and CCJMaskEdit::m_strWindowText.

00456 {
00457     // check the key against the mask
00458     switch( m_strMask.GetAt( nEndPos ))
00459     {
00460     case '0':       // digit only //completely changed this
00461         {
00462             bool bReturn = true;
00463
00464             if( isdigit( nChar ))
00465             {
00466                 if( nEndPos == 0 )
00467                 {
00468                     if( nChar > '3' ) {
00469                         bReturn = false;
00470                     }
00471                 }
00472                 else if( nEndPos == 1 )
00473                 {
00474                     if( m_strWindowText.GetAt(0) == '3' )
00475                     {
00476                         if( nChar > '1' ) {
00477                             bReturn = false;
00478                         }
00479                     }
00480                 }
00481                 else if( nEndPos == 3 )
00482                 {
00483                     if( nChar > '1' ) {
00484                         bReturn = false;
00485                     }
00486                 }
00487                 else if( nEndPos == 4 )
00488                 {
00489                     if( m_strWindowText.GetAt(3) == '1' )
00490                     {
00491                         if( nChar > '2') {
00492                             bReturn = false;
00493                         }
00494                     }
00495                 }
00496                 return bReturn;
00497             }
00498             break;
00499         }
00500     }
00501
00502     MessageBeep((UINT)-1);
00503     return false;
00504 }

COleDateTime CCJDateEdit::ReadOleDateTime ( LPCTSTR lpszData ) [virtual]

Definition at line 415 of file CJMaskEdit.cpp.

Referenced by GetDateTime.

00416 {
00417     COleDateTime dt;
00418     dt.ParseDateTime(lpszData);
00419     return dt;
00420 }

void CCJDateEdit::SetDateTime ( CString strDate ) [virtual]

Definition at line 435 of file CJMaskEdit.cpp.

References CCJMaskEdit::m_strMaskLiteral, and CCJMaskEdit::m_strWindowText.

00436 {
00437     m_strWindowText = m_strMaskLiteral = strDate;
00438     SetWindowText(strDate);
00439 }

void CCJDateEdit::SetDateTime ( COleDateTime & dt ) [virtual]

Definition at line 427 of file CJMaskEdit.cpp.

References FormatOleDateTime, CCJMaskEdit::m_strMaskLiteral, and CCJMaskEdit::m_strWindowText.

Referenced by DDX_OleDateTime.

00428 {
00429     CString strText;
00430     FormatOleDateTime(strText, dt);
00431     m_strWindowText = m_strMaskLiteral = strText;
00432     SetWindowText(strText);
00433 }

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJMaskEdit.h
  • WinCvs/CJLib/CJLibrary/CJMaskEdit.cpp
Generated on Sun Feb 24 01:24:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJDateTimeCtrl Class Reference

#include <CJDateTimeCtrl.h>

Inheritance diagram for CCJDateTimeCtrl:

[legend]
Collaboration diagram for CCJDateTimeCtrl:

[legend]
List of all members.

Public Methods

CCJDateTimeCtrl ()
virtual | ~CCJDateTimeCtrl ()
BOOL | Create (DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID)
COLORREF | GetMonthCalColor (int iColor) const
COLORREF | SetMonthCalColor (int iColor, COLORREF ref)
BOOL | SetFormat (LPCTSTR pstrFormat)
CCJMonthCalCtrl * | GetMonthCalCtrl () const
CFont * | GetMonthCalFont () const
void | SetMonthCalFont (HFONT hFont, BOOL bRedraw=TRUE)
BOOL | SetRange (const COleDateTime *pMinRange, const COleDateTime *pMaxRange)
BOOL | SetRange (const CTime *pMinRange, const CTime *pMaxRange)
DWORD | GetRange (COleDateTime *pMinRange, COleDateTime *pMaxRange) const
DWORD | GetRange (CTime *pMinRange, CTime *pMaxRange) const
BOOL | SetTime (const CTime *pTimeNew)
BOOL | SetTime (const COleDateTime &timeNew)
BOOL | SetTime (LPSYSTEMTIME pTimeNew=NULL)
DWORD | GetTime (CTime &timeDest) const
BOOL | GetTime (COleDateTime &timeDest) const
DWORD | GetTime (LPSYSTEMTIME pTimeDest) const

Constructor & Destructor Documentation

_CJXLIB_INLINE CCJDateTimeCtrl::CCJDateTimeCtrl ( )

Definition at line 763 of file CJDateTimeCtrl.h.

00764     { }

CCJDateTimeCtrl::~CCJDateTimeCtrl ( ) [virtual]

Definition at line 443 of file CJDateTimeCtrl.cpp.

00444 {
00445     DestroyWindow();
00446 }

Member Function Documentation

BOOL CCJDateTimeCtrl::Create | ( | DWORD | dwStyle,
 |  | const RECT & | rect,
 |  | CWnd * | pParentWnd,
 |  | UINT | nID
 | ) |

Definition at line 250 of file CJDateTimeCtrl.cpp.

References NULL, and VERIFY.

00252 {
00253    // initialize common controls
00254 #ifdef _VC_VERSION_5
00255     INITCOMMONCONTROLSEX icex;
00256     icex.dwSize = sizeof(icex);
00257     icex.dwICC = ICC_DATE_CLASSES;
00258     VERIFY(InitCommonControlsEx(&icex));
00259 #else
00260     VERIFY(AfxDeferRegisterClass(AFX_WNDCOMMCTL_DATE_REG));
00261 #endif
00262
00263     CWnd* pWnd = this;
00264     return pWnd->Create(DATETIMEPICK_CLASS, NULL, dwStyle, rect, pParentWnd, nID);
00265 }

_CJXLIB_INLINE COLORREF CCJDateTimeCtrl::GetMonthCalColor ( int iColor ) const

Definition at line 775 of file CJDateTimeCtrl.h.

References ASSERT.

00776     { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, DTM_GETMCCOLOR, (WPARAM) iColor, 0); }

_CJXLIB_INLINE CCJMonthCalCtrl * CCJDateTimeCtrl::GetMonthCalCtrl ( ) const

Definition at line 767 of file CJDateTimeCtrl.h.

References ASSERT.

00768     { ASSERT(::IsWindow(m_hWnd)); return (CCJMonthCalCtrl*) CWnd::FromHandle((HWND) ::SendMessage(m_hWnd, DTM_GETMONTHCAL, 0, 0)); }

_CJXLIB_INLINE CFont * CCJDateTimeCtrl::GetMonthCalFont ( ) const

Definition at line 765 of file CJDateTimeCtrl.h.

References ASSERT.

00766     { ASSERT(::IsWindow(m_hWnd)); return CFont::FromHandle((HFONT) ::SendMessage(m_hWnd, DTM_GETMCFONT, 0, 0)); }

DWORD CCJDateTimeCtrl::GetRange | ( | CTime * | pMinRange,
 |  | CTime * | pMaxRange
 | ) | const

Definition at line 267 of file CJDateTimeCtrl.cpp.

References ASSERT, and NULL.

00268 {
00269     ASSERT(::IsWindow(m_hWnd));
00270     SYSTEMTIME sysTimes[2];
00271     memset(sysTimes, 0, sizeof(sysTimes));
00272
00273     DWORD dwResult = ::SendMessage(m_hWnd, DTM_GETRANGE, 0, (LPARAM) &sysTimes);
00274
00275     if (pMinTime != NULL)
00276     {
00277         if (dwResult & GDTR_MIN)
00278             *pMinTime = CTime(sysTimes[0]);
00279     }
00280
00281     if (pMaxTime != NULL)
00282     {
00283         if (dwResult & GDTR_MAX)
00284             *pMaxTime = CTime(sysTimes[1]);
00285     }
00286
00287     return dwResult;
00288
00289 }

DWORD CCJDateTimeCtrl::GetRange | ( | COleDateTime * | pMinRange,
 |  | COleDateTime * | pMaxRange
 | ) | const

Definition at line 291 of file CJDateTimeCtrl.cpp.

References ASSERT, and NULL.

00293 {
00294     ASSERT(::IsWindow(m_hWnd));
00295
00296     SYSTEMTIME sysTimes[2];
00297     memset(sysTimes, 0, sizeof(sysTimes));
00298
00299     DWORD dwResult = ::SendMessage(m_hWnd, DTM_GETRANGE, 0, (LPARAM) &sysTimes);
00300     if (pMinTime != NULL)
00301     {
00302         if (dwResult & GDTR_MIN)
00303             *pMinTime = COleDateTime(sysTimes[0]);
00304         else
00305             pMinTime->SetStatus(COleDateTime::null);
00306     }
00307
00308     if (pMaxTime != NULL)
00309     {
00310         if (dwResult & GDTR_MAX)
00311             *pMaxTime = COleDateTime(sysTimes[1]);
00312         else
00313             pMaxTime->SetStatus(COleDateTime::null);
00314     }
00315
00316     return dwResult;
00317 }

_CJXLIB_INLINE DWORD CCJDateTimeCtrl::GetTime ( LPSYSTEMTIME pTimeDest ) const

Definition at line 773 of file CJDateTimeCtrl.h.

References ASSERT, and NULL.

00774     { ASSERT(::IsWindow(m_hWnd)); ASSERT(pTimeDest != NULL); return (DWORD) ::SendMessage(m_hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM) pTimeDest); }

BOOL CCJDateTimeCtrl::GetTime ( COleDateTime & timeDest ) const

Definition at line 409 of file CJDateTimeCtrl.cpp.

References ASSERT, and TRUE.

00410 {
00411     SYSTEMTIME sysTime;
00412     BOOL bRetVal = TRUE;
00413
00414     LRESULT result = ::SendMessage(m_hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM) &sysTime);
00415     if (result == GDT_VALID)
00416     {
00417         timeDest = COleDateTime(sysTime);
00418         bRetVal = TRUE;
00419         ASSERT(timeDest.GetStatus() == COleDateTime::valid);
00420     }
00421     else if (result == GDT_NONE)
00422     {
00423         timeDest.SetStatus(COleDateTime::null);
00424         bRetVal = TRUE;
00425     }
00426     else
00427         timeDest.SetStatus(COleDateTime::invalid);
00428     return bRetVal;
00429 }

DWORD CCJDateTimeCtrl::GetTime ( CTime & timeDest ) const

Definition at line 431 of file CJDateTimeCtrl.cpp.

Referenced by DDX_CJDateTimeCtrl.

00432 {
00433     SYSTEMTIME sysTime;
00434     DWORD dwResult = (DWORD)
00435         ::SendMessage(m_hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM) &sysTime);
00436
00437     if (dwResult == GDT_VALID)
00438         timeDest = CTime(sysTime);
00439
00440     return dwResult;
00441 }

_CJXLIB_INLINE BOOL CCJDateTimeCtrl::SetFormat ( LPCTSTR pstrFormat )

Definition at line 777 of file CJDateTimeCtrl.h.

References ASSERT.

00778     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, DTM_SETFORMAT, 0, (LPARAM) pstrFormat); }

_CJXLIB_INLINE COLORREF CCJDateTimeCtrl::SetMonthCalColor | ( | int | iColor,
 |  | COLORREF | ref
 | ) |

Definition at line 771 of file CJDateTimeCtrl.h.

References ASSERT.

00772     { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, DTM_SETMCCOLOR, (WPARAM) iColor, (LPARAM) ref); }

_CJXLIB_INLINE void CCJDateTimeCtrl::SetMonthCalFont | ( | HFONT | hFont,
 |  | BOOL | bRedraw = TRUE
 | ) |

Definition at line 769 of file CJDateTimeCtrl.h.

References ASSERT.

00770     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, DTM_SETMCFONT, (WPARAM) hFont, MAKELONG(bRedraw, 0)); }

BOOL CCJDateTimeCtrl::SetRange | ( | const CTime * | pMinRange,
 |  | const CTime * | pMaxRange
 | ) |

Definition at line 319 of file CJDateTimeCtrl.cpp.

References ASSERT, GetAsSystemTime, and NULL.

00320 {
00321     ASSERT(::IsWindow(m_hWnd));
00322
00323     SYSTEMTIME sysTimes[2];
00324
00325     WPARAM wFlags = 0;
00326     if (pMinTime != NULL && GetAsSystemTime(pMinTime, sysTimes[0]))
00327         wFlags |= GDTR_MIN;
00328
00329     if (pMaxTime != NULL && GetAsSystemTime(pMaxTime, sysTimes[1]))
00330         wFlags |= GDTR_MAX;
00331
00332     return (BOOL) ::SendMessage(m_hWnd, DTM_SETRANGE, wFlags, (LPARAM) &sysTimes);
00333 }

BOOL CCJDateTimeCtrl::SetRange | ( | const COleDateTime * | pMinRange,
 |  | const COleDateTime * | pMaxRange
 | ) |

Definition at line 335 of file CJDateTimeCtrl.cpp.

References ASSERT, GetAsSystemTime, and NULL.

Referenced by DDV_CJMinMaxDateTime.

00336 {
00337     ASSERT(::IsWindow(m_hWnd));
00338     ASSERT(pMinTime == NULL || pMinTime->GetStatus() != COleDateTime::invalid);
00339     ASSERT(pMaxTime == NULL || pMaxTime->GetStatus() != COleDateTime::invalid);
00340
00341     SYSTEMTIME sysTime[2];
00342
00343     WPARAM wFlags = 0;
00344     if (pMinTime != NULL && pMinTime->GetStatus() != COleDateTime::null)
00345     {
00346         if (GetAsSystemTime(pMinTime, sysTime[0]))
00347             wFlags |= GDTR_MIN;
00348     }
00349
00350     if (pMaxTime != NULL && pMaxTime->GetStatus() != COleDateTime::null)
00351     {
00352         if (GetAsSystemTime(pMaxTime, sysTime[1]))
00353             wFlags |= GDTR_MAX;
00354     }
00355
00356     return (BOOL) ::SendMessage(m_hWnd, DTM_SETRANGE, wFlags, (LPARAM) &sysTime);
00357 }

BOOL CCJDateTimeCtrl::SetTime ( LPSYSTEMTIME pTimeNew = NULL )

Definition at line 359 of file CJDateTimeCtrl.cpp.

References ASSERT, and NULL.

00360 {
00361     ASSERT(::IsWindow(m_hWnd));
00362     WPARAM wParam = (pTimeNew == NULL) ? GDT_NONE : GDT_VALID;
00363     return (BOOL) ::SendMessage(m_hWnd, DTM_SETSYSTEMTIME,
00364         wParam, (LPARAM) pTimeNew);
00365 }

BOOL CCJDateTimeCtrl::SetTime ( const COleDateTime & timeNew )

Definition at line 367 of file CJDateTimeCtrl.cpp.

References ASSERT, FALSE, and GetAsSystemTime.

00368 {
00369     BOOL bRetVal = FALSE;
00370
00371     // make sure the time isn't invalid
00372     ASSERT(timeNew.GetStatus() != COleDateTime::invalid);
00373     ASSERT(::IsWindow(m_hWnd));
00374
00375     SYSTEMTIME sysTime;
00376     WPARAM wParam = GDT_NONE;
00377     if (timeNew.GetStatus() == COleDateTime::valid &&
00378         GetAsSystemTime(timeNew, sysTime))
00379     {
00380         wParam = GDT_VALID;
00381     }
00382
00383     bRetVal = (BOOL) ::SendMessage(m_hWnd,
00384             DTM_SETSYSTEMTIME, wParam, (LPARAM) &sysTime);
00385
00386     return bRetVal;
00387 }

BOOL CCJDateTimeCtrl::SetTime ( const CTime * pTimeNew )

Definition at line 389 of file CJDateTimeCtrl.cpp.

References ASSERT, FALSE, GetAsSystemTime, and NULL.

Referenced by DDX_CJDateTimeCtrl.

00390 {
00391     BOOL bRetVal = FALSE;
00392
00393     // make sure the time isn't invalid
00394     ASSERT(::IsWindow(m_hWnd));
00395
00396     SYSTEMTIME sysTime;
00397     WPARAM wParam = GDT_NONE;
00398     if (pTimeNew != NULL && GetAsSystemTime(pTimeNew, sysTime))
00399     {
00400         wParam = GDT_VALID;
00401     }
00402
00403     bRetVal = (BOOL) ::SendMessage(m_hWnd,
00404             DTM_SETSYSTEMTIME, wParam, (LPARAM) &sysTime);
00405
00406     return bRetVal;
00407 }

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJDateTimeCtrl.h
  • WinCvs/CJLib/CJLibrary/CJDateTimeCtrl.cpp
Generated on Sun Feb 24 01:24:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJDockBar Class Reference

#include <CJDockBar.h>

Inheritance diagram for CCJDockBar:

[legend]
Collaboration diagram for CCJDockBar:

[legend]
List of all members.

Public Methods

CCJDockBar ()
virtual | ~CCJDockBar ()
virtual CSize | CalcFixedLayout (BOOL bStretch, BOOL bHorz)

Constructor & Destructor Documentation

CCJDockBar::CCJDockBar ( )

Definition at line 57 of file CJDockBar.cpp.

00058 {
00059     // TODO: add construction code here.
00060 }

CCJDockBar::~CCJDockBar ( ) [virtual]

Definition at line 62 of file CJDockBar.cpp.

00063 {
00064     // TODO: add destruction code here.
00065 }

Member Function Documentation

CSize CCJDockBar::CalcFixedLayout | ( | BOOL | bStretch,
 |  | BOOL | bHorz
 | ) | [virtual]

Definition at line 79 of file CJDockBar.cpp.

References FALSE, NULL, and TRUE.

00080 {
00081     ASSERT_VALID(this);
00082
00083     CSize sizeFixed = CControlBar::CalcFixedLayout(bStretch, bHorz);
00084
00085     // get max size
00086     CSize sizeMax;
00087     if (!m_rectLayout.IsRectEmpty())
00088         sizeMax = m_rectLayout.Size();
00089     else
00090     {
00091         CRect rectFrame;
00092         CFrameWnd* pFrame = GetParentFrame();
00093         pFrame->GetClientRect(&rectFrame);
00094         sizeMax = rectFrame.Size();
00095     }
00096
00097     const int NormalcxBorder2=GetSystemMetrics(SM_CYBORDER)*2;
00098     const int NormalcyBorder2=2;
00099     const int AltcxBorder2=0;
00100     const int AltcyBorder2=0;
00101     int cxBorder2=0;
00102     int cyBorder2=0;
00103
00104     // prepare for layout
00105     AFX_SIZEPARENTPARAMS layout;
00106     layout.hDWP = m_bLayoutQuery ?
00107         NULL : ::BeginDeferWindowPos(m_arrBars.GetSize());
00108     CPoint pt(-cxBorder2, -NormalcyBorder2);
00109     int nWidth = 0;
00110
00111     BOOL bWrapped = FALSE;
00112
00113     // layout all the control bars
00114     for (int nPos = 0; nPos < m_arrBars.GetSize(); nPos++)
00115     {
00116         CControlBar* pBar = GetDockedControlBar(nPos);
00117         void* pVoid = m_arrBars[nPos];
00118
00119         if (pBar != NULL)
00120         {
00121             if (pBar->IsVisible())
00122             {
00123                 if(pBar->IsKindOf(RUNTIME_CLASS(CCJToolBar)))
00124                 {
00125                     cxBorder2=AltcxBorder2;
00126                     cyBorder2=AltcyBorder2;
00127                 }
00128                 else
00129                 {
00130                     cxBorder2=NormalcxBorder2;
00131                     cyBorder2=NormalcyBorder2;
00132                 }
00133                 // get ideal rect for bar
00134                 DWORD dwMode = 0;
00135                 if ((pBar->m_dwStyle & CBRS_SIZE_DYNAMIC) &&
00136                     (pBar->m_dwStyle & CBRS_FLOATING))
00137                     dwMode |= LM_HORZ | LM_MRUWIDTH;
00138                 else if (pBar->m_dwStyle & CBRS_ORIENT_HORZ)
00139                     dwMode |= LM_HORZ | LM_HORZDOCK;
00140                 else
00141                     dwMode |=  LM_VERTDOCK;
00142
00143                 CSize sizeBar = pBar->CalcDynamicLayout(-1, dwMode);
00144
00145                 CRect rect(pt, sizeBar);
00146
00147                 // get current rect for bar
00148                 CRect rectBar;
00149                 pBar->GetWindowRect(&rectBar);
00150                 ScreenToClient(&rectBar);
00151
00152                 if (bHorz)
00153                 {
00154                     // Offset Calculated Rect out to Actual
00155                     if (rectBar.left > rect.left && !m_bFloating)
00156                         rect.OffsetRect(rectBar.left - rect.left, 0);
00157
00158                     // If ControlBar goes off the right, then right justify
00159                     if (rect.right > sizeMax.cx && !m_bFloating)
00160                     {
00161                         int x = rect.Width() - cxBorder2;
00162                         x = max(sizeMax.cx - x, pt.x);
00163                         rect.OffsetRect(x - rect.left, 0);
00164                     }
00165
00166                     // If ControlBar has been wrapped, then left justify
00167                     if (bWrapped)
00168                     {
00169                         bWrapped = FALSE;
00170                         rect.OffsetRect(-(rect.left + cxBorder2), 0);
00171                     }
00172                     // If ControlBar is completely invisible, then wrap it
00173                     else if ((rect.left >= (sizeMax.cx - cxBorder2)) &&
00174                         (nPos > 0) && (m_arrBars[nPos - 1] != NULL))
00175                     {
00176                         m_arrBars.InsertAt(nPos, (CObject*)NULL);
00177                         pBar = NULL; pVoid = NULL;
00178                         bWrapped = TRUE;
00179                     }
00180                     if (!bWrapped)
00181                     {
00182                         if (rect != rectBar)
00183                         {
00184                             if (!m_bLayoutQuery &&
00185                                 !(pBar->m_dwStyle & CBRS_FLOATING))
00186                             {
00187                                 pBar->m_pDockContext->m_rectMRUDockPos = rect;
00188                             }
00189                             AfxRepositionWindow(&layout, pBar->m_hWnd, &rect);
00190                         }
00191                         pt.x = rect.left + sizeBar.cx - cxBorder2;
00192                         nWidth = max(nWidth, sizeBar.cy);
00193                     }
00194                 }
00195                 else
00196                 {
00197                     // Offset Calculated Rect out to Actual
00198                     if (rectBar.top > rect.top && !m_bFloating)
00199                         rect.OffsetRect(0, rectBar.top - rect.top);
00200
00201                     // If ControlBar goes off the bottom, then bottom justify
00202                     if (rect.bottom > sizeMax.cy && !m_bFloating)
00203                     {
00204                         int y = rect.Height() - cyBorder2;
00205                         y = max(sizeMax.cy - y, pt.y);
00206                         rect.OffsetRect(0, y - rect.top);
00207                     }
00208
00209                     // If ControlBar has been wrapped, then top justify
00210                     if (bWrapped)
00211                     {
00212                         bWrapped = FALSE;
00213                         rect.OffsetRect(0, -(rect.top + cyBorder2));
00214                     }
00215                     // If ControlBar is completely invisible, then wrap it
00216                     else if ((rect.top >= (sizeMax.cy - cyBorder2)) &&
00217                         (nPos > 0) && (m_arrBars[nPos - 1] != NULL))
00218                     {
00219                         m_arrBars.InsertAt(nPos, (CObject*)NULL);
00220                         pBar = NULL; pVoid = NULL;
00221                         bWrapped = TRUE;
00222                     }
00223                     if (!bWrapped)
00224                     {
00225                         if (rect != rectBar)
00226                         {
00227                             if (!m_bLayoutQuery &&
00228                                 !(pBar->m_dwStyle & CBRS_FLOATING))
00229                             {
00230                                 pBar->m_pDockContext->m_rectMRUDockPos = rect;
00231                             }
00232                             AfxRepositionWindow(&layout, pBar->m_hWnd, &rect);
00233                         }
00234                         pt.y = rect.top + sizeBar.cy - cyBorder2;
00235                         nWidth = max(nWidth, sizeBar.cx);
00236                     }
00237                 }
00238             }
00239             if (!bWrapped)
00240             {
00241                 // handle any delay/show hide for the bar
00242                 pBar->RecalcDelayShow(&layout);
00243             }
00244         }
00245         if (pBar == NULL && pVoid == NULL && nWidth != 0)
00246         {
00247             // end of row because pBar == NULL
00248             if (bHorz)
00249             {
00250                 pt.y += nWidth - cyBorder2;
00251                 sizeFixed.cx = max(sizeFixed.cx, pt.x);
00252                 sizeFixed.cy = max(sizeFixed.cy, pt.y);
00253                 pt.x = -cxBorder2;
00254             }
00255             else
00256             {
00257                 pt.x += nWidth - cxBorder2;
00258                 sizeFixed.cx = max(sizeFixed.cx, pt.x);
00259                 sizeFixed.cy = max(sizeFixed.cy, pt.y);
00260                 pt.y = -cyBorder2;
00261             }
00262             nWidth = 0;
00263         }
00264     }
00265     if (!m_bLayoutQuery)
00266     {
00267         // move and resize all the windows at once!
00268         if (layout.hDWP == NULL || !::EndDeferWindowPos(layout.hDWP))
00269             TRACE0("Warning: DeferWindowPos failed - low system resources.\n");
00270     }
00271
00272     // adjust size for borders on the dock bar itself
00273     CRect rect;
00274     rect.SetRectEmpty();
00275     CalcInsideRect(rect, bHorz);
00276
00277     if ((!bStretch || !bHorz) && sizeFixed.cx != 0)
00278         sizeFixed.cx += -rect.right + rect.left;
00279     if ((!bStretch || bHorz) && sizeFixed.cy != 0)
00280         sizeFixed.cy += -rect.bottom + rect.top;
00281
00282     return sizeFixed;
00283 }

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJDockBar.h
  • WinCvs/CJLib/CJLibrary/CJDockBar.cpp
Generated on Sun Feb 24 01:24:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJDockContext Class Reference

#include <CJDockContext.h>

Inheritance diagram for CCJDockContext:

[legend]
Collaboration diagram for CCJDockContext:

[legend]
List of all members.

Public Methods

CCJDockContext (CControlBar *pBar)
virtual | ~CCJDockContext ()
void | EndDragDockBar ()
void | MoveDockBar (CPoint pt)
void | StartDragDockBar (CPoint pt)
DWORD | CanDockDockBar ()
DWORD | CanDockDockBar (CRect rect, DWORD dwDockStyle, CDockBar **ppDockBar=NULL)
BOOL | TrackDockBar ()
CCJSizeDockBar * | GetDockBar (DWORD dwOverDockStyle)
void | DockSizeBar (CControlBar *, CCJSizeDockBar *=NULL, LPRECT=NULL)
virtual void | ToggleDocking ()
void | Stretch (CPoint pt)
virtual void | StartResize (int nHitTest, CPoint pt)

Public Attributes

CPoint | m_ptOrig

Constructor & Destructor Documentation

CCJDockContext::CCJDockContext ( CControlBar * pBar )

Definition at line 106 of file CJDockContext.cpp.

00106                                                 : CDockContext(pBar)
00107 {
00108     // TODO: add construction code here.
00109 }

CCJDockContext::~CCJDockContext ( ) [virtual]

Definition at line 111 of file CJDockContext.cpp.

00112 {
00113     // TODO: add destruction code here.
00114 }

Member Function Documentation

DWORD CCJDockContext::CanDockDockBar | ( | CRect | rect,
 |  | DWORD | dwDockStyle,
 |  | CDockBar ** | ppDockBar = NULL
 | ) |

Definition at line 257 of file CJDockContext.cpp.

References CCJSizeDockBar::IsDockSizeBar, and NULL.

00258 {
00259     CFrameWnd *pFrame = (CFrameWnd*)m_pDockSite;
00260     ASSERT_VALID(pFrame);
00261
00262     dwDockStyle &= CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI;
00263
00264     if (ppDockBar != NULL)
00265         *ppDockBar = NULL;
00266     POSITION pos = pFrame->m_listControlBars.GetHeadPosition();
00267     while (pos != NULL)
00268     {
00269         CCJSizeDockBar* pDockBar = (CCJSizeDockBar*)pFrame->m_listControlBars.GetNext(pos);
00270         if( !pDockBar->IsKindOf(RUNTIME_CLASS(CCJSizeDockBar)) )
00271             continue;
00272         if (pDockBar->IsDockSizeBar() && pDockBar->IsWindowVisible() &&
00273             (pDockBar->m_dwStyle & dwDockStyle & CBRS_ALIGN_ANY) &&
00274             (!pDockBar->m_bFloating ||
00275                 (dwDockStyle & pDockBar->m_dwStyle & CBRS_FLOAT_MULTI)))
00276         {
00277             CRect rectBar;
00278             pDockBar->GetWindowRect(&rectBar);
00279             if (rectBar.Width() == 0)
00280                 rectBar.right++;
00281             if (rectBar.Height() == 0)
00282                 rectBar.bottom++;
00283             if (rectBar.IntersectRect(rectBar, rect))
00284             {
00285                 if (ppDockBar != NULL)
00286                     *ppDockBar = pDockBar;
00287                 return pDockBar->m_dwStyle & dwDockStyle;
00288             }
00289         }
00290     }
00291     return 0;
00292 }

DWORD CCJDockContext::CanDockDockBar ( )

Definition at line 209 of file CJDockContext.cpp.

References ASSERT, HORZF, and VERTF.

Referenced by GetDockBar, MoveDockBar, and StartDragDockBar.

00210 {
00211     BOOL bStyleHorz;
00212     DWORD dwDock = 0;
00213     DWORD dwCurr = 0;
00214
00215     ASSERT(m_dwStyle != 0);
00216     ASSERT_KINDOF(CFrameWnd, m_pDockSite);
00217
00218     bStyleHorz = HORZF(m_dwStyle);
00219     bStyleHorz = m_bFlip ? !bStyleHorz : bStyleHorz;
00220
00221     if (bStyleHorz && HORZF(m_dwDockStyle))
00222     {
00223         dwDock = CanDockDockBar(m_rectDragHorz,
00224             m_dwDockStyle & ~CBRS_ORIENT_VERT);
00225     }
00226
00227     else if (VERTF(m_dwDockStyle))
00228     {
00229         dwDock = CanDockDockBar(m_rectDragVert,
00230             m_dwDockStyle & ~CBRS_ORIENT_HORZ);
00231     }
00232
00233     if (!m_bFlip)
00234     {
00235         if (dwDock == 0 && HORZF(m_dwDockStyle))
00236         {
00237             dwCurr = CanDockDockBar(m_rectDragVert,
00238                 m_dwDockStyle & ~CBRS_ORIENT_VERT);
00239             dwDock = CanDockDockBar(m_rectDragHorz,
00240                 m_dwDockStyle & ~CBRS_ORIENT_VERT);
00241             dwDock = (dwDock == dwCurr) ? dwDock : 0;
00242         }
00243
00244         if (dwDock == 0 && VERTF(m_dwDockStyle))
00245         {
00246             dwCurr = CanDockDockBar(m_rectDragHorz,
00247                 m_dwDockStyle & ~CBRS_ORIENT_HORZ);
00248             dwDock = CanDockDockBar(m_rectDragVert,
00249                 m_dwDockStyle & ~CBRS_ORIENT_HORZ);
00250             dwDock = (dwDock == dwCurr) ? dwDock : 0;
00251         }
00252     }
00253
00254     return dwDock;
00255 }

void CCJDockContext::DockSizeBar | ( | CControlBar * | ,
 |  | CCJSizeDockBar * | = NULL,
 |  | LPRECT | = NULL
 | ) |

Definition at line 440 of file CJDockContext.cpp.

References ASSERT, dwSizeBarMap, and NULL.

Referenced by EndDragDockBar, and ToggleDocking.

00441 {
00442     CFrameWnd *pFrame = (CFrameWnd*)m_pDockSite;
00443     ASSERT_VALID(pFrame);
00444
00445     ASSERT(pBar != NULL);
00446     ASSERT(pBar->m_pDockContext != NULL);
00447
00448     if( pDockBar == NULL )
00449     {
00450         for (int i = 0; i < 4; i++)
00451         {
00452             if ((dwSizeBarMap[i][1] & CBRS_ALIGN_ANY) ==
00453                 (pBar->m_dwStyle & CBRS_ALIGN_ANY))
00454             {
00455                 pDockBar = (CCJSizeDockBar*)pFrame->GetControlBar(dwSizeBarMap[i][0]);
00456                 ASSERT(pDockBar != NULL);
00457                 break;
00458             }
00459         }
00460     }
00461
00462     ASSERT(pDockBar != NULL);
00463     ASSERT(pFrame->m_listControlBars.Find(pBar) != NULL);
00464     ASSERT(pBar->m_pDockSite == pFrame);
00465     ((CCJControlBar*)pBar)->Normalize();
00466     pDockBar->DockControlBar(pBar, lpRect);
00467 }

void CCJDockContext::EndDragDockBar ( )

Definition at line 352 of file CJDockContext.cpp.

References DockSizeBar, FALSE, GetDockBar, HORZF, m_ptOrig, NULL, and VERTF.

Referenced by TrackDockBar.

00353 {
00354     CancelLoop();
00355     //Yiannhs: reduce some more flickering, and unexpected behaviour in floating bars
00356     //         ok did the expected.
00357     if( m_ptLast == m_ptOrig )
00358         return;
00359
00360     if (m_dwOverDockStyle != 0)
00361     {
00362         CCJSizeDockBar* pDockBar = GetDockBar(m_dwOverDockStyle);
00363         if( pDockBar == NULL ) // John Armstrong
00364             return;
00365
00366         CRect rect = (m_dwOverDockStyle & CBRS_ORIENT_VERT) ?
00367             m_rectDragVert : m_rectDragHorz;
00368
00369         UINT uID = _AfxGetDlgCtrlID(pDockBar->m_hWnd);
00370         m_uMRUDockID = uID;
00371         m_rectMRUDockPos = rect;
00372         pDockBar->ScreenToClient(&m_rectMRUDockPos);
00373         DockSizeBar(m_pBar, pDockBar, &rect);
00374
00375         //yiannhs. after testing the posibilities I think this is the best way
00376         m_pDockSite->RecalcLayout( FALSE );
00377     }
00378
00379     else if ((m_dwStyle & CBRS_SIZE_DYNAMIC) || (HORZF(m_dwStyle) && !m_bFlip) ||
00380         (VERTF(m_dwStyle) && m_bFlip))
00381     {
00382         m_dwMRUFloatStyle = CBRS_ALIGN_TOP | (m_dwDockStyle & CBRS_FLOAT_MULTI);
00383         m_ptMRUFloatPos = m_rectFrameDragHorz.TopLeft();
00384         m_pDockSite->FloatControlBar(m_pBar, m_ptMRUFloatPos, m_dwMRUFloatStyle);
00385
00386         //yiannhs. after testing the posibilities I think this is the best way
00387         m_pDockSite->RecalcLayout( FALSE );
00388     }
00389
00390     else
00391     {
00392         m_dwMRUFloatStyle = CBRS_ALIGN_LEFT | (m_dwDockStyle & CBRS_FLOAT_MULTI);
00393         m_ptMRUFloatPos = m_rectFrameDragVert.TopLeft();
00394         m_pDockSite->FloatControlBar(m_pBar, m_ptMRUFloatPos, m_dwMRUFloatStyle);
00395
00396         //yiannhs. after testing the posibilities I think this is the best way
00397         m_pDockSite->RecalcLayout( FALSE );
00398     }
00399 }

CCJSizeDockBar * CCJDockContext::GetDockBar ( DWORD dwOverDockStyle )

Definition at line 401 of file CJDockContext.cpp.

References ASSERT, CanDockDockBar, HORZF, NULL, and VERTF.

Referenced by EndDragDockBar.

00402 {
00403     DWORD dw = 0;
00404     CDockBar* pBar;
00405     if (HORZF(dwOverDockStyle))
00406     {
00407         ASSERT_KINDOF(CFrameWnd, m_pDockSite);
00408         dw = CanDockDockBar(m_rectDragHorz,
00409             dwOverDockStyle & ~CBRS_ORIENT_VERT, &pBar);
00410         ASSERT(dw != 0);
00411         ASSERT(pBar != NULL);
00412         return (CCJSizeDockBar*)pBar;
00413     }
00414
00415     if (VERTF(dwOverDockStyle))
00416     {
00417         dw = CanDockDockBar(m_rectDragVert,
00418             dwOverDockStyle & ~CBRS_ORIENT_HORZ, &pBar);
00419         ASSERT(dw != 0);
00420         ASSERT(pBar != NULL);
00421         return (CCJSizeDockBar*)pBar;
00422     }
00423
00424     return NULL;
00425 }

void CCJDockContext::MoveDockBar ( CPoint pt )

Definition at line 427 of file CJDockContext.cpp.

References CanDockDockBar.

Referenced by StartDragDockBar, and TrackDockBar.

00428 {
00429     CPoint ptOffset = pt - m_ptLast;
00430
00431     m_rectDragHorz.OffsetRect(ptOffset);
00432     m_rectFrameDragHorz.OffsetRect(ptOffset);
00433     m_rectDragVert.OffsetRect(ptOffset);
00434     m_rectFrameDragVert.OffsetRect(ptOffset);
00435     m_ptLast = pt;
00436     m_dwOverDockStyle = m_bForceFrame ? 0 : CanDockDockBar();
00437     DrawFocusRect();
00438 }

void CCJDockContext::StartDragDockBar ( CPoint pt )

Definition at line 119 of file CJDockContext.cpp.

References AdjustRectangle, CanDockDockBar, HORZF, m_ptOrig, MoveDockBar, TrackDockBar, and TRUE.

00120 {
00121     ASSERT_VALID(m_pBar);
00122     m_bDragging = TRUE;
00123
00124     InitLoop();
00125
00126     if (m_pBar->m_dwStyle & CBRS_SIZE_DYNAMIC)
00127     {
00128         CRect rect;
00129         m_pBar->GetWindowRect(rect);
00130         // Yiannhs setup and the new member
00131         m_ptOrig = m_ptLast = pt;
00132         CSize sizeHorz = m_pBar->CalcDynamicLayout(0, LM_HORZ | LM_HORZDOCK);
00133         CSize sizeVert = m_pBar->CalcDynamicLayout(0, LM_VERTDOCK);
00134         CSize sizeFloat = m_pBar->CalcDynamicLayout(0, LM_HORZ | LM_MRUWIDTH);
00135
00136         m_rectDragHorz = CRect(rect.TopLeft(), sizeHorz);
00137         m_rectDragVert = CRect(rect.TopLeft(), sizeVert);
00138
00139         // calculate frame dragging rectangle
00140         m_rectFrameDragHorz = CRect(rect.TopLeft(), sizeFloat);
00141         m_rectFrameDragVert = CRect(rect.TopLeft(), sizeFloat);
00142
00143         CMiniFrameWnd::CalcBorders(&m_rectFrameDragHorz);
00144         CMiniFrameWnd::CalcBorders(&m_rectFrameDragVert);
00145
00146         m_rectFrameDragHorz.InflateRect(-afxData.cxBorder2, -afxData.cyBorder2);
00147         m_rectFrameDragVert.InflateRect(-afxData.cxBorder2, -afxData.cyBorder2);
00148     }
00149
00150     else if (m_pBar->m_dwStyle & CBRS_SIZE_FIXED)
00151     {
00152         CRect rect;
00153         m_pBar->GetWindowRect(rect);
00154         //Yiannhs setup and the new member
00155         m_ptOrig = m_ptLast = pt;
00156         CSize sizeHorz = m_pBar->CalcDynamicLayout(-1, LM_HORZ | LM_HORZDOCK);
00157         CSize sizeVert = m_pBar->CalcDynamicLayout(-1, LM_VERTDOCK);
00158
00159         m_rectFrameDragHorz = m_rectDragHorz = CRect(rect.TopLeft(), sizeHorz);
00160         m_rectFrameDragVert = m_rectDragVert = CRect(rect.TopLeft(), sizeVert);
00161
00162         CMiniFrameWnd::CalcBorders(&m_rectFrameDragHorz);
00163         CMiniFrameWnd::CalcBorders(&m_rectFrameDragVert);
00164         m_rectFrameDragHorz.InflateRect(-afxData.cxBorder2, -afxData.cyBorder2);
00165         m_rectFrameDragVert.InflateRect(-afxData.cxBorder2, -afxData.cyBorder2);
00166     }
00167
00168     else
00169     {
00170         CRect rect;
00171         m_pBar->GetWindowRect(rect);
00172         //Yiannhs setup and the new member
00173         m_ptOrig = m_ptLast = pt;
00174         BOOL bHorz = HORZF(m_dwStyle);
00175         DWORD dwMode = !bHorz ? (LM_HORZ | LM_HORZDOCK) : LM_VERTDOCK;
00176         CSize size = m_pBar->CalcDynamicLayout(-1, dwMode);
00177
00178         if (bHorz)
00179         {
00180             m_rectDragHorz = rect;
00181             m_rectDragVert = CRect(CPoint(pt.x - rect.Height()/2, rect.top), size);
00182         }
00183
00184         else
00185         {
00186             m_rectDragVert = rect;
00187             m_rectDragHorz = CRect(CPoint(rect.left, pt.y - rect.Width()/2), size);
00188         }
00189
00190         m_rectFrameDragHorz = m_rectDragHorz;
00191         m_rectFrameDragVert = m_rectDragVert;
00192
00193         CMiniFrameWnd::CalcBorders(&m_rectFrameDragHorz);
00194         CMiniFrameWnd::CalcBorders(&m_rectFrameDragVert);
00195         m_rectFrameDragHorz.InflateRect(-afxData.cxBorder2, -afxData.cyBorder2);
00196         m_rectFrameDragVert.InflateRect(-afxData.cxBorder2, -afxData.cyBorder2);
00197     }
00198
00199     AdjustRectangle(m_rectDragHorz, pt);
00200     AdjustRectangle(m_rectDragVert, pt);
00201     AdjustRectangle(m_rectFrameDragHorz, pt);
00202     AdjustRectangle(m_rectFrameDragVert, pt);
00203
00204     m_dwOverDockStyle = CanDockDockBar();
00205     MoveDockBar(pt);
00206     TrackDockBar();
00207 }

void CCJDockContext::StartResize | ( | int | nHitTest,
 |  | CPoint | pt
 | ) | [virtual]

Definition at line 515 of file CJDockContext.cpp.

References ASSERT, FALSE, m_rectActualFrameSize, m_rectActualSize, m_rectFrameBorders, m_rectRequestedSize, Stretch, and TrackDockBar.

00516 {
00517     ASSERT_VALID(m_pBar);
00518     ASSERT(m_pBar->m_dwStyle & CBRS_SIZE_DYNAMIC);
00519     m_bDragging = FALSE;
00520
00521     InitLoop();
00522
00523     // GetWindowRect returns screen coordinates(not mirrored)
00524     // So if the desktop is mirrored then turn off mirroring
00525     // for the desktop dc so that we draw correct focus rect
00526 #ifndef _VC_VERSION_5
00527
00529 #ifndef LAYOUT_LTR
00530 #define LAYOUT_LTR 0x00000000
00531 #endif
00532
00533     if (m_pDC->GetLayout() & LAYOUT_RTL)
00534         m_pDC->SetLayout(LAYOUT_LTR);
00535 #endif // _VC_VERSION_5
00536
00537     // get true bar size (including borders)
00538     CRect rect;
00539     m_pBar->GetWindowRect(rect);
00540     m_ptLast = pt;
00541     m_nHitTest = nHitTest;
00542
00543     CSize size = m_pBar->CalcDynamicLayout(0, LM_HORZ | LM_MRUWIDTH);
00544     m_rectRequestedSize = CRect(rect.TopLeft(), size);
00545     m_rectActualSize = CRect(rect.TopLeft(), size);
00546     m_rectActualFrameSize = CRect(rect.TopLeft(), size);
00547
00548     // calculate frame rectangle
00549     CMiniFrameWnd::CalcBorders(&m_rectActualFrameSize);
00550     m_rectActualFrameSize.InflateRect(-afxData.cxBorder2, -afxData.cyBorder2);
00551
00552     m_rectFrameBorders = CRect(CPoint(0,0),
00553         m_rectActualFrameSize.Size() - m_rectActualSize.Size());
00554
00555     // initialize tracking state and enter tracking loop
00556     m_dwOverDockStyle = 0;
00557     Stretch(pt);   // call it here to handle special keys
00558     TrackDockBar();
00559 }

void CCJDockContext::Stretch ( CPoint pt )

Definition at line 561 of file CJDockContext.cpp.

References m_rectActualFrameSize, m_rectActualSize, m_rectFrameBorders, and m_rectRequestedSize.

Referenced by StartResize, and TrackDockBar.

00562 {
00563     CPoint ptOffset = pt - m_ptLast;
00564     CSize size;
00565
00566     // offset all drag rects to new position
00567     if (m_nHitTest != HTTOP && m_nHitTest != HTBOTTOM)
00568     {
00569         if (m_nHitTest == HTLEFT || m_nHitTest == HTTOPLEFT || m_nHitTest == HTBOTTOMLEFT)
00570             m_rectRequestedSize.left += ptOffset.x;
00571         else
00572             m_rectRequestedSize.right += ptOffset.x;
00573         size = m_pBar->CalcDynamicLayout(m_rectRequestedSize.Width(), LM_HORZ);
00574     }
00575
00576     if (m_nHitTest != HTLEFT && m_nHitTest != HTRIGHT)
00577     {
00578         if (m_nHitTest == HTTOP || m_nHitTest == HTTOPLEFT || m_nHitTest == HTTOPRIGHT)
00579             m_rectRequestedSize.top += ptOffset.y;
00580         else
00581             m_rectRequestedSize.bottom += ptOffset.y;
00582         size = m_pBar->CalcDynamicLayout(m_rectRequestedSize.Height(), LM_HORZ|LM_LENGTHY);
00583     }
00584
00585     CRect rectDesk;
00586     HWND hWndDesk = ::GetDesktopWindow();
00587     ::GetWindowRect(hWndDesk, &rectDesk);
00588     CRect rectTemp = m_rectActualFrameSize;
00589
00590     // left, top, top left
00591     if (m_nHitTest == HTLEFT || m_nHitTest == HTTOP || m_nHitTest == HTTOPLEFT)
00592     {
00593         rectTemp.left = rectTemp.right -
00594             (size.cx + m_rectFrameBorders.Width());
00595         rectTemp.top = rectTemp.bottom -
00596             (size.cy + m_rectFrameBorders.Height());
00597         CRect rect;
00598         if (rect.IntersectRect(rectDesk, rectTemp))
00599         {
00600             m_rectActualSize.left = m_rectActualSize.right - size.cx;
00601             m_rectActualSize.top = m_rectActualSize.bottom - size.cy;
00602             m_rectActualFrameSize.left = rectTemp.left;
00603             m_rectActualFrameSize.top = rectTemp.top;
00604         }
00605     } else if (m_nHitTest == HTTOPRIGHT) // top right
00606     {
00607         rectTemp.top = rectTemp.bottom -
00608             (size.cy + m_rectFrameBorders.Height());
00609         rectTemp.right = rectTemp.left +
00610             (size.cx + m_rectFrameBorders.Width());
00611         CRect rect;
00612         if (rect.IntersectRect(rectDesk, rectTemp))
00613         {
00614             m_rectActualSize.left = m_rectActualSize.right - size.cx;
00615             m_rectActualSize.bottom = m_rectActualSize.top + size.cy;
00616             m_rectActualFrameSize.right = rectTemp.right;
00617             m_rectActualFrameSize.top = rectTemp.top;
00618         }
00619     } else if (m_nHitTest == HTBOTTOMLEFT) // bottom left
00620     {
00621         rectTemp.bottom = rectTemp.top +
00622             (size.cy + m_rectFrameBorders.Height());
00623         rectTemp.left = rectTemp.right -
00624             (size.cx + m_rectFrameBorders.Width());
00625         CRect rect;
00626         if (rect.IntersectRect(rectDesk, rectTemp))
00627         {
00628             m_rectActualSize.right = m_rectActualSize.left + size.cx;
00629             m_rectActualSize.top = m_rectActualSize.bottom - size.cy;
00630             m_rectActualFrameSize.left = rectTemp.left;
00631             m_rectActualFrameSize.bottom = rectTemp.bottom;
00632         }
00633     } else// bottom, right, bottom right
00634     {
00635         rectTemp.right = rectTemp.left +
00636             (size.cx + m_rectFrameBorders.Width());
00637         rectTemp.bottom = rectTemp.top +
00638             (size.cy + m_rectFrameBorders.Height());
00639         CRect rect;
00640         if (rect.IntersectRect(rectDesk, rectTemp))
00641         {
00642             m_rectActualSize.right = m_rectActualSize.left + size.cx;
00643             m_rectActualSize.bottom = m_rectActualSize.top + size.cy;
00644             m_rectActualFrameSize.right = rectTemp.right;
00645             m_rectActualFrameSize.bottom = rectTemp.bottom;
00646         }
00647     }
00648     m_ptLast = pt;
00649
00650     // update feedback
00651     DrawFocusRect();
00652 }

void CCJDockContext::ToggleDocking ( ) [virtual]

Definition at line 469 of file CJDockContext.cpp.

References AFX_IDW_SIZEBAR_BOTTOM, ASSERT, DockSizeBar, and NULL.

00470 {
00471     if (m_pBar->IsKindOf(RUNTIME_CLASS(CCJControlBar)))
00472     {
00473         if (m_pBar->IsFloating())
00474         {
00475             // Dock it only if is allowed to be docked
00476             if (m_pBar->m_dwDockStyle & CBRS_ALIGN_ANY)
00477             {
00478                 ASSERT((m_uMRUDockID >= AFX_IDW_DOCKBAR_TOP && m_uMRUDockID <= AFX_IDW_SIZEBAR_BOTTOM) ||
00479                     m_uMRUDockID == 0);
00480
00481                 CRect rect = m_rectMRUDockPos;
00482                 CCJSizeDockBar* pDockBar = NULL;
00483                 if (m_uMRUDockID != 0)
00484                 {
00485                     pDockBar = (CCJSizeDockBar*)m_pDockSite->GetControlBar(m_uMRUDockID);
00486                     pDockBar->ClientToScreen(&rect);
00487                 }
00488
00489                 // dock it at the specified position, RecalcLayout will snap
00490                 DockSizeBar(m_pBar, pDockBar, &rect);
00491                 m_pDockSite->RecalcLayout();
00492             }
00493         }
00494         else
00495         {
00496             CPoint ptFloat = m_ptMRUFloatPos;
00497             if (ptFloat.x < 0 || ptFloat.y < 0)
00498             {
00499                 ptFloat = m_rectMRUDockPos.TopLeft();
00500                 m_pBar->GetParent()->ClientToScreen(&ptFloat);
00501             }
00502             m_pDockSite->FloatControlBar(m_pBar, ptFloat, m_dwMRUFloatStyle);
00503         }
00504     }
00505 }

BOOL CCJDockContext::TrackDockBar ( )

Definition at line 294 of file CJDockContext.cpp.

References ASSERT, EndDragDockBar, FALSE, MoveDockBar, NULL, Stretch, and TRUE.

Referenced by StartDragDockBar, and StartResize.

00295 {
00296     if (::GetCapture() != NULL)
00297         return FALSE;
00298     m_pBar->SetCapture();
00299     ASSERT(m_pBar == CWnd::GetCapture());
00300
00301     while (CWnd::GetCapture() == m_pBar)
00302     {
00303         MSG msg;
00304         if (!::GetMessage(&msg, NULL, 0, 0))
00305         {
00306             AfxPostQuitMessage(msg.wParam);
00307             break;
00308         }
00309
00310         switch (msg.message)
00311         {
00312         case WM_LBUTTONUP:
00313             if (m_bDragging)
00314                 EndDragDockBar();
00315             else
00316                 EndResize();
00317             return TRUE;
00318         case WM_MOUSEMOVE:
00319             if (m_bDragging)
00320                 MoveDockBar(msg.pt);
00321             else
00322                 Stretch(msg.pt);
00323             break;
00324         case WM_KEYUP:
00325             if (m_bDragging)
00326                 OnKey((int)msg.wParam, FALSE);
00327             break;
00328         case WM_KEYDOWN:
00329             if (m_bDragging)
00330                 OnKey((int)msg.wParam, TRUE);
00331             if (msg.wParam == VK_ESCAPE)
00332             {
00333                 CancelLoop();
00334                 return FALSE;
00335             }
00336             break;
00337         case WM_RBUTTONDOWN:
00338             CancelLoop();
00339             return FALSE;
00340
00341             // just dispatch rest of the messages
00342         default:
00343             DispatchMessage(&msg);
00344             break;
00345         }
00346     }
00347
00348     CancelLoop();
00349     return FALSE;
00350 }

Member Data Documentation

CPoint CCJDockContext::m_ptOrig

Definition at line 103 of file CJDockContext.h.

Referenced by EndDragDockBar, and StartDragDockBar.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJDockContext.h
  • WinCvs/CJLib/CJLibrary/CJDockContext.cpp
Generated on Sun Feb 24 01:24:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJExplorerBar Class Reference

#include <CJExplorerBar.h>

Inheritance diagram for CCJExplorerBar:

[legend]
Collaboration diagram for CCJExplorerBar:

[legend]
List of all members.

Public Methods

CCJExplorerBar ()
virtual | ~CCJExplorerBar ()
virtual BOOL | Create (CWnd *pParentWnd, UINT nID, LPCTSTR lpszWindowName=NULL, CSize sizeDefault=CSize(200, 100), DWORD dwStyle=CBRS_LEFT)
virtual void | GetChildRect (CRect &rect)

Protected Methods

afx_msg int | OnCreate (LPCREATESTRUCT lpCreateStruct)
afx_msg void | OnButtonClose ()
afx_msg void | OnUpdateButtonClose (CCmdUI *pCmdUI)
afx_msg void | OnWindowPosChanged (WINDOWPOS FAR *lpwndpos)
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)
afx_msg void | OnLButtonDown (UINT nFlags, CPoint point)
afx_msg void | OnLButtonUp (UINT nFlags, CPoint point)

Protected Attributes

CCJCaption m_Caption
CCJFlatButton m_CaptionButton
CString | m_strCaption
HICON | m_hIcon

Constructor & Destructor Documentation

CCJExplorerBar::CCJExplorerBar ( )

Definition at line 99 of file CJExplorerBar.cpp.

References m_hIcon, m_strCaption, and NULL.

00100 {
00101     m_hIcon = NULL;
00102     m_strCaption = _T("");
00103 }

CCJExplorerBar::~CCJExplorerBar ( ) [virtual]

Definition at line 105 of file CJExplorerBar.cpp.

References _destroyIcon, and m_hIcon.

00106 {
00107     // fix potential resource leak - KStowell - 10-22-99.
00108     _destroyIcon(m_hIcon);
00109 }

Member Function Documentation

BOOL CCJExplorerBar::Create | ( | CWnd * | pParentWnd,
 |  | UINT | nID,
 |  | LPCTSTR | lpszWindowName = NULL,
 |  | CSize | sizeDefault = CSize(200, 100),
 |  | DWORD | dwStyle = CBRS_LEFT
 | ) | [virtual]

Definition at line 128 of file CJExplorerBar.cpp.

References CCJControlBar::Create, FALSE, m_strCaption, CCJControlBar::ShowFrameControls, and TRUE.

00129 {
00130     m_strCaption = lpszWindowName;
00131
00132     if(!CCJControlBar::Create(pParentWnd, nID, lpszWindowName, sizeDefault, dwStyle)) {
00133         return FALSE;
00134     }
00135
00136     ShowFrameControls(FALSE, FALSE);
00137     return TRUE;
00138 }

void CCJExplorerBar::GetChildRect ( CRect & rect ) [virtual]

Reimplemented from CCJControlBar.

Definition at line 182 of file CJExplorerBar.cpp.

References CCJControlBar::IsFloating, and CCJControlBar::IsVertDocked.

Referenced by OnWindowPosChanged.

00183 {
00184     GetClientRect(&rect);
00185
00186     if (!IsFloating())
00187     {
00188         rect.left   += 1;
00189         rect.right  -= 1;
00190         rect.top    += (IsVertDocked()?26:22);
00191     }
00192
00193     else
00194         rect.DeflateRect(2,2);
00195 }

void CCJExplorerBar::OnButtonClose ( ) [protected]

Reimplemented from CCJControlBar.

Definition at line 172 of file CJExplorerBar.cpp.

References FALSE.

00173 {
00174     GetDockingFrame()->ShowControlBar(this, FALSE, FALSE);
00175 }

int CCJExplorerBar::OnCreate ( LPCREATESTRUCT lpCreateStruct ) [protected]

Reimplemented from CCJControlBar.

Definition at line 140 of file CJExplorerBar.cpp.

References CCJCaption::Create, IDB_PUSHPIN, IDC_BAR_BUTTON, m_Caption, m_CaptionButton, m_hIcon, m_strCaption, NULL, CCJControlBar::OnCreate, and CCJFlatButton::SetIcon.

00141 {
00142     if (CCJControlBar::OnCreate(lpCreateStruct) == -1)
00143         return -1;
00144
00145     // Create the caption.
00146     if (!m_Caption.Create(this, m_strCaption))
00147     {
00148         TRACE0( "Unable to create caption.\n" );
00149         return -1;
00150     }
00151
00152     // Create the caption button.
00153     if (!m_CaptionButton.Create(NULL, WS_VISIBLE|BS_ICON|BS_OWNERDRAW|BS_CENTER|BS_VCENTER,
00154         CRect(0,0,0,0), this, IDC_BAR_BUTTON))
00155     {
00156         TRACE0( "Unable to create caption button.\n" );
00157         return -1;
00158     }
00159
00160     // Create the image list used by frame buttons.
00161     CImageList imageList;
00162     imageList.Create(IDB_PUSHPIN, 16, 1, RGB(255,0,255));
00163     m_hIcon = imageList.ExtractIcon(2);
00164
00165     // Associate the button icon
00166     m_CaptionButton.SetIcon(m_hIcon, CSize(16,15));
00167     imageList.DeleteImageList();
00168
00169     return 0;
00170 }

BOOL CCJExplorerBar::OnEraseBkgnd ( CDC * pDC ) [protected]

Reimplemented from CCJControlBar.

Definition at line 229 of file CJExplorerBar.cpp.

References CCJControlBar::IsVertDocked.

00230 {
00231     int result = CControlBar::OnEraseBkgnd(pDC);
00232
00233     CRect rect;
00234     GetClientRect(rect);
00235     rect.top+=(IsVertDocked()?3:-1);
00236     rect.bottom += 1;
00237     //Yiannhs This was a side effect of removing the variables
00238     pDC->Draw3dRect(rect, afxData.clrBtnShadow, afxData.clrBtnShadow);
00239     //pDC->Draw3dRect(rect, m_clrBtnShadow, m_clrBtnShadow);
00240     return result;
00241 }

void CCJExplorerBar::OnLButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Reimplemented from CCJControlBar.

Definition at line 243 of file CJExplorerBar.cpp.

00244 {
00245     // bypass CCJControlBar.
00246 }

void CCJExplorerBar::OnLButtonUp | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Reimplemented from CCJControlBar.

Definition at line 248 of file CJExplorerBar.cpp.

00249 {
00250     // bypass CCJControlBar.
00251 }

void CCJExplorerBar::OnUpdateButtonClose ( CCmdUI * pCmdUI ) [protected]

Reimplemented from CCJControlBar.

Definition at line 177 of file CJExplorerBar.cpp.

References TRUE.

00178 {
00179     pCmdUI->Enable(TRUE);
00180 }

void CCJExplorerBar::OnWindowPosChanged ( WINDOWPOS FAR * lpwndpos ) [protected]

Reimplemented from CCJControlBar.

Definition at line 197 of file CJExplorerBar.cpp.

References GetChildRect, CCJControlBar::IsFloating, CCJControlBar::IsVertDocked, m_Caption, m_CaptionButton, and CCJControlBar::m_pChildWnd.

00198 {
00199     CControlBar::OnWindowPosChanged(lpwndpos);
00200
00201     int nCmdShow = IsFloating() ? SW_HIDE:SW_SHOW;
00202     m_Caption.ShowWindow(nCmdShow);
00203     m_CaptionButton.ShowWindow(nCmdShow);
00204
00205     if (!IsFloating())
00206     {
00207         if (IsVertDocked())
00208         {
00209             m_Caption.MoveWindow(1,4,lpwndpos->cx-1,22);
00210             m_CaptionButton.MoveWindow(CRect(lpwndpos->cx-25,
00211                 7, lpwndpos->cx-5, 24));
00212         }
00213         else
00214         {
00215             m_Caption.MoveWindow(1,0,lpwndpos->cx-1,22);
00216             m_CaptionButton.MoveWindow(CRect(lpwndpos->cx-25,
00217                 3, lpwndpos->cx-5, 20));
00218         }
00219     }
00220
00221     if (m_pChildWnd->GetSafeHwnd())
00222     {
00223         CRect rc;
00224         GetChildRect(rc);
00225         m_pChildWnd->MoveWindow(rc);
00226     }
00227 }

Member Data Documentation

CCJCaption CCJExplorerBar::m_Caption [protected]

Definition at line 85 of file CJExplorerBar.h.

Referenced by OnCreate, and OnWindowPosChanged.

CCJFlatButton CCJExplorerBar::m_CaptionButton [protected]

Definition at line 86 of file CJExplorerBar.h.

Referenced by OnCreate, and OnWindowPosChanged.

HICON CCJExplorerBar::m_hIcon [protected]

Reimplemented from CCJControlBar.

Definition at line 88 of file CJExplorerBar.h.

Referenced by CCJExplorerBar, OnCreate, and ~CCJExplorerBar.

CString CCJExplorerBar::m_strCaption [protected]

Definition at line 87 of file CJExplorerBar.h.

Referenced by CCJExplorerBar, Create, and OnCreate.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJExplorerBar.h
  • WinCvs/CJLib/CJLibrary/CJExplorerBar.cpp
Generated on Sun Feb 24 01:24:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJFlatButton Class Reference

#include <CJFlatButton.h>

Inheritance diagram for CCJFlatButton:

[legend]
Collaboration diagram for CCJFlatButton:

[legend]
List of all members.

Public Methods

CCJFlatButton ()
virtual | ~CCJFlatButton ()
virtual void | SetButtonFont (CFont *pFont)
virtual void | SetAlternateColors (COLORREF clrAltNormal, COLORREF clrAltHilite, COLORREF clrAltShadow, COLORREF clrAltTextNm)
virtual void | DisableFlatLook (BOOL bDisable=FALSE)
virtual void | SetIcon (HICON hIcon, CSize size)
virtual void | SetIcon (HICON hIcon, HICON hPushed, CSize size)
virtual void | DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct)

Protected Methods

virtual void | DrawButtonIcon (CDC *pDC, UINT nState, CRect &rcItem)
virtual void | DrawButtonText (CDC *pDC, UINT nState, CRect &rcItem)
virtual void | DrawButtonBitmap (CDC *pDC, UINT nState, CRect &rcItem)
virtual void | UpdateFont ()
afx_msg void | OnMouseMove (UINT nFlags, CPoint point)
afx_msg void | OnLButtonDown (UINT nFlags, CPoint point)
afx_msg void | OnLButtonUp (UINT nFlags, CPoint point)
afx_msg void | OnTimer (UINT nIDEvent)
afx_msg void | OnSysColorChange ()
afx_msg BOOL | OnSetCursor (CWnd *pWnd, UINT nHitTest, UINT message)
afx_msg void | OnLButtonDblClk (UINT nFlags, CPoint point)
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)
afx_msg void | OnPaint ()

Protected Attributes

BOOL | m_bMouseOver
BOOL | m_bLBtnDown
BOOL | m_bFlatLook
CSize | m_sizeIcon
COLORREF | m_clrHilite
COLORREF | m_clrShadow
COLORREF | m_clrDkShad
COLORREF | m_clrNormal
COLORREF | m_clrTextGy
COLORREF | m_clrTextNm
COLORREF | m_clrAltNormal
COLORREF | m_clrAltHilite
COLORREF | m_clrAltShadow
COLORREF | m_clrAltTextNm
BOOL | m_bAltColor
BOOL | m_bPainted
HICON | m_hPushed
CFont * | m_pFont
CFont | m_Font
HCURSOR | m_hCursor

Constructor & Destructor Documentation

CCJFlatButton::CCJFlatButton ( )

Definition at line 146 of file CJFlatButton.cpp.

References FALSE, IDC_HANDCUR, NULL, TRUE, and UpdateFont.

00147 {
00148     m_pFont     = NULL;
00149     m_hPushed   = NULL;
00150     m_bLBtnDown = FALSE;
00151     m_bFlatLook = TRUE;
00152     m_bPainted  = FALSE;
00153     m_bAltColor = FALSE;
00154
00155     m_clrHilite = ::GetSysColor(COLOR_BTNHIGHLIGHT);
00156     m_clrShadow = ::GetSysColor(COLOR_BTNSHADOW);
00157     m_clrDkShad = ::GetSysColor(COLOR_3DDKSHADOW);
00158     m_clrNormal = ::GetSysColor(COLOR_BTNFACE);
00159     m_clrTextGy = ::GetSysColor(COLOR_GRAYTEXT);
00160     m_clrTextNm = ::GetSysColor(COLOR_BTNTEXT);
00161
00162     m_hCursor   = AfxGetApp()->LoadCursor( IDC_HANDCUR );
00163     UpdateFont();
00164 }

CCJFlatButton::~CCJFlatButton ( ) [virtual]

Definition at line 166 of file CJFlatButton.cpp.

References m_Font.

00167 {
00168     // fix potential resource leak - KStowell - 10-21-99
00169     m_Font.DeleteObject();
00170 }

Member Function Documentation

_CJXLIB_INLINE void CCJFlatButton::DisableFlatLook ( BOOL bDisable = FALSE ) [virtual]

Definition at line 247 of file CJFlatButton.h.

References ASSERT, and m_bFlatLook.

Referenced by CCJControlBar::EnableFlatLook, and CCJControlBar::OnCreate.

00248     { ASSERT(::IsWindow(m_hWnd)); m_bFlatLook = bDisable; Invalidate(); }

void CCJFlatButton::DrawButtonBitmap | ( | CDC * | pDC,
 |  | UINT | nState,
 |  | CRect & | rcItem
 | ) | [protected, virtual]

Reimplemented in CPseudoButton.

Definition at line 368 of file CJFlatButton.cpp.

References NULL.

Referenced by DrawItem.

00369 {
00370     // get the handle to the bitmap (if any) associated
00371     // with this button.
00372     HBITMAP hBitmap = GetBitmap();
00373     if( hBitmap == NULL ) {
00374         return;
00375     }
00376
00377     CRect rc = rcItem;
00378
00379     // if the button is selected.
00380     if( nState & ODS_SELECTED ) {
00381         rcItem.OffsetRect(1,1);
00382     }
00383
00384     // draw the bitmap associated with this button.
00385     pDC->DrawState( rc.TopLeft(), rc.Size(), hBitmap,
00386         ( nState & ODS_DISABLED )?DSS_DISABLED:DSS_NORMAL, (HBRUSH)NULL );
00387 }

void CCJFlatButton::DrawButtonIcon | ( | CDC * | pDC,
 |  | UINT | nState,
 |  | CRect & | rcItem
 | ) | [protected, virtual]

Reimplemented in CCJCBarButton.

Definition at line 330 of file CJFlatButton.cpp.

References GetIcon, m_hPushed, m_sizeIcon, and NULL.

Referenced by DrawItem.

00331 {
00332     UNUSED_ALWAYS( rcItem );
00333
00334     // get the handle to the icon (if any) associated
00335     // with this button.
00336     HICON hIcon = GetIcon();
00337     if( hIcon == NULL ) {
00338         return;
00339     }
00340
00341     CRect rcWnd;
00342     GetWindowRect(&rcWnd);
00343
00344     int left   = (rcWnd.Width()-m_sizeIcon.cx)/2;
00345     int right  = left+m_sizeIcon.cx;
00346     int top    = (rcWnd.Height()-m_sizeIcon.cy)/2;
00347     int bottom = top+m_sizeIcon.cy;
00348
00349     // determine the size of the icon to be drawn.
00350     CRect rc(left,top,right,bottom);
00351
00352     // if the button is selected.
00353     if( nState & ODS_SELECTED )
00354     {
00355         if( m_hPushed ) {
00356             hIcon = m_hPushed;
00357         }
00358         else {
00359             rc.OffsetRect(1,1);
00360         }
00361     }
00362
00363     // draw the icon associated with this button.
00364     pDC->DrawState( rc.TopLeft(), rc.Size(), hIcon,
00365         ( nState & ODS_DISABLED )?DSS_DISABLED:DSS_NORMAL, (HBRUSH)NULL );
00366 }

void CCJFlatButton::DrawButtonText | ( | CDC * | pDC,
 |  | UINT | nState,
 |  | CRect & | rcItem
 | ) | [protected, virtual]

Reimplemented in CCJCaptionButton.

Definition at line 302 of file CJFlatButton.cpp.

References m_Font, m_pFont, and NULL.

Referenced by DrawItem.

00303 {
00304     // Get the window text, return if empty.
00305     CString strWindowText; GetWindowText(strWindowText);
00306     if( strWindowText.IsEmpty( ))
00307         return;
00308
00309     if( m_pFont == NULL ) {
00310         m_pFont = &m_Font;
00311     }
00312
00313     CRect rc = rcItem;
00314     rc.DeflateRect( 2,0 );
00315
00316     // Set the text color and select the button font.
00317     pDC->SetTextColor(( nState & ODS_DISABLED )?m_clrTextGy:m_clrTextNm);
00318     CFont *oldFont = pDC->SelectObject( m_pFont );
00319
00320     // if the button is selected.
00321     if( nState & ODS_SELECTED ) {
00322         rc.OffsetRect(1,1);
00323     }
00324
00325     // draw the text, and select the original font.
00326     pDC->DrawText( strWindowText, -1, rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE );
00327     pDC->SelectObject( oldFont );
00328 }

void CCJFlatButton::DrawItem ( LPDRAWITEMSTRUCT lpDrawItemStruct ) [virtual]

Reimplemented in CPseudoButton.

Definition at line 266 of file CJFlatButton.cpp.

References ASSERT, DrawButtonBitmap, DrawButtonIcon, DrawButtonText, m_clrNormal, and NULL.

Referenced by CPseudoButton::DrawItem.

00267 {
00268     ASSERT(lpDrawItemStruct != NULL);
00269
00270     // define some temporary variables.
00271     CDC*  pDC    = CDC::FromHandle( lpDrawItemStruct->hDC );
00272     CRect rcItem = lpDrawItemStruct->rcItem;
00273     int   nState = lpDrawItemStruct->itemState;
00274
00275     // Paint the background.
00276     pDC->FillSolidRect( rcItem, m_clrNormal );
00277
00278     // Draw flat button border.
00279     if( m_bFlatLook ) {
00280         pDC->Draw3dRect( rcItem, (nState & ODS_SELECTED)?m_clrShadow:m_clrNormal,
00281             (nState & ODS_SELECTED)?m_clrHilite:m_clrNormal );
00282     }
00283
00284     // Draw normal border.
00285     else {
00286         pDC->Draw3dRect( rcItem, (nState & ODS_SELECTED)?m_clrDkShad:m_clrHilite,
00287             (nState & ODS_SELECTED)?m_clrHilite:m_clrDkShad);
00288         rcItem.DeflateRect(1,1);
00289         pDC->Draw3dRect( rcItem, (nState & ODS_SELECTED)?m_clrShadow:m_clrNormal,
00290             (nState & ODS_SELECTED)?m_clrNormal:m_clrShadow);
00291     }
00292
00293     // Set the background mode to transparent.
00294     pDC->SetBkMode( TRANSPARENT );
00295
00296     // draw the button text, icon or bitmap.
00297     DrawButtonText(pDC, nState, rcItem);
00298     DrawButtonIcon(pDC, nState, rcItem);
00299     DrawButtonBitmap(pDC, nState, rcItem);
00300 }

BOOL CCJFlatButton::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 421 of file CJFlatButton.cpp.

References TRUE.

00422 {
00423     // KStowell - overridden for flicker-free drawing.
00424     UNUSED_ALWAYS(pDC);
00425     return TRUE;
00426 }

void CCJFlatButton::OnLButtonDblClk | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 410 of file CJFlatButton.cpp.

References NULL.

00411 {
00412     POINT pt;
00413
00414     ::GetCursorPos(&pt);
00415     ::MapWindowPoints(NULL,(HWND)(m_hWnd),&pt,1);
00416     ::SendMessage((HWND)(m_hWnd),WM_LBUTTONDOWN,0,MAKELPARAM(pt.x,pt.y));
00417
00418     CButton::OnLButtonDblClk(nFlags, point);
00419 }

void CCJFlatButton::OnLButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 201 of file CJFlatButton.cpp.

References m_bLBtnDown, and TRUE.

00202 {
00203     m_bLBtnDown = TRUE;
00204     CButton::OnLButtonDown(nFlags, point);
00205 }

void CCJFlatButton::OnLButtonUp | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Reimplemented in CPseudoToggle.

Definition at line 207 of file CJFlatButton.cpp.

References FALSE, and m_bLBtnDown.

Referenced by CPseudoToggle::OnLButtonUp.

00208 {
00209     m_bLBtnDown = FALSE;
00210     CButton::OnLButtonUp(nFlags, point);
00211 }

void CCJFlatButton::OnMouseMove | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 190 of file CJFlatButton.cpp.

References NULL, and OnTimer.

00191 {
00192     if (m_bFlatLook)
00193     {
00194         SetTimer(1, 10, NULL);
00195         OnTimer(1);
00196     }
00197
00198     CButton::OnMouseMove(nFlags, point);
00199 }

void CCJFlatButton::OnPaint ( ) [protected]

Definition at line 428 of file CJFlatButton.cpp.

References m_clrNormal.

00429 {
00430     CPaintDC dc(this); // device context for painting
00431
00432     // KStowell - Get the client rect.
00433     CRect rcClient, rcClip;
00434     dc.GetClipBox( &rcClip );
00435     GetClientRect( &rcClient );
00436
00437     // KStowell - Create a memory device-context. This is done to help reduce
00438     // screen flicker, since we will paint the entire control to the
00439     // off screen device context first.
00440     CDC memDC;
00441     CBitmap bitmap;
00442     memDC.CreateCompatibleDC(&dc);
00443     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00444     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00445
00446     // KStowell - Repaint the background.
00447     memDC.FillSolidRect(rcClient, m_clrNormal);
00448
00449     // let the control do its default drawing.
00450     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00451
00452     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00453     dc.BitBlt( rcClip.left, rcClip.top, rcClip.Width(), rcClip.Height(), &memDC,
00454         rcClip.left, rcClip.top, SRCCOPY );
00455
00456     // KStowell - Cleanup resources.
00457     memDC.SelectObject(pOldBitmap);
00458     memDC.DeleteDC();
00459     bitmap.DeleteObject();
00460 }

BOOL CCJFlatButton::OnSetCursor | ( | CWnd * | pWnd,
 |  | UINT | nHitTest,
 |  | UINT | message
 | ) | [protected]

Definition at line 390 of file CJFlatButton.cpp.

References TRUE.

00391 {
00392     UNUSED_ALWAYS( pWnd );
00393     UNUSED_ALWAYS( nHitTest );
00394     UNUSED_ALWAYS( message );
00395
00396     ::SetCursor( m_hCursor );
00397
00398     return TRUE;
00399 }

void CCJFlatButton::OnSysColorChange ( ) [protected]

Reimplemented in CCJCaptionButton.

Definition at line 245 of file CJFlatButton.cpp.

References m_bAltColor, m_clrAltHilite, m_clrAltNormal, m_clrAltShadow, m_clrAltTextNm, m_clrDkShad, m_clrHilite, m_clrNormal, m_clrShadow, m_clrTextGy, and m_clrTextNm.

00246 {
00247     CButton::OnSysColorChange();
00248
00249     m_clrDkShad = ::GetSysColor(COLOR_3DDKSHADOW);
00250     m_clrTextGy = ::GetSysColor(COLOR_GRAYTEXT);
00251     m_clrTextNm = (m_bAltColor ? m_clrAltTextNm : ::GetSysColor(COLOR_BTNTEXT));
00252     m_clrNormal = (m_bAltColor ? m_clrAltNormal : ::GetSysColor(COLOR_BTNFACE));
00253     m_clrHilite = (m_bAltColor ? m_clrAltHilite : ::GetSysColor(COLOR_BTNHIGHLIGHT));
00254     m_clrShadow = (m_bAltColor ? m_clrAltShadow : ::GetSysColor(COLOR_BTNSHADOW));
00255 }

void CCJFlatButton::OnTimer ( UINT nIDEvent ) [protected]

Definition at line 213 of file CJFlatButton.cpp.

References FALSE, m_bLBtnDown, m_bPainted, m_clrHilite, m_clrShadow, NULL, and TRUE.

Referenced by OnMouseMove.

00214 {
00215     CRect rcItem;
00216     GetWindowRect(rcItem);
00217
00218     CPoint ptCursor;
00219     GetCursorPos(&ptCursor);
00220
00221     if(( m_bLBtnDown == TRUE ) || ( !rcItem.PtInRect( ptCursor )))
00222     {
00223         KillTimer(1);
00224
00225         if (m_bPainted == TRUE) {
00226             InvalidateRect (NULL);
00227         }
00228
00229         m_bPainted = FALSE;
00230         return;
00231     }
00232
00233     // On mouse over, show raised button.
00234     else if(( m_bFlatLook ) && ( !m_bPainted )) {
00235         CDC* pDC = GetDC();
00236         GetClientRect(rcItem);
00237         pDC->Draw3dRect( rcItem, m_clrHilite, m_clrShadow );
00238         m_bPainted = TRUE;
00239         ReleaseDC(pDC);
00240     }
00241
00242     CButton::OnTimer(nIDEvent);
00243 }

void CCJFlatButton::SetAlternateColors | ( | COLORREF | clrAltNormal,
 |  | COLORREF | clrAltHilite,
 |  | COLORREF | clrAltShadow,
 |  | COLORREF | clrAltTextNm
 | ) | [virtual]

Definition at line 257 of file CJFlatButton.cpp.

References m_bAltColor, m_clrAltHilite, m_clrAltNormal, m_clrAltShadow, m_clrAltTextNm, m_clrHilite, m_clrNormal, m_clrShadow, m_clrTextNm, and TRUE.

Referenced by CCJCaptionButton::SetButtonStyle.

00258 {
00259     m_clrNormal = m_clrAltNormal = clrAltNormal;
00260     m_clrHilite = m_clrAltHilite = clrAltHilite;
00261     m_clrShadow = m_clrAltShadow = clrAltShadow;
00262     m_clrTextNm = m_clrAltTextNm = clrAltTextNm;
00263     m_bAltColor = TRUE;
00264 }

_CJXLIB_INLINE void CCJFlatButton::SetButtonFont ( CFont * pFont ) [virtual]

Definition at line 256 of file CJFlatButton.h.

References ASSERT, and m_pFont.

00257     { ASSERT(::IsWindow(m_hWnd)); m_pFont = pFont; }

_CJXLIB_INLINE void CCJFlatButton::SetIcon | ( | HICON | hIcon,
 |  | HICON | hPushed,
 |  | CSize | size
 | ) | [virtual]

Definition at line 253 of file CJFlatButton.h.

References ASSERT, m_hPushed, and SetIcon.

00254     { ASSERT(::IsWindow(m_hWnd)); m_hPushed = hPushed; SetIcon(hIcon, size); }

_CJXLIB_INLINE void CCJFlatButton::SetIcon | ( | HICON | hIcon,
 |  | CSize | size
 | ) | [virtual]

Definition at line 250 of file CJFlatButton.h.

References ASSERT, m_sizeIcon, and SetIcon.

Referenced by CCJCaptionPopupWnd::Create, CCJExplorerBar::OnCreate, CCJControlBar::OnCreate, CCJControlBar::OnUpdateCmdUI, and SetIcon.

00251     { ASSERT(::IsWindow(m_hWnd)); m_sizeIcon = size; CButton::SetIcon(hIcon); }

void CCJFlatButton::UpdateFont ( ) [protected, virtual]

Definition at line 401 of file CJFlatButton.cpp.

References m_Font, and VERIFY.

Referenced by CCJFlatButton.

00402 {
00403     m_Font.DeleteObject();
00404     NONCLIENTMETRICS ncm;
00405     ncm.cbSize = sizeof(ncm);
00406     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00407     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00408 }

Member Data Documentation

BOOL CCJFlatButton::m_bAltColor [protected]

Definition at line 161 of file CJFlatButton.h.

Referenced by OnSysColorChange, and SetAlternateColors.

BOOL CCJFlatButton::m_bFlatLook [protected]

Definition at line 149 of file CJFlatButton.h.

Referenced by DisableFlatLook, and CPseudoButton::DrawItem.

BOOL CCJFlatButton::m_bLBtnDown [protected]

Definition at line 148 of file CJFlatButton.h.

Referenced by OnLButtonDown, OnLButtonUp, and OnTimer.

BOOL CCJFlatButton::m_bMouseOver [protected]

Definition at line 147 of file CJFlatButton.h.

BOOL CCJFlatButton::m_bPainted [protected]

Definition at line 162 of file CJFlatButton.h.

Referenced by OnTimer.

COLORREF CCJFlatButton::m_clrAltHilite [protected]

Definition at line 158 of file CJFlatButton.h.

Referenced by OnSysColorChange, and SetAlternateColors.

COLORREF CCJFlatButton::m_clrAltNormal [protected]

Definition at line 157 of file CJFlatButton.h.

Referenced by OnSysColorChange, and SetAlternateColors.

COLORREF CCJFlatButton::m_clrAltShadow [protected]

Definition at line 159 of file CJFlatButton.h.

Referenced by OnSysColorChange, and SetAlternateColors.

COLORREF CCJFlatButton::m_clrAltTextNm [protected]

Definition at line 160 of file CJFlatButton.h.

Referenced by OnSysColorChange, and SetAlternateColors.

COLORREF CCJFlatButton::m_clrDkShad [protected]

Definition at line 153 of file CJFlatButton.h.

Referenced by OnSysColorChange.

COLORREF CCJFlatButton::m_clrHilite [protected]

Definition at line 151 of file CJFlatButton.h.

Referenced by OnSysColorChange, OnTimer, and SetAlternateColors.

COLORREF CCJFlatButton::m_clrNormal [protected]

Definition at line 154 of file CJFlatButton.h.

Referenced by DrawItem, OnPaint, OnSysColorChange, and SetAlternateColors.

COLORREF CCJFlatButton::m_clrShadow [protected]

Definition at line 152 of file CJFlatButton.h.

Referenced by OnSysColorChange, OnTimer, and SetAlternateColors.

COLORREF CCJFlatButton::m_clrTextGy [protected]

Definition at line 155 of file CJFlatButton.h.

Referenced by OnSysColorChange.

COLORREF CCJFlatButton::m_clrTextNm [protected]

Definition at line 156 of file CJFlatButton.h.

Referenced by CCJCaptionButton::DrawButtonText, OnSysColorChange, and SetAlternateColors.

CFont CCJFlatButton::m_Font [protected]

Definition at line 165 of file CJFlatButton.h.

Referenced by DrawButtonText, CCJCaptionButton::DrawButtonText, UpdateFont, and ~CCJFlatButton.

HCURSOR CCJFlatButton::m_hCursor [protected]

Definition at line 166 of file CJFlatButton.h.

HICON CCJFlatButton::m_hPushed [protected]

Definition at line 163 of file CJFlatButton.h.

Referenced by DrawButtonIcon, and SetIcon.

CFont* CCJFlatButton::m_pFont [protected]

Definition at line 164 of file CJFlatButton.h.

Referenced by DrawButtonText, CCJCaptionButton::DrawButtonText, and SetButtonFont.

CSize CCJFlatButton::m_sizeIcon [protected]

Definition at line 150 of file CJFlatButton.h.

Referenced by DrawButtonIcon, and SetIcon.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJFlatButton.h
  • WinCvs/CJLib/CJLibrary/CJFlatButton.cpp
Generated on Sun Feb 24 01:24:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJFlatComboBox Class Reference

#include <CJFlatComboBox.h>

Inheritance diagram for CCJFlatComboBox:

[legend]
Collaboration diagram for CCJFlatComboBox:

[legend]
List of all members.

Public Methods

CCJFlatComboBox ()
virtual | ~CCJFlatComboBox ()
BOOL | IsWin95 ()
virtual void | EnableAutoCompletion (BOOL bEnable=TRUE)
virtual BOOL | PointInRect ()
virtual BOOL | PreTranslateMessage (MSG *pMsg)

Protected Types

enum STATE {
NORMAL = 1,
RAISED = 2,
PRESSED = 3
}

Protected Methods

virtual void | DrawCombo (STATE eState, COLORREF clrTopLeft, COLORREF clrBottomRight, CDC *pDC=NULL)
afx_msg void | OnMouseMove (UINT nFlags, CPoint point)
afx_msg void | OnLButtonDown (UINT nFlags, CPoint point)
afx_msg void | OnLButtonUp (UINT nFlags, CPoint point)
afx_msg void | OnTimer (UINT nIDEvent)
afx_msg void | OnPaint ()
afx_msg void | OnSetFocus ()
afx_msg void | OnKillFocus ()
afx_msg void | OnEditUpdate ()
afx_msg void | OnSysColorChange ()
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)

Protected Attributes

BOOL | m_bLBtnDown
BOOL | m_bPainted
BOOL | m_bHasFocus
BOOL | m_bAutoComp
COLORREF | m_clrHilite
COLORREF | m_clrShadow
COLORREF | m_clrNormal

Member Enumeration Documentation

enum CCJFlatComboBox::STATE [protected]

Enumeration values:
NORMAL
RAISED
PRESSED

Definition at line 150 of file CJFlatComboBox.h.

00150 { NORMAL = 1, RAISED = 2, PRESSED = 3 };

Constructor & Destructor Documentation

CCJFlatComboBox::CCJFlatComboBox ( )

Definition at line 126 of file CJFlatComboBox.cpp.

References FALSE.

00127 {
00128     m_bLBtnDown     = FALSE;
00129     m_bPainted      = FALSE;
00130     m_bHasFocus     = FALSE;
00131     m_bAutoComp     = FALSE;
00132     m_clrHilite     = ::GetSysColor(COLOR_BTNHIGHLIGHT);
00133     m_clrShadow     = ::GetSysColor(COLOR_BTNSHADOW);
00134     m_clrNormal     = ::GetSysColor(COLOR_BTNFACE);
00135 }

CCJFlatComboBox::~CCJFlatComboBox ( ) [virtual]

Definition at line 137 of file CJFlatComboBox.cpp.

00138 {
00139 }

Member Function Documentation

void CCJFlatComboBox::DrawCombo | ( | STATE | eState,
 |  | COLORREF | clrTopLeft,
 |  | COLORREF | clrBottomRight,
 |  | CDC * | pDC = NULL
 | ) | [protected, virtual]

Definition at line 245 of file CJFlatComboBox.cpp.

References m_clrHilite, m_clrNormal, m_clrShadow, NORMAL, NULL, PRESSED, and RAISED.

Referenced by OnKillFocus, OnPaint, OnSetFocus, and OnTimer.

00246 {
00247     CRect rcItem;
00248     GetClientRect(&rcItem);
00249     bool bRelease = false;
00250
00251     // if no device context was passed in, get the device context
00252     // for the CWnd client area ...
00253     if(pDC == NULL) {
00254         pDC = GetDC();
00255         bRelease = true;
00256     }
00257
00258     // Cover up dark 3D shadow.
00259     pDC->Draw3dRect(rcItem, clrTopLeft, clrBottomRight);
00260     rcItem.DeflateRect(1,1);
00261
00262     if (!IsWindowEnabled()) {
00263         pDC->Draw3dRect(rcItem, m_clrHilite, m_clrHilite);
00264     } else {
00265         pDC->Draw3dRect(rcItem, m_clrNormal, m_clrNormal);
00266     }
00267
00268     // Cover up dark 3D shadow on drop arrow.
00269     rcItem.DeflateRect(1,1);
00270     rcItem.left = rcItem.right-::GetSystemMetrics(SM_CXHTHUMB);;
00271     pDC->Draw3dRect(rcItem, m_clrNormal, m_clrNormal);
00272
00273     // Cover up NORMAL 3D shadow on drop arrow.
00274     rcItem.DeflateRect(1,1);
00275     pDC->Draw3dRect(rcItem, m_clrNormal, m_clrNormal);
00276
00277     if (!IsWindowEnabled()) {
00278         if(bRelease == true) {
00279             ReleaseDC(pDC);
00280         }
00281         return;
00282     }
00283
00284     rcItem.InflateRect(0,1);
00285     switch (eState)
00286     {
00287     case NORMAL:
00288         pDC->Draw3dRect(rcItem, m_clrHilite, m_clrHilite);
00289         rcItem.left -= 1;
00290         pDC->Draw3dRect(rcItem, m_clrHilite, m_clrHilite);
00291         break;
00292
00293     case RAISED:
00294         pDC->Draw3dRect(rcItem, m_clrHilite, m_clrShadow);
00295         break;
00296
00297     case PRESSED:
00298         rcItem.OffsetRect(1,1);
00299         pDC->Draw3dRect(rcItem, m_clrShadow, m_clrHilite);
00300         break;
00301     }
00302
00303     // KStowell - cleanup.
00304     if(bRelease == true) {
00305         ReleaseDC(pDC);
00306     }
00307 }

_CJXLIB_INLINE void CCJFlatComboBox::EnableAutoCompletion ( BOOL bEnable = TRUE ) [virtual]

Definition at line 208 of file CJFlatComboBox.h.

References ASSERT, and m_bAutoComp.

00209     { ASSERT(::IsWindow(m_hWnd)); m_bAutoComp = bEnable; }

BOOL CCJFlatComboBox::IsWin95 ( )

Definition at line 374 of file CJFlatComboBox.cpp.

Referenced by PreTranslateMessage.

00375 {
00376     OSVERSIONINFO info;
00377     info.dwOSVersionInfoSize = sizeof(info);
00378     GetVersionEx( &info );
00379     return ((VER_PLATFORM_WIN32_WINDOWS == info.dwPlatformId) && (info.dwMinorVersion == 0));
00380 }

void CCJFlatComboBox::OnEditUpdate ( ) [protected]

Definition at line 342 of file CJFlatComboBox.cpp.

References m_bAutoComp.

00343 {
00344     // if we are not to auto update the text, get outta here
00345     if (!m_bAutoComp)
00346         return;
00347
00348     // Get the text in the edit box
00349     CString str;
00350     GetWindowText(str);
00351     int nLength = str.GetLength();
00352
00353     // Currently selected range
00354     DWORD dwCurSel = GetEditSel();
00355     WORD dStart = LOWORD(dwCurSel);
00356     WORD dEnd   = HIWORD(dwCurSel);
00357
00358     // Search for, and select in, and string in the combo box that is prefixed
00359     // by the text in the edit box
00360     if (SelectString(-1, str) == CB_ERR)
00361     {
00362         SetWindowText(str);     // No text selected, so restore what was there before
00363         if (dwCurSel != CB_ERR)
00364             SetEditSel(dStart, dEnd);   //restore cursor postion
00365     }
00366
00367     // Set the text selection as the additional text that we have added
00368     if (dEnd < nLength && dwCurSel != CB_ERR)
00369         SetEditSel(dStart, dEnd);
00370     else
00371         SetEditSel(nLength, -1);
00372 }

BOOL CCJFlatComboBox::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 391 of file CJFlatComboBox.cpp.

References TRUE.

00392 {
00393     // KStowell - overridden for flicker-free drawing.
00394     UNUSED_ALWAYS(pDC);
00395     return TRUE;
00396 }

void CCJFlatComboBox::OnKillFocus ( ) [protected]

Definition at line 315 of file CJFlatComboBox.cpp.

References DrawCombo, FALSE, m_bHasFocus, m_clrNormal, and NORMAL.

00316 {
00317     m_bHasFocus = FALSE;
00318     DrawCombo(NORMAL, m_clrNormal, m_clrNormal);
00319 }

void CCJFlatComboBox::OnLButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 168 of file CJFlatComboBox.cpp.

References m_bLBtnDown, and TRUE.

00169 {
00170     m_bLBtnDown = TRUE;
00171     CComboBox::OnLButtonDown(nFlags, point);
00172 }

void CCJFlatComboBox::OnLButtonUp | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 174 of file CJFlatComboBox.cpp.

References FALSE, and m_bLBtnDown.

00175 {
00176     m_bLBtnDown = FALSE;
00177     Invalidate();
00178     CComboBox::OnLButtonUp(nFlags, point);
00179 }

void CCJFlatComboBox::OnMouseMove | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 161 of file CJFlatComboBox.cpp.

References NULL, and OnTimer.

00162 {
00163     SetTimer(1,10,NULL);
00164     OnTimer(1);
00165     CComboBox::OnMouseMove(nFlags, point);
00166 }

void CCJFlatComboBox::OnPaint ( ) [protected]

Definition at line 207 of file CJFlatComboBox.cpp.

References DrawCombo, m_bHasFocus, m_clrHilite, m_clrNormal, m_clrShadow, NORMAL, PointInRect, and RAISED.

00208 {
00209     ModifyStyleEx (WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE,
00210         0, SWP_FRAMECHANGED);
00211
00212     CPaintDC dc(this);
00213
00214     // KStowell - Get the client rect.
00215     CRect rcClient;
00216     GetClientRect( &rcClient );
00217
00218     // KStowell - Create a memory device-context. This is done to help reduce
00219     // screen flicker, since we will paint the entire control to the
00220     // off screen device context first.
00221     CDC memDC;
00222     CBitmap bitmap;
00223     memDC.CreateCompatibleDC(&dc);
00224     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00225     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00226
00227     // let the control do its default drawing.
00228     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00229
00230     if (PointInRect() || m_bHasFocus) {
00231         DrawCombo(RAISED, m_clrShadow, m_clrHilite, &memDC);
00232     } else {
00233         DrawCombo(NORMAL, m_clrNormal, m_clrNormal, &memDC);
00234     }
00235
00236     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00237     dc.BitBlt(rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), &memDC, 0,0, SRCCOPY);
00238
00239     // KStowell - Cleanup resources.
00240     memDC.SelectObject(pOldBitmap);
00241     memDC.DeleteDC();
00242     bitmap.DeleteObject();
00243 }

void CCJFlatComboBox::OnSetFocus ( ) [protected]

Definition at line 309 of file CJFlatComboBox.cpp.

References DrawCombo, m_bHasFocus, m_clrHilite, m_clrShadow, RAISED, and TRUE.

00310 {
00311     m_bHasFocus = TRUE;
00312     DrawCombo(RAISED, m_clrShadow, m_clrHilite);
00313 }

void CCJFlatComboBox::OnSysColorChange ( ) [protected]

Definition at line 382 of file CJFlatComboBox.cpp.

References m_clrHilite, m_clrNormal, and m_clrShadow.

00383 {
00384     CComboBox::OnSysColorChange();
00385
00386     m_clrHilite = ::GetSysColor(COLOR_BTNHIGHLIGHT);
00387     m_clrShadow = ::GetSysColor(COLOR_BTNSHADOW);
00388     m_clrNormal = ::GetSysColor(COLOR_BTNFACE);
00389 }

void CCJFlatComboBox::OnTimer ( UINT nIDEvent ) [protected]

Definition at line 181 of file CJFlatComboBox.cpp.

References DrawCombo, FALSE, m_bHasFocus, m_bLBtnDown, m_bPainted, m_clrHilite, m_clrNormal, m_clrShadow, NORMAL, PointInRect, PRESSED, RAISED, and TRUE.

Referenced by OnMouseMove.

00182 {
00183     UNUSED_ALWAYS(nIDEvent);
00184
00185     if (m_bLBtnDown==TRUE) { // OnLButtonDown, show PRESSED.
00186         KillTimer (1);
00187         if (m_bPainted == TRUE) {
00188             DrawCombo(PRESSED, m_clrShadow, m_clrHilite);
00189             m_bPainted = FALSE;
00190         }
00191     } else if (!PointInRect() && !m_bHasFocus) { // If mouse leaves, show flat.
00192         KillTimer (1);
00193         if (m_bPainted == TRUE) {
00194             DrawCombo(NORMAL, m_clrNormal, m_clrNormal);
00195             m_bPainted = FALSE;
00196         }
00197     } else { // On mouse over, show RAISED.
00198         if (m_bPainted == TRUE) {
00199             return;
00200         } else {
00201             m_bPainted = TRUE;
00202             DrawCombo(RAISED, m_clrShadow, m_clrHilite);
00203         }
00204     }
00205 }

_CJXLIB_INLINE BOOL CCJFlatComboBox::PointInRect ( ) [virtual]

Definition at line 211 of file CJFlatComboBox.h.

References ASSERT.

Referenced by OnPaint, and OnTimer.

00212     { ASSERT(::IsWindow(m_hWnd)); CPoint pt; GetCursorPos(&pt); CRect rcItem; GetWindowRect(&rcItem); return rcItem.PtInRect(pt); }

BOOL CCJFlatComboBox::PreTranslateMessage ( MSG * pMsg ) [virtual]

Definition at line 321 of file CJFlatComboBox.cpp.

References IsWin95, and TRUE.

00322 {
00323     if(IsWin95()) // alexander Golde [alex@viona.de]
00324     {
00325         // Make sure that the keystrokes continue to the appropriate handlers
00326         if (pMsg->message == WM_KEYDOWN || pMsg->message==WM_KEYUP)
00327         {
00328             ::TranslateMessage(pMsg);
00329             ::DispatchMessage(pMsg);
00330             return TRUE;
00331         }
00332
00333         // Catch the Alt key so we don't choke if focus
00334         // is going to an owner drawn button
00335         if (pMsg->message == WM_SYSCHAR)
00336             return TRUE;
00337     }
00338
00339     return CComboBox::PreTranslateMessage(pMsg);
00340 }

Member Data Documentation

BOOL CCJFlatComboBox::m_bAutoComp [protected]

Definition at line 155 of file CJFlatComboBox.h.

Referenced by EnableAutoCompletion, and OnEditUpdate.

BOOL CCJFlatComboBox::m_bHasFocus [protected]

Definition at line 154 of file CJFlatComboBox.h.

Referenced by OnKillFocus, OnPaint, OnSetFocus, and OnTimer.

BOOL CCJFlatComboBox::m_bLBtnDown [protected]

Definition at line 152 of file CJFlatComboBox.h.

Referenced by OnLButtonDown, OnLButtonUp, and OnTimer.

BOOL CCJFlatComboBox::m_bPainted [protected]

Definition at line 153 of file CJFlatComboBox.h.

Referenced by OnTimer.

COLORREF CCJFlatComboBox::m_clrHilite [protected]

Definition at line 156 of file CJFlatComboBox.h.

Referenced by DrawCombo, OnPaint, OnSetFocus, OnSysColorChange, and OnTimer.

COLORREF CCJFlatComboBox::m_clrNormal [protected]

Definition at line 158 of file CJFlatComboBox.h.

Referenced by DrawCombo, OnKillFocus, OnPaint, OnSysColorChange, and OnTimer.

COLORREF CCJFlatComboBox::m_clrShadow [protected]

Definition at line 157 of file CJFlatComboBox.h.

Referenced by DrawCombo, OnPaint, OnSetFocus, OnSysColorChange, and OnTimer.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJFlatComboBox.h
  • WinCvs/CJLib/CJLibrary/CJFlatComboBox.cpp
Generated on Sun Feb 24 01:24:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJFlatHeaderCtrl Class Reference

#include <CJFlatHeaderCtrl.h>

Inheritance diagram for CCJFlatHeaderCtrl:

[legend]
Collaboration diagram for CCJFlatHeaderCtrl:

[legend]
List of all members.

Public Methods

CCJFlatHeaderCtrl ()
virtual | ~CCJFlatHeaderCtrl ()
virtual void | SetMenuID (UINT popupMenuID, UINT popToolbarID=0, int nPos=0)
virtual UINT | GetMenuID ()
virtual void | InitializeHeader (bool bBoldFont)
virtual void | SetFontBold (BOOL bBoldFont=TRUE)
virtual int | SetSortImage (int nCol, BOOL bAsc)
virtual void | DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct)

Protected Methods

virtual void | DrawFlatBorder (CDC *pDC)
virtual void | ResizeWindow ()
virtual void | PreSubclassWindow ()
afx_msg void | OnPaint ()
afx_msg void | OnRButtonDown (UINT nFlags, CPoint point)
afx_msg void | OnMeasureItem (int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)
afx_msg LRESULT | OnMenuChar (UINT nChar, UINT nFlags, CMenu *pMenu)
afx_msg void | OnInitMenuPopup (CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu)
afx_msg int | OnCreate (LPCREATESTRUCT lpCreateStruct)
afx_msg void | OnWindowPosChanged (WINDOWPOS FAR *lpwndpos)
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)

Protected Attributes

UINT | m_popToolbarID
UINT | m_popupMenuID
CCJMenu m_popupMenu
int | m_nPos
BOOL | m_bBoldFont
BOOL | m_bLBtnDown
BOOL | m_bSortAsc
CFont | m_Font
int | m_nOffset
int | m_nSortCol
CWnd * m_pParentWnd
CRect | m_rcOldSize

Constructor & Destructor Documentation

CCJFlatHeaderCtrl::CCJFlatHeaderCtrl ( )

Definition at line 139 of file CJFlatHeaderCtrl.cpp.

References FALSE, and NULL.

00140 {
00141     m_nSortCol      = -1;
00142     m_bBoldFont     = FALSE;
00143     m_nOffset       = 6;
00144     m_bLBtnDown     = FALSE;
00145     m_popupMenuID   = 0;
00146     m_popToolbarID  = 0;
00147     m_nPos          = 0;
00148     m_pParentWnd    = NULL;
00149 }

CCJFlatHeaderCtrl::~CCJFlatHeaderCtrl ( ) [virtual]

Definition at line 151 of file CJFlatHeaderCtrl.cpp.

References m_Font.

00152 {
00153     // fix potential resource leak - KStowell - 10-22-99.
00154     m_Font.DeleteObject();
00155 }

Member Function Documentation

void CCJFlatHeaderCtrl::DrawFlatBorder ( CDC * pDC ) [protected, virtual]

Definition at line 358 of file CJFlatHeaderCtrl.cpp.

Referenced by OnPaint.

00359 {
00360     CRect rci;
00361     GetWindowRect(&rci);
00362     ScreenToClient(&rci);
00363
00364     // Cover up thick 3D border.
00365     pDC->Draw3dRect(rci, afxData.clrBtnFace, afxData.clrBtnFace);
00366     rci.DeflateRect(1,1);
00367     pDC->Draw3dRect(rci, afxData.clrBtnFace, afxData.clrBtnFace);
00368
00369     // Draw flat style border around entire header.
00370     rci.InflateRect(1,1);
00371     pDC->Draw3dRect(rci, afxData.clrBtnHilite, afxData.clrBtnShadow);
00372
00373     // Create the pens for further cover-up.
00374     CPen penLite(PS_SOLID, 1, afxData.clrBtnHilite);
00375     CPen penShad(PS_SOLID, 1, afxData.clrBtnShadow);
00376     CPen penFace(PS_SOLID, 1, afxData.clrBtnFace);
00377     CPen *pOldPen = pDC->SelectObject( &penLite );
00378
00379     // Set up the header item struct.
00380     HD_ITEM hdi;
00381     memset (&hdi, 0, sizeof(HD_ITEM));
00382     hdi.fmt  = HDF_STRING | HDF_LEFT | HDF_OWNERDRAW;
00383     hdi.mask = HDI_WIDTH | HDI_TEXT | HDI_FORMAT | HDI_ORDER; // Yiannhs :1999-10-19
00384     int cx = 0;
00385
00386     long j = GetItemCount();    //Yiannhs
00387     long i = 0;                 //Yiannhs
00388
00389     long * ItemOrders = new long[j];    //Yiannhs :1999-10-19
00390     for( i=0; i<j; i++ ) {              //Yiannhs :1999-10-19
00391         GetItem(i, &hdi);               //Yiannhs :1999-10-19
00392         ItemOrders[hdi.iOrder] = i;     //Yiannhs :1999-10-19
00393     }
00394
00395     hdi.fmt  = HDF_STRING | HDF_LEFT | HDF_OWNERDRAW;   //Yiannhs :1999-10-19
00396     hdi.mask = HDI_WIDTH | HDI_TEXT | HDI_FORMAT;       //Yiannhs :1999-10-19
00397
00398     // For each header item found, do further cover up.
00399     for (i = 0; i < j; ++i)
00400     {
00401         GetItem( ItemOrders[i], &hdi);
00402         cx += hdi.cxy;
00403
00404         pDC->SelectObject(&penShad);
00405         pDC->MoveTo(cx, 2);
00406         pDC->LineTo(cx, rci.bottom-2);
00407
00408         pDC->SelectObject(&penLite);
00409         pDC->MoveTo(cx+1, 2);
00410         pDC->LineTo(cx+1, rci.bottom-2);
00411
00412         pDC->SelectObject(&penFace);
00413         pDC->MoveTo(cx-1, 2);
00414         pDC->LineTo(cx-1, rci.bottom-2);
00415
00416         pDC->SelectObject(&penFace);
00417         pDC->MoveTo(cx-2, 2);
00418         pDC->LineTo(cx-2, rci.bottom-2);
00419     }
00420
00421     delete [] ItemOrders; //Yiannhs :1999-10-19
00422
00423     // Restore the pen and release device context.
00424     pDC->SelectObject( pOldPen );
00425
00426     // fix potential resource leak - KStowell - 10-21-99
00427     penLite.DeleteObject();
00428     penShad.DeleteObject();
00429     penFace.DeleteObject();
00430 }

void CCJFlatHeaderCtrl::DrawItem ( LPDRAWITEMSTRUCT lpDrawItemStruct ) [virtual]

Definition at line 211 of file CJFlatHeaderCtrl.cpp.

References ASSERT, m_Font, m_nOffset, m_nSortCol, and NULL.

00212 {
00213     ASSERT(lpDrawItemStruct != NULL);
00214
00215     // define some temporary variables.
00216     CDC*    pDC         = CDC::FromHandle( lpDrawItemStruct->hDC );
00217     CRect   rcItem      = lpDrawItemStruct->rcItem;
00218     CRect   rcIcon      = lpDrawItemStruct->rcItem;
00219     int     nState      = lpDrawItemStruct->itemState;
00220     int     nItemID     = lpDrawItemStruct->itemID;
00221     int     nSavedDC    = pDC->SaveDC();
00222
00223     // Paint the background.
00224     pDC->FillSolidRect(rcItem, afxData.clrBtnFace);
00225     pDC->SetBkMode(TRANSPARENT);
00226
00227     // Set clipping region to limit drawing within column
00228     CRgn rgn;
00229     rgn.CreateRectRgnIndirect( &rcItem );
00230     pDC->SelectObject( &rgn );
00231     rgn.DeleteObject();
00232
00233     // Get the column text and format
00234     TCHAR buf[256];
00235     HD_ITEM hditem;
00236
00237     hditem.mask = HDI_TEXT | HDI_FORMAT;
00238     hditem.pszText = buf;
00239     hditem.cchTextMax = 255;
00240
00241     GetItem( nItemID, &hditem );
00242
00243     // Determine format for drawing column label
00244     UINT uFormat = DT_SINGLELINE | DT_NOPREFIX | DT_NOCLIP
00245         | DT_VCENTER | DT_END_ELLIPSIS ;
00246
00247     if( hditem.fmt & HDF_CENTER) {
00248         uFormat |= DT_CENTER;
00249     } else if( hditem.fmt & HDF_RIGHT) {
00250         uFormat |= DT_RIGHT;
00251     } else {
00252         uFormat |= DT_LEFT;
00253     }
00254
00255     // Adjust the rect if the mouse button is pressed on it
00256     if( nState == ODS_SELECTED ) {
00257         rcItem.left++;
00258         rcItem.top += 2;
00259         rcItem.right++;
00260     }
00261
00262     // Adjust the rect further if Sort arrow is to be displayed
00263     if( nItemID == m_nSortCol ) {
00264         rcItem.right -= 3 * m_nOffset;
00265     }
00266
00267     rcItem.left += m_nOffset;
00268     rcItem.right -= m_nOffset;
00269
00270     // Draw column label
00271     if( rcItem.left < rcItem.right ) {
00272         if (m_bBoldFont) {
00273             CFont* pOldFont = pDC->SelectObject(&m_Font);
00274             pDC->DrawText(buf,-1,rcItem, uFormat);
00275             pDC->SelectObject(pOldFont);
00276         } else {
00277             pDC->DrawText(buf,-1,rcItem, uFormat);
00278         }
00279     }
00280
00281     // Draw the Sort arrow
00282     if( nItemID == m_nSortCol )
00283     {
00284         // Set up pens to use for drawing the triangle
00285         CPen penLite(PS_SOLID, 1, afxData.clrBtnHilite);
00286         CPen penShad(PS_SOLID, 1, afxData.clrBtnShadow);
00287         CPen *pOldPen = pDC->SelectObject( &penLite );
00288
00289         if( m_bSortAsc )
00290         {
00291             // Draw triangle pointing upwards
00292             pDC->MoveTo( rcIcon.right - 2*m_nOffset, m_nOffset-1);
00293             pDC->LineTo( rcIcon.right - 3*m_nOffset/2, rcIcon.bottom - m_nOffset );
00294             pDC->LineTo( rcIcon.right - 5*m_nOffset/2-2, rcIcon.bottom - m_nOffset );
00295             pDC->MoveTo( rcIcon.right - 5*m_nOffset/2-1, rcIcon.bottom - m_nOffset-1 );
00296
00297             pDC->SelectObject( &penShad );
00298             pDC->LineTo( rcIcon.right - 2*m_nOffset, m_nOffset-2);
00299         }
00300         else
00301         {
00302             // Draw triangle pointing downwords
00303             pDC->MoveTo( rcIcon.right - 3*m_nOffset/2, m_nOffset-1);
00304             pDC->LineTo( rcIcon.right - 2*m_nOffset-1, rcIcon.bottom - m_nOffset + 1 );
00305             pDC->MoveTo( rcIcon.right - 2*m_nOffset-1, rcIcon.bottom - m_nOffset );
00306
00307             pDC->SelectObject( &penShad );
00308             pDC->LineTo( rcIcon.right - 5*m_nOffset/2-1, m_nOffset -1 );
00309             pDC->LineTo( rcIcon.right - 3*m_nOffset/2, m_nOffset -1);
00310         }
00311
00312         // Restore the pen
00313         pDC->SelectObject( pOldPen );
00314
00315         // fix potential resource leak - KStowell - 10-21-99
00316         penLite.DeleteObject();
00317         penShad.DeleteObject();
00318     }
00319
00320     // restore the device context
00321     pDC->RestoreDC(nSavedDC);
00322 }

_CJXLIB_INLINE UINT CCJFlatHeaderCtrl::GetMenuID ( ) [virtual]

Definition at line 217 of file CJFlatHeaderCtrl.h.

References ASSERT, and m_popupMenuID.

00218     { ASSERT(::IsWindow(m_hWnd)); return m_popupMenuID; }

void CCJFlatHeaderCtrl::InitializeHeader ( bool bBoldFont ) [virtual]

Definition at line 173 of file CJFlatHeaderCtrl.cpp.

References m_bBoldFont, m_Font, and VERIFY.

Referenced by CCJListView::SubclassHeader, and CCJListCtrl::SubclassHeader.

00174 {
00175     m_Font.DeleteObject();
00176     NONCLIENTMETRICS ncm;
00177     ncm.cbSize = sizeof(ncm);
00178     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00179     if(bBoldFont)
00180         ncm.lfMessageFont.lfWeight = 700;
00181     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00182     SetFont(&m_Font);
00183
00184     m_bBoldFont = bBoldFont;
00185 }

int CCJFlatHeaderCtrl::OnCreate ( LPCREATESTRUCT lpCreateStruct ) [protected]

Definition at line 533 of file CJFlatHeaderCtrl.cpp.

References ASSERT, m_pParentWnd, and ResizeWindow.

00534 {
00535     if (CHeaderCtrl::OnCreate(lpCreateStruct) == -1)
00536         return -1;
00537
00538     m_pParentWnd = CWnd::FromHandle(lpCreateStruct->hwndParent);
00539     ASSERT(m_pParentWnd);
00540
00541     ResizeWindow();
00542     return 0;
00543 }

BOOL CCJFlatHeaderCtrl::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 571 of file CJFlatHeaderCtrl.cpp.

References TRUE.

00572 {
00573     // KStowell - overridden for flicker-free drawing.
00574     UNUSED_ALWAYS(pDC);
00575     return TRUE;
00576 }

void CCJFlatHeaderCtrl::OnInitMenuPopup | ( | CMenu * | pPopupMenu,
 |  | UINT | nIndex,
 |  | BOOL | bSysMenu
 | ) | [protected]

Definition at line 489 of file CJFlatHeaderCtrl.cpp.

References CCJMenu::IsMenu, m_popupMenu, and CCJMenu::UpdateMenu.

00490 {
00491     CHeaderCtrl::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
00492
00493     if(!bSysMenu) {
00494         if (m_popupMenu.IsMenu(pPopupMenu)) {
00495             CCJMenu::UpdateMenu(pPopupMenu);
00496         }
00497     }
00498 }

void CCJFlatHeaderCtrl::OnMeasureItem | ( | int | nIDCtl,
 |  | LPMEASUREITEMSTRUCT | lpMeasureItemStruct
 | ) | [protected]

Definition at line 463 of file CJFlatHeaderCtrl.cpp.

References CCJMenu::IsMenu, m_popupMenu, and CCJMenu::MeasureItem.

00464 {
00465     if (lpMeasureItemStruct->CtlType == ODT_MENU)
00466     {
00467         if (IsMenu((HMENU)lpMeasureItemStruct->itemID)) {
00468             CMenu* pMenu = CMenu::FromHandle((HMENU)lpMeasureItemStruct->itemID);
00469
00470             if (m_popupMenu.IsMenu(pMenu)) {
00471                 m_popupMenu.MeasureItem(lpMeasureItemStruct);
00472                 return;
00473             }
00474         }
00475     }
00476
00477     CHeaderCtrl::OnMeasureItem(nIDCtl, lpMeasureItemStruct);
00478 }

LRESULT CCJFlatHeaderCtrl::OnMenuChar | ( | UINT | nChar,
 |  | UINT | nFlags,
 |  | CMenu * | pMenu
 | ) | [protected]

Definition at line 480 of file CJFlatHeaderCtrl.cpp.

References CCJMenu::FindKeyboardShortcut, CCJMenu::IsMenu, and m_popupMenu.

00481 {
00482     if (m_popupMenu.IsMenu(pMenu)) {
00483         return CCJMenu::FindKeyboardShortcut(nChar, nFlags, pMenu);
00484     }
00485
00486     return CHeaderCtrl::OnMenuChar(nChar, nFlags, pMenu);
00487 }

void CCJFlatHeaderCtrl::OnPaint ( ) [protected]

Definition at line 324 of file CJFlatHeaderCtrl.cpp.

References DrawFlatBorder.

00325 {
00326     CPaintDC dc(this); // device context for painting
00327
00328     // KStowell - Get the client rect.
00329     CRect rcClient;
00330     GetClientRect( &rcClient );
00331
00332     // KStowell - Create a memory device-context. This is done to help reduce
00333     // screen flicker, since we will paint the entire control to the
00334     // off screen device context first.
00335     CDC memDC;
00336     CBitmap bitmap;
00337     memDC.CreateCompatibleDC(&dc);
00338     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00339     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00340     memDC.FillSolidRect(rcClient, afxData.clrBtnFace);
00341
00342     // First let the control do its default drawing.
00343     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00344
00345     // KStowell - Repaint the background.
00346     DrawFlatBorder(&memDC);
00347
00348     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00349     dc.BitBlt( rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), &memDC,
00350         rcClient.left, rcClient.top, SRCCOPY );
00351
00352     // KStowell - Cleanup resources.
00353     memDC.SelectObject(pOldBitmap);
00354     memDC.DeleteDC();
00355     bitmap.DeleteObject();
00356 }

void CCJFlatHeaderCtrl::OnRButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 432 of file CJFlatHeaderCtrl.cpp.

References ASSERT, CCJMenu::DestroyMenu, CCJMenu::LoadMenu, CCJMenu::LoadToolbar, m_nPos, m_popToolbarID, m_popupMenu, m_popupMenuID, NULL, and VERIFY.

00433 {
00434     // No menu was defined...
00435     if (!m_popupMenuID) {
00436         TRACE0( "Warning: No menu resource was associated with CCJTabCtrl.\n" );
00437         return;
00438     }
00439
00440     // Since we are using the main window as the
00441     // parent, we need to convert the point to screen
00442     // coordinates...
00443     CPoint pt = point;
00444     ClientToScreen(&pt);
00445
00446     // Load the popup menu.
00447     VERIFY(m_popupMenu.LoadMenu(m_popupMenuID));
00448     CCJMenu* pPopup = (CCJMenu*)m_popupMenu.GetSubMenu(m_nPos);
00449     ASSERT(pPopup != NULL);
00450
00451     // Load toolbar resource if any for menu icons.
00452     if (m_popToolbarID) {
00453         pPopup->LoadToolbar(m_popToolbarID);
00454     }
00455
00456     // Display the popup menu, use the main window as its parent.
00457     pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
00458         pt.x, pt.y, AfxGetMainWnd());
00459
00460     m_popupMenu.DestroyMenu();
00461 }

void CCJFlatHeaderCtrl::OnWindowPosChanged ( WINDOWPOS FAR * lpwndpos ) [protected]

Definition at line 545 of file CJFlatHeaderCtrl.cpp.

References ResizeWindow.

00546 {
00547     CHeaderCtrl::OnWindowPosChanged(lpwndpos);
00548     ResizeWindow();
00549 }

void CCJFlatHeaderCtrl::PreSubclassWindow ( ) [protected, virtual]

Definition at line 523 of file CJFlatHeaderCtrl.cpp.

References ASSERT, m_pParentWnd, and ResizeWindow.

00524 {
00525     CHeaderCtrl::PreSubclassWindow();
00526
00527     m_pParentWnd = GetParent();
00528     ASSERT(m_pParentWnd);
00529
00530     ResizeWindow();
00531 }

void CCJFlatHeaderCtrl::ResizeWindow ( ) [protected, virtual]

Definition at line 551 of file CJFlatHeaderCtrl.cpp.

References m_pParentWnd, and NULL.

Referenced by OnCreate, OnWindowPosChanged, and PreSubclassWindow.

00552 {
00553     ASSERT_VALID(this);
00554     ASSERT_VALID(m_pParentWnd);
00555
00556     // Get the client size of the parent window, this will give us the
00557     // actual width of the header we are looking for.
00558     CRect rcParent;
00559     m_pParentWnd->GetClientRect(&rcParent);
00560
00561     // Get the size of the header control, we will need this for the
00562     // height of the header.
00563     CRect rcWnd;
00564     GetWindowRect(&rcWnd);
00565
00566     // Now, resize the window.
00567     SetWindowPos(NULL, 0, 0, rcParent.Width(), rcWnd.Height(),
00568         SWP_NOMOVE|SWP_FRAMECHANGED);
00569 }

_CJXLIB_INLINE void CCJFlatHeaderCtrl::SetFontBold ( BOOL bBoldFont = TRUE ) [virtual]

Definition at line 220 of file CJFlatHeaderCtrl.h.

References ASSERT, and m_bBoldFont.

00221     { ASSERT(::IsWindow(m_hWnd)); m_bBoldFont = bBoldFont; }

_CJXLIB_INLINE void CCJFlatHeaderCtrl::SetMenuID | ( | UINT | popupMenuID,
 |  | UINT | popToolbarID = 0,
 |  | int | nPos = 0
 | ) | [virtual]

Definition at line 214 of file CJFlatHeaderCtrl.h.

References ASSERT, m_nPos, m_popToolbarID, and m_popupMenuID.

00215     { ASSERT(::IsWindow(m_hWnd)); m_popupMenuID=popupMenuID; m_popToolbarID=popToolbarID; m_nPos=nPos; }

int CCJFlatHeaderCtrl::SetSortImage | ( | int | nCol,
 |  | BOOL | bAsc
 | ) | [virtual]

Definition at line 187 of file CJFlatHeaderCtrl.cpp.

References m_bSortAsc, m_nSortCol, and NULL.

Referenced by CCJListView::OnNotify, and CCJListCtrl::OnNotify.

00188 {
00189     int nPrevCol = m_nSortCol;
00190
00191     m_nSortCol = nCol;
00192     m_bSortAsc = bAsc;
00193
00194     // Change the item to ownder drawn
00195     HD_ITEM hditem;
00196
00197     hditem.mask = HDI_BITMAP | HDI_FORMAT;
00198     GetItem( nCol, &hditem );
00199     if (hditem.hbm == NULL)
00200     {
00201         hditem.fmt |= HDF_OWNERDRAW;
00202         SetItem( nCol, &hditem );
00203
00204         // Invalidate header control so that it gets redrawn
00205         Invalidate();
00206     }
00207
00208     return nPrevCol;
00209 }

Member Data Documentation

BOOL CCJFlatHeaderCtrl::m_bBoldFont [protected]

Definition at line 133 of file CJFlatHeaderCtrl.h.

Referenced by InitializeHeader, and SetFontBold.

BOOL CCJFlatHeaderCtrl::m_bLBtnDown [protected]

Definition at line 134 of file CJFlatHeaderCtrl.h.

BOOL CCJFlatHeaderCtrl::m_bSortAsc [protected]

Definition at line 135 of file CJFlatHeaderCtrl.h.

Referenced by SetSortImage.

CFont CCJFlatHeaderCtrl::m_Font [protected]

Definition at line 136 of file CJFlatHeaderCtrl.h.

Referenced by DrawItem, InitializeHeader, and ~CCJFlatHeaderCtrl.

int CCJFlatHeaderCtrl::m_nOffset [protected]

Definition at line 137 of file CJFlatHeaderCtrl.h.

Referenced by DrawItem.

int CCJFlatHeaderCtrl::m_nPos [protected]

Definition at line 132 of file CJFlatHeaderCtrl.h.

Referenced by OnRButtonDown, and SetMenuID.

int CCJFlatHeaderCtrl::m_nSortCol [protected]

Definition at line 138 of file CJFlatHeaderCtrl.h.

Referenced by DrawItem, and SetSortImage.

UINT CCJFlatHeaderCtrl::m_popToolbarID [protected]

Definition at line 127 of file CJFlatHeaderCtrl.h.

Referenced by OnRButtonDown, and SetMenuID.

CCJMenu CCJFlatHeaderCtrl::m_popupMenu [protected]

Definition at line 131 of file CJFlatHeaderCtrl.h.

Referenced by OnInitMenuPopup, OnMeasureItem, OnMenuChar, and OnRButtonDown.

UINT CCJFlatHeaderCtrl::m_popupMenuID [protected]

Definition at line 130 of file CJFlatHeaderCtrl.h.

Referenced by GetMenuID, OnRButtonDown, and SetMenuID.

CWnd* CCJFlatHeaderCtrl::m_pParentWnd [protected]

Definition at line 139 of file CJFlatHeaderCtrl.h.

Referenced by OnCreate, PreSubclassWindow, and ResizeWindow.

CRect CCJFlatHeaderCtrl::m_rcOldSize [protected]

Definition at line 140 of file CJFlatHeaderCtrl.h.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJFlatHeaderCtrl.h
  • WinCvs/CJLib/CJLibrary/CJFlatHeaderCtrl.cpp
Generated on Sun Feb 24 01:24:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJFlatSplitterWnd Class Reference

#include <CJFlatSplitterWnd.h>

Inheritance diagram for CCJFlatSplitterWnd:

[legend]
Collaboration diagram for CCJFlatSplitterWnd:

[legend]
List of all members.

Public Methods

CCJFlatSplitterWnd ()
virtual | ~CCJFlatSplitterWnd ()
virtual void | DisableFlatStyle (BOOL bDisable=TRUE)
virtual BOOL | SwitchView (int nRow, int nCol, CView *pNewView)
virtual BOOL | ReplaceView (int nRow, int nCol, CRuntimeClass *pViewClass)
virtual void | ShowColumn ()
virtual void | HideColumn (int nColHide)
virtual void | ShowRow ()
virtual void | HideRow (int nRowHide)
virtual void | OnDrawSplitter (CDC *pDC, ESplitType nType, const CRect &rect)

Protected Methods

afx_msg void | OnPaint ()

Protected Attributes

int | m_nHiddenCol
int | m_nHiddenRow
BOOL | m_bFlatSplitter

Constructor & Destructor Documentation

CCJFlatSplitterWnd::CCJFlatSplitterWnd ( )

Definition at line 66 of file CJFlatSplitterWnd.cpp.

References TRUE.

00067 {
00068     m_bFlatSplitter = TRUE;
00069     m_nHiddenCol    = -1;
00070     m_nHiddenRow    = -1;
00071 }

CCJFlatSplitterWnd::~CCJFlatSplitterWnd ( ) [virtual]

Definition at line 73 of file CJFlatSplitterWnd.cpp.

00074 {
00075
00076 }

Member Function Documentation

_CJXLIB_INLINE void CCJFlatSplitterWnd::DisableFlatStyle ( BOOL bDisable = TRUE ) [virtual]

Definition at line 125 of file CJFlatSplitterWnd.h.

References m_bFlatSplitter.

00126     { m_bFlatSplitter = !bDisable; }

void CCJFlatSplitterWnd::HideColumn ( int nColHide ) [virtual]

Definition at line 288 of file CJFlatSplitterWnd.cpp.

References ASSERT, m_nHiddenCol, and NULL.

00289 {
00290     ASSERT_VALID( this );
00291     ASSERT( m_nCols > 1 );
00292     ASSERT( nColHide < m_nCols );
00293     ASSERT( m_nHiddenCol == -1 );
00294     m_nHiddenCol = nColHide;
00295
00296     // if the column has an active window -- change it
00297     int nActiveRow, nActiveCol;
00298     if( GetActivePane( &nActiveRow, &nActiveCol ) != NULL )
00299     {
00300         if( nActiveCol == nColHide )
00301         {
00302             if( ++nActiveCol >= m_nCols )
00303                 nActiveCol = 0;
00304             SetActivePane( nActiveRow, nActiveCol );
00305         }
00306     }
00307
00308     // hide all column panes
00309     for( int nRow = 0; nRow < m_nRows; nRow++)
00310     {
00311         CWnd* pPaneHide = GetPane(nRow, nColHide);
00312         ASSERT( pPaneHide != NULL );
00313
00314         pPaneHide->ShowWindow(SW_HIDE);
00315         pPaneHide->SetDlgCtrlID( AFX_IDW_PANE_FIRST+m_nCols + 16*nRow );
00316
00317         for( int nCol = nColHide + 1; nCol < m_nCols; nCol++ )
00318         {
00319             CWnd* pPane = GetPane( nRow, nCol );
00320             ASSERT( pPane != NULL );
00321
00322             pPane->SetDlgCtrlID( IdFromRowCol( nRow, nCol - 1 ));
00323         }
00324     }
00325
00326     m_nCols--;
00327     m_pColInfo[m_nCols].nCurSize = m_pColInfo[nColHide].nCurSize;
00328     RecalcLayout();
00329 }

void CCJFlatSplitterWnd::HideRow ( int nRowHide ) [virtual]

Definition at line 203 of file CJFlatSplitterWnd.cpp.

References ASSERT, m_nHiddenRow, and NULL.

00204 {
00205     ASSERT_VALID( this );
00206     ASSERT( m_nRows > 1 );
00207     ASSERT( nRowHide < m_nRows );
00208     ASSERT( m_nHiddenRow == -1 );
00209     m_nHiddenRow = nRowHide;
00210
00211     int nActiveRow, nActiveCol;
00212
00213     // if the nRow has an active window -- change it
00214     if( GetActivePane( &nActiveRow, &nActiveCol ) != NULL )
00215     {
00216         if( nActiveRow == nRowHide )
00217         {
00218             if( ++nActiveRow >= m_nRows )
00219                 nActiveRow = 0;
00220             SetActivePane( nActiveRow, nActiveCol );
00221         }
00222     }
00223
00224     // hide all nRow panes.
00225     for( int nCol = 0; nCol < m_nCols; ++nCol )
00226     {
00227         CWnd* pPaneHide = GetPane( nRowHide, nCol );
00228         ASSERT( pPaneHide != NULL );
00229
00230         pPaneHide->ShowWindow( SW_HIDE );
00231         pPaneHide->SetDlgCtrlID( AFX_IDW_PANE_FIRST+nCol + 16*m_nRows );
00232
00233         for( int nRow = nRowHide+1; nRow < m_nRows; ++nRow )
00234         {
00235             CWnd* pPane = GetPane( nRow, nCol );
00236             ASSERT( pPane != NULL );
00237
00238             pPane->SetDlgCtrlID( IdFromRowCol( nRow-1, nCol ));
00239         }
00240     }
00241
00242     m_nRows--;
00243     m_pRowInfo[m_nRows].nCurSize = m_pRowInfo[nRowHide].nCurSize;
00244     RecalcLayout();
00245 }

void CCJFlatSplitterWnd::OnDrawSplitter | ( | CDC * | pDC,
 |  | ESplitType | nType,
 |  | const CRect & | rect
 | ) | [virtual]

Definition at line 87 of file CJFlatSplitterWnd.cpp.

References ASSERT, CX_BORDER, CY_BORDER, FALSE, and NULL.

Referenced by OnPaint.

00089 {
00090     if( m_bFlatSplitter )
00091     {
00092         // if pDC == NULL, then just invalidate
00093         if (pDC == NULL)
00094         {
00095             RedrawWindow(rectArg, NULL, RDW_INVALIDATE|RDW_NOCHILDREN);
00096             return;
00097         }
00098         ASSERT_VALID(pDC);
00099
00100         // otherwise, actually draw
00101         CRect rect = rectArg;
00102         switch (nType)
00103         {
00104         case splitBorder:
00105             ASSERT(afxData.bWin4);
00106             pDC->Draw3dRect(rect, afxData.clrBtnFace, afxData.clrBtnFace);
00107             rect.InflateRect(-CX_BORDER, -CY_BORDER);
00108             pDC->Draw3dRect(rect, afxData.clrBtnShadow, afxData.clrBtnHilite);
00109             return;
00110
00111         case splitIntersection:
00112             ASSERT(!afxData.bWin4);
00113             break;
00114
00115         case splitBox:
00116             if (afxData.bWin4)
00117             {
00118                 pDC->Draw3dRect(rect, afxData.clrBtnFace, afxData.clrWindowFrame);
00119                 rect.InflateRect(-CX_BORDER, -CY_BORDER);
00120                 pDC->Draw3dRect(rect, afxData.clrBtnHilite, afxData.clrBtnShadow);
00121                 rect.InflateRect(-CX_BORDER, -CY_BORDER);
00122                 break;
00123             }
00124             // fall through...
00125         case splitBar:
00126             if (!afxData.bWin4)
00127             {
00128                 pDC->Draw3dRect(rect, afxData.clrBtnHilite, afxData.clrBtnShadow);
00129                 rect.InflateRect(-CX_BORDER, -CY_BORDER);
00130             }
00131             break;
00132
00133         default:
00134             ASSERT(FALSE);  // unknown splitter type
00135         }
00136
00137         // fill the middle
00138         pDC->FillSolidRect(rect, afxData.clrBtnFace);
00139     }
00140
00141     else {
00142         CSplitterWnd::OnDrawSplitter(pDC, nType, rectArg);
00143     }
00144 }

void CCJFlatSplitterWnd::OnPaint ( ) [protected]

Definition at line 146 of file CJFlatSplitterWnd.cpp.

References OnDrawSplitter.

00147 {
00148     if( m_bFlatSplitter )
00149     {
00150         ASSERT_VALID(this);
00151         CPaintDC dc(this);
00152
00153         CRect rectClient;
00154         GetClientRect(&rectClient);
00155
00156         CRect rectInside;
00157         GetInsideRect(rectInside);
00158         rectInside.InflateRect(4,4);
00159
00160         // draw the splitter boxes
00161         if (m_bHasVScroll && m_nRows < m_nMaxRows)
00162         {
00163             OnDrawSplitter(&dc, splitBox,
00164                 CRect(rectInside.right, rectClient.top,
00165                 rectClient.right, rectClient.top + m_cySplitter));
00166         }
00167
00168         if (m_bHasHScroll && m_nCols < m_nMaxCols)
00169         {
00170             OnDrawSplitter(&dc, splitBox,
00171                 CRect(rectClient.left, rectInside.bottom,
00172                 rectClient.left + m_cxSplitter, rectClient.bottom));
00173         }
00174
00175         // extend split bars to window border (past margins)
00176         DrawAllSplitBars(&dc, rectInside.right, rectInside.bottom);
00177
00178         // draw splitter intersections (inside only)
00179         GetInsideRect(rectInside);
00180         dc.IntersectClipRect(rectInside);
00181         CRect rect;
00182         rect.top = rectInside.top;
00183         for (int row = 0; row < m_nRows - 1; row++)
00184         {
00185             rect.top += m_pRowInfo[row].nCurSize + m_cyBorderShare;
00186             rect.bottom = rect.top + m_cySplitter;
00187             rect.left = rectInside.left;
00188             for (int col = 0; col < m_nCols - 1; col++)
00189             {
00190                 rect.left += m_pColInfo[col].nCurSize + m_cxBorderShare;
00191                 rect.right = rect.left + m_cxSplitter;
00192                 OnDrawSplitter(&dc, splitIntersection, rect);
00193                 rect.left = rect.right + m_cxBorderShare;
00194             }
00195             rect.top = rect.bottom + m_cxBorderShare;
00196         }
00197     }
00198     else {
00199         CSplitterWnd::OnPaint();
00200     }
00201 }

BOOL CCJFlatSplitterWnd::ReplaceView | ( | int | nRow,
 |  | int | nCol,
 |  | CRuntimeClass * | pViewClass
 | ) | [virtual]

Definition at line 372 of file CJFlatSplitterWnd.cpp.

References FALSE, and TRUE.

00373 {
00374     CView *pView = DYNAMIC_DOWNCAST( CView, GetPane( nRow, nCol ));
00375     ASSERT_KINDOF( CView, pView );
00376
00377     if( pView->IsKindOf( pViewClass ))
00378         return FALSE;
00379
00380     // Get pointer to CDocument object so that it can be used in the creation
00381     // process of the new view
00382     CDocument *pDoc = pView->GetDocument();
00383
00384     int nID = pView->GetDlgCtrlID();
00385     int nWidth, nHeight, nMinWidth, nMinHeight;
00386
00387     GetRowInfo( nRow, nWidth, nMinWidth );
00388     GetColumnInfo( nCol, nHeight, nMinHeight );
00389
00390     // Delete existing view
00391     DeleteView(nRow, nCol);
00392
00393     // Create new view
00394     CCreateContext context;
00395     context.m_pCurrentDoc = pDoc;
00396     CreateView( nRow, nCol, pViewClass, CSize( nWidth, nHeight ), &context );
00397     pView = DYNAMIC_DOWNCAST( CView, GetPane( nRow, nCol ));
00398     ASSERT_KINDOF( CView, pView );
00399
00400     pView->SetDlgCtrlID( nID );
00401
00402     SetRowInfo( nRow, nWidth, nMinWidth );
00403     SetColumnInfo( nCol, nHeight, nMinHeight );
00404     RecalcLayout();
00405
00406     return TRUE;
00407 }

void CCJFlatSplitterWnd::ShowColumn ( ) [virtual]

Definition at line 331 of file CJFlatSplitterWnd.cpp.

References ASSERT, m_nHiddenCol, and NULL.

00332 {
00333     ASSERT_VALID( this );
00334     ASSERT( m_nCols < m_nMaxCols );
00335     ASSERT( m_nHiddenCol != -1 );
00336
00337     int nShowCol = m_nHiddenCol;
00338     m_nHiddenCol = -1;
00339
00340     int cxNew = m_pColInfo[m_nCols].nCurSize;
00341     m_nCols++;  // add a column
00342
00343     ASSERT( m_nCols == m_nMaxCols );
00344
00345     int nCol;
00346
00347     // Show the hidden column
00348     for( int nRow = 0; nRow < m_nRows; ++nRow )
00349     {
00350         CWnd* pPaneShow = GetDlgItem( AFX_IDW_PANE_FIRST+m_nCols + 16*nRow );
00351         ASSERT( pPaneShow != NULL );
00352         pPaneShow->ShowWindow( SW_SHOWNA );
00353
00354         for( nCol = m_nCols - 2; nCol >= nShowCol; --nCol )
00355         {
00356             CWnd* pPane = GetPane( nRow, nCol );
00357             ASSERT( pPane != NULL );
00358             pPane->SetDlgCtrlID( IdFromRowCol( nRow, nCol + 1 ));
00359         }
00360
00361         pPaneShow->SetDlgCtrlID( IdFromRowCol( nRow, nShowCol ));
00362     }
00363
00364     // new panes have been created -- recalculate layout
00365     for( nCol = nShowCol+1; nCol < m_nCols; nCol++ )
00366         m_pColInfo[nCol].nIdealSize = m_pColInfo[nCol - 1].nCurSize;
00367
00368     m_pColInfo[nShowCol].nIdealSize = cxNew;
00369     RecalcLayout();
00370 }

void CCJFlatSplitterWnd::ShowRow ( ) [virtual]

Definition at line 247 of file CJFlatSplitterWnd.cpp.

References ASSERT, m_nHiddenRow, and NULL.

00248 {
00249     ASSERT_VALID( this );
00250     ASSERT( m_nRows < m_nMaxRows );
00251     ASSERT( m_nHiddenRow != -1 );
00252
00253     int nShowRow = m_nHiddenRow;
00254     m_nHiddenRow = -1;
00255
00256     int cyNew = m_pRowInfo[m_nRows].nCurSize;
00257     m_nRows++;  // add a nRow
00258
00259     ASSERT( m_nRows == m_nMaxRows );
00260
00261     int nRow;
00262
00263     // Show the hidden nRow
00264     for( int nCol = 0; nCol < m_nCols; ++nCol )
00265     {
00266         CWnd* pPaneShow = GetDlgItem( AFX_IDW_PANE_FIRST+nCol + 16*m_nRows );
00267         ASSERT( pPaneShow != NULL );
00268         pPaneShow->ShowWindow( SW_SHOWNA );
00269
00270         for( nRow = m_nRows - 2; nRow >= nShowRow; --nRow )
00271         {
00272             CWnd* pPane = GetPane( nRow, nCol );
00273             ASSERT( pPane != NULL );
00274             pPane->SetDlgCtrlID( IdFromRowCol( nRow + 1, nCol ));
00275         }
00276
00277         pPaneShow->SetDlgCtrlID( IdFromRowCol( nShowRow, nCol ));
00278     }
00279
00280     // new panes have been created -- recalculate layout
00281     for( nRow = nShowRow+1; nRow < m_nRows; nRow++ )
00282         m_pRowInfo[nRow].nIdealSize = m_pRowInfo[nRow - 1].nCurSize;
00283
00284     m_pRowInfo[nShowRow].nIdealSize = cyNew;
00285     RecalcLayout();
00286 }

BOOL CCJFlatSplitterWnd::SwitchView | ( | int | nRow,
 |  | int | nCol,
 |  | CView * | pNewView
 | ) | [virtual]

Definition at line 409 of file CJFlatSplitterWnd.cpp.

References FALSE, and TRUE.

00410 {
00411     CView *pOldView = DYNAMIC_DOWNCAST( CView, GetPane( nRow, nCol ));
00412     ASSERT_KINDOF( CView, pOldView );
00413
00414     if( pOldView == pNewView )
00415         return FALSE;
00416
00417     int nOldID, nNewID;
00418
00419     nOldID = pOldView->GetDlgCtrlID();
00420     nNewID = pNewView->GetDlgCtrlID();
00421
00422     pOldView->ShowWindow(SW_HIDE);
00423     pNewView->ShowWindow(SW_SHOW);
00424
00425     pOldView->SetDlgCtrlID(nNewID);
00426     pNewView->SetDlgCtrlID(nOldID);
00427
00428     RecalcLayout();
00429
00430     return TRUE;
00431 }

Member Data Documentation

BOOL CCJFlatSplitterWnd::m_bFlatSplitter [protected]

Definition at line 73 of file CJFlatSplitterWnd.h.

Referenced by DisableFlatStyle.

int CCJFlatSplitterWnd::m_nHiddenCol [protected]

Definition at line 71 of file CJFlatSplitterWnd.h.

Referenced by HideColumn, and ShowColumn.

int CCJFlatSplitterWnd::m_nHiddenRow [protected]

Definition at line 72 of file CJFlatSplitterWnd.h.

Referenced by HideRow, and ShowRow.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJFlatSplitterWnd.h
  • WinCvs/CJLib/CJLibrary/CJFlatSplitterWnd.cpp
Generated on Sun Feb 24 01:24:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJFlatTabCtrl Class Reference

#include <CJFlatTabCtrl.h>

Inheritance diagram for CCJFlatTabCtrl:

[legend]
Collaboration diagram for CCJFlatTabCtrl:

[legend]
List of all members.

Public Methods

CCJFlatTabCtrl ()
virtual BOOL | InsertItem (const int nItem, LPCTSTR lpszItem)
virtual BOOL | DeleteItem (int nItem)
virtual BOOL | DeleteAllItems ()
virtual BOOL | GetItemRect (int nItem, LPRECT lpRect)
virtual int | HitTest (TCHITTESTINFO *pHitTestInfo) const
virtual int | GetCurSel () const
virtual int | SetCurSel (int nItem)
virtual int | GetItemCount () const
virtual void | SetTipText (int nItem, LPCTSTR lpszTabTip)
virtual CString | GetTipText (int nItem)
virtual void | Home ()
virtual | ~CCJFlatTabCtrl ()

Protected Methods

virtual BOOL | PreCreateWindow (CREATESTRUCT &cs)
virtual BOOL | PreTranslateMessage (MSG *pMsg)
afx_msg void | OnPaint ()
afx_msg void | OnLButtonDown (UINT nFlags, CPoint point)
afx_msg void | OnSize (UINT nType, int cx, int cy)
afx_msg int | OnCreate (LPCREATESTRUCT lpCreateStruct)
afx_msg void | OnLeftArrow ()
afx_msg void | OnRightArrow ()
afx_msg void | OnHomeArrow ()
afx_msg void | OnEndArrow ()

Private Methods

void | CreateTabFont (const int iTabHeight)
int | GetTabWidth (const int nItem) const
int | GetTotalArrowWidth (void) const
int | GetTotalTabWidth (void) const
void | InvalidateTabs (void)
void | EnableButtons (void)
int | DrawTab (CDC &dc, const int x, const int y, const int iHeight, bool bSelected, bool bBottom, LPCTSTR lpszTab) const

Private Attributes

bool | m_bHasArrows
bool | m_bHasHomeEnd
bool | m_bTabsOnBottom
int | m_iCurSel
int | m_iClientWidth
int | m_iClientHeight
int | m_iTotalTabWidth
int | m_iXOffset
CTabList m_TabList
CTabList m_TabTipList
CFont | m_Font
CFont | m_BoldFont
CCJMetaFileButton * m_pLeftButton
CCJMetaFileButton * m_pRightButton
CCJMetaFileButton * m_pHomeButton
CCJMetaFileButton * m_pEndButton
HENHMETAFILE | m_hLeftArrow
HENHMETAFILE | m_hLeftArrowDisabled
HENHMETAFILE | m_hRightArrow
HENHMETAFILE | m_hRightArrowDisabled
HENHMETAFILE | m_hHomeArrow
HENHMETAFILE | m_hHomeArrowDisabled
HENHMETAFILE | m_hEndArrow
HENHMETAFILE | m_hEndArrowDisabled
CToolTipCtrl | m_ToolTip

Constructor & Destructor Documentation

CCJFlatTabCtrl::CCJFlatTabCtrl ( )

Definition at line 83 of file CJFlatTabCtrl.cpp.

References m_bHasArrows, m_bHasHomeEnd, m_bTabsOnBottom, m_hEndArrow, m_hEndArrowDisabled, m_hHomeArrow, m_hHomeArrowDisabled, m_hLeftArrow, m_hLeftArrowDisabled, m_hRightArrow, m_hRightArrowDisabled, m_iCurSel, m_iXOffset, m_pEndButton, m_pHomeButton, m_pLeftButton, m_pRightButton, and NULL.

00084 {
00085     m_bHasArrows          = false;
00086     m_bHasHomeEnd         = false;
00087     m_bTabsOnBottom       = false;
00088     m_iCurSel             = -1;
00089     m_pLeftButton         = NULL;
00090     m_pRightButton        = NULL;
00091     m_pHomeButton         = NULL;
00092     m_pEndButton          = NULL;
00093     m_hLeftArrow          = NULL;
00094     m_hLeftArrowDisabled  = NULL;
00095     m_hRightArrow         = NULL;
00096     m_hRightArrowDisabled = NULL;
00097     m_hHomeArrow          = NULL;
00098     m_hHomeArrowDisabled  = NULL;
00099     m_hEndArrow           = NULL;
00100     m_hEndArrowDisabled   = NULL;
00101     m_iXOffset            = 0;
00102 }

CCJFlatTabCtrl::~CCJFlatTabCtrl ( ) [virtual]

Definition at line 104 of file CJFlatTabCtrl.cpp.

References _delete, m_BoldFont, m_Font, m_pEndButton, m_pHomeButton, m_pLeftButton, m_pRightButton, m_TabList, and m_TabTipList.

00105 {
00106     _delete(m_pLeftButton);
00107     _delete(m_pRightButton);
00108     _delete(m_pHomeButton);
00109     _delete(m_pEndButton);
00110
00111     // free HENHMETAFILE handles.
00112     if(m_hLeftArrow) {
00113         ::DeleteEnhMetaFile(m_hLeftArrow);
00114     }
00115     if(m_hLeftArrowDisabled) {
00116         ::DeleteEnhMetaFile(m_hLeftArrowDisabled);
00117     }
00118     if(m_hRightArrow) {
00119         ::DeleteEnhMetaFile(m_hRightArrow);
00120     }
00121     if(m_hRightArrowDisabled) {
00122         ::DeleteEnhMetaFile(m_hRightArrowDisabled);
00123     }
00124     if(m_hHomeArrow) {
00125         ::DeleteEnhMetaFile(m_hHomeArrow);
00126     }
00127     if(m_hHomeArrowDisabled) {
00128         ::DeleteEnhMetaFile(m_hHomeArrowDisabled);
00129     }
00130     if(m_hEndArrow) {
00131         ::DeleteEnhMetaFile(m_hEndArrow);
00132     }
00133     if(m_hEndArrowDisabled) {
00134         ::DeleteEnhMetaFile(m_hEndArrowDisabled);
00135     }
00136     while(!m_TabList.IsEmpty()) {
00137         CString* pItem = m_TabList.RemoveTail();
00138         _delete(pItem);
00139     }
00140     while(!m_TabTipList.IsEmpty()) {
00141         CString* pItem = m_TabTipList.RemoveTail();
00142         _delete(pItem);
00143     }
00144
00145     // fix potential resource leak - KStowell - 10-21-99
00146     m_Font.DeleteObject();
00147     m_BoldFont.DeleteObject();
00148 }

Member Function Documentation

void CCJFlatTabCtrl::CreateTabFont ( const int iTabHeight ) [private]

Definition at line 150 of file CJFlatTabCtrl.cpp.

References FALSE, m_BoldFont, m_Font, and NULL.

Referenced by OnSize.

00151 {
00152     int iHeight = -(iTabHeight - 6);
00153
00154     m_Font.DeleteObject();
00155     m_Font.CreateFont(iHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
00156         OUT_STROKE_PRECIS, CLIP_STROKE_PRECIS, PROOF_QUALITY, FF_SWISS, NULL);
00157
00158     m_BoldFont.DeleteObject();
00159     m_BoldFont.CreateFont(iHeight, 0, 0, 0, FW_EXTRABOLD, FALSE, FALSE, FALSE, ANSI_CHARSET,
00160         OUT_STROKE_PRECIS, CLIP_STROKE_PRECIS, PROOF_QUALITY, FF_SWISS, NULL);
00161 }

BOOL CCJFlatTabCtrl::DeleteAllItems ( ) [virtual]

Definition at line 393 of file CJFlatTabCtrl.cpp.

References _delete, EnableButtons, GetTotalTabWidth, InvalidateTabs, m_iCurSel, m_iTotalTabWidth, m_TabList, m_TabTipList, and TRUE.

00394 {
00395     while(!m_TabList.IsEmpty()) {
00396         CString* pItem = m_TabList.RemoveTail();
00397         _delete(pItem);
00398     }
00399
00400     while(!m_TabTipList.IsEmpty()) {
00401         CString* pItem = m_TabTipList.RemoveTail();
00402         _delete(pItem);
00403     }
00404
00405     m_iCurSel = -1;                             // PGB - Reset the currently selected tab to -1 as we have no tabs in our list now.
00406
00407     m_iTotalTabWidth = GetTotalTabWidth();      // PGB - Recalculate the total tab width now we have deleted all items
00408
00409     EnableButtons();
00410     InvalidateTabs();
00411
00412     return TRUE;
00413 }

BOOL CCJFlatTabCtrl::DeleteItem ( int nItem ) [virtual]

Definition at line 348 of file CJFlatTabCtrl.cpp.

References _delete, ASSERT, EnableButtons, FALSE, GetTotalTabWidth, InvalidateTabs, m_iCurSel, m_iTotalTabWidth, m_TabList, SetCurSel, and TRUE.

00349 {
00350     if (nItem < 0 || nItem >= m_TabList.GetCount())
00351         return FALSE;
00352
00353     POSITION pos = m_TabList.FindIndex(nItem);
00354     ASSERT(pos);
00355
00356     CString* pItem = m_TabList.GetAt(pos);
00357     m_TabList.RemoveAt(pos);
00358     _delete(pItem);
00359
00360     // PGB - Stole the following code from the OnLButtonDown() function
00361     // in order to cause the tab control to show the newly selected item
00362     // after deleting an item from the list
00363
00364     // warn parent that the selection is about to change
00365     int id = GetDlgCtrlID();
00366     NMHDR hdr;
00367     hdr.hwndFrom = m_hWnd;
00368     hdr.idFrom = id;
00369     hdr.code = TCN_SELCHANGING;
00370     if (GetParent()->SendMessage(WM_NOTIFY, id, (LPARAM)&hdr) == 0)
00371     {
00372         if (m_iCurSel >= m_TabList.GetCount())
00373         {
00374             SetCurSel(m_TabList.GetCount() - 1); // PGB - Reset the currently selected tab to the last one in the list
00375             InvalidateTabs();
00376         }
00377
00378         // notify parent that the selection has changed
00379         hdr.hwndFrom = m_hWnd;
00380         hdr.idFrom = id;
00381         hdr.code = TCN_SELCHANGE;
00382         GetParent()->SendMessage(WM_NOTIFY, id, (LPARAM)&hdr);
00383     }
00384
00385     m_iTotalTabWidth = GetTotalTabWidth();      // PGB - Recalculate the total tab width now we have deleted an item
00386
00387     EnableButtons();
00388     InvalidateTabs();
00389
00390     return TRUE;
00391 }

int CCJFlatTabCtrl::DrawTab | ( | CDC & | dc,
 |  | const int | x,
 |  | const int | y,
 |  | const int | iHeight,
 |  | bool | bSelected,
 |  | bool | bBottom,
 |  | LPCTSTR | lpszTab
 | ) | const [private]

Definition at line 240 of file CJFlatTabCtrl.cpp.

References m_BoldFont, and m_Font.

Referenced by OnPaint.

00241 {
00242     CFont* pOldFont = dc.SelectObject((CFont*)&m_BoldFont);
00243     CSize size(dc.GetTextExtent(lpszTab));
00244     CRect rcText;
00245     rcText.left = iHeight + x - 4;
00246     rcText.top = 2 + y;
00247     rcText.right = size.cx + iHeight + x - 4;
00248     rcText.bottom = size.cy + 2 + y;
00249
00250     int iHalf = iHeight / 2;
00251     int iWidth = iHeight + iHalf;
00252
00253     COLORREF crBack;
00254     COLORREF crFore;
00255     if (bSelected) {
00256         crBack = GetSysColor(COLOR_WINDOW);
00257         crFore = GetSysColor(COLOR_WINDOWTEXT);
00258     } else {
00259         crBack = GetSysColor(COLOR_3DFACE);
00260         crFore = GetSysColor(COLOR_BTNTEXT);
00261     }
00262
00263     CPen penOutline(PS_SOLID, 1, GetSysColor(COLOR_BTNTEXT));
00264     CPen penShadow(PS_SOLID, 1, GetSysColor(COLOR_3DSHADOW));
00265     CBrush brush;
00266     brush.CreateSolidBrush(crBack);
00267
00268     POINT points[4];
00269     points[0].x = x;                     points[0].y = iHeight + y - 1;
00270     points[1].x = iHalf + x;             points[1].y = y;
00271     points[2].x = size.cx + iHeight + x; points[2].y = y;
00272     points[3].x = size.cx + iWidth + x;  points[3].y = iHeight + y - 1;
00273
00274     if (bBottom) {
00275         // swap vertical coordinates
00276         points[0].y = points[1].y;
00277         points[2].y = points[3].y;
00278         points[1].y = points[2].y;
00279         points[3].y = points[0].y;
00280     }
00281
00282     CPen* pOldPen = dc.SelectObject(&penOutline);
00283     dc.SetBkColor(crBack);
00284     CBrush* pOldBrush = dc.SelectObject(&brush);
00285     dc.Polygon(points, 4);
00286     dc.SelectObject(bSelected ? (CFont*)&m_BoldFont : (CFont*)&m_Font);
00287     dc.SetTextColor(crFore);
00288     dc.DrawText(lpszTab, rcText, DT_CENTER);
00289     dc.SelectObject(&penShadow);
00290
00291     if (bSelected) {
00292         dc.MoveTo(iHalf + x + 1, points[1].y);
00293         dc.LineTo(size.cx + iHeight + x, points[1].y);
00294         CPen penBack(PS_SOLID, 1, crBack);
00295         dc.SelectObject(&penBack);
00296         dc.MoveTo(x + 1, points[0].y);
00297         dc.LineTo(size.cx + iWidth + x, points[0].y);
00298     } else {
00299         dc.MoveTo(iHalf + x + 1, points[1].y);
00300         dc.LineTo(size.cx + iHeight + x - 1, points[1].y);
00301         dc.LineTo(size.cx + iWidth + x - 1, points[0].y);
00302     }
00303
00304     // fix potential resource leak - KStowell - 10-21-99
00305     dc.SelectObject(pOldFont);
00306     dc.SelectObject(pOldPen);
00307     dc.SelectObject(pOldBrush);
00308     penOutline.DeleteObject();
00309     penShadow.DeleteObject();
00310     brush.DeleteObject();
00311
00312     return size.cx + iWidth;
00313 }

void CCJFlatTabCtrl::EnableButtons ( void ) [private]

Definition at line 223 of file CJFlatTabCtrl.cpp.

References GetTotalArrowWidth, m_iClientWidth, m_iTotalTabWidth, m_iXOffset, m_pEndButton, m_pHomeButton, m_pLeftButton, and m_pRightButton.

Referenced by DeleteAllItems, DeleteItem, InsertItem, OnEndArrow, OnHomeArrow, OnLeftArrow, OnRightArrow, OnSize, and SetCurSel.

00224 {
00225     if (m_bHasArrows)  //TCC: ADDED to handle situations where ther are no arrows
00226     {
00227         m_pLeftButton->EnableWindow(m_iXOffset);
00228         if (m_iClientWidth + m_iXOffset < m_iTotalTabWidth + GetTotalArrowWidth() + 1)
00229             m_pRightButton->EnableWindow(true);
00230         else
00231             m_pRightButton->EnableWindow(false);
00232         if (m_bHasHomeEnd)
00233         {
00234             m_pHomeButton->EnableWindow(m_iXOffset);
00235             m_pEndButton->EnableWindow(m_pRightButton->IsWindowEnabled());
00236         }
00237     }
00238 }

virtual int CCJFlatTabCtrl::GetCurSel ( ) const [inline, virtual]

Definition at line 94 of file CJFlatTabCtrl.h.

00094 {return m_iCurSel;}

virtual int CCJFlatTabCtrl::GetItemCount ( ) const [inline, virtual]

Definition at line 96 of file CJFlatTabCtrl.h.

00096 { return m_TabList.GetCount(); }

BOOL CCJFlatTabCtrl::GetItemRect | ( | int | nItem,
 |  | LPRECT | lpRect
 | ) | [virtual]

Definition at line 415 of file CJFlatTabCtrl.cpp.

References FALSE, GetTabWidth, GetTotalArrowWidth, m_iClientHeight, m_iXOffset, m_TabList, and TRUE.

Referenced by OnLeftArrow, OnRightArrow, and SetCurSel.

00416 {
00417     if (nItem < 0 || nItem >= m_TabList.GetCount())
00418         return FALSE;
00419
00420     int x = GetTotalArrowWidth();
00421     for (int i = 0; i < nItem; i++)
00422     {
00423         x += GetTabWidth(i);
00424         if (i != m_TabList.GetCount())
00425             x -= (m_iClientHeight / 2) + 2;
00426     }
00427     lpRect->left = x - m_iXOffset;
00428     lpRect->top = 0;
00429     lpRect->right = lpRect->left + GetTabWidth(nItem);
00430     lpRect->bottom = m_iClientHeight;
00431     return TRUE;
00432 }

int CCJFlatTabCtrl::GetTabWidth ( const int nItem ) const [private]

Definition at line 163 of file CJFlatTabCtrl.cpp.

References m_BoldFont, m_iClientHeight, m_TabList, and NULL.

Referenced by GetItemRect, GetTotalTabWidth, HitTest, and OnPaint.

00164 {
00165     CDC dc;
00166     dc.CreateCompatibleDC(NULL);
00167     CFont* pOldFont = dc.SelectObject((CFont*)&m_BoldFont);
00168     CSize size(dc.GetTextExtent(*m_TabList.GetAt(m_TabList.FindIndex(nItem))));
00169
00170     // fix potential resource leak - KStowell - 10-20-99.
00171     dc.SelectObject(pOldFont);
00172     dc.DeleteDC();
00173
00174     return size.cx + m_iClientHeight + (m_iClientHeight / 2);
00175 }

CString CCJFlatTabCtrl::GetTipText ( int nItem ) [virtual]

Definition at line 945 of file CJFlatTabCtrl.cpp.

References m_TabList, and m_TabTipList.

00946 {
00947     CString strText;
00948
00949     if (nItem < m_TabList.GetCount())
00950     {
00951         for (int i = 0; i < m_TabList.GetCount(); i++)
00952         {
00953             if (i == nItem)
00954             {
00955                 strText = *m_TabTipList.GetAt(m_TabTipList.FindIndex(nItem));
00956                 break;
00957             }
00958         }
00959     }
00960
00961     return strText;
00962 }

int CCJFlatTabCtrl::GetTotalArrowWidth ( void ) const [private]

Definition at line 190 of file CJFlatTabCtrl.cpp.

Referenced by EnableButtons, GetItemRect, HitTest, InvalidateTabs, OnEndArrow, OnLeftArrow, OnPaint, OnRightArrow, and SetCurSel.

00191 {
00192     int iWidth = 1;
00193     if (m_bHasArrows)
00194         iWidth += 32;
00195     if (m_bHasHomeEnd)
00196         iWidth += 32;
00197     return iWidth;
00198 }

int CCJFlatTabCtrl::GetTotalTabWidth ( void ) const [private]

Definition at line 177 of file CJFlatTabCtrl.cpp.

References GetTabWidth, m_iClientHeight, and m_TabList.

Referenced by DeleteAllItems, DeleteItem, InsertItem, and OnSize.

00178 {
00179     int iWidth = 0;
00180     for (int i = 0; i < m_TabList.GetCount(); i++)
00181     {
00182         iWidth += GetTabWidth(i);
00183         if (i != m_TabList.GetCount()-1) {
00184             iWidth -= (m_iClientHeight / 2);
00185         }
00186     }
00187     return iWidth + 2;
00188 }

int CCJFlatTabCtrl::HitTest ( TCHITTESTINFO * pHitTestInfo ) const [virtual]

Definition at line 434 of file CJFlatTabCtrl.cpp.

References GetTabWidth, GetTotalArrowWidth, m_iClientHeight, m_iXOffset, and m_TabList.

Referenced by OnLButtonDown, OnLeftArrow, OnRightArrow, and PreTranslateMessage.

00435 {
00436     // ignore hits on the buttons
00437     int iHitX = pHitTestInfo->pt.x;
00438     if (iHitX < GetTotalArrowWidth())
00439         return -1;
00440
00441     // check if any tabs were hit
00442     int x = GetTotalArrowWidth() - m_iXOffset;
00443     for (int i = 0; i < m_TabList.GetCount(); i++)
00444     {
00445         int iTabWidth = GetTabWidth(i);
00446         if (i != m_TabList.GetCount())
00447             iTabWidth -= (m_iClientHeight / 2) + 2;
00448         if ((x <= iHitX) && (iHitX <= x + iTabWidth))
00449             return i;
00450         x += iTabWidth;
00451     }
00452
00453     // hit point is right of rightmost tab
00454     return -1;
00455 }

void CCJFlatTabCtrl::Home ( ) [virtual]

Definition at line 964 of file CJFlatTabCtrl.cpp.

References OnHomeArrow.

00965 {
00966     OnHomeArrow();
00967 }

BOOL CCJFlatTabCtrl::InsertItem | ( | const int | nItem,
 |  | LPCTSTR | lpszItem
 | ) | [virtual]

Definition at line 315 of file CJFlatTabCtrl.cpp.

References ASSERT, EnableButtons, GetTotalTabWidth, InvalidateTabs, m_iCurSel, m_iTotalTabWidth, m_TabList, and m_TabTipList.

00316 {
00317     if (nItem < 0 || nItem > m_TabList.GetCount())
00318         return -1;
00319
00320     // add tab to our list
00321     CString* pItem = new CString;
00322     ASSERT(pItem);
00323
00324     *pItem = lpszItem;
00325     m_TabList.AddTail(pItem);
00326
00327     // PGB - Add the tabs tip text to the list
00328
00329     CString* pTipItem = new CString;
00330     ASSERT(pTipItem);
00331
00332     *pTipItem = lpszItem;
00333     m_TabTipList.AddTail(pTipItem);
00334
00335     //
00336
00337     if (m_TabList.GetCount() == 1)
00338         m_iCurSel = 0;
00339
00340     m_iTotalTabWidth = GetTotalTabWidth();      // PGB - Recalculate the total tab width now we have added a new item
00341
00342     EnableButtons();
00343     InvalidateTabs();
00344
00345     return nItem;
00346 }

void CCJFlatTabCtrl::InvalidateTabs ( void ) [private]

Definition at line 200 of file CJFlatTabCtrl.cpp.

References GetTotalArrowWidth, m_iClientHeight, m_iClientWidth, m_iTotalTabWidth, and m_iXOffset.

Referenced by DeleteAllItems, DeleteItem, InsertItem, OnEndArrow, OnHomeArrow, OnLButtonDown, OnLeftArrow, OnRightArrow, and SetCurSel.

00201 {
00202     if (GetSafeHwnd())
00203     {
00204         // invalidate the visible tab area
00205         // to minimise flicker - don't erase the background
00206         CRect rcTabs;
00207
00208         rcTabs.left = GetTotalArrowWidth();
00209         rcTabs.top = 0;
00210         rcTabs.right = rcTabs.left + (m_iTotalTabWidth - m_iXOffset);
00211         rcTabs.bottom = m_iClientHeight;
00212         InvalidateRect(&rcTabs, false);
00213         // invalidate the blank area to the right of the tabs
00214         if (rcTabs.right < m_iClientWidth)
00215         {
00216             rcTabs.left = rcTabs.right;
00217             rcTabs.right = m_iClientWidth;
00218             InvalidateRect(&rcTabs, true);
00219         }
00220     }
00221 }

int CCJFlatTabCtrl::OnCreate ( LPCREATESTRUCT lpCreateStruct ) [protected]

Definition at line 675 of file CJFlatTabCtrl.cpp.

References FTS_BOTTOM, FTS_HASARROWS, FTS_HASHOMEEND, IDC_ENDBUTTON, IDC_HOMEBUTTON, IDC_LEFTBUTTON, IDC_RIGHTBUTTON, m_bHasArrows, m_bHasHomeEnd, m_bTabsOnBottom, m_hEndArrow, m_hEndArrowDisabled, m_hHomeArrow, m_hHomeArrowDisabled, m_hLeftArrow, m_hLeftArrowDisabled, m_hRightArrow, m_hRightArrowDisabled, m_pEndButton, m_pHomeButton, m_pLeftButton, m_pRightButton, m_ToolTip, NULL, CCJMetaFileButton::SetMetaFiles, and TRUE.

00676 {
00677     if (CWnd::OnCreate(lpCreateStruct) == -1)
00678         return -1;
00679
00680     // TODO: Add your specialized creation code here
00681     if (lpCreateStruct->style & FTS_BOTTOM) {
00682         m_bTabsOnBottom = true;
00683     }
00684
00685     if (lpCreateStruct->style & TCS_TOOLTIPS) {
00686         m_ToolTip.Create(this);
00687         m_ToolTip.Activate(TRUE);
00688         m_ToolTip.AddTool(this, _T("Flat Tab Tool Tip"));
00689         m_ToolTip.SendMessage(TTM_SETMAXTIPWIDTH, 0, SHRT_MAX); // Allow multiline tooltips
00690     }
00691
00692     if (lpCreateStruct->style & FTS_HASARROWS)
00693     {
00694         m_bHasArrows = true;
00695         POINT points[4];
00696         points[0].x = 100; points[0].y = 0;
00697         points[1].x = 0;   points[1].y = 50;
00698         points[2].x = 100; points[2].y = 100;
00699         points[3].x = 100; points[3].y = 0;
00700
00702         // This portion of the code was re-written to help eliminate a nasty resource
00703         // leak. It would seem that the CMetaFileDC was not freeing the GDI resources
00704         // completely whenever CMetaFileDC::CloseEnhanced() was called. This may be due
00705         // to a BUG in MFC or perhaps this class, in any event, this seems to resolve
00706         // the issue. - KStowell - 10-23-99.
00708         HPEN   hPen           = ::CreatePen( PS_SOLID, 1, RGB( 0,0,0 ));
00709         HPEN   hPenDisabled   = ::CreatePen( PS_SOLID, 1, RGB( 128,128,128 ));
00710         HBRUSH hBrush         = ::CreateSolidBrush( RGB( 0,0,0 ));
00711         HBRUSH hBrushDisabled = ::CreateSolidBrush( RGB( 128,128,128 ));;
00712
00713         // create left arrow metafile
00714         HDC hMetaDC      = ::CreateEnhMetaFile( NULL, NULL, NULL, NULL );
00715         HPEN hOldPen     = (HPEN)::SelectObject( hMetaDC, hPen );
00716         HBRUSH hOldBrush = (HBRUSH)::SelectObject( hMetaDC, hBrush );
00717         ::Polygon( hMetaDC, points, 4 );
00718         ::SelectObject( hMetaDC, hOldPen );
00719         ::SelectObject( hMetaDC, hOldBrush );
00720         m_hLeftArrow = ::CloseEnhMetaFile( hMetaDC );
00721
00722         // create disabled left arrow metafile
00723         hMetaDC   = ::CreateEnhMetaFile( NULL, NULL, NULL, NULL );
00724         hOldPen   = (HPEN)::SelectObject( hMetaDC, hPenDisabled );
00725         hOldBrush = (HBRUSH)::SelectObject( hMetaDC, hBrushDisabled );
00726         ::Polygon( hMetaDC, points, 4 );
00727         ::SelectObject( hMetaDC, hOldPen );
00728         ::SelectObject( hMetaDC, hOldBrush );
00729         m_hLeftArrowDisabled = ::CloseEnhMetaFile( hMetaDC );
00730
00731         points[0].x = 0;   points[0].y = 0;
00732         points[1].x = 100; points[1].y = 50;
00733         points[2].x = 0;   points[2].y = 100;
00734         points[3].x = 0;   points[3].y = 0;
00735
00736         // create right arrow metafile
00737         hMetaDC   = ::CreateEnhMetaFile( NULL, NULL, NULL, NULL );
00738         hOldPen   = (HPEN)::SelectObject( hMetaDC, hPen );
00739         hOldBrush = (HBRUSH)::SelectObject( hMetaDC, hBrush );
00740         ::Polygon( hMetaDC, points, 4 );
00741         ::SelectObject( hMetaDC, hOldPen );
00742         ::SelectObject( hMetaDC, hOldBrush );
00743         m_hRightArrow = ::CloseEnhMetaFile( hMetaDC );
00744
00745         // create disabled right arrow metafile
00746         hMetaDC   = ::CreateEnhMetaFile( NULL, NULL, NULL, NULL );
00747         hOldPen   = (HPEN)::SelectObject( hMetaDC, hPenDisabled );
00748         hOldBrush = (HBRUSH)::SelectObject( hMetaDC, hBrushDisabled );
00749         ::Polygon( hMetaDC, points, 4 );
00750         ::SelectObject( hMetaDC, hOldPen );
00751         ::SelectObject( hMetaDC, hOldBrush );
00752         m_hRightArrowDisabled = ::CloseEnhMetaFile( hMetaDC );
00753
00754         CRect rcButton(0, 0, 16, 16);
00755         m_pLeftButton = new CCJMetaFileButton;
00756         m_pLeftButton->Create(NULL, WS_CHILD | WS_VISIBLE | WS_DISABLED | BS_OWNERDRAW, rcButton, this, IDC_LEFTBUTTON);
00757         m_pLeftButton->SetMetaFiles(m_hLeftArrow, 0, 0, m_hLeftArrowDisabled);
00758
00759         m_pRightButton = new CCJMetaFileButton;
00760         m_pRightButton->Create(NULL, WS_CHILD | WS_VISIBLE | WS_DISABLED | BS_OWNERDRAW, rcButton, this, IDC_RIGHTBUTTON);
00761         m_pRightButton->SetMetaFiles(m_hRightArrow, 0, 0, m_hRightArrowDisabled);
00762
00763         if (lpCreateStruct->style & FTS_HASHOMEEND)
00764         {
00765             m_bHasHomeEnd = true;
00766
00767             // Setup the Home arrow button
00768             points[0].x = 100;   points[0].y = 0;
00769             points[1].x = 0;     points[1].y = 50;
00770             points[2].x = 100;   points[2].y = 100;
00771             points[3].x = 100;   points[3].y = 0;
00772
00773             // create right arrow metafile
00774             HDC hMetaDC      = ::CreateEnhMetaFile( NULL, NULL, NULL, NULL );
00775             HPEN hOldPen     = (HPEN)::SelectObject( hMetaDC, hPen );
00776             HBRUSH hOldBrush = (HBRUSH)::SelectObject( hMetaDC, hBrush );
00777             ::Polygon( hMetaDC, points, 4 );
00778             ::MoveToEx( hMetaDC, 0, 0, NULL );
00779             ::LineTo( hMetaDC, 0, 100 );
00780             ::SelectObject( hMetaDC, hOldPen );
00781             ::SelectObject( hMetaDC, hOldBrush );
00782             m_hHomeArrow = ::CloseEnhMetaFile( hMetaDC );
00783
00784             // create disabled right arrow metafile
00785             hMetaDC   = ::CreateEnhMetaFile( NULL, NULL, NULL, NULL );
00786             hOldPen   = (HPEN)::SelectObject( hMetaDC, hPenDisabled );
00787             hOldBrush = (HBRUSH)::SelectObject( hMetaDC, hBrushDisabled );
00788             ::Polygon( hMetaDC, points, 4 );
00789             ::MoveToEx( hMetaDC, 0, 0, NULL );
00790             ::LineTo( hMetaDC, 0, 100 );
00791             ::SelectObject( hMetaDC, hOldPen );
00792             ::SelectObject( hMetaDC, hOldBrush );
00793             m_hHomeArrowDisabled = ::CloseEnhMetaFile( hMetaDC );
00794
00795             m_pHomeButton = new CCJMetaFileButton;
00796             m_pHomeButton->Create(NULL, WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, rcButton, this, IDC_HOMEBUTTON);
00797             m_pHomeButton->SetMetaFiles(m_hHomeArrow, 0, 0, m_hHomeArrowDisabled);
00798
00799             // Setup the End arrow button
00800             points[0].x = 0;   points[0].y = 0;
00801             points[1].x = 100; points[1].y = 50;
00802             points[2].x = 0;   points[2].y = 100;
00803             points[3].x = 0;   points[3].y = 0;
00804
00805             // create right arrow metafile
00806             hMetaDC   = ::CreateEnhMetaFile( NULL, NULL, NULL, NULL );
00807             hOldPen   = (HPEN)::SelectObject( hMetaDC, hPen );
00808             hOldBrush = (HBRUSH)::SelectObject( hMetaDC, hBrush );
00809             ::Polygon( hMetaDC, points, 4 );
00810             ::MoveToEx( hMetaDC, 100, 0, NULL );
00811             ::LineTo( hMetaDC, 100, 100 );
00812             ::SelectObject( hMetaDC, hOldPen );
00813             ::SelectObject( hMetaDC, hOldBrush );
00814             m_hEndArrow = ::CloseEnhMetaFile( hMetaDC );
00815
00816             // create disabled right arrow metafile
00817             hMetaDC   = ::CreateEnhMetaFile( NULL, NULL, NULL, NULL );
00818             hOldPen   = (HPEN)::SelectObject( hMetaDC, hPenDisabled );
00819             hOldBrush = (HBRUSH)::SelectObject( hMetaDC, hBrushDisabled );
00820             ::Polygon( hMetaDC, points, 4 );
00821             ::MoveToEx( hMetaDC, 100, 0, NULL );
00822             ::LineTo( hMetaDC, 100, 100 );
00823             ::SelectObject( hMetaDC, hOldPen );
00824             ::SelectObject( hMetaDC, hOldBrush );
00825             m_hEndArrowDisabled = ::CloseEnhMetaFile( hMetaDC );
00826
00827             m_pEndButton = new CCJMetaFileButton;
00828             m_pEndButton->Create(NULL, WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, rcButton, this, IDC_ENDBUTTON);
00829             m_pEndButton->SetMetaFiles(m_hEndArrow, 0, 0, m_hEndArrowDisabled);
00830
00831             m_pHomeButton->MoveWindow(1, 0, 16, 16);
00832             m_pLeftButton->MoveWindow(17, 0, 16, 16);
00833             m_pRightButton->MoveWindow(33, 0, 16, 16);
00834             m_pEndButton->MoveWindow(49, 0, 16, 16);
00835
00836         } else {
00837             m_pLeftButton->MoveWindow(1, 0, 16, 16);
00838             m_pRightButton->MoveWindow(17, 0, 16, 16);
00839         }
00840
00841         // fix potential resource leak - KStowell - 10-23-99
00842         ::DeleteObject(hPen);
00843         ::DeleteObject(hPenDisabled);
00844         ::DeleteObject(hBrush);
00845         ::DeleteObject(hBrushDisabled);
00846     }
00847
00848     return 0;
00849 }

void CCJFlatTabCtrl::OnEndArrow ( ) [protected]

Definition at line 917 of file CJFlatTabCtrl.cpp.

References EnableButtons, GetTotalArrowWidth, InvalidateTabs, m_iClientWidth, m_iTotalTabWidth, and m_iXOffset.

00918 {
00919     // TODO: Add your control notification handler code here
00920     m_iXOffset = m_iTotalTabWidth + GetTotalArrowWidth() - m_iClientWidth + 1;
00921     EnableButtons();
00922     InvalidateTabs();
00923 }

void CCJFlatTabCtrl::OnHomeArrow ( ) [protected]

Definition at line 909 of file CJFlatTabCtrl.cpp.

References EnableButtons, InvalidateTabs, and m_iXOffset.

Referenced by Home.

00910 {
00911     // TODO: Add your control notification handler code here
00912     m_iXOffset = 0;
00913     EnableButtons();
00914     InvalidateTabs();
00915 }

void CCJFlatTabCtrl::OnLButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 618 of file CJFlatTabCtrl.cpp.

References HitTest, InvalidateTabs, m_iCurSel, and SetCurSel.

00619 {
00620     // TODO: Add your message handler code here and/or call default
00621     TCHITTESTINFO test;
00622     test.pt = point;
00623     int iTab = HitTest(&test);
00624     if ((iTab != -1) && (iTab != m_iCurSel))
00625     {
00626         // warn parent that the selection is about to change
00627         int id = GetDlgCtrlID();
00628         NMHDR hdr;
00629         hdr.hwndFrom = m_hWnd;
00630         hdr.idFrom = id;
00631         hdr.code = TCN_SELCHANGING;
00632         if (GetParent()->SendMessage(WM_NOTIFY, id, (LPARAM)&hdr) == 0)
00633         {
00634             // parent has given permission for the selection to change
00635             SetCurSel(iTab);
00636             InvalidateTabs();
00637
00638             // notify parent that the selection has changed
00639             hdr.hwndFrom = m_hWnd;
00640             hdr.idFrom = id;
00641             hdr.code = TCN_SELCHANGE;
00642             GetParent()->SendMessage(WM_NOTIFY, id, (LPARAM)&hdr);
00643         }
00644     }
00645
00646     CWnd::OnLButtonDown(nFlags, point);
00647 }

void CCJFlatTabCtrl::OnLeftArrow ( ) [protected]

Definition at line 851 of file CJFlatTabCtrl.cpp.

References EnableButtons, GetItemRect, GetTotalArrowWidth, HitTest, InvalidateTabs, and m_iXOffset.

00852 {
00853     // Move the tabs right, ensuring that we move right by one
00854     // whole tab each time ala Microsoft Access
00855
00856     CPoint Point(GetTotalArrowWidth()+1, 1);
00857
00858     TCHITTESTINFO test;
00859     test.pt = Point;
00860     int iTab = HitTest(&test);
00861
00862     if (iTab != -1)
00863     {
00864         m_iXOffset = 0;
00865         for (int iLoop = 0; iLoop <= iTab - 1; iLoop++)
00866         {
00867             RECT rect;
00868             if (GetItemRect(iLoop, &rect))
00869             {
00870                 m_iXOffset += rect.left;
00871             }
00872         }
00873         m_iXOffset -= GetTotalArrowWidth();
00874
00875         EnableButtons();
00876         InvalidateTabs();
00877     }
00878 }

void CCJFlatTabCtrl::OnPaint ( ) [protected]

Definition at line 555 of file CJFlatTabCtrl.cpp.

References DrawTab, GetTabWidth, GetTotalArrowWidth, m_bTabsOnBottom, m_iClientHeight, m_iClientWidth, m_iCurSel, m_iTotalTabWidth, m_iXOffset, m_TabList, and NULL.

00556 {
00557     CPaintDC dc(this); // device context for painting
00558
00559     CBrush brush;
00560     brush.CreateSysColorBrush(COLOR_3DFACE);
00561     CPen penBlack(PS_SOLID, 1, RGB(0,0,0));
00562
00563     // draw the black line along the left of the control
00564     CPen* pOldPen = dc.SelectObject(&penBlack);
00565     dc.MoveTo(0, 0);
00566     dc.LineTo(0, m_iClientHeight);
00567
00568     // draw the black line along the top/bottom of the control
00569     int iTotalArrowWidth = GetTotalArrowWidth();
00570     int iEndOfTab = iTotalArrowWidth + m_iTotalTabWidth - m_iXOffset;
00571     dc.MoveTo(iEndOfTab, m_bTabsOnBottom ? 0 : m_iClientHeight - 1);
00572     dc.LineTo(m_iClientWidth, m_bTabsOnBottom ? 0 : m_iClientHeight - 1);
00573
00574     // fill the empty background area
00575     int iFillHeight = m_iClientHeight - (m_bTabsOnBottom ? 0 : 1);
00576     CRect rcBack(iEndOfTab, m_bTabsOnBottom ? 1 : 0, m_iClientWidth, iFillHeight);
00577     dc.FillRect(rcBack, &brush);
00578
00579     // create a bitmap of all the tabs
00580     CDC dcMem;
00581     dcMem.CreateCompatibleDC(NULL);
00582     CBitmap bitmap;
00583     bitmap.CreateCompatibleBitmap(&dc, m_iTotalTabWidth, m_iClientHeight);
00584     CBitmap* pOldBitmap = dcMem.SelectObject(&bitmap);
00585     CBrush* pOldBrush = dcMem.SelectObject(&brush);
00586     CRect rc(0, m_bTabsOnBottom ? 1 : 0, m_iTotalTabWidth, iFillHeight);
00587     dcMem.FillRect(rc, &brush);
00588
00589     int iOverlap = (m_iClientHeight / 2) + 2;
00590     int x = 0;
00591     int iSelX = 0;
00592     for (int i = 0; i < m_TabList.GetCount(); i++)
00593     {
00594         if (i != m_iCurSel)
00595             x += DrawTab(dcMem, x, 0, m_iClientHeight, false, m_bTabsOnBottom, *m_TabList.GetAt(m_TabList.FindIndex(i))) - iOverlap;
00596         else
00597         {
00598             iSelX = x;
00599             x += GetTabWidth(i) - iOverlap;
00600         }
00601     }
00602     if (m_iCurSel >= 0)
00603         DrawTab(dcMem, iSelX, 0, m_iClientHeight, true, m_bTabsOnBottom, *m_TabList.GetAt(m_TabList.FindIndex(m_iCurSel)));
00604
00605     // blit the bitmap onto the control
00606     dc.BitBlt(iTotalArrowWidth, 0, m_iClientWidth - iTotalArrowWidth, m_iClientHeight, &dcMem, m_iXOffset, 0, SRCCOPY);
00607
00608     // fix potential resource leak - KStowell - 10-21-99.
00609     dcMem.SelectObject(pOldPen);
00610     dcMem.SelectObject(pOldBitmap);
00611     dcMem.SelectObject(pOldBrush);
00612     dcMem.DeleteDC();
00613     brush.DeleteObject();
00614     penBlack.DeleteObject();
00615     bitmap.DeleteObject();
00616 }

void CCJFlatTabCtrl::OnRightArrow ( ) [protected]

Definition at line 880 of file CJFlatTabCtrl.cpp.

References EnableButtons, GetItemRect, GetTotalArrowWidth, HitTest, InvalidateTabs, and m_iXOffset.

00881 {
00882     // Move the tabs left, ensuring that we move left by one
00883     // whole tab each time ala Microsoft Access
00884
00885     CPoint Point(GetTotalArrowWidth()+1, 1);
00886
00887     TCHITTESTINFO test;
00888     test.pt = Point;
00889     int iTab = HitTest(&test);
00890
00891     if (iTab != -1)
00892     {
00893         m_iXOffset = 0;
00894         for (int iLoop = 0; iLoop <= iTab + 1; iLoop++)
00895         {
00896             RECT rect;
00897             if (GetItemRect(iLoop, &rect))
00898             {
00899                 m_iXOffset += rect.left;
00900             }
00901         }
00902         m_iXOffset -= GetTotalArrowWidth();
00903
00904         EnableButtons();
00905         InvalidateTabs();
00906     }
00907 }

void CCJFlatTabCtrl::OnSize | ( | UINT | nType,
 |  | int | cx,
 |  | int | cy
 | ) | [protected]

Definition at line 649 of file CJFlatTabCtrl.cpp.

References CreateTabFont, EnableButtons, GetTotalTabWidth, m_iClientHeight, m_iClientWidth, m_iTotalTabWidth, m_pEndButton, m_pHomeButton, m_pLeftButton, and m_pRightButton.

00650 {
00651     CWnd::OnSize(nType, cx, cy);
00652
00653     // TODO: Add your message handler code here
00654     if (m_bHasHomeEnd) {
00655         m_pHomeButton->MoveWindow(1, 0, 16, cy);
00656         m_pLeftButton->MoveWindow(17, 0, 16, cy);
00657         m_pRightButton->MoveWindow(33, 0, 16, cy);
00658         m_pEndButton->MoveWindow(49, 0, 16, cy);
00659     } else {
00660         if (m_bHasArrows) { //TCC: ADDED to handle situations where ther are no arrows
00661             m_pLeftButton->MoveWindow(1, 0, 16, cy);
00662             m_pRightButton->MoveWindow(17, 0, 16, cy);
00663         }
00664     }
00665
00666     m_iClientWidth  = cx;
00667     m_iClientHeight = cy;
00668
00669     CreateTabFont(cy);
00670
00671     m_iTotalTabWidth = GetTotalTabWidth();
00672     EnableButtons();
00673 }

BOOL CCJFlatTabCtrl::PreCreateWindow ( CREATESTRUCT & cs ) [protected, virtual]

Definition at line 506 of file CJFlatTabCtrl.cpp.

References FALSE, NULL, and TRUE.

00507 {
00508     if (!CWnd::PreCreateWindow(cs))
00509         return FALSE;
00510
00511     cs.lpszClass = AfxRegisterWndClass(CS_DBLCLKS,
00512             ::LoadCursor(NULL, IDC_ARROW), NULL, NULL);
00513
00514     return TRUE;
00515 }

BOOL CCJFlatTabCtrl::PreTranslateMessage ( MSG * pMsg ) [protected, virtual]

Definition at line 517 of file CJFlatTabCtrl.cpp.

References HitTest, m_TabTipList, and m_ToolTip.

00518 {
00519     ASSERT_VALID(this);
00520
00521     if (::IsWindow(m_ToolTip.m_hWnd))
00522                                                                                                                                                                                                                                                                                                                                                                                                                            {
00523         if(pMsg->message == WM_MOUSEMOVE && pMsg->hwnd == m_hWnd)
00524         {
00525             CPoint Point(LOWORD(pMsg->lParam), HIWORD(pMsg->lParam));
00526
00527             TCHITTESTINFO test;
00528             test.pt = Point;
00529             int iTab = HitTest(&test);
00530
00531             if (iTab >= 0)
00532             {
00533                 CString strText;
00534
00535                 strText = (LPCTSTR) *m_TabTipList.GetAt(m_TabTipList.FindIndex(iTab));
00536
00537                 TRACE2("Mouse over tab %d : %s\n", iTab, strText);
00538
00539                 m_ToolTip.UpdateTipText(strText, this);
00540                 m_ToolTip.RelayEvent(pMsg);
00541             } else  {
00542                 // VC5 compatibility - Kirk Stowell - 10-21-99
00543                 ::SendMessage(m_ToolTip.m_hWnd, TTM_POP, 0, 0L);
00544             }
00545         }
00546         else {
00547             // VC5 compatibility - Kirk Stowell - 10-21-99
00548             ::SendMessage(m_ToolTip.m_hWnd, TTM_POP, 0, 0L);
00549         }
00550     }
00551
00552     return CWnd::PreTranslateMessage(pMsg);
00553 }

int CCJFlatTabCtrl::SetCurSel ( int nItem ) [virtual]

Definition at line 457 of file CJFlatTabCtrl.cpp.

References EnableButtons, GetItemRect, GetTotalArrowWidth, InvalidateTabs, m_iClientWidth, m_iCurSel, m_iXOffset, and m_TabList.

Referenced by DeleteItem, and OnLButtonDown.

00458 {
00459     if (nItem < 0 || nItem >= m_TabList.GetCount())
00460         return -1;
00461
00462     int iPrevSel = m_iCurSel;
00463     m_iCurSel = nItem;
00464
00465     // test if we need to center on the selected tab
00466     CRect rcItem;
00467     if (GetItemRect(nItem, &rcItem))
00468     {
00469         // test if the tab is off on the left
00470         int iTotalArrowWidth = GetTotalArrowWidth();
00471         rcItem.left -= iTotalArrowWidth;
00472         if (rcItem.left < 0)
00473             m_iXOffset += rcItem.left;
00474         else
00475         {
00476             // test if the tab is off on the right
00477             rcItem.right -= iTotalArrowWidth;
00478             int iTabAreaWidth = m_iClientWidth - iTotalArrowWidth;
00479             if (rcItem.right > iTabAreaWidth)
00480                 m_iXOffset += (rcItem.right - iTabAreaWidth);
00481         }
00482     }
00483
00484     EnableButtons();
00485     InvalidateTabs();
00486
00487     return iPrevSel;
00488 }

void CCJFlatTabCtrl::SetTipText | ( | int | nItem,
 |  | LPCTSTR | lpszTabTip
 | ) | [virtual]

Definition at line 925 of file CJFlatTabCtrl.cpp.

References m_TabList, and m_TabTipList.

00926 {
00927     if (nItem < m_TabList.GetCount())
00928     {
00929         for (int i = 0; i < m_TabList.GetCount(); i++)
00930         {
00931             if (i == nItem)
00932             {
00933                 CString *pTipItem = m_TabTipList.GetAt(m_TabTipList.FindIndex(nItem));
00934
00935                 *pTipItem = lpszTabTip;
00936
00937                 break;
00938             }
00939         }
00940     }
00941
00942     return;
00943 }

Member Data Documentation

bool CCJFlatTabCtrl::m_bHasArrows [private]

Definition at line 137 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl, and OnCreate.

bool CCJFlatTabCtrl::m_bHasHomeEnd [private]

Definition at line 138 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl, and OnCreate.

CFont CCJFlatTabCtrl::m_BoldFont [private]

Definition at line 148 of file CJFlatTabCtrl.h.

Referenced by CreateTabFont, DrawTab, GetTabWidth, and ~CCJFlatTabCtrl.

bool CCJFlatTabCtrl::m_bTabsOnBottom [private]

Definition at line 139 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl, OnCreate, and OnPaint.

CFont CCJFlatTabCtrl::m_Font [private]

Definition at line 147 of file CJFlatTabCtrl.h.

Referenced by CreateTabFont, DrawTab, and ~CCJFlatTabCtrl.

HENHMETAFILE CCJFlatTabCtrl::m_hEndArrow [private]

Definition at line 159 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl, and OnCreate.

HENHMETAFILE CCJFlatTabCtrl::m_hEndArrowDisabled [private]

Definition at line 160 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl, and OnCreate.

HENHMETAFILE CCJFlatTabCtrl::m_hHomeArrow [private]

Definition at line 157 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl, and OnCreate.

HENHMETAFILE CCJFlatTabCtrl::m_hHomeArrowDisabled [private]

Definition at line 158 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl, and OnCreate.

HENHMETAFILE CCJFlatTabCtrl::m_hLeftArrow [private]

Definition at line 153 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl, and OnCreate.

HENHMETAFILE CCJFlatTabCtrl::m_hLeftArrowDisabled [private]

Definition at line 154 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl, and OnCreate.

HENHMETAFILE CCJFlatTabCtrl::m_hRightArrow [private]

Definition at line 155 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl, and OnCreate.

HENHMETAFILE CCJFlatTabCtrl::m_hRightArrowDisabled [private]

Definition at line 156 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl, and OnCreate.

int CCJFlatTabCtrl::m_iClientHeight [private]

Definition at line 142 of file CJFlatTabCtrl.h.

Referenced by GetItemRect, GetTabWidth, GetTotalTabWidth, HitTest, InvalidateTabs, OnPaint, and OnSize.

int CCJFlatTabCtrl::m_iClientWidth [private]

Definition at line 141 of file CJFlatTabCtrl.h.

Referenced by EnableButtons, InvalidateTabs, OnEndArrow, OnPaint, OnSize, and SetCurSel.

int CCJFlatTabCtrl::m_iCurSel [private]

Definition at line 140 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl, DeleteAllItems, DeleteItem, InsertItem, OnLButtonDown, OnPaint, and SetCurSel.

int CCJFlatTabCtrl::m_iTotalTabWidth [private]

Definition at line 143 of file CJFlatTabCtrl.h.

Referenced by DeleteAllItems, DeleteItem, EnableButtons, InsertItem, InvalidateTabs, OnEndArrow, OnPaint, and OnSize.

int CCJFlatTabCtrl::m_iXOffset [private]

Definition at line 144 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl, EnableButtons, GetItemRect, HitTest, InvalidateTabs, OnEndArrow, OnHomeArrow, OnLeftArrow, OnPaint, OnRightArrow, and SetCurSel.

CCJMetaFileButton* CCJFlatTabCtrl::m_pEndButton [private]

Definition at line 152 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl, EnableButtons, OnCreate, OnSize, and ~CCJFlatTabCtrl.

CCJMetaFileButton* CCJFlatTabCtrl::m_pHomeButton [private]

Definition at line 151 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl, EnableButtons, OnCreate, OnSize, and ~CCJFlatTabCtrl.

CCJMetaFileButton* CCJFlatTabCtrl::m_pLeftButton [private]

Definition at line 149 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl, EnableButtons, OnCreate, OnSize, and ~CCJFlatTabCtrl.

CCJMetaFileButton* CCJFlatTabCtrl::m_pRightButton [private]

Definition at line 150 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl, EnableButtons, OnCreate, OnSize, and ~CCJFlatTabCtrl.

CTabList CCJFlatTabCtrl::m_TabList [private]

Definition at line 145 of file CJFlatTabCtrl.h.

Referenced by DeleteAllItems, DeleteItem, GetItemRect, GetTabWidth, GetTipText, GetTotalTabWidth, HitTest, InsertItem, OnPaint, SetCurSel, SetTipText, and ~CCJFlatTabCtrl.

CTabList CCJFlatTabCtrl::m_TabTipList [private]

Definition at line 146 of file CJFlatTabCtrl.h.

Referenced by DeleteAllItems, GetTipText, InsertItem, PreTranslateMessage, SetTipText, and ~CCJFlatTabCtrl.

CToolTipCtrl CCJFlatTabCtrl::m_ToolTip [private]

Definition at line 162 of file CJFlatTabCtrl.h.

Referenced by OnCreate, and PreTranslateMessage.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJFlatTabCtrl.h
  • WinCvs/CJLib/CJLibrary/CJFlatTabCtrl.cpp
Generated on Sun Feb 24 01:24:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJFontCombo Class Reference

#include <CJFontCombo.h>

Inheritance diagram for CCJFontCombo:

[legend]
Collaboration diagram for CCJFontCombo:

[legend]
List of all members.

Public Methods

CCJFontCombo ()
virtual int | GetSelFont (LOGFONT &logFont)
virtual void | SetHilightColors (COLORREF clrHilight, COLORREF clrHilightText)
virtual void | SetNormalColors (COLORREF clrBkgnd, COLORREF clrNormalText)
virtual void | DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct)
virtual void | MeasureItem (LPMEASUREITEMSTRUCT lpMeasureItemStruct)
virtual | ~CCJFontCombo ()

Static Public Methods

BOOL CALLBACK | EnumFontProc (LPLOGFONT lpLogFont, LPTEXTMETRIC lpTextMetric, short nFontType, LPHANDLE lpData)

Protected Methods

virtual void | InitializeFonts ()
virtual void | PreSubclassWindow ()
afx_msg void | OnDestroy ()
afx_msg int | OnCreate (LPCREATESTRUCT lpCreateStruct)
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)
afx_msg void | OnPaint ()

Protected Attributes

COLORREF | m_clrHilight
COLORREF | m_clrNormalText
COLORREF | m_clrHilightText
COLORREF | m_clrBkgnd

Constructor & Destructor Documentation

CCJFontCombo::CCJFontCombo ( )

Definition at line 64 of file CJFontCombo.cpp.

References m_clrBkgnd, m_clrHilight, m_clrHilightText, and m_clrNormalText.

00065 {
00066      m_clrHilight       = ::GetSysColor(COLOR_HIGHLIGHT);
00067      m_clrNormalText    = ::GetSysColor(COLOR_WINDOWTEXT);
00068      m_clrHilightText   = ::GetSysColor(COLOR_HIGHLIGHTTEXT);
00069      m_clrBkgnd         = ::GetSysColor(COLOR_WINDOW);
00070 }

CCJFontCombo::~CCJFontCombo ( ) [virtual]

Definition at line 72 of file CJFontCombo.cpp.

00073 {
00074 }

Member Function Documentation

void CCJFontCombo::DrawItem ( LPDRAWITEMSTRUCT lpDrawItemStruct ) [virtual]

Definition at line 90 of file CJFontCombo.cpp.

References m_clrBkgnd, m_clrHilight, m_clrHilightText, and m_clrNormalText.

00091 {
00092     CDC*      pDC      = CDC::FromHandle(lpDrawItemStruct->hDC);
00093     CRect     rect     = lpDrawItemStruct->rcItem;
00094     int       nState   = lpDrawItemStruct->itemState;
00095     int       nItem    = lpDrawItemStruct->itemID;
00096     LPLOGFONT pLogFont = (LPLOGFONT)lpDrawItemStruct->itemData;
00097
00098     pDC->SetBkMode( TRANSPARENT );
00099
00100     if( nState & ODS_SELECTED ) {
00101         pDC->FillSolidRect( rect, m_clrHilight );
00102         pDC->SetTextColor( m_clrHilightText );
00103     }
00104     else {
00105         pDC->FillSolidRect( rect, m_clrBkgnd );
00106         pDC->SetTextColor( m_clrNormalText );
00107     }
00108
00109     if( nItem >= 0 )
00110     {
00111         CString strText;
00112         GetLBText( nItem, strText );
00113
00114         CFont newFont;
00115         pLogFont->lfHeight = 90; //9 point size
00116         pLogFont->lfWidth  = 0;
00117         newFont.CreatePointFontIndirect( pLogFont );
00118
00119         CFont *pOldFont = pDC->SelectObject( &newFont );
00120         pDC->DrawText(strText, rect, DT_LEFT | DT_VCENTER | DT_SINGLELINE);
00121         pDC->SelectObject( pOldFont );
00122         newFont.DeleteObject();
00123     }
00124 }

BOOL CALLBACK CCJFontCombo::EnumFontProc | ( | LPLOGFONT | lpLogFont,
 |  | LPTEXTMETRIC | lpTextMetric,
 |  | short | nFontType,
 |  | LPHANDLE | lpData
 | ) | [static]

Definition at line 141 of file CJFontCombo.cpp.

References ASSERT, and TRUE.

Referenced by InitializeFonts.

00142 {
00143     UNUSED_ALWAYS( lpTextMetric );
00144
00145     if((nFontType == TRUETYPE_FONTTYPE) && (lpLogFont->lfCharSet != SYMBOL_CHARSET))
00146      {
00147          CCJFontCombo* pCombo = (CCJFontCombo*)lpData;
00148          ASSERT(pCombo);
00149
00150          int nIndex = pCombo->AddString(lpLogFont->lfFaceName);
00151          LPLOGFONT pLogFont = new LOGFONT;
00152
00153          ::CopyMemory((PVOID)pLogFont, (CONST VOID*)lpLogFont, (DWORD)sizeof( LOGFONT ));
00154          pCombo->SetItemData( nIndex, (DWORD)pLogFont );
00155      }
00156
00157      return TRUE;
00158 }

int CCJFontCombo::GetSelFont ( LOGFONT & logFont ) [virtual]

Definition at line 170 of file CJFontCombo.cpp.

00171 {
00172      int nIndex = GetCurSel ();
00173      if(nIndex != LB_ERR)
00174      {
00175         LPLOGFONT pLogFont = (LPLOGFONT)GetItemData(nIndex);
00176         ::CopyMemory((PVOID)&logFont, (CONST VOID*)pLogFont, sizeof(LOGFONT));
00177         return nIndex;
00178      }
00179
00180      return LB_ERR;
00181 }

void CCJFontCombo::InitializeFonts ( ) [protected, virtual]

Definition at line 131 of file CJFontCombo.cpp.

References EnumFontProc, and NULL.

Referenced by OnCreate, and PreSubclassWindow.

00132 {
00133     // Clear the combobox.
00134      ResetContent();
00135
00136      HDC hDC  = ::GetDC(m_hWnd);
00137      ::EnumFonts( hDC, NULL, (FONTENUMPROC)EnumFontProc, (LPARAM)this );//Enumerate
00138      ::ReleaseDC(m_hWnd, hDC);
00139 }

void CCJFontCombo::MeasureItem ( LPMEASUREITEMSTRUCT lpMeasureItemStruct ) [virtual]

Definition at line 126 of file CJFontCombo.cpp.

00127 {
00128     UNUSED_ALWAYS( lpMeasureItemStruct );
00129 }

int CCJFontCombo::OnCreate ( LPCREATESTRUCT lpCreateStruct ) [protected]

Definition at line 183 of file CJFontCombo.cpp.

References InitializeFonts.

00184 {
00185     if (CComboBox::OnCreate(lpCreateStruct) == -1)
00186         return -1;
00187
00188     InitializeFonts();
00189     return 0;
00190 }

void CCJFontCombo::OnDestroy ( ) [protected]

Definition at line 160 of file CJFontCombo.cpp.

References _delete.

00161 {
00162     for( int nIndex = 0; nIndex <  GetCount(); ++nIndex ) {
00163         LPLOGFONT pLogFont = (LPLOGFONT)GetItemData(nIndex);
00164         _delete( pLogFont );
00165     }
00166
00167      CComboBox::OnDestroy();
00168 }

BOOL CCJFontCombo::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 198 of file CJFontCombo.cpp.

References TRUE.

00199 {
00200     // KStowell - overridden for flicker-free drawing.
00201     UNUSED_ALWAYS(pDC);
00202     return TRUE;
00203 }

void CCJFontCombo::OnPaint ( ) [protected]

Definition at line 205 of file CJFontCombo.cpp.

00206 {
00207     CPaintDC dc(this); // device context for painting
00208
00209     // KStowell - Get the client rect.
00210     CRect rcClient, rcClip;
00211     dc.GetClipBox( &rcClip );
00212     GetClientRect( &rcClient );
00213
00214     // KStowell - Create a memory device-context. This is done to help reduce
00215     // screen flicker, since we will paint the entire control to the
00216     // off screen device context first.
00217     CDC memDC;
00218     CBitmap bitmap;
00219     memDC.CreateCompatibleDC(&dc);
00220     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00221     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00222
00223     // KStowell - Repaint the background.
00224     memDC.FillSolidRect(rcClient, ::GetSysColor(COLOR_WINDOW));
00225
00226     // let the control do its default drawing.
00227     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00228
00229     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00230     dc.BitBlt( rcClip.left, rcClip.top, rcClip.Width(), rcClip.Height(), &memDC,
00231         rcClip.left, rcClip.top, SRCCOPY );
00232
00233     // KStowell - Cleanup resources.
00234     memDC.SelectObject(pOldBitmap);
00235     memDC.DeleteDC();
00236     bitmap.DeleteObject();
00237 }

void CCJFontCombo::PreSubclassWindow ( ) [protected, virtual]

Definition at line 192 of file CJFontCombo.cpp.

References InitializeFonts.

00193 {
00194     CComboBox::PreSubclassWindow();
00195     InitializeFonts();
00196 }

_CJXLIB_INLINE void CCJFontCombo::SetHilightColors | ( | COLORREF | clrHilight,
 |  | COLORREF | clrHilightText
 | ) | [virtual]

Definition at line 109 of file CJFontCombo.h.

References m_clrHilight, and m_clrHilightText.

00110     { m_clrHilight = clrHilight; m_clrHilightText = clrHilightText; };

_CJXLIB_INLINE void CCJFontCombo::SetNormalColors | ( | COLORREF | clrBkgnd,
 |  | COLORREF | clrNormalText
 | ) | [virtual]

Definition at line 112 of file CJFontCombo.h.

References m_clrBkgnd, and m_clrNormalText.

00113     { m_clrNormalText = clrNormalText; m_clrBkgnd = clrBkgnd; };

Member Data Documentation

COLORREF CCJFontCombo::m_clrBkgnd [protected]

Definition at line 65 of file CJFontCombo.h.

Referenced by CCJFontCombo, DrawItem, and SetNormalColors.

COLORREF CCJFontCombo::m_clrHilight [protected]

Definition at line 62 of file CJFontCombo.h.

Referenced by CCJFontCombo, DrawItem, and SetHilightColors.

COLORREF CCJFontCombo::m_clrHilightText [protected]

Definition at line 64 of file CJFontCombo.h.

Referenced by CCJFontCombo, DrawItem, and SetHilightColors.

COLORREF CCJFontCombo::m_clrNormalText [protected]

Definition at line 63 of file CJFontCombo.h.

Referenced by CCJFontCombo, DrawItem, and SetNormalColors.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJFontCombo.h
  • WinCvs/CJLib/CJLibrary/CJFontCombo.cpp
Generated on Sun Feb 24 01:24:40 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJFrameWnd Class Reference

#include <CJFrameWnd.h>

Inheritance diagram for CCJFrameWnd:

[legend]
Collaboration diagram for CCJFrameWnd:

[legend]
List of all members.

Public Methods

CCJFrameWnd ()
virtual | ~CCJFrameWnd ()
virtual void | LoadBarState (LPCTSTR lpszProfileName)
virtual void | SaveBarState (LPCTSTR lpszProfileName) const
virtual BOOL | InitializeMenu (UINT nMenuID, UINT *nToolbarIDs=NULL, int nSize=0)
virtual BOOL | InitializeMenu (UINT nMenuID, UINT nToolbarID=NULL)
virtual void | RecalcAllExcept (CCJSizeDockBar *pBar)
virtual void | EnableDocking (DWORD dwDockStyle)
virtual void | EnableDockingSizeBar (DWORD dwDockStyle, DockFlatBorders FlatFlags=brdrAllRaised)
virtual void | DockSizeBar (CControlBar *pBar, CCJSizeDockBar *pDockBar=NULL, LPRECT lpRect=NULL)
virtual void | DockControlBarLeftOf (CControlBar *Bar, CControlBar *LeftOf)
virtual void | RecalcLayout (BOOL bNotify=TRUE)
virtual BOOL | PreTranslateMessage (MSG *pMsg)

Protected Types

enum DockFlatBorders {
brdrAllRaised = 0x0000,
brdrFlatTop = 0x0001,
brdrFlatBottom = 0x0002,
brdrFlatLeft = 0x0004,
brdrFlatRight = 0x0008,
brdrFlatVertical = 0x0003,
brdrFlatHorizontal = 0x000C,
brdrFlatAll = 0x000F
}

Protected Methods

virtual HMENU | NewMenu (UINT nMenuID, UINT *nToolbarIDs=NULL, int nSize=0)
virtual HMENU | NewMenu (UINT nMenuID, UINT nToolbarID=NULL)
virtual BOOL | PreCreateWindow (CREATESTRUCT &cs)
virtual BOOL | PreCreateWindow (CREATESTRUCT &cs, UINT nIconID)
afx_msg void | OnMeasureItem (int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)
afx_msg LRESULT | OnMenuChar (UINT nChar, UINT nFlags, CMenu *pMenu)
afx_msg void | OnInitMenuPopup (CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu)
afx_msg void | OnClose ()

Protected Attributes

CCJMenu m_menu
CCJMenuBar m_wndMenuBar

Static Protected Attributes

DWORD | dwDockBarMap [4][2]

Member Enumeration Documentation

enum CCJFrameWnd::DockFlatBorders [protected]

Enumeration values:
brdrAllRaised
brdrFlatTop
brdrFlatBottom
brdrFlatLeft
brdrFlatRight
brdrFlatVertical
brdrFlatHorizontal
brdrFlatAll

Definition at line 154 of file CJFrameWnd.h.

00154                          {
00155         brdrAllRaised       = 0x0000,
00156         brdrFlatTop         = 0x0001,
00157         brdrFlatBottom      = 0x0002,
00158         brdrFlatLeft        = 0x0004,
00159         brdrFlatRight       = 0x0008,
00160         brdrFlatVertical    = 0x0003,
00161         brdrFlatHorizontal  = 0x000C,
00162         brdrFlatAll         = 0x000F
00163     };

Constructor & Destructor Documentation

CCJFrameWnd::CCJFrameWnd ( )

Definition at line 133 of file CJFrameWnd.cpp.

00134 {
00135
00136 }

CCJFrameWnd::~CCJFrameWnd ( ) [virtual]

Definition at line 138 of file CJFrameWnd.cpp.

00139 {
00140 }

Member Function Documentation

void CCJFrameWnd::DockControlBarLeftOf | ( | CControlBar * | Bar,
 |  | CControlBar * | LeftOf
 | ) | [virtual]

Definition at line 165 of file CJFrameWnd.cpp.

References RecalcLayout, and TRUE.

00166 {
00167     CRect rect;
00168     DWORD dw;
00169     UINT n;
00170
00171     // get MFC to adjust the dimensions of all docked ToolBars
00172     // so that GetWindowRect will be accurate
00173     RecalcLayout(TRUE);
00174
00175     LeftOf->GetWindowRect(&rect);
00176     rect.OffsetRect(1,0);
00177     dw=LeftOf->GetBarStyle();
00178     n = 0;
00179     n = (dw&CBRS_ALIGN_TOP)              ? AFX_IDW_DOCKBAR_TOP      : n;
00180     n = (dw&CBRS_ALIGN_BOTTOM   && n==0) ? AFX_IDW_DOCKBAR_BOTTOM   : n;
00181     n = (dw&CBRS_ALIGN_LEFT     && n==0) ? AFX_IDW_DOCKBAR_LEFT     : n;
00182     n = (dw&CBRS_ALIGN_RIGHT    && n==0) ? AFX_IDW_DOCKBAR_RIGHT    : n;
00183
00184     // When we take the default parameters on rect, DockControlBar will dock
00185     // each Toolbar on a seperate line. By calculating a rectangle, we in effect
00186     // are simulating a Toolbar being dragged to that location and docked.
00187     DockControlBar(Bar,n,&rect);
00188 }

void CCJFrameWnd::DockSizeBar | ( | CControlBar * | pBar,
 |  | CCJSizeDockBar * | pDockBar = NULL,
 |  | LPRECT | lpRect = NULL
 | ) | [virtual]

Definition at line 270 of file CJFrameWnd.cpp.

References ASSERT, dwSizeBarMap, NULL, and CCJSizeDockBar::SetActualSize.

00271 {
00272     ASSERT(pBar != NULL);
00273     ASSERT(pBar->m_pDockContext != NULL);
00274
00275     if( pDockBar == NULL )
00276     {
00277         for (int i = 0; i < 4; i++)
00278         {
00279             if ((dwSizeBarMap[i][1] & CBRS_ALIGN_ANY) == (pBar->m_dwStyle & CBRS_ALIGN_ANY))
00280             {
00281                 pDockBar = (CCJSizeDockBar*)GetControlBar(dwSizeBarMap[i][0]);
00282                 ASSERT(pDockBar != NULL);
00283
00284                 int nSize = 0;
00285
00286                 switch(i)
00287                 {
00288                 case 0: // horizontal dock
00289                 case 1:
00290                     nSize = ((CCJControlBar*)pBar)->GetHorzSize();
00291                     break;
00292                 case 2: // vertical dock
00293                 case 3:
00294                     nSize = ((CCJControlBar*)pBar)->GetVertSize();
00295                     break;
00296                 }
00297
00298                 pDockBar->SetActualSize( nSize );
00299                 break;
00300             }
00301         }
00302     }
00303
00304     ASSERT(pDockBar != NULL);
00305     ASSERT(m_listControlBars.Find(pBar) != NULL);
00306     ASSERT(pBar->m_pDockSite == this);
00307     ((CCJControlBar*)pBar)->Normalize();
00308     pDockBar->DockControlBar(pBar, lpRect);
00309 }

void CCJFrameWnd::EnableDocking ( DWORD dwDockStyle ) [virtual]

Definition at line 190 of file CJFrameWnd.cpp.

References ASSERT, and dwDockBarMap.

00191 {
00192     // must be CBRS_ALIGN_XXX or CBRS_FLOAT_MULTI only
00193     ASSERT((dwDockStyle & ~(CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI)) == 0);
00194     CFrameWnd::EnableDocking(dwDockStyle);
00195
00196     for (int i = 0; i < 4; i++) {
00197         if (dwDockBarMap[i][1] & dwDockStyle & CBRS_ALIGN_ANY) {
00198             CDockBar* pDock = (CDockBar*)GetControlBar(dwDockBarMap[i][0]);
00199
00200             // make sure the dock bar is of correct type
00201             if( pDock || !pDock->IsKindOf(RUNTIME_CLASS(CCJDockBar)) ) {
00202                 BOOL bNeedDelete = ! pDock->m_bAutoDelete;
00203                 pDock->m_pDockSite->RemoveControlBar(pDock);
00204                 pDock->m_pDockSite = 0; // avoid problems in destroying the dockbar
00205                 pDock->DestroyWindow();
00206                 if( bNeedDelete )
00207                     delete pDock;
00208                 pDock = 0;
00209             }
00210
00211             if( pDock == 0 ) {
00212                 pDock = new CCJDockBar;
00213                 if (!pDock->Create(this,
00214                     WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_CHILD|WS_VISIBLE |
00215                     dwDockBarMap[i][1], dwDockBarMap[i][0])) {
00216                     AfxThrowResourceException();
00217                 }
00218             }
00219         }
00220     }
00221 }

void CCJFrameWnd::EnableDockingSizeBar | ( | DWORD | dwDockStyle,
 |  | DockFlatBorders | FlatFlags = brdrAllRaised
 | ) | [virtual]

Definition at line 230 of file CJFrameWnd.cpp.

References ASSERT, dwSizeBarMap, CCJSizeDockBar::FlatBorder, and NULL.

00231 {
00232     // must be CBRS_ALIGN_XXX or CBRS_FLOAT_MULTI only
00233     ASSERT((dwDockStyle & ~(CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI)) == 0);
00234
00235     m_pFloatingFrameClass = RUNTIME_CLASS(CCJMiniDockFrameWnd);
00236     for (int i = 0; i < 4; i++)
00237     {
00238         if (dwSizeBarMap[i][1] & dwDockStyle & CBRS_ALIGN_ANY)
00239         {
00240             CCJSizeDockBar* pDock = (CCJSizeDockBar*)GetControlBar(dwSizeBarMap[i][0]);
00241             if (pDock == NULL)
00242             {
00243                 pDock = new CCJSizeDockBar;
00244
00245                 if (!pDock->Create(this,
00246                     WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_CHILD|WS_VISIBLE |
00247                         dwSizeBarMap[i][1], dwSizeBarMap[i][0]))
00248                 {
00249                     AfxThrowResourceException();
00250                 }
00251                 //Yiannhs enable Flat Borders For dock Bars
00252                 pDock->FlatBorder( (FlatFlags >> i) & 0x0001 );
00253             }
00254         }
00255     }
00256 }

BOOL CCJFrameWnd::InitializeMenu | ( | UINT | nMenuID,
 |  | UINT | nToolbarID = NULL
 | ) | [virtual]

Definition at line 335 of file CJFrameWnd.cpp.

References ASSERT, NewMenu, and TRUE.

00336 {
00337     ASSERT(nMenuID);     // must be valid.
00338
00339     // Get a pointer to the existing menu, and destroy it.
00340     CMenu* pMenu = GetMenu();
00341     ASSERT_VALID(pMenu);
00342     pMenu->DestroyMenu();
00343
00344     // Set the default menu with the newly created Menu.
00345     m_hMenuDefault = NewMenu(nMenuID, nToolBarID);
00346     SetMenu(CMenu::FromHandle(m_hMenuDefault));
00347
00348     return TRUE;
00349 }

BOOL CCJFrameWnd::InitializeMenu | ( | UINT | nMenuID,
 |  | UINT * | nToolbarIDs = NULL,
 |  | int | nSize = 0
 | ) | [virtual]

Definition at line 351 of file CJFrameWnd.cpp.

References ASSERT, NewMenu, and TRUE.

00352 {
00353     ASSERT(nMenuID);     // must be valid.
00354
00355     // Get a pointer to the existing menu, and destroy it.
00356     CMenu* pMenu = GetMenu();
00357     ASSERT_VALID(pMenu);
00358     pMenu->DestroyMenu();
00359
00360     // Set the default menu with the newly created Menu.
00361     m_hMenuDefault = NewMenu(nMenuID, nToolbarIDs, nSize);
00362     SetMenu(CMenu::FromHandle(m_hMenuDefault));
00363
00364     return TRUE;
00365 }

void CCJFrameWnd::LoadBarState ( LPCTSTR lpszProfileName ) [virtual]

Definition at line 416 of file CJFrameWnd.cpp.

References CCJSizeDockBar::m_bIsDockBar.

00417 {
00418     CCJSizeDockBar::m_bIsDockBar = true;
00419     CFrameWnd::LoadBarState(lpszProfileName);
00420     CCJSizeDockBar::m_bIsDockBar = false;
00421 }

HMENU CCJFrameWnd::NewMenu | ( | UINT | nMenuID,
 |  | UINT | nToolbarID = NULL
 | ) | [protected, virtual]

Definition at line 311 of file CJFrameWnd.cpp.

References CCJMenu::LoadMenu, CCJMenu::LoadToolbar, and m_menu.

00312 {
00313     // Load the menu and toolbar resource.
00314     m_menu.LoadMenu(nMenuID);
00315     if (nToolbarID) {
00316         m_menu.LoadToolbar(nToolbarID);
00317     }
00318
00319     // Detach the menu.
00320     return(m_menu.Detach());
00321 }

HMENU CCJFrameWnd::NewMenu | ( | UINT | nMenuID,
 |  | UINT * | nToolbarIDs = NULL,
 |  | int | nSize = 0
 | ) | [protected, virtual]

Definition at line 323 of file CJFrameWnd.cpp.

References CCJMenu::LoadMenu, CCJMenu::LoadToolbars, and m_menu.

Referenced by InitializeMenu.

00324 {
00325     // Load the menu and toolbar resources.
00326     m_menu.LoadMenu(nMenuID);
00327     if (nToolbarIDs) {
00328         m_menu.LoadToolbars(nToolbarIDs, nSize);
00329     }
00330
00331     // Detach the menu.
00332     return(m_menu.Detach());
00333 }

void CCJFrameWnd::OnClose ( ) [protected]

Definition at line 430 of file CJFrameWnd.cpp.

References NULL.

00431 {
00432     // Clear active view before close
00433     SetActiveView (NULL);
00434     CFrameWnd::OnClose();
00435 }

void CCJFrameWnd::OnInitMenuPopup | ( | CMenu * | pPopupMenu,
 |  | UINT | nIndex,
 |  | BOOL | bSysMenu
 | ) | [protected]

Definition at line 393 of file CJFrameWnd.cpp.

References CCJMenu::IsMenu, m_menu, and CCJMenu::UpdateMenu.

00394 {
00395     CFrameWnd::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
00396
00397     if(!bSysMenu)
00398     {
00399         if(m_menu.IsMenu(pPopupMenu)) {
00400             CCJMenu::UpdateMenu(pPopupMenu);
00401         }
00402     }
00403 }

void CCJFrameWnd::OnMeasureItem | ( | int | nIDCtl,
 |  | LPMEASUREITEMSTRUCT | lpMeasureItemStruct
 | ) | [protected]

Definition at line 367 of file CJFrameWnd.cpp.

References CCJMenu::IsMenu, m_menu, and CCJMenu::MeasureItem.

00368 {
00369     if (lpMeasureItemStruct->CtlType == ODT_MENU)
00370     {
00371         if (IsMenu((HMENU)lpMeasureItemStruct->itemID)) {
00372             CMenu* pMenu = CMenu::FromHandle((HMENU)lpMeasureItemStruct->itemID);
00373
00374             if(m_menu.IsMenu(pMenu)) {
00375                 m_menu.MeasureItem(lpMeasureItemStruct);
00376                 return;
00377             }
00378         }
00379     }
00380
00381     CFrameWnd::OnMeasureItem(nIDCtl, lpMeasureItemStruct);
00382 }

LRESULT CCJFrameWnd::OnMenuChar | ( | UINT | nChar,
 |  | UINT | nFlags,
 |  | CMenu * | pMenu
 | ) | [protected]

Definition at line 384 of file CJFrameWnd.cpp.

References CCJMenu::FindKeyboardShortcut, CCJMenu::IsMenu, and m_menu.

00385 {
00386     if(m_menu.IsMenu(pMenu)) {
00387         return CCJMenu::FindKeyboardShortcut(nChar, nFlags, pMenu);
00388     }
00389
00390     return CFrameWnd::OnMenuChar(nChar, nFlags, pMenu);
00391 }

BOOL CCJFrameWnd::PreCreateWindow | ( | CREATESTRUCT & | cs,
 |  | UINT | nIconID
 | ) | [protected, virtual]

Definition at line 448 of file CJFrameWnd.cpp.

References ASSERT, and NULL.

00449 {
00450     // Register wnd class with no redraw, cursor (use default), background
00451     // brush and load your apps icon resource.
00452     cs.lpszClass = AfxRegisterWndClass( 0, NULL, NULL,
00453         AfxGetApp()->LoadIcon(nIconID));
00454     ASSERT(cs.lpszClass);
00455
00456     return CFrameWnd::PreCreateWindow(cs);
00457 }

BOOL CCJFrameWnd::PreCreateWindow ( CREATESTRUCT & cs ) [protected, virtual]

Definition at line 438 of file CJFrameWnd.cpp.

00439 {
00440     return CFrameWnd::PreCreateWindow(cs);
00441 }

BOOL CCJFrameWnd::PreTranslateMessage ( MSG * pMsg ) [virtual]

Definition at line 405 of file CJFrameWnd.cpp.

References m_wndMenuBar, CCJMenuBar::TranslateFrameMessage, and TRUE.

00406 {
00407     if( m_wndMenuBar.GetSafeHwnd()) {
00408         if( m_wndMenuBar.TranslateFrameMessage(pMsg)) {
00409             return TRUE;
00410         }
00411     }
00412
00413     return CFrameWnd::PreTranslateMessage(pMsg);
00414 }

void CCJFrameWnd::RecalcAllExcept ( CCJSizeDockBar * pBar ) [virtual]

Definition at line 258 of file CJFrameWnd.cpp.

References CCJSizeDockBar::CalcSizeBarLayout, dwSizeBarMap, and NULL.

Referenced by RecalcLayout.

00259 {
00260     for (int i = 0; i < 4; i++)
00261     {
00262         CCJSizeDockBar* pDock = (CCJSizeDockBar*)GetControlBar(dwSizeBarMap[i][0]);
00263         if (pDock != NULL && pDock != pBar)
00264         {
00265             pDock->CalcSizeBarLayout();
00266         }
00267     }
00268 }

void CCJFrameWnd::RecalcLayout ( BOOL bNotify = TRUE ) [virtual]

Definition at line 223 of file CJFrameWnd.cpp.

References NULL, and RecalcAllExcept.

Referenced by DockControlBarLeftOf.

00224 {
00225     CFrameWnd::RecalcLayout(bNotify);
00226     RecalcAllExcept(NULL);
00227 }

void CCJFrameWnd::SaveBarState ( LPCTSTR lpszProfileName ) const [virtual]

Definition at line 423 of file CJFrameWnd.cpp.

References CCJSizeDockBar::m_bIsDockBar.

00424 {
00425     CCJSizeDockBar::m_bIsDockBar = true;
00426     CFrameWnd::SaveBarState(lpszProfileName);
00427     CCJSizeDockBar::m_bIsDockBar = false;
00428 }

Member Data Documentation

DWORD CCJFrameWnd::dwDockBarMap [static, protected]

Initial value:

{
    { AFX_IDW_DOCKBAR_TOP,      CBRS_TOP    },
    { AFX_IDW_DOCKBAR_BOTTOM,   CBRS_BOTTOM },
    { AFX_IDW_DOCKBAR_LEFT,     CBRS_LEFT   },
    { AFX_IDW_DOCKBAR_RIGHT,    CBRS_RIGHT  },
}

Definition at line 157 of file CJFrameWnd.cpp.

Referenced by EnableDocking.

CCJMenu CCJFrameWnd::m_menu [protected]

Definition at line 150 of file CJFrameWnd.h.

Referenced by NewMenu, OnInitMenuPopup, OnMeasureItem, and OnMenuChar.

CCJMenuBar CCJFrameWnd::m_wndMenuBar [protected]

Definition at line 151 of file CJFrameWnd.h.

Referenced by PreTranslateMessage.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJFrameWnd.h
  • WinCvs/CJLib/CJLibrary/CJFrameWnd.cpp
Generated on Sun Feb 24 01:24:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJHexEdit Class Reference

#include <CJHexEdit.h>

Inheritance diagram for CCJHexEdit:

[legend]
Collaboration diagram for CCJHexEdit:

[legend]
List of all members.

Public Types

enum EDITMODE {
EDIT_NONE,
EDIT_ASCII,
EDIT_HIGH,
EDIT_LOW
}

Public Methods

CCJHexEdit ()
virtual int | GetData (LPBYTE p, int len)
virtual void | SetData (LPBYTE p, int len)
virtual CSize | GetSel (void)
virtual void | SetSel (int s, int e)
virtual void | SetBPR (int bpr)
virtual void | SetOptions (BOOL a, BOOL h, BOOL c, BOOL w)
virtual BOOL | Create (LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID, CCreateContext *pContext=NULL)
virtual | ~CCJHexEdit ()

Public Attributes

LPBYTE | m_pData
int | m_length
int | m_topindex
int | m_currentAddress
EDITMODE m_currentMode
int | m_selStart
int | m_selEnd
int | m_bpr
int | m_lpp
BOOL | m_bShowAddress
BOOL | m_bShowAscii
BOOL | m_bShowHex
BOOL | m_bAddressIsWide
BOOL | m_bNoAddressChange
BOOL | m_bHalfPage
CFont | m_Font
int | m_lineHeight
int | m_nullWidth
BOOL | m_bUpdate
int | m_offHex
int | m_offAscii
int | m_offAddress
CPoint | m_editPos

Protected Methods

virtual void | ScrollIntoView (int p)
virtual void | RepositionCaret (int p)
virtual void | Move (int x, int y)
virtual BOOL | IsSelected (void)
virtual void | UpdateScrollbars (void)
virtual void | CreateEditCaret (void)
virtual void | CreateAddressCaret (void)
virtual CPoint | CalcPos (int x, int y)
virtual void | SelInsert (int s, int l)
virtual void | SelDelete (int s, int e)
virtual void | NormalizeSel (void)
virtual BOOL | PreCreateWindow (CREATESTRUCT &cs)
afx_msg void | OnChar (UINT nChar, UINT nRepCnt, UINT nFlags)
afx_msg void | OnKillFocus (CWnd *pNewWnd)
afx_msg void | OnPaint ()
afx_msg void | OnSetFocus (CWnd *pOldWnd)
afx_msg void | OnVScroll (UINT nSBCode, UINT nPos, CScrollBar *pScrollBar)
afx_msg UINT | OnGetDlgCode ()
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)
afx_msg void | OnLButtonDown (UINT nFlags, CPoint point)
afx_msg void | OnMouseMove (UINT nFlags, CPoint point)
afx_msg void | OnLButtonUp (UINT nFlags, CPoint point)
afx_msg void | OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags)
afx_msg void | OnEditClear ()
afx_msg void | OnEditCopy ()
afx_msg void | OnEditCut ()
afx_msg void | OnEditPaste ()
afx_msg void | OnEditSelectAll ()
afx_msg void | OnEditUndo ()
afx_msg void | OnContextMenu (CWnd *, CPoint point)
afx_msg void | OnHScroll (UINT nSBCode, UINT nPos, CScrollBar *pScrollBar)
afx_msg void | OnLButtonDblClk (UINT nFlags, CPoint point)

Member Enumeration Documentation

enum CCJHexEdit::EDITMODE

Enumeration values:
EDIT_NONE
EDIT_ASCII
EDIT_HIGH
EDIT_LOW

Definition at line 44 of file CJHexEdit.h.

00044 { EDIT_NONE, EDIT_ASCII, EDIT_HIGH, EDIT_LOW } ;

Constructor & Destructor Documentation

CCJHexEdit::CCJHexEdit ( )

Definition at line 47 of file CJHexEdit.cpp.

References EDIT_NONE, FALSE, m_bAddressIsWide, m_bHalfPage, m_bNoAddressChange, m_bpr, m_bShowAddress, m_bShowAscii, m_bShowHex, m_bUpdate, m_currentAddress, m_currentMode, m_editPos, m_Font, m_length, m_lpp, m_offAddress, m_offAscii, m_offHex, m_pData, m_selEnd, m_selStart, m_topindex, NULL, and TRUE.

00048 {
00049     m_pData         = NULL;     // pointer to data
00050     m_length        = 0;        // length of data
00051     m_length        = 0x40;
00052     m_topindex      = 0;
00053     m_bpr           = 8;        // byte per row
00054     m_lpp           = 1;
00055
00056     m_bShowHex      = TRUE;
00057     m_bShowAscii    = TRUE;
00058     m_bShowAddress  = TRUE;
00059     m_bAddressIsWide= TRUE;     // 4/8 byte address
00060
00061     m_offAddress    = 0;
00062     m_offHex        = 0;
00063     m_offAscii      = 0;
00064
00065     m_bUpdate = TRUE;           // update font info
00066     m_bNoAddressChange = FALSE;
00067     m_currentMode = EDIT_NONE;
00068
00069     m_editPos.x = m_editPos.y = 0;
00070     m_currentAddress = 0;
00071     m_bHalfPage = TRUE;
00072
00073     m_selStart  = 0xffffffff;
00074     m_selEnd    = 0xffffffff;
00075
00076     m_Font.CreateFont(-12, 0,0,0,0,0,0,0,0,0,0,0,0, _T("Courier New"));
00077
00078     AfxOleInit();
00079 }

CCJHexEdit::~CCJHexEdit ( ) [virtual]

Definition at line 81 of file CJHexEdit.cpp.

References m_Font.

00082 {
00083     m_Font.DeleteObject();
00084 }

Member Function Documentation

CPoint CCJHexEdit::CalcPos | ( | int | x,
 |  | int | y
 | ) | [protected, virtual]

Definition at line 538 of file CJHexEdit.cpp.

References EDIT_ASCII, EDIT_HIGH, EDIT_LOW, EDIT_NONE, m_bAddressIsWide, m_bpr, m_bShowAddress, m_bShowAscii, m_bShowHex, m_currentAddress, m_currentMode, m_length, m_lineHeight, m_lpp, m_nullWidth, m_offAscii, m_offHex, and m_topindex.

Referenced by OnLButtonDown, and OnMouseMove.

00539 {
00540     y /= m_lineHeight;
00541     if(y < 0 || y > m_lpp)
00542         return CPoint(-1, -1);
00543
00544     if(y * m_bpr > m_length)
00545         return CPoint(-1, -1);
00546
00547     x += m_nullWidth;
00548     x /= m_nullWidth;
00549
00550     int xp;
00551
00552     if(m_bShowAddress && x <= (m_bAddressIsWide ? 8 : 4))
00553     {
00554         m_currentAddress = m_topindex + (m_bpr * y);
00555         m_currentMode = EDIT_NONE;
00556         return CPoint(0, y);
00557     }
00558
00559     xp = (m_offHex  / m_nullWidth) + m_bpr * 3;
00560     if(m_bShowHex && x < xp)
00561     {
00562         if(x%3)
00563             x--;
00564         m_currentAddress = m_topindex + (m_bpr * y) + (x - (m_offHex  / m_nullWidth)) / 3;
00565         m_currentMode =  ((x%3) & 0x01) ? EDIT_LOW : EDIT_HIGH;
00566         return CPoint(x, y);
00567     }
00568
00569     xp = (m_offAscii  / m_nullWidth) + m_bpr;
00570     if(m_bShowAscii && x < xp)
00571     {
00572         m_currentAddress = m_topindex + (m_bpr * y) + (x - (m_offAscii  / m_nullWidth));
00573         m_currentMode = EDIT_ASCII;
00574         return CPoint(x, y);
00575     }
00576
00577     return CPoint(-1,-1);
00578 }

BOOL CCJHexEdit::Create | ( | LPCTSTR | lpszClassName,
 |  | LPCTSTR | lpszWindowName,
 |  | DWORD | dwStyle,
 |  | const RECT & | rect,
 |  | CWnd * | pParentWnd,
 |  | UINT | nID,
 |  | CCreateContext * | pContext = NULL
 | ) | [virtual]

Definition at line 466 of file CJHexEdit.cpp.

References FALSE, m_Font, and TRUE.

00467 {
00468     if(!CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext)) {
00469         return FALSE;
00470     }
00471
00472     SetFont(&m_Font);
00473     return TRUE;
00474 }

void CCJHexEdit::CreateAddressCaret ( void ) [protected, virtual]

Definition at line 580 of file CJHexEdit.cpp.

References m_bAddressIsWide, m_lineHeight, and m_nullWidth.

Referenced by OnLButtonDown, OnSetFocus, RepositionCaret, and SetSel.

00581 {
00582     DestroyCaret();
00583     CreateSolidCaret(m_nullWidth * (m_bAddressIsWide ? 8 : 4), m_lineHeight);
00584 }

void CCJHexEdit::CreateEditCaret ( void ) [protected, virtual]

Definition at line 586 of file CJHexEdit.cpp.

References m_lineHeight, and m_nullWidth.

Referenced by OnLButtonDown, OnSetFocus, RepositionCaret, and SetSel.

00587 {
00588     DestroyCaret();
00589     CreateSolidCaret(m_nullWidth, m_lineHeight);
00590 }

_CJXLIB_INLINE int CCJHexEdit::GetData | ( | LPBYTE | p,
 |  | int | len
 | ) | [virtual]

Definition at line 153 of file CJHexEdit.h.

References m_length, and m_pData.

00154     { memcpy(p, m_pData, min(len, m_length)); return m_length; }

_CJXLIB_INLINE CSize CCJHexEdit::GetSel ( void ) [virtual]

Definition at line 150 of file CJHexEdit.h.

References m_selEnd, and m_selStart.

00151     { return CSize(m_selStart, m_selEnd); }

_CJXLIB_INLINE BOOL CCJHexEdit::IsSelected ( void ) [protected, virtual]

Definition at line 147 of file CJHexEdit.h.

References m_selStart.

Referenced by OnChar, OnContextMenu, OnKeyDown, OnLButtonDown, OnLButtonUp, OnMouseMove, and OnSetFocus.

00148     { return m_selStart != 0xffffffff; }

void CCJHexEdit::Move | ( | int | x,
 |  | int | y
 | ) | [protected, virtual]

Definition at line 976 of file CJHexEdit.cpp.

References EDIT_ASCII, EDIT_HIGH, EDIT_LOW, EDIT_NONE, FALSE, m_bNoAddressChange, m_bpr, m_currentAddress, m_currentMode, m_length, m_lpp, m_topindex, NULL, OnVScroll, RepositionCaret, and TRUE.

Referenced by OnChar, and OnKeyDown.

00977 {
00978     switch(m_currentMode)
00979     {
00980         case EDIT_NONE:
00981             return;
00982         case EDIT_HIGH:
00983             if(x != 0)
00984                 m_currentMode = EDIT_LOW;
00985             if(x == -1)
00986                 m_currentAddress --;
00987             m_currentAddress += y* m_bpr;
00988             break;
00989         case EDIT_LOW:
00990             if(x != 0)
00991                 m_currentMode = EDIT_HIGH;
00992             if(x == 1)
00993                 m_currentAddress++;
00994             m_currentAddress += y* m_bpr;
00995             break;
00996         case EDIT_ASCII:
00997             {
00998                 m_currentAddress += x;
00999                 m_currentAddress += y*m_bpr;
01000             }
01001             break;
01002     }
01003     if(m_currentAddress < 0)
01004         m_currentAddress = 0;
01005
01006     if(m_currentAddress >= m_length)
01007     {
01008         m_currentAddress -= x;
01009         m_currentAddress -= y*m_bpr;
01010     }
01011     m_bNoAddressChange = TRUE;
01012     if(m_currentAddress < m_topindex)
01013     {
01014         OnVScroll(SB_LINEUP, 0, NULL);
01015     }
01016     if(m_currentAddress >= m_topindex + m_lpp*m_bpr)
01017     {
01018         OnVScroll(SB_LINEDOWN, 0, NULL);
01019     }
01020     m_bNoAddressChange = FALSE;
01021     //ScrollIntoView(m_currentAddress);
01022     RepositionCaret(m_currentAddress);
01023 }

void CCJHexEdit::NormalizeSel ( void ) [protected, virtual]

Definition at line 1269 of file CJHexEdit.cpp.

References m_selEnd, and m_selStart.

Referenced by OnEditPaste.

01270 {
01271     if(m_selStart > m_selEnd)
01272         m_selStart ^= m_selEnd ^= m_selStart ^= m_selEnd;
01273 }

void CCJHexEdit::OnChar | ( | UINT | nChar,
 |  | UINT | nRepCnt,
 |  | UINT | nFlags
 | ) | [protected]

Definition at line 671 of file CJHexEdit.cpp.

References EDIT_ASCII, EDIT_HIGH, EDIT_LOW, EDIT_NONE, IsSelected, m_currentAddress, m_currentMode, m_pData, Move, OnEditCopy, OnEditCut, OnEditPaste, OnEditUndo, RepositionCaret, SelDelete, and SetSel.

00672 {
00673     nFlags;nRepCnt;
00674     if(!m_pData)
00675         return;
00676     if(nChar == '\t')
00677         return;
00678     if(GetKeyState(VK_CONTROL) & 0x80000000)
00679     {
00680         switch(nChar)
00681         {
00682             case 0x03:
00683                 if(IsSelected())
00684                     OnEditCopy();
00685                 return;
00686             case 0x16:
00687                 OnEditPaste();
00688                 return;
00689             case 0x18:
00690                 if(IsSelected())
00691                     OnEditCut();
00692                 return;
00693             case 0x1a:
00694                 OnEditUndo();
00695                 return;
00696         }
00697     }
00698
00699     if(nChar == 0x08)
00700     {
00701         if(m_currentAddress > 0)
00702         {
00703             m_currentAddress--;
00704             SelDelete(m_currentAddress, m_currentAddress+1);
00705             RepositionCaret(m_currentAddress);
00706             RedrawWindow();
00707         }
00708         return;
00709     }
00710
00711     SetSel(-1, -1);
00712     switch(m_currentMode)
00713     {
00714         case EDIT_NONE:
00715             return;
00716         case EDIT_HIGH:
00717         case EDIT_LOW:
00718             if((nChar >= '0' && nChar <= '9') || (nChar >= 'a' && nChar <= 'f'))
00719             {
00720                 UINT b = nChar - '0';
00721                 if(b > 9)
00722                     b = 10 + nChar - 'a';
00723
00724                 if(m_currentMode == EDIT_HIGH)
00725                 {
00726                     m_pData[m_currentAddress] = (unsigned char)((m_pData[m_currentAddress] & 0x0f) | (b << 4));
00727                 }
00728                 else
00729                 {
00730                     m_pData[m_currentAddress] = (unsigned char)((m_pData[m_currentAddress] & 0xf0) | b);
00731                 }
00732                 Move(1,0);
00733             }
00734             break;
00735         case EDIT_ASCII:
00736             m_pData[m_currentAddress] = (unsigned char)nChar;
00737             Move(1,0);
00738             break;
00739     }
00740     RedrawWindow();
00741 }

void CCJHexEdit::OnContextMenu | ( | CWnd * | ,
 |  | CPoint | point
 | ) | [protected]

Definition at line 1094 of file CJHexEdit.cpp.

References ASSERT, IDR_POPUP_HEX_EDIT, IsSelected, NULL, and VERIFY.

01095 {
01096     if (point.x == -1 && point.y == -1)
01097     {
01098         //keystroke invocation
01099         CRect rect;
01100         GetClientRect(rect);
01101         ClientToScreen(rect);
01102
01103         point = rect.TopLeft();
01104         point.Offset(5, 5);
01105     }
01106
01107     CMenu menu;
01108     VERIFY(menu.LoadMenu(IDR_POPUP_HEX_EDIT));
01109
01110     CMenu* pPopup = menu.GetSubMenu(0);
01111     ASSERT(pPopup != NULL);
01112
01113     pPopup->EnableMenuItem(ID_EDIT_UNDO, MF_GRAYED|MF_DISABLED|MF_BYCOMMAND);
01114     if(!IsSelected())
01115     {
01116         pPopup->EnableMenuItem(ID_EDIT_CLEAR, MF_GRAYED|MF_DISABLED|MF_BYCOMMAND);
01117         pPopup->EnableMenuItem(ID_EDIT_CUT, MF_GRAYED|MF_DISABLED|MF_BYCOMMAND);
01118         pPopup->EnableMenuItem(ID_EDIT_COPY, MF_GRAYED|MF_DISABLED|MF_BYCOMMAND);
01119     }
01120     {
01121         COleDataObject  obj;
01122         if (obj.AttachClipboard())
01123         {
01124             if(
01125                 !obj.IsDataAvailable(CF_TEXT) && !obj.IsDataAvailable((CLIPFORMAT)RegisterClipboardFormat( _T("BinaryData"))))
01126                 pPopup->EnableMenuItem(ID_EDIT_PASTE, MF_GRAYED|MF_DISABLED|MF_BYCOMMAND);
01127         }
01128     }
01129
01130     pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y,
01131         this);
01132 }

void CCJHexEdit::OnEditClear ( ) [protected]

Definition at line 1134 of file CJHexEdit.cpp.

References m_currentAddress, m_selEnd, m_selStart, RepositionCaret, and SelDelete.

Referenced by OnKeyDown.

01135 {
01136     m_currentAddress = m_selStart;
01137     SelDelete(m_selStart, m_selEnd);
01138     RepositionCaret(m_currentAddress);
01139     RedrawWindow();
01140 }

void CCJHexEdit::OnEditCopy ( ) [protected]

Definition at line 1142 of file CJHexEdit.cpp.

References EDIT_ASCII, m_currentMode, m_pData, m_selEnd, m_selStart, and TOHEX.

Referenced by OnChar, and OnEditCut.

01143 {
01144     COleDataSource*     pSource = new COleDataSource();
01145     EmptyClipboard();
01146     if(m_currentMode != EDIT_ASCII)
01147     {
01148         int         dwLen = (m_selEnd-m_selStart);
01149         HGLOBAL     hMemb = ::GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE|GMEM_ZEROINIT, m_selEnd-m_selStart);
01150         HGLOBAL     hMema = ::GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE|GMEM_ZEROINIT, (dwLen) * 3);
01151
01152         if (!hMema)
01153             return;
01154
01155         // copy binary
01156         LPBYTE  p = (BYTE*)::GlobalLock(hMemb);
01157         memcpy(p, m_pData+m_selStart, dwLen);
01158         ::GlobalUnlock(hMemb);
01159
01160         // copy ascii
01161         p = (BYTE*)::GlobalLock(hMema);
01162         for(int  i = 0; i < dwLen;)
01163         {
01164             TOHEX(m_pData[m_selStart+i], p);
01165             *p++ = ' ';
01166             i++;
01167         }
01168
01169         ::GlobalUnlock(hMema);
01170
01171         pSource->CacheGlobalData((CLIPFORMAT)RegisterClipboardFormat( _T("BinaryData")), hMemb);
01172         pSource->CacheGlobalData(CF_TEXT, hMema);
01173     }
01174     else
01175     {
01176         HGLOBAL             hMemb = ::GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE|GMEM_ZEROINIT, m_selEnd-m_selStart);
01177         HGLOBAL             hMema = ::GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE|GMEM_ZEROINIT, m_selEnd-m_selStart);
01178         if (!hMemb || !hMema)
01179             return;
01180
01181         // copy binary
01182         LPBYTE  p = (BYTE*)::GlobalLock(hMemb);
01183         int     dwLen = m_selEnd-m_selStart;
01184
01185         memcpy(p, m_pData+m_selStart, dwLen);
01186         ::GlobalUnlock(hMemb);
01187
01188         // copy ascii
01189         p = (BYTE*)::GlobalLock(hMema);
01190         memcpy(p, m_pData+m_selStart, dwLen);
01191         for(int i = 0; i < dwLen; p++, i++)
01192             if(!isprint(*p))
01193                 *p = '.';
01194         ::GlobalUnlock(hMema);
01195
01196         pSource->CacheGlobalData((CLIPFORMAT)RegisterClipboardFormat( _T("BinaryData")), hMemb);
01197         pSource->CacheGlobalData(CF_TEXT, hMema);
01198     }
01199     pSource->SetClipboard();
01200 }

void CCJHexEdit::OnEditCut ( ) [protected]

Definition at line 1202 of file CJHexEdit.cpp.

References m_selEnd, m_selStart, OnEditCopy, and SelDelete.

Referenced by OnChar.

01203 {
01204     OnEditCopy();
01205     SelDelete(m_selStart, m_selEnd);
01206     RedrawWindow();
01207 }

void CCJHexEdit::OnEditPaste ( ) [protected]

Definition at line 1209 of file CJHexEdit.cpp.

References EDIT_LOW, m_currentAddress, m_currentMode, m_pData, m_selEnd, m_selStart, NormalizeSel, NULL, SelDelete, SelInsert, and SetSel.

Referenced by OnChar.

01210 {
01211     COleDataObject  obj;
01212     if (obj.AttachClipboard())
01213     {
01214         HGLOBAL hmem = NULL;
01215         if (obj.IsDataAvailable((CLIPFORMAT)RegisterClipboardFormat( _T("BinaryData"))))
01216         {
01217             hmem = obj.GetGlobalData((CLIPFORMAT)RegisterClipboardFormat( _T("BinaryData")));
01218         }
01219         else if (obj.IsDataAvailable(CF_TEXT))
01220         {
01221             hmem = obj.GetGlobalData(CF_TEXT);
01222         }
01223         if(hmem)
01224         {
01225             LPBYTE  p = (BYTE*)::GlobalLock(hmem);
01226             DWORD   dwLen = ::GlobalSize(hmem);
01227             int     insert;
01228             int     oa = m_currentAddress;
01229
01230             NormalizeSel();
01231             if(m_selStart == 0xffffffff)
01232             {
01233                 if(m_currentMode == EDIT_LOW)
01234                     m_currentAddress++;
01235                 insert = m_currentAddress;
01236                 SelInsert(m_currentAddress, dwLen);
01237             }
01238             else
01239             {
01240                 insert = m_selStart;
01241                 SelDelete(m_selStart, m_selEnd);
01242                 SelInsert(insert, dwLen);
01243                 SetSel(-1, -1);
01244             }
01245
01246             memcpy(m_pData+insert, p, dwLen);
01247
01248             m_currentAddress = oa;
01249             RedrawWindow();
01250             ::GlobalUnlock(hmem);
01251         }
01252     }
01253 }

void CCJHexEdit::OnEditSelectAll ( ) [protected]

Definition at line 1255 of file CJHexEdit.cpp.

References m_length, m_selEnd, and m_selStart.

01256 {
01257     m_selStart = 0;
01258     m_selEnd = m_length;
01259     DestroyCaret();
01260     RedrawWindow();
01261 }

void CCJHexEdit::OnEditUndo ( ) [protected]

Definition at line 1263 of file CJHexEdit.cpp.

Referenced by OnChar.

01264 {
01265     // TODO: Add your command handler code here
01266
01267 }

BOOL CCJHexEdit::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 476 of file CJHexEdit.cpp.

References TRUE.

00477 {
00478     // KStowell - overridden for flicker-free drawing.
00479     UNUSED_ALWAYS(pDC);
00480     return TRUE;
00481 }

_CJXLIB_INLINE UINT CCJHexEdit::OnGetDlgCode ( ) [protected]

Definition at line 138 of file CJHexEdit.h.

00139     { return DLGC_WANTALLKEYS; }

void CCJHexEdit::OnHScroll | ( | UINT | nSBCode,
 |  | UINT | nPos,
 |  | CScrollBar * | pScrollBar
 | ) | [protected]

Definition at line 1322 of file CJHexEdit.cpp.

01323 {
01324     UNUSED_ALWAYS(nSBCode);
01325     UNUSED_ALWAYS(nPos);
01326     UNUSED_ALWAYS(pScrollBar);
01327 }

void CCJHexEdit::OnKeyDown | ( | UINT | nChar,
 |  | UINT | nRepCnt,
 |  | UINT | nFlags
 | ) | [protected]

Definition at line 743 of file CJHexEdit.cpp.

References EDIT_ASCII, EDIT_HIGH, EDIT_LOW, EDIT_NONE, IsSelected, m_bNoAddressChange, m_bpr, m_currentAddress, m_currentMode, m_length, m_lpp, m_selEnd, m_selStart, Move, NULL, OnEditClear, OnVScroll, SelDelete, SelInsert, SetSel, and TRUE.

00744 {
00745     nFlags; nRepCnt;
00746
00747     BOOL bShift = GetKeyState(VK_SHIFT) & 0x80000000;
00748     BOOL bac = m_bNoAddressChange;
00749     m_bNoAddressChange = TRUE;
00750     switch(nChar)
00751     {
00752         case VK_DOWN:
00753             if(bShift)
00754             {
00755                 if(!IsSelected())
00756                 {
00757                     m_selStart = m_currentAddress;
00758                 }
00759                 Move(0,1);
00760                 m_selEnd   = m_currentAddress;
00761                 if(m_currentMode == EDIT_HIGH || m_currentMode == EDIT_LOW)
00762                     m_selEnd++;
00763                 RedrawWindow();
00764                 break;
00765             }
00766             else
00767                 SetSel(-1, -1);
00768             Move(0,1);
00769             break;
00770         case VK_UP:
00771             if(bShift)
00772             {
00773                 if(!IsSelected())
00774                 {
00775                     m_selStart = m_currentAddress;
00776                 }
00777                 Move(0,-1);
00778                 m_selEnd   = m_currentAddress;
00779                 RedrawWindow();
00780                 break;
00781             }
00782             else
00783                 SetSel(-1, -1);
00784             Move(0,-1);
00785             break;
00786         case VK_LEFT:
00787             if(bShift)
00788             {
00789                 if(!IsSelected())
00790                 {
00791                     m_selStart = m_currentAddress;
00792                 }
00793                 Move(-1,0);
00794                 m_selEnd   = m_currentAddress;
00795                 RedrawWindow();
00796                 break;
00797             }
00798             else
00799                 SetSel(-1, -1);
00800             Move(-1,0);
00801             break;
00802         case VK_RIGHT:
00803             if(bShift)
00804             {
00805                 if(!IsSelected())
00806                 {
00807                     m_selStart = m_currentAddress;
00808                 }
00809                 Move(1,0);
00810                 m_selEnd   = m_currentAddress;
00811                 if(m_currentMode == EDIT_HIGH || m_currentMode == EDIT_LOW)
00812                     m_selEnd++;
00813                 RedrawWindow();
00814                 break;
00815             }
00816             else
00817                 SetSel(-1, -1);
00818             Move(1,0);
00819             break;
00820         case VK_PRIOR:
00821             if(bShift)
00822             {
00823                 if(!IsSelected())
00824                 {
00825                     m_selStart = m_currentAddress;
00826                 }
00827                 OnVScroll(SB_PAGEUP, 0, NULL);
00828                 Move(0,0);
00829                 m_selEnd   = m_currentAddress;
00830                 RedrawWindow();
00831                 break;
00832             }
00833             else
00834                 SetSel(-1, -1);
00835             OnVScroll(SB_PAGEUP, 0, NULL);
00836             Move(0,0);
00837             break;
00838         case VK_NEXT:
00839             if(bShift)
00840             {
00841                 if(!IsSelected())
00842                 {
00843                     m_selStart = m_currentAddress;
00844                 }
00845                 OnVScroll(SB_PAGEDOWN, 0, NULL);
00846                 Move(0,0);
00847                 m_selEnd   = m_currentAddress;
00848                 RedrawWindow();
00849                 break;
00850             }
00851             else
00852                 SetSel(-1, -1);
00853             OnVScroll(SB_PAGEDOWN, 0, NULL);
00854             Move(0,0);
00855             break;
00856         case VK_HOME:
00857             if(bShift)
00858             {
00859                 if(!IsSelected())
00860                 {
00861                     m_selStart = m_currentAddress;
00862                 }
00863                 if(GetKeyState(VK_CONTROL) & 0x80000000)
00864                 {
00865                     OnVScroll(SB_THUMBTRACK, 0, NULL);
00866                     Move(0,0);
00867                 }
00868                 else
00869                 {
00870                     m_currentAddress /= m_bpr;
00871                     m_currentAddress *= m_bpr;
00872                     Move(0,0);
00873                 }
00874                 m_selEnd   = m_currentAddress;
00875                 RedrawWindow();
00876                 break;
00877             }
00878             else
00879                 SetSel(-1, -1);
00880             if(GetKeyState(VK_CONTROL) & 0x80000000)
00881             {
00882                 OnVScroll(SB_THUMBTRACK, 0, NULL);
00883                 m_currentAddress = 0;
00884                 Move(0,0);
00885             }
00886             else
00887             {
00888                 m_currentAddress /= m_bpr;
00889                 m_currentAddress *= m_bpr;
00890                 Move(0,0);
00891             }
00892             break;
00893         case VK_END:
00894             if(bShift)
00895             {
00896                 if(!IsSelected())
00897                 {
00898                     m_selStart = m_currentAddress;
00899                 }
00900                 if(GetKeyState(VK_CONTROL) & 0x80000000)
00901                 {
00902                     m_currentAddress = m_length-1;
00903                     OnVScroll(SB_THUMBTRACK, ((m_length+(m_bpr/2)) / m_bpr) - m_lpp, NULL);
00904                     Move(0,0);
00905                 }
00906                 else
00907                 {
00908                     m_currentAddress /= m_bpr;
00909                     m_currentAddress *= m_bpr;
00910                     m_currentAddress += m_bpr - 1;
00911                     if(m_currentAddress > m_length)
00912                         m_currentAddress = m_length-1;
00913                     Move(0,0);
00914                 }
00915                 m_selEnd   = m_currentAddress;
00916                 RedrawWindow();
00917                 break;
00918             }
00919             else
00920                 SetSel(-1, -1);
00921             if(GetKeyState(VK_CONTROL) & 0x80000000)
00922             {
00923                 m_currentAddress = m_length-1;
00924                 if(m_bHalfPage)
00925                     OnVScroll(SB_THUMBTRACK, 0, NULL);
00926                 else
00927                     OnVScroll(SB_THUMBTRACK, ((m_length+(m_bpr/2)) / m_bpr) - m_lpp, NULL);
00928                 Move(0,0);
00929             }
00930             else
00931             {
00932                 m_currentAddress /= m_bpr;
00933                 m_currentAddress *= m_bpr;
00934                 m_currentAddress += m_bpr - 1;
00935                 if(m_currentAddress > m_length)
00936                     m_currentAddress = m_length-1;
00937                 Move(0,0);
00938             }
00939             break;
00940         case VK_INSERT:
00941             SelInsert(m_currentAddress, max(1, m_selEnd-m_selStart));
00942             RedrawWindow();
00943             break;
00944         case VK_DELETE:
00945             if(IsSelected())
00946             {
00947                 OnEditClear();
00948             }
00949             else
00950             {
00951                 SelDelete(m_currentAddress, m_currentAddress+1);
00952                 RedrawWindow();
00953             }
00954             break;
00955         case '\t':
00956             switch(m_currentMode)
00957             {
00958                 case EDIT_NONE:
00959                     m_currentMode = EDIT_HIGH;
00960                     break;
00961                 case EDIT_HIGH:
00962                 case EDIT_LOW:
00963                     m_currentMode = EDIT_ASCII;
00964                     break;
00965                 case EDIT_ASCII:
00966                     m_currentMode = EDIT_HIGH;
00967                     break;
00968             }
00969             Move(0,0);
00970             break;
00971
00972     }
00973     m_bNoAddressChange = bac;
00974 }

void CCJHexEdit::OnKillFocus ( CWnd * pNewWnd ) [protected]

Definition at line 392 of file CJHexEdit.cpp.

00393 {
00394     DestroyCaret();
00395     CWnd::OnKillFocus(pNewWnd);
00396 }

void CCJHexEdit::OnLButtonDblClk | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 1329 of file CJHexEdit.cpp.

01330 {
01331     UNUSED_ALWAYS(nFlags);
01332     UNUSED_ALWAYS(point);
01333 }

void CCJHexEdit::OnLButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 483 of file CJHexEdit.cpp.

References CalcPos, CreateAddressCaret, CreateEditCaret, EDIT_HIGH, EDIT_LOW, IsSelected, m_bShowAddress, m_currentAddress, m_currentMode, m_editPos, m_lineHeight, m_nullWidth, m_pData, m_selEnd, and m_selStart.

00484 {
00485     SetFocus();
00486     if(!m_pData)
00487         return;
00488
00489     if(nFlags & MK_SHIFT)
00490     {
00491         m_selStart = m_currentAddress;
00492     }
00493     CPoint pt = CalcPos(point.x, point.y);
00494     if(pt.x > -1)
00495     {
00496         m_editPos = pt;
00497         pt.x *= m_nullWidth;
00498         pt.y *= m_lineHeight;
00499
00500         if(pt.x == 0 && m_bShowAddress)
00501             CreateAddressCaret();
00502         else
00503             CreateEditCaret();
00504
00505         SetCaretPos(pt);
00506         if(nFlags & MK_SHIFT)
00507         {
00508             m_selEnd = m_currentAddress;
00509             if(m_currentMode == EDIT_HIGH || m_currentMode == EDIT_LOW)
00510                 m_selEnd++;
00511             RedrawWindow();
00512         }
00513     }
00514     if(!(nFlags & MK_SHIFT))
00515     {
00516         if(DragDetect(this->m_hWnd, point))
00517         {
00518             m_selStart = m_currentAddress;
00519             m_selEnd   = m_selStart;
00520             SetCapture();
00521         }
00522         else
00523         {
00524             BOOL bsel = m_selStart != 0xffffffff;
00525
00526             m_selStart = 0xffffffff;
00527             m_selEnd   = 0xffffffff;
00528             if(bsel)
00529                 RedrawWindow();
00530         }
00531     }
00532     if(!IsSelected())
00533     {
00534         ShowCaret();
00535     }
00536 }

void CCJHexEdit::OnLButtonUp | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 662 of file CJHexEdit.cpp.

References IsSelected.

00663 {
00664     if(IsSelected()) {
00665         ReleaseCapture();
00666     }
00667
00668     CWnd::OnLButtonUp(nFlags, point);
00669 }

void CCJHexEdit::OnMouseMove | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 592 of file CJHexEdit.cpp.

References CalcPos, EDIT_HIGH, EDIT_LOW, IsSelected, m_currentAddress, m_currentMode, m_pData, m_selEnd, m_selStart, NULL, and OnVScroll.

00593 {
00594     if(!m_pData) {
00595         return;
00596     }
00597
00598     if(nFlags & MK_LBUTTON && m_selStart != 0xffffffff)
00599     {
00600         CRect rc;
00601         GetClientRect(&rc);
00602         if(!rc.PtInRect(point))
00603         {
00604             if(point.y < 0)
00605             {
00606                 OnVScroll(SB_LINEUP, 0, NULL);
00607                 point.y = 0;
00608             }
00609             else if(point.y > rc.Height())
00610             {
00611                 OnVScroll(SB_LINEDOWN, 0, NULL);
00612                 point.y = rc.Height() -1;
00613             }
00614         }
00615
00616         //
00617         // we are selecting
00618         //
00619         int  seo = m_selEnd;
00620         CPoint pt = CalcPos(point.x, point.y);
00621         if(pt.x > -1)
00622         {
00623             m_selEnd = m_currentAddress;
00624             if(m_currentMode == EDIT_HIGH || m_currentMode == EDIT_LOW)
00625                 m_selEnd++;
00626         }
00627         if(IsSelected())
00628             DestroyCaret();
00629
00630         if(seo != m_selEnd)
00631             RedrawWindow();
00632     }
00633 }

void CCJHexEdit::OnPaint ( ) [protected]

Definition at line 116 of file CJHexEdit.cpp.

References ASSERT, EDIT_ASCII, EDIT_HIGH, EDIT_LOW, FALSE, m_bAddressIsWide, m_bHalfPage, m_bpr, m_bShowAddress, m_bShowHex, m_bUpdate, m_currentAddress, m_currentMode, m_Font, m_length, m_lineHeight, m_lpp, m_nullWidth, m_offAddress, m_offAscii, m_offHex, m_pData, m_selEnd, m_selStart, m_topindex, TOHEX, TRUE, and UpdateScrollbars.

00117 {
00118     CPaintDC dc(this); // device context for painting
00119
00120     // KStowell - Get the client rect.
00121     CRect rcClient;
00122     GetClientRect( &rcClient );
00123
00124     // KStowell - Create a memory device-context. This is done to help reduce
00125     // screen flicker, since we will paint the entire control to the
00126     // off screen device context first.
00127     CDC memDC;
00128     CBitmap bitmap;
00129     memDC.CreateCompatibleDC(&dc);
00130     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00131     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00132
00133     // KStowell - Repaint the background.
00134     memDC.FillSolidRect( rcClient, ::GetSysColor(COLOR_WINDOW) );
00135
00136     ASSERT(m_currentAddress >= 0);
00137     ASSERT(m_topindex >= 0);
00138
00139     CFont* pOldFont = memDC.SelectObject(&m_Font);
00140     int     height      = 0;
00141     int     x,y;
00142     TCHAR   buf[256];
00143
00144     x = rcClient.TopLeft().x;
00145     y = rcClient.TopLeft().y;
00146
00147     memDC.SetBoundsRect(&rcClient, DCB_DISABLE);
00148
00149     if(m_pData)
00150     {
00151         //
00152         // get char dimensions
00153         //
00154         if(m_bUpdate)
00155         {
00156             memDC.GetCharWidth('0', '0', &m_nullWidth);
00157             CSize sz = memDC.GetTextExtent(_T("0"), 1);
00158             m_lineHeight = sz.cy;
00159
00160             m_offHex    = m_bShowAddress ? (m_bAddressIsWide ? m_nullWidth * 9 : m_nullWidth * 5) : 0;
00161             m_offAscii  = m_bShowAddress ? (m_bAddressIsWide ? m_nullWidth * 9 : m_nullWidth * 5) : 0;
00162             m_offAscii += m_bShowHex     ? (m_bpr * 3 * m_nullWidth) : 0;
00163
00164             m_lpp = rcClient.Height() / m_lineHeight;
00165             m_bHalfPage = FALSE;
00166             if(m_lpp * m_bpr > m_length)
00167             {
00168                 m_lpp = (m_length + (m_bpr/2)) / m_bpr ;
00169                 if(m_length % m_bpr != 0)
00170                 {
00171                     m_bHalfPage = TRUE;
00172                     m_lpp++;
00173                 }
00174             }
00175             m_bUpdate = FALSE;
00176             UpdateScrollbars();
00177         }
00178
00179         height = rcClient.Height() / m_lineHeight;
00180         height *= m_lineHeight;
00181
00182         if(m_bShowAddress)
00183         {
00184             TCHAR fmt[8] = {'%','0','8','l','X'};
00185             fmt[2] = m_bAddressIsWide ? '8' : '4';
00186             int w = m_bAddressIsWide ? 8 : 4;
00187             y = 0;
00188             CRect rcd = rcClient;
00189             rcd.TopLeft().x = m_offAddress;
00190             for(int  i = m_topindex; (i < m_length) && (rcd.TopLeft().y < height); i+= m_bpr)
00191             {
00192                 _stprintf(buf, fmt, i);
00193                 memDC.DrawText(buf, w, rcd, DT_LEFT|DT_TOP|DT_SINGLELINE|DT_NOPREFIX);
00194                 rcd.TopLeft().y += m_lineHeight;
00195             }
00196         }
00197         if(m_bShowHex)
00198         {
00199             y = 0;
00200             CRect rcd = rcClient;
00201             rcd.TopLeft().x = x = m_offHex;
00202
00203             if(m_selStart != 0xffffffff && (m_currentMode == EDIT_HIGH || m_currentMode == EDIT_LOW))
00204             {
00205                 int  i;
00206                 int  n = 0;
00207                 int  selStart = m_selStart, selEnd = m_selEnd;
00208                 if(selStart > selEnd)
00209                     selStart ^= selEnd ^= selStart ^= selEnd;
00210
00211                 for(i = m_topindex; (i < selStart) && (y < height); i++)
00212                 {
00213                     LPTSTR p = &buf[0];
00214
00215                     TOHEX(m_pData[i], p);
00216
00217                     *p++ = ' ';
00218                     memDC.TextOut(x, y, buf, 3);
00219                     x += m_nullWidth * 3;
00220                     n++;
00221                     if(n == m_bpr)
00222                     {
00223                         n = 0;
00224                         x = m_offHex;
00225                         y += m_lineHeight;
00226                     }
00227                 }
00228
00229                 memDC.SetTextColor(GetSysColor(COLOR_HIGHLIGHTTEXT));
00230                 memDC.SetBkColor(GetSysColor(COLOR_HIGHLIGHT));
00231                 for(; (i < selEnd) && (i < m_length) && (y < height); i++)
00232                 {
00233                     LPTSTR p = &buf[0];
00234
00235                     TOHEX(m_pData[i], p);
00236
00237                     *p++ = ' ';
00238                     memDC.TextOut(x, y, buf, 3);
00239                     x += m_nullWidth * 3;
00240                     n++;
00241                     if(n == m_bpr)
00242                     {
00243                         n = 0;
00244                         x = m_offHex;
00245                         y += m_lineHeight;
00246                     }
00247                 }
00248                 memDC.SetTextColor(GetSysColor(COLOR_WINDOWTEXT));
00249                 memDC.SetBkColor(GetSysColor(COLOR_WINDOW));
00250                 for(; (i < m_length) && (y < height); i++)
00251                 {
00252                     LPTSTR p = &buf[0];
00253
00254                     TOHEX(m_pData[i], p);
00255
00256                     *p++ = ' ';
00257                     memDC.TextOut(x, y, buf, 3);
00258                     x += m_nullWidth * 3;
00259                     n++;
00260                     if(n == m_bpr)
00261                     {
00262                         n = 0;
00263                         x = m_offHex;
00264                         y += m_lineHeight;
00265                     }
00266                 }
00267             }
00268             else
00269             {
00270                 for(int  i = m_topindex; (i < m_length) && (rcd.TopLeft().y < height);)
00271                 {
00272                     LPTSTR p = &buf[0];
00273
00274                     for(int  n = 0; (n < m_bpr) && (i < m_length); n++)
00275                     {
00276                         TOHEX(m_pData[i], p);
00277                         *p++ = ' ';
00278                         i++;
00279                     }
00280
00281                     while(n < m_bpr)
00282                     {
00283                         *p++ = ' '; *p++ = ' '; *p++ = ' ';
00284                         n++;
00285                     }
00286
00287                     memDC.DrawText(buf, m_bpr*3, rcd, DT_LEFT|DT_TOP|DT_SINGLELINE|DT_NOPREFIX);
00288                     rcd.TopLeft().y += m_lineHeight;
00289                 }
00290             }
00291         }
00292         if(m_bShowAscii)
00293         {
00294             y = 0;
00295             CRect rcd = rcClient;
00296             rcd.TopLeft().x = x = m_offAscii;
00297             if(m_selStart != 0xffffffff && m_currentMode == EDIT_ASCII)
00298             {
00299                 int  i;
00300                 int  n = 0;
00301                 int  selStart = m_selStart, selEnd = m_selEnd;
00302                 if(selStart > selEnd)
00303                     selStart ^= selEnd ^= selStart ^= selEnd;
00304
00305                 for(i = m_topindex; (i < selStart) && (y < height); i++)
00306                 {
00307                     buf[0] = isprint(m_pData[i]) ? m_pData[i] : '.';
00308                     memDC.TextOut(x, y, buf, 1);
00309                     x += m_nullWidth;
00310                     n++;
00311                     if(n == m_bpr)
00312                     {
00313                         n = 0;
00314                         x = m_offAscii;
00315                         y += m_lineHeight;
00316                     }
00317                 }
00318                 memDC.SetTextColor(GetSysColor(COLOR_HIGHLIGHTTEXT));
00319                 memDC.SetBkColor(GetSysColor(COLOR_HIGHLIGHT));
00320                 for(; (i < selEnd) && (y < height); i++)
00321                 {
00322                     buf[0] = isprint(m_pData[i]) ? m_pData[i] : '.';
00323                     memDC.TextOut(x, y, buf, 1);
00324                     x += m_nullWidth;
00325                     n++;
00326                     if(n == m_bpr)
00327                     {
00328                         n = 0;
00329                         x = m_offAscii;
00330                         y += m_lineHeight;
00331                     }
00332                 }
00333                 memDC.SetTextColor(GetSysColor(COLOR_WINDOWTEXT));
00334                 memDC.SetBkColor(GetSysColor(COLOR_WINDOW));
00335                 for(; (i < m_length) && y < height; i++)
00336                 {
00337                     buf[0] = isprint(m_pData[i]) ? m_pData[i] : '.';
00338                     memDC.TextOut(x, y, buf, 1);
00339                     x += m_nullWidth;
00340                     n++;
00341                     if(n == m_bpr)
00342                     {
00343                         n = 0;
00344                         x = m_offAscii;
00345                         y += m_lineHeight;
00346                     }
00347                 }
00348             }
00349             else
00350             {
00351                 for(int  i = m_topindex; (i < m_length) && (rcd.TopLeft().y < height);)
00352                 {
00353                     LPTSTR p = &buf[0];
00354
00355                     for(int  n = 0; (n < m_bpr) && (i < m_length); n++)
00356                     {
00357                         *p++ = isprint(m_pData[i]) ? m_pData[i] : '.';
00358                         i++;
00359                     }
00360
00361                     memDC.DrawText(buf, n, rcd, DT_LEFT|DT_TOP|DT_SINGLELINE|DT_NOPREFIX);
00362                     rcd.TopLeft().y += m_lineHeight;
00363                 }
00364             }
00365         }
00366     }
00367
00368     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00369     dc.BitBlt(rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), &memDC, 0,0, SRCCOPY);
00370
00371     // KStowell - Cleanup resources.
00372     memDC.SelectObject(pOldBitmap);
00373     memDC.SelectObject(pOldFont);
00374     memDC.DeleteDC();
00375     bitmap.DeleteObject();
00376 }

void CCJHexEdit::OnSetFocus ( CWnd * pOldWnd ) [protected]

Definition at line 378 of file CJHexEdit.cpp.

References CreateAddressCaret, CreateEditCaret, IsSelected, m_bShowAddress, m_editPos, and m_pData.

00379 {
00380     if(m_pData && !IsSelected())
00381     {
00382         if(m_editPos.x == 0 && m_bShowAddress)
00383             CreateAddressCaret();
00384         else
00385             CreateEditCaret();
00386         SetCaretPos(m_editPos);
00387         ShowCaret();
00388     }
00389     CWnd::OnSetFocus(pOldWnd);
00390 }

void CCJHexEdit::OnVScroll | ( | UINT | nSBCode,
 |  | UINT | nPos,
 |  | CScrollBar * | pScrollBar
 | ) | [protected]

Definition at line 398 of file CJHexEdit.cpp.

References m_bNoAddressChange, m_bpr, m_currentAddress, m_length, m_lpp, m_pData, m_topindex, RepositionCaret, and TRUE.

Referenced by Move, OnKeyDown, and OnMouseMove.

00399 {
00400     UNUSED_ALWAYS(pScrollBar);
00401
00402     if(!m_pData) {
00403         return;
00404     }
00405
00406     int oa = m_topindex;
00407     switch(nSBCode)
00408     {
00409         case SB_LINEDOWN:
00410             if(m_topindex < m_length - m_lpp*m_bpr)
00411             {
00412                 m_topindex += m_bpr;
00413                 RedrawWindow();
00414             }
00415             break;
00416
00417         case SB_LINEUP:
00418             if(m_topindex > 0)
00419             {
00420                 m_topindex -= m_bpr;
00421                 RedrawWindow();
00422             }
00423             break;
00424
00425         case SB_PAGEDOWN:
00426             if(m_topindex < m_length - m_lpp*m_bpr)
00427             {
00428                 m_topindex += m_bpr * m_lpp;
00429                 if(m_topindex > m_length - m_lpp*m_bpr)
00430                     m_topindex = m_length - m_lpp*m_bpr;
00431                 RedrawWindow();
00432             }
00433             break;
00434
00435         case SB_PAGEUP:
00436             if(m_topindex > 0)
00437             {
00438                 m_topindex -= m_bpr * m_lpp;
00439                 if(m_topindex < 0)
00440                     m_topindex = 0;
00441                 RedrawWindow();
00442             }
00443             break;
00444
00445         case SB_THUMBTRACK:
00446             m_topindex = nPos * m_bpr;
00447             RedrawWindow();
00448             break;
00449     }
00450     ::SetScrollPos(this->m_hWnd, SB_VERT, m_topindex / m_bpr, TRUE);
00451     if(!m_bNoAddressChange)
00452         m_currentAddress += (m_topindex - oa);
00453     RepositionCaret(m_currentAddress);
00454 }

BOOL CCJHexEdit::PreCreateWindow ( CREATESTRUCT & cs ) [protected, virtual]

Definition at line 456 of file CJHexEdit.cpp.

References FALSE, and TRUE.

00457 {
00458     if(!CEdit::PreCreateWindow(cs)) {
00459         return FALSE;
00460     }
00461
00462     cs.style |= WS_HSCROLL|WS_VSCROLL;
00463     return TRUE;
00464 }

void CCJHexEdit::RepositionCaret ( int p ) [protected, virtual]

Definition at line 1039 of file CJHexEdit.cpp.

References CreateAddressCaret, CreateEditCaret, EDIT_ASCII, EDIT_HIGH, EDIT_LOW, EDIT_NONE, m_bpr, m_editPos, m_lineHeight, m_nullWidth, m_offAscii, m_offHex, and m_topindex.

Referenced by Move, OnChar, OnEditClear, OnVScroll, and SelDelete.

01040 {
01041     int x, y;
01042
01043     y = (p - m_topindex) / m_bpr;
01044     x = (p - m_topindex) % m_bpr;
01045
01046     switch(m_currentMode)
01047     {
01048         case EDIT_NONE:
01049             CreateAddressCaret();
01050             x = 0;
01051             break;
01052         case EDIT_HIGH:
01053             CreateEditCaret();
01054             x *= m_nullWidth*3;
01055             x += m_offHex;
01056             break;
01057         case EDIT_LOW:
01058             CreateEditCaret();
01059             x *= m_nullWidth*3;
01060             x += m_nullWidth;
01061             x += m_offHex;
01062             break;
01063         case EDIT_ASCII:
01064             CreateEditCaret();
01065             x *= m_nullWidth;
01066             x += m_offAscii;
01067             break;
01068     }
01069     m_editPos.x = x;
01070     m_editPos.y = y*m_lineHeight;
01071     CRect rc;
01072     GetClientRect(&rc);
01073     if(rc.PtInRect(m_editPos))
01074     {
01075         SetCaretPos(m_editPos);
01076         ShowCaret();
01077     }
01078 }

void CCJHexEdit::ScrollIntoView ( int p ) [protected, virtual]

Definition at line 1080 of file CJHexEdit.cpp.

References m_bpr, m_lpp, m_topindex, and UpdateScrollbars.

01081 {
01082     if(p < m_topindex || p > m_topindex + m_lpp*m_bpr)
01083     {
01084         m_topindex = (p/m_bpr) * m_bpr;
01085         m_topindex -= (m_lpp / 3) * m_bpr;
01086         if(m_topindex < 0)
01087             m_topindex = 0;
01088
01089         UpdateScrollbars();
01090         RedrawWindow();
01091     }
01092 }

void CCJHexEdit::SelDelete | ( | int | s,
 |  | int | e
 | ) | [protected, virtual]

Definition at line 1275 of file CJHexEdit.cpp.

References free, m_bUpdate, m_currentAddress, m_length, m_pData, malloc, RepositionCaret, SetSel, and TRUE.

Referenced by OnChar, OnEditClear, OnEditCut, OnEditPaste, and OnKeyDown.

01276 {
01277     LPBYTE p = (LPBYTE) malloc(m_length - (e-s)+1);
01278     memcpy(p, m_pData, s);
01279     if(s < m_length-(e-s))
01280         memcpy(p+s, m_pData+e, (m_length -e));
01281
01282     free(m_pData);
01283     SetSel(-1, -1);
01284     m_pData = p;
01285     m_length = m_length-(e-s);
01286     if(m_currentAddress > m_length)
01287     {
01288         m_currentAddress = m_length;
01289         RepositionCaret(m_currentAddress);
01290     }
01291     m_bUpdate = TRUE;
01292 }

void CCJHexEdit::SelInsert | ( | int | s,
 |  | int | l
 | ) | [protected, virtual]

Definition at line 1294 of file CJHexEdit.cpp.

References calloc, free, m_bUpdate, m_length, m_pData, SetSel, and TRUE.

Referenced by OnEditPaste, and OnKeyDown.

01295 {
01296     LPBYTE p = (LPBYTE) calloc(m_length + l, 1);
01297     memcpy(p, m_pData, s);
01298     memcpy(p+s+l, m_pData+s, (m_length-s));
01299     free(m_pData);
01300     SetSel(-1, -1);
01301     m_pData = p;
01302     m_length = m_length+l;
01303     m_bUpdate = TRUE;
01304 }

_CJXLIB_INLINE void CCJHexEdit::SetBPR ( int bpr ) [virtual]

Definition at line 144 of file CJHexEdit.h.

References m_bpr, m_bUpdate, and TRUE.

00145     { m_bpr = bpr; m_bUpdate = TRUE; }

void CCJHexEdit::SetData | ( | LPBYTE | p,
 |  | int | len
 | ) | [virtual]

Definition at line 1306 of file CJHexEdit.cpp.

References EDIT_HIGH, free, m_bUpdate, m_currentAddress, m_currentMode, m_editPos, m_length, m_pData, m_topindex, malloc, SetSel, and TRUE.

01307 {
01308     free(m_pData);
01309
01310     m_pData = (LPBYTE) malloc(len);
01311     memcpy(m_pData, p, len);
01312
01313     SetSel(-1, -1);
01314     m_length = len;
01315     m_currentAddress = 0;
01316     m_editPos.x = m_editPos.y = 0;
01317     m_currentMode = EDIT_HIGH;
01318     m_topindex = 0;
01319     m_bUpdate = TRUE;
01320 }

_CJXLIB_INLINE void CCJHexEdit::SetOptions | ( | BOOL | a,
 |  | BOOL | h,
 |  | BOOL | c,
 |  | BOOL | w
 | ) | [virtual]

Definition at line 141 of file CJHexEdit.h.

References m_bAddressIsWide, m_bShowAddress, m_bShowAscii, m_bShowHex, m_bUpdate, and TRUE.

00142     { m_bShowHex = h; m_bShowAscii = c; m_bShowAddress = a; m_bAddressIsWide = w; m_bUpdate = TRUE; }

void CCJHexEdit::SetSel | ( | int | s,
 |  | int | e
 | ) | [virtual]

Definition at line 1025 of file CJHexEdit.cpp.

References CreateAddressCaret, CreateEditCaret, m_bShowAddress, m_editPos, m_selEnd, and m_selStart.

Referenced by OnChar, OnEditPaste, OnKeyDown, SelDelete, SelInsert, and SetData.

01026 {
01027     DestroyCaret();
01028     m_selStart = s;
01029     m_selEnd = e;
01030     RedrawWindow();
01031     if(m_editPos.x == 0 && m_bShowAddress)
01032         CreateAddressCaret();
01033     else
01034         CreateEditCaret();
01035     SetCaretPos(m_editPos);
01036     ShowCaret();
01037 }

void CCJHexEdit::UpdateScrollbars ( void ) [protected, virtual]

Definition at line 635 of file CJHexEdit.cpp.

References m_bAddressIsWide, m_bpr, m_bShowAddress, m_bShowAscii, m_bShowHex, m_length, m_lpp, m_nullWidth, m_topindex, and TRUE.

Referenced by OnPaint, and ScrollIntoView.

00636 {
00637     SCROLLINFO si;
00638
00639     si.cbSize = sizeof(SCROLLINFO);
00640     si.fMask = SIF_ALL;
00641     si.nMin = 0;
00642     si.nMax = (m_length / m_bpr) - 1;
00643     si.nPage = m_lpp;
00644     si.nPos = m_topindex / m_bpr;
00645
00646     ::SetScrollInfo(this->m_hWnd, SB_VERT, &si, TRUE);
00647     if(si.nMax > (int)si.nPage)
00648         ::EnableScrollBar(this->m_hWnd, SB_VERT, ESB_ENABLE_BOTH);
00649
00650     CRect rc;
00651     GetClientRect(&rc);
00652
00653     si.nMin = 0;
00654     si.nMax =((m_bShowAddress ? (m_bAddressIsWide ? 8 : 4) : 0) +
00655               (m_bShowHex ? m_bpr * 3 : 0) +
00656               (m_bShowAscii ? m_bpr : 0) ) * m_nullWidth;
00657     si.nPage = 1;
00658     si.nPos = 0;
00659     ::SetScrollInfo(this->m_hWnd, SB_HORZ, &si, TRUE);
00660 }

Member Data Documentation

BOOL CCJHexEdit::m_bAddressIsWide

Definition at line 58 of file CJHexEdit.h.

Referenced by CalcPos, CCJHexEdit, CreateAddressCaret, OnPaint, SetOptions, and UpdateScrollbars.

BOOL CCJHexEdit::m_bHalfPage

Definition at line 60 of file CJHexEdit.h.

Referenced by CCJHexEdit, and OnPaint.

BOOL CCJHexEdit::m_bNoAddressChange

Definition at line 59 of file CJHexEdit.h.

Referenced by CCJHexEdit, Move, OnKeyDown, and OnVScroll.

int CCJHexEdit::m_bpr

Definition at line 53 of file CJHexEdit.h.

Referenced by CalcPos, CCJHexEdit, Move, OnKeyDown, OnPaint, OnVScroll, RepositionCaret, ScrollIntoView, SetBPR, and UpdateScrollbars.

BOOL CCJHexEdit::m_bShowAddress

Definition at line 55 of file CJHexEdit.h.

Referenced by CalcPos, CCJHexEdit, OnLButtonDown, OnPaint, OnSetFocus, SetOptions, SetSel, and UpdateScrollbars.

BOOL CCJHexEdit::m_bShowAscii

Definition at line 56 of file CJHexEdit.h.

Referenced by CalcPos, CCJHexEdit, SetOptions, and UpdateScrollbars.

BOOL CCJHexEdit::m_bShowHex

Definition at line 57 of file CJHexEdit.h.

Referenced by CalcPos, CCJHexEdit, OnPaint, SetOptions, and UpdateScrollbars.

BOOL CCJHexEdit::m_bUpdate

Definition at line 64 of file CJHexEdit.h.

Referenced by CCJHexEdit, OnPaint, SelDelete, SelInsert, SetBPR, SetData, and SetOptions.

int CCJHexEdit::m_currentAddress

Definition at line 49 of file CJHexEdit.h.

Referenced by CalcPos, CCJHexEdit, Move, OnChar, OnEditClear, OnEditPaste, OnKeyDown, OnLButtonDown, OnMouseMove, OnPaint, OnVScroll, SelDelete, and SetData.

EDITMODE CCJHexEdit::m_currentMode

Definition at line 50 of file CJHexEdit.h.

Referenced by CalcPos, CCJHexEdit, Move, OnChar, OnEditCopy, OnEditPaste, OnKeyDown, OnLButtonDown, OnMouseMove, OnPaint, and SetData.

CPoint CCJHexEdit::m_editPos

Definition at line 68 of file CJHexEdit.h.

Referenced by CCJHexEdit, OnLButtonDown, OnSetFocus, RepositionCaret, SetData, and SetSel.

CFont CCJHexEdit::m_Font

Definition at line 61 of file CJHexEdit.h.

Referenced by CCJHexEdit, Create, OnPaint, and ~CCJHexEdit.

int CCJHexEdit::m_length

Definition at line 47 of file CJHexEdit.h.

Referenced by CalcPos, CCJHexEdit, GetData, Move, OnEditSelectAll, OnKeyDown, OnPaint, OnVScroll, SelDelete, SelInsert, SetData, and UpdateScrollbars.

int CCJHexEdit::m_lineHeight

Definition at line 62 of file CJHexEdit.h.

Referenced by CalcPos, CreateAddressCaret, CreateEditCaret, OnLButtonDown, OnPaint, and RepositionCaret.

int CCJHexEdit::m_lpp

Definition at line 54 of file CJHexEdit.h.

Referenced by CalcPos, CCJHexEdit, Move, OnKeyDown, OnPaint, OnVScroll, ScrollIntoView, and UpdateScrollbars.

int CCJHexEdit::m_nullWidth

Definition at line 63 of file CJHexEdit.h.

Referenced by CalcPos, CreateAddressCaret, CreateEditCaret, OnLButtonDown, OnPaint, RepositionCaret, and UpdateScrollbars.

int CCJHexEdit::m_offAddress

Definition at line 67 of file CJHexEdit.h.

Referenced by CCJHexEdit, and OnPaint.

int CCJHexEdit::m_offAscii

Definition at line 66 of file CJHexEdit.h.

Referenced by CalcPos, CCJHexEdit, OnPaint, and RepositionCaret.

int CCJHexEdit::m_offHex

Definition at line 65 of file CJHexEdit.h.

Referenced by CalcPos, CCJHexEdit, OnPaint, and RepositionCaret.

LPBYTE CCJHexEdit::m_pData

Definition at line 46 of file CJHexEdit.h.

Referenced by CCJHexEdit, GetData, OnChar, OnEditCopy, OnEditPaste, OnLButtonDown, OnMouseMove, OnPaint, OnSetFocus, OnVScroll, SelDelete, SelInsert, and SetData.

int CCJHexEdit::m_selEnd

Definition at line 52 of file CJHexEdit.h.

Referenced by CCJHexEdit, GetSel, NormalizeSel, OnEditClear, OnEditCopy, OnEditCut, OnEditPaste, OnEditSelectAll, OnKeyDown, OnLButtonDown, OnMouseMove, OnPaint, and SetSel.

int CCJHexEdit::m_selStart

Definition at line 51 of file CJHexEdit.h.

Referenced by CCJHexEdit, GetSel, IsSelected, NormalizeSel, OnEditClear, OnEditCopy, OnEditCut, OnEditPaste, OnEditSelectAll, OnKeyDown, OnLButtonDown, OnMouseMove, OnPaint, and SetSel.

int CCJHexEdit::m_topindex

Definition at line 48 of file CJHexEdit.h.

Referenced by CalcPos, CCJHexEdit, Move, OnPaint, OnVScroll, RepositionCaret, ScrollIntoView, SetData, and UpdateScrollbars.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJHexEdit.h
  • WinCvs/CJLib/CJLibrary/CJHexEdit.cpp
Generated on Sun Feb 24 01:24:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJHtmlView Class Reference

#include <CJHtmlView.h>

Inheritance diagram for CCJHtmlView:

[legend]
Collaboration diagram for CCJHtmlView:

[legend]
List of all members.

Public Methods

CString | GetType () const
long | GetLeft () const
void | SetLeft (long nNewValue)
long | GetTop () const
void | SetTop (long nNewValue)
long | GetHeight () const
void | SetHeight (long nNewValue)
void | SetVisible (BOOL bNewValue)
BOOL | GetVisible () const
CString | GetLocationName () const
READYSTATE | GetReadyState () const
BOOL | GetOffline () const
void | SetOffline (BOOL bNewValue)
BOOL | GetSilent () const
void | SetSilent (BOOL bNewValue)
BOOL | GetTopLevelContainer () const
CString | GetLocationURL () const
BOOL | GetBusy () const
LPDISPATCH | GetApplication () const
LPDISPATCH | GetParentBrowser () const
LPDISPATCH | GetContainer () const
LPDISPATCH | GetHtmlDocument () const
CString | GetFullName () const
int | GetToolBar () const
void | SetToolBar (int nNewValue)
BOOL | GetMenuBar () const
void | SetMenuBar (BOOL bNewValue)
BOOL | GetFullScreen () const
void | SetFullScreen (BOOL bNewValue)
OLECMDF | QueryStatusWB (OLECMDID cmdID) const
BOOL | GetRegisterAsBrowser () const
void | SetRegisterAsBrowser (BOOL bNewValue)
BOOL | GetRegisterAsDropTarget () const
void | SetRegisterAsDropTarget (BOOL bNewValue)
BOOL | GetTheaterMode () const
void | SetTheaterMode (BOOL bNewValue)
BOOL | GetAddressBar () const
void | SetAddressBar (BOOL bNewValue)
BOOL | GetStatusBar () const
void | SetStatusBar (BOOL bNewValue)
void | GoBack ()
void | GoForward ()
void | GoHome ()
void | GoSearch ()
void | Navigate (LPCTSTR URL, DWORD dwFlags=0, LPCTSTR lpszTargetFrameName=NULL, LPCTSTR lpszHeaders=NULL, LPVOID lpvPostData=NULL, DWORD dwPostDataLen=0)
void | Navigate2 (LPITEMIDLIST pIDL, DWORD dwFlags=0, LPCTSTR lpszTargetFrameName=NULL)
void | Navigate2 (LPCTSTR lpszURL, DWORD dwFlags=0, LPCTSTR lpszTargetFrameName=NULL, LPCTSTR lpszHeaders=NULL, LPVOID lpvPostData=NULL, DWORD dwPostDataLen=0)
void | Navigate2 (LPCTSTR lpszURL, DWORD dwFlags, CByteArray &baPostedData, LPCTSTR lpszTargetFrameName=NULL, LPCTSTR lpszHeader=NULL)
void | Refresh ()
void | Refresh2 (int nLevel)
void | Stop ()
void | PutProperty (LPCTSTR lpszProperty, const VARIANT &vtValue)
void | PutProperty (LPCTSTR lpszPropertyName, double dValue)
void | PutProperty (LPCTSTR lpszPropertyName, LPCTSTR lpszValue)
void | PutProperty (LPCTSTR lpszPropertyName, long lValue)
void | PutProperty (LPCTSTR lpszPropertyName, short nValue)
BOOL | GetProperty (LPCTSTR lpszProperty, CString &strValue)
COleVariant | GetProperty (LPCTSTR lpszProperty)
void | ExecWB (OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
BOOL | LoadFromResource (LPCTSTR lpszResource)
BOOL | LoadFromResource (UINT nRes)
virtual void | OnDraw (CDC *pDC)
virtual BOOL | Create (LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID, CCreateContext *pContext=NULL)
virtual void | OnNavigateComplete2 (LPCTSTR strURL)
virtual void | OnBeforeNavigate2 (LPCTSTR lpszURL, DWORD nFlags, LPCTSTR lpszTargetFrameName, CByteArray &baPostedData, LPCTSTR lpszHeaders, BOOL *pbCancel)
virtual void | OnStatusTextChange (LPCTSTR lpszText)
virtual void | OnProgressChange (long nProgress, long nProgressMax)
virtual void | OnCommandStateChange (long nCommand, BOOL bEnable)
virtual void | OnDownloadBegin ()
virtual void | OnDownloadComplete ()
virtual void | OnTitleChange (LPCTSTR lpszText)
virtual void | OnPropertyChange (LPCTSTR lpszProperty)
virtual void | OnNewWindow2 (LPDISPATCH *ppDisp, BOOL *Cancel)
virtual void | OnDocumentComplete (LPCTSTR lpszURL)
virtual void | OnQuit ()
virtual void | OnVisible (BOOL bVisible)
virtual void | OnToolBar (BOOL bToolBar)
virtual void | OnMenuBar (BOOL bMenuBar)
virtual void | OnStatusBar (BOOL bStatusBar)
virtual void | OnFullScreen (BOOL bFullScreen)
virtual void | OnTheaterMode (BOOL bTheaterMode)

Public Attributes

CWnd m_wndBrowser

Protected Methods

CCJHtmlView ()
virtual | ~CCJHtmlView ()
virtual void | NavigateComplete2 (LPDISPATCH pDisp, VARIANT *URL)
virtual void | BeforeNavigate2 (LPDISPATCH pDisp, VARIANT *URL, VARIANT *Flags, VARIANT *TargetFrameName, VARIANT *PostData, VARIANT *Headers, BOOL *Cancel)
virtual void | DocumentComplete (LPDISPATCH pDisp, VARIANT *URL)
afx_msg void | OnSize (UINT nType, int cx, int cy)
afx_msg void | OnPaint ()
afx_msg void | OnDestroy ()
afx_msg void | OnFilePrint ()
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)

Protected Attributes

IWebBrowser2 * | m_pBrowserApp

Constructor & Destructor Documentation

CCJHtmlView::CCJHtmlView ( ) [protected]

Definition at line 123 of file CJHtmlView.cpp.

References m_pBrowserApp, and NULL.

00124     : CFormView((LPCTSTR) NULL)
00125 {
00126     m_pBrowserApp = NULL;
00127 }

CCJHtmlView::~CCJHtmlView ( ) [protected, virtual]

Definition at line 129 of file CJHtmlView.cpp.

References m_pBrowserApp, and NULL.

00130 {
00131     if (m_pBrowserApp != NULL)
00132         m_pBrowserApp->Release();
00133 }

Member Function Documentation

void CCJHtmlView::BeforeNavigate2 | ( | LPDISPATCH | pDisp,
 |  | VARIANT * | URL,
 |  | VARIANT * | Flags,
 |  | VARIANT * | TargetFrameName,
 |  | VARIANT * | PostData,
 |  | VARIANT * | Headers,
 |  | BOOL * | Cancel
 | ) | [protected, virtual]

Definition at line 733 of file CJHtmlView.cpp.

References ASSERT, NULL, and OnBeforeNavigate2.

00736 {
00737     ASSERT(V_VT(URL) == VT_BSTR);
00738     ASSERT(V_VT(TargetFrameName) == VT_BSTR);
00739     ASSERT(V_VT(PostData) == (VT_VARIANT | VT_BYREF));
00740     ASSERT(V_VT(Headers) == VT_BSTR);
00741     ASSERT(Cancel != NULL);
00742
00743     USES_CONVERSION;
00744
00745     VARIANT* vtPostedData = V_VARIANTREF(PostData);
00746     CByteArray array;
00747     if (V_VT(vtPostedData) & VT_ARRAY)
00748     {
00749         // must be a vector of bytes
00750         ASSERT(vtPostedData->parray->cDims == 1 && vtPostedData->parray->cbElements == 1);
00751
00752         vtPostedData->vt |= VT_UI1;
00753         COleSafeArray safe(vtPostedData);
00754
00755         DWORD dwSize = safe.GetOneDimSize();
00756         LPVOID pVoid;
00757         safe.AccessData(&pVoid);
00758
00759         array.SetSize(dwSize);
00760         LPBYTE lpByte = array.GetData();
00761
00762         memcpy(lpByte, pVoid, dwSize);
00763         safe.UnaccessData();
00764     }
00765     // make real parameters out of the notification
00766
00767     CString strTargetFrameName(V_BSTR(TargetFrameName));
00768     CString strURL = V_BSTR(URL);
00769     CString strHeaders = V_BSTR(Headers);
00770     DWORD nFlags = V_I4(Flags);
00771
00772     // notify the user's class
00773     OnBeforeNavigate2(strURL, nFlags, strTargetFrameName,
00774         array, strHeaders, Cancel);
00775 }

BOOL CCJHtmlView::Create | ( | LPCTSTR | lpszClassName,
 |  | LPCTSTR | lpszWindowName,
 |  | DWORD | dwStyle,
 |  | const RECT & | rect,
 |  | CWnd * | pParentWnd,
 |  | UINT | nID,
 |  | CCreateContext * | pContext = NULL
 | ) | [virtual]

Definition at line 220 of file CJHtmlView.cpp.

References FALSE, m_pBrowserApp, m_wndBrowser, NULL, and TRUE.

00223 {
00224     // create the view window itself
00225     m_pCreateContext = pContext;
00226     if (!CView::Create(lpszClassName, lpszWindowName,
00227                 dwStyle, rect, pParentWnd,  nID, pContext))
00228     {
00229         return FALSE;
00230     }
00231
00232     AfxEnableControlContainer();
00233
00234     RECT rectClient;
00235     GetClientRect(&rectClient);
00236
00237     // create the control window
00238     // AFX_IDW_PANE_FIRST is a safe but arbitrary ID
00239     if (!m_wndBrowser.CreateControl(CLSID_WebBrowser, lpszWindowName,
00240                 WS_VISIBLE | WS_CHILD, rectClient, this, AFX_IDW_PANE_FIRST))
00241     {
00242         DestroyWindow();
00243         return FALSE;
00244     }
00245
00246     LPUNKNOWN lpUnk = m_wndBrowser.GetControlUnknown();
00247     HRESULT hr = lpUnk->QueryInterface(IID_IWebBrowser2, (void**) &m_pBrowserApp);
00248     if (!SUCCEEDED(hr))
00249     {
00250         m_pBrowserApp = NULL;
00251         m_wndBrowser.DestroyWindow();
00252         DestroyWindow();
00253         return FALSE;
00254     }
00255
00256     return TRUE;
00257 }

void CCJHtmlView::DocumentComplete | ( | LPDISPATCH | pDisp,
 |  | VARIANT * | URL
 | ) | [protected, virtual]

Definition at line 777 of file CJHtmlView.cpp.

References ASSERT, and OnDocumentComplete.

00778 {
00779     UNUSED_ALWAYS(pDisp);
00780     ASSERT(V_VT(URL) == VT_BSTR);
00781
00782     CString str(V_BSTR(URL));
00783     OnDocumentComplete(str);
00784 }

void CCJHtmlView::ExecWB | ( | OLECMDID | cmdID,
 |  | OLECMDEXECOPT | cmdexecopt,
 |  | VARIANT * | pvaIn,
 |  | VARIANT * | pvaOut
 | ) |

Definition at line 453 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00455 {
00456     ASSERT(m_pBrowserApp != NULL);
00457
00458     m_pBrowserApp->ExecWB(cmdID, cmdexecopt, pvaIn, pvaOut);
00459 }

BOOL CCJHtmlView::GetAddressBar ( ) const

Definition at line 488 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00489 {
00490     ASSERT(m_pBrowserApp != NULL);
00491
00492     VARIANT_BOOL result;
00493     m_pBrowserApp->get_AddressBar(&result);
00494     return result;
00495 }

LPDISPATCH CCJHtmlView::GetApplication ( ) const

Definition at line 371 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00372 {
00373     ASSERT(m_pBrowserApp != NULL);
00374
00375     LPDISPATCH result;
00376     m_pBrowserApp->get_Application(&result);
00377     return result;
00378 }

BOOL CCJHtmlView::GetBusy ( ) const

Definition at line 335 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00336 {
00337     ASSERT(m_pBrowserApp != NULL);
00338
00339     VARIANT_BOOL result;
00340     m_pBrowserApp->get_Busy(&result);
00341     return result;
00342 }

LPDISPATCH CCJHtmlView::GetContainer ( ) const

Definition at line 390 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00391 {
00392     ASSERT(m_pBrowserApp != NULL);
00393
00394     LPDISPATCH result;
00395     m_pBrowserApp->get_Container(&result);
00396     return result;
00397 }

CString CCJHtmlView::GetFullName ( ) const

Definition at line 710 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00711 {
00712     ASSERT(m_pBrowserApp != NULL);
00713
00714     BSTR bstr;
00715     m_pBrowserApp->get_FullName(&bstr);
00716     CString retVal(bstr);
00717     return retVal;
00718 }

BOOL CCJHtmlView::GetFullScreen ( ) const

Definition at line 426 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00427 {
00428     ASSERT(m_pBrowserApp != NULL);
00429
00430     VARIANT_BOOL result;
00431     m_pBrowserApp->get_FullScreen(&result);
00432     return result;
00433 }

long CCJHtmlView::GetHeight ( ) const

Definition at line 298 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00299 {
00300     ASSERT(m_pBrowserApp != NULL);
00301     long result;
00302     m_pBrowserApp->get_Height(&result);
00303     return result;
00304 }

LPDISPATCH CCJHtmlView::GetHtmlDocument ( ) const

Definition at line 399 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

Referenced by OnFilePrint.

00400 {
00401     ASSERT(m_pBrowserApp != NULL);
00402
00403     LPDISPATCH result;
00404     m_pBrowserApp->get_Document(&result);
00405     return result;
00406 }

long CCJHtmlView::GetLeft ( ) const

Definition at line 272 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00273 {
00274     ASSERT(m_pBrowserApp != NULL);
00275
00276     long result;
00277     m_pBrowserApp->get_Left(&result);
00278     return result;
00279 }

CString CCJHtmlView::GetLocationName ( ) const

Definition at line 315 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00316 {
00317     ASSERT(m_pBrowserApp != NULL);
00318
00319     BSTR bstr;
00320     m_pBrowserApp->get_LocationName(&bstr);
00321     CString retVal(bstr);
00322     return retVal;
00323 }

CString CCJHtmlView::GetLocationURL ( ) const

Definition at line 325 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00326 {
00327     ASSERT(m_pBrowserApp != NULL);
00328
00329     BSTR bstr;
00330     m_pBrowserApp->get_LocationURL(&bstr);
00331     CString retVal(bstr);
00332     return retVal;
00333 }

BOOL CCJHtmlView::GetMenuBar ( ) const

Definition at line 417 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00418 {
00419     ASSERT(m_pBrowserApp != NULL);
00420
00421     VARIANT_BOOL result;
00422     m_pBrowserApp->get_MenuBar(&result);
00423     return result;
00424 }

BOOL CCJHtmlView::GetOffline ( ) const

Definition at line 353 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00354 {
00355     ASSERT(m_pBrowserApp != NULL);
00356
00357     VARIANT_BOOL result;
00358     m_pBrowserApp->get_Offline(&result);
00359     return result;
00360 }

LPDISPATCH CCJHtmlView::GetParentBrowser ( ) const

Definition at line 381 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00382 {
00383     ASSERT(m_pBrowserApp != NULL);
00384
00385     LPDISPATCH result;
00386     m_pBrowserApp->get_Parent(&result);
00387     return result;
00388 }

COleVariant CCJHtmlView::GetProperty ( LPCTSTR lpszProperty )

Definition at line 698 of file CJHtmlView.cpp.

References m_wndBrowser.

00699 {
00700     COleVariant result;
00701
00702     static BYTE parms[] =
00703         VTS_BSTR;
00704     m_wndBrowser.InvokeHelper(0x12f, DISPATCH_METHOD,
00705         VT_VARIANT, (void*)&result, parms, lpszProperty);
00706
00707     return result;
00708 }

BOOL CCJHtmlView::GetProperty | ( | LPCTSTR | lpszProperty,
 |  | CString & | strValue
 | ) |

Definition at line 675 of file CJHtmlView.cpp.

References ASSERT, FALSE, m_pBrowserApp, NULL, and TRUE.

00676 {
00677     ASSERT(m_pBrowserApp != NULL);
00678
00679     CString strProperty(lpszProperty);
00680     BSTR bstrProperty = strProperty.AllocSysString();
00681
00682     BOOL bResult = FALSE;
00683     VARIANT vReturn;
00684     vReturn.vt = VT_BSTR;
00685     vReturn.bstrVal = NULL;
00686     HRESULT hr = m_pBrowserApp->GetProperty(bstrProperty, &vReturn);
00687
00688     if (SUCCEEDED(hr))
00689     {
00690         strValue = CString(vReturn.bstrVal);
00691         bResult = TRUE;
00692     }
00693
00694     ::SysFreeString(bstrProperty);
00695     return bResult;
00696 }

READYSTATE CCJHtmlView::GetReadyState ( ) const

Definition at line 344 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00345 {
00346     ASSERT(m_pBrowserApp != NULL);
00347
00348     READYSTATE result;
00349     m_pBrowserApp->get_ReadyState(&result);
00350     return result;
00351 }

BOOL CCJHtmlView::GetRegisterAsBrowser ( ) const

Definition at line 461 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00462 {
00463     ASSERT(m_pBrowserApp != NULL);
00464
00465     VARIANT_BOOL result;
00466     m_pBrowserApp->get_RegisterAsBrowser(&result);
00467     return result;
00468 }

BOOL CCJHtmlView::GetRegisterAsDropTarget ( ) const

Definition at line 470 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00471 {
00472     ASSERT(m_pBrowserApp != NULL);
00473
00474     VARIANT_BOOL result;
00475     m_pBrowserApp->get_RegisterAsDropTarget(&result);
00476     return result;
00477 }

BOOL CCJHtmlView::GetSilent ( ) const

Definition at line 362 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00363 {
00364     ASSERT(m_pBrowserApp != NULL);
00365
00366     VARIANT_BOOL result;
00367     m_pBrowserApp->get_Silent(&result);
00368     return result;
00369 }

BOOL CCJHtmlView::GetStatusBar ( ) const

Definition at line 435 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00436 {
00437     ASSERT(m_pBrowserApp != NULL);
00438
00439     VARIANT_BOOL result;
00440     m_pBrowserApp->get_StatusBar(&result);
00441     return result;
00442 }

BOOL CCJHtmlView::GetTheaterMode ( ) const

Definition at line 479 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00480 {
00481     ASSERT(m_pBrowserApp != NULL);
00482
00483     VARIANT_BOOL result;
00484     m_pBrowserApp->get_TheaterMode(&result);
00485     return result;
00486 }

int CCJHtmlView::GetToolBar ( ) const

Definition at line 290 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00291 {
00292     ASSERT(m_pBrowserApp != NULL);
00293     int result;
00294     m_pBrowserApp->get_ToolBar(&result);
00295     return result;
00296 }

long CCJHtmlView::GetTop ( ) const

Definition at line 282 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00283 {
00284     ASSERT(m_pBrowserApp != NULL);
00285     long result;
00286     m_pBrowserApp->get_Top(&result);
00287     return result;
00288 }

BOOL CCJHtmlView::GetTopLevelContainer ( ) const

Definition at line 408 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00409 {
00410     ASSERT(m_pBrowserApp != NULL);
00411
00412     VARIANT_BOOL result;
00413     m_pBrowserApp->get_TopLevelContainer(&result);
00414     return result;
00415 }

CString CCJHtmlView::GetType ( ) const

Definition at line 262 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00263 {
00264     ASSERT(m_pBrowserApp != NULL);
00265
00266     BSTR bstr;
00267     m_pBrowserApp->get_Type(&bstr);
00268     CString retVal(bstr);
00269     return retVal;
00270 }

BOOL CCJHtmlView::GetVisible ( ) const

Definition at line 306 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00307 {
00308     ASSERT(m_pBrowserApp != NULL);
00309
00310     VARIANT_BOOL result;
00311     m_pBrowserApp->get_Visible(&result);
00312     return result;
00313 }

_CJXLIB_INLINE void CCJHtmlView::GoBack ( )

Definition at line 251 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00252     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoBack(); }

_CJXLIB_INLINE void CCJHtmlView::GoForward ( )

Definition at line 254 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00255     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoForward(); }

_CJXLIB_INLINE void CCJHtmlView::GoHome ( )

Definition at line 257 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00258     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoHome(); }

_CJXLIB_INLINE void CCJHtmlView::GoSearch ( )

Definition at line 260 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00261     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoSearch(); }

BOOL CCJHtmlView::LoadFromResource ( UINT nRes )

Definition at line 521 of file CJHtmlView.cpp.

References ASSERT, FALSE, Navigate, NULL, and TRUE.

00522 {
00523     HINSTANCE hInstance = AfxGetResourceHandle();
00524     ASSERT(hInstance != NULL);
00525
00526     CString strResourceURL;
00527     BOOL bRetVal = TRUE;
00528     LPTSTR lpszModule = new TCHAR[_MAX_PATH];
00529
00530     if (GetModuleFileName(hInstance, lpszModule, _MAX_PATH))
00531     {
00532         strResourceURL.Format(_T("res://%s/%d"), lpszModule, nRes);
00533         Navigate(strResourceURL, 0, 0, 0);
00534     }
00535     else
00536         bRetVal = FALSE;
00537
00538     delete [] lpszModule;
00539     return bRetVal;
00540 }

BOOL CCJHtmlView::LoadFromResource ( LPCTSTR lpszResource )

Definition at line 500 of file CJHtmlView.cpp.

References ASSERT, FALSE, Navigate, NULL, and TRUE.

00501 {
00502     HINSTANCE hInstance = AfxGetResourceHandle();
00503     ASSERT(hInstance != NULL);
00504
00505     CString strResourceURL;
00506     BOOL bRetVal = TRUE;
00507     LPTSTR lpszModule = new TCHAR[_MAX_PATH];
00508
00509     if (GetModuleFileName(hInstance, lpszModule, _MAX_PATH))
00510     {
00511         strResourceURL.Format(_T("res://%s/%s"), lpszModule, lpszResource);
00512         Navigate(strResourceURL, 0, 0, 0);
00513     }
00514     else
00515         bRetVal = FALSE;
00516
00517     delete [] lpszModule;
00518     return bRetVal;
00519 }

void CCJHtmlView::Navigate | ( | LPCTSTR | URL,
 |  | DWORD | dwFlags = 0,
 |  | LPCTSTR | lpszTargetFrameName = NULL,
 |  | LPCTSTR | lpszHeaders = NULL,
 |  | LPVOID | lpvPostData = NULL,
 |  | DWORD | dwPostDataLen = 0
 | ) |

Definition at line 542 of file CJHtmlView.cpp.

References m_pBrowserApp, and NULL.

Referenced by LoadFromResource.

00546 {
00547     CString strURL(lpszURL);
00548     BSTR bstrURL = strURL.AllocSysString();
00549
00550     COleSafeArray vPostData;
00551     if (lpvPostData != NULL)
00552     {
00553         if (dwPostDataLen == 0)
00554             dwPostDataLen = lstrlen((LPCTSTR) lpvPostData);
00555
00556         vPostData.CreateOneDim(VT_UI1, dwPostDataLen, lpvPostData);
00557     }
00558
00559     m_pBrowserApp->Navigate(bstrURL,
00560         COleVariant((long) dwFlags, VT_I4),
00561         COleVariant(lpszTargetFrameName, VT_BSTR),
00562         vPostData,
00563         COleVariant(lpszHeaders, VT_BSTR));
00564 }

void CCJHtmlView::Navigate2 | ( | LPCTSTR | lpszURL,
 |  | DWORD | dwFlags,
 |  | CByteArray & | baPostedData,
 |  | LPCTSTR | lpszTargetFrameName = NULL,
 |  | LPCTSTR | lpszHeader = NULL
 | ) |

Definition at line 647 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00650 {
00651     ASSERT(m_pBrowserApp != NULL);
00652
00653     COleVariant vPostData = baPostData;
00654     COleVariant vURL(lpszURL, VT_BSTR);
00655     COleVariant vHeaders(lpszHeaders, VT_BSTR);
00656     COleVariant vTargetFrameName(lpszTargetFrameName, VT_BSTR);
00657     COleVariant vFlags((long) dwFlags, VT_I4);
00658
00659     ASSERT(m_pBrowserApp != NULL);
00660
00661     m_pBrowserApp->Navigate2(vURL, vFlags, vTargetFrameName,
00662         vPostData, vHeaders);
00663 }

void CCJHtmlView::Navigate2 | ( | LPCTSTR | lpszURL,
 |  | DWORD | dwFlags = 0,
 |  | LPCTSTR | lpszTargetFrameName = NULL,
 |  | LPCTSTR | lpszHeaders = NULL,
 |  | LPVOID | lpvPostData = NULL,
 |  | DWORD | dwPostDataLen = 0
 | ) |

Definition at line 622 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00626 {
00627     ASSERT(m_pBrowserApp != NULL);
00628
00629     COleSafeArray vPostData;
00630     if (lpvPostData != NULL)
00631     {
00632         if (dwPostDataLen == 0)
00633             dwPostDataLen = lstrlen((LPCTSTR) lpvPostData);
00634
00635         vPostData.CreateOneDim(VT_UI1, dwPostDataLen, lpvPostData);
00636     }
00637
00638     COleVariant vURL(lpszURL, VT_BSTR);
00639     COleVariant vHeaders(lpszHeaders, VT_BSTR);
00640     COleVariant vTargetFrameName(lpszTargetFrameName, VT_BSTR);
00641     COleVariant vFlags((long) dwFlags, VT_I4);
00642
00643     m_pBrowserApp->Navigate2(vURL,
00644         vFlags, vTargetFrameName, vPostData, vHeaders);
00645 }

void CCJHtmlView::Navigate2 | ( | LPITEMIDLIST | pIDL,
 |  | DWORD | dwFlags = 0,
 |  | LPCTSTR | lpszTargetFrameName = NULL
 | ) |

Definition at line 603 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, MakeOleVariant, and NULL.

00605 {
00606     ASSERT(m_pBrowserApp != NULL);
00607
00608 #ifdef _VC_VERSION_5
00609     COleVariant vPIDL;
00610     MakeOleVariant(vPIDL, pIDL);
00611 #else
00612     COleVariant vPIDL(pIDL);
00613 #endif
00614     COleVariant empty;
00615
00616     m_pBrowserApp->Navigate2(vPIDL,
00617         COleVariant((long) dwFlags, VT_I4),
00618         COleVariant(lpszTargetFrameName, VT_BSTR),
00619         empty, empty);
00620 }

void CCJHtmlView::NavigateComplete2 | ( | LPDISPATCH | pDisp,
 |  | VARIANT * | URL
 | ) | [protected, virtual]

Definition at line 723 of file CJHtmlView.cpp.

References ASSERT, and OnNavigateComplete2.

00724 {
00725     ASSERT(V_VT(URL) == VT_BSTR);
00726
00727     USES_CONVERSION;
00728
00729     CString str = OLE2T(V_BSTR(URL));
00730     OnNavigateComplete2(str);
00731 }

void CCJHtmlView::OnBeforeNavigate2 | ( | LPCTSTR | lpszURL,
 |  | DWORD | nFlags,
 |  | LPCTSTR | lpszTargetFrameName,
 |  | CByteArray & | baPostedData,
 |  | LPCTSTR | lpszHeaders,
 |  | BOOL * | pbCancel
 | ) | [virtual]

Definition at line 887 of file CJHtmlView.cpp.

References FALSE.

Referenced by BeforeNavigate2.

00890 {
00891     // default to continuing
00892     bCancel = FALSE;
00893
00894     // user will override to handle this notification
00895     UNUSED_ALWAYS(lpszURL);
00896     UNUSED_ALWAYS(nFlags);
00897     UNUSED_ALWAYS(lpszTargetFrameName);
00898     UNUSED_ALWAYS(baPostData);
00899     UNUSED_ALWAYS(lpszHeaders);
00900 }

void CCJHtmlView::OnCommandStateChange | ( | long | nCommand,
 |  | BOOL | bEnable
 | ) | [virtual]

Definition at line 796 of file CJHtmlView.cpp.

00797 {
00798     // user will override to handle this notification
00799     UNUSED_ALWAYS(lCommand);
00800     UNUSED_ALWAYS(bEnable);
00801 }

void CCJHtmlView::OnDestroy ( ) [protected]

Definition at line 191 of file CJHtmlView.cpp.

References m_pBrowserApp, and RELEASE.

00192 {
00193     RELEASE(m_pBrowserApp);
00194 }

void CCJHtmlView::OnDocumentComplete ( LPCTSTR lpszURL ) [virtual]

Definition at line 834 of file CJHtmlView.cpp.

Referenced by DocumentComplete.

00835 {
00836     // user will override to handle this notification
00837     UNUSED_ALWAYS(lpszURL);
00838 }

void CCJHtmlView::OnDownloadBegin ( ) [virtual]

Definition at line 803 of file CJHtmlView.cpp.

00804 {
00805     // user will override to handle this notification
00806 }

void CCJHtmlView::OnDownloadComplete ( ) [virtual]

Definition at line 808 of file CJHtmlView.cpp.

00809 {
00810     // user will override to handle this notification
00811 }

void CCJHtmlView::OnDraw ( CDC * pDC ) [virtual]

Definition at line 138 of file CJHtmlView.cpp.

References ASSERT, and FALSE.

00139 {
00140     // this class should never do its own drawing;
00141     // the browser control should handle everything
00142
00143     ASSERT(FALSE);
00144 }

BOOL CCJHtmlView::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 914 of file CJHtmlView.cpp.

00915 {
00916     CRect rectClient;
00917     GetClientRect( &rectClient );
00918     pDC->ExcludeClipRect( &rectClient );
00919     return CFormView::OnEraseBkgnd(pDC);
00920 }

void CCJHtmlView::OnFilePrint ( ) [protected]

Definition at line 149 of file CJHtmlView.cpp.

References GetHtmlDocument, m_pBrowserApp, and NULL.

00150 {
00151     // get the HTMLDocument
00152
00153     if (m_pBrowserApp != NULL)
00154     {
00155         LPOLECOMMANDTARGET lpTarget = NULL;
00156         LPDISPATCH lpDisp = GetHtmlDocument();
00157
00158         if (lpDisp != NULL)
00159         {
00160             // the control will handle all printing UI
00161
00162             if (SUCCEEDED(lpDisp->QueryInterface(IID_IOleCommandTarget,
00163                     (LPVOID*) &lpTarget)))
00164             {
00165                 lpTarget->Exec(NULL, OLECMDID_PRINT, 0, NULL, NULL);
00166                 lpTarget->Release();
00167             }
00168             lpDisp->Release();
00169         }
00170     }
00171 }

void CCJHtmlView::OnFullScreen ( BOOL bFullScreen ) [virtual]

Definition at line 869 of file CJHtmlView.cpp.

00870 {
00871     // user will override to handle this notification
00872     UNUSED_ALWAYS(bFullScreen);
00873 }

void CCJHtmlView::OnMenuBar ( BOOL bMenuBar ) [virtual]

Definition at line 857 of file CJHtmlView.cpp.

00858 {
00859     // user will override to handle this notification
00860     UNUSED_ALWAYS(bMenuBar);
00861 }

void CCJHtmlView::OnNavigateComplete2 ( LPCTSTR strURL ) [virtual]

Definition at line 881 of file CJHtmlView.cpp.

Referenced by NavigateComplete2.

00882 {
00883     // user will override to handle this notification
00884     UNUSED_ALWAYS(lpszURL);
00885 }

void CCJHtmlView::OnNewWindow2 | ( | LPDISPATCH * | ppDisp,
 |  | BOOL * | Cancel
 | ) | [virtual]

Definition at line 825 of file CJHtmlView.cpp.

References FALSE.

00826 {
00827     // default to continuing
00828     bCancel = FALSE;
00829
00830     // user will override to handle this notification
00831     UNUSED_ALWAYS(ppDisp);
00832 }

void CCJHtmlView::OnPaint ( ) [protected]

Definition at line 212 of file CJHtmlView.cpp.

00213 {
00214     Default();
00215 }

void CCJHtmlView::OnProgressChange | ( | long | nProgress,
 |  | long | nProgressMax
 | ) | [virtual]

Definition at line 789 of file CJHtmlView.cpp.

00790 {
00791     // user will override to handle this notification
00792     UNUSED_ALWAYS(lProgress);
00793     UNUSED_ALWAYS(lProgressMax);
00794 }

void CCJHtmlView::OnPropertyChange ( LPCTSTR lpszProperty ) [virtual]

Definition at line 819 of file CJHtmlView.cpp.

00820 {
00821     // user will override to handle this notification
00822     UNUSED_ALWAYS(lpszProperty);
00823 }

void CCJHtmlView::OnQuit ( ) [virtual]

Definition at line 840 of file CJHtmlView.cpp.

00841 {
00842     // user will override to handle this notification
00843 }

void CCJHtmlView::OnSize | ( | UINT | nType,
 |  | int | cx,
 |  | int | cy
 | ) | [protected]

Definition at line 196 of file CJHtmlView.cpp.

References FALSE, m_wndBrowser, and NULL.

00197 {
00198     CFormView::OnSize(nType, cx, cy);
00199
00200     if (::IsWindow(m_wndBrowser.m_hWnd))
00201     {
00202         // need to push non-client borders out of the client area
00203         CRect rect;
00204         GetClientRect(rect);
00205         ::AdjustWindowRectEx(rect,
00206             m_wndBrowser.GetStyle(), FALSE, WS_EX_CLIENTEDGE);
00207         m_wndBrowser.SetWindowPos(NULL, rect.left, rect.top,
00208             rect.Width(), rect.Height(), SWP_NOACTIVATE | SWP_NOZORDER);
00209     }
00210 }

void CCJHtmlView::OnStatusBar ( BOOL bStatusBar ) [virtual]

Definition at line 863 of file CJHtmlView.cpp.

00864 {
00865     // user will override to handle this notification
00866     UNUSED_ALWAYS(bStatusBar);
00867 }

void CCJHtmlView::OnStatusTextChange ( LPCTSTR lpszText ) [virtual]

Definition at line 902 of file CJHtmlView.cpp.

References NULL.

00903 {
00904     // try to set the status bar text via the frame
00905
00906     CFrameWnd* pFrame = GetParentFrame();
00907     if (pFrame != NULL)
00908         pFrame->SetMessageText(pszText);
00909 }

void CCJHtmlView::OnTheaterMode ( BOOL bTheaterMode ) [virtual]

Definition at line 875 of file CJHtmlView.cpp.

00876 {
00877     // user will override to handle this notification
00878     UNUSED_ALWAYS(bTheaterMode);
00879 }

void CCJHtmlView::OnTitleChange ( LPCTSTR lpszText ) [virtual]

Definition at line 813 of file CJHtmlView.cpp.

00814 {
00815     // user will override to handle this notification
00816     UNUSED_ALWAYS(lpszText);
00817 }

void CCJHtmlView::OnToolBar ( BOOL bToolBar ) [virtual]

Definition at line 851 of file CJHtmlView.cpp.

00852 {
00853     // user will override to handle this notification
00854     UNUSED_ALWAYS(bToolBar);
00855 }

void CCJHtmlView::OnVisible ( BOOL bVisible ) [virtual]

Definition at line 845 of file CJHtmlView.cpp.

00846 {
00847     // user will override to handle this notification
00848     UNUSED_ALWAYS(bVisible);
00849 }

_CJXLIB_INLINE void CCJHtmlView::PutProperty | ( | LPCTSTR | lpszPropertyName,
 |  | short | nValue
 | ) |

Definition at line 284 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, NULL, and PutProperty.

00285     { ASSERT(m_pBrowserApp != NULL); ASSERT(m_pBrowserApp != NULL); PutProperty(lpszPropertyName, COleVariant(nValue, VT_UI2)); }

_CJXLIB_INLINE void CCJHtmlView::PutProperty | ( | LPCTSTR | lpszPropertyName,
 |  | long | lValue
 | ) |

Definition at line 281 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, NULL, and PutProperty.

00282     { ASSERT(m_pBrowserApp != NULL); ASSERT(m_pBrowserApp != NULL); PutProperty(lpszPropertyName, COleVariant(lValue, VT_UI4)); }

_CJXLIB_INLINE void CCJHtmlView::PutProperty | ( | LPCTSTR | lpszPropertyName,
 |  | LPCTSTR | lpszValue
 | ) |

Definition at line 287 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, NULL, and PutProperty.

00288     { ASSERT(m_pBrowserApp != NULL); ASSERT(m_pBrowserApp != NULL); PutProperty(lpszPropertyName, COleVariant(lpszValue, VT_BSTR)); }

_CJXLIB_INLINE void CCJHtmlView::PutProperty | ( | LPCTSTR | lpszPropertyName,
 |  | double | dValue
 | ) |

Definition at line 290 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, NULL, and PutProperty.

00291     { ASSERT(m_pBrowserApp != NULL); ASSERT(m_pBrowserApp != NULL); PutProperty(lpszPropertyName, COleVariant(dValue)); }

void CCJHtmlView::PutProperty | ( | LPCTSTR | lpszProperty,
 |  | const VARIANT & | vtValue
 | ) |

Definition at line 665 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

Referenced by PutProperty.

00666 {
00667     ASSERT(m_pBrowserApp != NULL);
00668
00669     CString strProp(lpszProperty);
00670     BSTR bstrProp = strProp.AllocSysString();
00671     m_pBrowserApp->PutProperty(bstrProp, vtValue);
00672     ::SysFreeString(bstrProp);
00673 }

OLECMDF CCJHtmlView::QueryStatusWB ( OLECMDID cmdID ) const

Definition at line 444 of file CJHtmlView.cpp.

References ASSERT, m_pBrowserApp, and NULL.

00445 {
00446     ASSERT(m_pBrowserApp != NULL);
00447
00448     OLECMDF result;
00449     m_pBrowserApp->QueryStatusWB(cmdID, &result);
00450     return result;
00451 }

_CJXLIB_INLINE void CCJHtmlView::Refresh ( )

Definition at line 263 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00264     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->Refresh(); }

_CJXLIB_INLINE void CCJHtmlView::Refresh2 ( int nLevel )

Definition at line 266 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00267     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->Refresh2(COleVariant((long) nLevel, VT_I4)); }

_CJXLIB_INLINE void CCJHtmlView::SetAddressBar ( BOOL bNewValue )

Definition at line 275 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00276     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_AddressBar((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }

_CJXLIB_INLINE void CCJHtmlView::SetFullScreen ( BOOL bNewValue )

Definition at line 272 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00273     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_FullScreen((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }

_CJXLIB_INLINE void CCJHtmlView::SetHeight ( long nNewValue )

Definition at line 278 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00279     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Height(nNewValue); }

_CJXLIB_INLINE void CCJHtmlView::SetLeft ( long nNewValue )

Definition at line 296 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00297     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Left(nNewValue); }

_CJXLIB_INLINE void CCJHtmlView::SetMenuBar ( BOOL bNewValue )

Definition at line 239 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00240     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_MenuBar((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }

_CJXLIB_INLINE void CCJHtmlView::SetOffline ( BOOL bNewValue )

Definition at line 245 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00246     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Offline((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }

_CJXLIB_INLINE void CCJHtmlView::SetRegisterAsBrowser ( BOOL bNewValue )

Definition at line 227 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00228     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_RegisterAsBrowser((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }

_CJXLIB_INLINE void CCJHtmlView::SetRegisterAsDropTarget ( BOOL bNewValue )

Definition at line 230 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00231     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_RegisterAsDropTarget((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }

_CJXLIB_INLINE void CCJHtmlView::SetSilent ( BOOL bNewValue )

Definition at line 248 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00249     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Silent((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }

_CJXLIB_INLINE void CCJHtmlView::SetStatusBar ( BOOL bNewValue )

Definition at line 299 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00300     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_StatusBar((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }

_CJXLIB_INLINE void CCJHtmlView::SetTheaterMode ( BOOL bNewValue )

Definition at line 233 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00234     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_TheaterMode((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }

_CJXLIB_INLINE void CCJHtmlView::SetToolBar ( int nNewValue )

Definition at line 242 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00243     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_ToolBar(nNewValue); }

_CJXLIB_INLINE void CCJHtmlView::SetTop ( long nNewValue )

Definition at line 293 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00294     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Top(nNewValue); }

_CJXLIB_INLINE void CCJHtmlView::SetVisible ( BOOL bNewValue )

Definition at line 236 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00237     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Visible((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); }

_CJXLIB_INLINE void CCJHtmlView::Stop ( )

Definition at line 269 of file CJHtmlView.h.

References ASSERT, m_pBrowserApp, and NULL.

00270     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->Stop(); }

Member Data Documentation

IWebBrowser2* CCJHtmlView::m_pBrowserApp [protected]

Definition at line 209 of file CJHtmlView.h.

Referenced by CCJHtmlView, Create, ExecWB, GetAddressBar, GetApplication, GetBusy, GetContainer, GetFullName, GetFullScreen, GetHeight, GetHtmlDocument, GetLeft, GetLocationName, GetLocationURL, GetMenuBar, GetOffline, GetParentBrowser, GetProperty, GetReadyState, GetRegisterAsBrowser, GetRegisterAsDropTarget, GetSilent, GetStatusBar, GetTheaterMode, GetToolBar, GetTop, GetTopLevelContainer, GetType, GetVisible, GoBack, GoForward, GoHome, GoSearch, Navigate, Navigate2, OnDestroy, OnFilePrint, PutProperty, QueryStatusWB, Refresh, Refresh2, SetAddressBar, SetFullScreen, SetHeight, SetLeft, SetMenuBar, SetOffline, SetRegisterAsBrowser, SetRegisterAsDropTarget, SetSilent, SetStatusBar, SetTheaterMode, SetToolBar, SetTop, SetVisible, Stop, and ~CCJHtmlView.

CWnd CCJHtmlView::m_wndBrowser

Definition at line 200 of file CJHtmlView.h.

Referenced by Create, GetProperty, and OnSize.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJHtmlView.h
  • WinCvs/CJLib/CJLibrary/CJHtmlView.cpp
Generated on Sun Feb 24 01:24:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJHyperLink Class Reference

#include <CJHyperLink.h>

Inheritance diagram for CCJHyperLink:

[legend]
Collaboration diagram for CCJHyperLink:

[legend]
List of all members.

Public Methods

CCJHyperLink ()
virtual | ~CCJHyperLink ()
virtual void | SetURL (CString strURL)
virtual CString | GetURL () const
virtual void | SetColors (COLORREF crLinkColor, COLORREF crVisitedColor, COLORREF crHoverColor=-1)
virtual COLORREF | GetLinkColor () const
virtual COLORREF | GetVisitedColor () const
virtual COLORREF | GetHoverColor () const
virtual void | SetVisited (BOOL bVisited=TRUE)
virtual BOOL | GetVisited () const
virtual void | SetLinkCursor (HCURSOR hCursor)
virtual HCURSOR | GetLinkCursor () const
virtual void | SetUnderline (BOOL bUnderline=TRUE)
virtual BOOL | GetUnderline () const
virtual void | SetAutoSize (BOOL bAutoSize=TRUE)
virtual BOOL | GetAutoSize () const
virtual HINSTANCE | GotoURL (LPCTSTR url, int showcmd)
virtual BOOL | PreTranslateMessage (MSG *pMsg)

Protected Methods

virtual void | PreSubclassWindow ()
virtual void | ReportError (int nError)
virtual LONG | GetRegKey (HKEY key, LPCTSTR subkey, LPTSTR retdata)
virtual void | PositionWindow ()
virtual void | SetDefaultCursor ()
afx_msg HBRUSH | CtlColor (CDC *pDC, UINT nCtlColor)
afx_msg BOOL | OnSetCursor (CWnd *pWnd, UINT nHitTest, UINT message)
afx_msg void | OnMouseMove (UINT nFlags, CPoint point)
afx_msg void | OnClicked ()

Protected Attributes

COLORREF | m_crLinkColor
COLORREF | m_crVisitedColor
COLORREF | m_crHoverColor
BOOL | m_bOverControl
BOOL | m_bVisited
BOOL | m_bUnderline
BOOL | m_bAdjustToFit
CString | m_strURL
CFont | m_Font
HCURSOR | m_hLinkCursor
CToolTipCtrl | m_ToolTip

Constructor & Destructor Documentation

CCJHyperLink::CCJHyperLink ( )

Definition at line 55 of file CJHyperLink.cpp.

References FALSE, m_bAdjustToFit, m_bOverControl, m_bUnderline, m_bVisited, m_crHoverColor, m_crLinkColor, m_crVisitedColor, m_hLinkCursor, m_strURL, NULL, and TRUE.

00056 {
00057     m_hLinkCursor       = NULL;                 // No cursor as yet
00058     m_crLinkColor      = RGB(  0,   0, 238);   // Blue
00059     m_crVisitedColor   = RGB( 85,  26, 139);   // Purple
00060     m_crHoverColor     = ::GetSysColor(COLOR_HIGHLIGHT);
00061     m_bOverControl      = FALSE;                // Cursor not yet over control
00062     m_bVisited          = FALSE;                // Hasn't been visited yet.
00063     m_bUnderline        = TRUE;                 // Underline the link?
00064     m_bAdjustToFit      = TRUE;                 // Resize the window to fit the text?
00065     m_strURL.Empty();
00066 }

CCJHyperLink::~CCJHyperLink ( ) [virtual]

Definition at line 68 of file CJHyperLink.cpp.

References m_Font, and m_hLinkCursor.

00069 {
00070     m_Font.DeleteObject();
00071     if (m_hLinkCursor) {
00072         DestroyCursor(m_hLinkCursor);
00073     }
00074 }

Member Function Documentation

HBRUSH CCJHyperLink::CtlColor | ( | CDC * | pDC,
 |  | UINT | nCtlColor
 | ) | [protected]

Definition at line 105 of file CJHyperLink.cpp.

References ASSERT, m_crHoverColor, m_crLinkColor, and m_crVisitedColor.

00106 {
00107 #ifdef _DEBUG
00108     ASSERT(nCtlColor == CTLCOLOR_STATIC);
00109 #else
00110     UNUSED_ALWAYS( nCtlColor );
00111 #endif
00112
00113     if (m_bOverControl)
00114         pDC->SetTextColor(m_crHoverColor);
00115     else if (m_bVisited)
00116         pDC->SetTextColor(m_crVisitedColor);
00117     else
00118         pDC->SetTextColor(m_crLinkColor);
00119
00120     // transparent text.
00121     pDC->SetBkMode(TRANSPARENT);
00122     return (HBRUSH)GetStockObject(NULL_BRUSH);
00123 }

BOOL CCJHyperLink::GetAutoSize ( ) const [virtual]

Definition at line 301 of file CJHyperLink.cpp.

References m_bAdjustToFit.

00302 {
00303     return m_bAdjustToFit;
00304 }

COLORREF CCJHyperLink::GetHoverColor ( ) const [virtual]

Definition at line 240 of file CJHyperLink.cpp.

References m_crHoverColor.

00241 {
00242     return m_crHoverColor;
00243 }

COLORREF CCJHyperLink::GetLinkColor ( ) const [virtual]

Definition at line 230 of file CJHyperLink.cpp.

References m_crLinkColor.

00231 {
00232     return m_crLinkColor;
00233 }

HCURSOR CCJHyperLink::GetLinkCursor ( ) const [virtual]

Definition at line 265 of file CJHyperLink.cpp.

References m_hLinkCursor.

00266 {
00267     return m_hLinkCursor;
00268 }

LONG CCJHyperLink::GetRegKey | ( | HKEY | key,
 |  | LPCTSTR | subkey,
 |  | LPTSTR | retdata
 | ) | [protected, virtual]

Definition at line 384 of file CJHyperLink.cpp.

References MAX_PATH, and NULL.

Referenced by GotoURL.

00385 {
00386     HKEY hkey;
00387     LONG retval = RegOpenKeyEx(key, subkey, 0, KEY_QUERY_VALUE, &hkey);
00388
00389     if (retval == ERROR_SUCCESS) {
00390         long datasize = MAX_PATH;
00391         TCHAR data[MAX_PATH];
00392         RegQueryValue(hkey, NULL, data, &datasize);
00393         _tcscpy(retdata,data);
00394         RegCloseKey(hkey);
00395     }
00396
00397     return retval;
00398 }

BOOL CCJHyperLink::GetUnderline ( ) const [virtual]

Definition at line 288 of file CJHyperLink.cpp.

References m_bUnderline.

00289 {
00290     return m_bUnderline;
00291 }

CString CCJHyperLink::GetURL ( ) const [virtual]

Definition at line 210 of file CJHyperLink.cpp.

References m_strURL.

00211 {
00212     return m_strURL;
00213 }

BOOL CCJHyperLink::GetVisited ( ) const [virtual]

Definition at line 253 of file CJHyperLink.cpp.

References m_bVisited.

00254 {
00255     return m_bVisited;
00256 }

COLORREF CCJHyperLink::GetVisitedColor ( ) const [virtual]

Definition at line 235 of file CJHyperLink.cpp.

References m_crVisitedColor.

00236 {
00237     return m_crVisitedColor;
00238 }

HINSTANCE CCJHyperLink::GotoURL | ( | LPCTSTR | url,
 |  | int | showcmd
 | ) | [virtual]

Definition at line 423 of file CJHyperLink.cpp.

References FALSE, GetRegKey, MAX_PATH, and NULL.

Referenced by OnClicked.

00424 {
00425     TCHAR key[MAX_PATH + MAX_PATH];
00426
00427     // First try ShellExecute()
00428     HINSTANCE result = ShellExecute( NULL, _T("open"), url, NULL, NULL, showcmd );
00429
00430     // If it failed, get the .htm regkey and lookup the program
00431     if((UINT)result <= HINSTANCE_ERROR)
00432     {
00433         if( GetRegKey( HKEY_CLASSES_ROOT, _T(".htm"), key ) == ERROR_SUCCESS )
00434         {
00435             lstrcat( key, _T("\\shell\\open\\command"));
00436
00437             if( GetRegKey( HKEY_CLASSES_ROOT, key, key ) == ERROR_SUCCESS )
00438             {
00439                 LPTSTR pos;
00440
00441                 pos = _tcsstr(key, _T("\"%1\""));
00442
00443                 if( pos == NULL )                       // No quotes found
00444                 {
00445                     pos = _tcsstr( key, _T("%1"));      // Check for %1, without quotes
00446
00447                     if( pos == NULL )                   // No parameter at all...
00448                     {
00449                         pos = key + _tcslen( key ) - 1;
00450                     }
00451                     else
00452                     {
00453                         *pos = _T('\0');                // Remove the parameter
00454                     }
00455                 }
00456                 else
00457                 {
00458                     *pos = _T('\0');                    // Remove the parameter
00459                 }
00460
00461                 lstrcat( pos, _T(" "));
00462                 lstrcat( pos, url );
00463
00464                 PROCESS_INFORMATION pi;
00465
00466                 STARTUPINFO         si;
00467
00468                 ::ZeroMemory( &si, sizeof( si ));
00469
00470                 si.cb = sizeof( si );
00471
00472                 if( ::CreateProcess( NULL,
00473                                      pos,
00474                                      NULL,
00475                                      NULL,
00476                                      FALSE,
00477                                      0,
00478                                      NULL,
00479                                      NULL,
00480                                      &si,
00481                                     &pi ) == FALSE )
00482                 {
00483                     return NULL;
00484                 }
00485
00486                 result = (HINSTANCE) pi.hProcess;
00487             }
00488         }
00489     }
00490
00491     return result;
00492 }

void CCJHyperLink::OnClicked ( ) [protected]

Definition at line 94 of file CJHyperLink.cpp.

References GotoURL, m_bVisited, m_strURL, ReportError, and SetVisited.

00095 {
00096     int result = (int)GotoURL(m_strURL, SW_SHOW);
00097     m_bVisited = (result > HINSTANCE_ERROR);
00098     if (!m_bVisited) {
00099         MessageBeep(MB_ICONEXCLAMATION);     // Unable to follow link
00100         ReportError(result);
00101     } else
00102         SetVisited();                        // Repaint to show visited Color
00103 }

void CCJHyperLink::OnMouseMove | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 125 of file CJHyperLink.cpp.

References FALSE, m_bOverControl, and TRUE.

00126 {
00127     CStatic::OnMouseMove(nFlags, point);
00128
00129     if (m_bOverControl)        // Cursor is currently over control
00130     {
00131         CRect rect;
00132         GetClientRect(rect);
00133
00134         if (!rect.PtInRect(point))
00135         {
00136             m_bOverControl = FALSE;
00137             ReleaseCapture();
00138             RedrawWindow();
00139             return;
00140         }
00141     }
00142     else                      // Cursor has just moved over control
00143     {
00144         m_bOverControl = TRUE;
00145         RedrawWindow();
00146         SetCapture();
00147     }
00148 }

BOOL CCJHyperLink::OnSetCursor | ( | CWnd * | pWnd,
 |  | UINT | nHitTest,
 |  | UINT | message
 | ) | [protected]

Definition at line 150 of file CJHyperLink.cpp.

References FALSE, and TRUE.

00151 {
00152     if (m_hLinkCursor)
00153     {
00154         ::SetCursor(m_hLinkCursor);
00155         return TRUE;
00156     }
00157     return FALSE;
00158 }

void CCJHyperLink::PositionWindow ( ) [protected, virtual]

Definition at line 315 of file CJHyperLink.cpp.

References m_bAdjustToFit, m_Font, and NULL.

Referenced by PreSubclassWindow, SetAutoSize, and SetURL.

00316 {
00317     if (!::IsWindow(GetSafeHwnd()) || !m_bAdjustToFit)
00318         return;
00319
00320     // Get the current window position
00321     CRect rect;
00322     GetWindowRect(rect);
00323
00324     CWnd* pParent = GetParent();
00325     if (pParent)
00326         pParent->ScreenToClient(rect);
00327
00328     // Get the size of the window text
00329     CString strWndText;
00330     GetWindowText(strWndText);
00331
00332     CDC* pDC = GetDC();
00333     CFont* pOldFont = pDC->SelectObject(&m_Font);
00334     CSize Extent = pDC->GetTextExtent(strWndText);
00335     pDC->SelectObject(pOldFont);
00336     ReleaseDC(pDC);
00337
00338     // Get the text justification via the window style
00339     DWORD dwStyle = GetStyle();
00340
00341     // Recalc the window size and position based on the text justification
00342     if (dwStyle & SS_CENTERIMAGE)
00343         rect.DeflateRect(0, (rect.Height() - Extent.cy)/2);
00344     else
00345         rect.bottom = rect.top + Extent.cy;
00346
00347     if (dwStyle & SS_CENTER)
00348         rect.DeflateRect((rect.Width() - Extent.cx)/2, 0);
00349     else if (dwStyle & SS_RIGHT)
00350         rect.left  = rect.right - Extent.cx;
00351     else // SS_LEFT = 0, so we can't test for it explicitly
00352         rect.right = rect.left + Extent.cx;
00353
00354     // Move the window
00355     SetWindowPos(NULL, rect.left, rect.top, rect.Width(), rect.Height(), SWP_NOZORDER);
00356 }

void CCJHyperLink::PreSubclassWindow ( ) [protected, virtual]

Definition at line 160 of file CJHyperLink.cpp.

References ASSERT, m_bUnderline, m_Font, m_strURL, m_ToolTip, PositionWindow, SetDefaultCursor, and TOOLTIP_ID.

00161 {
00162     // We want to get mouse clicks via STN_CLICKED
00163     DWORD dwStyle = GetStyle();
00164     ::SetWindowLong(GetSafeHwnd(), GWL_STYLE, dwStyle | SS_NOTIFY);
00165
00166     // Set the URL as the window text
00167     if (m_strURL.IsEmpty())
00168         GetWindowText(m_strURL);
00169
00170     // Check that the window text isn't empty. If it is, set it as the URL.
00171     CString strWndText;
00172     GetWindowText(strWndText);
00173     if (strWndText.IsEmpty()) {
00174         ASSERT(!m_strURL.IsEmpty());    // Window and URL both NULL. DUH!
00175         SetWindowText(m_strURL);
00176     }
00177
00178     // Create the font
00179     LOGFONT lf;
00180     GetFont()->GetLogFont(&lf);
00181     lf.lfUnderline = (char)m_bUnderline;
00182     m_Font.CreateFontIndirect(&lf);
00183     SetFont(&m_Font);
00184
00185     PositionWindow();        // Adjust size of window to fit URL if necessary
00186     SetDefaultCursor();      // Try and load up a "hand" cursor
00187
00188     // Create the tooltip
00189     CRect rect;
00190     GetClientRect(rect);
00191     m_ToolTip.Create(this);
00192     m_ToolTip.AddTool(this, m_strURL, rect, TOOLTIP_ID);
00193
00194     CStatic::PreSubclassWindow();
00195 }

BOOL CCJHyperLink::PreTranslateMessage ( MSG * pMsg ) [virtual]

Definition at line 88 of file CJHyperLink.cpp.

References m_ToolTip.

00089 {
00090     m_ToolTip.RelayEvent(pMsg);
00091     return CStatic::PreTranslateMessage(pMsg);
00092 }

void CCJHyperLink::ReportError ( int nError ) [protected, virtual]

Definition at line 400 of file CJHyperLink.cpp.

Referenced by OnClicked.

00401 {
00402     CString str;
00403     switch (nError) {
00404         case 0:                       str = _T("The operating system is out\nof memory or resources."); break;
00405         case SE_ERR_PNF:              str = _T("The specified path was not found."); break;
00406         case SE_ERR_FNF:              str = _T("The specified file was not found."); break;
00407         case ERROR_BAD_FORMAT:        str = _T("The .EXE file is invalid\n(non-Win32 .EXE or error in .EXE image)."); break;
00408         case SE_ERR_ACCESSDENIED:     str = _T("The operating system denied\naccess to the specified file."); break;
00409         case SE_ERR_ASSOCINCOMPLETE:  str = _T("The filename association is\nincomplete or invalid."); break;
00410         case SE_ERR_DDEBUSY:          str = _T("The DDE transaction could not\nbe completed because other DDE transactions\nwere being processed."); break;
00411         case SE_ERR_DDEFAIL:          str = _T("The DDE transaction failed."); break;
00412         case SE_ERR_DDETIMEOUT:       str = _T("The DDE transaction could not\nbe completed because the request timed out."); break;
00413         case SE_ERR_DLLNOTFOUND:      str = _T("The specified dynamic-link library was not found."); break;
00414         case SE_ERR_NOASSOC:          str = _T("There is no application associated\nwith the given filename extension."); break;
00415         case SE_ERR_OOM:              str = _T("There was not enough memory to complete the operation."); break;
00416         case SE_ERR_SHARE:            str = _T("A sharing violation occurred. ");
00417         default:                      str.Format(_T("Unknown Error (%d) occurred."), nError); break;
00418     }
00419     str = _T("Unable to open hyperlink:\n\n") + str;
00420     AfxMessageBox(str, MB_ICONEXCLAMATION | MB_OK);
00421 }

void CCJHyperLink::SetAutoSize ( BOOL bAutoSize = TRUE ) [virtual]

Definition at line 293 of file CJHyperLink.cpp.

References m_bAdjustToFit, and PositionWindow.

00294 {
00295     m_bAdjustToFit = bAutoSize;
00296
00297     if (::IsWindow(GetSafeHwnd()))
00298         PositionWindow();
00299 }

void CCJHyperLink::SetColors | ( | COLORREF | crLinkColor,
 |  | COLORREF | crVisitedColor,
 |  | COLORREF | crHoverColor = -1
 | ) | [virtual]

Definition at line 215 of file CJHyperLink.cpp.

References m_crHoverColor, m_crLinkColor, and m_crVisitedColor.

00217 {
00218     m_crLinkColor    = crLinkColor;
00219     m_crVisitedColor = crVisitedColor;
00220
00221     if (crHoverColor == -1)
00222         m_crHoverColor = ::GetSysColor(COLOR_HIGHLIGHT);
00223     else
00224         m_crHoverColor = crHoverColor;
00225
00226     if (::IsWindow(m_hWnd))
00227         Invalidate();
00228 }

void CCJHyperLink::SetDefaultCursor ( ) [protected, virtual]

Definition at line 363 of file CJHyperLink.cpp.

References m_hLinkCursor, MAX_PATH, and NULL.

Referenced by PreSubclassWindow, and SetLinkCursor.

00364 {
00365     if (m_hLinkCursor == NULL)                // No cursor handle - load our own
00366     {
00367         // Get the windows directory
00368         CString strWndDir;
00369         GetWindowsDirectory(strWndDir.GetBuffer(MAX_PATH), MAX_PATH);
00370         strWndDir.ReleaseBuffer();
00371
00372         strWndDir += _T("\\winhlp32.exe");
00373         // This retrieves cursor #106 from winhlp32.exe, which is a hand pointer
00374         HMODULE hModule = LoadLibrary(strWndDir);
00375         if (hModule) {
00376             HCURSOR hHandCursor = ::LoadCursor(hModule, MAKEINTRESOURCE(106));
00377             if (hHandCursor)
00378                 m_hLinkCursor = CopyCursor(hHandCursor);
00379         }
00380         FreeLibrary(hModule);
00381     }
00382 }

void CCJHyperLink::SetLinkCursor ( HCURSOR hCursor ) [virtual]

Definition at line 258 of file CJHyperLink.cpp.

References m_hLinkCursor, NULL, and SetDefaultCursor.

00259 {
00260     m_hLinkCursor = hCursor;
00261     if (m_hLinkCursor == NULL)
00262         SetDefaultCursor();
00263 }

void CCJHyperLink::SetUnderline ( BOOL bUnderline = TRUE ) [virtual]

Definition at line 270 of file CJHyperLink.cpp.

References m_bUnderline, and m_Font.

00271 {
00272     m_bUnderline = bUnderline;
00273
00274     if (::IsWindow(GetSafeHwnd()))
00275     {
00276         LOGFONT lf;
00277         GetFont()->GetLogFont(&lf);
00278         lf.lfUnderline = (char)m_bUnderline;
00279
00280         m_Font.DeleteObject();
00281         m_Font.CreateFontIndirect(&lf);
00282         SetFont(&m_Font);
00283
00284         Invalidate();
00285     }
00286 }

void CCJHyperLink::SetURL ( CString strURL ) [virtual]

Definition at line 200 of file CJHyperLink.cpp.

References m_strURL, m_ToolTip, PositionWindow, and TOOLTIP_ID.

Referenced by CAboutDlg::OnInitDialog, and CNoPython::OnInitDialog.

00201 {
00202     m_strURL = strURL;
00203
00204     if (::IsWindow(GetSafeHwnd())) {
00205         PositionWindow();
00206         m_ToolTip.UpdateTipText(strURL, this, TOOLTIP_ID);
00207     }
00208 }

void CCJHyperLink::SetVisited ( BOOL bVisited = TRUE ) [virtual]

Definition at line 245 of file CJHyperLink.cpp.

References m_bVisited.

Referenced by OnClicked.

00246 {
00247     m_bVisited = bVisited;
00248
00249     if (::IsWindow(GetSafeHwnd()))
00250         Invalidate();
00251 }

Member Data Documentation

BOOL CCJHyperLink::m_bAdjustToFit [protected]

Definition at line 99 of file CJHyperLink.h.

Referenced by CCJHyperLink, GetAutoSize, PositionWindow, and SetAutoSize.

BOOL CCJHyperLink::m_bOverControl [protected]

Definition at line 96 of file CJHyperLink.h.

Referenced by CCJHyperLink, and OnMouseMove.

BOOL CCJHyperLink::m_bUnderline [protected]

Definition at line 98 of file CJHyperLink.h.

Referenced by CCJHyperLink, GetUnderline, PreSubclassWindow, and SetUnderline.

BOOL CCJHyperLink::m_bVisited [protected]

Definition at line 97 of file CJHyperLink.h.

Referenced by CCJHyperLink, GetVisited, OnClicked, and SetVisited.

COLORREF CCJHyperLink::m_crHoverColor [protected]

Definition at line 95 of file CJHyperLink.h.

Referenced by CCJHyperLink, CtlColor, GetHoverColor, and SetColors.

COLORREF CCJHyperLink::m_crLinkColor [protected]

Definition at line 94 of file CJHyperLink.h.

Referenced by CCJHyperLink, CtlColor, GetLinkColor, and SetColors.

COLORREF CCJHyperLink::m_crVisitedColor [protected]

Definition at line 94 of file CJHyperLink.h.

Referenced by CCJHyperLink, CtlColor, GetVisitedColor, and SetColors.

CFont CCJHyperLink::m_Font [protected]

Definition at line 101 of file CJHyperLink.h.

Referenced by PositionWindow, PreSubclassWindow, SetUnderline, and ~CCJHyperLink.

HCURSOR CCJHyperLink::m_hLinkCursor [protected]

Definition at line 102 of file CJHyperLink.h.

Referenced by CCJHyperLink, GetLinkCursor, SetDefaultCursor, SetLinkCursor, and ~CCJHyperLink.

CString CCJHyperLink::m_strURL [protected]

Definition at line 100 of file CJHyperLink.h.

Referenced by CCJHyperLink, GetURL, OnClicked, PreSubclassWindow, and SetURL.

CToolTipCtrl CCJHyperLink::m_ToolTip [protected]

Definition at line 103 of file CJHyperLink.h.

Referenced by PreSubclassWindow, PreTranslateMessage, and SetURL.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJHyperLink.h
  • WinCvs/CJLib/CJLibrary/CJHyperLink.cpp
Generated on Sun Feb 24 01:24:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJListBox Class Reference

#include <CJListBox.h>

Inheritance diagram for CCJListBox:

[legend]
Collaboration diagram for CCJListBox:

[legend]
List of all members.

Public Methods

CCJListBox ()
virtual | ~CCJListBox ()

Protected Methods

afx_msg BOOL | OnEraseBkgnd (CDC *pDC)
afx_msg void | OnPaint ()

Constructor & Destructor Documentation

CCJListBox::CCJListBox ( )

Definition at line 33 of file CJListBox.cpp.

00034 {
00035     // TODO: add construction code here.
00036 }

CCJListBox::~CCJListBox ( ) [virtual]

Definition at line 38 of file CJListBox.cpp.

00039 {
00040     // TODO: add destruction code here.
00041 }

Member Function Documentation

BOOL CCJListBox::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 55 of file CJListBox.cpp.

References TRUE.

00056 {
00057     // KStowell - overridden for flicker-free drawing.
00058     UNUSED_ALWAYS(pDC);
00059     return TRUE;
00060 }

void CCJListBox::OnPaint ( ) [protected]

Definition at line 62 of file CJListBox.cpp.

00063 {
00064     CPaintDC dc(this); // device context for painting
00065
00066     // KStowell - Get the client rect.
00067     CRect rcClient, rcClip;
00068     dc.GetClipBox( &rcClip );
00069     GetClientRect( &rcClient );
00070
00071     // KStowell - Create a memory device-context. This is done to help reduce
00072     // screen flicker, since we will paint the entire control to the
00073     // off screen device context first.
00074     CDC memDC;
00075     CBitmap bitmap;
00076     memDC.CreateCompatibleDC(&dc);
00077     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00078     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00079
00080     // KStowell - Repaint the background.
00081     memDC.FillSolidRect( rcClient, ::GetSysColor(COLOR_WINDOW) );
00082
00083     // let the control do its default drawing.
00084     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00085
00086     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00087     dc.BitBlt( rcClip.left, rcClip.top, rcClip.Width(), rcClip.Height(), &memDC,
00088         rcClip.left, rcClip.top, SRCCOPY );
00089
00090     // KStowell - Cleanup resources.
00091     memDC.SelectObject(pOldBitmap);
00092     memDC.DeleteDC();
00093     bitmap.DeleteObject();
00094 }

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJListBox.h
  • WinCvs/CJLib/CJLibrary/CJListBox.cpp
Generated on Sun Feb 24 01:24:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJListCtrl Class Reference

#include <CJListCtrl.h>

Inheritance diagram for CCJListCtrl:

[legend]
Collaboration diagram for CCJListCtrl:

[legend]
List of all members.

Public Methods

CCJListCtrl ()
virtual | ~CCJListCtrl ()
virtual int | GetStoredWidth (int nCol)
virtual void | AutoSizeColumn (int nCol=-1)
virtual void | SetColumnWidth (int nCol)
virtual void | LoadColumnWidths ()
virtual void | SaveColumnWidths ()
virtual void | AutoSaveColumns (LPCTSTR lpszSection=NULL, LPCTSTR lpszEntry=NULL, LPCTSTR lpszDefault=NULL)
virtual bool | SubclassHeader (bool bBoldFont=false)
virtual bool | SortList (int nCol, bool bAscending)
virtual void | SetExtendedStyle (DWORD dwExStyle)
virtual DWORD | GetExtendedStyle ()
virtual void | DisableColumnSizing (bool bDisable)
virtual void | SetMinimumColSize (int nSize)
virtual int | HitTestEx (CPoint &point, int *col) const
virtual int | AddColumn (LPCTSTR lpszColHeading, int nWidth=-1, int nFormat=LVCFMT_LEFT)
virtual bool | BuildColumns (int nCols, int *nWidth, CString *strColString)
virtual bool | BuildColumns (int nCols, int *nWidth, int *nColString)
virtual void | SetRowColors (COLORREF clrText, COLORREF clrTextBk)
virtual int | GetColumnCount () const
virtual bool | CopyRow (int nFrom, int nTo)
virtual bool | MoveRow (int nFrom, int nTo)

Protected Methods

virtual BOOL | OnNotify (WPARAM wParam, LPARAM lParam, LRESULT *pResult)
afx_msg void | OnCustomDraw (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnDestroy ()
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)
afx_msg void | OnPaint ()

Protected Attributes

int | m_nMinColWidth
int | m_nMaxColWidth
int | m_nSortedCol
CCJFlatHeaderCtrl * m_pHeaderCtrl
CString | m_strSection
CString | m_strEntry
CString | m_strDefault
CListCtrl * m_pListCtrl
COLORREF | m_clrText
COLORREF | m_clrTextBk
bool | m_bNoColSizing
int | m_nMinSize
bool | m_bAscending

Private Attributes

bool | m_bAutoSave

Constructor & Destructor Documentation

CCJListCtrl::CCJListCtrl ( )

Definition at line 88 of file CJListCtrl.cpp.

References NULL.

00089 {
00090     m_nMinSize      = 0;
00091     m_nMinColWidth  = 50;
00092     m_nMaxColWidth  = 500;
00093     m_nSortedCol    = -1;
00094     m_bAscending    = true;
00095     m_bAutoSave     = false;
00096     m_bNoColSizing  = false;
00097     m_pHeaderCtrl   = NULL;
00098     m_clrText       = ::GetSysColor(COLOR_WINDOWTEXT);
00099     m_clrTextBk     = ::GetSysColor(COLOR_WINDOW);
00100 }

CCJListCtrl::~CCJListCtrl ( ) [virtual]

Definition at line 102 of file CJListCtrl.cpp.

References _delete, and m_pHeaderCtrl.

00103 {
00104     _delete( m_pHeaderCtrl );
00105 }

Member Function Documentation

int CCJListCtrl::AddColumn | ( | LPCTSTR | lpszColHeading,
 |  | int | nWidth = -1,
 |  | int | nFormat = LVCFMT_LEFT
 | ) | [virtual]

Definition at line 291 of file CJListCtrl.cpp.

Referenced by BuildColumns.

00292 {
00293     CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
00294     int nColumnCount = pHeader->GetItemCount();
00295
00296     if( nWidth == -1 )
00297     {
00298         // The line below return zero for ICON views
00299         //nWidth = GetColumnWidth( nColumnCount - 1 );
00300
00301         // Get the column width of the previous column from header control
00302         HD_ITEM hd_item;
00303         hd_item.mask = HDI_WIDTH;               //indicate that we want the width
00304         pHeader->GetItem( nColumnCount - 1, &hd_item );
00305         nWidth = hd_item.cxy;
00306     }
00307     return InsertColumn( nColumnCount, lpszColHeading, nFormat, nWidth, nColumnCount );
00308 }

void CCJListCtrl::AutoSaveColumns | ( | LPCTSTR | lpszSection = NULL,
 |  | LPCTSTR | lpszEntry = NULL,
 |  | LPCTSTR | lpszDefault = NULL
 | ) | [virtual]

Definition at line 405 of file CJListCtrl.cpp.

References LoadColumnWidths, m_bAutoSave, m_strDefault, m_strEntry, m_strSection, and NULL.

00406 {
00407     m_bAutoSave = true;
00408
00409     // initialize registry strings.
00410     if( lpszSection == NULL ) m_strSection = _T("Settings");
00411     else m_strSection = lpszSection;
00412
00413     if( lpszEntry == NULL ) m_strEntry = _T("Column Info");
00414     else m_strEntry = lpszEntry;
00415
00416     if( lpszDefault == NULL ) m_strDefault = _T("");
00417     else m_strDefault = lpszDefault;
00418
00419     LoadColumnWidths();
00420 }

void CCJListCtrl::AutoSizeColumn ( int nCol = -1 ) [virtual]

Definition at line 481 of file CJListCtrl.cpp.

References GetColumnCount, m_nMaxColWidth, and m_nMinColWidth.

Referenced by SetColumnWidth.

00482 {
00483     // Call this after your list control is filled
00484     SetRedraw( false );
00485
00486     int nMinCol = nCol < 0 ? 0 : nCol;
00487     int nMaxCol = nCol < 0 ? GetColumnCount()-1 : nCol;
00488
00489     for (nCol = nMinCol; nCol <= nMaxCol; nCol++)
00490     {
00491         CListCtrl::SetColumnWidth( nCol, LVSCW_AUTOSIZE );
00492         int wc1 = GetColumnWidth( nCol );
00493
00494         CListCtrl::SetColumnWidth( nCol, LVSCW_AUTOSIZE_USEHEADER );
00495         int wc2 = GetColumnWidth( nCol );
00496         int wc = max( m_nMinColWidth, max( wc1, wc2 ));
00497
00498         if( wc > m_nMaxColWidth )
00499             wc = m_nMaxColWidth;
00500
00501         // set the column width.
00502         CListCtrl::SetColumnWidth( nCol,wc );
00503     }
00504
00505     SetRedraw();
00506 }

bool CCJListCtrl::BuildColumns | ( | int | nCols,
 |  | int * | nWidth,
 |  | int * | nColString
 | ) | [virtual]

Definition at line 310 of file CJListCtrl.cpp.

References AddColumn.

00311 {
00312     for( int i = 0; i < nCols; ++i ) {
00313         CString strTemp; strTemp.LoadString( nColString[i] );
00314         if(AddColumn(strTemp, nWidth[i])==-1)
00315             return false;
00316     }
00317
00318     return true;
00319 }

bool CCJListCtrl::BuildColumns | ( | int | nCols,
 |  | int * | nWidth,
 |  | CString * | strColString
 | ) | [virtual]

Definition at line 321 of file CJListCtrl.cpp.

References AddColumn.

00322 {
00323     for( int i = 0; i < nCols; ++i ) {
00324         if(AddColumn(strColString[i], nWidth[i])==-1)
00325             return false;
00326     }
00327
00328     return true;
00329 }

bool CCJListCtrl::CopyRow | ( | int | nFrom,
 |  | int | nTo
 | ) | [virtual]

Definition at line 148 of file CJListCtrl.cpp.

References GetColumnCount.

Referenced by MoveRow.

00149 {
00150     //Can't move to the same place, or from or to a negative index
00151     if(nFrom == nTo || nFrom < 0 || nTo < 0)
00152         return false;
00153
00154     //Copy the row to the new index
00155     InsertItem(nTo, GetItemText(nFrom, 0));
00156
00157     //If row has been inserted before original
00158     //increment the original
00159     if(nFrom > nTo)
00160         nFrom++;
00161
00162     //Loop through subitems
00163     for(int i = 1; i < GetColumnCount(); i++)
00164     {
00165         SetItemText(nTo, i, GetItemText(nFrom, i));
00166     }
00167
00168     return true;
00169 }

_CJXLIB_INLINE void CCJListCtrl::DisableColumnSizing ( bool bDisable ) [virtual]

Definition at line 276 of file CJListCtrl.h.

References m_bNoColSizing.

00277     { m_bNoColSizing = bDisable; }

int CCJListCtrl::GetColumnCount ( ) const [virtual]

Definition at line 173 of file CJListCtrl.cpp.

Referenced by AutoSizeColumn, and CopyRow.

00174 {
00175     CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
00176     return pHeader->GetItemCount();
00177 }

_CJXLIB_INLINE DWORD CCJListCtrl::GetExtendedStyle ( ) [virtual]

Definition at line 264 of file CJListCtrl.h.

References ASSERT.

Referenced by SetExtendedStyle.

00265     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); }

int CCJListCtrl::GetStoredWidth ( int nCol ) [virtual]

Definition at line 458 of file CJListCtrl.cpp.

References m_strDefault, m_strEntry, and m_strSection.

Referenced by SetColumnWidth.

00459 {
00460     // get the value from the registry.
00461     CString strValue = AfxGetApp()->GetProfileString(
00462         m_strSection, m_strEntry, m_strDefault );
00463
00464     // extract the sub string to get the column width.
00465     CString strSubString;
00466     AfxExtractSubString( strSubString, strValue, nCol, _T(','));
00467
00468     // return the width from the registry.
00469     return _ttoi( strSubString );
00470 }

int CCJListCtrl::HitTestEx | ( | CPoint & | point,
 |  | int * | col
 | ) | const [virtual]

Definition at line 338 of file CJListCtrl.cpp.

References NULL.

00339 {
00340     int colnum = 0;
00341     int row = HitTest( point, NULL );
00342
00343     if( nCol ) *nCol = 0;
00344
00345     // Make sure that the ListView is in LVS_REPORT
00346     if( (GetWindowLong(m_hWnd, GWL_STYLE) & LVS_TYPEMASK) != LVS_REPORT )
00347         return row;
00348
00349     // Get the top and bottom row visible
00350     row = GetTopIndex();
00351     int bottom = row + GetCountPerPage();
00352     if( bottom > GetItemCount() )
00353         bottom = GetItemCount();
00354
00355     // Get the number of columns
00356     CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
00357     int nColumnCount = pHeader->GetItemCount();
00358
00359     // Loop through the visible rows
00360     for( ;row <= bottom;row++)
00361     {
00362         // Get bounding rect of item and check whether point falls in it.
00363         CRect rect;
00364         GetItemRect( row, &rect, LVIR_BOUNDS );
00365         if( rect.PtInRect(point) )
00366         {
00367             // Now find the column
00368             for( colnum = 0; colnum < nColumnCount; colnum++ )
00369             {
00370                 int colwidth = GetColumnWidth(colnum);
00371                 if( point.x >= rect.left
00372                     && point.x <= (rect.left + colwidth ) )
00373                 {
00374                     if( nCol ) *nCol = colnum;
00375                     return row;
00376                 }
00377                 rect.left += colwidth;
00378             }
00379         }
00380     }
00381     return -1;
00382 }

void CCJListCtrl::LoadColumnWidths ( ) [virtual]

Definition at line 439 of file CJListCtrl.cpp.

References SetColumnWidth.

Referenced by AutoSaveColumns.

00440 {
00441     // get a pointer to the header control.
00442     CHeaderCtrl* pHeader = DYNAMIC_DOWNCAST(CHeaderCtrl, GetDlgItem(0));
00443     ASSERT_KINDOF( CHeaderCtrl, pHeader );
00444
00445     for( int i = 0; i < pHeader->GetItemCount(); ++i )
00446         SetColumnWidth(i);
00447 }

bool CCJListCtrl::MoveRow | ( | int | nFrom,
 |  | int | nTo
 | ) | [virtual]

Definition at line 123 of file CJListCtrl.cpp.

References CopyRow.

00124 {
00125     //Can't move to the same place, or from or to a negative index
00126     if(nFrom == nTo || nFrom < 0 || nTo < 0)
00127         return false;
00128
00129     //First Copy the row to the new location
00130     if(CopyRow(nFrom, nTo))
00131     {
00132         //If we have just inserted a row before
00133         //this one in the list, we need to increment
00134         //our index.
00135         if(nFrom > nTo)
00136             DeleteItem(nFrom + 1);
00137         else
00138             DeleteItem(nFrom);
00139
00140         return true;
00141     }
00142     else
00143         return false;
00144 }

void CCJListCtrl::OnCustomDraw | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 181 of file CJListCtrl.cpp.

References m_clrText, and m_clrTextBk.

00182 {
00183     LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)pNMHDR;
00184
00185     switch(lplvcd->nmcd.dwDrawStage)
00186     {
00187     case CDDS_PREPAINT:
00188         // Request prepaint notifications for each item.
00189         *pResult = CDRF_NOTIFYITEMDRAW;
00190         break;
00191
00192     case CDDS_ITEMPREPAINT: // Requested notification
00193         if(lplvcd->nmcd.dwItemSpec % 2)
00194         {
00195             lplvcd->clrText   = m_clrText;
00196             lplvcd->clrTextBk = m_clrTextBk;
00197         }
00198         *pResult = CDRF_DODEFAULT;
00199         break;
00200     }
00201 }

void CCJListCtrl::OnDestroy ( ) [protected]

Definition at line 472 of file CJListCtrl.cpp.

References SaveColumnWidths.

00473 {
00474     if( m_bAutoSave ) SaveColumnWidths();
00475     CListCtrl::OnDestroy();
00476 }

BOOL CCJListCtrl::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 508 of file CJListCtrl.cpp.

References TRUE.

00509 {
00510     // KStowell - overridden for flicker-free drawing.
00511     UNUSED_ALWAYS(pDC);
00512     return TRUE;
00513 }

BOOL CCJListCtrl::OnNotify | ( | WPARAM | wParam,
 |  | LPARAM | lParam,
 |  | LRESULT * | pResult
 | ) | [protected, virtual]

Definition at line 203 of file CJListCtrl.cpp.

References m_bAscending, m_nMinSize, m_nSortedCol, m_pHeaderCtrl, CCJFlatHeaderCtrl::SetSortImage, SortList, and TRUE.

00204 {
00205     HD_NOTIFY *pHDNotify = (HD_NOTIFY*)lParam;
00206
00207     switch( pHDNotify->hdr.code )
00208     {
00209     // Sorting the list when user clicks on column header by Zafir Anjum.
00210     // http://www.codeguru.com/listview/sort_on_col_click.shtml
00211     case HDN_ITEMCLICKA:
00212     case HDN_ITEMCLICKW:
00213         {
00214             if( pHDNotify->iButton == 0 )
00215             {
00216                 // set the sort order.
00217                 if( pHDNotify->iItem == m_nSortedCol )
00218                     m_bAscending = !m_bAscending;
00219                 else
00220                     m_bAscending = true;
00221
00222                 // save the column index.
00223                 m_nSortedCol = pHDNotify->iItem;
00224
00225                 // virtual call to sort list.
00226                 SortList( m_nSortedCol, m_bAscending );
00227
00228                 // set the sort image in the header control.
00229                 if( m_pHeaderCtrl && m_pHeaderCtrl->GetSafeHwnd( ))
00230                     m_pHeaderCtrl->SetSortImage( m_nSortedCol, m_bAscending );
00231             }
00232         }
00233         break;
00234
00235     // How to force a minimum column width Cees Mechielsen.
00236     // http://www.codeguru.com/mfc/comments/866.shtml
00237     case HDN_ITEMCHANGINGA:
00238     case HDN_ITEMCHANGINGW:
00239     case HDN_ENDTRACK:
00240         {
00241             if( pHDNotify->pitem->mask & HDI_WIDTH &&
00242                 pHDNotify->pitem->cxy < m_nMinSize &&
00243                 pHDNotify->pitem->cxy >= 0 )
00244             {
00245                 pHDNotify->pitem->cxy = m_nMinSize; // Set the column width
00246             }
00247         }
00248         break;
00249
00250     // Prevent CListCtrl column resizing by Zafir Anjum.
00251     // http://www.codeguru.com/listview/no_col_resize.shtml
00252     case HDN_DIVIDERDBLCLICKA:
00253     case HDN_DIVIDERDBLCLICKW:
00254     case HDN_BEGINTRACKW:
00255     case HDN_BEGINTRACKA:
00256         {
00257             if(m_bNoColSizing)
00258             {
00259                 *pResult = TRUE;                // disable tracking
00260                 return TRUE;                    // Processed message
00261             }
00262             break;
00263         }
00264     }
00265
00266     return CListCtrl::OnNotify(wParam, lParam, pResult);
00267 }

void CCJListCtrl::OnPaint ( ) [protected]

Definition at line 515 of file CJListCtrl.cpp.

00516 {
00517     CPaintDC dc(this); // device context for painting
00518
00519     // KStowell - Get the client rect.
00520     CRect rcClient, rcClip;
00521     dc.GetClipBox( &rcClip );
00522     GetClientRect( &rcClient );
00523
00524     // Exclude the header control from being painted over.
00525     CWnd* pWnd = GetDlgItem(0);
00526     if(pWnd && pWnd->IsWindowVisible()) {
00527         CRect rcItem;
00528         pWnd->GetClientRect(&rcItem);
00529         dc.ExcludeClipRect(&rcItem);
00530     }
00531
00532     // KStowell - Create a memory device-context. This is done to help reduce
00533     // screen flicker, since we will paint the entire control to the
00534     // off screen device context first.
00535     CDC memDC;
00536     CBitmap bitmap;
00537     memDC.CreateCompatibleDC(&dc);
00538     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00539     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00540
00541     // KStowell - Repaint the background.
00542     memDC.FillSolidRect( rcClient, ::GetSysColor(COLOR_WINDOW) );
00543
00544     // let the control do its default drawing.
00545     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00546
00547     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00548     dc.BitBlt( rcClip.left, rcClip.top, rcClip.Width(), rcClip.Height(), &memDC,
00549         rcClip.left, rcClip.top, SRCCOPY );
00550
00551     // KStowell - Cleanup resources.
00552     memDC.SelectObject(pOldBitmap);
00553     memDC.DeleteDC();
00554     bitmap.DeleteObject();
00555 }

void CCJListCtrl::SaveColumnWidths ( ) [virtual]

Definition at line 422 of file CJListCtrl.cpp.

References m_strEntry, and m_strSection.

Referenced by OnDestroy.

00423 {
00424     // get a pointer to the header control.
00425     CHeaderCtrl* pHeader = DYNAMIC_DOWNCAST(CHeaderCtrl, GetDlgItem(0));
00426     ASSERT_KINDOF( CHeaderCtrl, pHeader );
00427
00428     CString strValue;
00429     for( int i = 0; i < pHeader->GetItemCount(); ++i )
00430     {
00431         CString strTemp;
00432         strTemp.Format(_T("%d,"), GetColumnWidth( i ));
00433         strValue += strTemp;
00434     }
00435
00436     AfxGetApp()->WriteProfileString( m_strSection, m_strEntry, strValue );
00437 }

void CCJListCtrl::SetColumnWidth ( int nCol ) [virtual]

Definition at line 449 of file CJListCtrl.cpp.

References AutoSizeColumn, GetStoredWidth, and m_nMinColWidth.

Referenced by LoadColumnWidths.

00450 {
00451     int nWidth = GetStoredWidth( nCol );
00452     if( nWidth > m_nMinColWidth )
00453         CListCtrl::SetColumnWidth( nCol, nWidth );
00454     else
00455         AutoSizeColumn( nCol );
00456 }

_CJXLIB_INLINE void CCJListCtrl::SetExtendedStyle ( DWORD dwExStyle ) [virtual]

Definition at line 267 of file CJListCtrl.h.

References ASSERT, and GetExtendedStyle.

00268     { ASSERT(::IsWindow(m_hWnd)); SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, GetExtendedStyle()|dwExStyle); }

_CJXLIB_INLINE void CCJListCtrl::SetMinimumColSize ( int nSize ) [virtual]

Definition at line 273 of file CJListCtrl.h.

References m_nMinSize.

00274     { m_nMinSize = nSize; }

_CJXLIB_INLINE void CCJListCtrl::SetRowColors | ( | COLORREF | clrText,
 |  | COLORREF | clrTextBk
 | ) | [virtual]

Definition at line 270 of file CJListCtrl.h.

References m_clrText, and m_clrTextBk.

00271     { m_clrText = clrText; m_clrTextBk = clrTextBk; }

bool CCJListCtrl::SortList | ( | int | nCol,
 |  | bool | bAscending
 | ) | [virtual]

Definition at line 269 of file CJListCtrl.cpp.

Referenced by OnNotify.

00270 {
00271 #ifdef _DEBUG
00272     TRACE2("Column sort on column index %d, ascending=%d", nCol, bAscending);
00273 #else
00274     UNUSED_ALWAYS( nCol );
00275     UNUSED_ALWAYS( bAscending );
00276 #endif
00277
00278     return true;
00279 }

bool CCJListCtrl::SubclassHeader ( bool bBoldFont = false ) [virtual]

Definition at line 384 of file CJListCtrl.cpp.

References ASSERT, CCJFlatHeaderCtrl::InitializeHeader, and m_pHeaderCtrl.

00385 {
00386     // allocate memory for the flat header.
00387     m_pHeaderCtrl = new CCJFlatHeaderCtrl;
00388     ASSERT( m_pHeaderCtrl );
00389
00390     // get the window handle to the existing header
00391     // control.
00392     HWND hWnd = GetDlgItem(0)->GetSafeHwnd();
00393     ASSERT( hWnd );
00394
00395     // subclass the flat header control.
00396     if( !m_pHeaderCtrl->SubclassWindow( hWnd ))
00397         return false;
00398
00399     // finish header initialization.
00400     m_pHeaderCtrl->InitializeHeader( bBoldFont );
00401
00402     return true;
00403 }

Member Data Documentation

bool CCJListCtrl::m_bAscending [protected]

Definition at line 112 of file CJListCtrl.h.

Referenced by OnNotify.

bool CCJListCtrl::m_bAutoSave [private]

Definition at line 116 of file CJListCtrl.h.

Referenced by AutoSaveColumns.

bool CCJListCtrl::m_bNoColSizing [protected]

Definition at line 110 of file CJListCtrl.h.

Referenced by DisableColumnSizing.

COLORREF CCJListCtrl::m_clrText [protected]

Definition at line 108 of file CJListCtrl.h.

Referenced by OnCustomDraw, and SetRowColors.

COLORREF CCJListCtrl::m_clrTextBk [protected]

Definition at line 109 of file CJListCtrl.h.

Referenced by OnCustomDraw, and SetRowColors.

int CCJListCtrl::m_nMaxColWidth [protected]

Definition at line 101 of file CJListCtrl.h.

Referenced by AutoSizeColumn.

int CCJListCtrl::m_nMinColWidth [protected]

Definition at line 100 of file CJListCtrl.h.

Referenced by AutoSizeColumn, and SetColumnWidth.

int CCJListCtrl::m_nMinSize [protected]

Definition at line 111 of file CJListCtrl.h.

Referenced by OnNotify, and SetMinimumColSize.

int CCJListCtrl::m_nSortedCol [protected]

Definition at line 102 of file CJListCtrl.h.

Referenced by OnNotify.

CCJFlatHeaderCtrl* CCJListCtrl::m_pHeaderCtrl [protected]

Definition at line 103 of file CJListCtrl.h.

Referenced by OnNotify, SubclassHeader, and ~CCJListCtrl.

CListCtrl* CCJListCtrl::m_pListCtrl [protected]

Definition at line 107 of file CJListCtrl.h.

CString CCJListCtrl::m_strDefault [protected]

Definition at line 106 of file CJListCtrl.h.

Referenced by AutoSaveColumns, and GetStoredWidth.

CString CCJListCtrl::m_strEntry [protected]

Definition at line 105 of file CJListCtrl.h.

Referenced by AutoSaveColumns, GetStoredWidth, and SaveColumnWidths.

CString CCJListCtrl::m_strSection [protected]

Definition at line 104 of file CJListCtrl.h.

Referenced by AutoSaveColumns, GetStoredWidth, and SaveColumnWidths.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJListCtrl.h
  • WinCvs/CJLib/CJLibrary/CJListCtrl.cpp
Generated on Sun Feb 24 01:24:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJListView Class Reference

#include <CJListView.h>

Inheritance diagram for CCJListView:

[legend]
Collaboration diagram for CCJListView:

[legend]
List of all members.

Public Methods

CCJListView ()
virtual | ~CCJListView ()
virtual int | GetStoredWidth (int nCol)
virtual void | AutoSizeColumn (int nCol=-1)
virtual void | SetColumnWidth (int nCol)
virtual void | LoadColumnWidths ()
virtual void | SaveColumnWidths ()
virtual void | AutoSaveColumns (LPCTSTR lpszSection=NULL, LPCTSTR lpszEntry=NULL, LPCTSTR lpszDefault=NULL)
virtual bool | SubclassHeader (bool bBoldFont=false)
virtual bool | SortList (int nCol, bool bAscending)
virtual void | SetExtendedStyle (DWORD dwExStyle)
virtual DWORD | GetExtendedStyle ()
virtual void | DisableColumnSizing (bool bDisable)
virtual void | SetMinimumColSize (int nSize)
virtual int | HitTestEx (CPoint &point, int *col) const
virtual int | AddColumn (LPCTSTR lpszColHeading, int nWidth=-1, int nFormat=LVCFMT_LEFT)
virtual bool | BuildColumns (int nCols, int *nWidth, CString *strColString)
virtual bool | BuildColumns (int nCols, int *nWidth, int *nColString)
virtual void | SetRowColors (COLORREF clrText, COLORREF clrTextBk)
virtual int | GetColumnCount () const
virtual bool | CopyRow (int nFrom, int nTo)
virtual bool | MoveRow (int nFrom, int nTo)
virtual void | OnInitialUpdate ()

Protected Methods

virtual void | OnDraw (CDC *pDC)
virtual BOOL | OnNotify (WPARAM wParam, LPARAM lParam, LRESULT *pResult)
afx_msg void | OnCustomDraw (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnDestroy ()
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)

Protected Attributes

int | m_nMinColWidth
int | m_nMaxColWidth
int | m_nSortedCol
CCJFlatHeaderCtrl * m_pHeaderCtrl
CString | m_strSection
CString | m_strEntry
CString | m_strDefault
CListCtrl * m_pListCtrl
COLORREF | m_clrText
COLORREF | m_clrTextBk
bool | m_bNoColSizing
int | m_nMinSize

Private Attributes

bool | m_bAutoSave
bool | m_bAscending

Constructor & Destructor Documentation

CCJListView::CCJListView ( )

Definition at line 84 of file CJListView.cpp.

References NULL.

00085 {
00086     m_nMinSize      = 0;
00087     m_nMinColWidth  = 50;
00088     m_nMaxColWidth  = 500;
00089     m_nSortedCol    = -1;
00090     m_bAscending    = true;
00091     m_bAutoSave     = false;
00092     m_bNoColSizing  = false;
00093     m_pHeaderCtrl   = NULL;
00094     m_pListCtrl     = NULL;
00095     m_clrText       = ::GetSysColor(COLOR_WINDOWTEXT);
00096     m_clrTextBk     = ::GetSysColor(COLOR_WINDOW);
00097 }

CCJListView::~CCJListView ( ) [virtual]

Definition at line 99 of file CJListView.cpp.

References _delete, and m_pHeaderCtrl.

00100 {
00101     _delete( m_pHeaderCtrl );
00102 }

Member Function Documentation

int CCJListView::AddColumn | ( | LPCTSTR | lpszColHeading,
 |  | int | nWidth = -1,
 |  | int | nFormat = LVCFMT_LEFT
 | ) | [virtual]

Definition at line 317 of file CJListView.cpp.

References m_pListCtrl.

Referenced by BuildColumns.

00318 {
00319     CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
00320     int nColumnCount = pHeader->GetItemCount();
00321
00322     if( nWidth == -1 )
00323     {
00324         // The line below return zero for ICON views
00325         //nWidth = GetColumnWidth( nColumnCount - 1 );
00326
00327         // Get the column width of the previous column from header control
00328         HD_ITEM hd_item;
00329         hd_item.mask = HDI_WIDTH;               //indicate that we want the width
00330         pHeader->GetItem( nColumnCount - 1, &hd_item );
00331         nWidth = hd_item.cxy;
00332     }
00333     return m_pListCtrl->InsertColumn( nColumnCount, lpszColHeading, nFormat, nWidth, nColumnCount );
00334 }

void CCJListView::AutoSaveColumns | ( | LPCTSTR | lpszSection = NULL,
 |  | LPCTSTR | lpszEntry = NULL,
 |  | LPCTSTR | lpszDefault = NULL
 | ) | [virtual]

Definition at line 431 of file CJListView.cpp.

References LoadColumnWidths, m_bAutoSave, m_strDefault, m_strEntry, m_strSection, and NULL.

00432 {
00433     m_bAutoSave = true;
00434
00435     // initialize registry strings.
00436     if( lpszSection == NULL ) m_strSection = _T("Settings");
00437     else m_strSection = lpszSection;
00438
00439     if( lpszEntry == NULL ) m_strEntry = _T("Column Info");
00440     else m_strEntry = lpszEntry;
00441
00442     if( lpszDefault == NULL ) m_strDefault = _T("");
00443     else m_strDefault = lpszDefault;
00444
00445     LoadColumnWidths();
00446 }

void CCJListView::AutoSizeColumn ( int nCol = -1 ) [virtual]

Definition at line 507 of file CJListView.cpp.

References GetColumnCount, m_nMaxColWidth, m_nMinColWidth, and m_pListCtrl.

Referenced by SetColumnWidth.

00508 {
00509     // Call this after your list control is filled
00510     SetRedraw( false );
00511
00512     int nMinCol = nCol < 0 ? 0 : nCol;
00513     int nMaxCol = nCol < 0 ? GetColumnCount()-1 : nCol;
00514
00515     for (nCol = nMinCol; nCol <= nMaxCol; nCol++)
00516     {
00517         m_pListCtrl->SetColumnWidth( nCol, LVSCW_AUTOSIZE );
00518         int wc1 = m_pListCtrl->GetColumnWidth( nCol );
00519
00520         m_pListCtrl->SetColumnWidth( nCol, LVSCW_AUTOSIZE_USEHEADER );
00521         int wc2 = m_pListCtrl->GetColumnWidth( nCol );
00522         int wc = max( m_nMinColWidth, max( wc1, wc2 ));
00523
00524         if( wc > m_nMaxColWidth )
00525             wc = m_nMaxColWidth;
00526
00527         // set the column width.
00528         m_pListCtrl->SetColumnWidth( nCol,wc );
00529     }
00530
00531     SetRedraw();
00532 }

bool CCJListView::BuildColumns | ( | int | nCols,
 |  | int * | nWidth,
 |  | int * | nColString
 | ) | [virtual]

Definition at line 336 of file CJListView.cpp.

References AddColumn.

00337 {
00338     for( int i = 0; i < nCols; ++i ) {
00339         CString strTemp; strTemp.LoadString( nColString[i] );
00340         if(AddColumn(strTemp, nWidth[i])==-1)
00341             return false;
00342     }
00343
00344     return true;
00345 }

bool CCJListView::BuildColumns | ( | int | nCols,
 |  | int * | nWidth,
 |  | CString * | strColString
 | ) | [virtual]

Definition at line 347 of file CJListView.cpp.

References AddColumn.

00348 {
00349     for( int i = 0; i < nCols; ++i ) {
00350         if(AddColumn(strColString[i], nWidth[i])==-1)
00351             return false;
00352     }
00353
00354     return true;
00355 }

bool CCJListView::CopyRow | ( | int | nFrom,
 |  | int | nTo
 | ) | [virtual]

Definition at line 174 of file CJListView.cpp.

References GetColumnCount, and m_pListCtrl.

Referenced by MoveRow.

00175 {
00176     //Can't move to the same place, or from or to a negative index
00177     if(nFrom == nTo || nFrom < 0 || nTo < 0)
00178         return false;
00179
00180     //Copy the row to the new index
00181     m_pListCtrl->InsertItem(nTo, m_pListCtrl->GetItemText(nFrom, 0));
00182
00183     //If row has been inserted before original
00184     //increment the original
00185     if(nFrom > nTo)
00186         nFrom++;
00187
00188     //Loop through subitems
00189     for(int i = 1; i < GetColumnCount(); i++)
00190     {
00191         m_pListCtrl->SetItemText(nTo, i, m_pListCtrl->GetItemText(nFrom, i));
00192     }
00193
00194     return true;
00195 }

_CJXLIB_INLINE void CCJListView::DisableColumnSizing ( bool bDisable ) [virtual]

Definition at line 283 of file CJListView.h.

References m_bNoColSizing.

00284     { m_bNoColSizing = bDisable; }

int CCJListView::GetColumnCount ( ) const [virtual]

Definition at line 199 of file CJListView.cpp.

References m_pListCtrl.

Referenced by AutoSizeColumn, and CopyRow.

00200 {
00201     CHeaderCtrl* pHeader = (CHeaderCtrl*)m_pListCtrl->GetDlgItem(0);
00202     return pHeader->GetItemCount();
00203 }

_CJXLIB_INLINE DWORD CCJListView::GetExtendedStyle ( ) [virtual]

Definition at line 271 of file CJListView.h.

References ASSERT.

Referenced by SetExtendedStyle.

00272     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); }

int CCJListView::GetStoredWidth ( int nCol ) [virtual]

Definition at line 484 of file CJListView.cpp.

References m_strDefault, m_strEntry, and m_strSection.

Referenced by SetColumnWidth.

00485 {
00486     // get the value from the registry.
00487     CString strValue = AfxGetApp()->GetProfileString(
00488         m_strSection, m_strEntry, m_strDefault );
00489
00490     // extract the sub string to get the column width.
00491     CString strSubString;
00492     AfxExtractSubString( strSubString, strValue, nCol, _T(','));
00493
00494     // return the width from the registry.
00495     return _ttoi( strSubString );
00496 }

int CCJListView::HitTestEx | ( | CPoint & | point,
 |  | int * | col
 | ) | const [virtual]

Definition at line 364 of file CJListView.cpp.

References m_pListCtrl, and NULL.

00365 {
00366     int colnum = 0;
00367     int row = m_pListCtrl->HitTest( point, NULL );
00368
00369     if( nCol ) *nCol = 0;
00370
00371     // Make sure that the ListView is in LVS_REPORT
00372     if( (GetWindowLong(m_hWnd, GWL_STYLE) & LVS_TYPEMASK) != LVS_REPORT )
00373         return row;
00374
00375     // Get the top and bottom row visible
00376     row = m_pListCtrl->GetTopIndex();
00377     int bottom = row + m_pListCtrl->GetCountPerPage();
00378     if( bottom > m_pListCtrl->GetItemCount() )
00379         bottom = m_pListCtrl->GetItemCount();
00380
00381     // Get the number of columns
00382     CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
00383     int nColumnCount = pHeader->GetItemCount();
00384
00385     // Loop through the visible rows
00386     for( ;row <= bottom;row++)
00387     {
00388         // Get bounding rect of item and check whether point falls in it.
00389         CRect rect;
00390         m_pListCtrl->GetItemRect( row, &rect, LVIR_BOUNDS );
00391         if( rect.PtInRect(point) )
00392         {
00393             // Now find the column
00394             for( colnum = 0; colnum < nColumnCount; colnum++ )
00395             {
00396                 int colwidth = m_pListCtrl->GetColumnWidth(colnum);
00397                 if( point.x >= rect.left
00398                     && point.x <= (rect.left + colwidth ) )
00399                 {
00400                     if( nCol ) *nCol = colnum;
00401                     return row;
00402                 }
00403                 rect.left += colwidth;
00404             }
00405         }
00406     }
00407     return -1;
00408 }

void CCJListView::LoadColumnWidths ( ) [virtual]

Definition at line 465 of file CJListView.cpp.

References SetColumnWidth.

Referenced by AutoSaveColumns.

00466 {
00467     // get a pointer to the header control.
00468     CHeaderCtrl* pHeader = DYNAMIC_DOWNCAST(CHeaderCtrl, GetDlgItem(0));
00469     ASSERT_KINDOF( CHeaderCtrl, pHeader );
00470
00471     for( int i = 0; i < pHeader->GetItemCount(); ++i )
00472         SetColumnWidth(i);
00473 }

bool CCJListView::MoveRow | ( | int | nFrom,
 |  | int | nTo
 | ) | [virtual]

Definition at line 149 of file CJListView.cpp.

References CopyRow, and m_pListCtrl.

00150 {
00151     //Can't move to the same place, or from or to a negative index
00152     if(nFrom == nTo || nFrom < 0 || nTo < 0)
00153         return false;
00154
00155     //First Copy the row to the new location
00156     if(CopyRow(nFrom, nTo))
00157     {
00158         //If we have just inserted a row before
00159         //this one in the list, we need to increment
00160         //our index.
00161         if(nFrom > nTo)
00162             m_pListCtrl->DeleteItem(nFrom + 1);
00163         else
00164             m_pListCtrl->DeleteItem(nFrom);
00165
00166         return true;
00167     }
00168     else
00169         return false;
00170 }

void CCJListView::OnCustomDraw | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 207 of file CJListView.cpp.

References m_clrText, and m_clrTextBk.

00208 {
00209     LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)pNMHDR;
00210
00211     switch(lplvcd->nmcd.dwDrawStage)
00212     {
00213     case CDDS_PREPAINT:
00214         // Request prepaint notifications for each item.
00215         *pResult = CDRF_NOTIFYITEMDRAW;
00216         break;
00217
00218     case CDDS_ITEMPREPAINT: // Requested notification
00219         if(lplvcd->nmcd.dwItemSpec % 2)
00220         {
00221             lplvcd->clrText   = m_clrText;
00222             lplvcd->clrTextBk = m_clrTextBk;
00223         }
00224         *pResult = CDRF_DODEFAULT;
00225         break;
00226     }
00227 }

void CCJListView::OnDestroy ( ) [protected]

Definition at line 498 of file CJListView.cpp.

References SaveColumnWidths.

00499 {
00500     if( m_bAutoSave ) SaveColumnWidths();
00501     CListView::OnDestroy();
00502 }

void CCJListView::OnDraw ( CDC * pDC ) [protected, virtual]

Definition at line 116 of file CJListView.cpp.

00117 {
00118     UNUSED_ALWAYS( pDC );
00119 }

BOOL CCJListView::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 534 of file CJListView.cpp.

00535 {
00536     CRect rectClient;
00537     GetClientRect( &rectClient );
00538     pDC->ExcludeClipRect( &rectClient );
00539     return CListView::OnEraseBkgnd(pDC);
00540 }

void CCJListView::OnInitialUpdate ( ) [virtual]

Definition at line 139 of file CJListView.cpp.

References m_pListCtrl.

00140 {
00141     CListView::OnInitialUpdate();
00142
00143     // Set a pointer to the list control.
00144     m_pListCtrl = &GetListCtrl();
00145 }

BOOL CCJListView::OnNotify | ( | WPARAM | wParam,
 |  | LPARAM | lParam,
 |  | LRESULT * | pResult
 | ) | [protected, virtual]

Definition at line 229 of file CJListView.cpp.

References m_bAscending, m_nMinSize, m_nSortedCol, m_pHeaderCtrl, CCJFlatHeaderCtrl::SetSortImage, SortList, and TRUE.

00230 {
00231     HD_NOTIFY *pHDNotify = (HD_NOTIFY*)lParam;
00232
00233     switch( pHDNotify->hdr.code )
00234     {
00235     // Sorting the list when user clicks on column header by Zafir Anjum.
00236     // http://www.codeguru.com/listview/sort_on_col_click.shtml
00237     case HDN_ITEMCLICKA:
00238     case HDN_ITEMCLICKW:
00239         {
00240             if( pHDNotify->iButton == 0 )
00241             {
00242                 // set the sort order.
00243                 if( pHDNotify->iItem == m_nSortedCol )
00244                     m_bAscending = !m_bAscending;
00245                 else
00246                     m_bAscending = true;
00247
00248                 // save the column index.
00249                 m_nSortedCol = pHDNotify->iItem;
00250
00251                 // virtual call to sort list.
00252                 SortList( m_nSortedCol, m_bAscending );
00253
00254                 // set the sort image in the header control.
00255                 if( m_pHeaderCtrl && m_pHeaderCtrl->GetSafeHwnd( ))
00256                     m_pHeaderCtrl->SetSortImage( m_nSortedCol, m_bAscending );
00257             }
00258         }
00259         break;
00260
00261     // How to force a minimum column width Cees Mechielsen.
00262     // http://www.codeguru.com/mfc/comments/866.shtml
00263     case HDN_ITEMCHANGINGA:
00264     case HDN_ITEMCHANGINGW:
00265     case HDN_ENDTRACK:
00266         {
00267             if( pHDNotify->pitem->mask & HDI_WIDTH &&
00268                 pHDNotify->pitem->cxy < m_nMinSize &&
00269                 pHDNotify->pitem->cxy >= 0 )
00270             {
00271                 pHDNotify->pitem->cxy = m_nMinSize; // Set the column width
00272             }
00273         }
00274         break;
00275
00276     // Prevent CListCtrl column resizing by Zafir Anjum.
00277     // http://www.codeguru.com/listview/no_col_resize.shtml
00278     case HDN_DIVIDERDBLCLICKA:
00279     case HDN_DIVIDERDBLCLICKW:
00280     case HDN_BEGINTRACKW:
00281     case HDN_BEGINTRACKA:
00282         {
00283             if(m_bNoColSizing)
00284             {
00285                 *pResult = TRUE;                // disable tracking
00286                 return TRUE;                    // Processed message
00287             }
00288             break;
00289         }
00290     }
00291
00292     return CListView::OnNotify(wParam, lParam, pResult);
00293 }

void CCJListView::SaveColumnWidths ( ) [virtual]

Definition at line 448 of file CJListView.cpp.

References m_pListCtrl, m_strEntry, and m_strSection.

Referenced by OnDestroy.

00449 {
00450     // get a pointer to the header control.
00451     CHeaderCtrl* pHeader = DYNAMIC_DOWNCAST(CHeaderCtrl, GetDlgItem(0));
00452     ASSERT_KINDOF( CHeaderCtrl, pHeader );
00453
00454     CString strValue;
00455     for( int i = 0; i < pHeader->GetItemCount(); ++i )
00456     {
00457         CString strTemp;
00458         strTemp.Format(_T("%d,"), m_pListCtrl->GetColumnWidth( i ));
00459         strValue += strTemp;
00460     }
00461
00462     AfxGetApp()->WriteProfileString( m_strSection, m_strEntry, strValue );
00463 }

void CCJListView::SetColumnWidth ( int nCol ) [virtual]

Definition at line 475 of file CJListView.cpp.

References AutoSizeColumn, GetStoredWidth, m_nMinColWidth, and m_pListCtrl.

Referenced by LoadColumnWidths.

00476 {
00477     int nWidth = GetStoredWidth( nCol );
00478     if( nWidth > m_nMinColWidth )
00479         m_pListCtrl->SetColumnWidth( nCol, nWidth );
00480     else
00481         AutoSizeColumn( nCol );
00482 }

_CJXLIB_INLINE void CCJListView::SetExtendedStyle ( DWORD dwExStyle ) [virtual]

Definition at line 274 of file CJListView.h.

References ASSERT, and GetExtendedStyle.

00275     { ASSERT(::IsWindow(m_hWnd)); SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, GetExtendedStyle()|dwExStyle); }

_CJXLIB_INLINE void CCJListView::SetMinimumColSize ( int nSize ) [virtual]

Definition at line 280 of file CJListView.h.

References m_nMinSize.

00281     { m_nMinSize = nSize; }

_CJXLIB_INLINE void CCJListView::SetRowColors | ( | COLORREF | clrText,
 |  | COLORREF | clrTextBk
 | ) | [virtual]

Definition at line 277 of file CJListView.h.

References m_clrText, and m_clrTextBk.

00278     { m_clrText = clrText; m_clrTextBk = clrTextBk; }

bool CCJListView::SortList | ( | int | nCol,
 |  | bool | bAscending
 | ) | [virtual]

Definition at line 295 of file CJListView.cpp.

Referenced by OnNotify.

00296 {
00297 #ifdef _DEBUG
00298     TRACE2("Column sort on column index %d, ascending=%d", nCol, bAscending);
00299 #else
00300     UNUSED_ALWAYS( nCol );
00301     UNUSED_ALWAYS( bAscending );
00302 #endif
00303
00304     return true;
00305 }

bool CCJListView::SubclassHeader ( bool bBoldFont = false ) [virtual]

Definition at line 410 of file CJListView.cpp.

References ASSERT, CCJFlatHeaderCtrl::InitializeHeader, and m_pHeaderCtrl.

00411 {
00412     // allocate memory for the flat header.
00413     m_pHeaderCtrl = new CCJFlatHeaderCtrl;
00414     ASSERT( m_pHeaderCtrl );
00415
00416     // get the window handle to the existing header
00417     // control.
00418     HWND hWnd = GetDlgItem(0)->GetSafeHwnd();
00419     ASSERT( hWnd );
00420
00421     // subclass the flat header control.
00422     if( !m_pHeaderCtrl->SubclassWindow( hWnd ))
00423         return false;
00424
00425     // finish header initialization.
00426     m_pHeaderCtrl->InitializeHeader( bBoldFont );
00427
00428     return true;
00429 }

Member Data Documentation

bool CCJListView::m_bAscending [private]

Definition at line 115 of file CJListView.h.

Referenced by OnNotify.

bool CCJListView::m_bAutoSave [private]

Definition at line 114 of file CJListView.h.

Referenced by AutoSaveColumns.

bool CCJListView::m_bNoColSizing [protected]

Definition at line 109 of file CJListView.h.

Referenced by DisableColumnSizing.

COLORREF CCJListView::m_clrText [protected]

Definition at line 107 of file CJListView.h.

Referenced by OnCustomDraw, and SetRowColors.

COLORREF CCJListView::m_clrTextBk [protected]

Definition at line 108 of file CJListView.h.

Referenced by OnCustomDraw, and SetRowColors.

int CCJListView::m_nMaxColWidth [protected]

Definition at line 100 of file CJListView.h.

Referenced by AutoSizeColumn.

int CCJListView::m_nMinColWidth [protected]

Definition at line 99 of file CJListView.h.

Referenced by AutoSizeColumn, and SetColumnWidth.

int CCJListView::m_nMinSize [protected]

Definition at line 110 of file CJListView.h.

Referenced by OnNotify, and SetMinimumColSize.

int CCJListView::m_nSortedCol [protected]

Definition at line 101 of file CJListView.h.

Referenced by OnNotify.

CCJFlatHeaderCtrl* CCJListView::m_pHeaderCtrl [protected]

Definition at line 102 of file CJListView.h.

Referenced by OnNotify, SubclassHeader, and ~CCJListView.

CListCtrl* CCJListView::m_pListCtrl [protected]

Definition at line 106 of file CJListView.h.

Referenced by AddColumn, AutoSizeColumn, CopyRow, GetColumnCount, HitTestEx, MoveRow, OnInitialUpdate, SaveColumnWidths, and SetColumnWidth.

CString CCJListView::m_strDefault [protected]

Definition at line 105 of file CJListView.h.

Referenced by AutoSaveColumns, and GetStoredWidth.

CString CCJListView::m_strEntry [protected]

Definition at line 104 of file CJListView.h.

Referenced by AutoSaveColumns, GetStoredWidth, and SaveColumnWidths.

CString CCJListView::m_strSection [protected]

Definition at line 103 of file CJListView.h.

Referenced by AutoSaveColumns, GetStoredWidth, and SaveColumnWidths.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJListView.h
  • WinCvs/CJLib/CJLibrary/CJListView.cpp
Generated on Sun Feb 24 01:24:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJLogoPane Class Reference

#include <CJLogoPane.h>

Inheritance diagram for CCJLogoPane:

[legend]
Collaboration diagram for CCJLogoPane:

[legend]
List of all members.

Public Methods

CCJLogoPane ()
virtual void | SetLogoText (LPCTSTR lpszLogoText)
virtual CString | GetLogoText ()
virtual void | SetLogoFont (LPCTSTR lpszFontName, int nHeight=24, int nWeight=FW_BOLD, BOOL bItalic=TRUE, BOOL bUnderline=FALSE)
virtual BOOL | Create (LPCTSTR lpszWindowName, DWORD dwStyle, CWnd *pParentWnd, UINT nID)
virtual | ~CCJLogoPane ()

Public Attributes

CString | m_strLogoText
CFont | m_Font

Protected Methods

afx_msg void | OnPaint ()

Constructor & Destructor Documentation

CCJLogoPane::CCJLogoPane ( )

Definition at line 33 of file CJLogoPane.cpp.

References SetLogoFont.

00034 {
00035     SetLogoFont(_T("Arial"));
00036 }

CCJLogoPane::~CCJLogoPane ( ) [virtual]

Definition at line 38 of file CJLogoPane.cpp.

References m_Font.

00039 {
00040     m_Font.DeleteObject();
00041 }

Member Function Documentation

BOOL CCJLogoPane::Create | ( | LPCTSTR | lpszWindowName,
 |  | DWORD | dwStyle,
 |  | CWnd * | pParentWnd,
 |  | UINT | nID
 | ) | [virtual]

Definition at line 93 of file CJLogoPane.cpp.

References FALSE, m_strLogoText, and TRUE.

00094 {
00095     CString wndClass = ::AfxRegisterWndClass(CS_BYTEALIGNCLIENT);
00096
00097     if(!CWnd::Create(wndClass, lpszWindowName, dwStyle, CRect(0,0,0,0), pParentWnd, nID)) {
00098         return FALSE;
00099     }
00100
00101     m_strLogoText = lpszWindowName;
00102     return TRUE;
00103 }

_CJXLIB_INLINE CString CCJLogoPane::GetLogoText ( ) [virtual]

Definition at line 76 of file CJLogoPane.h.

References m_strLogoText.

00077     { return m_strLogoText; }

void CCJLogoPane::OnPaint ( ) [protected]

Definition at line 64 of file CJLogoPane.cpp.

References m_Font, and m_strLogoText.

00065 {
00066     CPaintDC dc(this); // device context for painting
00067
00068     CRect rect;
00069     GetWindowRect(rect);
00070
00071     dc.SetBkMode(TRANSPARENT);
00072
00073     CFont * OldFont = dc.SelectObject(&m_Font);
00074
00075     // draw text in DC
00076     COLORREF OldColor = dc.SetTextColor(::GetSysColor( COLOR_3DHILIGHT));
00077
00078     rect.right  = rect.Width();
00079     rect.bottom = rect.Height();
00080     rect.left   = rect.top = 0;
00081     dc.FillSolidRect(rect, ::GetSysColor(COLOR_3DFACE));
00082
00083     dc.DrawText( m_strLogoText, rect + CPoint(1,1), DT_SINGLELINE | DT_LEFT | DT_VCENTER);
00084     dc.SetTextColor( ::GetSysColor( COLOR_3DSHADOW));
00085     dc.DrawText( m_strLogoText, rect, DT_SINGLELINE | DT_LEFT | DT_VCENTER);
00086
00087     // restore old text color
00088     dc.SetTextColor( OldColor);
00089     // restore old font
00090     dc.SelectObject(OldFont);
00091 }

void CCJLogoPane::SetLogoFont | ( | LPCTSTR | lpszFontName,
 |  | int | nHeight = 24,
 |  | int | nWeight = FW_BOLD,
 |  | BOOL | bItalic = TRUE,
 |  | BOOL | bUnderline = FALSE
 | ) | [virtual]

Definition at line 54 of file CJLogoPane.cpp.

References m_Font.

Referenced by CCJLogoPane.

00056 {
00057     if(m_Font.m_hObject) {
00058         m_Font.DeleteObject();
00059     }
00060
00061     m_Font.CreateFont(nHeight, 0, 0, 0, nWeight, (BYTE)bItalic, (BYTE)bUnderline, 0,0,0,0,0,0, lpszFontName);
00062 }

_CJXLIB_INLINE void CCJLogoPane::SetLogoText ( LPCTSTR lpszLogoText ) [virtual]

Definition at line 73 of file CJLogoPane.h.

References m_strLogoText.

00074     { m_strLogoText = lpszLogoText; }

Member Data Documentation

CFont CCJLogoPane::m_Font

Definition at line 42 of file CJLogoPane.h.

Referenced by OnPaint, SetLogoFont, and ~CCJLogoPane.

CString CCJLogoPane::m_strLogoText

Definition at line 41 of file CJLogoPane.h.

Referenced by Create, GetLogoText, OnPaint, and SetLogoText.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJLogoPane.h
  • WinCvs/CJLib/CJLibrary/CJLogoPane.cpp
Generated on Sun Feb 24 01:24:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJMaskEdit Class Reference

#include <CJMaskEdit.h>

Inheritance diagram for CCJMaskEdit:

[legend]
Collaboration diagram for CCJMaskEdit:

[legend]
List of all members.

Public Methods

CCJMaskEdit ()
virtual void | SetEditMask (LPCTSTR lpszMask, LPCTSTR lpszLiteral, LPCTSTR lpszWindowText)
virtual void | SendChar (UINT nChar)
virtual bool | CheckChar (UINT nChar)
virtual bool | ProcessMask (UINT nChar, int nEndPos)
virtual void | UpdateFont ()
virtual | ~CCJMaskEdit ()

Public Attributes

bool | m_bUseMask
bool | m_bMaskKeyInProgress
CString | m_strWindowText
CString | m_strMask
CString | m_strLiteral
CString | m_strValid
CString | m_strMaskLiteral
CFont | m_Font

Protected Methods

afx_msg void | OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags)
afx_msg void | OnChar (UINT nChar, UINT nRepCnt, UINT nFlags)
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)
afx_msg void | OnPaint ()

Constructor & Destructor Documentation

CCJMaskEdit::CCJMaskEdit ( )

Definition at line 84 of file CJMaskEdit.cpp.

References m_bMaskKeyInProgress, m_bUseMask, m_strLiteral, m_strMask, m_strMaskLiteral, m_strValid, and m_strWindowText.

00085 {
00086     m_bUseMask              = true;
00087     m_bMaskKeyInProgress    = false;
00088     m_strWindowText         = _T("");
00089     m_strMask               = _T("");
00090     m_strLiteral            = _T("");
00091     m_strValid              = _T("");
00092     m_strMaskLiteral        = _T("");
00093 }

CCJMaskEdit::~CCJMaskEdit ( ) [virtual]

Definition at line 95 of file CJMaskEdit.cpp.

References m_Font.

00096 {
00097     // fix potential resource leak - KStowell - 10-22-99.
00098     m_Font.DeleteObject();
00099 }

Member Function Documentation

bool CCJMaskEdit::CheckChar ( UINT nChar ) [virtual]

Definition at line 205 of file CJMaskEdit.cpp.

References m_bUseMask, m_strLiteral, m_strMask, m_strValid, ProcessMask, and SendChar.

Referenced by OnChar.

00206 {
00207     // do not use mask
00208     if( !m_bUseMask ) {
00209         return true;
00210     }
00211
00212     // control character, OK
00213     if( !isprint( nChar )) {
00214         return true;
00215     }
00216
00217     // unselect all selections, if any
00218     int nStartPos, nEndPos;
00219     GetSel( nStartPos, nEndPos );
00220     SetSel( -1, 0 );
00221
00222     // advance to the first character input position.
00223     for( nStartPos; nStartPos < m_strLiteral.GetLength(); ++nStartPos )
00224     {
00225         if( m_strLiteral.GetAt( nStartPos ) == '_' ) {
00226             SetSel( nStartPos, nStartPos );
00227             break;
00228         }
00229     }
00230
00231     // check the key against the mask
00232     GetSel( nStartPos, nEndPos );
00233
00234     // make sure the string is not longer than the mask
00235     if( nEndPos >= m_strMask.GetLength( )) {
00236         MessageBeep((UINT)-1);
00237         return false;
00238     }
00239
00240     // check to see if a literal is in this position
00241     UINT c = '_';
00242     if( !m_strLiteral.IsEmpty( )) {
00243         c = m_strLiteral.GetAt( nEndPos );
00244     }
00245
00246     if( c != '_' ) {
00247         SendChar( c );
00248         GetSel( nStartPos, nEndPos );
00249     }
00250
00251     // check the valid string character
00252     if( m_strValid.Find( static_cast<TCHAR>(nChar)) != -1 ) {
00253         return true;
00254     }
00255
00256     if( ProcessMask( nChar, nEndPos ))
00257         return true;
00258
00259     MessageBeep((UINT)-1);
00260     return false;
00261 }

void CCJMaskEdit::OnChar | ( | UINT | nChar,
 |  | UINT | nRepCnt,
 |  | UINT | nFlags
 | ) | [protected]

Definition at line 129 of file CJMaskEdit.cpp.

References CheckChar, FALSE, m_bMaskKeyInProgress, m_bUseMask, m_strLiteral, m_strMaskLiteral, m_strWindowText, and SendChar.

00130 {
00131     if( !m_bMaskKeyInProgress ) {
00132         if( !CheckChar( nChar )) {
00133             return;
00134         }
00135     }
00136
00137     if( m_bUseMask )
00138     {
00139         int nStartPos;
00140         int nEndPos;
00141         GetSel( nStartPos, nEndPos );
00142
00143         if( isprint( nChar ))
00144         {
00145             SetSel( nStartPos, nEndPos+1 );
00146
00147             Clear();
00148
00149             m_strWindowText.SetAt( nEndPos, static_cast<TCHAR>(nChar));
00150         }
00151         else if( nChar == VK_BACK )
00152         {
00153             if(( nStartPos == nEndPos ) &&
00154                ( nStartPos >= 1 ) &&
00155                ( nStartPos <= m_strWindowText.GetLength( )))
00156             {
00157                 UINT c = 0x20;
00158
00159                 // get the masked literal representation.
00160                 if( m_strMaskLiteral.IsEmpty() == FALSE )
00161                 {
00162                     c = m_strMaskLiteral[ nStartPos - 1 ];
00163                 }
00164
00165                 // backspace the cursor.
00166                 SendMessage( WM_KEYDOWN, VK_LEFT, 0 );
00167
00168                 if( m_strMaskLiteral.IsEmpty() == FALSE )
00169                 {
00170                     // update the char backspacing over.
00171                     SendChar( c );
00172
00173                     // backspace the cursor again.
00174                     SendMessage( WM_KEYDOWN, VK_LEFT, 0 );
00175                 }
00176             }
00177             else
00178             {
00179                 MessageBeep((UINT)-1);
00180             }
00181
00182             return;
00183         }
00184     }
00185
00186     CEdit::OnChar(nChar, nRepCnt, nFlags);
00187
00188     if( !m_bMaskKeyInProgress && m_bUseMask && !m_strLiteral.IsEmpty( ))
00189     {
00190         int nStartPos;
00191         int nEndPos;
00192         GetSel( nStartPos, nEndPos );
00193
00194         // make sure the string is not longer than the mask
00195         if( nEndPos < m_strLiteral.GetLength( ))
00196         {
00197             UINT c = m_strLiteral.GetAt( nEndPos );
00198             if (c != '_') {
00199                 SetSel( nEndPos+1, nEndPos+1 );
00200             }
00201         }
00202     }
00203 }

BOOL CCJMaskEdit::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 601 of file CJMaskEdit.cpp.

References TRUE.

00602 {
00603     // KStowell - overridden for flicker-free drawing.
00604     UNUSED_ALWAYS(pDC);
00605     return TRUE;
00606 }

void CCJMaskEdit::OnKeyDown | ( | UINT | nChar,
 |  | UINT | nRepCnt,
 |  | UINT | nFlags
 | ) | [protected]

Definition at line 115 of file CJMaskEdit.cpp.

00116 {
00117     if( m_bUseMask )
00118     {
00119         switch( nChar )
00120         {
00121         case VK_DELETE:
00122         case VK_INSERT: return;
00123         }
00124     }
00125
00126     CEdit::OnKeyDown(nChar, nRepCnt, nFlags);
00127 }

void CCJMaskEdit::OnPaint ( ) [protected]

Definition at line 608 of file CJMaskEdit.cpp.

00609 {
00610     // Use a "Offscreen" DC to fill rect and send to DefWindowProc...
00611     CClientDC memDC(this);
00612
00613     CRect rcClip;
00614     GetClientRect(&rcClip);
00615     memDC.FillSolidRect(rcClip, ::GetSysColor(COLOR_WINDOW));
00616     DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, (LPARAM)0 );
00617
00618     // Default is called for cleanup.
00619     Default();
00620 }

bool CCJMaskEdit::ProcessMask | ( | UINT | nChar,
 |  | int | nEndPos
 | ) | [virtual]

Reimplemented in CCJDateEdit.

Definition at line 274 of file CJMaskEdit.cpp.

References m_strMask.

Referenced by CheckChar.

00275 {
00276     // check the key against the mask
00277     switch( m_strMask.GetAt( nEndPos ))
00278     {
00279     case '0':       // digit only //completely changed this
00280         {
00281             if( isdigit( nChar )) {
00282                 return true;
00283             }
00284             break;
00285         }
00286     case '9':       // digit or space
00287         {
00288             if( isdigit( nChar )) {
00289                 return true;
00290             }
00291             if( nChar == VK_SPACE ) {
00292                 return true;
00293             }
00294             break;
00295         }
00296     case '#':       // digit or space or '+' or '-'
00297         {
00298             if( isdigit( nChar )) {
00299                 return true;
00300             }
00301             if( nChar == VK_SPACE || nChar == VK_ADD || nChar == VK_SUBTRACT ) {
00302                 return true;
00303             }
00304             break;
00305         }
00306     case 'L':       // alpha only
00307         {
00308             if( isalpha( nChar )) {
00309                 return true;
00310             }
00311             break;
00312         }
00313     case '?':       // alpha or space
00314         {
00315             if( isalpha( nChar )) {
00316                 return true;
00317             }
00318             if( nChar == VK_SPACE ) {
00319                 return true;
00320             }
00321             break;
00322         }
00323     case 'A':       // alpha numeric only
00324         {
00325             if( isalnum( nChar )) {
00326                 return true;
00327             }
00328             break;
00329         }
00330     case 'a':       // alpha numeric or space
00331         {
00332             if( isalnum( nChar )) {
00333                 return true;
00334             }
00335             if( nChar == VK_SPACE ) {
00336                 return true;
00337             }
00338             break;
00339         }
00340     case '&':       // all print character only
00341         {
00342             if( isprint( nChar )) {
00343                 return true;
00344             }
00345             break;
00346         }
00347     case 'H':       // hex digit
00348         {
00349             if( isxdigit( nChar )) {
00350                 return true;
00351             }
00352             break;
00353         }
00354     case 'X':       // hex digit or space
00355         {
00356             if( isxdigit( nChar )) {
00357                 return true;
00358             }
00359             if( nChar == VK_SPACE ) {
00360                 return true;
00361             }
00362             break;
00363         }
00364     }
00365
00366     return false;
00367 }

void CCJMaskEdit::SendChar ( UINT nChar ) [virtual]

Definition at line 263 of file CJMaskEdit.cpp.

References m_bMaskKeyInProgress.

Referenced by CheckChar, and OnChar.

00264 {
00265     m_bMaskKeyInProgress = true;
00266 #ifdef WIN32
00267     AfxCallWndProc(this, m_hWnd, WM_CHAR, nChar, 1);
00268 #else
00269     SendMessage(WM_CHAR, nChar, 1);
00270 #endif
00271     m_bMaskKeyInProgress = false;
00272 }

void CCJMaskEdit::SetEditMask | ( | LPCTSTR | lpszMask,
 |  | LPCTSTR | lpszLiteral,
 |  | LPCTSTR | lpszWindowText
 | ) | [virtual]

Definition at line 369 of file CJMaskEdit.cpp.

References ASSERT, m_strLiteral, m_strMask, m_strMaskLiteral, m_strWindowText, and UpdateFont.

00370 {
00371     ASSERT(lpszMask);
00372     ASSERT(lpszLiteral);
00373     ASSERT(lpszWindowText);
00374
00375     // initialize the mask for the control.
00376     m_strMask        = lpszMask;
00377     m_strLiteral     = lpszLiteral;
00378     m_strWindowText  = lpszWindowText;
00379     m_strMaskLiteral = m_strWindowText;
00380
00381     // set the window text for the control.
00382     SetWindowText( lpszWindowText );
00383
00384     // initialize the font used by the control.
00385     UpdateFont();
00386 }

void CCJMaskEdit::UpdateFont ( ) [virtual]

Definition at line 591 of file CJMaskEdit.cpp.

References m_Font, and VERIFY.

Referenced by SetEditMask.

00592 {
00593     m_Font.DeleteObject();
00594     NONCLIENTMETRICS ncm;
00595     ncm.cbSize = sizeof(ncm);
00596     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00597     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00598     SetFont(&m_Font);
00599 }

Member Data Documentation

bool CCJMaskEdit::m_bMaskKeyInProgress

Definition at line 73 of file CJMaskEdit.h.

Referenced by CCJMaskEdit, OnChar, and SendChar.

bool CCJMaskEdit::m_bUseMask

Definition at line 72 of file CJMaskEdit.h.

Referenced by CCJDateEdit::CCJDateEdit, CCJMaskEdit, CCJTimeEdit::CCJTimeEdit, CheckChar, and OnChar.

CFont CCJMaskEdit::m_Font

Definition at line 79 of file CJMaskEdit.h.

Referenced by UpdateFont, and ~CCJMaskEdit.

CString CCJMaskEdit::m_strLiteral

Definition at line 76 of file CJMaskEdit.h.

Referenced by CCJDateEdit::CCJDateEdit, CCJMaskEdit, CCJTimeEdit::CCJTimeEdit, CheckChar, OnChar, and SetEditMask.

CString CCJMaskEdit::m_strMask

Definition at line 75 of file CJMaskEdit.h.

Referenced by CCJDateEdit::CCJDateEdit, CCJMaskEdit, CCJTimeEdit::CCJTimeEdit, CheckChar, CCJTimeEdit::ProcessMask, CCJDateEdit::ProcessMask, ProcessMask, and SetEditMask.

CString CCJMaskEdit::m_strMaskLiteral

Definition at line 78 of file CJMaskEdit.h.

Referenced by CCJMaskEdit, OnChar, CCJDateEdit::SetDateTime, and SetEditMask.

CString CCJMaskEdit::m_strValid

Definition at line 77 of file CJMaskEdit.h.

Referenced by CCJMaskEdit, and CheckChar.

CString CCJMaskEdit::m_strWindowText

Definition at line 74 of file CJMaskEdit.h.

Referenced by CCJMaskEdit, OnChar, CCJTimeEdit::ProcessMask, CCJDateEdit::ProcessMask, CCJDateEdit::SetDateTime, and SetEditMask.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJMaskEdit.h
  • WinCvs/CJLib/CJLibrary/CJMaskEdit.cpp
Generated on Sun Feb 24 01:24:50 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJMDIChildWnd Class Reference

#include <CJMDIChildWnd.h>

Inheritance diagram for CCJMDIChildWnd:

[legend]
Collaboration diagram for CCJMDIChildWnd:

[legend]
List of all members.

Public Methods

CCJMDIChildWnd ()
virtual | ~CCJMDIChildWnd ()
virtual HMENU | GetInitializedMenu (UINT nMenuID, UINT nToolBarID)
virtual HMENU | GetInitializedMenu (UINT nMenuID, UINT *nToolbarIDs, int nSize)
virtual UINT | GetMenuID ()
virtual UINT | GetToolBarID ()
virtual UINT * | GetToolBarIDs (int &nCount)
virtual void | SetResourceIDs (UINT nMenuID, UINT nToolBarID)
virtual void | SetResourceIDs (UINT nMenuID, UINT *nToolBarIDs, int nCount)
virtual void | RecalcLayout (BOOL bNotify=TRUE)

Protected Types

enum DockFlatBorders {
brdrAllRaised = 0x0000,
brdrFlatTop = 0x0001,
brdrFlatBottom = 0x0002,
brdrFlatLeft = 0x0004,
brdrFlatRight = 0x0008,
brdrFlatVertical = 0x0003,
brdrFlatHorizontal = 0x000C,
brdrFlatAll = 0x000F
}

Protected Methods

virtual void | RecalcAllExcept (CCJSizeDockBar *pBar)
virtual void | EnableDocking (DWORD dwDockStyle)
virtual void | EnableDockingSizeBar (DWORD dwDockStyle, DockFlatBorders FlatFlags=brdrAllRaised)
virtual void | DockSizeBar (CControlBar *pBar, CCJSizeDockBar *pDockBar=NULL, LPRECT lpRect=NULL)
virtual void | DockControlBarLeftOf (CControlBar *Bar, CControlBar *LeftOf)
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)

Protected Attributes

HMENU | m_hMenu
UINT | m_nMenuID
UINT | m_nToolBarID
UINT * | m_nToolBarIDs
int | m_nCount

Static Protected Attributes

DWORD | dwDockBarMap [4][2]

Member Enumeration Documentation

enum CCJMDIChildWnd::DockFlatBorders [protected]

Enumeration values:
brdrAllRaised
brdrFlatTop
brdrFlatBottom
brdrFlatLeft
brdrFlatRight
brdrFlatVertical
brdrFlatHorizontal
brdrFlatAll

Definition at line 112 of file CJMDIChildWnd.h.

00112                          {
00113         brdrAllRaised       = 0x0000,
00114         brdrFlatTop         = 0x0001,
00115         brdrFlatBottom      = 0x0002,
00116         brdrFlatLeft        = 0x0004,
00117         brdrFlatRight       = 0x0008,
00118         brdrFlatVertical    = 0x0003,
00119         brdrFlatHorizontal  = 0x000C,
00120         brdrFlatAll         = 0x000F
00121     };

Constructor & Destructor Documentation

CCJMDIChildWnd::CCJMDIChildWnd ( )

Definition at line 72 of file CJMDIChildWnd.cpp.

References m_hMenu, m_nCount, m_nMenuID, m_nToolBarID, m_nToolBarIDs, and NULL.

00073 {
00074     m_hMenu       = NULL;
00075     m_nToolBarIDs = NULL;
00076     m_nMenuID     = 0;
00077     m_nToolBarID  = 0;
00078     m_nCount      = 0;
00079 }

CCJMDIChildWnd::~CCJMDIChildWnd ( ) [virtual]

Definition at line 81 of file CJMDIChildWnd.cpp.

00082 {
00083 }

Member Function Documentation

void CCJMDIChildWnd::DockControlBarLeftOf | ( | CControlBar * | Bar,
 |  | CControlBar * | LeftOf
 | ) | [protected, virtual]

Definition at line 104 of file CJMDIChildWnd.cpp.

References RecalcLayout, and TRUE.

00105 {
00106     CRect rect;
00107     DWORD dw;
00108     UINT n;
00109
00110     // get MFC to adjust the dimensions of all docked ToolBars
00111     // so that GetWindowRect will be accurate
00112     RecalcLayout(TRUE);
00113
00114     LeftOf->GetWindowRect(&rect);
00115     rect.OffsetRect(1,0);
00116     dw=LeftOf->GetBarStyle();
00117     n = 0;
00118     n = (dw&CBRS_ALIGN_TOP)              ? AFX_IDW_DOCKBAR_TOP      : n;
00119     n = (dw&CBRS_ALIGN_BOTTOM   && n==0) ? AFX_IDW_DOCKBAR_BOTTOM   : n;
00120     n = (dw&CBRS_ALIGN_LEFT     && n==0) ? AFX_IDW_DOCKBAR_LEFT     : n;
00121     n = (dw&CBRS_ALIGN_RIGHT    && n==0) ? AFX_IDW_DOCKBAR_RIGHT    : n;
00122
00123     // When we take the default parameters on rect, DockControlBar will dock
00124     // each Toolbar on a seperate line. By calculating a rectangle, we in effect
00125     // are simulating a Toolbar being dragged to that location and docked.
00126     DockControlBar(Bar,n,&rect);
00127 }

void CCJMDIChildWnd::DockSizeBar | ( | CControlBar * | pBar,
 |  | CCJSizeDockBar * | pDockBar = NULL,
 |  | LPRECT | lpRect = NULL
 | ) | [protected, virtual]

Definition at line 209 of file CJMDIChildWnd.cpp.

References ASSERT, dwSizeBarMap, NULL, and CCJSizeDockBar::SetActualSize.

00210 {
00211     ASSERT(pBar != NULL);
00212     ASSERT(pBar->m_pDockContext != NULL);
00213
00214     if( pDockBar == NULL )
00215     {
00216         for (int i = 0; i < 4; i++)
00217         {
00218             if ((dwSizeBarMap[i][1] & CBRS_ALIGN_ANY) == (pBar->m_dwStyle & CBRS_ALIGN_ANY))
00219             {
00220                 pDockBar = (CCJSizeDockBar*)GetControlBar(dwSizeBarMap[i][0]);
00221                 ASSERT(pDockBar != NULL);
00222
00223                 int nSize = 0;
00224
00225                 switch(i)
00226                 {
00227                 case 0: // horizontal dock
00228                 case 1:
00229                     nSize = ((CCJControlBar*)pBar)->GetHorzSize();
00230                     break;
00231                 case 2: // vertical dock
00232                 case 3:
00233                     nSize = ((CCJControlBar*)pBar)->GetVertSize();
00234                     break;
00235                 }
00236
00237                 pDockBar->SetActualSize( nSize );
00238                 break;
00239             }
00240         }
00241     }
00242
00243     ASSERT(pDockBar != NULL);
00244     ASSERT(m_listControlBars.Find(pBar) != NULL);
00245     ASSERT(pBar->m_pDockSite == this);
00246     ((CCJControlBar*)pBar)->Normalize();
00247     pDockBar->DockControlBar(pBar, lpRect);
00248 }

void CCJMDIChildWnd::EnableDocking ( DWORD dwDockStyle ) [protected, virtual]

Definition at line 129 of file CJMDIChildWnd.cpp.

References ASSERT, and dwDockBarMap.

00130 {
00131     // must be CBRS_ALIGN_XXX or CBRS_FLOAT_MULTI only
00132     ASSERT((dwDockStyle & ~(CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI)) == 0);
00133     CMDIChildWnd::EnableDocking(dwDockStyle);
00134
00135     for (int i = 0; i < 4; i++) {
00136         if (dwDockBarMap[i][1] & dwDockStyle & CBRS_ALIGN_ANY) {
00137             CDockBar* pDock = (CDockBar*)GetControlBar(dwDockBarMap[i][0]);
00138
00139             // make sure the dock bar is of correct type
00140             if( pDock || !pDock->IsKindOf(RUNTIME_CLASS(CCJDockBar)) ) {
00141                 BOOL bNeedDelete = ! pDock->m_bAutoDelete;
00142                 pDock->m_pDockSite->RemoveControlBar(pDock);
00143                 pDock->m_pDockSite = 0; // avoid problems in destroying the dockbar
00144                 pDock->DestroyWindow();
00145                 if( bNeedDelete )
00146                     delete pDock;
00147                 pDock = 0;
00148             }
00149
00150             if( pDock == 0 ) {
00151                 pDock = new CCJDockBar;
00152                 if (!pDock->Create(this,
00153                     WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_CHILD|WS_VISIBLE |
00154                     dwDockBarMap[i][1], dwDockBarMap[i][0])) {
00155                     AfxThrowResourceException();
00156                 }
00157             }
00158         }
00159     }
00160 }

void CCJMDIChildWnd::EnableDockingSizeBar | ( | DWORD | dwDockStyle,
 |  | DockFlatBorders | FlatFlags = brdrAllRaised
 | ) | [protected, virtual]

Definition at line 169 of file CJMDIChildWnd.cpp.

References ASSERT, dwSizeBarMap, CCJSizeDockBar::FlatBorder, and NULL.

00170 {
00171     // must be CBRS_ALIGN_XXX or CBRS_FLOAT_MULTI only
00172     ASSERT((dwDockStyle & ~(CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI)) == 0);
00173
00174     m_pFloatingFrameClass = RUNTIME_CLASS(CCJMiniDockFrameWnd);
00175     for (int i = 0; i < 4; i++)
00176     {
00177         if (dwSizeBarMap[i][1] & dwDockStyle & CBRS_ALIGN_ANY)
00178         {
00179             CCJSizeDockBar* pDock = (CCJSizeDockBar*)GetControlBar(dwSizeBarMap[i][0]);
00180             if (pDock == NULL)
00181             {
00182                 pDock = new CCJSizeDockBar;
00183
00184                 if (!pDock->Create(this,
00185                     WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_CHILD|WS_VISIBLE |
00186                         dwSizeBarMap[i][1], dwSizeBarMap[i][0]))
00187                 {
00188                     AfxThrowResourceException();
00189                 }
00190                 //Yiannhs enable Flat Borders For dock Bars
00191                 pDock->FlatBorder( (FlatFlags >> i) & 0x0001 );
00192             }
00193         }
00194     }
00195 }

HMENU CCJMDIChildWnd::GetInitializedMenu | ( | UINT | nMenuID,
 |  | UINT * | nToolbarIDs,
 |  | int | nSize
 | ) | [virtual]

Definition at line 266 of file CJMDIChildWnd.cpp.

References CCJMDIFrameWnd::InitializeMenu, m_hMenu, m_nCount, m_nMenuID, and m_nToolBarIDs.

00267 {
00268     if( m_hMenu ) {
00269         return m_hMenu;
00270     }
00271
00272     CCJMDIFrameWnd* pMainFrame = DYNAMIC_DOWNCAST(CCJMDIFrameWnd, GetParentFrame());
00273     if( pMainFrame ) {
00274         pMainFrame->InitializeMenu( &m_hMenu, nMenuID, nToolbarIDs, nSize);
00275         m_nMenuID     = nMenuID;
00276         m_nToolBarIDs = nToolbarIDs;
00277         m_nCount      = nSize;
00278     }
00279
00280     return m_hMenu;
00281 }

HMENU CCJMDIChildWnd::GetInitializedMenu | ( | UINT | nMenuID,
 |  | UINT | nToolBarID
 | ) | [virtual]

Definition at line 250 of file CJMDIChildWnd.cpp.

References CCJMDIFrameWnd::InitializeMenu, m_hMenu, m_nMenuID, and m_nToolBarID.

00251 {
00252     if( m_hMenu ) {
00253         return m_hMenu;
00254     }
00255
00256     CCJMDIFrameWnd* pMainFrame = DYNAMIC_DOWNCAST(CCJMDIFrameWnd, GetParentFrame());
00257     if( pMainFrame ) {
00258         pMainFrame->InitializeMenu( &m_hMenu, nMenuID, nToolBarID );
00259         m_nMenuID     = nMenuID;
00260         m_nToolBarID  = nToolBarID;
00261     }
00262
00263     return m_hMenu;
00264 }

_CJXLIB_INLINE UINT CCJMDIChildWnd::GetMenuID ( ) [virtual]

Definition at line 188 of file CJMDIChildWnd.h.

References m_nMenuID.

00189     { return m_nMenuID; }

_CJXLIB_INLINE UINT CCJMDIChildWnd::GetToolBarID ( ) [virtual]

Definition at line 191 of file CJMDIChildWnd.h.

References m_nToolBarID.

00192     { return m_nToolBarID; }

_CJXLIB_INLINE UINT * CCJMDIChildWnd::GetToolBarIDs ( int & nCount ) [virtual]

Definition at line 194 of file CJMDIChildWnd.h.

References m_nCount, and m_nToolBarIDs.

00195     { nCount = m_nCount; return m_nToolBarIDs; }

BOOL CCJMDIChildWnd::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 283 of file CJMDIChildWnd.cpp.

00284 {
00285     CRect rect;
00286     GetClientRect(&rect);
00287     pDC->ExcludeClipRect(rect);
00288
00289     return CMDIChildWnd::OnEraseBkgnd(pDC);
00290 }

void CCJMDIChildWnd::RecalcAllExcept ( CCJSizeDockBar * pBar ) [protected, virtual]

Definition at line 197 of file CJMDIChildWnd.cpp.

References CCJSizeDockBar::CalcSizeBarLayout, dwSizeBarMap, and NULL.

Referenced by RecalcLayout.

00198 {
00199     for (int i = 0; i < 4; i++)
00200     {
00201         CCJSizeDockBar* pDock = (CCJSizeDockBar*)GetControlBar(dwSizeBarMap[i][0]);
00202         if (pDock != NULL && pDock != pBar)
00203         {
00204             pDock->CalcSizeBarLayout();
00205         }
00206     }
00207 }

void CCJMDIChildWnd::RecalcLayout ( BOOL bNotify = TRUE ) [virtual]

Definition at line 162 of file CJMDIChildWnd.cpp.

References NULL, and RecalcAllExcept.

Referenced by DockControlBarLeftOf.

00163 {
00164     CMDIChildWnd::RecalcLayout(bNotify);
00165     RecalcAllExcept(NULL);
00166 }

_CJXLIB_INLINE void CCJMDIChildWnd::SetResourceIDs | ( | UINT | nMenuID,
 |  | UINT * | nToolBarIDs,
 |  | int | nCount
 | ) | [virtual]

Definition at line 200 of file CJMDIChildWnd.h.

References m_nCount, m_nMenuID, and m_nToolBarIDs.

00201     { m_nMenuID = nMenuID; m_nToolBarIDs = nToolBarIDs; m_nCount = nCount; }

_CJXLIB_INLINE void CCJMDIChildWnd::SetResourceIDs | ( | UINT | nMenuID,
 |  | UINT | nToolBarID
 | ) | [virtual]

Definition at line 197 of file CJMDIChildWnd.h.

References m_nMenuID, and m_nToolBarID.

00198     { m_nMenuID = nMenuID; m_nToolBarID = nToolBarID; }

Member Data Documentation

DWORD CCJMDIChildWnd::dwDockBarMap [static, protected]

Initial value:

{
    { AFX_IDW_DOCKBAR_TOP,      CBRS_TOP    },
    { AFX_IDW_DOCKBAR_BOTTOM,   CBRS_BOTTOM },
    { AFX_IDW_DOCKBAR_LEFT,     CBRS_LEFT   },
    { AFX_IDW_DOCKBAR_RIGHT,    CBRS_RIGHT  },
}

Definition at line 96 of file CJMDIChildWnd.cpp.

Referenced by EnableDocking.

HMENU CCJMDIChildWnd::m_hMenu [protected]

Definition at line 103 of file CJMDIChildWnd.h.

Referenced by CCJMDIChildWnd, and GetInitializedMenu.

int CCJMDIChildWnd::m_nCount [protected]

Definition at line 107 of file CJMDIChildWnd.h.

Referenced by CCJMDIChildWnd, GetInitializedMenu, GetToolBarIDs, and SetResourceIDs.

UINT CCJMDIChildWnd::m_nMenuID [protected]

Definition at line 104 of file CJMDIChildWnd.h.

Referenced by CCJMDIChildWnd, GetInitializedMenu, GetMenuID, and SetResourceIDs.

UINT CCJMDIChildWnd::m_nToolBarID [protected]

Definition at line 105 of file CJMDIChildWnd.h.

Referenced by CCJMDIChildWnd, GetInitializedMenu, GetToolBarID, and SetResourceIDs.

UINT* CCJMDIChildWnd::m_nToolBarIDs [protected]

Definition at line 106 of file CJMDIChildWnd.h.

Referenced by CCJMDIChildWnd, GetInitializedMenu, GetToolBarIDs, and SetResourceIDs.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJMDIChildWnd.h
  • WinCvs/CJLib/CJLibrary/CJMDIChildWnd.cpp
Generated on Sun Feb 24 01:24:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJMDIFrameWnd Class Reference

#include <CJMDIFrameWnd.h>

Inheritance diagram for CCJMDIFrameWnd:

[legend]
Collaboration diagram for CCJMDIFrameWnd:

[legend]
List of all members.

Public Methods

CCJMDIFrameWnd ()
virtual | ~CCJMDIFrameWnd ()
virtual void | LoadBarState (LPCTSTR lpszProfileName)
virtual void | SaveBarState (LPCTSTR lpszProfileName) const
virtual BOOL | InitializeMenu (CMultiDocTemplate *pDocTemplate, UINT nMenuID, UINT *nToolbarIDs=NULL, int nSize=0, UINT nDefaultMenuID=NULL)
virtual BOOL | InitializeMenu (CMultiDocTemplate *pDocTemplate, UINT nMenuID, UINT nToolbarID=NULL, UINT nDefaultMenuID=NULL)
virtual BOOL | InitializeMenu (HMENU *phMenu, UINT nMenuID, UINT nToolbarID=NULL)
virtual BOOL | InitializeMenu (HMENU *phMenu, UINT nMenuID, UINT *nToolbarIDs=NULL, int nSize=NULL)
virtual void | RecalcAllExcept (CCJSizeDockBar *pBar)
virtual void | EnableDocking (DWORD dwDockStyle)
virtual void | EnableDockingSizeBar (DWORD dwDockStyle, DockFlatBorders FlatFlags=brdrAllRaised)
virtual void | DockSizeBar (CControlBar *pBar, CCJSizeDockBar *pDockBar=NULL, LPRECT lpRect=NULL)
virtual void | DockControlBarLeftOf (CControlBar *Bar, CControlBar *LeftOf)
virtual void | RecalcLayout (BOOL bNotify=TRUE)

Protected Types

enum DockFlatBorders {
brdrAllRaised = 0x0000,
brdrFlatTop = 0x0001,
brdrFlatBottom = 0x0002,
brdrFlatLeft = 0x0004,
brdrFlatRight = 0x0008,
brdrFlatVertical = 0x0003,
brdrFlatHorizontal = 0x000C,
brdrFlatAll = 0x000F
}

Protected Methods

virtual HMENU | NewMenu (UINT nMenuID, UINT *nToolbarIDs=NULL, int nSize=0)
virtual HMENU | NewMenu (UINT nMenuID, UINT nToolbarID=NULL)
virtual BOOL | PreCreateWindow (CREATESTRUCT &cs)
virtual BOOL | PreCreateWindow (CREATESTRUCT &cs, UINT nIconID)
afx_msg void | OnMeasureItem (int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)
afx_msg LRESULT | OnMenuChar (UINT nChar, UINT nFlags, CMenu *pMenu)
afx_msg void | OnInitMenuPopup (CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu)
afx_msg void | OnClose ()

Protected Attributes

CMDIMenuList m_menuList
CCJMenuBar m_wndMenuBar

Static Protected Attributes

DWORD | dwDockBarMap [4][2]

Member Enumeration Documentation

enum CCJMDIFrameWnd::DockFlatBorders [protected]

Enumeration values:
brdrAllRaised
brdrFlatTop
brdrFlatBottom
brdrFlatLeft
brdrFlatRight
brdrFlatVertical
brdrFlatHorizontal
brdrFlatAll

Definition at line 170 of file CJMDIFrameWnd.h.

00170                          {
00171         brdrAllRaised       = 0x0000,
00172         brdrFlatTop         = 0x0001,
00173         brdrFlatBottom      = 0x0002,
00174         brdrFlatLeft        = 0x0004,
00175         brdrFlatRight       = 0x0008,
00176         brdrFlatVertical    = 0x0003,
00177         brdrFlatHorizontal  = 0x000C,
00178         brdrFlatAll         = 0x000F
00179     };

Constructor & Destructor Documentation

CCJMDIFrameWnd::CCJMDIFrameWnd ( )

Definition at line 148 of file CJMDIFrameWnd.cpp.

00149 {
00150
00151 }

CCJMDIFrameWnd::~CCJMDIFrameWnd ( ) [virtual]

Definition at line 153 of file CJMDIFrameWnd.cpp.

References _delete, and m_menuList.

00154 {
00155     // Free up any allocated memory.
00156     while (!m_menuList.IsEmpty()) {
00157         CCJMenu* pMenu = m_menuList.RemoveTail();
00158         _delete(pMenu);
00159     }
00160 }

Member Function Documentation

void CCJMDIFrameWnd::DockControlBarLeftOf | ( | CControlBar * | Bar,
 |  | CControlBar * | LeftOf
 | ) | [virtual]

Definition at line 185 of file CJMDIFrameWnd.cpp.

References RecalcLayout, and TRUE.

00186 {
00187     CRect rect;
00188     DWORD dw;
00189     UINT n;
00190
00191     // get MFC to adjust the dimensions of all docked ToolBars
00192     // so that GetWindowRect will be accurate
00193     RecalcLayout(TRUE);
00194
00195     LeftOf->GetWindowRect(&rect);
00196     rect.OffsetRect(1,0);
00197     dw=LeftOf->GetBarStyle();
00198     n = 0;
00199     n = (dw&CBRS_ALIGN_TOP)              ? AFX_IDW_DOCKBAR_TOP      : n;
00200     n = (dw&CBRS_ALIGN_BOTTOM   && n==0) ? AFX_IDW_DOCKBAR_BOTTOM   : n;
00201     n = (dw&CBRS_ALIGN_LEFT     && n==0) ? AFX_IDW_DOCKBAR_LEFT     : n;
00202     n = (dw&CBRS_ALIGN_RIGHT    && n==0) ? AFX_IDW_DOCKBAR_RIGHT    : n;
00203
00204     // When we take the default parameters on rect, DockControlBar will dock
00205     // each Toolbar on a seperate line. By calculating a rectangle, we in effect
00206     // are simulating a Toolbar being dragged to that location and docked.
00207     DockControlBar(Bar,n,&rect);
00208 }

void CCJMDIFrameWnd::DockSizeBar | ( | CControlBar * | pBar,
 |  | CCJSizeDockBar * | pDockBar = NULL,
 |  | LPRECT | lpRect = NULL
 | ) | [virtual]

Definition at line 290 of file CJMDIFrameWnd.cpp.

References ASSERT, dwSizeBarMap, NULL, and CCJSizeDockBar::SetActualSize.

Referenced by CMainFrame::InitializeDockingWindows.

00291 {
00292     ASSERT(pBar != NULL);
00293     ASSERT(pBar->m_pDockContext != NULL);
00294
00295     if( pDockBar == NULL )
00296     {
00297         for (int i = 0; i < 4; i++)
00298         {
00299             if ((dwSizeBarMap[i][1] & CBRS_ALIGN_ANY) == (pBar->m_dwStyle & CBRS_ALIGN_ANY))
00300             {
00301                 pDockBar = (CCJSizeDockBar*)GetControlBar(dwSizeBarMap[i][0]);
00302                 ASSERT(pDockBar != NULL);
00303
00304                 int nSize = 0;
00305
00306                 switch(i)
00307                 {
00308                 case 0: // horizontal dock
00309                 case 1:
00310                     nSize = ((CCJControlBar*)pBar)->GetHorzSize();
00311                     break;
00312                 case 2: // vertical dock
00313                 case 3:
00314                     nSize = ((CCJControlBar*)pBar)->GetVertSize();
00315                     break;
00316                 }
00317
00318                 pDockBar->SetActualSize( nSize );
00319                 break;
00320             }
00321         }
00322     }
00323
00324     ASSERT(pDockBar != NULL);
00325     ASSERT(m_listControlBars.Find(pBar) != NULL);
00326     ASSERT(pBar->m_pDockSite == this);
00327     ((CCJControlBar*)pBar)->Normalize();
00328     pDockBar->DockControlBar(pBar, lpRect);
00329 }

void CCJMDIFrameWnd::EnableDocking ( DWORD dwDockStyle ) [virtual]

Definition at line 210 of file CJMDIFrameWnd.cpp.

References ASSERT, and dwDockBarMap.

Referenced by CMainFrame::OnCreate.

00211 {
00212     // must be CBRS_ALIGN_XXX or CBRS_FLOAT_MULTI only
00213     ASSERT((dwDockStyle & ~(CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI)) == 0);
00214     CMDIFrameWnd::EnableDocking(dwDockStyle);
00215
00216     for (int i = 0; i < 4; i++) {
00217         if (dwDockBarMap[i][1] & dwDockStyle & CBRS_ALIGN_ANY) {
00218             CDockBar* pDock = (CDockBar*)GetControlBar(dwDockBarMap[i][0]);
00219
00220             // make sure the dock bar is of correct type
00221             if( pDock || !pDock->IsKindOf(RUNTIME_CLASS(CCJDockBar)) ) {
00222                 BOOL bNeedDelete = ! pDock->m_bAutoDelete;
00223                 pDock->m_pDockSite->RemoveControlBar(pDock);
00224                 pDock->m_pDockSite = 0; // avoid problems in destroying the dockbar
00225                 pDock->DestroyWindow();
00226                 if( bNeedDelete )
00227                     delete pDock;
00228                 pDock = 0;
00229             }
00230
00231             if( pDock == 0 ) {
00232                 pDock = new CCJDockBar;
00233                 if (!pDock->Create(this,
00234                     WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_CHILD|WS_VISIBLE |
00235                     dwDockBarMap[i][1], dwDockBarMap[i][0])) {
00236                     AfxThrowResourceException();
00237                 }
00238             }
00239         }
00240     }
00241 }

void CCJMDIFrameWnd::EnableDockingSizeBar | ( | DWORD | dwDockStyle,
 |  | DockFlatBorders | FlatFlags = brdrAllRaised
 | ) | [virtual]

Definition at line 250 of file CJMDIFrameWnd.cpp.

References ASSERT, dwSizeBarMap, CCJSizeDockBar::FlatBorder, and NULL.

Referenced by CMainFrame::InitializeDockingWindows.

00251 {
00252     // must be CBRS_ALIGN_XXX or CBRS_FLOAT_MULTI only
00253     ASSERT((dwDockStyle & ~(CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI)) == 0);
00254
00255     m_pFloatingFrameClass = RUNTIME_CLASS(CCJMiniDockFrameWnd);
00256     for (int i = 0; i < 4; i++)
00257     {
00258         if (dwSizeBarMap[i][1] & dwDockStyle & CBRS_ALIGN_ANY)
00259         {
00260             CCJSizeDockBar* pDock = (CCJSizeDockBar*)GetControlBar(dwSizeBarMap[i][0]);
00261             if (pDock == NULL)
00262             {
00263                 pDock = new CCJSizeDockBar;
00264
00265                 if (!pDock->Create(this,
00266                     WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_CHILD|WS_VISIBLE |
00267                         dwSizeBarMap[i][1], dwSizeBarMap[i][0]))
00268                 {
00269                     AfxThrowResourceException();
00270                 }
00271                 //Yiannhs enable Flat Borders For dock Bars
00272                 pDock->FlatBorder( (FlatFlags >> i) & 0x0001 );
00273             }
00274         }
00275     }
00276 }

BOOL CCJMDIFrameWnd::InitializeMenu | ( | HMENU * | phMenu,
 |  | UINT | nMenuID,
 |  | UINT * | nToolbarIDs = NULL,
 |  | int | nSize = NULL
 | ) | [virtual]

Definition at line 426 of file CJMDIFrameWnd.cpp.

References ASSERT, FALSE, NewMenu, and NULL.

00427 {
00428     if( !phMenu ) {
00429         return FALSE;
00430     }
00431
00432     ASSERT(nMenuID);            // must be valid.
00433     *phMenu = NewMenu(nMenuID, nToolbarIDs, nSize);
00434
00435     return (BOOL)(*phMenu != NULL);
00436 }

BOOL CCJMDIFrameWnd::InitializeMenu | ( | HMENU * | phMenu,
 |  | UINT | nMenuID,
 |  | UINT | nToolbarID = NULL
 | ) | [virtual]

Definition at line 414 of file CJMDIFrameWnd.cpp.

References ASSERT, FALSE, NewMenu, and NULL.

00415 {
00416     if( !phMenu ) {
00417         return FALSE;
00418     }
00419
00420     ASSERT(nMenuID);            // must be valid.
00421     *phMenu = NewMenu( nMenuID, nToolbarID );
00422
00423     return (BOOL)(*phMenu != NULL);
00424 }

BOOL CCJMDIFrameWnd::InitializeMenu | ( | CMultiDocTemplate * | pDocTemplate,
 |  | UINT | nMenuID,
 |  | UINT | nToolbarID = NULL,
 |  | UINT | nDefaultMenuID = NULL
 | ) | [virtual]

Definition at line 373 of file CJMDIFrameWnd.cpp.

References ASSERT, m_menuList, NewMenu, and TRUE.

00374 {
00375     ASSERT(nMenuID);            // must be valid.
00376
00377     // If no menus have been created yet, set the frame default,
00378     // this is the menu that is displayed when no views are active.
00379     if (m_menuList.IsEmpty()) {
00380         ASSERT(nDefaultMenuID != 0);
00381         m_hMenuDefault = NewMenu(nDefaultMenuID, nToolBarID);
00382         OnUpdateFrameMenu(m_hMenuDefault);
00383     }
00384     // Create the Doc/View menu. ONLY if there is a template passed.
00385     if( pDocTemplate )
00386     {
00387         ASSERT_VALID(pDocTemplate); // must be valid.
00388         pDocTemplate->m_hMenuShared = NewMenu(nMenuID, nToolBarID);
00389     }
00390     return TRUE;
00391 }

BOOL CCJMDIFrameWnd::InitializeMenu | ( | CMultiDocTemplate * | pDocTemplate,
 |  | UINT | nMenuID,
 |  | UINT * | nToolbarIDs = NULL,
 |  | int | nSize = 0,
 |  | UINT | nDefaultMenuID = NULL
 | ) | [virtual]

Definition at line 393 of file CJMDIFrameWnd.cpp.

References ASSERT, m_menuList, NewMenu, and TRUE.

Referenced by CCJMDIChildWnd::GetInitializedMenu, and CWincvsApp::InitInstance.

00394 {
00395     ASSERT(nMenuID);            // must be valid.
00396
00397     // If no menus have been created yet, set the frame default,
00398     // this is the menu that is displayed when no views are active.
00399     if (m_menuList.IsEmpty()) {
00400         ASSERT(nDefaultMenuID != 0);
00401         m_hMenuDefault = NewMenu(nDefaultMenuID, nToolbarIDs, nSize);
00402         OnUpdateFrameMenu(m_hMenuDefault);
00403     }
00404     // Create the Doc/View menu. ONLY if there is a template passed.
00405     if( pDocTemplate )
00406     {
00407         ASSERT_VALID(pDocTemplate); // must be valid.
00408         pDocTemplate->m_hMenuShared = NewMenu(nMenuID, nToolbarIDs, nSize);
00409     }
00410
00411     return TRUE;
00412 }

void CCJMDIFrameWnd::LoadBarState ( LPCTSTR lpszProfileName ) [virtual]

Definition at line 495 of file CJMDIFrameWnd.cpp.

References CCJSizeDockBar::m_bIsDockBar.

Referenced by CMainFrame::OnCreate.

00496 {
00497     CCJSizeDockBar::m_bIsDockBar = true;
00498     CFrameWnd::LoadBarState(lpszProfileName);
00499     CCJSizeDockBar::m_bIsDockBar = false;
00500 }

HMENU CCJMDIFrameWnd::NewMenu | ( | UINT | nMenuID,
 |  | UINT | nToolbarID = NULL
 | ) | [protected, virtual]

Definition at line 331 of file CJMDIFrameWnd.cpp.

References CCJMenu::LoadMenu, CCJMenu::LoadToolbar, m_menuList, and NULL.

00332 {
00333     // Allocate a new CCJMenu object.
00334     CCJMenu* pMenu = new CCJMenu;
00335     if( pMenu == NULL ) {
00336         return NULL;
00337     }
00338
00339     // Load the menu and toolbar resource.
00340     pMenu->LoadMenu(nMenuID);
00341     if (nToolbarID) {
00342         pMenu->LoadToolbar(nToolbarID);
00343     }
00344
00345     // Add the menu to the CList object.
00346     m_menuList.AddTail(pMenu);
00347
00348     // Detach the menu.
00349     return(pMenu->Detach());
00350 }

HMENU CCJMDIFrameWnd::NewMenu | ( | UINT | nMenuID,
 |  | UINT * | nToolbarIDs = NULL,
 |  | int | nSize = 0
 | ) | [protected, virtual]

Definition at line 352 of file CJMDIFrameWnd.cpp.

References CCJMenu::LoadMenu, CCJMenu::LoadToolbars, m_menuList, and NULL.

Referenced by InitializeMenu.

00353 {
00354     // Allocate a new CCJMenu object.
00355     CCJMenu* pMenu = new CCJMenu;
00356     if( pMenu == NULL ) {
00357         return NULL;
00358     }
00359
00360     // Load the menu and toolbar resources.
00361     pMenu->LoadMenu(nMenuID);
00362     if (nToolbarIDs) {
00363         pMenu->LoadToolbars(nToolbarIDs, nSize);
00364     }
00365
00366     // Add the menu to the CList object.
00367     m_menuList.AddTail(pMenu);
00368
00369     // Detach the menu.
00370     return(pMenu->Detach());
00371 }

void CCJMDIFrameWnd::OnClose ( ) [protected]

Reimplemented in CMainFrame.

Definition at line 509 of file CJMDIFrameWnd.cpp.

References NULL.

Referenced by CMainFrame::OnClose.

00510 {
00511     // Clear active view before close
00512     SetActiveView (NULL);
00513     CMDIFrameWnd::OnClose();
00514 }

void CCJMDIFrameWnd::OnInitMenuPopup | ( | CMenu * | pPopupMenu,
 |  | UINT | nIndex,
 |  | BOOL | bSysMenu
 | ) | [protected]

Definition at line 476 of file CJMDIFrameWnd.cpp.

References CCJMenu::IsMenu, m_menuList, and CCJMenu::UpdateMenu.

00477 {
00478     CMDIFrameWnd::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
00479
00480     if(!bSysMenu)
00481     {
00482         // Loop through all menus in list.
00483         for (POSITION pos = m_menuList.GetHeadPosition(); pos; m_menuList.GetNext(pos))
00484         {
00485             CCJMenu* pListMenu = m_menuList.GetAt(pos);
00486
00487             if(pListMenu->IsMenu(pPopupMenu)) {
00488                 CCJMenu::UpdateMenu(pPopupMenu);
00489                 break;
00490             }
00491         }
00492     }
00493 }

void CCJMDIFrameWnd::OnMeasureItem | ( | int | nIDCtl,
 |  | LPMEASUREITEMSTRUCT | lpMeasureItemStruct
 | ) | [protected]

Definition at line 438 of file CJMDIFrameWnd.cpp.

References CCJMenu::IsMenu, m_menuList, and CCJMenu::MeasureItem.

00439 {
00440     if (lpMeasureItemStruct->CtlType == ODT_MENU)
00441     {
00442         if (IsMenu((HMENU)lpMeasureItemStruct->itemID)) {
00443             CMenu* pMenu = CMenu::FromHandle((HMENU)lpMeasureItemStruct->itemID);
00444
00445             // Loop through all menus in list.
00446             for (POSITION pos = m_menuList.GetHeadPosition(); pos; m_menuList.GetNext(pos))
00447             {
00448                 CCJMenu* pListMenu = m_menuList.GetAt(pos);
00449
00450                 if(pListMenu->IsMenu(pMenu)) {
00451                     pListMenu->MeasureItem(lpMeasureItemStruct);
00452                     return;
00453                 }
00454             }
00455         }
00456     }
00457
00458     CMDIFrameWnd::OnMeasureItem(nIDCtl, lpMeasureItemStruct);
00459 }

LRESULT CCJMDIFrameWnd::OnMenuChar | ( | UINT | nChar,
 |  | UINT | nFlags,
 |  | CMenu * | pMenu
 | ) | [protected]

Definition at line 461 of file CJMDIFrameWnd.cpp.

References CCJMenu::FindKeyboardShortcut, CCJMenu::IsMenu, and m_menuList.

00462 {
00463     // Loop through all menus in list.
00464     for (POSITION pos = m_menuList.GetHeadPosition(); pos; m_menuList.GetNext(pos))
00465     {
00466         CCJMenu* pListMenu = m_menuList.GetAt(pos);
00467
00468         if(pListMenu->IsMenu(pMenu)) {
00469             return CCJMenu::FindKeyboardShortcut(nChar, nFlags, pMenu);
00470         }
00471     }
00472
00473     return CMDIFrameWnd::OnMenuChar(nChar, nFlags, pMenu);
00474 }

BOOL CCJMDIFrameWnd::PreCreateWindow | ( | CREATESTRUCT & | cs,
 |  | UINT | nIconID
 | ) | [protected, virtual]

Definition at line 527 of file CJMDIFrameWnd.cpp.

References ASSERT, and NULL.

00528 {
00529     // Register wnd class with no redraw, cursor (use default), background
00530     // brush and load your apps icon resource.
00531     cs.lpszClass = AfxRegisterWndClass( 0, NULL, NULL,
00532         AfxGetApp()->LoadIcon(nIconID));
00533     ASSERT(cs.lpszClass);
00534
00535     return CMDIFrameWnd::PreCreateWindow(cs);
00536 }

BOOL CCJMDIFrameWnd::PreCreateWindow ( CREATESTRUCT & cs ) [protected, virtual]

Reimplemented in CMainFrame.

Definition at line 517 of file CJMDIFrameWnd.cpp.

Referenced by CMainFrame::PreCreateWindow.

00518 {
00519     return CMDIFrameWnd::PreCreateWindow(cs);
00520 }

void CCJMDIFrameWnd::RecalcAllExcept ( CCJSizeDockBar * pBar ) [virtual]

Definition at line 278 of file CJMDIFrameWnd.cpp.

References CCJSizeDockBar::CalcSizeBarLayout, dwSizeBarMap, and NULL.

Referenced by RecalcLayout.

00279 {
00280     for (int i = 0; i < 4; i++)
00281     {
00282         CCJSizeDockBar* pDock = (CCJSizeDockBar*)GetControlBar(dwSizeBarMap[i][0]);
00283         if (pDock != NULL && pDock != pBar)
00284         {
00285             pDock->CalcSizeBarLayout();
00286         }
00287     }
00288 }

void CCJMDIFrameWnd::RecalcLayout ( BOOL bNotify = TRUE ) [virtual]

Definition at line 243 of file CJMDIFrameWnd.cpp.

References NULL, and RecalcAllExcept.

Referenced by CMainFrame::DockControlBarLeftOf, and DockControlBarLeftOf.

00244 {
00245     CMDIFrameWnd::RecalcLayout(bNotify);
00246     RecalcAllExcept(NULL);
00247 }

void CCJMDIFrameWnd::SaveBarState ( LPCTSTR lpszProfileName ) const [virtual]

Definition at line 502 of file CJMDIFrameWnd.cpp.

References CCJSizeDockBar::m_bIsDockBar.

Referenced by CMainFrame::OnClose.

00503 {
00504     CCJSizeDockBar::m_bIsDockBar = true;
00505     CFrameWnd::SaveBarState(lpszProfileName);
00506     CCJSizeDockBar::m_bIsDockBar = false;
00507 }

Member Data Documentation

DWORD CCJMDIFrameWnd::dwDockBarMap [static, protected]

Initial value:

{
    { AFX_IDW_DOCKBAR_TOP,      CBRS_TOP    },
    { AFX_IDW_DOCKBAR_BOTTOM,   CBRS_BOTTOM },
    { AFX_IDW_DOCKBAR_LEFT,     CBRS_LEFT   },
    { AFX_IDW_DOCKBAR_RIGHT,    CBRS_RIGHT  },
}

Definition at line 177 of file CJMDIFrameWnd.cpp.

Referenced by EnableDocking.

CMDIMenuList CCJMDIFrameWnd::m_menuList [protected]

Definition at line 166 of file CJMDIFrameWnd.h.

Referenced by CMainFrame::GetMenuList, InitializeMenu, NewMenu, OnInitMenuPopup, OnMeasureItem, OnMenuChar, and ~CCJMDIFrameWnd.

CCJMenuBar CCJMDIFrameWnd::m_wndMenuBar [protected]

Definition at line 167 of file CJMDIFrameWnd.h.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJMDIFrameWnd.h
  • WinCvs/CJLib/CJLibrary/CJMDIFrameWnd.cpp
Generated on Sun Feb 24 01:24:52 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJMemFile Class Reference

#include <CJMemFile.h>

Inheritance diagram for CCJMemFile:

[legend]
Collaboration diagram for CCJMemFile:

[legend]
List of all members.

Public Methods

CCJMemFile (UINT nGrowBytes=1024)
CCJMemFile (BYTE *lpBuffer, UINT nBufferSize, UINT nGrowBytes=0)
CCJMemFile (LPCTSTR lpstFilename, UINT uiOpenFlags)
virtual | ~CCJMemFile ()
virtual void | Flush ()
virtual bool | Open (CString strFilename, UINT uiOpenFlags, CFileException *pError=NULL)
virtual void | Close ()
virtual BOOL | ReadString (CString &rString)
virtual void | WriteString (LPCTSTR lpsz)
virtual bool | Duplicate (CFile *fDuplicate)
virtual bool | Duplicate (CString strDup)
virtual bool | Discard ()
virtual DWORD | Insert (CFile *fSrc, DWORD dwSourcePos, DWORD dwDestPos, DWORD dwBytes)
virtual DWORD | Insert (CString strSrc, DWORD dwSourcePos, DWORD dwDestPos, DWORD dwBytes)
virtual DWORD | Extract (CFile *fDest, DWORD dwStartPos, DWORD dwBytes)
virtual DWORD | Extract (CString strDest, DWORD dwStartPos, DWORD dwBytes)
LONG | FindData (void *pData, DWORD dwDataLen, LONG lStartPos)
void | operator= (CFile *fDup)
void | operator= (CString strDup)
void | operator= (DWORD dwFilePos)
void | operator+= (CFile *fApp)
void | operator+= (CString strApp)
BYTE | operator[] (DWORD dwFilePos)

Protected Methods

virtual bool | Load ()
virtual bool | Save ()
virtual bool | Import (CFile *fImp)
virtual bool | Append (CFile *fApp)

Private Attributes

CFileException * | m_pError
CFile | m_File
UINT | m_uiOpenFlags
bool | m_bOpen

Constructor & Destructor Documentation

CCJMemFile::CCJMemFile ( UINT nGrowBytes = 1024 )

Definition at line 55 of file CJMemFile.cpp.

References m_bOpen, m_File, m_uiOpenFlags, and NULL.

00056 {
00057     // Modified default constructor
00058
00059     m_File.m_hFile = NULL;
00060     m_bOpen = false;
00061     m_uiOpenFlags = 0;
00062     CMemFile::CMemFile(nGrowBytes);
00063 }

CCJMemFile::CCJMemFile | ( | BYTE * | lpBuffer,
 |  | UINT | nBufferSize,
 |  | UINT | nGrowBytes = 0
 | ) |

Definition at line 65 of file CJMemFile.cpp.

References m_bOpen, m_File, m_uiOpenFlags, and NULL.

00066 {
00067     // Modified default constructor
00068
00069     m_File.m_hFile = NULL;
00070     m_bOpen = false;
00071     m_uiOpenFlags = 0;
00072     CMemFile::CMemFile(lpBuffer,nBufferSize, nGrowBytes );
00073 }

CCJMemFile::CCJMemFile | ( | LPCTSTR | lpstFilename,
 |  | UINT | uiOpenFlags
 | ) |

Definition at line 75 of file CJMemFile.cpp.

References m_bOpen, m_File, m_uiOpenFlags, NULL, and Open.

00076 {
00077     // CFile compatible constructor
00078
00079     m_File.m_hFile = NULL;
00080     m_bOpen = false;
00081     m_uiOpenFlags = uiOpenFlags;
00082     Open(lpszFilename,uiOpenFlags);
00083 }

CCJMemFile::~CCJMemFile ( ) [virtual]

Definition at line 85 of file CJMemFile.cpp.

References Close, m_File, m_uiOpenFlags, and NULL.

00086 {
00087     if (m_bOpen)
00088         Close();
00089     m_File.m_hFile = NULL;
00090     m_uiOpenFlags = 0;
00091     CMemFile::~CMemFile();
00092 }

Member Function Documentation

bool CCJMemFile::Append ( CFile * fApp ) [protected, virtual]

Definition at line 285 of file CJMemFile.cpp.

References NULL.

Referenced by operator+=.

00286 {
00287     if ((fApp == NULL) || (fApp->m_hFile == NULL))
00288         return false;
00289
00290     DWORD dwLength = 1024;
00291     BYTE *pData = new BYTE[dwLength];
00292     if (pData == NULL)
00293         return false;
00294     SeekToEnd();
00295     fApp->SeekToBegin();
00296     while (fApp->GetPosition() < fApp->GetLength())
00297     {
00298         DWORD dwRead = fApp->Read(pData,dwLength);
00299         Write(pData,dwRead);
00300     }
00301
00302     delete pData;
00303     return true;
00304 }

void CCJMemFile::Close ( ) [virtual]

Definition at line 241 of file CJMemFile.cpp.

References m_bOpen, m_File, NULL, and Save.

Referenced by ~CCJMemFile.

00242 {
00243     if ((m_File.m_hFile != NULL) && m_bOpen)
00244     {
00245         m_bOpen = false;
00246         Save();
00247         m_File.Close();
00248         m_File.m_hFile = NULL;
00249     }
00250 }

bool CCJMemFile::Discard ( ) [virtual]

Definition at line 258 of file CJMemFile.cpp.

References Load.

00259 {
00260     return Load();
00261 }

bool CCJMemFile::Duplicate ( CString strDup ) [virtual]

Definition at line 161 of file CJMemFile.cpp.

References Duplicate.

00162 {
00163     // Duplicate With CString compatibility
00164
00165     CFile file(strDup,CFile::modeCreate | CFile::modeWrite);
00166     bool bResult = Duplicate(&file);
00167     file.Close();
00168     return bResult;
00169 }

bool CCJMemFile::Duplicate ( CFile * fDuplicate ) [virtual]

Definition at line 143 of file CJMemFile.cpp.

Referenced by Duplicate.

00144 {
00145     // Standard Copy Routine
00146
00147     BYTE *pbData = new BYTE[1024];
00148     DWORD dwPos = GetPosition();
00149     SeekToBegin();
00150     fDuplicate->SetLength(0);
00151     while (GetPosition() < GetLength())
00152     {
00153         DWORD dwRead = Read(pbData,1024);
00154         fDuplicate->Write(pbData,dwRead);
00155     }
00156     Seek(dwPos,fDuplicate->begin);
00157     delete pbData;
00158     return true;
00159 }

DWORD CCJMemFile::Extract | ( | CString | strDest,
 |  | DWORD | dwStartPos,
 |  | DWORD | dwBytes
 | ) | [virtual]

Definition at line 384 of file CJMemFile.cpp.

References Extract.

00385 {
00386     CFile file(strDest,CFile::modeCreate | CFile::modeWrite);
00387     DWORD dwResult = Extract(&file,dwStartPos,dwBytes);
00388     file.Close();
00389     return dwResult;
00390 }

DWORD CCJMemFile::Extract | ( | CFile * | fDest,
 |  | DWORD | dwStartPos,
 |  | DWORD | dwBytes
 | ) | [virtual]

Definition at line 357 of file CJMemFile.cpp.

References NULL.

Referenced by Extract, and Insert.

00358 {
00359     if (dwBytes == 0)
00360         return 0;
00361     DWORD dwPos = GetPosition();
00362     DWORD dwLength = 1024;
00363     DWORD dwCounter = 0;
00364     BYTE *pData = new BYTE[dwLength];
00365     if (pData == NULL)
00366         return 0;
00367     Seek(dwStartPos,begin);
00368
00369     while (((GetPosition() - dwStartPos) < dwBytes) && (GetPosition() < GetLength()) )
00370     {
00371         DWORD dwRead = Read(pData,dwLength);
00372         if (dwCounter + dwRead > dwStartPos + dwBytes)
00373             dwRead = dwBytes - dwCounter;
00374         fDest->Write(pData,dwRead);
00375         dwCounter += dwRead;
00376     }
00377     Seek(dwPos,begin);
00378     delete pData;
00379     fDest->Flush();
00380     return dwCounter;
00381
00382 }

LONG CCJMemFile::FindData | ( | void * | pData,
 |  | DWORD | dwDataLen,
 |  | LONG | lStartPos
 | ) |

Definition at line 443 of file CJMemFile.cpp.

00444 {
00445     BYTE* pBytes = (BYTE*)pData;
00446
00447
00448     Seek(lStartPos,begin);
00449
00450     bool bFoundAll = false;
00451     LONG lPos = -1;
00452
00453     while ((!bFoundAll) && (GetPosition() < GetLength()))
00454     {
00455         bool bFoundFirst = false;
00456
00457         while ((!bFoundFirst) && (GetPosition() < GetLength()))
00458         {
00459             lPos = GetPosition();
00460             BYTE read;
00461             Read(&read,1);
00462             if (read != pBytes[0])
00463                 continue;
00464
00465             bFoundFirst = true;
00466             break;
00467         }
00468
00469         //Hier Die Restlichen Bytes (dwDataLen -1) vergleichen
00470
00471         DWORD i = 1;
00472         bool bFound = true;
00473
00474         while ((i < dwDataLen) && (GetPosition() < GetLength()) && bFoundFirst)
00475         {
00476             BYTE read;
00477             Read(&read,1);
00478             if (read == pBytes[i++])
00479                 continue;
00480
00481             bFound = false;
00482             Seek(lPos+1,begin);
00483             break;
00484         }
00485
00486         bFoundAll = bFound && bFoundFirst;
00487     }
00488
00489     lPos = bFoundAll ? lPos : -1;
00490 //  while (bFound && (iPos < strSeek.GetLength())
00491 //  {
00492 //  }
00493     return lPos;
00494 }

void CCJMemFile::Flush ( ) [virtual]

Definition at line 252 of file CJMemFile.cpp.

References Save.

00253 {
00254     CMemFile::Flush();
00255     Save();
00256 }

bool CCJMemFile::Import ( CFile * fImp ) [protected, virtual]

Definition at line 263 of file CJMemFile.cpp.

References NULL.

Referenced by operator=.

00264 {
00265     if ((fImp == NULL) || (fImp->m_hFile == NULL))
00266         return false;
00267
00268     DWORD dwLength = 1024;
00269     BYTE *pData = new BYTE[dwLength];
00270     if (pData == NULL)
00271         return false;
00272     SeekToBegin();
00273     SetLength(0);
00274     fImp->SeekToBegin();
00275     while (fImp->GetPosition() < fImp->GetLength())
00276     {
00277         DWORD dwRead = fImp->Read(pData,dwLength);
00278         Write(pData,dwRead);
00279     }
00280
00281     delete pData;
00282     return true;
00283 }

DWORD CCJMemFile::Insert | ( | CString | strSrc,
 |  | DWORD | dwSourcePos,
 |  | DWORD | dwDestPos,
 |  | DWORD | dwBytes
 | ) | [virtual]

Definition at line 349 of file CJMemFile.cpp.

References Insert.

00350 {
00351     CFile file(strSrc,CFile::modeRead);
00352     DWORD dwResult = Insert(&file, dwSourcePos, dwDestPos, dwBytes);
00353     file.Close();
00354     return dwResult;
00355 }

DWORD CCJMemFile::Insert | ( | CFile * | fSrc,
 |  | DWORD | dwSourcePos,
 |  | DWORD | dwDestPos,
 |  | DWORD | dwBytes
 | ) | [virtual]

Definition at line 306 of file CJMemFile.cpp.

References Extract, and NULL.

Referenced by Insert.

00307 {
00308     if (dwBytes == 0)
00309         return 0;
00310
00311     CCJMemFile fPreIns;
00312     CCJMemFile fIns;
00313     CCJMemFile fPostIns;
00314     CCJMemFile fComplete;
00315
00316     Extract(&fPreIns,0,dwDestPos); // Extract Data BEFORE insertion point
00317     Extract(&fPostIns,dwDestPos,GetLength() - dwDestPos); // Extract Data AFTER intertion point
00318
00319     // Extract the "to be inserted" Data from the (fSrc) Source file
00320     {
00321         DWORD dwLength = 1024;
00322         DWORD dwCounter = 0;
00323         BYTE *pData = new BYTE[dwLength];
00324         if (pData == NULL)
00325             return 0;
00326         fSrc->Seek(dwSourcePos,begin);
00327
00328         while (((fSrc->GetPosition() - dwSourcePos) < dwBytes) && (fSrc->GetPosition() < fSrc->GetLength()) )
00329         {
00330             DWORD dwRead = fSrc->Read(pData,dwLength);
00331             if (dwCounter + dwRead > dwSourcePos + dwBytes)
00332                 dwRead = dwBytes - dwCounter;
00333             fIns.Write(pData,dwRead);
00334             dwCounter += dwRead;
00335         }
00336         delete pData;
00337     } // Finished Extraction
00338
00339
00340     fComplete += &fPreIns; // Append BEFORE Data
00341     fComplete += &fIns; // Append the "to be inserted" Data
00342     fComplete += &fPostIns;  // Append the AFTER Data
00343
00344     *this = &fComplete; // Copy completed File
00345
00346     return fIns.GetLength();
00347 }

bool CCJMemFile::Load ( ) [protected, virtual]

Definition at line 218 of file CJMemFile.cpp.

References m_File, and NULL.

Referenced by Discard, and Open.

00219 {
00220     if (m_File.m_hFile == NULL)
00221         return false;
00222
00223     DWORD dwLength = 1024;
00224     BYTE *pData = new BYTE[dwLength];
00225     if (pData == NULL)
00226         return false;
00227     SeekToBegin();
00228     SetLength(0);
00229     m_File.SeekToBegin();
00230     while (m_File.GetPosition() < m_File.GetLength())
00231     {
00232         DWORD dwRead = m_File.Read(pData,dwLength);
00233         Write(pData,dwRead);
00234     }
00235
00236     delete pData;
00237     return true;
00238 }

bool CCJMemFile::Open | ( | CString | strFilename,
 |  | UINT | uiOpenFlags,
 |  | CFileException * | pError = NULL
 | ) | [virtual]

Definition at line 171 of file CJMemFile.cpp.

References Load, m_bOpen, m_File, m_uiOpenFlags, and NULL.

Referenced by CCJMemFile.

00172 {
00173     // CFile compatible Open
00174
00175     if (m_File.m_hFile != NULL)
00176         return false;
00177     if (m_File.Open(strFilename,uiOpenFlags,pError))
00178     {
00179         m_uiOpenFlags = uiOpenFlags;
00180         Load();
00181         m_bOpen = true;
00182         return true;
00183     }
00184     else
00185         return false;
00186 }

void CCJMemFile::operator+= ( CString strApp )

Definition at line 420 of file CJMemFile.cpp.

References Append.

00421 {
00422     CFile file;
00423     if (file.Open(strApp,CFile::modeRead))
00424     {
00425         Append(&file);
00426         file.Close();
00427     }
00428 }

void CCJMemFile::operator+= ( CFile * fApp )

Definition at line 415 of file CJMemFile.cpp.

References Append.

00416 {
00417     Append(fApp);
00418 }

void CCJMemFile::operator= ( DWORD dwFilePos )

Definition at line 409 of file CJMemFile.cpp.

00410 {
00411     Seek(dwFilePos,begin);
00412 }

void CCJMemFile::operator= ( CString strDup )

Definition at line 399 of file CJMemFile.cpp.

References Import.

00400 {
00401     CFile file;
00402     if (file.Open(strDup,CFile::modeRead))
00403     {
00404         Import(&file);
00405         file.Close();
00406     }
00407 }

void CCJMemFile::operator= ( CFile * fDup )

Definition at line 394 of file CJMemFile.cpp.

References Import.

00395 {
00396     Import(fDup);
00397 }

BYTE CCJMemFile::operator[] ( DWORD dwFilePos )

Definition at line 432 of file CJMemFile.cpp.

00433 {
00434     if (dwFilePos > GetLength() -1)
00435         return 0;
00436
00437     BYTE bTemp;
00438     Seek(dwFilePos,begin);
00439     Read(&bTemp,sizeof(BYTE));
00440     return bTemp;
00441 }

BOOL CCJMemFile::ReadString ( CString & rString ) [virtual]

Definition at line 96 of file CJMemFile.cpp.

00097 {
00098     // Readstring Beta Version
00099
00100     rString.Empty();
00101     char ch;
00102
00103     bool bFound = false;
00104     while (GetPosition() < GetLength())
00105     {
00106         Read(&ch,1);
00107
00108         bFound = (ch == '\x0D');
00109         if (bFound || (ch == '\x0'))
00110             break;
00111         else
00112             rString = rString + ch;
00113     }
00114     if (bFound)
00115     {
00116         Read(&ch,1);
00117         if (ch != '\x0A')
00118             Seek(-1,current);
00119     }
00120
00121     if (rString.GetLength() > 0)
00122         return true;
00123     return false;
00124 }

bool CCJMemFile::Save ( ) [protected, virtual]

Definition at line 188 of file CJMemFile.cpp.

References m_File, m_uiOpenFlags, and NULL.

Referenced by Close, and Flush.

00189 {
00190     if (m_File.m_hFile == NULL)
00191         return false;
00192     CString str;
00193
00194     // Check if the physical file has write access
00195     if (!(m_uiOpenFlags & modeWrite) && !(m_uiOpenFlags & modeReadWrite))
00196     {
00197         return false;
00198     }
00199
00200     DWORD dwPos = GetPosition();
00201     DWORD dwLength = 1024;
00202     BYTE *pData = new BYTE[dwLength];
00203     if (pData == NULL)
00204         return false;
00205     SeekToBegin();
00206     m_File.SetLength(0);
00207     while (GetPosition() < GetLength())
00208     {
00209         DWORD dwRead = Read(pData,dwLength);
00210         m_File.Write(pData,dwRead);
00211     }
00212     Seek(dwPos,begin);
00213     delete pData;
00214     m_File.Flush();
00215     return true;
00216 }

void CCJMemFile::WriteString ( LPCTSTR lpsz ) [virtual]

Definition at line 126 of file CJMemFile.cpp.

00127 {
00128     // WriteString Beta Version
00129
00130     if (_tcslen(lpsz) > 0)
00131     {
00132         for (UINT iCount = 0; iCount < _tcslen(lpsz); iCount++)
00133             if ((lpsz[iCount] != '\x0D') && (lpsz[iCount] != '\x00'))
00134                 Write(&lpsz[iCount],1);
00135     }
00136     char ch = '\x0D';
00137     Write(&ch,1);
00138     ch = '\x0A';
00139     Write(&ch,1);
00140
00141 }

Member Data Documentation

bool CCJMemFile::m_bOpen [private]

Definition at line 50 of file CJMemFile.h.

Referenced by CCJMemFile, Close, and Open.

CFile CCJMemFile::m_File [private]

Definition at line 48 of file CJMemFile.h.

Referenced by CCJMemFile, Close, Load, Open, Save, and ~CCJMemFile.

CFileException* CCJMemFile::m_pError [private]

Definition at line 47 of file CJMemFile.h.

UINT CCJMemFile::m_uiOpenFlags [private]

Definition at line 49 of file CJMemFile.h.

Referenced by CCJMemFile, Open, Save, and ~CCJMemFile.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJMemFile.h
  • WinCvs/CJLib/CJLibrary/CJMemFile.cpp
Generated on Sun Feb 24 01:24:53 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJMenu Class Reference

#include <CJMenu.h>

Inheritance diagram for CCJMenu:

[legend]
Collaboration diagram for CCJMenu:

[legend]
List of all members.

Public Methods

CCJMenu ()
void | SetBitmapBackground (COLORREF color)
void | SetDisableOldStyle (void)
void | UnSetDisableOldStyle (void)
BOOL | GetDisableOldStyle (void)
void | UnSetBitmapBackground (void)
BOOL | AddBitmapToImageList (CImageList *list, UINT nResourceID)
BOOL | LoadFromToolBar (UINT nID, UINT nToolBar, int &xoffset)
void | InsertSpaces (void)
void | DrawCheckMark (CDC *pDC, int x, int y, COLORREF color)
void | DrawRadioDot (CDC *pDC, int x, int y, COLORREF color)
CCJMenu * | FindMenuOption (int nId, int &nLoc)
CCJMenuData * | FindMenuOption (wchar_t *lpstrText)
BOOL | GetMenuText (UINT id, CString &string, UINT nFlags=MF_BYPOSITION)
void | LoadCheckmarkBitmap (int unselect, int select)
void | DitherBlt (HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HBITMAP hbm, int nXSrc, int nYSrc)
void | DitherBlt2 (CDC *drawdc, int nXDest, int nYDest, int nWidth, int nHeight, CBitmap &bmp, int nXSrc, int nYSrc)
BOOL | GetBitmapFromImageList (CDC *pDC, CImageList *imglist, int nIndex, CBitmap &bmp)
virtual | ~CCJMenu ()
virtual void | DrawItem (LPDRAWITEMSTRUCT)
virtual void | MeasureItem (LPMEASUREITEMSTRUCT)
void | SetIconSize (int, int)
BOOL | AppendODMenuA (LPCSTR lpstrText, UINT nFlags=MF_OWNERDRAW, UINT nID=0, int nIconNormal=-1)
BOOL | AppendODMenuW (wchar_t *lpstrText, UINT nFlags=MF_OWNERDRAW, UINT nID=0, int nIconNormal=-1)
BOOL | AppendODMenuA (LPCSTR lpstrText, UINT nFlags, UINT nID, CImageList *il, int xoffset)
BOOL | AppendODMenuW (wchar_t *lpstrText, UINT nFlags, UINT nID, CImageList *il, int xoffset)
BOOL | AppendMenuA (UINT nFlags, UINT nIDNewItem=0, LPCTSTR lpszNewItem=NULL)
BOOL | AppendMenuA (UINT nFlags, UINT nIDNewItem, const CBitmap *pBmp)
BOOL | InsertODMenuA (UINT nPosition, LPCSTR lpstrText, UINT nFlags=MF_OWNERDRAW, UINT nID=0, int nIconNormal=-1)
BOOL | InsertODMenuW (UINT nPosition, wchar_t *lpstrText, UINT nFlags=MF_OWNERDRAW, UINT nID=0, int nIconNormal=-1)
BOOL | InsertODMenuA (UINT nPosition, LPCSTR lpstrText, UINT nFlags, UINT nID, CImageList *il, int xoffset)
BOOL | InsertODMenuW (UINT nPosition, wchar_t *lpstrText, UINT nFlags, UINT nID, CImageList *il, int xoffset)
BOOL | ModifyODMenuA (const char *lpstrText, UINT nID=0, int nIconNormal=-1)
BOOL | ModifyODMenuA (const char *lpstrText, UINT nID, CImageList *il, int xoffset)
BOOL | ModifyODMenuA (const char *lpstrText, UINT nID, CBitmap *bmp)
BOOL | ModifyODMenuA (const char *lpstrText, const char *OptionText, int nIconNormal)
BOOL | ModifyODMenuW (wchar_t *lpstrText, UINT nID=0, int nIconNormal=-1)
BOOL | ModifyODMenuW (wchar_t *lpstrText, UINT nID, CImageList *il, int xoffset)
BOOL | ModifyODMenuW (wchar_t *lpstrText, UINT nID, CBitmap *bmp)
BOOL | ModifyODMenuW (wchar_t *lpstrText, wchar_t *OptionText, int nIconNormal)
CCJMenuData * | NewODMenu (UINT pos, UINT nFlags, UINT nID, CString string)
void | SynchronizeMenu (void)
void | InitializeMenuList (int value)
void | DeleteMenuList (void)
CCJMenuData * | FindMenuList (UINT nID)
virtual BOOL | LoadMenu (LPCTSTR lpszResourceName)
virtual BOOL | LoadMenu (int nResource)
void | AddFromToolBar (CToolBar *pToolBar, int nResourceID)
BOOL | Draw3DCheckmark (CDC *dc, const CRect &rc, BOOL bSelected, HBITMAP hbmCheck)
BOOL | LoadToolbar (UINT nToolBar)
BOOL | LoadToolbars (const UINT *arID, int n)
BOOL | RemoveMenu (UINT uiId, UINT nFlags)
BOOL | DeleteMenu (UINT uiId, UINT nFlags)
BOOL | AppendMenuA (UINT nFlags, UINT nIDNewItem, const char *lpszNewItem, int nIconNormal=-1)
BOOL | AppendMenuA (UINT nFlags, UINT nIDNewItem, const char *lpszNewItem, CImageList *il, int xoffset)
BOOL | AppendMenuA (UINT nFlags, UINT nIDNewItem, const char *lpszNewItem, CBitmap *bmp)
BOOL | AppendMenuW (UINT nFlags, UINT nIDNewItem, wchar_t *lpszNewItem, int nIconNormal=-1)
BOOL | AppendMenuW (UINT nFlags, UINT nIDNewItem, wchar_t *lpszNewItem, CImageList *il, int xoffset)
BOOL | AppendMenuW (UINT nFlags, UINT nIDNewItem, wchar_t *lpszNewItem, CBitmap *bmp)
BOOL | InsertMenuA (UINT nPosition, UINT nFlags, UINT nIDNewItem, const char *lpszNewItem, int nIconNormal=-1)
BOOL | InsertMenuA (UINT nPosition, UINT nFlags, UINT nIDNewItem, const char *lpszNewItem, CImageList *il, int xoffset)
BOOL | InsertMenuA (UINT nPosition, UINT nFlags, UINT nIDNewItem, const char *lpszNewItem, CBitmap *bmp)
BOOL | InsertMenuW (UINT nPosition, UINT nFlags, UINT nIDNewItem, wchar_t *lpszNewItem, int nIconNormal=-1)
BOOL | InsertMenuW (UINT nPosition, UINT nFlags, UINT nIDNewItem, wchar_t *lpszNewItem, CImageList *il, int xoffset)
BOOL | InsertMenuW (UINT nPosition, UINT nFlags, UINT nIDNewItem, wchar_t *lpszNewItem, CBitmap *bmp)
CCJMenu * | AppendODPopupMenuA (LPCSTR lpstrText)
CCJMenu * | AppendODPopupMenuW (wchar_t *lpstrText)
virtual BOOL | DestroyMenu ()

Static Public Methods

BOOL | IsNewShell (void)
LRESULT | FindKeyboardShortcut (UINT nChar, UINT nFlags, CMenu *pMenu)
void | UpdateMenu (CMenu *pmenu)
BOOL | IsMenu (CMenu *submenu)
BOOL | IsMenu (HMENU submenu)
HBITMAP | LoadSysColorBitmap (int nResourceId)

Public Attributes

CImageList * | checkmaps
BOOL | checkmapsshare
int | m_selectcheck
int | m_unselectcheck

Protected Attributes

CTypedPtrArray< CPtrArray,
CCJMenuData * > 		m_MenuList
CTypedPtrArray< CPtrArray,
HMENU > 		m_SubMenus
int | m_iconX
int | m_iconY
COLORREF | m_bitmapBackground
BOOL | m_bitmapBackgroundFlag
BOOL | disable_old_style

Static Protected Attributes

CTypedPtrArray< CPtrArray,
HMENU > 		m_AllSubMenus

Constructor & Destructor Documentation

CCJMenu::CCJMenu ( )

Definition at line 128 of file CJMenu.cpp.

References checkmaps, checkmapsshare, CPInfo, disable_old_style, FALSE, m_bitmapBackground, m_bitmapBackgroundFlag, m_iconX, m_iconY, m_selectcheck, m_unselectcheck, and NULL.

00129 {
00130     disable_old_style=FALSE;
00131     m_iconX = 16;            // Icon sizes default to 16 x 16
00132     m_iconY = 15;            // ...
00133     m_selectcheck = -1;
00134     m_unselectcheck = -1;
00135     checkmaps=NULL;
00136     checkmapsshare=FALSE;
00137     // set the color used for the transparent background in all bitmaps
00138     m_bitmapBackground=RGB(192,192,192); //gray
00139     m_bitmapBackgroundFlag=FALSE;
00140     GetCPInfo(CP_ACP,&CPInfo);
00141 }

CCJMenu::~CCJMenu ( ) [virtual]

Definition at line 144 of file CJMenu.cpp.

References DestroyMenu.

00145 {
00146     DestroyMenu();
00147 }

Member Function Documentation

BOOL CCJMenu::AddBitmapToImageList | ( | CImageList * | list,
 |  | UINT | nResourceID
 | ) |

Definition at line 1523 of file CJMenu.cpp.

References FALSE, LoadSysColorBitmap, m_bitmapBackground, and TRUE.

Referenced by AddFromToolBar, AppendODMenuW, InsertODMenuW, LoadCheckmarkBitmap, and ModifyODMenuW.

01524 {
01525     BOOL bReturn=TRUE;
01526
01527     HBITMAP hbmp=LoadSysColorBitmap(nResourceID);
01528     if(hbmp){
01529         CBitmap bmp;
01530         bmp.Attach(hbmp);
01531         if(m_bitmapBackgroundFlag) bmplist->Add(&bmp,m_bitmapBackground);
01532         else bmplist->Add(&bmp,GetSysColor(COLOR_3DFACE));
01533         bmp.Detach();
01534         DeleteObject(hbmp);
01535         bReturn=TRUE;
01536     }
01537     else bReturn = FALSE;
01538     return(bReturn);
01539 }

void CCJMenu::AddFromToolBar | ( | CToolBar * | pToolBar,
 |  | int | nResourceID
 | ) |

Definition at line 1555 of file CJMenu.cpp.

References AddBitmapToImageList, CCJMenuData::bitmap, FindMenuOption, m_iconX, m_iconY, m_MenuList, CCJMenuData::menuIconNormal, CCJMenuData::nFlags, CCJMenuData::nID, NULL, and CCJMenuData::xoffset.

01556 {
01557     for (int i = 0; i < pToolBar->GetCount(); i++) {
01558         UINT nID = pToolBar->GetItemID(i);
01559         // See if this toolbar option
01560         // appears as a command on this
01561         // menu or is a separator
01562         if (nID == 0 || GetMenuState(nID, MF_BYCOMMAND) == 0xFFFFFFFF)
01563             continue; // Item doesn't exist
01564         UINT nStyle;
01565         int nImage;
01566         // Get the toolbar button info
01567         pToolBar->GetButtonInfo(i, nID, nStyle, nImage);
01568         // OK, we have the command ID of the toolbar
01569         // option, and the tollbar bitmap offset
01570         int nLoc;
01571         CCJMenuData* pData;
01572         CCJMenu *pSubMenu = FindMenuOption(nID, nLoc);
01573         if (pSubMenu && nLoc >= 0)pData = pSubMenu->m_MenuList[nLoc];
01574         else {
01575             // Create a new CCJMenuData structure
01576             pData = new CCJMenuData;
01577             m_MenuList.Add(pData);
01578         }
01579         // Set some default structure members
01580         pData->menuIconNormal = nResourceID;
01581         pData->nID = nID;
01582         pData->nFlags =  MF_BYCOMMAND | MF_OWNERDRAW;
01583         pData->xoffset = nImage;
01584         if (pData->bitmap)pData->bitmap->DeleteImageList();
01585         else pData->bitmap = new CImageList;
01586         pData->bitmap->Create(m_iconX, m_iconY,ILC_COLORDDB|ILC_MASK, 1, 1);
01587
01588         if(!AddBitmapToImageList(pData->bitmap, nResourceID)){
01589             pData->bitmap->DeleteImageList();
01590             delete pData->bitmap;
01591             pData->bitmap=NULL;
01592             pData->menuIconNormal = -1;
01593             pData->xoffset = -1;
01594         }
01595
01596         // Modify our menu
01597         ModifyMenu(nID,pData->nFlags,nID,(LPCTSTR)pData);
01598     }
01599 }

BOOL CCJMenu::AppendMenuA | ( | UINT | nFlags,
 |  | UINT | nIDNewItem,
 |  | const char * | lpszNewItem,
 |  | CBitmap * | bmp
 | ) |

Definition at line 1806 of file CJMenu.cpp.

References AppendMenuW.

01807 {
01808     USES_CONVERSION;
01809     return AppendMenuW(nFlags,nIDNewItem,A2W(lpszNewItem),bmp);
01810 }

BOOL CCJMenu::AppendMenuA | ( | UINT | nFlags,
 |  | UINT | nIDNewItem,
 |  | const char * | lpszNewItem,
 |  | CImageList * | il,
 |  | int | xoffset
 | ) |

Definition at line 1795 of file CJMenu.cpp.

References AppendMenuW.

01796 {
01797     USES_CONVERSION;
01798     return AppendMenuW(nFlags,nIDNewItem,A2W(lpszNewItem),il,xoffset);
01799 }

BOOL CCJMenu::AppendMenuA | ( | UINT | nFlags,
 |  | UINT | nIDNewItem,
 |  | const char * | lpszNewItem,
 |  | int | nIconNormal = -1
 | ) |

Definition at line 1784 of file CJMenu.cpp.

References AppendMenuW.

01785 {
01786     USES_CONVERSION;
01787     return AppendMenuW(nFlags,nIDNewItem,A2W(lpszNewItem),nIconNormal);
01788 }

BOOL CCJMenu::AppendMenuA | ( | UINT | nFlags,
 |  | UINT | nIDNewItem,
 |  | const CBitmap * | pBmp
 | ) | [inline]

Definition at line 186 of file CJMenu.h.

References AppendMenu.

00187         { return CMenu::AppendMenu( nFlags, nIDNewItem, pBmp ); }

BOOL CCJMenu::AppendMenuA | ( | UINT | nFlags,
 |  | UINT | nIDNewItem = 0,
 |  | LPCTSTR | lpszNewItem = NULL
 | ) | [inline]

Definition at line 183 of file CJMenu.h.

References AppendMenu, and NULL.

00184         { return CMenu::AppendMenu( nFlags, nIDNewItem, lpszNewItem ); }

BOOL CCJMenu::AppendMenuW | ( | UINT | nFlags,
 |  | UINT | nIDNewItem,
 |  | wchar_t * | lpszNewItem,
 |  | CBitmap * | bmp
 | ) |

Definition at line 1812 of file CJMenu.cpp.

References AppendODMenuW, m_bitmapBackground, m_iconX, m_iconY, and NULL.

01813 {
01814     if(bmp){
01815         CImageList temp;
01816         temp.Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1);
01817         if(m_bitmapBackgroundFlag)temp.Add(bmp,m_bitmapBackground);
01818         else temp.Add(bmp,GetSysColor(COLOR_3DFACE));
01819         return AppendODMenuW(lpszNewItem,nFlags,nIDNewItem,&temp,0);
01820     }
01821     return AppendODMenuW(lpszNewItem,nFlags,nIDNewItem,NULL,0);
01822 }

BOOL CCJMenu::AppendMenuW | ( | UINT | nFlags,
 |  | UINT | nIDNewItem,
 |  | wchar_t * | lpszNewItem,
 |  | CImageList * | il,
 |  | int | xoffset
 | ) |

Definition at line 1801 of file CJMenu.cpp.

References AppendODMenuW.

01802 {
01803     return AppendODMenuW(lpszNewItem,nFlags,nIDNewItem,il,xoffset);
01804 }

BOOL CCJMenu::AppendMenuW | ( | UINT | nFlags,
 |  | UINT | nIDNewItem,
 |  | wchar_t * | lpszNewItem,
 |  | int | nIconNormal = -1
 | ) |

Definition at line 1790 of file CJMenu.cpp.

References AppendODMenuW.

Referenced by AppendMenuA.

01791 {
01792     return AppendODMenuW(lpszNewItem,nFlags,nIDNewItem,nIconNormal);
01793 }

BOOL CCJMenu::AppendODMenuA | ( | LPCSTR | lpstrText,
 |  | UINT | nFlags,
 |  | UINT | nID,
 |  | CImageList * | il,
 |  | int | xoffset
 | ) |

Definition at line 654 of file CJMenu.cpp.

References AppendODMenuW.

00656 {
00657     USES_CONVERSION;
00658     return AppendODMenuW(A2W(lpstrText),nFlags,nID,il,xoffset);
00659 }

BOOL CCJMenu::AppendODMenuA | ( | LPCSTR | lpstrText,
 |  | UINT | nFlags = MF_OWNERDRAW,
 |  | UINT | nID = 0,
 |  | int | nIconNormal = -1
 | ) |

Definition at line 609 of file CJMenu.cpp.

References AppendODMenuW.

00611 {
00612     USES_CONVERSION;
00613     return AppendODMenuW(A2W(lpstrText),nFlags,nID,nIconNormal);//SK: See MFC Tech Note 059
00614 }

BOOL CCJMenu::AppendODMenuW | ( | wchar_t * | lpstrText,
 |  | UINT | nFlags,
 |  | UINT | nID,
 |  | CImageList * | il,
 |  | int | xoffset
 | ) |

Definition at line 661 of file CJMenu.cpp.

References AppendMenu, CCJMenuData::bitmap, m_AllSubMenus, m_MenuList, m_SubMenus, CCJMenuData::menuIconNormal, CCJMenuData::nFlags, CCJMenuData::nID, CCJMenuData::SetWideString, and CCJMenuData::xoffset.

00663 {
00664     // Add the MF_OWNERDRAW flag if not specified:
00665     if(!nID)nFlags=MF_SEPARATOR|MF_OWNERDRAW;
00666     else if(!(nFlags & MF_OWNERDRAW))nFlags |= MF_OWNERDRAW;
00667
00668     if(nFlags & MF_POPUP){
00669         m_AllSubMenus.Add((HMENU)nID);
00670         m_SubMenus.Add((HMENU)nID);
00671     }
00672
00673     CCJMenuData *mdata = new CCJMenuData;
00674     m_MenuList.Add(mdata);
00675     mdata->SetWideString(lpstrText);    //SK: modified for dynamic allocation
00676
00677     if(il){
00678         mdata->menuIconNormal = 0;
00679         mdata->xoffset=xoffset;
00680         if(mdata->bitmap)mdata->bitmap->Detach();
00681         else mdata->bitmap=new(CImageList);
00682         mdata->bitmap->Attach(ImageList_Duplicate(il->m_hImageList));
00683     }
00684     else{
00685         mdata->menuIconNormal = -1;
00686         mdata->xoffset = -1;
00687     }
00688     mdata->nFlags = nFlags;
00689     mdata->nID = nID;
00690     return(CMenu::AppendMenu(nFlags, nID, (LPCTSTR)mdata));
00691 }

BOOL CCJMenu::AppendODMenuW | ( | wchar_t * | lpstrText,
 |  | UINT | nFlags = MF_OWNERDRAW,
 |  | UINT | nID = 0,
 |  | int | nIconNormal = -1
 | ) |

Definition at line 617 of file CJMenu.cpp.

References AddBitmapToImageList, AppendMenu, CCJMenuData::bitmap, LoadFromToolBar, m_AllSubMenus, m_iconX, m_iconY, m_MenuList, m_SubMenus, CCJMenuData::menuIconNormal, CCJMenuData::nFlags, CCJMenuData::nID, NULL, CCJMenuData::SetWideString, and CCJMenuData::xoffset.

Referenced by AppendMenuW, AppendODMenuA, and AppendODPopupMenuW.

00619 {
00620     // Add the MF_OWNERDRAW flag if not specified:
00621     if(!nID)nFlags=MF_SEPARATOR|MF_OWNERDRAW;
00622     else if(!(nFlags & MF_OWNERDRAW))nFlags |= MF_OWNERDRAW;
00623
00624     if(nFlags & MF_POPUP){
00625         m_AllSubMenus.Add((HMENU)nID);
00626         m_SubMenus.Add((HMENU)nID);
00627     }
00628
00629     CCJMenuData *mdata = new CCJMenuData;
00630     m_MenuList.Add(mdata);
00631     mdata->SetWideString(lpstrText);    //SK: modified for dynamic allocation
00632
00633     mdata->menuIconNormal = nIconNormal;
00634     mdata->xoffset=-1;
00635     if(nIconNormal>=0){
00636         mdata->xoffset=0;
00637         LoadFromToolBar(nID,nIconNormal,mdata->xoffset);
00638         if(mdata->bitmap)mdata->bitmap->DeleteImageList();
00639         else mdata->bitmap=new(CImageList);
00640         mdata->bitmap->Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1);
00641         if(!AddBitmapToImageList(mdata->bitmap,nIconNormal)){
00642             mdata->bitmap->DeleteImageList();
00643             delete mdata->bitmap;
00644             mdata->bitmap=NULL;
00645             mdata->menuIconNormal = nIconNormal = -1;
00646             mdata->xoffset = -1;
00647         }
00648     }
00649     mdata->nFlags = nFlags;
00650     mdata->nID = nID;
00651     return(CMenu::AppendMenu(nFlags, nID, (LPCTSTR)mdata));
00652 }

CCJMenu * CCJMenu::AppendODPopupMenuA ( LPCSTR lpstrText )

Definition at line 1880 of file CJMenu.cpp.

References AppendODPopupMenuW.

01881 {
01882     USES_CONVERSION;
01883     return AppendODPopupMenuW(A2W(lpstrText));
01884 }

CCJMenu * CCJMenu::AppendODPopupMenuW ( wchar_t * lpstrText )

Definition at line 1866 of file CJMenu.cpp.

References AppendODMenuW, checkmaps, checkmapsshare, m_selectcheck, m_unselectcheck, and TRUE.

Referenced by AppendODPopupMenuA.

01867 {
01868     CCJMenu* pSubMenu = new CCJMenu;
01869     pSubMenu->m_unselectcheck=m_unselectcheck;
01870     pSubMenu->m_selectcheck=m_selectcheck;
01871     pSubMenu->checkmaps=checkmaps;
01872     pSubMenu->checkmapsshare=TRUE;
01873     pSubMenu->CreatePopupMenu();
01874     AppendODMenuW(lpstrText,MF_POPUP,(UINT)pSubMenu->m_hMenu, -1);
01875     return pSubMenu;
01876 }

BOOL CCJMenu::DeleteMenu | ( | UINT | uiId,
 |  | UINT | nFlags
 | ) |

Definition at line 1738 of file CJMenu.cpp.

References FindMenuOption, m_AllSubMenus, m_MenuList, m_SubMenus, and NULL.

01739 {
01740     if(MF_BYPOSITION&nFlags){
01741         CCJMenu* pSubMenu = (CCJMenu*) GetSubMenu(uiId);
01742         if(NULL==pSubMenu){
01743             UINT uiCommandId = GetMenuItemID(uiId);
01744             for(int i=0;i<m_MenuList.GetSize(); i++){
01745                 if(m_MenuList[i]->nID==uiCommandId){
01746                     delete m_MenuList.GetAt(i);
01747                     m_MenuList.RemoveAt(i);
01748                     break;
01749                 }
01750             }
01751         }
01752         else{
01753             int numSubMenus = m_SubMenus.GetUpperBound();
01754             for(int m = numSubMenus; m >= 0; m--){
01755                 if(m_SubMenus[m]==pSubMenu->m_hMenu){
01756                     int numAllSubMenus = m_AllSubMenus.GetUpperBound();
01757                     for(int n = numAllSubMenus; n>= 0; n--){
01758                         if(m_AllSubMenus[n]==m_SubMenus[m])m_AllSubMenus.RemoveAt(n);
01759                     }
01760                     m_SubMenus.RemoveAt(m);
01761                 }
01762             }
01763             int num = pSubMenu->GetMenuItemCount();
01764             for(int i=num-1;i>=0;--i)pSubMenu->DeleteMenu(i,MF_BYPOSITION);
01765             for(i=m_MenuList.GetUpperBound();i>=0;i--){
01766                 if(m_MenuList[i]->nID==(UINT)pSubMenu->m_hMenu){
01767                     delete m_MenuList.GetAt(i);
01768                     m_MenuList.RemoveAt(i);
01769                     break;
01770                 }
01771             }
01772             delete pSubMenu;
01773         }
01774     }
01775     else{
01776         int iPosition =0;
01777         CCJMenu* pMenu = FindMenuOption(uiId,iPosition);
01778         if(pMenu)pMenu->DeleteMenu(iPosition,MF_BYPOSITION);
01779     }
01780     return CMenu::DeleteMenu(uiId,nFlags);
01781 }

void CCJMenu::DeleteMenuList ( void )

Definition at line 1339 of file CJMenu.cpp.

References m_MenuList.

Referenced by SynchronizeMenu.

01340 {
01341     for(int i=0;i<=m_MenuList.GetUpperBound();++i){
01342         if(!m_MenuList[i]->syncflag){
01343             delete m_MenuList[i];
01344         }
01345     }
01346 }

BOOL CCJMenu::DestroyMenu ( ) [virtual]

Definition at line 198 of file CJMenu.cpp.

References checkmaps, checkmapsshare, m_AllSubMenus, m_MenuList, m_SubMenus, and NULL.

Referenced by CGfxOutBarCtrl::OnRButtonDown, CCJTabCtrl::OnRButtonDown, CCJFlatHeaderCtrl::OnRButtonDown, CCJControlBar::OnRButtonDown, CCJMenuBar::TrackPopup, and ~CCJMenu.

00199 {
00200     // Destroy Sub menus:
00201     int m,n;
00202     int numAllSubMenus = m_AllSubMenus.GetUpperBound();
00203     for(n = numAllSubMenus; n>= 0; n--){
00204         if(m_AllSubMenus[n]==this->m_hMenu)m_AllSubMenus.RemoveAt(n);
00205     }
00206     int numSubMenus = m_SubMenus.GetUpperBound();
00207     for(m = numSubMenus; m >= 0; m--){
00208         numAllSubMenus = m_AllSubMenus.GetUpperBound();
00209         for(n = numAllSubMenus; n>= 0; n--){
00210             if(m_AllSubMenus[n]==m_SubMenus[m])m_AllSubMenus.RemoveAt(n);
00211         }
00212         delete((CCJMenu *)FromHandle(m_SubMenus[m]));
00213     }
00214     m_SubMenus.RemoveAll();
00215     // Destroy menu data
00216     int numItems = m_MenuList.GetUpperBound();
00217     for(m = 0; m <= numItems; m++)delete(m_MenuList[m]);
00218     m_MenuList.RemoveAll();
00219     if(checkmaps&&!checkmapsshare){
00220         delete checkmaps;
00221         checkmaps=NULL;
00222     }
00223     // Call base-class implementation last:
00224     return(CMenu::DestroyMenu());
00225 };

void CCJMenu::DitherBlt | ( | HDC | hdcDest,
 |  | int | nXDest,
 |  | int | nYDest,
 |  | int | nWidth,
 |  | int | nHeight,
 |  | HBITMAP | hbm,
 |  | int | nXSrc,
 |  | int | nYSrc
 | ) |

Definition at line 1440 of file CJMenu.cpp.

References ASSERT, IsNewShell, NULL, and VERIFY.

Referenced by DrawItem.

01442 {
01443     ASSERT(hdcDest && hbm);
01444     ASSERT(nWidth > 0 && nHeight > 0);
01445
01446     // Create a generic DC for all BitBlts
01447     HDC hDC = CreateCompatibleDC(hdcDest);
01448     ASSERT(hDC);
01449
01450     if (hDC)
01451     {
01452         // Create a DC for the monochrome DIB section
01453         HDC bwDC = CreateCompatibleDC(hDC);
01454         ASSERT(bwDC);
01455
01456         if (bwDC)
01457         {
01458             // Create the monochrome DIB section with a black and white palette
01459             struct {
01460                 BITMAPINFOHEADER bmiHeader;
01461                 RGBQUAD      bmiColors[2];
01462             } RGBBWBITMAPINFO = {
01463
01464                 {    // a BITMAPINFOHEADER
01465                     sizeof(BITMAPINFOHEADER),  // biSize
01466                         nWidth,         // biWidth;
01467                         nHeight,        // biHeight;
01468                         1,            // biPlanes;
01469                         1,            // biBitCount
01470                         BI_RGB,         // biCompression;
01471                         0,            // biSizeImage;
01472                         0,            // biXPelsPerMeter;
01473                         0,            // biYPelsPerMeter;
01474                         0,            // biClrUsed;
01475                         0            // biClrImportant;
01476                 },
01477                 {
01478                     { 0x00, 0x00, 0x00, 0x00 }, { 0xFF, 0xFF, 0xFF, 0x00 }
01479                     }
01480             };
01481             VOID *pbitsBW;
01482             HBITMAP hbmBW = CreateDIBSection(bwDC,
01483                 (LPBITMAPINFO)&RGBBWBITMAPINFO, DIB_RGB_COLORS, &pbitsBW, NULL, 0);
01484             ASSERT(hbmBW);
01485
01486             if (hbmBW)
01487             {
01488                 // Attach the monochrome DIB section and the bitmap to the DCs
01489                 HBITMAP olddib = (HBITMAP)SelectObject(bwDC, hbmBW);
01490                 HBITMAP hdcolddib = (HBITMAP)SelectObject(hDC, hbm);
01491
01492                 // BitBlt the bitmap into the monochrome DIB section
01493                 BitBlt(bwDC, 0, 0, nWidth, nHeight, hDC, nXSrc, nYSrc, SRCCOPY);
01494
01495                 // Paint the destination rectangle in gray
01496                 FillRect(hdcDest, CRect(nXDest, nYDest, nXDest + nWidth, nYDest +
01497                     nHeight), GetSysColorBrush((IsNewShell())?COLOR_3DFACE:COLOR_MENU));
01498                 //SK: looks better on the old shell
01499                 // BitBlt the black bits in the monochrome bitmap into COLOR_3DHILIGHT
01500                 // bits in the destination DC
01501                 // The magic ROP comes from the Charles Petzold's book
01502                 HBRUSH hb = CreateSolidBrush(GetSysColor(COLOR_3DHILIGHT));
01503                 HBRUSH oldBrush = (HBRUSH)SelectObject(hdcDest, hb);
01504                 BitBlt(hdcDest,nXDest+1,nYDest+1,nWidth,nHeight,bwDC,0,0,0xB8074A);
01505
01506                 // BitBlt the black bits in the monochrome bitmap into COLOR_3DSHADOW
01507                 // bits in the destination DC
01508                 hb = CreateSolidBrush(GetSysColor(COLOR_3DSHADOW));
01509                 DeleteObject(SelectObject(hdcDest, hb));
01510                 BitBlt(hdcDest, nXDest, nYDest, nWidth, nHeight,bwDC,0,0,0xB8074A);
01511                 DeleteObject(SelectObject(hdcDest, oldBrush));
01512                 VERIFY(DeleteObject(SelectObject(bwDC, olddib)));
01513                 SelectObject(hDC, hdcolddib);
01514             }
01515
01516             VERIFY(DeleteDC(bwDC));
01517         }
01518
01519         VERIFY(DeleteDC(hDC));
01520     }
01521 }

void CCJMenu::DitherBlt2 | ( | CDC * | drawdc,
 |  | int | nXDest,
 |  | int | nYDest,
 |  | int | nWidth,
 |  | int | nHeight,
 |  | CBitmap & | bmp,
 |  | int | nXSrc,
 |  | int | nYSrc
 | ) |

Definition at line 1617 of file CJMenu.cpp.

References IsNewShell.

Referenced by DrawItem.

01619 {
01620     // create a monochrome memory DC
01621     CDC ddc;
01622     ddc.CreateCompatibleDC(0);
01623     CBitmap bwbmp;
01624     bwbmp.CreateCompatibleBitmap(&ddc, nWidth, nHeight);
01625     CBitmap * pddcOldBmp = ddc.SelectObject(&bwbmp);
01626
01627     CDC dc;
01628     dc.CreateCompatibleDC(0);
01629     CBitmap * pdcOldBmp = dc.SelectObject(&bmp);
01630
01631     // build a mask
01632     ddc.PatBlt(0, 0, nWidth, nHeight, WHITENESS);
01633     dc.SetBkColor(GetSysColor(COLOR_BTNFACE));
01634     ddc.BitBlt(0, 0, nWidth, nHeight, &dc, nXSrc,nYSrc, SRCCOPY);
01635     dc.SetBkColor(GetSysColor(COLOR_BTNHILIGHT));
01636     ddc.BitBlt(0, 0, nWidth, nHeight, &dc, nXSrc,nYSrc, SRCPAINT);
01637
01638     // Copy the image from the toolbar into the memory DC
01639     // and draw it (grayed) back into the toolbar.
01640     dc.FillSolidRect(0,0, nWidth, nHeight, GetSysColor((IsNewShell())?COLOR_3DFACE:COLOR_MENU));
01641     //SK: Looks better on the old shell
01642     dc.SetBkColor(RGB(0, 0, 0));
01643     dc.SetTextColor(RGB(255, 255, 255));
01644     CBrush brShadow, brHilight;
01645     brHilight.CreateSolidBrush(GetSysColor(COLOR_BTNHILIGHT));
01646     brShadow.CreateSolidBrush(GetSysColor(COLOR_BTNSHADOW));
01647     CBrush * pOldBrush = dc.SelectObject(&brHilight);
01648     dc.BitBlt(0,0, nWidth, nHeight, &ddc, 0, 0, 0x00E20746L);
01649     drawdc->BitBlt(nXDest+1,nYDest+1,nWidth, nHeight, &dc,0,0,SRCCOPY);
01650     dc.BitBlt(1,1, nWidth, nHeight, &ddc, 0, 0, 0x00E20746L);
01651     dc.SelectObject(&brShadow);
01652     dc.BitBlt(0,0, nWidth, nHeight, &ddc, 0, 0, 0x00E20746L);
01653     drawdc->BitBlt(nXDest,nYDest,nWidth, nHeight, &dc,0,0,SRCCOPY);
01654     // reset DCs
01655     ddc.SelectObject(pddcOldBmp);
01656     ddc.DeleteDC();
01657     dc.SelectObject(pOldBrush);
01658     dc.SelectObject(pdcOldBmp);
01659     dc.DeleteDC();
01660
01661     brShadow.DeleteObject();
01662     brHilight.DeleteObject();
01663     bwbmp.DeleteObject();
01664 }

BOOL CCJMenu::Draw3DCheckmark | ( | CDC * | dc,
 |  | const CRect & | rc,
 |  | BOOL | bSelected,
 |  | HBITMAP | hbmCheck
 | ) |

Definition at line 1601 of file CJMenu.cpp.

References DrawCheckMark, DrawRadioDot, IsNewShell, and TRUE.

Referenced by DrawItem.

01603 {
01604     CRect rcDest = rc;
01605     CBrush brush;
01606     COLORREF col=GetSysColor((bSelected||!IsNewShell())?COLOR_MENU:COLOR_3DLIGHT);//SK: Looks better on the old shell
01607     brush.CreateSolidBrush(col);
01608     dc->FillRect(rcDest,&brush);
01609     brush.DeleteObject();
01610     if (IsNewShell()) //SK: looks better on the old shell
01611         dc->DrawEdge(&rcDest, BDR_SUNKENOUTER, BF_RECT);
01612     if (!hbmCheck)DrawCheckMark(dc,rc.left+4,rc.top+4,GetSysColor(COLOR_MENUTEXT));
01613     else DrawRadioDot(dc,rc.left+5,rc.top+4,GetSysColor(COLOR_MENUTEXT));
01614     return TRUE;
01615 }

void CCJMenu::DrawCheckMark | ( | CDC * | pDC,
 |  | int | x,
 |  | int | y,
 |  | COLORREF | color
 | ) |

Definition at line 1291 of file CJMenu.cpp.

Referenced by Draw3DCheckmark.

01292 {
01293     pDC->SetPixel(x,y+2,color);
01294     pDC->SetPixel(x,y+3,color);
01295     pDC->SetPixel(x,y+4,color);
01296
01297     pDC->SetPixel(x+1,y+3,color);
01298     pDC->SetPixel(x+1,y+4,color);
01299     pDC->SetPixel(x+1,y+5,color);
01300
01301     pDC->SetPixel(x+2,y+4,color);
01302     pDC->SetPixel(x+2,y+5,color);
01303     pDC->SetPixel(x+2,y+6,color);
01304
01305     pDC->SetPixel(x+3,y+3,color);
01306     pDC->SetPixel(x+3,y+4,color);
01307     pDC->SetPixel(x+3,y+5,color);
01308
01309     pDC->SetPixel(x+4,y+2,color);
01310     pDC->SetPixel(x+4,y+3,color);
01311     pDC->SetPixel(x+4,y+4,color);
01312
01313     pDC->SetPixel(x+5,y+1,color);
01314     pDC->SetPixel(x+5,y+2,color);
01315     pDC->SetPixel(x+5,y+3,color);
01316
01317     pDC->SetPixel(x+6,y,color);
01318     pDC->SetPixel(x+6,y+1,color);
01319     pDC->SetPixel(x+6,y+2,color);
01320 }

void CCJMenu::DrawItem ( LPDRAWITEMSTRUCT ) [virtual]

Definition at line 245 of file CJMenu.cpp.

References ASSERT, checkmaps, DitherBlt, DitherBlt2, Draw3DCheckmark, FALSE, GAP, GetBitmapFromImageList, IsNewShell, m_iconX, m_iconY, m_selectcheck, m_unselectcheck, NULL, TRUE, and VERIFY.

00246 {
00247     ASSERT(lpDIS != NULL);
00248     CDC* pDC = CDC::FromHandle(lpDIS->hDC);
00249     CRect rect;
00250     UINT state = (((CCJMenuData*)(lpDIS->itemData))->nFlags);
00251     if(state & MF_SEPARATOR){
00252         rect.CopyRect(&lpDIS->rcItem);
00253         rect.top+=rect.Height()>>1;
00254         pDC->DrawEdge(&rect,EDGE_ETCHED,BF_TOP);
00255     }
00256     else{
00257         CRect rect2;
00258         BOOL standardflag=FALSE,selectedflag=FALSE,disableflag=FALSE;
00259         BOOL checkflag=FALSE;
00260         COLORREF crText = GetSysColor(COLOR_MENUTEXT);
00261         COLORREF m_clrBack=GetSysColor(COLOR_MENU);
00262         CBrush m_brBackground,m_brSelect;
00263         CPen m_penBack;
00264         int x0,y0,dy;
00265         int nIconNormal=-1,xoffset=-1;
00266         CImageList *bitmap=NULL;
00267         CFont m_fontMenu;
00268         LOGFONT m_lf;
00269
00270         // set some colors and the font
00271         m_penBack.CreatePen (PS_SOLID,0,GetSysColor(COLOR_MENU));
00272         m_brBackground.CreateSolidBrush(GetSysColor(COLOR_MENU));
00273         m_brSelect.CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT));
00274         ZeroMemory ((PVOID) &m_lf,sizeof (LOGFONT));
00275         NONCLIENTMETRICS nm;
00276         nm.cbSize = sizeof (NONCLIENTMETRICS);
00277         VERIFY (SystemParametersInfo(SPI_GETNONCLIENTMETRICS,nm.cbSize,&nm,0));
00278         m_lf =  nm.lfMenuFont;
00279         m_fontMenu.CreateFontIndirect (&m_lf);
00280
00281         // draw the colored rectangle portion
00282
00283         rect.CopyRect(&lpDIS->rcItem);
00284         rect2=rect;
00285
00286         // draw the up/down/focused/disabled state
00287
00288         UINT action = lpDIS->itemAction;
00289         UINT state = lpDIS->itemState;
00290         CString strText;
00291         LOGFONT lf;
00292         lf = m_lf;
00293
00294         CFont dispFont;
00295         CFont *pFont=NULL;
00296
00297         if(lpDIS->itemData != NULL){
00298             nIconNormal = (((CCJMenuData*)(lpDIS->itemData))->menuIconNormal);
00299             xoffset = (((CCJMenuData*)(lpDIS->itemData))->xoffset);
00300             bitmap = (((CCJMenuData*)(lpDIS->itemData))->bitmap);
00301             strText = ((CCJMenuData*) (lpDIS->itemData))->GetString();
00302
00303             if(state&ODS_CHECKED && nIconNormal<0){
00304                 if(state&ODS_SELECTED && m_selectcheck>0)checkflag=TRUE;
00305                 else if(m_unselectcheck>0) checkflag=TRUE;
00306             }
00307             else if(nIconNormal != -1){
00308                 standardflag=TRUE;
00309                 if(state&ODS_SELECTED && !(state&ODS_GRAYED))selectedflag=TRUE;
00310                 else if(state&ODS_GRAYED) disableflag=TRUE;
00311             }
00312         }
00313         else{
00314             strText.Empty();
00315         }
00316
00317         if(state&ODS_SELECTED){ // draw the down edges
00318
00319             CPen *pOldPen = pDC->SelectObject (&m_penBack);
00320
00321             // You need only Text highlight and thats what you get
00322
00323             if(checkflag||standardflag||selectedflag||disableflag||state&ODS_CHECKED)
00324                 rect2.SetRect(rect.left+m_iconX+4+GAP,rect.top,rect.right,rect.bottom);
00325             pDC->FillRect (rect2,&m_brSelect);
00326
00327             pDC->SelectObject (pOldPen);
00328             if((HFONT)dispFont != NULL)dispFont.DeleteObject ();
00329             dispFont.CreateFontIndirect (&lf);
00330             crText = GetSysColor(COLOR_HIGHLIGHTTEXT);
00331         }
00332         else {
00333             CPen *pOldPen = pDC->SelectObject (&m_penBack);
00334             pDC->FillRect (rect,&m_brBackground);
00335             pDC->SelectObject (pOldPen);
00336
00337             // draw the up edges
00338
00339             pDC->Draw3dRect (rect,m_clrBack,m_clrBack);
00340             if ((HFONT)dispFont != NULL) dispFont.DeleteObject ();
00341             dispFont.CreateFontIndirect (&lf); //Normal
00342         }
00343
00344         // draw the text if there is any
00345         //We have to paint the text only if the image is nonexistant
00346
00347         dy = (rect.Height()-4-m_iconY)/2;
00348         dy = dy<0 ? 0 : dy;
00349
00350         if(checkflag||standardflag||selectedflag||disableflag){
00351             rect2.SetRect(rect.left+1,rect.top+1+dy,rect.left+m_iconX+3,
00352                 rect.top+m_iconY+3+dy);
00353             pDC->Draw3dRect (rect2,m_clrBack,m_clrBack);
00354             if(checkflag && checkmaps){
00355                 pDC->FillRect (rect2,&m_brBackground);
00356                 rect2.SetRect(rect.left,rect.top+dy,rect.left+m_iconX+4,
00357                     rect.top+m_iconY+4+dy);
00358
00359                 pDC->Draw3dRect (rect2,m_clrBack,m_clrBack);
00360                 CPoint ptImage(rect.left+2,rect.top+2+dy);
00361
00362                 if(state&ODS_SELECTED)checkmaps->Draw(pDC,1,ptImage,ILD_TRANSPARENT);
00363                 else checkmaps->Draw(pDC,0,ptImage,ILD_TRANSPARENT);
00364             }
00365             else if(disableflag){
00366                 if(!selectedflag){
00367                     CBitmap bitmapstandard;
00368                     GetBitmapFromImageList(pDC,bitmap,xoffset,bitmapstandard);
00369                     rect2.SetRect(rect.left,rect.top+dy,rect.left+m_iconX+4,
00370                         rect.top+m_iconY+4+dy);
00371                     pDC->Draw3dRect (rect2,m_clrBack,m_clrBack);
00372                     if(disable_old_style)
00373                         DitherBlt(lpDIS->hDC,rect.left+2,rect.top+2+dy,m_iconX,m_iconY,
00374                         (HBITMAP)(bitmapstandard),0,0);
00375                     else
00376                         DitherBlt2(pDC,rect.left+2,rect.top+2+dy,m_iconX,m_iconY,
00377                         bitmapstandard,0,0);
00378                     bitmapstandard.DeleteObject();
00379                 }
00380             }
00381             else if(selectedflag){
00382                 pDC->FillRect (rect2,&m_brBackground);
00383                 rect2.SetRect(rect.left,rect.top+dy,rect.left+m_iconX+4,
00384                     rect.top+m_iconY+4+dy);
00385                 if (IsNewShell()){
00386                     if(state&ODS_CHECKED)
00387                         pDC->Draw3dRect(rect2,GetSysColor(COLOR_3DSHADOW),
00388                         GetSysColor(COLOR_3DHILIGHT));
00389                     else
00390                         pDC->Draw3dRect(rect2,GetSysColor(COLOR_3DHILIGHT),
00391                         GetSysColor(COLOR_3DSHADOW));
00392                 }
00393                 CPoint ptImage(rect.left+2,rect.top+2+dy);
00394                 if(bitmap)bitmap->Draw(pDC,xoffset,ptImage,ILD_TRANSPARENT);
00395             }
00396             else{
00397                 if(state&ODS_CHECKED){
00398                     CBrush brush;
00399                     COLORREF col =GetSysColor(COLOR_3DLIGHT);
00400                     brush.CreateSolidBrush(col);
00401                     pDC->FillRect(rect2,&brush);
00402                     brush.DeleteObject();
00403                     rect2.SetRect(rect.left,rect.top+dy,rect.left+m_iconX+4,
00404                         rect.top+m_iconY+4+dy);
00405                     if (IsNewShell())
00406                         pDC->Draw3dRect(rect2,GetSysColor(COLOR_3DSHADOW),
00407                         GetSysColor(COLOR_3DHILIGHT));
00408                 }
00409                 else{
00410                     pDC->FillRect (rect2,&m_brBackground);
00411                     rect2.SetRect(rect.left,rect.top+dy,rect.left+m_iconX+4,
00412                         rect.top+m_iconY+4+dy);
00413                     pDC->Draw3dRect (rect2,m_clrBack,m_clrBack);
00414                 }
00415                 CPoint ptImage(rect.left+2,rect.top+2+dy);
00416                 if(bitmap)bitmap->Draw(pDC,xoffset,ptImage,ILD_TRANSPARENT);
00417             }
00418         }
00419         if(nIconNormal<0 && state&ODS_CHECKED && !checkflag){
00420             rect2.SetRect(rect.left+1,rect.top+2+dy,rect.left+m_iconX+1,
00421                 rect.top+m_iconY+2+dy);
00422             CMenuItemInfo info;
00423             info.fMask = MIIM_CHECKMARKS;
00424             ::GetMenuItemInfo((HMENU)lpDIS->hwndItem,lpDIS->itemID,
00425                 MF_BYCOMMAND, &info);
00426             if(state&ODS_CHECKED || info.hbmpUnchecked) {
00427                 Draw3DCheckmark(pDC, rect2, state&ODS_SELECTED,
00428                     state&ODS_CHECKED ? info.hbmpChecked :
00429                 info.hbmpUnchecked);
00430             }
00431         }
00432
00433         //This is needed always so that we can have the space for check marks
00434
00435         x0=rect.left;y0=rect.top;
00436         rect.left = rect.left + m_iconX + 8 + GAP;
00437
00438         if(!strText.IsEmpty()){
00439
00440             CRect rectt(rect.left,rect.top-1,rect.right,rect.bottom-1);
00441
00442             //   Find tabs
00443
00444             CString leftStr,rightStr;
00445             leftStr.Empty();rightStr.Empty();
00446             int tablocr=strText.ReverseFind(_T('\t'));
00447             if(tablocr!=-1){
00448                 rightStr=strText.Mid(tablocr+1);
00449                 leftStr=strText.Left(strText.Find(_T('\t')));
00450                 rectt.right-=m_iconX;
00451             }
00452             else leftStr=strText;
00453
00454             int iOldMode = pDC->GetBkMode();
00455             pDC->SetBkMode( TRANSPARENT);
00456
00457             // Draw the text in the correct colour:
00458
00459             UINT nFormat  = DT_LEFT|DT_SINGLELINE|DT_VCENTER;
00460             UINT nFormatr = DT_RIGHT|DT_SINGLELINE|DT_VCENTER;
00461             if(!(lpDIS->itemState & ODS_GRAYED)){
00462                 pDC->SetTextColor(crText);
00463                 pDC->DrawText (leftStr,rectt,nFormat);
00464                 if(tablocr!=-1) pDC->DrawText (rightStr,rectt,nFormatr);
00465             }
00466             else{
00467
00468                 // Draw the disabled text
00469                 if(!(state & ODS_SELECTED)){
00470                     RECT offset = *rectt;
00471                     offset.left+=1;
00472                     offset.right+=1;
00473                     offset.top+=1;
00474                     offset.bottom+=1;
00475                     pDC->SetTextColor(GetSysColor(COLOR_BTNHILIGHT));
00476                     pDC->DrawText(leftStr,&offset, nFormat);
00477                     if(tablocr!=-1) pDC->DrawText (rightStr,&offset,nFormatr);
00478                     pDC->SetTextColor(GetSysColor(COLOR_GRAYTEXT));
00479                     pDC->DrawText(leftStr,rectt, nFormat);
00480                     if(tablocr!=-1) pDC->DrawText (rightStr,rectt,nFormatr);
00481                 }
00482                 else{
00483                     // And the standard Grey text:
00484                     pDC->SetTextColor(m_clrBack);
00485                     pDC->DrawText(leftStr,rectt, nFormat);
00486                     if(tablocr!=-1) pDC->DrawText (rightStr,rectt,nFormatr);
00487                 }
00488             }
00489             pFont = pDC->SelectObject (&dispFont);
00490             pDC->SetBkMode( iOldMode );
00491             pDC->SelectObject (pFont); //set it to the old font
00492         }
00493
00494         m_penBack.DeleteObject();
00495         m_brBackground.DeleteObject();
00496         m_fontMenu.DeleteObject();
00497         m_brSelect.DeleteObject();
00498         dispFont.DeleteObject ();
00499   }
00500 }

void CCJMenu::DrawRadioDot | ( | CDC * | pDC,
 |  | int | x,
 |  | int | y,
 |  | COLORREF | color
 | ) |

Definition at line 1275 of file CJMenu.cpp.

Referenced by Draw3DCheckmark.

01276 {
01277     CRect rcDot(x,y,x+6,y+6);
01278     CBrush brush;
01279     CPen pen;
01280     brush.CreateSolidBrush(color);
01281     pen.CreatePen(PS_SOLID,0,color);
01282     CBrush *pOldBrush=pDC->SelectObject(&brush);
01283     CPen *pOldPen=pDC->SelectObject(&pen);
01284     pDC->Ellipse(&rcDot);
01285     pDC->SelectObject(pOldBrush);
01286     pDC->SelectObject(pOldPen);
01287     pen.DeleteObject();
01288     brush.DeleteObject();
01289 }

LRESULT CCJMenu::FindKeyboardShortcut | ( | UINT | nChar,
 |  | UINT | nFlags,
 |  | CMenu * | pMenu
 | ) | [static]

Definition at line 1414 of file CJMenu.cpp.

References GetMenuText, m_MenuList, and SynchronizeMenu.

Referenced by CCJTabCtrl::OnMenuChar, CCJMDIFrameWnd::OnMenuChar, CCJFrameWnd::OnMenuChar, CCJFlatHeaderCtrl::OnMenuChar, and CCJControlBar::OnMenuChar.

01416 {
01417 #ifdef _CPPRTTI
01418     CCJMenu *pCCJMenu = dynamic_cast<CCJMenu *>(pMenu);
01419 #else
01420     CCJMenu *pCCJMenu = (CCJMenu *)pMenu;
01421 #endif
01422     if(pCCJMenu && nFlags&MF_POPUP){
01423         CString key(_T('&'),2);//SK: modified for Unicode correctness
01424         key.SetAt(1,(TCHAR)nChar);
01425         key.MakeLower();
01426         CString menutext;
01427         int menusize = (int)pCCJMenu->GetMenuItemCount();
01428         if(menusize!=(pCCJMenu->m_MenuList.GetUpperBound()+1))
01429             pCCJMenu->SynchronizeMenu();
01430         for(int i=0;i<menusize;++i){
01431             if(pCCJMenu->GetMenuText(i,menutext)){
01432                 menutext.MakeLower();
01433                 if(menutext.Find(key)>=0)return(MAKELRESULT(i,2));
01434             }
01435         }
01436     }
01437     return(0);
01438 }

CCJMenuData * CCJMenu::FindMenuList ( UINT nID )

Definition at line 1322 of file CJMenu.cpp.

References m_MenuList.

Referenced by SynchronizeMenu.

01323 {
01324     for(int i=0;i<=m_MenuList.GetUpperBound();++i){
01325         if(m_MenuList[i]->nID==nID && !m_MenuList[i]->syncflag){
01326             m_MenuList[i]->syncflag=1;
01327             return(m_MenuList[i]);
01328         }
01329     }
01330     return(NULL);
01331 }

CCJMenuData * CCJMenu::FindMenuOption ( wchar_t * lpstrText )

Definition at line 1023 of file CJMenu.cpp.

References FindMenuOption, and m_MenuList.

01024 {
01025     int i,j;
01026     CCJMenu *psubmenu;
01027     CCJMenuData *pmenulist;
01028
01029     for(i=0;i<(int)(GetMenuItemCount());++i){
01030 #ifdef _CPPRTTI
01031         psubmenu=dynamic_cast<CCJMenu *>(GetSubMenu(i));
01032 #else
01033         psubmenu=(CCJMenu *)GetSubMenu(i);
01034 #endif
01035         if(psubmenu){
01036             pmenulist=psubmenu->FindMenuOption(lpstrText);
01037             if(pmenulist)return(pmenulist);
01038         }
01039         else{
01040             const wchar_t *szWide;//SK: we use const to prevent misuse of this Ptr
01041             for(j=0;j<=m_MenuList.GetUpperBound();++j){
01042                 szWide = m_MenuList[j]->GetWideString ();
01043                 if(szWide && !wcscmp(lpstrText,szWide))//SK: modified for dynamic allocation
01044                     return(m_MenuList[j]);
01045             }
01046         }
01047     }
01048     return(NULL);
01049 }

CCJMenu * CCJMenu::FindMenuOption | ( | int | nId,
 |  | int & | nLoc
 | ) |

Definition at line 999 of file CJMenu.cpp.

Referenced by AddFromToolBar, DeleteMenu, FindMenuOption, GetMenuText, ModifyODMenuW, and RemoveMenu.

01000 {
01001     int i;
01002     CCJMenu *psubmenu,*pgoodmenu;
01003
01004     for(i=0;i<(int)(GetMenuItemCount());++i){
01005 #ifdef _CPPRTTI
01006         psubmenu=dynamic_cast<CCJMenu *>(GetSubMenu(i));
01007 #else
01008         psubmenu=(CCJMenu *)GetSubMenu(i);
01009 #endif
01010         if(psubmenu){
01011             pgoodmenu=psubmenu->FindMenuOption(nId,nLoc);
01012             if(pgoodmenu)return(pgoodmenu);
01013         }
01014         else if(nId==(int)GetMenuItemID(i)){
01015             nLoc=i;
01016             return(this);
01017         }
01018     }
01019     nLoc = -1;
01020     return(NULL);
01021 }

BOOL CCJMenu::GetBitmapFromImageList | ( | CDC * | pDC,
 |  | CImageList * | imglist,
 |  | int | nIndex,
 |  | CBitmap & | bmp
 | ) |

Definition at line 502 of file CJMenu.cpp.

References m_iconX, and m_iconY.

Referenced by DrawItem.

00503 {
00504     HICON hIcon = imglist->ExtractIcon(nIndex);
00505     CDC dc;
00506     dc.CreateCompatibleDC(pDC);
00507     bmp.CreateCompatibleBitmap(pDC,m_iconX,m_iconY);
00508     CBitmap* pOldBmp = dc.SelectObject(&bmp);
00509     CBrush brush ;
00510     brush.CreateSolidBrush(GetSysColor(COLOR_MENU));
00511     ::DrawIconEx(
00512         dc.GetSafeHdc(),
00513         0,
00514         0,
00515         hIcon,
00516         m_iconX,
00517         m_iconY,
00518         0,
00519         (HBRUSH)brush,
00520         DI_NORMAL
00521         );
00522     dc.SelectObject( pOldBmp );
00523     dc.DeleteDC();
00524     // the icon is not longer needed
00525     DestroyIcon(hIcon);
00526     return(TRUE);
00527 }

BOOL CCJMenu::GetDisableOldStyle ( void )

Definition at line 1676 of file CJMenu.cpp.

01677 {
01678     return(disable_old_style);
01679 }

BOOL CCJMenu::GetMenuText | ( | UINT | id,
 |  | CString & | string,
 |  | UINT | nFlags = MF_BYPOSITION
 | ) |

Definition at line 1255 of file CJMenu.cpp.

References FALSE, FindMenuOption, m_MenuList, NULL, and TRUE.

Referenced by FindKeyboardShortcut.

01256 {
01257     BOOL returnflag=FALSE;
01258
01259     if(MF_BYPOSITION&nFlags){
01260         UINT numMenuItems = m_MenuList.GetUpperBound();
01261         if(id<=numMenuItems){
01262             string=m_MenuList[id]->GetString();
01263             returnflag=TRUE;
01264         }
01265     }
01266     else{
01267         int uiLoc;
01268         CCJMenu* pMenu = FindMenuOption(id,uiLoc);
01269         if(NULL!=pMenu) returnflag = pMenu->GetMenuText(uiLoc,string);
01270     }
01271     return(returnflag);
01272 }

void CCJMenu::InitializeMenuList ( int value )

Definition at line 1333 of file CJMenu.cpp.

References m_MenuList.

Referenced by SynchronizeMenu.

01334 {
01335     for(int i=0;i<=m_MenuList.GetUpperBound();++i)
01336         m_MenuList[i]->syncflag=value;
01337 }

BOOL CCJMenu::InsertMenuA | ( | UINT | nPosition,
 |  | UINT | nFlags,
 |  | UINT | nIDNewItem,
 |  | const char * | lpszNewItem,
 |  | CBitmap * | bmp
 | ) |

Definition at line 1846 of file CJMenu.cpp.

References InsertMenuW.

01847 {
01848     USES_CONVERSION;
01849     return InsertMenuW(nPosition,nFlags,nIDNewItem,A2W(lpszNewItem),bmp);
01850 }

BOOL CCJMenu::InsertMenuA | ( | UINT | nPosition,
 |  | UINT | nFlags,
 |  | UINT | nIDNewItem,
 |  | const char * | lpszNewItem,
 |  | CImageList * | il,
 |  | int | xoffset
 | ) |

Definition at line 1835 of file CJMenu.cpp.

References InsertMenuW.

01836 {
01837     USES_CONVERSION;
01838     return InsertMenuW(nPosition,nFlags,nIDNewItem,A2W(lpszNewItem),il,xoffset);
01839 }

BOOL CCJMenu::InsertMenuA | ( | UINT | nPosition,
 |  | UINT | nFlags,
 |  | UINT | nIDNewItem,
 |  | const char * | lpszNewItem,
 |  | int | nIconNormal = -1
 | ) |

Definition at line 1824 of file CJMenu.cpp.

References InsertMenuW.

01825 {
01826     USES_CONVERSION;
01827     return InsertMenuW(nPosition,nFlags,nIDNewItem,A2W(lpszNewItem),nIconNormal);
01828 }

BOOL CCJMenu::InsertMenuW | ( | UINT | nPosition,
 |  | UINT | nFlags,
 |  | UINT | nIDNewItem,
 |  | wchar_t * | lpszNewItem,
 |  | CBitmap * | bmp
 | ) |

Definition at line 1852 of file CJMenu.cpp.

References InsertODMenuW, m_bitmapBackground, m_iconX, m_iconY, and NULL.

01853 {
01854     if(bmp){
01855         CImageList temp;
01856         temp.Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1);
01857         if(m_bitmapBackgroundFlag)temp.Add(bmp,m_bitmapBackground);
01858         else temp.Add(bmp,GetSysColor(COLOR_3DFACE));
01859         return InsertODMenuW(nPosition,lpszNewItem,nFlags,nIDNewItem,&temp,0);
01860     }
01861     return InsertODMenuW(nPosition,lpszNewItem,nFlags,nIDNewItem,NULL,0);
01862 }

BOOL CCJMenu::InsertMenuW | ( | UINT | nPosition,
 |  | UINT | nFlags,
 |  | UINT | nIDNewItem,
 |  | wchar_t * | lpszNewItem,
 |  | CImageList * | il,
 |  | int | xoffset
 | ) |

Definition at line 1841 of file CJMenu.cpp.

References InsertODMenuW.

01842 {
01843     return InsertODMenuW(nPosition,lpszNewItem,nFlags,nIDNewItem,il,xoffset);
01844 }

BOOL CCJMenu::InsertMenuW | ( | UINT | nPosition,
 |  | UINT | nFlags,
 |  | UINT | nIDNewItem,
 |  | wchar_t * | lpszNewItem,
 |  | int | nIconNormal = -1
 | ) |

Definition at line 1830 of file CJMenu.cpp.

References InsertODMenuW.

Referenced by InsertMenuA.

01831 {
01832     return InsertODMenuW(nPosition,lpszNewItem,nFlags,nIDNewItem,nIconNormal);
01833 }

BOOL CCJMenu::InsertODMenuA | ( | UINT | nPosition,
 |  | LPCSTR | lpstrText,
 |  | UINT | nFlags,
 |  | UINT | nID,
 |  | CImageList * | il,
 |  | int | xoffset
 | ) |

Definition at line 738 of file CJMenu.cpp.

References InsertODMenuW.

00740 {
00741     USES_CONVERSION;
00742     return InsertODMenuW(nPosition,A2W(lpstrText),nFlags,nID,il,xoffset);
00743 }

BOOL CCJMenu::InsertODMenuA | ( | UINT | nPosition,
 |  | LPCSTR | lpstrText,
 |  | UINT | nFlags = MF_OWNERDRAW,
 |  | UINT | nID = 0,
 |  | int | nIconNormal = -1
 | ) |

Definition at line 693 of file CJMenu.cpp.

References InsertODMenuW.

00695 {
00696     USES_CONVERSION;
00697     return InsertODMenuW(nPosition,A2W(lpstrText),nFlags,nID,nIconNormal);
00698 }

BOOL CCJMenu::InsertODMenuW | ( | UINT | nPosition,
 |  | wchar_t * | lpstrText,
 |  | UINT | nFlags,
 |  | UINT | nID,
 |  | CImageList * | il,
 |  | int | xoffset
 | ) |

Definition at line 745 of file CJMenu.cpp.

References CCJMenuData::bitmap, InsertMenu, m_AllSubMenus, m_MenuList, m_SubMenus, CCJMenuData::menuIconNormal, CCJMenuData::nFlags, CCJMenuData::nID, CCJMenuData::SetWideString, and CCJMenuData::xoffset.

00747 {
00748     // Add the MF_OWNERDRAW flag if not specified:
00749     if(!nID)nFlags=MF_SEPARATOR|MF_OWNERDRAW;
00750     else if(!(nFlags & MF_OWNERDRAW))nFlags |= MF_OWNERDRAW;
00751
00752     if(nFlags & MF_POPUP){
00753         m_AllSubMenus.Add((HMENU)nID);
00754         m_SubMenus.InsertAt(nPosition,(HMENU)nID);
00755     }
00756
00757     CCJMenuData *mdata = new CCJMenuData;
00758     m_MenuList.InsertAt(nPosition,mdata);
00759     mdata->SetWideString(lpstrText);    //SK: modified for dynamic allocation
00760
00761     if(il){
00762         mdata->menuIconNormal = 0;
00763         mdata->xoffset=xoffset;
00764         if(mdata->bitmap)mdata->bitmap->Detach();
00765         else mdata->bitmap=new(CImageList);
00766         mdata->bitmap->Attach(ImageList_Duplicate(il->m_hImageList));
00767     }
00768     else{
00769         mdata->menuIconNormal = -1;
00770         mdata->xoffset = -1;
00771     }
00772     mdata->nFlags = nFlags;
00773     mdata->nID = nID;
00774     return(CMenu::InsertMenu(nPosition,nFlags,nID,(LPCTSTR)mdata));
00775 }

BOOL CCJMenu::InsertODMenuW | ( | UINT | nPosition,
 |  | wchar_t * | lpstrText,
 |  | UINT | nFlags = MF_OWNERDRAW,
 |  | UINT | nID = 0,
 |  | int | nIconNormal = -1
 | ) |

Definition at line 701 of file CJMenu.cpp.

References AddBitmapToImageList, CCJMenuData::bitmap, InsertMenu, LoadFromToolBar, m_AllSubMenus, m_iconX, m_iconY, m_MenuList, m_SubMenus, CCJMenuData::menuIconNormal, CCJMenuData::nFlags, CCJMenuData::nID, NULL, CCJMenuData::SetWideString, and CCJMenuData::xoffset.

Referenced by InsertMenuW, and InsertODMenuA.

00703 {
00704     // Add the MF_OWNERDRAW flag if not specified:
00705     if(!nID)nFlags=MF_SEPARATOR|MF_OWNERDRAW;
00706     else if(!(nFlags & MF_OWNERDRAW))nFlags |= MF_OWNERDRAW;
00707
00708     if(nFlags & MF_POPUP){
00709         m_AllSubMenus.Add((HMENU)nID);
00710         m_SubMenus.InsertAt(nPosition,(HMENU)nID);
00711     }
00712
00713     CCJMenuData *mdata = new CCJMenuData;
00714     m_MenuList.InsertAt(nPosition,mdata);
00715     mdata->SetWideString(lpstrText);    //SK: modified for dynamic allocation
00716
00717     mdata->menuIconNormal = nIconNormal;
00718     mdata->xoffset=-1;
00719     if(nIconNormal>=0){
00720         mdata->xoffset=0;
00721         LoadFromToolBar(nID,nIconNormal,mdata->xoffset);
00722         if(mdata->bitmap)mdata->bitmap->DeleteImageList();
00723         else mdata->bitmap=new(CImageList);
00724         mdata->bitmap->Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1);
00725         if(!AddBitmapToImageList(mdata->bitmap,nIconNormal)){
00726             mdata->bitmap->DeleteImageList();
00727             delete mdata->bitmap;
00728             mdata->bitmap=NULL;
00729             mdata->menuIconNormal = nIconNormal = -1;
00730             mdata->xoffset = -1;
00731         }
00732     }
00733     mdata->nFlags = nFlags;
00734     mdata->nID = nID;
00735     return(CMenu::InsertMenu(nPosition,nFlags,nID,(LPCTSTR)mdata));
00736 }

void CCJMenu::InsertSpaces ( void )

Definition at line 1177 of file CJMenu.cpp.

References m_MenuList, and VERIFY.

01178 {
01179     int i,j,numitems,maxlength;
01180     CString string,newstring;
01181     CSize t;
01182     CFont m_fontMenu;
01183     LOGFONT m_lf;
01184
01185     ZeroMemory ((PVOID) &m_lf,sizeof (LOGFONT));
01186     NONCLIENTMETRICS nm;
01187     nm.cbSize = sizeof (NONCLIENTMETRICS);
01188     VERIFY (SystemParametersInfo (SPI_GETNONCLIENTMETRICS,nm.cbSize,&nm,0));
01189     m_lf =  nm.lfMenuFont;
01190     m_fontMenu.CreateFontIndirect (&m_lf);
01191
01192     CWnd *pWnd = AfxGetMainWnd();
01193     CDC *pDC = pWnd->GetDC();
01194     CFont* pFont = pDC->SelectObject (&m_fontMenu);
01195
01196     numitems=GetMenuItemCount();
01197     maxlength = -1;
01198     for(i=0;i<numitems;++i){
01199         string=m_MenuList[i]->GetString();
01200         j=string.Find((char)9);
01201         newstring.Empty();
01202         if(j!=-1)newstring=string.Left(j);
01203         else newstring=string;
01204         newstring+=_T(" ");//SK: modified for Unicode correctness.
01205         LPCTSTR lpstrText = (LPCTSTR)newstring;
01206         t=pDC->GetTextExtent(lpstrText,_tcslen(lpstrText));
01207         if(t.cx>maxlength)maxlength = t.cx;
01208     }
01209     for(i=0;i<numitems;++i){
01210         string=m_MenuList[i]->GetString();
01211         j=string.Find((char)9);
01212         if(j!=-1){
01213             newstring.Empty();
01214             newstring=string.Left(j);
01215             LPCTSTR lpstrText = (LPCTSTR)(newstring);
01216             t=pDC->GetTextExtent(lpstrText,_tcslen(lpstrText));
01217             while(t.cx<maxlength){
01218                 newstring+=_T(' ');//SK: modified for Unicode correctness
01219                 LPCTSTR lpstrText = (LPCTSTR)(newstring);
01220                 t=pDC->GetTextExtent(lpstrText,_tcslen(lpstrText));
01221             }
01222             newstring+=string.Mid(j);
01223 #ifdef UNICODE
01224             m_MenuList[i]->SetWideString(newstring);//SK: modified for dynamic allocation
01225 #else
01226             m_MenuList[i]->SetAnsiString(newstring);
01227 #endif
01228         }
01229     }
01230     pDC->SelectObject (pFont);              // Select old font in
01231     AfxGetMainWnd()->ReleaseDC(pDC);       // Release the DC
01232     m_fontMenu.DeleteObject();
01233 }

BOOL CCJMenu::IsMenu ( HMENU submenu ) [static]

Definition at line 188 of file CJMenu.cpp.

References m_AllSubMenus.

00189 {
00190     int m;
00191     int numSubMenus = m_AllSubMenus.GetUpperBound();
00192     for(m=0;m<=numSubMenus;++m){
00193         if(submenu==m_AllSubMenus[m])return(TRUE);
00194     }
00195     return(FALSE);
00196 }

BOOL CCJMenu::IsMenu ( CMenu * submenu ) [static]

Definition at line 178 of file CJMenu.cpp.

References m_AllSubMenus.

Referenced by CCJTabCtrl::OnInitMenuPopup, CCJMDIFrameWnd::OnInitMenuPopup, CCJFrameWnd::OnInitMenuPopup, CCJFlatHeaderCtrl::OnInitMenuPopup, CCJControlBar::OnInitMenuPopup, CCJTabCtrl::OnMeasureItem, CCJMDIFrameWnd::OnMeasureItem, CCJFrameWnd::OnMeasureItem, CCJFlatHeaderCtrl::OnMeasureItem, CCJControlBar::OnMeasureItem, CCJTabCtrl::OnMenuChar, CCJMDIFrameWnd::OnMenuChar, CCJFrameWnd::OnMenuChar, CCJFlatHeaderCtrl::OnMenuChar, and CCJControlBar::OnMenuChar.

00179 {
00180     int m;
00181     int numSubMenus = m_AllSubMenus.GetUpperBound();
00182     for(m=0;m<=numSubMenus;++m){
00183         if(submenu->m_hMenu==m_AllSubMenus[m])return(TRUE);
00184     }
00185     return(FALSE);
00186 }

BOOL CCJMenu::IsNewShell ( void ) [static]

Definition at line 149 of file CJMenu.cpp.

References g_Shell, Windoze95, and WinNT4orHigher.

Referenced by DitherBlt, DitherBlt2, Draw3DCheckmark, DrawItem, and MeasureItem.

00150 {
00151     return (Windoze95==g_Shell || WinNT4orHigher==g_Shell);
00152 }

void CCJMenu::LoadCheckmarkBitmap | ( | int | unselect,
 |  | int | select
 | ) |

Definition at line 1235 of file CJMenu.cpp.

References AddBitmapToImageList, checkmaps, m_iconX, m_iconY, m_selectcheck, m_unselectcheck, and NULL.

01236 {
01237     if(unselect>0 && select>0){
01238         m_selectcheck=select;
01239         m_unselectcheck=unselect;
01240         if(checkmaps)checkmaps->DeleteImageList();
01241         else checkmaps=new(CImageList);
01242         checkmaps->Create(m_iconX,m_iconY,ILC_MASK,2,1);
01243         BOOL flag1=AddBitmapToImageList(checkmaps,unselect);
01244         BOOL flag2=AddBitmapToImageList(checkmaps,select);
01245         if(!flag1||!flag2){
01246             checkmaps->DeleteImageList();
01247             delete checkmaps;
01248             checkmaps=NULL;
01249         }
01250     }
01251 }

BOOL CCJMenu::LoadFromToolBar | ( | UINT | nID,
 |  | UINT | nToolBar,
 |  | int & | xoffset
 | ) |

Definition at line 980 of file CJMenu.cpp.

References FALSE, and TRUE.

Referenced by AppendODMenuW, InsertODMenuW, and ModifyODMenuW.

00981 {
00982     int xset,offset;
00983     UINT nStyle;
00984     BOOL returnflag=FALSE;
00985     CToolBar bar;
00986
00987     bar.Create(AfxGetMainWnd());
00988     if(bar.LoadToolBar(nToolBar)){
00989         offset=bar.CommandToIndex(nID);
00990         if(offset>=0){
00991             bar.GetButtonInfo(offset,nID,nStyle,xset);
00992             if(xset>0)xoffset=xset;
00993             returnflag=TRUE;
00994         }
00995     }
00996     return(returnflag);
00997 }

BOOL CCJMenu::LoadMenu ( int nResource ) [virtual]

Definition at line 1052 of file CJMenu.cpp.

References LoadMenu.

01053 {
01054     return(CCJMenu::LoadMenu(MAKEINTRESOURCE(nResource)));
01055 };

BOOL CCJMenu::LoadMenu ( LPCTSTR lpszResourceName ) [virtual]

Definition at line 1057 of file CJMenu.cpp.

References ASSERT, checkmaps, checkmapsshare, FALSE, m_MenuList, m_selectcheck, m_unselectcheck, NULL, and TRUE.

Referenced by LoadMenu, CCJMDIFrameWnd::NewMenu, CCJFrameWnd::NewMenu, CCJToolBar::OnDropDownButton, CGfxOutBarCtrl::OnRButtonDown, CCJTabCtrl::OnRButtonDown, CCJFlatHeaderCtrl::OnRButtonDown, CCJControlBar::OnRButtonDown, and CCJMenuBar::TrackPopup.

01058 {
01059     TRACE(_T(
01060         "IMPORTANT:Use CCJMenu::DestroyMenu to destroy Loaded Menu's\n"));
01061     ASSERT_VALID(this);
01062     ASSERT(lpszResourceName != NULL);
01063
01064     // Find the Menu Resource:
01065     HINSTANCE m_hInst = AfxFindResourceHandle(lpszResourceName,RT_MENU);
01066     HRSRC hRsrc = ::FindResource(m_hInst,lpszResourceName,RT_MENU);
01067     if(hRsrc == NULL)return FALSE;
01068
01069     // Get size of resource:
01070
01071     DWORD dwSize = SizeofResource(NULL, hRsrc);
01072
01073     // Load the Menu Resource:
01074
01075     HGLOBAL hGlobal = LoadResource(m_hInst, hRsrc);
01076     if(hGlobal == NULL)return FALSE;
01077
01078     // Attempt to create us as a menu...
01079
01080     if(!CMenu::CreateMenu())return FALSE;
01081
01082     // Get Item template Header, and calculate offset of MENUITEMTEMPLATES
01083
01084     MENUITEMTEMPLATEHEADER *pTpHdr=
01085         (MENUITEMTEMPLATEHEADER*)LockResource(hGlobal);
01086     BYTE* pTp=(BYTE*)pTpHdr +
01087         (sizeof(MENUITEMTEMPLATEHEADER) + pTpHdr->offset);
01088
01089
01090     // Variables needed during processing of Menu Item Templates:
01091
01092     int j=0;
01093     CCJMenuData*  pData = NULL;              // New OD Menu Item Data
01094     WORD    dwFlags = 0;              // Flags of the Menu Item
01095     WORD    dwID  = 0;              // ID of the Menu Item
01096     UINT    uFlags;                  // Actual Flags.
01097     wchar_t *szCaption=NULL;
01098     int      nLen   = 0;                // Length of caption
01099     CTypedPtrArray<CPtrArray, CCJMenu*>  m_Stack;    // Popup menu stack
01100     CArray<BOOL,BOOL>  m_StackEnd;    // Popup menu stack
01101     m_Stack.Add(this);                  // Add it to this...
01102     m_StackEnd.Add(FALSE);
01103
01104     do{
01105         // Obtain Flags and (if necessary), the ID...
01106         memcpy(&dwFlags, pTp, sizeof(WORD));pTp+=sizeof(WORD);// Obtain Flags
01107         if(!(dwFlags & MF_POPUP)){
01108             memcpy(&dwID, pTp, sizeof(WORD)); // Obtain ID
01109             pTp+=sizeof(WORD);
01110         }
01111         else dwID = 0;
01112
01113         uFlags = (UINT)dwFlags; // Remove MF_END from the flags that will
01114         if(uFlags & MF_END) // be passed to the Append(OD)Menu functions.
01115             uFlags -= MF_END;
01116
01117         // Obtain Caption (and length)
01118
01119         nLen = 0;
01120         char *ch = (char*)pTp;
01121         szCaption=new wchar_t[wcslen((wchar_t *)pTp)+1];
01122         wcscpy(szCaption,(wchar_t *)pTp);
01123         pTp=&pTp[(wcslen((wchar_t *)pTp)+1)*sizeof(wchar_t)];//modified SK
01124
01125         // Handle popup menus first....
01126
01127         //WideCharToMultiByte
01128         if(dwFlags & MF_POPUP){
01129             if(dwFlags & MF_END)m_StackEnd.SetAt(m_Stack.GetUpperBound(),TRUE);
01130             CCJMenu* pSubMenu = new CCJMenu;
01131             pSubMenu->m_unselectcheck=m_unselectcheck;
01132             pSubMenu->m_selectcheck=m_selectcheck;
01133             pSubMenu->checkmaps=checkmaps;
01134             pSubMenu->checkmapsshare=TRUE;
01135             pSubMenu->CreatePopupMenu();
01136
01137             // Append it to the top of the stack:
01138
01139             m_Stack[m_Stack.GetUpperBound()]->AppendODMenuW(szCaption,uFlags,
01140                 (UINT)pSubMenu->m_hMenu, -1);
01141             m_Stack.Add(pSubMenu);
01142             m_StackEnd.Add(FALSE);
01143         }
01144         else {
01145             m_Stack[m_Stack.GetUpperBound()]->AppendODMenuW(szCaption, uFlags,
01146                 dwID, -1);
01147             if(dwFlags & MF_END)m_StackEnd.SetAt(m_Stack.GetUpperBound(),TRUE);
01148             j = m_Stack.GetUpperBound();
01149             while(j>=0 && m_StackEnd.GetAt(j)){
01150                 m_Stack[m_Stack.GetUpperBound()]->InsertSpaces();
01151                 m_Stack.RemoveAt(j);
01152                 m_StackEnd.RemoveAt(j);
01153                 --j;
01154             }
01155         }
01156
01157         delete[] szCaption;
01158     }while(m_Stack.GetUpperBound() != -1);
01159
01160     for(int i=0;i<(int)GetMenuItemCount();++i){
01161         CString str=m_MenuList[i]->GetString();
01162
01163         if(GetSubMenu(i)){
01164             m_MenuList[i]->nFlags=MF_POPUP|MF_BYPOSITION;
01165             ModifyMenu(i,MF_POPUP|MF_BYPOSITION,
01166                 (UINT)GetSubMenu(i)->m_hMenu,str);
01167         }
01168         else{
01169             m_MenuList[i]->nFlags=MF_STRING|MF_BYPOSITION;
01170             ModifyMenu(i,MF_STRING|MF_BYPOSITION,m_MenuList[i]->nID,str);
01171         }
01172     }
01173
01174     return(TRUE);
01175 }

HBITMAP CCJMenu::LoadSysColorBitmap ( int nResourceId ) [static]

Definition at line 1682 of file CJMenu.cpp.

References FALSE, and NULL.

Referenced by AddBitmapToImageList.

01683 {
01684     HINSTANCE hInst =
01685         AfxFindResourceHandle(MAKEINTRESOURCE(nResourceId),RT_BITMAP);
01686     HRSRC hRsrc =
01687         ::FindResource(hInst,MAKEINTRESOURCE(nResourceId),RT_BITMAP);
01688     if (hRsrc == NULL)
01689         return NULL;
01690     return AfxLoadSysColorBitmap(hInst, hRsrc, FALSE);
01691 }

BOOL CCJMenu::LoadToolbar ( UINT nToolBar )

Definition at line 960 of file CJMenu.cpp.

References FALSE, ModifyODMenu, NULL, and TRUE.

Referenced by LoadToolbars, CCJMDIFrameWnd::NewMenu, CCJFrameWnd::NewMenu, CGfxOutBarCtrl::OnRButtonDown, CCJTabCtrl::OnRButtonDown, CCJFlatHeaderCtrl::OnRButtonDown, CCJControlBar::OnRButtonDown, and CCJMenuBar::TrackPopup.

00961 {
00962     UINT nID;
00963     BOOL returnflag=FALSE;
00964     CToolBar bar;
00965
00966     bar.Create(AfxGetMainWnd());
00967     if(bar.LoadToolBar(nToolBar)){
00968         for(int i=0;i<bar.GetCount();++i){
00969             nID = bar.GetItemID(i);
00970             if(nID && GetMenuState(nID, MF_BYCOMMAND)
00971                 !=0xFFFFFFFF){
00972                 ModifyODMenu(NULL,nID,nToolBar);
00973             }
00974         }
00975         returnflag=TRUE;
00976     }
00977     return(returnflag);
00978 }

BOOL CCJMenu::LoadToolbars | ( | const UINT * | arID,
 |  | int | n
 | ) |

Definition at line 950 of file CJMenu.cpp.

References ASSERT, FALSE, LoadToolbar, and TRUE.

Referenced by CCJMDIFrameWnd::NewMenu, and CCJFrameWnd::NewMenu.

00951 {
00952     ASSERT(arID);
00953     BOOL returnflag=TRUE;
00954     for(int i=0;i<n;++i){
00955         if(!LoadToolbar(arID[i]))returnflag=FALSE;
00956     }
00957     return(returnflag);
00958 }

void CCJMenu::MeasureItem ( LPMEASUREITEMSTRUCT ) [virtual]

Definition at line 541 of file CJMenu.cpp.

References g_Shell, GAP, IsNewShell, m_iconX, m_iconY, NULL, VERIFY, and Win32s.

Referenced by CCJTabCtrl::OnMeasureItem, CCJMDIFrameWnd::OnMeasureItem, CCJFrameWnd::OnMeasureItem, CCJFlatHeaderCtrl::OnMeasureItem, and CCJControlBar::OnMeasureItem.

00542 {
00543     UINT state = (((CCJMenuData*)(lpMIS->itemData))->nFlags);
00544     if(state & MF_SEPARATOR){
00545         lpMIS->itemWidth = 0;
00546         lpMIS->itemHeight = GetSystemMetrics(SM_CYMENU)>>1;
00547     }
00548     else{
00549         CFont m_fontMenu;
00550         LOGFONT m_lf;
00551         ZeroMemory ((PVOID) &m_lf,sizeof (LOGFONT));
00552         NONCLIENTMETRICS nm;
00553         nm.cbSize = sizeof (NONCLIENTMETRICS);
00554         VERIFY(SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
00555             nm.cbSize,&nm,0));
00556         m_lf =  nm.lfMenuFont;
00557         m_fontMenu.CreateFontIndirect (&m_lf);
00558
00559         // Obtain the width of the text:
00560         CWnd *pWnd = AfxGetMainWnd();            // Get main window
00561         CDC *pDC = pWnd->GetDC();              // Get device context
00562         CFont* pFont=NULL;    // Select menu font in...
00563
00564         if (IsNewShell())
00565             pFont = pDC->SelectObject (&m_fontMenu);// Select menu font in...
00566
00567         //Get pointer to text SK
00568         const wchar_t *lpstrText = ((CCJMenuData*)(lpMIS->itemData))->GetWideString();//SK: we use const to prevent misuse
00569
00570
00571         SIZE size;
00572
00573         if (Win32s!=g_Shell)
00574             VERIFY(::GetTextExtentPoint32W(pDC->m_hDC,lpstrText,
00575             wcslen(lpstrText),&size)); //SK should also work on 95
00576 #ifndef UNICODE //can't be UNICODE for Win32s
00577         else{//it's Win32suckx
00578             RECT rect;
00579             rect.left=rect.top=0;
00580             size.cy=DrawText(pDC->m_hDC,(LPCTSTR)lpstrText,
00581                 wcslen(lpstrText),&rect,
00582                 DT_SINGLELINE|DT_LEFT|DT_VCENTER|DT_CALCRECT);
00583             //+3 makes at least three pixels space to the menu border
00584             size.cx=rect.right-rect.left+3;
00585             size.cx += 3*(size.cx/wcslen(lpstrText));
00586         }
00587 #endif
00588
00589         CSize t = CSize(size);
00590         if(IsNewShell())
00591             pDC->SelectObject (pFont);  // Select old font in
00592         AfxGetMainWnd()->ReleaseDC(pDC);  // Release the DC
00593
00594         // Set width and height:
00595
00596         lpMIS->itemWidth = m_iconX + t.cx + m_iconX + GAP;
00597         int temp = GetSystemMetrics(SM_CYMENU);
00598         lpMIS->itemHeight = temp>m_iconY+4 ? temp : m_iconY+4;
00599         m_fontMenu.DeleteObject();
00600     }
00601 }

BOOL CCJMenu::ModifyODMenuA | ( | const char * | lpstrText,
 |  | const char * | OptionText,
 |  | int | nIconNormal
 | ) |

Definition at line 879 of file CJMenu.cpp.

References ModifyODMenuW.

00881 {
00882     USES_CONVERSION;
00883     return ModifyODMenuW(A2W(lpstrText),A2W(OptionText),nIconNormal);//SK: see MFC  Tech Note 059
00884 }

BOOL CCJMenu::ModifyODMenuA | ( | const char * | lpstrText,
 |  | UINT | nID,
 |  | CBitmap * | bmp
 | ) |

Definition at line 860 of file CJMenu.cpp.

References ModifyODMenuW.

00861 {
00862     USES_CONVERSION;
00863     return ModifyODMenuW(A2W(lpstrText),nID,bmp);
00864 }

BOOL CCJMenu::ModifyODMenuA | ( | const char * | lpstrText,
 |  | UINT | nID,
 |  | CImageList * | il,
 |  | int | xoffset
 | ) |

Definition at line 821 of file CJMenu.cpp.

References ModifyODMenuW.

00822 {
00823     USES_CONVERSION;
00824     return ModifyODMenuW(A2W(lpstrText),nID,il,xoffset);
00825 }

BOOL CCJMenu::ModifyODMenuA | ( | const char * | lpstrText,
 |  | UINT | nID = 0,
 |  | int | nIconNormal = -1
 | ) |

Definition at line 777 of file CJMenu.cpp.

References ModifyODMenuW.

00778 {
00779     USES_CONVERSION;
00780     return ModifyODMenuW(A2W(lpstrText),nID,nIconNormal);//SK: see MFC Tech Note 059
00781 }

BOOL CCJMenu::ModifyODMenuW | ( | wchar_t * | lpstrText,
 |  | wchar_t * | OptionText,
 |  | int | nIconNormal
 | ) |

Definition at line 886 of file CJMenu.cpp.

References AddBitmapToImageList, CCJMenuData::bitmap, FindMenuOption, m_iconX, m_iconY, CCJMenuData::menuIconNormal, NULL, CCJMenuData::SetWideString, and CCJMenuData::xoffset.

00888 {
00889     CCJMenuData *mdata;
00890
00891     // Find the old CCJMenuData structure:
00892     CString junk=OptionText;
00893     mdata=FindMenuOption(OptionText);
00894     if(mdata){
00895         if(lpstrText)
00896             mdata->SetWideString(lpstrText);//SK: modified for dynamic allocation
00897         mdata->menuIconNormal = nIconNormal;
00898         mdata->xoffset=-1;
00899         if(nIconNormal>=0){
00900             mdata->xoffset=0;
00901             if(mdata->bitmap)mdata->bitmap->DeleteImageList();
00902             else mdata->bitmap=new(CImageList);
00903             mdata->bitmap->Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1);
00904             if(!AddBitmapToImageList(mdata->bitmap,nIconNormal)){
00905                 mdata->bitmap->DeleteImageList();
00906                 delete mdata->bitmap;
00907                 mdata->bitmap=NULL;
00908                 mdata->menuIconNormal = nIconNormal = -1;
00909                 mdata->xoffset = -1;
00910             }
00911         }
00912         return(TRUE);
00913     }
00914     return(FALSE);
00915 }

BOOL CCJMenu::ModifyODMenuW | ( | wchar_t * | lpstrText,
 |  | UINT | nID,
 |  | CBitmap * | bmp
 | ) |

Definition at line 866 of file CJMenu.cpp.

References m_bitmapBackground, m_iconX, m_iconY, ModifyODMenuW, and NULL.

00867 {
00868     if(bmp){
00869         CImageList temp;
00870         temp.Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1);
00871         if(m_bitmapBackgroundFlag)temp.Add(bmp,m_bitmapBackground);
00872         else temp.Add(bmp,GetSysColor(COLOR_3DFACE));
00873         return ModifyODMenuW(lpstrText,nID,&temp,0);
00874     }
00875     return ModifyODMenuW(lpstrText,nID,NULL,0);
00876 }

BOOL CCJMenu::ModifyODMenuW | ( | wchar_t * | lpstrText,
 |  | UINT | nID,
 |  | CImageList * | il,
 |  | int | xoffset
 | ) |

Definition at line 827 of file CJMenu.cpp.

References ASSERT, CCJMenuData::bitmap, FindMenuOption, m_MenuList, CCJMenuData::menuIconNormal, CCJMenuData::nFlags, CCJMenuData::nID, CCJMenuData::SetWideString, and CCJMenuData::xoffset.

00828 {
00829     int nLoc;
00830     CCJMenuData *mdata;
00831
00832     // Find the old CCJMenuData structure:
00833     CCJMenu *psubmenu = FindMenuOption(nID,nLoc);
00834     if(psubmenu && nLoc>=0)mdata = psubmenu->m_MenuList[nLoc];
00835     else{
00836         // Create a new CCJMenuData structure:
00837         mdata = new CCJMenuData;
00838         m_MenuList.Add(mdata);
00839     }
00840
00841     ASSERT(mdata);
00842     if(lpstrText)
00843         mdata->SetWideString(lpstrText);  //SK: modified for dynamic allocation
00844     if(il){
00845         mdata->menuIconNormal = 0;
00846         mdata->xoffset=xoffset;
00847         if(mdata->bitmap)mdata->bitmap->Detach();
00848         else mdata->bitmap=new(CImageList);
00849         mdata->bitmap->Attach(ImageList_Duplicate(il->m_hImageList));
00850     }
00851     else{
00852         mdata->menuIconNormal = -1;
00853         mdata->xoffset = -1;
00854     }
00855     mdata->nFlags = MF_BYCOMMAND | MF_OWNERDRAW;
00856     mdata->nID = nID;
00857     return (CMenu::ModifyMenu(nID,mdata->nFlags,nID,(LPCTSTR)mdata));
00858 }

BOOL CCJMenu::ModifyODMenuW | ( | wchar_t * | lpstrText,
 |  | UINT | nID = 0,
 |  | int | nIconNormal = -1
 | ) |

Definition at line 783 of file CJMenu.cpp.

References AddBitmapToImageList, ASSERT, CCJMenuData::bitmap, FindMenuOption, LoadFromToolBar, m_iconX, m_iconY, m_MenuList, CCJMenuData::menuIconNormal, CCJMenuData::nFlags, CCJMenuData::nID, NULL, CCJMenuData::SetWideString, and CCJMenuData::xoffset.

Referenced by ModifyODMenuA, and ModifyODMenuW.

00784 {
00785     int nLoc;
00786     CCJMenuData *mdata;
00787
00788     // Find the old CCJMenuData structure:
00789     CCJMenu *psubmenu = FindMenuOption(nID,nLoc);
00790     if(psubmenu && nLoc>=0)mdata = psubmenu->m_MenuList[nLoc];
00791     else{
00792         // Create a new CCJMenuData structure:
00793         mdata = new CCJMenuData;
00794         m_MenuList.Add(mdata);
00795     }
00796
00797     ASSERT(mdata);
00798     if(lpstrText)
00799         mdata->SetWideString(lpstrText);  //SK: modified for dynamic allocation
00800     mdata->menuIconNormal = nIconNormal;
00801     mdata->xoffset=-1;
00802     if(nIconNormal>=0){
00803         mdata->xoffset=0;
00804         LoadFromToolBar(nID,nIconNormal,mdata->xoffset);
00805         if(mdata->bitmap)mdata->bitmap->DeleteImageList();
00806         else mdata->bitmap=new CImageList;
00807         mdata->bitmap->Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1);
00808         if(!AddBitmapToImageList(mdata->bitmap,nIconNormal)){
00809             mdata->bitmap->DeleteImageList();
00810             delete mdata->bitmap;
00811             mdata->bitmap=NULL;
00812             mdata->menuIconNormal = nIconNormal = -1;
00813             mdata->xoffset = -1;
00814         }
00815     }
00816     mdata->nFlags = MF_BYCOMMAND | MF_OWNERDRAW;
00817     mdata->nID = nID;
00818     return (CMenu::ModifyMenu(nID,mdata->nFlags,nID,(LPCTSTR)mdata));
00819 }

CCJMenuData * CCJMenu::NewODMenu | ( | UINT | pos,
 |  | UINT | nFlags,
 |  | UINT | nID,
 |  | CString | string
 | ) |

Definition at line 917 of file CJMenu.cpp.

References ASSERT, CCJMenuData::GetString, m_AllSubMenus, CCJMenuData::menuIconNormal, CCJMenuData::nFlags, CCJMenuData::nID, CCJMenuData::SetAnsiString, CCJMenuData::SetWideString, and CCJMenuData::xoffset.

Referenced by SynchronizeMenu.

00918 {
00919     CCJMenuData *mdata;
00920
00921     mdata = new CCJMenuData;
00922     mdata->menuIconNormal = -1;
00923     mdata->xoffset=-1;
00924 #ifdef UNICODE
00925     mdata->SetWideString((LPCTSTR)string);//SK: modified for dynamic allocation
00926 #else
00927     mdata->SetAnsiString(string);
00928 #endif
00929     mdata->nFlags = nFlags;
00930     mdata->nID = nID;
00931
00932     if(nFlags & MF_POPUP)m_AllSubMenus.Add((HMENU)nID);
00933
00934     if (nFlags&MF_OWNERDRAW){
00935         ASSERT(!(nFlags&MF_STRING));
00936         ModifyMenu(pos,nFlags,nID,(LPCTSTR)mdata);
00937     }
00938     else if (nFlags&MF_STRING){
00939         ASSERT(!(nFlags&MF_OWNERDRAW));
00940         ModifyMenu(pos,nFlags,nID,mdata->GetString());
00941     }
00942     else{
00943         ASSERT(nFlags&MF_SEPARATOR);
00944         ModifyMenu(pos,nFlags,nID);
00945     }
00946
00947     return(mdata);
00948 };

BOOL CCJMenu::RemoveMenu | ( | UINT | uiId,
 |  | UINT | nFlags
 | ) |

Definition at line 1693 of file CJMenu.cpp.

References FindMenuOption, m_AllSubMenus, m_MenuList, m_SubMenus, and NULL.

01694 {
01695     if(MF_BYPOSITION&nFlags){
01696         CCJMenu* pSubMenu = (CCJMenu*) GetSubMenu(uiId);
01697         if(NULL==pSubMenu){
01698             UINT uiCommandId = GetMenuItemID(uiId);
01699             for(int i=0;i<m_MenuList.GetSize(); i++){
01700                 if(m_MenuList[i]->nID==uiCommandId){
01701                     delete m_MenuList.GetAt(i);
01702                     m_MenuList.RemoveAt(i);
01703                     break;
01704                 }
01705             }
01706         }
01707         else{
01708             int numSubMenus = m_SubMenus.GetUpperBound();
01709             for(int m = numSubMenus; m >= 0; m--){
01710                 if(m_SubMenus[m]==pSubMenu->m_hMenu){
01711                     int numAllSubMenus = m_AllSubMenus.GetUpperBound();
01712                     for(int n = numAllSubMenus; n>= 0; n--){
01713                         if(m_AllSubMenus[n]==m_SubMenus[m])m_AllSubMenus.RemoveAt(n);
01714                     }
01715                     m_SubMenus.RemoveAt(m);
01716                 }
01717             }
01718             int num = pSubMenu->GetMenuItemCount();
01719             for(int i=num-1;i>=0;--i)pSubMenu->RemoveMenu(i,MF_BYPOSITION);
01720             for(i=m_MenuList.GetUpperBound();i>=0;i--){
01721                 if(m_MenuList[i]->nID==(UINT)pSubMenu->m_hMenu){
01722                     delete m_MenuList.GetAt(i);
01723                     m_MenuList.RemoveAt(i);
01724                     break;
01725                 }
01726             }
01727             delete pSubMenu;
01728         }
01729     }
01730     else{
01731         int iPosition =0;
01732         CCJMenu* pMenu = FindMenuOption(uiId,iPosition);
01733         if(pMenu)pMenu->RemoveMenu(iPosition,MF_BYPOSITION);
01734     }
01735     return CMenu::RemoveMenu(uiId,nFlags);
01736 }

void CCJMenu::SetBitmapBackground ( COLORREF color )

Definition at line 1541 of file CJMenu.cpp.

References m_bitmapBackground, m_bitmapBackgroundFlag, and TRUE.

01542 {
01543     m_bitmapBackground=color;
01544     m_bitmapBackgroundFlag=TRUE;
01545 }

void CCJMenu::SetDisableOldStyle ( void )

Definition at line 1666 of file CJMenu.cpp.

References disable_old_style, and TRUE.

01667 {
01668     disable_old_style=TRUE;
01669 }

void CCJMenu::SetIconSize | ( | int | ,
 |  | int |
 | ) |

Definition at line 603 of file CJMenu.cpp.

References m_iconX, and m_iconY.

00604 {
00605     m_iconX = width;
00606     m_iconY = height;
00607 }

void CCJMenu::SynchronizeMenu ( void )

Definition at line 1348 of file CJMenu.cpp.

References DeleteMenuList, FindMenuList, InitializeMenuList, m_MenuList, NewODMenu, CCJMenuData::nFlags, NULL, CCJMenuData::SetAnsiString, and CCJMenuData::SetWideString.

Referenced by FindKeyboardShortcut, and UpdateMenu.

01349 {
01350     CTypedPtrArray<CPtrArray, CCJMenuData*> temp;
01351     CCJMenuData *mdata;
01352     CString string;
01353     UINT submenu,nID=0,state,j;
01354
01355     InitializeMenuList(0);
01356     for(j=0;j<GetMenuItemCount();++j){
01357         mdata=NULL;
01358         state=GetMenuState(j,MF_BYPOSITION);
01359         if(state&MF_POPUP){
01360             submenu=(UINT)GetSubMenu(j)->m_hMenu;
01361             mdata=FindMenuList(submenu);
01362             GetMenuString(j,string,MF_BYPOSITION);
01363             if(!mdata)mdata=NewODMenu(j,
01364                 (state&0xFF)|MF_BYPOSITION|MF_POPUP|MF_OWNERDRAW,submenu,string);
01365             else if(string.GetLength()>0)
01366 #ifdef UNICODE
01367                 mdata->SetWideString(string);  //SK: modified for dynamic allocation
01368 #else
01369             mdata->SetAnsiString(string);
01370 #endif
01371         }
01372         else if(state&MF_SEPARATOR){
01373             mdata=FindMenuList(0);
01374             if(!mdata)mdata=NewODMenu(j,
01375                 state|MF_BYPOSITION|MF_SEPARATOR|MF_OWNERDRAW,0,_T(""));//SK: modified for Unicode correctness
01376             else ModifyMenu(j,mdata->nFlags,nID,(LPCTSTR)mdata);
01377         }
01378         else{
01379             nID=GetMenuItemID(j);
01380             mdata=FindMenuList(nID);
01381             GetMenuString(j,string,MF_BYPOSITION);
01382             if(!mdata)mdata=NewODMenu(j,state|MF_BYPOSITION|MF_OWNERDRAW,
01383                 nID,string);
01384             else{
01385                 mdata->nFlags=state|MF_BYPOSITION|MF_OWNERDRAW;
01386                 if(string.GetLength()>0)
01387 #ifdef UNICODE
01388                     mdata->SetWideString(string);//SK: modified for dynamic allocation
01389 #else
01390                 mdata->SetAnsiString(string);
01391 #endif
01392
01393                 ModifyMenu(j,mdata->nFlags,nID,(LPCTSTR)mdata);
01394             }
01395         }
01396         if(mdata)temp.Add(mdata);
01397     }
01398     DeleteMenuList();
01399     m_MenuList.RemoveAll();
01400     m_MenuList.Append(temp);
01401     temp.RemoveAll();
01402 }

void CCJMenu::UnSetBitmapBackground ( void )

Definition at line 1547 of file CJMenu.cpp.

References FALSE, and m_bitmapBackgroundFlag.

01548 {
01549     m_bitmapBackgroundFlag=FALSE;
01550 }

void CCJMenu::UnSetDisableOldStyle ( void )

Definition at line 1671 of file CJMenu.cpp.

References disable_old_style, and FALSE.

01672 {
01673     disable_old_style=FALSE;
01674 }

void CCJMenu::UpdateMenu ( CMenu * pmenu ) [static]

Definition at line 1404 of file CJMenu.cpp.

References SynchronizeMenu.

Referenced by CCJTabCtrl::OnInitMenuPopup, CCJMDIFrameWnd::OnInitMenuPopup, CCJFrameWnd::OnInitMenuPopup, CCJFlatHeaderCtrl::OnInitMenuPopup, and CCJControlBar::OnInitMenuPopup.

01405 {
01406 #ifdef _CPPRTTI
01407     CCJMenu *psubmenu = dynamic_cast<CCJMenu *>(pmenu);
01408 #else
01409     CCJMenu *psubmenu = (CCJMenu *)pmenu;
01410 #endif
01411     if(psubmenu)psubmenu->SynchronizeMenu();
01412 }

Member Data Documentation

CImageList* CCJMenu::checkmaps

Definition at line 140 of file CJMenu.h.

Referenced by AppendODPopupMenuW, CCJMenu, DestroyMenu, DrawItem, LoadCheckmarkBitmap, and LoadMenu.

BOOL CCJMenu::checkmapsshare

Definition at line 141 of file CJMenu.h.

Referenced by AppendODPopupMenuW, CCJMenu, DestroyMenu, and LoadMenu.

BOOL CCJMenu::disable_old_style [protected]

Definition at line 263 of file CJMenu.h.

Referenced by CCJMenu, SetDisableOldStyle, and UnSetDisableOldStyle.

CTypedPtrArray< CPtrArray, HMENU > CCJMenu::m_AllSubMenus [static, protected]

Definition at line 118 of file CJMenu.cpp.

Referenced by AppendODMenuW, DeleteMenu, DestroyMenu, InsertODMenuW, IsMenu, NewODMenu, and RemoveMenu.

COLORREF CCJMenu::m_bitmapBackground [protected]

Definition at line 261 of file CJMenu.h.

Referenced by AddBitmapToImageList, AppendMenuW, CCJMenu, InsertMenuW, ModifyODMenuW, and SetBitmapBackground.

BOOL CCJMenu::m_bitmapBackgroundFlag [protected]

Definition at line 262 of file CJMenu.h.

Referenced by CCJMenu, SetBitmapBackground, and UnSetBitmapBackground.

int CCJMenu::m_iconX [protected]

Definition at line 260 of file CJMenu.h.

Referenced by AddFromToolBar, AppendMenuW, AppendODMenuW, CCJMenu, DrawItem, GetBitmapFromImageList, InsertMenuW, InsertODMenuW, LoadCheckmarkBitmap, MeasureItem, ModifyODMenuW, and SetIconSize.

int CCJMenu::m_iconY [protected]

Definition at line 260 of file CJMenu.h.

Referenced by AddFromToolBar, AppendMenuW, AppendODMenuW, CCJMenu, DrawItem, GetBitmapFromImageList, InsertMenuW, InsertODMenuW, LoadCheckmarkBitmap, MeasureItem, ModifyODMenuW, and SetIconSize.

CTypedPtrArray<CPtrArray, CCJMenuData*> CCJMenu::m_MenuList [protected]

Definition at line 104 of file CJMenu.h.

Referenced by AddFromToolBar, AppendODMenuW, DeleteMenu, DeleteMenuList, DestroyMenu, FindKeyboardShortcut, FindMenuList, FindMenuOption, GetMenuText, InitializeMenuList, InsertODMenuW, InsertSpaces, LoadMenu, ModifyODMenuW, RemoveMenu, and SynchronizeMenu.

int CCJMenu::m_selectcheck

Definition at line 142 of file CJMenu.h.

Referenced by AppendODPopupMenuW, CCJMenu, DrawItem, LoadCheckmarkBitmap, and LoadMenu.

CTypedPtrArray<CPtrArray, HMENU> CCJMenu::m_SubMenus [protected]

Definition at line 109 of file CJMenu.h.

Referenced by AppendODMenuW, DeleteMenu, DestroyMenu, InsertODMenuW, and RemoveMenu.

int CCJMenu::m_unselectcheck

Definition at line 143 of file CJMenu.h.

Referenced by AppendODPopupMenuW, CCJMenu, DrawItem, LoadCheckmarkBitmap, and LoadMenu.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJMenu.h
  • WinCvs/CJLib/CJLibrary/CJMenu.cpp
Generated on Sun Feb 24 01:24:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJMenuBar Class Reference

#include <CJMenuBar.h>

Inheritance diagram for CCJMenuBar:

[legend]
Collaboration diagram for CCJMenuBar:

[legend]
List of all members.

Public Methods

CCJMenuBar ()
virtual | ~CCJMenuBar ()
virtual BOOL | Create (CWnd *pParentWnd, DWORD dwStyle=WS_CHILD|WS_VISIBLE|CBRS_TOP, UINT nID=AFX_IDW_TOOLBAR)
virtual BOOL | CreateEx (CWnd *pParentWnd, DWORD dwCtrlStyle=TBSTYLE_FLAT, DWORD dwStyle=WS_CHILD|WS_VISIBLE|CBRS_ALIGN_TOP, CRect rcBorders=CRect(0, 0, 0, 0), UINT nID=AFX_IDW_TOOLBAR)
BOOL | LoadMenu (UINT nID)
CCJMenu * GetMenu ()
TRACKINGSTATE | GetTrackingState (int &iPopup)
virtual BOOL | TranslateFrameMessage (MSG *pMsg)

Public Attributes

BOOL | m_bAutoRemoveFrameMenu

Static Public Attributes

BOOL | bTRACE

Protected Methods

void | RecomputeToolbarSize ()
void | RecomputeMenuLayout ()
void | UpdateFont ()
int | GetNextOrPrevButton (int iButton, BOOL bPrev)
void | SetTrackingState (TRACKINGSTATE iState, int iButton=-1)
void | TrackPopup (int iButton)
void | ToggleTrackButtonMode ()
void | CancelMenuAndTrackNewOne (int iButton)
void | OnMenuSelect (HMENU hmenu, UINT nItemID)
CPoint | ComputeMenuTrackPoint (const CRect &rcButn, TPMPARAMS &tpm)
BOOL | IsValidButton (int iButton) const
int | HitTest (CPoint p) const
virtual BOOL | OnMenuInput (MSG &m)
virtual void | OnBarStyleChange (DWORD dwOldStyle, DWORD dwNewStyle)
virtual CSize | CalcFixedLayout (BOOL bStretch, BOOL bHorz)
afx_msg void | OnLButtonDown (UINT nFlags, CPoint point)
afx_msg void | OnMouseMove (UINT nFlags, CPoint point)
afx_msg void | OnSize (UINT nType, int cx, int cy)
afx_msg void | OnUpdateMenuButton (CCmdUI *pCmdUI)

Static Protected Methods

LRESULT CALLBACK | MenuInputFilter (int code, WPARAM wp, LPARAM lp)

Protected Attributes

CCJMenuBarFrameHook m_frameHook
CStringArray | m_arStrings
int | m_nMenuID
CCJMenu m_popupMenu
int | m_iPopupTracking
int | m_iNewPopup
BOOL | m_bProcessRightArrow
BOOL | m_bProcessLeftArrow
BOOL | m_bEscapeWasPressed
CPoint | m_ptMouse
HMENU | m_hMenuTracking
CFont | m_Font
TRACKINGSTATE m_iTrackingState

Friends

class | CCJMenuBarFrameHook

Constructor & Destructor Documentation

CCJMenuBar::CCJMenuBar ( )

Definition at line 86 of file CJMenuBar.cpp.

References m_bAutoRemoveFrameMenu, m_iNewPopup, m_iPopupTracking, m_iTrackingState, TRACK_NONE, and TRUE.

00087 {
00088     m_iTrackingState        = TRACK_NONE;   // initial state: not tracking
00089     m_iPopupTracking        = -1;
00090     m_iNewPopup             = -1;           // invalid
00091     m_bAutoRemoveFrameMenu  = TRUE;         // set frame's menu to NULL
00092 }

CCJMenuBar::~CCJMenuBar ( ) [virtual]

Definition at line 94 of file CJMenuBar.cpp.

References m_Font.

00095 {
00096     // fix potential resource leak - KStowell - 10-15-99
00097     m_Font.DeleteObject();
00098 }

Member Function Documentation

CSize CCJMenuBar::CalcFixedLayout | ( | BOOL | bStretch,
 |  | BOOL | bHorz
 | ) | [protected, virtual]

Reimplemented from CCJToolBar.

Definition at line 131 of file CJMenuBar.cpp.

References CCJToolBar::CalcFixedLayout.

00132 {
00133     if( m_bInReBar ) {
00134         return CCJToolBar::CalcFixedLayout(bStretch, bHorz);
00135     }
00136
00137     else
00138     {
00139         CSize size = CCJToolBar::CalcFixedLayout(bStretch, bHorz);
00140         CRect rcClient;
00141         GetParentFrame()->GetClientRect(&rcClient);
00142
00143         if( bHorz ) {
00144             size.cx = rcClient.Width();
00145         }
00146         else {
00147             size.cy = rcClient.Height();
00148         }
00149
00150         return size;
00151     }
00152 }

void CCJMenuBar::CancelMenuAndTrackNewOne ( int iButton ) [protected]

Definition at line 500 of file CJMenuBar.cpp.

References m_iNewPopup, and m_iPopupTracking.

Referenced by OnMenuInput.

00501 {
00502     ASSERT_VALID(this);
00503     if (iNewPopup != m_iPopupTracking) {
00504         GetParentFrame()->PostMessage(WM_CANCELMODE); // quit menu loop
00505         m_iNewPopup = iNewPopup;                     // go to this popup (-1 = quit)
00506     }
00507 }

CPoint CCJMenuBar::ComputeMenuTrackPoint | ( | const CRect & | rcButn,
 |  | TPMPARAMS & | tpm
 | ) | [protected]

Definition at line 585 of file CJMenuBar.cpp.

Referenced by TrackPopup.

00586 {
00587     tpm.cbSize = sizeof(tpm);
00588     DWORD dwStyle = m_dwStyle;
00589     CPoint pt;
00590     CRect& rcExclude = (CRect&)tpm.rcExclude;
00591     rcExclude = rcButn;
00592     ::GetWindowRect(::GetDesktopWindow(), &rcExclude);
00593
00594     switch (dwStyle & CBRS_ALIGN_ANY) {
00595     case CBRS_ALIGN_BOTTOM:
00596         pt = CPoint(rcButn.left, rcButn.top);
00597         rcExclude.top = rcButn.top;
00598         break;
00599
00600     case CBRS_ALIGN_LEFT:
00601         pt = CPoint(rcButn.right, rcButn.top);
00602         rcExclude.right = rcButn.right;
00603         break;
00604
00605     case CBRS_ALIGN_RIGHT:
00606         pt = CPoint(rcButn.left, rcButn.top);
00607         rcExclude.left = rcButn.left;
00608         break;
00609
00610     default: // case CBRS_ALIGN_TOP:
00611         pt = CPoint(rcButn.left, rcButn.bottom);
00612         break;
00613     }
00614     return pt;
00615 }

BOOL CCJMenuBar::Create | ( | CWnd * | pParentWnd,
 |  | DWORD | dwStyle = WS_CHILD|WS_VISIBLE|CBRS_TOP,
 |  | UINT | nID = AFX_IDW_TOOLBAR
 | ) | [virtual]

Reimplemented from CCJToolBar.

Definition at line 111 of file CJMenuBar.cpp.

References CreateEx, and NULL.

00112 {
00113     return CreateEx(pParentWnd, NULL, dwStyle,
00114         CRect(m_cxLeftBorder, m_cyTopBorder, m_cxRightBorder, m_cyBottomBorder), nID);
00115 }

BOOL CCJMenuBar::CreateEx | ( | CWnd * | pParentWnd,
 |  | DWORD | dwCtrlStyle = TBSTYLE_FLAT,
 |  | DWORD | dwStyle = WS_CHILD|WS_VISIBLE|CBRS_ALIGN_TOP,
 |  | CRect | rcBorders = CRect(0, 0, 0, 0),
 |  | UINT | nID = AFX_IDW_TOOLBAR
 | ) | [virtual]

Reimplemented from CCJToolBar.

Definition at line 117 of file CJMenuBar.cpp.

References CCJToolBar::CreateEx, FALSE, CCJMenuBarFrameHook::Install, m_frameHook, TRUE, and UpdateFont.

Referenced by Create.

00118 {
00119     if( !CCJToolBar::CreateEx( pParentWnd, dwCtrlStyle, dwStyle, rcBorders, nID))
00120         return FALSE;
00121
00122     UpdateFont();
00123     m_frameHook.Install(this, *pParentWnd);
00124
00125     SetWindowText(_T("Menu Bar"));
00126     return TRUE;
00127 }

_CJXLIB_INLINE CCJMenu * CCJMenuBar::GetMenu ( )

Definition at line 195 of file CJMenuBar.h.

References m_popupMenu.

00196     { return &m_popupMenu; }

int CCJMenuBar::GetNextOrPrevButton | ( | int | iButton,
 |  | BOOL | bPrev
 | ) | [protected]

Definition at line 243 of file CJMenuBar.cpp.

References CCJToolBar::GetButtonCount.

Referenced by OnMenuInput, and TranslateFrameMessage.

00244 {
00245     ASSERT_VALID(this);
00246     if (bPrev) {
00247         iButton--;
00248         if (iButton <0)
00249             iButton = GetButtonCount() - 1;
00250     } else {
00251         iButton++;
00252         if (iButton >= GetButtonCount())
00253             iButton = 0;
00254     }
00255     return iButton;
00256 }

_CJXLIB_INLINE TRACKINGSTATE CCJMenuBar::GetTrackingState ( int & iPopup )

Definition at line 198 of file CJMenuBar.h.

References m_iPopupTracking, m_iTrackingState, and TRACKINGSTATE.

00199     { iPopup = m_iPopupTracking; return m_iTrackingState; }

int CCJMenuBar::HitTest ( CPoint p ) const [protected]

Reimplemented from CCJToolBar.

Definition at line 263 of file CJMenuBar.cpp.

References CCJToolBar::HitTest.

Referenced by OnLButtonDown, OnMenuInput, and OnMouseMove.

00264 {
00265     int iHit = CCJToolBar::HitTest(p);
00266     if (iHit>0) {
00267         CRect rc;
00268         GetClientRect(&rc);
00269         if (!rc.PtInRect(p)) // if point is outside window
00270             iHit = -1;          // can't be a hit!
00271     }
00272     return iHit;
00273 }

_CJXLIB_INLINE BOOL CCJMenuBar::IsValidButton ( int iButton ) const [protected]

Definition at line 192 of file CJMenuBar.h.

References CCJToolBar::GetButtonCount.

Referenced by OnMenuInput, OnMouseMove, and OnUpdateMenuButton.

00193     { return 0 <= iButton && iButton < GetButtonCount(); }

BOOL CCJMenuBar::LoadMenu ( UINT nID )

Definition at line 279 of file CJMenuBar.cpp.

References CCJToolBar::AddButtons, CCJToolBar::AddStrings, CCJToolBar::AutoSize, CCJToolBar::DeleteButton, CCJToolBar::GetButtonCount, m_arStrings, m_nMenuID, NULL, RecomputeToolbarSize, CCJToolBar::SetImageList, TRUE, and VERIFY.

00280 {
00281     CFrameWnd* pFrame = GetParentFrame();
00282     ASSERT_VALID(pFrame);
00283
00284     pFrame->GetMenu()->DestroyMenu();
00285     pFrame->SetMenu(NULL);
00286
00287     CMenu menu;
00288     menu.LoadMenu(nID);
00289     m_nMenuID = nID;
00290
00291     // delete existing buttons
00292     int nCount = GetButtonCount();
00293     while (nCount--) {
00294         VERIFY(DeleteButton(0));
00295     }
00296
00297     DWORD dwStyle = GetStyle();
00298     BOOL bModifyStyle = ModifyStyle(0, TBSTYLE_FLAT|TBSTYLE_TRANSPARENT);
00299
00300     SetImageList(NULL);
00301     UINT nMenuItems = menu.GetMenuItemCount();
00302
00303     for( UINT i = 0; i < nMenuItems; i++ )
00304     {
00305         CString strName;
00306         if( menu.GetMenuString(i, strName, MF_BYPOSITION ))
00307         {
00308             TBBUTTON tbb;
00309             memset( &tbb, 0, sizeof( TBBUTTON ));
00310             tbb.idCommand = menu.GetMenuItemID(i);
00311
00312             // Because the toolbar is too brain-damaged to know if it already has
00313             // a string, and is also too brain-dead to even let you delete strings,
00314             // I have to determine if each string has been added already. Otherwise
00315             // in a MDI app, as the menus are repeatedly switched between doc and
00316             // no-doc menus, I will keep adding strings until somebody runs out of
00317             // memory. Sheesh!
00318             //
00319             int iString = -1;
00320             for (int j=0; j<m_arStrings.GetSize(); j++) {
00321                 if (m_arStrings[j] == strName) {
00322                     iString = j; // found it
00323                     break;
00324                 }
00325             }
00326             if (iString <0) {
00327                 // string not found: add it
00328                 iString = AddStrings(strName);
00329                 m_arStrings.SetAtGrow(iString, strName);
00330             }
00331
00332             tbb.iString = iString;
00333             tbb.fsState = TBSTATE_ENABLED;
00334             tbb.fsStyle = TBSTYLE_AUTOSIZE;
00335             tbb.iBitmap = -1;
00336             tbb.idCommand = i;
00337             VERIFY(AddButtons(1, &tbb));
00338         }
00339     }
00340
00341     if( bModifyStyle ) {
00342         SetWindowLong(m_hWnd, GWL_STYLE, dwStyle);
00343     }
00344
00345     if( ::IsMenu( menu )) {
00346         AutoSize();                              // size buttons
00347         RecomputeToolbarSize();              // and menubar itself
00348     }
00349
00350     menu.DestroyMenu();
00351     return TRUE;
00352 }

LRESULT CALLBACK CCJMenuBar::MenuInputFilter | ( | int | code,
 |  | WPARAM | wp,
 |  | LPARAM | lp
 | ) | [static, protected]

Definition at line 437 of file CJMenuBar.cpp.

References g_hMsgHook, OnMenuInput, and TRUE.

Referenced by TrackPopup.

00438 {
00439     return (code==MSGF_MENU && g_pMenuBar &&
00440         g_pMenuBar->OnMenuInput(*((MSG*)lp))) ? TRUE
00441         : CallNextHookEx(g_hMsgHook, code, wp, lp);
00442 }

void CCJMenuBar::OnBarStyleChange | ( | DWORD | dwOldStyle,
 |  | DWORD | dwNewStyle
 | ) | [protected, virtual]

Reimplemented from CCJToolBar.

Definition at line 407 of file CJMenuBar.cpp.

References CCJToolBar::OnBarStyleChange, and RecomputeMenuLayout.

00408 {
00409     CCJToolBar::OnBarStyleChange(dwOldStyle, dwNewStyle);
00410     RecomputeMenuLayout();
00411 }

void CCJMenuBar::OnLButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 358 of file CJMenuBar.cpp.

References CCJToolBar::GetButtonCount, HitTest, and TrackPopup.

00359 {
00360     ASSERT_VALID(this);
00361     int iButton = HitTest(pt);
00362     if (iButton >= 0 && iButton<GetButtonCount()) // if mouse is over a button:
00363         TrackPopup(iButton);                                 //   track it
00364     else                                                         // otherwise:
00365         CCJToolBar::OnLButtonDown(nFlags, pt);   //   pass it on...
00366 }

BOOL CCJMenuBar::OnMenuInput ( MSG & m ) [protected, virtual]

Definition at line 449 of file CJMenuBar.cpp.

References ASSERT, CancelMenuAndTrackNewOne, FALSE, GetNextOrPrevButton, HitTest, IsValidButton, m_bEscapeWasPressed, m_bProcessLeftArrow, m_bProcessRightArrow, m_iPopupTracking, m_iTrackingState, m_ptMouse, TRACK_POPUP, and TRUE.

Referenced by MenuInputFilter.

00450 {
00451     ASSERT_VALID(this);
00452     ASSERT(m_iTrackingState == TRACK_POPUP); // sanity check
00453     int msg = m.message;
00454
00455     if (msg==WM_KEYDOWN) {
00456         // handle left/right-arow.
00457         TCHAR vkey = static_cast<TCHAR>(m.wParam);
00458
00459         if ((vkey == VK_LEFT  && m_bProcessLeftArrow) ||
00460             (vkey == VK_RIGHT && m_bProcessRightArrow)) {
00461
00462             CancelMenuAndTrackNewOne(
00463                 GetNextOrPrevButton(m_iPopupTracking, vkey==VK_LEFT));
00464             return TRUE; // eat it
00465
00466         } else if (vkey == VK_ESCAPE) {
00467             m_bEscapeWasPressed = TRUE;  // (menu will abort itself)
00468         }
00469
00470     } else if (msg==WM_MOUSEMOVE || msg==WM_LBUTTONDOWN) {
00471         // handle mouse move or click
00472         CPoint pt = m.lParam;
00473         ScreenToClient(&pt);
00474
00475         if (msg == WM_MOUSEMOVE) {
00476             if (pt != m_ptMouse) {
00477                 int iButton = HitTest(pt);
00478                 if (IsValidButton(iButton) && iButton != m_iPopupTracking) {
00479                     // user moved mouse over a different button: track its popup
00480                     CancelMenuAndTrackNewOne(iButton);
00481                 }
00482                 m_ptMouse = pt;
00483             }
00484
00485         } else if (msg == WM_LBUTTONDOWN) {
00486             if (HitTest(pt) == m_iPopupTracking) {
00487                 // user clicked on same button I am tracking: cancel menu
00488                 CancelMenuAndTrackNewOne(-1);
00489                 return TRUE; // eat it
00490             }
00491         }
00492     }
00493     return FALSE; // not handled
00494 }

void CCJMenuBar::OnMenuSelect | ( | HMENU | hmenu,
 |  | UINT | nItemID
 | ) | [protected]

Definition at line 418 of file CJMenuBar.cpp.

References m_bProcessLeftArrow, m_bProcessRightArrow, m_iTrackingState, NULL, and TRUE.

Referenced by CCJMenuBarFrameHook::WindowProc.

00419 {
00420     if (m_iTrackingState > 0) {
00421         // process right-arrow if item is NOT a submenu
00422         m_bProcessRightArrow = (::GetSubMenu(hmenu, iItem) == NULL);
00423         // process left-arrow if curent menu is one I'm tracking
00424         m_bProcessLeftArrow = TRUE;
00425     }
00426 }

void CCJMenuBar::OnMouseMove | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 371 of file CJMenuBar.cpp.

References HitTest, IsValidButton, m_iTrackingState, m_ptMouse, CCJToolBar::SetHotItem, and TRACK_BUTTON.

00372 {
00373     ASSERT_VALID(this);
00374
00375     if (m_iTrackingState==TRACK_BUTTON) {
00376
00377         // In button-tracking state, ignore mouse-over to non-button area.
00378         // Normally, the toolbar would de-select the hot item in this case.
00379         //
00380         // Only change the hot item if the mouse has actually moved.
00381         // This is necessary to avoid a bug where the user moves to a different
00382         // button from the one the mouse is over, and presses arrow-down to get
00383         // the menu, then Esc to cancel it. Without this code, the button will
00384         // jump to wherever the mouse is--not right.
00385
00386         int iHot = HitTest(pt);
00387         if (IsValidButton(iHot) && pt != m_ptMouse)
00388             SetHotItem(iHot);
00389         return;          // don't let toolbar get it
00390     }
00391     m_ptMouse = pt; // remember point
00392     CCJToolBar::OnMouseMove(nFlags, pt);
00393 }

void CCJMenuBar::OnSize | ( | UINT | nType,
 |  | int | cx,
 |  | int | cy
 | ) | [protected]

Definition at line 398 of file CJMenuBar.cpp.

References RecomputeMenuLayout.

00399 {
00400     CCJToolBar::OnSize(nType, cx, cy);
00401     RecomputeMenuLayout();
00402 }

void CCJMenuBar::OnUpdateMenuButton ( CCmdUI * pCmdUI ) [protected]

Definition at line 172 of file CJMenuBar.cpp.

References IsValidButton, and TRUE.

00173 {
00174     ASSERT_VALID(this);
00175     if (IsValidButton(pCmdUI->m_nID))
00176         pCmdUI->Enable(TRUE);
00177 }

void CCJMenuBar::RecomputeMenuLayout ( ) [protected]

Definition at line 182 of file CJMenuBar.cpp.

References NULL.

Referenced by OnBarStyleChange, and OnSize.

00183 {
00184     SetWindowPos(NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOACTIVATE |
00185         SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
00186 }

void CCJMenuBar::RecomputeToolbarSize ( ) [protected]

Definition at line 191 of file CJMenuBar.cpp.

References ASSERT.

Referenced by LoadMenu.

00192 {
00193     // Force toolbar to recompute size
00194     CFrameWnd* pFrame = (CFrameWnd*)GetParentFrame();
00195     ASSERT_VALID(pFrame);
00196     ASSERT(pFrame->IsFrameWnd());
00197     pFrame->RecalcLayout();
00198
00199     // floating frame
00200     pFrame = GetParentFrame();
00201     if (pFrame->IsKindOf(RUNTIME_CLASS(CMiniFrameWnd)))
00202         pFrame->RecalcLayout();
00203 }

void CCJMenuBar::SetTrackingState | ( | TRACKINGSTATE | iState,
 |  | int | iButton = -1
 | ) | [protected]

Definition at line 208 of file CJMenuBar.cpp.

References FALSE, m_bEscapeWasPressed, m_bProcessLeftArrow, m_bProcessRightArrow, m_iPopupTracking, m_iTrackingState, CCJToolBar::SetHotItem, TRACK_NONE, TRACK_POPUP, TRACKINGSTATE, and TRUE.

Referenced by ToggleTrackButtonMode, TrackPopup, and TranslateFrameMessage.

00209 {
00210     ASSERT_VALID(this);
00211     if (iState != m_iTrackingState) {
00212         if (iState == TRACK_NONE)
00213             iButton = -1;
00214
00215         SetHotItem(iButton);                     // could be none (-1)
00216
00217         if (iState==TRACK_POPUP) {
00218             // set related state stuff
00219             m_bEscapeWasPressed = FALSE;     // assume Esc key not pressed
00220             m_bProcessRightArrow =           // assume left/right arrow..
00221                 m_bProcessLeftArrow = TRUE; // ..will move to prev/next popup
00222             m_iPopupTracking = iButton;  // which popup I'm tracking
00223         }
00224         m_iTrackingState = iState;
00225     }
00226 }

void CCJMenuBar::ToggleTrackButtonMode ( ) [protected]

Definition at line 231 of file CJMenuBar.cpp.

References m_iTrackingState, SetTrackingState, TRACK_BUTTON, and TRACK_NONE.

Referenced by TranslateFrameMessage.

00232 {
00233     ASSERT_VALID(this);
00234     if (m_iTrackingState == TRACK_NONE || m_iTrackingState == TRACK_BUTTON) {
00235         SetTrackingState(m_iTrackingState == TRACK_NONE ?
00236             TRACK_BUTTON : TRACK_NONE, 0);
00237     }
00238 }

void CCJMenuBar::TrackPopup ( int iButton ) [protected]

Definition at line 514 of file CJMenuBar.cpp.

References ASSERT, ComputeMenuTrackPoint, CCJMenu::DestroyMenu, FALSE, g_hMsgHook, CCJToolBar::GetRect, CCJMenu::LoadMenu, CCJMenu::LoadToolbar, m_bEscapeWasPressed, m_iNewPopup, m_nMenuID, m_popupMenu, MenuInputFilter, CCJToolBar::PressButton, SetTrackingState, TRACK_BUTTON, TRACK_NONE, TRACK_POPUP, and TRUE.

Referenced by OnLButtonDown, and TranslateFrameMessage.

00515 {
00516     ASSERT_VALID(this);
00517
00518     m_popupMenu.LoadMenu(m_nMenuID);
00519     m_popupMenu.LoadToolbar(m_nMenuID);
00520     ASSERT(::IsMenu(m_popupMenu));
00521
00522     while (iButton >= 0) {                   // while user selects another menu
00523
00524         m_iNewPopup = -1;                        // assume quit after this
00525         PressButton(iButton, TRUE);      // press the button
00526         UpdateWindow();                      // and force repaint now
00527
00528         // post a simulated arrow-down into the message stream
00529         // so TrackPopupMenu will read it and move to the first item
00530         GetParentFrame()->PostMessage(WM_KEYDOWN, VK_DOWN, 1);
00531         GetParentFrame()->PostMessage(WM_KEYUP, VK_DOWN, 1);
00532
00533         SetTrackingState(TRACK_POPUP, iButton); // enter tracking state
00534
00535         // Need to install a hook to trap menu input in order to make
00536         // left/right-arrow keys and "hot" mouse tracking work.
00537         //
00538         ASSERT(g_pMenuBar == NULL);
00539         g_pMenuBar = this;
00540         ASSERT(g_hMsgHook == NULL);
00541         g_hMsgHook = SetWindowsHookEx(WH_MSGFILTER,
00542             MenuInputFilter, NULL, ::GetCurrentThreadId());
00543
00544         // get submenu and display it beneath button
00545         TPMPARAMS tpm;
00546         CRect rcButton;
00547         GetRect(iButton, rcButton);
00548         ClientToScreen(&rcButton);
00549         CPoint pt = ComputeMenuTrackPoint(rcButton, tpm);
00550
00551         CCJMenu* pPopupMenu = (CCJMenu*)m_popupMenu.GetSubMenu(iButton);
00552         pPopupMenu->TrackPopupMenu( TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_VERTICAL,
00553             pt.x, pt.y, GetParentFrame());
00554
00555         // uninstall hook.
00556         ::UnhookWindowsHookEx(g_hMsgHook);
00557         g_hMsgHook = NULL;
00558         g_pMenuBar = NULL;
00559
00560         PressButton(iButton, FALSE);     // un-press button
00561         UpdateWindow();                  // and force repaint now
00562
00563         // If the user exited the menu loop by pressing Escape,
00564         // return to track-button state; otherwise normal non-tracking state.
00565         SetTrackingState(m_bEscapeWasPressed ?
00566             TRACK_BUTTON : TRACK_NONE, iButton);
00567
00568         // If the user moved mouse to a new top-level popup (eg from File to
00569         // Edit button), I will have posted a WM_CANCELMODE to quit
00570         // the first popup, and set m_iNewPopup to the new menu to show.
00571         // Otherwise, m_iNewPopup will be -1 as set above.
00572         // So just set iButton to the next popup menu and keep looping...
00573         iButton = m_iNewPopup;
00574     }
00575
00576     // fix potential resource leak - KStowell - 10-15-99
00577     m_popupMenu.DestroyMenu();
00578 }

BOOL CCJMenuBar::TranslateFrameMessage ( MSG * pMsg ) [virtual]

Definition at line 621 of file CJMenuBar.cpp.

References ASSERT, FALSE, CCJToolBar::GetHotItem, GetNextOrPrevButton, m_iTrackingState, CCJToolBar::MapAccelerator, CCJToolBar::SetHotItem, SetTrackingState, ToggleTrackButtonMode, TRACK_BUTTON, TRACK_NONE, TrackPopup, and TRUE.

Referenced by CCJFrameWnd::PreTranslateMessage.

00622 {
00623     ASSERT_VALID(this);
00624     ASSERT(pMsg);
00625     UINT msg = pMsg->message;
00626     if (WM_LBUTTONDOWN <= msg && msg <= WM_MOUSELAST) {
00627         if (pMsg->hwnd != m_hWnd && m_iTrackingState > 0) {
00628             // user clicked outside menu bar: exit tracking mode
00629             SetTrackingState(TRACK_NONE);
00630         }
00631
00632     } else if (msg==WM_SYSKEYDOWN || msg==WM_SYSKEYUP || msg==WM_KEYDOWN) {
00633
00634         TCHAR vkey = static_cast<TCHAR>(pMsg->wParam);  // get virt key
00635
00636         BOOL  bAlt = HIWORD(pMsg->lParam) & KF_ALTDOWN;     // Alt key down
00637
00638         if (vkey==VK_MENU ||
00639             (vkey==VK_F10 && !((GetKeyState(VK_SHIFT) & 0x80000000) ||
00640                                (GetKeyState(VK_CONTROL) & 0x80000000) || bAlt))) {
00641
00642             // key is VK_MENU or F10 with no alt/ctrl/shift: toggle menu mode
00643             if (msg==WM_SYSKEYUP) {
00644                 ToggleTrackButtonMode();
00645             }
00646             return TRUE;
00647
00648         } else if ((msg==WM_SYSKEYDOWN || msg==WM_KEYDOWN)) {
00649             if (m_iTrackingState == TRACK_BUTTON) {
00650                 // I am tracking: handle left/right/up/down/space/Esc
00651                 switch (vkey) {
00652                 case VK_LEFT:
00653                 case VK_RIGHT:
00654                     // left or right-arrow: change hot button if tracking buttons
00655                     SetHotItem(GetNextOrPrevButton(GetHotItem(), vkey==VK_LEFT));
00656                     return TRUE;
00657
00658                 case VK_SPACE:  // (personally, I like SPACE to enter menu too)
00659                 case VK_UP:
00660                 case VK_DOWN:
00661                     // up or down-arrow: move into current menu, if any
00662                     TrackPopup(GetHotItem());
00663                     return TRUE;
00664
00665                 case VK_ESCAPE:
00666                     // escape key: exit tracking mode
00667                     SetTrackingState(TRACK_NONE);
00668                     return TRUE;
00669                 }
00670             }
00671
00672             // Handle alphanumeric key: invoke menu. Note that Alt-X
00673             // chars come through as WM_SYSKEYDOWN, plain X as WM_KEYDOWN.
00674             if ((bAlt || m_iTrackingState == TRACK_BUTTON) && isalnum(vkey)) {
00675                 // Alt-X, or else X while in tracking mode
00676                 UINT nID;
00677                 if (MapAccelerator(vkey, nID)) {
00678                     TrackPopup(nID);     // found menu mnemonic: track it
00679                     return TRUE;         // handled
00680                 } else if (m_iTrackingState==TRACK_BUTTON && !bAlt) {
00681                     MessageBeep(0);
00682                     return TRUE;
00683                 }
00684             }
00685
00686             // Default for any key not handled so far: return to no-menu state
00687             if (m_iTrackingState > 0) {
00688                 SetTrackingState(TRACK_NONE);
00689             }
00690         }
00691     }
00692     return FALSE; // not handled, pass along
00693 }

void CCJMenuBar::UpdateFont ( ) [protected]

Definition at line 157 of file CJMenuBar.cpp.

References m_Font, and VERIFY.

Referenced by CreateEx, and CCJMenuBarFrameHook::WindowProc.

00158 {
00159     m_Font.DeleteObject();
00160     NONCLIENTMETRICS ncm;
00161     ncm.cbSize = sizeof(ncm);
00162     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00163     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMenuFont));
00164     SetFont(&m_Font);
00165 }

Friends And Related Function Documentation

friend class CCJMenuBarFrameHook [friend]

Definition at line 112 of file CJMenuBar.h.

Member Data Documentation

BOOL CCJMenuBar::bTRACE [static]

Definition at line 137 of file CJMenuBar.h.

CStringArray CCJMenuBar::m_arStrings [protected]

Definition at line 115 of file CJMenuBar.h.

Referenced by LoadMenu.

BOOL CCJMenuBar::m_bAutoRemoveFrameMenu

Definition at line 108 of file CJMenuBar.h.

Referenced by CCJMenuBar.

BOOL CCJMenuBar::m_bEscapeWasPressed [protected]

Definition at line 124 of file CJMenuBar.h.

Referenced by OnMenuInput, SetTrackingState, and TrackPopup.

BOOL CCJMenuBar::m_bProcessLeftArrow [protected]

Definition at line 123 of file CJMenuBar.h.

Referenced by OnMenuInput, OnMenuSelect, and SetTrackingState.

BOOL CCJMenuBar::m_bProcessRightArrow [protected]

Definition at line 122 of file CJMenuBar.h.

Referenced by OnMenuInput, OnMenuSelect, and SetTrackingState.

CFont CCJMenuBar::m_Font [protected]

Definition at line 127 of file CJMenuBar.h.

Referenced by UpdateFont, and ~CCJMenuBar.

CCJMenuBarFrameHook CCJMenuBar::m_frameHook [protected]

Definition at line 114 of file CJMenuBar.h.

Referenced by CreateEx.

HMENU CCJMenuBar::m_hMenuTracking [protected]

Definition at line 126 of file CJMenuBar.h.

int CCJMenuBar::m_iNewPopup [protected]

Definition at line 121 of file CJMenuBar.h.

Referenced by CancelMenuAndTrackNewOne, CCJMenuBar, and TrackPopup.

int CCJMenuBar::m_iPopupTracking [protected]

Definition at line 120 of file CJMenuBar.h.

Referenced by CancelMenuAndTrackNewOne, CCJMenuBar, GetTrackingState, OnMenuInput, and SetTrackingState.

TRACKINGSTATE CCJMenuBar::m_iTrackingState [protected]

Definition at line 129 of file CJMenuBar.h.

Referenced by CCJMenuBar, GetTrackingState, OnMenuInput, OnMenuSelect, OnMouseMove, SetTrackingState, ToggleTrackButtonMode, and TranslateFrameMessage.

int CCJMenuBar::m_nMenuID [protected]

Definition at line 116 of file CJMenuBar.h.

Referenced by LoadMenu, and TrackPopup.

CCJMenu CCJMenuBar::m_popupMenu [protected]

Definition at line 117 of file CJMenuBar.h.

Referenced by GetMenu, and TrackPopup.

CPoint CCJMenuBar::m_ptMouse [protected]

Definition at line 125 of file CJMenuBar.h.

Referenced by OnMenuInput, and OnMouseMove.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJMenuBar.h
  • WinCvs/CJLib/CJLibrary/CJMenuBar.cpp
Generated on Sun Feb 24 01:24:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJMenuBarFrameHook Class Reference

#include <CJMenuBar.h>

Inheritance diagram for CCJMenuBarFrameHook:

[legend]
Collaboration diagram for CCJMenuBarFrameHook:

[legend]
List of all members.

Protected Methods

CCJMenuBarFrameHook ()
~CCJMenuBarFrameHook ()
BOOL | Install (CCJMenuBar *pMenuBar, HWND hWndToHook)
virtual LRESULT | WindowProc (UINT msg, WPARAM wp, LPARAM lp)

Protected Attributes

CCJMenuBar * m_pMenuBar

Friends

class | CCJMenuBar

Constructor & Destructor Documentation

CCJMenuBarFrameHook::CCJMenuBarFrameHook ( ) [protected]

Definition at line 717 of file CJMenuBar.cpp.

00718 {
00719 }

CCJMenuBarFrameHook::~CCJMenuBarFrameHook ( ) [protected]

Definition at line 721 of file CJMenuBar.cpp.

References CSubclassWnd::HookWindow.

00722 {
00723     HookWindow((HWND)NULL); // (unhook)
00724 }

Member Function Documentation

BOOL CCJMenuBarFrameHook::Install | ( | CCJMenuBar * | pMenuBar,
 |  | HWND | hWndToHook
 | ) | [protected]

Definition at line 729 of file CJMenuBar.cpp.

References CSubclassWnd::HookWindow, and m_pMenuBar.

Referenced by CCJMenuBar::CreateEx.

00730 {
00731     ASSERT_VALID(pMenuBar);
00732     m_pMenuBar = pMenuBar;
00733     return HookWindow(hWndToHook);
00734 }

LRESULT CCJMenuBarFrameHook::WindowProc | ( | UINT | msg,
 |  | WPARAM | wp,
 |  | LPARAM | lp
 | ) | [protected, virtual]

Reimplemented from CSubclassWnd.

Definition at line 739 of file CJMenuBar.cpp.

References m_pMenuBar, CCJMenuBar::OnMenuSelect, CCJMenuBar::UpdateFont, and CSubclassWnd::WindowProc.

00740 {
00741     CCJMenuBar& mb = *m_pMenuBar;
00742
00743     switch (msg) {
00744     // The following messages are trapped for the frame window
00745     case WM_SYSCOLORCHANGE:
00746         mb.UpdateFont();
00747         break;
00748
00749     case WM_MENUSELECT:
00750         mb.OnMenuSelect((HMENU)lp, (UINT)LOWORD(wp));
00751         break;
00752     }
00753     return CSubclassWnd::WindowProc(msg, wp, lp);
00754 }

Friends And Related Function Documentation

friend class CCJMenuBar [friend]

Definition at line 63 of file CJMenuBar.h.

Member Data Documentation

CCJMenuBar* CCJMenuBarFrameHook::m_pMenuBar [protected]

Definition at line 64 of file CJMenuBar.h.

Referenced by Install, and WindowProc.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJMenuBar.h
  • WinCvs/CJLib/CJLibrary/CJMenuBar.cpp
Generated on Sun Feb 24 01:24:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJMenuData Class Reference

#include <CJMenu.h>

Collaboration diagram for CCJMenuData:

[legend]
List of all members.

Public Methods

CCJMenuData ()
void | SetAnsiString (LPCSTR szAnsiString)
void | SetWideString (const wchar_t *szWideString)
const wchar_t * | GetWideString (void)
~CCJMenuData ()
CString | GetString (void)

Public Attributes

int | xoffset
int | menuIconNormal
UINT | nFlags
UINT | nID
UINT | syncflag
CImageList * | bitmap

Private Attributes

wchar_t * | m_szMenuText

Constructor & Destructor Documentation

CCJMenuData::CCJMenuData ( ) [inline]

Definition at line 50 of file CJMenu.h.

References NULL.

00050                    {menuIconNormal=-1;xoffset=-1;bitmap=NULL;
00051     nFlags=0;nID=0;syncflag=0;m_szMenuText=NULL;};

CCJMenuData::~CCJMenuData ( )

Definition at line 155 of file CJMenu.cpp.

References m_szMenuText.

00156 {
00157     if(bitmap)
00158         delete(bitmap);
00159
00160     delete[] m_szMenuText; //Need not check for NULL because ANSI X3J16 allows "delete NULL"
00161 }

Member Function Documentation

CString CCJMenuData::GetString ( void )

Definition at line 102 of file CJMenu.cpp.

Referenced by CCJMenu::NewODMenu.

00104 {
00105     CString strText;
00106     if (m_szMenuText)
00107     {
00108 #ifdef UNICODE
00109         strText = m_szMenuText;
00110 #else
00111         USES_CONVERSION;
00112         strText=W2A(m_szMenuText);     //SK:  see MFC Tech Note 059
00113 #endif
00114     }
00115     return strText;
00116 }

const wchar_t* CCJMenuData::GetWideString ( void ) [inline]

Definition at line 54 of file CJMenu.h.

00054 {return m_szMenuText;};

void CCJMenuData::SetAnsiString ( LPCSTR szAnsiString )

Definition at line 96 of file CJMenu.cpp.

References SetWideString.

Referenced by CCJMenu::NewODMenu, and CCJMenu::SynchronizeMenu.

00097 {
00098     USES_CONVERSION;
00099     SetWideString(A2W(szAnsiString));  //SK:  see MFC Tech Note 059
00100 }

void CCJMenuData::SetWideString ( const wchar_t * szWideString )

Definition at line 164 of file CJMenu.cpp.

References m_szMenuText, and NULL.

Referenced by CCJMenu::AppendODMenuW, CCJMenu::InsertODMenuW, CCJMenu::ModifyODMenuW, CCJMenu::NewODMenu, SetAnsiString, and CCJMenu::SynchronizeMenu.

00165 {
00166     delete[] m_szMenuText;//Need not check for NULL because ANSI X3J16 allows "delete NULL"
00167
00168     if (szWideString)
00169     {
00170         m_szMenuText = new wchar_t[sizeof(wchar_t)*(wcslen(szWideString)+1)];
00171         if (m_szMenuText)
00172             wcscpy(m_szMenuText,szWideString);
00173     }
00174     else
00175         m_szMenuText=NULL;//set to NULL so we need not bother about dangling non-NULL Ptrs
00176 }

Member Data Documentation

CImageList* CCJMenuData::bitmap

Definition at line 60 of file CJMenu.h.

Referenced by CCJMenu::AddFromToolBar, CCJMenu::AppendODMenuW, CCJMenu::InsertODMenuW, and CCJMenu::ModifyODMenuW.

wchar_t* CCJMenuData::m_szMenuText [private]

Definition at line 48 of file CJMenu.h.

Referenced by SetWideString, and ~CCJMenuData.

int CCJMenuData::menuIconNormal

Definition at line 58 of file CJMenu.h.

Referenced by CCJMenu::AddFromToolBar, CCJMenu::AppendODMenuW, CCJMenu::InsertODMenuW, CCJMenu::ModifyODMenuW, and CCJMenu::NewODMenu.

UINT CCJMenuData::nFlags

Definition at line 59 of file CJMenu.h.

Referenced by CCJMenu::AddFromToolBar, CCJMenu::AppendODMenuW, CCJMenu::InsertODMenuW, CCJMenu::ModifyODMenuW, CCJMenu::NewODMenu, and CCJMenu::SynchronizeMenu.

UINT CCJMenuData::nID

Definition at line 59 of file CJMenu.h.

Referenced by CCJMenu::AddFromToolBar, CCJMenu::AppendODMenuW, CCJMenu::InsertODMenuW, CCJMenu::ModifyODMenuW, and CCJMenu::NewODMenu.

UINT CCJMenuData::syncflag

Definition at line 59 of file CJMenu.h.

int CCJMenuData::xoffset

Definition at line 57 of file CJMenu.h.

Referenced by CCJMenu::AddFromToolBar, CCJMenu::AppendODMenuW, CCJMenu::InsertODMenuW, CCJMenu::ModifyODMenuW, and CCJMenu::NewODMenu.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJMenu.h
  • WinCvs/CJLib/CJLibrary/CJMenu.cpp
Generated on Sun Feb 24 01:24:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJMetaFileButton Class Reference

#include <CJMetaFileButton.h>

Inheritance diagram for CCJMetaFileButton:

[legend]
Collaboration diagram for CCJMetaFileButton:

[legend]
List of all members.

Public Methods

CCJMetaFileButton ()
virtual void | SetMetaFiles (HENHMETAFILE hMetaFile, HENHMETAFILE hMetaFileSel=NULL, HENHMETAFILE hMetaFileFocus=NULL, HENHMETAFILE hMetaFileDisabled=NULL)
virtual void | DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct)
virtual | ~CCJMetaFileButton ()

Protected Methods

afx_msg void | OnLButtonDblClk (UINT nFlags, CPoint point)
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)
afx_msg void | OnPaint ()

Private Attributes

HENHMETAFILE | m_hEnhMetaFile
HENHMETAFILE | m_hEnhMetaFileSel
HENHMETAFILE | m_hEnhMetaFileFocus
HENHMETAFILE | m_hEnhMetaFileDisabled

Constructor & Destructor Documentation

CCJMetaFileButton::CCJMetaFileButton ( )

Definition at line 61 of file CJMetaFileButton.cpp.

00062 {
00063 }

CCJMetaFileButton::~CCJMetaFileButton ( ) [virtual]

Definition at line 65 of file CJMetaFileButton.cpp.

00066 {
00067 }

Member Function Documentation

void CCJMetaFileButton::DrawItem ( LPDRAWITEMSTRUCT lpDrawItemStruct ) [virtual]

Definition at line 100 of file CJMetaFileButton.cpp.

References ASSERT, m_hEnhMetaFile, m_hEnhMetaFileDisabled, m_hEnhMetaFileFocus, m_hEnhMetaFileSel, and NULL.

00101 {
00102     ASSERT(lpDrawItemStruct != NULL);
00103
00104     // define some temporary variables.
00105     CDC*  pDC    = CDC::FromHandle( lpDrawItemStruct->hDC );
00106     CRect rcItem = lpDrawItemStruct->rcItem;
00107     int   nState = lpDrawItemStruct->itemState;
00108
00109     // Paint the background.
00110     pDC->FillSolidRect(rcItem, ::GetSysColor(COLOR_3DFACE));
00111
00112     // draw 3D button outline
00113     CPen penOutline(PS_SOLID, 1, GetSysColor(COLOR_BTNTEXT));
00114     CPen penLight(PS_SOLID, 1, GetSysColor(COLOR_BTNHIGHLIGHT));
00115     CPen penDark(PS_SOLID, 1, GetSysColor(COLOR_BTNSHADOW));
00116     CPen* pOldPen = NULL;
00117
00118     if (nState & ODS_SELECTED)
00119     {
00120         pOldPen = pDC->SelectObject(&penDark);
00121         pDC->MoveTo(0, rcItem.bottom - 1);
00122         pDC->LineTo(0, 1);
00123         pDC->LineTo(rcItem.right - 1, 1);
00124     }
00125     else
00126     {
00127         pOldPen = pDC->SelectObject(&penLight);
00128         pDC->MoveTo(0, rcItem.bottom - 2);
00129         pDC->LineTo(0, 1);
00130         pDC->LineTo(rcItem.right - 2, 1);
00131         pDC->SelectObject(&penDark);
00132         pDC->MoveTo(0, rcItem.bottom - 1);
00133         pDC->LineTo(rcItem.right - 2, rcItem.bottom - 1);
00134         pDC->LineTo(rcItem.right - 2, 0);
00135         pDC->MoveTo(1, rcItem.bottom - 2);
00136         pDC->LineTo(rcItem.right - 3, rcItem.bottom - 2);
00137         pDC->LineTo(rcItem.right - 3, 1);
00138     }
00139     pDC->SelectObject(&penOutline);
00140     pDC->MoveTo(0, 0);
00141     pDC->LineTo(rcItem.right - 1, 0);
00142     pDC->LineTo(rcItem.right - 1, rcItem.bottom);
00143
00144     HENHMETAFILE hMetaFile = m_hEnhMetaFile;
00145     if ((nState & ODS_SELECTED) && m_hEnhMetaFileSel != NULL)
00146         hMetaFile = m_hEnhMetaFileSel;
00147     else if ((nState & ODS_FOCUS) && m_hEnhMetaFileFocus != NULL)
00148         hMetaFile = m_hEnhMetaFileFocus;   // third image for focused
00149     else if ((nState & ODS_DISABLED) && m_hEnhMetaFileDisabled != NULL)
00150         hMetaFile = m_hEnhMetaFileDisabled;   // last image for disabled
00151
00152     ASSERT(hMetaFile != NULL);
00153
00154     CRect rcBounds(5,4,0,0);
00155     int iButtonHeight = rcItem.Height();
00156     if (iButtonHeight > 15)
00157         iButtonHeight = 15;
00158     else if (iButtonHeight < 11)
00159         iButtonHeight = 11;
00160     int iArrowWidth = (iButtonHeight / 2) - 3;
00161     rcBounds.right = rcBounds.left + iArrowWidth - 1;
00162     rcBounds.bottom = rcBounds.top + (iArrowWidth * 2) - 2;
00163
00164     if (nState & ODS_SELECTED)
00165         rcBounds += CPoint(1, 1);
00166     pDC->PlayMetaFile(hMetaFile, rcBounds);
00167
00168     // fix potential resource leak - KStowell - 10-21-99
00169     pDC->SelectObject(pOldPen);
00170     penOutline.DeleteObject();
00171     penLight.DeleteObject();
00172     penDark.DeleteObject();
00173 }

BOOL CCJMetaFileButton::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 175 of file CJMetaFileButton.cpp.

References TRUE.

00176 {
00177     // KStowell - overridden for flicker-free drawing.
00178     UNUSED_ALWAYS(pDC);
00179     return TRUE;
00180 }

void CCJMetaFileButton::OnLButtonDblClk | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 90 of file CJMetaFileButton.cpp.

References NULL.

00091 {
00092     // Fix for the double click problem with owner drawn buttons
00093     POINT pt;
00094     ::GetCursorPos(&pt);
00095     ::MapWindowPoints(NULL, (HWND)(m_hWnd), &pt, 1);
00096     ::SendMessage((HWND)(m_hWnd), WM_LBUTTONDOWN, 0, MAKELPARAM(pt.x, pt.y));
00097     CButton::OnLButtonDblClk(nFlags, point);
00098 }

void CCJMetaFileButton::OnPaint ( ) [protected]

Definition at line 182 of file CJMetaFileButton.cpp.

00183 {
00184     CPaintDC dc(this); // device context for painting
00185
00186     // KStowell - Get the client rect.
00187     CRect rcClient, rcClip;
00188     dc.GetClipBox( &rcClip );
00189     GetClientRect( &rcClient );
00190
00191     // KStowell - Create a memory device-context. This is done to help reduce
00192     // screen flicker, since we will paint the entire control to the
00193     // off screen device context first.
00194     CDC memDC;
00195     CBitmap bitmap;
00196     memDC.CreateCompatibleDC(&dc);
00197     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00198     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00199
00200     // KStowell - Repaint the background.
00201     memDC.FillSolidRect( rcClient, ::GetSysColor(COLOR_WINDOW) );
00202
00203     // let the control do its default drawing.
00204     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00205
00206     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00207     dc.BitBlt( rcClip.left, rcClip.top, rcClip.Width(), rcClip.Height(), &memDC,
00208         rcClip.left, rcClip.top, SRCCOPY );
00209
00210     // KStowell - Cleanup resources.
00211     memDC.SelectObject(pOldBitmap);
00212     memDC.DeleteDC();
00213     bitmap.DeleteObject();
00214 }

void CCJMetaFileButton::SetMetaFiles | ( | HENHMETAFILE | hMetaFile,
 |  | HENHMETAFILE | hMetaFileSel = NULL,
 |  | HENHMETAFILE | hMetaFileFocus = NULL,
 |  | HENHMETAFILE | hMetaFileDisabled = NULL
 | ) | [virtual]

Definition at line 69 of file CJMetaFileButton.cpp.

References m_hEnhMetaFile, m_hEnhMetaFileDisabled, m_hEnhMetaFileFocus, and m_hEnhMetaFileSel.

Referenced by CCJFlatTabCtrl::OnCreate.

00071 {
00072     m_hEnhMetaFile         = hMetaFile;
00073     m_hEnhMetaFileSel      = hMetaFileSel;
00074     m_hEnhMetaFileFocus    = hMetaFileFocus;
00075     m_hEnhMetaFileDisabled = hMetaFileDisabled;
00076 }

Member Data Documentation

HENHMETAFILE CCJMetaFileButton::m_hEnhMetaFile [private]

Definition at line 90 of file CJMetaFileButton.h.

Referenced by DrawItem, and SetMetaFiles.

HENHMETAFILE CCJMetaFileButton::m_hEnhMetaFileDisabled [private]

Definition at line 93 of file CJMetaFileButton.h.

Referenced by DrawItem, and SetMetaFiles.

HENHMETAFILE CCJMetaFileButton::m_hEnhMetaFileFocus [private]

Definition at line 92 of file CJMetaFileButton.h.

Referenced by DrawItem, and SetMetaFiles.

HENHMETAFILE CCJMetaFileButton::m_hEnhMetaFileSel [private]

Definition at line 91 of file CJMetaFileButton.h.

Referenced by DrawItem, and SetMetaFiles.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJMetaFileButton.h
  • WinCvs/CJLib/CJLibrary/CJMetaFileButton.cpp
Generated on Sun Feb 24 01:24:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJMiniDockFrameWnd Class Reference

#include <CJMiniDockFrameWnd.h>

Inheritance diagram for CCJMiniDockFrameWnd:

[legend]
Collaboration diagram for CCJMiniDockFrameWnd:

[legend]
List of all members.

Public Methods

CCJMiniDockFrameWnd ()
virtual | ~CCJMiniDockFrameWnd ()
virtual BOOL | Create (CWnd *pParent, DWORD dwBarStyle)

Protected Methods

afx_msg void | OnNcLButtonDown (UINT nHitTest, CPoint point)
afx_msg void | OnNcLButtonDblClk (UINT nHitTest, CPoint point)

Friends

class | CDockBar

Constructor & Destructor Documentation

CCJMiniDockFrameWnd::CCJMiniDockFrameWnd ( )

Definition at line 75 of file CJMiniDockFrameWnd.cpp.

00076 {
00077     // TODO: add construction code here.
00078 }

CCJMiniDockFrameWnd::~CCJMiniDockFrameWnd ( ) [virtual]

Definition at line 80 of file CJMiniDockFrameWnd.cpp.

00081 {
00082     // TODO: add destruction code here.
00083 }

Member Function Documentation

BOOL CCJMiniDockFrameWnd::Create | ( | CWnd * | pParent,
 |  | DWORD | dwBarStyle
 | ) | [virtual]

Definition at line 183 of file CJMiniDockFrameWnd.cpp.

References FALSE, and TRUE.

00184 {
00185     // Let the base class do all the work.
00186     if (!CMiniDockFrameWnd::Create(pParent, dwBarStyle))
00187         return FALSE;
00188
00189     // remove the MFS_4THICKFRAME style to allow diagonal
00190     // resizing.
00191     ModifyStyle(MFS_4THICKFRAME, 0);
00192
00193     return TRUE;
00194 }

void CCJMiniDockFrameWnd::OnNcLButtonDblClk | ( | UINT | nHitTest,
 |  | CPoint | point
 | ) | [protected]

Definition at line 157 of file CJMiniDockFrameWnd.cpp.

References ASSERT, CCJSizeDockBar::GetDockedSizeBar, and NULL.

00158 {
00159     if (nHitTest == HTCAPTION)
00160     {
00161         ActivateTopParent();
00162         CCJSizeDockBar * m_pSizeBar = (CCJSizeDockBar *)&m_wndDockBar;
00163
00164         if ((m_pSizeBar->m_dwStyle & CBRS_FLOAT_MULTI) == 0)
00165         {
00166             int nPos = 1;
00167             CControlBar* pBar = NULL;
00168             while(pBar == NULL && nPos < m_pSizeBar->m_arrBars.GetSize())
00169                 pBar = m_pSizeBar->GetDockedSizeBar(nPos++);
00170
00171             ASSERT(pBar != NULL);
00172             ASSERT_KINDOF(CControlBar, pBar);
00173             ASSERT(pBar->m_pDockContext != NULL);
00174
00175             if (pBar->IsKindOf(RUNTIME_CLASS(CCJControlBar)))
00176                 pBar->m_pDockContext->ToggleDocking();
00177
00178             return;
00179         }
00180     }
00181 }

void CCJMiniDockFrameWnd::OnNcLButtonDown | ( | UINT | nHitTest,
 |  | CPoint | point
 | ) | [protected]

Definition at line 99 of file CJMiniDockFrameWnd.cpp.

References ASSERT, CCJSizeDockBar::GetDockedSizeBar, and NULL.

00100 {
00101     CCJSizeDockBar *pSizeBar = (CCJSizeDockBar*)&m_wndDockBar;
00102
00103     if (nHitTest == HTCAPTION)
00104     {
00105         ActivateTopParent();
00106         if ((m_wndDockBar.m_dwStyle & CBRS_FLOAT_MULTI) == 0)
00107         {
00108             int nPos = 1;
00109             CControlBar* pBar = NULL;
00110             while(pBar == NULL && nPos < m_wndDockBar.m_arrBars.GetSize())
00111                 pBar = pSizeBar->GetDockedSizeBar(nPos++);
00112             ASSERT(pBar != NULL);
00113             ASSERT_KINDOF(CControlBar, pBar);
00114             ASSERT(pBar->m_pDockContext != NULL);
00115
00116             if (!pBar->IsKindOf(RUNTIME_CLASS(CCJControlBar))) {
00117                 CMiniDockFrameWnd::OnNcLButtonDown(nHitTest,point);
00118                 return;
00119             }
00120
00121             //Yiannhs: This has to be fixed!! when the bar is floating
00122             //         and is over a visible dockbar, it arranges it inside
00123             //         the dock bar and does not drag, by just clicking on the caption
00124             ((CCJDockContext *)pBar->m_pDockContext)->StartDragDockBar(point);
00125             pBar->SetFocus();
00126             return;
00127         }
00128     }
00129
00130     else if (nHitTest >= HTSIZEFIRST && nHitTest <= HTSIZELAST)
00131     {
00132         ActivateTopParent();
00133         int nPos = 1;
00134         CControlBar* pBar = NULL;
00135         while(pBar == NULL && nPos < m_wndDockBar.m_arrBars.GetSize())
00136             pBar = pSizeBar->GetDockedSizeBar(nPos++);
00137
00138         ASSERT(pBar != NULL);
00139         ASSERT_KINDOF(CControlBar, pBar);
00140         ASSERT(pBar->m_pDockContext != NULL);
00141         ASSERT((m_wndDockBar.m_dwStyle & CBRS_FLOAT_MULTI) == 0);
00142
00143         if (!pBar->IsKindOf(RUNTIME_CLASS(CCJControlBar))) {
00144             CMiniDockFrameWnd::OnNcLButtonDown(nHitTest,point);
00145             return;
00146         }
00147
00148         pBar->m_pDockContext->StartResize(nHitTest, point);
00149         return;
00150     }
00151
00152     else {  //Yiannhs
00153         CMiniFrameWnd::OnNcLButtonDown(nHitTest, point);
00154     }
00155 }

Friends And Related Function Documentation

friend class CDockBar [friend]

Definition at line 80 of file CJMiniDockFrameWnd.h.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJMiniDockFrameWnd.h
  • WinCvs/CJLib/CJLibrary/CJMiniDockFrameWnd.cpp
Generated on Sun Feb 24 01:24:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJMonthCalCtrl Class Reference

#include <CJDateTimeCtrl.h>

Inheritance diagram for CCJMonthCalCtrl:

[legend]
Collaboration diagram for CCJMonthCalCtrl:

[legend]
List of all members.

Public Methods

CCJMonthCalCtrl ()
virtual | ~CCJMonthCalCtrl ()
BOOL | Create (DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID)
BOOL | Create (DWORD dwStyle, const POINT &pt, CWnd *pParentWnd, UINT nID)
BOOL | GetMinReqRect (RECT *pRect) const
int | SetMonthDelta (int iDelta)
int | GetMonthDelta () const
BOOL | SetFirstDayOfWeek (int iDay, int *lpnOld=NULL)
int | GetFirstDayOfWeek (BOOL *pbLocal=NULL) const
COLORREF | GetColor (int nRegion) const
COLORREF | SetColor (int nRegion, COLORREF ref)
BOOL | SizeMinReq (BOOL bRepaint=TRUE)
void | SetToday (const COleDateTime &refDateTime)
void | SetToday (const CTime *pDateTime)
void | SetToday (const LPSYSTEMTIME pDateTime)
BOOL | GetToday (CTime &refTime) const
BOOL | GetToday (COleDateTime &refDateTime) const
BOOL | GetToday (LPSYSTEMTIME pDateTime) const
BOOL | GetCurSel (LPSYSTEMTIME pDateTime) const
BOOL | GetCurSel (CTime &refDateTime) const
BOOL | GetCurSel (COleDateTime &refDateTime) const
BOOL | SetCurSel (const LPSYSTEMTIME pDateTime)
BOOL | SetCurSel (const CTime &refDateTime)
BOOL | SetCurSel (const COleDateTime &refDateTime)
BOOL | SetDayState (int nMonths, LPMONTHDAYSTATE pStates)
BOOL | SetMaxSelCount (int nMax)
int | GetMaxSelCount () const
BOOL | SetRange (const COleDateTime *pMinRange, const COleDateTime *pMaxRange)
BOOL | SetRange (const CTime *pMinRange, const CTime *pMaxRange)
BOOL | SetRange (const LPSYSTEMTIME pMinRange, const LPSYSTEMTIME pMaxRange)
DWORD | GetRange (COleDateTime *pMinRange, COleDateTime *pMaxRange) const
DWORD | GetRange (CTime *pMinRange, CTime *pMaxRange) const
DWORD | GetRange (LPSYSTEMTIME pMinRange, LPSYSTEMTIME pMaxRange) const
int | GetMonthRange (COleDateTime &refMinRange, COleDateTime &refMaxRange, DWORD dwFlags) const
int | GetMonthRange (CTime &refMinRange, CTime &refMaxRange, DWORD dwFlags) const
int | GetMonthRange (LPSYSTEMTIME pMinRange, LPSYSTEMTIME pMaxRange, DWORD dwFlags) const
BOOL | SetSelRange (const COleDateTime &pMinRange, const COleDateTime &pMaxRange)
BOOL | SetSelRange (const CTime &pMinRange, const CTime &pMaxRange)
BOOL | SetSelRange (const LPSYSTEMTIME pMinRange, const LPSYSTEMTIME pMaxRange)
BOOL | GetSelRange (COleDateTime &refMinRange, COleDateTime &refMaxRange) const
BOOL | GetSelRange (CTime &refMinRange, CTime &refMaxRange) const
BOOL | GetSelRange (LPSYSTEMTIME pMinRange, LPSYSTEMTIME pMaxRange) const
DWORD | HitTest (PMCHITTESTINFO pMCHitTest)

Constructor & Destructor Documentation

_CJXLIB_INLINE CCJMonthCalCtrl::CCJMonthCalCtrl ( )

Definition at line 781 of file CJDateTimeCtrl.h.

00782     { }

CCJMonthCalCtrl::~CCJMonthCalCtrl ( ) [virtual]

Definition at line 659 of file CJDateTimeCtrl.cpp.

00660 {
00661     DestroyWindow();
00662 }

Member Function Documentation

BOOL CCJMonthCalCtrl::Create | ( | DWORD | dwStyle,
 |  | const POINT & | pt,
 |  | CWnd * | pParentWnd,
 |  | UINT | nID
 | ) |

Definition at line 468 of file CJDateTimeCtrl.cpp.

References Create, FALSE, SizeMinReq, and TRUE.

00470 {
00471     BOOL bWasVisible = (dwStyle & WS_VISIBLE);
00472     dwStyle &= ~WS_VISIBLE;
00473
00474     CRect rect(pt.x, pt.y, 0, 0);
00475
00476     BOOL bRetVal = FALSE;
00477    if (Create(dwStyle, rect, pParentWnd, nID))
00478     {
00479         if (SizeMinReq())
00480         {
00481             if (bWasVisible)
00482                 ShowWindow(SW_SHOWNA);
00483             bRetVal = TRUE;
00484         }
00485         else
00486             DestroyWindow();
00487     }
00488
00489     return bRetVal;
00490 }

BOOL CCJMonthCalCtrl::Create | ( | DWORD | dwStyle,
 |  | const RECT & | rect,
 |  | CWnd * | pParentWnd,
 |  | UINT | nID
 | ) |

Definition at line 451 of file CJDateTimeCtrl.cpp.

References NULL, and VERIFY.

Referenced by Create.

00453 {
00454     // initialize common controls
00455 #ifdef _VC_VERSION_5
00456     INITCOMMONCONTROLSEX icex;
00457     icex.dwSize = sizeof(icex);
00458     icex.dwICC = ICC_DATE_CLASSES;
00459     VERIFY(InitCommonControlsEx(&icex));
00460 #else
00461     VERIFY(AfxDeferRegisterClass(AFX_WNDCOMMCTL_DATE_REG));
00462 #endif
00463
00464     CWnd* pWnd = this;
00465     return pWnd->Create(MONTHCAL_CLASS, NULL, dwStyle, rect, pParentWnd, nID);
00466 }

_CJXLIB_INLINE COLORREF CCJMonthCalCtrl::GetColor ( int nRegion ) const

Definition at line 791 of file CJDateTimeCtrl.h.

References ASSERT, and NULL.

00792     { ASSERT(m_hWnd != NULL); return (COLORREF) ::SendMessage(m_hWnd, MCM_GETCOLOR, (WPARAM) nRegion, 0); }

BOOL CCJMonthCalCtrl::GetCurSel ( COleDateTime & refDateTime ) const

Definition at line 591 of file CJDateTimeCtrl.cpp.

References ASSERT.

00592 {
00593     ASSERT(::IsWindow(m_hWnd));
00594
00595     // can't use this method on multiple selection controls
00596     ASSERT(!(GetStyle() & MCS_MULTISELECT));
00597
00598     SYSTEMTIME sysTime;
00599     BOOL bResult = (BOOL)
00600         ::SendMessage(m_hWnd, MCM_GETCURSEL, 0, (LPARAM) &sysTime);
00601
00602     if (bResult)
00603         refTime = COleDateTime(sysTime);
00604
00605     return bResult;
00606 }

BOOL CCJMonthCalCtrl::GetCurSel ( CTime & refDateTime ) const

Definition at line 625 of file CJDateTimeCtrl.cpp.

References ASSERT.

00626 {
00627     ASSERT(::IsWindow(m_hWnd));
00628
00629     // can't use this method on multiple selection controls
00630     ASSERT(!(GetStyle() & MCS_MULTISELECT));
00631
00632     SYSTEMTIME sysTime;
00633     BOOL bResult = (BOOL)
00634         ::SendMessage(m_hWnd, MCM_GETCURSEL, 0, (LPARAM) &sysTime);
00635
00636     if (bResult)
00637         refTime = CTime(sysTime);
00638
00639     return bResult;
00640 }

_CJXLIB_INLINE BOOL CCJMonthCalCtrl::GetCurSel ( LPSYSTEMTIME pDateTime ) const

Definition at line 805 of file CJDateTimeCtrl.h.

References ASSERT, and NULL.

Referenced by DDX_CJMonthCalCtrl.

00806     { ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_GETCURSEL, 0, (LPARAM) pDateTime); }

int CCJMonthCalCtrl::GetFirstDayOfWeek ( BOOL * pbLocal = NULL ) const

Definition at line 664 of file CJDateTimeCtrl.cpp.

References ASSERT.

00665 {
00666     ASSERT(::IsWindow(m_hWnd));
00667     DWORD dwResult;
00668     dwResult = (DWORD) ::SendMessage(m_hWnd, MCM_GETFIRSTDAYOFWEEK, 0, 0);
00669
00670     // set *pbLocal to reflect if the first day of week
00671     // matches current locale setting
00672
00673     if (pbLocal)
00674         *pbLocal = HIWORD(dwResult);
00675     return LOWORD(dwResult);
00676 }

_CJXLIB_INLINE int CCJMonthCalCtrl::GetMaxSelCount ( ) const

Definition at line 797 of file CJDateTimeCtrl.h.

References ASSERT, and NULL.

00798     { ASSERT(m_hWnd != NULL); return (int) ::SendMessage(m_hWnd, MCM_GETMAXSELCOUNT, 0, 0); }

_CJXLIB_INLINE BOOL CCJMonthCalCtrl::GetMinReqRect ( RECT * pRect ) const

Definition at line 785 of file CJDateTimeCtrl.h.

References ASSERT, and NULL.

Referenced by SizeMinReq.

00786     { ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_GETMINREQRECT, 0, (LPARAM) pRect); }

_CJXLIB_INLINE int CCJMonthCalCtrl::GetMonthDelta ( ) const

Definition at line 789 of file CJDateTimeCtrl.h.

References ASSERT, and NULL.

00790     { ASSERT(m_hWnd != NULL); return (int) ::SendMessage(m_hWnd, MCM_GETMONTHDELTA, 0, 0); }

int CCJMonthCalCtrl::GetMonthRange | ( | LPSYSTEMTIME | pMinRange,
 |  | LPSYSTEMTIME | pMaxRange,
 |  | DWORD | dwFlags
 | ) | const

Definition at line 839 of file CJDateTimeCtrl.cpp.

References ASSERT.

00841 {
00842     ASSERT(::IsWindow(m_hWnd));
00843     ASSERT_POINTER(pMinRange, SYSTEMTIME);
00844     ASSERT_POINTER(pMaxRange, SYSTEMTIME);
00845
00846     SYSTEMTIME sysTimes[2];
00847
00848     int nCount = (int) ::SendMessage(m_hWnd, MCM_GETMONTHRANGE,
00849         (WPARAM) dwFlags, (LPARAM) &sysTimes);
00850
00851     memcpy(pMinRange, &sysTimes[0], sizeof(SYSTEMTIME));
00852     memcpy(pMaxRange, &sysTimes[1], sizeof(SYSTEMTIME));
00853
00854     return nCount;
00855 }

int CCJMonthCalCtrl::GetMonthRange | ( | CTime & | refMinRange,
 |  | CTime & | refMaxRange,
 |  | DWORD | dwFlags
 | ) | const

Definition at line 857 of file CJDateTimeCtrl.cpp.

References ASSERT.

00859 {
00860     ASSERT(::IsWindow(m_hWnd));
00861     ASSERT(dwFlags == GMR_DAYSTATE || dwFlags == GMR_VISIBLE);
00862
00863     SYSTEMTIME sysTimes[2];
00864     memset(sysTimes, 0, sizeof(sysTimes));
00865     int nCount = (int) ::SendMessage(m_hWnd, MCM_GETMONTHRANGE,
00866         (WPARAM) dwFlags,   (LPARAM) &sysTimes);
00867
00868     refMinRange = CTime(sysTimes[0]);
00869     refMaxRange = CTime(sysTimes[1]);
00870
00871     return nCount;
00872 }

int CCJMonthCalCtrl::GetMonthRange | ( | COleDateTime & | refMinRange,
 |  | COleDateTime & | refMaxRange,
 |  | DWORD | dwFlags
 | ) | const

Definition at line 822 of file CJDateTimeCtrl.cpp.

References ASSERT.

00824 {
00825     ASSERT(::IsWindow(m_hWnd));
00826     ASSERT(dwFlags == GMR_DAYSTATE || dwFlags == GMR_VISIBLE);
00827
00828     SYSTEMTIME sysTimes[2];
00829     memset(sysTimes, 0, sizeof(sysTimes));
00830     int nCount = (int) ::SendMessage(m_hWnd, MCM_GETMONTHRANGE,
00831         (WPARAM) dwFlags, (LPARAM) &sysTimes);
00832
00833     refMinRange = COleDateTime(sysTimes[0]);
00834     refMaxRange = COleDateTime(sysTimes[1]);
00835
00836     return nCount;
00837 }

DWORD CCJMonthCalCtrl::GetRange | ( | LPSYSTEMTIME | pMinRange,
 |  | LPSYSTEMTIME | pMaxRange
 | ) | const

Definition at line 767 of file CJDateTimeCtrl.cpp.

References ASSERT.

00769 {
00770     ASSERT(::IsWindow(m_hWnd));
00771
00772     SYSTEMTIME sysTimes[2];
00773     memset(sysTimes, 0, sizeof(sysTimes));
00774
00775     DWORD dwRanges = (DWORD)
00776         ::SendMessage(m_hWnd, MCM_GETRANGE, 0, (LPARAM) &sysTimes);
00777
00778     if (dwRanges & GDTR_MIN && pMinRange)
00779         memcpy(pMinRange, &sysTimes[0], sizeof(SYSTEMTIME));
00780
00781     if (dwRanges & GDTR_MAX && pMaxRange)
00782         memcpy(pMaxRange, &sysTimes[1], sizeof(SYSTEMTIME));
00783
00784     return dwRanges;
00785 }

DWORD CCJMonthCalCtrl::GetRange | ( | CTime * | pMinRange,
 |  | CTime * | pMaxRange
 | ) | const

Definition at line 803 of file CJDateTimeCtrl.cpp.

References ASSERT.

00804 {
00805     ASSERT(::IsWindow(m_hWnd));
00806
00807     SYSTEMTIME sysTimes[2];
00808     memset(sysTimes, 0, sizeof(sysTimes));
00809
00810     DWORD dwRanges = (DWORD)
00811         ::SendMessage(m_hWnd, MCM_GETRANGE, 0, (LPARAM) &sysTimes);
00812
00813     if (dwRanges & GDTR_MIN && pMinRange)
00814         *pMinRange = CTime(sysTimes[0]);
00815
00816     if (dwRanges & GDTR_MAX && pMaxRange)
00817         *pMaxRange = CTime(sysTimes[1]);
00818
00819     return dwRanges;
00820 }

DWORD CCJMonthCalCtrl::GetRange | ( | COleDateTime * | pMinRange,
 |  | COleDateTime * | pMaxRange
 | ) | const

Definition at line 747 of file CJDateTimeCtrl.cpp.

References ASSERT.

00749 {
00750     ASSERT(::IsWindow(m_hWnd));
00751
00752     SYSTEMTIME sysTimes[2];
00753     memset(sysTimes, 0, sizeof(sysTimes));
00754
00755     DWORD dwRanges = (DWORD)
00756         ::SendMessage(m_hWnd, MCM_GETRANGE, 0, (LPARAM) &sysTimes);
00757
00758     if (dwRanges & GDTR_MIN && pMinRange)
00759         *pMinRange = COleDateTime(sysTimes[0]);
00760
00761     if (dwRanges & GDTR_MAX && pMaxRange)
00762         *pMaxRange = COleDateTime(sysTimes[1]);
00763
00764     return dwRanges;
00765 }

BOOL CCJMonthCalCtrl::GetSelRange | ( | LPSYSTEMTIME | pMinRange,
 |  | LPSYSTEMTIME | pMaxRange
 | ) | const

Definition at line 874 of file CJDateTimeCtrl.cpp.

References ASSERT, and NULL.

00876 {
00877     ASSERT(m_hWnd != NULL);
00878     ASSERT((GetStyle() & MCS_MULTISELECT));
00879
00880     ASSERT_POINTER(pMinRange, SYSTEMTIME);
00881     ASSERT_POINTER(pMaxRange, SYSTEMTIME);
00882
00883     SYSTEMTIME sysTimes[2];
00884     BOOL bReturn = (BOOL) ::SendMessage(m_hWnd, MCM_GETSELRANGE,
00885                                         0, (LPARAM) &sysTimes);
00886
00887     if (bReturn)
00888     {
00889         memcpy(pMinRange, &sysTimes[0], sizeof(SYSTEMTIME));
00890         memcpy(pMaxRange, &sysTimes[1], sizeof(SYSTEMTIME));
00891     }
00892
00893     return bReturn;
00894 }

BOOL CCJMonthCalCtrl::GetSelRange | ( | CTime & | refMinRange,
 |  | CTime & | refMaxRange
 | ) | const

Definition at line 977 of file CJDateTimeCtrl.cpp.

References ASSERT.

00978 {
00979     // control must have multiple select
00980     ASSERT((GetStyle() & MCS_MULTISELECT));
00981     ASSERT(::IsWindow(m_hWnd));
00982
00983     SYSTEMTIME sysTimes[2];
00984     memset(sysTimes, 0, sizeof(sysTimes));
00985     BOOL bResult = (BOOL)
00986         ::SendMessage(m_hWnd, MCM_GETSELRANGE, 0, (LPARAM) &sysTimes);
00987
00988     if (bResult)
00989     {
00990         refMinRange = CTime(sysTimes[0]);
00991         refMaxRange = CTime(sysTimes[1]);
00992     }
00993     return bResult;
00994 }

BOOL CCJMonthCalCtrl::GetSelRange | ( | COleDateTime & | refMinRange,
 |  | COleDateTime & | refMaxRange
 | ) | const

Definition at line 937 of file CJDateTimeCtrl.cpp.

References ASSERT.

00939 {
00940     // control must have multiple select
00941     ASSERT((GetStyle() & MCS_MULTISELECT));
00942     ASSERT(::IsWindow(m_hWnd));
00943
00944     SYSTEMTIME sysTimes[2];
00945     memset(sysTimes, 0, sizeof(sysTimes));
00946     BOOL bResult = (BOOL)
00947         ::SendMessage(m_hWnd, MCM_GETSELRANGE, 0, (LPARAM) &sysTimes);
00948
00949     if (bResult)
00950     {
00951         refMinRange = COleDateTime(sysTimes[0]);
00952         refMaxRange = COleDateTime(sysTimes[1]);
00953     }
00954     return bResult;
00955 }

_CJXLIB_INLINE BOOL CCJMonthCalCtrl::GetToday ( LPSYSTEMTIME pDateTime ) const

Definition at line 801 of file CJDateTimeCtrl.h.

References ASSERT, and NULL.

00802     { ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_GETTODAY, 0, (LPARAM) pDateTime); }

BOOL CCJMonthCalCtrl::GetToday ( COleDateTime & refDateTime ) const

Definition at line 608 of file CJDateTimeCtrl.cpp.

References ASSERT.

00609 {
00610     ASSERT(::IsWindow(m_hWnd));
00611
00612     // can't use this method on multiple selection controls
00613     ASSERT(!(GetStyle() & MCS_MULTISELECT));
00614
00615     SYSTEMTIME sysTime;
00616     BOOL bResult = (BOOL)
00617         ::SendMessage(m_hWnd, MCM_GETTODAY, 0, (LPARAM) &sysTime);
00618
00619     if (bResult)
00620         refTime = COleDateTime(sysTime);
00621
00622     return bResult;
00623 }

BOOL CCJMonthCalCtrl::GetToday ( CTime & refTime ) const

Definition at line 642 of file CJDateTimeCtrl.cpp.

References ASSERT.

00643 {
00644     ASSERT(::IsWindow(m_hWnd));
00645
00646     // can't use this method on multiple selection controls
00647     ASSERT(!(GetStyle() & MCS_MULTISELECT));
00648
00649     SYSTEMTIME sysTime;
00650     BOOL bResult = (BOOL)
00651         ::SendMessage(m_hWnd, MCM_GETTODAY, 0, (LPARAM) &sysTime);
00652
00653     if (bResult)
00654         refTime = CTime(sysTime);
00655
00656     return bResult;
00657 }

_CJXLIB_INLINE DWORD CCJMonthCalCtrl::HitTest ( PMCHITTESTINFO pMCHitTest )

Definition at line 783 of file CJDateTimeCtrl.h.

References ASSERT.

00784     { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, MCM_HITTEST, 0, (LPARAM) pMCHitTest); }

_CJXLIB_INLINE COLORREF CCJMonthCalCtrl::SetColor | ( | int | nRegion,
 |  | COLORREF | ref
 | ) |

Definition at line 793 of file CJDateTimeCtrl.h.

References ASSERT, and NULL.

00794     { ASSERT(m_hWnd != NULL); return (COLORREF) ::SendMessage(m_hWnd, MCM_SETCOLOR, (WPARAM) nRegion, (LPARAM) ref); }

BOOL CCJMonthCalCtrl::SetCurSel ( const COleDateTime & refDateTime )

Definition at line 555 of file CJDateTimeCtrl.cpp.

References ASSERT, FALSE, and GetAsSystemTime.

00556 {
00557     ASSERT(::IsWindow(m_hWnd));
00558
00559     SYSTEMTIME sysTime;
00560     BOOL bRetVal = FALSE;
00561
00562     // if the passed time is null or out of range,
00563     // we'll set the control to NULL
00564
00565     if (GetAsSystemTime(refTime, sysTime) &&
00566         refTime.GetStatus() == COleDateTime::valid)
00567     {
00568         bRetVal = (BOOL)
00569             ::SendMessage(m_hWnd, MCM_SETCURSEL, 0, (LPARAM) &sysTime);
00570     }
00571
00572     return bRetVal;
00573 }

BOOL CCJMonthCalCtrl::SetCurSel ( const CTime & refDateTime )

Definition at line 575 of file CJDateTimeCtrl.cpp.

References ASSERT, FALSE, and GetAsSystemTime.

00576 {
00577     ASSERT(::IsWindow(m_hWnd));
00578
00579     SYSTEMTIME sysTime;
00580     BOOL bRetVal = FALSE;
00581
00582     if (GetAsSystemTime(refTime, sysTime))
00583     {
00584         bRetVal = (BOOL)
00585             ::SendMessage(m_hWnd, MCM_SETCURSEL, 0, (LPARAM) &sysTime);
00586     }
00587
00588     return bRetVal;
00589 }

_CJXLIB_INLINE BOOL CCJMonthCalCtrl::SetCurSel ( const LPSYSTEMTIME pDateTime )

Definition at line 803 of file CJDateTimeCtrl.h.

References ASSERT, and NULL.

Referenced by DDX_CJMonthCalCtrl.

00804     { ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_SETCURSEL, 0, (LPARAM) pDateTime); }

BOOL CCJMonthCalCtrl::SetDayState | ( | int | nMonths,
 |  | LPMONTHDAYSTATE | pStates
 | ) |

Definition at line 690 of file CJDateTimeCtrl.cpp.

References ASSERT, and FALSE.

00691 {
00692     ASSERT(::IsWindow(m_hWnd));
00693     ASSERT(AfxIsValidAddress(pStates, nMonths * sizeof(MONTHDAYSTATE), FALSE));
00694     return (BOOL) ::SendMessage(m_hWnd, MCM_SETDAYSTATE, (WPARAM) nMonths, (LPARAM) pStates);
00695 }

BOOL CCJMonthCalCtrl::SetFirstDayOfWeek | ( | int | iDay,
 |  | int * | lpnOld = NULL
 | ) |

Definition at line 678 of file CJDateTimeCtrl.cpp.

References ASSERT, and NULL.

00679 {
00680     ASSERT(::IsWindow(m_hWnd));
00681     DWORD dwResult;
00682     dwResult = (DWORD) ::SendMessage(m_hWnd, MCM_SETFIRSTDAYOFWEEK, 0, (WPARAM) iDay);
00683
00684     if (lpnOld != NULL)
00685         *lpnOld = LOWORD(dwResult);
00686
00687     return (BOOL) HIWORD(dwResult);
00688 }

_CJXLIB_INLINE BOOL CCJMonthCalCtrl::SetMaxSelCount ( int nMax )

Definition at line 795 of file CJDateTimeCtrl.h.

References ASSERT, and NULL.

00796     { ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_SETMAXSELCOUNT, nMax, 0); }

_CJXLIB_INLINE int CCJMonthCalCtrl::SetMonthDelta ( int iDelta )

Definition at line 787 of file CJDateTimeCtrl.h.

References ASSERT, and NULL.

00788     { ASSERT(m_hWnd != NULL); return (int) ::SendMessage(m_hWnd, MCM_SETMONTHDELTA, (WPARAM) iDelta, 0); }

BOOL CCJMonthCalCtrl::SetRange | ( | const LPSYSTEMTIME | pMinRange,
 |  | const LPSYSTEMTIME | pMaxRange
 | ) |

Definition at line 723 of file CJDateTimeCtrl.cpp.

References ASSERT, and NULL.

00725 {
00726     ASSERT(::IsWindow(m_hWnd));
00727
00728     SYSTEMTIME sysTimes[2];
00729     WPARAM wFlags = 0;
00730
00731     if (pMinRange != NULL)
00732     {
00733         memcpy(&sysTimes[0], pMinRange, sizeof(SYSTEMTIME));
00734         wFlags |= GDTR_MIN;
00735     }
00736
00737     if (pMaxRange != NULL)
00738     {
00739         memcpy(&sysTimes[1], pMaxRange, sizeof(SYSTEMTIME));
00740         wFlags |= GDTR_MAX;
00741     }
00742
00743     return (BOOL)
00744         ::SendMessage(m_hWnd, MCM_SETRANGE, wFlags, (LPARAM) &sysTimes);
00745 }

BOOL CCJMonthCalCtrl::SetRange | ( | const CTime * | pMinRange,
 |  | const CTime * | pMaxRange
 | ) |

Definition at line 787 of file CJDateTimeCtrl.cpp.

References ASSERT, GetAsSystemTime, and NULL.

00788 {
00789     ASSERT(::IsWindow(m_hWnd));
00790
00791     SYSTEMTIME sysTimes[2];
00792     WPARAM wFlags = 0;
00793     if (pMinRange != NULL && GetAsSystemTime(pMinRange, sysTimes[0]))
00794         wFlags |= GDTR_MIN;
00795
00796     if (pMaxRange != NULL && GetAsSystemTime(pMaxRange, sysTimes[1]))
00797         wFlags |= GDTR_MAX;
00798
00799     return (BOOL)
00800         ::SendMessage(m_hWnd, MCM_SETRANGE, wFlags, (LPARAM) &sysTimes);
00801 }

BOOL CCJMonthCalCtrl::SetRange | ( | const COleDateTime * | pMinRange,
 |  | const COleDateTime * | pMaxRange
 | ) |

Definition at line 697 of file CJDateTimeCtrl.cpp.

References ASSERT, GetAsSystemTime, and NULL.

Referenced by DDV_CJMinMaxMonth.

00699 {
00700     ASSERT(::IsWindow(m_hWnd));
00701     ASSERT(pMinRange == NULL || pMinRange->GetStatus() != COleDateTime::invalid);
00702     ASSERT(pMaxRange == NULL || pMaxRange->GetStatus() != COleDateTime::invalid);
00703
00704     SYSTEMTIME sysTimes[2];
00705     WPARAM wFlags = 0;
00706
00707     if (pMinRange != NULL && pMinRange->GetStatus() != COleDateTime::null)
00708     {
00709         if (GetAsSystemTime(pMinRange, sysTimes[0]))
00710             wFlags |= GDTR_MIN;
00711     }
00712
00713     if (pMaxRange != NULL && pMaxRange->GetStatus() != COleDateTime::null)
00714     {
00715         if (GetAsSystemTime(pMaxRange, sysTimes[1]))
00716             wFlags |= GDTR_MAX;
00717     }
00718
00719     return (BOOL)
00720         ::SendMessage(m_hWnd, MCM_SETRANGE, wFlags, (LPARAM) &sysTimes);
00721 }

BOOL CCJMonthCalCtrl::SetSelRange | ( | const LPSYSTEMTIME | pMinRange,
 |  | const LPSYSTEMTIME | pMaxRange
 | ) |

Definition at line 896 of file CJDateTimeCtrl.cpp.

References ASSERT, and NULL.

00898 {
00899     ASSERT(m_hWnd != NULL);
00900     ASSERT((GetStyle() & MCS_MULTISELECT));
00901
00902     ASSERT_POINTER(pMinRange, SYSTEMTIME);
00903     ASSERT_POINTER(pMaxRange, SYSTEMTIME);
00904
00905     SYSTEMTIME sysTimes[2];
00906     memcpy(&sysTimes[0], pMinRange, sizeof(SYSTEMTIME));
00907     memcpy(&sysTimes[1], pMaxRange, sizeof(SYSTEMTIME));
00908
00909     return (BOOL) ::SendMessage(m_hWnd, MCM_SETSELRANGE,
00910         0, (LPARAM) &sysTimes);
00911 }

BOOL CCJMonthCalCtrl::SetSelRange | ( | const CTime & | pMinRange,
 |  | const CTime & | pMaxRange
 | ) |

Definition at line 957 of file CJDateTimeCtrl.cpp.

References ASSERT, FALSE, and GetAsSystemTime.

00959 {
00960     // control must have multiple select
00961     ASSERT((GetStyle() & MCS_MULTISELECT));
00962     ASSERT(::IsWindow(m_hWnd));
00963
00964     SYSTEMTIME sysTimes[2];
00965     BOOL bResult = FALSE;
00966
00967     if (GetAsSystemTime(refMinRange, sysTimes[0]) &&
00968         GetAsSystemTime(refMaxRange, sysTimes[1]))
00969     {
00970         bResult = (BOOL)
00971             ::SendMessage(m_hWnd, MCM_SETSELRANGE, 0, (LPARAM)sysTimes);
00972     }
00973
00974     return bResult;
00975 }

BOOL CCJMonthCalCtrl::SetSelRange | ( | const COleDateTime & | pMinRange,
 |  | const COleDateTime & | pMaxRange
 | ) |

Definition at line 913 of file CJDateTimeCtrl.cpp.

References ASSERT, FALSE, and GetAsSystemTime.

00915 {
00916     // control must have multiple select
00917     ASSERT((GetStyle() & MCS_MULTISELECT));
00918     ASSERT(::IsWindow(m_hWnd));
00919
00920     SYSTEMTIME sysTimes[2];
00921     BOOL bResult = FALSE;
00922
00923     if (refMinRange.GetStatus() == COleDateTime::valid &&
00924         refMinRange.GetStatus() == COleDateTime::valid)
00925     {
00926         if (GetAsSystemTime(refMinRange, sysTimes[0]) &&
00927             GetAsSystemTime(refMaxRange, sysTimes[1]))
00928         {
00929             bResult = (BOOL)
00930                 ::SendMessage(m_hWnd, MCM_SETSELRANGE, 0, (LPARAM)sysTimes);
00931         }
00932     }
00933
00934     return bResult;
00935 }

_CJXLIB_INLINE void CCJMonthCalCtrl::SetToday ( const LPSYSTEMTIME pDateTime )

Definition at line 799 of file CJDateTimeCtrl.h.

References ASSERT, and NULL.

00800     { ASSERT(m_hWnd != NULL); ::SendMessage(m_hWnd, MCM_SETTODAY, 0, (LPARAM) pDateTime); }

void CCJMonthCalCtrl::SetToday ( const CTime * pDateTime )

Definition at line 533 of file CJDateTimeCtrl.cpp.

References ASSERT, GetAsSystemTime, and NULL.

00534 {
00535     ASSERT(::IsWindow(m_hWnd));
00536     ASSERT_VALID(this);
00537
00538     // if the passed time is NULL, we'll set the
00539     // control to NULL
00540
00541     WPARAM wParam = GDT_NONE;
00542     LPSYSTEMTIME pSysTime = NULL;
00543     SYSTEMTIME sysTime;
00544
00545     if (pDateTime != NULL && GetAsSystemTime(pDateTime, sysTime))
00546     {
00547         wParam = GDT_VALID;
00548         pSysTime = &sysTime;
00549     }
00550
00551     if (::IsWindow(m_hWnd))
00552         ::SendMessage(m_hWnd, MCM_SETTODAY, wParam, (LPARAM) pSysTime);
00553 }

void CCJMonthCalCtrl::SetToday ( const COleDateTime & refDateTime )

Definition at line 508 of file CJDateTimeCtrl.cpp.

References ASSERT, GetAsSystemTime, and NULL.

00509 {
00510     ASSERT_VALID(this);
00511
00512     // make sure the time isn't invalid
00513     ASSERT(refTime.GetStatus() != COleDateTime::invalid);
00514     ASSERT(::IsWindow(m_hWnd));
00515
00516     SYSTEMTIME sysTime;
00517     LPSYSTEMTIME pSysTime = NULL;
00518     WPARAM wParam = GDT_NONE;
00519
00520     // if the passed time is null or out of range,
00521     // we'll set the control to NULL
00522
00523     if (GetAsSystemTime(refTime, sysTime))
00524     {
00525         pSysTime = &sysTime;
00526         wParam = GDT_VALID;
00527     }
00528
00529     if (::IsWindow(m_hWnd))
00530         ::SendMessage(m_hWnd, MCM_SETTODAY, wParam, (LPARAM) pSysTime);
00531 }

BOOL CCJMonthCalCtrl::SizeMinReq ( BOOL bRepaint = TRUE )

Definition at line 492 of file CJDateTimeCtrl.cpp.

References FALSE, GetMinReqRect, NULL, and TRUE.

Referenced by Create.

00493 {
00494     CRect rect;
00495     BOOL bRetVal = FALSE;
00496     if (GetMinReqRect(rect))
00497     {
00498         DWORD dwFlags = SWP_NOZORDER | SWP_NOREPOSITION | SWP_NOMOVE | SWP_NOACTIVATE;
00499         if (!bRepaint)
00500             dwFlags |= SWP_NOREDRAW;
00501         SetWindowPos(NULL, 0, 0, rect.Width(), rect.Height(), dwFlags);
00502         bRetVal = TRUE;
00503     }
00504
00505     return bRetVal;
00506 }

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJDateTimeCtrl.h
  • WinCvs/CJLib/CJLibrary/CJDateTimeCtrl.cpp
Generated on Sun Feb 24 01:24:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJOutlookBar Class Reference

#include <CJOutlookBar.h>

Inheritance diagram for CCJOutlookBar:

[legend]
Collaboration diagram for CCJOutlookBar:

[legend]
List of all members.

Public Methods

CCJOutlookBar ()
virtual | ~CCJOutlookBar ()
virtual void | SetImageLists (CImageList *pImageListSmall=NULL, CImageList *pImageListLarge=NULL)
virtual void | SetItems (CContentItems *pItems, int nNumItems)
virtual void | SetOwner (CWnd *pWnd)
virtual void | UpdateFont ()
virtual void | DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct)
virtual void | MeasureItem (LPMEASUREITEMSTRUCT lpMeasureItemStruct)

Protected Methods

afx_msg BOOL | OnEraseBkgnd (CDC *pDC)
afx_msg void | OnLButtonDown (UINT nFlags, CPoint point)
afx_msg void | OnLButtonUp (UINT nFlags, CPoint point)
afx_msg void | OnMouseMove (UINT nFlags, CPoint point)
afx_msg void | OnTimer (UINT nIDEvent)
afx_msg void | OnPaint ()
afx_msg void | OnSysColorChange ()

Protected Attributes

CWnd * m_pOwner
CPoint | m_point
CImageList * | m_pImageListLarge
CImageList * | m_pImageListSmall
CContentItems * m_pContents
int | m_nNumItems
int | m_nIndex
bool | m_bHilight
bool | m_bLBDown
CFont | m_Font
COLORREF | m_clrHilite
COLORREF | m_clrShadow
COLORREF | m_clrDkShad
COLORREF | m_clrNormal
COLORREF | m_clrTextNm

Constructor & Destructor Documentation

CCJOutlookBar::CCJOutlookBar ( )

Definition at line 84 of file CJOutlookBar.cpp.

References NULL, and UpdateFont.

00085 {
00086     m_bLBDown           = false;
00087     m_bHilight          = true;
00088     m_pImageListLarge   = NULL;
00089     m_pImageListSmall   = NULL;
00090     m_pOwner            = NULL;
00091     m_clrHilite         = ::GetSysColor(COLOR_BTNHIGHLIGHT);
00092     m_clrShadow         = ::GetSysColor(COLOR_BTNSHADOW);
00093     m_clrDkShad         = ::GetSysColor(COLOR_3DDKSHADOW);
00094     m_clrNormal         = ::GetSysColor(COLOR_BTNFACE);
00095     m_clrTextNm         = ::GetSysColor(COLOR_WINDOW);
00096
00097     UpdateFont();
00098 }

CCJOutlookBar::~CCJOutlookBar ( ) [virtual]

Definition at line 100 of file CJOutlookBar.cpp.

References m_Font.

00101 {
00102     // fix potential resource leak - KStowell - 10-22-99.
00103     m_Font.DeleteObject();
00104 }

Member Function Documentation

void CCJOutlookBar::DrawItem ( LPDRAWITEMSTRUCT lpDrawItemStruct ) [virtual]

Definition at line 194 of file CJOutlookBar.cpp.

References CContentItems::GetImageID, CContentItems::GetText, m_clrDkShad, m_clrNormal, m_clrShadow, m_clrTextNm, m_Font, m_pContents, and m_pImageListLarge.

00195 {
00196     CDC*            pDC = CDC::FromHandle( lpDrawItemStruct->hDC );
00197     CRect           rcItem(lpDrawItemStruct->rcItem);
00198     CRect           rClient(rcItem);
00199     CRect           rText;
00200     CPoint          Pt(((rcItem.Width() - 32) /2 ), rcItem.top + 15);
00201     CContentItems   pContents = m_pContents[ lpDrawItemStruct->itemID ];
00202     HICON           hIcon = m_pImageListLarge->ExtractIcon( pContents.GetImageID());
00203
00204     pDC->SetBkColor(m_clrShadow);
00205
00206     // deflate the client rect, and set up item and
00207     // text rect's.
00208     rClient.DeflateRect( 8, 5 );
00209     rcItem.CopyRect( rClient );
00210     rText.CopyRect( rClient );
00211     rText.top += 45;
00212     rText.bottom += 10;
00213
00214     // set the text color to white, and background mode
00215     // to transparent.
00216     pDC->SetTextColor( m_clrTextNm );
00217     pDC->SetBkMode( TRANSPARENT );
00218     CFont* pOldFont = pDC->SelectObject(&m_Font);
00219
00220     // draw the button icon and text.
00221     if( lpDrawItemStruct->itemAction& ODA_DRAWENTIRE ) {
00222         pDC->DrawIcon( Pt, hIcon );
00223         pDC->DrawText( pContents.GetText(), rText, DT_CENTER | DT_WORDBREAK );
00224     }
00225
00226     // if the left mouse button is pressed, offset
00227     // the button icon.
00228     if( m_bLBDown ) {
00229         Pt.x += 2;
00230         Pt.y += 2;
00231         rcItem.OffsetRect( 2, 2 );
00232     }
00233
00234     // deflate the button rect, and move up.
00235     rcItem.DeflateRect( 4, 16 );
00236     rcItem.top -= 8;
00237
00238     // Draw the button icon and text, if the mouse is over the
00239     // button, draw the 3d rect, either pressed,
00240     // or not pressed depending on left mouse button.
00241     if(( lpDrawItemStruct->itemState& ODS_SELECTED ) &&
00242         ( lpDrawItemStruct->itemAction& ( ODA_SELECT | ODA_DRAWENTIRE ))) {
00243
00244         rcItem.left = ( rcItem.Width()/2 )-5;
00245         rcItem.right = rcItem.left+37;
00246
00247         if( m_bHilight ) {
00248             if( m_bLBDown ) {
00249               pDC->Draw3dRect( rcItem, m_clrDkShad, m_clrNormal );
00250             } else {
00251               pDC->Draw3dRect( rcItem, m_clrNormal, m_clrDkShad );
00252             }
00253         }
00254
00255         pDC->DrawIcon( Pt, hIcon );
00256         pDC->DrawText( pContents.GetText(), rText, DT_CENTER | DT_WORDBREAK );
00257     }
00258
00259     if( !( lpDrawItemStruct->itemState& ODS_SELECTED ) &&
00260         ( lpDrawItemStruct->itemAction& ODA_SELECT )) {
00261         pDC->FillSolidRect( rClient, m_clrShadow );
00262         pDC->DrawIcon(Pt, hIcon);
00263         pDC->DrawText(pContents.GetText(), rText, DT_CENTER|DT_WORDBREAK);
00264     }
00265
00266     // To avoid ugly resource leaks that will
00267     // eventually TRASH the system, call DestroyIcon().
00268     // To reproduce bug, try resizing the window for a
00269     // good minute. Christopher Brown
00270
00271     ::DestroyIcon( hIcon );
00272     pDC->SelectObject(pOldFont);
00273 }

void CCJOutlookBar::MeasureItem ( LPMEASUREITEMSTRUCT lpMeasureItemStruct ) [virtual]

Definition at line 278 of file CJOutlookBar.cpp.

00279 {
00280     lpMeasureItemStruct->itemHeight = 70;
00281 }

BOOL CCJOutlookBar::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 286 of file CJOutlookBar.cpp.

References TRUE.

00287 {
00288     // KStowell - overridden for flicker-free drawing.
00289     UNUSED_ALWAYS(pDC);
00290     return TRUE;
00291 }

void CCJOutlookBar::OnLButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 132 of file CJOutlookBar.cpp.

References m_bLBDown.

00133 {
00134     m_bLBDown = true;
00135     SetCurSel(GetCurSel());
00136     CListBox::OnLButtonDown(nFlags, point);
00137 }

void CCJOutlookBar::OnLButtonUp | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 140 of file CJOutlookBar.cpp.

References ASSERT, m_bLBDown, m_pOwner, and OBN_SELENDOK.

00141 {
00142     m_bLBDown = false;
00143     int nIndex = GetCurSel();
00144     SetCurSel(nIndex);
00145
00146     ASSERT(m_pOwner);
00147     m_pOwner->SendMessage(OBN_SELENDOK, (LPARAM)nIndex, (WPARAM)GetDlgCtrlID());
00148
00149     CListBox::OnLButtonUp(nFlags, point);
00150 }

void CCJOutlookBar::OnMouseMove | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 124 of file CJOutlookBar.cpp.

References m_point, and NULL.

00125 {
00126     m_point = point;
00127     SetTimer (1, 10, NULL);
00128     CListBox::OnMouseMove(nFlags, point);
00129 }

void CCJOutlookBar::OnPaint ( ) [protected]

Definition at line 293 of file CJOutlookBar.cpp.

References m_clrShadow.

00294 {
00295     // Christopher Brown
00296     // Use a "Offscreen" DC to fill rect and
00297     // send to DefWindowProc...
00298     CClientDC memDC(this); // Henrik E. Rasmussen
00299
00300     CRect rcClip;
00301     memDC.GetClipBox(&rcClip);
00302     memDC.FillSolidRect(rcClip, m_clrShadow);
00303     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, (LPARAM)0 );
00304
00305     // Default is called for cleanup.
00306     Default();
00307 }

void CCJOutlookBar::OnSysColorChange ( ) [protected]

Definition at line 318 of file CJOutlookBar.cpp.

References m_clrDkShad, m_clrHilite, m_clrNormal, m_clrShadow, and m_clrTextNm.

00319 {
00320     CListBox::OnSysColorChange();
00321
00322     m_clrHilite = ::GetSysColor(COLOR_BTNHIGHLIGHT);
00323     m_clrShadow = ::GetSysColor(COLOR_BTNSHADOW);
00324     m_clrDkShad = ::GetSysColor(COLOR_3DDKSHADOW);
00325     m_clrNormal = ::GetSysColor(COLOR_BTNFACE);
00326     m_clrTextNm = ::GetSysColor(COLOR_WINDOW);
00327 }

void CCJOutlookBar::OnTimer ( UINT nIDEvent ) [protected]

Definition at line 153 of file CJOutlookBar.cpp.

References m_bHilight, m_bLBDown, and m_point.

00154 {
00155     BOOL   bOutSide;
00156     CRect  rItem;
00157     CRect  rWindow;
00158     CPoint pt;
00159     int    nIndex;
00160
00161     // Get the rect of the current window,
00162     // get the current cursor position.
00163     GetWindowRect (rWindow);
00164     GetCursorPos (&pt);
00165
00166     // If the mouse is in the rect of this window,
00167     // set hilite flag to true, get the item that
00168     // the mouse is over.
00169     if (rWindow.PtInRect (pt)) {
00170         m_bHilight = true;
00171         nIndex = ItemFromPoint (m_point, bOutSide);
00172
00173         if (nIndex != GetCurSel() && !bOutSide) {
00174             SetCurSel( nIndex );
00175         }
00176     }
00177
00178     // If the mouse is not in the rect of
00179     // this window, kill the timer, set hilite flag
00180     // to false, and return.
00181     else {
00182         m_bHilight = false;
00183         if( !m_bLBDown ) {
00184           SetCurSel (-1);
00185         }
00186         KillTimer(1);
00187     }
00188 }

_CJXLIB_INLINE void CCJOutlookBar::SetImageLists | ( | CImageList * | pImageListSmall = NULL,
 |  | CImageList * | pImageListLarge = NULL
 | ) | [virtual]

Definition at line 210 of file CJOutlookBar.h.

References m_pImageListLarge, and m_pImageListSmall.

00211     { m_pImageListLarge = pImageListLarge; m_pImageListSmall = pImageListSmall; }

_CJXLIB_INLINE void CCJOutlookBar::SetItems | ( | CContentItems * | pItems,
 |  | int | nNumItems
 | ) | [virtual]

Definition at line 213 of file CJOutlookBar.h.

References m_nNumItems, and m_pContents.

00214     { m_pContents = pItems; m_nNumItems = nNumItems; ResetContent(); for (int i = 0; i < nNumItems; ++i) AddString(m_pContents[i].GetText()); }

_CJXLIB_INLINE void CCJOutlookBar::SetOwner ( CWnd * pWnd ) [virtual]

Definition at line 216 of file CJOutlookBar.h.

References m_pOwner.

00217     { m_pOwner = pWnd; }

void CCJOutlookBar::UpdateFont ( ) [virtual]

Definition at line 309 of file CJOutlookBar.cpp.

References m_Font, and VERIFY.

Referenced by CCJOutlookBar.

00310 {
00311     m_Font.DeleteObject();
00312     NONCLIENTMETRICS ncm;
00313     ncm.cbSize = sizeof(ncm);
00314     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00315     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00316 }

Member Data Documentation

bool CCJOutlookBar::m_bHilight [protected]

Definition at line 139 of file CJOutlookBar.h.

Referenced by OnTimer.

bool CCJOutlookBar::m_bLBDown [protected]

Definition at line 140 of file CJOutlookBar.h.

Referenced by OnLButtonDown, OnLButtonUp, and OnTimer.

COLORREF CCJOutlookBar::m_clrDkShad [protected]

Definition at line 144 of file CJOutlookBar.h.

Referenced by DrawItem, and OnSysColorChange.

COLORREF CCJOutlookBar::m_clrHilite [protected]

Definition at line 142 of file CJOutlookBar.h.

Referenced by OnSysColorChange.

COLORREF CCJOutlookBar::m_clrNormal [protected]

Definition at line 145 of file CJOutlookBar.h.

Referenced by DrawItem, and OnSysColorChange.

COLORREF CCJOutlookBar::m_clrShadow [protected]

Definition at line 143 of file CJOutlookBar.h.

Referenced by DrawItem, OnPaint, and OnSysColorChange.

COLORREF CCJOutlookBar::m_clrTextNm [protected]

Definition at line 146 of file CJOutlookBar.h.

Referenced by DrawItem, and OnSysColorChange.

CFont CCJOutlookBar::m_Font [protected]

Definition at line 141 of file CJOutlookBar.h.

Referenced by DrawItem, UpdateFont, and ~CCJOutlookBar.

int CCJOutlookBar::m_nIndex [protected]

Definition at line 138 of file CJOutlookBar.h.

int CCJOutlookBar::m_nNumItems [protected]

Definition at line 137 of file CJOutlookBar.h.

Referenced by SetItems.

CContentItems* CCJOutlookBar::m_pContents [protected]

Definition at line 136 of file CJOutlookBar.h.

Referenced by DrawItem, and SetItems.

CImageList* CCJOutlookBar::m_pImageListLarge [protected]

Definition at line 134 of file CJOutlookBar.h.

Referenced by DrawItem, and SetImageLists.

CImageList* CCJOutlookBar::m_pImageListSmall [protected]

Definition at line 135 of file CJOutlookBar.h.

Referenced by SetImageLists.

CPoint CCJOutlookBar::m_point [protected]

Definition at line 133 of file CJOutlookBar.h.

Referenced by OnMouseMove, and OnTimer.

CWnd* CCJOutlookBar::m_pOwner [protected]

Definition at line 132 of file CJOutlookBar.h.

Referenced by OnLButtonUp, and SetOwner.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJOutlookBar.h
  • WinCvs/CJLib/CJLibrary/CJOutlookBar.cpp
Generated on Sun Feb 24 01:25:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJPagerCtrl Class Reference

#include <CJPagerCtrl.h>

Inheritance diagram for CCJPagerCtrl:

[legend]
Collaboration diagram for CCJPagerCtrl:

[legend]
List of all members.

Public Methods

CCJPagerCtrl ()
virtual | ~CCJPagerCtrl ()
void | SetScrollArea (int nWidth, int nHeight)
void | SetChild (HWND hwndChild)
void | RecalcSize ()
void | ForwardMouse (BOOL bForward)
COLORREF | SetBkColor (COLORREF clr)
COLORREF | GetBkColor ()
int | SetBorder (int iBorder)
int | GetBorder ()
int | SetPos (int iPos)
int | GetPos ()
int | SetButtonSize (int iSize)
int | GetButtonSize ()
DWORD | GetButtonState (int iButton)
void | GetDropTarget (IDropTarget **ppdt)
virtual BOOL | Create (DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID)

Protected Methods

virtual BOOL | OnPagerScroll (NMPGSCROLL *pNMPGScroll, LRESULT *pResult)
virtual BOOL | OnPagerCalcSize (NMPGCALCSIZE *pNMPGCalcSize, LRESULT *pResult)

Protected Attributes

int | m_nWidth
int | m_nHeight

Constructor & Destructor Documentation

CCJPagerCtrl::CCJPagerCtrl ( )

Definition at line 62 of file CJPagerCtrl.cpp.

References VERIFY.

00063 {
00064    // initialize common controls
00065     INITCOMMONCONTROLSEX icex;
00066     icex.dwSize = sizeof(icex);
00067     icex.dwICC = ICC_PAGESCROLLER_CLASS;
00068     VERIFY(InitCommonControlsEx(&icex));
00069 }

CCJPagerCtrl::~CCJPagerCtrl ( ) [virtual]

Definition at line 71 of file CJPagerCtrl.cpp.

00072 {
00073 }

Member Function Documentation

BOOL CCJPagerCtrl::Create | ( | DWORD | dwStyle,
 |  | const RECT & | rect,
 |  | CWnd * | pParentWnd,
 |  | UINT | nID
 | ) | [virtual]

Definition at line 84 of file CJPagerCtrl.cpp.

References NULL.

00085 {
00086     CWnd* pWnd = this;
00087     return pWnd->Create(WC_PAGESCROLLER, NULL, dwStyle, rect, pParentWnd, nID);
00088 }

_CJXLIB_INLINE void CCJPagerCtrl::ForwardMouse ( BOOL bForward )

Definition at line 192 of file CJPagerCtrl.h.

References ASSERT.

00193     { ASSERT(::IsWindow(m_hWnd)); Pager_ForwardMouse(m_hWnd, bForward); }

_CJXLIB_INLINE COLORREF CCJPagerCtrl::GetBkColor ( )

Definition at line 198 of file CJPagerCtrl.h.

References ASSERT.

00199     { ASSERT(::IsWindow(m_hWnd)); return Pager_GetBkColor(m_hWnd); }

_CJXLIB_INLINE int CCJPagerCtrl::GetBorder ( )

Definition at line 204 of file CJPagerCtrl.h.

References ASSERT.

00205     { ASSERT(::IsWindow(m_hWnd)); return Pager_GetBorder(m_hWnd); }

_CJXLIB_INLINE int CCJPagerCtrl::GetButtonSize ( )

Definition at line 216 of file CJPagerCtrl.h.

References ASSERT.

00217     { ASSERT(::IsWindow(m_hWnd)); return Pager_GetButtonSize(m_hWnd); }

_CJXLIB_INLINE DWORD CCJPagerCtrl::GetButtonState ( int iButton )

Definition at line 219 of file CJPagerCtrl.h.

References ASSERT.

00220     { ASSERT(::IsWindow(m_hWnd)); return Pager_GetButtonState(m_hWnd, iButton); }

_CJXLIB_INLINE void CCJPagerCtrl::GetDropTarget ( IDropTarget ** ppdt )

Definition at line 222 of file CJPagerCtrl.h.

References ASSERT.

00223     { ASSERT(::IsWindow(m_hWnd)); Pager_GetDropTarget(m_hWnd, ppdt); }

_CJXLIB_INLINE int CCJPagerCtrl::GetPos ( )

Definition at line 210 of file CJPagerCtrl.h.

References ASSERT.

00211     { ASSERT(::IsWindow(m_hWnd)); return Pager_GetPos(m_hWnd); }

BOOL CCJPagerCtrl::OnPagerCalcSize | ( | NMPGCALCSIZE * | pNMPGCalcSize,
 |  | LRESULT * | pResult
 | ) | [protected, virtual]

Definition at line 93 of file CJPagerCtrl.cpp.

References FALSE, m_nHeight, and m_nWidth.

00094 {
00095     switch(pNMPGCalcSize->dwFlag)
00096     {
00097     case PGF_CALCWIDTH:
00098         pNMPGCalcSize->iWidth = m_nWidth;
00099         break;
00100
00101     case PGF_CALCHEIGHT:
00102         pNMPGCalcSize->iHeight = m_nHeight;
00103         break;
00104     }
00105
00106     *pResult = 0;
00107     return FALSE;   // Let parent handle message
00108 }

BOOL CCJPagerCtrl::OnPagerScroll | ( | NMPGSCROLL * | pNMPGScroll,
 |  | LRESULT * | pResult
 | ) | [protected, virtual]

Definition at line 110 of file CJPagerCtrl.cpp.

References FALSE.

00111 {
00112     *pResult = 0;
00113     return FALSE;   // Let parent handle message
00114 }

_CJXLIB_INLINE void CCJPagerCtrl::RecalcSize ( )

Definition at line 189 of file CJPagerCtrl.h.

References ASSERT.

00190     { ASSERT(::IsWindow(m_hWnd)); Pager_RecalcSize(m_hWnd); }

_CJXLIB_INLINE COLORREF CCJPagerCtrl::SetBkColor ( COLORREF clr )

Definition at line 195 of file CJPagerCtrl.h.

References ASSERT.

00196     { ASSERT(::IsWindow(m_hWnd)); return Pager_SetBkColor(m_hWnd, clr); }

_CJXLIB_INLINE int CCJPagerCtrl::SetBorder ( int iBorder )

Definition at line 201 of file CJPagerCtrl.h.

References ASSERT.

00202     { ASSERT(::IsWindow(m_hWnd)); return Pager_SetBorder(m_hWnd, iBorder); }

_CJXLIB_INLINE int CCJPagerCtrl::SetButtonSize ( int iSize )

Definition at line 213 of file CJPagerCtrl.h.

References ASSERT.

00214     { ASSERT(::IsWindow(m_hWnd)); return Pager_SetButtonSize(m_hWnd, iSize); }

_CJXLIB_INLINE void CCJPagerCtrl::SetChild ( HWND hwndChild )

Definition at line 186 of file CJPagerCtrl.h.

References ASSERT.

00187     { ASSERT(::IsWindow(m_hWnd)); Pager_SetChild(m_hWnd, hwndChild); }

_CJXLIB_INLINE int CCJPagerCtrl::SetPos ( int iPos )

Definition at line 207 of file CJPagerCtrl.h.

References ASSERT.

00208     { ASSERT(::IsWindow(m_hWnd)); return Pager_SetPos(m_hWnd, iPos); }

_CJXLIB_INLINE void CCJPagerCtrl::SetScrollArea | ( | int | nWidth,
 |  | int | nHeight
 | ) |

Definition at line 183 of file CJPagerCtrl.h.

References ASSERT, m_nHeight, and m_nWidth.

00184     { ASSERT(::IsWindow(m_hWnd)); m_nWidth  = nWidth; m_nHeight = nHeight; }

Member Data Documentation

int CCJPagerCtrl::m_nHeight [protected]

Definition at line 76 of file CJPagerCtrl.h.

Referenced by OnPagerCalcSize, and SetScrollArea.

int CCJPagerCtrl::m_nWidth [protected]

Definition at line 75 of file CJPagerCtrl.h.

Referenced by OnPagerCalcSize, and SetScrollArea.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJPagerCtrl.h
  • WinCvs/CJLib/CJLibrary/CJPagerCtrl.cpp
Generated on Sun Feb 24 01:25:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJReBar Class Reference

#include <CJReBar.h>

Inheritance diagram for CCJReBar:

[legend]
Collaboration diagram for CCJReBar:

[legend]
List of all members.

Public Methods

CCJReBar ()
BOOL | Create (CWnd *pParentWnd, DWORD dwCtrlStyle=RBS_BANDBORDERS, DWORD dwStyle=WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|CBRS_TOP, UINT nID=AFX_IDW_REBAR)
CCJReBarCtrl & | GetReBarCtrl () const
BOOL | AddBar (CWnd *pBar, LPCTSTR pszText=NULL, CBitmap *pbmp=NULL, DWORD dwStyle=RBBS_GRIPPERALWAYS|RBBS_FIXEDBMP)
BOOL | AddBar (CWnd *pBar, COLORREF clrFore, COLORREF clrBack, LPCTSTR pszText=NULL, DWORD dwStyle=RBBS_GRIPPERALWAYS)
virtual void | OnUpdateCmdUI (CFrameWnd *pTarget, BOOL bDisableIfNoHndler)
virtual int | OnToolHitTest (CPoint point, TOOLINFO *pTI) const
virtual CSize | CalcFixedLayout (BOOL bStretch, BOOL bHorz)
virtual CSize | CalcDynamicLayout (int nLength, DWORD nMode)

Protected Methods

virtual LRESULT | WindowProc (UINT message, WPARAM wParam, LPARAM lParam)
BOOL | _AddBar (CWnd *pBar, REBARBANDINFO *pRBBI)
afx_msg BOOL | OnNcCreate (LPCREATESTRUCT)
afx_msg void | OnPaint ()
afx_msg void | OnHeightChange (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnNcPaint ()
afx_msg void | OnNcCalcSize (BOOL, NCCALCSIZE_PARAMS *)
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)
afx_msg LRESULT | OnShowBand (WPARAM wParam, LPARAM lParam)
afx_msg void | OnRecalcParent ()

Constructor & Destructor Documentation

CCJReBar::CCJReBar ( )

Definition at line 104 of file CJReBar.cpp.

References CCJToolBarBase::SetBorders.

00105 {
00106     SetBorders();
00107 }

Member Function Documentation

BOOL CCJReBar::_AddBar | ( | CWnd * | pBar,
 |  | REBARBANDINFO * | pRBBI
 | ) | [protected]

Definition at line 147 of file CJReBar.cpp.

References ASSERT, FALSE, CCJToolBarBase::m_bInReBar, and NULL.

Referenced by AddBar.

00148 {
00149     ASSERT_VALID(this);
00150     ASSERT(::IsWindow(m_hWnd));
00151     ASSERT(pBar != NULL);
00152     ASSERT(::IsWindow(pBar->m_hWnd));
00153
00154     pRBBI->cbSize = sizeof(REBARBANDINFO);
00155     pRBBI->fMask |= RBBIM_CHILD | RBBIM_CHILDSIZE;
00156     pRBBI->hwndChild = pBar->m_hWnd;
00157
00158     CSize size;
00159     CCJToolBarBase* pTemp = DYNAMIC_DOWNCAST(CCJToolBarBase, pBar);
00160     if (pTemp != NULL)
00161     {
00162         pTemp->m_bInReBar = true;
00163         size = pTemp->CalcFixedLayout(FALSE, m_dwStyle & CBRS_ORIENT_HORZ);
00164     }
00165     else
00166     {
00167         CRect rect;
00168         pBar->GetWindowRect(&rect);
00169         size = rect.Size();
00170     }
00171     //WINBUG: COMCTL32.DLL is off by 4 pixels in its sizing logic.  Whatever
00172     //  is specified as the minimum size, the system rebar will allow that band
00173     //  to be 4 actual pixels smaller!  That's why we add 4 to the size here.
00174     pRBBI->cxMinChild = size.cx + 4;
00175     pRBBI->cyMinChild = size.cy;
00176     BOOL bResult = (BOOL)DefWindowProc(RB_INSERTBAND, (WPARAM)-1, (LPARAM)pRBBI);
00177
00178     CFrameWnd* pFrameWnd = GetParentFrame();
00179     if (pFrameWnd != NULL)
00180         pFrameWnd->RecalcLayout();
00181
00182     return bResult;
00183 }

BOOL CCJReBar::AddBar | ( | CWnd * | pBar,
 |  | COLORREF | clrFore,
 |  | COLORREF | clrBack,
 |  | LPCTSTR | pszText = NULL,
 |  | DWORD | dwStyle = RBBS_GRIPPERALWAYS
 | ) |

Definition at line 203 of file CJReBar.cpp.

References _AddBar, and NULL.

00204 {
00205     REBARBANDINFO rbBand;
00206     rbBand.fMask = RBBIM_STYLE | RBBIM_COLORS;
00207     rbBand.fStyle = dwStyle;
00208     rbBand.clrFore = clrFore;
00209     rbBand.clrBack = clrBack;
00210     if (pszText != NULL)
00211     {
00212         rbBand.fMask |= RBBIM_TEXT;
00213         rbBand.lpText = const_cast<LPTSTR>(pszText);
00214     }
00215     return _AddBar(pBar, &rbBand);
00216 }

BOOL CCJReBar::AddBar | ( | CWnd * | pBar,
 |  | LPCTSTR | pszText = NULL,
 |  | CBitmap * | pbmp = NULL,
 |  | DWORD | dwStyle = RBBS_GRIPPERALWAYS|RBBS_FIXEDBMP
 | ) |

Definition at line 185 of file CJReBar.cpp.

References _AddBar, and NULL.

00186 {
00187     REBARBANDINFO rbBand;
00188     rbBand.fMask = RBBIM_STYLE;
00189     rbBand.fStyle = dwStyle;
00190     if (pszText != NULL)
00191     {
00192         rbBand.fMask |= RBBIM_TEXT;
00193         rbBand.lpText = const_cast<LPTSTR>(pszText);
00194     }
00195     if (pbmp != NULL)
00196     {
00197         rbBand.fMask |= RBBIM_BACKGROUND;
00198         rbBand.hbmBack = (HBITMAP)*pbmp;
00199     }
00200     return _AddBar(pBar, &rbBand);
00201 }

CSize CCJReBar::CalcDynamicLayout | ( | int | nLength,
 |  | DWORD | nMode
 | ) | [virtual]

Definition at line 272 of file CJReBar.cpp.

References ASSERT, and CalcFixedLayout.

00273 {
00274     if (dwMode & LM_HORZDOCK)
00275         ASSERT(dwMode & LM_HORZ);
00276     return CalcFixedLayout(dwMode & LM_STRETCH, dwMode & LM_HORZ);
00277 }

CSize CCJReBar::CalcFixedLayout | ( | BOOL | bStretch,
 |  | BOOL | bHorz
 | ) | [virtual]

Definition at line 218 of file CJReBar.cpp.

References ASSERT, CCJToolBarBase::CalcInsideRect, NULL, and VERIFY.

Referenced by CalcDynamicLayout.

00219 {
00220     ASSERT_VALID(this);
00221     ASSERT(::IsWindow(m_hWnd));
00222
00223     // the union of the band rectangles is the total bounding rect
00224     int nCount = DefWindowProc(RB_GETBANDCOUNT, 0, 0);
00225     REBARBANDINFO rbBand;
00226     rbBand.cbSize = sizeof(rbBand);
00227     int nTemp;
00228
00229     // sync up hidden state of the bands
00230     for (nTemp = nCount; nTemp--; )
00231     {
00232         rbBand.fMask = RBBIM_CHILD|RBBIM_STYLE;
00233         VERIFY(DefWindowProc(RB_GETBANDINFO, nTemp, (LPARAM)&rbBand));
00234         CCJToolBarBase* pBar = DYNAMIC_DOWNCAST(CCJToolBarBase, CWnd::FromHandlePermanent(rbBand.hwndChild));
00235         BOOL bWindowVisible;
00236         if (pBar != NULL)
00237             bWindowVisible = pBar->IsVisible();
00238         else
00239             bWindowVisible =  (::GetWindowLong(rbBand.hwndChild, GWL_STYLE) & WS_VISIBLE) != 0;
00240         BOOL bBandVisible = (rbBand.fStyle & RBBS_HIDDEN) == 0;
00241         if (bWindowVisible != bBandVisible)
00242             VERIFY(DefWindowProc(RB_SHOWBAND, nTemp, bWindowVisible));
00243     }
00244
00245     // determine bounding rect of all visible bands
00246     CRect rectBound; rectBound.SetRectEmpty();
00247     for (nTemp = nCount; nTemp--; )
00248     {
00249         rbBand.fMask = RBBIM_STYLE;
00250         VERIFY(DefWindowProc(RB_GETBANDINFO, nTemp, (LPARAM)&rbBand));
00251         if ((rbBand.fStyle & RBBS_HIDDEN) == 0)
00252         {
00253             CRect rect;
00254             VERIFY(DefWindowProc(RB_GETRECT, nTemp, (LPARAM)&rect));
00255             rectBound |= rect;
00256         }
00257     }
00258
00259     // add borders as part of bounding rect
00260     if (!rectBound.IsRectEmpty())
00261     {
00262         CRect rect; rect.SetRectEmpty();
00263         CalcInsideRect(rect, bHorz);
00264         rectBound.right -= rect.Width();
00265         rectBound.bottom -= rect.Height();
00266     }
00267
00268     return CSize((bHorz && bStretch) ? 32767 : rectBound.Width(),
00269         (!bHorz && bStretch) ? 32767 : rectBound.Height());
00270 }

BOOL CCJReBar::Create | ( | CWnd * | pParentWnd,
 |  | DWORD | dwCtrlStyle = RBS_BANDBORDERS,
 |  | DWORD | dwStyle = WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|CBRS_TOP,
 |  | UINT | nID = AFX_IDW_REBAR
 | ) |

Definition at line 279 of file CJReBar.cpp.

References _GetComCtlVersion, ASSERT, FALSE, CCJToolBarBase::m_bInReBar, NULL, TRUE, and VERIFY.

00280 {
00281     ASSERT_VALID(pParentWnd);   // must have a parent
00282     ASSERT (!((dwStyle & CBRS_SIZE_FIXED) && (dwStyle & CBRS_SIZE_DYNAMIC)));
00283
00284     // save the style
00285     m_dwStyle = (dwStyle & CBRS_ALL);
00286     if (nID == AFX_IDW_REBAR)
00287         m_dwStyle |= CBRS_HIDE_INPLACE;
00288
00289     dwStyle &= ~CBRS_ALL;
00290     dwStyle |= CCS_NOPARENTALIGN|CCS_NOMOVEY|CCS_NODIVIDER|CCS_NORESIZE|RBS_VARHEIGHT;
00291     dwStyle |= dwCtrlStyle;
00292
00293     // initialize common controls
00294 #if _MSC_VER >= 1200
00295     VERIFY(AfxDeferRegisterClass(AFX_WNDCOMMCTL_COOL_REG));
00296 #else
00297     INITCOMMONCONTROLSEX icex;
00298     icex.dwSize = sizeof(icex);
00299     icex.dwICC = ICC_COOL_CLASSES;
00300     VERIFY(InitCommonControlsEx(&icex));
00301 #endif
00302
00303     _GetComCtlVersion();
00304     ASSERT(_ComCtlVersion != -1);
00305
00306     // create the HWND
00307     CRect rect; rect.SetRectEmpty();
00308     if (!CWnd::Create(REBARCLASSNAME, NULL, dwStyle, rect, pParentWnd, nID))
00309         return FALSE;
00310
00311     // Note: Parent must resize itself for control bar to be resized
00312     m_bInReBar = true;
00313
00314     return TRUE;
00315 }

_CJXLIB_INLINE CCJReBarCtrl & CCJReBar::GetReBarCtrl ( ) const

Definition at line 123 of file CJReBar.h.

00124     { return *(CCJReBarCtrl*)this; }

BOOL CCJReBar::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 334 of file CJReBar.cpp.

00335 {
00336     return (BOOL)Default();
00337 }

void CCJReBar::OnHeightChange | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 116 of file CJReBar.cpp.

References NULL.

00117 {
00118     CFrameWnd* pFrameWnd = GetParentFrame();
00119     if (pFrameWnd != NULL)
00120         pFrameWnd->RecalcLayout();
00121     *pResult = 0;
00122 }

void CCJReBar::OnNcCalcSize | ( | BOOL | ,
 |  | NCCALCSIZE_PARAMS * |
 | ) | [protected]

Definition at line 339 of file CJReBar.cpp.

References CCJToolBarBase::CalcInsideRect.

00340 {
00341     // calculate border space (will add to top/bottom, subtract from right/bottom)
00342     CRect rect; rect.SetRectEmpty();
00343     BOOL bHorz = (m_dwStyle & CBRS_ORIENT_HORZ) != 0;
00344     CCJToolBarBase::CalcInsideRect(rect, bHorz);
00345
00346     // adjust non-client area for border space
00347     lpncsp->rgrc[0].left += rect.left;
00348     lpncsp->rgrc[0].top += rect.top;
00349     lpncsp->rgrc[0].right += rect.right;
00350     lpncsp->rgrc[0].bottom += rect.bottom;
00351 }

BOOL CCJReBar::OnNcCreate ( LPCREATESTRUCT ) [protected]

Definition at line 322 of file CJReBar.cpp.

References FALSE, NULL, and TRUE.

00323 {
00324     if (!CCJToolBarBase::OnNcCreate(lpCreateStruct))
00325         return FALSE;
00326
00327     // if the owner was set before the rebar was created, set it now
00328     if (m_hWndOwner != NULL)
00329         DefWindowProc(RB_SETPARENT, (WPARAM)m_hWndOwner, 0);
00330
00331     return TRUE;
00332 }

void CCJReBar::OnNcPaint ( ) [protected]

Definition at line 353 of file CJReBar.cpp.

References CCJToolBarBase::EraseNonClient.

00354 {
00355     EraseNonClient();
00356 }

void CCJReBar::OnPaint ( ) [protected]

Reimplemented from CCJToolBarBase.

Definition at line 358 of file CJReBar.cpp.

00359 {
00360     Default();
00361 }

void CCJReBar::OnRecalcParent ( ) [protected]

Definition at line 109 of file CJReBar.cpp.

References ASSERT, and NULL.

00110 {
00111     CFrameWnd* pFrameWnd = GetParentFrame();
00112     ASSERT(pFrameWnd != NULL);
00113     pFrameWnd->RecalcLayout();
00114 }

LRESULT CCJReBar::OnShowBand | ( | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [protected]

Definition at line 124 of file CJReBar.cpp.

References NULL, and VERIFY.

00125 {
00126     LRESULT lResult = Default();
00127     if (lResult)
00128     {
00129         // keep window visible state in sync with band visible state
00130         REBARBANDINFO rbBand;
00131         rbBand.cbSize = sizeof(rbBand);
00132         rbBand.fMask = RBBIM_CHILD|RBBIM_STYLE;
00133         VERIFY(DefWindowProc(RB_GETBANDINFO, wParam, (LPARAM)&rbBand));
00134         CCJToolBarBase* pBar = DYNAMIC_DOWNCAST(CCJToolBarBase, CWnd::FromHandlePermanent(rbBand.hwndChild));
00135         BOOL bWindowVisible;
00136         if (pBar != NULL)
00137             bWindowVisible = pBar->IsVisible();
00138         else
00139             bWindowVisible =  (::GetWindowLong(rbBand.hwndChild, GWL_STYLE) & WS_VISIBLE) != 0;
00140         BOOL bBandVisible = (rbBand.fStyle & RBBS_HIDDEN) == 0;
00141         if (bWindowVisible != bBandVisible)
00142             VERIFY(::ShowWindow(rbBand.hwndChild, bBandVisible ? SW_SHOW : SW_HIDE));
00143     }
00144     return lResult;
00145 }

int CCJReBar::OnToolHitTest | ( | CPoint | point,
 |  | TOOLINFO * | pTI
 | ) | const [virtual]

Definition at line 363 of file CJReBar.cpp.

References _CjxChildWindowFromPoint, ASSERT, and NULL.

00364 {
00365     ASSERT_VALID(this);
00366     ASSERT(::IsWindow(m_hWnd));
00367
00368     HWND hWndChild = _CjxChildWindowFromPoint(m_hWnd, point);
00369     CWnd* pWnd = CWnd::FromHandlePermanent(hWndChild);
00370     if (pWnd == NULL)
00371         return CCJToolBarBase::OnToolHitTest(point, pTI);
00372
00373     ASSERT(pWnd->m_hWnd == hWndChild);
00374     return pWnd->OnToolHitTest(point, pTI);
00375 }

void CCJReBar::OnUpdateCmdUI | ( | CFrameWnd * | pTarget,
 |  | BOOL | bDisableIfNoHndler
 | ) | [virtual]

Definition at line 317 of file CJReBar.cpp.

00318 {
00319     UpdateDialogControls(pTarget, bDisableIfNoHandler);
00320 }

LRESULT CCJReBar::WindowProc | ( | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [protected, virtual]

Reimplemented from CCJToolBarBase.

Definition at line 377 of file CJReBar.cpp.

References CCJToolBarBase::WindowProc.

00378 {
00379     // special handling for certain messages (forwarding to owner/parent)
00380     switch (message)
00381     {
00382     case WM_POPMESSAGESTRING:
00383     case WM_SETMESSAGESTRING:
00384         return GetOwner()->SendMessage(message, wParam, lParam);
00385     }
00386     return CCJToolBarBase::WindowProc(message, wParam, lParam);
00387 }

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJReBar.h
  • WinCvs/CJLib/CJLibrary/CJReBar.cpp
Generated on Sun Feb 24 01:25:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJReBarCtrl Class Reference

#include <CJReBarCtrl.h>

Inheritance diagram for CCJReBarCtrl:

[legend]
Collaboration diagram for CCJReBarCtrl:

[legend]
List of all members.

Public Methods

CCJReBarCtrl ()
BOOL | Create (DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID)
UINT | GetBandCount () const
BOOL | GetBandInfo (UINT uBand, REBARBANDINFO *prbbi) const
UINT | GetBarHeight () const
BOOL | GetBarInfo (REBARINFO *prbi) const
COLORREF | GetBkColor () const
IDropTarget * | GetDropTarget () const
BOOL | GetRect (UINT uBand, LPRECT prc) const
UINT | GetRowCount () const
UINT | GetRowHeight (UINT uRow) const
COLORREF | GetTextColor () const
CToolTipCtrl * | GetToolTips () const
int | IDToIndex (UINT uBandID) const
BOOL | SetBandInfo (UINT uBand, REBARBANDINFO *prbbi)
BOOL | SetBarInfo (REBARINFO *prbi)
COLORREF | SetBkColor (COLORREF clr)
CWnd * | SetOwner (CWnd *pWnd)
COLORREF | SetTextColor (COLORREF clr)
void | SetToolTips (CToolTipCtrl *pToolTip)
CImageList * | GetImageList () const
BOOL | SetImageList (CImageList *pImageList)
void | GetBandBorders (UINT uBand, LPRECT prc) const
CPalette * | GetPalette () const
CPalette * | SetPalette (HPALETTE hPal)
BOOL | GetColorScheme (COLORSCHEME *lpcs)
void | SetColorScheme (const COLORSCHEME *lpcs)
void | BeginDrag (UINT uBand, DWORD dwPos=(DWORD)-1)
BOOL | DeleteBand (UINT uBand)
void | DragMove (DWORD dwPos=(DWORD)-1)
void | EndDrag ()
int | HitTest (RBHITTESTINFO *prbht)
BOOL | InsertBand (UINT uIndex, REBARBANDINFO *prbbi)
void | MaximizeBand (UINT uBand)
void | MinimizeBand (UINT uBand)
BOOL | ShowBand (UINT uBand, BOOL fShow=TRUE)
BOOL | SizeToRect (CRect &rect)
BOOL | MoveBand (UINT uFrom, UINT uTo)

Constructor & Destructor Documentation

CCJReBarCtrl::CCJReBarCtrl ( )

Definition at line 56 of file CJReBarCtrl.cpp.

00057 {
00058 }

Member Function Documentation

_CJXLIB_INLINE void CCJReBarCtrl::BeginDrag | ( | UINT | uBand,
 |  | DWORD | dwPos = (DWORD)-1
 | ) |

Definition at line 181 of file CJReBarCtrl.h.

References ASSERT.

00182     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_BEGINDRAG, uBand, dwPos); }

BOOL CCJReBarCtrl::Create | ( | DWORD | dwStyle,
 |  | const RECT & | rect,
 |  | CWnd * | pParentWnd,
 |  | UINT | nID
 | ) |

Definition at line 60 of file CJReBarCtrl.cpp.

References NULL, and VERIFY.

00062 {
00063     // initialize common controls
00064 #if _MSC_VER >= 1200
00065     VERIFY(AfxDeferRegisterClass(AFX_WNDCOMMCTL_COOL_REG));
00066 #else
00067     INITCOMMONCONTROLSEX icex;
00068     icex.dwSize = sizeof(icex);
00069     icex.dwICC = ICC_COOL_CLASSES;
00070     VERIFY(InitCommonControlsEx(&icex));
00071 #endif
00072
00073     CWnd* pWnd = this;
00074     return pWnd->Create(REBARCLASSNAME, NULL, dwStyle, rect, pParentWnd, nID);
00075 }

_CJXLIB_INLINE BOOL CCJReBarCtrl::DeleteBand ( UINT uBand )

Definition at line 184 of file CJReBarCtrl.h.

References ASSERT.

00185     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_DELETEBAND, uBand, 0L); }

_CJXLIB_INLINE void CCJReBarCtrl::DragMove ( DWORD dwPos = (DWORD)-1 )

Definition at line 187 of file CJReBarCtrl.h.

References ASSERT.

00188     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_DRAGMOVE, 0, dwPos); }

_CJXLIB_INLINE void CCJReBarCtrl::EndDrag ( )

Definition at line 190 of file CJReBarCtrl.h.

References ASSERT.

00191     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_ENDDRAG, 0, 0L); }

_CJXLIB_INLINE void CCJReBarCtrl::GetBandBorders | ( | UINT | uBand,
 |  | LPRECT | prc
 | ) | const

Definition at line 172 of file CJReBarCtrl.h.

References ASSERT.

00173     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_GETBANDBORDERS, uBand, (LPARAM)prc); }

_CJXLIB_INLINE UINT CCJReBarCtrl::GetBandCount ( ) const

Definition at line 118 of file CJReBarCtrl.h.

References ASSERT.

00119     { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, RB_GETBANDCOUNT, 0, 0L); }

_CJXLIB_INLINE BOOL CCJReBarCtrl::GetBandInfo | ( | UINT | uBand,
 |  | REBARBANDINFO * | prbbi
 | ) | const

Definition at line 121 of file CJReBarCtrl.h.

References ASSERT.

00122     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_GETBANDINFO, uBand, (LPARAM)prbbi); }

_CJXLIB_INLINE UINT CCJReBarCtrl::GetBarHeight ( ) const

Definition at line 124 of file CJReBarCtrl.h.

References ASSERT.

00125     { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, RB_GETBARHEIGHT, 0, 0L); }

_CJXLIB_INLINE BOOL CCJReBarCtrl::GetBarInfo ( REBARINFO * prbi ) const

Definition at line 127 of file CJReBarCtrl.h.

References ASSERT.

Referenced by GetImageList.

00128     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_GETBARINFO, 0, (LPARAM)prbi); }

_CJXLIB_INLINE COLORREF CCJReBarCtrl::GetBkColor ( ) const

Definition at line 130 of file CJReBarCtrl.h.

References ASSERT.

00131     { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, RB_GETBKCOLOR, 0, 0L); }

BOOL CCJReBarCtrl::GetColorScheme ( COLORSCHEME * lpcs )

Definition at line 94 of file CJReBarCtrl.cpp.

00095 {
00096   lpcs->dwSize = sizeof(COLORSCHEME);
00097   return SendMessage(RB_GETCOLORSCHEME, 0, (LPARAM)lpcs);
00098 }

_CJXLIB_INLINE IDropTarget * CCJReBarCtrl::GetDropTarget ( ) const

Definition at line 133 of file CJReBarCtrl.h.

References ASSERT.

00134     { ASSERT(::IsWindow(m_hWnd)); IDropTarget* pdt; ::SendMessage(m_hWnd, RB_GETDROPTARGET, 0, (LPARAM)&pdt); return pdt; }

CImageList * CCJReBarCtrl::GetImageList ( ) const

Definition at line 77 of file CJReBarCtrl.cpp.

References GetBarInfo, and NULL.

00078 {
00079   REBARINFO rbi;
00080   rbi.cbSize = sizeof(rbi);
00081   rbi.fMask = RBIM_IMAGELIST;
00082   return GetBarInfo(&rbi) ? CImageList::FromHandle(rbi.himl) : NULL;
00083 }

_CJXLIB_INLINE CPalette * CCJReBarCtrl::GetPalette ( ) const

Definition at line 175 of file CJReBarCtrl.h.

References ASSERT.

00176     { ASSERT(::IsWindow(m_hWnd)); return CPalette::FromHandle((HPALETTE)::SendMessage(m_hWnd, RB_GETPALETTE, 0, 0L)); }

_CJXLIB_INLINE BOOL CCJReBarCtrl::GetRect | ( | UINT | uBand,
 |  | LPRECT | prc
 | ) | const

Definition at line 136 of file CJReBarCtrl.h.

References ASSERT.

00137     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_GETRECT, uBand, (LPARAM)prc); }

_CJXLIB_INLINE UINT CCJReBarCtrl::GetRowCount ( ) const

Definition at line 139 of file CJReBarCtrl.h.

References ASSERT.

00140     { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, RB_GETROWCOUNT, 0, 0L); }

_CJXLIB_INLINE UINT CCJReBarCtrl::GetRowHeight ( UINT uRow ) const

Definition at line 142 of file CJReBarCtrl.h.

References ASSERT.

00143     { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, RB_GETROWHEIGHT, uRow, 0L); }

_CJXLIB_INLINE COLORREF CCJReBarCtrl::GetTextColor ( ) const

Definition at line 145 of file CJReBarCtrl.h.

References ASSERT.

00146     { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, RB_GETTEXTCOLOR, 0, 0L); }

_CJXLIB_INLINE CToolTipCtrl * CCJReBarCtrl::GetToolTips ( ) const

Definition at line 148 of file CJReBarCtrl.h.

References ASSERT.

00149     { ASSERT(::IsWindow(m_hWnd)); return (CToolTipCtrl*)CWnd::FromHandle((HWND)::SendMessage(m_hWnd, RB_GETTOOLTIPS, 0, 0L)); }

_CJXLIB_INLINE int CCJReBarCtrl::HitTest ( RBHITTESTINFO * prbht )

Definition at line 193 of file CJReBarCtrl.h.

References ASSERT.

00194     { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, RB_HITTEST, 0, (LPARAM)prbht); }

_CJXLIB_INLINE int CCJReBarCtrl::IDToIndex ( UINT uBandID ) const

Definition at line 151 of file CJReBarCtrl.h.

References ASSERT.

00152     { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, RB_IDTOINDEX, uBandID, 0L); }

_CJXLIB_INLINE BOOL CCJReBarCtrl::InsertBand | ( | UINT | uIndex,
 |  | REBARBANDINFO * | prbbi
 | ) |

Definition at line 196 of file CJReBarCtrl.h.

References ASSERT.

00197     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_INSERTBAND, uIndex, (LPARAM)prbbi); }

_CJXLIB_INLINE void CCJReBarCtrl::MaximizeBand ( UINT uBand )

Definition at line 199 of file CJReBarCtrl.h.

References ASSERT.

00200     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_MAXIMIZEBAND, uBand, 0L); }

_CJXLIB_INLINE void CCJReBarCtrl::MinimizeBand ( UINT uBand )

Definition at line 202 of file CJReBarCtrl.h.

References ASSERT.

00203     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_MINIMIZEBAND, uBand, 0L); }

_CJXLIB_INLINE BOOL CCJReBarCtrl::MoveBand | ( | UINT | uFrom,
 |  | UINT | uTo
 | ) |

Definition at line 211 of file CJReBarCtrl.h.

References ASSERT.

00212     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_MOVEBAND, uFrom, uTo); }

_CJXLIB_INLINE BOOL CCJReBarCtrl::SetBandInfo | ( | UINT | uBand,
 |  | REBARBANDINFO * | prbbi
 | ) |

Definition at line 154 of file CJReBarCtrl.h.

References ASSERT.

00155     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_SETBANDINFO, uBand, (LPARAM)prbbi); }

_CJXLIB_INLINE BOOL CCJReBarCtrl::SetBarInfo ( REBARINFO * prbi )

Definition at line 157 of file CJReBarCtrl.h.

References ASSERT.

Referenced by SetImageList.

00158     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_SETBARINFO, 0, (LPARAM)prbi); }

_CJXLIB_INLINE COLORREF CCJReBarCtrl::SetBkColor ( COLORREF clr )

Definition at line 160 of file CJReBarCtrl.h.

References ASSERT.

00161     { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, RB_SETBKCOLOR, 0, (LPARAM)clr); }

void CCJReBarCtrl::SetColorScheme ( const COLORSCHEME * lpcs )

Definition at line 100 of file CJReBarCtrl.cpp.

00101 {
00102   ((COLORSCHEME*)lpcs)->dwSize = sizeof(COLORSCHEME);
00103   SendMessage(RB_SETCOLORSCHEME, 0, (LPARAM)lpcs);
00104 }

BOOL CCJReBarCtrl::SetImageList ( CImageList * pImageList )

Definition at line 85 of file CJReBarCtrl.cpp.

References SetBarInfo.

00086 {
00087   REBARINFO rbi;
00088   rbi.cbSize = sizeof(rbi);
00089   rbi.fMask = RBIM_IMAGELIST;
00090   rbi.himl = (HIMAGELIST)pImageList->GetSafeHandle();
00091   return SetBarInfo(&rbi);
00092 }

_CJXLIB_INLINE CWnd * CCJReBarCtrl::SetOwner ( CWnd * pWnd )

Definition at line 163 of file CJReBarCtrl.h.

References ASSERT.

00164     { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle((HWND)::SendMessage(m_hWnd, RB_SETPARENT, (WPARAM)pWnd->m_hWnd, 0L)); }

_CJXLIB_INLINE CPalette * CCJReBarCtrl::SetPalette ( HPALETTE hPal )

Definition at line 178 of file CJReBarCtrl.h.

References ASSERT, and hPal.

00179     { ASSERT(::IsWindow(m_hWnd)); return CPalette::FromHandle((HPALETTE)::SendMessage(m_hWnd, RB_SETPALETTE, 0, (LPARAM)hPal)); }

_CJXLIB_INLINE COLORREF CCJReBarCtrl::SetTextColor ( COLORREF clr )

Definition at line 166 of file CJReBarCtrl.h.

References ASSERT.

00167     { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, RB_SETTEXTCOLOR, 0, (LPARAM)clr); }

_CJXLIB_INLINE void CCJReBarCtrl::SetToolTips ( CToolTipCtrl * pToolTip )

Definition at line 169 of file CJReBarCtrl.h.

References ASSERT.

00170     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_SETTOOLTIPS, (WPARAM)pToolTip->m_hWnd, 0L); }

_CJXLIB_INLINE BOOL CCJReBarCtrl::ShowBand | ( | UINT | uBand,
 |  | BOOL | fShow = TRUE
 | ) |

Definition at line 205 of file CJReBarCtrl.h.

References ASSERT.

00206     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_SHOWBAND, uBand, fShow); }

_CJXLIB_INLINE BOOL CCJReBarCtrl::SizeToRect ( CRect & rect )

Definition at line 208 of file CJReBarCtrl.h.

References ASSERT.

00209     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_SIZETORECT, 0, (LPARAM)&rect); }

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJReBarCtrl.h
  • WinCvs/CJLib/CJLibrary/CJReBarCtrl.cpp
Generated on Sun Feb 24 01:25:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJShellTree Class Reference

Inheritance diagram for CCJShellTree:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/ExploreBar.h
Generated on Sun Feb 24 01:25:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJSizeDockBar Class Reference

#include <CJSizeDockBar.h>

Inheritance diagram for CCJSizeDockBar:

[legend]
Collaboration diagram for CCJSizeDockBar:

[legend]
List of all members.

Public Methods

CCJSizeDockBar ()
virtual | ~CCJSizeDockBar ()
void | Normalize (CCJControlBar *)
void | Maximize (CCJControlBar *)
void | CalcSizeBarLayout ()
void | SetActualSize (int iSize)
void | EraseNonClient ()
void | DrawBorders (CDC *pDC, CRect &rect)
void | RecalcAllExcept (CCJSizeDockBar *pBar)
CCJControlBar * | GetDockedSizeBar (int nPos)
void | FlatBorder (BOOL bFlat=TRUE)
virtual CSize | CalcDynamicLayout (int nLength, DWORD nMode)
virtual void | DoPaint (CDC *pDC)
virtual BOOL | IsDockBar () const
virtual BOOL | IsDockSizeBar () const
virtual void | OnInvertTracker (const CRect &)
virtual void | HitTest (const CPoint &point)

Static Public Attributes

bool | m_bIsDockBar = false

Protected Methods

BOOL | IsLastControlBar (int index)
void | GetAvailableRect (CRect &rect)
afx_msg void | OnNcPaint ()
afx_msg void | OnNcCalcSize (BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR *lpncsp)
afx_msg BOOL | OnSetCursor (CWnd *pWnd, UINT nHitTest, UINT message)
afx_msg UINT | OnNcHitTest (CPoint point)
afx_msg void | OnNcLButtonDown (UINT nHitTest, CPoint point)
afx_msg void | OnLButtonUp (UINT nFlags, CPoint point)
afx_msg void | OnMouseMove (UINT nFlags, CPoint point)

Protected Attributes

int | m_iSafeSpace
int | m_iActualSize
BOOL | m_bDragging
BOOL | m_bOkToDrag
CRect | m_rcTrack
CPoint | m_ptCurDrag
CPoint | m_ptStartDrag
HCURSOR | m_curHSplitBar
HCURSOR | m_curVSplitBar
BOOL | m_bFlatBorder
CPoint | m_ptCurrent

Constructor & Destructor Documentation

CCJSizeDockBar::CCJSizeDockBar ( )

Definition at line 111 of file CJSizeDockBar.cpp.

References FALSE, m_bDragging, m_bFlatBorder, m_bOkToDrag, m_iActualSize, m_iSafeSpace, m_ptCurrent, and TRUE.

00112 {
00113     m_cxLeftBorder      = 0;
00114     m_cyTopBorder       = 0;
00115     m_cxRightBorder     = 0;
00116     m_cyBottomBorder    = 0;
00117     m_iActualSize       = 100;
00118     m_iSafeSpace        = 25;
00119     m_bOkToDrag         = FALSE;
00120     m_bDragging         = FALSE;
00121     m_bAutoDelete       = TRUE;
00122     m_bFlatBorder       = TRUE;     //Yiannhs v6.06 for Docking bar flat border
00123     m_ptCurrent         = CPoint(0,0);
00124 }

CCJSizeDockBar::~CCJSizeDockBar ( ) [virtual]

Definition at line 126 of file CJSizeDockBar.cpp.

00127 {
00128     // TODO: add destruction code here.
00129 }

Member Function Documentation

CSize CCJSizeDockBar::CalcDynamicLayout | ( | int | nLength,
 |  | DWORD | nMode
 | ) | [virtual]

Definition at line 148 of file CJSizeDockBar.cpp.

References CalcSizeBarLayout, m_iActualSize, and NULL.

00149 {
00150     int ActualSize = 0;
00151     for(int i=0;i<= m_arrBars.GetUpperBound();++i)
00152     {
00153         CCJControlBar *pBar = (CCJControlBar *)GetDockedControlBar(i);
00154         if (pBar != NULL && pBar->IsVisible())
00155         {
00156             ActualSize = m_iActualSize;
00157             break;
00158         }
00159     }
00160
00161     int cx=0,cy=0;
00162     if (nMode & LM_VERTDOCK) {
00163         cx = ActualSize ;
00164         cy = 32767;
00165     }
00166
00167     if (nMode & LM_HORZDOCK) {
00168         cx= 32767;
00169         cy = ActualSize;
00170     }
00171
00172     //Yiannhs. Use selective layout. Since the dock bar does not calculate the bar sizes yet
00173     if( !m_bLayoutQuery )
00174         CalcSizeBarLayout();
00175
00176     return CSize(cx,cy);
00177 }

void CCJSizeDockBar::CalcSizeBarLayout ( )

Definition at line 594 of file CJSizeDockBar.cpp.

References CCJControlBar::CalcDynamicLayout, FALSE, IsLastControlBar, CCJControlBar::m_bToFit, CCJControlBar::m_bUnique, NULL, and TRUE.

Referenced by CalcDynamicLayout, Maximize, Normalize, RecalcAllExcept, CCJMDIFrameWnd::RecalcAllExcept, CCJMDIChildWnd::RecalcAllExcept, and CCJFrameWnd::RecalcAllExcept.

00595 {
00596     //Yiannhs: It is necessary to set all Control bars in one row.
00597     //         till now multiple rows are not handled
00598     int VisCount = GetDockedVisibleCount();
00599     if( !VisCount )
00600         return;      //Yiannhs v6.07 moved this on top
00601
00602     AFX_SIZEPARENTPARAMS layout;
00603     layout.hDWP = ::BeginDeferWindowPos( m_arrBars.GetSize( ));
00604     CRect rectAvail;
00605     GetClientRect(&rectAvail);
00606
00607     int nCount = 0;
00608     int lastLeft = 0;
00609     int lastTop = 0;
00610
00611     for (int i = 0; i < m_arrBars.GetSize(); i++)
00612     {
00613         CCJControlBar* pBar = STATIC_DOWNCAST(CCJControlBar, (CObject*)GetDockedControlBar(i));
00614         if (pBar != NULL && pBar->IsVisible())
00615         {
00616             if(!pBar->IsKindOf(RUNTIME_CLASS(CCJControlBar)))
00617                 continue;
00618
00619             CRect rectBar;
00620             ++nCount;
00621             pBar->GetWindowRect(&rectBar);
00622             pBar->m_bUnique = FALSE;        //Yiannhs ok in Ver 6.07
00623             ScreenToClient(&rectBar);
00624             CSize sizeIdeal = pBar->CalcDynamicLayout(-1, 0);
00625
00626             //Yiannhs  moved [if] code at the begining. It helps make these calculations near the top
00627             //         for checking the size of the last control bars
00628             int bIsLast = IsLastControlBar(i+1);
00629             pBar->m_bToFit = bIsLast;           //check fitting is setup here
00630             if( bIsLast && nCount == 1 ) {
00631                 pBar->m_bUnique = TRUE;
00632             }
00633
00635             //  so it is not completely hidden
00636             if( rectBar.right >= rectAvail.right && !bIsLast )
00637                 sizeIdeal.cx -= (sizeIdeal.cx / 4);
00638             if( rectBar.bottom >= rectAvail.bottom && !bIsLast )
00639                 sizeIdeal.cy -= (sizeIdeal.cy / 4);
00640
00641             //Yiannhs: The Dock bar is either horizontally or vertically docked itself.
00642             //         So are the ControlBars enclosed inside it. Since the control bars
00643             //         are docked, and Sizing dockbar does not derive from CCJControlBar
00644             //         we may be a bit more clever.
00645             if( m_dwStyle & CBRS_ORIENT_HORZ ) {//use some default data members
00646                 //horizontal;
00647                 rectBar.left = lastLeft;
00648                 rectBar.top = 0;
00649                 rectBar.bottom = rectAvail.Height();
00650                 rectBar.right = rectBar.left + sizeIdeal.cx;
00651
00652                 if( rectBar.left > lastLeft )
00653                     rectBar.left = lastLeft;
00654
00655                 lastLeft = rectBar.right;
00656                 if ( bIsLast ) {    //Yiannhs
00657                     rectBar.right = rectAvail.right;
00658                 }
00659
00660             } else if( m_dwStyle & CBRS_ORIENT_VERT ) {
00661                 //Vertical
00662                 rectBar.top = lastTop;
00663                 rectBar.left = 0;
00664                 rectBar.right = rectAvail.Width();
00665                 rectBar.bottom = rectBar.top + sizeIdeal.cy;
00666
00667                 if (rectBar.top > lastTop)
00668                     rectBar.top = lastTop;
00669
00670                 lastTop = rectBar.bottom;
00671                 if ( bIsLast ) {    //Yiannhs
00672                     rectBar.bottom = rectAvail.bottom;
00673                 }
00674             }
00675
00676             AfxRepositionWindow( &layout, pBar->m_hWnd, &rectBar );
00677         }
00678     }
00679
00680     // move and resize all the windows at once!
00681     if( layout.hDWP == NULL || !::EndDeferWindowPos( layout.hDWP ))
00682         TRACE0("Warning: DeferWindowPos failed - low system resources.\n");
00683 }

void CCJSizeDockBar::DoPaint ( CDC * pDC ) [virtual]

Definition at line 179 of file CJSizeDockBar.cpp.

00180 {
00181     CDockBar::DoPaint(pDC);
00182 }

void CCJSizeDockBar::DrawBorders | ( | CDC * | pDC,
 |  | CRect & | rect
 | ) |

Definition at line 495 of file CJSizeDockBar.cpp.

References AFX_IDW_SIZEBAR_BOTTOM, AFX_IDW_SIZEBAR_LEFT, AFX_IDW_SIZEBAR_RIGHT, AFX_IDW_SIZEBAR_TOP, m_bFlatBorder, and TRACK_BORDER_SIZE.

Referenced by EraseNonClient.

00496 {
00497     int cxBorderLeft    = 0;
00498     int cxBorderRight   = 0;
00499     int cyBorderTop     = 0;
00500     int cyBorderBottom  = 0;
00501
00502     CRect rc;
00503     rc.CopyRect(&rect);
00504
00505     //Yiannhs: i've replaced color variables with the afxdata ones.
00506     if (m_dwStyle & CBRS_BORDER_TOP) {
00507         pDC->FillSolidRect(rc.left, rc.top, rc.Width(), 1, afxData.clrBtnShadow);
00508         pDC->FillSolidRect(rc.left, rc.top+1, rc.Width(), 1, afxData.clrBtnHilite);
00509         cyBorderTop+=2;
00510     }
00511
00512     if (m_dwStyle & CBRS_BORDER_BOTTOM) {
00513         pDC->FillSolidRect(rc.left, rc.bottom-1, rc.Width(), 1, afxData.clrBtnHilite);
00514         pDC->FillSolidRect(rc.left, rc.bottom-2, rc.Width(), 1, afxData.clrBtnShadow);
00515         cyBorderBottom+=2;
00516     }
00517
00518     if (m_dwStyle & CBRS_BORDER_LEFT) {
00519         pDC->FillSolidRect(rc.left, rc.top, 1, rc.Height(), afxData.clrBtnShadow);
00520         pDC->FillSolidRect(rc.left+1, rc.top, 1, rc.Height(), afxData.clrBtnHilite);
00521         cxBorderLeft+=2;
00522     }
00523
00524     if (m_dwStyle & CBRS_BORDER_RIGHT) {
00525         pDC->FillSolidRect(rc.right-2, rc.top, 1, rc.Height(), afxData.clrBtnShadow);
00526         pDC->FillSolidRect(rc.right-1, rc.top, 1, rc.Height(), afxData.clrBtnHilite);
00527         cxBorderRight+=2;
00528     }
00529
00530     UINT nID = ((UINT)(WORD)::GetDlgCtrlID(m_hWnd));
00531
00532     CRect rcTrack;
00533     rcTrack.CopyRect(&rc);
00534
00535     if (nID == AFX_IDW_SIZEBAR_LEFT) {
00536         rcTrack.left    = rc.right - TRACK_BORDER_SIZE;
00537         rcTrack.right  += 1;
00538         rcTrack.top    += 1;
00539         rcTrack.bottom -= 1;
00540         //Yiannhs moved below
00541         cxBorderRight = TRACK_BORDER_SIZE;
00542     }
00543
00544     else if (nID == AFX_IDW_SIZEBAR_TOP) {
00545         rcTrack.top = rc.bottom - TRACK_BORDER_SIZE;
00546         rcTrack.bottom+=1;
00547         //Yiannhs moved below
00548         cyBorderBottom = TRACK_BORDER_SIZE;
00549     }
00550
00551     else if (nID == AFX_IDW_SIZEBAR_RIGHT) {
00552         rcTrack.right   = rc.left + TRACK_BORDER_SIZE;
00553         rcTrack.left   -= 1;
00554         rcTrack.top    += 1;
00555         rcTrack.bottom -= 1;
00556         //Yiannhs moved below
00557         cxBorderLeft = TRACK_BORDER_SIZE;
00558     }
00559
00560     else if (nID == AFX_IDW_SIZEBAR_BOTTOM) {
00561         rcTrack.bottom = rc.top + TRACK_BORDER_SIZE;
00562         rcTrack.top-=1;
00563         //Yiannhs moved below
00564         cyBorderTop = TRACK_BORDER_SIZE;
00565     }
00566
00567     //Yiannhs Moved these here. in one place. The optimizer may do this, but lets help it.
00568     pDC->FillSolidRect(rcTrack, afxData.clrBtnFace);
00569     if( !m_bFlatBorder )    //Yiannhs handle flat borders
00570         pDC->Draw3dRect(rcTrack, afxData.clrBtnHilite, afxData.clrBtnShadow);
00571
00572     rect.left   += cxBorderLeft;
00573     rect.right  -= cxBorderRight;
00574     rect.top    += cyBorderTop;
00575     rect.bottom -= cyBorderBottom;
00576 }

void CCJSizeDockBar::EraseNonClient ( )

Definition at line 578 of file CJSizeDockBar.cpp.

References DrawBorders.

Referenced by OnNcPaint.

00579 {
00580     CWindowDC dc(this);
00581     CRect rectClient;
00582     GetClientRect(rectClient);
00583     CRect rectWindow;
00584     GetWindowRect(rectWindow);
00585     ScreenToClient(rectWindow);
00586     rectClient.OffsetRect(-rectWindow.left, -rectWindow.top);
00587     dc.ExcludeClipRect(rectClient);
00588     rectWindow.OffsetRect(-rectWindow.left, -rectWindow.top);
00589     DrawBorders(&dc, rectWindow);
00590 }

_CJXLIB_INLINE void CCJSizeDockBar::FlatBorder ( BOOL bFlat = TRUE )

Definition at line 242 of file CJSizeDockBar.h.

References FALSE, m_bFlatBorder, and NULL.

Referenced by CCJMDIFrameWnd::EnableDockingSizeBar, CCJMDIChildWnd::EnableDockingSizeBar, and CCJFrameWnd::EnableDockingSizeBar.

00243     { if(m_bFlatBorder!=bFlat){m_bFlatBorder=bFlat;InvalidateRect(NULL,FALSE);UpdateWindow();}}

void CCJSizeDockBar::GetAvailableRect ( CRect & rect ) [protected]

Definition at line 455 of file CJSizeDockBar.cpp.

References TRUE.

Referenced by OnLButtonUp, and OnMouseMove.

00456 {
00457     GetDockingFrame()->GetClientRect(&rect);
00458     GetDockingFrame()->RepositionBars(0xffff, 0xffff, AFX_IDW_PANE_FIRST,reposQuery,
00459         &rect, &rect, TRUE);
00460 }

CCJControlBar * CCJSizeDockBar::GetDockedSizeBar ( int nPos )

Definition at line 476 of file CJSizeDockBar.cpp.

Referenced by CCJMiniDockFrameWnd::OnNcLButtonDblClk, and CCJMiniDockFrameWnd::OnNcLButtonDown.

00477 {
00478     return (CCJControlBar*)GetDockedControlBar(nPos);
00479 }

void CCJSizeDockBar::HitTest ( const CPoint & point ) [virtual]

Definition at line 205 of file CJSizeDockBar.cpp.

References AFX_IDW_SIZEBAR_LEFT, AFX_IDW_SIZEBAR_RIGHT, AFX_IDW_SIZEBAR_TOP, IDC_HSPLITBAR, IDC_VSPLITBAR, m_bOkToDrag, NULL, and TRACK_BORDER_SIZE.

Referenced by OnNcHitTest.

00206 {
00207     UINT nID = ((UINT)(WORD)::GetDlgCtrlID(m_hWnd));
00208     CRect rcWin;
00209     GetWindowRect(&rcWin);
00210     HCURSOR hCur = NULL;
00211
00212     //Yiannhs: Check the if statements, and change of variable TRackBorder size
00213     if (nID == AFX_IDW_SIZEBAR_LEFT || nID == AFX_IDW_SIZEBAR_RIGHT ) {
00214         //we are sure the DOCK bar is vertical
00215         if( nID == AFX_IDW_SIZEBAR_LEFT )
00216             rcWin.left = rcWin.right - TRACK_BORDER_SIZE;
00217         else
00218             rcWin.right = rcWin.left + TRACK_BORDER_SIZE;
00219
00220         if( rcWin.PtInRect(point) )
00221             hCur = AfxGetApp()->LoadCursor(IDC_HSPLITBAR);
00222
00223     } else {
00224         //The DOCK bar is horizontal
00225         if (nID == AFX_IDW_SIZEBAR_TOP)
00226             rcWin.top = rcWin.bottom - TRACK_BORDER_SIZE;
00227         else
00228             rcWin.bottom = rcWin.top + TRACK_BORDER_SIZE;
00229
00230         if( rcWin.PtInRect(point) )
00231             hCur = AfxGetApp()->LoadCursor(IDC_VSPLITBAR);
00232     }
00233
00234     if( hCur )
00235         SetCursor(hCur);
00236
00237     m_bOkToDrag = BOOL((long)hCur);
00238 }

_CJXLIB_INLINE BOOL CCJSizeDockBar::IsDockBar ( ) const [virtual]

Definition at line 233 of file CJSizeDockBar.h.

References m_bIsDockBar.

00234     { return m_bIsDockBar; }

_CJXLIB_INLINE BOOL CCJSizeDockBar::IsDockSizeBar ( ) const [virtual]

Definition at line 236 of file CJSizeDockBar.h.

References TRUE.

Referenced by CCJDockContext::CanDockDockBar.

00237     { return TRUE; }

BOOL CCJSizeDockBar::IsLastControlBar ( int index ) [protected]

Definition at line 462 of file CJSizeDockBar.cpp.

References FALSE, NULL, and TRUE.

Referenced by CalcSizeBarLayout.

00463 {
00464     for( int i=index; i<m_arrBars.GetSize(); ++i)
00465     {
00466         CCJControlBar *pOther = (CCJControlBar *)GetDockedControlBar(i);
00467         if (pOther != NULL && pOther->IsVisible())
00468         {
00469             return FALSE;
00470         }
00471     }
00472
00473     return TRUE;
00474 }

void CCJSizeDockBar::Maximize ( CCJControlBar * )

Definition at line 685 of file CJSizeDockBar.cpp.

References CalcSizeBarLayout, CCJControlBar::GetMinExt, CCJControlBar::IsBottomDocked, CCJControlBar::IsLeftDocked, CCJControlBar::IsRightDocked, CCJControlBar::IsTopDocked, CCJControlBar::Maximize, CCJControlBar::Minimize, NULL, and TRUE.

00686 {
00687     int iExt=0;
00688     CRect rectAvail;
00689     GetClientRect(rectAvail);
00690
00691     for (int i=0; i<m_arrBars.GetSize(); ++i)
00692     {
00693         CCJControlBar *pBarDock = (CCJControlBar *)GetDockedControlBar(i);
00694         if (pBarDock && pBarDock->IsVisible() && pBarDock != pBar) {
00695             pBarDock->Minimize();
00696             iExt += pBarDock->GetMinExt();
00697         }
00698     }
00699
00700     if (pBar->IsLeftDocked() || pBar->IsRightDocked()) {
00701         iExt = rectAvail.Height()-iExt;
00702     }
00703
00704     if (pBar->IsTopDocked() || pBar->IsBottomDocked()) {
00705         iExt = rectAvail.Width()-iExt;
00706     }
00707
00708     pBar->Maximize(iExt);
00709
00710     //1999-05-26 Yiannhs
00711     //do not care too much about flickering when maximizing controlbars
00712     CalcSizeBarLayout();
00713
00714     for (i=0; i<m_arrBars.GetSize(); ++i)
00715     {
00716         CCJControlBar *pBarDock = (CCJControlBar *)GetDockedControlBar(i);
00717         if (pBarDock && pBarDock->IsVisible() ) {
00718             pBarDock->InvalidateRect(NULL, TRUE);
00719             pBarDock->UpdateWindow();
00720         }
00721     }
00722     //1999-05-26 Yiannhs
00723 }

void CCJSizeDockBar::Normalize ( CCJControlBar * )

Definition at line 725 of file CJSizeDockBar.cpp.

References CalcSizeBarLayout, CCJControlBar::Normalize, NULL, and TRUE.

00726 {
00727     for( int i=0; i<m_arrBars.GetSize(); ++i) {
00728         CCJControlBar *pBarDock = (CCJControlBar*)GetDockedControlBar(i);
00729         if (pBarDock && pBarDock->IsVisible())
00730             pBarDock->Normalize();
00731     }
00732
00733
00734     //1999-05-26 Yiannhs
00735     //do not care too much about flickering when maximizing controlbars
00736
00737     CalcSizeBarLayout();
00738
00739     for (i=0; i<m_arrBars.GetSize(); ++i)
00740     {
00741         CCJControlBar *pBarDock = (CCJControlBar *)GetDockedControlBar(i);
00742         if (pBarDock && pBarDock->IsVisible() ) {
00743             pBarDock->InvalidateRect(NULL, TRUE);
00744             pBarDock->UpdateWindow();
00745         }
00746     }
00747     //1999-05-26 Yiannhs
00748 }

void CCJSizeDockBar::OnInvertTracker ( const CRect & ) [virtual]

Definition at line 184 of file CJSizeDockBar.cpp.

References ASSERT, and NULL.

Referenced by OnLButtonUp, OnMouseMove, and OnNcLButtonDown.

00185 {
00186     ASSERT_VALID(this);
00187     ASSERT(!rect.IsRectEmpty());
00188
00189     CDC* pDC = GetDockingFrame()->GetDC();
00190     CBrush* pBrush = CDC::GetHalftoneBrush();
00191     CBrush* pOldBrush = NULL;
00192
00193     if (pBrush != NULL) {
00194         pOldBrush = pDC->SelectObject(pBrush);
00195     }
00196
00197     pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATINVERT);
00198
00199     if (pOldBrush != NULL) {
00200         pDC->SelectObject(pOldBrush);
00201     }
00202     GetDockingFrame()->ReleaseDC(pDC);
00203 }

void CCJSizeDockBar::OnLButtonUp | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 330 of file CJSizeDockBar.cpp.

References AFX_IDW_SIZEBAR_BOTTOM, AFX_IDW_SIZEBAR_LEFT, AFX_IDW_SIZEBAR_RIGHT, AFX_IDW_SIZEBAR_TOP, FALSE, GetAvailableRect, m_bDragging, m_iActualSize, m_iSafeSpace, m_ptCurrent, m_ptStartDrag, m_rcTrack, NULL, OnInvertTracker, RecalcAllExcept, and TRACK_BORDER_SIZE.

00331 {
00332     if( m_ptCurrent == point ) {
00333         ReleaseCapture();
00334         m_bDragging = FALSE;
00335         OnInvertTracker(m_rcTrack);
00336         CDockBar::OnLButtonUp(nFlags, point);
00337     }
00338
00339     else if( m_bDragging )
00340     {
00341         CRect rectWin;
00342         CRect rectAvail;
00343         GetWindowRect(&rectWin);
00344         ReleaseCapture();
00345         m_bDragging = FALSE;
00346         OnInvertTracker(m_rcTrack);
00347         GetAvailableRect(rectAvail);
00348         UINT nID = ((UINT)(WORD)::GetDlgCtrlID(m_hWnd));
00349
00350         if (nID == AFX_IDW_SIZEBAR_LEFT ) {
00351             int maxWidth = rectAvail.Width()-m_iSafeSpace;
00352             int newWidth = m_rcTrack.left-m_ptStartDrag.x;
00353             m_iActualSize = newWidth>maxWidth ? maxWidth: newWidth;
00354             m_iActualSize += rectWin.Width();
00355         }
00356
00357         else if (nID == AFX_IDW_SIZEBAR_TOP) {
00358             int maxHeight = rectAvail.Height()-m_iSafeSpace;
00359             int newHeight = m_rcTrack.top-m_ptStartDrag.y;
00360             m_iActualSize = newHeight>maxHeight ? maxHeight : newHeight;
00361             m_iActualSize += rectWin.Height();
00362         }
00363
00364         else if (nID == AFX_IDW_SIZEBAR_RIGHT) {
00365             int maxWidth = rectAvail.Width()-m_iSafeSpace;
00366             int newWidth = m_ptStartDrag.x-m_rcTrack.left;
00367             m_iActualSize = newWidth>maxWidth ? maxWidth: newWidth;
00368             m_iActualSize += rectWin.Width();
00369         }
00370
00371         else if (nID == AFX_IDW_SIZEBAR_BOTTOM) {
00372             int maxHeight = rectAvail.Height()-m_iSafeSpace;
00373             int newHeight = m_ptStartDrag.y-m_rcTrack.top;
00374             m_iActualSize = newHeight>maxHeight ? maxHeight : newHeight;
00375             m_iActualSize += rectWin.Height();
00376         }
00377
00378         if(m_iActualSize< TRACK_BORDER_SIZE )
00379             m_iActualSize = TRACK_BORDER_SIZE;
00380
00381         GetDockingFrame()->RecalcLayout();
00382         RecalcAllExcept(NULL);
00383
00384     } else {
00385         //Yiannhs
00386         CDockBar::OnLButtonUp(nFlags, point);
00387     }
00388 }

void CCJSizeDockBar::OnMouseMove | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 390 of file CJSizeDockBar.cpp.

References AFX_IDW_SIZEBAR_BOTTOM, AFX_IDW_SIZEBAR_LEFT, AFX_IDW_SIZEBAR_RIGHT, AFX_IDW_SIZEBAR_TOP, GetAvailableRect, m_iActualSize, m_ptCurDrag, m_rcTrack, OnInvertTracker, and TRACK_BORDER_SIZE.

00391 {
00392     if( m_bDragging )
00393     {
00394         CRect rectWin;
00395         GetWindowRect(&rectWin);
00396         CRect rectAvail;
00397         GetAvailableRect(rectAvail);
00398         CFrameWnd *pFrame=GetDockingFrame();
00399         ClientToScreen(&point);
00400         pFrame->ScreenToClient(&point);
00401         UINT nID = ((UINT)(WORD)::GetDlgCtrlID(m_hWnd));
00402
00403         if (nID == AFX_IDW_SIZEBAR_LEFT) {
00404             point.x = point.x > rectAvail.right ? rectAvail.right : point.x;
00405             point.x = point.x < TRACK_BORDER_SIZE ? TRACK_BORDER_SIZE : point.x;
00406         }
00407
00408         else if (nID == AFX_IDW_SIZEBAR_TOP) {
00409             point.y = point.y > rectAvail.bottom ? rectAvail.bottom : point.y;
00410             point.y = point.y < TRACK_BORDER_SIZE ? TRACK_BORDER_SIZE : point.y;
00411         }
00412
00413         else if (nID == AFX_IDW_SIZEBAR_RIGHT) {
00414             point.x = point.x < rectAvail.left ? rectAvail.left:point.x;
00415             point.x = point.x > rectAvail.right + m_iActualSize - TRACK_BORDER_SIZE ?
00416                                 rectAvail.right - TRACK_BORDER_SIZE + m_iActualSize : point.x;
00417         }
00418
00419         else if (nID == AFX_IDW_SIZEBAR_BOTTOM) {
00420             point.y = point.y < rectAvail.top ? rectAvail.top : point.y;
00421             point.y = point.y > rectAvail.bottom + m_iActualSize - TRACK_BORDER_SIZE ?
00422                                 rectAvail.bottom - TRACK_BORDER_SIZE + m_iActualSize : point.y;
00423         }
00424
00425         int deltaX = point.x - m_ptCurDrag.x;
00426         int deltaY = point.y - m_ptCurDrag.y;
00427
00428         m_ptCurDrag = point;
00429
00430         if (nID == AFX_IDW_SIZEBAR_LEFT || nID == AFX_IDW_SIZEBAR_RIGHT && deltaX)
00431         {
00432             OnInvertTracker(m_rcTrack);
00433             m_rcTrack.left+=deltaX;
00434             m_rcTrack.right+=deltaX;
00435             OnInvertTracker(m_rcTrack);
00436         }
00437
00438         else if( nID == AFX_IDW_SIZEBAR_TOP || nID == AFX_IDW_SIZEBAR_BOTTOM && deltaY)
00439         {
00440             OnInvertTracker(m_rcTrack);
00441             m_rcTrack.top+=deltaY;
00442             m_rcTrack.bottom+=deltaY;
00443             OnInvertTracker(m_rcTrack);
00444         }
00445
00446     } else {
00447         //Yiannhs
00448         CDockBar::OnMouseMove(nFlags, point);
00449     }
00450 }

void CCJSizeDockBar::OnNcCalcSize | ( | BOOL | bCalcValidRects,
 |  | NCCALCSIZE_PARAMS FAR * | lpncsp
 | ) | [protected]

Definition at line 248 of file CJSizeDockBar.cpp.

References AFX_IDW_SIZEBAR_BOTTOM, AFX_IDW_SIZEBAR_LEFT, AFX_IDW_SIZEBAR_RIGHT, AFX_IDW_SIZEBAR_TOP, and TRACK_BORDER_SIZE.

00249 {
00250     UINT nID = ((UINT)(WORD)::GetDlgCtrlID(m_hWnd));
00251     //Yiannhs changed the tracksize variable
00252     if (nID == AFX_IDW_SIZEBAR_LEFT) {
00253         m_cyBottomBorder += TRACK_BORDER_SIZE;
00254         CDockBar::OnNcCalcSize(bCalcValidRects, lpncsp);
00255         m_cyBottomBorder -= TRACK_BORDER_SIZE;
00256     }
00257
00258     else if (nID == AFX_IDW_SIZEBAR_TOP) {
00259         m_cyBottomBorder += TRACK_BORDER_SIZE;
00260         CDockBar::OnNcCalcSize(bCalcValidRects, lpncsp);
00261         m_cyBottomBorder -= TRACK_BORDER_SIZE;
00262     }
00263
00264     else if (nID == AFX_IDW_SIZEBAR_RIGHT) {
00265         m_cyTopBorder += TRACK_BORDER_SIZE;
00266         CDockBar::OnNcCalcSize(bCalcValidRects, lpncsp);
00267         m_cyTopBorder -= TRACK_BORDER_SIZE;
00268     }
00269
00270     else if (nID == AFX_IDW_SIZEBAR_BOTTOM) {
00271         m_cyTopBorder += TRACK_BORDER_SIZE;
00272         CDockBar::OnNcCalcSize(bCalcValidRects, lpncsp);
00273         m_cyTopBorder -= TRACK_BORDER_SIZE;
00274     }
00275 }

UINT CCJSizeDockBar::OnNcHitTest ( CPoint point ) [protected]

Definition at line 283 of file CJSizeDockBar.cpp.

References HitTest.

00284 {
00285     HitTest(point);
00286     return (m_bOkToDrag)?HTBORDER:CDockBar::OnNcHitTest(point);
00287 }

void CCJSizeDockBar::OnNcLButtonDown | ( | UINT | nHitTest,
 |  | CPoint | point
 | ) | [protected]

Definition at line 289 of file CJSizeDockBar.cpp.

References AFX_IDW_SIZEBAR_BOTTOM, AFX_IDW_SIZEBAR_LEFT, AFX_IDW_SIZEBAR_RIGHT, AFX_IDW_SIZEBAR_TOP, m_bDragging, m_ptCurDrag, m_ptCurrent, m_ptStartDrag, m_rcTrack, OnInvertTracker, TRACK_BORDER_SIZE, and TRUE.

00290 {
00291     // save the current cursor postion.
00292     m_ptCurrent = point;
00293     ScreenToClient(&m_ptCurrent);
00294
00295     if( m_bOkToDrag )
00296     {
00297         UINT nID = ((UINT)(WORD)::GetDlgCtrlID(m_hWnd));
00298         CFrameWnd *pFrame=GetDockingFrame();
00299         GetWindowRect(m_rcTrack);
00300
00301         //Yiannhs changed tracsize variable
00302         if (nID == AFX_IDW_SIZEBAR_LEFT)
00303             m_rcTrack.left = m_rcTrack.right - TRACK_BORDER_SIZE;
00304
00305         else if (nID == AFX_IDW_SIZEBAR_TOP)
00306             m_rcTrack.top = m_rcTrack.bottom - TRACK_BORDER_SIZE;
00307
00308         else if (nID == AFX_IDW_SIZEBAR_RIGHT)
00309             m_rcTrack.right = m_rcTrack.left + TRACK_BORDER_SIZE;
00310
00311         else if (nID == AFX_IDW_SIZEBAR_BOTTOM)
00312             m_rcTrack.bottom = m_rcTrack.top + TRACK_BORDER_SIZE;
00313
00314         pFrame->ScreenToClient(&m_rcTrack);
00315         pFrame->ScreenToClient(&point);
00316
00317         m_ptStartDrag = point;
00318         m_ptCurDrag = point;
00319
00320         SetCapture();
00321         m_bDragging = TRUE;
00322         OnInvertTracker(m_rcTrack);
00323
00324     } else {
00325         //Yiannhs
00326         CDockBar::OnNcLButtonDown(nHitTest, point);
00327     }
00328 }

void CCJSizeDockBar::OnNcPaint ( ) [protected]

Definition at line 243 of file CJSizeDockBar.cpp.

References EraseNonClient.

00244 {
00245     EraseNonClient();
00246 }

BOOL CCJSizeDockBar::OnSetCursor | ( | CWnd * | pWnd,
 |  | UINT | nHitTest,
 |  | UINT | message
 | ) | [protected]

Definition at line 277 of file CJSizeDockBar.cpp.

References FALSE.

00278 {
00279     return (nHitTest == HTCLIENT)?
00280         CDockBar::OnSetCursor(pWnd, nHitTest, message):FALSE;
00281 }

void CCJSizeDockBar::RecalcAllExcept ( CCJSizeDockBar * pBar )

Definition at line 481 of file CJSizeDockBar.cpp.

References CalcSizeBarLayout, dwSizeBarMap, and NULL.

Referenced by OnLButtonUp.

00482 {
00483     CFrameWnd *pFrame = GetParentFrame();
00484     ASSERT_VALID(pFrame);
00485
00486     for (int i = 0; i < 4; i++)
00487     {
00488         CCJSizeDockBar* pDock = (CCJSizeDockBar*)pFrame->GetControlBar(dwSizeBarMap[i][0]);
00489         if (pDock != NULL && pDock != pBar) {
00490             pDock->CalcSizeBarLayout();
00491         }
00492     }
00493 }

_CJXLIB_INLINE void CCJSizeDockBar::SetActualSize ( int iSize )

Definition at line 239 of file CJSizeDockBar.h.

References m_iActualSize.

Referenced by CCJMDIFrameWnd::DockSizeBar, CCJMDIChildWnd::DockSizeBar, and CCJFrameWnd::DockSizeBar.

00240     { m_iActualSize=iSize; }

Member Data Documentation

BOOL CCJSizeDockBar::m_bDragging [protected]

Definition at line 126 of file CJSizeDockBar.h.

Referenced by CCJSizeDockBar, OnLButtonUp, and OnNcLButtonDown.

BOOL CCJSizeDockBar::m_bFlatBorder [protected]

Definition at line 142 of file CJSizeDockBar.h.

Referenced by CCJSizeDockBar, DrawBorders, and FlatBorder.

bool CCJSizeDockBar::m_bIsDockBar = false [static]

Definition at line 106 of file CJSizeDockBar.cpp.

Referenced by IsDockBar, CCJMDIFrameWnd::LoadBarState, CCJFrameWnd::LoadBarState, CCJMDIFrameWnd::SaveBarState, and CCJFrameWnd::SaveBarState.

BOOL CCJSizeDockBar::m_bOkToDrag [protected]

Definition at line 129 of file CJSizeDockBar.h.

Referenced by CCJSizeDockBar, and HitTest.

HCURSOR CCJSizeDockBar::m_curHSplitBar [protected]

Definition at line 136 of file CJSizeDockBar.h.

HCURSOR CCJSizeDockBar::m_curVSplitBar [protected]

Definition at line 139 of file CJSizeDockBar.h.

int CCJSizeDockBar::m_iActualSize [protected]

Definition at line 124 of file CJSizeDockBar.h.

Referenced by CalcDynamicLayout, CCJSizeDockBar, OnLButtonUp, OnMouseMove, and SetActualSize.

int CCJSizeDockBar::m_iSafeSpace [protected]

Definition at line 122 of file CJSizeDockBar.h.

Referenced by CCJSizeDockBar, and OnLButtonUp.

CPoint CCJSizeDockBar::m_ptCurDrag [protected]

Definition at line 133 of file CJSizeDockBar.h.

Referenced by OnMouseMove, and OnNcLButtonDown.

CPoint CCJSizeDockBar::m_ptCurrent [protected]

Definition at line 143 of file CJSizeDockBar.h.

Referenced by CCJSizeDockBar, OnLButtonUp, and OnNcLButtonDown.

CPoint CCJSizeDockBar::m_ptStartDrag [protected]

Definition at line 134 of file CJSizeDockBar.h.

Referenced by OnLButtonUp, and OnNcLButtonDown.

CRect CCJSizeDockBar::m_rcTrack [protected]

Definition at line 132 of file CJSizeDockBar.h.

Referenced by OnLButtonUp, OnMouseMove, and OnNcLButtonDown.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJSizeDockBar.h
  • WinCvs/CJLib/CJLibrary/CJSizeDockBar.cpp
Generated on Sun Feb 24 01:25:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJSortClass Class Reference

#include <CJSortClass.h>

Collaboration diagram for CCJSortClass:

[legend]
List of all members.

Public Methods

CCJSortClass (CListCtrl *pWnd, const int nCol)
virtual | ~CCJSortClass ()
virtual void | Sort (bool bAsc, DATA_TYPE eType)

Static Protected Methods

int CALLBACK | Compare (LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)

Protected Attributes

CListCtrl * m_pWnd

Constructor & Destructor Documentation

CCJSortClass::CCJSortClass | ( | CListCtrl * | pWnd,
 |  | const int | nCol
 | ) |

Definition at line 38 of file CJSortClass.cpp.

References ASSERT, and m_pWnd.

00039 {
00040     ASSERT(pWnd);
00041     m_pWnd = pWnd;
00042
00043     int nCount = m_pWnd->GetItemCount();
00044     DWORD dwData;
00045     CString strItemText;
00046
00047     // replace Item data with pointer to CSortItem structure
00048     for (int i = 0; i < nCount; i++)
00049     {
00050         dwData = m_pWnd->GetItemData(i); // save current data to restore it later
00051         strItemText = m_pWnd->GetItemText(i, nCol);
00052         m_pWnd->SetItemData(i, (DWORD) new CSortItem(dwData, strItemText));
00053     }
00054 }

CCJSortClass::~CCJSortClass ( ) [virtual]

Definition at line 56 of file CJSortClass.cpp.

References ASSERT, and m_pWnd.

00057 {
00058     ASSERT(m_pWnd);
00059     int nCount = m_pWnd->GetItemCount();
00060     CSortItem * pItem;
00061     for (int i = 0; i < nCount; i++)
00062     {
00063         pItem = (CSortItem *) m_pWnd->GetItemData(i);
00064         ASSERT(pItem);
00065         m_pWnd->SetItemData(i, pItem->m_dwData);
00066         delete pItem;
00067     }
00068 }

Member Function Documentation

int CALLBACK CCJSortClass::Compare | ( | LPARAM | lParam1,
 |  | LPARAM | lParam2,
 |  | LPARAM | lParamSort
 | ) | [static, protected]

Definition at line 81 of file CJSortClass.cpp.

References ASSERT, DATA_TYPE, DT_DATETIME, DT_DEC, DT_INT, DT_STRING, and NULL.

Referenced by Sort.

00082 {
00083     CSortItem* item1 = (CSortItem *) lParam1;
00084     CSortItem* item2 = (CSortItem *) lParam2;
00085
00086     ASSERT(item1 && item2);
00087
00088     // restore data type and sort order from lParamSort
00089     // if lParamSort positive - ascending sort order, negative - descending
00090     short     sOrder = lParamSort < 0 ? (short) -1 : (short) 1;
00091
00092     DATA_TYPE eType  = (DATA_TYPE) (lParamSort * sOrder); // get rid of sign
00093
00094     // declare typed buffers
00095     COleDateTime t1, t2;
00096
00097     switch (eType)
00098     {
00099     case DT_INT:
00100         return ( _ttol( item1->m_strItemText ) - _ttol( item2->m_strItemText )) * sOrder;
00101
00102     case DT_DEC:
00103 #ifdef _UNICODE
00104         {
00105             char szText1[ 256 ];
00106             char szText2[ 256 ];
00107
00108             WideCharToMultiByte( CP_ACP,
00109                                  0,
00110                                  item1->m_strItemText,
00111                                  -1,
00112                                  szText1,
00113                                  255,
00114                                  NULL,
00115                                  NULL );
00116
00117             WideCharToMultiByte( CP_ACP,
00118                                  0,
00119                                  item2->m_strItemText,
00120                                  -1,
00121                                  szText2,
00122                                  255,
00123                                  NULL,
00124                                  NULL );
00125
00126
00127             return ( atof( szText1 ) < atof( szText2 ) ? -1 : 1) * sOrder;
00128         }
00129 #else
00130         return ( atof ( item1->m_strItemText ) < atof( item2->m_strItemText ) ? -1 : 1) * sOrder;
00131 #endif
00132
00133     case DT_DATETIME:
00134         if( t1.ParseDateTime( item1->m_strItemText ) && t2.ParseDateTime( item2->m_strItemText ))
00135         {
00136             return (t1 < t2 ? -1 : 1 ) * sOrder;
00137         }
00138         return 0;
00139
00140     case DT_STRING:
00141         return item1->m_strItemText.CompareNoCase( item2->m_strItemText ) * sOrder;
00142
00143     default:
00144         ASSERT("Error: attempt to sort a column without type.");
00145         return 0;
00146     }
00147 }

void CCJSortClass::Sort | ( | bool | bAsc,
 |  | DATA_TYPE | eType
 | ) | [virtual]

Definition at line 70 of file CJSortClass.cpp.

References Compare, DATA_TYPE, and m_pWnd.

00071 {
00072     long lParamSort = eType;
00073
00074     // if lParamSort positive - ascending sort order, negative - descending
00075     if (!bAsc)
00076         lParamSort *= -1;
00077
00078     m_pWnd->SortItems(Compare, lParamSort);
00079 }

Member Data Documentation

CListCtrl* CCJSortClass::m_pWnd [protected]

Definition at line 70 of file CJSortClass.h.

Referenced by CCJSortClass, Sort, and ~CCJSortClass.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJSortClass.h
  • WinCvs/CJLib/CJLibrary/CJSortClass.cpp
Generated on Sun Feb 24 01:25:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJSortClass::CSortItem Struct Reference

#include <CJSortClass.h>

Collaboration diagram for CCJSortClass::CSortItem:

[legend]
List of all members.

Public Methods

CSortItem (const DWORD dwData, const CString &strItemText)

Public Attributes

DWORD | m_dwData
CString | m_strItemText

Constructor & Destructor Documentation

_CJXLIB_INLINE CCJSortClass::CSortItem::CSortItem | ( | const DWORD | dwData,
 |  | const CString & | strItemText
 | ) |

Definition at line 91 of file CJSortClass.h.

References m_dwData, and m_strItemText.

00092     { m_dwData  = dwData; m_strItemText = strItemText; }

Member Data Documentation

DWORD CCJSortClass::CSortItem::m_dwData

Definition at line 82 of file CJSortClass.h.

Referenced by CSortItem.

CString CCJSortClass::CSortItem::m_strItemText

Definition at line 83 of file CJSortClass.h.

Referenced by CSortItem.

The documentation for this struct was generated from the following file:
  • WinCvs/CJLib/Include/CJSortClass.h
Generated on Sun Feb 24 01:25:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJStatusBar Class Reference

#include <CJStatusBar.h>

Inheritance diagram for CCJStatusBar:

[legend]
Collaboration diagram for CCJStatusBar:

[legend]
List of all members.

Public Methods

CCJStatusBar ()
virtual | ~CCJStatusBar ()
virtual void | PositionControls ()
virtual CCJStatusBarPaneControlInfo * | GetPanControl (int nPaneID)
virtual BOOL | AddControl (CWnd *pWnd, int nPaneID, BOOL bAutodeleteControl=TRUE)
virtual void | SetPaneWidth (int index, int cxWidth)
virtual BOOL | AddIndicator (int position, UINT paneID)
virtual BOOL | GetStatusPane (int nIndex, CCJStatusBarPane &xfxpane)
virtual void | RemovePane (int nPaneID)

Protected Methods

afx_msg void | OnSize (UINT nType, int cx, int cy)

Private Attributes

CArray< CCJStatusBarPaneControlInfo *,
CCJStatusBarPaneControlInfo * > 		m_aPans

Constructor & Destructor Documentation

CCJStatusBar::CCJStatusBar ( )

Definition at line 87 of file CJStatusBar.cpp.

00088 {
00089     // TODO: add construction code here.
00090 }

CCJStatusBar::~CCJStatusBar ( ) [virtual]

Definition at line 92 of file CJStatusBar.cpp.

References m_aPans.

00093 {
00094     for( int i = 0; i < m_aPans.GetSize(); i++ )
00095     {
00096         if( m_aPans[i]->m_pWnd && ::IsWindow(m_aPans[i]->m_pWnd->m_hWnd) )
00097             m_aPans[i]->m_pWnd->CloseWindow();
00098         if( m_aPans[i]->m_bAutodelete )
00099         {
00100             delete m_aPans[i]->m_pWnd;
00101         }
00102         delete m_aPans[i];
00103     }
00104 }

Member Function Documentation

BOOL CCJStatusBar::AddControl | ( | CWnd * | pWnd,
 |  | int | nPaneID,
 |  | BOOL | bAutodeleteControl = TRUE
 | ) | [virtual]

Definition at line 159 of file CJStatusBar.cpp.

References FALSE, GetPanControl, m_aPans, CCJStatusBarPaneControlInfo::m_bAutodelete, CCJStatusBarPaneControlInfo::m_nPaneID, CCJStatusBarPaneControlInfo::m_pWnd, PositionControls, and TRUE.

00160 {
00161
00162     CCJStatusBarPaneControlInfo * pPanInfo = GetPanControl(paneID);
00163     if( pPanInfo )
00164         return FALSE;
00165
00166     int idx = CommandToIndex( paneID ) ;
00167     if( idx == -1 )
00168         return FALSE;
00169
00170     CCJStatusBarPaneControlInfo * pPan = new CCJStatusBarPaneControlInfo;
00171     pPan->m_nPaneID =  paneID;
00172     pPan->m_pWnd    =  pWnd;
00173     pPan->m_bAutodelete = bAutodeleteControl;
00174
00175     m_aPans.Add(pPan);
00176     PositionControls();
00177     Invalidate(TRUE);
00178     return TRUE;
00179 }

BOOL CCJStatusBar::AddIndicator | ( | int | position,
 |  | UINT | paneID
 | ) | [virtual]

Definition at line 200 of file CJStatusBar.cpp.

References FALSE, GetStatusPane, CCJStatusBarPane::m_nID, PositionControls, SetPaneWidth, and TRUE.

00201 {
00202     CArray<CCJStatusBarPane,CCJStatusBarPane> arPanes;
00203
00204     CCJStatusBarPane statusPane;
00205     int i;
00206
00207     i = 0;
00208     while( GetStatusPane(i,statusPane) )
00209     {
00210         arPanes.Add( statusPane );
00211         i++;
00212     }
00213     if( position < 0 )
00214         position = 0;
00215     if( position > arPanes.GetSize() )
00216         position = arPanes.GetSize()-1;
00217
00218     for(i = 0; i < arPanes.GetSize(); i ++ )
00219     {
00220         if( paneID == arPanes[i].m_nID )
00221         {
00222             TRACE0( "CCJStatusBar::AddIndicator(): Pane ID already exists \n" );
00223             return FALSE;
00224         }
00225     }
00226
00227     CCJStatusBarPane new_statusPane;
00228     new_statusPane.m_nID = paneID;
00229     if( arPanes.GetSize() )
00230         arPanes.InsertAt(position,new_statusPane);
00231     else
00232         arPanes.Add(new_statusPane);
00233
00234     UINT * pIndicators = new UINT[arPanes.GetSize()];
00235     for(i=0;i<arPanes.GetSize();i++)
00236         pIndicators[i]=arPanes[i].m_nID;
00237
00238     SetRedraw(FALSE);
00239     SetIndicators(pIndicators,arPanes.GetSize());
00240
00241     // Replace infos of indicators ..
00242     for(i = 0; i < arPanes.GetSize(); i++ )
00243     {
00244         if( arPanes[i].m_nID != paneID )
00245         {
00246             SetPaneInfo(i,arPanes[i].m_nID,arPanes[i].m_nStyle,arPanes[i].m_cxText);
00247             SetPaneText(i,arPanes[i].m_strText);
00248         }
00249         else
00250         {
00251             SetPaneWidth(i,50);
00252             SetPaneText(i,arPanes[i].m_strText);
00253         }
00254
00255     }
00256
00257     delete [] pIndicators;
00258     SetRedraw(TRUE);
00259     PositionControls();
00260     Invalidate(TRUE);
00261     return TRUE;
00262 }

CCJStatusBarPaneControlInfo * CCJStatusBar::GetPanControl ( int nPaneID ) [virtual]

Definition at line 149 of file CJStatusBar.cpp.

References m_aPans, and NULL.

Referenced by AddControl.

00150 {
00151     for(int i = 0; i < m_aPans.GetSize(); i++ )
00152     {
00153         if( m_aPans[i]->m_nPaneID == nPaneID )
00154             return m_aPans[i];
00155     }
00156     return NULL;
00157 }

BOOL CCJStatusBar::GetStatusPane | ( | int | nIndex,
 |  | CCJStatusBarPane & | xfxpane
 | ) | [virtual]

Definition at line 189 of file CJStatusBar.cpp.

References FALSE, CCJStatusBarPane::m_cxText, CCJStatusBarPane::m_nID, CCJStatusBarPane::m_nStyle, CCJStatusBarPane::m_strText, and TRUE.

Referenced by AddIndicator, and RemovePane.

00190 {
00191     if( nIndex < m_nCount  && nIndex >= 0 )
00192     {
00193         GetPaneInfo( nIndex,  rPane.m_nID, rPane.m_nStyle, rPane.m_cxText ) ;
00194         GetPaneText( nIndex , rPane.m_strText );
00195         return TRUE;
00196     }
00197     return FALSE;
00198 }

void CCJStatusBar::OnSize | ( | UINT | nType,
 |  | int | cx,
 |  | int | cy
 | ) | [protected]

Definition at line 117 of file CJStatusBar.cpp.

References PositionControls.

00118 {
00119     CStatusBar::OnSize(nType, cx, cy);
00120     PositionControls();
00121 }

void CCJStatusBar::PositionControls ( ) [virtual]

Definition at line 123 of file CJStatusBar.cpp.

References m_aPans.

Referenced by AddControl, AddIndicator, OnSize, and RemovePane.

00124 {
00125     int h,v,s;
00126     GetStatusBarCtrl( ).GetBorders( h, v, s ) ;
00127
00128
00129     for(int i = 0; i < m_aPans.GetSize(); i++ )
00130     {
00131         CRect rect;
00132
00133         int index = CommandToIndex( m_aPans[i]->m_nPaneID );
00134         GetItemRect(index,rect);
00135         if( GetPaneStyle(index) & SBPS_NOBORDERS == SBPS_NOBORDERS)
00136             m_aPans[i]->m_pWnd->MoveWindow(rect);
00137         else
00138         {
00139             rect.top+=v;
00140             rect.bottom-=v;
00141             rect.left+=h+s;
00142             rect.right-=(h+s);
00143             m_aPans[i]->m_pWnd->MoveWindow(rect);
00144         }
00145
00146     }
00147 }

void CCJStatusBar::RemovePane ( int nPaneID ) [virtual]

Definition at line 264 of file CJStatusBar.cpp.

References FALSE, GetStatusPane, m_aPans, CCJStatusBarPane::m_nID, NULL, PositionControls, and TRUE.

00265 {
00266     SetRedraw(FALSE);
00267     CWnd * pwnd = NULL;
00268     for( int i = 0; i < m_aPans.GetSize(); i++ )
00269     {
00270         if( m_aPans[i]->m_nPaneID == nPaneID )
00271         {
00272             if( m_aPans[i]->m_bAutodelete )
00273                 pwnd = m_aPans[i]->m_pWnd;
00274             delete m_aPans[i];
00275             m_aPans.RemoveAt(i);
00276             break;
00277         }
00278     }
00279     if( pwnd )
00280     {
00281         pwnd->DestroyWindow();
00282         delete pwnd;
00283     }
00284
00285     CArray<CCJStatusBarPane,CCJStatusBarPane> arPanes;
00286     CCJStatusBarPane statusPane;
00287     i = 0;
00288     while( GetStatusPane(i,statusPane) )
00289     {
00290         if( statusPane.m_nID != (UINT)nPaneID )
00291             arPanes.Add( statusPane );
00292         i++;
00293     }
00294     // Now remove the indicator
00295     UINT * pIndicators = new UINT[arPanes.GetSize()];
00296     for(i=0;i<arPanes.GetSize();i++)
00297         pIndicators[i]=arPanes[i].m_nID;
00298     SetIndicators(pIndicators,arPanes.GetSize());
00299
00300     // Replace infos of indicators ..
00301     for(i = 0; i < arPanes.GetSize(); i++ )
00302     {
00303         SetPaneInfo(i,arPanes[i].m_nID,arPanes[i].m_nStyle,arPanes[i].m_cxText);
00304         SetPaneText(i,arPanes[i].m_strText);
00305     }
00306
00307     delete [] pIndicators;
00308     SetRedraw(TRUE);
00309     PositionControls();
00310     Invalidate(TRUE);
00311 }

void CCJStatusBar::SetPaneWidth | ( | int | index,
 |  | int | cxWidth
 | ) | [virtual]

Definition at line 181 of file CJStatusBar.cpp.

Referenced by AddIndicator.

00182 {
00183     UINT nID,nStyle;
00184     int width;
00185     GetPaneInfo(index,nID,nStyle,width);
00186     SetPaneInfo(index,nID,nStyle,cxWidth);
00187 }

Member Data Documentation

CArray<CCJStatusBarPaneControlInfo*, CCJStatusBarPaneControlInfo*> CCJStatusBar::m_aPans [private]

Definition at line 85 of file CJStatusBar.h.

Referenced by AddControl, GetPanControl, PositionControls, RemovePane, and ~CCJStatusBar.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJStatusBar.h
  • WinCvs/CJLib/CJLibrary/CJStatusBar.cpp
Generated on Sun Feb 24 01:25:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJStatusBarPane Class Reference

#include <CJStatusBar.h>

Inheritance diagram for CCJStatusBarPane:

[legend]
Collaboration diagram for CCJStatusBarPane:

[legend]
List of all members.

Public Methods

CCJStatusBarPane ()
CCJStatusBarPane (CCJStatusBarPane &rPane)
virtual | ~CCJStatusBarPane ()
CCJStatusBarPane & | operator= (CCJStatusBarPane &rPane)

Public Attributes

UINT | m_nID
int | m_cxText
UINT | m_nStyle
UINT | m_nFlags
CString | m_strText

Constructor & Destructor Documentation

CCJStatusBarPane::CCJStatusBarPane ( )

Definition at line 55 of file CJStatusBar.cpp.

00056 {
00057     // TODO: add construction code here.
00058 }

CCJStatusBarPane::CCJStatusBarPane ( CCJStatusBarPane & rPane )

Definition at line 60 of file CJStatusBar.cpp.

References m_cxText, m_nFlags, m_nID, m_nStyle, and m_strText.

00061 {
00062     m_nID     = rPane.m_nID;
00063     m_cxText  = rPane.m_cxText;
00064     m_nStyle  = rPane.m_nStyle;
00065     m_nFlags  = rPane.m_nFlags;
00066     m_strText = rPane.m_strText;
00067 }

CCJStatusBarPane::~CCJStatusBarPane ( ) [virtual]

Definition at line 69 of file CJStatusBar.cpp.

00070 {
00071     // TODO: add destruction code here.
00072 }

Member Function Documentation

CCJStatusBarPane & CCJStatusBarPane::operator= ( CCJStatusBarPane & rPane )

Definition at line 74 of file CJStatusBar.cpp.

References m_cxText, m_nFlags, m_nID, m_nStyle, and m_strText.

00075 {
00076     m_nID     = rPane.m_nID;
00077     m_cxText  = rPane.m_cxText;
00078     m_nStyle  = rPane.m_nStyle;
00079     m_nFlags  = rPane.m_nFlags;
00080     m_strText = rPane.m_strText;
00081     return *this;
00082 }

Member Data Documentation

int CCJStatusBarPane::m_cxText

Definition at line 61 of file CJStatusBar.h.

Referenced by CCJStatusBarPane, CCJStatusBar::GetStatusPane, and operator=.

UINT CCJStatusBarPane::m_nFlags

Definition at line 63 of file CJStatusBar.h.

Referenced by CCJStatusBarPane, and operator=.

UINT CCJStatusBarPane::m_nID

Definition at line 60 of file CJStatusBar.h.

Referenced by CCJStatusBar::AddIndicator, CCJStatusBarPane, CCJStatusBar::GetStatusPane, operator=, and CCJStatusBar::RemovePane.

UINT CCJStatusBarPane::m_nStyle

Definition at line 62 of file CJStatusBar.h.

Referenced by CCJStatusBarPane, CCJStatusBar::GetStatusPane, and operator=.

CString CCJStatusBarPane::m_strText

Definition at line 64 of file CJStatusBar.h.

Referenced by CCJStatusBarPane, CCJStatusBar::GetStatusPane, and operator=.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJStatusBar.h
  • WinCvs/CJLib/CJLibrary/CJStatusBar.cpp
Generated on Sun Feb 24 01:25:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJStatusBarPaneControlInfo Class Reference

#include <CJStatusBar.h>

Inheritance diagram for CCJStatusBarPaneControlInfo:

[legend]
Collaboration diagram for CCJStatusBarPaneControlInfo:

[legend]
List of all members.

Public Methods

CCJStatusBarPaneControlInfo ()
virtual | ~CCJStatusBarPaneControlInfo ()

Public Attributes

CWnd * m_pWnd
int | m_nPaneID
BOOL | m_bAutodelete

Constructor & Destructor Documentation

CCJStatusBarPaneControlInfo::CCJStatusBarPaneControlInfo ( )

Definition at line 38 of file CJStatusBar.cpp.

References m_bAutodelete, m_nPaneID, m_pWnd, NULL, and TRUE.

00039 {
00040     m_pWnd        = NULL;
00041     m_bAutodelete = TRUE;
00042     m_nPaneID     = 0;
00043 }

CCJStatusBarPaneControlInfo::~CCJStatusBarPaneControlInfo ( ) [virtual]

Definition at line 45 of file CJStatusBar.cpp.

00046 {
00047     // TODO: add destruction code here.
00048 }

Member Data Documentation

BOOL CCJStatusBarPaneControlInfo::m_bAutodelete

Definition at line 44 of file CJStatusBar.h.

Referenced by CCJStatusBar::AddControl, and CCJStatusBarPaneControlInfo.

int CCJStatusBarPaneControlInfo::m_nPaneID

Definition at line 43 of file CJStatusBar.h.

Referenced by CCJStatusBar::AddControl, and CCJStatusBarPaneControlInfo.

CWnd* CCJStatusBarPaneControlInfo::m_pWnd

Definition at line 42 of file CJStatusBar.h.

Referenced by CCJStatusBar::AddControl, and CCJStatusBarPaneControlInfo.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJStatusBar.h
  • WinCvs/CJLib/CJLibrary/CJStatusBar.cpp
Generated on Sun Feb 24 01:25:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJTabCtrl Class Reference

#include <CJTabCtrl.h>

Inheritance diagram for CCJTabCtrl:

[legend]
Collaboration diagram for CCJTabCtrl:

[legend]
List of all members.

Public Methods

CCJTabCtrl ()
virtual | ~CCJTabCtrl ()
virtual void | UpdateFont ()
virtual void | SetMenuID (UINT popupMenuID, UINT popToolbarID=0, int nPos=0)
virtual UINT | GetMenuID ()
virtual BOOL | Create (CWnd *pParentWnd, UINT nID=AFX_IDC_TAB_CONTROL, DWORD dwStyle=WS_VISIBLE|WS_CHILD|TCS_BOTTOM|TCS_TOOLTIPS|WS_CLIPSIBLINGS|WS_CLIPCHILDREN, const CRect &rect=CRect(0, 0, 0, 0))

Public Attributes

UINT | m_popToolbarID
UINT | m_popupMenuID
CCJMenu m_popupMenu
int | m_nPos
CFont | m_Font

Protected Methods

afx_msg void | OnRButtonDown (UINT nFlags, CPoint point)
afx_msg void | OnMeasureItem (int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)
afx_msg LRESULT | OnMenuChar (UINT nChar, UINT nFlags, CMenu *pMenu)
afx_msg void | OnInitMenuPopup (CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu)
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)
afx_msg void | OnPaint ()

Constructor & Destructor Documentation

CCJTabCtrl::CCJTabCtrl ( )

Definition at line 110 of file CJTabCtrl.cpp.

00111 {
00112     m_popupMenuID   = 0;
00113     m_popToolbarID  = 0;
00114     m_nPos          = 0;
00115 }

CCJTabCtrl::~CCJTabCtrl ( ) [virtual]

Definition at line 117 of file CJTabCtrl.cpp.

References m_Font.

00118 {
00119     // fix potential resource leak - KStowell - 10-22-99.
00120     m_Font.DeleteObject();
00121 }

Member Function Documentation

BOOL CCJTabCtrl::Create | ( | CWnd * | pParentWnd,
 |  | UINT | nID = AFX_IDC_TAB_CONTROL,
 |  | DWORD | dwStyle = WS_VISIBLE|WS_CHILD|TCS_BOTTOM|TCS_TOOLTIPS|WS_CLIPSIBLINGS|WS_CLIPCHILDREN,
 |  | const CRect & | rect = CRect(0, 0, 0, 0)
 | ) | [virtual]

Definition at line 209 of file CJTabCtrl.cpp.

References FALSE, TRUE, and UpdateFont.

Referenced by CCJTabCtrlBar::OnCreate.

00210 {
00211     if (!CTabCtrl::Create(dwStyle, rect, pParentWnd, nID))
00212         return FALSE;
00213
00214     UpdateFont();
00215     return TRUE;
00216 }

_CJXLIB_INLINE UINT CCJTabCtrl::GetMenuID ( ) [virtual]

Definition at line 155 of file CJTabCtrl.h.

References m_popupMenuID.

00156     { return m_popupMenuID; }

BOOL CCJTabCtrl::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 218 of file CJTabCtrl.cpp.

References TRUE.

00219 {
00220     // KStowell - overridden for flicker-free drawing.
00221     UNUSED_ALWAYS(pDC);
00222     return TRUE;
00223 }

void CCJTabCtrl::OnInitMenuPopup | ( | CMenu * | pPopupMenu,
 |  | UINT | nIndex,
 |  | BOOL | bSysMenu
 | ) | [protected]

Definition at line 198 of file CJTabCtrl.cpp.

References CCJMenu::IsMenu, m_popupMenu, and CCJMenu::UpdateMenu.

00199 {
00200     CTabCtrl::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
00201
00202     if(!bSysMenu) {
00203         if (m_popupMenu.IsMenu(pPopupMenu)) {
00204             CCJMenu::UpdateMenu(pPopupMenu);
00205         }
00206     }
00207 }

void CCJTabCtrl::OnMeasureItem | ( | int | nIDCtl,
 |  | LPMEASUREITEMSTRUCT | lpMeasureItemStruct
 | ) | [protected]

Definition at line 172 of file CJTabCtrl.cpp.

References CCJMenu::IsMenu, m_popupMenu, and CCJMenu::MeasureItem.

00173 {
00174     if (lpMeasureItemStruct->CtlType == ODT_MENU)
00175     {
00176         if (IsMenu((HMENU)lpMeasureItemStruct->itemID)) {
00177             CMenu* pMenu = CMenu::FromHandle((HMENU)lpMeasureItemStruct->itemID);
00178
00179             if (m_popupMenu.IsMenu(pMenu)) {
00180                 m_popupMenu.MeasureItem(lpMeasureItemStruct);
00181                 return;
00182             }
00183         }
00184     }
00185
00186     CTabCtrl::OnMeasureItem(nIDCtl, lpMeasureItemStruct);
00187 }

LRESULT CCJTabCtrl::OnMenuChar | ( | UINT | nChar,
 |  | UINT | nFlags,
 |  | CMenu * | pMenu
 | ) | [protected]

Definition at line 189 of file CJTabCtrl.cpp.

References CCJMenu::FindKeyboardShortcut, CCJMenu::IsMenu, and m_popupMenu.

00190 {
00191     if (m_popupMenu.IsMenu(pMenu)) {
00192         return CCJMenu::FindKeyboardShortcut(nChar, nFlags, pMenu);
00193     }
00194
00195     return CTabCtrl::OnMenuChar(nChar, nFlags, pMenu);
00196 }

void CCJTabCtrl::OnPaint ( ) [protected]

Definition at line 235 of file CJTabCtrl.cpp.

00236 {
00237     CPaintDC dc(this); // device context for painting
00238
00239
00240     // KStowell - Get the client rect.
00241     CRect rcClient;
00242     GetClientRect( &rcClient );
00243
00244     // KStowell - Create a memory device-context. This is done to help reduce
00245     // screen flicker, since we will paint the entire control to the
00246     // off screen device context first.
00247     CDC memDC;
00248     CBitmap bitmap;
00249     memDC.CreateCompatibleDC(&dc);
00250     bitmap.CreateCompatibleBitmap(&dc, rcClient.Width(), rcClient.Height());
00251     CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
00252
00253     // KStowell - Repaint the background.
00254     memDC.FillSolidRect( rcClient, afxData.clrBtnFace );
00255
00256     // let the control do its default drawing.
00257     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00258
00259     // KStowell - Copy the memory device context back into the original DC via BitBlt().
00260     dc.BitBlt(rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), &memDC, 0,0, SRCCOPY);
00261
00262     // KStowell - Cleanup resources.
00263     memDC.SelectObject(pOldBitmap);
00264     memDC.DeleteDC();
00265     bitmap.DeleteObject();
00266 }

void CCJTabCtrl::OnRButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 139 of file CJTabCtrl.cpp.

References ASSERT, CCJMenu::DestroyMenu, CCJMenu::LoadMenu, CCJMenu::LoadToolbar, m_nPos, m_popToolbarID, m_popupMenu, m_popupMenuID, NULL, and VERIFY.

00140 {
00141     // No menu was defined...
00142     if (!m_popupMenuID) {
00143         TRACE0( "Warning: No menu resource was associated with CCJTabCtrl.\n" );
00144     }
00145
00146     else
00147     {
00148         // Since we are using the main window as the
00149         // parent, we need to convert the point to screen
00150         // coordinates...
00151         CPoint pt = point;
00152         ClientToScreen(&pt);
00153
00154         // Load the popup menu.
00155         VERIFY(m_popupMenu.LoadMenu(m_popupMenuID));
00156         CCJMenu* pPopup = (CCJMenu*)m_popupMenu.GetSubMenu(m_nPos);
00157         ASSERT(pPopup != NULL);
00158
00159         // Load toolbar resource if any for menu icons.
00160         if (m_popToolbarID) {
00161             pPopup->LoadToolbar(m_popToolbarID);
00162         }
00163
00164         // Display the popup menu, use the main window as its parent.
00165         pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
00166             pt.x, pt.y, AfxGetMainWnd());
00167
00168         m_popupMenu.DestroyMenu();
00169     }
00170 }

_CJXLIB_INLINE void CCJTabCtrl::SetMenuID | ( | UINT | popupMenuID,
 |  | UINT | popToolbarID = 0,
 |  | int | nPos = 0
 | ) | [virtual]

Definition at line 152 of file CJTabCtrl.h.

References m_nPos, m_popToolbarID, and m_popupMenuID.

Referenced by CCJTabCtrlBar::SetTabMenuID.

00153     { m_popupMenuID = popupMenuID; m_popToolbarID = popToolbarID; m_nPos = nPos; }

void CCJTabCtrl::UpdateFont ( ) [virtual]

Definition at line 225 of file CJTabCtrl.cpp.

References m_Font, and VERIFY.

Referenced by Create.

00226 {
00227     m_Font.DeleteObject();
00228     NONCLIENTMETRICS ncm;
00229     ncm.cbSize = sizeof(ncm);
00230     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00231     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00232     SetFont(&m_Font);
00233 }

Member Data Documentation

CFont CCJTabCtrl::m_Font

Definition at line 113 of file CJTabCtrl.h.

Referenced by UpdateFont, and ~CCJTabCtrl.

int CCJTabCtrl::m_nPos

Definition at line 112 of file CJTabCtrl.h.

Referenced by OnRButtonDown, and SetMenuID.

UINT CCJTabCtrl::m_popToolbarID

Definition at line 107 of file CJTabCtrl.h.

Referenced by OnRButtonDown, and SetMenuID.

CCJMenu CCJTabCtrl::m_popupMenu

Definition at line 111 of file CJTabCtrl.h.

Referenced by OnInitMenuPopup, OnMeasureItem, OnMenuChar, and OnRButtonDown.

UINT CCJTabCtrl::m_popupMenuID

Definition at line 110 of file CJTabCtrl.h.

Referenced by GetMenuID, OnRButtonDown, and SetMenuID.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJTabCtrl.h
  • WinCvs/CJLib/CJLibrary/CJTabCtrl.cpp
Generated on Sun Feb 24 01:25:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJTabCtrlBar Class Reference

#include <CJTabCtrlBar.h>

Inheritance diagram for CCJTabCtrlBar:

[legend]
Collaboration diagram for CCJTabCtrlBar:

[legend]
List of all members.

Public Methods

CCJTabCtrlBar ()
virtual | ~CCJTabCtrlBar ()
virtual BOOL | AddView (LPCTSTR lpszLabel, CRuntimeClass *pViewClass, CDocument *pDoc=NULL, UINT nIndex=-1, CCreateContext *pContext=NULL)
virtual void | RemoveView (int nView)
virtual void | SetActiveView (int nView)
virtual void | SetActiveView (CRuntimeClass *pViewClass)
virtual CView * | GetActiveView ()
virtual CView * | GetView (int nView)
virtual CView * | GetView (CRuntimeClass *pViewClass)
virtual CImageList * | SetTabImageList (CImageList *pImageList)
virtual BOOL | ModifyTabStyle (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
virtual LPCTSTR | GetViewName (int nView)
virtual LPCTSTR | GetViewName (CRuntimeClass *pViewClass)
virtual void | DeleteView (int nView)
virtual void | DeleteView (CRuntimeClass *pViewClass)
virtual void | SetViewToolTip (int nView, LPCTSTR lpszLabel)
virtual void | SetViewToolTip (CRuntimeClass *pViewClass, LPCTSTR lpszLabel)
virtual void | GetChildRect (CRect &rect)
virtual void | SetTabMenuID (UINT popupMenuID, UINT popToolbarID=0, int nPos=0)
virtual void | SetActiveView (CView *pUserView)
virtual void | AssociateImageIndexWithRuntimeClass (int nIndex, CRuntimeClass *pRuntimeClass)
void | AssociateImageIndexWithRuntimeClass (int nIndex, LPCTSTR lpszRuntimeClassName)
virtual BOOL | RemoveAllTabs ()
virtual int | GetTabFromPoint (CPoint point=CPoint(0, 0))
virtual BOOL | PreTranslateMessage (MSG *pMsg)

Protected Methods

virtual short | GetImageIndexFromRuntimeClass (CRuntimeClass *pRuntimeClass)
virtual void | RemoveListItem (POSITION pos)
virtual void | OverkillAssert (CRuntimeClass *pViewClass)
virtual void | SizeTabView (CWnd *pWnd)
virtual CToolTipCtrl * | GetToolTip ()
virtual void | AddToolTip (TCB_ITEM *pMember, LPCTSTR lpszLabel)
virtual void | ResetToolTips (CToolTipCtrl *pToolTip)
virtual TCB_ITEM * | CreateTabListItem (LPCTSTR lpszLabel)
virtual BOOL | CreateTabView (CRuntimeClass *pViewClass, CDocument *pDocument, CCreateContext *pContext)
virtual BOOL | EnableToolTips (BOOL bEnable)
afx_msg int | OnCreate (LPCREATESTRUCT lpCreateStruct)
afx_msg void | OnWindowPosChanged (WINDOWPOS FAR *lpwndpos)
afx_msg void | OnTabSelChange (NMHDR *pNMHDR, LRESULT *pResult)

Protected Attributes

int | m_nPointTab
int | m_nActiveTab
int | m_nNextToolTipId
CView * m_pActiveView
CTabViews m_viewList
CCJTabCtrl m_TabCtrl
CMapStringToPtr | m_ClassNameToImageIndexMap
BOOL | m_bToolTipsEnabled

Constructor & Destructor Documentation

CCJTabCtrlBar::CCJTabCtrlBar ( )

Definition at line 198 of file CJTabCtrlBar.cpp.

References TRUE.

00199 {
00200     m_nActiveTab        = 0;
00201     m_nNextToolTipId    = 0;
00202     m_bToolTipsEnabled  = TRUE;
00203 }

CCJTabCtrlBar::~CCJTabCtrlBar ( ) [virtual]

Definition at line 205 of file CJTabCtrlBar.cpp.

References _delete, and m_viewList.

00206 {
00207     while(!m_viewList.IsEmpty())
00208     {
00209         TCB_ITEM *pMember = m_viewList.RemoveHead();
00210         _delete(pMember);
00211     }
00212 }

Member Function Documentation

void CCJTabCtrlBar::AddToolTip | ( | TCB_ITEM * | pMember,
 |  | LPCTSTR | lpszLabel
 | ) | [protected, virtual]

Definition at line 392 of file CJTabCtrlBar.cpp.

References GetToolTip, m_TabCtrl, NULL, and tagTCB_ITEM::uiToolTipId.

Referenced by CreateTabListItem.

00393 {
00394     // Get the tool tips for the tab control.
00395     CToolTipCtrl* pToolTip = GetToolTip();
00396
00397     // Add the tool tip.
00398     if( pMember->uiToolTipId == 0 ) {
00399         pToolTip->AddTool( &m_TabCtrl, lpszLabel,
00400             NULL, pMember->uiToolTipId );
00401     }
00402     else {
00403         pToolTip->AddTool( &m_TabCtrl, lpszLabel,
00404             CRect(0,0,0,0), pMember->uiToolTipId );
00405     }
00406 }

BOOL CCJTabCtrlBar::AddView | ( | LPCTSTR | lpszLabel,
 |  | CRuntimeClass * | pViewClass,
 |  | CDocument * | pDoc = NULL,
 |  | UINT | nIndex = -1,
 |  | CCreateContext * | pContext = NULL
 | ) | [virtual]

Definition at line 431 of file CJTabCtrlBar.cpp.

References CreateTabListItem, CreateTabView, FALSE, GetToolTip, m_pActiveView, m_TabCtrl, m_viewList, NULL, OverkillAssert, ResetToolTips, SizeTabView, and TRUE.

Referenced by CMainFrame::InitializeDockingWindows.

00433 {
00434     OverkillAssert(pViewClass);
00435
00436     // Create the view to be associate with tab.
00437     if (!CreateTabView(pViewClass, pDoc, pContext))
00438         return FALSE;
00439
00440     // Create the tab list item.
00441     if (CreateTabListItem(lpszLabel) == NULL)
00442         return FALSE;
00443
00444     // Since the tool tip count has changed,
00445     // re-initialize the tooltips.
00446     ResetToolTips(GetToolTip());
00447
00448     int nViews = ( nIndex == -1 )?m_viewList.GetCount():nIndex;
00449     if( nViews != 1 ) {
00450         m_pActiveView->EnableWindow(FALSE);
00451         m_pActiveView->ShowWindow(SW_HIDE);
00452     }
00453
00454     // Insert the new tab item.
00455     TC_ITEM tci;
00456     tci.mask    = TCIF_TEXT | TCIF_IMAGE;
00457     tci.pszText = (LPTSTR)(LPCTSTR)lpszLabel;
00458     tci.iImage  = nViews-1;
00459     m_TabCtrl.InsertItem(m_viewList.GetCount()-1, &tci);
00460
00461     // Resize the tab view.
00462     SizeTabView(m_pActiveView);
00463
00464     return TRUE;
00465 }

void CCJTabCtrlBar::AssociateImageIndexWithRuntimeClass | ( | int | nIndex,
 |  | LPCTSTR | lpszRuntimeClassName
 | ) |

Definition at line 791 of file CJTabCtrlBar.cpp.

References m_ClassNameToImageIndexMap.

00792 {
00793     CString szClassName(lpszRuntimeClassName);
00794     m_ClassNameToImageIndexMap[szClassName] = (short*)nIndex;
00795 }

void CCJTabCtrlBar::AssociateImageIndexWithRuntimeClass | ( | int | nIndex,
 |  | CRuntimeClass * | pRuntimeClass
 | ) | [virtual]

Definition at line 785 of file CJTabCtrlBar.cpp.

References m_ClassNameToImageIndexMap.

00786 {
00787     CString szClassName(pRuntimeClass->m_lpszClassName);
00788     m_ClassNameToImageIndexMap[szClassName] = (short*)nIndex;
00789 }

TCB_ITEM * CCJTabCtrlBar::CreateTabListItem ( LPCTSTR lpszLabel ) [protected, virtual]

Definition at line 359 of file CJTabCtrlBar.cpp.

References AddToolTip, m_nNextToolTipId, m_pActiveView, m_viewList, tagTCB_ITEM::pWnd, tagTCB_ITEM::szTabLabel, tagTCB_ITEM::szToolTipLabel, and tagTCB_ITEM::uiToolTipId.

Referenced by AddView.

00360 {
00361     // Allocate a new TCB_ITEM object.
00362     TCB_ITEM* pMember = new TCB_ITEM;
00363
00364     pMember->pWnd           = m_pActiveView;
00365     pMember->szTabLabel     = lpszLabel;
00366     pMember->szToolTipLabel = lpszLabel;
00367     pMember->uiToolTipId    = m_nNextToolTipId++;
00368
00369     // Add the new TCB_ITEM to the tab item list.
00370     m_viewList.AddTail(pMember);
00371
00372     // Create the ToolTip for the tab.
00373     AddToolTip(pMember, lpszLabel);
00374
00375     return pMember;
00376 }

BOOL CCJTabCtrlBar::CreateTabView | ( | CRuntimeClass * | pViewClass,
 |  | CDocument * | pDocument,
 |  | CCreateContext * | pContext
 | ) | [protected, virtual]

Definition at line 301 of file CJTabCtrlBar.cpp.

References ASSERT, FALSE, CCJControlBar::m_bFloating, m_pActiveView, NULL, and TRUE.

Referenced by AddView.

00302 {
00303     CWnd* pWnd = NULL;
00304
00305     // if no context specified, generate one
00306     // from the currently selected client if possible...
00307     if (pContext == NULL)
00308     {
00309         CCreateContext context;
00310
00311         context.m_pNewViewClass     = pViewClass;
00312         context.m_pCurrentDoc       = pDocument;
00313         context.m_pNewDocTemplate   = pDocument?pDocument->GetDocTemplate() : NULL;
00314         context.m_pLastView         = GetParentFrame()->GetActiveView();
00315         context.m_pCurrentFrame     = GetParentFrame();
00316
00317         pContext = &context;
00318     }
00319
00320     TRY
00321     {
00322         // Create the object.
00323         pWnd = DYNAMIC_DOWNCAST(CWnd, pViewClass->CreateObject());
00324         if (!pWnd) AfxThrowMemoryException();
00325     }
00326     CATCH_ALL(e)
00327     {
00328         TRACE0( "Out of memory creating a view.\n" );
00329         // Note: DELETE_EXCEPTION(e) not required
00330         return FALSE;
00331     }
00332     END_CATCH_ALL
00333
00334     ASSERT_KINDOF(CWnd, pWnd);
00335     ASSERT(pWnd->m_hWnd == NULL); // not yet created.
00336
00337     // Create with the right size and position
00338     if (!pWnd->Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
00339         CRect(0,0,0,0), this, 0, pContext))
00340     {
00341         TRACE0( "Warning: couldn't create client pane for view.\n" );
00342         // pWnd will be cleaned up by PostNcDestroy
00343         return FALSE;
00344     }
00345
00346     // Set the newly create view as the active view.
00347     m_pActiveView = DYNAMIC_DOWNCAST(CView, pWnd);
00348     ASSERT_KINDOF(CView, m_pActiveView);
00349
00350     // If we were floating last, call OnInitialUpdate for the view
00351     // since CMiniDockFrameWnd does not do this for us.
00352     if( m_bFloating && m_pActiveView ) {
00353         m_pActiveView->OnInitialUpdate();
00354     }
00355
00356     return TRUE;
00357 }

void CCJTabCtrlBar::DeleteView ( CRuntimeClass * pViewClass ) [virtual]

Definition at line 559 of file CJTabCtrlBar.cpp.

References ASSERT, DeleteView, m_viewList, OverkillAssert, and tagTCB_ITEM::pWnd.

00560 {
00561     OverkillAssert(pViewClass);
00562
00563     int nIndex = 0;
00564     for( POSITION pos = m_viewList.GetHeadPosition(); pos; m_viewList.GetNext( pos ))
00565     {
00566         TCB_ITEM *pMember = m_viewList.GetAt(pos);
00567         ASSERT(pMember);
00568
00569         if (pMember->pWnd->IsKindOf(pViewClass)) {
00570             DeleteView(nIndex);
00571             return;
00572         }
00573         nIndex++;
00574     }
00575 }

void CCJTabCtrlBar::DeleteView ( int nView ) [virtual]

Definition at line 514 of file CJTabCtrlBar.cpp.

References ASSERT, FALSE, GetToolTip, m_nActiveTab, m_pActiveView, m_TabCtrl, m_viewList, NULL, RemoveListItem, ResetToolTips, and SetActiveView.

Referenced by DeleteView.

00515 {
00516     ASSERT_VALID( this );
00517     ASSERT(( nView >= 0 ) && (m_TabCtrl.GetItemCount() > nView));
00518
00519     TRACE2("***DeleteView: %d ( /%d )\n", nView,m_viewList.GetCount());
00520
00521     // Now find the view we want to delete and remove it
00522     POSITION pos = m_viewList.FindIndex(nView);
00523     if( pos != NULL )
00524     {
00525         CView *pOldActiveView;
00526         pOldActiveView = m_pActiveView;
00527
00528         // Ensure that we get no dangling pointers
00529         // DO NOT (RE-)MOVE THIS CODE ! Gero Kuehn [gero.kuehn@isc-soft.de]
00530         if(GetParentFrame()->GetActiveView() == DYNAMIC_DOWNCAST( CView, m_viewList.GetAt(pos)->pWnd))
00531             GetParentFrame()->SetActiveView( NULL , FALSE);
00532
00533         // Remove item from list, and free memory.
00534         RemoveListItem( pos );
00535
00536         // Remove it from the tab control
00537         m_TabCtrl.DeleteItem(nView);
00538
00539         // Finally, if we have just deleted the active view, reset the
00540         // active tab to be the first view in the list
00541         if (nView == m_nActiveTab)
00542         {
00543             m_nActiveTab = -1;
00544             m_pActiveView = NULL; // Gero Kuehn [gero.kuehn@isc-soft.de]
00545         }
00546         else
00547         {
00548             // ** GK/ISC
00549             if((m_nActiveTab - 1)>=0) {
00550                 SetActiveView(m_nActiveTab - 1);
00551             }
00552         }
00553
00554         // Reset the tooltips for the views we have left...
00555         ResetToolTips(GetToolTip());
00556     }
00557 }

BOOL CCJTabCtrlBar::EnableToolTips ( BOOL bEnable ) [protected, virtual]

Definition at line 849 of file CJTabCtrlBar.cpp.

References GetToolTip, and m_bToolTipsEnabled.

00850 {
00851     BOOL bPrev = m_bToolTipsEnabled;
00852
00853     m_bToolTipsEnabled = bEnable;
00854
00855     // Get the tool tips for the tab control.
00856     CToolTipCtrl* pToolTip = GetToolTip();
00857
00858     if (pToolTip)
00859         pToolTip->Activate(m_bToolTipsEnabled);
00860     else
00861         m_bToolTipsEnabled = bPrev;
00862
00863     return bPrev;
00864 }

_CJXLIB_INLINE CView * CCJTabCtrlBar::GetActiveView ( ) [virtual]

Definition at line 412 of file CJTabCtrlBar.h.

00413     { return m_pActiveView; }

void CCJTabCtrlBar::GetChildRect ( CRect & rect ) [virtual]

Reimplemented from CCJControlBar.

Definition at line 292 of file CJTabCtrlBar.cpp.

References CCJControlBar::GetChildRect, and CCJControlBar::IsFloating.

Referenced by SizeTabView.

00293 {
00294     CCJControlBar::GetChildRect(rect);
00295
00296     if (IsFloating()) {
00297         rect.DeflateRect(2,2);
00298     }
00299 }

short CCJTabCtrlBar::GetImageIndexFromRuntimeClass ( CRuntimeClass * pRuntimeClass ) [protected, virtual]

Definition at line 797 of file CJTabCtrlBar.cpp.

References ASSERT, FALSE, and m_ClassNameToImageIndexMap.

00798 {
00799     ASSERT(m_ClassNameToImageIndexMap.GetCount() > 0);
00800     CString szClassName(pRuntimeClass->m_lpszClassName);
00801
00802     // Look for class name
00803     short* psValue;
00804     if (FALSE == m_ClassNameToImageIndexMap.Lookup(szClassName, (void*&)psValue))
00805         return -1;
00806
00807     // return the de-referenced pointer.
00808     return *psValue;
00809
00810 }

int CCJTabCtrlBar::GetTabFromPoint ( CPoint point = CPoint(0, 0) ) [virtual]

Definition at line 826 of file CJTabCtrlBar.cpp.

References m_nPointTab, and m_TabCtrl.

00827 {
00828     TCHITTESTINFO tch;
00829     memset(&tch, 0, sizeof(TCHITTESTINFO));
00830
00831     if( point == CPoint(0,0) ) {
00832         CPoint pt;
00833         GetCursorPos(&pt);
00834         ScreenToClient(&pt);
00835         tch.pt = pt;
00836     } else {
00837         tch.pt = point;
00838     }
00839
00840     int iTab = m_TabCtrl.HitTest(&tch);
00841
00842     if( iTab != -1 ) {
00843         m_nPointTab = iTab ;
00844     }
00845
00846     return iTab;
00847 }

CToolTipCtrl * CCJTabCtrlBar::GetToolTip ( ) [protected, virtual]

Definition at line 378 of file CJTabCtrlBar.cpp.

References ASSERT, m_TabCtrl, and NULL.

Referenced by AddToolTip, AddView, DeleteView, EnableToolTips, and SetViewToolTip.

00379 {
00380     // Get a pointer to the tab control's CToolTipCtrl.
00381 #ifdef _VC_VERSION_5
00382     CToolTipCtrl* pToolTip = m_TabCtrl.GetTooltips();
00383     ASSERT(pToolTip != NULL);
00384 #else
00385     CToolTipCtrl* pToolTip = m_TabCtrl.GetToolTips();
00386     ASSERT(pToolTip != NULL);
00387 #endif // _VC_VERSION_5
00388
00389     return pToolTip;
00390 }

CView * CCJTabCtrlBar::GetView ( CRuntimeClass * pViewClass ) [virtual]

Definition at line 644 of file CJTabCtrlBar.cpp.

References m_viewList, NULL, OverkillAssert, and tagTCB_ITEM::pWnd.

00645 {
00646     OverkillAssert(pViewClass);
00647
00648     for( POSITION pos = m_viewList.GetHeadPosition(); pos; m_viewList.GetNext( pos ))
00649     {
00650         TCB_ITEM *pMember = m_viewList.GetAt( pos );
00651         if( pMember->pWnd->IsKindOf( pViewClass )) {
00652             return (CView*)pMember->pWnd;
00653         }
00654     }
00655     return NULL;
00656 }

CView * CCJTabCtrlBar::GetView ( int nView ) [virtual]

Definition at line 624 of file CJTabCtrlBar.cpp.

References ASSERT, m_TabCtrl, m_viewList, NULL, and tagTCB_ITEM::pWnd.

Referenced by CMainFrame::GetBrowserView, and CMainFrame::GetExplorerView.

00625 {
00626     ASSERT_VALID(this);
00627     ASSERT(( nView >= 0 ) && ( m_TabCtrl.GetItemCount() > nView ));
00628
00629     if( nView != -1 )
00630     {
00631         POSITION pos = m_viewList.FindIndex( nView );
00632         if( pos != NULL )
00633         {
00634             TCB_ITEM* pMember = m_viewList.GetAt( pos );
00635             return ( pMember )?(CView*)pMember->pWnd:NULL;
00636         }
00637
00638         return NULL;
00639     }
00640
00641     return NULL;
00642 }

LPCTSTR CCJTabCtrlBar::GetViewName ( CRuntimeClass * pViewClass ) [virtual]

Definition at line 678 of file CJTabCtrlBar.cpp.

References m_viewList, NULL, OverkillAssert, tagTCB_ITEM::pWnd, and tagTCB_ITEM::szTabLabel.

00679 {
00680     OverkillAssert(pViewClass);
00681
00682     for( POSITION pos = m_viewList.GetHeadPosition(); pos; m_viewList.GetNext( pos ))
00683     {
00684         TCB_ITEM *pMember = m_viewList.GetAt( pos );
00685         if( pMember->pWnd->IsKindOf( pViewClass )) {
00686             return (LPCTSTR)pMember->szTabLabel;
00687         }
00688     }
00689     return NULL;
00690 }

LPCTSTR CCJTabCtrlBar::GetViewName ( int nView ) [virtual]

Definition at line 658 of file CJTabCtrlBar.cpp.

References ASSERT, m_TabCtrl, m_viewList, NULL, and tagTCB_ITEM::szTabLabel.

00659 {
00660     ASSERT_VALID(this);
00661     ASSERT(( nView >= 0 ) && ( m_TabCtrl.GetItemCount() > nView ));
00662
00663     if( nView != -1 )
00664     {
00665         POSITION pos = m_viewList.FindIndex( nView );
00666         if( pos != NULL )
00667         {
00668             TCB_ITEM* pMember = m_viewList.GetAt( pos );
00669             return ( pMember )?(LPCTSTR)pMember->szTabLabel:NULL;
00670         }
00671
00672         return NULL;
00673     }
00674
00675     return NULL;
00676 }

_CJXLIB_INLINE BOOL CCJTabCtrlBar::ModifyTabStyle | ( | DWORD | dwRemove,
 |  | DWORD | dwAdd,
 |  | UINT | nFlags = 0
 | ) | [virtual]

Definition at line 418 of file CJTabCtrlBar.h.

00419     { return m_TabCtrl.ModifyStyle(dwRemove, dwAdd, nFlags); }

int CCJTabCtrlBar::OnCreate ( LPCREATESTRUCT lpCreateStruct ) [protected]

Reimplemented from CCJControlBar.

Definition at line 253 of file CJTabCtrlBar.cpp.

References CCJTabCtrl::Create, IDC_TAB_CONTROL, m_TabCtrl, CCJControlBar::OnCreate, and CCJControlBar::SetChild.

00254 {
00255     if (CCJControlBar::OnCreate(lpCreateStruct) == -1)
00256         return -1;
00257
00258     // Create the Tab Control
00259     if (!m_TabCtrl.Create(this, IDC_TAB_CONTROL))
00260     {
00261         TRACE0( "Unable to create tab control bar\n" );
00262         return -1;
00263     }
00264
00265     // Associate the child window.
00266     SetChild(&m_TabCtrl);
00267
00268     return 0;
00269 }

void CCJTabCtrlBar::OnTabSelChange | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 287 of file CJTabCtrlBar.cpp.

References m_TabCtrl, and SetActiveView.

00288 {
00289     SetActiveView(m_TabCtrl.GetCurSel());
00290 }

void CCJTabCtrlBar::OnWindowPosChanged ( WINDOWPOS FAR * lpwndpos ) [protected]

Reimplemented from CCJControlBar.

Definition at line 227 of file CJTabCtrlBar.cpp.

References ASSERT, m_viewList, NULL, CCJControlBar::OnWindowPosChanged, tagTCB_ITEM::pWnd, and SizeTabView.

00228 {
00229     // Get a pointer to the parent frame.
00230     CFrameWnd* pFrame = GetParentFrame();
00231     ASSERT(pFrame != NULL);
00232
00233     POSITION pos = m_viewList.GetHeadPosition();
00234     while( pos != NULL )
00235     {
00236         // Get the item for this position.
00237         TCB_ITEM *pItem = (TCB_ITEM*)m_viewList.GetNext(pos);
00238         ASSERT(pItem != NULL);
00239
00240         // To avoid mainwindow freezing, we must
00241         // deativate the view, it's not visible now.
00242         if (pFrame->GetActiveView() == pItem->pWnd) {
00243             pFrame->SetActiveView(NULL);
00244         }
00245
00246         // Resize the tab view.
00247         SizeTabView(pItem->pWnd);
00248     }
00249
00250     CCJControlBar::OnWindowPosChanged(lpwndpos);
00251 }

void CCJTabCtrlBar::OverkillAssert ( CRuntimeClass * pViewClass ) [protected, virtual]

Definition at line 481 of file CJTabCtrlBar.cpp.

References ASSERT, FALSE, and NULL.

Referenced by AddView, DeleteView, GetView, GetViewName, SetActiveView, and SetViewToolTip.

00482 {
00483 #ifdef _DEBUG
00484     ASSERT_VALID(this);
00485     ASSERT(pViewClass != NULL);
00486     ASSERT(pViewClass->IsDerivedFrom(RUNTIME_CLASS(CWnd)));
00487     ASSERT(AfxIsValidAddress(pViewClass, sizeof(CRuntimeClass), FALSE));
00488 #else
00489     UNUSED_ALWAYS( pViewClass );
00490 #endif
00491 }

BOOL CCJTabCtrlBar::PreTranslateMessage ( MSG * pMsg ) [virtual]

Reimplemented from CCJControlBar.

Definition at line 271 of file CJTabCtrlBar.cpp.

References m_pActiveView, CCJControlBar::PreTranslateMessage, and TRUE.

00272 {
00273     if (pMsg->message == WM_KEYDOWN)
00274     {
00275         switch (pMsg->wParam)
00276         {
00277         case VK_RETURN:
00278             m_pActiveView->SendMessage(pMsg->message,
00279                 pMsg->wParam, pMsg->lParam);
00280             return TRUE;
00281         }
00282     }
00283
00284     return CCJControlBar::PreTranslateMessage(pMsg);
00285 }

BOOL CCJTabCtrlBar::RemoveAllTabs ( ) [virtual]

Definition at line 812 of file CJTabCtrlBar.cpp.

References m_pActiveView, m_TabCtrl, m_viewList, NULL, RemoveView, and TRUE.

00813 {
00814     // Itterate the tab views
00815     while(!m_viewList.IsEmpty())
00816     {
00817         RemoveView(0);  // Remove the view from the bar
00818         m_TabCtrl.DeleteItem(0);
00819     }
00820     m_pActiveView = NULL;
00821     ((CFrameWnd *)GetParent())->SetActiveView(NULL);
00822     Invalidate();
00823     return TRUE;
00824 }

void CCJTabCtrlBar::RemoveListItem ( POSITION pos ) [protected, virtual]

Definition at line 493 of file CJTabCtrlBar.cpp.

References _delete, ASSERT, m_viewList, NULL, and tagTCB_ITEM::pWnd.

Referenced by DeleteView, and RemoveView.

00494 {
00495     if( pos != NULL )
00496     {
00497         // remove the page from internal list
00498         TCB_ITEM *pMember = m_viewList.GetAt(pos);
00499         ASSERT(pMember);
00500
00501         // And delete the member window, freeing our stored
00502         // values relating to it
00503         if (pMember->pWnd != NULL) {
00504             pMember->pWnd->DestroyWindow();
00505             pMember->pWnd = NULL;
00506         }
00507
00508         // Remove from list and free memory.
00509         m_viewList.RemoveAt(pos);
00510         _delete(pMember);
00511     }
00512 }

void CCJTabCtrlBar::RemoveView ( int nView ) [virtual]

Definition at line 577 of file CJTabCtrlBar.cpp.

References ASSERT, m_TabCtrl, m_viewList, and RemoveListItem.

Referenced by RemoveAllTabs.

00578 {
00579     ASSERT_VALID( this );
00580     ASSERT(( nView >= 0 ) && (m_TabCtrl.GetItemCount() > nView));
00581     RemoveListItem( m_viewList.FindIndex( nView ));
00582 }

void CCJTabCtrlBar::ResetToolTips ( CToolTipCtrl * pToolTip ) [protected, virtual]

Definition at line 408 of file CJTabCtrlBar.cpp.

References m_nNextToolTipId, m_TabCtrl, m_viewList, tagTCB_ITEM::szToolTipLabel, and tagTCB_ITEM::uiToolTipId.

Referenced by AddView, and DeleteView.

00409 {
00410     if (pToolTip)
00411     {
00412         int nIndex = 0;
00413         POSITION pos;
00414         for( pos = m_viewList.GetHeadPosition(); pos; m_viewList.GetNext(pos) )
00415         {
00416             // Get the next item in the list.
00417             TCB_ITEM* pMember = m_viewList.GetAt( pos );
00418
00419             // Update the tooltip for the view
00420             pMember->uiToolTipId = nIndex;
00421             pToolTip->UpdateTipText( pMember->szToolTipLabel, &m_TabCtrl,
00422                 pMember->uiToolTipId );
00423
00424             nIndex++;
00425         }
00426
00427         m_nNextToolTipId = ( nIndex == 0 )?1:nIndex;
00428     }
00429 }

void CCJTabCtrlBar::SetActiveView ( CView * pUserView ) [virtual]

Definition at line 767 of file CJTabCtrlBar.cpp.

References m_pActiveView, and m_viewList.

00768 {
00769     // Walk through the tabs
00770     for (POSITION pos=m_viewList.GetHeadPosition(); pos; m_viewList.GetNext(pos))
00771     {
00772         // Get the tab's view
00773         CView* pTabView = (CView *)(m_viewList.GetAt(pos)->pWnd);
00774
00775         // Does the tab view match the requested view?
00776         if (pTabView == pUserView)
00777         {
00778             // Change the active view
00779             m_pActiveView = pTabView;
00780             ((CFrameWnd *)GetParent())->SetActiveView((CView *)m_pActiveView);
00781         }
00782     }
00783 }

void CCJTabCtrlBar::SetActiveView ( CRuntimeClass * pViewClass ) [virtual]

Definition at line 734 of file CJTabCtrlBar.cpp.

References FALSE, m_nActiveTab, m_pActiveView, m_TabCtrl, m_viewList, OverkillAssert, tagTCB_ITEM::pWnd, and TRUE.

00735 {
00736     OverkillAssert(pViewClass);
00737
00738     int nView = 0;
00739     for (POSITION pos=m_viewList.GetHeadPosition(); pos; m_viewList.GetNext(pos))
00740     {
00741         TCB_ITEM *pMember=m_viewList.GetAt(pos);
00742         if (pMember->pWnd->IsKindOf(pViewClass))
00743         {
00744             //first hide old first view
00745             m_pActiveView->EnableWindow(FALSE);
00746             m_pActiveView->ShowWindow(SW_HIDE);
00747
00748             // set new active view
00749             m_pActiveView = (CView*)pMember->pWnd;
00750
00751             // enable, show, set focus to new view
00752             m_pActiveView->EnableWindow(TRUE);
00753             m_pActiveView->ShowWindow(SW_SHOW);
00754             m_pActiveView->SetFocus();
00755
00756             m_nActiveTab = nView;
00757
00758             // select the tab
00759             m_TabCtrl.SetCurSel(m_nActiveTab);
00760
00761             break;
00762         }
00763         nView++;
00764     }
00765 }

void CCJTabCtrlBar::SetActiveView ( int nView ) [virtual]

Definition at line 692 of file CJTabCtrlBar.cpp.

References ASSERT, FALSE, m_nActiveTab, m_pActiveView, m_TabCtrl, m_viewList, NULL, tagTCB_ITEM::pWnd, and TRUE.

Referenced by CWincvsApp::ActivateBrowserView, DeleteView, CMainFrame::InitializeDockingWindows, and OnTabSelChange.

00693 {
00694     ASSERT_VALID(this);
00695     ASSERT(( nView >= 0 ) && ( m_TabCtrl.GetItemCount() > nView ));
00696
00697     if(( nView != -1 ) && ( nView != m_nActiveTab ))
00698     {
00699         POSITION pos = m_viewList.FindIndex( nView );
00700         if( pos != NULL )
00701         {
00702             // Hide the old view we are changing.
00703             // GK/ISC
00704             POSITION oldPos = NULL;
00705             if( m_nActiveTab >= 0) {
00706                 oldPos = m_viewList.FindIndex( m_nActiveTab );
00707             }
00708
00709             if( oldPos )
00710             {
00711                 TCB_ITEM* pOldItem = m_viewList.GetAt( oldPos );
00712                 pOldItem->pWnd->EnableWindow(FALSE);
00713                 pOldItem->pWnd->ShowWindow(SW_HIDE);
00714             }
00715
00716             // Show the newly selected view.
00717             TCB_ITEM* pMember = m_viewList.GetAt( pos );
00718             pMember->pWnd->EnableWindow(TRUE);
00719             pMember->pWnd->ShowWindow(SW_SHOW);
00720             pMember->pWnd->SetFocus();
00721
00722             // select the tab (if tab programmatically changed)
00723             m_nActiveTab = nView;
00724             m_TabCtrl.SetCurSel( m_nActiveTab );
00725
00726             // Set the active view.
00727             m_pActiveView = DYNAMIC_DOWNCAST( CView, pMember->pWnd );
00728             ASSERT_KINDOF( CView, m_pActiveView );
00729             GetParentFrame()->SetActiveView( m_pActiveView );
00730         }
00731     }
00732 }

_CJXLIB_INLINE CImageList * CCJTabCtrlBar::SetTabImageList ( CImageList * pImageList ) [virtual]

Definition at line 415 of file CJTabCtrlBar.h.

Referenced by CMainFrame::InitializeDockingWindows.

00416     { return m_TabCtrl.SetImageList (pImageList); }

_CJXLIB_INLINE void CCJTabCtrlBar::SetTabMenuID | ( | UINT | popupMenuID,
 |  | UINT | popToolbarID = 0,
 |  | int | nPos = 0
 | ) | [virtual]

Definition at line 409 of file CJTabCtrlBar.h.

References CCJTabCtrl::SetMenuID.

00410     { m_TabCtrl.SetMenuID(popupMenuID, popToolbarID, nPos); }

void CCJTabCtrlBar::SetViewToolTip | ( | CRuntimeClass * | pViewClass,
 |  | LPCTSTR | lpszLabel
 | ) | [virtual]

Definition at line 606 of file CJTabCtrlBar.cpp.

References m_viewList, OverkillAssert, tagTCB_ITEM::pWnd, and SetViewToolTip.

00607 {
00608     OverkillAssert(pViewClass);
00609
00610     int nIndex=0;
00611     for (POSITION pos=m_viewList.GetHeadPosition(); pos; m_viewList.GetNext(pos))
00612     {
00613         TCB_ITEM *pMember=m_viewList.GetAt(pos);
00614         if (pMember->pWnd->IsKindOf(pViewClass))
00615         {
00616             SetViewToolTip(nIndex, lpszLabel);
00617             break;
00618         }
00619         nIndex++;
00620     }
00621     return;
00622 }

void CCJTabCtrlBar::SetViewToolTip | ( | int | nView,
 |  | LPCTSTR | lpszLabel
 | ) | [virtual]

Definition at line 584 of file CJTabCtrlBar.cpp.

References ASSERT, GetToolTip, m_TabCtrl, m_viewList, NULL, tagTCB_ITEM::szToolTipLabel, and tagTCB_ITEM::uiToolTipId.

Referenced by SetViewToolTip.

00585 {
00586     ASSERT_VALID(this);
00587     ASSERT(( nView >= 0 ) && (m_TabCtrl.GetItemCount() > nView));
00588
00589     // Find the view we want to change the tooltip for and
00590     // reset its tooltip text
00591     POSITION pos = m_viewList.FindIndex( nView );
00592     if( pos != NULL )
00593     {
00594         // Get the private data for the view
00595         TCB_ITEM *pMember = m_viewList.GetAt(pos);
00596
00597         // Reset the tooltip text to the new value
00598         pMember->szToolTipLabel = lpszLabel;
00599
00600         // Update the tooltip for the view
00601         GetToolTip()->UpdateTipText( pMember->szToolTipLabel,
00602             &m_TabCtrl, pMember->uiToolTipId );
00603     }
00604 }

void CCJTabCtrlBar::SizeTabView ( CWnd * pWnd ) [protected, virtual]

Definition at line 467 of file CJTabCtrlBar.cpp.

References GetChildRect, m_TabCtrl, and NULL.

Referenced by AddView, and OnWindowPosChanged.

00468 {
00469     // Get the new window size.
00470     CRect rcChild;
00471     GetChildRect(rcChild);
00472     rcChild.DeflateRect(3,3);
00473     rcChild.bottom -= (21 * m_TabCtrl.GetRowCount());
00474
00475     // Resize the window.
00476     pWnd->MoveWindow(rcChild);
00477     pWnd->SetWindowPos(NULL, 0,0,0,0,
00478         SWP_NOSIZE|SWP_NOMOVE);
00479 }

Member Data Documentation

BOOL CCJTabCtrlBar::m_bToolTipsEnabled [protected]

Definition at line 206 of file CJTabCtrlBar.h.

Referenced by EnableToolTips.

CMapStringToPtr CCJTabCtrlBar::m_ClassNameToImageIndexMap [protected]

Definition at line 205 of file CJTabCtrlBar.h.

Referenced by AssociateImageIndexWithRuntimeClass, and GetImageIndexFromRuntimeClass.

int CCJTabCtrlBar::m_nActiveTab [protected]

Definition at line 200 of file CJTabCtrlBar.h.

Referenced by DeleteView, and SetActiveView.

int CCJTabCtrlBar::m_nNextToolTipId [protected]

Definition at line 201 of file CJTabCtrlBar.h.

Referenced by CreateTabListItem, and ResetToolTips.

int CCJTabCtrlBar::m_nPointTab [protected]

Definition at line 199 of file CJTabCtrlBar.h.

Referenced by GetTabFromPoint.

CView* CCJTabCtrlBar::m_pActiveView [protected]

Definition at line 202 of file CJTabCtrlBar.h.

Referenced by AddView, CreateTabListItem, CreateTabView, DeleteView, PreTranslateMessage, RemoveAllTabs, and SetActiveView.

CCJTabCtrl CCJTabCtrlBar::m_TabCtrl [protected]

Definition at line 204 of file CJTabCtrlBar.h.

Referenced by AddToolTip, AddView, DeleteView, GetTabFromPoint, GetToolTip, GetView, GetViewName, OnCreate, OnTabSelChange, RemoveAllTabs, RemoveView, ResetToolTips, SetActiveView, SetViewToolTip, and SizeTabView.

CTabViews CCJTabCtrlBar::m_viewList [protected]

Definition at line 203 of file CJTabCtrlBar.h.

Referenced by AddView, CreateTabListItem, DeleteView, GetView, GetViewName, OnWindowPosChanged, RemoveAllTabs, RemoveListItem, RemoveView, ResetToolTips, SetActiveView, SetViewToolTip, and ~CCJTabCtrlBar.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJTabCtrlBar.h
  • WinCvs/CJLib/CJLibrary/CJTabCtrlBar.cpp
Generated on Sun Feb 24 01:25:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJTabView Class Reference

#include <CJTabView.h>

Inheritance diagram for CCJTabView:

[legend]
Collaboration diagram for CCJTabView:

[legend]
List of all members.

Public Methods

virtual BOOL | AddView (LPCTSTR lpszLabel, CRuntimeClass *pViewClass, CDocument *pDoc=NULL, CCreateContext *pContext=NULL)
virtual BOOL | ModifyTabStyle (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
virtual void | SetActiveView (CRuntimeClass *pViewClass)
virtual void | SetActiveView (int nNewTab)
virtual void | RemoveView (int nView)
virtual CView * | GetView (CRuntimeClass *pViewClass)
virtual CView * | GetView (int nView)
virtual CView * | GetActiveView ()
virtual CImageList * | SetTabImageList (CImageList *pImageList)
virtual CTabCtrl * | GetTabCtrl ()
virtual void | GetChildRect (CRect &rect)

Protected Methods

CCJTabView ()
virtual | ~CCJTabView ()
afx_msg void | OnWindowPosChanged (WINDOWPOS FAR *lpwndpos)
afx_msg void | OnSelchange (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg int | OnCreate (LPCREATESTRUCT lpCreateStruct)
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)

Protected Attributes

CView * m_pActiveView
int | m_nActiveTab
CTabCtrl * m_pTabCtrl
CToolTipCtrl * | m_pToolTip
CFont | m_TabFont
CListViews m_views

Private Methods

void | CalcViewRect (CRect *pRect)

Constructor & Destructor Documentation

CCJTabView::CCJTabView ( ) [protected]

Definition at line 50 of file CJTabView.cpp.

References m_nActiveTab, and m_pTabCtrl.

00050                        : CCtrlView(_T("SysTabControl32"),
00051     TCS_TOOLTIPS | WS_VISIBLE | WS_CHILD | WS_BORDER)
00052 {
00053     m_pTabCtrl = (CTabCtrl*) this;
00054     m_nActiveTab = 0;
00055 }

CCJTabView::~CCJTabView ( ) [protected, virtual]

Definition at line 57 of file CJTabView.cpp.

References _delete, m_TabFont, and m_views.

00058 {
00059     while(!m_views.IsEmpty()) {
00060         CTV_ITEM *pMember=m_views.RemoveTail();
00061         _delete(pMember);
00062     }
00063
00064     // fix potential resource leak - KStowell - 10-22-99.
00065     m_TabFont.DeleteObject();
00066 }

Member Function Documentation

BOOL CCJTabView::AddView | ( | LPCTSTR | lpszLabel,
 |  | CRuntimeClass * | pViewClass,
 |  | CDocument * | pDoc = NULL,
 |  | CCreateContext * | pContext = NULL
 | ) | [virtual]

Definition at line 287 of file CJTabView.cpp.

References ASSERT, CalcViewRect, FALSE, m_pActiveView, m_pTabCtrl, m_pToolTip, m_views, NULL, tagCTV_ITEM::pWnd, tagCTV_ITEM::szLabel, and TRUE.

00288 {
00289
00290 #ifdef _DEBUG
00291     ASSERT_VALID(this);
00292     ASSERT(pViewClass != NULL);
00293     ASSERT(pViewClass->IsDerivedFrom(RUNTIME_CLASS(CWnd)));
00294     ASSERT(AfxIsValidAddress(pViewClass, sizeof(CRuntimeClass), FALSE));
00295 #endif
00296
00297     CCreateContext context;
00298     if (pContext == NULL)
00299     {
00300         context.m_pCurrentDoc       = pDoc;
00301         context.m_pCurrentFrame     = GetParentFrame();
00302         context.m_pLastView         = NULL;
00303         context.m_pNewDocTemplate   = NULL;
00304         context.m_pNewViewClass     = pViewClass;
00305         pContext = &context;
00306     }
00307
00308     CWnd* pWnd;
00309     TRY {
00310         pWnd = (CWnd*)pViewClass->CreateObject();
00311         if (pWnd == NULL)
00312             AfxThrowMemoryException();
00313     }
00314     CATCH_ALL(e) {
00315         TRACE0( "Out of memory creating a view.\n" );
00316         // Note: DELETE_EXCEPTION(e) not required
00317         return FALSE;
00318     }
00319     END_CATCH_ALL
00320
00321     ASSERT_KINDOF(CWnd, pWnd);
00322     ASSERT(pWnd->m_hWnd == NULL);       // not yet created
00323
00324     DWORD dwStyle = AFX_WS_DEFAULT_VIEW;
00325     CRect rect;
00326
00327     // Create with the right size and position
00328     if (!pWnd->Create(NULL, NULL, dwStyle, rect, this, 0, pContext))
00329     {
00330         TRACE0( "Warning: couldn't create client pane for view.\n" );
00331         // pWnd will be cleaned up by PostNcDestroy
00332         return FALSE;
00333     }
00334     m_pActiveView = (CView*) pWnd;
00335
00336     CTV_ITEM* pMember = new CTV_ITEM;
00337
00338     pMember->pWnd = pWnd;
00339
00340     _tcscpy( pMember->szLabel, lpszLabel );
00341
00342     m_views.AddTail(pMember);
00343
00344     // ToolTip support for tabs.
00345     if((m_views.GetCount()-1)==0) {
00346         m_pToolTip->AddTool( m_pTabCtrl, lpszLabel,
00347             NULL, m_views.GetCount()-1 );
00348     }
00349     else {
00350         m_pToolTip->AddTool( m_pTabCtrl, lpszLabel,
00351             CRect(0,0,0,0), m_views.GetCount()-1 );
00352     }
00353
00354     int nViews = m_views.GetCount();
00355     if (nViews != 1) {
00356         pWnd->EnableWindow(FALSE);
00357         pWnd->ShowWindow(SW_HIDE);
00358     }
00359
00360     TC_ITEM tci;
00361     tci.mask = TCIF_TEXT | TCIF_IMAGE;
00362     tci.pszText = (LPTSTR)(LPCTSTR)lpszLabel;
00363     tci.iImage = nViews-1;
00364     m_pTabCtrl->InsertItem(nViews, &tci);
00365
00366     CRect rcChild;
00367     CalcViewRect(&rcChild);
00368     m_pActiveView->MoveWindow(rcChild);
00369
00370     return TRUE;
00371 }

void CCJTabView::CalcViewRect ( CRect * pRect ) [private]

Definition at line 151 of file CJTabView.cpp.

References GetChildRect, and TABVIEW_BORDER.

Referenced by AddView, and OnWindowPosChanged.

00152 {
00153     GetChildRect((*pRect));
00154     DWORD dwStyle = GetStyle();
00155
00156     if ((dwStyle & TCS_BOTTOM) && !(dwStyle & TCS_VERTICAL)) {      // Bottom
00157         (*pRect).top    += TABVIEW_BORDER;
00158         (*pRect).left   += TABVIEW_BORDER;
00159         (*pRect).right  -= TABVIEW_BORDER;
00160         (*pRect).bottom -= 26;
00161     }
00162     else if ((dwStyle & TCS_RIGHT) && (dwStyle & TCS_VERTICAL)) {   // Right
00163         (*pRect).top    += TABVIEW_BORDER;
00164         (*pRect).left   += TABVIEW_BORDER;
00165         (*pRect).right  -= 26;
00166         (*pRect).bottom -= TABVIEW_BORDER;
00167     }
00168     else if (dwStyle & TCS_VERTICAL) {                              // Left
00169         (*pRect).top    += TABVIEW_BORDER;
00170         (*pRect).left   += 26;
00171         (*pRect).right  -= TABVIEW_BORDER;
00172         (*pRect).bottom -= TABVIEW_BORDER;
00173     }
00174     else {                                                          // Top
00175         (*pRect).top    += 26;
00176         (*pRect).left   += TABVIEW_BORDER;
00177         (*pRect).right  -= TABVIEW_BORDER;
00178         (*pRect).bottom -= TABVIEW_BORDER;
00179     }
00180 }

_CJXLIB_INLINE CView * CCJTabView::GetActiveView ( ) [virtual]

Definition at line 176 of file CJTabView.h.

References m_pActiveView.

Referenced by OnEraseBkgnd.

00177     { return m_pActiveView; }

void CCJTabView::GetChildRect ( CRect & rect ) [virtual]

Definition at line 80 of file CJTabView.cpp.

References m_pTabCtrl.

Referenced by CalcViewRect.

00081 {
00082     m_pTabCtrl->GetClientRect(&rect);
00083 }

_CJXLIB_INLINE CTabCtrl * CCJTabView::GetTabCtrl ( ) [virtual]

Definition at line 173 of file CJTabView.h.

References m_pTabCtrl.

00174     { return m_pTabCtrl; }

CView * CCJTabView::GetView ( int nView ) [virtual]

Definition at line 85 of file CJTabView.cpp.

References ASSERT, m_views, NULL, and tagCTV_ITEM::pWnd.

00086 {
00087     ASSERT_VALID(this);
00088     ASSERT(nView >= 0);
00089
00090     if (nView!=-1) {
00091         CTV_ITEM *pMember=m_views.GetAt(m_views.FindIndex(nView));
00092         return (CView*)pMember->pWnd;
00093     }
00094     else
00095         return NULL;
00096 }

CView * CCJTabView::GetView ( CRuntimeClass * pViewClass ) [virtual]

Definition at line 98 of file CJTabView.cpp.

References ASSERT, FALSE, m_views, NULL, and tagCTV_ITEM::pWnd.

00099 {
00100     ASSERT_VALID(this);
00101     ASSERT(pViewClass != NULL);
00102     ASSERT(pViewClass->IsDerivedFrom(RUNTIME_CLASS(CWnd)));
00103     ASSERT(AfxIsValidAddress(pViewClass, sizeof(CRuntimeClass), FALSE));
00104
00105     for (POSITION pos=m_views.GetHeadPosition(); pos; m_views.GetNext(pos)) {
00106         CTV_ITEM *pMember=m_views.GetAt(pos);
00107         if (pMember->pWnd->IsKindOf(pViewClass)) {
00108             return (CView*)pMember->pWnd;
00109         }
00110     }
00111     return NULL;
00112 }

BOOL CCJTabView::ModifyTabStyle | ( | DWORD | dwRemove,
 |  | DWORD | dwAdd,
 |  | UINT | nFlags = 0
 | ) | [virtual]

Definition at line 114 of file CJTabView.cpp.

References m_pTabCtrl, m_TabFont, and VERIFY.

00115 {
00116     DWORD dwCurrentStyle = GetStyle();
00117
00118     // We are in horizontal mode...go vertical
00119     if ((dwAdd & TCS_VERTICAL) && !(dwCurrentStyle & TCS_VERTICAL)) {
00120         // Get the log font.
00121         NONCLIENTMETRICS ncm;
00122         ncm.cbSize = sizeof(NONCLIENTMETRICS);
00123         VERIFY(::SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
00124             sizeof(NONCLIENTMETRICS), &ncm, 0));
00125         // fix potential resource leak - KStowell - 10-22-99.
00126         m_TabFont.DeleteObject();
00127         ncm.lfMessageFont.lfOrientation = (dwAdd & TCS_RIGHT) ? 2700 : 900;
00128         ncm.lfMessageFont.lfEscapement  = (dwAdd & TCS_RIGHT) ? 2700 : 900;
00129         m_TabFont.CreateFontIndirect(&ncm.lfMessageFont);
00130         m_pTabCtrl->SetFont(&m_TabFont);
00131     }
00132     // We are in vertical mode....go horizontal
00133     else if ((dwCurrentStyle & TCS_VERTICAL) && !(dwAdd & TCS_VERTICAL)) {
00134         // Get the log font.
00135         NONCLIENTMETRICS ncm;
00136         ncm.cbSize = sizeof(NONCLIENTMETRICS);
00137         VERIFY(::SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
00138             sizeof(NONCLIENTMETRICS), &ncm, 0));
00139         // fix potential resource leak - KStowell - 10-22-99.
00140         m_TabFont.DeleteObject();
00141         ncm.lfMessageFont.lfOrientation = 0;
00142         ncm.lfMessageFont.lfEscapement  = 0;
00143         m_TabFont.CreateFontIndirect(&ncm.lfMessageFont);
00144         m_pTabCtrl->SetFont(&m_TabFont);
00145     }
00146
00147     return m_pTabCtrl->ModifyStyle(dwRemove, dwAdd, nFlags);
00148 }

int CCJTabView::OnCreate ( LPCREATESTRUCT lpCreateStruct ) [protected]

Definition at line 381 of file CJTabView.cpp.

References ASSERT, m_pTabCtrl, m_pToolTip, m_TabFont, and VERIFY.

00382 {
00383     if (CCtrlView::OnCreate(lpCreateStruct) == -1)
00384         return -1;
00385
00386     ASSERT(m_pTabCtrl);         // Should already be constructed
00387
00389     // Fixed bug with set parent and modifystyle which would cause the
00390     // application to lock up. - Kevin [klussier@redcreek.com].
00392     m_pTabCtrl->SetParent(CWnd::FromHandle(lpCreateStruct->hwndParent));
00393     m_pTabCtrl->ModifyStyleEx(WS_EX_NOPARENTNOTIFY, 0);
00394
00395     // Get the log font.
00396     NONCLIENTMETRICS ncm;
00397     ncm.cbSize = sizeof(NONCLIENTMETRICS);
00398     VERIFY(::SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
00399         sizeof(NONCLIENTMETRICS), &ncm, 0));
00400     m_TabFont.CreateFontIndirect(&ncm.lfMessageFont);
00401     m_pTabCtrl->SetFont(&m_TabFont);
00402
00403 #ifdef _VC_VERSION_5
00404     m_pToolTip = m_pTabCtrl->GetTooltips();
00405     m_pTabCtrl->SetTooltips(m_pToolTip);
00406 #else
00407     m_pToolTip = m_pTabCtrl->GetToolTips();
00408     m_pTabCtrl->SetToolTips(m_pToolTip);
00409 #endif // _VC_VERSION_5
00410
00411     return 0;
00412 }

BOOL CCJTabView::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 414 of file CJTabView.cpp.

References GetActiveView.

00415 {
00416     CView *pView = GetActiveView();
00417     if ( pView )
00418     {
00419         // Exclude the embedded views
00420         // area from the erase - Andy
00421         CRect rectClient;
00422         pView->GetWindowRect( &rectClient );
00423         ScreenToClient( &rectClient );
00424         pDC->ExcludeClipRect( &rectClient );
00425     }
00426     return CCtrlView::OnEraseBkgnd(pDC);
00427 }

void CCJTabView::OnSelchange | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 374 of file CJTabView.cpp.

References m_pTabCtrl, and SetActiveView.

00375 {
00376     SetActiveView(m_pTabCtrl->GetCurSel());
00377
00378     *pResult = 0;
00379 }

void CCJTabView::OnWindowPosChanged ( WINDOWPOS FAR * lpwndpos ) [protected]

Definition at line 182 of file CJTabView.cpp.

References CalcViewRect, m_views, NULL, and tagCTV_ITEM::pWnd.

00183 {
00184     CRect rcChild;
00185     CWnd *pWnd;
00186
00187     CalcViewRect(&rcChild);
00188     for (POSITION pos=m_views.GetHeadPosition(); pos; m_views.GetNext(pos)) {
00189         pWnd = m_views.GetAt(pos)->pWnd;
00190         pWnd->MoveWindow(rcChild);
00191     }
00192
00193     // *** LiangYiBin.Donald
00194     if( lpwndpos->flags & SWP_HIDEWINDOW ) {
00195         CFrameWnd* pFrame = GetParentFrame();
00196         POSITION pos = m_views.GetHeadPosition();
00197         while ( pos != NULL ) {
00198             // check whether the views in the controlbar are focused
00199             CTV_ITEM *pItem = (CTV_ITEM *) m_views.GetNext(pos);
00200             if ( pFrame != NULL && pFrame->GetActiveView() == pItem->pWnd ) {
00201                 // To avoid mainwindow freezing, we must deativate the view,
00202                 // because it's not visible now.
00203                 pFrame->SetActiveView(NULL);
00204             }
00205         }
00206     }
00207
00208     CCtrlView::OnWindowPosChanged(lpwndpos);
00209 }

void CCJTabView::RemoveView ( int nView ) [virtual]

Definition at line 211 of file CJTabView.cpp.

References ASSERT, and m_views.

00212 {
00213     ASSERT_VALID(this);
00214     ASSERT(nView >= 0);
00215
00216     // remove the page from internal list
00217     m_views.RemoveAt(m_views.FindIndex(nView));
00218 }

void CCJTabView::SetActiveView ( int nNewTab ) [virtual]

Definition at line 256 of file CJTabView.cpp.

References ASSERT, FALSE, m_nActiveTab, m_pActiveView, m_pTabCtrl, m_views, NULL, tagCTV_ITEM::pWnd, and TRUE.

00257 {
00258     ASSERT_VALID(this);
00259     ASSERT(nNewTab >= 0);
00260
00261     if (nNewTab!=-1 && nNewTab!=m_nActiveTab) {
00262         CTV_ITEM *newMember=m_views.GetAt(m_views.FindIndex(nNewTab));
00263         CTV_ITEM *oldMember=NULL;
00264
00265         if (m_nActiveTab!=-1) {
00266             oldMember=m_views.GetAt(m_views.FindIndex(m_nActiveTab));
00267             oldMember->pWnd->EnableWindow(FALSE);
00268             oldMember->pWnd->ShowWindow(SW_HIDE);
00269         }
00270         newMember->pWnd->EnableWindow(TRUE);
00271         newMember->pWnd->ShowWindow(SW_SHOW);
00272         newMember->pWnd->SetFocus();
00273
00274         m_pActiveView = (CView *)newMember->pWnd;
00275
00276         m_nActiveTab = nNewTab;
00277         // select the tab (if tab programmatically changed)
00278         m_pTabCtrl->SetCurSel(m_nActiveTab);
00279     }
00280 }

void CCJTabView::SetActiveView ( CRuntimeClass * pViewClass ) [virtual]

Definition at line 220 of file CJTabView.cpp.

References ASSERT, FALSE, m_nActiveTab, m_pActiveView, m_pTabCtrl, m_views, NULL, tagCTV_ITEM::pWnd, and TRUE.

Referenced by OnSelchange.

00221 {
00222     ASSERT_VALID(this);
00223     ASSERT(pViewClass != NULL);
00224     ASSERT(pViewClass->IsDerivedFrom(RUNTIME_CLASS(CWnd)));
00225     ASSERT(AfxIsValidAddress(pViewClass, sizeof(CRuntimeClass), FALSE));
00226
00227     int nNewTab = 0;
00228     for (POSITION pos=m_views.GetHeadPosition(); pos; m_views.GetNext(pos)) {
00229         CTV_ITEM *pMember=m_views.GetAt(pos);
00230         if (pMember->pWnd->IsKindOf(pViewClass)) {
00231             //first hide old first view
00232             m_pActiveView->EnableWindow(FALSE);
00233             m_pActiveView->ShowWindow(SW_HIDE);
00234
00235             // set new active view
00236             m_pActiveView = (CView*)pMember->pWnd;
00237             // enable, show, set focus to new view
00238             m_pActiveView->EnableWindow(TRUE);
00239             m_pActiveView->ShowWindow(SW_SHOW);
00240             m_pActiveView->SetFocus();
00241
00242             // *** LiangYiBin.Donald
00243             //((CFrameWnd *)GetParent())->SetActiveView(m_pActiveView);
00244             //GetParentFrame()->SetActiveView(m_pActiveView);
00245
00246             m_nActiveTab = nNewTab;
00247             // select the tab
00248             m_pTabCtrl->SetCurSel(m_nActiveTab);
00249
00250             break;
00251         }
00252         nNewTab++;
00253     }
00254 }

CImageList * CCJTabView::SetTabImageList ( CImageList * pImageList ) [virtual]

Definition at line 282 of file CJTabView.cpp.

References m_pTabCtrl.

00283 {
00284     return m_pTabCtrl->SetImageList (pImageList);
00285 }

Member Data Documentation

int CCJTabView::m_nActiveTab [protected]

Definition at line 76 of file CJTabView.h.

Referenced by CCJTabView, and SetActiveView.

CView* CCJTabView::m_pActiveView [protected]

Definition at line 75 of file CJTabView.h.

Referenced by AddView, GetActiveView, and SetActiveView.

CTabCtrl* CCJTabView::m_pTabCtrl [protected]

Definition at line 77 of file CJTabView.h.

Referenced by AddView, CCJTabView, GetChildRect, GetTabCtrl, ModifyTabStyle, OnCreate, OnSelchange, SetActiveView, and SetTabImageList.

CToolTipCtrl* CCJTabView::m_pToolTip [protected]

Definition at line 78 of file CJTabView.h.

Referenced by AddView, and OnCreate.

CFont CCJTabView::m_TabFont [protected]

Definition at line 79 of file CJTabView.h.

Referenced by ModifyTabStyle, OnCreate, and ~CCJTabView.

CListViews CCJTabView::m_views [protected]

Definition at line 80 of file CJTabView.h.

Referenced by AddView, GetView, OnWindowPosChanged, RemoveView, SetActiveView, and ~CCJTabView.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJTabView.h
  • WinCvs/CJLib/CJLibrary/CJTabView.cpp
Generated on Sun Feb 24 01:25:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJTimeEdit Class Reference

#include <CJMaskEdit.h>

Inheritance diagram for CCJTimeEdit:

[legend]
Collaboration diagram for CCJTimeEdit:

[legend]
List of all members.

Public Methods

CCJTimeEdit ()
virtual void | SetHours (int nHours)
virtual void | SetMins (int nMins)
virtual bool | ProcessMask (UINT nChar, int nEndPos)
virtual void | FormatOleDateTime (CString &strData, COleDateTime dt)

Public Attributes

CString | m_strHours
CString | m_strMins

Constructor & Destructor Documentation

CCJTimeEdit::CCJTimeEdit ( )

Definition at line 511 of file CJMaskEdit.cpp.

References CCJMaskEdit::m_bUseMask, m_strHours, CCJMaskEdit::m_strLiteral, CCJMaskEdit::m_strMask, and m_strMins.

00512 {
00513     m_bUseMask      = true;
00514     m_strMask       = _T("00:00");
00515     m_strLiteral    = _T("__:__");
00516     m_strHours      = _T("47");
00517     m_strMins       = _T("59");
00518 }

Member Function Documentation

void CCJTimeEdit::FormatOleDateTime | ( | CString & | strData,
 |  | COleDateTime | dt
 | ) | [virtual]

Reimplemented from CCJDateEdit.

Definition at line 520 of file CJMaskEdit.cpp.

00521 {
00522     if( dt.m_dt == 0 ) {
00523         strData = "00:00";
00524     }
00525     else {
00526         strData = dt.Format( _T("%H:%M"));
00527     }
00528 }

bool CCJTimeEdit::ProcessMask | ( | UINT | nChar,
 |  | int | nEndPos
 | ) | [virtual]

Reimplemented from CCJDateEdit.

Definition at line 530 of file CJMaskEdit.cpp.

References m_strHours, CCJMaskEdit::m_strMask, m_strMins, and CCJMaskEdit::m_strWindowText.

00531 {
00532     // check the key against the mask
00533     switch( m_strMask.GetAt( nEndPos ))
00534     {
00535     case '0':       // digit only //completely changed this
00536         {
00537             bool bReturn = true;
00538
00539             if( isdigit( nChar ))
00540             {
00541                 if( nEndPos == 0 )
00542                 {
00543                     if(nChar > (UINT)m_strHours[0]) {
00544                         bReturn = false;
00545                     }
00546                 }
00547                 else if( nEndPos == 1 )
00548                 {
00549                     if(m_strWindowText.GetAt(0) == m_strHours[0])
00550                     {
00551                         if( nChar > (UINT)m_strHours[1] ) {
00552                             bReturn = false;
00553                         }
00554                     }
00555                 }
00556                 else if( nEndPos == 3 )
00557                 {
00558                     if( nChar > (UINT)m_strMins[0] ) {
00559                         bReturn = false;
00560                     }
00561                 }
00562                 else if( nEndPos == 4 )
00563                 {
00564                     if( m_strWindowText.GetAt(3) == m_strMins[0] )
00565                     {
00566                         if( nChar > (UINT)m_strMins[1] ) {
00567                             bReturn = false;
00568                         }
00569                     }
00570                 }
00571                 return bReturn;
00572             }
00573             break;
00574         }
00575     }
00576
00577     MessageBeep((UINT)-1);
00578     return false;
00579 }

void CCJTimeEdit::SetHours ( int nHours ) [virtual]

Definition at line 581 of file CJMaskEdit.cpp.

References m_strHours.

00582 {
00583     m_strHours.Format( _T("%d"), nHours);
00584 }

void CCJTimeEdit::SetMins ( int nMins ) [virtual]

Definition at line 586 of file CJMaskEdit.cpp.

References m_strMins.

00587 {
00588     m_strMins.Format( _T("%d"), nMins);
00589 }

Member Data Documentation

CString CCJTimeEdit::m_strHours

Definition at line 142 of file CJMaskEdit.h.

Referenced by CCJTimeEdit, ProcessMask, and SetHours.

CString CCJTimeEdit::m_strMins

Definition at line 143 of file CJMaskEdit.h.

Referenced by CCJTimeEdit, ProcessMask, and SetMins.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJMaskEdit.h
  • WinCvs/CJLib/CJLibrary/CJMaskEdit.cpp
Generated on Sun Feb 24 01:25:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJToolBar Class Reference

#include <CJToolBar.h>

Inheritance diagram for CCJToolBar:

[legend]
Collaboration diagram for CCJToolBar:

[legend]
List of all members.

Public Methods

CCJToolBar ()
virtual | ~CCJToolBar ()
virtual BOOL | Create (CWnd *pParentWnd, DWORD dwStyle=WS_CHILD|WS_VISIBLE|CBRS_TOP, UINT nID=AFX_IDW_TOOLBAR)
virtual BOOL | CreateEx (CWnd *pParentWnd, DWORD dwCtrlStyle=TBSTYLE_FLAT, DWORD dwStyle=WS_CHILD|WS_VISIBLE|CBRS_ALIGN_TOP, CRect rcBorders=CRect(0, 0, 0, 0), UINT nID=AFX_IDW_TOOLBAR)
CWnd * | InsertControl (CRuntimeClass *pClass, LPCTSTR lpszWindowName, CRect &rect, UINT nID, DWORD dwStyle)
CWnd * | InsertControl (CWnd *pCtrl, CRect &rect, UINT nID)
BOOL | AddDropDownButton (UINT nIDButton, UINT nIDMenu, BOOL bArrow=TRUE)
DROPDOWNBUTTON * | FindDropDownButton (UINT nID)
LRESULT | SendMessageC (UINT m, WPARAM wp=0, LPARAM lp=0) const
void | SetSizes (SIZE sizeButton, SIZE sizeImage)
void | SetHeight (int cyHeight)
BOOL | LoadToolBar (LPCTSTR lpszResourceName, TOOLBARINFO *pBarInfo=NULL)
BOOL | LoadToolBar (UINT nIDResource, TOOLBARINFO *pBarInfo=NULL)
BOOL | LoadBitmap (LPCTSTR lpszResourceName)
BOOL | LoadBitmap (UINT nIDResource)
BOOL | SetBitmap (HBITMAP hbmImageWell)
BOOL | SetButtons (const UINT *lpIDArray, int nIDCount)
int | CommandToIndex (UINT nIDFind) const
UINT | GetItemID (int nIndex) const
UINT | GetButtonStyle (int nIndex) const
void | SetButtonStyle (int nIndex, UINT nStyle)
void | SaveState ()
void | RestoreState ()
void | GetButtonInfo (int nIndex, UINT &nID, UINT &nStyle, int &iImage) const
void | SetButtonInfo (int nIndex, UINT nID, UINT nStyle, int iImage)
BOOL | SetButtonText (int nIndex, LPCTSTR lpszText)
CString | GetButtonText (int nIndex) const
void | GetButtonText (int nIndex, CString &rString) const
CCJToolBarCtrl & | GetToolBarCtrl () const
void | SetOwner (CWnd *pOwnerWnd)
BOOL | AddReplaceBitmap (HBITMAP hbmImageWell)
void | GetButton (int nIndex, TBBUTTON *pButton) const
void | SetButton (int nIndex, TBBUTTON *pButton)
BOOL | EnableButton (int nID, BOOL bEnable)
BOOL | CheckButton (int nID, BOOL bCheck)
BOOL | PressButton (int nID, BOOL bPress)
BOOL | HideButton (int nID, BOOL bHide)
BOOL | Indeterminate (int nID, BOOL bIndeterminate)
BOOL | IsButtonEnabled (int nID) const
BOOL | IsButtonChecked (int nID) const
BOOL | IsButtonPressed (int nID) const
BOOL | IsButtonHidden (int nID) const
BOOL | IsButtonIndeterminate (int nID) const
BOOL | SetState (int nID, UINT nState)
int | GetState (int nID) const
BOOL | AddButtons (int nNumButtons, LPTBBUTTON lpButtons)
BOOL | InsertButton (int nIndex, LPTBBUTTON lpButton)
BOOL | DeleteButton (int nIndex)
int | GetButtonCount () const
void | Customize ()
int | AddStrings (LPCTSTR lpszStrings)
void | SetButtonStructSize (int nSize)
BOOL | SetButtonSize (CSize sz)
BOOL | SetBitmapSize (CSize sz)
void | AutoSize ()
CToolTipCtrl * | GetToolTips () const
void | SetToolTips (CToolTipCtrl *pTip)
void | SetRows (int nRows, BOOL bLarger, LPRECT lpRect)
int | GetRows () const
BOOL | SetCmdID (int nIndex, UINT nID)
UINT | GetBitmapFlags () const
BOOL | SetIndent (int indent)
HIMAGELIST | GetImageList () const
HIMAGELIST | SetImageList (HIMAGELIST hImgList)
int | GetBitmap (UINT nIdButton) const
DWORD | SetExtendedStyle (DWORD dwStyle)
BOOL | GetRect (UINT nIdButton, RECT &rc) const
DWORD | GetToolbarStyle () const
void | SetToolbarStyle (DWORD dwStyle)
int | HitTest (CPoint p) const
int | GetHotItem () const
void | SetHotItem (int iHot)
BOOL | MapAccelerator (TCHAR ch, UINT &nID) const
CSize | GetPadding () const
CSize | SetPadding (CSize sz)
virtual CSize | CalcFixedLayout (BOOL bStretch, BOOL bHorz)
virtual CSize | CalcDynamicLayout (int nLength, DWORD nMode)
virtual void | OnUpdateCmdUI (CFrameWnd *pTarget, BOOL bDisableIfNoHndler)
virtual void | OnBarStyleChange (DWORD dwOldStyle, DWORD dwNewStyle)
virtual BOOL | PreCreateWindow (CREATESTRUCT &cs)
virtual int | OnToolHitTest (CPoint point, TOOLINFO *pTI) const
virtual void | GetItemRect (int nIndex, LPRECT lpRect) const
virtual void | InvalidateOldPos (const CRect &rcInvalid)
virtual CSize | GetButtonSize (TBBUTTON *pData, int iButton)
virtual void | OnDropDownButton (const NMTOOLBAR &nmtb, UINT nID, CRect rc)

Protected Methods

CSize | CalcLayout (DWORD nMode, int nLength=-1)
CSize | CalcSize (TBBUTTON *pData, int nCount)
int | WrapToolBar (TBBUTTON *pData, int nCount, int nWidth)
void | SizeToolBar (TBBUTTON *pData, int nCount, int nLength, BOOL bVert=FALSE)
void | Layout ()
LRESULT | OnSetSizeHelper (CSize &size, LPARAM lParam)
afx_msg UINT | OnNcHitTest (CPoint)
afx_msg void | OnNcPaint ()
afx_msg void | OnPaint ()
afx_msg void | OnNcCalcSize (BOOL, NCCALCSIZE_PARAMS *)
afx_msg void | OnWindowPosChanging (LPWINDOWPOS)
afx_msg void | OnWindowPosChanged (WINDOWPOS *lpwndpos)
afx_msg void | OnSysColorChange ()
afx_msg LRESULT | OnSetButtonSize (WPARAM, LPARAM)
afx_msg LRESULT | OnSetBitmapSize (WPARAM, LPARAM)
afx_msg BOOL | OnNcCreate (LPCREATESTRUCT)
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)
afx_msg void | OnDestroy ()
afx_msg void | OnRButtonDown (UINT nFlags, CPoint point)
afx_msg void | OnToolBarBtnDropDown (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnToolBarQueryDelete (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnToolBarQueryInsert (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnToolBarChange (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnToolBarBeginDrag (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnToolBarEndDrag (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnToolBarBeginAdjust (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnToolBarCustomHelp (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnToolBarEndAdjust (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnToolBarGetButtonInfo (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnToolBarReset (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg LRESULT | OnPreserveZeroBorderHelper (WPARAM, LPARAM)

Protected Attributes

TOOLBARINFO * m_pBarInfo
CObList * | m_pControls
bool | m_bShowDropArrow
HRSRC | m_hRsrcImageWell
HINSTANCE | m_hInstImageWell
HBITMAP | m_hbmImageWell
BOOL | m_bDelayedButtonLayout
CRect | m_rcOldPos
int | m_nButtons
HKEY | m_hKeyRoot
CString | m_strSubKey
CString | m_strValueName
CSize | m_sizeImage
CSize | m_sizeButton
DROPDOWNBUTTON * m_pDropButtons
CMapStringToPtr * | m_pStringMap

Static Protected Attributes

int | m_nBarNumber = 0

Constructor & Destructor Documentation

CCJToolBar::CCJToolBar ( )

Definition at line 300 of file CJToolBar.cpp.

References ASSERT, m_bDelayedButtonLayout, CCJToolBarBase::m_bExStyle, m_bShowDropArrow, m_hbmImageWell, m_hInstImageWell, m_hKeyRoot, m_hRsrcImageWell, m_nBarNumber, m_nButtons, m_pBarInfo, m_pControls, m_pDropButtons, m_pStringMap, m_sizeButton, m_sizeImage, m_strSubKey, m_strValueName, NULL, and TRUE.

00301 {
00302     m_bShowDropArrow = false;
00303     m_pControls      = NULL;
00304     m_pDropButtons   = NULL;        // list of drop-down buttons
00305     m_nButtons       = 0;
00306     m_pBarInfo       = NULL;
00307     m_hKeyRoot       = HKEY_CURRENT_USER;
00308
00309     // get a pointer to the application.
00310     CWinApp* pApp = AfxGetApp();
00311     ASSERT( pApp );
00312
00313     ++m_nBarNumber;
00314     m_strValueName.Format( _T("CJToolBar %d"), m_nBarNumber );
00315     m_strSubKey.Format( _T("Software\\%s\\%s\\Settings"),
00316         pApp->m_pszRegistryKey, pApp->m_pszProfileName );
00317
00318     // initialize state
00319     m_pStringMap = NULL;
00320     m_hRsrcImageWell = NULL;
00321     m_hInstImageWell = NULL;
00322     m_hbmImageWell = NULL;
00323     m_bDelayedButtonLayout = TRUE;
00324
00325     // default image sizes
00326     m_sizeImage.cx = 16;
00327     m_sizeImage.cy = 15;
00328
00329     // default button sizes
00330     m_sizeButton.cx = 23;
00331     m_sizeButton.cy = 22;
00332
00333     // top and bottom borders are 1 larger than default for ease of grabbing
00334     m_cyTopBorder = 3;
00335     m_cyBottomBorder = 3;
00336     m_bExStyle = false;
00337 }

CCJToolBar::~CCJToolBar ( ) [virtual]

Definition at line 339 of file CJToolBar.cpp.

References m_hbmImageWell, m_pControls, m_pDropButtons, m_pStringMap, and DROPDOWNBUTTON::next.

00340 {
00341     AfxDeleteObject((HGDIOBJ*)&m_hbmImageWell);
00342     delete m_pStringMap;
00343
00344     m_nCount = 0;
00345
00346     while (m_pDropButtons)
00347     {
00348         DROPDOWNBUTTON* pnext = m_pDropButtons->next;
00349         delete m_pDropButtons;
00350         m_pDropButtons = pnext;
00351     }
00352
00353     if( m_pControls ) {
00354         for( POSITION pos = m_pControls->GetHeadPosition() ; pos ; ) {
00355             delete m_pControls->GetNext(pos);
00356         }
00357         delete m_pControls;
00358     }
00359 }

Member Function Documentation

_CJXLIB_INLINE BOOL CCJToolBar::AddButtons | ( | int | nNumButtons,
 |  | LPTBBUTTON | lpButtons
 | ) |

Definition at line 403 of file CJToolBar.h.

References ASSERT.

Referenced by CCJMenuBar::LoadMenu.

00404     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_ADDBUTTONS, nNumButtons, (LPARAM)lpButtons); }

BOOL CCJToolBar::AddDropDownButton | ( | UINT | nIDButton,
 |  | UINT | nIDMenu,
 |  | BOOL | bArrow = TRUE
 | ) |

Definition at line 580 of file CJToolBar.cpp.

References ASSERT, CommandToIndex, FindDropDownButton, GetButtonStyle, DROPDOWNBUTTON::idButton, DROPDOWNBUTTON::idMenu, m_pDropButtons, DROPDOWNBUTTON::next, SetButtonStyle, SetExtendedStyle, and TRUE.

Referenced by UToolbar::RebuildBar.

00581 {
00582     ASSERT_VALID(this);
00583
00584     DROPDOWNBUTTON* pb = FindDropDownButton(nIDButton);
00585     if (!pb) {
00586         pb = new DROPDOWNBUTTON;
00587         ASSERT(pb);
00588         pb->next = m_pDropButtons;
00589         m_pDropButtons = pb;
00590     }
00591     pb->idButton = nIDButton;
00592     pb->idMenu   = nIDMenu;
00593
00594     int iButton = CommandToIndex(nIDButton);
00595
00596     DWORD dwStyle = GetButtonStyle(iButton);
00597     dwStyle |= TBSTYLE_DROPDOWN;
00598     SetButtonStyle(iButton, dwStyle);
00599
00600     if (bArrow)
00601         SetExtendedStyle(TBSTYLE_EX_DRAWDDARROWS);
00602
00603     return TRUE;
00604 }

BOOL CCJToolBar::AddReplaceBitmap ( HBITMAP hbmImageWell )

Definition at line 1141 of file CJToolBar.cpp.

References m_hbmImageWell, m_sizeImage, NULL, and VERIFY.

Referenced by LoadBitmap, OnSysColorChange, and SetBitmap.

01142 {
01143     // need complete bitmap size to determine number of images
01144     BITMAP bitmap;
01145     VERIFY(::GetObject(hbmImageWell, sizeof(BITMAP), &bitmap));
01146
01147     // add the bitmap to the common control toolbar
01148     BOOL bResult;
01149     if (m_hbmImageWell == NULL)
01150     {
01151         TBADDBITMAP addBitmap;
01152         addBitmap.hInst = NULL; // makes TBADDBITMAP::nID behave a HBITMAP
01153         addBitmap.nID = (UINT)hbmImageWell;
01154         bResult =  DefWindowProc(TB_ADDBITMAP,
01155             bitmap.bmWidth / m_sizeImage.cx, (LPARAM)&addBitmap) == 0;
01156     }
01157     else
01158     {
01159         TBREPLACEBITMAP replaceBitmap;
01160         replaceBitmap.hInstOld = NULL;
01161         replaceBitmap.nIDOld = (UINT)m_hbmImageWell;
01162         replaceBitmap.hInstNew = NULL;
01163         replaceBitmap.nIDNew = (UINT)hbmImageWell;
01164         replaceBitmap.nButtons = bitmap.bmWidth / m_sizeImage.cx;
01165         bResult = (BOOL)DefWindowProc(TB_REPLACEBITMAP, 0,
01166             (LPARAM)&replaceBitmap);
01167     }
01168     // remove old bitmap, if present
01169     if (bResult)
01170     {
01171         AfxDeleteObject((HGDIOBJ*)&m_hbmImageWell);
01172         m_hbmImageWell = hbmImageWell;
01173     }
01174
01175     return bResult;
01176 }

_CJXLIB_INLINE int CCJToolBar::AddStrings ( LPCTSTR lpszStrings )

Definition at line 418 of file CJToolBar.h.

References ASSERT.

Referenced by CCJMenuBar::LoadMenu.

00419     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_ADDSTRING, 0, (LPARAM)lpszStrings); }

_CJXLIB_INLINE void CCJToolBar::AutoSize ( )

Definition at line 430 of file CJToolBar.h.

References ASSERT.

Referenced by CCJMenuBar::LoadMenu.

00431     { ASSERT(::IsWindow(m_hWnd)); SendMessage(TB_AUTOSIZE); }

CSize CCJToolBar::CalcDynamicLayout | ( | int | nLength,
 |  | DWORD | nMode
 | ) | [virtual]

Definition at line 1687 of file CJToolBar.cpp.

References CalcFixedLayout, and CalcLayout.

Referenced by OnBarStyleChange.

01688 {
01689     if ((nLength == -1) && !(dwMode & LM_MRUWIDTH) && !(dwMode & LM_COMMIT) &&
01690         ((dwMode & LM_HORZDOCK) || (dwMode & LM_VERTDOCK)))
01691     {
01692         return CalcFixedLayout(dwMode & LM_STRETCH, dwMode & LM_HORZDOCK);
01693     }
01694     return CalcLayout(dwMode, nLength);
01695 }

CSize CCJToolBar::CalcFixedLayout | ( | BOOL | bStretch,
 |  | BOOL | bHorz
 | ) | [virtual]

Reimplemented in CCJMenuBar.

Definition at line 1679 of file CJToolBar.cpp.

References CalcLayout.

Referenced by CalcDynamicLayout, and CCJMenuBar::CalcFixedLayout.

01680 {
01681     DWORD dwMode = bStretch ? LM_STRETCH : 0;
01682     dwMode |= bHorz ? LM_HORZ : 0;
01683
01684     return CalcLayout(dwMode);
01685 }

CSize CCJToolBar::CalcLayout | ( | DWORD | nMode,
 |  | int | nLength = -1
 | ) | [protected]

Definition at line 1553 of file CJToolBar.cpp.

References ASSERT, CCJToolBarBase::CalcInsideRect, CalcSize, FALSE, GetButton, GetItemRect, m_bDelayedButtonLayout, CJX_CONTROLPOS::nID, CJX_CONTROLPOS::nIndex, NULL, CJX_CONTROLPOS::rectOldPos, SetButton, and SizeToolBar.

Referenced by CalcDynamicLayout, and CalcFixedLayout.

01554 {
01555     ASSERT_VALID(this);
01556     ASSERT(::IsWindow(m_hWnd));
01557     if (dwMode & LM_HORZDOCK)
01558         ASSERT(dwMode & LM_HORZ);
01559
01560     int nCount;
01561     TBBUTTON* pData = NULL;
01562     CSize sizeResult(0,0);
01563
01564     //BLOCK: Load Buttons
01565     {
01566         nCount = DefWindowProc(TB_BUTTONCOUNT, 0, 0);
01567         if (nCount != 0)
01568         {
01569             int i;
01570             pData = new TBBUTTON[nCount];
01571             for (i = 0; i < nCount; i++)
01572                 GetButton(i, &pData[i]);
01573         }
01574     }
01575
01576     if (nCount > 0)
01577     {
01578         if (!(m_dwStyle & CBRS_SIZE_FIXED))
01579         {
01580             BOOL bDynamic = m_dwStyle & CBRS_SIZE_DYNAMIC;
01581
01582             if (bDynamic && (dwMode & LM_MRUWIDTH))
01583                 SizeToolBar(pData, nCount, m_nMRUWidth);
01584             else if (bDynamic && (dwMode & LM_HORZDOCK))
01585                 SizeToolBar(pData, nCount, 32767);
01586             else if (bDynamic && (dwMode & LM_VERTDOCK))
01587                 SizeToolBar(pData, nCount, 0);
01588             else if (bDynamic && (nLength != -1))
01589             {
01590                 CRect rect; rect.SetRectEmpty();
01591                 CalcInsideRect(rect, (dwMode & LM_HORZ));
01592                 BOOL bVert = (dwMode & LM_LENGTHY);
01593                 int nLen = nLength + (bVert ? rect.Height() : rect.Width());
01594
01595                 SizeToolBar(pData, nCount, nLen, bVert);
01596             }
01597             else if (bDynamic && (m_dwStyle & CBRS_FLOATING))
01598                 SizeToolBar(pData, nCount, m_nMRUWidth);
01599             else
01600                 SizeToolBar(pData, nCount, (dwMode & LM_HORZ) ? 32767 : 0);
01601         }
01602
01603         sizeResult = CalcSize(pData, nCount);
01604
01605         if (dwMode & LM_COMMIT)
01606         {
01607             CJX_CONTROLPOS* pControl = NULL;
01608             int nControlCount = 0;
01609             BOOL bIsDelayed = m_bDelayedButtonLayout;
01610             m_bDelayedButtonLayout = FALSE;
01611
01612             for (int i = 0; i < nCount; i++)
01613                 if ((pData[i].fsStyle & TBSTYLE_SEP) && (pData[i].idCommand != 0))
01614                     nControlCount++;
01615
01616             if (nControlCount > 0)
01617             {
01618                 pControl = new CJX_CONTROLPOS[nControlCount];
01619                 nControlCount = 0;
01620
01621                 for(int i = 0; i < nCount; i++)
01622                 {
01623                     if ((pData[i].fsStyle & TBSTYLE_SEP) && (pData[i].idCommand != 0))
01624                     {
01625                         pControl[nControlCount].nIndex = i;
01626                         pControl[nControlCount].nID = pData[i].idCommand;
01627
01628                         CRect rect;
01629                         GetItemRect(i, &rect);
01630                         ClientToScreen(&rect);
01631                         pControl[nControlCount].rectOldPos = rect;
01632
01633                         nControlCount++;
01634                     }
01635                 }
01636             }
01637
01638             if ((m_dwStyle & CBRS_FLOATING) && (m_dwStyle & CBRS_SIZE_DYNAMIC))
01639                 m_nMRUWidth = sizeResult.cx;
01640             for (i = 0; i < nCount; i++)
01641                 SetButton(i, &pData[i]);
01642
01643             if (nControlCount > 0)
01644             {
01645                 for (int i = 0; i < nControlCount; i++)
01646                 {
01647                     CWnd* pWnd = GetDlgItem(pControl[i].nID);
01648                     if (pWnd != NULL)
01649                     {
01650                         CRect rect;
01651                         pWnd->GetWindowRect(&rect);
01652                         CPoint pt = rect.TopLeft() - pControl[i].rectOldPos.TopLeft();
01653                         GetItemRect(pControl[i].nIndex, &rect);
01654                         pt = rect.TopLeft() + pt;
01655                         pWnd->SetWindowPos(NULL, pt.x, pt.y, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER);
01656                     }
01657                 }
01658                 delete[] pControl;
01659             }
01660             m_bDelayedButtonLayout = bIsDelayed;
01661         }
01662         delete[] pData;
01663     }
01664
01665     //BLOCK: Adjust Margins
01666     {
01667         CRect rect; rect.SetRectEmpty();
01668         CalcInsideRect(rect, (dwMode & LM_HORZ));
01669         sizeResult.cy -= rect.Height();
01670         sizeResult.cx -= rect.Width();
01671
01672         CSize size = CCJToolBarBase::CalcFixedLayout((dwMode & LM_STRETCH), (dwMode & LM_HORZ));
01673         sizeResult.cx = max(sizeResult.cx, size.cx);
01674         sizeResult.cy = max(sizeResult.cy, size.cy);
01675     }
01676     return sizeResult;
01677 }

CSize CCJToolBar::CalcSize | ( | TBBUTTON * | pData,
 |  | int | nCount
 | ) | [protected]

Definition at line 1370 of file CJToolBar.cpp.

References ASSERT, CX_OVERLAP, GetButtonSize, m_sizeButton, and NULL.

Referenced by CalcLayout, and SizeToolBar.

01371 {
01372     ASSERT(pData != NULL && nCount > 0);
01373
01374     CPoint cur(0,0);
01375     CSize sizeResult(0,0);
01376     int cyTallestOnRow = 0;
01377
01378     for (int i = 0; i < nCount; i++)
01379     {
01380         if (pData[i].fsState & TBSTATE_HIDDEN)
01381             continue;
01382
01383         // **PD**
01384         // Load actual size of button into a local variable
01385         // called m_sizeButton. C++ will use this instead of
01386         // CToolBar::m_sizeButton.
01387         //
01388         CSize m_sizeButton = GetButtonSize(pData, i);
01389
01390         // **PD**
01391         // I also changed the logic below to be more correct.
01392         cyTallestOnRow = max(cyTallestOnRow, m_sizeButton.cy);
01393         sizeResult.cx = max(cur.x + m_sizeButton.cx, sizeResult.cx);
01394         sizeResult.cy = max(cur.y + m_sizeButton.cy, sizeResult.cy);
01395
01396         cur.x += m_sizeButton.cx - CX_OVERLAP;
01397
01398         if (pData[i].fsState & TBSTATE_WRAP)
01399         {
01400             cur.x = 0;
01401             cur.y += cyTallestOnRow;
01402             cyTallestOnRow = 0;
01403             if (pData[i].fsStyle & TBSTYLE_SEP)
01404                 cur.y += m_sizeButton.cy;
01405         }
01406     }
01407     return sizeResult;
01408 }

_CJXLIB_INLINE BOOL CCJToolBar::CheckButton | ( | int | nID,
 |  | BOOL | bCheck
 | ) |

Definition at line 370 of file CJToolBar.h.

References ASSERT.

00371     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_CHECKBUTTON, nID, MAKELPARAM(bCheck, 0)); }

int CCJToolBar::CommandToIndex ( UINT nIDFind ) const

Definition at line 1293 of file CJToolBar.cpp.

References ASSERT.

Referenced by AddDropDownButton, and InsertControl.

01294 {
01295     ASSERT_VALID(this);
01296     ASSERT(::IsWindow(m_hWnd));
01297
01298     CCJToolBar* pBar = (CCJToolBar*)this;
01299     return (int)pBar->DefWindowProc(TB_COMMANDTOINDEX, nIDFind, 0);
01300 }

BOOL CCJToolBar::Create | ( | CWnd * | pParentWnd,
 |  | DWORD | dwStyle = WS_CHILD|WS_VISIBLE|CBRS_TOP,
 |  | UINT | nID = AFX_IDW_TOOLBAR
 | ) | [virtual]

Reimplemented in CCJMenuBar.

Definition at line 361 of file CJToolBar.cpp.

References CreateEx, and NULL.

Referenced by UToolbar::OnTbInit.

00362 {
00363     return CreateEx(pParentWnd, NULL, dwStyle,
00364         CRect(m_cxLeftBorder, m_cyTopBorder, m_cxRightBorder, m_cyBottomBorder), nID);
00365 }

BOOL CCJToolBar::CreateEx | ( | CWnd * | pParentWnd,
 |  | DWORD | dwCtrlStyle = TBSTYLE_FLAT,
 |  | DWORD | dwStyle = WS_CHILD|WS_VISIBLE|CBRS_ALIGN_TOP,
 |  | CRect | rcBorders = CRect(0, 0, 0, 0),
 |  | UINT | nID = AFX_IDW_TOOLBAR
 | ) | [virtual]

Reimplemented in CCJMenuBar.

Definition at line 367 of file CJToolBar.cpp.

References _ComCtlVersion, _dropDownWidth, _GetComCtlVersion, _GetDropDownWidth, ASSERT, FALSE, CCJToolBarBase::m_bExStyle, m_sizeButton, m_sizeImage, NULL, CCJToolBarBase::SetBorders, SetSizes, TRUE, and VERIFY.

Referenced by Create, and CCJMenuBar::CreateEx.

00368 {
00369     ASSERT_VALID(pParentWnd);   // must have a parent
00370     ASSERT (!((dwStyle & CBRS_SIZE_FIXED) && (dwStyle & CBRS_SIZE_DYNAMIC)));
00371
00372     // KStowell - bool for drawing office style gripper.
00373     if( dwCtrlStyle != NULL )
00374         m_bExStyle = true;
00375
00376     SetBorders(rcBorders);
00377
00378     // save the style
00379     m_dwStyle = (dwStyle & CBRS_ALL)|( dwStyle & CBRS_GRIPPER );
00380     if (nID == AFX_IDW_TOOLBAR)
00381         m_dwStyle |= CBRS_HIDE_INPLACE;
00382
00383     dwStyle &= ~CBRS_ALL;
00384     dwStyle |= CCS_NOPARENTALIGN|CCS_NOMOVEY|CCS_NODIVIDER|CCS_NORESIZE;
00385     dwStyle |= dwCtrlStyle;
00386
00387     // initialize common controls
00388
00389 #ifdef _VC_VERSION_5
00390
00391     INITCOMMONCONTROLSEX icex;
00392     icex.dwSize = sizeof(icex);
00393     icex.dwICC = ICC_BAR_CLASSES;
00394     VERIFY(InitCommonControlsEx(&icex));
00395
00396 #else
00397
00398     VERIFY(AfxDeferRegisterClass(AFX_WNDCOMMCTL_BAR_REG));
00399
00400 #endif
00401
00402     _GetComCtlVersion();
00403     ASSERT(_ComCtlVersion != -1);
00404     _GetDropDownWidth();
00405     ASSERT(_dropDownWidth != -1);
00406
00407     // create the HWND
00408     CRect rect; rect.SetRectEmpty();
00409     if (!CWnd::Create(TOOLBARCLASSNAME, NULL, dwStyle, rect, pParentWnd, nID))
00410         return FALSE;
00411
00412     // sync up the sizes
00413     SetSizes(m_sizeButton, m_sizeImage);
00414
00415     // Note: Parent must resize itself for control bar to be resized
00416
00417     return TRUE;
00418 }

_CJXLIB_INLINE void CCJToolBar::Customize ( )

Definition at line 415 of file CJToolBar.h.

References ASSERT.

00416     { ASSERT(::IsWindow(m_hWnd)); SendMessage(TB_CUSTOMIZE, 0, 0L); }

_CJXLIB_INLINE BOOL CCJToolBar::DeleteButton ( int nIndex )

Definition at line 409 of file CJToolBar.h.

References ASSERT.

Referenced by CCJMenuBar::LoadMenu.

00410     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_DELETEBUTTON, nIndex); }

_CJXLIB_INLINE BOOL CCJToolBar::EnableButton | ( | int | nID,
 |  | BOOL | bEnable
 | ) |

Definition at line 367 of file CJToolBar.h.

References ASSERT.

00368     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_ENABLEBUTTON, nID, MAKELPARAM(bEnable, 0)); }

DROPDOWNBUTTON * CCJToolBar::FindDropDownButton ( UINT nID )

Definition at line 610 of file CJToolBar.cpp.

References DROPDOWNBUTTON::idButton, m_pDropButtons, DROPDOWNBUTTON::next, and NULL.

Referenced by AddDropDownButton, and OnDropDownButton.

00611 {
00612     for (DROPDOWNBUTTON* pb = m_pDropButtons; pb; pb = pb->next) {
00613         if (pb->idButton == nID)
00614             return pb;
00615     }
00616     return NULL;
00617 }

_CJXLIB_INLINE int CCJToolBar::GetBitmap ( UINT nIdButton ) const

Definition at line 461 of file CJToolBar.h.

References ASSERT, and SendMessageC.

00462     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_GETBITMAP, nIdButton); }

_CJXLIB_INLINE UINT CCJToolBar::GetBitmapFlags ( ) const

Definition at line 448 of file CJToolBar.h.

References ASSERT, and SendMessageC.

00449     { ASSERT(::IsWindow(m_hWnd)); return (UINT) SendMessageC(TB_GETBITMAPFLAGS); }

void CCJToolBar::GetButton | ( | int | nIndex,
 |  | TBBUTTON * | pButton
 | ) | const

Definition at line 1244 of file CJToolBar.cpp.

References VERIFY.

Referenced by CalcLayout, GetButtonInfo, GetButtonStyle, GetButtonText, GetItemID, OnUpdateCmdUI, SetButtonInfo, SetButtonStyle, and SetButtonText.

01245 {
01246     CCJToolBar* pBar = (CCJToolBar*)this;
01247     VERIFY(pBar->DefWindowProc(TB_GETBUTTON, nIndex, (LPARAM)pButton));
01248     // TBSTATE_ENABLED == TBBS_DISABLED so invert it
01249     pButton->fsState ^= TBSTATE_ENABLED;
01250 }

_CJXLIB_INLINE int CCJToolBar::GetButtonCount ( ) const

Definition at line 412 of file CJToolBar.h.

References ASSERT, and SendMessageC.

Referenced by CCJMenuBar::GetNextOrPrevButton, CCJMenuBar::IsValidButton, CCJMenuBar::LoadMenu, and CCJMenuBar::OnLButtonDown.

00413     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_BUTTONCOUNT); }

void CCJToolBar::GetButtonInfo | ( | int | nIndex,
 |  | UINT & | nID,
 |  | UINT & | nStyle,
 |  | int & | iImage
 | ) | const

Definition at line 1697 of file CJToolBar.cpp.

References ASSERT, and GetButton.

01698 {
01699     ASSERT_VALID(this);
01700     ASSERT(::IsWindow(m_hWnd));
01701
01702     TBBUTTON button;
01703     GetButton(nIndex, &button);
01704     nID = button.idCommand;
01705     nStyle = MAKELONG(button.fsStyle, button.fsState);
01706     iImage = button.iBitmap;
01707 }

CSize CCJToolBar::GetButtonSize | ( | TBBUTTON * | pData,
 |  | int | iButton
 | ) | [virtual]

Definition at line 718 of file CJToolBar.cpp.

References _ComCtlVersion, ASSERT, m_bShowDropArrow, VERSION_IE3, and VERSION_IE4.

Referenced by CalcSize, and WrapToolBar.

00719 {
00720     ASSERT(_ComCtlVersion > 0);
00721
00722     // Get the actual size of the button, not what's in m_sizeButton.
00723     // Make sure to do SendMessage instead of calling MFC's GetItemRect,
00724     // which has all sorts of bad side-effects! (Go ahead, take a look at it.)
00725     //
00726     CRect rc;
00727     SendMessage(TB_GETITEMRECT, iButton, (LPARAM)&rc);
00728     CSize sz = rc.Size();
00729
00731     // Now must do special case for various versions of comctl32.dll,
00732     //
00733     DWORD dwStyle = pData[iButton].fsStyle;
00734     if ((pData[iButton].fsState & TBSTATE_WRAP)) {
00735         if (dwStyle & TBSTYLE_SEP) {
00736             // this is the last separator in the row (eg vertically docked)
00737             // fudge the height, and ignore the width. TB_GETITEMRECT will return
00738             // size = (8 x 22) even for a separator in vertical toolbar
00739             //
00740             if (_ComCtlVersion <= VERSION_IE3)
00741                 sz.cy -= 3;     // empircally good fudge factor
00742             else if (_ComCtlVersion != VERSION_IE4)
00743                 sz.cy = sz.cx;
00744             sz.cx = 0;          // separator takes no width if it's the last one
00745
00746         } else if (dwStyle & TBSTYLE_DROPDOWN && ( m_bShowDropArrow == false )) {
00747             // ignore width of dropdown
00748             sz.cx = 0;
00749         }
00750     }
00751     return sz;
00752 }

UINT CCJToolBar::GetButtonStyle ( int nIndex ) const

Definition at line 1342 of file CJToolBar.cpp.

References ASSERT, and GetButton.

Referenced by AddDropDownButton, CCJToolCmdUI::Enable, and UToolbar::RebuildBar.

01343 {
01344     ASSERT_VALID(this);
01345     ASSERT(::IsWindow(m_hWnd));
01346
01347     TBBUTTON button;
01348     GetButton(nIndex, &button);
01349     return MAKELONG(button.fsStyle, button.fsState);
01350 }

void CCJToolBar::GetButtonText | ( | int | nIndex,
 |  | CString & | rString
 | ) | const

Definition at line 1811 of file CJToolBar.cpp.

References GetButton, m_pStringMap, and NULL.

01812 {
01813     if (m_pStringMap != NULL)
01814     {
01815         // get button information (need button.iString)
01816         TBBUTTON button;
01817         GetButton(nIndex, &button);
01818
01819         // look in map for matching iString
01820         POSITION pos = m_pStringMap->GetStartPosition();
01821         CString str; void* p;
01822         while (pos)
01823         {
01824             m_pStringMap->GetNextAssoc(pos, str, p);
01825             if ((int)p == button.iString)
01826             {
01827                 rString = str;
01828                 return;
01829             }
01830         }
01831     }
01832     rString.Empty();
01833 }

CString CCJToolBar::GetButtonText ( int nIndex ) const

Definition at line 1804 of file CJToolBar.cpp.

01805 {
01806     CString strResult;
01807     GetButtonText(nIndex, strResult);
01808     return strResult;
01809 }

_CJXLIB_INLINE int CCJToolBar::GetHotItem ( ) const

Definition at line 479 of file CJToolBar.h.

References ASSERT, and SendMessageC.

Referenced by CCJMenuBar::TranslateFrameMessage.

00480     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_GETHOTITEM); }

_CJXLIB_INLINE HIMAGELIST CCJToolBar::GetImageList ( ) const

Definition at line 455 of file CJToolBar.h.

References ASSERT, and SendMessageC.

00456     { ASSERT(::IsWindow(m_hWnd)); return (HIMAGELIST)SendMessageC(TB_GETIMAGELIST); }

UINT CCJToolBar::GetItemID ( int nIndex ) const

Definition at line 1302 of file CJToolBar.cpp.

References ASSERT, and GetButton.

Referenced by OnToolHitTest.

01303 {
01304     ASSERT_VALID(this);
01305     ASSERT(::IsWindow(m_hWnd));
01306
01307     TBBUTTON button;
01308     GetButton(nIndex, &button);
01309     return button.idCommand;
01310 }

void CCJToolBar::GetItemRect | ( | int | nIndex,
 |  | LPRECT | lpRect
 | ) | const [virtual]

Definition at line 1312 of file CJToolBar.cpp.

References ASSERT, and SetRectEmpty.

Referenced by CalcLayout, InsertControl, and UToolbar::RebuildBar.

01313 {
01314     ASSERT_VALID(this);
01315     ASSERT(::IsWindow(m_hWnd));
01316
01317     // handle any delayed layout
01318     if (m_bDelayedButtonLayout)
01319         ((CCJToolBar*)this)->Layout();
01320
01321     // now it is safe to get the item rectangle
01322     CCJToolBar* pBar = (CCJToolBar*)this;
01323     if (!pBar->DefWindowProc(TB_GETITEMRECT, nIndex, (LPARAM)lpRect))
01324         SetRectEmpty(lpRect);
01325 }

_CJXLIB_INLINE CSize CCJToolBar::GetPadding ( ) const

Definition at line 488 of file CJToolBar.h.

References ASSERT, and SendMessageC.

00489     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_GETPADDING); }

_CJXLIB_INLINE BOOL CCJToolBar::GetRect | ( | UINT | nIdButton,
 |  | RECT & | rc
 | ) | const

Definition at line 467 of file CJToolBar.h.

References ASSERT, and SendMessageC.

Referenced by OnToolBarBtnDropDown, and CCJMenuBar::TrackPopup.

00468     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_GETRECT, nIdButton, (LPARAM)&rc); }

_CJXLIB_INLINE int CCJToolBar::GetRows ( ) const

Definition at line 442 of file CJToolBar.h.

References ASSERT, and SendMessageC.

00443     { ASSERT(::IsWindow(m_hWnd)); return (int) SendMessageC(TB_GETROWS); }

_CJXLIB_INLINE int CCJToolBar::GetState ( int nID ) const

Definition at line 400 of file CJToolBar.h.

References ASSERT, and SendMessageC.

00401     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_GETSTATE, nID); }

_CJXLIB_INLINE CCJToolBarCtrl & CCJToolBar::GetToolBarCtrl ( ) const

Definition at line 355 of file CJToolBar.h.

References ASSERT.

Referenced by LoadToolBar, OnRButtonDown, RestoreState, and SaveState.

00356     { ASSERT(::IsWindow(m_hWnd)); return *(CCJToolBarCtrl*)this; }

_CJXLIB_INLINE DWORD CCJToolBar::GetToolbarStyle ( ) const

Definition at line 470 of file CJToolBar.h.

References ASSERT, and SendMessageC.

00471     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_GETSTYLE); }

_CJXLIB_INLINE CToolTipCtrl * CCJToolBar::GetToolTips ( ) const

Definition at line 433 of file CJToolBar.h.

References ASSERT, and SendMessageC.

00434     { ASSERT(::IsWindow(m_hWnd)); return (CToolTipCtrl*)CWnd::FromHandle((HWND)SendMessageC(TB_GETTOOLTIPS)); }

_CJXLIB_INLINE BOOL CCJToolBar::HideButton | ( | int | nID,
 |  | BOOL | bHide
 | ) |

Definition at line 376 of file CJToolBar.h.

References ASSERT.

00377     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_HIDEBUTTON, nID, MAKELPARAM(bHide, 0)); }

_CJXLIB_INLINE int CCJToolBar::HitTest ( CPoint p ) const

Reimplemented in CCJMenuBar.

Definition at line 476 of file CJToolBar.h.

References ASSERT, and SendMessageC.

Referenced by CCJMenuBar::HitTest.

00477     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_HITTEST, 0, (LPARAM)&p); }

_CJXLIB_INLINE BOOL CCJToolBar::Indeterminate | ( | int | nID,
 |  | BOOL | bIndeterminate
 | ) |

Definition at line 379 of file CJToolBar.h.

References ASSERT.

00380     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_INDETERMINATE, nID, MAKELPARAM(bIndeterminate, 0)); }

_CJXLIB_INLINE BOOL CCJToolBar::InsertButton | ( | int | nIndex,
 |  | LPTBBUTTON | lpButton
 | ) |

Definition at line 406 of file CJToolBar.h.

References ASSERT.

00407     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_INSERTBUTTON, nIndex, (LPARAM)lpButton); }

CWnd * CCJToolBar::InsertControl | ( | CWnd * | pCtrl,
 |  | CRect & | rect,
 |  | UINT | nID
 | ) |

Definition at line 557 of file CJToolBar.cpp.

References ASSERT, CommandToIndex, GetItemRect, SetButtonInfo, and TBBS_SEPARATOR.

00558 {
00559     ASSERT_VALID( pCtrl );
00560
00561     // make sure the id is valid, and set the button
00562     // style for a seperator.
00563     ASSERT( CommandToIndex( nID ) >= 0 );
00564     SetButtonInfo( CommandToIndex( nID ), nID, TBBS_SEPARATOR, rect.Width());
00565
00566     // insert the control into the toolbar.
00567     GetItemRect( CommandToIndex(nID), &rect );
00568     pCtrl->SetWindowPos(0, rect.left, rect.top, 0, 0,
00569         SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOCOPYBITS );
00570     pCtrl->SetFont( GetFont( ));
00571     pCtrl->ShowWindow( SW_SHOW );
00572
00573     return pCtrl;
00574 }

CWnd * CCJToolBar::InsertControl | ( | CRuntimeClass * | pClass,
 |  | LPCTSTR | lpszWindowName,
 |  | CRect & | rect,
 |  | UINT | nID,
 |  | DWORD | dwStyle
 | ) |

Definition at line 433 of file CJToolBar.cpp.

References ASSERT, FALSE, m_pControls, and NULL.

00434 {
00435     CWnd *pCtrl = NULL;
00436
00437     if( pClass->IsDerivedFrom( RUNTIME_CLASS( CCJComboBoxEx ))) // CCJComboBoxEx control.
00438     {
00439         pCtrl = new CCJComboBoxEx;
00440
00441         ASSERT_VALID( pCtrl );
00442
00443         if(((CCJComboBoxEx*)pCtrl)->Create( WS_CHILD|WS_VISIBLE|dwStyle, rect, this, nID ) == FALSE )
00444         {
00445             delete pCtrl;
00446             return NULL;
00447         }
00448     }
00449     else if( pClass->IsDerivedFrom( RUNTIME_CLASS( CCJFlatComboBox )))  // CCJFlatComboBox control.
00450     {
00451         pCtrl = new CCJFlatComboBox;
00452
00453         ASSERT_VALID( pCtrl );
00454
00455         if(((CCJFlatComboBox*)pCtrl)->Create( WS_CHILD|WS_VISIBLE|dwStyle, rect, this, nID ) == FALSE )
00456         {
00457             delete pCtrl;
00458             return NULL;
00459         }
00460     }
00461     else if( pClass->IsDerivedFrom( RUNTIME_CLASS( CCJFontCombo ))) // CCJFontCombo control.
00462     {
00463         pCtrl = new CCJFontCombo;
00464
00465         ASSERT_VALID( pCtrl );
00466
00467         if(((CCJFontCombo*)pCtrl)->Create( WS_CHILD|WS_VISIBLE|dwStyle, rect, this, nID ) == FALSE )
00468         {
00469             delete pCtrl;
00470             return NULL;
00471         }
00472     }
00473     else if( pClass->IsDerivedFrom( RUNTIME_CLASS( CComboBox )))    // CComboBox control.
00474     {
00475         pCtrl = new CComboBox;
00476
00477         ASSERT_VALID( pCtrl );
00478
00479         if(((CComboBox*)pCtrl)->Create( WS_CHILD|WS_VISIBLE|dwStyle, rect, this, nID ) == FALSE )
00480         {
00481             delete pCtrl;
00482             return NULL;
00483         }
00484     }
00485     else if( pClass->IsDerivedFrom( RUNTIME_CLASS( CEdit )))        // CEdit control.
00486     {
00487         pCtrl = new CEdit;
00488
00489         ASSERT_VALID( pCtrl );
00490
00491         if(((CEdit*)pCtrl)->Create( WS_CHILD|WS_VISIBLE|dwStyle, rect, this, nID ) == FALSE )
00492         {
00493             delete pCtrl;
00494             return NULL;
00495         }
00496     }
00497     else if( pClass->IsDerivedFrom( RUNTIME_CLASS( CButton )))      // CButton control.
00498     {
00499         pCtrl = new CButton;
00500
00501         ASSERT_VALID( pCtrl );
00502
00503         if(((CButton*)pCtrl)->Create( lpszWindowName, WS_CHILD|WS_VISIBLE|dwStyle, rect, this, nID ) == FALSE )
00504         {
00505             delete pCtrl;
00506             return NULL;
00507         }
00508     }
00509     else if( pClass->IsDerivedFrom( RUNTIME_CLASS( CWnd )))         // CWnd object.
00510     {
00511         pCtrl = new CWnd;
00512
00513         ASSERT_VALID( pCtrl );
00514
00515 #ifdef _UNICODE
00516         TCHAR szClassName[ 256 ];
00517
00518         MultiByteToWideChar( CP_ACP,
00519                              MB_PRECOMPOSED,
00520                              pClass->m_lpszClassName,
00521                              -1,
00522                              szClassName,
00523                              255 );
00524
00525         if(((CWnd*)pCtrl)->Create( szClassName, lpszWindowName, WS_CHILD|WS_VISIBLE|dwStyle, rect, this, nID ) == FALSE )
00526         {
00527             delete pCtrl;
00528             return NULL;
00529         }
00530 #else
00531         if(((CWnd*)pCtrl)->Create( pClass->m_lpszClassName, lpszWindowName, WS_CHILD|WS_VISIBLE|dwStyle, rect, this, nID ) == FALSE )
00532         {
00533             delete pCtrl;
00534             return NULL;
00535         }
00536 #endif
00537     }
00538     else                                                            // An invalid object was passed in
00539     {
00540         ASSERT( FALSE );
00541         return NULL;
00542     }
00543
00544     // if our object list has not been allocated, do it now...
00545     if( m_pControls == NULL )
00546     {
00547         m_pControls = new CObList();
00548         ASSERT( m_pControls );
00549     }
00550
00551     // we have to remember this control, so we can delete it later
00552     m_pControls->AddTail( pCtrl );
00553
00554     return InsertControl( pCtrl, rect, nID );
00555 }

void CCJToolBar::InvalidateOldPos ( const CRect & rcInvalid ) [virtual]

Definition at line 688 of file CJToolBar.cpp.

Referenced by OnWindowPosChanged.

00689 {
00690     // make parent paint the area beneath rectangle
00691     CWnd* pParent = GetParent();        // parent (dock bar/frame) window
00692     ASSERT_VALID(pParent);              // check
00693     CRect rc( rcInvalid );              // copy rectangle
00694     pParent->ScreenToClient(&rc);       // convert to parent client coords
00695     pParent->InvalidateRect(&rc);       // invalidate
00696
00697     // now do same for each sibling too
00698     for (CWnd* pSib = pParent->GetWindow(GW_CHILD);
00699           pSib;
00700           pSib=pSib->GetNextWindow(GW_HWNDNEXT)) {
00701
00702         CRect rc;                                       // window rect of sibling
00703         pSib->GetWindowRect(&rc);                   // ...
00704         if (rc.IntersectRect(rc, rcInvalid)) {  // if intersects invalid rect
00705             pSib->ScreenToClient(&rc);              // convert to sibling coords
00706             pSib->InvalidateRect(&rc);              // invalidate
00707             pSib->SendMessage(WM_NCPAINT);      // nonclient area too!
00708         }
00709     }
00710 }

_CJXLIB_INLINE BOOL CCJToolBar::IsButtonChecked ( int nID ) const

Definition at line 385 of file CJToolBar.h.

References ASSERT, and SendMessageC.

00386     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_ISBUTTONCHECKED, nID); }

_CJXLIB_INLINE BOOL CCJToolBar::IsButtonEnabled ( int nID ) const

Definition at line 382 of file CJToolBar.h.

References ASSERT, and SendMessageC.

00383     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_ISBUTTONENABLED, nID); }

_CJXLIB_INLINE BOOL CCJToolBar::IsButtonHidden ( int nID ) const

Definition at line 391 of file CJToolBar.h.

References ASSERT, and SendMessageC.

00392     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_ISBUTTONHIDDEN, nID); }

_CJXLIB_INLINE BOOL CCJToolBar::IsButtonIndeterminate ( int nID ) const

Definition at line 394 of file CJToolBar.h.

References ASSERT, and SendMessageC.

00395     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_ISBUTTONINDETERMINATE, nID); }

_CJXLIB_INLINE BOOL CCJToolBar::IsButtonPressed ( int nID ) const

Definition at line 388 of file CJToolBar.h.

References ASSERT, and SendMessageC.

00389     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_ISBUTTONPRESSED, nID); }

void CCJToolBar::Layout ( ) [protected]

Definition at line 1327 of file CJToolBar.cpp.

References ASSERT, FALSE, and m_bDelayedButtonLayout.

Referenced by OnPaint.

01328 {
01329     ASSERT(m_bDelayedButtonLayout);
01330
01331     m_bDelayedButtonLayout = FALSE;
01332
01333     BOOL bHorz = (m_dwStyle & CBRS_ORIENT_HORZ) != 0;
01334     if ((m_dwStyle & CBRS_FLOATING) && (m_dwStyle & CBRS_SIZE_DYNAMIC))
01335         ((CCJToolBar*)this)->CalcDynamicLayout(0, LM_HORZ | LM_MRUWIDTH | LM_COMMIT);
01336     else if (bHorz)
01337         ((CCJToolBar*)this)->CalcDynamicLayout(0, LM_HORZ | LM_HORZDOCK | LM_COMMIT);
01338     else
01339         ((CCJToolBar*)this)->CalcDynamicLayout(0, LM_VERTDOCK | LM_COMMIT);
01340 }

_CJXLIB_INLINE BOOL CCJToolBar::LoadBitmap ( UINT nIDResource )

Definition at line 358 of file CJToolBar.h.

References LoadBitmap.

00359     { return LoadBitmap(MAKEINTRESOURCE(nIDResource)); }

BOOL CCJToolBar::LoadBitmap ( LPCTSTR lpszResourceName )

Definition at line 1103 of file CJToolBar.cpp.

References _LoadSysColorBitmap, AddReplaceBitmap, ASSERT, FALSE, m_hInstImageWell, m_hRsrcImageWell, NULL, and TRUE.

Referenced by LoadBitmap, and LoadToolBar.

01104 {
01105     ASSERT_VALID(this);
01106     ASSERT(lpszResourceName != NULL);
01107
01108     // determine location of the bitmap in resource fork
01109     HINSTANCE hInstImageWell = AfxFindResourceHandle(lpszResourceName, RT_BITMAP);
01110     HRSRC hRsrcImageWell = ::FindResource(hInstImageWell, lpszResourceName, RT_BITMAP);
01111     if (hRsrcImageWell == NULL)
01112         return FALSE;
01113
01114     // load the bitmap
01115     HBITMAP hbmImageWell;
01116     hbmImageWell = _LoadSysColorBitmap(hInstImageWell, hRsrcImageWell);
01117
01118     // tell common control toolbar about the new bitmap
01119     if (!AddReplaceBitmap(hbmImageWell))
01120         return FALSE;
01121
01122     // remember the resource handles so the bitmap can be recolored if necessary
01123     m_hInstImageWell = hInstImageWell;
01124     m_hRsrcImageWell = hRsrcImageWell;
01125     return TRUE;
01126 }

_CJXLIB_INLINE BOOL CCJToolBar::LoadToolBar | ( | UINT | nIDResource,
 |  | TOOLBARINFO * | pBarInfo = NULL
 | ) |

Definition at line 361 of file CJToolBar.h.

References LoadToolBar.

00362     { return LoadToolBar(MAKEINTRESOURCE(nIDResource), pBarInfo); }

BOOL CCJToolBar::LoadToolBar | ( | LPCTSTR | lpszResourceName,
 |  | TOOLBARINFO * | pBarInfo = NULL
 | ) |

Definition at line 1049 of file CJToolBar.cpp.

References ASSERT, FALSE, GetToolBarCtrl, CToolBarData::items, LoadBitmap, m_nButtons, m_pBarInfo, NULL, RestoreState, SetButtons, SetSizes, CToolBarData::wHeight, CToolBarData::wItemCount, CToolBarData::wVersion, and CToolBarData::wWidth.

Referenced by LoadToolBar.

01050 {
01051     ASSERT_VALID(this);
01052     ASSERT(lpszResourceName != NULL);
01053
01054     // determine location of the bitmap in resource fork
01055     HINSTANCE hInst = AfxFindResourceHandle(lpszResourceName, RT_TOOLBAR);
01056     HRSRC hRsrc = ::FindResource(hInst, lpszResourceName, RT_TOOLBAR);
01057     if (hRsrc == NULL)
01058         return FALSE;
01059
01060     HGLOBAL hGlobal = LoadResource(hInst, hRsrc);
01061     if (hGlobal == NULL)
01062         return FALSE;
01063
01064     CToolBarData* pData = (CToolBarData*)LockResource(hGlobal);
01065     if (pData == NULL)
01066         return FALSE;
01067     ASSERT(pData->wVersion == 1);
01068
01069     UINT* pItems = new UINT[pData->wItemCount];
01070     for (int i = 0; i < pData->wItemCount; i++)
01071         pItems[i] = pData->items()[i];
01072     BOOL bResult = SetButtons(pItems, pData->wItemCount);
01073     delete[] pItems;
01074
01075     if (bResult)
01076     {
01077         // set new sizes of the buttons
01078         CSize sizeImage(pData->wWidth, pData->wHeight);
01079         CSize sizeButton(pData->wWidth + 7, pData->wHeight + 7);
01080         SetSizes(sizeButton, sizeImage);
01081
01082         // load bitmap now that sizes are known by the toolbar control
01083         bResult = LoadBitmap(lpszResourceName);
01084     }
01085
01086     UnlockResource(hGlobal);
01087     FreeResource(hGlobal);
01088
01089     // is the toolbar is customizable?
01090     if(( pBarInfo ) && ( bResult )) {
01091         m_pBarInfo = pBarInfo;
01092         m_nButtons = GetToolBarCtrl().GetButtonCount();
01093
01094         // modify the style to include adjustable
01095         ModifyStyle(0, CCS_ADJUSTABLE);
01096         RestoreState();
01097     }
01098
01099
01100     return bResult;
01101 }

_CJXLIB_INLINE BOOL CCJToolBar::MapAccelerator | ( | TCHAR | ch,
 |  | UINT & | nID
 | ) | const

Definition at line 485 of file CJToolBar.h.

References ASSERT, and SendMessageC.

Referenced by CCJMenuBar::TranslateFrameMessage.

00486     { ASSERT(::IsWindow(m_hWnd)); return SendMessageC(TB_MAPACCELERATOR, (WPARAM)ch, (LPARAM)&nID); }

void CCJToolBar::OnBarStyleChange | ( | DWORD | dwOldStyle,
 |  | DWORD | dwNewStyle
 | ) | [virtual]

Reimplemented in CCJMenuBar.

Definition at line 1911 of file CJToolBar.cpp.

References ASSERT, CalcDynamicLayout, m_bDelayedButtonLayout, NULL, and TRUE.

Referenced by CCJMenuBar::OnBarStyleChange.

01912 {
01913     // a dynamically resizeable toolbar can not have the CBRS_FLOAT_MULTI
01914     ASSERT(!((dwNewStyle & CBRS_SIZE_DYNAMIC) &&
01915         (m_dwDockStyle & CBRS_FLOAT_MULTI)));
01916
01917     // a toolbar can not be both dynamic and fixed in size
01918     ASSERT (!((dwNewStyle & CBRS_SIZE_FIXED) &&
01919         (dwNewStyle & CBRS_SIZE_DYNAMIC)));
01920
01921     // CBRS_SIZE_DYNAMIC can not be disabled once it has been enabled
01922     ASSERT (((dwOldStyle & CBRS_SIZE_DYNAMIC) == 0) ||
01923         ((dwNewStyle & CBRS_SIZE_DYNAMIC) != 0));
01924
01925     if (m_hWnd != NULL &&
01926         ((dwOldStyle & CBRS_BORDER_ANY) != (dwNewStyle & CBRS_BORDER_ANY)))
01927     {
01928         // recalc non-client area when border styles change
01929         SetWindowPos(NULL, 0, 0, 0, 0,
01930             SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_DRAWFRAME);
01931     }
01932     m_bDelayedButtonLayout = TRUE;
01933
01934     if (dwOldStyle != dwNewStyle) {
01935         DWORD dwMode = 0;
01936         if ((dwNewStyle & CBRS_SIZE_DYNAMIC) && (dwNewStyle & CBRS_FLOATING))
01937             dwMode = LM_HORZ | LM_MRUWIDTH;
01938         else if (dwNewStyle & CBRS_ORIENT_HORZ)
01939             dwMode = LM_HORZ | LM_HORZDOCK;
01940         else
01941             dwMode =  LM_VERTDOCK;
01942
01943         CalcDynamicLayout(-1, dwMode | LM_COMMIT);
01944     }
01945 }

void CCJToolBar::OnDestroy ( ) [protected]

Reimplemented in CDynToolBar.

Definition at line 899 of file CJToolBar.cpp.

References SaveState.

Referenced by CDynToolBar::OnDestroy.

00900 {
00901     // save the current state of the toolbar
00902     SaveState();
00903
00904     CCJToolBarBase::OnDestroy();
00905 }

void CCJToolBar::OnDropDownButton | ( | const NMTOOLBAR & | nmtb,
 |  | UINT | nID,
 |  | CRect | rc
 | ) | [virtual]

Reimplemented in CDynToolBar.

Definition at line 649 of file CJToolBar.cpp.

References ASSERT, FindDropDownButton, DROPDOWNBUTTON::idMenu, CCJMenu::LoadMenu, and VERIFY.

Referenced by OnToolBarBtnDropDown.

00650 {
00651     UNUSED_ALWAYS( nID );
00652
00653     DROPDOWNBUTTON* pb = FindDropDownButton(nmtb.iItem);
00654     if (pb && pb->idMenu) {
00655
00656         // load and display popup menu
00657         CCJMenu menu;
00658         VERIFY(menu.LoadMenu(pb->idMenu));
00659         CCJMenu* pPopup = (CCJMenu*)menu.GetSubMenu(0);
00660         ASSERT(pPopup);
00661         pPopup->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_VERTICAL,
00662             rc.left, rc.bottom, GetParentFrame(), &rc);
00663     }
00664 }

BOOL CCJToolBar::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 1872 of file CJToolBar.cpp.

01873 {
01874     return (BOOL)Default();
01875 }

void CCJToolBar::OnNcCalcSize | ( | BOOL | ,
 |  | NCCALCSIZE_PARAMS * |
 | ) | [protected]

Definition at line 1885 of file CJToolBar.cpp.

References _ComCtlVersion, ASSERT, CCJToolBarBase::CalcInsideRect, and VERSION_IE4.

01886 {
01887     // calculate border space (will add to top/bottom, subtract from right/bottom)
01888     CRect rect; rect.SetRectEmpty();
01889     BOOL bHorz = (m_dwStyle & CBRS_ORIENT_HORZ) != 0;
01890     CCJToolBarBase::CalcInsideRect(rect, bHorz);
01891     ASSERT(_ComCtlVersion != -1);
01892     ASSERT(_ComCtlVersion >= VERSION_IE4 || rect.top >= 2);
01893
01894     // adjust non-client area for border space
01895     lpncsp->rgrc[0].left += rect.left;
01896     lpncsp->rgrc[0].top += rect.top;
01897     // previous versions of COMCTL32.DLL had a built-in 2 pixel border
01898     if (_ComCtlVersion < VERSION_IE4)
01899         lpncsp->rgrc[0].top -= 2;
01900     lpncsp->rgrc[0].right += rect.right;
01901     lpncsp->rgrc[0].bottom += rect.bottom;
01902 }

BOOL CCJToolBar::OnNcCreate ( LPCREATESTRUCT ) [protected]

Definition at line 942 of file CJToolBar.cpp.

References ASSERT, FALSE, CCJToolBarBase::m_bExStyle, CCJToolBarBase::m_bInReBar, NULL, SetOwner, and TRUE.

00943 {
00944     // If the toolbar is inside a ReBar, we need to make the parent frame
00945     // the owner so it will get notifications.
00946     CWnd* pParent = GetParent();
00947     ASSERT(pParent);
00948     TCHAR classname[64];
00949     GetClassName(pParent->m_hWnd, classname, _countof(classname));
00950     if (_tcscmp(classname, REBARCLASSNAME)==0)
00951     {
00952         CFrameWnd* pFrame = GetParentFrame();
00953         ASSERT_VALID(pFrame);
00954         SetOwner(pFrame);
00955         m_bInReBar = true;
00956         m_bExStyle = false;
00957     }
00958
00959     if (!CCJToolBarBase::OnNcCreate(lpCreateStruct))
00960         return FALSE;
00961
00962     // if the owner was set before the toolbar was created, set it now
00963     if (m_hWndOwner != NULL)
00964         DefWindowProc(TB_SETPARENT, (WPARAM)m_hWndOwner, 0);
00965
00966     DefWindowProc(TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
00967     return TRUE;
00968 }

UINT CCJToolBar::OnNcHitTest ( CPoint ) [protected]

Definition at line 1877 of file CJToolBar.cpp.

01878 {
01879     return HTCLIENT;
01880 }

void CCJToolBar::OnNcPaint ( ) [protected]

Definition at line 1947 of file CJToolBar.cpp.

References CCJToolBarBase::EraseNonClient.

01948 {
01949     EraseNonClient();
01950 }

void CCJToolBar::OnPaint ( ) [protected]

Reimplemented from CCJToolBarBase.

Definition at line 1961 of file CJToolBar.cpp.

References Layout.

01962 {
01963     if (m_bDelayedButtonLayout)
01964         Layout();
01965
01966     Default();
01967 }

LRESULT CCJToolBar::OnPreserveZeroBorderHelper | ( | WPARAM | ,
 |  | LPARAM |
 | ) | [protected]

Definition at line 2009 of file CJToolBar.cpp.

References _ComCtlVersion, ASSERT, FALSE, and VERSION_IE4.

02010 {
02011     UNUSED_ALWAYS( lParam );
02012
02013     BOOL bModify = FALSE;
02014     ASSERT(_ComCtlVersion != -1);
02015     DWORD dwStyle = 0;
02016     if (_ComCtlVersion >= VERSION_IE4)
02017     {
02018         dwStyle = GetStyle();
02019         bModify = ModifyStyle(0, TBSTYLE_TRANSPARENT|TBSTYLE_FLAT);
02020     }
02021
02022     LRESULT lResult = Default();
02023
02024     if (bModify)
02025         SetWindowLong(m_hWnd, GWL_STYLE, dwStyle);
02026
02027     return lResult;
02028 }

void CCJToolBar::OnRButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 907 of file CJToolBar.cpp.

References GetToolBarCtrl, IDC_CUSTOMIZE_BAR, and VERIFY.

00908 {
00909     if( m_pBarInfo )
00910     {
00911         CPoint pt( point );
00912         ClientToScreen( &pt );
00913
00914         // load and display popup menu
00915         CCJMenu popupMenu;
00916         VERIFY(popupMenu.CreatePopupMenu( ));
00917         popupMenu.InsertMenu(0, MF_BYPOSITION, IDC_CUSTOMIZE_BAR, _T("&Customize..."));
00918         int nResult = popupMenu.TrackPopupMenu(
00919             TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_VERTICAL|TPM_RETURNCMD,
00920             pt.x, pt.y, this );
00921
00922         if( nResult == IDC_CUSTOMIZE_BAR )
00923         {
00924             // open the customization dialog.
00925             GetToolBarCtrl().Customize();
00926         }
00927     }
00928
00929     else {
00930         CCJToolBarBase::OnRButtonDown(nFlags, point);
00931     }
00932 }

LRESULT CCJToolBar::OnSetBitmapSize | ( | WPARAM | ,
 |  | LPARAM |
 | ) | [protected]

Definition at line 1974 of file CJToolBar.cpp.

References m_sizeImage, and OnSetSizeHelper.

01975 {
01976     return OnSetSizeHelper(m_sizeImage, lParam);
01977 }

LRESULT CCJToolBar::OnSetButtonSize | ( | WPARAM | ,
 |  | LPARAM |
 | ) | [protected]

Definition at line 1969 of file CJToolBar.cpp.

References m_sizeButton, and OnSetSizeHelper.

01970 {
01971     return OnSetSizeHelper(m_sizeButton, lParam);
01972 }

LRESULT CCJToolBar::OnSetSizeHelper | ( | CSize & | size,
 |  | LPARAM | lParam
 | ) | [protected]

Definition at line 1979 of file CJToolBar.cpp.

References _ComCtlVersion, ASSERT, FALSE, and VERSION_IE4.

Referenced by OnSetBitmapSize, and OnSetButtonSize.

01980 {
01981     //WINBUG: The IE4 version of COMCTL32.DLL supports a zero border, but
01982     //  only if TBSTYLE_TRANSPARENT is on during the the TB_SETBITMAPSIZE
01983     //  and/or TB_SETBUTTONSIZE messages.  In order to enable this feature
01984     //  all the time (so we get consistent border behavior, dependent only
01985     //  on the version of COMCTL32.DLL) we turn on TBSTYLE_TRANSPARENT
01986     //  whenever these messages go through.  It would be nice that in a
01987     //  future version, the system toolbar would just allow you to set
01988     //  the top and left borders to anything you please.
01989
01990     BOOL bModify = FALSE;
01991     ASSERT(_ComCtlVersion != -1);
01992     DWORD dwStyle = 0;
01993     if (_ComCtlVersion >= VERSION_IE4)
01994     {
01995         dwStyle = GetStyle();
01996         bModify = ModifyStyle(0, TBSTYLE_TRANSPARENT|TBSTYLE_FLAT);
01997     }
01998
01999     LRESULT lResult = Default();
02000     if (lResult)
02001         size = lParam;
02002
02003     if (bModify)
02004         SetWindowLong(m_hWnd, GWL_STYLE, dwStyle);
02005
02006     return lResult;
02007 }

void CCJToolBar::OnSysColorChange ( ) [protected]

Definition at line 2030 of file CJToolBar.cpp.

References _LoadSysColorBitmap, AddReplaceBitmap, m_hbmImageWell, m_hInstImageWell, m_hRsrcImageWell, and NULL.

02031 {
02032     // re-color bitmap for toolbar
02033     if (m_hInstImageWell != NULL && m_hbmImageWell != NULL)
02034     {
02035         HBITMAP hbmNew;
02036         hbmNew = _LoadSysColorBitmap(m_hInstImageWell, m_hRsrcImageWell);
02037         if (hbmNew != NULL)
02038             AddReplaceBitmap(hbmNew);
02039     }
02040 }

void CCJToolBar::OnToolBarBeginAdjust | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 832 of file CJToolBar.cpp.

00833 {
00834     UNUSED_ALWAYS( pNMHDR );
00835     UNUSED_ALWAYS( pResult );
00836 }

void CCJToolBar::OnToolBarBeginDrag | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 817 of file CJToolBar.cpp.

00818 {
00819     UNUSED_ALWAYS( pNMHDR );
00820     UNUSED_ALWAYS( pResult );
00821 }

void CCJToolBar::OnToolBarBtnDropDown | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 629 of file CJToolBar.cpp.

References GetRect, and OnDropDownButton.

00630 {
00631     UNUSED_ALWAYS( pRes );
00632
00633     const NMTOOLBAR& nmtb = *(NMTOOLBAR*)pNMHDR;
00634
00635     // get location of button
00636     CRect rc;
00637     GetRect(nmtb.iItem, rc);
00638     ClientToScreen(&rc);
00639
00640     // call virtual function to display dropdown menu
00641     OnDropDownButton(nmtb, nmtb.iItem, rc);
00642 }

void CCJToolBar::OnToolBarChange | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 807 of file CJToolBar.cpp.

00808 {
00809     UNUSED_ALWAYS( pNMHDR );
00810     UNUSED_ALWAYS( pResult );
00811
00812     // force the frame window to recalculate the size
00813     GetParentFrame()->RecalcLayout();
00814 }

void CCJToolBar::OnToolBarCustomHelp | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 840 of file CJToolBar.cpp.

00841 {
00842     UNUSED_ALWAYS( pNMHDR );
00843     UNUSED_ALWAYS( pResult );
00844 }

void CCJToolBar::OnToolBarEndAdjust | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 848 of file CJToolBar.cpp.

References SaveState.

00849 {
00850     UNUSED_ALWAYS( pNMHDR );
00851     UNUSED_ALWAYS( pResult );
00852
00853     // save the state of the toolbar for reinitialization
00854     SaveState();
00855 }

void CCJToolBar::OnToolBarEndDrag | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 824 of file CJToolBar.cpp.

00825 {
00826     UNUSED_ALWAYS( pNMHDR );
00827     UNUSED_ALWAYS( pResult );
00828 }

void CCJToolBar::OnToolBarGetButtonInfo | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 859 of file CJToolBar.cpp.

References TOOLBARINFO::btnText, FALSE, m_nButtons, m_pBarInfo, TOOLBARINFO::tbButton, and TRUE.

00860 {
00861     UNUSED_ALWAYS( pResult );
00862
00863     TBNOTIFY* tbStruct;     // data needed by customize dialog box
00864
00865     // init the pointer
00866     tbStruct = (TBNOTIFY *)pNMHDR;
00867
00868     // if the index is valid
00869     if (0 <= tbStruct->iItem && tbStruct->iItem < m_nButtons)
00870     {
00871         // copy the stored button structure
00872         tbStruct->tbButton = m_pBarInfo[tbStruct->iItem].tbButton;
00873
00874         // copy the text for the button label in the dialog
00875         _tcscpy( tbStruct->pszText, m_pBarInfo[tbStruct->iItem].btnText );
00876
00877         // indicate valid data was sent
00878         *pResult = TRUE;
00879     }
00880
00881     // else there is no button for this index
00882     else
00883     {
00884         *pResult = FALSE;
00885     }
00886 }

void CCJToolBar::OnToolBarQueryDelete | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 783 of file CJToolBar.cpp.

00784 {
00785     UNUSED_ALWAYS( pNMHDR );
00786
00787     // if we're not floating - user can delete anything
00788     *pResult = !IsFloating();
00789 }

void CCJToolBar::OnToolBarQueryInsert | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 796 of file CJToolBar.cpp.

00797 {
00798     UNUSED_ALWAYS( pNMHDR );
00799
00800     // if we're not floating - user can insert anywhere
00801     *pResult = !IsFloating();
00802 }

void CCJToolBar::OnToolBarReset | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 890 of file CJToolBar.cpp.

References RestoreState.

00891 {
00892     UNUSED_ALWAYS( pNMHDR );
00893     UNUSED_ALWAYS( pResult );
00894
00895     // restore the toolbar to the way it was before entering customization
00896     RestoreState();
00897 }

int CCJToolBar::OnToolHitTest | ( | CPoint | point,
 |  | TOOLINFO * | pTI
 | ) | const [virtual]

Definition at line 1728 of file CJToolBar.cpp.

References ASSERT, GetItemID, and NULL.

01729 {
01730     ASSERT_VALID(this);
01731     ASSERT(::IsWindow(m_hWnd));
01732
01733     // check child windows first by calling CCJToolBarBase
01734     int nHit = CCJToolBarBase::OnToolHitTest(point, pTI);
01735     if (nHit != -1)
01736         return nHit;
01737
01738     // now hit test against CCJToolBar buttons
01739     CCJToolBar* pBar = (CCJToolBar*)this;
01740     int nButtons = (int)pBar->DefWindowProc(TB_BUTTONCOUNT, 0, 0);
01741     for (int i = 0; i < nButtons; i++)
01742     {
01743         CRect rect;
01744         TBBUTTON button;
01745         if (pBar->DefWindowProc(TB_GETITEMRECT, i, (LPARAM)&rect))
01746         {
01747             ++rect.bottom;
01748             ++rect.right;
01749             if (rect.PtInRect(point) &&
01750                 pBar->DefWindowProc(TB_GETBUTTON, i, (LPARAM)&button) &&
01751                 !(button.fsStyle & TBSTYLE_SEP))
01752             {
01753                 int nHit = GetItemID(i);
01754                 if (pTI != NULL && pTI->cbSize >= sizeof(AFX_OLDTOOLINFO))
01755                 {
01756                     pTI->hwnd = m_hWnd;
01757                     pTI->rect = rect;
01758                     pTI->uId = nHit;
01759                     pTI->lpszText = LPSTR_TEXTCALLBACK;
01760                 }
01761                 // found matching rect, return the ID of the button
01762                 return nHit != 0 ? nHit : -1;
01763             }
01764         }
01765     }
01766     return -1;
01767 }

void CCJToolBar::OnUpdateCmdUI | ( | CFrameWnd * | pTarget,
 |  | BOOL | bDisableIfNoHndler
 | ) | [virtual]

Definition at line 2098 of file CJToolBar.cpp.

References GetButton, and NULL.

02099 {
02100     CCJToolCmdUI state;
02101     state.m_pOther = this;
02102
02103     state.m_nIndexMax = (UINT)DefWindowProc(TB_BUTTONCOUNT, 0, 0);
02104     for (state.m_nIndex = 0; state.m_nIndex < state.m_nIndexMax; state.m_nIndex++)
02105     {
02106         // get buttons state
02107         TBBUTTON button;
02108         GetButton(state.m_nIndex, &button);
02109         state.m_nID = button.idCommand;
02110
02111         // ignore separators
02112         if (!(button.fsStyle & TBSTYLE_SEP))
02113         {
02114             // allow reflections
02115             if (CWnd::OnCmdMsg(0,
02116                 MAKELONG((int)CN_UPDATE_COMMAND_UI, WM_COMMAND+WM_REFLECT_BASE),
02117                 &state, NULL))
02118                 continue;
02119
02120             // allow the toolbar itself to have update handlers
02121             if (CWnd::OnCmdMsg(state.m_nID, CN_UPDATE_COMMAND_UI, &state, NULL))
02122                 continue;
02123
02124             // allow the owner to process the update
02125             state.DoUpdate(pTarget, bDisableIfNoHndler);
02126         }
02127     }
02128
02129     // update the dialog controls added to the toolbar
02130     UpdateDialogControls(pTarget, bDisableIfNoHndler);
02131 }

void CCJToolBar::OnWindowPosChanged ( WINDOWPOS * lpwndpos ) [protected]

Definition at line 670 of file CJToolBar.cpp.

References InvalidateOldPos, and m_rcOldPos.

00671 {
00672     CCJToolBarBase::OnWindowPosChanged(lpwndpos);
00673     if (!(lpwndpos->flags & SWP_NOMOVE)) {   // if moved:
00674         InvalidateOldPos(m_rcOldPos);        // invalidate area of old position
00675
00676         // Now paint my non-client area at the new location.
00677         // Without this, you will still have a partial display bug (try it!)
00678         SendMessage(WM_NCPAINT);
00679     }
00680 }

void CCJToolBar::OnWindowPosChanging ( LPWINDOWPOS ) [protected]

Reimplemented from CCJToolBarBase.

Definition at line 1952 of file CJToolBar.cpp.

References CCJToolBarBase::OnWindowPosChanging.

01953 {
01954     // not necessary to invalidate the borders
01955     DWORD dwStyle = m_dwStyle;
01956     m_dwStyle &= ~(CBRS_BORDER_ANY);
01957     CCJToolBarBase::OnWindowPosChanging(lpwndpos);
01958     m_dwStyle = dwStyle;
01959 }

BOOL CCJToolBar::PreCreateWindow ( CREATESTRUCT & cs ) [virtual]

Definition at line 420 of file CJToolBar.cpp.

References FALSE, and TRUE.

00421 {
00422     if( !CCJToolBarBase::PreCreateWindow(cs))
00423         return FALSE;
00424
00425     cs.style |= TBSTYLE_TRANSPARENT|TBSTYLE_FLAT;
00426
00427     return TRUE;
00428 }

_CJXLIB_INLINE BOOL CCJToolBar::PressButton | ( | int | nID,
 |  | BOOL | bPress
 | ) |

Definition at line 373 of file CJToolBar.h.

References ASSERT.

Referenced by CCJMenuBar::TrackPopup.

00374     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_PRESSBUTTON, nID, MAKELPARAM(bPress, 0)); }

void CCJToolBar::RestoreState ( )

Definition at line 768 of file CJToolBar.cpp.

References GetToolBarCtrl, m_hKeyRoot, m_strSubKey, and m_strValueName.

Referenced by LoadToolBar, and OnToolBarReset.

00769 {
00770     // if there is an associated registry subkey
00771     if (m_strSubKey.GetLength())
00772     {
00773         // restore the toolbar state from the registry
00774         GetToolBarCtrl().RestoreState( m_hKeyRoot, m_strSubKey, m_strValueName );
00775     }
00776 }

void CCJToolBar::SaveState ( )

Definition at line 756 of file CJToolBar.cpp.

References GetToolBarCtrl, m_hKeyRoot, m_strSubKey, and m_strValueName.

Referenced by OnDestroy, and OnToolBarEndAdjust.

00757 {
00758     // if there is an associated registry subkey
00759     if (m_strSubKey.GetLength())
00760     {
00761         // save the toolbar state to the registry
00762         GetToolBarCtrl().SaveState( m_hKeyRoot, m_strSubKey, m_strValueName );
00763     }
00764 }

_CJXLIB_INLINE LRESULT CCJToolBar::SendMessageC | ( | UINT | m,
 |  | WPARAM | wp = 0,
 |  | LPARAM | lp = 0
 | ) | const

Definition at line 364 of file CJToolBar.h.

References ASSERT.

Referenced by GetBitmap, GetBitmapFlags, GetButtonCount, GetHotItem, GetImageList, GetPadding, GetRect, GetRows, GetState, GetToolbarStyle, GetToolTips, HitTest, IsButtonChecked, IsButtonEnabled, IsButtonHidden, IsButtonIndeterminate, IsButtonPressed, and MapAccelerator.

00365     { ASSERT(::IsWindow(m_hWnd)); return ((CCJToolBar*)this)->SendMessage(m, wp, lp); }

BOOL CCJToolBar::SetBitmap ( HBITMAP hbmImageWell )

Definition at line 1128 of file CJToolBar.cpp.

References AddReplaceBitmap, ASSERT, m_hInstImageWell, m_hRsrcImageWell, and NULL.

Referenced by UToolbar::RebuildBar.

01129 {
01130     ASSERT_VALID(this);
01131     ASSERT(hbmImageWell != NULL);
01132
01133     // the caller must manage changing system colors
01134     m_hInstImageWell = NULL;
01135     m_hRsrcImageWell = NULL;
01136
01137     // tell common control toolbar about the new bitmap
01138     return AddReplaceBitmap(hbmImageWell);
01139 }

_CJXLIB_INLINE BOOL CCJToolBar::SetBitmapSize ( CSize sz )

Definition at line 427 of file CJToolBar.h.

References ASSERT.

00428     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_SETBITMAPSIZE, 0, MAKELPARAM(sz.cx, sz.cy)); }

void CCJToolBar::SetButton | ( | int | nIndex,
 |  | TBBUTTON * | pButton
 | ) |

Definition at line 1252 of file CJToolBar.cpp.

References VERIFY.

Referenced by CalcLayout, SetButtonInfo, SetButtonStyle, and SetButtonText.

01253 {
01254     // get original button state
01255     TBBUTTON button;
01256     VERIFY(DefWindowProc(TB_GETBUTTON, nIndex, (LPARAM)&button));
01257
01258     // prepare for old/new button comparsion
01259     button.bReserved[0] = 0;
01260     button.bReserved[1] = 0;
01261     // TBSTATE_ENABLED == TBBS_DISABLED so invert it
01262     pButton->fsState ^= TBSTATE_ENABLED;
01263     pButton->bReserved[0] = 0;
01264     pButton->bReserved[1] = 0;
01265
01266     // nothing to do if they are the same
01267     if (memcmp(pButton, &button, sizeof(TBBUTTON)) != 0)
01268     {
01269         // don't redraw everything while setting the button
01270         DWORD dwStyle = GetStyle();
01271         ModifyStyle(WS_VISIBLE, 0);
01272         VERIFY(DefWindowProc(TB_DELETEBUTTON, nIndex, 0));
01273         VERIFY(DefWindowProc(TB_INSERTBUTTON, nIndex, (LPARAM)pButton));
01274         ModifyStyle(0, dwStyle & WS_VISIBLE);
01275
01276         // invalidate appropriate parts
01277         if (((pButton->fsStyle ^ button.fsStyle) & TBSTYLE_SEP) ||
01278             ((pButton->fsStyle & TBSTYLE_SEP) && pButton->iBitmap != button.iBitmap))
01279         {
01280             // changing a separator
01281             Invalidate();
01282         }
01283         else
01284         {
01285             // invalidate just the button
01286             CRect rect;
01287             if (DefWindowProc(TB_GETITEMRECT, nIndex, (LPARAM)&rect))
01288                 InvalidateRect(rect);
01289         }
01290     }
01291 }

void CCJToolBar::SetButtonInfo | ( | int | nIndex,
 |  | UINT | nID,
 |  | UINT | nStyle,
 |  | int | iImage
 | ) |

Definition at line 1709 of file CJToolBar.cpp.

References GetButton, m_bDelayedButtonLayout, SetButton, and TRUE.

Referenced by InsertControl, and UToolbar::RebuildBar.

01710 {
01711     ASSERT_VALID(this);
01712
01713     TBBUTTON button;
01714     GetButton(nIndex, &button);
01715     TBBUTTON save;
01716     memcpy(&save, &button, sizeof(save));
01717     button.idCommand = nID;
01718     button.iBitmap = iImage;
01719     button.fsStyle = (BYTE)LOWORD(nStyle);
01720     button.fsState = (BYTE)HIWORD(nStyle);
01721     if (memcmp(&save, &button, sizeof(save)) != 0)
01722     {
01723         SetButton(nIndex, &button);
01724         m_bDelayedButtonLayout = TRUE;
01725     }
01726 }

BOOL CCJToolBar::SetButtons | ( | const UINT * | lpIDArray,
 |  | int | nIDCount
 | ) |

Definition at line 1178 of file CJToolBar.cpp.

References _ComCtlVersion, ASSERT, FALSE, m_bDelayedButtonLayout, NULL, TRUE, VERIFY, and VERSION_IE4.

Referenced by LoadToolBar, and UToolbar::RebuildBar.

01179 {
01180     ASSERT_VALID(this);
01181     ASSERT(nIDCount >= 1);  // must be at least one of them
01182     ASSERT(lpIDArray == NULL ||
01183         AfxIsValidAddress(lpIDArray, sizeof(UINT) * nIDCount, FALSE));
01184
01185     // delete all existing buttons
01186     int nCount = (int)DefWindowProc(TB_BUTTONCOUNT, 0, 0);
01187     while (nCount--)
01188         VERIFY(DefWindowProc(TB_DELETEBUTTON, 0, 0));
01189
01190     TBBUTTON button; memset(&button, 0, sizeof(TBBUTTON));
01191     button.iString = -1;
01192     if (lpIDArray != NULL)
01193     {
01194         // add new buttons to the common control
01195         int iImage = 0;
01196         for (int i = 0; i < nIDCount; i++)
01197         {
01198             button.fsState = TBSTATE_ENABLED;
01199             if ((button.idCommand = *lpIDArray++) == 0)
01200             {
01201                 // separator
01202                 button.fsStyle = TBSTYLE_SEP;
01203                 // width of separator includes 8 pixel overlap
01204                 ASSERT(_ComCtlVersion != -1);
01205                 if ((GetStyle() & TBSTYLE_FLAT) || _ComCtlVersion == VERSION_IE4)
01206                     button.iBitmap = 6;
01207                 else
01208                     button.iBitmap = 8;
01209             }
01210             else
01211             {
01212                 // a command button with image
01213                 button.fsStyle = TBSTYLE_BUTTON;
01214                 button.iBitmap = iImage++;
01215             }
01216             if (!DefWindowProc(TB_ADDBUTTONS, 1, (LPARAM)&button))
01217                 return FALSE;
01218         }
01219     }
01220     else
01221     {
01222         // add 'blank' buttons
01223         button.fsState = TBSTATE_ENABLED;
01224         for (int i = 0; i < nIDCount; i++)
01225         {
01226             ASSERT(button.fsStyle == TBSTYLE_BUTTON);
01227             if (!DefWindowProc(TB_ADDBUTTONS, 1, (LPARAM)&button))
01228                 return FALSE;
01229         }
01230     }
01231     m_nCount = (int)DefWindowProc(TB_BUTTONCOUNT, 0, 0);
01232     m_bDelayedButtonLayout = TRUE;
01233
01234     return TRUE;
01235 }

_CJXLIB_INLINE BOOL CCJToolBar::SetButtonSize ( CSize sz )

Definition at line 424 of file CJToolBar.h.

References ASSERT.

00425     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_SETBUTTONSIZE, 0, MAKELPARAM(sz.cx, sz.cy)); }

_CJXLIB_INLINE void CCJToolBar::SetButtonStructSize ( int nSize )

Definition at line 421 of file CJToolBar.h.

References ASSERT.

00422     { ASSERT(::IsWindow(m_hWnd)); SendMessage(TB_BUTTONSTRUCTSIZE, nSize); }

void CCJToolBar::SetButtonStyle | ( | int | nIndex,
 |  | UINT | nStyle
 | ) |

Definition at line 1352 of file CJToolBar.cpp.

References ASSERT, GetButton, m_bDelayedButtonLayout, SetButton, and TRUE.

Referenced by AddDropDownButton, and CCJToolCmdUI::Enable.

01353 {
01354     ASSERT_VALID(this);
01355     ASSERT(::IsWindow(m_hWnd));
01356
01357     TBBUTTON button;
01358     GetButton(nIndex, &button);
01359     if (button.fsStyle != (BYTE)LOWORD(nStyle) || button.fsState != (BYTE)HIWORD(nStyle))
01360     {
01361         button.fsStyle = (BYTE)LOWORD(nStyle);
01362         button.fsState = (BYTE)HIWORD(nStyle);
01363         SetButton(nIndex, &button);
01364         m_bDelayedButtonLayout = TRUE;
01365     }
01366 }

BOOL CCJToolBar::SetButtonText | ( | int | nIndex,
 |  | LPCTSTR | lpszText
 | ) |

Definition at line 1769 of file CJToolBar.cpp.

References ASSERT, FALSE, GetButton, m_pStringMap, NULL, SetButton, and TRUE.

01770 {
01771     // attempt to lookup string index in map
01772     int nString = -1;
01773     void* p;
01774     if (m_pStringMap != NULL && m_pStringMap->Lookup(lpszText, p))
01775         nString = (int)p;
01776
01777     // add new string if not already in map
01778     if (nString == -1)
01779     {
01780         // initialize map if necessary
01781         if (m_pStringMap == NULL)
01782             m_pStringMap = new CMapStringToPtr;
01783
01784         // add new string to toolbar list
01785         CString strTemp(lpszText, lstrlen(lpszText)+1);
01786         nString = (int)DefWindowProc(TB_ADDSTRING, 0, (LPARAM)(LPCTSTR)strTemp);
01787         if (nString == -1)
01788             return FALSE;
01789
01790         // cache string away in string map
01791         m_pStringMap->SetAt(lpszText, (void*)nString);
01792         ASSERT(m_pStringMap->Lookup(lpszText, p));
01793     }
01794
01795     // change the toolbar button description
01796     TBBUTTON button;
01797     GetButton(nIndex, &button);
01798     button.iString = nString;
01799     SetButton(nIndex, &button);
01800
01801     return TRUE;
01802 }

_CJXLIB_INLINE BOOL CCJToolBar::SetCmdID | ( | int | nIndex,
 |  | UINT | nID
 | ) |

Definition at line 445 of file CJToolBar.h.

References ASSERT.

00446     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_SETCMDID, nIndex, nID); }

_CJXLIB_INLINE DWORD CCJToolBar::SetExtendedStyle ( DWORD dwStyle )

Definition at line 464 of file CJToolBar.h.

References ASSERT.

Referenced by AddDropDownButton.

00465     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_SETEXTENDEDSTYLE, 0, dwStyle); }

void CCJToolBar::SetHeight ( int cyHeight )

Definition at line 1011 of file CJToolBar.cpp.

References m_sizeButton, and NULL.

01012 {
01013     ASSERT_VALID(this);
01014
01015     int nHeight = cyHeight;
01016     if (m_dwStyle & CBRS_BORDER_TOP)
01017         cyHeight -= afxData.cyBorder2;
01018     if (m_dwStyle & CBRS_BORDER_BOTTOM)
01019         cyHeight -= afxData.cyBorder2;
01020     m_cyBottomBorder = (cyHeight - m_sizeButton.cy) / 2;
01021     // if there is an extra pixel, m_cyTopBorder will get it
01022     m_cyTopBorder = cyHeight - m_sizeButton.cy - m_cyBottomBorder;
01023     if (m_cyTopBorder < 0)
01024     {
01025         TRACE1("Warning: CCJToolBar::SetHeight(%d) is smaller than button.\n",
01026             nHeight);
01027         m_cyBottomBorder += m_cyTopBorder;
01028         m_cyTopBorder = 0;  // will clip at bottom
01029     }
01030
01031     // recalculate the non-client region
01032     SetWindowPos(NULL, 0, 0, 0, 0,
01033         SWP_DRAWFRAME|SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|SWP_NOZORDER);
01034     Invalidate();   // just to be nice if called when toolbar is visible
01035 }

_CJXLIB_INLINE void CCJToolBar::SetHotItem ( int iHot )

Definition at line 482 of file CJToolBar.h.

References ASSERT.

Referenced by CCJMenuBar::OnMouseMove, CCJMenuBar::SetTrackingState, and CCJMenuBar::TranslateFrameMessage.

00483     { ASSERT(::IsWindow(m_hWnd)); SendMessage(TB_SETHOTITEM, iHot); }

_CJXLIB_INLINE HIMAGELIST CCJToolBar::SetImageList ( HIMAGELIST hImgList )

Definition at line 458 of file CJToolBar.h.

References ASSERT.

Referenced by CCJMenuBar::LoadMenu.

00459     { ASSERT(::IsWindow(m_hWnd)); return (HIMAGELIST)SendMessage(TB_SETIMAGELIST, 0, (LPARAM)hImgList); }

_CJXLIB_INLINE BOOL CCJToolBar::SetIndent ( int indent )

Definition at line 452 of file CJToolBar.h.

References ASSERT.

00453     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_SETINDENT, indent); }

void CCJToolBar::SetOwner ( CWnd * pOwnerWnd )

Definition at line 970 of file CJToolBar.cpp.

References ASSERT, and NULL.

Referenced by OnNcCreate.

00971 {
00972     ASSERT_VALID(this);
00973     if (m_hWnd != NULL)
00974     {
00975         ASSERT(::IsWindow(m_hWnd));
00976         DefWindowProc(TB_SETPARENT, (WPARAM)pOwnerWnd->GetSafeHwnd(), 0);
00977     }
00978     CCJToolBarBase::SetOwner(pOwnerWnd);
00979 }

_CJXLIB_INLINE CSize CCJToolBar::SetPadding ( CSize sz )

Definition at line 491 of file CJToolBar.h.

References ASSERT.

00492     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_SETPADDING, 0, MAKELPARAM(sz.cx,sz.cy)); }

_CJXLIB_INLINE void CCJToolBar::SetRows | ( | int | nRows,
 |  | BOOL | bLarger,
 |  | LPRECT | lpRect
 | ) |

Definition at line 439 of file CJToolBar.h.

References ASSERT.

00440     { ASSERT(::IsWindow(m_hWnd)); SendMessage(TB_SETROWS, MAKELPARAM(nRows, bLarger), (LPARAM)lpRect); }

void CCJToolBar::SetSizes | ( | SIZE | sizeButton,
 |  | SIZE | sizeImage
 | ) |

Definition at line 981 of file CJToolBar.cpp.

References ASSERT, m_sizeButton, m_sizeImage, and VERIFY.

Referenced by CreateEx, LoadToolBar, and UToolbar::OnTbInit.

00982 {
00983     ASSERT_VALID(this);
00984
00985     // sizes must be non-zero and positive
00986     ASSERT(sizeButton.cx > 0 && sizeButton.cy > 0);
00987     ASSERT(sizeImage.cx > 0 && sizeImage.cy > 0);
00988
00989     // button must be big enough to hold image
00990     //   + 7 pixels on x
00991     //   + 6 pixels on y
00992     ASSERT(sizeButton.cx >= sizeImage.cx + 7);
00993     ASSERT(sizeButton.cy >= sizeImage.cy + 6);
00994
00995     if (::IsWindow(m_hWnd))
00996     {
00997         // set the sizes via TB_SETBITMAPSIZE and TB_SETBUTTONSIZE
00998         VERIFY(SendMessage(TB_SETBITMAPSIZE, 0, MAKELONG(sizeImage.cx, sizeImage.cy)));
00999         VERIFY(SendMessage(TB_SETBUTTONSIZE, 0, MAKELONG(sizeButton.cx, sizeButton.cy)));
01000
01001         Invalidate();   // just to be nice if called when toolbar is visible
01002     }
01003     else
01004     {
01005         // just set our internal values for later
01006         m_sizeButton = sizeButton;
01007         m_sizeImage = sizeImage;
01008     }
01009 }

_CJXLIB_INLINE BOOL CCJToolBar::SetState | ( | int | nID,
 |  | UINT | nState
 | ) |

Definition at line 397 of file CJToolBar.h.

References ASSERT.

00398     { ASSERT(::IsWindow(m_hWnd)); return SendMessage(TB_SETSTATE, nID, MAKELPARAM(nState, 0)); }

_CJXLIB_INLINE void CCJToolBar::SetToolbarStyle ( DWORD dwStyle )

Definition at line 473 of file CJToolBar.h.

References ASSERT.

00474     { ASSERT(::IsWindow(m_hWnd)); SendMessage(TB_SETSTYLE, 0, dwStyle); }

_CJXLIB_INLINE void CCJToolBar::SetToolTips ( CToolTipCtrl * pTip )

Definition at line 436 of file CJToolBar.h.

References ASSERT.

00437     { ASSERT(::IsWindow(m_hWnd)); SendMessage(TB_SETTOOLTIPS, (WPARAM)pTip->m_hWnd); }

void CCJToolBar::SizeToolBar | ( | TBBUTTON * | pData,
 |  | int | nCount,
 |  | int | nLength,
 |  | BOOL | bVert = FALSE
 | ) | [protected]

Definition at line 1479 of file CJToolBar.cpp.

References ASSERT, CalcSize, NULL, and WrapToolBar.

Referenced by CalcLayout.

01480 {
01481     ASSERT(pData != NULL && nCount > 0);
01482
01483     if (!bVert)
01484     {
01485         int nMin, nMax, nTarget, nCurrent, nMid;
01486
01487         // Wrap ToolBar as specified
01488         nMax = nLength;
01489         nTarget = WrapToolBar(pData, nCount, nMax);
01490
01491         // Wrap ToolBar vertically
01492         nMin = 0;
01493         nCurrent = WrapToolBar(pData, nCount, nMin);
01494
01495         if (nCurrent != nTarget)
01496         {
01497             while (nMin < nMax)
01498             {
01499                 nMid = (nMin + nMax) / 2;
01500                 nCurrent = WrapToolBar(pData, nCount, nMid);
01501
01502                 if (nCurrent == nTarget)
01503                     nMax = nMid;
01504                 else
01505                 {
01506                     if (nMin == nMid)
01507                     {
01508                         WrapToolBar(pData, nCount, nMax);
01509                         break;
01510                     }
01511                     nMin = nMid;
01512                 }
01513             }
01514         }
01515         CSize size = CalcSize(pData, nCount);
01516         WrapToolBar(pData, nCount, size.cx);
01517     }
01518     else
01519     {
01520         CSize sizeMax, sizeMin, sizeMid;
01521
01522         // Wrap ToolBar vertically
01523         WrapToolBar(pData, nCount, 0);
01524         sizeMin = CalcSize(pData, nCount);
01525
01526         // Wrap ToolBar horizontally
01527         WrapToolBar(pData, nCount, 32767);
01528         sizeMax = CalcSize(pData, nCount);
01529
01530         while (sizeMin.cx < sizeMax.cx)
01531         {
01532             sizeMid.cx = (sizeMin.cx + sizeMax.cx) / 2;
01533             WrapToolBar(pData, nCount, sizeMid.cx);
01534             sizeMid = CalcSize(pData, nCount);
01535
01536             if (nLength < sizeMid.cy)
01537             {
01538                 if (sizeMin == sizeMid)
01539                 {
01540                     WrapToolBar(pData, nCount, sizeMax.cx);
01541                     return;
01542                 }
01543                 sizeMin = sizeMid;
01544             }
01545             else if (nLength > sizeMid.cy)
01546                 sizeMax = sizeMid;
01547             else
01548                 return;
01549         }
01550     }
01551 }

int CCJToolBar::WrapToolBar | ( | TBBUTTON * | pData,
 |  | int | nCount,
 |  | int | nWidth
 | ) | [protected]

Definition at line 1410 of file CJToolBar.cpp.

References ASSERT, CX_OVERLAP, FALSE, GetButtonSize, m_sizeButton, NULL, and TRUE.

Referenced by SizeToolBar.

01411 {
01412     ASSERT(pData != NULL && nCount > 0);
01413
01414     int nResult = 0;
01415     int x = 0;
01416     for (int i = 0; i < nCount; i++)
01417     {
01418         pData[i].fsState &= ~TBSTATE_WRAP;
01419
01420         if (pData[i].fsState & TBSTATE_HIDDEN)
01421             continue;
01422
01423         int dx, dxNext;
01424
01425         // **PD**
01426         // Load actual size of button into a local variable
01427         // called m_sizeButton. C++ will use this instead of
01428         // CToolBar::m_sizeButton.
01429         //
01430         CSize m_sizeButton = GetButtonSize(pData, i);
01431
01432         dx = m_sizeButton.cx;
01433         dxNext = dx - CX_OVERLAP;
01434
01435         if (x + dx > nWidth)
01436         {
01437             BOOL bFound = FALSE;
01438             for (int j = i; j >= 0  &&  !(pData[j].fsState & TBSTATE_WRAP); j--)
01439             {
01440                 // Find last separator that isn't hidden
01441                 // a separator that has a command ID is not
01442                 // a separator, but a custom control.
01443                 if ((pData[j].fsStyle & TBSTYLE_SEP) &&
01444                     (pData[j].idCommand == 0) &&
01445                     !(pData[j].fsState & TBSTATE_HIDDEN))
01446                 {
01447                     bFound = TRUE; i = j; x = 0;
01448                     pData[j].fsState |= TBSTATE_WRAP;
01449                     nResult++;
01450                     break;
01451                 }
01452             }
01453             if (!bFound)
01454             {
01455                 for (int j = i - 1; j >= 0 && !(pData[j].fsState & TBSTATE_WRAP); j--)
01456                 {
01457                     // Never wrap anything that is hidden,
01458                     // or any custom controls
01459                     if ((pData[j].fsState & TBSTATE_HIDDEN) ||
01460                         ((pData[j].fsStyle & TBSTYLE_SEP) &&
01461                         (pData[j].idCommand != 0)))
01462                         continue;
01463
01464                     bFound = TRUE; i = j; x = 0;
01465                     pData[j].fsState |= TBSTATE_WRAP;
01466                     nResult++;
01467                     break;
01468                 }
01469                 if (!bFound)
01470                     x += dxNext;
01471             }
01472         }
01473         else
01474             x += dxNext;
01475     }
01476     return nResult + 1;
01477 }

Member Data Documentation

BOOL CCJToolBar::m_bDelayedButtonLayout [protected]

Definition at line 125 of file CJToolBar.h.

Referenced by CalcLayout, CCJToolBar, Layout, OnBarStyleChange, SetButtonInfo, SetButtons, and SetButtonStyle.

bool CCJToolBar::m_bShowDropArrow [protected]

Definition at line 121 of file CJToolBar.h.

Referenced by CCJToolBar, and GetButtonSize.

HBITMAP CCJToolBar::m_hbmImageWell [protected]

Definition at line 124 of file CJToolBar.h.

Referenced by AddReplaceBitmap, CCJToolBar, OnSysColorChange, and ~CCJToolBar.

HINSTANCE CCJToolBar::m_hInstImageWell [protected]

Definition at line 123 of file CJToolBar.h.

Referenced by CCJToolBar, LoadBitmap, OnSysColorChange, and SetBitmap.

HKEY CCJToolBar::m_hKeyRoot [protected]

Definition at line 128 of file CJToolBar.h.

Referenced by CCJToolBar, RestoreState, and SaveState.

HRSRC CCJToolBar::m_hRsrcImageWell [protected]

Definition at line 122 of file CJToolBar.h.

Referenced by CCJToolBar, LoadBitmap, OnSysColorChange, and SetBitmap.

int CCJToolBar::m_nBarNumber = 0 [static, protected]

Definition at line 298 of file CJToolBar.cpp.

Referenced by CCJToolBar.

int CCJToolBar::m_nButtons [protected]

Definition at line 127 of file CJToolBar.h.

Referenced by CCJToolBar, LoadToolBar, and OnToolBarGetButtonInfo.

TOOLBARINFO* CCJToolBar::m_pBarInfo [protected]

Definition at line 119 of file CJToolBar.h.

Referenced by CCJToolBar, LoadToolBar, and OnToolBarGetButtonInfo.

CObList* CCJToolBar::m_pControls [protected]

Definition at line 120 of file CJToolBar.h.

Referenced by CCJToolBar, InsertControl, and ~CCJToolBar.

DROPDOWNBUTTON* CCJToolBar::m_pDropButtons [protected]

Definition at line 134 of file CJToolBar.h.

Referenced by AddDropDownButton, CCJToolBar, FindDropDownButton, and ~CCJToolBar.

CMapStringToPtr* CCJToolBar::m_pStringMap [protected]

Definition at line 135 of file CJToolBar.h.

Referenced by CCJToolBar, GetButtonText, SetButtonText, and ~CCJToolBar.

CRect CCJToolBar::m_rcOldPos [protected]

Definition at line 126 of file CJToolBar.h.

Referenced by OnWindowPosChanged.

CSize CCJToolBar::m_sizeButton [protected]

Definition at line 133 of file CJToolBar.h.

Referenced by CalcSize, CCJToolBar, CreateEx, OnSetButtonSize, SetHeight, SetSizes, and WrapToolBar.

CSize CCJToolBar::m_sizeImage [protected]

Definition at line 132 of file CJToolBar.h.

Referenced by AddReplaceBitmap, CCJToolBar, CreateEx, OnSetBitmapSize, and SetSizes.

CString CCJToolBar::m_strSubKey [protected]

Definition at line 129 of file CJToolBar.h.

Referenced by CCJToolBar, RestoreState, and SaveState.

CString CCJToolBar::m_strValueName [protected]

Definition at line 130 of file CJToolBar.h.

Referenced by CCJToolBar, RestoreState, and SaveState.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJToolBar.h
  • WinCvs/CJLib/CJLibrary/CJToolBar.cpp
Generated on Sun Feb 24 01:25:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJToolBarBase Class Reference

#include <CJToolBarBase.h>

Inheritance diagram for CCJToolBarBase:

[legend]
Collaboration diagram for CCJToolBarBase:

[legend]
List of all members.

Public Methods

virtual | ~CCJToolBarBase ()
virtual void | DoPaint (CDC *pDC)
void | DrawGripper (CDC *pDC, const CRect &rect)
virtual LRESULT | WindowProc (UINT nMsg, WPARAM wParam, LPARAM lParam)
void | CalcInsideRect (CRect &rect, BOOL bHorz) const
void | EraseNonClient ()
void | DrawBorders (CDC *pDC, CRect &rect)
afx_msg void | OnPaint ()
afx_msg void | OnWindowPosChanging (LPWINDOWPOS lpWndPos)

Public Attributes

bool | m_bInReBar
bool | m_bExStyle

Protected Methods

CCJToolBarBase ()
void | SetBorders (LPCRECT lpRect)
void | SetBorders (int cxLeft=0, int cyTop=0, int cxRight=0, int cyBottom=0)
CRect | GetBorders () const

Constructor & Destructor Documentation

CCJToolBarBase::CCJToolBarBase ( ) [protected]

Definition at line 56 of file CJToolBarBase.cpp.

References m_bExStyle, and m_bInReBar.

00057 {
00058     m_bInReBar = false;
00059     m_bExStyle = false;
00060 }

CCJToolBarBase::~CCJToolBarBase ( ) [virtual]

Definition at line 62 of file CJToolBarBase.cpp.

00063 {
00064
00065 }

Member Function Documentation

void CCJToolBarBase::CalcInsideRect | ( | CRect & | rect,
 |  | BOOL | bHorz
 | ) | const

Definition at line 413 of file CJToolBarBase.cpp.

References CX_BORDER_GRIPPER, CX_GRIPPER, CY_BORDER_GRIPPER, CY_GRIPPER, m_bExStyle, and m_bInReBar.

Referenced by CCJReBar::CalcFixedLayout, CCJToolBar::CalcLayout, CCJToolBar::OnNcCalcSize, and CCJReBar::OnNcCalcSize.

00414 {
00415     ASSERT_VALID(this);
00416     DWORD dwStyle = m_dwStyle;
00417
00418     if (dwStyle & CBRS_BORDER_LEFT)
00419         rect.left += afxData.cxBorder2;
00420     if (dwStyle & CBRS_BORDER_TOP)
00421         rect.top += afxData.cyBorder2;
00422     if (dwStyle & CBRS_BORDER_RIGHT)
00423         rect.right -= afxData.cxBorder2;
00424     if (dwStyle & CBRS_BORDER_BOTTOM)
00425         rect.bottom -= afxData.cyBorder2;
00426
00427     // inset the top and bottom.
00428     if (bHorz)
00429     {
00430         rect.left += m_cxLeftBorder;
00431         rect.top += m_cyTopBorder;
00432         rect.right -= m_cxRightBorder;
00433         rect.bottom -= m_cyBottomBorder;
00434         if ((m_dwStyle & (CBRS_GRIPPER|CBRS_FLOATING)) == CBRS_GRIPPER)
00435         {
00436             rect.left += CX_BORDER_GRIPPER+CX_GRIPPER+CX_BORDER_GRIPPER;
00437
00438             if( m_bExStyle == true ) {
00439                 rect.left += CX_GRIPPER;
00440             }
00441
00442             if(( m_bExStyle == false ) && ( m_bInReBar == false )) {
00443                 rect.left -= CX_BORDER_GRIPPER+CX_GRIPPER;
00444             }
00445         }
00446     }
00447     else
00448     {
00449         rect.left += m_cyTopBorder;
00450         rect.top += m_cxLeftBorder;
00451         rect.right -= m_cyBottomBorder;
00452         rect.bottom -= m_cxRightBorder;
00453         if ((m_dwStyle & (CBRS_GRIPPER|CBRS_FLOATING)) == CBRS_GRIPPER)
00454         {
00455             rect.top += CY_BORDER_GRIPPER+CY_GRIPPER+CY_BORDER_GRIPPER;
00456
00457             if( m_bExStyle == true ) {
00458                 rect.top += CY_GRIPPER;
00459             }
00460
00461             if(( m_bExStyle == false ) && ( m_bInReBar == false )) {
00462                 rect.top -= CY_BORDER_GRIPPER+CY_GRIPPER;
00463             }
00464         }
00465     }
00466 }

void CCJToolBarBase::DoPaint ( CDC * pDC ) [virtual]

Definition at line 206 of file CJToolBarBase.cpp.

References DrawBorders, and DrawGripper.

Referenced by OnPaint.

00207 {
00208     ASSERT_VALID(this);
00209     ASSERT_VALID(pDC);
00210
00211     // paint inside client area
00212     CRect rect;
00213     GetClientRect(rect);
00214     DrawBorders(pDC, rect);
00215     DrawGripper(pDC, rect);
00216 }

void CCJToolBarBase::DrawBorders | ( | CDC * | pDC,
 |  | CRect & | rect
 | ) |

Definition at line 218 of file CJToolBarBase.cpp.

References ASSERT, CX_BORDER, and CY_BORDER.

Referenced by DoPaint, and EraseNonClient.

00219 {
00220     ASSERT_VALID(this);
00221     ASSERT_VALID(pDC);
00222
00223     DWORD dwStyle = m_dwStyle;
00224     if (!(dwStyle & CBRS_BORDER_ANY))
00225         return;
00226
00227     // prepare for dark lines
00228     ASSERT(rect.top == 0 && rect.left == 0);
00229     if(m_bInReBar)
00230     {
00231         CRect rect1, rect2;
00232         rect1 = rect;
00233         rect2 = rect;
00234         COLORREF clr = afxData.bWin4 ? afxData.clrBtnShadow : afxData.clrWindowFrame;
00235
00236         // draw dark line one pixel back/up
00237         if (dwStyle & CBRS_BORDER_3D)
00238         {
00239             rect1.right -= CX_BORDER;
00240             rect1.bottom -= CY_BORDER;
00241         }
00242         if (dwStyle & CBRS_BORDER_TOP)
00243             rect2.top += afxData.cyBorder2;
00244         if (dwStyle & CBRS_BORDER_BOTTOM)
00245             rect2.bottom -= afxData.cyBorder2;
00246
00247         // draw left and top
00248         if (dwStyle & CBRS_BORDER_LEFT)
00249             pDC->FillSolidRect(0, rect2.top, CX_BORDER, rect2.Height(), clr);
00250         if (dwStyle & CBRS_BORDER_TOP)
00251             pDC->FillSolidRect(0, 0, rect.right, CY_BORDER, clr);
00252
00253         // draw right and bottom
00254         if (dwStyle & CBRS_BORDER_RIGHT)
00255             pDC->FillSolidRect(rect1.right, rect2.top, -CX_BORDER, rect2.Height(), clr);
00256         if (dwStyle & CBRS_BORDER_BOTTOM)
00257             pDC->FillSolidRect(0, rect1.bottom, rect.right, -CY_BORDER, clr);
00258
00259         if (dwStyle & CBRS_BORDER_3D)
00260         {
00261             // prepare for hilite lines
00262             clr = afxData.clrBtnHilite;
00263
00264             // draw left and top
00265             if (dwStyle & CBRS_BORDER_LEFT)
00266                 pDC->FillSolidRect(1, rect2.top, CX_BORDER, rect2.Height(), clr);
00267             if (dwStyle & CBRS_BORDER_TOP)
00268                 pDC->FillSolidRect(0, 1, rect.right, CY_BORDER, clr);
00269
00270             // draw right and bottom
00271             if (dwStyle & CBRS_BORDER_RIGHT)
00272                 pDC->FillSolidRect(rect.right, rect2.top, -CX_BORDER, rect2.Height(), clr);
00273             if (dwStyle & CBRS_BORDER_BOTTOM)
00274                 pDC->FillSolidRect(0, rect.bottom, rect.right, -CY_BORDER, clr);
00275         }
00276
00277         if (dwStyle & CBRS_BORDER_LEFT)
00278             rect.left += afxData.cxBorder2;
00279         if (dwStyle & CBRS_BORDER_TOP)
00280             rect.top += afxData.cyBorder2;
00281         if (dwStyle & CBRS_BORDER_RIGHT)
00282             rect.right -= afxData.cxBorder2;
00283         if (dwStyle & CBRS_BORDER_BOTTOM)
00284             rect.bottom -= afxData.cyBorder2;
00285     }
00286     else
00287     {
00288         if(dwStyle & CBRS_BORDER_RIGHT) {
00289             pDC->FillSolidRect(rect.right-1, 0, rect.right, rect.bottom, afxData.clrBtnShadow);
00290             rect.right--;
00291         }
00292         if(dwStyle & CBRS_BORDER_BOTTOM) {
00293             pDC->FillSolidRect(0, rect.bottom-1, rect.right, rect.bottom, afxData.clrBtnShadow);
00294             rect.bottom--;
00295         }
00296         if(dwStyle & CBRS_BORDER_TOP) {
00297             pDC->FillSolidRect(0, 0, rect.right, 1, afxData.clrBtnHilite);
00298             rect.top++;
00299         }
00300         if(dwStyle & CBRS_BORDER_LEFT) {
00301             pDC->FillSolidRect(0, 0, 1, rect.bottom, afxData.clrBtnHilite);
00302             rect.left++;
00303         }
00304     }
00305 }

void CCJToolBarBase::DrawGripper | ( | CDC * | pDC,
 |  | const CRect & | rect
 | ) |

Definition at line 312 of file CJToolBarBase.cpp.

References CX_BORDER_GRIPPER, CX_GRIPPER, CY_BORDER_GRIPPER, CY_GRIPPER, m_bExStyle, and m_bInReBar.

Referenced by DoPaint, and EraseNonClient.

00313 {
00314     // if we are floating return.
00315     if( m_dwStyle & CBRS_FLOATING ) {
00316         return;
00317     }
00318
00319     // if we are to draw the extended "office" style gripper.
00320     if(( m_dwStyle & CBRS_GRIPPER ) && ( m_bExStyle == true ))
00321     {
00322         // draw the gripper in the border
00323         if (m_dwStyle & CBRS_ORIENT_HORZ)
00324         {
00325             // Draw the first gripper.
00326             pDC->Draw3dRect( rect.left+3, rect.top+2, 3, rect.Height()-4,
00327                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00328
00329             pDC->SetPixel( rect.left+3, rect.top+2+rect.Height()-5,
00330                 afxData.clrBtnHilite);
00331
00332             // Draw the second gripper.
00333             pDC->Draw3dRect( rect.left+6, rect.top+2, 3, rect.Height()-4,
00334                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00335
00336             pDC->SetPixel( rect.left+6, rect.top+2+rect.Height()-5,
00337                 afxData.clrBtnHilite);
00338         }
00339         else
00340         {
00341             // Draw the first gripper.
00342             pDC->Draw3dRect( rect.left+2, rect.top+3, rect.Width()-4, 3,
00343                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00344
00345             pDC->SetPixel( rect.left+2+rect.Width()-5, rect.top+3,
00346                 afxData.clrBtnHilite);
00347
00348             // Draw the second gripper.
00349             pDC->Draw3dRect( rect.left+2, rect.top+6, rect.Width()-4, 3,
00350                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00351
00352             pDC->SetPixel( rect.left+2+rect.Width()-5, rect.top+6,
00353                 afxData.clrBtnHilite);
00354         }
00355
00356         GdiFlush();
00357     }
00358
00359     // if we are to draw the "ReBar" style gripper.
00360     else
00361     if(( m_dwStyle & CBRS_GRIPPER ) && ( m_bInReBar == true ))
00362     {
00363         // draw the gripper in the border
00364         if (m_dwStyle & CBRS_ORIENT_HORZ)
00365         {
00366             // Draw the first gripper.
00367             pDC->Draw3dRect( rect.left+CX_BORDER_GRIPPER, rect.top+m_cyTopBorder,
00368                 CX_GRIPPER, rect.Height()-m_cyTopBorder-m_cyBottomBorder,
00369                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00370         }
00371         else
00372         {
00373             // Draw the first gripper.
00374             pDC->Draw3dRect( rect.left+m_cyTopBorder, rect.top+CY_BORDER_GRIPPER,
00375                 rect.Width()-m_cyTopBorder-m_cyBottomBorder, CY_GRIPPER,
00376                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00377         }
00378
00379         GdiFlush();
00380     }
00381
00382     // by default, we will draw the "visual studio" style gripper.
00383     else
00384     if( m_dwStyle & CBRS_GRIPPER )
00385     {
00386         // draw the gripper in the border
00387         if (m_dwStyle & CBRS_ORIENT_HORZ)
00388         {
00389             // Draw the first gripper.
00390             pDC->Draw3dRect( rect.left+1, rect.top+2, 3, rect.Height()-4,
00391                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00392
00393             // Draw the second gripper.
00394             pDC->Draw3dRect( rect.left+5, rect.top+2, 3, rect.Height()-4,
00395                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00396         }
00397         else
00398         {
00399             // Draw the first gripper.
00400             pDC->Draw3dRect( rect.left+2, rect.top+1, rect.Width()-4, 3,
00401                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00402
00403             // Draw the second gripper.
00404             pDC->Draw3dRect( rect.left+2, rect.top+5, rect.Width()-4, 3,
00405                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00406         }
00407
00408         GdiFlush();
00409     }
00410 }

void CCJToolBarBase::EraseNonClient ( )

Definition at line 182 of file CJToolBarBase.cpp.

References DrawBorders, and DrawGripper.

Referenced by CCJToolBar::OnNcPaint, and CCJReBar::OnNcPaint.

00183 {
00184     // get window DC that is clipped to the non-client area
00185     CWindowDC dc(this);
00186     CRect rectClient;
00187     GetClientRect(rectClient);
00188     CRect rectWindow;
00189     GetWindowRect(rectWindow);
00190     ScreenToClient(rectWindow);
00191     rectClient.OffsetRect(-rectWindow.left, -rectWindow.top);
00192     dc.ExcludeClipRect(rectClient);
00193
00194     // draw borders in non-client area
00195     rectWindow.OffsetRect(-rectWindow.left, -rectWindow.top);
00196     DrawBorders(&dc, rectWindow);
00197
00198     // erase parts not drawn
00199     dc.IntersectClipRect(rectWindow);
00200     SendMessage(WM_ERASEBKGND, (WPARAM)dc.m_hDC);
00201
00202     // draw gripper in non-client area
00203     DrawGripper(&dc, rectWindow);
00204 }

CRect CCJToolBarBase::GetBorders ( ) const [protected]

void CCJToolBarBase::OnPaint ( )

Reimplemented in CCJReBar.

Definition at line 172 of file CJToolBarBase.cpp.

References DoPaint.

00173 {
00174     // background is already filled in gray
00175     CPaintDC dc(this);
00176
00177     // erase background now
00178     if (IsVisible())
00179         DoPaint(&dc);       // delegate to paint helper
00180 }

void CCJToolBarBase::OnWindowPosChanging ( LPWINDOWPOS lpWndPos )

Reimplemented in CCJToolBar.

Definition at line 135 of file CJToolBarBase.cpp.

Referenced by CCJToolBar::OnWindowPosChanging.

00136 {
00137     // WINBUG: We call DefWindowProc here instead of CWnd::OnWindowPosChanging
00138     //  (which calls CWnd::Default, which calls through the super wndproc)
00139     //  because certain control bars that are system implemented (such as
00140     //  CToolBar with TBSTYLE_FLAT) do not implement WM_WINDOWPOSCHANGING
00141     //  correctly, causing repaint problems.  This code bypasses that whole
00142     //  mess.
00143     ::DefWindowProc(m_hWnd, WM_WINDOWPOSCHANGING, 0, (LPARAM)lpWndPos);
00144
00145     if (lpWndPos->flags & SWP_NOSIZE)
00146         return;
00147
00148     // invalidate borders on the right
00149     CRect rect;
00150     GetWindowRect(&rect);
00151     CSize sizePrev = rect.Size();
00152     int cx = lpWndPos->cx;
00153     int cy = lpWndPos->cy;
00154     if (cx != sizePrev.cx && (m_dwStyle & CBRS_BORDER_RIGHT))
00155     {
00156         rect.SetRect(cx-afxData.cxBorder2, 0, cx, cy);
00157         InvalidateRect(&rect);
00158         rect.SetRect(sizePrev.cx-afxData.cxBorder2, 0, sizePrev.cx, cy);
00159         InvalidateRect(&rect);
00160     }
00161
00162     // invalidate borders on the bottom
00163     if (cy != sizePrev.cy && (m_dwStyle & CBRS_BORDER_BOTTOM))
00164     {
00165         rect.SetRect(0, cy-afxData.cyBorder2, cx, cy);
00166         InvalidateRect(&rect);
00167         rect.SetRect(0, sizePrev.cy-afxData.cyBorder2, cx, sizePrev.cy);
00168         InvalidateRect(&rect);
00169     }
00170 }

void CCJToolBarBase::SetBorders | ( | int | cxLeft = 0,
 |  | int | cyTop = 0,
 |  | int | cxRight = 0,
 |  | int | cyBottom = 0
 | ) | [protected]

Definition at line 74 of file CJToolBarBase.cpp.

References ASSERT.

00075 {
00076     ASSERT(cxLeft >= 0);
00077     ASSERT(cyTop >= 0);
00078     ASSERT(cxRight >= 0);
00079     ASSERT(cyBottom >= 0);
00080
00081     m_cxLeftBorder = cxLeft;
00082     m_cyTopBorder = cyTop;
00083     m_cxRightBorder = cxRight;
00084     m_cyBottomBorder = cyBottom;
00085 }

_CJXLIB_INLINE void CCJToolBarBase::SetBorders ( LPCRECT lpRect ) [protected]

Definition at line 113 of file CJToolBarBase.h.

Referenced by CCJReBar::CCJReBar, and CCJToolBar::CreateEx.

00114     { SetBorders(lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); }

LRESULT CCJToolBarBase::WindowProc | ( | UINT | nMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [virtual]

Reimplemented in CCJReBar.

Definition at line 87 of file CJToolBarBase.cpp.

Referenced by CCJReBar::WindowProc.

00088 {
00089     ASSERT_VALID(this);
00090
00091     LRESULT lResult;
00092     switch (nMsg)
00093     {
00094     case WM_NOTIFY:
00095     case WM_COMMAND:
00096     case WM_DRAWITEM:
00097     case WM_MEASUREITEM:
00098     case WM_DELETEITEM:
00099     case WM_COMPAREITEM:
00100     case WM_VKEYTOITEM:
00101     case WM_CHARTOITEM:
00102         // send these messages to the owner if not handled
00103         if (OnWndMsg(nMsg, wParam, lParam, &lResult))
00104             return lResult;
00105         else
00106         {
00107             // try owner next
00108             lResult = GetOwner()->SendMessage(nMsg, wParam, lParam);
00109
00110             // special case for TTN_NEEDTEXTA and TTN_NEEDTEXTW
00111             if(nMsg == WM_NOTIFY)
00112             {
00113                 NMHDR* pNMHDR = (NMHDR*)lParam;
00114                 if (pNMHDR->code == TTN_NEEDTEXTA || pNMHDR->code == TTN_NEEDTEXTW)
00115                 {
00116                     TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR;
00117                     TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR;
00118                     if ((pNMHDR->code == TTN_NEEDTEXTA && (!pTTTA->lpszText || !*pTTTA->lpszText)) ||
00119                         (pNMHDR->code == TTN_NEEDTEXTW && (!pTTTW->lpszText || !*pTTTW->lpszText)))
00120                     {
00121                         // not handled by owner, so let bar itself handle it
00122                         lResult = CWnd::WindowProc(nMsg, wParam, lParam);
00123                     }
00124                 }
00125             }
00126             return lResult;
00127         }
00128     }
00129
00130     // otherwise, just handle in default way
00131     lResult = CWnd::WindowProc(nMsg, wParam, lParam);
00132     return lResult;
00133 }

Member Data Documentation

bool CCJToolBarBase::m_bExStyle

Definition at line 90 of file CJToolBarBase.h.

Referenced by CalcInsideRect, CCJToolBar::CCJToolBar, CCJToolBarBase, CCJToolBar::CreateEx, DrawGripper, and CCJToolBar::OnNcCreate.

bool CCJToolBarBase::m_bInReBar

Definition at line 89 of file CJToolBarBase.h.

Referenced by CCJReBar::_AddBar, CalcInsideRect, CCJToolBarBase, CCJReBar::Create, DrawGripper, and CCJToolBar::OnNcCreate.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJToolBarBase.h
  • WinCvs/CJLib/CJLibrary/CJToolBarBase.cpp
Generated on Sun Feb 24 01:25:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJToolBarCtrl Class Reference

#include <CJToolBarCtrl.h>

Inheritance diagram for CCJToolBarCtrl:

[legend]
Collaboration diagram for CCJToolBarCtrl:

[legend]
List of all members.

Public Methods

CCJToolBarCtrl ()
BOOL | Create (DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID)
DWORD | GetButtonSize () const
CImageList * | GetDisabledImageList () const
CImageList * | GetHotImageList () const
CImageList * | GetImageList () const
DWORD | GetStyle () const
int | GetMaxTextRows () const
BOOL | IsButtonHighlighted (int nID) const
BOOL | SetButtonWidth (int cxMin, int cxMax)
CImageList * | SetDisabledImageList (CImageList *pImageList)
CImageList * | SetHotImageList (CImageList *pImageList)
CImageList * | SetImageList (CImageList *pImageList)
HRESULT | GetDropTarget (IDropTarget **ppDropTarget) const
BOOL | SetIndent (int iIndent)
BOOL | SetMaxTextRows (int iMaxRows)
void | SetStyle (DWORD dwStyle)
BOOL | GetButtonInfo (int nID, TBBUTTONINFO *ptbbi) const
BOOL | SetButtonInfo (int nID, TBBUTTONINFO *ptbbi)
DWORD | SetDrawTextFlags (DWORD dwMask, DWORD dwDTFlags)
BOOL | GetAnchorHighlight () const
BOOL | SetAnchorHighlight (BOOL fAnchor=TRUE)
int | GetHotItem () const
int | SetHotItem (int nHot)
void | GetInsertMark (TBINSERTMARK *ptbim) const
void | SetInsertMark (TBINSERTMARK *ptbim)
BOOL | GetMaxSize (LPSIZE pSize) const
BOOL | InsertMarkHitTest (LPPOINT ppt, LPTBINSERTMARK ptbim) const
DWORD | GetExtendedStyle () const
DWORD | SetExtendedStyle (DWORD dwExStyle)
COLORREF | GetInsertMarkColor () const
COLORREF | SetInsertMarkColor (COLORREF clrNew)
BOOL | MapAccelerator (TCHAR chAccel, UINT *pIDBtn)
BOOL | MarkButton (int nID, BOOL bHighlight=TRUE)
BOOL | MoveButton (UINT nOldPos, UINT nNewPos)
int | HitTest (LPPOINT ppt) const
virtual | ~CCJToolBarCtrl ()

Protected Methods

afx_msg int | OnCreate (LPCREATESTRUCT lpCreateStruct)

Constructor & Destructor Documentation

CCJToolBarCtrl::CCJToolBarCtrl ( )

Definition at line 71 of file CJToolBarCtrl.cpp.

References VERIFY.

00072 {
00073   // initialize common controls
00074   INITCOMMONCONTROLSEX icex;
00075   icex.dwSize = sizeof(icex);
00076   icex.dwICC = ICC_BAR_CLASSES;
00077   VERIFY(InitCommonControlsEx(&icex));
00078 }

CCJToolBarCtrl::~CCJToolBarCtrl ( ) [virtual]

Definition at line 56 of file CJToolBarCtrl.cpp.

00057 {
00058   DestroyWindow();
00059 }

Member Function Documentation

BOOL CCJToolBarCtrl::Create | ( | DWORD | dwStyle,
 |  | const RECT & | rect,
 |  | CWnd * | pParentWnd,
 |  | UINT | nID
 | ) |

Definition at line 80 of file CJToolBarCtrl.cpp.

References NULL.

00082 {
00083   CWnd* pWnd = this;
00084   BOOL bCreated = pWnd->Create(TOOLBARCLASSNAME, NULL, dwStyle, rect, pParentWnd, nID);
00085
00086   return bCreated;
00087 }

_CJXLIB_INLINE BOOL CCJToolBarCtrl::GetAnchorHighlight ( ) const

Definition at line 179 of file CJToolBarCtrl.h.

References ASSERT.

00180     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_GETANCHORHIGHLIGHT, 0, 0); }

_CJXLIB_INLINE BOOL CCJToolBarCtrl::GetButtonInfo | ( | int | nID,
 |  | TBBUTTONINFO * | ptbbi
 | ) | const

Definition at line 170 of file CJToolBarCtrl.h.

References ASSERT.

00171     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_GETBUTTONINFO, nID, (LPARAM)ptbbi); }

_CJXLIB_INLINE DWORD CCJToolBarCtrl::GetButtonSize ( ) const

Definition at line 128 of file CJToolBarCtrl.h.

References ASSERT.

00129     { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_GETBUTTONSIZE, 0, 0L); }

_CJXLIB_INLINE CImageList * CCJToolBarCtrl::GetDisabledImageList ( ) const

Definition at line 131 of file CJToolBarCtrl.h.

References ASSERT.

00132     { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, TB_GETDISABLEDIMAGELIST, 0, 0)); }

HRESULT CCJToolBarCtrl::GetDropTarget ( IDropTarget ** ppDropTarget ) const

Definition at line 97 of file CJToolBarCtrl.cpp.

References ASSERT.

00098 {
00099   ASSERT(::IsWindow(m_hWnd));
00100   ASSERT(ppDropTarget);
00101   return (HRESULT) ::SendMessage(m_hWnd, TB_GETOBJECT, (WPARAM)&IID_IDropTarget, (LPARAM)ppDropTarget);
00102 }

_CJXLIB_INLINE DWORD CCJToolBarCtrl::GetExtendedStyle ( ) const

Definition at line 203 of file CJToolBarCtrl.h.

References ASSERT.

00204     { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_GETEXTENDEDSTYLE, 0, 0L); }

_CJXLIB_INLINE CImageList * CCJToolBarCtrl::GetHotImageList ( ) const

Definition at line 134 of file CJToolBarCtrl.h.

References ASSERT.

00135     { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, TB_GETHOTIMAGELIST, 0, 0)); }

_CJXLIB_INLINE int CCJToolBarCtrl::GetHotItem ( ) const

Definition at line 185 of file CJToolBarCtrl.h.

References ASSERT.

00186     { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_GETHOTITEM, 0, 0); }

_CJXLIB_INLINE CImageList * CCJToolBarCtrl::GetImageList ( ) const

Definition at line 137 of file CJToolBarCtrl.h.

References ASSERT.

00138     { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, TB_GETIMAGELIST, 0, 0)); }

_CJXLIB_INLINE void CCJToolBarCtrl::GetInsertMark ( TBINSERTMARK * ptbim ) const

Definition at line 191 of file CJToolBarCtrl.h.

References ASSERT.

00192     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_GETINSERTMARK, 0, (LPARAM)ptbim); }

_CJXLIB_INLINE COLORREF CCJToolBarCtrl::GetInsertMarkColor ( ) const

Definition at line 209 of file CJToolBarCtrl.h.

References ASSERT.

00210     { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, TB_GETINSERTMARKCOLOR, 0, 0); }

_CJXLIB_INLINE BOOL CCJToolBarCtrl::GetMaxSize ( LPSIZE pSize ) const

Definition at line 197 of file CJToolBarCtrl.h.

References ASSERT.

00198     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_GETMAXSIZE, 0, (LPARAM)pSize); }

_CJXLIB_INLINE int CCJToolBarCtrl::GetMaxTextRows ( ) const

Definition at line 143 of file CJToolBarCtrl.h.

References ASSERT.

00144     { ASSERT(::IsWindow(m_hWnd)); return (INT) ::SendMessage(m_hWnd, TB_GETTEXTROWS, 0, 0L); }

_CJXLIB_INLINE DWORD CCJToolBarCtrl::GetStyle ( ) const

Definition at line 140 of file CJToolBarCtrl.h.

References ASSERT.

00141     { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_GETSTYLE, 0, 0L); }

_CJXLIB_INLINE int CCJToolBarCtrl::HitTest ( LPPOINT ppt ) const

Definition at line 224 of file CJToolBarCtrl.h.

References ASSERT.

00225     { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_HITTEST, 0, (LPARAM)ppt); }

_CJXLIB_INLINE BOOL CCJToolBarCtrl::InsertMarkHitTest | ( | LPPOINT | ppt,
 |  | LPTBINSERTMARK | ptbim
 | ) | const

Definition at line 200 of file CJToolBarCtrl.h.

References ASSERT.

00201     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_INSERTMARKHITTEST, (WPARAM)ppt, (LPARAM)ptbim); }

_CJXLIB_INLINE BOOL CCJToolBarCtrl::IsButtonHighlighted ( int nID ) const

Definition at line 146 of file CJToolBarCtrl.h.

References ASSERT.

00147     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONHIGHLIGHTED, nID, 0); }

_CJXLIB_INLINE BOOL CCJToolBarCtrl::MapAccelerator | ( | TCHAR | chAccel,
 |  | UINT * | pIDBtn
 | ) |

Definition at line 215 of file CJToolBarCtrl.h.

References ASSERT.

00216     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_MAPACCELERATOR, (WPARAM)chAccel, (LPARAM)pIDBtn); }

_CJXLIB_INLINE BOOL CCJToolBarCtrl::MarkButton | ( | int | nID,
 |  | BOOL | bHighlight = TRUE
 | ) |

Definition at line 218 of file CJToolBarCtrl.h.

References ASSERT.

00219     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_MARKBUTTON, nID, MAKELPARAM(bHighlight, 0)); }

_CJXLIB_INLINE BOOL CCJToolBarCtrl::MoveButton | ( | UINT | nOldPos,
 |  | UINT | nNewPos
 | ) |

Definition at line 221 of file CJToolBarCtrl.h.

References ASSERT.

00222     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_MOVEBUTTON, nOldPos, nNewPos); }

int CCJToolBarCtrl::OnCreate ( LPCREATESTRUCT lpCreateStruct ) [protected]

Definition at line 89 of file CJToolBarCtrl.cpp.

00090 {
00091   if (CWnd::OnCreate(lpcs) == -1)
00092     return -1;
00093   SetButtonStructSize(sizeof(TBBUTTON));
00094   return 0;
00095 }

_CJXLIB_INLINE BOOL CCJToolBarCtrl::SetAnchorHighlight ( BOOL fAnchor = TRUE )

Definition at line 182 of file CJToolBarCtrl.h.

References ASSERT.

00183     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETANCHORHIGHLIGHT, fAnchor, 0); }

_CJXLIB_INLINE BOOL CCJToolBarCtrl::SetButtonInfo | ( | int | nID,
 |  | TBBUTTONINFO * | ptbbi
 | ) |

Definition at line 173 of file CJToolBarCtrl.h.

References ASSERT.

00174     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETBUTTONINFO, nID, (LPARAM)ptbbi); }

_CJXLIB_INLINE BOOL CCJToolBarCtrl::SetButtonWidth | ( | int | cxMin,
 |  | int | cxMax
 | ) |

Definition at line 149 of file CJToolBarCtrl.h.

References ASSERT.

00150     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETBUTTONWIDTH, 0, MAKELPARAM(cxMin, cxMax)); }

_CJXLIB_INLINE CImageList * CCJToolBarCtrl::SetDisabledImageList ( CImageList * pImageList )

Definition at line 152 of file CJToolBarCtrl.h.

References ASSERT.

00153     { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, TB_SETDISABLEDIMAGELIST, 0, (LPARAM)pImageList->GetSafeHandle())); }

_CJXLIB_INLINE DWORD CCJToolBarCtrl::SetDrawTextFlags | ( | DWORD | dwMask,
 |  | DWORD | dwDTFlags
 | ) |

Definition at line 176 of file CJToolBarCtrl.h.

References ASSERT.

00177     { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_SETDRAWTEXTFLAGS, dwMask, dwDTFlags); }

_CJXLIB_INLINE DWORD CCJToolBarCtrl::SetExtendedStyle ( DWORD dwExStyle )

Definition at line 206 of file CJToolBarCtrl.h.

References ASSERT.

00207     { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_SETEXTENDEDSTYLE, 0, dwExStyle); }

_CJXLIB_INLINE CImageList * CCJToolBarCtrl::SetHotImageList ( CImageList * pImageList )

Definition at line 155 of file CJToolBarCtrl.h.

References ASSERT.

00156     { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, TB_SETHOTIMAGELIST, 0, (LPARAM)pImageList->GetSafeHandle())); }

_CJXLIB_INLINE int CCJToolBarCtrl::SetHotItem ( int nHot )

Definition at line 188 of file CJToolBarCtrl.h.

References ASSERT.

00189     { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_SETHOTITEM, nHot, 0); }

_CJXLIB_INLINE CImageList * CCJToolBarCtrl::SetImageList ( CImageList * pImageList )

Definition at line 158 of file CJToolBarCtrl.h.

References ASSERT.

00159     { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, TB_SETIMAGELIST, 0, (LPARAM)pImageList->GetSafeHandle())); }

_CJXLIB_INLINE BOOL CCJToolBarCtrl::SetIndent ( int iIndent )

Definition at line 161 of file CJToolBarCtrl.h.

References ASSERT.

00162     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETINDENT, iIndent, 0L); }

_CJXLIB_INLINE void CCJToolBarCtrl::SetInsertMark ( TBINSERTMARK * ptbim )

Definition at line 194 of file CJToolBarCtrl.h.

References ASSERT.

00195     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_SETINSERTMARK, 0, (LPARAM)ptbim); }

_CJXLIB_INLINE COLORREF CCJToolBarCtrl::SetInsertMarkColor ( COLORREF clrNew )

Definition at line 212 of file CJToolBarCtrl.h.

References ASSERT.

00213     { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, TB_SETINSERTMARKCOLOR, 0, (LPARAM) clrNew); }

_CJXLIB_INLINE BOOL CCJToolBarCtrl::SetMaxTextRows ( int iMaxRows )

Definition at line 164 of file CJToolBarCtrl.h.

References ASSERT.

00165     { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETMAXTEXTROWS, iMaxRows, 0L); }

_CJXLIB_INLINE void CCJToolBarCtrl::SetStyle ( DWORD dwStyle )

Definition at line 167 of file CJToolBarCtrl.h.

References ASSERT.

00168     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_SETSTYLE, 0, dwStyle); }

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJToolBarCtrl.h
  • WinCvs/CJLib/CJLibrary/CJToolBarCtrl.cpp
Generated on Sun Feb 24 01:25:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJToolCmdUI Class Reference

Inheritance diagram for CCJToolCmdUI:

[legend]
Collaboration diagram for CCJToolCmdUI:

[legend]
List of all members.

Public Methods

virtual void | Enable (BOOL bOn)
virtual void | SetCheck (int nCheck)
virtual void | SetText (LPCTSTR lpszText)

Member Function Documentation

void CCJToolCmdUI::Enable ( BOOL bOn ) [virtual]

Definition at line 2053 of file CJToolBar.cpp.

References ASSERT, CCJToolBar::GetButtonStyle, NULL, CCJToolBar::SetButtonStyle, TBBS_DISABLED, TBBS_PRESSED, TBBS_SEPARATOR, and TRUE.

02054 {
02055     m_bEnableChanged = TRUE;
02056     CCJToolBar* pToolBar = (CCJToolBar*)m_pOther;
02057     ASSERT(pToolBar != NULL);
02058     ASSERT_KINDOF(CCJToolBar, pToolBar);
02059     ASSERT(m_nIndex < m_nIndexMax);
02060
02061     UINT nNewStyle = pToolBar->GetButtonStyle(m_nIndex) & ~TBBS_DISABLED;
02062     if (!bOn)
02063     {
02064         nNewStyle |= TBBS_DISABLED;
02065         // WINBUG: If a button is currently pressed and then is disabled
02066         // COMCTL32.DLL does not unpress the button, even after the mouse
02067         // button goes up!  We work around this bug by forcing TBBS_PRESSED
02068         // off when a button is disabled.
02069         nNewStyle &= ~TBBS_PRESSED;
02070     }
02071     ASSERT(!(nNewStyle & TBBS_SEPARATOR));
02072     pToolBar->SetButtonStyle(m_nIndex, nNewStyle);
02073 }

void CCJToolCmdUI::SetCheck ( int nCheck ) [virtual]

Definition at line 2075 of file CJToolBar.cpp.

References ASSERT, NULL, TBBS_CHECKBOX, TBBS_CHECKED, TBBS_INDETERMINATE, and TBBS_SEPARATOR.

02076 {
02077     ASSERT(nCheck >= 0 && nCheck <= 2); // 0=>off, 1=>on, 2=>indeterminate
02078     CCJToolBar* pToolBar = (CCJToolBar*)m_pOther;
02079     ASSERT(pToolBar != NULL);
02080     ASSERT_KINDOF(CCJToolBar, pToolBar);
02081     ASSERT(m_nIndex < m_nIndexMax);
02082
02083     UINT nNewStyle = pToolBar->GetButtonStyle(m_nIndex) &
02084                 ~(TBBS_CHECKED | TBBS_INDETERMINATE);
02085     if (nCheck == 1)
02086         nNewStyle |= TBBS_CHECKED;
02087     else if (nCheck == 2)
02088         nNewStyle |= TBBS_INDETERMINATE;
02089     ASSERT(!(nNewStyle & TBBS_SEPARATOR));
02090     pToolBar->SetButtonStyle(m_nIndex, nNewStyle | TBBS_CHECKBOX);
02091 }

void CCJToolCmdUI::SetText ( LPCTSTR lpszText ) [virtual]

Definition at line 2093 of file CJToolBar.cpp.

02094 {
02095     // ignore it
02096 }

The documentation for this class was generated from the following file:
  • WinCvs/CJLib/CJLibrary/CJToolBar.cpp
Generated on Sun Feb 24 01:25:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJTreeCtrl Class Reference

#include <CJTreeCtrl.h>

Inheritance diagram for CCJTreeCtrl:

[legend]
Collaboration diagram for CCJTreeCtrl:

[legend]
List of all members.

Public Methods

CCJTreeCtrl ()
virtual | ~CCJTreeCtrl ()
virtual HTREEITEM | GetNextItem (HTREEITEM hItem, UINT nCode)
virtual HTREEITEM | GetNextItem (HTREEITEM hItem)
virtual HTREEITEM | GetPrevItem (HTREEITEM hItem)
virtual HTREEITEM | GetLastItem (HTREEITEM hItem)
virtual HTREEITEM | GetPrevSelectedItem (HTREEITEM hItem)
virtual HTREEITEM | GetNextSelectedItem (HTREEITEM hItem)
virtual HTREEITEM | GetFirstSelectedItem ()
virtual COLORREF | GetItemColor (HTREEITEM hItem)
virtual void | ClearSelection ()
virtual void | SetItemFont (HTREEITEM hItem, LOGFONT &logfont)
virtual void | SetItemBold (HTREEITEM hItem, BOOL bBold=TRUE)
virtual void | SetItemColor (HTREEITEM hItem, COLORREF color)
virtual void | EnableMultiSelect (BOOL bMultiSelect=TRUE)
virtual BOOL | GetItemFont (HTREEITEM hItem, LOGFONT *plogfont)
virtual BOOL | GetItemBold (HTREEITEM hItem)
virtual BOOL | SelectItems (HTREEITEM hItemFrom, HTREEITEM hItemTo)
virtual HTREEITEM | FindItem (LPCTSTR lpszSearch, BOOL bCaseSensitive=FALSE, BOOL bDownDir=TRUE, BOOL bWholeWord=FALSE, HTREEITEM hItem=NULL)

Protected Methods

virtual BOOL | IsFindValid (HTREEITEM hti)
virtual BOOL | PreCreateWindow (CREATESTRUCT &cs)
afx_msg void | OnPaint ()
afx_msg void | OnLButtonDown (UINT nFlags, CPoint point)
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)

Protected Attributes

HTREEITEM | m_hItemFirstSel
DWORD | m_dwDragStart
BOOL | m_bMultiSelect
CMap< void *, void *, Color_Font,
Color_Font & > 		m_mapColorFont

Constructor & Destructor Documentation

CCJTreeCtrl::CCJTreeCtrl ( )

Definition at line 63 of file CJTreeCtrl.cpp.

References FALSE, m_bMultiSelect, m_dwDragStart, m_hItemFirstSel, and NULL.

00064 {
00065     m_hItemFirstSel = NULL;
00066     m_dwDragStart   = NULL;
00067     m_bMultiSelect = FALSE;
00068 }

CCJTreeCtrl::~CCJTreeCtrl ( ) [virtual]

Definition at line 70 of file CJTreeCtrl.cpp.

00071 {
00072 }

Member Function Documentation

void CCJTreeCtrl::ClearSelection ( ) [virtual]

Definition at line 503 of file CJTreeCtrl.cpp.

References GetNextItem, and NULL.

Referenced by OnLButtonDown.

00504 {
00505     if(m_bMultiSelect)
00506     {
00507         // This can be time consuming for very large trees
00508         // and is called every time the user does a normal selection
00509         // If performance is an issue, it may be better to maintain
00510         // a list of selected items
00511         for ( HTREEITEM hItem=GetRootItem(); hItem!=NULL; hItem=GetNextItem( hItem ) )
00512             if ( GetItemState( hItem, TVIS_SELECTED ) & TVIS_SELECTED )
00513                 SetItemState( hItem, 0, TVIS_SELECTED );
00514     }
00515 }

_CJXLIB_INLINE void CCJTreeCtrl::EnableMultiSelect ( BOOL bMultiSelect = TRUE ) [virtual]

Definition at line 250 of file CJTreeCtrl.h.

References m_bMultiSelect.

00251     { m_bMultiSelect = bMultiSelect; }

HTREEITEM CCJTreeCtrl::FindItem | ( | LPCTSTR | lpszSearch,
 |  | BOOL | bCaseSensitive = FALSE,
 |  | BOOL | bDownDir = TRUE,
 |  | BOOL | bWholeWord = FALSE,
 |  | HTREEITEM | hItem = NULL
 | ) | [virtual]

Definition at line 168 of file CJTreeCtrl.cpp.

References FALSE, GetLastItem, GetNextItem, GetPrevItem, IsFindValid, NULL, and TRUE.

00173 {
00174     CString str = lpszSearch;
00175
00176     int lenSearchStr = str.GetLength();
00177     if( lenSearchStr == 0 ) return NULL;
00178
00179     // For the first pass, set the current item equal to the selection
00180     HTREEITEM htiSel = hItem ? hItem : GetSelectedItem();
00181     HTREEITEM htiCur = htiSel;
00182     CString sSearch = str;
00183
00184     // make sure it ends if we started with no selection
00185     if(( htiCur == NULL ) && ( htiSel != NULL ))
00186     {
00187         if( bDownDir )
00188             htiCur = GetRootItem();
00189         else
00190             htiCur = GetLastItem( NULL );
00191     }
00192
00193     if( !bCaseSensitive )
00194         sSearch.MakeLower();
00195
00196     // For the first pass only, we check to see if it
00197     // is the item we're looking for.
00198     BOOL bFirstPass = TRUE;
00199
00200     while( htiCur && (htiCur != htiSel || bFirstPass) )
00201     {
00202         bFirstPass = FALSE;
00203
00204         CString sItemText = GetItemText( htiCur );
00205         if( !bCaseSensitive )
00206             sItemText.MakeLower();
00207
00208         int n;
00209         while( (n = sItemText.Find( sSearch )) != -1 )
00210         {
00211             // Search string found
00212             if( bWholeWord )
00213             {
00214                 // Check preceding char
00215                 if( n != 0 )
00216                 {
00217                     if( isalpha(sItemText[n-1]) ||
00218                             sItemText[n-1] == '_' ){
00219                         // Not whole word
00220                         sItemText = sItemText.Right(
00221                             sItemText.GetLength() - n -
00222                             lenSearchStr );
00223                         continue;
00224                     }
00225                 }
00226
00227                 // Check succeeding char
00228                 if( sItemText.GetLength() > n + lenSearchStr
00229                     && ( isalpha(sItemText[n+lenSearchStr]) ||
00230                     sItemText[n+lenSearchStr] == '_' ) )
00231                 {
00232                     // Not whole word
00233                     sItemText = sItemText.Right( sItemText.GetLength()
00234                             - n - sSearch.GetLength() );
00235                     continue;
00236                 }
00237             }
00238
00239             if( IsFindValid( htiCur ) )
00240                 return htiCur;
00241             else break;
00242         }
00243
00244
00245         htiCur = bDownDir ? GetNextItem( htiCur ) : GetPrevItem( htiCur );
00246         if( htiCur == NULL )
00247         {
00248             if( bDownDir )  htiCur = GetRootItem();
00249             else htiCur = GetLastItem( NULL );
00250         }
00251     }
00252     return NULL;
00253 }

HTREEITEM CCJTreeCtrl::GetFirstSelectedItem ( ) [virtual]

Definition at line 569 of file CJTreeCtrl.cpp.

References GetNextItem, and NULL.

00570 {
00571     if(m_bMultiSelect)
00572     {
00573         for ( HTREEITEM hItem = GetRootItem(); hItem!=NULL; hItem = GetNextItem( hItem ) )
00574             if ( GetItemState( hItem, TVIS_SELECTED ) & TVIS_SELECTED )
00575                 return hItem;
00576     }
00577
00578     return NULL;
00579 }

BOOL CCJTreeCtrl::GetItemBold ( HTREEITEM hItem ) [virtual]

Definition at line 315 of file CJTreeCtrl.cpp.

Referenced by OnPaint.

00316 {
00317     return GetItemState( hItem, TVIS_BOLD ) & TVIS_BOLD;
00318 }

COLORREF CCJTreeCtrl::GetItemColor ( HTREEITEM hItem ) [virtual]

Definition at line 320 of file CJTreeCtrl.cpp.

References m_mapColorFont.

00321 {
00322     // Returns (COLORREF)-1 if color was not set
00323     Color_Font cf;
00324     if( !m_mapColorFont.Lookup( hItem, cf ) )
00325         return (COLORREF)-1;
00326     return cf.color;
00327
00328 }

BOOL CCJTreeCtrl::GetItemFont | ( | HTREEITEM | hItem,
 |  | LOGFONT * | plogfont
 | ) | [virtual]

Definition at line 303 of file CJTreeCtrl.cpp.

References FALSE, m_mapColorFont, and TRUE.

00304 {
00305     Color_Font cf;
00306     if( !m_mapColorFont.Lookup( hItem, cf ) )
00307         return FALSE;
00308     if( cf.logfont.lfFaceName[0] == '\0' )
00309         return FALSE;
00310     *plogfont = cf.logfont;
00311     return TRUE;
00312
00313 }

HTREEITEM CCJTreeCtrl::GetLastItem ( HTREEITEM hItem ) [virtual]

Definition at line 134 of file CJTreeCtrl.cpp.

References NULL.

Referenced by FindItem, and GetPrevItem.

00135 {
00136     //  Temporary used variable
00137     HTREEITEM   htiNext;
00138
00139     if( hItem == NULL ) {
00140         // Get the last item at the top level
00141         hItem = GetRootItem();
00142     }
00143
00144     while( ItemHasChildren( hItem ) != NULL ) {
00145         //  Find the last child of hItem
00146         htiNext = GetChildItem( hItem );
00147         while( htiNext != NULL ) {
00148             hItem = htiNext;
00149             htiNext = GetNextSiblingItem( htiNext );
00150         }
00151     }
00152
00153     return hItem;
00154
00155 }

HTREEITEM CCJTreeCtrl::GetNextItem ( HTREEITEM hItem ) [virtual]

Definition at line 93 of file CJTreeCtrl.cpp.

References NULL.

00094 {
00095     HTREEITEM hti = NULL;
00096
00097     if (ItemHasChildren(hItem))
00098         hti = GetChildItem(hItem);
00099
00100     if (hti == NULL) {
00101         while ((hti = GetNextSiblingItem(hItem)) == NULL) {
00102             if ((hItem = GetParentItem(hItem)) == NULL)
00103                 return NULL;
00104         }
00105     }
00106     return hti;
00107 }

_CJXLIB_INLINE HTREEITEM CCJTreeCtrl::GetNextItem | ( | HTREEITEM | hItem,
 |  | UINT | nCode
 | ) | [virtual]

Definition at line 247 of file CJTreeCtrl.h.

Referenced by ClearSelection, FindItem, GetFirstSelectedItem, and GetNextSelectedItem.

00248     { return CTreeCtrl::GetNextItem( hItem, nCode ); }

HTREEITEM CCJTreeCtrl::GetNextSelectedItem ( HTREEITEM hItem ) [virtual]

Definition at line 581 of file CJTreeCtrl.cpp.

References GetNextItem, and NULL.

00582 {
00583     if(m_bMultiSelect)
00584     {
00585         for ( hItem = GetNextItem( hItem ); hItem!=NULL; hItem = GetNextItem( hItem ) )
00586             if ( GetItemState( hItem, TVIS_SELECTED ) & TVIS_SELECTED )
00587                 return hItem;
00588     }
00589
00590     return NULL;
00591 }

HTREEITEM CCJTreeCtrl::GetPrevItem ( HTREEITEM hItem ) [virtual]

Definition at line 115 of file CJTreeCtrl.cpp.

References GetLastItem, and NULL.

Referenced by FindItem, and GetPrevSelectedItem.

00116 {
00117     HTREEITEM       hti;
00118
00119     hti = GetPrevSiblingItem(hItem);
00120     if( hti == NULL )
00121         hti = GetParentItem(hItem);
00122     else
00123         hti = GetLastItem(hti);
00124     return hti;
00125 }

HTREEITEM CCJTreeCtrl::GetPrevSelectedItem ( HTREEITEM hItem ) [virtual]

Definition at line 593 of file CJTreeCtrl.cpp.

References GetPrevItem, and NULL.

00594 {
00595     if(m_bMultiSelect)
00596     {
00597         for ( hItem = GetPrevItem( hItem ); hItem!=NULL; hItem = GetPrevItem( hItem ) )
00598             if ( GetItemState( hItem, TVIS_SELECTED ) & TVIS_SELECTED )
00599                 return hItem;
00600     }
00601
00602     return NULL;
00603 }

BOOL CCJTreeCtrl::IsFindValid ( HTREEITEM hti ) [protected, virtual]

Definition at line 262 of file CJTreeCtrl.cpp.

References TRUE.

Referenced by FindItem.

00263 {
00264     return TRUE;
00265 }

BOOL CCJTreeCtrl::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 605 of file CJTreeCtrl.cpp.

References TRUE.

00606 {
00607     // KStowell - overridden for flicker-free drawing.
00608     UNUSED_ALWAYS(pDC);
00609     return TRUE;
00610 }

void CCJTreeCtrl::OnLButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 427 of file CJTreeCtrl.cpp.

References ClearSelection, m_dwDragStart, m_hItemFirstSel, NULL, and SelectItems.

00428 {
00429     if(m_bMultiSelect)
00430     {
00431         // Set focus to control if key strokes are needed.
00432         // Focus is not automatically given to control on lbuttondown
00433
00434         m_dwDragStart = GetTickCount();
00435
00436         if(nFlags & MK_CONTROL )
00437         {
00438             // Control key is down
00439             UINT flag;
00440             HTREEITEM hItem = HitTest( point, &flag );
00441             if( hItem )
00442             {
00443                 // Toggle selection state
00444                 UINT uNewSelState =
00445                     GetItemState(hItem, TVIS_SELECTED) & TVIS_SELECTED ?
00446                     0 : TVIS_SELECTED;
00447
00448                 // Get old selected (focus) item and state
00449                 HTREEITEM hItemOld = GetSelectedItem();
00450                 UINT uOldSelState  = hItemOld ?
00451                     GetItemState(hItemOld, TVIS_SELECTED) : 0;
00452
00453                 // Select new item
00454                 if( GetSelectedItem() == hItem )
00455                     SelectItem( NULL );     // to prevent edit
00456                 CTreeCtrl::OnLButtonDown(nFlags, point);
00457
00458                 // Set proper selection (highlight) state for new item
00459                 SetItemState(hItem, uNewSelState,  TVIS_SELECTED);
00460
00461                 // Restore state of old selected item
00462                 if (hItemOld && hItemOld != hItem)
00463                     SetItemState(hItemOld, uOldSelState, TVIS_SELECTED);
00464
00465                 m_hItemFirstSel = NULL;
00466
00467                 return;
00468             }
00469         }
00470         else if(nFlags & MK_SHIFT)
00471         {
00472             // Shift key is down
00473             UINT flag;
00474             HTREEITEM hItem = HitTest( point, &flag );
00475
00476             // Initialize the reference item if this is the first shift selection
00477             if( !m_hItemFirstSel )
00478                 m_hItemFirstSel = GetSelectedItem();
00479
00480             // Select new item
00481             if( GetSelectedItem() == hItem )
00482                 SelectItem( NULL );         // to prevent edit
00483             CTreeCtrl::OnLButtonDown(nFlags, point);
00484
00485             if( m_hItemFirstSel )
00486             {
00487                 SelectItems( m_hItemFirstSel, hItem );
00488                 return;
00489             }
00490         }
00491         else
00492         {
00493             // Normal - remove all selection and let default
00494             // handler do the rest
00495             ClearSelection();
00496             m_hItemFirstSel = NULL;
00497         }
00498     }
00499
00500     CTreeCtrl::OnLButtonDown(nFlags, point);
00501 }

void CCJTreeCtrl::OnPaint ( ) [protected]

Definition at line 330 of file CJTreeCtrl.cpp.

References GetItemBold, m_mapColorFont, and TRUE.

00331 {
00332     CPaintDC dc(this);
00333
00334     // Create a memory DC compatible with the paint DC
00335     CDC memDC;
00336     memDC.CreateCompatibleDC( &dc );
00337
00338     CRect rcClip, rcClient;
00339     dc.GetClipBox( &rcClip );
00340     GetClientRect(&rcClient);
00341
00342     // Select a compatible bitmap into the memory DC
00343     CBitmap bitmap;
00344     bitmap.CreateCompatibleBitmap( &dc, rcClient.Width(), rcClient.Height() );
00345     CBitmap* pOldBitmap = memDC.SelectObject( &bitmap );
00346
00347     // Set clip region to be same as that in paint DC
00348     CRgn rgn;
00349     rgn.CreateRectRgnIndirect( &rcClip );
00350     memDC.SelectClipRgn(&rgn);
00351     rgn.DeleteObject();
00352
00353     // First let the control do its default drawing.
00354     CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
00355
00356     HTREEITEM hItem = GetFirstVisibleItem();
00357
00358     int n = GetVisibleCount()+1;
00359     while( hItem && n--)
00360     {
00361         CRect rect;
00362
00363         // Do not meddle with selected items or drop highlighted items
00364         UINT selflag = TVIS_DROPHILITED | TVIS_SELECTED;
00365         Color_Font cf;
00366
00367         if ( !(GetItemState( hItem, selflag ) & selflag )
00368             && m_mapColorFont.Lookup( hItem, cf ))
00369         {
00370             CFont *pFontDC;
00371             CFont fontDC;
00372             LOGFONT logfont;
00373
00374             if( cf.logfont.lfFaceName[0] != '\0' )
00375             {
00376                 logfont = cf.logfont;
00377             }
00378             else
00379             {
00380                 // No font specified, so use window font
00381                 CFont *pFont = GetFont();
00382                 pFont->GetLogFont( &logfont );
00383             }
00384
00385             CString sItem = GetItemText( hItem );
00386             GetItemRect( hItem, &rect, TRUE );
00387
00388             // cover up over old font.
00389             CFont* pOldFont = memDC.SelectObject(GetFont());
00390             memDC.SetTextColor(::GetSysColor( COLOR_WINDOW ));
00391             memDC.SetBkColor( GetSysColor( COLOR_WINDOW ) );
00392             memDC.TextOut( rect.left+2, rect.top+1, sItem );
00393             memDC.SelectObject(pOldFont);
00394
00395             if( GetItemBold( hItem ) )
00396                 logfont.lfWeight = 700;
00397             fontDC.CreateFontIndirect( &logfont );
00398             pFontDC = memDC.SelectObject( &fontDC );
00399
00400             if( cf.color != (COLORREF)-1 )
00401                 memDC.SetTextColor( cf.color );
00402
00403             memDC.SetBkColor( GetSysColor( COLOR_WINDOW ) );
00404             memDC.TextOut( rect.left+2, rect.top+1, sItem );
00405
00406             memDC.SelectObject( pFontDC );
00407
00408             // fix potential resource leak - KStowell - 10-22-99.
00409             fontDC.DeleteObject();
00410         }
00411         hItem = GetNextVisibleItem( hItem );
00412     }
00413
00414
00415     dc.BitBlt( rcClip.left, rcClip.top, rcClip.Width(), rcClip.Height(), &memDC,
00416         rcClip.left, rcClip.top, SRCCOPY );
00417
00418     // fix potential resource leak - KStowell - 10-21-99
00419     memDC.SelectObject( pOldBitmap );
00420     memDC.DeleteDC();
00421     bitmap.DeleteObject();
00422 }

BOOL CCJTreeCtrl::PreCreateWindow ( CREATESTRUCT & cs ) [protected, virtual]

Definition at line 267 of file CJTreeCtrl.cpp.

References FALSE, and TRUE.

00268 {
00269     if( !CTreeCtrl::PreCreateWindow(cs))
00270         return FALSE;
00271
00272     cs.style |= TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_SHOWSELALWAYS;
00273
00274     return TRUE;
00275 }

BOOL CCJTreeCtrl::SelectItems | ( | HTREEITEM | hItemFrom,
 |  | HTREEITEM | hItemTo
 | ) | [virtual]

Definition at line 522 of file CJTreeCtrl.cpp.

References FALSE, and TRUE.

Referenced by OnLButtonDown.

00523 {
00524     if(m_bMultiSelect)
00525     {
00526         HTREEITEM hItem = GetRootItem();
00527
00528         // Clear selection upto the first item
00529         while ( hItem && hItem!=hItemFrom && hItem!=hItemTo )
00530         {
00531             hItem = GetNextVisibleItem( hItem );
00532             SetItemState( hItem, 0, TVIS_SELECTED );
00533         }
00534
00535         if ( !hItem )
00536             return FALSE;   // Item is not visible
00537
00538         SelectItem( hItemTo );
00539
00540         // Rearrange hItemFrom and hItemTo so that hItemFirst is at top
00541         if( hItem == hItemTo )
00542         {
00543             hItemTo = hItemFrom;
00544             hItemFrom = hItem;
00545         }
00546
00547
00548         // Go through remaining visible items
00549         BOOL bSelect = TRUE;
00550         while ( hItem )
00551         {
00552             // Select or remove selection depending on whether item
00553             // is still within the range.
00554             SetItemState( hItem, bSelect ? TVIS_SELECTED : 0, TVIS_SELECTED );
00555
00556             // Do we need to start removing items from selection
00557             if( hItem == hItemTo )
00558                 bSelect = FALSE;
00559
00560             hItem = GetNextVisibleItem( hItem );
00561         }
00562
00563         return TRUE;
00564     }
00565
00566     return FALSE;
00567 }

void CCJTreeCtrl::SetItemBold | ( | HTREEITEM | hItem,
 |  | BOOL | bBold = TRUE
 | ) | [virtual]

Definition at line 289 of file CJTreeCtrl.cpp.

00290 {
00291     SetItemState( hItem, bBold ? TVIS_BOLD: 0, TVIS_BOLD );
00292 }

void CCJTreeCtrl::SetItemColor | ( | HTREEITEM | hItem,
 |  | COLORREF | color
 | ) | [virtual]

Definition at line 294 of file CJTreeCtrl.cpp.

References m_mapColorFont.

00295 {
00296     Color_Font cf;
00297     if( !m_mapColorFont.Lookup( hItem, cf ) )
00298         cf.logfont.lfFaceName[0] = '\0';
00299     cf.color = color;
00300     m_mapColorFont[hItem] = cf;
00301 }

void CCJTreeCtrl::SetItemFont | ( | HTREEITEM | hItem,
 |  | LOGFONT & | logfont
 | ) | [virtual]

Definition at line 280 of file CJTreeCtrl.cpp.

References m_mapColorFont.

00281 {
00282     Color_Font cf;
00283     if( !m_mapColorFont.Lookup( hItem, cf ) )
00284         cf.color = (COLORREF)-1;
00285     cf.logfont = logfont;
00286     m_mapColorFont[hItem] = cf;
00287 }

Member Data Documentation

BOOL CCJTreeCtrl::m_bMultiSelect [protected]

Definition at line 75 of file CJTreeCtrl.h.

Referenced by CCJTreeCtrl, and EnableMultiSelect.

DWORD CCJTreeCtrl::m_dwDragStart [protected]

Definition at line 74 of file CJTreeCtrl.h.

Referenced by CCJTreeCtrl, and OnLButtonDown.

HTREEITEM CCJTreeCtrl::m_hItemFirstSel [protected]

Definition at line 73 of file CJTreeCtrl.h.

Referenced by CCJTreeCtrl, and OnLButtonDown.

CMap< void*, void*, Color_Font, Color_Font& > CCJTreeCtrl::m_mapColorFont [protected]

Definition at line 78 of file CJTreeCtrl.h.

Referenced by GetItemColor, GetItemFont, OnPaint, SetItemColor, and SetItemFont.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJTreeCtrl.h
  • WinCvs/CJLib/CJLibrary/CJTreeCtrl.cpp
Generated on Sun Feb 24 01:25:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJTreeCtrl::Color_Font Struct Reference

#include <CJTreeCtrl.h>

Collaboration diagram for CCJTreeCtrl::Color_Font:

[legend]
List of all members.

Public Attributes

COLORREF | color
LOGFONT | logfont

Member Data Documentation

COLORREF CCJTreeCtrl::Color_Font::color

Definition at line 77 of file CJTreeCtrl.h.

LOGFONT CCJTreeCtrl::Color_Font::logfont

Definition at line 77 of file CJTreeCtrl.h.

The documentation for this struct was generated from the following file:
  • WinCvs/CJLib/Include/CJTreeCtrl.h
Generated on Sun Feb 24 01:25:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCJWindowPlacement Class Reference

#include <CJWindowPlacement.h>

Inheritance diagram for CCJWindowPlacement:

[legend]
Collaboration diagram for CCJWindowPlacement:

[legend]
List of all members.

Public Methods

CCJWindowPlacement ()
virtual | ~CCJWindowPlacement ()
virtual BOOL | LoadWindowPos (CFrameWnd *pFrameWnd, LPCTSTR lpszFormat=NULL, LPCTSTR lpszSection=NULL, LPCTSTR lpszWndPos=NULL)
virtual void | SaveWindowPos (CFrameWnd *pFrameWnd)

Private Attributes

CString | m_strFormat
CString | m_strSection
CString | m_strWndPos

Constructor & Destructor Documentation

CCJWindowPlacement::CCJWindowPlacement ( )

Definition at line 60 of file CJWindowPlacement.cpp.

References NULL.

00061 {
00062     length                  = sizeof( WINDOWPLACEMENT );
00063     flags                   = NULL;
00064     showCmd                 = SW_SHOWMAXIMIZED;
00065     ptMinPosition.x         = 0;
00066     ptMinPosition.y         = 0;
00067     ptMaxPosition.x         = 0;
00068     ptMaxPosition.y         = 0;
00069     rcNormalPosition.left   = 0;
00070     rcNormalPosition.top    = 0;
00071     rcNormalPosition.right  = 0;
00072     rcNormalPosition.bottom = 0;
00073 }

CCJWindowPlacement::~CCJWindowPlacement ( ) [virtual]

Definition at line 75 of file CJWindowPlacement.cpp.

00076 {
00077 }

Member Function Documentation

BOOL CCJWindowPlacement::LoadWindowPos | ( | CFrameWnd * | pFrameWnd,
 |  | LPCTSTR | lpszFormat = NULL,
 |  | LPCTSTR | lpszSection = NULL,
 |  | LPCTSTR | lpszWndPos = NULL
 | ) | [virtual]

Definition at line 105 of file CJWindowPlacement.cpp.

References FALSE, IDS_SETTINGS, IDS_WIN_PLACEMENT, IDS_WNDPOS, m_strFormat, m_strSection, m_strWndPos, NULL, and TRUE.

Referenced by CMainFrame::OnCreate.

00106 {
00107     ASSERT_VALID( pFrameWnd ); // must be valid.
00108
00109     // load the strings for the registry.
00110     if( lpszFormat == NULL )
00111         m_strFormat.LoadString( IDS_WIN_PLACEMENT );
00112     else
00113         m_strFormat = lpszFormat;
00114
00115     if( lpszSection == NULL )
00116         m_strSection.LoadString( IDS_SETTINGS );
00117     else
00118         m_strSection = lpszSection;
00119
00120     if( lpszWndPos == NULL )
00121         m_strWndPos.LoadString( IDS_WNDPOS  );
00122     else
00123         m_strWndPos = lpszWndPos;
00124
00125     // Load the previous window placement settings.
00126     CString strBuffer = AfxGetApp()->GetProfileString( m_strSection, m_strWndPos, NULL );
00127
00128     int nRead = _stscanf( strBuffer, m_strFormat,
00129         &flags,
00130         &showCmd,
00131         &ptMinPosition.x,
00132         &ptMinPosition.y,
00133         &ptMaxPosition.x,
00134         &ptMaxPosition.y,
00135         &rcNormalPosition.left,
00136         &rcNormalPosition.top,
00137         &rcNormalPosition.right,
00138         &rcNormalPosition.bottom);
00139
00140     // Set the window position.
00141     if( nRead == 10 )
00142     {
00143         pFrameWnd->SetWindowPlacement( this );
00144         pFrameWnd->ShowWindow( showCmd );
00145         pFrameWnd->UpdateWindow();
00146         return TRUE;
00147     }
00148
00149     return FALSE;
00150 }

void CCJWindowPlacement::SaveWindowPos ( CFrameWnd * pFrameWnd ) [virtual]

Definition at line 81 of file CJWindowPlacement.cpp.

References m_strFormat, m_strSection, and m_strWndPos.

Referenced by CMainFrame::OnClose.

00082 {
00083     ASSERT_VALID( pFrameWnd ); // must be valid.
00084
00085     // Get the current window position.
00086     pFrameWnd->GetWindowPlacement( this );
00087
00088     // Save position to registry.
00089     CString strBuffer;
00090     strBuffer.Format( m_strFormat,
00091         flags,
00092         showCmd,
00093         ptMinPosition.x,
00094         ptMinPosition.y,
00095         ptMaxPosition.x,
00096         ptMaxPosition.y,
00097         rcNormalPosition.left,
00098         rcNormalPosition.top,
00099         rcNormalPosition.right,
00100         rcNormalPosition.bottom);
00101
00102     AfxGetApp()->WriteProfileString( m_strSection, m_strWndPos, strBuffer );
00103 }

Member Data Documentation

CString CCJWindowPlacement::m_strFormat [private]

Definition at line 71 of file CJWindowPlacement.h.

Referenced by LoadWindowPos, and SaveWindowPos.

CString CCJWindowPlacement::m_strSection [private]

Definition at line 72 of file CJWindowPlacement.h.

Referenced by LoadWindowPos, and SaveWindowPos.

CString CCJWindowPlacement::m_strWndPos [private]

Definition at line 73 of file CJWindowPlacement.h.

Referenced by LoadWindowPos, and SaveWindowPos.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJWindowPlacement.h
  • WinCvs/CJLib/CJLibrary/CJWindowPlacement.cpp
Generated on Sun Feb 24 01:25:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCmdLine_MAIN Class Reference

#include <LineCmd.h>

Inheritance diagram for CCmdLine_MAIN:

[legend]
Collaboration diagram for CCmdLine_MAIN:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_CMDLINE_MAIN }

Public Methods

CCmdLine_MAIN ()
CCmdLine_MAIN (const char *lastcmd, bool hasPath, const char *lastpath)
~CCmdLine_MAIN ()
virtual BOOL | PreTranslateMessage (MSG *pMsg)

Public Attributes

CEdit m_cmdLineEdit
CSmartComboBox m_prevCmdCombo
CButton m_selFolder
BOOL | m_checkPath
CString | m_cmdLine
CString | m_folderLoc

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnCheckpath ()
afx_msg void | OnSelfolder ()
virtual BOOL | OnInitDialog ()
afx_msg void | OnSelchangePrevcmd ()
afx_msg void | OnSetfocusCmdline ()

Private Attributes

bool | m_firstTimeCmdline

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 53 of file LineCmd.h.

00053 { IDD = IDD_CMDLINE_MAIN };

Constructor & Destructor Documentation

CCmdLine_MAIN::CCmdLine_MAIN ( )

Definition at line 131 of file LineCmd.cpp.

00131                              : CPropertyPage(CCmdLine_MAIN::IDD)
00132 {
00133 }

CCmdLine_MAIN::CCmdLine_MAIN | ( | const char * | lastcmd,
 |  | bool | hasPath,
 |  | const char * | lastpath
 | ) |

Definition at line 118 of file LineCmd.cpp.

References m_checkPath, m_cmdLine, m_firstTimeCmdline, m_folderLoc, m_prevCmdCombo, and USmartCombo::SetItems.

00119     : CPropertyPage(CCmdLine_MAIN::IDD)
00120 {
00121     //{{AFX_DATA_INIT(CCmdLine_MAIN)
00122     m_checkPath = hasPath;
00123     m_cmdLine = lastcmd;
00124     m_folderLoc = lastpath;
00125     //}}AFX_DATA_INIT
00126
00127     m_firstTimeCmdline = true;
00128     m_prevCmdCombo.SetItems(&gPrevCvsCmd);
00129 }

CCmdLine_MAIN::~CCmdLine_MAIN ( )

Definition at line 135 of file LineCmd.cpp.

00136 {
00137 }

Member Function Documentation

void CCmdLine_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 139 of file LineCmd.cpp.

References DDV_CheckPathExists, DDV_MinChars, DDX_ComboMString, DEF_CVS_CMD, IDC_CHECKPATH, IDC_CMDLINE, IDC_FOLDERLOC, IDC_PREVCMD, IDC_SELFOLDER, TMString< UStr >::Insert, m_checkPath, m_cmdLine, m_cmdLineEdit, m_folderLoc, m_prevCmdCombo, and m_selFolder.

00140 {
00141     CPropertyPage::DoDataExchange(pDX);
00142     //{{AFX_DATA_MAP(CCmdLine_MAIN)
00143     DDX_Control(pDX, IDC_CMDLINE, m_cmdLineEdit);
00144     DDX_Control(pDX, IDC_PREVCMD, m_prevCmdCombo);
00145     DDX_Control(pDX, IDC_SELFOLDER, m_selFolder);
00146     DDX_Check(pDX, IDC_CHECKPATH, m_checkPath);
00147     DDX_Text(pDX, IDC_CMDLINE, m_cmdLine);
00148     DDV_MinChars(pDX, m_cmdLine, 1);
00149     DDX_Text(pDX, IDC_FOLDERLOC, m_folderLoc);
00150     //}}AFX_DATA_MAP
00151
00152     if( pDX->m_bSaveAndValidate )
00153     {
00154         if( !m_cmdLine.IsEmpty() && DEF_CVS_CMD != m_cmdLine )
00155         {
00156             gPrevCvsCmd.Insert(m_cmdLine);
00157         }
00158     }
00159     else
00160     {
00161         DDX_ComboMString(pDX, IDC_PREVCMD, m_prevCmdCombo);
00162     }
00163
00164     if( m_checkPath )
00165     {
00166         DDV_MinChars(pDX, m_folderLoc, 1);
00167         DDV_CheckPathExists(pDX, IDC_FOLDERLOC, m_folderLoc);
00168     }
00169
00170     if( !pDX->m_bSaveAndValidate )
00171     {
00172         m_selFolder.EnableWindow(m_checkPath);
00173     }
00174 }

void CCmdLine_MAIN::OnCheckpath ( ) [protected]

Definition at line 189 of file LineCmd.cpp.

References IDC_CHECKPATH, IDC_FOLDERLOC, and m_selFolder.

Referenced by OnInitDialog.

00190 {
00191     CButton* button = (CButton *)GetDlgItem(IDC_CHECKPATH);
00192     int isChecked = button->GetCheck();
00193     CWnd* folderLoc = GetDlgItem(IDC_FOLDERLOC);
00194
00195     m_selFolder.EnableWindow(isChecked);
00196     folderLoc->EnableWindow(isChecked);
00197     m_selFolder.EnableWindow(isChecked);
00198 }

BOOL CCmdLine_MAIN::OnInitDialog ( ) [protected, virtual]

Definition at line 230 of file LineCmd.cpp.

References OnCheckpath, and TRUE.

00231 {
00232     CPropertyPage::OnInitDialog();
00233
00234     // Extra initialization
00235     OnCheckpath();
00236
00237     return TRUE;  // return TRUE unless you set the focus to a control
00238                   // EXCEPTION: OCX Property Pages should return FALSE
00239 }

void CCmdLine_MAIN::OnSelchangePrevcmd ( ) [protected]

Definition at line 241 of file LineCmd.cpp.

References TMString< UStr >::GetList, m_cmdLineEdit, m_prevCmdCombo, and NAMESPACE.

00242 {
00243     int sel = m_prevCmdCombo.GetCurSel();
00244     if( sel == CB_ERR )
00245         return;
00246
00247     m_cmdLineEdit.SetSel(0, -1);
00248     const NAMESPACE(std) vector<CStr> & list = gPrevCvsCmd.GetList();
00249     m_cmdLineEdit.ReplaceSel(list[sel]);
00250 }

void CCmdLine_MAIN::OnSelfolder ( ) [protected]

Definition at line 200 of file LineCmd.cpp.

References BrowserGetDirectory, IDC_FOLDERLOC, and NULL.

00201 {
00202     const char *dir = BrowserGetDirectory("Select where to execute:", IsWindow(this->m_hWnd) ? this : NULL);
00203     if( dir != 0L )
00204     {
00205         SetDlgItemText(IDC_FOLDERLOC, dir);
00206     }
00207 }

void CCmdLine_MAIN::OnSetfocusCmdline ( ) [protected]

Definition at line 252 of file LineCmd.cpp.

References DEF_CVS_CMD, m_cmdLineEdit, and m_firstTimeCmdline.

00253 {
00254     if( m_firstTimeCmdline )
00255     {
00256         m_firstTimeCmdline = false;
00257
00258         CString cmdLine;
00259         m_cmdLineEdit.GetWindowText(cmdLine);
00260
00261         if( DEF_CVS_CMD == cmdLine )
00262         {
00263             m_cmdLineEdit.SetSel(-1, -1);
00264         }
00265     }
00266 }

BOOL CCmdLine_MAIN::PreTranslateMessage ( MSG * pMsg ) [virtual]

Definition at line 209 of file LineCmd.cpp.

00210 {
00211     if( pMsg->message == WM_KEYDOWN )
00212     {
00213         switch( (int)pMsg->wParam )
00214         {
00215         case VK_ESCAPE:     //dialog can be dismissed by Esc key
00216             EndDialog(IDCANCEL);
00217             break;
00218         case VK_RETURN:     //command can be executed with Enter key
00219             UpdateData();
00220             EndDialog(IDOK);
00221             break;
00222         default:
00223             break;
00224         }
00225     }
00226
00227     return CPropertyPage::PreTranslateMessage(pMsg);
00228 }

Member Data Documentation

BOOL CCmdLine_MAIN::m_checkPath

Definition at line 57 of file LineCmd.h.

Referenced by CCmdLine_MAIN, CompatGetCommand, and DoDataExchange.

CString CCmdLine_MAIN::m_cmdLine

Definition at line 58 of file LineCmd.h.

Referenced by CCmdLine_MAIN, CompatGetCommand, and DoDataExchange.

CEdit CCmdLine_MAIN::m_cmdLineEdit

Definition at line 54 of file LineCmd.h.

Referenced by DoDataExchange, OnSelchangePrevcmd, and OnSetfocusCmdline.

bool CCmdLine_MAIN::m_firstTimeCmdline [private]

Definition at line 84 of file LineCmd.h.

Referenced by CCmdLine_MAIN, and OnSetfocusCmdline.

CString CCmdLine_MAIN::m_folderLoc

Definition at line 59 of file LineCmd.h.

Referenced by CCmdLine_MAIN, CompatGetCommand, and DoDataExchange.

CSmartComboBox CCmdLine_MAIN::m_prevCmdCombo

Definition at line 55 of file LineCmd.h.

Referenced by CCmdLine_MAIN, DoDataExchange, and OnSelchangePrevcmd.

CButton CCmdLine_MAIN::m_selFolder

Definition at line 56 of file LineCmd.h.

Referenced by DoDataExchange, and OnCheckpath.

The documentation for this class was generated from the following files:
  • common/LineCmd.h
  • common/LineCmd.cpp
Generated on Sun Feb 24 01:25:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCmdTarget Class Reference

#include <umain.h>

Inheritance diagram for UCmdTarget:

[legend]
Collaboration diagram for UCmdTarget:

[legend]
List of all members.

Public Types

enum UDispatchInfo {
kUNoDispatchInfo,
kUDispatchHandled = 0x01
}

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UCmdTarget (int widid)
virtual | ~UCmdTarget ()
virtual int | UDispatchMessage (int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo)
dispatch an event using the static message table. More...

int | GetWidID (void) const

Static Public Methods

const URuntimeClass * | rtUCmdTarget (void)

Protected Methods

virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Static Protected Attributes

const URuntimeClass | classUCmdTarget
const UMSGMAP | messageMap

Private Attributes

int | m_widid

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Member Enumeration Documentation

enum UCmdTarget::UDispatchInfo

Enumeration values:
kUNoDispatchInfo
kUDispatchHandled

Definition at line 686 of file umain.h.

Referenced by UDispatchMessage, UEventNotifyMessage, UEventSendMessage, and UEventSendMessageExt.

00687     {
00688         kUNoDispatchInfo,
00689         kUDispatchHandled = 0x01
00690     } UDispatchInfo;

Constructor & Destructor Documentation

UCmdTarget::UCmdTarget ( int widid )

Definition at line 406 of file uevent.cpp.

References CAllTargets::Get, and sAllTargets.

00406                                 : m_widid(widid)
00407 {
00408     std::map<int, UCmdTarget *>::value_type val(widid, this);
00409     sAllTargets.Get().insert(val);
00410 }

UCmdTarget::~UCmdTarget ( ) [virtual]

Definition at line 412 of file uevent.cpp.

References m_widid, and UEventRemoveWidID.

00413 {
00414     UEventRemoveWidID(m_widid);
00415 }

Member Function Documentation

const URuntimeClass * UCmdTarget::_GetBaseClass ( ) [static, protected]

Reimplemented from UObject.

Reimplemented in UMacAppMenu.

Definition at line 144 of file uevent.cpp.

00148 {

const UMSGMAP * UCmdTarget::GetBaseMessageMap ( ) [static, protected]

Reimplemented in UMacAppMenu.

Definition at line 108 of file uevent.cpp.

00109     { return 0L; }

const UMSGMAP * UCmdTarget::GetMessageMap ( ) const [protected, virtual]

Reimplemented in UMacAppMenu.

Definition at line 112 of file uevent.cpp.

References messageMap.

Referenced by UDispatchMessage.

00113     { return &UCmdTarget::messageMap; }

const URuntimeClass * UCmdTarget::GetRuntimeClass ( ) const [virtual]

Reimplemented from UObject.

Reimplemented in UMacAppMenu.

Definition at line 144 of file uevent.cpp.

00148 {

const UMSGMAP * UCmdTarget::GetThisMessageMap ( ) [static, protected]

Reimplemented in UMacAppMenu.

Definition at line 110 of file uevent.cpp.

References messageMap.

00111     { return &UCmdTarget::messageMap; }

int UCmdTarget::GetWidID ( void ) const [inline]

Definition at line 695 of file umain.h.

Referenced by UWidget::AddPage, AskCreatePersistentSettings, UCvsGraph::CalcImageSize, CvsLogParse, UCvsFolders::DeleteAllItems, UCvsFiles::DisableGeneric, USaveSettings::DoDataExchange, UAuthen_Gserver::DoDataExchange, UAuthen_Kserver::DoDataExchange, UAuthen_Rhosts::DoDataExchange, UAuthen_Pserver::DoDataExchange, UAuthen_SSH::DoDataExchange, UEditMessage::DoDataExchange, UPromptMessage::DoDataExchange, UWidget::DoModal, TBrowserFill::ExitDirectory, TBrowserFillDummy::ExitDirectory, UCvsFolders::GetItemByLocation, UWidget::HasFocus, UAuthen_SSH::OnBtnName, UAuthen_SSH::OnBtnRSA, UAuthen_SSH::OnCheckName, UAuthen_SSH::OnCheckOptions, UAuthen_Kserver::OnCheckPort, UAuthen_Rhosts::OnCheckPort, UAuthen_Pserver::OnCheckPort, UAuthen_Pserver::OnCheckProxy, UAuthen_SSH::OnCheckRSA, UAuthen_Rhosts::OnCheckRshName, UAuthen_Rhosts::OnCheckServerName, UCvsFolders::OnCmdAdd, UCvsFiles::OnCmdAdd, UCvsFiles::OnCmdAddb, UCvsFolders::OnCmdCommit, UCvsFiles::OnCmdCommit, UCvsFolders::OnCmdDiff, UCvsFiles::OnCmdDiff, UCvsFolders::OnCmdEdit, UCvsFiles::OnCmdEdit, UCvsFolders::OnCmdEditors, UCvsFiles::OnCmdEditors, UCvsFiles::OnCmdEditsel, UCvsFiles::OnCmdEditseldef, UCvsFolders::OnCmdExplore, UCvsFiles::OnCmdExplore, UCvsFiles::OnCmdGraph, UCvsFolders::OnCmdLock, UCvsFiles::OnCmdLock, UCvsFolders::OnCmdLog, UCvsFiles::OnCmdLog, UCvsFolders::OnCmdMacrosSel, UCvsFolders::OnCmdQueryUpdate, UCvsFiles::OnCmdQueryUpdate, UCvsFolders::OnCmdRelease, UCvsFiles::OnCmdRelease, UCvsFiles::OnCmdRmv, UCvsFolders::OnCmdStatus, UCvsFiles::OnCmdStatus, UCvsFolders::OnCmdTagBranch, UCvsFiles::OnCmdTagBranch, UCvsFolders::OnCmdTagDelete, UCvsFiles::OnCmdTagDelete, UCvsFolders::OnCmdTagNew, UCvsFiles::OnCmdTagNew, UCvsFiles::OnCmdTrash, UCvsFiles::OnCmdUIAdd, UCvsFiles::OnCmdUIAddB, UCvsFiles::OnCmdUIEditseldef, UCvsFolders::OnCmdUIExplore, UCvsFiles::OnCmdUIExplore, UCvsFiles::OnCmdUIGraph, UCvsFiles::OnCmdUIMacroSel, UCvsFolders::OnCmdUIMacrosSel, UCvsFiles::OnCmdUIRelease, UCvsFiles::OnCmdUIRmv, UCvsFiles::OnCmdUITrash, UCvsFiles::OnCmdUIUpdate, UCvsFolders::OnCmdUnedit, UCvsFiles::OnCmdUnedit, UCvsFolders::OnCmdUnlock, UCvsFiles::OnCmdUnlock, UCvsFolders::OnCmdUpdate, UCvsFiles::OnCmdUpdate, UCvsFolders::OnCmdWatchers, UCvsFiles::OnCmdWatchers, UCvsFolders::OnCmdWatchOff, UCvsFiles::OnCmdWatchOff, UCvsFolders::OnCmdWatchOn, UCvsFiles::OnCmdWatchOn, UWidget::OnComboAppend, UToolbar::OnCommands, UMenu::OnCommands, USaveSettings::OnCopyFrom, UCvsGraph::OnCreate, UCvsFiles::OnCreate, UCvsFiles::OnDblClick, TBrowserFill::OnDirectory, TViewFill::OnDirectory, UCvsGraph::OnDrawing, TViewFill::OnFile, CPseudoDlg::OnInitDialog, UWidget::OnInitTabWidget, UWidget::OnInitWidget, UWidget::OnListNewRow, UCvsFiles::OnMacroSel, UWidget::OnPageChanged, CPseudoDraw::OnPaint, UToolbar::OnTbButton, UToolbar::OnTbCheckBtn, UToolbar::OnTbInit, UCvsFolders::OnTreeExpanding, UWidget::OnTreeInsert, UCvsFolders::OnTreeSelecting, UWidget::OnUpdateFocus, UCvsFolders::OnUpdateGeneric, UWidget::OnUpdateUI, UToolbar::OnUpdateUI, UMenu::OnUpdateUI, UMacAppMenu::OnUpdateUI, UCvsFolders::ResetBrowser, UCvsFolders::ResetView, UCvsFiles::ResetView, UCvsFiles::Resort, UCvsFolders::RetrievePath, UCvsFiles::Search, LPseudoWinAttachment::SearchWidID, UCvsFolders::StepToLocation, UCvsFolders::StoreExpanded, UEventGiveTime, UMacAppMenu::UMacAppMenu, UPPMenu::UPPMenu, UWinPseudoWindowProc, WinInitWidgets, and CPseudoDlg::~CPseudoDlg.

00695 { return m_widid; }

const URuntimeClass * UCmdTarget::rtUCmdTarget ( void ) [static]

Definition at line 144 of file uevent.cpp.

00148 {

int UCmdTarget::UDispatchMessage | ( | int | evt,
 |  | int | arg1,
 |  | void * | arg2,
 |  | UDispatchInfo & | dispatchInfo
 | ) | [virtual]

dispatch an event using the static message table.

Reimplemented in UToolbar.

Definition at line 323 of file uevent.cpp.

References epi_i, epi_ii, epi_iVP, epi_V, epi_VP, epV_I, epV_i, epV_ii, epV_iii, epV_iiVP, epV_IVP, epV_iVP, epV_V, epV_VP, EV_NONE, UMSGMAP_ENTRY::ext, UMSGMAP_ENTRY::ext1, UMSGMAP_ENTRY::ext2, GetMessageMap, kUDispatchHandled, UMSGMAP::lpEntries, UMSGMAP_ENTRY::nMessage, UMSGMAP_ENTRY::nSig, UMSGMAP::pBaseMap, UMSGMAP_ENTRY::pfn, UMessageMapFunctions::pfn, UMessageMapFunctions::pfni_i, UMessageMapFunctions::pfni_ii, UMessageMapFunctions::pfni_iVP, UMessageMapFunctions::pfni_V, UMessageMapFunctions::pfni_VP, UMessageMapFunctions::pfnV_i, UMessageMapFunctions::pfnV_ii, UMessageMapFunctions::pfnV_iii, UMessageMapFunctions::pfnV_iiVP, UMessageMapFunctions::pfnV_iVP, UMessageMapFunctions::pfnV_V, UMessageMapFunctions::pfnV_VP, UAppConsole, UDispatchInfo, UHIWORD, ULOWORD, and UMSG_RANGE.

Referenced by UWidget::UDispatchMessage, UEventNotifyMessage, UEventSendMessage, and UEventSendMessageExt.

00324 {
00325     const UMSGMAP* themap;
00326     const UMSGMAP_ENTRY *entries;
00327     for(themap = GetMessageMap(); themap != 0L; themap = themap->pBaseMap)
00328     {
00329         entries = themap->lpEntries;
00330         while(entries->nMessage != EV_NONE)
00331         {
00332             if(entries->ext == UMSG_RANGE)
00333             {
00334                 int cmd = (unsigned short)ULOWORD(arg1);
00335                 if(evt == entries->nMessage &&
00336                     cmd >= entries->ext1 &&
00337                     cmd <= entries->ext2)
00338                         goto dispatch;
00339             }
00340             else if(entries->nMessage == evt)
00341                 goto dispatch;
00342             entries++;
00343         }
00344     }
00345     return 0;
00346
00347 dispatch:
00348     union UMessageMapFunctions mmf;
00349     mmf.pfn = entries->pfn;
00350     int res = 0;
00351
00352     dispatchInfo = UDispatchInfo((int)dispatchInfo | UCmdTarget::kUDispatchHandled);
00353
00354     switch(entries->nSig)
00355     {
00356     case epV_V:
00357         (this->*mmf.pfnV_V)();
00358         break;
00359     case epV_VP:
00360         (this->*mmf.pfnV_VP)(arg2);
00361         break;
00362     case epV_iVP:
00363         (this->*mmf.pfnV_iVP)(arg1, arg2);
00364         break;
00365     case epV_IVP:
00366         (this->*mmf.pfnV_iVP)(UHIWORD(arg1), arg2);
00367         break;
00368     case epV_i:
00369         (this->*mmf.pfnV_i)(arg1);
00370         break;
00371     case epV_I:
00372         (this->*mmf.pfnV_i)(UHIWORD(arg1));
00373         break;
00374     case epV_ii:
00375         (this->*mmf.pfnV_ii)(ULOWORD(arg1), UHIWORD(arg1));
00376         break;
00377     case epV_iii:
00378         (this->*mmf.pfnV_iii)(ULOWORD(arg1), UHIWORD(arg1), (int)arg2);
00379         break;
00380     case epV_iiVP:
00381         (this->*mmf.pfnV_iiVP)(ULOWORD(arg1), UHIWORD(arg1), arg2);
00382         break;
00383     case epi_ii:
00384         res = (this->*mmf.pfni_ii)(ULOWORD(arg1), UHIWORD(arg1));
00385         break;
00386     case epi_i:
00387         res = (this->*mmf.pfni_i)(arg1);
00388         break;
00389     case epi_V:
00390         res = (this->*mmf.pfni_V)();
00391         break;
00392     case epi_iVP:
00393         res = (this->*mmf.pfni_iVP)(arg1, arg2);
00394         break;
00395     case epi_VP:
00396         res = (this->*mmf.pfni_VP)(arg2);
00397         break;
00398     default:
00399         UAppConsole("Unknown event cast : %d\n", entries->nSig);
00400         break;
00401     }
00402
00403     return res;
00404 }

Member Data Documentation

const UMSGMAP_ENTRY UCmdTarget::_messageEntries [static, private]

Initial value:

{
    {EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }
}

Reimplemented in UMacAppMenu.

Definition at line 116 of file uevent.cpp.

const URuntimeClass UCmdTarget::classUCmdTarget [static, protected]

int UCmdTarget::m_widid [private]

Definition at line 697 of file umain.h.

Referenced by ~UCmdTarget.

const UMSGMAP UCmdTarget::messageMap [static, protected]

Initial value:

{ 0L, &UCmdTarget::_messageEntries[0] }

Reimplemented in UMacAppMenu.

Definition at line 114 of file uevent.cpp.

Referenced by GetMessageMap, and GetThisMessageMap.

The documentation for this class was generated from the following files:
  • rf/umain.h
  • rf/uevent.cpp
Generated on Sun Feb 24 01:25:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCmdUI Class Reference

#include <umain.h>

Collaboration diagram for UCmdUI:

[legend]
List of all members.

Public Methods

UCmdUI (int id)
virtual | ~UCmdUI ()
virtual void | Enable (bool bOn=true)
virtual void | Check (bool bOn=true)
virtual void | SetText (const char *title)
void | SetContinue (bool state)
bool | CanContinue (void)
virtual void | SetTooltip (const char *tooltip)

Public Attributes

int | m_nID
CCmdUI * pCmdUI
void * | pNMHDR
void * | m_widget
bool | m_continue

Constructor & Destructor Documentation

UCmdUI::UCmdUI ( int id ) [inline]

Definition at line 707 of file umain.h.

References m_continue, m_nID, m_widget, pCmdUI, pNMHDR, and qMacPP.

00707                    : m_nID(id)
00708 #ifdef WIN32
00709     , pCmdUI(0L)
00710     , pNMHDR(0L)
00711 #endif
00712 #ifdef qMacPP
00713     , m_wrapper(0L)
00714 #endif
00715     , m_widget(0L)
00716     , m_continue(true)
00717         {}

virtual UCmdUI::~UCmdUI ( ) [inline, virtual]

Definition at line 718 of file umain.h.

00718 {}

Member Function Documentation

bool UCmdUI::CanContinue ( void ) [inline]

Definition at line 730 of file umain.h.

References m_continue.

Referenced by LMainPseudoAttachment::ExecuteSelf, UToolbar::OnUpdateUI, UMenu::OnUpdateUI, and UMacAppMenu::OnUpdateUI.

00730 { return m_continue; }

void UCmdUI::Check ( bool bOn = true ) [virtual]

Definition at line 482 of file uevent.cpp.

References m_continue, m_nID, m_widget, pCmdUI, CPseudoToggle::SetState, and UASSERT.

Referenced by UCvsFolders::OnCmdUIIgnore, UCvsFiles::OnCmdUIIgnore, and PyCmdUI::SetCheck.

00483 {
00484     m_continue = false;
00485
00486 #ifdef qMacAPP
00487     if((long)m_widget <= 2L)
00488     {
00489         // this is a menu
00490         if(m_widget == 0L)
00491         {
00492             UASSERT("You need to call UCmdUI::Enable before UCmdUI::Check !\n");
00493         }
00494         else
00495         {
00496             ::EnableCheck(m_nID, m_widget == (void *)1L, bOn);
00497         }
00498     }
00499     else
00500     {
00501         TView *view = (TView *)m_widget;
00502         if(MA_MEMBER(view, TCheckBox))
00503         {
00504             ((TCheckBox *)view)->SetState(bOn, kRedraw);
00505         }
00506         else if(MA_MEMBER(view, TRadio))
00507         {
00508             ((TRadio *)view)->SetState(bOn, kRedraw);
00509         }
00510     }
00511 #endif
00512 #ifdef qMacPP
00513     if(m_wrapper != 0L)
00514     {
00515         // this is a menu
00516         *m_wrapper->outUsesMark = true;
00517         *m_wrapper->outMark = bOn ? checkMark : noMark;
00518     }
00519     else
00520     {
00521         LPane *view = (LPane *)m_widget;
00522         if(dynamic_cast<LCheckBox*>(view) != 0L ||
00523             dynamic_cast<LRadioButton*>(view) != 0L ||
00524             dynamic_cast<LCheckBoxGroupBox*>(view) != 0L ||
00525             dynamic_cast<LBevelButton*>(view) != 0L)
00526         {
00527             USemaphore policeman(gTurnOffBroadcast);
00528
00529             view->SetValue(bOn ? Button_On : Button_Off);
00530         }
00531     }
00532 #endif
00533 #ifdef WIN32
00534     if(pCmdUI != 0L)
00535     {
00536         // this is a menu
00537         pCmdUI->SetCheck(bOn ? 1 : 0);
00538     }
00539     else if(m_widget)
00540     {
00541         CWnd *wnd = (CWnd *)m_widget;
00542         if(wnd->IsKindOf(RUNTIME_CLASS(CPseudoToggle)))
00543         {
00544             CPseudoToggle *btn = (CPseudoToggle *)wnd;
00545             btn->SetState(bOn);
00546         }
00547         else if(wnd->IsKindOf(RUNTIME_CLASS(CButton)))
00548         {
00549             CButton *btn = (CButton *)wnd;
00550             btn->SetCheck(bOn ? BST_CHECKED : BST_UNCHECKED);
00551         }
00552     }
00553 #endif
00554 #ifdef qGTK
00555     if(m_widget != 0L)
00556     {
00557         if(GTK_IS_TOGGLE_BUTTON(m_widget))
00558         {
00559             CTurnOffDispatching turnOff;
00560             gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_widget), bOn);
00561         }
00562     }
00563 #endif
00564 }

void UCmdUI::Enable ( bool bOn = true ) [virtual]

Definition at line 417 of file uevent.cpp.

References m_continue, m_nID, m_widget, and pCmdUI.

Referenced by PyCmdUI::Enable, UCvsFiles::OnCmdUIAdd, UCvsFiles::OnCmdUIAddB, UCvsFrame::OnCmdUIAnytime, UCvsFolders::OnCmdUICheckout, UCvsFrame::OnCmdUICvsCmd, UCvsFiles::OnCmdUIEditseldef, UCvsFolders::OnCmdUIExplore, UCvsFiles::OnCmdUIExplore, UCvsFiles::OnCmdUIGraph, UCvsFolders::OnCmdUIIgnore, UCvsFiles::OnCmdUIIgnore, UCvsFolders::OnCmdUIImport, UCvsFrame::OnCmdUIMacroAdmin, UCvsFiles::OnCmdUIMacroSel, UCvsFolders::OnCmdUIMacrosSel, UCvsFrame::OnCmdUIQuit, UCvsFiles::OnCmdUIRelease, UCvsFolders::OnCmdUIReload, UCvsFiles::OnCmdUIReload, UCvsFiles::OnCmdUIRmv, UCvsFrame::OnCmdUIStopcvs, UCvsFiles::OnCmdUITrash, UCvsFiles::OnCmdUIUpdate, UCvsFiles::OnCmdUIUpone, UCvsFolders::OnUpdateGeneric, UToolbar::OnUpdateUI, UMenu::OnUpdateUI, and UMacAppMenu::OnUpdateUI.

00418 {
00419     m_continue = false;
00420
00421 #ifdef qMacAPP
00422     if((long)m_widget <= 2L)
00423     {
00424         // this is a menu
00425         ::Enable(m_nID, bOn);
00426         m_widget = (void *)(bOn ? 1L : 2L);
00427             // see UCmdUI::Check
00428     }
00429     else
00430     {
00431         TView *view = (TView *)m_widget;
00432         if(MA_MEMBER(view, TView))
00433         {
00434             view->SetActiveState(bOn, kRedraw);
00435         }
00436     }
00437 #endif
00438 #ifdef qMacPP
00439     if(m_wrapper != 0L)
00440     {
00441         // this is a menu
00442         *m_wrapper->outEnabled = bOn;
00443     }
00444     else
00445     {
00446         LPane *view = (LPane *)m_widget;
00447         if(view != 0L)
00448         {
00449             if(bOn)
00450                 view->Enable();
00451             else
00452                 view->Disable();
00453         }
00454     }
00455 #endif
00456 #ifdef WIN32
00457     if(pCmdUI != 0L)
00458     {
00459         // this is a menu
00460         pCmdUI->Enable(bOn);
00461     }
00462     else if(m_widget)
00463     {
00464         // this something else
00465         CWnd *wid = (CWnd *)m_widget;
00466         BOOL state = bOn;
00467         if(state != wid->IsWindowEnabled())
00468             wid->EnableWindow(state);
00469     }
00470 #endif
00471 #ifdef qGTK
00472     if(m_widget != 0L)
00473     {
00474         if(GTK_IS_WIDGET(m_widget))
00475         {
00476             gtk_widget_set_sensitive(GTK_WIDGET(m_widget), bOn);
00477         }
00478     }
00479 #endif
00480 }

void UCmdUI::SetContinue ( bool state ) [inline]

Definition at line 729 of file umain.h.

References m_continue.

00729 { m_continue = state; }

void UCmdUI::SetText ( const char * title ) [virtual]

Definition at line 566 of file uevent.cpp.

References getLabelFromContainer, m_continue, m_nID, m_widget, pCmdUI, and stat.

Referenced by UCvsFiles::OnCmdUIEditseldef, and PyCmdUI::SetText.

00567 {
00568     m_continue = false;
00569
00570 #ifdef qMacAPP
00571     if((long)m_widget <= 2L)
00572     {
00573         // this is a menu
00574         CStr255_AC pstr(title);
00575         SetCommandName(m_nID, pstr);
00576     }
00577     else
00578     {
00579         TCtlMgr *view = (TCtlMgr *)m_widget;
00580         if(MA_MEMBER(view, TCtlMgr))
00581         {
00582             view->SetText(CStr255_AC(title), kRedraw);
00583         }
00584     }
00585 #endif
00586 #ifdef qGTK
00587     if(m_widget != 0L)
00588     {
00589         if(GTK_IS_TOGGLE_BUTTON(m_widget))
00590         {
00591             GtkLabel *label = getLabelFromContainer(GTK_CONTAINER(m_widget));
00592             if(label != 0L)
00593                 gtk_label_set_text(label, title);
00594         }
00595     }
00596 #endif
00597 #ifdef qMacPP
00598     if(m_wrapper != 0L)
00599     {
00600         // this is a menu
00601         LStr255 pstr(title);
00602         LString::CopyPStr(pstr, m_wrapper->outName);
00603     }
00604     else
00605     {
00606         LPane *view = (LPane *)m_widget;
00607         LEditText *edit;
00608         LStaticText *stat;
00609         if((edit = dynamic_cast<LEditText*>(view)) != 0L)
00610         {
00611             edit->SetText((Ptr)title, strlen(title));
00612         }
00613         else if((stat = dynamic_cast<LStaticText*>(view)) != 0L)
00614         {
00615             stat->SetText((Ptr)title, strlen(title));
00616         }
00617     }
00618 #endif
00619 #ifdef WIN32
00620     if(pCmdUI != 0L)
00621     {
00622         // this is a menu
00623         if(title != 0L && *title != '\0')
00624             pCmdUI->SetText(title);
00625     }
00626 #endif
00627 }

void UCmdUI::SetTooltip ( const char * tooltip ) [virtual]

Definition at line 629 of file uevent.cpp.

References ASSERT, pNMHDR, and sTooltipHandler.

Referenced by UWidget::OnSetTooltip, and UToolbar::OnSetTooltip.

00630 {
00631     if(tooltip == 0L)
00632         return;
00633
00634     char status[256] = {'\0'};
00635     char prompt[256] = {'\0'};
00636
00637     strcpy(status, tooltip);
00638     char *cr = strchr(status, '\n');
00639     if(cr != 0L)
00640     {
00641         strcpy(prompt, cr + 1);
00642         *cr = '\0';
00643     }
00644 #ifdef WIN32
00645 #   define _countof(array) (sizeof(array)/sizeof(array[0]))
00646     NMHDR *hdr = (NMHDR *)pNMHDR;
00647     ASSERT(hdr->code == TTN_NEEDTEXTA || hdr->code == TTN_NEEDTEXTW);
00648
00649     TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)hdr;
00650     TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)hdr;
00651 #   ifndef _UNICODE
00652     if (hdr->code == TTN_NEEDTEXTA)
00653         lstrcpyn(pTTTA->szText, prompt, _countof(pTTTA->szText));
00654     else
00655         _mbstowcsz(pTTTW->szText, prompt, _countof(pTTTW->szText));
00656 #   else
00657     if (hdr->code == TTN_NEEDTEXTA)
00658         _wcstombsz(pTTTA->szText, prompt, _countof(pTTTA->szText));
00659     else
00660         lstrcpyn(pTTTW->szText, prompt, _countof(pTTTW->szText));
00661 #   endif
00662 #endif
00663
00664     if(sTooltipHandler != 0L)
00665         sTooltipHandler(status);
00666 }

Member Data Documentation

bool UCmdUI::m_continue

Definition at line 742 of file umain.h.

Referenced by CanContinue, Check, Enable, SetContinue, SetText, and UCmdUI.

int UCmdUI::m_nID

Definition at line 721 of file umain.h.

Referenced by Check, Enable, LMainPseudoAttachment::ExecuteSelf, UWidget::OnUpdateUI, UToolbar::OnUpdateUI, UMenu::OnUpdateUI, UMacAppMenu::OnUpdateUI, PyDoCmdUI, SetText, and UCmdUI.

void* UCmdUI::m_widget

Definition at line 741 of file umain.h.

Referenced by Check, Enable, UWidget::OnUpdateUI, UToolbar::OnUpdateUI, UMenu::OnUpdateUI, SetText, and UCmdUI.

class CCmdUI* UCmdUI::pCmdUI

Definition at line 735 of file umain.h.

Referenced by Check, Enable, CWinCvsBrowser::OnUpdateMacro, CBrowseFileView::OnUpdateMacro, SetText, and UCmdUI.

void* UCmdUI::pNMHDR

Definition at line 736 of file umain.h.

Referenced by SetTooltip, and UCmdUI.

The documentation for this class was generated from the following files:
  • rf/umain.h
  • rf/uevent.cpp
Generated on Sun Feb 24 01:25:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCmdUI Class Reference

Inheritance diagram for CCmdUI:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/CJLibrary/CJToolBar.cpp
Generated on Sun Feb 24 01:25:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCOLOR Struct Reference

#include <UCvsConsole.h>

Collaboration diagram for UCOLOR:

[legend]
List of all members.

Public Methods

UCOLOR ()
UCOLOR (char _r, char _g, char _b)

Public Attributes

unsigned char | r
unsigned char | g
unsigned char | b

Constructor & Destructor Documentation

UCOLOR::UCOLOR ( ) [inline]

Definition at line 33 of file UCvsConsole.h.

00033 {}

UCOLOR::UCOLOR | ( | char | _r,
 |  | char | _g,
 |  | char | _b
 | ) | [inline]

Definition at line 34 of file UCvsConsole.h.

References b, g, and r.

00034 : r(_r), g(_g), b(_b) {}

Member Data Documentation

unsigned char UCOLOR::b

Definition at line 38 of file UCvsConsole.h.

Referenced by UCvsConsole::FeedThisLine, and UCOLOR.

unsigned char UCOLOR::g

Definition at line 37 of file UCvsConsole.h.

Referenced by UCvsConsole::FeedThisLine, and UCOLOR.

unsigned char UCOLOR::r

Definition at line 36 of file UCvsConsole.h.

Referenced by UCvsConsole::FeedThisLine, and UCOLOR.

The documentation for this struct was generated from the following file:
  • common/UCvsConsole.h
Generated on Sun Feb 24 01:25:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UColor Struct Reference

portable color definition. More...

#include <uwidget.h>

Collaboration diagram for UColor:

[legend]
List of all members.

Public Attributes

unsigned char | r
unsigned char | g
unsigned char | b

Detailed Description

portable color definition.

Definition at line 82 of file uwidget.h.

Member Data Documentation

unsigned char UColor::b

Definition at line 84 of file uwidget.h.

unsigned char UColor::g

Definition at line 84 of file uwidget.h.

unsigned char UColor::r

Definition at line 84 of file uwidget.h.

The documentation for this struct was generated from the following file:
  • rf/uwidget.h
Generated on Sun Feb 24 01:25:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CColorConsole Class Reference

#include <AppConsole.h>

Collaboration diagram for CColorConsole:

[legend]
List of all members.

Public Methods

CColorConsole ()
virtual | ~CColorConsole ()
CColorConsole & | operator<< (char c)
CColorConsole & | operator<< (kConsoleColor color)
CColorConsole & | operator<< (const char *str)
CColorConsole & | operator<< (int value)
CColorConsole (CWincvsView *aview)

Protected Methods

CWincvsView * GetView ()

Protected Attributes

CWincvsView * fView
CHARFORMAT oldFormat

Constructor & Destructor Documentation

CColorConsole::CColorConsole ( )

Definition at line 195 of file AppConsole.cpp.

References fView, CWincvsView::GetCurFormat, GetView, kNormal, and oldFormat.

Referenced by cvs_out.

00196 {
00197 #ifdef WIN32
00198     fView = 0L;
00199     CWincvsView *view = GetView();
00200     if(view == 0L)
00201         return;
00202
00203     oldFormat = view->GetCurFormat();
00204 #else /* !WIN32 */
00205     *this << kNormal;
00206 #endif /* !WIN32 */
00207 }

CColorConsole::~CColorConsole ( ) [virtual]

Definition at line 221 of file AppConsole.cpp.

References kNormal.

Referenced by cvs_out.

00222 {
00223     *this << kNormal;
00224 }

CColorConsole::CColorConsole ( CWincvsView * aview )

Definition at line 210 of file AppConsole.cpp.

References fView, CWincvsView::GetCurFormat, GetView, and oldFormat.

00211 {
00212     fView = aview;
00213     CWincvsView *view = GetView();
00214     if(view == 0L)
00215         return;
00216
00217     oldFormat = view->GetCurFormat();
00218 }

Member Function Documentation

CWincvsView * CColorConsole::GetView ( ) [protected]

Definition at line 185 of file AppConsole.cpp.

References fView.

Referenced by CColorConsole, and operator<<.

00186 {
00187     CWinApp* app = AfxGetApp();
00188     CWincvsView *view = fView != 0L ? fView : ((CWincvsApp *)app)->GetConsoleView();
00189     if(view && view->m_hWnd == 0L)
00190         view = 0L;
00191     return view;
00192 }

CColorConsole & CColorConsole::operator<< ( int value )

Definition at line 330 of file AppConsole.cpp.

References GetView, UCvsConsole::OutColor, and CWincvsView::OutColor.

00331 {
00332 #ifdef WIN32
00333     CWincvsView *view = GetView();
00334     if(view == 0L)
00335         return *this;
00336
00337     char tmp[20] = {'\0'};
00338     sprintf(tmp, "%d", value);
00339     view->OutColor(tmp, strlen(tmp));
00340 #endif /* WIN32 */
00341 #ifdef qMacCvsPP
00342     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00343     if(log == 0L)
00344         return *this;
00345
00346     char tmp[20] = {'\0'};
00347     sprintf(tmp, "%d", value);
00348     log->OutColor(tmp, strlen(tmp));
00349 #endif /* qMacCvsPP */
00350 #ifdef qUnix
00351     UCvsConsole *log = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00352     if(log == 0L)
00353         return *this;
00354
00355     char tmp[20] = {'\0'};
00356     sprintf(tmp, "%d", value);
00357     log->OutColor(tmp, strlen(tmp));
00358 #endif /* qUnix */
00359
00360     return *this;
00361 }

CColorConsole & CColorConsole::operator<< ( const char * str )

Definition at line 303 of file AppConsole.cpp.

References GetView, UCvsConsole::OutColor, and CWincvsView::OutColor.

00304 {
00305 #ifdef WIN32
00306     CWincvsView *view = GetView();
00307     if(view == 0L)
00308         return *this;
00309
00310     view->OutColor(str, strlen(str));
00311 #endif /* WIN32 */
00312 #ifdef qMacCvsPP
00313     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00314     if(log == 0L)
00315         return *this;
00316
00317     log->OutColor(str, strlen(str));
00318 #endif /* qMacCvsPP */
00319 #ifdef qUnix
00320     UCvsConsole *log = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00321     if(log == 0L)
00322         return *this;
00323
00324     log->OutColor(str, strlen(str));
00325 #endif /* qUnix */
00326
00327     return *this;
00328 }

CColorConsole & CColorConsole::operator<< ( kConsoleColor color )

Definition at line 253 of file AppConsole.cpp.

References GetView, kConsoleColor, kNL, kNormal, oldFormat, UCvsConsole::OutColor, and CWincvsView::OutColor.

00254 {
00255 #ifdef WIN32
00256     CWincvsView *view = GetView();
00257     if(view == 0L)
00258         return *this;
00259
00260     if(color == kNL)
00261     {
00262         char tmp[2] = {0x0a};
00263         view->OutColor(tmp, 1);
00264     }
00265     else if(color == kNormal)
00266     {
00267         oldFormat.dwMask = CFM_COLOR | CFM_BOLD | CFM_ITALIC | CFE_UNDERLINE;
00268         view->OutColor(oldFormat);
00269     }
00270     else
00271         view->OutColor(color);
00272 #endif /* WIN32 */
00273 #ifdef qMacCvsPP
00274     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00275     if(log == 0L)
00276         return *this;
00277
00278     if(color == kNL)
00279     {
00280         char tmp[1] = {0x0d};
00281         log->OutColor(tmp, 1);
00282     }
00283     else
00284         log->OutColor(color);
00285 #endif /* qMacCvsPP */
00286 #ifdef qUnix
00287     UCvsConsole *log = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00288     if(log == 0L)
00289         return *this;
00290
00291     if(color == kNL)
00292     {
00293         char tmp[1] = {0x0a};
00294         log->OutColor(tmp, 1);
00295     }
00296     else
00297         log->OutColor(color);
00298 #endif /* qUnix */
00299
00300     return *this;
00301 }

CColorConsole & CColorConsole::operator<< ( char c )

Definition at line 226 of file AppConsole.cpp.

References GetView, UCvsConsole::OutColor, and CWincvsView::OutColor.

Referenced by cvs_out.

00227 {
00228 #ifdef WIN32
00229     CWincvsView *view = GetView();
00230     if(view == 0L)
00231         return *this;
00232
00233     view->OutColor(&c, 1);
00234 #endif /* WIN32 */
00235 #ifdef qMacCvsPP
00236     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00237     if(log == 0L)
00238         return *this;
00239
00240     log->OutColor(&c, 1);
00241 #endif /* qMacCvsPP */
00242 #ifdef qUnix
00243     UCvsConsole *log = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00244     if(log == 0L)
00245         return *this;
00246
00247     log->OutColor(&c, 1);
00248 #endif /* qUnix */
00249
00250     return *this;
00251 }

Member Data Documentation

CWincvsView* CColorConsole::fView [protected]

Definition at line 65 of file AppConsole.h.

Referenced by CColorConsole, and GetView.

CHARFORMAT CColorConsole::oldFormat [protected]

Definition at line 67 of file AppConsole.h.

Referenced by CColorConsole, and operator<<.

The documentation for this class was generated from the following files:
  • common/AppConsole.h
  • common/AppConsole.cpp
Generated on Sun Feb 24 01:25:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CColorMenu Class Reference

Inheritance diagram for CColorMenu:

[legend]
Collaboration diagram for CColorMenu:

[legend]
List of all members.

Public Methods

void | AppendColorMenuItem (UINT nID, awidget *what)
virtual void | MeasureItem (LPMEASUREITEMSTRUCT lpMIS)
virtual void | DrawItem (LPDRAWITEMSTRUCT lpDIS)
CColorMenu (int width, int height)
virtual | ~CColorMenu ()

Public Attributes

int | m_width
int | m_height

Constructor & Destructor Documentation

CColorMenu::CColorMenu | ( | int | width,
 |  | int | height
 | ) |

Definition at line 304 of file utoolbar.cpp.

References VERIFY.

00304                                             : m_width(width), m_height(height)
00305 {
00306     VERIFY(CreatePopupMenu());
00307 }

CColorMenu::~CColorMenu ( ) [virtual]

Definition at line 309 of file utoolbar.cpp.

00310 {
00311 }

Member Function Documentation

void CColorMenu::AppendColorMenuItem | ( | UINT | nID,
 |  | awidget * | what
 | ) |

Definition at line 313 of file utoolbar.cpp.

References AppendMenu, and VERIFY.

Referenced by CDynToolBar::OnDropDownButton.

00314 {
00315     VERIFY(AppendMenu(MF_ENABLED | MF_OWNERDRAW, nID, (LPCTSTR)what));
00316 }

void CColorMenu::DrawItem ( LPDRAWITEMSTRUCT lpDIS ) [virtual]

Definition at line 325 of file utoolbar.cpp.

References awidget::bitmap, m_height, m_width, and VERIFY.

00326 {
00327     CDC* pDC = CDC::FromHandle(lpDIS->hDC);
00328     awidget *what = (awidget *)lpDIS->itemData;
00329
00330     if (!(lpDIS->itemState & ODS_SELECTED) &&
00331         (lpDIS->itemAction & ODA_SELECT))
00332     {
00333         COLORREF crHilite = ::GetSysColor(COLOR_MENU);
00334         CBrush br(crHilite);
00335         CRect r(lpDIS->rcItem);
00336         r.DeflateRect(1, 1);
00337         pDC->FrameRect(&r, &br);
00338     }
00339
00340     if (lpDIS->itemAction & ODA_DRAWENTIRE)
00341     {
00342         // Paint the color item in the color requested
00343         CRect r(lpDIS->rcItem);
00344         r.OffsetRect((r.Width() - m_width) / 2, (r.Height() - m_height) / 2);
00345         CDC memdc;
00346         memdc.CreateCompatibleDC(pDC);
00347         CBitmap bmap;
00348         VERIFY(bmap.Attach(what->bitmap));
00349         CBitmap *old = memdc.SelectObject(&bmap);
00350         pDC->BitBlt(r.left, r.top, r.Width(), r.Height(), &memdc, 0, 0, SRCCOPY);
00351         memdc.SelectObject(old);
00352         bmap.Detach();
00353         VERIFY(memdc.DeleteDC());
00354     }
00355
00356     if ((lpDIS->itemState & ODS_SELECTED) &&
00357         (lpDIS->itemAction & (ODA_SELECT | ODA_DRAWENTIRE)))
00358     {
00359         // item has been selected - hilite frame
00360         COLORREF crHilite = ::GetSysColor(COLOR_HIGHLIGHT);
00361         CBrush br(crHilite);
00362         CRect r(lpDIS->rcItem);
00363         r.DeflateRect(1, 1);
00364         pDC->FrameRect(&r, &br);
00365     }
00366 }

void CColorMenu::MeasureItem ( LPMEASUREITEMSTRUCT lpMIS ) [virtual]

Definition at line 318 of file utoolbar.cpp.

References m_height, and m_width.

00319 {
00320     // all items are of fixed size
00321     lpMIS->itemWidth = m_width + 4;
00322     lpMIS->itemHeight = m_height + 4;
00323 }

Member Data Documentation

int CColorMenu::m_height

Definition at line 301 of file utoolbar.cpp.

Referenced by DrawItem, and MeasureItem.

int CColorMenu::m_width

Definition at line 300 of file utoolbar.cpp.

Referenced by DrawItem, and MeasureItem.

The documentation for this class was generated from the following file:
  • rf/utoolbar.cpp
Generated on Sun Feb 24 01:25:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CColorStatic Class Reference

#include <ColorStatic.h>

Inheritance diagram for CColorStatic:

[legend]
Collaboration diagram for CColorStatic:

[legend]
List of all members.

Public Methods

CColorStatic ()
COLORREF | GetColor ()
void | SetColor (COLORREF color)
virtual | ~CColorStatic ()

Protected Methods

afx_msg void | OnPaint ()

Private Attributes

COLORREF | m_color

Constructor & Destructor Documentation

CColorStatic::CColorStatic ( )

Definition at line 38 of file ColorStatic.cpp.

References m_color.

00039 {
00040     m_color = RGB(255, 255, 255);
00041 }

CColorStatic::~CColorStatic ( ) [virtual]

Definition at line 43 of file ColorStatic.cpp.

00044 {
00045 }

Member Function Documentation

COLORREF CColorStatic::GetColor ( )

Definition at line 66 of file ColorStatic.cpp.

References m_color.

Referenced by CGraphOptDlg::GetAllColors, and CGraphOptDlg::PromptForColor.

00067 {
00068     return m_color;
00069 }

void CColorStatic::OnPaint ( ) [protected]

Definition at line 71 of file ColorStatic.cpp.

References m_color.

00072 {
00073     CPaintDC dc(this); // device context for painting
00074
00075     CRect rect;
00076     GetClientRect(rect);
00077     dc.FillSolidRect(rect, m_color);
00078
00079     // Do not call CStatic::OnPaint() for painting messages
00080 }

void CColorStatic::SetColor ( COLORREF color )

Definition at line 57 of file ColorStatic.cpp.

References m_color.

Referenced by CGraphOptDlg::CGraphOptDlg, CGraphOptDlg::OnReset, and CGraphOptDlg::PromptForColor.

00058 {
00059     m_color = color;
00060     if( IsWindow(m_hWnd) )
00061     {
00062         RedrawWindow();
00063     }
00064 }

Member Data Documentation

COLORREF CColorStatic::m_color [private]

Definition at line 68 of file ColorStatic.h.

Referenced by CColorStatic, GetColor, OnPaint, and SetColor.

The documentation for this class was generated from the following files:
  • WinCvs/ColorStatic.h
  • WinCvs/ColorStatic.cpp
Generated on Sun Feb 24 01:25:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CComboBox Class Reference

Inheritance diagram for CComboBox:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJFlatComboBox.h
Generated on Sun Feb 24 01:25:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CComboBoxEx Class Reference

Inheritance diagram for CComboBoxEx:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/HistComboBoxEx.h
Generated on Sun Feb 24 01:25:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CComCoClass Class Reference

Inheritance diagram for CComCoClass:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CoWorker/CvsCoworker.h
Generated on Sun Feb 24 01:25:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCommit_MAIN Class Reference

#include <CommitDlg.h>

Inheritance diagram for CCommit_MAIN:

[legend]
Collaboration diagram for CCommit_MAIN:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_COMMIT_MAIN }

Public Methods

CCommit_MAIN ()
CCommit_MAIN (const char *logMsg, const char *pathTmpl=0L, MultiFiles *mf=0L)
~CCommit_MAIN ()
virtual BOOL | PreTranslateMessage (MSG *pMsg)

Public Attributes

CButton m_previewInfo
CSmartComboBox m_fileToDiffCombo
CButton m_wordWrapCtrl
CEdit m_logMsgCtrlWrap
CEdit m_logMsgCtrl
CSmartComboBox m_prevLogsCombo
CString | m_logMsg
BOOL | m_wordWrap
UStr m_tmplPath
MultiFiles * m_pmfarg

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnSelchangeCombo ()
afx_msg void | OnLauncheditor ()
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)
afx_msg void | OnWordwrap ()
virtual BOOL | OnInitDialog ()
afx_msg void | OnDiff ()
afx_msg void | OnSelchangeFiletodiff ()
afx_msg void | OnTemplate ()

Private Methods

void | UpdateInfo ()
void | UpdatePreviewInfo ()
void | SwitchWrapEdit (BOOL bWordWrap)
Switch the edit wrap and non-wrap edit boxes. More...

int | GetLogMsgID ()
CWnd * GetLogMsgWnd ()

Private Attributes

BOOL | m_bSwitchingWrap

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 63 of file CommitDlg.h.

00063 { IDD = IDD_COMMIT_MAIN };

Constructor & Destructor Documentation

CCommit_MAIN::CCommit_MAIN ( )

Definition at line 98 of file CommitDlg.cpp.

00098                            : CPropertyPage(CCommit_MAIN::IDD)
00099 {
00100 }

CCommit_MAIN::CCommit_MAIN | ( | const char * | logMsg,
 |  | const char * | pathTmpl = 0L,
 |  | MultiFiles * | mf = 0L
 | ) |

Definition at line 102 of file CommitDlg.cpp.

References UStr::empty, UStr::endsWith, FALSE, m_bSwitchingWrap, m_logMsg, m_pmfarg, m_prevLogsCombo, m_tmplPath, m_wordWrap, and USmartCombo::SetItems.

00103     : m_fileToDiffCombo(USmartCombo::AutoDropWidth | USmartCombo::ReadOnly),
00104     CPropertyPage(CCommit_MAIN::IDD)
00105 {
00106     //{{AFX_DATA_INIT(CCommit_MAIN)
00107     m_logMsg = logMsg;
00108     m_wordWrap = FALSE;
00109     //}}AFX_DATA_INIT
00110
00111     m_tmplPath = pathTmpl;
00112     if(!m_tmplPath.empty())
00113     {
00114         if(!m_tmplPath.endsWith(kPathDelimiter))
00115             m_tmplPath << kPathDelimiter;
00116         m_tmplPath << "CVS";
00117         m_tmplPath << kPathDelimiter;
00118         m_tmplPath << "Template";
00119     }
00120     m_pmfarg = mf;
00121
00122     m_bSwitchingWrap = FALSE;
00123     m_wordWrap = gCvsPrefs.WordWrapLogMsg();
00124
00125     m_prevLogsCombo.SetItems(&gCommitLogs);
00126 }

CCommit_MAIN::~CCommit_MAIN ( )

Definition at line 128 of file CommitDlg.cpp.

00129 {
00130 }

Member Function Documentation

void CCommit_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 132 of file CommitDlg.cpp.

References DDX_ComboMString, GetLogMsgID, IDC_COMBO, IDC_FILETODIFF, IDC_LOGMSG, IDC_LOGMSG_WRAP, IDC_PREVIEWINFO, IDC_WORDWRAP, TMString< UStr >::Insert, m_fileToDiffCombo, m_logMsg, m_logMsgCtrl, m_logMsgCtrlWrap, m_previewInfo, m_prevLogsCombo, m_wordWrap, and m_wordWrapCtrl.

00133 {
00134     CPropertyPage::DoDataExchange(pDX);
00135     //{{AFX_DATA_MAP(CCommit_MAIN)
00136     DDX_Control(pDX, IDC_PREVIEWINFO, m_previewInfo);
00137     DDX_Control(pDX, IDC_FILETODIFF, m_fileToDiffCombo);
00138     DDX_Control(pDX, IDC_WORDWRAP, m_wordWrapCtrl);
00139     DDX_Control(pDX, IDC_LOGMSG_WRAP, m_logMsgCtrlWrap);
00140     DDX_Control(pDX, IDC_LOGMSG, m_logMsgCtrl);
00141     DDX_Control(pDX, IDC_COMBO, m_prevLogsCombo);
00142     DDX_Check(pDX, IDC_WORDWRAP, m_wordWrap);
00143     //}}AFX_DATA_MAP
00144
00145     if( !pDX->m_bSaveAndValidate )
00146     {
00147         DDX_Text(pDX, IDC_LOGMSG_WRAP, m_logMsg);
00148         DDX_Text(pDX, IDC_LOGMSG, m_logMsg);
00149     }
00150     else
00151     {
00152         DDX_Text(pDX, GetLogMsgID(), m_logMsg);
00153     }
00154
00155     if( pDX->m_bSaveAndValidate )
00156     {
00157         if( !m_logMsg.IsEmpty() )
00158         {
00159             gCommitLogs.Insert(m_logMsg);
00160         }
00161     }
00162     else
00163     {
00164         DDX_ComboMString(pDX, IDC_COMBO, m_prevLogsCombo);
00165     }
00166 }

int CCommit_MAIN::GetLogMsgID ( ) [private]

Definition at line 299 of file CommitDlg.cpp.

References IDC_LOGMSG, IDC_LOGMSG_WRAP, and m_wordWrapCtrl.

Referenced by DoDataExchange, and GetLogMsgWnd.

00300 {
00301     return m_wordWrapCtrl.GetCheck() ? IDC_LOGMSG_WRAP : IDC_LOGMSG;
00302 }

CWnd * CCommit_MAIN::GetLogMsgWnd ( ) [private]

Definition at line 304 of file CommitDlg.cpp.

References GetLogMsgID.

Referenced by OnLauncheditor, OnSelchangeCombo, OnTemplate, and UpdateInfo.

00305 {
00306     return GetDlgItem( GetLogMsgID() );
00307 }

void CCommit_MAIN::OnDiff ( ) [protected]

Definition at line 325 of file CommitDlg.cpp.

References CStr, CvsCmdDiffFiles, MultiFiles::get, m_fileToDiffCombo, m_pmfarg, MultiFiles::newdir, and MultiFiles::newfile.

00326 {
00327     const int nComboIndex = m_fileToDiffCombo.GetCurSel();
00328     if( nComboIndex > CB_ERR )
00329     {
00330         int nIndex = (int)m_fileToDiffCombo.GetItemData(nComboIndex);
00331         CStr path;
00332         CStr fileName;
00333         if( m_pmfarg->get(nIndex, path, fileName) )
00334         {
00335             MultiFiles mf;
00336             mf.newdir(path);
00337             mf.newfile(fileName);
00338
00339             CvsCmdDiffFiles(&mf);
00340         }
00341     }
00342 }

BOOL CCommit_MAIN::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 309 of file CommitDlg.cpp.

References TRUE.

00310 {
00311     if( m_bSwitchingWrap )
00312     {
00313         return TRUE;
00314     }
00315
00316     return CPropertyPage::OnEraseBkgnd(pDC);
00317 }

BOOL CCommit_MAIN::OnInitDialog ( ) [protected, virtual]

Definition at line 344 of file CommitDlg.cpp.

References CStr, FALSE, MultiFiles::get, IDC_DIFF, IDC_TEMPLATE, m_fileToDiffCombo, m_pmfarg, m_tmplPath, NULL, MultiFiles::NumFiles, SwitchWrapEdit, TRUE, and UpdatePreviewInfo.

00345 {
00346     CPropertyPage::OnInitDialog();
00347
00348     // Extra initialization here
00349     SwitchWrapEdit( gCvsPrefs.WordWrapLogMsg() );
00350     if( m_pmfarg )
00351     {
00352         for( int nIndex = 0; nIndex < m_pmfarg->NumFiles(); nIndex++ )
00353         {
00354             CStr path;
00355             CStr fileName;
00356             m_pmfarg->get(nIndex, path, fileName);
00357             int nComboIndex = m_fileToDiffCombo.AddString(CString(path) + CString(fileName));
00358             m_fileToDiffCombo.SetItemData(nComboIndex, (DWORD)nIndex);
00359         }
00360     }
00361
00362     if( m_fileToDiffCombo.GetCount() )
00363     {
00364         m_fileToDiffCombo.SetCurSel(0);
00365     }
00366     else
00367     {
00368         m_fileToDiffCombo.EnableWindow(FALSE);
00369         CWnd* pButton = GetDlgItem(IDC_DIFF);
00370         if( pButton )
00371         {
00372             pButton->EnableWindow(FALSE);
00373         }
00374     }
00375
00376     //enable template button
00377     {
00378         CWnd* pTemplateButton = GetDlgItem(IDC_TEMPLATE);
00379         if( pTemplateButton )
00380         {
00381             FILE* templateFile = fopen(m_tmplPath, "r");
00382             pTemplateButton->EnableWindow(NULL != templateFile);
00383             if( templateFile )
00384             {
00385                 fclose(templateFile);
00386             }
00387         }
00388     }
00389
00390     UpdatePreviewInfo();
00391
00392     return TRUE;  // return TRUE unless you set the focus to a control
00393                   // EXCEPTION: OCX Property Pages should return FALSE
00394 }

void CCommit_MAIN::OnLauncheditor ( ) [protected]

Definition at line 252 of file CommitDlg.cpp.

References CompatGetEditorMsg, and GetLogMsgWnd.

00253 {
00254     UStr message;
00255
00256     if( CompatGetEditorMsg(message) )
00257     {
00258         CString strMessage(message);
00259         strMessage.Replace("\n", "\r\n");
00260
00261         if( !strMessage.IsEmpty() )
00262         {
00263             CEdit* pEdit = (CEdit*)GetLogMsgWnd();
00264             pEdit->SetSel(0, -1);
00265             pEdit->ReplaceSel(strMessage);
00266         }
00267     }
00268
00269     GotoDlgCtrl( GetLogMsgWnd() );
00270 }

void CCommit_MAIN::OnSelchangeCombo ( ) [protected]

Definition at line 168 of file CommitDlg.cpp.

References TMString< UStr >::GetList, GetLogMsgWnd, m_prevLogsCombo, and NAMESPACE.

00169 {
00170     int sel = m_prevLogsCombo.GetCurSel();
00171     if( sel == CB_ERR )
00172         return;
00173
00174     CEdit* pEdit = (CEdit*)GetLogMsgWnd();
00175     pEdit->SetSel(0, -1);
00176
00177     const NAMESPACE(std) vector<CStr> & list = gCommitLogs.GetList();
00178     pEdit->ReplaceSel(list[sel]);
00179 }

void CCommit_MAIN::OnSelchangeFiletodiff ( ) [protected]

Definition at line 247 of file CommitDlg.cpp.

References UpdatePreviewInfo.

00248 {
00249     UpdatePreviewInfo();
00250 }

void CCommit_MAIN::OnTemplate ( ) [protected]

Definition at line 396 of file CommitDlg.cpp.

References UStr::empty, free, getline, GetLogMsgWnd, and m_tmplPath.

00397 {
00398     CEdit* pEdit = (CEdit*)GetLogMsgWnd();
00399     pEdit->SetSel(0, -1);
00400
00401     bool gotIt = false;
00402     FILE* output;
00403
00404     if( !m_tmplPath.empty() && (output = fopen(m_tmplPath, "r")) != 0L )
00405     {
00406         char *line = 0L;
00407         size_t line_chars_allocated = 0;
00408         int line_length;
00409         while ((line_length = getline (&line, &line_chars_allocated, output)) > 0)
00410         {
00411             //correct the new line characters for edit box and insert the line
00412             CString strLine(line);
00413             strLine.Replace( "\n", "\r\n" );
00414             pEdit->ReplaceSel(strLine);
00415         }
00416
00417         gotIt = true;
00418         if (line_length < 0 && !feof (output))
00419             gotIt = false;
00420
00421         if(line != 0L)
00422             free (line);
00423
00424         fclose(output);
00425     }
00426
00427     if( !gotIt )
00428     {
00429         pEdit->ReplaceSel("*CVS/Template file not found*");
00430     }
00431 }

void CCommit_MAIN::OnWordwrap ( ) [protected]

Definition at line 319 of file CommitDlg.cpp.

References m_wordWrapCtrl, and SwitchWrapEdit.

00320 {
00321     gCvsPrefs.SetWordWrapLogMsg(m_wordWrapCtrl.GetCheck());
00322     SwitchWrapEdit(gCvsPrefs.WordWrapLogMsg());
00323 }

BOOL CCommit_MAIN::PreTranslateMessage ( MSG * pMsg ) [virtual]

Definition at line 193 of file CommitDlg.cpp.

References UpdateInfo.

00194 {
00195     if( pMsg->message >= WM_KEYFIRST ||
00196         pMsg->message <= WM_KEYLAST ||
00197         pMsg->message == WM_COPY || pMsg->message == WM_CUT || pMsg->message == WM_PASTE )
00198     {
00199         UpdateInfo();
00200     }
00201
00202     //dialog can be dismissed by Esc key
00203     if( pMsg->message == WM_KEYDOWN &&
00204         (int)pMsg->wParam == VK_ESCAPE )
00205     {
00206         EndDialog(IDCANCEL);
00207     }
00208
00209     return CPropertyPage::PreTranslateMessage(pMsg);
00210 }

void CCommit_MAIN::SwitchWrapEdit ( BOOL bWordWrap ) [private]

Switch the edit wrap and non-wrap edit boxes.

Definition at line 273 of file CommitDlg.cpp.

References FALSE, m_bSwitchingWrap, m_logMsgCtrl, m_logMsgCtrlWrap, and TRUE.

Referenced by OnInitDialog, and OnWordwrap.

00274 {
00275     CString strMessage;
00276
00277     if( bWordWrap )
00278     {
00279         m_logMsgCtrl.GetWindowText(strMessage);
00280         m_logMsgCtrlWrap.SetWindowText(strMessage);
00281
00282         m_bSwitchingWrap = TRUE;
00283         m_logMsgCtrl.ShowWindow(SW_HIDE);
00284         m_logMsgCtrlWrap.ShowWindow(SW_SHOW);
00285         m_bSwitchingWrap = FALSE;
00286     }
00287     else
00288     {
00289         m_logMsgCtrlWrap.GetWindowText(strMessage);
00290         m_logMsgCtrl.SetWindowText(strMessage);
00291
00292         m_bSwitchingWrap = TRUE;
00293         m_logMsgCtrlWrap.ShowWindow(SW_HIDE);
00294         m_logMsgCtrl.ShowWindow(SW_SHOW);
00295         m_bSwitchingWrap = FALSE;
00296     }
00297 }

void CCommit_MAIN::UpdateInfo ( ) [private]

Definition at line 212 of file CommitDlg.cpp.

References GetLogMsgWnd, and IDC_EDIT_POSITION.

Referenced by PreTranslateMessage.

00213 {
00214     CEdit* pEdit = (CEdit*)GetLogMsgWnd();
00215
00216     CString strOldInfo;
00217     CString strInfo;
00218     int nLineNumber = pEdit->LineFromChar();
00219     int nLineLenght = pEdit->LineLength( pEdit->LineIndex() );
00220
00221     strInfo.Format( "Line %d (%d chars)", nLineNumber + 1, nLineLenght );
00222
00223     GetDlgItemText( IDC_EDIT_POSITION, strOldInfo );
00224     if( strOldInfo != strInfo )
00225     {
00226         SetDlgItemText( IDC_EDIT_POSITION, strInfo );
00227     }
00228 }

void CCommit_MAIN::UpdatePreviewInfo ( ) [private]

Definition at line 230 of file CommitDlg.cpp.

References m_fileToDiffCombo, and m_previewInfo.

Referenced by OnInitDialog, and OnSelchangeFiletodiff.

00231 {
00232     CString strPreviewInfo;
00233     int nSelInfo = m_fileToDiffCombo.GetCurSel();
00234     if( nSelInfo < 0 || !m_fileToDiffCombo.GetCount() )
00235     {
00236         nSelInfo = 0;
00237     }
00238     else
00239     {
00240         nSelInfo++;
00241     }
00242
00243     strPreviewInfo.Format("Preview file changes (%d/%d):", nSelInfo, m_fileToDiffCombo.GetCount());
00244     m_previewInfo.SetWindowText(strPreviewInfo);
00245 }

Member Data Documentation

BOOL CCommit_MAIN::m_bSwitchingWrap [private]

Definition at line 108 of file CommitDlg.h.

Referenced by CCommit_MAIN, and SwitchWrapEdit.

CSmartComboBox CCommit_MAIN::m_fileToDiffCombo

Definition at line 65 of file CommitDlg.h.

Referenced by DoDataExchange, OnDiff, OnInitDialog, and UpdatePreviewInfo.

CString CCommit_MAIN::m_logMsg

Definition at line 70 of file CommitDlg.h.

Referenced by CCommit_MAIN, CompatGetCommit, and DoDataExchange.

CEdit CCommit_MAIN::m_logMsgCtrl

Definition at line 68 of file CommitDlg.h.

Referenced by DoDataExchange, and SwitchWrapEdit.

CEdit CCommit_MAIN::m_logMsgCtrlWrap

Definition at line 67 of file CommitDlg.h.

Referenced by DoDataExchange, and SwitchWrapEdit.

MultiFiles* CCommit_MAIN::m_pmfarg

Definition at line 75 of file CommitDlg.h.

Referenced by CCommit_MAIN, OnDiff, and OnInitDialog.

CButton CCommit_MAIN::m_previewInfo

Definition at line 64 of file CommitDlg.h.

Referenced by DoDataExchange, and UpdatePreviewInfo.

CSmartComboBox CCommit_MAIN::m_prevLogsCombo

Definition at line 69 of file CommitDlg.h.

Referenced by CCommit_MAIN, DoDataExchange, and OnSelchangeCombo.

UStr CCommit_MAIN::m_tmplPath

Definition at line 74 of file CommitDlg.h.

Referenced by CCommit_MAIN, OnInitDialog, and OnTemplate.

BOOL CCommit_MAIN::m_wordWrap

Definition at line 71 of file CommitDlg.h.

Referenced by CCommit_MAIN, and DoDataExchange.

CButton CCommit_MAIN::m_wordWrapCtrl

Definition at line 66 of file CommitDlg.h.

Referenced by DoDataExchange, GetLogMsgID, and OnWordwrap.

The documentation for this class was generated from the following files:
  • common/CommitDlg.h
  • common/CommitDlg.cpp
Generated on Sun Feb 24 01:25:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCommit_OPTIONS Class Reference

#include <CommitDlg.h>

Inheritance diagram for CCommit_OPTIONS:

[legend]
Collaboration diagram for CCommit_OPTIONS:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_COMMIT_OPTIONS }

Public Methods

CCommit_OPTIONS ()
~CCommit_OPTIONS ()

Public Attributes

CSmartComboBox m_revCombo
BOOL | m_forceCommit
CString | m_rev
BOOL | m_forceRecurse
BOOL | m_forceRevision
BOOL | m_noModuleProgram
BOOL | m_noRecurse
BOOL | m_checkValidEdits

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnForcerevision ()

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 125 of file CommitDlg.h.

00125 { IDD = IDD_COMMIT_OPTIONS };

Constructor & Destructor Documentation

CCommit_OPTIONS::CCommit_OPTIONS ( )

Definition at line 438 of file CommitDlg.cpp.

References FALSE, m_checkValidEdits, m_forceCommit, m_forceRecurse, m_forceRevision, m_noModuleProgram, m_noRecurse, m_rev, m_revCombo, and USmartCombo::SetItems.

00438                                  : CPropertyPage(CCommit_OPTIONS::IDD)
00439 {
00440     //{{AFX_DATA_INIT(CCommit_OPTIONS)
00441     m_forceCommit = FALSE;
00442     m_rev = _T("");
00443     m_forceRecurse = FALSE;
00444     m_forceRevision = FALSE;
00445     m_noModuleProgram = FALSE;
00446     m_noRecurse = FALSE;
00447     m_checkValidEdits = FALSE;
00448     //}}AFX_DATA_INIT
00449
00450     m_checkValidEdits = (bool)gCheckValidEdits;
00451     m_revCombo.SetItems(&gRevNames);
00452 }

CCommit_OPTIONS::~CCommit_OPTIONS ( )

Definition at line 454 of file CommitDlg.cpp.

00455 {
00456 }

Member Function Documentation

void CCommit_OPTIONS::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 458 of file CommitDlg.cpp.

References DDV_MinChars, DDX_ComboMString, IDC_CHECKVALIDEDITS, IDC_COMBOREV, IDC_FORCECOMMIT, IDC_FORCERECURSE, IDC_FORCEREVISION, IDC_NOMODULEPROGRAM, IDC_NORECURS, m_checkValidEdits, m_forceCommit, m_forceRecurse, m_forceRevision, m_noModuleProgram, m_noRecurse, m_rev, m_revCombo, and OnForcerevision.

00459 {
00460     CPropertyPage::DoDataExchange(pDX);
00461     //{{AFX_DATA_MAP(CCommit_OPTIONS)
00462     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00463     DDX_Check(pDX, IDC_FORCECOMMIT, m_forceCommit);
00464     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00465     DDX_Check(pDX, IDC_FORCERECURSE, m_forceRecurse);
00466     DDX_Check(pDX, IDC_FORCEREVISION, m_forceRevision);
00467     DDX_Check(pDX, IDC_NOMODULEPROGRAM, m_noModuleProgram);
00468     DDX_Check(pDX, IDC_NORECURS, m_noRecurse);
00469     DDX_Check(pDX, IDC_CHECKVALIDEDITS, m_checkValidEdits);
00470     //}}AFX_DATA_MAP
00471
00472     if( m_forceRevision )
00473     {
00474         DDV_MinChars(pDX, m_rev, 1);
00475     }
00476
00477     if( !pDX->m_bSaveAndValidate )
00478     {
00479         OnForcerevision();
00480     }
00481
00482     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00483 }

void CCommit_OPTIONS::OnForcerevision ( ) [protected]

Definition at line 495 of file CommitDlg.cpp.

References IDC_COMBOREV, and IDC_FORCEREVISION.

Referenced by DoDataExchange.

00496 {
00497     CButton* but = (CButton *)GetDlgItem(IDC_FORCEREVISION);
00498     CWnd* wnd = GetDlgItem(IDC_COMBOREV);
00499     wnd->EnableWindow(but->GetCheck() == 1);
00500 }

Member Data Documentation

BOOL CCommit_OPTIONS::m_checkValidEdits

Definition at line 133 of file CommitDlg.h.

Referenced by CCommit_OPTIONS, CompatGetCommit, and DoDataExchange.

BOOL CCommit_OPTIONS::m_forceCommit

Definition at line 127 of file CommitDlg.h.

Referenced by CCommit_OPTIONS, CompatGetCommit, and DoDataExchange.

BOOL CCommit_OPTIONS::m_forceRecurse

Definition at line 129 of file CommitDlg.h.

Referenced by CCommit_OPTIONS, CompatGetCommit, and DoDataExchange.

BOOL CCommit_OPTIONS::m_forceRevision

Definition at line 130 of file CommitDlg.h.

Referenced by CCommit_OPTIONS, CompatGetCommit, and DoDataExchange.

BOOL CCommit_OPTIONS::m_noModuleProgram

Definition at line 131 of file CommitDlg.h.

Referenced by CCommit_OPTIONS, CompatGetCommit, and DoDataExchange.

BOOL CCommit_OPTIONS::m_noRecurse

Definition at line 132 of file CommitDlg.h.

Referenced by CCommit_OPTIONS, CompatGetCommit, and DoDataExchange.

CString CCommit_OPTIONS::m_rev

Definition at line 128 of file CommitDlg.h.

Referenced by CCommit_OPTIONS, CompatGetCommit, and DoDataExchange.

CSmartComboBox CCommit_OPTIONS::m_revCombo

Definition at line 126 of file CommitDlg.h.

Referenced by CCommit_OPTIONS, and DoDataExchange.

The documentation for this class was generated from the following files:
  • common/CommitDlg.h
  • common/CommitDlg.cpp
Generated on Sun Feb 24 01:25:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CComModule Class Reference

Inheritance diagram for CComModule:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/StdAfx.h
Generated on Sun Feb 24 01:25:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CComObjectRootEx Class Reference

Inheritance diagram for CComObjectRootEx:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CoWorker/CvsCoworker.h
Generated on Sun Feb 24 01:25:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CContentItems Class Reference

#include <CJOutlookBar.h>

Collaboration diagram for CContentItems:

[legend]
List of all members.

Public Methods

CContentItems (UINT nID, CString str)
void | operator= (CContentItems &pItems)
virtual UINT | GetImageID ()
virtual CString | GetText ()

Protected Attributes

UINT | m_nImageID
CString | m_csText

Constructor & Destructor Documentation

_CJXLIB_INLINE CContentItems::CContentItems | ( | UINT | nID,
 |  | CString | str
 | ) |

Definition at line 194 of file CJOutlookBar.h.

References m_csText, and m_nImageID.

00195     { m_nImageID = nID; m_csText = str; }

Member Function Documentation

_CJXLIB_INLINE UINT CContentItems::GetImageID ( ) [virtual]

Definition at line 200 of file CJOutlookBar.h.

References m_nImageID.

Referenced by CCJOutlookBar::DrawItem.

00201     { return m_nImageID; }

_CJXLIB_INLINE CString CContentItems::GetText ( ) [virtual]

Definition at line 197 of file CJOutlookBar.h.

References m_csText.

Referenced by CCJOutlookBar::DrawItem.

00198     { return m_csText; }

_CJXLIB_INLINE void CContentItems::operator= ( CContentItems & pItems )

Definition at line 203 of file CJOutlookBar.h.

References m_csText, and m_nImageID.

00204     { m_nImageID = pItems.m_nImageID; m_csText = pItems.m_csText; }

Member Data Documentation

CString CContentItems::m_csText [protected]

Definition at line 96 of file CJOutlookBar.h.

Referenced by CContentItems, GetText, and operator=.

UINT CContentItems::m_nImageID [protected]

Definition at line 95 of file CJOutlookBar.h.

Referenced by CContentItems, GetImageID, and operator=.

The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJOutlookBar.h
Generated on Sun Feb 24 01:25:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CControlBar Class Reference

Inheritance diagram for CControlBar:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJToolBarBase.h
Generated on Sun Feb 24 01:25:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCtrlView Class Reference

Inheritance diagram for CCtrlView:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJTabView.h
Generated on Sun Feb 24 01:25:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCustInvertTable Class Reference

Inheritance diagram for CCustInvertTable:

[legend]
Collaboration diagram for CCustInvertTable:

[legend]
List of all members.

Public Methods

CCustInvertTable ()
virtual | ~CCustInvertTable ()
void | Initialize ()

Protected Attributes

std::vector< char * > | m_garbage

Constructor & Destructor Documentation

CCustInvertTable::CCustInvertTable ( )

Definition at line 96 of file CustomizeMenus.cpp.

References CustInvertTable::key.

00097 {
00098     // init the cmd table with the static MFC commands
00099     const CustInvertTable *tmp = sInitInvTable;
00100     CustInvertTable newEntry;
00101     while(tmp->key != 0L)
00102     {
00103         newEntry = *tmp;
00104         push_back(newEntry);
00105         tmp++;
00106     }
00107 }

CCustInvertTable::~CCustInvertTable ( ) [virtual]

Definition at line 109 of file CustomizeMenus.cpp.

References free, and m_garbage.

00110 {
00111     std::vector<char *>::iterator i;
00112     for(i = m_garbage.begin(); i != m_garbage.end(); ++i)
00113     {
00114         free(*i);
00115     }
00116 }

Member Function Documentation

void CCustInvertTable::Initialize ( )

Definition at line 118 of file CustomizeMenus.cpp.

References CustInvertTable::cmd, ID_MACRO_ADMIN, ID_MACRO_SEL, CustInvertTable::key, m_garbage, strdup, and CustInvertTable::title.

Referenced by CustGetByKey, and CCustomizeMenus::OnInitDialog.

00119 {
00120     if(m_garbage.size() != 0)
00121         return;
00122
00123 #if 0 // fix me, Python
00124     vector<CMacroEntry>::const_iterator i;
00125     int cnt;
00126     CustInvertTable newEntry;
00127     for(cnt = 0, i = gMacrosAdmin.entries.begin(); i != gMacrosAdmin.entries.end(); ++i, cnt++)
00128     {
00129         newEntry.cmd = ID_MACRO_ADMIN + cnt;
00130         char *name = strdup((*i).name);
00131         m_garbage.push_back(name);
00132         newEntry.key = name;
00133         newEntry.title = name;
00134         push_back(newEntry);
00135     }
00136     for(cnt = 0, i = gMacrosSel.entries.begin(); i != gMacrosSel.entries.end(); ++i, cnt++)
00137     {
00138         newEntry.cmd = ID_MACRO_SEL + cnt;
00139         char *name = strdup((*i).name);
00140         m_garbage.push_back(name);
00141         newEntry.key = name;
00142         newEntry.title = name;
00143         push_back(newEntry);
00144     }
00145 #endif
00146 }

Member Data Documentation

std::vector<char *> CCustInvertTable::m_garbage [protected]

Definition at line 93 of file CustomizeMenus.cpp.

Referenced by Initialize, and ~CCustInvertTable.

The documentation for this class was generated from the following file:
  • WinCvs/CustomizeMenus.cpp
Generated on Sun Feb 24 01:25:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCustomizeMenus Class Reference

#include <CustomizeMenus.h>

Inheritance diagram for CCustomizeMenus:

[legend]
Collaboration diagram for CCustomizeMenus:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_CUSTOMIZE }

Public Methods

CCustomizeMenus (CMMenuString *fromMenu, CWnd *pParent=NULL)

Public Attributes

CListCtrl m_menuList
CListCtrl m_cmdsList
CButton m_upbtn
CButton m_removebtn
CButton m_downbtn
CButton m_addbtn

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
void | OnMove (int offset)
virtual void | OnOK ()
int | GetIcon (const CustInvertTable *entry)
afx_msg void | OnRemove ()
afx_msg void | OnAdd ()
virtual BOOL | OnInitDialog ()
afx_msg void | OnItemchangedAllcmds (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnDblclkMenulist (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnDblclkAllcmds (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnItemchangedMenulist (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnDown ()
afx_msg void | OnUp ()
afx_msg void | OnBegindragMenulist (NMHDR *pNMHDR, LRESULT *pResult)

Protected Attributes

CMMenuString * m_Menu
CImageList | m_SmallImageList

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 78 of file CustomizeMenus.h.

00078 { IDD = IDD_CUSTOMIZE };

Constructor & Destructor Documentation

CCustomizeMenus::CCustomizeMenus | ( | CMMenuString * | fromMenu,
 |  | CWnd * | pParent = NULL
 | ) |

Definition at line 191 of file CustomizeMenus.cpp.

00192     : CDialog(CCustomizeMenus::IDD, pParent), m_Menu(fromMenu)
00193 {
00194     //{{AFX_DATA_INIT(CCustomizeMenus)
00195     //}}AFX_DATA_INIT
00196 }

Member Function Documentation

void CCustomizeMenus::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 199 of file CustomizeMenus.cpp.

References FALSE, IDC_ADD, IDC_ALLCMDS, IDC_DOWN, IDC_MENULIST, IDC_REMOVE, IDC_UP, m_addbtn, m_cmdsList, m_downbtn, m_menuList, m_removebtn, and m_upbtn.

00200 {
00201     CDialog::DoDataExchange(pDX);
00202     //{{AFX_DATA_MAP(CCustomizeMenus)
00203     DDX_Control(pDX, IDC_MENULIST, m_menuList);
00204     DDX_Control(pDX, IDC_ALLCMDS, m_cmdsList);
00205     DDX_Control(pDX, IDC_UP, m_upbtn);
00206     DDX_Control(pDX, IDC_REMOVE, m_removebtn);
00207     DDX_Control(pDX, IDC_DOWN, m_downbtn);
00208     DDX_Control(pDX, IDC_ADD, m_addbtn);
00209     //}}AFX_DATA_MAP
00210
00211     if(!pDX->m_bSaveAndValidate)
00212     {
00213         // initialize the buttons
00214         m_upbtn.EnableWindow(FALSE);
00215         m_downbtn.EnableWindow(FALSE);
00216         m_addbtn.EnableWindow(FALSE);
00217         m_removebtn.EnableWindow(FALSE);
00218         m_cmdsList.SetExtendedStyle(
00219             m_cmdsList.GetExtendedStyle() |
00220             LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT);
00221         m_menuList.SetExtendedStyle(
00222             m_menuList.GetExtendedStyle() |
00223             LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
00224     }
00225 }

int CCustomizeMenus::GetIcon ( const CustInvertTable * entry ) [protected]

Definition at line 512 of file CustomizeMenus.cpp.

References CustInvertTable::cmd, ID_MACRO_ADMIN, and ID_MACRO_SEL.

Referenced by OnAdd, OnInitDialog, OnMove, and OnRemove.

00513 {
00514     if(entry->cmd == ID_SEPARATOR)
00515         return 0;
00516
00517     if(entry->cmd >= ID_MACRO_SEL && entry->cmd < (ID_MACRO_SEL + 100))
00518         return 2;
00519
00520     if(entry->cmd >= ID_MACRO_ADMIN && entry->cmd < (ID_MACRO_ADMIN + 100))
00521         return 2;
00522
00523     return 1;
00524 }

void CCustomizeMenus::OnAdd ( ) [protected]

Definition at line 272 of file CustomizeMenus.cpp.

References CustInvertTable::cmd, GetIcon, GetInvString, m_cmdsList, m_menuList, TRUE, and VERIFY.

Referenced by OnDblclkAllcmds.

00273 {
00274     int nItem = m_cmdsList.GetNextItem(-1, LVNI_SELECTED);
00275     if(nItem == -1)
00276         return;
00277
00278     const CustInvertTable *data = (const CustInvertTable *)
00279         m_cmdsList.GetItemData(nItem);
00280
00281     LV_ITEM lvi;
00282     lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
00283     lvi.iItem = m_menuList.GetItemCount();
00284     lvi.iSubItem = 0;
00285     lvi.lParam = (DWORD)data;
00286     lvi.pszText = GetInvString(data);
00287     lvi.iImage = GetIcon(data);
00288
00289     int newItem = m_menuList.InsertItem(&lvi);
00290     VERIFY(m_menuList.EnsureVisible(newItem, TRUE));
00291     VERIFY(m_menuList.SetItemState(newItem, LVIS_SELECTED, LVIS_SELECTED));
00292
00293     if(data->cmd != ID_SEPARATOR)
00294     {
00295         VERIFY(m_cmdsList.DeleteItem(nItem));
00296     }
00297 }

void CCustomizeMenus::OnBegindragMenulist | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 504 of file CustomizeMenus.cpp.

00505 {
00506     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
00507     // TODO: Add your control notification handler code here
00508
00509     *pResult = 0;
00510 }

void CCustomizeMenus::OnDblclkAllcmds | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 428 of file CustomizeMenus.cpp.

References OnAdd.

00429 {
00430     OnAdd();
00431
00432     *pResult = 0;
00433 }

void CCustomizeMenus::OnDblclkMenulist | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 421 of file CustomizeMenus.cpp.

References OnRemove.

00422 {
00423     OnRemove();
00424
00425     *pResult = 0;
00426 }

void CCustomizeMenus::OnDown ( ) [protected]

Definition at line 494 of file CustomizeMenus.cpp.

References OnMove.

00495 {
00496     OnMove(1);
00497 }

BOOL CCustomizeMenus::OnInitDialog ( ) [protected, virtual]

Definition at line 333 of file CustomizeMenus.cpp.

References _Compare, CustInvertTable::cmd, CustGetByKey, GetIcon, GetInvString, CMMenuString::GetList, IDR_CUSTMENUS, CCustInvertTable::Initialize, IsInInvertList, m_cmdsList, m_Menu, m_menuList, m_SmallImageList, sInvTable, and TRUE.

00334 {
00335     m_SmallImageList.Create(IDR_CUSTMENUS, 16, 1, RGB(255, 255, 255));
00336     sInvTable.Initialize();
00337
00338     CDialog::OnInitDialog();
00339
00340     LV_COLUMN lvc;
00341     int cnt;
00342     const std::vector<UStr> & list = m_Menu->GetList();
00343
00344     // Get the client rect of the list view control
00345     CRect rect;
00346     m_cmdsList.GetClientRect(&rect);
00347
00348     // Make the width of the column to the width of the client area minus
00349     // the width of a scroll bar
00350     int nWidth = rect.right - ::GetSystemMetrics(SM_CXVSCROLL);
00351
00352     // first the left list
00353     lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM;
00354     lvc.iSubItem = 0;
00355     lvc.cx = nWidth;
00356     lvc.fmt = LVCFMT_LEFT;
00357     m_cmdsList.InsertColumn(0, &lvc);
00358     m_cmdsList.SetImageList(&m_SmallImageList, LVSIL_SMALL);
00359
00360     std::vector<CustInvertTable>::const_iterator table;
00361     for(cnt = 0, table = sInvTable.begin(); table != sInvTable.end(); ++table, cnt++)
00362     {
00363         const CustInvertTable & tablEntry = *table;
00364         if(table->cmd != ID_SEPARATOR && IsInInvertList(&tablEntry, list))
00365             continue;
00366
00367         LV_ITEM lvi;
00368         lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
00369         lvi.iItem = cnt;
00370         lvi.iSubItem = 0;
00371         lvi.lParam = (DWORD)&tablEntry;
00372         lvi.pszText = GetInvString(&tablEntry);
00373         lvi.iImage = GetIcon(table);
00374
00375         m_cmdsList.InsertItem(&lvi);
00376     }
00377
00378     m_cmdsList.SortItems(_Compare, 0L);
00379
00380     // then the right one
00381     lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM;
00382     lvc.iSubItem = 0;
00383     lvc.cx = nWidth;
00384     lvc.fmt = LVCFMT_LEFT;
00385     m_menuList.InsertColumn(0, &lvc);
00386     m_menuList.SetImageList(&m_SmallImageList, LVSIL_SMALL);
00387
00388     std::vector<UStr>::const_iterator i;
00389
00390     for(cnt = 0, i = list.begin(); i != list.end(); ++i, cnt++)
00391     {
00392         const CustInvertTable *tab = CustGetByKey(*i);
00393         if(tab == 0L)
00394             continue;
00395
00396         LV_ITEM lvi;
00397         lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
00398         lvi.iItem = cnt;
00399         lvi.iSubItem = 0;
00400         lvi.lParam = (DWORD)tab;
00401         lvi.pszText = GetInvString(tab);
00402         lvi.iImage = GetIcon(tab);
00403
00404         m_menuList.InsertItem(&lvi);
00405     }
00406
00407     return TRUE;  // return TRUE unless you set the focus to a control
00408                   // EXCEPTION: OCX Property Pages should return FALSE
00409 }

void CCustomizeMenus::OnItemchangedAllcmds | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 411 of file CustomizeMenus.cpp.

References m_addbtn, and m_cmdsList.

00412 {
00413     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
00414     // TODO: Add your control notification handler code here
00415
00416     *pResult = 0;
00417     int nItem = m_cmdsList.GetNextItem(-1, LVNI_SELECTED);
00418     m_addbtn.EnableWindow(nItem != -1);
00419 }

void CCustomizeMenus::OnItemchangedMenulist | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 435 of file CustomizeMenus.cpp.

References FALSE, m_downbtn, m_menuList, m_removebtn, m_upbtn, and TRUE.

00436 {
00437     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
00438     // TODO: Add your control notification handler code here
00439
00440     *pResult = 0;
00441     int nItem = m_menuList.GetNextItem(-1, LVNI_SELECTED);
00442     m_removebtn.EnableWindow(nItem != -1);
00443
00444     if(nItem == -1)
00445     {
00446         m_upbtn.EnableWindow(FALSE);
00447         m_downbtn.EnableWindow(FALSE);
00448     }
00449     else if(nItem == 0)
00450     {
00451         m_upbtn.EnableWindow(FALSE);
00452         m_downbtn.EnableWindow(m_menuList.GetItemCount() > 1 ? TRUE : FALSE);
00453     }
00454     else if(nItem == m_menuList.GetItemCount() - 1)
00455     {
00456         m_upbtn.EnableWindow(TRUE);
00457         m_downbtn.EnableWindow(FALSE);
00458     }
00459     else
00460     {
00461         m_upbtn.EnableWindow(TRUE);
00462         m_downbtn.EnableWindow(TRUE);
00463     }
00464 }

void CCustomizeMenus::OnMove ( int offset ) [protected]

Definition at line 466 of file CustomizeMenus.cpp.

References GetIcon, GetInvString, m_menuList, TRUE, and VERIFY.

Referenced by OnDown, and OnUp.

00467 {
00468     int nItem = m_menuList.GetNextItem(-1, LVNI_SELECTED);
00469     if(nItem == -1)
00470         return;
00471
00472     const CustInvertTable *data = (const CustInvertTable *)
00473         m_menuList.GetItemData(nItem);
00474
00475     int newPos = nItem + offset;
00476     if(newPos < 0 || newPos > m_menuList.GetItemCount())
00477         return;
00478
00479     VERIFY(m_menuList.DeleteItem(nItem));
00480
00481     LV_ITEM lvi;
00482     lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
00483     lvi.iItem = newPos;
00484     lvi.iSubItem = 0;
00485     lvi.lParam = (DWORD)data;
00486     lvi.pszText = GetInvString(data);
00487     lvi.iImage = GetIcon(data);
00488
00489     int newItem = m_menuList.InsertItem(&lvi);
00490     VERIFY(m_menuList.EnsureVisible(newItem, TRUE));
00491     VERIFY(m_menuList.SetItemState(newItem, LVIS_SELECTED, LVIS_SELECTED));
00492 }

void CCustomizeMenus::OnOK ( ) [protected, virtual]

Definition at line 316 of file CustomizeMenus.cpp.

References CMMenuString::GetList, CustInvertTable::key, m_Menu, and m_menuList.

00317 {
00318     std::vector<UStr> & list = m_Menu->GetList();
00319     list.erase(list.begin(), list.end());
00320
00321     int nItem = -1;
00322     while((nItem = m_menuList.GetNextItem(nItem, LVNI_ALL)) != -1)
00323     {
00324         const CustInvertTable *data = (const CustInvertTable *)
00325             m_menuList.GetItemData(nItem);
00326
00327         list.push_back(data->key);
00328     }
00329
00330     CDialog::OnOK();
00331 }

void CCustomizeMenus::OnRemove ( ) [protected]

Definition at line 245 of file CustomizeMenus.cpp.

References CustInvertTable::cmd, GetIcon, GetInvString, m_cmdsList, m_menuList, TRUE, and VERIFY.

Referenced by OnDblclkMenulist.

00246 {
00247     int nItem = m_menuList.GetNextItem(-1, LVNI_SELECTED);
00248     if(nItem == -1)
00249         return;
00250
00251     const CustInvertTable *data = (const CustInvertTable *)
00252         m_menuList.GetItemData(nItem);
00253
00254     if(data->cmd != ID_SEPARATOR)
00255     {
00256         LV_ITEM lvi;
00257         lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
00258         lvi.iItem = m_cmdsList.GetItemCount();
00259         lvi.iSubItem = 0;
00260         lvi.lParam = (DWORD)data;
00261         lvi.pszText = GetInvString(data);
00262         lvi.iImage = GetIcon(data);
00263
00264         int newItem = m_cmdsList.InsertItem(&lvi);
00265         VERIFY(m_cmdsList.EnsureVisible(newItem, TRUE));
00266         VERIFY(m_cmdsList.SetItemState(newItem, LVIS_SELECTED, LVIS_SELECTED));
00267     }
00268
00269     VERIFY(m_menuList.DeleteItem(nItem));
00270 }

void CCustomizeMenus::OnUp ( ) [protected]

Definition at line 499 of file CustomizeMenus.cpp.

References OnMove.

00500 {
00501     OnMove(-1);
00502 }

Member Data Documentation

CButton CCustomizeMenus::m_addbtn

Definition at line 84 of file CustomizeMenus.h.

Referenced by DoDataExchange, and OnItemchangedAllcmds.

CListCtrl CCustomizeMenus::m_cmdsList

Definition at line 80 of file CustomizeMenus.h.

Referenced by DoDataExchange, OnAdd, OnInitDialog, OnItemchangedAllcmds, and OnRemove.

CButton CCustomizeMenus::m_downbtn

Definition at line 83 of file CustomizeMenus.h.

Referenced by DoDataExchange, and OnItemchangedMenulist.

CMMenuString* CCustomizeMenus::m_Menu [protected]

Definition at line 97 of file CustomizeMenus.h.

Referenced by OnInitDialog, and OnOK.

CListCtrl CCustomizeMenus::m_menuList

Definition at line 79 of file CustomizeMenus.h.

Referenced by DoDataExchange, OnAdd, OnInitDialog, OnItemchangedMenulist, OnMove, OnOK, and OnRemove.

CButton CCustomizeMenus::m_removebtn

Definition at line 82 of file CustomizeMenus.h.

Referenced by DoDataExchange, and OnItemchangedMenulist.

CImageList CCustomizeMenus::m_SmallImageList [protected]

Definition at line 98 of file CustomizeMenus.h.

Referenced by OnInitDialog.

CButton CCustomizeMenus::m_upbtn

Definition at line 81 of file CustomizeMenus.h.

Referenced by DoDataExchange, and OnItemchangedMenulist.

The documentation for this class was generated from the following files:
  • WinCvs/CustomizeMenus.h
  • WinCvs/CustomizeMenus.cpp
Generated on Sun Feb 24 01:25:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCVS_CoworkerModule Class Reference

#include <StdAfx.h>

Inheritance diagram for CCVS_CoworkerModule:

[legend]
Collaboration diagram for CCVS_CoworkerModule:

[legend]
List of all members.

Public Methods

LONG | Unlock ()
LONG | Lock ()
LPCTSTR | FindOneOf (LPCTSTR p1, LPCTSTR p2)

Public Attributes

DWORD | dwThreadID

Member Function Documentation

LPCTSTR CCVS_CoworkerModule::FindOneOf | ( | LPCTSTR | p1,
 |  | LPCTSTR | p2
 | ) |

Definition at line 80 of file wincvs.cpp.

References NULL.

Referenced by CWincvsApp::InitATL.

00081 {
00082     while (*p1 != NULL)
00083     {
00084         LPCTSTR p = p2;
00085         while (*p != NULL)
00086         {
00087             if (*p1 == *p)
00088                 return CharNext(p1);
00089             p = CharNext(p);
00090         }
00091         p1++;
00092     }
00093     return NULL;
00094 }

LONG CCVS_CoworkerModule::Lock ( )

Definition at line 75 of file wincvs.cpp.

00076 {
00077     AfxOleLockApp();
00078     return 1;
00079 }

LONG CCVS_CoworkerModule::Unlock ( )

Definition at line 69 of file wincvs.cpp.

00070 {
00071     AfxOleUnlockApp();
00072     return 0;
00073 }

Member Data Documentation

DWORD CCVS_CoworkerModule::dwThreadID

Definition at line 50 of file StdAfx.h.

Referenced by CWincvsApp::InitATL.

The documentation for this class was generated from the following files:
  • WinCvs/StdAfx.h
  • WinCvs/wincvs.cpp
Generated on Sun Feb 24 01:25:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCVSAlert Class Reference

#include <CvsAlert.h>

Inheritance diagram for CCVSAlert:

[legend]
Collaboration diagram for CCVSAlert:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_ALERT }

Public Methods

CCVSAlert (const char *prompt, const char *defhit, const char *cnclhit, CWnd *pParent=NULL)

Public Attributes

CString | m_prompt
CString | m_defhit
CString | m_cnclhit

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 47 of file CvsAlert.h.

00047 { IDD = IDD_ALERT };

Constructor & Destructor Documentation

CCVSAlert::CCVSAlert | ( | const char * | prompt,
 |  | const char * | defhit,
 |  | const char * | cnclhit,
 |  | CWnd * | pParent = NULL
 | ) |

Definition at line 55 of file CvsAlert.cpp.

References m_cnclhit, m_defhit, m_prompt, and NULL.

00057     : CDialog(CCVSAlert::IDD, pParent)
00058 {
00059     //{{AFX_DATA_INIT(CCVSAlert)
00060     m_prompt = prompt != NULL ? prompt : "";
00061     m_cnclhit = cnclhit != NULL ? cnclhit : "";
00062     m_defhit = defhit != NULL ? defhit : "";
00063     //}}AFX_DATA_INIT
00064 }

Member Function Documentation

void CCVSAlert::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 67 of file CvsAlert.cpp.

References IDC_ALRTMSG, m_cnclhit, m_defhit, and m_prompt.

00068 {
00069     CDialog::DoDataExchange(pDX);
00070     //{{AFX_DATA_MAP(CCVSAlert)
00071     DDX_Text(pDX, IDC_ALRTMSG, m_prompt);
00072     DDX_Text(pDX, IDCANCEL, m_cnclhit);
00073     DDX_Text(pDX, IDOK, m_defhit);
00074     //}}AFX_DATA_MAP
00075 }

Member Data Documentation

CString CCVSAlert::m_cnclhit

Definition at line 50 of file CvsAlert.h.

Referenced by CCVSAlert, and DoDataExchange.

CString CCVSAlert::m_defhit

Definition at line 49 of file CvsAlert.h.

Referenced by CCVSAlert, and DoDataExchange.

CString CCVSAlert::m_prompt

Definition at line 48 of file CvsAlert.h.

Referenced by CCVSAlert, and DoDataExchange.

The documentation for this class was generated from the following files:
  • common/CvsAlert.h
  • common/CvsAlert.cpp
Generated on Sun Feb 24 01:25:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsApp Class Reference

#include <UCvsApp.h>

Inheritance diagram for UCvsApp:

[legend]
Collaboration diagram for UCvsApp:

[legend]
List of all members.

Public Types

enum | { kProcessTimer = EV_COMMAND_START }

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UCvsApp (int argc, char **argv)
virtual | ~UCvsApp ()
void | SayWelcome (void)
void | SetCvsRunning (bool state)
bool | IsCvsRunning (void)
void | SetCvsStopping (bool state)
bool | IsCvsStopping (void)
UCvsFolders * | GetBrowserView (void)
UCvsFiles * | GetFilesView (void)
const char * | GetAppName (void) const
const char * | GetAppLibFolder (void) const
const char * | GetAppVersion (void) const
void | Execute (int argc, char *const *argv)

Static Public Methods

const URuntimeClass * | rtUCvsApp (void)

Static Public Attributes

UCvsApp * | gApp = 0L
CvsProcess * | gCurCvs = 0L

Protected Methods

void | OnMainTimer (long time)
virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Protected Attributes

bool | gCvsRunning
bool | gCvsStopping

Static Protected Attributes

const URuntimeClass | classUCvsApp
const UMSGMAP | messageMap = { UWidget ::GetThisMessageMap(), & UCvsApp ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Member Enumeration Documentation

anonymous enum

Enumeration values:
kProcessTimer

Definition at line 70 of file UCvsApp.h.

00071     {
00072         kProcessTimer = EV_COMMAND_START
00073     };

Constructor & Destructor Documentation

UCvsApp::UCvsApp | ( | int | argc,
 |  | char ** | argv
 | ) |

Definition at line 74 of file UCvsApp.cpp.

References UWidget::AddTimer, cvs_err, gApp, kProcessTimer, MacrosReloadAll, required_argument, UCvsFolders::SetDefaultRoot, and usage.

00074                                       :
00075 UWidget (::UEventGetWidID ()),
00076 gCvsRunning (false),
00077 gCvsStopping (false)
00078 {
00079     gApp = this;
00080
00081 #if qGTK
00082     add_pixmap_directory (PACKAGE_DATA_DIR "/pixmaps");
00083     add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps");
00084 #endif
00085
00086     // load the persistent values (i.e. preferences) and the locate the macros
00087     gCvsPrefs.load ();
00088     MacrosReloadAll ();
00089
00090     AddTimer (50, kProcessTimer);
00091
00092     if (argc > 0)
00093     {
00094         static struct option long_options[] = {
00095             {"root", required_argument, 0L, 1},
00096             {0, 0, 0, 0}
00097         };
00098         optind = 0;
00099         int option_index = 0, c;
00100         while ((c = getopt_long
00101             (argc, argv, "+", long_options,
00102              &option_index)) != EOF)
00103         {
00104             switch (c)
00105             {
00106             case 1:
00107                 UCvsFolders::SetDefaultRoot (optarg);
00108                 break;
00109             default:
00110                 cvs_err ("Warning : unknown option\n");
00111                 usage ();
00112                 break;
00113             }
00114         }
00115
00116     }
00117 }

UCvsApp::~UCvsApp ( ) [virtual]

Definition at line 119 of file UCvsApp.cpp.

00120 {
00121 }

Member Function Documentation

const URuntimeClass * UCvsApp::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 62 of file UCvsApp.cpp.

void UCvsApp::Execute | ( | int | argc,
 |  | char *const * | argv
 | ) |

Definition at line 377 of file UCvsApp.cpp.

Referenced by UCvsFiles::EditSel, LaunchDiff, UCvsFolders::OnCmdExplore, and UCvsFiles::OnCmdExplore.

00378 {
00379 #if qUnix
00380     gnome_execute_async_with_env_fds (0L, argc, argv, 0, 0L, true);
00381 #endif
00382 }

const char* UCvsApp::GetAppLibFolder ( void ) const

const char * UCvsApp::GetAppName ( void ) const

Definition at line 183 of file UCvsApp.cpp.

Referenced by UCvsFrame::OnCopyrights, and UCvsFrame::OnCredits.

00184 {
00185 #ifdef macintosh
00186     return "MacCvs";
00187 #elif defined(WIN32)
00188     return "WinCvs";
00189 #elif defined(qUnix)
00190     return PACKAGE;
00191 #endif
00192 }

const char * UCvsApp::GetAppVersion ( void ) const

Definition at line 195 of file UCvsApp.cpp.

Referenced by UCvsFrame::OnCredits.

00196 {
00197 #ifdef macintosh
00198
00199 #elif defined(WIN32)
00200
00201 #elif defined(qUnix)
00202     return VERSION;
00203 #endif
00204 }

const UMSGMAP * UCvsApp::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 63 of file UCvsApp.cpp.

UCvsFolders * UCvsApp::GetBrowserView ( void )

Definition at line 163 of file UCvsApp.cpp.

References UObject::IsKindOf, kUCvsFoldersID, UEventQueryWidget, and URUNTIME_CLASS.

Referenced by UCvsFrame::OnBrowserPopup, UCvsFrame::OnCmdSaveSettings, UCvsFrame::OnComboSelDir, UCvsFiles::ResetView, and CvsPrefs::save.

00164 {
00165     UCmdTarget *cmd = UEventQueryWidget (kUCvsFoldersID);
00166     if (cmd != 0L && cmd->IsKindOf (URUNTIME_CLASS (UCvsFolders)))
00167         return (UCvsFolders *) cmd;
00168
00169     return 0L;
00170 }

UCvsFiles * UCvsApp::GetFilesView ( void )

Definition at line 173 of file UCvsApp.cpp.

References UObject::IsKindOf, kUCvsFilesID, UEventQueryWidget, and URUNTIME_CLASS.

Referenced by OnMainTimer, UCvsFolders::ResetBrowser, and UCvsFolders::ResetView.

00174 {
00175     UCmdTarget *cmd = UEventQueryWidget (kUCvsFilesID);
00176     if (cmd != 0L && cmd->IsKindOf (URUNTIME_CLASS (UCvsFiles)))
00177         return (UCvsFiles *) cmd;
00178
00179     return 0L;
00180 }

const UMSGMAP * UCvsApp::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 63 of file UCvsApp.cpp.

const URuntimeClass * UCvsApp::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 62 of file UCvsApp.cpp.

const UMSGMAP * UCvsApp::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 63 of file UCvsApp.cpp.

bool UCvsApp::IsCvsRunning ( void ) [inline]

Definition at line 51 of file UCvsApp.h.

References gCvsRunning.

Referenced by UCvsFrame::AskForQuitting, UCvsFolders::DisableGeneric, UCvsFiles::DisableGeneric, launchCVS, UCvsFolders::OnCmdUICheckout, UCvsFolders::OnCmdUIImport, UCvsFolders::OnCmdUIReload, UCvsFrame::OnCmdUIStopcvs, and testCVS.

00051 { return gCvsRunning; }

bool UCvsApp::IsCvsStopping ( void ) [inline]

Definition at line 55 of file UCvsApp.h.

References gCvsStopping.

Referenced by UCvsFrame::OnCmdUIStopcvs.

00055 { return gCvsStopping; }

void UCvsApp::OnMainTimer ( long time ) [protected]

Definition at line 385 of file UCvsApp.cpp.

References cvs_process_give_time, cvs_process_is_active, UWidget::DoValidUI, gApp, gCurCvs, GetFilesView, UCvsFiles::ResetView, and SetCvsRunning.

00386 {
00387     if (gCurCvs != 0L)
00388     {
00389         cvs_process_give_time ();
00390         if (!cvs_process_is_active (gCurCvs))
00391         {
00392             UCvsApp::gApp->SetCvsRunning (false);
00393             gCurCvs = 0L;
00394             UWidget::DoValidUI (false);
00395             UCvsApp::gApp->GetFilesView ()->ResetView ();
00396         }
00397     }
00398 }

const URuntimeClass * UCvsApp::rtUCvsApp ( void ) [static]

Definition at line 62 of file UCvsApp.cpp.

void UCvsApp::SayWelcome ( void )

Definition at line 124 of file UCvsApp.cpp.

References CompatGetPrefs, cvs_err, cvs_out, and CTcl_Interp::IsAvail.

00125 {
00126     // say hello from the application, optionnaly prompt for the CVSROOT
00127     cvs_out ("Welcome to %s %s\n", PACKAGE, VERSION);
00128     if (gCvsPrefs.empty ())
00129         CompatGetPrefs ();
00130     else
00131         cvs_out ("CVSROOT: %s (%s)\n", (const char *) gCvsPrefs,
00132              gAuthen.kindstr ());
00133
00134     if (CTcl_Interp::IsAvail ())
00135     {
00136         cvs_out ("TCL is available, shell and macros are enabled : help (select and press enter)\n");
00137     }
00138     else
00139     {
00140         cvs_err ("TCL is *not* available, shell and macros are disabled\n");
00141     }
00142 }

void UCvsApp::SetCvsRunning ( bool state )

Definition at line 145 of file UCvsApp.cpp.

References gCvsRunning.

Referenced by launchCVS, and OnMainTimer.

00146 {
00147     if (state ^ gCvsRunning)
00148     {
00149         gCvsRunning = state;
00150     }
00151 }

void UCvsApp::SetCvsStopping ( bool state )

Definition at line 154 of file UCvsApp.cpp.

References gCvsStopping.

Referenced by launchCVS, UCvsFrame::OnCmdStopcvs, and testCVS.

00155 {
00156     if (state ^ gCvsStopping)
00157     {
00158         gCvsStopping = state;
00159     }
00160 }

Member Data Documentation

const UMSGMAP_ENTRY UCvsApp::_messageEntries [static, private]

Initial value:

   {
{ EV_TIMER, epV_VP, UMSG_RANGE,  UCvsApp::kProcessTimer ,  UCvsApp::kProcessTimer ,   (UPMSG)(void (UCmdTarget::*)(long time))& UCvsApp::OnMainTimer  },
{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }   }

Reimplemented from UWidget.

Definition at line 63 of file UCvsApp.cpp.

const URuntimeClass UCvsApp::classUCvsApp [static, protected]

UCvsApp * UCvsApp::gApp = 0L [static]

Definition at line 66 of file UCvsApp.cpp.

Referenced by UCvsFrame::AskForQuitting, UCvsFolders::DisableGeneric, UCvsFiles::DisableGeneric, UCvsFiles::EditSel, launchCVS, LaunchDiff, UCvsFrame::OnBrowserPopup, UCvsFolders::OnCmdExplore, UCvsFiles::OnCmdExplore, UCvsFrame::OnCmdSaveSettings, UCvsFrame::OnCmdStopcvs, UCvsFrame::OnCmdUIAnytime, UCvsFolders::OnCmdUICheckout, UCvsFrame::OnCmdUICvsCmd, UCvsFolders::OnCmdUIImport, UCvsFrame::OnCmdUIMacroAdmin, UCvsFolders::OnCmdUIReload, UCvsFrame::OnCmdUIStopcvs, UCvsFrame::OnComboSelDir, UCvsFrame::OnCopyrights, UCvsFrame::OnCredits, OnMainTimer, UCvsFolders::ResetBrowser, UCvsFolders::ResetView, UCvsFiles::ResetView, CvsPrefs::save, testCVS, and UCvsApp.

CvsProcess * UCvsApp::gCurCvs = 0L [static]

Definition at line 67 of file UCvsApp.cpp.

Referenced by launchCVS, UCvsFrame::OnCmdStopcvs, and OnMainTimer.

bool UCvsApp::gCvsRunning [protected]

Definition at line 76 of file UCvsApp.h.

Referenced by IsCvsRunning, and SetCvsRunning.

bool UCvsApp::gCvsStopping [protected]

Definition at line 77 of file UCvsApp.h.

Referenced by IsCvsStopping, and SetCvsStopping.

const UMSGMAP UCvsApp::messageMap = { UWidget ::GetThisMessageMap(), & UCvsApp ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Definition at line 63 of file UCvsApp.cpp.

The documentation for this class was generated from the following files:
  • common/UCvsApp.h
  • common/UCvsApp.cpp
Generated on Sun Feb 24 01:25:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsConsole Class Reference

#include <UCvsConsole.h>

Inheritance diagram for UCvsConsole:

[legend]
Collaboration diagram for UCvsConsole:

[legend]
List of all members.

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UCvsConsole ()
virtual | ~UCvsConsole ()
void | OutConsole (const char *txt, size_t len, bool isStderr=false)
void | OutColor (const char *txt, long len)
void | OutColor (kConsoleColor color)

Static Public Methods

const URuntimeClass * | rtUCvsConsole (void)

Protected Types

enum | { MAX_CHAR_BY_LINE = 1024 }

Protected Methods

void | FeedThisLine (const char *buf, size_t numbuf, bool isStderr)
void | OnDestroy ()
void | OnCreate ()
virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Protected Attributes

char * | m_buf
size_t | m_numbuf
struct {
UCOLOR col
bool bold
bool italic
bool underline
} out

Static Protected Attributes

const URuntimeClass | classUCvsConsole
const UMSGMAP | messageMap = { UWidget ::GetThisMessageMap(), & UCvsConsole ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Member Enumeration Documentation

anonymous enum [protected]

Enumeration values:
MAX_CHAR_BY_LINE

Definition at line 56 of file UCvsConsole.h.

00057     {
00058         MAX_CHAR_BY_LINE = 1024
00059     };

Constructor & Destructor Documentation

UCvsConsole::UCvsConsole ( )

Definition at line 44 of file UCvsConsole.cpp.

References kUMainConsoleID, and out.

00044                          : UWidget(kUMainConsoleID), m_buf(0L), m_numbuf(0)
00045 {
00046     out.col = UCOLOR(0, 0, 0);
00047     out.bold = false;
00048     out.italic = false;
00049     out.underline = false;
00050 }

UCvsConsole::~UCvsConsole ( ) [virtual]

Definition at line 52 of file UCvsConsole.cpp.

References free, m_buf, and m_numbuf.

00053 {
00054     m_numbuf = 0;
00055     if(m_buf != 0L)
00056     {
00057         free(m_buf);
00058         m_buf = 0L;
00059     }
00060 }

Member Function Documentation

const URuntimeClass * UCvsConsole::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 37 of file UCvsConsole.cpp.

void UCvsConsole::FeedThisLine | ( | const char * | buf,
 |  | size_t | numbuf,
 |  | bool | isStderr
 | ) | [protected]

Definition at line 62 of file UCvsConsole.cpp.

References UCOLOR::b, col, UCOLOR::g, UWidget::GetWidget, kUMainWidget, UStr::length, NULL, UCOLOR::r, UStr::set, and UAppConsole.

Referenced by OutConsole.

00063 {
00064     void *wid = GetWidget(kUMainWidget);
00065     if(wid == 0L)
00066     {
00067         UAppConsole("The console is not here !\n");
00068         return;
00069     }
00070
00071 #if qGTK
00072     if(!GTK_IS_TEXT(wid))
00073     {
00074         g_warning("The pseudo-console is not here !\n");
00075         return;
00076     }
00077
00078     GtkText *w = GTK_TEXT(wid);
00079     gtk_text_set_point(w, gtk_text_get_length(w));
00080 #endif
00081
00082     UCOLOR color(0, 0, 0);
00083     bool colorChanged = false;
00084     UStr s;
00085     s.set(buf, numbuf);
00086
00087     if(s.length() >= 5 && s[1] == ' ' &&
00088         (s[0] == 'M' || s[0] == 'C' || s[0] == 'U' ||
00089         s[0] == 'P' || s[0] == 'N' || s[0] == 'A' ||
00090         s[0] == 'R' || s[0] == 'I' || s[0] == '?' ||
00091         s[0] == '<' || s[0] == '>'))
00092     {
00093         colorChanged = true;
00094         switch(s[0])
00095         {
00096         default:
00097         case '?' :
00098         case 'I' :
00099             color = UCOLOR(0x80, 0x80, 0x00);
00100             break;
00101         case 'U' :
00102         case 'N' :
00103             color = UCOLOR(0x00, 0xA0, 0x00);
00104             break;
00105         case 'M' :
00106         case 'A' :
00107         case 'R' :
00108             color = UCOLOR(0xFF, 0x00, 0xFF);
00109             break;
00110         case 'C' :
00111         case '<' :
00112             color = UCOLOR(0xFF, 0x00, 0x00);
00113             break;
00114         case '>' :
00115         case 'P' :
00116             color = UCOLOR(0x00, 0x00, 0xFF);
00117             break;
00118         }
00119     }
00120     else if(isStderr)
00121     {
00122         colorChanged = true;
00123         color = UCOLOR(0xFF, 0x80, 0x00);
00124     }
00125
00126 #if qGTK
00127     GdkColormap *cmap;
00128     GdkColor col;
00129     cmap = gdk_colormap_get_system();
00130     col.red = ((unsigned int)color.r) << 8;
00131     col.green = ((unsigned int)color.g) << 8;
00132     col.blue = ((unsigned int)color.b) << 8;
00133     if(color.r != 0 || color.g != 0 || color.b != 0)
00134     {
00135         if (!gdk_color_alloc(cmap, &col)) {
00136             g_error("Couldn't allocate color\n");
00137         }
00138         gtk_text_insert(w, NULL, &col, NULL, s, -1);
00139     }
00140     else
00141         gtk_text_insert(w, NULL, &GTK_WIDGET(w)->style->black, NULL, s, -1);
00142 #endif
00143 }

const UMSGMAP * UCvsConsole::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 39 of file UCvsConsole.cpp.

const UMSGMAP * UCvsConsole::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 39 of file UCvsConsole.cpp.

const URuntimeClass * UCvsConsole::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 37 of file UCvsConsole.cpp.

const UMSGMAP * UCvsConsole::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 39 of file UCvsConsole.cpp.

void UCvsConsole::OnCreate ( ) [protected]

Definition at line 259 of file UCvsConsole.cpp.

References UWidget::GetWidget, gpointer, kUMainWidget, and UAppConsole.

00260 {
00261     void *wid = GetWidget(kUMainWidget);
00262     if(wid == 0L)
00263     {
00264         UAppConsole("The console is not here !\n");
00265         return;
00266     }
00267
00268 #if qGTK
00269     gtk_signal_connect (GTK_OBJECT (wid), "key_press_event",
00270                         GTK_SIGNAL_FUNC(gtkkeypress), (gpointer)this);
00271 #endif
00272 }

void UCvsConsole::OnDestroy ( ) [protected]

Definition at line 181 of file UCvsConsole.cpp.

00182 {
00183     delete this;
00184 }

void UCvsConsole::OutColor ( kConsoleColor color )

Definition at line 311 of file UCvsConsole.cpp.

References kBlue, kBold, kBrown, kConsoleColor, kGreen, kItalic, kMagenta, kNL, kNormal, kRed, kUnderline, and out.

00312 {
00313     switch(color)
00314     {
00315     case kBrown :
00316         out.col = UCOLOR(0x80, 0x80, 0x00);
00317         break;
00318     case kGreen :
00319         out.col = UCOLOR(0x00, 0xA0, 0x00);
00320         break;
00321     case kMagenta :
00322         out.col = UCOLOR(0xFF, 0x00, 0xFF);
00323         break;
00324     case kRed :
00325         out.col = UCOLOR(0xFF, 0x00, 0x00);
00326         break;
00327     case kBlue :
00328         out.col = UCOLOR(0x00, 0x00, 0xFF);
00329         break;
00330     case kBold :
00331         out.bold = true;
00332         break;
00333     case kItalic :
00334         out.italic = true;
00335         break;
00336     case kUnderline :
00337         out.underline = true;
00338         break;
00339     case kNormal:
00340         out.col = UCOLOR(0, 0, 0);
00341         out.bold = false;
00342         out.italic = false;
00343         out.underline = false;
00344         break;
00345     case kNL :
00346         break;
00347     }
00348 }

void UCvsConsole::OutColor | ( | const char * | txt,
 |  | long | len
 | ) |

Definition at line 274 of file UCvsConsole.cpp.

References col, UWidget::GetWidget, kUMainWidget, NULL, out, and UAppConsole.

Referenced by CColorConsole::operator<<.

00275 {
00276     void *wid = GetWidget(kUMainWidget);
00277     if(wid == 0L)
00278     {
00279         UAppConsole("The console is not here !\n");
00280         return;
00281     }
00282
00283 #if qGTK
00284     if(!GTK_IS_TEXT(wid))
00285     {
00286         g_warning("The pseudo-console is not here !\n");
00287         return;
00288     }
00289
00290     GtkText *w = GTK_TEXT(wid);
00291     gtk_text_set_point(w, gtk_text_get_length(w));
00292
00293     GdkColormap *cmap;
00294     GdkColor col;
00295     cmap = gdk_colormap_get_system();
00296     col.red = ((unsigned int)out.col.r) << 8;
00297     col.green = ((unsigned int)out.col.g) << 8;
00298     col.blue = ((unsigned int)out.col.b) << 8;
00299     if(out.col.r != 0 || out.col.g != 0 || out.col.b != 0)
00300     {
00301         if (!gdk_color_alloc(cmap, &col)) {
00302             g_error("Couldn't allocate color\n");
00303         }
00304         gtk_text_insert(w, NULL, &col, NULL, txt, len);
00305     }
00306     else
00307         gtk_text_insert(w, NULL, &GTK_WIDGET(w)->style->black, NULL, txt, len);
00308 #endif
00309 }

void UCvsConsole::OutConsole | ( | const char * | txt,
 |  | size_t | len,
 |  | bool | isStderr = false
 | ) |

Definition at line 145 of file UCvsConsole.cpp.

References FeedThisLine, m_buf, m_numbuf, malloc, and MAX_CHAR_BY_LINE.

Referenced by cvs_err, cvs_errstr, cvs_out, and cvs_outstr.

00146 {
00147     if(len == 0)
00148         return;
00149
00150     if(m_buf == 0L)
00151     {
00152         m_buf = (char *)malloc((MAX_CHAR_BY_LINE + 3) * sizeof(char));
00153         if(m_buf == 0L)
00154             return;
00155     }
00156
00157     size_t i = 0;
00158     char c = 0;
00159 once_again:
00160     for(; i < len && m_numbuf < MAX_CHAR_BY_LINE; m_numbuf++)
00161     {
00162         c = txt[i++];
00163         if(c == 0x0a)
00164             break;
00165         m_buf[m_numbuf] = c;
00166     }
00167
00168     if(c == 0x0a || m_numbuf == MAX_CHAR_BY_LINE)
00169     {
00170         m_buf[m_numbuf++] = 0x0a;
00171         m_buf[m_numbuf++] = 0x00;
00172
00173         FeedThisLine(m_buf, m_numbuf, isStderr);
00174         m_numbuf = 0;
00175     }
00176
00177     if(i != len)
00178         goto once_again;
00179 }

const URuntimeClass * UCvsConsole::rtUCvsConsole ( void ) [static]

Definition at line 37 of file UCvsConsole.cpp.

Member Data Documentation

const UMSGMAP_ENTRY UCvsConsole::_messageEntries [static, private]

Initial value:

   {
    { EV_DESTROY, epV_V, UMSG_NOEXT, 0, 0,   (UPMSG)(void (UCmdTarget::*)(void))& UCvsConsole ::OnDestroy },
    { EV_CREATE, epV_V, UMSG_NOEXT, 0, 0,   (UPMSG)(void (UCmdTarget::*)(void))& UCvsConsole ::OnCreate },
{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }   }

Reimplemented from UWidget.

Definition at line 39 of file UCvsConsole.cpp.

bool UCvsConsole::bold [protected]

Definition at line 67 of file UCvsConsole.h.

const URuntimeClass UCvsConsole::classUCvsConsole [static, protected]

UCOLOR UCvsConsole::col [protected]

Definition at line 66 of file UCvsConsole.h.

Referenced by FeedThisLine, and OutColor.

bool UCvsConsole::italic [protected]

Definition at line 67 of file UCvsConsole.h.

char* UCvsConsole::m_buf [protected]

Definition at line 61 of file UCvsConsole.h.

Referenced by OutConsole, and ~UCvsConsole.

size_t UCvsConsole::m_numbuf [protected]

Definition at line 62 of file UCvsConsole.h.

Referenced by OutConsole, and ~UCvsConsole.

const UMSGMAP UCvsConsole::messageMap = { UWidget ::GetThisMessageMap(), & UCvsConsole ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Definition at line 39 of file UCvsConsole.cpp.

struct { ... } UCvsConsole::out [protected]

Referenced by OutColor, and UCvsConsole.

bool UCvsConsole::underline [protected]

Definition at line 67 of file UCvsConsole.h.

The documentation for this class was generated from the following files:
  • common/UCvsConsole.h
  • common/UCvsConsole.cpp
Generated on Sun Feb 24 01:25:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCvsConsole Class Reference

#include <AppGlue.h>

Inheritance diagram for CCvsConsole:

[legend]
List of all members.

Public Methods

virtual long | cvs_out (char *txt, long len)=0L
virtual long | cvs_err (char *txt, long len)=0L

Member Function Documentation

virtual long CCvsConsole::cvs_err | ( | char * | txt,
 |  | long | len
 | ) | [pure virtual]

Implemented in CStreamConsole.

Referenced by glue_consoleerr.

virtual long CCvsConsole::cvs_out | ( | char * | txt,
 |  | long | len
 | ) | [pure virtual]

Implemented in CStreamConsole.

Referenced by glue_consoleout.

The documentation for this class was generated from the following file:
  • common/AppGlue.h
Generated on Sun Feb 24 01:25:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsFiles Class Reference

#include <UCvsFiles.h>

Inheritance diagram for UCvsFiles:

[legend]
Collaboration diagram for UCvsFiles:

[legend]
List of all members.

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UCvsFiles ()
virtual | ~UCvsFiles ()
void | ResetView (const char *path, bool notifyBrowser=false)
void | ResetView (bool forceReload=false, bool notifyBrowser=false)
bool | IsSortAscendant (void)

Static Public Methods

const URuntimeClass * | rtUCvsFiles (void)
void * | GetImageForEntry (EntnodeData *data)

Protected Methods

void | GetEntriesModTime (time_t &newEntriesMod, time_t &newEntriesLogMod)
void | EditSel (EntnodeData *data, bool useDefault=false)
void | Resort (void)
bool | DisableGeneric ()
int | Search (const char *title)
void | OnDestroy ()
void | OnCreate ()
int | OnCmdUpdate (void)
int | OnCmdAdd (void)
int | OnCmdAddb (void)
int | OnCmdCommit (void)
int | OnCmdRmv (void)
int | OnCmdQueryUpdate (void)
int | OnCmdReload (void)
int | OnCmdUpone (void)
int | OnCmdTrash (void)
int | OnCmdDiff (void)
int | OnCmdLog (void)
int | OnCmdGraph (void)
int | OnCmdStatus (void)
int | OnCmdLock (void)
int | OnCmdUnlock (void)
int | OnCmdWatchOn (void)
int | OnCmdWatchOff (void)
int | OnCmdEdit (void)
int | OnCmdUnedit (void)
int | OnCmdWatchers (void)
int | OnCmdEditors (void)
int | OnCmdRelease (void)
int | OnCmdTagNew (void)
int | OnCmdTagDelete (void)
int | OnCmdTagBranch (void)
int | OnCmdExplore (void)
int | OnCmdIgnore (void)
int | OnCmdEditsel (void)
int | OnCmdEditseldef (void)
int | OnMacroSel (int cmd)
void | OnCmdUIUpdate (UCmdUI *pCmdUI)
void | OnCmdUIAdd (UCmdUI *pCmdUI)
void | OnCmdUIAddB (UCmdUI *pCmdUI)
void | OnCmdUIRelease (UCmdUI *pCmdUI)
void | OnCmdUIRmv (UCmdUI *pCmdUI)
void | OnCmdUIGraph (UCmdUI *pCmdUI)
void | OnCmdUIEditseldef (UCmdUI *pCmdUI)
void | OnCmdUIReload (UCmdUI *pCmdUI)
void | OnCmdUIUpone (UCmdUI *pCmdUI)
void | OnCmdUITrash (UCmdUI *pCmdUI)
void | OnCmdUIExplore (UCmdUI *pCmdUI)
void | OnCmdUIIgnore (UCmdUI *pCmdUI)
void | OnCmdUIMacroSel (int cmd, UCmdUI *pCmdUI)
void | OnDblClick (void)
void | OnSelColumn (int column)
virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Protected Attributes

CSortList< ENTNODE > m_entries
UStr m_path
time_t | m_entriesMod
time_t | m_entriesLogMod
int | m_sort
bool | m_ascendant

Static Protected Attributes

const URuntimeClass | classUCvsFiles
const UMSGMAP | messageMap = { UWidget ::GetThisMessageMap(), & UCvsFiles ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Constructor & Destructor Documentation

UCvsFiles::UCvsFiles ( )

Definition at line 368 of file UCvsFiles.cpp.

References kUCvsFilesID, m_ascendant, and m_sort.

00368                      : UWidget(kUCvsFilesID), m_entries(200, ENTNODE::Compare), m_entriesMod(0), m_entriesLogMod(0)
00369
00370 {
00371     m_sort = (int)gFileViewSort;
00372     m_ascendant = (bool)gFileViewSortAsc;
00373 }

UCvsFiles::~UCvsFiles ( ) [virtual]

Definition at line 375 of file UCvsFiles.cpp.

References m_ascendant, and m_sort.

00376 {
00377     gFileViewSort = m_sort;
00378     gFileViewSortAsc = m_ascendant;
00379 }

Member Function Documentation

const URuntimeClass * UCvsFiles::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 63 of file UCvsFiles.cpp.

bool UCvsFiles::DisableGeneric ( ) [protected]

Definition at line 724 of file UCvsFiles.cpp.

References EV_LIST_GETNEXTSEL, UCvsApp::gApp, UCmdTarget::GetWidID, UWidget::HasFocus, UCvsApp::IsCvsRunning, kUMainWidget, UEventSendMessage, and UMAKEINT.

Referenced by OnCmdUIAdd, OnCmdUIAddB, OnCmdUIEditseldef, OnCmdUIExplore, OnCmdUIGraph, OnCmdUIIgnore, OnCmdUIMacroSel, OnCmdUIRelease, OnCmdUIReload, OnCmdUIRmv, OnCmdUITrash, OnCmdUIUpdate, and OnCmdUIUpone.

00725 {
00726     return UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, -1), 0L) == -1 ||
00727         UCvsApp::gApp->IsCvsRunning() || gCvsPrefs.empty() || !HasFocus();
00728 }

void UCvsFiles::EditSel | ( | EntnodeData * | data,
 |  | bool | useDefault = false
 | ) | [protected]

Definition at line 1880 of file UCvsFiles.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, CStr, cvs_err, ENT_SUBDIR, UCvsApp::Execute, UCvsApp::gApp, EntnodeData::GetType, EntnodeData::kName, m_path, NULL, and ResetView.

Referenced by OnCmdEditsel, OnCmdEditseldef, and OnDblClick.

01881 {
01882     CStr fullpath;
01883     fullpath = m_path;
01884     if(!fullpath.endsWith(kPathDelimiter))
01885         fullpath << kPathDelimiter;
01886     fullpath << (*data)[EntnodeData::kName];
01887     if(data->GetType() == ENT_SUBDIR)
01888     {
01889         ResetView(fullpath, true);
01890     }
01891     else
01892     {
01893 #ifdef WIN32
01894         char viewer[_MAX_PATH];
01895         HINSTANCE hInst = FindExecutable((*data)[EntnodeData::kName],
01896             m_path, viewer);
01897         bool done = false;
01898         if(!useDefault && (UINT)hInst >= 32)
01899         {
01900             HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), "open", (*data)[EntnodeData::kName],
01901                 NULL, m_path, SW_SHOWDEFAULT);
01902             if((long)hInst < 32)
01903             {
01904                 cvs_err("Unable to open '%s' (error %d), using default viewer instead\n", (char *)fullpath, GetLastError());
01905             }
01906             else
01907                 done = true;
01908         }
01909
01910         if(!done)
01911         {
01912             const char * argv[3] = {0L, 0L, 0L};
01913             CStr program, file;
01914             if(strchr(gCvsPrefs.Viewer(), ' ') != 0L)
01915             {
01916                 program << '\"';
01917                 program << gCvsPrefs.Viewer();
01918                 program << '\"';
01919             }
01920             else
01921                 program = gCvsPrefs.Viewer();
01922             if(strchr(fullpath, ' ') != 0L)
01923             {
01924                 file << '\"';
01925                 file << fullpath;
01926                 file << '\"';
01927             }
01928             else
01929                 file = fullpath;
01930             argv[0] = program;
01931             argv[1] = file;
01932             int process = _spawnvp(_P_NOWAIT, gCvsPrefs.Viewer(), argv);
01933         }
01934 #endif
01935 #ifdef qUnix
01936         CStr fullpath;
01937         fullpath = m_path;
01938         if(!fullpath.endsWith(kPathDelimiter))
01939             fullpath << kPathDelimiter;
01940         fullpath << (*data)[EntnodeData::kName];
01941
01942         CvsArgs args(false);
01943         args.add(gCvsPrefs.Viewer());
01944         args.add(fullpath);
01945         UCvsApp::gApp->Execute(args.Argc(), args.Argv());
01946 #endif
01947     }
01948 }

const UMSGMAP * UCvsFiles::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 65 of file UCvsFiles.cpp.

void UCvsFiles::GetEntriesModTime | ( | time_t & | newEntriesMod,
 |  | time_t & | newEntriesLogMod
 | ) | [protected]

Definition at line 433 of file UCvsFiles.cpp.

References m_path, and stat.

Referenced by ResetView.

00434 {
00435     newEntriesMod = 0;
00436     newEntriesLogMod = 0;
00437     if(chdir(m_path) != 0)
00438         return;
00439     if(chdir("CVS") != 0)
00440         return;
00441
00442     struct stat sb;
00443     if (stat("Entries", &sb) != -1)
00444         newEntriesMod = sb.st_mtime;
00445     if (stat("Entries.log", &sb) != -1)
00446         newEntriesLogMod = sb.st_mtime;
00447     chdir(m_path);
00448 }

void * UCvsFiles::GetImageForEntry ( EntnodeData * data ) [static]

Definition at line 576 of file UCvsFiles.cpp.

References ENT_FILE, EntnodeData::GetType, EntnodeData::IsIgnored, EntnodeData::IsMissing, EntnodeData::IsRemoved, EntnodeData::IsUnknown, EntnodeData::IsUnmodified, EntnodeFile::kConflict, kFileIconAdded, kFileIconBinary, kFileIconBinaryMod, kFileIconConflict, kFileIconIgnored, kFileIconMiss, kFileIconRemoved, kFileIconText, kFileIconTextMod, kFileIconUnknown, kFolderIcon, kFolderIconIgnored, kFolderIconMiss, kFolderIconUnknown, EntnodeFile::kOption, sFileIconAddedIcon, sFileIconBinaryIcon, sFileIconBinaryModIcon, sFileIconConflictIcon, sFileIconIgnoredIcon, sFileIconMissIcon, sFileIconRemovedIcon, sFileIconTextIcon, sFileIconTextModIcon, sFileIconUnknownIcon, sFolderIconIcon, sFolderIconIgnoredIcon, sFolderIconMissIcon, and sFolderIconUnknownIcon.

Referenced by TViewFill::OnDirectory, TViewFill::OnFile, ResetView, and CWinLogRevData::UpdateSelf.

00577 {
00578     int result;
00579     void *resIcon = 0L;
00580
00581     if(data->GetType() == ENT_FILE)
00582     {
00583         const char *info = 0L;
00584         if(data->IsIgnored())
00585         {
00586             result = kFileIconIgnored;
00587         }
00588         else if(data->IsUnknown())
00589         {
00590             result = kFileIconUnknown;
00591         }
00592         else if(data->IsMissing())
00593         {
00594             result = data->IsRemoved() ? kFileIconRemoved : kFileIconMiss;
00595         }
00596         else if((*data)[EntnodeFile::kConflict] != 0L)
00597         {
00598             result = kFileIconConflict;
00599         }
00600         else if(data->IsRemoved())
00601         {
00602             result = kFileIconRemoved;
00603         }
00604         else if((info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-kb") == 0)
00605         {
00606             result = data->IsUnmodified() ? kFileIconBinary : kFileIconBinaryMod;
00607         }
00608         else
00609         {
00610             result = data->IsUnmodified() ? kFileIconText : kFileIconTextMod;
00611         }
00612     }
00613     else
00614     {
00615         if(data->IsIgnored())
00616         {
00617             result = kFolderIconIgnored;
00618         }
00619         else if(data->IsUnknown())
00620         {
00621             result = kFolderIconUnknown;
00622         }
00623         else if(data->IsMissing())
00624         {
00625             result = kFolderIconMiss;
00626         }
00627         else
00628         {
00629             result = kFolderIcon;
00630         }
00631     }
00632
00633 #if qGTK
00634     void *pixmap = 0L;
00635     switch(result)
00636     {
00637     case kFileIconText:
00638         pixmap = sFileIconTextIcon;
00639         break;
00640     case kFileIconBinary:
00641         pixmap = sFileIconBinaryIcon;
00642         break;
00643     case kFileIconUnknown:
00644         pixmap = sFileIconUnknownIcon;
00645         break;
00646     case kFileIconAdded:
00647         pixmap = sFileIconAddedIcon;
00648         break;
00649     case kFileIconConflict:
00650         pixmap = sFileIconConflictIcon;
00651         break;
00652     case kFileIconMiss:
00653         pixmap = sFileIconMissIcon;
00654         break;
00655     case kFolderIcon:
00656         pixmap = sFolderIconIcon;
00657         break;
00658     case kFolderIconUnknown:
00659         pixmap = sFolderIconUnknownIcon;
00660         break;
00661     case kFolderIconMiss:
00662         pixmap = sFolderIconMissIcon;
00663         break;
00664     case kFileIconTextMod:
00665         pixmap = sFileIconTextModIcon;
00666         break;
00667     case kFileIconBinaryMod:
00668         pixmap = sFileIconBinaryModIcon;
00669         break;
00670     case kFileIconIgnored:
00671         pixmap = sFileIconIgnoredIcon;
00672         break;
00673     case kFolderIconIgnored:
00674         pixmap = sFolderIconIgnoredIcon;
00675         break;
00676     case kFileIconRemoved:
00677         pixmap = sFileIconRemovedIcon;
00678         break;
00679     }
00680     if(pixmap != 0L)
00681     {
00682         resIcon = gtk_pixmap_new (GTK_PIXMAP(pixmap)->pixmap, GTK_PIXMAP(pixmap)->mask);
00683     }
00684 #endif
00685
00686     return resIcon;
00687 }

const UMSGMAP * UCvsFiles::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 65 of file UCvsFiles.cpp.

const URuntimeClass * UCvsFiles::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 63 of file UCvsFiles.cpp.

const UMSGMAP * UCvsFiles::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 65 of file UCvsFiles.cpp.

bool UCvsFiles::IsSortAscendant ( void ) [inline]

Definition at line 50 of file UCvsFiles.h.

References m_ascendant.

Referenced by compareConflict, compareName, compareOption, compareRevs, compareStatus, and compareTag.

00050 { return m_ascendant; }

int UCvsFiles::OnCmdAdd ( void ) [protected]

Definition at line 1037 of file UCvsFiles.cpp.

References CStr, CvsCmdAddFiles, CvsCmdAddFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01038 {
01039     int nItem = -1;
01040
01041     MultiFiles mf;
01042     mf.newdir(m_path);
01043
01044     // first add the folders
01045     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01046     {
01047         EntnodeData *data;
01048         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01049
01050         if(data->GetType() == ENT_SUBDIR)
01051         {
01052             CStr fullpath;
01053             fullpath = m_path;
01054             if(!fullpath.endsWith(kPathDelimiter))
01055                 fullpath << kPathDelimiter;
01056             fullpath << (*data)[EntnodeData::kName];
01057             CvsCmdAddFolder(fullpath);
01058         }
01059         else
01060         {
01061             mf.newfile((*data)[EntnodeData::kName]);
01062         }
01063     }
01064     if(mf.NumFiles() != 0)
01065     {
01066         CvsCmdAddFiles(&mf);
01067     }
01068     return 0;
01069 }

int UCvsFiles::OnCmdAddb ( void ) [protected]

Definition at line 1071 of file UCvsFiles.cpp.

References CStr, CvsCmdAddBinaryFiles, CvsCmdAddFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01072 {
01073     int nItem = -1;
01074
01075     MultiFiles mf;
01076     mf.newdir(m_path);
01077
01078     // first add the folders
01079     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01080     {
01081         EntnodeData *data;
01082         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01083
01084         if(data->GetType() == ENT_SUBDIR)
01085         {
01086             CStr fullpath;
01087             fullpath = m_path;
01088             if(!fullpath.endsWith(kPathDelimiter))
01089                 fullpath << kPathDelimiter;
01090             fullpath << (*data)[EntnodeData::kName];
01091             CvsCmdAddFolder(fullpath);
01092         }
01093         else
01094         {
01095             mf.newfile((*data)[EntnodeData::kName]);
01096         }
01097     }
01098     if(mf.NumFiles() != 0)
01099     {
01100         CvsCmdAddBinaryFiles(&mf);
01101     }
01102     return 0;
01103 }

int UCvsFiles::OnCmdCommit ( void ) [protected]

Definition at line 1105 of file UCvsFiles.cpp.

References CStr, CvsCmdCommitFiles, CvsCmdCommitFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01106 {
01107     int nItem = -1;
01108
01109     MultiFiles mf;
01110     mf.newdir(m_path);
01111
01112     // first add the folders
01113     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01114     {
01115         EntnodeData *data;
01116         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01117
01118         if(data->GetType() == ENT_SUBDIR)
01119         {
01120             CStr fullpath;
01121             fullpath = m_path;
01122             if(!fullpath.endsWith(kPathDelimiter))
01123                 fullpath << kPathDelimiter;
01124             fullpath << (*data)[EntnodeData::kName];
01125             CvsCmdCommitFolder(fullpath);
01126         }
01127         else
01128         {
01129             mf.newfile((*data)[EntnodeData::kName]);
01130         }
01131     }
01132     if(mf.NumFiles() != 0)
01133     {
01134         CvsCmdCommitFiles(&mf);
01135     }
01136     return 0;
01137 }

int UCvsFiles::OnCmdDiff ( void ) [protected]

Definition at line 1268 of file UCvsFiles.cpp.

References CStr, CvsCmdDiffFiles, CvsCmdDiffFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01269 {
01270     int nItem = -1;
01271
01272     MultiFiles mf;
01273     mf.newdir(m_path);
01274
01275     // first add the folders
01276     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01277     {
01278         EntnodeData *data;
01279         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01280
01281         if(data->GetType() == ENT_SUBDIR)
01282         {
01283             CStr fullpath;
01284             fullpath = m_path;
01285             if(!fullpath.endsWith(kPathDelimiter))
01286                 fullpath << kPathDelimiter;
01287             fullpath << (*data)[EntnodeData::kName];
01288             CvsCmdDiffFolder(fullpath);
01289         }
01290         else
01291         {
01292             mf.newfile((*data)[EntnodeData::kName]);
01293         }
01294     }
01295     if(mf.NumFiles() != 0)
01296     {
01297         CvsCmdDiffFiles(&mf);
01298     }
01299     return 0;
01300 }

int UCvsFiles::OnCmdEdit ( void ) [protected]

Definition at line 1531 of file UCvsFiles.cpp.

References CStr, CvsCmdEditFiles, CvsCmdEditFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01532 {
01533     int nItem = -1;
01534
01535     MultiFiles mf;
01536     mf.newdir(m_path);
01537
01538     // first add the folders
01539     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01540     {
01541         EntnodeData *data;
01542         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01543
01544         if(data->GetType() == ENT_SUBDIR)
01545         {
01546             CStr fullpath;
01547             fullpath = m_path;
01548             if(!fullpath.endsWith(kPathDelimiter))
01549                 fullpath << kPathDelimiter;
01550             fullpath << (*data)[EntnodeData::kName];
01551             CvsCmdEditFolder(fullpath);
01552         }
01553         else
01554         {
01555             mf.newfile((*data)[EntnodeData::kName]);
01556         }
01557     }
01558     if(mf.NumFiles() != 0)
01559     {
01560         CvsCmdEditFiles(&mf);
01561     }
01562     return 0;
01563 }

int UCvsFiles::OnCmdEditors ( void ) [protected]

Definition at line 1633 of file UCvsFiles.cpp.

References CStr, CvsCmdEditorsFiles, CvsCmdEditorsFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01634 {
01635     int nItem = -1;
01636
01637     MultiFiles mf;
01638     mf.newdir(m_path);
01639
01640     // first add the folders
01641     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01642     {
01643         EntnodeData *data;
01644         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01645
01646         if(data->GetType() == ENT_SUBDIR)
01647         {
01648             CStr fullpath;
01649             fullpath = m_path;
01650             if(!fullpath.endsWith(kPathDelimiter))
01651                 fullpath << kPathDelimiter;
01652             fullpath << (*data)[EntnodeData::kName];
01653             CvsCmdEditorsFolder(fullpath);
01654         }
01655         else
01656         {
01657             mf.newfile((*data)[EntnodeData::kName]);
01658         }
01659     }
01660     if(mf.NumFiles() != 0)
01661     {
01662         CvsCmdEditorsFiles(&mf);
01663     }
01664     return 0;
01665 }

int UCvsFiles::OnCmdEditsel ( void ) [protected]

Definition at line 1833 of file UCvsFiles.cpp.

References EditSel, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, UCmdTarget::GetWidID, kUMainWidget, UEventSendMessage, and UMAKEINT.

01834 {
01835     int nItem = -1;
01836
01837     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01838     {
01839         EntnodeData *data;
01840         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01841         EditSel(data);
01842     }
01843     return 0;
01844 }

int UCvsFiles::OnCmdEditseldef ( void ) [protected]

Definition at line 1846 of file UCvsFiles.cpp.

References EditSel, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, UCmdTarget::GetWidID, kUMainWidget, UEventSendMessage, and UMAKEINT.

01847 {
01848     int nItem = -1;
01849
01850     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01851     {
01852         EntnodeData *data;
01853         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01854         EditSel(data, true);
01855     }
01856     return 0;
01857 }

int UCvsFiles::OnCmdExplore ( void ) [protected]

Definition at line 1792 of file UCvsFiles.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, CStr, cvs_err, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, UCvsApp::Execute, UCvsApp::gApp, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, UEventSendMessage, and UMAKEINT.

01793 {
01794     int nItem = -1;
01795
01796     // first add the folders
01797     if((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01798     {
01799         EntnodeData *data;
01800         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01801
01802         CStr fullpath;
01803         fullpath = m_path;
01804         if(!fullpath.endsWith(kPathDelimiter))
01805             fullpath << kPathDelimiter;
01806         fullpath << (*data)[EntnodeData::kName];
01807
01808 #ifdef WIN32
01809         HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), "explore", fullpath,
01810                                        0L, 0L, SW_SHOWDEFAULT);
01811         if((long)hInst < 32)
01812         {
01813             cvs_err("Unable to explore '%s' (error %d)\n", (char *)m_path, GetLastError());
01814         }
01815 #endif
01816 #ifdef qUnix
01817         CvsArgs args(false);
01818         args.add(gCvsPrefs.Browser());
01819         args.add(fullpath);
01820         UCvsApp::gApp->Execute(args.Argc(), args.Argv());
01821 #endif
01822     }
01823     return 0;
01824 }

int UCvsFiles::OnCmdGraph ( void ) [protected]

Definition at line 1336 of file UCvsFiles.cpp.

References CvsCmdLogFiles, ENT_FILE, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01337 {
01338     int nItem = -1;
01339
01340     MultiFiles mf;
01341     mf.newdir(m_path);
01342
01343     // first add the folders
01344     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01345     {
01346         EntnodeData *data;
01347         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01348
01349         if(data->GetType() != ENT_FILE)
01350             continue;
01351
01352         mf.newfile((*data)[EntnodeData::kName]);
01353     }
01354     if(mf.NumFiles() != 0)
01355     {
01356         CvsCmdLogFiles(&mf, true);
01357     }
01358     return 0;
01359 }

int UCvsFiles::OnCmdIgnore ( void ) [protected]

Definition at line 1826 of file UCvsFiles.cpp.

References ResetView.

01827 {
01828     gFileViewIgnore = !(bool)gFileViewIgnore;
01829     ResetView(true, true);
01830     return 0;
01831 }

int UCvsFiles::OnCmdLock ( void ) [protected]

Definition at line 1395 of file UCvsFiles.cpp.

References CStr, CvsCmdLockFiles, CvsCmdLockFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01396 {
01397     int nItem = -1;
01398
01399     MultiFiles mf;
01400     mf.newdir(m_path);
01401
01402     // first add the folders
01403     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01404     {
01405         EntnodeData *data;
01406         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01407
01408         if(data->GetType() == ENT_SUBDIR)
01409         {
01410             CStr fullpath;
01411             fullpath = m_path;
01412             if(!fullpath.endsWith(kPathDelimiter))
01413                 fullpath << kPathDelimiter;
01414             fullpath << (*data)[EntnodeData::kName];
01415             CvsCmdLockFolder(fullpath);
01416         }
01417         else
01418         {
01419             mf.newfile((*data)[EntnodeData::kName]);
01420         }
01421     }
01422     if(mf.NumFiles() != 0)
01423     {
01424         CvsCmdLockFiles(&mf);
01425     }
01426     return 0;
01427 }

int UCvsFiles::OnCmdLog ( void ) [protected]

Definition at line 1302 of file UCvsFiles.cpp.

References CStr, CvsCmdLogFiles, CvsCmdLogFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01303 {
01304     int nItem = -1;
01305
01306     MultiFiles mf;
01307     mf.newdir(m_path);
01308
01309     // first add the folders
01310     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01311     {
01312         EntnodeData *data;
01313         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01314
01315         if(data->GetType() == ENT_SUBDIR)
01316         {
01317             CStr fullpath;
01318             fullpath = m_path;
01319             if(!fullpath.endsWith(kPathDelimiter))
01320                 fullpath << kPathDelimiter;
01321             fullpath << (*data)[EntnodeData::kName];
01322             CvsCmdLogFolder(fullpath);
01323         }
01324         else
01325         {
01326             mf.newfile((*data)[EntnodeData::kName]);
01327         }
01328     }
01329     if(mf.NumFiles() != 0)
01330     {
01331         CvsCmdLogFiles(&mf);
01332     }
01333     return 0;
01334 }

int UCvsFiles::OnCmdQueryUpdate ( void ) [protected]

Definition at line 1164 of file UCvsFiles.cpp.

References CStr, CvsCmdUpdateFiles, CvsCmdUpdateFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01165 {
01166     int nItem = -1;
01167
01168     MultiFiles mf;
01169     mf.newdir(m_path);
01170
01171     // first add the folders
01172     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01173     {
01174         EntnodeData *data;
01175         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01176
01177         if(data->GetType() == ENT_SUBDIR)
01178         {
01179             CStr fullpath;
01180             fullpath = m_path;
01181             if(!fullpath.endsWith(kPathDelimiter))
01182                 fullpath << kPathDelimiter;
01183             fullpath << (*data)[EntnodeData::kName];
01184             CvsCmdUpdateFolder(fullpath, true);
01185         }
01186         else
01187         {
01188             mf.newfile((*data)[EntnodeData::kName]);
01189         }
01190     }
01191     if(mf.NumFiles() != 0)
01192     {
01193         CvsCmdUpdateFiles(&mf, true);
01194     }
01195     return 0;
01196 }

int UCvsFiles::OnCmdRelease ( void ) [protected]

Definition at line 1667 of file UCvsFiles.cpp.

References CStr, CvsCmdReleaseFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, UEventSendMessage, and UMAKEINT.

01668 {
01669     int nItem = -1;
01670
01671     // first add the folders
01672     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01673     {
01674         EntnodeData *data;
01675         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01676
01677         if(data->GetType() == ENT_SUBDIR)
01678         {
01679             CStr fullpath;
01680             fullpath = m_path;
01681             if(!fullpath.endsWith(kPathDelimiter))
01682                 fullpath << kPathDelimiter;
01683             fullpath << (*data)[EntnodeData::kName];
01684             CvsCmdReleaseFolder(fullpath);
01685         }
01686     }
01687     return 0;
01688 }

int UCvsFiles::OnCmdReload ( void ) [protected]

Definition at line 1198 of file UCvsFiles.cpp.

References ResetView.

01199 {
01200     ResetView(true, true);
01201     return 0;
01202 }

int UCvsFiles::OnCmdRmv ( void ) [protected]

Definition at line 1139 of file UCvsFiles.cpp.

References CvsCmdRemoveFiles, ENT_FILE, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01140 {
01141     int nItem = -1;
01142
01143     MultiFiles mf;
01144     mf.newdir(m_path);
01145
01146     // first add the folders
01147     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01148     {
01149         EntnodeData *data;
01150         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01151
01152         if(data->GetType() != ENT_FILE)
01153             continue;
01154
01155         mf.newfile((*data)[EntnodeData::kName]);
01156     }
01157     if(mf.NumFiles() != 0)
01158     {
01159         CvsCmdRemoveFiles(&mf);
01160     }
01161     return 0;
01162 }

int UCvsFiles::OnCmdStatus ( void ) [protected]

Definition at line 1361 of file UCvsFiles.cpp.

References CStr, CvsCmdStatusFiles, CvsCmdStatusFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01362 {
01363     int nItem = -1;
01364
01365     MultiFiles mf;
01366     mf.newdir(m_path);
01367
01368     // first add the folders
01369     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01370     {
01371         EntnodeData *data;
01372         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01373
01374         if(data->GetType() == ENT_SUBDIR)
01375         {
01376             CStr fullpath;
01377             fullpath = m_path;
01378             if(!fullpath.endsWith(kPathDelimiter))
01379                 fullpath << kPathDelimiter;
01380             fullpath << (*data)[EntnodeData::kName];
01381             CvsCmdStatusFolder(fullpath);
01382         }
01383         else
01384         {
01385             mf.newfile((*data)[EntnodeData::kName]);
01386         }
01387     }
01388     if(mf.NumFiles() != 0)
01389     {
01390         CvsCmdStatusFiles(&mf);
01391     }
01392     return 0;
01393 }

int UCvsFiles::OnCmdTagBranch ( void ) [protected]

Definition at line 1758 of file UCvsFiles.cpp.

References CStr, CvsCmdTagBranchFiles, CvsCmdTagBranchFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01759 {
01760     int nItem = -1;
01761
01762     MultiFiles mf;
01763     mf.newdir(m_path);
01764
01765     // first add the folders
01766     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01767     {
01768         EntnodeData *data;
01769         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01770
01771         if(data->GetType() == ENT_SUBDIR)
01772         {
01773             CStr fullpath;
01774             fullpath = m_path;
01775             if(!fullpath.endsWith(kPathDelimiter))
01776                 fullpath << kPathDelimiter;
01777             fullpath << (*data)[EntnodeData::kName];
01778             CvsCmdTagBranchFolder(fullpath);
01779         }
01780         else
01781         {
01782             mf.newfile((*data)[EntnodeData::kName]);
01783         }
01784     }
01785     if(mf.NumFiles() != 0)
01786     {
01787         CvsCmdTagBranchFiles(&mf);
01788     }
01789     return 0;
01790 }

int UCvsFiles::OnCmdTagDelete ( void ) [protected]

Definition at line 1724 of file UCvsFiles.cpp.

References CStr, CvsCmdTagDeleteFiles, CvsCmdTagDeleteFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01725 {
01726     int nItem = -1;
01727
01728     MultiFiles mf;
01729     mf.newdir(m_path);
01730
01731     // first add the folders
01732     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01733     {
01734         EntnodeData *data;
01735         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01736
01737         if(data->GetType() == ENT_SUBDIR)
01738         {
01739             CStr fullpath;
01740             fullpath = m_path;
01741             if(!fullpath.endsWith(kPathDelimiter))
01742                 fullpath << kPathDelimiter;
01743             fullpath << (*data)[EntnodeData::kName];
01744             CvsCmdTagDeleteFolder(fullpath);
01745         }
01746         else
01747         {
01748             mf.newfile((*data)[EntnodeData::kName]);
01749         }
01750     }
01751     if(mf.NumFiles() != 0)
01752     {
01753         CvsCmdTagDeleteFiles(&mf);
01754     }
01755     return 0;
01756 }

int UCvsFiles::OnCmdTagNew ( void ) [protected]

Definition at line 1690 of file UCvsFiles.cpp.

References CStr, CvsCmdTagCreateFiles, CvsCmdTagCreateFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01691 {
01692     int nItem = -1;
01693
01694     MultiFiles mf;
01695     mf.newdir(m_path);
01696
01697     // first add the folders
01698     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01699     {
01700         EntnodeData *data;
01701         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01702
01703         if(data->GetType() == ENT_SUBDIR)
01704         {
01705             CStr fullpath;
01706             fullpath = m_path;
01707             if(!fullpath.endsWith(kPathDelimiter))
01708                 fullpath << kPathDelimiter;
01709             fullpath << (*data)[EntnodeData::kName];
01710             CvsCmdTagCreateFolder(fullpath);
01711         }
01712         else
01713         {
01714             mf.newfile((*data)[EntnodeData::kName]);
01715         }
01716     }
01717     if(mf.NumFiles() != 0)
01718     {
01719         CvsCmdTagCreateFiles(&mf);
01720     }
01721     return 0;
01722 }

int UCvsFiles::OnCmdTrash ( void ) [protected]

Definition at line 1212 of file UCvsFiles.cpp.

References MultiFiles::add, CvsArgs::Argc, CvsArgs::Argv, CompatMoveToTrash, CStr, cvs_err, cvs_out, ENT_FILE, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::next, MultiFiles::NumFiles, ResetView, UEventSendMessage, and UMAKEINT.

01213 {
01214     int nItem = -1;
01215
01216     MultiFiles mf;
01217     mf.newdir(m_path);
01218
01219     // first add the folders
01220     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01221     {
01222         EntnodeData *data;
01223         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01224
01225         if(data->GetType() != ENT_FILE)
01226             continue;
01227
01228         mf.newfile((*data)[EntnodeData::kName]);
01229     }
01230
01231     if(mf.NumFiles() != 0)
01232     {
01233         CvsArgs args(false);
01234         mf.next();
01235         const char *dir = mf.add(args);
01236         char * const *argv = args.Argv();
01237         int argc = args.Argc();
01238         for(int i = 0; i < argc; i++)
01239         {
01240             CStr fullpath(dir);
01241             if(!fullpath.empty() && !fullpath.endsWith(kPathDelimiter))
01242             {
01243                 fullpath << kPathDelimiter;
01244             }
01245             fullpath << argv[i];
01246
01247             if(chmod(fullpath, 0666) != 0)
01248             {
01249                 cvs_err("Unable to change permission on '%s' (error %d)\n", (const char *)fullpath, errno);
01250                 continue;
01251             }
01252
01253             if(!CompatMoveToTrash(argv[i], dir))
01254                 cvs_err("Unable to remove '%s' (error %d)\n", (const char *)fullpath, errno);
01255             else
01256 #ifdef WIN32
01257                 cvs_out("'%s' has been moved successfully to the recycle bin...\n", (const char *)fullpath);
01258 #else
01259                 cvs_out("'%s' has been deleted successfully...\n", (const char *)fullpath);
01260 #endif
01261             }
01262
01263         ResetView(true);
01264     }
01265     return 0;
01266 }

void UCvsFiles::OnCmdUIAdd ( UCmdUI * pCmdUI ) [protected]

Definition at line 768 of file UCvsFiles.cpp.

References DisableGeneric, UCmdUI::Enable, ENT_FILE, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::IsMissing, EntnodeData::IsRemoved, EntnodeData::IsUnknown, kUMainWidget, UEventSendMessage, and UMAKEINT.

00769 {
00770     if(DisableGeneric())
00771     {
00772         pCmdUI->Enable(false);
00773         return;
00774     }
00775
00776     int nItem = -1;
00777     bool res = true;
00778     int numFiles = 0;
00779     int numFolders = 0;
00780
00781     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00782     {
00783         EntnodeData *data;
00784         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00785
00786         if(!(data->IsUnknown() || (data->IsRemoved() && data->IsMissing())))
00787         {
00788             res = false;
00789             break;
00790         }
00791         if(data->GetType() == ENT_FILE)
00792         {
00793             numFiles++;
00794         }
00795         else
00796             numFolders++;
00797
00798         if((numFiles != 0 && numFolders != 0) || numFolders > 1)
00799         {
00800             res = false;
00801             break;
00802         }
00803     }
00804
00805     pCmdUI->Enable(res);
00806 }

void UCvsFiles::OnCmdUIAddB ( UCmdUI * pCmdUI ) [protected]

Definition at line 808 of file UCvsFiles.cpp.

References DisableGeneric, UCmdUI::Enable, ENT_FILE, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::IsMissing, EntnodeData::IsRemoved, EntnodeData::IsUnknown, kUMainWidget, UEventSendMessage, and UMAKEINT.

00809 {
00810     if(DisableGeneric())
00811     {
00812         pCmdUI->Enable(false);
00813         return;
00814     }
00815
00816     int nItem = -1;
00817     bool res = true;
00818
00819     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00820     {
00821         EntnodeData *data;
00822         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00823
00824         if(data->GetType() != ENT_FILE)
00825         {
00826             res = false;
00827             break;
00828         }
00829         if(!(data->IsUnknown() || (data->IsRemoved() && data->IsMissing())))
00830         {
00831             res = false;
00832             break;
00833         }
00834     }
00835
00836     pCmdUI->Enable(res);
00837 }

void UCvsFiles::OnCmdUIEditseldef ( UCmdUI * pCmdUI ) [protected]

Definition at line 925 of file UCvsFiles.cpp.

References CStr, DisableGeneric, UCmdUI::Enable, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::IsMissing, kUMainWidget, UCmdUI::SetText, UEventSendMessage, and UMAKEINT.

00926 {
00927     if(DisableGeneric())
00928     {
00929         pCmdUI->Enable(false);
00930         return;
00931     }
00932
00933     int nItem = -1;
00934     bool res = true;
00935
00936     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00937     {
00938         EntnodeData *data;
00939         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00940
00941         if(data->GetType() == ENT_SUBDIR || data->IsMissing())
00942         {
00943             res = false;
00944             break;
00945         }
00946     }
00947
00948     pCmdUI->Enable(res);
00949     if(gCvsPrefs.Viewer() != 0L)
00950     {
00951         CStr title("Edit with ");
00952         title << gCvsPrefs.Viewer();
00953         pCmdUI->SetText(title);
00954     }
00955 }

void UCvsFiles::OnCmdUIExplore ( UCmdUI * pCmdUI ) [protected]

Definition at line 992 of file UCvsFiles.cpp.

References DisableGeneric, UCmdUI::Enable, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, UCmdTarget::GetWidID, EntnodeData::IsMissing, kUMainWidget, UEventSendMessage, and UMAKEINT.

00993 {
00994     if(DisableGeneric())
00995     {
00996         pCmdUI->Enable(false);
00997         return;
00998     }
00999
01000     int nItem = -1;
01001     bool res = true;
01002     int numItem = 0;
01003
01004     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01005     {
01006         EntnodeData *data;
01007         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01008
01009         if(data->IsMissing() || ++numItem > 1)
01010         {
01011             res = false;
01012             break;
01013         }
01014     }
01015
01016     pCmdUI->Enable(res);
01017 }

void UCvsFiles::OnCmdUIGraph ( UCmdUI * pCmdUI ) [protected]

Definition at line 899 of file UCvsFiles.cpp.

References DisableGeneric, UCmdUI::Enable, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::IsUnknown, kUMainWidget, UEventSendMessage, and UMAKEINT.

00900 {
00901     if(DisableGeneric())
00902     {
00903         pCmdUI->Enable(false);
00904         return;
00905     }
00906
00907     int nItem = -1;
00908     bool res = true;
00909
00910     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00911     {
00912         EntnodeData *data;
00913         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00914
00915         if(data->IsUnknown() || data->GetType() == ENT_SUBDIR)
00916         {
00917             res = false;
00918             break;
00919         }
00920     }
00921
00922     pCmdUI->Enable(res);
00923 }

void UCvsFiles::OnCmdUIIgnore ( UCmdUI * pCmdUI ) [protected]

Definition at line 1019 of file UCvsFiles.cpp.

References UCmdUI::Check, DisableGeneric, and UCmdUI::Enable.

01020 {
01021     pCmdUI->Enable(!DisableGeneric());
01022     pCmdUI->Check(gFileViewIgnore);
01023 }

void UCvsFiles::OnCmdUIMacroSel | ( | int | cmd,
 |  | UCmdUI * | pCmdUI
 | ) | [protected]

Definition at line 1025 of file UCvsFiles.cpp.

References DisableGeneric, UCmdUI::Enable, EV_LIST_GETNEXTSEL, UCmdTarget::GetWidID, CTcl_Interp::IsAvail, kUMainWidget, UEventSendMessage, and UMAKEINT.

01026 {
01027     if(DisableGeneric())
01028     {
01029         pCmdUI->Enable(false);
01030         return;
01031     }
01032
01033     int nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, -1), 0L);
01034     pCmdUI->Enable(nItem != -1 && CTcl_Interp::IsAvail());
01035 }

void UCvsFiles::OnCmdUIRelease ( UCmdUI * pCmdUI ) [protected]

Definition at line 839 of file UCvsFiles.cpp.

References DisableGeneric, UCmdUI::Enable, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::IsUnknown, kUMainWidget, UEventSendMessage, and UMAKEINT.

00840 {
00841     if(DisableGeneric())
00842     {
00843         pCmdUI->Enable(false);
00844         return;
00845     }
00846
00847     int nItem = -1;
00848     bool res = true;
00849     int numFolders = 0;
00850
00851     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00852     {
00853         EntnodeData *data;
00854         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00855
00856         if(data->IsUnknown() || data->GetType() != ENT_SUBDIR)
00857         {
00858             res = false;
00859             break;
00860         }
00861         numFolders++;
00862
00863         if(numFolders > 1)
00864         {
00865             res = false;
00866             break;
00867         }
00868     }
00869
00870     pCmdUI->Enable(res);
00871 }

void UCvsFiles::OnCmdUIReload ( UCmdUI * pCmdUI ) [protected]

Definition at line 957 of file UCvsFiles.cpp.

References DisableGeneric, and UCmdUI::Enable.

00958 {
00959     pCmdUI->Enable(!DisableGeneric());
00960 }

void UCvsFiles::OnCmdUIRmv ( UCmdUI * pCmdUI ) [protected]

Definition at line 873 of file UCvsFiles.cpp.

References DisableGeneric, UCmdUI::Enable, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::IsRemoved, EntnodeData::IsUnknown, kUMainWidget, UEventSendMessage, and UMAKEINT.

00874 {
00875     if(DisableGeneric())
00876     {
00877         pCmdUI->Enable(false);
00878         return;
00879     }
00880
00881     int nItem = -1;
00882     bool res = true;
00883
00884     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00885     {
00886         EntnodeData *data;
00887         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00888
00889         if(data->IsUnknown() || data->IsRemoved() || data->GetType() == ENT_SUBDIR)
00890         {
00891             res = false;
00892             break;
00893         }
00894     }
00895
00896     pCmdUI->Enable(res);
00897 }

void UCvsFiles::OnCmdUITrash ( UCmdUI * pCmdUI ) [protected]

Definition at line 967 of file UCvsFiles.cpp.

References DisableGeneric, UCmdUI::Enable, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::IsMissing, kUMainWidget, UEventSendMessage, and UMAKEINT.

00968 {
00969     if(DisableGeneric())
00970     {
00971         pCmdUI->Enable(false);
00972         return;
00973     }
00974
00975     int nItem = -1;
00976     bool res = true;
00977
00978     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00979     {
00980         EntnodeData *data;
00981         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00982         if(data->GetType() == ENT_SUBDIR || data->IsMissing())
00983         {
00984             res = false;
00985             break;
00986         }
00987     }
00988
00989     pCmdUI->Enable(res);
00990 }

void UCvsFiles::OnCmdUIUpdate ( UCmdUI * pCmdUI ) [protected]

Definition at line 730 of file UCvsFiles.cpp.

References DisableGeneric, UCmdUI::Enable, ENT_FILE, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::IsUnknown, kUMainWidget, UEventSendMessage, and UMAKEINT.

00731 {
00732     if(DisableGeneric())
00733     {
00734         pCmdUI->Enable(false);
00735         return;
00736     }
00737
00738     int nItem = -1;
00739     bool res = true;
00740     int numFiles = 0;
00741     int numFolders = 0;
00742
00743     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00744     {
00745         EntnodeData *data;
00746         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00747
00748         if(data->IsUnknown())
00749         {
00750             res = false;
00751             break;
00752         }
00753         if(data->GetType() == ENT_FILE)
00754             numFiles++;
00755         else
00756             numFolders++;
00757
00758         if((numFiles != 0 && numFolders != 0) || numFolders > 1)
00759         {
00760             res = false;
00761             break;
00762         }
00763     }
00764
00765     pCmdUI->Enable(res);
00766 }

void UCvsFiles::OnCmdUIUpone ( UCmdUI * pCmdUI ) [protected]

Definition at line 962 of file UCvsFiles.cpp.

References DisableGeneric, and UCmdUI::Enable.

00963 {
00964     pCmdUI->Enable(!DisableGeneric());
00965 }

int UCvsFiles::OnCmdUnedit ( void ) [protected]

Definition at line 1565 of file UCvsFiles.cpp.

References CStr, CvsCmdUneditFiles, CvsCmdUneditFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01566 {
01567     int nItem = -1;
01568
01569     MultiFiles mf;
01570     mf.newdir(m_path);
01571
01572     // first add the folders
01573     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01574     {
01575         EntnodeData *data;
01576         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01577
01578         if(data->GetType() == ENT_SUBDIR)
01579         {
01580             CStr fullpath;
01581             fullpath = m_path;
01582             if(!fullpath.endsWith(kPathDelimiter))
01583                 fullpath << kPathDelimiter;
01584             fullpath << (*data)[EntnodeData::kName];
01585             CvsCmdUneditFolder(fullpath);
01586         }
01587         else
01588         {
01589             mf.newfile((*data)[EntnodeData::kName]);
01590         }
01591     }
01592     if(mf.NumFiles() != 0)
01593     {
01594         CvsCmdUneditFiles(&mf);
01595     }
01596     return 0;
01597 }

int UCvsFiles::OnCmdUnlock ( void ) [protected]

Definition at line 1429 of file UCvsFiles.cpp.

References CStr, CvsCmdUnlockFiles, CvsCmdUnlockFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01430 {
01431     int nItem = -1;
01432
01433     MultiFiles mf;
01434     mf.newdir(m_path);
01435
01436     // first add the folders
01437     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01438     {
01439         EntnodeData *data;
01440         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01441
01442         if(data->GetType() == ENT_SUBDIR)
01443         {
01444             CStr fullpath;
01445             fullpath = m_path;
01446             if(!fullpath.endsWith(kPathDelimiter))
01447                 fullpath << kPathDelimiter;
01448             fullpath << (*data)[EntnodeData::kName];
01449             CvsCmdUnlockFolder(fullpath);
01450         }
01451         else
01452         {
01453             mf.newfile((*data)[EntnodeData::kName]);
01454         }
01455     }
01456     if(mf.NumFiles() != 0)
01457     {
01458         CvsCmdUnlockFiles(&mf);
01459     }
01460     return 0;
01461 }

int UCvsFiles::OnCmdUpdate ( void ) [protected]

Definition at line 690 of file UCvsFiles.cpp.

References CStr, CvsCmdUpdateFiles, CvsCmdUpdateFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

00691 {
00692     int nItem = -1;
00693
00694     MultiFiles mf;
00695     mf.newdir(m_path);
00696
00697     // first add the folders
00698     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00699     {
00700         EntnodeData *data;
00701         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00702
00703         if(data->GetType() == ENT_SUBDIR)
00704         {
00705             CStr fullpath;
00706             fullpath = m_path;
00707             if(!fullpath.endsWith(kPathDelimiter))
00708                 fullpath << kPathDelimiter;
00709             fullpath << (*data)[EntnodeData::kName];
00710             CvsCmdUpdateFolder(fullpath);
00711         }
00712         else
00713         {
00714             mf.newfile((*data)[EntnodeData::kName]);
00715         }
00716     }
00717     if(mf.NumFiles() != 0)
00718     {
00719         CvsCmdUpdateFiles(&mf);
00720     }
00721     return 0;
00722 }

int UCvsFiles::OnCmdUpone ( void ) [protected]

Definition at line 1204 of file UCvsFiles.cpp.

References m_path, ResetView, and SplitPath.

01205 {
01206     UStr uppath, filename;
01207     SplitPath(m_path, uppath, filename);
01208     ResetView(uppath, true);
01209     return 0;
01210 }

int UCvsFiles::OnCmdWatchers ( void ) [protected]

Definition at line 1599 of file UCvsFiles.cpp.

References CStr, CvsCmdWatchersFiles, CvsCmdWatchersFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01600 {
01601     int nItem = -1;
01602
01603     MultiFiles mf;
01604     mf.newdir(m_path);
01605
01606     // first add the folders
01607     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01608     {
01609         EntnodeData *data;
01610         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01611
01612         if(data->GetType() == ENT_SUBDIR)
01613         {
01614             CStr fullpath;
01615             fullpath = m_path;
01616             if(!fullpath.endsWith(kPathDelimiter))
01617                 fullpath << kPathDelimiter;
01618             fullpath << (*data)[EntnodeData::kName];
01619             CvsCmdWatchersFolder(fullpath);
01620         }
01621         else
01622         {
01623             mf.newfile((*data)[EntnodeData::kName]);
01624         }
01625     }
01626     if(mf.NumFiles() != 0)
01627     {
01628         CvsCmdWatchersFiles(&mf);
01629     }
01630     return 0;
01631 }

int UCvsFiles::OnCmdWatchOff ( void ) [protected]

Definition at line 1497 of file UCvsFiles.cpp.

References CStr, CvsCmdWatchOffFiles, CvsCmdWatchOffFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01498 {
01499     int nItem = -1;
01500
01501     MultiFiles mf;
01502     mf.newdir(m_path);
01503
01504     // first add the folders
01505     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01506     {
01507         EntnodeData *data;
01508         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01509
01510         if(data->GetType() == ENT_SUBDIR)
01511         {
01512             CStr fullpath;
01513             fullpath = m_path;
01514             if(!fullpath.endsWith(kPathDelimiter))
01515                 fullpath << kPathDelimiter;
01516             fullpath << (*data)[EntnodeData::kName];
01517             CvsCmdWatchOffFolder(fullpath);
01518         }
01519         else
01520         {
01521             mf.newfile((*data)[EntnodeData::kName]);
01522         }
01523     }
01524     if(mf.NumFiles() != 0)
01525     {
01526         CvsCmdWatchOffFiles(&mf);
01527     }
01528     return 0;
01529 }

int UCvsFiles::OnCmdWatchOn ( void ) [protected]

Definition at line 1463 of file UCvsFiles.cpp.

References CStr, CvsCmdWatchOnFiles, CvsCmdWatchOnFolder, ENT_SUBDIR, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, EntnodeData::GetType, UCmdTarget::GetWidID, EntnodeData::kName, kUMainWidget, m_path, MultiFiles::newdir, MultiFiles::newfile, MultiFiles::NumFiles, UEventSendMessage, and UMAKEINT.

01464 {
01465     int nItem = -1;
01466
01467     MultiFiles mf;
01468     mf.newdir(m_path);
01469
01470     // first add the folders
01471     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01472     {
01473         EntnodeData *data;
01474         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01475
01476         if(data->GetType() == ENT_SUBDIR)
01477         {
01478             CStr fullpath;
01479             fullpath = m_path;
01480             if(!fullpath.endsWith(kPathDelimiter))
01481                 fullpath << kPathDelimiter;
01482             fullpath << (*data)[EntnodeData::kName];
01483             CvsCmdWatchOnFolder(fullpath);
01484         }
01485         else
01486         {
01487             mf.newfile((*data)[EntnodeData::kName]);
01488         }
01489     }
01490     if(mf.NumFiles() != 0)
01491     {
01492         CvsCmdWatchOnFiles(&mf);
01493     }
01494     return 0;
01495 }

void UCvsFiles::OnCreate ( ) [protected]

Definition at line 386 of file UCvsFiles.cpp.

References _gnColumnWidth, _gszColumnLabel, EV_LIST_ADDCOLUMNS, EV_LIST_SETCOLTITLE, EV_LIST_SETCOLWIDTH, EV_LIST_SETFEEDBACK, UCmdTarget::GetWidID, kUMainWidget, NUM_COLUMNS, sFileIconAddedIcon, sFileIconBinaryIcon, sFileIconBinaryModIcon, sFileIconConflictIcon, sFileIconIgnoredIcon, sFileIconMissIcon, sFileIconRemovedIcon, sFileIconTextIcon, sFileIconTextModIcon, sFileIconUnknownIcon, sFolderIconIcon, sFolderIconIgnoredIcon, sFolderIconMissIcon, sFolderIconUnknownIcon, UCreate_pixmap, UEventSendMessage, and UMAKEINT.

00387 {
00388     if(sFileIconTextIcon == 0L)
00389     {
00390         sFileIconTextIcon = UCreate_pixmap(this, "cvsfile.xpm");
00391         sFileIconBinaryIcon = UCreate_pixmap(this, "binfile.xpm");
00392         sFileIconUnknownIcon = UCreate_pixmap(this, "unkfile.xpm");
00393         sFileIconAddedIcon = UCreate_pixmap(this, "addfile.xpm");
00394         sFileIconConflictIcon = UCreate_pixmap(this, "conflict.xpm");
00395         sFileIconMissIcon = UCreate_pixmap(this, "missfile.xpm");
00396         sFolderIconIcon = UCreate_pixmap(this, "folder.xpm");
00397         sFolderIconUnknownIcon = UCreate_pixmap(this, "foldunk.xpm");
00398         sFolderIconMissIcon = UCreate_pixmap(this, "foldmiss.xpm");
00399         sFileIconTextModIcon = UCreate_pixmap(this, "modfile.xpm");
00400         sFileIconBinaryModIcon = UCreate_pixmap(this, "modbin.xpm");
00401         sFileIconIgnoredIcon = UCreate_pixmap(this, "ignfile.xpm");
00402         sFolderIconIgnoredIcon = UCreate_pixmap(this, "foldign.xpm");
00403         sFileIconRemovedIcon = UCreate_pixmap(this, "delfile.xpm");
00404     }
00405
00406     UEventSendMessage(GetWidID(), EV_LIST_SETFEEDBACK, UMAKEINT(kUMainWidget, 0), 0L);
00407     UEventSendMessage(GetWidID(), EV_LIST_ADDCOLUMNS, UMAKEINT(kUMainWidget, NUM_COLUMNS), 0L);
00408     for(int i = 0; i < NUM_COLUMNS; i++)
00409     {
00410         UEventSendMessage(GetWidID(), EV_LIST_SETCOLTITLE, UMAKEINT(kUMainWidget, i), _gszColumnLabel[i]);
00411         UEventSendMessage(GetWidID(), EV_LIST_SETCOLWIDTH, UMAKEINT(kUMainWidget, i), (void *)_gnColumnWidth[i]);
00412     }
00413     UEventSendMessage(GetWidID(), EV_LIST_SETFEEDBACK, UMAKEINT(kUMainWidget, 1), 0L);
00414 }

void UCvsFiles::OnDblClick ( void ) [protected]

Definition at line 1950 of file UCvsFiles.cpp.

References EditSel, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, UCmdTarget::GetWidID, kUMainWidget, UEventSendMessage, and UMAKEINT.

01951 {
01952     int nItem = -1;
01953
01954     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01955     {
01956         EntnodeData *data;
01957         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01958         EditSel(data);
01959     }
01960 }

void UCvsFiles::OnDestroy ( ) [protected]

Definition at line 381 of file UCvsFiles.cpp.

00382 {
00383     delete this;
00384 }

int UCvsFiles::OnMacroSel ( int cmd ) [protected]

Definition at line 1859 of file UCvsFiles.cpp.

References cmdSELMACRO, CStr, CTcl_Interp::DoScriptVar, EV_LIST_GETNEXTSEL, EV_LIST_ROWGETDATA, UCmdTarget::GetWidID, kUMainWidget, m_path, CMacroEntry::path, TclBrowserAppend, TclBrowserReset, UEventSendMessage, UMAKEINT, and CTcl_Interp::Unixfy.

01860 {
01861     CTcl_Interp interp;
01862     CMacroEntry & entry = gMacrosSel.entries[cmd - cmdSELMACRO];
01863     CStr path = entry.path;
01864     CTcl_Interp::Unixfy(path);
01865
01866     TclBrowserReset();
01867
01868     int nItem = -1;
01869     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01870     {
01871         EntnodeData *data;
01872         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01873         TclBrowserAppend(m_path, data);
01874     }
01875
01876     interp.DoScriptVar("source \"%s\"", (const char *)path);
01877     return 0;
01878 }

void UCvsFiles::OnSelColumn ( int column ) [protected]

Definition at line 2111 of file UCvsFiles.cpp.

References EntnodeFile::kConflict, EntnodeData::kName, EntnodeFile::kOption, EntnodeData::kStatus, EntnodeFile::kTag, EntnodeFile::kVN, m_ascendant, m_sort, and Resort.

02112 {
02113     if(column == m_sort)
02114         m_ascendant = !m_ascendant;
02115     else
02116     {
02117         m_ascendant = true;
02118         switch(column)
02119         {
02120         case EntnodeData::kName:
02121         case EntnodeData::kStatus:
02122         case EntnodeFile::kOption:
02123         case EntnodeFile::kTag:
02124         case EntnodeFile::kConflict:
02125         case EntnodeFile::kVN:
02126             m_sort = column;
02127             break;
02128         }
02129     }
02130
02131     Resort();
02132 }

void UCvsFiles::ResetView | ( | bool | forceReload = false,
 |  | bool | notifyBrowser = false
 | ) |

Definition at line 474 of file UCvsFiles.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, ULIST_INSERT::col, Entries_SetMissing, EV_LIST_ADDSEL, EV_LIST_GETNEXTSEL, EV_LIST_INSERT, EV_LIST_NEWROW, EV_LIST_RESETALL, EV_LIST_ROWGETDATA, EV_LIST_ROWSETDATA, FileTraverse, UCvsApp::gApp, CSortList< ENTNODE >::Get, UCvsApp::GetBrowserView, EntnodeData::GetDesc, GetEntriesModTime, GetImageForEntry, UCmdTarget::GetWidID, ULIST_INSERT::icon, USemaphore::IsEnteredTwice, EntnodeData::IsMissing, EntnodeData::kName, EntnodeData::kStatus, kUMainWidget, m_entries, m_entriesLogMod, m_entriesMod, m_path, NUM_COLUMNS, CSortList< ENTNODE >::NumOfElements, UCvsFolders::ResetView, Resort, ULIST_INSERT::row, Search, ULIST_INSERT::title, UEventSendMessage, and UMAKEINT.

00475 {
00476     UWaitCursor wait;
00477
00478     static bool sSemaphore = false;
00479     USemaphore policeman(sSemaphore);
00480     if(policeman.IsEnteredTwice())
00481         return;
00482
00483     // - check if we really need to reload (forceReload == false)
00484     // - wait a bit for the watcher in order to let him tell us
00485     // if something was modified.
00486     time_t newEntriesMod;
00487     time_t newEntriesLogMod;
00488     GetEntriesModTime(newEntriesMod, newEntriesLogMod);
00489     if(!forceReload)
00490     {
00491         if(m_entriesMod == newEntriesMod && m_entriesLogMod == newEntriesLogMod)
00492             return;
00493     }
00494
00495     // reset all the watchers
00496     m_entriesMod = newEntriesMod;
00497     m_entriesLogMod = newEntriesLogMod;
00498
00499     // get the selection to later try to restore it
00500     CvsArgs selection(false);
00501     int nItem = -1;
00502
00503     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL,
00504                                      UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00505     {
00506         EntnodeData *data;
00507         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00508         selection.add((*data)[EntnodeData::kName]);
00509     }
00510
00511     UEventSendMessage(GetWidID(), EV_LIST_RESETALL, kUMainWidget, 0L);
00512
00513     // refetch all items
00514     TViewFill traverse(this, m_entries);
00515     /*kTraversal res = */FileTraverse(m_path, traverse);
00516
00517     // add the missing files
00518     Entries_SetMissing(m_entries);
00519
00520     int numEntries = m_entries.NumOfElements();
00521     for(int i = 0; i < numEntries; i++)
00522     {
00523         const ENTNODE & theNode = m_entries.Get(i);
00524         EntnodeData *data = ((ENTNODE *)&theNode)->Data();
00525         if(!data->IsMissing())
00526             continue;
00527
00528         int rownum;
00529         UEventSendMessage(GetWidID(), EV_LIST_NEWROW, kUMainWidget, &rownum);
00530         UEventSendMessage(GetWidID(), EV_LIST_ROWSETDATA, UMAKEINT(kUMainWidget, rownum), data);
00531         ULIST_INSERT entry;
00532         entry.row = rownum;
00533
00534         entry.col = 0;
00535         entry.title = (*data)[EntnodeData::kName];
00536         entry.icon = UCvsFiles::GetImageForEntry(data);
00537         UEventSendMessage(GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00538
00539         entry.icon = 0L;
00540
00541         // set item text for additional columns
00542         for(int j = 1; j < NUM_COLUMNS; j++)
00543         {
00544             const char *info = (*data)[j];
00545             if(info != 0L)
00546             {
00547                 entry.col = j;
00548                 entry.title = info;
00549                 UEventSendMessage(GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00550             }
00551         }
00552         entry.col = EntnodeData::kStatus;
00553         entry.title = data->GetDesc();
00554         UEventSendMessage(GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00555     }
00556
00557     Resort();
00558
00559     // now restore the selection
00560     int argc = selection.Argc(), c;
00561     char * const *argv = selection.Argv();
00562     for(c = 0; c < argc; c++)
00563     {
00564         int row = Search(argv[c]);
00565         if(row != -1)
00566             UEventSendMessage(GetWidID(), EV_LIST_ADDSEL, UMAKEINT(kUMainWidget, row), 0L);
00567     }
00568
00569     if(notifyBrowser)
00570     {
00571         // notify the tree
00572         UCvsApp::gApp->GetBrowserView()->ResetView(forceReload);
00573     }
00574 }

void UCvsFiles::ResetView | ( | const char * | path,
 |  | bool | notifyBrowser = false
 | ) |

Definition at line 416 of file UCvsFiles.cpp.

References EV_SETTEXT, UCvsApp::gApp, UCvsApp::GetBrowserView, kUCvsFrameID, kUMainWidget, m_path, UCvsFolders::StepToLocation, and UEventSendMessage.

Referenced by EditSel, OnCmdIgnore, OnCmdReload, OnCmdTrash, OnCmdUpone, UCvsApp::OnMainTimer, UCvsFolders::OnTreeSelecting, UCvsFolders::ResetBrowser, and UCvsFolders::ResetView.

00417 {
00418     m_path = path;
00419     ResetView(true);
00420
00421     UStr title(UCvsApp::gApp->GetAppName());
00422     title << ": ";
00423     title << m_path;
00424     UEventSendMessage(kUCvsFrameID, EV_SETTEXT, kUMainWidget, (void *)(const char *)title);
00425
00426     if(notifyBrowser)
00427     {
00428         // notify the tree
00429         UCvsApp::gApp->GetBrowserView()->StepToLocation(path);
00430     }
00431 }

void UCvsFiles::Resort ( void ) [protected]

Definition at line 2083 of file UCvsFiles.cpp.

References compareConflict, compareName, compareOption, compareRevs, compareStatus, compareTag, EV_LIST_RESORT, UCmdTarget::GetWidID, EntnodeFile::kConflict, EntnodeData::kName, EntnodeFile::kOption, EntnodeData::kStatus, EntnodeFile::kTag, kUMainWidget, EntnodeFile::kVN, m_sort, UEventSendMessage, UListSorter, and UMAKEINT.

Referenced by OnSelColumn, and ResetView.

02084 {
02085     UListSorter fsort = 0L;
02086     switch(m_sort)
02087     {
02088     case EntnodeData::kName:
02089         fsort = compareName;
02090         break;
02091     case EntnodeFile::kVN:
02092         fsort = compareRevs;
02093         break;
02094     case EntnodeData::kStatus:
02095         fsort = compareStatus;
02096         break;
02097     case EntnodeFile::kOption:
02098         fsort = compareOption;
02099         break;
02100     case EntnodeFile::kTag:
02101         fsort = compareTag;
02102         break;
02103     case EntnodeFile::kConflict:
02104         fsort = compareConflict;
02105         break;
02106     }
02107     if(fsort != 0L)
02108         UEventSendMessage(GetWidID(), EV_LIST_RESORT, UMAKEINT(kUMainWidget, m_sort), (void *)fsort);
02109 }

const URuntimeClass * UCvsFiles::rtUCvsFiles ( void ) [static]

Definition at line 63 of file UCvsFiles.cpp.

int UCvsFiles::Search ( const char * title ) [protected]

Definition at line 450 of file UCvsFiles.cpp.

References ULIST_INFO::col, EV_LIST_GETINFO, EV_LIST_GETNEXT, UCmdTarget::GetWidID, kUMainWidget, ULIST_INFO::row, stricmp, ULIST_INFO::title, UEventSendMessage, and UMAKEINT.

Referenced by ResetView.

00451 {
00452     int row = -1;
00453     while((row = UEventSendMessage(GetWidID(), EV_LIST_GETNEXT,
00454                                      UMAKEINT(kUMainWidget, row), 0L)) != -1)
00455     {
00456         ULIST_INFO info;
00457         info.col = 0;
00458         info.row = row;
00459         UEventSendMessage(GetWidID(), EV_LIST_GETINFO, kUMainWidget, &info);
00460         if(info.title == 0L)
00461             continue;
00462
00463 #if qUnix
00464         if(strcmp(title, info.title) == 0)
00465 #else
00466         if(stricmp(title, info.title) == 0)
00467 #endif
00468             return row;
00469     }
00470
00471     return -1;
00472 }

Member Data Documentation

const UMSGMAP_ENTRY UCvsFiles::_messageEntries [static, private]

Reimplemented from UWidget.

Definition at line 65 of file UCvsFiles.cpp.

const URuntimeClass UCvsFiles::classUCvsFiles [static, protected]

bool UCvsFiles::m_ascendant [protected]

Definition at line 71 of file UCvsFiles.h.

Referenced by IsSortAscendant, OnSelColumn, UCvsFiles, and ~UCvsFiles.

CSortList<ENTNODE> UCvsFiles::m_entries [protected]

Definition at line 62 of file UCvsFiles.h.

Referenced by ResetView.

time_t UCvsFiles::m_entriesLogMod [protected]

Definition at line 67 of file UCvsFiles.h.

Referenced by ResetView.

time_t UCvsFiles::m_entriesMod [protected]

Definition at line 66 of file UCvsFiles.h.

Referenced by ResetView.

UStr UCvsFiles::m_path [protected]

Definition at line 64 of file UCvsFiles.h.

Referenced by EditSel, GetEntriesModTime, OnCmdAdd, OnCmdAddb, OnCmdCommit, OnCmdDiff, OnCmdEdit, OnCmdEditors, OnCmdExplore, OnCmdGraph, OnCmdLock, OnCmdLog, OnCmdQueryUpdate, OnCmdRelease, OnCmdRmv, OnCmdStatus, OnCmdTagBranch, OnCmdTagDelete, OnCmdTagNew, OnCmdTrash, OnCmdUnedit, OnCmdUnlock, OnCmdUpdate, OnCmdUpone, OnCmdWatchers, OnCmdWatchOff, OnCmdWatchOn, OnMacroSel, and ResetView.

int UCvsFiles::m_sort [protected]

Definition at line 69 of file UCvsFiles.h.

Referenced by OnSelColumn, Resort, UCvsFiles, and ~UCvsFiles.

const UMSGMAP UCvsFiles::messageMap = { UWidget ::GetThisMessageMap(), & UCvsFiles ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Definition at line 65 of file UCvsFiles.cpp.

The documentation for this class was generated from the following files:
  • common/UCvsFiles.h
  • common/UCvsFiles.cpp
Generated on Sun Feb 24 01:25:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsFolders Class Reference

#include <UCvsFolders.h>

Inheritance diagram for UCvsFolders:

[legend]
Collaboration diagram for UCvsFolders:

[legend]
List of all members.

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UCvsFolders ()
virtual | ~UCvsFolders ()
void | ResetBrowser (const char *path, bool notifyView=false)
const char * | GetRoot (void) const
void | RetrievePath (UTREEITEM item, UStr &path)
void | StepToLocation (const char *path, bool notifyView=false)
void | DeleteAllItems (UTREEITEM root=0L)
void | ResetView (bool forceReload=false, bool notifyView=false)

Static Public Methods

const URuntimeClass * | rtUCvsFolders (void)
void | SetDefaultRoot (const char *root)

Protected Methods

void | OnUpdateGeneric (UCmdUI *pCmdUI, bool needCvsInfos)
bool | DisableGeneric ()
void | StoreExpanded (std::vector< UStr > &allExpanded, UTREEITEM root=0L)
UTREEITEM | GetItemByLocation (const char *path)
void | OnDestroy ()
void | OnCreate ()
void | OnTreeExpanding (int collapse, UTREEITEM item)
void | OnTreeSelecting (int deselect, UTREEITEM item)
void | OnCmdUIMacrosSel (int cmd, UCmdUI *pCmdUI)
void | OnCmdUIUpdate (UCmdUI *pCmdUI)
void | OnCmdUIAdd (UCmdUI *pCmdUI)
void | OnCmdUIExplore (UCmdUI *pCmdUI)
void | OnCmdUIReload (UCmdUI *pCmdUI)
void | OnCmdUIIgnore (UCmdUI *pCmdUI)
void | OnCmdUICheckout (UCmdUI *pCmdUI)
void | OnCmdUIImport (UCmdUI *pCmdUI)
int | OnCmdUpdate (void)
int | OnCmdAdd (void)
int | OnCmdCommit (void)
int | OnCmdQueryUpdate (void)
int | OnCmdDiff (void)
int | OnCmdLog (void)
int | OnCmdStatus (void)
int | OnCmdLock (void)
int | OnCmdUnlock (void)
int | OnCmdWatchOn (void)
int | OnCmdWatchOff (void)
int | OnCmdEdit (void)
int | OnCmdUnedit (void)
int | OnCmdWatchers (void)
int | OnCmdEditors (void)
int | OnCmdRelease (void)
int | OnCmdTagNew (void)
int | OnCmdTagDelete (void)
int | OnCmdTagBranch (void)
int | OnCmdExplore (void)
int | OnCmdReload (void)
int | OnCmdIgnore (void)
int | OnCmdCheckout (void)
int | OnCmdImport (void)
int | OnCmdMacrosSel (int cmd)
virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Protected Attributes

UStr m_root

Static Protected Attributes

const URuntimeClass | classUCvsFolders
const UMSGMAP | messageMap = { UWidget ::GetThisMessageMap(), & UCvsFolders ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Constructor & Destructor Documentation

UCvsFolders::UCvsFolders ( )

Definition at line 431 of file UCvsFolders.cpp.

References kUCvsFoldersID.

00431                          : UWidget(kUCvsFoldersID)
00432 {
00433 }

UCvsFolders::~UCvsFolders ( ) [virtual]

Definition at line 435 of file UCvsFolders.cpp.

00436 {
00437 }

Member Function Documentation

const URuntimeClass * UCvsFolders::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 79 of file UCvsFolders.cpp.

void UCvsFolders::DeleteAllItems ( UTREEITEM root = 0L )

Definition at line 868 of file UCvsFolders.cpp.

References ASSERT, UTREE_INFO::child, UTREE_INFO::data, EV_TREE_DELETE, EV_TREE_GETINFO, EV_TREE_SETDATA, UCmdTarget::GetWidID, UTREE_INFO::item, kUMainWidget, UTREE_INFO::next, sTemporaryTurnOffNotify, UEventSendMessage, EntnodeData::UnRef, and UTREEITEM.

Referenced by OnTreeExpanding, and ResetBrowser.

00869 {
00870     // we don't want the file view to be notified when things get deleted
00871     CTempToggleBool toggler(sTemporaryTurnOffNotify);
00872
00873     UTREE_INFO query;
00874     bool eraseRoot = false;
00875     query.item = root;
00876     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00877     if(root == 0L)
00878     {
00879         root = query.item;
00880         eraseRoot = true;
00881     }
00882
00883     if(root == 0L)
00884         return;
00885
00886     UTREEITEM childItem = query.child;
00887
00888     // erase all the childs
00889     while(childItem != 0L)
00890     {
00891         UTREE_INFO queryChild;
00892         queryChild.item = childItem;
00893         UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &queryChild);
00894
00895         EntnodeData *data = (EntnodeData *)queryChild.data;
00896         if(data != 0L)
00897         {
00898             queryChild.data = 0L; // So that subsequent references after UnRef() won't SEGV
00899             UEventSendMessage(GetWidID(), EV_TREE_SETDATA, kUMainWidget, &queryChild);
00900             data->UnRef();  // Or move this one after DeleteAllItems? so we don't loose one system call. For now, safe way
00901         }
00902
00903         DeleteAllItems(childItem);
00904
00905         UEventSendMessage(GetWidID(), EV_TREE_DELETE, kUMainWidget, childItem);
00906         childItem = queryChild.next;
00907     }
00908
00909     // erase the root only if initially root was 0L
00910     if(eraseRoot)
00911     {
00912         EntnodeData *data = (EntnodeData *)query.data;
00913         ASSERT(data == 0L);
00914
00915         UEventSendMessage(GetWidID(), EV_TREE_DELETE, kUMainWidget, root);
00916     }
00917 }

bool UCvsFolders::DisableGeneric ( ) [protected]

Definition at line 919 of file UCvsFolders.cpp.

References UCvsApp::gApp, UWidget::HasFocus, and UCvsApp::IsCvsRunning.

Referenced by OnCmdUIExplore, OnCmdUIIgnore, OnCmdUIMacrosSel, and OnUpdateGeneric.

00920 {
00921     UCvsApp *app = UCvsApp::gApp;
00922     return app->IsCvsRunning() || gCvsPrefs.empty() || !HasFocus();
00923 }

const UMSGMAP * UCvsFolders::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 81 of file UCvsFolders.cpp.

UTREEITEM UCvsFolders::GetItemByLocation ( const char * path ) [protected]

Definition at line 677 of file UCvsFolders.cpp.

References UTREE_INFO::child, CStr, UTREE_INFO::data, UStr::endsWith, EV_TREE_GETINFO, UCmdTarget::GetWidID, UTREE_INFO::item, EntnodeData::kName, kUMainWidget, UStr::length, m_root, UTREE_INFO::next, UEventSendMessage, and UTREEITEM.

Referenced by ResetView.

00678 {
00679     UStr root(m_root);
00680     if(!root.endsWith(kPathDelimiter))
00681         root << kPathDelimiter;
00682     UStr subpath(path);
00683     if(!subpath.endsWith(kPathDelimiter))
00684         subpath << kPathDelimiter;
00685
00686     // check if it is a sub-path
00687     if(strncmp(root, subpath, root.length()) != 0)
00688         return 0L;
00689
00690     UTREE_INFO query;
00691     query.item = 0L;
00692     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00693     UTREEITEM item = query.item;
00694     if(item == 0L)
00695         return 0L;
00696
00697     // step inside synchronized
00698     const char *tmp = (const char *)subpath + root.length() - 1;
00699     while((tmp = strchr(tmp, kPathDelimiter)) != 0L)
00700     {
00701         const char *name = ++tmp;
00702         if(name[0] == '\0')
00703             break;
00704
00705         CStr subname;
00706         const char *tmp2 = strchr(name, kPathDelimiter);
00707         if(tmp2 == 0L)
00708             subname = name;
00709         else
00710             subname.set(name, tmp2 - name);
00711
00712         UTREEITEM childItem = query.child;
00713
00714         // find the subitem which matches this name
00715         while(childItem != 0L)
00716         {
00717             query.item = childItem;
00718             UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00719             EntnodeData *data = (EntnodeData *)query.data;
00720             if(data != 0L)
00721             {
00722 #if qUnix
00723                 if(strcmp((*data)[EntnodeData::kName], subname) == 0)
00724 #else
00725                 if(_stricmp((*data)[EntnodeData::kName], subname) == 0)
00726 #endif
00727                 {
00728                     item = childItem;
00729                     break;
00730                 }
00731             }
00732
00733             childItem = query.next;
00734         }
00735         if(childItem == 0L)
00736             return 0L;
00737     }
00738
00739     return item;
00740 }

const UMSGMAP * UCvsFolders::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 81 of file UCvsFolders.cpp.

const char* UCvsFolders::GetRoot ( void ) const [inline]

Definition at line 40 of file UCvsFolders.h.

References m_root.

Referenced by UCvsFrame::OnCmdSaveSettings, and CvsPrefs::save.

00040 { return m_root; }

const URuntimeClass * UCvsFolders::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 79 of file UCvsFolders.cpp.

const UMSGMAP * UCvsFolders::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 81 of file UCvsFolders.cpp.

int UCvsFolders::OnCmdAdd ( void ) [protected]

Definition at line 971 of file UCvsFolders.cpp.

References ASSERT, CvsCmdAddFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

00972 {
00973     UTREEITEM *item;
00974     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
00975     ASSERT(item != 0L);
00976
00977     UStr path;
00978     RetrievePath(item, path);
00979     CvsCmdAddFolder(path);
00980     return 0;
00981 }

int UCvsFolders::OnCmdCheckout ( void ) [protected]

Definition at line 1227 of file UCvsFolders.cpp.

References CvsCmdCheckoutModule.

01228 {
01229     CvsCmdCheckoutModule();
01230     return 0;
01231 }

int UCvsFolders::OnCmdCommit ( void ) [protected]

Definition at line 983 of file UCvsFolders.cpp.

References ASSERT, CvsCmdCommitFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

00984 {
00985     UTREEITEM *item;
00986     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
00987     ASSERT(item != 0L);
00988
00989     UStr path;
00990     RetrievePath(item, path);
00991     CvsCmdCommitFolder(path);
00992     return 0;
00993 }

int UCvsFolders::OnCmdDiff ( void ) [protected]

Definition at line 1007 of file UCvsFolders.cpp.

References ASSERT, CvsCmdDiffFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

01008 {
01009     UTREEITEM *item;
01010     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01011     ASSERT(item != 0L);
01012
01013     UStr path;
01014     RetrievePath(item, path);
01015     CvsCmdDiffFolder(path);
01016     return 0;
01017 }

int UCvsFolders::OnCmdEdit ( void ) [protected]

Definition at line 1091 of file UCvsFolders.cpp.

References ASSERT, CvsCmdEditFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

01092 {
01093     UTREEITEM *item;
01094     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01095     ASSERT(item != 0L);
01096
01097     UStr path;
01098     RetrievePath(item, path);
01099     CvsCmdEditFolder(path);
01100     return 0;
01101 }

int UCvsFolders::OnCmdEditors ( void ) [protected]

Definition at line 1127 of file UCvsFolders.cpp.

References ASSERT, CvsCmdEditorsFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

01128 {
01129     UTREEITEM *item;
01130     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01131     ASSERT(item != 0L);
01132
01133     UStr path;
01134     RetrievePath(item, path);
01135     CvsCmdEditorsFolder(path);
01136     return 0;
01137 }

int UCvsFolders::OnCmdExplore ( void ) [protected]

Definition at line 1187 of file UCvsFolders.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, ASSERT, cvs_err, EV_TREE_GETSEL, UCvsApp::Execute, UCvsApp::gApp, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

01188 {
01189     UTREEITEM *item;
01190     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01191     ASSERT(item != 0L);
01192
01193     UStr path;
01194     RetrievePath(item, path);
01195
01196 #ifdef WIN32
01197     HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), "explore", path,
01198             0L, 0L, SW_SHOWDEFAULT);
01199     if((long)hInst < 32)
01200     {
01201         cvs_err("Unable to explore '%s' (error %d)\n", (const char *)path, GetLastError());
01202     }
01203 #endif
01204 #ifdef qUnix
01205     CvsArgs args(false);
01206     args.add(gCvsPrefs.Browser());
01207     args.add(path);
01208     UCvsApp::gApp->Execute(args.Argc(), args.Argv());
01209 #endif
01210
01211     return 0;
01212 }

int UCvsFolders::OnCmdIgnore ( void ) [protected]

Definition at line 1220 of file UCvsFolders.cpp.

References ResetView.

01221 {
01222     gFileViewIgnore = !(bool)gFileViewIgnore;
01223     ResetView(true, true);
01224     return 0;
01225 }

int UCvsFolders::OnCmdImport ( void ) [protected]

Definition at line 1233 of file UCvsFolders.cpp.

References CvsCmdImportModule.

01234 {
01235     CvsCmdImportModule();
01236     return 0;
01237 }

int UCvsFolders::OnCmdLock ( void ) [protected]

Definition at line 1043 of file UCvsFolders.cpp.

References ASSERT, CvsCmdLockFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

01044 {
01045     UTREEITEM *item;
01046     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01047     ASSERT(item != 0L);
01048
01049     UStr path;
01050     RetrievePath(item, path);
01051     CvsCmdLockFolder(path);
01052     return 0;
01053 }

int UCvsFolders::OnCmdLog ( void ) [protected]

Definition at line 1019 of file UCvsFolders.cpp.

References ASSERT, CvsCmdLogFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

01020 {
01021     UTREEITEM *item;
01022     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01023     ASSERT(item != 0L);
01024
01025     UStr path;
01026     RetrievePath(item, path);
01027     CvsCmdLogFolder(path);
01028     return 0;
01029 }

int UCvsFolders::OnCmdMacrosSel ( int cmd ) [protected]

Definition at line 1292 of file UCvsFolders.cpp.

References cmdSELMACRO, CStr, UTREE_INFO::data, CTcl_Interp::DoScriptVar, EV_TREE_GETINFO, EV_TREE_GETSEL, UCmdTarget::GetWidID, UTREE_INFO::item, kUMainWidget, CMacroEntry::path, RetrievePath, SplitPath, TclBrowserAppend, TclBrowserReset, UEventSendMessage, CTcl_Interp::Unixfy, EntnodeData::UnRef, EntnodePath::UnRef, and UTREEITEM.

01293 {
01294     CTcl_Interp interp;
01295     CMacroEntry & entry = gMacrosSel.entries[cmd - cmdSELMACRO];
01296     CStr path = entry.path;
01297     CTcl_Interp::Unixfy(path);
01298
01299     UTREEITEM selItem;
01300     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &selItem);
01301
01302     CStr selPath;
01303     RetrievePath(selItem, selPath);
01304     CStr uppath, folder;
01305     SplitPath(selPath, uppath, folder);
01306
01307     UTREE_INFO query;
01308     query.item = selItem;
01309     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
01310     bool deleteData = false;
01311     EntnodeData *data = (EntnodeData *)query.data;
01312     if(data == 0L)
01313     {
01314         deleteData = true;
01315         EntnodePath *apath = new EntnodePath(uppath);
01316         data = new EntnodeFolder(folder, apath);
01317         apath->UnRef();
01318     }
01319
01320     TclBrowserReset();
01321     TclBrowserAppend(uppath, data);
01322
01323     interp.DoScriptVar("source \"%s\"", (const char *)path);
01324
01325     if(deleteData)
01326         data->UnRef();
01327
01328     return 0;
01329 }

int UCvsFolders::OnCmdQueryUpdate ( void ) [protected]

Definition at line 995 of file UCvsFolders.cpp.

References ASSERT, CvsCmdUpdateFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

00996 {
00997     UTREEITEM *item;
00998     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
00999     ASSERT(item != 0L);
01000
01001     UStr path;
01002     RetrievePath(item, path);
01003     CvsCmdUpdateFolder(path, true);
01004     return 0;
01005 }

int UCvsFolders::OnCmdRelease ( void ) [protected]

Definition at line 1139 of file UCvsFolders.cpp.

References ASSERT, CvsCmdReleaseFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

01140 {
01141     UTREEITEM *item;
01142     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01143     ASSERT(item != 0L);
01144
01145     UStr path;
01146     RetrievePath(item, path);
01147     CvsCmdReleaseFolder(path);
01148     return 0;
01149 }

int UCvsFolders::OnCmdReload ( void ) [protected]

Definition at line 1214 of file UCvsFolders.cpp.

References ResetView.

01215 {
01216     ResetView(true);
01217     return 0;
01218 }

int UCvsFolders::OnCmdStatus ( void ) [protected]

Definition at line 1031 of file UCvsFolders.cpp.

References ASSERT, CvsCmdStatusFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

01032 {
01033     UTREEITEM *item;
01034     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01035     ASSERT(item != 0L);
01036
01037     UStr path;
01038     RetrievePath(item, path);
01039     CvsCmdStatusFolder(path);
01040     return 0;
01041 }

int UCvsFolders::OnCmdTagBranch ( void ) [protected]

Definition at line 1175 of file UCvsFolders.cpp.

References ASSERT, CvsCmdTagBranchFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

01176 {
01177     UTREEITEM *item;
01178     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01179     ASSERT(item != 0L);
01180
01181     UStr path;
01182     RetrievePath(item, path);
01183     CvsCmdTagBranchFolder(path);
01184     return 0;
01185 }

int UCvsFolders::OnCmdTagDelete ( void ) [protected]

Definition at line 1163 of file UCvsFolders.cpp.

References ASSERT, CvsCmdTagDeleteFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

01164 {
01165     UTREEITEM *item;
01166     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01167     ASSERT(item != 0L);
01168
01169     UStr path;
01170     RetrievePath(item, path);
01171     CvsCmdTagDeleteFolder(path);
01172     return 0;
01173 }

int UCvsFolders::OnCmdTagNew ( void ) [protected]

Definition at line 1151 of file UCvsFolders.cpp.

References ASSERT, CvsCmdTagCreateFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

01152 {
01153     UTREEITEM *item;
01154     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01155     ASSERT(item != 0L);
01156
01157     UStr path;
01158     RetrievePath(item, path);
01159     CvsCmdTagCreateFolder(path);
01160     return 0;
01161 }

void UCvsFolders::OnCmdUIAdd ( UCmdUI * pCmdUI ) [protected]

Definition at line 1239 of file UCvsFolders.cpp.

References OnUpdateGeneric.

01240 {
01241     OnUpdateGeneric(pCmdUI, false);
01242 }

void UCvsFolders::OnCmdUICheckout ( UCmdUI * pCmdUI ) [protected]

Definition at line 1268 of file UCvsFolders.cpp.

References UCmdUI::Enable, UCvsApp::gApp, and UCvsApp::IsCvsRunning.

01269 {
01270     UCvsApp *app = UCvsApp::gApp;
01271     pCmdUI->Enable(!app->IsCvsRunning() && !gCvsPrefs.empty());
01272 }

void UCvsFolders::OnCmdUIExplore ( UCmdUI * pCmdUI ) [protected]

Definition at line 1244 of file UCvsFolders.cpp.

References DisableGeneric, UCmdUI::Enable, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, UEventSendMessage, and UTREEITEM.

01245 {
01246     if(DisableGeneric())
01247     {
01248         pCmdUI->Enable(false);
01249         return;
01250     }
01251     UTREEITEM selItem;
01252     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &selItem);
01253     pCmdUI->Enable(selItem != 0L);
01254 }

void UCvsFolders::OnCmdUIIgnore ( UCmdUI * pCmdUI ) [protected]

Definition at line 1262 of file UCvsFolders.cpp.

References UCmdUI::Check, DisableGeneric, and UCmdUI::Enable.

01263 {
01264     pCmdUI->Enable(!DisableGeneric());
01265     pCmdUI->Check(gFileViewIgnore);
01266 }

void UCvsFolders::OnCmdUIImport ( UCmdUI * pCmdUI ) [protected]

Definition at line 1274 of file UCvsFolders.cpp.

References UCmdUI::Enable, UCvsApp::gApp, and UCvsApp::IsCvsRunning.

01275 {
01276     UCvsApp *app = UCvsApp::gApp;
01277     pCmdUI->Enable(!app->IsCvsRunning() && !gCvsPrefs.empty());
01278 }

void UCvsFolders::OnCmdUIMacrosSel | ( | int | cmd,
 |  | UCmdUI * | pCmdUI
 | ) | [protected]

Definition at line 1280 of file UCvsFolders.cpp.

References DisableGeneric, UCmdUI::Enable, EV_TREE_GETSEL, UCmdTarget::GetWidID, CTcl_Interp::IsAvail, kUMainWidget, UEventSendMessage, and UTREEITEM.

01281 {
01282     if(DisableGeneric())
01283     {
01284         pCmdUI->Enable(false);
01285         return;
01286     }
01287     UTREEITEM selItem;
01288     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &selItem);
01289     pCmdUI->Enable(selItem != 0L && CTcl_Interp::IsAvail());
01290 }

void UCvsFolders::OnCmdUIReload ( UCmdUI * pCmdUI ) [protected]

Definition at line 1256 of file UCvsFolders.cpp.

References UCmdUI::Enable, UCvsApp::gApp, and UCvsApp::IsCvsRunning.

01257 {
01258     UCvsApp *app = UCvsApp::gApp;
01259     pCmdUI->Enable(!app->IsCvsRunning());
01260 }

void UCvsFolders::OnCmdUIUpdate ( UCmdUI * pCmdUI ) [protected]

Definition at line 966 of file UCvsFolders.cpp.

References OnUpdateGeneric.

00967 {
00968     OnUpdateGeneric(pCmdUI, true);
00969 }

int UCvsFolders::OnCmdUnedit ( void ) [protected]

Definition at line 1103 of file UCvsFolders.cpp.

References ASSERT, CvsCmdUneditFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

01104 {
01105     UTREEITEM *item;
01106     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01107     ASSERT(item != 0L);
01108
01109     UStr path;
01110     RetrievePath(item, path);
01111     CvsCmdUneditFolder(path);
01112     return 0;
01113 }

int UCvsFolders::OnCmdUnlock ( void ) [protected]

Definition at line 1055 of file UCvsFolders.cpp.

References ASSERT, CvsCmdUnlockFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

01056 {
01057     UTREEITEM *item;
01058     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01059     ASSERT(item != 0L);
01060
01061     UStr path;
01062     RetrievePath(item, path);
01063     CvsCmdUnlockFolder(path);
01064     return 0;
01065 }

int UCvsFolders::OnCmdUpdate ( void ) [protected]

Definition at line 954 of file UCvsFolders.cpp.

References ASSERT, CvsCmdUpdateFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

00955 {
00956     UTREEITEM *item;
00957     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
00958     ASSERT(item != 0L);
00959
00960     UStr path;
00961     RetrievePath(item, path);
00962     CvsCmdUpdateFolder(path);
00963     return 0;
00964 }

int UCvsFolders::OnCmdWatchers ( void ) [protected]

Definition at line 1115 of file UCvsFolders.cpp.

References ASSERT, CvsCmdWatchersFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

01116 {
01117     UTREEITEM *item;
01118     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01119     ASSERT(item != 0L);
01120
01121     UStr path;
01122     RetrievePath(item, path);
01123     CvsCmdWatchersFolder(path);
01124     return 0;
01125 }

int UCvsFolders::OnCmdWatchOff ( void ) [protected]

Definition at line 1079 of file UCvsFolders.cpp.

References ASSERT, CvsCmdWatchOffFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

01080 {
01081     UTREEITEM *item;
01082     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01083     ASSERT(item != 0L);
01084
01085     UStr path;
01086     RetrievePath(item, path);
01087     CvsCmdWatchOffFolder(path);
01088     return 0;
01089 }

int UCvsFolders::OnCmdWatchOn ( void ) [protected]

Definition at line 1067 of file UCvsFolders.cpp.

References ASSERT, CvsCmdWatchOnFolder, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, UEventSendMessage, and UTREEITEM.

01068 {
01069     UTREEITEM *item;
01070     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01071     ASSERT(item != 0L);
01072
01073     UStr path;
01074     RetrievePath(item, path);
01075     CvsCmdWatchOnFolder(path);
01076     return 0;
01077 }

void UCvsFolders::OnCreate ( ) [protected]

Definition at line 444 of file UCvsFolders.cpp.

References UStr::empty, ResetBrowser, sFolderIcon, sFolderIgnoredIcon, sFolderMissingIcon, sFolderUnknownIcon, and UCreate_pixmap.

00445 {
00446     if(sFolderIcon == 0L)
00447     {
00448         sFolderIcon = UCreate_pixmap(this, "folder.xpm");
00449         sFolderUnknownIcon = UCreate_pixmap(this, "foldunk.xpm");
00450         sFolderIgnoredIcon = UCreate_pixmap(this, "foldign.xpm");
00451         sFolderMissingIcon = UCreate_pixmap(this, "foldmiss.xpm");
00452     }
00453
00454     UStr newpath;
00455     newpath = (const char *)gOldLoc;
00456     if(newpath.empty())
00457         newpath = gCvsPrefs.Home();
00458
00459     // set the initial root
00460     ResetBrowser(newpath, true);
00461 }

void UCvsFolders::OnDestroy ( ) [protected]

Definition at line 439 of file UCvsFolders.cpp.

00440 {
00441     delete this;
00442 }

void UCvsFolders::OnTreeExpanding | ( | int | collapse,
 |  | UTREEITEM | item
 | ) | [protected]

Definition at line 742 of file UCvsFolders.cpp.

References ENTNODE::Compare, UTREE_INSERT::data, UTREE_INFO::data, DeleteAllItems, ENT_SUBDIR, Entries_SetMissing, EV_TREE_EXPAND, EV_TREE_GETINFO, EV_TREE_INSERT, FileTraverse, CSortList::Get, GetIcon, EntnodeData::GetType, UCmdTarget::GetWidID, UTREE_INSERT::icon, USemaphore::IsEnteredTwice, EntnodeData::IsMissing, UTREE_INFO::item, EntnodeData::kName, kUMainWidget, CSortList::NumOfElements, UTREE_INSERT::parent, EntnodeData::Ref, RetrievePath, UTREE_INSERT::title, UEventSendMessage, UMAKEINT, and UTREEITEM.

00743 {
00744     // many situations make that we enter here twice. Fortunately enough
00745     // we only dare the first signal.
00746     static bool sSemaphore = false;
00747     USemaphore policeman(sSemaphore);
00748     if(policeman.IsEnteredTwice())
00749         return;
00750
00751     UWaitCursor wait;
00752
00753     UTREE_INFO query;
00754     query.item = item;
00755     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00756     EntnodeData *data = (EntnodeData *)query.data;
00757
00758     // we refuse to expand in this case cause the folder is not really here
00759     if(data != 0L && data->IsMissing())
00760     {
00761         UEventSendMessage(GetWidID(), EV_TREE_EXPAND, UMAKEINT(kUMainWidget, 1), item);
00762         return;
00763     }
00764
00765     // erase all the childs
00766     DeleteAllItems(item);
00767
00768     UStr path;
00769     RetrievePath(item, path);
00770
00771     if(collapse)
00772     {
00773         TBrowserFillDummy traverse(this, 0L, item, 0L);
00774         /*kTraversal res = */FileTraverse(path, traverse);
00775     }
00776     else
00777     {
00778         CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00779         TBrowserFill traverse(this, 0L, item, entries);
00780         /*kTraversal res = */FileTraverse(path, traverse);
00781
00782 #if qGTK
00783         // gtk is closing the tree when we removed everything in it
00784         UEventSendMessage(GetWidID(), EV_TREE_EXPAND, UMAKEINT(kUMainWidget, 0), item);
00785 #endif
00786
00787         // add the missing folders
00788         Entries_SetMissing(entries);
00789         int numEntries = entries.NumOfElements();
00790         for(int i = 0; i < numEntries; i++)
00791         {
00792             const ENTNODE & theNode = entries.Get(i);
00793             EntnodeData *data = ((ENTNODE *)&theNode)->Data();
00794             if(!data->IsMissing() || data->GetType() != ENT_SUBDIR)
00795                 continue;
00796
00797             UTREE_INSERT insert;
00798             insert.parent = item;
00799             insert.icon = GetIcon(this, item, false, false, data->Ref());
00800             insert.title = (*data)[EntnodeData::kName];
00801             insert.data = data;
00802             UEventSendMessage(GetWidID(), EV_TREE_INSERT, kUMainWidget, &insert);
00803         }
00804     }
00805 }

void UCvsFolders::OnTreeSelecting | ( | int | deselect,
 |  | UTREEITEM | item
 | ) | [protected]

Definition at line 807 of file UCvsFolders.cpp.

References ASSERT, UTREE_INFO::data, EV_TREE_GETINFO, UCmdTarget::GetWidID, UObject::IsKindOf, EntnodeData::IsMissing, UTREE_INFO::item, kUCvsFilesID, kUMainWidget, UCvsFiles::ResetView, RetrievePath, sTemporaryTurnOffNotify, UEventQueryWidget, UEventSendMessage, URUNTIME_CLASS, and UTREEITEM.

00808 {
00809     if(deselect)
00810         return;
00811
00812     UTREE_INFO query;
00813     query.item = item;
00814     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00815     EntnodeData *data = (EntnodeData *)query.data;
00816     if(data != 0L && data->IsMissing())
00817         return;
00818
00819     if(!sTemporaryTurnOffNotify)
00820     {
00821         UStr path;
00822         RetrievePath(item, path);
00823         UCvsFiles *fileView = (UCvsFiles *)UEventQueryWidget(kUCvsFilesID);
00824         if(fileView != 0L)
00825         {
00826             ASSERT(fileView->IsKindOf(URUNTIME_CLASS(UCvsFiles)));
00827             fileView->ResetView(path);
00828         }
00829     }
00830
00831 }

void UCvsFolders::OnUpdateGeneric | ( | UCmdUI * | pCmdUI,
 |  | bool | needCvsInfos
 | ) | [protected]

Definition at line 925 of file UCvsFolders.cpp.

References DisableGeneric, UCmdUI::Enable, UStr::endsWith, EV_TREE_GETSEL, UCmdTarget::GetWidID, kUMainWidget, RetrievePath, stat, UEventSendMessage, and UTREEITEM.

Referenced by OnCmdUIAdd, and OnCmdUIUpdate.

00926 {
00927     if(DisableGeneric())
00928     {
00929         pCmdUI->Enable(false);
00930         return;
00931     }
00932
00933     UTREEITEM *item;
00934     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
00935     if(item == 0L)
00936     {
00937         pCmdUI->Enable(false);
00938         return;
00939     }
00940
00941     UStr path;
00942     RetrievePath(item, path);
00943     if(!path.endsWith(kPathDelimiter))
00944         path << kPathDelimiter;
00945     path << "CVS";
00946
00947     struct stat sb;
00948     if (stat(path, &sb) == -1 || !S_ISDIR(sb.st_mode))
00949         pCmdUI->Enable(!needCvsInfos);
00950     else
00951         pCmdUI->Enable(needCvsInfos);
00952 }

void UCvsFolders::ResetBrowser | ( | const char * | path,
 |  | bool | notifyView = false
 | ) |

Definition at line 463 of file UCvsFolders.cpp.

References AskCreatePersistentSettings, DeleteAllItems, UStr::empty, UStr::endsWith, EV_COMBO_APPEND, EV_COMBO_RESETALL, EV_COMBO_SETSEL, EV_TREE_EXPAND, FileTraverse, UCvsApp::gApp, UCvsApp::GetFilesView, TMString< UStr >::GetList, UCmdTarget::GetWidID, HasPersistentSettings, TMString< UStr >::Insert, UCvsFrame::kDirCombo, kUCvsFrameID, kUMainWidget, LoadPersistentSettings, TBrowserFillDummy::m_item, m_root, UCvsFiles::ResetView, stat, stricmp, UEventSendMessage, and UMAKEINT.

Referenced by UCvsFrame::OnBrowserPopup, UCvsFrame::OnComboSelDir, OnCreate, and ResetView.

00464 {
00465     UWaitCursor wait;
00466
00467     DeleteAllItems();
00468     bool isReload = path != 0L && !m_root.empty() && stricmp(m_root, path) == 0;
00469
00470     m_root = path;
00471
00472     if(path == 0L)
00473         return;
00474
00475     if(!isReload)
00476     {
00477         if(HasPersistentSettings(m_root))
00478             LoadPersistentSettings(m_root);
00479         else
00480         {
00481             // check if the path has a CVS folder. If not,
00482             // we don't want the user to be prompted (like when
00483             // WinCvs is starting for the first time).
00484             UStr cvsFolder(m_root);
00485             if(!cvsFolder.endsWith(kPathDelimiter))
00486                 cvsFolder << kPathDelimiter;
00487             cvsFolder << "CVS";
00488             struct stat sb;
00489             if (stat(cvsFolder, &sb) != -1 && S_ISDIR(sb.st_mode))
00490                 AskCreatePersistentSettings(m_root);
00491         }
00492     }
00493
00494     if(stricmp(gOldLoc, m_root) != 0)
00495         gOldLoc = m_root;
00496
00497     // update the history combo
00498     gHistoryLocs.Insert(m_root);
00499     UEventSendMessage(kUCvsFrameID, EV_COMBO_RESETALL, UCvsFrame::kDirCombo, 0L);
00500     const std::vector<UStr> & list = gHistoryLocs.GetList();
00501     std::vector<UStr>::const_iterator i;
00502     int pos = 0;
00503     for(i = list.begin(); i != list.end(); ++i, pos++)
00504     {
00505         UEventSendMessage(kUCvsFrameID, EV_COMBO_APPEND,
00506                           UCvsFrame::kDirCombo, (void *)(const char *)*i);
00507     }
00508     UEventSendMessage(kUCvsFrameID, EV_COMBO_SETSEL, UMAKEINT(UCvsFrame::kDirCombo, 0), 0L);
00509
00510     // fill the browser
00511     TBrowserFillDummy traverse(this, 0L, 0L, 0L);
00512     /*kTraversal res = */FileTraverse(m_root, traverse);
00513
00514     if(traverse.m_item != 0L)
00515     {
00516         UEventSendMessage(GetWidID(), EV_TREE_EXPAND, UMAKEINT(kUMainWidget, 0), traverse.m_item);
00517         if(notifyView && UCvsApp::gApp->GetFilesView())
00518             UCvsApp::gApp->GetFilesView()->ResetView(path);
00519     }
00520 }

void UCvsFolders::ResetView | ( | bool | forceReload = false,
 |  | bool | notifyView = false
 | ) |

Definition at line 522 of file UCvsFolders.cpp.

References UStr::empty, EV_CHGFOCUS, EV_TREE_GETSEL, EV_TREE_SELECT, UCvsApp::gApp, UCvsApp::GetFilesView, GetItemByLocation, UCmdTarget::GetWidID, kUMainWidget, m_root, ResetBrowser, UCvsFiles::ResetView, RetrievePath, StepToLocation, StoreExpanded, UEventSendMessage, UMAKEINT, and UTREEITEM.

Referenced by OnCmdIgnore, OnCmdReload, and UCvsFiles::ResetView.

00523 {
00524     UWaitCursor doWait;
00525
00526     std::vector<UStr> allExpanded;
00527     StoreExpanded(allExpanded);
00528
00529     bool contentChanged = false;
00530     UStr selPath;
00531     UTREEITEM selItem;
00532     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &selItem);
00533     if(selItem != 0L)
00534         RetrievePath(selItem, selPath);
00535
00536     if(forceReload)
00537     {
00538         ResetBrowser(m_root);
00539         contentChanged = true;
00540     }
00541
00542     if(contentChanged)
00543     {
00544         // restore the expanded paths and the selected item
00545         std::vector<UStr>::const_iterator i;
00546         for(i = allExpanded.begin(); i != allExpanded.end(); ++i)
00547         {
00548             StepToLocation(*i);
00549         }
00550         if(!selPath.empty())
00551         {
00552             selItem = GetItemByLocation(selPath);
00553             if(selItem != 0L)
00554                 UEventSendMessage(GetWidID(), EV_TREE_SELECT, UMAKEINT(kUMainWidget, 0), selItem);
00555         }
00556     }
00557
00558     // we don't need to notify the file view if we force the reload
00559     // because that's already done
00560     if(notifyView)
00561     {
00562         UCvsApp::gApp->GetFilesView()->ResetView(forceReload);
00563     }
00564     UEventSendMessage(GetWidID(), EV_CHGFOCUS, kUMainWidget, 0L);
00565 }

void UCvsFolders::RetrievePath | ( | UTREEITEM | item,
 |  | UStr & | path
 | ) |

Definition at line 846 of file UCvsFolders.cpp.

References UStr::endsWith, EV_TREE_GETINFO, UCmdTarget::GetWidID, UTREE_INFO::item, kUMainWidget, m_root, UTREE_INFO::parent, UTREE_INFO::title, UEventSendMessage, and UTREEITEM.

Referenced by OnCmdAdd, OnCmdCommit, OnCmdDiff, OnCmdEdit, OnCmdEditors, OnCmdExplore, OnCmdLock, OnCmdLog, OnCmdMacrosSel, OnCmdQueryUpdate, OnCmdRelease, OnCmdStatus, OnCmdTagBranch, OnCmdTagDelete, OnCmdTagNew, OnCmdUnedit, OnCmdUnlock, OnCmdUpdate, OnCmdWatchers, OnCmdWatchOff, OnCmdWatchOn, OnTreeExpanding, OnTreeSelecting, OnUpdateGeneric, ResetView, and StoreExpanded.

00847 {
00848     UStr tmp, newPath;
00849     path = "";
00850
00851     do
00852     {
00853         UTREE_INFO query;
00854         query.item = item;
00855         UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00856
00857         item = query.parent;
00858
00859         tmp = path;
00860         newPath = item == 0L ? (const char *)m_root : query.title;
00861         if(!newPath.endsWith(kPathDelimiter))
00862             newPath << kPathDelimiter;
00863         newPath << path;
00864         path = newPath;
00865     } while(item != 0L);
00866 }

const URuntimeClass * UCvsFolders::rtUCvsFolders ( void ) [static]

Definition at line 79 of file UCvsFolders.cpp.

void UCvsFolders::SetDefaultRoot ( const char * root ) [static]

Definition at line 833 of file UCvsFolders.cpp.

References cvs_err, and stat.

Referenced by UCvsApp::UCvsApp.

00834 {
00835     struct stat sb;
00836
00837     if (stat(root, &sb) == -1 || !S_ISDIR(sb.st_mode))
00838     {
00839         cvs_err("Cannot access directory '%s' (error %d)\n", root, errno);
00840         return;
00841     }
00842
00843     gOldLoc = root;
00844 }

void UCvsFolders::StepToLocation | ( | const char * | path,
 |  | bool | notifyView = false
 | ) |

Definition at line 595 of file UCvsFolders.cpp.

References UTREE_INFO::child, UTREE_INFO::data, UStr::endsWith, EV_TREE_EXPAND, EV_TREE_GETINFO, EV_TREE_SELECT, UCmdTarget::GetWidID, UTREE_INFO::item, EntnodeData::kName, kUMainWidget, UStr::length, m_root, UTREE_INFO::next, UStr::set, sTemporaryTurnOffNotify, UEventSendMessage, UMAKEINT, and UTREEITEM.

Referenced by ResetView, and UCvsFiles::ResetView.

00596 {
00597     UStr root(m_root);
00598     if(!root.endsWith(kPathDelimiter))
00599         root << kPathDelimiter;
00600     UStr subpath(path);
00601     if(!subpath.endsWith(kPathDelimiter))
00602         subpath << kPathDelimiter;
00603
00604     // check if it is a sub-path
00605     if(strncmp(root, subpath, root.length()) != 0)
00606         return;
00607
00608     UTREE_INFO query;
00609     query.item = 0L;
00610     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00611
00612     UTREEITEM item = query.item;
00613     UTREEITEM lastitem = 0L;
00614     if(item == 0L)
00615         return;
00616
00617     // step inside synchronized
00618     const char *tmp = (const char *)subpath + root.length() - 1;
00619     while((tmp = strchr(tmp, kPathDelimiter)) != 0L)
00620     {
00621         const char *name = ++tmp;
00622         if(name[0] == '\0')
00623             break;
00624
00625         UStr subname;
00626         const char *tmp2 = strchr(name, kPathDelimiter);
00627         if(tmp2 == 0L)
00628             subname = name;
00629         else
00630             subname.set(name, tmp2 - name);
00631
00632         query.item = item;
00633         UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00634         UTREEITEM childItem = query.child;
00635
00636         // find the subitem which matches this name
00637         while(childItem != 0L)
00638         {
00639             query.item = childItem;
00640             UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00641             EntnodeData *data = (EntnodeData *)query.data;
00642             if(data != 0L)
00643             {
00644 #ifdef qUnix
00645                 if(strcmp((*data)[EntnodeData::kName], subname) == 0)
00646 #else
00647                 if(_stricmp((*data)[EntnodeData::kName], subname) == 0)
00648 #endif
00649                 {
00650                     // found it !
00651                     lastitem = item = childItem;
00652                     UEventSendMessage(GetWidID(), EV_TREE_EXPAND, UMAKEINT(kUMainWidget, 0), item);
00653                     break;
00654                 }
00655             }
00656
00657             childItem = query.next;
00658         }
00659     }
00660
00661     // in case this is called by the view, turn off notifying
00662     // when the item gets selected
00663     if(lastitem != 0L)
00664     {
00665         if(!notifyView)
00666         {
00667             CTempToggleBool toggler(sTemporaryTurnOffNotify);
00668             UEventSendMessage(GetWidID(), EV_TREE_SELECT, UMAKEINT(kUMainWidget, 0), lastitem);
00669         }
00670         else
00671         {
00672             UEventSendMessage(GetWidID(), EV_TREE_SELECT, UMAKEINT(kUMainWidget, 0), lastitem);
00673         }
00674     }
00675 }

void UCvsFolders::StoreExpanded | ( | std::vector< UStr > & | allExpanded,
 |  | UTREEITEM | root = 0L
 | ) | [protected]

Definition at line 567 of file UCvsFolders.cpp.

References UTREE_INFO::child, EV_TREE_GETINFO, UTREE_INFO::expanded, UCmdTarget::GetWidID, UTREE_INFO::item, kUMainWidget, UTREE_INFO::next, RetrievePath, UEventSendMessage, and UTREEITEM.

Referenced by ResetView.

00568 {
00569     UTREE_INFO query;
00570     query.item = root;
00571     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00572
00573     UTREEITEM item = query.item;
00574     if(item == 0L)
00575         return;
00576
00577     if(query.expanded)
00578     {
00579         UStr path;
00580         RetrievePath(item, path);
00581         allExpanded.push_back(path);
00582     }
00583
00584     UTREEITEM childItem = query.child;
00585
00586     while(childItem != 0L)
00587     {
00588         StoreExpanded(allExpanded, childItem);
00589         query.item = childItem;
00590         UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00591         childItem = query.next;
00592     }
00593 }

Member Data Documentation

const UMSGMAP_ENTRY UCvsFolders::_messageEntries [static, private]

Reimplemented from UWidget.

Definition at line 81 of file UCvsFolders.cpp.

const URuntimeClass UCvsFolders::classUCvsFolders [static, protected]

UStr UCvsFolders::m_root [protected]

Definition at line 62 of file UCvsFolders.h.

Referenced by GetItemByLocation, GetRoot, ResetBrowser, ResetView, RetrievePath, and StepToLocation.

const UMSGMAP UCvsFolders::messageMap = { UWidget ::GetThisMessageMap(), & UCvsFolders ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Definition at line 81 of file UCvsFolders.cpp.

The documentation for this class was generated from the following files:
  • common/UCvsFolders.h
  • common/UCvsFolders.cpp
Generated on Sun Feb 24 01:25:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsFrame Class Reference

#include <UCvsFrame.h>

Inheritance diagram for UCvsFrame:

[legend]
Collaboration diagram for UCvsFrame:

[legend]
List of all members.

Public Types

enum {
kDirCombo = EV_COMMAND_START,
kBrowserPopup
}

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UCvsFrame ()
virtual | ~UCvsFrame ()
bool | AskForQuitting (void)

Static Public Methods

const URuntimeClass * | rtUCvsFrame (void)

Protected Methods

void | OnCmdUIAnytime (int cmd, UCmdUI *pCmdUI)
void | OnCmdUIQuit (UCmdUI *pCmdUI)
void | OnCmdUIStopcvs (UCmdUI *pCmdUI)
void | OnCmdUICvsCmd (UCmdUI *pCmdUI)
void | OnCmdUIMacroAdmin (int cmd, UCmdUI *pCmdUI)
void | OnDestroy (void)
int | OnQuit (void)
int | OnCopyrights (void)
int | OnCredits (void)
void | OnComboSelDir (int pos, const char *txt)
int | OnBrowserPopup (void)
int | OnCmdPreferences (void)
int | OnCmdSaveSettings (void)
int | OnCmdRtagNew (void)
int | OnCmdRtagDelete (void)
int | OnCmdRtagBranch (void)
int | OnCmdCmdline (void)
int | OnCmdLogin (void)
int | OnCmdLogout (void)
int | OnCmdStopcvs (void)
int | OnCmdInit (void)
int | OnCmdMacroAdmin (int cmd)
virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Static Protected Attributes

const URuntimeClass | classUCvsFrame
const UMSGMAP | messageMap = { UWidget ::GetThisMessageMap(), & UCvsFrame ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Member Enumeration Documentation

anonymous enum

Enumeration values:
kDirCombo
kBrowserPopup

Definition at line 41 of file UCvsFrame.h.

00042     {
00043         kDirCombo = EV_COMMAND_START,   // 0
00044         kBrowserPopup                   // 1
00045     };

Constructor & Destructor Documentation

UCvsFrame::UCvsFrame ( )

Definition at line 90 of file UCvsFrame.cpp.

References kUCvsFrameID.

00090                      : UWidget(kUCvsFrameID)
00091 {
00092 }

UCvsFrame::~UCvsFrame ( ) [virtual]

Definition at line 94 of file UCvsFrame.cpp.

00095 {
00096 }

Member Function Documentation

const URuntimeClass * UCvsFrame::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 45 of file UCvsFrame.cpp.

bool UCvsFrame::AskForQuitting ( void )

Definition at line 106 of file UCvsFrame.cpp.

References CvsAlert, UCvsApp::gApp, and UCvsApp::IsCvsRunning.

Referenced by OnQuit.

00107 {
00108     bool res = true;
00109
00110     if(UCvsApp::gApp->IsCvsRunning())
00111         res = !CvsAlert("Cvs is currently running. Are-you sure you want to quit ?", "Cancel", "Quit");
00112
00113     gCvsPrefs.save();
00114
00115     return res;
00116 }

const UMSGMAP * UCvsFrame::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 47 of file UCvsFrame.cpp.

const UMSGMAP * UCvsFrame::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 47 of file UCvsFrame.cpp.

const URuntimeClass * UCvsFrame::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 45 of file UCvsFrame.cpp.

const UMSGMAP * UCvsFrame::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 47 of file UCvsFrame.cpp.

int UCvsFrame::OnBrowserPopup ( void ) [protected]

Definition at line 123 of file UCvsFrame.cpp.

References BrowserGetDirectory, UCvsApp::gApp, UCvsApp::GetBrowserView, and UCvsFolders::ResetBrowser.

00124 {
00125     const char *newPath =
00126         BrowserGetDirectory("Select a folder to open with the browser");
00127     if(newPath == 0L)
00128         return 0;
00129
00130     UCvsApp::gApp->GetBrowserView()->ResetBrowser(newPath, true);
00131
00132     return 0;
00133 }

int UCvsFrame::OnCmdCmdline ( void ) [protected]

Definition at line 258 of file UCvsFrame.cpp.

References CvsCmdLine.

00259 {
00260     CvsCmdLine();
00261     return 0;
00262 }

int UCvsFrame::OnCmdInit ( void ) [protected]

Definition at line 288 of file UCvsFrame.cpp.

References CvsCmdInit.

00289 {
00290     CvsCmdInit();
00291     return 0;
00292 }

int UCvsFrame::OnCmdLogin ( void ) [protected]

Definition at line 264 of file UCvsFrame.cpp.

References CvsCmdLogin.

00265 {
00266     CvsCmdLogin();
00267     return 0;
00268 }

int UCvsFrame::OnCmdLogout ( void ) [protected]

Definition at line 270 of file UCvsFrame.cpp.

References CvsCmdLogout.

00271 {
00272     CvsCmdLogout();
00273     return 0;
00274 }

int UCvsFrame::OnCmdMacroAdmin ( int cmd ) [protected]

Definition at line 294 of file UCvsFrame.cpp.

References cmdMACROADMIN, CvsCmdMacrosAdmin, and CMacroEntry::path.

00295 {
00296     CMacroEntry & entry = gMacrosAdmin.entries[cmd - cmdMACROADMIN];
00297     CvsCmdMacrosAdmin(entry.path);
00298     return 0;
00299 }

int UCvsFrame::OnCmdPreferences ( void ) [protected]

Definition at line 226 of file UCvsFrame.cpp.

References CompatGetPrefs.

00227 {
00228     CompatGetPrefs();
00229     return 0;
00230 }

int UCvsFrame::OnCmdRtagBranch ( void ) [protected]

Definition at line 252 of file UCvsFrame.cpp.

References CvsCmdRtagBranch.

00253 {
00254     CvsCmdRtagBranch();
00255     return 0;
00256 }

int UCvsFrame::OnCmdRtagDelete ( void ) [protected]

Definition at line 246 of file UCvsFrame.cpp.

References CvsCmdRtagDelete.

00247 {
00248     CvsCmdRtagDelete();
00249     return 0;
00250 }

int UCvsFrame::OnCmdRtagNew ( void ) [protected]

Definition at line 240 of file UCvsFrame.cpp.

References CvsCmdRtagCreate.

00241 {
00242     CvsCmdRtagCreate();
00243     return 0;
00244 }

int UCvsFrame::OnCmdSaveSettings ( void ) [protected]

Definition at line 232 of file UCvsFrame.cpp.

References AskCreatePersistentSettings, UCvsApp::gApp, UCvsApp::GetBrowserView, and UCvsFolders::GetRoot.

00233 {
00234     UCvsFolders *browser = UCvsApp::gApp->GetBrowserView();
00235     if(browser != 0L && browser->GetRoot() != 0L)
00236         AskCreatePersistentSettings(browser->GetRoot());
00237     return 0;
00238 }

int UCvsFrame::OnCmdStopcvs ( void ) [protected]

Definition at line 276 of file UCvsFrame.cpp.

References cvs_out, cvs_process_is_active, cvs_process_kill, UCvsApp::gApp, UCvsApp::gCurCvs, and UCvsApp::SetCvsStopping.

00277 {
00278     UCvsApp::gApp->SetCvsStopping(true);
00279     if(UCvsApp::gCurCvs != 0L && cvs_process_is_active(UCvsApp::gCurCvs))
00280     {
00281         cvs_process_kill(UCvsApp::gCurCvs);
00282         cvs_out("*****CVS stopped on user request !!! *****\n\n");
00283     }
00284
00285     return 0;
00286 }

void UCvsFrame::OnCmdUIAnytime | ( | int | cmd,
 |  | UCmdUI * | pCmdUI
 | ) | [protected]

Definition at line 152 of file UCvsFrame.cpp.

References UCmdUI::Enable, and UCvsApp::gApp.

00153 {
00154     pCmdUI->Enable(!UCvsApp::gApp->IsCvsRunning());
00155 }

void UCvsFrame::OnCmdUICvsCmd ( UCmdUI * pCmdUI ) [protected]

Definition at line 307 of file UCvsFrame.cpp.

References UCmdUI::Enable, and UCvsApp::gApp.

00308 {
00309     pCmdUI->Enable(!UCvsApp::gApp->IsCvsRunning() && !gCvsPrefs.empty());
00310 }

void UCvsFrame::OnCmdUIMacroAdmin | ( | int | cmd,
 |  | UCmdUI * | pCmdUI
 | ) | [protected]

Definition at line 312 of file UCvsFrame.cpp.

References UCmdUI::Enable, UCvsApp::gApp, and CTcl_Interp::IsAvail.

00313 {
00314     pCmdUI->Enable(!UCvsApp::gApp->IsCvsRunning() && !gCvsPrefs.empty() && CTcl_Interp::IsAvail());
00315 }

void UCvsFrame::OnCmdUIQuit ( UCmdUI * pCmdUI ) [protected]

Definition at line 147 of file UCvsFrame.cpp.

References UCmdUI::Enable.

00148 {
00149     pCmdUI->Enable(true);
00150 }

void UCvsFrame::OnCmdUIStopcvs ( UCmdUI * pCmdUI ) [protected]

Definition at line 301 of file UCvsFrame.cpp.

References UCmdUI::Enable, UCvsApp::gApp, UCvsApp::IsCvsRunning, and UCvsApp::IsCvsStopping.

00302 {
00303     UCvsApp *app = UCvsApp::gApp;
00304     pCmdUI->Enable(app->IsCvsRunning() && !app->IsCvsStopping());
00305 }

void UCvsFrame::OnComboSelDir | ( | int | pos,
 |  | const char * | txt
 | ) | [protected]

Definition at line 118 of file UCvsFrame.cpp.

References UCvsApp::gApp, UCvsApp::GetBrowserView, and UCvsFolders::ResetBrowser.

00119 {
00120     UCvsApp::gApp->GetBrowserView()->ResetBrowser(txt, true);
00121 }

int UCvsFrame::OnCopyrights ( void ) [protected]

Definition at line 157 of file UCvsFrame.cpp.

References cvs_out, UCvsApp::gApp, and UCvsApp::GetAppName.

00158 {
00159     const char *appName = UCvsApp::gApp->GetAppName();
00160
00161     cvs_out("\nBoth %s and CVS are distributed under the terms of\n", appName);
00162     cvs_out("the GNU General Public Licence (GPL).\n\n");
00163     cvs_out("* %s : maintained by Alexandre Parenteau (aubonbeurre@hotmail.com)\n", appName);
00164     cvs_out("* CVS : Copyright © 1989-1998 Brian Berliner, david d `zoo' zuhn,\n");
00165     cvs_out("        Jeff Polk, and other authors\n");
00166 #ifdef macintosh
00167     printf("* MacCVS : Mike Ladwig, Matthias Neeracher, Alexandre Parenteau\n");
00168     printf("* GUSI : Copyright © 1992-1997 Matthias Neeracher\n");
00169     printf("* Waste : Copyright © 1993-1998 Marco Piovanelli\n");
00170     printf("* CWASTEEdit : Copyright © 1995-1997 Timothy Paustian\n");
00171     printf("* ABalloon : Freeware of James W. Walker (jwwalker@kagi.com)\n");
00172     printf("* Metrowerks Standard Library, PowerPlant & CodeWarrior :\n");
00173     printf("    Copyright © 1996-1997 Metrowerks Inc.\n");
00174     printf("* MPW, MoreFiles : Copyright © Apple Computer Inc.\n");
00175 #endif
00176 #ifdef WIN32
00177     cvs_out("* WinCvs documentation : Copyright © 1999 Don Harper <don@lamrc.com>.\n");
00178     cvs_out("* CJLIB : Copyright © 1998-99 Kirk Stowell <kstowell@codejockeys.com>\n");
00179     cvs_out("* MFC : Copyright © 1992-1997 Microsoft Corporation\n");
00180 #endif
00181     cvs_out("* Kerberos : Copyright © 1997 the Massachusetts Institute of Technology\n");
00182     cvs_out("* TCL : Copyright © Sun Microsystems Inc.\n");
00183     cvs_out("\nSome others copyrights may apply, check the source code for details.\n");
00184     return 0;
00185 }

int UCvsFrame::OnCredits ( void ) [protected]

Definition at line 187 of file UCvsFrame.cpp.

References cvs_out, UCvsApp::gApp, UCvsApp::GetAppName, and UCvsApp::GetAppVersion.

00188 {
00189     const char *appName = UCvsApp::gApp->GetAppName();
00190     const char *appVers = UCvsApp::gApp->GetAppVersion();
00191
00192 #ifndef macintosh
00193     cvs_out("\n%s %s - Client/Local\n", appName, appVers);
00194 #else
00195     cvs_out("\n%s %s - Client\n", appName, appVers);
00196 #endif
00197     cvs_out("%s is maintained by Alexandre Parenteau\n", appName);
00198     cvs_out("- WinCvs/MacCvs/gcvs page : http://www.wincvs.org\n");
00199     cvs_out("- cvs page : http://www.cyclic.com\n");
00200 #ifdef WIN32
00201     cvs_out("- WinCvs documentation : Don Harper <don@lamrc.com>.\n");
00202     cvs_out("- WinHelp cvs documentation : Norbert Klamann.\n");
00203 #endif
00204 #ifdef macintosh
00205     printf("- Mac port :\n");
00206     printf("\t* Mike Ladwig <mike@twinpeaks.prc.com>\n");
00207     printf("\t* Matthias Neeracher <neeri@iis.ee.ethz.ch>\n");
00208     printf("\t* Alexandre Parenteau <aubonbeurre@hotmail.com>\n");
00209     printf("- With contributions of :\n");
00210     printf("\t* Miro Jurisic <meeroh@mit.edu> (Kerberos)\n");
00211     printf("\t* Aleks Totic <atotic@netscape.com> (AppleSingle)\n");
00212     printf("\t* Jocelyn Houle <houlejo@IRO.UMontreal.CA> (Help balloons)\n");
00213 #endif
00214     cvs_out("- Special thanks to :\n");
00215     cvs_out("\t* Gary Bringhurst from C3D Digital who gives me time, resources,\n");
00216     cvs_out("\t  help and ideas for doing this project (http://www.3d.com)\n");
00217     cvs_out("\t* The Freeware community for providing cvs, Linux, Perl, GTK, gcc\n");
00218     cvs_out("\t  and so many others valuables tools\n");
00219     cvs_out("\t* The users of the CvsGui project (WinCvs, MacCvs, gcvs) who have\n");
00220     cvs_out("\t  defined all the functionnalities and help every day to enhance it\n");
00221     cvs_out("- Cvs contributors :\n");
00222     cvs_out("\t* Too many to be listed here, see the 'ChangeLog' instead !\n");
00223     return 0;
00224 }

void UCvsFrame::OnDestroy ( void ) [protected]

Definition at line 98 of file UCvsFrame.cpp.

00099 {
00100 #if qGTK
00101     gtk_main_quit();
00102 #endif /* qGTK */
00103     delete this;
00104 }

int UCvsFrame::OnQuit ( void ) [protected]

Definition at line 135 of file UCvsFrame.cpp.

References AskForQuitting.

00136 {
00137     if(!AskForQuitting())
00138         return 0;
00139
00140 #if qGTK
00141     gtk_main_quit();
00142 #endif /* qGTK */
00143
00144     return 0;
00145 }

const URuntimeClass * UCvsFrame::rtUCvsFrame ( void ) [static]

Definition at line 45 of file UCvsFrame.cpp.

Member Data Documentation

const UMSGMAP_ENTRY UCvsFrame::_messageEntries [static, private]

Reimplemented from UWidget.

Definition at line 47 of file UCvsFrame.cpp.

const URuntimeClass UCvsFrame::classUCvsFrame [static, protected]

const UMSGMAP UCvsFrame::messageMap = { UWidget ::GetThisMessageMap(), & UCvsFrame ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Definition at line 47 of file UCvsFrame.cpp.

The documentation for this class was generated from the following files:
  • common/UCvsFrame.h
  • common/UCvsFrame.cpp
Generated on Sun Feb 24 01:25:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsGraph Class Reference

#include <UCvsGraph.h>

Inheritance diagram for UCvsGraph:

[legend]
Collaboration diagram for UCvsGraph:

[legend]
List of all members.

Public Types

enum | { kDrawing = EV_COMMAND_START }

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UCvsGraph (CLogNode *node, const char *dir)
virtual | ~UCvsGraph ()

Static Public Methods

const URuntimeClass * | rtUCvsGraph (void)

Protected Methods

void | CalcImageSize (void)
void | OnDestroy ()
void | OnCreate ()
void | OnDrawing (void *info)
virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Protected Attributes

CLogNode * | m_node
UStr m_dir
UStr m_name
EntnodeData * m_data

Static Protected Attributes

const URuntimeClass | classUCvsGraph
const UMSGMAP | messageMap = { UWidget ::GetThisMessageMap(), & UCvsGraph ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Member Enumeration Documentation

anonymous enum

Enumeration values:
kDrawing

Definition at line 40 of file UCvsGraph.h.

00041     {
00042         kDrawing = EV_COMMAND_START // 0
00043     };

Constructor & Destructor Documentation

UCvsGraph::UCvsGraph | ( | CLogNode * | node,
 |  | const char * | dir
 | ) |

Definition at line 48 of file UCvsGraph.cpp.

References ENTNODE::Compare, cvs_err, Entries_Open, Entries_SetVisited, m_data, m_name, EntnodeData::Ref, and stat.

00048                                                     :
00049     UWidget(::UEventGetWidID()), m_node(node), m_dir(dir), m_data(0L)
00050 {
00051     // get the CVS/Entries infos for this file
00052     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00053     if(!Entries_Open (entries, dir))
00054     {
00055         cvs_err("Warning : Error while accessing the CVS folder in '%s'\n", dir);
00056     }
00057     else
00058     {
00059         if(node->GetType() != kNodeHeader)
00060         {
00061             cvs_err("Warning : Top node is not a RCS file description !\n");
00062         }
00063         else
00064         {
00065             const char *name = (**(CLogNodeHeader *)node).WorkingFile();
00066             struct stat sb;
00067             if (stat(name, &sb) == -1)
00068             {
00069                 cvs_err("Warning : Unknown file '%s'\n", name);
00070             }
00071             else
00072             {
00073                 m_data = Entries_SetVisited(dir, entries, name, sb, false);
00074                 m_data->Ref();
00075                 m_name = name;
00076             }
00077         }
00078     }
00079 }

UCvsGraph::~UCvsGraph ( ) [virtual]

Definition at line 81 of file UCvsGraph.cpp.

References m_data, m_node, and EntnodeData::UnRef.

00082 {
00083     if(m_node != 0L)
00084         delete m_node;
00085     if(m_data != 0L)
00086         m_data->UnRef();
00087 }

Member Function Documentation

const URuntimeClass * UCvsGraph::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 40 of file UCvsGraph.cpp.

void UCvsGraph::CalcImageSize ( void ) [protected]

Definition at line 692 of file UCvsGraph.cpp.

References CWinLogData::Bounds, CWinLogData::ComputeBounds, CWinLogData::CreateNewData, UWidget::GetWidget, UCmdTarget::GetWidID, URect::Height, kDrawing, m_data, m_node, CWinLogData::Offset, URect::Size, URect::TopLeft, and URect::Width.

Referenced by OnDrawing.

00693 {
00694     if(m_node == 0L)
00695         return;
00696
00697     // set all the bounds locations
00698     UDC dc(GetWidID(), kDrawing);
00699     CWinLogData *data = CWinLogData::CreateNewData(m_node);
00700     m_node->SetUserData(data);
00701     UPoint start(5, 5);
00702     data->ComputeBounds(start, dc, m_data);
00703
00704     // reoffset from (0, 0)
00705     URect bounds = data->Bounds();
00706     data->Offset(start - bounds.TopLeft());
00707     bounds = data->Bounds();
00708
00709 #if qGTK
00710     GtkWidget *layout = (GtkWidget *)GetWidget(kDrawing);
00711     gtk_layout_set_size (GTK_LAYOUT (layout), bounds.Width(), bounds.Height());
00712 #endif
00713 #if 0
00714     // set the scroll size
00715     SetScrollSizes(MM_TEXT, bounds.Size() + USize(5, 5));
00716 #endif
00717 }

const UMSGMAP * UCvsGraph::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 42 of file UCvsGraph.cpp.

const UMSGMAP * UCvsGraph::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 42 of file UCvsGraph.cpp.

const URuntimeClass * UCvsGraph::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 40 of file UCvsGraph.cpp.

const UMSGMAP * UCvsGraph::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 42 of file UCvsGraph.cpp.

void UCvsGraph::OnCreate ( ) [protected]

Definition at line 94 of file UCvsGraph.cpp.

References EV_SETTEXT, UCmdTarget::GetWidID, kUMainWidget, m_name, and UEventSendMessage.

00095 {
00096     UStr title("Graph log : ");
00097     title << m_name;
00098     UEventSendMessage(GetWidID(), EV_SETTEXT, kUMainWidget, (void *)(const char *)title);
00099 }

void UCvsGraph::OnDestroy ( ) [protected]

Definition at line 89 of file UCvsGraph.cpp.

00090 {
00091     delete this;
00092 }

void UCvsGraph::OnDrawing ( void * info ) [protected]

Definition at line 719 of file UCvsGraph.cpp.

References CalcImageSize, UWidget::GetWidget, UCmdTarget::GetWidID, kDrawing, m_data, m_node, and CWinLogData::Update.

00720 {
00721 #if qGTK
00722     GdkEventExpose *event = (GdkEventExpose *)info;
00723     GtkLayout *layout = GTK_LAYOUT(GetWidget(kDrawing));
00724     gdk_window_clear_area (layout->bin_window,
00725                            event->area.x, event->area.y,
00726                            event->area.width, event->area.height);
00727 #endif
00728     CalcImageSize();
00729
00730     if(m_node == 0L || m_node->GetUserData() == 0L)
00731         return;
00732
00733     UDC dc(GetWidID(), kDrawing);
00734     CWinLogData *data = (CWinLogData *)m_node->GetUserData();
00735     data->Update(dc, m_data);
00736
00737 /*  GtkWidget *widget = (GtkWidget *)GetWidget(kDrawing);
00738     if(widget == 0L)
00739         return;
00740
00741     GtkDrawingArea *darea;
00742     GdkDrawable *drawable;
00743     GdkGC *black_gc;
00744     GdkGC *gray_gc;
00745     GdkGC *white_gc;
00746     guint max_width;
00747     guint max_height;
00748
00749     g_return_if_fail (widget != NULL);
00750     g_return_if_fail (GTK_IS_DRAWING_AREA (widget));
00751
00752     darea = GTK_DRAWING_AREA (widget);
00753     drawable = widget->window;
00754     white_gc = widget->style->white_gc;
00755     gray_gc = widget->style->bg_gc[GTK_STATE_NORMAL];
00756     black_gc = widget->style->black_gc;
00757     max_width = widget->allocation.width;
00758     max_height = widget->allocation.height;
00759     gdk_draw_rectangle (drawable, black_gc,
00760                         TRUE,
00761                         0,
00762                         max_height / 2,
00763                         max_width,
00764                         max_height / 2);*/
00765 }

const URuntimeClass * UCvsGraph::rtUCvsGraph ( void ) [static]

Definition at line 40 of file UCvsGraph.cpp.

Member Data Documentation

const UMSGMAP_ENTRY UCvsGraph::_messageEntries [static, private]

Initial value:

   {
    { EV_DESTROY, epV_V, UMSG_NOEXT, 0, 0,   (UPMSG)(void (UCmdTarget::*)(void))& UCvsGraph ::OnDestroy },
    { EV_CREATE, epV_V, UMSG_NOEXT, 0, 0,   (UPMSG)(void (UCmdTarget::*)(void))& UCvsGraph ::OnCreate },
    { EV_CUSTOM_DRAW, epV_VP, UMSG_RANGE,  UCvsGraph::kDrawing ,  UCvsGraph::kDrawing ,   (UPMSG)(void (UCmdTarget::*)(void *drawInfo))& UCvsGraph::OnDrawing  },
{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }   }

Reimplemented from UWidget.

Definition at line 42 of file UCvsGraph.cpp.

const URuntimeClass UCvsGraph::classUCvsGraph [static, protected]

EntnodeData* UCvsGraph::m_data [protected]

Definition at line 48 of file UCvsGraph.h.

Referenced by CalcImageSize, OnDrawing, UCvsGraph, and ~UCvsGraph.

UStr UCvsGraph::m_dir [protected]

Definition at line 46 of file UCvsGraph.h.

UStr UCvsGraph::m_name [protected]

Definition at line 47 of file UCvsGraph.h.

Referenced by OnCreate, and UCvsGraph.

CLogNode* UCvsGraph::m_node [protected]

Definition at line 45 of file UCvsGraph.h.

Referenced by CalcImageSize, OnDrawing, and ~UCvsGraph.

const UMSGMAP UCvsGraph::messageMap = { UWidget ::GetThisMessageMap(), & UCvsGraph ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Definition at line 42 of file UCvsGraph.cpp.

The documentation for this class was generated from the following files:
  • common/UCvsGraph.h
  • common/UCvsGraph.cpp
Generated on Sun Feb 24 01:25:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsMenubar Class Reference

#include <UCvsMenubar.h>

Inheritance diagram for UCvsMenubar:

[legend]
Collaboration diagram for UCvsMenubar:

[legend]
List of all members.

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UCvsMenubar ()
virtual | ~UCvsMenubar ()

Static Public Methods

const URuntimeClass * | rtUCvsMenubar (void)

Protected Methods

void | OnDestroy ()
void | OnCreate ()
virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Static Protected Attributes

const URuntimeClass | classUCvsMenubar
const UMSGMAP | messageMap = { UMenu ::GetThisMessageMap(), & UCvsMenubar ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Constructor & Destructor Documentation

UCvsMenubar::UCvsMenubar ( )

Definition at line 38 of file UCvsMenubar.cpp.

References kUCvsMenubarID.

00038                          : UMenu(kUCvsMenubarID)
00039 {
00040 }

UCvsMenubar::~UCvsMenubar ( ) [virtual]

Definition at line 42 of file UCvsMenubar.cpp.

00043 {
00044 }

Member Function Documentation

const URuntimeClass * UCvsMenubar::_GetBaseClass ( ) [static, protected]

Reimplemented from UMenu.

Definition at line 31 of file UCvsMenubar.cpp.

const UMSGMAP * UCvsMenubar::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UMenu.

Definition at line 33 of file UCvsMenubar.cpp.

const UMSGMAP * UCvsMenubar::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UMenu.

Definition at line 33 of file UCvsMenubar.cpp.

const URuntimeClass * UCvsMenubar::GetRuntimeClass ( ) const [virtual]

Reimplemented from UMenu.

Definition at line 31 of file UCvsMenubar.cpp.

const UMSGMAP * UCvsMenubar::GetThisMessageMap ( ) [static, protected]

Reimplemented from UMenu.

Definition at line 33 of file UCvsMenubar.cpp.

void UCvsMenubar::OnCreate ( ) [protected]

Definition at line 51 of file UCvsMenubar.cpp.

00052 {
00053 }

void UCvsMenubar::OnDestroy ( ) [protected]

Definition at line 46 of file UCvsMenubar.cpp.

00047 {
00048     delete this;
00049 }

const URuntimeClass * UCvsMenubar::rtUCvsMenubar ( void ) [static]

Definition at line 31 of file UCvsMenubar.cpp.

Member Data Documentation

const UMSGMAP_ENTRY UCvsMenubar::_messageEntries [static, private]

Initial value:

   {
    { EV_DESTROY, epV_V, UMSG_NOEXT, 0, 0,   (UPMSG)(void (UCmdTarget::*)(void))& UCvsMenubar ::OnDestroy },
    { EV_CREATE, epV_V, UMSG_NOEXT, 0, 0,   (UPMSG)(void (UCmdTarget::*)(void))& UCvsMenubar ::OnCreate },
{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }   }

Reimplemented from UMenu.

Definition at line 33 of file UCvsMenubar.cpp.

const URuntimeClass UCvsMenubar::classUCvsMenubar [static, protected]

const UMSGMAP UCvsMenubar::messageMap = { UMenu ::GetThisMessageMap(), & UCvsMenubar ::_messageEntries[0] } [static, protected]

Reimplemented from UMenu.

Definition at line 33 of file UCvsMenubar.cpp.

The documentation for this class was generated from the following files:
  • common/UCvsMenubar.h
  • common/UCvsMenubar.cpp
Generated on Sun Feb 24 01:25:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCvsStatusBar Class Reference

#include <CvsStatusBar.h>

Inheritance diagram for CCvsStatusBar:

[legend]
Collaboration diagram for CCvsStatusBar:

[legend]
List of all members.

Public Methods

CCvsStatusBar ()
virtual void | DrawItem (LPDRAWITEMSTRUCT)
virtual | ~CCvsStatusBar ()

Protected Methods

afx_msg void | OnTimer (UINT nIDEvent)

Protected Attributes

CBitmap | m_indic
int | m_step
bool | m_settimer

Constructor & Destructor Documentation

CCvsStatusBar::CCvsStatusBar ( )

Definition at line 18 of file CvsStatusBar.cpp.

References IDB_IDLE, and m_indic.

00018                              : m_step(-1), m_settimer(false)
00019 {
00020     m_indic.LoadBitmap(IDB_IDLE);
00021 }

CCvsStatusBar::~CCvsStatusBar ( ) [virtual]

Definition at line 23 of file CvsStatusBar.cpp.

00024 {
00025 }

Member Function Documentation

void CCvsStatusBar::DrawItem ( LPDRAWITEMSTRUCT ) [virtual]

Definition at line 27 of file CvsStatusBar.cpp.

References CWincvsApp::gCvsRunning, m_indic, m_settimer, and m_step.

00028 {
00029     if(!m_settimer)
00030     {
00031         SetTimer(999, 100, 0L);
00032         m_settimer = true;
00033     }
00034
00035     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00036     if(!app->gCvsRunning && !gCvsPrefs.IsTclFileRunning())
00037         return;
00038
00039     static int tab[12] = {
00040         -2, -1, 1, 4, 8, 11, 13, 11,
00041         8, 4, 1, -1};
00042     CDC hdc;
00043     CBrush b(RGB(0, 0, 0xFF));
00044
00045     hdc.Attach(p->hDC);
00046     CRect r(p->rcItem);
00047     hdc.FillRect(r, &b);
00048     CPoint off(r.TopLeft());
00049     off.x -= m_step;
00050     int cnt = 0;
00051     while(off.x < r.right)
00052     {
00053         CPoint offy(off);
00054         offy.y += tab[(m_step + cnt) % 12];
00055         hdc.DrawState(offy, CSize(16,16), m_indic, DSS_NORMAL);
00056         off.x += 24;
00057         cnt++;
00058     }
00059     hdc.Detach();
00060 }

void CCvsStatusBar::OnTimer ( UINT nIDEvent ) [protected]

Definition at line 62 of file CvsStatusBar.cpp.

References FALSE, CWincvsApp::gCvsRunning, and m_step.

00063 {
00064     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00065     if(app->gCvsRunning || gCvsPrefs.IsTclFileRunning())
00066     {
00067         if(++m_step == 24)
00068             m_step = 0;
00069
00070         CRect r;
00071         GetItemRect(1, r);
00072         InvalidateRect(r, FALSE);
00073     }
00074     else if(m_step != -1)
00075     {
00076         m_step = -1;
00077         CRect r;
00078         GetItemRect(1, r);
00079         InvalidateRect(r, FALSE);
00080     }
00081 }

Member Data Documentation

CBitmap CCvsStatusBar::m_indic [protected]

Definition at line 37 of file CvsStatusBar.h.

Referenced by CCvsStatusBar, and DrawItem.

bool CCvsStatusBar::m_settimer [protected]

Definition at line 39 of file CvsStatusBar.h.

Referenced by DrawItem.

int CCvsStatusBar::m_step [protected]

Definition at line 38 of file CvsStatusBar.h.

Referenced by DrawItem, and OnTimer.

The documentation for this class was generated from the following files:
  • WinCvs/CvsStatusBar.h
  • WinCvs/CvsStatusBar.cpp
Generated on Sun Feb 24 01:25:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CCvsThreadLock Class Reference

#include <wincvsView.h>

Collaboration diagram for CCvsThreadLock:

[legend]
List of all members.

Public Methods

CCvsThreadLock ()
~CCvsThreadLock ()

Static Public Attributes

CRITICAL_SECTION m_lock

Constructor & Destructor Documentation

CCvsThreadLock::CCvsThreadLock ( ) [inline]

Definition at line 42 of file wincvsView.h.

References m_lock.

00043     {
00044         EnterCriticalSection(&m_lock);
00045     }

CCvsThreadLock::~CCvsThreadLock ( ) [inline]

Definition at line 46 of file wincvsView.h.

References m_lock.

00047     {
00048         LeaveCriticalSection(&m_lock);
00049     }

Member Data Documentation

CRITICAL_SECTION CCvsThreadLock::m_lock [static]

Definition at line 45 of file wincvsView.cpp.

Referenced by CCvsThreadLock, CWincvsApp::ExitInstance, CWincvsApp::InitInstance, and ~CCvsThreadLock.

The documentation for this class was generated from the following files:
  • WinCvs/wincvsView.h
  • WinCvs/wincvsView.cpp
Generated on Sun Feb 24 01:25:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UCvsToolbar Class Reference

#include <UCvsToolbar.h>

Inheritance diagram for UCvsToolbar:

[legend]
Collaboration diagram for UCvsToolbar:

[legend]
List of all members.

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UCvsToolbar ()
virtual | ~UCvsToolbar ()

Static Public Methods

const URuntimeClass * | rtUCvsToolbar (void)

Protected Methods

void | OnDestroy ()
void | OnCreate ()
virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Static Protected Attributes

const URuntimeClass | classUCvsToolbar
const UMSGMAP | messageMap = { UToolbar ::GetThisMessageMap(), & UCvsToolbar ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Constructor & Destructor Documentation

UCvsToolbar::UCvsToolbar ( )

Definition at line 37 of file UCvsToolbar.cpp.

References kUCvsToolbarID.

00037                          : UToolbar(kUCvsToolbarID)
00038 {
00039 }

UCvsToolbar::~UCvsToolbar ( ) [virtual]

Definition at line 41 of file UCvsToolbar.cpp.

00042 {
00043 }

Member Function Documentation

const URuntimeClass * UCvsToolbar::_GetBaseClass ( ) [static, protected]

Reimplemented from UToolbar.

Definition at line 30 of file UCvsToolbar.cpp.

const UMSGMAP * UCvsToolbar::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UToolbar.

Definition at line 32 of file UCvsToolbar.cpp.

const UMSGMAP * UCvsToolbar::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UToolbar.

Definition at line 32 of file UCvsToolbar.cpp.

const URuntimeClass * UCvsToolbar::GetRuntimeClass ( ) const [virtual]

Reimplemented from UToolbar.

Definition at line 30 of file UCvsToolbar.cpp.

const UMSGMAP * UCvsToolbar::GetThisMessageMap ( ) [static, protected]

Reimplemented from UToolbar.

Definition at line 32 of file UCvsToolbar.cpp.

void UCvsToolbar::OnCreate ( ) [protected]

Definition at line 50 of file UCvsToolbar.cpp.

00051 {
00052 }

void UCvsToolbar::OnDestroy ( ) [protected]

Reimplemented from UToolbar.

Definition at line 45 of file UCvsToolbar.cpp.

00046 {
00047     delete this;
00048 }

const URuntimeClass * UCvsToolbar::rtUCvsToolbar ( void ) [static]

Definition at line 30 of file UCvsToolbar.cpp.

Member Data Documentation

const UMSGMAP_ENTRY UCvsToolbar::_messageEntries [static, private]

Initial value:

   {
    { EV_DESTROY, epV_V, UMSG_NOEXT, 0, 0,   (UPMSG)(void (UCmdTarget::*)(void))& UCvsToolbar ::OnDestroy },
    { EV_CREATE, epV_V, UMSG_NOEXT, 0, 0,   (UPMSG)(void (UCmdTarget::*)(void))& UCvsToolbar ::OnCreate },
{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }   }

Reimplemented from UToolbar.

Definition at line 32 of file UCvsToolbar.cpp.

const URuntimeClass UCvsToolbar::classUCvsToolbar [static, protected]

const UMSGMAP UCvsToolbar::messageMap = { UToolbar ::GetThisMessageMap(), & UCvsToolbar ::_messageEntries[0] } [static, protected]

Reimplemented from UToolbar.

Definition at line 32 of file UCvsToolbar.cpp.

The documentation for this class was generated from the following files:
  • common/UCvsToolbar.h
  • common/UCvsToolbar.cpp
Generated on Sun Feb 24 01:25:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UDC Class Reference

#include <udraw.h>

Collaboration diagram for UDC:

[legend]
List of all members.

Public Methods

UDC (int widid, int cmdid)
~UDC ()
USize | GetTextExtent (const char *lpszString, int nCount) const
int | GetTextHeight (void) const
bool | TextOutClipped (int x, int y, const URECT *lpRect, const char *lpszString, int nCount)
void | MoveTo (int x, int y)
void | LineTo (int x, int y)
bool | DrawBitmap (void *bitmap, UPOINT where)
UPen * | SelectObject (UPen *pPen)
UBrush * | SelectObject (UBrush *pBrush)
bool | Rectangle (const URECT *lpRect)
bool | RoundRect (const URECT *lpRect, UPOINT point)

Protected Attributes

void * | m_wid
UPen * m_pen
UBrush * m_brush

Constructor & Destructor Documentation

UDC::UDC | ( | int | widid,
 |  | int | cmdid
 | ) |

Definition at line 160 of file udraw.cpp.

References UObject::IsKindOf, m_wid, UEventQueryWidget, and URUNTIME_CLASS.

00160                              : m_wid(0L), m_pen(0L), m_brush(0L)
00161 #if qGTK
00162     , m_gc(0L), m_penloc(0, 0), m_drawable(0L), m_orig(0, 0)
00163 #endif
00164 {
00165     UCmdTarget *target = UEventQueryWidget(widid);
00166     if(target == 0L || !target->IsKindOf(URUNTIME_CLASS(UWidget)))
00167         return;
00168
00169     m_wid = ((UWidget *)target)->GetWidget(cmdid);
00170 #if qGTK
00171     if(m_wid != 0L)
00172     {
00173         GtkWidget *widget = GTK_WIDGET(m_wid);
00174         if(GTK_IS_LAYOUT(widget))
00175         {
00176             GtkLayout *layout = GTK_LAYOUT(widget);
00177             m_drawable = layout->bin_window;
00178             m_orig.x = -layout->xoffset;
00179             m_orig.y = -layout->yoffset;
00180         }
00181         else
00182             m_drawable = m_drawable;
00183         m_gc = gdk_gc_new(m_drawable);
00184         if(m_gc == 0L)
00185             m_wid = 0L;
00186         else
00187         {
00188             GdkGCValues values;
00189             gdk_gc_get_values(m_gc, &values);
00190             m_foreground = values.foreground;
00191             m_background = values.background;
00192             m_font = gdk_font_load ("-adobe-*-medium-r-normal--*-120-*-*-*-*-iso8859-*");
00193             if(m_font == 0L)
00194                 m_font = gdk_font_load ("-adobe-courier-medium-r-normal--*-120-*-*-*-*-*-*");
00195             if(m_font != 0L)
00196                 gdk_gc_set_font(m_gc, m_font);
00197         }
00198     }
00199 #endif
00200 }

UDC::~UDC ( )

Definition at line 238 of file udraw.cpp.

00239 {
00240 #if qGTK
00241     if(m_gc != 0L)
00242         gdk_gc_destroy(m_gc);
00243     if(m_font != 0L)
00244         gdk_font_unref (m_font);
00245 #endif
00246 }

Member Function Documentation

bool UDC::DrawBitmap | ( | void * | bitmap,
 |  | UPOINT | where
 | ) |

Definition at line 366 of file udraw.cpp.

References m_wid, UPOINT::x, and UPOINT::y.

Referenced by CWinLogRevData::UpdateSelf.

00367 {
00368     if(m_wid == 0L)
00369         return false;
00370
00371 #if qGTK
00372     if(m_font == 0L)
00373         return false;
00374
00375     gdk_draw_pixmap(m_drawable, m_gc, GTK_PIXMAP(bitmap)->pixmap,
00376                     0, 0, where.x + m_orig.x, where.y + m_orig.y, -1, -1);
00377 #endif
00378
00379     return true;
00380 }

USize UDC::GetTextExtent | ( | const char * | lpszString,
 |  | int | nCount
 | ) | const

Definition at line 312 of file udraw.cpp.

References USIZE::cx, USIZE::cy, and m_wid.

Referenced by CWinLogBranchData::GetBoundsSelf, CWinLogTagData::GetBoundsSelf, CWinLogRevData::GetBoundsSelf, CWinLogHeaderData::GetBoundsSelf, and TextOutClipped.

00313 {
00314     USize res(0, 0);
00315     if(m_wid == 0L)
00316         return res;
00317
00318 #if qGTK
00319     if(m_font == 0L)
00320         return res;
00321
00322     res.cx = gdk_text_width(m_font, lpszString, nCount);
00323     res.cy = gdk_text_height(m_font, lpszString, nCount);
00324 #endif
00325
00326     return res;
00327 }

int UDC::GetTextHeight ( void ) const

Definition at line 329 of file udraw.cpp.

References m_wid.

Referenced by CWinLogBranchData::UpdateSelf, CWinLogTagData::UpdateSelf, CWinLogRevData::UpdateSelf, and CWinLogHeaderData::UpdateSelf.

00330 {
00331     int res = 0;
00332     if(m_wid == 0L)
00333         return res;
00334
00335 #if qGTK
00336     if(m_font == 0L)
00337         return res;
00338
00339     res = m_font->ascent + m_font->descent;
00340 #endif
00341
00342     return res;
00343 }

void UDC::LineTo | ( | int | x,
 |  | int | y
 | ) |

Definition at line 299 of file udraw.cpp.

References m_wid.

Referenced by CWinLogData::Update.

00300 {
00301     if(m_wid == 0L)
00302         return;
00303
00304 #if qGTK
00305     gdk_draw_line(m_drawable, m_gc,
00306                   m_penloc.x, m_penloc.y, x + m_orig.x, y + m_orig.y);
00307     m_penloc.x = x + m_orig.x;
00308     m_penloc.y = y + m_orig.y;
00309 #endif
00310 }

void UDC::MoveTo | ( | int | x,
 |  | int | y
 | ) |

Definition at line 288 of file udraw.cpp.

References m_wid.

Referenced by CWinLogData::Update.

00289 {
00290     if(m_wid == 0L)
00291         return;
00292
00293 #if qGTK
00294     m_penloc.x = x + m_orig.x;
00295     m_penloc.y = y + m_orig.y;
00296 #endif
00297 }

bool UDC::Rectangle ( const URECT * lpRect )

Definition at line 248 of file udraw.cpp.

References FALSE, URect::Height, URECT::left, m_brush, m_pen, m_wid, SelectObject, URECT::top, TRUE, and URect::Width.

Referenced by DrawNode.

00249 {
00250     if(m_wid == 0L)
00251         return false;
00252
00253 #if qGTK
00254     URect r(*lpRect);
00255     if(m_brush != 0L && m_brush->m_set)
00256     {
00257         gdk_gc_set_foreground(m_gc, &m_brush->m_col);
00258         gdk_draw_rectangle (m_drawable, m_gc, TRUE,
00259                             r.left + m_orig.x, r.top + m_orig.y, r.Width(), r.Height());
00260         SelectObject(m_pen);
00261     }
00262     gdk_draw_rectangle (m_drawable, m_gc, FALSE,
00263                         r.left + m_orig.x, r.top + m_orig.y, r.Width(), r.Height());
00264 #endif
00265     return true;
00266 }

bool UDC::RoundRect | ( | const URECT * | lpRect,
 |  | UPOINT | point
 | ) |

Definition at line 268 of file udraw.cpp.

References FALSE, URect::Height, URECT::left, m_brush, m_pen, m_wid, SelectObject, URECT::top, TRUE, and URect::Width.

Referenced by DrawNode.

00269 {
00270     if(m_wid == 0L)
00271         return false;
00272
00273 #if qGTK
00274     URect r(*lpRect);
00275     if(m_brush != 0L && m_brush->m_set)
00276     {
00277         gdk_gc_set_foreground(m_gc, &m_brush->m_col);
00278         gdk_draw_rectangle (m_drawable, m_gc, TRUE,
00279                             r.left + m_orig.x, r.top + m_orig.y, r.Width(), r.Height());
00280         SelectObject(m_pen);
00281     }
00282     gdk_draw_rectangle (m_drawable, m_gc, FALSE,
00283                         r.left + m_orig.x, r.top + m_orig.y, r.Width(), r.Height());
00284 #endif
00285     return true;
00286 }

UBrush * UDC::SelectObject ( UBrush * pBrush )

Definition at line 220 of file udraw.cpp.

References m_brush, and m_wid.

00221 {
00222     if(m_wid == 0L)
00223         return 0L;
00224
00225     UBrush *oldbrush = m_brush;
00226     m_brush = pBrush;
00227
00228 #if qGTK
00229     if(m_brush != 0L && m_brush->m_set)
00230         gdk_gc_set_background(m_gc, &m_brush->m_col);
00231     else
00232         gdk_gc_set_background(m_gc, &m_background);
00233 #endif
00234
00235     return oldbrush;
00236 }

UPen * UDC::SelectObject ( UPen * pPen )

Definition at line 202 of file udraw.cpp.

References m_pen, and m_wid.

Referenced by DrawNode, Rectangle, RoundRect, and CWinLogData::Update.

00203 {
00204     if(m_wid == 0L)
00205         return 0L;
00206
00207     UPen *oldpen = m_pen;
00208     m_pen = pPen;
00209
00210 #if qGTK
00211     if(m_pen != 0L && m_pen->m_set)
00212         gdk_gc_set_foreground(m_gc, &m_pen->m_col);
00213     else
00214         gdk_gc_set_foreground(m_gc, &m_foreground);
00215 #endif
00216
00217     return oldpen;
00218 }

bool UDC::TextOutClipped | ( | int | x,
 |  | int | y,
 |  | const URECT * | lpRect,
 |  | const char * | lpszString,
 |  | int | nCount
 | ) |

Definition at line 345 of file udraw.cpp.

References URECT::bottom, USIZE::cx, USIZE::cy, GetTextExtent, URect::Height, URECT::left, m_wid, URect::Width, UPOINT::x, and UPOINT::y.

Referenced by CWinLogBranchData::UpdateSelf, CWinLogTagData::UpdateSelf, CWinLogRevData::UpdateSelf, and CWinLogHeaderData::UpdateSelf.

00347 {
00348     if(m_wid == 0L)
00349         return false;
00350
00351 #if qGTK
00352     if(m_font == 0L)
00353         return false;
00354
00355     USize size = GetTextExtent(lpszString, nCount);
00356     URect r(*lpRect);
00357     UPoint out(r.left, r.bottom);
00358     out += UPoint((r.Width() - size.cx) / 2, -(r.Height() - size.cy) / 2);
00359     gdk_draw_text(m_drawable, m_font, m_gc, out.x + m_orig.x, out.y + m_orig.y,
00360                   lpszString, nCount);
00361 #endif
00362
00363     return true;
00364 }

Member Data Documentation

UBrush* UDC::m_brush [protected]

Definition at line 525 of file udraw.h.

Referenced by Rectangle, RoundRect, and SelectObject.

UPen* UDC::m_pen [protected]

Definition at line 524 of file udraw.h.

Referenced by Rectangle, RoundRect, and SelectObject.

void* UDC::m_wid [protected]

Definition at line 523 of file udraw.h.

Referenced by DrawBitmap, GetTextExtent, GetTextHeight, LineTo, MoveTo, Rectangle, RoundRect, SelectObject, TextOutClipped, and UDC.

The documentation for this class was generated from the following files:
  • rf/udraw.h
  • rf/udraw.cpp
Generated on Sun Feb 24 01:25:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CDestroyThreadLock Struct Reference

List of all members.

Public Methods

CDestroyThreadLock ()
~CDestroyThreadLock ()

Constructor & Destructor Documentation

CDestroyThreadLock::CDestroyThreadLock ( ) [inline]

Definition at line 145 of file cvsgui_process.cpp.

References CDummyInit::m_destroylock.

00146     {
00147         EnterCriticalSection(&CDummyInit::m_destroylock);
00148     }

CDestroyThreadLock::~CDestroyThreadLock ( ) [inline]

Definition at line 149 of file cvsgui_process.cpp.

References CDummyInit::m_destroylock.

00150     {
00151         LeaveCriticalSection(&CDummyInit::m_destroylock);
00152     }

The documentation for this struct was generated from the following file:
  • common/cvsgui_process.cpp
Generated on Sun Feb 24 01:25:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CDialog Class Reference

Inheritance diagram for CDialog:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CustomizeMenus.h
Generated on Sun Feb 24 01:25:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CDiff_MAIN Class Reference

#include <DiffDlg.h>

Inheritance diagram for CDiff_MAIN:

[legend]
Collaboration diagram for CDiff_MAIN:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_DIFF_MAIN }

Public Methods

CDiff_MAIN (const char *rev1, const char *rev2, bool allowExtDiff, bool noWhiteSpace, bool ignoreCare)
CDiff_MAIN ()
~CDiff_MAIN ()

Public Attributes

CButton m_extdiffctl
CSmartComboBox m_rev2Combo
CSmartComboBox m_rev1Combo
BOOL | m_isDate1
BOOL | m_isDate2
CString | m_rev1
CString | m_rev2
int | m_diff
BOOL | m_norecurs
BOOL | m_extdiff
BOOL | m_noWhiteSpace
BOOL | m_ignoreCase
bool | m_allowExtDiff

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnDiff1 ()
afx_msg void | OnDiff2 ()
afx_msg void | OnDiff3 ()
afx_msg void | OnExtdiff ()
afx_msg void | OnCheck1 ()
afx_msg void | OnCheck2 ()

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 55 of file DiffDlg.h.

00055 { IDD = IDD_DIFF_MAIN };

Constructor & Destructor Documentation

CDiff_MAIN::CDiff_MAIN | ( | const char * | rev1,
 |  | const char * | rev2,
 |  | bool | allowExtDiff,
 |  | bool | noWhiteSpace,
 |  | bool | ignoreCare
 | ) |

Definition at line 67 of file DiffDlg.cpp.

References FALSE, m_diff, m_extdiff, m_ignoreCase, m_isDate1, m_isDate2, m_norecurs, m_noWhiteSpace, m_rev1, m_rev1Combo, m_rev2, m_rev2Combo, and USmartCombo::SetItems.

00067                                                                                                                 :
00068     CPropertyPage(CDiff_MAIN::IDD), m_allowExtDiff(allowExtDiff)
00069 {
00070     //{{AFX_DATA_INIT(CDiff_MAIN)
00071     m_isDate1 = FALSE;
00072     m_isDate2 = FALSE;
00073     m_rev1 = rev1;
00074     m_rev2 = rev2;
00075     m_diff = 0;
00076     m_norecurs = FALSE;
00077     m_extdiff = (bool)gUseExtDiff;
00078     m_noWhiteSpace = noWhiteSpace;
00079     m_ignoreCase = ignoreCase;
00080     //}}AFX_DATA_INIT
00081
00082     m_rev1Combo.SetItems(m_isDate1 ? &gDateNames : &gRevNames);
00083     m_rev2Combo.SetItems(m_isDate2 ? &gDateNames : &gRevNames);
00084 }

CDiff_MAIN::CDiff_MAIN ( )

Definition at line 86 of file DiffDlg.cpp.

00086                        : CPropertyPage(CDiff_MAIN::IDD)
00087 {
00088 }

CDiff_MAIN::~CDiff_MAIN ( )

Definition at line 90 of file DiffDlg.cpp.

00091 {
00092 }

Member Function Documentation

void CDiff_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 94 of file DiffDlg.cpp.

References DDV_MinChars, DDX_ComboMString, IDC_CHECK1, IDC_CHECK2, IDC_COMBO1, IDC_COMBO2, IDC_DIFF1, IDC_EXTDIFF, IDC_IGNORECASE, IDC_IGNOREWHITESPACE, IDC_NORECURS, m_allowExtDiff, m_diff, m_extdiff, m_extdiffctl, m_ignoreCase, m_isDate1, m_isDate2, m_norecurs, m_noWhiteSpace, m_rev1, m_rev1Combo, m_rev2, m_rev2Combo, OnDiff1, and OnExtdiff.

00095 {
00096     CPropertyPage::DoDataExchange(pDX);
00097     //{{AFX_DATA_MAP(CDiff_MAIN)
00098     DDX_Control(pDX, IDC_EXTDIFF, m_extdiffctl);
00099     DDX_Control(pDX, IDC_COMBO2, m_rev2Combo);
00100     DDX_Control(pDX, IDC_COMBO1, m_rev1Combo);
00101     DDX_Check(pDX, IDC_CHECK1, m_isDate1);
00102     DDX_Check(pDX, IDC_CHECK2, m_isDate2);
00103     DDX_CBString(pDX, IDC_COMBO1, m_rev1);
00104     DDX_CBString(pDX, IDC_COMBO2, m_rev2);
00105     DDX_Radio(pDX, IDC_DIFF1, m_diff);
00106     DDX_Check(pDX, IDC_NORECURS, m_norecurs);
00107     DDX_Check(pDX, IDC_EXTDIFF, m_extdiff);
00108     DDX_Check(pDX, IDC_IGNOREWHITESPACE, m_noWhiteSpace);
00109     DDX_Check(pDX, IDC_IGNORECASE, m_ignoreCase);
00110     //}}AFX_DATA_MAP
00111     if( m_diff == 1 || m_diff == 2 )
00112     {
00113         DDV_MinChars(pDX, m_rev1, 1);
00114     }
00115
00116     if( m_diff == 2 )
00117     {
00118         DDV_MinChars(pDX, m_rev2, 1);
00119     }
00120
00121     if( !pDX->m_bSaveAndValidate )
00122     {
00123         OnDiff1();
00124     }
00125
00126     DDX_ComboMString(pDX, IDC_COMBO1, m_rev1Combo);
00127     DDX_ComboMString(pDX, IDC_COMBO2, m_rev2Combo);
00128
00129     m_extdiffctl.EnableWindow(m_allowExtDiff ? true : false);
00130     OnExtdiff();
00131 }

void CDiff_MAIN::OnCheck1 ( ) [protected]

Definition at line 199 of file DiffDlg.cpp.

References DDX_ComboMString, IDC_CHECK1, IDC_COMBO1, m_rev1Combo, NULL, and USmartCombo::SetItems.

00200 {
00201     CButton* btnIsDate = (CButton*)GetDlgItem(IDC_CHECK1);
00202     BOOL isDate = btnIsDate->GetCheck();
00203
00204     m_rev1Combo.SetItems(isDate ? &gDateNames : &gRevNames);
00205     DDX_ComboMString(NULL, IDC_COMBO1, m_rev1Combo);
00206 }

void CDiff_MAIN::OnCheck2 ( ) [protected]

Definition at line 208 of file DiffDlg.cpp.

References DDX_ComboMString, IDC_CHECK2, IDC_COMBO2, m_rev2Combo, NULL, and USmartCombo::SetItems.

00209 {
00210     CButton* btnIsDate = (CButton*)GetDlgItem(IDC_CHECK2);
00211     BOOL isDate = btnIsDate->GetCheck();
00212
00213     m_rev2Combo.SetItems(isDate ? &gDateNames : &gRevNames);
00214     DDX_ComboMString(NULL, IDC_COMBO2, m_rev2Combo);
00215 }

void CDiff_MAIN::OnDiff1 ( ) [protected]

Definition at line 147 of file DiffDlg.cpp.

References FALSE, IDC_CHECK1, IDC_CHECK2, IDC_COMBO1, IDC_COMBO2, IDC_DIFF1, IDC_DIFF2, IDC_DIFF3, and TRUE.

Referenced by DoDataExchange, OnDiff2, and OnDiff3.

00148 {
00149     CButton* but = (CButton *)GetDlgItem(IDC_DIFF1);
00150     CButton* but1 = (CButton *)GetDlgItem(IDC_DIFF2);
00151     CButton* but2 = (CButton *)GetDlgItem(IDC_DIFF3);
00152     CWnd* wnd1 = GetDlgItem(IDC_COMBO1);
00153     CWnd* wnd2 = GetDlgItem(IDC_COMBO2);
00154     CWnd* wnd3 = GetDlgItem(IDC_CHECK1);
00155     CWnd* wnd4 = GetDlgItem(IDC_CHECK2);
00156     if(but->GetCheck() == 1)
00157     {
00158         wnd1->EnableWindow(FALSE);
00159         wnd2->EnableWindow(FALSE);
00160         wnd3->EnableWindow(FALSE);
00161         wnd4->EnableWindow(FALSE);
00162     }
00163     else if(but1->GetCheck() == 1)
00164     {
00165         wnd1->EnableWindow(TRUE);
00166         wnd2->EnableWindow(FALSE);
00167         wnd3->EnableWindow(TRUE);
00168         wnd4->EnableWindow(FALSE);
00169     }
00170     else
00171     {
00172         wnd1->EnableWindow(TRUE);
00173         wnd2->EnableWindow(TRUE);
00174         wnd3->EnableWindow(TRUE);
00175         wnd4->EnableWindow(TRUE);
00176     }
00177 }

void CDiff_MAIN::OnDiff2 ( ) [protected]

Definition at line 179 of file DiffDlg.cpp.

References OnDiff1.

00180 {
00181     OnDiff1();
00182 }

void CDiff_MAIN::OnDiff3 ( ) [protected]

Definition at line 184 of file DiffDlg.cpp.

References OnDiff1.

00185 {
00186     OnDiff1();
00187 }

void CDiff_MAIN::OnExtdiff ( ) [protected]

Definition at line 189 of file DiffDlg.cpp.

References IDC_EXTDIFF, IDC_IGNORECASE, and IDC_IGNOREWHITESPACE.

Referenced by DoDataExchange.

00190 {
00191     CButton* but = (CButton *)GetDlgItem(IDC_EXTDIFF);
00192     CWnd* wnd1 = GetDlgItem(IDC_IGNOREWHITESPACE);
00193     CWnd* wnd2 = GetDlgItem(IDC_IGNORECASE);
00194     BOOL bEnableDiffOptions = ( !but->GetCheck() || !but->IsWindowEnabled() );
00195     wnd1->EnableWindow(bEnableDiffOptions);
00196     wnd2->EnableWindow(bEnableDiffOptions);
00197 }

Member Data Documentation

bool CDiff_MAIN::m_allowExtDiff

Definition at line 70 of file DiffDlg.h.

Referenced by DoDataExchange.

int CDiff_MAIN::m_diff

Definition at line 63 of file DiffDlg.h.

Referenced by CDiff_MAIN, CompatGetDiff, and DoDataExchange.

BOOL CDiff_MAIN::m_extdiff

Definition at line 65 of file DiffDlg.h.

Referenced by CDiff_MAIN, CompatGetDiff, and DoDataExchange.

CButton CDiff_MAIN::m_extdiffctl

Definition at line 56 of file DiffDlg.h.

Referenced by DoDataExchange.

BOOL CDiff_MAIN::m_ignoreCase

Definition at line 67 of file DiffDlg.h.

Referenced by CDiff_MAIN, CompatGetDiff, and DoDataExchange.

BOOL CDiff_MAIN::m_isDate1

Definition at line 59 of file DiffDlg.h.

Referenced by CDiff_MAIN, CompatGetDiff, and DoDataExchange.

BOOL CDiff_MAIN::m_isDate2

Definition at line 60 of file DiffDlg.h.

Referenced by CDiff_MAIN, CompatGetDiff, and DoDataExchange.

BOOL CDiff_MAIN::m_norecurs

Definition at line 64 of file DiffDlg.h.

Referenced by CDiff_MAIN, CompatGetDiff, and DoDataExchange.

BOOL CDiff_MAIN::m_noWhiteSpace

Definition at line 66 of file DiffDlg.h.

Referenced by CDiff_MAIN, CompatGetDiff, and DoDataExchange.

CString CDiff_MAIN::m_rev1

Definition at line 61 of file DiffDlg.h.

Referenced by CDiff_MAIN, CompatGetDiff, and DoDataExchange.

CSmartComboBox CDiff_MAIN::m_rev1Combo

Definition at line 58 of file DiffDlg.h.

Referenced by CDiff_MAIN, DoDataExchange, and OnCheck1.

CString CDiff_MAIN::m_rev2

Definition at line 62 of file DiffDlg.h.

Referenced by CDiff_MAIN, CompatGetDiff, and DoDataExchange.

CSmartComboBox CDiff_MAIN::m_rev2Combo

Definition at line 57 of file DiffDlg.h.

Referenced by CDiff_MAIN, DoDataExchange, and OnCheck2.

The documentation for this class was generated from the following files:
  • common/DiffDlg.h
  • common/DiffDlg.cpp
Generated on Sun Feb 24 01:25:47 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


direct Struct Reference

#include <ndir.h>

Collaboration diagram for direct:

[legend]
List of all members.

Public Attributes

ino_t | d_ino
int | d_reclen
int | d_namlen
char | d_name [255+1]

Member Data Documentation

ino_t direct::d_ino

Definition at line 41 of file ndir.h.

Referenced by readdir.

char direct::d_name[ 255 + 1]

Definition at line 44 of file ndir.h.

Referenced by readdir.

int direct::d_namlen

Definition at line 43 of file ndir.h.

Referenced by opendir, and readdir.

int direct::d_reclen

Definition at line 42 of file ndir.h.

Referenced by readdir.

The documentation for this struct was generated from the following file:
  • WinCvs/ndir.h
Generated on Sun Feb 24 01:25:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CDockBar Class Reference

Inheritance diagram for CDockBar:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJSizeDockBar.h
Generated on Sun Feb 24 01:25:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CDockContext Class Reference

Inheritance diagram for CDockContext:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJDockContext.h
Generated on Sun Feb 24 01:25:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CDocument Class Reference

Inheritance diagram for CDocument:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/GraphDoc.h
Generated on Sun Feb 24 01:25:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


DROPDOWNBUTTON Struct Reference

#include <CJToolBar.h>

Collaboration diagram for DROPDOWNBUTTON:

[legend]
List of all members.

Public Attributes

DROPDOWNBUTTON * | next
UINT | idButton
UINT | idMenu

Member Data Documentation

UINT DROPDOWNBUTTON::idButton

Definition at line 89 of file CJToolBar.h.

Referenced by CCJToolBar::AddDropDownButton, and CCJToolBar::FindDropDownButton.

UINT DROPDOWNBUTTON::idMenu

Definition at line 90 of file CJToolBar.h.

Referenced by CCJToolBar::AddDropDownButton, and CCJToolBar::OnDropDownButton.

DROPDOWNBUTTON* DROPDOWNBUTTON::next

Definition at line 88 of file CJToolBar.h.

Referenced by CCJToolBar::AddDropDownButton, CCJToolBar::FindDropDownButton, and CCJToolBar::~CCJToolBar.

The documentation for this struct was generated from the following file:
  • WinCvs/CJLib/Include/CJToolBar.h
Generated on Sun Feb 24 01:25:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CDummyClass Class Reference

List of all members.

Public Methods

CDummyClass ()
CDummyClass ()

Constructor & Destructor Documentation

CDummyClass::CDummyClass ( ) [inline]

Definition at line 864 of file UPseudoSupport.cpp.

References TPseudoTextListView::kTextStringListViewSignature.

00865     {
00866         InitUSlider();
00867         if (!gUGridViewInitialized)
00868         {
00869             InitUGridView();
00870         }
00871         MA_REGISTER_CLASS(TPseudoAppBehavior);
00872         MA_REGISTER_CLASS(TPseudoIconButton);
00873         MA_REGISTER_CLASS(TPseudoIconPopup);
00874         MA_REGISTER_CLASS(TPseudoScrollBar);
00875         MA_REGISTER_CLASS(TPseudoRotateIconButton);
00876         MA_REGISTER_CLASS(TPseudoIconCheckBox);
00877         MA_REGISTER_CLASS(TBuggyPopup);
00878         MA_REGISTER_CLASS(TPseudoWinBehavior);
00879         MA_REGISTER_CLASS(TPseudoCustomView);
00880         MA_REGISTER_CLASS(TPseudoWinAdorner);
00881         MA_REGISTER_SIGNATURE(TPseudoTextListView,
00882                 TPseudoTextListView::kTextStringListViewSignature);
00883         MA_REGISTER_CLASS(TPseudoDoubleNumberText);
00884     }

CDummyClass::CDummyClass ( ) [inline]

Definition at line 1031 of file UPseudoSupport.cpp.

01032     {
01033         RegisterClass_(UPseudoRotButton);
01034         RegisterClass_(UPseudoPlaceHolder);
01035         RegisterClass_(UPseudoPageHider);
01036     }

The documentation for this class was generated from the following files:
  • rf/support/macapp/UPseudoSupport.cpp
  • rf/support/powerplant/UPseudoSupport.cpp
Generated on Sun Feb 24 01:25:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CDummyInit Class Reference

Collaboration diagram for CDummyInit:

[legend]
List of all members.

Public Methods

CDummyInit ()
~CDummyInit ()

Static Public Attributes

CRITICAL_SECTION | m_destroylock
CRITICAL_SECTION | m_stacklock

Constructor & Destructor Documentation

CDummyInit::CDummyInit ( ) [inline]

Definition at line 87 of file cvsgui_process.cpp.

References m_destroylock, and m_stacklock.

00088     {
00089         ::InitializeCriticalSection(&m_destroylock);
00090         ::InitializeCriticalSection(&m_stacklock);
00091     }

CDummyInit::~CDummyInit ( ) [inline]

Definition at line 93 of file cvsgui_process.cpp.

References m_destroylock, and m_stacklock.

00094     {
00095         ::DeleteCriticalSection(&m_destroylock);
00096         ::DeleteCriticalSection(&m_stacklock);
00097     }

Member Data Documentation

CRITICAL_SECTION CDummyInit::m_destroylock [static]

Definition at line 103 of file cvsgui_process.cpp.

Referenced by CDestroyThreadLock::CDestroyThreadLock, CDummyInit, CDestroyThreadLock::~CDestroyThreadLock, and ~CDummyInit.

CRITICAL_SECTION CDummyInit::m_stacklock [static]

Definition at line 104 of file cvsgui_process.cpp.

Referenced by CDummyInit, CStackThreadLock::CStackThreadLock, ~CDummyInit, and CStackThreadLock::~CStackThreadLock.

The documentation for this class was generated from the following file:
  • common/cvsgui_process.cpp
Generated on Sun Feb 24 01:25:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


DYN_LIST Struct Reference

Collaboration diagram for DYN_LIST:

[legend]
List of all members.

Public Attributes

int | numentries
int | defaultnumcells
int | sizeofcell
int | totpage
void * | first
DYN_LIST * | next
DYN_LIST * | current

Member Data Documentation

struct DYN_LIST* DYN_LIST::current

Definition at line 284 of file dll_garbage.c.

Referenced by listAddCell, and listNew.

int DYN_LIST::defaultnumcells

Definition at line 278 of file dll_garbage.c.

Referenced by listAddCell, and listNew.

void* DYN_LIST::first

Definition at line 282 of file dll_garbage.c.

struct DYN_LIST* DYN_LIST::next

Definition at line 283 of file dll_garbage.c.

Referenced by listAddCell, listFree, and listNew.

int DYN_LIST::numentries

Definition at line 277 of file dll_garbage.c.

Referenced by listAddCell, and listNew.

int DYN_LIST::sizeofcell

Definition at line 279 of file dll_garbage.c.

Referenced by listAddCell, and listNew.

int DYN_LIST::totpage

Definition at line 280 of file dll_garbage.c.

Referenced by listAddCell, and listNew.

The documentation for this struct was generated from the following file:
  • common/dll_garbage.c
Generated on Sun Feb 24 01:25:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CDynToolBar Class Reference

#include <utoolbar.h>

Inheritance diagram for CDynToolBar:

[legend]
Collaboration diagram for CDynToolBar:

[legend]
List of all members.

Public Methods

CDynToolBar ()
virtual | ~CDynToolBar ()
int | GetPseudoID (void) const
void | SetPseudoID (int id)
WININFO * | GetWinInfo (void) const
void | SetWinInfo (WININFO *info)
CFrameWnd * GetMainFrame ()

Public Attributes

HBITMAP | m_bitmap
bool | m_tracking

Protected Methods

virtual void | OnDropDownButton (const NMTOOLBAR &nmtb, UINT nID, CRect rc)
afx_msg void | OnDestroy (void)

Protected Attributes

WININFO * m_info
int | m_widid

Constructor & Destructor Documentation

CDynToolBar::CDynToolBar ( )

Definition at line 376 of file utoolbar.cpp.

00376                          : m_info(0L), m_bitmap(0L),
00377     m_tracking(false), m_widid(0)
00378 {
00379 }

CDynToolBar::~CDynToolBar ( ) [virtual]

Definition at line 381 of file utoolbar.cpp.

00382 {
00383     //if(m_bitmap != 0L)
00384         //::DeleteObject(m_bitmap);
00385 }

Member Function Documentation

CFrameWnd* CDynToolBar::GetMainFrame ( ) [inline]

Definition at line 62 of file utoolbar.h.

Referenced by UToolbar::OnTbInit.

00062 { return GetRoutingFrame(); }

int CDynToolBar::GetPseudoID ( void ) const [inline]

Definition at line 58 of file utoolbar.h.

References m_widid.

Referenced by OnDestroy.

00058 { return m_widid; }

WININFO* CDynToolBar::GetWinInfo ( void ) const [inline]

Definition at line 60 of file utoolbar.h.

References m_info.

00060 { return m_info; }

void CDynToolBar::OnDestroy ( void ) [protected]

Reimplemented from CCJToolBar.

Definition at line 387 of file utoolbar.cpp.

References EV_DESTROY, GetPseudoID, NULL, CCJToolBar::OnDestroy, and UEventSendMessage.

00388 {
00389     UEventSendMessage(GetPseudoID(), EV_DESTROY, 0, NULL);
00390
00391     CCJToolBar::OnDestroy();
00392 }

void CDynToolBar::OnDropDownButton | ( | const NMTOOLBAR & | nmtb,
 |  | UINT | nID,
 |  | CRect | rc
 | ) | [protected, virtual]

Reimplemented from CCJToolBar.

Definition at line 394 of file utoolbar.cpp.

References CColorMenu::AppendColorMenuItem, WININFO::entries, WININFO::height, TbEntryDropDown::icons, TbEntry::kind, m_info, m_tracking, WININFO::Search, tbeDropDown, UCMD_to_WINCMD, WININFO::width, and WINCMD_to_UCMD.

00395 {
00396     std::vector<TbEntry *>::iterator f = m_info->Search(WINCMD_to_UCMD(nID));
00397     if(f == m_info->entries.end())
00398     {
00399         TRACE("Unknown id");
00400         return;
00401     }
00402
00403     TbEntryDropDown *entry = (TbEntryDropDown *)(*f);
00404     if(entry->kind != tbeDropDown)
00405     {
00406         TRACE("Unknown kind");
00407         return;
00408     }
00409
00410     CColorMenu menu(m_info->width, m_info->height);
00411     std::vector<awidget>::iterator i;
00412     for(i = entry->icons.begin(); i != entry->icons.end(); ++i)
00413     {
00414         menu.AppendColorMenuItem(UCMD_to_WINCMD((*i).cmd), i);
00415     }
00416
00417     m_tracking = true;
00418     menu.TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_VERTICAL,
00419         rc.left, rc.bottom, GetOwner(), &rc);
00420     m_tracking = false;
00421 }

void CDynToolBar::SetPseudoID ( int id ) [inline]

Definition at line 59 of file utoolbar.h.

References m_widid.

Referenced by UToolbar::OnTbInit.

00059 { m_widid = id; }

void CDynToolBar::SetWinInfo ( WININFO * info ) [inline]

Definition at line 61 of file utoolbar.h.

References m_info.

Referenced by UToolbar::OnTbInit.

00061 { m_info = info; }

Member Data Documentation

HBITMAP CDynToolBar::m_bitmap

Definition at line 55 of file utoolbar.h.

Referenced by UToolbar::RebuildBar.

WININFO* CDynToolBar::m_info [protected]

Definition at line 66 of file utoolbar.h.

Referenced by GetWinInfo, OnDropDownButton, and SetWinInfo.

bool CDynToolBar::m_tracking

Definition at line 56 of file utoolbar.h.

Referenced by OnDropDownButton.

int CDynToolBar::m_widid [protected]

Definition at line 67 of file utoolbar.h.

Referenced by GetPseudoID, and SetPseudoID.

The documentation for this class was generated from the following files:
  • rf/utoolbar.h
  • rf/utoolbar.cpp
Generated on Sun Feb 24 01:25:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CEdit Class Reference

Inheritance diagram for CEdit:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJBrowseEdit.h
Generated on Sun Feb 24 01:25:50 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UEditMessage Class Reference

Inheritance diagram for UEditMessage:

[legend]
Collaboration diagram for UEditMessage:

[legend]
List of all members.

Public Types

enum {
kOK = EV_COMMAND_START,
kCancel,
kMsg,
kEdit
}

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UEditMessage (const char *msg, const char *edit, const char *title, const char *def, const char *cncl)
virtual | ~UEditMessage ()
virtual void | DoDataExchange (bool fill)
while modaling, allows to fill/read the dialog content.
  • fill says if it expects to fill or read the dialog content.
 More...

Static Public Methods

const URuntimeClass * | rtUEditMessage (void)

Public Attributes

UStr m_edit

Protected Methods

virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Static Protected Attributes

const URuntimeClass | classUEditMessage
const UMSGMAP | messageMap = { UPromptMessage ::GetThisMessageMap(), & UEditMessage ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Member Enumeration Documentation

anonymous enum

Enumeration values:
kOK
kCancel
kMsg
kEdit

Definition at line 206 of file AskYesNo.cpp.

00207     {
00208         kOK = EV_COMMAND_START, // 0
00209         kCancel,                // 1
00210         kMsg,                   // 2
00211         kEdit                   // 3
00212     };

Constructor & Destructor Documentation

UEditMessage::UEditMessage | ( | const char * | msg,
 |  | const char * | edit,
 |  | const char * | title,
 |  | const char * | def,
 |  | const char * | cncl
 | ) | [inline]

Definition at line 199 of file AskYesNo.cpp.

References m_edit.

00200                           : m_edit(edit), UPromptMessage(msg, title, def, cncl)
00201     {
00202     }

virtual UEditMessage::~UEditMessage ( ) [inline, virtual]

Definition at line 204 of file AskYesNo.cpp.

00204 {}

Member Function Documentation

const URuntimeClass * UEditMessage::_GetBaseClass ( ) [static, protected]

Reimplemented from UPromptMessage.

Definition at line 235 of file AskYesNo.cpp.

00241 {

virtual void UEditMessage::DoDataExchange ( bool fill ) [inline, virtual]

while modaling, allows to fill/read the dialog content.

  • fill says if it expects to fill or read the dialog content.

Reimplemented from UPromptMessage.

Definition at line 214 of file AskYesNo.cpp.

References UStr::c_str, UPromptMessage::DoDataExchange, EV_GETTEXT, EV_SETTEXT, UCmdTarget::GetWidID, kEdit, m_edit, and UEventSendMessage.

00215     {
00216         UPromptMessage::DoDataExchange(fill);
00217
00218         if(fill)
00219         {
00220             UEventSendMessage(GetWidID(), EV_SETTEXT, kEdit, (void *)m_edit.c_str());
00221         }
00222         else
00223         {
00224             UEventSendMessage(GetWidID(), EV_GETTEXT, kEdit, &m_edit);
00225         }
00226     }

const UMSGMAP * UEditMessage::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UPromptMessage.

Definition at line 237 of file AskYesNo.cpp.

00241 {

const UMSGMAP * UEditMessage::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UPromptMessage.

Definition at line 237 of file AskYesNo.cpp.

00241 {

const URuntimeClass * UEditMessage::GetRuntimeClass ( ) const [virtual]

Reimplemented from UPromptMessage.

Definition at line 235 of file AskYesNo.cpp.

00241 {

const UMSGMAP * UEditMessage::GetThisMessageMap ( ) [static, protected]

Reimplemented from UPromptMessage.

Definition at line 237 of file AskYesNo.cpp.

00241 {

const URuntimeClass * UEditMessage::rtUEditMessage ( void ) [static]

Definition at line 235 of file AskYesNo.cpp.

00241 {

Member Data Documentation

const UMSGMAP_ENTRY UEditMessage::_messageEntries [static, private]

Initial value:

   {
{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }   }

Reimplemented from UPromptMessage.

Definition at line 237 of file AskYesNo.cpp.

const URuntimeClass UEditMessage::classUEditMessage [static, protected]

UStr UEditMessage::m_edit

Definition at line 228 of file AskYesNo.cpp.

Referenced by DoDataExchange, and UEditMessage.

const UMSGMAP UEditMessage::messageMap = { UPromptMessage ::GetThisMessageMap(), & UEditMessage ::_messageEntries[0] } [static, protected]

Reimplemented from UPromptMessage.

Definition at line 237 of file AskYesNo.cpp.

The documentation for this class was generated from the following file:
  • common/AskYesNo.cpp
Generated on Sun Feb 24 01:25:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CEditorMonDlg Class Reference

#include <EditorMonDlg.h>

Inheritance diagram for CEditorMonDlg:

[legend]
Collaboration diagram for CEditorMonDlg:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_EDITORMON }

Public Methods

CEditorMonDlg (CWnd *pParent=NULL)

Public Attributes

CString | m_tempFile
HANDLE | m_hProcess

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnDestroy ()
virtual BOOL | OnInitDialog ()
afx_msg void | OnTimer (UINT nIDEvent)

Private Attributes

UINT | m_timer

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 50 of file EditorMonDlg.h.

00050 { IDD = IDD_EDITORMON };

Constructor & Destructor Documentation

CEditorMonDlg::CEditorMonDlg ( CWnd * pParent = NULL )

Definition at line 45 of file EditorMonDlg.cpp.

References m_tempFile.

00046     : CDialog(CEditorMonDlg::IDD, pParent)
00047 {
00048     //{{AFX_DATA_INIT(CEditorMonDlg)
00049     m_tempFile = _T("");
00050     //}}AFX_DATA_INIT
00051 }

Member Function Documentation

void CEditorMonDlg::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 54 of file EditorMonDlg.cpp.

References IDC_TEMPFILE, and m_tempFile.

00055 {
00056     CDialog::DoDataExchange(pDX);
00057     //{{AFX_DATA_MAP(CEditorMonDlg)
00058     DDX_Text(pDX, IDC_TEMPFILE, m_tempFile);
00059     //}}AFX_DATA_MAP
00060 }

void CEditorMonDlg::OnDestroy ( ) [protected]

Definition at line 73 of file EditorMonDlg.cpp.

References m_timer.

00074 {
00075     if( m_timer )
00076     {
00077         KillTimer(m_timer);
00078     }
00079
00080     CDialog::OnDestroy();
00081 }

BOOL CEditorMonDlg::OnInitDialog ( ) [protected, virtual]

Definition at line 83 of file EditorMonDlg.cpp.

References m_timer, NULL, and TRUE.

00084 {
00085     CDialog::OnInitDialog();
00086
00087     // Extra initialization here
00088     m_timer = SetTimer(2048, 200, NULL);
00089
00090     return TRUE;  // return TRUE unless you set the focus to a control
00091                   // EXCEPTION: OCX Property Pages should return FALSE
00092 }

void CEditorMonDlg::OnTimer ( UINT nIDEvent ) [protected]

Definition at line 94 of file EditorMonDlg.cpp.

References m_hProcess, and m_timer.

00095 {
00096     if( nIDEvent == m_timer && INVALID_HANDLE_VALUE != m_hProcess )
00097     {
00098         int status = WaitForSingleObject( m_hProcess, 0 );
00099         if( status == WAIT_OBJECT_0 )   //have been terminated...
00100         {
00101             EndDialog(IDOK);
00102         }
00103     }
00104
00105     CDialog::OnTimer(nIDEvent);
00106 }

Member Data Documentation

HANDLE CEditorMonDlg::m_hProcess

Definition at line 73 of file EditorMonDlg.h.

Referenced by CompatGetEditorMsg, and OnTimer.

CString CEditorMonDlg::m_tempFile

Definition at line 51 of file EditorMonDlg.h.

Referenced by CEditorMonDlg, CompatGetEditorMsg, and DoDataExchange.

UINT CEditorMonDlg::m_timer [private]

Definition at line 75 of file EditorMonDlg.h.

Referenced by OnDestroy, OnInitDialog, and OnTimer.

The documentation for this class was generated from the following files:
  • common/EditorMonDlg.h
  • common/EditorMonDlg.cpp
Generated on Sun Feb 24 01:25:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ENTNODE Class Reference

#include <CvsEntries.h>

Collaboration diagram for ENTNODE:

[legend]
List of all members.

Public Methods

ENTNODE ()
ENTNODE (EntnodeData *data)
ENTNODE (EntnodeData &data)
ENTNODE (const ENTNODE &anode)
~ENTNODE ()
ENTNODE & | operator= (const ENTNODE &anode)
EntnodeData * | Data () const
operator EntnodeData * () const

Static Public Methods

int | Compare (const ENTNODE &node1, const ENTNODE &node2)

Protected Attributes

EntnodeData * shareData

Constructor & Destructor Documentation

ENTNODE::ENTNODE ( ) [inline]

Definition at line 277 of file CvsEntries.h.

References shareData.

00277 : shareData(0L) {}

ENTNODE::ENTNODE ( EntnodeData * data ) [inline]

Definition at line 278 of file CvsEntries.h.

References shareData.

00278 : shareData(data->Ref()) {}

ENTNODE::ENTNODE ( EntnodeData & data ) [inline]

Definition at line 279 of file CvsEntries.h.

References shareData.

00279 : shareData(data.Ref()) {}

ENTNODE::ENTNODE ( const ENTNODE & anode ) [inline]

Definition at line 280 of file CvsEntries.h.

References shareData.

00280                                    : shareData(0L)
00281     {
00282         *this = anode;
00283     }

ENTNODE::~ENTNODE ( ) [inline]

Definition at line 284 of file CvsEntries.h.

References shareData, and EntnodeData::UnRef.

00285     {
00286         if(shareData != 0L)
00287             shareData->UnRef();
00288     }

Member Function Documentation

int ENTNODE::Compare | ( | const ENTNODE & | node1,
 |  | const ENTNODE & | node2
 | ) | [inline, static]

Definition at line 290 of file CvsEntries.h.

References EntnodeData::Compare, and shareData.

Referenced by cvsgui_GetCvsEntries, CWinCvsBrowser::OnItemexpanding, UCvsFolders::OnTreeExpanding, CHistComboBoxEx::SetIcon, CGraphDoc::SetNode, tclCvsEntriesProc, and UCvsGraph::UCvsGraph.

00291     {
00292         return EntnodeData::Compare(*node1.shareData, *node2.shareData);
00293     }

EntnodeData* ENTNODE::Data ( ) const [inline]

Definition at line 310 of file CvsEntries.h.

References shareData.

Referenced by cvsgui_GetCvsEntries, Entries_SetMissing, Entries_SetVisited, TViewFill::ExitDirectory, CTCLBrowserEnt::GetData, CTCLBrowserEnt::GetNormalized, CTCLBrowserEnt::IsSamePath, CWinCvsBrowser::OnItemexpanding, and tclCvsEntriesProc.

00310 { return shareData; }

ENTNODE::operator EntnodeData * ( ) const [inline]

Definition at line 311 of file CvsEntries.h.

References shareData.

00311 { return shareData; }

ENTNODE& ENTNODE::operator= ( const ENTNODE & anode ) [inline]

Definition at line 295 of file CvsEntries.h.

References EntnodeData::Ref, shareData, and EntnodeData::UnRef.

00296     {
00297         EntnodeData* oldData = shareData;
00298         shareData = anode.shareData;
00299         if(shareData != 0L)
00300         {
00301             shareData->Ref();
00302         }
00303         if(oldData != 0L)
00304         {
00305             oldData->UnRef();
00306         }
00307         return *this;
00308     }

Member Data Documentation

EntnodeData* ENTNODE::shareData [protected]

Definition at line 314 of file CvsEntries.h.

Referenced by Compare, Data, ENTNODE, operator EntnodeData *, operator=, and ~ENTNODE.

The documentation for this class was generated from the following file:
  • common/CvsEntries.h
Generated on Sun Feb 24 01:25:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


EntnodeData Class Reference

#include <CvsEntries.h>

Inheritance diagram for EntnodeData:

[legend]
Collaboration diagram for EntnodeData:

[legend]
List of all members.

Public Types

enum {
kName = 0,
kStatus = 3,
kPath = 7
}

Public Methods

virtual ent_type | GetType (void) const=0
EntnodeData * | Ref (void)
EntnodeData * | UnRef (void)
virtual const char * | operator[] (int index) const
void | SetMissing (bool state)
bool | IsMissing (void) const
void | SetVisited (bool state)
bool | IsVisited (void) const
void | SetUnknown (bool state)
bool | IsUnknown (void) const
void | SetIgnored (bool state)
bool | IsIgnored (void) const
void | SetLocked (bool state)
bool | IsLocked (void) const
void | SetRemoved (bool state)
bool | IsRemoved (void) const
void | SetDesc (const char *newdesc)
const char * | GetDesc (void) const
const char * | GetName (void) const
const char * | GetFullPathName (UStr &resPath) const
const char * | GetFolderPath (void) const
virtual const char * | GetConflict () const
void | SetUnmodified (bool state)
bool | IsUnmodified (void) const

Static Public Methods

int | Compare (const EntnodeData &node1, const EntnodeData &node2)

Protected Methods

EntnodeData (const char *name, EntnodePath *path)
virtual | ~EntnodeData ()

Protected Attributes

int | ref
int | missing: 1
int | visited: 1
int | unknown: 1
int | unmodified: 1
int | ignored: 1
int | locked: 1
int | removed: 1

Private Attributes

const char * | user
const char * | desc
EntnodePath * fullpathname

Static Private Attributes

UStr sbuffer

Member Enumeration Documentation

anonymous enum

Enumeration values:
kName
kStatus
kPath

Definition at line 80 of file CvsEntries.h.

00081     {
00082         kName = 0,
00083         kStatus = 3,
00084         kPath = 7
00085     };

Constructor & Destructor Documentation

EntnodeData::EntnodeData | ( | const char * | name,
 |  | EntnodePath * | path
 | ) | [protected]

Definition at line 110 of file CvsEntries.cpp.

References cloneStr, fullpathname, EntnodePath::Ref, unmodified, and user.

00111     : ref(1), missing(false), visited(false), unknown(false),
00112       unmodified(true), ignored(false), locked(false), removed(false),
00113       user(0L), desc(0L), fullpathname(0L)
00114 {
00115 #if TARGET_RT_MAC_CFM
00116     macspec.vRefNum = 0;
00117     macspec.parID = 0;
00118     macspec.name[0] = '\0';
00119 #endif
00120 #if TARGET_RT_MAC_MACHO
00121     memset(&macspec, 0, sizeof(macspec));
00122 #endif
00123     user = cloneStr(name);
00124     fullpathname = path->Ref();
00125 }

EntnodeData::~EntnodeData ( ) [protected, virtual]

Definition at line 127 of file CvsEntries.cpp.

References disposeStr, fullpathname, EntnodePath::UnRef, and user.

00128 {
00129     disposeStr(user);
00130     if(fullpathname)
00131         fullpathname->UnRef();
00132 }

Member Function Documentation

int EntnodeData::Compare | ( | const EntnodeData & | node1,
 |  | const EntnodeData & | node2
 | ) | [inline, static]

Definition at line 88 of file CvsEntries.h.

References stricmp, and user.

Referenced by ENTNODE::Compare.

00089     {
00090 #ifdef WIN32
00091         return stricmp(node1.user, node2.user);
00092 #else /* !WIN32 */
00093         return strcmp(node1.user, node2.user);
00094 #endif /* !WIN32 */
00095     }

virtual const char* EntnodeData::GetConflict ( ) const [inline, virtual]

Reimplemented in EntnodeFile.

Definition at line 152 of file CvsEntries.h.

Referenced by KoConflictColumn::Compare, Entries_SetVisited, PyCvsEntry::GetAttr, CBrowseFileView::GetImageForEntry, KoConflictColumn::GetText, and KoFilterModel::IsMatch.

00153     {
00154         return 0L;
00155     }

const char* EntnodeData::GetDesc ( void ) const [inline]

Definition at line 131 of file CvsEntries.h.

References desc.

Referenced by PyCvsEntry::GetAttr, TViewFill::OnDirectory, TViewFill::OnFile, UCvsFiles::ResetView, and tclCvsBrowserProc.

00131 {return desc;}

const char* EntnodeData::GetFolderPath ( void ) const [inline]

Definition at line 146 of file CvsEntries.h.

References fullpathname, and EntnodePath::GetFolderPath.

00147     {
00148         return fullpathname->GetFolderPath();
00149     }

const char* EntnodeData::GetFullPathName ( UStr & resPath ) const [inline]

Definition at line 140 of file CvsEntries.h.

References fullpathname, EntnodePath::GetFullPathName, and user.

Referenced by CBrowseFileView::DoDrag, CBrowseFileView::EditSel, PyCvsEntry::GetAttr, CTCLBrowserEnt::GetNormalized, KoPathColumn::GetText, CTCLBrowserEnt::IsSamePath, CBrowseFileView::OnKeydown, CBrowseFileView::OnViewExplore, operator[], CBrowseFileView::ProcessSelectionCommand, and CBrowseFileView::ResetView.

00141     {
00142         return fullpathname->GetFullPathName(resPath, user);
00143     }

const char* EntnodeData::GetName ( void ) const [inline]

Definition at line 134 of file CvsEntries.h.

References user.

Referenced by KoNameColumn::Compare, PyCvsEntry::GetAttr, KoPathColumn::GetText, KoNameColumn::GetText, and KoFilterModel::IsMatch.

00135     {
00136         return user;
00137     }

virtual ent_type EntnodeData::GetType ( void ) const [pure virtual]

Implemented in EntnodeFile.

Referenced by _Compare, CBrowseFileView::DoDrag, CBrowseFileView::EditSel, UCvsFiles::EditSel, TViewFill::ExitDirectory, PyCvsEntry::GetAttr, CBrowseFileView::GetImageForEntry, UCvsFiles::GetImageForEntry, UCvsFiles::OnCmdAdd, UCvsFiles::OnCmdAddb, UCvsFiles::OnCmdCommit, UCvsFiles::OnCmdDiff, UCvsFiles::OnCmdEdit, UCvsFiles::OnCmdEditors, UCvsFiles::OnCmdGraph, UCvsFiles::OnCmdLock, UCvsFiles::OnCmdLog, UCvsFiles::OnCmdQueryUpdate, UCvsFiles::OnCmdRelease, UCvsFiles::OnCmdRmv, UCvsFiles::OnCmdStatus, UCvsFiles::OnCmdTagBranch, UCvsFiles::OnCmdTagDelete, UCvsFiles::OnCmdTagNew, UCvsFiles::OnCmdTrash, UCvsFiles::OnCmdUIAdd, UCvsFiles::OnCmdUIAddB, UCvsFiles::OnCmdUIEditseldef, UCvsFiles::OnCmdUIGraph, UCvsFiles::OnCmdUIRelease, UCvsFiles::OnCmdUIRmv, UCvsFiles::OnCmdUITrash, UCvsFiles::OnCmdUIUpdate, UCvsFiles::OnCmdUnedit, UCvsFiles::OnCmdUnlock, UCvsFiles::OnCmdUpdate, UCvsFiles::OnCmdWatchers, UCvsFiles::OnCmdWatchOff, UCvsFiles::OnCmdWatchOn, CBrowseFileView::OnEditSelectAll, CWinCvsBrowser::OnItemexpanding, CBrowseFileView::OnKeydown, UCvsFolders::OnTreeExpanding, CBrowseFileView::OnUpdateQueryAnnotate, CBrowseFileView::OnUpdateViewAdd, CBrowseFileView::OnUpdateViewAddB, CBrowseFileView::OnUpdateViewEditseldef, CBrowseFileView::OnUpdateViewGraph, CBrowseFileView::OnUpdateViewRelease, CBrowseFileView::OnUpdateViewRmv, CBrowseFileView::OnUpdateViewUpdate, CBrowseFileView::OnViewExplore, CBrowseFileView::ProcessSelectionCommand, CBrowseFileView::ResetView, and tclCvsBrowserProc.

bool EntnodeData::IsIgnored ( void ) const [inline]

Definition at line 125 of file CvsEntries.h.

References ignored.

Referenced by Entries_SetVisited, PyCvsEntry::GetAttr, GetIcon, CBrowseFileView::GetImageForEntry, UCvsFiles::GetImageForEntry, TBrowserFill::OnDirectory, TViewFill::OnDirectory, TViewFill::OnFile, CHistComboBoxEx::SetIcon, and tclCvsBrowserProc.

00125 {return 0 != ignored;}

bool EntnodeData::IsLocked ( void ) const [inline]

Definition at line 127 of file CvsEntries.h.

References locked.

Referenced by PyCvsEntry::GetAttr, TViewFill::OnFile, and tclCvsBrowserProc.

00127 {return 0 != locked;}

bool EntnodeData::IsMissing ( void ) const [inline]

Definition at line 119 of file CvsEntries.h.

References missing.

Referenced by TViewFill::ExitDirectory, PyCvsEntry::GetAttr, GetIcon, UCvsFiles::GetImageForEntry, KoFilterModel::IsMatch, UCvsFiles::OnCmdUIAdd, UCvsFiles::OnCmdUIAddB, UCvsFiles::OnCmdUIEditseldef, UCvsFiles::OnCmdUIExplore, UCvsFiles::OnCmdUITrash, TViewFill::OnDirectory, CWinCvsBrowser::OnItemexpanding, CWinCvsBrowser::OnSelchanging, UCvsFolders::OnTreeExpanding, UCvsFolders::OnTreeSelecting, CBrowseFileView::OnUpdateViewAdd, CBrowseFileView::OnUpdateViewAddB, CBrowseFileView::OnUpdateViewEditseldef, CBrowseFileView::OnUpdateViewExplore, UCvsFiles::ResetView, CHistComboBoxEx::SetIcon, and tclCvsBrowserProc.

00119 {return 0 != missing;}

bool EntnodeData::IsRemoved ( void ) const [inline]

Definition at line 129 of file CvsEntries.h.

References removed.

Referenced by Entries_SetMissing, TViewFill::ExitDirectory, PyCvsEntry::GetAttr, CBrowseFileView::GetImageForEntry, UCvsFiles::GetImageForEntry, KoFilterModel::IsMatch, UCvsFiles::OnCmdUIAdd, UCvsFiles::OnCmdUIAddB, UCvsFiles::OnCmdUIRmv, CBrowseFileView::OnUpdateViewAdd, CBrowseFileView::OnUpdateViewAddB, and CBrowseFileView::OnUpdateViewRmv.

00129 {return 0 != removed;}

bool EntnodeData::IsUnknown ( void ) const [inline]

Definition at line 123 of file CvsEntries.h.

References unknown.

Referenced by Entries_SetVisited, PyCvsEntry::GetAttr, GetIcon, CBrowseFileView::GetImageForEntry, UCvsFiles::GetImageForEntry, KoFilterModel::IsMatch, UCvsFiles::OnCmdUIAdd, UCvsFiles::OnCmdUIAddB, UCvsFiles::OnCmdUIGraph, UCvsFiles::OnCmdUIRelease, UCvsFiles::OnCmdUIRmv, UCvsFiles::OnCmdUIUpdate, TViewFill::OnDirectory, CBrowseFileView::OnUpdateQueryAnnotate, CBrowseFileView::OnUpdateViewAdd, CBrowseFileView::OnUpdateViewAddB, CBrowseFileView::OnUpdateViewGraph, CBrowseFileView::OnUpdateViewRelease, CBrowseFileView::OnUpdateViewRmv, CBrowseFileView::OnUpdateViewUpdate, CHistComboBoxEx::SetIcon, and tclCvsBrowserProc.

00123 {return 0 != unknown;}

bool EntnodeData::IsUnmodified ( void ) const [inline]

Definition at line 158 of file CvsEntries.h.

References unmodified.

Referenced by Entries_SetVisited, PyCvsEntry::GetAttr, CBrowseFileView::GetImageForEntry, UCvsFiles::GetImageForEntry, KoFilterModel::IsMatch, and tclCvsBrowserProc.

00158 {return 0 != unmodified;}

bool EntnodeData::IsVisited ( void ) const [inline]

Definition at line 121 of file CvsEntries.h.

References visited.

Referenced by Entries_SetMissing.

00121 {return 0 != visited;}

virtual const char* EntnodeData::operator[] ( int index ) const [inline, virtual]

Reimplemented in EntnodeFile.

Definition at line 107 of file CvsEntries.h.

References desc, GetFullPathName, kName, kPath, kStatus, sbuffer, and user.

Referenced by EntnodeFolder::operator[], and EntnodeFile::operator[].

00108     {
00109         if(index == kName)
00110             return user;
00111         else if(index == kStatus)
00112             return desc;
00113         else if(index == kPath)
00114             return GetFullPathName(sbuffer);
00115         return 0L;
00116     }

EntnodeData* EntnodeData::Ref ( void ) [inline]

Definition at line 96 of file CvsEntries.h.

References ref.

Referenced by TBrowserFillDummy::EnterDirectory, TBrowserFillDummy::ExitDirectory, TViewFill::InitItem, CWinCvsBrowser::OnItemexpanding, UCvsFolders::OnTreeExpanding, ENTNODE::operator=, CGraphDoc::SetNode, and UCvsGraph::UCvsGraph.

00096 {++ref; return this;}

void EntnodeData::SetDesc ( const char * newdesc )

Definition at line 134 of file CvsEntries.cpp.

References desc.

Referenced by Entries_SetMissing, and Entries_SetVisited.

00135 {
00136     desc = newdesc;
00137 }

void EntnodeData::SetIgnored ( bool state ) [inline]

Definition at line 124 of file CvsEntries.h.

References ignored.

Referenced by Entries_SetVisited.

00124 {ignored = state;}

void EntnodeData::SetLocked ( bool state ) [inline]

Definition at line 126 of file CvsEntries.h.

References locked.

Referenced by Entries_SetVisited.

00126 {locked = state;}

void EntnodeData::SetMissing ( bool state ) [inline]

Definition at line 118 of file CvsEntries.h.

References missing.

Referenced by Entries_SetMissing.

00118 {missing = state;}

void EntnodeData::SetRemoved ( bool state ) [inline]

Definition at line 128 of file CvsEntries.h.

References removed.

Referenced by EntnodeFile::EntnodeFile.

00128 {removed = state;}

void EntnodeData::SetUnknown ( bool state ) [inline]

Definition at line 122 of file CvsEntries.h.

References unknown.

Referenced by Entries_SetVisited.

00122 {unknown = state;}

void EntnodeData::SetUnmodified ( bool state ) [inline]

Definition at line 157 of file CvsEntries.h.

References unmodified.

Referenced by Entries_SetVisited.

00157 {unmodified = state;}

void EntnodeData::SetVisited ( bool state ) [inline]

Definition at line 120 of file CvsEntries.h.

References visited.

Referenced by Entries_SetVisited.

00120 {visited = state;}

EntnodeData* EntnodeData::UnRef ( void ) [inline]

Definition at line 97 of file CvsEntries.h.

References ref.

Referenced by CWinCvsBrowser::DeleteAllItems, UCvsFolders::DeleteAllItems, TBrowserFillDummy::EnterDirectory, Entries_Open, Entries_SetVisited, TBrowserFillDummy::ExitDirectory, UCvsFolders::OnCmdMacrosSel, CBrowseFileView::OnDeleteitem, CWinCvsBrowser::OnUpdateMacro, ENTNODE::operator=, CGraphDoc::PrepareNew, ENTNODE::~ENTNODE, and UCvsGraph::~UCvsGraph.

00098     {
00099         if(--ref == 0)
00100         {
00101             delete this;
00102             return 0L;
00103         }
00104         return this;
00105     }

Member Data Documentation

const char* EntnodeData::desc [private]

Definition at line 178 of file CvsEntries.h.

Referenced by GetDesc, operator[], and SetDesc.

EntnodePath* EntnodeData::fullpathname [private]

Definition at line 179 of file CvsEntries.h.

Referenced by EntnodeData, GetFolderPath, GetFullPathName, and ~EntnodeData.

int EntnodeData::ignored [protected]

Definition at line 170 of file CvsEntries.h.

Referenced by IsIgnored, and SetIgnored.

int EntnodeData::locked [protected]

Definition at line 171 of file CvsEntries.h.

Referenced by IsLocked, and SetLocked.

int EntnodeData::missing [protected]

Definition at line 166 of file CvsEntries.h.

Referenced by IsMissing, and SetMissing.

int EntnodeData::ref [protected]

Definition at line 165 of file CvsEntries.h.

Referenced by Ref, and UnRef.

int EntnodeData::removed [protected]

Definition at line 172 of file CvsEntries.h.

Referenced by IsRemoved, and SetRemoved.

UStr EntnodeData::sbuffer [static, private]

Definition at line 139 of file CvsEntries.cpp.

Referenced by operator[].

int EntnodeData::unknown [protected]

Definition at line 168 of file CvsEntries.h.

Referenced by IsUnknown, and SetUnknown.

int EntnodeData::unmodified [protected]

Definition at line 169 of file CvsEntries.h.

Referenced by IsUnmodified, and SetUnmodified.

const char* EntnodeData::user [private]

Definition at line 177 of file CvsEntries.h.

Referenced by Compare, EntnodeData, GetFullPathName, GetName, operator[], and ~EntnodeData.

int EntnodeData::visited [protected]

Definition at line 167 of file CvsEntries.h.

Referenced by IsVisited, and SetVisited.

The documentation for this class was generated from the following files:
  • common/CvsEntries.h
  • common/CvsEntries.cpp
Generated on Sun Feb 24 01:25:53 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


EntnodeFile Class Reference

#include <CvsEntries.h>

Inheritance diagram for EntnodeFile:

[legend]
Collaboration diagram for EntnodeFile:

[legend]
List of all members.

Public Types

enum {
kVN = 1,
kTS = 5,
kOption = 2,
kTag = 4,
kConflict = 6
}

Public Methods

EntnodeFile (const char *name, EntnodePath *path, const char *newvn=0L, const char *newts=0L, const char *newoptions=0L, const char *newtag=0L, const char *newdate=0L, const char *newts_conflict=0L)
virtual const char * | operator[] (int index) const
virtual ent_type | GetType (void) const
virtual const char * | GetConflict () const

Protected Methods

virtual | ~EntnodeFile ()

Protected Attributes

const char * | vn
const char * | ts
const char * | option
const char * | tag
const char * | date
const char * | ts_conflict

Member Enumeration Documentation

anonymous enum

Enumeration values:
kVN
kTS
kOption
kTag
kConflict

Definition at line 198 of file CvsEntries.h.

00199     {
00200         kVN = 1,
00201         kTS = 5,
00202         kOption = 2,
00203         kTag = 4,
00204         kConflict = 6
00205     };

Constructor & Destructor Documentation

EntnodeFile::EntnodeFile | ( | const char * | name,
 |  | EntnodePath * | path,
 |  | const char * | newvn = 0L,
 |  | const char * | newts = 0L,
 |  | const char * | newoptions = 0L,
 |  | const char * | newtag = 0L,
 |  | const char * | newdate = 0L,
 |  | const char * | newts_conflict = 0L
 | ) |

Definition at line 151 of file CvsEntries.cpp.

References cloneStr, date, EntnodeData::SetRemoved, tag, ts, ts_conflict, and vn.

00153                                                      : EntnodeData(name, path)
00154 {
00155     vn = 0L;
00156     ts = 0L;
00157     option = 0L;
00158     tag = 0L;
00159     date = 0L;
00160     ts_conflict = 0L;
00161
00162     vn = cloneStr(newvn);
00163     ts = cloneStr(newts);
00164     option = cloneStr(newoptions);
00165     tag = cloneStr(newtag);
00166     date = cloneStr(newdate);
00167     ts_conflict = cloneStr(newts_conflict);
00168
00169     if(newvn != 0L && newvn[0] == '-')
00170         SetRemoved(true);
00171 }

EntnodeFile::~EntnodeFile ( ) [protected, virtual]

Definition at line 141 of file CvsEntries.cpp.

References date, disposeStr, tag, ts, ts_conflict, and vn.

00142 {
00143     disposeStr(vn);
00144     disposeStr(ts);
00145     disposeStr(option);
00146     disposeStr(tag);
00147     disposeStr(date);
00148     disposeStr(ts_conflict);
00149 }

Member Function Documentation

virtual const char* EntnodeFile::GetConflict ( ) const [inline, virtual]

Reimplemented from EntnodeData.

Definition at line 230 of file CvsEntries.h.

References ts_conflict.

00231     {
00232         return ts_conflict;
00233     }

virtual ent_type EntnodeFile::GetType ( void ) const [inline, virtual]

Implements EntnodeData.

Definition at line 224 of file CvsEntries.h.

References ENT_FILE, and ent_type.

00225     {
00226         return ENT_FILE;
00227     }

virtual const char* EntnodeFile::operator[] ( int index ) const [inline, virtual]

Reimplemented from EntnodeData.

Definition at line 208 of file CvsEntries.h.

References date, kConflict, kOption, kTag, kTS, kVN, EntnodeData::operator[], tag, ts, ts_conflict, and vn.

00209     {
00210         if(index == kVN)
00211             return vn;
00212         else if(index == kTS)
00213             return ts;
00214         else if(index == kOption)
00215             return option;
00216         else if(index == kTag)
00217             return tag != 0L ? tag : date;
00218         else if(index == kConflict)
00219             return ts_conflict;
00220
00221         return EntnodeData::operator[](index);
00222     }

Member Data Documentation

const char* EntnodeFile::date [protected]

Definition at line 240 of file CvsEntries.h.

Referenced by EntnodeFile, operator[], and ~EntnodeFile.

const char* EntnodeFile::option [protected]

Definition at line 238 of file CvsEntries.h.

const char* EntnodeFile::tag [protected]

Definition at line 239 of file CvsEntries.h.

Referenced by EntnodeFile, operator[], and ~EntnodeFile.

const char* EntnodeFile::ts [protected]

Definition at line 237 of file CvsEntries.h.

Referenced by EntnodeFile, operator[], and ~EntnodeFile.

const char* EntnodeFile::ts_conflict [protected]

Definition at line 241 of file CvsEntries.h.

Referenced by EntnodeFile, GetConflict, operator[], and ~EntnodeFile.

const char* EntnodeFile::vn [protected]

Definition at line 236 of file CvsEntries.h.

Referenced by EntnodeFile, operator[], and ~EntnodeFile.

The documentation for this class was generated from the following files:
  • common/CvsEntries.h
  • common/CvsEntries.cpp
Generated on Sun Feb 24 01:25:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


EntnodeFolder Class Reference

#include <CvsEntries.h>

Inheritance diagram for EntnodeFolder:

[legend]
Collaboration diagram for EntnodeFolder:

[legend]
List of all members.

Public Methods

EntnodeFolder (const char *name, EntnodePath *path, const char *newvn=0L, const char *newts=0L, const char *newoptions=0L, const char *newtag=0L, const char *newdate=0L, const char *newts_conflict=0L)
virtual const char * | operator[] (int index) const
virtual ent_type | GetType (void) const

Protected Methods

virtual | ~EntnodeFolder ()

Constructor & Destructor Documentation

EntnodeFolder::EntnodeFolder | ( | const char * | name,
 |  | EntnodePath * | path,
 |  | const char * | newvn = 0L,
 |  | const char * | newts = 0L,
 |  | const char * | newoptions = 0L,
 |  | const char * | newtag = 0L,
 |  | const char * | newdate = 0L,
 |  | const char * | newts_conflict = 0L
 | ) |

Definition at line 177 of file CvsEntries.cpp.

00179                                                      : EntnodeData(name, path)
00180 {
00181 }

EntnodeFolder::~EntnodeFolder ( ) [protected, virtual]

Definition at line 173 of file CvsEntries.cpp.

00174 {
00175 }

Member Function Documentation

virtual ent_type EntnodeFolder::GetType ( void ) const [inline, virtual]

Implements EntnodeData.

Definition at line 264 of file CvsEntries.h.

References ENT_SUBDIR, and ent_type.

00265     {
00266         return ENT_SUBDIR;
00267     }

virtual const char* EntnodeFolder::operator[] ( int index ) const [inline, virtual]

Reimplemented from EntnodeData.

Definition at line 259 of file CvsEntries.h.

References EntnodeData::operator[].

00260     {
00261         return EntnodeData::operator[](index);
00262     }

The documentation for this class was generated from the following files:
  • common/CvsEntries.h
  • common/CvsEntries.cpp
Generated on Sun Feb 24 01:25:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


EntnodePath Class Reference

#include <CvsEntries.h>

Collaboration diagram for EntnodePath:

[legend]
List of all members.

Public Methods

EntnodePath (const char *path)
EntnodePath * | Ref (void)
EntnodePath * | UnRef (void)
const char * | GetFullPathName (UStr &resPath, const char *name) const
const char * | GetFolderPath (void) const

Protected Methods

~EntnodePath ()

Protected Attributes

const char * | fullpathname
int | ref

Constructor & Destructor Documentation

EntnodePath::~EntnodePath ( ) [protected]

Definition at line 95 of file CvsEntries.cpp.

References disposeStr, and fullpathname.

00096 {
00097     disposeStr(fullpathname);
00098 }

EntnodePath::EntnodePath ( const char * path )

Definition at line 90 of file CvsEntries.cpp.

References cloneStr, and fullpathname.

00090                                          : fullpathname(0L), ref(1)
00091 {
00092     fullpathname = cloneStr(path);
00093 }

Member Function Documentation

const char* EntnodePath::GetFolderPath ( void ) const [inline]

Definition at line 61 of file CvsEntries.h.

References fullpathname.

Referenced by EntnodeData::GetFolderPath.

00061 { return fullpathname; }

const char * EntnodePath::GetFullPathName | ( | UStr & | resPath,
 |  | const char * | name
 | ) | const

Definition at line 100 of file CvsEntries.cpp.

References UStr::endsWith, and fullpathname.

Referenced by EntnodeData::GetFullPathName.

00101 {
00102     resPath = fullpathname;
00103     if(!resPath.endsWith(kPathDelimiter))
00104         resPath << kPathDelimiter;
00105     resPath << name;
00106
00107     return resPath;
00108 }

EntnodePath* EntnodePath::Ref ( void ) [inline]

Definition at line 49 of file CvsEntries.h.

References ref.

Referenced by EntnodeData::EntnodeData.

00049 {++ref; return this;}

EntnodePath* EntnodePath::UnRef ( void ) [inline]

Definition at line 50 of file CvsEntries.h.

References ref.

Referenced by Entries_SetVisited, fgetentent, UCvsFolders::OnCmdMacrosSel, CWinCvsBrowser::OnUpdateMacro, and EntnodeData::~EntnodeData.

00051     {
00052         if(--ref == 0)
00053         {
00054             delete this;
00055             return 0L;
00056         }
00057         return this;
00058     }

Member Data Documentation

const char* EntnodePath::fullpathname [protected]

Definition at line 64 of file CvsEntries.h.

Referenced by EntnodePath, GetFolderPath, GetFullPathName, and ~EntnodePath.

int EntnodePath::ref [protected]

Definition at line 65 of file CvsEntries.h.

Referenced by Ref, and UnRef.

The documentation for this class was generated from the following files:
  • common/CvsEntries.h
  • common/CvsEntries.cpp
Generated on Sun Feb 24 01:25:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CExploreBar Class Reference

#include <ExploreBar.h>

Inheritance diagram for CExploreBar:

[legend]
Collaboration diagram for CExploreBar:

[legend]
List of all members.

Public Methods

virtual BOOL | Create (LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID, CCreateContext *pContext=NULL)

Public Attributes

CMyShellTree m_TreeCtrl

Protected Methods

CExploreBar ()
virtual void | OnDraw (CDC *pDC)
virtual | ~CExploreBar ()
void | OnUpdateCmd (CCmdUI *pCmdUI)
bool | DisableCommon ()
afx_msg void | OnWindowPosChanged (WINDOWPOS FAR *lpwndpos)
afx_msg void | OnViewCheckout ()
afx_msg void | OnUpdateViewCheckout (CCmdUI *pCmdUI)
afx_msg void | OnViewImport ()
afx_msg void | OnUpdateViewImport (CCmdUI *pCmdUI)

Constructor & Destructor Documentation

CExploreBar::CExploreBar ( ) [protected]

Definition at line 106 of file ExploreBar.cpp.

00107 {
00108 }

CExploreBar::~CExploreBar ( ) [protected, virtual]

Definition at line 110 of file ExploreBar.cpp.

00111 {
00112 }

Member Function Documentation

BOOL CExploreBar::Create | ( | LPCTSTR | lpszClassName,
 |  | LPCTSTR | lpszWindowName,
 |  | DWORD | dwStyle,
 |  | const RECT & | rect,
 |  | CWnd * | pParentWnd,
 |  | UINT | nID,
 |  | CCreateContext * | pContext = NULL
 | ) | [virtual]

Definition at line 151 of file ExploreBar.cpp.

References FALSE, IDC_BAR_TREE, and m_TreeCtrl.

00152 {
00153     BOOL res = CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
00154
00155     if(res)
00156     {
00157         if (!m_TreeCtrl.Create(
00158             WS_VISIBLE|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS,
00159             CRect(0,0,0,0), this, IDC_BAR_TREE))
00160         {
00161             TRACE0("Unable to create caption button.\n");
00162             return FALSE;
00163         }
00164     }
00165
00166     //m_TreeCtrl.EnableImages();
00167     //m_TreeCtrl.PopulateTree();
00168
00169     //SetChild(&m_TreeCtrl);
00170
00171     return res;
00172 }

bool CExploreBar::DisableCommon ( ) [protected]

Definition at line 201 of file ExploreBar.cpp.

References CWincvsApp::gCvsRunning.

Referenced by OnUpdateCmd.

00202 {
00203     CWincvsApp *app = (CWincvsApp *)AfxGetApp();
00204     return app->gCvsRunning || gCvsPrefs.empty();
00205 }

void CExploreBar::OnDraw ( CDC * pDC ) [protected, virtual]

Definition at line 128 of file ExploreBar.cpp.

00129 {
00130     CDocument* pDoc = GetDocument();
00131 }

void CExploreBar::OnUpdateCmd ( CCmdUI * pCmdUI ) [protected]

Definition at line 183 of file ExploreBar.cpp.

References DisableCommon, FALSE, m_TreeCtrl, and TRUE.

Referenced by OnUpdateViewCheckout, and OnUpdateViewImport.

00184 {
00185     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00186     if(DisableCommon())
00187     {
00188         pCmdUI->Enable(FALSE);
00189         return;
00190     }
00191     CString folderPath;
00192     if(!m_TreeCtrl.GetSelectedFolderPath(folderPath) || folderPath.IsEmpty())
00193     {
00194         pCmdUI->Enable(FALSE);
00195         return;
00196     }
00197
00198     pCmdUI->Enable(TRUE);
00199 }

void CExploreBar::OnUpdateViewCheckout ( CCmdUI * pCmdUI ) [protected]

Definition at line 214 of file ExploreBar.cpp.

References OnUpdateCmd.

00215 {
00216     OnUpdateCmd(pCmdUI);
00217     pCmdUI->SetText("Chec&kout module to selection...");
00218 }

void CExploreBar::OnUpdateViewImport ( CCmdUI * pCmdUI ) [protected]

Definition at line 227 of file ExploreBar.cpp.

References OnUpdateCmd.

00228 {
00229     OnUpdateCmd(pCmdUI);
00230     pCmdUI->SetText("&Import module from selection...");
00231 }

void CExploreBar::OnViewCheckout ( ) [protected]

Definition at line 207 of file ExploreBar.cpp.

References CvsCmdCheckoutModule, and m_TreeCtrl.

00208 {
00209     CString folderPath;
00210     if(m_TreeCtrl.GetSelectedFolderPath(folderPath) && !folderPath.IsEmpty())
00211         CvsCmdCheckoutModule(folderPath);
00212 }

void CExploreBar::OnViewImport ( ) [protected]

Definition at line 220 of file ExploreBar.cpp.

References CvsCmdImportModule, and m_TreeCtrl.

00221 {
00222     CString folderPath;
00223     if(m_TreeCtrl.GetSelectedFolderPath(folderPath) && !folderPath.IsEmpty())
00224         CvsCmdImportModule(folderPath);
00225 }

void CExploreBar::OnWindowPosChanged ( WINDOWPOS FAR * lpwndpos ) [protected]

Definition at line 174 of file ExploreBar.cpp.

References m_TreeCtrl, and NULL.

00175 {
00176     CView::OnWindowPosChanged(wp);
00177
00178     CRect r;
00179     GetClientRect(&r);
00180     m_TreeCtrl.SetWindowPos(NULL, r.left, r.top, r.Width(), r.Height(), SWP_NOZORDER);
00181 }

Member Data Documentation

CMyShellTree CExploreBar::m_TreeCtrl

Definition at line 40 of file ExploreBar.h.

Referenced by Create, CMainFrame::GetExplorerView, OnUpdateCmd, OnViewCheckout, OnViewImport, and OnWindowPosChanged.

The documentation for this class was generated from the following files:
  • WinCvs/ExploreBar.h
  • WinCvs/ExploreBar.cpp
Generated on Sun Feb 24 01:25:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


FileEntry Class Reference

#include <MultiFiles.h>

Collaboration diagram for FileEntry:

[legend]
List of all members.

Public Methods

FileEntry ()
FileEntry (const char *filename, const FSSpec *macspec=0L)
FileEntry (const FileEntry &entry)
FileEntry & operator= (const FileEntry &entry)

Public Attributes

UStr file
FSSpec spec

Constructor & Destructor Documentation

FileEntry::FileEntry ( ) [inline]

Definition at line 43 of file MultiFiles.h.

00043 {}

FileEntry::FileEntry | ( | const char * | filename,
 |  | const FSSpec * | macspec = 0L
 | ) | [inline]

Definition at line 44 of file MultiFiles.h.

References file, spec, and UFSSpec.

00045     {
00046         file = filename;
00047         if(macspec != 0L)
00048             spec = *macspec;
00049     }

FileEntry::FileEntry ( const FileEntry & entry ) [inline]

Definition at line 50 of file MultiFiles.h.

00051     {
00052         *this = entry;
00053     }

Member Function Documentation

FileEntry& FileEntry::operator= ( const FileEntry & entry ) [inline]

Definition at line 55 of file MultiFiles.h.

References file, and spec.

00056     {
00057         file = entry.file;
00058         spec = entry.spec;
00059         return *this;
00060     }

Member Data Documentation

UStr FileEntry::file

Definition at line 62 of file MultiFiles.h.

Referenced by FileEntry, and operator=.

FSSpec FileEntry::spec

Definition at line 63 of file MultiFiles.h.

Referenced by FileEntry, and operator=.

The documentation for this class was generated from the following file:
  • common/MultiFiles.h
Generated on Sun Feb 24 01:25:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CFillPyEntries Class Reference

Inheritance diagram for CFillPyEntries:

[legend]
Collaboration diagram for CFillPyEntries:

[legend]
List of all members.

Public Methods

CFillPyEntries (CSortList< ENTNODE > &entries)
virtual | ~CFillPyEntries ()
virtual kTraversal | EnterDirectory (const char *fullpath, const char *dirname, const FSSpec *macspec)
virtual kTraversal | ExitDirectory (const char *fullpath)
virtual kTraversal | OnError (const char *err, int errcode)
virtual kTraversal | OnIdle (const char *fullpath)
virtual kTraversal | OnDirectory (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)
virtual kTraversal | OnAlias (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)
virtual kTraversal | OnFile (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)

Public Attributes

CSortList< ENTNODE > & m_entries
std::vector< UStr > m_ignlist

Constructor & Destructor Documentation

CFillPyEntries::CFillPyEntries ( CSortList< ENTNODE > & entries ) [inline]

Definition at line 288 of file PythonGlue.cpp.

00288                                                  :
00289         m_entries(entries) {}

virtual CFillPyEntries::~CFillPyEntries ( ) [inline, virtual]

Definition at line 291 of file PythonGlue.cpp.

00291 {}

Member Function Documentation

virtual kTraversal CFillPyEntries::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 293 of file PythonGlue.cpp.

References BuildIgnoredList, Entries_Open, FSSpec, kContinueTraversal, and kTraversal.

00294     {
00295         Entries_Open (m_entries, fullpath);
00296         BuildIgnoredList(m_ignlist, fullpath);
00297         return kContinueTraversal;
00298     }

virtual kTraversal CFillPyEntries::ExitDirectory ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 300 of file PythonGlue.cpp.

References kContinueTraversal, and kTraversal.

00301     {
00302         m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00303         return kContinueTraversal;
00304     }

virtual kTraversal CFillPyEntries::OnAlias | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 333 of file PythonGlue.cpp.

References FSSpec, kTraversal, OnFile, and stat.

00337     {
00338         return OnFile(fullpath, fullname, name, dir, macspec);
00339     }

virtual kTraversal CFillPyEntries::OnDirectory | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 316 of file PythonGlue.cpp.

References Entries_SetVisited, FSSpec, kSkipFile, kTraversal, stat, and stricmp.

00320     {
00321 #if defined(WIN32) || defined(macintosh)
00322         if(stricmp(name, "CVS") == 0)
00323 #else
00324         if(strcmp(name, "CVS") == 0)
00325 #endif
00326             return kSkipFile;
00327
00328         /*EntnodeData *data = */Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00329
00330         return kSkipFile;
00331     }

virtual kTraversal CFillPyEntries::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 306 of file PythonGlue.cpp.

References err, kTraversal, and kTraversalError.

00307     {
00308         return kTraversalError;
00309     }

virtual kTraversal CFillPyEntries::OnFile | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 341 of file PythonGlue.cpp.

References Entries_SetVisited, FSSpec, kContinueTraversal, kTraversal, and stat.

Referenced by OnAlias.

00345     {
00346         /*EntnodeData *data = */Entries_SetVisited(fullpath, m_entries, name, dir, false, &m_ignlist);
00347
00348         return kContinueTraversal;
00349     }

virtual kTraversal CFillPyEntries::OnIdle ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 311 of file PythonGlue.cpp.

References kContinueTraversal, and kTraversal.

00312     {
00313         return kContinueTraversal;
00314     }

Member Data Documentation

CSortList<ENTNODE>& CFillPyEntries::m_entries

Definition at line 285 of file PythonGlue.cpp.

std::vector< UStr > CFillPyEntries::m_ignlist

Definition at line 286 of file PythonGlue.cpp.

The documentation for this class was generated from the following file:
  • common/PythonGlue.cpp
Generated on Sun Feb 24 01:25:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CFillTclEntries Class Reference

Inheritance diagram for CFillTclEntries:

[legend]
Collaboration diagram for CFillTclEntries:

[legend]
List of all members.

Public Methods

CFillTclEntries (CSortList< ENTNODE > &entries)
virtual | ~CFillTclEntries ()
virtual kTraversal | EnterDirectory (const char *fullpath, const char *dirname, const FSSpec *macspec)
virtual kTraversal | ExitDirectory (const char *fullpath)
virtual kTraversal | OnError (const char *err, int errcode)
virtual kTraversal | OnIdle (const char *fullpath)
virtual kTraversal | OnDirectory (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)
virtual kTraversal | OnAlias (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)
virtual kTraversal | OnFile (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)

Public Attributes

CSortList< ENTNODE > & m_entries
std::vector< UStr > m_ignlist

Constructor & Destructor Documentation

CFillTclEntries::CFillTclEntries ( CSortList< ENTNODE > & entries ) [inline]

Definition at line 545 of file TclGlue.cpp.

00545                                                   :
00546         m_entries(entries) {}

virtual CFillTclEntries::~CFillTclEntries ( ) [inline, virtual]

Definition at line 548 of file TclGlue.cpp.

00548 {}

Member Function Documentation

virtual kTraversal CFillTclEntries::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 550 of file TclGlue.cpp.

References BuildIgnoredList, Entries_Open, FSSpec, kContinueTraversal, and kTraversal.

00551     {
00552         Entries_Open (m_entries, fullpath);
00553         BuildIgnoredList(m_ignlist, fullpath);
00554         return kContinueTraversal;
00555     }

virtual kTraversal CFillTclEntries::ExitDirectory ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 557 of file TclGlue.cpp.

References kContinueTraversal, and kTraversal.

00558     {
00559         m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00560         return kContinueTraversal;
00561     }

virtual kTraversal CFillTclEntries::OnAlias | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 590 of file TclGlue.cpp.

References FSSpec, kTraversal, OnFile, and stat.

00594     {
00595         return OnFile(fullpath, fullname, name, dir, macspec);
00596     }

virtual kTraversal CFillTclEntries::OnDirectory | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 573 of file TclGlue.cpp.

References Entries_SetVisited, FSSpec, kSkipFile, kTraversal, stat, and stricmp.

00577     {
00578 #if defined(WIN32) || defined(macintosh)
00579         if(stricmp(name, "CVS") == 0)
00580 #else
00581         if(strcmp(name, "CVS") == 0)
00582 #endif
00583             return kSkipFile;
00584
00585         /*EntnodeData *data = */Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00586
00587         return kSkipFile;
00588     }

virtual kTraversal CFillTclEntries::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 563 of file TclGlue.cpp.

References err, kTraversal, and kTraversalError.

00564     {
00565         return kTraversalError;
00566     }

virtual kTraversal CFillTclEntries::OnFile | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 598 of file TclGlue.cpp.

References Entries_SetVisited, FSSpec, kContinueTraversal, kTraversal, and stat.

Referenced by OnAlias.

00602     {
00603         /*EntnodeData *data = */Entries_SetVisited(fullpath, m_entries, name, dir, false, &m_ignlist);
00604
00605         return kContinueTraversal;
00606     }

virtual kTraversal CFillTclEntries::OnIdle ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 568 of file TclGlue.cpp.

References kContinueTraversal, and kTraversal.

00569     {
00570         return kContinueTraversal;
00571     }

Member Data Documentation

CSortList<ENTNODE>& CFillTclEntries::m_entries

Definition at line 542 of file TclGlue.cpp.

std::vector< UStr > CFillTclEntries::m_ignlist

Definition at line 543 of file TclGlue.cpp.

The documentation for this class was generated from the following file:
  • common/TclGlue.cpp
Generated on Sun Feb 24 01:25:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CFindSettings Class Reference

Inheritance diagram for CFindSettings:

[legend]
Collaboration diagram for CFindSettings:

[legend]
List of all members.

Public Methods

CFindSettings (const char *findPath)
CFindSettings (std::map< UStr, UStr > &list)
virtual | ~CFindSettings ()
virtual kTraversal | OnError (const char *err, int errcode)
virtual kTraversal | OnFile (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)

Static Public Methods

bool | searchPath (const char *token, const char *value, void *data)
bool | searchAllPath (const char *token, const char *value, void *data)

Public Attributes

UStr m_pathToFind
UStr m_settingsFile
bool | m_foundIt
UStr m_topfolder
std::map< UStr, UStr > * | m_list

Constructor & Destructor Documentation

CFindSettings::CFindSettings ( const char * findPath ) [inline]

Definition at line 950 of file Persistent.cpp.

References UStr::endsWith, UStr::length, m_list, and m_pathToFind.

00950                                         : m_pathToFind(findPath), m_list(0L)
00951     {
00952         if(m_pathToFind.endsWith(kPathDelimiter))
00953             m_pathToFind[m_pathToFind.length() - 1] = '\0';
00954     }

CFindSettings::CFindSettings ( std::map< UStr, UStr > & list ) [inline]

Definition at line 956 of file Persistent.cpp.

References m_list.

00956                                              : m_list(&list)
00957     {
00958     }

virtual CFindSettings::~CFindSettings ( ) [inline, virtual]

Definition at line 960 of file Persistent.cpp.

00960 {}

Member Function Documentation

virtual kTraversal CFindSettings::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 962 of file Persistent.cpp.

References cvs_err, err, kTraversal, and kTraversalError.

00963     {
00964         cvs_err(err);
00965         cvs_err("\n");
00966         return kTraversalError;
00967     }

kTraversal CFindSettings::OnFile | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [virtual]

Reimplemented from TraversalReport.

Definition at line 1017 of file Persistent.cpp.

References kContinueTraversal, kStopTraversal, kTraversal, loadSettingsInternal, m_foundIt, m_list, m_settingsFile, searchAllPath, searchPath, stat, and UFSSpec.

01021 {
01022     m_foundIt = false;
01023     if(m_list == 0L)
01024     {
01025         loadSettingsInternal(fullname, searchPath, this);
01026     }
01027     else
01028     {
01029         m_settingsFile = fullname;
01030         loadSettingsInternal(fullname, searchAllPath, this);
01031     }
01032
01033     if(m_foundIt)
01034         m_settingsFile = fullname;
01035
01036     return m_foundIt ? kStopTraversal : kContinueTraversal;
01037 }

bool CFindSettings::searchAllPath | ( | const char * | token,
 |  | const char * | value,
 |  | void * | data
 | ) | [static]

Definition at line 1004 of file Persistent.cpp.

References getSettingName, m_list, and m_settingsFile.

Referenced by OnFile.

01005 {
01006     CFindSettings *loader = (CFindSettings *)data;
01007     if(strcmp(token, "PATH") == 0)
01008     {
01009         getSettingName(loader->m_settingsFile, loader->m_settingsFile);
01010         std::map<UStr, UStr>::value_type v(loader->m_settingsFile, UStr(value));
01011         loader->m_list->insert(v);
01012         return true;
01013     }
01014     return false;
01015 }

bool CFindSettings::searchPath | ( | const char * | token,
 |  | const char * | value,
 |  | void * | data
 | ) | [static]

Definition at line 984 of file Persistent.cpp.

References m_foundIt, m_pathToFind, m_topfolder, and strnicmp.

Referenced by OnFile.

00985 {
00986     CFindSettings *loader = (CFindSettings *)data;
00987     // if we give a sub-folder to look for, it will return the
00988     // top folder's settings
00989     if(strcmp(token, "PATH") == 0 &&
00990 #if qUnix
00991         strncmp(value, loader->m_pathToFind, strlen(value)) == 0
00992 #else
00993         strnicmp(value, loader->m_pathToFind, strlen(value)) == 0
00994 #endif
00995         )
00996     {
00997         loader->m_foundIt = true;
00998         loader->m_topfolder = value;
00999         return true;
01000     }
01001     return false;
01002 }

Member Data Documentation

bool CFindSettings::m_foundIt

Definition at line 979 of file Persistent.cpp.

Referenced by OnFile, and searchPath.

std::map<UStr, UStr>* CFindSettings::m_list

Definition at line 981 of file Persistent.cpp.

Referenced by CFindSettings, OnFile, and searchAllPath.

UStr CFindSettings::m_pathToFind

Definition at line 977 of file Persistent.cpp.

Referenced by CFindSettings, and searchPath.

UStr CFindSettings::m_settingsFile

Definition at line 978 of file Persistent.cpp.

Referenced by AskCreatePersistentSettings, HasPersistentSettings, LoadPersistentSettings, OnFile, SavePersistentSettings, and searchAllPath.

UStr CFindSettings::m_topfolder

Definition at line 980 of file Persistent.cpp.

Referenced by SavePersistentSettings, and searchPath.

The documentation for this class was generated from the following file:
  • common/Persistent.cpp
Generated on Sun Feb 24 01:25:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CFormView Class Reference

Inheritance diagram for CFormView:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJHtmlView.h
Generated on Sun Feb 24 01:25:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CFrameWnd Class Reference

Inheritance diagram for CFrameWnd:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJFrameWnd.h
Generated on Sun Feb 24 01:25:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


garbyRec Struct Reference

Collaboration diagram for garbyRec:

[legend]
List of all members.

Public Attributes

poolRec pools [20]

Member Data Documentation

poolRec garbyRec::pools[ 20 ]

Definition at line 299 of file dll_garbage.c.

The documentation for this struct was generated from the following file:
  • common/dll_garbage.c
Generated on Sun Feb 24 01:25:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GetPassword Class Reference

#include <GetPassword.h>

Inheritance diagram for GetPassword:

[legend]
Collaboration diagram for GetPassword:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_PASSWRD }

Public Methods

GetPassword (CWnd *pParent=NULL)

Public Attributes

CString | m_passwd

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
virtual BOOL | OnInitDialog ()

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 45 of file GetPassword.h.

00045 { IDD = IDD_PASSWRD };

Constructor & Destructor Documentation

GetPassword::GetPassword ( CWnd * pParent = NULL )

Definition at line 63 of file GetPassword.cpp.

References m_passwd.

00064     : CDialog(GetPassword::IDD, pParent)
00065 {
00066     //{{AFX_DATA_INIT(GetPassword)
00067     m_passwd = _T("");
00068     //}}AFX_DATA_INIT
00069 }

Member Function Documentation

void GetPassword::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 72 of file GetPassword.cpp.

References IDC_PASSWD, and m_passwd.

00073 {
00074     CDialog::DoDataExchange(pDX);
00075     //{{AFX_DATA_MAP(GetPassword)
00076     DDX_Text(pDX, IDC_PASSWD, m_passwd);
00077     //}}AFX_DATA_MAP
00078 }

BOOL GetPassword::OnInitDialog ( ) [protected, virtual]

Definition at line 89 of file GetPassword.cpp.

References TRUE.

00090 {
00091     CDialog::OnInitDialog();
00092
00093     // Extra initialization here
00094
00095     //force the window to the foreground in case it was covered by terminal or DOS box
00096     if( !IsWindowVisible() )
00097     {
00098         SetForegroundWindow();
00099     }
00100
00101     return TRUE;  // return TRUE unless you set the focus to a control
00102     // EXCEPTION: OCX Property Pages should return FALSE
00103 }

Member Data Documentation

CString GetPassword::m_passwd

Definition at line 46 of file GetPassword.h.

Referenced by CompatGetPassword, DoDataExchange, and GetPassword.

The documentation for this class was generated from the following files:
  • common/GetPassword.h
  • common/GetPassword.cpp
Generated on Sun Feb 24 01:25:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CGetPrefs_CVSCMD_DIALOGS Class Reference

#include <GetPrefs.h>

Inheritance diagram for CGetPrefs_CVSCMD_DIALOGS:

[legend]
Collaboration diagram for CGetPrefs_CVSCMD_DIALOGS:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_PREFS_CVSCMD_DIALOGS }

Public Methods

CGetPrefs_CVSCMD_DIALOGS ()
~CGetPrefs_CVSCMD_DIALOGS ()
void | StoreValues ()

Public Attributes

BOOL | m_hideUpdate
BOOL | m_hideDiff
BOOL | m_hideGraph
BOOL | m_hideLog
int | m_keyForce
BOOL | m_hideAnnotate

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)

Protected Attributes

bool | m_didInteract

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 206 of file GetPrefs.h.

00206 { IDD = IDD_PREFS_CVSCMD_DIALOGS };

Constructor & Destructor Documentation

CGetPrefs_CVSCMD_DIALOGS::CGetPrefs_CVSCMD_DIALOGS ( )

Definition at line 580 of file GetPrefs.cpp.

References m_hideAnnotate, m_hideDiff, m_hideGraph, m_hideLog, m_hideUpdate, and m_keyForce.

00580                                                    : CPropertyPage(CGetPrefs_CVSCMD_DIALOGS::IDD), m_didInteract(false)
00581 {
00582     //{{AFX_DATA_INIT(CGetPrefs_CVSCMD_DIALOGS)
00583     m_hideUpdate = gCvsPrefs.HideCommandDlgUpdate() != 0L;
00584     m_hideDiff = gCvsPrefs.HideCommandDlgDiff() != 0L;
00585     m_hideGraph = gCvsPrefs.HideCommandDlgGraph() != 0L;
00586     m_hideLog = gCvsPrefs.HideCommandDlgLog() != 0L;
00587     m_keyForce = gCvsPrefs.HideCommandDlgUseShift() != 0L ? 0 : 1;
00588     m_hideAnnotate = gCvsPrefs.HideCommandDlgAnnotate() != 0L;
00589     //}}AFX_DATA_INIT
00590 }

CGetPrefs_CVSCMD_DIALOGS::~CGetPrefs_CVSCMD_DIALOGS ( )

Definition at line 592 of file GetPrefs.cpp.

00593 {
00594 }

Member Function Documentation

void CGetPrefs_CVSCMD_DIALOGS::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 596 of file GetPrefs.cpp.

References IDC_CHECKANNOTATE, IDC_CHECKDIFF, IDC_CHECKGRAPH, IDC_CHECKLOG, IDC_CHECKUPDATE, IDC_RADIOSHIFT, m_didInteract, m_hideAnnotate, m_hideDiff, m_hideGraph, m_hideLog, m_hideUpdate, and m_keyForce.

00597 {
00598     m_didInteract = true;
00599
00600     CPropertyPage::DoDataExchange(pDX);
00601     //{{AFX_DATA_MAP(CGetPrefs_CVSCMD_DIALOGS)
00602     DDX_Check(pDX, IDC_CHECKUPDATE, m_hideUpdate);
00603     DDX_Check(pDX, IDC_CHECKDIFF, m_hideDiff);
00604     DDX_Check(pDX, IDC_CHECKGRAPH, m_hideGraph);
00605     DDX_Check(pDX, IDC_CHECKLOG, m_hideLog);
00606     DDX_Radio(pDX, IDC_RADIOSHIFT, m_keyForce);
00607     DDX_Check(pDX, IDC_CHECKANNOTATE, m_hideAnnotate);
00608     //}}AFX_DATA_MAP
00609 }

void CGetPrefs_CVSCMD_DIALOGS::StoreValues ( )

Definition at line 611 of file GetPrefs.cpp.

References m_didInteract, m_hideAnnotate, m_hideDiff, m_hideGraph, m_hideLog, m_hideUpdate, and m_keyForce.

Referenced by CompatGetPrefs.

00612 {
00613     if(!m_didInteract)
00614         return;
00615
00616     gCvsPrefs.SetHideCommandDlgUpdate(m_hideUpdate ? true : false);
00617     gCvsPrefs.SetHideCommandDlgDiff(m_hideDiff ? true : false);
00618     gCvsPrefs.SetHideCommandDlgGraph(m_hideGraph ? true : false);
00619     gCvsPrefs.SetHideCommandDlgAnnotate(m_hideAnnotate ? true : false);
00620     gCvsPrefs.SetHideCommandDlgLog(m_hideLog ? true : false);
00621     gCvsPrefs.SetHideCommandDlgUseShift(m_keyForce == 0);
00622 }

Member Data Documentation

bool CGetPrefs_CVSCMD_DIALOGS::m_didInteract [protected]

Definition at line 225 of file GetPrefs.h.

Referenced by DoDataExchange, and StoreValues.

BOOL CGetPrefs_CVSCMD_DIALOGS::m_hideAnnotate

Definition at line 212 of file GetPrefs.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS, DoDataExchange, and StoreValues.

BOOL CGetPrefs_CVSCMD_DIALOGS::m_hideDiff

Definition at line 208 of file GetPrefs.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS, DoDataExchange, and StoreValues.

BOOL CGetPrefs_CVSCMD_DIALOGS::m_hideGraph

Definition at line 209 of file GetPrefs.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS, DoDataExchange, and StoreValues.

BOOL CGetPrefs_CVSCMD_DIALOGS::m_hideLog

Definition at line 210 of file GetPrefs.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS, DoDataExchange, and StoreValues.

BOOL CGetPrefs_CVSCMD_DIALOGS::m_hideUpdate

Definition at line 207 of file GetPrefs.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS, DoDataExchange, and StoreValues.

int CGetPrefs_CVSCMD_DIALOGS::m_keyForce

Definition at line 211 of file GetPrefs.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS, DoDataExchange, and StoreValues.

The documentation for this class was generated from the following files:
  • common/GetPrefs.h
  • common/GetPrefs.cpp
Generated on Sun Feb 24 01:25:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CGetPrefs_CVSROOT Class Reference

#include <GetPrefs.h>

Inheritance diagram for CGetPrefs_CVSROOT:

[legend]
Collaboration diagram for CGetPrefs_CVSROOT:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_PREFS_CVSROOT }

Public Methods

CGetPrefs_CVSROOT ()
~CGetPrefs_CVSROOT ()
void | StoreValues ()

Public Attributes

CSmartComboBox m_versCombo
CSmartComboBox m_authenCombo
CSmartComboBox m_cvsrootCombo
CString | m_cvsroot
int | m_cvsvers
AuthenKind m_authen
CString | m_host
CString | m_login
CString | m_path
BOOL | m_cvsconsole

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
void | FillFields (void)
void | OnChangeFields (void)
afx_msg void | OnSelchangeAuthen ()
afx_msg void | OnChangePath ()
afx_msg void | OnChangeHost ()
afx_msg void | OnChangeLogin ()
afx_msg void | OnSettings ()
afx_msg void | OnSelchangeComboroot ()
afx_msg void | OnEditchangeComboroot ()

Protected Attributes

bool | m_didInteract
bool | m_flag

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 52 of file GetPrefs.h.

00052 { IDD = IDD_PREFS_CVSROOT };

Constructor & Destructor Documentation

CGetPrefs_CVSROOT::CGetPrefs_CVSROOT ( )

Definition at line 67 of file GetPrefs.cpp.

References m_authen, m_cvsconsole, m_cvsroot, m_cvsrootCombo, m_cvsvers, m_flag, m_host, m_login, m_path, and USmartCombo::SetItems.

00068     : m_versCombo(USmartCombo::AutoDropWidth), m_authenCombo(USmartCombo::AutoDropWidth),
00069     CPropertyPage(CGetPrefs_CVSROOT::IDD), m_didInteract(false)
00070 {
00071     //{{AFX_DATA_INIT(CGetPrefs_CVSROOT)
00072     m_cvsroot = (const char *)gCvsPrefs;
00073     m_cvsvers = gCvsPrefs.CvsVersion();
00074     m_cvsconsole = gCvsPrefs.CvsConsole();
00075     m_authen = gAuthen.kind();
00076     m_host = _T("");
00077     m_login = _T("");
00078     m_path = _T("");
00079     //}}AFX_DATA_INIT
00080
00081     m_flag = false;
00082     m_cvsrootCombo.SetItems(&gOldCvsroots);
00083 }

CGetPrefs_CVSROOT::~CGetPrefs_CVSROOT ( )

Definition at line 85 of file GetPrefs.cpp.

00086 {
00087 }

Member Function Documentation

void CGetPrefs_CVSROOT::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 90 of file GetPrefs.cpp.

References DDV_CheckCVSROOT, DDV_MinChars, DDX_ComboMString, FillFields, AuthenModel::GetAllInstances, AuthenModel::GetInstance, IDC_AUTHEN, IDC_COMBOROOT, IDC_CONSOLE, IDC_CVSVERS, IDC_HOST, IDC_LOGIN, IDC_PATH, Authen::kindToNum, m_authen, m_authenCombo, m_cvsconsole, m_cvsroot, m_cvsrootCombo, m_cvsvers, m_didInteract, m_host, m_login, m_path, m_versCombo, and OnSelchangeAuthen.

00091 {
00092     m_didInteract = true;
00093
00094     CPropertyPage::DoDataExchange(pDX);
00095
00096     //{{AFX_DATA_MAP(CGetPrefs_CVSROOT)
00097     DDX_Control(pDX, IDC_CVSVERS, m_versCombo);
00098     DDX_Control(pDX, IDC_AUTHEN, m_authenCombo);
00099     DDX_Control(pDX, IDC_COMBOROOT, m_cvsrootCombo);
00100     DDX_CBString(pDX, IDC_COMBOROOT, m_cvsroot);
00101     DDV_MinChars(pDX, m_cvsroot, 1);
00102     DDX_Text(pDX, IDC_HOST, m_host);
00103     DDX_Text(pDX, IDC_LOGIN, m_login);
00104     DDX_Text(pDX, IDC_PATH, m_path);
00105     DDX_Check(pDX, IDC_CONSOLE, m_cvsconsole);
00106     //}}AFX_DATA_MAP
00107
00108     DDV_CheckCVSROOT(pDX, m_cvsroot);
00109
00110     if( pDX->m_bSaveAndValidate )
00111     {
00112         //in case the CVSROOT was modified by DDV rutine we need to refill the fields
00113         FillFields();
00114
00115         m_cvsvers = m_versCombo.GetCurSel();
00116
00117         if( !m_cvsroot.IsEmpty() )
00118         {
00119             gOldCvsroots.Insert(m_cvsroot);
00120         }
00121     }
00122     else
00123     {
00124         DDX_ComboMString(pDX, IDC_COMBOROOT, m_cvsrootCombo);
00125
00126         m_versCombo.SetCurSel(m_cvsvers);
00127
00128         m_authenCombo.ResetContent();
00129         std::vector<AuthenModel *> & allAuthen = AuthenModel::GetAllInstances();
00130         std::vector<AuthenModel *>::iterator j;
00131         for(j = allAuthen.begin(); j != allAuthen.end(); ++j)
00132         {
00133             m_authenCombo.InsertString(-1, (*j)->GetToken());
00134         }
00135
00136         AuthenModel *model = AuthenModel::GetInstance(m_authen);
00137         m_authenCombo.SetCurSel(Authen::kindToNum(m_authen));
00138
00139         FillFields();
00140         OnSelchangeAuthen();
00141     }
00142 }

void CGetPrefs_CVSROOT::FillFields ( void ) [protected]

Definition at line 213 of file GetPrefs.cpp.

References USemaphore::IsEnteredTwice, m_authen, m_cvsroot, m_flag, Authen::parse_cvsroot, Authen::skiptoken, and Authen::token.

Referenced by DoDataExchange, OnEditchangeComboroot, and OnSelchangeComboroot.

00214 {
00215     UStr theMethod, theUser, theHost, thePath;
00216     USemaphore policeman(m_flag);
00217     if(policeman.IsEnteredTwice())
00218         return;
00219
00220     UStr root;
00221     root = Authen::token(m_authen);
00222     root << Authen::skiptoken(m_cvsroot);
00223
00224     if(Authen::parse_cvsroot(root, theMethod, theUser, theHost, thePath))
00225     {
00226         GetDlgItem(IDC_PATH)->SetWindowText(thePath);
00227         GetDlgItem(IDC_HOST)->SetWindowText(theHost);
00228         GetDlgItem(IDC_LOGIN)->SetWindowText(theUser);
00229     }
00230 }

void CGetPrefs_CVSROOT::OnChangeFields ( void ) [protected]

Definition at line 238 of file GetPrefs.cpp.

References AuthenModel::GetInstance, AuthenModel::HasHost, AuthenModel::HasUser, USemaphore::IsEnteredTwice, m_authen, m_cvsroot, m_cvsrootCombo, and m_flag.

Referenced by OnChangeHost, OnChangeLogin, and OnChangePath.

00239 {
00240     USemaphore policeman(m_flag);
00241     if(policeman.IsEnteredTwice())
00242         return;
00243
00244     CString theUser, theHost, thePath;
00245
00246     GetDlgItem(IDC_PATH)->GetWindowText(thePath);
00247     GetDlgItem(IDC_HOST)->GetWindowText(theHost);
00248     GetDlgItem(IDC_LOGIN)->GetWindowText(theUser);
00249
00250     m_cvsroot = "";
00251     AuthenModel *model = AuthenModel::GetInstance(m_authen);
00252     if(model->HasUser())
00253     {
00254         m_cvsroot += theUser;
00255
00256         if(model->HasHost())
00257         {
00258             m_cvsroot += '@';
00259         }
00260     }
00261
00262     if(model->HasHost())
00263     {
00264         m_cvsroot += theHost;
00265     }
00266
00267     if(model->HasUser() || model->HasHost())
00268         m_cvsroot += ':';
00269
00270     m_cvsroot += thePath;
00271
00272     m_cvsrootCombo.SetWindowText(m_cvsroot);
00273 }

void CGetPrefs_CVSROOT::OnChangeHost ( ) [protected]

Definition at line 194 of file GetPrefs.cpp.

References OnChangeFields.

00195 {
00196     OnChangeFields();
00197 }

void CGetPrefs_CVSROOT::OnChangeLogin ( ) [protected]

Definition at line 199 of file GetPrefs.cpp.

References OnChangeFields.

00200 {
00201     OnChangeFields();
00202 }

void CGetPrefs_CVSROOT::OnChangePath ( ) [protected]

Definition at line 189 of file GetPrefs.cpp.

References OnChangeFields.

00190 {
00191     OnChangeFields();
00192 }

void CGetPrefs_CVSROOT::OnEditchangeComboroot ( ) [protected]

Definition at line 232 of file GetPrefs.cpp.

References FillFields, m_cvsroot, and m_cvsrootCombo.

00233 {
00234     m_cvsrootCombo.GetWindowText(m_cvsroot);
00235     FillFields();
00236 }

void CGetPrefs_CVSROOT::OnSelchangeAuthen ( ) [protected]

Definition at line 155 of file GetPrefs.cpp.

References AuthenModel::GetInstance, AuthenModel::GetSettingsDesc, AuthenModel::HasHost, AuthenModel::HasSettings, AuthenModel::HasUser, m_authen, m_authenCombo, ntserver, and Authen::numToKind.

Referenced by DoDataExchange.

00156 {
00157     m_authen = Authen::numToKind(m_authenCombo.GetCurSel());
00158
00159     AuthenModel *model = AuthenModel::GetInstance(m_authen);
00160
00161     GetDlgItem(IDC_HOST)->EnableWindow(model->HasHost());
00162     GetDlgItem(IDC_LOGIN)->EnableWindow(model->HasUser());
00163     GetDlgItem(IDC_SETTINGS)->EnableWindow(model->HasSettings());
00164
00165     if(!model->HasHost())
00166         GetDlgItem(IDC_HOST)->SetWindowText("");
00167
00168     if(!model->HasUser())
00169         GetDlgItem(IDC_LOGIN)->SetWindowText("");
00170
00171     UStr desc;
00172     model->GetSettingsDesc(desc);
00173     GetDlgItem(IDC_AUTHENDESC)->SetWindowText(desc);
00174
00175     // ntserver
00176     // the default *is* ntserver now
00177     // TODO : something more elaborated that is querying cvs
00178 #if 0
00179     if(m_authen == ntserver && m_combovers.GetCurSel() != 1)
00180     {
00181         AfxMessageBox("For the ntserver support, you got to switch the cvs used from"
00182             " \"cvs-1.10 (Standard)\" to \"cvs-1.10 (NT server)\". Check"
00183             " http://www.cvsnt.org for more informations."
00184             , MB_ICONEXCLAMATION | MB_OK);
00185     }
00186 #endif
00187 }

void CGetPrefs_CVSROOT::OnSelchangeComboroot ( ) [protected]

Definition at line 275 of file GetPrefs.cpp.

References FillFields, m_cvsroot, and m_cvsrootCombo.

00276 {
00277     int nCurSel = m_cvsrootCombo.GetCurSel();
00278     m_cvsrootCombo.GetLBText(nCurSel, m_cvsroot);
00279     FillFields();
00280 }

void CGetPrefs_CVSROOT::OnSettings ( ) [protected]

Definition at line 204 of file GetPrefs.cpp.

References AuthenModel::DoSettings, AuthenModel::GetInstance, AuthenModel::GetSettingsDesc, and m_authen.

00205 {
00206     AuthenModel *model = AuthenModel::GetInstance(m_authen);
00207     model->DoSettings();
00208     UStr desc;
00209     model->GetSettingsDesc(desc);
00210     GetDlgItem(IDC_AUTHENDESC)->SetWindowText(desc);
00211 }

void CGetPrefs_CVSROOT::StoreValues ( )

Definition at line 144 of file GetPrefs.cpp.

References m_authen, m_cvsconsole, m_cvsroot, m_cvsvers, and m_didInteract.

Referenced by CompatGetCheckout, CompatGetImport, CompatGetInit, and CompatGetPrefs.

00145 {
00146     if(!m_didInteract)
00147         return;
00148
00149     gCvsPrefs = (const char *)m_cvsroot;
00150     gAuthen.setkind(m_authen);
00151     gCvsPrefs.SetCvsVersion(m_cvsvers);
00152     gCvsPrefs.SetCvsConsole(m_cvsconsole != 0);
00153 }

Member Data Documentation

AuthenKind CGetPrefs_CVSROOT::m_authen

Definition at line 58 of file GetPrefs.h.

Referenced by CGetPrefs_CVSROOT, DoDataExchange, FillFields, OnChangeFields, OnSelchangeAuthen, OnSettings, and StoreValues.

CSmartComboBox CGetPrefs_CVSROOT::m_authenCombo

Definition at line 54 of file GetPrefs.h.

Referenced by DoDataExchange, and OnSelchangeAuthen.

BOOL CGetPrefs_CVSROOT::m_cvsconsole

Definition at line 62 of file GetPrefs.h.

Referenced by CGetPrefs_CVSROOT, DoDataExchange, and StoreValues.

CString CGetPrefs_CVSROOT::m_cvsroot

Definition at line 56 of file GetPrefs.h.

Referenced by CGetPrefs_CVSROOT, DoDataExchange, FillFields, OnChangeFields, OnEditchangeComboroot, OnSelchangeComboroot, and StoreValues.

CSmartComboBox CGetPrefs_CVSROOT::m_cvsrootCombo

Definition at line 55 of file GetPrefs.h.

Referenced by CGetPrefs_CVSROOT, DoDataExchange, OnChangeFields, OnEditchangeComboroot, and OnSelchangeComboroot.

int CGetPrefs_CVSROOT::m_cvsvers

Definition at line 57 of file GetPrefs.h.

Referenced by CGetPrefs_CVSROOT, DoDataExchange, and StoreValues.

bool CGetPrefs_CVSROOT::m_didInteract [protected]

Definition at line 74 of file GetPrefs.h.

Referenced by DoDataExchange, and StoreValues.

bool CGetPrefs_CVSROOT::m_flag [protected]

Definition at line 75 of file GetPrefs.h.

Referenced by CGetPrefs_CVSROOT, FillFields, and OnChangeFields.

CString CGetPrefs_CVSROOT::m_host

Definition at line 59 of file GetPrefs.h.

Referenced by CGetPrefs_CVSROOT, and DoDataExchange.

CString CGetPrefs_CVSROOT::m_login

Definition at line 60 of file GetPrefs.h.

Referenced by CGetPrefs_CVSROOT, and DoDataExchange.

CString CGetPrefs_CVSROOT::m_path

Definition at line 61 of file GetPrefs.h.

Referenced by CGetPrefs_CVSROOT, and DoDataExchange.

CSmartComboBox CGetPrefs_CVSROOT::m_versCombo

Definition at line 53 of file GetPrefs.h.

Referenced by DoDataExchange.

The documentation for this class was generated from the following files:
  • common/GetPrefs.h
  • common/GetPrefs.cpp
Generated on Sun Feb 24 01:26:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CGetPrefs_GLOBALS Class Reference

#include <GetPrefs.h>

Inheritance diagram for CGetPrefs_GLOBALS:

[legend]
Collaboration diagram for CGetPrefs_GLOBALS:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_PREFS_GLOBALS }

Public Methods

CGetPrefs_GLOBALS ()
~CGetPrefs_GLOBALS ()
void | StoreValues ()

Public Attributes

CSpinButtonCtrl | m_zspin
CSpinButtonCtrl | m_spin
BOOL | m_checkoutro
BOOL | m_prune
BOOL | m_tcpip
BOOL | m_quiet
BOOL | m_cntladd
BOOL | m_dirty
BOOL | m_alwaysroot
BOOL | m_logout
UINT | m_editlogout
BOOL | m_unixlf
UINT | m_zlevel

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnLogout ()
afx_msg void | OnCheckunixlf ()
afx_msg void | OnTcpip ()
virtual BOOL | OnInitDialog ()

Protected Attributes

bool | m_didInteract

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 106 of file GetPrefs.h.

00106 { IDD = IDD_PREFS_GLOBALS };

Constructor & Destructor Documentation

CGetPrefs_GLOBALS::CGetPrefs_GLOBALS ( )

Definition at line 297 of file GetPrefs.cpp.

References m_alwaysroot, m_checkoutro, m_cntladd, m_dirty, m_editlogout, m_logout, m_prune, m_quiet, m_tcpip, m_unixlf, and m_zlevel.

00297                                      : CPropertyPage(CGetPrefs_GLOBALS::IDD), m_didInteract(false)
00298 {
00299     //{{AFX_DATA_INIT(CGetPrefs_GLOBALS)
00300     m_checkoutro = gCvsPrefs.CheckoutRO();
00301     m_prune = gCvsPrefs.PruneOption();
00302     m_tcpip = gCvsPrefs.Z9Option();
00303     m_quiet = gCvsPrefs.QuietOption();
00304     m_cntladd = gCvsPrefs.AddControl();
00305     m_dirty = gCvsPrefs.DirtySupport();
00306     m_alwaysroot = gCvsPrefs.AlwaysUseCvsroot();
00307     m_logout = gCvsPrefs.LogoutTimeOut() > 0;
00308     m_editlogout = gCvsPrefs.LogoutTimeOut();
00309     m_unixlf = gCvsPrefs.UnixLF();
00310     m_zlevel = gCvsPrefs.ZLevel();
00311     //}}AFX_DATA_INIT
00312 }

CGetPrefs_GLOBALS::~CGetPrefs_GLOBALS ( )

Definition at line 314 of file GetPrefs.cpp.

00315 {
00316 }

Member Function Documentation

void CGetPrefs_GLOBALS::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 318 of file GetPrefs.cpp.

References IDC_ALWAYSROOT, IDC_CHECKOUTRO, IDC_CHECKUNIXLF, IDC_CTNLADD, IDC_DIRTYSUPPORT, IDC_EDITLOGOUT, IDC_LOGOUT, IDC_PRUNE, IDC_QUIET, IDC_SPINLOGOUT, IDC_TCPIP, IDC_ZLEVEL, IDC_ZSPIN, m_alwaysroot, m_checkoutro, m_cntladd, m_didInteract, m_dirty, m_editlogout, m_logout, m_prune, m_quiet, m_spin, m_tcpip, m_unixlf, m_zlevel, m_zspin, OnLogout, and OnTcpip.

00319 {
00320     m_didInteract = true;
00321
00322     CPropertyPage::DoDataExchange(pDX);
00323
00324     //{{AFX_DATA_MAP(CGetPrefs_GLOBALS)
00325     DDX_Control(pDX, IDC_ZSPIN, m_zspin);
00326     DDX_Control(pDX, IDC_SPINLOGOUT, m_spin);
00327     DDX_Check(pDX, IDC_CHECKOUTRO, m_checkoutro);
00328     DDX_Check(pDX, IDC_PRUNE, m_prune);
00329     DDX_Check(pDX, IDC_TCPIP, m_tcpip);
00330     DDX_Check(pDX, IDC_QUIET, m_quiet);
00331     DDX_Check(pDX, IDC_CTNLADD, m_cntladd);
00332     DDX_Check(pDX, IDC_DIRTYSUPPORT, m_dirty);
00333     DDX_Check(pDX, IDC_ALWAYSROOT, m_alwaysroot);
00334     DDX_Check(pDX, IDC_LOGOUT, m_logout);
00335     DDX_Text(pDX, IDC_EDITLOGOUT, m_editlogout);
00336     DDV_MinMaxUInt(pDX, m_editlogout, 0, 999999);
00337     DDX_Check(pDX, IDC_CHECKUNIXLF, m_unixlf);
00338     DDX_Text(pDX, IDC_ZLEVEL, m_zlevel);
00339     DDV_MinMaxUInt(pDX, m_zlevel, 1, 9);
00340     //}}AFX_DATA_MAP
00341
00342     if(!pDX->m_bSaveAndValidate)
00343     {
00344         OnTcpip();
00345         OnLogout();
00346     }
00347 }

void CGetPrefs_GLOBALS::OnCheckunixlf ( ) [protected]

Definition at line 407 of file GetPrefs.cpp.

00408 {
00409     AfxMessageBox("Be carefull when toggling this option : you *CANNOT* use WinCvs in"
00410         " both mode. You got to use either one or the other. If you experience some"
00411         " problems, try to remove the global cvs files (such as .cvspass) because they probably"
00412         " don't match the new line feeds.", MB_ICONEXCLAMATION | MB_OK);
00413 }

BOOL CGetPrefs_GLOBALS::OnInitDialog ( ) [protected, virtual]

Definition at line 374 of file GetPrefs.cpp.

References m_spin, m_zspin, and TRUE.

00375 {
00376     CPropertyPage::OnInitDialog();
00377
00378     // Extra initialization
00379     m_spin.SetBase(10);
00380     m_spin.SetRange(0, 30000);
00381
00382     m_zspin.SetBase(1);
00383     m_zspin.SetRange(1, 9);
00384
00385     return TRUE;  // return TRUE unless you set the focus to a control
00386                   // EXCEPTION: OCX Property Pages should return FALSE
00387 }

void CGetPrefs_GLOBALS::OnLogout ( ) [protected]

Definition at line 398 of file GetPrefs.cpp.

References IDC_EDITLOGOUT, IDC_LOGOUT, and IDC_SPINLOGOUT.

Referenced by DoDataExchange.

00399 {
00400     CButton* but = (CButton *)GetDlgItem(IDC_LOGOUT);
00401     CWnd* wnd = (CButton *)GetDlgItem(IDC_EDITLOGOUT);
00402     wnd->EnableWindow(but->GetCheck() == 1);
00403     wnd = (CButton *)GetDlgItem(IDC_SPINLOGOUT);
00404     wnd->EnableWindow(but->GetCheck() == 1);
00405 }

void CGetPrefs_GLOBALS::OnTcpip ( ) [protected]

Definition at line 389 of file GetPrefs.cpp.

References IDC_TCPIP, IDC_ZLEVEL, and IDC_ZSPIN.

Referenced by DoDataExchange.

00390 {
00391     CButton* but = (CButton *)GetDlgItem(IDC_TCPIP);
00392     CWnd* wnd = (CButton *)GetDlgItem(IDC_ZLEVEL);
00393     wnd->EnableWindow(but->GetCheck() == 1);
00394     wnd = (CButton *)GetDlgItem(IDC_ZSPIN);
00395     wnd->EnableWindow(but->GetCheck() == 1);
00396 }

void CGetPrefs_GLOBALS::StoreValues ( )

Definition at line 349 of file GetPrefs.cpp.

References m_alwaysroot, m_checkoutro, m_cntladd, m_didInteract, m_dirty, m_editlogout, m_logout, m_prune, m_quiet, m_tcpip, m_unixlf, and m_zlevel.

Referenced by CompatGetAnnotate, CompatGetCheckout, CompatGetCommand, CompatGetCommit, CompatGetDiff, CompatGetImport, CompatGetInit, CompatGetLog, CompatGetPrefs, CompatGetUpdate, CompatRtagBranch, CompatRtagCreate, CompatRtagDelete, CompatTagBranch, CompatTagCreate, and CompatTagDelete.

00350 {
00351     if(!m_didInteract)
00352         return;
00353
00354     gCvsPrefs.SetCheckoutRO(m_checkoutro ? true : false);
00355     gCvsPrefs.SetPruneOption(m_prune ? true : false);
00356     gCvsPrefs.SetZ9Option(m_tcpip ? true : false);
00357     gCvsPrefs.SetQuietOption(m_quiet ? true : false);
00358     gCvsPrefs.SetAddControl(m_cntladd ? true : false);
00359     gCvsPrefs.SetDirtySupport(m_dirty ? true : false);
00360     gCvsPrefs.SetAlwaysUseCvsroot(m_alwaysroot ? true : false);
00361     gCvsPrefs.SetLogoutTimeOut(m_logout ? (int)m_editlogout : 0);
00362     gCvsPrefs.SetUnixLF(m_unixlf != 0);
00363     gCvsPrefs.SetZLevel(m_zlevel);
00364 }

Member Data Documentation

BOOL CGetPrefs_GLOBALS::m_alwaysroot

Definition at line 115 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS, DoDataExchange, and StoreValues.

BOOL CGetPrefs_GLOBALS::m_checkoutro

Definition at line 109 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS, DoDataExchange, and StoreValues.

BOOL CGetPrefs_GLOBALS::m_cntladd

Definition at line 113 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS, DoDataExchange, and StoreValues.

bool CGetPrefs_GLOBALS::m_didInteract [protected]

Definition at line 132 of file GetPrefs.h.

Referenced by DoDataExchange, and StoreValues.

BOOL CGetPrefs_GLOBALS::m_dirty

Definition at line 114 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS, DoDataExchange, and StoreValues.

UINT CGetPrefs_GLOBALS::m_editlogout

Definition at line 117 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS, DoDataExchange, and StoreValues.

BOOL CGetPrefs_GLOBALS::m_logout

Definition at line 116 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS, DoDataExchange, and StoreValues.

BOOL CGetPrefs_GLOBALS::m_prune

Definition at line 110 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS, DoDataExchange, and StoreValues.

BOOL CGetPrefs_GLOBALS::m_quiet

Definition at line 112 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS, DoDataExchange, and StoreValues.

CSpinButtonCtrl CGetPrefs_GLOBALS::m_spin

Definition at line 108 of file GetPrefs.h.

Referenced by DoDataExchange, and OnInitDialog.

BOOL CGetPrefs_GLOBALS::m_tcpip

Definition at line 111 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS, DoDataExchange, and StoreValues.

BOOL CGetPrefs_GLOBALS::m_unixlf

Definition at line 118 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS, DoDataExchange, and StoreValues.

UINT CGetPrefs_GLOBALS::m_zlevel

Definition at line 119 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS, DoDataExchange, and StoreValues.

CSpinButtonCtrl CGetPrefs_GLOBALS::m_zspin

Definition at line 107 of file GetPrefs.h.

Referenced by DoDataExchange, and OnInitDialog.

The documentation for this class was generated from the following files:
  • common/GetPrefs.h
  • common/GetPrefs.cpp
Generated on Sun Feb 24 01:26:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CGetPrefs_WINCVS Class Reference

#include <GetPrefs.h>

Inheritance diagram for CGetPrefs_WINCVS:

[legend]
Collaboration diagram for CGetPrefs_WINCVS:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_PREFS_WINCVS }

Public Methods

CGetPrefs_WINCVS ()
~CGetPrefs_WINCVS ()
void | StoreValues ()

Public Attributes

CString | m_viewer
CString | m_diffprog
BOOL | m_chkdiff
CString | m_home
BOOL | m_chkUseViewerAlways
BOOL | m_cvschk
CString | m_cvsprog

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnBtnviewer ()
afx_msg void | OnExtdiffsel ()
afx_msg void | OnExtdiff ()
afx_msg void | OnBtnhome ()
afx_msg void | OnAltcvschk ()
afx_msg void | OnAltcvssel ()

Protected Attributes

bool | m_didInteract

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 158 of file GetPrefs.h.

00158 { IDD = IDD_PREFS_WINCVS };

Constructor & Destructor Documentation

CGetPrefs_WINCVS::CGetPrefs_WINCVS ( )

Definition at line 418 of file GetPrefs.cpp.

References m_chkdiff, m_chkUseViewerAlways, m_cvschk, m_cvsprog, m_diffprog, m_home, and m_viewer.

00418                                    : CPropertyPage(CGetPrefs_WINCVS::IDD), m_didInteract(false)
00419 {
00420     UStr cvsPath;
00421     //{{AFX_DATA_INIT(CGetPrefs_WINCVS)
00422     m_viewer = gCvsPrefs.Viewer() != 0L ? gCvsPrefs.Viewer() : "";
00423     m_diffprog = gCvsPrefs.ExtDiff() != 0L ? gCvsPrefs.ExtDiff() : "";
00424     m_chkdiff = gCvsPrefs.ExtDiff() != 0L;
00425     m_home = gCvsPrefs.Home() != 0L ? gCvsPrefs.Home() : "";
00426     m_chkUseViewerAlways = gCvsPrefs.UseViewerAlways() != 0L;
00427     m_cvschk = gCvsPrefs.WhichCvs(cvsPath, true) != 0L;
00428     m_cvsprog = gCvsPrefs.WhichCvs(cvsPath);
00429     //}}AFX_DATA_INIT
00430 }

CGetPrefs_WINCVS::~CGetPrefs_WINCVS ( )

Definition at line 432 of file GetPrefs.cpp.

00433 {
00434 }

Member Function Documentation

void CGetPrefs_WINCVS::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 436 of file GetPrefs.cpp.

References DDV_CheckPathExists, IDC_ALTCVSCHK, IDC_ALTCVSPROG, IDC_DIFFPROG, IDC_EXTDIFF, IDC_HOME, IDC_PROGRAM, IDC_USE_VIEWER_ALWAYS, m_chkdiff, m_chkUseViewerAlways, m_cvschk, m_cvsprog, m_didInteract, m_diffprog, m_home, m_viewer, OnAltcvschk, and OnExtdiff.

00437 {
00438     m_didInteract = true;
00439
00440     CPropertyPage::DoDataExchange(pDX);
00441
00442     //{{AFX_DATA_MAP(CGetPrefs_WINCVS)
00443     DDX_Text(pDX, IDC_PROGRAM, m_viewer);
00444     DDX_Text(pDX, IDC_DIFFPROG, m_diffprog);
00445     DDX_Check(pDX, IDC_EXTDIFF, m_chkdiff);
00446     DDX_Text(pDX, IDC_HOME, m_home);
00447     DDX_Check(pDX, IDC_USE_VIEWER_ALWAYS, m_chkUseViewerAlways);
00448     DDX_Check(pDX, IDC_ALTCVSCHK, m_cvschk);
00449     DDX_Text(pDX, IDC_ALTCVSPROG, m_cvsprog);
00450     //}}AFX_DATA_MAP
00451
00452     DDV_CheckPathExists(pDX, IDC_HOME, m_home);
00453
00454     if( !pDX->m_bSaveAndValidate )
00455     {
00456         OnExtdiff();
00457         OnAltcvschk();
00458     }
00459 }

void CGetPrefs_WINCVS::OnAltcvschk ( ) [protected]

Definition at line 549 of file GetPrefs.cpp.

References IDC_ALTCVSCHK, IDC_ALTCVSPROG, and IDC_ALTCVSSEL.

Referenced by DoDataExchange.

00550 {
00551     CButton* but = (CButton *)GetDlgItem(IDC_ALTCVSCHK);
00552     CWnd* wnd = GetDlgItem(IDC_ALTCVSPROG);
00553     wnd->EnableWindow(but->GetCheck() == 1);
00554     wnd = GetDlgItem(IDC_ALTCVSSEL);
00555     wnd->EnableWindow(but->GetCheck() == 1);
00556 }

void CGetPrefs_WINCVS::OnAltcvssel ( ) [protected]

Definition at line 558 of file GetPrefs.cpp.

References MultiFiles::add, CvsArgs::Argv, BrowserGetMultiFiles, CStr, IDC_ALTCVSPROG, and MultiFiles::next.

00559 {
00560     MultiFiles mf;
00561     if(!BrowserGetMultiFiles("Select a cvs program :", mf, "Executable Files (*.exe)|*.exe|All Files (*.*)|*.*||"))
00562         return;
00563
00564     CvsArgs args(false);
00565     mf.next();
00566     const char *dir = mf.add(args);
00567     char * const *argv = args.Argv();
00568     CStr fullpath;
00569     fullpath = dir;
00570     if(!fullpath.endsWith(kPathDelimiter))
00571         fullpath << kPathDelimiter;
00572     fullpath << argv[0];
00573
00574     SetDlgItemText(IDC_ALTCVSPROG, fullpath);
00575 }

void CGetPrefs_WINCVS::OnBtnhome ( ) [protected]

Definition at line 542 of file GetPrefs.cpp.

References BrowserGetDirectory, IDC_HOME, and NULL.

00543 {
00544     const char *dir = BrowserGetDirectory("Select a directory to be the HOME :");
00545     if(dir != NULL)
00546         SetDlgItemText(IDC_HOME, dir);
00547 }

void CGetPrefs_WINCVS::OnBtnviewer ( ) [protected]

Definition at line 495 of file GetPrefs.cpp.

References MultiFiles::add, CvsArgs::Argv, BrowserGetMultiFiles, CStr, IDC_PROGRAM, and MultiFiles::next.

00496 {
00497     MultiFiles mf;
00498     if(!BrowserGetMultiFiles("Select a program :", mf, "Executable Files (*.exe)|*.exe|All Files (*.*)|*.*||"))
00499         return;
00500
00501     CvsArgs args(false);
00502     mf.next();
00503     const char *dir = mf.add(args);
00504     char * const *argv = args.Argv();
00505     CStr fullpath;
00506     fullpath = dir;
00507     if(!fullpath.endsWith(kPathDelimiter))
00508         fullpath << kPathDelimiter;
00509     fullpath << argv[0];
00510
00511     SetDlgItemText(IDC_PROGRAM, fullpath);
00512 }

void CGetPrefs_WINCVS::OnExtdiff ( ) [protected]

Definition at line 533 of file GetPrefs.cpp.

References IDC_DIFFPROG, IDC_EXTDIFF, and IDC_EXTDIFFSEL.

Referenced by DoDataExchange.

00534 {
00535     CButton* but = (CButton *)GetDlgItem(IDC_EXTDIFF);
00536     CWnd* wnd = GetDlgItem(IDC_DIFFPROG);
00537     wnd->EnableWindow(but->GetCheck() == 1);
00538     wnd = GetDlgItem(IDC_EXTDIFFSEL);
00539     wnd->EnableWindow(but->GetCheck() == 1);
00540 }

void CGetPrefs_WINCVS::OnExtdiffsel ( ) [protected]

Definition at line 514 of file GetPrefs.cpp.

References MultiFiles::add, CvsArgs::Argv, BrowserGetMultiFiles, CStr, IDC_DIFFPROG, and MultiFiles::next.

00515 {
00516     MultiFiles mf;
00517     if(!BrowserGetMultiFiles("Select a diff program :", mf, "Executable Files (*.exe)|*.exe|All Files (*.*)|*.*||"))
00518         return;
00519
00520     CvsArgs args(false);
00521     mf.next();
00522     const char *dir = mf.add(args);
00523     char * const *argv = args.Argv();
00524     CStr fullpath;
00525     fullpath = dir;
00526     if(!fullpath.endsWith(kPathDelimiter))
00527         fullpath << kPathDelimiter;
00528     fullpath << argv[0];
00529
00530     SetDlgItemText(IDC_DIFFPROG, fullpath);
00531 }

void CGetPrefs_WINCVS::StoreValues ( )

Definition at line 461 of file GetPrefs.cpp.

References m_chkdiff, m_chkUseViewerAlways, m_cvschk, m_cvsprog, m_didInteract, m_diffprog, m_home, and m_viewer.

Referenced by CompatGetPrefs.

00462 {
00463     if(!m_didInteract)
00464         return;
00465
00466     if(!m_viewer.IsEmpty())
00467         gCvsPrefs.SetViewer(m_viewer);
00468     else
00469         gCvsPrefs.SetViewer(0L);
00470     if(m_chkdiff && !m_diffprog.IsEmpty())
00471         gCvsPrefs.SetExtDiff(m_diffprog);
00472     else
00473         gCvsPrefs.SetExtDiff(0L);
00474     if(!m_home.IsEmpty())
00475         gCvsPrefs.SetHome(m_home);
00476     gCvsPrefs.SetUseViewerAlways(m_chkUseViewerAlways ? true : false);
00477
00478     if(m_cvschk && !m_cvsprog.IsEmpty())
00479         gCvsPrefs.SetWhichCvs(m_cvsprog);
00480     else
00481         gCvsPrefs.SetWhichCvs("");
00482 }

Member Data Documentation

BOOL CGetPrefs_WINCVS::m_chkdiff

Definition at line 161 of file GetPrefs.h.

Referenced by CGetPrefs_WINCVS, DoDataExchange, and StoreValues.

BOOL CGetPrefs_WINCVS::m_chkUseViewerAlways

Definition at line 163 of file GetPrefs.h.

Referenced by CGetPrefs_WINCVS, DoDataExchange, and StoreValues.

BOOL CGetPrefs_WINCVS::m_cvschk

Definition at line 164 of file GetPrefs.h.

Referenced by CGetPrefs_WINCVS, DoDataExchange, and StoreValues.

CString CGetPrefs_WINCVS::m_cvsprog

Definition at line 165 of file GetPrefs.h.

Referenced by CGetPrefs_WINCVS, DoDataExchange, and StoreValues.

bool CGetPrefs_WINCVS::m_didInteract [protected]

Definition at line 178 of file GetPrefs.h.

Referenced by DoDataExchange, and StoreValues.

CString CGetPrefs_WINCVS::m_diffprog

Definition at line 160 of file GetPrefs.h.

Referenced by CGetPrefs_WINCVS, DoDataExchange, and StoreValues.

CString CGetPrefs_WINCVS::m_home

Definition at line 162 of file GetPrefs.h.

Referenced by CGetPrefs_WINCVS, DoDataExchange, and StoreValues.

CString CGetPrefs_WINCVS::m_viewer

Definition at line 159 of file GetPrefs.h.

Referenced by CGetPrefs_WINCVS, DoDataExchange, and StoreValues.

The documentation for this class was generated from the following files:
  • common/GetPrefs.h
  • common/GetPrefs.cpp
Generated on Sun Feb 24 01:26:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GetValue Class Reference

#include <GetValue.h>

Inheritance diagram for GetValue:

[legend]
Collaboration diagram for GetValue:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_GETVALUE }

Public Methods

GetValue (const char *defvalue, const char *title, CWnd *pParent=NULL)

Public Attributes

CString | m_prompt
CString | m_value

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 50 of file GetValue.h.

00050 { IDD = IDD_GETVALUE };

Constructor & Destructor Documentation

GetValue::GetValue | ( | const char * | defvalue,
 |  | const char * | title,
 |  | CWnd * | pParent = NULL
 | ) |

Definition at line 51 of file GetValue.cpp.

References m_prompt, m_value, and NULL.

00052     : CDialog(GetValue::IDD, pParent)
00053 {
00054     //{{AFX_DATA_INIT(GetValue)
00055     m_value = defvalue != NULL ? defvalue : "";
00056     m_prompt = title != NULL ? title : "";
00057     //}}AFX_DATA_INIT
00058 }

Member Function Documentation

void GetValue::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 70 of file GetValue.cpp.

References DDV_MinChars, IDC_PROMPTEDIT, m_prompt, and m_value.

00071 {
00072     CDialog::DoDataExchange(pDX);
00073
00074     //{{AFX_DATA_MAP(GetValue)
00075     DDX_Text(pDX, IDC_PROMPTVALUE, m_prompt);
00076     DDX_Text(pDX, IDC_PROMPTEDIT, m_value);
00077     DDV_MinChars(pDX, m_value, 1);
00078     //}}AFX_DATA_MAP
00079 }

Member Data Documentation

CString GetValue::m_prompt

Definition at line 51 of file GetValue.h.

Referenced by DoDataExchange, and GetValue.

CString GetValue::m_value

Definition at line 52 of file GetValue.h.

Referenced by CompatGetValue, DoDataExchange, and GetValue.

The documentation for this class was generated from the following files:
  • common/GetValue.h
  • common/GetValue.cpp
Generated on Sun Feb 24 01:26:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CGfxGroupEdit Class Reference

#include <GfxGroupEdit.h>

Inheritance diagram for CGfxGroupEdit:

[legend]
Collaboration diagram for CGfxGroupEdit:

[legend]
List of all members.

Public Methods

CGfxGroupEdit ()
virtual BOOL | PreTranslateMessage (MSG *pMsg)
virtual | ~CGfxGroupEdit ()

Public Attributes

BOOL | bEscapeKey
CString | text
WPARAM | msgSend
bool | bNoDown
int | iIndex

Protected Methods

virtual void | PostNcDestroy ()
afx_msg void | OnKillFocus (CWnd *pNewWnd)
afx_msg int | OnCreate (LPCREATESTRUCT lpCreateStruct)
afx_msg void | OnChar (UINT nChar, UINT nRepCnt, UINT nFlags)

Constructor & Destructor Documentation

CGfxGroupEdit::CGfxGroupEdit ( )

Definition at line 38 of file GfxGroupEdit.cpp.

References bEscapeKey, bNoDown, FALSE, iIndex, msgSend, and NM_OB_ONGROUPENDEDIT.

00039 {
00040     bEscapeKey = FALSE;
00041     iIndex = -1;
00042     msgSend = NM_OB_ONGROUPENDEDIT;
00043     bNoDown = false;
00044 }

CGfxGroupEdit::~CGfxGroupEdit ( ) [virtual]

Definition at line 46 of file GfxGroupEdit.cpp.

00047 {
00048 }

Member Function Documentation

void CGfxGroupEdit::OnChar | ( | UINT | nChar,
 |  | UINT | nRepCnt,
 |  | UINT | nFlags
 | ) | [protected]

Definition at line 103 of file GfxGroupEdit.cpp.

References bEscapeKey, bNoDown, msgSend, NM_OB_ONGROUPENDEDIT, and TRUE.

00104 {
00105     if (msgSend == NM_OB_ONGROUPENDEDIT)
00106     {
00107         CEdit::OnChar(nChar, nRepCnt, nFlags);
00108         return;
00109     }
00110
00111     if (nChar == VK_ESCAPE || nChar == VK_RETURN)
00112     {
00113         if (nChar == VK_ESCAPE) bEscapeKey = TRUE;
00114         GetParent()->SetFocus();
00115         return;
00116     }
00117     CEdit::OnChar(nChar, nRepCnt, nFlags);
00118     CString str;
00119     CRect rect, parentrect;
00120     GetClientRect(&rect);
00121     GetParent()->GetClientRect(&parentrect);
00122     ClientToScreen(&rect);
00123     GetParent()->ScreenToClient(&rect);
00124     GetWindowText(str);
00125     CWindowDC dc(this);
00126     CFont *pFont = GetParent()->GetFont();
00127     CFont *pFontDC = dc.SelectObject(pFont);
00128     CRect szrc(rect);
00129     szrc.bottom = szrc.top;
00130
00131     if (bNoDown == true)
00132     {
00133         dc.DrawText(str, szrc, DT_CALCRECT);
00134         if (szrc.right >= parentrect.right - 1) rect.right = parentrect.right - 1;
00135         else rect.right = szrc.right;
00136         MoveWindow(&rect);
00137         return;
00138     }
00139
00140     dc.DrawText(str, szrc, DT_WORDBREAK|DT_CENTER|DT_CALCRECT);
00141     dc.SelectObject(pFontDC);
00142     CSize size = szrc.Size();
00143
00144     if (size.cx > rect.Width())
00145     {
00146         if (size.cx + rect.left < parentrect.right) rect.right = rect.left + size.cx;
00147         else rect.right = parentrect.right;
00148         MoveWindow(&rect);
00149     }
00150     else if (size.cy > rect.Height())
00151     {
00152         if (size.cy + rect.bottom < parentrect.bottom) rect.bottom = rect.top + size.cy;
00153         else rect.bottom = parentrect.bottom;
00154         MoveWindow(&rect);
00155     }
00156 }

int CGfxGroupEdit::OnCreate ( LPCREATESTRUCT lpCreateStruct ) [protected]

Definition at line 94 of file GfxGroupEdit.cpp.

References TRUE.

00095 {
00096     if (CEdit::OnCreate(lpCreateStruct) == -1)
00097         return -1;
00098
00099     SendMessage(WM_SETFONT,(WPARAM) GetStockObject(DEFAULT_GUI_FONT),MAKELPARAM(TRUE,0));
00100     return 0;
00101 }

void CGfxGroupEdit::OnKillFocus ( CWnd * pNewWnd ) [protected]

Definition at line 62 of file GfxGroupEdit.cpp.

References bEscapeKey, msgSend, text, and WM_OUTBAR_NOTIFY.

00063 {
00064     PostMessage(WM_CLOSE, 0, 0);
00065     if (!bEscapeKey)
00066     {
00067         GetWindowText(text);
00068         if (text != "") GetOwner()->SendMessage(WM_OUTBAR_NOTIFY, msgSend, (LPARAM) this);
00069     }
00070 }

void CGfxGroupEdit::PostNcDestroy ( ) [protected, virtual]

Definition at line 88 of file GfxGroupEdit.cpp.

00089 {
00090     CEdit::PostNcDestroy();
00091     delete this;
00092 }

BOOL CGfxGroupEdit::PreTranslateMessage ( MSG * pMsg ) [virtual]

Definition at line 72 of file GfxGroupEdit.cpp.

References bEscapeKey, and TRUE.

00073 {
00074     if (pMsg->wParam == VK_RETURN)
00075     {
00076         PostMessage(WM_CLOSE, 0, 0);
00077         return TRUE;
00078     }
00079     else if (pMsg->wParam == VK_ESCAPE)
00080     {
00081         PostMessage(WM_CLOSE, 0, 0);
00082         return bEscapeKey = TRUE;
00083     }
00084
00085     return CEdit::PreTranslateMessage(pMsg);
00086 }

Member Data Documentation

BOOL CGfxGroupEdit::bEscapeKey

Definition at line 43 of file GfxGroupEdit.h.

Referenced by CGfxGroupEdit, OnChar, OnKillFocus, and PreTranslateMessage.

bool CGfxGroupEdit::bNoDown

Definition at line 46 of file GfxGroupEdit.h.

Referenced by CGfxGroupEdit, OnChar, and CGfxOutBarCtrl::StartItemEdit.

int CGfxGroupEdit::iIndex

Definition at line 62 of file GfxGroupEdit.h.

Referenced by CGfxGroupEdit, CGfxOutBarCtrl::OnEndLabelEdit, CGfxOutBarCtrl::StartGroupEdit, and CGfxOutBarCtrl::StartItemEdit.

WPARAM CGfxGroupEdit::msgSend

Definition at line 45 of file GfxGroupEdit.h.

Referenced by CGfxGroupEdit, OnChar, OnKillFocus, CGfxOutBarCtrl::StartGroupEdit, and CGfxOutBarCtrl::StartItemEdit.

CString CGfxGroupEdit::text

Definition at line 44 of file GfxGroupEdit.h.

Referenced by CGfxOutBarCtrl::OnEndLabelEdit, and OnKillFocus.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/GfxGroupEdit.h
  • WinCvs/CJLib/CJLibrary/GfxGroupEdit.cpp
Generated on Sun Feb 24 01:26:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CGfxOutBarCtrl Class Reference

#include <GfxOutBarCtrl.h>

Inheritance diagram for CGfxOutBarCtrl:

[legend]
Collaboration diagram for CGfxOutBarCtrl:

[legend]
List of all members.

Public Types

enum {
fSmallIcon = 1 << 0,
fLargeIcon = 1 << 1,
fEditGroups = 1 << 2,
fEditItems = 1 << 3,
fRemoveGroups = 1 << 4,
fRemoveItems = 1 << 5,
fAddGroups = 1 << 6,
fDragItems = 1 << 7,
fAnimation = 1 << 8,
fSelHighlight = 1 << 9
}
enum {
ircIcon = 1,
ircLabel = 2,
ircAll = 3
}
enum {
htNothing = -1,
htFolder,
htItem,
htUpScroll,
htDownScroll
}

Public Methods

CGfxOutBarCtrl ()
virtual void | DrawAnimItem (const int xoffset, const int yoffset, const int index)
virtual void | SetAnimSelHighlight (const int iTime)
virtual DWORD | GetFolderData (int iFolder=-1)
virtual CWnd * | GetFolderChild (int iFolder=-1)
virtual int | AddFolderBar (LPCTSTR pFolder, CWnd *pSon, const DWORD exData=0)
virtual CString | GetItemText (const int index)
virtual void | SetAnimationTickCount (const long value)
virtual long | GetAnimationTickCount ()
virtual void | AnimateFolderScroll (const int iFrom, const int iTo)
virtual int | GetDragItemRect (const int index, CRect &rect)
virtual void | DrawDragArrow (CDC *pDC, const int iFrom, const int iTo)
virtual void | SetItemImage (const int index, const int iImage)
virtual void | SetItemData (const int index, const DWORD dwData)
virtual int | GetItemImage (const int index) const
virtual DWORD | GetItemData (const int index) const
virtual bool | IsValidItem (const int index) const
virtual void | RemoveItem (const int index)
virtual void | SetItemText (const int index, LPCTSTR text)
virtual void | StartItemEdit (const int index)
virtual void | SetFolderText (const int index, LPCTSTR text)
virtual void | StartGroupEdit (const int index)
virtual void | GetLabelRect (const int iFolder, const int iIndex, CRect &rect)
virtual void | GetIconRect (const int iFolder, const int iIndex, CRect &rect)
virtual void | HighlightItem (const int index, const bool bPressed=false)
virtual void | GetVisibleRange (const int iFolder, int &first, int &last)
virtual void | DrawItem (CDC *pDC, const int iFolder, CRect rc, const int index, const bool bOnlyImage=false)
virtual CImageList * | GetFolderImageList (const int index, const bool bSmall) const
virtual CSize | GetItemSize (const int iFolder, const int index, const int type)
virtual void | PaintItems (CDC *pDC, const int iFolder, CRect rc)
virtual CImageList * | GetImageList (CImageList *pImageList, int nImageList)
virtual CImageList * | SetFolderImageList (const int folder, CImageList *pImageList, int nImageList)
virtual CImageList * | SetImageList (CImageList *pImageList, int nImageList)
virtual int | GetCountPerPage () const
virtual void | RemoveFolder (const int index)
virtual int | GetSelFolder () const
virtual int | GetFolderCount () const
virtual void | SetSelFolder (const int index)
virtual int | GetItemCount () const
virtual int | InsertItem (const int folder, const int index, LPCTSTR text, const int image=-1, const DWORD exData=0)
virtual void | HighlightFolder (const int index)
virtual int | HitTestEx (const CPoint &point, int &index)
virtual void | GetInsideRect (CRect &rect) const
virtual int | AddFolder (LPCTSTR cFolderName, const DWORD exData)
virtual void | GetItemRect (const int iFolder, const int iIndex, CRect &rect)
virtual bool | GetFolderRect (const int iIndex, CRect &rect) const
virtual void | ModifyFlag (const DWORD &dwRemove, const DWORD &dwAdd, const UINT redraw=0)
virtual DWORD | GetFlag () const
virtual void | SetSmallIconView (const bool bSet)
virtual bool | IsSmallIconView () const
virtual BOOL | Create (DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID, const DWORD dwFlag=fDragItems|fEditGroups|fEditItems|fRemoveGroups|fRemoveItems|fAddGroups|fAnimation|fSelHighlight)
virtual | ~CGfxOutBarCtrl ()

Public Attributes

COLORREF | crBackGroundColor
COLORREF | crBackGroundColor1
COLORREF | crTextColor
COLORREF | cr3dFace
COLORREF | crLightBorder
COLORREF | crHilightBorder
COLORREF | crShadowBorder
COLORREF | crDkShadowBorder
int | iFolderHeight
int | xSmallIconLabelOffset
int | yLargeIconLabelOffset
int | ySmallIconSpacing
int | yLargeIconSpacing
int | xLeftMargin
int | yTopMargin
bool | bUpArrow
bool | bDownArrow
bool | bUpPressed
bool | bDownPressed
CRect | rcUpArrow
CRect | rcDownArrow
bool | bLooping
int | iHitInternal1
int | iHitInternal2
long | lAnimationTickCount
int | iLastSel
int | iSelAnimTiming
int | iSelAnimCount
DWORD | dwFlags
CPtrArray | arFolder
int | iLastFolderHighlighted
int | iLastSelectedFolder
int | iFirstItem
int | iLastItemHighlighted
bool | bPressedHighlight
int | iLastDragItemDraw
int | iLastDragItemDrawType
int | iSelFolder
CImageList * | pLargeImageList
CImageList * | pSmallImageList
HCURSOR | hHandCursor
HCURSOR | hDragCursor
HCURSOR | hNoDragCursor
CPen * | pBlackPen
CCJMenu m_popupMenu
CString | m_strRemoveItem
CString | m_strRenameItem

Protected Methods

void | DrawFolder (CDC *pDC, const int iIdx, CRect rect, const bool bSelected)
afx_msg int | OnCreate (LPCREATESTRUCT lpCreateStruct)
afx_msg void | OnTimer (UINT nIDEvent)
afx_msg void | OnPaint ()
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)
afx_msg void | OnMouseMove (UINT nFlags, CPoint point)
afx_msg void | OnLButtonDown (UINT nFlags, CPoint point)
afx_msg BOOL | OnSetCursor (CWnd *pWnd, UINT nHitTest, UINT message)
afx_msg void | OnSize (UINT nType, int cx, int cy)
afx_msg void | OnRButtonDown (UINT nFlags, CPoint point)
afx_msg void | OnGfxLargeicon ()
afx_msg void | OnUpdateGfxLargeicon (CCmdUI *pCmdUI)
afx_msg void | OnGfxSmallicon ()
afx_msg void | OnUpdateGfxSmallicon (CCmdUI *pCmdUI)
afx_msg void | OnGfxRemoveitem ()
afx_msg void | OnUpdateGfxRemoveitem (CCmdUI *pCmdUI)
afx_msg void | OnGfxRenameitem ()
afx_msg void | OnUpdateGfxRenameitem (CCmdUI *pCmdUI)
afx_msg void | OnSysColorChange ()
afx_msg long | OnEndLabelEdit (WPARAM wParam, LPARAM lParam)

Member Enumeration Documentation

anonymous enum

Enumeration values:
fSmallIcon
fLargeIcon
fEditGroups
fEditItems
fRemoveGroups
fRemoveItems
fAddGroups
fDragItems
fAnimation
fSelHighlight

Definition at line 66 of file GfxOutBarCtrl.h.

00066          {  fSmallIcon = 1 << 0, fLargeIcon = 1 << 1, fEditGroups = 1 << 2, fEditItems = 1 << 3,
00067             fRemoveGroups = 1 << 4, fRemoveItems = 1 << 5, fAddGroups = 1 << 6,
00068             fDragItems = 1 << 7, fAnimation = 1 << 8, fSelHighlight = 1 << 9 };

anonymous enum

Enumeration values:
ircIcon
ircLabel
ircAll

Definition at line 70 of file GfxOutBarCtrl.h.

00070 { ircIcon = 1, ircLabel = 2, ircAll = 3 };

anonymous enum

Enumeration values:
htNothing
htFolder
htItem
htUpScroll
htDownScroll

Definition at line 150 of file GfxOutBarCtrl.h.

00150 { htNothing = -1, htFolder, htItem, htUpScroll, htDownScroll};

Constructor & Destructor Documentation

CGfxOutBarCtrl::CGfxOutBarCtrl ( )

Definition at line 53 of file GfxOutBarCtrl.cpp.

References bDownArrow, bDownPressed, bLooping, bPressedHighlight, bUpArrow, bUpPressed, cr3dFace, crBackGroundColor, crBackGroundColor1, crDkShadowBorder, crHilightBorder, crLightBorder, crShadowBorder, crTextColor, dwFlags, fAddGroups, fAnimation, fDragItems, fEditGroups, fEditItems, fRemoveGroups, fRemoveItems, fSelHighlight, hDragCursor, hHandCursor, hNoDragCursor, IDC_DRAGGING, IDC_HANDCUR, IDC_NODRAGGING, IDS_REMOVEITEM, IDS_RENAMEITEM, iFirstItem, iFolderHeight, iLastDragItemDraw, iLastFolderHighlighted, iLastItemHighlighted, iLastSel, iLastSelectedFolder, iSelAnimCount, iSelAnimTiming, iSelFolder, lAnimationTickCount, m_strRemoveItem, m_strRenameItem, NULL, pBlackPen, pLargeImageList, pSmallImageList, rcDownArrow, rcUpArrow, xLeftMargin, xSmallIconLabelOffset, yLargeIconLabelOffset, yLargeIconSpacing, ySmallIconSpacing, and yTopMargin.

00054 {
00055     crBackGroundColor   = ::GetSysColor(COLOR_3DSHADOW);//RGB(0,128,128);//
00056     crBackGroundColor1  = ::GetSysColor(COLOR_3DSHADOW);
00057     crTextColor         = ::GetSysColor(COLOR_WINDOW);
00058     cr3dFace            = ::GetSysColor(COLOR_3DFACE);
00059     crLightBorder       = ::GetSysColor(COLOR_3DLIGHT);
00060     crHilightBorder     = ::GetSysColor(COLOR_3DHILIGHT);
00061     crShadowBorder      = ::GetSysColor(COLOR_3DSHADOW);
00062     crDkShadowBorder    = ::GetSysColor(COLOR_3DDKSHADOW);
00063
00064     pBlackPen = new CPen(PS_SOLID, 1, RGB(0,0,0));
00065
00066     iFolderHeight = 22;
00067
00068     dwFlags = fDragItems|fEditGroups|fEditItems|fRemoveGroups|fRemoveItems|fAddGroups|fAnimation|fSelHighlight;
00069
00070     iSelFolder = 0;
00071
00072     iLastFolderHighlighted = -1;
00073     iLastSelectedFolder = -1;
00074
00075     pLargeImageList = NULL;
00076     pSmallImageList = NULL;
00077
00078     iFirstItem = 0;
00079
00080     xSmallIconLabelOffset = 4;
00081     yLargeIconLabelOffset = 3;
00082
00083     ySmallIconSpacing = 10;
00084     yLargeIconSpacing = 8;
00085
00086     xLeftMargin = 5;
00087     yTopMargin = 5;
00088
00089     bUpArrow = bDownArrow = false;
00090
00091     hHandCursor = AfxGetApp()->LoadCursor(IDC_HANDCUR);
00092     rcUpArrow = rcDownArrow = CRect(0,0,0,0);
00093
00094     bUpPressed = bDownPressed = false;
00095
00096     bLooping = false;
00097
00098     iLastItemHighlighted = -1;
00099     bPressedHighlight = false;
00100
00101     iLastDragItemDraw = -1;
00102
00103     lAnimationTickCount = 10;
00104
00105     hDragCursor = AfxGetApp()->LoadCursor(IDC_DRAGGING);
00106     hNoDragCursor = AfxGetApp()->LoadCursor(IDC_NODRAGGING);
00107
00108     iLastSel = -1;
00109     iSelAnimCount = 0;
00110
00111     iSelAnimTiming = 0;
00112
00113     m_strRemoveItem.LoadString(IDS_REMOVEITEM);
00114     m_strRenameItem.LoadString(IDS_RENAMEITEM);
00115 }

CGfxOutBarCtrl::~CGfxOutBarCtrl ( ) [virtual]

Definition at line 117 of file GfxOutBarCtrl.cpp.

References arFolder, and pBlackPen.

00118 {
00119     for (int t = 0; t < arFolder.GetSize(); t++)
00120     {
00121         if (arFolder.GetAt(t)) delete (CBarFolder*) arFolder.GetAt(t);
00122     }
00123
00124     arFolder.RemoveAll();
00125
00126     delete pBlackPen;
00127 }

Member Function Documentation

int CGfxOutBarCtrl::AddFolder | ( | LPCTSTR | cFolderName,
 |  | const DWORD | exData
 | ) | [virtual]

Definition at line 590 of file GfxOutBarCtrl.cpp.

References arFolder, and ASSERT.

00591 {
00592     CBarFolder* pbf = new CBarFolder(cFolderName, exData);
00593
00594     ASSERT(pbf);
00595
00596     arFolder.Add((void *)pbf);
00597
00598     return arFolder.GetSize() - 1;
00599 }

int CGfxOutBarCtrl::AddFolderBar | ( | LPCTSTR | pFolder,
 |  | CWnd * | pSon,
 |  | const DWORD | exData = 0
 | ) | [virtual]

Definition at line 2307 of file GfxOutBarCtrl.cpp.

References arFolder, and ASSERT.

02308 {
02309     CBarFolder* pbf = new CBarFolder( pFolder, exData );
02310
02311     ASSERT( pbf );
02312
02313     pbf->pChild = pSon;
02314
02315     arFolder.Add((void*) pbf);
02316
02317     return arFolder.GetSize() - 1;
02318 }

void CGfxOutBarCtrl::AnimateFolderScroll | ( | const int | iFrom,
 |  | const int | iTo
 | ) | [virtual]

Definition at line 2166 of file GfxOutBarCtrl.cpp.

References ASSERT, crBackGroundColor, DrawFolder, GetFolderChild, GetFolderCount, GetFolderRect, GetInsideRect, lAnimationTickCount, and PaintItems.

Referenced by SetSelFolder.

02167 {
02168     ASSERT(iFrom >= 0 && iFrom < GetFolderCount());
02169     ASSERT(iTo >= 0 && iTo < GetFolderCount());
02170
02171     CRect rc, rc1, frc, frc1;
02172     GetInsideRect(rc);
02173     rc1.SetRect(0,0,rc.Width(),rc.Height());
02174     GetFolderRect(iTo, frc);
02175     frc1 = frc;
02176
02177     CClientDC dc(this);
02178     CDC memDC;
02179     memDC.CreateCompatibleDC(&dc);
02180     CBitmap bmpFrom, bmpTo;
02181     bmpFrom.CreateCompatibleBitmap(&dc, rc1.Width(), rc1.Height() + frc.Height() * 2);
02182     bmpTo.CreateCompatibleBitmap(&dc, rc1.Width(), rc1.Height() + frc.Height() * 2);
02183     CDC * pDC = &memDC;
02184
02185     CWnd * pWnd1 = GetFolderChild(iFrom);
02186     CWnd * pWnd2 = GetFolderChild(iTo);
02187
02188     CBitmap * obmp = pDC->SelectObject(&bmpFrom);
02189     if (iTo > iFrom)
02190     {
02191         rc1.bottom += frc.Height() * 2;
02192         pDC->FillSolidRect(rc1, crBackGroundColor);
02193         if (pWnd1)
02194         {
02195             BOOL bPrev = pWnd1->ShowWindow(SW_SHOW);
02196             pWnd1->SendMessage(WM_ERASEBKGND, (WPARAM) pDC->GetSafeHdc(), (LPARAM) 0);
02197             pWnd1->SendMessage(WM_PAINT, (WPARAM) pDC->GetSafeHdc(), (LPARAM) 0);
02198             if (!bPrev) pWnd1->ShowWindow(SW_HIDE);
02199         }
02200         else PaintItems(pDC, iFrom, rc1);
02201
02202         pDC->SelectObject(&bmpTo);
02203         frc.SetRect(0,0,frc.Width(),frc.Height());
02204         rc1.SetRect(0,frc.Height(),rc.Width(), rc.Height()+frc.Height() * 2);
02205         pDC->FillSolidRect(rc1, crBackGroundColor);
02206
02207         if (pWnd2)
02208         {
02209             CPoint ovpt = pDC->SetViewportOrg(0, frc.Height());
02210             BOOL bPrev = pWnd2->ShowWindow(SW_SHOW);
02211             pWnd2->SendMessage(WM_ERASEBKGND, (WPARAM) pDC->GetSafeHdc(), (LPARAM) 0);
02212             pWnd2->SendMessage(WM_PAINT, (WPARAM) pDC->GetSafeHdc(), (LPARAM) 0);
02213             if (!bPrev) pWnd2->ShowWindow(SW_HIDE);
02214             pDC->SetViewportOrg(ovpt);
02215         }
02216         else PaintItems(pDC, iTo, rc1);
02217         DrawFolder(pDC, iTo, frc, false);
02218     }
02219     else
02220     {
02221         frc.SetRect(0,0,frc.Width(),frc.Height());
02222         rc1.top += frc.Height();
02223         rc1.bottom += frc.Height() * 2;
02224         pDC->FillSolidRect(rc1, crBackGroundColor);
02225         if (pWnd1)
02226         {
02227             CPoint ovpt = pDC->SetViewportOrg(0, frc.Height());
02228             BOOL bPrev = pWnd1->ShowWindow(SW_SHOW);
02229             pWnd1->SendMessage(WM_ERASEBKGND, (WPARAM) pDC->GetSafeHdc(), (LPARAM) 0);
02230             pWnd1->SendMessage(WM_PAINT, (WPARAM) pDC->GetSafeHdc(), (LPARAM) 0);
02231             if (!bPrev) pWnd1->ShowWindow(SW_HIDE);
02232             pDC->SetViewportOrg(ovpt);
02233         }
02234         else PaintItems(pDC, iFrom, rc1);
02235
02236         DrawFolder(pDC, iFrom, frc, false);
02237
02238         pDC->SelectObject(&bmpTo);
02239         rc1.SetRect(0,0,rc.Width(), rc.Height() + frc.Height() * 2);
02240         pDC->FillSolidRect(rc1, crBackGroundColor);
02241
02242         if (pWnd2)
02243         {
02244             BOOL bPrev = pWnd2->ShowWindow(SW_SHOW);
02245             pWnd2->SendMessage(WM_ERASEBKGND, (WPARAM) pDC->GetSafeHdc(), (LPARAM) 0);
02246             pWnd2->SendMessage(WM_PAINT, (WPARAM) pDC->GetSafeHdc(), (LPARAM) 0);
02247             if (!bPrev) pWnd2->ShowWindow(SW_HIDE);
02248         }
02249         else PaintItems(pDC, iTo, rc1);
02250     }
02251
02252     if (iTo > iFrom)
02253     {
02254         CRect rcFrom, rcTo;
02255         GetFolderRect(iFrom, rcFrom);
02256         GetFolderRect(iTo, rcTo);
02257         int fh = rcFrom.Height();
02258         for (int y = rcTo.top - fh; y > rcFrom.bottom; y -= fh)
02259         {
02260             pDC->SelectObject(&bmpFrom);
02261             dc.BitBlt(rc.left, rcFrom.bottom + 1, rc.Width(), y - rcFrom.bottom - 1, pDC, 0,fh, SRCCOPY);
02262             pDC->SelectObject(&bmpTo);
02263             dc.BitBlt(rc.left, y, rc.Width(), rc.bottom - y + fh, pDC, 0,0, SRCCOPY);
02264             Sleep(lAnimationTickCount);
02265         }
02266     }
02267     else
02268     {
02269         CRect rcFrom, rcTo;
02270         GetFolderRect(iFrom, rcFrom);
02271         int fh = rcFrom.Height();
02272         rcTo.SetRect(rc.left, rc.bottom, rc.right, rc.bottom - fh);
02273         for (int y = rcFrom.top + 1; y < rcTo.top - fh; y += fh)
02274         {
02275             pDC->SelectObject(&bmpTo);
02276             dc.BitBlt(rc.left, rcFrom.top, rc.Width(), y - rcFrom.top - 1, pDC, 0, fh*2, SRCCOPY);
02277             pDC->SelectObject(&bmpFrom);
02278             dc.BitBlt(rc.left, y, rc.Width(), rc.bottom - y, pDC, 0,0, SRCCOPY);
02279             Sleep(lAnimationTickCount);
02280         }
02281     }
02282
02283     pDC->SelectObject(obmp);
02284     // fix potential resource leak - KStowell - 10-21-99
02285     memDC.DeleteDC();
02286     bmpFrom.DeleteObject();
02287     bmpTo.DeleteObject();
02288 }

BOOL CGfxOutBarCtrl::Create | ( | DWORD | dwStyle,
 |  | const RECT & | rect,
 |  | CWnd * | pParentWnd,
 |  | UINT | nID,
 |  | const DWORD | dwFlag = fDragItems|fEditGroups|fEditItems|fRemoveGroups|fRemoveItems|fAddGroups|fAnimation|fSelHighlight
 | ) | [virtual]

Definition at line 233 of file GfxOutBarCtrl.cpp.

References dwFlags, and NULL.

00234 {
00235     dwFlags = dwFlag;
00236     return CWnd::CreateEx(WS_EX_STATICEDGE, NULL, NULL, dwStyle|WS_CHILD, rect, pParentWnd, nID);
00237     //GFXOUTBARCTRL_CLASSNAME
00238 }

void CGfxOutBarCtrl::DrawAnimItem | ( | const int | xoffset,
 |  | const int | yoffset,
 |  | const int | index
 | ) | [virtual]

Definition at line 331 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, crBackGroundColor, GetFolderCount, GetFolderImageList, GetInsideRect, GetItemCount, GetItemRect, iFirstItem, iLastSel, iSelFolder, and IsSmallIconView.

Referenced by OnLButtonDown, and OnTimer.

00332 {
00333     CImageList * ima = GetFolderImageList(iSelFolder, IsSmallIconView());
00334
00335     CRect rc, irc;
00336     GetInsideRect(irc);
00337     GetItemRect(iSelFolder, iLastSel, rc);
00338
00339     if (iLastSel >= iFirstItem && irc.bottom > rc.bottom && irc.top < rc.top)
00340     {
00341         ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
00342         CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
00343
00344         ASSERT(index >= 0 && index < pbf->GetItemCount());
00345         CBarItem * pi = (CBarItem *) pbf->arItems.GetAt(index);
00346
00347         ASSERT(pi && ima);
00348
00349         CClientDC dc(this);
00350
00351         if (IsSmallIconView())
00352         {
00353             if (ima)
00354             {
00355                 IMAGEINFO ii;
00356                 ima->GetImageInfo(pi->iImageIndex, &ii);
00357                 CSize szImage = CRect(ii.rcImage).Size();
00358                 CPoint pt;
00359                 pt.x = rc.left + 2;
00360                 pt.y = rc.top + (rc.Height() - szImage.cy) / 2;
00361
00362                 CRect rcBck(pt.x-1, pt.y-1, pt.x + szImage.cx+2, pt.y + szImage.cy+2);
00363                 dc.FillSolidRect(rcBck, crBackGroundColor);
00364
00365                 pt.x += xoffset;
00366                 pt.y += yoffset;
00367
00368                 ima->Draw(&dc, pi->iImageIndex, pt, ILD_NORMAL);
00369
00370             }
00371         }
00372         else
00373         {
00374             if (ima)
00375             {
00376                 IMAGEINFO ii;
00377                 ima->GetImageInfo(pi->iImageIndex, &ii);
00378                 CSize szImage = CRect(ii.rcImage).Size();
00379                 CPoint pt;
00380                 pt.x = rc.left + (rc.Width() - szImage.cx) / 2;
00381                 pt.y = rc.top;
00382
00383                 CRect rcBck(pt.x-1, pt.y-1, pt.x + szImage.cx+2, pt.y + szImage.cy+2);
00384                 dc.FillSolidRect(rcBck, crBackGroundColor);
00385
00386                 pt.x += xoffset;
00387                 pt.y += yoffset;
00388
00389                 ima->Draw(&dc, pi->iImageIndex, pt, ILD_NORMAL);
00390             }
00391         }
00392     }
00393 }

void CGfxOutBarCtrl::DrawDragArrow | ( | CDC * | pDC,
 |  | const int | iFrom,
 |  | const int | iTo
 | ) | [virtual]

Definition at line 2058 of file GfxOutBarCtrl.cpp.

References GetDragItemRect, iLastDragItemDraw, iLastDragItemDrawType, and pBlackPen.

Referenced by OnLButtonDown.

02059 {
02060     if (iTo == iLastDragItemDraw) return;
02061     CRect rc1;
02062     if (iLastDragItemDraw >= 0)
02063     {
02064         GetDragItemRect(iLastDragItemDraw, rc1);
02065         if (iLastDragItemDrawType == 0) rc1.bottom = rc1.top + 5;
02066         else if (iLastDragItemDrawType == 1) { rc1.top -= 4; rc1.bottom = rc1.top + 9; }
02067         else if (iLastDragItemDrawType == 2) { rc1.top -= 4; rc1.bottom = rc1.top + 5; }
02068         InvalidateRect(rc1, true);
02069         UpdateWindow();
02070     }
02071     iLastDragItemDraw = iTo;
02072
02073     if (iLastDragItemDraw >= 0)
02074     {
02075         iLastDragItemDrawType = GetDragItemRect(iLastDragItemDraw, rc1);
02076
02077         CPen * op = pDC->SelectObject(pBlackPen);
02078
02079         pDC->MoveTo(rc1.left, rc1.top);
02080         pDC->LineTo(rc1.right, rc1.top);
02081
02082         if (iLastDragItemDrawType != 2)
02083         {
02084             pDC->MoveTo(rc1.left, rc1.top+1);
02085             pDC->LineTo(rc1.left + 7, rc1.top+1);
02086             pDC->MoveTo(rc1.left, rc1.top+2);
02087             pDC->LineTo(rc1.left + 5, rc1.top+2);
02088             pDC->MoveTo(rc1.left, rc1.top+3);
02089             pDC->LineTo(rc1.left + 3, rc1.top+3);
02090             pDC->MoveTo(rc1.left, rc1.top+4);
02091             pDC->LineTo(rc1.left + 1, rc1.top+4);
02092
02093             pDC->MoveTo(rc1.right-1, rc1.top+1);
02094             pDC->LineTo(rc1.right - 7, rc1.top+1);
02095             pDC->MoveTo(rc1.right-1, rc1.top+2);
02096             pDC->LineTo(rc1.right - 5, rc1.top+2);
02097             pDC->MoveTo(rc1.right-1, rc1.top+3);
02098             pDC->LineTo(rc1.right - 3, rc1.top+3);
02099         }
02100         if (iLastDragItemDrawType != 0)
02101         {
02102             pDC->MoveTo(rc1.left, rc1.top-1);
02103             pDC->LineTo(rc1.left + 7, rc1.top-1);
02104             pDC->MoveTo(rc1.left, rc1.top-2);
02105             pDC->LineTo(rc1.left + 5, rc1.top-2);
02106             pDC->MoveTo(rc1.left, rc1.top-3);
02107             pDC->LineTo(rc1.left + 3, rc1.top-3);
02108             pDC->MoveTo(rc1.left, rc1.top-4);
02109             pDC->LineTo(rc1.left + 1, rc1.top-4);
02110
02111             pDC->MoveTo(rc1.right-1, rc1.top-1);
02112             pDC->LineTo(rc1.right - 7, rc1.top-1);
02113             pDC->MoveTo(rc1.right-1, rc1.top-2);
02114             pDC->LineTo(rc1.right - 5, rc1.top-2);
02115             pDC->MoveTo(rc1.right-1, rc1.top-3);
02116             pDC->LineTo(rc1.right - 3, rc1.top-3);
02117             pDC->MoveTo(rc1.right-1, rc1.top-4);
02118             pDC->LineTo(rc1.right - 1, rc1.top-4);
02119         }
02120
02121         pDC->SelectObject(op);
02122     }
02123 }

void CGfxOutBarCtrl::DrawFolder | ( | CDC * | pDC,
 |  | const int | iIdx,
 |  | CRect | rect,
 |  | const bool | bSelected
 | ) | [protected]

Definition at line 536 of file GfxOutBarCtrl.cpp.

References arFolder, cr3dFace, crBackGroundColor1, crDkShadowBorder, and crHilightBorder.

Referenced by AnimateFolderScroll, OnLButtonDown, and OnPaint.

00537 {
00538     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iIdx);
00539
00540     if (!bSelected)
00541     {
00542         CPen pn1(PS_SOLID, 1, crBackGroundColor1);
00543         CPen * op = pDC->SelectObject(&pn1);
00544         pDC->MoveTo(rect.left, rect.top);
00545         pDC->LineTo(rect.right, rect.top);
00546         pDC->SelectObject(op);
00547
00548         // fix potential resource leak - KStowell - 10-21-99
00549         pn1.DeleteObject();
00550
00551         rect.top ++;
00552
00553         pDC->Draw3dRect(rect, crHilightBorder, crBackGroundColor1);
00554         rect.InflateRect(-1,-1);
00555         pDC->FillSolidRect(rect, cr3dFace);
00556         int obk = pDC->SetBkMode(TRANSPARENT);
00557         CFont * of = pDC->SelectObject(CFont::FromHandle((HFONT)GetStockObject(DEFAULT_GUI_FONT)));
00558         pDC->DrawText(CString(pbf->cName), rect, DT_CENTER|DT_VCENTER|DT_SINGLELINE);
00559         pDC->SetBkMode(obk);
00560         pDC->SelectObject(of);
00561     }
00562     else
00563     {
00564         CPen pn1(PS_SOLID, 1, crBackGroundColor1);
00565         CPen * op = pDC->SelectObject(&pn1);
00566         pDC->MoveTo(rect.left+1, rect.top);
00567         pDC->LineTo(rect.right, rect.top);
00568         pDC->SelectObject(op);
00569
00570         // fix potential resource leak - KStowell - 10-21-99
00571         pn1.DeleteObject();
00572
00573         rect.top ++;
00574
00575         pDC->Draw3dRect(rect, crDkShadowBorder, crHilightBorder);
00576         rect.InflateRect(-1,-1);
00577         pDC->Draw3dRect(rect, crBackGroundColor1, cr3dFace);
00578         rect.InflateRect(-1,-1);
00579
00580         pDC->FillSolidRect(rect, cr3dFace);
00581
00582         int obk = pDC->SetBkMode(TRANSPARENT);
00583         CFont * of = pDC->SelectObject(CFont::FromHandle((HFONT)GetStockObject(DEFAULT_GUI_FONT)));
00584         pDC->DrawText(CString(pbf->cName), rect, DT_CENTER|DT_VCENTER|DT_SINGLELINE);
00585         pDC->SetBkMode(obk);
00586         pDC->SelectObject(of);
00587     }
00588 }

void CGfxOutBarCtrl::DrawItem | ( | CDC * | pDC,
 |  | const int | iFolder,
 |  | CRect | rc,
 |  | const int | index,
 |  | const bool | bOnlyImage = false
 | ) | [virtual]

Definition at line 1569 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, cr3dFace, crDkShadowBorder, crTextColor, dwFlags, fSelHighlight, GetFolderCount, GetFolderImageList, GetIconRect, GetItemCount, iLastSel, iSelFolder, IsSmallIconView, xSmallIconLabelOffset, and yLargeIconLabelOffset.

Referenced by PaintItems.

01570 {
01571     CImageList * ima = GetFolderImageList(iFolder, IsSmallIconView());
01572
01573     ASSERT(iFolder >= 0 && iFolder < GetFolderCount());
01574     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iFolder);
01575
01576     ASSERT(index >= 0 && index < pbf->GetItemCount());
01577     CBarItem * pi = (CBarItem *) pbf->arItems.GetAt(index);
01578
01579     ASSERT(pi && ima);
01580
01581     CFont * oft = (CFont *) pDC->SelectObject(CFont::FromHandle((HFONT)GetStockObject(DEFAULT_GUI_FONT)));
01582     COLORREF ocr = pDC->SetTextColor(crTextColor);
01583     int obk = pDC->SetBkMode(TRANSPARENT);
01584
01585     if (IsSmallIconView())
01586     {
01587         if (ima)
01588         {
01589             IMAGEINFO ii;
01590             ima->GetImageInfo(pi->iImageIndex, &ii);
01591             CSize szImage = CRect(ii.rcImage).Size();
01592             CPoint pt;
01593             pt.x = rc.left + 2;
01594             pt.y = rc.top + (rc.Height() - szImage.cy) / 2;
01595             ima->Draw(pDC, pi->iImageIndex, pt, ILD_NORMAL);
01596
01597             if (!bOnlyImage)
01598             {
01599                 rc.left += szImage.cx + xSmallIconLabelOffset;
01600                 pDC->TextOut(rc.left, rc.top, CString(pi->cItem));
01601             }
01602
01603         }
01604     }
01605     else
01606     {
01607         if (ima)
01608         {
01609             IMAGEINFO ii;
01610             ima->GetImageInfo(pi->iImageIndex, &ii);
01611             CSize szImage = CRect(ii.rcImage).Size();
01612             CPoint pt;
01613             pt.x = rc.left + (rc.Width() - szImage.cx) / 2;
01614             pt.y = rc.top;// + (rc.Height() - szImage.cy) / 2;
01615             ima->Draw(pDC, pi->iImageIndex, pt, ILD_NORMAL);
01616             if (!bOnlyImage)
01617             {
01618                 rc.top += szImage.cy + yLargeIconLabelOffset;
01619                 pDC->DrawText(pi->cItem, lstrlen(pi->cItem), rc, DT_CENTER|DT_WORDBREAK);
01620             }
01621         }
01622     }
01623
01624     if (dwFlags&fSelHighlight && iLastSel == index && iLastSel >= 0)
01625     {
01626         CRect rc;
01627         GetIconRect(iSelFolder, iLastSel, rc);
01628         rc.InflateRect(1,1);
01629         pDC->Draw3dRect(rc, crDkShadowBorder, cr3dFace);
01630     }
01631
01632     pDC->SetTextColor(ocr);
01633     pDC->SelectObject(oft);
01634     pDC->SetBkMode(obk);
01635
01636 }

virtual long CGfxOutBarCtrl::GetAnimationTickCount ( ) [inline, virtual]

Definition at line 166 of file GfxOutBarCtrl.h.

00166 { return lAnimationTickCount; };

int CGfxOutBarCtrl::GetCountPerPage ( ) const [virtual]

Definition at line 1398 of file GfxOutBarCtrl.cpp.

01399 {
01400     return 0;
01401 }

int CGfxOutBarCtrl::GetDragItemRect | ( | const int | index,
 |  | CRect & | rect
 | ) | [virtual]

Definition at line 2125 of file GfxOutBarCtrl.cpp.

References GetInsideRect, GetItemCount, GetItemRect, iSelFolder, and IsSmallIconView.

Referenced by DrawDragArrow.

02126 {
02127     CRect rc, crc;
02128     GetInsideRect(crc);
02129     crc.InflateRect(-2, 0);
02130
02131     GetItemRect(iSelFolder, index < GetItemCount() ? index : index - 1, rc);
02132     int line = 0;
02133     if (index < GetItemCount())
02134     {
02135         line = rc.top - 4;
02136     }
02137     else
02138     {
02139         line = rc.bottom + 6;
02140     }
02141     int tpe;
02142     if (index == 0)
02143     {
02144         rect.SetRect(crc.left, line+2, crc.right, line + 7);
02145         tpe = 0;
02146     }
02147     else if (index < GetItemCount())
02148     {
02149         rect.SetRect(crc.left, line - 9, crc.right, line);
02150         tpe = 1;
02151         if (IsSmallIconView())
02152         {
02153             rect.top += 8;
02154             rect.bottom += 8;
02155         }
02156     }
02157     else
02158     {
02159         rect.SetRect(crc.left, line, crc.right, line + 5);
02160         tpe = 2;
02161     }
02162     return tpe;
02163 }

DWORD CGfxOutBarCtrl::GetFlag ( ) const [virtual]

Definition at line 271 of file GfxOutBarCtrl.cpp.

References dwFlags.

00272 {
00273     return dwFlags;
00274 }

CWnd * CGfxOutBarCtrl::GetFolderChild ( int iFolder = -1 ) [virtual]

Definition at line 2320 of file GfxOutBarCtrl.cpp.

References arFolder, GetFolderCount, iSelFolder, and NULL.

Referenced by AnimateFolderScroll, OnPaint, OnSize, and SetSelFolder.

02321 {
02322     if (GetFolderCount())
02323     {
02324         if (iFolder < 0) iFolder = iSelFolder;
02325
02326         CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iFolder);
02327         return pbf->pChild;
02328     }
02329     return NULL;
02330 }

int CGfxOutBarCtrl::GetFolderCount ( ) const [virtual]

Definition at line 1353 of file GfxOutBarCtrl.cpp.

References arFolder.

Referenced by AnimateFolderScroll, DrawAnimItem, DrawItem, GetFolderChild, GetFolderImageList, GetItemCount, GetItemData, GetItemImage, GetItemSize, GetItemText, InsertItem, IsValidItem, OnSize, PaintItems, RemoveFolder, RemoveItem, SetFolderImageList, SetFolderText, SetItemData, SetItemImage, SetItemText, SetSelFolder, StartGroupEdit, and StartItemEdit.

01354 {
01355     return arFolder.GetSize();
01356 }

DWORD CGfxOutBarCtrl::GetFolderData ( int iFolder = -1 ) [virtual]

Definition at line 2332 of file GfxOutBarCtrl.cpp.

References arFolder, and iSelFolder.

02333 {
02334     if (iFolder < 0) iFolder = iSelFolder;
02335     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iFolder);
02336     return pbf->dwData;
02337 }

CImageList * CGfxOutBarCtrl::GetFolderImageList | ( | const int | index,
 |  | const bool | bSmall
 | ) | const [virtual]

Definition at line 1558 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, GetFolderCount, pLargeImageList, and pSmallImageList.

Referenced by DrawAnimItem, DrawItem, and GetItemSize.

01559 {
01560     ASSERT(index >= 0 && index < GetFolderCount());
01561     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(index);
01562     if (bSmall)
01563     {
01564         if (pbf->pSmallImageList) return pbf->pSmallImageList; else return pSmallImageList;
01565     }
01566     if (pbf->pLargeImageList) return pbf->pLargeImageList; else return pLargeImageList;
01567 }

bool CGfxOutBarCtrl::GetFolderRect | ( | const int | iIndex,
 |  | CRect & | rect
 | ) | const [virtual]

Definition at line 477 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, iFolderHeight, and iSelFolder.

Referenced by AnimateFolderScroll, HighlightFolder, HitTestEx, OnEndLabelEdit, OnLButtonDown, OnPaint, and StartGroupEdit.

00478 {
00479     int max = arFolder.GetSize();
00480     ASSERT(iIndex >= 0 && iIndex < max);
00481
00482     if (iIndex >= 0 && iIndex < max)
00483     {
00484         CRect rc;
00485         GetClientRect(rc);
00486         if (iIndex > iSelFolder)
00487             rect.SetRect(rc.left, rc.bottom - ((max - iIndex)) * iFolderHeight, rc.right,
00488             rc.bottom - (max - iIndex - 1) * iFolderHeight);
00489         else
00490             rect.SetRect(rc.left, rc.top + iIndex * iFolderHeight - 1, rc.right,
00491             rc.top + (1 + iIndex) * iFolderHeight - 1);
00492         return true;
00493     }
00494     return false;
00495 }

void CGfxOutBarCtrl::GetIconRect | ( | const int | iFolder,
 |  | const int | iIndex,
 |  | CRect & | rect
 | ) | [virtual]

Definition at line 1745 of file GfxOutBarCtrl.cpp.

References GetInsideRect, GetItemSize, iFirstItem, ircAll, ircIcon, IsSmallIconView, xLeftMargin, yLargeIconSpacing, ySmallIconSpacing, and yTopMargin.

Referenced by DrawItem, HighlightItem, HitTestEx, OnLButtonDown, and StartItemEdit.

01746 {
01747     CRect rc;
01748     GetInsideRect(rc);
01749     int top = rc.top;
01750     CSize sz(0,0);
01751     int y = 0;
01752     int spacing = IsSmallIconView() ? ySmallIconSpacing : yLargeIconSpacing;
01753
01754     for (int t = 0; t < iIndex; t++)
01755     {
01756         sz = GetItemSize(iFolder, t, ircAll);
01757         top += sz.cy;
01758         top += spacing;
01759         if (t == iFirstItem - 1) y = top - rc.top;
01760     }
01761     top += spacing;
01762
01763     sz = GetItemSize(iFolder, iIndex, ircIcon);
01764     if (IsSmallIconView())
01765     {
01766         rect.SetRect(rc.left, top, rc.left + sz.cx, top + sz.cy);
01767         rect.left += xLeftMargin + 2;
01768         rect.right += xLeftMargin + 2;
01769         rect.top -= yTopMargin;
01770         rect.bottom -= yTopMargin;
01771
01772         rect.top -= y;
01773         rect.bottom -= y;
01774     }
01775     else
01776     {
01777         rect.SetRect(rc.left + (rc.Width() - sz.cx)/2, top, rc.left + (rc.Width() - sz.cx)/2 + sz.cx, top + sz.cy);
01778         rect.top -= y + 3;
01779         rect.bottom -= y + 2;
01780     }
01781 }

CImageList * CGfxOutBarCtrl::GetImageList | ( | CImageList * | pImageList,
 |  | int | nImageList
 | ) | [virtual]

Definition at line 1419 of file GfxOutBarCtrl.cpp.

References fLargeIcon, fSmallIcon, NULL, pLargeImageList, and pSmallImageList.

01420 {
01421     if (nImageList == fSmallIcon) return pSmallImageList;
01422     else if (nImageList == fLargeIcon) return pLargeImageList;
01423     return NULL;
01424 }

void CGfxOutBarCtrl::GetInsideRect ( CRect & rect ) const [virtual]

Definition at line 629 of file GfxOutBarCtrl.cpp.

References arFolder, iFolderHeight, and iSelFolder.

Referenced by AnimateFolderScroll, DrawAnimItem, GetDragItemRect, GetIconRect, GetItemRect, GetItemSize, GetLabelRect, GetVisibleRange, HighlightItem, HitTestEx, OnEndLabelEdit, OnLButtonDown, OnPaint, OnSize, PaintItems, RemoveItem, SetSelFolder, SetSmallIconView, and StartItemEdit.

00630 {
00631     GetClientRect(rect);
00632     if (arFolder.GetSize() > 0)
00633     {
00634         int max = arFolder.GetSize();
00635         rect.top += iFolderHeight * (iSelFolder + 1) - 1;//+ 2;
00636         rect.bottom -= (max - iSelFolder - 1)*iFolderHeight;
00637         return;
00638     }
00639 }

int CGfxOutBarCtrl::GetItemCount ( ) const [virtual]

Definition at line 1315 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, GetFolderCount, and iSelFolder.

Referenced by DrawAnimItem, DrawItem, GetDragItemRect, GetItemSize, OnLButtonDown, OnPaint, RemoveItem, and StartItemEdit.

01316 {
01317     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
01318     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
01319     return  pbf->GetItemCount();
01320 }

DWORD CGfxOutBarCtrl::GetItemData ( const int index ) const [virtual]

Definition at line 2012 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, GetFolderCount, iSelFolder, and IsValidItem.

02013 {
02014     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
02015     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
02016     if (IsValidItem(index))
02017     {
02018         CBarItem * i = (CBarItem *) pbf->arItems.GetAt(index);
02019         return i->dwData;
02020     }
02021     return 0;
02022 }

int CGfxOutBarCtrl::GetItemImage ( const int index ) const [virtual]

Definition at line 2024 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, GetFolderCount, iSelFolder, and IsValidItem.

02025 {
02026     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
02027     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
02028     if (IsValidItem(index))
02029     {
02030         CBarItem * i = (CBarItem *) pbf->arItems.GetAt(index);
02031         return i->iImageIndex;
02032     }
02033     return 0;
02034 }

void CGfxOutBarCtrl::GetItemRect | ( | const int | iFolder,
 |  | const int | iIndex,
 |  | CRect & | rect
 | ) | [virtual]

Definition at line 497 of file GfxOutBarCtrl.cpp.

References GetInsideRect, GetItemSize, iFirstItem, ircAll, IsSmallIconView, xLeftMargin, yLargeIconSpacing, ySmallIconSpacing, and yTopMargin.

Referenced by DrawAnimItem, GetDragItemRect, GetVisibleRange, HitTestEx, OnLButtonDown, and PaintItems.

00498 {
00499     CRect rc;
00500     GetInsideRect(rc);
00501     int top = rc.top;
00502     CSize sz(0,0);
00503     int y = 0;
00504     for (int t = 0; t < iIndex; t++)
00505     {
00506         sz = GetItemSize(iFolder, t, ircAll);
00507         top += sz.cy;
00508
00509         if (IsSmallIconView())
00510         {
00511             top += ySmallIconSpacing;
00512         }
00513         else
00514         {
00515             top += yLargeIconSpacing;
00516         }
00517         if (t == iFirstItem - 1) y = top - rc.top;
00518     }
00519     sz = GetItemSize(iFolder, iIndex, ircAll);
00520     rect.SetRect(rc.left, top, rc.left + sz.cx, top + sz.cy);
00521
00522     rect.top -= y;
00523     rect.bottom -= y;
00524
00525     rect.left += xLeftMargin;
00526     rect.top  += yTopMargin;
00527     rect.bottom += yTopMargin;
00528
00529     if (!IsSmallIconView())
00530     {
00531         rect.left = rc.left;
00532         rect.right = rc.right;
00533     }
00534 }

CSize CGfxOutBarCtrl::GetItemSize | ( | const int | iFolder,
 |  | const int | index,
 |  | const int | type
 | ) | [virtual]

Definition at line 1493 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, GetFolderCount, GetFolderImageList, GetInsideRect, GetItemCount, ircAll, ircIcon, ircLabel, IsSmallIconView, xSmallIconLabelOffset, yLargeIconLabelOffset, and yLargeIconSpacing.

Referenced by GetIconRect, GetItemRect, and GetLabelRect.

01494 {
01495     ASSERT(iFolder >= 0 && iFolder < GetFolderCount());
01496     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iFolder);
01497
01498     ASSERT(index >= 0 && index < pbf->GetItemCount());
01499     CBarItem * pi = (CBarItem *) pbf->arItems.GetAt(index);
01500
01501     CSize szImage(0,0);
01502     CSize szLabel(0,0);
01503     CSize szAll(0,0);
01504
01505     if (pi->iImageIndex >= 0)
01506     {
01507         if (type != ircLabel)
01508         {
01509             CImageList * il = GetFolderImageList(iFolder, IsSmallIconView());
01510             ASSERT(il);
01511             if (il)
01512             {
01513                 IMAGEINFO ii;
01514                 il->GetImageInfo(pi->iImageIndex, &ii);
01515                 szImage = CRect(ii.rcImage).Size();
01516             }
01517         }
01518     }
01519     if (pi->cItem)
01520     {
01521         if (type != ircIcon)
01522         {
01523             CClientDC dc(this);
01524             CFont * oft = (CFont *) dc.SelectObject(CFont::FromHandle((HFONT)GetStockObject(DEFAULT_GUI_FONT)));
01525             if (IsSmallIconView())
01526             {
01527                 szLabel = dc.GetTextExtent(pi->cItem, lstrlen(pi->cItem));
01528             }
01529             else
01530             {
01531                 CRect rc;
01532                 GetInsideRect(rc);
01533                 rc.bottom = rc.top;
01534                 dc.DrawText(pi->cItem, lstrlen(pi->cItem), rc, DT_CALCRECT|DT_CENTER|DT_WORDBREAK);
01535                 szLabel = rc.Size();
01536             }
01537             dc.SelectObject(oft);
01538         }
01539     }
01540     if (IsSmallIconView())
01541     {
01542         if (type == ircIcon) szAll = szImage;
01543         else if (type == ircLabel) szAll = szLabel;
01544         else if (type == ircAll) szAll = CSize(szImage.cx + szLabel.cx + xSmallIconLabelOffset, szImage.cy > szLabel.cy ? szImage.cy : szLabel.cy);
01545     }
01546     else
01547     {
01548         if (type == ircIcon) szAll = szImage;
01549         else if (type == ircLabel) szAll = szLabel;
01550         else if (type == ircAll)
01551         {
01552             szAll = CSize(szImage.cx > szLabel.cx ? szImage.cx : szLabel.cx, szLabel.cy + szImage.cy + yLargeIconLabelOffset + yLargeIconSpacing);
01553         }
01554     }
01555     return szAll;
01556 }

CString CGfxOutBarCtrl::GetItemText ( const int index ) [virtual]

Definition at line 2293 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, GetFolderCount, iSelFolder, and IsValidItem.

02294 {
02295     CString item;
02296
02297     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
02298     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
02299     if (IsValidItem(index))
02300     {
02301         CBarItem * pi = (CBarItem *) pbf->arItems.GetAt(index);
02302         if (pi->cItem) item = pi->cItem;
02303     }
02304     return item;
02305 }

void CGfxOutBarCtrl::GetLabelRect | ( | const int | iFolder,
 |  | const int | iIndex,
 |  | CRect & | rect
 | ) | [virtual]

Definition at line 1783 of file GfxOutBarCtrl.cpp.

References GetInsideRect, GetItemSize, iFirstItem, ircAll, ircLabel, IsSmallIconView, xLeftMargin, yLargeIconSpacing, ySmallIconSpacing, and yTopMargin.

Referenced by HitTestEx, and StartItemEdit.

01784 {
01785     CRect rc;
01786     GetInsideRect(rc);
01787     int top = rc.top;
01788     CSize sz(0,0);
01789     int y = 0;
01790     int spacing = IsSmallIconView() ? ySmallIconSpacing : yLargeIconSpacing;
01791
01792     for (int t = 0; t < iIndex; t++)
01793     {
01794         sz = GetItemSize(iFolder, t, ircAll);
01795         top += sz.cy;
01796         top += spacing;
01797         if (t == iFirstItem - 1) y = top - rc.top;
01798     }
01799     top += spacing;
01800
01801     sz = GetItemSize(iFolder, iIndex, ircAll);
01802
01803     CSize szLabel = GetItemSize(iFolder, iIndex, ircLabel);
01804
01805     if (IsSmallIconView())
01806     {
01807         rect.SetRect(rc.left, top, rc.left + sz.cx, top + sz.cy);
01808         rect.left += xLeftMargin + 2;
01809         rect.right += xLeftMargin + 2;
01810         rect.top  += yTopMargin - 5;
01811         rect.bottom += yTopMargin - 5;
01812     }
01813     else
01814     {
01815         rect.SetRect(rc.left + (rc.Width() - sz.cx)/2, top, rc.left + (rc.Width() - sz.cx)/2 + sz.cx, top + sz.cy);
01816         rect.top -= y + 3;
01817         rect.bottom -= y + 2;
01818
01819         rect.bottom -=  yLargeIconSpacing;
01820         rect.top    = rect.bottom - szLabel.cy;
01821     }
01822 }

int CGfxOutBarCtrl::GetSelFolder ( ) const [virtual]

Definition at line 1358 of file GfxOutBarCtrl.cpp.

References iSelFolder.

01359 {
01360     return iSelFolder;
01361 }

void CGfxOutBarCtrl::GetVisibleRange | ( | const int | iFolder,
 |  | int & | first,
 |  | int & | last
 | ) | [virtual]

Definition at line 1653 of file GfxOutBarCtrl.cpp.

References arFolder, GetInsideRect, GetItemRect, and iFirstItem.

Referenced by OnPaint.

01654 {
01655     first = iFirstItem;
01656     CRect rc;
01657     GetInsideRect(rc);
01658
01659     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iFolder);
01660     int max = pbf->GetItemCount(), t;
01661     for (t = iFirstItem; t < max; t++)
01662     {
01663         CRect itemRc;
01664         GetItemRect(iFolder, t, itemRc);
01665         if (itemRc.bottom > rc.bottom)
01666         {
01667             last = t - 1;
01668             break;
01669         }
01670         else last = t;
01671     }
01672 }

void CGfxOutBarCtrl::HighlightFolder ( const int index ) [virtual]

Definition at line 718 of file GfxOutBarCtrl.cpp.

References cr3dFace, crBackGroundColor1, crDkShadowBorder, GetFolderRect, iLastFolderHighlighted, and NULL.

Referenced by OnMouseMove, OnPaint, and OnTimer.

00719 {
00720     CWnd * pf = GetFocus();
00721     if (pf != NULL && pf != this && IsChild(pf)) return;
00722
00723     if (iLastFolderHighlighted == index) return;
00724
00725     if (iLastFolderHighlighted >= 0)
00726     {
00727         CRect rc;
00728         if (GetFolderRect(iLastFolderHighlighted, rc))
00729         {
00730             CClientDC dc(this);
00731             CPen pn(PS_SOLID, 1, crBackGroundColor1);//crShadowBorder);
00732             CPen * op = dc.SelectObject(&pn);
00733             dc.MoveTo(rc.left, rc.bottom-1);
00734             dc.LineTo(rc.right-1, rc.bottom-1);
00735             dc.LineTo(rc.right-1, rc.top);
00736             CPen pn1(PS_SOLID, 1, cr3dFace);
00737             dc.SelectObject(&pn1);
00738             dc.MoveTo(rc.left+1, rc.bottom-2);
00739             dc.LineTo(rc.right-2, rc.bottom-2);
00740             dc.LineTo(rc.right-2, rc.top+1);
00741             dc.SelectObject(op);
00742
00743             // fix potential resource leak - KStowell - 10-21-99
00744             pn.DeleteObject();
00745         }
00746     }
00747     iLastFolderHighlighted = index;
00748     if (iLastFolderHighlighted >= 0)
00749     {
00750         CRect rc;
00751         if (GetFolderRect(iLastFolderHighlighted, rc))
00752         {
00753             CClientDC dc(this);
00754             CPen pn(PS_SOLID, 1, crDkShadowBorder);
00755             CPen * op = dc.SelectObject(&pn);
00756             dc.MoveTo(rc.left, rc.bottom-1);
00757             dc.LineTo(rc.right-1, rc.bottom-1);
00758             dc.LineTo(rc.right-1, rc.top);
00759             CPen pn1(PS_SOLID, 1, crBackGroundColor1);
00760             dc.SelectObject(&pn1);
00761             dc.MoveTo(rc.left+1, rc.bottom-2);
00762             dc.LineTo(rc.right-2, rc.bottom-2);
00763             dc.LineTo(rc.right-2, rc.top+1);
00764             dc.SelectObject(op);
00765
00766             // fix potential resource leak - KStowell - 10-21-99
00767             pn.DeleteObject();
00768         }
00769     }
00770 }

void CGfxOutBarCtrl::HighlightItem | ( | const int | index,
 |  | const bool | bPressed = false
 | ) | [virtual]

Definition at line 1691 of file GfxOutBarCtrl.cpp.

References cr3dFace, crBackGroundColor, crDkShadowBorder, dwFlags, fSelHighlight, GetIconRect, GetInsideRect, iLastItemHighlighted, iLastSel, iSelAnimTiming, iSelFolder, IsValidItem, NM_OB_ITEMHOVER, NULL, and WM_OUTBAR_NOTIFY.

Referenced by OnLButtonDown, OnMouseMove, OnPaint, and OnTimer.

01692 {
01693     CWnd * pf = GetFocus();
01694     if (pf != NULL && pf != this && IsChild(pf)) return;
01695
01696     static bool bOldPressed = false;
01697     if (iLastItemHighlighted == index && bOldPressed == bPressed) return;
01698
01699     bOldPressed = bPressed;
01700
01701     CClientDC dc(this);
01702
01703     CRect irc;
01704     GetInsideRect(irc);
01705     int isdc = dc.SaveDC();
01706     CRgn itemRegion;
01707     itemRegion.CreateRectRgnIndirect(&irc);
01708     dc.SelectClipRgn(&itemRegion);
01709     itemRegion.DeleteObject();
01710
01711
01712     if (iLastItemHighlighted >= 0 && IsValidItem(iLastItemHighlighted))
01713     {
01714         CRect rc;
01715         GetIconRect(iSelFolder, iLastItemHighlighted, rc);
01716         rc.InflateRect(1,1);
01717         dc.Draw3dRect(rc, crBackGroundColor, crBackGroundColor);
01718     }
01719     if (iSelAnimTiming > 0 && index == iLastSel)
01720     {
01721         iLastItemHighlighted = -1;
01722         return;
01723     }
01724     if (dwFlags&fSelHighlight && iLastSel == index)
01725     {
01726         iLastItemHighlighted = -1;
01727         return;
01728     }
01729
01730     iLastItemHighlighted = index;
01731     if (iLastItemHighlighted >= 0 && IsValidItem(iLastItemHighlighted))
01732     {
01733         CRect rc;
01734         GetIconRect(iSelFolder, iLastItemHighlighted, rc);
01735         rc.InflateRect(1,1);
01736         if (bPressed)
01737             dc.Draw3dRect(rc, crDkShadowBorder, cr3dFace);
01738         else
01739             dc.Draw3dRect(rc, cr3dFace, crDkShadowBorder);
01740     }
01741     dc.RestoreDC(isdc);
01742     GetOwner()->SendMessage(WM_OUTBAR_NOTIFY,NM_OB_ITEMHOVER,index);
01743 }

int CGfxOutBarCtrl::HitTestEx | ( | const CPoint & | point,
 |  | int & | index
 | ) | [virtual]

Definition at line 662 of file GfxOutBarCtrl.cpp.

References arFolder, bDownArrow, bUpArrow, GetFolderRect, GetIconRect, GetInsideRect, GetItemRect, GetLabelRect, htDownScroll, htFolder, htItem, htNothing, htUpScroll, iFirstItem, iSelFolder, IsSmallIconView, rcDownArrow, rcUpArrow, and yLargeIconLabelOffset.

Referenced by OnLButtonDown, OnMouseMove, OnRButtonDown, and OnSetCursor.

00663 {
00664     if (bUpArrow && rcUpArrow.PtInRect(point)) return htUpScroll;
00665     if (bDownArrow && rcDownArrow.PtInRect(point)) return htDownScroll;
00666
00667     int max = arFolder.GetSize(), t;
00668
00669     CRect rc;
00670     for (t = 0; t < max; t++)
00671     {
00672         GetFolderRect(t, rc);
00673         if (rc.PtInRect(point))
00674         {
00675             index = t;
00676             return htFolder;
00677         }
00678     }
00679     GetInsideRect(rc);
00680     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
00681     max = pbf->GetItemCount();
00682     for (t = iFirstItem; t < max; t++)
00683     {
00684         CRect itemRc;
00685         if (!IsSmallIconView())
00686         {
00687             GetIconRect(iSelFolder, t, itemRc);
00688             if (itemRc.PtInRect(point))
00689             {
00690                 index = t;
00691                 return htItem;
00692             }
00693             else if (itemRc.top > rc.bottom) break;
00694             GetLabelRect(iSelFolder, t, itemRc);
00695             itemRc.top -= yLargeIconLabelOffset;
00696
00697             if (itemRc.PtInRect(point))
00698             {
00699                 index = t;
00700                 return htItem;
00701             }
00702             else if (itemRc.top > rc.bottom) break;
00703         }
00704         else
00705         {
00706             GetItemRect(iSelFolder, t, itemRc);
00707             if (itemRc.PtInRect(point))
00708             {
00709                 index = t;
00710                 return htItem;
00711             }
00712             else if (itemRc.top > rc.bottom) break;
00713         }
00714     }
00715     return htNothing;
00716 }

int CGfxOutBarCtrl::InsertItem | ( | const int | folder,
 |  | const int | index,
 |  | LPCTSTR | text,
 |  | const int | image = -1,
 |  | const DWORD | exData = 0
 | ) | [virtual]

Definition at line 1306 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, and GetFolderCount.

01307 {
01308     ASSERT(folder >= 0 && folder < GetFolderCount());
01309
01310     CBarFolder* pbf = (CBarFolder*) arFolder.GetAt(folder);
01311
01312     return pbf->InsertItem(index, text, image, exData);
01313 }

bool CGfxOutBarCtrl::IsSmallIconView ( ) const [virtual]

Definition at line 240 of file GfxOutBarCtrl.cpp.

References dwFlags, and fSmallIcon.

Referenced by DrawAnimItem, DrawItem, GetDragItemRect, GetIconRect, GetItemRect, GetItemSize, GetLabelRect, HitTestEx, OnUpdateGfxLargeicon, OnUpdateGfxSmallicon, SetSmallIconView, and StartItemEdit.

00241 {
00242     return dwFlags&fSmallIcon;
00243 }

bool CGfxOutBarCtrl::IsValidItem ( const int index ) const [virtual]

Definition at line 2005 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, GetFolderCount, and iSelFolder.

Referenced by GetItemData, GetItemImage, GetItemText, HighlightItem, RemoveItem, SetItemData, and SetItemImage.

02006 {
02007     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
02008     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
02009     return (index >= 0 && index < pbf->GetItemCount());
02010 }

void CGfxOutBarCtrl::ModifyFlag | ( | const DWORD & | dwRemove,
 |  | const DWORD & | dwAdd,
 |  | const UINT | redraw = 0
 | ) | [virtual]

Definition at line 276 of file GfxOutBarCtrl.cpp.

References dwFlags.

00277 {
00278     if (dwRemove)   dwFlags &= ~(dwRemove);
00279     if (dwAdd)      dwFlags |= dwAdd;
00280
00281     if (GetSafeHwnd())
00282     {
00283         if (redraw != 0) SetWindowPos(0,0,0,0,0,SWP_NOZORDER|SWP_NOSIZE|SWP_NOMOVE|redraw);
00284         else Invalidate();
00285     }
00286 }

int CGfxOutBarCtrl::OnCreate ( LPCREATESTRUCT lpCreateStruct ) [protected]

Definition at line 288 of file GfxOutBarCtrl.cpp.

00289 {
00290     if (CWnd::OnCreate(lpCreateStruct) == -1)
00291         return -1;
00292
00293     // TODO: Add your specialized creation code here
00294
00295     return 0;
00296 }

long CGfxOutBarCtrl::OnEndLabelEdit | ( | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [protected]

Definition at line 158 of file GfxOutBarCtrl.cpp.

References OUTBAR_INFO::cText, GetFolderRect, GetInsideRect, CGfxGroupEdit::iIndex, OUTBAR_INFO::index, NM_OB_ONGROUPENDEDIT, NM_OB_ONLABELENDEDIT, SetFolderText, SetItemText, CGfxGroupEdit::text, and WM_OUTBAR_NOTIFY.

00159 {
00160     if (wParam == NM_OB_ONGROUPENDEDIT)
00161     {
00162         CGfxGroupEdit* pEdit = (CGfxGroupEdit*) lParam;
00163
00164         OUTBAR_INFO ob;
00165
00166         ob.index = pEdit->iIndex;
00167         ob.cText = (LPCTSTR) pEdit->text;
00168
00169         if (GetOwner()->SendMessage(WM_OUTBAR_NOTIFY, NM_OB_ONGROUPENDEDIT, (LPARAM) &ob))
00170         {
00171             SetFolderText(pEdit->iIndex, pEdit->text);
00172             CRect rc;
00173             GetFolderRect(pEdit->iIndex, rc);
00174             InvalidateRect(rc, false);
00175         }
00176     }
00177
00178     if (wParam == NM_OB_ONLABELENDEDIT)
00179     {
00180         CGfxGroupEdit * pEdit = (CGfxGroupEdit *) lParam;
00181         OUTBAR_INFO ob;
00182         ob.index = pEdit->iIndex;
00183         ob.cText = pEdit->text;
00184
00185         if (GetOwner()->SendMessage(WM_OUTBAR_NOTIFY, NM_OB_ONLABELENDEDIT, (LPARAM) &ob))
00186         {
00187             SetItemText(pEdit->iIndex, pEdit->text);
00188             CRect rc;
00189             GetInsideRect(rc);
00190             InvalidateRect(rc, true);
00191         }
00192     }
00193
00194     return 0;
00195 }

BOOL CGfxOutBarCtrl::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 472 of file GfxOutBarCtrl.cpp.

00473 {
00474     return true;
00475 }

void CGfxOutBarCtrl::OnGfxLargeicon ( ) [protected]

Definition at line 1933 of file GfxOutBarCtrl.cpp.

References SetSmallIconView.

01934 {
01935     SetSmallIconView(false);
01936     Invalidate();
01937 }

void CGfxOutBarCtrl::OnGfxRemoveitem ( ) [protected]

Definition at line 1955 of file GfxOutBarCtrl.cpp.

References htFolder, htItem, iHitInternal1, iHitInternal2, RemoveFolder, and RemoveItem.

01956 {
01957     if (iHitInternal1 == htFolder)
01958     {
01959         RemoveFolder(iHitInternal2);
01960     }
01961     else if (iHitInternal1 == htItem)
01962     {
01963         RemoveItem(iHitInternal2);
01964     }
01965 }

void CGfxOutBarCtrl::OnGfxRenameitem ( ) [protected]

Definition at line 1972 of file GfxOutBarCtrl.cpp.

References htFolder, htItem, iHitInternal1, iHitInternal2, StartGroupEdit, and StartItemEdit.

01973 {
01974     if (iHitInternal1 == htFolder)
01975     {
01976         StartGroupEdit(iHitInternal2);
01977     }
01978     else if (iHitInternal1 == htItem)
01979     {
01980         StartItemEdit(iHitInternal2);
01981     }
01982 }

void CGfxOutBarCtrl::OnGfxSmallicon ( ) [protected]

Definition at line 1944 of file GfxOutBarCtrl.cpp.

References SetSmallIconView.

01945 {
01946     SetSmallIconView(true);
01947     Invalidate();
01948 }

void CGfxOutBarCtrl::OnLButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 772 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, bDownArrow, bDownPressed, bLooping, bPressedHighlight, bUpArrow, bUpPressed, DrawAnimItem, DrawDragArrow, DrawFolder, dwFlags, FALSE, fDragItems, fSelHighlight, GetFolderRect, GetIconRect, GetInsideRect, GetItemCount, GetItemRect, hDragCursor, HighlightItem, HitTestEx, hNoDragCursor, htDownScroll, htFolder, htItem, htUpScroll, OUTBAR_INFO::iDragFrom, OUTBAR_INFO::iDragTo, iFirstItem, iLastDragItemDraw, iLastDragItemDrawType, iLastItemHighlighted, iLastSel, iLastSelectedFolder, iSelAnimTiming, iSelFolder, NM_OB_DRAGITEM, NM_OB_ITEMCLICK, NULL, rcDownArrow, rcUpArrow, SetSelFolder, VERIFY, and WM_OUTBAR_NOTIFY.

00773 {
00774     if (GetFocus() != this) SetFocus();
00775
00776     int index, ht = HitTestEx(point, index);
00777     iLastDragItemDrawType = -1;
00778
00779     CRect inRc;
00780     GetInsideRect(inRc);
00781
00782     if (ht == htFolder)
00783     {
00784         bool bHigh = true;
00785         CRect rc;
00786         GetFolderRect(index, rc);
00787
00788         if (::GetCapture() == NULL)
00789         {
00790             SetCapture();
00791             ASSERT(this == GetCapture());
00792             CClientDC dc(this);
00793             DrawFolder(&dc, index, rc, true);
00794             AfxLockTempMaps();
00795             for (;;)
00796             {
00797                 MSG msg;
00798                 VERIFY(::GetMessage(&msg, NULL, 0, 0));
00799
00800                 if (CWnd::GetCapture() != this) break;
00801
00802                 switch (msg.message)
00803                 {
00804                 case WM_MOUSEMOVE:
00805                     {
00806                         CPoint pt(msg.lParam);
00807                         int idx, ht1 = HitTestEx(pt, idx);
00808                         if (ht1 == htFolder && idx == index)
00809                         {
00810                             if (!bHigh)
00811                             {
00812                                 DrawFolder(&dc, index, rc, true);
00813                                 bHigh = true;
00814                             }
00815                         }
00816                         else
00817                         {
00818                             if (bHigh)
00819                             {
00820                                 DrawFolder(&dc, index, rc, false);
00821                                 bHigh = false;
00822                             }
00823                         }
00824                     }
00825                     break;
00826
00827                 case WM_LBUTTONUP:
00828                     {
00829                         if (bHigh)
00830                         {
00831                             DrawFolder(&dc, index, rc, false);
00832                             bHigh = false;
00833                         }
00834                         CPoint pt(msg.lParam);
00835                         int idx, ht1 = HitTestEx(pt, idx);
00836                         if (ht1 == htFolder && idx != iSelFolder)
00837                             SetSelFolder(idx);
00838                     }
00839
00840                     goto ExitLoop2;
00841
00842                 case WM_KEYDOWN:
00843                     if (msg.wParam != VK_ESCAPE)
00844                         break;
00845
00846                 default:
00847                     DispatchMessage(&msg);
00848                     break;
00849                 }
00850             }
00851
00852         ExitLoop2:
00853             ReleaseCapture();
00854             AfxUnlockTempMaps(FALSE);
00855         }
00856         if (bHigh) InvalidateRect(rc, false);
00857     }
00858     else iLastSelectedFolder = -1;
00859
00860     if (ht == htItem)
00861     {
00862         iLastDragItemDraw = -1;
00863         bool bHigh = true, bDragging = false;
00864         CRect rc;
00865         GetItemRect(iSelFolder, index, rc);
00866
00867         HCURSOR hCur = GetCursor();
00868
00869         if (::GetCapture() == NULL)
00870         {
00871             SetCapture();
00872             ASSERT(this == GetCapture());
00873             CClientDC dc(this);
00874             HighlightItem(index, true);
00875             AfxLockTempMaps();
00876             for (;;)
00877             {
00878                 MSG msg;
00879                 VERIFY(::GetMessage(&msg, NULL, 0, 0));
00880
00881                 if (CWnd::GetCapture() != this) break;
00882
00883                 switch (msg.message)
00884                 {
00885                 case WM_MOUSEMOVE:
00886                     {
00887                         CPoint pt(msg.lParam);
00888                         int idx, ht1 = HitTestEx(pt, idx);
00889                         if (bDragging)
00890                         {
00891                             if (ht1 == htItem)
00892                             {
00893                                 DrawDragArrow(&dc, index, idx);
00894                                 SetCursor(hDragCursor);
00895                                 hCur = hDragCursor;
00896                             }
00897                             else
00898                             {
00899                                 CRect rcItem;
00900                                 GetItemRect(iSelFolder, GetItemCount() - 1, rcItem);
00901                                 if (pt.y > rcItem.bottom && pt.y < inRc.bottom)
00902                                 {
00903                                     DrawDragArrow(&dc, index, GetItemCount());
00904                                     SetCursor(hDragCursor);
00905                                     hCur = hDragCursor;
00906                                 }
00907                                 else
00908                                 {
00909                                     DrawDragArrow(&dc, index, -1);
00910                                     SetCursor(hNoDragCursor);
00911                                     hCur = hNoDragCursor;
00912                                 }
00913                             }
00914                         }
00915                         else
00916                         {
00917                             if (ht1 == htItem && idx == index)
00918                             {
00919                                 if (!bHigh)
00920                                 {
00921                                     HighlightItem(index, true);
00922                                     bHigh = true;
00923                                     bPressedHighlight = true;
00924                                 }
00925                             }
00926                             else
00927                             {
00928                                 if (ht1 == htItem)
00929                                 {
00930                                     if (bHigh)
00931                                     {
00932                                         HighlightItem(index, false);
00933                                         bHigh = false;
00934                                         bPressedHighlight = false;
00935                                     }
00936                                 }
00937                                 else
00938                                 {
00939                                     if (dwFlags&fDragItems)
00940                                     {
00941                                         HighlightItem(index, true);
00942                                         bHigh = true;
00943                                         bDragging = true;
00944
00945                                         SetCursor(hDragCursor);
00946                                         hCur = hDragCursor;
00947
00948                                         bPressedHighlight = true;
00949                                     }
00950                                 }
00951                             }
00952                         }
00953                     }
00954                     break;
00955
00956                 case WM_SETCURSOR:
00957                     SetCursor(hCur);
00958                     break;
00959
00960                 case WM_LBUTTONUP:
00961                     {
00962                         if (bHigh)
00963                         {
00964                             HighlightItem(-1);
00965                             bHigh = false;
00966                         }
00967                         CPoint pt(msg.lParam);
00968                         int idx, ht1 = HitTestEx(pt, idx);
00969                         if (!bDragging)
00970                         {
00971                             if (ht1 == htItem && idx == index)
00972                             {
00973                                 if (iSelAnimTiming > 0 && index != iLastSel && iLastSel >= 0)
00974                                 {
00975                                     DrawAnimItem(0, 0, iLastSel);
00976                                 }
00977
00978                                 if (dwFlags&fSelHighlight && iLastSel >= 0)
00979                                 {
00980                                     CRect rc;
00981                                     GetIconRect(iSelFolder, iLastSel, rc);
00982                                     rc.InflateRect(1,1);
00983                                     InvalidateRect(rc);
00984                                 }
00985
00986                                 iLastSel = index;
00987
00988                                 if (dwFlags&fSelHighlight && iLastSel >= 0)
00989                                 {
00990                                     CRect rc;
00991                                     GetIconRect(iSelFolder, iLastSel, rc);
00992                                     rc.InflateRect(1,1);
00993                                     InvalidateRect(rc);
00994                                 }
00995
00996                                 GetOwner()->SendMessage(WM_OUTBAR_NOTIFY, NM_OB_ITEMCLICK, idx);
00997                             }
00998                         }
00999                         else
01000                         {
01001                             if (ht1 == htItem)
01002                             {
01003                                 if (idx != index)
01004                                 {
01005                                     OUTBAR_INFO ob;
01006                                     ob.iDragFrom = iSelFolder;
01007                                     ob.iDragTo = index;
01008                                     if (GetOwner()->SendMessage(WM_OUTBAR_NOTIFY, NM_OB_DRAGITEM, (LPARAM) &ob))
01009                                     {
01010                                         CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
01011                                         CBarItem * piFrom = (CBarItem *) pbf->arItems.GetAt(index);
01012                                         pbf->arItems.RemoveAt(index);
01013                                         if (idx > index) idx --;
01014                                         pbf->arItems.InsertAt(idx, piFrom);
01015                                     }
01016                                 }
01017                             }
01018                             else
01019                             {
01020                                 CRect rcItem;
01021                                 GetItemRect(iSelFolder, GetItemCount() - 1, rcItem);
01022                                 if (pt.y > rcItem.bottom && pt.y < inRc.bottom)
01023                                 {
01024                                     OUTBAR_INFO ob;
01025                                     ob.iDragFrom = iSelFolder;
01026                                     ob.iDragTo = index;
01027                                     if (GetOwner()->SendMessage(WM_OUTBAR_NOTIFY, NM_OB_DRAGITEM, (LPARAM) &ob))
01028                                     {
01029                                         CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
01030                                         CBarItem * piFrom = (CBarItem *) pbf->arItems.GetAt(index);
01031                                         pbf->arItems.RemoveAt(index);
01032                                         pbf->arItems.Add((void *) piFrom);
01033                                     }
01034                                 }
01035                             }
01036                         }
01037                     }
01038
01039                     goto ExitLoop4;
01040
01041                 default:
01042                     DispatchMessage(&msg);
01043                     break;
01044                 }
01045             }
01046
01047         ExitLoop4:
01048             ReleaseCapture();
01049             AfxUnlockTempMaps(FALSE);
01050             if (bDragging)
01051             {
01052                 Invalidate();
01053             }
01054         }
01055         bPressedHighlight = false;
01056         if (bHigh) InvalidateRect(rc, false);
01057     }
01058     else iLastItemHighlighted = -1;
01059
01060     if (ht == htDownScroll)
01061     {
01062         bLooping = true;
01063         bool bHigh = true;
01064
01065         if (::GetCapture() == NULL)
01066         {
01067             SetCapture();
01068             ASSERT(this == GetCapture());
01069             CClientDC dc(this);
01070             dc.DrawFrameControl(rcDownArrow, DFC_SCROLL, DFCS_SCROLLDOWN|DFCS_PUSHED);
01071             SetTimer(2,300,NULL);
01072             AfxLockTempMaps();
01073             for (;;)
01074             {
01075                 MSG msg;
01076                 VERIFY(::GetMessage(&msg, NULL, 0, 0));
01077
01078                 if (CWnd::GetCapture() != this) break;
01079
01080                 switch (msg.message)
01081                 {
01082                 case WM_MOUSEMOVE:
01083                     {
01084                         CPoint pt(msg.lParam);
01085                         if (rcDownArrow.PtInRect(pt))
01086                         {
01087                             if (bHigh == false)
01088                             {
01089                                 dc.DrawFrameControl(rcDownArrow, DFC_SCROLL, DFCS_SCROLLDOWN|DFCS_PUSHED);
01090                                 bHigh = true;
01091                                 bDownArrow = true;
01092                                 bDownPressed = true;
01093                             }
01094                         }
01095                         else
01096                         {
01097                             if (bHigh == true)
01098                             {
01099                                 dc.DrawFrameControl(rcDownArrow, DFC_SCROLL, DFCS_SCROLLDOWN);
01100                                 bHigh = false;
01101                                 bDownArrow = false;
01102                                 bDownPressed = false;
01103                             }
01104                         }
01105                     }
01106                     break;
01107
01108                 case WM_LBUTTONUP:
01109                     {
01110                         if (bHigh)
01111                         {
01112                             dc.DrawFrameControl(rcDownArrow, DFC_SCROLL, DFCS_SCROLLDOWN);
01113                             bHigh = false;
01114                         }
01115                         bDownArrow = false;
01116                         CPoint pt(msg.lParam);
01117                         if (rcDownArrow.PtInRect(pt))
01118                         {
01119                             CRect itrc;
01120                             GetItemRect(iSelFolder, GetItemCount() - 1, itrc);
01121                             CRect crc;
01122                             GetInsideRect(crc);
01123                             if (itrc.bottom > crc.bottom)
01124                             {
01125                                 iFirstItem ++;
01126                                 InvalidateRect(crc, true);
01127                             }
01128                         }
01129                     }
01130                     goto ExitLoop3;
01131
01132
01133                 case WM_TIMER:
01134                     {
01135                         if (msg.wParam == 2)
01136                         {
01137                             if (bHigh)
01138                             {
01139                                 CPoint pt(msg.pt);
01140                                 ScreenToClient(&pt);
01141                                 if (rcDownArrow.PtInRect(pt))
01142                                 {
01143                                     bDownPressed = true;
01144                                     CRect itrc;
01145                                     GetItemRect(iSelFolder, GetItemCount() - 1, itrc);
01146                                     CRect crc;
01147                                     GetInsideRect(crc);
01148                                     if (itrc.bottom > crc.bottom)
01149                                     {
01150                                         iFirstItem ++;
01151                                         InvalidateRect(crc, true);
01152                                     }
01153                                     else goto ExitLoop3;
01154                                 }
01155                                 else bDownPressed = false;
01156                             }
01157                         }
01158                         break;
01159                     }
01160
01161                 case WM_KEYDOWN:
01162                     if (msg.wParam != VK_ESCAPE)
01163                         break;
01164
01165                 default:
01166                     DispatchMessage(&msg);
01167                     break;
01168                 }
01169             }
01170
01171         ExitLoop3:
01172             KillTimer(2);
01173             ReleaseCapture();
01174             AfxUnlockTempMaps(FALSE);
01175             bLooping = false;
01176             bDownPressed = false;
01177             bDownArrow = false;
01178             CRect crc;
01179             GetInsideRect(crc);
01180             InvalidateRect(crc, true);
01181         }
01182     }
01183
01184     if (ht == htUpScroll)
01185     {
01186         bLooping = true;
01187         bool bHigh = true;
01188
01189         if (::GetCapture() == NULL)
01190         {
01191             SetCapture();
01192             ASSERT(this == GetCapture());
01193             CClientDC dc(this);
01194             dc.DrawFrameControl(rcUpArrow, DFC_SCROLL, DFCS_SCROLLUP|DFCS_PUSHED);
01195             SetTimer(2,300,NULL);
01196             AfxLockTempMaps();
01197             for (;;)
01198             {
01199                 MSG msg;
01200                 VERIFY(::GetMessage(&msg, NULL, 0, 0));
01201
01202                 if (CWnd::GetCapture() != this) break;
01203
01204                 switch (msg.message)
01205                 {
01206                 case WM_MOUSEMOVE:
01207                     {
01208                         CPoint pt(msg.lParam);
01209                         if (rcUpArrow.PtInRect(pt))
01210                         {
01211                             if (bHigh == false)
01212                             {
01213                                 dc.DrawFrameControl(rcUpArrow, DFC_SCROLL, DFCS_SCROLLUP|DFCS_PUSHED);
01214                                 bHigh = true;
01215                                 bUpArrow = true;
01216                                 bUpPressed = true;
01217                             }
01218                         }
01219                         else
01220                         {
01221                             if (bHigh == true)
01222                             {
01223                                 dc.DrawFrameControl(rcUpArrow, DFC_SCROLL, DFCS_SCROLLUP);
01224                                 bHigh = false;
01225                                 bUpArrow = false;
01226                                 bUpPressed = false;
01227                             }
01228                         }
01229                     }
01230                     break;
01231
01232                 case WM_LBUTTONUP:
01233                     {
01234                         if (bHigh)
01235                         {
01236                             dc.DrawFrameControl(rcUpArrow, DFC_SCROLL, DFCS_SCROLLUP);
01237                             bHigh = false;
01238                         }
01239                         bUpArrow = false;
01240                         CPoint pt(msg.lParam);
01241                         if (rcUpArrow.PtInRect(pt))
01242                         {
01243                             if (iFirstItem > 0 )
01244                             {
01245                                 iFirstItem --;
01246                                 CRect crc;
01247                                 GetInsideRect(crc);
01248                                 InvalidateRect(crc, true);
01249                             }
01250                         }
01251                     }
01252
01253                     goto ExitLoop;
01254
01255                 case WM_TIMER:
01256                     {
01257                         if (msg.wParam == 2)
01258                         {
01259                             if (bHigh)
01260                             {
01261                                 CPoint pt(msg.pt);
01262                                 ScreenToClient(&pt);
01263                                 if (rcUpArrow.PtInRect(pt))
01264                                 {
01265                                     bUpPressed = true;
01266                                     if (iFirstItem > 0)
01267                                     {
01268                                         iFirstItem --;
01269                                         CRect crc;
01270                                         GetInsideRect(crc);
01271                                         InvalidateRect(crc, true);
01272                                     }
01273                                     else goto ExitLoop;
01274                                 }
01275                                 else bUpPressed = false;
01276                             }
01277                         }
01278                         break;
01279                     }
01280                 case WM_KEYDOWN:
01281                     if (msg.wParam != VK_ESCAPE) break;
01282
01283                 default:
01284                     DispatchMessage(&msg);
01285                     break;
01286                 }
01287             }
01288
01289         ExitLoop:
01290             KillTimer(2);
01291             ReleaseCapture();
01292             AfxUnlockTempMaps(FALSE);
01293             bLooping = false;
01294             bUpPressed = false;
01295             bUpArrow = false;
01296             CRect crc;
01297             GetInsideRect(crc);
01298             InvalidateRect(crc, true);
01299         }
01300     }
01301
01302     CWnd::OnLButtonDown(nFlags, point);
01303 }

void CGfxOutBarCtrl::OnMouseMove | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 641 of file GfxOutBarCtrl.cpp.

References HighlightFolder, HighlightItem, HitTestEx, htFolder, htItem, iLastFolderHighlighted, iLastItemHighlighted, and NULL.

00642 {
00643     int index, ht = HitTestEx(point, index);
00644
00645     if (ht != htFolder && iLastFolderHighlighted >= 0) HighlightFolder(-1);
00646     if (ht != htItem   && iLastItemHighlighted   >= 0) HighlightItem(-1);
00647
00648     if (ht == htFolder)
00649     {
00650         HighlightFolder(index);
00651         SetTimer(1,100,NULL);
00652     }
00653     else if (ht == htItem)
00654     {
00655         HighlightItem(index);
00656         SetTimer(1,100,NULL);
00657     }
00658
00659     CWnd::OnMouseMove(nFlags, point);
00660 }

void CGfxOutBarCtrl::OnPaint ( ) [protected]

Definition at line 395 of file GfxOutBarCtrl.cpp.

References arFolder, bDownArrow, bPressedHighlight, bUpArrow, crBackGroundColor, DrawFolder, GetFolderChild, GetFolderRect, GetInsideRect, GetItemCount, GetVisibleRange, HighlightFolder, HighlightItem, iLastFolderHighlighted, iLastItemHighlighted, iSelFolder, PaintItems, rcDownArrow, and rcUpArrow.

00396 {
00397     CRect clientRc;
00398     GetClientRect(&clientRc);
00399     CPaintDC dc(this);
00400     CDC memDC;
00401     memDC.CreateCompatibleDC(&dc);
00402     CBitmap bmp;
00403     bmp.CreateCompatibleBitmap(&dc, clientRc.Width(), clientRc.Height());
00404     CBitmap * obmp = memDC.SelectObject(&bmp);
00405
00406     CDC * pDC = &memDC;
00407
00408     CRect rc;
00409     GetInsideRect(rc);
00410     if (!GetFolderChild()) pDC->FillSolidRect(rc, crBackGroundColor);
00411
00412
00413     int max = arFolder.GetSize();
00414     CRect frc;
00415     for (int t = 0; t < max; t++)
00416     {
00417         GetFolderRect(t, frc);
00418         DrawFolder(pDC, t, frc, false);
00419     }
00420     if (!GetFolderChild())
00421     {
00422         int f,l;
00423         GetVisibleRange(iSelFolder, f,l);
00424         rcUpArrow.SetRect(0,0,GetSystemMetrics(SM_CXVSCROLL), GetSystemMetrics(SM_CXVSCROLL));
00425         rcDownArrow = rcUpArrow;
00426         rcUpArrow.OffsetRect(rc.right - 5 - GetSystemMetrics(SM_CXVSCROLL), rc.top +5);
00427         rcDownArrow.OffsetRect(rc.right - 5 - GetSystemMetrics(SM_CXVSCROLL), rc.bottom - 5 - GetSystemMetrics(SM_CXVSCROLL));
00428
00429         if (f > 0)
00430         {
00431             if (bUpPressed) pDC->DrawFrameControl(rcUpArrow, DFC_SCROLL, DFCS_SCROLLUP|DFCS_PUSHED);
00432             else pDC->DrawFrameControl(rcUpArrow, DFC_SCROLL, DFCS_SCROLLUP);
00433             bUpArrow = true;
00434             pDC->ExcludeClipRect(rcUpArrow);
00435         }
00436         else bUpArrow = false;
00437
00438         if (l < GetItemCount() - 1)
00439         {
00440             if (bDownPressed) pDC->DrawFrameControl(rcDownArrow, DFC_SCROLL, DFCS_SCROLLDOWN|DFCS_PUSHED);
00441             else pDC->DrawFrameControl(rcDownArrow, DFC_SCROLL, DFCS_SCROLLDOWN);
00442             bDownArrow = true;
00443             pDC->ExcludeClipRect(rcDownArrow);
00444         }
00445         else bDownArrow = false;
00446
00447         PaintItems(pDC, iSelFolder, rc);
00448     }
00449
00450     dc.BitBlt(clientRc.left, clientRc.top, clientRc.Width(), clientRc.Height(), &memDC, 0,0, SRCCOPY);
00451
00452     memDC.SelectObject(obmp);
00453
00454     if (iLastFolderHighlighted >= 0)
00455     {
00456         int i = iLastFolderHighlighted;
00457         iLastFolderHighlighted = -1;
00458         HighlightFolder(i);
00459     }
00460     if (iLastItemHighlighted >= 0)
00461     {
00462         int i = iLastItemHighlighted;
00463         iLastItemHighlighted = -1;
00464         HighlightItem(i, bPressedHighlight);
00465     }
00466
00467     // fix potential resource leak - KStowell - 10-21-99
00468     memDC.DeleteDC();
00469     bmp.DeleteObject();
00470 }

void CGfxOutBarCtrl::OnRButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 1880 of file GfxOutBarCtrl.cpp.

References ASSERT, CCJMenu::DestroyMenu, dwFlags, fEditGroups, fEditItems, fRemoveGroups, fRemoveItems, HitTestEx, htFolder, htItem, ID_GFX_REMOVEITEM, ID_GFX_RENAMEITEM, IDR_GFXOUTBAR, iHitInternal1, iHitInternal2, CCJMenu::LoadMenu, CCJMenu::LoadToolbar, m_popupMenu, m_strRemoveItem, m_strRenameItem, NULL, and VERIFY.

01881 {
01882     iHitInternal1 = HitTestEx(point, iHitInternal2);
01883
01884     SetCapture();
01885
01886     CPoint pt = point;
01887     ClientToScreen(&pt);
01888
01889     // Load the popup menu.
01890     VERIFY(m_popupMenu.LoadMenu(IDR_GFXOUTBAR));
01891     CCJMenu* pPopup = (CCJMenu*)m_popupMenu.GetSubMenu(0);
01892     ASSERT(pPopup != NULL);
01893
01894     // Load toolbar resource if any for menu icons.
01895     pPopup->LoadToolbar(IDR_GFXOUTBAR);
01896
01897     if (iHitInternal1 == htItem)
01898     {
01899         if (dwFlags&fRemoveItems || dwFlags&fEditItems)
01900         {
01901             pPopup->AppendMenu(MF_SEPARATOR);
01902             if (dwFlags&fRemoveItems)
01903                 ((CMenu*)pPopup)->AppendMenu(MF_STRING, ID_GFX_REMOVEITEM, m_strRemoveItem);
01904
01905             if (dwFlags&fEditItems)
01906                 ((CMenu*)pPopup)->AppendMenu(MF_STRING, ID_GFX_RENAMEITEM, m_strRenameItem);
01907         }
01908     }
01909     else if (iHitInternal1 == htFolder)
01910     {
01911         if (dwFlags&fRemoveGroups || dwFlags&fEditGroups)
01912         {
01913             ((CMenu*)pPopup)->AppendMenu(MF_SEPARATOR);
01914
01915             if (dwFlags&fRemoveGroups)
01916                 ((CMenu*)pPopup)->AppendMenu(MF_STRING, ID_GFX_REMOVEITEM, m_strRemoveItem);
01917
01918             if (dwFlags&fEditGroups)
01919                 ((CMenu*)pPopup)->AppendMenu(MF_STRING, ID_GFX_RENAMEITEM, m_strRenameItem);
01920         }
01921     }
01922
01923     // Display the popup menu, use the main window as its parent.
01924     pPopup->TrackPopupMenu( TPM_LEFTALIGN | TPM_RIGHTBUTTON,
01925         pt.x, pt.y, this );
01926
01927     m_popupMenu.DestroyMenu();
01928     ReleaseCapture();
01929
01930     CWnd::OnRButtonDown(nFlags, point);
01931 }

BOOL CGfxOutBarCtrl::OnSetCursor | ( | CWnd * | pWnd,
 |  | UINT | nHitTest,
 |  | UINT | message
 | ) | [protected]

Definition at line 1639 of file GfxOutBarCtrl.cpp.

References hHandCursor, HitTestEx, and htFolder.

01640 {
01641     CPoint pt(GetMessagePos());
01642     ScreenToClient(&pt);
01643     int index, ht = HitTestEx(pt, index);
01644     if (ht == htFolder)
01645     {
01646         SetCursor(hHandCursor);
01647         return true;
01648     }
01649
01650     return CWnd::OnSetCursor(pWnd, nHitTest, message);
01651 }

void CGfxOutBarCtrl::OnSize | ( | UINT | nType,
 |  | int | cx,
 |  | int | cy
 | ) | [protected]

Definition at line 1674 of file GfxOutBarCtrl.cpp.

References bDownArrow, bUpArrow, GetFolderChild, GetFolderCount, and GetInsideRect.

01675 {
01676     bUpArrow = bDownArrow = false;
01677
01678     CWnd::OnSize(nType, cx, cy);
01679
01680     int t, max = GetFolderCount();
01681     CRect rc;
01682     GetInsideRect(rc);
01683
01684     for (t = 0; t < max; t++)
01685     {
01686         CWnd * pc = GetFolderChild(t);
01687         if (pc) pc->SetWindowPos(0, rc.left, rc.top, rc.Width(), rc.Height(), SWP_NOZORDER);
01688     }
01689 }

void CGfxOutBarCtrl::OnSysColorChange ( ) [protected]

Definition at line 2346 of file GfxOutBarCtrl.cpp.

References cr3dFace, crBackGroundColor, crBackGroundColor1, crDkShadowBorder, crHilightBorder, crLightBorder, crShadowBorder, and crTextColor.

02347 {
02348     // TODO: Add your message handler code here
02349     crBackGroundColor   = ::GetSysColor(COLOR_3DSHADOW);//RGB(0,128,128);//
02350     crBackGroundColor1  = ::GetSysColor(COLOR_3DSHADOW);
02351     crTextColor         = ::GetSysColor(COLOR_WINDOW);
02352     cr3dFace            = ::GetSysColor(COLOR_3DFACE);
02353     crLightBorder       = ::GetSysColor(COLOR_3DLIGHT);
02354     crHilightBorder     = ::GetSysColor(COLOR_3DHILIGHT);
02355     crShadowBorder      = ::GetSysColor(COLOR_3DSHADOW);
02356     crDkShadowBorder    = ::GetSysColor(COLOR_3DDKSHADOW);
02357
02358     CWnd::OnSysColorChange();
02359 }

void CGfxOutBarCtrl::OnTimer ( UINT nIDEvent ) [protected]

Definition at line 298 of file GfxOutBarCtrl.cpp.

References DrawAnimItem, HighlightFolder, HighlightItem, iLastSel, and iSelAnimCount.

00299 {
00300     if (nIDEvent == 1)
00301     {
00302         CPoint pt(GetMessagePos());
00303
00304         ScreenToClient(&pt);
00305
00306         CRect rc;
00307         GetClientRect(&rc);
00308         if (!(rc.PtInRect(pt)))
00309         {
00310             HighlightFolder(-1);
00311             HighlightItem(-1);
00312             KillTimer(1);
00313         }
00314     }
00315     else if (nIDEvent == 3 && iLastSel >= 0)
00316     {
00317         iSelAnimCount ++;
00318         if (iSelAnimCount > 10) iSelAnimCount = -1;
00319         if (iSelAnimCount == 0)
00320             DrawAnimItem(-1, 1, iLastSel);
00321         if (iSelAnimCount == 1)
00322             DrawAnimItem(0, 0, iLastSel);
00323         if (iSelAnimCount == 2)
00324             DrawAnimItem(1, 1, iLastSel);
00325         if (iSelAnimCount == 3)
00326             DrawAnimItem(0, 0, iLastSel);
00327     }
00328     CWnd::OnTimer(nIDEvent);
00329 }

void CGfxOutBarCtrl::OnUpdateGfxLargeicon ( CCmdUI * pCmdUI ) [protected]

Definition at line 1939 of file GfxOutBarCtrl.cpp.

References IsSmallIconView.

01940 {
01941     pCmdUI->Enable(IsSmallIconView());
01942 }

void CGfxOutBarCtrl::OnUpdateGfxRemoveitem ( CCmdUI * pCmdUI ) [protected]

Definition at line 1967 of file GfxOutBarCtrl.cpp.

01968 {
01969
01970 }

void CGfxOutBarCtrl::OnUpdateGfxRenameitem ( CCmdUI * pCmdUI ) [protected]

Definition at line 1984 of file GfxOutBarCtrl.cpp.

01985 {
01986 }

void CGfxOutBarCtrl::OnUpdateGfxSmallicon ( CCmdUI * pCmdUI ) [protected]

Definition at line 1950 of file GfxOutBarCtrl.cpp.

References IsSmallIconView.

01951 {
01952     pCmdUI->Enable(!IsSmallIconView());
01953 }

void CGfxOutBarCtrl::PaintItems | ( | CDC * | pDC,
 |  | const int | iFolder,
 |  | CRect | rc
 | ) | [virtual]

Definition at line 1470 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, DrawItem, GetFolderCount, GetInsideRect, GetItemRect, and iFirstItem.

Referenced by AnimateFolderScroll, and OnPaint.

01471 {
01472     ASSERT(iFolder >= 0 && iFolder < GetFolderCount());
01473     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iFolder);
01474     int max = pbf->GetItemCount(), t;
01475     CRect irc;
01476     GetInsideRect(irc);
01477     int isdc = pDC->SaveDC();
01478     CRgn itemRegion;
01479     itemRegion.CreateRectRgnIndirect(&irc);
01480     pDC->SelectClipRgn(&itemRegion);
01481     itemRegion.DeleteObject();
01482     for (t = iFirstItem; t < max; t++)
01483     {
01484         CRect itemRc;
01485         GetItemRect(iFolder, t, itemRc);
01486         if (itemRc.top > rc.bottom) break;
01487         else DrawItem(pDC, iFolder, itemRc, t);
01488     }
01489     pDC->RestoreDC(isdc);
01490 }

void CGfxOutBarCtrl::RemoveFolder ( const int index ) [virtual]

Definition at line 1363 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, GetFolderCount, and iSelFolder.

Referenced by OnGfxRemoveitem.

01364 {
01365     ASSERT(index >= 0 && index < GetFolderCount());
01366     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(index);
01367     delete pbf;
01368     arFolder.RemoveAt(index);
01369     if (iSelFolder >= index) iSelFolder = index - 1;
01370     if (iSelFolder < 0 && GetFolderCount() > 0) iSelFolder = 0;
01371     Invalidate();
01372 }

void CGfxOutBarCtrl::RemoveItem ( const int index ) [virtual]

Definition at line 1988 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, GetFolderCount, GetInsideRect, GetItemCount, iSelFolder, and IsValidItem.

Referenced by OnGfxRemoveitem.

01989 {
01990     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
01991     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
01992     ASSERT(index >= 0 && index < pbf->GetItemCount());
01993     if (IsValidItem(index))
01994     {
01995         CBarItem * i = (CBarItem *) pbf->arItems.GetAt(index);
01996         delete i;
01997
01998         pbf->arItems.RemoveAt(index);
01999         CRect rc;
02000         GetInsideRect(rc);
02001         InvalidateRect(rc);
02002     }
02003 }

virtual void CGfxOutBarCtrl::SetAnimationTickCount ( const long value ) [inline, virtual]

Definition at line 165 of file GfxOutBarCtrl.h.

00165 { lAnimationTickCount = value; };

void CGfxOutBarCtrl::SetAnimSelHighlight ( const int iTime ) [virtual]

Definition at line 2339 of file GfxOutBarCtrl.cpp.

References iSelAnimTiming, and NULL.

02340 {
02341     if (iTime <= 0) KillTimer(3);
02342     else SetTimer(3, iTime, NULL);
02343     iSelAnimTiming = iTime;
02344 }

CImageList * CGfxOutBarCtrl::SetFolderImageList | ( | const int | folder,
 |  | CImageList * | pImageList,
 |  | int | nImageList
 | ) | [virtual]

Definition at line 1426 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, fLargeIcon, fSmallIcon, GetFolderCount, and NULL.

01427 {
01428     ASSERT(folder >= 0 && folder < GetFolderCount());
01429     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(folder);
01430     CImageList * o = NULL;
01431     if (nImageList == fSmallIcon)
01432     {
01433         o = pbf->pSmallImageList;
01434         pbf->pSmallImageList = pImageList;
01435     }
01436     else if (nImageList == fLargeIcon)
01437     {
01438         o = pbf->pLargeImageList;
01439         pbf->pLargeImageList = pImageList;
01440     }
01441     return o;
01442 }

void CGfxOutBarCtrl::SetFolderText | ( | const int | index,
 |  | LPCTSTR | text
 | ) | [virtual]

Definition at line 197 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, GetFolderCount, and NULL.

Referenced by OnEndLabelEdit.

00198 {
00199     ASSERT(index >= 0 && index < GetFolderCount());
00200
00201     CBarFolder* pbf = (CBarFolder *) arFolder.GetAt(index);
00202
00203     if( pbf->cName )
00204     {
00205         delete [] pbf->cName;
00206         pbf->cName = NULL;
00207     }
00208
00209     pbf->cName = new TCHAR[ _tcslen( text ) + 1 ];
00210
00211     _tcscpy( pbf->cName, text );
00212 }

CImageList * CGfxOutBarCtrl::SetImageList | ( | CImageList * | pImageList,
 |  | int | nImageList
 | ) | [virtual]

Definition at line 1403 of file GfxOutBarCtrl.cpp.

References fLargeIcon, fSmallIcon, NULL, pLargeImageList, and pSmallImageList.

01404 {
01405     CImageList * o = NULL;
01406     if (nImageList == fSmallIcon)
01407     {
01408         o = pSmallImageList;
01409         pSmallImageList = pImageList;
01410     }
01411     else if (nImageList == fLargeIcon)
01412     {
01413         o = pLargeImageList;
01414         pLargeImageList = pImageList;
01415     }
01416     return o;
01417 }

void CGfxOutBarCtrl::SetItemData | ( | const int | index,
 |  | const DWORD | dwData
 | ) | [virtual]

Definition at line 2036 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, GetFolderCount, iSelFolder, and IsValidItem.

02037 {
02038     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
02039     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
02040     if (IsValidItem(index))
02041     {
02042         CBarItem * i = (CBarItem *) pbf->arItems.GetAt(index);
02043         i->dwData = dwData;
02044     }
02045 }

void CGfxOutBarCtrl::SetItemImage | ( | const int | index,
 |  | const int | iImage
 | ) | [virtual]

Definition at line 2047 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, GetFolderCount, iSelFolder, and IsValidItem.

02048 {
02049     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
02050     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
02051     if (IsValidItem(index))
02052     {
02053         CBarItem * i = (CBarItem *) pbf->arItems.GetAt(index);
02054         i->iImageIndex = iImage;
02055     }
02056 }

void CGfxOutBarCtrl::SetItemText | ( | const int | index,
 |  | LPCTSTR | text
 | ) | [virtual]

Definition at line 214 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, GetFolderCount, iSelFolder, and NULL.

Referenced by OnEndLabelEdit.

00215 {
00216     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
00217
00218     CBarFolder* pbf = (CBarFolder*) arFolder.GetAt(iSelFolder);
00219
00220     CBarItem*   pi  = (CBarItem*) pbf->arItems.GetAt(index);
00221
00222     if (pi->cItem)
00223     {
00224         delete [] pi->cItem;
00225         pi->cItem = NULL;
00226     }
00227
00228     pi->cItem = new TCHAR[ _tcslen( text ) + 1 ];
00229
00230     _tcscpy( pi->cItem, text );
00231 }

void CGfxOutBarCtrl::SetSelFolder ( const int index ) [virtual]

Definition at line 1322 of file GfxOutBarCtrl.cpp.

References AnimateFolderScroll, ASSERT, dwFlags, fAnimation, GetFolderChild, GetFolderCount, GetInsideRect, iFirstItem, iLastSel, iSelFolder, lAnimationTickCount, NM_FOLDERCHANGE, and WM_OUTBAR_NOTIFY.

Referenced by OnLButtonDown.

01323 {
01324     ASSERT(index >= 0 && index < GetFolderCount());
01325 //  if (index == iSelFolder) return;
01326
01327     CWnd * pc = GetFolderChild();
01328     if (pc) pc->ShowWindow(SW_HIDE);
01329
01330     if (index != iSelFolder)
01331     {
01332         if (dwFlags&fAnimation && lAnimationTickCount >= 0) AnimateFolderScroll(iSelFolder, index);
01333     }
01334
01335     iSelFolder = index;
01336     iFirstItem = 0;
01337     iLastSel = -1;
01338
01339     pc = GetFolderChild();
01340     if (pc)
01341     {
01342         CRect rc;
01343         GetInsideRect(rc);
01344         pc->MoveWindow(rc);
01345         pc->ShowWindow(SW_SHOW);
01346     }
01347
01348     GetOwner()->SendMessage(WM_OUTBAR_NOTIFY, NM_FOLDERCHANGE, (LPARAM) iSelFolder);
01349
01350     Invalidate();
01351 }

void CGfxOutBarCtrl::SetSmallIconView ( const bool bSet ) [virtual]

Definition at line 245 of file GfxOutBarCtrl.cpp.

References dwFlags, fSmallIcon, GetInsideRect, iFirstItem, and IsSmallIconView.

Referenced by OnGfxLargeicon, and OnGfxSmallicon.

00246 {
00247     iFirstItem = 0;
00248
00249     if (bSet)
00250     {
00251         if (!IsSmallIconView())
00252         {
00253             dwFlags |= fSmallIcon;
00254             CRect rc;
00255             GetInsideRect(rc);
00256             InvalidateRect(rc, false);
00257         }
00258     }
00259     else
00260     {
00261         if (IsSmallIconView())
00262         {
00263             dwFlags &= ~fSmallIcon;
00264             CRect rc;
00265             GetInsideRect(rc);
00266             InvalidateRect(rc, false);
00267         }
00268     }
00269 }

void CGfxOutBarCtrl::StartGroupEdit ( const int index ) [virtual]

Definition at line 1825 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, GetFolderCount, GetFolderRect, CGfxGroupEdit::iIndex, CGfxGroupEdit::msgSend, and NM_OB_ONGROUPENDEDIT.

Referenced by OnGfxRenameitem.

01826 {
01827     CGfxGroupEdit * pEdit = new CGfxGroupEdit;
01828     pEdit->iIndex = index;
01829     CRect rc;
01830     GetFolderRect(index, rc);
01831     rc.InflateRect(-2,-2);
01832     pEdit->Create(WS_CHILD|WS_VISIBLE|ES_CENTER|ES_MULTILINE,rc,this,1);
01833     pEdit->msgSend = NM_OB_ONGROUPENDEDIT;
01834     pEdit->ModifyStyleEx(0, WS_EX_CLIENTEDGE, SWP_FRAMECHANGED);
01835     ASSERT(index >= 0 && index < GetFolderCount());
01836     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(index);
01837     pEdit->SetWindowText(pbf->cName);
01838     pEdit->SetFocus();
01839 }

void CGfxOutBarCtrl::StartItemEdit ( const int index ) [virtual]

Definition at line 1841 of file GfxOutBarCtrl.cpp.

References arFolder, ASSERT, CGfxGroupEdit::bNoDown, GetFolderCount, GetIconRect, GetInsideRect, GetItemCount, GetLabelRect, CGfxGroupEdit::iIndex, iSelFolder, IsSmallIconView, CGfxGroupEdit::msgSend, and NM_OB_ONLABELENDEDIT.

Referenced by OnGfxRenameitem.

01842 {
01843     ASSERT(iSelFolder >= 0 && iSelFolder < GetFolderCount());
01844     CBarFolder * pbf = (CBarFolder *) arFolder.GetAt(iSelFolder);
01845     ASSERT(index >= 0 && index < pbf->GetItemCount());
01846     CBarItem * pi = (CBarItem *) pbf->arItems.GetAt(index);
01847
01848     CGfxGroupEdit * pEdit = new CGfxGroupEdit;
01849     pEdit->iIndex = index;
01850     CRect rc, crc;
01851     GetLabelRect(iSelFolder, index, rc);
01852     GetInsideRect(crc);
01853
01854     DWORD dwFlag = WS_CHILD|WS_VISIBLE|WS_BORDER;
01855
01856     if (!IsSmallIconView())
01857     {
01858         rc.left = crc.left + 5;
01859         rc.right = crc.right - 5;
01860         rc.bottom += 5;
01861         dwFlag |= ES_CENTER|ES_MULTILINE;
01862     }
01863     else
01864     {
01865         CRect irc;
01866         GetIconRect(iSelFolder, index, irc);
01867         dwFlag |= ES_AUTOHSCROLL;
01868         rc.OffsetRect(irc.Width()+1, -6);
01869         pEdit->bNoDown = true;
01870     }
01871
01872     pEdit->Create(dwFlag, rc, this, 1);
01873     pEdit->msgSend = NM_OB_ONLABELENDEDIT;
01874
01875     pEdit->SetWindowText(pi->cItem);
01876     pEdit->SetFocus();
01877
01878 }

Member Data Documentation

CPtrArray CGfxOutBarCtrl::arFolder

Definition at line 97 of file GfxOutBarCtrl.h.

Referenced by AddFolder, AddFolderBar, DrawAnimItem, DrawFolder, DrawItem, GetFolderChild, GetFolderCount, GetFolderData, GetFolderImageList, GetFolderRect, GetInsideRect, GetItemCount, GetItemData, GetItemImage, GetItemSize, GetItemText, GetVisibleRange, HitTestEx, InsertItem, IsValidItem, OnLButtonDown, OnPaint, PaintItems, RemoveFolder, RemoveItem, SetFolderImageList, SetFolderText, SetItemData, SetItemImage, SetItemText, StartGroupEdit, StartItemEdit, and ~CGfxOutBarCtrl.

bool CGfxOutBarCtrl::bDownArrow

Definition at line 83 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, HitTestEx, OnLButtonDown, OnPaint, and OnSize.

bool CGfxOutBarCtrl::bDownPressed

Definition at line 83 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, and OnLButtonDown.

bool CGfxOutBarCtrl::bLooping

Definition at line 85 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, and OnLButtonDown.

bool CGfxOutBarCtrl::bPressedHighlight

Definition at line 104 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, OnLButtonDown, and OnPaint.

bool CGfxOutBarCtrl::bUpArrow

Definition at line 83 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, HitTestEx, OnLButtonDown, OnPaint, and OnSize.

bool CGfxOutBarCtrl::bUpPressed

Definition at line 83 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, and OnLButtonDown.

COLORREF CGfxOutBarCtrl::cr3dFace

Definition at line 76 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, DrawFolder, DrawItem, HighlightFolder, HighlightItem, and OnSysColorChange.

COLORREF CGfxOutBarCtrl::crBackGroundColor

Definition at line 74 of file GfxOutBarCtrl.h.

Referenced by AnimateFolderScroll, CGfxOutBarCtrl, DrawAnimItem, HighlightItem, OnPaint, and OnSysColorChange.

COLORREF CGfxOutBarCtrl::crBackGroundColor1

Definition at line 74 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, DrawFolder, HighlightFolder, and OnSysColorChange.

COLORREF CGfxOutBarCtrl::crDkShadowBorder

Definition at line 76 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, DrawFolder, DrawItem, HighlightFolder, HighlightItem, and OnSysColorChange.

COLORREF CGfxOutBarCtrl::crHilightBorder

Definition at line 76 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, DrawFolder, and OnSysColorChange.

COLORREF CGfxOutBarCtrl::crLightBorder

Definition at line 76 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, and OnSysColorChange.

COLORREF CGfxOutBarCtrl::crShadowBorder

Definition at line 76 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, and OnSysColorChange.

COLORREF CGfxOutBarCtrl::crTextColor

Definition at line 75 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, DrawItem, and OnSysColorChange.

DWORD CGfxOutBarCtrl::dwFlags

Definition at line 95 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, Create, DrawItem, GetFlag, HighlightItem, IsSmallIconView, ModifyFlag, OnLButtonDown, OnRButtonDown, SetSelFolder, and SetSmallIconView.

HCURSOR CGfxOutBarCtrl::hDragCursor

Definition at line 139 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, and OnLButtonDown.

HCURSOR CGfxOutBarCtrl::hHandCursor

Definition at line 138 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, and OnSetCursor.

HCURSOR CGfxOutBarCtrl::hNoDragCursor

Definition at line 140 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, and OnLButtonDown.

int CGfxOutBarCtrl::iFirstItem

Definition at line 101 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, DrawAnimItem, GetIconRect, GetItemRect, GetLabelRect, GetVisibleRange, HitTestEx, OnLButtonDown, PaintItems, SetSelFolder, and SetSmallIconView.

int CGfxOutBarCtrl::iFolderHeight

Definition at line 77 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, GetFolderRect, and GetInsideRect.

int CGfxOutBarCtrl::iHitInternal1

Definition at line 87 of file GfxOutBarCtrl.h.

Referenced by OnGfxRemoveitem, OnGfxRenameitem, and OnRButtonDown.

int CGfxOutBarCtrl::iHitInternal2

Definition at line 87 of file GfxOutBarCtrl.h.

Referenced by OnGfxRemoveitem, OnGfxRenameitem, and OnRButtonDown.

int CGfxOutBarCtrl::iLastDragItemDraw

Definition at line 106 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, DrawDragArrow, and OnLButtonDown.

int CGfxOutBarCtrl::iLastDragItemDrawType

Definition at line 106 of file GfxOutBarCtrl.h.

Referenced by DrawDragArrow, and OnLButtonDown.

int CGfxOutBarCtrl::iLastFolderHighlighted

Definition at line 99 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, HighlightFolder, OnMouseMove, and OnPaint.

int CGfxOutBarCtrl::iLastItemHighlighted

Definition at line 103 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, HighlightItem, OnLButtonDown, OnMouseMove, and OnPaint.

int CGfxOutBarCtrl::iLastSel

Definition at line 91 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, DrawAnimItem, DrawItem, HighlightItem, OnLButtonDown, OnTimer, and SetSelFolder.

int CGfxOutBarCtrl::iLastSelectedFolder

Definition at line 100 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, and OnLButtonDown.

int CGfxOutBarCtrl::iSelAnimCount

Definition at line 92 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, and OnTimer.

int CGfxOutBarCtrl::iSelAnimTiming

Definition at line 91 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, HighlightItem, OnLButtonDown, and SetAnimSelHighlight.

int CGfxOutBarCtrl::iSelFolder

Definition at line 133 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, DrawAnimItem, DrawItem, GetDragItemRect, GetFolderChild, GetFolderData, GetFolderRect, GetInsideRect, GetItemCount, GetItemData, GetItemImage, GetItemText, GetSelFolder, HighlightItem, HitTestEx, IsValidItem, OnLButtonDown, OnPaint, RemoveFolder, RemoveItem, SetItemData, SetItemImage, SetItemText, SetSelFolder, and StartItemEdit.

long CGfxOutBarCtrl::lAnimationTickCount

Definition at line 89 of file GfxOutBarCtrl.h.

Referenced by AnimateFolderScroll, CGfxOutBarCtrl, and SetSelFolder.

CCJMenu CGfxOutBarCtrl::m_popupMenu

Definition at line 144 of file GfxOutBarCtrl.h.

Referenced by OnRButtonDown.

CString CGfxOutBarCtrl::m_strRemoveItem

Definition at line 145 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, and OnRButtonDown.

CString CGfxOutBarCtrl::m_strRenameItem

Definition at line 146 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, and OnRButtonDown.

CPen* CGfxOutBarCtrl::pBlackPen

Definition at line 142 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, DrawDragArrow, and ~CGfxOutBarCtrl.

CImageList* CGfxOutBarCtrl::pLargeImageList

Definition at line 135 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, GetFolderImageList, GetImageList, and SetImageList.

CImageList* CGfxOutBarCtrl::pSmallImageList

Definition at line 136 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, GetFolderImageList, GetImageList, and SetImageList.

CRect CGfxOutBarCtrl::rcDownArrow

Definition at line 84 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, HitTestEx, OnLButtonDown, and OnPaint.

CRect CGfxOutBarCtrl::rcUpArrow

Definition at line 84 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, HitTestEx, OnLButtonDown, and OnPaint.

int CGfxOutBarCtrl::xLeftMargin

Definition at line 82 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, GetIconRect, GetItemRect, and GetLabelRect.

int CGfxOutBarCtrl::xSmallIconLabelOffset

Definition at line 79 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, DrawItem, and GetItemSize.

int CGfxOutBarCtrl::yLargeIconLabelOffset

Definition at line 79 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, DrawItem, GetItemSize, and HitTestEx.

int CGfxOutBarCtrl::yLargeIconSpacing

Definition at line 80 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, GetIconRect, GetItemRect, GetItemSize, and GetLabelRect.

int CGfxOutBarCtrl::ySmallIconSpacing

Definition at line 80 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, GetIconRect, GetItemRect, and GetLabelRect.

int CGfxOutBarCtrl::yTopMargin

Definition at line 82 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl, GetIconRect, GetItemRect, and GetLabelRect.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/GfxOutBarCtrl.h
  • WinCvs/CJLib/CJLibrary/GfxOutBarCtrl.cpp
Generated on Sun Feb 24 01:26:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CGfxOutBarCtrl::CBarFolder Class Reference

#include <GfxOutBarCtrl.h>

Collaboration diagram for CGfxOutBarCtrl::CBarFolder:

[legend]
List of all members.

Public Methods

CBarFolder (LPCTSTR name, DWORD exData)
virtual | ~CBarFolder ()
int | GetItemCount ()
int | InsertItem (int index, LPCTSTR text, const int image, const DWORD exData)

Public Attributes

LPTSTR | cName
DWORD | dwData
CImageList * | pLargeImageList
CImageList * | pSmallImageList
CPtrArray | arItems
CWnd * pChild

Constructor & Destructor Documentation

CGfxOutBarCtrl::CBarFolder::CBarFolder | ( | LPCTSTR | name,
 |  | DWORD | exData
 | ) |

Definition at line 601 of file GfxOutBarCtrl.cpp.

References ASSERT, cName, dwData, NULL, pChild, pLargeImageList, and pSmallImageList.

Referenced by ~CBarFolder.

00602 {
00603     cName  = NULL;
00604     dwData = exData;
00605
00606     if( name )
00607     {
00608         cName = new TCHAR[ _tcslen( name ) + 1 ];
00609
00610         ASSERT(cName);
00611
00612         _tcscpy( cName, name );
00613     }
00614
00615     pLargeImageList = NULL;
00616     pSmallImageList = NULL;
00617     pChild          = NULL;
00618 }

CGfxOutBarCtrl::CBarFolder::~CBarFolder ( ) [virtual]

Definition at line 620 of file GfxOutBarCtrl.cpp.

References arItems, CBarFolder, and cName.

00621 {
00622     if (cName) delete [] cName;
00623     for (int t = 0; t < arItems.GetSize(); t++)
00624         if (arItems.GetAt(t)) delete (CBarFolder*) arItems.GetAt(t);
00625
00626     arItems.RemoveAll();
00627 }

Member Function Documentation

int CGfxOutBarCtrl::CBarFolder::GetItemCount ( )

Definition at line 1465 of file GfxOutBarCtrl.cpp.

References arItems.

Referenced by InsertItem.

01466 {
01467     return arItems.GetSize();
01468 }

int CGfxOutBarCtrl::CBarFolder::InsertItem | ( | int | index,
 |  | LPCTSTR | text,
 |  | const int | image,
 |  | const DWORD | exData
 | ) |

Definition at line 1374 of file GfxOutBarCtrl.cpp.

References arItems, ASSERT, and GetItemCount.

01375 {
01376     if (index < 0 || index > GetItemCount()) index = GetItemCount();
01377
01378     int c = GetItemCount();
01379
01380     CBarItem* pbf = new CBarItem(text, image, exData);
01381
01382     ASSERT(pbf);
01383
01384     if( index < GetItemCount())
01385     {
01386         arItems.InsertAt(index, (void *) pbf);
01387     }
01388     else
01389     {
01390         arItems.Add((void *) pbf);
01391     }
01392
01393     c = GetItemCount();
01394
01395     return index;
01396 }

Member Data Documentation

CPtrArray CGfxOutBarCtrl::CBarFolder::arItems

Definition at line 129 of file GfxOutBarCtrl.h.

Referenced by GetItemCount, InsertItem, and ~CBarFolder.

LPTSTR CGfxOutBarCtrl::CBarFolder::cName

Definition at line 125 of file GfxOutBarCtrl.h.

Referenced by CBarFolder, and ~CBarFolder.

DWORD CGfxOutBarCtrl::CBarFolder::dwData

Definition at line 126 of file GfxOutBarCtrl.h.

Referenced by CBarFolder.

CWnd* CGfxOutBarCtrl::CBarFolder::pChild

Definition at line 130 of file GfxOutBarCtrl.h.

Referenced by CBarFolder.

CImageList* CGfxOutBarCtrl::CBarFolder::pLargeImageList

Definition at line 127 of file GfxOutBarCtrl.h.

Referenced by CBarFolder.

CImageList* CGfxOutBarCtrl::CBarFolder::pSmallImageList

Definition at line 128 of file GfxOutBarCtrl.h.

Referenced by CBarFolder.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/GfxOutBarCtrl.h
  • WinCvs/CJLib/CJLibrary/GfxOutBarCtrl.cpp
Generated on Sun Feb 24 01:26:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CGfxOutBarCtrl::CBarItem Class Reference

#include <GfxOutBarCtrl.h>

Collaboration diagram for CGfxOutBarCtrl::CBarItem:

[legend]
List of all members.

Public Methods

CBarItem (LPCTSTR name, const int image, DWORD exData)
virtual | ~CBarItem ()

Public Attributes

int | iImageIndex
LPTSTR | cItem
DWORD | dwData

Constructor & Destructor Documentation

CGfxOutBarCtrl::CBarItem::CBarItem | ( | LPCTSTR | name,
 |  | const int | image,
 |  | DWORD | exData
 | ) |

Definition at line 1444 of file GfxOutBarCtrl.cpp.

References ASSERT, cItem, dwData, iImageIndex, and NULL.

01445 {
01446     cItem       = NULL;
01447     iImageIndex = image;
01448     dwData      = exData;
01449
01450     if( name )
01451     {
01452         cItem = new TCHAR[ _tcslen( name ) + 1 ];
01453
01454         ASSERT(cItem);
01455
01456         _tcscpy( cItem, name );
01457     }
01458 }

CGfxOutBarCtrl::CBarItem::~CBarItem ( ) [virtual]

Definition at line 1460 of file GfxOutBarCtrl.cpp.

References cItem.

01461 {
01462     if (cItem) delete [] cItem;
01463 }

Member Data Documentation

LPTSTR CGfxOutBarCtrl::CBarItem::cItem

Definition at line 114 of file GfxOutBarCtrl.h.

Referenced by CBarItem, and ~CBarItem.

DWORD CGfxOutBarCtrl::CBarItem::dwData

Definition at line 115 of file GfxOutBarCtrl.h.

Referenced by CBarItem.

int CGfxOutBarCtrl::CBarItem::iImageIndex

Definition at line 113 of file GfxOutBarCtrl.h.

Referenced by CBarItem.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/GfxOutBarCtrl.h
  • WinCvs/CJLib/CJLibrary/GfxOutBarCtrl.cpp
Generated on Sun Feb 24 01:26:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CGfxSplitterWnd Class Reference

#include <GfxSplitterWnd.h>

Inheritance diagram for CGfxSplitterWnd:

[legend]
Collaboration diagram for CGfxSplitterWnd:

[legend]
List of all members.

Public Methods

CGfxSplitterWnd ()
virtual | ~CGfxSplitterWnd ()
virtual void | OnDrawSplitter (CDC *pDC, ESplitType nType, const CRect &rectArg)
virtual void | OnInvertTracker (const CRect &rect)
virtual void | RecalcLayout ()

Public Attributes

int | m_upBorder
bool | bWhiteLine

Protected Methods

virtual void | GetInsideRect (CRect &rect) const
afx_msg BOOL | OnEraseBkgnd (CDC *pDC)
afx_msg void | OnPaint ()

Constructor & Destructor Documentation

CGfxSplitterWnd::CGfxSplitterWnd ( )

Definition at line 62 of file GfxSplitterWnd.cpp.

References bNotWin4, bWhiteLine, and m_upBorder.

00063 {
00064     m_cxBorder = 0;
00065     m_cyBorder = 0;
00066     m_cxSplitter = m_cySplitter = 2 + 2;
00067     m_cxSplitterGap = m_cySplitterGap = 2 + 2;
00068
00069
00070     DWORD dwVersion = ::GetVersion();
00071     BOOL bWin4 = (BYTE)dwVersion >= 4;
00072     bNotWin4 = 1 - bWin4;   // for convenience
00073
00074     m_upBorder = 5;
00075     bWhiteLine = false;
00076 }

CGfxSplitterWnd::~CGfxSplitterWnd ( ) [virtual]

Definition at line 78 of file GfxSplitterWnd.cpp.

00079 {
00080
00081 }

Member Function Documentation

void CGfxSplitterWnd::GetInsideRect ( CRect & rect ) const [protected, virtual]

Definition at line 364 of file GfxSplitterWnd.cpp.

References m_upBorder.

Referenced by RecalcLayout.

00365 {
00366     CSplitterWnd::GetInsideRect(rect);
00367     rect.top += m_upBorder;
00368 /*  ASSERT_VALID(this);
00369
00370     GetClientRect(rect);
00371     ASSERT(rect.left == 0 && rect.top == 0);
00372
00373     // subtract space for 3d borders
00374     rect.InflateRect(-m_cxBorder, -m_cyBorder);
00375     rect.top += m_upBorder;
00376
00377     // subtract scrollbar clearance
00378     if (m_bHasVScroll)
00379         rect.right -= GetSystemMetrics(SM_CXVSCROLL);
00380     if (m_bHasHScroll)
00381         rect.bottom -= GetSystemMetrics(SM_CYHSCROLL);*/
00382 }

void CGfxSplitterWnd::OnDrawSplitter | ( | CDC * | pDC,
 |  | ESplitType | nType,
 |  | const CRect & | rectArg
 | ) | [virtual]

Definition at line 83 of file GfxSplitterWnd.cpp.

References CX_BORDER, CY_BORDER, and NULL.

00084 {
00085     if (pDC == NULL)
00086     {
00087         RedrawWindow(rectArg, NULL, RDW_INVALIDATE|RDW_NOCHILDREN);
00088         return;
00089     }
00090     ASSERT_VALID(pDC);
00091     CRect rect = rectArg;
00092     switch (nType)
00093     {
00094     case splitBorder:
00095         return;
00096     case splitBox:
00097         pDC->Draw3dRect(rect, GetSysColor(COLOR_3DFACE), GetSysColor(COLOR_WINDOWFRAME));
00098         rect.InflateRect(-CX_BORDER, -CY_BORDER);
00099         pDC->Draw3dRect(rect, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNSHADOW));
00100         rect.InflateRect(-CX_BORDER, -CY_BORDER);
00101         break;
00102     }
00103
00104     COLORREF clr = GetSysColor(COLOR_3DFACE);
00105     pDC->FillSolidRect(rect, clr);
00106 }

BOOL CGfxSplitterWnd::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 384 of file GfxSplitterWnd.cpp.

References m_upBorder.

00385 {
00386 //  return CSplitterWnd::OnEraseBkgnd(pDC);
00387
00388     CRect rectClient;
00389     GetClientRect(rectClient);
00390     rectClient.InflateRect(-m_cxBorder, -m_cyBorder);
00391     rectClient.bottom = rectClient.top + m_upBorder;
00392     pDC->FillSolidRect(rectClient, GetSysColor(COLOR_3DFACE));
00393     return true;
00394 }

void CGfxSplitterWnd::OnInvertTracker ( const CRect & rect ) [virtual]

Definition at line 108 of file GfxSplitterWnd.cpp.

References ASSERT, and NULL.

00109 {
00110     ASSERT_VALID(this);
00111     ASSERT(!rect.IsRectEmpty());
00112     ASSERT((GetStyle() & WS_CLIPCHILDREN) == 0);
00113
00114     CDC* pDC = GetDC();
00115     CBrush* pBrush = CDC::GetHalftoneBrush();
00116     CBrush* pOldBrush = NULL;
00117
00118     if (pBrush != NULL) {
00119         pOldBrush = pDC->SelectObject(pBrush);
00120     }
00121
00122     pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATINVERT);
00123
00124     if (pOldBrush != NULL) {
00125         pDC->SelectObject(pOldBrush);
00126     }
00127     ReleaseDC(pDC);
00128 }

void CGfxSplitterWnd::OnPaint ( ) [protected]

Definition at line 396 of file GfxSplitterWnd.cpp.

00397 {
00398     CSplitterWnd::OnPaint();
00399     if (bWhiteLine)
00400     {
00401         CClientDC dc(this);
00402         CRect rectClient;
00403         GetClientRect(rectClient);
00404         CPen pn(PS_SOLID, 1, GetSysColor(COLOR_3DSHADOW));
00405         CPen * op = dc.SelectObject(&pn);
00406         dc.MoveTo(rectClient.left, rectClient.top);
00407         dc.LineTo(rectClient.right, rectClient.top);
00408         CPen pn1(PS_SOLID, 1, GetSysColor(COLOR_3DHILIGHT));
00409         dc.SelectObject(&pn1);
00410         dc.MoveTo(rectClient.left, rectClient.top+1);
00411         dc.LineTo(rectClient.right, rectClient.top+1);
00412         dc.SelectObject(op);
00413
00414         // fix potential resource leak - KStowell - 10-21-99
00415         pn.DeleteObject();
00416         pn1.DeleteObject();
00417     }
00418 }

void CGfxSplitterWnd::RecalcLayout ( ) [virtual]

Definition at line 256 of file GfxSplitterWnd.cpp.

References ASSERT, bNotWin4, DeferClientPos, FALSE, GetInsideRect, LayoutRowCol, m_upBorder, NULL, and TRUE.

00257 {
00258     ASSERT_VALID(this);
00259     ASSERT(m_nRows > 0 && m_nCols > 0); // must have at least one pane
00260
00261     CRect rectClient;
00262     GetClientRect(rectClient);
00263     rectClient.InflateRect(-m_cxBorder, -m_cyBorder);
00264     rectClient.top += m_upBorder;
00265
00266     CRect rectInside;
00267     GetInsideRect(rectInside);
00268
00269     // layout columns (restrict to possible sizes)
00270     LayoutRowCol(m_pColInfo, m_nCols, rectInside.Width(), m_cxSplitterGap);
00271     LayoutRowCol(m_pRowInfo, m_nRows, rectInside.Height(), m_cySplitterGap);
00272
00273     // adjust the panes (and optionally scroll bars)
00274
00275     // give the hint for the maximum number of HWNDs
00276     AFX_SIZEPARENTPARAMS layout;
00277     layout.hDWP = ::BeginDeferWindowPos((m_nCols + 1) * (m_nRows + 1) + 1);
00278
00279     // size of scrollbars
00280     int cx = (rectClient.right - rectInside.right - bNotWin4);// - afxData.bNotWin4;
00281     int cy = (rectClient.bottom - rectInside.bottom - bNotWin4);// - afxData.bNotWin4;
00282
00283     // reposition size box
00284     if (m_bHasHScroll && m_bHasVScroll)
00285     {
00286         CWnd* pScrollBar = GetDlgItem(AFX_IDW_SIZE_BOX);
00287         ASSERT(pScrollBar != NULL);
00288
00289         // fix style if necessary
00290         BOOL bSizingParent = (GetSizingParent() != NULL);
00291         // modifyStyle returns TRUE if style changes
00292         if (pScrollBar->ModifyStyle(SBS_SIZEGRIP|SBS_SIZEBOX,
00293                 bSizingParent ? SBS_SIZEGRIP : SBS_SIZEBOX))
00294             pScrollBar->Invalidate();
00295         pScrollBar->EnableWindow(bSizingParent);
00296
00297         // reposition the size box
00298         DeferClientPos(&layout, pScrollBar,
00299             rectInside.right + bNotWin4,
00300             rectInside.bottom + bNotWin4, cx, cy, TRUE);
00301     }
00302
00303     // reposition scroll bars
00304     if (m_bHasHScroll)
00305     {
00306         int cxSplitterBox = m_cxSplitter + bNotWin4;// split box bigger
00307         int x = rectClient.left;
00308         int y = rectInside.bottom + bNotWin4;
00309         for (int col = 0; col < m_nCols; col++)
00310         {
00311             CWnd* pScrollBar = GetDlgItem(AFX_IDW_HSCROLL_FIRST + col);
00312             ASSERT(pScrollBar != NULL);
00313             int cx = m_pColInfo[col].nCurSize;
00314             if (col == 0 && m_nCols < m_nMaxCols)
00315                 x += cxSplitterBox, cx -= cxSplitterBox;
00316             DeferClientPos(&layout, pScrollBar, x, y, cx, cy, TRUE);
00317             x += cx + m_cxSplitterGap;
00318         }
00319     }
00320
00321     if (m_bHasVScroll)
00322     {
00323         int cySplitterBox = m_cySplitter + bNotWin4;// split box bigger
00324         int x = rectInside.right + bNotWin4;
00325         int y = rectClient.top;
00326         for (int row = 0; row < m_nRows; row++)
00327         {
00328             CWnd* pScrollBar = GetDlgItem(AFX_IDW_VSCROLL_FIRST + row);
00329             ASSERT(pScrollBar != NULL);
00330             int cy = m_pRowInfo[row].nCurSize;
00331             if (row == 0 && m_nRows < m_nMaxRows)
00332                 y += cySplitterBox, cy -= cySplitterBox;
00333             DeferClientPos(&layout, pScrollBar, x, y, cx, cy, TRUE);
00334             y += cy + m_cySplitterGap;
00335         }
00336     }
00337
00338     //BLOCK: Reposition all the panes
00339     {
00340         int x = rectClient.left;
00341         for (int col = 0; col < m_nCols; col++)
00342         {
00343             int cx = m_pColInfo[col].nCurSize;
00344             int y = rectClient.top;
00345             for (int row = 0; row < m_nRows; row++)
00346             {
00347                 int cy = m_pRowInfo[row].nCurSize;
00348                 CWnd* pWnd = GetPane(row, col);
00349                 DeferClientPos(&layout, pWnd, x, y, cx, cy, FALSE);
00350                 y += cy + m_cySplitterGap;
00351             }
00352             x += cx + m_cxSplitterGap;
00353         }
00354     }
00355
00356     // move and resize all the windows at once!
00357     if (layout.hDWP == NULL || !::EndDeferWindowPos(layout.hDWP))
00358         TRACE0("Warning: DeferWindowPos failed - low system resources.\n");
00359
00360     // invalidate all the splitter bars (with NULL pDC)
00361     DrawAllSplitBars(NULL, rectInside.right, rectInside.bottom);
00362 }

Member Data Documentation

bool CGfxSplitterWnd::bWhiteLine

Definition at line 40 of file GfxSplitterWnd.h.

Referenced by CGfxSplitterWnd.

int CGfxSplitterWnd::m_upBorder

Definition at line 39 of file GfxSplitterWnd.h.

Referenced by CGfxSplitterWnd, GetInsideRect, OnEraseBkgnd, and RecalcLayout.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/GfxSplitterWnd.h
  • WinCvs/CJLib/CJLibrary/GfxSplitterWnd.cpp
Generated on Sun Feb 24 01:26:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GPT_CONSOLE Struct Reference

#include <cvsgui_protocol.h>

Collaboration diagram for GPT_CONSOLE:

[legend]
List of all members.

Public Attributes

guint8 isStderr
guint32 len
char * str

Member Data Documentation

guint8 GPT_CONSOLE::isStderr

Definition at line 52 of file cvsgui_protocol.h.

Referenced by _gp_console_read, _gp_console_write, cvs_process_handle_message, and gp_console_write.

guint32 GPT_CONSOLE::len

Definition at line 53 of file cvsgui_protocol.h.

Referenced by _gp_console_read, _gp_console_write, cvs_process_handle_message, and gp_console_write.

char* GPT_CONSOLE::str

Definition at line 54 of file cvsgui_protocol.h.

Referenced by _gp_console_destroy, _gp_console_read, _gp_console_write, cvs_process_handle_message, and gp_console_write.

The documentation for this struct was generated from the following file:
  • common/cvsgui_protocol.h
Generated on Sun Feb 24 01:26:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GPT_GETENV Struct Reference

#include <cvsgui_protocol.h>

Collaboration diagram for GPT_GETENV:

[legend]
List of all members.

Public Attributes

guint8 empty
char * str

Member Data Documentation

guint8 GPT_GETENV::empty

Definition at line 46 of file cvsgui_protocol.h.

Referenced by _gp_getenv_read, _gp_getenv_write, gp_getenv_read, and gp_getenv_write.

char* GPT_GETENV::str

Definition at line 47 of file cvsgui_protocol.h.

Referenced by _gp_getenv_destroy, _gp_getenv_read, _gp_getenv_write, cvs_process_handle_message, gp_getenv_read, and gp_getenv_write.

The documentation for this struct was generated from the following file:
  • common/cvsgui_protocol.h
Generated on Sun Feb 24 01:26:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


GPT_QUIT Struct Reference

#include <cvsgui_protocol.h>

Collaboration diagram for GPT_QUIT:

[legend]
List of all members.

Public Attributes

gint32 code

Member Data Documentation

gint32 GPT_QUIT::code

Definition at line 41 of file cvsgui_protocol.h.

Referenced by _gp_quit_read, _gp_quit_write, cvs_process_handle_message, and gp_quit_write.

The documentation for this struct was generated from the following file:
  • common/cvsgui_protocol.h
Generated on Sun Feb 24 01:26:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CGraphConsole Class Reference

Inheritance diagram for CGraphConsole:

[legend]
Collaboration diagram for CGraphConsole:

[legend]
List of all members.

Public Methods

CGraphConsole ()
virtual long | cvs_out (char *txt, long len)
virtual long | cvs_err (char *txt, long len)

Public Attributes

CWincvsView * view

Constructor & Destructor Documentation

CGraphConsole::CGraphConsole ( ) [inline]

Definition at line 1077 of file GraphView.cpp.

References CWincvsApp::GetConsoleView, and view.

01078     {
01079         CWincvsApp *app = (CWincvsApp *)AfxGetApp();
01080         view = app->GetConsoleView();
01081     }

Member Function Documentation

virtual long CGraphConsole::cvs_err | ( | char * | txt,
 |  | long | len
 | ) | [inline, virtual]

Implements CCvsConsole.

Definition at line 1090 of file GraphView.cpp.

References CWincvsView::OutConsole, and view.

01091     {
01092         if(view != 0L)
01093             view->OutConsole(txt, len, true);
01094         return  len;
01095     }

virtual long CGraphConsole::cvs_out | ( | char * | txt,
 |  | long | len
 | ) | [inline, virtual]

Implements CCvsConsole.

Definition at line 1083 of file GraphView.cpp.

References CWincvsView::OutConsole, and view.

01084     {
01085         if(view != 0L)
01086             view->OutConsole(txt, len);
01087         return  len;
01088     }

Member Data Documentation

CWincvsView* CGraphConsole::view

Definition at line 1097 of file GraphView.cpp.

Referenced by CGraphConsole, cvs_err, and cvs_out.

The documentation for this class was generated from the following file:
  • WinCvs/GraphView.cpp
Generated on Sun Feb 24 01:26:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CGraphDoc Class Reference

#include <GraphDoc.h>

Inheritance diagram for CGraphDoc:

[legend]
Collaboration diagram for CGraphDoc:

[legend]
List of all members.

Public Methods

void | SetNode (CLogNode *node, const char *dir)
CLogNode * | GetNode (void)
EntnodeData * | GetEntryInfo (void)
const char * | GetDir (void) const
const char * | GetName (void) const
CGraphView * | GetTreeView (void)
virtual BOOL | OnNewDocument ()
virtual void | Serialize (CArchive &ar)
virtual | ~CGraphDoc ()

Protected Methods

CGraphDoc ()
void | PrepareNew (void)
afx_msg long | NumNodes ()

Protected Attributes

CLogNode * | fNode
CString | fDir
CString | fName
EntnodeData * fData

Constructor & Destructor Documentation

CGraphDoc::CGraphDoc ( ) [protected]

Definition at line 78 of file GraphDoc.cpp.

References fData, and fNode.

00079 {
00080     EnableAutomation();
00081
00082     AfxOleLockApp();
00083
00084     fNode = 0L;
00085     fData = 0L;
00086 }

CGraphDoc::~CGraphDoc ( ) [virtual]

Definition at line 88 of file GraphDoc.cpp.

References PrepareNew.

00089 {
00090     AfxOleUnlockApp();
00091
00092     PrepareNew();
00093 }

Member Function Documentation

const char* CGraphDoc::GetDir ( void ) const [inline]

Definition at line 49 of file GraphDoc.h.

References fDir.

Referenced by CGraphView::OnGraphChangelogmessage, CGraphView::OnGraphSetdescription, CGraphView::OnGraphSetstate, CGraphView::OnQueryAnnotate, CGraphView::OnViewDelrev, CGraphView::OnViewDiff, CGraphView::OnViewReload, CGraphView::OnViewRetrieve, CGraphView::OnViewTag, CGraphView::OnViewUnlockf, and CGraphView::OnViewUpdate.

00049 { return fDir; }

EntnodeData* CGraphDoc::GetEntryInfo ( void ) [inline]

Definition at line 48 of file GraphDoc.h.

References fData.

Referenced by CGraphView::CalcImageSize, CGraphView::OnBeginPrinting, CGraphView::OnDraw, and CGraphView::OnPrint.

00048 { return fData; }

const char* CGraphDoc::GetName ( void ) const [inline]

Definition at line 50 of file GraphDoc.h.

References fName.

Referenced by CGraphView::OnGraphChangelogmessage, CGraphView::OnGraphSetdescription, CGraphView::OnGraphSetstate, CGraphView::OnQueryAnnotate, CGraphView::OnViewDelrev, CGraphView::OnViewDiff, CGraphView::OnViewReload, CGraphView::OnViewRetrieve, CGraphView::OnViewTag, CGraphView::OnViewUnlockf, and CGraphView::OnViewUpdate.

00050 { return fName; }

CLogNode* CGraphDoc::GetNode ( void ) [inline]

Definition at line 47 of file GraphDoc.h.

References fNode.

Referenced by CGraphView::CalcImageSize, CGraphView::DisableCommon, CGraphView::IsSelSingleNode, CGraphView::OnBeginPrinting, CGraphView::OnContextMenu, CGraphView::OnDraw, CGraphView::OnGraphChangelogmessage, CGraphView::OnGraphSetdescription, CGraphView::OnGraphSetstate, CGraphView::OnLButtonDown, CGraphView::OnPrint, CGraphView::OnQueryAnnotate, CGraphView::OnUpdateViewDelrev, CGraphView::OnUpdateViewDiff, CGraphView::OnUpdateViewTag, CGraphView::OnViewDelrev, CGraphView::OnViewDiff, CGraphView::OnViewReload, CGraphView::OnViewRetrieve, CGraphView::OnViewSelnonsig, CGraphView::OnViewTag, CGraphView::OnViewUnlockf, and CGraphView::OnViewUpdate.

00047 { return fNode; }

CGraphView * CGraphDoc::GetTreeView ( void )

Definition at line 201 of file GraphDoc.cpp.

References NULL.

Referenced by SetNode.

00202 {
00203     POSITION posv = GetFirstViewPosition();
00204     CView* view;
00205     while(posv != NULL)
00206     {
00207         view = GetNextView(posv);
00208         if(view->IsKindOf(RUNTIME_CLASS(CGraphView)))
00209             return (CGraphView *)view;
00210     }
00211     return NULL;
00212 }

long CGraphDoc::NumNodes ( ) [protected]

Definition at line 232 of file GraphDoc.cpp.

00233 {
00234     return 0;
00235 }

BOOL CGraphDoc::OnNewDocument ( ) [virtual]

Definition at line 111 of file GraphDoc.cpp.

References FALSE, PrepareNew, and TRUE.

00112 {
00113     PrepareNew();
00114
00115     if (!CDocument::OnNewDocument())
00116         return FALSE;
00117
00118     return TRUE;
00119 }

void CGraphDoc::PrepareNew ( void ) [protected]

Definition at line 95 of file GraphDoc.cpp.

References fData, fDir, fName, fNode, and EntnodeData::UnRef.

Referenced by OnNewDocument, SetNode, and ~CGraphDoc.

00096 {
00097     if(fNode != 0L)
00098     {
00099         delete fNode;
00100         fNode = 0L;
00101     }
00102     if(fData != 0L)
00103     {
00104         fData->UnRef();
00105         fData = 0L;
00106     }
00107     fDir.Empty();
00108     fName.Empty();
00109 }

void CGraphDoc::Serialize ( CArchive & ar ) [virtual]

Definition at line 189 of file GraphDoc.cpp.

00190 {
00191     if (ar.IsStoring())
00192     {
00193         // TODO: add storing code here
00194     }
00195     else
00196     {
00197         // TODO: add loading code here
00198     }
00199 }

void CGraphDoc::SetNode | ( | CLogNode * | node,
 |  | const char * | dir
 | ) |

Definition at line 134 of file GraphDoc.cpp.

References CGraphView::CalcImageSize, ENTNODE::Compare, cvs_err, Entries_Open, Entries_SetVisited, fData, fDir, fName, fNode, GetTreeView, NormalizeFn, PrepareNew, EntnodeData::Ref, and stat.

Referenced by CvsLogParse.

00135 {
00136     PrepareNew();
00137
00138     // normalize folder/fname since the latter can be a path relative to folder
00139     const char *fn = (**(CLogNodeHeader *)node).WorkingFile();
00140     char dir[_MAX_PATH];
00141     char name[_MAX_PATH];
00142     NormalizeFn(folder, fn, dir, name);
00143
00144     fNode = node;
00145     fDir = dir;
00146
00147     // get the CVS/Entries infos for this file
00148     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00149     if(!Entries_Open (entries, dir))
00150     {
00151         cvs_err("Warning : Error while accessing the CVS folder in '%s'\n", dir);
00152     }
00153     else
00154     {
00155         if(node->GetType() != kNodeHeader)
00156         {
00157             cvs_err("Warning : Top node is not a RCS file description !\n");
00158         }
00159         else
00160         {
00161             struct stat sb;
00162             if (stat(fn, &sb) == -1)    //JK - used to be "name", fix for the flat mode
00163             {
00164                 cvs_err("Warning : Unknown file '%s'\n", name);
00165             }
00166             else
00167             {
00168                 fData = Entries_SetVisited(dir, entries, name, sb, false);
00169                 fData->Ref();
00170                 fName = name;
00171             }
00172         }
00173     }
00174
00175     // create the graph and redraw
00176     CGraphView *view = GetTreeView();
00177     if(view != 0L)
00178     {
00179         view->CalcImageSize();
00180         view->Invalidate();
00181         SetTitle(fName);
00182     }
00183 }

Member Data Documentation

EntnodeData* CGraphDoc::fData [protected]

Definition at line 79 of file GraphDoc.h.

Referenced by CGraphDoc, GetEntryInfo, PrepareNew, and SetNode.

CString CGraphDoc::fDir [protected]

Definition at line 77 of file GraphDoc.h.

Referenced by GetDir, PrepareNew, and SetNode.

CString CGraphDoc::fName [protected]

Definition at line 78 of file GraphDoc.h.

Referenced by GetName, PrepareNew, and SetNode.

CLogNode* CGraphDoc::fNode [protected]

Definition at line 76 of file GraphDoc.h.

Referenced by CGraphDoc, GetNode, PrepareNew, and SetNode.

The documentation for this class was generated from the following files:
  • WinCvs/GraphDoc.h
  • WinCvs/GraphDoc.cpp
Generated on Sun Feb 24 01:26:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CGraphFrame Class Reference

#include <GraphFrm.h>

Inheritance diagram for CGraphFrame:

[legend]
Collaboration diagram for CGraphFrame:

[legend]
List of all members.

Public Methods

CGraphFrame ()
virtual BOOL | OnCmdMsg (UINT nID, int nCode, void *pExtra, AFX_CMDHANDLERINFO *pHandlerInfo)
virtual | ~CGraphFrame ()

Constructor & Destructor Documentation

CGraphFrame::CGraphFrame ( )

Definition at line 53 of file GraphFrm.cpp.

00054 {
00055     // TODO: add member initialization code here
00056
00057 }

CGraphFrame::~CGraphFrame ( ) [virtual]

Definition at line 59 of file GraphFrm.cpp.

00060 {
00061 }

Member Function Documentation

BOOL CGraphFrame::OnCmdMsg | ( | UINT | nID,
 |  | int | nCode,
 |  | void * | pExtra,
 |  | AFX_CMDHANDLERINFO * | pHandlerInfo
 | ) | [virtual]

Definition at line 82 of file GraphFrm.cpp.

References CWincvsApp::GetMainFrame, CMainFrame::OnBroadcastCmdMsg, and TRUE.

00083 {
00084     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00085     if(app->GetMainFrame()->OnBroadcastCmdMsg(nID, nCode, pExtra, pHandlerInfo))
00086         return TRUE;
00087
00088     return CCJMDIChildWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
00089 }

The documentation for this class was generated from the following files:
  • WinCvs/GraphFrm.h
  • WinCvs/GraphFrm.cpp
Generated on Sun Feb 24 01:26:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CGraphOptDlg Class Reference

#include <GraphOptDlg.h>

Inheritance diagram for CGraphOptDlg:

[legend]
Collaboration diagram for CGraphOptDlg:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_GRAPH_OPTIONS }

Public Methods

CGraphOptDlg (CPersistentInt &selColor, CPersistentInt &shadowColor, CPersistentInt &headerColor, CPersistentInt &tagColor, CPersistentInt &branchColor, CPersistentInt &nodeColor, CPersistentInt &deadNodeColor, CPersistentInt &userStateNodeColor, CWnd *pParent=NULL)

Public Attributes

CButton m_apply
CColorStatic m_rgbShadow
CColorStatic m_rgbSelection
CColorStatic m_rgbState
CColorStatic m_rgbDead
CColorStatic m_rgbNode
CColorStatic m_rgbBranch
CColorStatic m_rgbTag
CColorStatic m_rgbHeader

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
virtual void | OnOK ()
afx_msg void | OnApply ()
afx_msg void | OnHeader ()
afx_msg void | OnTag ()
afx_msg void | OnBranch ()
afx_msg void | OnNode ()
afx_msg void | OnDead ()
afx_msg void | OnState ()
afx_msg void | OnSelection ()
afx_msg void | OnShadow ()
afx_msg void | OnReset ()
virtual void | OnCancel ()

Private Methods

void | PromptForColor (CColorStatic &colorStatic)
void | GetAllColors ()

Private Attributes

CPersistentInt & m_selColor
CPersistentInt & m_shadowColor
CPersistentInt & m_headerColor
CPersistentInt & m_tagColor
CPersistentInt & m_branchColor
CPersistentInt & m_nodeColor
CPersistentInt & m_deadNodeColor
CPersistentInt & m_userStateNodeColor
int | m_origSelColor
int | m_origShadowColor
int | m_origHeaderColor
int | m_origTagColor
int | m_origBranchColor
int | m_origNodeColor
int | m_origDeadNodeColor
int | m_origUserStateNodeColor

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 58 of file GraphOptDlg.h.

00058 { IDD = IDD_GRAPH_OPTIONS };

Constructor & Destructor Documentation

CGraphOptDlg::CGraphOptDlg | ( | CPersistentInt & | selColor,
 |  | CPersistentInt & | shadowColor,
 |  | CPersistentInt & | headerColor,
 |  | CPersistentInt & | tagColor,
 |  | CPersistentInt & | branchColor,
 |  | CPersistentInt & | nodeColor,
 |  | CPersistentInt & | deadNodeColor,
 |  | CPersistentInt & | userStateNodeColor,
 |  | CWnd * | pParent = NULL
 | ) |

Definition at line 48 of file GraphOptDlg.cpp.

References m_branchColor, m_deadNodeColor, m_headerColor, m_nodeColor, m_origBranchColor, m_origDeadNodeColor, m_origHeaderColor, m_origNodeColor, m_origSelColor, m_origShadowColor, m_origTagColor, m_origUserStateNodeColor, m_rgbBranch, m_rgbDead, m_rgbHeader, m_rgbNode, m_rgbSelection, m_rgbShadow, m_rgbState, m_rgbTag, m_selColor, m_shadowColor, m_tagColor, m_userStateNodeColor, and CColorStatic::SetColor.

00052     : CDialog(CGraphOptDlg::IDD, pParent),
00053     m_selColor(selColor), m_shadowColor(shadowColor),
00054     m_headerColor(headerColor), m_tagColor(tagColor), m_branchColor(branchColor),
00055     m_nodeColor(nodeColor), m_deadNodeColor(deadNodeColor), m_userStateNodeColor(userStateNodeColor)
00056 {
00057     //{{AFX_DATA_INIT(CGraphOptDlg)
00058         // NOTE: the ClassWizard will add member initialization here
00059     //}}AFX_DATA_INIT
00060
00061     m_rgbShadow.SetColor((int)m_shadowColor);
00062     m_rgbSelection.SetColor((int)m_selColor);
00063     m_rgbState.SetColor((int)m_userStateNodeColor);
00064     m_rgbDead.SetColor((int)m_deadNodeColor);
00065     m_rgbNode.SetColor((int)m_nodeColor);
00066     m_rgbBranch.SetColor((int)m_branchColor);
00067     m_rgbTag.SetColor((int)m_tagColor);
00068     m_rgbHeader.SetColor((int)m_headerColor);
00069
00070     m_origSelColor = m_selColor;
00071     m_origShadowColor = m_shadowColor;
00072     m_origHeaderColor = m_headerColor;
00073     m_origTagColor = m_tagColor;
00074     m_origBranchColor = m_branchColor;
00075     m_origNodeColor = m_deadNodeColor;
00076     m_origDeadNodeColor = m_deadNodeColor;
00077     m_origUserStateNodeColor = m_userStateNodeColor;
00078 }

Member Function Documentation

void CGraphOptDlg::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 81 of file GraphOptDlg.cpp.

References IDC_APPLY, IDC_RGBBRANCH, IDC_RGBDEAD, IDC_RGBHEADER, IDC_RGBNODE, IDC_RGBSELECTION, IDC_RGBSHADOW, IDC_RGBSTATE, IDC_RGBTAG, m_apply, m_rgbBranch, m_rgbDead, m_rgbHeader, m_rgbNode, m_rgbSelection, m_rgbShadow, m_rgbState, and m_rgbTag.

00082 {
00083     CDialog::DoDataExchange(pDX);
00084     //{{AFX_DATA_MAP(CGraphOptDlg)
00085     DDX_Control(pDX, IDC_APPLY, m_apply);
00086     DDX_Control(pDX, IDC_RGBSHADOW, m_rgbShadow);
00087     DDX_Control(pDX, IDC_RGBSELECTION, m_rgbSelection);
00088     DDX_Control(pDX, IDC_RGBSTATE, m_rgbState);
00089     DDX_Control(pDX, IDC_RGBDEAD, m_rgbDead);
00090     DDX_Control(pDX, IDC_RGBNODE, m_rgbNode);
00091     DDX_Control(pDX, IDC_RGBBRANCH, m_rgbBranch);
00092     DDX_Control(pDX, IDC_RGBTAG, m_rgbTag);
00093     DDX_Control(pDX, IDC_RGBHEADER, m_rgbHeader);
00094     //}}AFX_DATA_MAP
00095 }

void CGraphOptDlg::GetAllColors ( ) [private]

Definition at line 116 of file GraphOptDlg.cpp.

References CColorStatic::GetColor, m_branchColor, m_deadNodeColor, m_headerColor, m_nodeColor, m_rgbBranch, m_rgbDead, m_rgbHeader, m_rgbNode, m_rgbSelection, m_rgbShadow, m_rgbState, m_rgbTag, m_selColor, m_shadowColor, m_tagColor, and m_userStateNodeColor.

Referenced by OnApply, and OnOK.

00117 {
00118     m_shadowColor = (int)m_rgbShadow.GetColor();
00119     m_selColor = (int)m_rgbSelection.GetColor();
00120     m_userStateNodeColor = (int)m_rgbState.GetColor();
00121     m_deadNodeColor = (int)m_rgbDead.GetColor();
00122     m_nodeColor = (int)m_rgbNode.GetColor();
00123     m_branchColor = (int)m_rgbBranch.GetColor();
00124     m_tagColor = (int)m_rgbTag.GetColor();
00125     m_headerColor = (int)m_rgbHeader.GetColor();
00126 }

void CGraphOptDlg::OnApply ( ) [protected]

Definition at line 135 of file GraphOptDlg.cpp.

References FALSE, GetAllColors, m_apply, and CWincvsApp::UpdateAllDocsView.

00136 {
00137     GetAllColors();
00138
00139     CWincvsApp* pApp = (CWincvsApp*)AfxGetApp();
00140     if( pApp )
00141     {
00142         pApp->UpdateAllDocsView();
00143     }
00144
00145     m_apply.EnableWindow(FALSE);
00146 }

void CGraphOptDlg::OnBranch ( ) [protected]

Definition at line 185 of file GraphOptDlg.cpp.

References m_rgbBranch, and PromptForColor.

00186 {
00187     PromptForColor(m_rgbBranch);
00188 }

void CGraphOptDlg::OnCancel ( ) [protected, virtual]

Definition at line 148 of file GraphOptDlg.cpp.

References m_branchColor, m_deadNodeColor, m_headerColor, m_origBranchColor, m_origDeadNodeColor, m_origHeaderColor, m_origNodeColor, m_origSelColor, m_origShadowColor, m_origTagColor, m_origUserStateNodeColor, m_selColor, m_shadowColor, m_tagColor, and m_userStateNodeColor.

00149 {
00150     m_selColor = m_origSelColor;
00151     m_shadowColor = m_origShadowColor;
00152     m_headerColor = m_origHeaderColor;
00153     m_tagColor = m_origTagColor;
00154     m_branchColor = m_origBranchColor;
00155     m_deadNodeColor = m_origNodeColor;
00156     m_deadNodeColor = m_origDeadNodeColor;
00157     m_userStateNodeColor = m_origUserStateNodeColor;
00158
00159     CDialog::OnCancel();
00160 }

void CGraphOptDlg::OnDead ( ) [protected]

Definition at line 195 of file GraphOptDlg.cpp.

References m_rgbDead, and PromptForColor.

00196 {
00197     PromptForColor(m_rgbDead);
00198 }

void CGraphOptDlg::OnHeader ( ) [protected]

Definition at line 175 of file GraphOptDlg.cpp.

References m_rgbHeader, and PromptForColor.

00176 {
00177     PromptForColor(m_rgbHeader);
00178 }

void CGraphOptDlg::OnNode ( ) [protected]

Definition at line 190 of file GraphOptDlg.cpp.

References m_rgbNode, and PromptForColor.

00191 {
00192     PromptForColor(m_rgbNode);
00193 }

void CGraphOptDlg::OnOK ( ) [protected, virtual]

Definition at line 128 of file GraphOptDlg.cpp.

References GetAllColors.

00129 {
00130     GetAllColors();
00131
00132     CDialog::OnOK();
00133 }

void CGraphOptDlg::OnReset ( ) [protected]

Definition at line 215 of file GraphOptDlg.cpp.

References m_apply, m_rgbBranch, m_rgbDead, m_rgbHeader, m_rgbNode, m_rgbSelection, m_rgbShadow, m_rgbState, m_rgbTag, RGB_DEF_BRANCH, RGB_DEF_DEADNODE, RGB_DEF_HEADER, RGB_DEF_NODE, RGB_DEF_SEL, RGB_DEF_SHADOW, RGB_DEF_TAG, RGB_DEF_USERSTATENODE, and CColorStatic::SetColor.

00216 {
00217     m_rgbShadow.SetColor(RGB_DEF_SHADOW);
00218     m_rgbSelection.SetColor(RGB_DEF_SEL);
00219     m_rgbState.SetColor(RGB_DEF_USERSTATENODE);
00220     m_rgbDead.SetColor(RGB_DEF_DEADNODE);
00221     m_rgbNode.SetColor(RGB_DEF_NODE);
00222     m_rgbBranch.SetColor(RGB_DEF_BRANCH);
00223     m_rgbTag.SetColor(RGB_DEF_TAG);
00224     m_rgbHeader.SetColor(RGB_DEF_HEADER);
00225
00226     m_apply.EnableWindow();
00227 }

void CGraphOptDlg::OnSelection ( ) [protected]

Definition at line 205 of file GraphOptDlg.cpp.

References m_rgbSelection, and PromptForColor.

00206 {
00207     PromptForColor(m_rgbSelection);
00208 }

void CGraphOptDlg::OnShadow ( ) [protected]

Definition at line 210 of file GraphOptDlg.cpp.

References m_rgbShadow, and PromptForColor.

00211 {
00212     PromptForColor(m_rgbShadow);
00213 }

void CGraphOptDlg::OnState ( ) [protected]

Definition at line 200 of file GraphOptDlg.cpp.

References m_rgbState, and PromptForColor.

00201 {
00202     PromptForColor(m_rgbState);
00203 }

void CGraphOptDlg::OnTag ( ) [protected]

Definition at line 180 of file GraphOptDlg.cpp.

References m_rgbTag, and PromptForColor.

00181 {
00182     PromptForColor(m_rgbTag);
00183 }

void CGraphOptDlg::PromptForColor ( CColorStatic & colorStatic ) [private]

Definition at line 162 of file GraphOptDlg.cpp.

References CColorStatic::GetColor, m_apply, and CColorStatic::SetColor.

Referenced by OnBranch, OnDead, OnHeader, OnNode, OnSelection, OnShadow, OnState, and OnTag.

00163 {
00164     CColorDialog colorDialog(colorStatic.GetColor());
00165     if( colorDialog.DoModal() == IDOK )
00166     {
00167         if( colorDialog.GetColor() != colorStatic.GetColor() )
00168         {
00169             colorStatic.SetColor(colorDialog.GetColor());
00170             m_apply.EnableWindow();
00171         }
00172     }
00173 }

Member Data Documentation

CButton CGraphOptDlg::m_apply

Definition at line 59 of file GraphOptDlg.h.

Referenced by DoDataExchange, OnApply, OnReset, and PromptForColor.

CPersistentInt& CGraphOptDlg::m_branchColor [private]

Definition at line 102 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, GetAllColors, and OnCancel.

CPersistentInt& CGraphOptDlg::m_deadNodeColor [private]

Definition at line 104 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, GetAllColors, and OnCancel.

CPersistentInt& CGraphOptDlg::m_headerColor [private]

Definition at line 100 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, GetAllColors, and OnCancel.

CPersistentInt& CGraphOptDlg::m_nodeColor [private]

Definition at line 103 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, and GetAllColors.

int CGraphOptDlg::m_origBranchColor [private]

Definition at line 111 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, and OnCancel.

int CGraphOptDlg::m_origDeadNodeColor [private]

Definition at line 113 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, and OnCancel.

int CGraphOptDlg::m_origHeaderColor [private]

Definition at line 109 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, and OnCancel.

int CGraphOptDlg::m_origNodeColor [private]

Definition at line 112 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, and OnCancel.

int CGraphOptDlg::m_origSelColor [private]

Definition at line 107 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, and OnCancel.

int CGraphOptDlg::m_origShadowColor [private]

Definition at line 108 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, and OnCancel.

int CGraphOptDlg::m_origTagColor [private]

Definition at line 110 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, and OnCancel.

int CGraphOptDlg::m_origUserStateNodeColor [private]

Definition at line 114 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, and OnCancel.

CColorStatic CGraphOptDlg::m_rgbBranch

Definition at line 65 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, DoDataExchange, GetAllColors, OnBranch, and OnReset.

CColorStatic CGraphOptDlg::m_rgbDead

Definition at line 63 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, DoDataExchange, GetAllColors, OnDead, and OnReset.

CColorStatic CGraphOptDlg::m_rgbHeader

Definition at line 67 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, DoDataExchange, GetAllColors, OnHeader, and OnReset.

CColorStatic CGraphOptDlg::m_rgbNode

Definition at line 64 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, DoDataExchange, GetAllColors, OnNode, and OnReset.

CColorStatic CGraphOptDlg::m_rgbSelection

Definition at line 61 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, DoDataExchange, GetAllColors, OnReset, and OnSelection.

CColorStatic CGraphOptDlg::m_rgbShadow

Definition at line 60 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, DoDataExchange, GetAllColors, OnReset, and OnShadow.

CColorStatic CGraphOptDlg::m_rgbState

Definition at line 62 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, DoDataExchange, GetAllColors, OnReset, and OnState.

CColorStatic CGraphOptDlg::m_rgbTag

Definition at line 66 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, DoDataExchange, GetAllColors, OnReset, and OnTag.

CPersistentInt& CGraphOptDlg::m_selColor [private]

Definition at line 98 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, GetAllColors, and OnCancel.

CPersistentInt& CGraphOptDlg::m_shadowColor [private]

Definition at line 99 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, GetAllColors, and OnCancel.

CPersistentInt& CGraphOptDlg::m_tagColor [private]

Definition at line 101 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, GetAllColors, and OnCancel.

CPersistentInt& CGraphOptDlg::m_userStateNodeColor [private]

Definition at line 105 of file GraphOptDlg.h.

Referenced by CGraphOptDlg, GetAllColors, and OnCancel.

The documentation for this class was generated from the following files:
  • common/GraphOptDlg.h
  • common/GraphOptDlg.cpp
Generated on Sun Feb 24 01:26:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CGraphRectTracker Class Reference

Inheritance diagram for CGraphRectTracker:

[legend]
Collaboration diagram for CGraphRectTracker:

[legend]
List of all members.

Public Methods

CGraphRectTracker (CGraphView *view)
virtual void OnChangedRect (const CRect &rectOld)

Protected Attributes

CGraphView * mView

Constructor & Destructor Documentation

CGraphRectTracker::CGraphRectTracker ( CGraphView * view ) [inline]

Definition at line 871 of file GraphView.cpp.

References mView.

00871 : mView(view) {}

Member Function Documentation

void CGraphRectTracker::OnChangedRect ( const CRect & rectOld ) [virtual]

Definition at line 878 of file GraphView.cpp.

References CScrollView::GetDeviceScrollPosition, and mView.

00879 {
00880 #if 0 // :-< doesn't work...
00881     CRect r;
00882     mView->GetClientRect(&r);
00883     CPoint rb = m_rect.BottomRight();
00884
00885     if(!r.PtInRect(rb))
00886     {
00887         CPoint orig = mView->GetDeviceScrollPosition();
00888         CPoint offset;
00889         if(rb.x >= r.right)
00890             offset.x += 10;
00891         if(rb.y >= r.bottom)
00892             offset.y += 10;
00893         orig += offset;
00894         m_rect -= offset;
00895         mView->ScrollToPosition(orig);
00896     }
00897 #endif
00898 }

Member Data Documentation

CGraphView* CGraphRectTracker::mView [protected]

Definition at line 875 of file GraphView.cpp.

Referenced by CGraphRectTracker, and OnChangedRect.

The documentation for this class was generated from the following file:
  • WinCvs/GraphView.cpp
Generated on Sun Feb 24 01:26:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CGraphView Class Reference

#include <GraphView.h>

Inheritance diagram for CGraphView:

[legend]
Collaboration diagram for CGraphView:

[legend]
List of all members.

Public Methods

void | CalcImageSize (void)

Static Public Methods

CImageList & | GetImgList (void)

Protected Methods

CGraphView ()
virtual void | OnDraw (CDC *pDC)
virtual void | OnInitialUpdate ()
virtual void | OnBeginPrinting (CDC *pDC, CPrintInfo *pInfo)
virtual void | OnEndPrinting (CDC *pDC, CPrintInfo *pInfo)
virtual BOOL | OnPreparePrinting (CPrintInfo *pInfo)
virtual void | OnPrint (CDC *pDC, CPrintInfo *pInfo)
bool | DisableCommon ()
bool | IsSelSingleNode (kLogNode type, bool equal=true)
virtual | ~CGraphView ()
void | OnInitMenuPopup (CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu)
afx_msg void | OnLButtonDown (UINT nFlags, CPoint point)
afx_msg void | OnViewReload ()
afx_msg void | OnUpdateViewReload (CCmdUI *pCmdUI)
afx_msg void | OnViewDiff ()
afx_msg void | OnUpdateViewDiff (CCmdUI *pCmdUI)
afx_msg void | OnViewUpdate ()
afx_msg void | OnUpdateViewUpdate (CCmdUI *pCmdUI)
afx_msg void | OnViewTag ()
afx_msg void | OnUpdateViewTag (CCmdUI *pCmdUI)
afx_msg void | OnViewDelrev ()
afx_msg void | OnUpdateViewDelrev (CCmdUI *pCmdUI)
afx_msg void | OnViewSelnonsig ()
afx_msg void | OnUpdateViewSelnonsig (CCmdUI *pCmdUI)
afx_msg void | OnViewRetrieve ()
afx_msg void | OnUpdateViewRetrieve (CCmdUI *pCmdUI)
afx_msg void | DisableUpdate (CCmdUI *pCmdUI)
afx_msg void | OnContextMenu (CWnd *pWnd, CPoint point)
afx_msg void | OnQueryAnnotate ()
afx_msg void | OnUpdateQueryAnnotate (CCmdUI *pCmdUI)
afx_msg void | OnGraphGraphoptions ()
afx_msg void | OnUpdateGraphChangelogmessage (CCmdUI *pCmdUI)
afx_msg void | OnGraphChangelogmessage ()
afx_msg void | OnUpdateGraphSetdescription (CCmdUI *pCmdUI)
afx_msg void | OnGraphSetdescription ()
afx_msg void | OnGraphSetstate ()
afx_msg void | OnUpdateGraphSetstate (CCmdUI *pCmdUI)
afx_msg void | OnViewUnlockf ()
afx_msg void | OnUpdateViewUnlockf (CCmdUI *pCmdUI)

Protected Attributes

bool | fFirstTime
int | m_numberOfPages
int | m_pageHeight

Static Protected Attributes

CImageList | m_ImageList

Constructor & Destructor Documentation

CGraphView::CGraphView ( ) [protected]

Definition at line 61 of file GraphView.cpp.

References fFirstTime, IDB_SMALLICONS, and m_ImageList.

00062 {
00063     fFirstTime = true;
00064     if(m_ImageList.m_hImageList == 0L)
00065         m_ImageList.Create(IDB_SMALLICONS, 16, 1, RGB(255, 255, 255));
00066 }

CGraphView::~CGraphView ( ) [protected, virtual]

Definition at line 68 of file GraphView.cpp.

00069 {
00070 }

Member Function Documentation

void CGraphView::CalcImageSize ( void )

Definition at line 808 of file GraphView.cpp.

References CWinLogData::Bounds, CWinLogData::ComputeBounds, CWinLogData::CreateNewData, CGraphDoc::GetEntryInfo, CGraphDoc::GetNode, CWinLogData::Offset, SHADOW_OFFSET_PT, and STARTPOINT_PT.

Referenced by OnEndPrinting, and CGraphDoc::SetNode.

00809 {
00810     const CPoint startPoint(STARTPOINT_PT);
00811     CWindowDC dc(this);
00812     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
00813     CLogNode *root = pDoc->GetNode();
00814     if(root == 0L)
00815         return;
00816
00817     // set all the bounds locations
00818     CWinLogData *data = CWinLogData::CreateNewData(root);
00819     root->SetUserData(data);
00820     data->ComputeBounds(startPoint, dc, pDoc->GetEntryInfo());
00821
00822     // reoffset from (0, 0)
00823     CRect bounds = data->Bounds();
00824     data->Offset(startPoint - bounds.TopLeft());
00825     bounds = data->Bounds();
00826
00827     // set the scroll size, we add the margin of the start point offset on each side
00828     SetScrollSizes(MM_TEXT, bounds.Size() + CSize(startPoint)+CSize(startPoint)+CSize(SHADOW_OFFSET_PT));
00829 }

bool CGraphView::DisableCommon ( ) [protected]

Definition at line 1362 of file GraphView.cpp.

References CWincvsApp::gCvsRunning, and CGraphDoc::GetNode.

Referenced by OnContextMenu, OnUpdateGraphChangelogmessage, OnUpdateGraphSetdescription, OnUpdateGraphSetstate, OnUpdateQueryAnnotate, OnUpdateViewDelrev, OnUpdateViewDiff, OnUpdateViewReload, OnUpdateViewRetrieve, OnUpdateViewSelnonsig, OnUpdateViewTag, OnUpdateViewUnlockf, and OnUpdateViewUpdate.

01363 {
01364     CWincvsApp *app = (CWincvsApp *)AfxGetApp();
01365     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01366     CLogNode *root = pDoc->GetNode();
01367     return root == 0L || root->GetUserData() == 0L || app->gCvsRunning || this != CWnd::GetFocus() || gCvsPrefs.empty();
01368 }

void CGraphView::DisableUpdate ( CCmdUI * pCmdUI ) [protected]

Definition at line 1589 of file GraphView.cpp.

01590 {
01591     pCmdUI->Enable(false);
01592 }

CImageList& CGraphView::GetImgList ( void ) [inline, static]

Definition at line 66 of file GraphView.h.

References m_ImageList.

Referenced by CWinLogRevData::UpdateSelf.

00066 { return m_ImageList; }

bool CGraphView::IsSelSingleNode | ( | kLogNode | type,
 |  | bool | equal = true
 | ) | [protected]

Definition at line 1370 of file GraphView.cpp.

References TGraphCmdStatus::fCountSel, TGraphCmdStatus::fSel1, CGraphDoc::GetNode, CWinLogData::GetType, and TGraph::TraverseGraph.

Referenced by OnUpdateGraphChangelogmessage, OnUpdateGraphSetdescription, OnUpdateGraphSetstate, OnUpdateQueryAnnotate, OnUpdateViewRetrieve, and OnUpdateViewUnlockf.

01371 {
01372     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01373     CLogNode *root = pDoc->GetNode();
01374
01375     TGraphCmdStatus trav;
01376     trav.TraverseGraph(root);
01377     return (trav.fCountSel == 1 &&
01378         (equal ? trav.fSel1->GetType() == type : trav.fSel1->GetType() != type));
01379 }

void CGraphView::OnBeginPrinting | ( | CDC * | pDC,
 |  | CPrintInfo * | pInfo
 | ) | [protected, virtual]

Definition at line 1295 of file GraphView.cpp.

References CWinLogData::Bounds, CWinLogData::ComputeBounds, CWinLogData::CreateNewData, CGraphDoc::GetEntryInfo, CGraphDoc::GetNode, m_numberOfPages, and m_pageHeight.

01296 {
01297     // TODO: Add your specialized code here and/or call the base class
01298
01299     CScrollView::OnBeginPrinting(pDC, pInfo);
01300
01301     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01302     CLogNode *root = pDoc->GetNode();
01303     if(root == 0L)
01304         return;
01305
01306     // set all the bounds locations
01307     CWinLogData *data = CWinLogData::CreateNewData(root);
01308     root->SetUserData(data);
01309     CPoint start(0, 0);
01310     data->ComputeBounds(start, *pDC, pDoc->GetEntryInfo());
01311
01312     // compute the number of pages
01313     CRect bounds = data->Bounds();
01314     m_pageHeight = pDC->GetDeviceCaps(VERTRES);
01315     m_numberOfPages = bounds.Height() / m_pageHeight + 1;
01316
01317     pInfo->SetMaxPage(m_numberOfPages);
01318 }

void CGraphView::OnContextMenu | ( | CWnd * | pWnd,
 |  | CPoint | point
 | ) | [protected]

Definition at line 1594 of file GraphView.cpp.

References DisableCommon, FALSE, TGraphCmdStatus::fCountSel, TGraphCmdStatus::fSel1, CScrollView::GetDeviceScrollPosition, CGraphDoc::GetNode, CWinLogData::GetType, CWinLogData::HitTest, CWinLogData::Selected, CWinLogData::SetSelected, TGraph::TraverseGraph, and CWinLogData::UnselectAll.

01595 {
01596     //Comply with windows UI standard (Windows Explorer file view used as a reference),
01597     //change selections according to the state of Control and Shift keys
01598     BYTE abKeyboardState[256];
01599     BOOL bControlState = FALSE;
01600     BOOL bShiftState = FALSE;
01601     memset( abKeyboardState, 0, 256 );
01602
01603     if( GetKeyboardState(abKeyboardState) )
01604     {
01605         bControlState = abKeyboardState[VK_CONTROL] & 0x80;
01606         bShiftState = abKeyboardState[VK_SHIFT] & 0x80;
01607     }
01608
01609     if( (!bControlState || (bControlState && bShiftState)) && !DisableCommon() )
01610     {
01611         CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01612         CLogNode *root = pDoc->GetNode();
01613
01614         TGraphCmdStatus trav;
01615         trav.TraverseGraph(root);
01616
01617         CWinLogData *data = (CWinLogData *)root->GetUserData();
01618         CPoint hitPoint(point);
01619         ScreenToClient(&hitPoint);
01620         hitPoint += GetDeviceScrollPosition();
01621         CWinLogData *hit = data->HitTest(hitPoint);
01622
01623         if( hit != 0L )
01624         {
01625             if( trav.fCountSel == 0 )
01626             {
01627                 hit->SetSelected(this, true);
01628             }
01629             else if( trav.fCountSel >= 1 && trav.fSel1->GetType() != kNodeHeader )
01630             {
01631                 if( !(hit->Selected() && bShiftState) && !(bControlState && bShiftState && hit->Selected()) )
01632                 {
01633                     data->UnselectAll(this);
01634                 }
01635                 hit->SetSelected(this, true);
01636             }
01637         }
01638     }
01639
01640
01641
01642     // Get the menu to display from the main app window, which for graph view
01643     // will be IDR_GRAPH,  The submenu to display is the menu under "Graph".
01644     // Note that if the position of this menu changes, the index under
01645     // GetSubMenu must also change.
01646     CMenu* pMenu    = ::AfxGetMainWnd()->GetMenu();
01647     CMenu* pSubMenu = pMenu->GetSubMenu(5);
01648
01649     pSubMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON,
01650         point.x, point.y, this);
01651 }

void CGraphView::OnDraw ( CDC * pDC ) [protected, virtual]

Definition at line 839 of file GraphView.cpp.

References CGraphDoc::GetEntryInfo, CGraphDoc::GetNode, and CWinLogData::Update.

00840 {
00841     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
00842     CLogNode *root = pDoc->GetNode();
00843     if(root == 0L || root->GetUserData() == 0L)
00844         return;
00845
00846     CWinLogData *data = (CWinLogData *)root->GetUserData();
00847
00848     pDC->SetTextAlign(TA_CENTER);
00849     pDC->SetBkMode(TRANSPARENT);
00850     data->Update(*pDC, pDoc->GetEntryInfo());
00851 }

void CGraphView::OnEndPrinting | ( | CDC * | pDC,
 |  | CPrintInfo * | pInfo
 | ) | [protected, virtual]

Definition at line 1320 of file GraphView.cpp.

References CalcImageSize.

01321 {
01322     // TODO: Add your specialized code here and/or call the base class
01323
01324     CScrollView::OnEndPrinting(pDC, pInfo);
01325
01326     CalcImageSize();
01327     Invalidate();
01328 }

void CGraphView::OnGraphChangelogmessage ( ) [protected]

Definition at line 1806 of file GraphView.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, ASSERT, cleanUpLogMsg, CompatGetAdminOptions, CPStr, CStr, TGraphCmdStatus::fSel1, CGraphDoc::GetDir, CGraphDoc::GetName, CGraphDoc::GetNode, CWinLogData::GetStr, kChangeLog, launchCVS, OnViewReload, CvsArgs::print, and TGraph::TraverseGraph.

01807 {
01808     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01809     CLogNode *root = pDoc->GetNode();
01810     if(root == 0L || root->GetUserData() == 0L)
01811         return;
01812
01813     TGraphCmdStatus trav;
01814     trav.TraverseGraph(root);
01815
01816     CLogNode *node = trav.fSel1->Node();
01817     ASSERT(node->GetType() == kNodeRev);
01818     CRevFile& rev = **(CLogNodeRev *)node;
01819
01820     CPStr msg = (const char*)rev.DescLog();
01821
01822     if( CompatGetAdminOptions(kChangeLog, msg) )
01823     {
01824         CvsArgs args;
01825         args.add("admin");
01826         args.add(CStr("-m") + trav.fSel1->GetStr() + CStr(":") + cleanUpLogMsg(msg));
01827
01828         args.add(pDoc->GetName());
01829         args.print(pDoc->GetDir());
01830
01831         CGraphConsole cons;
01832         launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01833         OnViewReload();
01834     }
01835 }

void CGraphView::OnGraphGraphoptions ( ) [protected]

Definition at line 1780 of file GraphView.cpp.

References CompatGetGraphOptions, and CWincvsApp::UpdateAllDocsView.

01781 {
01782     if( CompatGetGraphOptions(gGraphSelColor, gGraphShadowColor,
01783         gGraphHeaderColor, gGraphTagColor, gGraphBranchColor,
01784         gGraphNodeColor, gGraphDeadNodeColor, gGraphUserStateNodeColor) )
01785     {
01786         // add any additional processing here
01787     }
01788
01789     CWincvsApp* pApp = (CWincvsApp*)AfxGetApp();
01790     if( pApp )
01791     {
01792         pApp->UpdateAllDocsView();
01793     }
01794 }

void CGraphView::OnGraphSetdescription ( ) [protected]

Definition at line 1847 of file GraphView.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, ASSERT, cleanUpLogMsg, CompatGetAdminOptions, CPStr, CStr, TGraphCmdStatus::fSel1, CGraphDoc::GetDir, CGraphDoc::GetName, CGraphDoc::GetNode, kSetDescription, launchCVS, OnViewReload, CvsArgs::print, and TGraph::TraverseGraph.

01848 {
01849     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01850     CLogNode *root = pDoc->GetNode();
01851     if(root == 0L || root->GetUserData() == 0L)
01852         return;
01853
01854     TGraphCmdStatus trav;
01855     trav.TraverseGraph(root);
01856
01857     CLogNode *node = trav.fSel1->Node();
01858     ASSERT(node->GetType() == kNodeHeader);
01859     CRcsFile& rev = **(CLogNodeHeader *)node;
01860
01861     CPStr msg = (const char*)rev.DescLog();
01862
01863     if( CompatGetAdminOptions(kSetDescription, msg) )
01864     {
01865         CvsArgs args;
01866         args.add("admin");
01867         args.add(CStr("-t-") + cleanUpLogMsg(msg));
01868
01869         args.add(pDoc->GetName());
01870         args.print(pDoc->GetDir());
01871
01872         CGraphConsole cons;
01873         launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01874         OnViewReload();
01875     }
01876 }

void CGraphView::OnGraphSetstate ( ) [protected]

Definition at line 1888 of file GraphView.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, ASSERT, cleanUpLogMsg, CompatGetAdminOptions, CPStr, CStr, CvsAlert, TGraphCmdStatus::fSel1, CGraphDoc::GetDir, CGraphDoc::GetName, CGraphDoc::GetNode, CWinLogData::GetStr, kSetState, launchCVS, OnViewReload, CvsArgs::print, and TGraph::TraverseGraph.

01889 {
01890     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01891     CLogNode *root = pDoc->GetNode();
01892     if(root == 0L || root->GetUserData() == 0L)
01893         return;
01894
01895     TGraphCmdStatus trav;
01896     trav.TraverseGraph(root);
01897
01898     CLogNode *node = trav.fSel1->Node();
01899     ASSERT(node->GetType() == kNodeRev);
01900     CRevFile& rev = **(CLogNodeRev *)node;
01901
01902     CPStr state = (const char*)rev.State();
01903
01904     if( strcmp("dead", (const char*)state ) == 0 &&
01905         CvsAlert("The revision state is: \"dead\". You should not alter it manually.\nAre you sure you want to continue?", "Cancel", "Continue") )
01906     {
01907         return;
01908     }
01909
01910     if( CompatGetAdminOptions(kSetState, state) )
01911     {
01912         CvsArgs args;
01913         args.add("admin");
01914         args.add("-s");
01915         args.add(cleanUpLogMsg(state) + CStr(":") + trav.fSel1->GetStr());
01916
01917         args.add(pDoc->GetName());
01918         args.print(pDoc->GetDir());
01919
01920         CGraphConsole cons;
01921         launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01922         OnViewReload();
01923     }
01924 }

void CGraphView::OnInitialUpdate ( ) [protected, virtual]

Definition at line 831 of file GraphView.cpp.

00832 {
00833     CScrollView::OnInitialUpdate();
00834
00835     SetScrollSizes(MM_TEXT, CSize(200, 100));
00836     //CalcImageSize();
00837 }

void CGraphView::OnInitMenuPopup | ( | CMenu * | pPopupMenu,
 |  | UINT | nIndex,
 |  | BOOL | bSysMenu
 | ) | [protected]

Definition at line 1653 of file GraphView.cpp.

References ASSERT, FALSE, NULL, and TRUE.

01654 {
01655     ASSERT(pPopupMenu != NULL);
01656     // Check the enabled state of various menu items.
01657
01658     CCmdUI state;
01659     state.m_pMenu = pPopupMenu;
01660     ASSERT(state.m_pOther == NULL);
01661     ASSERT(state.m_pParentMenu == NULL);
01662
01663     // Determine if menu is popup in top-level menu and set m_pOther to
01664     // it if so (m_pParentMenu == NULL indicates that it is secondary popup).
01665     HMENU hParentMenu;
01666     if (AfxGetThreadState()->m_hTrackingMenu == pPopupMenu->m_hMenu)
01667         state.m_pParentMenu = pPopupMenu;    // Parent == child for tracking popup.
01668     else if ((hParentMenu = ::GetMenu(m_hWnd)) != NULL)
01669     {
01670         CWnd* pParent = this;
01671            // Child windows don't have menus--need to go to the top!
01672         if (pParent != NULL &&
01673            (hParentMenu = ::GetMenu(pParent->m_hWnd)) != NULL)
01674         {
01675            int nIndexMax = ::GetMenuItemCount(hParentMenu);
01676            for (int nIndex = 0; nIndex < nIndexMax; nIndex++)
01677            {
01678             if (::GetSubMenu(hParentMenu, nIndex) == pPopupMenu->m_hMenu)
01679             {
01680                 // When popup is found, m_pParentMenu is containing menu.
01681                 state.m_pParentMenu = CMenu::FromHandle(hParentMenu);
01682                 break;
01683             }
01684            }
01685         }
01686     }
01687
01688     state.m_nIndexMax = pPopupMenu->GetMenuItemCount();
01689     for (state.m_nIndex = 0; state.m_nIndex < state.m_nIndexMax;
01690       state.m_nIndex++)
01691     {
01692         state.m_nID = pPopupMenu->GetMenuItemID(state.m_nIndex);
01693         if (state.m_nID == 0)
01694            continue; // Menu separator or invalid cmd - ignore it.
01695
01696         ASSERT(state.m_pOther == NULL);
01697         ASSERT(state.m_pMenu != NULL);
01698         if (state.m_nID == (UINT)-1)
01699         {
01700            // Possibly a popup menu, route to first item of that popup.
01701            state.m_pSubMenu = pPopupMenu->GetSubMenu(state.m_nIndex);
01702            if (state.m_pSubMenu == NULL ||
01703             (state.m_nID = state.m_pSubMenu->GetMenuItemID(0)) == 0 ||
01704             state.m_nID == (UINT)-1)
01705            {
01706             continue;       // First item of popup can't be routed to.
01707            }
01708            state.DoUpdate(this, TRUE);   // Popups are never auto disabled.
01709         }
01710         else
01711         {
01712            // Normal menu item.
01713            // Auto enable/disable if frame window has m_bAutoMenuEnable
01714            // set and command is _not_ a system command.
01715            state.m_pSubMenu = NULL;
01716            state.DoUpdate(this, FALSE);
01717         }
01718
01719         // Adjust for menu deletions and additions.
01720         UINT nCount = pPopupMenu->GetMenuItemCount();
01721         if (nCount < state.m_nIndexMax)
01722         {
01723             state.m_nIndex -= (state.m_nIndexMax - nCount);
01724             while (state.m_nIndex < nCount &&
01725                 pPopupMenu->GetMenuItemID(state.m_nIndex) == state.m_nID)
01726             {
01727                 state.m_nIndex++;
01728             }
01729         }
01730         state.m_nIndexMax = nCount;
01731       }
01732
01733 }

void CGraphView::OnLButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 988 of file GraphView.cpp.

References CvsLogOutput, CWincvsApp::GetConsoleView, CScrollView::GetDeviceScrollPosition, CGraphDoc::GetNode, CWinLogData::HitTest, CWinLogData::Selected, CWinLogData::SetSelected, TGraph::TraverseGraph, and CWinLogData::UnselectAll.

00989 {
00990     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
00991     CLogNode *root = pDoc->GetNode();
00992     if(root == 0L || root->GetUserData() == 0L)
00993         return;
00994
00995     CWinLogData *data = (CWinLogData *)root->GetUserData();
00996
00997     if(nFlags & MK_LBUTTON)
00998     {
00999         if((nFlags & MK_SHIFT) == 0 && (nFlags & MK_CONTROL) == 0)
01000             data->UnselectAll(this);
01001         point += GetDeviceScrollPosition();
01002         CWinLogData *hit = data->HitTest(point);
01003
01004         if(hit != 0L)
01005         {
01006             if((nFlags & MK_SHIFT) == 0 && (nFlags & MK_CONTROL) == 0)
01007             {
01008                 if(!hit->Selected())
01009                 {
01010                     hit->SetSelected(this, true);
01011                     CWincvsApp *app = (CWincvsApp *)AfxGetApp();
01012                     CWincvsView *view = app->GetConsoleView();
01013                     if(view != 0L)
01014                     {
01015                         CColorConsole out(view);
01016                         CvsLogOutput(out, hit->Node());
01017                     }
01018                 }
01019             }
01020             else
01021             {
01022                 hit->SetSelected(this, !hit->Selected());
01023             }
01024         }
01025         else
01026         {
01027             CGraphRectTracker track(this);
01028             point -= GetDeviceScrollPosition();
01029             if(track.TrackRubberBand(this, point, true))
01030             {
01031                 // traverse and mark
01032                 track.m_rect.OffsetRect(GetDeviceScrollPosition());
01033                 track.m_rect.NormalizeRect();
01034                 TGraphRectSelect traversal((nFlags & MK_CONTROL) != 0, this,
01035                     track.m_rect);
01036                 traversal.TraverseGraph(root);
01037             }
01038         }
01039     }
01040     else if(nFlags & MK_RBUTTON)
01041     {
01042     }
01043
01044     CScrollView::OnLButtonDown(nFlags, point);
01045 }

BOOL CGraphView::OnPreparePrinting ( CPrintInfo * pInfo ) [protected, virtual]

Definition at line 1330 of file GraphView.cpp.

References TRUE.

01331 {
01332     BOOL res = DoPreparePrinting(pInfo);
01333     if(!res)
01334         return res;
01335
01336     return TRUE;
01337 }

void CGraphView::OnPrint | ( | CDC * | pDC,
 |  | CPrintInfo * | pInfo
 | ) | [protected, virtual]

Definition at line 1339 of file GraphView.cpp.

References CGraphDoc::GetEntryInfo, CGraphDoc::GetNode, m_pageHeight, and CWinLogData::Update.

01340 {
01341     if (!pDC->IsPrinting())
01342         return;
01343
01344     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01345     CLogNode *root = pDoc->GetNode();
01346     if(root == 0L || root->GetUserData() == 0L)
01347         return;
01348
01349     CWinLogData *data = (CWinLogData *)root->GetUserData();
01350
01351     // Orient the viewport so that the first row to be printed
01352     // has a viewport coordinate of (0,0).
01353     int yTopOfPage = (pInfo->m_nCurPage -1) * m_pageHeight;
01354     pDC->SetViewportOrg(0, -yTopOfPage);
01355     pDC->SetTextAlign(TA_CENTER);
01356     pDC->SetBkMode(TRANSPARENT);
01357     data->Update(*pDC, pDoc->GetEntryInfo());
01358
01359     //  CScrollView::OnPrint(pDC, pInfo);
01360 }

void CGraphView::OnQueryAnnotate ( ) [protected]

Definition at line 1745 of file GraphView.cpp.

References CvsArgs::add, CStr, TGraphCmdStatus::fSel1, CGraphDoc::GetDir, GetExtension, CGraphDoc::GetName, CGraphDoc::GetNode, CWinLogData::GetStr, launchCVS, LaunchViewer, CvsArgs::print, and TGraph::TraverseGraph.

01746 {
01747     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01748     CLogNode *root = pDoc->GetNode();
01749     if(root == 0L || root->GetUserData() == 0L)
01750         return;
01751
01752     TGraphCmdStatus trav;
01753     trav.TraverseGraph(root);
01754
01755     if(gCvsPrefs.ExtDiff() != 0L)
01756     {
01757         CStr file, prf, ext, base;
01758         CvsArgs args;
01759
01760         GetExtension(pDoc->GetName(), base, ext);
01761
01762         prf = base;
01763         prf << "_ann_";
01764         prf << trav.fSel1->GetStr();
01765         prf << '_';
01766         args.add("annotate");
01767         args.add("-r");
01768         args.add(trav.fSel1->GetStr());
01769         args.add(pDoc->GetName());
01770         args.print(pDoc->GetDir());
01771         file = launchCVS(pDoc->GetDir(), args, (const char *)prf, ext);
01772
01773         if(file.empty())
01774             return;
01775
01776         LaunchViewer(file);
01777     }
01778 }

void CGraphView::OnUpdateGraphChangelogmessage ( CCmdUI * pCmdUI ) [protected]

Definition at line 1796 of file GraphView.cpp.

References DisableCommon, FALSE, and IsSelSingleNode.

01797 {
01798     BOOL enabled = FALSE;
01799     if(!DisableCommon())
01800     {
01801         enabled = IsSelSingleNode(kNodeRev);
01802     }
01803     pCmdUI->Enable(enabled);
01804 }

void CGraphView::OnUpdateGraphSetdescription ( CCmdUI * pCmdUI ) [protected]

Definition at line 1837 of file GraphView.cpp.

References DisableCommon, FALSE, and IsSelSingleNode.

01838 {
01839     BOOL enabled = FALSE;
01840     if(!DisableCommon())
01841     {
01842         enabled = IsSelSingleNode(kNodeHeader);
01843     }
01844     pCmdUI->Enable(enabled);
01845 }

void CGraphView::OnUpdateGraphSetstate ( CCmdUI * pCmdUI ) [protected]

Definition at line 1878 of file GraphView.cpp.

References DisableCommon, FALSE, and IsSelSingleNode.

01879 {
01880     BOOL enabled = FALSE;
01881     if(!DisableCommon())
01882     {
01883         enabled = IsSelSingleNode(kNodeRev);
01884     }
01885     pCmdUI->Enable(enabled);
01886 }

void CGraphView::OnUpdateQueryAnnotate ( CCmdUI * pCmdUI ) [protected]

Definition at line 1735 of file GraphView.cpp.

References DisableCommon, FALSE, and IsSelSingleNode.

01736 {
01737     BOOL enabled = FALSE;
01738     if(!DisableCommon())
01739     {
01740         enabled = IsSelSingleNode(kNodeHeader, false);
01741     }
01742     pCmdUI->Enable(enabled);
01743 }

void CGraphView::OnUpdateViewDelrev ( CCmdUI * pCmdUI ) [protected]

Definition at line 1448 of file GraphView.cpp.

References DisableCommon, FALSE, TGraphDelCmd::fCountSel, TGraphDelCmd::fOnlyRev, CGraphDoc::GetNode, and TGraph::TraverseGraph.

01449 {
01450     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01451     CLogNode *root = pDoc->GetNode();
01452     if(DisableCommon())
01453     {
01454         pCmdUI->Enable(FALSE);
01455         return;
01456     }
01457
01458     TGraphDelCmd trav;
01459     trav.TraverseGraph(root);
01460     BOOL outEnabled = trav.fCountSel >= 1 && trav.fOnlyRev;
01461     pCmdUI->Enable(outEnabled);
01462 }

void CGraphView::OnUpdateViewDiff ( CCmdUI * pCmdUI ) [protected]

Definition at line 1199 of file GraphView.cpp.

References DisableCommon, FALSE, TGraphCmdStatus::fCountSel, TGraphCmdStatus::fSel1, TGraphCmdStatus::fSel2, CGraphDoc::GetNode, CWinLogData::GetType, and TGraph::TraverseGraph.

01200 {
01201     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01202     CLogNode *root = pDoc->GetNode();
01203     if(DisableCommon())
01204     {
01205         pCmdUI->Enable(FALSE);
01206         return;
01207     }
01208
01209     TGraphCmdStatus trav;
01210     trav.TraverseGraph(root);
01211     BOOL outEnabled = (trav.fCountSel == 2 && trav.fSel1->GetType() != kNodeHeader &&
01212         trav.fSel2->GetType() != kNodeHeader) ||
01213         (trav.fCountSel == 1 && trav.fSel1->GetType() != kNodeHeader);
01214     pCmdUI->Enable(outEnabled);
01215 }

void CGraphView::OnUpdateViewReload ( CCmdUI * pCmdUI ) [protected]

Definition at line 1115 of file GraphView.cpp.

References DisableCommon, FALSE, and TRUE.

01116 {
01117     if(DisableCommon())
01118         pCmdUI->Enable(FALSE);
01119     else
01120         pCmdUI->Enable(TRUE);
01121 }

void CGraphView::OnUpdateViewRetrieve ( CCmdUI * pCmdUI ) [protected]

Definition at line 1579 of file GraphView.cpp.

References DisableCommon, FALSE, and IsSelSingleNode.

01580 {
01581     BOOL enabled = FALSE;
01582     if(!DisableCommon())
01583     {
01584         enabled = IsSelSingleNode(kNodeHeader, false);
01585     }
01586     pCmdUI->Enable(enabled);
01587 }

void CGraphView::OnUpdateViewSelnonsig ( CCmdUI * pCmdUI ) [protected]

Definition at line 1501 of file GraphView.cpp.

References DisableCommon, FALSE, and TRUE.

01502 {
01503     if(DisableCommon())
01504         pCmdUI->Enable(FALSE);
01505     else
01506         pCmdUI->Enable(TRUE);
01507 }

void CGraphView::OnUpdateViewTag ( CCmdUI * pCmdUI ) [protected]

Definition at line 1279 of file GraphView.cpp.

References DisableCommon, FALSE, TGraphCmdStatus::fCountSel, CGraphDoc::GetNode, and TGraph::TraverseGraph.

01280 {
01281     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01282     CLogNode *root = pDoc->GetNode();
01283     if(DisableCommon())
01284     {
01285         pCmdUI->Enable(FALSE);
01286         return;
01287     }
01288
01289     TGraphCmdStatus trav;
01290     trav.TraverseGraph(root);
01291     BOOL outEnabled = trav.fCountSel == 1;
01292     pCmdUI->Enable(outEnabled);
01293 }

void CGraphView::OnUpdateViewUnlockf ( CCmdUI * pCmdUI ) [protected]

Definition at line 1926 of file GraphView.cpp.

References DisableCommon, FALSE, and IsSelSingleNode.

01927 {
01928     BOOL enabled = FALSE;
01929     if(!DisableCommon())
01930     {
01931         enabled = IsSelSingleNode(kNodeRev);
01932     }
01933     pCmdUI->Enable(enabled);
01934 }

void CGraphView::OnUpdateViewUpdate ( CCmdUI * pCmdUI ) [protected]

Definition at line 1235 of file GraphView.cpp.

References DisableCommon, FALSE, and TRUE.

01236 {
01237     if(DisableCommon())
01238         pCmdUI->Enable(FALSE);
01239     else
01240         pCmdUI->Enable(TRUE);
01241 }

void CGraphView::OnViewDelrev ( ) [protected]

Definition at line 1408 of file GraphView.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, TGraphDelCmd::fAllRevs, CGraphDoc::GetDir, CGraphDoc::GetName, CGraphDoc::GetNode, CProgress::HasAborted, launchCVS, OnViewReload, CvsArgs::print, CProgress::SetProgress, and TGraph::TraverseGraph.

01409 {
01410     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01411     CLogNode *root = pDoc->GetNode();
01412     if(root == 0L || root->GetUserData() == 0L)
01413         return;
01414
01415     if(AfxMessageBox("Are you really sure you want to do that ? This will permanently remove the revisions on the server.",
01416         MB_OKCANCEL|MB_DEFBUTTON2|MB_ICONSTOP) != IDOK)
01417             return;
01418
01419     TGraphDelCmd trav;
01420     trav.TraverseGraph(root);
01421
01422     CProgress progress(true, "Deleting revisions...");
01423
01424     std::vector<CStr>::const_iterator i;
01425     int count = 0;
01426     for(i = trav.fAllRevs.begin(); i != trav.fAllRevs.end(); ++i, ++count)
01427     {
01428         progress.SetProgress(((float)count / (float)trav.fAllRevs.size()) * 100.0 + .5);
01429         if(progress.HasAborted())
01430             break;
01431
01432         CvsArgs args;
01433         args.add("admin");
01434         args.add("-o");
01435         args.add(*i);
01436         args.add(pDoc->GetName());
01437         args.print(pDoc->GetDir());
01438         CGraphConsole cons;
01439         launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01440     }
01441
01442     if(!progress.HasAborted())
01443         progress.SetProgress(100);
01444
01445     OnViewReload();
01446 }

void CGraphView::OnViewDiff ( ) [protected]

Definition at line 1123 of file GraphView.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, CStr, TGraphCmdStatus::fCountSel, TGraphCmdStatus::fSel1, TGraphCmdStatus::fSel2, CGraphDoc::GetDir, GetExtension, CGraphDoc::GetName, CGraphDoc::GetNode, CWinLogData::GetStr, launchCVS, LaunchDiff, CvsArgs::print, and TGraph::TraverseGraph.

01124 {
01125     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01126     CLogNode *root = pDoc->GetNode();
01127     if(root == 0L || root->GetUserData() == 0L)
01128         return;
01129
01130     TGraphCmdStatus trav;
01131     trav.TraverseGraph(root);
01132
01133     bool done = false;
01134     if(gCvsPrefs.ExtDiff() != 0L)
01135     {
01136         CStr f1, f2, prf1, prf2, ext, base;
01137         CvsArgs args1, args2;
01138
01139         GetExtension(pDoc->GetName(), base, ext);
01140
01141         prf1 = base;
01142         prf1 << '_';
01143         prf1 << trav.fSel1->GetStr();
01144         prf1 << '_';
01145         args1.add("update");
01146         args1.add("-p");
01147         args1.add("-r");
01148         args1.add(trav.fSel1->GetStr());
01149         args1.add(pDoc->GetName());
01150         args1.print(pDoc->GetDir());
01151         f1 = launchCVS(pDoc->GetDir(), args1, (const char *)prf1, ext);
01152
01153         if(trav.fCountSel == 2)
01154         {
01155             prf2 = base;
01156             prf2 << '_';
01157             prf2 << trav.fSel2->GetStr();
01158             prf2 << '_';
01159             args2.add("update");
01160             args2.add("-p");
01161             args2.add("-r");
01162             args2.add(trav.fSel2->GetStr());
01163             args2.add(pDoc->GetName());
01164             args2.print(pDoc->GetDir());
01165             f2 = launchCVS(pDoc->GetDir(), args2, (const char *)prf2, ext);
01166         }
01167         else
01168         {
01169             f2 = pDoc->GetDir();
01170             if(!f2.endsWith(kPathDelimiter))
01171                 f2 << kPathDelimiter;
01172             f2 << pDoc->GetName();
01173         }
01174
01175         if(f1.empty() || f2.empty())
01176             return;
01177
01178         done = LaunchDiff(f1, f2);
01179     }
01180
01181     if(!done)
01182     {
01183         CvsArgs args;
01184         CGraphConsole cons;
01185         args.add("diff");
01186         args.add("-r");
01187         args.add(trav.fSel1->GetStr());
01188         if(trav.fCountSel == 2)
01189         {
01190             args.add("-r");
01191             args.add(trav.fSel2->GetStr());
01192         }
01193         args.add(pDoc->GetName());
01194         args.print(pDoc->GetDir());
01195         launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01196     }
01197 }

void CGraphView::OnViewReload ( ) [protected]

Definition at line 1100 of file GraphView.cpp.

References CvsArgs::add, CStr, CvsLogParse, CGraphDoc::GetDir, CGraphDoc::GetName, CGraphDoc::GetNode, and CvsArgs::print.

Referenced by OnGraphChangelogmessage, OnGraphSetdescription, OnGraphSetstate, OnViewDelrev, OnViewTag, OnViewUnlockf, and OnViewUpdate.

01101 {
01102     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01103     CLogNode *root = pDoc->GetNode();
01104     if(root == 0L || root->GetUserData() == 0L)
01105         return;
01106
01107     CvsArgs args;
01108     args.add("log");
01109     args.add(pDoc->GetName());
01110     args.print(pDoc->GetDir());
01111     CStr dir(pDoc->GetDir());
01112     CvsLogParse(dir, args, true, pDoc);
01113 }

void CGraphView::OnViewRetrieve ( ) [protected]

Definition at line 1550 of file GraphView.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, CStr, TGraphCmdStatus::fSel1, CGraphDoc::GetDir, CGraphDoc::GetName, CGraphDoc::GetNode, CWinLogData::GetStr, CRevisionConsole::init, launchCVS, CvsArgs::print, and TGraph::TraverseGraph.

01551 {
01552     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01553     CLogNode *root = pDoc->GetNode();
01554     if(root == 0L || root->GetUserData() == 0L)
01555         return;
01556
01557     TGraphCmdStatus trav;
01558     trav.TraverseGraph(root);
01559
01560     CStr f1, prf1;
01561     CvsArgs args;
01562
01563     prf1 = pDoc->GetName();
01564     prf1 << ".#.";
01565     prf1 << trav.fSel1->GetStr();
01566     args.add("update");
01567     args.add("-p");
01568     args.add("-r");
01569     args.add(trav.fSel1->GetStr());
01570     args.add(pDoc->GetName());
01571     args.print(pDoc->GetDir());
01572
01573     CRevisionConsole console;
01574     console.init(pDoc->GetDir(), prf1);
01575
01576     int code = launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &console);
01577 }

void CGraphView::OnViewSelnonsig ( ) [protected]

Definition at line 1487 of file GraphView.cpp.

References CGraphDoc::GetNode, TGraph::TraverseGraph, and CWinLogData::UnselectAll.

01488 {
01489     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01490     CLogNode *root = pDoc->GetNode();
01491     if(root == 0L || root->GetUserData() == 0L)
01492         return;
01493
01494     CWinLogData *data = (CWinLogData *)root->GetUserData();
01495     data->UnselectAll(this);
01496
01497     TGraphSelNonSig trav(this);
01498     trav.TraverseGraph(root);
01499 }

void CGraphView::OnViewTag ( ) [protected]

Definition at line 1243 of file GraphView.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, TGraphCmdStatus::fSel1, CGraphDoc::GetDir, CGraphDoc::GetName, CGraphDoc::GetNode, CWinLogData::GetStr, launchCVS, OnViewReload, CvsArgs::print, and TGraph::TraverseGraph.

01244 {
01245     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01246     CLogNode *root = pDoc->GetNode();
01247     if(root == 0L || root->GetUserData() == 0L)
01248         return;
01249
01250     TGraphCmdStatus trav;
01251     trav.TraverseGraph(root);
01252     CvsArgs args;
01253     args.add("update");
01254     CLogNode *node = trav.fSel1->Node();
01255     switch(node->GetType())
01256     {
01257         case kNodeHeader :
01258         {
01259             args.add("-A");
01260             break;
01261         }
01262         case kNodeRev :
01263         case kNodeBranch :
01264         case kNodeTag :
01265         {
01266             args.add("-r");
01267             args.add(trav.fSel1->GetStr());
01268             break;
01269         }
01270     }
01271     args.add(pDoc->GetName());
01272     args.print(pDoc->GetDir());
01273     CGraphConsole cons;
01274     launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01275
01276     OnViewReload();
01277 }

void CGraphView::OnViewUnlockf ( ) [protected]

Definition at line 1936 of file GraphView.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, CStr, TGraphCmdStatus::fSel1, CGraphDoc::GetDir, CGraphDoc::GetName, CGraphDoc::GetNode, CWinLogData::GetStr, launchCVS, OnViewReload, CvsArgs::print, and TGraph::TraverseGraph.

01937 {
01938     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01939     CLogNode *root = pDoc->GetNode();
01940     if(root == 0L || root->GetUserData() == 0L)
01941         return;
01942
01943     TGraphCmdStatus trav;
01944     trav.TraverseGraph(root);
01945
01946     CvsArgs args;
01947     args.add("admin");
01948     args.add(CStr("-u") + trav.fSel1->GetStr());
01949
01950     args.add(pDoc->GetName());
01951     args.print(pDoc->GetDir());
01952
01953     CGraphConsole cons;
01954     launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01955     OnViewReload();
01956 }

void CGraphView::OnViewUpdate ( ) [protected]

Definition at line 1217 of file GraphView.cpp.

References CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, CGraphDoc::GetDir, CGraphDoc::GetName, CGraphDoc::GetNode, launchCVS, OnViewReload, and CvsArgs::print.

01218 {
01219     CGraphDoc *pDoc = (CGraphDoc *)GetDocument();
01220     CLogNode *root = pDoc->GetNode();
01221     if(root == 0L || root->GetUserData() == 0L)
01222         return;
01223
01224     CvsArgs args;
01225     args.add("update");
01226     args.add("-A");
01227     args.add(pDoc->GetName());
01228     args.print(pDoc->GetDir());
01229     CGraphConsole cons;
01230     launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01231
01232     OnViewReload();
01233 }

Member Data Documentation

bool CGraphView::fFirstTime [protected]

Definition at line 86 of file GraphView.h.

Referenced by CGraphView.

CImageList CGraphView::m_ImageList [static, protected]

Definition at line 806 of file GraphView.cpp.

Referenced by CGraphView, and GetImgList.

int CGraphView::m_numberOfPages [protected]

Definition at line 89 of file GraphView.h.

Referenced by OnBeginPrinting.

int CGraphView::m_pageHeight [protected]

Definition at line 90 of file GraphView.h.

Referenced by OnBeginPrinting, and OnPrint.

The documentation for this class was generated from the following files:
  • WinCvs/GraphView.h
  • WinCvs/GraphView.cpp
Generated on Sun Feb 24 01:26:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CHARFORMAT Class Reference

Inheritance diagram for CHARFORMAT:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/wincvsView.cpp
Generated on Sun Feb 24 01:26:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CHeaderCtrl Class Reference

Inheritance diagram for CHeaderCtrl:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/SortHeaderCtrl.h
Generated on Sun Feb 24 01:26:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CHistComboBoxEx Class Reference

#include <HistComboBoxEx.h>

Inheritance diagram for CHistComboBoxEx:

[legend]
Collaboration diagram for CHistComboBoxEx:

[legend]
List of all members.

Public Methods

CHistComboBoxEx (int feature=USmartCombo::DefaultFeature)
virtual BOOL | PreTranslateMessage (MSG *pMsg)
PreTranslateMessage virtual override. More...

virtual | ~CHistComboBoxEx ()
int | AddString (LPCTSTR lpszString)
int | InsertString (int nIndex, LPCTSTR lpszString)
BOOL | SetIcon (COMBOBOXEXITEM cbi)
const char * | GetOldLoc ()
int | NewRoot (const char *root)

Static Public Methods

CString | FindBestRoot (CMString &strItems, const char *path, bool mustExist=false)
Find the best root for passed path. More...

Protected Methods

afx_msg void | OnDropdown ()
CBN_DROPDOWN notification message handler. More...

Private Methods

virtual int | CalcDroppedWidth ()
Calculate droplist width. More...

BOOL | DelKeyTest (MSG *pMsg)
Test if the Del key is pressed and remove the item if the droplist is dropped down. More...

Private Attributes

CImageList | m_ImageList

Constructor & Destructor Documentation

CHistComboBoxEx::CHistComboBoxEx ( int feature = USmartCombo::DefaultFeature )

Definition at line 62 of file HistComboBoxEx.cpp.

00063     : USmartCombo(feature)
00064 {
00065 }

CHistComboBoxEx::~CHistComboBoxEx ( ) [virtual]

Definition at line 67 of file HistComboBoxEx.cpp.

00068 {
00069 }

Member Function Documentation

int CHistComboBoxEx::AddString ( LPCTSTR lpszString )

Definition at line 167 of file HistComboBoxEx.cpp.

References InsertString.

00168 {
00169     return InsertString(-1, lpszString);
00170 }

int CHistComboBoxEx::CalcDroppedWidth ( ) [private, virtual]

Calculate droplist width.

Calculate the proper width for droplist so the items can fit into it. Make sure it doesn't go off-screen as well.

Reimplemented from USmartCombo.

Definition at line 263 of file HistComboBoxEx.cpp.

References HISTLOC_IMAGE_CX.

Referenced by OnDropdown.

00264 {
00265     int maxSize = 0;
00266
00267     CClientDC ClientDC(this);
00268     int savedDc = ClientDC.SaveDC();
00269     ClientDC.SelectObject(GetFont());
00270
00271     CString strLBText;
00272     for( int nIndex = 0; nIndex < GetCount(); nIndex++ )
00273     {
00274         GetLBText( nIndex, strLBText );
00275         CSize size = ClientDC.GetTextExtent(strLBText);
00276
00277         if( size.cx > maxSize )
00278         {
00279             maxSize = size.cx;
00280         }
00281     }
00282     ClientDC.RestoreDC(savedDc);
00283
00284     maxSize += ::GetSystemMetrics(SM_CXVSCROLL)     //vertical scroll bar
00285         + 4*::GetSystemMetrics(SM_CXEDGE)           //the border aroung the text and icon: Edge-Icon-Edge - Edge-Text-Edge
00286         + HISTLOC_IMAGE_CX                          //the icon width
00287         + 2;                                        //the focus frame width
00288
00289     CRect rect;
00290     GetWindowRect(rect);
00291     maxSize = min(ClientDC.GetDeviceCaps(HORZRES) - rect.TopLeft().x, maxSize);
00292
00293     return maxSize;
00294 }

BOOL CHistComboBoxEx::DelKeyTest ( MSG * pMsg ) [private]

Test if the Del key is pressed and remove the item if the droplist is dropped down.

Analizes the message and removes the item if the Del key is pressed while droplist is dropped down.

Attention:
Make sure the items collection is set earlier (call USmartCombo::SetItems to set the collection).
Returns:
TRUE if the droplist was dropped and Del key was pressed.

Definition at line 302 of file HistComboBoxEx.cpp.

References ASSERT, CMainFrame::ChangeLocation, FALSE, USmartCombo::GetItems, CWincvsApp::GetMainFrame, NULL, USmartCombo::RemoveItem, and TRUE.

Referenced by PreTranslateMessage.

00303 {
00304     CMString* pstrItems = GetItems();
00305     ASSERT(pstrItems != NULL);
00306
00307     BOOL bRes = FALSE;
00308
00309     if( WM_KEYDOWN == pMsg->message &&
00310         VK_DELETE == (int)pMsg->wParam &&
00311         pstrItems &&
00312         GetDroppedState() )
00313     {
00314         int sel = GetCurSel();
00315         if( CB_ERR < sel && GetCount() > 1 )
00316         {
00317             CString strItem;
00318             GetLBText(sel, strItem);
00319
00320             if( RemoveItem(strItem) )
00321             {
00322                 DeleteString(sel);
00323
00324                 if( GetCount() )
00325                 {
00326                     int nNewSel = (0 == sel ? sel : (GetCount() ? 0 : -1));
00327                     if( 0 != nNewSel || 0 == sel )
00328                     {
00329                         SetCurSel(nNewSel);
00330
00331                         //trigger the location change for all views
00332                         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00333                         CMainFrame* mainFrm = app->GetMainFrame();
00334                         mainFrm->ChangeLocation();
00335                     }
00336                 }
00337             }
00338         }
00339         else if( GetCount() == 1 )
00340         {
00341             AfxMessageBox("Can't remove the last item from the history.\n"
00342                 "Please add a new location first and then remove the current one.", MB_OK | MB_ICONSTOP);
00343         }
00344
00345         //we have to prevent it going to another window
00346         bRes = TRUE;
00347     }
00348
00349     return bRes;
00350 }

CString CHistComboBoxEx::FindBestRoot | ( | CMString & | strItems,
 |  | const char * | path,
 |  | bool | mustExist = false
 | ) | [static]

Find the best root for passed path.

Definition at line 110 of file HistComboBoxEx.cpp.

References TMString< UStr >::GetList.

Referenced by CWincvsApp::InitInstance.

00111 {
00112     CString normPath(path);
00113     CString bestRoot;
00114     normPath.TrimRight("\\/");
00115     normPath.MakeLower();
00116
00117     const std::vector<CStr> & list = strItems.GetList();
00118     std::vector<CStr>::const_iterator i;
00119     for(i = list.begin(); i != list.end(); ++i)
00120     {
00121         CString root = *i;
00122         root.TrimRight("\\/");
00123         root.MakeLower();
00124
00125         if( normPath.Find(root) != -1 )
00126         {
00127             //we want the longest root so it's near the file
00128             if( root.GetLength() > bestRoot.GetLength() )
00129             {
00130                 bestRoot = *i;
00131             }
00132         }
00133     }
00134
00135     if( !mustExist && bestRoot.IsEmpty() )
00136     {
00137         bestRoot = path;
00138         bestRoot.TrimRight("\\/");
00139     }
00140
00141     //handle the drive root
00142     if( bestRoot.GetAllocLength() &&
00143         ':' == bestRoot[bestRoot.GetLength()-1])
00144     {
00145         bestRoot += kPathDelimiter;
00146     }
00147
00148     return bestRoot;
00149 }

const char * CHistComboBoxEx::GetOldLoc ( )

Definition at line 81 of file HistComboBoxEx.cpp.

Referenced by CWinCvsBrowser::Create.

00082 {
00083     return gOldLoc;
00084 }

int CHistComboBoxEx::InsertString | ( | int | nIndex,
 |  | LPCTSTR | lpszString
 | ) |

Definition at line 151 of file HistComboBoxEx.cpp.

References SetIcon.

Referenced by AddString, and NewRoot.

00152 {
00153     int nRes = -1;
00154
00155     COMBOBOXEXITEM cbi;
00156     cbi.mask = CBEIF_TEXT;
00157     cbi.iItem = 0 > nIndex ? GetCount() : nIndex;
00158     cbi.pszText = (LPTSTR)lpszString;   //this cast is safe because we are Inserting item only
00159     cbi.cchTextMax = 0;
00160
00161     nRes = InsertItem(&cbi);
00162     SetIcon(cbi);
00163
00164     return nRes;
00165 }

int CHistComboBoxEx::NewRoot ( const char * root )

Definition at line 86 of file HistComboBoxEx.cpp.

References ASSERT, USmartCombo::GetItems, TMString< UStr >::GetList, TMString< UStr >::Insert, InsertString, NULL, and stricmp.

Referenced by CWinCvsBrowser::ResetBrowser.

00087 {
00088     if(stricmp(gOldLoc, root) != 0)
00089         gOldLoc = root;
00090
00091     CMString* pstrItems = GetItems();
00092     ASSERT(pstrItems != NULL);
00093
00094     // update the history combo
00095     pstrItems->Insert(root);
00096     ResetContent();
00097     const std::vector<CStr> & list = pstrItems->GetList();
00098     std::vector<CStr>::const_iterator i;
00099     for(i = list.begin(); i != list.end(); ++i)
00100     {
00101         InsertString(-1, *i);
00102     }
00103     SetCurSel(0);
00104     TRACE("Browse History has %d items\n", GetCount());
00105
00106     return GetCount();
00107 }

void CHistComboBoxEx::OnDropdown ( ) [protected]

CBN_DROPDOWN notification message handler.

Traverse the history items to set the apropriate icons and calculates the width of the droplist if the USmartCombo::AutoDropWidth feature is set.

Definition at line 249 of file HistComboBoxEx.cpp.

References USmartCombo::AutoDropWidth, CalcDroppedWidth, USmartCombo::HasFeature, and TraverseHistory.

00250 {
00251     TraverseHistory(*this);
00252     if( HasFeature(USmartCombo::AutoDropWidth) )
00253     {
00254         SetDroppedWidth(CalcDroppedWidth());
00255     }
00256 }

BOOL CHistComboBoxEx::PreTranslateMessage ( MSG * pMsg ) [virtual]

PreTranslateMessage virtual override.

If the USmartCombo::RemoveItems feature is set perform the key test to determine whether to delete item.

Definition at line 231 of file HistComboBoxEx.cpp.

References DelKeyTest, USmartCombo::HasFeature, USmartCombo::RemoveItems, and TRUE.

00232 {
00233     if( HasFeature(USmartCombo::RemoveItems) )
00234     {
00235         if( DelKeyTest(pMsg) )
00236         {
00237             return TRUE;
00238         }
00239     }
00240
00241     return CComboBoxEx::PreTranslateMessage(pMsg);
00242 }

BOOL CHistComboBoxEx::SetIcon ( COMBOBOXEXITEM cbi )

Definition at line 172 of file HistComboBoxEx.cpp.

References BuildIgnoredList, ENTNODE::Compare, CStr, Entries_SetVisited, HISTLOC_IMAGE_CX, IDB_HISTLOC, EntnodeData::IsIgnored, EntnodeData::IsMissing, EntnodeData::IsUnknown, kLocationIcon, kLocationIconErased, kLocationIconIgnored, kLocationIconMissing, kLocationIconUnknown, m_ImageList, SplitPath, and stat.

Referenced by InsertString, and TraverseHistory.

00173 {
00174     //initialize the image list if neccessary
00175     if( m_ImageList.m_hImageList == 0L )
00176     {
00177         m_ImageList.Create(IDB_HISTLOC, HISTLOC_IMAGE_CX, 1, RGB(255, 255, 255));
00178         SetImageList(&m_ImageList);
00179     }
00180
00181     cbi.mask = CBEIF_IMAGE | /*CBEIF_OVERLAY |*/ CBEIF_SELECTEDIMAGE;
00182     cbi.iImage = cbi.iSelectedImage = kLocationIconUnknown;
00183     //cbi.iOverlay = ;
00184
00185     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00186     vector<CStr> ignlist;
00187     struct stat sb;
00188     const char *fullpath = cbi.pszText;
00189
00190     int statres = stat(fullpath, &sb);
00191     if( statres != -1 )
00192     {
00193         if( S_ISDIR(sb.st_mode) )
00194         {
00195             CStr uppath, folder;
00196             if( !SplitPath(fullpath, uppath, folder) || uppath.empty() )
00197             {
00198                 uppath = fullpath;
00199                 folder = ".";
00200             }
00201
00202             BuildIgnoredList(ignlist, uppath);
00203
00204             EntnodeData *data = Entries_SetVisited(uppath, entries, folder, sb, true, &ignlist);
00205             if( !data->IsUnknown() )
00206             {
00207                 cbi.iImage = cbi.iSelectedImage = kLocationIcon;
00208             }
00209             if( data->IsIgnored() )
00210             {
00211                 cbi.iImage = cbi.iSelectedImage = kLocationIconIgnored;
00212             }
00213             if( data->IsMissing() )
00214             {
00215                 cbi.iImage = cbi.iSelectedImage = kLocationIconMissing;
00216             }
00217         }
00218     }
00219     else
00220     {
00221         cbi.iImage = cbi.iSelectedImage = kLocationIconErased;
00222     }
00223
00224     return SetItem(&cbi);
00225 }

Member Data Documentation

CImageList CHistComboBoxEx::m_ImageList [private]

Definition at line 80 of file HistComboBoxEx.h.

Referenced by SetIcon.

The documentation for this class was generated from the following files:
  • WinCvs/HistComboBoxEx.h
  • WinCvs/HistComboBoxEx.cpp
Generated on Sun Feb 24 01:26:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ICvsCoworker Interface Reference

import "CVS_Coworker.idl";

List of all members.

Public Methods

HRESULT | GetLastError ([in] int handle,[out] int *piError)
HRESULT | GetErrorMessage ([in] int handle,[in] int iError,[in] int cbErrorBuffer,[out, string, size_is(cbErrorBuffer)] char *sErrorBuffer)
HRESULT | OpenProject ([out] int *pHandle,[in, string] const char *sUsername,[in, string] const char *sProjectName,[in, string] const char *sProjectHome)
HRESULT | GetProject ([out] int *pHandle,[in] const char *sUsername,[in] int cbProjectNameBuffer,[in, out, string, size_is(cbProjectNameBuffer)] char *sProjectName,[in] int cbProjectHomeBuffer,[in, out, string, size_is(cbProjectHomeBuffer)] char *sProjectHome,[in] BOOL bAllowPathChange,[in] BOOL bAllowNewProject,[out] BOOL *pbNewProject)
HRESULT | UpdateFiles ([in] int handle,[in, string] const char *sFilenames,[in] BOOL bDirectories,[in] BOOL bRecurse)
HRESULT | CheckoutFiles ([in] int handle,[in, string] const char *sFilenames)
HRESULT | CheckinFiles ([in] int handle,[in, string] const char *sFilenames,[in] BOOL bKeepCheckedOut)
HRESULT | UncheckoutFiles ([in] int handle,[in, string] const char *sFilenames)
HRESULT | AddFiles ([in] int handle,[in, string] const char *sOptionsAndFilenames,[in, string] const char *sComment)
HRESULT | RemoveFiles ([in] int handle,[in, string] const char *sFilenames)
HRESULT | RenameFile ([in] int handle,[in, string] const char *sOldFilename,[in, string] const char *sNewFilename)
HRESULT | DiffFile ([in] int handle,[in, string] const char *sFilename,[in] BOOL bIgnoreCase,[in] BOOL bIgnoreBlanks)
HRESULT | ShowFileHistory ([in] int handle,[in, string] const char *sFilenames)
HRESULT | ShowFileProperties ([in] int handle,[in, string] const char *sFilename)
HRESULT | ShowUserInterface ([in] int handle,[in, string] const char *sFilenames)
HRESULT | HasAdvancedOptionsForCommand ([in] int handle,[in] CvsCommand command,[out, retval] BOOL *pbAdvancedOptions)
HRESULT | ShowAdvancedOptionsForCommand ([in] int handle,[in] CvsCommand command)
HRESULT | GetFileChanges ([in] int handle,[in] int cbFilenameBuffer,[out, string, size_is(cbFilenameBuffer)] char *sFilenameBuffer)
HRESULT | GetFilesToAdd ([in] int handle,[in] int cbFilenamesBuffer,[out, string, size_is(cbFilenamesBuffer)] char *sFilenamesBuffer)
HRESULT | CloseProject ([in] int handle)

Member Function Documentation

HRESULT ICvsCoworker::AddFiles | ( | [in] int | handle,
 |  | [in, string] const char * | sOptionsAndFilenames,
 |  | [in, string] const char * | sComment
 | ) |

HRESULT ICvsCoworker::CheckinFiles | ( | [in] int | handle,
 |  | [in, string] const char * | sFilenames,
 |  | [in] BOOL | bKeepCheckedOut
 | ) |

HRESULT ICvsCoworker::CheckoutFiles | ( | [in] int | handle,
 |  | [in, string] const char * | sFilenames
 | ) |

HRESULT ICvsCoworker::CloseProject ( [in] int handle )

HRESULT ICvsCoworker::DiffFile | ( | [in] int | handle,
 |  | [in, string] const char * | sFilename,
 |  | [in] BOOL | bIgnoreCase,
 |  | [in] BOOL | bIgnoreBlanks
 | ) |

HRESULT ICvsCoworker::GetErrorMessage | ( | [in] int | handle,
 |  | [in] int | iError,
 |  | [in] int | cbErrorBuffer,
 |  | [out, string, size_is(cbErrorBuffer)] char * | sErrorBuffer
 | ) |

HRESULT ICvsCoworker::GetFileChanges | ( | [in] int | handle,
 |  | [in] int | cbFilenameBuffer,
 |  | [out, string, size_is(cbFilenameBuffer)] char * | sFilenameBuffer
 | ) |

HRESULT ICvsCoworker::GetFilesToAdd | ( | [in] int | handle,
 |  | [in] int | cbFilenamesBuffer,
 |  | [out, string, size_is(cbFilenamesBuffer)] char * | sFilenamesBuffer
 | ) |

HRESULT ICvsCoworker::GetLastError | ( | [in] int | handle,
 |  | [out] int * | piError
 | ) |

HRESULT ICvsCoworker::GetProject | ( | [out] int * | pHandle,
 |  | [in] const char * | sUsername,
 |  | [in] int | cbProjectNameBuffer,
 |  | [in, out, string, size_is(cbProjectNameBuffer)] char * | sProjectName,
 |  | [in] int | cbProjectHomeBuffer,
 |  | [in, out, string, size_is(cbProjectHomeBuffer)] char * | sProjectHome,
 |  | [in] BOOL | bAllowPathChange,
 |  | [in] BOOL | bAllowNewProject,
 |  | [out] BOOL * | pbNewProject
 | ) |

HRESULT ICvsCoworker::HasAdvancedOptionsForCommand | ( | [in] int | handle,
 |  | [in] CvsCommand | command,
 |  | [out, retval] BOOL * | pbAdvancedOptions
 | ) |

HRESULT ICvsCoworker::OpenProject | ( | [out] int * | pHandle,
 |  | [in, string] const char * | sUsername,
 |  | [in, string] const char * | sProjectName,
 |  | [in, string] const char * | sProjectHome
 | ) |

HRESULT ICvsCoworker::RemoveFiles | ( | [in] int | handle,
 |  | [in, string] const char * | sFilenames
 | ) |

HRESULT ICvsCoworker::RenameFile | ( | [in] int | handle,
 |  | [in, string] const char * | sOldFilename,
 |  | [in, string] const char * | sNewFilename
 | ) |

HRESULT ICvsCoworker::ShowAdvancedOptionsForCommand | ( | [in] int | handle,
 |  | [in] CvsCommand | command
 | ) |

HRESULT ICvsCoworker::ShowFileHistory | ( | [in] int | handle,
 |  | [in, string] const char * | sFilenames
 | ) |

HRESULT ICvsCoworker::ShowFileProperties | ( | [in] int | handle,
 |  | [in, string] const char * | sFilename
 | ) |

HRESULT ICvsCoworker::ShowUserInterface | ( | [in] int | handle,
 |  | [in, string] const char * | sFilenames
 | ) |

HRESULT ICvsCoworker::UncheckoutFiles | ( | [in] int | handle,
 |  | [in, string] const char * | sFilenames
 | ) |

HRESULT ICvsCoworker::UpdateFiles | ( | [in] int | handle,
 |  | [in, string] const char * | sFilenames,
 |  | [in] BOOL | bDirectories,
 |  | [in] BOOL | bRecurse
 | ) |

The documentation for this interface was generated from the following file:
  • WinCvs/CoWorker/CVS_Coworker.idl
Generated on Sun Feb 24 01:26:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ICvsCoworker Class Reference

Inheritance diagram for ICvsCoworker:

[legend]
Collaboration diagram for ICvsCoworker:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CoWorker/CvsCoworker.h
Generated on Sun Feb 24 01:26:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CImport_MAIN Class Reference

#include <ImportDlg.h>

Inheritance diagram for CImport_MAIN:

[legend]
Collaboration diagram for CImport_MAIN:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_IMPORT_MAIN }

Public Methods

CImport_MAIN (const char *logmsg, const char *modname, const char *rtag, const char *vtag)
CImport_MAIN ()
~CImport_MAIN ()

Public Attributes

CSmartComboBox m_modnameCombo
CSmartComboBox m_rtagCombo
CSmartComboBox m_vtagCombo
CString | m_logmsg
CString | m_vtag
CString | m_rtag
CString | m_modname

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 55 of file ImportDlg.h.

00055 { IDD = IDD_IMPORT_MAIN };

Constructor & Destructor Documentation

CImport_MAIN::CImport_MAIN | ( | const char * | logmsg,
 |  | const char * | modname,
 |  | const char * | rtag,
 |  | const char * | vtag
 | ) |

Definition at line 88 of file ImportDlg.cpp.

References m_logmsg, m_modname, m_modnameCombo, m_rtag, m_rtagCombo, m_vtag, m_vtagCombo, and USmartCombo::SetItems.

00089                                                                :
00090     CPropertyPage(CImport_MAIN::IDD)
00091 {
00092     //{{AFX_DATA_INIT(CImport_MAIN)
00093     m_logmsg = logmsg;
00094     m_vtag = vtag;
00095     m_rtag = rtag;
00096     m_modname = modname;
00097     //}}AFX_DATA_INIT
00098
00099     m_modnameCombo.SetItems(&gImportModuleNames);
00100     m_rtagCombo.SetItems(&gReleasesNames);
00101     m_vtagCombo.SetItems(&gVendorNames);
00102 }

CImport_MAIN::CImport_MAIN ( )

Definition at line 104 of file ImportDlg.cpp.

00104                            : CPropertyPage(CImport_MAIN::IDD)
00105 {
00106 }

CImport_MAIN::~CImport_MAIN ( )

Definition at line 108 of file ImportDlg.cpp.

00109 {
00110 }

Member Function Documentation

void CImport_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 112 of file ImportDlg.cpp.

References DDV_MinChars, DDX_ComboMString, IDC_COMBOMODNAME, IDC_COMBORTAG, IDC_COMBOVTAG, IDC_LOGMSG, m_logmsg, m_modname, m_modnameCombo, m_rtag, m_rtagCombo, m_vtag, and m_vtagCombo.

00113 {
00114     CPropertyPage::DoDataExchange(pDX);
00115
00116     //{{AFX_DATA_MAP(CImport_MAIN)
00117     DDX_Control(pDX, IDC_COMBOMODNAME, m_modnameCombo);
00118     DDX_Control(pDX, IDC_COMBORTAG, m_rtagCombo);
00119     DDX_Control(pDX, IDC_COMBOVTAG, m_vtagCombo);
00120     DDX_Text(pDX, IDC_LOGMSG, m_logmsg);
00121     DDX_CBString(pDX, IDC_COMBOVTAG, m_vtag);
00122     DDX_CBString(pDX, IDC_COMBORTAG, m_rtag);
00123     DDX_CBString(pDX, IDC_COMBOMODNAME, m_modname);
00124     //}}AFX_DATA_MAP
00125
00126     DDV_MinChars(pDX, m_modname, 1);
00127     DDV_MinChars(pDX, m_rtag, 1);
00128     DDV_MinChars(pDX, m_vtag, 1);
00129     DDX_ComboMString(pDX, IDC_COMBOMODNAME, m_modnameCombo);
00130     DDX_ComboMString(pDX, IDC_COMBOVTAG, m_vtagCombo);
00131     DDX_ComboMString(pDX, IDC_COMBORTAG, m_rtagCombo);
00132
00133     //error if the vendor and release tags are same
00134     if( pDX->m_bSaveAndValidate )
00135     {
00136         if( m_vtag == m_rtag )
00137         {
00138             AfxMessageBox("Vendor Tag and Release Tag can't have the same values.", MB_ICONEXCLAMATION, AFX_IDP_PARSE_STRING_SIZE);
00139             pDX->Fail();
00140         }
00141     }
00142 }

Member Data Documentation

CString CImport_MAIN::m_logmsg

Definition at line 59 of file ImportDlg.h.

Referenced by CImport_MAIN, CompatGetImport, and DoDataExchange.

CString CImport_MAIN::m_modname

Definition at line 62 of file ImportDlg.h.

Referenced by CImport_MAIN, CompatGetImport, and DoDataExchange.

CSmartComboBox CImport_MAIN::m_modnameCombo

Definition at line 56 of file ImportDlg.h.

Referenced by CImport_MAIN, and DoDataExchange.

CString CImport_MAIN::m_rtag

Definition at line 61 of file ImportDlg.h.

Referenced by CImport_MAIN, CompatGetImport, and DoDataExchange.

CSmartComboBox CImport_MAIN::m_rtagCombo

Definition at line 57 of file ImportDlg.h.

Referenced by CImport_MAIN, and DoDataExchange.

CString CImport_MAIN::m_vtag

Definition at line 60 of file ImportDlg.h.

Referenced by CImport_MAIN, CompatGetImport, and DoDataExchange.

CSmartComboBox CImport_MAIN::m_vtagCombo

Definition at line 58 of file ImportDlg.h.

Referenced by CImport_MAIN, and DoDataExchange.

The documentation for this class was generated from the following files:
  • common/ImportDlg.h
  • common/ImportDlg.cpp
Generated on Sun Feb 24 01:26:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CImport_OPTIONS Class Reference

#include <ImportDlg.h>

Inheritance diagram for CImport_OPTIONS:

[legend]
Collaboration diagram for CImport_OPTIONS:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_IMPORT_OPTIONS }

Public Methods

CImport_OPTIONS (const char *path, const bool useDefIgnore, const bool useFilesTime)
CImport_OPTIONS ()
~CImport_OPTIONS ()

Public Attributes

CString | m_path
BOOL | m_useDefIgnore
BOOL | m_useFilesTime

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnBtnpath ()

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 95 of file ImportDlg.h.

00095 { IDD = IDD_IMPORT_OPTIONS };

Constructor & Destructor Documentation

CImport_OPTIONS::CImport_OPTIONS | ( | const char * | path,
 |  | const bool | useDefIgnore,
 |  | const bool | useFilesTime
 | ) |

Definition at line 153 of file ImportDlg.cpp.

References m_path, m_useDefIgnore, and m_useFilesTime.

00153                                                                                                    :
00154     CPropertyPage(CImport_OPTIONS::IDD)
00155 {
00156     //{{AFX_DATA_INIT(CImport_OPTIONS)
00157     m_path = path;
00158     m_useDefIgnore = useDefIgnore;
00159     m_useFilesTime = useFilesTime;
00160     //}}AFX_DATA_INIT
00161 }

CImport_OPTIONS::CImport_OPTIONS ( )

Definition at line 163 of file ImportDlg.cpp.

00163                                  : CPropertyPage(CImport_OPTIONS::IDD)
00164 {
00165 }

CImport_OPTIONS::~CImport_OPTIONS ( )

Definition at line 167 of file ImportDlg.cpp.

00168 {
00169 }

Member Function Documentation

void CImport_OPTIONS::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 171 of file ImportDlg.cpp.

References DDV_CheckPathExists, IDC_PATH, IDC_USEDEFIGNORE, IDC_USEFILESTIME, m_path, m_useDefIgnore, and m_useFilesTime.

00172 {
00173     CPropertyPage::DoDataExchange(pDX);
00174
00175     //{{AFX_DATA_MAP(CImport_OPTIONS)
00176     DDX_Text(pDX, IDC_PATH, m_path);
00177     DDX_Check(pDX, IDC_USEDEFIGNORE, m_useDefIgnore);
00178     DDX_Check(pDX, IDC_USEFILESTIME, m_useFilesTime);
00179     //}}AFX_DATA_MAP
00180
00181     DDV_CheckPathExists(pDX, IDC_PATH, m_path, false);
00182 }

void CImport_OPTIONS::OnBtnpath ( ) [protected]

Definition at line 194 of file ImportDlg.cpp.

References BrowserGetDirectory, IDC_PATH, and NULL.

00195 {
00196     const char *dir = BrowserGetDirectory("Select a directory to import :", IsWindow(this->m_hWnd) ? this : NULL);
00197     if(dir != NULL)
00198         SetDlgItemText(IDC_PATH, dir);
00199 }

Member Data Documentation

CString CImport_OPTIONS::m_path

Definition at line 96 of file ImportDlg.h.

Referenced by CImport_OPTIONS, CompatGetImport, and DoDataExchange.

BOOL CImport_OPTIONS::m_useDefIgnore

Definition at line 97 of file ImportDlg.h.

Referenced by CImport_OPTIONS, CompatGetImport, and DoDataExchange.

BOOL CImport_OPTIONS::m_useFilesTime

Definition at line 98 of file ImportDlg.h.

Referenced by CImport_OPTIONS, CompatGetImport, and DoDataExchange.

The documentation for this class was generated from the following files:
  • common/ImportDlg.h
  • common/ImportDlg.cpp
Generated on Sun Feb 24 01:26:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CImportEntry Class Reference

#include <ImportFilterDlg.h>

Inheritance diagram for CImportEntry:

[legend]
Collaboration diagram for CImportEntry:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_ENTRYDESC }

Public Methods

CImportEntry (ReportConflict *entry, CWnd *pParent=NULL)

Public Attributes

CString | m_desc
int | m_radios

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 119 of file ImportFilterDlg.h.

00119 { IDD = IDD_ENTRYDESC };

Constructor & Destructor Documentation

CImportEntry::CImportEntry | ( | ReportConflict * | entry,
 |  | CWnd * | pParent = NULL
 | ) |

Definition at line 87 of file ImportFilterDlg.cpp.

References CStr, ReportConflict::HasForceBinary, ReportConflict::HasForceNoKeywords, ReportConflict::HasForceText, ReportConflict::HasForceUnicode, ReportConflict::HasIgnore, m_desc, m_radios, and ReportConflict::PrintOut.

00088     : CDialog(CImportEntry::IDD, pParent)
00089 {
00090     CStr print;
00091     entry->PrintOut(print);
00092
00093     //{{AFX_DATA_INIT(CImportEntry)
00094     //}}AFX_DATA_INIT
00095
00096     //keep these outside MFC remarks
00097     m_desc = print;
00098     if(entry->HasForceBinary())
00099         m_radios = 1;
00100     else if(entry->HasForceUnicode())
00101         m_radios = 2;
00102     else if(entry->HasForceText())
00103         m_radios = 3;
00104     else if(entry->HasForceNoKeywords())
00105         m_radios = 4;
00106     else if(entry->HasIgnore())
00107         m_radios = 5;
00108     else
00109         m_radios = 0;
00110 }

Member Function Documentation

void CImportEntry::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 113 of file ImportFilterDlg.cpp.

References IDC_ENTRYSTATE, IDC_WARNINGDESC, m_desc, and m_radios.

00114 {
00115     CDialog::DoDataExchange(pDX);
00116     //{{AFX_DATA_MAP(CImportEntry)
00117     DDX_Text(pDX, IDC_WARNINGDESC, m_desc);
00118     DDX_Radio(pDX, IDC_ENTRYSTATE, m_radios);
00119     //}}AFX_DATA_MAP
00120 }

Member Data Documentation

CString CImportEntry::m_desc

Definition at line 120 of file ImportFilterDlg.h.

Referenced by CImportEntry, and DoDataExchange.

int CImportEntry::m_radios

Definition at line 121 of file ImportFilterDlg.h.

Referenced by CImportEntry, DoDataExchange, and CImportFilterDlg::OnEditentry.

The documentation for this class was generated from the following files:
  • common/ImportFilterDlg.h
  • common/ImportFilterDlg.cpp
Generated on Sun Feb 24 01:26:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CImportFilterDlg Class Reference

#include <ImportFilterDlg.h>

Inheritance diagram for CImportFilterDlg:

[legend]
Collaboration diagram for CImportFilterDlg:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_IMPORTFILTER }

Public Methods

CImportFilterDlg (ReportConflict *entries, ReportWarning *warnings, CWnd *pParent=NULL)

Public Attributes

CListCtrl m_list
CButton m_edit

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnEditentry ()
virtual BOOL | OnInitDialog ()
afx_msg void | OnDblclkListentries (NMHDR *pNMHDR, LRESULT *pResult)

Protected Attributes

CImageList | m_ImageList
ReportConflict * m_entries
ReportWarning * m_warnings

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 53 of file ImportFilterDlg.h.

00053 { IDD = IDD_IMPORTFILTER };

Constructor & Destructor Documentation

CImportFilterDlg::CImportFilterDlg | ( | ReportConflict * | entries,
 |  | ReportWarning * | warnings,
 |  | CWnd * | pParent = NULL
 | ) |

Definition at line 133 of file ImportFilterDlg.cpp.

References m_entries, and m_warnings.

00135     : CDialog(CImportFilterDlg::IDD, pParent)
00136 {
00137     //{{AFX_DATA_INIT(CImportFilterDlg)
00138     m_entries = entries;
00139     m_warnings = warnings;
00140     //}}AFX_DATA_INIT
00141 }

Member Function Documentation

void CImportFilterDlg::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 144 of file ImportFilterDlg.cpp.

References IDC_EDITENTRY, IDC_LISTENTRIES, m_edit, and m_list.

00145 {
00146     CDialog::DoDataExchange(pDX);
00147     //{{AFX_DATA_MAP(CImportFilterDlg)
00148     DDX_Control(pDX, IDC_LISTENTRIES, m_list);
00149     DDX_Control(pDX, IDC_EDITENTRY, m_edit);
00150     //}}AFX_DATA_MAP
00151 }

void CImportFilterDlg::OnDblclkListentries | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 239 of file ImportFilterDlg.cpp.

References OnEditentry.

00240 {
00241     OnEditentry();
00242     *pResult = 0;
00243 }

void CImportFilterDlg::OnEditentry ( ) [protected]

Definition at line 164 of file ImportFilterDlg.cpp.

References ReportConflict::DisableUserSettings, ReportConflict::ForceBinary, ReportConflict::ForceNoKeywords, ReportConflict::ForceText, ReportConflict::ForceUnicode, ReportConflict::Ignore, ReportConflict::IsBinary, m_entries, m_list, CImportEntry::m_radios, m_warnings, ReportConflict::next, and ReportWarning::next.

Referenced by OnDblclkListentries.

00165 {
00166     // The user wants to edit an entry.
00167     // Start at the top of the list and walk through it until an item
00168     // that is selected is found.
00169     int nItem = m_list.GetNextItem(-1, LVNI_ALL);
00170     while (nItem != -1)
00171     {
00172         UINT nState = m_list.GetItemState(nItem, LVIS_SELECTED);
00173         if ((nState & LVIS_SELECTED) == LVIS_SELECTED)
00174             break;
00175
00176         nItem = m_list.GetNextItem(nItem, LVNI_ALL);
00177     }
00178     if(nItem == -1)
00179         return;
00180
00181     int i = 0;
00182     ReportWarning * warn = m_warnings;
00183     while(warn != 0L)
00184     {
00185         if(i == nItem)
00186         {
00187             CImportWarning dlg(warn);
00188             dlg.DoModal();
00189             return;
00190         }
00191         warn = warn->next;
00192         i++;
00193     }
00194
00195     ReportConflict * conf = m_entries;
00196     while(conf != 0L)
00197     {
00198         if(i == nItem)
00199         {
00200             CImportEntry dlg(conf);
00201             if(dlg.DoModal() == IDOK)
00202             {
00203                 switch(dlg.m_radios)
00204                 {
00205                 case 0:
00206                     conf->DisableUserSettings();
00207                     m_list.SetItem(nItem, 2, LVIF_TEXT, conf->IsBinary() ? "BINARY" : "TEXT", 0, 0, 0, 0);
00208                     break;
00209                 case 1:
00210                     conf->ForceBinary();
00211                     m_list.SetItem(nItem, 2, LVIF_TEXT, "FORCE BINARY", 0, 0, 0, 0);
00212                     break;
00213                 case 2:
00214                     conf->ForceUnicode();
00215                     m_list.SetItem(nItem, 2, LVIF_TEXT, "FORCE UNICODE", 0, 0, 0, 0);
00216                     break;
00217                 case 3:
00218                     conf->ForceText();
00219                     m_list.SetItem(nItem, 2, LVIF_TEXT, "FORCE TEXT", 0, 0, 0, 0);
00220                     break;
00221                 case 4:
00222                     conf->ForceNoKeywords();
00223                     m_list.SetItem(nItem, 2, LVIF_TEXT, "FORCE NO KEYWORDS", 0, 0, 0, 0);
00224                     break;
00225                 case 5:
00226                     conf->Ignore();
00227                     m_list.SetItem(nItem, 2, LVIF_TEXT, "IGNORE", 0, 0, 0, 0);
00228                     break;
00229                 }
00230             }
00231             return;
00232         }
00233
00234         conf = conf->next;
00235         i++;
00236     }
00237 }

BOOL CImportFilterDlg::OnInitDialog ( ) [protected, virtual]

Definition at line 245 of file ImportFilterDlg.cpp.

References CPStr, ReportConflict::GetPattern, ReportConflict::HasConflict, ReportConflict::HasIgnore, IDI_CVSERROR, IDI_CVSWARNING, ReportConflict::IsBinary, ReportConflict::IsExtension, ReportConflict::IsUnicode, kBinIsUnicode, kFileInvalidName, kFileIsAlias, kFileIsOK, kFileMissing, ReportWarning::Kind, kTextEscapeChar, kTextIsBinary, kTextIsUnicode, kTextWrongLF, m_entries, m_ImageList, m_list, m_warnings, ReportConflict::next, ReportWarning::next, and TRUE.

00246 {
00247     CDialog::OnInitDialog();
00248
00249     // Need to set up to display the little icons next to each entry
00250     HICON hIcon = AfxGetApp()->LoadIcon(IDI_CVSERROR);
00251     m_ImageList.Create(16, 16, ILC_COLOR, 1, 1);
00252     m_ImageList.SetBkColor(GetSysColor(COLOR_WINDOW));
00253     m_ImageList.Add(hIcon);
00254     hIcon = AfxGetApp()->LoadIcon(IDI_CVSWARNING);
00255     m_ImageList.Add(hIcon);
00256     m_list.SetImageList(&m_ImageList, LVSIL_SMALL);
00257
00258     //full row selection
00259     m_list.SetExtendedStyle( LVS_EX_FULLROWSELECT |
00260         LVS_EX_ONECLICKACTIVATE |
00261         LVS_EX_UNDERLINEHOT );
00262
00263     // Set up columns inside the list view
00264     m_list.InsertColumn(0, "Entry state", LVCFMT_LEFT, 80);
00265     m_list.InsertColumn(1, "Entry description", LVCFMT_LEFT, 270);
00266     m_list.InsertColumn(2, "Entry kind", LVCFMT_LEFT, 140);
00267
00268     int i = 0;
00269     ReportWarning * warn = m_warnings;
00270     while(warn != 0L)
00271     {
00272         const char *desc;
00273         bool isError = true;
00274
00275         switch(warn->Kind())
00276         {
00277         case kFileIsOK:
00278             isError = false; // should not happen
00279             desc = "File is OK";
00280             break;
00281         case kFileMissing:
00282             desc = "File is missing or unreadable";
00283             break;
00284         case kFileIsAlias:
00285             desc = "File is an alias";
00286             break;
00287         case kFileInvalidName:
00288             desc = "File has an invalid name";
00289             break;
00290         case kTextWrongLF:
00291             desc = "File has the wrong line feed for this machine";
00292             break;
00293         case kTextIsBinary:
00294             desc = "File seems to be binary, while expecting text";
00295             break;
00296         case kTextEscapeChar:
00297             desc = "File has some escape characters in it (0x00-0x20, 0x80-0xFF)";
00298             isError = false;
00299             break;
00300         case kTextIsUnicode:
00301             desc = "File seems to be unicode, while expecting text";
00302             break;
00303         case kBinIsUnicode:
00304             desc = "File seems to be unicode, while expecting binary";
00305             break;
00306         default:
00307             desc = "File has some unknown problem";
00308             break;
00309         }
00310
00311         // Store this information in the list view
00312         m_list.InsertItem(i, "", isError ? 0 : 1);
00313
00314         m_list.SetItem(i, 1, LVIF_TEXT, desc, 0, 0, 0, 0);
00315         m_list.SetItem(i, 0, LVIF_TEXT, isError ? "Error" : "Warning", 0, 0, 0, 0);
00316
00317         warn = warn->next;
00318         i++;
00319     }
00320
00321     ReportConflict * conf = m_entries;
00322     while(conf != 0L)
00323     {
00324         CPStr desc;
00325
00326         desc << "Type ";
00327         desc << (conf->IsExtension() ? "*" : "");
00328         desc << conf->GetPattern();
00329
00330         // Store this information in the list view
00331         m_list.InsertItem(i, "", conf->HasConflict() ? 0 : 1);
00332
00333         if( conf->HasIgnore() )
00334         {
00335             m_list.SetItem(i, 2, LVIF_TEXT, "IGNORE", 0, 0, 0, 0);
00336         }
00337         else
00338         {
00339             CPStr kind;
00340
00341             if( conf->IsBinary() )
00342             {
00343                 kind << "BINARY";
00344             }
00345             else if( conf->IsUnicode() )
00346             {
00347                 kind << "UNICODE";
00348             }
00349             else
00350             {
00351                 kind << "TEXT";
00352             }
00353
00354             m_list.SetItem(i, 2, LVIF_TEXT, kind, 0, 0, 0, 0);
00355         }
00356
00357         m_list.SetItem(i, 1, LVIF_TEXT, desc, 0, 0, 0, 0);
00358         m_list.SetItem(i, 0, LVIF_TEXT, conf->HasConflict() ? "Error" : "OK", 0, 0, 0, 0);
00359
00360         conf = conf->next;
00361         i++;
00362     }
00363
00364     return TRUE;  // return TRUE unless you set the focus to a control
00365                   // EXCEPTION: OCX Property Pages should return FALSE
00366 }

Member Data Documentation

CButton CImportFilterDlg::m_edit

Definition at line 55 of file ImportFilterDlg.h.

Referenced by DoDataExchange.

ReportConflict* CImportFilterDlg::m_entries [protected]

Definition at line 69 of file ImportFilterDlg.h.

Referenced by CImportFilterDlg, OnEditentry, and OnInitDialog.

CImageList CImportFilterDlg::m_ImageList [protected]

Definition at line 68 of file ImportFilterDlg.h.

Referenced by OnInitDialog.

CListCtrl CImportFilterDlg::m_list

Definition at line 54 of file ImportFilterDlg.h.

Referenced by DoDataExchange, OnEditentry, and OnInitDialog.

ReportWarning* CImportFilterDlg::m_warnings [protected]

Definition at line 70 of file ImportFilterDlg.h.

Referenced by CImportFilterDlg, OnEditentry, and OnInitDialog.

The documentation for this class was generated from the following files:
  • common/ImportFilterDlg.h
  • common/ImportFilterDlg.cpp
Generated on Sun Feb 24 01:26:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ImportReport Class Reference

Inheritance diagram for ImportReport:

[legend]
Collaboration diagram for ImportReport:

[legend]
List of all members.

Public Methods

ImportReport (const char *path, ReportWarning *&w, ReportConflict *&c)
virtual | ~ImportReport ()
virtual kTraversal | EnterDirectory (const char *fullpath, const char *dirname, const FSSpec *macspec)
virtual kTraversal | ExitDirectory (const char *fullpath)
virtual kTraversal | OnError (const char *err, int errcode)
virtual kTraversal | OnIdle (const char *fullpath)
virtual kTraversal | OnDirectory (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)
virtual kTraversal | OnFile (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)
virtual kTraversal | OnAlias (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)

Public Attributes

ReportWarning *& warnings
ReportConflict *& conflicts
std::vector< UStr > m_Ignlist

Constructor & Destructor Documentation

ImportReport::ImportReport | ( | const char * | path,
 |  | ReportWarning *& | w,
 |  | ReportConflict *& | c
 | ) | [inline]

Definition at line 405 of file ImportFilter.cpp.

References BuildIgnoredList, conflicts, m_Ignlist, and warnings.

00405                                                                             : warnings(w), conflicts(c)
00406     {
00407         // MN - Apply ignore filter to import file list
00408         BuildIgnoredList(m_Ignlist, path);
00409     }

virtual ImportReport::~ImportReport ( ) [inline, virtual]

Definition at line 410 of file ImportFilter.cpp.

00410 {}

Member Function Documentation

virtual kTraversal ImportReport::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 417 of file ImportFilter.cpp.

References cvs_out, FSSpec, kContinueTraversal, and kTraversal.

00418     {
00419         cvs_out("Filtering \'%s\'...\n", fullpath);
00420         return kContinueTraversal;
00421     }

virtual kTraversal ImportReport::ExitDirectory ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 423 of file ImportFilter.cpp.

References kContinueTraversal, and kTraversal.

00424     {
00425         return kContinueTraversal;
00426     }

virtual kTraversal ImportReport::OnAlias | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 513 of file ImportFilter.cpp.

References FSSpec, kContinueTraversal, kFileIsAlias, kTraversal, list_add_warning, and stat.

00517     {
00518         list_add_warning(warnings, kFileIsAlias, fullname);
00519         return kContinueTraversal;
00520     }

virtual kTraversal ImportReport::OnDirectory | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 439 of file ImportFilter.cpp.

References FSSpec, kContinueTraversal, kSkipFile, kTraversal, stat, and stricmp.

00443     {
00444 #if defined(WIN32) || defined(macintosh)
00445         if(stricmp(name, "CVS") == 0)
00446 #else
00447         if(strcmp(name, "CVS") == 0)
00448 #endif
00449             return kSkipFile;
00450         return kContinueTraversal;
00451     }

virtual kTraversal ImportReport::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 428 of file ImportFilter.cpp.

References err, kContinueTraversal, kFileMissing, kTraversal, and list_add_warning.

00429     {
00430         list_add_warning(warnings, kFileMissing, err);
00431         return kContinueTraversal;
00432     }

virtual kTraversal ImportReport::OnFile | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 453 of file ImportFilter.cpp.

References FileIsBinary, FileIsText, FSSpec, kContinueTraversal, kFileIsOK, kFileType, kFileTypeBin, kFileTypeText, kFileTypeUnicode, kTextBinTYPE, kTextIsBinary, kTextIsUnicode, kTextWrongSig, kTraversal, list_add_type, list_add_warning, stat, and UFSSpec.

00457     {
00458         int mac_type = 0;
00459         int mac_creator = 0;
00460 #ifdef macintosh
00461 #   define MACSPEC , &fsSpec
00462         GUSIFileSpec inspec(fullname);
00463 #   if TARGET_RT_MAC_CFM
00464         mac_type = inspec.CatInfo()->FileInfo().ioFlFndrInfo.fdType;
00465         mac_creator = inspec.CatInfo()->FileInfo().ioFlFndrInfo.fdCreator;
00466 #   else
00467         FInfo finfo;
00468         memcpy(&finfo, inspec.CatInfo()->Info().finderInfo, 2 * sizeof(OSType));
00469         mac_type = finfo.fdType;
00470         mac_creator = finfo.fdCreator;
00471 #   endif
00472         UFSSpec fsSpec = inspec;
00473 #else /* !macintosh */
00474 #   define MACSPEC
00475 #endif /* !macintosh */
00476
00477         kFileType newType = kFileTypeText;
00478         kTextBinTYPE filetype = FileIsText(name, fullpath MACSPEC);
00479         if( kTextIsBinary == filetype || kTextWrongSig == filetype )
00480         {
00481             kTextBinTYPE bintype = FileIsBinary(name, fullpath MACSPEC);
00482             if( kFileIsOK != bintype )
00483             {
00484                 list_add_warning(warnings, bintype, fullname);
00485             }
00486             else if( kTextWrongSig == filetype )
00487             {
00488                 list_add_warning(warnings, filetype, fullname);
00489                 filetype = kTextIsBinary;
00490                 newType = kFileTypeBin;
00491             }
00492
00493             if( kFileIsOK == bintype )
00494             {
00495                 newType = kFileTypeBin;
00496             }
00497         }
00498         else if( kTextIsUnicode == filetype )
00499         {
00500             newType = kFileTypeUnicode;
00501         }
00502         else if( kFileIsOK != filetype )
00503         {
00504             list_add_warning(warnings, filetype, fullname);
00505         }
00506
00507         // add the type
00508         list_add_type(this, conflicts, newType, name, fullname, mac_type, mac_creator);
00509
00510         return kContinueTraversal;
00511     }

virtual kTraversal ImportReport::OnIdle ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 434 of file ImportFilter.cpp.

References kContinueTraversal, and kTraversal.

00435     {
00436         return kContinueTraversal;
00437     }

Member Data Documentation

ReportConflict*& ImportReport::conflicts

Definition at line 413 of file ImportFilter.cpp.

Referenced by ImportReport.

std::vector< UStr > ImportReport::m_Ignlist

Definition at line 414 of file ImportFilter.cpp.

Referenced by ImportReport, and list_add_type.

ReportWarning*& ImportReport::warnings

Definition at line 412 of file ImportFilter.cpp.

Referenced by ImportReport.

The documentation for this class was generated from the following file:
  • common/ImportFilter.cpp
Generated on Sun Feb 24 01:26:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CImportWarning Class Reference

#include <ImportFilterDlg.h>

Inheritance diagram for CImportWarning:

[legend]
Collaboration diagram for CImportWarning:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_WARNINGDESC }

Public Methods

CImportWarning (ReportWarning *warn, CWnd *pParent=NULL)

Public Attributes

CString | m_desc

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 89 of file ImportFilterDlg.h.

00089 { IDD = IDD_WARNINGDESC };

Constructor & Destructor Documentation

CImportWarning::CImportWarning | ( | ReportWarning * | warn,
 |  | CWnd * | pParent = NULL
 | ) |

Definition at line 61 of file ImportFilterDlg.cpp.

References CStr, m_desc, and ReportWarning::PrintOut.

00062     : CDialog(CImportWarning::IDD, pParent)
00063 {
00064     CStr print;
00065     warn->PrintOut(print);
00066     //{{AFX_DATA_INIT(CImportWarning)
00067     m_desc = print;
00068     //}}AFX_DATA_INIT
00069 }

Member Function Documentation

void CImportWarning::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 72 of file ImportFilterDlg.cpp.

References IDC_WARNINGDESC, and m_desc.

00073 {
00074     CDialog::DoDataExchange(pDX);
00075     //{{AFX_DATA_MAP(CImportWarning)
00076     DDX_Text(pDX, IDC_WARNINGDESC, m_desc);
00077     //}}AFX_DATA_MAP
00078 }

Member Data Documentation

CString CImportWarning::m_desc

Definition at line 90 of file ImportFilterDlg.h.

Referenced by CImportWarning, and DoDataExchange.

The documentation for this class was generated from the following files:
  • common/ImportFilterDlg.h
  • common/ImportFilterDlg.cpp
Generated on Sun Feb 24 01:26:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CInit_MAIN Class Reference

#include <InitDlg.h>

Inheritance diagram for CInit_MAIN:

[legend]
Collaboration diagram for CInit_MAIN:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_INIT_MAIN }

Public Methods

CInit_MAIN ()
CInit_MAIN (bool forceRoot)

Public Attributes

BOOL | m_forceroot
CString | m_helpinit

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 52 of file InitDlg.h.

00052 { IDD = IDD_INIT_MAIN };

Constructor & Destructor Documentation

CInit_MAIN::CInit_MAIN ( )

Definition at line 47 of file InitDlg.cpp.

References FALSE, m_forceroot, and m_helpinit.

00048     : CPropertyPage(CInit_MAIN::IDD)
00049 {
00050     //{{AFX_DATA_INIT(CInit_MAIN)
00051     m_forceroot = FALSE;
00052     m_helpinit = _T("");
00053     //}}AFX_DATA_INIT
00054 }

CInit_MAIN::CInit_MAIN ( bool forceRoot )

Definition at line 56 of file InitDlg.cpp.

References m_forceroot, and m_helpinit.

00057     : CPropertyPage(CInit_MAIN::IDD)
00058 {
00059     m_forceroot = forceRoot;
00060     m_helpinit = _T("If the CVSROOT (see next tab) is set to ""local"", "
00061         "the CVSROOT should be a Windows path (i.e. c:\\cvsroot). "
00062         "If the CVSROOT points on a remote machine, the path should be a Unix path "
00063         "(i.e. /fscvs/cvsroot : make sure you got the relevant security rights in "
00064         "order to create such a directory on the remote machine.");
00065 }

Member Function Documentation

void CInit_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 67 of file InitDlg.cpp.

References IDC_FORCEROOT, IDC_HELPINIT, m_forceroot, and m_helpinit.

00068 {
00069     CPropertyPage::DoDataExchange(pDX);
00070     //{{AFX_DATA_MAP(CInit_MAIN)
00071     DDX_Check(pDX, IDC_FORCEROOT, m_forceroot);
00072     DDX_Text(pDX, IDC_HELPINIT, m_helpinit);
00073     //}}AFX_DATA_MAP
00074 }

Member Data Documentation

BOOL CInit_MAIN::m_forceroot

Definition at line 53 of file InitDlg.h.

Referenced by CInit_MAIN, CompatGetInit, and DoDataExchange.

CString CInit_MAIN::m_helpinit

Definition at line 54 of file InitDlg.h.

Referenced by CInit_MAIN, and DoDataExchange.

The documentation for this class was generated from the following files:
  • common/InitDlg.h
  • common/InitDlg.cpp
Generated on Sun Feb 24 01:26:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


irciiAttrCvt Class Reference

#include <CTCP2Parse.hpp>

Inheritance diagram for irciiAttrCvt:

[legend]
Collaboration diagram for irciiAttrCvt:

[legend]
List of all members.

Public Methods

void | ircii2ctcp (std::string *in)

Static Private Attributes

const char | tokens [5]

Member Function Documentation

void irciiAttrCvt::ircii2ctcp ( std::string * in )

Definition at line 507 of file CTCP2Parse.cpp.

References CBOLD, CCTCP2, CREV, CSTOP, CUNDR, and tokens.

Referenced by CTCP2Parse::ParseIt.

00508 {
00509     int pos, bold = 0, under = 0, rev = 0;
00510
00511     pos = in->find_first_of(tokens);
00512
00513     while (pos != std::string::npos)
00514     {
00515         switch (in->at(pos))
00516         {
00517         case CBOLD:
00518             bold = !bold;
00519             in->replace(pos, 1,
00520                 std::string("") + CCTCP2 + 'B' + (bold?'+':'-') + CCTCP2);
00521             pos += 3;   // consume the additions
00522             break;
00523
00524         case CUNDR:
00525             under = !under;
00526             in->replace(pos, 1,
00527                 std::string("") + CCTCP2 + 'U' + (under?'+':'-') + CCTCP2);
00528             pos += 3;   // consume the additions
00529             break;
00530
00531         case CREV:
00532             rev = !rev;
00533             in->replace(pos, 1,
00534                 std::string("") + CCTCP2 + 'V' + (rev?'+':'-') + CCTCP2);
00535             pos += 3;   // consume the additions
00536             break;
00537
00538         case CSTOP:
00539             bold = under = rev = 0;
00540             in->replace(pos, 1, std::string("") + CCTCP2 + 'N' + CCTCP2);
00541             pos += 2;   // consume the additions
00542         }
00543         pos = in->find_first_of(tokens,++pos);
00544     }
00545 }

Member Data Documentation

const char irciiAttrCvt::tokens [static, private]

Initial value:

 {
     (char)2 ,  (char)31 ,  (char)22 ,  (char)15 , 0
}

Definition at line 502 of file CTCP2Parse.cpp.

Referenced by ircii2ctcp.

The documentation for this class was generated from the following files:
  • common/CTCP2Parse.hpp
  • common/CTCP2Parse.cpp
Generated on Sun Feb 24 01:26:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ISupportErrorInfo Class Reference

Inheritance diagram for ISupportErrorInfo:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CoWorker/CvsCoworker.h
Generated on Sun Feb 24 01:26:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


IUnknown Class Reference

Inheritance diagram for IUnknown:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CoWorker/CVS_Coworker.idl
Generated on Sun Feb 24 01:26:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Wincvs::IWincvs Interface Reference

List of all members.

Properties

BSTR ViewPath

Property Documentation

BSTR Wincvs::IWincvs::ViewPath

Definition at line 21 of file wincvs.odl.

The documentation for this interface was generated from the following file:
  • WinCvs/wincvs.odl
Generated on Sun Feb 24 01:29:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJX_COLORMAP Struct Reference

Collaboration diagram for CJX_COLORMAP:

[legend]
List of all members.

Public Attributes

DWORD | rgbqFrom
int | iSysColorTo

Member Data Documentation

int CJX_COLORMAP::iSysColorTo

Definition at line 128 of file CJToolBar.cpp.

Referenced by _LoadSysColorBitmap.

DWORD CJX_COLORMAP::rgbqFrom

Definition at line 127 of file CJToolBar.cpp.

Referenced by _LoadSysColorBitmap.

The documentation for this struct was generated from the following file:
  • WinCvs/CJLib/CJLibrary/CJToolBar.cpp
Generated on Sun Feb 24 01:26:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CJX_CONTROLPOS Struct Reference

Collaboration diagram for CJX_CONTROLPOS:

[legend]
List of all members.

Public Attributes

int | nIndex
int | nID
CRect | rectOldPos

Member Data Documentation

int CJX_CONTROLPOS::nID

Definition at line 260 of file CJToolBar.cpp.

Referenced by CCJToolBar::CalcLayout.

int CJX_CONTROLPOS::nIndex

Definition at line 259 of file CJToolBar.cpp.

Referenced by CCJToolBar::CalcLayout.

CRect CJX_CONTROLPOS::rectOldPos

Definition at line 261 of file CJToolBar.cpp.

Referenced by CCJToolBar::CalcLayout.

The documentation for this struct was generated from the following file:
  • WinCvs/CJLib/CJLibrary/CJToolBar.cpp
Generated on Sun Feb 24 01:26:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CKeyString Class Reference

#include <MultiString.h>

Inheritance diagram for CKeyString:

[legend]
Collaboration diagram for CKeyString:

[legend]
List of all members.

Public Methods

CKeyString (unsigned int maxstr, const char *uniqueName, char *const *defaultStr=0L, kClassPersistent pclass=kNoClass)
virtual | ~CKeyString ()

Static Public Methods

void | Concatenate (UStr &res, const char *key, const char *value)
void | Split (const char *str, UStr &key, UStr &value)

Protected Methods

virtual int | Compare (const char *s1, const char *s2) const

Constructor & Destructor Documentation

CKeyString::CKeyString | ( | unsigned int | maxstr,
 |  | const char * | uniqueName,
 |  | char *const * | defaultStr = 0L,
 |  | kClassPersistent | pclass = kNoClass
 | ) | [inline]

Definition at line 166 of file MultiString.h.

References kClassPersistent, and kNoClass.

00167                                                                            :
00168         CMString(maxstr, uniqueName, defaultStr, pclass)
00169     {
00170     }

virtual CKeyString::~CKeyString ( ) [inline, virtual]

Definition at line 172 of file MultiString.h.

00173     {
00174     }

Member Function Documentation

int CKeyString::Compare | ( | const char * | s1,
 |  | const char * | s2
 | ) | const [protected, virtual]

Reimplemented from TMString< UStr >.

Definition at line 207 of file MultiString.cpp.

References Split.

00208 {
00209     UStr key1, key2, val1, val2;
00210     Split(s1, key1, val1);
00211     Split(s2, key2, val2);
00212     return strcmp(key1, key2);
00213 }

void CKeyString::Concatenate | ( | UStr & | res,
 |  | const char * | key,
 |  | const char * | value
 | ) | [static]

Definition at line 166 of file MultiString.cpp.

Referenced by CvsPrefs::SetWhichCvs, and CvsPrefs::WhichCvs.

00167 {
00168     char c;
00169     while((c = *key++) != '\0')
00170     {
00171         if(c == '@' || c == '\\')
00172             res << '\\';
00173         res << c;
00174     }
00175     res << '@';
00176     while((c = *value++) != '\0')
00177     {
00178         if(c == '@' || c == '\\')
00179             res << '\\';
00180         res << c;
00181     }
00182 }

void CKeyString::Split | ( | const char * | str,
 |  | UStr & | key,
 |  | UStr & | value
 | ) | [static]

Definition at line 184 of file MultiString.cpp.

Referenced by Compare, and CvsPrefs::WhichCvs.

00185 {
00186     key = "";
00187     value = "";
00188     char c;
00189     bool inKey = true;
00190     while((c = *str++) != 0)
00191     {
00192         if(c == '\\')
00193             c = *str++;
00194         else if(c == '@')
00195         {
00196             inKey = false;
00197             continue;
00198         }
00199
00200         if(inKey)
00201             key << c;
00202         else
00203             value << c;
00204     }
00205 }

The documentation for this class was generated from the following files:
  • common/MultiString.h
  • common/MultiString.cpp
Generated on Sun Feb 24 01:26:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KiColumn Class Reference

#include <BrowseViewColumn.h>

Inheritance diagram for KiColumn:

[legend]
List of all members.

Public Methods

virtual void | GetSetupData (LV_COLUMN *lvc) const=0
virtual bool | IsDefaultAscending () const=0
virtual void | GetText (KoColumnContext *context, EntnodeData *data, char *buffer, int buffersize) const=0
virtual int | Compare (KoColumnContext *context, EntnodeData *d1, EntnodeData *d2) const=0

Member Function Documentation

virtual int KiColumn::Compare | ( | KoColumnContext * | context,
 |  | EntnodeData * | d1,
 |  | EntnodeData * | d2
 | ) | const [pure virtual]

Implemented in KoNameColumn.

Referenced by _Compare.

virtual void KiColumn::GetSetupData ( LV_COLUMN * lvc ) const [pure virtual]

Implemented in KoNameColumn.

Referenced by CBrowseFileView::AddColumns.

virtual void KiColumn::GetText | ( | KoColumnContext * | context,
 |  | EntnodeData * | data,
 |  | char * | buffer,
 |  | int | buffersize
 | ) | const [pure virtual]

Implemented in KoNameColumn.

Referenced by TViewFill::InitItem, and CBrowseFileView::OnPrint.

virtual bool KiColumn::IsDefaultAscending ( ) const [pure virtual]

Implemented in KoNameColumn.

Referenced by CBrowseFileView::OnColumnclick.

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.h
Generated on Sun Feb 24 01:26:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KiColumnModel Class Reference

#include <BrowseViewColumn.h>

Inheritance diagram for KiColumnModel:

[legend]
List of all members.

Public Methods

virtual const KiColumn * | GetAt (int pos) const=0
virtual int | GetType (int pos) const=0
virtual int | GetCount () const=0
virtual int | GetColumn (int type) const

Static Public Methods

KiColumnModel * | GetRecursiveModel ()
KiColumnModel * | GetRegularModel ()

Member Function Documentation

virtual const KiColumn* KiColumnModel::GetAt ( int pos ) const [pure virtual]

Implemented in KoRegularModel.

Referenced by CBrowseFileView::AddColumns, TViewFill::InitItem, CBrowseFileView::OnColumnclick, CBrowseFileView::OnPrint, CBrowseFileView::ResetView, and CBrowseFileView::Resort.

int KiColumnModel::GetColumn ( int type ) const [virtual]

Definition at line 598 of file BrowseViewColumn.cpp.

References GetCount, and GetType.

00599 {
00600     int numColumns = GetCount();
00601     for(int i = 0; i < numColumns; i++)
00602     {
00603         if(type == GetType(i))
00604             return i;
00605     }
00606     return 0;
00607 }

virtual int KiColumnModel::GetCount ( ) const [pure virtual]

Implemented in KoRegularModel.

Referenced by CBrowseFileView::AddColumns, CBrowseFileView::DeleteColumns, GetColumn, TViewFill::InitItem, CBrowseFileView::OnPrint, and CBrowseFileView::ResetView.

KiColumnModel * KiColumnModel::GetRecursiveModel ( ) [static]

Definition at line 588 of file BrowseViewColumn.cpp.

References modelRecursive.

Referenced by CBrowseFileView::SetRecursive.

00589 {
00590     return &modelRecursive;
00591 }

KiColumnModel * KiColumnModel::GetRegularModel ( ) [static]

Definition at line 593 of file BrowseViewColumn.cpp.

References modelRegular.

Referenced by CBrowseFileView::SetRecursive.

00594 {
00595     return &modelRegular;
00596 }

virtual int KiColumnModel::GetType ( int pos ) const [pure virtual]

Implemented in KoRegularModel.

Referenced by GetColumn.

The documentation for this class was generated from the following files:
  • common/BrowseViewColumn.h
  • common/BrowseViewColumn.cpp
Generated on Sun Feb 24 01:26:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KiFilterModel Class Reference

#include <BrowseViewModel.h>

Inheritance diagram for KiFilterModel:

[legend]
List of all members.

Public Methods

virtual bool | IsMatch (EntnodeData *data)=0
virtual NotificationManager * | GetNotificationManager ()=0

Member Function Documentation

virtual NotificationManager* KiFilterModel::GetNotificationManager ( ) [pure virtual]

Implemented in KoFilterModel.

Referenced by CBrowseFileView::OnDestroy, and CBrowseFileView::OnInitialUpdate.

virtual bool KiFilterModel::IsMatch ( EntnodeData * data ) [pure virtual]

Implemented in KoFilterModel.

Referenced by KoTraversalContext::IsMatch.

The documentation for this class was generated from the following file:
  • common/BrowseViewModel.h
Generated on Sun Feb 24 01:26:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KiIgnoreModel Class Reference

#include <BrowseViewModel.h>

Inheritance diagram for KiIgnoreModel:

[legend]
List of all members.

Public Methods

virtual bool | IsShowIgnored ()=0
virtual NotificationManager * | GetNotificationManager ()=0

Member Function Documentation

virtual NotificationManager* KiIgnoreModel::GetNotificationManager ( ) [pure virtual]

Implemented in KoIgnoreModel.

Referenced by CWinCvsBrowser::OnDestroy, CBrowseFileView::OnDestroy, CWinCvsBrowser::OnInitialUpdate, and CBrowseFileView::OnInitialUpdate.

virtual bool KiIgnoreModel::IsShowIgnored ( ) [pure virtual]

Implemented in KoIgnoreModel.

Referenced by KoTraversalContext::KoTraversalContext, and TBrowserFill::TBrowserFill.

The documentation for this class was generated from the following file:
  • common/BrowseViewModel.h
Generated on Sun Feb 24 01:26:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KiRecursionModel Class Reference

#include <BrowseViewModel.h>

Inheritance diagram for KiRecursionModel:

[legend]
List of all members.

Public Methods

virtual bool | IsShowRecursive ()=0
virtual NotificationManager * | GetNotificationManager ()=0

Member Function Documentation

virtual NotificationManager* KiRecursionModel::GetNotificationManager ( ) [pure virtual]

Implemented in KoRecursionModel.

Referenced by CBrowseFileView::OnDestroy, and CBrowseFileView::OnInitialUpdate.

virtual bool KiRecursionModel::IsShowRecursive ( ) [pure virtual]

Implemented in KoRecursionModel.

Referenced by KoTraversalContext::KoTraversalContext.

The documentation for this class was generated from the following file:
  • common/BrowseViewModel.h
Generated on Sun Feb 24 01:26:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KiSelectionHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KiSelectionHandler:

[legend]
List of all members.

Public Methods

virtual void | OnFolder (const char *fullpath)=0
virtual void | OnFiles (MultiFiles *mf)=0

Member Function Documentation

virtual void KiSelectionHandler::OnFiles ( MultiFiles * mf ) [pure virtual]

Implemented in KoMoveToTrashHandler.

Referenced by CBrowseFileView::ProcessSelectionCommand.

virtual void KiSelectionHandler::OnFolder ( const char * fullpath ) [pure virtual]

Implemented in KoMoveToTrashHandler.

Referenced by CBrowseFileView::ProcessSelectionCommand.

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoAddBinaryHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoAddBinaryHandler:

[legend]
Collaboration diagram for KoAddBinaryHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoAddBinaryHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 388 of file BrowseViewHandlers.h.

References CvsCmdAddBinaryFiles.

00389     {
00390         CvsCmdAddBinaryFiles(pmf);
00391     }

virtual void KoAddBinaryHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 383 of file BrowseViewHandlers.h.

References CvsCmdAddFolder.

00384     {
00385         CvsCmdAddFolder(fullpath);
00386     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoAddHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoAddHandler:

[legend]
Collaboration diagram for KoAddHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoAddHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 374 of file BrowseViewHandlers.h.

References CvsCmdAddFiles.

00375     {
00376         CvsCmdAddFiles(pmf);
00377     }

virtual void KoAddHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 369 of file BrowseViewHandlers.h.

References CvsCmdAddFolder.

00370     {
00371         CvsCmdAddFolder(fullpath);
00372     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoAddUnicodeHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoAddUnicodeHandler:

[legend]
Collaboration diagram for KoAddUnicodeHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoAddUnicodeHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 402 of file BrowseViewHandlers.h.

References CvsCmdAddUnicodeFiles.

00403     {
00404         CvsCmdAddUnicodeFiles(pmf);
00405     }

virtual void KoAddUnicodeHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 397 of file BrowseViewHandlers.h.

References CvsCmdAddFolder.

00398     {
00399         CvsCmdAddFolder(fullpath);
00400     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoAnnotateHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoAnnotateHandler:

[legend]
Collaboration diagram for KoAnnotateHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoAnnotateHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 458 of file BrowseViewHandlers.h.

References CvsCmdAnnotateFiles.

00459     {
00460         CvsCmdAnnotateFiles(pmf);
00461     }

virtual void KoAnnotateHandler::OnFolder ( const char * ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 453 of file BrowseViewHandlers.h.

00454     {
00455         /*we avoid processing directory*/
00456     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoBranchTagHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoBranchTagHandler:

[legend]
Collaboration diagram for KoBranchTagHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoBranchTagHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 140 of file BrowseViewHandlers.h.

References CvsCmdTagBranchFiles.

00141     {
00142         CvsCmdTagBranchFiles(pmf);
00143     }

virtual void KoBranchTagHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 135 of file BrowseViewHandlers.h.

References CvsCmdTagBranchFolder.

00136     {
00137         CvsCmdTagBranchFolder(fullpath);
00138     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoColumnContext Class Reference

#include <BrowseViewColumn.h>

Collaboration diagram for KoColumnContext:

[legend]
List of all members.

Public Methods

KoColumnContext (const char *path)

Public Attributes

UStr m_path

Constructor & Destructor Documentation

KoColumnContext::KoColumnContext ( const char * path ) [inline]

Definition at line 33 of file BrowseViewColumn.h.

00034     : m_path(path)
00035     {}

Member Data Documentation

UStr KoColumnContext::m_path

Definition at line 29 of file BrowseViewColumn.h.

Referenced by KoPathColumn::GetText.

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.h
Generated on Sun Feb 24 01:26:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoCommitHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoCommitHandler:

[legend]
Collaboration diagram for KoCommitHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoCommitHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 416 of file BrowseViewHandlers.h.

References CvsCmdCommitFiles.

00417     {
00418         CvsCmdCommitFiles(pmf);
00419     }

virtual void KoCommitHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 411 of file BrowseViewHandlers.h.

References CvsCmdCommitFolder.

00412     {
00413         CvsCmdCommitFolder(fullpath);
00414     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoConflictColumn Class Reference

Inheritance diagram for KoConflictColumn:

[legend]
Collaboration diagram for KoConflictColumn:

[legend]
List of all members.

Public Methods

virtual void | GetSetupData (LV_COLUMN *lvc) const
virtual void | GetText (KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const
virtual int | Compare (KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const
virtual bool | IsDefaultAscending () const

Member Function Documentation

virtual int KoConflictColumn::Compare | ( | KoColumnContext * | ,
 |  | EntnodeData * | d1,
 |  | EntnodeData * | d2
 | ) | const [inline, virtual]

Implements KiColumn.

Definition at line 496 of file BrowseViewColumn.cpp.

References EntnodeData::GetConflict.

00497     {
00498         const char *s1 = d1->GetConflict();
00499         const char *s2 = d2->GetConflict();
00500         int res;
00501         if(s1 != 0L && s2 != 0L)
00502             res = strcmp(s1, s2);
00503         else
00504             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00505         return res;
00506     }

virtual void KoConflictColumn::GetSetupData ( LV_COLUMN * lvc ) const [inline, virtual]

Implements KiColumn.

Definition at line 473 of file BrowseViewColumn.cpp.

00474     {
00475         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00476         lvc->pszText = _T("Conflict");
00477         lvc->cx = 150;
00478         lvc->fmt = LVCFMT_LEFT;
00479     }

virtual void KoConflictColumn::GetText | ( | KoColumnContext * | ,
 |  | EntnodeData * | data,
 |  | char * | buffer,
 |  | int | bufferSize
 | ) | const [inline, virtual]

Implements KiColumn.

Definition at line 490 of file BrowseViewColumn.cpp.

References EntnodeData::GetConflict, and SafeCopy.

00491     {
00492         SafeCopy(buffer, data->GetConflict(), bufferSize);
00493     }

virtual bool KoConflictColumn::IsDefaultAscending ( ) const [inline, virtual]

Implements KiColumn.

Definition at line 509 of file BrowseViewColumn.cpp.

00510     {
00511         return true;
00512     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Sun Feb 24 01:26:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoCreateTagHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoCreateTagHandler:

[legend]
Collaboration diagram for KoCreateTagHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoCreateTagHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 112 of file BrowseViewHandlers.h.

References CvsCmdTagCreateFiles.

00113     {
00114         CvsCmdTagCreateFiles(pmf);
00115     }

virtual void KoCreateTagHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 107 of file BrowseViewHandlers.h.

References CvsCmdTagCreateFolder.

00108     {
00109         CvsCmdTagCreateFolder(fullpath);
00110     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoDateColumn Class Reference

Inheritance diagram for KoDateColumn:

[legend]
Collaboration diagram for KoDateColumn:

[legend]
List of all members.

Public Methods

virtual void | GetSetupData (LV_COLUMN *lvc) const
virtual void | GetText (KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const
virtual int | Compare (KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const
virtual bool | IsDefaultAscending () const

Member Function Documentation

virtual int KoDateColumn::Compare | ( | KoColumnContext * | ,
 |  | EntnodeData * | d1,
 |  | EntnodeData * | d2
 | ) | const [inline, virtual]

Implements KiColumn.

Definition at line 441 of file BrowseViewColumn.cpp.

References get_date, EntnodeFile::kTS, and NULL.

00442     {
00443         const char *s1 = (*d1)[EntnodeFile::kTS];
00444         const char *s2 = (*d2)[EntnodeFile::kTS];
00445         int res;
00446
00447         if(s1 != 0L && s2 != 0L) {
00448             time_t t1 = get_date(s1,(struct timeb *)NULL);
00449             time_t t2 = get_date(s2,(struct timeb *)NULL);
00450
00451             res = t1 < t2 ? -1 : (t1 > t2 ? 1 : 0);
00452         }
00453         else
00454             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00455         return res;
00456     }

virtual void KoDateColumn::GetSetupData ( LV_COLUMN * lvc ) const [inline, virtual]

Implements KiColumn.

Definition at line 418 of file BrowseViewColumn.cpp.

References IsLargeFonts.

00419     {
00420         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00421         lvc->pszText = _T("Date");
00422         lvc->cx = (IsLargeFonts()) ? 170 : 150;
00423         lvc->fmt = LVCFMT_LEFT;
00424     }

virtual void KoDateColumn::GetText | ( | KoColumnContext * | ,
 |  | EntnodeData * | data,
 |  | char * | buffer,
 |  | int | bufferSize
 | ) | const [inline, virtual]

Implements KiColumn.

Definition at line 435 of file BrowseViewColumn.cpp.

References EntnodeFile::kTS, and SafeCopy.

00436     {
00437         SafeCopy(buffer, (*data)[EntnodeFile::kTS], bufferSize);
00438     }

virtual bool KoDateColumn::IsDefaultAscending ( ) const [inline, virtual]

Implements KiColumn.

Definition at line 459 of file BrowseViewColumn.cpp.

00460     {
00461         return true;
00462     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Sun Feb 24 01:26:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoDeleteTagHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoDeleteTagHandler:

[legend]
Collaboration diagram for KoDeleteTagHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoDeleteTagHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 126 of file BrowseViewHandlers.h.

References CvsCmdTagDeleteFiles.

00127     {
00128         CvsCmdTagDeleteFiles(pmf);
00129     }

virtual void KoDeleteTagHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 121 of file BrowseViewHandlers.h.

References CvsCmdTagDeleteFolder.

00122     {
00123         CvsCmdTagDeleteFolder(fullpath);
00124     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoDiffHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoDiffHandler:

[legend]
Collaboration diagram for KoDiffHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoDiffHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 278 of file BrowseViewHandlers.h.

References CvsCmdDiffFiles.

00279     {
00280         CvsCmdDiffFiles(pmf);
00281     }

virtual void KoDiffHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 273 of file BrowseViewHandlers.h.

References CvsCmdDiffFolder.

00274     {
00275         CvsCmdDiffFolder(fullpath);
00276     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoEditHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoEditHandler:

[legend]
Collaboration diagram for KoEditHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoEditHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 154 of file BrowseViewHandlers.h.

References CvsCmdEditFiles.

00155     {
00156         CvsCmdEditFiles(pmf);
00157     }

virtual void KoEditHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 149 of file BrowseViewHandlers.h.

References CvsCmdEditFolder.

00150     {
00151         CvsCmdEditFolder(fullpath);
00152     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoEditorsHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoEditorsHandler:

[legend]
Collaboration diagram for KoEditorsHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoEditorsHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 236 of file BrowseViewHandlers.h.

References CvsCmdEditorsFiles.

00237     {
00238         CvsCmdEditorsFiles(pmf);
00239     }

virtual void KoEditorsHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 231 of file BrowseViewHandlers.h.

References CvsCmdEditorsFolder.

00232     {
00233         CvsCmdEditorsFolder(fullpath);
00234     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoFileRemoveHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoFileRemoveHandler:

[legend]
Collaboration diagram for KoFileRemoveHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoFileRemoveHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 332 of file BrowseViewHandlers.h.

References CvsCmdRemoveFiles.

00333     {
00334         CvsCmdRemoveFiles(pmf);
00335     }

virtual void KoFileRemoveHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 329 of file BrowseViewHandlers.h.

00330     { /*folder cannot be removed */ }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoFilterModel Class Reference

#include <BrowseViewModel.h>

Inheritance diagram for KoFilterModel:

[legend]
Collaboration diagram for KoFilterModel:

[legend]
List of all members.

Public Methods

KoFilterModel ()
~KoFilterModel ()
virtual bool | IsMatch (EntnodeData *data)
virtual NotificationManager * | GetNotificationManager ()
bool | IsDefaultMode () const
void | ToggleModified ()
bool | IsModified () const
bool | SetMask (const char *mask)
void | ToggleConflict ()
bool | IsConflict () const
void | ToggleUnknown ()
bool | IsUnknown () const
void | ToggleHideUnknown ()
bool | IsHideUnknown () const
void | ToggleMissing ()
bool | IsMissing () const
void | ToggleChanged ()
bool | IsChanged () const
void | ToggleAdded ()
bool | IsAdded () const
void | ToggleRemoved ()
bool | IsRemoved () const

Protected Attributes

NotificationManager m_manager
UStr m_mask
std::vector< UStr > m_match
bool | m_isChanged
bool | m_isAdded
bool | m_isRemoved
bool | m_isConflicts
bool | m_isUnknown
bool | m_isHideUnknown
bool | m_isMissing

Constructor & Destructor Documentation

KoFilterModel::KoFilterModel ( )

Definition at line 37 of file BrowseViewModel.cpp.

00038 : m_isChanged(persistentChanged)
00039 , m_isAdded(persistentAdded)
00040 , m_isRemoved(persistentRemoved)
00041 , m_isConflicts(persistentConflicts)
00042 , m_isUnknown(persistentUnknown)
00043 , m_isMissing(persistentMissing)
00044 , m_isHideUnknown(persistentHideUnknown)
00045 {}

KoFilterModel::~KoFilterModel ( )

Definition at line 47 of file BrowseViewModel.cpp.

References m_isAdded, m_isChanged, m_isConflicts, m_isHideUnknown, m_isMissing, m_isRemoved, and m_isUnknown.

00048 {
00049     persistentChanged = m_isChanged;
00050     persistentAdded = m_isAdded;
00051     persistentRemoved = m_isRemoved;
00052     persistentConflicts = m_isConflicts;
00053     persistentUnknown = m_isUnknown;
00054     persistentMissing = m_isMissing;
00055     persistentHideUnknown = m_isHideUnknown;
00056 }

Member Function Documentation

NotificationManager * KoFilterModel::GetNotificationManager ( ) [virtual]

Implements KiFilterModel.

Definition at line 164 of file BrowseViewModel.cpp.

References m_manager.

Referenced by CMainFrame::OnFilterMaskEntered, CMainFrame::OnViewAdded, CMainFrame::OnViewChanged, CMainFrame::OnViewConflict, CMainFrame::OnViewHideunknown, CMainFrame::OnViewMissing, CMainFrame::OnViewModified, CMainFrame::OnViewRemoved, and CMainFrame::OnViewUnknown.

00165 {
00166     return &m_manager;
00167 }

bool KoFilterModel::IsAdded ( ) const [inline]

Definition at line 257 of file BrowseViewModel.h.

References m_isAdded.

Referenced by CMainFrame::OnUpdateViewAdded.

00258     {
00259         return m_isAdded;
00260     }

bool KoFilterModel::IsChanged ( ) const [inline]

Definition at line 247 of file BrowseViewModel.h.

References m_isChanged.

Referenced by CMainFrame::OnUpdateViewChanged.

00248     {
00249         return m_isChanged;
00250     }

bool KoFilterModel::IsConflict ( ) const [inline]

Definition at line 206 of file BrowseViewModel.h.

References m_isConflicts.

Referenced by CMainFrame::OnUpdateViewConflict.

00207     {
00208         return m_isConflicts;
00209     }

bool KoFilterModel::IsDefaultMode ( ) const

Definition at line 58 of file BrowseViewModel.cpp.

References m_isAdded, m_isChanged, m_isConflicts, m_isMissing, and m_isRemoved.

Referenced by IsMatch, and CMainFrame::OnUpdateViewHideunknown.

00059 {
00060     return !m_isConflicts && !m_isChanged && !m_isMissing && !m_isAdded && !m_isRemoved;
00061 }

bool KoFilterModel::IsHideUnknown ( ) const [inline]

Definition at line 224 of file BrowseViewModel.h.

References m_isHideUnknown.

Referenced by CMainFrame::OnUpdateViewHideunknown.

00225     {
00226         return m_isHideUnknown;
00227     }

bool KoFilterModel::IsMatch ( EntnodeData * data ) [virtual]

Implements KiFilterModel.

Definition at line 63 of file BrowseViewModel.cpp.

References EntnodeData::GetConflict, EntnodeData::GetName, IsDefaultMode, EntnodeData::IsMissing, EntnodeData::IsRemoved, EntnodeData::IsUnknown, EntnodeData::IsUnmodified, EntnodeFile::kVN, m_isAdded, m_isChanged, m_isConflicts, m_isHideUnknown, m_isMissing, m_isRemoved, m_isUnknown, m_match, MatchIgnoredList, and NULL.

00064 {
00065     // check to see if file name matches
00066     if (m_match.size() && !MatchIgnoredList(data->GetName(), m_match))
00067     {
00068         return false;
00069     }
00070
00071     if (IsDefaultMode() && !m_isUnknown)
00072     {
00073         // check if unknown files are to be hidden
00074         if (data->IsUnknown() && m_isHideUnknown)
00075         {
00076             // unknown item match
00077             return false;
00078         }
00079
00080         return true;
00081     }
00082
00083     if (data->IsMissing() && data->IsRemoved() && m_isRemoved)
00084     {
00085         // removed item match
00086         return true;
00087     }
00088
00089     if (data->IsMissing() && !data->IsRemoved() && m_isMissing)
00090     {
00091         // missing item match
00092         return true;
00093     }
00094
00095     if (data->IsUnknown() && m_isUnknown)
00096     {
00097         // unknown item match
00098         return true;
00099     }
00100
00101     if ((data->GetConflict() != NULL) && m_isConflicts)
00102     {
00103         // conflict match
00104         return true;
00105     }
00106
00107     if (!data->IsUnmodified())
00108     {
00109         // can be either changed or added
00110         const char* vn = (*data)[EntnodeFile::kVN];
00111         bool isAdded = vn && (strcmp(vn, "0") == 0);
00112         if (isAdded && m_isAdded)
00113         {
00114             // added file match
00115             return true;
00116         }
00117         if (!isAdded && m_isChanged)
00118         {
00119             // changed file match
00120             return true;
00121         }
00122     }
00123
00124     // no match
00125     return false;
00126 }

bool KoFilterModel::IsMissing ( ) const [inline]

Definition at line 237 of file BrowseViewModel.h.

References m_isMissing.

Referenced by CMainFrame::OnUpdateViewMissing.

00238     {
00239         return m_isMissing;
00240     }

bool KoFilterModel::IsModified ( ) const

Definition at line 158 of file BrowseViewModel.cpp.

References m_isAdded, m_isChanged, m_isConflicts, and m_isRemoved.

Referenced by CMainFrame::OnUpdateViewModified, and ToggleModified.

00159 {
00160     bool isModified = m_isAdded && m_isChanged && m_isRemoved && m_isConflicts;
00161     return isModified;
00162 }

bool KoFilterModel::IsRemoved ( ) const [inline]

Definition at line 267 of file BrowseViewModel.h.

References m_isRemoved.

Referenced by CMainFrame::OnUpdateViewRemoved.

00268     {
00269         return m_isRemoved;
00270     }

bool KoFilterModel::IsUnknown ( ) const [inline]

Definition at line 215 of file BrowseViewModel.h.

References m_isUnknown.

Referenced by CMainFrame::OnUpdateViewUnknown.

00216     {
00217         return m_isUnknown;
00218     }

bool KoFilterModel::SetMask ( const char * mask )

Definition at line 169 of file BrowseViewModel.cpp.

References UStr::empty, m_mask, m_match, NULL, and stricmp.

Referenced by CMainFrame::FreshenFileMask.

00170 {
00171     bool changed = m_mask.empty() || fileMask == 0L || stricmp(m_mask, fileMask) != 0;
00172     if (changed)
00173     {
00174         m_mask = fileMask;
00175         m_match.clear();
00176         if (!m_mask.empty())
00177         {
00178             // build match list
00179             UStr mask = fileMask;
00180             char * buffer = mask;
00181             static const char separators[] = " \t;";
00182             for (char * token = strtok(buffer, separators); token; token = strtok(NULL, separators))
00183             {
00184                 m_match.push_back(UStr(token));
00185             }
00186         }
00187     }
00188     return changed;
00189 }

void KoFilterModel::ToggleAdded ( ) [inline]

Definition at line 252 of file BrowseViewModel.h.

References m_isAdded.

Referenced by CMainFrame::OnViewAdded.

00253     {
00254         m_isAdded = !m_isAdded;
00255     }

void KoFilterModel::ToggleChanged ( ) [inline]

Definition at line 242 of file BrowseViewModel.h.

References m_isChanged.

Referenced by CMainFrame::OnViewChanged.

00243     {
00244         m_isChanged = !m_isChanged;
00245     }

void KoFilterModel::ToggleConflict ( ) [inline]

Definition at line 200 of file BrowseViewModel.h.

References m_isConflicts.

Referenced by CMainFrame::OnViewConflict.

00201     {
00202         m_isConflicts = !m_isConflicts;
00203     }

void KoFilterModel::ToggleHideUnknown ( )

Definition at line 129 of file BrowseViewModel.cpp.

References m_isHideUnknown, and m_isUnknown.

Referenced by CMainFrame::OnViewHideunknown.

00130 {
00131     m_isHideUnknown = !m_isHideUnknown;
00132     if (m_isHideUnknown)
00133     {
00134         m_isUnknown = false;
00135     }
00136 }

void KoFilterModel::ToggleMissing ( ) [inline]

Definition at line 231 of file BrowseViewModel.h.

References m_isMissing.

Referenced by CMainFrame::OnViewMissing.

00232     {
00233         m_isMissing = !m_isMissing;
00234     }

void KoFilterModel::ToggleModified ( )

Definition at line 149 of file BrowseViewModel.cpp.

References IsModified, m_isAdded, m_isChanged, m_isConflicts, and m_isRemoved.

Referenced by CMainFrame::OnViewModified.

00150 {
00151     m_isAdded =
00152     m_isChanged =
00153     m_isRemoved =
00154     m_isConflicts = !IsModified();
00155 }

void KoFilterModel::ToggleRemoved ( ) [inline]

Definition at line 262 of file BrowseViewModel.h.

References m_isRemoved.

Referenced by CMainFrame::OnViewRemoved.

00263     {
00264         m_isRemoved = !m_isRemoved;
00265     }

void KoFilterModel::ToggleUnknown ( )

Definition at line 139 of file BrowseViewModel.cpp.

References m_isHideUnknown, and m_isUnknown.

Referenced by CMainFrame::OnViewUnknown.

00140 {
00141     m_isUnknown = !m_isUnknown;
00142     if (m_isUnknown)
00143     {
00144         m_isHideUnknown = false;
00145     }
00146 }

Member Data Documentation

bool KoFilterModel::m_isAdded [protected]

Definition at line 163 of file BrowseViewModel.h.

Referenced by IsAdded, IsDefaultMode, IsMatch, IsModified, ToggleAdded, ToggleModified, and ~KoFilterModel.

bool KoFilterModel::m_isChanged [protected]

Definition at line 162 of file BrowseViewModel.h.

Referenced by IsChanged, IsDefaultMode, IsMatch, IsModified, ToggleChanged, ToggleModified, and ~KoFilterModel.

bool KoFilterModel::m_isConflicts [protected]

Definition at line 165 of file BrowseViewModel.h.

Referenced by IsConflict, IsDefaultMode, IsMatch, IsModified, ToggleConflict, ToggleModified, and ~KoFilterModel.

bool KoFilterModel::m_isHideUnknown [protected]

Definition at line 168 of file BrowseViewModel.h.

Referenced by IsHideUnknown, IsMatch, ToggleHideUnknown, ToggleUnknown, and ~KoFilterModel.

bool KoFilterModel::m_isMissing [protected]

Definition at line 170 of file BrowseViewModel.h.

Referenced by IsDefaultMode, IsMatch, IsMissing, ToggleMissing, and ~KoFilterModel.

bool KoFilterModel::m_isRemoved [protected]

Definition at line 164 of file BrowseViewModel.h.

Referenced by IsDefaultMode, IsMatch, IsModified, IsRemoved, ToggleModified, ToggleRemoved, and ~KoFilterModel.

bool KoFilterModel::m_isUnknown [protected]

Definition at line 167 of file BrowseViewModel.h.

Referenced by IsMatch, IsUnknown, ToggleHideUnknown, ToggleUnknown, and ~KoFilterModel.

NotificationManager KoFilterModel::m_manager [protected]

Definition at line 159 of file BrowseViewModel.h.

Referenced by GetNotificationManager.

UStr KoFilterModel::m_mask [protected]

Definition at line 160 of file BrowseViewModel.h.

Referenced by SetMask.

std::vector<UStr> KoFilterModel::m_match [protected]

Definition at line 161 of file BrowseViewModel.h.

Referenced by IsMatch, and SetMask.

The documentation for this class was generated from the following files:
  • common/BrowseViewModel.h
  • common/BrowseViewModel.cpp
Generated on Sun Feb 24 01:26:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoForceEditHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoForceEditHandler:

[legend]
Collaboration diagram for KoForceEditHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoForceEditHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 182 of file BrowseViewHandlers.h.

References CvsCmdEditFiles, and kEditForce.

00183     {
00184         CvsCmdEditFiles(pmf, kEditForce);
00185     }

virtual void KoForceEditHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 177 of file BrowseViewHandlers.h.

References CvsCmdEditFolder, and kEditForce.

00178     {
00179         CvsCmdEditFolder(fullpath, kEditForce);
00180     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoGraphHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoGraphHandler:

[legend]
Collaboration diagram for KoGraphHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoGraphHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 306 of file BrowseViewHandlers.h.

References CvsCmdLogFiles.

00307     {
00308         CvsCmdLogFiles(pmf, true);
00309     }

virtual void KoGraphHandler::OnFolder ( const char * ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 301 of file BrowseViewHandlers.h.

00302     {
00303         /*we avoid processing directory*/
00304     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoIgnoreModel Class Reference

#include <BrowseViewModel.h>

Inheritance diagram for KoIgnoreModel:

[legend]
Collaboration diagram for KoIgnoreModel:

[legend]
List of all members.

Public Methods

KoIgnoreModel ()
~KoIgnoreModel ()
virtual bool | IsShowIgnored ()
virtual NotificationManager * | GetNotificationManager ()
void | ToggleIgnore ()

Private Attributes

NotificationManager m_manager
bool | m_isIgnore

Constructor & Destructor Documentation

KoIgnoreModel::KoIgnoreModel ( )

Definition at line 223 of file BrowseViewModel.cpp.

00224 : m_isIgnore(persistentIgnore)
00225 {}

KoIgnoreModel::~KoIgnoreModel ( )

Definition at line 227 of file BrowseViewModel.cpp.

References m_isIgnore.

00228 {
00229     persistentIgnore =  m_isIgnore;
00230 }

Member Function Documentation

NotificationManager * KoIgnoreModel::GetNotificationManager ( ) [virtual]

Implements KiIgnoreModel.

Definition at line 237 of file BrowseViewModel.cpp.

References m_manager.

Referenced by CMainFrame::OnViewIgnore.

00238 {
00239     return &m_manager;
00240 }

bool KoIgnoreModel::IsShowIgnored ( ) [virtual]

Implements KiIgnoreModel.

Definition at line 232 of file BrowseViewModel.cpp.

References m_isIgnore.

Referenced by CMainFrame::OnUpdateViewIgnore.

00233 {
00234     return m_isIgnore;
00235 }

void KoIgnoreModel::ToggleIgnore ( )

Definition at line 242 of file BrowseViewModel.cpp.

References m_isIgnore.

Referenced by CMainFrame::OnViewIgnore.

00243 {
00244     m_isIgnore = !m_isIgnore;
00245 };

Member Data Documentation

bool KoIgnoreModel::m_isIgnore [private]

Definition at line 305 of file BrowseViewModel.h.

Referenced by IsShowIgnored, ToggleIgnore, and ~KoIgnoreModel.

NotificationManager KoIgnoreModel::m_manager [private]

Definition at line 302 of file BrowseViewModel.h.

Referenced by GetNotificationManager.

The documentation for this class was generated from the following files:
  • common/BrowseViewModel.h
  • common/BrowseViewModel.cpp
Generated on Sun Feb 24 01:26:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoLockHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoLockHandler:

[legend]
Collaboration diagram for KoLockHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoLockHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 346 of file BrowseViewHandlers.h.

References CvsCmdLockFiles.

00347     {
00348         CvsCmdLockFiles(pmf);
00349     }

virtual void KoLockHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 341 of file BrowseViewHandlers.h.

References CvsCmdLockFolder.

00342     {
00343         CvsCmdLockFolder(fullpath);
00344     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoLogHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoLogHandler:

[legend]
Collaboration diagram for KoLogHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoLogHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 292 of file BrowseViewHandlers.h.

References CvsCmdLogFiles.

00293     {
00294         CvsCmdLogFiles(pmf);
00295     }

virtual void KoLogHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 287 of file BrowseViewHandlers.h.

References CvsCmdLogFolder.

00288     {
00289         CvsCmdLogFolder(fullpath);
00290     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoMoveToTrashHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoMoveToTrashHandler:

[legend]
Collaboration diagram for KoMoveToTrashHandler:

[legend]
List of all members.

Public Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *mf)

Member Function Documentation

virtual void KoMoveToTrashHandler::OnFiles ( MultiFiles * mf ) [inline, virtual]

Implements KiSelectionHandler.

Definition at line 43 of file BrowseViewHandlers.h.

References CompatMoveToTrash, CStr, cvs_err, cvs_out, CvsAlert, MultiFiles::get, MultiFiles::next, NULL, and MultiFiles::NumFiles.

00044     {
00045         if( !CvsAlert("Are you sure you want to erase selected files?", "Yes", "No") )
00046         {
00047             return;
00048         }
00049
00050         while(mf->next())
00051         {
00052             int count = mf->NumFiles();
00053             for (int i = 0; i < count; i++)
00054             {
00055                 CStr path, fileName;
00056                 if (mf->get(i, path, fileName))
00057                 {
00058                     char fn[_MAX_PATH];
00059                     _makepath(fn, NULL, path, fileName, NULL);
00060                     if(!CompatMoveToTrash(fn))
00061                     {
00062                         cvs_err("Unable to remove '%s' (error %d)\n", fn, errno);
00063                     }
00064                     else
00065                     {
00066                         cvs_out("'%s' has been moved successfully to the recycle bin...\n", fn);
00067                     }
00068                 }
00069             }
00070         }
00071     }

virtual void KoMoveToTrashHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Implements KiSelectionHandler.

Definition at line 39 of file BrowseViewHandlers.h.

00040     { /* ignore */ }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoNameColumn Class Reference

Inheritance diagram for KoNameColumn:

[legend]
Collaboration diagram for KoNameColumn:

[legend]
List of all members.

Public Methods

virtual void | GetSetupData (LV_COLUMN *lvc) const
virtual void | GetText (KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const
virtual int | Compare (KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const
virtual bool | IsDefaultAscending () const

Member Function Documentation

virtual int KoNameColumn::Compare | ( | KoColumnContext * | ,
 |  | EntnodeData * | d1,
 |  | EntnodeData * | d2
 | ) | const [inline, virtual]

Implements KiColumn.

Definition at line 102 of file BrowseViewColumn.cpp.

References EntnodeData::GetName, and stricmp.

00103     {
00104         int res = stricmp(d1->GetName(), d2->GetName());
00105         return res;
00106     }

virtual void KoNameColumn::GetSetupData ( LV_COLUMN * lvc ) const [inline, virtual]

Implements KiColumn.

Definition at line 79 of file BrowseViewColumn.cpp.

00080     {
00081         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00082         lvc->pszText = _T("Name");
00083         lvc->cx = 150;
00084         lvc->fmt = LVCFMT_LEFT;
00085     }

virtual void KoNameColumn::GetText | ( | KoColumnContext * | ,
 |  | EntnodeData * | data,
 |  | char * | buffer,
 |  | int | bufferSize
 | ) | const [inline, virtual]

Implements KiColumn.

Definition at line 96 of file BrowseViewColumn.cpp.

References EntnodeData::GetName, and SafeCopy.

00097     {
00098         SafeCopy(buffer, data->GetName(), bufferSize);
00099     }

virtual bool KoNameColumn::IsDefaultAscending ( ) const [inline, virtual]

Implements KiColumn.

Definition at line 109 of file BrowseViewColumn.cpp.

00110     {
00111         return false;
00112     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Sun Feb 24 01:26:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoOptionColumn Class Reference

Inheritance diagram for KoOptionColumn:

[legend]
Collaboration diagram for KoOptionColumn:

[legend]
List of all members.

Public Methods

virtual void | GetSetupData (LV_COLUMN *lvc) const
virtual void | GetText (KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const
virtual int | Compare (KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const
virtual bool | IsDefaultAscending () const

Member Function Documentation

virtual int KoOptionColumn::Compare | ( | KoColumnContext * | ,
 |  | EntnodeData * | d1,
 |  | EntnodeData * | d2
 | ) | const [inline, virtual]

Implements KiColumn.

Definition at line 298 of file BrowseViewColumn.cpp.

References EntnodeFile::kOption.

00299     {
00300         const char *s1 = (*d1)[EntnodeFile::kOption];
00301         const char *s2 = (*d2)[EntnodeFile::kOption];
00302         int res;
00303         if(s1 != 0L && s2 != 0L)
00304             res = strcmp(s1, s2);
00305         else
00306             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00307         return res;
00308     }

virtual void KoOptionColumn::GetSetupData ( LV_COLUMN * lvc ) const [inline, virtual]

Implements KiColumn.

Definition at line 275 of file BrowseViewColumn.cpp.

00276     {
00277         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00278         lvc->pszText = _T("Option");
00279         lvc->cx = 50;
00280         lvc->fmt = LVCFMT_LEFT;
00281     }

virtual void KoOptionColumn::GetText | ( | KoColumnContext * | ,
 |  | EntnodeData * | data,
 |  | char * | buffer,
 |  | int | bufferSize
 | ) | const [inline, virtual]

Implements KiColumn.

Definition at line 292 of file BrowseViewColumn.cpp.

References EntnodeFile::kOption, and SafeCopy.

00293     {
00294         SafeCopy(buffer, (*data)[EntnodeFile::kOption], bufferSize);
00295     }

virtual bool KoOptionColumn::IsDefaultAscending ( ) const [inline, virtual]

Implements KiColumn.

Definition at line 311 of file BrowseViewColumn.cpp.

00312     {
00313         return true;
00314     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Sun Feb 24 01:26:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoPathColumn Class Reference

Inheritance diagram for KoPathColumn:

[legend]
Collaboration diagram for KoPathColumn:

[legend]
List of all members.

Public Methods

virtual void | GetSetupData (LV_COLUMN *lvc) const
virtual void | GetText (KoColumnContext *context, EntnodeData *data, char *buffer, int bufferSize) const
virtual int | Compare (KoColumnContext *context, EntnodeData *d1, EntnodeData *d2) const
virtual bool | IsDefaultAscending () const

Member Function Documentation

virtual int KoPathColumn::Compare | ( | KoColumnContext * | context,
 |  | EntnodeData * | d1,
 |  | EntnodeData * | d2
 | ) | const [inline, virtual]

Implements KiColumn.

Definition at line 167 of file BrowseViewColumn.cpp.

References GetText, and stricmp.

00168     {
00169         char text1[256];
00170         GetText(context, d1, text1, 256);
00171         char text2[256];
00172         GetText(context, d2, text2, 256);
00173         int res = stricmp(text1, text2);
00174         return res;
00175     }

virtual void KoPathColumn::GetSetupData ( LV_COLUMN * lvc ) const [inline, virtual]

Implements KiColumn.

Definition at line 122 of file BrowseViewColumn.cpp.

00123     {
00124         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00125         lvc->pszText = _T("Path");
00126         lvc->cx = 150;
00127         lvc->fmt = LVCFMT_LEFT;
00128     }

virtual void KoPathColumn::GetText | ( | KoColumnContext * | context,
 |  | EntnodeData * | data,
 |  | char * | buffer,
 |  | int | bufferSize
 | ) | const [inline, virtual]

Implements KiColumn.

Definition at line 139 of file BrowseViewColumn.cpp.

References EntnodeData::GetFullPathName, EntnodeData::GetName, UStr::length, KoColumnContext::m_path, and SafeCopy.

Referenced by Compare.

00140     {
00141         UStr buf;
00142         const char *fullpath = data->GetFullPathName(buf);
00143         int len = context->m_path.length();
00144         fullpath += len;
00145         if (*fullpath == '\\')
00146         {
00147             fullpath++;
00148         }
00149         SafeCopy(buffer, fullpath, bufferSize);
00150         const char *name = data->GetName();
00151         if (name)
00152         {
00153             int lenName = strlen(name) + 1;
00154             int lenPath = strlen(buffer);
00155             if (lenPath <= lenName)
00156             {
00157                 strncpy(buffer, ".", bufferSize);
00158             }
00159             else
00160             {
00161                 buffer[lenPath - lenName] = 0;
00162             }
00163         }
00164     }

virtual bool KoPathColumn::IsDefaultAscending ( ) const [inline, virtual]

Implements KiColumn.

Definition at line 178 of file BrowseViewColumn.cpp.

00179     {
00180         return false;
00181     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Sun Feb 24 01:26:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoQueryUpdateHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoQueryUpdateHandler:

[legend]
Collaboration diagram for KoQueryUpdateHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoQueryUpdateHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 444 of file BrowseViewHandlers.h.

References CvsCmdUpdateFiles.

00445     {
00446         CvsCmdUpdateFiles(pmf, true);
00447     }

virtual void KoQueryUpdateHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 439 of file BrowseViewHandlers.h.

References CvsCmdUpdateFolder.

00440     {
00441         CvsCmdUpdateFolder(fullpath, true);
00442     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoRecursionModel Class Reference

#include <BrowseViewModel.h>

Inheritance diagram for KoRecursionModel:

[legend]
Collaboration diagram for KoRecursionModel:

[legend]
List of all members.

Public Methods

KoRecursionModel ()
~KoRecursionModel ()
virtual bool | IsShowRecursive ()
virtual NotificationManager * | GetNotificationManager ()
void | ToggleRecursion ()

Private Attributes

NotificationManager m_manager
bool | m_isRecursive

Constructor & Destructor Documentation

KoRecursionModel::KoRecursionModel ( )

Definition at line 195 of file BrowseViewModel.cpp.

00196 : m_isRecursive(persistentRecursive)
00197 {}

KoRecursionModel::~KoRecursionModel ( )

Definition at line 199 of file BrowseViewModel.cpp.

References m_isRecursive.

00200 {
00201     persistentRecursive = m_isRecursive;
00202 }

Member Function Documentation

NotificationManager * KoRecursionModel::GetNotificationManager ( ) [virtual]

Implements KiRecursionModel.

Definition at line 209 of file BrowseViewModel.cpp.

References m_manager.

Referenced by CMainFrame::OnViewRecursive.

00210 {
00211     return &m_manager;
00212 }

bool KoRecursionModel::IsShowRecursive ( ) [virtual]

Implements KiRecursionModel.

Definition at line 204 of file BrowseViewModel.cpp.

References m_isRecursive.

Referenced by CMainFrame::OnUpdateViewRecursive.

00205 {
00206     return m_isRecursive;
00207 }

void KoRecursionModel::ToggleRecursion ( )

Definition at line 214 of file BrowseViewModel.cpp.

References m_isRecursive.

Referenced by CMainFrame::OnViewRecursive.

00215 {
00216     m_isRecursive = !m_isRecursive;
00217 };

Member Data Documentation

bool KoRecursionModel::m_isRecursive [private]

Definition at line 279 of file BrowseViewModel.h.

Referenced by IsShowRecursive, ToggleRecursion, and ~KoRecursionModel.

NotificationManager KoRecursionModel::m_manager [private]

Definition at line 276 of file BrowseViewModel.h.

Referenced by GetNotificationManager.

The documentation for this class was generated from the following files:
  • common/BrowseViewModel.h
  • common/BrowseViewModel.cpp
Generated on Sun Feb 24 01:26:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoRecursiveModel Class Reference

Inheritance diagram for KoRecursiveModel:

[legend]
Collaboration diagram for KoRecursiveModel:

[legend]
List of all members.

Public Methods

virtual const KiColumn * | GetAt (int pos) const
virtual int | GetType (int pos) const
virtual int | GetCount () const

Member Function Documentation

virtual const KiColumn* KoRecursiveModel::GetAt ( int pos ) const [inline, virtual]

Implements KiColumnModel.

Definition at line 567 of file BrowseViewColumn.cpp.

00568     {
00569         return columnsRecursive[pos];
00570     }

virtual int KoRecursiveModel::GetCount ( ) const [inline, virtual]

Implements KiColumnModel.

Definition at line 579 of file BrowseViewColumn.cpp.

References _countof.

00580     {
00581         return _countof(columnsRecursive);
00582     }

virtual int KoRecursiveModel::GetType ( int pos ) const [inline, virtual]

Implements KiColumnModel.

Definition at line 573 of file BrowseViewColumn.cpp.

References typesRecursive.

00574     {
00575         return typesRecursive[pos];
00576     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Sun Feb 24 01:26:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoRegularModel Class Reference

Inheritance diagram for KoRegularModel:

[legend]
Collaboration diagram for KoRegularModel:

[legend]
List of all members.

Public Methods

virtual const KiColumn * | GetAt (int pos) const
virtual int | GetType (int pos) const
virtual int | GetCount () const

Member Function Documentation

virtual const KiColumn* KoRegularModel::GetAt ( int pos ) const [inline, virtual]

Implements KiColumnModel.

Definition at line 543 of file BrowseViewColumn.cpp.

00544     {
00545         return columnsRegular[pos];
00546     }

virtual int KoRegularModel::GetCount ( ) const [inline, virtual]

Implements KiColumnModel.

Definition at line 555 of file BrowseViewColumn.cpp.

References _countof.

00556     {
00557         return _countof(columnsRegular);
00558     }

virtual int KoRegularModel::GetType ( int pos ) const [inline, virtual]

Implements KiColumnModel.

Definition at line 549 of file BrowseViewColumn.cpp.

References typesRegular.

00550     {
00551         return typesRegular[pos];
00552     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Sun Feb 24 01:26:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoReleaseHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoReleaseHandler:

[legend]
Collaboration diagram for KoReleaseHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *)

Member Function Documentation

virtual void KoReleaseHandler::OnFiles ( MultiFiles * ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 210 of file BrowseViewHandlers.h.

00211     {   }

virtual void KoReleaseHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 205 of file BrowseViewHandlers.h.

References CvsCmdReleaseFolder.

00206     {
00207         CvsCmdReleaseFolder(fullpath);
00208     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoReservedEditHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoReservedEditHandler:

[legend]
Collaboration diagram for KoReservedEditHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoReservedEditHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 168 of file BrowseViewHandlers.h.

References CvsCmdEditFiles, and kEditReserved.

00169     {
00170         CvsCmdEditFiles(pmf, kEditReserved);
00171     }

virtual void KoReservedEditHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 163 of file BrowseViewHandlers.h.

References CvsCmdEditFolder, and kEditReserved.

00164     {
00165         CvsCmdEditFolder(fullpath, kEditReserved);
00166     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoRevisionColumn Class Reference

Inheritance diagram for KoRevisionColumn:

[legend]
Collaboration diagram for KoRevisionColumn:

[legend]
List of all members.

Public Methods

virtual void | GetSetupData (LV_COLUMN *lvc) const
virtual void | GetText (KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const
virtual int | Compare (KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const
virtual bool | IsDefaultAscending () const

Static Public Methods

int | revcmp (const char *rev1, const char *rev2)

Member Function Documentation

virtual int KoRevisionColumn::Compare | ( | KoColumnContext * | ,
 |  | EntnodeData * | d1,
 |  | EntnodeData * | d2
 | ) | const [inline, virtual]

Implements KiColumn.

Definition at line 215 of file BrowseViewColumn.cpp.

References EntnodeFile::kVN, and revcmp.

00216     {
00217         const char *s1 = (*d1)[EntnodeFile::kVN];
00218         const char *s2 = (*d2)[EntnodeFile::kVN];
00219         int res;
00220         if(s1 != 0L && s2 != 0L)
00221             res = revcmp(s1, s2);
00222         else
00223             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00224         return res;
00225     }

virtual void KoRevisionColumn::GetSetupData ( LV_COLUMN * lvc ) const [inline, virtual]

Implements KiColumn.

Definition at line 192 of file BrowseViewColumn.cpp.

00193     {
00194         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00195         lvc->pszText = _T("Rev.");
00196         lvc->cx = 50;
00197         lvc->fmt = LVCFMT_LEFT;
00198     }

virtual void KoRevisionColumn::GetText | ( | KoColumnContext * | ,
 |  | EntnodeData * | data,
 |  | char * | buffer,
 |  | int | bufferSize
 | ) | const [inline, virtual]

Implements KiColumn.

Definition at line 209 of file BrowseViewColumn.cpp.

References EntnodeFile::kVN, and SafeCopy.

00210     {
00211         SafeCopy(buffer, (*data)[EntnodeFile::kVN], bufferSize);
00212     }

virtual bool KoRevisionColumn::IsDefaultAscending ( ) const [inline, virtual]

Implements KiColumn.

Definition at line 262 of file BrowseViewColumn.cpp.

00263     {
00264         return true;
00265     }

int KoRevisionColumn::revcmp | ( | const char * | rev1,
 |  | const char * | rev2
 | ) | [inline, static]

Definition at line 228 of file BrowseViewColumn.cpp.

References CStr.

Referenced by Compare.

00229     {
00230         if(rev1 == 0L && rev2 == 0L)
00231             return 0;
00232         else if(rev1 == 0L || rev2 == 0L)
00233             return rev1 == 0L ? -1 : 1;
00234
00235         CStr r1(rev1), r2(rev2);
00236         CStr q1, q2;
00237         char *tmp;
00238         int v1, v2;
00239
00240         if((tmp = strchr(r1, '.')) != 0L)
00241         {
00242             tmp[0] = '\0';
00243             q1 = tmp + 1;
00244         }
00245
00246         v1 = atoi(r1);
00247
00248         if((tmp = strchr(r2, '.')) != 0L)
00249         {
00250             tmp[0] = '\0';
00251             q2 = tmp + 1;
00252         }
00253         v2 = atoi(r2);
00254
00255         if(v1 == v2)
00256             return revcmp(q1.empty() ? (char *)0L : q1, q2.empty() ? (char *)0L : q2);
00257
00258         return v1 < v2 ? -1 : 1;
00259     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Sun Feb 24 01:26:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoStatusColumn Class Reference

Inheritance diagram for KoStatusColumn:

[legend]
Collaboration diagram for KoStatusColumn:

[legend]
List of all members.

Public Methods

virtual void | GetSetupData (LV_COLUMN *lvc) const
virtual void | GetText (KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const
virtual int | Compare (KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const
virtual bool | IsDefaultAscending () const

Member Function Documentation

virtual int KoStatusColumn::Compare | ( | KoColumnContext * | ,
 |  | EntnodeData * | d1,
 |  | EntnodeData * | d2
 | ) | const [inline, virtual]

Implements KiColumn.

Definition at line 347 of file BrowseViewColumn.cpp.

References EntnodeData::kStatus, and stricmp.

00348     {
00349         int res = stricmp((*d1)[EntnodeData::kStatus], (*d2)[EntnodeData::kStatus]);
00350         return res;
00351     }

virtual void KoStatusColumn::GetSetupData ( LV_COLUMN * lvc ) const [inline, virtual]

Implements KiColumn.

Definition at line 324 of file BrowseViewColumn.cpp.

00325     {
00326         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00327         lvc->pszText = _T("Status");
00328         lvc->cx = 100;
00329         lvc->fmt = LVCFMT_LEFT;
00330     }

virtual void KoStatusColumn::GetText | ( | KoColumnContext * | ,
 |  | EntnodeData * | data,
 |  | char * | buffer,
 |  | int | bufferSize
 | ) | const [inline, virtual]

Implements KiColumn.

Definition at line 341 of file BrowseViewColumn.cpp.

References EntnodeData::kStatus, and SafeCopy.

00342     {
00343         SafeCopy(buffer, (*data)[EntnodeData::kStatus], bufferSize);
00344     }

virtual bool KoStatusColumn::IsDefaultAscending ( ) const [inline, virtual]

Implements KiColumn.

Definition at line 354 of file BrowseViewColumn.cpp.

00355     {
00356         return true;
00357     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Sun Feb 24 01:26:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoStatusHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoStatusHandler:

[legend]
Collaboration diagram for KoStatusHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoStatusHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 320 of file BrowseViewHandlers.h.

References CvsCmdStatusFiles.

00321     {
00322         CvsCmdStatusFiles(pmf);
00323     }

virtual void KoStatusHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 315 of file BrowseViewHandlers.h.

References CvsCmdStatusFolder.

00316     {
00317         CvsCmdStatusFolder(fullpath);
00318     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoTagColumn Class Reference

Inheritance diagram for KoTagColumn:

[legend]
Collaboration diagram for KoTagColumn:

[legend]
List of all members.

Public Methods

virtual void | GetSetupData (LV_COLUMN *lvc) const
virtual void | GetText (KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const
virtual int | Compare (KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const
virtual bool | IsDefaultAscending () const

Member Function Documentation

virtual int KoTagColumn::Compare | ( | KoColumnContext * | ,
 |  | EntnodeData * | d1,
 |  | EntnodeData * | d2
 | ) | const [inline, virtual]

Implements KiColumn.

Definition at line 390 of file BrowseViewColumn.cpp.

References EntnodeFile::kTag.

00391     {
00392         const char *s1 = (*d1)[EntnodeFile::kTag];
00393         const char *s2 = (*d2)[EntnodeFile::kTag];
00394         int res;
00395         if(s1 != 0L && s2 != 0L)
00396             res = strcmp(s1, s2);
00397         else
00398             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00399         return res;
00400
00401     }

virtual void KoTagColumn::GetSetupData ( LV_COLUMN * lvc ) const [inline, virtual]

Implements KiColumn.

Definition at line 367 of file BrowseViewColumn.cpp.

00368     {
00369         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00370         lvc->pszText = _T("Tag");
00371         lvc->cx = 150;
00372         lvc->fmt = LVCFMT_LEFT;
00373     }

virtual void KoTagColumn::GetText | ( | KoColumnContext * | ,
 |  | EntnodeData * | data,
 |  | char * | buffer,
 |  | int | bufferSize
 | ) | const [inline, virtual]

Implements KiColumn.

Definition at line 384 of file BrowseViewColumn.cpp.

References EntnodeFile::kTag, and SafeCopy.

00385     {
00386         SafeCopy(buffer, (*data)[EntnodeFile::kTag], bufferSize);
00387     }

virtual bool KoTagColumn::IsDefaultAscending ( ) const [inline, virtual]

Implements KiColumn.

Definition at line 404 of file BrowseViewColumn.cpp.

00405     {
00406         return true;
00407     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Sun Feb 24 01:26:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoTraversalContext Class Reference

Collaboration diagram for KoTraversalContext:

[legend]
List of all members.

Public Methods

KoTraversalContext (CBrowseFileView *view)
bool | IsRecursive () const
bool | IsShowIgnored () const
bool | IsMatch (EntnodeData *data) const

Public Attributes

CBrowseFileView * m_view

Private Attributes

bool | m_isRecursive
bool | m_isShowIgnored
KiFilterModel * m_filter

Constructor & Destructor Documentation

KoTraversalContext::KoTraversalContext ( CBrowseFileView * view ) [inline]

Definition at line 184 of file BrowseFileView.cpp.

References CWincvsApp::GetFilterModel, CWincvsApp::GetIgnoreModel, CWincvsApp::GetRecursionModel, KiIgnoreModel::IsShowIgnored, KiRecursionModel::IsShowRecursive, m_isRecursive, m_isShowIgnored, and NULL.

00185     : m_view(view), m_filter(NULL), m_isRecursive(false), m_isShowIgnored(false)
00186     {
00187         if (CWincvsApp* app = (CWincvsApp *)AfxGetApp())
00188         {
00189             m_filter = app->GetFilterModel();
00190             m_isRecursive = app->GetRecursionModel()->IsShowRecursive();
00191             m_isShowIgnored = app->GetIgnoreModel()->IsShowIgnored();
00192         }
00193     }

Member Function Documentation

bool KoTraversalContext::IsMatch ( EntnodeData * data ) const [inline]

Definition at line 205 of file BrowseFileView.cpp.

References KiFilterModel::IsMatch.

Referenced by TViewFill::ExitDirectory, and TViewFill::OnFile.

00206     {
00207         return m_filter->IsMatch(data);
00208     }

bool KoTraversalContext::IsRecursive ( ) const [inline]

Definition at line 195 of file BrowseFileView.cpp.

References m_isRecursive.

Referenced by TViewFill::IsRecursive, CBrowseFileView::OnInitialUpdate, and CBrowseFileView::ResetView.

00196     {
00197         return m_isRecursive;
00198     }

bool KoTraversalContext::IsShowIgnored ( ) const [inline]

Definition at line 200 of file BrowseFileView.cpp.

References m_isShowIgnored.

Referenced by TViewFill::IsShowIgnored.

00201     {
00202         return m_isShowIgnored;
00203     }

Member Data Documentation

KiFilterModel* KoTraversalContext::m_filter [private]

Definition at line 178 of file BrowseFileView.cpp.

bool KoTraversalContext::m_isRecursive [private]

Definition at line 176 of file BrowseFileView.cpp.

Referenced by IsRecursive, and KoTraversalContext.

bool KoTraversalContext::m_isShowIgnored [private]

Definition at line 177 of file BrowseFileView.cpp.

Referenced by IsShowIgnored, and KoTraversalContext.

CBrowseFileView* KoTraversalContext::m_view

Definition at line 181 of file BrowseFileView.cpp.

Referenced by TViewFill::GetView.

The documentation for this class was generated from the following file:
  • WinCvs/BrowseFileView.cpp
Generated on Sun Feb 24 01:26:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoUneditHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoUneditHandler:

[legend]
Collaboration diagram for KoUneditHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoUneditHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 196 of file BrowseViewHandlers.h.

References CvsCmdUneditFiles.

00197     {
00198         CvsCmdUneditFiles(pmf);
00199     }

virtual void KoUneditHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 191 of file BrowseViewHandlers.h.

References CvsCmdUneditFolder.

00192     {
00193         CvsCmdUneditFolder(fullpath);
00194     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoUnlockHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoUnlockHandler:

[legend]
Collaboration diagram for KoUnlockHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoUnlockHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 360 of file BrowseViewHandlers.h.

References CvsCmdUnlockFiles.

00361     {
00362         CvsCmdUnlockFiles(pmf);
00363     }

virtual void KoUnlockHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 355 of file BrowseViewHandlers.h.

References CvsCmdUnlockFolder.

00356     {
00357         CvsCmdUnlockFolder(fullpath);
00358     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoUpdateHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoUpdateHandler:

[legend]
Collaboration diagram for KoUpdateHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoUpdateHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 430 of file BrowseViewHandlers.h.

References CvsCmdUpdateFiles.

00431     {
00432         CvsCmdUpdateFiles(pmf);
00433     }

virtual void KoUpdateHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 425 of file BrowseViewHandlers.h.

References CvsCmdUpdateFolder.

00426     {
00427         CvsCmdUpdateFolder(fullpath);
00428     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoUpdateMoveToTrashHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoUpdateMoveToTrashHandler:

[legend]
Collaboration diagram for KoUpdateMoveToTrashHandler:

[legend]
List of all members.

Public Methods

KoUpdateMoveToTrashHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *)
bool | IsEnabled () const

Private Attributes

bool | m_isFolders
bool | m_isFiles

Constructor & Destructor Documentation

KoUpdateMoveToTrashHandler::KoUpdateMoveToTrashHandler ( ) [inline]

Definition at line 82 of file BrowseViewHandlers.h.

References m_isFiles, and m_isFolders.

00083     : m_isFolders(false), m_isFiles(false)
00084     {}

Member Function Documentation

bool KoUpdateMoveToTrashHandler::IsEnabled ( ) const [inline]

Definition at line 97 of file BrowseViewHandlers.h.

References m_isFiles, and m_isFolders.

Referenced by CBrowseFileView::OnUpdateViewTrash.

00098     {
00099         return !m_isFolders && m_isFiles;
00100     }

virtual void KoUpdateMoveToTrashHandler::OnFiles ( MultiFiles * ) [inline, virtual]

Implements KiSelectionHandler.

Definition at line 92 of file BrowseViewHandlers.h.

References m_isFiles.

00093     {
00094         m_isFiles = true;
00095     }

virtual void KoUpdateMoveToTrashHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Implements KiSelectionHandler.

Definition at line 86 of file BrowseViewHandlers.h.

References m_isFolders.

00087     {
00088         m_isFolders = true;
00089     }

Member Data Documentation

bool KoUpdateMoveToTrashHandler::m_isFiles [private]

Definition at line 79 of file BrowseViewHandlers.h.

Referenced by IsEnabled, KoUpdateMoveToTrashHandler, and OnFiles.

bool KoUpdateMoveToTrashHandler::m_isFolders [private]

Definition at line 79 of file BrowseViewHandlers.h.

Referenced by IsEnabled, KoUpdateMoveToTrashHandler, and OnFolder.

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoWatcher Class Reference

#include <FileViewWatcher.h>

Collaboration diagram for KoWatcher:

[legend]
List of all members.

Public Types

enum | { WM_FILECHANGE = WM_APP + 51 }

Public Methods

KoWatcher (HWND hWnd)
void | SignalStartWatch (LPCTSTR path, bool isRecursive)
void | SignalTerminate ()

Private Methods

~KoWatcher ()
UINT | Run ()
bool | StartWatch ()
void | StopWatch ()

Static Private Methods

UINT | DelegateRun (LPVOID p)

Private Attributes

CEvent | m_eventStartWatching
CEvent | m_eventTerminate
CCriticalSection | m_section
TCHAR | m_path [_MAX_PATH]
bool | m_isRecursive
HWND | m_hWnd
HANDLE | m_handles [3]
DWORD | m_count

Member Enumeration Documentation

anonymous enum

Enumeration values:
WM_FILECHANGE

Definition at line 61 of file FileViewWatcher.h.

00062     {
00063         WM_FILECHANGE = WM_APP + 51,
00064         // private message for delivering file change notification
00065     };

Constructor & Destructor Documentation

KoWatcher::KoWatcher ( HWND hWnd ) [inline]

Definition at line 70 of file FileViewWatcher.h.

References DelegateRun, m_count, m_eventStartWatching, m_eventTerminate, m_handles, m_hWnd, m_isRecursive, and m_path.

00071     : m_isRecursive(false)
00072     , m_hWnd(hWnd)
00073     {
00074         m_handles[0] = m_eventStartWatching;
00075         m_handles[1] = m_eventTerminate;
00076         m_count = 2;
00077         *m_path = 0;
00078
00079         // start the thread immediately
00080         AfxBeginThread(DelegateRun, this);
00081     }

KoWatcher::~KoWatcher ( ) [inline, private]

Definition at line 85 of file FileViewWatcher.h.

00086     {}

Member Function Documentation

UINT KoWatcher::DelegateRun ( LPVOID p ) [inline, static, private]

Definition at line 110 of file FileViewWatcher.h.

References Run.

Referenced by KoWatcher.

00111     {
00112         KoWatcher* watcher = (KoWatcher*)p;
00113         return watcher->Run();
00114     }

UINT KoWatcher::Run ( ) [private]

Definition at line 35 of file FileViewWatcher.cpp.

References FALSE, m_count, m_eventStartWatching, m_handles, m_hWnd, CWincvsApp::m_isBackgroundProcess, StartWatch, StopWatch, and WM_FILECHANGE.

Referenced by DelegateRun.

00036 {
00037     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00038
00039     for(;;)
00040     {
00041         // if a lot of changes happen suddenly in the folder, we
00042         // don't want WinCvs to die under the WM_FILECHANGE message,
00043         // so we need to slow down a bit.
00044         Sleep(app->m_isBackgroundProcess ? 2000 : 200);
00045
00046         DWORD dw = WaitForMultipleObjects(m_count, m_handles, FALSE, INFINITE);
00047         switch (dw)
00048         {
00049             case WAIT_OBJECT_0 :
00050             {
00051                 // process signal to start watching
00052                 StopWatch();
00053                 StartWatch();
00054                 m_eventStartWatching.Unlock();
00055                 break;
00056             }
00057             case WAIT_OBJECT_0 + 1 :
00058             {
00059                 // process signal to terminate
00060                 StopWatch();
00061                 delete this;
00062                 return 0;
00063             }
00064             case WAIT_OBJECT_0 + 2 :
00065             {
00066                 // process file change signal
00067                 StopWatch();
00068                 PostMessage(m_hWnd, WM_FILECHANGE, 0, 0);
00069                 break;
00070             }
00071
00072         }
00073     }
00074     return 0;
00075 }

void KoWatcher::SignalStartWatch | ( | LPCTSTR | path,
 |  | bool | isRecursive
 | ) | [inline]

Definition at line 91 of file FileViewWatcher.h.

References m_eventStartWatching, m_isRecursive, m_path, and m_section.

Referenced by CBrowseFileView::ResetView.

00092     {
00093         // store parameters
00094         m_section.Lock();
00095         _tcscpy(m_path, path);
00096         m_isRecursive = isRecursive;
00097         m_section.Unlock();
00098         m_eventStartWatching.SetEvent();
00099     }

void KoWatcher::SignalTerminate ( ) [inline]

Definition at line 102 of file FileViewWatcher.h.

References m_eventTerminate.

Referenced by CBrowseFileView::OnDestroy.

00103     {
00104         m_eventTerminate.SetEvent();
00105     }

bool KoWatcher::StartWatch ( ) [private]

Definition at line 77 of file FileViewWatcher.cpp.

References m_count, m_handles, m_isRecursive, m_path, and m_section.

Referenced by Run.

00078 {
00079     // retrieve parameters first
00080     TCHAR path[_MAX_PATH];
00081     bool isRecursive;
00082     m_section.Lock();
00083     lstrcpyn(path, m_path, _MAX_PATH);
00084     isRecursive = m_isRecursive;
00085     m_section.Unlock();
00086
00087     // start watching
00088     HANDLE h =  FindFirstChangeNotification(
00089                     path,
00090                     isRecursive,
00091                     FILE_NOTIFY_CHANGE_FILE_NAME |
00092                     FILE_NOTIFY_CHANGE_DIR_NAME |
00093                     //FILE_NOTIFY_CHANGE_SIZE |
00094                     FILE_NOTIFY_CHANGE_LAST_WRITE |
00095                     //FILE_NOTIFY_CHANGE_LAST_ACCESS |
00096 #if _MSC_VER >= 1200
00097                     //FILE_NOTIFY_CHANGE_CREATION | (makes Win98 fails)
00098 #endif
00099                     //FILE_NOTIFY_CHANGE_SECURITY |
00100                     FILE_NOTIFY_CHANGE_ATTRIBUTES
00101                 );
00102     if (h != INVALID_HANDLE_VALUE)
00103     {
00104         m_handles[2] = h;
00105         m_count = 3;
00106     }
00107     return m_count == 3;
00108 }

void KoWatcher::StopWatch ( ) [private]

Definition at line 111 of file FileViewWatcher.cpp.

References m_count, and m_handles.

Referenced by Run.

00112 {
00113     if (m_count == 3 && m_handles[2] != INVALID_HANDLE_VALUE)
00114     {
00115         // reset and close the handle
00116         FindNextChangeNotification(m_handles[2]);
00117         FindCloseChangeNotification(m_handles[2]);
00118         m_handles[2] = INVALID_HANDLE_VALUE;
00119         m_count = 2;
00120     }
00121 }

Member Data Documentation

DWORD KoWatcher::m_count [private]

Definition at line 56 of file FileViewWatcher.h.

Referenced by KoWatcher, Run, StartWatch, and StopWatch.

CEvent KoWatcher::m_eventStartWatching [private]

Definition at line 35 of file FileViewWatcher.h.

Referenced by KoWatcher, Run, and SignalStartWatch.

CEvent KoWatcher::m_eventTerminate [private]

Definition at line 38 of file FileViewWatcher.h.

Referenced by KoWatcher, and SignalTerminate.

HANDLE KoWatcher::m_handles[3] [private]

Definition at line 53 of file FileViewWatcher.h.

Referenced by KoWatcher, Run, StartWatch, and StopWatch.

HWND KoWatcher::m_hWnd [private]

Definition at line 50 of file FileViewWatcher.h.

Referenced by KoWatcher, and Run.

bool KoWatcher::m_isRecursive [private]

Definition at line 47 of file FileViewWatcher.h.

Referenced by KoWatcher, SignalStartWatch, and StartWatch.

TCHAR KoWatcher::m_path[_MAX_PATH] [private]

Definition at line 44 of file FileViewWatcher.h.

Referenced by KoWatcher, SignalStartWatch, and StartWatch.

CCriticalSection KoWatcher::m_section [private]

Definition at line 41 of file FileViewWatcher.h.

Referenced by SignalStartWatch, and StartWatch.

The documentation for this class was generated from the following files:
  • WinCvs/FileViewWatcher.h
  • WinCvs/FileViewWatcher.cpp
Generated on Sun Feb 24 01:26:38 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoWatchersHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoWatchersHandler:

[legend]
Collaboration diagram for KoWatchersHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoWatchersHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 222 of file BrowseViewHandlers.h.

References CvsCmdWatchersFiles.

00223     {
00224         CvsCmdWatchersFiles(pmf);
00225     }

virtual void KoWatchersHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 217 of file BrowseViewHandlers.h.

References CvsCmdWatchersFolder.

00218     {
00219         CvsCmdWatchersFolder(fullpath);
00220     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:38 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoWatchOffHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoWatchOffHandler:

[legend]
Collaboration diagram for KoWatchOffHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoWatchOffHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 264 of file BrowseViewHandlers.h.

References CvsCmdWatchOffFiles.

00265     {
00266         CvsCmdWatchOffFiles(pmf);
00267     }

virtual void KoWatchOffHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 259 of file BrowseViewHandlers.h.

References CvsCmdWatchOffFolder.

00260     {
00261         CvsCmdWatchOffFolder(fullpath);
00262     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


KoWatchOnHandler Class Reference

#include <BrowseViewHandlers.h>

Inheritance diagram for KoWatchOnHandler:

[legend]
Collaboration diagram for KoWatchOnHandler:

[legend]
List of all members.

Private Methods

virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Member Function Documentation

virtual void KoWatchOnHandler::OnFiles ( MultiFiles * pmf ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 250 of file BrowseViewHandlers.h.

References CvsCmdWatchOnFiles.

00251     {
00252         CvsCmdWatchOnFiles(pmf);
00253     }

virtual void KoWatchOnHandler::OnFolder ( const char * fullpath ) [inline, private, virtual]

Implements KiSelectionHandler.

Definition at line 245 of file BrowseViewHandlers.h.

References CvsCmdWatchOnFolder.

00246     {
00247         CvsCmdWatchOnFolder(fullpath);
00248     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Sun Feb 24 01:26:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LAttachment Class Reference

Inheritance diagram for LAttachment:

[legend]
The documentation for this class was generated from the following file:
  • rf/support/powerplant/UPseudoSupport.cpp
Generated on Sun Feb 24 01:26:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LBevelButton Class Reference

Inheritance diagram for LBevelButton:

[legend]
The documentation for this class was generated from the following file:
  • rf/support/powerplant/UPseudoSupport.h
Generated on Sun Feb 24 01:26:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LCommander Class Reference

Inheritance diagram for LCommander:

[legend]
The documentation for this class was generated from the following file:
  • common/MacBinEncoding.h
Generated on Sun Feb 24 01:26:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ULIST_INFO Struct Reference

#include <umain.h>

Collaboration diagram for ULIST_INFO:

[legend]
List of all members.

Public Attributes

int | row
int | col
const char * | title
void * | data

Member Data Documentation

int ULIST_INFO::col

Definition at line 963 of file umain.h.

Referenced by UWidget::OnListGetInfo, and UCvsFiles::Search.

void* ULIST_INFO::data

Definition at line 965 of file umain.h.

Referenced by UWidget::OnListGetInfo.

int ULIST_INFO::row

Definition at line 963 of file umain.h.

Referenced by UWidget::OnListGetInfo, and UCvsFiles::Search.

const char* ULIST_INFO::title

Definition at line 964 of file umain.h.

Referenced by UWidget::OnListGetInfo, and UCvsFiles::Search.

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Sun Feb 24 01:26:40 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ULIST_INSERT Struct Reference

#include <umain.h>

Collaboration diagram for ULIST_INSERT:

[legend]
List of all members.

Public Attributes

int | row
int | col
const char * | title
void * | icon

Member Data Documentation

int ULIST_INSERT::col

Definition at line 954 of file umain.h.

Referenced by TViewFill::OnDirectory, TViewFill::OnFile, UWidget::OnListInsert, and UCvsFiles::ResetView.

void* ULIST_INSERT::icon

Definition at line 956 of file umain.h.

Referenced by TViewFill::OnDirectory, TViewFill::OnFile, UWidget::OnListInsert, and UCvsFiles::ResetView.

int ULIST_INSERT::row

Definition at line 954 of file umain.h.

Referenced by TViewFill::OnDirectory, TViewFill::OnFile, UWidget::OnListInsert, and UCvsFiles::ResetView.

const char* ULIST_INSERT::title

Definition at line 955 of file umain.h.

Referenced by TViewFill::OnDirectory, TViewFill::OnFile, UWidget::OnListInsert, and UCvsFiles::ResetView.

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Sun Feb 24 01:26:40 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CListBox Class Reference

Inheritance diagram for CListBox:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJListBox.h
Generated on Sun Feb 24 01:26:40 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CListCtrl Class Reference

Inheritance diagram for CListCtrl:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJListCtrl.h
Generated on Sun Feb 24 01:26:40 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CListView Class Reference

Inheritance diagram for CListView:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/BrowseFileView.h
Generated on Sun Feb 24 01:26:40 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LListener Class Reference

Inheritance diagram for LListener:

[legend]
The documentation for this class was generated from the following file:
  • rf/support/powerplant/UPseudoSupport.h
Generated on Sun Feb 24 01:26:40 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LMainPseudoAttachment Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for LMainPseudoAttachment:

[legend]
Collaboration diagram for LMainPseudoAttachment:

[legend]
List of all members.

Public Methods

LMainPseudoAttachment ()
virtual | ~LMainPseudoAttachment ()
virtual void | SpendTime (const EventRecord &inMacEvent)

Protected Methods

virtual void | ExecuteSelf (MessageT inMessage, void *ioParam)

Constructor & Destructor Documentation

LMainPseudoAttachment::LMainPseudoAttachment ( )

Definition at line 302 of file UPseudoSupport.cpp.

00302                                              : LAttachment(msg_AnyMessage)
00303 {
00304     StartIdling();
00305 }

LMainPseudoAttachment::~LMainPseudoAttachment ( ) [virtual]

Definition at line 307 of file UPseudoSupport.cpp.

00308 {
00309 }

Member Function Documentation

void LMainPseudoAttachment::ExecuteSelf | ( | MessageT | inMessage,
 |  | void * | ioParam
 | ) | [protected, virtual]

Definition at line 316 of file UPseudoSupport.cpp.

References UCmdUI::CanContinue, UWidget::DoValidUI, EV_CMD, EV_COMMAND_START, EV_UPDATEFOCUS, EV_UPDTCMD, UWidget::GetFocus, UCmdUI::m_nID, NEW, UPseudoCmdStatusWrapper::outEnabled, UPseudoCmdStatusWrapper::outMark, UPseudoCmdStatusWrapper::outName, UPseudoCmdStatusWrapper::outUsesMark, UPPMenu::sPPMenuWidID, STD, UEventGetTargets, UEventNotifyMessage, UEventSendMessage, and UEventSendMessageExt.

00317 {
00318     SetExecuteHost(true);
00319
00320     if(UPPMenu::sPPMenuWidID == -1)
00321     {
00322         NEW UPPMenu();
00323     }
00324
00325     if((inMessage > 0 && inMessage < 800) || inMessage >= EV_COMMAND_START)
00326     {
00327         int handledFlag;
00328         int res = UEventSendMessageExt(UPPMenu::sPPMenuWidID, EV_CMD,
00329             inMessage, 0L, &handledFlag);
00330         if(res == 0 && handledFlag)
00331         {
00332             SetExecuteHost(false);
00333             return;
00334         }
00335         else
00336             SetExecuteHost(true);
00337     }
00338
00339     switch (inMessage)
00340     {
00341         case msg_CommandStatus:
00342         {
00343             SCommandStatus *status = static_cast<SCommandStatus*> (ioParam);
00344             CommandT cmdid = status->command;
00345             UPseudoCmdStatusWrapper wrapper;
00346             wrapper.outEnabled = status->enabled;
00347             wrapper.outUsesMark = status->usesMark;
00348             wrapper.outMark = status->mark;
00349             wrapper.outName = status->name;
00350
00351             // first forward the command to the focused widget : if it doesn't want it
00352             // we give it to the next pseudo widget.
00353             int widFocus = UWidget::GetFocus();
00354             if(widFocus != -1)
00355             {
00356                 UCmdUI pUI(cmdid);
00357                 pUI.m_wrapper = &wrapper;
00358                 UEventSendMessage(widFocus, EV_UPDTCMD, pUI.m_nID, &pUI);
00359                 if(!pUI.CanContinue())
00360                 {
00361                     SetExecuteHost(false);
00362                     break;
00363                 }
00364             }
00365
00366             STD map<int, UCmdTarget *>::const_iterator i;
00367             const STD map<int, UCmdTarget *> & targets = UEventGetTargets();
00368             for(i = targets.begin(); i != targets.end(); ++i)
00369             {
00370                 int widid = (*i).first;
00371                 if(widid == widFocus)
00372                     continue;
00373
00374                 UCmdUI pUI(cmdid);
00375                 pUI.m_wrapper = &wrapper;
00376                 UEventSendMessage(widid, EV_UPDTCMD, pUI.m_nID, &pUI);
00377                 if(!pUI.CanContinue())
00378                     break;
00379             }
00380
00381             if(i != targets.end())
00382                 SetExecuteHost(false);
00383             break;
00384         }
00385
00386         case msg_Event:
00387         {
00388             EventRecord *ev = static_cast<EventRecord*> (ioParam);
00389
00390 #if 0
00391             if(ev->what == activateEvt)
00392             {
00393                 bool activate = (ev->modifiers & activeFlag) != 0;
00394                 LWindow *theWindow = LWindow::FetchWindowObject((WindowPtr)ev->message);
00395                 if(theWindow != 0L)
00396                 {
00397                     UEventNotifyMessage(EV_UPDATEFOCUS, !activate, theWindow);
00398                         // so the pseudo widget update its current widget.
00399                         // it's important for the menu handling.
00400                 }
00401             }
00402 #endif
00403             if(ev->what == activateEvt ||
00404                 ev->what == mouseDown ||
00405                 ev->what == mouseUp ||
00406                 ev->what == keyDown ||
00407                 ev->what == keyUp ||
00408                 ev->what == autoKey)
00409             {
00410                 UWidget::DoValidUI(false);
00411                 LCommander::SetUpdateCommandStatus(true);
00412             }
00413             break;
00414         }
00415     }
00416 }

void LMainPseudoAttachment::SpendTime ( const EventRecord & inMacEvent ) [virtual]

Definition at line 311 of file UPseudoSupport.cpp.

00312 {
00313     ::UEventGiveTime();
00314 }

The documentation for this class was generated from the following files:
  • rf/support/powerplant/UPseudoSupport.h
  • rf/support/powerplant/UPseudoSupport.cpp
Generated on Sun Feb 24 01:26:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CLogFilters Class Reference

#include <LogDlg.h>

Inheritance diagram for CLogFilters:

[legend]
Collaboration diagram for CLogFilters:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_LOG_FILTERS }

Public Methods

CLogFilters (const char *sLastDate, const char *sLastRev, const char *sLastUsers, const char *sLastStates)
CLogFilters ()
~CLogFilters ()

Public Attributes

CSmartComboBox m_userCombo
CSmartComboBox m_stateCombo
CSmartComboBox m_revCombo
CSmartComboBox m_dateCombo
CString | m_date
CString | m_rev
CString | m_state
CString | m_user
BOOL | m_hasdate
BOOL | m_hasrev
BOOL | m_hasstate
BOOL | m_hasuser

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnDate ()
afx_msg void | OnRev ()
afx_msg void | OnState ()
afx_msg void | OnUser ()

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 92 of file LogDlg.h.

00092 { IDD = IDD_LOG_FILTERS };

Constructor & Destructor Documentation

CLogFilters::CLogFilters | ( | const char * | sLastDate,
 |  | const char * | sLastRev,
 |  | const char * | sLastUsers,
 |  | const char * | sLastStates
 | ) |

Definition at line 142 of file LogDlg.cpp.

References FALSE, m_date, m_dateCombo, m_hasdate, m_hasrev, m_hasstate, m_hasuser, m_rev, m_revCombo, m_state, m_stateCombo, m_user, m_userCombo, and USmartCombo::SetItems.

00143                                                            : CPropertyPage(CLogFilters::IDD)
00144 {
00145     //{{AFX_DATA_INIT(CLogFilters)
00146     m_date = sLastDate;
00147     m_rev = sLastRev;
00148     m_state = sLastStates;
00149     m_user = sLastUsers;
00150     //}}AFX_DATA_INIT
00151
00152     m_hasdate = FALSE;
00153     m_hasrev = FALSE;
00154     m_hasstate = FALSE;
00155     m_hasuser = FALSE;
00156
00157     m_revCombo.SetItems(&gLogRevNames);
00158     m_dateCombo.SetItems(&gLogDateNames);
00159     m_userCombo.SetItems(&gLogUserNames);
00160     m_stateCombo.SetItems(&gLogStateNames);
00161 }

CLogFilters::CLogFilters ( )

Definition at line 163 of file LogDlg.cpp.

00163                          : CPropertyPage(CLogFilters::IDD)
00164 {
00165 }

CLogFilters::~CLogFilters ( )

Definition at line 167 of file LogDlg.cpp.

00168 {
00169 }

Member Function Documentation

void CLogFilters::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 171 of file LogDlg.cpp.

References DDV_MinChars, DDX_ComboMString, IDC_COMBODATE, IDC_COMBOREV, IDC_COMBOSTATE, IDC_COMBOUSER, IDC_DATE, IDC_REV, IDC_STATE, IDC_USER, m_date, m_dateCombo, m_hasdate, m_hasrev, m_hasstate, m_hasuser, m_rev, m_revCombo, m_state, m_stateCombo, m_user, m_userCombo, OnDate, OnRev, OnState, and OnUser.

00172 {
00173     CPropertyPage::DoDataExchange(pDX);
00174     //{{AFX_DATA_MAP(CLogFilters)
00175     DDX_Control(pDX, IDC_COMBOUSER, m_userCombo);
00176     DDX_Control(pDX, IDC_COMBOSTATE, m_stateCombo);
00177     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00178     DDX_Control(pDX, IDC_COMBODATE, m_dateCombo);
00179     DDX_CBString(pDX, IDC_COMBODATE, m_date);
00180     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00181     DDX_CBString(pDX, IDC_COMBOSTATE, m_state);
00182     DDX_CBString(pDX, IDC_COMBOUSER, m_user);
00183     DDX_Check(pDX, IDC_DATE, m_hasdate);
00184     DDX_Check(pDX, IDC_REV, m_hasrev);
00185     DDX_Check(pDX, IDC_STATE, m_hasstate);
00186     DDX_Check(pDX, IDC_USER, m_hasuser);
00187     //}}AFX_DATA_MAP
00188
00189     if( m_hasstate )
00190     {
00191         DDV_MinChars(pDX, m_state, 1);
00192     }
00193
00194     if( m_hasdate )
00195     {
00196         DDV_MinChars(pDX, m_date, 1);
00197     }
00198
00199     if( !pDX->m_bSaveAndValidate )
00200     {
00201         OnRev();
00202         OnDate();
00203         OnState();
00204         OnUser();
00205     }
00206
00207     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00208     DDX_ComboMString(pDX, IDC_COMBODATE, m_dateCombo);
00209     DDX_ComboMString(pDX, IDC_COMBOUSER, m_userCombo);
00210     DDX_ComboMString(pDX, IDC_COMBOSTATE, m_stateCombo);
00211 }

void CLogFilters::OnDate ( ) [protected]

Definition at line 226 of file LogDlg.cpp.

References IDC_COMBODATE, and IDC_DATE.

Referenced by DoDataExchange.

00227 {
00228     CButton* but = (CButton *)GetDlgItem(IDC_DATE);
00229     CWnd* wnd = GetDlgItem(IDC_COMBODATE);
00230     wnd->EnableWindow(but->GetCheck() == 1);
00231 }

void CLogFilters::OnRev ( ) [protected]

Definition at line 233 of file LogDlg.cpp.

References IDC_COMBOREV, and IDC_REV.

Referenced by DoDataExchange.

00234 {
00235     CButton* but = (CButton *)GetDlgItem(IDC_REV);
00236     CWnd* wnd = GetDlgItem(IDC_COMBOREV);
00237     wnd->EnableWindow(but->GetCheck() == 1);
00238 }

void CLogFilters::OnState ( ) [protected]

Definition at line 240 of file LogDlg.cpp.

References IDC_COMBOSTATE, and IDC_STATE.

Referenced by DoDataExchange.

00241 {
00242     CButton* but = (CButton *)GetDlgItem(IDC_STATE);
00243     CWnd* wnd = GetDlgItem(IDC_COMBOSTATE);
00244     wnd->EnableWindow(but->GetCheck() == 1);
00245 }

void CLogFilters::OnUser ( ) [protected]

Definition at line 247 of file LogDlg.cpp.

References IDC_COMBOUSER, and IDC_USER.

Referenced by DoDataExchange.

00248 {
00249     CButton* but = (CButton *)GetDlgItem(IDC_USER);
00250     CWnd* wnd = GetDlgItem(IDC_COMBOUSER);
00251     wnd->EnableWindow(but->GetCheck() == 1);
00252 }

Member Data Documentation

CString CLogFilters::m_date

Definition at line 97 of file LogDlg.h.

Referenced by CLogFilters, CompatGetLog, and DoDataExchange.

CSmartComboBox CLogFilters::m_dateCombo

Definition at line 96 of file LogDlg.h.

Referenced by CLogFilters, and DoDataExchange.

BOOL CLogFilters::m_hasdate

Definition at line 101 of file LogDlg.h.

Referenced by CLogFilters, CompatGetLog, and DoDataExchange.

BOOL CLogFilters::m_hasrev

Definition at line 102 of file LogDlg.h.

Referenced by CLogFilters, CompatGetLog, and DoDataExchange.

BOOL CLogFilters::m_hasstate

Definition at line 103 of file LogDlg.h.

Referenced by CLogFilters, CompatGetLog, and DoDataExchange.

BOOL CLogFilters::m_hasuser

Definition at line 104 of file LogDlg.h.

Referenced by CLogFilters, CompatGetLog, and DoDataExchange.

CString CLogFilters::m_rev

Definition at line 98 of file LogDlg.h.

Referenced by CLogFilters, CompatGetLog, and DoDataExchange.

CSmartComboBox CLogFilters::m_revCombo

Definition at line 95 of file LogDlg.h.

Referenced by CLogFilters, and DoDataExchange.

CString CLogFilters::m_state

Definition at line 99 of file LogDlg.h.

Referenced by CLogFilters, CompatGetLog, and DoDataExchange.

CSmartComboBox CLogFilters::m_stateCombo

Definition at line 94 of file LogDlg.h.

Referenced by CLogFilters, and DoDataExchange.

CString CLogFilters::m_user

Definition at line 100 of file LogDlg.h.

Referenced by CLogFilters, CompatGetLog, and DoDataExchange.

CSmartComboBox CLogFilters::m_userCombo

Definition at line 93 of file LogDlg.h.

Referenced by CLogFilters, and DoDataExchange.

The documentation for this class was generated from the following files:
  • common/LogDlg.h
  • common/LogDlg.cpp
Generated on Sun Feb 24 01:26:42 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CLogFrame Class Reference

#include <LogFrm.h>

Inheritance diagram for CLogFrame:

[legend]
Collaboration diagram for CLogFrame:

[legend]
List of all members.

Public Methods

CLogFrame ()
virtual BOOL | PreTranslateMessage (MSG *pMsg)
virtual BOOL | OnCmdMsg (UINT nID, int nCode, void *pExtra, AFX_CMDHANDLERINFO *pHandlerInfo)
virtual | ~CLogFrame ()
virtual BOOL | OnCreateClient (LPCREATESTRUCT lpcs, CCreateContext *pContext)

Protected Methods

afx_msg void | OnClose ()

Constructor & Destructor Documentation

CLogFrame::CLogFrame ( )

Definition at line 66 of file LogFrm.cpp.

00067 {
00068     // TODO: add member initialization code here
00069
00070 }

CLogFrame::~CLogFrame ( ) [virtual]

Definition at line 72 of file LogFrm.cpp.

00073 {
00074 }

Member Function Documentation

void CLogFrame::OnClose ( ) [protected]

Definition at line 104 of file LogFrm.cpp.

00105 {
00106     // prevent from closing the main frame
00107     //CCJMDIChildWnd::OnClose();
00108 }

BOOL CLogFrame::OnCmdMsg | ( | UINT | nID,
 |  | int | nCode,
 |  | void * | pExtra,
 |  | AFX_CMDHANDLERINFO * | pHandlerInfo
 | ) | [virtual]

Definition at line 136 of file LogFrm.cpp.

References CWincvsApp::GetMainFrame, CMainFrame::OnBroadcastCmdMsg, and TRUE.

00137 {
00138     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00139     if(app->GetMainFrame()->OnBroadcastCmdMsg(nID, nCode, pExtra, pHandlerInfo))
00140         return TRUE;
00141
00142     return CCJMDIChildWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
00143 }

BOOL CLogFrame::OnCreateClient | ( | LPCREATESTRUCT | lpcs,
 |  | CCreateContext * | pContext
 | ) | [virtual]

Definition at line 76 of file LogFrm.cpp.

00078 {
00079     BOOL res = CCJMDIChildWnd::OnCreateClient(lpcs, pContext);
00080     MDIMaximize();
00081
00082     return res;
00083 }

BOOL CLogFrame::PreTranslateMessage ( MSG * pMsg ) [virtual]

Definition at line 110 of file LogFrm.cpp.

00111 {
00112 /*  if (IsKeyMovingFocus(pMsg))
00113     {
00114         CWnd* pWnd;
00115         if (0x8000 & GetKeyState(VK_SHIFT))
00116             pWnd = FindPrevWindow(GetFocus());
00117         else
00118             pWnd = FindNextWindow(GetFocus());
00119         if(pWnd)
00120         {
00121             LRESULT DlgCode = ::SendMessage(pMsg->hwnd, WM_GETDLGCODE, 0, 0);
00122             if (!(DlgCode & (DLGC_WANTTAB | DLGC_WANTALLKEYS)))
00123             {
00124                 if (pWnd->IsKindOf(RUNTIME_CLASS(CView)))
00125                     SetActiveView((CView*)pWnd, TRUE);
00126                 else
00127                     pWnd->SetFocus();
00128             }
00129         }
00130         return TRUE;
00131     }*/
00132
00133     return CCJMDIChildWnd::PreTranslateMessage(pMsg);
00134 }

The documentation for this class was generated from the following files:
  • WinCvs/LogFrm.h
  • WinCvs/LogFrm.cpp
Generated on Sun Feb 24 01:26:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CLogMain Class Reference

#include <LogDlg.h>

Inheritance diagram for CLogMain:

[legend]
Collaboration diagram for CLogMain:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_LOG_MAIN }

Public Methods

CLogMain ()
~CLogMain ()

Public Attributes

BOOL | m_defbranch
BOOL | m_norecurs
BOOL | m_notags
BOOL | m_nousers
BOOL | m_onlyrcs

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 53 of file LogDlg.h.

00053 { IDD = IDD_LOG_MAIN };

Constructor & Destructor Documentation

CLogMain::CLogMain ( )

Definition at line 106 of file LogDlg.cpp.

References FALSE, m_defbranch, m_norecurs, m_notags, m_nousers, and m_onlyrcs.

00106                    : CPropertyPage(CLogMain::IDD)
00107 {
00108     //{{AFX_DATA_INIT(CLogMain)
00109     m_defbranch = FALSE;
00110     m_norecurs = FALSE;
00111     m_notags = FALSE;
00112     m_nousers = FALSE;
00113     m_onlyrcs = FALSE;
00114     //}}AFX_DATA_INIT
00115 }

CLogMain::~CLogMain ( )

Definition at line 117 of file LogDlg.cpp.

00118 {
00119 }

Member Function Documentation

void CLogMain::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 121 of file LogDlg.cpp.

References IDC_DEFBRANCH, IDC_NORECURS, IDC_NOTAGS, IDC_NOUSERS, IDC_ONLYRCS, m_defbranch, m_norecurs, m_notags, m_nousers, and m_onlyrcs.

00122 {
00123     CPropertyPage::DoDataExchange(pDX);
00124     //{{AFX_DATA_MAP(CLogMain)
00125     DDX_Check(pDX, IDC_DEFBRANCH, m_defbranch);
00126     DDX_Check(pDX, IDC_NORECURS, m_norecurs);
00127     DDX_Check(pDX, IDC_NOTAGS, m_notags);
00128     DDX_Check(pDX, IDC_NOUSERS, m_nousers);
00129     DDX_Check(pDX, IDC_ONLYRCS, m_onlyrcs);
00130     //}}AFX_DATA_MAP
00131 }

Member Data Documentation

BOOL CLogMain::m_defbranch

Definition at line 54 of file LogDlg.h.

Referenced by CLogMain, CompatGetLog, and DoDataExchange.

BOOL CLogMain::m_norecurs

Definition at line 55 of file LogDlg.h.

Referenced by CLogMain, CompatGetLog, and DoDataExchange.

BOOL CLogMain::m_notags

Definition at line 56 of file LogDlg.h.

Referenced by CLogMain, CompatGetLog, and DoDataExchange.

BOOL CLogMain::m_nousers

Definition at line 57 of file LogDlg.h.

Referenced by CLogMain, CompatGetLog, and DoDataExchange.

BOOL CLogMain::m_onlyrcs

Definition at line 58 of file LogDlg.h.

Referenced by CLogMain, CompatGetLog, and DoDataExchange.

The documentation for this class was generated from the following files:
  • common/LogDlg.h
  • common/LogDlg.cpp
Generated on Sun Feb 24 01:26:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CLogNodeData Class Reference

Inheritance diagram for CLogNodeData:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/GraphView.cpp
Generated on Sun Feb 24 01:26:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CLogoutThread Class Reference

Inheritance diagram for CLogoutThread:

[legend]
Collaboration diagram for CLogoutThread:

[legend]
List of all members.

Public Methods

CLogoutThread ()
virtual | ~CLogoutThread ()
virtual void | Delete ()
void | KillThread (void)

Protected Methods

virtual BOOL | InitInstance ()

Protected Attributes

bool | m_term

Constructor & Destructor Documentation

CLogoutThread::CLogoutThread ( )

Definition at line 127 of file wincvs.cpp.

00127                              : m_term(false)
00128 {
00129 }

CLogoutThread::~CLogoutThread ( ) [virtual]

Definition at line 131 of file wincvs.cpp.

00132 {
00133 }

Member Function Documentation

void CLogoutThread::Delete ( ) [virtual]

Definition at line 135 of file wincvs.cpp.

00136 {
00137     CWinThread::Delete();
00138 }

BOOL CLogoutThread::InitInstance ( ) [protected, virtual]

Definition at line 140 of file wincvs.cpp.

References cvs_err, CvsCmdLogout, FALSE, CWincvsApp::gCvsRunning, CWincvsApp::GetIdleTime, pserver, and CWincvsApp::ResetIdleTime.

00141 {
00142     for(;;)
00143     {
00144         Sleep(1000);
00145
00146         if(m_term)
00147             return FALSE;
00148
00149         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00150         if(gAuthen.kind() != pserver || !gCvsPrefs.HasLoogedIn() ||
00151             gCvsPrefs.LogoutTimeOut() <= 0 || app->gCvsRunning)
00152                 continue;
00153
00154         DWORD time = ::GetTickCount();
00155         if(app->GetIdleTime() != 0 &&
00156             (time - app->GetIdleTime()) >= (gCvsPrefs.LogoutTimeOut() * 60 * 1000))
00157         {
00158             app->ResetIdleTime();
00159             cvs_err("Making automatic logout after %d minute(s):\n", gCvsPrefs.LogoutTimeOut());
00160             CvsCmdLogout();
00161         }
00162     }
00163
00164     return FALSE;
00165 }

void CLogoutThread::KillThread ( void ) [inline]

Definition at line 106 of file wincvs.cpp.

References m_term.

Referenced by CWincvsApp::SaveAllModified.

00106 { m_term = true; }

Member Data Documentation

bool CLogoutThread::m_term [protected]

Definition at line 115 of file wincvs.cpp.

Referenced by KillThread.

The documentation for this class was generated from the following file:
  • WinCvs/wincvs.cpp
Generated on Sun Feb 24 01:26:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LOutlineItem Class Reference

Inheritance diagram for LOutlineItem:

[legend]
The documentation for this class was generated from the following file:
  • rf/support/powerplant/UPseudoSupport.h
Generated on Sun Feb 24 01:26:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LOutlineTable Class Reference

Inheritance diagram for LOutlineTable:

[legend]
The documentation for this class was generated from the following file:
  • common/MacBinEncoding.h
Generated on Sun Feb 24 01:26:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LPane Class Reference

Inheritance diagram for LPane:

[legend]
The documentation for this class was generated from the following file:
  • rf/support/powerplant/UPseudoSupport.h
Generated on Sun Feb 24 01:26:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LPeriodical Class Reference

Inheritance diagram for LPeriodical:

[legend]
The documentation for this class was generated from the following file:
  • rf/support/powerplant/UPseudoSupport.h
Generated on Sun Feb 24 01:26:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LPlaceHolder Class Reference

Inheritance diagram for LPlaceHolder:

[legend]
The documentation for this class was generated from the following file:
  • rf/support/powerplant/UPseudoSupport.h
Generated on Sun Feb 24 01:26:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LPseudoDrawAttachment Class Reference

Inheritance diagram for LPseudoDrawAttachment:

[legend]
Collaboration diagram for LPseudoDrawAttachment:

[legend]
List of all members.

Public Methods

LPseudoDrawAttachment (int widid, int cmdid)
virtual | ~LPseudoDrawAttachment ()

Protected Methods

virtual void | ExecuteSelf (MessageT inMessage, void *ioParam)

Protected Attributes

int | m_widid
int | m_cmdid

Constructor & Destructor Documentation

LPseudoDrawAttachment::LPseudoDrawAttachment | ( | int | widid,
 |  | int | cmdid
 | ) |

Definition at line 286 of file UPseudoSupport.cpp.

00286                                                                  : LAttachment(msg_DrawOrPrint),
00287     m_widid(widid), m_cmdid(cmdid)
00288 {
00289 }

LPseudoDrawAttachment::~LPseudoDrawAttachment ( ) [virtual]

Definition at line 291 of file UPseudoSupport.cpp.

00292 {
00293 }

Member Function Documentation

void LPseudoDrawAttachment::ExecuteSelf | ( | MessageT | inMessage,
 |  | void * | ioParam
 | ) | [protected, virtual]

Definition at line 295 of file UPseudoSupport.cpp.

References EV_CUSTOM_DRAW, m_cmdid, m_widid, and UEventSendMessage.

00296 {
00297     SetExecuteHost(true);
00298     LView *view = dynamic_cast<LView*>(GetOwnerHost());
00299     UEventSendMessage(m_widid, EV_CUSTOM_DRAW, m_cmdid, view);
00300 }

Member Data Documentation

int LPseudoDrawAttachment::m_cmdid [protected]

Definition at line 63 of file UPseudoSupport.cpp.

Referenced by ExecuteSelf.

int LPseudoDrawAttachment::m_widid [protected]

Definition at line 63 of file UPseudoSupport.cpp.

Referenced by ExecuteSelf.

The documentation for this class was generated from the following file:
  • rf/support/powerplant/UPseudoSupport.cpp
Generated on Sun Feb 24 01:26:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LPseudoWinAttachment Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for LPseudoWinAttachment:

[legend]
Collaboration diagram for LPseudoWinAttachment:

[legend]
List of all members.

Public Methods

LPseudoWinAttachment (int widid)
virtual | ~LPseudoWinAttachment ()
int | GetPageValue (int cmdid) const
void | SetPageValue (int cmdid, int value)
void | CheckWindowSize (void)
int | SearchWidID (LPane *pane)
void | InvalidCache (UWidget *tab_wid)

Protected Methods

virtual void | ExecuteSelf (MessageT inMessage, void *ioParam)
virtual void | ListenToMessage (MessageT inMessage, void *ioParam)

Protected Attributes

int | m_widid
Rect | m_lastRect
std::map< int, int > | m_PageValues
std::map< LPane *, int > | m_CacheWidgets

Constructor & Destructor Documentation

LPseudoWinAttachment::LPseudoWinAttachment ( int widid )

Definition at line 418 of file UPseudoSupport.cpp.

References CheckWindowSize, and m_lastRect.

00418                                                     : LAttachment(msg_GrowZone), m_widid(widid)
00419 {
00420     ::SetRect(&m_lastRect, 0, 0, 0, 0);
00421
00422     CheckWindowSize();
00423 }

LPseudoWinAttachment::~LPseudoWinAttachment ( ) [virtual]

Definition at line 425 of file UPseudoSupport.cpp.

References EV_DESTROY, m_widid, and UEventSendMessage.

00426 {
00427     UEventSendMessage(m_widid, EV_DESTROY, 0, 0L);
00428 }

Member Function Documentation

void LPseudoWinAttachment::CheckWindowSize ( void )

Definition at line 452 of file UPseudoSupport.cpp.

References EV_RESIZE, kUMainWidget, m_lastRect, m_widid, and UEventSendMessage.

Referenced by UPseudoFakePane::AdaptToSuperFrameSize, and LPseudoWinAttachment.

00453 {
00454     LWindow *wind = dynamic_cast<LWindow*>(GetOwnerHost());
00455     if(wind != 0L)
00456     {
00457         Rect r;
00458         wind->GetGlobalBounds(r);
00459         if(!::EqualRect(&r, &m_lastRect))
00460         {
00461             m_lastRect = r;
00462             URect ur(r);
00463             UEventSendMessage(m_widid, EV_RESIZE, kUMainWidget, &ur);
00464         }
00465     }
00466 }

void LPseudoWinAttachment::ExecuteSelf | ( | MessageT | inMessage,
 |  | void * | ioParam
 | ) | [protected, virtual]

Definition at line 445 of file UPseudoSupport.cpp.

00446 {
00447     SetExecuteHost(true);
00448
00449     // not used yet
00450 }

int LPseudoWinAttachment::GetPageValue ( int cmdid ) const

Definition at line 430 of file UPseudoSupport.cpp.

References m_PageValues.

Referenced by ListenToMessage, and UWidget::OnGetSliderProperty.

00431 {
00432     std::map<int, int>::const_iterator i = m_PageValues.find(cmdid);
00433     if(i != m_PageValues.end())
00434         return (*i).second;
00435     return 1;
00436 }

void LPseudoWinAttachment::InvalidCache ( UWidget * tab_wid )

Definition at line 505 of file UPseudoSupport.cpp.

References m_CacheWidgets, and UWidget::m_widgets.

Referenced by UWidget::OnPageChanged.

00506 {
00507     std::map<int, void *>::iterator s;
00508     for(s = tab_wid->m_widgets.begin(); s != tab_wid->m_widgets.end(); ++s)
00509     {
00510         std::map<LPane *, int>::iterator i = m_CacheWidgets.find((LPane *)(*s).second);
00511         if(i != m_CacheWidgets.end())
00512             m_CacheWidgets.erase(i);
00513     }
00514 }

void LPseudoWinAttachment::ListenToMessage | ( | MessageT | inMessage,
 |  | void * | ioParam
 | ) | [protected, virtual]

Definition at line 517 of file UPseudoSupport.cpp.

References EV_CMD, EV_COMBO_SEL, EV_EDITCHANGE, EV_LIST_DBLCLICK, EV_LIST_SELECTING, EV_SCROLLCHANGE, GetPageValue, macpp_getcmdid, SearchWidID, UStr::set, UEventSendMessage, UMAKEINT, UTextTableView_DoubleClick, and UTextTableView_SingleClick.

00520 {
00521     int cmdid;
00522     LPane *pane;
00523
00524     if(gTurnOffBroadcast)
00525         return;
00526
00527     if(macpp_getcmdid(inMessage, cmdid))
00528     {
00529         LWindow *wind = dynamic_cast<LWindow*>(GetOwnerHost());
00530         if(wind != 0L)
00531         {
00532             pane = wind->FindPaneByID(inMessage);
00533
00534             if(pane != 0L)
00535             {
00536                 int widid = SearchWidID(pane);
00537
00538                 LEditText *edit;
00539                 LControl *control;
00540                 LMenuController *popup;
00541                 LScrollBar *bar;
00542                 LSlider *slider;
00543                 LLittleArrows *arrows;
00544                 LCheckBoxGroupBox *groupbox;
00545
00546                 if((edit = dynamic_cast<LEditText*>(pane)) != 0L)
00547                     UEventSendMessage(widid, EV_EDITCHANGE, cmdid, 0L);
00548                 else if((popup = dynamic_cast<LMenuController*>(pane)) != 0L &&
00549                     popup->GetMacMenuH() != 0L)
00550                 {
00551                     SInt16 item = popup->GetCurrentMenuItem();
00552                     LStr255 pstr;
00553                     if(item > 0)
00554                         popup->GetMenuItemText(item, pstr);
00555                     UStr content(pstr);
00556                     UEventSendMessage(widid, EV_COMBO_SEL, UMAKEINT(cmdid, item - 1),
00557                         (void *)(const char *)content);
00558                 }
00559                 else if((bar = dynamic_cast<LScrollBar*>(pane)) != 0L)
00560                     UEventSendMessage(widid, EV_SCROLLCHANGE, cmdid, (void *)bar->GetValue());
00561                 else if((slider = dynamic_cast<LSlider*>(pane)) != 0L)
00562                     UEventSendMessage(widid, EV_SCROLLCHANGE, cmdid, (void *)slider->GetValue());
00563                 else if((arrows = dynamic_cast<LLittleArrows*>(pane)) != 0L)
00564                     UEventSendMessage(widid, EV_SCROLLCHANGE, cmdid, (void *)arrows->GetValue());
00565                 else if((control = dynamic_cast<LControl*>(pane)) != 0L)
00566                     UEventSendMessage(widid, EV_CMD, cmdid, 0L);
00567                 else if((groupbox = dynamic_cast<LCheckBoxGroupBox*>(pane)) != 0L)
00568                     UEventSendMessage(widid, EV_CMD, cmdid, 0L);
00569             }
00570         }
00571     }
00572     else switch (inMessage)
00573     {
00574         case msg_ScrollAction:
00575         {
00576             LScrollBar::SScrollMessage *message = static_cast<LScrollBar::SScrollMessage *>(ioParam);
00577             LScrollBar* scrollBar = message->scrollBar;
00578             int fPageStep = 1;
00579             if(macpp_getcmdid(scrollBar->GetPaneID(), cmdid))
00580                 fPageStep = GetPageValue(cmdid);
00581             int fButtonStep = 1;
00582             switch(message->hotSpot)
00583             {
00584             case kControlPageUpPart:
00585                 scrollBar->SetValue(scrollBar->GetValue() - fPageStep);
00586                 break;
00587             case kControlUpButtonPart:
00588                 scrollBar->SetValue(scrollBar->GetValue() - fButtonStep);
00589                 break;
00590             case kControlPageDownPart:
00591                 scrollBar->SetValue(scrollBar->GetValue() + fPageStep);
00592                 break;
00593             case kControlDownButtonPart:
00594                 scrollBar->SetValue(scrollBar->GetValue() + fButtonStep);
00595                 break;
00596             }
00597             break;
00598         }
00599         case UTextTableView_SingleClick:
00600         case UTextTableView_DoubleClick:
00601             pane = static_cast<LPane *>(ioParam);
00602
00603             if(pane != 0L && macpp_getcmdid(pane, cmdid))
00604             {
00605                 UStr name;
00606                 int entry = 0;
00607                 LTextTableView *table = dynamic_cast<LTextTableView *>(pane);
00608                 if(table != 0L)
00609                 {
00610                     STableCell cell = table->GetFirstSelectedCell();
00611                     if(!cell.IsNullCell())
00612                     {
00613                         char tmp[255];
00614                         UInt32 ioDataSize = 255;
00615                         table->GetCellData(cell, tmp, ioDataSize);
00616                         name.set(tmp, ioDataSize);
00617                         entry = cell.row;
00618                     }
00619                 }
00620
00621                 UEventSendMessage(SearchWidID(pane),
00622                     inMessage == UTextTableView_SingleClick ?
00623                     EV_LIST_SELECTING : EV_LIST_DBLCLICK, UMAKEINT(cmdid, entry - 1),
00624                     (void *)(const char *)name);
00625             }
00626             break;
00627     }
00628 }

int LPseudoWinAttachment::SearchWidID ( LPane * pane )

Definition at line 468 of file UPseudoSupport.cpp.

References UCmdTarget::GetWidID, m_CacheWidgets, UWidget::m_tabs, UWidget::m_widgets, m_widid, UDYNAMIC_CAST, and UEventQueryWidget.

Referenced by ListenToMessage.

00469 {
00470     int res = m_widid;
00471
00472     // first ask the cache
00473     std::map<LPane *, int>::iterator i = m_CacheWidgets.find(pane);
00474     if(i != m_CacheWidgets.end())
00475         return (*i).second;
00476
00477     // then look if it belongs to a tab
00478     UCmdTarget *target = UEventQueryWidget(m_widid);
00479     UWidget *wid = UDYNAMIC_CAST(UWidget, target);
00480     if(wid == 0L)
00481         return res;
00482
00483     std::map<int, UWidget *>::iterator t;
00484     for(t = wid->m_tabs.begin(); t != wid->m_tabs.end(); ++t)
00485     {
00486         UWidget *tab = (*t).second;
00487         std::map<int, void *>::iterator s;
00488         for(s = tab->m_widgets.begin(); s != tab->m_widgets.end(); ++s)
00489         {
00490             if((*s).second == (void *)pane)
00491             {
00492                 res = tab->GetWidID();
00493                 break; // it's a tab widget
00494             }
00495         }
00496     }
00497
00498     // so we guess it's in the main widget !
00499     std::map<LPane *, int>::value_type val(pane, res);
00500     m_CacheWidgets.insert(val);
00501
00502     return res;
00503 }

void LPseudoWinAttachment::SetPageValue | ( | int | cmdid,
 |  | int | value
 | ) |

Definition at line 438 of file UPseudoSupport.cpp.

References m_PageValues.

Referenced by UWidget::OnSetSliderProperty.

00439 {
00440     std::map<int, int>::value_type val(cmdid, value);
00441     m_PageValues.erase(cmdid);
00442     m_PageValues.insert(val);
00443 }

Member Data Documentation

std::map<LPane *, int> LPseudoWinAttachment::m_CacheWidgets [protected]

Definition at line 137 of file UPseudoSupport.h.

Referenced by InvalidCache, and SearchWidID.

Rect LPseudoWinAttachment::m_lastRect [protected]

Definition at line 135 of file UPseudoSupport.h.

Referenced by CheckWindowSize, and LPseudoWinAttachment.

std::map<int, int> LPseudoWinAttachment::m_PageValues [protected]

Definition at line 136 of file UPseudoSupport.h.

Referenced by GetPageValue, and SetPageValue.

int LPseudoWinAttachment::m_widid [protected]

Definition at line 134 of file UPseudoSupport.h.

Referenced by CheckWindowSize, SearchWidID, and ~LPseudoWinAttachment.

The documentation for this class was generated from the following files:
  • rf/support/powerplant/UPseudoSupport.h
  • rf/support/powerplant/UPseudoSupport.cpp
Generated on Sun Feb 24 01:26:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


LSReport Class Reference

Inheritance diagram for LSReport:

[legend]
Collaboration diagram for LSReport:

[legend]
List of all members.

Public Methods

LSReport (Tcl_Interp *interp)
virtual kTraversal | EnterDirectory (const char *fullpath, const char *dirname, const FSSpec *macspec)
virtual kTraversal | ExitDirectory (const char *fullpath)
virtual kTraversal | OnError (const char *err, int errcode)
virtual kTraversal | OnIdle (const char *fullpath)
virtual kTraversal | OnAnyDevice (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)

Public Attributes

Tcl_Interp * | fInterp
int | fState

Constructor & Destructor Documentation

LSReport::LSReport ( Tcl_Interp * interp ) [inline]

Definition at line 659 of file TclGlue.cpp.

References fInterp, fState, and TCL_OK.

00659 : fInterp(interp), fState(TCL_OK) {}

Member Function Documentation

virtual kTraversal LSReport::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 661 of file TclGlue.cpp.

References FSSpec, kContinueTraversal, and kTraversal.

00662     {
00663         return kContinueTraversal;
00664     }

virtual kTraversal LSReport::ExitDirectory ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 666 of file TclGlue.cpp.

References kContinueTraversal, and kTraversal.

00667     {
00668         return kContinueTraversal;
00669     }

virtual kTraversal LSReport::OnAnyDevice | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 683 of file TclGlue.cpp.

References fInterp, FSSpec, kSkipFile, kTraversal, stat, and Tcl_AppendResult.

00687     {
00688         Tcl_AppendResult(fInterp, name, "\n", 0L);
00689         return kSkipFile;
00690     }

virtual kTraversal LSReport::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 671 of file TclGlue.cpp.

References err, fInterp, fState, kTraversal, kTraversalError, Tcl_AppendResult, and TCL_ERROR.

00672     {
00673         fState = TCL_ERROR;
00674         Tcl_AppendResult(fInterp, err, "\n", 0L);
00675         return kTraversalError;
00676     }

virtual kTraversal LSReport::OnIdle ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 678 of file TclGlue.cpp.

References kContinueTraversal, and kTraversal.

00679     {
00680         return kContinueTraversal;
00681     }

Member Data Documentation

Tcl_Interp* LSReport::fInterp

Definition at line 656 of file TclGlue.cpp.

Referenced by LSReport, OnAnyDevice, and OnError.

int LSReport::fState

Definition at line 657 of file TclGlue.cpp.

Referenced by LSReport, OnError, and tclDirProc.

The documentation for this class was generated from the following file:
  • common/TclGlue.cpp
Generated on Sun Feb 24 01:26:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UMacAppMenu Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for UMacAppMenu:

[legend]
Collaboration diagram for UMacAppMenu:

[legend]
List of all members.

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UMacAppMenu ()
virtual | ~UMacAppMenu ()
void | OnUpdateUI (void)
EV_UPDATEUI is a notification sent to all the widgets when the user interface is invalid. the default is to send a EV_UPDTCMD to each sub-widget. More...

Static Public Methods

const URuntimeClass * | rtUMacAppMenu (void)

Static Public Attributes

int | sMAMenuWidID = -1

Protected Methods

virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Static Protected Attributes

const URuntimeClass | classUMacAppMenu
const UMSGMAP | messageMap = { UMenu ::GetThisMessageMap(), & UMacAppMenu ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Constructor & Destructor Documentation

UMacAppMenu::UMacAppMenu ( )

Definition at line 772 of file UPseudoSupport.cpp.

References UCmdTarget::GetWidID, and sMAMenuWidID.

00772                          : UMenu(::UEventGetWidID())
00773 {
00774     sMAMenuWidID = GetWidID();
00775 }

UMacAppMenu::~UMacAppMenu ( ) [virtual]

Definition at line 777 of file UPseudoSupport.cpp.

00778 {
00779 }

Member Function Documentation

const URuntimeClass * UMacAppMenu::_GetBaseClass ( ) [static, protected]

Reimplemented from UMenu.

Definition at line 764 of file UPseudoSupport.cpp.

const UMSGMAP * UMacAppMenu::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UMenu.

Definition at line 766 of file UPseudoSupport.cpp.

const UMSGMAP * UMacAppMenu::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UMenu.

Definition at line 766 of file UPseudoSupport.cpp.

const URuntimeClass * UMacAppMenu::GetRuntimeClass ( ) const [virtual]

Reimplemented from UMenu.

Definition at line 764 of file UPseudoSupport.cpp.

const UMSGMAP * UMacAppMenu::GetThisMessageMap ( ) [static, protected]

Reimplemented from UMenu.

Definition at line 766 of file UPseudoSupport.cpp.

void UMacAppMenu::OnUpdateUI ( void )

EV_UPDATEUI is a notification sent to all the widgets when the user interface is invalid. the default is to send a EV_UPDTCMD to each sub-widget.

Reimplemented from UMenu.

Definition at line 789 of file UPseudoSupport.cpp.

References UCmdUI::CanContinue, UCmdUI::Enable, EV_UPDTCMD, UWidget::GetFocus, UCmdTarget::GetWidID, USemaphore::IsEnteredTwice, kHierarchicalMax, kUMainWidget, UCmdUI::m_nID, STD, UAppConsole, UEventGetTargets, and UEventSendMessage.

00790 {
00791     static bool sSemaphore = false;
00792     USemaphore policeman(sSemaphore);
00793     if(policeman.IsEnteredTwice())
00794         return;
00795
00796     // this is the interesting thing about the toolbar : it resends the
00797     // update UI to other widgets according to the focus information and
00798     // allows the update to be handled several times if the handler asks for it
00799     // (by using UCmdUI::SetContinue)
00800
00801     const STD map<int, UCmdTarget *> & targets = UEventGetTargets();
00802     std::map<int, void *>::iterator w;
00803     int cmdid;
00804     int widFocus = UWidget::GetFocus();
00805
00806     for(CMenuIterator iter; iter.Current(); ++iter)
00807     {
00808         MenuRef menu = iter;
00809         short menuID = (**menu).menuID;
00810
00811         // see UMenuMgr.cpp from MacApp
00812         if (menuID < kHierarchicalMin || menuID > kHierarchicalMax)
00813             continue;
00814
00815         short numitems = ::CountMItems(menu);
00816         for(int j = 1; j <= numitems; j++)
00817         {
00818             cmdid = CommandFromMenuItem(menuID, j);
00819             if(cmdid < 0)
00820             {
00821                 UAppConsole("The item %d of the menu %d has not a MacApp cmd\n", j, menuID);
00822             }
00823             else
00824             {
00825                 if(cmdid == kUMainWidget)
00826                     continue;
00827
00828                 // first forward the command to the focused widget : if it doesn't want it
00829                 // we give it to the next pseudo widget.
00830                 if(widFocus != -1 && widFocus != GetWidID())
00831                 {
00832                     UCmdUI pUI(cmdid);
00833                     UEventSendMessage(widFocus, EV_UPDTCMD, pUI.m_nID, &pUI);
00834                     if(!pUI.CanContinue())
00835                         continue;
00836                 }
00837
00838                 STD map<int, UCmdTarget *>::const_iterator i;
00839                 for(i = targets.begin(); i != targets.end(); ++i)
00840                 {
00841                     int widid = (*i).first;
00842                     if(widid == widFocus || widid == GetWidID())
00843                         continue;
00844
00845                     UCmdUI pUI(cmdid);
00846                     UEventSendMessage(widid, EV_UPDTCMD, pUI.m_nID, &pUI);
00847                     if(!pUI.CanContinue())
00848                         break;
00849                 }
00850                 if(i == targets.end())
00851                 {
00852                     //UAppConsole("The cmd %d of the menubar has no update handler, it's gonna be disabled\n", cmdid);
00853                     UCmdUI pUI(cmdid);
00854                     pUI.Enable(false);
00855                 }
00856             }
00857         }
00858     }
00859 }

const URuntimeClass * UMacAppMenu::rtUMacAppMenu ( void ) [static]

Definition at line 764 of file UPseudoSupport.cpp.

Member Data Documentation

const UMSGMAP_ENTRY UMacAppMenu::_messageEntries [static, private]

Initial value:

   {
    { EV_UPDATEUI, epV_V, UMSG_NOEXT, 0, 0,   (UPMSG)(void (UCmdTarget::*)(void))& UMacAppMenu ::OnUpdateUI },
{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }   }

Reimplemented from UMenu.

Definition at line 766 of file UPseudoSupport.cpp.

const URuntimeClass UMacAppMenu::classUMacAppMenu [static, protected]

const UMSGMAP UMacAppMenu::messageMap = { UMenu ::GetThisMessageMap(), & UMacAppMenu ::_messageEntries[0] } [static, protected]

Reimplemented from UMenu.

Definition at line 766 of file UPseudoSupport.cpp.

int UMacAppMenu::sMAMenuWidID = -1 [static]

Definition at line 770 of file UPseudoSupport.cpp.

Referenced by TPseudoAppBehavior::DoMenuCommand, and UMacAppMenu.

The documentation for this class was generated from the following files:
  • rf/support/macapp/UPseudoSupport.h
  • rf/support/macapp/UPseudoSupport.cpp
Generated on Sun Feb 24 01:26:47 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CMacBinItem Class Reference

#include <MacBinEncoding.h>

Inheritance diagram for CMacBinItem:

[legend]
Collaboration diagram for CMacBinItem:

[legend]
List of all members.

Public Methods

CMacBinItem (const MACBINMAP &map)
virtual | ~CMacBinItem ()
virtual bool | EditCell (void)
virtual void | RemoveCell (void)

Protected Methods

virtual void | GetDrawContentsSelf (const STableCell &inCell, SOutlineDrawContents &ioDrawContents)
virtual void | DrawRowAdornments (const Rect &inLocalRowRect)
virtual void | DoubleClick (const STableCell &inCell, const SMouseDownEvent &inMouseDown, const SOutlineDrawContents &inDrawContents, Boolean inHitText)

Protected Attributes

MACBINMAP fMap

Private Methods

CMacBinItem ()
CMacBinItem (const CMacBinItem &inOriginal)
CMacBinItem & | operator= (const CMacBinItem &inOriginal)

Constructor & Destructor Documentation

CMacBinItem::CMacBinItem ( const MACBINMAP & map )

virtual CMacBinItem::~CMacBinItem ( ) [virtual]

CMacBinItem::CMacBinItem ( ) [private]

CMacBinItem::CMacBinItem ( const CMacBinItem & inOriginal ) [private]

Member Function Documentation

virtual void CMacBinItem::DoubleClick | ( | const STableCell & | inCell,
 |  | const SMouseDownEvent & | inMouseDown,
 |  | const SOutlineDrawContents & | inDrawContents,
 |  | Boolean | inHitText
 | ) | [protected, virtual]

virtual void CMacBinItem::DrawRowAdornments ( const Rect & inLocalRowRect ) [protected, virtual]

virtual bool CMacBinItem::EditCell ( void ) [virtual]

virtual void CMacBinItem::GetDrawContentsSelf | ( | const STableCell & | inCell,
 |  | SOutlineDrawContents & | ioDrawContents
 | ) | [protected, virtual]

CMacBinItem& CMacBinItem::operator= ( const CMacBinItem & inOriginal ) [private]

virtual void CMacBinItem::RemoveCell ( void ) [virtual]

Member Data Documentation

MACBINMAP CMacBinItem::fMap [protected]

Definition at line 73 of file MacBinEncoding.h.

The documentation for this class was generated from the following file:
  • common/MacBinEncoding.h
Generated on Sun Feb 24 01:26:47 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MACBINMAP Struct Reference

#include <MacBinMaps.h>

Collaboration diagram for MACBINMAP:

[legend]
List of all members.

Public Attributes

OSType | sig
char | desc [63+1]
MACENCODING encod
bool | plainBin
bool | useDefault

Member Data Documentation

char MACBINMAP::desc[ 63 + 1]

Definition at line 34 of file MacBinMaps.h.

MACENCODING MACBINMAP::encod

Definition at line 35 of file MacBinMaps.h.

bool MACBINMAP::plainBin

Definition at line 36 of file MacBinMaps.h.

OSType MACBINMAP::sig

Definition at line 33 of file MacBinMaps.h.

bool MACBINMAP::useDefault

Definition at line 37 of file MacBinMaps.h.

The documentation for this struct was generated from the following file:
  • common/MacBinMaps.h
Generated on Sun Feb 24 01:26:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MACBINMAPENTRIES Struct Reference

#include <MacBinMaps.h>

Collaboration diagram for MACBINMAPENTRIES:

[legend]
List of all members.

Public Attributes

int | numMaps
MACBINMAP | maps [1]

Member Data Documentation

MACBINMAP MACBINMAPENTRIES::maps[1]

Definition at line 43 of file MacBinMaps.h.

int MACBINMAPENTRIES::numMaps

Definition at line 42 of file MacBinMaps.h.

The documentation for this struct was generated from the following file:
  • common/MacBinMaps.h
Generated on Sun Feb 24 01:26:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MacBinMaps Class Reference

#include <MacBinMaps.h>

Collaboration diagram for MacBinMaps:

[legend]
List of all members.

Public Methods

MacBinMaps ()
~MacBinMaps ()
void | LoadDefaults (void)
void | SaveDefaults (void)
const MACBINMAP * | AddEntry (OSType sig, const char *desc, MACENCODING encod, bool plainBin, bool useDefault)
void | RemoveEntry (OSType sig)
MacBinMaps & | operator= (const MacBinMaps &otherMap)
const MACBINMAPENTRIES * | Entries (void) const

Static Public Methods

const char * | GetEnvPlainTypes (void)
const char * | GetEnvTypes (MACENCODING type)

Protected Methods

void | Reset (void)

Protected Attributes

MACBINMAPENTRIES * entries

Constructor & Destructor Documentation

MacBinMaps::MacBinMaps ( )

MacBinMaps::~MacBinMaps ( )

Member Function Documentation

const MACBINMAP* MacBinMaps::AddEntry | ( | OSType | sig,
 |  | const char * | desc,
 |  | MACENCODING | encod,
 |  | bool | plainBin,
 |  | bool | useDefault
 | ) |

const MACBINMAPENTRIES* MacBinMaps::Entries ( void ) const [inline]

Definition at line 67 of file MacBinMaps.h.

References entries.

00067 {return entries;}

const char* MacBinMaps::GetEnvPlainTypes ( void ) [static]

Referenced by glue_getenv.

const char* MacBinMaps::GetEnvTypes ( MACENCODING type ) [static]

Referenced by glue_getenv.

void MacBinMaps::LoadDefaults ( void )

Referenced by CompatGetPrefs.

MacBinMaps& MacBinMaps::operator= ( const MacBinMaps & otherMap )

void MacBinMaps::RemoveEntry ( OSType sig )

void MacBinMaps::Reset ( void ) [protected]

void MacBinMaps::SaveDefaults ( void )

Referenced by CompatGetPrefs.

Member Data Documentation

MACBINMAPENTRIES* MacBinMaps::entries [protected]

Definition at line 80 of file MacBinMaps.h.

Referenced by Entries.

The documentation for this class was generated from the following file:
  • common/MacBinMaps.h
Generated on Sun Feb 24 01:26:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CMacBinTable Class Reference

#include <MacBinEncoding.h>

Inheritance diagram for CMacBinTable:

[legend]
Collaboration diagram for CMacBinTable:

[legend]
List of all members.

Public Types

enum | { class_ID = 'MBTA' }

Public Methods

CMacBinTable (LStream *inStream)
virtual | ~CMacBinTable ()

Static Public Methods

void | SetCurrentMap (MacBinMaps *map)
MacBinMaps * | GetCurrentMap (void)

Protected Methods

virtual void | FinishCreateSelf ()

Static Protected Attributes

MacBinMaps * gCurMacBinMap

Private Methods

CMacBinTable ()
CMacBinTable (const CMacBinTable &inOriginal)
CMacBinTable & | operator= (const CMacBinTable &inOriginal)

Member Enumeration Documentation

anonymous enum

Enumeration values:
class_ID

Definition at line 38 of file MacBinEncoding.h.

00038 { class_ID = 'MBTA' };

Constructor & Destructor Documentation

CMacBinTable::CMacBinTable ( LStream * inStream )

virtual CMacBinTable::~CMacBinTable ( ) [virtual]

CMacBinTable::CMacBinTable ( ) [private]

CMacBinTable::CMacBinTable ( const CMacBinTable & inOriginal ) [private]

Member Function Documentation

virtual void CMacBinTable::FinishCreateSelf ( ) [protected, virtual]

MacBinMaps* CMacBinTable::GetCurrentMap ( void ) [inline, static]

Definition at line 44 of file MacBinEncoding.h.

References gCurMacBinMap.

00044 {return gCurMacBinMap;}

CMacBinTable& CMacBinTable::operator= ( const CMacBinTable & inOriginal ) [private]

void CMacBinTable::SetCurrentMap ( MacBinMaps * map ) [inline, static]

Definition at line 43 of file MacBinEncoding.h.

References gCurMacBinMap.

Referenced by CompatGetPrefs.

00043 {gCurMacBinMap = map;}

Member Data Documentation

MacBinMaps* CMacBinTable::gCurMacBinMap [static, protected]

Definition at line 46 of file MacBinEncoding.h.

Referenced by GetCurrentMap, and SetCurrentMap.

The documentation for this class was generated from the following file:
  • common/MacBinEncoding.h
Generated on Sun Feb 24 01:26:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CMacroEntry Class Reference

#include <MacrosSetup.h>

Collaboration diagram for CMacroEntry:

[legend]
List of all members.

Public Methods

CMacroEntry ()
CMacroEntry (const char *fullname, const char *dispname)
CMacroEntry (const CMacroEntry &anentry)
CMacroEntry & | operator= (const CMacroEntry &anentry)
bool | operator< (const CMacroEntry &anentry) const
bool | operator== (const CMacroEntry &anentry) const

Public Attributes

UStr path
UStr name

Constructor & Destructor Documentation

CMacroEntry::CMacroEntry ( ) [inline]

Definition at line 42 of file MacrosSetup.h.

00042 {}

CMacroEntry::CMacroEntry | ( | const char * | fullname,
 |  | const char * | dispname
 | ) | [inline]

Definition at line 43 of file MacrosSetup.h.

References name, and path.

00044     {
00045         path = fullname;
00046         name = dispname;
00047     }

CMacroEntry::CMacroEntry ( const CMacroEntry & anentry ) [inline]

Definition at line 48 of file MacrosSetup.h.

00049     {
00050         *this = anentry;
00051     }

Member Function Documentation

bool CMacroEntry::operator< ( const CMacroEntry & anentry ) const [inline]

Definition at line 60 of file MacrosSetup.h.

00061     {
00062         return false;
00063     }

CMacroEntry& CMacroEntry::operator= ( const CMacroEntry & anentry ) [inline]

Definition at line 53 of file MacrosSetup.h.

References name, and path.

00054     {
00055         path = anentry.path;
00056         name = anentry.name;
00057         return *this;
00058     }

bool CMacroEntry::operator== ( const CMacroEntry & anentry ) const [inline]

Definition at line 65 of file MacrosSetup.h.

References UStr::compare, name, and path.

00066     {
00067         return path.compare(anentry.path) == 0 && name.compare(anentry.name) == 0;
00068     }

Member Data Documentation

UStr CMacroEntry::name

Definition at line 71 of file MacrosSetup.h.

Referenced by CMacroEntry, operator=, and operator==.

UStr CMacroEntry::path

Definition at line 70 of file MacrosSetup.h.

Referenced by CMacroEntry, UCvsFrame::OnCmdMacroAdmin, UCvsFolders::OnCmdMacrosSel, CWincvsDoc::OnMacroAdmin, UCvsFiles::OnMacroSel, operator=, and operator==.

The documentation for this class was generated from the following file:
  • common/MacrosSetup.h
Generated on Sun Feb 24 01:26:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CMacroSet Class Reference

#include <MacrosSetup.h>

Collaboration diagram for CMacroSet:

[legend]
List of all members.

Public Methods

CMacroSet ()
void | Flush (void)
void | Add (const char *fullname, const char *name)

Public Attributes

std::vector< CMacroEntry > entries
bool | invalFlag

Constructor & Destructor Documentation

CMacroSet::CMacroSet ( ) [inline]

Definition at line 78 of file MacrosSetup.h.

References invalFlag.

00079     {
00080         invalFlag = true;
00081     }

Member Function Documentation

void CMacroSet::Add | ( | const char * | fullname,
 |  | const char * | name
 | ) | [inline]

Definition at line 92 of file MacrosSetup.h.

Referenced by MacroTraversal::OnFile.

00093     {
00094         entries.push_back(CMacroEntry(fullname, name));
00095     }

void CMacroSet::Flush ( void ) [inline]

Definition at line 86 of file MacrosSetup.h.

References invalFlag.

Referenced by MacrosFlushAll.

00087     {
00088         entries.erase(entries.begin(), entries.end());
00089         invalFlag = true;
00090     }

Member Data Documentation

std::vector<CMacroEntry> CMacroSet::entries

Definition at line 83 of file MacrosSetup.h.

bool CMacroSet::invalFlag

Definition at line 84 of file MacrosSetup.h.

Referenced by CMacroSet, and Flush.

The documentation for this class was generated from the following file:
  • common/MacrosSetup.h
Generated on Sun Feb 24 01:26:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MacroTraversal Class Reference

Inheritance diagram for MacroTraversal:

[legend]
Collaboration diagram for MacroTraversal:

[legend]
List of all members.

Public Methods

virtual kTraversal | OnError (const char *err, int errcode)
virtual kTraversal | OnFile (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)

Member Function Documentation

virtual kTraversal MacroTraversal::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 180 of file MacrosSetup.cpp.

References cvs_err, err, kTraversal, and kTraversalError.

00181     {
00182         cvs_err(err);
00183         cvs_err("\n");
00184         return kTraversalError;
00185     }

kTraversal MacroTraversal::OnFile | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [virtual]

Reimplemented from TraversalReport.

Definition at line 193 of file MacrosSetup.cpp.

References CMacroSet::Add, CvsArgs::add, CvsArgs::Argc, CvsArgs::Argv, CStr, cvs_err, free, getline, kContinueTraversal, kTraversal, no_argument, required_argument, stat, stricmp, strnicmp, and UFSSpec.

00197 {
00198     if(stricmp(name + strlen(name) - 4, ".tcl"))
00199         return kContinueTraversal;
00200
00201     FILE *fpin = fopen(fullname, "r");
00202     if(fpin == 0L)
00203     {
00204         cvs_err("Impossible to open '%s' (error %d)\n", fullname, errno);
00205         return kContinueTraversal;
00206     }
00207
00208     char *oldline = 0L;
00209     int line_length;
00210     size_t line_chars_allocated = 0;
00211     CvsArgs args(false);
00212     args.add("dummy");
00213
00214     if((line_length = getline (&oldline, &line_chars_allocated, fpin)) > 0 &&
00215         strnicmp(oldline, "#!CVSGUI1.0", strlen("#!CVSGUI1.0")) == 0)
00216     {
00217         char *line = oldline + strlen("#!CVSGUI1.0");
00218
00219         while(*line)
00220         {
00221             int hasQuote = 0;
00222             char *temp;
00223
00224             // Search for the non space char
00225             while(*line && isspace(*line))
00226                 ++line;
00227
00228             // handle the quote
00229             if((*line) == '"')
00230             {
00231                 hasQuote = 1;
00232                 line++;
00233             }
00234             for(temp=line;*line;++line)
00235             {
00236                 if((*line) == '"')
00237                 {
00238                     if(hasQuote)
00239                     {
00240                         hasQuote = 0; /* ok doc */
00241                         break;
00242                     }
00243                 }
00244                 if(isspace(*line) && !hasQuote)
00245                     break;
00246             }
00247             if(hasQuote) /* mismatch quote */
00248                 temp = line;
00249
00250             if(temp != line)
00251             {
00252                 CStr arg;
00253                 arg.set(temp, line - temp);
00254                 args.add(arg);
00255             }
00256         }
00257
00258         static struct option long_options[] =
00259         {
00260             {"admin", no_argument, 0L, 1},
00261             {"selection", no_argument, 0L, 2},
00262             {"name", required_argument, 0L, 3},
00263             {0, 0, 0, 0}
00264         };
00265         bool hasAdmin = false;
00266         bool hasSel = false;
00267         CStr dispname;
00268
00269         optind = 0;
00270         int option_index = 0, c;
00271         while ((c = getopt_long
00272             (args.Argc(), args.Argv(), "+", long_options, &option_index)) != EOF)
00273         {
00274             switch (c)
00275             {
00276             case 1:
00277                 hasAdmin = true;
00278                 break;
00279             case 2:
00280                 hasSel = true;
00281                 break;
00282             case 3:
00283                 dispname = optarg;
00284                 break;
00285             default:
00286                 cvs_err("Warning : unknown option in the file '%s'\n", fullname);
00287                 break;
00288             }
00289         }
00290
00291         if(dispname.empty())
00292         {
00293             dispname = name;
00294         }
00295
00296         if(hasAdmin)
00297         {
00298             gMacrosAdmin.Add(fullname, dispname);
00299         }
00300         else if(hasSel)
00301         {
00302             gMacrosSel.Add(fullname, dispname);
00303         }
00304         else
00305         {
00306             cvs_err("Warning : no option <admin|selection> in the file '%s'\n", fullname);
00307         }
00308     }
00309
00310     free (oldline);
00311
00312     fclose(fpin);
00313
00314     return kContinueTraversal;
00315 }

The documentation for this class was generated from the following file:
  • common/MacrosSetup.cpp
Generated on Sun Feb 24 01:26:50 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CMainFrame Class Reference

#include <MainFrm.h>

Inheritance diagram for CMainFrame:

[legend]
Collaboration diagram for CMainFrame:

[legend]
List of all members.

Public Methods

CMainFrame ()
virtual BOOL | PreCreateWindow (CREATESTRUCT &cs)
void | DropFiles (HDROP hDropInfo)
void | InitialShowWindow (int nCmdShow)
virtual | ~CMainFrame ()
CWinCvsBrowser * GetBrowserView ()
CCJShellTree * GetExplorerView ()
CCJTabCtrlBar * GetWorkspace ()
CMDIMenuList & | GetMenuList (void)
CWincvsView * GetConsoleView ()
CHistComboBoxEx & | GetBrowseHistory (void)
CStatusBar * GetStatusBar ()
BOOL | OnBroadcastCmdMsg (UINT nID, int nCode, void *pExtra, AFX_CMDHANDLERINFO *pHandlerInfo)
char * | GetEnvMainThread (const char *name)
KiFilterModel * GetFilterModel ()
KiRecursionModel * GetRecursionModel ()
KiIgnoreModel * GetIgnoreModel ()
void | OnFilterMaskEntered ()
void | ChangeLocation ()

Protected Methods

BOOL | InitializeDockingWindows ()
afx_msg void | OnInitMenu (CMenu *pMenu)
void | DockControlBarLeftOf (CToolBar *Bar, CToolBar *LeftOf)
bool | FreshenFileMask ()
afx_msg int | OnCreate (LPCREATESTRUCT lpCreateStruct)
afx_msg void | OnClose ()
afx_msg void | OnDropFiles (HDROP hDropInfo)
afx_msg void | OnHistorySelect ()
afx_msg void | OnActivate (UINT nState, CWnd *pWndOther, BOOL bMinimized)
afx_msg void | OnSysCommand (UINT nID, LPARAM lParam)
afx_msg void | OnViewRecursive ()
afx_msg void | OnViewModified ()
afx_msg void | OnUpdateViewModified (CCmdUI *pCmdUI)
afx_msg void | OnUpdateViewRecursive (CCmdUI *pCmdUI)
afx_msg void | OnViewConflict ()
afx_msg void | OnUpdateViewConflict (CCmdUI *pCmdUI)
afx_msg void | OnViewUnknown ()
afx_msg void | OnUpdateViewUnknown (CCmdUI *pCmdUI)
afx_msg void | OnViewMissing ()
afx_msg void | OnUpdateViewMissing (CCmdUI *pCmdUI)
afx_msg void | OnViewIgnore ()
afx_msg void | OnUpdateViewIgnore (CCmdUI *pCmdUI)
afx_msg void | OnUpdateFilterMask (CCmdUI *pCmdUI)
afx_msg void | OnUpdateHistory (CCmdUI *pCmdUI)
afx_msg void | OnViewAdded ()
afx_msg void | OnUpdateViewAdded (CCmdUI *pCmdUI)
afx_msg void | OnUpdateViewRemoved (CCmdUI *pCmdUI)
afx_msg void | OnViewRemoved ()
afx_msg void | OnViewChanged ()
afx_msg void | OnUpdateViewChanged (CCmdUI *pCmdUI)
afx_msg void | OnViewHideunknown ()
afx_msg void | OnUpdateViewHideunknown (CCmdUI *pCmdUI)
afx_msg void | OnTimer (UINT nIDEvent)

Protected Attributes

KoFilterModel m_filter
KoRecursionModel m_recursion
KoIgnoreModel m_ignore
CCvsStatusBar m_wndStatusBar
CToolBar | m_wndToolBar
CToolBar | m_wndBrowser
CToolBar | m_wndMultiUser
CToolBar | m_wndTags
CToolBar | m_wndList
CToolBar | m_wndFilter
CHistComboBoxEx m_browseHist
CToolbarCombo m_comboFilterMask
CFont | m_fontNormal
CBarConsole m_consolebar
CCJTabCtrlBar m_wndWorkspace
CImageList | m_TabImages
CCJWindowPlacement m_state

Private Attributes

BOOL | m_bRestoreFocus

Constructor & Destructor Documentation

CMainFrame::CMainFrame ( )

Definition at line 173 of file MainFrm.cpp.

References FALSE, and m_bRestoreFocus.

00174 {
00175     m_bRestoreFocus = FALSE;
00176 }

CMainFrame::~CMainFrame ( ) [virtual]

Definition at line 178 of file MainFrm.cpp.

00179 {
00180 }

Member Function Documentation

void CMainFrame::ChangeLocation ( )

Definition at line 650 of file MainFrm.cpp.

References CWincvsApp::ActivateBrowserView, CWincvsApp::GetBrowserView, m_browseHist, and CWinCvsBrowser::ResetBrowser.

Referenced by CHistComboBoxEx::DelKeyTest, and OnHistorySelect.

00651 {
00652     int nCurSel = m_browseHist.GetCurSel();
00653     CString s;
00654     m_browseHist.GetLBText(nCurSel, s);
00655     if(!s.IsEmpty())
00656     {
00657         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00658         app->GetBrowserView()->ResetBrowser(s, true);
00659         app->ActivateBrowserView();
00660     }
00661 }

void CMainFrame::DockControlBarLeftOf | ( | CToolBar * | Bar,
 |  | CToolBar * | LeftOf
 | ) | [protected]

Definition at line 423 of file MainFrm.cpp.

References CCJMDIFrameWnd::RecalcLayout.

Referenced by OnCreate.

00424 {
00425     CRect rect;
00426     DWORD dw;
00427     UINT n;
00428
00429     // get MFC to adjust the dimensions of all docked ToolBars
00430     // so that GetWindowRect will be accurate
00431     RecalcLayout();
00432     LeftOf->GetWindowRect(&rect);
00433     rect.OffsetRect(1,0);
00434     dw=LeftOf->GetBarStyle();
00435     n = 0;
00436     n = (dw&CBRS_ALIGN_TOP) ? AFX_IDW_DOCKBAR_TOP : n;
00437     n = (dw&CBRS_ALIGN_BOTTOM && n==0) ? AFX_IDW_DOCKBAR_BOTTOM : n;
00438     n = (dw&CBRS_ALIGN_LEFT && n==0) ? AFX_IDW_DOCKBAR_LEFT : n;
00439     n = (dw&CBRS_ALIGN_RIGHT && n==0) ? AFX_IDW_DOCKBAR_RIGHT : n;
00440
00441     // When we take the default parameters on rect, DockControlBar will dock
00442     // each Toolbar on a seperate line.  By calculating a rectangle, we in effect
00443     // are simulating a Toolbar being dragged to that location and docked.
00444     DockControlBar(Bar,n,&rect);
00445 }

void CMainFrame::DropFiles ( HDROP hDropInfo )

Definition at line 702 of file MainFrm.cpp.

References OnDropFiles.

Referenced by CWincvsView::OnDropFiles.

00703 {
00704     OnDropFiles(hDropInfo);
00705 }

bool CMainFrame::FreshenFileMask ( ) [protected]

Definition at line 766 of file MainFrm.cpp.

References m_comboFilterMask, m_filter, and KoFilterModel::SetMask.

Referenced by OnFilterMaskEntered, OnViewAdded, OnViewChanged, OnViewConflict, OnViewHideunknown, OnViewMissing, OnViewModified, OnViewRemoved, and OnViewUnknown.

00767 {
00768     CString strFileMask;
00769     m_comboFilterMask.GetWindowText(strFileMask);
00770     return m_filter.SetMask(strFileMask);
00771 }

CHistComboBoxEx& CMainFrame::GetBrowseHistory ( void ) [inline]

Definition at line 57 of file MainFrm.h.

References m_browseHist.

Referenced by CWinCvsBrowser::Create, and CWinCvsBrowser::ResetBrowser.

00057 { return m_browseHist; }

CWinCvsBrowser * CMainFrame::GetBrowserView ( )

Definition at line 663 of file MainFrm.cpp.

References CBrowserBar::GetBrowserView, CCJTabCtrlBar::GetView, and m_wndWorkspace.

Referenced by CWincvsApp::GetBrowserView.

00664 {
00665     CBrowserBar *bar = (CBrowserBar *)m_wndWorkspace.GetView(0);
00666     return bar->GetBrowserView();
00667 }

CWincvsView* CMainFrame::GetConsoleView ( ) [inline]

Definition at line 56 of file MainFrm.h.

References m_consolebar, and CBarConsole::m_view.

Referenced by CWincvsApp::GetConsoleView.

00056 { return m_consolebar.m_view; }

char * CMainFrame::GetEnvMainThread ( const char * name )

Definition at line 913 of file MainFrm.cpp.

References ASSERT, sAskingMainThread, and sGetEnv.

Referenced by CWincvsApp::GetEnvMainThread.

00914 {
00915     ASSERT(::GetCurrentThreadId() != AfxGetApp()->m_nThreadID);
00916
00917     sGetEnvResult = name;
00918     sAskingMainThread = true;
00919
00920     sGetEnv.Lock();
00921
00922     return sGetEnvResult;
00923 }

CCJShellTree * CMainFrame::GetExplorerView ( )

Definition at line 669 of file MainFrm.cpp.

References CCJTabCtrlBar::GetView, CExploreBar::m_TreeCtrl, and m_wndWorkspace.

Referenced by CWincvsApp::GetExplorerView.

00670 {
00671     CExploreBar *bar = (CExploreBar *)m_wndWorkspace.GetView(1);
00672     return &bar->m_TreeCtrl;
00673 }

KiFilterModel* CMainFrame::GetFilterModel ( ) [inline]

Definition at line 66 of file MainFrm.h.

Referenced by CWincvsApp::GetFilterModel.

00067     {
00068         return &m_filter;
00069     }

KiIgnoreModel* CMainFrame::GetIgnoreModel ( ) [inline]

Definition at line 78 of file MainFrm.h.

Referenced by CWincvsApp::GetIgnoreModel.

00079     {
00080         return &m_ignore;
00081     }

CMDIMenuList& CMainFrame::GetMenuList ( void ) [inline]

Definition at line 54 of file MainFrm.h.

References CMDIMenuList, and CCJMDIFrameWnd::m_menuList.

00054 { return m_menuList; }

KiRecursionModel* CMainFrame::GetRecursionModel ( ) [inline]

Definition at line 72 of file MainFrm.h.

Referenced by CWincvsApp::GetRecursionModel.

00073     {
00074         return &m_recursion;
00075     }

CStatusBar* CMainFrame::GetStatusBar ( ) [inline]

Definition at line 58 of file MainFrm.h.

References m_wndStatusBar.

Referenced by CWincvsApp::GetStatusBar.

00058 { return &m_wndStatusBar; }

CCJTabCtrlBar* CMainFrame::GetWorkspace ( ) [inline]

Definition at line 53 of file MainFrm.h.

References m_wndWorkspace.

Referenced by CWincvsApp::ActivateBrowserView.

00053 { return &m_wndWorkspace; }

BOOL CMainFrame::InitializeDockingWindows ( ) [protected]

Definition at line 182 of file MainFrm.cpp.

References CCJTabCtrlBar::AddView, CCJControlBar::Create, CCJMDIFrameWnd::DockSizeBar, CCJControlBar::EnableDockingOnSizeBar, CCJMDIFrameWnd::EnableDockingSizeBar, FALSE, ID_VIEW_CONSOLE_BAR, ID_VIEW_WORKSPACE, IDR_WORKSPACE, m_consolebar, m_TabImages, m_wndWorkspace, CCJTabCtrlBar::SetActiveView, CCJTabCtrlBar::SetTabImageList, and TRUE.

Referenced by OnCreate.

00183 {
00184     // Initial size when docked: top, bottom, left, right.
00185     // ??? SetInitialSize(125,225,225,225);
00186
00187     if (!m_wndWorkspace.Create(this, ID_VIEW_WORKSPACE,
00188         _T("Workspace"), CSize(200,100), CBRS_LEFT))
00189     {
00190         TRACE0("Failed to create dialog bar (Workspace)\n");
00191         return -1;      // fail to create
00192     }
00193
00194     m_wndWorkspace.AddView(_T("Modules"), RUNTIME_CLASS(CBrowserBar));
00195 #ifndef NOEXPLOREVIEW
00196     m_wndWorkspace.AddView(_T("Explore"), RUNTIME_CLASS(CExploreBar));
00197 #endif
00198     m_wndWorkspace.SetActiveView(0);
00199     // Define the image list to use with the tab control
00200     m_TabImages.Create (IDR_WORKSPACE, 16, 1, RGB(255,255,255));
00201     m_wndWorkspace.SetTabImageList(&m_TabImages);
00202     //m_wndWorkspace.SetMenuID(IDR_POPUP);
00203     m_wndWorkspace.EnableDockingOnSizeBar(CBRS_ALIGN_ANY);
00204
00205     if (!m_consolebar.Create(this, ID_VIEW_CONSOLE_BAR,
00206         _T("Output"), CSize(300,100), CBRS_BOTTOM))
00207     {
00208         TRACE0("Failed to create dialog bar (Output)\n");
00209         return FALSE;       // fail to create
00210     }
00211
00212     //m_consolebar.SetMenuID(IDR_POPUP);
00213     m_consolebar.EnableDockingOnSizeBar(CBRS_ALIGN_ANY);
00214
00215     EnableDockingSizeBar(CBRS_ALIGN_ANY);
00216     DockSizeBar(&m_wndWorkspace);
00217     DockSizeBar(&m_consolebar);
00218
00219     return TRUE;
00220 }

void CMainFrame::InitialShowWindow ( int nCmdShow )

Definition at line 628 of file MainFrm.cpp.

References CWinPlacement::hasOne, and CWinPlacement::placement.

Referenced by CWincvsApp::InitInstance.

00629 {
00630     if (gMainPlacement.hasOne)
00631     {
00632         WINDOWPLACEMENT wp = gMainPlacement.placement;
00633         if (nCmdShow != SW_SHOWNORMAL)
00634             wp.showCmd = nCmdShow;
00635         else if (wp.showCmd & SW_SHOWMINIMIZED)
00636             wp.showCmd = (wp.flags & WPF_RESTORETOMAXIMIZED) ? SW_MAXIMIZE : SW_SHOWNORMAL;
00637         SetWindowPlacement(&wp);
00638     }
00639     else
00640     {
00641         ShowWindow(nCmdShow);
00642     }
00643 }

void CMainFrame::OnActivate | ( | UINT | nState,
 |  | CWnd * | pWndOther,
 |  | BOOL | bMinimized
 | ) | [protected]

Definition at line 707 of file MainFrm.cpp.

References ASSERT, FALSE, CWincvsApp::GetFileView, m_bRestoreFocus, and CWincvsApp::m_isBackgroundProcess.

00708 {
00709     CCJMDIFrameWnd::OnActivate(nState, pWndOther, bMinimized);
00710
00711     // TODO: Add your message handler code here
00712
00713     //JK - prevent the focus to be gone from FileView to the Workspace - for the Dialogs etc.
00714     CWincvsApp* pApp = (CWincvsApp*)AfxGetApp();
00715     ASSERT(pApp);
00716
00717     if( WA_INACTIVE == nState && !m_bRestoreFocus )
00718     {
00719         m_bRestoreFocus = BOOL( GetFocus() == pApp->GetFileView() );
00720         pApp->m_isBackgroundProcess = true;
00721     }
00722     else
00723     {
00724         pApp->m_isBackgroundProcess = false;
00725         if( !bMinimized && m_bRestoreFocus )
00726         {
00727             m_bRestoreFocus = FALSE;
00728             CBrowseFileView* pBrowseFileView = pApp->GetFileView();
00729             if(pBrowseFileView)
00730             {
00731                 pBrowseFileView->SetFocus();
00732             }
00733         }
00734     }
00735 }

BOOL CMainFrame::OnBroadcastCmdMsg | ( | UINT | nID,
 |  | int | nCode,
 |  | void * | pExtra,
 |  | AFX_CMDHANDLERINFO * | pHandlerInfo
 | ) |

Definition at line 675 of file MainFrm.cpp.

References FALSE, CWincvsApp::GetBrowserView, CWincvsApp::GetConsoleView, CWincvsApp::GetExplorerView, NULL, and TRUE.

Referenced by CLogFrame::OnCmdMsg, and CGraphFrame::OnCmdMsg.

00676 {
00677     CPushRoutingFrame push(this);
00678
00679     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00680
00681     // pump through dock bars FIRST
00682     CWinCvsBrowser *bView = app->GetBrowserView();
00683     if (bView != NULL && bView == CWnd::GetFocus() && bView->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
00684         return TRUE;
00685 #ifndef NOEXPLOREVIEW
00686     // pump through dock bars FIRST
00687     CCJShellTree *eView = app->GetExplorerView();
00688     if (eView != NULL && eView == CWnd::GetFocus())
00689     {
00690         if(eView->GetParent()->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
00691             return TRUE;
00692     }
00693 #endif
00694
00695     CWincvsView *cView = app->GetConsoleView();
00696     if (cView != NULL && cView == CWnd::GetFocus() && cView->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
00697         return TRUE;
00698
00699     return FALSE;
00700 }

void CMainFrame::OnClose ( ) [protected]

Reimplemented from CCJMDIFrameWnd.

Definition at line 474 of file MainFrm.cpp.

References CWincvsApp::gCvsRunning, CWincvsApp::GetBrowserView, m_state, CCJMDIFrameWnd::OnClose, CWinCvsBrowser::ResetBrowser, CCJMDIFrameWnd::SaveBarState, and CCJWindowPlacement::SaveWindowPos.

00475 {
00476     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00477     if(app->gCvsRunning)
00478     {
00479         AfxMessageBox("Cvs is currently running : stop cvs first before quitting", MB_OK | MB_ICONSTOP);
00480         return;
00481     }
00482
00483     // only way I found to notify the browser
00484     // and to prevent the memory leak support.
00485     app->GetBrowserView()->ResetBrowser(0L);
00486
00487     // Charybids Ltd's suggested fix:
00488     // Saving the window positions whilst iconic trashes the registry.
00489     if (!IsIconic())
00490     {
00491         m_state.SaveWindowPos(this);
00492         SaveBarState(_T("Bar State"));
00493
00494         WINDOWPLACEMENT wp;
00495         wp.length = sizeof wp;
00496         if (GetWindowPlacement(&wp)) {
00497             wp.flags &= WPF_RESTORETOMAXIMIZED;
00498             gMainPlacement = wp;
00499         }
00500     }
00501
00502     // write all the persistents to the .INI file
00503     gCvsPrefs.save();
00504
00505     CCJMDIFrameWnd::OnClose();
00506 }

int CMainFrame::OnCreate ( LPCREATESTRUCT lpCreateStruct ) [protected]

Definition at line 227 of file MainFrm.cpp.

References ASSERT, NotificationManager::CheckIn, CToolbarCombo::Create, DockControlBarLeftOf, CCJMDIFrameWnd::EnableDocking, CToolbarCombo::GetManager, HISTLOC_IMAGE_CX, HISTLOC_VISIBLEITEMS, ID_FILTERMASK, ID_HISTORYBROWSE, ID_VIEW_BROWSER_BAR, ID_VIEW_FILES_BAR, ID_VIEW_FILTER_BAR, ID_VIEW_MULTI_BAR, ID_VIEW_TAGS_BAR, IDR_BROWSER, IDR_FILELIST, IDR_FILTER, IDR_MAINFRAME, IDR_MULTIUSER, IDR_TAGS, indicators, InitializeDockingWindows, CCJMDIFrameWnd::LoadBarState, CCJWindowPlacement::LoadWindowPos, m_browseHist, m_comboFilterMask, m_fontNormal, m_state, m_wndBrowser, m_wndFilter, m_wndList, m_wndMultiUser, m_wndStatusBar, m_wndTags, m_wndToolBar, NULL, onFilterMaskEntered, USmartCombo::SetItems, CSplashWnd::ShowSplashScreen, and TBBS_SEPARATOR.

00228 {
00229     if (CCJMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
00230         return -1;
00231
00232     if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
00233         | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
00234         !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
00235     {
00236         TRACE0("Failed to create toolbar (Standard)\n");
00237         return -1;      // fail to create
00238     }
00239
00240     if (!m_wndBrowser.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
00241         | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(0, 0, 0, 0), ID_VIEW_BROWSER_BAR) ||
00242         !m_wndBrowser.LoadToolBar(IDR_BROWSER))
00243     {
00244         TRACE0("Failed to create toolbar (Browse)\n");
00245         return -1;      // fail to create
00246     }
00247
00248     m_wndBrowser.SetButtonInfo(3, ID_SEPARATOR, TBBS_SEPARATOR, 200);
00249     CRect rect;
00250     m_wndBrowser.GetItemRect(3, &rect);
00251     rect.bottom += HISTLOC_VISIBLEITEMS * HISTLOC_IMAGE_CX + rect.bottom % HISTLOC_IMAGE_CX;
00252
00253     m_browseHist.SetItems(&gHistoryLocs);
00254
00255     if (!m_browseHist.Create(CBS_DROPDOWNLIST|WS_CHILD|WS_VISIBLE|WS_TABSTOP|WS_VSCROLL|WS_HSCROLL,
00256             rect, &m_wndBrowser, ID_HISTORYBROWSE))
00257     {
00258         TRACE0("Failed to create combobox (Browse History)\n");
00259         return -1;      // fail to create
00260     }
00261
00262     // Older versions of Windows* (NT 3.51 for instance) fail with DEFAULT_GUI_FONT
00263     if (!m_fontNormal.CreateStockObject(DEFAULT_GUI_FONT))
00264     {
00265         if (!m_fontNormal.CreatePointFont(80, "MS Sans Serif"))
00266         {
00267             TRACE0("Failed to create default GUI font\n");
00268             return -1;
00269         }
00270     }
00271
00272     // Make browse history use default GUI font
00273     m_browseHist.SetFont(&m_fontNormal);
00274
00275     if (!m_wndList.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
00276         | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(0, 0, 0, 0), ID_VIEW_FILES_BAR) ||
00277         !m_wndList.LoadToolBar(IDR_FILELIST))
00278     {
00279         TRACE0("Failed to create toolbar (Files)\n");
00280         return -1;      // fail to create
00281     }
00282
00283     if (!m_wndFilter.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
00284         | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(0, 0, 0, 0), ID_VIEW_FILTER_BAR) ||
00285         !m_wndFilter.LoadToolBar(IDR_FILTER))
00286     {
00287         TRACE0("Failed to create toolbar (Filter)\n");
00288         return -1;      // fail to create
00289     }
00290
00291     if (!m_wndMultiUser.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
00292         | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(0, 0, 0, 0), ID_VIEW_MULTI_BAR) ||
00293         !m_wndMultiUser.LoadToolBar(IDR_MULTIUSER))
00294     {
00295         TRACE0("Failed to create toolbar (Multi-User)\n");
00296         return -1;      // fail to create
00297     }
00298
00299     if (!m_wndTags.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
00300         | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(0, 0, 0, 0), ID_VIEW_TAGS_BAR) ||
00301         !m_wndTags.LoadToolBar(IDR_TAGS))
00302     {
00303         TRACE0("Failed to create toolbar (Tags)\n");
00304         return -1;      // fail to create
00305     }
00306
00307     if (!m_wndStatusBar.Create(this) ||
00308         !m_wndStatusBar.SetIndicators(indicators,
00309           sizeof(indicators)/sizeof(UINT)))
00310     {
00311         TRACE0("Failed to create status bar\n");
00312         return -1;      // fail to create
00313     }
00314
00315     // rotating icon
00316     UINT nID, nStyle;
00317     int cxWidth;
00318     m_wndStatusBar.GetPaneInfo( 1, nID, nStyle, cxWidth);
00319     m_wndStatusBar.SetPaneInfo( 1, nID, nStyle|SBPS_OWNERDRAW, 100);
00320
00321     EnableDocking(CBRS_ALIGN_ANY);
00322
00323     // Set toolbar title (visible when toolbar is floating)
00324     // Adjust toolbar height (default of 26 pixels is a little bit too small)
00325     // Enable docking
00326     m_wndToolBar.SetWindowText("Standard");
00327     m_wndToolBar.SetHeight(28);
00328     m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
00329         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
00330     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
00331     DockControlBar(&m_wndToolBar,AFX_IDW_DOCKBAR_TOP);
00332
00333     m_wndBrowser.SetWindowText("Browse");
00334     m_wndBrowser.SetHeight(28);
00335     m_wndBrowser.SetBarStyle(m_wndBrowser.GetBarStyle() |
00336         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
00337     m_wndBrowser.EnableDocking(CBRS_ALIGN_ANY);
00338     DockControlBarLeftOf(&m_wndBrowser,&m_wndToolBar);
00339
00340     m_wndList.SetWindowText("Files");
00341     m_wndList.SetHeight(28);
00342     m_wndList.SetBarStyle(m_wndList.GetBarStyle() |
00343         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
00344     m_wndList.EnableDocking(CBRS_ALIGN_ANY);
00345     DockControlBarLeftOf(&m_wndList,&m_wndBrowser);
00346
00347     m_wndMultiUser.SetWindowText("Multi-Users");
00348     m_wndMultiUser.SetHeight(28);
00349     m_wndMultiUser.SetBarStyle(m_wndMultiUser.GetBarStyle() |
00350         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
00351     m_wndMultiUser.EnableDocking(CBRS_ALIGN_ANY);
00352     DockControlBarLeftOf(&m_wndMultiUser,&m_wndList);
00353
00354     m_wndTags.SetWindowText("Tags");
00355     m_wndTags.SetHeight(28);
00356     m_wndTags.SetBarStyle(m_wndTags.GetBarStyle() |
00357         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
00358     m_wndTags.EnableDocking(CBRS_ALIGN_ANY);
00359     DockControlBarLeftOf(&m_wndTags,&m_wndMultiUser);
00360
00361     m_wndFilter.SetWindowText("Filter");
00362     m_wndFilter.SetHeight(28);
00363     m_wndFilter.SetBarStyle(m_wndFilter.GetBarStyle() |
00364         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
00365     m_wndFilter.EnableDocking(CBRS_ALIGN_ANY);
00366     DockControlBarLeftOf(&m_wndFilter,&m_wndTags);
00367
00368     m_wndFilter.SetButtonInfo(2, ID_SEPARATOR, TBBS_SEPARATOR, 200);
00369     m_wndFilter.GetItemRect(2, &rect);
00370     rect.bottom += 80;
00371
00372     if (!m_comboFilterMask.Create(CBS_DROPDOWN|WS_CHILD|WS_VISIBLE|WS_TABSTOP,
00373             rect, &m_wndFilter, ID_FILTERMASK))
00374     {
00375         TRACE0("Failed to create combobox (filter mask)\n");
00376         return -1;          // fail to create
00377     }
00378
00379     // Make browse history use default GUI font
00380     m_comboFilterMask.SetFont(&m_fontNormal);
00381     m_comboFilterMask.GetManager()->CheckIn(this, onFilterMaskEntered);
00382
00383
00384     if(!InitializeDockingWindows())
00385     {
00386         TRACE0("Failed to initialize docking windows\n");
00387         return -1;      // fail to create
00388     }
00389
00390 #if 1
00391     // load the dock state, but check the toolbar exists (MFC bug)
00392     CDockState state;
00393     state.LoadState(_T("Bar State"));
00394     for (int i = 0; i < state.m_arrBarInfo.GetSize(); i++)
00395     {
00396         CControlBarInfo* pInfo = (CControlBarInfo*)state.m_arrBarInfo[i];
00397         ASSERT(pInfo != NULL);
00398         if (!pInfo->m_bFloating)
00399         {
00400             pInfo->m_pBar = GetControlBar(pInfo->m_nBarID);
00401             if(pInfo->m_pBar == NULL)
00402             {
00403                 delete (CControlBarInfo*)state.m_arrBarInfo[i];
00404                 state.m_arrBarInfo.RemoveAt(i);
00405                 i--;
00406             }
00407         }
00408     }
00409     SetDockState(state);
00410 #else
00411     LoadBarState(_T("Bar State"));
00412 #endif
00413     m_state.LoadWindowPos(this);
00414
00415     // CG: The following line was added by the Splash Screen component.
00416     CSplashWnd::ShowSplashScreen(this);
00417
00418     SetTimer(99, 200, 0L);
00419
00420     return 0;
00421 }

void CMainFrame::OnDropFiles ( HDROP hDropInfo ) [protected]

Definition at line 508 of file MainFrm.cpp.

References cvs_out, CWincvsApp::GetBrowserView, CWincvsApp::GetFileView, kBold, kNL, kNormal, kUnderline, NULL, CBrowseFileView::ResetView, and CWinCvsBrowser::StepToLocation.

Referenced by DropFiles.

00509 {
00510     SetActiveWindow();  // activate us first !
00511     UINT nFiles = ::DragQueryFile(hDropInfo, (UINT)-1, NULL, 0);
00512
00513     CWinApp* pApp = AfxGetApp();
00514     for (UINT iFile = 0; iFile < nFiles; iFile++)
00515     {
00516         TCHAR szFileName[_MAX_PATH];
00517         ::DragQueryFile(hDropInfo, iFile, szFileName, _MAX_PATH);
00518
00519         if( iFile == 0 )
00520         {
00521             CColorConsole out;
00522             out << kBold << "Locating: " << kNormal << kUnderline << szFileName << kNormal <<  kNormal << kNL;
00523
00524             CWincvsApp* pApp = (CWincvsApp *)AfxGetApp();
00525             if( pApp )
00526             {
00527                 const TCHAR *p1, *p2 = szFileName;
00528
00529                 while( p2 )
00530                 {
00531                     p1 = ++p2;
00532                     p2 = strchr(p2, _T('\\'));
00533                 }
00534
00535                 CWinCvsBrowser* pBrowser = pApp->GetBrowserView();
00536                 if( pBrowser )
00537                 {
00538                     if( pBrowser->StepToLocation(szFileName, true) )
00539                     {
00540                         pApp->GetFileView()->ResetView(false, p1);
00541                     }
00542                 }
00543             }
00544         }
00545
00546         // replace \ by /
00547         TCHAR *tmp = szFileName;
00548         while( (tmp = strchr(tmp, '\\')) != 0L )
00549         {
00550             *tmp++ = '/';
00551         }
00552
00553         cvs_out("%s\n", szFileName);
00554
00555         //pApp->OpenDocumentFile(szFileName);
00556     }//end for
00557
00558     ::DragFinish(hDropInfo);
00559 }

void CMainFrame::OnFilterMaskEntered ( )

Definition at line 786 of file MainFrm.cpp.

References FreshenFileMask, KoFilterModel::GetNotificationManager, m_filter, and NotificationManager::NotifyAll.

Referenced by OnViewIgnore, and OnViewRecursive.

00787 {
00788     if (FreshenFileMask())
00789     {
00790         m_filter.GetNotificationManager()->NotifyAll();
00791     }
00792 }

void CMainFrame::OnHistorySelect ( ) [protected]

Definition at line 645 of file MainFrm.cpp.

References ChangeLocation.

00646 {
00647     ChangeLocation();
00648 }

void CMainFrame::OnInitMenu ( CMenu * pMenu ) [protected]

Definition at line 561 of file MainFrm.cpp.

References ASSERT, CG_IDS_TIPOFTHEDAY, CG_IDS_TIPOFTHEDAYHELP, CG_IDS_TIPOFTHEDAYMENU, FALSE, NULL, and TRUE.

00562 {
00563     CCJMDIFrameWnd::OnInitMenu(pMenu);
00564
00565 #if 0 // now it's in the resources
00566     // CG: This block added by 'Tip of the Day' component.
00567     {
00568         // TODO: This code adds the "Tip of the Day" menu item
00569         // on the fly.  It may be removed after adding the menu
00570         // item to all applicable menu items using the resource
00571         // editor.
00572
00573         // Add Tip of the Day menu item on the fly!
00574         static CMenu* pSubMenu = NULL;
00575
00576         CString strHelp; strHelp.LoadString(CG_IDS_TIPOFTHEDAYHELP);
00577         CString strMenu;
00578         int nMenuCount = pMenu->GetMenuItemCount();
00579         BOOL bFound = FALSE;
00580         for (int i=0; i < nMenuCount; i++)
00581         {
00582             pMenu->GetMenuString(i, strMenu, MF_BYPOSITION);
00583             if (strMenu == strHelp)
00584             {
00585                 pSubMenu = pMenu->GetSubMenu(i);
00586                 bFound = TRUE;
00587                 ASSERT(pSubMenu != NULL);
00588             }
00589         }
00590
00591         CString strTipMenu;
00592         strTipMenu.LoadString(CG_IDS_TIPOFTHEDAYMENU);
00593         if (!bFound)
00594         {
00595             // Help menu is not available. Please add it!
00596             if (pSubMenu == NULL)
00597             {
00598                 // The same pop-up menu is shared between mainfrm and frame
00599                 // with the doc.
00600                 static CMenu popUpMenu;
00601                 pSubMenu = &popUpMenu;
00602                 pSubMenu->CreatePopupMenu();
00603                 pSubMenu->InsertMenu(0, MF_STRING|MF_BYPOSITION,
00604                     CG_IDS_TIPOFTHEDAY, strTipMenu);
00605             }
00606             pMenu->AppendMenu(MF_STRING|MF_BYPOSITION|MF_ENABLED|MF_POPUP,
00607                 (UINT)pSubMenu->m_hMenu, strHelp);
00608             DrawMenuBar();
00609         }
00610         else
00611         {
00612             // Check to see if the Tip of the Day menu has already been added.
00613             pSubMenu->GetMenuString(0, strMenu, MF_BYPOSITION);
00614
00615             if (strMenu != strTipMenu)
00616             {
00617                 // Tip of the Day submenu has not been added to the
00618                 // first position, so add it.
00619                 pSubMenu->InsertMenu(0, MF_BYPOSITION);  // Separator
00620                 pSubMenu->InsertMenu(0, MF_STRING|MF_BYPOSITION,
00621                     CG_IDS_TIPOFTHEDAY, strTipMenu);
00622             }
00623         }
00624     }
00625 #endif
00626 }

void CMainFrame::OnSysCommand | ( | UINT | nID,
 |  | LPARAM | lParam
 | ) | [protected]

Definition at line 737 of file MainFrm.cpp.

References ASSERT, CWincvsApp::GetFileView, and m_bRestoreFocus.

00738 {
00739     // TODO: Add your message handler code here and/or call default
00740
00741     //JK - prevent the focus to be gone from FileView to the Workspace - for the Minimize
00742     if( SC_MINIMIZE == nID )
00743     {
00744         CWincvsApp* pApp = (CWincvsApp*)AfxGetApp();
00745         ASSERT(pApp);
00746
00747         m_bRestoreFocus = BOOL( GetFocus() == pApp->GetFileView() );
00748     }
00749
00750     CCJMDIFrameWnd::OnSysCommand(nID, lParam);
00751 }

void CMainFrame::OnTimer ( UINT nIDEvent ) [protected]

Definition at line 925 of file MainFrm.cpp.

References glue_getenv, sAskingMainThread, and sGetEnv.

00926 {
00927     if(sAskingMainThread)
00928     {
00929         sAskingMainThread = false;
00930
00931         sGetEnvResult = glue_getenv(sGetEnvResult);
00932         sGetEnv.Unlock();
00933     }
00934 }

void CMainFrame::OnUpdateFilterMask ( CCmdUI * pCmdUI ) [protected]

Definition at line 846 of file MainFrm.cpp.

References IsAppEnabled.

00847 {
00848     pCmdUI->Enable(IsAppEnabled());
00849 }

void CMainFrame::OnUpdateHistory ( CCmdUI * pCmdUI ) [protected]

Definition at line 851 of file MainFrm.cpp.

References IsAppEnabled.

00852 {
00853     pCmdUI->Enable(IsAppEnabled());
00854 }

void CMainFrame::OnUpdateViewAdded ( CCmdUI * pCmdUI ) [protected]

Definition at line 863 of file MainFrm.cpp.

References KoFilterModel::IsAdded, IsAppEnabled, and m_filter.

00864 {
00865     pCmdUI->Enable(IsAppEnabled());
00866     pCmdUI->SetCheck(m_filter.IsAdded());
00867 }

void CMainFrame::OnUpdateViewChanged ( CCmdUI * pCmdUI ) [protected]

Definition at line 889 of file MainFrm.cpp.

References IsAppEnabled, KoFilterModel::IsChanged, and m_filter.

00890 {
00891     pCmdUI->Enable(IsAppEnabled());
00892     pCmdUI->SetCheck(m_filter.IsChanged());
00893 }

void CMainFrame::OnUpdateViewConflict ( CCmdUI * pCmdUI ) [protected]

Definition at line 801 of file MainFrm.cpp.

References IsAppEnabled, KoFilterModel::IsConflict, and m_filter.

00802 {
00803     pCmdUI->Enable(IsAppEnabled());
00804     pCmdUI->SetCheck(m_filter.IsConflict());
00805 }

void CMainFrame::OnUpdateViewHideunknown ( CCmdUI * pCmdUI ) [protected]

Definition at line 902 of file MainFrm.cpp.

References IsAppEnabled, KoFilterModel::IsDefaultMode, KoFilterModel::IsHideUnknown, and m_filter.

00903 {
00904     pCmdUI->Enable(IsAppEnabled() && m_filter.IsDefaultMode());
00905     pCmdUI->SetCheck(m_filter.IsHideUnknown());
00906 }

void CMainFrame::OnUpdateViewIgnore ( CCmdUI * pCmdUI ) [protected]

Definition at line 840 of file MainFrm.cpp.

References IsAppEnabled, KoIgnoreModel::IsShowIgnored, and m_ignore.

00841 {
00842     pCmdUI->Enable(IsAppEnabled());
00843     pCmdUI->SetCheck(m_ignore.IsShowIgnored());
00844 }

void CMainFrame::OnUpdateViewMissing ( CCmdUI * pCmdUI ) [protected]

Definition at line 827 of file MainFrm.cpp.

References IsAppEnabled, KoFilterModel::IsMissing, and m_filter.

00828 {
00829     pCmdUI->Enable(IsAppEnabled());
00830     pCmdUI->SetCheck(m_filter.IsMissing());
00831 }

void CMainFrame::OnUpdateViewModified ( CCmdUI * pCmdUI ) [protected]

Definition at line 780 of file MainFrm.cpp.

References IsAppEnabled, KoFilterModel::IsModified, and m_filter.

00781 {
00782     pCmdUI->Enable(IsAppEnabled());
00783     pCmdUI->SetCheck(m_filter.IsModified());
00784 }

void CMainFrame::OnUpdateViewRecursive ( CCmdUI * pCmdUI ) [protected]

Definition at line 760 of file MainFrm.cpp.

References IsAppEnabled, KoRecursionModel::IsShowRecursive, and m_recursion.

00761 {
00762     pCmdUI->Enable(IsAppEnabled());
00763     pCmdUI->SetCheck(m_recursion.IsShowRecursive());
00764 }

void CMainFrame::OnUpdateViewRemoved ( CCmdUI * pCmdUI ) [protected]

Definition at line 869 of file MainFrm.cpp.

References IsAppEnabled, KoFilterModel::IsRemoved, and m_filter.

00870 {
00871     pCmdUI->Enable(IsAppEnabled());
00872     pCmdUI->SetCheck(m_filter.IsRemoved());
00873 }

void CMainFrame::OnUpdateViewUnknown ( CCmdUI * pCmdUI ) [protected]

Definition at line 814 of file MainFrm.cpp.

References IsAppEnabled, KoFilterModel::IsUnknown, and m_filter.

00815 {
00816     pCmdUI->Enable(IsAppEnabled());
00817     pCmdUI->SetCheck(m_filter.IsUnknown());
00818 }

void CMainFrame::OnViewAdded ( ) [protected]

Definition at line 856 of file MainFrm.cpp.

References FreshenFileMask, KoFilterModel::GetNotificationManager, m_filter, NotificationManager::NotifyAll, and KoFilterModel::ToggleAdded.

00857 {
00858     m_filter.ToggleAdded();
00859     FreshenFileMask();
00860     m_filter.GetNotificationManager()->NotifyAll();
00861 }

void CMainFrame::OnViewChanged ( ) [protected]

Definition at line 882 of file MainFrm.cpp.

References FreshenFileMask, KoFilterModel::GetNotificationManager, m_filter, NotificationManager::NotifyAll, and KoFilterModel::ToggleChanged.

00883 {
00884     m_filter.ToggleChanged();
00885     FreshenFileMask();
00886     m_filter.GetNotificationManager()->NotifyAll();
00887 }

void CMainFrame::OnViewConflict ( ) [protected]

Definition at line 794 of file MainFrm.cpp.

References FreshenFileMask, KoFilterModel::GetNotificationManager, m_filter, NotificationManager::NotifyAll, and KoFilterModel::ToggleConflict.

00795 {
00796     m_filter.ToggleConflict();
00797     FreshenFileMask();
00798     m_filter.GetNotificationManager()->NotifyAll();
00799 }

void CMainFrame::OnViewHideunknown ( ) [protected]

Definition at line 895 of file MainFrm.cpp.

References FreshenFileMask, KoFilterModel::GetNotificationManager, m_filter, NotificationManager::NotifyAll, and KoFilterModel::ToggleHideUnknown.

00896 {
00897     m_filter.ToggleHideUnknown();
00898     FreshenFileMask();
00899     m_filter.GetNotificationManager()->NotifyAll();
00900 }

void CMainFrame::OnViewIgnore ( ) [protected]

Definition at line 833 of file MainFrm.cpp.

References KoIgnoreModel::GetNotificationManager, m_ignore, NotificationManager::NotifyAll, OnFilterMaskEntered, and KoIgnoreModel::ToggleIgnore.

00834 {
00835     m_ignore.ToggleIgnore();
00836     m_ignore.GetNotificationManager()->NotifyAll();
00837     OnFilterMaskEntered();
00838 }

void CMainFrame::OnViewMissing ( ) [protected]

Definition at line 820 of file MainFrm.cpp.

References FreshenFileMask, KoFilterModel::GetNotificationManager, m_filter, NotificationManager::NotifyAll, and KoFilterModel::ToggleMissing.

00821 {
00822     m_filter.ToggleMissing();
00823     FreshenFileMask();
00824     m_filter.GetNotificationManager()->NotifyAll();
00825 }

void CMainFrame::OnViewModified ( ) [protected]

Definition at line 773 of file MainFrm.cpp.

References FreshenFileMask, KoFilterModel::GetNotificationManager, m_filter, NotificationManager::NotifyAll, and KoFilterModel::ToggleModified.

00774 {
00775     m_filter.ToggleModified();
00776     FreshenFileMask();
00777     m_filter.GetNotificationManager()->NotifyAll();
00778 }

void CMainFrame::OnViewRecursive ( ) [protected]

Definition at line 753 of file MainFrm.cpp.

References KoRecursionModel::GetNotificationManager, m_recursion, NotificationManager::NotifyAll, OnFilterMaskEntered, and KoRecursionModel::ToggleRecursion.

00754 {
00755     m_recursion.ToggleRecursion();
00756     m_recursion.GetNotificationManager()->NotifyAll();
00757     OnFilterMaskEntered();
00758 }

void CMainFrame::OnViewRemoved ( ) [protected]

Definition at line 875 of file MainFrm.cpp.

References FreshenFileMask, KoFilterModel::GetNotificationManager, m_filter, NotificationManager::NotifyAll, and KoFilterModel::ToggleRemoved.

00876 {
00877     m_filter.ToggleRemoved();
00878     FreshenFileMask();
00879     m_filter.GetNotificationManager()->NotifyAll();
00880 }

void CMainFrame::OnViewUnknown ( ) [protected]

Definition at line 807 of file MainFrm.cpp.

References FreshenFileMask, KoFilterModel::GetNotificationManager, m_filter, NotificationManager::NotifyAll, and KoFilterModel::ToggleUnknown.

00808 {
00809     m_filter.ToggleUnknown();
00810     FreshenFileMask();
00811     m_filter.GetNotificationManager()->NotifyAll();
00812 }

BOOL CMainFrame::PreCreateWindow ( CREATESTRUCT & cs ) [virtual]

Reimplemented from CCJMDIFrameWnd.

Definition at line 447 of file MainFrm.cpp.

References CCJMDIFrameWnd::PreCreateWindow.

00448 {
00449     // TODO: Modify the Window class or styles here by modifying
00450     //  the CREATESTRUCT cs
00451
00452     return CCJMDIFrameWnd::PreCreateWindow(cs);
00453 }

Member Data Documentation

BOOL CMainFrame::m_bRestoreFocus [private]

Definition at line 149 of file MainFrm.h.

Referenced by CMainFrame, OnActivate, and OnSysCommand.

CHistComboBoxEx CMainFrame::m_browseHist [protected]

Definition at line 100 of file MainFrm.h.

Referenced by ChangeLocation, GetBrowseHistory, and OnCreate.

CToolbarCombo CMainFrame::m_comboFilterMask [protected]

Definition at line 101 of file MainFrm.h.

Referenced by FreshenFileMask, and OnCreate.

CBarConsole CMainFrame::m_consolebar [protected]

Definition at line 103 of file MainFrm.h.

Referenced by GetConsoleView, and InitializeDockingWindows.

KoFilterModel CMainFrame::m_filter [protected]

Definition at line 31 of file MainFrm.h.

Referenced by FreshenFileMask, OnFilterMaskEntered, OnUpdateViewAdded, OnUpdateViewChanged, OnUpdateViewConflict, OnUpdateViewHideunknown, OnUpdateViewMissing, OnUpdateViewModified, OnUpdateViewRemoved, OnUpdateViewUnknown, OnViewAdded, OnViewChanged, OnViewConflict, OnViewHideunknown, OnViewMissing, OnViewModified, OnViewRemoved, and OnViewUnknown.

CFont CMainFrame::m_fontNormal [protected]

Definition at line 102 of file MainFrm.h.

Referenced by OnCreate.

KoIgnoreModel CMainFrame::m_ignore [protected]

Definition at line 33 of file MainFrm.h.

Referenced by OnUpdateViewIgnore, and OnViewIgnore.

KoRecursionModel CMainFrame::m_recursion [protected]

Definition at line 32 of file MainFrm.h.

Referenced by OnUpdateViewRecursive, and OnViewRecursive.

CCJWindowPlacement CMainFrame::m_state [protected]

Definition at line 106 of file MainFrm.h.

Referenced by OnClose, and OnCreate.

CImageList CMainFrame::m_TabImages [protected]

Definition at line 105 of file MainFrm.h.

Referenced by InitializeDockingWindows.

CToolBar CMainFrame::m_wndBrowser [protected]

Definition at line 95 of file MainFrm.h.

Referenced by OnCreate.

CToolBar CMainFrame::m_wndFilter [protected]

Definition at line 99 of file MainFrm.h.

Referenced by OnCreate.

CToolBar CMainFrame::m_wndList [protected]

Definition at line 98 of file MainFrm.h.

Referenced by OnCreate.

CToolBar CMainFrame::m_wndMultiUser [protected]

Definition at line 96 of file MainFrm.h.

Referenced by OnCreate.

CCvsStatusBar CMainFrame::m_wndStatusBar [protected]

Definition at line 93 of file MainFrm.h.

Referenced by GetStatusBar, and OnCreate.

CToolBar CMainFrame::m_wndTags [protected]

Definition at line 97 of file MainFrm.h.

Referenced by OnCreate.

CToolBar CMainFrame::m_wndToolBar [protected]

Definition at line 94 of file MainFrm.h.

Referenced by OnCreate.

CCJTabCtrlBar CMainFrame::m_wndWorkspace [protected]

Definition at line 104 of file MainFrm.h.

Referenced by GetBrowserView, GetExplorerView, GetWorkspace, and InitializeDockingWindows.

The documentation for this class was generated from the following files:
  • WinCvs/MainFrm.h
  • WinCvs/MainFrm.cpp
Generated on Sun Feb 24 01:26:53 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CMapPtrToPtr Class Reference

Inheritance diagram for CMapPtrToPtr:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/CJLibrary/Subclass.cpp
Generated on Sun Feb 24 01:26:53 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CMDIChildWnd Class Reference

Inheritance diagram for CMDIChildWnd:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJMDIChildWnd.h
Generated on Sun Feb 24 01:26:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CMDIFrameWnd Class Reference

Inheritance diagram for CMDIFrameWnd:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJMDIFrameWnd.h
Generated on Sun Feb 24 01:26:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CMemFile Class Reference

Inheritance diagram for CMemFile:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJMemFile.h
Generated on Sun Feb 24 01:26:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CMenu Class Reference

Inheritance diagram for CMenu:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJMenu.h
Generated on Sun Feb 24 01:26:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UMenu Class Reference

#include <umenu.h>

Inheritance diagram for UMenu:

[legend]
Collaboration diagram for UMenu:

[legend]
List of all members.

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UMenu (int widid)
virtual | ~UMenu ()

Static Public Methods

const URuntimeClass * | rtUMenu (void)

Protected Methods

void | OnUpdateUI (void)
EV_UPDATEUI is a notification sent to all the widgets when the user interface is invalid. the default is to send a EV_UPDTCMD to each sub-widget. More...

int | OnCommands (int cmd)
virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Static Protected Attributes

const URuntimeClass | classUMenu
const UMSGMAP | messageMap = { UWidget ::GetThisMessageMap(), & UMenu ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Constructor & Destructor Documentation

UMenu::UMenu ( int widid )

Definition at line 81 of file umenu.cpp.

00081                       : UWidget(widid)
00082 #if qGTK
00083     , fAccelGroup(0L)
00084 #endif
00085 {
00086 #if qGTK
00087     fAccelGroup = gtk_accel_group_new ();
00088 #endif
00089 }

UMenu::~UMenu ( ) [virtual]

Definition at line 91 of file umenu.cpp.

00092 {
00093 }

Member Function Documentation

const URuntimeClass * UMenu::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Reimplemented in UMacAppMenu.

Definition at line 74 of file umenu.cpp.

const UMSGMAP * UMenu::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Reimplemented in UMacAppMenu.

Definition at line 76 of file umenu.cpp.

const UMSGMAP * UMenu::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Reimplemented in UMacAppMenu.

Definition at line 76 of file umenu.cpp.

const URuntimeClass * UMenu::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Reimplemented in UMacAppMenu.

Definition at line 74 of file umenu.cpp.

const UMSGMAP * UMenu::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Reimplemented in UMacAppMenu.

Definition at line 76 of file umenu.cpp.

int UMenu::OnCommands ( int cmd ) [protected]

Definition at line 924 of file umenu.cpp.

References EV_CMD, UCmdTarget::GetWidID, USemaphore::IsEnteredTwice, UWidget::sFocusWidID, STD, UEventGetTargets, and UEventSendMessageExt.

00925 {
00926     static bool sSemaphore = false;
00927     USemaphore policeman(sSemaphore);
00928     if(policeman.IsEnteredTwice())
00929         return 1;
00930
00931     // this is the interesting thing about the toolbar : it resends the
00932     // commands to other widgets according to the focus information and
00933     // allows the command to be handled several times if the handler return 1
00934
00935     const STD map<int, UCmdTarget *> & targets = UEventGetTargets();
00936     int res = 0;
00937     int handledFlag;
00938
00939     // first forward the command to the focused widget : if it doesn't want it
00940     // we give it to the next pseudo widget.
00941     if(sFocusWidID != -1 && sFocusWidID != GetWidID())
00942     {
00943         res = UEventSendMessageExt(sFocusWidID, EV_CMD, cmd, 0L, &handledFlag);
00944         if(res == 0 && handledFlag)
00945             return 0;
00946     }
00947
00948     STD map<int, UCmdTarget *>::const_iterator i;
00949     for(i = targets.begin(); i != targets.end(); ++i)
00950     {
00951         int widid = (*i).first;
00952         if(widid == sFocusWidID || widid == GetWidID())
00953             continue;
00954         res = UEventSendMessageExt(widid, EV_CMD, cmd, 0L, &handledFlag);
00955         if(res == 0 && handledFlag)
00956             return 0;
00957     }
00958
00959     //UAppConsole("The cmd %d of the menubar has no command handler\n", cmd);
00960
00961     return 1;
00962 }

void UMenu::OnUpdateUI ( void ) [protected]

EV_UPDATEUI is a notification sent to all the widgets when the user interface is invalid. the default is to send a EV_UPDTCMD to each sub-widget.

Reimplemented from UWidget.

Reimplemented in UMacAppMenu.

Definition at line 858 of file umenu.cpp.

References UCmdUI::CanContinue, UCmdUI::Enable, EV_UPDTCMD, UCmdTarget::GetWidID, USemaphore::IsEnteredTwice, kUMainWidget, UCmdUI::m_nID, UCmdUI::m_widget, UWidget::m_widgets, UWidget::sFocusWidID, STD, UEventGetTargets, and UEventSendMessage.

00859 {
00860     // for WIN32, the UpdateUI on the menus is better handled by MFC
00861 #ifndef WIN32
00862     static bool sSemaphore = false;
00863     USemaphore policeman(sSemaphore);
00864     if(policeman.IsEnteredTwice())
00865         return;
00866
00867     // this is the interesting thing about the toolbar : it resends the
00868     // update UI to other widgets according to the focus information and
00869     // allows the update to be handled several times if the handler asks for it
00870     // (by using UCmdUI::SetContinue)
00871
00872     const STD map<int, UCmdTarget *> & targets = UEventGetTargets();
00873     std::map<int, void *>::iterator w;
00874     int cmdid;
00875
00876     for(w = m_widgets.begin(); w != m_widgets.end(); ++w)
00877     {
00878         void *widget = (*w).second;
00879         cmdid = (*w).first;
00880
00881         if(cmdid == kUMainWidget)
00882             continue;
00883
00884 #if qGTK
00885         if(!GTK_IS_MENU_ITEM(widget))
00886             continue;
00887 #endif
00888
00889         // first forward the command to the focused widget : if it doesn't want it
00890         // we give it to the next pseudo widget.
00891         if(sFocusWidID != -1 && sFocusWidID != GetWidID())
00892         {
00893             UCmdUI pUI(cmdid);
00894             pUI.m_widget = widget;
00895             UEventSendMessage(sFocusWidID, EV_UPDTCMD, pUI.m_nID, &pUI);
00896             if(!pUI.CanContinue())
00897                 continue;
00898         }
00899
00900         STD map<int, UCmdTarget *>::const_iterator i;
00901         for(i = targets.begin(); i != targets.end(); ++i)
00902         {
00903             int widid = (*i).first;
00904             if(widid == sFocusWidID || widid == GetWidID())
00905                 continue;
00906
00907             UCmdUI pUI(cmdid);
00908             pUI.m_widget = widget;
00909             UEventSendMessage(widid, EV_UPDTCMD, pUI.m_nID, &pUI);
00910             if(!pUI.CanContinue())
00911                 break;
00912         }
00913         if(i == targets.end())
00914         {
00915             //UAppConsole("The cmd %d of the menubar has no update handler, it's gonna be disabled\n", cmdid);
00916             UCmdUI pUI(cmdid);
00917             pUI.m_widget = widget;
00918             pUI.Enable(false);
00919         }
00920     }
00921 #endif
00922 }

const URuntimeClass * UMenu::rtUMenu ( void ) [static]

Definition at line 74 of file umenu.cpp.

Member Data Documentation

const UMSGMAP_ENTRY UMenu::_messageEntries [static, private]

Initial value:

   {
    { EV_UPDATEUI, epV_V, UMSG_NOEXT, 0, 0,   (UPMSG)(void (UCmdTarget::*)(void))& UMenu ::OnUpdateUI },
    { EV_CMD, epi_i, UMSG_RANGE,  0 ,  0xFFFF ,   (UPMSG)(int (UCmdTarget::*)(int cmd))& UMenu::OnCommands  },
{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }   }

Reimplemented from UWidget.

Reimplemented in UMacAppMenu.

Definition at line 76 of file umenu.cpp.

const URuntimeClass UMenu::classUMenu [static, protected]

const UMSGMAP UMenu::messageMap = { UWidget ::GetThisMessageMap(), & UMenu ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Reimplemented in UMacAppMenu.

Definition at line 76 of file umenu.cpp.

The documentation for this class was generated from the following files:
  • rf/umenu.h
  • rf/umenu.cpp
Generated on Sun Feb 24 01:26:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CMenuItemInfo Struct Reference

#include <CJMenu.h>

Inheritance diagram for CMenuItemInfo:

[legend]
Collaboration diagram for CMenuItemInfo:

[legend]
List of all members.

Public Methods

CMenuItemInfo ()

Constructor & Destructor Documentation

CMenuItemInfo::CMenuItemInfo ( ) [inline]

Definition at line 72 of file CJMenu.h.

00073     { memset(this, 0, sizeof(MENUITEMINFO));
00074       cbSize = sizeof(MENUITEMINFO);
00075     }

The documentation for this struct was generated from the following file:
  • WinCvs/CJLib/Include/CJMenu.h
Generated on Sun Feb 24 01:26:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UMessageMapFunctions Union Reference

Collaboration diagram for UMessageMapFunctions:

[legend]
List of all members.

Public Attributes

UPMSG pfn
void(UCmdTarget::* | pfnV_V )(void)
void(UCmdTarget::* | pfnV_VP )(void *)
void(UCmdTarget::* | pfnV_iVP )(int, void *)
void(UCmdTarget::* | pfnV_i )(int)
void(UCmdTarget::* | pfnV_ii )(int, int)
void(UCmdTarget::* | pfnV_iii )(int, int, int)
void(UCmdTarget::* | pfnV_iiVP )(int, int, void *)
int(UCmdTarget::* | pfni_ii )(int, int)
int(UCmdTarget::* | pfni_i )(int)
int(UCmdTarget::* | pfni_V )()
int(UCmdTarget::* | pfni_iVP )(int, void *)
int(UCmdTarget::* | pfni_VP )(void *)

Member Data Documentation

UPMSG UMessageMapFunctions::pfn

Definition at line 182 of file uevent.cpp.

Referenced by UCmdTarget::UDispatchMessage.

int(UCmdTarget::* UMessageMapFunctions::pfni_i)(int)

Referenced by UCmdTarget::UDispatchMessage.

int(UCmdTarget::* UMessageMapFunctions::pfni_ii)(int, int)

Referenced by UCmdTarget::UDispatchMessage.

int(UCmdTarget::* UMessageMapFunctions::pfni_iVP)(int,void *)

Referenced by UCmdTarget::UDispatchMessage.

int(UCmdTarget::* UMessageMapFunctions::pfni_V)()

Referenced by UCmdTarget::UDispatchMessage.

int(UCmdTarget::* UMessageMapFunctions::pfni_VP)(void *)

Referenced by UCmdTarget::UDispatchMessage.

void(UCmdTarget::* UMessageMapFunctions::pfnV_i)(int)

Referenced by UCmdTarget::UDispatchMessage.

void(UCmdTarget::* UMessageMapFunctions::pfnV_ii)(int, int)

Referenced by UCmdTarget::UDispatchMessage.

void(UCmdTarget::* UMessageMapFunctions::pfnV_iii)(int, int, int)

Referenced by UCmdTarget::UDispatchMessage.

void(UCmdTarget::* UMessageMapFunctions::pfnV_iiVP)(int, int, void *)

Referenced by UCmdTarget::UDispatchMessage.

void(UCmdTarget::* UMessageMapFunctions::pfnV_iVP)(int,void *)

Referenced by UCmdTarget::UDispatchMessage.

void(UCmdTarget::* UMessageMapFunctions::pfnV_V)(void)

Referenced by UCmdTarget::UDispatchMessage.

void(UCmdTarget::* UMessageMapFunctions::pfnV_VP)(void *)

Referenced by UCmdTarget::UDispatchMessage.

The documentation for this union was generated from the following file:
  • rf/uevent.cpp
Generated on Sun Feb 24 01:26:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CMiniDockFrameWnd Class Reference

Inheritance diagram for CMiniDockFrameWnd:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJMiniDockFrameWnd.h
Generated on Sun Feb 24 01:26:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


mircAttrCvt Class Reference

#include <CTCP2Parse.hpp>

Inheritance diagram for mircAttrCvt:

[legend]
Collaboration diagram for mircAttrCvt:

[legend]
List of all members.

Public Methods

void | mirc2ctcp (std::string *in)

Private Methods

int | extractcolor (std::string *in, int start, short *fg, short *bg)

Static Private Attributes

const char | tokens [2]
const char * | mirc2ctcpmap [17]

Member Function Documentation

int mircAttrCvt::extractcolor | ( | std::string * | in,
 |  | int | start,
 |  | short * | fg,
 |  | short * | bg
 | ) | [private]

Definition at line 445 of file CTCP2Parse.cpp.

References isn, and MIRC_TRANSPARENT.

Referenced by mirc2ctcp.

00446 {
00447     int ptr = start, len = in->length(), preColor;
00448
00449     if (ptr == len) return 0;
00450
00451     if (isn(in->at(ptr)))
00452     {
00453         // there's a foreground
00454
00455         if (ptr + 1 < len && isn(in->at(ptr + 1)))
00456         {
00457             // it's 2 digits
00458             preColor = (((in->at(ptr) - '0') * 10) + (in->at(ptr + 1) - '0'));
00459             if (preColor == 99) *fg = MIRC_TRANSPARENT;
00460             else *fg = preColor % 16;
00461             ptr += 2;
00462         }
00463         else
00464         {
00465             // it's 1 digit
00466             *fg = in->at(ptr) - '0';
00467             ptr++;
00468         }
00469         if (ptr + 1 < len && in->at(ptr) == ',' && isn(in->at(ptr + 1)))
00470         {
00471             // there's a background
00472             ptr++; // the comma
00473
00474             if (ptr + 1 < len && isn(in->at(ptr + 1)))
00475             {
00476                 // it's 2 digits
00477                 preColor = (((in->at(ptr) - '0') * 10) + (in->at(ptr + 1) - '0'));
00478                 if (preColor == 99) *bg = MIRC_TRANSPARENT;
00479                 else *bg = preColor % 16;
00480                 ptr += 2;
00481             }
00482             else
00483             {
00484                 // it's 1 digit
00485                 *bg = in->at(ptr) - '0';
00486                 ptr++;
00487             }
00488         }
00489     }
00490     return (ptr - start);
00491 };

void mircAttrCvt::mirc2ctcp ( std::string * in )

Definition at line 404 of file CTCP2Parse.cpp.

References CCTCP2, extractcolor, mirc2ctcpmap, and tokens.

Referenced by CTCP2Parse::ParseIt.

00405 {
00406     int col;
00407     char f[20];
00408     bool eqf, eqb;
00409     short oldfg, oldbg, fg = -1, bg = -1;
00410     int pos;
00411
00412     pos = in->find_first_of(tokens);
00413
00414     while (pos != std::string::npos)
00415     {
00416         oldfg = fg;
00417         oldbg = bg;
00418         col = extractcolor(in, pos+1, &fg, &bg);
00419         eqf = (oldfg == fg);
00420         eqb = (oldbg == bg);
00421
00422         if (col && (!eqf || !eqb))
00423         {
00424             // if the color hasn't changed, we insert a - which means
00425             // basically "ignore me"
00426             sprintf(f, "C%s%s",
00427                 eqf ? "-" : mirc2ctcpmap[fg],
00428                 eqb ? (eqf ? 0 : "-") : mirc2ctcpmap[bg]);
00429
00430             in->replace(pos, col+1,
00431                 std::string("") + CCTCP2 + f + CCTCP2);
00432             pos += (2 + strlen(f));   // consume the additions
00433         }
00434         else
00435         {
00436             in->replace(pos, 1, std::string("") + CCTCP2 + 'C' + CCTCP2);
00437             pos += 2;   // consume the additions
00438         }
00439         pos = in->find_first_of(tokens, pos);
00440     }
00441 };

Member Data Documentation

const char * mircAttrCvt::mirc2ctcpmap [static, private]

Initial value:

 {
    "F",
    "0",
    "1",
    "2",
    "C",
    "#7F3F3F",
    "5",
    "#FF7F00",
    "E",
    "A",
    "3",
    "B",
    "9",
    "#FF7FC0",
    "8",
    "7",
    "."
}

Definition at line 382 of file CTCP2Parse.cpp.

Referenced by mirc2ctcp.

const char mircAttrCvt::tokens [static, private]

Initial value:

 {
     (char)3 , 0
}

Definition at line 376 of file CTCP2Parse.cpp.

Referenced by mirc2ctcp.

The documentation for this class was generated from the following files:
  • common/CTCP2Parse.hpp
  • common/CTCP2Parse.cpp
Generated on Sun Feb 24 01:26:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CMMenuString Class Reference

#include <CustomizeMenus.h>

Inheritance diagram for CMMenuString:

[legend]
Collaboration diagram for CMMenuString:

[legend]
List of all members.

Public Methods

CMMenuString (unsigned int maxstr, const char *uniqueName, char *const *defaultStr=0L)
virtual | ~CMMenuString ()
virtual unsigned int | SizeOf (void) const
virtual const void * | GetData (void) const
virtual void | SetData (const void *ptr, unsigned int size)
void | Insert (const char *newstr)
const std::vector< UStr > & | GetList (void) const
std::vector< UStr > & | GetList (void)

Protected Attributes

std::vector< UStr > fAllStrs
CStaticAllocT< char > | fBuf
unsigned int | fMaxStr

Constructor & Destructor Documentation

CMMenuString::CMMenuString | ( | unsigned int | maxstr,
 |  | const char * | uniqueName,
 |  | char *const * | defaultStr = 0L
 | ) |

Definition at line 309 of file wincvs_winutil.cpp.

References Insert, and kNoClass.

00309                                                                                                 :
00310     CPersistent(uniqueName, kNoClass), fMaxStr(maxstr)
00311 {
00312     if(defaultStr != 0L)
00313     {
00314         int i = 0;
00315         while(defaultStr[i] != 0L)
00316         {
00317             Insert(defaultStr[i++]);
00318         }
00319     }
00320 }

CMMenuString::~CMMenuString ( ) [virtual]

Definition at line 322 of file wincvs_winutil.cpp.

00323 {
00324 }

Member Function Documentation

const void * CMMenuString::GetData ( void ) const [virtual]

Implements CPersistent.

Definition at line 338 of file wincvs_winutil.cpp.

References fAllStrs, fBuf, NAMESPACE, and SizeOf.

00339 {
00340     unsigned int thesize = SizeOf(), tmpsize;
00341     ((CMMenuString *)this)->fBuf.AdjustSize(thesize);
00342     char *tmp = ((CMMenuString *)this)->fBuf;
00343     *(int *)tmp = fAllStrs.size();
00344     tmp += sizeof(int) / sizeof(char);
00345
00346     NAMESPACE(std) vector<UStr>::const_iterator i;
00347     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00348     {
00349         tmpsize = (*i).length() + 1;
00350         memcpy(tmp, (const char *)(*i), tmpsize * sizeof(char));
00351         tmp += tmpsize;
00352     }
00353
00354     return (char *)fBuf;
00355 }

std::vector<UStr>& CMMenuString::GetList ( void ) [inline]

Definition at line 59 of file CustomizeMenus.h.

References fAllStrs, and CPersistent::TouchTimeStamp.

00059 { TouchTimeStamp(); return fAllStrs; }

const std::vector<UStr>& CMMenuString::GetList ( void ) const [inline]

Definition at line 58 of file CustomizeMenus.h.

References fAllStrs.

Referenced by GetCustomMenu, CCustomizeMenus::OnInitDialog, and CCustomizeMenus::OnOK.

00058 { return fAllStrs; }

void CMMenuString::Insert ( const char * newstr )

Definition at line 371 of file wincvs_winutil.cpp.

References fAllStrs, and CPersistent::TouchTimeStamp.

Referenced by CMMenuString.

00372 {
00373     TouchTimeStamp();
00374     fAllStrs.push_back(UStr(newstr));
00375 }

void CMMenuString::SetData | ( | const void * | ptr,
 |  | unsigned int | size
 | ) | [virtual]

Implements CPersistent.

Definition at line 357 of file wincvs_winutil.cpp.

References fAllStrs, and fMaxStr.

00358 {
00359     const char *tmp = (char *)ptr;
00360     unsigned int thesize;
00361     fAllStrs.erase(fAllStrs.begin(), fAllStrs.end());
00362     thesize = *(int *)tmp;
00363     tmp += sizeof(int) / sizeof(char);
00364     for(unsigned int i = 0; i < thesize && i < fMaxStr; i++)
00365     {
00366         fAllStrs.push_back(UStr(tmp));
00367         tmp += strlen(tmp) + 1;
00368     }
00369 }

unsigned int CMMenuString::SizeOf ( void ) const [virtual]

Implements CPersistent.

Definition at line 326 of file wincvs_winutil.cpp.

References fAllStrs, and NAMESPACE.

Referenced by GetData.

00327 {
00328     NAMESPACE(std) vector<UStr>::const_iterator i;
00329     unsigned int thesize = sizeof(int);
00330
00331     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00332     {
00333         thesize += (*i).length() + 1;
00334     }
00335     return thesize;
00336 }

Member Data Documentation

std::vector<UStr> CMMenuString::fAllStrs [protected]

Definition at line 62 of file CustomizeMenus.h.

Referenced by GetData, GetList, Insert, SetData, and SizeOf.

CStaticAllocT<char> CMMenuString::fBuf [protected]

Definition at line 63 of file CustomizeMenus.h.

Referenced by GetData.

unsigned int CMMenuString::fMaxStr [protected]

Definition at line 64 of file CustomizeMenus.h.

Referenced by SetData.

The documentation for this class was generated from the following files:
  • WinCvs/CustomizeMenus.h
  • WinCvs/wincvs_winutil.cpp
Generated on Sun Feb 24 01:26:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CMPString Class Reference

#include <MultiString.h>

Inheritance diagram for CMPString:

[legend]
Collaboration diagram for CMPString:

[legend]
List of all members.

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
CMPString (unsigned int maxstr, const char *uniqueName, char *const *defaultStr=0L, kClassPersistent pclass=kNoClass)
virtual | ~CMPString ()

Static Public Methods

const URuntimeClass * | rtCMPString (void)

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()

Static Protected Attributes

const URuntimeClass | classCMPString

Constructor & Destructor Documentation

CMPString::CMPString | ( | unsigned int | maxstr,
 |  | const char * | uniqueName,
 |  | char *const * | defaultStr = 0L,
 |  | kClassPersistent | pclass = kNoClass
 | ) | [inline]

Definition at line 151 of file MultiString.h.

References CPStr, kClassPersistent, and kNoClass.

00152                                                                            :
00153         TMString<CPStr>(maxstr, uniqueName, defaultStr, pclass)
00154     {
00155     }

virtual CMPString::~CMPString ( ) [inline, virtual]

Definition at line 157 of file MultiString.h.

00158     {
00159     }

Member Function Documentation

const URuntimeClass * CMPString::_GetBaseClass ( ) [static, protected]

Reimplemented from CPersistent.

Definition at line 164 of file MultiString.cpp.

const URuntimeClass * CMPString::GetRuntimeClass ( ) const [virtual]

Reimplemented from CPersistent.

Definition at line 164 of file MultiString.cpp.

const URuntimeClass * CMPString::rtCMPString ( void ) [static]

Definition at line 164 of file MultiString.cpp.

Member Data Documentation

const URuntimeClass CMPString::classCMPString [static, protected]

The documentation for this class was generated from the following files:
  • common/MultiString.h
  • common/MultiString.cpp
Generated on Sun Feb 24 01:26:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CMsg Class Reference

Collaboration diagram for CMsg:

[legend]
List of all members.

Public Methods

CMsg (int wid, int ev, int arg1, void *arg2)
CMsg ()
CMsg (const CMsg &msg)
CMsg & | operator= (const CMsg &msg)

Public Attributes

int | m_wid
int | m_ev
int | m_arg1
void * | m_arg2

Constructor & Destructor Documentation

CMsg::CMsg | ( | int | wid,
 |  | int | ev,
 |  | int | arg1,
 |  | void * | arg2
 | ) | [inline]

Definition at line 150 of file uevent.cpp.

References m_arg1, m_arg2, m_ev, and m_wid.

00150                                                 : m_wid(wid), m_ev(ev), m_arg1(arg1), m_arg2(arg2)
00151     {
00152     }

CMsg::CMsg ( ) [inline]

Definition at line 154 of file uevent.cpp.

References m_arg1, m_arg2, m_ev, and m_wid.

00154            : m_wid(0), m_ev(0), m_arg1(0), m_arg2(0L)
00155     {
00156     }

CMsg::CMsg ( const CMsg & msg ) [inline]

Definition at line 158 of file uevent.cpp.

References m_arg1, m_arg2, m_ev, and m_wid.

00158                            : m_wid(0), m_ev(0), m_arg1(0), m_arg2(0L)
00159     {
00160         *this = msg;
00161     }

Member Function Documentation

CMsg& CMsg::operator= ( const CMsg & msg ) [inline]

Definition at line 163 of file uevent.cpp.

References m_arg1, m_arg2, m_ev, and m_wid.

00164     {
00165         m_wid = msg.m_wid;
00166         m_ev = msg.m_ev;
00167         m_arg1 = msg.m_arg1;
00168         m_arg2 = msg.m_arg2;
00169
00170         return *this;
00171     }

Member Data Documentation

int CMsg::m_arg1

Definition at line 173 of file uevent.cpp.

Referenced by CMsg, operator=, and UEventGiveTime.

void* CMsg::m_arg2

Definition at line 174 of file uevent.cpp.

Referenced by CMsg, operator=, and UEventGiveTime.

int CMsg::m_ev

Definition at line 173 of file uevent.cpp.

Referenced by CMsg, operator=, and UEventGiveTime.

int CMsg::m_wid

Definition at line 173 of file uevent.cpp.

Referenced by CMsg, operator=, and UEventGiveTime.

The documentation for this class was generated from the following file:
  • rf/uevent.cpp
Generated on Sun Feb 24 01:26:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UMSGMAP Struct Reference

#include <umain.h>

Collaboration diagram for UMSGMAP:

[legend]
List of all members.

Public Attributes

const UMSGMAP * | pBaseMap
const UMSGMAP_ENTRY * | lpEntries

Member Data Documentation

const UMSGMAP_ENTRY* UMSGMAP::lpEntries

Definition at line 649 of file umain.h.

Referenced by UCmdTarget::UDispatchMessage.

const UMSGMAP* UMSGMAP::pBaseMap

Definition at line 648 of file umain.h.

Referenced by UCmdTarget::UDispatchMessage.

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Sun Feb 24 01:26:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UMSGMAP_ENTRY Struct Reference

#include <umain.h>

Collaboration diagram for UMSGMAP_ENTRY:

[legend]
List of all members.

Public Attributes

int | nMessage
UEventParam nSig
UMSG_EXT ext
int | ext1
int | ext2
UPMSG pfn

Member Data Documentation

UMSG_EXT UMSGMAP_ENTRY::ext

Definition at line 640 of file umain.h.

Referenced by UCmdTarget::UDispatchMessage.

int UMSGMAP_ENTRY::ext1

Definition at line 641 of file umain.h.

Referenced by UCmdTarget::UDispatchMessage.

int UMSGMAP_ENTRY::ext2

Definition at line 642 of file umain.h.

Referenced by UCmdTarget::UDispatchMessage.

int UMSGMAP_ENTRY::nMessage

Definition at line 638 of file umain.h.

Referenced by UCmdTarget::UDispatchMessage.

UEventParam UMSGMAP_ENTRY::nSig

Definition at line 639 of file umain.h.

Referenced by UCmdTarget::UDispatchMessage.

UPMSG UMSGMAP_ENTRY::pfn

Definition at line 643 of file umain.h.

Referenced by UCmdTarget::UDispatchMessage.

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Sun Feb 24 01:26:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CMString Class Reference

#include <MultiString.h>

Inheritance diagram for CMString:

[legend]
Collaboration diagram for CMString:

[legend]
List of all members.

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
CMString (unsigned int maxstr, const char *uniqueName, char *const *defaultStr=0L, kClassPersistent pclass=kNoClass)
virtual | ~CMString ()

Static Public Methods

const URuntimeClass * | rtCMString (void)

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()

Static Protected Attributes

const URuntimeClass | classCMString

Constructor & Destructor Documentation

CMString::CMString | ( | unsigned int | maxstr,
 |  | const char * | uniqueName,
 |  | char *const * | defaultStr = 0L,
 |  | kClassPersistent | pclass = kNoClass
 | ) | [inline]

Definition at line 136 of file MultiString.h.

References CStr, kClassPersistent, and kNoClass.

00137                                                                            :
00138         TMString<CStr>(maxstr, uniqueName, defaultStr, pclass)
00139     {
00140     }

virtual CMString::~CMString ( ) [inline, virtual]

Definition at line 142 of file MultiString.h.

00143     {
00144     }

Member Function Documentation

const URuntimeClass * CMString::_GetBaseClass ( ) [static, protected]

Reimplemented from CPersistent.

Definition at line 163 of file MultiString.cpp.

const URuntimeClass * CMString::GetRuntimeClass ( ) const [virtual]

Reimplemented from CPersistent.

Definition at line 163 of file MultiString.cpp.

const URuntimeClass * CMString::rtCMString ( void ) [static]

Definition at line 163 of file MultiString.cpp.

Member Data Documentation

const URuntimeClass CMString::classCMString [static, protected]

The documentation for this class was generated from the following files:
  • common/MultiString.h
  • common/MultiString.cpp
Generated on Sun Feb 24 01:27:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MultiFiles Class Reference

#include <MultiFiles.h>

Collaboration diagram for MultiFiles:

[legend]
List of all members.

Public Methods

MultiFiles ()
void | newdir (const char *dir)
void | newfile (const char *file, const FSSpec *spec=0L)
void | rewind (void)
bool | next (void)
char * | add (CvsArgs &args)
bool | get (int index, UStr &path, UStr &fileName)
int | NumFiles (void) const
void | reset ()

Protected Attributes

int | pos
std::vector< MultiFilesEntry > dirs

Constructor & Destructor Documentation

MultiFiles::MultiFiles ( ) [inline]

Definition at line 97 of file MultiFiles.h.

References pos.

00097 : pos(-1) {}

Member Function Documentation

char * MultiFiles::add ( CvsArgs & args )

Definition at line 88 of file MultiFiles.cpp.

References CvsArgs::addfile, MultiFilesEntry::dir, dirs, MultiFilesEntry::files, and pos.

Referenced by CvsCmdAddBinaryFiles, CvsCmdAddFiles, CvsCmdAddUnicodeFiles, CvsCmdCancelChangesFiles, CvsCmdCommitFiles, CvsCmdDiffFiles, CvsCmdEditFiles, CvsCmdEditorsFiles, CvsCmdLockFiles, CvsCmdLogFiles, CvsCmdRemoveFiles, CvsCmdStatusFiles, CvsCmdTagBranchFiles, CvsCmdTagCreateFiles, CvsCmdTagDeleteFiles, CvsCmdUneditFiles, CvsCmdUnlockFiles, CvsCmdUpdateFiles, CvsCmdWatchersFiles, CvsCmdWatchOffFiles, CvsCmdWatchOnFiles, CGetPrefs_WINCVS::OnAltcvssel, UAuthen_SSH::OnBtnName, UAuthen_SSH::OnBtnRSA, CGetPrefs_WINCVS::OnBtnviewer, UCvsFiles::OnCmdTrash, and CGetPrefs_WINCVS::OnExtdiffsel.

00089 {
00090     if(pos < 0 || (size_t)pos >= dirs.size())
00091         return 0L;
00092
00093     MultiFilesEntry & entry = dirs[pos];
00094     std::vector<FileEntry>::const_iterator i;
00095     for(i = entry.files.begin(); i != entry.files.end(); ++i)
00096     {
00097         args.addfile((*i).file, entry.dir, &(*i).spec);
00098     }
00099     return entry.dir;
00100 }

bool MultiFiles::get | ( | int | index,
 |  | UStr & | path,
 |  | UStr & | fileName
 | ) |

Definition at line 102 of file MultiFiles.cpp.

References CStr, MultiFilesEntry::dir, dirs, MultiFilesEntry::files, and pos.

Referenced by CvsCmdAnnotateFiles, CvsCmdCommitFiles, CvsCmdDiffFiles, CCommit_MAIN::OnDiff, KoMoveToTrashHandler::OnFiles, and CCommit_MAIN::OnInitDialog.

00103 {
00104     if(pos < 0 || (size_t)pos >= dirs.size())
00105         return false;
00106
00107     MultiFilesEntry & entry = dirs[pos];
00108     if(index < 0 || (size_t)index >= entry.files.size())
00109         return false;
00110
00111     path = entry.dir;
00112     fileName = entry.files[index].file;
00113     return true;
00114 }

void MultiFiles::newdir ( const char * dir )

Definition at line 57 of file MultiFiles.cpp.

References dirs.

Referenced by BrowserGetMultiFiles, UCvsFiles::OnCmdAdd, UCvsFiles::OnCmdAddb, UCvsFiles::OnCmdCommit, UCvsFiles::OnCmdDiff, UCvsFiles::OnCmdEdit, UCvsFiles::OnCmdEditors, UCvsFiles::OnCmdGraph, UCvsFiles::OnCmdLock, UCvsFiles::OnCmdLog, UCvsFiles::OnCmdQueryUpdate, UCvsFiles::OnCmdRmv, UCvsFiles::OnCmdStatus, UCvsFiles::OnCmdTagBranch, UCvsFiles::OnCmdTagDelete, UCvsFiles::OnCmdTagNew, UCvsFiles::OnCmdTrash, UCvsFiles::OnCmdUnedit, UCvsFiles::OnCmdUnlock, UCvsFiles::OnCmdUpdate, UCvsFiles::OnCmdWatchers, UCvsFiles::OnCmdWatchOff, UCvsFiles::OnCmdWatchOn, CCommit_MAIN::OnDiff, and CBrowseFileView::ProcessSelectionCommand.

00058 {
00059     MultiFilesEntry entry(dir);
00060     dirs.push_back(dir);
00061 }

void MultiFiles::newfile | ( | const char * | file,
 |  | const FSSpec * | spec = 0L
 | ) |

Definition at line 63 of file MultiFiles.cpp.

References MultiFilesEntry::add, dirs, and UFSSpec.

Referenced by BrowserGetMultiFiles, UCvsFiles::OnCmdAdd, UCvsFiles::OnCmdAddb, UCvsFiles::OnCmdCommit, UCvsFiles::OnCmdDiff, UCvsFiles::OnCmdEdit, UCvsFiles::OnCmdEditors, UCvsFiles::OnCmdGraph, UCvsFiles::OnCmdLock, UCvsFiles::OnCmdLog, UCvsFiles::OnCmdQueryUpdate, UCvsFiles::OnCmdRmv, UCvsFiles::OnCmdStatus, UCvsFiles::OnCmdTagBranch, UCvsFiles::OnCmdTagDelete, UCvsFiles::OnCmdTagNew, UCvsFiles::OnCmdTrash, UCvsFiles::OnCmdUnedit, UCvsFiles::OnCmdUnlock, UCvsFiles::OnCmdUpdate, UCvsFiles::OnCmdWatchers, UCvsFiles::OnCmdWatchOff, UCvsFiles::OnCmdWatchOn, CCommit_MAIN::OnDiff, and CBrowseFileView::ProcessSelectionCommand.

00064 {
00065     if(dirs.size() == 0)
00066         return;
00067
00068     MultiFilesEntry & entry = dirs[dirs.size() - 1];
00069     entry.add(file, spec);
00070 }

bool MultiFiles::next ( void )

Definition at line 72 of file MultiFiles.cpp.

References dirs, pos, and WaitForCvs.

Referenced by CvsCmdAddBinaryFiles, CvsCmdAddFiles, CvsCmdAddUnicodeFiles, CvsCmdAnnotateFiles, CvsCmdCancelChangesFiles, CvsCmdCommitFiles, CvsCmdDiffFiles, CvsCmdEditFiles, CvsCmdEditorsFiles, CvsCmdLockFiles, CvsCmdLogFiles, CvsCmdRemoveFiles, CvsCmdStatusFiles, CvsCmdTagBranchFiles, CvsCmdTagCreateFiles, CvsCmdTagDeleteFiles, CvsCmdUneditFiles, CvsCmdUnlockFiles, CvsCmdUpdateFiles, CvsCmdWatchersFiles, CvsCmdWatchOffFiles, CvsCmdWatchOnFiles, CGetPrefs_WINCVS::OnAltcvssel, UAuthen_SSH::OnBtnName, UAuthen_SSH::OnBtnRSA, CGetPrefs_WINCVS::OnBtnviewer, UCvsFiles::OnCmdTrash, CGetPrefs_WINCVS::OnExtdiffsel, and KoMoveToTrashHandler::OnFiles.

00073 {
00074     if(pos == -1)
00075         pos = 0;
00076     else
00077     {
00078         // only the mac uses MultiFiles for now in such a fashion.
00079         // it also means that cvs should be finished with the last round.
00080         ++pos;
00081         if((size_t)pos < dirs.size())
00082             WaitForCvs();
00083     }
00084
00085     return (size_t)pos < dirs.size();
00086 }

int MultiFiles::NumFiles ( void ) const

Definition at line 116 of file MultiFiles.cpp.

References dirs, MultiFilesEntry::files, and pos.

Referenced by UCvsFiles::OnCmdAdd, UCvsFiles::OnCmdAddb, UCvsFiles::OnCmdCommit, UCvsFiles::OnCmdDiff, UCvsFiles::OnCmdEdit, UCvsFiles::OnCmdEditors, UCvsFiles::OnCmdGraph, UCvsFiles::OnCmdLock, UCvsFiles::OnCmdLog, UCvsFiles::OnCmdQueryUpdate, UCvsFiles::OnCmdRmv, UCvsFiles::OnCmdStatus, UCvsFiles::OnCmdTagBranch, UCvsFiles::OnCmdTagDelete, UCvsFiles::OnCmdTagNew, UCvsFiles::OnCmdTrash, UCvsFiles::OnCmdUnedit, UCvsFiles::OnCmdUnlock, UCvsFiles::OnCmdUpdate, UCvsFiles::OnCmdWatchers, UCvsFiles::OnCmdWatchOff, UCvsFiles::OnCmdWatchOn, KoMoveToTrashHandler::OnFiles, CCommit_MAIN::OnInitDialog, and CBrowseFileView::ProcessSelectionCommand.

00117 {
00118     int locpos = pos;
00119     if(locpos == -1)
00120         locpos = 0;
00121     if((size_t)locpos >= dirs.size())
00122         return 0;
00123
00124     const MultiFilesEntry & entry = dirs[locpos];
00125     return entry.files.size();
00126 }

void MultiFiles::reset ( )

Definition at line 128 of file MultiFiles.cpp.

References dirs, and pos.

00129 {
00130     dirs.erase(dirs.begin(), dirs.end());
00131     pos = -1;
00132 }

void MultiFiles::rewind ( void ) [inline]

Definition at line 104 of file MultiFiles.h.

References pos.

00104 {pos = -1;}

Member Data Documentation

std::vector<MultiFilesEntry> MultiFiles::dirs [protected]

Definition at line 120 of file MultiFiles.h.

Referenced by add, get, newdir, newfile, next, NumFiles, and reset.

int MultiFiles::pos [protected]

Definition at line 119 of file MultiFiles.h.

Referenced by add, get, MultiFiles, next, NumFiles, reset, and rewind.

The documentation for this class was generated from the following files:
  • common/MultiFiles.h
  • common/MultiFiles.cpp
Generated on Sun Feb 24 01:27:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


MultiFilesEntry Class Reference

#include <MultiFiles.h>

Collaboration diagram for MultiFilesEntry:

[legend]
List of all members.

Public Methods

MultiFilesEntry ()
MultiFilesEntry (const char *path)
MultiFilesEntry (const MultiFilesEntry &entries)
MultiFilesEntry & | operator= (const MultiFilesEntry &entries)
void | setdir (const char *newdir)
void | add (const char *file, const FSSpec *spec=0L)

Public Attributes

UStr dir
std::vector< FileEntry > files

Constructor & Destructor Documentation

MultiFilesEntry::MultiFilesEntry ( ) [inline]

Definition at line 70 of file MultiFiles.h.

00070 {}

MultiFilesEntry::MultiFilesEntry ( const char * path ) [inline]

Definition at line 71 of file MultiFiles.h.

References dir.

00072     {
00073         dir = path;
00074     }

MultiFilesEntry::MultiFilesEntry ( const MultiFilesEntry & entries ) [inline]

Definition at line 75 of file MultiFiles.h.

00076     {
00077         *this = entries;
00078     }

Member Function Documentation

void MultiFilesEntry::add | ( | const char * | file,
 |  | const FSSpec * | spec = 0L
 | ) |

Definition at line 51 of file MultiFiles.cpp.

References files, and UFSSpec.

Referenced by MultiFiles::newfile.

00052 {
00053     FileEntry entry(file, spec);
00054     files.push_back(entry);
00055 }

MultiFilesEntry& MultiFilesEntry::operator= ( const MultiFilesEntry & entries ) [inline]

Definition at line 80 of file MultiFiles.h.

References dir, and files.

00081     {
00082         dir = entries.dir;
00083         files = entries.files;
00084         return *this;
00085     }

void MultiFilesEntry::setdir ( const char * newdir )

Definition at line 46 of file MultiFiles.cpp.

References dir.

00047 {
00048     dir = newdir;
00049 }

Member Data Documentation

UStr MultiFilesEntry::dir

Definition at line 90 of file MultiFiles.h.

Referenced by MultiFiles::add, MultiFiles::get, MultiFilesEntry, operator=, and setdir.

std::vector<FileEntry> MultiFilesEntry::files

Definition at line 91 of file MultiFiles.h.

Referenced by MultiFiles::add, add, MultiFiles::get, MultiFiles::NumFiles, and operator=.

The documentation for this class was generated from the following files:
  • common/MultiFiles.h
  • common/MultiFiles.cpp
Generated on Sun Feb 24 01:27:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CMyShellTree Class Reference

#include <ExploreBar.h>

Inheritance diagram for CMyShellTree:

[legend]
Collaboration diagram for CMyShellTree:

[legend]
List of all members.

Protected Methods

bool | DisableCommon ()
afx_msg void | OnRclick (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnDeleteitem (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnSelchanged (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnItemexpanding (NMHDR *pNMHDR, LRESULT *pResult)

Member Function Documentation

bool CMyShellTree::DisableCommon ( ) [protected]

Definition at line 30 of file ExploreBar.cpp.

References CWincvsApp::gCvsRunning.

Referenced by OnDeleteitem, OnItemexpanding, OnRclick, and OnSelchanged.

00031 {
00032     CWincvsApp *app = (CWincvsApp *)AfxGetApp();
00033     return app->gCvsRunning || gCvsPrefs.empty();
00034 }

void CMyShellTree::OnDeleteitem | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 87 of file ExploreBar.cpp.

References DisableCommon.

00088 {
00089     if(DisableCommon())
00090     {
00091         *pResult = 1;
00092         return;
00093     }
00094
00095     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00096     // TODO: Add your control notification handler code here
00097     CCJShellTree::OnDeleteitem(pNMHDR,pResult);
00098     *pResult = 0;
00099 }

void CMyShellTree::OnItemexpanding | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 36 of file ExploreBar.cpp.

References DisableCommon.

00037 {
00038     if(DisableCommon())
00039     {
00040         *pResult = 1;
00041         return;
00042     }
00043
00044     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00045     CCJShellTree::OnItemexpanding(pNMHDR,pResult);
00046     CCJShellTree::Invalidate();
00047     *pResult = 0;
00048 }

void CMyShellTree::OnRclick | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 74 of file ExploreBar.cpp.

References DisableCommon.

00075 {
00076     if(DisableCommon())
00077     {
00078         *pResult = 1;
00079         return;
00080     }
00081
00082     // TODO: Add your control notification handler code here
00083     CCJShellTree::OnRclick(pNMHDR,pResult);
00084     *pResult = 0;
00085 }

void CMyShellTree::OnSelchanged | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 50 of file ExploreBar.cpp.

References DisableCommon, CWincvsApp::GetFileView, and CBrowseFileView::ResetView.

00051 {
00052     if(DisableCommon())
00053     {
00054         *pResult = 1;
00055         return;
00056     }
00057
00058     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00059
00060     CString szPath;
00061     CCJShellTree::OnSelchanged(pNMHDR,pResult);
00062
00063     if(CCJShellTree::GetSelectedFolderPath(szPath))
00064     {
00065         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00066         CBrowseFileView *view = app->GetFileView();
00067         if(view != 0L)
00068             view->ResetView(szPath);
00069     }
00070
00071     *pResult = 0;
00072 }

The documentation for this class was generated from the following files:
  • WinCvs/ExploreBar.h
  • WinCvs/ExploreBar.cpp
Generated on Sun Feb 24 01:27:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CNoPython Class Reference

#include <NoPython.h>

Inheritance diagram for CNoPython:

[legend]
Collaboration diagram for CNoPython:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_NOPYTHON }

Public Methods

CNoPython (CWnd *pParent=NULL)

Public Attributes

CCJHyperLink m_url
BOOL | m_remind

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
virtual BOOL | OnInitDialog ()

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 23 of file NoPython.h.

00023 { IDD = IDD_NOPYTHON };

Constructor & Destructor Documentation

CNoPython::CNoPython ( CWnd * pParent = NULL )

Definition at line 22 of file NoPython.cpp.

References m_remind, and TRUE.

00023     : CDialog(CNoPython::IDD, pParent)
00024 {
00025     //{{AFX_DATA_INIT(CNoPython)
00026     m_remind = TRUE;
00027     //}}AFX_DATA_INIT
00028 }

Member Function Documentation

void CNoPython::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 31 of file NoPython.cpp.

References IDC_PYTHONURL, IDC_REMIND, m_remind, and m_url.

00032 {
00033     CDialog::DoDataExchange(pDX);
00034     //{{AFX_DATA_MAP(CNoPython)
00035     DDX_Control(pDX, IDC_PYTHONURL, m_url);
00036     DDX_Check(pDX, IDC_REMIND, m_remind);
00037     //}}AFX_DATA_MAP
00038 }

BOOL CNoPython::OnInitDialog ( ) [protected, virtual]

Definition at line 49 of file NoPython.cpp.

References m_url, CCJHyperLink::SetURL, and TRUE.

00050 {
00051     CDialog::OnInitDialog();
00052
00053     m_url.SetURL(_T("http://www.python.org"));
00054
00055     return TRUE;  // return TRUE unless you set the focus to a control
00056                   // EXCEPTION: OCX Property Pages should return FALSE
00057 }

Member Data Documentation

BOOL CNoPython::m_remind

Definition at line 25 of file NoPython.h.

Referenced by CNoPython, DoDataExchange, and WarnNoPython.

CCJHyperLink CNoPython::m_url

Definition at line 24 of file NoPython.h.

Referenced by DoDataExchange, and OnInitDialog.

The documentation for this class was generated from the following files:
  • WinCvs/NoPython.h
  • WinCvs/NoPython.cpp
Generated on Sun Feb 24 01:27:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


NotificationManager Class Reference

#include <BrowseViewModel.h>

Collaboration diagram for NotificationManager:

[legend]
List of all members.

Public Methods

NotificationManager ()
void | CheckIn (CObject *observer, FNOBSERVER handler)
void | CheckOut (CObject *observer)
void | NotifyAll ()

Private Attributes

std::vector< Node > m_nodes

Constructor & Destructor Documentation

NotificationManager::NotificationManager ( ) [inline]

Definition at line 82 of file BrowseViewModel.h.

00082 {}

Member Function Documentation

void NotificationManager::CheckIn | ( | CObject * | observer,
 |  | FNOBSERVER | handler
 | ) | [inline]

Definition at line 87 of file BrowseViewModel.h.

References FNOBSERVER.

Referenced by CMainFrame::OnCreate, CWinCvsBrowser::OnInitialUpdate, and CBrowseFileView::OnInitialUpdate.

00088     {
00089         m_nodes.push_back(Node(observer, handler));
00090     }

void NotificationManager::CheckOut ( CObject * observer ) [inline]

Definition at line 93 of file BrowseViewModel.h.

Referenced by CWinCvsBrowser::OnDestroy, and CBrowseFileView::OnDestroy.

00094     {
00095         for (std::vector<Node>::iterator i = m_nodes.begin(); i != m_nodes.end(); i++)
00096         {
00097             if ((*i).observer == observer)
00098             {
00099                 m_nodes.erase(i);
00100                 break;
00101             }
00102         }
00103     }

void NotificationManager::NotifyAll ( ) [inline]

Definition at line 106 of file BrowseViewModel.h.

Referenced by CMainFrame::OnFilterMaskEntered, CMainFrame::OnViewAdded, CMainFrame::OnViewChanged, CMainFrame::OnViewConflict, CMainFrame::OnViewHideunknown, CMainFrame::OnViewIgnore, CMainFrame::OnViewMissing, CMainFrame::OnViewModified, CMainFrame::OnViewRecursive, CMainFrame::OnViewRemoved, CMainFrame::OnViewUnknown, and CToolbarCombo::SetText.

00107     {
00108         for (std::vector<Node>::iterator i = m_nodes.begin(); i != m_nodes.end(); i++)
00109         {
00110             // make a local copy so that observers can freely unregister during the process
00111             Node & node = *i;
00112             node.handler(node.observer);
00113         }
00114     }

Member Data Documentation

std::vector<Node> NotificationManager::m_nodes [private]

Definition at line 78 of file BrowseViewModel.h.

The documentation for this class was generated from the following file:
  • common/BrowseViewModel.h
Generated on Sun Feb 24 01:27:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


NotificationManager::Node Struct Reference

Collaboration diagram for NotificationManager::Node:

[legend]
List of all members.

Public Methods

Node ()
Node (CObject *o, FNOBSERVER h)
Node (const Node &n)
Node & operator= (const Node &n)

Public Attributes

CObject * observer
FNOBSERVER handler

Constructor & Destructor Documentation

NotificationManager::Node::Node ( ) [inline]

Definition at line 52 of file BrowseViewModel.h.

References handler, and NULL.

Referenced by Node, and operator=.

00053         : observer(NULL), handler(NULL)
00054         {}

NotificationManager::Node::Node | ( | CObject * | o,
 |  | FNOBSERVER | h
 | ) | [inline]

Definition at line 57 of file BrowseViewModel.h.

References FNOBSERVER, and handler.

00058         : observer(o), handler(h)
00059         {}

NotificationManager::Node::Node ( const Node & n ) [inline]

Definition at line 61 of file BrowseViewModel.h.

References handler, and Node.

00062         {
00063             observer = n.observer;
00064             handler = n.handler;
00065         }

Member Function Documentation

Node& NotificationManager::Node::operator= ( const Node & n ) [inline]

Definition at line 67 of file BrowseViewModel.h.

References handler, and Node.

00068         {
00069             observer = n.observer;
00070             handler = n.handler;
00071             return *this;
00072         }

Member Data Documentation

FNOBSERVER NotificationManager::Node::handler

Definition at line 48 of file BrowseViewModel.h.

Referenced by Node, and operator=.

CObject* NotificationManager::Node::observer

Definition at line 45 of file BrowseViewModel.h.

The documentation for this struct was generated from the following file:
  • common/BrowseViewModel.h
Generated on Sun Feb 24 01:27:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CObject Class Reference

Inheritance diagram for CObject:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJStatusBar.h
Generated on Sun Feb 24 01:27:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UObject Class Reference

#include <uobject.h>

Inheritance diagram for UObject:

[legend]
Collaboration diagram for UObject:

[legend]
List of all members.

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
virtual | ~UObject ()
bool | IsKindOf (const URuntimeClass *pClass) const

Static Public Methods

const URuntimeClass * | rtUObject ()
const URuntimeClass * | _GetBaseClass ()
UObject * | CreateObject (const char *className)

Protected Methods

UObject ()

Static Protected Attributes

const URuntimeClass | classUObject

Constructor & Destructor Documentation

virtual UObject::~UObject ( ) [inline, virtual]

Definition at line 93 of file uobject.h.

00093 {}

UObject::UObject ( ) [inline, protected]

Definition at line 102 of file uobject.h.

00102 {}

Member Function Documentation

const URuntimeClass * UObject::_GetBaseClass ( ) [static]

Reimplemented in UMacAppMenu.

Definition at line 33 of file uobject.cpp.

00034     { return 0L; }

UObject * UObject::CreateObject ( const char * className ) [static]

Definition at line 40 of file uobject.cpp.

References URuntimeClass::CreateObject, URuntimeClass::m_lpszClassName, URuntimeClass::m_pNextClass, and URuntimeClass::sAllURuntimeClass.

00041 {
00042     URuntimeClass *next = URuntimeClass::sAllURuntimeClass;
00043     while(next != 0L)
00044     {
00045         if(strcmp(next->m_lpszClassName, className) == 0)
00046             return next->CreateObject();
00047
00048         next = next->m_pNextClass;
00049     }
00050     return 0L;
00051 }

const URuntimeClass * UObject::GetRuntimeClass ( ) const [virtual]

Reimplemented in UMacAppMenu.

Definition at line 53 of file uobject.cpp.

References URUNTIME_CLASS.

Referenced by IsKindOf.

00054 {
00055     return URUNTIME_CLASS(UObject);
00056 }

bool UObject::IsKindOf ( const URuntimeClass * pClass ) const

Definition at line 58 of file uobject.cpp.

References GetRuntimeClass, and URuntimeClass::IsDerivedFrom.

Referenced by _loadPersistentSettings, UCvsApp::GetBrowserView, UCvsApp::GetFilesView, UWidget::HasModal, UCvsFolders::OnTreeSelecting, UDC::UDC, UEventGiveTime, UMenuAddButton, UMenuAddPulldown, and UMenuAddToggle.

00059 {
00060     // simple SI case
00061     const URuntimeClass* pClassThis = GetRuntimeClass();
00062     return pClassThis->IsDerivedFrom(pClass);
00063 }

const URuntimeClass * UObject::rtUObject ( ) [static]

Definition at line 37 of file uobject.cpp.

References classUObject.

00038     { return &UObject::classUObject; }

Member Data Documentation

const URuntimeClass UObject::classUObject [static, protected]

Referenced by rtUObject.

The documentation for this class was generated from the following files:
  • rf/uobject.h
  • rf/uobject.cpp
Generated on Sun Feb 24 01:27:03 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ColorTableEntry Struct Reference

#include <CJColorPopup.h>

Collaboration diagram for ColorTableEntry:

[legend]
List of all members.

Public Attributes

COLORREF | crColor
TCHAR * | szName

Member Data Documentation

COLORREF ColorTableEntry::crColor

Definition at line 66 of file CJColorPopup.h.

TCHAR* ColorTableEntry::szName

Definition at line 67 of file CJColorPopup.h.

The documentation for this struct was generated from the following file:
  • WinCvs/CJLib/Include/CJColorPopup.h
Generated on Sun Feb 24 01:27:03 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ControlCvsArgs Class Reference

Inheritance diagram for ControlCvsArgs:

[legend]
Collaboration diagram for ControlCvsArgs:

[legend]
List of all members.

Public Methods

ControlCvsArgs ()
virtual void | addfile (const char *arg, const char *dir=0L, const FSSpec *spec=0L)
bool | HasProblem (void) const
void | SetProblem (bool newState)

Protected Methods

virtual kTextBinTYPE | FileIsType (const char *arg, const char *dir, const FSSpec *spec=0L)=0
virtual const char * | TypeDesc ()=0

Private Attributes

bool | m_gotProblem

Constructor & Destructor Documentation

ControlCvsArgs::ControlCvsArgs ( ) [inline]

Definition at line 1102 of file CvsCommands.cpp.

References m_gotProblem.

01102 : m_gotProblem(false) { }

Member Function Documentation

void ControlCvsArgs::addfile | ( | const char * | arg,
 |  | const char * | dir = 0L,
 |  | const FSSpec * | spec = 0L
 | ) | [virtual]

Reimplemented from CvsArgs.

Definition at line 1124 of file CvsCommands.cpp.

References CvsArgs::addfile, cvs_err, cvs_out, FileIsType, ISO8559_none, kBinIsText, kBinIsUnicode, kBinWrongSig, kFileInvalidName, kFileIsAlias, kFileIsOK, kFileMissing, kTextBinTYPE, kTextEscapeChar, kTextIsBinary, kTextIsUnicode, kTextWrongLF, kTextWrongSig, kUnicodeIsBinary, kUnicodeIsText, SetProblem, TypeDesc, and UFSSpec.

01125 {
01126     CvsArgs::addfile(arg, dir, spec);
01127
01128     if(!gCvsPrefs.AddControl())
01129         return;
01130
01131 #if TARGET_RT_MAC_CFM
01132     // here a bug of MSL : it refuses to open a file beginning by
01133     // ".". So we skip this file out of the test and warn the user.
01134     if(arg[0] == '.')
01135     {
01136         cvs_out("Warning : \'%s\' cannot be verified due to a bug in MW MSL, please\n", arg);
01137         cvs_out("          verify manually \'%s\' *is* a %s file\n", arg, TypeDesc());
01138         return;
01139     }
01140 #endif
01141
01142     kTextBinTYPE state = FileIsType(arg, dir, spec);
01143     switch(state)
01144     {
01145     case kFileIsOK:
01146         break;
01147     case kFileMissing:
01148         // we can resurect a file which is missing by re-adding it
01149         break;
01150     case kFileIsAlias:
01151         cvs_err("Warning : \'%s\' is an alias\n", arg);
01152         SetProblem(true);
01153         break;
01154     case kFileInvalidName:
01155         cvs_err("Warning : \'%s\' has an invalid name\n", arg);
01156         SetProblem(true);
01157         break;
01158     case kTextWrongLF:
01159         cvs_err("Warning : \'%s\' seems to have the wrong line feed for this machine, you should correct it first\n", arg);
01160         SetProblem(true);
01161         break;
01162     case kUnicodeIsBinary: // fall thru intentional
01163     case kTextIsBinary:
01164         cvs_err("Warning : \'%s\' seems to be \'binary\', you should use the \'Add binary\' command instead...\n", arg);
01165         SetProblem(true);
01166         break;
01167     case kTextEscapeChar:
01168 #ifdef macintosh
01169         if(gCvsPrefs.IsoConvert() == ISO8559_none)
01170         {
01171             cvs_err("Warning : \'%s\' has some escape characters in it (0x00-0x20, 0x80-0xFF),\n", arg);
01172             cvs_err("Warning   so you may need to have the ISO8559 translation option set in the preferences\n");
01173             cvs_err("Warning   before commiting\n");
01174         }
01175 #else /* !macintosh */
01176         cvs_err("Warning : \'%s\' has some escape characters in it (0x00-0x20, 0x80-0xFF), you should correct it first\n", arg);
01177 #endif /* !macintosh */
01178         break;
01179     case kTextWrongSig:
01180         cvs_err("Warning : \'%s\' has a file type different from \'TEXT\', you should correct it first\n", arg);
01181         SetProblem(true);
01182         break;
01183     case kUnicodeIsText: // fall thru intentional
01184     case kBinIsText:
01185         cvs_err("Warning : \'%s\' seems to be a text file, you should consider to use the \'Add selection\' command instead\n", arg);
01186         SetProblem(true);
01187         break;
01188     case kBinWrongSig:
01189         cvs_err("Warning : \'%s\' has a file type of \'TEXT\', you should correct it first\n", arg);
01190         SetProblem(true);
01191         break;
01192     case kTextIsUnicode: // fall thru intentional
01193     case kBinIsUnicode:
01194         cvs_err("Warning : \'%s\' seems to be an Unicode file, you should consider to use the \'Add unicode\' command instead\n", arg);
01195         SetProblem(true);
01196         break;
01197     default:
01198         cvs_err("Warning : \'%s\' has some unknown problems\n", arg);
01199         SetProblem(true);
01200         break;
01201     }
01202 }

virtual kTextBinTYPE ControlCvsArgs::FileIsType | ( | const char * | arg,
 |  | const char * | dir,
 |  | const FSSpec * | spec = 0L
 | ) | [protected, pure virtual]

Implemented in AddCvsArgs.

Referenced by addfile.

bool ControlCvsArgs::HasProblem ( void ) const [inline]

Definition at line 1106 of file CvsCommands.cpp.

References m_gotProblem.

Referenced by CvsCmdAddBinaryFiles, CvsCmdAddFiles, and CvsCmdAddUnicodeFiles.

01107     {
01108         return m_gotProblem;
01109     }

void ControlCvsArgs::SetProblem ( bool newState ) [inline]

Definition at line 1111 of file CvsCommands.cpp.

References m_gotProblem.

Referenced by addfile.

01112     {
01113         m_gotProblem = newState;
01114     }

virtual const char* ControlCvsArgs::TypeDesc ( ) [protected, pure virtual]

Implemented in AddCvsArgs.

Referenced by addfile.

Member Data Documentation

bool ControlCvsArgs::m_gotProblem [private]

Definition at line 1121 of file CvsCommands.cpp.

Referenced by ControlCvsArgs, HasProblem, and SetProblem.

The documentation for this class was generated from the following file:
  • common/CvsCommands.cpp
Generated on Sun Feb 24 01:27:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


option Struct Reference

#include <getopt.h>

Collaboration diagram for option:

[legend]
List of all members.

Public Attributes

const char * | name
int | has_arg
int * | flag
int | val

Member Data Documentation

int* option::flag

Definition at line 89 of file getopt.h.

Referenced by _getopt_internal.

int option::has_arg

Definition at line 88 of file getopt.h.

Referenced by _getopt_internal.

const char* option::name

Definition at line 82 of file getopt.h.

Referenced by _getopt_internal.

int option::val

Definition at line 90 of file getopt.h.

Referenced by _getopt_internal.

The documentation for this struct was generated from the following file:
  • common/getopt.h
Generated on Sun Feb 24 01:27:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


COptionalPropertySheet Class Reference

#include <OptionalPropertySheet.h>

Inheritance diagram for COptionalPropertySheet:

[legend]
Collaboration diagram for COptionalPropertySheet:

[legend]
List of all members.

Public Methods

COptionalPropertySheet (bool bOptionChecked, UINT nIDCaption, CWnd *pParentWnd=NULL, UINT iSelectPage=0)
COptionalPropertySheet (bool bOptionChecked, LPCTSTR pszCaption, CWnd *pParentWnd=NULL, UINT iSelectPage=0)
virtual int | DoModal ()
virtual | ~COptionalPropertySheet ()
bool | GetHideCommandDlg ()

Protected Methods

virtual BOOL | OnCommand (WPARAM wParam, LPARAM lParam)
virtual BOOL | OnInitDialog ()

Protected Attributes

bool | m_bOptionChecked
CButton m_optionCheck

Constructor & Destructor Documentation

COptionalPropertySheet::COptionalPropertySheet | ( | bool | bOptionChecked,
 |  | UINT | nIDCaption,
 |  | CWnd * | pParentWnd = NULL,
 |  | UINT | iSelectPage = 0
 | ) |

Definition at line 41 of file OptionalPropertySheet.cpp.

References m_bOptionChecked.

00042     :CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
00043 {
00044     m_bOptionChecked = bOptionChecked;
00045 }

COptionalPropertySheet::COptionalPropertySheet | ( | bool | bOptionChecked,
 |  | LPCTSTR | pszCaption,
 |  | CWnd * | pParentWnd = NULL,
 |  | UINT | iSelectPage = 0
 | ) |

Definition at line 47 of file OptionalPropertySheet.cpp.

References m_bOptionChecked.

00048     :CPropertySheet(pszCaption, pParentWnd, iSelectPage)
00049 {
00050     m_bOptionChecked = bOptionChecked;
00051 }

COptionalPropertySheet::~COptionalPropertySheet ( ) [virtual]

Definition at line 53 of file OptionalPropertySheet.cpp.

00054 {
00055 }

Member Function Documentation

int COptionalPropertySheet::DoModal ( ) [virtual]

Definition at line 95 of file OptionalPropertySheet.cpp.

Referenced by CompatGetAnnotate, CompatGetDiff, CompatGetLog, and CompatGetUpdate.

00096 {
00097     bool bDisplayDlg = true;
00098
00099     // See if the option flag is set
00100     //m_bOptionChecked = !!AfxGetApp()->GetProfileInt(PROFILE_NAME, m_psh.pszCaption, (int)false);
00101
00102     if (m_bOptionChecked)
00103     {
00104         // See if the ctrl key is down
00105         bDisplayDlg = (::GetKeyState(gCvsPrefs.HideCommandDlgUseShift() ? VK_SHIFT : VK_CONTROL) < 0);
00106     }
00107
00108     if (bDisplayDlg)
00109         return CPropertySheet::DoModal();
00110     else
00111         return IDOK;
00112 }

bool COptionalPropertySheet::GetHideCommandDlg ( )

Definition at line 126 of file OptionalPropertySheet.cpp.

References m_bOptionChecked.

Referenced by CompatGetAnnotate, CompatGetDiff, CompatGetLog, and CompatGetUpdate.

00127 {
00128     return m_bOptionChecked;
00129 }

BOOL COptionalPropertySheet::OnCommand | ( | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [protected, virtual]

Definition at line 114 of file OptionalPropertySheet.cpp.

References m_bOptionChecked, and m_optionCheck.

00115 {
00116     if (wParam == IDOK)
00117     {
00118         // Save the check state of the display option
00119         m_bOptionChecked = (m_optionCheck.GetCheck() == 1);
00120         //AfxGetApp()->WriteProfileInt(PROFILE_NAME, m_psh.pszCaption, bChecked);
00121     }
00122
00123     return CPropertySheet::OnCommand(wParam, lParam);
00124 }

BOOL COptionalPropertySheet::OnInitDialog ( ) [protected, virtual]

Definition at line 66 of file OptionalPropertySheet.cpp.

References m_bOptionChecked, m_optionCheck, and TRUE.

00067 {
00068     CPropertySheet::OnInitDialog();
00069
00070     // Add the option check box
00071     CRect rectWnd;
00072     GetClientRect(rectWnd);
00073
00074     rectWnd.bottom -= 13;
00075     rectWnd.left   += 7;
00076     rectWnd.top     = rectWnd.bottom - 12;
00077     rectWnd.right   = rectWnd.left   + 180;
00078
00079     CString strOptionText;
00080     strOptionText.Format(_T("Display only if %s key is down"),
00081         gCvsPrefs.HideCommandDlgUseShift() ? "Shift" : "Ctrl");
00082     m_optionCheck.Create(strOptionText,
00083         WS_CHILD|WS_VISIBLE|BS_AUTOCHECKBOX|WS_TABSTOP,
00084         rectWnd, this, 4);
00085
00086     m_optionCheck.SetFont( GetFont() );
00087
00088     // Set the checkbox
00089     m_optionCheck.SetCheck(m_bOptionChecked);
00090
00091     return TRUE;  // return TRUE unless you set the focus to a control
00092     // EXCEPTION: OCX Property Pages should return FALSE
00093 }

Member Data Documentation

bool COptionalPropertySheet::m_bOptionChecked [protected]

Definition at line 68 of file OptionalPropertySheet.h.

Referenced by COptionalPropertySheet, GetHideCommandDlg, OnCommand, and OnInitDialog.

CButton COptionalPropertySheet::m_optionCheck [protected]

Definition at line 69 of file OptionalPropertySheet.h.

Referenced by OnCommand, and OnInitDialog.

The documentation for this class was generated from the following files:
  • common/OptionalPropertySheet.h
  • common/OptionalPropertySheet.cpp
Generated on Sun Feb 24 01:27:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


OUTBAR_INFO Struct Reference

#include <GfxOutBarCtrl.h>

Collaboration diagram for OUTBAR_INFO:

[legend]
List of all members.

Public Attributes

int | index
int | iDragFrom
int | iDragTo
LPCTSTR | cText

Member Data Documentation

LPCTSTR OUTBAR_INFO::cText

Definition at line 56 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl::OnEndLabelEdit.

int OUTBAR_INFO::iDragFrom

Definition at line 53 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl::OnLButtonDown.

int OUTBAR_INFO::iDragTo

Definition at line 54 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl::OnLButtonDown.

int OUTBAR_INFO::index

Definition at line 52 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl::OnEndLabelEdit.

The documentation for this struct was generated from the following file:
  • WinCvs/CJLib/Include/GfxOutBarCtrl.h
Generated on Sun Feb 24 01:27:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PCPStr Class Reference

#include <CPStr.h>

Inheritance diagram for PCPStr:

[legend]
Collaboration diagram for PCPStr:

[legend]
List of all members.

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
PCPStr (const char *uniqueName, const char *defValue=0L, kClassPersistent pclass=kNoClass)
virtual | ~PCPStr ()
virtual unsigned int | SizeOf (void) const
virtual const void * | GetData (void) const
virtual void | SetData (const void *ptr, unsigned int size)
operator const unsigned char * () const
as a P string. More...

operator unsigned char * ()
as a P string. More...

operator const char * () const
as a C string. More...

operator char * ()
as a C string. More...

const char * | operator= (const char *newstr)
set to a new C String (0L is OK). More...

const unsigned char * | operator= (const unsigned char *newstr)
set to a new P String (0L is OK). More...

Static Public Methods

const URuntimeClass * | rtPCPStr (void)

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()

Static Protected Attributes

const URuntimeClass | classPCPStr

Constructor & Destructor Documentation

PCPStr::PCPStr | ( | const char * | uniqueName,
 |  | const char * | defValue = 0L,
 |  | kClassPersistent | pclass = kNoClass
 | ) | [inline]

Definition at line 43 of file CPStr.h.

References CPStr, kClassPersistent, and kNoClass.

00043                                                                                                   : CPStr(),
00044         CPersistent(uniqueName, pclass)
00045     {
00046         if(defValue != 0L)
00047             *(CPStr *)this = defValue;
00048     }

virtual PCPStr::~PCPStr ( ) [inline, virtual]

Definition at line 49 of file CPStr.h.

00050     {
00051     }

Member Function Documentation

const URuntimeClass * PCPStr::_GetBaseClass ( ) [static, protected]

Reimplemented from CPersistent.

Definition at line 101 of file Persistent.cpp.

virtual const void* PCPStr::GetData ( void ) const [inline, virtual]

Implements CPersistent.

Definition at line 58 of file CPStr.h.

References CPStr.

00059     {
00060         const void *res = (const char *)(*(CPStr *)this);
00061         return res == 0L ? "" : res;
00062     }

const URuntimeClass * PCPStr::GetRuntimeClass ( ) const [virtual]

Reimplemented from CPersistent.

Definition at line 101 of file Persistent.cpp.

PCPStr::operator char * ( ) [inline]

as a C string.

Reimplemented from UPStr.

Definition at line 77 of file CPStr.h.

References CPStr, and EGCS_CONST.

00077 { return *(CPStr *)this; }

PCPStr::operator const char * ( ) const [inline]

as a C string.

Reimplemented from UPStr.

Definition at line 76 of file CPStr.h.

References CPStr.

00076 { return *(CPStr *)this; }

PCPStr::operator const unsigned char * ( ) const [inline]

as a P string.

Reimplemented from UPStr.

Definition at line 70 of file CPStr.h.

References CPStr.

00071         { return *(CPStr *)this; }

PCPStr::operator unsigned char * ( ) [inline]

as a P string.

Reimplemented from UPStr.

Definition at line 72 of file CPStr.h.

References CPStr, and EGCS_CONST.

00073         { return *(CPStr *)this; }

const unsigned char* PCPStr::operator= ( const unsigned char * newstr ) [inline]

set to a new P String (0L is OK).

Reimplemented from UPStr.

Definition at line 83 of file CPStr.h.

References CPStr.

00084         { return ((CPStr *)this)->operator=(newstr); }

const char* PCPStr::operator= ( const char * newstr ) [inline]

set to a new C String (0L is OK).

Reimplemented from UPStr.

Definition at line 80 of file CPStr.h.

References CPStr.

00081         { return ((CPStr *)this)->operator=(newstr); }

const URuntimeClass * PCPStr::rtPCPStr ( void ) [static]

Definition at line 101 of file Persistent.cpp.

virtual void PCPStr::SetData | ( | const void * | ptr,
 |  | unsigned int | size
 | ) | [inline, virtual]

Implements CPersistent.

Definition at line 64 of file CPStr.h.

References CPStr.

00065     {
00066         if(strlen((const char *)ptr) == (size - 1))
00067             *(CPStr *)this = (const char *)ptr;
00068     }

virtual unsigned int PCPStr::SizeOf ( void ) const [inline, virtual]

Implements CPersistent.

Definition at line 53 of file CPStr.h.

References UPStr::length, and UPStr::str.

00054     {
00055         return str != 0L ? length() + 1 : 1;
00056     }

Member Data Documentation

const URuntimeClass PCPStr::classPCPStr [static, protected]

The documentation for this class was generated from the following files:
  • common/CPStr.h
  • common/Persistent.cpp
Generated on Sun Feb 24 01:27:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PCStr Class Reference

#include <CPStr.h>

Inheritance diagram for PCStr:

[legend]
Collaboration diagram for PCStr:

[legend]
List of all members.

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
PCStr (const char *uniqueName, const char *defValue=0L, kClassPersistent pclass=kNoClass)
virtual | ~PCStr ()
virtual unsigned int | SizeOf (void) const
virtual const void * | GetData (void) const
virtual void | SetData (const void *ptr, unsigned int size)
operator const char * () const
as a C string. More...

operator char * ()
as a C string. More...

const char * | operator= (const char *newstr)
set from a C String (0L is OK). More...

const char * | operator= (const unsigned char *newstr)
set from a P String (0L is OK). More...

Static Public Methods

const URuntimeClass * | rtPCStr (void)

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()

Static Protected Attributes

const URuntimeClass | classPCStr

Constructor & Destructor Documentation

PCStr::PCStr | ( | const char * | uniqueName,
 |  | const char * | defValue = 0L,
 |  | kClassPersistent | pclass = kNoClass
 | ) | [inline]

Definition at line 92 of file CPStr.h.

References CStr, kClassPersistent, and kNoClass.

00092                                                                                                  : CStr(),
00093         CPersistent(uniqueName, pclass)
00094     {
00095         if(defValue != 0L)
00096             *(CStr *)this = defValue;
00097     }

virtual PCStr::~PCStr ( ) [inline, virtual]

Definition at line 98 of file CPStr.h.

00099     {
00100     }

Member Function Documentation

const URuntimeClass * PCStr::_GetBaseClass ( ) [static, protected]

Reimplemented from CPersistent.

Definition at line 100 of file Persistent.cpp.

virtual const void* PCStr::GetData ( void ) const [inline, virtual]

Implements CPersistent.

Definition at line 107 of file CPStr.h.

References CStr.

00108     {
00109         const void *res = (const char *)(*(CStr *)this);
00110         return res == 0L ? "" : res;
00111     }

const URuntimeClass * PCStr::GetRuntimeClass ( ) const [virtual]

Reimplemented from CPersistent.

Definition at line 100 of file Persistent.cpp.

PCStr::operator char * ( ) [inline]

as a C string.

Reimplemented from UStr.

Definition at line 120 of file CPStr.h.

References CStr, and EGCS_CONST.

00120 { return *(CStr *)this; }

PCStr::operator const char * ( ) const [inline]

as a C string.

Reimplemented from UStr.

Definition at line 119 of file CPStr.h.

References CStr.

00119 { return *(CStr *)this; }

const char* PCStr::operator= ( const unsigned char * newstr ) [inline]

set from a P String (0L is OK).

Reimplemented from UStr.

Definition at line 129 of file CPStr.h.

References CStr, and CPersistent::TouchTimeStamp.

00130     {
00131         TouchTimeStamp();
00132         return ((CStr *)this)->operator=(newstr);
00133     }

const char* PCStr::operator= ( const char * newstr ) [inline]

set from a C String (0L is OK).

Reimplemented from UStr.

Definition at line 123 of file CPStr.h.

References CStr, and CPersistent::TouchTimeStamp.

00124     {
00125         TouchTimeStamp();
00126         return ((CStr *)this)->operator=(newstr);
00127     }

const URuntimeClass * PCStr::rtPCStr ( void ) [static]

Definition at line 100 of file Persistent.cpp.

virtual void PCStr::SetData | ( | const void * | ptr,
 |  | unsigned int | size
 | ) | [inline, virtual]

Implements CPersistent.

Definition at line 113 of file CPStr.h.

References CStr.

00114     {
00115         if(strlen((const char *)ptr) == (size - 1))
00116             *(CStr *)this = (const char *)ptr;
00117     }

virtual unsigned int PCStr::SizeOf ( void ) const [inline, virtual]

Implements CPersistent.

Definition at line 102 of file CPStr.h.

References UStr::length, and UStr::str.

00103     {
00104         return str != 0L ? length() + 1 : 0;
00105     }

Member Data Documentation

const URuntimeClass PCStr::classPCStr [static, protected]

The documentation for this class was generated from the following files:
  • common/CPStr.h
  • common/Persistent.cpp
Generated on Sun Feb 24 01:27:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UPen Class Reference

#include <udraw.h>

Collaboration diagram for UPen:

[legend]
List of all members.

Public Methods

UPen ()
~UPen ()
bool | DeleteObject (void)
bool | CreatePen (int nPenStyle, int nWidth, UCOLORREF crColor)

Protected Attributes

int | m_width
int | m_style

Friends

class | UDC

Constructor & Destructor Documentation

UPen::UPen ( )

Definition at line 382 of file udraw.cpp.

00384     : m_set(false)
00385 #endif
00386 {
00387 }

UPen::~UPen ( )

Definition at line 389 of file udraw.cpp.

References DeleteObject.

00390 {
00391     DeleteObject();
00392 }

Member Function Documentation

bool UPen::CreatePen | ( | int | nPenStyle,
 |  | int | nWidth,
 |  | UCOLORREF | crColor
 | ) |

Definition at line 414 of file udraw.cpp.

References DeleteObject, m_style, m_width, UCOLORREF, UGetBValue, UGetGValue, and UGetRValue.

Referenced by DrawNode, and CWinLogData::Update.

00415 {
00416     bool res = false;
00417
00418     m_width = nWidth;
00419     m_style = nPenStyle;
00420
00421 #if qGTK
00422     DeleteObject();
00423     GdkColormap *cmap = gdk_colormap_get_system();
00424     if(cmap != 0L)
00425     {
00426         m_col.red = UGetRValue(crColor) << 8;
00427         m_col.green = UGetGValue(crColor) << 8;
00428         m_col.blue = UGetBValue(crColor) << 8;
00429         if(gdk_color_alloc(cmap, &m_col))
00430             m_set = true;
00431     }
00432     res = m_set;
00433 #endif
00434     return res;
00435 }

bool UPen::DeleteObject ( void )

Definition at line 394 of file udraw.cpp.

Referenced by CreatePen, DrawNode, CWinLogData::Update, and ~UPen.

00395 {
00396     bool res = false;
00397 #if qGTK
00398     if(m_set)
00399     {
00400         m_set = false;
00401         GdkColormap *cmap = gdk_colormap_get_system();
00402         if(cmap != 0L)
00403         {
00404             gdk_colormap_free_colors(cmap, &m_col, 1);
00405             res = true;
00406         }
00407     }
00408     else
00409         res = true;
00410 #endif
00411     return res;
00412 }

Friends And Related Function Documentation

friend class UDC [friend]

Definition at line 479 of file udraw.h.

Member Data Documentation

int UPen::m_style [protected]

Definition at line 473 of file udraw.h.

Referenced by CreatePen.

int UPen::m_width [protected]

Definition at line 472 of file udraw.h.

Referenced by CreatePen.

The documentation for this class was generated from the following files:
  • rf/udraw.h
  • rf/udraw.cpp
Generated on Sun Feb 24 01:27:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CPersistent Class Reference

#include <Persistent.h>

Inheritance diagram for CPersistent:

[legend]
Collaboration diagram for CPersistent:

[legend]
List of all members.

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
CPersistent (const char *uniqueName, kClassPersistent pclass)
virtual | ~CPersistent ()
virtual unsigned int | SizeOf (void) const=0L
virtual const void * | GetData (void) const=0L
virtual void | SetData (const void *ptr, unsigned int size)=0L
void | ResetTimeStamp ()
long | GetTimeStamp () const
void | TouchTimeStamp ()

Static Public Methods

const URuntimeClass * | rtCPersistent (void)
void | SaveAll (void)
bool | LoadAll (void)
bool | SaveAllSettings (const char *settingFileName, const char *forPath)
CPersistentEntry * | Find (const char *uniqueName)
bool | NeedSave (bool onlySettings=false)

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()

Protected Attributes

long | fTimeStamp

Static Protected Attributes

const URuntimeClass | classCPersistent
std::vector< CPersistentEntry > * | fAllEntries = 0L

Static Private Methods

void | Register (CPersistent *value, const char *uniqueName, kClassPersistent pclass)
void | UnRegister (CPersistent *value)

Constructor & Destructor Documentation

CPersistent::CPersistent | ( | const char * | uniqueName,
 |  | kClassPersistent | pclass
 | ) |

Definition at line 103 of file Persistent.cpp.

References kClassPersistent, Register, and TouchTimeStamp.

00103                                                                         : fTimeStamp(0)
00104 {
00105     Register(this, uniqueName, pclass);
00106     TouchTimeStamp();
00107 }

CPersistent::~CPersistent ( ) [virtual]

Definition at line 109 of file Persistent.cpp.

References UnRegister.

00110 {
00111     UnRegister(this);
00112 }

Member Function Documentation

const URuntimeClass * CPersistent::_GetBaseClass ( ) [static, protected]

Reimplemented from UObject.

Reimplemented in PCPStr.

Definition at line 97 of file Persistent.cpp.

CPersistent::CPersistentEntry * CPersistent::Find ( const char * uniqueName ) [static]

Definition at line 633 of file Persistent.cpp.

References fAllEntries.

Referenced by _loadPersistentSettings, and LoadAll.

00634 {
00635     std::vector<CPersistentEntry>::iterator i;
00636     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00637     {
00638         CPersistentEntry & entry = *i;
00639         if(!strcmp(uniqueName, entry.fUniqueName))
00640             return &entry;
00641     }
00642     return 0L;
00643 }

virtual const void* CPersistent::GetData ( void ) const [pure virtual]

Implemented in PCPStr.

const URuntimeClass * CPersistent::GetRuntimeClass ( ) const [virtual]

Reimplemented from UObject.

Reimplemented in PCPStr.

Definition at line 97 of file Persistent.cpp.

long CPersistent::GetTimeStamp ( ) const [inline]

Definition at line 73 of file Persistent.h.

References fTimeStamp.

00073 { return fTimeStamp; }

bool CPersistent::LoadAll ( void ) [static]

Definition at line 472 of file Persistent.cpp.

References CStaticAllocT::AdjustSize, CPStr, CStr, cvs_err, err, fAllEntries, Find, FSSpec, NULL, NUM_CVSROOT, and PROFILE_NAME.

Referenced by CvsPrefs::load.

00473 {
00474 #ifdef macintosh
00475     FSSpec thePrefFile;
00476     short FRef, oldRef;
00477     Handle hdl;
00478     OSErr err;
00479
00480 #if TARGET_RT_MAC_CFM
00481     err = GetPreferencesFile(thePrefFile);
00482 #else
00483     FSRef thePrefRef;
00484     err = GetPreferencesFile(thePrefRef);
00485     if(err == noErr)
00486         err = FSGetCatalogInfo(&thePrefRef, kFSCatInfoNone, NULL, NULL, &thePrefFile, NULL);
00487 #endif
00488     if(err != noErr)
00489         return false;
00490
00491     oldRef = CurResFile();
00492     FRef = FSpOpenResFile(&thePrefFile, fsRdPerm);
00493     if(FRef < 0)
00494         return false;
00495
00496     CPStr name;
00497     UseResFile(FRef);
00498
00499     std::vector<CPersistentEntry>::iterator i;
00500     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00501     {
00502         CPersistentEntry & entry = *i;
00503         name = entry.fUniqueName;
00504
00505         Handle hdl = Get1NamedResource(kCVS_prefID, name);
00506         if(hdl == 0L)
00507             continue;
00508
00509         HLock(hdl);
00510         entry.fValue->SetData(*hdl, GetHandleSize(hdl));
00511         entry.fValue->ResetTimeStamp();
00512         HUnlock(hdl);
00513     }
00514
00515     // migrate to the new gOldCvsroots container
00516     if(gOldCvsroots.GetList().size() == 0)
00517     {
00518         for(int nIndex = 0; nIndex <= NUM_CVSROOT; nIndex++)
00519         {
00520             char tmp[20];
00521             sprintf(tmp, "P_Cvsroot%d", nIndex);
00522
00523             CPStr pstr(tmp);
00524             Handle hdl = Get1NamedResource(kCVS_prefID, pstr);
00525             if(hdl == 0L)
00526                 continue;
00527
00528             CStr root((char *)*hdl);
00529             if( !root.empty() )
00530                 gOldCvsroots.Insert(root);
00531         }
00532     }
00533
00534     CloseResFile (FRef);
00535     UseResFile(oldRef);
00536     return true;
00537 #endif /* macintosh */
00538 #ifdef WIN32
00539     bool found_one = false;
00540     std::vector<CPersistentEntry>::iterator i;
00541     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00542     {
00543         CPersistentEntry & entry = *i;
00544         BYTE* ppData;
00545         UINT pBytes;
00546
00547         if(!AfxGetApp()->GetProfileBinary(PROFILE_NAME, entry.fUniqueName,
00548             &ppData, &pBytes))
00549         {
00550             continue;
00551         }
00552         found_one = true;
00553         entry.fValue->SetData(ppData, pBytes);
00554         entry.fValue->ResetTimeStamp();
00555         delete ppData;
00556     }
00557     return found_one;
00558 #endif /* WIN32 */
00559 #ifdef qUnix
00560     CStr home;
00561     home = gCvsPrefs.Home();
00562     if(!home.endsWith(kPathDelimiter))
00563         home << kPathDelimiter;
00564     home << ".gcvsrc";
00565     FILE *out = fopen(home, "rb");
00566     if(out == 0L)
00567         return false;
00568
00569     int version;
00570     int numEntries;
00571     CStaticAllocT<char> alloc;
00572
00573     fread(&version, sizeof(int), 1, out);
00574     if(version != 1)
00575     {
00576         cvs_err("Unexpected version %d in the file '%s'\n", version, (char *)home);
00577         goto close;
00578     }
00579     fread(&numEntries, sizeof(int), 1, out);
00580     if(numEntries < 0)
00581     {
00582         cvs_err("Unexpected # %d in the file '%s'\n", numEntries, (char *)home);
00583         goto close;
00584     }
00585     for(int i = 0; i < numEntries; i++)
00586     {
00587         CStr name;
00588         while(!feof(out) && !ferror(out))
00589         {
00590             int c = getc(out);
00591             name << (char)c;
00592             if(c == '\0')
00593                 break;
00594         }
00595         if(feof(out))
00596         {
00597             cvs_err("Unexpected end of file in '%s'\n", (char *)home);
00598             goto close;
00599         }
00600         if(ferror(out))
00601         {
00602             cvs_err("Unexpected error %d in '%s'\n", errno, (char *)home);
00603             goto close;
00604         }
00605         CPersistentEntry * entry = CPersistent::Find(name);
00606         if(entry == 0L)
00607         {
00608             cvs_err("Unexpected token '%s' in '%s'\n", (char *)name, (char *)home);
00609         }
00610
00611         unsigned int size;
00612         fread(&size, sizeof(unsigned int), 1, out);
00613
00614         alloc.AdjustSize(size);
00615         fread((char *)alloc, 1, size, out);
00616         if(entry != 0L)
00617         {
00618             entry->fValue->SetData((char *)alloc, size);
00619             entry->fValue->ResetTimeStamp();
00620         }
00621     }
00622
00623     if(ferror(out))
00624         cvs_err("Error while reading '%s' (error %d)", (char *)home, errno);
00625     fclose(out);
00626     return true;
00627 close:
00628     fclose(out);
00629 #endif /* qUnix */
00630     return false;
00631 }

bool CPersistent::NeedSave ( bool onlySettings = false ) [static]

Definition at line 645 of file Persistent.cpp.

References fAllEntries, and kAddSettings.

Referenced by CvsPrefs::save.

00646 {
00647     std::vector<CPersistentEntry>::const_iterator i;
00648     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00649     {
00650         const CPersistentEntry & entry = *i;
00651         if(onlySettings && (entry.fClass & kAddSettings) == 0)
00652             continue;
00653
00654         if(entry.fValue->fTimeStamp != 0)
00655             return true;
00656     }
00657     return false;
00658 }

void CPersistent::Register | ( | CPersistent * | value,
 |  | const char * | uniqueName,
 |  | kClassPersistent | pclass
 | ) | [static, private]

Definition at line 114 of file Persistent.cpp.

References fAllEntries, kClassPersistent, NEW, and UAppConsole.

Referenced by CPersistent.

00115 {
00116     std::vector<CPersistentEntry>::const_iterator i;
00117     if(fAllEntries == 0L)
00118         fAllEntries = NEW std::vector<CPersistentEntry>;
00119     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00120     {
00121         if(strcmp(uniqueName, (*i).fUniqueName) == 0)
00122         {
00123             UAppConsole("Error : duplicate persistent %s !\n", uniqueName);
00124         }
00125     }
00126     CPersistentEntry newentry;
00127     newentry.fClass = pclass;
00128     newentry.fUniqueName = uniqueName;
00129     newentry.fValue = value;
00130     fAllEntries->push_back(newentry);
00131 }

void CPersistent::ResetTimeStamp ( ) [inline]

Definition at line 72 of file Persistent.h.

References fTimeStamp.

00072 { fTimeStamp = 0; }

const URuntimeClass * CPersistent::rtCPersistent ( void ) [static]

Definition at line 97 of file Persistent.cpp.

void CPersistent::SaveAll ( void ) [static]

Definition at line 332 of file Persistent.cpp.

References CPStr, CStr, cvs_err, err, fAllEntries, FSSpec, NULL, and PROFILE_NAME.

Referenced by CvsPrefs::save.

00333 {
00334 #ifdef macintosh
00335     short FRef, oldRef;
00336     Handle hdl;
00337     OSErr err;
00338     FSSpec thePrefFile;
00339
00340 #if TARGET_RT_MAC_CFM
00341     err = GetPreferencesFile(thePrefFile);
00342 #else
00343     FSRef thePrefRef;
00344     err = GetPreferencesFile(thePrefRef);
00345     if(err == noErr)
00346         err = FSGetCatalogInfo(&thePrefRef, kFSCatInfoNone, NULL, NULL, &thePrefFile, NULL);
00347 #endif
00348     if(err != noErr)
00349     {
00350         cvs_err("Error while searching preference folder (error %d)!\n", err);
00351         return;
00352     }
00353
00354     oldRef = CurResFile();
00355
00356     FRef = FSpOpenResFile(&thePrefFile, fsRdWrPerm);
00357     if(FRef < 0)
00358     {
00359         ::FSpCreateResFile (&thePrefFile, 'mCVS', 'pref', smRoman);
00360         FRef = FSpOpenResFile(&thePrefFile, fsRdWrPerm);
00361         if(FRef < 0)
00362         {
00363             cvs_err("Error while saving preferences (error %d)!\n", ResError());
00364             return;
00365         }
00366     }
00367
00368     UseResFile (FRef);
00369     CPStr name;
00370
00371     std::vector<CPersistentEntry>::iterator i;
00372     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00373     {
00374         CPersistentEntry & entry = *i;
00375         int size = entry.fValue->SizeOf();
00376         if(size <= 0)
00377             continue;
00378
00379         //short id = Unique1ID(kCVS_prefID);
00380         name = entry.fUniqueName;
00381
00382         Handle removing = Get1NamedResource(kCVS_prefID, name);
00383
00384         if (removing != nil)
00385         {
00386             RemoveResource(removing);
00387             Assert_(ResError() == noErr);
00388             DisposeHandle(removing);
00389         }
00390
00391         short theID;
00392         do
00393         {
00394             theID = Unique1ID(kCVS_prefID);
00395         }
00396         while (theID <= 127);
00397
00398         Handle hdl = NewHandle(size);
00399         Assert_(hdl != 0L);
00400         HLock(hdl);
00401         BlockMove(entry.fValue->GetData(), *hdl, size);
00402         HUnlock(hdl);
00403         AddResource(hdl, kCVS_prefID, theID, name);
00404         Assert_(ResError() == noErr);
00405         UpdateResFile(FRef);
00406         Assert_(ResError() == noErr);
00407         ReleaseResource(hdl);
00408         Assert_(ResError() == noErr);
00409     }
00410
00411     UseResFile(oldRef);
00412     Assert_(ResError() == noErr);
00413     CloseResFile (FRef);
00414     Assert_(ResError() == noErr);
00415 #endif /* macintosh */
00416 #ifdef WIN32
00417     std::vector<CPersistentEntry>::iterator i;
00418     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00419     {
00420         CPersistentEntry & entry = *i;
00421         unsigned int size = entry.fValue->SizeOf();
00422         if(size == 0)
00423             continue;
00424
00425         if(!AfxGetApp()->WriteProfileBinary(PROFILE_NAME, entry.fUniqueName,
00426             (BYTE *)entry.fValue->GetData(), size))
00427         {
00428             cvs_err("Error while saving preferences !\n");
00429             break;
00430         }
00431     }
00432 #endif /* WIN32 */
00433 #ifdef qUnix
00434     CStr home;
00435     home = gCvsPrefs.Home();
00436     if(!home.endsWith(kPathDelimiter))
00437         home << kPathDelimiter;
00438     home << ".gcvsrc";
00439     FILE *out = fopen(home, "wb");
00440     if(out == 0L)
00441     {
00442         cvs_err("Unable to open '%s' for writing (error %d)", (char *)home, errno);
00443         return;
00444     }
00445     int version = 1;
00446     fwrite(&version, sizeof(int), 1, out);
00447     int numEntries = fAllEntries->size();
00448     fwrite(&numEntries, sizeof(int), 1, out);
00449     std::vector<CPersistentEntry>::iterator i;
00450     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00451     {
00452         CPersistentEntry & entry = *i;
00453         unsigned int size = entry.fValue->SizeOf();
00454
00455         fwrite(entry.fUniqueName, sizeof(char), strlen(entry.fUniqueName) + 1, out);
00456         fwrite(&size, sizeof(unsigned int), 1, out);
00457         fwrite(entry.fValue->GetData(), 1, size, out);
00458     }
00459
00460     if(ferror(out))
00461         cvs_err("Error while writing '%s' (error %d)", (char *)home, errno);
00462     fclose(out);
00463 #endif /* qUnix */
00464
00465     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00466     {
00467         CPersistentEntry & entry = *i;
00468         entry.fValue->ResetTimeStamp();
00469     }
00470 }

bool CPersistent::SaveAllSettings | ( | const char * | settingFileName,
 |  | const char * | forPath
 | ) | [static]

Definition at line 195 of file Persistent.cpp.

References cvs_err, UStr::endsWith, fAllEntries, kAddSettings, Authen::kindToToken, UStr::length, simple_diff, and URUNTIME_CLASS.

Referenced by SaveAsPersistentSettings, and SavePersistentSettings.

00196 {
00197     UStr tmpSettingsFile(settingFileName);
00198     tmpSettingsFile << "__";
00199     FILE *fd = fopen(tmpSettingsFile, "w");
00200     if(fd == 0L)
00201     {
00202         cvs_err("Failed to open the setting file '%s' for writing (error %d)",
00203             (const char *)tmpSettingsFile, errno);
00204         return false;
00205     }
00206
00207     fprintf(fd, "VERSION=%d\n", 1);
00208
00209     UStr path(forPath);
00210     if(path.endsWith(kPathDelimiter))
00211         path[path.length() - 1] = '\0';
00212     fprintf(fd, "PATH=%s\n", (const char *)path);
00213
00214     fprintf(fd, "AUTHENTICATION=%s\n",
00215         (const char *)Authen::kindToToken(gAuthen.kind()));
00216
00217     fprintf(fd, "CVSROOT=%s\n", (const char *)gCvsPrefs);
00218
00219     std::vector<CPersistentEntry>::const_iterator i;
00220     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00221     {
00222         const CPersistentEntry & entry = *i;
00223         if((entry.fClass & kAddSettings) == 0)
00224             continue;
00225
00226         if(entry.fValue->IsKindOf(URUNTIME_CLASS(CPersistentBool)))
00227         {
00228             CPersistentBool *pbool = (CPersistentBool *)entry.fValue;
00229             bool state = *pbool;
00230             fprintf(fd, "%s=%s\n", entry.fUniqueName, state ? "true" : "false");
00231         }
00232         else if(entry.fValue->IsKindOf(URUNTIME_CLASS(CPersistentInt)))
00233         {
00234             CPersistentInt *pint = (CPersistentInt *)entry.fValue;
00235             int val = *pint;
00236             fprintf(fd, "%s=%d\n", entry.fUniqueName, val);
00237         }
00238         else if(entry.fValue->IsKindOf(URUNTIME_CLASS(PCStr)))
00239         {
00240             PCStr *pstr = (PCStr *)entry.fValue;
00241             const char *str = *pstr;
00242             fprintf(fd, "%s=%s\n", entry.fUniqueName, (const char *)(str == 0L ? "" : str));
00243         }
00244         else if(entry.fValue->IsKindOf(URUNTIME_CLASS(PCPStr)))
00245         {
00246             PCPStr *pstr = (PCPStr *)entry.fValue;
00247             const char *str = *pstr;
00248             fprintf(fd, "%s=%s\n", entry.fUniqueName, (const char *)(str == 0L ? "" : str));
00249         }
00250         else
00251         {
00252             cvs_err("Unknown persistent value '%s'\n", entry.fUniqueName);
00253         }
00254     }
00255     fclose(fd);
00256
00257     if(simple_diff(tmpSettingsFile, settingFileName) == 0)
00258     {
00259         if(unlink(tmpSettingsFile) != 0 && errno != ENOENT)
00260             cvs_err("Could not remove file '%s' (error %d)\n", (const char *)tmpSettingsFile, errno);
00261
00262         return false;
00263     }
00264
00265     if(unlink(settingFileName) != 0 && errno != ENOENT)
00266     {
00267         cvs_err("Could not remove file '%s' (error %d)\n", (const char *)settingFileName, errno);
00268         return false;
00269     }
00270
00271     if(rename(tmpSettingsFile, settingFileName) != 0)
00272     {
00273         cvs_err("Could not rename file '%s' (error %d)\n", (const char *)tmpSettingsFile, errno);
00274         return false;
00275     }
00276
00277     return true;
00278 }

virtual void CPersistent::SetData | ( | const void * | ptr,
 |  | unsigned int | size
 | ) | [pure virtual]

Implemented in PCPStr.

virtual unsigned int CPersistent::SizeOf ( void ) const [pure virtual]

Implemented in PCPStr.

void CPersistent::TouchTimeStamp ( ) [inline]

Definition at line 74 of file Persistent.h.

References fTimeStamp.

Referenced by CPersistent, CMMenuString::GetList, CMMenuString::Insert, TMString::Insert, CWinPlacement::operator=, PCStr::operator=, and TMString::Remove.

00074 { fTimeStamp++; }

void CPersistent::UnRegister ( CPersistent * value ) [static, private]

Definition at line 133 of file Persistent.cpp.

References fAllEntries, and UAppConsole.

Referenced by ~CPersistent.

00134 {
00135     std::vector<CPersistentEntry>::iterator i;
00136     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00137     {
00138         if(value == (*i).fValue)
00139             break;
00140     }
00141
00142     if(i == fAllEntries->end())
00143     {
00144         UAppConsole("Error : Unknown persistent value !\n");
00145         return;
00146     }
00147
00148     fAllEntries->erase(i);
00149     if(fAllEntries->size() == 0)
00150     {
00151         delete fAllEntries;
00152         fAllEntries = 0L;
00153     }
00154 }

Member Data Documentation

const URuntimeClass CPersistent::classCPersistent [static, protected]

std::vector< CPersistent::CPersistentEntry > * CPersistent::fAllEntries = 0L [static, protected]

Definition at line 95 of file Persistent.cpp.

Referenced by Find, LoadAll, NeedSave, Register, SaveAll, SaveAllSettings, and UnRegister.

long CPersistent::fTimeStamp [protected]

Definition at line 85 of file Persistent.h.

Referenced by GetTimeStamp, ResetTimeStamp, and TouchTimeStamp.

The documentation for this class was generated from the following files:
  • common/Persistent.h
  • common/Persistent.cpp
Generated on Sun Feb 24 01:27:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CPersistent::CPersistentEntry Struct Reference

#include <Persistent.h>

Collaboration diagram for CPersistent::CPersistentEntry:

[legend]
List of all members.

Public Attributes

const char * fUniqueName
CPersistent * fValue
kClassPersistent fClass

Member Data Documentation

kClassPersistent CPersistent::CPersistentEntry::fClass

Definition at line 66 of file Persistent.h.

const char* CPersistent::CPersistentEntry::fUniqueName

Definition at line 64 of file Persistent.h.

Referenced by _loadPersistentSettings.

CPersistent* CPersistent::CPersistentEntry::fValue

Definition at line 65 of file Persistent.h.

Referenced by _loadPersistentSettings.

The documentation for this struct was generated from the following file:
  • common/Persistent.h
Generated on Sun Feb 24 01:27:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CPersistentBool Class Reference

#include <Persistent.h>

Inheritance diagram for CPersistentBool:

[legend]
Collaboration diagram for CPersistentBool:

[legend]
List of all members.

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
CPersistentBool (const char *uniqueName, bool defValue, kClassPersistent pclass=kNoClass)
virtual | ~CPersistentBool ()
operator const bool & () const
const bool * | operator-> () const
bool & | operator= (const bool &val)
bool | operator== (const bool &val) const

Static Public Methods

const URuntimeClass * | rtCPersistentBool (void)

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()

Static Protected Attributes

const URuntimeClass | classCPersistentBool

Constructor & Destructor Documentation

CPersistentBool::CPersistentBool | ( | const char * | uniqueName,
 |  | bool | defValue,
 |  | kClassPersistent | pclass = kNoClass
 | ) | [inline]

Definition at line 127 of file Persistent.h.

References kClassPersistent, and kNoClass.

00128                                             :
00129       CPersistentT<bool>(uniqueName, defValue, pclass)
00130     {
00131     }

virtual CPersistentBool::~CPersistentBool ( ) [inline, virtual]

Definition at line 132 of file Persistent.h.

00133     {
00134     }

Member Function Documentation

const URuntimeClass * CPersistentBool::_GetBaseClass ( ) [static, protected]

Reimplemented from CPersistent.

Definition at line 99 of file Persistent.cpp.

const URuntimeClass * CPersistentBool::GetRuntimeClass ( ) const [virtual]

Reimplemented from CPersistent.

Definition at line 99 of file Persistent.cpp.

CPersistentBool::operator const bool & ( ) const [inline]

Definition at line 136 of file Persistent.h.

00139 : public CPersistentT<int>

const bool* CPersistentBool::operator-> ( ) const [inline]

Reimplemented from CPersistentT< bool >.

Definition at line 136 of file Persistent.h.

00139 : public CPersistentT<int>

bool& CPersistentBool::operator= ( const bool & val ) [inline]

Reimplemented from CPersistentT< bool >.

Definition at line 136 of file Persistent.h.

00139 : public CPersistentT<int>

bool CPersistentBool::operator== ( const bool & val ) const [inline]

Reimplemented from CPersistentT< bool >.

Definition at line 136 of file Persistent.h.

00139 : public CPersistentT<int>

const URuntimeClass * CPersistentBool::rtCPersistentBool ( void ) [static]

Definition at line 99 of file Persistent.cpp.

Member Data Documentation

const URuntimeClass CPersistentBool::classCPersistentBool [static, protected]

The documentation for this class was generated from the following files:
  • common/Persistent.h
  • common/Persistent.cpp
Generated on Sun Feb 24 01:27:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CPersistentInt Class Reference

#include <Persistent.h>

Inheritance diagram for CPersistentInt:

[legend]
Collaboration diagram for CPersistentInt:

[legend]
List of all members.

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
CPersistentInt (const char *uniqueName, int defValue, kClassPersistent pclass=kNoClass)
virtual | ~CPersistentInt ()
operator const int & () const
const int * | operator-> () const
int & | operator= (const int &val)
bool | operator== (const int &val) const

Static Public Methods

const URuntimeClass * | rtCPersistentInt (void)

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()

Static Protected Attributes

const URuntimeClass | classCPersistentInt

Constructor & Destructor Documentation

CPersistentInt::CPersistentInt | ( | const char * | uniqueName,
 |  | int | defValue,
 |  | kClassPersistent | pclass = kNoClass
 | ) | [inline]

Definition at line 143 of file Persistent.h.

References kClassPersistent, and kNoClass.

00144                                             :
00145             CPersistentT<int>(uniqueName, defValue, pclass)
00146     {
00147     }

virtual CPersistentInt::~CPersistentInt ( ) [inline, virtual]

Definition at line 148 of file Persistent.h.

00149     {
00150     }

Member Function Documentation

const URuntimeClass * CPersistentInt::_GetBaseClass ( ) [static, protected]

Reimplemented from CPersistent.

Definition at line 98 of file Persistent.cpp.

const URuntimeClass * CPersistentInt::GetRuntimeClass ( ) const [virtual]

Reimplemented from CPersistent.

Definition at line 98 of file Persistent.cpp.

CPersistentInt::operator const int & ( ) const [inline]

Definition at line 152 of file Persistent.h.

const int* CPersistentInt::operator-> ( ) const [inline]

Reimplemented from CPersistentT< int >.

Definition at line 152 of file Persistent.h.

int& CPersistentInt::operator= ( const int & val ) [inline]

Reimplemented from CPersistentT< int >.

Definition at line 152 of file Persistent.h.

bool CPersistentInt::operator== ( const int & val ) const [inline]

Reimplemented from CPersistentT< int >.

Definition at line 152 of file Persistent.h.

const URuntimeClass * CPersistentInt::rtCPersistentInt ( void ) [static]

Definition at line 98 of file Persistent.cpp.

Member Data Documentation

const URuntimeClass CPersistentInt::classCPersistentInt [static, protected]

The documentation for this class was generated from the following files:
  • common/Persistent.h
  • common/Persistent.cpp
Generated on Sun Feb 24 01:27:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TemplateCPersistentT class Reference

CPersistentT Class Template Reference

#include <Persistent.h>

Inheritance diagram for CPersistentT:

[legend]
Collaboration diagram for CPersistentT:

[legend]
List of all members.

Public Methods

CPersistentT (const char *uniqueName, T defValue, kClassPersistent pclass)
virtual | ~CPersistentT ()
operator const T & () const
const T * | operator-> () const
T & | operator= (const T &val)
bool | operator== (const T &val) const
virtual unsigned int | SizeOf (void) const
virtual const void * | GetData (void) const
virtual void | SetData (const void *ptr, unsigned int size)

Protected Attributes

T | fDefValue
T | fValue

template<class T>
class CPersistentT< T >

Constructor & Destructor Documentation

template<class T>
CPersistentT< T >::CPersistentT | ( | const char * | uniqueName,
 |  | T | defValue,
 |  | kClassPersistent | pclass
 | ) | [inline]

Definition at line 101 of file Persistent.h.

00101                                                                               : CPersistent(uniqueName, pclass)
00102     {
00103         fValue = fDefValue = defValue;
00104     }

template<class T>
virtual CPersistentT< T >::~CPersistentT ( ) [inline, virtual]

Definition at line 105 of file Persistent.h.

00106     {
00107     }

Member Function Documentation

template<class T>
virtual const void* CPersistentT< T >::GetData ( void ) const [inline, virtual]

Implements CPersistent.

Definition at line 112 of file Persistent.h.

00112 {return &fValue;}

template<class T>
CPersistentT< T >::operator const T & ( ) const [inline]

Definition at line 109 of file Persistent.h.

00111 {return sizeof(T);}

template<class T>
const T* CPersistentT< T >::operator-> ( ) const [inline]

Reimplemented in CPersistentBool.

Definition at line 109 of file Persistent.h.

00111 {return sizeof(T);}

template<class T>
T& CPersistentT< T >::operator= ( const T & val ) [inline]

Reimplemented in CPersistentBool.

Definition at line 109 of file Persistent.h.

00111 {return sizeof(T);}

template<class T>
bool CPersistentT< T >::operator== ( const T & val ) const [inline]

Reimplemented in CPersistentBool.

Definition at line 109 of file Persistent.h.

00111 {return sizeof(T);}

template<class T>
virtual void CPersistentT< T >::SetData | ( | const void * | ptr,
 |  | unsigned int | size
 | ) | [inline, virtual]

Implements CPersistent.

Definition at line 113 of file Persistent.h.

00114     {
00115         if(size == sizeof(T))
00116             memcpy(&fValue, ptr, size);
00117     }

template<class T>
virtual unsigned int CPersistentT< T >::SizeOf ( void ) const [inline, virtual]

Implements CPersistent.

Definition at line 111 of file Persistent.h.

00111 {return sizeof(T);}

Member Data Documentation

template<class T>
T CPersistentT::fDefValue [protected]

Definition at line 120 of file Persistent.h.

Referenced by CPersistentT< bool >::CPersistentT.

template<class T>
T CPersistentT::fValue [protected]

Definition at line 120 of file Persistent.h.

Referenced by CPersistentT< bool >::CPersistentT, CPersistentT< bool >::GetData, and CPersistentT< bool >::SetData.

The documentation for this class was generated from the following file:
  • common/Persistent.h
Generated on Sun Feb 24 01:27:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UPoint Class Reference

#include <udraw.h>

Inheritance diagram for UPoint:

[legend]
Collaboration diagram for UPoint:

[legend]
List of all members.

Public Methods

UPoint ()
UPoint (int initX, int initY)
UPoint (UPOINT initPt)
UPoint (USIZE initSize)
void | Offset (int xOffset, int yOffset)
void | Offset (UPOINT point)
void | Offset (USIZE size)
bool | operator== (UPOINT point) const
bool | operator!= (UPOINT point) const
void | operator+= (USIZE size)
void | operator-= (USIZE size)
void | operator+= (UPOINT point)
void | operator-= (UPOINT point)
UPoint | operator+ (USIZE size) const
UPoint | operator- (USIZE size) const
UPoint | operator- () const
UPoint | operator+ (UPOINT point) const
USize | operator- (UPOINT point) const
URect | operator+ (const URECT *lpRect) const
URect | operator- (const URECT *lpRect) const

Constructor & Destructor Documentation

UPoint::UPoint ( ) [inline]

Definition at line 282 of file udraw.h.

Referenced by OffsetRect, operator+, and operator-.

00283     { /* random filled */ }

UPoint::UPoint | ( | int | initX,
 |  | int | initY
 | ) | [inline]

Definition at line 284 of file udraw.h.

References UPOINT::x, and UPOINT::y.

00285     { x = initX; y = initY; }

UPoint::UPoint ( UPOINT initPt ) [inline]

Definition at line 286 of file udraw.h.

00287     { *(UPOINT*)this = initPt; }

UPoint::UPoint ( USIZE initSize ) [inline]

Definition at line 288 of file udraw.h.

00289     { *(USIZE*)this = initSize; }

Member Function Documentation

void UPoint::Offset ( USIZE size ) [inline]

Definition at line 294 of file udraw.h.

References USIZE::cx, USIZE::cy, UPOINT::x, and UPOINT::y.

00295     { x += size.cx; y += size.cy; }

void UPoint::Offset ( UPOINT point ) [inline]

Definition at line 292 of file udraw.h.

References UPOINT::x, and UPOINT::y.

00293     { x += point.x; y += point.y; }

void UPoint::Offset | ( | int | xOffset,
 |  | int | yOffset
 | ) | [inline]

Definition at line 290 of file udraw.h.

References UPOINT::x, and UPOINT::y.

00291     { x += xOffset; y += yOffset; }

bool UPoint::operator!= ( UPOINT point ) const [inline]

Definition at line 298 of file udraw.h.

References UPOINT::x, and UPOINT::y.

00299     { return (x != point.x || y != point.y); }

URect UPoint::operator+ ( const URECT * lpRect ) const [inline]

Definition at line 318 of file udraw.h.

00319     { return URect(lpRect) + *this; }

UPoint UPoint::operator+ ( UPOINT point ) const [inline]

Definition at line 314 of file udraw.h.

References UPoint, UPOINT::x, and UPOINT::y.

00315     { return UPoint(x + point.x, y + point.y); }

UPoint UPoint::operator+ ( USIZE size ) const [inline]

Definition at line 308 of file udraw.h.

References USIZE::cx, USIZE::cy, UPoint, UPOINT::x, and UPOINT::y.

00309     { return UPoint(x + size.cx, y + size.cy); }

void UPoint::operator+= ( UPOINT point ) [inline]

Definition at line 304 of file udraw.h.

References UPOINT::x, and UPOINT::y.

00305     { x += point.x; y += point.y; }

void UPoint::operator+= ( USIZE size ) [inline]

Definition at line 300 of file udraw.h.

References USIZE::cx, USIZE::cy, UPOINT::x, and UPOINT::y.

00301     { x += size.cx; y += size.cy; }

URect UPoint::operator- ( const URECT * lpRect ) const [inline]

Definition at line 320 of file udraw.h.

00321     { return URect(lpRect) - *this; }

USize UPoint::operator- ( UPOINT point ) const [inline]

Definition at line 316 of file udraw.h.

References UPOINT::x, and UPOINT::y.

00317     { return USize(x - point.x, y - point.y); }

UPoint UPoint::operator- ( ) const [inline]

Definition at line 312 of file udraw.h.

References UPoint, UPOINT::x, and UPOINT::y.

00313     { return UPoint(-x, -y); }

UPoint UPoint::operator- ( USIZE size ) const [inline]

Definition at line 310 of file udraw.h.

References USIZE::cx, USIZE::cy, UPoint, UPOINT::x, and UPOINT::y.

00311     { return UPoint(x - size.cx, y - size.cy); }

void UPoint::operator-= ( UPOINT point ) [inline]

Definition at line 306 of file udraw.h.

References UPOINT::x, and UPOINT::y.

00307     { x -= point.x; y -= point.y; }

void UPoint::operator-= ( USIZE size ) [inline]

Definition at line 302 of file udraw.h.

References USIZE::cx, USIZE::cy, UPOINT::x, and UPOINT::y.

00303     { x -= size.cx; y -= size.cy; }

bool UPoint::operator== ( UPOINT point ) const [inline]

Definition at line 296 of file udraw.h.

References UPOINT::x, and UPOINT::y.

00297     { return (x == point.x && y == point.y); }

The documentation for this class was generated from the following file:
  • rf/udraw.h
Generated on Sun Feb 24 01:27:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UPOINT Struct Reference

#include <umain.h>

Inheritance diagram for UPOINT:

[legend]
Collaboration diagram for UPOINT:

[legend]
List of all members.

Public Attributes

int | x
int | y

Member Data Documentation

int UPOINT::x

Definition at line 921 of file umain.h.

Referenced by CWinLogData::ComputeBounds, UDC::DrawBitmap, UPoint::Offset, URect::OffsetRect, UWidget::OnSetLoc, UPoint::operator!=, URect::operator+, UPoint::operator+, USize::operator+, URect::operator+=, UPoint::operator+=, URect::operator-, UPoint::operator-, USize::operator-, URect::operator-=, UPoint::operator-=, UPoint::operator==, PtInRect, URect::SetRect, UDC::TextOutClipped, CWinLogData::Update, CWinLogBranchData::UpdateSelf, CWinLogTagData::UpdateSelf, CWinLogRevData::UpdateSelf, CWinLogHeaderData::UpdateSelf, UPoint::UPoint, and URect::URect.

int UPOINT::y

Definition at line 921 of file umain.h.

Referenced by CWinLogData::ComputeBounds, UDC::DrawBitmap, UPoint::Offset, URect::OffsetRect, UWidget::OnSetLoc, UPoint::operator!=, URect::operator+, UPoint::operator+, USize::operator+, URect::operator+=, UPoint::operator+=, URect::operator-, UPoint::operator-, USize::operator-, URect::operator-=, UPoint::operator-=, UPoint::operator==, PtInRect, URect::SetRect, UDC::TextOutClipped, CWinLogData::Update, CWinLogBranchData::UpdateSelf, CWinLogTagData::UpdateSelf, CWinLogRevData::UpdateSelf, CWinLogHeaderData::UpdateSelf, UPoint::UPoint, and URect::URect.

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Sun Feb 24 01:27:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


poolRec Struct Reference

Collaboration diagram for poolRec:

[legend]
List of all members.

Public Attributes

frameRec * firstentry
frameRec * firstfree
DYN_LIST * pool

Member Data Documentation

frameRec* poolRec::firstentry

Definition at line 292 of file dll_garbage.c.

frameRec* poolRec::firstfree

Definition at line 293 of file dll_garbage.c.

DYN_LIST* poolRec::pool

Definition at line 294 of file dll_garbage.c.

The documentation for this struct was generated from the following file:
  • common/dll_garbage.c
Generated on Sun Feb 24 01:27:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UPPMenu Class Reference

Inheritance diagram for UPPMenu:

[legend]
Collaboration diagram for UPPMenu:

[legend]
List of all members.

Public Methods

UPPMenu ()
virtual | ~UPPMenu ()

Static Public Attributes

int | sPPMenuWidID = -1

Constructor & Destructor Documentation

UPPMenu::UPPMenu ( )

Definition at line 718 of file UPseudoSupport.cpp.

References UCmdTarget::GetWidID, and sPPMenuWidID.

00718                  : UMenu(::UEventGetWidID())
00719 {
00720     sPPMenuWidID = GetWidID();
00721 }

UPPMenu::~UPPMenu ( ) [virtual]

Definition at line 723 of file UPseudoSupport.cpp.

00724 {
00725 }

Member Data Documentation

int UPPMenu::sPPMenuWidID = -1 [static]

Definition at line 716 of file UPseudoSupport.cpp.

Referenced by LMainPseudoAttachment::ExecuteSelf, and UPPMenu.

The documentation for this class was generated from the following file:
  • rf/support/powerplant/UPseudoSupport.cpp
Generated on Sun Feb 24 01:27:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CProgress Class Reference

#include <ProgressDialog.h>

Collaboration diagram for CProgress:

[legend]
List of all members.

Public Methods

CProgress (bool interruptable, const char *title=0L)
~CProgress ()
bool | HasAborted (void) const
void | SetProgress (int percent)
void | DoAbort (void)

Protected Attributes

CProgressDialog * m_dlg
bool | m_abort

Constructor & Destructor Documentation

CProgress::CProgress | ( | bool | interruptable,
 |  | const char * | title = 0L
 | ) |

Definition at line 101 of file ProgressDialog.cpp.

References CProgressDialog::Create, m_abort, and m_dlg.

00101                                                           : m_dlg(0L), m_abort(false)
00102 {
00103     m_dlg = new CProgressDialog(m_abort, interruptable);
00104     if (!m_dlg->Create())
00105     {
00106         TRACE0("Failed to create DlgBar\n");
00107         delete m_dlg;
00108         m_dlg = 0L;
00109         return;      // fail to create
00110     }
00111     if(title != 0L)
00112         m_dlg->SetWindowText(title);
00113     ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
00114 }

CProgress::~CProgress ( )

Definition at line 116 of file ProgressDialog.cpp.

References m_dlg.

00117 {
00118     if(m_dlg != 0L)
00119         m_dlg->DestroyWindow();
00120 }

Member Function Documentation

void CProgress::DoAbort ( void )

Definition at line 134 of file ProgressDialog.cpp.

References m_dlg.

00135 {
00136     if(m_dlg != 0L)
00137         m_dlg->DestroyWindow();
00138     m_dlg = 0L;
00139 }

bool CProgress::HasAborted ( void ) const [inline]

Definition at line 19 of file ProgressDialog.h.

References m_abort.

Referenced by CGraphView::OnViewDelrev.

00019 { return m_abort; }

void CProgress::SetProgress ( int percent )

Definition at line 122 of file ProgressDialog.cpp.

References flushDisplay, m_abort, m_dlg, and CProgressDialog::m_progress.

Referenced by CGraphView::OnViewDelrev.

00123 {
00124     if(m_dlg == 0L)
00125         return;
00126
00127     m_dlg->m_progress.SetPos(percent);
00128     flushDisplay(m_dlg, m_abort);
00129     ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
00130     if(m_abort)
00131         m_dlg = 0L;
00132 }

Member Data Documentation

bool CProgress::m_abort [protected]

Definition at line 25 of file ProgressDialog.h.

Referenced by CProgress, HasAborted, and SetProgress.

CProgressDialog* CProgress::m_dlg [protected]

Definition at line 24 of file ProgressDialog.h.

Referenced by CProgress, DoAbort, SetProgress, and ~CProgress.

The documentation for this class was generated from the following files:
  • WinCvs/ProgressDialog.h
  • WinCvs/ProgressDialog.cpp
Generated on Sun Feb 24 01:27:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CProgressDialog Class Reference

#include <ProgressDialog.h>

Inheritance diagram for CProgressDialog:

[legend]
Collaboration diagram for CProgressDialog:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_PROGRESS }

Public Methods

CProgressDialog (bool &abort, bool interruptable, CWnd *pParent=NULL)
BOOL | Create ()

Public Attributes

CProgressCtrl | m_progress

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
virtual void | PostNcDestroy ()
virtual void | OnOK ()
virtual BOOL | OnInitDialog ()

Protected Attributes

CWnd * m_pParent
bool & | m_abort
bool | m_stopable
HWND | hWndParent

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 40 of file ProgressDialog.h.

00040 { IDD = IDD_PROGRESS };

Constructor & Destructor Documentation

CProgressDialog::CProgressDialog | ( | bool & | abort,
 |  | bool | interruptable,
 |  | CWnd * | pParent = NULL
 | ) |

Definition at line 18 of file ProgressDialog.cpp.

00019     : m_abort(abort), m_stopable(interruptable), m_pParent(pParent), hWndParent(0L),
00020     CDialog(CProgressDialog::IDD, pParent)
00021 {
00022     //{{AFX_DATA_INIT(CProgressDialog)
00023         // NOTE: the ClassWizard will add member initialization here
00024     //}}AFX_DATA_INIT
00025 }

Member Function Documentation

BOOL CProgressDialog::Create ( )

Definition at line 78 of file ProgressDialog.cpp.

References hWndParent, IDD, and m_pParent.

Referenced by CProgress::CProgress.

00079 {
00080     hWndParent = PreModal();
00081     return CDialog::Create(CProgressDialog::IDD, m_pParent);
00082 }

void CProgressDialog::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 28 of file ProgressDialog.cpp.

References IDC_PROGRESS, and m_progress.

00029 {
00030     CDialog::DoDataExchange(pDX);
00031     //{{AFX_DATA_MAP(CProgressDialog)
00032     DDX_Control(pDX, IDC_PROGRESS, m_progress);
00033     //}}AFX_DATA_MAP
00034 }

BOOL CProgressDialog::OnInitDialog ( ) [protected, virtual]

Definition at line 62 of file ProgressDialog.cpp.

References FALSE, m_stopable, and TRUE.

00063 {
00064     CenterWindow();
00065
00066     CDialog::OnInitDialog();
00067
00068     CWnd *wnd = GetDlgItem(IDOK);
00069     if(wnd != 0L && !m_stopable)
00070     {
00071         wnd->EnableWindow(FALSE);
00072     }
00073     ShowWindow(SW_SHOW);
00074
00075     return TRUE;  // return TRUE unless you set the focus to a control
00076 }

void CProgressDialog::OnOK ( ) [protected, virtual]

Definition at line 56 of file ProgressDialog.cpp.

References m_abort.

00057 {
00058     m_abort = true;
00059     DestroyWindow();
00060 }

void CProgressDialog::PostNcDestroy ( ) [protected, virtual]

Definition at line 45 of file ProgressDialog.cpp.

References hWndParent, NULL, and TRUE.

00046 {
00047     MSG msg;
00048     if (hWndParent != NULL && ::GetActiveWindow() == m_hWnd)
00049         ::SetActiveWindow(hWndParent);
00050     PostModal();
00051     while (PeekMessage(&msg, m_hWnd, 0, 0, PM_NOREMOVE) == TRUE)
00052         AfxGetApp()->PumpMessage();
00053     delete this;
00054 }

Member Data Documentation

HWND CProgressDialog::hWndParent [protected]

Definition at line 59 of file ProgressDialog.h.

Referenced by Create, and PostNcDestroy.

bool& CProgressDialog::m_abort [protected]

Definition at line 57 of file ProgressDialog.h.

Referenced by OnOK.

CWnd* CProgressDialog::m_pParent [protected]

Definition at line 56 of file ProgressDialog.h.

Referenced by Create.

CProgressCtrl CProgressDialog::m_progress

Definition at line 41 of file ProgressDialog.h.

Referenced by DoDataExchange, and CProgress::SetProgress.

bool CProgressDialog::m_stopable [protected]

Definition at line 58 of file ProgressDialog.h.

Referenced by OnInitDialog.

The documentation for this class was generated from the following files:
  • WinCvs/ProgressDialog.h
  • WinCvs/ProgressDialog.cpp
Generated on Sun Feb 24 01:27:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UPromptMessage Class Reference

Inheritance diagram for UPromptMessage:

[legend]
Collaboration diagram for UPromptMessage:

[legend]
List of all members.

Public Types

enum {
kOK = EV_COMMAND_START,
kCancel,
kMsg
}

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UPromptMessage (const char *msg, const char *title, const char *def, const char *cncl)
virtual | ~UPromptMessage ()
virtual void | DoDataExchange (bool fill)
while modaling, allows to fill/read the dialog content.
  • fill says if it expects to fill or read the dialog content.
 More...

Static Public Methods

const URuntimeClass * | rtUPromptMessage (void)

Protected Methods

int | OnOK (void)
int | OnCancel (void)
virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Protected Attributes

UStr m_msg
UStr m_title
UStr m_ok
UStr m_cncl

Static Protected Attributes

const URuntimeClass | classUPromptMessage
const UMSGMAP | messageMap = { UWidget ::GetThisMessageMap(), & UPromptMessage ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Member Enumeration Documentation

anonymous enum

Enumeration values:
kOK
kCancel
kMsg

Definition at line 131 of file AskYesNo.cpp.

00132     {
00133         kOK = EV_COMMAND_START, // 0
00134         kCancel,                // 1
00135         kMsg                    // 2
00136     };

Constructor & Destructor Documentation

UPromptMessage::UPromptMessage | ( | const char * | msg,
 |  | const char * | title,
 |  | const char * | def,
 |  | const char * | cncl
 | ) | [inline]

Definition at line 123 of file AskYesNo.cpp.

References m_cncl, m_msg, m_ok, and m_title.

00124                           : UWidget(UEventGetWidID()), m_msg(msg), m_title(title),
00125         m_ok(def), m_cncl(cncl)
00126     {
00127     }

virtual UPromptMessage::~UPromptMessage ( ) [inline, virtual]

Definition at line 129 of file AskYesNo.cpp.

00129 {}

Member Function Documentation

const URuntimeClass * UPromptMessage::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Reimplemented in UEditMessage.

Definition at line 161 of file AskYesNo.cpp.

virtual void UPromptMessage::DoDataExchange ( bool fill ) [inline, virtual]

while modaling, allows to fill/read the dialog content.

  • fill says if it expects to fill or read the dialog content.

Reimplemented from UWidget.

Reimplemented in UEditMessage.

Definition at line 138 of file AskYesNo.cpp.

References UStr::c_str, EV_SETTEXT, UCmdTarget::GetWidID, kCancel, kMsg, kOK, kUMainWidget, m_cncl, m_msg, m_ok, m_title, and UEventSendMessage.

Referenced by UEditMessage::DoDataExchange.

00139     {
00140         if(fill)
00141         {
00142             UEventSendMessage(GetWidID(), EV_SETTEXT, kOK, (void *)m_ok.c_str());
00143             UEventSendMessage(GetWidID(), EV_SETTEXT, kUMainWidget, (void *)m_title.c_str());
00144             UEventSendMessage(GetWidID(), EV_SETTEXT, kCancel, (void *)m_cncl.c_str());
00145             UEventSendMessage(GetWidID(), EV_SETTEXT, kMsg, (void *)m_msg.c_str());
00146         }
00147         else
00148         {
00149         }
00150     }

const UMSGMAP * UPromptMessage::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Reimplemented in UEditMessage.

Definition at line 163 of file AskYesNo.cpp.

const UMSGMAP * UPromptMessage::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Reimplemented in UEditMessage.

Definition at line 163 of file AskYesNo.cpp.

const URuntimeClass * UPromptMessage::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Reimplemented in UEditMessage.

Definition at line 161 of file AskYesNo.cpp.

const UMSGMAP * UPromptMessage::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Reimplemented in UEditMessage.

Definition at line 163 of file AskYesNo.cpp.

int UPromptMessage::OnCancel ( void ) [protected]

Definition at line 174 of file AskYesNo.cpp.

References UWidget::EndModal.

00175 {
00176     EndModal(false);
00177     return 0;
00178 }

int UPromptMessage::OnOK ( void ) [protected]

Definition at line 168 of file AskYesNo.cpp.

References UWidget::EndModal.

00169 {
00170     EndModal(true);
00171     return 0;
00172 }

const URuntimeClass * UPromptMessage::rtUPromptMessage ( void ) [static]

Definition at line 161 of file AskYesNo.cpp.

Member Data Documentation

const UMSGMAP_ENTRY UPromptMessage::_messageEntries [static, private]

Initial value:

   {
    { EV_CMD, epi_V, UMSG_RANGE,  kOK ,  kOK ,   (UPMSG)(int (UCmdTarget::*)(void))& UPromptMessage::OnOK  },
    { EV_CMD, epi_V, UMSG_RANGE,  kCancel ,  kCancel ,   (UPMSG)(int (UCmdTarget::*)(void))& UPromptMessage::OnCancel  },
{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }   }

Reimplemented from UWidget.

Reimplemented in UEditMessage.

Definition at line 163 of file AskYesNo.cpp.

const URuntimeClass UPromptMessage::classUPromptMessage [static, protected]

UStr UPromptMessage::m_cncl [protected]

Definition at line 153 of file AskYesNo.cpp.

Referenced by DoDataExchange, and UPromptMessage.

UStr UPromptMessage::m_msg [protected]

Definition at line 153 of file AskYesNo.cpp.

Referenced by DoDataExchange, and UPromptMessage.

UStr UPromptMessage::m_ok [protected]

Definition at line 153 of file AskYesNo.cpp.

Referenced by DoDataExchange, and UPromptMessage.

UStr UPromptMessage::m_title [protected]

Definition at line 153 of file AskYesNo.cpp.

Referenced by DoDataExchange, and UPromptMessage.

const UMSGMAP UPromptMessage::messageMap = { UWidget ::GetThisMessageMap(), & UPromptMessage ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Reimplemented in UEditMessage.

Definition at line 163 of file AskYesNo.cpp.

The documentation for this class was generated from the following file:
  • common/AskYesNo.cpp
Generated on Sun Feb 24 01:27:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CPropertyPage Class Reference

Inheritance diagram for CPropertyPage:

[legend]
The documentation for this class was generated from the following file:
  • common/RtagDlg.h
Generated on Sun Feb 24 01:27:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CPropertySheet Class Reference

Inheritance diagram for CPropertySheet:

[legend]
The documentation for this class was generated from the following file:
  • common/OptionalPropertySheet.h
Generated on Sun Feb 24 01:27:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CPseudoButton Class Reference

#include <PseudoButton.h>

Inheritance diagram for CPseudoButton:

[legend]
Collaboration diagram for CPseudoButton:

[legend]
List of all members.

Public Methods

CPseudoButton ()
virtual bool | LoadXPM (int rsrcid)
virtual void | DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct)
virtual | ~CPseudoButton ()

Static Public Methods

bool | loadIcon (CString &icon, int rsrcid)

Protected Methods

virtual void | DrawButtonBitmap (CDC *pDC, UINT nState, CRect &rcItem)

Protected Attributes

HBITMAP | m_bitmap
HBITMAP | m_disbitmap

Constructor & Destructor Documentation

CPseudoButton::CPseudoButton ( )

Definition at line 41 of file PseudoButton.cpp.

00041                              : m_bitmap(0L), m_disbitmap(0L)
00042 {
00043 }

CPseudoButton::~CPseudoButton ( ) [virtual]

Definition at line 45 of file PseudoButton.cpp.

References m_bitmap, and m_disbitmap.

00046 {
00047     if(m_bitmap != 0L)
00048         AfxDeleteObject((HGDIOBJ*)&m_bitmap);
00049     if(m_disbitmap != 0L)
00050         AfxDeleteObject((HGDIOBJ*)&m_disbitmap);
00051 }

Member Function Documentation

void CPseudoButton::DrawButtonBitmap | ( | CDC * | pDC,
 |  | UINT | nState,
 |  | CRect & | rcItem
 | ) | [protected, virtual]

Reimplemented from CCJFlatButton.

Definition at line 114 of file PseudoButton.cpp.

References m_bitmap, m_disbitmap, and NULL.

00115 {
00116     // get the handle to the bitmap (if any) associated
00117     // with this button.
00118     HBITMAP hBitmap = GetBitmap();
00119     if( hBitmap == NULL ) {
00120         return;
00121     }
00122
00123     CRect rc = rcItem;
00124
00125     // if the button is selected.
00126     if( nState & ODS_SELECTED ) {
00127         rcItem.OffsetRect(1,1);
00128     }
00129
00130     // draw the bitmap associated with this button.
00131     if((nState & ODS_DISABLED) != 0 && m_disbitmap != 0L)
00132         pDC->DrawState( rc.TopLeft(), rc.Size(), m_disbitmap,
00133             DSS_NORMAL, (HBRUSH)NULL );
00134     else if(m_bitmap != 0L)
00135         pDC->DrawState( rc.TopLeft(), rc.Size(), m_bitmap,
00136             DSS_NORMAL, (HBRUSH)NULL );
00137     else
00138         pDC->DrawState( rc.TopLeft(), rc.Size(), hBitmap,
00139             ( nState & ODS_DISABLED )?DSS_DISABLED:DSS_NORMAL, (HBRUSH)NULL );
00140 }

void CPseudoButton::DrawItem ( LPDRAWITEMSTRUCT lpDrawItemStruct ) [virtual]

Reimplemented from CCJFlatButton.

Reimplemented in CPseudoToggle.

Definition at line 53 of file PseudoButton.cpp.

References CCJFlatButton::DrawItem, and CCJFlatButton::m_bFlatLook.

Referenced by CPseudoToggle::DrawItem.

00054 {
00055     BOOL oldFlag = m_bFlatLook;
00056     if(lpDIS->itemState & ODS_DISABLED)
00057         m_bFlatLook = true;
00058     CCJFlatButton::DrawItem(lpDIS);
00059     m_bFlatLook = oldFlag;
00060 }

bool CPseudoButton::loadIcon | ( | CString & | icon,
 |  | int | rsrcid
 | ) | [static]

Definition at line 62 of file PseudoButton.cpp.

Referenced by LoadXPM, and CPseudoRotButton::LoadXPMs.

00063 {
00064     icon = "";
00065     bool res = false;
00066
00067     HINSTANCE inst = ::AfxGetResourceHandle();
00068     HRSRC hRsrc = FindResource(inst, MAKEINTRESOURCE(rsrcid), "CICN");
00069     if (hRsrc != 0L)
00070     {
00071         HGLOBAL hg = LoadResource(inst, hRsrc);
00072         if (hg != 0L)
00073         {
00074             DWORD size = SizeofResource(inst, hRsrc);
00075             char *rsrcptr = (char *)LockResource(hg);
00076             icon = CString(rsrcptr, size);
00077             FreeResource(hg);
00078             res = true;
00079         }
00080     }
00081
00082     return res;
00083 }

bool CPseudoButton::LoadXPM ( int rsrcid ) [virtual]

Definition at line 85 of file PseudoButton.cpp.

References DD_PIXMAP, loadIcon, m_bitmap, m_disbitmap, and UMakeBitmap.

00086 {
00087     CString sicon;
00088
00089     if(!CPseudoButton::loadIcon(sicon, rsrcid))
00090         return false;
00091
00092     COLORREF back = ::GetSysColor(COLOR_BTNFACE);
00093     COLORREF fore = ::GetSysColor(COLOR_GRAYTEXT);
00094
00095     int w, h;
00096     HBITMAP bmap = UMakeBitmap((const char *)sicon, w, h, DD_PIXMAP, back, fore);
00097     if(bmap == 0L)
00098         return false;
00099
00100     SetBitmap(bmap);
00101     if(m_bitmap != 0L)
00102         AfxDeleteObject((HGDIOBJ*)&m_bitmap);
00103     m_bitmap = bmap;
00104
00105     bmap = UMakeBitmap((const char *)sicon, w, h, DD_PIXMAP, back, fore, false);
00106     if(bmap == 0L)
00107         return false;
00108     if(m_disbitmap != 0L)
00109         AfxDeleteObject((HGDIOBJ*)&m_disbitmap);
00110     m_disbitmap = bmap;
00111     return true;
00112 }

Member Data Documentation

HBITMAP CPseudoButton::m_bitmap [protected]

Definition at line 58 of file PseudoButton.h.

Referenced by CPseudoRotButton::DoRotate, DrawButtonBitmap, LoadXPM, ~CPseudoButton, and CPseudoRotButton::~CPseudoRotButton.

HBITMAP CPseudoButton::m_disbitmap [protected]

Definition at line 59 of file PseudoButton.h.

Referenced by CPseudoRotButton::DoRotate, DrawButtonBitmap, LoadXPM, ~CPseudoButton, and CPseudoRotButton::~CPseudoRotButton.

The documentation for this class was generated from the following files:
  • rf/support/mfc/PseudoButton.h
  • rf/support/mfc/PseudoButton.cpp
Generated on Sun Feb 24 01:27:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UPseudoCmdStatusWrapper Struct Reference

#include <UPseudoSupport.h>

Collaboration diagram for UPseudoCmdStatusWrapper:

[legend]
List of all members.

Public Attributes

Boolean * | outEnabled
Boolean * | outUsesMark
UInt16 * | outMark
unsigned char * | outName

Member Data Documentation

Boolean* UPseudoCmdStatusWrapper::outEnabled

Definition at line 16 of file UPseudoSupport.h.

Referenced by LMainPseudoAttachment::ExecuteSelf.

UInt16* UPseudoCmdStatusWrapper::outMark

Definition at line 18 of file UPseudoSupport.h.

Referenced by LMainPseudoAttachment::ExecuteSelf.

unsigned char* UPseudoCmdStatusWrapper::outName

Definition at line 19 of file UPseudoSupport.h.

Referenced by LMainPseudoAttachment::ExecuteSelf.

Boolean* UPseudoCmdStatusWrapper::outUsesMark

Definition at line 17 of file UPseudoSupport.h.

Referenced by LMainPseudoAttachment::ExecuteSelf.

The documentation for this struct was generated from the following file:
  • rf/support/powerplant/UPseudoSupport.h
Generated on Sun Feb 24 01:27:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CPseudoDlg Class Reference

#include <PseudoDlg.h>

Inheritance diagram for CPseudoDlg:

[legend]
Collaboration diagram for CPseudoDlg:

[legend]
List of all members.

Public Methods

CPseudoDlg (int dlgid, UWidget *pseudo, CWnd *pParent=NULL)
virtual | ~CPseudoDlg ()

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
virtual LRESULT | WindowProc (UINT message, WPARAM wParam, LPARAM lParam)
virtual BOOL | OnInitDialog ()

Protected Attributes

UWidget * m_pseudo

Constructor & Destructor Documentation

CPseudoDlg::CPseudoDlg | ( | int | dlgid,
 |  | UWidget * | pseudo,
 |  | CWnd * | pParent = NULL
 | ) |

Definition at line 42 of file PseudoDlg.cpp.

00043     : CDialog(dlgid, pParent), m_pseudo(pseudo)
00044 {
00045     //{{AFX_DATA_INIT(CPseudoDlg)
00046         // NOTE: the ClassWizard will add member initialization here
00047     //}}AFX_DATA_INIT
00048 }

CPseudoDlg::~CPseudoDlg ( ) [virtual]

Definition at line 50 of file PseudoDlg.cpp.

References EV_DESTROY, UWidget::GetWidgets, UCmdTarget::GetWidID, kUMainWidget, m_pseudo, and UEventSendMessage.

00051 {
00052     if(m_pseudo != 0L)
00053     {
00054         UEventSendMessage(m_pseudo->GetWidID(), EV_DESTROY, 0, 0L);
00055
00056         std::map<int, void *>::iterator k;
00057         for(k = m_pseudo->GetWidgets().begin(); k != m_pseudo->GetWidgets().end(); ++k)
00058         {
00059             CWnd *wnd = (CWnd *)(*k).second;
00060             if((*k).first != kUMainWidget)
00061                 delete wnd;
00062         }
00063     }
00064 }

Member Function Documentation

void CPseudoDlg::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 66 of file PseudoDlg.cpp.

References UWidget::DoDataExchange, UWidget::GetWidgets, kUMainWidget, m_pseudo, and UCMD_to_WINCTL.

00067 {
00068     CDialog::DoDataExchange(pDX);
00069
00070     if(m_pseudo != 0L)
00071     {
00072         std::map<int, void *>::iterator i;
00073         for(i = m_pseudo->GetWidgets().begin(); i != m_pseudo->GetWidgets().end(); ++i)
00074         {
00075             if((*i).first != kUMainWidget)
00076                 DDX_Control(pDX, UCMD_to_WINCTL((*i).first), *(CWnd *)(*i).second);
00077         }
00078
00079         m_pseudo->DoDataExchange(!pDX->m_bSaveAndValidate);
00080     }
00081
00082     //{{AFX_DATA_MAP(CPseudoDlg)
00083     //}}AFX_DATA_MAP
00084 }

BOOL CPseudoDlg::OnInitDialog ( ) [protected, virtual]

Definition at line 167 of file PseudoDlg.cpp.

References EV_CREATE, UCmdTarget::GetWidID, m_pseudo, TRUE, UEventSendMessage, and WinInitWidgets.

00168 {
00169     if(m_pseudo != 0L)
00170     {
00171         WinInitWidgets(this, m_pseudo);
00172         UEventSendMessage(m_pseudo->GetWidID(), EV_CREATE, 0, 0L);
00173     }
00174
00175     CDialog::OnInitDialog();
00176
00177     return TRUE;  // return TRUE unless you set the focus to a control
00178                   // EXCEPTION: OCX Property Pages should return FALSE
00179 }

LRESULT CPseudoDlg::WindowProc | ( | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [protected, virtual]

Definition at line 486 of file PseudoDlg.cpp.

References m_pseudo, and UWinPseudoWindowProc.

00487 {
00488     if(m_pseudo != 0L && !UWinPseudoWindowProc(this, m_pseudo, message, wParam, lParam))
00489         return 0;
00490
00491     return CDialog::WindowProc(message, wParam, lParam);
00492 }

Member Data Documentation

UWidget* CPseudoDlg::m_pseudo [protected]

Definition at line 56 of file PseudoDlg.h.

Referenced by DoDataExchange, OnInitDialog, WindowProc, and ~CPseudoDlg.

The documentation for this class was generated from the following files:
  • rf/support/mfc/PseudoDlg.h
  • rf/support/mfc/PseudoDlg.cpp
Generated on Sun Feb 24 01:27:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CPseudoDraw Class Reference

#include <PseudoDraw.h>

Inheritance diagram for CPseudoDraw:

[legend]
Collaboration diagram for CPseudoDraw:

[legend]
List of all members.

Public Methods

CPseudoDraw (UWidget *pseudo, int cmdid)
virtual | ~CPseudoDraw ()

Public Attributes

UWidget * m_pseudo
int | m_cmdid

Protected Methods

afx_msg void | OnPaint ()

Constructor & Destructor Documentation

CPseudoDraw::CPseudoDraw | ( | UWidget * | pseudo,
 |  | int | cmdid
 | ) |

Definition at line 18 of file PseudoDraw.cpp.

00018                                                    : m_pseudo(pseudo), m_cmdid(cmdid)
00019 {
00020 }

CPseudoDraw::~CPseudoDraw ( ) [virtual]

Definition at line 22 of file PseudoDraw.cpp.

00023 {
00024 }

Member Function Documentation

void CPseudoDraw::OnPaint ( ) [protected]

Definition at line 36 of file PseudoDraw.cpp.

References EV_CUSTOM_DRAW, UCmdTarget::GetWidID, m_cmdid, m_pseudo, and UEventSendMessage.

00037 {
00038     CPaintDC dc(this); // device context for painting
00039
00040     if(m_pseudo != 0L)
00041         UEventSendMessage(m_pseudo->GetWidID(), EV_CUSTOM_DRAW, m_cmdid, &dc);
00042 }

Member Data Documentation

int CPseudoDraw::m_cmdid

Definition at line 24 of file PseudoDraw.h.

Referenced by OnPaint.

UWidget* CPseudoDraw::m_pseudo

Definition at line 23 of file PseudoDraw.h.

Referenced by OnPaint.

The documentation for this class was generated from the following files:
  • rf/support/mfc/PseudoDraw.h
  • rf/support/mfc/PseudoDraw.cpp
Generated on Sun Feb 24 01:27:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UPseudoFakePane Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for UPseudoFakePane:

[legend]
Collaboration diagram for UPseudoFakePane:

[legend]
List of all members.

Public Methods

UPseudoFakePane (const SPaneInfo &inPaneInfo, LPseudoWinAttachment *inAttach)
virtual | ~UPseudoFakePane ()
virtual void | AdaptToSuperFrameSize (SInt32 inSurrWidthDelta, SInt32 inSurrHeightDelta, Boolean inRefresh)

Protected Methods

virtual void | ActivateSelf ()
virtual void | DeactivateSelf ()

Protected Attributes

LPseudoWinAttachment * m_Attach

Constructor & Destructor Documentation

UPseudoFakePane::UPseudoFakePane | ( | const SPaneInfo & | inPaneInfo,
 |  | LPseudoWinAttachment * | inAttach
 | ) |

Definition at line 998 of file UPseudoSupport.cpp.

00998                                                                                              :
00999     LPane(inPaneInfo), m_Attach(inAttach)
01000 {
01001 }

UPseudoFakePane::~UPseudoFakePane ( ) [virtual]

Definition at line 1003 of file UPseudoSupport.cpp.

01004 {
01005 }

Member Function Documentation

void UPseudoFakePane::ActivateSelf ( ) [protected, virtual]

Definition at line 1007 of file UPseudoSupport.cpp.

References EV_UPDATEFOCUS, and UEventNotifyMessage.

01008 {
01009     UEventNotifyMessage(EV_UPDATEFOCUS, 0, dynamic_cast<LWindow *>(GetSuperView()));
01010 }

void UPseudoFakePane::AdaptToSuperFrameSize | ( | SInt32 | inSurrWidthDelta,
 |  | SInt32 | inSurrHeightDelta,
 |  | Boolean | inRefresh
 | ) | [virtual]

Definition at line 1017 of file UPseudoSupport.cpp.

References LPseudoWinAttachment::CheckWindowSize, and m_Attach.

01021 {
01022     LPane::AdaptToSuperFrameSize(inSurrWidthDelta, inSurrHeightDelta, inRefresh);
01023
01024     m_Attach->CheckWindowSize();
01025 }

void UPseudoFakePane::DeactivateSelf ( ) [protected, virtual]

Definition at line 1012 of file UPseudoSupport.cpp.

References EV_UPDATEFOCUS, and UEventNotifyMessage.

01013 {
01014     UEventNotifyMessage(EV_UPDATEFOCUS, 1, dynamic_cast<LWindow *>(GetSuperView()));
01015 }

Member Data Documentation

LPseudoWinAttachment* UPseudoFakePane::m_Attach [protected]

Definition at line 152 of file UPseudoSupport.h.

Referenced by AdaptToSuperFrameSize.

The documentation for this class was generated from the following files:
  • rf/support/powerplant/UPseudoSupport.h
  • rf/support/powerplant/UPseudoSupport.cpp
Generated on Sun Feb 24 01:27:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CPseudoItem Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for CPseudoItem:

[legend]
Collaboration diagram for CPseudoItem:

[legend]
List of all members.

Public Methods

CPseudoItem (int widid, int cmdid)
virtual | ~CPseudoItem ()

Public Attributes

std::map< int, UStr > | m_texts
void * | m_data

Protected Methods

virtual void | GetDrawContentsSelf (const STableCell &inCell, SOutlineDrawContents &ioDrawContents)
virtual void | DrawRowAdornments (const Rect &inLocalRowRect)
virtual void | DrawCell (const STableCell &inCell, const Rect &inLocalCellRect)
virtual void | DoubleClick (const STableCell &inCell, const SMouseDownEvent &inMouseDown, const SOutlineDrawContents &inDrawContents, Boolean inHitText)
virtual void | SingleClick (const STableCell &inCell, const SMouseDownEvent &inMouseDown, const SOutlineDrawContents &inDrawContents, Boolean inHitText)

Protected Attributes

int | m_widid
int | m_cmdid

Private Methods

CPseudoItem ()
CPseudoItem (const CPseudoItem &inOriginal)
CPseudoItem & | operator= (const CPseudoItem &inOriginal)

Constructor & Destructor Documentation

CPseudoItem::CPseudoItem | ( | int | widid,
 |  | int | cmdid
 | ) |

Definition at line 630 of file UPseudoSupport.cpp.

00630                                              : m_widid(widid), m_cmdid(cmdid), m_data(0L)
00631 {
00632 }

CPseudoItem::~CPseudoItem ( ) [virtual]

Definition at line 634 of file UPseudoSupport.cpp.

00635 {
00636 }

CPseudoItem::CPseudoItem ( ) [private]

CPseudoItem::CPseudoItem ( const CPseudoItem & inOriginal ) [private]

Member Function Documentation

void CPseudoItem::DoubleClick | ( | const STableCell & | inCell,
 |  | const SMouseDownEvent & | inMouseDown,
 |  | const SOutlineDrawContents & | inDrawContents,
 |  | Boolean | inHitText
 | ) | [protected, virtual]

Definition at line 697 of file UPseudoSupport.cpp.

References EV_LIST_DBLCLICK, m_cmdid, m_texts, m_widid, UEventSendMessage, and UMAKEINT.

00702 {
00703     UStr name;
00704     std::map<int, UStr>::iterator i = m_texts.find(inCell.col - 1);
00705     if(i != m_texts.end())
00706     {
00707         name = (*i).second;
00708     }
00709     UEventSendMessage(m_widid,
00710         EV_LIST_DBLCLICK, UMAKEINT(m_cmdid, inCell.row - 1),
00711         (void *)(const char *)name);
00712
00713     LOutlineItem::DoubleClick(inCell, inMouseDown, inDrawContents, inHitText);
00714 }

void CPseudoItem::DrawCell | ( | const STableCell & | inCell,
 |  | const Rect & | inLocalCellRect
 | ) | [protected, virtual]

Definition at line 667 of file UPseudoSupport.cpp.

00668 {
00669     LOutlineItem::DrawCell(inCell, inLocalCellRect);
00670
00671     RGBColor c = UGAColorRamp::GetColor(colorRamp_Gray2);
00672     RGBForeColor(&c);
00673     MoveTo(inLocalCellRect.right - 1, inLocalCellRect.top);
00674     LineTo(inLocalCellRect.right - 1, inLocalCellRect.bottom);
00675 }

void CPseudoItem::DrawRowAdornments ( const Rect & inLocalRowRect ) [protected, virtual]

Definition at line 657 of file UPseudoSupport.cpp.

00659 {
00660     ShadeRow(UGAColorRamp::GetColor(colorRamp_White), inLocalRowRect);
00661     RGBColor c = UGAColorRamp::GetColor(colorRamp_Gray2);
00662     RGBForeColor(&c);
00663     MoveTo(inLocalRowRect.right, inLocalRowRect.top);
00664     LineTo(inLocalRowRect.right, inLocalRowRect.bottom);
00665 }

void CPseudoItem::GetDrawContentsSelf | ( | const STableCell & | inCell,
 |  | SOutlineDrawContents & | ioDrawContents
 | ) | [protected, virtual]

Definition at line 641 of file UPseudoSupport.cpp.

References m_texts.

00644 {
00645     std::map<int, UStr>::iterator i = m_texts.find(inCell.col);
00646     if(i != m_texts.end())
00647     {
00648         ioDrawContents.outShowSelection = true;
00649         LStr255 pstr((*i).second);
00650         LString::CopyPStr(pstr, ioDrawContents.outTextString);
00651     }
00652 }

CPseudoItem& CPseudoItem::operator= ( const CPseudoItem & inOriginal ) [private]

void CPseudoItem::SingleClick | ( | const STableCell & | inCell,
 |  | const SMouseDownEvent & | inMouseDown,
 |  | const SOutlineDrawContents & | inDrawContents,
 |  | Boolean | inHitText
 | ) | [protected, virtual]

Definition at line 677 of file UPseudoSupport.cpp.

References EV_LIST_SELECTING, m_cmdid, m_texts, m_widid, UEventSendMessage, and UMAKEINT.

00682 {
00683     UStr name;
00684     std::map<int, UStr>::iterator i = m_texts.find(inCell.col - 1);
00685     if(i != m_texts.end())
00686     {
00687         name = (*i).second;
00688     }
00689     UEventSendMessage(m_widid,
00690         EV_LIST_SELECTING, UMAKEINT(m_cmdid, inCell.row - 1),
00691         (void *)(const char *)name);
00692
00693     LOutlineItem::SingleClick(inCell, inMouseDown, inDrawContents, inHitText);
00694 }

Member Data Documentation

int CPseudoItem::m_cmdid [protected]

Definition at line 183 of file UPseudoSupport.h.

Referenced by DoubleClick, and SingleClick.

void* CPseudoItem::m_data

Definition at line 165 of file UPseudoSupport.h.

Referenced by UWidget::OnListGetInfo, UWidget::OnListRowGetData, and UWidget::OnListRowSetData.

std::map<int, UStr> CPseudoItem::m_texts

Definition at line 164 of file UPseudoSupport.h.

Referenced by DoubleClick, GetDrawContentsSelf, UWidget::OnListGetInfo, UWidget::OnListInsert, and SingleClick.

int CPseudoItem::m_widid [protected]

Definition at line 183 of file UPseudoSupport.h.

Referenced by DoubleClick, and SingleClick.

The documentation for this class was generated from the following files:
  • rf/support/powerplant/UPseudoSupport.h
  • rf/support/powerplant/UPseudoSupport.cpp
Generated on Sun Feb 24 01:27:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CPseudoList Class Reference

#include <pseudolist.h>

Inheritance diagram for CPseudoList:

[legend]
Collaboration diagram for CPseudoList:

[legend]
List of all members.

Public Methods

CPseudoList (int wid, int cmd)
virtual | ~CPseudoList ()

Protected Methods

afx_msg void | OnLButtonDblClk (UINT nFlags, CPoint point)

Protected Attributes

int | m_cmd
int | m_wid

Constructor & Destructor Documentation

CPseudoList::CPseudoList | ( | int | wid,
 |  | int | cmd
 | ) |

Definition at line 17 of file PseudoList.cpp.

00017                                          : m_wid(wid), m_cmd(cmd)
00018 {
00019 }

CPseudoList::~CPseudoList ( ) [virtual]

Definition at line 21 of file PseudoList.cpp.

00022 {
00023 }

Member Function Documentation

void CPseudoList::OnLButtonDblClk | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 35 of file PseudoList.cpp.

References EV_LIST_DBLCLICK, m_cmd, m_wid, UEventSendMessage, and UMAKEINT.

00036 {
00037     UINT pFlags;
00038     int nItem = HitTest(point, &pFlags);
00039     if(nItem != -1)
00040     {
00041         CString s = GetItemText(nItem, 0);
00042
00043         UEventSendMessage(m_wid, EV_LIST_DBLCLICK, UMAKEINT(m_cmd, nItem),
00044             (void *)(const char *)s);
00045     }
00046
00047     CListCtrl::OnLButtonDblClk(nFlags, point);
00048 }

Member Data Documentation

int CPseudoList::m_cmd [protected]

Definition at line 36 of file pseudolist.h.

Referenced by OnLButtonDblClk.

int CPseudoList::m_wid [protected]

Definition at line 36 of file pseudolist.h.

Referenced by OnLButtonDblClk.

The documentation for this class was generated from the following files:
  • rf/support/mfc/pseudolist.h
  • rf/support/mfc/PseudoList.cpp
Generated on Sun Feb 24 01:27:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UPseudoPageHider Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for UPseudoPageHider:

[legend]
Collaboration diagram for UPseudoPageHider:

[legend]
List of all members.

Public Types

enum | { class_ID = FOUR_CHAR_CODE('UPPH') }

Public Methods

UPseudoPageHider (LStream *inStream)
virtual | ~UPseudoPageHider ()
void | SetWidID (int widid)
virtual void | ListenToMessage (MessageT inMessage, void *ioParam)

Protected Methods

void | DoRotate (int entry)
virtual void | ExecuteSelf (MessageT inMessage, void *ioParam)

Protected Attributes

std::vector< PaneIDT > | fViewSuite
int | fWidid
int | fCurSel
LPageController * | fPageCtrl

Member Enumeration Documentation

anonymous enum

Enumeration values:
class_ID

Definition at line 67 of file UPseudoSupport.h.

00067 { class_ID = FOUR_CHAR_CODE('UPPH') };

Constructor & Destructor Documentation

UPseudoPageHider::UPseudoPageHider ( LStream * inStream )

Definition at line 891 of file UPseudoSupport.cpp.

References fViewSuite, UStr::length, and UStr::set.

00891                                                     : LAttachment(inStream),
00892     fWidid(-1), fCurSel(-1), fPageCtrl(0L)
00893 {
00894     SetMessage(msg_FinishCreate);
00895
00896     LStr255 pstr;
00897     inStream->ReadPString(pstr);
00898
00899     UStr str(pstr);
00900     const char *ptr = str;
00901     while(ptr != 0L)
00902     {
00903         PaneIDT paneID;
00904         const char *tmp = strchr(ptr, ',');
00905         if(tmp != 0L)
00906         {
00907             UStr stmp;
00908             size_t offset = tmp - ptr;
00909             stmp.set(ptr, offset);
00910             ptr += offset + 1;
00911             if(stmp.length() == 4)
00912             {
00913                 paneID = *(PaneIDT *)(char *)stmp;
00914                 fViewSuite.push_back(paneID);
00915             }
00916         }
00917         else
00918         {
00919             if(strlen(ptr) == 4)
00920             {
00921                 paneID = *(PaneIDT *)ptr;
00922                 fViewSuite.push_back(paneID);
00923             }
00924             ptr = 0L;
00925         }
00926     }
00927 }

UPseudoPageHider::~UPseudoPageHider ( ) [virtual]

Definition at line 950 of file UPseudoSupport.cpp.

00951 {
00952 }

Member Function Documentation

void UPseudoPageHider::DoRotate ( int entry ) [protected]

Definition at line 954 of file UPseudoSupport.cpp.

References EV_CMD, fCurSel, fPageCtrl, fViewSuite, fWidid, macpp_findwindow, macpp_getcmdid, and UEventSendMessage.

Referenced by ListenToMessage.

00955 {
00956     if(fPageCtrl == 0L)
00957         return;
00958
00959     int cmdid;
00960     if(macpp_getcmdid(fPageCtrl->GetPaneID(), cmdid) && entry >= 0 && entry < fViewSuite.size() &&
00961         entry != fCurSel)
00962     {
00963         fCurSel = entry;
00964
00965         LWindow *win = macpp_findwindow(fPageCtrl);
00966         if(win == 0L)
00967             return;
00968
00969         LPane* samplePanel;
00970         std::vector<PaneIDT>::iterator i;
00971         for(i = fViewSuite.begin(); i != fViewSuite.end(); ++i)
00972         {
00973             samplePanel = win->FindPaneByID(*i);
00974             if(samplePanel != 0L)
00975                 samplePanel->Hide();
00976         }
00977
00978         samplePanel = win->FindPaneByID(fViewSuite[entry]);
00979         if(samplePanel == 0L)
00980             return;
00981
00982         samplePanel->Show();
00983
00984         if(fWidid != -1)
00985             UEventSendMessage(fWidid, EV_CMD, cmdid, (void *)entry);
00986     }
00987 }

void UPseudoPageHider::ExecuteSelf | ( | MessageT | inMessage,
 |  | void * | ioParam
 | ) | [protected, virtual]

Definition at line 929 of file UPseudoSupport.cpp.

References fPageCtrl, and UAppConsole.

00932 {
00933     if(inMessage == msg_FinishCreate)
00934     {
00935         LPane *pane = reinterpret_cast<LPane*>(ioParam);
00936         fPageCtrl = dynamic_cast<LPageController*>(pane);
00937         if(fPageCtrl == 0L)
00938         {
00939             UAppConsole("The UPseudoPageHider attachement does not have any LPageController to attach to.");
00940         }
00941         else
00942         {
00943             // add ourself to the broadcast so we receive the changes
00944             fPageCtrl->StartBroadcasting ();
00945             fPageCtrl->AddListener (this);
00946         }
00947     }
00948 }

void UPseudoPageHider::ListenToMessage | ( | MessageT | inMessage,
 |  | void * | ioParam
 | ) | [virtual]

Definition at line 989 of file UPseudoSupport.cpp.

References DoRotate, and fPageCtrl.

00990 {
00991     if(fPageCtrl != 0L && inMessage == fPageCtrl->GetPaneID())
00992     {
00993         SInt32 currPageIndex = *static_cast<SInt32 *>(ioParam);
00994         DoRotate(currPageIndex - 1);
00995     }
00996 }

void UPseudoPageHider::SetWidID ( int widid ) [inline]

Definition at line 72 of file UPseudoSupport.h.

References fWidid.

Referenced by macpp_fecthview.

00072 { fWidid = widid; }

Member Data Documentation

int UPseudoPageHider::fCurSel [protected]

Definition at line 87 of file UPseudoSupport.h.

Referenced by DoRotate.

class LPageController* UPseudoPageHider::fPageCtrl [protected]

Definition at line 88 of file UPseudoSupport.h.

Referenced by DoRotate, ExecuteSelf, and ListenToMessage.

std::vector<PaneIDT> UPseudoPageHider::fViewSuite [protected]

Definition at line 85 of file UPseudoSupport.h.

Referenced by DoRotate, and UPseudoPageHider.

int UPseudoPageHider::fWidid [protected]

Definition at line 86 of file UPseudoSupport.h.

Referenced by DoRotate, and SetWidID.

The documentation for this class was generated from the following files:
  • rf/support/powerplant/UPseudoSupport.h
  • rf/support/powerplant/UPseudoSupport.cpp
Generated on Sun Feb 24 01:27:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UPseudoPlaceHolder Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for UPseudoPlaceHolder:

[legend]
Collaboration diagram for UPseudoPlaceHolder:

[legend]
List of all members.

Public Types

enum | { class_ID = FOUR_CHAR_CODE('UPLH') }

Public Methods

UPseudoPlaceHolder (LStream *inStream)
virtual | ~UPseudoPlaceHolder ()
void | DoRotate (int entry)
void | SetWidID (int widid)
LView * | GetCurrentView (void)
virtual void | ListenToMessage (MessageT inMessage, void *ioParam)

Protected Methods

virtual void | FinishCreateSelf ()

Protected Attributes

std::vector< short > | fViewSuite
LView * | fCurrentView
PaneIDT | fController
int | fWidid

Member Enumeration Documentation

anonymous enum

Enumeration values:
class_ID

Definition at line 42 of file UPseudoSupport.h.

00042 { class_ID = FOUR_CHAR_CODE('UPLH') };

Constructor & Destructor Documentation

UPseudoPlaceHolder::UPseudoPlaceHolder ( LStream * inStream )

Definition at line 788 of file UPseudoSupport.cpp.

References fController, fViewSuite, and UStr::set.

00788                                                         : LPlaceHolder(inStream),
00789     fCurrentView(0L), fWidid(-1)
00790 {
00791     LStr255 pstr;
00792     inStream->ReadPString(pstr);
00793     *inStream >> fController;
00794
00795     UStr str(pstr);
00796     const char *ptr = str;
00797     while(ptr != 0L)
00798     {
00799         int v;
00800         const char *tmp = strchr(ptr, ',');
00801         if(tmp != 0L)
00802         {
00803             UStr stmp;
00804             size_t offset = tmp - ptr;
00805             stmp.set(ptr, offset);
00806             ptr += offset + 1;
00807             if(sscanf(stmp, "%d", &v) == 1)
00808                 fViewSuite.push_back(v);
00809         }
00810         else
00811         {
00812             if(sscanf(ptr, "%d", &v) == 1)
00813                 fViewSuite.push_back(v);
00814             ptr = 0L;
00815         }
00816     }
00817 }

UPseudoPlaceHolder::~UPseudoPlaceHolder ( ) [virtual]

Definition at line 819 of file UPseudoSupport.cpp.

00820 {
00821 }

Member Function Documentation

void UPseudoPlaceHolder::DoRotate ( int entry )

Definition at line 823 of file UPseudoSupport.cpp.

References EV_PAGE_CHANGED, fCurrentView, fViewSuite, fWidid, gTurnOffBroadcast, macpp_findwindow, macpp_getcmdid, UEventSendMessage, and UMAKEINT.

Referenced by FinishCreateSelf, and ListenToMessage.

00824 {
00825     int cmdid;
00826     if(macpp_getcmdid(GetPaneID(), cmdid) && entry >= 0 && entry < fViewSuite.size())
00827     {
00828         LWindow *win = macpp_findwindow(this);
00829         if(win == 0L)
00830             return;
00831
00832         LView* samplePanel = UReanimator::CreateView(fViewSuite[entry], this, win);
00833         if(samplePanel == 0L)
00834             return;
00835
00836         InstallOccupant (samplePanel);
00837
00838         LView *oldView = fCurrentView;
00839
00840         if (fCurrentView != 0L)
00841         {
00842             fCurrentView->Hide ();
00843             fCurrentView = nil;
00844         }
00845
00846         Refresh();
00847         fCurrentView = samplePanel;
00848
00849         if(fWidid != -1 && !gTurnOffBroadcast)
00850             UEventSendMessage(fWidid, EV_PAGE_CHANGED, UMAKEINT(cmdid, entry), 0L);
00851
00852         if (oldView != 0L)
00853         {
00854             delete oldView;
00855         }
00856
00857     }
00858 }

void UPseudoPlaceHolder::FinishCreateSelf ( ) [protected, virtual]

Definition at line 869 of file UPseudoSupport.cpp.

References DoRotate, fController, and macpp_findwindow.

00870 {
00871     DoRotate(0);
00872
00873     LWindow *win = macpp_findwindow(this);
00874     if(win == 0L)
00875         return;
00876
00877     LPageController *controller = dynamic_cast<LPageController*>(win->FindPaneByID(fController));
00878     if (controller != 0L)
00879     {
00880         controller->StartBroadcasting ();
00881         controller->AddListener (this);
00882     }
00883     LTabsControl *controller2 = dynamic_cast<LTabsControl*>(win->FindPaneByID(fController));
00884     if (controller2 != 0L)
00885     {
00886         controller2->StartBroadcasting ();
00887         controller2->AddListener (this);
00888     }
00889 }

LView* UPseudoPlaceHolder::GetCurrentView ( void ) [inline]

Definition at line 49 of file UPseudoSupport.h.

References fCurrentView.

Referenced by UWidget::OnPageChanged.

00049 { return fCurrentView; }

void UPseudoPlaceHolder::ListenToMessage | ( | MessageT | inMessage,
 |  | void * | ioParam
 | ) | [virtual]

Definition at line 860 of file UPseudoSupport.cpp.

References DoRotate, and fController.

00861 {
00862     if(inMessage == fController)
00863     {
00864         SInt32 currPageIndex = *static_cast<SInt32 *>(ioParam);
00865         DoRotate(currPageIndex - 1);
00866     }
00867 }

void UPseudoPlaceHolder::SetWidID ( int widid ) [inline]

Definition at line 48 of file UPseudoSupport.h.

References fWidid.

Referenced by macpp_fecthview.

00048 { fWidid = widid; }

Member Data Documentation

PaneIDT UPseudoPlaceHolder::fController [protected]

Definition at line 60 of file UPseudoSupport.h.

Referenced by FinishCreateSelf, ListenToMessage, and UPseudoPlaceHolder.

LView* UPseudoPlaceHolder::fCurrentView [protected]

Definition at line 59 of file UPseudoSupport.h.

Referenced by DoRotate, and GetCurrentView.

std::vector<short> UPseudoPlaceHolder::fViewSuite [protected]

Definition at line 58 of file UPseudoSupport.h.

Referenced by DoRotate, and UPseudoPlaceHolder.

int UPseudoPlaceHolder::fWidid [protected]

Definition at line 61 of file UPseudoSupport.h.

Referenced by DoRotate, and SetWidID.

The documentation for this class was generated from the following files:
  • rf/support/powerplant/UPseudoSupport.h
  • rf/support/powerplant/UPseudoSupport.cpp
Generated on Sun Feb 24 01:27:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CPseudoRotButton Class Reference

#include <PseudoButton.h>

Inheritance diagram for CPseudoRotButton:

[legend]
Collaboration diagram for CPseudoRotButton:

[legend]
List of all members.

Public Methods

CPseudoRotButton ()
virtual bool | LoadXPMs (const int *rsrcid, int numrsrc)
virtual void | DoRotate (int index)
int | GetCurrent (void) const
virtual | ~CPseudoRotButton ()

Protected Attributes

std::vector< HBITMAP > | m_bitmaps
std::vector< HBITMAP > | m_disbitmaps
int | m_curindex

Constructor & Destructor Documentation

CPseudoRotButton::CPseudoRotButton ( )

Definition at line 152 of file PseudoButton.cpp.

00152                                    : m_curindex(-1)
00153 {
00154 }

CPseudoRotButton::~CPseudoRotButton ( ) [virtual]

Definition at line 156 of file PseudoButton.cpp.

References CPseudoButton::m_bitmap, m_bitmaps, CPseudoButton::m_disbitmap, and m_disbitmaps.

00157 {
00158     m_bitmap = 0L;
00159     m_disbitmap = 0L;
00160     std::vector<HBITMAP>::iterator i;
00161     for(i = m_bitmaps.begin(); i != m_bitmaps.end(); ++i)
00162     {
00163         HBITMAP bmap = *i;
00164         AfxDeleteObject((HGDIOBJ*)&bmap);
00165     }
00166     for(i = m_disbitmaps.begin(); i != m_disbitmaps.end(); ++i)
00167     {
00168         HBITMAP bmap = *i;
00169         AfxDeleteObject((HGDIOBJ*)&bmap);
00170     }
00171 }

Member Function Documentation

void CPseudoRotButton::DoRotate ( int index ) [virtual]

Definition at line 201 of file PseudoButton.cpp.

References CPseudoButton::m_bitmap, m_bitmaps, m_curindex, CPseudoButton::m_disbitmap, m_disbitmaps, and TRUE.

Referenced by LoadXPMs, and UWidget::OnSetState.

00202 {
00203     if(index < 0 || index > m_bitmaps.size() || index > m_disbitmaps.size() ||
00204         m_curindex == index)
00205         return;
00206
00207     SetBitmap(m_bitmaps[index]);
00208     Invalidate(TRUE);
00209     m_curindex = index;
00210     m_bitmap = m_bitmaps[index];
00211     m_disbitmap = m_disbitmaps[index];
00212 }

int CPseudoRotButton::GetCurrent ( void ) const [inline]

Definition at line 104 of file PseudoButton.h.

References m_curindex.

Referenced by UWidget::OnGetState.

00104 { return m_curindex; }

bool CPseudoRotButton::LoadXPMs | ( | const int * | rsrcid,
 |  | int | numrsrc
 | ) | [virtual]

Definition at line 173 of file PseudoButton.cpp.

References DD_PIXMAP, DoRotate, CPseudoButton::loadIcon, m_bitmaps, m_disbitmaps, and UMakeBitmap.

00174 {
00175     CString sicon;
00176     COLORREF back = ::GetSysColor(COLOR_BTNFACE);
00177     COLORREF fore = ::GetSysColor(COLOR_GRAYTEXT);
00178
00179     for(int i = 0; i < numrsrc; i++)
00180     {
00181         if(!CPseudoButton::loadIcon(sicon, rsrcid[i]))
00182             return false;
00183
00184         int w, h;
00185         HBITMAP bmap = UMakeBitmap((const char *)sicon, w, h, DD_PIXMAP, back, fore);
00186         if(bmap == 0L)
00187             return false;
00188
00189         HBITMAP disbmap = UMakeBitmap((const char *)sicon, w, h, DD_PIXMAP, back, fore, false);
00190         if(disbmap == 0L)
00191             return false;
00192
00193         m_bitmaps.push_back(bmap);
00194         m_disbitmaps.push_back(disbmap);
00195     }
00196
00197     DoRotate(0);
00198     return true;
00199 }

Member Data Documentation

std::vector<HBITMAP> CPseudoRotButton::m_bitmaps [protected]

Definition at line 95 of file PseudoButton.h.

Referenced by DoRotate, LoadXPMs, and ~CPseudoRotButton.

int CPseudoRotButton::m_curindex [protected]

Definition at line 97 of file PseudoButton.h.

Referenced by DoRotate, and GetCurrent.

std::vector<HBITMAP> CPseudoRotButton::m_disbitmaps [protected]

Definition at line 96 of file PseudoButton.h.

Referenced by DoRotate, LoadXPMs, and ~CPseudoRotButton.

The documentation for this class was generated from the following files:
  • rf/support/mfc/PseudoButton.h
  • rf/support/mfc/PseudoButton.cpp
Generated on Sun Feb 24 01:27:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UPseudoRotButton Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for UPseudoRotButton:

[legend]
Collaboration diagram for UPseudoRotButton:

[legend]
List of all members.

Public Types

enum | { class_ID = FOUR_CHAR_CODE('UPRB') }

Public Methods

UPseudoRotButton (LStream *inStream, ClassIDT inImpID=LBevelButton::imp_class_ID)
virtual | ~UPseudoRotButton ()
virtual void | DoRotate (int icon, bool refresh=true)
int | GetCurrentState (void) const

Protected Methods

void | ReadIconsID (LStream *inStream, std::vector< short > &res)

Protected Attributes

std::vector< short > | fIconSuite
int | fCurrentIcon

Member Enumeration Documentation

anonymous enum

Enumeration values:
class_ID

Definition at line 25 of file UPseudoSupport.h.

00025 { class_ID = FOUR_CHAR_CODE('UPRB') };

Constructor & Destructor Documentation

UPseudoRotButton::UPseudoRotButton | ( | LStream * | inStream,
 |  | ClassIDT | inImpID = LBevelButton::imp_class_ID
 | ) |

Definition at line 727 of file UPseudoSupport.cpp.

References DoRotate, fIconSuite, and ReadIconsID.

00727                                                                       : LBevelButton(inStream, inImpID), fCurrentIcon(0)
00728 {
00729     ReadIconsID(inStream, fIconSuite);
00730
00731     if(fIconSuite.size() != 0)
00732         DoRotate(0, false);
00733 }

UPseudoRotButton::~UPseudoRotButton ( ) [virtual]

Definition at line 735 of file UPseudoSupport.cpp.

00736 {
00737 }

Member Function Documentation

void UPseudoRotButton::DoRotate | ( | int | icon,
 |  | bool | refresh = true
 | ) | [virtual]

Definition at line 768 of file UPseudoSupport.cpp.

References fCurrentIcon, and fIconSuite.

Referenced by UWidget::OnSetState, and UPseudoRotButton.

00769 {
00770     if(fCurrentIcon != icon && icon >= 0 && icon < fIconSuite.size())
00771     {
00772         fCurrentIcon = icon;
00773         ControlButtonContentInfo info;
00774         GetContentInfo(info);
00775         if(info.contentType == kControlContentCIconRes ||
00776             info.contentType == kControlContentIconSuiteRes ||
00777             info.contentType == kControlContentICONRes ||
00778             info.contentType == kControlContentPictRes)
00779         {
00780             info.u.resID = fIconSuite[icon];
00781             SetContentInfo(info);
00782         }
00783         if(refresh)
00784             Refresh();
00785     }
00786 }

int UPseudoRotButton::GetCurrentState ( void ) const [inline]

Definition at line 31 of file UPseudoSupport.h.

References fCurrentIcon.

Referenced by UWidget::OnGetState.

00031 { return fCurrentIcon; }

void UPseudoRotButton::ReadIconsID | ( | LStream * | inStream,
 |  | std::vector< short > & | res
 | ) | [protected]

Definition at line 739 of file UPseudoSupport.cpp.

References UStr::set.

Referenced by UPseudoRotButton.

00740 {
00741     LStr255 pstr;
00742
00743     inStream->ReadPString(pstr);
00744     UStr str(pstr);
00745     const char *ptr = str;
00746     while(ptr != 0L)
00747     {
00748         int v;
00749         const char *tmp = strchr(ptr, ',');
00750         if(tmp != 0L)
00751         {
00752             UStr stmp;
00753             size_t offset = tmp - ptr;
00754             stmp.set(ptr, offset);
00755             ptr += offset + 1;
00756             if(sscanf(stmp, "%d", &v) == 1)
00757                 res.push_back(v);
00758         }
00759         else
00760         {
00761             if(sscanf(ptr, "%d", &v) == 1)
00762                 res.push_back(v);
00763             ptr = 0L;
00764         }
00765     }
00766 }

Member Data Documentation

int UPseudoRotButton::fCurrentIcon [protected]

Definition at line 36 of file UPseudoSupport.h.

Referenced by DoRotate, and GetCurrentState.

std::vector<short> UPseudoRotButton::fIconSuite [protected]

Definition at line 35 of file UPseudoSupport.h.

Referenced by DoRotate, and UPseudoRotButton.

The documentation for this class was generated from the following files:
  • rf/support/powerplant/UPseudoSupport.h
  • rf/support/powerplant/UPseudoSupport.cpp
Generated on Sun Feb 24 01:27:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CPseudoToggle Class Reference

#include <PseudoButton.h>

Inheritance diagram for CPseudoToggle:

[legend]
Collaboration diagram for CPseudoToggle:

[legend]
List of all members.

Public Methods

CPseudoToggle ()
~CPseudoToggle ()
virtual void | DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct)
virtual void | SetState (int state)
int | GetState (void) const
void | ToggleBtn ()
void | SetRadio (bool state)
bool | IsRadio (void) const
void | SetGroup (const char *group)
const char * | GetGroup (void) const
afx_msg void | OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags)
afx_msg void | OnLButtonUp (UINT nFlags, CPoint point)
afx_msg void | OnChar (UINT nChar, UINT nRepCnt, UINT nFlags)

Protected Attributes

int | m_flag
bool | m_radio
CString | m_group

Constructor & Destructor Documentation

CPseudoToggle::CPseudoToggle ( )

Definition at line 223 of file PseudoButton.cpp.

References m_flag, and m_radio.

00224 {
00225     m_flag = 0;
00226     m_radio = false;
00227 }

CPseudoToggle::~CPseudoToggle ( )

Definition at line 229 of file PseudoButton.cpp.

00230 {
00231 }

Member Function Documentation

void CPseudoToggle::DrawItem ( LPDRAWITEMSTRUCT lpDrawItemStruct ) [virtual]

Reimplemented from CPseudoButton.

Definition at line 260 of file PseudoButton.cpp.

References CPseudoButton::DrawItem.

00261 {
00262     if(m_flag)
00263         lpDIS->itemState |= ODS_SELECTED;
00264     CPseudoButton::DrawItem(lpDIS);
00265 }

const char* CPseudoToggle::GetGroup ( void ) const [inline]

Definition at line 153 of file PseudoButton.h.

References m_group.

Referenced by SetState.

00153 { return m_group; }

int CPseudoToggle::GetState ( void ) const [inline]

Definition at line 146 of file PseudoButton.h.

References m_flag.

Referenced by UWidget::OnGetState, and ToggleBtn.

00146 { return m_flag;}

bool CPseudoToggle::IsRadio ( void ) const [inline]

Definition at line 151 of file PseudoButton.h.

References m_radio.

Referenced by SetState.

00151 { return m_radio; }

afx_msg void CPseudoToggle::OnChar | ( | UINT | nChar,
 |  | UINT | nRepCnt,
 |  | UINT | nFlags
 | ) |

afx_msg void CPseudoToggle::OnKeyDown | ( | UINT | nChar,
 |  | UINT | nRepCnt,
 |  | UINT | nFlags
 | ) |

void CPseudoToggle::OnLButtonUp | ( | UINT | nFlags,
 |  | CPoint | point
 | ) |

Reimplemented from CCJFlatButton.

Definition at line 267 of file PseudoButton.cpp.

References CCJFlatButton::OnLButtonUp, PtInRect, and ToggleBtn.

00268 {
00269     CRect rect;
00270     GetClientRect(&rect);
00271
00272     //check you are still on the button
00273     if(PtInRect(rect, point))
00274         ToggleBtn();
00275
00276     CPseudoButton::OnLButtonUp(nFlags, point);
00277 }

void CPseudoToggle::SetGroup ( const char * group ) [inline]

Definition at line 152 of file PseudoButton.h.

References m_group.

00152 { m_group = group; }

void CPseudoToggle::SetRadio ( bool state ) [inline]

Definition at line 150 of file PseudoButton.h.

References m_radio.

00150 { m_radio = state; }

void CPseudoToggle::SetState ( int state ) [virtual]

Definition at line 233 of file PseudoButton.cpp.

References GetGroup, IsRadio, m_flag, m_group, and TRUE.

Referenced by UCmdUI::Check, UWidget::OnSetState, and ToggleBtn.

00234 {
00235     int newstate = state ? 1 : 0;
00236     if(m_flag == newstate)
00237         return;
00238
00239     m_flag = newstate;
00240     Invalidate(TRUE);
00241
00242     if(state && IsRadio() && !m_group.IsEmpty())
00243     {
00244         CWnd *hwndChild, *parent = GetParent();
00245         for (hwndChild = parent->GetTopWindow(); hwndChild != 0L; hwndChild = hwndChild->GetNextWindow())
00246         {
00247             if(hwndChild != this && hwndChild->IsWindowEnabled() && hwndChild->IsKindOf(RUNTIME_CLASS(CPseudoToggle)))
00248             {
00249                 CPseudoToggle *btn = (CPseudoToggle *)hwndChild;
00250                 if(btn->IsRadio() && m_group == btn->GetGroup())
00251                 {
00252                     btn->SetState(0);
00253                     break;
00254                 }
00255             }
00256         }
00257     }
00258 }

void CPseudoToggle::ToggleBtn ( ) [inline]

Definition at line 147 of file PseudoButton.h.

References GetState, and SetState.

Referenced by OnLButtonUp.

00147 { SetState(GetState() == 0 ? 1:0);}

Member Data Documentation

int CPseudoToggle::m_flag [protected]

Definition at line 135 of file PseudoButton.h.

Referenced by CPseudoToggle, GetState, and SetState.

CString CPseudoToggle::m_group [protected]

Definition at line 137 of file PseudoButton.h.

Referenced by GetGroup, SetGroup, and SetState.

bool CPseudoToggle::m_radio [protected]

Definition at line 136 of file PseudoButton.h.

Referenced by CPseudoToggle, IsRadio, and SetRadio.

The documentation for this class was generated from the following files:
  • rf/support/mfc/PseudoButton.h
  • rf/support/mfc/PseudoButton.cpp
Generated on Sun Feb 24 01:27:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UPStr Class Reference

up to 255 characters pascal and C string. More...

#include <ustr.h>

Inheritance diagram for UPStr:

[legend]
Collaboration diagram for UPStr:

[legend]
List of all members.

Public Methods

UPStr ()
UPStr (const char *newstr)
UPStr (const unsigned char *newstr)
UPStr (const UPStr &newstr)
virtual | ~UPStr ()
bool | empty (void) const
unsigned int | length (void) const
const char * | operator= (const char *newstr)
set to a new C String (0L is OK). More...

const unsigned char * | operator= (const unsigned char *newstr)
set to a new P String (0L is OK). More...

const UPStr & | operator= (const UPStr &newstr)
set according to another UPStr. More...

const UPStr & | set (const char *buf, unsigned int len)
set from a buffer. More...

operator const char * () const
as a C string. More...

operator char * ()
as a C string. More...

const char * | c_str () const
as a C string. More...

operator const unsigned char * () const
as a P string. More...

operator unsigned char * ()
as a P string. More...

const unsigned char * | p_str () const
as a P string. More...

UPStr & | operator<< (const char *addToStr)
concatenate. More...

UPStr & | operator<< (char addToStr)
concatenate. More...

UPStr & | operator<< (int addToStr)
concatenate. More...

bool | endsWith (char c) const
const UPStr & | replace (char which, char bywhich)
replace a character. More...

Protected Methods

void | flush (void)

Protected Attributes

char * | str
the String. More...

Detailed Description

up to 255 characters pascal and C string.

Definition at line 39 of file ustr.h.

Constructor & Destructor Documentation

UPStr::UPStr ( ) [inline]

Definition at line 42 of file ustr.h.

00042 : str(0L) {}

UPStr::UPStr ( const char * newstr ) [inline]

Definition at line 43 of file ustr.h.

00044     {
00045         str = 0L;
00046         *this = newstr;
00047     }

UPStr::UPStr ( const unsigned char * newstr ) [inline]

Definition at line 48 of file ustr.h.

00049     {
00050         str = 0L;
00051         *this = newstr;
00052     }

UPStr::UPStr ( const UPStr & newstr ) [inline]

Definition at line 53 of file ustr.h.

00054     {
00055         str = 0L;
00056         *this = newstr;
00057     }

virtual UPStr::~UPStr ( ) [inline, virtual]

Definition at line 58 of file ustr.h.

00058 {flush();}

Member Function Documentation

const char* UPStr::c_str ( ) const [inline]

as a C string.

Definition at line 77 of file ustr.h.

00077 {return str == 0L ? "" : str + 1;}

bool UPStr::empty ( void ) const [inline]

Definition at line 60 of file ustr.h.

Referenced by CvsPrefs::empty, and CvsPrefs::ServerName.

00060 {return str == 0L || str[0] == '\0';}

bool UPStr::endsWith ( char c ) const [inline]

Definition at line 96 of file ustr.h.

00096 {return str == 0L ? false : str[str[0]] == c;}

void UPStr::flush ( void ) [protected]

Definition at line 46 of file ustr.cpp.

References free, and str.

Referenced by operator=, and set.

00047 {
00048     if(str == 0L)
00049         return;
00050     free(str);
00051     str = 0L;
00052 }

unsigned int UPStr::length ( void ) const [inline]

Definition at line 61 of file ustr.h.

Referenced by CvsPrefs::length, operator<<, and PCPStr::SizeOf.

00061 {return str == 0L ? 0 : (unsigned char)str[0];}

UPStr::operator char * ( ) [inline]

as a C string.

Reimplemented in PCPStr.

Definition at line 75 of file ustr.h.

References EGCS_CONST.

00075 {return str == 0L ? 0L : str + 1;}

UPStr::operator const char * ( ) const [inline]

as a C string.

Reimplemented in PCPStr.

Definition at line 73 of file ustr.h.

00073 {return str == 0L ? "" : str + 1;}

UPStr::operator const unsigned char * ( ) const [inline]

as a P string.

Reimplemented in PCPStr.

Definition at line 80 of file ustr.h.

00081         {return str == 0L ? (unsigned char *)"" : (unsigned char *)str;}

UPStr::operator unsigned char * ( ) [inline]

as a P string.

Reimplemented in PCPStr.

Definition at line 83 of file ustr.h.

References EGCS_CONST.

00084         {return str == 0L ? (unsigned char *)"" : (unsigned char *)str;}

UPStr & UPStr::operator<< ( int addToStr )

concatenate.

Definition at line 177 of file ustr.cpp.

00178 {
00179     char astr[50];
00180     sprintf(astr, "%d", addToStr);
00181     return *this << astr;
00182 }

UPStr & UPStr::operator<< ( char addToStr )

concatenate.

Definition at line 170 of file ustr.cpp.

00171 {
00172     char astr[2] = {'\0', '\0'};
00173     astr[0] = addToStr;
00174     return *this << astr;
00175 }

UPStr & UPStr::operator<< ( const char * addToStr )

concatenate.

Definition at line 144 of file ustr.cpp.

References kMaxChar, length, realloc, and str.

00145 {
00146     if(addToStr == 0L)
00147         return *this;
00148
00149     if(str == 0L)
00150     {
00151         *this = addToStr;
00152         return *this;
00153     }
00154
00155     size_t len = strlen(addToStr);
00156     unsigned curlen = length();
00157     if(len + length() > kMaxChar)
00158         len = kMaxChar - length();
00159     if(len == 0)
00160         return *this;
00161
00162     str = (char *)realloc(str, (len + curlen + 2) * sizeof(char));
00163     memcpy(str + curlen + 1, addToStr, len * sizeof(char));
00164     str[0] = len + curlen;
00165     str[len + curlen + 1] = '\0';
00166
00167     return *this;
00168 }

const UPStr & UPStr::operator= ( const UPStr & newstr )

set according to another UPStr.

Definition at line 97 of file ustr.cpp.

00098 {
00099     *this = (const char *)newstr;
00100     return *this;
00101 }

const unsigned char * UPStr::operator= ( const unsigned char * newstr )

set to a new P String (0L is OK).

Reimplemented in PCPStr.

Definition at line 77 of file ustr.cpp.

References flush, malloc, str, and UTHROW.

00078 {
00079     if(newstr == 0L)
00080         newstr = (unsigned char *)"";
00081
00082     int l = newstr[0];
00083     char *newvalue = (char *)malloc((l + 2) * sizeof(char));
00084     if(newvalue == 0L)
00085         UTHROW(std::bad_alloc());
00086
00087     memcpy(newvalue + 1, (char *)newstr + 1, l * sizeof(char));
00088     newvalue[0] = l;
00089     newvalue[l + 1] = '\0';
00090
00091     flush();
00092     str = newvalue;
00093
00094     return *this;
00095 }

const char * UPStr::operator= ( const char * newstr )

set to a new C String (0L is OK).

Reimplemented in PCPStr.

Definition at line 54 of file ustr.cpp.

References flush, kMaxChar, malloc, str, and UTHROW.

00055 {
00056     if(newstr == 0L)
00057         newstr = "";
00058
00059     size_t l = strlen(newstr);
00060     if(l > kMaxChar)
00061         l = kMaxChar;
00062
00063     char *newvalue = (char *)malloc((l + 2) * sizeof(char));
00064     if(newvalue == 0L)
00065         UTHROW(std::bad_alloc());
00066
00067     strncpy(newvalue + 1, newstr, l);
00068     newvalue[0] = l;
00069     newvalue[l + 1] = '\0';
00070
00071     flush();
00072     str = newvalue;
00073
00074     return *this;
00075 }

const unsigned char* UPStr::p_str ( ) const [inline]

as a P string.

Definition at line 86 of file ustr.h.

00087         {return str == 0L ? (unsigned char *)"" : (unsigned char *)str;}

const UPStr & UPStr::replace | ( | char | which,
 |  | char | bywhich
 | ) |

replace a character.

Definition at line 128 of file ustr.cpp.

References str.

00129 {
00130     if(str == 0L)
00131         return *this;
00132
00133     char *buf = str + 1;
00134     while(*buf)
00135     {
00136         if(*buf == which)
00137             *buf++ = bywhich;
00138         else
00139             buf++;
00140     }
00141     return *this;
00142 }

const UPStr & UPStr::set | ( | const char * | buf,
 |  | unsigned int | len
 | ) |

set from a buffer.

Definition at line 103 of file ustr.cpp.

References flush, kMaxChar, malloc, str, and UAppConsole.

00104 {
00105     flush();
00106     if(len == 0)
00107     {
00108         *this = "";
00109         return *this;
00110     }
00111     if(len > kMaxChar)
00112         len = kMaxChar;
00113
00114     str = (char *)malloc((len + 2) * sizeof(char));
00115     if(str == 0L)
00116     {
00117         UAppConsole("Impossible to allocate %d bytes !\n", (len + 2) * sizeof(char));
00118         return *this;
00119     }
00120
00121     memcpy(str + 1, buf, len * sizeof(char));
00122     str[0] = len;
00123     str[len + 1] = '\0';
00124
00125     return *this;
00126 }

Member Data Documentation

char* UPStr::str [protected]

the String.

Definition at line 105 of file ustr.h.

Referenced by flush, operator<<, operator=, replace, set, and PCPStr::SizeOf.

The documentation for this class was generated from the following files:
  • rf/ustr.h
  • rf/ustr.cpp
Generated on Sun Feb 24 01:27:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TemplatePyAutoObject class Reference

PyAutoObject Class Template Reference

#include <PythonContainer.h>

Collaboration diagram for PyAutoObject:

[legend]
List of all members.

Public Methods

PyAutoObject ()
PyAutoObject (T *o)
PyAutoObject (PyObject *o)
PyAutoObject (PyAutoObject &obj)
operator T * () const
~PyAutoObject ()
PyAutoObject & | operator= (T *o)
PyAutoObject & | operator= (PyObject *o)
PyAutoObject & | operator= (PyAutoObject &obj)
PyObject * | CopyReturn (void)
bool | IsValid (void)
T * | operator-> (void)

Protected Methods

void | Ref (void)
void | UnRef (void)

Protected Attributes

T * | m_o

template<class T>
class PyAutoObject< T >

Constructor & Destructor Documentation

template<class T>
PyAutoObject< T >::PyAutoObject ( ) [inline]

Definition at line 103 of file PythonContainer.h.

References m_o, and NULL.

00103                           : m_o(NULL)
00104     {
00105     }

template<class T>
PyAutoObject< T >::PyAutoObject ( T * o ) [inline]

Definition at line 107 of file PythonContainer.h.

References m_o, and Ref.

00107                               : m_o(o)
00108     {
00109         Ref();
00110     }

template<class T>
PyAutoObject< T >::PyAutoObject ( PyObject * o ) [inline]

Definition at line 112 of file PythonContainer.h.

References m_o, and Ref.

00112                                      : m_o((T *)o)
00113     {
00114         Ref();
00115     }

template<class T>
PyAutoObject< T >::PyAutoObject ( PyAutoObject< T > & obj ) [inline]

Definition at line 117 of file PythonContainer.h.

References CopyReturn, and m_o.

00117                                             : m_o((T *)obj.CopyReturn())
00118     {
00119     }

template<class T>
PyAutoObject< T >::~PyAutoObject ( ) [inline]

Definition at line 123 of file PythonContainer.h.

References UnRef.

00124     {
00125         UnRef();
00126     }

Member Function Documentation

template<class T>
PyObject* PyAutoObject< T >::CopyReturn ( void ) [inline]

Definition at line 151 of file PythonContainer.h.

References m_o, and Ref.

Referenced by PyMenuMgr::AddPulldown, PyPersistent::Create, PyCmdUI::Create, PyMenuMgr::Create, PyColorConsole::Create, PyCvsEntry::Create, cvsgui_GetCvsEntries, cvsgui_GetSelection, cvsgui_GetTopMacroAdminMenu, cvsgui_GetTopMacroSelectionMenu, operator=, and PyAutoObject.

00152     {
00153         Ref();
00154         return (PyObject *)m_o;
00155     }

template<class T>
bool PyAutoObject< T >::IsValid ( void ) [inline]

Definition at line 157 of file PythonContainer.h.

References m_o.

Referenced by PyMenuMgr::AddPulldown, PyPersistent::Create, PyCmdUI::Create, PyMenuMgr::Create, PyColorConsole::Create, PyCvsEntry::Create, cvsgui_GetCvsEntries, cvsgui_GetSelection, cvsgui_GetTopMacroAdminMenu, and cvsgui_GetTopMacroSelectionMenu.

00158     {
00159         return m_o != 0L;
00160     }

template<class T>
PyAutoObject< T >::operator T * ( void ) const [inline]

Definition at line 121 of file PythonContainer.h.

References m_o.

00121 { return m_o; }

template<class T>
T* PyAutoObject< T >::operator-> ( void ) [inline]

Definition at line 162 of file PythonContainer.h.

References m_o.

00163     {
00164         return m_o;
00165     }

template<class T>
PyAutoObject& PyAutoObject< T >::operator= ( PyAutoObject< T > & obj ) [inline]

Definition at line 144 of file PythonContainer.h.

References CopyReturn, m_o, and UnRef.

00145     {
00146         UnRef();
00147         m_o = (T *)obj.CopyReturn();
00148         return *this;
00149     }

template<class T>
PyAutoObject& PyAutoObject< T >::operator= ( PyObject * o ) [inline]

Definition at line 136 of file PythonContainer.h.

References m_o, Ref, and UnRef.

00137     {
00138         UnRef();
00139         m_o = (T *)o;
00140         Ref();
00141         return *this;
00142     }

template<class T>
PyAutoObject& PyAutoObject< T >::operator= ( T * o ) [inline]

Definition at line 128 of file PythonContainer.h.

References m_o, Ref, and UnRef.

00129     {
00130         UnRef();
00131         m_o = o;
00132         Ref();
00133         return *this;
00134     }

template<class T>
void PyAutoObject< T >::Ref ( void ) [inline, protected]

Definition at line 168 of file PythonContainer.h.

References m_o.

Referenced by CopyReturn, operator=, and PyAutoObject.

00169     {
00170         if(m_o)
00171             Py_INCREF(m_o);
00172     }

template<class T>
void PyAutoObject< T >::UnRef ( void ) [inline, protected]

Definition at line 174 of file PythonContainer.h.

References m_o, and NULL.

Referenced by operator=, and ~PyAutoObject.

00175     {
00176         if(m_o)
00177         {
00178             Py_DECREF(m_o);
00179             m_o = NULL;
00180         }
00181     }

Member Data Documentation

template<class T>
T* PyAutoObject::m_o [protected]

Definition at line 183 of file PythonContainer.h.

Referenced by CopyReturn, IsValid, operator T *, operator->, operator=, PyAutoObject, Ref, and UnRef.

The documentation for this class was generated from the following file:
  • common/PythonContainer.h
Generated on Sun Feb 24 01:27:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PyCmdUI Class Reference

#include <PythonImpl.h>

Inheritance diagram for PyCmdUI:

[legend]
Collaboration diagram for PyCmdUI:

[legend]
List of all members.

Public Methods

PyObject * | Enable (PyObject *args)
PyObject * | SetCheck (PyObject *args)
PyObject * | SetText (PyObject *args)
PyCmdUI (UCmdUI *cmdui)
virtual | ~PyCmdUI ()

Static Public Methods

void | dealloc (obj_t *self)
PyObject * | getattr (obj_t *self, char *name)
PyAutoObject< obj_t > | New (void)
PyTypeObject * | GetType (void)
PyObject * | Create (PyObject *selfptr, PyObject *args)
void | InitValues (PyObject *d)
PyObject * | FindMethod (PyObject *self, char *name)

Static Public Attributes

const char * | m_doc = "Class to update an interface object state"
PyMethodDef | m_methods []
PyRegistry m_registry

Static Protected Methods

PyObject * | _Enable (obj_t *self, PyObject *args)
PyObject * | _SetCheck (obj_t *self, PyObject *args)
PyObject * | _SetText (obj_t *self, PyObject *args)

Protected Attributes

UCmdUI * m_cmdui

Constructor & Destructor Documentation

PyCmdUI::PyCmdUI ( UCmdUI * cmdui ) [inline]

Definition at line 101 of file PythonImpl.h.

References m_cmdui.

Referenced by Create.

00101                            : m_cmdui(cmdui)
00102     {
00103     }

virtual PyCmdUI::~PyCmdUI ( ) [inline, virtual]

Definition at line 105 of file PythonImpl.h.

00106     {
00107     }

Member Function Documentation

PyObject* PyCmdUI::_Enable | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 97 of file PythonImpl.h.

References Enable.

00100 :

PyObject* PyCmdUI::_SetCheck | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 98 of file PythonImpl.h.

References SetCheck.

00100 :

PyObject* PyCmdUI::_SetText | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 99 of file PythonImpl.h.

References SetText.

00100 :

PyObject * PyCmdUI::Create | ( | PyObject * | selfptr,
 |  | PyObject * | args
 | ) | [static]

Definition at line 335 of file PythonImpl.cpp.

References PyAutoObject::CopyReturn, PyAutoObject::IsValid, New, NULL, PyArg_ParseTuple, PyCmdUI, and PyHandleCvsguiError.

00336 {
00337     UCmdUI *cmdui;
00338
00339     if (!PyArg_ParseTuple(args, "i:CCmdUI", &cmdui))
00340         return NULL;
00341
00342     PyAutoObject<PyCmdUI::obj_t> self = PyCmdUI::New();
00343     if (!self.IsValid())
00344         return NULL;
00345
00346     TRY
00347     {
00348         self->m_object = new PyCmdUI(cmdui);
00349     }
00350     CATCH_ALL(e)
00351     {
00352         PyHandleCvsguiError(e);
00353         return NULL;
00354     }
00355     END_CATCH_ALL
00356
00357     return self.CopyReturn();
00358 }

void PyCmdUI::dealloc ( obj_t * self ) [static]

Definition at line 327 of file PythonImpl.cpp.

PyObject * PyCmdUI::Enable ( PyObject * args )

Definition at line 364 of file PythonImpl.cpp.

References UCmdUI::Enable, m_cmdui, NULL, PyArg_ParseTuple, and PyContainer::Void.

Referenced by _Enable.

00365 {
00366     int state;
00367
00368     if (!PyArg_ParseTuple(args, "i", &state))
00369         return NULL;
00370
00371     m_cmdui->Enable(state != 0);
00372
00373     return Void();
00374 }

PyObject* PyCmdUI::FindMethod | ( | PyObject * | self,
 |  | char * | name
 | ) | [inline, static]

Definition at line 96 of file PythonImpl.h.

00100 :

PyObject * PyCmdUI::getattr | ( | obj_t * | self,
 |  | char * | name
 | ) | [static]

Definition at line 327 of file PythonImpl.cpp.

PyTypeObject* PyCmdUI::GetType ( void ) [inline, static]

Definition at line 96 of file PythonImpl.h.

00100 :

void PyCmdUI::InitValues ( PyObject * d ) [static]

Definition at line 360 of file PythonImpl.cpp.

00361 {
00362 }

PyAutoObject< PyCmdUI::obj_t > PyCmdUI::New ( void ) [static]

Definition at line 327 of file PythonImpl.cpp.

Referenced by Create.

PyObject * PyCmdUI::SetCheck ( PyObject * args )

Definition at line 376 of file PythonImpl.cpp.

References UCmdUI::Check, m_cmdui, NULL, PyArg_ParseTuple, and PyContainer::Void.

Referenced by _SetCheck.

00377 {
00378     int state;
00379
00380     if (!PyArg_ParseTuple(args, "i", &state))
00381         return NULL;
00382
00383     m_cmdui->Check(state != 0);
00384
00385     return Void();
00386 }

PyObject * PyCmdUI::SetText ( PyObject * args )

Definition at line 388 of file PythonImpl.cpp.

References m_cmdui, NULL, PyArg_ParseTuple, UCmdUI::SetText, and PyContainer::Void.

Referenced by _SetText.

00389 {
00390     char *text;
00391
00392     if (!PyArg_ParseTuple(args, "s", &text))
00393         return NULL;
00394
00395     m_cmdui->SetText(text);
00396
00397     return Void();
00398 }

Member Data Documentation

UCmdUI* PyCmdUI::m_cmdui [protected]

Definition at line 110 of file PythonImpl.h.

Referenced by Enable, PyCmdUI, SetCheck, and SetText.

const char * PyCmdUI::m_doc = "Class to update an interface object state" [static]

Definition at line 327 of file PythonImpl.cpp.

PyMethodDef PyCmdUI::m_methods [static]

Initial value:

   {
    {"Enable", (binaryfunc)PyCmdUI ::_Enable , METH_VARARGS, (char *) "Enable/Disable the object" },
    {"SetCheck", (binaryfunc)PyCmdUI ::_SetCheck , METH_VARARGS, (char *) "Check/uncheck the object" },
    {"SetText", (binaryfunc)PyCmdUI ::_SetText , METH_VARARGS, (char *) "Rename the object" },
 {NULL, NULL}   }

Definition at line 329 of file PythonImpl.cpp.

PyRegistry PyCmdUI::m_registry [static]

The documentation for this class was generated from the following files:
  • common/PythonImpl.h
  • common/PythonImpl.cpp
Generated on Sun Feb 24 01:27:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PyCmdUI::obj_t Struct Reference

#include <PythonImpl.h>

Collaboration diagram for PyCmdUI::obj_t:

[legend]
List of all members.

Public Attributes

PyObject_HEAD PyCmdUI * m_object

Member Data Documentation

PyObject_HEAD PyCmdUI* PyCmdUI::obj_t::m_object

Definition at line 96 of file PythonImpl.h.

The documentation for this struct was generated from the following file:
  • common/PythonImpl.h
Generated on Sun Feb 24 01:27:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PyColorConsole Class Reference

#include <PythonImpl.h>

Inheritance diagram for PyColorConsole:

[legend]
Collaboration diagram for PyColorConsole:

[legend]
List of all members.

Public Methods

PyObject * | Print (PyObject *args)
PyColorConsole ()
virtual | ~PyColorConsole ()

Static Public Methods

void | dealloc (obj_t *self)
PyObject * | getattr (obj_t *self, char *name)
PyAutoObject< obj_t > | New (void)
PyTypeObject * | GetType (void)
PyObject * | Create (PyObject *selfptr, PyObject *args)
void | InitValues (PyObject *d)
PyObject * | FindMethod (PyObject *self, char *name)

Static Public Attributes

const char * | m_doc = "Class printing in color in the console"
PyMethodDef | m_methods []
PyRegistry m_registry

Static Protected Methods

PyObject * | _Print (obj_t *self, PyObject *args)

Protected Attributes

CColorConsole m_console

Constructor & Destructor Documentation

PyColorConsole::PyColorConsole ( ) [inline]

Definition at line 57 of file PythonImpl.h.

Referenced by Create.

00058     {
00059     }

virtual PyColorConsole::~PyColorConsole ( ) [inline, virtual]

Definition at line 61 of file PythonImpl.h.

00062     {
00063     }

Member Function Documentation

PyObject* PyColorConsole::_Print | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 55 of file PythonImpl.h.

References Print.

00056 :

PyObject * PyColorConsole::Create | ( | PyObject * | selfptr,
 |  | PyObject * | args
 | ) | [static]

Definition at line 124 of file PythonImpl.cpp.

References PyAutoObject::CopyReturn, PyAutoObject::IsValid, New, NULL, PyArg_ParseTuple, PyColorConsole, and PyHandleCvsguiError.

00125 {
00126     if (!PyArg_ParseTuple(args, ":CColorConsole"))
00127         return NULL;
00128
00129     PyAutoObject<PyColorConsole::obj_t> self = PyColorConsole::New();
00130     if (!self.IsValid())
00131         return NULL;
00132
00133     TRY
00134     {
00135         self->m_object = new PyColorConsole();
00136     }
00137     CATCH_ALL(e)
00138     {
00139         PyHandleCvsguiError(e);
00140         return NULL;
00141     }
00142     END_CATCH_ALL
00143
00144     return self.CopyReturn();
00145 }

void PyColorConsole::dealloc ( obj_t * self ) [static]

Definition at line 118 of file PythonImpl.cpp.

PyObject* PyColorConsole::FindMethod | ( | PyObject * | self,
 |  | char * | name
 | ) | [inline, static]

Definition at line 54 of file PythonImpl.h.

00056 :

PyObject * PyColorConsole::getattr | ( | obj_t * | self,
 |  | char * | name
 | ) | [static]

Definition at line 118 of file PythonImpl.cpp.

PyTypeObject* PyColorConsole::GetType ( void ) [inline, static]

Definition at line 54 of file PythonImpl.h.

00056 :

void PyColorConsole::InitValues ( PyObject * d ) [static]

Definition at line 148 of file PythonImpl.cpp.

References kBlue, kBold, kBrown, kGreen, kItalic, kMagenta, kNL, kNormal, kRed, kUnderline, and PyContainer::RegisterValue.

00149 {
00150     RegisterValue(d, "kNormal", kNormal);
00151     RegisterValue(d, "kBrown", kBrown);
00152     RegisterValue(d, "kGreen", kGreen);
00153     RegisterValue(d, "kMagenta", kMagenta);
00154     RegisterValue(d, "kRed", kRed);
00155     RegisterValue(d, "kBlue", kBlue);
00156     RegisterValue(d, "kBold", kBold);
00157     RegisterValue(d, "kItalic", kItalic);
00158     RegisterValue(d, "kUnderline", kUnderline);
00159     RegisterValue(d, "kNL", kNL);
00160 }

PyAutoObject< PyColorConsole::obj_t > PyColorConsole::New ( void ) [static]

Definition at line 118 of file PythonImpl.cpp.

Referenced by Create.

PyObject * PyColorConsole::Print ( PyObject * args )

Definition at line 162 of file PythonImpl.cpp.

References kConsoleColor, m_console, NULL, PyArg_ParseTuple, PyErr_Clear, and PyContainer::Void.

Referenced by _Print.

00163 {
00164     int style;
00165
00166     if(PyArg_ParseTuple(args, "i", &style))
00167     {
00168         m_console << kConsoleColor(style);
00169         return Void();
00170     }
00171
00172     PyErr_Clear();
00173
00174     char *str;
00175     if(PyArg_ParseTuple(args, "s", &str))
00176     {
00177         m_console << str;
00178         return Void();
00179     }
00180
00181     return NULL;
00182 }

Member Data Documentation

CColorConsole PyColorConsole::m_console [protected]

Definition at line 66 of file PythonImpl.h.

Referenced by Print.

const char * PyColorConsole::m_doc = "Class printing in color in the console" [static]

Definition at line 118 of file PythonImpl.cpp.

PyMethodDef PyColorConsole::m_methods [static]

Initial value:

   {
    {"Print", (binaryfunc)PyColorConsole ::_Print , METH_VARARGS, (char *) "Print in color" },
 {NULL, NULL}   }

Definition at line 120 of file PythonImpl.cpp.

PyRegistry PyColorConsole::m_registry [static]

The documentation for this class was generated from the following files:
  • common/PythonImpl.h
  • common/PythonImpl.cpp
Generated on Sun Feb 24 01:27:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PyColorConsole::obj_t Struct Reference

#include <PythonImpl.h>

Collaboration diagram for PyColorConsole::obj_t:

[legend]
List of all members.

Public Attributes

PyObject_HEAD PyColorConsole * m_object

Member Data Documentation

PyObject_HEAD PyColorConsole* PyColorConsole::obj_t::m_object

Definition at line 54 of file PythonImpl.h.

The documentation for this struct was generated from the following file:
  • common/PythonImpl.h
Generated on Sun Feb 24 01:27:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PyContainer Class Reference

#include <PythonContainer.h>

Inheritance diagram for PyContainer:

[legend]
List of all members.

Public Methods

PyContainer ()
virtual | ~PyContainer ()
virtual PyObject * | GetAttr (char *name)

Static Public Methods

PyObject * | True ()
PyObject * | False ()
PyObject * | Void ()
void | RegisterValue (PyObject *d, char *name, int value)

Constructor & Destructor Documentation

PyContainer::PyContainer ( ) [inline]

Definition at line 83 of file PythonContainer.h.

00083 {}

virtual PyContainer::~PyContainer ( ) [inline, virtual]

Definition at line 84 of file PythonContainer.h.

00084 {}

Member Function Documentation

PyObject* PyContainer::False ( ) [inline, static]

Definition at line 90 of file PythonContainer.h.

References GetPyFalse.

Referenced by cvsgui_PromptMessage, and PyCvsEntry::GetAttr.

00090 { Py_INCREF(GetPyFalse()); return GetPyFalse(); }

virtual PyObject* PyContainer::GetAttr ( char * name ) [inline, virtual]

Reimplemented in PyCvsEntry.

Definition at line 86 of file PythonContainer.h.

References NULL.

00086 { return NULL; }

void PyContainer::RegisterValue | ( | PyObject * | d,
 |  | char * | name,
 |  | int | value
 | ) | [static]

Definition at line 96 of file PythonContainer.cpp.

References PyDict_SetItemString, PyErr_Clear, and PyInt_FromLong.

Referenced by PyColorConsole::InitValues.

00097 {
00098     PyObject *v = PyInt_FromLong((long) value);
00099     if (v == NULL) {
00100         /* Don't bother reporting this error */
00101         PyErr_Clear();
00102     }
00103     else {
00104         PyDict_SetItemString(d, name, v);
00105         Py_DECREF(v);
00106     }
00107 }

PyObject* PyContainer::True ( ) [inline, static]

Definition at line 89 of file PythonContainer.h.

References GetPyTrue.

Referenced by cvsgui_PromptMessage, and PyCvsEntry::GetAttr.

00089 { Py_INCREF(GetPyTrue()); return GetPyTrue(); }

PyObject* PyContainer::Void ( ) [inline, static]

Definition at line 91 of file PythonContainer.h.

References GetPyNone.

Referenced by PyMenuMgr::AddButton, PyMenuMgr::AddSeparator, PyMenuMgr::AddToggle, cvsgui_GetHistoryAsXML, cvsgui_LaunchBrowser, cvsgui_LaunchTclMacro, cvsgui_write, PyMenuMgr::Delete, PyMenuMgr::DeleteByCmd, PyCmdUI::Enable, PyColorConsole::Print, PyCmdUI::SetCheck, PyCmdUI::SetText, and PyPersistent::SetValue.

00091 { Py_INCREF(GetPyNone()); return GetPyNone(); }

The documentation for this class was generated from the following files:
  • common/PythonContainer.h
  • common/PythonContainer.cpp
Generated on Sun Feb 24 01:27:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CPyCvsConsole Class Reference

Inheritance diagram for CPyCvsConsole:

[legend]
Collaboration diagram for CPyCvsConsole:

[legend]
List of all members.

Public Methods

CPyCvsConsole ()
virtual | ~CPyCvsConsole ()
virtual long | cvs_out (char *txt, long len)
virtual long | cvs_err (char *txt, long len)

Public Attributes

CBuffer m_out
CBuffer m_err

Constructor & Destructor Documentation

CPyCvsConsole::CPyCvsConsole ( ) [inline]

Definition at line 512 of file PythonGlue.cpp.

00512 {}

virtual CPyCvsConsole::~CPyCvsConsole ( ) [inline, virtual]

Definition at line 513 of file PythonGlue.cpp.

00513 {}

Member Function Documentation

virtual long CPyCvsConsole::cvs_err | ( | char * | txt,
 |  | long | len
 | ) | [inline, virtual]

Implements CCvsConsole.

Definition at line 521 of file PythonGlue.cpp.

References CBuffer::append, and m_err.

00522     {
00523         m_err.append(txt, len);
00524         return len;
00525     }

virtual long CPyCvsConsole::cvs_out | ( | char * | txt,
 |  | long | len
 | ) | [inline, virtual]

Implements CCvsConsole.

Definition at line 515 of file PythonGlue.cpp.

References CBuffer::append, and m_out.

00516     {
00517         m_out.append(txt, len);
00518         return len;
00519     }

Member Data Documentation

CBuffer CPyCvsConsole::m_err

Definition at line 528 of file PythonGlue.cpp.

Referenced by cvs_err, and cvsgui_RunCvs.

CBuffer CPyCvsConsole::m_out

Definition at line 527 of file PythonGlue.cpp.

Referenced by cvs_out, and cvsgui_RunCvs.

The documentation for this class was generated from the following file:
  • common/PythonGlue.cpp
Generated on Sun Feb 24 01:27:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PyCvsEntry Class Reference

#include <PythonImpl.h>

Inheritance diagram for PyCvsEntry:

[legend]
Collaboration diagram for PyCvsEntry:

[legend]
List of all members.

Public Methods

PyCvsEntry (EntnodeData *data)
virtual | ~PyCvsEntry ()
virtual PyObject * | GetAttr (char *name)
operator EntnodeData * (void) const

Static Public Methods

void | dealloc (obj_t *self)
PyObject * | getattr (obj_t *self, char *name)
PyAutoObject< obj_t > | New (void)
PyTypeObject * | GetType (void)
PyObject * | Create (PyObject *selfptr, PyObject *args)
void | InitValues (PyObject *d)
PyObject * | FindMethod (PyObject *self, char *name)

Static Public Attributes

const char * | m_doc = "Class for an entry in CVS/Entries"
PyMethodDef | m_methods []
PyRegistry m_registry

Protected Attributes

ENTNODE m_data

Constructor & Destructor Documentation

PyCvsEntry::PyCvsEntry ( EntnodeData * data ) [inline]

Definition at line 36 of file PythonImpl.h.

References m_data.

Referenced by Create.

00036                                   : m_data(data)
00037     {
00038     }

virtual PyCvsEntry::~PyCvsEntry ( ) [inline, virtual]

Definition at line 40 of file PythonImpl.h.

00041     {
00042     }

Member Function Documentation

PyObject * PyCvsEntry::Create | ( | PyObject * | selfptr,
 |  | PyObject * | args
 | ) | [static]

Definition at line 34 of file PythonImpl.cpp.

References PyAutoObject::CopyReturn, PyAutoObject::IsValid, New, NULL, PyArg_ParseTuple, PyCvsEntry, and PyHandleCvsguiError.

00035 {
00036     if (!PyArg_ParseTuple(args, ":CCvsEntry"))
00037         return NULL;
00038
00039     PyAutoObject<PyCvsEntry::obj_t> self = PyCvsEntry::New();
00040     if (!self.IsValid())
00041         return NULL;
00042
00043     TRY
00044     {
00045         self->m_object = new PyCvsEntry(0L);
00046     }
00047     CATCH_ALL(e)
00048     {
00049         PyHandleCvsguiError(e);
00050         return NULL;
00051     }
00052     END_CATCH_ALL
00053
00054     return self.CopyReturn();
00055 }

void PyCvsEntry::dealloc ( obj_t * self ) [static]

Definition at line 29 of file PythonImpl.cpp.

PyObject* PyCvsEntry::FindMethod | ( | PyObject * | self,
 |  | char * | name
 | ) | [inline, static]

Definition at line 34 of file PythonImpl.h.

00035 :

PyObject * PyCvsEntry::GetAttr ( char * name ) [virtual]

Reimplemented from PyContainer.

Definition at line 61 of file PythonImpl.cpp.

References ENT_FILE, PyContainer::False, EntnodeData::GetConflict, EntnodeData::GetDesc, EntnodeData::GetFullPathName, EntnodeData::GetName, EntnodeData::GetType, EntnodeData::IsIgnored, EntnodeData::IsLocked, EntnodeData::IsMissing, EntnodeData::IsRemoved, EntnodeData::IsUnknown, EntnodeData::IsUnmodified, EntnodeFile::kOption, EntnodeFile::kTag, EntnodeFile::kTS, EntnodeFile::kVN, m_data, NULL, PyString_FromString, and PyContainer::True.

00062 {
00063     UStr buf;
00064     EntnodeData *data = m_data;
00065
00066     if(strcmp(name, "name") == 0)
00067         return PyString_FromString(data->GetName());
00068     else if(strcmp(name, "fullname") == 0)
00069         return PyString_FromString(data->GetFullPathName(buf));
00070     else if(strcmp(name, "version") == 0)
00071     {
00072         const char *str = (*data)[EntnodeFile::kVN];
00073         return PyString_FromString(str ? str : "");
00074     }
00075     else if(strcmp(name, "timeutc") == 0)
00076     {
00077         const char *str = (*data)[EntnodeFile::kTS];
00078         return PyString_FromString(str ? str : "");
00079     }
00080     else if(strcmp(name, "keyword") == 0)
00081     {
00082         const char *str = (*data)[EntnodeFile::kOption];
00083         return PyString_FromString(str ? str : "");
00084     }
00085     else if(strcmp(name, "tag") == 0)
00086     {
00087         const char *str = (*data)[EntnodeFile::kTag];
00088         return PyString_FromString(str ? str : "");
00089     }
00090     else if(strcmp(name, "isfile") == 0)
00091         return data->GetType() == ENT_FILE ? True() : False();
00092     else if(strcmp(name, "modified") == 0)
00093         return data->IsUnmodified() ? False() : True();
00094     else if(strcmp(name, "missing") == 0)
00095         return data->IsMissing() ? True() : False();
00096     else if(strcmp(name, "unknown") == 0)
00097         return data->IsUnknown() ? True() : False();
00098     else if(strcmp(name, "ignored") == 0)
00099         return data->IsIgnored() ? True() : False();
00100     else if(strcmp(name, "readonly") == 0)
00101         return data->IsLocked() ? True() : False();
00102     else if(strcmp(name, "removed") == 0)
00103         return data->IsRemoved() ? True() : False();
00104     else if(strcmp(name, "added") == 0)
00105     {
00106         const char* vn = (*data)[EntnodeFile::kVN];
00107         bool isAdded = vn && (strcmp(vn, "0") == 0);
00108         return isAdded ? True() : False();
00109     }
00110     else if(strcmp(name, "desc") == 0)
00111         return PyString_FromString(data->GetDesc() ? data->GetDesc() : "");
00112     else if(strcmp(name, "conflict") == 0)
00113         return PyString_FromString(data->GetConflict() ? data->GetConflict() : "");
00114
00115     return NULL;
00116 }

PyObject * PyCvsEntry::getattr | ( | obj_t * | self,
 |  | char * | name
 | ) | [static]

Definition at line 29 of file PythonImpl.cpp.

PyTypeObject* PyCvsEntry::GetType ( void ) [inline, static]

Definition at line 34 of file PythonImpl.h.

00035 :

void PyCvsEntry::InitValues ( PyObject * d ) [static]

Definition at line 57 of file PythonImpl.cpp.

00058 {
00059 }

PyAutoObject< PyCvsEntry::obj_t > PyCvsEntry::New ( void ) [static]

Definition at line 29 of file PythonImpl.cpp.

Referenced by Create, cvsgui_GetCvsEntries, and cvsgui_GetSelection.

PyCvsEntry::operator EntnodeData * ( void ) const [inline]

Definition at line 46 of file PythonImpl.h.

References m_data.

00046 { return m_data; }

Member Data Documentation

ENTNODE PyCvsEntry::m_data [protected]

Definition at line 49 of file PythonImpl.h.

Referenced by GetAttr, operator EntnodeData *, and PyCvsEntry.

const char * PyCvsEntry::m_doc = "Class for an entry in CVS/Entries" [static]

Definition at line 29 of file PythonImpl.cpp.

PyMethodDef PyCvsEntry::m_methods [static]

Initial value:

   {
 {NULL, NULL}   }

Definition at line 31 of file PythonImpl.cpp.

PyRegistry PyCvsEntry::m_registry [static]

The documentation for this class was generated from the following files:
  • common/PythonImpl.h
  • common/PythonImpl.cpp
Generated on Sun Feb 24 01:27:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PyCvsEntry::obj_t Struct Reference

#include <PythonImpl.h>

Collaboration diagram for PyCvsEntry::obj_t:

[legend]
List of all members.

Public Attributes

PyObject_HEAD PyCvsEntry * m_object

Member Data Documentation

PyObject_HEAD PyCvsEntry* PyCvsEntry::obj_t::m_object

Definition at line 34 of file PythonImpl.h.

The documentation for this struct was generated from the following file:
  • common/PythonImpl.h
Generated on Sun Feb 24 01:27:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PyMenuMgr Class Reference

#include <PythonImpl.h>

Inheritance diagram for PyMenuMgr:

[legend]
Collaboration diagram for PyMenuMgr:

[legend]
List of all members.

Public Methods

PyObject * | AddPulldown (PyObject *args)
PyObject * | AddToggle (PyObject *args)
PyObject * | AddButton (PyObject *args)
PyObject * | AddSeparator (PyObject *args)
PyObject * | Delete (PyObject *args)
PyObject * | DeleteByCmd (PyObject *args)
PyObject * | Count (PyObject *args)
PyMenuMgr (UMENU menu)
virtual | ~PyMenuMgr ()
operator UMENU () const

Static Public Methods

void | dealloc (obj_t *self)
PyObject * | getattr (obj_t *self, char *name)
PyAutoObject< obj_t > | New (void)
PyTypeObject * | GetType (void)
PyObject * | Create (PyObject *selfptr, PyObject *args)
void | InitValues (PyObject *d)
PyObject * | FindMethod (PyObject *self, char *name)

Static Public Attributes

const char * | m_doc = "Class to manipulate menus"
PyMethodDef | m_methods []
PyRegistry m_registry

Static Protected Methods

PyObject * | _AddPulldown (obj_t *self, PyObject *args)
PyObject * | _AddToggle (obj_t *self, PyObject *args)
PyObject * | _AddButton (obj_t *self, PyObject *args)
PyObject * | _AddSeparator (obj_t *self, PyObject *args)
PyObject * | _Delete (obj_t *self, PyObject *args)
PyObject * | _DeleteByCmd (obj_t *self, PyObject *args)
PyObject * | _Count (obj_t *self, PyObject *args)

Protected Attributes

UMENU m_menu

Constructor & Destructor Documentation

PyMenuMgr::PyMenuMgr ( UMENU menu ) [inline]

Definition at line 81 of file PythonImpl.h.

References m_menu, and UMENU.

Referenced by AddPulldown, and Create.

00081                           : m_menu(menu)
00082     {
00083     }

virtual PyMenuMgr::~PyMenuMgr ( ) [inline, virtual]

Definition at line 85 of file PythonImpl.h.

00086     {
00087     }

Member Function Documentation

PyObject* PyMenuMgr::_AddButton | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 74 of file PythonImpl.h.

References AddButton.

00080 :

PyObject* PyMenuMgr::_AddPulldown | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 72 of file PythonImpl.h.

References AddPulldown.

00080 :

PyObject* PyMenuMgr::_AddSeparator | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 75 of file PythonImpl.h.

References AddSeparator.

00080 :

PyObject* PyMenuMgr::_AddToggle | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 73 of file PythonImpl.h.

References AddToggle.

00080 :

PyObject* PyMenuMgr::_Count | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 78 of file PythonImpl.h.

References Count.

00080 :

PyObject* PyMenuMgr::_Delete | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 76 of file PythonImpl.h.

References Delete.

00080 :

PyObject* PyMenuMgr::_DeleteByCmd | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 77 of file PythonImpl.h.

References DeleteByCmd.

00080 :

PyObject * PyMenuMgr::AddButton ( PyObject * args )

Definition at line 266 of file PythonImpl.cpp.

References m_menu, NULL, PyArg_ParseTuple, UMenuAddButton, and PyContainer::Void.

Referenced by _AddButton.

00267 {
00268     int widid, cmd;
00269     char *name, *pixmap = 0L;
00270
00271     if (!PyArg_ParseTuple(args, "isi|s", &widid, &name, &cmd, &pixmap))
00272         return NULL;
00273
00274     UMenuAddButton(widid, name, m_menu, pixmap, cmd);
00275
00276     return Void();
00277 }

PyObject * PyMenuMgr::AddPulldown ( PyObject * args )

Definition at line 236 of file PythonImpl.cpp.

References PyAutoObject::CopyReturn, PyAutoObject::IsValid, m_menu, New, NULL, PyArg_ParseTuple, PyMenuMgr, and UMenuAddPulldown.

Referenced by _AddPulldown.

00237 {
00238     int widid;
00239     char *name;
00240
00241     if (!PyArg_ParseTuple(args, "is", &widid, &name))
00242         return NULL;
00243
00244     PyAutoObject<PyMenuMgr::obj_t> res = PyMenuMgr::New();
00245     if (!res.IsValid())
00246         return NULL;
00247
00248     res->m_object = new PyMenuMgr(UMenuAddPulldown(widid, name, m_menu));
00249
00250     return res.CopyReturn();
00251 }

PyObject * PyMenuMgr::AddSeparator ( PyObject * args )

Definition at line 279 of file PythonImpl.cpp.

References m_menu, NULL, PyArg_ParseTuple, UMenuAddSeparator, and PyContainer::Void.

Referenced by _AddSeparator.

00280 {
00281     int widid;
00282
00283     if (!PyArg_ParseTuple(args, "i", &widid))
00284         return NULL;
00285
00286     UMenuAddSeparator(widid, m_menu);
00287
00288     return Void();
00289 }

PyObject * PyMenuMgr::AddToggle ( PyObject * args )

Definition at line 253 of file PythonImpl.cpp.

References m_menu, NULL, PyArg_ParseTuple, UMenuAddToggle, and PyContainer::Void.

Referenced by _AddToggle.

00254 {
00255     int widid, cmd;
00256     char *name, *pixmap = 0L;
00257
00258     if (!PyArg_ParseTuple(args, "isi|s", &widid, &name, &cmd, &pixmap))
00259         return NULL;
00260
00261     UMenuAddToggle(widid, name, m_menu, pixmap, cmd);
00262
00263     return Void();
00264 }

PyObject * PyMenuMgr::Count ( PyObject * args )

Definition at line 315 of file PythonImpl.cpp.

References m_menu, NULL, PyArg_ParseTuple, PyInt_FromLong, and UMenuCount.

Referenced by _Count.

00316 {
00317     int res;
00318
00319     if (!PyArg_ParseTuple(args, ""))
00320         return NULL;
00321
00322     res = UMenuCount(m_menu);
00323
00324     return PyInt_FromLong(res);
00325 }

PyObject * PyMenuMgr::Create | ( | PyObject * | selfptr,
 |  | PyObject * | args
 | ) | [static]

Definition at line 207 of file PythonImpl.cpp.

References PyAutoObject::CopyReturn, PyAutoObject::IsValid, New, NULL, PyArg_ParseTuple, PyHandleCvsguiError, PyMenuMgr, and UMENU.

00208 {
00209     UMENU menu;
00210
00211     if (!PyArg_ParseTuple(args, "i:CMenuMgr", &menu))
00212         return NULL;
00213
00214     PyAutoObject<PyMenuMgr::obj_t> self = PyMenuMgr::New();
00215     if (!self.IsValid())
00216         return NULL;
00217
00218     TRY
00219     {
00220         self->m_object = new PyMenuMgr(menu);
00221     }
00222     CATCH_ALL(e)
00223     {
00224         PyHandleCvsguiError(e);
00225         return NULL;
00226     }
00227     END_CATCH_ALL
00228
00229     return self.CopyReturn();
00230 }

void PyMenuMgr::dealloc ( obj_t * self ) [static]

Definition at line 184 of file PythonImpl.cpp.

00197 {

PyObject * PyMenuMgr::Delete ( PyObject * args )

Definition at line 291 of file PythonImpl.cpp.

References m_menu, NULL, PyArg_ParseTuple, UMenuDelete, and PyContainer::Void.

Referenced by _Delete.

00292 {
00293     int afterIndex;
00294
00295     if (!PyArg_ParseTuple(args, "i", &afterIndex))
00296         return NULL;
00297
00298     UMenuDelete(m_menu, afterIndex);
00299
00300     return Void();
00301 }

PyObject * PyMenuMgr::DeleteByCmd ( PyObject * args )

Definition at line 303 of file PythonImpl.cpp.

References m_menu, NULL, PyArg_ParseTuple, UMenuDeleteByCmd, and PyContainer::Void.

Referenced by _DeleteByCmd.

00304 {
00305     int cmd;
00306
00307     if (!PyArg_ParseTuple(args, "i", &cmd))
00308         return NULL;
00309
00310     UMenuDeleteByCmd(m_menu, cmd);
00311
00312     return Void();
00313 }

PyObject* PyMenuMgr::FindMethod | ( | PyObject * | self,
 |  | char * | name
 | ) | [inline, static]

Definition at line 71 of file PythonImpl.h.

00080 :

PyObject * PyMenuMgr::getattr | ( | obj_t * | self,
 |  | char * | name
 | ) | [static]

Definition at line 184 of file PythonImpl.cpp.

00197 {

PyTypeObject* PyMenuMgr::GetType ( void ) [inline, static]

Definition at line 71 of file PythonImpl.h.

Referenced by ParseUMENU.

00080 :

void PyMenuMgr::InitValues ( PyObject * d ) [static]

Definition at line 232 of file PythonImpl.cpp.

00233 {
00234 }

PyAutoObject< PyMenuMgr::obj_t > PyMenuMgr::New ( void ) [static]

Definition at line 184 of file PythonImpl.cpp.

Referenced by AddPulldown, Create, cvsgui_GetTopMacroAdminMenu, and cvsgui_GetTopMacroSelectionMenu.

00197 {

PyMenuMgr::operator UMENU ( ) const [inline]

Definition at line 89 of file PythonImpl.h.

References m_menu.

00089 { return m_menu; }

Member Data Documentation

const char * PyMenuMgr::m_doc = "Class to manipulate menus" [static]

Definition at line 184 of file PythonImpl.cpp.

UMENU PyMenuMgr::m_menu [protected]

Definition at line 91 of file PythonImpl.h.

Referenced by AddButton, AddPulldown, AddSeparator, AddToggle, Count, Delete, DeleteByCmd, operator UMENU, and PyMenuMgr.

PyMethodDef PyMenuMgr::m_methods [static]

Initial value:

   {
    {"AddPulldown", (binaryfunc)PyMenuMgr ::_AddPulldown , METH_VARARGS, (char *) "Add a new menu" },
    {"AddToggle", (binaryfunc)PyMenuMgr ::_AddToggle , METH_VARARGS, (char *) "Add a toggle menu entry" },
    {"AddButton", (binaryfunc)PyMenuMgr ::_AddButton , METH_VARARGS, (char *) "Add a regular menu entry" },
    {"AddSeparator", (binaryfunc)PyMenuMgr ::_AddSeparator , METH_VARARGS, (char *) "Add a separator menu entry" },
    {"Delete", (binaryfunc)PyMenuMgr ::_Delete , METH_VARARGS, (char *) "Delete a menu entry by index" },
    {"DeleteByCmd", (binaryfunc)PyMenuMgr ::_DeleteByCmd , METH_VARARGS, (char *) "Delete a menu entry by command" },
    {"Count", (binaryfunc)PyMenuMgr ::_Count , METH_VARARGS, (char *) "Count the number of entries in the menu" },
 {NULL, NULL}   }

Definition at line 186 of file PythonImpl.cpp.

PyRegistry PyMenuMgr::m_registry [static]

The documentation for this class was generated from the following files:
  • common/PythonImpl.h
  • common/PythonImpl.cpp
Generated on Sun Feb 24 01:27:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PyMenuMgr::obj_t Struct Reference

#include <PythonImpl.h>

Collaboration diagram for PyMenuMgr::obj_t:

[legend]
List of all members.

Public Attributes

PyObject_HEAD PyMenuMgr * m_object

Member Data Documentation

PyObject_HEAD PyMenuMgr* PyMenuMgr::obj_t::m_object

Definition at line 71 of file PythonImpl.h.

The documentation for this struct was generated from the following file:
  • common/PythonImpl.h
Generated on Sun Feb 24 01:27:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PyPersistent Class Reference

#include <PythonImpl.h>

Inheritance diagram for PyPersistent:

[legend]
Collaboration diagram for PyPersistent:

[legend]
List of all members.

Public Methods

PyObject * | GetValue (PyObject *args)
PyObject * | SetValue (PyObject *args)
PyPersistent (const char *uniqueName, const char *defValue, kClassPersistent pclass)
virtual | ~PyPersistent ()

Static Public Methods

void | dealloc (obj_t *self)
PyObject * | getattr (obj_t *self, char *name)
PyAutoObject< obj_t > | New (void)
PyTypeObject * | GetType (void)
PyObject * | Create (PyObject *selfptr, PyObject *args)
void | InitValues (PyObject *d)
PyObject * | FindMethod (PyObject *self, char *name)

Static Public Attributes

const char * | m_doc = "Class to store persistent values on disk"
PyMethodDef | m_methods []
PyRegistry m_registry

Static Protected Methods

PyObject * | _GetValue (obj_t *self, PyObject *args)
PyObject * | _SetValue (obj_t *self, PyObject *args)

Protected Attributes

PCStr m_cstr

Constructor & Destructor Documentation

PyPersistent::PyPersistent | ( | const char * | uniqueName,
 |  | const char * | defValue,
 |  | kClassPersistent | pclass
 | ) | [inline]

Definition at line 119 of file PythonImpl.h.

References kClassPersistent, and m_cstr.

Referenced by Create.

00119                                                                                         :
00120         m_cstr(uniqueName, defValue, pclass)
00121     {
00122     }

virtual PyPersistent::~PyPersistent ( ) [inline, virtual]

Definition at line 124 of file PythonImpl.h.

00125     {
00126     }

Member Function Documentation

PyObject* PyPersistent::_GetValue | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 116 of file PythonImpl.h.

00118 :

PyObject* PyPersistent::_SetValue | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 117 of file PythonImpl.h.

References SetValue.

00118 :

PyObject * PyPersistent::Create | ( | PyObject * | selfptr,
 |  | PyObject * | args
 | ) | [static]

Definition at line 407 of file PythonImpl.cpp.

References PyAutoObject::CopyReturn, PyAutoObject::IsValid, kAddSettings, kNoClass, New, NULL, PyArg_ParseTuple, PyHandleCvsguiError, and PyPersistent.

00408 {
00409     char *uniqueName, *defValue = 0L;
00410     int addToSettings = 0;
00411
00412     if (!PyArg_ParseTuple(args, "s|si:CPersistent", &uniqueName, &defValue,
00413         &addToSettings))
00414         return NULL;
00415
00416     PyAutoObject<PyPersistent::obj_t> self = PyPersistent::New();
00417     if (!self.IsValid())
00418         return NULL;
00419
00420     TRY
00421     {
00422         self->m_object = new PyPersistent(uniqueName, defValue,
00423             addToSettings ? kAddSettings : kNoClass);
00424     }
00425     CATCH_ALL(e)
00426     {
00427         PyHandleCvsguiError(e);
00428         return NULL;
00429     }
00430     END_CATCH_ALL
00431
00432     return self.CopyReturn();
00433 }

void PyPersistent::dealloc ( obj_t * self ) [static]

Definition at line 400 of file PythonImpl.cpp.

PyObject* PyPersistent::FindMethod | ( | PyObject * | self,
 |  | char * | name
 | ) | [inline, static]

Definition at line 115 of file PythonImpl.h.

00118 :

PyObject * PyPersistent::getattr | ( | obj_t * | self,
 |  | char * | name
 | ) | [static]

Definition at line 400 of file PythonImpl.cpp.

PyTypeObject* PyPersistent::GetType ( void ) [inline, static]

Definition at line 115 of file PythonImpl.h.

00118 :

PyObject * PyPersistent::GetValue ( PyObject * args )

Definition at line 452 of file PythonImpl.cpp.

References m_cstr, NULL, PyArg_ParseTuple, and PyString_FromString.

00453 {
00454     if (!PyArg_ParseTuple(args, ""))
00455         return NULL;
00456
00457     return PyString_FromString(m_cstr);
00458 }

void PyPersistent::InitValues ( PyObject * d ) [static]

Definition at line 435 of file PythonImpl.cpp.

00436 {
00437 }

PyAutoObject< PyPersistent::obj_t > PyPersistent::New ( void ) [static]

Definition at line 400 of file PythonImpl.cpp.

Referenced by Create.

PyObject * PyPersistent::SetValue ( PyObject * args )

Definition at line 439 of file PythonImpl.cpp.

References m_cstr, NULL, PyArg_ParseTuple, and PyContainer::Void.

Referenced by _SetValue.

00440 {
00441     char *s;
00442
00443     if (!PyArg_ParseTuple(args, "s", &s))
00444         return NULL;
00445
00446     m_cstr = s;
00447     gCvsPrefs.save();
00448
00449     return Void();
00450 }

Member Data Documentation

PCStr PyPersistent::m_cstr [protected]

Definition at line 129 of file PythonImpl.h.

Referenced by GetValue, PyPersistent, and SetValue.

const char * PyPersistent::m_doc = "Class to store persistent values on disk" [static]

Definition at line 400 of file PythonImpl.cpp.

PyMethodDef PyPersistent::m_methods [static]

Initial value:

   {
    {"GetValue", (binaryfunc)PyPersistent ::_GetValue , METH_VARARGS, (char *) "Get the persistent value" },
    {"SetValue", (binaryfunc)PyPersistent ::_SetValue , METH_VARARGS, (char *) "Set the persistent value" },
 {NULL, NULL}   }

Definition at line 402 of file PythonImpl.cpp.

PyRegistry PyPersistent::m_registry [static]

The documentation for this class was generated from the following files:
  • common/PythonImpl.h
  • common/PythonImpl.cpp
Generated on Sun Feb 24 01:27:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PyPersistent::obj_t Struct Reference

#include <PythonImpl.h>

Collaboration diagram for PyPersistent::obj_t:

[legend]
List of all members.

Public Attributes

PyObject_HEAD PyPersistent * m_object

Member Data Documentation

PyObject_HEAD PyPersistent* PyPersistent::obj_t::m_object

Definition at line 115 of file PythonImpl.h.

The documentation for this struct was generated from the following file:
  • common/PythonImpl.h
Generated on Sun Feb 24 01:27:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


PyRegistry Class Reference

#include <PythonContainer.h>

Collaboration diagram for PyRegistry:

[legend]
List of all members.

Public Methods

PyRegistry (const char *name, size_t size, destructor d, getattrfunc g, PyRegistry_InitValues v, PyCFunction c, const char *doc)
~PyRegistry ()

Static Public Methods

void | RegisterAllObjects (std::vector< PyMethodDef > &methods)
void | CallInitValues (PyObject *dict)

Public Attributes

PyTypeObject | m_type

Protected Attributes

PyRegistry * | m_next
PyRegistry_InitValues m_v
PyCFunction | m_c
const char * | m_doc

Static Protected Attributes

PyRegistry * | m_all = NULL

Constructor & Destructor Documentation

PyRegistry::PyRegistry | ( | const char * | name,
 |  | size_t | size,
 |  | destructor | d,
 |  | getattrfunc | g,
 |  | PyRegistry_InitValues | v,
 |  | PyCFunction | c,
 |  | const char * | doc
 | ) |

Definition at line 32 of file PythonContainer.cpp.

References GetPyType_Type, m_all, m_next, m_type, and PyRegistry_InitValues.

00033                                                              : m_v(v), m_c(c), m_doc(doc)
00034 {
00035     m_next = m_all;
00036     m_all = this;
00037
00038     PyTypeObject deftype =
00039     {
00040         PyObject_HEAD_INIT(0)
00041         0,
00042         (char *)name,
00043         size,
00044         0, \
00045         d,                           /*tp_dealloc*/
00046         0,                              /*tp_print*/
00047         g,                            /*tp_getattr*/
00048         0,                              /*tp_setattr*/
00049         0,                              /*tp_compare*/
00050         0,                              /*tp_repr*/
00051         0,                              /*tp_as_number*/
00052         0,                              /*tp_as_sequence*/
00053         0,                              /*tp_as_mapping*/
00054     };
00055
00056     m_type = deftype;
00057     m_type.ob_type = GetPyType_Type();
00058 }

PyRegistry::~PyRegistry ( )

Definition at line 60 of file PythonContainer.cpp.

00061 {
00062 }

Member Function Documentation

void PyRegistry::CallInitValues ( PyObject * dict ) [static]

Definition at line 84 of file PythonContainer.cpp.

References m_all, m_next, and m_v.

Referenced by InitializeInterp.

00085 {
00086     PyRegistry *tmp = m_all;
00087     while(tmp != 0L)
00088     {
00089         tmp->m_v(d);
00090         tmp = tmp->m_next;
00091     }
00092 }

void PyRegistry::RegisterAllObjects ( std::vector< PyMethodDef > & methods ) [static]

Definition at line 64 of file PythonContainer.cpp.

References m_all, m_c, m_doc, m_next, and m_type.

Referenced by InitializeInterp.

00065 {
00066     PyRegistry *tmp = m_all;
00067     PyMethodDef def;
00068     while(tmp != 0L)
00069     {
00070         def.ml_name = tmp->m_type.tp_name;
00071         def.ml_meth = tmp->m_c;
00072         def.ml_flags = METH_VARARGS;
00073         def.ml_doc = (char *)tmp->m_doc;
00074
00075         methods.push_back(def);
00076
00077         tmp = tmp->m_next;
00078     }
00079
00080     memset(&def, 0, sizeof(def));
00081     methods.push_back(def);
00082 }

Member Data Documentation

PyRegistry * PyRegistry::m_all = NULL [static, protected]

Definition at line 30 of file PythonContainer.cpp.

Referenced by CallInitValues, PyRegistry, and RegisterAllObjects.

PyCFunction PyRegistry::m_c [protected]

Definition at line 70 of file PythonContainer.h.

Referenced by RegisterAllObjects.

const char* PyRegistry::m_doc [protected]

Definition at line 71 of file PythonContainer.h.

Referenced by RegisterAllObjects.

PyRegistry* PyRegistry::m_next [protected]

Definition at line 68 of file PythonContainer.h.

Referenced by CallInitValues, PyRegistry, and RegisterAllObjects.

PyTypeObject PyRegistry::m_type

Definition at line 58 of file PythonContainer.h.

Referenced by PyRegistry, and RegisterAllObjects.

PyRegistry_InitValues PyRegistry::m_v [protected]

Definition at line 69 of file PythonContainer.h.

Referenced by CallInitValues.

The documentation for this class was generated from the following files:
  • common/PythonContainer.h
  • common/PythonContainer.cpp
Generated on Sun Feb 24 01:27:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CPython_Interp Class Reference

#include <PythonGlue.h>

Collaboration diagram for CPython_Interp:

[legend]
List of all members.

Public Methods

CPython_Interp (bool mainInterp=true)
~CPython_Interp ()
int | DoScriptVar (const char *format,...)
int | DoScript (const char *script)
int | DoFile (const char *file)
operator PyThreadState * (void)

Static Public Methods

bool | IsAvail (void)
void | InitPythonSupport (void)
void | ClosePythonSupport (void)

Protected Attributes

PyThreadState * fInterp

Static Protected Attributes

PyThreadState * | m_mainInterpreter = 0L

Constructor & Destructor Documentation

CPython_Interp::CPython_Interp ( bool mainInterp = true )

Definition at line 943 of file PythonGlue.cpp.

References cvs_err, fInterp, InitializeInterp, IsAvail, m_mainInterpreter, NULL, and Py_NewInterpreter.

00944 {
00945     fInterp = 0L;
00946
00947 #if USE_PYTHON
00948     if(!CPython_Interp::IsAvail())
00949     {
00950         cvs_err("Python is not available !\n");
00951         return;
00952     }
00953
00954     if(mainInterp)
00955     {
00956         fInterp = m_mainInterpreter;
00957         gCvsPrefs.SetTclFileRunning(true);
00958         return;
00959     }
00960
00961     {
00962         CPyThreadState lock(0L);
00963
00964         fInterp = Py_NewInterpreter();
00965         if(fInterp == NULL)
00966             return;
00967     }
00968
00969     InitializeInterp(fInterp);
00970     gCvsPrefs.SetTclFileRunning(true);
00971 #endif
00972 }

CPython_Interp::~CPython_Interp ( )

Definition at line 974 of file PythonGlue.cpp.

References fInterp, m_mainInterpreter, and Py_EndInterpreter.

00975 {
00976 #if USE_PYTHON
00977     if(fInterp != 0L)
00978     {
00979         gCvsPrefs.SetTclFileRunning(false);
00980
00981         if(fInterp != m_mainInterpreter)
00982         {
00983             CPyThreadState lock(fInterp);
00984
00985             Py_EndInterpreter(fInterp);
00986         }
00987     }
00988 #endif
00989 }

Member Function Documentation

void CPython_Interp::ClosePythonSupport ( void ) [static]

Definition at line 1179 of file PythonGlue.cpp.

References IsAvail, m_mainInterpreter, Py_Finalize, PyInvalUICache, and PyThreadState_Swap.

Referenced by CWincvsView::~CWincvsView.

01180 {
01181 #if USE_PYTHON
01182     if(!CPython_Interp::IsAvail())
01183         return;
01184
01185     PyThreadState_Swap(m_mainInterpreter);
01186 //  PyEval_ReleaseLock();
01187
01188     PyInvalUICache();
01189
01190     Py_Finalize();
01191     m_mainInterpreter = 0L;
01192 #endif
01193 }

int CPython_Interp::DoFile ( const char * file )

Definition at line 1117 of file PythonGlue.cpp.

References fInterp, and PyRun_SimpleFile.

01118 {
01119 #if USE_PYTHON
01120     if(fInterp == 0L)
01121         return -1;
01122
01123     CPyThreadState lock(fInterp);
01124
01125     FILE *f = fopen(file, "r");
01126     if(f)
01127     {
01128         PyRun_SimpleFile(f, (char *)file);
01129         fclose(f);
01130     }
01131
01132     return 0;
01133 #else
01134     return -1;
01135 #endif
01136 }

int CPython_Interp::DoScript ( const char * script )

Definition at line 1082 of file PythonGlue.cpp.

References fInterp, and PyRun_SimpleString.

Referenced by DoScriptVar, and CWincvsView::OnKeyDown.

01083 {
01084 #if USE_PYTHON
01085     if(fInterp == 0L)
01086         return -1;
01087
01088     CPyThreadState lock(fInterp);
01089
01090     PyRun_SimpleString((char *)script);
01091
01092     return 0;
01093 #else
01094     return -1;
01095 #endif
01096 }

int CPython_Interp::DoScriptVar | ( | const char * | format,
 |  | ... |
 | ) |

Definition at line 1098 of file PythonGlue.cpp.

References DoScript, and fInterp.

Referenced by PyDoCmdUI, PyDoPython, and PyMacrosReloadAll.

01099 {
01100 #if USE_PYTHON
01101     if(fInterp == 0L)
01102         return -1;
01103
01104     va_list args;
01105     char script[1024] = {'\0'};
01106
01107     va_start (args, format);
01108     vsprintf (script, format, args);
01109     va_end (args);
01110
01111     return DoScript(script);
01112 #else
01113     return -1;
01114 #endif
01115 }

void CPython_Interp::InitPythonSupport ( void ) [static]

Definition at line 1144 of file PythonGlue.cpp.

References InitializeInterp, IsAvail, m_mainInterpreter, NULL, Py_Initialize, Py_SetProgramName, PyEval_InitThreads, and PyThreadState_Swap.

Referenced by CWincvsView::OnInitialUpdate.

01145 {
01146 #if USE_PYTHON
01147     if(!CPython_Interp::IsAvail())
01148         return;
01149
01150 #ifdef WIN32
01151     Py_SetProgramName("wincvs");
01152     Py_Initialize();
01153 #elif qMacCvsPP
01154     console_output_state = 1;
01155
01156     PyMac_SetConsoleHandler(PyMac_DummyReadHandler, PyMac_DummyWriteHandler,
01157         PyMac_DummyWriteHandler);
01158
01159     PyMacSchedParams scp;
01160
01161     PyMac_GetSchedParams(&scp);
01162     scp.process_events = 0;
01163     PyMac_SetSchedParams(&scp);
01164
01165     Py_SetProgramName("maccvs");
01166     PyMac_Initialize();
01167 #else
01168     Py_SetProgramName("gcvs");
01169     Py_Initialize();
01170 #endif
01171
01172     PyEval_InitThreads();
01173     m_mainInterpreter = PyThreadState_Swap(NULL);
01174
01175     InitializeInterp(m_mainInterpreter);
01176 #endif
01177 }

bool CPython_Interp::IsAvail ( void ) [static]

Definition at line 991 of file PythonGlue.cpp.

References _PyObject_Del, _PyObject_New, CompatConnectID, CompatLoadLibrary, Py_BuildValue, Py_EndInterpreter, Py_Finalize, Py_FindMethod, Py_GetPath, Py_Initialize, Py_InitModule4, Py_IsInitialized, Py_NewInterpreter, Py_SetProgramName, PyArg_ParseTuple, PyDict_SetItemString, PyErr_Clear, PyErr_NewException, PyErr_SetString, PyEval_InitThreads, PyFile_AsFile, PyInt_FromLong, PyModule_GetDict, PyRun_SimpleFile, PyRun_SimpleString, PyString_AsString, PyString_FromString, PySys_SetPath, PyThreadState_Swap, PyTuple_New, PyTuple_Size, and WarnNoPython.

Referenced by ClosePythonSupport, CPython_Interp, CWincvsApp::InitInstance, InitPythonSupport, CWincvsView::OnKeyDown, and CWincvsDoc::OnUpdateUsePyshell.

00992 {
00993 #if USE_PYTHON
00994 #   if qMacCvsPP
00995     return PyThreadState_Swap != 0L;
00996 #   elif defined(WIN32) && !qCvsDebug /* || qCarbon */
00997     static bool firstTime = true;
00998     static bool pyAvail = false;
00999     if(firstTime)
01000     {
01001 #   if defined(WIN32) || qCarbon
01002         CompatConnectID connID;
01003 #   endif
01004
01005 #   ifdef WIN32
01006         if(!pyAvail)
01007             pyAvail = CompatLoadLibrary(&connID, "python21.dll") != 0 ||
01008                 CompatLoadLibrary(&connID, "python22.dll") != 0;
01009 #   endif
01010
01011 #   if qCarbon
01012         if (UEnvironment::GetOSVersion() >= 0x1000)
01013             pyAvail = CompatLoadLibrary(&connID, "/System/Library/Frameworks/Tcl.framework");
01014         else
01015             pyAvail = CompatLoadLibrary(&connID, "tcl8.3");
01016 #   endif
01017
01018 #   if defined(WIN32) || qCarbon
01019 #   define LOAD_CODEFRAG(name) \
01020         if(pyAvail) \
01021             pyAvail = (*(void **)&name##_glue = \
01022                 _CompatCallLibrary(connID, #name)) != 0L
01023 #   endif
01024 #   if defined(WIN32) || TARGET_API_MAC_CARBON
01025         LOAD_CODEFRAG(PyThreadState_Swap);
01026         LOAD_CODEFRAG(PyDict_SetItemString);
01027         LOAD_CODEFRAG(PyErr_Clear);
01028         LOAD_CODEFRAG(PyInt_FromLong);
01029         LOAD_CODEFRAG(PyErr_SetString);
01030         LOAD_CODEFRAG(PyArg_ParseTuple);
01031         LOAD_CODEFRAG(PyTuple_New);
01032         LOAD_CODEFRAG(Py_BuildValue);
01033         LOAD_CODEFRAG(PyFile_AsFile);
01034         LOAD_CODEFRAG(PyString_AsString);
01035         LOAD_CODEFRAG(PyTuple_Size);
01036         LOAD_CODEFRAG(PyRun_SimpleString);
01037         LOAD_CODEFRAG(PyRun_SimpleFile);
01038         LOAD_CODEFRAG(Py_SetProgramName);
01039         LOAD_CODEFRAG(Py_Initialize);
01040         LOAD_CODEFRAG(Py_Finalize);
01041         LOAD_CODEFRAG(Py_IsInitialized);
01042         LOAD_CODEFRAG(Py_NewInterpreter);
01043         LOAD_CODEFRAG(Py_EndInterpreter);
01044         LOAD_CODEFRAG(PyString_FromString);
01045         LOAD_CODEFRAG(PyErr_NewException);
01046         LOAD_CODEFRAG(PyModule_GetDict);
01047         LOAD_CODEFRAG(Py_InitModule4);
01048         LOAD_CODEFRAG(PyEval_InitThreads);
01049         LOAD_CODEFRAG(Py_FindMethod);
01050         LOAD_CODEFRAG(_PyObject_New);
01051         LOAD_CODEFRAG(_PyObject_Del);
01052         LOAD_CODEFRAG(PySys_SetPath);
01053         LOAD_CODEFRAG(Py_GetPath);
01054
01055         LOAD_CODEFRAG(PyType_Type);
01056         LOAD_CODEFRAG(PyFile_Type);
01057         LOAD_CODEFRAG(PyString_Type);
01058         LOAD_CODEFRAG(PyTuple_Type);
01059         LOAD_CODEFRAG(PyInt_Type);
01060         LOAD_CODEFRAG(_Py_NoneStruct);
01061         LOAD_CODEFRAG(_Py_ZeroStruct);
01062         LOAD_CODEFRAG(_Py_TrueStruct);
01063
01064         if(!pyAvail)
01065         {
01066             WarnNoPython();
01067         }
01068 #   endif /* WIN32 */
01069
01070         firstTime = false;
01071     }
01072
01073     return pyAvail;
01074 #   else
01075     return true;
01076 #   endif
01077 #else // !USE_PYTHON
01078     return false;
01079 #endif // !USE_PYTHON
01080 }

CPython_Interp::operator PyThreadState * ( void ) [inline]

Definition at line 49 of file PythonGlue.h.

References fInterp.

00049 {return fInterp;}

Member Data Documentation

PyThreadState* CPython_Interp::fInterp [protected]

Definition at line 52 of file PythonGlue.h.

Referenced by CPython_Interp, DoFile, DoScript, DoScriptVar, operator PyThreadState *, and ~CPython_Interp.

PyThreadState * CPython_Interp::m_mainInterpreter = 0L [static, protected]

Definition at line 84 of file PythonGlue.cpp.

Referenced by ClosePythonSupport, CPython_Interp, InitPythonSupport, and ~CPython_Interp.

The documentation for this class was generated from the following files:
  • common/PythonGlue.h
  • common/PythonGlue.cpp
Generated on Sun Feb 24 01:27:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CPyThreadState Class Reference

Collaboration diagram for CPyThreadState:

[legend]
List of all members.

Public Methods

CPyThreadState (PyThreadState *p)
~CPyThreadState ()

Protected Attributes

PyThreadState * m_p

Constructor & Destructor Documentation

CPyThreadState::CPyThreadState ( PyThreadState * p ) [inline]

Definition at line 92 of file PythonGlue.cpp.

References m_p, PyThreadState, and PyThreadState_Swap.

00092                                      : m_p(p)
00093     {
00094         m_p = PyThreadState_Swap(p);
00095     }

CPyThreadState::~CPyThreadState ( ) [inline]

Definition at line 96 of file PythonGlue.cpp.

References m_p, and PyThreadState_Swap.

00097     {
00098         PyThreadState_Swap(m_p);
00099     }

Member Data Documentation

PyThreadState* CPyThreadState::m_p [protected]

Definition at line 101 of file PythonGlue.cpp.

Referenced by CPyThreadState, and ~CPyThreadState.

The documentation for this class was generated from the following file:
  • common/PythonGlue.cpp
Generated on Sun Feb 24 01:27:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


URect Class Reference

#include <udraw.h>

Inheritance diagram for URect:

[legend]
Collaboration diagram for URect:

[legend]
List of all members.

Public Methods

URect ()
URect (int l, int t, int r, int b)
URect (const URECT &srURect)
URect (const URECT *lpSrURect)
URect (UPOINT point, USIZE size)
URect (UPOINT topLeft, UPOINT bottomRight)
URect (const CRect &winRect)
int | Width () const
int | Height () const
USize | Size () const
UPoint & TopLeft ()
UPoint & BottomRight ()
const UPoint & | TopLeft () const
const UPoint & | BottomRight () const
UPoint | CenterPoint () const
operator URECT * ()
operator const URECT * () const
operator CRect () const
bool | IsRectEmpty () const
bool | IsRectNull () const
bool | PtInRect (UPOINT point) const
void | SetRect (int x1, int y1, int x2, int y2)
void | SetRect (UPOINT topLeft, UPOINT bottomRight)
void | SetRectEmpty ()
void | CopyRect (const URECT *lpSrURect)
bool | EqualRect (const URECT *lpRect) const
void | InflateRect (int x, int y)
void | InflateRect (USIZE size)
void | InflateRect (const URECT *lpRect)
void | InflateRect (int l, int t, int r, int b)
void | DeflateRect (int x, int y)
void | DeflateRect (USIZE size)
void | DeflateRect (const URECT *lpRect)
void | DeflateRect (int l, int t, int r, int b)
void | OffsetRect (int x, int y)
void | OffsetRect (USIZE size)
void | OffsetRect (UPOINT point)
void | NormalizeRect ()
bool | IntersectRect (const URECT *lpRect1, const URECT *lpRect2)
bool | UnionRect (const URECT *lpRect1, const URECT *lpRect2)
void | operator= (const URECT &srURect)
bool | operator== (const URECT &rect) const
bool | operator!= (const URECT &rect) const
void | operator+= (UPOINT point)
void | operator+= (USIZE size)
void | operator+= (const URECT *lpRect)
void | operator-= (UPOINT point)
void | operator-= (USIZE size)
void | operator-= (const URECT *lpRect)
void | operator &= (const URECT &rect)
void | operator|= (const URECT &rect)
URect | operator+ (UPOINT point) const
URect | operator- (UPOINT point) const
URect | operator+ (const URECT *lpRect) const
URect | operator+ (USIZE size) const
URect | operator- (USIZE size) const
URect | operator- (const URECT *lpRect) const
URect | operator & (const URECT &rect2) const
URect | operator| (const URECT &rect2) const
URect | MulDiv (int nMultiplier, int nDivisor) const

Constructor & Destructor Documentation

URect::URect ( ) [inline]

Definition at line 324 of file udraw.h.

00325     { /* random filled */ }

URect::URect | ( | int | l,
 |  | int | t,
 |  | int | r,
 |  | int | b
 | ) | [inline]

Definition at line 326 of file udraw.h.

References URECT::bottom, URECT::left, URECT::right, and URECT::top.

00327     { left = l; top = t; right = r; bottom = b; }

URect::URect ( const URECT & srURect ) [inline]

Definition at line 328 of file udraw.h.

00329     { ::CopyRect(this, &srURect); }

URect::URect ( const URECT * lpSrURect ) [inline]

Definition at line 330 of file udraw.h.

00331     { ::CopyRect(this, lpSrURect); }

URect::URect | ( | UPOINT | point,
 |  | USIZE | size
 | ) | [inline]

Definition at line 332 of file udraw.h.

References URECT::bottom, USIZE::cx, USIZE::cy, URECT::left, URECT::right, URECT::top, UPOINT::x, and UPOINT::y.

00333     { right = (left = point.x) + size.cx; bottom = (top = point.y) + size.cy; }

URect::URect | ( | UPOINT | topLeft,
 |  | UPOINT | bottomRight
 | ) | [inline]

Definition at line 334 of file udraw.h.

References URECT::bottom, URECT::left, URECT::right, URECT::top, UPOINT::x, and UPOINT::y.

00335     { left = topLeft.x; top = topLeft.y;
00336         right = bottomRight.x; bottom = bottomRight.y; }

URect::URect ( const CRect & winRect ) [inline]

Definition at line 342 of file udraw.h.

References URECT::bottom, URECT::left, URECT::right, and URECT::top.

00343     { left = winRect.left; right = winRect.right; top = winRect.top; bottom = winRect.bottom; }

Member Function Documentation

const UPoint & URect::BottomRight ( ) const [inline]

Definition at line 357 of file udraw.h.

00358     { return *((UPoint*)this+1); }

UPoint & URect::BottomRight ( ) [inline]

Definition at line 353 of file udraw.h.

Referenced by CWinLogData::ComputeBounds, and CWinLogData::Update.

00354     { return *((UPoint*)this+1); }

UPoint URect::CenterPoint ( ) const [inline]

Definition at line 359 of file udraw.h.

References URECT::bottom, URECT::left, URECT::right, and URECT::top.

Referenced by CWinLogData::Update, CWinLogBranchData::UpdateSelf, CWinLogTagData::UpdateSelf, CWinLogRevData::UpdateSelf, and CWinLogHeaderData::UpdateSelf.

00360     { return UPoint((left+right)/2, (top+bottom)/2); }

void URect::CopyRect ( const URECT * lpSrURect ) [inline]

Definition at line 389 of file udraw.h.

00390     { ::CopyRect(this, lpSrURect); }

void URect::DeflateRect | ( | int | l,
 |  | int | t,
 |  | int | r,
 |  | int | b
 | ) |

void URect::DeflateRect ( const URECT * lpRect )

void URect::DeflateRect ( USIZE size ) [inline]

Definition at line 399 of file udraw.h.

References USIZE::cx, and USIZE::cy.

00400     { ::InflateRect(this, -size.cx, -size.cy); }

void URect::DeflateRect | ( | int | x,
 |  | int | y
 | ) | [inline]

Definition at line 397 of file udraw.h.

Referenced by operator-, and operator-=.

00398     { ::InflateRect(this, -x, -y); }

bool URect::EqualRect ( const URECT * lpRect ) const [inline]

Definition at line 391 of file udraw.h.

References EqualRect.

00392     { return ::EqualRect(this, lpRect); }

int URect::Height ( ) const [inline]

Definition at line 347 of file udraw.h.

References URECT::bottom, and URECT::top.

Referenced by UCvsGraph::CalcImageSize, CWinLogData::ComputeBounds, UWidget::OnSetLoc, UDC::Rectangle, UDC::RoundRect, UDC::TextOutClipped, and CWinLogRevData::UpdateSelf.

00348     { return bottom - top; }

void URect::InflateRect | ( | int | l,
 |  | int | t,
 |  | int | r,
 |  | int | b
 | ) |

void URect::InflateRect ( const URECT * lpRect )

void URect::InflateRect ( USIZE size ) [inline]

Definition at line 395 of file udraw.h.

References USIZE::cx, and USIZE::cy.

00396     { ::InflateRect(this, size.cx, size.cy); }

void URect::InflateRect | ( | int | x,
 |  | int | y
 | ) | [inline]

Definition at line 393 of file udraw.h.

Referenced by operator+, and operator+=.

00394     { ::InflateRect(this, x, y); }

bool URect::IntersectRect | ( | const URECT * | lpRect1,
 |  | const URECT * | lpRect2
 | ) | [inline]

Definition at line 407 of file udraw.h.

References IntersectRect.

00408     { return ::IntersectRect(this, lpRect1, lpRect2);}

bool URect::IsRectEmpty ( ) const [inline]

Definition at line 377 of file udraw.h.

References URECT::bottom, URECT::left, URECT::right, and URECT::top.

00378     { return left == right || top == bottom; }

bool URect::IsRectNull ( ) const [inline]

Definition at line 379 of file udraw.h.

References URECT::bottom, URECT::left, URECT::right, and URECT::top.

00380     { return (left == 0 && right == 0 && top == 0 && bottom == 0); }

URect URect::MulDiv | ( | int | nMultiplier,
 |  | int | nDivisor
 | ) | const

void URect::NormalizeRect ( )

void URect::OffsetRect ( UPOINT point ) [inline]

Definition at line 403 of file udraw.h.

References UPOINT::x, and UPOINT::y.

00404     { ::OffsetRect(this, point.x, point.y); }

void URect::OffsetRect ( USIZE size ) [inline]

Definition at line 405 of file udraw.h.

References USIZE::cx, and USIZE::cy.

00406     { ::OffsetRect(this, size.cx, size.cy); }

void URect::OffsetRect | ( | int | x,
 |  | int | y
 | ) | [inline]

Definition at line 401 of file udraw.h.

Referenced by CWinLogData::ComputeBounds, DrawNode, CWinLogData::Offset, and CWinLogData::SetSelected.

00402     { ::OffsetRect(this, x, y); }

URect URect::operator & ( const URECT & rect2 ) const [inline]

Definition at line 445 of file udraw.h.

00446     { URect rect; ::IntersectRect(&rect, this, &rect2);
00447         return rect; }

void URect::operator &= ( const URECT & rect ) [inline]

Definition at line 429 of file udraw.h.

00430     { ::IntersectRect(this, this, &rect); }

URect::operator const URECT * ( ) const [inline]

Definition at line 363 of file udraw.h.

00364     { return this; }

URect::operator CRect ( ) const [inline]

Definition at line 372 of file udraw.h.

References URECT::bottom, URECT::left, URECT::right, and URECT::top.

00373 {
00374     return CRect(left, top, right, bottom);
00375 }

URect::operator URECT * ( ) [inline]

Definition at line 361 of file udraw.h.

00362     { return this; }

bool URect::operator!= ( const URECT & rect ) const [inline]

Definition at line 415 of file udraw.h.

00416     { return !::EqualRect(this, &rect); }

URect URect::operator+ ( USIZE size ) const [inline]

Definition at line 437 of file udraw.h.

References USIZE::cx, and USIZE::cy.

00438     { URect rect(*this); ::OffsetRect(&rect, size.cx, size.cy); return rect; }

URect URect::operator+ ( const URECT * lpRect ) const [inline]

Definition at line 441 of file udraw.h.

References InflateRect.

00442     { URect rect(this); rect.InflateRect(lpRect); return rect; }

URect URect::operator+ ( UPOINT point ) const [inline]

Definition at line 433 of file udraw.h.

References UPOINT::x, and UPOINT::y.

00434     { URect rect(*this); ::OffsetRect(&rect, pt.x, pt.y); return rect; }

void URect::operator+= ( const URECT * lpRect ) [inline]

Definition at line 421 of file udraw.h.

References InflateRect.

00422     { InflateRect(lpRect); }

void URect::operator+= ( USIZE size ) [inline]

Definition at line 419 of file udraw.h.

References USIZE::cx, and USIZE::cy.

00420     { ::OffsetRect(this, size.cx, size.cy); }

void URect::operator+= ( UPOINT point ) [inline]

Definition at line 417 of file udraw.h.

References UPOINT::x, and UPOINT::y.

00418     { ::OffsetRect(this, point.x, point.y); }

URect URect::operator- ( const URECT * lpRect ) const [inline]

Definition at line 443 of file udraw.h.

References DeflateRect.

00444     { URect rect(this); rect.DeflateRect(lpRect); return rect; }

URect URect::operator- ( USIZE size ) const [inline]

Definition at line 439 of file udraw.h.

References USIZE::cx, and USIZE::cy.

00440     { URect rect(*this); ::OffsetRect(&rect, -size.cx, -size.cy); return rect; }

URect URect::operator- ( UPOINT point ) const [inline]

Definition at line 435 of file udraw.h.

References UPOINT::x, and UPOINT::y.

00436     { URect rect(*this); ::OffsetRect(&rect, -pt.x, -pt.y); return rect; }

void URect::operator-= ( const URECT * lpRect ) [inline]

Definition at line 427 of file udraw.h.

References DeflateRect.

00428     { DeflateRect(lpRect); }

void URect::operator-= ( USIZE size ) [inline]

Definition at line 425 of file udraw.h.

References USIZE::cx, and USIZE::cy.

00426     { ::OffsetRect(this, -size.cx, -size.cy); }

void URect::operator-= ( UPOINT point ) [inline]

Definition at line 423 of file udraw.h.

References UPOINT::x, and UPOINT::y.

00424     { ::OffsetRect(this, -point.x, -point.y); }

void URect::operator= ( const URECT & srURect ) [inline]

Definition at line 411 of file udraw.h.

00412     { ::CopyRect(this, &srURect); }

bool URect::operator== ( const URECT & rect ) const [inline]

Definition at line 413 of file udraw.h.

References EqualRect.

00414     { return ::EqualRect(this, &rect); }

URect URect::operator| ( const URECT & rect2 ) const [inline]

Definition at line 448 of file udraw.h.

00449     { URect rect; ::UnionRect(&rect, this, &rect2);
00450         return rect; }

void URect::operator|= ( const URECT & rect ) [inline]

Definition at line 431 of file udraw.h.

00432     { ::UnionRect(this, this, &rect); }

bool URect::PtInRect ( UPOINT point ) const [inline]

Definition at line 381 of file udraw.h.

References PtInRect.

Referenced by CWinLogData::HitTest.

00382     { return ::PtInRect(this, point); }

void URect::SetRect | ( | UPOINT | topLeft,
 |  | UPOINT | bottomRight
 | ) | [inline]

Definition at line 385 of file udraw.h.

References UPOINT::x, and UPOINT::y.

00386     { ::SetRect(this, topLeft.x, topLeft.y, bottomRight.x, bottomRight.y); }

void URect::SetRect | ( | int | x1,
 |  | int | y1,
 |  | int | x2,
 |  | int | y2
 | ) | [inline]

Definition at line 383 of file udraw.h.

Referenced by CWinLogData::ComputeBounds.

00384     { ::SetRect(this, x1, y1, x2, y2); }

void URect::SetRectEmpty ( ) [inline]

Definition at line 387 of file udraw.h.

Referenced by CWinLogData::ComputeBounds, and CWinLogData::CWinLogData.

00388     { ::SetRectEmpty(this); }

USize URect::Size ( ) const [inline]

Definition at line 349 of file udraw.h.

References URECT::bottom, URECT::left, URECT::right, and URECT::top.

Referenced by UCvsGraph::CalcImageSize.

00350     { return USize(right - left, bottom - top); }

const UPoint & URect::TopLeft ( ) const [inline]

Definition at line 355 of file udraw.h.

00356     { return *((UPoint*)this); }

UPoint & URect::TopLeft ( ) [inline]

Definition at line 351 of file udraw.h.

Referenced by UCvsGraph::CalcImageSize, CWinLogData::ComputeBounds, UWidget::OnSetLoc, CWinLogData::Update, and CWinLogRevData::UpdateSelf.

00352     { return *((UPoint*)this); }

bool URect::UnionRect | ( | const URECT * | lpRect1,
 |  | const URECT * | lpRect2
 | ) | [inline]

Definition at line 409 of file udraw.h.

References UnionRect.

Referenced by CWinLogData::ComputeBounds.

00410     { return ::UnionRect(this, lpRect1, lpRect2); }

int URect::Width ( ) const [inline]

Definition at line 345 of file udraw.h.

References URECT::left, and URECT::right.

Referenced by UCvsGraph::CalcImageSize, CWinLogData::ComputeBounds, UWidget::OnSetLoc, UDC::Rectangle, UDC::RoundRect, UDC::TextOutClipped, and CWinLogData::Update.

00346     { return right - left; }

The documentation for this class was generated from the following file:
  • rf/udraw.h
Generated on Sun Feb 24 01:27:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


URECT Struct Reference

#include <umain.h>

Inheritance diagram for URECT:

[legend]
Collaboration diagram for URECT:

[legend]
List of all members.

Public Attributes

int | left
int | top
int | right
int | bottom

Member Data Documentation

int URECT::bottom

Definition at line 926 of file umain.h.

Referenced by URect::CenterPoint, EqualRect, URect::Height, InflateRect, IntersectRect, URect::IsRectEmpty, IsRectEmpty, URect::IsRectNull, OffsetRect, UWidget::OnGetLoc, UWidget::OnSetLoc, URect::operator CRect, PtInRect, SetRect, SetRectEmpty, URect::Size, UDC::TextOutClipped, UnionRect, URect::URect, and TPseudoWinAdorner::ViewChangedFrame.

int URECT::left

Definition at line 926 of file umain.h.

Referenced by URect::CenterPoint, EqualRect, InflateRect, IntersectRect, URect::IsRectEmpty, IsRectEmpty, URect::IsRectNull, OffsetRect, UWidget::OnGetLoc, UWidget::OnSetLoc, URect::operator CRect, PtInRect, UDC::Rectangle, UDC::RoundRect, SetRect, SetRectEmpty, URect::Size, UDC::TextOutClipped, UnionRect, CWinLogRevData::UpdateSelf, URect::URect, TPseudoWinAdorner::ViewChangedFrame, and URect::Width.

int URECT::right

Definition at line 926 of file umain.h.

Referenced by URect::CenterPoint, EqualRect, InflateRect, IntersectRect, URect::IsRectEmpty, IsRectEmpty, URect::IsRectNull, OffsetRect, UWidget::OnGetLoc, UWidget::OnSetLoc, URect::operator CRect, PtInRect, SetRect, SetRectEmpty, URect::Size, UnionRect, URect::URect, TPseudoWinAdorner::ViewChangedFrame, and URect::Width.

int URECT::top

Definition at line 926 of file umain.h.

Referenced by URect::CenterPoint, EqualRect, URect::Height, InflateRect, IntersectRect, URect::IsRectEmpty, IsRectEmpty, URect::IsRectNull, OffsetRect, UWidget::OnGetLoc, UWidget::OnSetLoc, URect::operator CRect, PtInRect, UDC::Rectangle, UDC::RoundRect, SetRect, SetRectEmpty, URect::Size, UnionRect, URect::URect, and TPseudoWinAdorner::ViewChangedFrame.

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Sun Feb 24 01:27:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CRectTracker Class Reference

Inheritance diagram for CRectTracker:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/GraphView.cpp
Generated on Sun Feb 24 01:27:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CRecursionLock Class Reference

Collaboration diagram for CRecursionLock:

[legend]
List of all members.

Public Methods

CRecursionLock (bool &semaphore)
~CRecursionLock ()

Private Attributes

bool & m_semaphore

Constructor & Destructor Documentation

CRecursionLock::CRecursionLock ( bool & semaphore ) [inline]

Definition at line 597 of file BrowseFileView.cpp.

References m_semaphore.

00598     : m_semaphore(semaphore)
00599     {
00600         m_semaphore = true;
00601     }

CRecursionLock::~CRecursionLock ( ) [inline]

Definition at line 603 of file BrowseFileView.cpp.

References m_semaphore.

00604     {
00605         m_semaphore = false;
00606     }

Member Data Documentation

bool& CRecursionLock::m_semaphore [private]

Definition at line 595 of file BrowseFileView.cpp.

Referenced by CRecursionLock, and ~CRecursionLock.

The documentation for this class was generated from the following file:
  • WinCvs/BrowseFileView.cpp
Generated on Sun Feb 24 01:27:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CReleaseDlg Class Reference

#include <ReleaseDlg.h>

Inheritance diagram for CReleaseDlg:

[legend]
Collaboration diagram for CReleaseDlg:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_RELEASE }

Public Methods

CReleaseDlg (CWnd *pParent=NULL)

Public Attributes

CString | m_strDirectory
BOOL | m_bRemoveDirectory

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 47 of file ReleaseDlg.h.

00047 { IDD = IDD_RELEASE };

Constructor & Destructor Documentation

CReleaseDlg::CReleaseDlg ( CWnd * pParent = NULL )

Definition at line 45 of file ReleaseDlg.cpp.

References FALSE, m_bRemoveDirectory, and m_strDirectory.

00046     : CDialog(CReleaseDlg::IDD, pParent)
00047 {
00048     //{{AFX_DATA_INIT(CReleaseDlg)
00049     m_strDirectory = _T("");
00050     m_bRemoveDirectory = FALSE;
00051     //}}AFX_DATA_INIT
00052 }

Member Function Documentation

void CReleaseDlg::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 55 of file ReleaseDlg.cpp.

References IDC_DIRECTORY, IDC_REMOVE, m_bRemoveDirectory, and m_strDirectory.

00056 {
00057     CDialog::DoDataExchange(pDX);
00058     //{{AFX_DATA_MAP(CReleaseDlg)
00059     DDX_Text(pDX, IDC_DIRECTORY, m_strDirectory);
00060     DDX_Check(pDX, IDC_REMOVE, m_bRemoveDirectory);
00061     //}}AFX_DATA_MAP
00062 }

Member Data Documentation

BOOL CReleaseDlg::m_bRemoveDirectory

Definition at line 49 of file ReleaseDlg.h.

Referenced by CompatGetRelease, CReleaseDlg, and DoDataExchange.

CString CReleaseDlg::m_strDirectory

Definition at line 48 of file ReleaseDlg.h.

Referenced by CompatGetRelease, CReleaseDlg, and DoDataExchange.

The documentation for this class was generated from the following files:
  • common/ReleaseDlg.h
  • common/ReleaseDlg.cpp
Generated on Sun Feb 24 01:27:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


RemoveCvsArgs Class Reference

Inheritance diagram for RemoveCvsArgs:

[legend]
Collaboration diagram for RemoveCvsArgs:

[legend]
List of all members.

Public Methods

virtual void addfile (const char *arg, const char *dir=0L, const FSSpec *spec=0L)

Member Function Documentation

void RemoveCvsArgs::addfile | ( | const char * | arg,
 |  | const char * | dir = 0L,
 |  | const FSSpec * | spec = 0L
 | ) | [virtual]

Reimplemented from CvsArgs.

Definition at line 1340 of file CvsCommands.cpp.

References CvsArgs::addfile, CompatMoveToTrash, CStr, cvs_err, cvs_out, stat, and UFSSpec.

01341 {
01342     CvsArgs::addfile(arg, dir, spec);
01343
01344     CStr fullpath(dir);
01345     if(!fullpath.endsWith(kPathDelimiter))
01346         fullpath << kPathDelimiter;
01347     fullpath << arg;
01348
01349     // check the file is not already deleted
01350     struct stat sb;
01351     if (stat(dir, &sb) != -1 && S_ISDIR(sb.st_mode) &&
01352         stat(fullpath, &sb) == -1 && errno == ENOENT)
01353     {
01354         return;
01355     }
01356
01357     if(!CompatMoveToTrash(arg, dir, spec))
01358 #ifdef WIN32
01359         cvs_err("Unable to send \'%s\' to the recycle bin\n", arg);
01360     else
01361         cvs_out("\'%s\' has been moved successfully to the recycle bin...\n", arg);
01362 #elif !defined(macintosh)
01363         cvs_err("Unable to send \'%s\' to the trash\n", arg);
01364     else
01365         cvs_out("\'%s\' has been moved successfully to trash...\n", arg);
01366 #else
01367     {}
01368 #endif
01369 }

The documentation for this class was generated from the following file:
  • common/CvsCommands.cpp
Generated on Sun Feb 24 01:27:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ReportConflict Class Reference

#include <ImportFilter.h>

Collaboration diagram for ReportConflict:

[legend]
List of all members.

Public Types

enum {
noConflict = 0x0000,
hasConflict = 0x0001,
hasExtension = 0x0002,
isBinary = 0x0004,
forceBinary = 0x0008,
forceText = 0x0010,
hasIgnore = 0x0020,
hasTypeCreatorConflict = 0x0040,
forceNoKeywords = 0x0080,
isUnicode = 0x0100,
forceUnicode = 0x0200,
userFlags = forceText | forceBinary | forceUnicode | hasIgnore | forceNoKeywords
}

Public Methods

ReportConflict (int mac_type, int mac_creator)
~ReportConflict ()
void | AddPattern (const char *newpat, kFileType fileType, bool isExtension, const char *sample)
void | SetConflict (const char *sample)
void | SetTypeCreatorConflict (const char *sample)
bool | Match (const char *pat)
bool | HasConflict (void) const
bool | HasTypeCreatorConflict (void) const
bool | IsBinary (void) const
bool | IsUnicode (void) const
bool | IsExtension (void) const
const char * | GetPattern (void) const
int | GetMacType (void) const
int | GetMacCreator (void) const
void | ForceBinary (void)
void | ForceText (void)
void | ForceUnicode (void)
void | Ignore (void)
void | ForceNoKeywords (void)
bool | HasForceBinary (void) const
bool | HasForceText (void) const
bool | HasForceUnicode (void) const
bool | HasIgnore (void) const
bool | HasForceNoKeywords (void) const
void | DisableUserSettings (void)
void | PrintOut (UStr &out) const

Public Attributes

ReportConflict * | next

Protected Attributes

int | status
UStr pattern
UStr sample1
UStr sample2
int | ftype
int | fcreator

Member Enumeration Documentation

anonymous enum

Enumeration values:
noConflict
hasConflict
hasExtension
isBinary
forceBinary
forceText
hasIgnore
hasTypeCreatorConflict
forceNoKeywords
isUnicode
forceUnicode
userFlags

Definition at line 52 of file ImportFilter.h.

00053     {
00054         noConflict =                0x0000,
00055         hasConflict =               0x0001,
00056         hasExtension =              0x0002,
00057         isBinary =                  0x0004,
00058         forceBinary =               0x0008,
00059         forceText =                 0x0010,
00060         hasIgnore =                 0x0020,
00061         hasTypeCreatorConflict =    0x0040, /* mac only */
00062         forceNoKeywords =           0x0080,
00063         isUnicode =                 0x0100,
00064         forceUnicode =              0x0200,
00065         userFlags =     forceText | forceBinary | forceUnicode | hasIgnore | forceNoKeywords
00066     };

Constructor & Destructor Documentation

ReportConflict::ReportConflict | ( | int | mac_type,
 |  | int | mac_creator
 | ) |

Definition at line 75 of file ImportFilter.cpp.

References fcreator, ftype, next, noConflict, and status.

00076 {
00077     next = 0L;
00078     status = noConflict;
00079     ftype = mac_type;
00080     fcreator = mac_creator;
00081 }

ReportConflict::~ReportConflict ( )

Definition at line 137 of file ImportFilter.cpp.

00138 {
00139 }

Member Function Documentation

void ReportConflict::AddPattern | ( | const char * | newpat,
 |  | kFileType | fileType,
 |  | bool | isExtension,
 |  | const char * | sample
 | ) |

Definition at line 141 of file ImportFilter.cpp.

References hasExtension, isBinary, isUnicode, kFileType, kFileTypeBin, kFileTypeUnicode, pattern, sample1, and status.

Referenced by list_add_type.

00142 {
00143     pattern = newpat;
00144     sample1 = sample;
00145
00146     switch( fileType )
00147     {
00148     case kFileTypeBin:
00149         status |= isBinary;
00150         break;
00151     case kFileTypeUnicode:
00152         status |= isUnicode;
00153         break;
00154     default:
00155         // nothing to do
00156         break;
00157     }
00158
00159     if(isExt)
00160         status |= hasExtension;
00161 }

void ReportConflict::DisableUserSettings ( void ) [inline]

Definition at line 151 of file ImportFilter.h.

References status, and userFlags.

Referenced by CImportFilterDlg::OnEditentry.

00152     {
00153         status &= ~(int)userFlags;
00154     }

void ReportConflict::ForceBinary ( void ) [inline]

Definition at line 106 of file ImportFilter.h.

References forceBinary, status, and userFlags.

Referenced by CImportFilterDlg::OnEditentry.

00107     {
00108         status &= ~(int)userFlags;
00109         status |= (int)forceBinary;
00110     }

void ReportConflict::ForceNoKeywords ( void ) [inline]

Definition at line 126 of file ImportFilter.h.

References forceNoKeywords, status, and userFlags.

Referenced by CImportFilterDlg::OnEditentry.

00127     {
00128         status &= ~(int)userFlags;
00129         status |= (int)forceNoKeywords;
00130     }

void ReportConflict::ForceText ( void ) [inline]

Definition at line 111 of file ImportFilter.h.

References forceText, status, and userFlags.

Referenced by CImportFilterDlg::OnEditentry.

00112     {
00113         status &= ~(int)userFlags;
00114         status |= (int)forceText;
00115     }

void ReportConflict::ForceUnicode ( void ) [inline]

Definition at line 116 of file ImportFilter.h.

References forceUnicode, status, and userFlags.

Referenced by CImportFilterDlg::OnEditentry.

00117     {
00118         status &= ~(int)userFlags;
00119         status |= (int)forceUnicode;
00120     }

int ReportConflict::GetMacCreator ( void ) const [inline]

Definition at line 101 of file ImportFilter.h.

References fcreator.

Referenced by list_add_type.

00102     {
00103         return fcreator;
00104     }

int ReportConflict::GetMacType ( void ) const [inline]

Definition at line 97 of file ImportFilter.h.

References ftype.

Referenced by list_add_type.

00098     {
00099         return ftype;
00100     }

const char* ReportConflict::GetPattern ( void ) const [inline]

Definition at line 93 of file ImportFilter.h.

References pattern.

Referenced by CvsCmdImportModule, and CImportFilterDlg::OnInitDialog.

00094     {
00095         return pattern;
00096     }

bool ReportConflict::HasConflict ( void ) const [inline]

Definition at line 73 of file ImportFilter.h.

References hasConflict, and status.

Referenced by list_add_type, CImportFilterDlg::OnInitDialog, PrintOut, SetConflict, and SetTypeCreatorConflict.

00074     {
00075         return (status & hasConflict) != 0;
00076     }

bool ReportConflict::HasForceBinary ( void ) const [inline]

Definition at line 131 of file ImportFilter.h.

References forceBinary, and status.

Referenced by CImportEntry::CImportEntry, and CvsCmdImportModule.

00132     {
00133         return (status & forceBinary) != 0;
00134     }

bool ReportConflict::HasForceNoKeywords ( void ) const [inline]

Definition at line 147 of file ImportFilter.h.

References forceNoKeywords, and status.

Referenced by CImportEntry::CImportEntry, and CvsCmdImportModule.

00148     {
00149         return (status & forceNoKeywords) != 0;
00150     }

bool ReportConflict::HasForceText ( void ) const [inline]

Definition at line 135 of file ImportFilter.h.

References forceText, and status.

Referenced by CImportEntry::CImportEntry, and CvsCmdImportModule.

00136     {
00137         return (status & forceText) != 0;
00138     }

bool ReportConflict::HasForceUnicode ( void ) const [inline]

Definition at line 139 of file ImportFilter.h.

References forceUnicode, and status.

Referenced by CImportEntry::CImportEntry, and CvsCmdImportModule.

00140     {
00141         return (status & forceUnicode) != 0;
00142     }

bool ReportConflict::HasIgnore ( void ) const [inline]

Definition at line 143 of file ImportFilter.h.

References hasIgnore, and status.

Referenced by CImportEntry::CImportEntry, CvsCmdImportModule, and CImportFilterDlg::OnInitDialog.

00144     {
00145         return (status & hasIgnore) != 0;
00146     }

bool ReportConflict::HasTypeCreatorConflict ( void ) const [inline]

Definition at line 77 of file ImportFilter.h.

References hasTypeCreatorConflict, and status.

Referenced by PrintOut, and SetTypeCreatorConflict.

00078     {
00079         return (status & hasTypeCreatorConflict) != 0;
00080     }

void ReportConflict::Ignore ( void ) [inline]

Definition at line 121 of file ImportFilter.h.

References hasIgnore, status, and userFlags.

Referenced by list_add_type, and CImportFilterDlg::OnEditentry.

00122     {
00123         status &= ~(int)userFlags;
00124         status |= (int)hasIgnore;
00125     }

bool ReportConflict::IsBinary ( void ) const [inline]

Definition at line 81 of file ImportFilter.h.

References isBinary, and status.

Referenced by CvsCmdImportModule, list_add_type, CImportFilterDlg::OnEditentry, and CImportFilterDlg::OnInitDialog.

00082     {
00083         return (status & isBinary) != 0;
00084     }

bool ReportConflict::IsExtension ( void ) const [inline]

Definition at line 89 of file ImportFilter.h.

References hasExtension, and status.

Referenced by CvsCmdImportModule, and CImportFilterDlg::OnInitDialog.

00090     {
00091         return (status & hasExtension) != 0;
00092     }

bool ReportConflict::IsUnicode ( void ) const [inline]

Definition at line 85 of file ImportFilter.h.

References isUnicode, and status.

Referenced by CvsCmdImportModule, list_add_type, and CImportFilterDlg::OnInitDialog.

00086     {
00087         return (status & isUnicode) != 0;
00088     }

bool ReportConflict::Match ( const char * pat )

Definition at line 163 of file ImportFilter.cpp.

References UStr::empty, hasExtension, UStr::length, pattern, status, and stricmp.

Referenced by list_add_type.

00164 {
00165     if(pat == 0L || pattern.empty())
00166         return false;
00167
00168     int len = strlen(pat);
00169     int patlen = pattern.length();
00170
00171     if(status & hasExtension)
00172     {
00173         if(len < patlen)
00174             return false;
00175         // since it is the server who compares against the pattern,
00176         // that might be a case compare
00177 #if 0 //def WIN32
00178         return stricmp(pattern, pat + len - patlen) == 0;
00179 #else /* !WIN32 */
00180         return strcmp(pattern, pat + len - patlen) == 0;
00181 #endif /* !WIN32 */
00182     }
00183
00184 #if 0 //def WIN32
00185     return stricmp(pattern, pat) == 0;
00186 #else /* !WIN32 */
00187     return strcmp(pattern, pat) == 0;
00188 #endif /* !WIN32 */
00189 }

void ReportConflict::PrintOut ( UStr & out ) const

Definition at line 83 of file ImportFilter.cpp.

References CStr, UStr::empty, HasConflict, HasTypeCreatorConflict, lf, sample1, and sample2.

Referenced by CImportEntry::CImportEntry.

00084 {
00085     out = "";
00086     if(HasConflict())
00087     {
00088         out << "Text/Binary conflict, at least these files :";
00089         out << lf;
00090         if(!sample1.empty() && !sample2.empty())
00091         {
00092             out << "    ";
00093             out << sample1;
00094             out << " and ";
00095             out << sample2;
00096             out << lf;
00097         }
00098     }
00099     else if(HasTypeCreatorConflict())
00100     {
00101         out << "Mac signature mismatch for this type, at least these files :";
00102         out << lf;
00103         if(!sample1.empty() && !sample2.empty())
00104         {
00105             out << "    ";
00106             out << sample1;
00107             out << " and ";
00108             out << sample2;
00109             out << lf;
00110         }
00111     }
00112 }

void ReportConflict::SetConflict ( const char * sample )

Definition at line 191 of file ImportFilter.cpp.

References hasConflict, HasConflict, sample2, and status.

Referenced by list_add_type.

00192 {
00193     // one is enough !
00194     if(HasConflict())
00195         return;
00196
00197     sample2 = sample;
00198     status |= hasConflict;
00199 }

void ReportConflict::SetTypeCreatorConflict ( const char * sample )

Definition at line 201 of file ImportFilter.cpp.

References HasConflict, hasTypeCreatorConflict, HasTypeCreatorConflict, sample2, and status.

Referenced by list_add_type.

00202 {
00203     // one is enough !
00204     if(HasTypeCreatorConflict() || HasConflict())
00205         return;
00206
00207     sample2 = sample;
00208     status |= hasTypeCreatorConflict;
00209 }

Member Data Documentation

int ReportConflict::fcreator [protected]

Definition at line 171 of file ImportFilter.h.

Referenced by GetMacCreator, and ReportConflict.

int ReportConflict::ftype [protected]

Definition at line 171 of file ImportFilter.h.

Referenced by GetMacType, and ReportConflict.

ReportConflict* ReportConflict::next

Definition at line 50 of file ImportFilter.h.

Referenced by CvsCmdImportModule, free_list_types, list_add_type, CImportFilterDlg::OnEditentry, CImportFilterDlg::OnInitDialog, and ReportConflict.

UStr ReportConflict::pattern [protected]

Definition at line 164 of file ImportFilter.h.

Referenced by AddPattern, GetPattern, and Match.

UStr ReportConflict::sample1 [protected]

Definition at line 166 of file ImportFilter.h.

Referenced by AddPattern, and PrintOut.

UStr ReportConflict::sample2 [protected]

Definition at line 168 of file ImportFilter.h.

Referenced by PrintOut, SetConflict, and SetTypeCreatorConflict.

int ReportConflict::status [protected]

Definition at line 162 of file ImportFilter.h.

Referenced by AddPattern, DisableUserSettings, ForceBinary, ForceNoKeywords, ForceText, ForceUnicode, HasConflict, HasForceBinary, HasForceNoKeywords, HasForceText, HasForceUnicode, HasIgnore, HasTypeCreatorConflict, Ignore, IsBinary, IsExtension, IsUnicode, Match, ReportConflict, SetConflict, and SetTypeCreatorConflict.

The documentation for this class was generated from the following files:
  • common/ImportFilter.h
  • common/ImportFilter.cpp
Generated on Sun Feb 24 01:27:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


ReportWarning Class Reference

#include <ImportFilter.h>

Collaboration diagram for ReportWarning:

[legend]
List of all members.

Public Methods

ReportWarning (kTextBinTYPE akind)
~ReportWarning ()
void | AddWarning (const char *sample)
kTextBinTYPE | Kind (void) const
void | PrintOut (UStr &out) const

Public Attributes

ReportWarning * | next

Static Public Attributes

const size_t | maxWarnings = 10

Protected Attributes

kTextBinTYPE kind
std::vector< UStr > samples
bool | tooMuchWarnings

Constructor & Destructor Documentation

ReportWarning::ReportWarning ( kTextBinTYPE akind )

Definition at line 213 of file ImportFilter.cpp.

References kind, kTextBinTYPE, next, and tooMuchWarnings.

00214 {
00215     kind = akind;
00216     next = 0L;
00217     tooMuchWarnings = false;
00218 }

ReportWarning::~ReportWarning ( )

Definition at line 220 of file ImportFilter.cpp.

00221 {
00222 }

Member Function Documentation

void ReportWarning::AddWarning ( const char * sample )

Definition at line 348 of file ImportFilter.cpp.

References CStr, maxWarnings, samples, and tooMuchWarnings.

Referenced by list_add_warning.

00349 {
00350     // it's enough !
00351     if(samples.size() >= maxWarnings)
00352     {
00353         tooMuchWarnings = true;
00354         return;
00355     }
00356
00357     samples.push_back(CStr(sample));
00358 }

kTextBinTYPE ReportWarning::Kind ( void ) const [inline]

Definition at line 188 of file ImportFilter.h.

References kind, and kTextBinTYPE.

Referenced by list_add_warning, and CImportFilterDlg::OnInitDialog.

00188 {return kind;}

void ReportWarning::PrintOut ( UStr & out ) const

Definition at line 224 of file ImportFilter.cpp.

References CStr, kBinIsText, kBinIsUnicode, kBinWrongSig, kFileInvalidName, kFileIsAlias, kFileIsOK, kFileMissing, kTextEscapeChar, kTextIsBinary, kTextIsUnicode, kTextWrongLF, kTextWrongSig, lf, and samples.

Referenced by CImportWarning::CImportWarning.

00225 {
00226     out = "";
00227
00228     if(samples.size() == 0)
00229         return;
00230
00231     out = "Warning : ";
00232     switch(kind)
00233     {
00234     default:
00235     case kFileIsOK:
00236         out << "Files are OK";
00237         break;
00238     case kFileMissing:
00239         out << "Files are missing or unreadable";
00240         break;
00241     case kFileIsAlias:
00242         out << "Files are aliases";
00243         break;
00244     case kFileInvalidName:
00245         out << "Files have invalid name";
00246         break;
00247     case kTextWrongLF:
00248         out << "Files have the wrong line feed";
00249         break;
00250     case kTextIsBinary:
00251         out << "Files are binary";
00252         break;
00253     case kTextEscapeChar:
00254         out << "Files have escape characters in it";
00255         break;
00256     case kTextWrongSig:
00257         out << "Text files have the wrong signature";
00258         break;
00259     case kBinIsText:
00260         out << "Files are text, should be binary";
00261         break;
00262     case kBinWrongSig:
00263         out << "Binary files have the wrong signature";
00264         break;
00265     case kTextIsUnicode:
00266         out << "Files are unicode, should be text";
00267         break;
00268     case kBinIsUnicode:
00269         out << "Files are unicode, should be binary";
00270         break;
00271     }
00272     out << lf;
00273
00274     std::vector<CStr>::const_iterator i;
00275     for(i = samples.begin(); i != samples.end(); ++i)
00276     {
00277         out << "    ";
00278         out << *i;
00279         out << lf;
00280     }
00281
00282     if(tooMuchWarnings)
00283     {
00284         out << "    More files follow";
00285         out << lf;
00286     }
00287 }

Member Data Documentation

kTextBinTYPE ReportWarning::kind [protected]

Definition at line 196 of file ImportFilter.h.

Referenced by Kind, and ReportWarning.

const size_t ReportWarning::maxWarnings = 10 [static]

Definition at line 211 of file ImportFilter.cpp.

Referenced by AddWarning.

ReportWarning* ReportWarning::next

Definition at line 184 of file ImportFilter.h.

Referenced by free_list_types, list_add_warning, CImportFilterDlg::OnEditentry, CImportFilterDlg::OnInitDialog, and ReportWarning.

std::vector< UStr > ReportWarning::samples [protected]

Definition at line 198 of file ImportFilter.h.

Referenced by AddWarning, and PrintOut.

bool ReportWarning::tooMuchWarnings [protected]

Definition at line 199 of file ImportFilter.h.

Referenced by AddWarning, and ReportWarning.

The documentation for this class was generated from the following files:
  • common/ImportFilter.h
  • common/ImportFilter.cpp
Generated on Sun Feb 24 01:27:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CRevisionConsole Class Reference

Inheritance diagram for CRevisionConsole:

[legend]
Collaboration diagram for CRevisionConsole:

[legend]
List of all members.

Public Methods

CRevisionConsole ()
~CRevisionConsole ()
BOOL | init (LPCTSTR path, LPCTSTR fname)
virtual long | cvs_out (char *txt, long len)
virtual long | cvs_err (char *txt, long len)

Protected Attributes

FILE * | fOut

Constructor & Destructor Documentation

CRevisionConsole::CRevisionConsole ( ) [inline]

Definition at line 1513 of file GraphView.cpp.

References fOut, and NULL.

01514     : fOut(NULL)
01515     {}

CRevisionConsole::~CRevisionConsole ( ) [inline]

Definition at line 1517 of file GraphView.cpp.

References fOut.

01518     {
01519         if (fOut)
01520         {
01521             fclose(fOut);
01522         }
01523     }

Member Function Documentation

virtual long CRevisionConsole::cvs_err | ( | char * | txt,
 |  | long | len
 | ) | [inline, virtual]

Implements CCvsConsole.

Definition at line 1539 of file GraphView.cpp.

References cvs_errstr.

01540     {
01541         cvs_errstr(txt, len);
01542         return len;
01543     }

virtual long CRevisionConsole::cvs_out | ( | char * | txt,
 |  | long | len
 | ) | [inline, virtual]

Implements CCvsConsole.

Definition at line 1533 of file GraphView.cpp.

References fOut.

01534     {
01535         fwrite(txt, sizeof(char), len, fOut);
01536         return len;
01537     }

BOOL CRevisionConsole::init | ( | LPCTSTR | path,
 |  | LPCTSTR | fname
 | ) | [inline]

Definition at line 1525 of file GraphView.cpp.

References fOut, and NULL.

Referenced by CGraphView::OnViewRetrieve.

01526     {
01527         TCHAR buf[_MAX_PATH];
01528         _tmakepath(buf, NULL, path, fname, NULL);
01529         fOut = fopen(buf, "w+");
01530         return fOut != NULL;
01531     }

Member Data Documentation

FILE* CRevisionConsole::fOut [protected]

Definition at line 1546 of file GraphView.cpp.

Referenced by CRevisionConsole, cvs_out, init, and ~CRevisionConsole.

The documentation for this class was generated from the following file:
  • WinCvs/GraphView.cpp
Generated on Sun Feb 24 01:27:40 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CRichEditView Class Reference

Inheritance diagram for CRichEditView:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/wincvsView.h
Generated on Sun Feb 24 01:27:40 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CRtag_MAIN Class Reference

#include <RtagDlg.h>

Inheritance diagram for CRtag_MAIN:

[legend]
Collaboration diagram for CRtag_MAIN:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_RTAG_MAIN }

Public Methods

CRtag_MAIN (kRtagDlgType type, const char *sLastModule, const char *sLastTag, bool noRecurs, bool lookAttic, bool overwriteExist=false)
CRtag_MAIN ()
~CRtag_MAIN ()

Public Attributes

CButton m_overwriteExistingCheck
CStatic m_moduleDescStatic
CStatic m_tagDescStatic
CButton m_grpBox
CSmartComboBox m_moduleCombo
CSmartComboBox m_tagCombo
CString | m_tagName
CString | m_moduleName
BOOL | m_noRecurs
BOOL | m_lookAttic
BOOL | m_overwriteExisting

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
virtual BOOL | OnInitDialog ()

Private Attributes

kRtagDlgType m_type

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 74 of file RtagDlg.h.

00074 { IDD = IDD_RTAG_MAIN };

Constructor & Destructor Documentation

CRtag_MAIN::CRtag_MAIN | ( | kRtagDlgType | type,
 |  | const char * | sLastModule,
 |  | const char * | sLastTag,
 |  | bool | noRecurs,
 |  | bool | lookAttic,
 |  | bool | overwriteExist = false
 | ) |

Definition at line 67 of file RtagDlg.cpp.

References kRtagDlgType, m_lookAttic, m_moduleCombo, m_moduleName, m_noRecurs, m_overwriteExisting, m_tagCombo, m_tagName, m_type, and USmartCombo::SetItems.

00070         : CPropertyPage(CRtag_MAIN::IDD)
00071 {
00072     m_type = type;
00073
00074     m_tagName = sLastTag;
00075     m_moduleName = sLastModule;
00076     m_noRecurs = noRecurs;
00077     m_lookAttic = lookAttic;
00078     m_overwriteExisting = overwriteExist;
00079
00080     m_moduleCombo.SetItems(&gOldModules);
00081     m_tagCombo.SetItems(&gRevNames);
00082 }

CRtag_MAIN::CRtag_MAIN ( )

Definition at line 84 of file RtagDlg.cpp.

References FALSE, m_lookAttic, m_moduleName, m_noRecurs, m_overwriteExisting, and m_tagName.

00084                        : CPropertyPage(CRtag_MAIN::IDD)
00085 {
00086     //{{AFX_DATA_INIT(CRtag_MAIN)
00087     m_tagName = _T("");
00088     m_moduleName = _T("");
00089     m_noRecurs = FALSE;
00090     m_lookAttic = FALSE;
00091     m_overwriteExisting = FALSE;
00092     //}}AFX_DATA_INIT
00093 }

CRtag_MAIN::~CRtag_MAIN ( )

Definition at line 95 of file RtagDlg.cpp.

00096 {
00097 }

Member Function Documentation

void CRtag_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 99 of file RtagDlg.cpp.

References DDV_MinChars, DDX_ComboMString, IDC_ATTIC, IDC_GRPBOX_TEXT, IDC_MODNAME, IDC_MODULEDESC_TEXT, IDC_NORECURS, IDC_OVERWRITE, IDC_TAGDESC_TEXT, IDC_TAGNAME, m_grpBox, m_lookAttic, m_moduleCombo, m_moduleDescStatic, m_moduleName, m_noRecurs, m_overwriteExisting, m_overwriteExistingCheck, m_tagCombo, m_tagDescStatic, and m_tagName.

00100 {
00101     CPropertyPage::DoDataExchange(pDX);
00102     //{{AFX_DATA_MAP(CRtag_MAIN)
00103     DDX_Control(pDX, IDC_OVERWRITE, m_overwriteExistingCheck);
00104     DDX_Control(pDX, IDC_MODULEDESC_TEXT, m_moduleDescStatic);
00105     DDX_Control(pDX, IDC_TAGDESC_TEXT, m_tagDescStatic);
00106     DDX_Control(pDX, IDC_GRPBOX_TEXT, m_grpBox);
00107     DDX_Control(pDX, IDC_MODNAME, m_moduleCombo);
00108     DDX_Control(pDX, IDC_TAGNAME, m_tagCombo);
00109     DDX_CBString(pDX, IDC_TAGNAME, m_tagName);
00110     DDX_CBString(pDX, IDC_MODNAME, m_moduleName);
00111     DDX_Check(pDX, IDC_NORECURS, m_noRecurs);
00112     DDX_Check(pDX, IDC_ATTIC, m_lookAttic);
00113     DDX_Check(pDX, IDC_OVERWRITE, m_overwriteExisting);
00114     //}}AFX_DATA_MAP
00115
00116     DDV_MinChars(pDX, m_moduleName, 1);
00117     DDV_MinChars(pDX, m_tagName, 1);
00118
00119     DDX_ComboMString(pDX, IDC_MODNAME, m_moduleCombo);
00120     DDX_ComboMString(pDX, IDC_TAGNAME, m_tagCombo);
00121 }

BOOL CRtag_MAIN::OnInitDialog ( ) [protected, virtual]

Definition at line 132 of file RtagDlg.cpp.

References ASSERT, FALSE, kRtagAdd, kRtagDelete, kRtagFork, m_grpBox, m_moduleDescStatic, m_overwriteExistingCheck, m_tagDescStatic, and TRUE.

00133 {
00134     CPropertyPage::OnInitDialog();
00135
00136     // set the type-specific data
00137     CString strGrpBox;
00138     CString strTagDesc;
00139     CString strmoduleDesc;
00140
00141     switch( m_type )
00142     {
00143     case kRtagAdd:
00144         strGrpBox = "Enter the tag name and which module to tag:";
00145         strTagDesc = "New &tag name:";
00146         strmoduleDesc = "&Module to tag:";
00147         break;
00148     case kRtagDelete:
00149         strGrpBox = "Enter the tag name to delete and which module to untag:";
00150         strTagDesc = "Delete &tag name:";
00151         strmoduleDesc = "&Module to untag:";
00152
00153         m_overwriteExistingCheck.ShowWindow(SW_HIDE);
00154         break;
00155     case kRtagFork:
00156         strGrpBox = "Enter the branch name and which module to fork:";
00157         strTagDesc = "New &branch name:";
00158         strmoduleDesc = "&Module to fork:";
00159
00160         m_overwriteExistingCheck.ShowWindow(SW_HIDE);
00161         break;
00162     default:
00163         ASSERT(FALSE); //unknown type
00164     }
00165
00166     m_grpBox.SetWindowText(strGrpBox);
00167     m_tagDescStatic.SetWindowText(strTagDesc);
00168     m_moduleDescStatic.SetWindowText(strmoduleDesc);;
00169
00170     return TRUE;  // return TRUE unless you set the focus to a control
00171                   // EXCEPTION: OCX Property Pages should return FALSE
00172 }

Member Data Documentation

CButton CRtag_MAIN::m_grpBox

Definition at line 78 of file RtagDlg.h.

Referenced by DoDataExchange, and OnInitDialog.

BOOL CRtag_MAIN::m_lookAttic

Definition at line 84 of file RtagDlg.h.

Referenced by CompatRtagBranch, CompatRtagCreate, CompatRtagDelete, CRtag_MAIN, and DoDataExchange.

CSmartComboBox CRtag_MAIN::m_moduleCombo

Definition at line 79 of file RtagDlg.h.

Referenced by CRtag_MAIN, and DoDataExchange.

CStatic CRtag_MAIN::m_moduleDescStatic

Definition at line 76 of file RtagDlg.h.

Referenced by DoDataExchange, and OnInitDialog.

CString CRtag_MAIN::m_moduleName

Definition at line 82 of file RtagDlg.h.

Referenced by CompatRtagBranch, CompatRtagCreate, CompatRtagDelete, CRtag_MAIN, and DoDataExchange.

BOOL CRtag_MAIN::m_noRecurs

Definition at line 83 of file RtagDlg.h.

Referenced by CompatRtagBranch, CompatRtagCreate, CompatRtagDelete, CRtag_MAIN, and DoDataExchange.

BOOL CRtag_MAIN::m_overwriteExisting

Definition at line 85 of file RtagDlg.h.

Referenced by CompatRtagCreate, CRtag_MAIN, and DoDataExchange.

CButton CRtag_MAIN::m_overwriteExistingCheck

Definition at line 75 of file RtagDlg.h.

Referenced by DoDataExchange, and OnInitDialog.

CSmartComboBox CRtag_MAIN::m_tagCombo

Definition at line 80 of file RtagDlg.h.

Referenced by CRtag_MAIN, and DoDataExchange.

CStatic CRtag_MAIN::m_tagDescStatic

Definition at line 77 of file RtagDlg.h.

Referenced by DoDataExchange, and OnInitDialog.

CString CRtag_MAIN::m_tagName

Definition at line 81 of file RtagDlg.h.

Referenced by CompatRtagBranch, CompatRtagCreate, CompatRtagDelete, CRtag_MAIN, and DoDataExchange.

kRtagDlgType CRtag_MAIN::m_type [private]

Definition at line 104 of file RtagDlg.h.

Referenced by CRtag_MAIN.

The documentation for this class was generated from the following files:
  • common/RtagDlg.h
  • common/RtagDlg.cpp
Generated on Sun Feb 24 01:27:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CRtag_OPTIONS Class Reference

#include <RtagDlg.h>

Inheritance diagram for CRtag_OPTIONS:

[legend]
Collaboration diagram for CRtag_OPTIONS:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_RTAG_OPTIONS }

Public Methods

CRtag_OPTIONS (kRtagDlgType type, bool hasDate, bool hasRev, const char *sLastDate, const char *sLastRev, bool useMostRecent)
CRtag_OPTIONS ()
~CRtag_OPTIONS ()

Public Attributes

CSmartComboBox m_revCombo
CSmartComboBox m_dateCombo
CButton m_grpBox
CString | m_date
CString | m_rev
BOOL | m_hasDate
BOOL | m_hasRev
BOOL | m_useMostRecent

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnDate ()
afx_msg void | OnRev ()
virtual BOOL | OnInitDialog ()

Private Attributes

kRtagDlgType m_type

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 125 of file RtagDlg.h.

00125 { IDD = IDD_RTAG_OPTIONS };

Constructor & Destructor Documentation

CRtag_OPTIONS::CRtag_OPTIONS | ( | kRtagDlgType | type,
 |  | bool | hasDate,
 |  | bool | hasRev,
 |  | const char * | sLastDate,
 |  | const char * | sLastRev,
 |  | bool | useMostRecent
 | ) |

Definition at line 179 of file RtagDlg.cpp.

References kRtagDlgType, m_date, m_dateCombo, m_hasDate, m_hasRev, m_rev, m_revCombo, m_type, m_useMostRecent, and USmartCombo::SetItems.

00182                             : CPropertyPage(CRtag_OPTIONS::IDD)
00183 {
00184     m_type = type;
00185
00186     m_date = sLastDate;
00187     m_rev = sLastRev;
00188     m_hasDate = hasDate;
00189     m_hasRev = hasRev;
00190     m_useMostRecent = useMostRecent;
00191
00192     m_revCombo.SetItems(&gRevNames);
00193     m_dateCombo.SetItems(&gDateNames);
00194 }

CRtag_OPTIONS::CRtag_OPTIONS ( )

Definition at line 196 of file RtagDlg.cpp.

References FALSE, m_date, m_hasDate, m_hasRev, m_rev, and m_useMostRecent.

00196                              : CPropertyPage(CRtag_OPTIONS::IDD)
00197 {
00198     //{{AFX_DATA_INIT(CRtag_OPTIONS)
00199     m_date = _T("");
00200     m_rev = _T("");
00201     m_hasDate = FALSE;
00202     m_hasRev = FALSE;
00203     m_useMostRecent = FALSE;
00204     //}}AFX_DATA_INIT
00205 }

CRtag_OPTIONS::~CRtag_OPTIONS ( )

Definition at line 207 of file RtagDlg.cpp.

00208 {
00209 }

Member Function Documentation

void CRtag_OPTIONS::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 211 of file RtagDlg.cpp.

References DDV_MinChars, DDX_ComboMString, IDC_COMBODATE, IDC_COMBOREV, IDC_DATE, IDC_GRPBOX_TEXT, IDC_MATCH, IDC_REV, m_date, m_dateCombo, m_grpBox, m_hasDate, m_hasRev, m_rev, m_revCombo, m_useMostRecent, OnDate, and OnRev.

00212 {
00213     CPropertyPage::DoDataExchange(pDX);
00214     //{{AFX_DATA_MAP(CRtag_OPTIONS)
00215     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00216     DDX_Control(pDX, IDC_COMBODATE, m_dateCombo);
00217     DDX_Control(pDX, IDC_GRPBOX_TEXT, m_grpBox);
00218     DDX_CBString(pDX, IDC_COMBODATE, m_date);
00219     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00220     DDX_Check(pDX, IDC_DATE, m_hasDate);
00221     DDX_Check(pDX, IDC_REV, m_hasRev);
00222     DDX_Check(pDX, IDC_MATCH, m_useMostRecent);
00223     //}}AFX_DATA_MAP
00224
00225     if( m_hasRev )
00226     {
00227         DDV_MinChars(pDX, m_rev, 1);
00228     }
00229
00230     if( m_hasDate )
00231     {
00232         DDV_MinChars(pDX, m_date, 1);
00233     }
00234
00235     if( !pDX->m_bSaveAndValidate )
00236     {
00237         OnDate();
00238         OnRev();
00239     }
00240
00241     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00242     DDX_ComboMString(pDX, IDC_COMBODATE, m_dateCombo);
00243 }

void CRtag_OPTIONS::OnDate ( ) [protected]

Definition at line 256 of file RtagDlg.cpp.

References IDC_COMBODATE, and IDC_DATE.

Referenced by DoDataExchange.

00257 {
00258     CButton* but = (CButton *)GetDlgItem(IDC_DATE);
00259     CWnd* wnd = GetDlgItem(IDC_COMBODATE);
00260     wnd->EnableWindow(but->GetCheck() == 1);
00261 }

BOOL CRtag_OPTIONS::OnInitDialog ( ) [protected, virtual]

Definition at line 270 of file RtagDlg.cpp.

References ASSERT, FALSE, kRtagAdd, kRtagDelete, kRtagFork, m_grpBox, and TRUE.

00271 {
00272     CPropertyPage::OnInitDialog();
00273
00274     // set the type-specific data
00275     CString strGrpBox;
00276
00277     switch( m_type )
00278     {
00279     case kRtagAdd:
00280         strGrpBox = "Optionally use this revision/tag/date to create the tag:";
00281         break;
00282     case kRtagDelete:
00283         ASSERT(FALSE); //delete tag has no options
00284         break;
00285     case kRtagFork:
00286         strGrpBox = "Optionally use this revision/tag/date to create the branch:";
00287         break;
00288     default:
00289         ASSERT(FALSE); //unknown type
00290     }
00291
00292     m_grpBox.SetWindowText(strGrpBox);
00293
00294     return TRUE;  // return TRUE unless you set the focus to a control
00295                   // EXCEPTION: OCX Property Pages should return FALSE
00296 }

void CRtag_OPTIONS::OnRev ( ) [protected]

Definition at line 263 of file RtagDlg.cpp.

References IDC_COMBOREV, and IDC_REV.

Referenced by DoDataExchange.

00264 {
00265     CButton* but = (CButton *)GetDlgItem(IDC_REV);
00266     CWnd* wnd = GetDlgItem(IDC_COMBOREV);
00267     wnd->EnableWindow(but->GetCheck() == 1);
00268 }

Member Data Documentation

CString CRtag_OPTIONS::m_date

Definition at line 129 of file RtagDlg.h.

Referenced by CompatRtagBranch, CompatRtagCreate, CRtag_OPTIONS, and DoDataExchange.

CSmartComboBox CRtag_OPTIONS::m_dateCombo

Definition at line 127 of file RtagDlg.h.

Referenced by CRtag_OPTIONS, and DoDataExchange.

CButton CRtag_OPTIONS::m_grpBox

Definition at line 128 of file RtagDlg.h.

Referenced by DoDataExchange, and OnInitDialog.

BOOL CRtag_OPTIONS::m_hasDate

Definition at line 131 of file RtagDlg.h.

Referenced by CompatRtagBranch, CompatRtagCreate, CRtag_OPTIONS, and DoDataExchange.

BOOL CRtag_OPTIONS::m_hasRev

Definition at line 132 of file RtagDlg.h.

Referenced by CompatRtagBranch, CompatRtagCreate, CRtag_OPTIONS, and DoDataExchange.

CString CRtag_OPTIONS::m_rev

Definition at line 130 of file RtagDlg.h.

Referenced by CompatRtagBranch, CompatRtagCreate, CRtag_OPTIONS, and DoDataExchange.

CSmartComboBox CRtag_OPTIONS::m_revCombo

Definition at line 126 of file RtagDlg.h.

Referenced by CRtag_OPTIONS, and DoDataExchange.

kRtagDlgType CRtag_OPTIONS::m_type [private]

Definition at line 154 of file RtagDlg.h.

Referenced by CRtag_OPTIONS.

BOOL CRtag_OPTIONS::m_useMostRecent

Definition at line 133 of file RtagDlg.h.

Referenced by CompatRtagBranch, CompatRtagCreate, CRtag_OPTIONS, and DoDataExchange.

The documentation for this class was generated from the following files:
  • common/RtagDlg.h
  • common/RtagDlg.cpp
Generated on Sun Feb 24 01:27:42 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


URuntimeClass Class Reference

#include <uobject.h>

Collaboration diagram for URuntimeClass:

[legend]
List of all members.

Public Methods

URuntimeClass (const char *lpszClassName, int nObjectSize, UObject *(*pfnCreateObject)(), const URuntimeClass *(*pfnGetBaseClass)())
~URuntimeClass ()
UObject * CreateObject ()
bool | IsDerivedFrom (const URuntimeClass *pBaseClass) const

Public Attributes

const char * | m_lpszClassName
int | m_nObjectSize
UObject *(* m_pfnCreateObject )()
const URuntimeClass *(* | m_pfnGetBaseClass )()
URuntimeClass * | m_pNextClass

Static Public Attributes

URuntimeClass * | sAllURuntimeClass = 0L

Constructor & Destructor Documentation

URuntimeClass::URuntimeClass | ( | const char * | lpszClassName,
 |  | int | nObjectSize,
 |  | UObject *(* | pfnCreateObject)(),
 |  | const URuntimeClass *(* | pfnGetBaseClass)()
 | ) |

Definition at line 65 of file uobject.cpp.

References m_lpszClassName, m_nObjectSize, m_pfnCreateObject, m_pfnGetBaseClass, m_pNextClass, and sAllURuntimeClass.

00067 {
00068     m_lpszClassName = lpszClassName;
00069     m_nObjectSize = nObjectSize;
00070     m_pfnCreateObject = pfnCreateObject;
00071     m_pfnGetBaseClass = pfnGetBaseClass;
00072     m_pNextClass = sAllURuntimeClass;
00073
00074     sAllURuntimeClass = this;
00075 }

URuntimeClass::~URuntimeClass ( )

Definition at line 77 of file uobject.cpp.

References m_pNextClass, and sAllURuntimeClass.

00078 {
00079     URuntimeClass *next = sAllURuntimeClass;
00080     URuntimeClass *prev = 0L;
00081     while(next != 0L)
00082     {
00083         if(next == this)
00084         {
00085             if(prev == 0L)
00086                 sAllURuntimeClass = m_pNextClass;
00087             else
00088                 prev->m_pNextClass = m_pNextClass;
00089             break;
00090         }
00091
00092         prev = next;
00093         next = next->m_pNextClass;
00094     }
00095 }

Member Function Documentation

UObject * URuntimeClass::CreateObject ( )

Definition at line 97 of file uobject.cpp.

References m_pfnCreateObject.

Referenced by UObject::CreateObject.

00098 {
00099     if (m_pfnCreateObject == 0L)
00100     {
00101         return 0L;
00102     }
00103
00104     UObject* pObject = 0L;
00105     try
00106     {
00107         pObject = (*m_pfnCreateObject)();
00108     }
00109     catch(...)
00110     {
00111     }
00112
00113     return pObject;
00114 }

bool URuntimeClass::IsDerivedFrom ( const URuntimeClass * pBaseClass ) const

Definition at line 116 of file uobject.cpp.

References m_pfnGetBaseClass.

Referenced by UObject::IsKindOf.

00117 {
00118     // simple SI case
00119     const URuntimeClass* pClassThis = this;
00120     while (pClassThis != 0L)
00121     {
00122         if (pClassThis == pBaseClass)
00123             return true;
00124         pClassThis = (*pClassThis->m_pfnGetBaseClass)();
00125     }
00126     return false;       // walked to the top, no match
00127 }

Member Data Documentation

const char* URuntimeClass::m_lpszClassName

Definition at line 38 of file uobject.h.

Referenced by UObject::CreateObject, and URuntimeClass.

int URuntimeClass::m_nObjectSize

Definition at line 39 of file uobject.h.

Referenced by URuntimeClass.

UObject*(* URuntimeClass::m_pfnCreateObject)()

Referenced by CreateObject, and URuntimeClass.

const URuntimeClass*(* URuntimeClass::m_pfnGetBaseClass)()

Referenced by IsDerivedFrom, and URuntimeClass.

URuntimeClass* URuntimeClass::m_pNextClass

Definition at line 48 of file uobject.h.

Referenced by UObject::CreateObject, URuntimeClass, and ~URuntimeClass.

URuntimeClass * URuntimeClass::sAllURuntimeClass = 0L [static]

Definition at line 31 of file uobject.cpp.

Referenced by UObject::CreateObject, URuntimeClass, and ~URuntimeClass.

The documentation for this class was generated from the following files:
  • rf/uobject.h
  • rf/uobject.cpp
Generated on Sun Feb 24 01:27:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


USaveSettings Class Reference

Inheritance diagram for USaveSettings:

[legend]
Collaboration diagram for USaveSettings:

[legend]
List of all members.

Public Types

enum {
kSettingName = EV_COMMAND_START,
kCopyPath,
kCopyFrom,
kCopyList
}

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
USaveSettings (const char *path, const char *oldname)
virtual | ~USaveSettings ()
virtual void | DoDataExchange (bool fill)
while modaling, allows to fill/read the dialog content.
  • fill says if it expects to fill or read the dialog content.
 More...

Static Public Methods

const URuntimeClass * | rtUSaveSettings (void)

Public Attributes

UStr m_settingName
UStr m_copyFromPath

Protected Methods

int | OnCopyFrom (void)
virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Protected Attributes

UStr m_path
UStr m_oldname
std::map< UStr, UStr > | m_list

Static Protected Attributes

const URuntimeClass | classUSaveSettings
const UMSGMAP | messageMap = { UWidget ::GetThisMessageMap(), & USaveSettings ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Member Enumeration Documentation

anonymous enum

Enumeration values:
kSettingName
kCopyPath
kCopyFrom
kCopyList

Definition at line 741 of file Persistent.cpp.

00742     {
00743 #if qUnix
00744         kOK = EV_COMMAND_START,
00745         kCancel,
00746         kSettingName,
00747 #else
00748         kSettingName = EV_COMMAND_START,
00749 #endif
00750         kCopyPath,
00751         kCopyFrom,
00752         kCopyList
00753     };

Constructor & Destructor Documentation

USaveSettings::USaveSettings | ( | const char * | path,
 |  | const char * | oldname
 | ) |

Definition at line 796 of file Persistent.cpp.

00796                                                                   :
00797     UWidget(::UEventGetWidID()), m_path(path), m_oldname(oldname)
00798 {
00799 }

USaveSettings::~USaveSettings ( ) [virtual]

Definition at line 801 of file Persistent.cpp.

00802 {
00803 }

Member Function Documentation

const URuntimeClass * USaveSettings::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 772 of file Persistent.cpp.

void USaveSettings::DoDataExchange ( bool fill ) [virtual]

while modaling, allows to fill/read the dialog content.

  • fill says if it expects to fill or read the dialog content.

Reimplemented from UWidget.

Definition at line 807 of file Persistent.cpp.

References UStr::empty, EV_COMBO_APPEND, EV_COMBO_GETSEL, EV_COMBO_RESETALL, EV_ENABLECMD, EV_GETTEXT, EV_QUERYSTATE, EV_SETTEXT, GetAllPersistentSettings, UCmdTarget::GetWidID, kCopyFrom, kCopyList, kCopyPath, kSettingName, m_copyFromPath, m_list, m_oldname, m_path, m_settingName, SplitPath, UEventSendMessage, and UMAKEINT.

00808 {
00809     if(fill)
00810     {
00811         UEventSendMessage(GetWidID(), EV_SETTEXT, kCopyPath,
00812             (void *)(const char *)m_path);
00813
00814         UStr defname;
00815         if(m_oldname.empty())
00816         {
00817             UStr uppath;
00818             SplitPath(m_path, uppath, defname);
00819         }
00820         else
00821             defname = m_oldname;
00822
00823         UEventSendMessage(GetWidID(), EV_SETTEXT, kSettingName,
00824             (void *)(const char *)defname);
00825
00826         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kCopyList, 0), 0L);
00827
00828         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kCopyList, 0L);
00829
00830         if(GetAllPersistentSettings(m_list))
00831         {
00832             std::map<UStr, UStr>::const_iterator i;
00833             for(i = m_list.begin(); i != m_list.end(); ++i)
00834             {
00835                 UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kCopyList,
00836                     (void *)(const char *)(*i).first);
00837             }
00838         }
00839     }
00840     else
00841     {
00842         UEventSendMessage(GetWidID(), EV_GETTEXT, kSettingName,
00843             &m_settingName);
00844         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCopyFrom, 0L);
00845         if(state)
00846         {
00847             UStr what;
00848             UEventSendMessage(GetWidID(), EV_COMBO_GETSEL, kCopyList, &what);
00849
00850             std::map<UStr, UStr>::const_iterator i;
00851             i = m_list.find(what);
00852             if(i != m_list.end())
00853             {
00854                 m_copyFromPath = (*i).second;
00855             }
00856         }
00857     }
00858 }

const UMSGMAP * USaveSettings::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 774 of file Persistent.cpp.

const UMSGMAP * USaveSettings::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 774 of file Persistent.cpp.

const URuntimeClass * USaveSettings::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 772 of file Persistent.cpp.

const UMSGMAP * USaveSettings::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 774 of file Persistent.cpp.

int USaveSettings::OnCopyFrom ( void ) [protected]

Definition at line 860 of file Persistent.cpp.

References EV_ENABLECMD, EV_QUERYSTATE, UCmdTarget::GetWidID, kCopyFrom, kCopyList, UEventSendMessage, and UMAKEINT.

00861 {
00862     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCopyFrom, 0L);
00863     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kCopyList, state), 0L);
00864     return 1;
00865 }

const URuntimeClass * USaveSettings::rtUSaveSettings ( void ) [static]

Definition at line 772 of file Persistent.cpp.

Member Data Documentation

const UMSGMAP_ENTRY USaveSettings::_messageEntries [static, private]

Initial value:

   {
    { EV_CMD, epi_V, UMSG_RANGE,  USaveSettings::kCopyFrom ,  USaveSettings::kCopyFrom ,   (UPMSG)(int (UCmdTarget::*)(void))& USaveSettings::OnCopyFrom  },

{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }   }

Reimplemented from UWidget.

Definition at line 774 of file Persistent.cpp.

const URuntimeClass USaveSettings::classUSaveSettings [static, protected]

UStr USaveSettings::m_copyFromPath

Definition at line 756 of file Persistent.cpp.

Referenced by AskCreatePersistentSettings, and DoDataExchange.

std::map<UStr, UStr> USaveSettings::m_list [protected]

Definition at line 761 of file Persistent.cpp.

Referenced by DoDataExchange.

UStr USaveSettings::m_oldname [protected]

Definition at line 760 of file Persistent.cpp.

Referenced by DoDataExchange.

UStr USaveSettings::m_path [protected]

Definition at line 759 of file Persistent.cpp.

Referenced by DoDataExchange.

UStr USaveSettings::m_settingName

Definition at line 755 of file Persistent.cpp.

Referenced by AskCreatePersistentSettings, and DoDataExchange.

const UMSGMAP USaveSettings::messageMap = { UWidget ::GetThisMessageMap(), & USaveSettings ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Definition at line 774 of file Persistent.cpp.

The documentation for this class was generated from the following file:
  • common/Persistent.cpp
Generated on Sun Feb 24 01:27:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CScrollView Class Reference

Inheritance diagram for CScrollView:

[legend]
List of all members.

Public Methods

UPoint GetDeviceScrollPosition ()
void InvalidateRect (const URECT *r)

Member Function Documentation

UPoint CScrollView::GetDeviceScrollPosition ( ) [inline]

Definition at line 104 of file UCvsGraph.cpp.

Referenced by CGraphRectTracker::OnChangedRect, CGraphView::OnContextMenu, CGraphView::OnLButtonDown, and CWinLogData::SetSelected.

00104 { return UPoint(0, 0); }

void CScrollView::InvalidateRect ( const URECT * r ) [inline]

Definition at line 105 of file UCvsGraph.cpp.

Referenced by CWinLogData::SetSelected.

00105 {}

The documentation for this class was generated from the following file:
  • common/UCvsGraph.cpp
Generated on Sun Feb 24 01:27:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


USemaphore Class Reference

#include <umain.h>

Collaboration diagram for USemaphore:

[legend]
List of all members.

Public Methods

USemaphore (bool &semaphore)
~USemaphore ()
bool | IsEnteredTwice () const

Protected Attributes

bool & | m_semaphore
bool | m_didSetSemaphore
bool | m_enteredTwice

Constructor & Destructor Documentation

USemaphore::USemaphore ( bool & semaphore ) [inline]

Definition at line 748 of file umain.h.

References m_didSetSemaphore, m_enteredTwice, and m_semaphore.

00748                                  : m_semaphore(semaphore), m_didSetSemaphore(false),
00749         m_enteredTwice(false)
00750     {
00751         if(m_semaphore)
00752         {
00753             m_enteredTwice = true;
00754             return;
00755         }
00756         m_semaphore = true;
00757         m_didSetSemaphore = true;
00758     }

USemaphore::~USemaphore ( ) [inline]

Definition at line 760 of file umain.h.

00761     {
00762         if(m_didSetSemaphore)
00763             m_semaphore = false;
00764     }

Member Function Documentation

bool USemaphore::IsEnteredTwice ( ) const [inline]

Definition at line 766 of file umain.h.

References m_enteredTwice.

Referenced by FileTraverse, CGetPrefs_CVSROOT::FillFields, CGetPrefs_CVSROOT::OnChangeFields, UToolbar::OnCommands, UMenu::OnCommands, UWidget::OnInitWidget, UCvsFolders::OnTreeExpanding, UToolbar::OnUpdateUI, UMenu::OnUpdateUI, UMacAppMenu::OnUpdateUI, and UCvsFiles::ResetView.

00766 { return m_enteredTwice; }

Member Data Documentation

bool USemaphore::m_didSetSemaphore [protected]

Definition at line 770 of file umain.h.

Referenced by USemaphore.

bool USemaphore::m_enteredTwice [protected]

Definition at line 771 of file umain.h.

Referenced by IsEnteredTwice, and USemaphore.

bool& USemaphore::m_semaphore [protected]

Definition at line 769 of file umain.h.

Referenced by UEventGetTargets, and USemaphore.

The documentation for this class was generated from the following file:
  • rf/umain.h
Generated on Sun Feb 24 01:27:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


USize Class Reference

#include <udraw.h>

Inheritance diagram for USize:

[legend]
Collaboration diagram for USize:

[legend]
List of all members.

Public Methods

USize ()
USize (int initCX, int initCY)
USize (USIZE initSize)
USize (UPOINT initPt)
bool | operator== (USIZE size) const
bool | operator!= (USIZE size) const
void | operator+= (USIZE size)
void | operator-= (USIZE size)
USize | operator+ (USIZE size) const
USize | operator- (USIZE size) const
USize | operator- () const
UPoint | operator+ (UPOINT point) const
UPoint | operator- (UPOINT point) const
URect | operator+ (const URECT *lpRect) const
URect | operator- (const URECT *lpRect) const

Constructor & Destructor Documentation

USize::USize ( ) [inline]

Definition at line 250 of file udraw.h.

Referenced by operator+, and operator-.

00251     { /* random filled */ }

USize::USize | ( | int | initCX,
 |  | int | initCY
 | ) | [inline]

Definition at line 252 of file udraw.h.

References USIZE::cx, and USIZE::cy.

00253     { cx = initCX; cy = initCY; }

USize::USize ( USIZE initSize ) [inline]

Definition at line 254 of file udraw.h.

00255     { *(USIZE*)this = initSize; }

USize::USize ( UPOINT initPt ) [inline]

Definition at line 256 of file udraw.h.

00257     { *(UPOINT*)this = initPt; }

Member Function Documentation

bool USize::operator!= ( USIZE size ) const [inline]

Definition at line 260 of file udraw.h.

References USIZE::cx, and USIZE::cy.

00261     { return (cx != size.cx || cy != size.cy); }

URect USize::operator+ ( const URECT * lpRect ) const [inline]

Definition at line 276 of file udraw.h.

00277     { return URect(lpRect) + *this; }

UPoint USize::operator+ ( UPOINT point ) const [inline]

Definition at line 272 of file udraw.h.

References USIZE::cx, USIZE::cy, UPOINT::x, and UPOINT::y.

00273     { return UPoint(cx + point.x, cy + point.y); }

USize USize::operator+ ( USIZE size ) const [inline]

Definition at line 266 of file udraw.h.

References USIZE::cx, USIZE::cy, and USize.

00267     { return USize(cx + size.cx, cy + size.cy); }

void USize::operator+= ( USIZE size ) [inline]

Definition at line 262 of file udraw.h.

References USIZE::cx, and USIZE::cy.

00263     { cx += size.cx; cy += size.cy; }

URect USize::operator- ( const URECT * lpRect ) const [inline]

Definition at line 278 of file udraw.h.

00279     { return URect(lpRect) - *this; }

UPoint USize::operator- ( UPOINT point ) const [inline]

Definition at line 274 of file udraw.h.

References USIZE::cx, USIZE::cy, UPOINT::x, and UPOINT::y.

00275     { return UPoint(cx - point.x, cy - point.y); }

USize USize::operator- ( ) const [inline]

Definition at line 270 of file udraw.h.

References USIZE::cx, USIZE::cy, and USize.

00271     { return USize(-cx, -cy); }

USize USize::operator- ( USIZE size ) const [inline]

Definition at line 268 of file udraw.h.

References USIZE::cx, USIZE::cy, and USize.

00269     { return USize(cx - size.cx, cy - size.cy); }

void USize::operator-= ( USIZE size ) [inline]

Definition at line 264 of file udraw.h.

References USIZE::cx, and USIZE::cy.

00265     { cx -= size.cx; cy -= size.cy; }

bool USize::operator== ( USIZE size ) const [inline]

Definition at line 258 of file udraw.h.

References USIZE::cx, and USIZE::cy.

00259     { return (cx == size.cx && cy == size.cy); }

The documentation for this class was generated from the following file:
  • rf/udraw.h
Generated on Sun Feb 24 01:27:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


USIZE Struct Reference

#include <umain.h>

Inheritance diagram for USIZE:

[legend]
Collaboration diagram for USIZE:

[legend]
List of all members.

Public Attributes

int | cx
int | cy

Member Data Documentation

int USIZE::cx

Definition at line 916 of file umain.h.

Referenced by CWinLogData::ComputeBounds, URect::DeflateRect, CWinLogRevData::GetBoundsSelf, UDC::GetTextExtent, URect::InflateRect, UPoint::Offset, URect::OffsetRect, USize::operator!=, URect::operator+, UPoint::operator+, USize::operator+, URect::operator+=, UPoint::operator+=, USize::operator+=, URect::operator-, UPoint::operator-, USize::operator-, URect::operator-=, UPoint::operator-=, USize::operator-=, USize::operator==, UDC::TextOutClipped, URect::URect, and USize::USize.

int USIZE::cy

Definition at line 916 of file umain.h.

Referenced by CWinLogData::ComputeBounds, URect::DeflateRect, CWinLogRevData::GetBoundsSelf, UDC::GetTextExtent, URect::InflateRect, UPoint::Offset, URect::OffsetRect, USize::operator!=, URect::operator+, UPoint::operator+, USize::operator+, URect::operator+=, UPoint::operator+=, USize::operator+=, URect::operator-, UPoint::operator-, USize::operator-, URect::operator-=, UPoint::operator-=, USize::operator-=, USize::operator==, UDC::TextOutClipped, URect::URect, and USize::USize.

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Sun Feb 24 01:27:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


USLIDER Struct Reference

#include <umain.h>

Collaboration diagram for USLIDER:

[legend]
List of all members.

Public Attributes

int | max
int | min
int | inc
int | pos

Member Data Documentation

int USLIDER::inc

Definition at line 904 of file umain.h.

Referenced by UWidget::OnGetSliderProperty, and UWidget::OnSetSliderProperty.

int USLIDER::max

Definition at line 902 of file umain.h.

Referenced by UWidget::OnGetSliderProperty, and UWidget::OnSetSliderProperty.

int USLIDER::min

Definition at line 903 of file umain.h.

Referenced by UWidget::OnGetSliderProperty, and UWidget::OnSetSliderProperty.

int USLIDER::pos

Definition at line 905 of file umain.h.

Referenced by UWidget::OnGetSliderProperty, and UWidget::OnSetSliderProperty.

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Sun Feb 24 01:27:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


USmartCombo Class Reference

This is an abstract class for Smart Combo Box (CSmartComboBox). More...

#include "common/SmartComboBox.h"

Inheritance diagram for USmartCombo:

[legend]
Collaboration diagram for USmartCombo:

[legend]
List of all members.

Public Types

enum Feature {
None = 0x00,
AutoDropWidth = 0x01,
RemoveItems = 0x02,
ReadOnly = 0x04,
DefaultFeature = AutoDropWidth | RemoveItems
}
Feature enum. More...

Public Methods

USmartCombo (int feature)
Constructor. More...

virtual | ~USmartCombo ()
Destructor. More...

void | SetFeature (int feature)
Set the features. More...

bool | HasFeature (int feature) const
Test if the feature is supported. More...

void | SetItems (CMString *pstrItems)
Set the items persistent collection. More...

CMString * GetItems ()
Get the items persistent collection. More...

virtual int | CalcDroppedWidth ()
Calculate the width of the dropped items list to fit all items. More...

virtual void | SetReadOnly (bool readOnly=true)
Set the read-only feature. More...

virtual bool | RemoveItem (const char *strItem)
Remove the item from the list. More...

Private Attributes

int | m_feature
CMString * m_pstrItems

Detailed Description

This is an abstract class for Smart Combo Box (CSmartComboBox).

Use as a base class to derive the Smart Combo Box for different plaftorms.

Note:
To set the desired features support by Smart Combo Box objects you can use the combinations of values enumerated under USmartCombo::Feature

Definition at line 42 of file SmartComboBox.h.

Member Enumeration Documentation

enum USmartCombo::Feature

Feature enum.

Enum to specify the desired features for your Smart Combo Box object

Enumeration values:
None | No features, just standard Combo Box.
AutoDropWidth | Automatically adjust the width of the droplist to fit the long items.
RemoveItems | Allows to remove items from combo boxes containing previous values.
ReadOnly | Make the edit portion of combo box read-only (while still allowing to change the selection it prevents from typing those and copy it's values).
DefaultFeature | Default combination of features passed to the Smart Combo Box constructor.

Definition at line 56 of file SmartComboBox.h.

00056                 {
00057         None =          0x00,
00058         AutoDropWidth = 0x01,
00059         RemoveItems =   0x02,
00060         ReadOnly =      0x04,
00061         //
00062         DefaultFeature = AutoDropWidth | RemoveItems
00063     };

Constructor & Destructor Documentation

USmartCombo::USmartCombo ( int feature )

Constructor.

Definition at line 45 of file SmartComboBox.cpp.

References m_pstrItems, and NULL.

00046     : m_feature(feature)
00047 {
00048     m_pstrItems = NULL;
00049 }

USmartCombo::~USmartCombo ( ) [virtual]

Destructor.

Definition at line 52 of file SmartComboBox.cpp.

00053 {
00054 }

Member Function Documentation

int USmartCombo::CalcDroppedWidth ( ) [virtual]

Calculate the width of the dropped items list to fit all items.

Note:
The default implementation does nothing, you should override that method to perform the real calculation.

Reimplemented in CSmartComboBox.

Definition at line 112 of file SmartComboBox.cpp.

00113 {
00114     return 0;
00115 }

CMString * USmartCombo::GetItems ( )

Get the items persistent collection.

Get the items persistent collection as a pointer to CMString class object so that it can be used to populate combo box in DDX rutine etc.

Note:
the return can be NULL

Definition at line 101 of file SmartComboBox.cpp.

References m_pstrItems.

Referenced by DDX_ComboMString, CHistComboBoxEx::DelKeyTest, CSmartComboBox::DelKeyTest, and CHistComboBoxEx::NewRoot.

00102 {
00103     return m_pstrItems;
00104 }

bool USmartCombo::HasFeature ( int feature ) const

Test if the feature is supported.

Return true if the feature is set, false otherwise

Definition at line 70 of file SmartComboBox.cpp.

References m_feature.

Referenced by CHistComboBoxEx::OnDropdown, CSmartComboBox::OnDropdown, CSmartComboBox::PreSubclassWindow, CHistComboBoxEx::PreTranslateMessage, and CSmartComboBox::PreTranslateMessage.

00071 {
00072     return (m_feature & feature) != 0;
00073 }

bool USmartCombo::RemoveItem ( const char * strItem ) [virtual]

Remove the item from the list.

Prompt the user to remove the item from the list and remove it.

Returns:
true if item remove, false otherwise.

Definition at line 138 of file SmartComboBox.cpp.

References CvsAlert, m_pstrItems, and TMString< UStr >::Remove.

Referenced by CHistComboBoxEx::DelKeyTest, and CSmartComboBox::DelKeyTest.

00139 {
00140     UStr prompt("Do you want to remove that item from the list?\n");
00141     prompt << "Item: ";
00142     prompt << strItem;
00143
00144     bool res = CvsAlert(prompt, "Yes", "No");
00145     if( res )
00146     {
00147         m_pstrItems->Remove(strItem);
00148     }
00149
00150     return res;
00151 }

void USmartCombo::SetFeature ( int feature )

Set the features.

Reflect the read-only state apropriate.

Definition at line 60 of file SmartComboBox.cpp.

References m_feature, ReadOnly, and SetReadOnly.

Referenced by CSmartComboBox::OnSetFeature.

00061 {
00062     m_feature = feature;
00063     SetReadOnly(0 != (m_feature & USmartCombo::ReadOnly));
00064 }

void USmartCombo::SetItems ( CMString * pstrItems )

Set the items persistent collection.

Set the items persistent collection as a pointer to CMString class object so that it can be removed with Del key when the droplist is dropped down. It will also set the feature member apropriate: if pstrItems is NULL it will remove and if it's valid then it will add the USmartCombo::RemoveItems feature.

Definition at line 82 of file SmartComboBox.cpp.

References m_feature, m_pstrItems, and RemoveItems.

Referenced by CAnnotate_MAIN::CAnnotate_MAIN, CCheckout_MAIN::CCheckout_MAIN, CCheckout_OPTIONS::CCheckout_OPTIONS, CCmdLine_MAIN::CCmdLine_MAIN, CCommit_MAIN::CCommit_MAIN, CCommit_OPTIONS::CCommit_OPTIONS, CDiff_MAIN::CDiff_MAIN, CGetPrefs_CVSROOT::CGetPrefs_CVSROOT, CImport_MAIN::CImport_MAIN, CLogFilters::CLogFilters, CRtag_MAIN::CRtag_MAIN, CRtag_OPTIONS::CRtag_OPTIONS, CTag_MAIN::CTag_MAIN, CUpdateMerge::CUpdateMerge, CUpdateSticky::CUpdateSticky, CDiff_MAIN::OnCheck1, CDiff_MAIN::OnCheck2, CMainFrame::OnCreate, CAnnotate_MAIN::OnIsdate, and CSmartComboBox::OnSetItems.

00083 {
00084     m_pstrItems = pstrItems;
00085     if( m_pstrItems )
00086     {
00087         m_feature |= USmartCombo::RemoveItems;
00088     }
00089     else
00090     {
00091         m_feature &= ~USmartCombo::RemoveItems;
00092     }
00093 }

void USmartCombo::SetReadOnly ( bool readOnly = true ) [virtual]

Set the read-only feature.

Note:
Call the base class first when you override USmartCombo::SetReadOnly.

Reimplemented in CSmartComboBox.

Definition at line 121 of file SmartComboBox.cpp.

References m_feature, and ReadOnly.

Referenced by SetFeature, and CSmartComboBox::SetReadOnly.

00122 {
00123     if( readOnly )
00124     {
00125         m_feature |= USmartCombo::ReadOnly;
00126     }
00127     else
00128     {
00129         m_feature &= ~USmartCombo::ReadOnly;
00130     }
00131 }

Member Data Documentation

int USmartCombo::m_feature [private]

Definition at line 50 of file SmartComboBox.h.

Referenced by HasFeature, SetFeature, SetItems, and SetReadOnly.

CMString* USmartCombo::m_pstrItems [private]

Definition at line 51 of file SmartComboBox.h.

Referenced by GetItems, RemoveItem, SetItems, and USmartCombo.

The documentation for this class was generated from the following files:
  • common/SmartComboBox.h
  • common/SmartComboBox.cpp
Generated on Sun Feb 24 01:27:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CSmartComboBox Class Reference

This is a Smart Combo Box class(CSmartComboBox). More...

#include "common/SmartComboBox.h"

Inheritance diagram for CSmartComboBox:

[legend]
Collaboration diagram for CSmartComboBox:

[legend]
List of all members.

Public Methods

CSmartComboBox (int feature=USmartCombo::DefaultFeature)
virtual BOOL | PreTranslateMessage (MSG *pMsg)
PreTranslateMessage virtual override. More...

virtual | ~CSmartComboBox ()
virtual void | SetReadOnly (bool readOnly=true)
Set the read-only state. More...

Protected Methods

virtual void | PreSubclassWindow ()
PreSubclassWindow virtual override. More...

afx_msg void | OnDropdown ()
CBN_DROPDOWN notification message handler. More...

afx_msg LRESULT | OnSetFeature (WPARAM wParam, LPARAM lParam)
WM_SMCB_SETFEATURE private message handler. More...

afx_msg LRESULT | OnSetItems (WPARAM wParam, LPARAM lParam)
WM_SMCB_SETITEMS private message handler. More...

afx_msg LRESULT | OnSetReadOnly (WPARAM wParam, LPARAM lParam)
WM_SMCB_SETREADONLY private message handler. More...

Private Methods

virtual int | CalcDroppedWidth ()
Calculate droplist width. More...

BOOL | DelKeyTest (MSG *pMsg)
Test if the Del key is pressed and remove the item if the droplist is dropped down. More...

Detailed Description

This is a Smart Combo Box class(CSmartComboBox).

Use that class as a replacement for CComboBox. Set the desired features using the constructor or CSmartComboBox::SetFeature method. To use the Del key feature when the droplist is dropped down you need to also call CSmartComboBox::SetItems method to setup apropriate persistent collection (CMString object). The CSmartComboBox::SetReadOnlymethod can be used to make an edit portion of the combo readonly or to reverse that feature. For use with the UWidget the messages to set apropriate features and data members are provided (WM_SMCB_SETFEATURE, WM_SMCB_SETITEMS and WM_SMCB_SETREADONLY).

Definition at line 114 of file SmartComboBox.h.

Constructor & Destructor Documentation

CSmartComboBox::CSmartComboBox ( int feature = USmartCombo::DefaultFeature )

Definition at line 157 of file SmartComboBox.cpp.

00158     : USmartCombo(feature)
00159 {
00160 }

CSmartComboBox::~CSmartComboBox ( ) [virtual]

Definition at line 162 of file SmartComboBox.cpp.

00163 {
00164 }

Member Function Documentation

int CSmartComboBox::CalcDroppedWidth ( ) [private, virtual]

Calculate droplist width.

Calculate the proper width for droplist so the items can fit into it. Make sure it doesn't go off-screen as well.

Reimplemented from USmartCombo.

Definition at line 213 of file SmartComboBox.cpp.

Referenced by OnDropdown.

00214 {
00215     int maxSize = 0;
00216
00217     CClientDC ClientDC(this);
00218     int savedDC = ClientDC.SaveDC();
00219     ClientDC.SelectObject(GetFont());
00220
00221     CString strLBText;
00222     for( int nIndex = 0; nIndex < GetCount(); nIndex++ )
00223     {
00224         GetLBText( nIndex, strLBText );
00225         CSize size = ClientDC.GetTextExtent(strLBText);
00226
00227         if( size.cx > maxSize )
00228         {
00229             maxSize = size.cx;
00230         }
00231     }
00232     ClientDC.RestoreDC(savedDC);
00233
00234     maxSize += ::GetSystemMetrics(SM_CXVSCROLL) + 3*::GetSystemMetrics(SM_CXEDGE);
00235
00236     CRect rect;
00237     GetWindowRect(rect);
00238     maxSize = min(ClientDC.GetDeviceCaps(HORZRES) - rect.TopLeft().x, maxSize);
00239
00240     return maxSize;
00241 }

BOOL CSmartComboBox::DelKeyTest ( MSG * pMsg ) [private]

Test if the Del key is pressed and remove the item if the droplist is dropped down.

Analizes the message and removes the item if the Del key is pressed while droplist is dropped down.

Attention:
Make sure the items collection is set earlier (call USmartCombo::SetItems to set the collection).
Returns:
TRUE if the droplist was dropped and Del key was pressed.

Definition at line 249 of file SmartComboBox.cpp.

References ASSERT, FALSE, USmartCombo::GetItems, NULL, USmartCombo::RemoveItem, and TRUE.

Referenced by PreTranslateMessage.

00250 {
00251     CMString* pstrItems = GetItems();
00252     ASSERT(pstrItems != NULL);
00253
00254     BOOL bRes = FALSE;
00255
00256     if( WM_KEYDOWN == pMsg->message &&
00257         VK_DELETE == (int)pMsg->wParam &&
00258         pstrItems &&
00259         GetDroppedState() )
00260     {
00261         int sel = GetCurSel();
00262         if( CB_ERR < sel )
00263         {
00264             CString strItem;
00265             GetLBText(sel, strItem);
00266
00267             if( RemoveItem(strItem) )
00268             {
00269                 DeleteString(sel);
00270             }
00271
00272             //we have to prevent it going to another window
00273             bRes = TRUE;
00274         }
00275     }
00276
00277     return bRes;
00278 }

void CSmartComboBox::OnDropdown ( ) [protected]

CBN_DROPDOWN notification message handler.

Calculates the width of the droplist if the USmartCombo::AutoDropWidth feature is set.

Definition at line 183 of file SmartComboBox.cpp.

References USmartCombo::AutoDropWidth, CalcDroppedWidth, and USmartCombo::HasFeature.

00184 {
00185     if( HasFeature(USmartCombo::AutoDropWidth) )
00186     {
00187         SetDroppedWidth(CalcDroppedWidth());
00188     }
00189 }

LRESULT CSmartComboBox::OnSetFeature | ( | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [protected]

WM_SMCB_SETFEATURE private message handler.

  • wParam value or a combinations of values enumerated under USmartCombo::Feature
  • lParam unused

Definition at line 319 of file SmartComboBox.cpp.

References USmartCombo::SetFeature.

00320 {
00321     SetFeature((int)wParam);
00322     return 0;
00323 }

LRESULT CSmartComboBox::OnSetItems | ( | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [protected]

WM_SMCB_SETITEMS private message handler.

  • wParam pointer to persistent collection of items
  • lParam unused

Definition at line 330 of file SmartComboBox.cpp.

References USmartCombo::SetItems.

00331 {
00332     SetItems((CMString*)wParam);
00333     return 0;
00334 }

LRESULT CSmartComboBox::OnSetReadOnly | ( | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [protected]

WM_SMCB_SETREADONLY private message handler.

  • wParam boolean value to set the read-only state
  • lParam unused

Definition at line 341 of file SmartComboBox.cpp.

References SetReadOnly.

00342 {
00343     SetReadOnly(0 != wParam);
00344     return 0;
00345 }

void CSmartComboBox::PreSubclassWindow ( ) [protected, virtual]

PreSubclassWindow virtual override.

Sets the read-only state if the USmartCombo::ReadOnly feature is set.

Definition at line 284 of file SmartComboBox.cpp.

References USmartCombo::HasFeature, USmartCombo::ReadOnly, and SetReadOnly.

00285 {
00286     if( HasFeature(USmartCombo::ReadOnly) )
00287     {
00288         SetReadOnly();
00289     }
00290
00291     CComboBox::PreSubclassWindow();
00292 }

BOOL CSmartComboBox::PreTranslateMessage ( MSG * pMsg ) [virtual]

PreTranslateMessage virtual override.

If the USmartCombo::RemoveItems feature is set perform the key test to determine whether to delete item.

Definition at line 195 of file SmartComboBox.cpp.

References DelKeyTest, USmartCombo::HasFeature, USmartCombo::RemoveItems, and TRUE.

00196 {
00197     if( HasFeature(USmartCombo::RemoveItems) )
00198     {
00199         if( DelKeyTest(pMsg) )
00200         {
00201             return TRUE;
00202         }
00203     }
00204
00205     return CComboBox::PreTranslateMessage(pMsg);
00206 }

void CSmartComboBox::SetReadOnly ( bool readOnly = true ) [virtual]

Set the read-only state.

Set the read-only state of the edit part of combo box.

Note:
It can be used at runtime, but it's better to set read-only using constructor (CSmartComboBox::CSmartComboBox)

Reimplemented from USmartCombo.

Definition at line 300 of file SmartComboBox.cpp.

References USmartCombo::SetReadOnly.

Referenced by OnSetReadOnly, and PreSubclassWindow.

00301 {
00302     USmartCombo::SetReadOnly(readOnly);
00303
00304     if( IsWindow(m_hWnd) )
00305     {
00306         CEdit* pEdit = (CEdit*)GetDlgItem(1001);
00307         if( pEdit && IsWindow(pEdit->m_hWnd) )
00308         {
00309             pEdit->SetReadOnly(readOnly);
00310         }
00311     }
00312 }

The documentation for this class was generated from the following files:
  • common/SmartComboBox.h
  • common/SmartComboBox.cpp
Generated on Sun Feb 24 01:27:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CSortHeaderCtrl Class Reference

#include <SortHeaderCtrl.h>

Inheritance diagram for CSortHeaderCtrl:

[legend]
Collaboration diagram for CSortHeaderCtrl:

[legend]
List of all members.

Public Methods

CSortHeaderCtrl ()
virtual void | DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct)
virtual int | SetSortImage (int nCol, BOOL bAsc)
virtual | ~CSortHeaderCtrl ()

Protected Attributes

int | m_nSortCol
BOOL | m_bSortAsc

Constructor & Destructor Documentation

CSortHeaderCtrl::CSortHeaderCtrl ( )

Definition at line 14 of file SortHeaderCtrl.cpp.

References m_bSortAsc, m_nSortCol, and TRUE.

00015 {
00016     m_bSortAsc  = TRUE;
00017     m_nSortCol  = -1;
00018 }

CSortHeaderCtrl::~CSortHeaderCtrl ( ) [virtual]

Definition at line 20 of file SortHeaderCtrl.cpp.

00021 {
00022 }

Member Function Documentation

void CSortHeaderCtrl::DrawItem ( LPDRAWITEMSTRUCT lpDrawItemStruct ) [virtual]

Definition at line 45 of file SortHeaderCtrl.cpp.

References m_nSortCol.

00046 {
00047     CDC dc;
00048
00049     dc.Attach( lpDrawItemStruct->hDC );
00050
00051     // Get the column rect
00052     CRect rcLabel( lpDrawItemStruct->rcItem );
00053
00054     // Save DC
00055     int nSavedDC = dc.SaveDC();
00056
00057     // Set clipping region to limit drawing within column
00058     CRgn rgn;
00059     rgn.CreateRectRgnIndirect( &rcLabel );
00060     dc.SelectObject( &rgn );
00061     rgn.DeleteObject();
00062
00063     // Draw the background
00064     dc.FillRect(rcLabel, &CBrush(::GetSysColor(COLOR_3DFACE)));
00065
00066     // Labels are offset by a certain amount
00067     // This offset is related to the width of a space character
00068     int offset = dc.GetTextExtent(_T(" "), 1 ).cx*2;
00069
00070     // Get the column text and format
00071     TCHAR buf[256];
00072     HD_ITEM hditem;
00073
00074     hditem.mask = HDI_TEXT | HDI_FORMAT;
00075     hditem.pszText = buf;
00076     hditem.cchTextMax = 255;
00077
00078     GetItem( lpDrawItemStruct->itemID, &hditem );
00079
00080     // Determine format for drawing column label
00081     UINT uFormat = DT_SINGLELINE | DT_NOPREFIX | DT_NOCLIP
00082                         | DT_VCENTER | DT_END_ELLIPSIS ;
00083
00084     if( hditem.fmt & HDF_CENTER)
00085         uFormat |= DT_CENTER;
00086     else if( hditem.fmt & HDF_RIGHT)
00087         uFormat |= DT_RIGHT;
00088     else
00089         uFormat |= DT_LEFT;
00090
00091     // Adjust the rect if the mouse button is pressed on it
00092     if( lpDrawItemStruct->itemState == ODS_SELECTED )
00093     {
00094         rcLabel.left++;
00095         rcLabel.top += 2;
00096         rcLabel.right++;
00097     }
00098
00099     // Adjust the rect further if Sort arrow is to be displayed
00100     if( lpDrawItemStruct->itemID == (UINT)m_nSortCol )
00101     {
00102         rcLabel.right -= 3 * offset;
00103     }
00104
00105     rcLabel.left += offset;
00106     rcLabel.right -= offset;
00107
00108     // Draw column label
00109     if( rcLabel.left < rcLabel.right )
00110         dc.DrawText(buf,-1,rcLabel, uFormat);
00111
00112     // Draw the Sort arrow
00113     if( lpDrawItemStruct->itemID == (UINT)m_nSortCol )
00114     {
00115         CRect rcIcon( lpDrawItemStruct->rcItem );
00116
00117         // Set up pens to use for drawing the triangle
00118         CPen penLight(PS_SOLID, 1, GetSysColor(COLOR_3DHILIGHT));
00119         CPen penShadow(PS_SOLID, 1, GetSysColor(COLOR_3DSHADOW));
00120         CPen *pOldPen = dc.SelectObject( &penLight );
00121
00122         offset = (rcIcon.bottom - rcIcon.top) / 4;
00123         if (m_bSortAsc)
00124         {
00125             // Draw triangle pointing upwards
00126             dc.MoveTo( rcIcon.right - 2* offset, offset);
00127             dc.LineTo( rcIcon.right - offset, rcIcon.bottom - offset-1 );
00128             dc.LineTo( rcIcon.right - 3*offset-2, rcIcon.bottom - offset-1 );
00129             dc.MoveTo( rcIcon.right - 3*offset-1, rcIcon.bottom - offset-1 );
00130             dc.SelectObject( &penShadow );
00131             dc.LineTo( rcIcon.right - 2*offset, offset-1);
00132         }
00133         else
00134         {
00135             // Draw triangle pointing downwards
00136             dc.MoveTo( rcIcon.right - offset-1, offset);
00137             dc.LineTo( rcIcon.right - 2*offset-1, rcIcon.bottom - offset );
00138             dc.MoveTo( rcIcon.right - 2*offset-2, rcIcon.bottom - offset );
00139             dc.SelectObject( &penShadow );
00140             dc.LineTo( rcIcon.right - 3*offset-1, offset );
00141             dc.LineTo( rcIcon.right - offset-1, offset);
00142         }
00143
00144         // Restore the pen
00145         dc.SelectObject( pOldPen );
00146     }
00147
00148     // Restore dc
00149     dc.RestoreDC( nSavedDC );
00150
00151     // Detach the dc before returning
00152     dc.Detach();
00153 }

int CSortHeaderCtrl::SetSortImage | ( | int | nCol,
 |  | BOOL | bAsc
 | ) | [virtual]

Definition at line 24 of file SortHeaderCtrl.cpp.

References m_bSortAsc, and m_nSortCol.

Referenced by CBrowseFileView::Resort.

00025 {
00026     int nPrevCol = m_nSortCol;
00027
00028     m_nSortCol = nCol;
00029     m_bSortAsc = bAsc;
00030
00031     // Change the item to ownder drawn
00032     HD_ITEM hditem;
00033
00034     hditem.mask = HDI_FORMAT;
00035     GetItem( nCol, &hditem );
00036     hditem.fmt |= HDF_OWNERDRAW;
00037     SetItem( nCol, &hditem );
00038
00039     // Invalidate header control so that it gets redrawn
00040     Invalidate();
00041
00042     return nPrevCol;
00043 }

Member Data Documentation

BOOL CSortHeaderCtrl::m_bSortAsc [protected]

Definition at line 19 of file SortHeaderCtrl.h.

Referenced by CSortHeaderCtrl, and SetSortImage.

int CSortHeaderCtrl::m_nSortCol [protected]

Definition at line 18 of file SortHeaderCtrl.h.

Referenced by CSortHeaderCtrl, DrawItem, and SetSortImage.

The documentation for this class was generated from the following files:
  • WinCvs/SortHeaderCtrl.h
  • WinCvs/SortHeaderCtrl.cpp
Generated on Sun Feb 24 01:27:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TemplateCSortList class Reference

CSortList Class Template Reference

#include <SortList.h>

Inheritance diagram for CSortList:

[legend]
Collaboration diagram for CSortList:

[legend]
List of all members.

Public Types

typedef int(* | QsortMethod )(const T &, const T &)

Public Methods

CSortList (int def_size, QsortMethod method_sort)
~CSortList ()
int | Insert (const T &entry, bool replaceIfAlreadyExists=false)
bool | Inside (const T &entry, int *indexptr=0L) const
bool | InsideAndInsert (const T &entry, int *indexptr=0L, bool replaceIfAlreadyExists=false)
bool | Delete (const T &entry)
T * | Result (int *num_elem)
const T & | Get (int index) const
void | Reset (void)
int | NumOfElements (void)

Private Methods

const T & | Entry (int num_elem) const
int | Location (const T &entry)

Private Attributes

QsortMethod fMethod
int | fDef
int | fNum
int | fMax
T * | fElems
bool | fNewOne

template<class T>
class CSortList< T >

Member Typedef Documentation

template<class T>
typedef int(* CSortList::QsortMethod)(const T &, const T &)

Definition at line 48 of file SortList.h.

Referenced by CSortList< ENTNODE >::CSortList.

Constructor & Destructor Documentation

template<class T>
CSortList< T >::CSortList | ( | int | def_size,
 |  | QsortMethod | method_sort
 | ) | [inline]

Definition at line 50 of file SortList.h.

00051     {
00052         assert(def_size > 1 && method_sort != 0L);
00053
00054         fDef = def_size;
00055         fMethod = method_sort;
00056         fMax = fNum = 0;
00057         fElems = 0L;
00058         fNewOne = false;
00059     }

template<class T>
CSortList< T >::~CSortList ( ) [inline]

Definition at line 61 of file SortList.h.

00062     {
00063         Reset();
00064     }

Member Function Documentation

template<class T>
bool CSortList< T >::Delete ( const T & entry ) [inline]

Definition at line 151 of file SortList.h.

Referenced by Entries_Open.

00152     {
00153         int index = Location(entry), i;
00154
00155         if(fNewOne)
00156             return false;
00157
00158         if(fNum == 1)
00159         {
00160             Reset();
00161             return true;
00162         }
00163
00164         for(i = index; i < fNum - 1; i++)
00165         {
00166             fElems[i] = fElems[i + 1];
00167         }
00168         --fNum;
00169         return true;
00170     }

template<class T>
const T& CSortList< T >::Entry ( int num_elem ) const [inline, private]

Definition at line 217 of file SortList.h.

Referenced by CSortList< ENTNODE >::Get, and CSortList< ENTNODE >::Location.

00218     {
00219         assert(num_elem >= 0 && num_elem < fNum);
00220
00221         return fElems[num_elem];
00222     }

template<class T>
const T& CSortList< T >::Get ( int index ) const [inline]

Definition at line 191 of file SortList.h.

Referenced by cvsgui_GetCvsEntries, Entries_SetMissing, Entries_SetVisited, TViewFill::ExitDirectory, CWinCvsBrowser::OnItemexpanding, UCvsFolders::OnTreeExpanding, and tclCvsEntriesProc.

00192     {
00193         return Entry(index);
00194     }

template<class T>
int CSortList< T >::Insert | ( | const T & | entry,
 |  | bool | replaceIfAlreadyExists = false
 | ) | [inline]

Definition at line 68 of file SortList.h.

Referenced by CSortList< ENTNODE >::InsideAndInsert.

00069     {
00070         int index = Location(entry), i;
00071
00072         if(!fNewOne)
00073         {
00074             if(replaceIfAlreadyExists)
00075                 fElems[index] = entry;
00076
00077             return index;
00078         }
00079
00080         // check memory
00081         if(fNum == fMax)
00082         {
00083             T *newElems = 0L;
00084
00085             try
00086             {
00087                 newElems = new T[fMax + fDef];
00088
00089                 for(i = 0; i < fNum + 1; i++)
00090                 {
00091                     if(i < index)
00092                         newElems[i] = fElems[i];
00093                     else if(i == index)
00094                         newElems[i] = entry;
00095                     else
00096                         newElems[i] = fElems[i - 1];
00097                 }
00098             }
00099             catch(...)
00100             {
00101                 if(newElems != 0L)
00102                     delete[] newElems;
00103                 throw;
00104             }
00105
00106             fMax += fDef;
00107             fNum++;
00108             if(fElems != 0L)
00109                 delete[] fElems;
00110             fElems = newElems;
00111             return index;
00112         }
00113
00114         for(i = fNum - 1; i >= index; i--)
00115         {
00116             fElems[i + 1] = fElems[i];
00117         }
00118
00119         fElems[index] = entry;
00120         fNum++;
00121         return index;
00122     }

template<class T>
bool CSortList< T >::Inside | ( | const T & | entry,
 |  | int * | indexptr = 0L
 | ) | const [inline]

Definition at line 127 of file SortList.h.

00128     {
00129         int index = ((CSortList*)this)->Location(entry);
00130
00131         if(indexptr != 0L)
00132             *indexptr = fNewOne ? -1 : index;
00133
00134         return !fNewOne;
00135     }

template<class T>
bool CSortList< T >::InsideAndInsert | ( | const T & | entry,
 |  | int * | indexptr = 0L,
 |  | bool | replaceIfAlreadyExists = false
 | ) | [inline]

Definition at line 139 of file SortList.h.

Referenced by Entries_Open, and Entries_SetVisited.

00141     {
00142         int index = Insert(entry, replaceIfAlreadyExists);
00143         if(indexptr != 0L)
00144             *indexptr = index;
00145
00146         return !fNewOne;
00147     }

template<class T>
int CSortList< T >::Location ( const T & entry ) [inline, private]

Definition at line 226 of file SortList.h.

Referenced by CSortList< ENTNODE >::Delete, and CSortList< ENTNODE >::Insert.

00227     {
00228         int left, right, cmp_left = 0, cmp_right = 0;
00229         int cmp_middle, middle;
00230         computeSort compute;
00231
00232         if(fNum == 0)
00233         {
00234             fNewOne = true;
00235             return 0;
00236         }
00237
00238         fNewOne = false;
00239         left = 0;
00240         right = fNum - 1;
00241         compute = computeLR;
00242
00243         while(1)
00244         {
00245             middle = (left + right) / 2;
00246
00247             if(compute == computeLR)
00248             {
00249                 // firstime only
00250                 cmp_left = fMethod(Entry(left), entry);
00251                 cmp_right = fMethod(Entry(right), entry);
00252             }
00253             cmp_middle = fMethod(Entry(middle), entry);
00254
00255             // entry already exist (E == L || E == R)
00256             if(cmp_left == 0 || cmp_right == 0)
00257             {
00258                 return cmp_left == 0 ? left : right;
00259             }
00260
00261             // found an entry superior to the right (E > R && E < R + 1)
00262             if(cmp_right < 0)
00263             {
00264                 fNewOne = true;
00265                 return right + 1;
00266             }
00267
00268             // found an entry inferior to the left (L - 1 < E < L)
00269             if(cmp_left > 0)
00270             {
00271                 fNewOne = true;
00272                 return left;
00273             }
00274
00275             // found an entry inferior to the right (E > R - 1 && E < R)
00276             if(middle == left)
00277             {
00278                 fNewOne = true;
00279                 return right;
00280             }
00281
00282             // entry already exist (E == M)
00283             if(cmp_middle == 0)
00284                 return middle;
00285             // restart search (E > M && E < R)
00286             else if(cmp_middle < 0)
00287             {
00288                 compute = computeNone;
00289                 left = middle;
00290                 cmp_left = cmp_middle;
00291                 cmp_right = 1;
00292             }
00293             // restart search (E > L && E < M)
00294             else
00295             {
00296                 compute = computeNone;
00297                 right = middle;
00298                 cmp_right = cmp_middle;
00299                 cmp_left = -1;
00300             }
00301         }
00302         assert(0);
00303         return 0;
00304     }

template<class T>
int CSortList< T >::NumOfElements ( void ) [inline]

Definition at line 207 of file SortList.h.

Referenced by cvsgui_GetCvsEntries, Entries_SetMissing, TViewFill::ExitDirectory, CWinCvsBrowser::OnItemexpanding, UCvsFolders::OnTreeExpanding, and tclCvsEntriesProc.

00207 {return fNum;}

template<class T>
void CSortList< T >::Reset ( void ) [inline]

Definition at line 198 of file SortList.h.

Referenced by CSortList< ENTNODE >::Delete, Entries_Open, and CSortList< ENTNODE >::~CSortList.

00199     {
00200         if(fElems != 0L)
00201             delete[] fElems;
00202         fMax = fNum = 0;
00203         fElems = 0L;
00204     }

template<class T>
T* CSortList< T >::Result ( int * num_elem ) [inline]

Definition at line 173 of file SortList.h.

00174     {
00175         *num_elem = 0;
00176
00177         if(fNum == 0)
00178             return 0L;
00179
00180         *num_elem = fNum;
00181         T *res = new T[fNum];
00182         for(int i = 0; i < fNum; i++)
00183         {
00184             res[i] = fElems[i];
00185         }
00186
00187         return res;
00188     }

Member Data Documentation

template<class T>
int CSortList::fDef [private]

Definition at line 210 of file SortList.h.

Referenced by CSortList< ENTNODE >::CSortList, and CSortList< ENTNODE >::Insert.

template<class T>
T* CSortList::fElems [private]

Definition at line 213 of file SortList.h.

Referenced by CSortList< ENTNODE >::CSortList, CSortList< ENTNODE >::Delete, CSortList< ENTNODE >::Entry, CSortList< ENTNODE >::Insert, CSortList< ENTNODE >::Reset, and CSortList< ENTNODE >::Result.

template<class T>
int CSortList::fMax [private]

Definition at line 212 of file SortList.h.

Referenced by CSortList< ENTNODE >::CSortList, CSortList< ENTNODE >::Insert, and CSortList< ENTNODE >::Reset.

template<class T>
QsortMethod CSortList::fMethod [private]

Definition at line 209 of file SortList.h.

Referenced by CSortList< ENTNODE >::CSortList, and CSortList< ENTNODE >::Location.

template<class T>
bool CSortList::fNewOne [private]

Definition at line 214 of file SortList.h.

Referenced by CSortList< ENTNODE >::CSortList, CSortList< ENTNODE >::Insert, CSortList< ENTNODE >::Inside, CSortList< ENTNODE >::InsideAndInsert, and CSortList< ENTNODE >::Location.

template<class T>
int CSortList::fNum [private]

Definition at line 211 of file SortList.h.

Referenced by CSortList< ENTNODE >::CSortList, CSortList< ENTNODE >::Delete, CSortList< ENTNODE >::Entry, CSortList< ENTNODE >::Insert, CSortList< ENTNODE >::Location, CSortList< ENTNODE >::NumOfElements, CSortList< ENTNODE >::Reset, and CSortList< ENTNODE >::Result.

The documentation for this class was generated from the following file:
  • common/SortList.h
Generated on Sun Feb 24 01:27:50 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CSortParam Struct Reference

#include <BrowseViewColumn.h>

Collaboration diagram for CSortParam:

[legend]
List of all members.

Public Methods

CSortParam (bool fAccendant, bool fGroupSubDir, const KiColumn *column, const KiColumn *columnAlt, KoColumnContext *context)

Public Attributes

const KiColumn * | m_column
const KiColumn * | m_columnAlt
KoColumnContext * m_context
bool | m_fAccendant
bool | m_fGroupSubDir

Constructor & Destructor Documentation

CSortParam::CSortParam | ( | bool | fAccendant,
 |  | bool | fGroupSubDir,
 |  | const KiColumn * | column,
 |  | const KiColumn * | columnAlt,
 |  | KoColumnContext * | context
 | ) | [inline]

Definition at line 89 of file BrowseViewColumn.h.

References m_column, m_columnAlt, m_context, m_fAccendant, and m_fGroupSubDir.

00090     : m_fAccendant(fAccendant)
00091     , m_fGroupSubDir(fGroupSubDir)
00092     , m_column(column)
00093     , m_columnAlt(columnAlt)
00094     , m_context(context)
00095     {};

Member Data Documentation

const KiColumn* CSortParam::m_column

Definition at line 97 of file BrowseViewColumn.h.

Referenced by _Compare, and CSortParam.

const KiColumn* CSortParam::m_columnAlt

Definition at line 98 of file BrowseViewColumn.h.

Referenced by _Compare, and CSortParam.

KoColumnContext* CSortParam::m_context

Definition at line 99 of file BrowseViewColumn.h.

Referenced by _Compare, and CSortParam.

bool CSortParam::m_fAccendant

Definition at line 100 of file BrowseViewColumn.h.

Referenced by _Compare, and CSortParam.

bool CSortParam::m_fGroupSubDir

Definition at line 101 of file BrowseViewColumn.h.

Referenced by _Compare, and CSortParam.

The documentation for this struct was generated from the following file:
  • common/BrowseViewColumn.h
Generated on Sun Feb 24 01:27:50 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CSplashWnd Class Reference

#include <Splash.h>

Inheritance diagram for CSplashWnd:

[legend]
Collaboration diagram for CSplashWnd:

[legend]
List of all members.

Public Methods

~CSplashWnd ()
virtual void | PostNcDestroy ()

Static Public Methods

void | EnableSplashScreen (BOOL bEnable=TRUE)
void | ShowSplashScreen (CWnd *pParentWnd=NULL)
BOOL | PreTranslateAppMessage (MSG *pMsg)
void | CloseSplashScreen ()

Public Attributes

CBitmap | m_bitmap

Protected Methods

CSplashWnd ()
BOOL | Create (CWnd *pParentWnd=NULL)
void | HideSplashScreen ()
afx_msg int | OnCreate (LPCREATESTRUCT lpCreateStruct)
afx_msg void | OnPaint ()
afx_msg void | OnTimer (UINT nIDEvent)

Static Protected Attributes

BOOL | c_bShowSplashWnd
CSplashWnd * | c_pSplashWnd

Constructor & Destructor Documentation

CSplashWnd::CSplashWnd ( ) [protected]

Definition at line 29 of file Splash.cpp.

00030 {
00031 }

CSplashWnd::~CSplashWnd ( )

Definition at line 33 of file Splash.cpp.

References ASSERT, c_pSplashWnd, and NULL.

00034 {
00035     // Clear the static window pointer.
00036     ASSERT(c_pSplashWnd == this);
00037     c_pSplashWnd = NULL;
00038 }

Member Function Documentation

void CSplashWnd::CloseSplashScreen ( ) [static]

Definition at line 108 of file Splash.cpp.

References c_pSplashWnd, and HideSplashScreen.

Referenced by WarnNoPython.

00109 {
00110     if(c_pSplashWnd)
00111     {
00112         c_pSplashWnd->HideSplashScreen();
00113     }
00114 }

BOOL CSplashWnd::Create ( CWnd * pParentWnd = NULL ) [protected]

Definition at line 88 of file Splash.cpp.

References FALSE, IDB_SPLASH, m_bitmap, and NULL.

Referenced by ShowSplashScreen.

00089 {
00090     if (!m_bitmap.LoadBitmap(IDB_SPLASH))
00091         return FALSE;
00092
00093     BITMAP bm;
00094     m_bitmap.GetBitmap(&bm);
00095
00096     return CreateEx(0,
00097         AfxRegisterWndClass(0, AfxGetApp()->LoadStandardCursor(IDC_ARROW)),
00098         NULL, WS_POPUP | WS_VISIBLE, 0, 0, bm.bmWidth, bm.bmHeight, pParentWnd->GetSafeHwnd(), NULL);
00099 }

void CSplashWnd::EnableSplashScreen ( BOOL bEnable = TRUE ) [static]

Definition at line 48 of file Splash.cpp.

References c_bShowSplashWnd.

Referenced by CWincvsApp::InitInstance.

00049 {
00050     c_bShowSplashWnd = bEnable;
00051 }

void CSplashWnd::HideSplashScreen ( ) [protected]

Definition at line 101 of file Splash.cpp.

Referenced by CloseSplashScreen, OnTimer, and PreTranslateAppMessage.

00102 {
00103     // Destroy the window, and update the mainframe.
00104     DestroyWindow();
00105     AfxGetMainWnd()->UpdateWindow();
00106 }

int CSplashWnd::OnCreate ( LPCREATESTRUCT lpCreateStruct ) [protected]

Definition at line 122 of file Splash.cpp.

References NULL.

00123 {
00124     if (CWnd::OnCreate(lpCreateStruct) == -1)
00125         return -1;
00126
00127     // Center the window.
00128     CenterWindow();
00129
00130     // Set a timer to destroy the splash screen.
00131     SetTimer(1, 750, NULL);
00132
00133     return 0;
00134 }

void CSplashWnd::OnPaint ( ) [protected]

Definition at line 136 of file Splash.cpp.

References CStr, gc_nBitmapRightMargin, CWincvsApp::GetAppVersion, and m_bitmap.

00137 {
00138     CPaintDC dc(this);
00139
00140     CDC dcImage;
00141     if (!dcImage.CreateCompatibleDC(&dc))
00142         return;
00143
00144     BITMAP bm;
00145     m_bitmap.GetBitmap(&bm);
00146
00147     // Paint the image.
00148     CBitmap* pOldBitmap = dcImage.SelectObject(&m_bitmap);
00149     dc.BitBlt(0, 0, bm.bmWidth, bm.bmHeight, &dcImage, 0, 0, SRCCOPY);
00150     dcImage.SelectObject(pOldBitmap);
00151
00152     // Get version information from the application
00153     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00154     CStr vers;
00155
00156     if(app->GetAppVersion(vers))
00157     {
00158         dc.SetBkMode(TRANSPARENT);
00159         dc.SetTextAlign(TA_RIGHT | TA_TOP);
00160         dc.TextOut(bm.bmWidth - gc_nBitmapRightMargin - 10, 219, vers, vers.length());
00161     }
00162 }

void CSplashWnd::OnTimer ( UINT nIDEvent ) [protected]

Definition at line 164 of file Splash.cpp.

References HideSplashScreen.

00165 {
00166     // Destroy the splash screen window.
00167     HideSplashScreen();
00168 }

void CSplashWnd::PostNcDestroy ( ) [virtual]

Definition at line 116 of file Splash.cpp.

00117 {
00118     // Free the C++ class.
00119     delete this;
00120 }

BOOL CSplashWnd::PreTranslateAppMessage ( MSG * pMsg ) [static]

Definition at line 66 of file Splash.cpp.

References c_pSplashWnd, FALSE, HideSplashScreen, NULL, and TRUE.

Referenced by CWincvsApp::PreTranslateMessage.

00067 {
00068     if (c_pSplashWnd == NULL)
00069         return FALSE;
00070
00071     // If we get a keyboard or mouse message, hide the splash screen.
00072     if (pMsg->message == WM_KEYDOWN ||
00073         pMsg->message == WM_SYSKEYDOWN ||
00074         pMsg->message == WM_LBUTTONDOWN ||
00075         pMsg->message == WM_RBUTTONDOWN ||
00076         pMsg->message == WM_MBUTTONDOWN ||
00077         pMsg->message == WM_NCLBUTTONDOWN ||
00078         pMsg->message == WM_NCRBUTTONDOWN ||
00079         pMsg->message == WM_NCMBUTTONDOWN)
00080     {
00081         c_pSplashWnd->HideSplashScreen();
00082         return TRUE;    // message handled here
00083     }
00084
00085     return FALSE;   // message not handled
00086 }

void CSplashWnd::ShowSplashScreen ( CWnd * pParentWnd = NULL ) [static]

Definition at line 53 of file Splash.cpp.

References c_bShowSplashWnd, c_pSplashWnd, Create, and NULL.

Referenced by CMainFrame::OnCreate.

00054 {
00055     if (!c_bShowSplashWnd || c_pSplashWnd != NULL)
00056         return;
00057
00058     // Allocate a new splash screen, and create the window.
00059     c_pSplashWnd = new CSplashWnd;
00060     if (!c_pSplashWnd->Create(pParentWnd))
00061         delete c_pSplashWnd;
00062     else
00063         c_pSplashWnd->UpdateWindow();
00064 }

Member Data Documentation

BOOL CSplashWnd::c_bShowSplashWnd [static, protected]

Definition at line 27 of file Splash.cpp.

Referenced by EnableSplashScreen, and ShowSplashScreen.

CSplashWnd * CSplashWnd::c_pSplashWnd [static, protected]

Definition at line 28 of file Splash.cpp.

Referenced by CloseSplashScreen, PreTranslateAppMessage, ShowSplashScreen, and ~CSplashWnd.

CBitmap CSplashWnd::m_bitmap

Definition at line 20 of file Splash.h.

Referenced by Create, and OnPaint.

The documentation for this class was generated from the following files:
  • WinCvs/Splash.h
  • WinCvs/Splash.cpp
Generated on Sun Feb 24 01:27:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CSplitterWnd Class Reference

Inheritance diagram for CSplitterWnd:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/GfxSplitterWnd.h
Generated on Sun Feb 24 01:27:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CStackThreadLock Struct Reference

List of all members.

Public Methods

CStackThreadLock ()
~CStackThreadLock ()

Constructor & Destructor Documentation

CStackThreadLock::CStackThreadLock ( ) [inline]

Definition at line 157 of file cvsgui_process.cpp.

References CDummyInit::m_stacklock.

00158     {
00159         EnterCriticalSection(&CDummyInit::m_stacklock);
00160     }

CStackThreadLock::~CStackThreadLock ( ) [inline]

Definition at line 161 of file cvsgui_process.cpp.

References CDummyInit::m_stacklock.

00162     {
00163         LeaveCriticalSection(&CDummyInit::m_stacklock);
00164     }

The documentation for this struct was generated from the following file:
  • common/cvsgui_process.cpp
Generated on Sun Feb 24 01:27:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CStatic Class Reference

Inheritance diagram for CStatic:

[legend]
The documentation for this class was generated from the following file:
  • rf/support/mfc/PseudoDraw.h
Generated on Sun Feb 24 01:27:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TemplateCStaticAllocT class Reference

CStaticAllocT Class Template Reference

#include <CPStr.h>

Inheritance diagram for CStaticAllocT:

[legend]
Collaboration diagram for CStaticAllocT:

[legend]
List of all members.

Public Methods

CStaticAllocT ()
~CStaticAllocT ()
void | AdjustSize (size_t size)
operator T * (void) const
operator const T * (void) const
size_t | size () const

Protected Attributes

T * | buf
size_t | numbuf

template<class T>
class CStaticAllocT< T >

Constructor & Destructor Documentation

template<class T>
CStaticAllocT< T >::CStaticAllocT ( ) [inline]

Definition at line 142 of file CPStr.h.

00143     {
00144         buf = 0L;
00145         numbuf = 0;
00146     }

template<class T>
CStaticAllocT< T >::~CStaticAllocT ( ) [inline]

Definition at line 148 of file CPStr.h.

00149     {
00150         if(buf != 0L)
00151             free(buf);
00152     }

Member Function Documentation

template<class T>
void CStaticAllocT< T >::AdjustSize ( size_t size ) [inline]

Definition at line 154 of file CPStr.h.

Referenced by cleanUpLogMsg, expandLF, FillBuffer, CPersistent::LoadAll, and reduceString.

00155     {
00156         if(numbuf < size)
00157         {
00158             if(buf == 0L)
00159                 buf = (T *)malloc(size * sizeof(T));
00160             else
00161                 buf = (T *)realloc(buf, size * sizeof(T));
00162             if(buf == 0L)
00163                 throw std::bad_alloc();
00164             numbuf = size;
00165         }
00166     }

template<class T>
CStaticAllocT< T >::operator const T * ( void ) const [inline]

Definition at line 169 of file CPStr.h.

00169 { return buf; }

template<class T>
CStaticAllocT< T >::operator T * ( void ) const [inline]

Definition at line 168 of file CPStr.h.

00168 { return buf; }

template<class T>
size_t CStaticAllocT< T >::size ( ) const [inline]

Definition at line 175 of file CPStr.h.

Referenced by CStaticAllocT< char >::AdjustSize.

00175 { return numbuf; }

Member Data Documentation

template<class T>
T* CStaticAllocT::buf [protected]

Definition at line 177 of file CPStr.h.

Referenced by CStaticAllocT< char >::AdjustSize, CStaticAllocT< char >::CStaticAllocT, CStaticAllocT< char >::operator const T *, CStaticAllocT< char >::operator T *, and CStaticAllocT< char >::~CStaticAllocT.

template<class T>
size_t CStaticAllocT::numbuf [protected]

Definition at line 178 of file CPStr.h.

Referenced by CStaticAllocT< char >::AdjustSize, CStaticAllocT< char >::CStaticAllocT, and CStaticAllocT< char >::size.

The documentation for this class was generated from the following file:
  • common/CPStr.h
Generated on Sun Feb 24 01:27:52 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CStatusBar Class Reference

Inheritance diagram for CStatusBar:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CvsStatusBar.h
Generated on Sun Feb 24 01:27:52 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UStr Class Reference

C string class. More...

#include <ustr.h>

Inheritance diagram for UStr:

[legend]
Collaboration diagram for UStr:

[legend]
List of all members.

Public Methods

UStr ()
UStr (const char *newstr)
UStr (const unsigned char *newstr)
UStr (const UStr &newstr)
virtual | ~UStr ()
bool | empty (void) const
unsigned int | length (void) const
const char * | operator= (const char *newstr)
set from a C String (0L is OK). More...

const char * | operator= (const unsigned char *newstr)
set from a P String (0L is OK). More...

const UStr & | operator= (const UStr &newstr)
set according to another UStr. More...

const UStr & | set (const char *buf, unsigned int len)
set from a buffer. More...

bool | operator< (const UStr &str) const
compare, provided to compile with STL. More...

bool | operator> (const UStr &str) const
compare, provided to compile with STL. More...

bool | operator== (const UStr &str) const
compare, provided to compile with STL. More...

bool | operator== (const char *str) const
compare, provided to compile with STL. More...

bool | operator!= (const UStr &str) const
compare, provided to compile with STL. More...

bool | operator!= (const char *str) const
compare, provided to compile with STL. More...

operator const char * () const
as a C string. More...

operator char * ()
as a C string. More...

const char * | c_str () const
as a C string. More...

UStr & | operator<< (const char *addToStr)
concatenate. More...

UStr & | operator<< (char addToStr)
concatenate. More...

UStr & | operator<< (int addToStr)
concatenate. More...

int | compare (const char *thestr) const
compare. More...

bool | endsWith (char c) const
const UStr & | replace (char which, char bywhich)
replace a character. More...

Protected Methods

void | flush (void)

Protected Attributes

char * | str
the String. More...

Detailed Description

C string class.

Definition at line 113 of file ustr.h.

Constructor & Destructor Documentation

UStr::UStr ( ) [inline]

Definition at line 116 of file ustr.h.

00116 : str(0L) {}

UStr::UStr ( const char * newstr ) [inline]

Definition at line 117 of file ustr.h.

00118     {
00119         str = 0L;
00120         *this = newstr;
00121     }

UStr::UStr ( const unsigned char * newstr ) [inline]

Definition at line 122 of file ustr.h.

00123     {
00124         str = 0L;
00125         set((const char *)newstr + 1, newstr[0]);
00126     }

UStr::UStr ( const UStr & newstr ) [inline]

Definition at line 127 of file ustr.h.

00128     {
00129         str = 0L;
00130         *this = newstr;
00131     }

virtual UStr::~UStr ( ) [inline, virtual]

Definition at line 132 of file ustr.h.

00132 {flush();}

Member Function Documentation

const char* UStr::c_str ( ) const [inline]

as a C string.

Definition at line 169 of file ustr.h.

Referenced by cvsgui_PromptEditMessage, UAuthen_Rhosts::DoDataExchange, UAuthen_SSH::DoDataExchange, UEditMessage::DoDataExchange, UPromptMessage::DoDataExchange, AuthenSSH::GetSettingsDesc, UAuthen_SSH::OnBtnName, UAuthen_SSH::OnBtnRSA, AuthenSSH::OnGetEnv, AuthenSSH::OnSetupEnv, PyMacrosReloadAll, and CvsPrefs::WhichCvs.

00169 { return str == 0L ? "" : str; }

int UStr::compare ( const char * thestr ) const [inline]

compare.

Definition at line 179 of file ustr.h.

Referenced by CMacroEntry::operator==.

00179 { return strcmp(*this, thestr); }

bool UStr::empty ( void ) const [inline]

Definition at line 134 of file ustr.h.

Referenced by AskCreatePersistentSettings, CvsPrefs::Browser, CCommit_MAIN::CCommit_MAIN, cvsgui_PromptEditMessage, USaveSettings::DoDataExchange, UAuthen_Rhosts::DoDataExchange, UAuthen_SSH::DoDataExchange, TBrowserFillDummy::EnterDirectory, CvsPrefs::ExtDiff, getLoc, AuthenSSH::GetSettingsDesc, HasPersistentSettings, CvsPrefs::Helper, CvsPrefs::Home, CvsPrefs::LastWorkingDir, LoadPersistentSettings, ReportConflict::Match, UCvsFolders::OnCreate, AuthenSSH::OnGetEnv, AuthenSSH::OnSetupEnv, CCommit_MAIN::OnTemplate, ReportConflict::PrintOut, CWinCvsBrowser::ResetBrowser, UCvsFolders::ResetBrowser, UCvsFolders::ResetView, AuthenSSH::RsaIdentityFile, CvsPrefs::RshName, SaveAsPersistentSettings, SavePersistentSettings, CvsPrefs::SetHome, KoFilterModel::SetMask, CvsPrefs::SetWhichCvs, CvsPrefs::Viewer, and CvsPrefs::WhichCvs.

00134 {return str == 0L || str[0] == '\0';}

bool UStr::endsWith ( char c ) const [inline]

Definition at line 181 of file ustr.h.

Referenced by BuildIgnoredList, CCommit_MAIN::CCommit_MAIN, CFindSettings::CFindSettings, Entries_Open, EntnodePath::GetFullPathName, UCvsFolders::GetItemByLocation, getLoc, CvsPrefs::Home, launchCVS, UAuthen_SSH::OnBtnName, UAuthen_SSH::OnBtnRSA, UCvsFolders::OnUpdateGeneric, CWinCvsBrowser::ResetBrowser, UCvsFolders::ResetBrowser, UCvsFolders::RetrievePath, CPersistent::SaveAllSettings, SaveAsPersistentSettings, CvsPrefs::SetHome, UCvsFolders::StepToLocation, and CvsPrefs::WhichCvs.

00181 {return !length() ? false : str[length()-1] == c;}

void UStr::flush ( void ) [protected]

Definition at line 184 of file ustr.cpp.

References free, and str.

Referenced by operator=, and set.

00185 {
00186     if(str == 0L)
00187         return;
00188     free(str);
00189     str = 0L;
00190 }

unsigned int UStr::length ( void ) const [inline]

Definition at line 135 of file ustr.h.

Referenced by CFindSettings::CFindSettings, CompatGetPassword, UCvsConsole::FeedThisLine, UCvsFolders::GetItemByLocation, GetMenuTitle, KoPathColumn::GetText, CvsPrefs::Home, ReportConflict::Match, operator<<, CBrowseFileView::ProcessSelectionCommand, CPersistent::SaveAllSettings, CvsPrefs::SetHome, PCStr::SizeOf, UCvsFolders::StepToLocation, and UPseudoPageHider::UPseudoPageHider.

00135 {return str == 0L ? 0 : strlen(str);}

UStr::operator char * ( ) [inline]

as a C string.

Reimplemented in PCStr.

Definition at line 167 of file ustr.h.

References EGCS_CONST.

00167 { return str == 0L ? 0L : str; }

UStr::operator const char * ( ) const [inline]

as a C string.

Reimplemented in PCStr.

Definition at line 165 of file ustr.h.

00165 { return str == 0L ? "" : str; }

bool UStr::operator!= ( const char * str ) const

compare, provided to compile with STL.

Definition at line 339 of file ustr.cpp.

References str.

00340 {
00341     return strcmp(*this, str) != 0;
00342 }

bool UStr::operator!= ( const UStr & str ) const

compare, provided to compile with STL.

Definition at line 334 of file ustr.cpp.

00335 {
00336     return strcmp(*this, str) != 0;
00337 }

bool UStr::operator< ( const UStr & str ) const

compare, provided to compile with STL.

Definition at line 314 of file ustr.cpp.

00315 {
00316     return strcmp(*this, str) < 0;
00317 }

UStr & UStr::operator<< ( int addToStr )

concatenate.

Definition at line 307 of file ustr.cpp.

00308 {
00309     char astr[50];
00310     sprintf(astr, "%d", addToStr);
00311     return *this << astr;
00312 }

UStr & UStr::operator<< ( char addToStr )

concatenate.

Definition at line 300 of file ustr.cpp.

00301 {
00302     char astr[2] = {'\0', '\0'};
00303     astr[0] = addToStr;
00304     return *this << astr;
00305 }

UStr & UStr::operator<< ( const char * addToStr )

concatenate.

Definition at line 270 of file ustr.cpp.

References free, length, malloc, str, and UTHROW.

00271 {
00272     if(addToStr == 0L)
00273         return *this;
00274
00275     if(str == 0L)
00276     {
00277         *this = addToStr;
00278         return *this;
00279     }
00280
00281     unsigned int len = strlen(addToStr);
00282     if(len == 0)
00283         return *this;
00284
00285     unsigned int curlen = length();
00286     char *newstr = (char *)malloc((len + curlen + 1) * sizeof(char));
00287     if(newstr == 0L)
00288         UTHROW(std::bad_alloc());
00289     memcpy(newstr, str, curlen * sizeof(char));
00290     memcpy(newstr + curlen, addToStr, len * sizeof(char));
00291     newstr[len + curlen] = '\0';
00292
00293     if(str != 0L)
00294         free(str);
00295     str = newstr;
00296
00297     return *this;
00298 }

const UStr & UStr::operator= ( const UStr & newstr )

set according to another UStr.

Definition at line 229 of file ustr.cpp.

00230 {
00231     *this = (const char *)newstr;
00232     return *this;
00233 }

const char * UStr::operator= ( const unsigned char * newstr )

set from a P String (0L is OK).

Reimplemented in PCStr.

Definition at line 210 of file ustr.cpp.

References flush, malloc, str, and UTHROW.

00211 {
00212     if(newstr == 0L)
00213         newstr = (unsigned char *)"";
00214
00215     int l = newstr[0];
00216     char *newvalue = (char *)malloc((l + 1) * sizeof(char));
00217     if(newvalue == 0L)
00218         UTHROW(std::bad_alloc());
00219
00220     memcpy(newvalue, newstr + 1, l * sizeof(char));
00221     newvalue[l] = '\0';
00222
00223     flush();
00224     str = newvalue;
00225
00226     return *this;
00227 }

const char * UStr::operator= ( const char * newstr )

set from a C String (0L is OK).

Reimplemented in PCStr.

Definition at line 192 of file ustr.cpp.

References flush, malloc, str, and UTHROW.

00193 {
00194     if(newstr == 0L)
00195         newstr = "";
00196
00197     int l = strlen(newstr);
00198     char *newvalue = (char *)malloc((l + 1) * sizeof(char));
00199     if(newvalue == 0L)
00200         UTHROW(std::bad_alloc());
00201
00202     strcpy(newvalue, newstr);
00203
00204     flush();
00205     str = newvalue;
00206
00207     return *this;
00208 }

bool UStr::operator== ( const char * str ) const

compare, provided to compile with STL.

Definition at line 329 of file ustr.cpp.

References str.

00330 {
00331     return strcmp(*this, str) == 0;
00332 }

bool UStr::operator== ( const UStr & str ) const

compare, provided to compile with STL.

Definition at line 324 of file ustr.cpp.

00325 {
00326     return strcmp(*this, str) == 0;
00327 }

bool UStr::operator> ( const UStr & str ) const

compare, provided to compile with STL.

Definition at line 319 of file ustr.cpp.

00320 {
00321     return strcmp(*this, str) > 0;
00322 }

const UStr & UStr::replace | ( | char | which,
 |  | char | bywhich
 | ) |

replace a character.

Definition at line 254 of file ustr.cpp.

References str.

00255 {
00256     if(str == 0L)
00257         return *this;
00258
00259     char *buf = str;
00260     while(*buf)
00261     {
00262         if(*buf == which)
00263             *buf++ = bywhich;
00264         else
00265             buf++;
00266     }
00267     return *this;
00268 }

const UStr & UStr::set | ( | const char * | buf,
 |  | unsigned int | len
 | ) |

set from a buffer.

Definition at line 235 of file ustr.cpp.

References flush, malloc, str, and UAppConsole.

Referenced by cvsgui_RunCvs, UCvsConsole::FeedThisLine, GetEnvValue, LPseudoWinAttachment::ListenToMessage, loadSettingsInternal, UWidget::OnGetText, UWidget::OnListGetInfo, UPseudoRotButton::ReadIconsID, UCvsFolders::StepToLocation, UMakeBitmap, UPseudoPageHider::UPseudoPageHider, and UPseudoPlaceHolder::UPseudoPlaceHolder.

00236 {
00237     flush();
00238     if(len == 0)
00239         return *this;
00240
00241     str = (char *)malloc((len + 1) * sizeof(char));
00242     if(str == 0L)
00243     {
00244         UAppConsole("Impossible to allocate %d bytes !\n", (len + 1) * sizeof(char));
00245         return *this;
00246     }
00247
00248     memcpy(str, buf, len * sizeof(char));
00249     str[len] = '\0';
00250
00251     return *this;
00252 }

Member Data Documentation

char* UStr::str [protected]

the String.

Definition at line 189 of file ustr.h.

Referenced by flush, operator!=, operator<<, operator=, operator==, replace, set, and PCStr::SizeOf.

The documentation for this class was generated from the following files:
  • rf/ustr.h
  • rf/ustr.cpp
Generated on Sun Feb 24 01:27:53 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CStreamConsole Class Reference

Inheritance diagram for CStreamConsole:

[legend]
Collaboration diagram for CStreamConsole:

[legend]
List of all members.

Public Methods

CStreamConsole (FILE *out)
virtual long | cvs_out (char *txt, long len)
virtual long | cvs_err (char *txt, long len)

Protected Attributes

FILE * | fOut

Constructor & Destructor Documentation

CStreamConsole::CStreamConsole ( FILE * out ) [inline]

Definition at line 732 of file AppGlue.cpp.

References fOut.

00732 : fOut(out) {}

Member Function Documentation

virtual long CStreamConsole::cvs_err | ( | char * | txt,
 |  | long | len
 | ) | [inline, virtual]

Implements CCvsConsole.

Definition at line 739 of file AppGlue.cpp.

References cvs_errstr.

00740     {
00741         cvs_errstr(txt, len);
00742         return len;
00743     }

virtual long CStreamConsole::cvs_out | ( | char * | txt,
 |  | long | len
 | ) | [inline, virtual]

Implements CCvsConsole.

Definition at line 734 of file AppGlue.cpp.

References fOut.

00735     {
00736         fwrite(txt, sizeof(char), len, fOut);
00737         return len;
00738     }

Member Data Documentation

FILE* CStreamConsole::fOut [protected]

Definition at line 745 of file AppGlue.cpp.

Referenced by CStreamConsole, and cvs_out.

The documentation for this class was generated from the following file:
  • common/AppGlue.cpp
Generated on Sun Feb 24 01:27:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CSubclassWnd Class Reference

#include <Subclass.h>

Inheritance diagram for CSubclassWnd:

[legend]
Collaboration diagram for CSubclassWnd:

[legend]
List of all members.

Public Methods

DECLARE_DYNAMIC (CSubclassWnd)
CSubclassWnd ()
~CSubclassWnd ()
virtual BOOL | HookWindow (HWND hwnd)
virtual BOOL | HookWindow (CWnd *pWnd)
virtual BOOL | IsHooked ()

Protected Methods

virtual LRESULT | WindowProc (UINT msg, WPARAM wp, LPARAM lp)
virtual LRESULT | Default ()

Protected Attributes

HWND | m_hWnd
WNDPROC | m_pOldWndProc
CSubclassWnd * | m_pNext

Friends

class | CSubclassWndMap
LRESULT CALLBACK | HookWndProc (HWND, UINT, WPARAM, LPARAM)

Constructor & Destructor Documentation

CSubclassWnd::CSubclassWnd ( )

Definition at line 59 of file Subclass.cpp.

References m_hWnd, m_pNext, m_pOldWndProc, and NULL.

00060 {
00061     m_pNext = NULL;
00062     m_pOldWndProc = NULL;
00063     m_hWnd  = NULL;
00064 }

CSubclassWnd::~CSubclassWnd ( )

Definition at line 66 of file Subclass.cpp.

References HookWindow, and NULL.

00067 {
00068     if (m_hWnd)
00069         HookWindow((HWND)NULL);     // unhook window
00070 }

Member Function Documentation

CSubclassWnd::DECLARE_DYNAMIC ( CSubclassWnd )

LRESULT CSubclassWnd::Default ( ) [protected, virtual]

Definition at line 115 of file Subclass.cpp.

References WindowProc.

00116 {
00117     // MFC stores current MSG in thread state
00118     MSG& curMsg = AfxGetThreadState()->m_lastSentMsg;
00119     // Note: must explicitly call CSubclassWnd::WindowProc to avoid infinte
00120     // recursion on virtual function
00121     return CSubclassWnd::WindowProc(curMsg.message, curMsg.wParam, curMsg.lParam);
00122 }

virtual BOOL CSubclassWnd::HookWindow ( CWnd * pWnd ) [inline, virtual]

Definition at line 61 of file Subclass.h.

References HookWindow.

00061 { return HookWindow(pWnd->GetSafeHwnd()); }

BOOL CSubclassWnd::HookWindow ( HWND hwnd ) [virtual]

Definition at line 77 of file Subclass.cpp.

References ASSERT, m_hWnd, m_pOldWndProc, NULL, theHookMap, and TRUE.

Referenced by HookWindow, CCJMenuBarFrameHook::Install, CSubclassWndMap::RemoveAll, CCJMenuBarFrameHook::~CCJMenuBarFrameHook, and ~CSubclassWnd.

00078 {
00079     ASSERT_VALID(this);
00080     if (hwnd) {
00081         // Hook the window
00082         ASSERT(m_hWnd==NULL);
00083         ASSERT(::IsWindow(hwnd));
00084         theHookMap.Add(hwnd, this);         // Add to map of hooks
00085
00086     } else if (m_hWnd) {
00087         // Unhook the window
00088         theHookMap.Remove(this);                // Remove from map
00089         m_pOldWndProc = NULL;
00090     }
00091     m_hWnd = hwnd;
00092     return TRUE;
00093 }

virtual BOOL CSubclassWnd::IsHooked ( ) [inline, virtual]

Definition at line 62 of file Subclass.h.

References NULL.

00062 { return m_hWnd!=NULL; }

LRESULT CSubclassWnd::WindowProc | ( | UINT | msg,
 |  | WPARAM | wp,
 |  | LPARAM | lp
 | ) | [protected, virtual]

Reimplemented in CCJMenuBarFrameHook.

Definition at line 103 of file Subclass.cpp.

References ASSERT, m_hWnd, m_pNext, and m_pOldWndProc.

Referenced by Default, HookWndProc, and CCJMenuBarFrameHook::WindowProc.

00104 {
00105 //  ASSERT_VALID(this);  // removed for speed
00106     ASSERT(m_pOldWndProc);
00107     return m_pNext ? m_pNext->WindowProc(msg, wp, lp) :
00108         ::CallWindowProc(m_pOldWndProc, m_hWnd, msg, wp, lp);
00109 }

Friends And Related Function Documentation

friend class CSubclassWndMap [friend]

Definition at line 65 of file Subclass.h.

LRESULT CALLBACK HookWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) | [friend]

Definition at line 150 of file Subclass.cpp.

00151 {
00152 #ifdef _USRDLL
00153     // If this is a DLL, need to set up MFC state
00154     AFX_MANAGE_STATE(AfxGetStaticModuleState());
00155 #endif
00156
00157     // Set up MFC message state just in case anyone wants it
00158     // This is just like AfxCallWindowProc, but we can't use that because
00159     // a CSubclassWnd is not a CWnd.
00160     //
00161     MSG& curMsg = AfxGetThreadState()->m_lastSentMsg;
00162     MSG  oldMsg = curMsg;   // save for nesting
00163     curMsg.hwnd     = hwnd;
00164     curMsg.message = msg;
00165     curMsg.wParam  = wp;
00166     curMsg.lParam  = lp;
00167
00168     // Get hook object for this window. Get from hook map
00169     CSubclassWnd* pSubclassWnd = theHookMap.Lookup(hwnd);
00170     ASSERT(pSubclassWnd);
00171
00172     LRESULT lr;
00173     if (msg==WM_NCDESTROY) {
00174         // Window is being destroyed: unhook all hooks (for this window)
00175         // and pass msg to orginal window proc
00176         //
00177         WNDPROC wndproc = pSubclassWnd->m_pOldWndProc;
00178         theHookMap.RemoveAll(hwnd);
00179         lr = ::CallWindowProc(wndproc, hwnd, msg, wp, lp);
00180
00181     } else {
00182         // pass to msg hook
00183         lr = pSubclassWnd->WindowProc(msg, wp, lp);
00184     }
00185     curMsg = oldMsg;            // pop state
00186     return lr;
00187 }

Member Data Documentation

HWND CSubclassWnd::m_hWnd [protected]

Definition at line 73 of file Subclass.h.

Referenced by CSubclassWnd, HookWindow, CSubclassWndMap::Remove, and WindowProc.

CSubclassWnd* CSubclassWnd::m_pNext [protected]

Definition at line 75 of file Subclass.h.

Referenced by CSubclassWndMap::Add, CSubclassWnd, CSubclassWndMap::Remove, and WindowProc.

WNDPROC CSubclassWnd::m_pOldWndProc [protected]

Definition at line 74 of file Subclass.h.

Referenced by CSubclassWndMap::Add, CSubclassWnd, HookWindow, HookWndProc, CSubclassWndMap::Remove, and WindowProc.

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/Subclass.h
  • WinCvs/CJLib/CJLibrary/Subclass.cpp
Generated on Sun Feb 24 01:27:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CSubclassWndMap Class Reference

Inheritance diagram for CSubclassWndMap:

[legend]
Collaboration diagram for CSubclassWndMap:

[legend]
List of all members.

Public Methods

CSubclassWndMap ()
~CSubclassWndMap ()
void | Add (HWND hwnd, CSubclassWnd *pSubclassWnd)
void | Remove (CSubclassWnd *pSubclassWnd)
void | RemoveAll (HWND hwnd)
CSubclassWnd * | Lookup (HWND hwnd)

Static Public Methods

CSubclassWndMap & | GetHookMap ()

Constructor & Destructor Documentation

CSubclassWndMap::CSubclassWndMap ( )

Definition at line 192 of file Subclass.cpp.

00193 {
00194 }

CSubclassWndMap::~CSubclassWndMap ( )

Definition at line 196 of file Subclass.cpp.

00197 {
00198 // This assert bombs when posting WM_QUIT, so I've deleted it.
00199 //  ASSERT(IsEmpty());  // all hooks should be removed!
00200 }

Member Function Documentation

void CSubclassWndMap::Add | ( | HWND | hwnd,
 |  | CSubclassWnd * | pSubclassWnd
 | ) |

Definition at line 218 of file Subclass.cpp.

References ASSERT, HookWndProc, Lookup, CSubclassWnd::m_pNext, CSubclassWnd::m_pOldWndProc, and NULL.

00219 {
00220     ASSERT(hwnd && ::IsWindow(hwnd));
00221
00222     // Add to front of list
00223     pSubclassWnd->m_pNext = Lookup(hwnd);
00224     SetAt(hwnd, pSubclassWnd);
00225
00226     if (pSubclassWnd->m_pNext==NULL) {
00227         // If this is the first hook added, subclass the window
00228         pSubclassWnd->m_pOldWndProc =
00229             (WNDPROC)SetWindowLong(hwnd, GWL_WNDPROC, (DWORD)HookWndProc);
00230
00231     } else {
00232         // just copy wndproc from next hook
00233         pSubclassWnd->m_pOldWndProc = pSubclassWnd->m_pNext->m_pOldWndProc;
00234     }
00235     ASSERT(pSubclassWnd->m_pOldWndProc);
00236 }

CSubclassWndMap & CSubclassWndMap::GetHookMap ( ) [static]

Definition at line 205 of file Subclass.cpp.

00206 {
00207     // By creating theMap here, C++ doesn't instantiate it until/unless
00208     // it's ever used! This is a good trick to use in C++, to
00209     // instantiate/initialize a static object the first time it's used.
00210     //
00211     static CSubclassWndMap theMap;
00212     return theMap;
00213 }

CSubclassWnd * CSubclassWndMap::Lookup ( HWND hwnd )

Definition at line 279 of file Subclass.cpp.

References NULL.

Referenced by Add, Remove, and RemoveAll.

00280 {
00281     CSubclassWnd* pFound = NULL;
00282     if (!CMapPtrToPtr::Lookup(hwnd, (void*&)pFound))
00283         return NULL;
00284     ASSERT_KINDOF(CSubclassWnd, pFound);
00285     return pFound;
00286 }

void CSubclassWndMap::Remove ( CSubclassWnd * pSubclassWnd )

Definition at line 241 of file Subclass.cpp.

References ASSERT, Lookup, CSubclassWnd::m_hWnd, CSubclassWnd::m_pNext, and CSubclassWnd::m_pOldWndProc.

00242 {
00243     HWND hwnd = pUnHook->m_hWnd;
00244     ASSERT(hwnd && ::IsWindow(hwnd));
00245
00246     CSubclassWnd* pHook = Lookup(hwnd);
00247     ASSERT(pHook);
00248     if (pHook==pUnHook) {
00249         // hook to remove is the one in the hash table: replace w/next
00250         if (pHook->m_pNext)
00251             SetAt(hwnd, pHook->m_pNext);
00252         else {
00253             // This is the last hook for this window: restore wnd proc
00254             RemoveKey(hwnd);
00255             SetWindowLong(hwnd, GWL_WNDPROC, (DWORD)pHook->m_pOldWndProc);
00256         }
00257     } else {
00258         // Hook to remove is in the middle: just remove from linked list
00259         while (pHook->m_pNext!=pUnHook)
00260             pHook = pHook->m_pNext;
00261         ASSERT(pHook && pHook->m_pNext==pUnHook);
00262         pHook->m_pNext = pUnHook->m_pNext;
00263     }
00264 }

void CSubclassWndMap::RemoveAll ( HWND hwnd )

Definition at line 269 of file Subclass.cpp.

References CSubclassWnd::HookWindow, Lookup, and NULL.

00270 {
00271     CSubclassWnd* pSubclassWnd;
00272     while ((pSubclassWnd = Lookup(hwnd))!=NULL)
00273         pSubclassWnd->HookWindow((HWND)NULL);   // (unhook)
00274 }

The documentation for this class was generated from the following file:
  • WinCvs/CJLib/CJLibrary/Subclass.cpp
Generated on Sun Feb 24 01:27:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CTabCtrl Class Reference

Inheritance diagram for CTabCtrl:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJTabCtrl.h
Generated on Sun Feb 24 01:27:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TAdorner Class Reference

Inheritance diagram for TAdorner:

[legend]
The documentation for this class was generated from the following file:
  • rf/support/macapp/UPseudoSupport.h
Generated on Sun Feb 24 01:27:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CTag_MAIN Class Reference

#include <TagDlg.h>

Inheritance diagram for CTag_MAIN:

[legend]
Collaboration diagram for CTag_MAIN:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_TAG_MAIN }

Public Methods

CTag_MAIN (kTagDlgType type, const char *sLastTag, bool noRecurs, bool checkUnmod=false, bool overwriteExisting=false)
CTag_MAIN ()
~CTag_MAIN ()

Public Attributes

CStatic m_tagDescStatic
CButton m_grpBox
CButton m_overwriteExistingCheck
CButton m_checkUnmodCheck
CSmartComboBox m_tagCombo
BOOL | m_noRecurs
BOOL | m_checkUnmod
BOOL | m_overwriteExisting
CString | m_tagName

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
virtual BOOL | OnInitDialog ()

Private Attributes

kTagDlgType m_type

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 70 of file TagDlg.h.

00070 { IDD = IDD_TAG_MAIN };

Constructor & Destructor Documentation

CTag_MAIN::CTag_MAIN | ( | kTagDlgType | type,
 |  | const char * | sLastTag,
 |  | bool | noRecurs,
 |  | bool | checkUnmod = false,
 |  | bool | overwriteExisting = false
 | ) |

Definition at line 67 of file TagDlg.cpp.

References kTagDlgType, m_checkUnmod, m_noRecurs, m_overwriteExisting, m_tagCombo, m_tagName, m_type, and USmartCombo::SetItems.

00070         : CPropertyPage(CTag_MAIN::IDD)
00071 {
00072     m_type = type;
00073
00074     m_noRecurs = noRecurs;
00075     m_checkUnmod = checkUnmod;
00076     m_overwriteExisting = overwriteExisting;
00077     m_tagName = sLastTag;
00078
00079     m_tagCombo.SetItems(&gRevNames);
00080 }

CTag_MAIN::CTag_MAIN ( )

Definition at line 82 of file TagDlg.cpp.

References FALSE, m_checkUnmod, m_noRecurs, m_overwriteExisting, and m_tagName.

00082                      : CPropertyPage(CTag_MAIN::IDD)
00083 {
00084     //{{AFX_DATA_INIT(CTag_MAIN)
00085     m_noRecurs = FALSE;
00086     m_checkUnmod = FALSE;
00087     m_overwriteExisting = FALSE;
00088     m_tagName = _T("");
00089     //}}AFX_DATA_INIT
00090 }

CTag_MAIN::~CTag_MAIN ( )

Definition at line 92 of file TagDlg.cpp.

00093 {
00094 }

Member Function Documentation

void CTag_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 96 of file TagDlg.cpp.

References DDV_MinChars, DDX_ComboMString, IDC_CHECKUNMOD, IDC_GRPBOX_TEXT, IDC_NORECURS, IDC_OVERWRITE, IDC_TAGDESC_TEXT, IDC_TAGNAME, m_checkUnmod, m_checkUnmodCheck, m_grpBox, m_noRecurs, m_overwriteExisting, m_overwriteExistingCheck, m_tagCombo, m_tagDescStatic, and m_tagName.

00097 {
00098     CPropertyPage::DoDataExchange(pDX);
00099     //{{AFX_DATA_MAP(CTag_MAIN)
00100     DDX_Control(pDX, IDC_TAGDESC_TEXT, m_tagDescStatic);
00101     DDX_Control(pDX, IDC_GRPBOX_TEXT, m_grpBox);
00102     DDX_Control(pDX, IDC_OVERWRITE, m_overwriteExistingCheck);
00103     DDX_Control(pDX, IDC_CHECKUNMOD, m_checkUnmodCheck);
00104     DDX_Control(pDX, IDC_TAGNAME, m_tagCombo);
00105     DDX_Check(pDX, IDC_NORECURS, m_noRecurs);
00106     DDX_Check(pDX, IDC_CHECKUNMOD, m_checkUnmod);
00107     DDX_Check(pDX, IDC_OVERWRITE, m_overwriteExisting);
00108     DDX_CBString(pDX, IDC_TAGNAME, m_tagName);
00109     //}}AFX_DATA_MAP
00110
00111     DDV_MinChars(pDX, m_tagName, 1);
00112     DDX_ComboMString(pDX, IDC_TAGNAME, m_tagCombo);
00113 }

BOOL CTag_MAIN::OnInitDialog ( ) [protected, virtual]

Definition at line 124 of file TagDlg.cpp.

References ASSERT, FALSE, kTagAdd, kTagDelete, kTagFork, m_checkUnmodCheck, m_grpBox, m_overwriteExistingCheck, m_tagDescStatic, and TRUE.

00125 {
00126     CPropertyPage::OnInitDialog();
00127
00128     // set the type-specific data
00129     CString strGrpBox;
00130     CString strTagDesc;
00131
00132     switch( m_type )
00133     {
00134     case kTagAdd:
00135         strGrpBox = "Enter the tag name to create:";
00136         strTagDesc = "New tag &name:";
00137         break;
00138     case kTagDelete:
00139         strGrpBox = "Enter the tag name to delete:";
00140         strTagDesc = "Delete tag &name:";
00141
00142         m_checkUnmodCheck.ShowWindow(SW_HIDE);
00143         m_overwriteExistingCheck.ShowWindow(SW_HIDE);
00144         break;
00145     case kTagFork:
00146         strGrpBox = "Enter the branch name to create:";
00147         strTagDesc = "New branch &name:";
00148
00149         m_overwriteExistingCheck.ShowWindow(SW_HIDE);
00150         break;
00151     default:
00152         ASSERT(FALSE); //unknown type
00153     }
00154
00155     m_grpBox.SetWindowText(strGrpBox);
00156     m_tagDescStatic.SetWindowText(strTagDesc);
00157
00158     return TRUE;  // return TRUE unless you set the focus to a control
00159                   // EXCEPTION: OCX Property Pages should return FALSE
00160 }

Member Data Documentation

BOOL CTag_MAIN::m_checkUnmod

Definition at line 77 of file TagDlg.h.

Referenced by CompatTagBranch, CompatTagCreate, CTag_MAIN, and DoDataExchange.

CButton CTag_MAIN::m_checkUnmodCheck

Definition at line 74 of file TagDlg.h.

Referenced by DoDataExchange, and OnInitDialog.

CButton CTag_MAIN::m_grpBox

Definition at line 72 of file TagDlg.h.

Referenced by DoDataExchange, and OnInitDialog.

BOOL CTag_MAIN::m_noRecurs

Definition at line 76 of file TagDlg.h.

Referenced by CompatTagBranch, CompatTagCreate, CompatTagDelete, CTag_MAIN, and DoDataExchange.

BOOL CTag_MAIN::m_overwriteExisting

Definition at line 78 of file TagDlg.h.

Referenced by CompatTagCreate, CTag_MAIN, and DoDataExchange.

CButton CTag_MAIN::m_overwriteExistingCheck

Definition at line 73 of file TagDlg.h.

Referenced by DoDataExchange, and OnInitDialog.

CSmartComboBox CTag_MAIN::m_tagCombo

Definition at line 75 of file TagDlg.h.

Referenced by CTag_MAIN, and DoDataExchange.

CStatic CTag_MAIN::m_tagDescStatic

Definition at line 71 of file TagDlg.h.

Referenced by DoDataExchange, and OnInitDialog.

CString CTag_MAIN::m_tagName

Definition at line 79 of file TagDlg.h.

Referenced by CompatTagBranch, CompatTagCreate, CompatTagDelete, CTag_MAIN, and DoDataExchange.

kTagDlgType CTag_MAIN::m_type [private]

Definition at line 98 of file TagDlg.h.

Referenced by CTag_MAIN.

The documentation for this class was generated from the following files:
  • common/TagDlg.h
  • common/TagDlg.cpp
Generated on Sun Feb 24 01:27:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


tagCTV_ITEM Struct Reference

#include <CJTabView.h>

Collaboration diagram for tagCTV_ITEM:

[legend]
List of all members.

Public Attributes

CWnd * pWnd
TCHAR szLabel [32]

Member Data Documentation

CWnd* tagCTV_ITEM::pWnd

Definition at line 48 of file CJTabView.h.

Referenced by CCJTabView::AddView, CCJTabView::GetView, CCJTabView::OnWindowPosChanged, and CCJTabView::SetActiveView.

TCHAR tagCTV_ITEM::szLabel[32]

Definition at line 49 of file CJTabView.h.

Referenced by CCJTabView::AddView.

The documentation for this struct was generated from the following file:
  • WinCvs/CJLib/Include/CJTabView.h
Generated on Sun Feb 24 01:27:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


tagMENUITEMINFOA Class Reference

Inheritance diagram for tagMENUITEMINFOA:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJMenu.h
Generated on Sun Feb 24 01:27:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


tagTCB_ITEM Struct Reference

#include <CJTabCtrlBar.h>

Collaboration diagram for tagTCB_ITEM:

[legend]
List of all members.

Public Attributes

CWnd * pWnd
CString | szTabLabel
CString | szToolTipLabel
UINT | uiToolTipId

Member Data Documentation

CWnd* tagTCB_ITEM::pWnd

Definition at line 169 of file CJTabCtrlBar.h.

Referenced by CCJTabCtrlBar::CreateTabListItem, CCJTabCtrlBar::DeleteView, CCJTabCtrlBar::GetView, CCJTabCtrlBar::GetViewName, CCJTabCtrlBar::OnWindowPosChanged, CCJTabCtrlBar::RemoveListItem, CCJTabCtrlBar::SetActiveView, and CCJTabCtrlBar::SetViewToolTip.

CString tagTCB_ITEM::szTabLabel

Definition at line 170 of file CJTabCtrlBar.h.

Referenced by CCJTabCtrlBar::CreateTabListItem, and CCJTabCtrlBar::GetViewName.

CString tagTCB_ITEM::szToolTipLabel

Definition at line 171 of file CJTabCtrlBar.h.

Referenced by CCJTabCtrlBar::CreateTabListItem, CCJTabCtrlBar::ResetToolTips, and CCJTabCtrlBar::SetViewToolTip.

UINT tagTCB_ITEM::uiToolTipId

Definition at line 172 of file CJTabCtrlBar.h.

Referenced by CCJTabCtrlBar::AddToolTip, CCJTabCtrlBar::CreateTabListItem, CCJTabCtrlBar::ResetToolTips, and CCJTabCtrlBar::SetViewToolTip.

The documentation for this struct was generated from the following file:
  • WinCvs/CJLib/Include/CJTabCtrlBar.h
Generated on Sun Feb 24 01:27:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UTB_BUTTON Struct Reference

#include <umain.h>

Collaboration diagram for UTB_BUTTON:

[legend]
List of all members.

Public Attributes

const void * | icon
int | cmd
UTB_VAR varcode
UTB_DROP drop
const char * | tooltip

Member Data Documentation

int UTB_BUTTON::cmd

Definition at line 888 of file umain.h.

Referenced by UToolbar::OnTbButton, UToolbar::OnTbCheckBtn, and UToolbar::OnTbDropDown.

UTB_DROP UTB_BUTTON::drop

Definition at line 890 of file umain.h.

const void* UTB_BUTTON::icon

Definition at line 887 of file umain.h.

Referenced by UToolbar::OnTbButton, UToolbar::OnTbCheckBtn, and UToolbar::OnTbDropDown.

const char* UTB_BUTTON::tooltip

Definition at line 891 of file umain.h.

Referenced by UToolbar::OnTbButton, UToolbar::OnTbCheckBtn, and UToolbar::OnTbDropDown.

UTB_VAR UTB_BUTTON::varcode

Definition at line 889 of file umain.h.

Referenced by UToolbar::OnTbButton, UToolbar::OnTbCheckBtn, and UToolbar::OnTbDropDown.

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Sun Feb 24 01:27:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UTB_DROPDOWN Struct Reference

#include <umain.h>

Collaboration diagram for UTB_DROPDOWN:

[legend]
List of all members.

Public Attributes

int initialcmd
UTB_BUTTON * btns

Member Data Documentation

UTB_BUTTON* UTB_DROPDOWN::btns

Definition at line 897 of file umain.h.

Referenced by UToolbar::OnTbDropDown.

int UTB_DROPDOWN::initialcmd

Definition at line 896 of file umain.h.

Referenced by UToolbar::OnTbDropDown.

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Sun Feb 24 01:27:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UTB_INIT Struct Reference

#include <umain.h>

Collaboration diagram for UTB_INIT:

[legend]
List of all members.

Public Attributes

int | widthbtn
int | heightbtn
const char * | title
int | winid

Member Data Documentation

int UTB_INIT::heightbtn

Definition at line 868 of file umain.h.

Referenced by CreateMainToolbar, and UToolbar::OnTbInit.

const char* UTB_INIT::title

Definition at line 869 of file umain.h.

Referenced by CreateMainToolbar, and UToolbar::OnTbInit.

int UTB_INIT::widthbtn

Definition at line 868 of file umain.h.

Referenced by CreateMainToolbar, and UToolbar::OnTbInit.

int UTB_INIT::winid

Definition at line 871 of file umain.h.

Referenced by UToolbar::OnTbInit.

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Sun Feb 24 01:27:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CTbEdit Class Reference

#include <TbEdit.h>

Inheritance diagram for CTbEdit:

[legend]
Collaboration diagram for CTbEdit:

[legend]
List of all members.

Public Types

enum | { WM_CONTENTCHANGE = WM_APP + 56 }

Public Methods

CTbEdit ()
virtual BOOL | PreTranslateMessage (MSG *pMsg)
virtual | ~CTbEdit ()

Member Enumeration Documentation

anonymous enum

Enumeration values:
WM_CONTENTCHANGE

Definition at line 21 of file TbEdit.h.

00021 { WM_CONTENTCHANGE = WM_APP + 56};

Constructor & Destructor Documentation

CTbEdit::CTbEdit ( )

Definition at line 17 of file TbEdit.cpp.

00018 {
00019 }

CTbEdit::~CTbEdit ( ) [virtual]

Definition at line 21 of file TbEdit.cpp.

00022 {
00023 }

Member Function Documentation

BOOL CTbEdit::PreTranslateMessage ( MSG * pMsg ) [virtual]

Definition at line 35 of file TbEdit.cpp.

References FALSE, TRUE, and WM_CONTENTCHANGE.

00036 {
00037     if (pMsg->message == WM_KEYDOWN)
00038     {
00039         int nVirtKey = (int) pMsg->wParam;
00040         switch (nVirtKey)
00041         {
00042             case VK_ESCAPE:
00043                 GetOwner()->PostMessage(WM_CONTENTCHANGE, FALSE);
00044                 break;
00045             case VK_RETURN:
00046                 GetOwner()->PostMessage(WM_CONTENTCHANGE, TRUE);
00047                 break;
00048         }
00049     }
00050     return CEdit::PreTranslateMessage(pMsg);
00051 }

The documentation for this class was generated from the following files:
  • WinCvs/TbEdit.h
  • WinCvs/TbEdit.cpp
Generated on Sun Feb 24 01:27:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TBehavior Class Reference

Inheritance diagram for TBehavior:

[legend]
The documentation for this class was generated from the following file:
  • rf/support/macapp/UPseudoSupport.h
Generated on Sun Feb 24 01:27:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TbEntry Class Reference

Inheritance diagram for TbEntry:

[legend]
Collaboration diagram for TbEntry:

[legend]
List of all members.

Public Methods

TbEntry (tbeKind k)
virtual ~TbEntry ()

Public Attributes

tbeKind kind

Constructor & Destructor Documentation

TbEntry::TbEntry ( tbeKind k ) [inline]

Definition at line 82 of file utoolbar.cpp.

References kind, and tbeKind.

00082 : kind(k) {}

virtual TbEntry::~TbEntry ( ) [inline, virtual]

Definition at line 83 of file utoolbar.cpp.

00083 {}

Member Data Documentation

tbeKind TbEntry::kind

Definition at line 85 of file utoolbar.cpp.

Referenced by CDynToolBar::OnDropDownButton, UToolbar::OnSetTooltip, UToolbar::OnUpdateUI, UToolbar::RebuildBar, WININFO::Search, TbEntry, and UToolbar::UDispatchMessage.

The documentation for this class was generated from the following file:
  • rf/utoolbar.cpp
Generated on Sun Feb 24 01:27:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TbEntryButton Class Reference

Inheritance diagram for TbEntryButton:

[legend]
Collaboration diagram for TbEntryButton:

[legend]
List of all members.

Public Methods

TbEntryButton (HBITMAP b, int c, const char *t, UTB_VAR v)
virtual | ~TbEntryButton ()

Public Attributes

awidget wid
bool | ischeck

Constructor & Destructor Documentation

TbEntryButton::TbEntryButton | ( | HBITMAP | b,
 |  | int | c,
 |  | const char * | t,
 |  | UTB_VAR | v
 | ) | [inline]

Definition at line 192 of file utoolbar.cpp.

References ischeck, tbeButton, UTB_VAR, and wid.

00192                                                               :
00193         TbEntry(tbeButton), wid(b, c, t, v), ischeck(false)
00194     {
00195     }

virtual TbEntryButton::~TbEntryButton ( ) [inline, virtual]

Definition at line 196 of file utoolbar.cpp.

00197     {
00198     }

Member Data Documentation

bool TbEntryButton::ischeck

Definition at line 201 of file utoolbar.cpp.

Referenced by UToolbar::RebuildBar, TbEntryButton, and TbEntryChkButton::TbEntryChkButton.

awidget TbEntryButton::wid

Definition at line 200 of file utoolbar.cpp.

Referenced by UToolbar::OnSetTooltip, UToolbar::OnUpdateUI, UToolbar::RebuildBar, WININFO::Search, and TbEntryButton.

The documentation for this class was generated from the following file:
  • rf/utoolbar.cpp
Generated on Sun Feb 24 01:27:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TbEntryChkButton Class Reference

Inheritance diagram for TbEntryChkButton:

[legend]
Collaboration diagram for TbEntryChkButton:

[legend]
List of all members.

Public Methods

TbEntryChkButton (HBITMAP b, int c, const char *t, UTB_VAR v)
virtual ~TbEntryChkButton ()

Constructor & Destructor Documentation

TbEntryChkButton::TbEntryChkButton | ( | HBITMAP | b,
 |  | int | c,
 |  | const char * | t,
 |  | UTB_VAR | v
 | ) | [inline]

Definition at line 207 of file utoolbar.cpp.

References TbEntryButton::ischeck, and UTB_VAR.

00207                                                                  :
00208         TbEntryButton(b, c, t, v)
00209     {
00210         ischeck = true;
00211     }

virtual TbEntryChkButton::~TbEntryChkButton ( ) [inline, virtual]

Definition at line 212 of file utoolbar.cpp.

00213     {
00214     }

The documentation for this class was generated from the following file:
  • rf/utoolbar.cpp
Generated on Sun Feb 24 01:27:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TbEntryDropDown Class Reference

Inheritance diagram for TbEntryDropDown:

[legend]
Collaboration diagram for TbEntryDropDown:

[legend]
List of all members.

Public Methods

TbEntryDropDown ()
virtual | ~TbEntryDropDown ()

Public Attributes

std::vector< awidget > icons
int | current

Constructor & Destructor Documentation

TbEntryDropDown::TbEntryDropDown ( ) [inline]

Definition at line 220 of file utoolbar.cpp.

References current, and tbeDropDown.

00220 : TbEntry(tbeDropDown), current(0) {}

virtual TbEntryDropDown::~TbEntryDropDown ( ) [inline, virtual]

Definition at line 221 of file utoolbar.cpp.

00222     {
00223     }

Member Data Documentation

int TbEntryDropDown::current

Definition at line 226 of file utoolbar.cpp.

Referenced by UToolbar::OnTbDropDown, UToolbar::RebuildBar, TbEntryDropDown, and UToolbar::UDispatchMessage.

std::vector<awidget> TbEntryDropDown::icons

Definition at line 225 of file utoolbar.cpp.

Referenced by CDynToolBar::OnDropDownButton, UToolbar::OnSetTooltip, UToolbar::OnTbDropDown, UToolbar::RebuildBar, and WININFO::Search.

The documentation for this class was generated from the following file:
  • rf/utoolbar.cpp
Generated on Sun Feb 24 01:28:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TbEntrySeparator Class Reference

Inheritance diagram for TbEntrySeparator:

[legend]
Collaboration diagram for TbEntrySeparator:

[legend]
List of all members.

Public Methods

TbEntrySeparator ()
virtual ~TbEntrySeparator ()

Constructor & Destructor Documentation

TbEntrySeparator::TbEntrySeparator ( ) [inline]

Definition at line 232 of file utoolbar.cpp.

References tbeSeparator.

00232 : TbEntry(tbeSeparator) {}

virtual TbEntrySeparator::~TbEntrySeparator ( ) [inline, virtual]

Definition at line 233 of file utoolbar.cpp.

00234     {
00235     }

The documentation for this class was generated from the following file:
  • rf/utoolbar.cpp
Generated on Sun Feb 24 01:28:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TBrowserFill Class Reference

Inheritance diagram for TBrowserFill:

[legend]
Collaboration diagram for TBrowserFill:

[legend]
List of all members.

Public Methods

TBrowserFill (UCvsFolders *treeCtrl, UTREEITEM root, UTREEITEM item, CSortList< ENTNODE > &entries)
virtual | ~TBrowserFill ()
virtual kTraversal | EnterDirectory (const char *fullpath, const char *dirname, const FSSpec *macspec)
virtual kTraversal | ExitDirectory (const char *fullpath)
virtual kTraversal | OnError (const char *err, int errcode)
virtual kTraversal | OnIdle (const char *fullpath)
virtual kTraversal | OnDirectory (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)
TBrowserFill (CTreeCtrl &treeCtrl, HTREEITEM root, HTREEITEM item, CSortList< ENTNODE > &entries)
virtual kTraversal | EnterDirectory (const char *fullpath, const char *dirname, const FSSpec *macspec)
virtual kTraversal | ExitDirectory (const char *fullpath)
virtual kTraversal | OnError (const char *err, int errcode)
virtual kTraversal | OnIdle (const char *fullpath)
virtual kTraversal | OnDirectory (const char *fullpath, const char *fullname, const char *name, const struct wnt_stat &dir, const FSSpec *macspec)

Public Attributes

UTREEITEM m_root
UTREEITEM m_item
UCvsFolders * m_treeCtrl
CSortList< ENTNODE > & m_entries
std::vector< UStr > m_ignlist
HTREEITEM | m_root
HTREEITEM | m_item
CTreeCtrl & m_treeCtrl
bool | m_hascvs
CSortList< ENTNODE > & m_entries
vector< UStr > | m_ignlist
bool | m_isShowIgnored

Constructor & Destructor Documentation

TBrowserFill::TBrowserFill | ( | UCvsFolders * | treeCtrl,
 |  | UTREEITEM | root,
 |  | UTREEITEM | item,
 |  | CSortList< ENTNODE > & | entries
 | ) | [inline]

Definition at line 357 of file UCvsFolders.cpp.

References m_item, m_root, and UTREEITEM.

00357                                                                                                       :
00358             m_root(root), m_item(item), m_treeCtrl(treeCtrl),
00359             m_entries(entries) {}

virtual TBrowserFill::~TBrowserFill ( ) [inline, virtual]

Definition at line 361 of file UCvsFolders.cpp.

00361 {}

TBrowserFill::TBrowserFill | ( | CTreeCtrl & | treeCtrl,
 |  | HTREEITEM | root,
 |  | HTREEITEM | item,
 |  | CSortList< ENTNODE > & | entries
 | ) | [inline]

Definition at line 390 of file WinCvsBrowser.cpp.

References CWincvsApp::GetIgnoreModel, KiIgnoreModel::IsShowIgnored, m_hascvs, m_isShowIgnored, m_item, and m_root.

00390                                                                                                      :
00391             m_root(root), m_item(item), m_treeCtrl(treeCtrl), m_hascvs(false),
00392             m_entries(entries), m_isShowIgnored(false)
00393     {
00394         if (CWincvsApp* app = (CWincvsApp *)AfxGetApp())
00395         {
00396             m_isShowIgnored = app->GetIgnoreModel()->IsShowIgnored();
00397         }
00398     }

Member Function Documentation

virtual kTraversal TBrowserFill::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 400 of file WinCvsBrowser.cpp.

References ASSERT, BuildIgnoredList, Entries_Open, FSSpec, kContinueTraversal, kTraversal, m_ignlist, and m_item.

00401     {
00402         ASSERT(m_item != 0L);
00403
00404         Entries_Open (m_entries, fullpath);
00405         BuildIgnoredList(m_ignlist, fullpath);
00406
00407         return kContinueTraversal;
00408     }

virtual kTraversal TBrowserFill::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 363 of file UCvsFolders.cpp.

References ASSERT, BuildIgnoredList, Entries_Open, FSSpec, kContinueTraversal, kTraversal, and m_item.

00364     {
00365         ASSERT(m_item != 0L);
00366
00367         // assign the entries to this item
00368         Entries_Open (m_entries, fullpath);
00369         BuildIgnoredList(m_ignlist, fullpath);
00370
00371         return kContinueTraversal;
00372     }

virtual kTraversal TBrowserFill::ExitDirectory ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 410 of file WinCvsBrowser.cpp.

References kContinueTraversal, kTraversal, m_hascvs, m_ignlist, m_item, and SetIcon.

00411     {
00412         m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00413         SetIcon(m_treeCtrl, m_item, m_hascvs, true,
00414             (EntnodeData *)m_treeCtrl.GetItemData(m_item));
00415         return kContinueTraversal;
00416     }

virtual kTraversal TBrowserFill::ExitDirectory ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 374 of file UCvsFolders.cpp.

References UTREE_INFO::data, EV_TREE_GETINFO, EV_TREE_SETICON, GetIcon, UCmdTarget::GetWidID, UTREE_INFO::icon, UTREE_INFO::item, kContinueTraversal, kTraversal, kUMainWidget, m_item, and UEventSendMessage.

00375     {
00376         m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00377
00378         UTREE_INFO query;
00379         query.item = m_item;
00380         UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00381         query.icon = GetIcon(m_treeCtrl, m_item, true /*ignored*/, true, (EntnodeData *)query.data);
00382         UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_SETICON, kUMainWidget, &query);
00383
00384         return kContinueTraversal;
00385     }

virtual kTraversal TBrowserFill::OnDirectory | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct wnt_stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Definition at line 428 of file WinCvsBrowser.cpp.

References Entries_SetVisited, FileTraverse, FSSpec, EntnodeData::IsIgnored, kSkipFile, kTraversal, m_hascvs, m_ignlist, m_isShowIgnored, TBrowserFillDummy::m_item, m_item, SetIcon, stat, and stricmp.

00432     {
00433         if(stricmp(name, "cvs") == 0)
00434         {
00435             m_hascvs = true;
00436             return kSkipFile;
00437         }
00438
00439         // is the sub-directory ignored ?
00440         EntnodeData *data = Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00441         if(!m_isShowIgnored && data->IsIgnored())
00442             return kSkipFile;
00443
00444         // create the item for the sub-directory
00445         TBrowserFillDummy traverse(m_treeCtrl, m_item, 0L, data);
00446         kTraversal res = FileTraverse(fullname, traverse);
00447
00448         // assign the icon regarding our Entries info
00449         if(traverse.m_item != 0L)
00450         {
00451             SetIcon(m_treeCtrl, traverse.m_item, m_hascvs, false, data);
00452         }
00453
00454         return kSkipFile;
00455     }

virtual kTraversal TBrowserFill::OnDirectory | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 397 of file UCvsFolders.cpp.

References Entries_SetVisited, EV_TREE_SETICON, FileTraverse, FSSpec, GetIcon, UCmdTarget::GetWidID, UTREE_INFO::icon, EntnodeData::IsIgnored, UTREE_INFO::item, kSkipFile, kTraversal, kUMainWidget, TBrowserFillDummy::m_item, m_item, stat, stricmp, and UEventSendMessage.

00401     {
00402 #if qUnix
00403         if(strcmp(name, "CVS") == 0)
00404 #else
00405         if(stricmp(name, "cvs") == 0)
00406 #endif
00407             return kSkipFile;
00408
00409         // is the sub-directory ignored ?
00410         EntnodeData *data = Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00411         if(!(bool)gFileViewIgnore && data->IsIgnored())
00412             return kSkipFile;
00413
00414         // create the item for the sub-directory
00415         TBrowserFillDummy traverse(m_treeCtrl, m_item, 0L, data);
00416         /*kTraversal res = */FileTraverse(fullname, traverse);
00417
00418         // assign the icon regarding our Entries info
00419         if(traverse.m_item != 0L)
00420         {
00421             UTREE_INFO query;
00422             query.item = traverse.m_item;
00423             query.icon = GetIcon(m_treeCtrl, m_item, true /*ignored*/, false, data);
00424             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_SETICON, kUMainWidget, &query);
00425         }
00426
00427         return kSkipFile;
00428     }

virtual kTraversal TBrowserFill::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 418 of file WinCvsBrowser.cpp.

References err, kTraversal, and kTraversalError.

00419     {
00420         return kTraversalError;
00421     }

virtual kTraversal TBrowserFill::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 387 of file UCvsFolders.cpp.

References err, kTraversal, and kTraversalError.

00388     {
00389         return kTraversalError;
00390     }

virtual kTraversal TBrowserFill::OnIdle ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 423 of file WinCvsBrowser.cpp.

References kContinueTraversal, and kTraversal.

00424     {
00425         return kContinueTraversal;
00426     }

virtual kTraversal TBrowserFill::OnIdle ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 392 of file UCvsFolders.cpp.

References kContinueTraversal, and kTraversal.

00393     {
00394         return kContinueTraversal;
00395     }

Member Data Documentation

CSortList<ENTNODE>& TBrowserFill::m_entries

Definition at line 386 of file WinCvsBrowser.cpp.

CSortList<ENTNODE>& TBrowserFill::m_entries

Definition at line 354 of file UCvsFolders.cpp.

bool TBrowserFill::m_hascvs

Definition at line 385 of file WinCvsBrowser.cpp.

Referenced by ExitDirectory, OnDirectory, and TBrowserFill.

vector< UStr > TBrowserFill::m_ignlist

Definition at line 387 of file WinCvsBrowser.cpp.

std::vector<UStr> TBrowserFill::m_ignlist

Definition at line 355 of file UCvsFolders.cpp.

Referenced by EnterDirectory, ExitDirectory, and OnDirectory.

bool TBrowserFill::m_isShowIgnored

Definition at line 388 of file WinCvsBrowser.cpp.

Referenced by OnDirectory, and TBrowserFill.

HTREEITEM TBrowserFill::m_item

Definition at line 383 of file WinCvsBrowser.cpp.

UTREEITEM TBrowserFill::m_item

Definition at line 352 of file UCvsFolders.cpp.

Referenced by EnterDirectory, ExitDirectory, OnDirectory, and TBrowserFill.

HTREEITEM TBrowserFill::m_root

Definition at line 382 of file WinCvsBrowser.cpp.

UTREEITEM TBrowserFill::m_root

Definition at line 351 of file UCvsFolders.cpp.

Referenced by TBrowserFill.

CTreeCtrl& TBrowserFill::m_treeCtrl

Definition at line 384 of file WinCvsBrowser.cpp.

UCvsFolders* TBrowserFill::m_treeCtrl

Definition at line 353 of file UCvsFolders.cpp.

The documentation for this class was generated from the following files:
  • common/UCvsFolders.cpp
  • WinCvs/WinCvsBrowser.cpp
Generated on Sun Feb 24 01:28:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TBrowserFillDummy Class Reference

Inheritance diagram for TBrowserFillDummy:

[legend]
Collaboration diagram for TBrowserFillDummy:

[legend]
List of all members.

Public Methods

TBrowserFillDummy (UCvsFolders *treeCtrl, UTREEITEM root, UTREEITEM item, EntnodeData *data)
virtual | ~TBrowserFillDummy ()
virtual kTraversal | EnterDirectory (const char *fullpath, const char *dirname, const FSSpec *macspec)
virtual kTraversal | ExitDirectory (const char *fullpath)
virtual kTraversal | OnError (const char *err, int errcode)
virtual kTraversal | OnIdle (const char *fullpath)
virtual kTraversal | OnDirectory (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)
TBrowserFillDummy (CTreeCtrl &treeCtrl, HTREEITEM root, HTREEITEM item, EntnodeData *data)
virtual kTraversal | EnterDirectory (const char *fullpath, const char *dirname, const FSSpec *macspec)
virtual kTraversal | ExitDirectory (const char *fullpath)
virtual kTraversal | OnError (const char *err, int errcode)
virtual kTraversal | OnIdle (const char *fullpath)
virtual kTraversal | OnDirectory (const char *fullpath, const char *fullname, const char *name, const struct wnt_stat &dir, const FSSpec *macspec)

Public Attributes

UTREEITEM m_root
UTREEITEM m_item
UCvsFolders * m_treeCtrl
bool | m_empty
bool | m_hascvs
EntnodeData * m_data
UStr m_dirname
HTREEITEM | m_root
HTREEITEM | m_item
CTreeCtrl & m_treeCtrl
EntnodeData * m_data

Constructor & Destructor Documentation

TBrowserFillDummy::TBrowserFillDummy | ( | UCvsFolders * | treeCtrl,
 |  | UTREEITEM | root,
 |  | UTREEITEM | item,
 |  | EntnodeData * | data
 | ) | [inline]

Definition at line 248 of file UCvsFolders.cpp.

References m_empty, m_hascvs, m_item, m_root, and UTREEITEM.

00248                                                                                                 :
00249         m_root(root), m_item(item), m_treeCtrl(treeCtrl), m_empty(true),
00250         m_hascvs(false), m_data(data) {}

virtual TBrowserFillDummy::~TBrowserFillDummy ( ) [inline, virtual]

Definition at line 252 of file UCvsFolders.cpp.

00252 {}

TBrowserFillDummy::TBrowserFillDummy | ( | CTreeCtrl & | treeCtrl,
 |  | HTREEITEM | root,
 |  | HTREEITEM | item,
 |  | EntnodeData * | data
 | ) | [inline]

Definition at line 297 of file WinCvsBrowser.cpp.

References m_empty, m_hascvs, m_item, and m_root.

00297                                                                                                :
00298         m_root(root), m_item(item), m_treeCtrl(treeCtrl), m_empty(true),
00299         m_data(data), m_hascvs(false) {}

Member Function Documentation

virtual kTraversal TBrowserFillDummy::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 301 of file WinCvsBrowser.cpp.

References FSSpec, kContinueTraversal, kIconFolderClosed, kTraversal, m_item, m_root, EntnodeData::Ref, and EntnodeData::UnRef.

00302     {
00303         if(m_item == 0L)
00304         {
00305             TV_INSERTSTRUCT tvstruct;
00306             tvstruct.hParent = m_root;
00307             tvstruct.hInsertAfter = TVI_SORT;
00308             tvstruct.item.iImage = kIconFolderClosed;
00309             tvstruct.item.iSelectedImage = kIconFolderClosed;
00310             tvstruct.item.pszText = (char *)dirname;
00311             tvstruct.item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT;
00312             m_item = m_treeCtrl.InsertItem(&tvstruct);
00313         }
00314
00315         // assign the entries to this item
00316         if(m_data != 0L)
00317         {
00318             EntnodeData *data = (EntnodeData *)m_treeCtrl.GetItemData(m_item);
00319
00320             if(m_data != 0L)
00321                 m_data->Ref();
00322             m_treeCtrl.SetItemData(m_item, (long)m_data);
00323
00324             if(data != 0L)
00325                 data->UnRef();
00326         }
00327         else
00328             m_data = (EntnodeData *)m_treeCtrl.GetItemData(m_item);
00329
00330         return kContinueTraversal;
00331     }

virtual kTraversal TBrowserFillDummy::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 254 of file UCvsFolders.cpp.

References UStr::empty, FSSpec, kContinueTraversal, and kTraversal.

00255     {
00256         m_dirname = dirname;
00257 #if qUnix
00258         if(m_dirname.empty())
00259             m_dirname = fullpath; // '/'
00260 #endif
00261         return kContinueTraversal;
00262     }

virtual kTraversal TBrowserFillDummy::ExitDirectory ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 333 of file WinCvsBrowser.cpp.

References gDummyFile, kContinueTraversal, kTraversal, m_hascvs, m_item, and SetIcon.

00334     {
00335         SetIcon(m_treeCtrl, m_item, m_hascvs, false, m_data);
00336
00337         if(m_empty)
00338             return kContinueTraversal;
00339
00340         // add a dummy item to simulate the folder
00341         // is not empty. This dummy item will be
00342         // replaced by a complete listing when the
00343         // node is expanding...
00344         TV_INSERTSTRUCT tvstruct;
00345         tvstruct.hParent = m_item;
00346         tvstruct.hInsertAfter = TVI_SORT;
00347         tvstruct.item.pszText = (char *)gDummyFile;
00348         tvstruct.item.mask = TVIF_TEXT;
00349         m_treeCtrl.InsertItem(&tvstruct);
00350
00351         return kContinueTraversal;
00352     }

virtual kTraversal TBrowserFillDummy::ExitDirectory ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 264 of file UCvsFolders.cpp.

References UTREE_INFO::data, UTREE_INSERT::data, EV_TREE_GETINFO, EV_TREE_INSERT, EV_TREE_SETDATA, gDummyFile, GetIcon, UCmdTarget::GetWidID, UTREE_INSERT::icon, UTREE_INFO::item, kContinueTraversal, kTraversal, kUMainWidget, m_hascvs, m_item, m_root, UTREE_INSERT::parent, EntnodeData::Ref, UTREE_INSERT::result, UTREE_INSERT::title, UEventSendMessage, and EntnodeData::UnRef.

00265     {
00266         if(m_item == 0L)
00267         {
00268             UTREE_INSERT insert;
00269             insert.parent = m_root;
00270             insert.icon = GetIcon(m_treeCtrl, m_item, m_hascvs, false, m_data);
00271             insert.title = m_dirname;
00272             insert.data = 0L;
00273             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_INSERT, kUMainWidget, &insert);
00274             m_item = insert.result;
00275         }
00276
00277         // assign the entries to this item
00278         UTREE_INFO query;
00279         query.item = m_item;
00280         if(m_data != 0L)
00281         {
00282             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00283             EntnodeData *data = (EntnodeData *)query.data;
00284
00285             if(m_data != 0L)
00286                 m_data->Ref();
00287
00288             query.data = m_data;
00289             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_SETDATA, kUMainWidget, &query);
00290
00291             if(data != 0L)
00292                 data->UnRef();
00293         }
00294         else
00295         {
00296             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00297             m_data = (EntnodeData *)query.data;
00298         }
00299
00300         if(m_empty)
00301             return kContinueTraversal;
00302
00303         // add a dummy item to simulate the folder
00304         // is not empty. This dummy item will be
00305         // replaced by a complete listing when the
00306         // node is expanding...
00307
00308         UTREE_INSERT insert;
00309         insert.parent = m_item;
00310         insert.icon = 0L;
00311         insert.title = gDummyFile;
00312         insert.data = 0L;
00313         UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_INSERT, kUMainWidget, &insert);
00314
00315         return kContinueTraversal;
00316     }

virtual kTraversal TBrowserFillDummy::OnDirectory | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct wnt_stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Definition at line 364 of file WinCvsBrowser.cpp.

References FSSpec, kSkipFile, kTraversal, m_empty, m_hascvs, stat, and stricmp.

00368     {
00369         if(stricmp(name, "cvs") == 0)
00370             m_hascvs = true;
00371         else
00372             m_empty = false;
00373         return kSkipFile;
00374     }

virtual kTraversal TBrowserFillDummy::OnDirectory | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 328 of file UCvsFolders.cpp.

References FSSpec, kSkipFile, kTraversal, m_empty, m_hascvs, stat, and stricmp.

00332     {
00333 #if qUnix
00334         if(strcmp(name, "CVS") == 0)
00335 #else
00336         if(stricmp(name, "cvs") == 0)
00337 #endif
00338             m_hascvs = true;
00339         else
00340             m_empty = false;
00341
00342         return kSkipFile;
00343     }

virtual kTraversal TBrowserFillDummy::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 354 of file WinCvsBrowser.cpp.

References err, kTraversal, and kTraversalError.

00355     {
00356         return kTraversalError;
00357     }

virtual kTraversal TBrowserFillDummy::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 318 of file UCvsFolders.cpp.

References err, kTraversal, and kTraversalError.

00319     {
00320         return kTraversalError;
00321     }

virtual kTraversal TBrowserFillDummy::OnIdle ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 359 of file WinCvsBrowser.cpp.

References kContinueTraversal, and kTraversal.

00360     {
00361         return kContinueTraversal;
00362     }

virtual kTraversal TBrowserFillDummy::OnIdle ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 323 of file UCvsFolders.cpp.

References kContinueTraversal, and kTraversal.

00324     {
00325         return kContinueTraversal;
00326     }

Member Data Documentation

EntnodeData* TBrowserFillDummy::m_data

Definition at line 295 of file WinCvsBrowser.cpp.

EntnodeData* TBrowserFillDummy::m_data

Definition at line 245 of file UCvsFolders.cpp.

UStr TBrowserFillDummy::m_dirname

Definition at line 246 of file UCvsFolders.cpp.

bool TBrowserFillDummy::m_empty

Definition at line 293 of file WinCvsBrowser.cpp.

Referenced by OnDirectory, and TBrowserFillDummy.

bool TBrowserFillDummy::m_hascvs

Definition at line 294 of file WinCvsBrowser.cpp.

Referenced by ExitDirectory, OnDirectory, and TBrowserFillDummy.

HTREEITEM TBrowserFillDummy::m_item

Definition at line 291 of file WinCvsBrowser.cpp.

UTREEITEM TBrowserFillDummy::m_item

Definition at line 241 of file UCvsFolders.cpp.

Referenced by EnterDirectory, ExitDirectory, TBrowserFill::OnDirectory, UCvsFolders::ResetBrowser, and TBrowserFillDummy.

HTREEITEM TBrowserFillDummy::m_root

Definition at line 290 of file WinCvsBrowser.cpp.

UTREEITEM TBrowserFillDummy::m_root

Definition at line 240 of file UCvsFolders.cpp.

Referenced by EnterDirectory, ExitDirectory, and TBrowserFillDummy.

CTreeCtrl& TBrowserFillDummy::m_treeCtrl

Definition at line 292 of file WinCvsBrowser.cpp.

UCvsFolders* TBrowserFillDummy::m_treeCtrl

Definition at line 242 of file UCvsFolders.cpp.

The documentation for this class was generated from the following files:
  • common/UCvsFolders.cpp
  • WinCvs/WinCvsBrowser.cpp
Generated on Sun Feb 24 01:28:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TBuggyPopup Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for TBuggyPopup:

[legend]
Collaboration diagram for TBuggyPopup:

[legend]
List of all members.

Protected Attributes

int | fRealWidth

Private Methods

TBuggyPopup ()
virtual | ~TBuggyPopup ()
virtual void | ReadFields (CStream_AC *aStream)
virtual void | WriteFields (CStream_AC *aStream) const
virtual void | DoPostCreate (TDocument *itsDocument)

Private Attributes

MA_DECLARE_CLASS

Constructor & Destructor Documentation

TBuggyPopup::TBuggyPopup ( ) [private]

Definition at line 541 of file UPseudoSupport.cpp.

00542 {
00543 }

TBuggyPopup::~TBuggyPopup ( ) [private, virtual]

Definition at line 545 of file UPseudoSupport.cpp.

00546 {
00547 }

Member Function Documentation

void TBuggyPopup::DoPostCreate ( TDocument * itsDocument ) [private, virtual]

Definition at line 563 of file UPseudoSupport.cpp.

References fRealWidth.

00564 {
00565     if(fRealWidth > 0)
00566     {
00567         CViewRect r = GetExtent();
00568         Resize(CViewPoint(fRealWidth, r.Height()), true);
00569     }
00570 }

void TBuggyPopup::ReadFields ( CStream_AC * aStream ) [private, virtual]

Definition at line 549 of file UPseudoSupport.cpp.

References fRealWidth.

00550 {
00551     Inherited::ReadFields(aStream);
00552
00553     *aStream >> fRealWidth;
00554 }

void TBuggyPopup::WriteFields ( CStream_AC * aStream ) const [private, virtual]

Definition at line 556 of file UPseudoSupport.cpp.

References fRealWidth.

00557 {
00558     Inherited::WriteFields(aStream);
00559
00560     *aStream << fRealWidth;
00561 }

Member Data Documentation

int TBuggyPopup::fRealWidth [protected]

Definition at line 24 of file UPseudoSupport.h.

Referenced by DoPostCreate, ReadFields, and WriteFields.

TBuggyPopup::MA_DECLARE_CLASS [private]

Definition at line 15 of file UPseudoSupport.h.

The documentation for this class was generated from the following files:
  • rf/support/macapp/UPseudoSupport.h
  • rf/support/macapp/UPseudoSupport.cpp
Generated on Sun Feb 24 01:28:03 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CTcl_Interp Class Reference

#include <TclGlue.h>

Collaboration diagram for CTcl_Interp:

[legend]
List of all members.

Public Methods

CTcl_Interp ()
~CTcl_Interp ()
kTclRes | DoScriptVar (const char *format,...)
kTclRes | DoScript (const char *script)
kTclRes | DoFile (const char *file)
operator Tcl_Interp * (void)
int | GetCvsLastErrorCode ()
void | SetCvsLastErrorCode (int value)
bool | GetCvsExitOnError ()
void | SetCvsExitOnError (bool value)

Static Public Methods

bool | IsAvail (void)
void | Unixfy (UStr &path)
void | Deunixfy (UStr &path)

Protected Attributes

Tcl_Interp * | fInterp
int | fLastErrorCode
bool | fExitOnError

Constructor & Destructor Documentation

CTcl_Interp::CTcl_Interp ( )

Definition at line 942 of file TclGlue.cpp.

References _TCL_CALLBACK, CStr, cvs_err, fExitOnError, fInterp, fLastErrorCode, IsAvail, MacrosGetLoc, myTcl_CreateInterp, Tcl_CreateCommand, Tcl_Init, Tcl_SetVar, Tcl_SourceRCFile, tclCvsBrowserProc, tclCvsEntriesProc, tclCvsErrProc, tclCvsExitOnErrorProc, tclCvsLastErrorCodeProc, tclCvsOutProc, tclCvsProc, tclDirProc, tclGetDebugMaskProc, tclGetFileModTimeProc, tclHelpProc, tclSafeRemove, and tclSetDebugMaskProc.

00943 {
00944     fInterp = 0L;
00945
00946     fExitOnError = true;
00947     fLastErrorCode = 0;
00948
00949 #if USE_TCL
00950     if(!CTcl_Interp::IsAvail())
00951     {
00952         cvs_err("TCL is not available !\n");
00953         return;
00954     }
00955
00956     fInterp = myTcl_CreateInterp();
00957     if(fInterp == 0L)
00958     {
00959         cvs_err("Unable to create a new TCL interpreter !\n");
00960         return;
00961     }
00962
00963     Tcl_Command cmd;
00964
00965     // this parameter is used to get access to CTcl_Interp::SetCvsLastErrorCode
00966     // in tclCvsProc method
00967     cmd = Tcl_CreateCommand (fInterp, "cvs", _TCL_CALLBACK(tclCvsProc),
00968         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
00969
00970     cmd = Tcl_CreateCommand (fInterp, "help", _TCL_CALLBACK(tclHelpProc),
00971         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00972     cmd = Tcl_CreateCommand (fInterp, "cvsout", _TCL_CALLBACK(tclCvsOutProc),
00973         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00974     cmd = Tcl_CreateCommand (fInterp, "cvserr", _TCL_CALLBACK(tclCvsErrProc),
00975         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00976     cmd = Tcl_CreateCommand (fInterp, "cvsbrowser", _TCL_CALLBACK(tclCvsBrowserProc),
00977         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00978     cmd = Tcl_CreateCommand (fInterp, "cvsentries", _TCL_CALLBACK(tclCvsEntriesProc),
00979         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00980 #ifdef WIN32
00981     cmd = Tcl_CreateCommand (fInterp, "ls", _TCL_CALLBACK(tclDirProc),
00982         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00983     cmd = Tcl_CreateCommand (fInterp, "dir", _TCL_CALLBACK(tclDirProc),
00984         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00985 #endif /* WIN32 */
00986     cmd = Tcl_CreateCommand (fInterp, "trash", _TCL_CALLBACK(tclSafeRemove),
00987         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00988
00989     cmd = Tcl_CreateCommand (fInterp, "cvsexitonerror", _TCL_CALLBACK(tclCvsExitOnErrorProc),
00990         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
00991
00992     cmd = Tcl_CreateCommand (fInterp, "cvslasterrorcode", _TCL_CALLBACK(tclCvsLastErrorCodeProc),
00993         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
00994 #if defined(WIN32)
00995     cmd = Tcl_CreateCommand (fInterp, "cvssetdebugmask", _TCL_CALLBACK(tclSetDebugMaskProc),
00996         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
00997     cmd = Tcl_CreateCommand (fInterp, "cvsgetdebugmask", _TCL_CALLBACK(tclGetDebugMaskProc),
00998         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
00999     cmd = Tcl_CreateCommand (fInterp, "cvsfilemodtime", _TCL_CALLBACK(tclGetFileModTimeProc),
01000         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
01001 #endif  // defined(WIN32)
01002
01003     CStr rcfile;
01004     MacrosGetLoc(rcfile);
01005     if(!rcfile.endsWith(kPathDelimiter))
01006         rcfile << kPathDelimiter;
01007     rcfile << "startup.tcl";
01008     Tcl_SetVar(fInterp, "tcl_rcFileName", rcfile, TCL_GLOBAL_ONLY);
01009     Tcl_SetVar(fInterp, "tcl_interactive", "1", TCL_GLOBAL_ONLY);
01010     Tcl_Init(fInterp);
01011     Tcl_SourceRCFile(fInterp);
01012 #endif
01013 }

CTcl_Interp::~CTcl_Interp ( )

Definition at line 1015 of file TclGlue.cpp.

References fInterp, and Tcl_DeleteInterp.

01016 {
01017 #if USE_TCL
01018     if(fInterp != 0L)
01019         Tcl_DeleteInterp(fInterp);
01020 #endif
01021 }

Member Function Documentation

void CTcl_Interp::Deunixfy ( UStr & path ) [static]

Definition at line 1227 of file TclGlue.cpp.

References CStr, and kTCLPathDelimiter.

Referenced by CTCLBrowserEnt::GetNormalized, CTCLBrowserEnt::IsSamePath, tclCvsEntriesProc, and tclSafeRemove.

01228 {
01229     char *ptr = path;
01230     while((ptr = strchr(ptr, kTCLPathDelimiter)) != 0L)
01231     {
01232         *ptr++ = kPathDelimiter;
01233     }
01234 }

kTclRes CTcl_Interp::DoFile ( const char * file )

Definition at line 1186 of file TclGlue.cpp.

References cvs_errstr, cvs_outstr, fInterp, kTclRes, TCL_ERROR, and Tcl_EvalFile.

01187 {
01188 #if USE_TCL
01189     if(fInterp == 0L)
01190         return false;
01191
01192     int exitc = Tcl_EvalFile(fInterp, (char *)file);
01193     size_t len = strlen(fInterp->result);
01194     if(exitc == TCL_ERROR)
01195     {
01196         cvs_errstr(fInterp->result, len);
01197         if(len != 0 && fInterp->result[len - 1] != '\n')
01198             cvs_errstr("\n", 1);
01199     }
01200     else
01201     {
01202         cvs_outstr(fInterp->result, len);
01203         if(len != 0 && fInterp->result[len - 1] != '\n')
01204             cvs_outstr("\n", 1);
01205     }
01206
01207     return exitc;
01208 #else
01209     return false;
01210 #endif
01211 }

kTclRes CTcl_Interp::DoScript ( const char * script )

Definition at line 1128 of file TclGlue.cpp.

References cvs_errstr, cvs_outstr, fInterp, kTclRes, TCL_ERROR, and Tcl_Eval.

Referenced by DoScriptVar, and CWincvsView::OnKeyDown.

01129 {
01130 #if USE_TCL
01131     bool bTclFileStarted;
01132
01133     if(fInterp == 0L)
01134         return false;
01135
01136     // If script cmd begins with "source " then this
01137     // must be TCL file execution.
01138     bTclFileStarted = (strncmp(script, "source ", 7) == 0);
01139     if(bTclFileStarted)
01140         gCvsPrefs.SetTclFileRunning(true);
01141
01142     int exitc = Tcl_Eval(fInterp, (char *)script);
01143
01144     if(bTclFileStarted)
01145         gCvsPrefs.SetTclFileRunning(false);
01146
01147     size_t len = strlen(fInterp->result);
01148     if(exitc == TCL_ERROR)
01149     {
01150         cvs_errstr(fInterp->result, len);
01151         if(len != 0 && fInterp->result[len - 1] != '\n')
01152             cvs_errstr("\n", 1);
01153     }
01154     else
01155     {
01156         cvs_outstr(fInterp->result, len);
01157         if(len != 0 && fInterp->result[len - 1] != '\n')
01158             cvs_outstr("\n", 1);
01159     }
01160
01161     return exitc;
01162 #else
01163     return false;
01164 #endif
01165 }

kTclRes CTcl_Interp::DoScriptVar | ( | const char * | format,
 |  | ... |
 | ) |

Definition at line 1167 of file TclGlue.cpp.

References DoScript, fInterp, and kTclRes.

Referenced by CvsCmdMacrosAdmin, cvsgui_LaunchTclMacro, UCvsFolders::OnCmdMacrosSel, and UCvsFiles::OnMacroSel.

01168 {
01169 #if USE_TCL
01170     if(fInterp == 0L)
01171         return false;
01172
01173     va_list args;
01174     char script[1024] = {'\0'};
01175
01176     va_start (args, format);
01177     vsprintf (script, format, args);
01178     va_end (args);
01179
01180     return DoScript(script);
01181 #else
01182     return false;
01183 #endif
01184 }

bool CTcl_Interp::GetCvsExitOnError ( ) [inline]

Definition at line 68 of file TclGlue.h.

References fExitOnError.

Referenced by tclCvsProc.

00068 { return fExitOnError; }

int CTcl_Interp::GetCvsLastErrorCode ( ) [inline]

Definition at line 65 of file TclGlue.h.

References fLastErrorCode.

Referenced by tclCvsLastErrorCodeProc.

00065 { return fLastErrorCode; }

bool CTcl_Interp::IsAvail ( void ) [static]

Definition at line 1023 of file TclGlue.cpp.

References CompatConnectID, CompatLoadLibrary, findTcl, myTcl_CreateInterp, Tcl_Alloc, Tcl_AppendResult, Tcl_Concat, Tcl_CreateCommand, Tcl_CreateInterp, Tcl_DeleteInterp, Tcl_DStringAppendElement, Tcl_DStringEndSublist, Tcl_DStringFree, Tcl_DStringInit, Tcl_DStringResult, Tcl_DStringStartSublist, Tcl_Eval, Tcl_EvalFile, Tcl_ExprLong, Tcl_FindExecutable, Tcl_Free, Tcl_Init, Tcl_ListObjAppendElement, Tcl_NewListObj, Tcl_NewStringObj, Tcl_Realloc, Tcl_SetObjResult, Tcl_SetResult, Tcl_SetVar, Tcl_SetVar2, Tcl_SourceRCFile, and TclFreeObj.

Referenced by CTcl_Interp, CvsCmdMacrosAdmin, cvsgui_LaunchTclMacro, CWincvsApp::InitInstance, UCvsFrame::OnCmdUIMacroAdmin, UCvsFiles::OnCmdUIMacroSel, UCvsFolders::OnCmdUIMacrosSel, CWincvsView::OnKeyDown, CWincvsDoc::OnUpdateMacroAdmin, CWincvsDoc::OnUpdateUseTclshell, and UCvsApp::SayWelcome.

01024 {
01025 #if USE_TCL
01026 #if defined(macintosh) && !qCarbon
01027     return Tcl_CreateInterp != 0L;
01028 #else /* !macintosh */
01029     static bool firstTime = true;
01030     static bool tclAvail = false;
01031     if(firstTime)
01032     {
01033 #   if defined(WIN32) || qCarbon
01034         CompatConnectID connID;
01035 #   endif
01036
01037 #   ifdef WIN32
01038         extern char *findTcl (char *_minVer, int _exact, int _dbgOnly);
01039         char *tclver = 0L;
01040         try
01041         {
01042             tclver = findTcl("8.1", 0, 0);
01043         }
01044         catch(...)
01045         {
01046         }
01047
01048         if(tclver != 0L)
01049             tclAvail = CompatLoadLibrary(&connID, tclver) != 0;
01050
01051         if(!tclAvail)
01052             tclAvail = CompatLoadLibrary(&connID, "tcl87.dll") != 0 ||
01053             CompatLoadLibrary(&connID, "tcl86.dll") != 0 ||
01054             CompatLoadLibrary(&connID, "tcl85.dll") != 0 ||
01055             CompatLoadLibrary(&connID, "tcl84.dll") != 0 ||
01056             CompatLoadLibrary(&connID, "tcl83.dll") != 0 ||
01057             CompatLoadLibrary(&connID, "tcl82.dll") != 0 ||
01058             CompatLoadLibrary(&connID, "tcl81.dll") != 0;
01059 #   endif
01060
01061 #   if qCarbon
01062         if (UEnvironment::GetOSVersion() >= 0x1000)
01063             tclAvail = CompatLoadLibrary(&connID, "/System/Library/Frameworks/Tcl.framework");
01064         else
01065             tclAvail = CompatLoadLibrary(&connID, "tcl8.3");
01066 #   endif
01067
01068 #   if defined(WIN32) || qCarbon
01069 #   define LOAD_CODEFRAG(name) \
01070         if(tclAvail) \
01071             tclAvail = (*(void **)&name##_glue = \
01072                 _CompatCallLibrary(connID, #name)) != 0L
01073 #   endif
01074 #   if defined(WIN32) || TARGET_API_MAC_CARBON
01075         LOAD_CODEFRAG(Tcl_CreateCommand);
01076         LOAD_CODEFRAG(Tcl_CreateInterp);
01077         LOAD_CODEFRAG(Tcl_AppendResult);
01078         LOAD_CODEFRAG(Tcl_SetResult);
01079         LOAD_CODEFRAG(Tcl_DeleteInterp);
01080         LOAD_CODEFRAG(Tcl_Eval);
01081         LOAD_CODEFRAG(Tcl_EvalFile);
01082         LOAD_CODEFRAG(Tcl_Alloc);
01083         LOAD_CODEFRAG(Tcl_Free);
01084         LOAD_CODEFRAG(Tcl_Realloc);
01085         LOAD_CODEFRAG(Tcl_ExprLong);
01086         LOAD_CODEFRAG(Tcl_Concat);
01087         LOAD_CODEFRAG(Tcl_SetVar2);
01088         LOAD_CODEFRAG(Tcl_DStringStartSublist);
01089         LOAD_CODEFRAG(Tcl_DStringEndSublist);
01090         LOAD_CODEFRAG(Tcl_DStringFree);
01091         LOAD_CODEFRAG(Tcl_DStringInit);
01092         LOAD_CODEFRAG(Tcl_DStringResult);
01093         LOAD_CODEFRAG(Tcl_DStringAppendElement);
01094         LOAD_CODEFRAG(TclFreeObj);
01095         LOAD_CODEFRAG(Tcl_SetObjResult);
01096         LOAD_CODEFRAG(Tcl_NewStringObj);
01097         LOAD_CODEFRAG(Tcl_NewListObj);
01098         LOAD_CODEFRAG(Tcl_ListObjAppendElement);
01099         LOAD_CODEFRAG(Tcl_SourceRCFile);
01100         LOAD_CODEFRAG(Tcl_Init);
01101         LOAD_CODEFRAG(Tcl_SetVar);
01102         LOAD_CODEFRAG(Tcl_FindExecutable);
01103
01104         if(!tclAvail)
01105             return false;
01106 #   endif /* WIN32 */
01107
01108         Tcl_Interp *interp = myTcl_CreateInterp();
01109         tclAvail = interp != 0L;
01110         if (!tclAvail)
01111             return false;
01112
01113         Tcl_Init(interp);
01114
01115         /* Destroy the interp we needed just for this */
01116         Tcl_DeleteInterp(interp);
01117
01118         firstTime = false;
01119     }
01120
01121     return tclAvail;
01122 #endif /* !macintosh */
01123 #else
01124     return false;
01125 #endif
01126 }

CTcl_Interp::operator Tcl_Interp * ( void ) [inline]

Definition at line 63 of file TclGlue.h.

References fInterp.

00063 {return fInterp;}

void CTcl_Interp::SetCvsExitOnError ( bool value ) [inline]

Definition at line 69 of file TclGlue.h.

References fExitOnError.

Referenced by tclCvsExitOnErrorProc.

00069 { fExitOnError = value; }

void CTcl_Interp::SetCvsLastErrorCode ( int value ) [inline]

Definition at line 66 of file TclGlue.h.

References fLastErrorCode.

Referenced by tclCvsLastErrorCodeProc, and tclCvsProc.

00066 { fLastErrorCode = value; }

void CTcl_Interp::Unixfy ( UStr & path ) [static]

Definition at line 1213 of file TclGlue.cpp.

References CStr, and kTCLPathDelimiter.

Referenced by CvsCmdMacrosAdmin, cvsgui_LaunchTclMacro, UCvsFolders::OnCmdMacrosSel, UCvsFiles::OnMacroSel, and tclCvsBrowserProc.

01214 {
01215     char *ptr = path;
01216     while((ptr = strchr(ptr, kPathDelimiter)) != 0L)
01217     {
01218         *ptr++ = kTCLPathDelimiter;
01219     }
01220     ptr = (char *)path + path.length() - 1;
01221     if(*ptr == kTCLPathDelimiter)
01222     {
01223         *ptr = '\0';
01224     }
01225 }

Member Data Documentation

bool CTcl_Interp::fExitOnError [protected]

Definition at line 78 of file TclGlue.h.

Referenced by CTcl_Interp, GetCvsExitOnError, and SetCvsExitOnError.

Tcl_Interp* CTcl_Interp::fInterp [protected]

Definition at line 75 of file TclGlue.h.

Referenced by CTcl_Interp, DoFile, DoScript, DoScriptVar, operator Tcl_Interp *, and ~CTcl_Interp.

int CTcl_Interp::fLastErrorCode [protected]

Definition at line 77 of file TclGlue.h.

Referenced by CTcl_Interp, GetCvsLastErrorCode, and SetCvsLastErrorCode.

The documentation for this class was generated from the following files:
  • common/TclGlue.h
  • common/TclGlue.cpp
Generated on Sun Feb 24 01:28:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CTCLBrowserEnt Class Reference

Collaboration diagram for CTCLBrowserEnt:

[legend]
List of all members.

Public Methods

CTCLBrowserEnt ()
CTCLBrowserEnt (EntnodeData *data)
CTCLBrowserEnt (const CTCLBrowserEnt &ent)
~CTCLBrowserEnt ()
CTCLBrowserEnt & | operator= (const CTCLBrowserEnt &ent)
bool | IsSamePath (const char *pathstr) const
EntnodeData * | GetData () const
void | GetNormalized (UStr &path, UStr &fname) const

Private Attributes

ENTNODE node

Constructor & Destructor Documentation

CTCLBrowserEnt::CTCLBrowserEnt ( ) [inline]

Definition at line 231 of file TclGlue.cpp.

00232     {}

CTCLBrowserEnt::CTCLBrowserEnt ( EntnodeData * data ) [inline]

Definition at line 234 of file TclGlue.cpp.

References node.

00235     : node(data)
00236     {}

CTCLBrowserEnt::CTCLBrowserEnt ( const CTCLBrowserEnt & ent ) [inline]

Definition at line 238 of file TclGlue.cpp.

References node.

00239     : node(ent.node)
00240     {}

CTCLBrowserEnt::~CTCLBrowserEnt ( ) [inline]

Definition at line 242 of file TclGlue.cpp.

00243     {}

Member Function Documentation

EntnodeData* CTCLBrowserEnt::GetData ( void ) const [inline]

Definition at line 263 of file TclGlue.cpp.

References ENTNODE::Data, and node.

00264     {
00265         return node.Data();
00266     }

void CTCLBrowserEnt::GetNormalized | ( | UStr & | path,
 |  | UStr & | fname
 | ) | const [inline]

Definition at line 269 of file TclGlue.cpp.

References CStr, ENTNODE::Data, CTcl_Interp::Deunixfy, EntnodeData::GetFullPathName, node, and SplitPath.

00270     {
00271         CStr file;
00272         node.Data()->GetFullPathName(file);
00273         CTcl_Interp::Deunixfy(file);
00274         SplitPath(file, path, fname);
00275     }

bool CTCLBrowserEnt::IsSamePath ( const char * pathstr ) const [inline]

Definition at line 251 of file TclGlue.cpp.

References CStr, ENTNODE::Data, CTcl_Interp::Deunixfy, EntnodeData::GetFullPathName, and node.

00252     {
00253         CStr path = pathstr;
00254         CTcl_Interp::Deunixfy(path);
00255
00256         CStr file;
00257         node.Data()->GetFullPathName(file);
00258         CTcl_Interp::Deunixfy(file);
00259
00260         return path.compare(file) == 0;
00261     }

CTCLBrowserEnt& CTCLBrowserEnt::operator= ( const CTCLBrowserEnt & ent ) [inline]

Definition at line 245 of file TclGlue.cpp.

References node.

00246     {
00247         node = ent.node;
00248         return *this;
00249     }

Member Data Documentation

ENTNODE CTCLBrowserEnt::node [private]

Definition at line 278 of file TclGlue.cpp.

Referenced by CTCLBrowserEnt, GetData, GetNormalized, IsSamePath, and operator=.

The documentation for this class was generated from the following file:
  • common/TclGlue.cpp
Generated on Sun Feb 24 01:28:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CTCLCvsConsole Class Reference

Inheritance diagram for CTCLCvsConsole:

[legend]
Collaboration diagram for CTCLCvsConsole:

[legend]
List of all members.

Public Methods

CTCLCvsConsole (Tcl_Interp *interp)
virtual | ~CTCLCvsConsole ()
virtual long | cvs_out (char *txt, long len)
virtual long | cvs_err (char *txt, long len)

Protected Attributes

Tcl_Interp * | fInterp
int | fLen
char * | fAlloc

Constructor & Destructor Documentation

CTCLCvsConsole::CTCLCvsConsole ( Tcl_Interp * interp ) [inline]

Definition at line 286 of file TclGlue.cpp.

References fAlloc, fInterp, fLen, and malloc.

00286                                        : fInterp(interp)
00287     {
00288         fLen = 100;
00289         fAlloc = (char *)malloc((fLen + 1) * sizeof(char));
00290     }

virtual CTCLCvsConsole::~CTCLCvsConsole ( ) [inline, virtual]

Definition at line 291 of file TclGlue.cpp.

References fAlloc, and free.

00292     {
00293         if(fAlloc != 0L)
00294             free(fAlloc);
00295     }

Member Function Documentation

virtual long CTCLCvsConsole::cvs_err | ( | char * | txt,
 |  | long | len
 | ) | [inline, virtual]

Implements CCvsConsole.

Definition at line 317 of file TclGlue.cpp.

References cvs_out.

00318     {
00319         return cvs_out(txt, len);
00320     }

virtual long CTCLCvsConsole::cvs_out | ( | char * | txt,
 |  | long | len
 | ) | [inline, virtual]

Implements CCvsConsole.

Definition at line 297 of file TclGlue.cpp.

References fAlloc, fInterp, fLen, realloc, and Tcl_AppendResult.

Referenced by cvs_err.

00298     {
00299         if(fAlloc == 0L)
00300             return 0;
00301
00302         if(len > fLen)
00303         {
00304             fLen = len;
00305             fAlloc = (char *)realloc(fAlloc, (fLen + 1) * sizeof(char));
00306         }
00307         if(fAlloc == 0L)
00308             return 0;
00309
00310         memcpy(fAlloc, txt, len * sizeof(char));
00311         fAlloc[len] = '\0';
00312
00313         Tcl_AppendResult(fInterp, fAlloc, 0L);
00314         return len;
00315     }

Member Data Documentation

char* CTCLCvsConsole::fAlloc [protected]

Definition at line 324 of file TclGlue.cpp.

Referenced by CTCLCvsConsole, cvs_out, and ~CTCLCvsConsole.

Tcl_Interp* CTCLCvsConsole::fInterp [protected]

Definition at line 322 of file TclGlue.cpp.

Referenced by CTCLCvsConsole, and cvs_out.

int CTCLCvsConsole::fLen [protected]

Definition at line 323 of file TclGlue.cpp.

Referenced by CTCLCvsConsole, and cvs_out.

The documentation for this class was generated from the following file:
  • common/TclGlue.cpp
Generated on Sun Feb 24 01:28:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CTCP2Parse Class Reference

#include <CTCP2Parse.hpp>

Inheritance diagram for CTCP2Parse:

[legend]
Collaboration diagram for CTCP2Parse:

[legend]
List of all members.

Protected Types

enum EncodingType {
iso8859_1,
iso8859_2,
iso8859_3,
iso8859_4,
iso8859_5,
iso8859_6,
iso8859_7,
iso8859_8,
iso8859_9,
UTF_8
}
enum CharSpacingType {
Fixed,
Proportional
}
enum ColorType {
Black = 0x000000,
Blue = 0x00007F,
Green = 0x007F00,
Cyan = 0x007F7F,
Red = 0x7F0000,
Magenta = 0x7F007F,
Yellow = 0x7F7F00,
Lt_Grey = 0xC0C0C0,
Grey = 0x7F7F7F,
Lt_Blue = 0x0000FF,
Lt_Green = 0x00FF00,
Lt_Cyan = 0x00FFFF,
Lt_Red = 0xFF0000,
Lt_Magenta = 0xFF00FF,
Lt_Yellow = 0xFFFF00,
White = 0xFFFFFF
}

Protected Methods

CTCP2Parse ()
void | SetDefaults (unsigned char fgR=(unsigned char)((Lt_Grey &0xFF0000) >> 16), unsigned char fgG=(unsigned char)((Lt_Grey &0x00FF00) >> 8), unsigned char fgB=(unsigned char)(Lt_Grey &0x0000FF), unsigned char bgR=(unsigned char)((Black &0xFF0000) >> 16), unsigned char bgG=(unsigned char)((Black &0x00FF00) >> 8), unsigned char bgB=(unsigned char)(Black &0x0000FF), CharSpacingType cpDef_=Fixed, EncodingType encDef_=iso8859_1)
void | ParseIt (std::string *line)
virtual void | PushStart ()=0
virtual void | PushBold (bool)=0
virtual void | PushReverse (bool)=0
virtual void | PushUnderline (bool)=0
virtual void | PushOverstrike (bool)=0
virtual void | PushItalic (bool)=0
virtual void | PushBlink (bool)=0
virtual void | PushURL (bool)=0
virtual void | PushEncoding (EncodingType)=0
virtual void | PushSpacing (CharSpacingType)=0
virtual void | PushFontSize (int)=0
virtual void | PushForegroundColor (unsigned char R, unsigned char G, unsigned char B)=0
virtual void | PushBackgroundColor (unsigned char R, unsigned char G, unsigned char B)=0
virtual void | PushTextSegment (std::string *)=0

Private Methods

void | decodeToggle (std::string *line, int *parseFrmChar, int *parseEndChar, int *varCnt)
int | decodeColor (std::string *line, int *parseFrmChar, int *parseEndChar, RGBColor *c)
int | fromHex (unsigned char h, unsigned char *val)
void | PushOut (void)

Private Attributes

EncodingType enc
EncodingType encLast
EncodingType encDef
int | boldCnt
int | revCnt
int | overCnt
int | underCnt
int | italicCnt
int | blinkCnt
int | urlCnt
int | boldLast
int | revLast
int | overLast
int | underLast
int | italicLast
int | blinkLast
int | urlLast
int | fntSize
int | fntLast
CharSpacingType cp
CharSpacingType cpLast
CharSpacingType cpDef
RGBColor fg
RGBColor fgLast
RGBColor fgDef
RGBColor bg
RGBColor bgLast
RGBColor bgDef
std::string * | segment

Static Private Attributes

const RGBColor | indexColor [16]

Member Enumeration Documentation

enum CTCP2Parse::CharSpacingType [protected]

Enumeration values:
Fixed
Proportional

Definition at line 111 of file CTCP2Parse.hpp.

00111 { Fixed, Proportional };

enum CTCP2Parse::ColorType [protected]

Enumeration values:
Black
Blue
Green
Cyan
Red
Magenta
Yellow
Lt_Grey
Grey
Lt_Blue
Lt_Green
Lt_Cyan
Lt_Red
Lt_Magenta
Lt_Yellow
White

Definition at line 114 of file CTCP2Parse.hpp.

00115     {
00116         Black      = 0x000000,
00117         Blue       = 0x00007F,
00118         Green      = 0x007F00,
00119         Cyan       = 0x007F7F,
00120         Red        = 0x7F0000,
00121         Magenta    = 0x7F007F,
00122         Yellow     = 0x7F7F00,
00123         Lt_Grey    = 0xC0C0C0,
00124         Grey       = 0x7F7F7F,
00125         Lt_Blue    = 0x0000FF,
00126         Lt_Green   = 0x00FF00,
00127         Lt_Cyan    = 0x00FFFF,
00128         Lt_Red     = 0xFF0000,
00129         Lt_Magenta = 0xFF00FF,
00130         Lt_Yellow  = 0xFFFF00,
00131         White      = 0xFFFFFF
00132     };

enum CTCP2Parse::EncodingType [protected]

Enumeration values:
iso8859_1
iso8859_2
iso8859_3
iso8859_4
iso8859_5
iso8859_6
iso8859_7
iso8859_8
iso8859_9
UTF_8

Definition at line 104 of file CTCP2Parse.hpp.

00105     {
00106         iso8859_1, iso8859_2, iso8859_3, iso8859_4, iso8859_5, iso8859_6,
00107         iso8859_7, iso8859_8, iso8859_9, UTF_8
00108     };

Constructor & Destructor Documentation

CTCP2Parse::CTCP2Parse ( ) [protected]

Definition at line 31 of file CTCP2Parse.cpp.

References bg, bgDef, bgLast, Black, blinkCnt, blinkLast, boldCnt, boldLast, cp, cpDef, cpLast, enc, encDef, encLast, fg, fgDef, fgLast, Fixed, fntLast, fntSize, iso8859_1, italicCnt, italicLast, Lt_Grey, overCnt, overLast, revCnt, revLast, CTCP2Parse::RGBColor::RGB, underCnt, underLast, urlCnt, and urlLast.

00032 {
00033     boldCnt = revCnt = overCnt = underCnt = italicCnt = blinkCnt = urlCnt = 0;
00034     boldLast = revLast = overLast = underLast = italicLast = blinkLast = urlLast = 0;
00035     fntSize = fntLast = 0;
00036
00037     fg.RGB = fgLast.RGB = fgDef.RGB = Lt_Grey;
00038     bg.RGB = bgLast.RGB = bgDef.RGB = Black;
00039
00040     cp = cpLast = cpDef = Fixed;
00041     enc = encLast = encDef = iso8859_1;
00042 }

Member Function Documentation

int CTCP2Parse::decodeColor | ( | std::string * | line,
 |  | int * | parseFrmChar,
 |  | int * | parseEndChar,
 |  | RGBColor * | c
 | ) | [inline, private]

Definition at line 212 of file CTCP2Parse.hpp.

References fromHex, indexColor, and CTCP2Parse::RGBColor::RGB.

Referenced by ParseIt.

00213     {
00214         if (line->at(*parseFrmChar) == '#')
00215         {
00216             (*parseFrmChar)++;   // consume it
00217             if (*parseFrmChar + 6 <= *parseEndChar)
00218             {
00219                 unsigned char C = 0;
00220
00221                 c->RGB = 0;     // start with a clean plate
00222
00223                 // hi-byte red
00224                 if (!fromHex(line->at(*parseFrmChar), &C)) return 3;
00225                 (*parseFrmChar)++;  // consume the hex character
00226                 c->R |= (C << 4);
00227
00228                 // lo-byte red
00229                 if (!fromHex(line->at(*parseFrmChar), &C)) return 4;
00230                 (*parseFrmChar)++;  // consume the hex character
00231                 c->R |= C;
00232
00233                 // hi-byte green
00234                 if (!fromHex(line->at(*parseFrmChar), &C)) return 5;
00235                 (*parseFrmChar)++;  // consume the hex character
00236                 c->G |= (C << 4);
00237
00238                 // lo-byte green
00239                 if (!fromHex(line->at(*parseFrmChar), &C)) return 6;
00240                 (*parseFrmChar)++;  // consume the hex character
00241                 c->G |= C;
00242
00243                 // hi-byte blue
00244                 if (!fromHex(line->at(*parseFrmChar), &C)) return 7;
00245                 (*parseFrmChar)++;  // consume the hex character
00246                 c->B |= (C << 4);
00247
00248                 // lo-byte blue
00249                 if (!fromHex(line->at(*parseFrmChar), &C)) return 8;
00250                 (*parseFrmChar)++;  // consume the hex character
00251                 c->B |= C;
00252             } else {
00253                 // rollback the error...
00254                 return 3;
00255             }
00256         } else {
00257             unsigned char index = 0;
00258             if (!fromHex(line->at(*parseFrmChar), &index)) return 3;
00259             (*parseFrmChar)++;  // consume the hex character
00260             c->RGB = indexColor[index].RGB;
00261         }
00262         return 0;
00263     }

void CTCP2Parse::decodeToggle | ( | std::string * | line,
 |  | int * | parseFrmChar,
 |  | int * | parseEndChar,
 |  | int * | varCnt
 | ) | [inline, private]

Definition at line 190 of file CTCP2Parse.hpp.

00191     {
00192         (*parseFrmChar)++;   // consume the attribute
00193         if (*parseFrmChar < *parseEndChar)
00194         {
00195             if (line->at(*parseFrmChar) == '+')
00196             {
00197                 (*varCnt)++;
00198                 (*parseFrmChar)++;   // consume the '+'
00199             }
00200             else if (line->at(*parseFrmChar) == '-')
00201             {
00202                 if ((*varCnt) > 0)
00203                     (*varCnt)--;
00204                 (*parseFrmChar)++;   // consume the '-'
00205             }
00206         }
00207         else
00208             (*varCnt)++;  // default to a '+'
00209     }

int CTCP2Parse::fromHex | ( | unsigned char | h,
 |  | unsigned char * | val
 | ) | [inline, private]

Definition at line 265 of file CTCP2Parse.hpp.

Referenced by decodeColor.

00266     {
00267         // 0 - 9
00268         if (h > 47 && h < 58) *val = (h - 48);
00269         // A - F
00270         else if (h > 64 && h < 71) *val = (h - 55);
00271         else return 0;   // throw a little conversion exception
00272         return 1;
00273     }

void CTCP2Parse::ParseIt ( std::string * line ) [protected]

Definition at line 65 of file CTCP2Parse.cpp.

References ansiAttrCvt::ansi2ctcp, CTCP2Parse::RGBColor::B, bg, bgDef, blinkCnt, boldCnt, cp, cpDef, decodeColor, enc, encDef, fg, fgDef, Fixed, fntSize, CTCP2Parse::RGBColor::G, irciiAttrCvt::ircii2ctcp, iso8859_1, iso8859_2, iso8859_3, iso8859_4, iso8859_5, iso8859_6, iso8859_7, iso8859_8, iso8859_9, italicCnt, mircAttrCvt::mirc2ctcp, overCnt, Proportional, PushOut, CTCP2Parse::RGBColor::R, revCnt, CTCP2Parse::RGBColor::RGB, segment, underCnt, urlCnt, and UTF_8.

00066 {
00067     int parseFrmChar = 0, parseEndChar = 0, parseStart = 0;
00068     int fntVal, fntDir = 1;
00069     int rollBack;
00070
00071     // Pre-parse and replace other attribute standards with
00072     // the ctcp2 equivalents for display.
00073     mirc2ctcp(line);
00074     ircii2ctcp(line);
00075     ansi2ctcp(line);
00076
00077
00078     // find an opening ctcp/2 format character (^F)
00079     parseFrmChar = line->find_first_of("\006");
00080
00081     // do we have any?
00082     while (parseFrmChar != std::string::npos)
00083     {
00084         // find the closing ctcp/2 format character (^F)
00085         parseEndChar = line->find_first_of("\006", parseFrmChar+1);
00086
00087         if (parseEndChar == std::string::npos)
00088         {
00089             // an opening without a closing is bogus
00090             // so remove it and fallout of the while loop
00091             line->replace(parseFrmChar, 1, "");
00092             break;
00093         }
00094
00095         // check for text before this format character
00096         // and after the last format character (or index 0 for
00097         // the first iteration.
00098         if (parseFrmChar > parseStart)
00099         {
00100             // yes.. we got a text segment ready to push.
00101             segment = new std::string(line->substr(parseStart, (parseFrmChar - parseStart)));
00102             PushOut();
00103             delete segment;
00104         }
00105
00106         // now, interpret this format code and decode this attribute
00107         // (and options, if any).
00108
00109
00110         parseFrmChar++;  // consume the first ^F.
00111
00112
00113         switch (line->at(parseFrmChar)) {
00114
00115 #   define CTCP2_TOGGLE(ch, var)  \
00116         case (ch): \
00117         decodeToggle(line, &parseFrmChar, &parseEndChar, &(var)); \
00118             break;
00119
00120         // bold
00121         CTCP2_TOGGLE('B', boldCnt);
00122
00123         // reverse
00124         CTCP2_TOGGLE('V', revCnt);
00125
00126         // underline
00127         CTCP2_TOGGLE('U', underCnt);
00128
00129         // over-strike
00130         CTCP2_TOGGLE('S', overCnt);
00131
00132         // italics
00133         CTCP2_TOGGLE('I', italicCnt);
00134
00135         // blink
00136         CTCP2_TOGGLE('K', blinkCnt);
00137
00138         // URL
00139         CTCP2_TOGGLE('L', urlCnt);
00140
00141 #   undef CTCP2_TOGGLE
00142
00143         // color
00144         case 'C':
00145             parseFrmChar++;   // consume the 'C'
00146             if (parseFrmChar < parseEndChar)
00147             {
00148                 if (line->at(parseFrmChar) == '.')
00149                 {
00150                     // reset to default
00151                     fg.RGB = fgDef.RGB;
00152                     parseFrmChar++;  // consume the '.'
00153                 }
00154                 else if (line->at(parseFrmChar) == '-')
00155                 {
00156                     // ignore
00157                     parseFrmChar++;   // consume the '-'
00158                 }
00159                 else
00160                 {
00161                     if (rollBack = decodeColor(line, &parseFrmChar, &parseEndChar, &fg))
00162                     {
00163                         // rollback the error to the 'C'
00164                         parseFrmChar -= rollBack;
00165                         fg.RGB = fgDef.RGB;
00166                         break;
00167                     }
00168                 }
00169
00170
00171                 // background color?
00172                 if (parseFrmChar < parseEndChar)
00173                 {
00174                     if (line->at(parseFrmChar) == '.')
00175                     {
00176                         bg.RGB = bgDef.RGB;
00177                         parseFrmChar++;  // consume the '.'
00178                     }
00179                     else if (line->at(parseFrmChar) == '-')
00180                     {
00181                         // ignore
00182                         parseFrmChar++;   // consume the '-'
00183                     }
00184                     else
00185                     {
00186                         if (rollBack = decodeColor(line, &parseFrmChar, &parseEndChar, &bg))
00187                         {
00188                             // rollback the error to the 'C'
00189                             parseFrmChar -= rollBack;
00190                             bg.RGB = bgDef.RGB;
00191                             break;
00192                         }
00193                     }
00194                 }
00195                 else
00196                     parseFrmChar--;   // rollback one
00197             }
00198             else
00199             {
00200                 // no colors were specified: reset to normal
00201                 fg.RGB = fgDef.RGB;
00202                 bg.RGB = bgDef.RGB;
00203             }
00204
00205             // if fg/bg are too similar, reset to defaults.
00206             // (this is in the ctcp2 draft).  These calculations
00207             // are DIRECTLY from ctcp2's draft.
00208             if ((fg.R >= bg.R - 8) && (fg.R <= bg.R + 8) &&
00209                 (fg.G >= bg.G - 8) && (fg.G <= bg.G + 8) &&
00210                 (fg.B >= bg.B - 8) && (fg.B <= bg.B + 8))
00211             {
00212                 fg.RGB = fgDef.RGB;
00213                 bg.RGB = bgDef.RGB;
00214             }
00215             break;
00216
00217         // font size
00218         case 'F':
00219             parseFrmChar++;
00220             if (parseFrmChar < parseEndChar)
00221             {
00222                 if (line->at(parseFrmChar) == '+') fntDir = 1;
00223                 else fntDir = -1;
00224                 parseFrmChar++;
00225                 if (parseFrmChar < parseEndChar)
00226                 {
00227                     fntVal = line->at(parseFrmChar) - 48;
00228                     if (fntVal > 4) fntVal = 4;
00229                 } else {
00230                     // no amount -- assume 1
00231                     fntVal = 1;
00232                     parseFrmChar--;
00233                 }
00234                 fntSize += (fntDir*fntVal);
00235             } else {
00236                 // no parameters -- reset to normal
00237                 fntSize = 0;
00238                 parseFrmChar--;
00239             }
00240             break;
00241
00242         // character spacing
00243         case 'P':
00244             parseFrmChar++;   // consume it
00245             if (parseFrmChar < parseEndChar)
00246             {
00247                 switch (line->at(parseFrmChar))
00248                 {
00249                 case 'P':
00250                     cp = Proportional; parseFrmChar++; break;
00251                 case 'F':
00252                     cp = Fixed; parseFrmChar++; break;
00253                 default:
00254                     // rollback to show the error.
00255                     parseFrmChar -= 2;
00256                 }
00257             } else {
00258                 // no parameters -- reset to normal
00259                 cp = cpDef;
00260             }
00261             break;
00262
00263         // text encoding
00264         case 'E':
00265             parseFrmChar++;   // consume it
00266             switch (line->at(parseFrmChar))
00267             {
00268             case '1':
00269                 if (line->at(parseFrmChar+1) == '0') parseFrmChar++; // what's iso8859-10 ???
00270                 enc = iso8859_1; parseFrmChar++; break;
00271             case '2':
00272                 enc = iso8859_2; parseFrmChar++; break;
00273             case '3':
00274                 enc = iso8859_3; parseFrmChar++; break;
00275             case '4':
00276                 enc = iso8859_4; parseFrmChar++; break;
00277             case '5':
00278                 enc = iso8859_5; parseFrmChar++; break;
00279             case '6':
00280                 enc = iso8859_6; parseFrmChar++; break;
00281             case '7':
00282                 enc = iso8859_7; parseFrmChar++; break;
00283             case '8':
00284                 enc = iso8859_8; parseFrmChar++; break;
00285             case '9':
00286                 enc = iso8859_9; parseFrmChar++; break;
00287             case 'U':
00288                 enc = UTF_8; parseFrmChar++; break;
00289             default:
00290                 // rollback to show the error.
00291                 parseFrmChar -= 2;
00292             }
00293             break;
00294
00295         // revert to normal
00296         case 'N':
00297             parseFrmChar++;   // consume it
00298             boldCnt = revCnt = overCnt = underCnt = italicCnt = blinkCnt = urlCnt = 0;
00299             enc = encDef;
00300             fg.RGB = fgDef.RGB;
00301             bg.RGB = bgDef.RGB;
00302             cp = cpDef;
00303             break;
00304
00305         // client extensions
00306         case 'X':
00307             //  no extensions are defined at this time.
00308             /*
00309             parseFrmChar++;
00310             switch (line->at(parseFrmChar)) {
00311             case '':
00312             default:
00313                  rollback to show the error.
00314                 parseFrmChar -= 2;
00315             }
00316             */
00317             parseFrmChar--;
00318             break;
00319
00320         // error condition...
00321         default:
00322             // rollback one.  unrecognized format specifier.
00323             parseFrmChar--;
00324         }
00325
00326         // extra params? include them in the text surrounded by "[ ]"
00327         // (This is recommended, in case someone chooses to "hide" a
00328         //    message by doing "^FNsell yoyodyne stocks!^F" -- this code
00329         //    effectively "unhides" it, and is [yet again] recommended
00330         //    by the CTCP2 draft.)
00331
00332         parseFrmChar++;
00333         if (parseFrmChar < parseEndChar)
00334         {
00335             line->replace(parseFrmChar, parseEndChar - parseFrmChar,
00336                 std::string("\006[") +
00337                 line->substr(parseFrmChar, parseEndChar-parseFrmChar) +
00338                 std::string("]"));
00339
00340             parseEndChar = parseFrmChar;
00341         }
00342
00343         // save old end position
00344         parseStart = parseEndChar+1;
00345
00346         // got any more?
00347         parseFrmChar = line->find_first_of("\006", parseStart);
00348     };
00349
00350
00351
00352     // anything left?
00353     if (parseStart < line->length())
00354     {
00355         // last text segment is ready to push.
00356         segment = new std::string(line->substr(parseStart));
00357         PushOut();
00358         delete segment;
00359     }
00360 };

virtual void CTCP2Parse::PushBackgroundColor | ( | unsigned char | R,
 |  | unsigned char | G,
 |  | unsigned char | B
 | ) | [protected, pure virtual]

Referenced by PushOut.

virtual void CTCP2Parse::PushBlink ( bool ) [protected, pure virtual]

Referenced by PushOut.

virtual void CTCP2Parse::PushBold ( bool ) [protected, pure virtual]

Referenced by PushOut.

virtual void CTCP2Parse::PushEncoding ( EncodingType ) [protected, pure virtual]

Referenced by PushOut.

virtual void CTCP2Parse::PushFontSize ( int ) [protected, pure virtual]

Referenced by PushOut.

virtual void CTCP2Parse::PushForegroundColor | ( | unsigned char | R,
 |  | unsigned char | G,
 |  | unsigned char | B
 | ) | [protected, pure virtual]

Referenced by PushOut.

virtual void CTCP2Parse::PushItalic ( bool ) [protected, pure virtual]

Referenced by PushOut.

void CTCP2Parse::PushOut ( void ) [inline, private]

Definition at line 275 of file CTCP2Parse.hpp.

References CTCP2Parse::RGBColor::B, bg, bgLast, blinkCnt, blinkLast, boldCnt, boldLast, cp, cpLast, enc, encLast, fg, fgLast, fntLast, fntSize, CTCP2Parse::RGBColor::G, italicCnt, italicLast, overCnt, overLast, PushBackgroundColor, PushBlink, PushBold, PushEncoding, PushFontSize, PushForegroundColor, PushItalic, PushOverstrike, PushReverse, PushSpacing, PushStart, PushTextSegment, PushUnderline, PushURL, CTCP2Parse::RGBColor::R, revCnt, revLast, CTCP2Parse::RGBColor::RGB, segment, underCnt, underLast, urlCnt, and urlLast.

Referenced by ParseIt.

00276     {
00277         // notify the derived class, we are about to start a new attribute set.
00278         PushStart();
00279
00280         // never push-out ALL the attributes -- only the CHANGED ones.
00281
00282         if ((boldCnt > 0) ^ boldLast) PushBold (boldLast = !boldLast ? true : false);
00283         if ((revCnt > 0) ^ revLast) PushReverse (revLast = !revLast ? true : false);
00284         if ((underCnt > 0) ^ underLast) PushUnderline (underLast = !underLast ? true : false);
00285         if ((overCnt > 0) ^ overLast) PushOverstrike (overLast = !overLast ? true : false);
00286         if ((italicCnt > 0) ^ italicLast) PushItalic (italicLast = !italicLast ? true : false);
00287         if ((blinkCnt > 0) ^ blinkLast) PushBlink (blinkLast = !blinkLast ? true : false);
00288         if ((urlCnt > 0) ^ urlLast) PushURL (urlLast = !urlLast ? true : false);
00289         if (enc ^ encLast) PushEncoding (encLast = enc);
00290         if (cp ^ cpLast) PushSpacing (cpLast = cp);
00291         if (fntSize ^ fntLast) PushFontSize (fntLast = fntSize);
00292
00293         if (fg.RGB ^ fgLast.RGB)
00294         {
00295             fgLast.RGB = fg.RGB;
00296             PushForegroundColor(fg.R, fg.G, fg.B);
00297         }
00298         if (bg.RGB ^ bgLast.RGB)
00299         {
00300             bgLast.RGB = bg.RGB;
00301             PushBackgroundColor(bg.R, bg.G, bg.B);
00302         }
00303
00304         PushTextSegment(segment);
00305     }

virtual void CTCP2Parse::PushOverstrike ( bool ) [protected, pure virtual]

Referenced by PushOut.

virtual void CTCP2Parse::PushReverse ( bool ) [protected, pure virtual]

Referenced by PushOut.

virtual void CTCP2Parse::PushSpacing ( CharSpacingType ) [protected, pure virtual]

Referenced by PushOut.

virtual void CTCP2Parse::PushStart ( ) [protected, pure virtual]

Referenced by PushOut.

virtual void CTCP2Parse::PushTextSegment ( std::string * ) [protected, pure virtual]

Referenced by PushOut.

virtual void CTCP2Parse::PushUnderline ( bool ) [protected, pure virtual]

Referenced by PushOut.

virtual void CTCP2Parse::PushURL ( bool ) [protected, pure virtual]

Referenced by PushOut.

void CTCP2Parse::SetDefaults | ( | unsigned char | fgR = (unsigned char)((Lt_Grey &0xFF0000) >> 16),
 |  | unsigned char | fgG = (unsigned char)((Lt_Grey &0x00FF00) >> 8),
 |  | unsigned char | fgB = (unsigned char)(Lt_Grey &0x0000FF),
 |  | unsigned char | bgR = (unsigned char)((Black &0xFF0000) >> 16),
 |  | unsigned char | bgG = (unsigned char)((Black &0x00FF00) >> 8),
 |  | unsigned char | bgB = (unsigned char)(Black &0x0000FF),
 |  | CharSpacingType | cpDef_ = Fixed,
 |  | EncodingType | encDef_ = iso8859_1
 | ) | [protected]

Definition at line 44 of file CTCP2Parse.cpp.

References CTCP2Parse::RGBColor::B, bg, bgDef, bgLast, cp, cpDef, cpLast, enc, encDef, encLast, fg, fgDef, fgLast, CTCP2Parse::RGBColor::G, and CTCP2Parse::RGBColor::R.

00049 {
00050
00051     // reassemble the seperate RGB values into our internal rep.
00052
00053     fg.R = fgLast.R = fgDef.R = fgR;
00054     fg.G = fgLast.G = fgDef.G = fgG;
00055     fg.B = fgLast.B = fgDef.B = fgB;
00056
00057     bg.R = bgLast.R = bgDef.R = bgR;
00058     bg.G = bgLast.G = bgDef.G = bgG;
00059     bg.B = bgLast.B = bgDef.B = bgB;
00060
00061     cp = cpLast = cpDef = cpDef_;
00062     enc = encLast = encDef = encDef_;
00063 }

Member Data Documentation

RGBColor CTCP2Parse::bg [private]

Definition at line 317 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, ParseIt, PushOut, and SetDefaults.

RGBColor CTCP2Parse::bgDef [private]

Definition at line 317 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, ParseIt, and SetDefaults.

RGBColor CTCP2Parse::bgLast [private]

Definition at line 317 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, PushOut, and SetDefaults.

int CTCP2Parse::blinkCnt [private]

Definition at line 311 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, ParseIt, and PushOut.

int CTCP2Parse::blinkLast [private]

Definition at line 312 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, and PushOut.

int CTCP2Parse::boldCnt [private]

Definition at line 311 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, ParseIt, and PushOut.

int CTCP2Parse::boldLast [private]

Definition at line 312 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, and PushOut.

CharSpacingType CTCP2Parse::cp [private]

Definition at line 315 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, ParseIt, PushOut, and SetDefaults.

CharSpacingType CTCP2Parse::cpDef [private]

Definition at line 315 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, ParseIt, and SetDefaults.

CharSpacingType CTCP2Parse::cpLast [private]

Definition at line 315 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, PushOut, and SetDefaults.

EncodingType CTCP2Parse::enc [private]

Definition at line 308 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, ParseIt, PushOut, and SetDefaults.

EncodingType CTCP2Parse::encDef [private]

Definition at line 308 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, ParseIt, and SetDefaults.

EncodingType CTCP2Parse::encLast [private]

Definition at line 308 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, PushOut, and SetDefaults.

RGBColor CTCP2Parse::fg [private]

Definition at line 317 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, ParseIt, PushOut, and SetDefaults.

RGBColor CTCP2Parse::fgDef [private]

Definition at line 317 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, ParseIt, and SetDefaults.

RGBColor CTCP2Parse::fgLast [private]

Definition at line 317 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, PushOut, and SetDefaults.

int CTCP2Parse::fntLast [private]

Definition at line 313 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, and PushOut.

int CTCP2Parse::fntSize [private]

Definition at line 313 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, ParseIt, and PushOut.

const CTCP2Parse::RGBColor CTCP2Parse::indexColor [static, private]

Initial value:

 {
    Black, Blue, Green, Cyan, Red, Magenta, Yellow, Lt_Grey, Grey,
    Lt_Blue, Lt_Green, Lt_Cyan, Lt_Red, Lt_Magenta, Lt_Yellow, White
}

Definition at line 362 of file CTCP2Parse.cpp.

Referenced by decodeColor.

int CTCP2Parse::italicCnt [private]

Definition at line 311 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, ParseIt, and PushOut.

int CTCP2Parse::italicLast [private]

Definition at line 312 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, and PushOut.

int CTCP2Parse::overCnt [private]

Definition at line 311 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, ParseIt, and PushOut.

int CTCP2Parse::overLast [private]

Definition at line 312 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, and PushOut.

int CTCP2Parse::revCnt [private]

Definition at line 311 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, ParseIt, and PushOut.

int CTCP2Parse::revLast [private]

Definition at line 312 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, and PushOut.

std::string* CTCP2Parse::segment [private]

Definition at line 319 of file CTCP2Parse.hpp.

Referenced by ParseIt, and PushOut.

int CTCP2Parse::underCnt [private]

Definition at line 311 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, ParseIt, and PushOut.

int CTCP2Parse::underLast [private]

Definition at line 312 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, and PushOut.

int CTCP2Parse::urlCnt [private]

Definition at line 311 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, ParseIt, and PushOut.

int CTCP2Parse::urlLast [private]

Definition at line 312 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse, and PushOut.

The documentation for this class was generated from the following files:
  • common/CTCP2Parse.hpp
  • common/CTCP2Parse.cpp
Generated on Sun Feb 24 01:28:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CTCP2Parse::RGBColor Struct Reference

Collaboration diagram for CTCP2Parse::RGBColor:

[legend]
List of all members.

Member Data Documentation

unsigned char CTCP2Parse::RGBColor::B

Definition at line 184 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse::ParseIt, CTCP2Parse::PushOut, and CTCP2Parse::SetDefaults.

unsigned char CTCP2Parse::RGBColor::G

Definition at line 183 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse::ParseIt, CTCP2Parse::PushOut, and CTCP2Parse::SetDefaults.

unsigned char CTCP2Parse::RGBColor::nul_void_ignore

Definition at line 181 of file CTCP2Parse.hpp.

unsigned char CTCP2Parse::RGBColor::R

Definition at line 182 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse::ParseIt, CTCP2Parse::PushOut, and CTCP2Parse::SetDefaults.

__int32 CTCP2Parse::RGBColor::RGB

Definition at line 172 of file CTCP2Parse.hpp.

Referenced by CTCP2Parse::CTCP2Parse, CTCP2Parse::decodeColor, CTCP2Parse::ParseIt, and CTCP2Parse::PushOut.

The documentation for this struct was generated from the following file:
  • common/CTCP2Parse.hpp
Generated on Sun Feb 24 01:28:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TEditText Class Reference

Inheritance diagram for TEditText:

[legend]
The documentation for this class was generated from the following file:
  • rf/support/macapp/UPseudoSupport.h
Generated on Sun Feb 24 01:28:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CTempToggleBool Class Reference

Collaboration diagram for CTempToggleBool:

[legend]
List of all members.

Public Methods

CTempToggleBool (bool &value)
~CTempToggleBool ()

Protected Attributes

bool & | m_value
bool | m_didSetIt

Constructor & Destructor Documentation

CTempToggleBool::CTempToggleBool ( bool & value ) [inline]

Definition at line 148 of file UCvsFolders.cpp.

References m_didSetIt, and m_value.

00148                                   : m_value(value), m_didSetIt(false)
00149     {
00150         if(!m_value)
00151         {
00152             m_didSetIt = true;
00153             m_value = true;
00154         }
00155     }

CTempToggleBool::~CTempToggleBool ( ) [inline]

Definition at line 157 of file UCvsFolders.cpp.

References m_value.

00158     {
00159         if(m_didSetIt)
00160             m_value = false;
00161     }

Member Data Documentation

bool CTempToggleBool::m_didSetIt [protected]

Definition at line 164 of file UCvsFolders.cpp.

Referenced by CTempToggleBool.

bool& CTempToggleBool::m_value [protected]

Definition at line 163 of file UCvsFolders.cpp.

Referenced by CTempToggleBool, and ~CTempToggleBool.

The documentation for this class was generated from the following file:
  • common/UCvsFolders.cpp
Generated on Sun Feb 24 01:28:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TGraph Class Reference

Inheritance diagram for TGraph:

[legend]
List of all members.

Public Methods

kTGraph | TraverseGraph (CLogNode *node)
virtual kTGraph | TraverseNode (CLogNode *node)=0

Member Function Documentation

kTGraph TGraph::TraverseGraph ( CLogNode * node )

Definition at line 918 of file GraphView.cpp.

References kTContinue, kTGetDown, kTGraph, kTStop, and TraverseNode.

Referenced by CGraphView::IsSelSingleNode, CGraphView::OnContextMenu, CGraphView::OnGraphChangelogmessage, CGraphView::OnGraphSetdescription, CGraphView::OnGraphSetstate, CGraphView::OnLButtonDown, CGraphView::OnQueryAnnotate, CGraphView::OnUpdateViewDelrev, CGraphView::OnUpdateViewDiff, CGraphView::OnUpdateViewTag, CGraphView::OnViewDelrev, CGraphView::OnViewDiff, CGraphView::OnViewRetrieve, CGraphView::OnViewSelnonsig, CGraphView::OnViewTag, and CGraphView::OnViewUnlockf.

00919 {
00920     kTGraph res;
00921
00922     res = TraverseNode(node);
00923     if(res == kTStop)
00924         return kTStop;
00925
00926     if(res == kTGetDown)
00927     {
00928         vector<CLogNode *>::iterator i;
00929         for(i = node->Childs().begin(); i != node->Childs().end(); ++i)
00930         {
00931             res = TraverseGraph(*i);
00932             if(res == kTStop)
00933                 return kTStop;
00934         }
00935     }
00936
00937     if(node->Next() != 0L)
00938     {
00939         res = TraverseGraph(node->Next());
00940         if(res == kTStop)
00941             return kTStop;
00942     }
00943
00944     return kTContinue;
00945 };

virtual kTGraph TGraph::TraverseNode ( CLogNode * node ) [pure virtual]

Implemented in TGraphRectSelect.

Referenced by TraverseGraph.

The documentation for this class was generated from the following file:
  • WinCvs/GraphView.cpp
Generated on Sun Feb 24 01:28:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TGraphCmdStatus Class Reference

Inheritance diagram for TGraphCmdStatus:

[legend]
Collaboration diagram for TGraphCmdStatus:

[legend]
List of all members.

Public Methods

TGraphCmdStatus ()
virtual kTGraph | TraverseNode (CLogNode *node)

Public Attributes

CWinLogData * fSel1
CWinLogData * fSel2
int | fCountSel

Constructor & Destructor Documentation

TGraphCmdStatus::TGraphCmdStatus ( ) [inline]

Definition at line 1050 of file GraphView.cpp.

References fCountSel, fSel1, and fSel2.

01050                       :
01051         fSel1(0L), fSel2(0L), fCountSel(0) {}

Member Function Documentation

virtual kTGraph TGraphCmdStatus::TraverseNode ( CLogNode * node ) [inline, virtual]

Implements TGraph.

Definition at line 1053 of file GraphView.cpp.

References fCountSel, fSel1, fSel2, kTGetDown, kTGraph, and CWinLogData::Selected.

01054     {
01055         CWinLogData *data = (CWinLogData *)node->GetUserData();
01056
01057         if(data->Selected())
01058         {
01059             if(fSel1 == 0L)
01060                 fSel1 = data;
01061             else if(fSel2 == 0L)
01062                 fSel2 = data;
01063             fCountSel++;
01064         }
01065
01066         return kTGetDown;
01067     }

Member Data Documentation

int TGraphCmdStatus::fCountSel

Definition at line 1071 of file GraphView.cpp.

Referenced by CGraphView::IsSelSingleNode, CGraphView::OnContextMenu, CGraphView::OnUpdateViewDiff, CGraphView::OnUpdateViewTag, CGraphView::OnViewDiff, TGraphCmdStatus, and TraverseNode.

CWinLogData* TGraphCmdStatus::fSel1

Definition at line 1069 of file GraphView.cpp.

Referenced by CGraphView::IsSelSingleNode, CGraphView::OnContextMenu, CGraphView::OnGraphChangelogmessage, CGraphView::OnGraphSetdescription, CGraphView::OnGraphSetstate, CGraphView::OnQueryAnnotate, CGraphView::OnUpdateViewDiff, CGraphView::OnViewDiff, CGraphView::OnViewRetrieve, CGraphView::OnViewTag, CGraphView::OnViewUnlockf, TGraphCmdStatus, and TraverseNode.

CWinLogData* TGraphCmdStatus::fSel2

Definition at line 1070 of file GraphView.cpp.

Referenced by CGraphView::OnUpdateViewDiff, CGraphView::OnViewDiff, TGraphCmdStatus, and TraverseNode.

The documentation for this class was generated from the following file:
  • WinCvs/GraphView.cpp
Generated on Sun Feb 24 01:28:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TGraphDelCmd Class Reference

Inheritance diagram for TGraphDelCmd:

[legend]
Collaboration diagram for TGraphDelCmd:

[legend]
List of all members.

Public Methods

TGraphDelCmd ()
virtual kTGraph | TraverseNode (CLogNode *node)

Public Attributes

int | fCountSel
bool | fOnlyRev
std::vector< UStr > fAllRevs

Constructor & Destructor Documentation

TGraphDelCmd::TGraphDelCmd ( ) [inline]

Definition at line 1384 of file GraphView.cpp.

References fCountSel, and fOnlyRev.

01384                    :
01385         fCountSel(0), fOnlyRev(true) {}

Member Function Documentation

virtual kTGraph TGraphDelCmd::TraverseNode ( CLogNode * node ) [inline, virtual]

Implements TGraph.

Definition at line 1387 of file GraphView.cpp.

References CStr, fAllRevs, fCountSel, fOnlyRev, CWinLogData::GetStr, CWinLogData::GetType, kTGetDown, kTGraph, and CWinLogData::Selected.

01388     {
01389         CWinLogData *data = (CWinLogData *)node->GetUserData();
01390
01391         if(data->Selected())
01392         {
01393             if(data->GetType() != kNodeRev)
01394                 fOnlyRev = false;
01395             else
01396                 fAllRevs.push_back(CStr(data->GetStr()));
01397             fCountSel++;
01398         }
01399
01400         return kTGetDown;
01401     }

Member Data Documentation

std::vector< UStr > TGraphDelCmd::fAllRevs

Definition at line 1405 of file GraphView.cpp.

Referenced by CGraphView::OnViewDelrev, and TraverseNode.

int TGraphDelCmd::fCountSel

Definition at line 1403 of file GraphView.cpp.

Referenced by CGraphView::OnUpdateViewDelrev, TGraphDelCmd, and TraverseNode.

bool TGraphDelCmd::fOnlyRev

Definition at line 1404 of file GraphView.cpp.

Referenced by CGraphView::OnUpdateViewDelrev, TGraphDelCmd, and TraverseNode.

The documentation for this class was generated from the following file:
  • WinCvs/GraphView.cpp
Generated on Sun Feb 24 01:28:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TGraphRectSelect Class Reference

Inheritance diagram for TGraphRectSelect:

[legend]
Collaboration diagram for TGraphRectSelect:

[legend]
List of all members.

Public Methods

TGraphRectSelect (bool shiftOn, CGraphView *view, CRect &r)
virtual kTGraph | TraverseNode (CLogNode *node)

Protected Attributes

bool | mShiftOn
CGraphView * mView
CRect & | mR

Constructor & Destructor Documentation

TGraphRectSelect::TGraphRectSelect | ( | bool | shiftOn,
 |  | CGraphView * | view,
 |  | CRect & | r
 | ) | [inline]

Definition at line 950 of file GraphView.cpp.

References mR, mShiftOn, and mView.

00950                                                                 :
00951         mShiftOn(shiftOn), mView(view), mR(r) {}

Member Function Documentation

virtual kTGraph TGraphRectSelect::TraverseNode ( CLogNode * node ) [inline, virtual]

Implements TGraph.

Definition at line 953 of file GraphView.cpp.

References CWinLogData::Bounds, kTContinue, kTGetDown, kTGraph, mR, mShiftOn, mView, CWinLogData::Selected, CWinLogData::SelfBounds, and CWinLogData::SetSelected.

00954     {
00955         CWinLogData *data = (CWinLogData *)node->GetUserData();
00956
00957         // no need to go further
00958         CRect inter;
00959         if(!inter.IntersectRect(mR, data->Bounds()))
00960         {
00961             return kTContinue;
00962         }
00963         // self enclosed in the tracker ?
00964         CRect & b = data->SelfBounds();
00965         if(mR.PtInRect(b.TopLeft()) && mR.PtInRect(b.BottomRight()))
00966         {
00967             if(!mShiftOn)
00968             {
00969                 if(!data->Selected())
00970                     data->SetSelected(mView, true);
00971             }
00972             else
00973                 data->SetSelected(mView, !data->Selected());
00974         }
00975         // traverse childrens
00976         return kTGetDown;
00977     }

Member Data Documentation

CRect& TGraphRectSelect::mR [protected]

Definition at line 982 of file GraphView.cpp.

Referenced by TGraphRectSelect, and TraverseNode.

bool TGraphRectSelect::mShiftOn [protected]

Definition at line 980 of file GraphView.cpp.

Referenced by TGraphRectSelect, and TraverseNode.

CGraphView* TGraphRectSelect::mView [protected]

Definition at line 981 of file GraphView.cpp.

Referenced by TGraphRectSelect, and TraverseNode.

The documentation for this class was generated from the following file:
  • WinCvs/GraphView.cpp
Generated on Sun Feb 24 01:28:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TGraphSelNonSig Class Reference

Inheritance diagram for TGraphSelNonSig:

[legend]
Collaboration diagram for TGraphSelNonSig:

[legend]
List of all members.

Public Methods

TGraphSelNonSig (CGraphView *view)
virtual kTGraph TraverseNode (CLogNode *node)

Public Attributes

CGraphView * fView

Constructor & Destructor Documentation

TGraphSelNonSig::TGraphSelNonSig ( CGraphView * view ) [inline]

Definition at line 1467 of file GraphView.cpp.

References fView.

01467                                       : fView(view)
01468     {
01469     }

Member Function Documentation

virtual kTGraph TGraphSelNonSig::TraverseNode ( CLogNode * node ) [inline, virtual]

Implements TGraph.

Definition at line 1471 of file GraphView.cpp.

References fView, CWinLogData::GetType, kTGetDown, kTGraph, and CWinLogData::SetSelected.

01472     {
01473         CWinLogData *data = (CWinLogData *)node->GetUserData();
01474
01475         if(data->GetType() == kNodeRev)
01476         {
01477             if(node->Next() != 0L && node->Childs().size() == 0)
01478                 data->SetSelected(fView, true);
01479         }
01480
01481         return kTGetDown;
01482     }

Member Data Documentation

CGraphView* TGraphSelNonSig::fView

Definition at line 1484 of file GraphView.cpp.

Referenced by TGraphSelNonSig, and TraverseNode.

The documentation for this class was generated from the following file:
  • WinCvs/GraphView.cpp
Generated on Sun Feb 24 01:28:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TIconButton Class Reference

Inheritance diagram for TIconButton:

[legend]
The documentation for this class was generated from the following file:
  • rf/support/macapp/UPseudoSupport.h
Generated on Sun Feb 24 01:28:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TIconCheckBox Class Reference

Inheritance diagram for TIconCheckBox:

[legend]
The documentation for this class was generated from the following file:
  • rf/support/macapp/UPseudoSupport.h
Generated on Sun Feb 24 01:28:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TIconPopup Class Reference

Inheritance diagram for TIconPopup:

[legend]
The documentation for this class was generated from the following file:
  • rf/support/macapp/UPseudoSupport.h
Generated on Sun Feb 24 01:28:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UTimer Class Reference

used by the UWidget class to implement timers/repeaters. More...

#include <uwidget.h>

Collaboration diagram for UTimer:

[legend]
List of all members.

Public Methods

UTimer (int lap, int lastlap, int cmd)
UTimer ()
UTimer (const UTimer &src)
UTimer & | operator= (const UTimer &src)

Public Attributes

long | m_lap
long | m_lastlap
int | m_cmd

Detailed Description

used by the UWidget class to implement timers/repeaters.

Definition at line 57 of file uwidget.h.

Constructor & Destructor Documentation

UTimer::UTimer | ( | int | lap,
 |  | int | lastlap,
 |  | int | cmd
 | ) | [inline]

Definition at line 60 of file uwidget.h.

References m_cmd, m_lap, and m_lastlap.

00060 : m_lap(lap), m_lastlap(lastlap), m_cmd(cmd) {}

UTimer::UTimer ( ) [inline]

Definition at line 61 of file uwidget.h.

References m_cmd, m_lap, and m_lastlap.

00061 : m_lap(0), m_lastlap(0), m_cmd(0) {}

UTimer::UTimer ( const UTimer & src ) [inline]

Definition at line 62 of file uwidget.h.

References m_cmd, m_lap, and m_lastlap.

00062 : m_lap(src.m_lap), m_lastlap(src.m_lastlap), m_cmd(src.m_cmd) {}

Member Function Documentation

UTimer& UTimer::operator= ( const UTimer & src ) [inline]

Definition at line 64 of file uwidget.h.

References m_cmd, m_lap, and m_lastlap.

00065     {
00066         m_lastlap = src.m_lastlap;
00067         m_lap = src.m_lap;
00068         m_cmd = src.m_cmd;
00069
00070         return *this;
00071     }

Member Data Documentation

int UTimer::m_cmd

Definition at line 74 of file uwidget.h.

Referenced by operator=, UEventGiveTime, and UTimer.

long UTimer::m_lap

Definition at line 72 of file uwidget.h.

Referenced by operator=, UEventGiveTime, and UTimer.

long UTimer::m_lastlap

Definition at line 73 of file uwidget.h.

Referenced by operator=, UEventGiveTime, and UTimer.

The documentation for this class was generated from the following file:
  • rf/uwidget.h
Generated on Sun Feb 24 01:28:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CTipDlg Class Reference

#include <TipDlg.h>

Inheritance diagram for CTipDlg:

[legend]
Collaboration diagram for CTipDlg:

[legend]
List of all members.

Public Methods

CTipDlg (CWnd *pParent=NULL)
virtual | ~CTipDlg ()

Public Attributes

BOOL | m_bStartup
CString | m_strTip
FILE * | m_pStream

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnNextTip ()
afx_msg HBRUSH | OnCtlColor (CDC *pDC, CWnd *pWnd, UINT nCtlColor)
virtual void | OnOK ()
virtual BOOL | OnInitDialog ()
afx_msg void | OnPaint ()
void | GetNextTipString (CString &strNext)

Constructor & Destructor Documentation

CTipDlg::CTipDlg ( CWnd * pParent = NULL )

Definition at line 29 of file TipDlg.cpp.

References CG_IDP_FILE_CORRUPT, CG_IDS_FILE_ABSENT, CStr, CWincvsApp::GetAppPath, GetNextTipString, IDD_TIP, m_bStartup, m_pStream, m_strTip, NULL, szIntFilePos, szIntStartup, szSection, szTimeStamp, and TRUE.

00030     : CDialog(IDD_TIP, pParent)
00031 {
00032     //{{AFX_DATA_INIT(CTipDlg)
00033     m_bStartup = TRUE;
00034     //}}AFX_DATA_INIT
00035
00036     // We need to find out what the startup and file position parameters are
00037     // If startup does not exist, we assume that the Tips on startup is checked TRUE.
00038     CWincvsApp* pApp = (CWincvsApp *)AfxGetApp();
00039     m_bStartup = !pApp->GetProfileInt(szSection, szIntStartup, 0);
00040     UINT iFilePos = pApp->GetProfileInt(szSection, szIntFilePos, 0);
00041     CStr tips;
00042     pApp->GetAppPath(tips);
00043     if(!tips.empty() && !tips.endsWith(kPathDelimiter))
00044     {
00045         tips << kPathDelimiter;
00046     }
00047     tips << "tips.txt";
00048
00049     // Now try to open the tips file
00050     m_pStream = fopen(tips, "r");
00051 #if qCvsDebug
00052     if(m_pStream == 0L)
00053         m_pStream = fopen("c:\\cvsgui\\wincvs\\hlp\\tips.txt", "r");
00054     if(m_pStream == 0L)
00055         m_pStream = fopen("d:\\cvsgui\\wincvs\\hlp\\tips.txt", "r");
00056     if(m_pStream == 0L)
00057         m_pStream = fopen("e:\\cvsgui\\wincvs\\hlp\\tips.txt", "r");
00058     if(m_pStream == 0L)
00059         m_pStream = fopen("f:\\cvsgui\\wincvs\\hlp\\tips.txt", "r");
00060 #endif
00061     if (m_pStream == NULL)
00062     {
00063         m_strTip.LoadString(CG_IDS_FILE_ABSENT);
00064         return;
00065     }
00066
00067     // If the timestamp in the INI file is different from the timestamp of
00068     // the tips file, then we know that the tips file has been modified
00069     // Reset the file position to 0 and write the latest timestamp to the
00070     // ini file
00071     struct _stat buf;
00072     _fstat(_fileno(m_pStream), &buf);
00073     CString strCurrentTime = ctime(&buf.st_ctime);
00074     strCurrentTime.TrimRight();
00075     CString strStoredTime =
00076         pApp->GetProfileString(szSection, szTimeStamp, NULL);
00077     if (strCurrentTime != strStoredTime)
00078     {
00079         iFilePos = 0;
00080         pApp->WriteProfileString(szSection, szTimeStamp, strCurrentTime);
00081     }
00082
00083     if (fseek(m_pStream, iFilePos, SEEK_SET) != 0)
00084     {
00085         AfxMessageBox(CG_IDP_FILE_CORRUPT);
00086     }
00087     else
00088     {
00089         GetNextTipString(m_strTip);
00090     }
00091 }

CTipDlg::~CTipDlg ( ) [virtual]

Definition at line 93 of file TipDlg.cpp.

References m_pStream, NULL, szIntFilePos, and szSection.

00094 {
00095     // This destructor is executed whether the user had pressed the escape key
00096     // or clicked on the close button. If the user had pressed the escape key,
00097     // it is still required to update the filepos in the ini file with the
00098     // latest position so that we don't repeat the tips!
00099
00100     // But make sure the tips file existed in the first place....
00101     if (m_pStream != NULL)
00102     {
00103         CWinApp* pApp = AfxGetApp();
00104         pApp->WriteProfileInt(szSection, szIntFilePos, ftell(m_pStream));
00105         fclose(m_pStream);
00106     }
00107 }

Member Function Documentation

void CTipDlg::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 109 of file TipDlg.cpp.

References IDC_STARTUP, IDC_TIPSTRING, m_bStartup, and m_strTip.

00110 {
00111     CDialog::DoDataExchange(pDX);
00112     //{{AFX_DATA_MAP(CTipDlg)
00113     DDX_Check(pDX, IDC_STARTUP, m_bStartup);
00114     DDX_Text(pDX, IDC_TIPSTRING, m_strTip);
00115     //}}AFX_DATA_MAP
00116 }

void CTipDlg::GetNextTipString ( CString & strNext ) [protected]

Definition at line 135 of file TipDlg.cpp.

References CG_IDP_FILE_CORRUPT, FALSE, m_pStream, MAX_BUFLEN, NULL, and TRUE.

Referenced by CTipDlg, and OnNextTip.

00136 {
00137     LPTSTR lpsz = strNext.GetBuffer(MAX_BUFLEN);
00138
00139     // This routine identifies the next string that needs to be
00140     // read from the tips file
00141     BOOL bStop = FALSE;
00142     while (!bStop)
00143     {
00144         if (_fgetts(lpsz, MAX_BUFLEN, m_pStream) == NULL)
00145         {
00146             // We have either reached EOF or enocuntered some problem
00147             // In both cases reset the pointer to the beginning of the file
00148             // This behavior is same as VC++ Tips file
00149             if (fseek(m_pStream, 0, SEEK_SET) != 0)
00150                 AfxMessageBox(CG_IDP_FILE_CORRUPT);
00151         }
00152         else
00153         {
00154             if (*lpsz != ' ' && *lpsz != '\t' &&
00155                 *lpsz != '\n' && *lpsz != ';')
00156             {
00157                 // There should be no space at the beginning of the tip
00158                 // This behavior is same as VC++ Tips file
00159                 // Comment lines are ignored and they start with a semicolon
00160                 bStop = TRUE;
00161             }
00162         }
00163     }
00164     strNext.ReleaseBuffer();
00165 }

HBRUSH CTipDlg::OnCtlColor | ( | CDC * | pDC,
 |  | CWnd * | pWnd,
 |  | UINT | nCtlColor
 | ) | [protected]

Definition at line 167 of file TipDlg.cpp.

References IDC_TIPSTRING.

00168 {
00169     if (pWnd->GetDlgCtrlID() == IDC_TIPSTRING)
00170         return (HBRUSH)GetStockObject(WHITE_BRUSH);
00171
00172     return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
00173 }

BOOL CTipDlg::OnInitDialog ( ) [protected, virtual]

Definition at line 184 of file TipDlg.cpp.

References FALSE, m_pStream, NULL, and TRUE.

00185 {
00186     CDialog::OnInitDialog();
00187
00188     // If Tips file does not exist then disable NextTip
00189     if (m_pStream == NULL)
00190         GetDlgItem(IDC_NEXTTIP)->EnableWindow(FALSE);
00191
00192     return TRUE;  // return TRUE unless you set the focus to a control
00193 }

void CTipDlg::OnNextTip ( ) [protected]

Definition at line 129 of file TipDlg.cpp.

References FALSE, GetNextTipString, and m_strTip.

00130 {
00131     GetNextTipString(m_strTip);
00132     UpdateData(FALSE);
00133 }

void CTipDlg::OnOK ( ) [protected, virtual]

Definition at line 175 of file TipDlg.cpp.

References m_bStartup, szIntStartup, and szSection.

00176 {
00177     CDialog::OnOK();
00178
00179     // Update the startup information stored in the INI file
00180     CWinApp* pApp = AfxGetApp();
00181     pApp->WriteProfileInt(szSection, szIntStartup, !m_bStartup);
00182 }

void CTipDlg::OnPaint ( ) [protected]

Definition at line 195 of file TipDlg.cpp.

References CG_IDS_DIDYOUKNOW, IDB_LIGHTBULB, and IDC_BULB.

00196 {
00197     CPaintDC dc(this); // device context for painting
00198
00199     // Get paint area for the big static control
00200     CWnd* pStatic = GetDlgItem(IDC_BULB);
00201     CRect rect;
00202     pStatic->GetWindowRect(&rect);
00203     ScreenToClient(&rect);
00204
00205     // Paint the background white.
00206     CBrush brush;
00207     brush.CreateStockObject(WHITE_BRUSH);
00208     dc.FillRect(rect, &brush);
00209
00210     // Load bitmap and get dimensions of the bitmap
00211     CBitmap bmp;
00212     bmp.LoadBitmap(IDB_LIGHTBULB);
00213     BITMAP bmpInfo;
00214     bmp.GetBitmap(&bmpInfo);
00215
00216     // Draw bitmap in top corner and validate only top portion of window
00217     CDC dcTmp;
00218     dcTmp.CreateCompatibleDC(&dc);
00219     dcTmp.SelectObject(&bmp);
00220     rect.bottom = bmpInfo.bmHeight + rect.top;
00221     dc.BitBlt(rect.left, rect.top, rect.Width(), rect.Height(),
00222         &dcTmp, 0, 0, SRCCOPY);
00223
00224     // Draw out "Did you know..." message next to the bitmap
00225     CString strMessage;
00226     strMessage.LoadString(CG_IDS_DIDYOUKNOW);
00227     rect.left += bmpInfo.bmWidth;
00228     dc.DrawText(strMessage, rect, DT_VCENTER | DT_SINGLELINE);
00229
00230     // Do not call CDialog::OnPaint() for painting messages
00231 }

Member Data Documentation

BOOL CTipDlg::m_bStartup

Definition at line 18 of file TipDlg.h.

Referenced by CTipDlg, DoDataExchange, OnOK, and CWincvsApp::ShowTipAtStartup.

FILE* CTipDlg::m_pStream

Definition at line 22 of file TipDlg.h.

Referenced by CTipDlg, GetNextTipString, OnInitDialog, and ~CTipDlg.

CString CTipDlg::m_strTip

Definition at line 19 of file TipDlg.h.

Referenced by CTipDlg, DoDataExchange, and OnNextTip.

The documentation for this class was generated from the following files:
  • WinCvs/TipDlg.h
  • WinCvs/TipDlg.cpp
Generated on Sun Feb 24 01:28:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TemplateTMPersistent class Reference

TMPersistent Class Template Reference

#include <MultiString.h>

Inheritance diagram for TMPersistent:

[legend]
Collaboration diagram for TMPersistent:

[legend]
List of all members.

Public Types

typedef ::vector< T > | list_t

Public Methods

TMPersistent (const char *uniqueName, kClassPersistent pclass=kNoClass)
virtual | ~TMPersistent ()
virtual unsigned int | SizeOf (void) const
virtual const void * | GetData (void) const
virtual void | SetData (const void *ptr, unsigned int size)
const list_t & | GetList (void) const
list_t & | GetList (void)

Protected Attributes

list_t fAllItems
CStaticAllocT< char > | fBuf

template<class T>
class TMPersistent< T >

Member Typedef Documentation

template<class T>
typedef :: vector<T> TMPersistent::list_t

Definition at line 45 of file MultiString.h.

Referenced by GetList.

Constructor & Destructor Documentation

template<class T>
TMPersistent< T >::TMPersistent | ( | const char * | uniqueName,
 |  | kClassPersistent | pclass = kNoClass
 | ) | [inline]

Definition at line 47 of file MultiString.h.

References kClassPersistent, and kNoClass.

00048     : CPersistent(uniqueName, pclass) {};

template<class T>
virtual TMPersistent< T >::~TMPersistent ( ) [inline, virtual]

Definition at line 50 of file MultiString.h.

00050 {};

Member Function Documentation

template<class T>
virtual const void* TMPersistent< T >::GetData ( void ) const [inline, virtual]

Implements CPersistent.

Definition at line 53 of file MultiString.h.

References CStaticAllocT< char >::AdjustSize, fAllItems, fBuf, and SizeOf.

00054         {
00055             fBuf.AdjustSize(SizeOf());
00056             char *tmp = fBuf;
00057             *(int *) tmp = fAllItems.size();
00058             tmp += sizeof(int) / sizeof(char);
00059
00060             for(list_t::const_iterator i = fAllItems.begin(); i != fAllItems.end(); ++i)
00061             {
00062                 memcpy(tmp, (const char *)(&*i), sizeof (T));
00063                 tmp += sizeof (T);
00064             }
00065
00066             return (char *)fBuf;
00067         };

template<class T>
list_t& TMPersistent< T >::GetList ( void ) [inline]

Definition at line 84 of file MultiString.h.

References fAllItems, and list_t.

00084 { return fAllItems; }

template<class T>
const list_t& TMPersistent< T >::GetList ( void ) const [inline]

Definition at line 83 of file MultiString.h.

References fAllItems, and list_t.

00083 { return fAllItems; }

template<class T>
virtual void TMPersistent< T >::SetData | ( | const void * | ptr,
 |  | unsigned int | size
 | ) | [inline, virtual]

Implements CPersistent.

Definition at line 69 of file MultiString.h.

References fAllItems.

00070         {
00071             const char *tmp = (char *)ptr;
00072             fAllItems.erase(fAllItems.begin(), fAllItems.end());
00073             unsigned int thesize = *(int *)tmp;
00074             tmp += sizeof(int) / sizeof(char);
00075             for(unsigned int i = 0; i < thesize; ++i)
00076             {
00077                 fAllItems.push_back(*((T*)tmp));
00078                 tmp += sizeof (T);
00079             }
00080         };

template<class T>
virtual unsigned int TMPersistent< T >::SizeOf ( void ) const [inline, virtual]

Implements CPersistent.

Definition at line 52 of file MultiString.h.

References fAllItems.

Referenced by GetData.

00052 {return sizeof (int) + sizeof (T) * fAllItems.size ();};

Member Data Documentation

template<class T>
list_t TMPersistent::fAllItems [protected]

Definition at line 87 of file MultiString.h.

Referenced by GetData, GetList, SetData, and SizeOf.

template<class T>
CStaticAllocT<char> TMPersistent::fBuf [protected]

Definition at line 88 of file MultiString.h.

Referenced by GetData.

The documentation for this class was generated from the following file:
  • common/MultiString.h
Generated on Sun Feb 24 01:28:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CTmpFiles Class Reference

Collaboration diagram for CTmpFiles:

[legend]
List of all members.

Public Methods

~CTmpFiles ()
const char * push_back (const char *file)

Protected Attributes

std::vector< UStr > allfiles

Constructor & Destructor Documentation

CTmpFiles::~CTmpFiles ( ) [inline]

Definition at line 773 of file AppGlue.cpp.

References allfiles.

00774     {
00775         std::vector<CStr>::const_iterator i;
00776         for(i = allfiles.begin(); i != allfiles.end(); ++i)
00777         {
00778             const char *file = *i;
00779             unlink((char *)file);
00780         }
00781     }

Member Function Documentation

const char* CTmpFiles::push_back ( const char * file ) [inline]

Definition at line 783 of file AppGlue.cpp.

References allfiles.

Referenced by launchCVS.

00784     {
00785         allfiles.push_back(file);
00786         return allfiles[allfiles.size() - 1];
00787     }

Member Data Documentation

std::vector< UStr > CTmpFiles::allfiles [protected]

Definition at line 789 of file AppGlue.cpp.

Referenced by push_back, and ~CTmpFiles.

The documentation for this class was generated from the following file:
  • common/AppGlue.cpp
Generated on Sun Feb 24 01:28:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TemplateTMString class Reference

TMString Class Template Reference

#include <MultiString.h>

Inheritance diagram for TMString:

[legend]
Collaboration diagram for TMString:

[legend]
List of all members.

Public Types

typedef ::vector< T > | list_t

Public Methods

TMString (unsigned int maxstr, const char *uniqueName, char *const *defaultStr=0L, kClassPersistent pclass=kNoClass)
virtual | ~TMString ()
virtual unsigned int | SizeOf (void) const
virtual const void * | GetData (void) const
virtual void | SetData (const void *ptr, unsigned int size)
void | Insert (const char *newstr)
bool | Remove (const char *newstr)
list_t::const_iterator | Find (const char *instr) const
const list_t & | GetList (void) const
list_t::const_iterator | begin () const
list_t::const_iterator | end () const

Protected Methods

virtual int | Compare (const char *s1, const char *s2) const

Protected Attributes

list_t fAllStrs
CStaticAllocT< char > | fBuf
unsigned int | fMaxStr

template<class T>
class TMString< T >

Member Typedef Documentation

template<class T>
typedef :: vector<T> TMString::list_t

Definition at line 95 of file MultiString.h.

Referenced by TMString< UPStr >::GetList.

Constructor & Destructor Documentation

template<class T>
TMString< T >::TMString | ( | unsigned int | maxstr,
 |  | const char * | uniqueName,
 |  | char *const * | defaultStr = 0L,
 |  | kClassPersistent | pclass = kNoClass
 | ) |

Definition at line 43 of file MultiString.cpp.

References Insert, and kClassPersistent.

00044                              : CPersistent(uniqueName, pclass), fMaxStr(maxstr)
00045 {
00046     if(defaultStr != 0L)
00047     {
00048         int i = 0;
00049         while(defaultStr[i] != 0L)
00050         {
00051             Insert(defaultStr[i++]);
00052         }
00053     }
00054 }

template<class T>
TMString< T >::~TMString ( ) [virtual]

Definition at line 57 of file MultiString.cpp.

00058 {
00059 }

Member Function Documentation

template<class T>
list_t::const_iterator TMString< T >::begin ( ) const [inline]

Definition at line 118 of file MultiString.h.

00118 { return GetList ().begin ();};

template<class T>
virtual int TMString< T >::Compare | ( | const char * | s1,
 |  | const char * | s2
 | ) | const [inline, protected, virtual]

Reimplemented in CKeyString.

Definition at line 122 of file MultiString.h.

Referenced by Find, Insert, and Remove.

00123     {
00124         return strcmp(s1, s2);
00125     }

template<class T>
list_t::const_iterator TMString< T >::end ( ) const [inline]

Definition at line 119 of file MultiString.h.

00119 { return GetList ().end ();};

template<class T>
TMString< T >::list_t::const_iterator TMString< T >::Find ( const char * instr ) const

Definition at line 111 of file MultiString.cpp.

References Compare, and fAllStrs.

00112 {
00113     TMString<T>::list_t::const_iterator i;
00114     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00115         if(Compare(*i, instr) == 0) break;
00116
00117     return i;
00118 }

template<class T>
const void * TMString< T >::GetData ( void ) const [virtual]

Implements CPersistent.

Definition at line 75 of file MultiString.cpp.

References fAllStrs, fBuf, NAMESPACE, and SizeOf.

00076 {
00077     unsigned int thesize = SizeOf(), tmpsize;
00078     ((TMString *)this)->fBuf.AdjustSize(thesize);
00079     char *tmp = ((TMString *)this)->fBuf;
00080     *(int *)tmp = fAllStrs.size();
00081     tmp += sizeof(int) / sizeof(char);
00082
00083     NAMESPACE(std) vector<T>::const_iterator i;
00084     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00085     {
00086         tmpsize = (*i).length() + 1;
00087         memcpy(tmp, (const char *)(*i), tmpsize * sizeof(char));
00088         tmp += tmpsize;
00089     }
00090
00091     return (char *)fBuf;
00092 }

template<class T>
const list_t& TMString< T >::GetList ( void ) const [inline]

Definition at line 117 of file MultiString.h.

Referenced by TMString< UPStr >::begin, and TMString< UPStr >::end.

00117 { return fAllStrs; }

template<class T>
void TMString< T >::Insert ( const char * newstr )

Definition at line 121 of file MultiString.cpp.

References Compare, fAllStrs, fMaxStr, NAMESPACE, and CPersistent::TouchTimeStamp.

Referenced by TMString.

00122 {
00123     TouchTimeStamp();
00124
00125     NAMESPACE(std) vector<T>::iterator i;
00126     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00127     {
00128         if(Compare(*i, newstr) == 0)
00129         {
00130             fAllStrs.erase(i);
00131             fAllStrs.insert(fAllStrs.begin(), T(newstr));
00132             return;
00133         }
00134     }
00135     fAllStrs.insert(fAllStrs.begin(), T(newstr));
00136     if(fAllStrs.size() > fMaxStr)
00137     {
00138         fAllStrs.erase(fAllStrs.begin() + fMaxStr, fAllStrs.end());
00139     }
00140 }

template<class T>
bool TMString< T >::Remove ( const char * newstr )

Definition at line 143 of file MultiString.cpp.

References Compare, fAllStrs, NAMESPACE, and CPersistent::TouchTimeStamp.

00144 {
00145
00146     NAMESPACE(std) vector<T>::iterator i;
00147     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00148     {
00149         if(Compare(*i, newstr) == 0)
00150         {
00151             TouchTimeStamp();
00152             fAllStrs.erase(i);
00153             return true;
00154         }
00155     }
00156
00157     return false;
00158 }

template<class T>
void TMString< T >::SetData | ( | const void * | ptr,
 |  | unsigned int | size
 | ) | [virtual]

Implements CPersistent.

Definition at line 95 of file MultiString.cpp.

References fAllStrs, and fMaxStr.

00096 {
00097     const char *tmp = (char *)ptr;
00098     unsigned int thesize;
00099     fAllStrs.erase(fAllStrs.begin(), fAllStrs.end());
00100     thesize = *(int *)tmp;
00101     tmp += sizeof(int) / sizeof(char);
00102     for(unsigned int i = 0; i < thesize && i < fMaxStr; i++)
00103     {
00104         fAllStrs.push_back(T(tmp));
00105         tmp += strlen(tmp) + 1;
00106     }
00107 }

template<class T>
unsigned int TMString< T >::SizeOf ( void ) const [virtual]

Implements CPersistent.

Definition at line 62 of file MultiString.cpp.

References fAllStrs, and NAMESPACE.

Referenced by GetData.

00063 {
00064     NAMESPACE(std) vector<T>::const_iterator i;
00065     unsigned int thesize = sizeof(int);
00066
00067     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00068     {
00069         thesize += (*i).length() + 1;
00070     }
00071     return thesize;
00072 }

Member Data Documentation

template<class T>
list_t TMString::fAllStrs [protected]

Definition at line 127 of file MultiString.h.

Referenced by Find, GetData, TMString< UPStr >::GetList, Insert, Remove, SetData, and SizeOf.

template<class T>
CStaticAllocT<char> TMString::fBuf [protected]

Definition at line 128 of file MultiString.h.

Referenced by GetData.

template<class T>
unsigned int TMString::fMaxStr [protected]

Definition at line 129 of file MultiString.h.

Referenced by Insert, and SetData.

The documentation for this class was generated from the following files:
  • common/MultiString.h
  • common/MultiString.cpp
Generated on Sun Feb 24 01:28:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UToolbar Class Reference

#include <utoolbar.h>

Inheritance diagram for UToolbar:

[legend]
Collaboration diagram for UToolbar:

[legend]
List of all members.

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UToolbar (int widid)
virtual | ~UToolbar ()
virtual int | UDispatchMessage (int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo)
this is overided in order to broadcast to the listeners. More...

Static Public Methods

const URuntimeClass * | rtUToolbar (void)

Protected Methods

void | OnDestroy ()
void | OnTbInit (UTB_INIT *info)
void | OnTbEnd (void)
void | OnTbButton (UTB_BUTTON *info)
void | OnTbDropDown (UTB_DROPDOWN *info)
void | OnTbCheckBtn (UTB_BUTTON *info)
void | OnTbSeparator (void)
void | OnSetTooltip (int cmd, UCmdUI *pCmdUI)
EV_USETTOOLTIP message handling
Warning:
not documented.
 More...

int | OnCommands (int cmd)
void | OnUpdateUI (void)
EV_UPDATEUI is a notification sent to all the widgets when the user interface is invalid. the default is to send a EV_UPDTCMD to each sub-widget. More...

void | RebuildBar (bool onlyBitmap=true)
virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Protected Attributes

WININFO * m_winInfo
CDynToolBar * m_wndToolBar

Static Protected Attributes

const URuntimeClass | classUToolbar
const UMSGMAP | messageMap = { UWidget ::GetThisMessageMap(), & UToolbar ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Constructor & Destructor Documentation

UToolbar::UToolbar ( int widid )

Definition at line 424 of file utoolbar.cpp.

00424                             : UWidget(widid), m_winInfo(0L)
00425 #ifdef WIN32
00426     , m_wndToolBar(0L)
00427 #endif
00428 {
00429 }

UToolbar::~UToolbar ( ) [virtual]

Definition at line 431 of file utoolbar.cpp.

00432 {
00433 }

Member Function Documentation

const URuntimeClass * UToolbar::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Reimplemented in UCvsToolbar.

Definition at line 57 of file utoolbar.cpp.

const UMSGMAP * UToolbar::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Reimplemented in UCvsToolbar.

Definition at line 59 of file utoolbar.cpp.

const UMSGMAP * UToolbar::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Reimplemented in UCvsToolbar.

Definition at line 59 of file utoolbar.cpp.

const URuntimeClass * UToolbar::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Reimplemented in UCvsToolbar.

Definition at line 57 of file utoolbar.cpp.

const UMSGMAP * UToolbar::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Reimplemented in UCvsToolbar.

Definition at line 59 of file utoolbar.cpp.

int UToolbar::OnCommands ( int cmd ) [protected]

Definition at line 794 of file utoolbar.cpp.

References EV_CMD, UCmdTarget::GetWidID, USemaphore::IsEnteredTwice, UWidget::sFocusWidID, STD, UAppConsole, UEventGetTargets, and UEventSendMessageExt.

00795 {
00796     static bool sSemaphore = false;
00797     USemaphore policeman(sSemaphore);
00798     if(policeman.IsEnteredTwice())
00799         return 1;
00800
00801     // this is the interesting thing about the toolbar : it resends the
00802     // commands to other widgets according to the focus information and
00803     // allows the command to be handled several times if the handler return 1
00804
00805     const STD map<int, UCmdTarget *> & targets = UEventGetTargets();
00806     int res = 0;
00807     int handledFlag;
00808
00809     // first forward the command to the focused widget : if it soesn't want it
00810     // we give it to the next pseudo widget.
00811     if(sFocusWidID != -1 && sFocusWidID != GetWidID())
00812     {
00813         res = UEventSendMessageExt(sFocusWidID, EV_CMD, cmd, 0L, &handledFlag);
00814         if(res == 0 && handledFlag)
00815             return 0;
00816     }
00817
00818     STD map<int, UCmdTarget *>::const_iterator i;
00819     for(i = targets.begin(); i != targets.end(); ++i)
00820     {
00821         int widid = (*i).first;
00822         if(widid == sFocusWidID || widid == GetWidID())
00823             continue;
00824         res = UEventSendMessageExt(widid, EV_CMD, cmd, 0L, &handledFlag);
00825         if(res == 0 && handledFlag)
00826             return 0;
00827     }
00828
00829     UAppConsole("The cmd %d of the toolbar has no command handler\n", cmd);
00830
00831     return 0;
00832 }

void UToolbar::OnDestroy ( ) [protected]

Reimplemented in UCvsToolbar.

Definition at line 733 of file utoolbar.cpp.

References m_winInfo.

00734 {
00735     if(m_winInfo != 0L)
00736         delete m_winInfo;
00737 }

void UToolbar::OnSetTooltip | ( | int | cmd,
 |  | UCmdUI * | pCmdUI
 | ) | [protected]

EV_USETTOOLTIP message handling

Warning:
not documented.

Reimplemented from UWidget.

Definition at line 769 of file utoolbar.cpp.

References WININFO::entries, TbEntryDropDown::icons, TbEntry::kind, m_winInfo, WININFO::Search, UCmdUI::SetTooltip, tbeButton, tbeDropDown, awidget::tooltip, and TbEntryButton::wid.

00770 {
00771     WININFO *info = m_winInfo;
00772     if(info == 0L)
00773         return;
00774
00775     int index;
00776     std::vector<TbEntry *>::iterator f = info->Search(cmd, &index);
00777     if(f == info->entries.end())
00778         return;
00779
00780     TbEntry * entry = *f;
00781     if(entry->kind == tbeDropDown)
00782     {
00783         TbEntryDropDown *drop = (TbEntryDropDown *)entry;
00784         awidget & wid = drop->icons[index];
00785         pCmdUI->SetTooltip(wid.tooltip);
00786     }
00787     else if(entry->kind == tbeButton)
00788     {
00789         TbEntryButton *btn = (TbEntryButton *)entry;
00790         pCmdUI->SetTooltip(btn->wid.tooltip);
00791     }
00792 }

void UToolbar::OnTbButton ( UTB_BUTTON * info ) [protected]

Definition at line 624 of file utoolbar.cpp.

References ASSERT, UTB_BUTTON::cmd, WININFO::entries, EV_INIT_WIDGET, UWidget::GetWidget, UCmdTarget::GetWidID, UTB_BUTTON::icon, kUMainWidget, m_winInfo, m_wndToolBar, NEW, UTB_BUTTON::tooltip, UEventSendMessage, UMakeBitmap, and UTB_BUTTON::varcode.

00625 {
00626 #ifdef WIN32
00627     ASSERT(m_wndToolBar != 0L);
00628 #endif
00629
00630     WININFO & tb = *m_winInfo;
00631     HBITMAP bitmap = UMakeBitmap((char **)info->icon);
00632     TbEntryButton *btn = NEW TbEntryButton(bitmap, info->cmd,
00633         info->tooltip, info->varcode);
00634     tb.entries.push_back(btn);
00635
00636 #ifdef qGTK
00637     char status[256] = {'\0'};
00638     char prompt[256] = {'\0'};
00639
00640     strcpy(status, info->tooltip);
00641     char *cr = strchr(status, '\n');
00642     if(cr != 0L)
00643     {
00644         strcpy(prompt, cr + 1);
00645         *cr = '\0';
00646     }
00647     GtkToolbar *toolbar = GTK_TOOLBAR(GetWidget(kUMainWidget));
00648     GtkWidget *tmp_toolbar_icon = info->icon != 0L ?
00649         create_pixmap(GTK_WIDGET(toolbar), (const char *)info->icon) : 0L;
00650     GtkWidget *wid = gtk_toolbar_append_element(toolbar, GTK_TOOLBAR_CHILD_BUTTON, 0L,
00651                                                 prompt, status, 0L,
00652                                                 tmp_toolbar_icon, 0L, 0L);
00653     UEventSendMessage(GetWidID(), EV_INIT_WIDGET, info->cmd, wid);
00654 #endif
00655 }

void UToolbar::OnTbCheckBtn ( UTB_BUTTON * info ) [protected]

Definition at line 699 of file utoolbar.cpp.

References ASSERT, UTB_BUTTON::cmd, WININFO::entries, EV_INIT_WIDGET, UWidget::GetWidget, UCmdTarget::GetWidID, UTB_BUTTON::icon, kUMainWidget, m_winInfo, m_wndToolBar, NEW, UTB_BUTTON::tooltip, UEventSendMessage, UMakeBitmap, and UTB_BUTTON::varcode.

00700 {
00701 #ifdef WIN32
00702     ASSERT(m_wndToolBar != 0L);
00703 #endif
00704
00705     WININFO & tb = *m_winInfo;
00706     HBITMAP bitmap = UMakeBitmap((char **)info->icon);
00707     TbEntryButton *btn = NEW TbEntryChkButton(bitmap, info->cmd,
00708         info->tooltip, info->varcode);
00709     tb.entries.push_back(btn);
00710
00711 #ifdef qGTK
00712     char status[256] = {'\0'};
00713     char prompt[256] = {'\0'};
00714
00715     strcpy(status, info->tooltip);
00716     char *cr = strchr(status, '\n');
00717     if(cr != 0L)
00718     {
00719         strcpy(prompt, cr + 1);
00720         *cr = '\0';
00721     }
00722     GtkToolbar *toolbar = GTK_TOOLBAR(GetWidget(kUMainWidget));
00723     GtkWidget *tmp_toolbar_icon = info->icon != 0L ?
00724         create_pixmap(GTK_WIDGET(toolbar), (const char *)info->icon) : 0L;
00725     GtkWidget *wid = gtk_toolbar_append_element(toolbar, GTK_TOOLBAR_CHILD_TOGGLEBUTTON, 0L,
00726                                                 prompt, status, 0L,
00727                                                 tmp_toolbar_icon, 0L, 0L);
00728     UEventSendMessage(GetWidID(), EV_INIT_WIDGET, info->cmd, wid);
00729 #endif
00730 }

void UToolbar::OnTbDropDown ( UTB_DROPDOWN * info ) [protected]

Definition at line 675 of file utoolbar.cpp.

References ASSERT, UTB_DROPDOWN::btns, UTB_BUTTON::cmd, TbEntryDropDown::current, WININFO::entries, UTB_BUTTON::icon, TbEntryDropDown::icons, UTB_DROPDOWN::initialcmd, m_winInfo, m_wndToolBar, NEW, UTB_BUTTON::tooltip, UMakeBitmap, and UTB_BUTTON::varcode.

00676 {
00677 #ifdef WIN32
00678     ASSERT(m_wndToolBar != 0L);
00679 #endif
00680
00681     WININFO & tb = *m_winInfo;
00682     TbEntryDropDown *drop = NEW TbEntryDropDown();
00683     tb.entries.push_back(drop);
00684     int current = 0;
00685
00686     UTB_BUTTON *btns = info->btns;
00687     while(btns->icon != 0L)
00688     {
00689         HBITMAP bitmap = UMakeBitmap((char **)btns->icon);
00690         awidget ad(bitmap, btns->cmd, btns->tooltip, btns->varcode);
00691         drop->icons.push_back(ad);
00692         if(btns->cmd == info->initialcmd)
00693             drop->current = current;
00694         btns++;
00695         current++;
00696     }
00697 }

void UToolbar::OnTbEnd ( void ) [protected]

Definition at line 617 of file utoolbar.cpp.

References RebuildBar.

00618 {
00619 #ifdef WIN32
00620     RebuildBar(false);
00621 #endif
00622 }

void UToolbar::OnTbInit ( UTB_INIT * info ) [protected]

Definition at line 435 of file utoolbar.cpp.

References CCJToolBar::Create, CDynToolBar::GetMainFrame, UWidget::GetWidget, UCmdTarget::GetWidID, UTB_INIT::heightbtn, kUMainWidget, m_winInfo, m_wndToolBar, NEW, CDynToolBar::SetPseudoID, CCJToolBar::SetSizes, CDynToolBar::SetWinInfo, UTB_INIT::title, VERIFY, UTB_INIT::widthbtn, and UTB_INIT::winid.

00436 {
00437     m_winInfo = NEW WININFO(info->widthbtn, info->heightbtn);
00438
00439 #ifdef WIN32
00440     WININFO & tb = *m_winInfo;
00441     m_wndToolBar = new CDynToolBar;
00442     CFrameWnd *f = m_wndToolBar->GetMainFrame();
00443     VERIFY(m_wndToolBar->Create(f, WS_CHILD | WS_VISIBLE | CBRS_TOP, info->winid));
00444     m_wndToolBar->SetBarStyle(m_wndToolBar->GetBarStyle() |
00445         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
00446     m_wndToolBar->EnableDocking(CBRS_ALIGN_ANY);
00447     m_wndToolBar->SetWinInfo(m_winInfo);
00448     m_wndToolBar->SetPseudoID(GetWidID());
00449     f->DockControlBar(m_wndToolBar);
00450
00451     // configure the Win32 toolbar
00452     if(info->title != 0L)
00453         m_wndToolBar->SetWindowText(info->title);
00454     m_wndToolBar->SetSizes(CSize(info->widthbtn+7,info->heightbtn+6),
00455         CSize(info->widthbtn,info->heightbtn));
00456 #endif
00457 #ifdef qGTK
00458     void *wid = GetWidget(kUMainWidget);
00459     g_assert(wid != 0L && GTK_IS_TOOLBAR(wid));
00460 #endif
00461 }

void UToolbar::OnTbSeparator ( void ) [protected]

Definition at line 657 of file utoolbar.cpp.

References ASSERT, WININFO::entries, UWidget::GetWidget, kUMainWidget, m_winInfo, m_wndToolBar, and NEW.

00658 {
00659 #ifdef WIN32
00660     ASSERT(m_wndToolBar != 0L);
00661 #endif
00662
00663     WININFO & tb = *m_winInfo;
00664     TbEntrySeparator *btn = NEW TbEntrySeparator();
00665     tb.entries.push_back(btn);
00666
00667 #ifdef qGTK
00668     GtkToolbar *toolbar = GTK_TOOLBAR(GetWidget(kUMainWidget));
00669     /*GtkWidget *wid = */gtk_toolbar_append_element(toolbar, GTK_TOOLBAR_CHILD_SPACE, 0L,
00670                                                 0L, 0L, 0L,
00671                                                 0L, 0L, 0L);
00672 #endif
00673 }

void UToolbar::OnUpdateUI ( void ) [protected]

EV_UPDATEUI is a notification sent to all the widgets when the user interface is invalid. the default is to send a EV_UPDTCMD to each sub-widget.

Reimplemented from UWidget.

Definition at line 834 of file utoolbar.cpp.

References UCmdUI::CanContinue, awidget::cmd, UCmdUI::Enable, WININFO::entries, EV_UPDTCMD, UWidget::GetWidget, UCmdTarget::GetWidID, USemaphore::IsEnteredTwice, TbEntry::kind, UCmdUI::m_nID, UCmdUI::m_widget, m_winInfo, UWidget::sFocusWidID, STD, tbeButton, UEventGetTargets, UEventSendMessage, and TbEntryButton::wid.

00835 {
00836 // on Windows the update UI is sent by MFC
00837 #ifndef WIN32
00838     WININFO *info = m_winInfo;
00839     if(info == 0L)
00840         return;
00841
00842     static bool sSemaphore = false;
00843     USemaphore policeman(sSemaphore);
00844     if(policeman.IsEnteredTwice())
00845         return;
00846
00847     // this is the interesting thing about the toolbar : it resends the
00848     // update UI to other widgets according to the focus information and
00849     // allows the update to be handled several times if the handler asks for it
00850     // (by using UCmdUI::SetContinue)
00851
00852     const STD map<int, UCmdTarget *> & targets = UEventGetTargets();
00853     std::vector<TbEntry *>::const_iterator f;
00854     int cmdid;
00855
00856     for(f = info->entries.begin(); f != info->entries.end(); ++f)
00857     {
00858         TbEntry * entry = *f;
00859         if(entry->kind == tbeButton)
00860         {
00861             TbEntryButton *btn = (TbEntryButton *)entry;
00862             cmdid = btn->wid.cmd;
00863         }
00864         else
00865             continue;
00866
00867         void *widget = GetWidget(cmdid);
00868         if(widget == 0L)
00869             continue;
00870
00871         // first forward the command to the focused widget : if it doesn't want it
00872         // we give it to the next pseudo widget.
00873         if(sFocusWidID != -1 && sFocusWidID != GetWidID())
00874         {
00875             UCmdUI pUI(cmdid);
00876             pUI.m_widget = widget;
00877             UEventSendMessage(sFocusWidID, EV_UPDTCMD, pUI.m_nID, &pUI);
00878             if(!pUI.CanContinue())
00879                 continue;
00880         }
00881
00882         STD map<int, UCmdTarget *>::const_iterator i;
00883         for(i = targets.begin(); i != targets.end(); ++i)
00884         {
00885             int widid = (*i).first;
00886             if(widid == sFocusWidID || widid == GetWidID())
00887                 continue;
00888
00889             UCmdUI pUI(cmdid);
00890             pUI.m_widget = widget;
00891             UEventSendMessage(widid, EV_UPDTCMD, pUI.m_nID, &pUI);
00892             if(!pUI.CanContinue())
00893                 break;
00894         }
00895         if(i == targets.end())
00896         {
00897             //UAppConsole("The cmd %d of the toolbar has no update handler, it's gonna be disabled\n", cmdid);
00898             UCmdUI pUI(cmdid);
00899             pUI.m_widget = widget;
00900             pUI.Enable(false);
00901         }
00902     }
00903 #endif // !WIN32
00904 }

void UToolbar::RebuildBar ( bool onlyBitmap = true ) [protected]

Definition at line 464 of file utoolbar.cpp.

References CCJToolBar::AddDropDownButton, ASSERT, awidget::bitmap, awidget::cmd, TbEntryDropDown::current, DDV_NONE, WININFO::entries, CCJToolBar::GetButtonStyle, CCJToolBar::GetItemRect, WININFO::height, TbEntryDropDown::icons, TbEntryButton::ischeck, TbEntry::kind, CDynToolBar::m_bitmap, m_winInfo, m_wndToolBar, NULL, CCJToolBar::SetBitmap, CCJToolBar::SetButtonInfo, CCJToolBar::SetButtons, TBBS_BUTTON, TBBS_CHECKBOX, TBBS_SEPARATOR, tbeButton, tbeDropDown, tbeSeparator, TRUE, UCMD_to_WINCMD, UTB_SEPARATOR, awidget::var, VERIFY, TbEntryButton::wid, and WININFO::width.

Referenced by OnTbEnd, and UDispatchMessage.

00465 {
00466     WININFO & tb = *m_winInfo;
00467
00468     ASSERT(m_wndToolBar != 0L);
00469     // create the bitmap associated with the toolbar
00470     CClientDC dc(m_wndToolBar);
00471     CBitmap* pbmOld = NULL;
00472
00473     CDC dcDest;
00474     VERIFY(dcDest.CreateCompatibleDC(&dc));
00475     CDC dcSrc;
00476     VERIFY(dcSrc.CreateCompatibleDC(&dc));
00477
00478     std::vector<UINT> styles;
00479     std::vector<TbEntry *>::iterator i;
00480     int numicons = 0;
00481     for(i = tb.entries.begin(); i != tb.entries.end(); ++i)
00482     {
00483         TbEntry * entry = *i;
00484
00485         if(entry->kind == tbeDropDown)
00486         {
00487             TbEntryDropDown *drop = (TbEntryDropDown *)entry;
00488             styles.push_back(UCMD_to_WINCMD(drop->icons[drop->current].cmd));
00489             numicons++;
00490         }
00491         else if(entry->kind == tbeButton)
00492         {
00493             TbEntryButton *btn = (TbEntryButton *)entry;
00494             if(btn->wid.var != DDV_NONE)
00495             {
00496                 styles.push_back(UTB_SEPARATOR);
00497             }
00498             else
00499             {
00500                 numicons++;
00501                 styles.push_back(btn->wid.cmd);
00502             }
00503         }
00504         else if(entry->kind == tbeSeparator)
00505         {
00506             styles.push_back(UTB_SEPARATOR);
00507         }
00508         else
00509         {
00510             ASSERT(0);
00511         }
00512     }
00513
00514     if(!onlyBitmap)
00515     {
00516         // create the Win32 toolbar
00517         m_wndToolBar->SetButtons(styles.begin(), styles.size());
00518     }
00519
00520     CBitmap bdest;
00521     bdest.CreateCompatibleBitmap(&dc, tb.width * numicons, tb.height);
00522     ASSERT(bdest.m_hObject != NULL);
00523     CBitmap *pbmOldDest = dcDest.SelectObject(&bdest);
00524
00525     int cnt = 0, index = 0;
00526     for(i = tb.entries.begin(); i != tb.entries.end(); ++i, index++)
00527     {
00528         TbEntry * entry = *i;
00529         HBITMAP bmap = 0L;
00530         int cmd;
00531         bool dropdown = false;
00532         bool ischeck = false;
00533
00534         if(entry->kind == tbeDropDown)
00535         {
00536             TbEntryDropDown *drop = (TbEntryDropDown *)entry;
00537             bmap = drop->icons[drop->current].bitmap;
00538             cmd = drop->icons[drop->current].cmd;
00539             dropdown = true;
00540         }
00541         else if(entry->kind == tbeButton)
00542         {
00543             TbEntryButton *btn = (TbEntryButton *)entry;
00544             if(btn->wid.var != DDV_NONE)
00545             {
00546                 if(!onlyBitmap)
00547                 {
00548                     m_wndToolBar->SetButtonInfo(index, ID_SEPARATOR,
00549                         TBBS_SEPARATOR, tb.width);
00550                     CRect rect;
00551                     m_wndToolBar->GetItemRect(index, &rect);
00552                     /*VERIFY(Create("",
00553                             WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_OWNERDRAW,
00554                             rect, m_wndToolBar, UCMD_to_WINCMD(btn->wid.cmd)));*/
00555                 }
00556                 continue;
00557             }
00558
00559             bmap = btn->wid.bitmap;
00560             cmd = btn->wid.cmd;
00561             ischeck = btn->ischeck;
00562         }
00563         else if(entry->kind == tbeSeparator)
00564         {
00565             m_wndToolBar->SetButtonInfo(index, ID_SEPARATOR,
00566                 TBBS_SEPARATOR, 0);
00567             continue;
00568         }
00569         else
00570         {
00571             continue;
00572             ASSERT(0);
00573         }
00574
00575         if(bmap != 0L)
00576         {
00577             CBitmap bsrc;
00578             VERIFY(bsrc.Attach(bmap));
00579             CBitmap *pbmOldSrc = dcSrc.SelectObject(&bsrc);
00580
00581             dcDest.BitBlt(tb.width * cnt, 0, tb.width, tb.height,
00582                     &dcSrc, 0, 0, SRCCOPY);
00583             bsrc.Detach();
00584
00585             dcSrc.SelectObject(pbmOldSrc);
00586         }
00587
00588         DWORD dwStyle = m_wndToolBar->GetButtonStyle(index);
00589         if(ischeck)
00590         {
00591             dwStyle &= ~TBBS_BUTTON;
00592             dwStyle |= TBBS_CHECKBOX;
00593         }
00594         m_wndToolBar->SetButtonInfo(index, UCMD_to_WINCMD(cmd),
00595             dwStyle, cnt);
00596
00597         if(dropdown)
00598             m_wndToolBar->AddDropDownButton(UCMD_to_WINCMD(cmd), -1, TRUE);
00599
00600         cnt++;
00601     }
00602
00603     dcDest.SelectObject(pbmOldDest);
00604     VERIFY(dcDest.DeleteDC());
00605     VERIFY(dcSrc.DeleteDC());
00606
00607     HBITMAP finalbmap = (HBITMAP)bdest.Detach();
00608     m_wndToolBar->SetBitmap(finalbmap);
00609
00610     if(m_wndToolBar->m_bitmap != 0L)
00611         ::DeleteObject(m_wndToolBar->m_bitmap);
00612     m_wndToolBar->m_bitmap = finalbmap;
00613
00614 }

const URuntimeClass * UToolbar::rtUToolbar ( void ) [static]

Definition at line 57 of file utoolbar.cpp.

int UToolbar::UDispatchMessage | ( | int | evt,
 |  | int | arg1,
 |  | void * | arg2,
 |  | UDispatchInfo & | dispatchInfo
 | ) | [virtual]

this is overided in order to broadcast to the listeners.

Reimplemented from UWidget.

Definition at line 739 of file utoolbar.cpp.

References TbEntryDropDown::current, WININFO::entries, EV_CMD, TbEntry::kind, m_winInfo, RebuildBar, WININFO::Search, tbeDropDown, and UWidget::UDispatchMessage.

00740 {
00741     if(evt == EV_CMD)
00742     {
00743         WININFO *info = m_winInfo;
00744         if(info != 0L)
00745         {
00746             int index;
00747             std::vector<TbEntry *>::iterator f = info->Search(arg1, &index);
00748             if(f != info->entries.end())
00749             {
00750                 TbEntryDropDown *entry = (TbEntryDropDown *)*f;
00751                 if(entry->kind == tbeDropDown)
00752                 {
00753                     // toggle the current bitmap
00754                     if(entry->current != index)
00755                     {
00756                         entry->current = index;
00757 #ifdef WIN32
00758                         RebuildBar();
00759 #endif
00760                     }
00761                 }
00762             }
00763         }
00764     }
00765
00766     return UWidget::UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00767 }

Member Data Documentation

const UMSGMAP_ENTRY UToolbar::_messageEntries [static, private]

Initial value:

   {
    { EV_UPDATEUI, epV_V, UMSG_NOEXT, 0, 0,   (UPMSG)(void (UCmdTarget::*)(void))& UToolbar ::OnUpdateUI },
    { EV_CMD, epi_i, UMSG_RANGE,  0 ,  0xFFFF ,   (UPMSG)(int (UCmdTarget::*)(int cmd))& UToolbar::OnCommands  },
    { EV_DESTROY, epV_V, UMSG_NOEXT, 0, 0,   (UPMSG)(void (UCmdTarget::*)(void))& UToolbar ::OnDestroy },
    { EV_TB_INIT, epV_VP, UMSG_NOEXT, 0, 0,   (UPMSG)(void (UCmdTarget::*)(UTB_INIT *info))& UToolbar ::OnTbInit },
    { EV_TB_END, epV_V, UMSG_NOEXT, 0, 0,   (UPMSG)(void (UCmdTarget::*)(void))& UToolbar ::OnTbEnd },
    { EV_TB_BUTTON, epV_VP, UMSG_NOEXT, 0, 0,   (UPMSG)(void (UCmdTarget::*)(UTB_BUTTON *info))& UToolbar ::OnTbButton },
    { EV_TB_DROPDOWN, epV_VP, UMSG_NOEXT, 0, 0,   (UPMSG)(void (UCmdTarget::*)(UTB_DROPDOWN *info))& UToolbar ::OnTbDropDown },
    { EV_TB_CHECKBTN, epV_VP, UMSG_NOEXT, 0, 0,   (UPMSG)(void (UCmdTarget::*)(UTB_BUTTON *info))& UToolbar ::OnTbCheckBtn },
    { EV_TB_SEPARATOR, epV_V, UMSG_NOEXT, 0, 0,   (UPMSG)(void (UCmdTarget::*)(void))& UToolbar ::OnTbSeparator },
    { EV_SETTOOLTIP, epV_iVP, UMSG_RANGE,  0 ,  0xFFFF ,   (UPMSG)(void (UCmdTarget::*)(int cmd, UCmdUI *pCmdUI))& UToolbar::OnSetTooltip  },
{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }   }

Reimplemented from UWidget.

Reimplemented in UCvsToolbar.

Definition at line 59 of file utoolbar.cpp.

const URuntimeClass UToolbar::classUToolbar [static, protected]

WININFO* UToolbar::m_winInfo [protected]

Definition at line 102 of file utoolbar.h.

Referenced by OnDestroy, OnSetTooltip, OnTbButton, OnTbCheckBtn, OnTbDropDown, OnTbInit, OnTbSeparator, OnUpdateUI, RebuildBar, and UDispatchMessage.

CDynToolBar* UToolbar::m_wndToolBar [protected]

Definition at line 105 of file utoolbar.h.

Referenced by OnTbButton, OnTbCheckBtn, OnTbDropDown, OnTbInit, OnTbSeparator, and RebuildBar.

const UMSGMAP UToolbar::messageMap = { UWidget ::GetThisMessageMap(), & UToolbar ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Reimplemented in UCvsToolbar.

Definition at line 59 of file utoolbar.cpp.

The documentation for this class was generated from the following files:
  • rf/utoolbar.h
  • rf/utoolbar.cpp
Generated on Sun Feb 24 01:28:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CToolbarCombo Class Reference

#include <ToolbarCombo.h>

Inheritance diagram for CToolbarCombo:

[legend]
Collaboration diagram for CToolbarCombo:

[legend]
List of all members.

Public Methods

CToolbarCombo ()
BOOL | Create (DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID)
NotificationManager * GetManager ()
const CString & | GetText ()
void | GetItemText (int pos, LPTSTR buffer, int count)
virtual | ~CToolbarCombo ()

Protected Methods

void | SetText (const CString &text)
void | ResetText ()
afx_msg void | OnSelendok ()
afx_msg void | OnSelendcancel ()
afx_msg LRESULT | OnContentChange (WPARAM wp, LPARAM lp)

Private Attributes

CTbEdit m_edit
NotificationManager m_manager
CString | m_text

Constructor & Destructor Documentation

CToolbarCombo::CToolbarCombo ( )

Definition at line 26 of file ToolbarCombo.cpp.

00027 {
00028 }

CToolbarCombo::~CToolbarCombo ( ) [virtual]

Definition at line 30 of file ToolbarCombo.cpp.

00031 {
00032 }

Member Function Documentation

BOOL CToolbarCombo::Create | ( | DWORD | dwStyle,
 |  | const RECT & | rect,
 |  | CWnd * | pParentWnd,
 |  | UINT | nID
 | ) |

Definition at line 34 of file ToolbarCombo.cpp.

References FALSE, m_edit, and TRUE.

Referenced by CMainFrame::OnCreate.

00035 {
00036     if (!CComboBoxEx::Create(dwStyle, rect, pParentWnd, nID))
00037     {
00038         return FALSE;
00039     }
00040     SetExtendedStyle(CBES_EX_CASESENSITIVE, CBES_EX_CASESENSITIVE);
00041     m_edit.SubclassWindow(GetEditCtrl()->m_hWnd);
00042     m_edit.SetOwner(this);
00043     return TRUE;
00044 }

void CToolbarCombo::GetItemText | ( | int | pos,
 |  | LPTSTR | buffer,
 |  | int | count
 | ) |

Definition at line 101 of file ToolbarCombo.cpp.

References VERIFY.

Referenced by OnSelendok, and SetText.

00102 {
00103     COMBOBOXEXITEM item;
00104     item.mask = CBEIF_TEXT;
00105     item.pszText = buffer;
00106     item.cchTextMax = count;
00107     item.iItem = pos;
00108     VERIFY(GetItem(&item));
00109 }

NotificationManager* CToolbarCombo::GetManager ( ) [inline]

Definition at line 32 of file ToolbarCombo.h.

Referenced by CMainFrame::OnCreate.

00033     {
00034         return &m_manager;
00035     }

const CString& CToolbarCombo::GetText ( ) [inline]

Definition at line 37 of file ToolbarCombo.h.

References m_text.

00038     {
00039         return m_text;
00040     }

LRESULT CToolbarCombo::OnContentChange | ( | WPARAM | wp,
 |  | LPARAM | lp
 | ) | [protected]

Definition at line 46 of file ToolbarCombo.cpp.

References m_edit, ResetText, and SetText.

00047 {
00048     bool complete = wp != 0;
00049     if (complete)
00050     {
00051         CString text;
00052         m_edit.GetWindowText(text);
00053         SetText(text);
00054     }
00055     else
00056     {
00057         // restore previous text
00058         ResetText();
00059     }
00060     return 0;
00061 }

void CToolbarCombo::OnSelendcancel ( ) [protected]

Definition at line 124 of file ToolbarCombo.cpp.

References ResetText.

00125 {
00126     ResetText();
00127 }

void CToolbarCombo::OnSelendok ( ) [protected]

Definition at line 111 of file ToolbarCombo.cpp.

References GetItemText, ResetText, and SetText.

00112 {
00113     CComboBox* combo = GetComboBoxCtrl();
00114     int pos = combo->GetCurSel();
00115     if (pos >= 0)
00116     {
00117         TCHAR buffer[256];
00118         GetItemText(pos, buffer, 256);
00119         SetText(buffer);
00120         ResetText();
00121     }
00122 }

void CToolbarCombo::ResetText ( ) [protected]

Definition at line 63 of file ToolbarCombo.cpp.

References m_edit, and m_text.

Referenced by OnContentChange, OnSelendcancel, and OnSelendok.

00064 {
00065     m_edit.SetWindowText(m_text);
00066 }

void CToolbarCombo::SetText ( const CString & text ) [protected]

Definition at line 68 of file ToolbarCombo.cpp.

References GetItemText, m_manager, m_text, and NotificationManager::NotifyAll.

Referenced by OnContentChange, and OnSelendok.

00069 {
00070     if (m_text.Compare(text) != 0)
00071     {
00072         m_text = text;
00073
00074         // append selection to combo box
00075         int count = GetCount();
00076         for (int i = count - 1; i >= 0 ; i--)
00077         {
00078             TCHAR buffer[256];
00079             GetItemText(i, buffer, 256);
00080             if (text.Compare(buffer) == 0)
00081             {
00082                 DeleteItem(i);
00083             }
00084         }
00085         COMBOBOXEXITEM item;
00086         item.mask = CBEIF_TEXT;
00087         item.iItem = 0;
00088         item.pszText = (LPTSTR)(LPCTSTR)text;
00089         InsertItem(&item);
00090         count = GetCount();
00091         while (count > 8)
00092         {
00093             count--;
00094             DeleteItem(count);
00095         }
00096
00097         m_manager.NotifyAll();
00098     }
00099 }

Member Data Documentation

CTbEdit CToolbarCombo::m_edit [private]

Definition at line 24 of file ToolbarCombo.h.

Referenced by Create, OnContentChange, and ResetText.

NotificationManager CToolbarCombo::m_manager [private]

Definition at line 25 of file ToolbarCombo.h.

Referenced by SetText.

CString CToolbarCombo::m_text [private]

Definition at line 26 of file ToolbarCombo.h.

Referenced by GetText, ResetText, and SetText.

The documentation for this class was generated from the following files:
  • WinCvs/ToolbarCombo.h
  • WinCvs/ToolbarCombo.cpp
Generated on Sun Feb 24 01:28:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CToolBarCtrl Class Reference

Inheritance diagram for CToolBarCtrl:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJToolBarCtrl.h
Generated on Sun Feb 24 01:28:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CToolBarData Struct Reference

Collaboration diagram for CToolBarData:

[legend]
List of all members.

Public Methods

WORD * | items ()

Public Attributes

WORD | wVersion
WORD | wWidth
WORD | wHeight
WORD | wItemCount

Member Function Documentation

WORD* CToolBarData::items ( ) [inline]

Definition at line 1045 of file CJToolBar.cpp.

Referenced by CCJToolBar::LoadToolBar.

01046         { return (WORD*)(this+1); }

Member Data Documentation

WORD CToolBarData::wHeight

Definition at line 1041 of file CJToolBar.cpp.

Referenced by CCJToolBar::LoadToolBar.

WORD CToolBarData::wItemCount

Definition at line 1042 of file CJToolBar.cpp.

Referenced by CCJToolBar::LoadToolBar.

WORD CToolBarData::wVersion

Definition at line 1039 of file CJToolBar.cpp.

Referenced by CCJToolBar::LoadToolBar.

WORD CToolBarData::wWidth

Definition at line 1040 of file CJToolBar.cpp.

Referenced by CCJToolBar::LoadToolBar.

The documentation for this struct was generated from the following file:
  • WinCvs/CJLib/CJLibrary/CJToolBar.cpp
Generated on Sun Feb 24 01:28:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TOOLBARINFO Struct Reference

#include <CJToolBar.h>

Collaboration diagram for TOOLBARINFO:

[legend]
List of all members.

Public Attributes

TBBUTTON | tbButton
LPCTSTR | btnText

Member Data Documentation

LPCTSTR TOOLBARINFO::btnText

Definition at line 95 of file CJToolBar.h.

Referenced by CCJToolBar::OnToolBarGetButtonInfo.

TBBUTTON TOOLBARINFO::tbButton

Definition at line 94 of file CJToolBar.h.

Referenced by CCJToolBar::OnToolBarGetButtonInfo.

The documentation for this struct was generated from the following file:
  • WinCvs/CJLib/Include/CJToolBar.h
Generated on Sun Feb 24 01:28:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TPopup Class Reference

Inheritance diagram for TPopup:

[legend]
The documentation for this class was generated from the following file:
  • rf/support/macapp/UPseudoSupport.h
Generated on Sun Feb 24 01:28:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TPseudoAppBehavior Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for TPseudoAppBehavior:

[legend]
Collaboration diagram for TPseudoAppBehavior:

[legend]
List of all members.

Public Methods

TPseudoAppBehavior ()
virtual | ~TPseudoAppBehavior ()
virtual bool | DoIdle (IdlePhase phase)
virtual void | DoMenuCommand (CommandNumber aCommandNumber)
virtual void | DoSetupMenus ()
virtual bool | DoToolboxEvent (TToolboxEvent *event)

Private Attributes

MA_DECLARE_CLASS

Constructor & Destructor Documentation

TPseudoAppBehavior::TPseudoAppBehavior ( )

Definition at line 453 of file UPseudoSupport.cpp.

00453                                        : TBehavior()
00454 {
00455     SetIdleFreq(0); // ASAP
00456 }

TPseudoAppBehavior::~TPseudoAppBehavior ( ) [virtual]

Definition at line 458 of file UPseudoSupport.cpp.

00459 {
00460 }

Member Function Documentation

bool TPseudoAppBehavior::DoIdle ( IdlePhase phase ) [virtual]

Definition at line 462 of file UPseudoSupport.cpp.

00463 {
00464     ::UEventGiveTime();
00465     return false;
00466 }

void TPseudoAppBehavior::DoMenuCommand ( CommandNumber aCommandNumber ) [virtual]

Definition at line 468 of file UPseudoSupport.cpp.

References EV_CMD, UMacAppMenu::sMAMenuWidID, and UEventSendMessageExt.

00469 {
00470     if(UMacAppMenu::sMAMenuWidID != -1)
00471     {
00472         int handledFlag;
00473         int res = UEventSendMessageExt(UMacAppMenu::sMAMenuWidID, EV_CMD,
00474             aCommandNumber, 0L, &handledFlag);
00475         if(res == 0 && handledFlag)
00476             return;
00477     }
00478
00479     // regular MacApp handling
00480     Inherited::DoMenuCommand(aCommandNumber);
00481 }

void TPseudoAppBehavior::DoSetupMenus ( ) [virtual]

Definition at line 483 of file UPseudoSupport.cpp.

References UWidget::DoValidUI.

00484 {
00485     UWidget::DoValidUI(false);
00486     ::UEventGiveTime();
00487
00488     Inherited::DoSetupMenus();
00489 }

bool TPseudoAppBehavior::DoToolboxEvent ( TToolboxEvent * event ) [virtual]

Definition at line 491 of file UPseudoSupport.cpp.

References EV_UPDATEFOCUS, and UEventNotifyMessage.

00492 {
00493     if(event && event->GetIdentifier() == activateEvt)
00494     {
00495         bool activate = ((event->GetModifiers()) & activeFlag) != 0;
00496         TWindow * aWindow = TWindow::WMgrToWindow((WindowRef)(event->GetMessage()));
00497         if(aWindow)
00498         {
00499             UEventNotifyMessage(EV_UPDATEFOCUS, !activate, aWindow);
00500                 // so the pseudo widget update its current widget.
00501                 // it's important for the menu handling.
00502         }
00503     }
00504
00505     return Inherited::DoToolboxEvent(event);
00506 }

Member Data Documentation

TPseudoAppBehavior::MA_DECLARE_CLASS [private]

Definition at line 107 of file UPseudoSupport.h.

The documentation for this class was generated from the following files:
  • rf/support/macapp/UPseudoSupport.h
  • rf/support/macapp/UPseudoSupport.cpp
Generated on Sun Feb 24 01:28:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TPseudoCustomView Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for TPseudoCustomView:

[legend]
Collaboration diagram for TPseudoCustomView:

[legend]
List of all members.

Public Methods

TPseudoCustomView ()
virtual | ~TPseudoCustomView ()
virtual void | Draw (const CViewRect &area)

Private Attributes

MA_DECLARE_CLASS

Constructor & Destructor Documentation

TPseudoCustomView::TPseudoCustomView ( )

Definition at line 324 of file UPseudoSupport.cpp.

00325 {
00326 }

TPseudoCustomView::~TPseudoCustomView ( ) [virtual]

Definition at line 328 of file UPseudoSupport.cpp.

00329 {
00330 }

Member Function Documentation

void TPseudoCustomView::Draw ( const CViewRect & area ) [virtual]

Definition at line 332 of file UPseudoSupport.cpp.

References EV_CUSTOM_DRAW, EV_FETCHCMD, TPseudoWinBehavior::GetWidID, TPseudoWinBehavior::kPseudoWinBehavior, and UEventSendMessage.

00333 {
00334     TWindow *wind = GetWindow();
00335     if(wind != 0L)
00336     {
00337         TPseudoWinBehavior *pseudo = dynamic_cast_AC(TPseudoWinBehavior*,
00338             wind->GetBehaviorWithIdentifier(TPseudoWinBehavior::kPseudoWinBehavior));
00339         if(pseudo != 0L)
00340         {
00341             int cmdid = UEventSendMessage(pseudo->GetWidID(), EV_FETCHCMD, 0, this);
00342             if(cmdid != -1)
00343                 UEventSendMessage(pseudo->GetWidID(), EV_CUSTOM_DRAW, cmdid, this);
00344         }
00345     }
00346 }

Member Data Documentation

TPseudoCustomView::MA_DECLARE_CLASS [private]

Definition at line 172 of file UPseudoSupport.h.

The documentation for this class was generated from the following files:
  • rf/support/macapp/UPseudoSupport.h
  • rf/support/macapp/UPseudoSupport.cpp
Generated on Sun Feb 24 01:28:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TPseudoDoubleNumberText Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for TPseudoDoubleNumberText:

[legend]
Collaboration diagram for TPseudoDoubleNumberText:

[legend]
List of all members.

Public Types

enum {
kDefaultPrecision = 5,
kStdDoubleNumberText = 'dNum'
}

Public Methods

TPseudoDoubleNumberText ()
virtual | ~TPseudoDoubleNumberText ()
virtual IDType | GetStandardSignature () const
virtual void | ReadFields (CStream_AC *aStream)
virtual void | WriteFields (CStream_AC *aStream) const
virtual long | GetValidationError ()
virtual double | GetValue ()
virtual void | SetValue (double newValue, bool redraw)

Protected Attributes

double | fMinimum
double | fMaximum
short | fPrecision

Private Attributes

MA_DECLARE_CLASS

Member Enumeration Documentation

anonymous enum

Enumeration values:
kDefaultPrecision
kStdDoubleNumberText

Definition at line 224 of file UPseudoSupport.h.

00225     {
00226         kDefaultPrecision = 5,
00227         kStdDoubleNumberText = 'dNum'
00228     };

Constructor & Destructor Documentation

TPseudoDoubleNumberText::TPseudoDoubleNumberText ( )

Definition at line 354 of file UPseudoSupport.cpp.

00354                                                  : fMaximum(DBL_MAX), fMinimum(DBL_MIN),
00355     fPrecision(kDefaultPrecision)
00356 {
00357 }

TPseudoDoubleNumberText::~TPseudoDoubleNumberText ( ) [virtual]

Definition at line 359 of file UPseudoSupport.cpp.

00360 {
00361 }

Member Function Documentation

IDType TPseudoDoubleNumberText::GetStandardSignature ( ) const [virtual]

Definition at line 363 of file UPseudoSupport.cpp.

References kStdDoubleNumberText.

00364 {
00365     return kStdDoubleNumberText;
00366 }

long TPseudoDoubleNumberText::GetValidationError ( ) [virtual]

Definition at line 428 of file UPseudoSupport.cpp.

References fMaximum, and fMinimum.

00429 {
00430     CStr255_AC theString = GetText();
00431
00432     if (!theString.IsEmpty())
00433     {
00434         double extValue;
00435         bool valid = sscanf(CChar255_AC(theString), "%lf", &extValue) == 1;
00436
00437         if (!valid)
00438             return kNonNumericCharacters;
00439         else if (extValue < fMinimum)
00440             return kValueTooSmall;
00441         else if (extValue > fMaximum)
00442             return kValueTooLarge;
00443     }
00444
00445     return kValidValue;
00446 }

double TPseudoDoubleNumberText::GetValue ( ) [virtual]

Definition at line 393 of file UPseudoSupport.cpp.

Referenced by UWidget::OnGetFloat.

00394 {
00395     double theValue = 0.0;
00396     CStr255_AC theString = GetText();
00397
00398     if (!theString.IsEmpty())
00399     {
00400         sscanf(CChar255_AC(theString), "%lf", &theValue);
00401     }
00402
00403     return theValue;
00404 }

void TPseudoDoubleNumberText::ReadFields ( CStream_AC * aStream ) [virtual]

Definition at line 368 of file UPseudoSupport.cpp.

References fMaximum, fMinimum, and fPrecision.

00369 {
00370     Inherited::ReadFields(aStream);
00371
00372     CStr255_AC theString;
00373     theString = aStream->ReadString(255);
00374     sscanf(CChar255_AC(theString), "%lf", &fMinimum);
00375     theString = aStream->ReadString(255);
00376     sscanf(CChar255_AC(theString), "%lf", &fMaximum);
00377     fPrecision = aStream->ReadInteger();
00378 }

void TPseudoDoubleNumberText::SetValue | ( | double | newValue,
 |  | bool | redraw
 | ) | [virtual]

Definition at line 416 of file UPseudoSupport.cpp.

References fMaximum, fMinimum, fPrecision, and NumberToString_US.

Referenced by UWidget::OnSetFloat.

00417 {
00418     newValue = fMinimum >= newValue ? fMinimum : newValue;
00419     newValue = newValue <= fMaximum ? newValue : fMaximum;
00420
00421     UStr aString;
00422     NumberToString_US(newValue, aString, fPrecision);
00423
00424     CStr255_AC tempString = aString;
00425     SetText(tempString, redraw);
00426 }

void TPseudoDoubleNumberText::WriteFields ( CStream_AC * aStream ) const [virtual]

Definition at line 380 of file UPseudoSupport.cpp.

References fMaximum, fMinimum, and fPrecision.

00381 {
00382     Inherited::WriteFields(aStream);
00383
00384     char tmp[255];
00385     sprintf(tmp, "%lf", fMinimum);
00386     aStream->WriteString(CStr255_AC(tmp));
00387     sprintf(tmp, "%lf", fMaximum);
00388     aStream->WriteString(CStr255_AC(tmp));
00389     aStream->WriteLong(fPrecision);
00390 }

Member Data Documentation

double TPseudoDoubleNumberText::fMaximum [protected]

Definition at line 243 of file UPseudoSupport.h.

Referenced by GetValidationError, ReadFields, SetValue, and WriteFields.

double TPseudoDoubleNumberText::fMinimum [protected]

Definition at line 242 of file UPseudoSupport.h.

Referenced by GetValidationError, ReadFields, SetValue, and WriteFields.

short TPseudoDoubleNumberText::fPrecision [protected]

Definition at line 244 of file UPseudoSupport.h.

Referenced by ReadFields, SetValue, and WriteFields.

TPseudoDoubleNumberText::MA_DECLARE_CLASS [private]

Definition at line 221 of file UPseudoSupport.h.

The documentation for this class was generated from the following files:
  • rf/support/macapp/UPseudoSupport.h
  • rf/support/macapp/UPseudoSupport.cpp
Generated on Sun Feb 24 01:28:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TPseudoIconButton Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for TPseudoIconButton:

[legend]
Collaboration diagram for TPseudoIconButton:

[legend]
List of all members.

Private Methods

TPseudoIconButton ()
virtual | ~TPseudoIconButton ()
virtual void | ReadFields (CStream_AC *aStream)
virtual void | WriteFields (CStream_AC *aStream) const

Private Attributes

MA_DECLARE_CLASS

Constructor & Destructor Documentation

TPseudoIconButton::TPseudoIconButton ( ) [private]

Definition at line 513 of file UPseudoSupport.cpp.

00514 {
00515 }

TPseudoIconButton::~TPseudoIconButton ( ) [private, virtual]

Definition at line 517 of file UPseudoSupport.cpp.

00518 {
00519 }

Member Function Documentation

void TPseudoIconButton::ReadFields ( CStream_AC * aStream ) [private, virtual]

Reimplemented in TPseudoRotateIconButton.

Definition at line 521 of file UPseudoSupport.cpp.

00522 {
00523     Inherited::ReadFields(aStream);
00524
00525     *aStream >> fContentType;
00526     SetContentRsrcID(fContentType, fRsrcID);
00527 }

void TPseudoIconButton::WriteFields ( CStream_AC * aStream ) const [private, virtual]

Reimplemented in TPseudoRotateIconButton.

Definition at line 529 of file UPseudoSupport.cpp.

00530 {
00531     Inherited::WriteFields(aStream);
00532
00533     *aStream << fContentType;
00534 }

Member Data Documentation

TPseudoIconButton::MA_DECLARE_CLASS [private]

Reimplemented in TPseudoRotateIconButton.

Definition at line 53 of file UPseudoSupport.h.

The documentation for this class was generated from the following files:
  • rf/support/macapp/UPseudoSupport.h
  • rf/support/macapp/UPseudoSupport.cpp
Generated on Sun Feb 24 01:28:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TPseudoIconCheckBox Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for TPseudoIconCheckBox:

[legend]
Collaboration diagram for TPseudoIconCheckBox:

[legend]
List of all members.

Private Methods

TPseudoIconCheckBox ()
virtual | ~TPseudoIconCheckBox ()
virtual void | ReadFields (CStream_AC *aStream)
virtual void | WriteFields (CStream_AC *aStream) const

Private Attributes

MA_DECLARE_CLASS

Constructor & Destructor Documentation

TPseudoIconCheckBox::TPseudoIconCheckBox ( ) [private]

Definition at line 704 of file UPseudoSupport.cpp.

00705 {
00706 }

TPseudoIconCheckBox::~TPseudoIconCheckBox ( ) [private, virtual]

Definition at line 708 of file UPseudoSupport.cpp.

00709 {
00710 }

Member Function Documentation

void TPseudoIconCheckBox::ReadFields ( CStream_AC * aStream ) [private, virtual]

Definition at line 712 of file UPseudoSupport.cpp.

00713 {
00714     Inherited::ReadFields(aStream);
00715
00716     *aStream >> fContentType;
00717     SetContentRsrcID(fContentType, fRsrcID);
00718 }

void TPseudoIconCheckBox::WriteFields ( CStream_AC * aStream ) const [private, virtual]

Definition at line 720 of file UPseudoSupport.cpp.

00721 {
00722     Inherited::WriteFields(aStream);
00723
00724     *aStream << fContentType;
00725 }

Member Data Documentation

TPseudoIconCheckBox::MA_DECLARE_CLASS [private]

Definition at line 81 of file UPseudoSupport.h.

The documentation for this class was generated from the following files:
  • rf/support/macapp/UPseudoSupport.h
  • rf/support/macapp/UPseudoSupport.cpp
Generated on Sun Feb 24 01:28:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TPseudoIconPopup Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for TPseudoIconPopup:

[legend]
Collaboration diagram for TPseudoIconPopup:

[legend]
List of all members.

Private Methods

TPseudoIconPopup ()
virtual | ~TPseudoIconPopup ()
virtual void | ReadFields (CStream_AC *aStream)
virtual void | WriteFields (CStream_AC *aStream) const

Private Attributes

MA_DECLARE_CLASS

Constructor & Destructor Documentation

TPseudoIconPopup::TPseudoIconPopup ( ) [private]

Definition at line 577 of file UPseudoSupport.cpp.

00578 {
00579 }

TPseudoIconPopup::~TPseudoIconPopup ( ) [private, virtual]

Definition at line 581 of file UPseudoSupport.cpp.

00582 {
00583 }

Member Function Documentation

void TPseudoIconPopup::ReadFields ( CStream_AC * aStream ) [private, virtual]

Definition at line 585 of file UPseudoSupport.cpp.

00586 {
00587     Inherited::ReadFields(aStream);
00588
00589     *aStream >> fContentType;
00590     SetContentRsrcID(fContentType, fRsrcID);
00591 }

void TPseudoIconPopup::WriteFields ( CStream_AC * aStream ) const [private, virtual]

Definition at line 593 of file UPseudoSupport.cpp.

00594 {
00595     Inherited::WriteFields(aStream);
00596
00597     *aStream << fContentType;
00598 }

Member Data Documentation

TPseudoIconPopup::MA_DECLARE_CLASS [private]

Definition at line 42 of file UPseudoSupport.h.

The documentation for this class was generated from the following files:
  • rf/support/macapp/UPseudoSupport.h
  • rf/support/macapp/UPseudoSupport.cpp
Generated on Sun Feb 24 01:28:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TPseudoRotateIconButton Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for TPseudoRotateIconButton:

[legend]
Collaboration diagram for TPseudoRotateIconButton:

[legend]
List of all members.

Protected Attributes

std::vector< short > | fIconSuite
int | fCurrentIcon

Private Methods

TPseudoRotateIconButton ()
virtual | ~TPseudoRotateIconButton ()
virtual void | ReadFields (CStream_AC *aStream)
virtual void | WriteFields (CStream_AC *aStream) const
void | DoRotate (int icon)

Private Attributes

MA_DECLARE_CLASS

Constructor & Destructor Documentation

TPseudoRotateIconButton::TPseudoRotateIconButton ( ) [private]

Definition at line 641 of file UPseudoSupport.cpp.

00641                                                  : fCurrentIcon(0)
00642 {
00643 }

TPseudoRotateIconButton::~TPseudoRotateIconButton ( ) [private, virtual]

Definition at line 645 of file UPseudoSupport.cpp.

00646 {
00647 }

Member Function Documentation

void TPseudoRotateIconButton::DoRotate ( int icon ) [private]

Definition at line 689 of file UPseudoSupport.cpp.

References fCurrentIcon, and fIconSuite.

Referenced by UWidget::OnSetState.

00690 {
00691     if(fCurrentIcon != icon && icon >= 0 && icon < fIconSuite.size())
00692     {
00693         fCurrentIcon = icon;
00694         SetContentRsrcID(fContentType, fIconSuite[fCurrentIcon]);
00695         ForceRedraw();
00696     }
00697 }

void TPseudoRotateIconButton::ReadFields ( CStream_AC * aStream ) [private, virtual]

Reimplemented from TPseudoIconButton.

Definition at line 649 of file UPseudoSupport.cpp.

References fIconSuite.

00650 {
00651     Inherited::ReadFields(aStream);
00652
00653     CChar255_AC str(aStream->ReadString(255));
00654     const char *ptr = str;
00655     while(ptr != 0L)
00656     {
00657         int v;
00658         const char *tmp = strchr(ptr, ',');
00659         if(tmp != 0L)
00660         {
00661             CChar255_AC stmp;
00662             size_t offset = tmp - ptr;
00663             stmp.CopyFrom(ptr, offset);
00664             ptr += offset + 1;
00665             if(sscanf(stmp, "%d", &v) == 1)
00666                 fIconSuite.push_back(v);
00667         }
00668         else
00669         {
00670             if(sscanf(ptr, "%d", &v) == 1)
00671                 fIconSuite.push_back(v);
00672             ptr = 0;
00673         }
00674     }
00675
00676     if(fIconSuite.size() != 0)
00677         SetContentRsrcID(fContentType, fIconSuite[0]);
00678 }

void TPseudoRotateIconButton::WriteFields ( CStream_AC * aStream ) const [private, virtual]

Reimplemented from TPseudoIconButton.

Definition at line 680 of file UPseudoSupport.cpp.

References UASSERT.

00681 {
00682     Inherited::WriteFields(aStream);
00683
00684     // do we really need to write ?
00685     *aStream << "";
00686     UASSERT(0);
00687 }

Member Data Documentation

int TPseudoRotateIconButton::fCurrentIcon [protected]

Definition at line 76 of file UPseudoSupport.h.

Referenced by DoRotate.

std::vector<short> TPseudoRotateIconButton::fIconSuite [protected]

Definition at line 75 of file UPseudoSupport.h.

Referenced by DoRotate, and ReadFields.

TPseudoRotateIconButton::MA_DECLARE_CLASS [private]

Reimplemented from TPseudoIconButton.

Definition at line 64 of file UPseudoSupport.h.

The documentation for this class was generated from the following files:
  • rf/support/macapp/UPseudoSupport.h
  • rf/support/macapp/UPseudoSupport.cpp
Generated on Sun Feb 24 01:28:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TPseudoScrollBar Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for TPseudoScrollBar:

[legend]
Collaboration diagram for TPseudoScrollBar:

[legend]
List of all members.

Private Methods

TPseudoScrollBar ()
virtual | ~TPseudoScrollBar ()
virtual void | TrackScrollBar (short partCode)

Private Attributes

MA_DECLARE_CLASS
int | fPageStep
int | fButtonStep

Constructor & Destructor Documentation

TPseudoScrollBar::TPseudoScrollBar ( ) [private]

Definition at line 605 of file UPseudoSupport.cpp.

00605                                    : fPageStep(1), fButtonStep(1)
00606 {
00607 }

TPseudoScrollBar::~TPseudoScrollBar ( ) [private, virtual]

Definition at line 609 of file UPseudoSupport.cpp.

00610 {
00611 }

Member Function Documentation

void TPseudoScrollBar::TrackScrollBar ( short partCode ) [private, virtual]

Definition at line 613 of file UPseudoSupport.cpp.

References fButtonStep, and fPageStep.

00614 {
00615     switch (partCode)
00616     {
00617         case kControlPageUpPart:
00618             if (GetValue() > GetMinimum())
00619                 DeltaValue(-fPageStep);
00620             break;
00621         case kControlUpButtonPart:
00622             if (GetValue() > GetMinimum())
00623                 DeltaValue(-fButtonStep);
00624             break;
00625         case kControlPageDownPart:
00626             if (GetValue() < GetMaximum())
00627                 DeltaValue(fPageStep);
00628             break;
00629         case kControlDownButtonPart:
00630             if (GetValue() < GetMaximum())
00631                 DeltaValue(fButtonStep);
00632             break;
00633     }
00634 }

Member Data Documentation

int TPseudoScrollBar::fButtonStep [private]

Definition at line 37 of file UPseudoSupport.h.

Referenced by TrackScrollBar.

int TPseudoScrollBar::fPageStep [private]

Definition at line 36 of file UPseudoSupport.h.

Referenced by TrackScrollBar.

TPseudoScrollBar::MA_DECLARE_CLASS [private]

Definition at line 29 of file UPseudoSupport.h.

The documentation for this class was generated from the following files:
  • rf/support/macapp/UPseudoSupport.h
  • rf/support/macapp/UPseudoSupport.cpp
Generated on Sun Feb 24 01:28:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TPseudoTextListView Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for TPseudoTextListView:

[legend]
Collaboration diagram for TPseudoTextListView:

[legend]
List of all members.

Public Types

enum {
kTextStringListViewSignature = 'TxLv',
kSelectionChanged = 'TxSC',
kMultiClickSelection = 'TxMu'
}

Public Methods

TPseudoTextListView ()
virtual | ~TPseudoTextListView ()
virtual IDType | GetStandardSignature (void) const
virtual CStr255_AC | GetItemText (GridCoordinate) const
virtual void | InsStringBefore (short anItem, const char *string)
virtual void | InsStringFirst (const char *string)
virtual void | InsStringLast (const char *string)
virtual void | DelItemAt (GridCoordinate anItem, GridCoordinate numOfItems)
virtual void | RemoveAll (void)
virtual void | DoKeyEvent (TToolboxEvent *event)
virtual void | DoMouseCommand (CViewPoint &theMouse, TToolboxEvent *event, CPoint_AC)
virtual void | SetSelection (const TGridViewDesignator *cellsToSelect, bool extendSelection, bool highlight, bool select)

Protected Methods

virtual bool | DoMouseCommand_SelectCells (GridCell whichCell, class TToolboxEvent *event)

Protected Attributes

std::vector< CStr255_AC > | fStringContainer

Private Attributes

MA_DECLARE_CLASS

Member Enumeration Documentation

anonymous enum

Enumeration values:
kTextStringListViewSignature
kSelectionChanged
kMultiClickSelection

Definition at line 186 of file UPseudoSupport.h.

00187     {
00188         kTextStringListViewSignature = 'TxLv',
00189
00190         kSelectionChanged = 'TxSC',
00191         kMultiClickSelection = 'TxMu'
00192     };

Constructor & Destructor Documentation

TPseudoTextListView::TPseudoTextListView ( )

Definition at line 127 of file UPseudoSupport.cpp.

00128 {
00129 }

TPseudoTextListView::~TPseudoTextListView ( ) [virtual]

Definition at line 133 of file UPseudoSupport.cpp.

00134 {
00135 }

Member Function Documentation

void TPseudoTextListView::DelItemAt | ( | GridCoordinate | anItem,
 |  | GridCoordinate | numOfItems
 | ) | [virtual]

Definition at line 186 of file UPseudoSupport.cpp.

References fStringContainer.

Referenced by UWidget::OnListDelRow.

00187 {
00188     this->fStringContainer.erase(
00189             this->fStringContainer.begin() + (anItem - 1),
00190             this->fStringContainer.begin() + (anItem - 1 + numOfItems));
00191
00192     this->Inherited::DelItemAt(anItem, numOfItems);
00193 }

void TPseudoTextListView::DoKeyEvent ( TToolboxEvent * event ) [virtual]

Definition at line 277 of file UPseudoSupport.cpp.

00278 {
00279     Boolean handledCharacter = false;
00280
00281     if (this->IsEnabled() && this->Focus())     // if view is not enabled then we don't take ANY keystrokes
00282     {
00283         GridCell selected;
00284         unsigned char ch = event->GetText()[1];
00285
00286         if (ch == chUp)
00287         {
00288             selected = this->FirstSelectedCell();
00289             selected.v -= 1;
00290
00291             this->DoMouseCommand_SelectCells(selected, event);
00292
00293             handledCharacter = true;
00294         }
00295         else if (ch == chDown)
00296         {
00297             selected = this->LastSelectedCell();
00298             selected.v += 1;
00299
00300             this->DoMouseCommand_SelectCells(selected, event);
00301
00302             handledCharacter = true;
00303         }
00304     }
00305
00306     if (!handledCharacter)
00307         Inherited::DoKeyEvent(event);
00308 }

void TPseudoTextListView::DoMouseCommand | ( | CViewPoint & | theMouse,
 |  | TToolboxEvent * | event,
 |  | CPoint_AC |
 | ) | [virtual]

Definition at line 261 of file UPseudoSupport.cpp.

References DoMouseCommand_SelectCells, and kMultiClickSelection.

00262 {
00263     GridCell aCell;
00264
00265     if (badChoice != this->IdentifyPoint(theMouse, aCell))
00266     {
00267         this->DoMouseCommand_SelectCells(aCell, event);
00268             // First be sure to select/deselect the cell they clicked on.
00269
00270         if (event->GetClickCount() > 1)
00271         {
00272             this->HandleEvent(kMultiClickSelection, this, event);
00273         }
00274     }
00275 }

bool TPseudoTextListView::DoMouseCommand_SelectCells | ( | GridCell | whichCell,
 |  | class TToolboxEvent * | event
 | ) | [protected, virtual]

Definition at line 200 of file UPseudoSupport.cpp.

References MA_CHECK.

Referenced by DoMouseCommand.

00201 {
00202     MA_CHECK(nil != event);
00203
00204     bool selectionChanged = false;
00205         // Will be true if the selection changed.
00206
00207     if (this->CanSelectCell(whichCell))
00208     {
00209         bool shifted = event->IsShiftKeyPressed();
00210         bool commandKey = event->IsCommandKeyPressed();
00211
00212         if (commandKey)
00213         {
00214             this->SelectCell(whichCell, !this->fSingleSelection,
00215                     kHighlight, !this->IsCellSelected(whichCell));
00216
00217             selectionChanged = true;
00218         }
00219         else if (shifted && !this->fSingleSelection)
00220         {
00221             GridCell runner = whichCell;
00222
00223             if (this->IsCellSelected(whichCell))
00224             {
00225                 for ( ; runner.v <= this->fNumOfRows; runner.v++)
00226                 {
00227                     if (!this->IsCellSelected(runner))
00228                     {
00229                         break;
00230                     }
00231
00232                     this->SelectCell(runner, kExtend, kHighlight, kDeSelect);
00233                 }
00234             }
00235             else
00236             {
00237                 for ( ; runner.v > 0; runner.v--)
00238                 {
00239                     if (this->IsCellSelected(runner))
00240                     {
00241                         break;
00242                     }
00243
00244                     this->SelectCell(runner, kExtend, kHighlight, kSelect);
00245                 }
00246             }
00247
00248             selectionChanged = true;
00249         }
00250         else if (!this->IsCellSelected(whichCell))
00251         {
00252             this->SelectCell(whichCell, kDontExtend, kHighlight, kSelect);
00253
00254             selectionChanged = true;
00255         }
00256     }
00257
00258     return selectionChanged;
00259 }

CStr255_AC TPseudoTextListView::GetItemText ( GridCoordinate ) const [virtual]

Definition at line 143 of file UPseudoSupport.cpp.

References fStringContainer, and MA_CHECK.

Referenced by TPseudoWinBehavior::DoEvent, and UWidget::OnListGetInfo.

00144 {
00145     MA_CHECK(this->fNumOfRows == this->fStringContainer.size());
00146     MA_CHECK(1 <= anItem && this->fStringContainer.size() >= anItem);
00147
00148     CStr255_AC aString = this->fStringContainer[anItem - 1];
00149     return aString;
00150 }

IDType TPseudoTextListView::GetStandardSignature ( void ) const [virtual]

Definition at line 138 of file UPseudoSupport.cpp.

References kTextStringListViewSignature.

00139 {
00140     return TPseudoTextListView::kTextStringListViewSignature;
00141 }

void TPseudoTextListView::InsStringBefore | ( | short | anItem,
 |  | const char * | string
 | ) | [virtual]

Definition at line 152 of file UPseudoSupport.cpp.

References fStringContainer, and MA_CHECK.

Referenced by InsStringFirst, and InsStringLast.

00153 {
00154     MA_CHECK(1 <= anItem && this->fStringContainer.size() >= anItem - 1);
00155
00156     std::vector<CStr255_AC>::iterator iter = this->fStringContainer.end();
00157
00158     try
00159     {
00160         iter = this->fStringContainer.insert(
00161                     this->fStringContainer.begin() + (anItem - 1), string);
00162     }
00163     catch(CException_AC& theException)
00164     {
00165         if (iter != this->fStringContainer.end())
00166         {
00167             this->fStringContainer.erase(iter);
00168                 // Put it back like it was.  This will maintain internal consistency.
00169         }
00170         throw;
00171     }
00172
00173     this->InsItemBefore(anItem, 1);
00174 }

void TPseudoTextListView::InsStringFirst ( const char * string ) [virtual]

Definition at line 176 of file UPseudoSupport.cpp.

References InsStringBefore.

00177 {
00178     this->InsStringBefore(1, string);
00179 }

void TPseudoTextListView::InsStringLast ( const char * string ) [virtual]

Definition at line 181 of file UPseudoSupport.cpp.

References InsStringBefore.

Referenced by UWidget::OnListInsert.

00182 {
00183     this->InsStringBefore(this->fNumOfRows + 1, string);
00184 }

void TPseudoTextListView::RemoveAll ( void ) [virtual]

Definition at line 195 of file UPseudoSupport.cpp.

Referenced by UWidget::OnListResetAll.

00196 {
00197     this->DelItemFirst(this->fNumOfRows);
00198 }

void TPseudoTextListView::SetSelection | ( | const TGridViewDesignator * | cellsToSelect,
 |  | bool | extendSelection,
 |  | bool | highlight,
 |  | bool | select
 | ) | [virtual]

Definition at line 310 of file UPseudoSupport.cpp.

References kSelectionChanged.

00312 {
00313     this->Inherited::SetSelection(cellsToSelect, extendSelection, highlight, select);
00314
00315     this->Changed(kSelectionChanged, this);
00316     this->HandleEvent(kSelectionChanged, this, nil);
00317 }

Member Data Documentation

std::vector<CStr255_AC> TPseudoTextListView::fStringContainer [protected]

Definition at line 216 of file UPseudoSupport.h.

Referenced by DelItemAt, GetItemText, and InsStringBefore.

TPseudoTextListView::MA_DECLARE_CLASS [private]

Definition at line 183 of file UPseudoSupport.h.

The documentation for this class was generated from the following files:
  • rf/support/macapp/UPseudoSupport.h
  • rf/support/macapp/UPseudoSupport.cpp
Generated on Sun Feb 24 01:28:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TPseudoWinAdorner Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for TPseudoWinAdorner:

[legend]
Collaboration diagram for TPseudoWinAdorner:

[legend]
List of all members.

Public Types

enum | { kPseudoWinAdorner = 'pswa' }

Public Methods

TPseudoWinAdorner ()
virtual | ~TPseudoWinAdorner ()
virtual void | ViewChangedFrame (TView *itsView, const CViewRect &oldFrame, const CViewRect &newFrame, bool invalidate)

Protected Methods

void | SetPseudoWidget (int widid)

Protected Attributes

int | fWidID

Private Attributes

MA_DECLARE_CLASS

Friends

class | UWidget

Member Enumeration Documentation

anonymous enum

Enumeration values:
kPseudoWinAdorner

Definition at line 149 of file UPseudoSupport.h.

00150     {
00151         kPseudoWinAdorner = 'pswa'
00152     };

Constructor & Destructor Documentation

TPseudoWinAdorner::TPseudoWinAdorner ( )

Definition at line 732 of file UPseudoSupport.cpp.

00732                                      : TAdorner(kPseudoWinAdorner), fWidID(-1)
00733 {
00734 }

TPseudoWinAdorner::~TPseudoWinAdorner ( ) [virtual]

Definition at line 736 of file UPseudoSupport.cpp.

References EV_DESTROY, fWidID, and UEventSendMessage.

00737 {
00738     if(fWidID != -1)
00739         UEventSendMessage(fWidID, EV_DESTROY, 0, 0L);
00740 }

Member Function Documentation

void TPseudoWinAdorner::SetPseudoWidget ( int widid ) [inline, protected]

Definition at line 163 of file UPseudoSupport.h.

References fWidID.

Referenced by UWidget::OnInitWidget.

00163 { fWidID = widid; }

void TPseudoWinAdorner::ViewChangedFrame | ( | TView * | itsView,
 |  | const CViewRect & | oldFrame,
 |  | const CViewRect & | newFrame,
 |  | bool | invalidate
 | ) | [virtual]

Definition at line 742 of file UPseudoSupport.cpp.

References URECT::bottom, EV_FETCHCMD, EV_RESIZE, fWidID, URECT::left, URECT::right, URECT::top, and UEventSendMessage.

00746 {
00747     TWindow *wind = itsView->GetWindow();
00748     if(wind != 0L && fWidID != -1)
00749     {
00750         int cmdid = UEventSendMessage(fWidID, EV_FETCHCMD, 0, itsView);
00751         if(cmdid != -1)
00752         {
00753             URECT r;
00754             r.left = newFrame.left;
00755             r.right = newFrame.right;
00756             r.top = newFrame.top;
00757             r.bottom = newFrame.bottom;
00758
00759             UEventSendMessage(fWidID, EV_RESIZE, cmdid, &r);
00760         }
00761     }
00762 }

Friends And Related Function Documentation

friend class UWidget [friend]

Definition at line 167 of file UPseudoSupport.h.

Member Data Documentation

int TPseudoWinAdorner::fWidID [protected]

Definition at line 165 of file UPseudoSupport.h.

Referenced by SetPseudoWidget, ViewChangedFrame, and ~TPseudoWinAdorner.

TPseudoWinAdorner::MA_DECLARE_CLASS [private]

Definition at line 146 of file UPseudoSupport.h.

The documentation for this class was generated from the following files:
  • rf/support/macapp/UPseudoSupport.h
  • rf/support/macapp/UPseudoSupport.cpp
Generated on Sun Feb 24 01:28:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TPseudoWinBehavior Class Reference

#include <UPseudoSupport.h>

Inheritance diagram for TPseudoWinBehavior:

[legend]
Collaboration diagram for TPseudoWinBehavior:

[legend]
List of all members.

Public Types

enum | { kPseudoWinBehavior = 'pswb' }

Public Methods

TPseudoWinBehavior ()
virtual | ~TPseudoWinBehavior ()
virtual void | DoEvent (EventNumber eventNumber, TEventHandler *source, TEvent *event)
int | GetWidID () const

Protected Methods

void | SetPseudoWidget (int widid)

Protected Attributes

int | fWidID

Private Attributes

MA_DECLARE_CLASS

Friends

class | UWidget

Member Enumeration Documentation

anonymous enum

Enumeration values:
kPseudoWinBehavior

Definition at line 125 of file UPseudoSupport.h.

00126     {
00127         kPseudoWinBehavior = 'pswb'
00128     };

Constructor & Destructor Documentation

TPseudoWinBehavior::TPseudoWinBehavior ( )

Definition at line 35 of file UPseudoSupport.cpp.

00035                                        : TBehavior(kPseudoWinBehavior), fWidID(-1)
00036 {
00037 }

TPseudoWinBehavior::~TPseudoWinBehavior ( ) [virtual]

Definition at line 39 of file UPseudoSupport.cpp.

00040 {
00041 }

Member Function Documentation

void TPseudoWinBehavior::DoEvent | ( | EventNumber | eventNumber,
 |  | TEventHandler * | source,
 |  | TEvent * | event
 | ) | [virtual]

Definition at line 43 of file UPseudoSupport.cpp.

References EV_CMD, EV_COMBO_SEL, EV_EDITCHANGE, EV_FETCHCMD, EV_LIST_DBLCLICK, EV_LIST_SELECTING, EV_SCROLLCHANGE, EV_UPDATEFOCUS, fWidID, TPseudoTextListView::GetItemText, TPseudoTextListView::kMultiClickSelection, TPseudoTextListView::kSelectionChanged, UEventNotifyMessage, UEventSendMessage, and UMAKEINT.

00044 {
00045     // find out the command who fired the event (if any)
00046     int cmdid = -1;
00047
00048     // the typing event is originated by a sub-view of an TEditText field
00049     TEventHandler* ourSource = source;
00050     if(eventNumber == cTyping && MA_MEMBER(ourSource, TDialogTEView))
00051     {
00052         ourSource = ((TDialogTEView *)ourSource)->fEditText;
00053     }
00054
00055     if(fWidID != -1)
00056         cmdid = UEventSendMessage(fWidID, EV_FETCHCMD, 0, ourSource);
00057
00058     if(cmdid != -1) switch(eventNumber)
00059     {
00060         case mBecameTarget:
00061         case mResignedTarget:
00062             UEventNotifyMessage(EV_UPDATEFOCUS, eventNumber == mResignedTarget, ourSource);
00063             break;
00064         case mButtonHit:
00065         case mRadioHit:
00066         case mCheckBoxHit:
00067             UEventSendMessage(fWidID, EV_CMD, cmdid, 0L);
00068             break;
00069         case mHScrollBarHit:
00070         case mVScrollBarHit:
00071             if(MA_MEMBER(ourSource, TSlider) || MA_MEMBER(ourSource, TScrollBar))
00072             {
00073                 TCtlMgr *slider = (TCtlMgr *)ourSource;
00074                 UEventSendMessage(fWidID, EV_SCROLLCHANGE, cmdid, (void *)slider->GetValue());
00075             }
00076             break;
00077         case mPopupHit:
00078             if(MA_MEMBER(ourSource, TPopup))
00079             {
00080                 TPopup *popup = (TPopup *)ourSource;
00081                 short cur = popup->GetCurrentItem();
00082                 CStr255_AC pstr = popup->GetItemText(cur);
00083                 UPStr content(pstr);
00084                 UEventSendMessage(fWidID, EV_COMBO_SEL, UMAKEINT(cmdid, cur - 1),
00085                     (void *)(const char *)content);
00086             }
00087             break;
00088         case mControlHit:
00089             if(MA_MEMBER(ourSource, TSlider))
00090             {
00091                 TSlider *slider = (TSlider *)ourSource;
00092                 UEventSendMessage(fWidID, EV_SCROLLCHANGE, cmdid, (void *)slider->GetValue());
00093             }
00094             break;
00095         case cTyping:
00096             if(MA_MEMBER(ourSource, TEditText))
00097             {
00098                 UEventSendMessage(fWidID, EV_EDITCHANGE, cmdid, 0L);
00099             }
00100             break;
00101         case TPseudoTextListView::kSelectionChanged:
00102         case TPseudoTextListView::kMultiClickSelection:
00103             if(MA_MEMBER(ourSource, TPseudoTextListView))
00104             {
00105                 TPseudoTextListView *txt = (TPseudoTextListView *)ourSource;
00106                 short entry = txt->FirstSelectedItem();
00107                 CChar255_AC name;
00108                 if(entry > 0)
00109                     name = txt->GetItemText(entry);
00110
00111                 UEventSendMessage(fWidID,
00112                     eventNumber == TPseudoTextListView::kSelectionChanged ?
00113                     EV_LIST_SELECTING : EV_LIST_DBLCLICK, UMAKEINT(cmdid, entry - 1),
00114                     (void *)(const char *)name);
00115             }
00116             break;
00117     }
00118
00119     Inherited::DoEvent(eventNumber, source, event);
00120 }

int TPseudoWinBehavior::GetWidID ( ) const [inline]

Definition at line 135 of file UPseudoSupport.h.

References fWidID.

Referenced by TPseudoCustomView::Draw.

00135 { return fWidID; }

void TPseudoWinBehavior::SetPseudoWidget ( int widid ) [inline, protected]

Definition at line 137 of file UPseudoSupport.h.

References fWidID.

Referenced by UWidget::OnInitWidget.

00137 { fWidID = widid; }

Friends And Related Function Documentation

friend class UWidget [friend]

Definition at line 141 of file UPseudoSupport.h.

Member Data Documentation

int TPseudoWinBehavior::fWidID [protected]

Definition at line 139 of file UPseudoSupport.h.

Referenced by DoEvent, GetWidID, and SetPseudoWidget.

TPseudoWinBehavior::MA_DECLARE_CLASS [private]

Definition at line 122 of file UPseudoSupport.h.

The documentation for this class was generated from the following files:
  • rf/support/macapp/UPseudoSupport.h
  • rf/support/macapp/UPseudoSupport.cpp
Generated on Sun Feb 24 01:28:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TraversalReport Class Reference

#include <FileTraversal.h>

Inheritance diagram for TraversalReport:

[legend]
Collaboration diagram for TraversalReport:

[legend]
List of all members.

Public Methods

virtual kTraversal | EnterDirectory (const char *fullpath, const char *dirname, const FSSpec *macspec)
virtual kTraversal | ExitDirectory (const char *fullpath)
virtual kTraversal | OnError (const char *err, int errcode)
virtual kTraversal | OnIdle (const char *fullpath)
virtual kTraversal | OnAnyDevice (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)
virtual kTraversal | OnDirectory (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)
virtual kTraversal | OnFile (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)
virtual kTraversal | OnAlias (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)

Static Public Attributes

bool | gRunning = false

Member Function Documentation

virtual kTraversal TraversalReport::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented in ImportReport.

Definition at line 91 of file FileTraversal.h.

References kContinueTraversal, kTraversal, and UFSSpec.

Referenced by FileTraverse.

00092     {
00093         return kContinueTraversal;
00094     }

virtual kTraversal TraversalReport::ExitDirectory ( const char * fullpath ) [inline, virtual]

Reimplemented in ImportReport.

Definition at line 96 of file FileTraversal.h.

References kTraversal.

Referenced by FileTraverse.

00097     {
00098         return kContinueTraversal;
00099     }

virtual kTraversal TraversalReport::OnAlias | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented in ImportReport.

Definition at line 135 of file FileTraversal.h.

References kTraversal, OnAnyDevice, stat, and UFSSpec.

Referenced by FileTraverse.

00139     {
00140         return OnAnyDevice(fullpath, fullname, name, dir, macspec);
00141     }

virtual kTraversal TraversalReport::OnAnyDevice | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented in LSReport.

Definition at line 111 of file FileTraversal.h.

References kContinueTraversal, kTraversal, stat, and UFSSpec.

Referenced by OnAlias, OnDirectory, and OnFile.

00115     {
00116         return kContinueTraversal;
00117     }

virtual kTraversal TraversalReport::OnDirectory | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented in ImportReport.

Definition at line 119 of file FileTraversal.h.

References kTraversal, OnAnyDevice, stat, and UFSSpec.

Referenced by FileTraverse.

00123     {
00124         return OnAnyDevice(fullpath, fullname, name, dir, macspec);
00125     }

virtual kTraversal TraversalReport::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented in ImportReport.

Definition at line 101 of file FileTraversal.h.

References err, kTraversal, and kTraversalError.

Referenced by FileTraverse.

00102     {
00103         return kTraversalError;
00104     }

virtual kTraversal TraversalReport::OnFile | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented in ImportReport.

Definition at line 127 of file FileTraversal.h.

References kTraversal, OnAnyDevice, stat, and UFSSpec.

Referenced by FileTraverse.

00131     {
00132         return OnAnyDevice(fullpath, fullname, name, dir, macspec);
00133     }

virtual kTraversal TraversalReport::OnIdle ( const char * fullpath ) [inline, virtual]

Reimplemented in ImportReport.

Definition at line 106 of file FileTraversal.h.

References kContinueTraversal, and kTraversal.

Referenced by FileTraverse.

00107     {
00108         return kContinueTraversal;
00109     }

Member Data Documentation

bool TraversalReport::gRunning = false [static]

Definition at line 95 of file FileTraversal.cpp.

Referenced by FileTraverse.

The documentation for this class was generated from the following files:
  • common/FileTraversal.h
  • common/FileTraversal.cpp
Generated on Sun Feb 24 01:28:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UTREE_INFO Struct Reference

#include <umain.h>

Collaboration diagram for UTREE_INFO:

[legend]
List of all members.

Public Attributes

UTREEITEM item
UTREEITEM parent
UTREEITEM next
UTREEITEM child
void * | data
char * | title
void * | icon
int | expanded

Member Data Documentation

UTREEITEM UTREE_INFO::child

Definition at line 945 of file umain.h.

Referenced by UCvsFolders::DeleteAllItems, UCvsFolders::GetItemByLocation, UWidget::OnTreeGetInfo, UCvsFolders::StepToLocation, and UCvsFolders::StoreExpanded.

void* UTREE_INFO::data

Definition at line 946 of file umain.h.

Referenced by UCvsFolders::DeleteAllItems, TBrowserFill::ExitDirectory, TBrowserFillDummy::ExitDirectory, UCvsFolders::GetItemByLocation, UCvsFolders::OnCmdMacrosSel, UCvsFolders::OnTreeExpanding, UWidget::OnTreeGetInfo, UCvsFolders::OnTreeSelecting, UWidget::OnTreeSetData, and UCvsFolders::StepToLocation.

int UTREE_INFO::expanded

Definition at line 949 of file umain.h.

Referenced by UWidget::OnTreeGetInfo, and UCvsFolders::StoreExpanded.

void* UTREE_INFO::icon

Definition at line 948 of file umain.h.

Referenced by TBrowserFill::ExitDirectory, TBrowserFill::OnDirectory, UWidget::OnTreeGetInfo, and UWidget::OnTreeSetIcon.

UTREEITEM UTREE_INFO::item

Definition at line 942 of file umain.h.

Referenced by UCvsFolders::DeleteAllItems, TBrowserFill::ExitDirectory, TBrowserFillDummy::ExitDirectory, UCvsFolders::GetItemByLocation, UCvsFolders::OnCmdMacrosSel, TBrowserFill::OnDirectory, UCvsFolders::OnTreeExpanding, UWidget::OnTreeGetInfo, UCvsFolders::OnTreeSelecting, UWidget::OnTreeSetData, UWidget::OnTreeSetIcon, UCvsFolders::RetrievePath, UCvsFolders::StepToLocation, and UCvsFolders::StoreExpanded.

UTREEITEM UTREE_INFO::next

Definition at line 944 of file umain.h.

Referenced by UCvsFolders::DeleteAllItems, UCvsFolders::GetItemByLocation, UWidget::OnTreeGetInfo, UCvsFolders::StepToLocation, and UCvsFolders::StoreExpanded.

UTREEITEM UTREE_INFO::parent

Definition at line 943 of file umain.h.

Referenced by UWidget::OnTreeGetInfo, and UCvsFolders::RetrievePath.

char* UTREE_INFO::title

Definition at line 947 of file umain.h.

Referenced by UWidget::OnTreeGetInfo, and UCvsFolders::RetrievePath.

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Sun Feb 24 01:28:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UTREE_INSERT Struct Reference

#include <umain.h>

Collaboration diagram for UTREE_INSERT:

[legend]
List of all members.

Public Attributes

const char * | title
UTREEITEM parent
UTREEITEM result
void * | icon
void * | data

Member Data Documentation

void* UTREE_INSERT::data

Definition at line 937 of file umain.h.

Referenced by TBrowserFillDummy::ExitDirectory, UCvsFolders::OnTreeExpanding, and UWidget::OnTreeInsert.

void* UTREE_INSERT::icon

Definition at line 936 of file umain.h.

Referenced by TBrowserFillDummy::ExitDirectory, UCvsFolders::OnTreeExpanding, and UWidget::OnTreeInsert.

UTREEITEM UTREE_INSERT::parent

Definition at line 934 of file umain.h.

Referenced by TBrowserFillDummy::ExitDirectory, UCvsFolders::OnTreeExpanding, and UWidget::OnTreeInsert.

UTREEITEM UTREE_INSERT::result

Definition at line 935 of file umain.h.

Referenced by TBrowserFillDummy::ExitDirectory, and UWidget::OnTreeInsert.

const char* UTREE_INSERT::title

Definition at line 933 of file umain.h.

Referenced by TBrowserFillDummy::ExitDirectory, UCvsFolders::OnTreeExpanding, and UWidget::OnTreeInsert.

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Sun Feb 24 01:28:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CTreeCtrl Class Reference

Inheritance diagram for CTreeCtrl:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJTreeCtrl.h
Generated on Sun Feb 24 01:28:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CTreeView Class Reference

Inheritance diagram for CTreeView:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/WinCvsBrowser.h
Generated on Sun Feb 24 01:28:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TScrollBar Class Reference

Inheritance diagram for TScrollBar:

[legend]
The documentation for this class was generated from the following file:
  • rf/support/macapp/UPseudoSupport.h
Generated on Sun Feb 24 01:28:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TTextListView Class Reference

Inheritance diagram for TTextListView:

[legend]
The documentation for this class was generated from the following file:
  • rf/support/macapp/UPseudoSupport.h
Generated on Sun Feb 24 01:28:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CTurnOffDispatching Class Reference

Collaboration diagram for CTurnOffDispatching:

[legend]
List of all members.

Public Methods

CTurnOffDispatching ()
~CTurnOffDispatching ()

Protected Attributes

bool m_didSetIt

Constructor & Destructor Documentation

CTurnOffDispatching::CTurnOffDispatching ( ) [inline]

Definition at line 126 of file uevent.cpp.

References m_didSetIt, and sTurnOffDispatching.

00126                           : m_didSetIt(false)
00127     {
00128         if(!sTurnOffDispatching)
00129         {
00130             m_didSetIt = true;
00131             sTurnOffDispatching = true;
00132         }
00133     }

CTurnOffDispatching::~CTurnOffDispatching ( ) [inline]

Definition at line 135 of file uevent.cpp.

References sTurnOffDispatching.

00136     {
00137         if(m_didSetIt)
00138             sTurnOffDispatching = false;
00139     }

Member Data Documentation

bool CTurnOffDispatching::m_didSetIt [protected]

Definition at line 141 of file uevent.cpp.

Referenced by CTurnOffDispatching.

The documentation for this class was generated from the following file:
  • rf/uevent.cpp
Generated on Sun Feb 24 01:28:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TView Class Reference

Inheritance diagram for TView:

[legend]
The documentation for this class was generated from the following file:
  • rf/support/macapp/UPseudoSupport.h
Generated on Sun Feb 24 01:28:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


TViewFill Class Reference

Inheritance diagram for TViewFill:

[legend]
Collaboration diagram for TViewFill:

[legend]
List of all members.

Public Methods

TViewFill (UCvsFiles *listCtrl, CSortList< ENTNODE > &entries)
virtual | ~TViewFill ()
virtual kTraversal | EnterDirectory (const char *fullpath, const char *dirname, const FSSpec *macspec)
virtual kTraversal | ExitDirectory (const char *fullpath)
virtual kTraversal | OnError (const char *err, int errcode)
virtual kTraversal | OnIdle (const char *fullpath)
virtual kTraversal | OnDirectory (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)
virtual kTraversal | OnAlias (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)
virtual kTraversal | OnFile (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)
TViewFill (const KoTraversalContext *context)
CBrowseFileView * | GetView () const
CListCtrl & | GetListCtrl () const
bool | IsRecursive () const
bool | IsShowIgnored () const
virtual kTraversal | EnterDirectory (const char *fullpath, const char *dirname, const FSSpec *macspec)
virtual kTraversal | ExitDirectory (const char *fullpath)
int | InitItem (EntnodeData *data, int iImage, const char *tag=0L)
virtual kTraversal | OnError (const char *err, int errcode)
virtual kTraversal | OnIdle (const char *fullpath)
virtual kTraversal | OnDirectory (const char *fullpath, const char *fullname, const char *name, const struct wnt_stat &dir, const FSSpec *macspec)
virtual kTraversal | OnAlias (const char *fullpath, const char *fullname, const char *name, const struct wnt_stat &dir, const FSSpec *macspec)
virtual kTraversal | OnFile (const char *fullpath, const char *fullname, const char *name, const struct wnt_stat &dir, const FSSpec *macspec)

Public Attributes

UCvsFiles * m_listCtrl
CSortList< ENTNODE > & m_entries
::vector< UStr > | m_ignlist
CSortList< ENTNODE > m_entries
vector< UStr > | m_ignlist
const KoTraversalContext * | m_context

Constructor & Destructor Documentation

TViewFill::TViewFill | ( | UCvsFiles * | listCtrl,
 |  | CSortList< ENTNODE > & | entries
 | ) | [inline]

Definition at line 223 of file UCvsFiles.cpp.

00223                                                                  :
00224         m_listCtrl(listCtrl), m_entries(entries) {}

virtual TViewFill::~TViewFill ( ) [inline, virtual]

Definition at line 226 of file UCvsFiles.cpp.

00226 {}

TViewFill::TViewFill ( const KoTraversalContext * context ) [inline]

Definition at line 218 of file BrowseFileView.cpp.

00219     : m_context(context)
00220     , m_entries(200, ENTNODE::Compare)
00221     { }

Member Function Documentation

virtual kTraversal TViewFill::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 243 of file BrowseFileView.cpp.

References BuildIgnoredList, Entries_Open, FSSpec, kContinueTraversal, kTraversal, and m_ignlist.

00244     {
00245         Entries_Open (m_entries, fullpath);
00246         BuildIgnoredList(m_ignlist, fullpath);
00247         return kContinueTraversal;
00248     }

virtual kTraversal TViewFill::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 228 of file UCvsFiles.cpp.

References BuildIgnoredList, Entries_Open, FSSpec, kContinueTraversal, kTraversal, and m_ignlist.

00229     {
00230         Entries_Open (m_entries, fullpath);
00231         BuildIgnoredList(m_ignlist, fullpath);
00232
00233         return kContinueTraversal;
00234     }

virtual kTraversal TViewFill::ExitDirectory ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 250 of file BrowseFileView.cpp.

References ENTNODE::Data, ENT_FILE, Entries_SetMissing, CSortList::Get, EntnodeData::GetType, InitItem, KoTraversalContext::IsMatch, EntnodeData::IsMissing, IsRecursive, EntnodeData::IsRemoved, kContinueTraversal, kTraversal, m_ignlist, and CSortList::NumOfElements.

00251     {
00252         // add the missing files
00253         Entries_SetMissing(m_entries);
00254
00255         int numEntries = m_entries.NumOfElements();
00256         for(int i = 0; i < numEntries; i++)
00257         {
00258             const ENTNODE & theNode = m_entries.Get(i);
00259             EntnodeData *data = theNode.Data();
00260             if (data->IsMissing() && m_context->IsMatch(data))
00261             {
00262                 if (!IsRecursive() || data->GetType() == ENT_FILE)
00263                 {
00264                     int iImage = data->GetType() == ENT_FILE ?
00265                                 (data->IsRemoved() ? kFileIconRemoved : kFileIconMiss) : kFolderIconMiss;
00266                     InitItem(data, iImage);
00267                 }
00268             }
00269         }
00270
00271         m_ignlist.clear();
00272         return kContinueTraversal;
00273     }

virtual kTraversal TViewFill::ExitDirectory ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 236 of file UCvsFiles.cpp.

References kContinueTraversal, kTraversal, and m_ignlist.

00237     {
00238         m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00239         return kContinueTraversal;
00240     }

CListCtrl& TViewFill::GetListCtrl ( ) const [inline]

Definition at line 228 of file BrowseFileView.cpp.

References GetView.

Referenced by InitItem, and OnFile.

00229     {
00230         return GetView()->GetListCtrl();
00231     }

CBrowseFileView* TViewFill::GetView ( ) const [inline]

Definition at line 223 of file BrowseFileView.cpp.

References KoTraversalContext::m_view.

Referenced by GetListCtrl, and InitItem.

00224     {
00225         return m_context->m_view;
00226     }

int TViewFill::InitItem | ( | EntnodeData * | data,
 |  | int | iImage,
 |  | const char * | tag = 0L
 | ) | [inline]

Definition at line 276 of file BrowseFileView.cpp.

References KiColumnModel::GetAt, CBrowseFileView::GetColumnModel, KiColumnModel::GetCount, GetListCtrl, KiColumn::GetText, GetView, IsRecursive, EntnodeFile::kTag, and EntnodeData::Ref.

Referenced by ExitDirectory, OnDirectory, and OnFile.

00277     {
00278         CListCtrl& listCtrl = GetListCtrl();
00279         KoColumnContext context(GetView()->GetPath());
00280         TCHAR buf[256];
00281         GetView()->GetColumnModel()->GetAt(0)->GetText(&context, data, buf, 256);
00282
00283         LV_ITEM lvi;
00284         lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
00285         lvi.iItem = listCtrl.GetItemCount();
00286         lvi.iSubItem = 0;
00287         lvi.pszText = buf;
00288         lvi.iImage = iImage;
00289         lvi.lParam = (LPARAM)(LPVOID)data;
00290         int pos = listCtrl.InsertItem(&lvi);
00291         if (pos >= 0)
00292         {
00293             // note ownership addition
00294             data->Ref();
00295
00296             // set item text for additional columns
00297             KiColumnModel* model = GetView()->GetColumnModel();
00298             int columnCount = model->GetCount();
00299             for(int j = 1; j < columnCount; j++)
00300             {
00301                 TCHAR buf[256];
00302                 model->GetAt(j)->GetText(&context, data, buf, 256);
00303                 listCtrl.SetItemText(pos, j, buf);
00304             }
00305
00306             if(tag != 0L && tag[0] != '\0' && !IsRecursive())
00307                 listCtrl.SetItemText(pos, EntnodeFile::kTag, tag);
00308         }
00309         return pos;
00310     }

bool TViewFill::IsRecursive ( ) const [inline]

Definition at line 233 of file BrowseFileView.cpp.

References KoTraversalContext::IsRecursive.

Referenced by ExitDirectory, InitItem, and OnDirectory.

00234     {
00235         return m_context->IsRecursive();
00236     }

bool TViewFill::IsShowIgnored ( ) const [inline]

Definition at line 238 of file BrowseFileView.cpp.

References KoTraversalContext::IsShowIgnored.

Referenced by OnDirectory, and OnFile.

00239     {
00240         return m_context->IsShowIgnored();
00241     }

virtual kTraversal TViewFill::OnAlias | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct wnt_stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Definition at line 360 of file BrowseFileView.cpp.

References FSSpec, kTraversal, OnFile, and stat.

00364     {
00365         return OnFile(fullpath, fullname, name, dir, macspec);
00366     }

virtual kTraversal TViewFill::OnAlias | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 314 of file UCvsFiles.cpp.

References FSSpec, kTraversal, OnFile, and stat.

00318     {
00319         return OnFile(fullpath, fullname, name, dir, macspec);
00320     }

virtual kTraversal TViewFill::OnDirectory | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct wnt_stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Definition at line 323 of file BrowseFileView.cpp.

References CStr, Entries_SetVisited, FileTraverse, FSSpec, CBrowseFileView::GetImageForEntry, InitItem, EntnodeData::IsIgnored, EntnodeData::IsMissing, IsRecursive, IsShowIgnored, EntnodeData::IsUnknown, kSkipFile, kTraversal, m_ignlist, stat, stricmp, and Tag_Open.

00327     {
00328         if(stricmp(name, "CVS") == 0)
00329             return kSkipFile;
00330
00331         EntnodeData *data = Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00332         if (!IsShowIgnored() && data->IsIgnored())
00333         {
00334             return kSkipFile;
00335         }
00336
00337         if (IsRecursive())
00338         {
00339             if (!data->IsIgnored() && !data->IsUnknown() && !data->IsMissing())
00340             {
00341                 TViewFill traverse(m_context);
00342                 FileTraverse(fullname, traverse);
00343             }
00344             return kSkipFile;
00345         }
00346
00347         // get the tag
00348         CStr subCVS;
00349         CStr tagName;
00350         subCVS = fullname;
00351         if(!subCVS.endsWith(kPathDelimiter))
00352             subCVS << kPathDelimiter;
00353         subCVS << "CVS";
00354         Tag_Open(tagName, subCVS);
00355
00356         InitItem(data, CBrowseFileView::GetImageForEntry(data), tagName);
00357         return kSkipFile;
00358     }

virtual kTraversal TViewFill::OnDirectory | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 252 of file UCvsFiles.cpp.

References ULIST_INSERT::col, CStr, Entries_SetVisited, EV_LIST_INSERT, EV_LIST_NEWROW, EV_LIST_ROWSETDATA, FSSpec, EntnodeData::GetDesc, UCvsFiles::GetImageForEntry, UCmdTarget::GetWidID, ULIST_INSERT::icon, EntnodeData::IsIgnored, kSkipFile, EntnodeData::kStatus, EntnodeFile::kTag, kTraversal, kTraversalError, kUMainWidget, m_ignlist, NUM_COLUMNS, ULIST_INSERT::row, stat, stricmp, Tag_Open, ULIST_INSERT::title, UEventSendMessage, and UMAKEINT.

00256     {
00257 #if qUnix
00258         if(strcmp(name, "CVS") == 0)
00259 #else
00260         if(stricmp(name, "CVS") == 0)
00261 #endif
00262             return kSkipFile;
00263
00264         EntnodeData *data = Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00265         if(!(bool)gFileViewIgnore && data->IsIgnored())
00266             return kSkipFile;
00267
00268         // get the tag
00269         CStr subCVS;
00270         CStr tagName;
00271         subCVS = fullname;
00272         if(!subCVS.endsWith(kPathDelimiter))
00273             subCVS << kPathDelimiter;
00274         subCVS << "CVS";
00275         if(chdir(subCVS) == 0)
00276             Tag_Open(tagName, subCVS);
00277         if(chdir(fullpath) != 0)
00278             return kTraversalError;
00279
00280         int rownum;
00281         UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_NEWROW, kUMainWidget, &rownum);
00282         UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_ROWSETDATA, UMAKEINT(kUMainWidget, rownum), data);
00283         ULIST_INSERT entry;
00284         entry.row = rownum;
00285
00286         entry.col = 0;
00287         entry.title = name;
00288         entry.icon = UCvsFiles::GetImageForEntry(data);
00289         UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00290
00291         entry.icon = 0L;
00292
00293         // set item text for additional columns
00294         for(int j = 1; j < NUM_COLUMNS; j++)
00295         {
00296             const char *info = (*data)[j];
00297             if(info != 0L)
00298             {
00299                 entry.col = j;
00300                 entry.title = info;
00301                 UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00302             }
00303         }
00304         entry.col = EntnodeData::kStatus;
00305         entry.title = data->GetDesc();
00306         UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00307         entry.col = EntnodeFile::kTag;
00308         entry.title = tagName.empty() ? "" : (const char *)tagName;
00309         UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00310
00311         return kSkipFile;
00312     }

virtual kTraversal TViewFill::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 313 of file BrowseFileView.cpp.

References err, kTraversal, and kTraversalError.

00314     {
00315         return kTraversalError;
00316     }

virtual kTraversal TViewFill::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 242 of file UCvsFiles.cpp.

References err, kTraversal, and kTraversalError.

00243     {
00244         return kTraversalError;
00245     }

virtual kTraversal TViewFill::OnFile | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct wnt_stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Definition at line 368 of file BrowseFileView.cpp.

References Entries_SetVisited, FSSpec, CBrowseFileView::GetImageForEntry, GetListCtrl, InitItem, EntnodeData::IsIgnored, EntnodeData::IsLocked, KoTraversalContext::IsMatch, IsShowIgnored, kContinueTraversal, kTraversal, m_ignlist, and stat.

00372     {
00373         EntnodeData *data = Entries_SetVisited(fullpath, m_entries, name, dir, false, &m_ignlist);
00374         if(!IsShowIgnored() && data->IsIgnored())
00375             return kContinueTraversal;
00376
00377         if (m_context->IsMatch(data))
00378         {
00379             int pos = InitItem(data, CBrowseFileView::GetImageForEntry(data));
00380             if (pos >=  0)
00381             {
00382                 UINT state = data->IsLocked() ? INDEXTOSTATEIMAGEMASK(2) : INDEXTOSTATEIMAGEMASK(1);
00383                 CListCtrl& listCtrl = GetListCtrl();
00384                 listCtrl.SetItemState(pos, state, LVIS_STATEIMAGEMASK);
00385             }
00386         }
00387         return kContinueTraversal;
00388     }

virtual kTraversal TViewFill::OnFile | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 322 of file UCvsFiles.cpp.

References ULIST_INSERT::col, Entries_SetVisited, EV_LIST_INSERT, EV_LIST_NEWROW, EV_LIST_ROWSETDATA, FSSpec, EntnodeData::GetDesc, UCvsFiles::GetImageForEntry, UCmdTarget::GetWidID, ULIST_INSERT::icon, EntnodeData::IsIgnored, EntnodeData::IsLocked, kContinueTraversal, EntnodeData::kStatus, kTraversal, kUMainWidget, m_ignlist, NUM_COLUMNS, ULIST_INSERT::row, stat, ULIST_INSERT::title, UEventSendMessage, and UMAKEINT.

Referenced by OnAlias.

00326     {
00327         EntnodeData *data = Entries_SetVisited(fullpath, m_entries, name, dir, false, &m_ignlist);
00328         if(!(bool)gFileViewIgnore && data->IsIgnored())
00329             return kContinueTraversal;
00330
00331         int rownum;
00332         UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_NEWROW, kUMainWidget, &rownum);
00333         UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_ROWSETDATA, UMAKEINT(kUMainWidget, rownum), data);
00334         ULIST_INSERT entry;
00335         entry.row = rownum;
00336
00337         entry.col = 0;
00338         entry.title = name;
00339         entry.icon = UCvsFiles::GetImageForEntry(data);
00340         UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00341
00342         entry.icon = 0L;
00343
00344 #if 0 /* TODO */
00345         lvi.state = data->IsLocked() ?
00346             INDEXTOSTATEIMAGEMASK(2) : INDEXTOSTATEIMAGEMASK(1);
00347 #endif
00348
00349         // set item text for additional columns
00350         for(int j = 1; j < NUM_COLUMNS; j++)
00351         {
00352             const char *info = (*data)[j];
00353             if(info != 0L)
00354             {
00355                 entry.col = j;
00356                 entry.title = info;
00357                 UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00358             }
00359         }
00360         entry.col = EntnodeData::kStatus;
00361         entry.title = data->GetDesc();
00362         UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00363
00364         return kContinueTraversal;
00365     }

virtual kTraversal TViewFill::OnIdle ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 318 of file BrowseFileView.cpp.

References kContinueTraversal, and kTraversal.

00319     {
00320         return kContinueTraversal;
00321     }

virtual kTraversal TViewFill::OnIdle ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 247 of file UCvsFiles.cpp.

References kContinueTraversal, and kTraversal.

00248     {
00249         return kContinueTraversal;
00250     }

Member Data Documentation

const KoTraversalContext* TViewFill::m_context

Definition at line 216 of file BrowseFileView.cpp.

CSortList<ENTNODE> TViewFill::m_entries

Definition at line 214 of file BrowseFileView.cpp.

CSortList<ENTNODE>& TViewFill::m_entries

Definition at line 220 of file UCvsFiles.cpp.

vector< UStr > TViewFill::m_ignlist

Definition at line 215 of file BrowseFileView.cpp.

:: vector< UStr > TViewFill::m_ignlist

Definition at line 221 of file UCvsFiles.cpp.

Referenced by EnterDirectory, ExitDirectory, OnDirectory, and OnFile.

UCvsFiles* TViewFill::m_listCtrl

Definition at line 219 of file UCvsFiles.cpp.

The documentation for this class was generated from the following files:
  • common/UCvsFiles.cpp
  • WinCvs/BrowseFileView.cpp
Generated on Sun Feb 24 01:28:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CUpdateMain Class Reference

#include <UpdateDlg.h>

Inheritance diagram for CUpdateMain:

[legend]
Collaboration diagram for CUpdateMain:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_UPDATE_MAIN }

Public Methods

CUpdateMain ()
~CUpdateMain ()

Public Attributes

BOOL | m_delsticky
BOOL | m_norecurs
BOOL | m_stdout
BOOL | m_createmissdir
BOOL | m_getcleancopy

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 62 of file UpdateDlg.h.

00062 { IDD = IDD_UPDATE_MAIN };

Constructor & Destructor Documentation

CUpdateMain::CUpdateMain ( )

Definition at line 103 of file UpdateDlg.cpp.

References FALSE, m_createmissdir, m_delsticky, m_getcleancopy, m_norecurs, and m_stdout.

00103                          : CPropertyPage(CUpdateMain::IDD)
00104 {
00105     //{{AFX_DATA_INIT(CUpdateMain)
00106     m_delsticky = FALSE;
00107     m_norecurs = FALSE;
00108     m_stdout = FALSE;
00109     m_createmissdir = FALSE;
00110     m_getcleancopy = FALSE;
00111     //}}AFX_DATA_INIT
00112 }

CUpdateMain::~CUpdateMain ( )

Definition at line 114 of file UpdateDlg.cpp.

00115 {
00116 }

Member Function Documentation

void CUpdateMain::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 118 of file UpdateDlg.cpp.

References IDC_CLEANCOPY, IDC_CREATEMISSDIR, IDC_DELSTICKY, IDC_NORECURS, IDC_STDOUT, m_createmissdir, m_delsticky, m_getcleancopy, m_norecurs, and m_stdout.

00119 {
00120     CPropertyPage::DoDataExchange(pDX);
00121     //{{AFX_DATA_MAP(CUpdateMain)
00122     DDX_Check(pDX, IDC_DELSTICKY, m_delsticky);
00123     DDX_Check(pDX, IDC_NORECURS, m_norecurs);
00124     DDX_Check(pDX, IDC_STDOUT, m_stdout);
00125     DDX_Check(pDX, IDC_CREATEMISSDIR, m_createmissdir);
00126     DDX_Check(pDX, IDC_CLEANCOPY, m_getcleancopy);
00127     //}}AFX_DATA_MAP
00128 }

Member Data Documentation

BOOL CUpdateMain::m_createmissdir

Definition at line 66 of file UpdateDlg.h.

Referenced by CompatGetUpdate, CUpdateMain, and DoDataExchange.

BOOL CUpdateMain::m_delsticky

Definition at line 63 of file UpdateDlg.h.

Referenced by CompatGetUpdate, CUpdateMain, and DoDataExchange.

BOOL CUpdateMain::m_getcleancopy

Definition at line 67 of file UpdateDlg.h.

Referenced by CompatGetUpdate, CUpdateMain, and DoDataExchange.

BOOL CUpdateMain::m_norecurs

Definition at line 64 of file UpdateDlg.h.

Referenced by CompatGetUpdate, CUpdateMain, and DoDataExchange.

BOOL CUpdateMain::m_stdout

Definition at line 65 of file UpdateDlg.h.

Referenced by CompatGetUpdate, CUpdateMain, and DoDataExchange.

The documentation for this class was generated from the following files:
  • common/UpdateDlg.h
  • common/UpdateDlg.cpp
Generated on Sun Feb 24 01:28:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CUpdateMerge Class Reference

#include <UpdateDlg.h>

Inheritance diagram for CUpdateMerge:

[legend]
Collaboration diagram for CUpdateMerge:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_UPDATE_MERGE }

Public Methods

CUpdateMerge (bool isCheckout, const char *rev1, const char *rev2, const char *date1, const char *date2)
CUpdateMerge ()
~CUpdateMerge ()

Public Attributes

CSmartComboBox m_date2Combo
CSmartComboBox m_date1Combo
CSmartComboBox m_rev2Combo
CSmartComboBox m_rev1Combo
CString | m_rev1
CString | m_rev2
int | m_merge
BOOL | m_hasDate1
BOOL | m_hasDate2
CString | m_date1
CString | m_date2

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnMerge ()
afx_msg void | OnMerge1 ()
afx_msg void | OnMerge2 ()
afx_msg void | OnCheckdate1 ()
afx_msg void | OnCheckdate2 ()

Private Attributes

bool | m_isCheckout

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 100 of file UpdateDlg.h.

00100 { IDD = IDD_UPDATE_MERGE };

Constructor & Destructor Documentation

CUpdateMerge::CUpdateMerge | ( | bool | isCheckout,
 |  | const char * | rev1,
 |  | const char * | rev2,
 |  | const char * | date1,
 |  | const char * | date2
 | ) |

Definition at line 218 of file UpdateDlg.cpp.

References FALSE, m_date1, m_date1Combo, m_date2, m_date2Combo, m_hasDate1, m_hasDate2, m_isCheckout, m_merge, m_rev1, m_rev1Combo, m_rev2, m_rev2Combo, and USmartCombo::SetItems.

00219     : CPropertyPage(CUpdateMerge::IDD)
00220 {
00221     //{{AFX_DATA_INIT(CUpdateMerge)
00222     m_rev1 = rev1;
00223     m_rev2 = rev2;
00224     m_merge = 0;
00225     m_hasDate1 = FALSE;
00226     m_hasDate2 = FALSE;
00227     m_date1 = _T("");
00228     m_date2 = _T("");
00229     //}}AFX_DATA_INIT
00230
00231     m_isCheckout = isCheckout;
00232
00233     m_rev1Combo.SetItems(m_isCheckout ? &gReleasesNames : &gRevNames);
00234     m_rev2Combo.SetItems(m_isCheckout ? &gReleasesNames : &gRevNames);
00235     m_date1Combo.SetItems(&gDateNames);
00236     m_date2Combo.SetItems(&gDateNames);
00237 }

CUpdateMerge::CUpdateMerge ( )

Definition at line 239 of file UpdateDlg.cpp.

00239                            : CPropertyPage(CUpdateMerge::IDD)
00240 {
00241 }

CUpdateMerge::~CUpdateMerge ( )

Definition at line 243 of file UpdateDlg.cpp.

00244 {
00245 }

Member Function Documentation

void CUpdateMerge::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 247 of file UpdateDlg.cpp.

References DDV_MinChars, DDX_ComboMString, IDC_CHECKDATE1, IDC_CHECKDATE2, IDC_COMBODATE1, IDC_COMBODATE2, IDC_COMBOREV, IDC_COMBOREV2, IDC_MERGE, m_date1, m_date1Combo, m_date2, m_date2Combo, m_hasDate1, m_hasDate2, m_merge, m_rev1, m_rev1Combo, m_rev2, m_rev2Combo, and OnMerge.

00248 {
00249     CPropertyPage::DoDataExchange(pDX);
00250     //{{AFX_DATA_MAP(CUpdateMerge)
00251     DDX_Control(pDX, IDC_COMBODATE2, m_date2Combo);
00252     DDX_Control(pDX, IDC_COMBODATE1, m_date1Combo);
00253     DDX_Control(pDX, IDC_COMBOREV2, m_rev2Combo);
00254     DDX_Control(pDX, IDC_COMBOREV, m_rev1Combo);
00255     DDX_CBString(pDX, IDC_COMBOREV, m_rev1);
00256     DDX_CBString(pDX, IDC_COMBOREV2, m_rev2);
00257     DDX_Radio(pDX, IDC_MERGE, m_merge);
00258     DDX_Check(pDX, IDC_CHECKDATE1, m_hasDate1);
00259     DDX_Check(pDX, IDC_CHECKDATE2, m_hasDate2);
00260     DDX_CBString(pDX, IDC_COMBODATE1, m_date1);
00261     DDX_CBString(pDX, IDC_COMBODATE2, m_date2);
00262     //}}AFX_DATA_MAP
00263
00264     if( m_merge == 1 || m_merge == 2 )
00265     {
00266         DDV_MinChars(pDX, m_rev1, 1);
00267         if( m_hasDate1 )
00268         {
00269             DDV_MinChars(pDX, m_date1, 1);
00270         }
00271     }
00272
00273     if( m_merge == 2 )
00274     {
00275         DDV_MinChars(pDX, m_rev2, 1);
00276         if( m_hasDate2 )
00277         {
00278             DDV_MinChars(pDX, m_date2, 1);
00279         }
00280     }
00281
00282     if( !pDX->m_bSaveAndValidate )
00283     {
00284         OnMerge();
00285     }
00286
00287     DDX_ComboMString(pDX, IDC_COMBOREV, m_rev1Combo);
00288     DDX_ComboMString(pDX, IDC_COMBOREV2, m_rev2Combo);
00289     DDX_ComboMString(pDX, IDC_COMBODATE1, m_date1Combo);
00290     DDX_ComboMString(pDX, IDC_COMBODATE2, m_date2Combo);
00291 }

void CUpdateMerge::OnCheckdate1 ( ) [protected]

Definition at line 337 of file UpdateDlg.cpp.

References OnMerge.

00338 {
00339     OnMerge();
00340 }

void CUpdateMerge::OnCheckdate2 ( ) [protected]

Definition at line 342 of file UpdateDlg.cpp.

References OnMerge.

00343 {
00344     OnMerge();
00345 }

void CUpdateMerge::OnMerge ( ) [protected]

Definition at line 293 of file UpdateDlg.cpp.

References FALSE, IDC_CHECKDATE1, IDC_CHECKDATE2, IDC_COMBODATE1, IDC_COMBODATE2, IDC_COMBOREV, IDC_COMBOREV2, IDC_MERGE1, IDC_MERGE2, and TRUE.

Referenced by DoDataExchange, OnCheckdate1, OnCheckdate2, OnMerge1, and OnMerge2.

00294 {
00295     CButton* chkMerge1 = (CButton*)GetDlgItem(IDC_MERGE1);
00296     CButton* chkMerge2 = (CButton*)GetDlgItem(IDC_MERGE2);
00297     CWnd* wndRev1 = GetDlgItem(IDC_COMBOREV);
00298     CWnd* wndRev2 = GetDlgItem(IDC_COMBOREV2);
00299
00300     CButton* chkDate1 = (CButton*)GetDlgItem(IDC_CHECKDATE1);
00301     CButton* chkDate2 = (CButton*)GetDlgItem(IDC_CHECKDATE2);
00302     CWnd* wndDate1 = GetDlgItem(IDC_COMBODATE1);
00303     CWnd* wndDate2 = GetDlgItem(IDC_COMBODATE2);
00304
00305     if( chkMerge1->GetCheck() == 1 )
00306     {
00307         wndRev1->EnableWindow(TRUE);
00308         wndRev2->EnableWindow(FALSE);
00309     }
00310     else if( chkMerge2->GetCheck() == 1 )
00311     {
00312         wndRev1->EnableWindow(TRUE);
00313         wndRev2->EnableWindow(TRUE);
00314     }
00315     else
00316     {
00317         wndRev1->EnableWindow(FALSE);
00318         wndRev2->EnableWindow(FALSE);
00319     }
00320
00321     chkDate1->EnableWindow(wndRev1->IsWindowEnabled());
00322     chkDate2->EnableWindow(wndRev2->IsWindowEnabled());
00323     wndDate1->EnableWindow(wndRev1->IsWindowEnabled() && chkDate1->GetCheck());
00324     wndDate2->EnableWindow(wndRev2->IsWindowEnabled() && chkDate2->GetCheck());
00325 }

void CUpdateMerge::OnMerge1 ( ) [protected]

Definition at line 327 of file UpdateDlg.cpp.

References OnMerge.

00328 {
00329     OnMerge();
00330 }

void CUpdateMerge::OnMerge2 ( ) [protected]

Definition at line 332 of file UpdateDlg.cpp.

References OnMerge.

00333 {
00334     OnMerge();
00335 }

Member Data Documentation

CString CUpdateMerge::m_date1

Definition at line 110 of file UpdateDlg.h.

Referenced by CompatGetCheckout, CompatGetUpdate, CUpdateMerge, and DoDataExchange.

CSmartComboBox CUpdateMerge::m_date1Combo

Definition at line 102 of file UpdateDlg.h.

Referenced by CUpdateMerge, and DoDataExchange.

CString CUpdateMerge::m_date2

Definition at line 111 of file UpdateDlg.h.

Referenced by CompatGetCheckout, CompatGetUpdate, CUpdateMerge, and DoDataExchange.

CSmartComboBox CUpdateMerge::m_date2Combo

Definition at line 101 of file UpdateDlg.h.

Referenced by CUpdateMerge, and DoDataExchange.

BOOL CUpdateMerge::m_hasDate1

Definition at line 108 of file UpdateDlg.h.

Referenced by CompatGetCheckout, CompatGetUpdate, CUpdateMerge, and DoDataExchange.

BOOL CUpdateMerge::m_hasDate2

Definition at line 109 of file UpdateDlg.h.

Referenced by CompatGetCheckout, CompatGetUpdate, CUpdateMerge, and DoDataExchange.

bool CUpdateMerge::m_isCheckout [private]

Definition at line 134 of file UpdateDlg.h.

Referenced by CUpdateMerge.

int CUpdateMerge::m_merge

Definition at line 107 of file UpdateDlg.h.

Referenced by CompatGetCheckout, CompatGetUpdate, CUpdateMerge, and DoDataExchange.

CString CUpdateMerge::m_rev1

Definition at line 105 of file UpdateDlg.h.

Referenced by CompatGetCheckout, CompatGetUpdate, CUpdateMerge, and DoDataExchange.

CSmartComboBox CUpdateMerge::m_rev1Combo

Definition at line 104 of file UpdateDlg.h.

Referenced by CUpdateMerge, and DoDataExchange.

CString CUpdateMerge::m_rev2

Definition at line 106 of file UpdateDlg.h.

Referenced by CompatGetCheckout, CompatGetUpdate, CUpdateMerge, and DoDataExchange.

CSmartComboBox CUpdateMerge::m_rev2Combo

Definition at line 103 of file UpdateDlg.h.

Referenced by CUpdateMerge, and DoDataExchange.

The documentation for this class was generated from the following files:
  • common/UpdateDlg.h
  • common/UpdateDlg.cpp
Generated on Sun Feb 24 01:28:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CUpdateSticky Class Reference

#include <UpdateDlg.h>

Inheritance diagram for CUpdateSticky:

[legend]
Collaboration diagram for CUpdateSticky:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_UPDATE_STICKY }

Public Methods

CUpdateSticky (const char *rev, const char *date)
CUpdateSticky ()
~CUpdateSticky ()

Public Attributes

CSmartComboBox m_dateCombo
CSmartComboBox m_revCombo
CString | m_date
CString | m_rev
BOOL | m_hasdate
BOOL | m_hasrev
BOOL | m_match

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnDate ()
afx_msg void | OnRev ()

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 149 of file UpdateDlg.h.

00149 { IDD = IDD_UPDATE_STICKY };

Constructor & Destructor Documentation

CUpdateSticky::CUpdateSticky | ( | const char * | rev,
 |  | const char * | date
 | ) |

Definition at line 139 of file UpdateDlg.cpp.

References FALSE, m_date, m_dateCombo, m_hasdate, m_hasrev, m_match, m_rev, m_revCombo, and USmartCombo::SetItems.

00139                                                               : CPropertyPage(CUpdateSticky::IDD)
00140 {
00141     //{{AFX_DATA_INIT(CUpdateSticky)
00142     m_date = date;
00143     m_rev = rev;
00144     m_hasdate = FALSE;
00145     m_hasrev = FALSE;
00146     m_match = FALSE;
00147     //}}AFX_DATA_INIT
00148
00149     m_revCombo.SetItems(&gRevNames);
00150     m_dateCombo.SetItems(&gDateNames);
00151 }

CUpdateSticky::CUpdateSticky ( )

Definition at line 153 of file UpdateDlg.cpp.

00153                              : CPropertyPage(CUpdateSticky::IDD)
00154 {
00155 }

CUpdateSticky::~CUpdateSticky ( )

Definition at line 157 of file UpdateDlg.cpp.

00158 {
00159 }

Member Function Documentation

void CUpdateSticky::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 161 of file UpdateDlg.cpp.

References DDV_MinChars, DDX_ComboMString, IDC_COMBODATE, IDC_COMBOREV, IDC_DATE, IDC_MATCH, IDC_REV, m_date, m_dateCombo, m_hasdate, m_hasrev, m_match, m_rev, m_revCombo, OnDate, and OnRev.

00162 {
00163     CPropertyPage::DoDataExchange(pDX);
00164     //{{AFX_DATA_MAP(CUpdateSticky)
00165     DDX_Control(pDX, IDC_COMBODATE, m_dateCombo);
00166     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00167     DDX_CBString(pDX, IDC_COMBODATE, m_date);
00168     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00169     DDX_Check(pDX, IDC_DATE, m_hasdate);
00170     DDX_Check(pDX, IDC_REV, m_hasrev);
00171     DDX_Check(pDX, IDC_MATCH, m_match);
00172     //}}AFX_DATA_MAP
00173
00174     if( m_hasrev )
00175     {
00176         DDV_MinChars(pDX, m_rev, 1);
00177     }
00178
00179     if( m_hasdate )
00180     {
00181         DDV_MinChars(pDX, m_date, 1);
00182     }
00183
00184     if( !pDX->m_bSaveAndValidate )
00185     {
00186         OnDate();
00187         OnRev();
00188     }
00189
00190     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00191     DDX_ComboMString(pDX, IDC_COMBODATE, m_dateCombo);
00192 }

void CUpdateSticky::OnDate ( ) [protected]

Definition at line 202 of file UpdateDlg.cpp.

References IDC_COMBODATE, and IDC_DATE.

Referenced by DoDataExchange.

00203 {
00204     CButton* but = (CButton *)GetDlgItem(IDC_DATE);
00205     CWnd* wnd = GetDlgItem(IDC_COMBODATE);
00206     wnd->EnableWindow(but->GetCheck() == 1);
00207 }

void CUpdateSticky::OnRev ( ) [protected]

Definition at line 209 of file UpdateDlg.cpp.

References IDC_COMBOREV, and IDC_REV.

Referenced by DoDataExchange.

00210 {
00211     CButton* but = (CButton *)GetDlgItem(IDC_REV);
00212     CWnd* wnd = GetDlgItem(IDC_COMBOREV);
00213     wnd->EnableWindow(but->GetCheck() == 1);
00214 }

Member Data Documentation

CString CUpdateSticky::m_date

Definition at line 152 of file UpdateDlg.h.

Referenced by CompatGetUpdate, CUpdateSticky, and DoDataExchange.

CSmartComboBox CUpdateSticky::m_dateCombo

Definition at line 150 of file UpdateDlg.h.

Referenced by CUpdateSticky, and DoDataExchange.

BOOL CUpdateSticky::m_hasdate

Definition at line 154 of file UpdateDlg.h.

Referenced by CompatGetUpdate, CUpdateSticky, and DoDataExchange.

BOOL CUpdateSticky::m_hasrev

Definition at line 155 of file UpdateDlg.h.

Referenced by CompatGetUpdate, CUpdateSticky, and DoDataExchange.

BOOL CUpdateSticky::m_match

Definition at line 156 of file UpdateDlg.h.

Referenced by CompatGetUpdate, CUpdateSticky, and DoDataExchange.

CString CUpdateSticky::m_rev

Definition at line 153 of file UpdateDlg.h.

Referenced by CompatGetUpdate, CUpdateSticky, and DoDataExchange.

CSmartComboBox CUpdateSticky::m_revCombo

Definition at line 151 of file UpdateDlg.h.

Referenced by CUpdateSticky, and DoDataExchange.

The documentation for this class was generated from the following files:
  • common/UpdateDlg.h
  • common/UpdateDlg.cpp
Generated on Sun Feb 24 01:28:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CustInvertTable Struct Reference

#include <CustomizeMenus.h>

Collaboration diagram for CustInvertTable:

[legend]
List of all members.

Public Attributes

const char * | title
const char * | key
int | cmd

Member Data Documentation

int CustInvertTable::cmd

Definition at line 37 of file CustomizeMenus.h.

Referenced by _Compare, GetCustomMenu, CCustomizeMenus::GetIcon, CCustInvertTable::Initialize, CCustomizeMenus::OnAdd, CCustomizeMenus::OnInitDialog, and CCustomizeMenus::OnRemove.

const char* CustInvertTable::key

Definition at line 36 of file CustomizeMenus.h.

Referenced by CCustInvertTable::CCustInvertTable, CCustInvertTable::Initialize, IsInInvertList, and CCustomizeMenus::OnOK.

const char* CustInvertTable::title

Definition at line 35 of file CustomizeMenus.h.

Referenced by GetCustomMenu, GetInvString, and CCustInvertTable::Initialize.

The documentation for this struct was generated from the following file:
  • WinCvs/CustomizeMenus.h
Generated on Sun Feb 24 01:28:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


std::vector Class Reference

Inheritance diagram for std::vector:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CustomizeMenus.cpp
Generated on Sun Feb 24 01:28:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CView Class Reference

Inheritance diagram for CView:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/BrowserBar.h
Generated on Sun Feb 24 01:28:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CViewInfo Struct Reference

Collaboration diagram for CViewInfo:

[legend]
List of all members.

Public Attributes

TView * view

Member Data Documentation

TView* CViewInfo::view

Definition at line 890 of file UPseudoSupport.cpp.

Referenced by extractInfos.

The documentation for this struct was generated from the following file:
  • rf/support/macapp/UPseudoSupport.cpp
Generated on Sun Feb 24 01:28:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsArgs Class Reference

#include <CvsArgs.h>

Inheritance diagram for CvsArgs:

[legend]
Collaboration diagram for CvsArgs:

[legend]
List of all members.

Public Methods

CvsArgs (bool defargs=true)
CvsArgs (char *const *fromargv, int fromargc)
virtual | ~CvsArgs ()
virtual void | add (const char *arg)
virtual void | addfile (const char *arg, const char *dir=0L, const FSSpec *spec=0L)
void | reset (bool defargs=true)
void | print (const char *indirectory=0L)
char *const * | Argv (void) const
int | Argc (void) const

Protected Attributes

char ** | argv
int | argc

Constructor & Destructor Documentation

CvsArgs::CvsArgs ( bool defargs = true )

Definition at line 56 of file CvsArgs.cpp.

References argc, argv, NULL, and reset.

00057 {
00058     argv = NULL;
00059     argc = 0;
00060
00061     reset(defargs);
00062 }

CvsArgs::CvsArgs | ( | char *const * | fromargv,
 |  | int | fromargc
 | ) |

Definition at line 64 of file CvsArgs.cpp.

References add, argc, argv, NULL, and reset.

00065 {
00066     argv = NULL;
00067     argc = 0;
00068
00069     reset(false);
00070
00071     for(int i = 0; i < fromargc; i++)
00072     {
00073         add(fromargv[i]);
00074     }
00075 }

CvsArgs::~CvsArgs ( ) [virtual]

Definition at line 77 of file CvsArgs.cpp.

References reset.

00078 {
00079     reset(false);
00080 }

Member Function Documentation

void CvsArgs::add ( const char * arg ) [virtual]

Definition at line 223 of file CvsArgs.cpp.

References argc, argv, malloc, mystrdup, and realloc.

Referenced by addfile, CompatGetCommand, CvsArgs, CvsCmdAddBinaryFiles, CvsCmdAddFiles, CvsCmdAddFolder, CvsCmdAddUnicodeFiles, CvsCmdAnnotateFiles, CvsCmdCancelChangesFiles, CvsCmdCheckoutModule, CvsCmdCommitFiles, CvsCmdCommitFolder, CvsCmdDiffFiles, CvsCmdDiffFolder, CvsCmdEditFiles, CvsCmdEditFolder, CvsCmdEditorsFiles, CvsCmdEditorsFolder, CvsCmdImportModule, CvsCmdInit, CvsCmdLockFiles, CvsCmdLockFolder, CvsCmdLogFiles, CvsCmdLogFolder, CvsCmdLogin, CvsCmdLogout, CvsCmdReleaseFolder, CvsCmdRemoveFiles, CvsCmdRtagBranch, CvsCmdRtagCreate, CvsCmdRtagDelete, CvsCmdStatusFiles, CvsCmdStatusFolder, CvsCmdTagBranchFiles, CvsCmdTagBranchFolder, CvsCmdTagCreateFiles, CvsCmdTagCreateFolder, CvsCmdTagDeleteFiles, CvsCmdTagDeleteFolder, CvsCmdUneditFiles, CvsCmdUneditFolder, CvsCmdUnlockFiles, CvsCmdUnlockFolder, CvsCmdUpdateFiles, CvsCmdUpdateFolder, CvsCmdWatchersFiles, CvsCmdWatchersFolder, CvsCmdWatchOffFiles, CvsCmdWatchOffFolder, CvsCmdWatchOnFiles, CvsCmdWatchOnFolder, cvsgui_RunCvs, UCvsFiles::EditSel, LaunchDiff, UCvsFolders::OnCmdExplore, UCvsFiles::OnCmdExplore, MacroTraversal::OnFile, CGraphView::OnGraphChangelogmessage, CGraphView::OnGraphSetdescription, CGraphView::OnGraphSetstate, CGraphView::OnQueryAnnotate, CGraphView::OnViewDelrev, CGraphView::OnViewDiff, CGraphView::OnViewReload, CGraphView::OnViewRetrieve, CGraphView::OnViewTag, CGraphView::OnViewUnlockf, CGraphView::OnViewUpdate, CBrowseFileView::ResetView, UCvsFiles::ResetView, and tclCvsProc.

00224 {
00225     if(argv == 0L)
00226         argv = (char **)malloc(2 * sizeof(char *));
00227     else
00228         argv = (char **)realloc(argv, (argc + 2) * sizeof(char *));
00229     argv[argc++] = arg != 0L ? mystrdup(arg) : 0L;
00230     argv[argc] = 0L;
00231 }

void CvsArgs::addfile | ( | const char * | arg,
 |  | const char * | dir = 0L,
 |  | const FSSpec * | spec = 0L
 | ) | [virtual]

Reimplemented in ControlCvsArgs.

Definition at line 233 of file CvsArgs.cpp.

References add, and UFSSpec.

Referenced by MultiFiles::add, RemoveCvsArgs::addfile, and ControlCvsArgs::addfile.

00234 {
00235     add(arg);
00236 }

int CvsArgs::Argc ( void ) const [inline]

Definition at line 51 of file CvsArgs.h.

References argc.

Referenced by CvsCmdAddBinaryFiles, CvsCmdAddFiles, CvsCmdAddFolder, CvsCmdAddUnicodeFiles, CvsCmdCancelChangesFiles, CvsCmdCheckoutModule, CvsCmdCommitFiles, CvsCmdCommitFolder, CvsCmdDiffFiles, CvsCmdDiffFolder, CvsCmdEditFiles, CvsCmdEditFolder, CvsCmdEditorsFiles, CvsCmdEditorsFolder, CvsCmdImportModule, CvsCmdInit, CvsCmdLine, CvsCmdLockFiles, CvsCmdLockFolder, CvsCmdLogin, CvsCmdLogout, CvsCmdReleaseFolder, CvsCmdRemoveFiles, CvsCmdRtagBranch, CvsCmdRtagCreate, CvsCmdRtagDelete, CvsCmdStatusFiles, CvsCmdStatusFolder, CvsCmdTagBranchFiles, CvsCmdTagBranchFolder, CvsCmdTagCreateFiles, CvsCmdTagCreateFolder, CvsCmdTagDeleteFiles, CvsCmdTagDeleteFolder, CvsCmdUneditFiles, CvsCmdUneditFolder, CvsCmdUnlockFiles, CvsCmdUnlockFolder, CvsCmdUpdateFiles, CvsCmdUpdateFolder, CvsCmdWatchersFiles, CvsCmdWatchersFolder, CvsCmdWatchOffFiles, CvsCmdWatchOffFolder, CvsCmdWatchOnFiles, CvsCmdWatchOnFolder, cvsgui_RunCvs, UCvsFiles::EditSel, launchCVS, LaunchDiff, UCvsFolders::OnCmdExplore, UCvsFiles::OnCmdExplore, UCvsFiles::OnCmdTrash, MacroTraversal::OnFile, CGraphView::OnGraphChangelogmessage, CGraphView::OnGraphSetdescription, CGraphView::OnGraphSetstate, CGraphView::OnViewDelrev, CGraphView::OnViewDiff, CGraphView::OnViewRetrieve, CGraphView::OnViewTag, CGraphView::OnViewUnlockf, CGraphView::OnViewUpdate, CBrowseFileView::ResetView, UCvsFiles::ResetView, and tclCvsProc.

00051 {return argc;}

char* const* CvsArgs::Argv ( void ) const [inline]

Definition at line 50 of file CvsArgs.h.

References argv.

Referenced by CvsCmdAddBinaryFiles, CvsCmdAddFiles, CvsCmdAddFolder, CvsCmdAddUnicodeFiles, CvsCmdCancelChangesFiles, CvsCmdCheckoutModule, CvsCmdCommitFiles, CvsCmdCommitFolder, CvsCmdDiffFiles, CvsCmdDiffFolder, CvsCmdEditFiles, CvsCmdEditFolder, CvsCmdEditorsFiles, CvsCmdEditorsFolder, CvsCmdImportModule, CvsCmdInit, CvsCmdLine, CvsCmdLockFiles, CvsCmdLockFolder, CvsCmdLogin, CvsCmdLogout, CvsCmdReleaseFolder, CvsCmdRemoveFiles, CvsCmdRtagBranch, CvsCmdRtagCreate, CvsCmdRtagDelete, CvsCmdStatusFiles, CvsCmdStatusFolder, CvsCmdTagBranchFiles, CvsCmdTagBranchFolder, CvsCmdTagCreateFiles, CvsCmdTagCreateFolder, CvsCmdTagDeleteFiles, CvsCmdTagDeleteFolder, CvsCmdUneditFiles, CvsCmdUneditFolder, CvsCmdUnlockFiles, CvsCmdUnlockFolder, CvsCmdUpdateFiles, CvsCmdUpdateFolder, CvsCmdWatchersFiles, CvsCmdWatchersFolder, CvsCmdWatchOffFiles, CvsCmdWatchOffFolder, CvsCmdWatchOnFiles, CvsCmdWatchOnFolder, cvsgui_RunCvs, UCvsFiles::EditSel, launchCVS, LaunchDiff, CGetPrefs_WINCVS::OnAltcvssel, UAuthen_SSH::OnBtnName, UAuthen_SSH::OnBtnRSA, CGetPrefs_WINCVS::OnBtnviewer, UCvsFolders::OnCmdExplore, UCvsFiles::OnCmdExplore, UCvsFiles::OnCmdTrash, CGetPrefs_WINCVS::OnExtdiffsel, MacroTraversal::OnFile, CGraphView::OnGraphChangelogmessage, CGraphView::OnGraphSetdescription, CGraphView::OnGraphSetstate, CGraphView::OnViewDelrev, CGraphView::OnViewDiff, CGraphView::OnViewRetrieve, CGraphView::OnViewTag, CGraphView::OnViewUnlockf, CGraphView::OnViewUpdate, CBrowseFileView::ResetView, UCvsFiles::ResetView, and tclCvsProc.

00050 {return argv;}

void CvsArgs::print ( const char * indirectory = 0L )

Definition at line 193 of file CvsArgs.cpp.

References argc, argv, CStr, cvs_out, cvs_outstr, expandLF, MAX_PRINT_ARG, NULL, and reduceString.

Referenced by CvsCmdAddBinaryFiles, CvsCmdAddFiles, CvsCmdAddFolder, CvsCmdAddUnicodeFiles, CvsCmdAnnotateFiles, CvsCmdCancelChangesFiles, CvsCmdCheckoutModule, CvsCmdCommitFiles, CvsCmdCommitFolder, CvsCmdDiffFiles, CvsCmdDiffFolder, CvsCmdEditFiles, CvsCmdEditFolder, CvsCmdEditorsFiles, CvsCmdEditorsFolder, CvsCmdImportModule, CvsCmdInit, CvsCmdLine, CvsCmdLockFiles, CvsCmdLockFolder, CvsCmdLogFiles, CvsCmdLogFolder, CvsCmdLogin, CvsCmdLogout, CvsCmdReleaseFolder, CvsCmdRemoveFiles, CvsCmdRtagBranch, CvsCmdRtagCreate, CvsCmdRtagDelete, CvsCmdStatusFiles, CvsCmdStatusFolder, CvsCmdTagBranchFiles, CvsCmdTagBranchFolder, CvsCmdTagCreateFiles, CvsCmdTagCreateFolder, CvsCmdTagDeleteFiles, CvsCmdTagDeleteFolder, CvsCmdUneditFiles, CvsCmdUneditFolder, CvsCmdUnlockFiles, CvsCmdUnlockFolder, CvsCmdUpdateFiles, CvsCmdUpdateFolder, CvsCmdWatchersFiles, CvsCmdWatchersFolder, CvsCmdWatchOffFiles, CvsCmdWatchOffFolder, CvsCmdWatchOnFiles, CvsCmdWatchOnFolder, CGraphView::OnGraphChangelogmessage, CGraphView::OnGraphSetdescription, CGraphView::OnGraphSetstate, CGraphView::OnQueryAnnotate, CGraphView::OnViewDelrev, CGraphView::OnViewDiff, CGraphView::OnViewReload, CGraphView::OnViewRetrieve, CGraphView::OnViewTag, CGraphView::OnViewUnlockf, and CGraphView::OnViewUpdate.

00194 {
00195     static CStaticAllocT<char> buf;
00196
00197     for(int i = 0; i < argc; i++)
00198     {
00199         CStr newarg;
00200         newarg = argv[i];
00201         bool hasLF = strchr(newarg, '\n') != 0L;
00202         size_t len = newarg.length();
00203
00204         if(len > MAX_PRINT_ARG)
00205             newarg = reduceString(newarg, buf);
00206
00207         if(hasLF)
00208             newarg = expandLF(newarg, buf);
00209
00210         bool hasSpace = strchr(newarg, ' ') != 0L;
00211         if(hasSpace)
00212             cvs_out("\"");
00213         cvs_outstr(newarg, newarg.length());
00214         if(hasSpace)
00215             cvs_out("\"");
00216         cvs_out(" ");
00217     }
00218     if(indirectory != NULL)
00219         cvs_out("(in directory %s)", indirectory);
00220     cvs_out("\n");
00221 }

void CvsArgs::reset ( bool defargs = true )

Definition at line 82 of file CvsArgs.cpp.

References argc, argv, CStr, free, gserver, malloc, mystrdup, NULL, and Authen::skiptoken.

Referenced by CvsArgs, CBrowseFileView::ResetView, and ~CvsArgs.

00083 {
00084     if(argv != 0L)
00085     {
00086         for(int i = 0; i < argc; i++)
00087         {
00088             if(argv[i] != 0L)
00089                 free(argv[i]);
00090         }
00091         free(argv);
00092     }
00093
00094     argc = 0;
00095     argv = NULL;
00096
00097     if(defargs)
00098     {
00099         int numargs = 1;
00100
00101         if(gCvsPrefs.Z9Option())
00102             numargs++;
00103         if(gCvsPrefs.QuietOption())
00104             numargs++;
00105         if(gCvsPrefs.EncryptCommunication() && gAuthen.kind() == gserver)
00106             numargs++;
00107         if(gCvsPrefs.AlwaysUseCvsroot())
00108             numargs += 2;
00109
00110         argv = (char **)malloc(numargs * sizeof(char *));
00111         argv[argc++] = mystrdup("cvs");
00112         if(gCvsPrefs.AlwaysUseCvsroot())
00113         {
00114             argv[argc++] = mystrdup("-d");
00115             CStr root;
00116             const char *ccvsroot = gCvsPrefs;
00117             ccvsroot = Authen::skiptoken(ccvsroot);
00118             root = gAuthen.token();
00119             root << ccvsroot;
00120             argv[argc++] = mystrdup(root);
00121         }
00122         if(gCvsPrefs.Z9Option())
00123         {
00124             CStr zlev("-z");
00125             zlev << gCvsPrefs.ZLevel();
00126             argv[argc++] = mystrdup(zlev);
00127         }
00128         if(gCvsPrefs.QuietOption())
00129             argv[argc++] = mystrdup("-q");
00130         if(gCvsPrefs.EncryptCommunication() && gAuthen.kind() == gserver)
00131             argv[argc++] = mystrdup("-x");
00132     }
00133 }

Member Data Documentation

int CvsArgs::argc [protected]

Definition at line 54 of file CvsArgs.h.

Referenced by add, Argc, CvsArgs, print, and reset.

char** CvsArgs::argv [protected]

Definition at line 53 of file CvsArgs.h.

Referenced by add, Argv, CvsArgs, print, and reset.

The documentation for this class was generated from the following files:
  • common/CvsArgs.h
  • common/CvsArgs.cpp
Generated on Sun Feb 24 01:28:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsCoworker Class Reference

#include <CvsCoworker.h>

Inheritance diagram for CvsCoworker:

[legend]
Collaboration diagram for CvsCoworker:

[legend]
List of all members.

Public Methods

CvsCoworker ()
HRESULT | InterfaceSupportsErrorInfo (REFIID riid)
HRESULT | GetErrorMessage (int handle, int iError, int cbErrorBuffer, unsigned char *sError)
HRESULT | GetLastError (int handle, int *piError)
HRESULT | OpenProject (int *pHandle, const unsigned char *sUsername, const unsigned char *sProjectName, const unsigned char *sProjectHome)
HRESULT | GetProject (int *pHandle, const unsigned char *sUsername, int cbProjectNameBuffer, unsigned char *sProjectName, int cbProjectHomeBuffer, unsigned char *sProjectHome, BOOL bAllowPathChange, BOOL bAllowNewProject, BOOL *pbNewProject)
HRESULT | CloseProject (int handle)
HRESULT | UpdateFiles (int handle, const unsigned char *sFilenames, BOOL bDirectories, BOOL bRecurse)
HRESULT | CheckoutFiles (int handle, const unsigned char *sFilenames)
HRESULT | CheckinFiles (int handle, const unsigned char *sFilenames, BOOL bKeepCheckedOut)
HRESULT | UncheckoutFiles (int handle, const unsigned char *sFilenames)
HRESULT | AddFiles (int handle, const unsigned char *sOptionsAndFilenames, const unsigned char *sComment)
HRESULT | RemoveFiles (int handle, const unsigned char *sFilenames)
HRESULT | RenameFile (int handle, const unsigned char *sOldFilename, const unsigned char *sNewFilename)
HRESULT | DiffFile (int handle, const unsigned char *sFilename, BOOL bIgnoreCase, BOOL bIgnoreWhitespace)
HRESULT | ShowFileHistory (int handle, const unsigned char *sFilenames)
HRESULT | ShowFileProperties (int handle, const unsigned char *sFilename)
HRESULT | ShowUserInterface (int handle, const unsigned char *sFilenames)
HRESULT | HasAdvancedOptionsForCommand (int handle, CvsCommand command, BOOL *pbAdvancedOptions)
HRESULT | ShowAdvancedOptionsForCommand (int handle, CvsCommand command)
HRESULT | GetFileChanges (int handle, int cbFilenameBuffer, unsigned char *sFilenameBuffer)
HRESULT | GetFilesToAdd (int handle, int cbFilenamesBuffer, unsigned char *sFilenamesBuffer)

Constructor & Destructor Documentation

CvsCoworker::CvsCoworker ( ) [inline]

Definition at line 17 of file CvsCoworker.h.

References qTRACE_FN.

00018     {
00019         qTRACE_FN(CvsCoworker);
00020     }

Member Function Documentation

STDMETHODIMP CvsCoworker::AddFiles | ( | int | handle,
 |  | const unsigned char * | sOptionsAndFilenames,
 |  | const unsigned char * | sComment
 | ) |

Definition at line 312 of file CvsCoworker.cpp.

References AddFiles, ASSERT, CATCH_EXCEPTIONS, CVS_E_FAILED, LOG_API_FN, LOG_API_N, LOG_API_S, and PREAMBLE.

Referenced by AddFiles.

00317 {
00318     LOG_API_FN(AddFiles);
00319     LOG_API_S(sOptionsAndFilenames);
00320     LOG_API_S(sComment);
00321     ASSERT(sOptionsAndFilenames);
00322     PREAMBLE(handle);
00323     try {
00324         bool bOK = pProject->addFiles(
00325             CvsFilenames(sOptionsAndFilenames),
00326             (const char*)sComment
00327             );
00328         LOG_API_N(bOK);
00329         if (!bOK) {
00330             return CVS_E_FAILED;
00331         }
00332         return S_OK;
00333     }
00334     CATCH_EXCEPTIONS(AddFiles);
00335 }

STDMETHODIMP CvsCoworker::CheckinFiles | ( | int | handle,
 |  | const unsigned char * | sFilenames,
 |  | BOOL | bKeepCheckedOut
 | ) |

Definition at line 265 of file CvsCoworker.cpp.

References ASSERT, CATCH_EXCEPTIONS, CheckinFiles, CVS_E_FAILED, LOG_API_FN, LOG_API_N, LOG_API_S, and PREAMBLE.

Referenced by CheckinFiles.

00270 {
00271     LOG_API_FN(CheckinFiles);
00272     LOG_API_S(sFilenames);
00273     LOG_API_N(bKeepCheckedOut);
00274     ASSERT(sFilenames);
00275     PREAMBLE(handle);
00276     try {
00277         bool bOK = pProject->checkinFiles(
00278             CvsFilenames(sFilenames),
00279             bKeepCheckedOut
00280             );
00281         LOG_API_N(bOK);
00282         if (!bOK) {
00283             return CVS_E_FAILED;
00284         }
00285         return S_OK;
00286     }
00287     CATCH_EXCEPTIONS(CheckinFiles);
00288 }

STDMETHODIMP CvsCoworker::CheckoutFiles | ( | int | handle,
 |  | const unsigned char * | sFilenames
 | ) |

Definition at line 243 of file CvsCoworker.cpp.

References ASSERT, CATCH_EXCEPTIONS, CheckoutFiles, CVS_E_FAILED, LOG_API_FN, LOG_API_N, LOG_API_S, and PREAMBLE.

Referenced by CheckoutFiles.

00247 {
00248     LOG_API_FN(CheckoutFiles);
00249     LOG_API_S(sFilenames);
00250     ASSERT(sFilenames);
00251     PREAMBLE(handle);
00252     try {
00253         bool bOK = pProject->checkoutFiles(
00254             CvsFilenames(sFilenames)
00255             );
00256         LOG_API_N(bOK);
00257         if (!bOK) {
00258             return CVS_E_FAILED;
00259         }
00260         return S_OK;
00261     }
00262     CATCH_EXCEPTIONS(CheckoutFiles);
00263 }

STDMETHODIMP CvsCoworker::CloseProject ( int handle )

Definition at line 198 of file CvsCoworker.cpp.

References CATCH_EXCEPTIONS, CloseProject, CVS_E_FAILED_CLOSE_PROJECT, LOG_API_FN, LOG_API_N, and PREAMBLE.

Referenced by CloseProject.

00201 {
00202     LOG_API_FN(CloseProject);
00203     PREAMBLE(handle);
00204     try {
00205         bool bOK = pProject->closeProject();
00206         LOG_API_N(bOK);
00207         if (!bOK) {
00208             return CVS_E_FAILED_CLOSE_PROJECT;
00209         }
00210         return S_OK;
00211     }
00212     CATCH_EXCEPTIONS(CloseProject);
00213 }

STDMETHODIMP CvsCoworker::DiffFile | ( | int | handle,
 |  | const unsigned char * | sFilename,
 |  | BOOL | bIgnoreCase,
 |  | BOOL | bIgnoreWhitespace
 | ) |

Definition at line 385 of file CvsCoworker.cpp.

References ASSERT, CATCH_EXCEPTIONS, CVS_E_FAILED, DiffFile, LOG_API_FN, LOG_API_N, LOG_API_S, and PREAMBLE.

Referenced by DiffFile.

00391 {
00392     LOG_API_FN(DiffFiles);
00393     LOG_API_S(sFilename);
00394     LOG_API_N(bIgnoreCase);
00395     LOG_API_N(bIgnoreWhitespace);
00396     ASSERT(sFilename);
00397     PREAMBLE(handle);
00398     try {
00399         bool bOK = pProject->diffFile(
00400             (const char*)sFilename,
00401             bIgnoreCase,
00402             bIgnoreWhitespace
00403             );
00404         LOG_API_N(bOK);
00405         if (!bOK) {
00406             return CVS_E_FAILED;
00407         }
00408         return S_OK;
00409     }
00410     CATCH_EXCEPTIONS(DiffFile);
00411 }

STDMETHODIMP CvsCoworker::GetErrorMessage | ( | int | handle,
 |  | int | iError,
 |  | int | cbErrorBuffer,
 |  | unsigned char * | sError
 | ) |

Definition at line 81 of file CvsCoworker.cpp.

References ASSERT, CopyString, CVS_E_FAILED_PROJECT_INVALID, CvsProject::FindProject, CvsProject::getErrorMessage, GetErrorMessage, LOG_API_FN, LOG_API_N, and LOG_API_S.

Referenced by GetErrorMessage.

00087 {
00088     LOG_API_FN(GetErrorMessage);
00089     LOG_API_N(iError);
00090     ASSERT(sErrorBuffer);
00091     ASSERT(0 < cbErrorBuffer);
00092     if (sErrorBuffer) {
00093         *sErrorBuffer = 0;
00094     }
00095     CvsProject* pProject = CvsProject::FindProject(handle);
00096     if (!pProject) {
00097         return CVS_E_FAILED_PROJECT_INVALID;
00098     }
00099     CvsString sError;
00100     if (!pProject->getErrorMessage(iError,sError)) {
00101         return S_FALSE;
00102     }
00103     CopyString(sErrorBuffer,sError,cbErrorBuffer);
00104     LOG_API_S(sErrorBuffer);
00105     return S_OK;
00106 }

STDMETHODIMP CvsCoworker::GetFileChanges | ( | int | handle,
 |  | int | cbFilenameBuffer,
 |  | unsigned char * | sFilenameBuffer
 | ) |

Definition at line 525 of file CvsCoworker.cpp.

References ASSERT, CATCH_EXCEPTIONS, CopyString, CVS_E_FAILED, GetFileChanges, LOG_API_FN, LOG_API_N, LOG_API_S, and PREAMBLE.

Referenced by GetFileChanges.

00530 {
00531     LOG_API_FN(GetFileChanges);
00532     ASSERT(0<cbFilenameBuffer);
00533     ASSERT(sFilenameBuffer);
00534     PREAMBLE(handle);
00535     CvsString sFilename;
00536     try {
00537         bool bOK = pProject->getFileChanges(
00538             sFilename
00539             );
00540         CopyString(sFilenameBuffer,sFilename,cbFilenameBuffer);
00541         LOG_API_N(bOK);
00542         LOG_API_S(sFilenameBuffer);
00543         if (!bOK) {
00544             return CVS_E_FAILED;
00545         }
00546         return S_OK;
00547     }
00548     CATCH_EXCEPTIONS(GetFileChanges);
00549 }

STDMETHODIMP CvsCoworker::GetFilesToAdd | ( | int | handle,
 |  | int | cbFilenamesBuffer,
 |  | unsigned char * | sFilenamesBuffer
 | ) |

Definition at line 551 of file CvsCoworker.cpp.

References ASSERT, CATCH_EXCEPTIONS, CopyString, CVS_E_FAILED, GetFilesToAdd, LOG_API_FN, LOG_API_N, LOG_API_S, and PREAMBLE.

Referenced by GetFilesToAdd.

00556 {
00557     LOG_API_FN(GetFilesToAdd);
00558     ASSERT(0<cbFilenamesBuffer);
00559     ASSERT(sFilenamesBuffer);
00560     PREAMBLE(handle);
00561     CvsString sFilenames;
00562     try {
00563         bool bOK = pProject->getFilesToAdd(
00564             sFilenames
00565             );
00566         CopyString(sFilenamesBuffer,sFilenames,cbFilenamesBuffer);
00567         LOG_API_N(bOK);
00568         LOG_API_S(sFilenamesBuffer);
00569         if (!bOK) {
00570             return CVS_E_FAILED;
00571         }
00572         return S_OK;
00573     }
00574     CATCH_EXCEPTIONS(GetFilesToAdd);
00575 }

STDMETHODIMP CvsCoworker::GetLastError | ( | int | handle,
 |  | int * | piError
 | ) |

Definition at line 66 of file CvsCoworker.cpp.

References ASSERT, CVS_E_FAILED_PROJECT_INVALID, CvsProject::FindProject, and CvsProject::getLastError.

00070 {
00071     ASSERT(piError);
00072     *piError = 0;
00073     CvsProject* pProject = CvsProject::FindProject(handle);
00074     if (!pProject) {
00075         return CVS_E_FAILED_PROJECT_INVALID;
00076     }
00077     *piError = pProject->getLastError();
00078     return S_OK;
00079 }

STDMETHODIMP CvsCoworker::GetProject | ( | int * | pHandle,
 |  | const unsigned char * | sUsername,
 |  | int | cbProjectNameBuffer,
 |  | unsigned char * | sProjectName,
 |  | int | cbProjectHomeBuffer,
 |  | unsigned char * | sProjectHome,
 |  | BOOL | bAllowPathChange,
 |  | BOOL | bAllowNewProject,
 |  | BOOL * | pbNewProject
 | ) |

Definition at line 108 of file CvsCoworker.cpp.

References ASSERT, CATCH_EXCEPTIONS, CopyString, CVS_E_FAILED_OPEN_PROJECT, CvsProject::getProject, GetProject, CvsProject::getProjectHandle, CvsProject::getProjectHome, CvsProject::getProjectName, LOG_API_FN, LOG_API_N, and LOG_API_S.

Referenced by GetProject.

00119 {
00120     LOG_API_FN(GetProject);
00121     LOG_API_S(sUsername);
00122     LOG_API_S(sProjectNameBuffer);
00123     LOG_API_S(sProjectHomeBuffer);
00124     LOG_API_N(bAllowPathChange);
00125     LOG_API_N(bAllowNewProject);
00126     ASSERT(pHandle);
00127     ASSERT(sUsername);
00128     ASSERT(0 < cbProjectNameBuffer);
00129     ASSERT(sProjectNameBuffer);
00130     ASSERT(0 < cbProjectHomeBuffer);
00131     ASSERT(sProjectHomeBuffer);
00132     ASSERT(pbNewProject);
00133     try {
00134         *pHandle = 0;
00135         *pbNewProject = false;
00136         CvsProject* pProject = new CvsProject;
00137         *pHandle = pProject->getProjectHandle();
00138         bool bOK = pProject->getProject(
00139             (char*)sUsername,
00140             (char*)sProjectNameBuffer,
00141             (char*)sProjectHomeBuffer,
00142             bAllowPathChange,
00143             bAllowNewProject,
00144             *pbNewProject
00145             );
00146         CopyString(sProjectNameBuffer,pProject->getProjectName(),cbProjectNameBuffer);
00147         CopyString(sProjectHomeBuffer,pProject->getProjectHome(),cbProjectHomeBuffer);
00148         LOG_API_N(bOK);
00149         LOG_API_S(sProjectNameBuffer);
00150         LOG_API_S(sProjectHomeBuffer);
00151         if (!bOK) {
00152             return CVS_E_FAILED_OPEN_PROJECT;
00153         }
00154         return S_OK;
00155     }
00156     CATCH_EXCEPTIONS(GetProject);
00157 }

STDMETHODIMP CvsCoworker::HasAdvancedOptionsForCommand | ( | int | handle,
 |  | CvsCommand | command,
 |  | BOOL * | pbAdvancedOptions
 | ) |

Definition at line 479 of file CvsCoworker.cpp.

References ASSERT, CATCH_EXCEPTIONS, CVS_E_FAILED, HasAdvancedOptionsForCommand, LOG_API_FN, LOG_API_N, and PREAMBLE.

Referenced by HasAdvancedOptionsForCommand.

00484 {
00485     LOG_API_FN(HasAdvancedOptionsForCommand);
00486     LOG_API_N(command);
00487     ASSERT(pbAdvancedOptions);
00488     PREAMBLE(handle);
00489     try {
00490         bool bOK = pProject->hasAdvancedOptionsForCommand(
00491             command,
00492             *pbAdvancedOptions
00493             );
00494         LOG_API_N(bOK);
00495         LOG_API_N(*pbAdvancedOptions);
00496         if (!bOK) {
00497             return CVS_E_FAILED;
00498         }
00499         return S_OK;
00500     }
00501     CATCH_EXCEPTIONS(HasAdvancedOptionsForCommand);
00502 }

STDMETHODIMP CvsCoworker::InterfaceSupportsErrorInfo ( REFIID riid )

Definition at line 51 of file CvsCoworker.cpp.

References InterfaceSupportsErrorInfo, and qTRACE_FN.

Referenced by InterfaceSupportsErrorInfo.

00052 {
00053     qTRACE_FN(CvsCoworker::InterfaceSupportsErrorInfo);
00054     static const IID* arr[] = {
00055         &IID_ICvsCoworker,
00056         0
00057     };
00058     for (int i=0; arr[i]; ++i) {
00059         if (::ATL::InlineIsEqualGUID(*arr[i],riid)) {   //Jerzy[6/13/2001] - fix according to Q243298 at MSDN
00060             return S_OK;
00061         }
00062     }
00063     return S_FALSE;
00064 }

STDMETHODIMP CvsCoworker::OpenProject | ( | int * | pHandle,
 |  | const unsigned char * | sUsername,
 |  | const unsigned char * | sProjectName,
 |  | const unsigned char * | sProjectHome
 | ) |

Definition at line 159 of file CvsCoworker.cpp.

References ASSERT, CATCH_EXCEPTIONS, CVS_E_FAILED_OPEN_PROJECT, CvsProject::getProjectHandle, LOG_API_FN, LOG_API_N, LOG_API_S, CvsProject::openProject, and OpenProject.

Referenced by OpenProject.

00165 {
00166     LOG_API_FN(OpenProject);
00167     LOG_API_S(sUsername);
00168     LOG_API_S(sProjectName);
00169     LOG_API_S(sProjectHome);
00170     ASSERT(pHandle);
00171     ASSERT(sUsername);
00172     ASSERT(sProjectName);
00173     ASSERT(sProjectHome);
00174     try {
00175         *pHandle = 0;
00176         CvsProject* pProject = new CvsProject;
00177         *pHandle = pProject->getProjectHandle();
00178         bool bOK = pProject->openProject(
00179             (const char*)sUsername,
00180             (const char*)sProjectName,
00181             (const char*)sProjectHome
00182             );
00183         LOG_API_N(bOK);
00184         if (!bOK) {
00185             return CVS_E_FAILED_OPEN_PROJECT;
00186         }
00187         return S_OK;
00188     }
00189     CATCH_EXCEPTIONS(OpenProject);
00190 }

STDMETHODIMP CvsCoworker::RemoveFiles | ( | int | handle,
 |  | const unsigned char * | sFilenames
 | ) |

Definition at line 337 of file CvsCoworker.cpp.

References ASSERT, CATCH_EXCEPTIONS, CVS_E_FAILED, LOG_API_FN, LOG_API_N, LOG_API_S, PREAMBLE, and RemoveFiles.

Referenced by RemoveFiles.

00341 {
00342     LOG_API_FN(RemoveFiles);
00343     LOG_API_S(sFilenames);
00344     ASSERT(sFilenames);
00345     PREAMBLE(handle);
00346     try {
00347         bool bOK = pProject->removeFiles(
00348             CvsFilenames(sFilenames)
00349             );
00350         LOG_API_N(bOK);
00351         if (!bOK) {
00352             return CVS_E_FAILED;
00353         }
00354         return S_OK;
00355     }
00356     CATCH_EXCEPTIONS(RemoveFiles);
00357 }

STDMETHODIMP CvsCoworker::RenameFile | ( | int | handle,
 |  | const unsigned char * | sOldFilename,
 |  | const unsigned char * | sNewFilename
 | ) |

Definition at line 359 of file CvsCoworker.cpp.

References ASSERT, CATCH_EXCEPTIONS, CVS_E_FAILED, LOG_API_FN, LOG_API_N, LOG_API_S, PREAMBLE, and RenameFile.

Referenced by RenameFile.

00364 {
00365     LOG_API_FN(RenameFiles);
00366     LOG_API_S(sOldFilename);
00367     LOG_API_S(sNewFilename);
00368     ASSERT(sOldFilename);
00369     ASSERT(sNewFilename);
00370     PREAMBLE(handle);
00371     try {
00372         bool bOK = pProject->renameFile(
00373             (const char*)sOldFilename,
00374             (const char*)sNewFilename
00375             );
00376         LOG_API_N(bOK);
00377         if (!bOK) {
00378             return CVS_E_FAILED;
00379         }
00380         return S_OK;
00381     }
00382     CATCH_EXCEPTIONS(RenameFile);
00383 }

STDMETHODIMP CvsCoworker::ShowAdvancedOptionsForCommand | ( | int | handle,
 |  | CvsCommand | command
 | ) |

Definition at line 504 of file CvsCoworker.cpp.

References CATCH_EXCEPTIONS, CVS_E_FAILED, LOG_API_FN, LOG_API_N, PREAMBLE, and ShowAdvancedOptionsForCommand.

Referenced by ShowAdvancedOptionsForCommand.

00508 {
00509     LOG_API_FN(ShowAdvancedOptionsForCommand);
00510     LOG_API_N(command);
00511     PREAMBLE(handle);
00512     try {
00513         bool bOK = pProject->showAdvancedOptionsForCommand(
00514             command
00515             );
00516         LOG_API_N(bOK);
00517         if (!bOK) {
00518             return CVS_E_FAILED;
00519         }
00520         return S_OK;
00521     }
00522     CATCH_EXCEPTIONS(ShowAdvancedOptionsForCommand);
00523 }

STDMETHODIMP CvsCoworker::ShowFileHistory | ( | int | handle,
 |  | const unsigned char * | sFilenames
 | ) |

Definition at line 413 of file CvsCoworker.cpp.

References ASSERT, CATCH_EXCEPTIONS, CVS_E_FAILED, LOG_API_FN, LOG_API_N, LOG_API_S, PREAMBLE, and ShowFileHistory.

Referenced by ShowFileHistory.

00417 {
00418     LOG_API_FN(ShowFileHistory);
00419     LOG_API_S(sFilenames);
00420     ASSERT(sFilenames);
00421     PREAMBLE(handle);
00422     try {
00423         bool bOK = pProject->showFileHistory(
00424             CvsFilenames(sFilenames)
00425             );
00426         LOG_API_N(bOK);
00427         if (!bOK) {
00428             return CVS_E_FAILED;
00429         }
00430         return S_OK;
00431     }
00432     CATCH_EXCEPTIONS(ShowFileHistory);
00433 }

STDMETHODIMP CvsCoworker::ShowFileProperties | ( | int | handle,
 |  | const unsigned char * | sFilename
 | ) |

Definition at line 435 of file CvsCoworker.cpp.

References ASSERT, CATCH_EXCEPTIONS, CVS_E_FAILED, LOG_API_FN, LOG_API_N, LOG_API_S, PREAMBLE, and ShowFileProperties.

Referenced by ShowFileProperties.

00439 {
00440     LOG_API_FN(ShowFileProperties);
00441     LOG_API_S(sFilename);
00442     ASSERT(sFilename);
00443     PREAMBLE(handle);
00444     try {
00445         bool bOK = pProject->showFileProperties(
00446             (const char*)sFilename
00447             );
00448         LOG_API_N(bOK);
00449         if (!bOK) {
00450             return CVS_E_FAILED;
00451         }
00452         return S_OK;
00453     }
00454     CATCH_EXCEPTIONS(ShowFileProperties);
00455 }

STDMETHODIMP CvsCoworker::ShowUserInterface | ( | int | handle,
 |  | const unsigned char * | sFilenames
 | ) |

Definition at line 457 of file CvsCoworker.cpp.

References ASSERT, CATCH_EXCEPTIONS, CVS_E_FAILED, LOG_API_FN, LOG_API_N, LOG_API_S, PREAMBLE, and ShowUserInterface.

Referenced by ShowUserInterface.

00461 {
00462     LOG_API_FN(ShowUserInterface);
00463     LOG_API_S(sFilenames);
00464     ASSERT(sFilenames);
00465     PREAMBLE(handle);
00466     try {
00467         bool bOK = pProject->showUserInterface(
00468             CvsFilenames(sFilenames)
00469             );
00470         LOG_API_N(bOK);
00471         if (!bOK) {
00472             return CVS_E_FAILED;
00473         }
00474         return S_OK;
00475     }
00476     CATCH_EXCEPTIONS(ShowUserInterface);
00477 }

STDMETHODIMP CvsCoworker::UncheckoutFiles | ( | int | handle,
 |  | const unsigned char * | sFilenames
 | ) |

Definition at line 290 of file CvsCoworker.cpp.

References ASSERT, CATCH_EXCEPTIONS, CVS_E_FAILED, LOG_API_FN, LOG_API_N, LOG_API_S, PREAMBLE, and UncheckoutFiles.

Referenced by UncheckoutFiles.

00294 {
00295     LOG_API_FN(UncheckoutFiles);
00296     LOG_API_S(sFilenames);
00297     ASSERT(sFilenames);
00298     PREAMBLE(handle);
00299     try {
00300         bool bOK = pProject->uncheckoutFiles(
00301             CvsFilenames(sFilenames)
00302             );
00303         LOG_API_N(bOK);
00304         if (!bOK) {
00305             return CVS_E_FAILED;
00306         }
00307         return S_OK;
00308     }
00309     CATCH_EXCEPTIONS(UncheckoutFiles);
00310 }

STDMETHODIMP CvsCoworker::UpdateFiles | ( | int | handle,
 |  | const unsigned char * | sFilenames,
 |  | BOOL | bDirectories,
 |  | BOOL | bRecurse
 | ) |

Definition at line 215 of file CvsCoworker.cpp.

References ASSERT, CATCH_EXCEPTIONS, CVS_E_FAILED, LOG_API_FN, LOG_API_N, LOG_API_S, PREAMBLE, and UpdateFiles.

Referenced by UpdateFiles.

00221 {
00222     LOG_API_FN(UpdateFiles);
00223     LOG_API_S(sFilenames);
00224     LOG_API_N(bDirectories);
00225     LOG_API_N(bRecurse);
00226     ASSERT(sFilenames);
00227     PREAMBLE(handle);
00228     try {
00229         bool bOK = pProject->updateFiles(
00230             CvsFilenames(sFilenames),
00231             bDirectories,
00232             bRecurse
00233             );
00234         LOG_API_N(bOK);
00235         if (!bOK) {
00236             return CVS_E_FAILED;
00237         }
00238         return S_OK;
00239     }
00240     CATCH_EXCEPTIONS(UpdateFiles);
00241 }

The documentation for this class was generated from the following files:
  • WinCvs/CoWorker/CvsCoworker.h
  • WinCvs/CoWorker/CvsCoworker.cpp
Generated on Sun Feb 24 01:28:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsFilenames Class Reference

#include <CvsFilenames.h>

Collaboration diagram for CvsFilenames:

[legend]
List of all members.

Public Methods

CvsFilenames (const unsigned char *)
~CvsFilenames ()
bool | getOptionsAndFilename (int i, CvsString &, CvsString &)
const char * | getFilename (int)
int | getNumberOfFilenames ()

Protected Attributes

CvsString m_sBuffer
int | m_nFilenames
int * | m_arrayOffsetName

Constructor & Destructor Documentation

CvsFilenames::CvsFilenames ( const unsigned char * )

Definition at line 13 of file CvsFilenames.cpp.

References ASSERT, CvsString::getBuffer, m_arrayOffsetName, m_sBuffer, qTRACE, and qTRACE_FN.

00014 :   m_sBuffer((const char*)sFilenames),
00015     m_nFilenames(0),
00016     m_arrayOffsetName(0)
00017 {
00018     qTRACE_FN(CvsFilenames);
00019     qTRACE(("* strlen(sFilenames) = %d",strlen((const char*)sFilenames)));
00020
00021     char* sBase = m_sBuffer.getBuffer();
00022
00023     // count \n separators
00024     int nNames = 0;
00025     char* sName = sBase;
00026     for (;;) {
00027         char* s = strchr(sName,'\n');
00028         if (!s) break;
00029         ++nNames;
00030         sName = s + 1;
00031     }
00032
00033     qTRACE(("* found %d names",nNames));
00034
00035     // set name offsets and replace \n with \0
00036     m_arrayOffsetName = new int[nNames];
00037     int iName = 0;
00038     sName = sBase;
00039     for (;;) {
00040         char* s = strchr(sName,'\n');
00041         if (!s) break;
00042         m_arrayOffsetName[iName++] = (int)(sName - sBase);
00043         *s++ = 0;
00044         sName = s;
00045     }
00046     ASSERT(iName == nNames);
00047     ASSERT((0 == iName) || !*sName);
00048 }

CvsFilenames::~CvsFilenames ( )

Definition at line 50 of file CvsFilenames.cpp.

References m_arrayOffsetName.

00051 {
00052     delete [] m_arrayOffsetName;
00053 }

Member Function Documentation

const char * CvsFilenames::getFilename ( int )

Definition at line 59 of file CvsFilenames.cpp.

References ASSERT, CvsString::getBufferMax, m_arrayOffsetName, m_nFilenames, and m_sBuffer.

00060 {
00061     if ((i < 0) || (m_nFilenames <= i)) return "";
00062     int iOffset = m_arrayOffsetName[i];
00063     ASSERT(0 <= iOffset);
00064     ASSERT(iOffset < m_sBuffer.getBufferMax());
00065     const char* p = m_sBuffer;
00066     return p + iOffset;
00067 }

int CvsFilenames::getNumberOfFilenames ( ) [inline]

Definition at line 22 of file CvsFilenames.h.

References m_nFilenames.

00022 { return m_nFilenames; }

bool CvsFilenames::getOptionsAndFilename | ( | int | i,
 |  | CvsString & | ,
 |  | CvsString & |
 | ) |

Definition at line 73 of file CvsFilenames.cpp.

References ASSERT, CvsString::getBufferMax, m_arrayOffsetName, m_nFilenames, m_sBuffer, CvsString::strcpy, and CvsString::strncpy.

00074 {
00075     if ((i < 0) || (m_nFilenames <= i)) {
00076         sOptions.strcpy("");
00077         sFilename.strcpy("");
00078         return false;
00079     }
00080     int iOffset = m_arrayOffsetName[i];
00081     ASSERT(0 <= iOffset);
00082     ASSERT(iOffset < m_sBuffer.getBufferMax());
00083     const char* pBase = m_sBuffer + iOffset;
00084     const char* pTab  = strchr(pBase,'\t');
00085     if (pTab) {
00086         sOptions.strncpy(pBase,(int)(pTab - pBase));
00087         sFilename.strcpy(pTab+1);
00088     } else {
00089         sOptions.strcpy("");
00090         sFilename.strcpy(pBase);
00091     }
00092     return true;
00093 }

Member Data Documentation

int* CvsFilenames::m_arrayOffsetName [protected]

Definition at line 26 of file CvsFilenames.h.

Referenced by CvsFilenames, getFilename, getOptionsAndFilename, and ~CvsFilenames.

int CvsFilenames::m_nFilenames [protected]

Definition at line 25 of file CvsFilenames.h.

Referenced by getFilename, getNumberOfFilenames, and getOptionsAndFilename.

CvsString CvsFilenames::m_sBuffer [protected]

Definition at line 24 of file CvsFilenames.h.

Referenced by CvsFilenames, getFilename, and getOptionsAndFilename.

The documentation for this class was generated from the following files:
  • WinCvs/CoWorker/CvsFilenames.h
  • WinCvs/CoWorker/CvsFilenames.cpp
Generated on Sun Feb 24 01:28:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsPrefs Class Reference

#include <CvsPrefs.h>

Collaboration diagram for CvsPrefs:

[legend]
List of all members.

Public Methods

CvsPrefs ()
~CvsPrefs ()
bool | empty (void) const
int | length (void) const
const char * | operator= (const char *newstr)
const unsigned char * | operator= (const unsigned char *newstr)
operator const char * () const
operator const unsigned char * () const
bool | CheckoutRO (void) const
bool | Z9Option (void) const
bool | PruneOption (void) const
bool | QuietOption (void) const
ISO8559 | IsoConvert (void) const
bool | ICTextOption (void) const
bool | AddControl (void) const
bool | UseViewerAlways (void) const
MACENCODING | MacBinEncoding (void) const
int | KserverPort (void) const
int | PserverPort (void) const
int | RhostPort (void) const
const char * | ServerName (void) const
const char * | RshName (void) const
bool | EncryptCommunication (void) const
const char * | Home (void) const
const char * | Viewer (void) const
const char * | ExtDiff (void) const
const char * | Helper (void) const
const char * | Browser (void) const
bool | DirtySupport (void) const
int | LogoutTimeOut (void) const
bool | AlwaysUseCvsroot (void) const
bool | UseProxy (void) const
const char * | ProxyHost (void) const
int | ProxyPort (void) const
bool | UnixLF (void) const
bool | MacLF (void) const
int | ZLevel (void) const
int | CvsVersion (void) const
bool | CvsConsole (void) const
int | WordWrapLogMsg (void) const
const char * | LastWorkingDir (void) const
bool | UseKeyChain (void) const
bool | HideCommandDlgUpdate (void) const
bool | HideCommandDlgDiff (void) const
bool | HideCommandDlgLog (void) const
bool | HideCommandDlgGraph (void) const
bool | HideCommandDlgAnnotate (void) const
bool | HideCommandDlgUseShift (void) const
SHELL_KIND | GetUseShell (void) const
void | SetCheckoutRO (bool newState)
void | SetZ9Option (bool newState)
void | SetPruneOption (bool newState)
void | SetQuietOption (bool newState)
void | SetIsoConvert (ISO8559 newState)
void | SetICTextOption (bool newState)
void | SetAddControl (bool newState)
void | SetUseViewerAlways (bool newState)
void | SetMacBinEncoding (MACENCODING newState)
void | SetKserverPort (int newState)
void | SetPserverPort (int newState)
void | SetRhostPort (int newState)
void | SetServerName (const char *newservername)
void | SetRshName (const char *newrshname)
void | SetEncryptCommunication (bool newState)
void | SetHome (const char *newhome)
void | SetViewer (const char *newviewer)
void | SetExtDiff (const char *newdiff)
void | SetHelper (const char *newhelper)
void | SetBrowser (const char *newbrowser)
void | SetDirtySupport (bool newState)
void | SetLogoutTimeOut (int newTimeout)
void | SetAlwaysUseCvsroot (bool newState)
void | SetUseProxy (bool useit)
void | SetProxyHost (const char *newhost)
void | SetProxyPort (int newport)
void | SetUnixLF (bool useit)
void | SetMacLF (bool useit)
void | SetZLevel (int level)
void | SetCvsVersion (int version)
void | SetCvsConsole (bool console)
void | SetWordWrapLogMsg (int wordwrap)
void | SetLastWorkingDir (const char *workdir)
void | SetHideCommandDlgUpdate (bool newState)
void | SetHideCommandDlgDiff (bool newState)
void | SetHideCommandDlgLog (bool newState)
void | SetHideCommandDlgGraph (bool newState)
void | SetHideCommandDlgAnnotate (bool newState)
void | SetHideCommandDlgUseShift (bool newState)
void | SetUseShell (SHELL_KIND shell)
kWinVersion WhichVersion ()
bool | UseAltCvs (void) const
void | SetUseAltCvs (bool useit)
const char * | WhichCvs (UStr &path, bool userOnly=false) const
void | SetWhichCvs (const char *cvsPath)
bool | HasLoogedIn (void) const
void | SetHasLoogedIn (bool newstate)
bool | IsCvsRunning (void) const
int | SetCvsRunning (bool launched)
bool | IsTclFileRunning (void) const
int | SetTclFileRunning (bool launched)
void | save (void)
void | load (void)

Protected Attributes

bool | fHasLoggedIn
int | fCvsRunningCounter
int | fTclFileRunningCounter

Constructor & Destructor Documentation

CvsPrefs::CvsPrefs ( ) [inline]

Definition at line 102 of file CvsPrefs.h.

References fCvsRunningCounter, fHasLoggedIn, and fTclFileRunningCounter.

00102                       : fHasLoggedIn(false),
00103         fCvsRunningCounter(0), fTclFileRunningCounter(0) {}

CvsPrefs::~CvsPrefs ( ) [inline]

Definition at line 104 of file CvsPrefs.h.

00104 {}

Member Function Documentation

bool CvsPrefs::AddControl ( void ) const

Definition at line 180 of file CvsPrefs.cpp.

00180 {return gAddBinControl;}

bool CvsPrefs::AlwaysUseCvsroot ( void ) const

Definition at line 244 of file CvsPrefs.cpp.

00244 {return gAlwaysUseCvsroot;}

const char * CvsPrefs::Browser ( void ) const

Definition at line 234 of file CvsPrefs.cpp.

References UStr::empty.

00235 {
00236     return gBrowser.empty() ? 0L : (const char *)gBrowser;
00237 }

bool CvsPrefs::CheckoutRO ( void ) const

Definition at line 167 of file CvsPrefs.cpp.

00167 {return gCheckoutRO;}

bool CvsPrefs::CvsConsole ( void ) const

Definition at line 252 of file CvsPrefs.cpp.

00252 {return gCvsConsole;}

int CvsPrefs::CvsVersion ( void ) const

Definition at line 251 of file CvsPrefs.cpp.

00251 {return gCvsVersion;}

bool CvsPrefs::DirtySupport ( void ) const

Definition at line 242 of file CvsPrefs.cpp.

00242 {return gDirtySupport;}

bool CvsPrefs::empty ( void ) const

Definition at line 325 of file CvsPrefs.cpp.

References UPStr::empty.

Referenced by save.

00325 {   return gCvsroot.empty();  }

bool CvsPrefs::EncryptCommunication ( void ) const

Definition at line 195 of file CvsPrefs.cpp.

00195 {return gEncryptCommunication;}

const char * CvsPrefs::ExtDiff ( void ) const

Definition at line 238 of file CvsPrefs.cpp.

References UStr::empty.

Referenced by LaunchDiff.

00239 {
00240     return gExtdiff.empty() ? 0L : (const char *)gExtdiff;
00241 }

SHELL_KIND CvsPrefs::GetUseShell ( void ) const

Definition at line 254 of file CvsPrefs.cpp.

References SHELL_KIND.

00254 {return (SHELL_KIND)(int)gUseShell;}

bool CvsPrefs::HasLoogedIn ( void ) const [inline]

Definition at line 215 of file CvsPrefs.h.

References fHasLoggedIn.

00215 { return fHasLoggedIn; }

const char * CvsPrefs::Helper ( void ) const

Definition at line 230 of file CvsPrefs.cpp.

References UStr::empty.

00231 {
00232     return gHelper.empty() ? 0L : (const char *)gHelper;
00233 }

bool CvsPrefs::HideCommandDlgAnnotate ( void ) const

Definition at line 268 of file CvsPrefs.cpp.

00268 {return gHideCommandDlgAnnotate;}

bool CvsPrefs::HideCommandDlgDiff ( void ) const

Definition at line 265 of file CvsPrefs.cpp.

00265 {return gHideCommandDlgDiff;}

bool CvsPrefs::HideCommandDlgGraph ( void ) const

Definition at line 267 of file CvsPrefs.cpp.

00267 {return gHideCommandDlgGraph;}

bool CvsPrefs::HideCommandDlgLog ( void ) const

Definition at line 266 of file CvsPrefs.cpp.

00266 {return gHideCommandDlgLog;}

bool CvsPrefs::HideCommandDlgUpdate ( void ) const

Definition at line 264 of file CvsPrefs.cpp.

00264 {return gHideCommandDlgUpdate;}

bool CvsPrefs::HideCommandDlgUseShift ( void ) const

Definition at line 269 of file CvsPrefs.cpp.

00269 {return gHideCommandDlgUseShift;}

const char * CvsPrefs::Home ( void ) const

Definition at line 197 of file CvsPrefs.cpp.

References CStr, UStr::empty, UStr::endsWith, getenv, and UStr::length.

00198 {
00199 #if !qUnix && !TARGET_RT_MAC_MACHO
00200 #   ifdef WIN32
00201     // Windows 98 doesn't like C:\/.cvspass
00202     if(!gHome.empty() && gHome.endsWith(kPathDelimiter))
00203     {
00204         gHome[gHome.length() - 1] = '\0';
00205     }
00206 #   endif
00207     return gHome.empty() ? 0L : (const char *)gHome;
00208 #else /* qUnix */
00209     static CStr home;
00210     if (!home.empty())
00211         return home;
00212
00213     char *env = getenv ("HOME");
00214     struct passwd *pw;
00215     if (env)
00216         home = env;
00217     else if ((pw = (struct passwd *) getpwuid (getuid ()))
00218              && pw->pw_dir)
00219         home = pw->pw_dir;
00220     else
00221         return 0L;
00222
00223     return home;
00224 #endif /* qUnix */
00225 }

bool CvsPrefs::ICTextOption ( void ) const

Definition at line 179 of file CvsPrefs.cpp.

00179 {return gICTextOption;}

bool CvsPrefs::IsCvsRunning ( void ) const

Definition at line 655 of file CvsPrefs.cpp.

References fCvsRunningCounter.

00656 {
00657     return(fCvsRunningCounter > 0);
00658 }

ISO8559 CvsPrefs::IsoConvert ( void ) const

Definition at line 178 of file CvsPrefs.cpp.

References ISO8559.

00178 {return (ISO8559)(int)gIsoConvert;}

bool CvsPrefs::IsTclFileRunning ( void ) const

Definition at line 670 of file CvsPrefs.cpp.

References fTclFileRunningCounter.

00671 {
00672     return(fTclFileRunningCounter > 0);
00673 }

int CvsPrefs::KserverPort ( void ) const

Definition at line 183 of file CvsPrefs.cpp.

00183 {return gKserverPort;}

const char * CvsPrefs::LastWorkingDir ( void ) const

Definition at line 259 of file CvsPrefs.cpp.

References UStr::empty.

00260 {
00261     return gLastWorkingDir.empty() ? 0L : (const char *)gLastWorkingDir;
00262 }

int CvsPrefs::length ( void ) const

Definition at line 326 of file CvsPrefs.cpp.

References UPStr::length.

00326 {   return gCvsroot.length(); }

void CvsPrefs::load ( void )

Definition at line 451 of file CvsPrefs.cpp.

References AuthenKind, err, FSSpec, TMString< UStr >::Insert, ISO8559, CPersistent::LoadAll, MacGetPrefsFolder, MigrateCvsrootList, NULL, NUM_CVSROOT, PROFILE_NAME, SCHEMA_0, SetAddControl, SetCheckoutRO, SetICTextOption, SetIsoConvert, SetPruneOption, SetQuietOption, and SetZ9Option.

00452 {
00453 // migration
00454 #ifndef MIGRATECVSROOTLIST
00455     // flush the CVSROOT list, it will be filled later
00456     flush_list();
00457 #endif
00458
00459     bool loaded = CPersistent::LoadAll();
00460
00461     if( loaded )
00462     {
00463         if( SCHEMA_0 == gPersistentShema )
00464         {
00465             MigrateCvsrootList();
00466         }
00467
00468         return;
00469     }
00470
00471     // backward compatibility
00472 #ifdef WIN32
00473     UINT value;
00474
00475     CString cstr = AfxGetApp()->GetProfileString(PROFILE_NAME, "CVSROOT");
00476     if(!cstr.IsEmpty())
00477         *this = (const char *)cstr;
00478
00479     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "CheckoutRO", -1)) != -1)
00480         SetCheckoutRO(value ? 1 : 0);
00481     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "Z9Option", -1)) != -1)
00482         SetZ9Option(value ? 1 : 0);
00483     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "QuietOption", -1)) != -1)
00484         SetQuietOption(value ? 1 : 0);
00485     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "PruneOption", -1)) != -1)
00486         SetPruneOption(value ? 1 : 0);
00487     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "Authentication", -1)) != -1)
00488         gAuthen.setkind((AuthenKind)value);
00489     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "AddControl", -1)) != -1)
00490         SetAddControl(value ? 1 : 0);
00491
00492     char tmp[20];
00493     for(int i = 0; i < NUM_CVSROOT; i++)
00494     {
00495         sprintf(tmp, "CVSROOTLIST%d", i);
00496         cstr = AfxGetApp()->GetProfileString(PROFILE_NAME, tmp);
00497         if(!cstr.IsEmpty())
00498             gOldCvsroots.Insert((const char *)cstr);
00499     }
00500
00501 #endif /* WIN32 */
00502
00503 #if defined(macintosh) && !TARGET_API_MAC_CARBON
00504     FSSpec theFolder;
00505     short FRef;
00506     Handle hdl;
00507     OSErr err;
00508     Str255 thePath;
00509
00510     err = MacGetPrefsFolder(theFolder, thePath);
00511     if(err != noErr)
00512         return;
00513
00514     err = HSetVol(NULL, theFolder.vRefNum, theFolder.parID);
00515     FRef = OpenResFile(PCVS);
00516     if(FRef < 0)
00517         return;
00518
00519     hdl = GetResource('CVS ', 128);
00520     if(hdl != NULL)
00521     {
00522         Str255 str;
00523         HLock(hdl);
00524         BlockMove(*hdl, str, (*hdl)[0] + 1);
00525         str[str[0] + 1] = '\0';
00526         *this = (const char *)str + 1;
00527         HUnlock(hdl);
00528     }
00529     hdl = GetResource('CHRO', 128);
00530     if(hdl != NULL)
00531     {
00532         SetCheckoutRO(**hdl);
00533     }
00534     hdl = GetResource('Z9OP', 128);
00535     if(hdl != NULL)
00536     {
00537         SetZ9Option(**hdl);
00538     }
00539     hdl = GetResource('QUIE', 128);
00540     if(hdl != NULL)
00541     {
00542         SetQuietOption(**hdl);
00543     }
00544     hdl = GetResource('POPT', 128);
00545     if(hdl != NULL)
00546     {
00547         SetPruneOption(**hdl);
00548     }
00549     hdl = GetResource('AUTH', 128);
00550     if(hdl != NULL)
00551     {
00552         gAuthen.setkind((AuthenKind)**hdl);
00553     }
00554     hdl = GetResource('ISOC', 128);
00555     if(hdl != NULL)
00556     {
00557         SetIsoConvert((ISO8559)**hdl);
00558     }
00559     hdl = GetResource('ICTO', 128);
00560     if(hdl != NULL)
00561     {
00562         SetICTextOption(**hdl);
00563     }
00564     hdl = GetResource('ACTL', 128);
00565     if(hdl != NULL)
00566     {
00567         SetAddControl(**hdl);
00568     }
00569
00570     for(int i = 0; i < NUM_CVSROOT; i++)
00571     {
00572         hdl = GetResource('CROL', 128 + i);
00573         if(hdl != NULL)
00574         {
00575             HLock(hdl);
00576             get_cvsroot_list(i) = (const char *)*hdl;
00577             HUnlock(hdl);
00578         }
00579     }
00580     CloseResFile (FRef);
00581 #endif /* macintosh && !TARGET_API_MAC_CARBON */
00582 }

int CvsPrefs::LogoutTimeOut ( void ) const

Definition at line 243 of file CvsPrefs.cpp.

00243 {return gLogoutTimeOut;}

MACENCODING CvsPrefs::MacBinEncoding ( void ) const

Definition at line 182 of file CvsPrefs.cpp.

References MACENCODING.

00182 {return (MACENCODING)(int)gMacBinEncoding;}

bool CvsPrefs::MacLF ( void ) const

Definition at line 249 of file CvsPrefs.cpp.

00249 {return gMacLF;}

CvsPrefs::operator const char * ( ) const

Definition at line 327 of file CvsPrefs.cpp.

00327 {   return (const char *)gCvsroot; }

CvsPrefs::operator const unsigned char * ( ) const

Definition at line 328 of file CvsPrefs.cpp.

00328 {return (const unsigned char *)gCvsroot;}

const unsigned char * CvsPrefs::operator= ( const unsigned char * newstr )

Definition at line 330 of file CvsPrefs.cpp.

00330 {   return gCvsroot = newstr; }

const char * CvsPrefs::operator= ( const char * newstr )

Definition at line 329 of file CvsPrefs.cpp.

00329 {   return gCvsroot = newstr; }

const char * CvsPrefs::ProxyHost ( void ) const

Definition at line 245 of file CvsPrefs.cpp.

00245 {return gProxyHost;}

int CvsPrefs::ProxyPort ( void ) const

Definition at line 246 of file CvsPrefs.cpp.

00246 {return gProxyPort;}

bool CvsPrefs::PruneOption ( void ) const

Definition at line 176 of file CvsPrefs.cpp.

00176 {return gPruneOption;}

int CvsPrefs::PserverPort ( void ) const

Definition at line 184 of file CvsPrefs.cpp.

00184 {return gPserverPort;}

bool CvsPrefs::QuietOption ( void ) const

Definition at line 177 of file CvsPrefs.cpp.

00177 {return gQuietOption;}

int CvsPrefs::RhostPort ( void ) const

Definition at line 185 of file CvsPrefs.cpp.

00185 {return gRhostPort;}

const char * CvsPrefs::RshName ( void ) const

Definition at line 191 of file CvsPrefs.cpp.

References UStr::empty.

00192 {
00193     return gRshName.empty() ? 0L : (const char *)gRshName;
00194 }

void CvsPrefs::save ( void )

Definition at line 411 of file CvsPrefs.cpp.

References empty, UCvsApp::gApp, UCvsApp::GetBrowserView, CWincvsApp::GetBrowserView, UCvsFolders::GetRoot, CWinCvsBrowser::GetRoot, CPersistent::NeedSave, CPersistent::SaveAll, SavePersistentSettings, and SCHEMA_1.

00412 {
00413     if(empty())
00414         return;
00415
00416     if( SCHEMA_1 != gPersistentShema )
00417     {
00418         gPersistentShema = SCHEMA_1;
00419     }
00420
00421     bool needSave = CPersistent::NeedSave();
00422     bool needSaveSettings = CPersistent::NeedSave(true);
00423     if(!needSave)
00424         return;
00425
00426 // migration
00427 #ifndef MIGRATECVSROOTLIST
00428     // update the CVSROOT list
00429     insert_cvsroot_in_list((const char *)*this);
00430 #endif
00431
00432     CPersistent::SaveAll();
00433
00434     if(!needSaveSettings)
00435         return;
00436
00437 #ifdef WIN32
00438     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00439     SavePersistentSettings(app->GetBrowserView()->GetRoot());
00440 #endif
00441 #ifdef qMacCvsPP
00442     CMacCvsApp::SavePersistentSettings();
00443 #endif /* qMacCvsPP */
00444 #if qUnix
00445     UCvsFolders *browser = UCvsApp::gApp->GetBrowserView();
00446     if(browser != 0L && browser->GetRoot() != 0L)
00447         SavePersistentSettings(browser->GetRoot());
00448 #endif
00449 }

const char * CvsPrefs::ServerName ( void ) const

Definition at line 187 of file CvsPrefs.cpp.

References UPStr::empty.

00188 {
00189     return gServerName.empty() ? 0L : (const char *)gServerName;
00190 }

void CvsPrefs::SetAddControl ( bool newState )

Definition at line 277 of file CvsPrefs.cpp.

Referenced by load.

00277 {gAddBinControl = newState;}

void CvsPrefs::SetAlwaysUseCvsroot ( bool newState )

Definition at line 305 of file CvsPrefs.cpp.

00305 {gAlwaysUseCvsroot = newState;}

void CvsPrefs::SetBrowser ( const char * newbrowser )

Definition at line 300 of file CvsPrefs.cpp.

00300 {gBrowser = newviewer;}

void CvsPrefs::SetCheckoutRO ( bool newState )

Definition at line 271 of file CvsPrefs.cpp.

Referenced by load.

00271 {gCheckoutRO = newState;}

void CvsPrefs::SetCvsConsole ( bool console )

Definition at line 313 of file CvsPrefs.cpp.

00313 {gCvsConsole = console;}

int CvsPrefs::SetCvsRunning ( bool launched )

Definition at line 660 of file CvsPrefs.cpp.

References fCvsRunningCounter.

00661 {
00662     if(launched)
00663         fCvsRunningCounter++;
00664     else if(fCvsRunningCounter > 0)
00665         fCvsRunningCounter--;
00666
00667     return fCvsRunningCounter;
00668 }

void CvsPrefs::SetCvsVersion ( int version )

Definition at line 312 of file CvsPrefs.cpp.

00312 {gCvsVersion = vers;}

void CvsPrefs::SetDirtySupport ( bool newState )

Definition at line 303 of file CvsPrefs.cpp.

00303 {gDirtySupport = newState;}

void CvsPrefs::SetEncryptCommunication ( bool newState )

Definition at line 285 of file CvsPrefs.cpp.

00285 {gEncryptCommunication = newState;}

void CvsPrefs::SetExtDiff ( const char * newdiff )

Definition at line 302 of file CvsPrefs.cpp.

00302 {gExtdiff = newdiff;}

void CvsPrefs::SetHasLoogedIn ( bool newstate ) [inline]

Definition at line 216 of file CvsPrefs.h.

References fHasLoggedIn.

00216 { fHasLoggedIn = newstate; }

void CvsPrefs::SetHelper ( const char * newhelper )

Definition at line 301 of file CvsPrefs.cpp.

00301 {gHelper = newviewer;}

void CvsPrefs::SetHideCommandDlgAnnotate ( bool newState )

Definition at line 322 of file CvsPrefs.cpp.

00322 {gHideCommandDlgAnnotate = newState;}

void CvsPrefs::SetHideCommandDlgDiff ( bool newState )

Definition at line 319 of file CvsPrefs.cpp.

00319 {gHideCommandDlgDiff = newState;}

void CvsPrefs::SetHideCommandDlgGraph ( bool newState )

Definition at line 321 of file CvsPrefs.cpp.

00321 {gHideCommandDlgGraph = newState;}

void CvsPrefs::SetHideCommandDlgLog ( bool newState )

Definition at line 320 of file CvsPrefs.cpp.

00320 {gHideCommandDlgLog = newState;}

void CvsPrefs::SetHideCommandDlgUpdate ( bool newState )

Definition at line 318 of file CvsPrefs.cpp.

00318 {gHideCommandDlgUpdate = newState;}

void CvsPrefs::SetHideCommandDlgUseShift ( bool newState )

Definition at line 323 of file CvsPrefs.cpp.

00323 {gHideCommandDlgUseShift = newState;}

void CvsPrefs::SetHome ( const char * newhome )

Definition at line 286 of file CvsPrefs.cpp.

References UStr::empty, UStr::endsWith, and UStr::length.

00287 {
00288 #ifndef qUnix
00289     gHome = newhome;
00290 #   ifdef WIN32
00291     // Windows 98 doesn't like C:\/.cvspass
00292     if(!gHome.empty() && gHome.endsWith(kPathDelimiter))
00293     {
00294         gHome[gHome.length() - 1] = '\0';
00295     }
00296 #   endif
00297 #endif /* !qUnix */
00298 }

void CvsPrefs::SetICTextOption ( bool newState )

Definition at line 276 of file CvsPrefs.cpp.

Referenced by load.

00276 {gICTextOption = newState;}

void CvsPrefs::SetIsoConvert ( ISO8559 newState )

Definition at line 275 of file CvsPrefs.cpp.

References ISO8559.

Referenced by load.

00275 {gIsoConvert = (int)newState;}

void CvsPrefs::SetKserverPort ( int newState )

Definition at line 280 of file CvsPrefs.cpp.

00280 {gKserverPort = newState;}

void CvsPrefs::SetLastWorkingDir ( const char * workdir )

Definition at line 315 of file CvsPrefs.cpp.

00315 {gLastWorkingDir = workdir;}

void CvsPrefs::SetLogoutTimeOut ( int newTimeout )

Definition at line 304 of file CvsPrefs.cpp.

00304 {gLogoutTimeOut = newTimeout;}

void CvsPrefs::SetMacBinEncoding ( MACENCODING newState )

Definition at line 279 of file CvsPrefs.cpp.

References MACENCODING.

00279 {gMacBinEncoding = (int)newState;}

void CvsPrefs::SetMacLF ( bool useit )

Definition at line 308 of file CvsPrefs.cpp.

00308 {gMacLF = useit;}

void CvsPrefs::SetProxyHost ( const char * newhost )

Definition at line 310 of file CvsPrefs.cpp.

00310 {gProxyHost = newhost;}

void CvsPrefs::SetProxyPort ( int newport )

Definition at line 311 of file CvsPrefs.cpp.

00311 {gProxyPort = newport;}

void CvsPrefs::SetPruneOption ( bool newState )

Definition at line 273 of file CvsPrefs.cpp.

Referenced by load.

00273 {gPruneOption = newState;}

void CvsPrefs::SetPserverPort ( int newState )

Definition at line 281 of file CvsPrefs.cpp.

00281 {gPserverPort = newState;}

void CvsPrefs::SetQuietOption ( bool newState )

Definition at line 274 of file CvsPrefs.cpp.

Referenced by load.

00274 {gQuietOption = newState;}

void CvsPrefs::SetRhostPort ( int newState )

Definition at line 282 of file CvsPrefs.cpp.

00282 {gRhostPort = newState;}

void CvsPrefs::SetRshName ( const char * newrshname )

Definition at line 284 of file CvsPrefs.cpp.

00284 {gRshName = newrshname;}

void CvsPrefs::SetServerName ( const char * newservername )

Definition at line 283 of file CvsPrefs.cpp.

00283 {gServerName = newservername;}

int CvsPrefs::SetTclFileRunning ( bool launched )

Definition at line 675 of file CvsPrefs.cpp.

References fTclFileRunningCounter.

00676 {
00677     if(launched)
00678         fTclFileRunningCounter++;
00679     else if(fTclFileRunningCounter > 0)
00680         fTclFileRunningCounter--;
00681
00682     return fTclFileRunningCounter;
00683 }

void CvsPrefs::SetUnixLF ( bool useit )

Definition at line 307 of file CvsPrefs.cpp.

00307 {gUnixLF = useit;}

void CvsPrefs::SetUseAltCvs ( bool useit )

Definition at line 1022 of file CvsPrefs.cpp.

01022 {gUseAltCvs = useit;}

void CvsPrefs::SetUseProxy ( bool useit )

Definition at line 306 of file CvsPrefs.cpp.

00306 {gUseProxy = useit;}

void CvsPrefs::SetUseShell ( SHELL_KIND shell )

Definition at line 316 of file CvsPrefs.cpp.

References SHELL_KIND.

00316 {gUseShell = shell;}

void CvsPrefs::SetUseViewerAlways ( bool newState )

Definition at line 278 of file CvsPrefs.cpp.

00278 {gUseViewerAlways = newState;}

void CvsPrefs::SetViewer ( const char * newviewer )

Definition at line 299 of file CvsPrefs.cpp.

00299 {gViewer = newviewer;}

void CvsPrefs::SetWhichCvs ( const char * cvsPath )

Definition at line 1024 of file CvsPrefs.cpp.

References CKeyString::Concatenate, UStr::empty, and TMString< UStr >::Insert.

01025 {
01026     UStr appPath;
01027
01028 #ifdef WIN32
01029     HINSTANCE hInst = ::AfxGetInstanceHandle();
01030     char apath[512];
01031     DWORD len;
01032     if(hInst != 0L && (len = ::GetModuleFileName(hInst, apath, 512)) > 0)
01033     {
01034         CString tmp(apath);
01035         tmp.MakeLower();
01036         appPath = tmp;
01037     }
01038 #elif qUnix
01039     appPath << EXECLIB << "/" << "cvs";
01040 #elif TARGET_RT_MAC_MACHO
01041     appPath = CMacCvsApp::gApp->GetAppPath();
01042 #endif
01043
01044     if(!appPath.empty()) {
01045         UStr value;
01046         gWhichCvs.Concatenate(value, appPath, cvsPath);
01047         gWhichCvs.Insert(value);
01048     } else {
01049         gWhichCvs.Insert( cvsPath );
01050     }
01051 }

void CvsPrefs::SetWordWrapLogMsg ( int wordwrap )

Definition at line 314 of file CvsPrefs.cpp.

00314 {gWordWrapLogMsg = wordwrap;}

void CvsPrefs::SetZ9Option ( bool newState )

Definition at line 272 of file CvsPrefs.cpp.

Referenced by load.

00272 {gZ9Option = newState;}

void CvsPrefs::SetZLevel ( int level )

Definition at line 309 of file CvsPrefs.cpp.

00309 {gZLevel = level;}

bool CvsPrefs::UnixLF ( void ) const

Definition at line 248 of file CvsPrefs.cpp.

00248 {return gUnixLF;}

bool CvsPrefs::UseAltCvs ( void ) const

Definition at line 1021 of file CvsPrefs.cpp.

01021 {return gUseAltCvs;}

bool CvsPrefs::UseKeyChain ( void ) const

Definition at line 970 of file Authen.cpp.

00971 {
00972 #if TARGET_RT_MAC_CFM
00973     return (bool)AuthenLSH::gLSHKeychain;
00974 #else
00975     return false;
00976 #endif
00977 }

bool CvsPrefs::UseProxy ( void ) const

Definition at line 247 of file CvsPrefs.cpp.

00247 {return gUseProxy;}

bool CvsPrefs::UseViewerAlways ( void ) const

Definition at line 181 of file CvsPrefs.cpp.

Referenced by LaunchViewer.

00181 {return gUseViewerAlways;}

const char * CvsPrefs::Viewer ( void ) const

Definition at line 226 of file CvsPrefs.cpp.

References UStr::empty.

Referenced by LaunchEditor, and LaunchViewer.

00227 {
00228     return gViewer.empty() ? 0L : (const char *)gViewer;
00229 }

const char * CvsPrefs::WhichCvs | ( | UStr & | path,
 |  | bool | userOnly = false
 | ) | const

Definition at line 1053 of file CvsPrefs.cpp.

References UStr::c_str, CKeyString::Concatenate, UStr::empty, TMString< UStr >::end, UStr::endsWith, TMString< UStr >::Find, CWincvsApp::GetAppPath, kWin32, CKeyString::Split, stat, and WhichVersion.

01054 {
01055     path = "";
01056
01057     UStr appPath = "";
01058
01059 #ifdef WIN32
01060     HINSTANCE hInst = ::AfxGetInstanceHandle();
01061     char apath[512];
01062     DWORD len;
01063     if(hInst != 0L && (len = ::GetModuleFileName(hInst, apath, 512)) > 0)
01064     {
01065         CString tmp(apath);
01066         tmp.MakeLower();
01067         appPath = tmp;
01068     }
01069 #elif qUnix
01070     appPath << EXECLIB << "/" << "cvs";
01071 #elif TARGET_RT_MAC_MACHO
01072     appPath = CMacCvsApp::gApp->GetAppPath();
01073 #endif
01074
01075     // search if beside the default cvs, the user defined one to use
01076     // with this application only.
01077     UStr candidate;
01078     if(!appPath.empty())
01079     {
01080         UStr value;
01081         gWhichCvs.Concatenate(value, appPath, "");
01082         TMString<UStr>::list_t::const_iterator i = gWhichCvs.Find(value);
01083         if(i != gWhichCvs.end())
01084         {
01085             UStr key;
01086             gWhichCvs.Split(*i, key, candidate);
01087         }
01088     }
01089
01090     // verify this cvs exe is still there
01091     struct stat sb;
01092     if(!candidate.empty() && stat(candidate, &sb) != -1 && S_ISREG(sb.st_mode))
01093     {
01094         path = candidate;
01095         return path.c_str();
01096     }
01097
01098     // fallback to the default one.
01099     if(userOnly)
01100         return 0L;
01101
01102 #ifdef WIN32
01103     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01104
01105     app->GetAppPath(path);
01106     if(!path.endsWith(kPathDelimiter))
01107         path << kPathDelimiter;
01108     path << (gCvsPrefs.WhichVersion() == kWin32 ? "cvs95.exe" : "cvs.exe");
01109 #elif qUnix
01110     if( path.empty() )
01111         path = EXECLIB;
01112
01113     if(!path.endsWith(kPathDelimiter))
01114         path << kPathDelimiter;
01115
01116     path << "cvs";
01117 #elif TARGET_RT_MAC_MACHO
01118     path = CMacCvsApp::gApp->GetAppPath();
01119     if(!path.endsWith(kPathDelimiter))
01120         path << kPathDelimiter;
01121 #   if qCvsDebug
01122     path << "cvsguidbg";
01123 #   else
01124     path << "cvsgui";
01125 #   endif
01126 #endif
01127
01128     return path.c_str();
01129 }

kWinVersion CvsPrefs::WhichVersion ( )

Definition at line 619 of file CvsPrefs.cpp.

References kWin16, kWin32, kWinNT35, kWinNT4, and kWinVersion.

Referenced by WhichCvs.

00620 {
00621     DWORD dwVersion = GetVersion(); // Get major and minor version numbers of Windows
00622     DWORD dwWindowsMajorVersion =  (DWORD)(LOBYTE(LOWORD(dwVersion)));
00623     DWORD dwWindowsMinorVersion =  (DWORD)(HIBYTE(LOWORD(dwVersion)));
00624     DWORD dwBuild;
00625
00626     // Get build numbers for Windows NT or Win32s
00627     if (dwVersion < 0x80000000)                // Windows NT
00628     {
00629         dwBuild = (DWORD)(HIWORD(dwVersion));
00630         return dwWindowsMajorVersion == 3 ? kWinNT35 : kWinNT4;
00631     }
00632     else if (dwWindowsMajorVersion < 4)        // Win16s
00633     {
00634         dwBuild = (DWORD)(HIWORD(dwVersion));
00635         return kWin16;
00636     }
00637
00638     // Windows 95 -- No build numbers provided    dwBuild =  0;
00639     return kWin32;
00640 }

int CvsPrefs::WordWrapLogMsg ( void ) const

Definition at line 253 of file CvsPrefs.cpp.

00253 {return gWordWrapLogMsg;}

bool CvsPrefs::Z9Option ( void ) const

Definition at line 168 of file CvsPrefs.cpp.

00169 {
00170 #ifdef macintosh
00171     // because of the problem with LSH...
00172     return true;
00173 #endif
00174     return gZ9Option;
00175 }

int CvsPrefs::ZLevel ( void ) const

Definition at line 250 of file CvsPrefs.cpp.

00250 {return gZLevel;}

Member Data Documentation

int CvsPrefs::fCvsRunningCounter [protected]

Definition at line 239 of file CvsPrefs.h.

Referenced by CvsPrefs, IsCvsRunning, and SetCvsRunning.

bool CvsPrefs::fHasLoggedIn [protected]

Definition at line 237 of file CvsPrefs.h.

Referenced by CvsPrefs, HasLoogedIn, and SetHasLoogedIn.

int CvsPrefs::fTclFileRunningCounter [protected]

Definition at line 240 of file CvsPrefs.h.

Referenced by CvsPrefs, IsTclFileRunning, and SetTclFileRunning.

The documentation for this class was generated from the following files:
  • common/CvsPrefs.h
  • common/Authen.cpp
  • common/CvsPrefs.cpp
Generated on Sun Feb 24 01:28:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsProcessCallbacks Struct Reference

#include <cvsgui_process.h>

Collaboration diagram for CvsProcessCallbacks:

[legend]
List of all members.

Public Attributes

long(* | consoleout )(char *txt, long len)
long(* | consoleerr )(char *txt, long len)
const char *(* | getenv )(char *name)
void(* | exit )(int code)

Member Data Documentation

long(* CvsProcessCallbacks::consoleerr)(char *txt, long len)

Referenced by cvs_process_handle_message, and GetChldError.

long(* CvsProcessCallbacks::consoleout)(char *txt, long len)

Referenced by cvs_process_handle_message, and GetChldOutput.

void(* CvsProcessCallbacks::exit)(int code)

Referenced by cvs_process_handle_message.

const char*(* CvsProcessCallbacks::getenv)(char *name)

Referenced by cvs_process_handle_message.

The documentation for this struct was generated from the following file:
  • common/cvsgui_process.h
Generated on Sun Feb 24 01:28:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsProject Class Reference

#include <CvsProject.h>

Collaboration diagram for CvsProject:

[legend]
List of all members.

Public Methods

CvsProject ()
~CvsProject ()
int | getProjectHandle ()
int | getLastError ()
const char * | getProjectName ()
const char * | getProjectHome ()
bool | getErrorMessage (int, CvsString &)
bool | getFilesToAdd (CvsString &)
bool | getFileChanges (CvsString &)
bool | showAdvancedOptionsForCommand (CvsCommand)
bool | hasAdvancedOptionsForCommand (CvsCommand, BOOL &)
bool | showUserInterface (CvsFilenames &)
bool | showFileProperties (const char *)
bool | showFileHistory (CvsFilenames &)
bool | isFileDifferent (const char *, CvsOption, BOOL &)
bool | diffFile (const char *, BOOL, BOOL)
bool | renameFile (const char *, const char *)
bool | removeFiles (CvsFilenames &)
bool | addFiles (CvsFilenames &, const char *)
bool | uncheckoutFiles (CvsFilenames &)
bool | checkinFiles (CvsFilenames &, BOOL)
bool | checkoutFiles (CvsFilenames &)
bool | updateFiles (CvsFilenames &, BOOL, BOOL)
bool | getProject (const char *, const char *, const char *, BOOL, BOOL, BOOL &)
bool | openProject (const char *, const char *, const char *)
bool | closeProject ()

Static Public Methods

CvsProject * | FindProject (int)

Protected Attributes

CvsProject * | m_pNextProject
int | m_hProject
int | m_iLastError
CvsString m_sProjectName
CvsString m_sProjectHome
CvsString m_sUsername

Constructor & Destructor Documentation

CvsProject::CvsProject ( )

Definition at line 20 of file CvsProject.cpp.

References g_hNextProject.

00021 :   m_hProject(g_hNextProject++),
00022     m_pNextProject(g_pProjects),
00023     m_iLastError(0)
00024 {
00025     g_pProjects = this;
00026 }

CvsProject::~CvsProject ( )

Definition at line 28 of file CvsProject.cpp.

References ASSERT, and m_pNextProject.

00029 {
00030     ASSERT(!m_pNextProject);
00031     // Not freed immediately for error catching.
00032 }

Member Function Documentation

bool CvsProject::addFiles | ( | CvsFilenames & | ,
 |  | const char * |
 | ) |

Definition at line 135 of file CvsProject.cpp.

00139 {
00140     // TODO: Add your implementation code here
00141     return true;
00142 }

bool CvsProject::checkinFiles | ( | CvsFilenames & | ,
 |  | BOOL |
 | ) |

Definition at line 118 of file CvsProject.cpp.

00122 {
00123     // TODO: Add your implementation code here
00124     return true;
00125 }

bool CvsProject::checkoutFiles ( CvsFilenames & )

Definition at line 110 of file CvsProject.cpp.

00113 {
00114     // TODO: Add your implementation code here
00115     return true;
00116 }

bool CvsProject::closeProject ( )

Definition at line 94 of file CvsProject.cpp.

00095 {
00096     // TODO: Add your implementation code here
00097     return true;
00098 }

bool CvsProject::diffFile | ( | const char * | ,
 |  | BOOL | ,
 |  | BOOL |
 | ) |

Definition at line 161 of file CvsProject.cpp.

00166 {
00167     // TODO: Add your implementation code here
00168     return true;
00169 }

CvsProject * CvsProject::FindProject ( int ) [static]

Definition at line 38 of file CvsProject.cpp.

References getProjectHandle, and m_pNextProject.

Referenced by CvsCoworker::GetErrorMessage, and CvsCoworker::GetLastError.

00039 {
00040     CvsProject* pProject = g_pProjects;
00041     while (pProject) {
00042         if (h == pProject->getProjectHandle()) {
00043             return pProject;
00044         }
00045         pProject = pProject->m_pNextProject;
00046     }
00047     return 0;
00048 }

bool CvsProject::getErrorMessage | ( | int | ,
 |  | CvsString & |
 | ) |

Definition at line 54 of file CvsProject.cpp.

Referenced by CvsCoworker::GetErrorMessage.

00055 {
00056     // TODO: Add your implementation code here
00057     sError = "No error";
00058     return true;
00059 }

bool CvsProject::getFileChanges ( CvsString & )

Definition at line 231 of file CvsProject.cpp.

00234 {
00235     // TODO: Add your implementation code here
00236     return true;
00237 }

bool CvsProject::getFilesToAdd ( CvsString & )

Definition at line 239 of file CvsProject.cpp.

00242 {
00243     // TODO: Add your implementation code here
00244     return true;
00245 }

int CvsProject::getLastError ( ) [inline]

Definition at line 27 of file CvsProject.h.

References m_iLastError.

Referenced by CvsCoworker::GetLastError.

00027 { return m_iLastError; }

bool CvsProject::getProject | ( | const char * | ,
 |  | const char * | ,
 |  | const char * | ,
 |  | BOOL | ,
 |  | BOOL | ,
 |  | BOOL & |
 | ) |

Definition at line 65 of file CvsProject.cpp.

References m_sProjectHome, m_sProjectName, and m_sUsername.

Referenced by CvsCoworker::GetProject.

00073 {
00074     m_sUsername     = sUsername;
00075     m_sProjectName  = sProjectName;
00076     m_sProjectHome  = sProjectHome;
00077     // TODO: Add your implementation code here
00078     return false;
00079 }

int CvsProject::getProjectHandle ( ) [inline]

Definition at line 26 of file CvsProject.h.

References m_hProject.

Referenced by FindProject, CvsCoworker::GetProject, and CvsCoworker::OpenProject.

00026 { return m_hProject; }

const char* CvsProject::getProjectHome ( ) [inline]

Definition at line 29 of file CvsProject.h.

References m_sProjectHome.

Referenced by CvsCoworker::GetProject.

00029 { return m_sProjectHome; }

const char* CvsProject::getProjectName ( ) [inline]

Definition at line 28 of file CvsProject.h.

References m_sProjectName.

Referenced by CvsCoworker::GetProject.

00028 { return m_sProjectName; }

bool CvsProject::hasAdvancedOptionsForCommand | ( | CvsCommand | ,
 |  | BOOL & |
 | ) |

Definition at line 214 of file CvsProject.cpp.

00218 {
00219     // TODO: Add your implementation code here
00220     return true;
00221 }

bool CvsProject::isFileDifferent | ( | const char * | ,
 |  | CvsOption | ,
 |  | BOOL & |
 | ) |

Definition at line 171 of file CvsProject.cpp.

00176 {
00177     bFileIsDifferent = false;
00178     // TODO: Add your implementation code here
00179     return true;
00180 }

bool CvsProject::openProject | ( | const char * | ,
 |  | const char * | ,
 |  | const char * |
 | ) |

Definition at line 81 of file CvsProject.cpp.

References m_sProjectHome, m_sProjectName, and m_sUsername.

Referenced by CvsCoworker::OpenProject.

00086 {
00087     m_sUsername     = sUsername;
00088     m_sProjectName  = sProjectName;
00089     m_sProjectHome  = sProjectHome;
00090     // TODO: Add your implementation code here
00091     return true;
00092 }

bool CvsProject::removeFiles ( CvsFilenames & )

Definition at line 144 of file CvsProject.cpp.

00147 {
00148     // TODO: Add your implementation code here
00149     return true;
00150 }

bool CvsProject::renameFile | ( | const char * | ,
 |  | const char * |
 | ) |

Definition at line 152 of file CvsProject.cpp.

00156 {
00157     // TODO: Add your implementation code here
00158     return true;
00159 }

bool CvsProject::showAdvancedOptionsForCommand ( CvsCommand )

Definition at line 223 of file CvsProject.cpp.

00226 {
00227     // TODO: Add your implementation code here
00228     return true;
00229 }

bool CvsProject::showFileHistory ( CvsFilenames & )

Definition at line 182 of file CvsProject.cpp.

00185 {
00186     // TODO: Add your implementation code here
00187     return true;
00188 }

bool CvsProject::showFileProperties ( const char * )

Definition at line 190 of file CvsProject.cpp.

00193 {
00194     // TODO: Add your implementation code here
00195     return true;
00196 }

bool CvsProject::showUserInterface ( CvsFilenames & )

Definition at line 198 of file CvsProject.cpp.

00201 {
00202     CWnd* pMainWnd = AfxGetMainWnd();
00203     if (pMainWnd) {
00204         pMainWnd->ShowWindow(SW_SHOWDEFAULT);
00205     }
00206     CWinApp* pApp = AfxGetApp();
00207     if (pApp) {
00208          // TBD
00209     }
00210     // TODO: Add your implementation code here
00211     return true;
00212 }

bool CvsProject::uncheckoutFiles ( CvsFilenames & )

Definition at line 127 of file CvsProject.cpp.

00130 {
00131     // TODO: Add your implementation code here
00132     return true;
00133 }

bool CvsProject::updateFiles | ( | CvsFilenames & | ,
 |  | BOOL | ,
 |  | BOOL |
 | ) |

Definition at line 100 of file CvsProject.cpp.

00105 {
00106     // TODO: Add your implementation code here
00107     return true;
00108 }

Member Data Documentation

int CvsProject::m_hProject [protected]

Definition at line 56 of file CvsProject.h.

Referenced by getProjectHandle.

int CvsProject::m_iLastError [protected]

Definition at line 57 of file CvsProject.h.

Referenced by getLastError.

CvsProject* CvsProject::m_pNextProject [protected]

Definition at line 55 of file CvsProject.h.

Referenced by FindProject, and ~CvsProject.

CvsString CvsProject::m_sProjectHome [protected]

Definition at line 59 of file CvsProject.h.

Referenced by getProject, getProjectHome, and openProject.

CvsString CvsProject::m_sProjectName [protected]

Definition at line 58 of file CvsProject.h.

Referenced by getProject, getProjectName, and openProject.

CvsString CvsProject::m_sUsername [protected]

Definition at line 60 of file CvsProject.h.

Referenced by getProject, and openProject.

The documentation for this class was generated from the following files:
  • WinCvs/CoWorker/CvsProject.h
  • WinCvs/CoWorker/CvsProject.cpp
Generated on Sun Feb 24 01:28:42 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsString Class Reference

#include <CvsString.h>

Collaboration diagram for CvsString:

[legend]
List of all members.

Public Methods

void | requireSize (int)
int | strlen () const
void | strcpy (const char *)
void | strncpy (const char *, int)
void | strcat (const char *)
char & | operator[] (int i)
CvsString & | operator= (const char *s)
CvsString & | operator= (const CvsString &s)
CvsString & | operator+= (const char *s)
CvsString | operator+ (const char *s) const
int | operator== (const char *s) const
operator const char * () const
int | getBufferMax () const
char * | getBuffer ()
CvsString ()
CvsString (const char *s)
CvsString (const CvsString &s)
~CvsString ()

Protected Methods

void | resize (int)

Static Protected Methods

void | recycle (char *, int)

Protected Attributes

char * | m_sBuffer
int | m_cbBufferMax

Constructor & Destructor Documentation

CvsString::CvsString ( ) [inline]

Definition at line 41 of file CvsString.h.

References m_cbBufferMax, m_sBuffer, and strcpy.

00041 : m_sBuffer(0), m_cbBufferMax(0) { strcpy(""); }

CvsString::CvsString ( const char * s ) [inline]

Definition at line 42 of file CvsString.h.

References m_cbBufferMax, m_sBuffer, and strcpy.

00042 : m_sBuffer(0), m_cbBufferMax(0) { strcpy(s); }

CvsString::CvsString ( const CvsString & s ) [inline]

Definition at line 43 of file CvsString.h.

References m_cbBufferMax, m_sBuffer, and strcpy.

00043 : m_sBuffer(0), m_cbBufferMax(0) { strcpy(s); }

CvsString::~CvsString ( )

Definition at line 50 of file CvsString.cpp.

References m_cbBufferMax, m_sBuffer, and recycle.

00051 {
00052     if (m_sBuffer) {
00053         char* p = m_sBuffer;
00054         m_sBuffer = 0;
00055         recycle(p,m_cbBufferMax);
00056     }
00057 }

Member Function Documentation

char* CvsString::getBuffer ( ) [inline]

Definition at line 39 of file CvsString.h.

References m_sBuffer.

Referenced by CvsFilenames::CvsFilenames.

00039 { return m_sBuffer; }

int CvsString::getBufferMax ( ) const [inline]

Definition at line 38 of file CvsString.h.

References m_cbBufferMax.

Referenced by CvsFilenames::getFilename, and CvsFilenames::getOptionsAndFilename.

00038 { return m_cbBufferMax; }

CvsString::operator const char * ( ) const [inline]

Definition at line 36 of file CvsString.h.

References m_sBuffer.

00036 { return m_sBuffer; }

CvsString CvsString::operator+ ( const char * s ) const [inline]

Definition at line 32 of file CvsString.h.

References m_sBuffer, and strcat.

00032 { CvsString v(m_sBuffer); v.strcat(s); return v; }

CvsString& CvsString::operator+= ( const char * s ) [inline]

Definition at line 31 of file CvsString.h.

References strcat.

00031 { strcat(s); return *this; }

CvsString& CvsString::operator= ( const CvsString & s ) [inline]

Definition at line 30 of file CvsString.h.

References strcpy.

00030 { strcpy(s); return *this; }

CvsString& CvsString::operator= ( const char * s ) [inline]

Definition at line 29 of file CvsString.h.

References strcpy.

00029 { strcpy(s); return *this; }

int CvsString::operator== ( const char * s ) const [inline]

Definition at line 34 of file CvsString.h.

References m_sBuffer.

00034 { return 0 == strcmp(m_sBuffer,s); }

char& CvsString::operator[] ( int i ) [inline]

Definition at line 24 of file CvsString.h.

References m_sBuffer, and strlen.

00024                              {
00025         if ((i < 0) || ((int)strlen() <= i)) { static char c; return c; }
00026         return m_sBuffer[i];
00027     }

void CvsString::recycle | ( | char * | ,
 |  | int |
 | ) | [static, protected]

Definition at line 32 of file CvsString.cpp.

References cbQuanta, CheckBuffer, g_pListOfFreeBuffers, and qTRACE.

Referenced by resize, and ~CvsString.

00033 {
00034     CheckBuffer(p,cb);
00035     --p;
00036     if (cbQuanta == cb) {
00037         *(char**)p = g_pListOfFreeBuffers;
00038         g_pListOfFreeBuffers = p;
00039         qTRACE(("* recycle %08lx (%d bytes)",(int)p,cb));
00040     } else {
00041         delete p;
00042         qTRACE(("* recycle %08lx (%d bytes) DELETE",(int)p,cb));
00043     }
00044 }

void CvsString::requireSize ( int ) [inline]

Definition at line 54 of file CvsString.h.

References m_cbBufferMax, and resize.

Referenced by strcat, strcpy, and strncpy.

00055 {
00056     if (m_cbBufferMax < cbNew) {
00057         resize(cbNew);
00058     }
00059 }

void CvsString::resize ( int ) [protected]

Definition at line 63 of file CvsString.cpp.

References ASSERT, cBOB, cbQuanta, cEOB, CheckBuffer, g_pListOfFreeBuffers, m_cbBufferMax, m_sBuffer, qTRACE, and recycle.

Referenced by requireSize.

00064 {
00065     char* sOld      = m_sBuffer;
00066     int cbOld       = m_cbBufferMax;
00067
00068     // upsize to 256 byte quanta
00069     cbNew = (cbNew+255)&~255;
00070
00071     char* pNew = g_pListOfFreeBuffers;
00072     if ((cbQuanta == cbNew) && pNew) {
00073         qTRACE(("* resize %08lx (%d bytes) RECYCLED",(int)pNew,cbNew));
00074         g_pListOfFreeBuffers = *(char**)pNew;
00075         *pNew++         = (char)cBOB;
00076     } else {
00077         pNew = new char[cbNew+2];
00078         qTRACE(("* resize %08lx (%d bytes) NEW",(int)pNew,cbNew));
00079         *pNew++         = (char)cBOB;
00080         *(pNew+cbNew)   = (char)cEOB;
00081     }
00082     memset(pNew,0,cbNew);
00083     CheckBuffer(pNew,cbNew);
00084
00085     m_cbBufferMax   = cbNew;
00086     m_sBuffer       = pNew;
00087
00088     if (sOld) {
00089         ASSERT(cbOld <= cbNew);
00090         memcpy(m_sBuffer,sOld,cbOld);
00091         recycle(sOld,cbOld);
00092     }
00093 }

void CvsString::strcat ( const char * ) [inline]

Definition at line 86 of file CvsString.h.

References m_sBuffer, requireSize, and strlen.

Referenced by operator+, and operator+=.

00087 {
00088     requireSize(strlen()+::strlen(s)+1);
00089     ::strcat(m_sBuffer,s);
00090 }

void CvsString::strcpy ( const char * ) [inline]

Definition at line 65 of file CvsString.h.

References m_sBuffer, requireSize, and strlen.

Referenced by CvsString, CvsFilenames::getOptionsAndFilename, and operator=.

00066 {
00067     requireSize(::strlen(s)+1);
00068     ::strcpy(m_sBuffer,s);
00069 }

int CvsString::strlen ( ) const [inline]

Definition at line 17 of file CvsString.h.

References m_sBuffer.

Referenced by operator[], strcat, and strcpy.

00017 { return ::strlen(m_sBuffer); }

void CvsString::strncpy | ( | const char * | ,
 |  | int |
 | ) | [inline]

Definition at line 75 of file CvsString.h.

References m_sBuffer, and requireSize.

Referenced by CvsFilenames::getOptionsAndFilename.

00076 {
00077     requireSize(n+1);
00078     ::strncpy(m_sBuffer,s,n);
00079     m_sBuffer[n] = 0;
00080 }

Member Data Documentation

int CvsString::m_cbBufferMax [protected]

Definition at line 47 of file CvsString.h.

Referenced by CvsString, getBufferMax, requireSize, resize, and ~CvsString.

char* CvsString::m_sBuffer [protected]

Definition at line 46 of file CvsString.h.

Referenced by CvsString, getBuffer, operator const char *, operator+, operator==, operator[], resize, strcat, strcpy, strlen, strncpy, and ~CvsString.

The documentation for this class was generated from the following files:
  • WinCvs/CoWorker/CvsString.h
  • WinCvs/CoWorker/CvsString.cpp
Generated on Sun Feb 24 01:28:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CvsTrace Class Reference

#include <CvsTrace.h>

Collaboration diagram for CvsTrace:

[legend]
List of all members.

Public Methods

CvsTrace (const char *)
~CvsTrace ()

Private Attributes

const char * m_sOuter

Constructor & Destructor Documentation

CvsTrace::CvsTrace ( const char * )

Definition at line 188 of file CvsTrace.cpp.

References g_nLevel, g_sCurrent, IS_LOGGING, Log_printf, and m_sOuter.

00189 :   m_sOuter(0)
00190 {
00191     // skip if not logging
00192     if (!IS_LOGGING()) {
00193         return;
00194     }
00195     Log_printf("> > %s",s);
00196     {
00197         m_sOuter = g_sCurrent;
00198         g_sCurrent = s;
00199         ++g_nLevel;
00200     }
00201 }

CvsTrace::~CvsTrace ( )

Definition at line 203 of file CvsTrace.cpp.

References g_nLevel, g_sCurrent, IS_LOGGING, Log_printf, and m_sOuter.

00204 {
00205     // skip if not logging
00206     if (!IS_LOGGING()) {
00207         return;
00208     }
00209     const char* s;
00210     {
00211         --g_nLevel;
00212         s = g_sCurrent;
00213         g_sCurrent = m_sOuter;
00214     }
00215     Log_printf("< < %s",s);
00216 }

Member Data Documentation

const char* CvsTrace::m_sOuter [private]

Definition at line 36 of file CvsTrace.h.

Referenced by CvsTrace, and ~CvsTrace.

The documentation for this class was generated from the following files:
  • WinCvs/CoWorker/CvsTrace.h
  • WinCvs/CoWorker/CvsTrace.cpp
Generated on Sun Feb 24 01:28:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UWaitCursor Class Reference

#include <UCvsFrame.h>

List of all members.

Public Methods

UWaitCursor ()
virtual ~UWaitCursor ()

Constructor & Destructor Documentation

UWaitCursor::UWaitCursor ( ) [inline]

Definition at line 78 of file UCvsFrame.h.

References EV_CHGCURSOR, kUCvsFrameID, kUMainWidget, uCursWatch, UEventSendMessage, and UMAKEINT.

00079     {
00080         UEventSendMessage(kUCvsFrameID, EV_CHGCURSOR, UMAKEINT(kUMainWidget, uCursWatch), 0L);
00081     }

virtual UWaitCursor::~UWaitCursor ( ) [inline, virtual]

Definition at line 82 of file UCvsFrame.h.

References EV_CHGCURSOR, kUCvsFrameID, kUMainWidget, uCursArrow, UEventSendMessage, and UMAKEINT.

00083     {
00084         UEventSendMessage(kUCvsFrameID, EV_CHGCURSOR, UMAKEINT(kUMainWidget, uCursArrow), 0L);
00085     }

The documentation for this class was generated from the following file:
  • common/UCvsFrame.h
Generated on Sun Feb 24 01:28:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


UWidget Class Reference

This is the pseudo widget class. More...

#include <uwidget.h>

Inheritance diagram for UWidget:

[legend]
Collaboration diagram for UWidget:

[legend]
List of all members.

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UWidget (int widid)
  • widid unique pseudo widget identifier.
 More...

virtual | ~UWidget ()
virtual void | AddListener (UCmdTarget *listener)
  • listener has the widget events broadcasted to it.
Note:
listener gets destroyed by the widget when it is destroyed.
 More...

virtual int | UDispatchMessage (int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo)
this is overided in order to broadcast to the listeners. More...

void * | GetWidget (int cmd) const
return a sub-widget as inserted by EV_INIT_WIDGET
  • cmd the sub-widget identifier.
Returns:
a native pointer for the sub-widget.
Note:
the native pointer type depends on the platform implementation.
for example on Windows it's a derivated CWnd *.
 More...

std::map< int, void * > & | GetWidgets (void)
return all the sub-widgets inserted by EV_INIT_WIDGET
Returns:
a STL map with a pair of id and native pointer.
 More...

bool | WidgetIsActive (int cmd) const
return true if a widget has the focus ...
  • cmd the sub-widget identifier.
Warning:
only on Win32.
 More...

const char * | GetTooltip (int cmd) const
return the tooltip (i.e. status/nprompt) or 0L if no tooltip associated with this command
  • cmd the sub-widget identifier.
 More...

void | AddTooltip (int cmd, const char *tooltipID)
associate a tooltip with a sub-widget
  • cmd the sub-widget identifier.
  • tooltipID a string.
 More...

void | AddTimer (long lap, int cmd)
timer handling - add a timer.
  • lap in milliseconds.
  • cmd to fire to the pseudo-widget each time the lap expires.
 More...

void | RemoveTimer (int cmd)
timer handling - remove a timer.
  • cmd associated with the timer.
 More...

std::vector< UTimer > & | GetTimers (void)
timer handling - get the timers. Used internally by the event mamanger. More...

bool | DoModal (int id=0)
modality : works only on the top widget and if it is a window
  • id associated dialog id.
Returns:
true -> OK, false -> Cancel.
Note:
the 'id' is significant by platform (on Mac, that is the id view).
 More...

void | EndModal (bool result)
while modaling, allows to quit the interaction
  • result set the return value for DoModal.
 More...

virtual void | DoDataExchange (bool)
while modaling, allows to fill/read the dialog content.
  • fill says if it expects to fill or read the dialog content.
 More...

virtual void | Dismiss (void)
while modaling, allows to detect when the user cancels the dialog. More...

virtual void | BeforeUpdateUI (void)
update user interface handling : before the EV_UPDATEUI get fired, give a chance to all the widgets to cache some computations used for the handling of the event. More...

bool | HasFocus (void)
tells if the pseudo-widget has the focus. More...

bool | HasFocus (int cmdid)
tells if the pseudo-widget and the sub-widget have the focus. More...

void | AddPage (UWidget *page, int pagecmd, int num_page)
map the widgets inside a pseudo tab-page and the pseudo tab-page to the pseudo-widget.
Warning:
not implemented yet on Win32.
 More...

void | OverideMapWidget (int cmdid, CRuntimeClass *widClass)
std::map< int, CRuntimeClass * > & | GetOverideList (void)
CDialog * | GetCurModal () const

Static Public Methods

const URuntimeClass * | rtUWidget (void)
bool | HasModal (void)
tells if any other widget is currently modaling. More...

bool | IsUIValid ()
update user interface handling : check validation says if at this moment the UI is valid (i.e. menus, widgets states are correct). More...

void | DoValidUI (bool how)
update user interface handling : invalidate/validate UI
  • how determines if the UI will be valid.
Note:
if the UI is not valid, the event manager will fire a EV_UPDATEUI event next time it spends time.
Warning:
you generally don't have to use this function since
the pseudo-widgets detect the UI validity automatically.
 More...

int | GetFocus (void)
returns the current pseudo-widget which has the focus
Note:
it is important cause it is used by the event manager
in order to decide which routing for the events.
 More...

int | GetFocusCmd (void)

Protected Methods

int | OnGetState (int cmd)
EV_QUERYSTATE message handling
  • cmd the sub-widget
Returns:
0 or 1 if the widget is checked/pushed...
 More...

void | OnSetState (int cmd, int state)
EV_SETSTATE message handling
  • cmd the sub-widget
  • state of the widget to set (pushed/checked...).
 More...

void | OnEnableCmd (int cmd, int state)
EV_ENABLECMD message handling
  • cmd the sub-widget
  • state of the widget to enable/disable (grayed).
 More...

void | OnChgFocus (int cmd)
EV_CHGFOCUS UWidget message handling
  • cmd the sub-widget to change focus to.
 More...

void | OnInvalidate (int cmd)
EV_INVALIDATE UWidget message handling
  • cmd the sub-widget to redraw (delayed).
 More...

void | OnRedraw (int cmd)
EV_REDRAW UWidget message handling
  • cmd the sub-widget to redraw *now*.
 More...

void | OnSetText (int cmd, const char *text)
EV_SETTEXT message handling
  • cmd the sub-widget
  • text the c-string caption to set.
 More...

void | OnGetText (int cmd, UStr *text)
EV_GETTEXT message handling
  • cmd the sub-widget
  • text is filled with the widget caption.
 More...

void | OnSetFloat (int cmd, const float *f)
EV_SETFLOAT UWidget message handling
  • cmd the sub-widget
  • f the float value the to set.
 More...

void | OnGetFloat (int cmd, float *f)
EV_GETFLOAT UWidget message handling
  • cmd the sub-widget
  • f the float value the to get.
 More...

void | OnInitWidget (int cmd, void *widget)
EV_INIT_WIDGET UWidget message handling
  • cmd the sub-widget
  • widget the native pointer/handle for the sub-widget.
 More...

void | OnInitTabWidget (int cmd, int page, void *widget)
EV_INIT_TAB_WIDGET UWidget message handling
  • cmd the sub-widget page holder
  • page the location for the page insertion
  • widget the native pointer/handle for the sub-widget page
Warning:
not implemented yet on Win32.
 More...

void | OnShowWidget (int cmd, int state)
EV_SHOW message handling
  • cmd the sub-widget
  • state of the widget to show/hide.
 More...

void | OnSetSlider (int cmd, int pos)
EV_SET_SLIDER UWidget message handling
  • cmd the sub-widget
  • pos is the position to set.
 More...

void | OnGetSliderProperty (int cmd, USLIDER *prop)
EV_GET_SLIDERPROP UWidget message handling
  • cmd the sub-widget
  • prop get the informations about this scroller/slider.
 More...

void | OnSetSliderProperty (int cmd, const USLIDER *prop)
EV_SET_SLIDERPROP UWidget message handling
  • cmd the sub-widget
  • prop set the informations about this scroller/slider.
 More...

void | OnSetTooltip (int cmd, UCmdUI *pCmdUI)
EV_USETTOOLTIP message handling
Warning:
not documented.
 More...

void | OnGetLoc (int cmd, URECT *r)
EV_UGETLLOC message handling
  • cmd the sub-widget
  • r get the position of the widget relative to its parent.
 More...

void | OnSetLoc (int cmd, const URECT *r)
EV_USETLLOC message handling
  • cmd the sub-widget
  • r set the position of the widget relative to its parent.
 More...

void | OnChgCursor (int cmd, UCURSOR cursor)
EV_CHGCURSOR UWidget message handling
  • cmd the sub-widget
  • cursor to use in this sub-widget
Warning:
GTK only and limited implementation.
 More...

void | OnUpdateUI (void)
EV_UPDATEUI is a notification sent to all the widgets when the user interface is invalid. the default is to send a EV_UPDTCMD to each sub-widget. More...

void | OnTreeResetAll (int cmd)
EV_TREE_RESETALL UWidget message handling. More...

void | OnTreeInsert (int cmd, UTREE_INSERT *data)
EV_TREE_INSERT UWidget message handling. More...

void | OnTreeGetInfo (int cmd, UTREE_INFO *data)
EV_TREE_GETINFO UWidget message handling. More...

void | OnTreeSetData (int cmd, UTREE_INFO *data)
EV_TREE_SETDATA UWidget message handling. More...

void | OnTreeSetIcon (int cmd, UTREE_INFO *data)
EV_TREE_SETICON UWidget message handling. More...

void | OnTreeDelete (int cmd, UTREEITEM item)
EV_TREE_DELETE UWidget message handling. More...

void | OnTreeExpand (int cmd, int collapse, UTREEITEM item)
EV_TREE_EXPAND UWidget message handling. More...

void | OnTreeSelect (int cmd, int deselect, UTREEITEM item)
EV_TREE_SELECT UWidget message handling. More...

void | OnTreeGetSel (int cmd, UTREEITEM *item)
EV_TREE_GETSEL UWidget message handling. More...

void | OnListAddColumns (int cmd, int num)
EV_LIST_ADDCOLUMNS UWidget message handling. More...

void | OnListSetColTitle (int cmd, int num, const char *title)
EV_LIST_SETCOLTITLE UWidget message handling. More...

void | OnListSetColWidth (int cmd, int num, int width)
EV_LIST_SETCOLWIDTH UWidget message handling. More...

void | OnListResetAll (int cmd)
EV_LIST_RESETALL UWidget message handling. More...

void | OnListAddSel (int cmd, int entry)
EV_LIST_ADDSEL UWidget message handling. More...

void | OnListDelRow (int cmd, int row)
EV_LIST_DELROW UWidget message handling. More...

void | OnListSetFeedback (int cmd, int turnOn)
EV_LIST_SETFEEDBACK UWidget message handling. More...

void | OnListNewRow (int cmd, int *num)
EV_LIST_NEWROW UWidget message handling. More...

void | OnListRowSetData (int cmd, int row, void *data)
EV_LIST_ROWSETDATA UWidget message handling. More...

void | OnListRowGetData (int cmd, int row, void **data)
EV_LIST_ROWGETDATA UWidget message handling. More...

void | OnListInsert (int cmd, ULIST_INSERT *data)
EV_LIST_INSERT UWidget message handling. More...

void | OnListGetInfo (int cmd, ULIST_INFO *desc)
EV_LIST_GETINFO UWidget message handling. More...

int | OnListGetNextSel (int cmd, int selectedCell)
EV_LIST_GETNEXTSEL UWidget message handling. More...

int | OnListGetNext (int cmd, int whichCell)
EV_LIST_GETNEXT UWidget message handling. More...

void | OnListResort (int cmd, int column, UListSorter s)
EV_LIST_RESORT UWidget message handling. More...

void | OnComboResetAll (int cmd)
EV_COMBO_RESETALL UWidget message handling. More...

void | OnComboAppend (int cmd, const char *txt)
EV_COMBO_APPEND UWidget message handling. More...

void | OnComboSetPos (int cmd, int sel)
EV_COMBO_SETSEL UWidget message handling. More...

int | OnComboGetPos (int cmd, UStr *txt)
EV_COMBO_GETSEL UWidget message handling. More...

int | OnComboGetCount (int cmd)
EV_COMBO_GETCOUNT UWidget message handling. More...

void | OnComboDelSel (int cmd, int sel)
EV_COMBO_DELSEL UWidget message handling. More...

void | OnComboEnableSel (int cmd, int sel, int state)
EV_COMBO_ENABLESEL UWidget message handling
Warning:
not implemented on Win32.
 More...

void | OnComboGetMenu (int cmd, UMENU *menu)
EV_COMBO_ENABLESEL UWidget message handling. More...

void | OnSmartComboSetFeature (int cmd, int feature)
EV_SMARTCOMBO_SETFEATURE UWidget message handling. More...

void | OnSmartComboSetItems (int cmd, CMString *items)
EV_SMARTCOMBO_SETITEMS UWidget message handling. More...

void | OnSmartComboSetReadOnly (int cmd, bool readOnly)
EV_SMARTCOMBO_SETREADONLY UWidget message handling. More...

int | OnUpdateFocus (int leave, void *widget)
EV_UPDATEFOCUS UWidget message handling. More...

int | OnFetchCmd (int cmd, void *widget)
EV_FETCHCMD UWidget message handling. More...

void | OnPageChanged (int cmd, int pagenum)
EV_PAGE UWidget message handling. More...

virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Protected Attributes

std::vector< UCmdTarget * > m_listeners
std::map< int, void * > | m_widgets
std::map< int, UStr > | m_tooltips
std::vector< UTimer > m_timers
std::map< int, UWidget * > | m_tabs
bool | m_modalRes
int | m_currentPage
CDialog * m_curModal
std::map< int, CRuntimeClass * > | m_overide
bool | m_noDispatch

Static Protected Attributes

const URuntimeClass | classUWidget
bool | sValidMenu = false
int | sFocusWidID = -1
int | sFocusCmdID
const UMSGMAP | messageMap = { UCmdTarget ::GetThisMessageMap(), & UWidget ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Friends

LRESULT | UWinPseudoWindowProc (CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam)

Detailed Description

This is the pseudo widget class.

The pseudo widget class allows to access mapped widgets (using the event EV_INIT_WIDGET) and to manipulate them (i.e. set the caption, visible state...). By derivating this class, you can also take advantage of features like modaling dialogs, timers...

Definition at line 109 of file uwidget.h.

Constructor & Destructor Documentation

UWidget::UWidget ( int widid )

  • widid unique pseudo widget identifier.

Definition at line 697 of file uwidget.cpp.

References NEW, and qMacPP.

00697                           : UCmdTarget(widid), m_currentPage(-1)
00698 #if qGTK || qMacPP
00699     , m_modalLoop(false)
00700 #endif
00701 #ifdef WIN32
00702     , m_curModal(0L), m_noDispatch(false)
00703 #endif
00704 {
00705 #if qMacAPP
00706     static bool firstTime = true;
00707     if(firstTime)
00708     {
00709         firstTime = false;
00710         gDispatcher->AddBehavior(new TPseudoAppBehavior);
00711             // this behavior takes care about menu routing and giving time
00712             // to the pseudo-events.
00713         new UMacAppMenu();
00714             // for MacApp, we can create automatically the pseudo menu handling.
00715     }
00716 #endif
00717 #if qMacPP
00718     static bool firstTime = true;
00719     if(firstTime && LCommander::GetTopCommander() != 0L)
00720     {
00721         firstTime = false;
00722         LCommander::GetTopCommander()->AddAttachment(NEW LMainPseudoAttachment());
00723     }
00724 #endif
00725 }

UWidget::~UWidget ( ) [virtual]

Definition at line 727 of file uwidget.cpp.

References HasFocus, m_listeners, m_tabs, and sFocusWidID.

00728 {
00729     std::vector<UCmdTarget *>::iterator i;
00730     for(i = m_listeners.begin(); i != m_listeners.end(); ++i)
00731     {
00732         delete *i;
00733     }
00734     std::map<int, UWidget *>::iterator j;
00735     for(j = m_tabs.begin(); j != m_tabs.end(); ++j)
00736     {
00737         delete (*j).second;
00738     }
00739     if(HasFocus())
00740         sFocusWidID = -1;
00741 }

Member Function Documentation

const URuntimeClass * UWidget::_GetBaseClass ( ) [static, protected]

Reimplemented from UCmdTarget.

Reimplemented in UMacAppMenu.

Definition at line 83 of file uwidget.cpp.

void UWidget::AddListener ( UCmdTarget * listener ) [virtual]

  • listener has the widget events broadcasted to it.
Note:
listener gets destroyed by the widget when it is destroyed.

Definition at line 743 of file uwidget.cpp.

References m_listeners.

00744 {
00745     m_listeners.push_back(listener);
00746 }

void UWidget::AddPage | ( | UWidget * | page,
 |  | int | pagecmd,
 |  | int | num_page
 | ) |

map the widgets inside a pseudo tab-page and the pseudo tab-page to the pseudo-widget.

Warning:
not implemented yet on Win32.

Definition at line 3548 of file uwidget.cpp.

References EV_INIT_TAB_WIDGET, EV_PAGE_CHANGED, GetWidget, UCmdTarget::GetWidID, kUMainWidget, m_tabs, UEventSendMessage, and UMAKEINT.

03549 {
03550     void *wid = GetWidget(kUMainWidget);
03551     if(wid == 0L)
03552         return;
03553
03554     UEventSendMessage(page->GetWidID(), EV_INIT_TAB_WIDGET, UMAKEINT(pagecmd, num_page), wid);
03555     std::map<int, UWidget *>::value_type val(UMAKEINT(pagecmd, num_page), page);
03556     m_tabs.insert(val);
03557
03558 #if qMacPP
03559     // emulate the click in tab 1
03560     if(num_page == 0)
03561     {
03562         // emulate the click in tab 1
03563         UEventSendMessage(GetWidID(), EV_PAGE_CHANGED, UMAKEINT(pagecmd, num_page), 0L);
03564     }
03565 #endif /* qMacPP */
03566 }

void UWidget::AddTimer | ( | long | lap,
 |  | int | cmd
 | ) |

timer handling - add a timer.

  • lap in milliseconds.
  • cmd to fire to the pseudo-widget each time the lap expires.

Definition at line 1892 of file uwidget.cpp.

References m_timers, and UTickCount.

Referenced by UCvsApp::UCvsApp.

01893 {
01894     UTimer timer(lap, ::UTickCount(), cmd);
01895     m_timers.push_back(timer);
01896 }

void UWidget::AddTooltip | ( | int | cmd,
 |  | const char * | tooltipID
 | ) |

associate a tooltip with a sub-widget

  • cmd the sub-widget identifier.
  • tooltipID a string.

Definition at line 889 of file uwidget.cpp.

References m_tooltips.

00890 {
00891     std::map<int, UStr>::value_type val(cmd, UStr(tooltipID));
00892     m_tooltips.insert(val);
00893 }

virtual void UWidget::BeforeUpdateUI ( void ) [inline, virtual]

update user interface handling : before the EV_UPDATEUI get fired, give a chance to all the widgets to cache some computations used for the handling of the event.

Definition at line 199 of file uwidget.h.

Referenced by UEventGiveTime.

00199 {}

virtual void UWidget::Dismiss ( void ) [inline, virtual]

while modaling, allows to detect when the user cancels the dialog.

Definition at line 178 of file uwidget.h.

Referenced by DoModal.

00178 {}

virtual void UWidget::DoDataExchange ( bool ) [inline, virtual]

while modaling, allows to fill/read the dialog content.

  • fill says if it expects to fill or read the dialog content.

Reimplemented in UPromptMessage.

Definition at line 175 of file uwidget.h.

Referenced by CPseudoDlg::DoDataExchange, DoModal, and OnPageChanged.

00175 {}

bool UWidget::DoModal ( int id = 0 )

modality : works only on the top widget and if it is a window

  • id associated dialog id.
Returns:
true -> OK, false -> Cancel.
Note:
the 'id' is significant by platform (on Mac, that is the id view).

Definition at line 1938 of file uwidget.cpp.

References Dismiss, DoDataExchange, EV_INIT_WIDGET, EV_PAGE_CHANGED, GetWidget, UCmdTarget::GetWidID, kUMainWidget, m_curModal, m_modalRes, m_tabs, TRUE, UAppConsole, UEventSendMessage, UHIWORD, ULOWORD, and UMAKEINT.

Referenced by AskCreatePersistentSettings, AuthenGserver::DoSettings, AuthenKserver::DoSettings, AuthenRhosts::DoSettings, AuthenPserver::DoSettings, and AuthenSSH::DoSettings.

01939 {
01940     bool result = false;
01941
01942 #if !defined(qMacAPP) && !defined(qMacPP) && !defined(WIN32)
01943     void *w = GetWidget(kUMainWidget);
01944     if(w == 0L)
01945     {
01946         UAppConsole("Unable to find widget id : %d (file %s:%d)\n", kUMainWidget, __FILE__, __LINE__);
01947         return result;
01948     }
01949 #endif // !qMacAPP && !WIN32
01950
01951 #if qGTK || qMacPP
01952     if(m_modalLoop)
01953     {
01954         UAppConsole("Trying to break a modal state\n");
01955         return result;
01956     }
01957 #endif
01958
01959 #ifdef WIN32
01960     CPseudoDlg dlg(id, this);
01961     m_curModal = &dlg;
01962     result = dlg.DoModal() == IDOK;
01963     if(!result)
01964         Dismiss();
01965     m_curModal = 0L;
01966 #endif
01967 #if qMacAPP
01968     TWindow *view = gViewServer->NewTemplateWindow(id, nil);
01969     ThrowIfNULL_AC(view);
01970
01971     UEventSendMessage(GetWidID(), EV_INIT_WIDGET, kUMainWidget, view);
01972
01973     DoDataExchange(true);
01974     IDType resid = view->PoseModally();
01975
01976     TDialogBehavior* dlgb;
01977     if((dlgb = view->GetDialogBehavior()) != 0L)
01978     {
01979         result = resid == dlgb->fDefaultItem;
01980     }
01981
01982     if(result)
01983         DoDataExchange(false);
01984     else
01985         Dismiss();
01986
01987     view->Close();
01988 #endif
01989 #if qMacPP
01990     StDialogHandler theHandler(id, LCommander::GetTopCommander());
01991     LWindow *theDialog = theHandler.GetDialog();
01992
01993     if(theDialog != 0L)
01994     {
01995         UEventSendMessage(GetWidID(), EV_INIT_WIDGET, kUMainWidget, theDialog);
01996
01997         DoDataExchange(true);
01998         theDialog->Show();
01999         theHandler.SetSleepTime(0);
02000
02001         m_modalLoop = true;
02002         MessageT hitMessage;
02003         while (m_modalLoop)
02004         {       // Let DialogHandler process events
02005             hitMessage = theHandler.DoDialog();
02006
02007             if (hitMessage == msg_OK || hitMessage == msg_Cancel)
02008                 break;
02009         }
02010
02011         result = m_modalLoop ? hitMessage == msg_OK : m_modalRes;
02012
02013         if(result)
02014             DoDataExchange(false);
02015         else
02016             Dismiss();
02017
02018         //theDialog->Hide();
02019         //theDialog->DoClose();
02020     }
02021 #endif
02022 #if qGTK
02023     if(GTK_IS_WINDOW(w))
02024     {
02025         // emulate the click in tab 1
02026         std::map<int, UWidget *>::iterator i;
02027         for(i = m_tabs.begin(); i != m_tabs.end(); ++i)
02028         {
02029             int cmdid = ULOWORD((*i).first);
02030             int pagenum = UHIWORD((*i).first);
02031             if(pagenum == 0)
02032             {
02033                 UEventSendMessage(GetWidID(), EV_PAGE_CHANGED, UMAKEINT(cmdid, pagenum), 0L);
02034                 break;
02035             }
02036         }
02037         gtk_signal_connect(GTK_OBJECT(w),"delete_event", GTK_SIGNAL_FUNC(gtkcancel), this);
02038         DoDataExchange(true);
02039         gtk_widget_show(GTK_WIDGET(w));
02040         m_modalLoop = true;
02041         gtk_grab_add (GTK_WIDGET(w));
02042         while (m_modalLoop)
02043         {
02044             gtk_main_iteration_do(TRUE);
02045         }
02046         gtk_grab_remove (GTK_WIDGET(w));
02047         result = m_modalRes;
02048         if(result)
02049         {
02050             UEventSendMessage(GetWidID(), EV_PAGE_CHANGED, UMAKEINT(0, -1), 0L);
02051             DoDataExchange(false);
02052         }
02053         else
02054             Dismiss();
02055         gtk_widget_destroy(GTK_WIDGET(w));
02056     }
02057     else
02058         g_warning("Trying to modal on a non-window\n");
02059 #endif
02060
02061     return result;
02062 }

void UWidget::DoValidUI ( bool how ) [static]

update user interface handling : invalidate/validate UI

  • how determines if the UI will be valid.
Note:
if the UI is not valid, the event manager will fire a EV_UPDATEUI event next time it spends time.
Warning:
you generally don't have to use this function since
the pseudo-widgets detect the UI validity automatically.

Definition at line 153 of file uwidget.cpp.

References sValidMenu.

Referenced by TPseudoAppBehavior::DoSetupMenus, LMainPseudoAttachment::ExecuteSelf, UCvsApp::OnMainTimer, UEventGiveTime, and UWinPseudoWindowProc.

00153 { sValidMenu = how; }

void UWidget::EndModal ( bool result )

while modaling, allows to quit the interaction

  • result set the return value for DoModal.

Definition at line 2064 of file uwidget.cpp.

References GetWidget, kUMainWidget, m_curModal, m_modalRes, TRUE, and UAppConsole.

Referenced by UPromptMessage::OnCancel, and UPromptMessage::OnOK.

02065 {
02066     m_modalRes = result;
02067 #if qGTK || qMacPP
02068     if(!m_modalLoop)
02069         UAppConsole("EndModal called twice\n");
02070
02071     m_modalLoop = false;
02072 #endif
02073 #if qMacAPP
02074     void *w = GetWidget(kUMainWidget);
02075     if(w == 0L)
02076         return;
02077
02078     TWindow *wind = (TWindow *)w;
02079     TDialogBehavior* dlgb;
02080     if(MA_MEMBER(wind, TWindow) && (dlgb = wind->GetDialogBehavior()) != 0L)
02081     {
02082         wind->Dismiss(result ? dlgb->fDefaultItem : dlgb->fCancelItem, result);
02083     }
02084 #endif
02085 #ifdef WIN32
02086     if(m_curModal != 0L)
02087     {
02088         if (result && !m_curModal->UpdateData(TRUE))
02089         {
02090             TRACE0("UpdateData failed during dialog termination.\n");
02091             // the UpdateData routine will set focus to correct item
02092             return;
02093         }
02094         m_curModal->EndDialog(result ? IDOK : IDCANCEL);
02095     }
02096 #endif
02097 }

const UMSGMAP * UWidget::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UCmdTarget.

Reimplemented in UMacAppMenu.

Definition at line 85 of file uwidget.cpp.

CDialog* UWidget::GetCurModal ( ) const [inline]

Definition at line 224 of file uwidget.h.

00224 { return m_curModal; }

int UWidget::GetFocus ( void ) [static]

returns the current pseudo-widget which has the focus

Note:
it is important cause it is used by the event manager
in order to decide which routing for the events.

Definition at line 154 of file uwidget.cpp.

References sFocusWidID.

Referenced by LMainPseudoAttachment::ExecuteSelf, and UMacAppMenu::OnUpdateUI.

00154 { return sFocusWidID; }

int UWidget::GetFocusCmd ( void ) [static]

Definition at line 155 of file uwidget.cpp.

References sFocusCmdID.

00155 { return sFocusCmdID; }

const UMSGMAP * UWidget::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UCmdTarget.

Reimplemented in UMacAppMenu.

Definition at line 85 of file uwidget.cpp.

std::map<int, CRuntimeClass *>& UWidget::GetOverideList ( void ) [inline]

Definition at line 220 of file uwidget.h.

Referenced by WinInitWidgets.

00220 { return m_overide; }

const URuntimeClass * UWidget::GetRuntimeClass ( ) const [virtual]

Reimplemented from UCmdTarget.

Reimplemented in UMacAppMenu.

Definition at line 83 of file uwidget.cpp.

const UMSGMAP * UWidget::GetThisMessageMap ( ) [static, protected]

Reimplemented from UCmdTarget.

Reimplemented in UMacAppMenu.

Definition at line 85 of file uwidget.cpp.

std::vector< UTimer > & UWidget::GetTimers ( void )

timer handling - get the timers. Used internally by the event mamanger.

Definition at line 1911 of file uwidget.cpp.

References m_timers.

Referenced by UEventGiveTime.

01912 {
01913     // removed the delayed items
01914     std::vector<UTimer>::iterator i;
01915     for(i = m_timers.begin(); i != m_timers.end(); ++i)
01916     {
01917         if((*i).m_cmd == 0)
01918         {
01919             m_timers.erase(i);
01920             break;
01921         }
01922     }
01923
01924     return m_timers;
01925 }

const char * UWidget::GetTooltip ( int cmd ) const

return the tooltip (i.e. status/nprompt) or 0L if no tooltip associated with this command

  • cmd the sub-widget identifier.

Definition at line 769 of file uwidget.cpp.

References m_tooltips, and UAppConsole.

Referenced by OnSetTooltip.

00770 {
00771     std::map<int, UStr>::const_iterator i = m_tooltips.find(cmd);
00772     if(i == m_tooltips.end())
00773     {
00774         UAppConsole("Unable to find widget id : %d (file %s:%d)\n", cmd, __FILE__, __LINE__);
00775         return 0L;
00776     }
00777     return (*i).second;
00778 }

void * UWidget::GetWidget ( int cmd ) const

return a sub-widget as inserted by EV_INIT_WIDGET

  • cmd the sub-widget identifier.
Returns:
a native pointer for the sub-widget.
Note:
the native pointer type depends on the platform implementation.
for example on Windows it's a derivated CWnd *.

Definition at line 758 of file uwidget.cpp.

References m_widgets, and UAppConsole.

Referenced by AddPage, UCvsGraph::CalcImageSize, DoModal, EndModal, UCvsConsole::FeedThisLine, macpp_getattachwindow, OnChgCursor, OnChgFocus, OnComboAppend, OnComboDelSel, OnComboEnableSel, OnComboGetCount, OnComboGetMenu, OnComboGetPos, OnComboResetAll, OnComboSetPos, UCvsConsole::OnCreate, UCvsGraph::OnDrawing, OnEnableCmd, OnGetFloat, OnGetLoc, OnGetSliderProperty, OnGetState, OnGetText, OnInvalidate, OnListAddColumns, OnListAddSel, OnListDelRow, OnListGetInfo, OnListGetNext, OnListGetNextSel, OnListInsert, OnListNewRow, OnListResetAll, OnListResort, OnListRowGetData, OnListRowSetData, OnListSetColTitle, OnListSetColWidth, OnListSetFeedback, OnPageChanged, OnRedraw, OnSetFloat, OnSetLoc, OnSetSlider, OnSetSliderProperty, OnSetState, OnSetText, OnShowWidget, OnSmartComboSetFeature, OnSmartComboSetItems, OnSmartComboSetReadOnly, UToolbar::OnTbButton, UToolbar::OnTbCheckBtn, UToolbar::OnTbInit, UToolbar::OnTbSeparator, OnTreeDelete, OnTreeExpand, OnTreeGetInfo, OnTreeGetSel, OnTreeInsert, OnTreeResetAll, OnTreeSelect, OnTreeSetData, OnTreeSetIcon, UToolbar::OnUpdateUI, UCvsConsole::OutColor, UCreate_pixmap, UMenuAddPulldown, UWinPseudoWindowProc, and WidgetIsActive.

00759 {
00760     std::map<int, void *>::const_iterator i = m_widgets.find(cmd);
00761     if(i == m_widgets.end())
00762     {
00763         UAppConsole("Unable to find widget id : %d (file %s:%d)\n", cmd, __FILE__, __LINE__);
00764         return 0L;
00765     }
00766     return (*i).second;
00767 }

std::map<int, void *>& UWidget::GetWidgets ( void ) [inline]

return all the sub-widgets inserted by EV_INIT_WIDGET

Returns:
a STL map with a pair of id and native pointer.

Definition at line 133 of file uwidget.h.

Referenced by CPseudoDlg::DoDataExchange, findIdForWnd, UWinPseudoWindowProc, and CPseudoDlg::~CPseudoDlg.

00133 { return m_widgets; }

bool UWidget::HasFocus ( int cmdid ) [inline]

tells if the pseudo-widget and the sub-widget have the focus.

Definition at line 211 of file uwidget.h.

References UCmdTarget::GetWidID.

00211 { return GetFocus() == GetWidID() && GetFocusCmd() == cmdid; }

bool UWidget::HasFocus ( void ) [inline]

tells if the pseudo-widget has the focus.

Definition at line 208 of file uwidget.h.

References UCmdTarget::GetWidID.

Referenced by UCvsFolders::DisableGeneric, UCvsFiles::DisableGeneric, and ~UWidget.

00208 { return GetFocus() == GetWidID(); }

bool UWidget::HasModal ( void ) [static]

tells if any other widget is currently modaling.

Definition at line 3518 of file uwidget.cpp.

References UObject::IsKindOf, STD, UEventGetTargets, and URUNTIME_CLASS.

03519 {
03520 #if qGTK
03521     const STD map<int, UCmdTarget *> & targets = UEventGetTargets();
03522     STD map<int, UCmdTarget *>::const_iterator i;
03523     for(i = targets.begin(); i != targets.end(); ++i)
03524     {
03525         UCmdTarget *target = (*i).second;
03526         if(!target->IsKindOf(URUNTIME_CLASS(UWidget)))
03527             continue;
03528
03529         UWidget *wid = (UWidget *)target;
03530         if(wid->m_modalLoop)
03531             return true;
03532     }
03533 #endif
03534     return false;
03535 }

bool UWidget::IsUIValid ( ) [static]

update user interface handling : check validation says if at this moment the UI is valid (i.e. menus, widgets states are correct).

Definition at line 152 of file uwidget.cpp.

References sValidMenu.

Referenced by UEventGiveTime.

00152 { return sValidMenu; }

void UWidget::OnChgCursor | ( | int | cmd,
 |  | UCURSOR | cursor
 | ) | [protected]

EV_CHGCURSOR UWidget message handling

  • cmd the sub-widget
  • cursor to use in this sub-widget
Warning:
GTK only and limited implementation.

Definition at line 2099 of file uwidget.cpp.

References GetWidget, uCursArrow, UCURSOR, and uCursWatch.

02100 {
02101     void *w = GetWidget(cmd);
02102     if(w == 0L)
02103         return;
02104
02105 #if qGTK
02106     if(GTK_IS_WIDGET(w) && GTK_WIDGET(w)->window != 0L)
02107     {
02108         static GdkCursor *cursor_arrow;
02109         static GdkCursor *cursor_watch;
02110         if(cursor_arrow == 0L)
02111         {
02112             cursor_arrow = gdk_cursor_new (GDK_ARROW);
02113             cursor_watch = gdk_cursor_new (GDK_WATCH);
02114         }
02115         if(cursor == uCursArrow)
02116             gdk_window_set_cursor (GTK_WIDGET(w)->window, cursor_arrow);
02117         else if(cursor == uCursWatch)
02118             gdk_window_set_cursor (GTK_WIDGET(w)->window, cursor_watch);
02119     }
02120 #endif
02121 }

void UWidget::OnChgFocus ( int cmd ) [protected]

EV_CHGFOCUS UWidget message handling

  • cmd the sub-widget to change focus to.

Definition at line 1437 of file uwidget.cpp.

References GetWidget.

01438 {
01439     void *w = GetWidget(cmd);
01440     if(w == 0L)
01441         return;
01442
01443 #if qMacPP
01444     LPane *pane = (LPane *)w;
01445     LCommander *target = dynamic_cast<LCommander *>(pane);
01446     if(target != 0L)
01447     {
01448         LCommander::SwitchTarget(target);
01449     }
01450 #endif
01451 #if qMacAPP
01452     TView *view = (TView *)w;
01453     if(MA_MEMBER(view, TView))
01454     {
01455         if(view->GetWindow() != 0L)
01456             view->GetWindow()->SetWindowTarget(view);
01457     }
01458 #endif
01459 #if qGTK
01460     if(GTK_IS_WIDGET(w))
01461     {
01462         gtk_widget_grab_focus(GTK_WIDGET(w)); // TODO doesn't work
01463     }
01464 #endif
01465 #ifdef WIN32
01466     CWnd *wnd = (CWnd *)w;
01467
01468     wnd->SetFocus();
01469 #endif
01470 }

void UWidget::OnComboAppend | ( | int | cmd,
 |  | const char * | txt
 | ) | [protected]

EV_COMBO_APPEND UWidget message handling.

Definition at line 2426 of file uwidget.cpp.

References free, GetWidget, UCmdTarget::GetWidID, gpointer, strdup, and UMAKEINT.

02427 {
02428     void *w = GetWidget(cmd);
02429     if(w == 0L)
02430         return;
02431
02432 #ifdef WIN32
02433     CWnd *wnd = (CWnd *)w;
02434
02435     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02436     {
02437         CComboBox *combo = (CComboBox *)wnd;
02438         combo->InsertString(-1, txt);
02439     }
02440 #endif
02441 #if qGTK
02442     if(GTK_IS_COMBO(w))
02443     {
02444         GtkWidget *list = GTK_COMBO(w)->list;
02445         GtkWidget *list_item = gtk_list_item_new_with_label(txt);
02446         gtk_container_add( GTK_CONTAINER(list), list_item );
02447         gtk_widget_show( list_item );
02448
02449         gtk_signal_connect( GTK_OBJECT(list_item), "select",
02450                             GTK_SIGNAL_FUNC(gtkcomboclicked), (gpointer)UMAKEINT(GetWidID(), cmd) );
02451     }
02452     else if(GTK_IS_OPTION_MENU(w))
02453     {
02454         GtkWidget *menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(w));
02455         GtkWidget *item = gtk_menu_item_new_with_label(txt);
02456         // fix me: where to find the label of the item ?
02457         gtk_object_set_data_full(GTK_OBJECT(item), "rf_menuitemtext", strdup(txt), (GtkDestroyNotify)free);
02458         gtk_signal_connect (GTK_OBJECT(item), "activate",
02459             GTK_SIGNAL_FUNC(gtkmenuactivated), (gpointer)UMAKEINT(GetWidID(), cmd));
02460         gtk_widget_show(item);
02461         gtk_menu_append(GTK_MENU(menu), item);
02462     }
02463 #endif
02464 #if qMacPP
02465     LPane *view = (LPane *)w;
02466     LMenuController *popup;
02467     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02468     {
02469         USemaphore policeman(gTurnOffBroadcast);
02470
02471         if(strcmp(txt, "-") == 0)
02472             popup->InsertMenuItem("\p(-", max_Int16, false);
02473         else
02474             popup->InsertMenuItem(LStr255(txt), max_Int16);
02475     }
02476 #endif
02477 #if qMacAPP
02478     TView *view = (TView *)w;
02479     if(MA_MEMBER(view, TPopup))
02480     {
02481         TPopup *popup = (TPopup *)view;
02482         if(strcmp(txt, "-") == 0)
02483             popup->AddSeparator();
02484         else
02485             popup->AddItem(CStr255_AC(txt));
02486     }
02487 #endif
02488 }

void UWidget::OnComboDelSel | ( | int | cmd,
 |  | int | sel
 | ) | [protected]

EV_COMBO_DELSEL UWidget message handling.

Definition at line 2537 of file uwidget.cpp.

References GetWidget.

02538 {
02539     void *w = GetWidget(cmd);
02540     if(w == 0L)
02541         return;
02542
02543 #ifdef WIN32
02544     CWnd *wnd = (CWnd *)w;
02545
02546     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02547     {
02548         CComboBox *combo = (CComboBox *)wnd;
02549         combo->DeleteString(sel);
02550     }
02551 #endif
02552 #if qMacPP
02553     LPane *view = (LPane *)w;
02554     LMenuController *popup;
02555     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02556     {
02557         USemaphore policeman(gTurnOffBroadcast);
02558
02559         popup->DeleteMenuItem(sel + 1);
02560     }
02561 #endif
02562 }

void UWidget::OnComboEnableSel | ( | int | cmd,
 |  | int | sel,
 |  | int | state
 | ) | [protected]

EV_COMBO_ENABLESEL UWidget message handling

Warning:
not implemented on Win32.

Definition at line 2564 of file uwidget.cpp.

References GetWidget.

02565 {
02566     void *w = GetWidget(cmd);
02567     if(w == 0L)
02568         return;
02569
02570 #ifdef WIN32
02571     CWnd *wnd = (CWnd *)w;
02572
02573     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02574     {
02575     }
02576 #endif
02577 #if qMacPP
02578     LPane *view = (LPane *)w;
02579     LMenuController *popup;
02580     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02581     {
02582         if(state)
02583             ::EnableMenuItem(popup->GetMacMenuH(), sel + 1);
02584         else
02585             ::DisableMenuItem(popup->GetMacMenuH(), sel + 1);
02586     }
02587 #endif
02588 }

int UWidget::OnComboGetCount ( int cmd ) [protected]

EV_COMBO_GETCOUNT UWidget message handling.

Definition at line 2677 of file uwidget.cpp.

References GetWidget.

02678 {
02679     int res = 0; // sanity
02680
02681     void *w = GetWidget(cmd);
02682     if(w == 0L)
02683         return res;
02684
02685 #ifdef WIN32
02686     CWnd *wnd = (CWnd *)w;
02687
02688     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02689     {
02690         CComboBox *combo = (CComboBox *)wnd;
02691         res = combo->GetCount();
02692     }
02693 #endif
02694 #if qMacAPP
02695     TView *view = (TView *)w;
02696     if(MA_MEMBER(view, TPopup))
02697     {
02698         TPopup *popup = (TPopup *)view;
02699         res = popup->GetNumberOfItems();
02700     }
02701 #endif
02702 #if qMacPP
02703     LPane *view = (LPane *)w;
02704     LMenuController *popup;
02705     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02706     {
02707         res = ::CountMenuItems(popup->GetMacMenuH());
02708     }
02709 #endif
02710
02711     return res;
02712 }

void UWidget::OnComboGetMenu | ( | int | cmd,
 |  | UMENU * | menu
 | ) | [protected]

EV_COMBO_ENABLESEL UWidget message handling.

Definition at line 2590 of file uwidget.cpp.

References GetWidget, UMENU, and UMENU_NULL.

02591 {
02592     *menu = UMENU_NULL; // sanity
02593
02594     void *w = GetWidget(cmd);
02595     if(w == 0L)
02596         return;
02597
02598 #ifdef WIN32
02599     CWnd *wnd = (CWnd *)w;
02600
02601     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02602     {
02603     }
02604 #endif
02605 #if qMacPP
02606     LPane *view = (LPane *)w;
02607     LMenuController *popup;
02608     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02609     {
02610         MenuHandle hdl = popup->GetMacMenuH();
02611         if(hdl != 0L)
02612 #   if ACCESSOR_CALLS_ARE_FUNCTIONS
02613             *menu = GetMenuID(hdl);
02614 #   else
02615             *menu = (**hdl).menuID;
02616 #   endif
02617     }
02618 #endif
02619 }

int UWidget::OnComboGetPos | ( | int | cmd,
 |  | UStr * | txt
 | ) | [protected]

EV_COMBO_GETSEL UWidget message handling.

Definition at line 2621 of file uwidget.cpp.

References GetWidget.

02622 {
02623     int res = -1; // sanity
02624     if(txt != 0L)
02625         *txt = "";
02626
02627     void *w = GetWidget(cmd);
02628     if(w == 0L)
02629         return res;
02630
02631 #ifdef WIN32
02632     CWnd *wnd = (CWnd *)w;
02633
02634     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02635     {
02636         CComboBox *combo = (CComboBox *)wnd;
02637         res = combo->GetCurSel();
02638         if(res != -1 && txt != 0L)
02639         {
02640             CString s;
02641             combo->GetLBText(res, s);
02642             *txt = s;
02643         }
02644     }
02645 #endif
02646 #if qMacAPP
02647     TView *view = (TView *)w;
02648     if(MA_MEMBER(view, TPopup))
02649     {
02650         TPopup *popup = (TPopup *)view;
02651         res = popup->GetCurrentItem() - 1;
02652         if(txt != 0L)
02653         {
02654             CStr255_AC pstr = popup->GetItemText(res + 1);
02655             *txt = pstr;
02656         }
02657     }
02658 #endif
02659 #if qMacPP
02660     LPane *view = (LPane *)w;
02661     LMenuController *popup;
02662     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02663     {
02664         res = popup->GetCurrentMenuItem() - 1;
02665         if(txt != 0L)
02666         {
02667             LStr255 pstr;
02668             popup->GetMenuItemText(res + 1, pstr);
02669             *txt = pstr;
02670         }
02671     }
02672 #endif
02673
02674     return res;
02675 }

void UWidget::OnComboResetAll ( int cmd ) [protected]

EV_COMBO_RESETALL UWidget message handling.

Definition at line 2369 of file uwidget.cpp.

References GetWidget.

02370 {
02371     void *w = GetWidget(cmd);
02372     if(w == 0L)
02373         return;
02374
02375 #ifdef WIN32
02376     CWnd *wnd = (CWnd *)w;
02377
02378     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02379     {
02380         CComboBox *combo = (CComboBox *)wnd;
02381         combo->ResetContent();
02382     }
02383 #endif
02384 #if qGTK
02385     if(GTK_IS_COMBO(w))
02386     {
02387         GtkList *listbox = GTK_LIST( GTK_COMBO(w)->list );
02388         if(listbox && listbox->children != 0L)
02389             gtk_list_remove_items( listbox, g_list_copy(listbox->children));
02390     }
02391     else if(GTK_IS_OPTION_MENU(w))
02392     {
02393         GtkWidget *menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(w));
02394         GList *list = g_list_copy(GTK_MENU_SHELL(menu)->children);
02395         GList *head = list;
02396         while(list != 0L)
02397         {
02398             GtkWidget *wid = GTK_WIDGET(list->data);
02399             gtk_container_remove(GTK_CONTAINER(menu), wid);
02400             list = (GList *)g_list_next(list);
02401         }
02402         g_list_free(head);
02403     }
02404 #endif
02405 #if qMacPP
02406     LPane *view = (LPane *)w;
02407     LMenuController *popup;
02408     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02409     {
02410         USemaphore policeman(gTurnOffBroadcast);
02411
02412         popup->DeleteAllMenuItems();
02413     }
02414 #endif
02415 #if qMacAPP
02416     TView *view = (TView *)w;
02417     if(MA_MEMBER(view, TPopup))
02418     {
02419         TPopup *popup = (TPopup *)view;
02420         while(popup->GetNumberOfItems() > 0)
02421             popup->DeleteItem(1);
02422     }
02423 #endif
02424 }

void UWidget::OnComboSetPos | ( | int | cmd,
 |  | int | sel
 | ) | [protected]

EV_COMBO_SETSEL UWidget message handling.

Definition at line 2490 of file uwidget.cpp.

References GetWidget.

02491 {
02492     void *w = GetWidget(cmd);
02493     if(w == 0L)
02494         return;
02495
02496 #ifdef WIN32
02497     CWnd *wnd = (CWnd *)w;
02498
02499     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02500     {
02501         CComboBox *combo = (CComboBox *)wnd;
02502         combo->SetCurSel(sel);
02503     }
02504 #endif
02505 #if qGTK
02506     if(GTK_IS_COMBO(w))
02507     {
02508         GtkWidget *list = GTK_COMBO(w)->list;
02509         gtk_list_select_item(GTK_LIST(list), sel);
02510     }
02511     else if(GTK_IS_OPTION_MENU(w))
02512     {
02513         gtk_option_menu_set_history (GTK_OPTION_MENU(w), sel);
02514     }
02515
02516 #endif
02517 #if qMacAPP
02518     TView *view = (TView *)w;
02519     if(MA_MEMBER(view, TPopup))
02520     {
02521         TPopup *popup = (TPopup *)view;
02522         popup->SetCurrentItem(sel + 1, true);
02523     }
02524 #endif
02525 #if qMacPP
02526     LPane *view = (LPane *)w;
02527     LMenuController *popup;
02528     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02529     {
02530         USemaphore policeman(gTurnOffBroadcast);
02531
02532         popup->SetCurrentMenuItem(sel + 1);
02533     }
02534 #endif
02535 }

void UWidget::OnEnableCmd | ( | int | cmd,
 |  | int | state
 | ) | [protected]

EV_ENABLECMD message handling

  • cmd the sub-widget
  • state of the widget to enable/disable (grayed).

Definition at line 1404 of file uwidget.cpp.

References GetWidget.

01405 {
01406     void *w = GetWidget(cmd);
01407     if(w == 0L)
01408         return;
01409
01410 #if qMacPP
01411     LPane *view = (LPane *)w;
01412     if(state)
01413         view->Enable();
01414     else
01415         view->Disable();
01416 #endif
01417 #if qMacAPP
01418     TView *view = (TView *)w;
01419     if(MA_MEMBER(view, TView))
01420     {
01421         view->SetActiveState(state != 0, true);
01422     }
01423 #endif
01424 #if qGTK
01425     if(GTK_IS_WIDGET(w))
01426     {
01427         gtk_widget_set_sensitive(GTK_WIDGET(w), state != 0);
01428     }
01429 #endif
01430 #ifdef WIN32
01431     CWnd *wnd = (CWnd *)w;
01432
01433     wnd->EnableWindow(state != 0);
01434 #endif
01435 }

int UWidget::OnFetchCmd | ( | int | cmd,
 |  | void * | widget
 | ) | [protected]

EV_FETCHCMD UWidget message handling.

Definition at line 3537 of file uwidget.cpp.

References m_widgets.

03538 {
03539     std::map<int, void *>::const_iterator i;
03540     for(i = m_widgets.begin(); i != m_widgets.end(); ++i)
03541     {
03542         if(widget == (*i).second)
03543             return (*i).first;
03544     }
03545     return -1;
03546 }

void UWidget::OnGetFloat | ( | int | cmd,
 |  | float * | f
 | ) | [protected]

EV_GETFLOAT UWidget message handling

  • cmd the sub-widget
  • f the float value the to get.

Definition at line 1195 of file uwidget.cpp.

References TPseudoDoubleNumberText::GetValue, GetWidget, and stat.

01196 {
01197     *f = 0.0; // sanity
01198
01199     void *w = GetWidget(cmd);
01200     if(w == 0L)
01201         return;
01202
01203 #if qMacPP
01204     LPane *view = (LPane *)w;
01205     LEditText *edit;
01206     LStaticText *stat;
01207     if((edit = dynamic_cast<LEditText *>(view)) != 0L)
01208     {
01209         LStr255 pstr;
01210         edit->GetText(pstr);
01211         *f = (double)pstr;
01212     }
01213     else if((stat = dynamic_cast<LStaticText *>(view)) != 0L)
01214     {
01215         LStr255 pstr;
01216         stat->GetText(pstr);
01217         *f = (double)pstr;
01218     }
01219 #endif
01220 #if qMacAPP
01221     TView *view = (TView *)w;
01222     if(MA_MEMBER(view, TPseudoDoubleNumberText))
01223     {
01224         TPseudoDoubleNumberText *num = (TPseudoDoubleNumberText *)view;
01225         *f = num->GetValue();
01226     }
01227 #endif
01228 #ifdef WIN32
01229     CWnd *wnd = (CWnd *)w;
01230
01231     CString s;
01232     wnd->GetWindowText(s);
01233     sscanf(s, "%f", f);
01234 #endif
01235 }

void UWidget::OnGetLoc | ( | int | cmd,
 |  | URECT * | r
 | ) | [protected]

EV_UGETLLOC message handling

  • cmd the sub-widget
  • r get the position of the widget relative to its parent.

Definition at line 780 of file uwidget.cpp.

References URECT::bottom, GetWidget, URECT::left, URECT::right, and URECT::top.

00781 {
00782     r->left = 0; // sanity
00783     r->right = 0;
00784     r->top = 0;
00785     r->bottom = 0;
00786
00787     void *w = GetWidget(cmd);
00788     if(w == 0L)
00789         return;
00790
00791 #if qMacAPP
00792     TView *view = (TView *)w;
00793     CViewRect mr = view->GetFrame();
00794     view->SuperViewToLocal(mr);
00795     view->LocalToRootView(mr);
00796     r->left = mr.left;
00797     r->right = mr.right;
00798     r->top = mr.top;
00799     r->bottom = mr.bottom;
00800 #endif
00801 #if qMacPP
00802     LPane *view = (LPane *)w;
00803     SPoint32 outLocation;
00804     SDimension16 outSize;
00805     view->GetFrameLocation(outLocation);
00806     view->GetFrameSize(outSize);
00807
00808     *r = URect(UPoint(outLocation.h, outLocation.v), USize(outSize.width, outSize.height));
00809 #endif
00810 #ifdef WIN32
00811     CRect mr;
00812     CWnd *wnd = (CWnd *)w;
00813     wnd->GetClientRect(mr);
00814     CWnd *parent = wnd->GetParent();
00815     if(parent != 0L)
00816     {
00817         wnd->ClientToScreen(mr);
00818         parent->ScreenToClient(mr);
00819     }
00820     r->left = mr.left;
00821     r->right = mr.right;
00822     r->top = mr.top;
00823     r->bottom = mr.bottom;
00824 #endif
00825 }

void UWidget::OnGetSliderProperty | ( | int | cmd,
 |  | USLIDER * | prop
 | ) | [protected]

EV_GET_SLIDERPROP UWidget message handling

  • cmd the sub-widget
  • prop get the informations about this scroller/slider.

Definition at line 1775 of file uwidget.cpp.

References LPseudoWinAttachment::GetPageValue, GetWidget, USLIDER::inc, macpp_getattachwindow, USLIDER::max, USLIDER::min, USLIDER::pos, and VERIFY.

01776 {
01777     void *w = GetWidget(cmd);
01778     if(w == 0L)
01779         return;
01780
01781 #ifdef WIN32
01782     CWnd *wnd = (CWnd *)w;
01783
01784     if(wnd->IsKindOf(RUNTIME_CLASS(CSliderCtrl)))
01785     {
01786         CSliderCtrl *slider = (CSliderCtrl *)wnd;
01787         prop->max = slider->GetRangeMax();
01788         prop->min = slider->GetRangeMin();
01789         prop->inc = slider->GetPageSize();
01790         prop->pos = slider->GetPos();
01791     }
01792     else if(wnd->IsKindOf(RUNTIME_CLASS(CScrollBar)))
01793     {
01794         SCROLLINFO info;
01795         CScrollBar *scroll = (CScrollBar *)wnd;
01796         VERIFY(scroll->GetScrollInfo(&info));
01797         prop->max = info.nMax;
01798         prop->min = info.nMin;
01799         prop->inc = info.nPage;
01800         prop->pos = info.nPos;
01801     }
01802 #endif
01803 #if qMacAPP
01804     TView *view = (TView *)w;
01805     if(MA_MEMBER(view, TSlider) || MA_MEMBER(view, TScrollBar))
01806     {
01807         TCtlMgr *ctrl = (TCtlMgr *)view;
01808         prop->max = ctrl->GetMaximum();
01809         prop->min = ctrl->GetMinimum();
01810         if(MA_MEMBER(ctrl, TPseudoScrollBar))
01811             prop->inc = ((TPseudoScrollBar *)ctrl)->fPageStep;
01812         else
01813             prop->inc = 1;
01814         prop->pos = ctrl->GetValue();
01815     }
01816 #endif
01817 #if qMacPP
01818     LPane *view = (LPane *)w;
01819     LControl *ctrl;
01820     if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01821     {
01822         prop->max = ctrl->GetMaxValue();
01823         prop->min = ctrl->GetMinValue();
01824         LPseudoWinAttachment *attach = macpp_getattachwindow(this);
01825         prop->inc = attach != 0L ? attach->GetPageValue(cmd) : 1;
01826         prop->pos = ctrl->GetValue();
01827     }
01828 #endif
01829 }

int UWidget::OnGetState ( int cmd ) [protected]

EV_QUERYSTATE message handling

  • cmd the sub-widget
Returns:
0 or 1 if the widget is checked/pushed...

Definition at line 1072 of file uwidget.cpp.

References gchar, CPseudoRotButton::GetCurrent, UPseudoRotButton::GetCurrentState, CPseudoToggle::GetState, GetWidget, and stat.

01073 {
01074     void *w = GetWidget(cmd);
01075     if(w == 0L)
01076         return 0;
01077
01078     int state = 0; // sanity
01079
01080 #ifdef WIN32
01081     CWnd *wnd = (CWnd *)w;
01082
01083     if(wnd->IsKindOf(RUNTIME_CLASS(CPseudoRotButton)))
01084     {
01085         CPseudoRotButton *btn = (CPseudoRotButton *)wnd;
01086         state = btn->GetCurrent();
01087     }
01088     else if(wnd->IsKindOf(RUNTIME_CLASS(CPseudoToggle)))
01089     {
01090         CPseudoToggle *btn = (CPseudoToggle *)wnd;
01091         state = btn->GetState();
01092     }
01093     else if(wnd->IsKindOf(RUNTIME_CLASS(CButton)))
01094     {
01095         CButton *btn = (CButton *)wnd;
01096         state = btn->GetCheck() != 0;
01097     }
01098     else
01099     {
01100         CString s;
01101         wnd->GetWindowText(s);
01102         sscanf(s, "%d", &state);
01103     }
01104 #endif
01105 #if qGTK
01106     if(GTK_IS_TOGGLE_BUTTON(w))
01107     {
01108         state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)) != 0;
01109     }
01110     else if(GTK_IS_ENTRY(w))
01111     {
01112         gchar *text = gtk_entry_get_text(GTK_ENTRY(w));
01113         sscanf(text, "%d", &state);
01114     }
01115 #endif
01116 #if qMacPP
01117     LPane *view = (LPane *)w;
01118     LCheckBox *check;
01119     LRadioButton *rad;
01120     LEditText *edit;
01121     LStaticText *stat;
01122     LBevelButton *bevel;
01123     UPseudoRotButton *rot;
01124     LCheckBoxGroupBox *groupbox;
01125     LPageController *tabctrl;
01126     LTabsControl *tabctrl2;
01127     LControl *ctrl;
01128     if((check = dynamic_cast<LCheckBox *>(view)) != 0L)
01129     {
01130         state = check->GetValue() == Button_On ? 1 : 0;
01131     }
01132     else if((rad = dynamic_cast<LRadioButton *>(view)) != 0L)
01133     {
01134         state = rad->GetValue() == Button_On ? 1 : 0;
01135     }
01136     else if((edit = dynamic_cast<LEditText *>(view)) != 0L)
01137     {
01138         LStr255 pstr;
01139         edit->GetText(pstr);
01140         state = (SInt32)pstr;
01141     }
01142     else if((stat = dynamic_cast<LStaticText *>(view)) != 0L)
01143     {
01144         LStr255 pstr;
01145         stat->GetText(pstr);
01146         state = (SInt32)pstr;
01147     }
01148     else if((groupbox = dynamic_cast<LCheckBoxGroupBox *>(view)) != 0L)
01149     {
01150         state = groupbox->GetValue() == Button_On ? 1 : 0;
01151     }
01152     else if((rot = dynamic_cast<UPseudoRotButton *>(view)) != 0L)
01153     {
01154         state = rot->GetCurrentState();
01155     }
01156     else if((bevel = dynamic_cast<LBevelButton *>(view)) != 0L)
01157     {
01158         state = bevel->GetValue() == Button_On ? 1 : 0;
01159     }
01160     else if((tabctrl = dynamic_cast<LPageController *>(view)) != 0L)
01161     {
01162         state = tabctrl->GetCurrentPageIndex() - 1;
01163     }
01164     else if((tabctrl2 = dynamic_cast<LTabsControl *>(view)) != 0L)
01165     {
01166         state = tabctrl2->GetValue() - 1;
01167     }
01168     else if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01169     {
01170         state = ctrl->GetValue();
01171     }
01172 #endif
01173 #if qMacAPP
01174     TView *view = (TView *)w;
01175     if(MA_MEMBER(view, TCheckBox))
01176     {
01177         TCheckBox *check = (TCheckBox *)view;
01178         state = check->GetState();
01179     }
01180     else if(MA_MEMBER(view, TRadio))
01181     {
01182         TRadio *rad = (TRadio *)view;
01183         state = rad->GetState();
01184     }
01185     else if(MA_MEMBER(view, TNumberText))
01186     {
01187         TNumberText *num = (TNumberText *)view;
01188         state = num->GetValue();
01189     }
01190 #endif
01191
01192     return state;
01193 }

void UWidget::OnGetText | ( | int | cmd,
 |  | UStr * | text
 | ) | [protected]

EV_GETTEXT message handling

  • cmd the sub-widget
  • text is filled with the widget caption.

Definition at line 1606 of file uwidget.cpp.

References gchar, getLabelFromContainer, GetWidget, and UStr::set.

01607 {
01608     *text = ""; // sanity
01609
01610     void *w = GetWidget(cmd);
01611     if(w == 0L)
01612         return;
01613
01614 #ifdef WIN32
01615     CWnd *wnd = (CWnd *)w;
01616
01617     CString s;
01618     wnd->GetWindowText(s);
01619     *text = s;
01620 #endif
01621 #if qGTK
01622     if(GTK_IS_WINDOW(w))
01623     {
01624         *text = GTK_WINDOW(w)->title;
01625     }
01626     else if(GTK_IS_BUTTON(w))
01627     {
01628         GtkLabel *label = getLabelFromContainer(GTK_CONTAINER(w));
01629         if(label != 0L)
01630         {
01631             gchar *str;
01632             gtk_label_get(label, &str);
01633             if(str != 0L)
01634                 *text = str;
01635         }
01636         else
01637             g_warning("Cannot find the label of '%s'\n", gtk_widget_get_name(GTK_WIDGET(w)));
01638     }
01639     else if(GTK_IS_ENTRY(w))
01640     {
01641         *text = gtk_entry_get_text(GTK_ENTRY(w));
01642     }
01643     else if(GTK_IS_COMBO(w))
01644     {
01645         *text = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(w)->entry));
01646     }
01647     else if(GTK_IS_TEXT(w))
01648     {
01649         GtkText *t = GTK_TEXT(w);
01650         size_t size = gtk_text_get_length(t);
01651         if(size > 0)
01652             text->set((char *)t->text.ch, size);
01653     }
01654     else if(GTK_IS_LABEL(w))
01655     {
01656         GtkLabel *t = GTK_LABEL(w);
01657         gchar *str;
01658         gtk_label_get(t, &str);
01659         if(str != 0L)
01660             *text = str;
01661     }
01662 #endif
01663 #if qMacPP
01664     LPane *view = (LPane *)w;
01665     LTextEditView *txt;
01666     if((txt = dynamic_cast<LTextEditView *>(view)) != 0L)
01667     {
01668         LStr255 pstr;
01669         Handle hdl = txt->GetTextHandle();
01670         text->set((const char *)*hdl, ::GetHandleSize(hdl));
01671     }
01672     else
01673     {
01674         LStr255 pstr;
01675         view->GetDescriptor(pstr);
01676         *text = pstr;
01677     }
01678 #endif
01679 #if qMacAPP
01680     TView *view = (TView *)w;
01681     if(MA_MEMBER(view, TCtlMgr))
01682     {
01683         TCtlMgr *ctrl = (TCtlMgr *)view;
01684         CStr255_AC pstr = ctrl->GetText();
01685         *text = pstr;
01686     }
01687     else if(MA_MEMBER(view, TStaticText))
01688     {
01689         TStaticText *ctrl = (TStaticText *)view;
01690         CStr255_AC pstr = ctrl->GetText();
01691         *text = pstr;
01692     }
01693     else if(MA_MEMBER(view, TWindow))
01694     {
01695         TWindow *ctrl = (TWindow *)view;
01696         CStr255_AC pstr = ctrl->GetTitle();
01697         *text = pstr;
01698     }
01699 #endif
01700 }

void UWidget::OnInitTabWidget | ( | int | cmd,
 |  | int | page,
 |  | void * | widget
 | ) | [protected]

EV_INIT_TAB_WIDGET UWidget message handling

  • cmd the sub-widget page holder
  • page the location for the page insertion
  • widget the native pointer/handle for the sub-widget page
Warning:
not implemented yet on Win32.

Definition at line 1060 of file uwidget.cpp.

References UCmdTarget::GetWidID, and gpointer.

01061 {
01062 #if qGTK
01063     if(GTK_IS_WIDGET(widget))
01064     {
01065         // extract and map to the pseudo widget the sub-widgets begining with 'kUgtkPrefixToken'
01066         _dataTabForeach data = {GetWidID(), cmd, page};
01067         g_datalist_foreach (&GTK_OBJECT(widget)->object_data, dataTabForeach, (gpointer)&data);
01068     }
01069 #endif /* qGTK */
01070 }

void UWidget::OnInitWidget | ( | int | cmd,
 |  | void * | widget
 | ) | [protected]

EV_INIT_WIDGET UWidget message handling

  • cmd the sub-widget
  • widget the native pointer/handle for the sub-widget.

Definition at line 895 of file uwidget.cpp.

References EV_CREATE, UCmdTarget::GetWidID, gpointer, USemaphore::IsEnteredTwice, TPseudoWinAdorner::kPseudoWinAdorner, TPseudoWinBehavior::kPseudoWinBehavior, kUMainWidget, m_widgets, macpp_fecthview, macpp_linkbroadcasters, NEW, NULL, TPseudoWinAdorner::SetPseudoWidget, TPseudoWinBehavior::SetPseudoWidget, UEventSendMessage, and UMAKEINT.

00896 {
00897     std::map<int, void *>::value_type val(cmd, widget);
00898     m_widgets.insert(val);
00899
00900 #ifdef WIN32
00901
00902 #endif
00903 #if qMacPP
00904     LPane *view = (LPane *)widget;
00905     if(view != 0L)
00906     {
00907         // fetch the inside widgets and add them the the widget list
00908         static bool sSemaphore = false;
00909         USemaphore policeman(sSemaphore);
00910         if(!policeman.IsEnteredTwice())
00911         {
00912             macpp_fecthview(GetWidID(), view);
00913         }
00914
00915         LWindow *wind = dynamic_cast<LWindow*>(view);
00916         if(wind != 0L)
00917         {
00918             LPseudoWinAttachment *attach = NEW LPseudoWinAttachment(GetWidID());
00919             wind->AddAttachment(attach);
00920             macpp_linkbroadcasters(wind, attach);
00921
00922             SPaneInfo inPaneInfo;
00923             memset(&inPaneInfo, 0, sizeof(SPaneInfo));
00924             inPaneInfo.superView = wind;
00925             NEW UPseudoFakePane(inPaneInfo, attach);
00926
00927             // call the create callback
00928             UEventSendMessage(GetWidID(), EV_CREATE, 0, 0L);
00929         }
00930     }
00931 #endif
00932 #if qMacAPP
00933     TView *view = (TView *)widget;
00934     if(MA_MEMBER(view, TView))
00935     {
00936         // fetch the inside widgets and add them the the widget list
00937         static bool sSemaphore = false;
00938         USemaphore policeman(sSemaphore);
00939         if(!policeman.IsEnteredTwice())
00940         {
00941             macapp_fecthview(GetWidID(), view);
00942             //macapp_workaround_adlib_bug(view);
00943         }
00944
00945         if(MA_MEMBER(view, TWindow))
00946         {
00947             // add the pseudo behaviour which re-routes the events to the pseudo-widget
00948             TPseudoWinBehavior *psbehavior = dynamic_cast_AC(TPseudoWinBehavior*,
00949                 view->GetBehaviorWithIdentifier(TPseudoWinBehavior::kPseudoWinBehavior));
00950
00951             if(psbehavior == 0L)
00952             {
00953                 psbehavior = TH_new TPseudoWinBehavior;
00954                 view->AddBehavior(psbehavior);
00955             }
00956             psbehavior->SetPseudoWidget(GetWidID());
00957
00958             // add the pseudo adorner which intercepts the frame size changes
00959             TPseudoWinAdorner *psadorner = dynamic_cast_AC(TPseudoWinAdorner*,
00960                 view->AdornerWithID(TPseudoWinAdorner::kPseudoWinAdorner));
00961
00962             if(psadorner == 0L)
00963             {
00964                 psadorner = TH_new TPseudoWinAdorner;
00965                 view->AddAdorner(psadorner, kAdornLast, false);
00966             }
00967             psadorner->SetPseudoWidget(GetWidID());
00968
00969             // call the create callback
00970             UEventSendMessage(GetWidID(), EV_CREATE, 0, 0L);
00971         }
00972     }
00973 #endif
00974 #if qGTK
00975     static bool firstTime = true;
00976     if(firstTime)
00977     {
00978         // for the disable/enable handling notification (EV_UPDATEUI)
00979         gdk_event_handler_set((GdkEventFunc)gtkmaindoevent, NULL, NULL);
00980
00981         // listen focus events
00982         focus_in_signal_id = gtk_signal_lookup ("focus_in_event", GTK_TYPE_WIDGET);
00983         gtk_signal_add_emission_hook (focus_in_signal_id, gtkeventwatcher, NULL);
00984         focus_out_signal_id = gtk_signal_lookup ("focus_out_event", GTK_TYPE_WIDGET);
00985         gtk_signal_add_emission_hook (focus_out_signal_id, gtkeventwatcher, NULL);
00986
00987         firstTime = false;
00988     }
00989
00990     // so for every widget mapped, we'll be able to find the pseudo-widget associated with.
00991     gtk_object_set_data(GTK_OBJECT(widget), kUgtkDataToken, (gpointer)UMAKEINT(GetWidID(), cmd));
00992
00993     // we are only interesting about the main widgets here
00994     if(GTK_IS_WIDGET(widget))
00995     {
00996         if(cmd == kUMainWidget)
00997         {
00998             // extract and map to the pseudo widget the sub-widgets begining with 'kUgtkPrefixToken'
00999             g_datalist_foreach (&GTK_OBJECT(widget)->object_data, dataForeach, (gpointer)GetWidID());
01000
01001             // map the destroy callback
01002             gtk_signal_connect (GTK_OBJECT(widget), "destroy",
01003                                 GTK_SIGNAL_FUNC(gtkdestroy), (gpointer)this);
01004
01005             gtk_signal_connect (GTK_OBJECT (widget), "key_press_event",
01006                                 GTK_SIGNAL_FUNC(gtkkeypress), (gpointer)this);
01007
01008             // call the create callback
01009             UEventSendMessage(GetWidID(), EV_CREATE, 0, 0L);
01010         }
01011     }
01012
01013     if(GTK_IS_NOTEBOOK(widget))
01014     {
01015         gtk_signal_connect (GTK_OBJECT (widget), "switch_page",
01016                             GTK_SIGNAL_FUNC(gtkswitchpage),
01017                             (gpointer)UMAKEINT(GetWidID(), cmd));
01018     }
01019
01020     if(GTK_IS_BUTTON(widget))
01021     {
01022         gtk_signal_connect (GTK_OBJECT(widget), "clicked",
01023             GTK_SIGNAL_FUNC(gtkclicked), (gpointer)UMAKEINT(GetWidID(), cmd));
01024     }
01025
01026     if(GTK_IS_MENU_ITEM(widget))
01027     {
01028         gtk_signal_connect(GTK_OBJECT(widget), "activate",
01029             GTK_SIGNAL_FUNC(gtkmenuitemactivate), (gpointer)UMAKEINT(GetWidID(), cmd));
01030     }
01031
01032     if(GTK_IS_CLIST(widget))
01033     {
01034         gtk_signal_connect (GTK_OBJECT(widget), "select_row",
01035             GTK_SIGNAL_FUNC(gtkselectclist), (gpointer)UMAKEINT(GetWidID(), cmd));
01036
01037         gtk_signal_connect (GTK_OBJECT(widget), "click_column",
01038             GTK_SIGNAL_FUNC(gtkselectclistcolumn), (gpointer)UMAKEINT(GetWidID(), cmd));
01039
01040         gtk_signal_connect_after (GTK_OBJECT (widget), "button_press_event",
01041                                   GTK_SIGNAL_FUNC (gtkclistdblclick), (gpointer)UMAKEINT(GetWidID(), cmd));
01042     }
01043
01044     if(GTK_IS_DRAWING_AREA(widget))
01045     {
01046         gtk_signal_connect (GTK_OBJECT(widget), "expose_event",
01047                             GTK_SIGNAL_FUNC (gtkexposeevent), (gpointer)UMAKEINT(GetWidID(), cmd));
01048         gtk_widget_set_events (GTK_WIDGET(widget), GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK);
01049     }
01050
01051     if(GTK_IS_LAYOUT(widget))
01052     {
01053         gtk_signal_connect (GTK_OBJECT(widget), "expose_event",
01054                             GTK_SIGNAL_FUNC (gtkexposeevent), (gpointer)UMAKEINT(GetWidID(), cmd));
01055         gtk_widget_set_events (GTK_WIDGET(widget), GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK);
01056     }
01057 #endif /* qGTK */
01058 }

void UWidget::OnInvalidate ( int cmd ) [protected]

EV_INVALIDATE UWidget message handling

  • cmd the sub-widget to redraw (delayed).

Definition at line 1472 of file uwidget.cpp.

References GetWidget.

01473 {
01474     void *w = GetWidget(cmd);
01475     if(w == 0L)
01476         return;
01477
01478 #if qMacAPP
01479     TView *view = (TView *)w;
01480     if(MA_MEMBER(view, TView))
01481     {
01482         view->ForceRedraw();
01483     }
01484 #endif
01485 #if qMacPP
01486     LPane *pane = (LPane *)w;
01487     pane->Refresh();
01488 #endif
01489 #ifdef WIN32
01490     CWnd *wnd = (CWnd *)w;
01491
01492     wnd->Invalidate();
01493 #endif
01494 }

void UWidget::OnListAddColumns | ( | int | cmd,
 |  | int | num
 | ) | [protected]

EV_LIST_ADDCOLUMNS UWidget message handling.

Definition at line 2771 of file uwidget.cpp.

References GetWidget, kUMainWidget, and macpp_preparetable.

02772 {
02773     void *w = GetWidget(cmd);
02774     if(w == 0L)
02775         return;
02776
02777 #if qGTK
02778     if(!GTK_IS_CLIST(w))
02779         return;
02780
02781     //GtkCList *list = GTK_CLIST(w);
02782     // don't know how to do that, for now it relies on glade settings
02783 #endif
02784 #ifdef WIN32
02785     CWnd *wnd = (CWnd *)w;
02786
02787     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
02788     {
02789         CListCtrl *list = (CListCtrl *)wnd;
02790         DWORD dwExStyle = ListView_GetExtendedListViewStyle(list->m_hWnd);
02791         dwExStyle |= LVS_EX_FULLROWSELECT;
02792         ListView_SetExtendedListViewStyle(list->m_hWnd, dwExStyle);
02793
02794         while(num--)
02795             list->InsertColumn(0, "", LVCFMT_LEFT, 80);
02796     }
02797 #endif
02798 #if qMacPP
02799     LPane *view = (LPane *)w;
02800     LOutlineTable *table;
02801     LTextTableView *tabtext;
02802     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
02803     {
02804         macpp_preparetable(table);
02805         table->InsertCols( num, 0, nil, nil, false );
02806     }
02807     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
02808     {
02809         macpp_preparetable(GetWidget(kUMainWidget), tabtext);
02810         tabtext->InsertCols( num, 0, nil, nil, false );
02811     }
02812 #endif
02813 }

void UWidget::OnListAddSel | ( | int | cmd,
 |  | int | entry
 | ) | [protected]

EV_LIST_ADDSEL UWidget message handling.

Definition at line 2945 of file uwidget.cpp.

References GetWidget, and VERIFY.

02946 {
02947     void *w = GetWidget(cmd);
02948     if(w == 0L)
02949         return;
02950
02951 #if qMacAPP
02952     TView *view = (TView *)w;
02953     if(MA_MEMBER(view, TPseudoTextListView))
02954     {
02955         TPseudoTextListView *txt = (TPseudoTextListView *)view;
02956         txt->SelectItem(entry + 1, false, true, true);
02957     }
02958 #endif
02959 #if qGTK
02960     if(!GTK_IS_CLIST(w))
02961         return;
02962
02963     GtkCList *list = GTK_CLIST(w);
02964     gtk_clist_select_row(list, entry, 0);
02965 #endif
02966 #ifdef WIN32
02967     CWnd *wnd = (CWnd *)w;
02968
02969     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
02970     {
02971         CListCtrl *list = (CListCtrl *)wnd;
02972         VERIFY(list->SetItemState(entry, LVIS_SELECTED, LVIS_SELECTED));
02973         VERIFY(list->EnsureVisible(entry, true));
02974     }
02975 #endif
02976 #if qMacPP
02977     LPane *view = (LPane *)w;
02978     LTableView *table;
02979     if((table = dynamic_cast<LTableView *>(view)) != 0L)
02980     {
02981         STableCell cell(entry + 1, 1);
02982         table->SelectCell(cell);
02983         table->ScrollCellIntoFrame(cell);
02984     }
02985 #endif
02986 }

void UWidget::OnListDelRow | ( | int | cmd,
 |  | int | row
 | ) | [protected]

EV_LIST_DELROW UWidget message handling.

Definition at line 2988 of file uwidget.cpp.

References TPseudoTextListView::DelItemAt, GetWidget, and VERIFY.

02989 {
02990     void *w = GetWidget(cmd);
02991     if(w == 0L)
02992         return;
02993
02994 #if qMacAPP
02995     TView *view = (TView *)w;
02996     if(MA_MEMBER(view, TPseudoTextListView))
02997     {
02998         TPseudoTextListView *txt = (TPseudoTextListView *)view;
02999         txt->DelItemAt(entry + 1, 1);
03000     }
03001 #endif
03002 #if qGTK
03003     if(!GTK_IS_CLIST(w))
03004         return;
03005
03006     GtkCList *list = GTK_CLIST(w);
03007     gtk_clist_remove(list, entry);
03008 #endif
03009 #ifdef WIN32
03010     CWnd *wnd = (CWnd *)w;
03011
03012     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03013     {
03014         CListCtrl *list = (CListCtrl *)wnd;
03015         VERIFY(list->DeleteItem(entry));
03016     }
03017 #endif
03018 #if qMacPP
03019     LPane *view = (LPane *)w;
03020     LOutlineTable *table;
03021     LTextTableView *tabtext;
03022     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03023     {
03024         LOutlineItem* item = table->FindItemForRow(entry + 1);
03025         if(item != 0L)
03026         {
03027             table->RemoveItem(item);
03028         }
03029     }
03030     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03031     {
03032         tabtext->RemoveRows(1, entry + 1, true);
03033     }
03034 #endif
03035 }

void UWidget::OnListGetInfo | ( | int | cmd,
 |  | ULIST_INFO * | desc
 | ) | [protected]

EV_LIST_GETINFO UWidget message handling.

Definition at line 3397 of file uwidget.cpp.

References ULIST_INFO::col, ULIST_INFO::data, gchar, TPseudoTextListView::GetItemText, GetWidget, CPseudoItem::m_data, CPseudoItem::m_texts, ULIST_INFO::row, UStr::set, and ULIST_INFO::title.

03398 {
03399     // sanity
03400     desc->data = 0L;
03401     desc->title = 0L;
03402
03403     void *w = GetWidget(cmd);
03404     if(w == 0L)
03405         return;
03406
03407 #if qMacAPP
03408     TView *view = (TView *)w;
03409     if(MA_MEMBER(view, TPseudoTextListView))
03410     {
03411         static UStr cstr; // no good
03412
03413         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03414         CStr255_AC name = txt->GetItemText(desc->row + 1);
03415         cstr = name;
03416         desc->title = cstr;
03417     }
03418 #endif
03419 #if qGTK
03420     if(!GTK_IS_CLIST(w))
03421         return;
03422
03423     GtkCList *list = GTK_CLIST(w);
03424     desc->data = gtk_clist_get_row_data(list, desc->row);
03425     gtk_clist_get_text_is_buggy(list, desc->row, desc->col, (gchar **)&desc->title);
03426 #endif
03427 #ifdef WIN32
03428     CWnd *wnd = (CWnd *)w;
03429
03430     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03431     {
03432         CListCtrl *list = (CListCtrl *)wnd;
03433
03434         desc->data = (void *)list->GetItemData(desc->row);
03435         static CString s;
03436         s = list->GetItemText(desc->row, desc->col);
03437         desc->title = s;
03438     }
03439 #endif
03440 #if qMacPP
03441     LPane *view = (LPane *)w;
03442     LOutlineTable *table;
03443     LTextTableView *tabtext;
03444     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03445     {
03446         LOutlineItem *item = table->FindItemForRow(desc->row + 1);
03447         CPseudoItem *theItem;
03448         if((theItem = dynamic_cast<CPseudoItem *>(item)) != 0L)
03449         {
03450             std::map<int, UStr>::iterator i = theItem->m_texts.find(desc->col + 1);
03451             if(i != theItem->m_texts.end())
03452             {
03453                 desc->title = (*i).second;
03454             }
03455             desc->data = theItem->m_data;
03456         }
03457     }
03458     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03459     {
03460         STableCell cell(desc->row + 1, desc->col + 1);
03461         UInt32 ioDataSize = 255;
03462         char tmp[255];
03463         tabtext->GetCellData(cell, tmp, ioDataSize);
03464         static UStr res;
03465         res.set(tmp, ioDataSize);
03466         desc->title = res;
03467     }
03468 #endif
03469 }

int UWidget::OnListGetNext | ( | int | cmd,
 |  | int | whichCell
 | ) | [protected]

EV_LIST_GETNEXT UWidget message handling.

Definition at line 3261 of file uwidget.cpp.

References GetWidget.

03262 {
03263     void *w = GetWidget(cmd);
03264     if(w == 0L)
03265         return -1;
03266
03267 #if qGTK
03268     if(!GTK_IS_CLIST(w))
03269         return -1;
03270
03271     if(whichCell == -1)
03272         whichCell = 0;
03273     else
03274         whichCell++;
03275
03276     if(whichCell >= GTK_CLIST(w)->rows)
03277         whichCell = -1;
03278
03279     return whichCell;
03280 #endif
03281 #ifdef WIN32
03282     CWnd *wnd = (CWnd *)w;
03283
03284     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03285     {
03286         CListCtrl *list = (CListCtrl *)wnd;
03287         return list->GetNextItem(whichCell, LVNI_ALL);
03288     }
03289 #endif
03290 #if qMacPP
03291     LPane *view = (LPane *)w;
03292     LTableView *table;
03293     if((table = dynamic_cast<LTableView *>(view)) != 0L)
03294     {
03295         STableCell sel;
03296
03297         if(whichCell != -1)
03298         {
03299             sel.row = whichCell + 1;
03300             sel.col = 1;
03301         }
03302
03303         while(table->GetNextCell(sel))
03304         {
03305             if(sel.row != whichCell + 1)
03306                 return sel.row - 1;
03307         }
03308     }
03309 #endif
03310
03311     return -1;
03312 }

int UWidget::OnListGetNextSel | ( | int | cmd,
 |  | int | selectedCell
 | ) | [protected]

EV_LIST_GETNEXTSEL UWidget message handling.

Definition at line 3178 of file uwidget.cpp.

References GetWidget, and gint.

03179 {
03180     void *w = GetWidget(cmd);
03181     if(w == 0L)
03182         return -1;
03183
03184 #if qGTK
03185     if(!GTK_IS_CLIST(w))
03186         return -1;
03187
03188     GList *sel = GTK_CLIST(w)->selection;
03189     if(sel == 0L)
03190         return -1;
03191
03192     while(sel != 0L)
03193     {
03194         gint row = GPOINTER_TO_INT(sel->data);
03195         if(selectedCell == -1)
03196             return row;
03197
03198         sel = (GList *)g_list_next(sel);
03199
03200         if(selectedCell == row)
03201         {
03202             return sel == 0L ? -1 : GPOINTER_TO_INT(sel->data);
03203         }
03204     }
03205 #endif
03206 #if qMacAPP
03207     TView *view = (TView *)w;
03208     if(MA_MEMBER(view, TPseudoTextListView))
03209     {
03210         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03211         if(txt->FirstSelectedItem() == 0)
03212             return -1;
03213
03214         for(GridCoordinate c = 0; c < txt->GetNumOfRows(); ++c)
03215         {
03216             if(!txt->IsItemSelected(c + 1))
03217                 continue;
03218
03219             if(selectedCell == -1)
03220                 return c;
03221
03222             if(selectedCell == c)
03223                 selectedCell = -1; // so the next pick is the one
03224         }
03225     }
03226 #endif
03227 #ifdef WIN32
03228     CWnd *wnd = (CWnd *)w;
03229
03230     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03231     {
03232         CListCtrl *list = (CListCtrl *)wnd;
03233         return list->GetNextItem(selectedCell, LVNI_SELECTED);
03234     }
03235 #endif
03236 #if qMacPP
03237     LPane *view = (LPane *)w;
03238     LTableView *table;
03239     if((table = dynamic_cast<LTableView *>(view)) != 0L)
03240     {
03241         STableCell sel;
03242         if(selectedCell == -1)
03243         {
03244             sel = table->GetFirstSelectedCell();
03245             return sel.row - 1;
03246         }
03247
03248         sel.row = selectedCell + 1;
03249         sel.col = 1;
03250         while(table->GetNextSelectedCell(sel))
03251         {
03252             if(sel.row != selectedCell + 1)
03253                 return sel.row - 1;
03254         }
03255     }
03256 #endif
03257
03258     return -1;
03259 }

void UWidget::OnListInsert | ( | int | cmd,
 |  | ULIST_INSERT * | data
 | ) | [protected]

EV_LIST_INSERT UWidget message handling.

Definition at line 3314 of file uwidget.cpp.

References ULIST_INSERT::col, GetWidget, ULIST_INSERT::icon, TPseudoTextListView::InsStringLast, CPseudoItem::m_texts, ULIST_INSERT::row, and ULIST_INSERT::title.

03315 {
03316     void *w = GetWidget(cmd);
03317     if(w == 0L)
03318         return;
03319
03320 #if qGTK
03321     if(!GTK_IS_CLIST(w))
03322         return;
03323
03324     GtkCList *list = GTK_CLIST(w);
03325
03326     if(data->title == 0L && data->icon == 0L)
03327         g_warning("Got an empty cell !\n");
03328     else if(data->title == 0L)
03329     {
03330         GtkPixmap *pix = GTK_PIXMAP(data->icon);
03331         gtk_clist_set_pixmap(list, data->row, data->col, pix->pixmap, pix->mask);
03332     }
03333     else if(data->icon == 0L)
03334     {
03335         gtk_clist_set_text(list, data->row, data->col, data->title);
03336     }
03337     else
03338     {
03339         GtkPixmap *pix = GTK_PIXMAP(data->icon);
03340         gtk_clist_set_pixtext(list, data->row, data->col, data->title, 2, pix->pixmap, pix->mask);
03341     }
03342 #endif
03343 #if qMacAPP
03344     TView *view = (TView *)w;
03345     if(MA_MEMBER(view, TPseudoTextListView))
03346     {
03347         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03348         //txt->InsStringBefore(data->row + 1, data->title);
03349         txt->InsStringLast(data->title);
03350     }
03351 #endif
03352 #ifdef WIN32
03353     CWnd *wnd = (CWnd *)w;
03354
03355     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03356     {
03357         CListCtrl *list = (CListCtrl *)wnd;
03358         if(data->col == 0)
03359         {
03360             LV_ITEM lvi;
03361             memset(&lvi, 0, sizeof(lvi));
03362             lvi.mask = LVIF_TEXT;
03363             lvi.iItem = data->row;
03364             lvi.iSubItem = 0;
03365             lvi.pszText = (char *)data->title;
03366
03367             list->InsertItem(&lvi);
03368         }
03369         else
03370         {
03371             list->SetItemText(data->row, data->col, data->title);
03372         }
03373     }
03374 #endif
03375 #if qMacPP
03376     LPane *view = (LPane *)w;
03377     LOutlineTable *table;
03378     LTextTableView *tabtext;
03379     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03380     {
03381         LOutlineItem *item = table->FindItemForRow(data->row + 1);
03382         CPseudoItem *theItem;
03383         if((theItem = dynamic_cast<CPseudoItem *>(item)) != 0L)
03384         {
03385             std::map<int, UStr>::value_type val(data->col + 1, UStr(data->title));
03386             theItem->m_texts.insert(val);
03387         }
03388     }
03389     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03390     {
03391         STableCell cell(data->row + 1, data->col + 1);
03392         tabtext->SetCellData(cell, data->title, strlen(data->title));
03393     }
03394 #endif
03395 }

void UWidget::OnListNewRow | ( | int | cmd,
 |  | int * | num
 | ) | [protected]

EV_LIST_NEWROW UWidget message handling.

Definition at line 3055 of file uwidget.cpp.

References gchar, GetWidget, UCmdTarget::GetWidID, and NEW.

03056 {
03057     *num = 0; // sanity
03058
03059     void *w = GetWidget(cmd);
03060     if(w == 0L)
03061         return;
03062
03063 #if qGTK
03064     if(!GTK_IS_CLIST(w))
03065         return;
03066
03067     gchar *emptyTxts[] = {"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""};
03068
03069     GtkCList *list = GTK_CLIST(w);
03070     *num = gtk_clist_append  (list, emptyTxts);
03071 #endif
03072 #if qMacAPP
03073     TView *view = (TView *)w;
03074     if(MA_MEMBER(view, TPseudoTextListView))
03075     {
03076         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03077         *num = txt->GetNumOfRows();
03078     }
03079 #endif
03080 #ifdef WIN32
03081     CWnd *wnd = (CWnd *)w;
03082
03083     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03084     {
03085         CListCtrl *list = (CListCtrl *)wnd;
03086         *num = list->GetItemCount();
03087     }
03088 #endif
03089 #if qMacPP
03090     LPane *view = (LPane *)w;
03091     LOutlineTable *table;
03092     LTextTableView *tabtext;
03093     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03094     {
03095         // Store this information in the list view
03096         CPseudoItem *theItem = NEW CPseudoItem(GetWidID(), cmd);
03097         if(theItem != 0L)
03098         {
03099             TableIndexT outRows, outCols;
03100             table->GetTableSize(outRows, outCols);
03101             // and insert it at the end of the table
03102             LOutlineItem *lastItem = table->FindItemForRow(outRows);
03103             table->InsertItem( theItem, nil, lastItem );
03104             *num = outRows;
03105         }
03106     }
03107     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03108     {
03109         TableIndexT outRows, outCols;
03110         tabtext->GetTableSize(outRows, outCols);
03111         tabtext->InsertRows(1, outRows);
03112         tabtext->AdjustImageSize(false);
03113         *num = outRows;
03114     }
03115 #endif
03116 }

void UWidget::OnListResetAll ( int cmd ) [protected]

EV_LIST_RESETALL UWidget message handling.

Definition at line 2890 of file uwidget.cpp.

References GetWidget, kUMainWidget, macpp_preparetable, TPseudoTextListView::RemoveAll, and VERIFY.

02891 {
02892     void *w = GetWidget(cmd);
02893     if(w == 0L)
02894         return;
02895
02896 #if qGTK
02897     if(!GTK_IS_CLIST(w))
02898         return;
02899
02900     GtkCList *list = GTK_CLIST(w);
02901     gtk_clist_clear(list);
02902 #endif
02903 #if qMacAPP
02904     TView *view = (TView *)w;
02905     if(MA_MEMBER(view, TPseudoTextListView))
02906     {
02907         TPseudoTextListView *txt = (TPseudoTextListView *)view;
02908         txt->RemoveAll();
02909     }
02910 #endif
02911 #if qMacPP
02912     LPane *view = (LPane *)w;
02913     LOutlineTable *table;
02914     LTextTableView *tabtext;
02915     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
02916     {
02917         macpp_preparetable(table);
02918         LArrayIterator iter(table->GetFirstLevelItems());
02919         LOutlineItem* item;
02920         while (iter.Next(&item))
02921         {
02922             table->RemoveItem(item, false, false);
02923         }
02924         table->AdjustImageSize(false);
02925         table->Refresh();
02926     }
02927     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
02928     {
02929         macpp_preparetable(GetWidget(kUMainWidget), tabtext);
02930         tabtext->RemoveAllRows(false);
02931         tabtext->Refresh();
02932     }
02933 #endif
02934 #ifdef WIN32
02935     CWnd *wnd = (CWnd *)w;
02936
02937     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
02938     {
02939         CListCtrl *list = (CListCtrl *)wnd;
02940         VERIFY(list->DeleteAllItems());
02941     }
02942 #endif
02943 }

void UWidget::OnListResort | ( | int | cmd,
 |  | int | column,
 |  | UListSorter | s
 | ) | [protected]

EV_LIST_RESORT UWidget message handling.

Definition at line 3471 of file uwidget.cpp.

References GetWidget, and UListSorter.

03472 {
03473     void *w = GetWidget(cmd);
03474     if(w == 0L)
03475         return;
03476
03477 #if qGTK
03478     if(!GTK_IS_CLIST(w))
03479         return;
03480
03481     GtkCList *list = GTK_CLIST(w);
03482
03483     sGtkClistDiff = s;
03484     sGtkClistWid = this;
03485     gtk_clist_set_compare_func(list, gtkclistdefcompare);
03486     gtk_clist_set_sort_column(list, column);
03487     gtk_clist_sort(list);
03488     gtk_clist_set_compare_func(list, 0L);
03489 #endif
03490 }

void UWidget::OnListRowGetData | ( | int | cmd,
 |  | int | row,
 |  | void ** | data
 | ) | [protected]

EV_LIST_ROWGETDATA UWidget message handling.

Definition at line 3147 of file uwidget.cpp.

References GetWidget, and CPseudoItem::m_data.

03148 {
03149     *data = 0L; // sanity
03150
03151     void *w = GetWidget(cmd);
03152     if(w == 0L)
03153         return;
03154
03155 #if qGTK
03156     if(!GTK_IS_CLIST(w))
03157         return;
03158
03159     GtkCList *list = GTK_CLIST(w);
03160     *data = gtk_clist_get_row_data(list, row);
03161 #endif
03162 #if qMacPP
03163     LPane *view = (LPane *)w;
03164     LOutlineTable *table;
03165     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03166     {
03167         // Store this information in the list view
03168         LOutlineItem *item = table->FindItemForRow(row + 1);
03169         CPseudoItem *theItem;
03170         if((theItem = dynamic_cast<CPseudoItem *>(item)) != 0L)
03171         {
03172             *data = theItem->m_data;
03173         }
03174     }
03175 #endif
03176 }

void UWidget::OnListRowSetData | ( | int | cmd,
 |  | int | row,
 |  | void * | data
 | ) | [protected]

EV_LIST_ROWSETDATA UWidget message handling.

Definition at line 3118 of file uwidget.cpp.

References GetWidget, and CPseudoItem::m_data.

03119 {
03120     void *w = GetWidget(cmd);
03121     if(w == 0L)
03122         return;
03123
03124 #if qGTK
03125     if(!GTK_IS_CLIST(w))
03126         return;
03127
03128     GtkCList *list = GTK_CLIST(w);
03129     gtk_clist_set_row_data(list, num, data);
03130 #endif
03131 #if qMacPP
03132     LPane *view = (LPane *)w;
03133     LOutlineTable *table;
03134     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03135     {
03136         // Store this information in the list view
03137         LOutlineItem *item = table->FindItemForRow(num + 1);
03138         CPseudoItem *theItem;
03139         if((theItem = dynamic_cast<CPseudoItem *>(item)) != 0L)
03140         {
03141             theItem->m_data = data;
03142         }
03143     }
03144 #endif
03145 }

void UWidget::OnListSetColTitle | ( | int | cmd,
 |  | int | num,
 |  | const char * | title
 | ) | [protected]

EV_LIST_SETCOLTITLE UWidget message handling.

Definition at line 2815 of file uwidget.cpp.

References GetWidget, and VERIFY.

02816 {
02817     void *w = GetWidget(cmd);
02818     if(w == 0L)
02819         return;
02820
02821 #if qGTK
02822     if(!GTK_IS_CLIST(w))
02823         return;
02824
02825     GtkCList *list = GTK_CLIST(w);
02826     gtk_clist_set_column_title (list, num, title);
02827 #endif
02828 #ifdef WIN32
02829     CWnd *wnd = (CWnd *)w;
02830
02831     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
02832     {
02833         CListCtrl *list = (CListCtrl *)wnd;
02834         LVCOLUMN col;
02835         memset(&col, 0, sizeof(col));
02836         col.mask = LVCF_TEXT;
02837         col.pszText = (char *)title;
02838         VERIFY(list->SetColumn(num, &col));
02839     }
02840 #endif
02841 }

void UWidget::OnListSetColWidth | ( | int | cmd,
 |  | int | num,
 |  | int | width
 | ) | [protected]

EV_LIST_SETCOLWIDTH UWidget message handling.

Definition at line 2843 of file uwidget.cpp.

References GetWidget, kUMainWidget, macpp_preparetable, and VERIFY.

02844 {
02845     void *w = GetWidget(cmd);
02846     if(w == 0L)
02847         return;
02848
02849 #if qGTK
02850     if(!GTK_IS_CLIST(w))
02851         return;
02852
02853     GtkCList *list = GTK_CLIST(w);
02854     gtk_clist_set_column_width(list, num, width);
02855 #endif
02856 #ifdef WIN32
02857     CWnd *wnd = (CWnd *)w;
02858
02859     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
02860     {
02861         CListCtrl *list = (CListCtrl *)wnd;
02862         LVCOLUMN col;
02863         memset(&col, 0, sizeof(col));
02864         col.mask = LVCF_WIDTH;
02865         col.cx = width;
02866         VERIFY(list->SetColumn(num, &col));
02867     }
02868 #endif
02869 #if qMacPP
02870     LPane *view = (LPane *)w;
02871     LOutlineTable *table;
02872     LTextTableView *tabtext;
02873     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
02874     {
02875         macpp_preparetable(table);
02876         LTableGeometry *geom = table->GetTableGeometry();
02877         if(geom != 0L)
02878             geom->SetColWidth(width, num + 1, num + 1);
02879     }
02880     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
02881     {
02882         macpp_preparetable(GetWidget(kUMainWidget), tabtext);
02883         LTableGeometry *geom = tabtext->GetTableGeometry();
02884         if(geom != 0L)
02885             geom->SetColWidth(width, num + 1, num + 1);
02886     }
02887 #endif
02888 }

void UWidget::OnListSetFeedback | ( | int | cmd,
 |  | int | turnOn
 | ) | [protected]

EV_LIST_SETFEEDBACK UWidget message handling.

Definition at line 3037 of file uwidget.cpp.

References GetWidget.

03038 {
03039     void *w = GetWidget(cmd);
03040     if(w == 0L)
03041         return;
03042
03043 #if qGTK
03044     if(!GTK_IS_CLIST(w))
03045         return;
03046
03047     GtkCList *list = GTK_CLIST(w);
03048     if(turnOn)
03049         gtk_clist_thaw(list);
03050     else
03051         gtk_clist_freeze(list);
03052 #endif
03053 }

void UWidget::OnPageChanged | ( | int | cmd,
 |  | int | pagenum
 | ) | [protected]

EV_PAGE UWidget message handling.

Definition at line 3568 of file uwidget.cpp.

References DoDataExchange, UPseudoPlaceHolder::GetCurrentView, GetWidget, UCmdTarget::GetWidID, LPseudoWinAttachment::InvalidCache, m_currentPage, m_tabs, m_widgets, macpp_fecthview, macpp_getattachwindow, macpp_linkbroadcasters, and UMAKEINT.

03569 {
03570     if(m_currentPage == UMAKEINT(cmdid, num_page))
03571         return;
03572
03573     std::map<int, UWidget *>::iterator i;
03574     if(m_currentPage != -1)
03575     {
03576         i = m_tabs.find(m_currentPage);
03577         if(i != m_tabs.end())
03578         {
03579             UWidget *tab = (*i).second;
03580             tab->DoDataExchange(false);
03581
03582 #if qMacPP
03583             LPseudoWinAttachment *attach = macpp_getattachwindow(this);
03584             if(attach != 0L)
03585             {
03586                 attach->InvalidCache(tab);
03587             }
03588
03589             tab->m_widgets.erase(tab->m_widgets.begin(), tab->m_widgets.end());
03590 #endif /* qMacPP */
03591         }
03592     }
03593
03594     if(num_page == -1)
03595     {
03596         m_currentPage = -1;
03597         return;
03598     }
03599
03600     i = m_tabs.find(UMAKEINT(cmdid, num_page));
03601     if(i != m_tabs.end())
03602     {
03603         UWidget *tab = (*i).second;
03604
03605 #if qMacPP
03606         UPseudoPlaceHolder *holder = dynamic_cast<UPseudoPlaceHolder *>((LPane *)GetWidget(cmdid));
03607         if(holder != 0L)
03608         {
03609             macpp_fecthview(tab->GetWidID(), holder->GetCurrentView());
03610
03611             LPseudoWinAttachment *attach = macpp_getattachwindow(this);
03612             if(attach != 0L)
03613             {
03614                 macpp_linkbroadcasters(holder->GetCurrentView(), attach);
03615             }
03616         }
03617 #endif /* qMacPP */
03618
03619         tab->DoDataExchange(true);
03620     }
03621     m_currentPage = UMAKEINT(cmdid, num_page);
03622 }

void UWidget::OnRedraw ( int cmd ) [protected]

EV_REDRAW UWidget message handling

  • cmd the sub-widget to redraw *now*.

Definition at line 1496 of file uwidget.cpp.

References GetWidget.

01497 {
01498     void *w = GetWidget(cmd);
01499     if(w == 0L)
01500         return;
01501
01502 #if qMacAPP
01503     TView *view = (TView *)w;
01504     if(MA_MEMBER(view, TView))
01505     {
01506         view->ForceRedraw();
01507     }
01508 #endif
01509 #if qMacPP
01510     LPane *pane = (LPane *)w;
01511     pane->Draw(nil);
01512 #endif
01513 #ifdef WIN32
01514     CWnd *wnd = (CWnd *)w;
01515
01516     wnd->Invalidate();
01517 #endif
01518 }

void UWidget::OnSetFloat | ( | int | cmd,
 |  | const float * | f
 | ) | [protected]

EV_SETFLOAT UWidget message handling

  • cmd the sub-widget
  • f the float value the to set.

Definition at line 1363 of file uwidget.cpp.

References GetWidget, m_noDispatch, TPseudoDoubleNumberText::SetValue, and stat.

01364 {
01365     void *w = GetWidget(cmd);
01366     if(w == 0L)
01367         return;
01368
01369 #if qMacAPP
01370     TView *view = (TView *)w;
01371     if(MA_MEMBER(view, TPseudoDoubleNumberText))
01372     {
01373         TPseudoDoubleNumberText *num = (TPseudoDoubleNumberText *)view;
01374         num->SetValue(*f, true);
01375     }
01376 #endif
01377 #if qMacPP
01378     USemaphore policeman(gTurnOffBroadcast);
01379
01380     LPane *view = (LPane *)w;
01381     LEditText *edit;
01382     LStaticText *stat;
01383     if((edit = dynamic_cast<LEditText *>(view)) != 0L)
01384     {
01385         LStr255 pstr((long double)*f, "\p#####.##");
01386         edit->SetText(pstr);
01387     }
01388     else if((stat = dynamic_cast<LStaticText *>(view)) != 0L)
01389     {
01390         LStr255 pstr((long double)*f, "\p#####.##");
01391         stat->SetText(pstr);
01392     }
01393 #endif
01394 #ifdef WIN32
01395     USemaphore policeman(m_noDispatch);
01396     CWnd *wnd = (CWnd *)w;
01397
01398     char tmp[100];
01399     sprintf(tmp, "%f", *f);
01400     wnd->SetWindowText(tmp);
01401 #endif
01402 }

void UWidget::OnSetLoc | ( | int | cmd,
 |  | const URECT * | r
 | ) | [protected]

EV_USETLLOC message handling

  • cmd the sub-widget
  • r set the position of the widget relative to its parent.

Definition at line 827 of file uwidget.cpp.

References URECT::bottom, GetWidget, URect::Height, URECT::left, URECT::right, URECT::top, URect::TopLeft, TRUE, URect::Width, UPOINT::x, and UPOINT::y.

00828 {
00829     void *w = GetWidget(cmd);
00830     if(w == 0L)
00831         return;
00832
00833 #if qMacAPP
00834     TView *view = (TView *)w;
00835     CViewRect mr(r->left, r->top, r->right, r->bottom);
00836     if(mr.right < mr.left)
00837         mr.right = mr.left;
00838     if(mr.bottom < mr.top)
00839         mr.bottom = mr.top;
00840     view->RootViewToLocal(mr);
00841     view->LocalToSuperView(mr);
00842     view->SetFrame(mr, true);
00843 #endif
00844 #if qMacPP
00845     LPane *view = (LPane *)w;
00846     SPoint32 oldLocation;
00847     view->GetFrameLocation(oldLocation);
00848     URect newDim(*r);
00849     UPoint offset = newDim.TopLeft() - UPoint(oldLocation.h, oldLocation.v);
00850     view->ResizeFrameTo(newDim.Width(), newDim.Height(), true);
00851     view->MoveBy(offset.x, offset.y, true);
00852 #endif
00853 #ifdef WIN32
00854     CRect wr(r->left, r->top, r->right, r->bottom);
00855     CWnd *wnd = (CWnd *)w;
00856     wnd->MoveWindow(wr, TRUE);
00857 #endif
00858 }

void UWidget::OnSetSlider | ( | int | cmd,
 |  | int | pos
 | ) | [protected]

EV_SET_SLIDER UWidget message handling

  • cmd the sub-widget
  • pos is the position to set.

Definition at line 1734 of file uwidget.cpp.

References GetWidget.

01735 {
01736     void *w = GetWidget(cmd);
01737     if(w == 0L)
01738         return;
01739
01740 #ifdef WIN32
01741     CWnd *wnd = (CWnd *)w;
01742
01743     if(wnd->IsKindOf(RUNTIME_CLASS(CSliderCtrl)))
01744     {
01745         CSliderCtrl *slider = (CSliderCtrl *)wnd;
01746         slider->SetPos(pos);
01747     }
01748     else if(wnd->IsKindOf(RUNTIME_CLASS(CScrollBar)))
01749     {
01750         CScrollBar *scroll = (CScrollBar *)wnd;
01751         scroll->SetScrollPos(pos);
01752     }
01753 #endif
01754 #if qMacAPP
01755     TView *view = (TView *)w;
01756     if(MA_MEMBER(view, TSlider) || MA_MEMBER(view, TScrollBar))
01757     {
01758         TCtlMgr *ctrl = (TCtlMgr *)view;
01759         ctrl->SetValue(pos, true);
01760     }
01761 #endif
01762 #if qMacPP
01763     USemaphore policeman(gTurnOffBroadcast);
01764
01765     LPane *view = (LPane *)w;
01766     LControl *ctrl;
01767     if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01768     {
01769         ctrl->SetValue(pos);
01770     }
01771 #endif
01772 }

void UWidget::OnSetSliderProperty | ( | int | cmd,
 |  | const USLIDER * | prop
 | ) | [protected]

EV_SET_SLIDERPROP UWidget message handling

  • cmd the sub-widget
  • prop set the informations about this scroller/slider.

Definition at line 1831 of file uwidget.cpp.

References GetWidget, USLIDER::inc, macpp_getattachwindow, USLIDER::max, USLIDER::min, USLIDER::pos, LPseudoWinAttachment::SetPageValue, TRUE, and VERIFY.

01832 {
01833     void *w = GetWidget(cmd);
01834     if(w == 0L)
01835         return;
01836
01837 #ifdef WIN32
01838     CWnd *wnd = (CWnd *)w;
01839
01840     if(wnd->IsKindOf(RUNTIME_CLASS(CSliderCtrl)))
01841     {
01842         CSliderCtrl *slider = (CSliderCtrl *)wnd;
01843         slider->SetRange(prop->min, prop->max);
01844         slider->SetPos(prop->pos);
01845         slider->SetPageSize(prop->inc);
01846     }
01847     else if(wnd->IsKindOf(RUNTIME_CLASS(CScrollBar)))
01848     {
01849         SCROLLINFO info;
01850         memset(&info, 0, sizeof(info));
01851         info.cbSize = sizeof(info);
01852         info.fMask = SIF_DISABLENOSCROLL | SIF_PAGE | SIF_POS | SIF_RANGE;
01853         info.nMax = prop->max;
01854         info.nMin = prop->min;
01855         info.nPos = prop->pos;
01856         info.nPage = prop->inc;
01857         if(info.nPage > (info.nMax - info.nMin))
01858             info.nPage = (info.nMax - info.nMin) / 2;
01859         CScrollBar *scroll = (CScrollBar *)wnd;
01860         VERIFY(scroll->SetScrollInfo(&info));
01861         if(prop->max != prop->min)
01862             scroll->EnableWindow(TRUE);
01863     }
01864 #endif
01865 #if qMacAPP
01866     TView *view = (TView *)w;
01867     if(MA_MEMBER(view, TSlider) || MA_MEMBER(view, TScrollBar))
01868     {
01869         TCtlMgr *ctrl = (TCtlMgr *)view;
01870         ctrl->SetValues(prop->pos, prop->min, prop->max, true);
01871         if(MA_MEMBER(ctrl, TPseudoScrollBar))
01872             ((TPseudoScrollBar *)ctrl)->fPageStep = prop->inc;
01873     }
01874 #endif
01875 #if qMacPP
01876     USemaphore policeman(gTurnOffBroadcast);
01877
01878     LPane *view = (LPane *)w;
01879     LControl *ctrl;
01880     if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01881     {
01882         ctrl->SetMaxValue(prop->max);
01883         ctrl->SetMinValue(prop->min);
01884         ctrl->SetValue(prop->pos);
01885         LPseudoWinAttachment *attach = macpp_getattachwindow(this);
01886         if(attach != 0L)
01887             attach->SetPageValue(cmd, prop->inc);
01888     }
01889 #endif
01890 }

void UWidget::OnSetState | ( | int | cmd,
 |  | int | state
 | ) | [protected]

EV_SETSTATE message handling

  • cmd the sub-widget
  • state of the widget to set (pushed/checked...).

Definition at line 1237 of file uwidget.cpp.

References TPseudoRotateIconButton::DoRotate, UPseudoRotButton::DoRotate, CPseudoRotButton::DoRotate, GetWidget, m_noDispatch, CPseudoToggle::SetState, and stat.

01238 {
01239     void *w = GetWidget(cmd);
01240     if(w == 0L)
01241         return;
01242
01243 #ifdef WIN32
01244     CWnd *wnd = (CWnd *)w;
01245
01246     if(wnd->IsKindOf(RUNTIME_CLASS(CPseudoRotButton)))
01247     {
01248         CPseudoRotButton *btn = (CPseudoRotButton *)wnd;
01249         btn->DoRotate(state);
01250     }
01251     else if(wnd->IsKindOf(RUNTIME_CLASS(CPseudoToggle)))
01252     {
01253         CPseudoToggle *btn = (CPseudoToggle *)wnd;
01254         btn->SetState(state);
01255     }
01256     else if(wnd->IsKindOf(RUNTIME_CLASS(CButton)))
01257     {
01258         CButton *btn = (CButton *)wnd;
01259         btn->SetCheck(state != 0);
01260     }
01261     else
01262     {
01263         USemaphore policeman(m_noDispatch);
01264         char tmp[100];
01265         sprintf(tmp, "%d", state);
01266         wnd->SetWindowText(tmp);
01267     }
01268 #endif
01269 #if qGTK
01270     if(GTK_IS_TOGGLE_BUTTON(w))
01271     {
01272         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), state != 0);
01273     }
01274     else if(GTK_IS_ENTRY(w))
01275     {
01276         char tmp[20];
01277         sprintf(tmp, "%d", state);
01278         gtk_entry_set_text(GTK_ENTRY(w), tmp);
01279     }
01280 #endif
01281 #if qMacPP
01282     USemaphore policeman(gTurnOffBroadcast);
01283
01284     LPane *view = (LPane *)w;
01285     LCheckBox *check;
01286     LRadioButton *rad;
01287     LEditText *edit;
01288     LStaticText *stat;
01289     UPseudoRotButton *rot;
01290     LCheckBoxGroupBox *groupbox;
01291     LPageController *tabctrl;
01292     LTabsControl *tabctrl2;
01293     LControl *ctrl;
01294     if((check = dynamic_cast<LCheckBox *>(view)) != 0L)
01295     {
01296         check->SetValue(state ? Button_On : Button_Off);
01297     }
01298     else if((rad = dynamic_cast<LRadioButton *>(view)) != 0L)
01299     {
01300         rad->SetValue(state ? Button_On : Button_Off);
01301     }
01302     else if((groupbox = dynamic_cast<LCheckBoxGroupBox *>(view)) != 0L)
01303     {
01304         groupbox->SetValue(state ? Button_On : Button_Off);
01305     }
01306     else if((edit = dynamic_cast<LEditText *>(view)) != 0L)
01307     {
01308         LStr255 pstr((SInt32)state);
01309         edit->SetText(pstr);
01310     }
01311     else if((stat = dynamic_cast<LStaticText *>(view)) != 0L)
01312     {
01313         LStr255 pstr((SInt32)state);
01314         stat->SetText(pstr);
01315     }
01316     else if((rot = dynamic_cast<UPseudoRotButton *>(view)) != 0L)
01317     {
01318         rot->DoRotate(state);
01319     }
01320     else if((tabctrl = dynamic_cast<LPageController *>(view)) != 0L)
01321     {
01322         tabctrl->SetSelectedPageButtonByIndex(state + 1, false);
01323     }
01324     else if((tabctrl2 = dynamic_cast<LTabsControl *>(view)) != 0L)
01325     {
01326         tabctrl2->SetValue(state + 1);
01327     }
01328     else if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01329     {
01330         ctrl->SetValue(state);
01331     }
01332 #endif
01333 #if qMacAPP
01334     TView *view = (TView *)w;
01335     if(MA_MEMBER(view, TCheckBox))
01336     {
01337         TCheckBox *check = (TCheckBox *)view;
01338         check->SetState(state, true);
01339     }
01340     else if(MA_MEMBER(view, TRadio))
01341     {
01342         TRadio *rad = (TRadio *)view;
01343         rad->SetState(state, true);
01344     }
01345     else if(MA_MEMBER(view, TNumberText))
01346     {
01347         TNumberText *num = (TNumberText *)view;
01348         num->SetValue(state, true);
01349     }
01350     else if(MA_MEMBER(view, TPseudoRotateIconButton))
01351     {
01352         TPseudoRotateIconButton *rot = (TPseudoRotateIconButton *)view;
01353         rot->DoRotate(state);
01354     }
01355     else if(MA_MEMBER(view, TProgressIndicator))
01356     {
01357         TProgressIndicator *progress = (TProgressIndicator *)view;
01358         progress->SetValue(state, true);
01359     }
01360 #endif
01361 }

void UWidget::OnSetText | ( | int | cmd,
 |  | const char * | text
 | ) | [protected]

EV_SETTEXT message handling

  • cmd the sub-widget
  • text the c-string caption to set.

Definition at line 1520 of file uwidget.cpp.

References getLabelFromContainer, GetWidget, and m_noDispatch.

01521 {
01522     void *w = GetWidget(cmd);
01523     if(w == 0L)
01524         return;
01525
01526 #ifdef WIN32
01527     USemaphore policeman(m_noDispatch);
01528     CWnd *wnd = (CWnd *)w;
01529     wnd->SetWindowText(text);
01530 #endif
01531 #if qGTK
01532     if(GTK_IS_WINDOW(w))
01533     {
01534         gtk_window_set_title(GTK_WINDOW(w), text);
01535     }
01536     else if(GTK_IS_BUTTON(w))
01537     {
01538         GtkLabel *label = getLabelFromContainer(GTK_CONTAINER(w));
01539         if(label != 0L)
01540             gtk_label_set_text(label, text);
01541         else
01542             g_warning("Cannot find the label of '%s'\n", gtk_widget_get_name(GTK_WIDGET(w)));
01543     }
01544     else if(GTK_IS_TEXT(w))
01545     {
01546         GtkText *t = GTK_TEXT(w);
01547         gtk_text_set_point(t, 0);
01548         gtk_text_forward_delete(t, gtk_text_get_length(t));
01549         gtk_text_insert(t, 0L, 0L, 0L, text, -1);
01550     }
01551     else if(GTK_IS_ENTRY(w))
01552     {
01553         gtk_entry_set_text(GTK_ENTRY(w), text);
01554     }
01555     else if(GTK_IS_COMBO(w))
01556     {
01557         gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(w)->entry), text);
01558     }
01559     else if(GTK_IS_LABEL(w))
01560     {
01561         GtkLabel *t = GTK_LABEL(w);
01562         gtk_label_set_text(t, text);
01563     }
01564 #endif
01565 #if qMacPP
01566     USemaphore policeman(gTurnOffBroadcast);
01567
01568     LPane *view = (LPane *)w;
01569     LTextEditView *txt;
01570     if((txt = dynamic_cast<LTextEditView *>(view)) != 0L)
01571     {
01572         txt->SetTextPtr((Ptr)text, strlen(text));
01573     }
01574     else
01575     {
01576         LStr255 pstr(text);
01577         LStr255 oldstr;
01578         view->GetDescriptor(oldstr);
01579         if(oldstr != pstr)
01580             view->SetDescriptor(pstr);
01581     }
01582 #endif
01583 #if qMacAPP
01584     TView *view = (TView *)w;
01585     if(MA_MEMBER(view, TCtlMgr))
01586     {
01587         TCtlMgr *ctrl = (TCtlMgr *)view;
01588         CStr255_AC pstr(text);
01589         ctrl->SetText(pstr, true);
01590     }
01591     else if(MA_MEMBER(view, TStaticText))
01592     {
01593         TStaticText *ctrl = (TStaticText *)view;
01594         CStr255_AC pstr(text);
01595         ctrl->SetText(pstr, true);
01596     }
01597     else if(MA_MEMBER(view, TWindow))
01598     {
01599         TWindow *ctrl = (TWindow *)view;
01600         CStr255_AC pstr(text);
01601         ctrl->SetTitle(pstr);
01602     }
01603 #endif
01604 }

void UWidget::OnSetTooltip | ( | int | cmd,
 |  | UCmdUI * | pCmdUI
 | ) | [protected]

EV_USETTOOLTIP message handling

Warning:
not documented.

Reimplemented in UToolbar.

Definition at line 860 of file uwidget.cpp.

References GetTooltip, and UCmdUI::SetTooltip.

00861 {
00862     const char *tooltip = GetTooltip(cmd);
00863     if(tooltip == 0L)
00864         return;
00865
00866     pCmdUI->SetTooltip(tooltip);
00867 }

void UWidget::OnShowWidget | ( | int | cmd,
 |  | int | state
 | ) | [protected]

EV_SHOW message handling

  • cmd the sub-widget
  • state of the widget to show/hide.

Definition at line 1702 of file uwidget.cpp.

References GetWidget.

01703 {
01704     void *w = GetWidget(cmd);
01705     if(w == 0L)
01706         return;
01707
01708 #ifdef WIN32
01709     CWnd *wnd = (CWnd *)w;
01710
01711     wnd->ShowWindow(state ? SW_SHOWNORMAL : SW_HIDE);
01712 #endif
01713 #if qGTK
01714     GtkWidget *wid = (GtkWidget *)w;
01715     if(state)
01716         gtk_widget_show(wid);
01717     else
01718         gtk_widget_hide(wid);
01719 #endif
01720 #if qMacAPP
01721     TView *view = (TView *)w;
01722     view->Show(state != 0, true);
01723 #endif
01724 #if qMacPP
01725     LPane *view = (LPane *)w;
01726     if(state)
01727         view->Show();
01728     else
01729         view->Hide();
01730 #endif
01731 }

void UWidget::OnSmartComboSetFeature | ( | int | cmd,
 |  | int | feature
 | ) | [protected]

EV_SMARTCOMBO_SETFEATURE UWidget message handling.

Definition at line 2714 of file uwidget.cpp.

References GetWidget, and WM_SMCB_SETFEATURE.

02715 {
02716     void *w = GetWidget(cmd);
02717     if( w == 0L )
02718         return;
02719
02720 #ifdef WIN32
02721     CWnd* wnd = (CWnd*)w;
02722
02723     if( wnd->IsKindOf(RUNTIME_CLASS(CComboBox)) )
02724     {
02725         CComboBox* combo = (CComboBox*)wnd;
02726         combo->SendMessage(WM_SMCB_SETFEATURE, WPARAM(feature));
02727     }
02728 #endif
02729 #if qMacPP
02730 #endif
02731 }

void UWidget::OnSmartComboSetItems | ( | int | cmd,
 |  | CMString * | items
 | ) | [protected]

EV_SMARTCOMBO_SETITEMS UWidget message handling.

Definition at line 2733 of file uwidget.cpp.

References GetWidget, and WM_SMCB_SETITEMS.

02734 {
02735     void *w = GetWidget(cmd);
02736     if( w == 0L )
02737         return;
02738
02739 #ifdef WIN32
02740     CWnd* wnd = (CWnd*)w;
02741
02742     if( wnd->IsKindOf(RUNTIME_CLASS(CComboBox)) )
02743     {
02744         CComboBox* combo = (CComboBox*)wnd;
02745         combo->SendMessage(WM_SMCB_SETITEMS, WPARAM(items));
02746     }
02747 #endif
02748 #if qMacPP
02749 #endif
02750 }

void UWidget::OnSmartComboSetReadOnly | ( | int | cmd,
 |  | bool | readOnly
 | ) | [protected]

EV_SMARTCOMBO_SETREADONLY UWidget message handling.

Definition at line 2752 of file uwidget.cpp.

References GetWidget, and WM_SMCB_SETREADONLY.

02753 {
02754     void *w = GetWidget(cmd);
02755     if( w == 0L )
02756         return;
02757
02758 #ifdef WIN32
02759     CWnd* wnd = (CWnd*)w;
02760
02761     if( wnd->IsKindOf(RUNTIME_CLASS(CComboBox)) )
02762     {
02763         CComboBox* combo = (CComboBox*)wnd;
02764         combo->SendMessage(WM_SMCB_SETREADONLY, WPARAM(readOnly));
02765     }
02766 #endif
02767 #if qMacPP
02768 #endif
02769 }

void UWidget::OnTreeDelete | ( | int | cmd,
 |  | UTREEITEM | item
 | ) | [protected]

EV_TREE_DELETE UWidget message handling.

Definition at line 2297 of file uwidget.cpp.

References GetWidget, and UTREEITEM.

02298 {
02299     // sanity
02300     void *w = GetWidget(cmd);
02301     if(w == 0L)
02302         return;
02303
02304 #if qGTK
02305     if(!GTK_IS_TREE(w) || item == 0L)
02306         return;
02307
02308     GtkTreeItem *i = GTK_TREE_ITEM(item);
02309
02310     GtkTree *parent = GTK_TREE(GTK_WIDGET(i)->parent);
02311     if (parent == 0L)
02312         return;
02313
02314     gtk_container_remove(GTK_CONTAINER(parent), GTK_WIDGET(i));
02315 #endif
02316 }

void UWidget::OnTreeExpand | ( | int | cmd,
 |  | int | collapse,
 |  | UTREEITEM | item
 | ) | [protected]

EV_TREE_EXPAND UWidget message handling.

Definition at line 2318 of file uwidget.cpp.

References GetWidget, and UTREEITEM.

02319 {
02320     // sanity
02321     void *w = GetWidget(cmd);
02322     if(w == 0L)
02323         return;
02324
02325 #if qGTK
02326     if(!GTK_IS_TREE(w) || item == 0L)
02327         return;
02328
02329     GtkTreeItem *i = GTK_TREE_ITEM(item);
02330     int collapsed = !i->expanded;
02331     if((collapsed != 0) ^ (collapse != 0))
02332     {
02333         if(!collapse)
02334             gtk_tree_item_expand(i);
02335         else
02336             gtk_tree_item_collapse(i);
02337     }
02338 #endif
02339 }

void UWidget::OnTreeGetInfo | ( | int | cmd,
 |  | UTREE_INFO * | data
 | ) | [protected]

EV_TREE_GETINFO UWidget message handling.

Definition at line 2240 of file uwidget.cpp.

References UTREE_INFO::child, UTREE_INFO::data, UTREE_INFO::expanded, GetWidget, UTREE_INFO::icon, UTREE_INFO::item, UTREE_INFO::next, UTREE_INFO::parent, and UTREE_INFO::title.

02241 {
02242     // sanity
02243     desc->parent = 0L;
02244     desc->next = 0L;
02245     desc->child = 0L;
02246     desc->data = 0L;
02247     desc->title = 0L;
02248     desc->icon = 0L;
02249     desc->expanded = 0;
02250
02251     void *w = GetWidget(cmd);
02252     if(w == 0L)
02253         return;
02254
02255 #if qGTK
02256     if(!GTK_IS_TREE(w))
02257         return;
02258
02259     GtkTreeItem *item;
02260     if(desc->item == 0L)
02261     {
02262         GList *list = g_list_first(GTK_TREE(w)->children);
02263         GList *next = g_list_next(list);
02264         item = list != 0L ? GTK_TREE_ITEM(list->data) : 0L;
02265         desc->item = item;
02266         desc->next = next != 0L ? GTK_TREE_ITEM(next->data) : 0L;
02267     }
02268     else
02269     {
02270         GtkTree *parent = GTK_TREE(GTK_WIDGET(desc->item)->parent);
02271         GList *list = g_list_find(GTK_TREE(parent)->children, desc->item);
02272         GList *next = g_list_next(list);
02273         item = list != 0L ? GTK_TREE_ITEM(list->data) : 0L;
02274         desc->item = item;
02275         // the only way I found to guess the TREE_ITEM parent
02276         desc->parent = parent == w ? 0L : GTK_TREE_ITEM(gtk_object_get_data(GTK_OBJECT(parent), "rf_treeparent"));
02277         g_assert(desc->parent == 0L || GTK_IS_TREE_ITEM(desc->parent));
02278         desc->next = next != 0L ? GTK_TREE_ITEM(next->data) : 0L;
02279     }
02280     if(item != 0L)
02281     {
02282         if(item->subtree != 0L)
02283         {
02284             GtkTree *subtree = GTK_TREE(item->subtree);
02285             GList *list = g_list_first(GTK_TREE(subtree)->children);
02286             desc->child = list != 0L ? GTK_TREE_ITEM(list->data) : 0L;
02287         }
02288         desc->data = gtk_object_get_data(GTK_OBJECT(item), "rf_treeitemdata");
02289         GtkLabel *label = gtktreegetlabel(GTK_WIDGET(item));
02290         if(label != 0L)
02291             gtk_label_get(label, &desc->title);
02292         desc->expanded = item->expanded;
02293     }
02294 #endif
02295 }

void UWidget::OnTreeGetSel | ( | int | cmd,
 |  | UTREEITEM * | item
 | ) | [protected]

EV_TREE_GETSEL UWidget message handling.

Definition at line 2220 of file uwidget.cpp.

References GetWidget, and UTREEITEM.

02221 {
02222     *item = 0L; // sanity
02223
02224     void *w = GetWidget(cmd);
02225     if(w == 0L)
02226         return;
02227
02228 #if qGTK
02229     if(!GTK_IS_TREE(w))
02230         return;
02231
02232     GList *sel = GTK_TREE(w)->selection;
02233     if(sel == 0L || !GTK_IS_TREE_ITEM(sel->data))
02234         return;
02235
02236     *item = sel->data;
02237 #endif
02238 }

void UWidget::OnTreeInsert | ( | int | cmd,
 |  | UTREE_INSERT * | data
 | ) | [protected]

EV_TREE_INSERT UWidget message handling.

Definition at line 2146 of file uwidget.cpp.

References UTREE_INSERT::data, GetWidget, UCmdTarget::GetWidID, gpointer, UTREE_INSERT::icon, UTREE_INSERT::parent, UTREE_INSERT::result, UTREE_INSERT::title, and UMAKEINT.

02147 {
02148     data->result = 0L; // sanity
02149
02150     void *w = GetWidget(cmd);
02151     if(w == 0L)
02152         return;
02153
02154 #if qGTK
02155     if(!GTK_IS_TREE(w))
02156         return;
02157
02158     GtkTree *root;
02159     if(data->parent == 0L)
02160         root = GTK_TREE(w);
02161     else
02162     {
02163         GtkTreeItem *item = GTK_TREE_ITEM(data->parent);
02164
02165         if(item->subtree != 0L)
02166             root = GTK_TREE(item->subtree);
02167         else
02168         {
02169             root = GTK_TREE(gtk_tree_new());
02170             gtk_object_set_data(GTK_OBJECT(root), "rf_treeparent", item);
02171             gtk_tree_set_selection_mode (root, GTK_SELECTION_BROWSE); // TODO : find out it with the root
02172             gtk_tree_set_view_mode (root, GTK_TREE_VIEW_ITEM); // TODO : find out it with the root
02173             gtk_tree_item_set_subtree (item, GTK_WIDGET(root));
02174         }
02175     }
02176     GtkTreeItem *item = gtknewtreeitem(data->title, data->icon == 0L ? 0L : GTK_PIXMAP(data->icon));
02177     gtk_object_set_data(GTK_OBJECT(item), "rf_treeitemdata", data->data);
02178     gtk_signal_connect(GTK_OBJECT(item), "select",
02179                        GTK_SIGNAL_FUNC(gtktreeselect), (gpointer)UMAKEINT(GetWidID(), cmd));
02180     gtk_signal_connect(GTK_OBJECT(item), "deselect",
02181                        GTK_SIGNAL_FUNC(gtktreedeselect), (gpointer)UMAKEINT(GetWidID(), cmd));
02182     gtk_signal_connect (GTK_OBJECT(item), "expand",
02183                         GTK_SIGNAL_FUNC(gtktreeexpand), (gpointer)UMAKEINT(GetWidID(), cmd));
02184     gtk_signal_connect (GTK_OBJECT(item), "collapse",
02185                         GTK_SIGNAL_FUNC(gtktreecollapse), (gpointer)UMAKEINT(GetWidID(), cmd));
02186     gtk_tree_append (GTK_TREE(root), GTK_WIDGET(item));
02187     gtk_widget_show (GTK_WIDGET(item));
02188     data->result = (UTREEITEM)item;
02189 #endif
02190 }

void UWidget::OnTreeResetAll ( int cmd ) [protected]

EV_TREE_RESETALL UWidget message handling.

Definition at line 2123 of file uwidget.cpp.

References GetWidget.

02124 {
02125     void *w = GetWidget(cmd);
02126     if(w == 0L)
02127         return;
02128
02129 #if qGTK
02130     if(!GTK_IS_TREE(w))
02131         return;
02132
02133     GtkTree *tree = GTK_TREE(w);
02134     GList *list = g_list_copy(tree->children);
02135     GList *head = list;
02136     while(list != 0L)
02137     {
02138         GtkWidget *wid = GTK_WIDGET(list->data);
02139         gtk_container_remove(GTK_CONTAINER(tree), wid);
02140         list = (GList *)g_list_next(list);
02141     }
02142     g_list_free(head);
02143 #endif
02144 }

void UWidget::OnTreeSelect | ( | int | cmd,
 |  | int | deselect,
 |  | UTREEITEM | item
 | ) | [protected]

EV_TREE_SELECT UWidget message handling.

Definition at line 2341 of file uwidget.cpp.

References GetWidget, and UTREEITEM.

02342 {
02343     // sanity
02344     void *w = GetWidget(cmd);
02345     if(w == 0L)
02346         return;
02347
02348 #if qGTK
02349     if(!GTK_IS_TREE(w) || item == 0L)
02350         return;
02351
02352 #if 0 // FIXME ! GTK is behaving strangely
02353     GList *sel = GTK_TREE(w)->selection;
02354     while(sel)
02355     {
02356         gtk_tree_item_deselect(GTK_TREE_ITEM(sel->data));
02357         sel = g_list_next(sel);
02358     }
02359
02360     GtkTreeItem *i = GTK_TREE_ITEM(item);
02361     if(!deselect)
02362         gtk_tree_item_select(i);
02363     else
02364         gtk_tree_item_deselect(i);
02365 #endif
02366 #endif
02367 }

void UWidget::OnTreeSetData | ( | int | cmd,
 |  | UTREE_INFO * | data
 | ) | [protected]

EV_TREE_SETDATA UWidget message handling.

Definition at line 2192 of file uwidget.cpp.

References UTREE_INFO::data, GetWidget, and UTREE_INFO::item.

02193 {
02194     void *w = GetWidget(cmd);
02195     if(w == 0L)
02196         return;
02197
02198 #if qGTK
02199     if(!GTK_IS_TREE(w))
02200         return;
02201
02202     gtk_object_set_data(GTK_OBJECT(data->item), "rf_treeitemdata", data->data);
02203 #endif
02204 }

void UWidget::OnTreeSetIcon | ( | int | cmd,
 |  | UTREE_INFO * | data
 | ) | [protected]

EV_TREE_SETICON UWidget message handling.

Definition at line 2206 of file uwidget.cpp.

References GetWidget, UTREE_INFO::icon, and UTREE_INFO::item.

02207 {
02208     void *w = GetWidget(cmd);
02209     if(w == 0L)
02210         return;
02211
02212 #if qGTK
02213     if(!GTK_IS_TREE(w))
02214         return;
02215
02216     gtksettreeitemicon(GTK_TREE_ITEM(data->item), GTK_PIXMAP(data->icon));
02217 #endif
02218 }

int UWidget::OnUpdateFocus | ( | int | leave,
 |  | void * | widget
 | ) | [protected]

EV_UPDATEFOCUS UWidget message handling.

Definition at line 3492 of file uwidget.cpp.

References UCmdTarget::GetWidID, m_widgets, sFocusCmdID, and sFocusWidID.

03493 {
03494     std::map<int, void *>::const_iterator i;
03495
03496     for(i = m_widgets.begin(); i != m_widgets.end(); ++i)
03497     {
03498         if((*i).second == widget)
03499             break;
03500     }
03501     if(i == m_widgets.end())
03502         return 0; // continue notification
03503
03504     if(leave)
03505     {
03506         if(sFocusWidID == GetWidID())
03507             sFocusWidID = -1;
03508     }
03509     else
03510     {
03511         sFocusWidID = GetWidID();
03512         sFocusCmdID = (*i).first;
03513     }
03514
03515     return 1; // stop notification
03516 }

void UWidget::OnUpdateUI ( void ) [protected]

EV_UPDATEUI is a notification sent to all the widgets when the user interface is invalid. the default is to send a EV_UPDTCMD to each sub-widget.

Reimplemented in UMacAppMenu.

Definition at line 1927 of file uwidget.cpp.

References EV_UPDTCMD, UCmdTarget::GetWidID, UCmdUI::m_nID, UCmdUI::m_widget, m_widgets, and UEventSendMessage.

01928 {
01929     std::map<int, void *>::const_iterator i;
01930     for(i = m_widgets.begin(); i != m_widgets.end(); ++i)
01931     {
01932         UCmdUI pUI((*i).first);
01933         pUI.m_widget = (*i).second;
01934         UEventSendMessage(GetWidID(), EV_UPDTCMD, pUI.m_nID, &pUI);
01935     }
01936 }

void UWidget::OverideMapWidget | ( | int | cmdid,
 |  | CRuntimeClass * | widClass
 | ) |

Definition at line 3625 of file uwidget.cpp.

References m_overide.

03626 {
03627     std::map<int, CRuntimeClass *>::value_type val(cmdid, widClass);
03628     m_overide.insert(val);
03629 }

void UWidget::RemoveTimer ( int cmd )

timer handling - remove a timer.

  • cmd associated with the timer.

Definition at line 1898 of file uwidget.cpp.

References m_timers.

01899 {
01900     std::vector<UTimer>::iterator i;
01901     for(i = m_timers.begin(); i != m_timers.end(); i++)
01902     {
01903         if((*i).m_cmd == cmd)
01904         {
01905             (*i).m_cmd = 0; // delay removing
01906             break;
01907         }
01908     }
01909 }

const URuntimeClass * UWidget::rtUWidget ( void ) [static]

Definition at line 83 of file uwidget.cpp.

int UWidget::UDispatchMessage | ( | int | evt,
 |  | int | arg1,
 |  | void * | arg2,
 |  | UDispatchInfo & | dispatchInfo
 | ) | [virtual]

this is overided in order to broadcast to the listeners.

Reimplemented from UCmdTarget.

Reimplemented in UToolbar.

Definition at line 748 of file uwidget.cpp.

References m_listeners, and UCmdTarget::UDispatchMessage.

Referenced by UToolbar::UDispatchMessage.

00749 {
00750     std::vector<UCmdTarget *>::iterator i;
00751     for(i = m_listeners.begin(); i != m_listeners.end(); ++i)
00752     {
00753         (*i)->UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00754     }
00755     return UCmdTarget::UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00756 }

bool UWidget::WidgetIsActive ( int cmd ) const

return true if a widget has the focus ...

  • cmd the sub-widget identifier.
Warning:
only on Win32.

Definition at line 869 of file uwidget.cpp.

References GetWidget.

00870 {
00871     void *w = GetWidget(cmd);
00872     if(w == 0L)
00873         return false;
00874
00875 #ifdef WIN32
00876     CWnd *wnd = (CWnd *)w;
00877
00878     bool res = false;
00879
00880     CWnd* parent = wnd->GetOwner();
00881     if(parent && (HWND)*parent->GetFocus() == (HWND)*wnd)
00882         res = true;
00883
00884     return res;
00885 #endif
00886     return false;
00887 }

Friends And Related Function Documentation

LRESULT UWinPseudoWindowProc | ( | CWnd * | wnd,
 |  | UWidget * | wid,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [friend]

Definition at line 212 of file PseudoDlg.cpp.

00213 {
00214     bool sentOne = false;
00215
00216     if(wid == 0L)
00217         return 1;
00218
00219     if (message == WM_COMMAND)
00220     {
00221         UINT nID = LOWORD(wParam);
00222         if(!IS_PSEUDO_CTL(nID))
00223             return 1;
00224
00225         int nCode = HIWORD(wParam);
00226         HWND hWndCtrl = (HWND)lParam;
00227         switch(nCode)
00228         {
00229         case BN_CLICKED:
00230             UEventSendMessage(wid->GetWidID(), EV_CMD, WINCTL_to_UCMD(nID), 0L);
00231             sentOne = true;
00232             break;
00233         case CBN_SELCHANGE:
00234         {
00235             ASSERT(::IsWindow(hWndCtrl));
00236             int sel = (int)::SendMessage(hWndCtrl, CB_GETCURSEL, 0, 0);
00237             const char *txt = 0L;
00238             char buf[1024] = {'\0'};
00239             if(sel != -1 && (int)::SendMessage(hWndCtrl, CB_GETLBTEXT, sel, (LPARAM)buf) != CB_ERR)
00240                 txt = buf;
00241             if(strcmp(buf, "-") != 0) // separator
00242                 UEventSendMessage(wid->GetWidID(), EV_COMBO_SEL,
00243                     UMAKEINT(WINCTL_to_UCMD(nID), sel), (void *)txt);
00244             sentOne = true;
00245             break;
00246         }
00247         case EN_CHANGE:
00248             if(wid->m_noDispatch)
00249                 break;
00250
00251             ASSERT(::IsWindow(hWndCtrl));
00252             UEventSendMessage(wid->GetWidID(), EV_EDITCHANGE,
00253                 WINCTL_to_UCMD(nID), 0L);
00254             break;
00255         }
00256     }
00257     else if (message == WM_NOTIFY)
00258     {
00259         NMHDR* pNMHDR = (NMHDR*)lParam;
00260         if (pNMHDR->hwndFrom != NULL)
00261         {
00262             UINT nID = _AfxGetDlgCtrlID(pNMHDR->hwndFrom);
00263             int nCode = pNMHDR->code;
00264             if(!IS_PSEUDO_CTL(nID))
00265                 return 1;
00266
00267             switch(nCode)
00268             {
00269             case LVN_ITEMCHANGED:
00270                 NMLISTVIEW *state = (NMLISTVIEW *)pNMHDR;
00271
00272                 HWND wnd = state->hdr.hwndFrom;
00273                 ASSERT(::IsWindow(wnd));
00274
00275                 int id = state->hdr.idFrom;
00276                 std::map<int, void *>::const_iterator i = wid->GetWidgets().find(WINCTL_to_UCMD(id));
00277                 if(i != wid->GetWidgets().end())
00278                 {
00279                     CWnd *w = (CWnd *)(*i).second;
00280                     if(w->IsKindOf(RUNTIME_CLASS(CListCtrl)))
00281                     {
00282                         CListCtrl *list = (CListCtrl*)w;
00283                         CString s = list->GetItemText(state->iItem, 0);
00284
00285                         UEventSendMessage(wid->GetWidID(), EV_LIST_SELECTING,
00286                             UMAKEINT(WINCTL_to_UCMD(state->hdr.idFrom), state->iItem), (void *)(const char *)s);
00287                         sentOne = true;
00288                     }
00289                 }
00290                 break;
00291             }
00292         }
00293     }
00294     else if (message == WM_SIZE)
00295     {
00296         int id = findIdForWnd(wnd, wid);
00297         if(id != -1)
00298         {
00299             URECT r = {0, 0, LOWORD(lParam), HIWORD(lParam)};
00300             UEventSendMessage(wid->GetWidID(), EV_RESIZE, id, &r);
00301             sentOne = true;
00302         }
00303     }
00304     else if (message == WM_MOUSEMOVE)
00305     {
00306         int id = findIdForWnd(wnd, wid);
00307         if(id != -1)
00308         {
00309             UEventSendMessage(wid->GetWidID(), EV_MMOVE, UMAKEINT(LOWORD(lParam), HIWORD(lParam)),
00310                 (void *)UWinToUMod(wParam));
00311             sentOne = true;
00312         }
00313     }
00314     else if (message == WM_LBUTTONDOWN)
00315     {
00316         int id = findIdForWnd(wnd, wid);
00317         if(id != -1)
00318         {
00319             UEventSendMessage(wid->GetWidID(), EV_BTNDOWN, UMAKEINT(LOWORD(lParam), HIWORD(lParam)),
00320                 (void *)UWinToUMod(wParam));
00321             sentOne = true;
00322         }
00323     }
00324     else if (message == WM_LBUTTONUP)
00325     {
00326         int id = findIdForWnd(wnd, wid);
00327         if(id != -1)
00328         {
00329             UEventSendMessage(wid->GetWidID(), EV_BTNUP, UMAKEINT(LOWORD(lParam), HIWORD(lParam)),
00330                 (void *)UWinToUMod(wParam));
00331             sentOne = true;
00332         }
00333     }
00334     else if (message == WM_LBUTTONDBLCLK)
00335     {
00336         int id = findIdForWnd(wnd, wid);
00337         if(id != -1)
00338         {
00339             UEventSendMessage(wid->GetWidID(), EV_BTNDBLDOWN, UMAKEINT(LOWORD(lParam), HIWORD(lParam)),
00340                 (void *)UWinToUMod(wParam));
00341             sentOne = true;
00342         }
00343     }
00344     else if (message == WM_KEYDOWN)
00345     {
00346         int id = findIdForWnd(wnd, wid);
00347         if(id != -1)
00348         {
00349             UEventSendMessage(wid->GetWidID(), EV_KEYDOWN, wParam, 0L);
00350             sentOne = true;
00351         }
00352     }
00353     else if (message == WM_HSCROLL)
00354     {
00355         HWND hwndScrollBar = (HWND) lParam;       // handle to scroll bar
00356         int nID = ::GetDlgCtrlID(hwndScrollBar);
00357         if(!IS_PSEUDO_CTL(nID))
00358             return 1;
00359
00360         int cmd = WINCTL_to_UCMD(nID);
00361         CWnd *wnds = (CWnd *)wid->GetWidget(cmd);
00362         if(wnds == 0L || !wnds->IsKindOf(RUNTIME_CLASS(CScrollBar)))
00363             return 1;
00364
00365         CScrollBar *scroll = (CScrollBar *)wnds;
00366
00367         int nScrollCode = (int) LOWORD(wParam);  // scroll bar value
00368         int nPos;
00369         if(nScrollCode == SB_THUMBPOSITION || nScrollCode == SB_THUMBTRACK)
00370         {
00371             nPos = (short int) HIWORD(wParam);   // scroll box position
00372
00373             if(nScrollCode == SB_THUMBPOSITION)
00374                 scroll->SetScrollPos(nPos);
00375         }
00376         else
00377         {
00378             SCROLLINFO info;
00379             VERIFY(scroll->GetScrollInfo(&info));
00380             nPos = info.nPos;
00381
00382             switch(nScrollCode)
00383             {
00384             case SB_ENDSCROLL:
00385                 return 1;
00386                 break;
00387             case SB_LINELEFT:
00388                 nPos -= 1;
00389                 break;
00390             case SB_LINERIGHT:
00391                 nPos += 1;
00392                 break;
00393             case SB_PAGELEFT:
00394                 nPos -= info.nPage;
00395                 break;
00396             case SB_PAGERIGHT:
00397                 nPos += info.nPage;
00398                 break;
00399             case SB_LEFT:
00400                 nPos = info.nMin;
00401                 break;
00402             case SB_RIGHT:
00403                 nPos = info.nMax;
00404                 break;
00405             }
00406
00407             scroll->SetScrollPos(nPos);
00408         }
00409
00410         UEventSendMessage(wid->GetWidID(), EV_SCROLLCHANGE, WINCTL_to_UCMD(nID),
00411             (void *)nPos);
00412         sentOne = true;
00413     }
00414     else if (message == WM_VSCROLL)
00415     {
00416         HWND hwndScrollBar = (HWND) lParam;       // handle to scroll bar
00417         int nID = ::GetDlgCtrlID(hwndScrollBar);
00418         if(!IS_PSEUDO_CTL(nID))
00419             return 1;
00420
00421         int cmd = WINCTL_to_UCMD(nID);
00422         CWnd *wnds = (CWnd *)wid->GetWidget(cmd);
00423         if(wnds == 0L || !wnds->IsKindOf(RUNTIME_CLASS(CScrollBar)))
00424             return 1;
00425
00426         CScrollBar *scroll = (CScrollBar *)wnds;
00427
00428         int nScrollCode = (int) LOWORD(wParam);  // scroll bar value
00429         int nPos;
00430         if(nScrollCode == SB_THUMBPOSITION || nScrollCode == SB_THUMBTRACK)
00431         {
00432             nPos = (short int) HIWORD(wParam);   // scroll box position
00433
00434             if(nScrollCode == SB_THUMBPOSITION)
00435                 scroll->SetScrollPos(nPos);
00436         }
00437         else
00438         {
00439             SCROLLINFO info;
00440             VERIFY(scroll->GetScrollInfo(&info));
00441             nPos = info.nPos;
00442
00443             switch(nScrollCode)
00444             {
00445             case SB_ENDSCROLL:
00446                 return 1;
00447                 break;
00448             case SB_LINEUP:
00449                 nPos -= 1;
00450                 break;
00451             case SB_LINEDOWN:
00452                 nPos += 1;
00453                 break;
00454             case SB_PAGEUP:
00455                 nPos -= info.nPage;
00456                 break;
00457             case SB_PAGEDOWN:
00458                 nPos += info.nPage;
00459                 break;
00460             case SB_TOP:
00461                 nPos = info.nMin;
00462                 break;
00463             case SB_BOTTOM:
00464                 nPos = info.nMax;
00465                 break;
00466             }
00467
00468             if(nPos > info.nMax)
00469                 nPos = info.nMax;
00470             else if(nPos < info.nMin)
00471                 nPos = info.nMin;
00472             scroll->SetScrollPos(nPos);
00473         }
00474
00475         UEventSendMessage(wid->GetWidID(), EV_SCROLLCHANGE, WINCTL_to_UCMD(nID),
00476             (void *)nPos);
00477         sentOne = true;
00478     }
00479
00480     if(sentOne)
00481         UWidget::DoValidUI(false);
00482
00483     return 1;
00484 }

Member Data Documentation

const UMSGMAP_ENTRY UWidget::_messageEntries [static, private]

Reimplemented from UCmdTarget.

Reimplemented in UMacAppMenu.

Definition at line 85 of file uwidget.cpp.

const URuntimeClass UWidget::classUWidget [static, protected]

CDialog* UWidget::m_curModal [protected]

Definition at line 245 of file uwidget.h.

Referenced by DoModal, and EndModal.

int UWidget::m_currentPage [protected]

Definition at line 240 of file uwidget.h.

Referenced by OnPageChanged.

std::vector<UCmdTarget *> UWidget::m_listeners [protected]

Definition at line 233 of file uwidget.h.

Referenced by AddListener, UDispatchMessage, and ~UWidget.

bool UWidget::m_modalRes [protected]

Definition at line 239 of file uwidget.h.

Referenced by DoModal, and EndModal.

bool UWidget::m_noDispatch [protected]

Definition at line 247 of file uwidget.h.

Referenced by OnSetFloat, OnSetState, OnSetText, and UWinPseudoWindowProc.

std::map<int, CRuntimeClass *> UWidget::m_overide [protected]

Definition at line 246 of file uwidget.h.

Referenced by OverideMapWidget.

std::map<int, UWidget *> UWidget::m_tabs [protected]

Definition at line 237 of file uwidget.h.

Referenced by AddPage, DoModal, OnPageChanged, LPseudoWinAttachment::SearchWidID, and ~UWidget.

std::vector<UTimer> UWidget::m_timers [protected]

Definition at line 236 of file uwidget.h.

Referenced by AddTimer, GetTimers, and RemoveTimer.

std::map<int, UStr> UWidget::m_tooltips [protected]

Definition at line 235 of file uwidget.h.

Referenced by AddTooltip, and GetTooltip.

std::map<int, void *> UWidget::m_widgets [protected]

Definition at line 234 of file uwidget.h.

Referenced by GetWidget, LPseudoWinAttachment::InvalidCache, OnFetchCmd, OnInitWidget, OnPageChanged, OnUpdateFocus, OnUpdateUI, UMenu::OnUpdateUI, and LPseudoWinAttachment::SearchWidID.

const UMSGMAP UWidget::messageMap = { UCmdTarget ::GetThisMessageMap(), & UWidget ::_messageEntries[0] } [static, protected]

Reimplemented from UCmdTarget.

Reimplemented in UMacAppMenu.

Definition at line 85 of file uwidget.cpp.

int UWidget::sFocusCmdID [static, protected]

Definition at line 150 of file uwidget.cpp.

Referenced by GetFocusCmd, and OnUpdateFocus.

int UWidget::sFocusWidID = -1 [static, protected]

Definition at line 149 of file uwidget.cpp.

Referenced by GetFocus, UToolbar::OnCommands, UMenu::OnCommands, OnUpdateFocus, UToolbar::OnUpdateUI, UMenu::OnUpdateUI, and ~UWidget.

bool UWidget::sValidMenu = false [static, protected]

Definition at line 148 of file uwidget.cpp.

Referenced by DoValidUI, and IsUIValid.

The documentation for this class was generated from the following files:
  • rf/uwidget.h
  • rf/uwidget.cpp
Generated on Sun Feb 24 01:28:52 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Win32wstring Class Reference

#include <Win32wstring.hpp>

Inheritance diagram for Win32wstring:

[legend]
Collaboration diagram for Win32wstring:

[legend]
List of all members.

Public Methods

Win32wstring (unsigned int codepage, std::string *s)
Win32wstring (unsigned int codepage, std::string &s)

Private Methods

void convert (unsigned int codepage, const char *s, int inLen)

Constructor & Destructor Documentation

Win32wstring::Win32wstring | ( | unsigned int | codepage,
 |  | std::string * | s
 | ) | [inline]

Definition at line 11 of file Win32wstring.hpp.

References convert.

00012     {
00013         convert(codepage, s->c_str(), s->length());
00014     }

Win32wstring::Win32wstring | ( | unsigned int | codepage,
 |  | std::string & | s
 | ) | [inline]

Definition at line 16 of file Win32wstring.hpp.

References convert.

00017     {
00018         convert(codepage, s.c_str(), s.length());
00019     }

Member Function Documentation

void Win32wstring::convert | ( | unsigned int | codepage,
 |  | const char * | s,
 |  | int | inLen
 | ) | [inline, private]

Definition at line 22 of file Win32wstring.hpp.

References NULL.

Referenced by Win32wstring.

00023     {
00024         register int outLen;
00025         register wchar_t *buff = NULL;
00026
00027         // I read this in the msdn docs:
00028         // "Windows NT 4.0 and Windows 2000: Translate using UTF-8.
00029         //  When this is set, dwFlags must be zero."
00030         //
00031         // Does this mean UTF-8 conversions don't work on win 95/98 ???
00032         //
00033         DWORD flags = (codepage == CP_UTF8 ? 0 : MB_USEGLYPHCHARS);
00034
00035         // calc size needed
00036         outLen = ::MultiByteToWideChar(codepage, flags, s, inLen, buff, 0);
00037
00038         buff = new wchar_t [outLen];
00039
00040         // do it
00041         ::MultiByteToWideChar(codepage, flags, s, inLen, buff, outLen);
00042
00043         // set the string into our base class.
00044         assign(buff, outLen);
00045
00046         // discard the scratch space.
00047         delete [] buff;
00048     }

The documentation for this class was generated from the following file:
  • WinCvs/Win32wstring.hpp
Generated on Sun Feb 24 01:28:52 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CWinApp Class Reference

Inheritance diagram for CWinApp:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/wincvs.h
Generated on Sun Feb 24 01:28:52 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CWincvsApp Class Reference

#include <wincvs.h>

Inheritance diagram for CWincvsApp:

[legend]
Collaboration diagram for CWincvsApp:

[legend]
List of all members.

Public Methods

CWincvsApp ()
CWincvsView * | GetConsoleView (void)
CWinCvsBrowser * | GetBrowserView (void)
void | ActivateBrowserView (void)
CCJShellTree * | GetExplorerView (void)
CBrowseFileView * | GetFileView (void)
CDocument * | GetDocument (void)
CStatusBar * GetStatusBar ()
CString | GetRoot ()
CMainFrame * | GetMainFrame (void)
void | PeekPumpAndIdle (void)
void | UpdateAllDocsView ()
void | GetAppPath (UStr &path) const
void | GetAppModule (UStr &module) const
bool | GetAppVersion (UStr &vers) const
DWORD | GetIdleTime (void) const
void | ResetIdleTime (void)
void | IdleCvsProgress (void)
KiFilterModel * | GetFilterModel () const
KiRecursionModel * | GetRecursionModel () const
KiIgnoreModel * | GetIgnoreModel () const
char * | GetEnvMainThread (const char *name)
virtual BOOL | InitInstance ()
virtual int | ExitInstance ()
virtual BOOL | SaveAllModified ()
virtual BOOL | PreTranslateMessage (MSG *pMsg)

Public Attributes

bool | gCvsRunning
bool | gCvsStopping
int | gLastCvsResult
CMultiDocTemplate * | gLogTempl
CMultiDocTemplate * | gLogGraph
CMultiDocTemplate * | gLogHtml
_CvsProcess * gCvsProcess
bool | m_isBackgroundProcess

Protected Methods

BOOL | InitATL ()
void | LookForResourceFile (const char *what, UStr &path)
afx_msg void | OnFileNew ()
afx_msg void | OnAppAbout ()
afx_msg void | OnAppCopyrights ()
afx_msg void | OnAppCredits ()
afx_msg void | OnLogWindowIsPresent (CCmdUI *pCmdUI)
afx_msg void | OnHelpCvs ()
afx_msg void | OnHelpCvsclient ()

Protected Attributes

DWORD | m_idletime
CMainFrame * m_mainFrame
BOOL | m_bATLInited
COleTemplateServer | m_server

Private Methods

void | ShowTipAtStartup (void)
void | ShowTipOfTheDay (void)

Constructor & Destructor Documentation

CWincvsApp::CWincvsApp ( )

Definition at line 201 of file wincvs.cpp.

References FALSE, gCvsProcess, gCvsRunning, gCvsStopping, gLastCvsResult, m_bATLInited, and m_idletime.

00201                        : m_isBackgroundProcess(false)
00202 {
00203     gCvsRunning = false;
00204     gCvsStopping = false;
00205     gLastCvsResult = 0;
00206     m_idletime = 0;
00207     m_bATLInited = FALSE;
00208     gCvsProcess = 0L;
00209 }

Member Function Documentation

void CWincvsApp::ActivateBrowserView ( void )

Definition at line 747 of file wincvs.cpp.

References CMainFrame::GetWorkspace, m_mainFrame, and CCJTabCtrlBar::SetActiveView.

Referenced by CMainFrame::ChangeLocation.

00748 {
00749     if(m_mainFrame == 0L)
00750         return;
00751
00752     m_mainFrame->GetWorkspace()->SetActiveView(RUNTIME_CLASS(CBrowserBar));
00753 }

int CWincvsApp::ExitInstance ( ) [virtual]

Definition at line 948 of file wincvs.cpp.

References LogCleanup, and CCvsThreadLock::m_lock.

00949 {
00950     // Save existing preferences. This will save, for example,
00951     // the current working directory as "LastWorkingDir" property.
00952     gCvsPrefs.save();
00953
00954     DeleteCriticalSection(&CCvsThreadLock::m_lock);
00955
00956     if (m_bATLInited)
00957     {
00958         LogCleanup();
00959         _Module.RevokeClassObjects();
00960         _Module.Term();
00961         CoUninitialize();
00962     }
00963
00964     return CWinApp::ExitInstance();
00965 }

void CWincvsApp::GetAppModule ( UStr & module ) const

Definition at line 1078 of file wincvs.cpp.

References CStr.

Referenced by myTcl_CreateInterp.

01079 {
01080     module = "";
01081     HINSTANCE hInst = ::AfxGetInstanceHandle();
01082     if(hInst != 0L)
01083     {
01084         char apath[512];
01085         DWORD len = ::GetModuleFileName(hInst, apath, 512);
01086         if(len > 0)
01087         {
01088             module = apath;
01089         }
01090     }
01091 }

void CWincvsApp::GetAppPath ( UStr & path ) const

Definition at line 1061 of file wincvs.cpp.

References CStr.

Referenced by CTipDlg::CTipDlg, getLoc, LookForResourceFile, SettingsGetLoc, and CvsPrefs::WhichCvs.

01062 {
01063     path = "";
01064     HINSTANCE hInst = ::AfxGetInstanceHandle();
01065     if(hInst != 0L)
01066     {
01067         char apath[512];
01068         DWORD len = ::GetModuleFileName(hInst, apath, 512);
01069         CStr uppath;
01070         CStr exefile;
01071         if(len > 0 && ::SplitPath(apath, uppath, exefile))
01072         {
01073             path = uppath;
01074         }
01075     }
01076 }

bool CWincvsApp::GetAppVersion ( UStr & vers ) const

Definition at line 1145 of file wincvs.cpp.

References CStr, and NULL.

Referenced by CAboutDlg::CAboutDlg, InitInstance, OnAppCredits, and CSplashWnd::OnPaint.

01146 {
01147     bool bRet=false;
01148     char  szFullPath[_MAX_PATH];
01149     DWORD len = ::GetModuleFileName(AfxGetInstanceHandle(), szFullPath, sizeof(szFullPath));
01150     DWORD dwVerHnd;
01151     DWORD dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd);
01152     if (dwVerInfoSize && len)
01153     {
01154         // If we were able to get the information, process it:
01155         HANDLE  hMem;
01156         LPVOID  lpvMem;
01157         char    szGetName[256];
01158         int     cchRoot;
01159
01160         hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize);
01161         lpvMem = GlobalLock(hMem);
01162         GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize, lpvMem);
01163         lstrcpy(szGetName, "\\StringFileInfo\\040904b0\\");
01164         cchRoot = lstrlen(szGetName);
01165
01166         BOOL  fRet;
01167         UINT  cchVer = 0;
01168         LPVOID lszVer = NULL;
01169
01170         lstrcpy(&szGetName[cchRoot], "ProductVersion");
01171         fRet = VerQueryValue(lpvMem, szGetName, &lszVer, &cchVer);
01172
01173         if (fRet && cchVer && lszVer)
01174         {
01175             vers = (char *)lszVer;
01176             bRet = true;
01177         }
01178         GlobalUnlock(hMem);
01179         GlobalFree(hMem);
01180     }
01181     return bRet;
01182 }

CWinCvsBrowser * CWincvsApp::GetBrowserView ( void )

Definition at line 728 of file wincvs.cpp.

References CMainFrame::GetBrowserView, and m_mainFrame.

Referenced by CMainFrame::ChangeLocation, GetRoot, InitInstance, CMainFrame::OnBroadcastCmdMsg, CWincvsDoc::OnBrowserOpen, CMainFrame::OnClose, CMainFrame::OnDropFiles, CWincvsDoc::OnSavesettings, CBrowseFileView::ResetView, and CvsPrefs::save.

00729 {
00730     if(m_mainFrame == 0L)
00731         return 0L;
00732
00733     return m_mainFrame->GetBrowserView();
00734 }

CWincvsView * CWincvsApp::GetConsoleView ( void )

Definition at line 712 of file wincvs.cpp.

References CMainFrame::GetConsoleView, and m_mainFrame.

Referenced by CGraphConsole::CGraphConsole, CMainFrame::OnBroadcastCmdMsg, CGraphView::OnLButtonDown, and OnLogWindowIsPresent.

00713 {
00714     if(m_mainFrame == 0L)
00715         return 0L;
00716
00717     return m_mainFrame->GetConsoleView();
00718 }

CDocument * CWincvsApp::GetDocument ( void )

Definition at line 792 of file wincvs.cpp.

References ASSERT, and NULL.

Referenced by InitInstance, and CBrowseFileView::ResetView.

00793 {
00794     CWinApp *app = AfxGetApp();
00795     POSITION post = app->GetFirstDocTemplatePosition();
00796     CDocTemplate* tmpl;
00797     while(post != NULL)
00798     {
00799         tmpl = app->GetNextDocTemplate(post);
00800         POSITION posd = tmpl->GetFirstDocPosition();
00801         CDocument* doc;
00802         while(posd != NULL)
00803         {
00804             doc = tmpl->GetNextDoc(posd);
00805             if(!doc->IsKindOf(RUNTIME_CLASS(CWincvsDoc)))
00806                 continue;
00807             return doc;
00808         }
00809     }
00810     ASSERT(0);
00811     return 0L;
00812 }

char * CWincvsApp::GetEnvMainThread ( const char * name )

Definition at line 1214 of file wincvs.cpp.

References CMainFrame::GetEnvMainThread, and m_mainFrame.

Referenced by glue_getenv.

01215 {
01216     return m_mainFrame->GetEnvMainThread(name);
01217 }

CCJShellTree * CWincvsApp::GetExplorerView ( void )

Definition at line 755 of file wincvs.cpp.

References CMainFrame::GetExplorerView, and m_mainFrame.

Referenced by CMainFrame::OnBroadcastCmdMsg.

00756 {
00757     if(m_mainFrame == 0L)
00758         return 0L;
00759
00760     return m_mainFrame->GetExplorerView();
00761 }

CBrowseFileView * CWincvsApp::GetFileView ( void )

Definition at line 763 of file wincvs.cpp.

References NULL.

Referenced by IdleCvsProgress, InitInstance, CWinCvsBrowser::NotifySelectionChange, CMainFrame::OnActivate, CMainFrame::OnDropFiles, CMyShellTree::OnSelchanged, CMainFrame::OnSysCommand, CWinCvsBrowser::ResetBrowser, and CWinCvsBrowser::ResetView.

00764 {
00765     POSITION post = GetFirstDocTemplatePosition();
00766     CDocTemplate* tmpl;
00767     while(post != NULL)
00768     {
00769         tmpl = GetNextDocTemplate(post);
00770         if(!tmpl->IsKindOf(RUNTIME_CLASS(CMultiDocTemplate)))
00771             continue;
00772         POSITION posd = tmpl->GetFirstDocPosition();
00773         CDocument* doc;
00774         while(posd != NULL)
00775         {
00776             doc = tmpl->GetNextDoc(posd);
00777             if(!doc->IsKindOf(RUNTIME_CLASS(CWincvsDoc)))
00778                 continue;
00779             POSITION posv = doc->GetFirstViewPosition();
00780             CView* view;
00781             while(posv != NULL)
00782             {
00783                 view = doc->GetNextView(posv);
00784                 if(view->IsKindOf(RUNTIME_CLASS(CBrowseFileView)))
00785                     return (CBrowseFileView *)view;
00786             }
00787         }
00788     }
00789     return NULL;
00790 }

KiFilterModel * CWincvsApp::GetFilterModel ( ) const

Definition at line 1357 of file wincvs.cpp.

References CMainFrame::GetFilterModel, and m_mainFrame.

Referenced by KoTraversalContext::KoTraversalContext, CBrowseFileView::OnDestroy, and CBrowseFileView::OnInitialUpdate.

01358 {
01359     return m_mainFrame->GetFilterModel();
01360 }

DWORD CWincvsApp::GetIdleTime ( void ) const [inline]

Definition at line 115 of file wincvs.h.

References m_idletime.

Referenced by CLogoutThread::InitInstance.

00115 { return m_idletime; }

KiIgnoreModel * CWincvsApp::GetIgnoreModel ( ) const

Definition at line 1368 of file wincvs.cpp.

References CMainFrame::GetIgnoreModel, and m_mainFrame.

Referenced by KoTraversalContext::KoTraversalContext, CWinCvsBrowser::OnDestroy, CBrowseFileView::OnDestroy, CWinCvsBrowser::OnInitialUpdate, CBrowseFileView::OnInitialUpdate, and TBrowserFill::TBrowserFill.

01369 {
01370     return m_mainFrame->GetIgnoreModel();
01371 }

CMainFrame* CWincvsApp::GetMainFrame ( void ) [inline]

Definition at line 81 of file wincvs.h.

References m_mainFrame.

Referenced by CWinCvsBrowser::Create, CHistComboBoxEx::DelKeyTest, CLogFrame::OnCmdMsg, CGraphFrame::OnCmdMsg, and CWinCvsBrowser::ResetBrowser.

00081 { return m_mainFrame; }

KiRecursionModel * CWincvsApp::GetRecursionModel ( ) const

Definition at line 1363 of file wincvs.cpp.

References CMainFrame::GetRecursionModel, and m_mainFrame.

Referenced by KoTraversalContext::KoTraversalContext, CBrowseFileView::OnDestroy, and CBrowseFileView::OnInitialUpdate.

01364 {
01365     return m_mainFrame->GetRecursionModel();
01366 }

CString CWincvsApp::GetRoot ( )

Definition at line 736 of file wincvs.cpp.

References GetBrowserView, and CWinCvsBrowser::GetRoot.

Referenced by CCheckout_MAIN::CCheckout_MAIN, and GetRoot.

00737 {
00738     CString root;
00739     CWinCvsBrowser* view = GetBrowserView();
00740     if (view)
00741     {
00742         root = view->GetRoot();
00743     }
00744     return root;
00745 }

CStatusBar * CWincvsApp::GetStatusBar ( )

Definition at line 720 of file wincvs.cpp.

References CMainFrame::GetStatusBar, and m_mainFrame.

Referenced by IdleCvsProgress.

00721 {
00722     if(m_mainFrame == 0L)
00723         return 0L;
00724
00725     return m_mainFrame->GetStatusBar();
00726 }

void CWincvsApp::IdleCvsProgress ( void )

Definition at line 1219 of file wincvs.cpp.

References CBrowseFileView::CheckChanges, cvs_process_is_active, gCvsProcess, gCvsRunning, gCvsStopping, GetFileView, and GetStatusBar.

Referenced by PreTranslateMessage.

01220 {
01221     static bool bWasCvsRunning = false; //to restore the idle message once CVS has stoped
01222
01223     if(!gCvsRunning)
01224     {
01225         if( bWasCvsRunning )
01226         {
01227             bWasCvsRunning = false;
01228
01229             CString strIdleString;
01230             strIdleString.LoadString(AFX_IDS_IDLEMESSAGE);
01231
01232             CStatusBar *bar = GetStatusBar();
01233             if(bar != 0L)
01234                 bar->SetWindowText(strIdleString);
01235         }
01236         return;
01237     }
01238
01239     if(gCvsProcess != 0L)
01240     {
01241         if(!cvs_process_is_active(gCvsProcess))
01242         {
01243             gCvsRunning = false;
01244             gCvsStopping = false;
01245             gCvsProcess = 0L;
01246             GetFileView()->CheckChanges();
01247         }
01248     }
01249
01250     bWasCvsRunning = true;
01251
01252     DWORD whatTimeIsIt = ::GetTickCount();
01253     static DWORD lastTime = 0;
01254     // let's make some stuff every second while cvs is idling
01255     if((whatTimeIsIt - lastTime) < 1000)
01256         return;
01257
01258     lastTime = whatTimeIsIt;
01259     char path[_MAX_PATH];
01260     getcwd(path, _MAX_PATH);
01261     CStatusBar *bar = GetStatusBar();
01262     if(bar != 0L)
01263         bar->SetWindowText(path);
01264 }

BOOL CWincvsApp::InitATL ( ) [protected]

Definition at line 1292 of file wincvs.cpp.

References DEBUG_MESSAGE, CCVS_CoworkerModule::dwThreadID, FALSE, CCVS_CoworkerModule::FindOneOf, IDR_CVS_COWORKER, m_bATLInited, MatchToken, NULL, and TRUE.

Referenced by InitInstance.

01293 {
01294     m_bATLInited = TRUE;
01295
01296 #if _WIN32_WINNT >= 0x0400
01297     HRESULT hRes = CoInitializeEx(NULL, COINIT_MULTITHREADED);
01298 #else
01299     HRESULT hRes = CoInitialize(NULL);
01300 #endif
01301
01302     if (FAILED(hRes))
01303     {
01304         m_bATLInited = FALSE;
01305         return FALSE;
01306     }
01307
01308     _Module.Init(ObjectMap, AfxGetInstanceHandle());
01309     _Module.dwThreadID = GetCurrentThreadId();
01310
01311     LPTSTR lpCmdLine = GetCommandLine(); //this line necessary for _ATL_MIN_CRT
01312     TCHAR szTokens[] = _T("-/");
01313
01314     BOOL bRun = TRUE;
01315     LPCTSTR lpszToken = _Module.FindOneOf(lpCmdLine, szTokens);
01316     while (lpszToken != NULL)
01317     {
01318         if (MatchToken(lpszToken,_T("UnregServer"))) {
01319             _Module.UpdateRegistryFromResource(IDR_CVS_COWORKER, FALSE);
01320             _Module.UnregisterServer(TRUE); //TRUE means typelib is unreg'd
01321             bRun = FALSE;
01322             DEBUG_MESSAGE(_T("Now UNREGISTERED"));
01323             break;
01324         }
01325         if (MatchToken(lpszToken,_T("RegServer"))) {
01326             //RegisterLogging();  // specific to CVS_Coworker
01327             _Module.UpdateRegistryFromResource(IDR_CVS_COWORKER, TRUE);
01328             _Module.RegisterServer(TRUE);
01329             bRun = FALSE;
01330             DEBUG_MESSAGE(_T("REGISTERED"));
01331             break;
01332         }
01333         lpszToken = _Module.FindOneOf(lpszToken, szTokens);
01334     }
01335
01336     if (!bRun)
01337     {
01338         m_bATLInited = FALSE;
01339         _Module.Term();
01340         CoUninitialize();
01341         return FALSE;
01342     }
01343
01344     //StartLogging();         // specific to CVS_Coworker
01345     hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER,REGCLS_MULTIPLEUSE);
01346     if (FAILED(hRes))
01347     {
01348         m_bATLInited = FALSE;
01349         CoUninitialize();
01350         return FALSE;
01351     }
01352
01353     return TRUE;
01354 }

BOOL CWincvsApp::InitInstance ( ) [virtual]

Definition at line 291 of file wincvs.cpp.

References CStr, cvs_err, cvs_out, CSplashWnd::EnableSplashScreen, FALSE, CHistComboBoxEx::FindBestRoot, GetAppVersion, GetBrowserView, GetDocument, GetFileView, CBrowseFileView::GetPath, CWinCvsBrowser::GetRoot, gLogGraph, gLogTempl, ID_APP_PREFERENCES, IDP_OLE_INIT_FAILED, IDP_SOCKETS_INIT_FAILED, IDR_BROWSER, IDR_CNTR_INPLACE, IDR_FILELIST, IDR_FILTER, IDR_GRAPH, IDR_MAINFRAME, IDR_MULTIUSER, IDR_TAGS, InitATL, CCJMDIFrameWnd::InitializeMenu, CMainFrame::InitialShowWindow, CPython_Interp::IsAvail, CTcl_Interp::IsAvail, IsValidHandle, kBold, kNL, kNormal, kUnderline, CCvsThreadLock::m_lock, m_mainFrame, m_server, NULL, PyMacrosReloadAll, CWinCvsBrowser::ResetBrowser, CBrowseFileView::ResetView, SHELL_PYTHON, SHELL_TCL, ShowTipAtStartup, CWinCvsBrowser::StepToLocation, TRUE, and VERIFY.

00292 {
00293 #if qCvsDebug
00294     int tmpDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
00295     tmpDbgFlag |= _CRTDBG_LEAK_CHECK_DF;
00296     _CrtSetDbgFlag(tmpDbgFlag);
00297 #endif
00298     CStr lastWorkingDir;
00299
00300     // David Gravereaux <davygrvy@interwoven.com> suggests this might
00301     // be a work around to the bug #42 (I love the bug number,
00302     // really fits the bug description ;-))
00303 #if 0
00304     if (!IsValidHandle(GetStdHandle(STD_OUTPUT_HANDLE)))
00305     {
00306         SetStdHandle(STD_OUTPUT_HANDLE, 0L);
00307     }
00308 #endif
00309
00310     // CG: The following block was added by the Splash Screen component.
00311     {
00312         CCommandLineInfo cmdInfo;
00313         ParseCommandLine(cmdInfo);
00314
00315         CSplashWnd::EnableSplashScreen(
00316             (!(m_nCmdShow & SW_SHOWMINIMIZED)) && cmdInfo.m_bShowSplash);
00317     }
00318
00319     if (!AfxSocketInit())
00320     {
00321         AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
00322         return FALSE;
00323     }
00324
00325     if (!InitATL())
00326         return FALSE;
00327
00328     // Initialize OLE libraries
00329     if (!AfxOleInit())
00330     {
00331         AfxMessageBox(IDP_OLE_INIT_FAILED);
00332         return FALSE;
00333     }
00334
00335     AfxEnableControlContainer();
00336
00337     // Standard initialization
00338     // If you are not using these features and wish to reduce the size
00339     //  of your final executable, you should remove from the following
00340     //  the specific initialization routines you do not need.
00341
00342 #ifdef _AFXDLL
00343     Enable3dControls();         // Call this when using MFC in a shared DLL
00344 #else
00345     Enable3dControlsStatic();   // Call this when linking to MFC statically
00346 #endif
00347
00348     InitializeCriticalSection(&CCvsThreadLock::m_lock);
00349
00350     // Change the registry key under which our settings are stored.
00351     // You should modify this string to be something appropriate
00352     // such as the name of your company or organization.
00353     SetRegistryKey(_T("WinCvs"));
00354
00355     LoadStdProfileSettings(5);  // Load standard INI file options (including MRU)
00356     gCvsPrefs.load();
00357
00358     CStr strVersion;
00359     GetAppVersion(strVersion);
00360     WriteProfileString(_T(""), _T("Current Version"), strVersion);
00361
00362     //
00363     // We need to make a temp local copy of LastWorkingDir property here,
00364     // because CWinCvsBrowser::OnSelchanging event would override
00365     // LastWorkingDir preference when browser window is created.
00366     //
00367     lastWorkingDir = gCvsPrefs.LastWorkingDir();
00368
00369     // Register the application's document templates.  Document templates
00370     //  serve as the connection between documents, frame windows and views.
00371
00372     gLogTempl = new CMultiDocTemplate(
00373         IDR_MAINFRAME,
00374         RUNTIME_CLASS(CWincvsDoc),
00375         RUNTIME_CLASS(CLogFrame),
00376         RUNTIME_CLASS(CBrowseFileView));
00377     AddDocTemplate(gLogTempl);
00378
00379     gLogGraph = new CMultiDocTemplate(
00380         IDR_GRAPH,
00381         RUNTIME_CLASS(CGraphDoc),
00382         RUNTIME_CLASS(CGraphFrame),
00383         RUNTIME_CLASS(CGraphView));
00384     AddDocTemplate(gLogGraph);
00385
00386     /*gLogHtml = new CMultiDocTemplate(
00387         IDR_GRAPH,
00388         RUNTIME_CLASS(CDocument),
00389         RUNTIME_CLASS(CMDIChildWnd),
00390         RUNTIME_CLASS(CGraphView));
00391     AddDocTemplate(gLogGraph);*/
00392
00393     // Connect the COleTemplateServer to the document template.
00394     //  The COleTemplateServer creates new documents on behalf
00395     //  of requesting OLE containers by using information
00396     //  specified in the document template.
00397     m_server.ConnectTemplate(clsid, gLogTempl, TRUE);
00398         // Note: SDI applications register server objects only if /Embedding
00399         //   or /Automation is present on the command line.
00400
00401     // Register all OLE server factories as running.  This enables the
00402     //  OLE libraries to create objects from other applications.
00403     COleTemplateServer::RegisterAll();
00404         // Note: MDI applications register all server objects without regard
00405         //  to the /Embedding or /Automation on the command line.
00406
00407     // create main MDI Frame window
00408     m_mainFrame = new CMainFrame;
00409     if (!m_mainFrame->LoadFrame(IDR_CNTR_INPLACE))
00410         return FALSE;
00411     m_pMainWnd = m_mainFrame;
00412
00413     // Initialize the cool menus...
00414 #if 0
00415     UINT barIds[] = {IDR_BROWSER, IDR_MAINFRAME, IDR_MULTIUSER, IDR_TAGS, IDR_FILELIST, IDR_FILTER};
00416     m_mainFrame->InitializeMenu(gLogTempl,
00417         IDR_MAINFRAME, barIds, _countof(barIds), IDR_MAINFRAME);
00418     m_mainFrame->InitializeMenu(gLogGraph,
00419         IDR_GRAPH, barIds, _countof(barIds), IDR_GRAPH);
00420 #endif
00421
00422     // Parse command line for standard shell commands, DDE, file open
00423     CCommandLineInfo cmdInfo;
00424     ParseCommandLine(cmdInfo);
00425
00426     // Check to see if launched as OLE server
00427     if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated)
00428     {
00429 #if 0
00430         // Register all OLE server (factories) as running.  This enables the
00431         //  OLE libraries to create objects from other applications.
00432         COleTemplateServer::RegisterAll();
00433 #endif
00434
00435         // Application was run with /Embedding or /Automation.  Don't show the
00436         //  main window in this case.
00437         return TRUE;
00438     }
00439
00440     // When a server application is launched stand-alone, it is a good idea
00441     //  to update the system registry in case it has been damaged.
00442     m_server.UpdateRegistry(OAT_DISPATCH_OBJECT);
00443     COleObjectFactory::UpdateRegistryAll();
00444
00445     //JK - try to resolve the long filename if the argument passed is the short filename (like when it's a call thru SendTo shell menu)
00446     if( -1 != cmdInfo.m_strFileName.Find('~') )
00447     {
00448         CString strLongFileName;
00449         CString strTempTileName = cmdInfo.m_strFileName;
00450
00451         SHFILEINFO sFileInfo;
00452         int nSlashPos = -1;
00453
00454         BOOL bError = FALSE;
00455
00456         while( -1 != (nSlashPos = strTempTileName.ReverseFind(kPathDelimiter)) )
00457         {
00458             if( SHGetFileInfo((LPCTSTR)strTempTileName, 0, &sFileInfo, sizeof(sFileInfo), SHGFI_DISPLAYNAME) )
00459             {
00460                 CString strFileNameBit = strTempTileName.Mid(nSlashPos + 1);
00461
00462                 strLongFileName = sFileInfo.szDisplayName + strLongFileName;
00463                 strLongFileName = kPathDelimiter + strLongFileName;
00464                 strTempTileName = strTempTileName.Left(nSlashPos);
00465             }
00466             else
00467             {
00468                 bError = TRUE;
00469                 break;  //we need it or we get the dead loop
00470             }
00471         }//end while
00472
00473         if( !bError )
00474         {
00475             cmdInfo.m_strFileName = strTempTileName + strLongFileName;
00476         }
00477     }
00478
00479     //JK - open in the directory, so remove the file
00480     CString strOpenDirectory;
00481     CString strSelectFile;
00482     if( !cmdInfo.m_strFileName.IsEmpty() )
00483     {
00484         TCHAR fullpath[_MAX_PATH];
00485         _tfullpath(fullpath, cmdInfo.m_strFileName, _MAX_PATH);
00486         if( GetFileAttributes(cmdInfo.m_strFileName) != 0xFFFFFFFF )
00487         {
00488             cmdInfo.m_strFileName.Replace('/', kPathDelimiter); //normalize path
00489             TCHAR drive[_MAX_DRIVE];
00490             TCHAR dir[_MAX_DIR];
00491             _tsplitpath(fullpath, drive, dir, NULL, NULL);
00492             strSelectFile = fullpath;
00493             _tmakepath(fullpath, drive, dir, NULL, NULL);
00494             strOpenDirectory = fullpath;
00495         }
00496     }
00497
00498     // Dispatch commands specified on the command line
00499     //JK - we need to trick the ProcessShellCommand a bit
00500     //because we might get a directory as a parameter we don't want it to check after the file...
00501     cmdInfo.m_nShellCommand = CCommandLineInfo::FileNew;
00502     if (!ProcessShellCommand(cmdInfo))
00503         return FALSE;
00504
00505     // The one and only window has been initialized, so show and update it.
00506     m_mainFrame/*m_pMainWnd*/->InitialShowWindow(m_nCmdShow);
00507     m_mainFrame/*m_pMainWnd*/->UpdateWindow();
00508
00509     m_mainFrame/*m_pMainWnd*/->DragAcceptFiles();
00510     //CWincvsView *cons = GetConsoleView();
00511     //if(cons != 0L)
00512     //  cons->DragAcceptFiles();
00513
00514
00515     CWinCvsBrowser *browser = GetBrowserView();
00516     CWincvsDoc *doc = (CWincvsDoc *)GetDocument();
00517     if(doc != 0L && browser != 0L)
00518         doc->SetTitle(browser->GetRoot());
00519     CBrowseFileView *fileView = GetFileView();
00520     if(fileView != 0L)
00521     {
00522         if( strOpenDirectory.IsEmpty() )
00523         {
00524             // Goto the last working directory, which was selected
00525             // when WinCVS was closed
00526             if( !lastWorkingDir.empty() && browser->StepToLocation(lastWorkingDir) )
00527             {
00528                 fileView->ResetView(lastWorkingDir, false, (LPCTSTR) 0L);
00529                 gCvsPrefs.SetLastWorkingDir(lastWorkingDir);
00530             }
00531             else
00532                 fileView->ResetView(browser->GetRoot());
00533         }
00534         else
00535         {
00536             CColorConsole out;
00537             out << kBold << "Locating: " << kNormal << kUnderline << cmdInfo.m_strFileName << kNormal <<  kNormal << kNL;
00538
00539             //search the browse location (will create a new location if not found)
00540             extern CMString gHistoryLocs;
00541             CString bestRoot = CHistComboBoxEx::FindBestRoot(gHistoryLocs, strOpenDirectory);
00542             if( !bestRoot.IsEmpty() )
00543             {
00544                 browser->ResetBrowser((LPCTSTR)bestRoot);
00545             }
00546
00547             if( browser->StepToLocation((LPCTSTR)strOpenDirectory) )
00548             {
00549                 fileView->ResetView( (LPCTSTR)strOpenDirectory, false, (LPCTSTR)strSelectFile );
00550             }
00551             else
00552             {
00553                 fileView->ResetView( browser->GetRoot() );
00554             }
00555         }
00556     }
00557
00558     //MacrosReloadAll();
00559     PyMacrosReloadAll();
00560
00561     //JK - if you launch WinCvs with the file or directory as a parameter you obviously don't need a "tip of the day" because you're in a hurry
00562     if( strOpenDirectory.IsEmpty() )
00563     {
00564         // CG: This line inserted by 'Tip of the Day' component.
00565         ShowTipAtStartup();
00566     }
00567
00568     // auto-logout thread
00569     sLogout = new CLogoutThread();
00570     if (sLogout == 0L)
00571     {
00572         cvs_err("Impossible to create the auto-logout thread !\n");
00573     }
00574     else
00575     {
00576         ASSERT_VALID(sLogout);
00577
00578         // Create Thread in a suspended state so we can set the Priority
00579         // before it starts getting away from us
00580         if (!sLogout->CreateThread(CREATE_SUSPENDED))
00581         {
00582             cvs_err("Impossible to start the auto-logout thread (error %d)!\n", GetLastError());
00583             delete sLogout;
00584             sLogout = 0L;
00585         }
00586
00587         if(sLogout != 0L)
00588         {
00589             // If you want to make the sample more sprightly, set the thread priority here
00590             // a little higher. It has been set at idle priority to keep from bogging down
00591             // other apps that may also be running.
00592             VERIFY(sLogout->SetThreadPriority(THREAD_PRIORITY_NORMAL));
00593             // Now the thread can run wild
00594             sLogout->ResumeThread();
00595         }
00596     }
00597
00598     // load preferences. If CVSROOT is not defined
00599     // then prompt first preferences dialog.
00600     if(gCvsPrefs.empty())
00601         SendMessage(*m_mainFrame, WM_COMMAND, ID_APP_PREFERENCES, 0L);
00602         //doc->OnAppPreferences();
00603     else
00604         cvs_out("CVSROOT: %s (%s)\n", (const char *)gCvsPrefs, gAuthen.kindstr());
00605
00606     bool hasTCL = CTcl_Interp::IsAvail();
00607     bool hasPY = CPython_Interp::IsAvail();
00608
00609     if(gCvsPrefs.GetUseShell() == SHELL_PYTHON && !hasPY && hasTCL)
00610     {
00611         gCvsPrefs.SetUseShell(SHELL_TCL);
00612     }
00613     else if(gCvsPrefs.GetUseShell() == SHELL_TCL && hasPY && !hasTCL)
00614     {
00615         gCvsPrefs.SetUseShell(SHELL_PYTHON);
00616     }
00617
00618     if(gCvsPrefs.GetUseShell() == SHELL_TCL)
00619     {
00620         cvs_out("TCL is available, shell is enabled : help (select and press enter)\n");
00621     }
00622
00623     if(!hasTCL && !hasPY)
00624     {
00625         cvs_err("TCL or Python are *not* available, shell is disabled\n");
00626     }
00627
00628     //make sure the current directory is properly setup
00629     if( 0L != fileView )
00630     {
00631         chdir( fileView->GetPath() );
00632     }
00633
00634     return TRUE;
00635 }

void CWincvsApp::LookForResourceFile | ( | const char * | what,
 |  | UStr & | path
 | ) | [protected]

Definition at line 1093 of file wincvs.cpp.

References CStr, GetAppPath, SplitPath, and stat.

Referenced by OnHelpCvs, and OnHelpCvsclient.

01094 {
01095     path = "";
01096     GetAppPath(path);
01097
01098     CString appPath = path;
01099     // first the macro folder may be ./macro
01100     CString test = appPath;
01101     test.TrimRight('\\');
01102     test += "\\";
01103     test += what;
01104
01105     struct stat sb;
01106     if(stat(test, &sb) != -1 && S_ISREG(sb.st_mode))
01107     {
01108         path = test;
01109         return;
01110     }
01111
01112     CStr uppath, file;
01113     while(SplitPath(appPath, uppath, file) && !uppath.empty())
01114     {
01115         test = uppath;
01116         test.TrimRight('\\');
01117         test += "\\";
01118         test += what;
01119
01120         if(stat(test, &sb) != -1 && S_ISREG(sb.st_mode))
01121         {
01122             path = test;
01123             return;
01124         }
01125         appPath = uppath;
01126     }
01127     path = test;
01128 }

void CWincvsApp::OnAppAbout ( ) [protected]

Definition at line 706 of file wincvs.cpp.

00707 {
00708     CAboutDlg aboutDlg;
00709     aboutDlg.DoModal();
00710 }

void CWincvsApp::OnAppCopyrights ( ) [protected]

Definition at line 967 of file wincvs.cpp.

References cvs_out.

00968 {
00969     cvs_out("\nBoth WinCVS and CVS are distributed under the terms of\n");
00970     cvs_out("the GNU General Public Licence (GPL).\n\n");
00971     cvs_out("* MacCVS/WinCvs : maintained by Alexandre Parenteau (aubonbeurre@hotmail.com)\n");
00972     cvs_out("* WinCvs documentation : Copyright © 1999 Don Harper <don@lamrc.com>.\n");
00973     cvs_out("* CVS : Copyright © 1989-1998 Brian Berliner, david d `zoo' zuhn,\n");
00974     cvs_out("        Jeff Polk, and other authors\n");
00975     cvs_out("* CJLIB : Copyright © 1998-99 Kirk Stowell <kstowell@codejockeys.com>\n");
00976     cvs_out("* Kerberos : Copyright © 1997 the Massachusetts Institute of Technology\n");
00977     cvs_out("* TCL : Copyright © Sun Microsystems Inc.\n");
00978     cvs_out("* Python : Copyright © Guido van Rossum\n");
00979     cvs_out("* MFC : Copyright © 1992-1997 Microsoft Corporation\n");
00980     cvs_out("\nSome others copyrights may apply, check the source code for details.\n");
00981 }

void CWincvsApp::OnAppCredits ( ) [protected]

Definition at line 983 of file wincvs.cpp.

References CStr, cvs_out, and GetAppVersion.

00984 {
00985     CStr vers;
00986
00987     if(GetAppVersion(vers))
00988         cvs_out("\n%s - Client/Local\n", (const char *)vers);
00989     else
00990         cvs_out("\nWinCvs 1.2 - Client/Local/\n");
00991     cvs_out("- WinCvs is developed by (alphabetically):\n");
00992     cvs_out("\t* V.Antonevich <v_antonevich@hotmail.com>\n");
00993     cvs_out("\t* Jerzy Kaczorowski  <kaczoroj@hotmail.com>\n");
00994     cvs_out("\t* Alexandre Parenteau <aubonbeurre@hotmail.com>\n");
00995     cvs_out("\t* Others contributors (see the ChangeLog)\n");
00996     cvs_out("- WinCvs page : http://www.cvsgui.org\n");
00997     cvs_out("- cvs page : http://www.cvshome.org\n");
00998     cvs_out("- WinCvs documentation : Don Harper <don@lamrc.com>.\n");
00999     cvs_out("- WinHelp cvs documentation : Norbert Klamann.\n");
01000     cvs_out("- Special thanks to :\n");
01001     cvs_out("\t* The Strata Inc. developpers who are so patients with WinCvs\n");
01002     cvs_out("\t  and help to identify a lot of problems.\n");
01003     cvs_out("\t* All the people who are submitting bugs, patches and\n");
01004     cvs_out("\t  answer the cvsgui mailing list.\n");
01005     cvs_out("- Bug reports, suggestions :\n");
01006     cvs_out("\t* Richard Wesley, Alain Aslag Roy, Eric Aubourg and many others\n");
01007     cvs_out("- Cvs contributors :\n");
01008     cvs_out("\t* Too many to be listed here, see the 'ChangeLog' instead !\n");
01009 }

void CWincvsApp::OnFileNew ( ) [protected]

Definition at line 216 of file wincvs.cpp.

References gLogTempl, and NULL.

00217 {
00218     gLogTempl->OpenDocumentFile(NULL);
00219 }

void CWincvsApp::OnHelpCvs ( ) [protected]

Definition at line 1131 of file wincvs.cpp.

References CStr, and LookForResourceFile.

01132 {
01133     CStr hlp;
01134     LookForResourceFile("cvs.hlp", hlp);
01135     ::WinHelp(*AfxGetMainWnd(), hlp, HELP_CONTENTS, 0L);
01136 }

void CWincvsApp::OnHelpCvsclient ( ) [protected]

Definition at line 1138 of file wincvs.cpp.

References CStr, and LookForResourceFile.

01139 {
01140     CStr hlp;
01141     LookForResourceFile("cvscli.hlp", hlp);
01142     ::WinHelp(*AfxGetMainWnd(), hlp, HELP_CONTENTS, 0L);
01143 }

void CWincvsApp::OnLogWindowIsPresent ( CCmdUI * pCmdUI ) [protected]

Definition at line 211 of file wincvs.cpp.

References GetConsoleView.

00212 {
00213     pCmdUI->Enable(GetConsoleView() != 0L);
00214 }

void CWincvsApp::PeekPumpAndIdle ( void )

Definition at line 1391 of file wincvs.cpp.

References NULL.

Referenced by launchCVS, and testCVS.

01392 {
01393     MSG Msg;
01394     while( ::PeekMessage(&Msg, NULL, 0, 0, PM_NOREMOVE) )
01395     {
01396         PumpMessage();
01397     }
01398
01399     LONG lIdle = 0;
01400     while( OnIdle(lIdle++) )
01401         ;
01402 }

BOOL CWincvsApp::PreTranslateMessage ( MSG * pMsg ) [virtual]

Definition at line 1035 of file wincvs.cpp.

References IdleCvsProgress, m_idletime, CSplashWnd::PreTranslateAppMessage, PyInvalUICache, and TRUE.

01036 {
01037     // CG: The following lines were added by the Splash Screen component.
01038     if (CSplashWnd::PreTranslateAppMessage(pMsg))
01039         return TRUE;
01040
01041     DWORD time = ::GetTickCount();
01042     if (m_idletime == 0 ||
01043         pMsg->message == WM_KEYDOWN ||
01044         pMsg->message == WM_SYSKEYDOWN ||
01045         pMsg->message == WM_LBUTTONDOWN ||
01046         pMsg->message == WM_RBUTTONDOWN ||
01047         pMsg->message == WM_MBUTTONDOWN ||
01048         pMsg->message == WM_NCLBUTTONDOWN ||
01049         pMsg->message == WM_NCRBUTTONDOWN ||
01050         pMsg->message == WM_NCMBUTTONDOWN)
01051     {
01052         m_idletime = time;
01053         PyInvalUICache();
01054     }
01055
01056     IdleCvsProgress();
01057
01058     return CWinApp::PreTranslateMessage(pMsg);
01059 }

void CWincvsApp::ResetIdleTime ( void ) [inline]

Definition at line 116 of file wincvs.h.

References m_idletime.

Referenced by CLogoutThread::InitInstance.

00116 { m_idletime = 0; }

BOOL CWincvsApp::SaveAllModified ( ) [virtual]

Definition at line 1184 of file wincvs.cpp.

References cvs_err, CvsCmdLogout, gCvsStopping, CLogoutThread::KillThread, pserver, TRUE, and WaitForCvs.

01185 {
01186     // prevent from exiting when cvs is running
01187     if(gCvsRunning)
01188     {
01189         gCvsStopping = true;
01190         return TRUE;
01191     }
01192
01193     if(sLogout != 0L)
01194     {
01195         HANDLE hdl = sLogout->m_hThread;
01196         sLogout->KillThread();
01197         WaitForSingleObject(hdl, INFINITE);
01198         //delete sLogout;
01199         sLogout = 0L;
01200     }
01201
01202     // auto-logout
01203     if(gAuthen.kind() == pserver && gCvsPrefs.HasLoogedIn() &&
01204         gCvsPrefs.LogoutTimeOut() > 0)
01205     {
01206         cvs_err("Making automatic logout before quitting:\n");
01207         CvsCmdLogout();
01208         WaitForCvs();
01209     }
01210
01211     return CWinApp::SaveAllModified();
01212 }

void CWincvsApp::ShowTipAtStartup ( void ) [private]

Definition at line 1011 of file wincvs.cpp.

References CTipDlg::m_bStartup, and NULL.

Referenced by InitInstance.

01012 {
01013     // CG: This function added by 'Tip of the Day' component.
01014
01015     CCommandLineInfo cmdInfo;
01016     ParseCommandLine(cmdInfo);
01017     if (cmdInfo.m_bShowSplash)
01018     {
01019         CTipDlg dlg( IsWindow(m_pMainWnd->GetSafeHwnd()) ? m_pMainWnd : NULL );
01020         if (dlg.m_bStartup)
01021             dlg.DoModal();
01022     }
01023
01024 }

void CWincvsApp::ShowTipOfTheDay ( void ) [private]

Definition at line 1026 of file wincvs.cpp.

01027 {
01028     // CG: This function added by 'Tip of the Day' component.
01029
01030     CTipDlg dlg;
01031     dlg.DoModal();
01032
01033 }

void CWincvsApp::UpdateAllDocsView ( )

Definition at line 1373 of file wincvs.cpp.

References NULL.

Referenced by CGraphOptDlg::OnApply, and CGraphView::OnGraphGraphoptions.

01374 {
01375     POSITION pos = GetFirstDocTemplatePosition();
01376     while( pos )
01377     {
01378         CDocTemplate* pTemplate = GetNextDocTemplate(pos);
01379         POSITION pos2 = pTemplate->GetFirstDocPosition();
01380         while(pos2)
01381         {
01382             CDocument* pDocument;
01383             if(pDocument = pTemplate->GetNextDoc(pos2))
01384             {
01385                 pDocument->UpdateAllViews(NULL);
01386             }
01387         }
01388     }
01389 }

Member Data Documentation

struct _CvsProcess* CWincvsApp::gCvsProcess

Definition at line 103 of file wincvs.h.

Referenced by CWincvsApp, IdleCvsProgress, launchCVS, CWincvsDoc::OnStopcvs, testCVS, and WaitForCvs.

bool CWincvsApp::gCvsRunning

Definition at line 87 of file wincvs.h.

Referenced by CWincvsApp, CWinCvsBrowser::DisableCommon, CGraphView::DisableCommon, CExploreBar::DisableCommon, CMyShellTree::DisableCommon, CBrowseFileView::DisableCommon, CCvsStatusBar::DrawItem, IdleCvsProgress, CLogoutThread::InitInstance, IsAppEnabled, launchCVS, CMainFrame::OnClose, CWinCvsBrowser::OnItemexpanding, CBrowseFileView::OnKeydown, CBrowseFileView::OnLButtonDblClk, CWinCvsBrowser::OnRButtonDown, CWinCvsBrowser::OnSelchanging, CWinCvsBrowser::OnSetCursor, CBrowseFileView::OnSetCursor, CCvsStatusBar::OnTimer, CBrowseFileView::OnTimer, CWincvsDoc::OnUpdateCvsCmd, CWincvsDoc::OnUpdateMacroAdmin, CWincvsDoc::OnUpdatePrefs, CWincvsDoc::OnUpdateSavesettings, CWincvsDoc::OnUpdateStopcvs, CWinCvsBrowser::OnUpdateViewReload, CBrowseFileView::OnUpdateViewReload, CBrowseFileView::OnUpdateViewUpone, and testCVS.

bool CWincvsApp::gCvsStopping

Definition at line 90 of file wincvs.h.

Referenced by CWincvsApp, IdleCvsProgress, launchCVS, CWincvsDoc::OnStopcvs, CWincvsDoc::OnUpdateStopcvs, SaveAllModified, and testCVS.

int CWincvsApp::gLastCvsResult

Definition at line 93 of file wincvs.h.

Referenced by CWincvsApp.

CMultiDocTemplate* CWincvsApp::gLogGraph

Definition at line 97 of file wincvs.h.

Referenced by CvsLogParse, and InitInstance.

CMultiDocTemplate* CWincvsApp::gLogHtml

Definition at line 98 of file wincvs.h.

CMultiDocTemplate* CWincvsApp::gLogTempl

Definition at line 96 of file wincvs.h.

Referenced by InitInstance, and OnFileNew.

BOOL CWincvsApp::m_bATLInited [protected]

Definition at line 155 of file wincvs.h.

Referenced by CWincvsApp, and InitATL.

DWORD CWincvsApp::m_idletime [protected]

Definition at line 153 of file wincvs.h.

Referenced by CWincvsApp, GetIdleTime, PreTranslateMessage, and ResetIdleTime.

bool CWincvsApp::m_isBackgroundProcess

Definition at line 144 of file wincvs.h.

Referenced by CMainFrame::OnActivate, and KoWatcher::Run.

CMainFrame* CWincvsApp::m_mainFrame [protected]

Definition at line 154 of file wincvs.h.

Referenced by ActivateBrowserView, GetBrowserView, GetConsoleView, GetEnvMainThread, GetExplorerView, GetFilterModel, GetIgnoreModel, GetMainFrame, GetRecursionModel, GetStatusBar, and InitInstance.

COleTemplateServer CWincvsApp::m_server [protected]

Definition at line 158 of file wincvs.h.

Referenced by InitInstance.

The documentation for this class was generated from the following files:
  • WinCvs/wincvs.h
  • WinCvs/wincvs.cpp
Generated on Sun Feb 24 01:28:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CWinCvsBrowser Class Reference

#include <WinCvsBrowser.h>

Inheritance diagram for CWinCvsBrowser:

[legend]
Collaboration diagram for CWinCvsBrowser:

[legend]
List of all members.

Public Methods

void | NotifySelectionChange ()
void | SetNewStyle (long lStyleMask, BOOL bSetBits)
void | DeleteAllItems (HTREEITEM root=0L)
void | ResetBrowser (const char *path, bool notifyView=false)
void | RetrievePath (HTREEITEM item, UStr &path)
bool | StepToLocation (const char *path, bool notifyView=false)
void | ResetView (bool forceReload=false, bool notifyView=false)
const char * | GetRoot (void) const
void | OnIgnoreChanged ()
virtual BOOL | Create (LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID, CCreateContext *pContext=NULL)
virtual void | OnInitialUpdate ()

Public Attributes

friend | CSelectionChangeNotifier

Protected Methods

CWinCvsBrowser ()
virtual void | OnDraw (CDC *pDC)
virtual BOOL | PreCreateWindow (CREATESTRUCT &cs)
void | StoreExpanded (std::vector< UStr > &allExpanded, HTREEITEM root=0L)
bool | DisableCommon ()
HTREEITEM | GetItemByLocation (const char *path)
virtual | ~CWinCvsBrowser ()
void | OnUpdateCmd (CCmdUI *pCmdUI, BOOL needCvsInfos)
afx_msg void | OnItemexpanding (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnRButtonDown (UINT nFlags, CPoint point)
afx_msg void | OnSelchanging (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnUpdateViewAdd (CCmdUI *pCmdUI)
afx_msg void | OnUpdateViewUpdate (CCmdUI *pCmdUI)
afx_msg void | OnViewAdd ()
afx_msg void | OnViewCommit ()
afx_msg void | OnViewUpdate ()
afx_msg void | OnViewQueryUpdate ()
afx_msg void | OnViewDiff ()
afx_msg void | OnViewLog ()
afx_msg void | OnViewStatus ()
afx_msg void | OnViewUnlock ()
afx_msg void | OnViewWatchOn ()
afx_msg void | OnViewWatchOff ()
afx_msg void | OnViewEdit ()
afx_msg void | OnViewUnedit ()
afx_msg void | OnViewWatchers ()
afx_msg void | OnViewEditors ()
afx_msg void | OnViewRelease ()
afx_msg void | OnViewTagNew ()
afx_msg void | OnViewTagDelete ()
afx_msg void | OnViewTagBranch ()
afx_msg void | OnViewExplore ()
afx_msg void | OnUpdateViewExplore (CCmdUI *pCmdUI)
afx_msg void | OnUpdateViewReload (CCmdUI *pCmdUI)
afx_msg void | OnViewReload ()
afx_msg void | OnViewCheckout ()
afx_msg void | OnUpdateViewCheckout (CCmdUI *pCmdUI)
afx_msg void | OnViewImport ()
afx_msg void | OnUpdateViewImport (CCmdUI *pCmdUI)
afx_msg BOOL | OnSetCursor (CWnd *pWnd, UINT nHitTest, UINT message)
afx_msg void | OnSelchanged (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void | OnDestroy ()
afx_msg void | OnViewReservededit ()
afx_msg void | OnViewForceedit ()
afx_msg void | OnUpdateMacro (CCmdUI *pCmdUI)
afx_msg BOOL | OnMacro (UINT nID)
afx_msg void | OnUpdateCustomize (CCmdUI *pCmdUI)
afx_msg BOOL | OnCustomize (UINT nID)
afx_msg LRESULT | OnResetView (WPARAM, LPARAM)

Protected Attributes

bool | m_isSelectionNotificationLocked
bool | m_isSelectionChanged
bool | m_isResetViewPending
UStr m_root

Static Protected Attributes

CImageList | m_Imagelist

Constructor & Destructor Documentation

CWinCvsBrowser::CWinCvsBrowser ( ) [protected]

Definition at line 116 of file WinCvsBrowser.cpp.

00117 : m_isSelectionNotificationLocked(false)
00118 , m_isSelectionChanged(false)
00119 , m_isResetViewPending(false)
00120 {
00121 }

CWinCvsBrowser::~CWinCvsBrowser ( ) [protected, virtual]

Definition at line 123 of file WinCvsBrowser.cpp.

00124 { }

Member Function Documentation

BOOL CWinCvsBrowser::Create | ( | LPCTSTR | lpszClassName,
 |  | LPCTSTR | lpszWindowName,
 |  | DWORD | dwStyle,
 |  | const RECT & | rect,
 |  | CWnd * | pParentWnd,
 |  | UINT | nID,
 |  | CCreateContext * | pContext = NULL
 | ) | [virtual]

Definition at line 152 of file WinCvsBrowser.cpp.

References CStr, FALSE, CMainFrame::GetBrowseHistory, CWincvsApp::GetMainFrame, CHistComboBoxEx::GetOldLoc, IDI_FOLDER, IDI_FOLDERCVS, IDI_FOLDERIGN, IDI_FOLDERLOST, IDI_FOLDERO, IDI_FOLDEROCVS, IDI_FOLDEROIGN, m_Imagelist, ResetBrowser, SetNewStyle, and TRUE.

Referenced by CBrowserBar::Create.

00153 {
00154     if (!CTreeView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext))
00155     {
00156         return FALSE;
00157     }
00158
00159     if(m_Imagelist.m_hImageList == 0L)
00160         m_Imagelist.Create(16, 16, ILC_MASK, 1, 1);
00161     m_Imagelist.SetBkColor(GetSysColor(COLOR_WINDOW));
00162
00163     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00164     HICON hIcon = app->LoadIcon(IDI_FOLDER);
00165     m_Imagelist.Add(hIcon);
00166     hIcon = app->LoadIcon(IDI_FOLDERO);
00167     m_Imagelist.Add(hIcon);
00168     hIcon = app->LoadIcon(IDI_FOLDERCVS);
00169     m_Imagelist.Add(hIcon);
00170     hIcon = app->LoadIcon(IDI_FOLDEROCVS);
00171     m_Imagelist.Add(hIcon);
00172     hIcon = app->LoadIcon(IDI_FOLDERIGN);
00173     m_Imagelist.Add(hIcon);
00174     hIcon = app->LoadIcon(IDI_FOLDEROIGN);
00175     m_Imagelist.Add(hIcon);
00176     hIcon = app->LoadIcon(IDI_FOLDERLOST);
00177     m_Imagelist.Add(hIcon);
00178
00179     CTreeCtrl& treeCtrl = GetTreeCtrl();
00180     treeCtrl.SetImageList(&m_Imagelist, TVSIL_NORMAL);
00181
00182     // set the initial root
00183     CMainFrame* mainFrm = app->GetMainFrame();
00184     CHistComboBoxEx& hist = mainFrm->GetBrowseHistory();
00185     CStr newpath((const char *)hist.GetOldLoc());
00186     ResetBrowser(newpath, true);
00187
00188     SetNewStyle(TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT, TRUE);
00189
00190     return TRUE;
00191 }

void CWinCvsBrowser::DeleteAllItems ( HTREEITEM root = 0L )

Definition at line 193 of file WinCvsBrowser.cpp.

References ASSERT, CSelectionChangeNotifier, EntnodeData::UnRef, and VERIFY.

Referenced by OnItemexpanding, and ResetBrowser.

00194 {
00195     // we don't want the file view to be notified when things get deleted
00196     // process selection after we are done with all that jazz below
00197     CSelectionChangeNotifier notifier(this, true);
00198
00199     CTreeCtrl& treeCtrl = GetTreeCtrl();
00200     bool eraseRoot = false;
00201     if(root == 0L)
00202     {
00203         root = treeCtrl.GetRootItem( );
00204         eraseRoot = true;
00205     }
00206     if(root == 0L)
00207         return;
00208
00209     HTREEITEM childItem = treeCtrl.GetNextItem(root, TVGN_CHILD);
00210
00211     // erase all the childs
00212     while(childItem != 0L)
00213     {
00214         EntnodeData *data = (EntnodeData *)treeCtrl.GetItemData(childItem);
00215         if(data != 0L) {
00216             treeCtrl.SetItemData(childItem,0L); //So that subsequent references after UnRef() won't SEGV
00217             data->UnRef();  //Or move this one after DeleteAllItems? so we don't loose one system call. For now, safe way
00218         }
00219
00220         DeleteAllItems(childItem);
00221
00222         HTREEITEM nextItem = treeCtrl.GetNextItem(childItem, TVGN_NEXT);
00223         VERIFY(treeCtrl.DeleteItem(childItem));
00224         childItem = nextItem;
00225     }
00226
00227     // erase the root only if initially root was 0L
00228     if(eraseRoot)
00229     {
00230         EntnodeData *data = (EntnodeData *)treeCtrl.GetItemData(root);
00231         ASSERT(data == 0L);
00232
00233         VERIFY(treeCtrl.DeleteItem(root));
00234     }
00235 }

bool CWinCvsBrowser::DisableCommon ( ) [protected]

Definition at line 1288 of file WinCvsBrowser.cpp.

References CWincvsApp::gCvsRunning.

Referenced by OnUpdateCmd, OnUpdateMacro, OnUpdateViewCheckout, OnUpdateViewExplore, and OnUpdateViewImport.

01289 {
01290     CWincvsApp *app = (CWincvsApp *)AfxGetApp();
01291     return app->gCvsRunning || gCvsPrefs.empty();
01292 }

HTREEITEM CWinCvsBrowser::GetItemByLocation ( const char * path ) [protected]

Definition at line 1083 of file WinCvsBrowser.cpp.

References CStr, EntnodeData::kName, and m_root.

Referenced by ResetView.

01084 {
01085     CStr root(m_root);
01086     if(!root.endsWith(kPathDelimiter))
01087         root << kPathDelimiter;
01088     CStr subpath(path);
01089     if(!subpath.endsWith(kPathDelimiter))
01090         subpath << kPathDelimiter;
01091
01092     // check if it is a sub-path
01093     if(strncmp(root, subpath, root.length()) != 0)
01094         return 0L;
01095
01096     CTreeCtrl& treeCtrl = GetTreeCtrl();
01097     HTREEITEM item = treeCtrl.GetRootItem();
01098     if(item == 0L)
01099         return 0L;
01100
01101     // step inside synchronized
01102     const char *tmp = (const char *)subpath + root.length() - 1;
01103     while((tmp = strchr(tmp, kPathDelimiter)) != 0L)
01104     {
01105         const char *name = ++tmp;
01106         if(name[0] == '\0')
01107             break;
01108
01109         CStr subname;
01110         const char *tmp2 = strchr(name, kPathDelimiter);
01111         if(tmp2 == 0L)
01112             subname = name;
01113         else
01114             subname.set(name, tmp2 - name);
01115
01116         HTREEITEM childItem = treeCtrl.GetNextItem(item, TVGN_CHILD);
01117
01118         // find the subitem which matches this name
01119         while(childItem != 0L)
01120         {
01121             EntnodeData *data = (EntnodeData *)treeCtrl.GetItemData(childItem);
01122             if(data != 0L)
01123             {
01124                 if(_stricmp((*data)[EntnodeData::kName], subname) == 0)
01125                 {
01126                     item = childItem;
01127                     break;
01128                 }
01129             }
01130
01131             childItem = treeCtrl.GetNextItem(childItem, TVGN_NEXT);
01132         }
01133         if(childItem == 0L)
01134             return 0L;
01135     }
01136
01137     return item;
01138 }

const char* CWinCvsBrowser::GetRoot ( void ) const [inline]

Definition at line 110 of file WinCvsBrowser.h.

References m_root.

Referenced by CWincvsApp::GetRoot, CWincvsApp::InitInstance, CWincvsDoc::OnSavesettings, and CvsPrefs::save.

00110 { return m_root; }

void CWinCvsBrowser::NotifySelectionChange ( )

Definition at line 714 of file WinCvsBrowser.cpp.

References CStr, CWincvsApp::GetFileView, m_isSelectionNotificationLocked, CBrowseFileView::ResetView, and RetrievePath.

Referenced by OnSelchanged, and CWinCvsBrowser::CSelectionChangeNotifier::~CSelectionChangeNotifier.

00715 {
00716     if(!m_isSelectionNotificationLocked)
00717     {
00718         if (m_isSelectionChanged)
00719         {
00720             CStr path;
00721             HTREEITEM item = GetTreeCtrl().GetSelectedItem();
00722             if (item)
00723             {
00724                 RetrievePath(item, path);
00725                 CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00726                 CBrowseFileView *fileView = app->GetFileView();
00727                 if (fileView)
00728                 {
00729                     fileView->ResetView(path);
00730                 }
00731                 gCvsPrefs.SetLastWorkingDir(path);
00732             }
00733         }
00734     }
00735 }

BOOL CWinCvsBrowser::OnCustomize ( UINT nID ) [protected]

Definition at line 1327 of file WinCvsBrowser.cpp.

References CustomizeMenus, ID_CUST_FILES_MENU, kCustomBrowserMenu, kCustomFilesMenu, and TRUE.

01328 {
01329     CustomizeMenus(nID == ID_CUST_FILES_MENU ? kCustomFilesMenu : kCustomBrowserMenu);
01330     return TRUE;
01331 }

void CWinCvsBrowser::OnDestroy ( ) [protected]

Definition at line 1350 of file WinCvsBrowser.cpp.

References NotificationManager::CheckOut, CWincvsApp::GetIgnoreModel, and KiIgnoreModel::GetNotificationManager.

01351 {
01352     if (CWincvsApp* app = (CWincvsApp *)AfxGetApp())
01353     {
01354         app->GetIgnoreModel()->GetNotificationManager()->CheckOut(this);
01355     }
01356
01357     CTreeView::OnDestroy();
01358 }

void CWinCvsBrowser::OnDraw ( CDC * pDC ) [protected, virtual]

Definition at line 129 of file WinCvsBrowser.cpp.

00130 {
00131     // TODO: add draw code here
00132 }

void CWinCvsBrowser::OnIgnoreChanged ( )

Definition at line 1360 of file WinCvsBrowser.cpp.

References m_isResetViewPending, and WM_RESETVIEW.

01361 {
01362     if (!m_isResetViewPending)
01363     {
01364         m_isResetViewPending = true;
01365         PostMessage(WM_RESETVIEW);
01366     }
01367 }

void CWinCvsBrowser::OnInitialUpdate ( ) [virtual]

Definition at line 952 of file WinCvsBrowser.cpp.

References NotificationManager::CheckIn, CWincvsApp::GetIgnoreModel, KiIgnoreModel::GetNotificationManager, onIgnoreChanged, and VERIFY.

00953 {
00954     CTreeView::OnInitialUpdate();
00955
00956     CTreeCtrl& treeCtrl = GetTreeCtrl();
00957     HTREEITEM root = treeCtrl.GetRootItem( );
00958     if(root != 0L)
00959     {
00960         treeCtrl.Expand(root, TVE_EXPAND);
00961         VERIFY(treeCtrl.Select(root, TVGN_CARET));
00962     }
00963
00964     if (CWincvsApp* app = (CWincvsApp *)AfxGetApp())
00965     {
00966         app->GetIgnoreModel()->GetNotificationManager()->CheckIn(this, onIgnoreChanged);
00967     }
00968 }

void CWinCvsBrowser::OnItemexpanding | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 559 of file WinCvsBrowser.cpp.

References ENTNODE::Compare, CStr, ENTNODE::Data, DeleteAllItems, ENT_SUBDIR, Entries_SetMissing, FileTraverse, CWincvsApp::gCvsRunning, CSortList::Get, EntnodeData::GetType, EntnodeData::IsMissing, kIconFolderIgnoreLost, EntnodeData::kName, kTraversal, CSortList::NumOfElements, EntnodeData::Ref, RetrievePath, and TRUE.

00560 {
00561     // prevent from changing directory if cvs is running
00562     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00563     if(app->gCvsRunning)
00564     {
00565         *pResult = TRUE;
00566         return;
00567     }
00568
00569     CTreeCtrl& treeCtrl = GetTreeCtrl();
00570     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00571
00572     HTREEITEM item = pNMTreeView->itemNew.hItem;
00573
00574     EntnodeData *data = (EntnodeData *)treeCtrl.GetItemData(item);
00575     if(data != 0L && data->IsMissing())
00576     {
00577         *pResult = TRUE;
00578         return;
00579     }
00580
00581     // erase all the childs
00582     DeleteAllItems(item);
00583
00584     CStr path;
00585     RetrievePath(item, path);
00586
00587     if(pNMTreeView->action & TVE_COLLAPSE)
00588     {
00589         TBrowserFillDummy traverse(treeCtrl, 0L, item, 0L);
00590         kTraversal res = FileTraverse(path, traverse);
00591     }
00592     else if(pNMTreeView->action & TVE_EXPAND)
00593     {
00594         CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00595         TBrowserFill traverse(treeCtrl, 0L, item, entries);
00596         kTraversal res = FileTraverse(path, traverse);
00597
00598         // add the missing folders
00599         Entries_SetMissing(entries);
00600         int numEntries = entries.NumOfElements();
00601         for(int i = 0; i < numEntries; i++)
00602         {
00603             const ENTNODE & theNode = entries.Get(i);
00604             EntnodeData *data = theNode.Data();
00605             if(!data->IsMissing() || data->GetType() != ENT_SUBDIR)
00606                 continue;
00607
00608             TV_INSERTSTRUCT tvstruct;
00609             tvstruct.hParent = item;
00610             tvstruct.hInsertAfter = TVI_SORT;
00611             tvstruct.item.iImage = kIconFolderIgnoreLost;
00612             tvstruct.item.iSelectedImage = kIconFolderIgnoreLost;
00613             tvstruct.item.pszText = (char *)(*data)[EntnodeData::kName];
00614             tvstruct.item.lParam = (long)data->Ref();
00615             tvstruct.item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT | TVIF_PARAM;
00616             treeCtrl.InsertItem(&tvstruct);
00617
00618         }
00619     }
00620
00621     *pResult = 0;
00622 }

BOOL CWinCvsBrowser::OnMacro ( UINT nID ) [protected]

Definition at line 1232 of file WinCvsBrowser.cpp.

References PyDoPython, and WINCMD_to_UCMD.

01233 {
01234     PyDoPython(WINCMD_to_UCMD(nID));
01235
01236     return 1;
01237 }

void CWinCvsBrowser::OnRButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 653 of file WinCvsBrowser.cpp.

References CWincvsApp::gCvsRunning, and kCustomBrowserMenu.

00654 {
00655     // prevent from changing directory if cvs is running
00656     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00657     if(app->gCvsRunning)
00658         return;
00659
00660     // prompt a menu when hitting a selection
00661     // with the right button...
00662     CTreeCtrl& treeCtrl = GetTreeCtrl();
00663     UINT pFlags;
00664     HTREEITEM testItem = treeCtrl.HitTest(point, &pFlags);
00665     if(testItem != 0L && (pFlags & (TVHT_ONITEM|TVHT_ONITEMBUTTON)) != 0)
00666     {
00667         treeCtrl.SelectItem(testItem);
00668         // Locate the submenu AFTER item selection
00669         CMenu* pMyMenu=::GetCustomMenu(kCustomBrowserMenu,this);
00670         if (pMyMenu)
00671         {
00672             ClientToScreen(&point);
00673             pMyMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON, point.x, point.y, this);
00674             delete pMyMenu;
00675             return;
00676         }
00677     }
00678     CTreeView::OnRButtonDown(nFlags, point);    //L->R
00679 }

LRESULT CWinCvsBrowser::OnResetView | ( | WPARAM | ,
 |  | LPARAM |
 | ) | [protected]

Definition at line 1369 of file WinCvsBrowser.cpp.

References ResetView.

01370 {
01371     ResetView(true, false);
01372     return 0;
01373 }

void CWinCvsBrowser::OnSelchanged | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 705 of file WinCvsBrowser.cpp.

References m_isSelectionChanged, and NotifySelectionChange.

00706 {
00707     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00708     m_isSelectionChanged = true;
00709     NotifySelectionChange();
00710
00711     *pResult = 0;
00712 }

void CWinCvsBrowser::OnSelchanging | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 681 of file WinCvsBrowser.cpp.

References CWincvsApp::gCvsRunning, EntnodeData::IsMissing, and TRUE.

00682 {
00683     // prevent from changing directory if cvs is running
00684     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00685     if(app->gCvsRunning)
00686     {
00687         *pResult = TRUE;
00688         return;
00689     }
00690
00691     CTreeCtrl& treeCtrl = GetTreeCtrl();
00692     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00693     HTREEITEM item = pNMTreeView->itemNew.hItem;
00694
00695     EntnodeData *data = (EntnodeData *)treeCtrl.GetItemData(item);
00696     if(data != 0L && data->IsMissing())
00697     {
00698         *pResult = TRUE;
00699         return;
00700     }
00701
00702     *pResult = 0;
00703 }

BOOL CWinCvsBrowser::OnSetCursor | ( | CWnd * | pWnd,
 |  | UINT | nHitTest,
 |  | UINT | message
 | ) | [protected]

Definition at line 1338 of file WinCvsBrowser.cpp.

References CWincvsApp::gCvsRunning, and TRUE.

01339 {
01340     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01341     if(app->gCvsRunning)
01342     {
01343         SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
01344         return TRUE;
01345     }
01346
01347     return CTreeView::OnSetCursor(pWnd, nHitTest, message);
01348 }

void CWinCvsBrowser::OnUpdateCmd | ( | CCmdUI * | pCmdUI,
 |  | BOOL | needCvsInfos
 | ) | [protected]

Definition at line 624 of file WinCvsBrowser.cpp.

References CStr, DisableCommon, FALSE, RetrievePath, and stat.

Referenced by OnUpdateViewAdd, and OnUpdateViewUpdate.

00625 {
00626     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00627     if(DisableCommon())
00628     {
00629         pCmdUI->Enable(FALSE);
00630         return;
00631     }
00632     CTreeCtrl& treeCtrl = GetTreeCtrl();
00633     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00634     if(selItem == 0L)
00635     {
00636         pCmdUI->Enable(FALSE);
00637         return;
00638     }
00639
00640     CStr path;
00641     RetrievePath(selItem, path);
00642     if(!path.endsWith(kPathDelimiter))
00643         path << kPathDelimiter;
00644     path << "CVS";
00645
00646     struct stat sb;
00647     if (stat(path, &sb) == -1 || !S_ISDIR(sb.st_mode))
00648         pCmdUI->Enable(!needCvsInfos);
00649     else
00650         pCmdUI->Enable(needCvsInfos);
00651 }

void CWinCvsBrowser::OnUpdateCustomize ( CCmdUI * pCmdUI ) [protected]

Definition at line 1333 of file WinCvsBrowser.cpp.

References TRUE.

01334 {
01335     pCmdUI->Enable(TRUE);
01336 }

void CWinCvsBrowser::OnUpdateMacro ( CCmdUI * pCmdUI ) [protected]

Definition at line 1239 of file WinCvsBrowser.cpp.

References CStr, DisableCommon, FALSE, UCmdUI::pCmdUI, PyAppendCache, PyDoCmdUI, PyIsUICacheValid, RetrievePath, SplitPath, EntnodeData::UnRef, EntnodePath::UnRef, and WINCMD_to_UCMD.

01240 {
01241     if(DisableCommon())
01242     {
01243         pCmdUI->Enable(FALSE);
01244         return;
01245     }
01246
01247     // fill the cache with current selection
01248     if(!PyIsUICacheValid())
01249     {
01250         CTreeCtrl& treeCtrl = GetTreeCtrl();
01251         HTREEITEM selItem = treeCtrl.GetSelectedItem();
01252         if(selItem != 0L)
01253         {
01254             CStr selPath;
01255             RetrievePath(selItem, selPath);
01256             CStr uppath, folder;
01257             SplitPath(selPath, uppath, folder);
01258
01259             bool deleteData = false;
01260             EntnodeData *data = (EntnodeData *)treeCtrl.GetItemData(selItem);
01261             if(data == 0L)
01262             {
01263                 deleteData = true;
01264                 EntnodePath *thePath = new EntnodePath(uppath);
01265                 data = new EntnodeFolder(folder, thePath);
01266                 thePath->UnRef();
01267             }
01268
01269             PyAppendCache(data);
01270
01271             if(deleteData)
01272                 data->UnRef();
01273         }
01274     }
01275
01276     UCmdUI ucmdui(WINCMD_to_UCMD(pCmdUI->m_nID));
01277     ucmdui.pCmdUI = pCmdUI;
01278     PyDoCmdUI(&ucmdui);
01279 }

void CWinCvsBrowser::OnUpdateViewAdd ( CCmdUI * pCmdUI ) [protected]

Definition at line 737 of file WinCvsBrowser.cpp.

References FALSE, and OnUpdateCmd.

00738 {
00739     OnUpdateCmd(pCmdUI, FALSE);
00740 }

void CWinCvsBrowser::OnUpdateViewCheckout ( CCmdUI * pCmdUI ) [protected]

Definition at line 1300 of file WinCvsBrowser.cpp.

References DisableCommon, FALSE, and TRUE.

01301 {
01302     if(DisableCommon())
01303     {
01304         pCmdUI->Enable(FALSE);
01305         return;
01306     }
01307     pCmdUI->Enable(TRUE);
01308     pCmdUI->SetText("Chec&kout module...");
01309 }

void CWinCvsBrowser::OnUpdateViewExplore ( CCmdUI * pCmdUI ) [protected]

Definition at line 985 of file WinCvsBrowser.cpp.

References DisableCommon, FALSE, and TRUE.

00986 {
00987     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00988     if(DisableCommon())
00989     {
00990         pCmdUI->Enable(FALSE);
00991         return;
00992     }
00993     CTreeCtrl& treeCtrl = GetTreeCtrl();
00994     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00995     if(selItem == 0L)
00996     {
00997         pCmdUI->Enable(FALSE);
00998         return;
00999     }
01000     pCmdUI->Enable(TRUE);
01001 }

void CWinCvsBrowser::OnUpdateViewImport ( CCmdUI * pCmdUI ) [protected]

Definition at line 1316 of file WinCvsBrowser.cpp.

References DisableCommon, FALSE, and TRUE.

01317 {
01318     if(DisableCommon())
01319     {
01320         pCmdUI->Enable(FALSE);
01321         return;
01322     }
01323     pCmdUI->Enable(TRUE);
01324     pCmdUI->SetText("&Import module...");
01325 }

void CWinCvsBrowser::OnUpdateViewReload ( CCmdUI * pCmdUI ) [protected]

Definition at line 1221 of file WinCvsBrowser.cpp.

References CWincvsApp::gCvsRunning.

01222 {
01223     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01224     pCmdUI->Enable(!app->gCvsRunning);
01225 }

void CWinCvsBrowser::OnUpdateViewUpdate ( CCmdUI * pCmdUI ) [protected]

Definition at line 742 of file WinCvsBrowser.cpp.

References OnUpdateCmd, and TRUE.

00743 {
00744     OnUpdateCmd(pCmdUI, TRUE);
00745 }

void CWinCvsBrowser::OnViewAdd ( ) [protected]

Definition at line 747 of file WinCvsBrowser.cpp.

References CStr, CvsCmdAddFolder, and RetrievePath.

00748 {
00749     CTreeCtrl& treeCtrl = GetTreeCtrl();
00750     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00751
00752     CStr path;
00753     RetrievePath(selItem, path);
00754     CvsCmdAddFolder(path);
00755 }

void CWinCvsBrowser::OnViewCheckout ( ) [protected]

Definition at line 1295 of file WinCvsBrowser.cpp.

References CvsCmdCheckoutModule.

01296 {
01297     CvsCmdCheckoutModule();
01298 }

void CWinCvsBrowser::OnViewCommit ( ) [protected]

Definition at line 757 of file WinCvsBrowser.cpp.

References CStr, CvsCmdCommitFolder, and RetrievePath.

00758 {
00759     CTreeCtrl& treeCtrl = GetTreeCtrl();
00760     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00761
00762     CStr path;
00763     RetrievePath(selItem, path);
00764     CvsCmdCommitFolder(path);
00765 }

void CWinCvsBrowser::OnViewDiff ( ) [protected]

Definition at line 787 of file WinCvsBrowser.cpp.

References CStr, CvsCmdDiffFolder, and RetrievePath.

00788 {
00789     CTreeCtrl& treeCtrl = GetTreeCtrl();
00790     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00791
00792     CStr path;
00793     RetrievePath(selItem, path);
00794     CvsCmdDiffFolder(path);
00795 }

void CWinCvsBrowser::OnViewEdit ( ) [protected]

Definition at line 847 of file WinCvsBrowser.cpp.

References CStr, CvsCmdEditFolder, and RetrievePath.

00848 {
00849     CTreeCtrl& treeCtrl = GetTreeCtrl();
00850     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00851
00852     CStr path;
00853     RetrievePath(selItem, path);
00854     CvsCmdEditFolder(path);
00855 }

void CWinCvsBrowser::OnViewEditors ( ) [protected]

Definition at line 897 of file WinCvsBrowser.cpp.

References CStr, CvsCmdEditorsFolder, and RetrievePath.

00898 {
00899     CTreeCtrl& treeCtrl = GetTreeCtrl();
00900     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00901
00902     CStr path;
00903     RetrievePath(selItem, path);
00904     CvsCmdEditorsFolder(path);
00905 }

void CWinCvsBrowser::OnViewExplore ( ) [protected]

Definition at line 970 of file WinCvsBrowser.cpp.

References CStr, cvs_err, and RetrievePath.

00971 {
00972     CTreeCtrl& treeCtrl = GetTreeCtrl();
00973     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00974
00975     CStr path;
00976     RetrievePath(selItem, path);
00977     HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), "explore", path,
00978             0L, 0L, SW_SHOWDEFAULT);
00979     if((long)hInst < 32)
00980     {
00981         cvs_err("Unable to explore '%s' (error %d)\n", (char *)path, GetLastError());
00982     }
00983 }

void CWinCvsBrowser::OnViewForceedit ( ) [protected]

Definition at line 867 of file WinCvsBrowser.cpp.

References CStr, CvsCmdEditFolder, kEditForce, and RetrievePath.

00868 {
00869     CTreeCtrl& treeCtrl = GetTreeCtrl();
00870     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00871
00872     CStr path;
00873     RetrievePath(selItem, path);
00874     CvsCmdEditFolder(path, kEditForce);
00875 }

void CWinCvsBrowser::OnViewImport ( ) [protected]

Definition at line 1311 of file WinCvsBrowser.cpp.

References CvsCmdImportModule.

01312 {
01313     CvsCmdImportModule();
01314 }

void CWinCvsBrowser::OnViewLog ( ) [protected]

Definition at line 797 of file WinCvsBrowser.cpp.

References CStr, CvsCmdLogFolder, and RetrievePath.

00798 {
00799     CTreeCtrl& treeCtrl = GetTreeCtrl();
00800     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00801
00802     CStr path;
00803     RetrievePath(selItem, path);
00804     CvsCmdLogFolder(path);
00805 }

void CWinCvsBrowser::OnViewQueryUpdate ( ) [protected]

Definition at line 777 of file WinCvsBrowser.cpp.

References CStr, CvsCmdUpdateFolder, and RetrievePath.

00778 {
00779     CTreeCtrl& treeCtrl = GetTreeCtrl();
00780     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00781
00782     CStr path;
00783     RetrievePath(selItem, path);
00784     CvsCmdUpdateFolder(path, true);
00785 }

void CWinCvsBrowser::OnViewRelease ( ) [protected]

Definition at line 907 of file WinCvsBrowser.cpp.

References CStr, CvsCmdReleaseFolder, and RetrievePath.

00908 {
00909     CTreeCtrl& treeCtrl = GetTreeCtrl();
00910     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00911
00912     CStr path;
00913     RetrievePath(selItem, path);
00914     CvsCmdReleaseFolder(path);
00915 }

void CWinCvsBrowser::OnViewReload ( ) [protected]

Definition at line 1227 of file WinCvsBrowser.cpp.

References ResetView.

01228 {
01229     ResetView(true, true);
01230 }

void CWinCvsBrowser::OnViewReservededit ( ) [protected]

Definition at line 857 of file WinCvsBrowser.cpp.

References CStr, CvsCmdEditFolder, kEditReserved, and RetrievePath.

00858 {
00859     CTreeCtrl& treeCtrl = GetTreeCtrl();
00860     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00861
00862     CStr path;
00863     RetrievePath(selItem, path);
00864     CvsCmdEditFolder(path, kEditReserved);
00865 }

void CWinCvsBrowser::OnViewStatus ( ) [protected]

Definition at line 807 of file WinCvsBrowser.cpp.

References CStr, CvsCmdStatusFolder, and RetrievePath.

00808 {
00809     CTreeCtrl& treeCtrl = GetTreeCtrl();
00810     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00811
00812     CStr path;
00813     RetrievePath(selItem, path);
00814     CvsCmdStatusFolder(path);
00815 }

void CWinCvsBrowser::OnViewTagBranch ( ) [protected]

Definition at line 937 of file WinCvsBrowser.cpp.

References CStr, CvsCmdTagBranchFolder, and RetrievePath.

00938 {
00939     CTreeCtrl& treeCtrl = GetTreeCtrl();
00940     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00941
00942     CStr path;
00943     RetrievePath(selItem, path);
00944     CvsCmdTagBranchFolder(path);
00945 }

void CWinCvsBrowser::OnViewTagDelete ( ) [protected]

Definition at line 927 of file WinCvsBrowser.cpp.

References CStr, CvsCmdTagDeleteFolder, and RetrievePath.

00928 {
00929     CTreeCtrl& treeCtrl = GetTreeCtrl();
00930     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00931
00932     CStr path;
00933     RetrievePath(selItem, path);
00934     CvsCmdTagDeleteFolder(path);
00935 }

void CWinCvsBrowser::OnViewTagNew ( ) [protected]

Definition at line 917 of file WinCvsBrowser.cpp.

References CStr, CvsCmdTagCreateFolder, and RetrievePath.

00918 {
00919     CTreeCtrl& treeCtrl = GetTreeCtrl();
00920     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00921
00922     CStr path;
00923     RetrievePath(selItem, path);
00924     CvsCmdTagCreateFolder(path);
00925 }

void CWinCvsBrowser::OnViewUnedit ( ) [protected]

Definition at line 877 of file WinCvsBrowser.cpp.

References CStr, CvsCmdUneditFolder, and RetrievePath.

00878 {
00879     CTreeCtrl& treeCtrl = GetTreeCtrl();
00880     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00881
00882     CStr path;
00883     RetrievePath(selItem, path);
00884     CvsCmdUneditFolder(path);
00885 }

void CWinCvsBrowser::OnViewUnlock ( ) [protected]

Definition at line 817 of file WinCvsBrowser.cpp.

References CStr, CvsCmdUnlockFolder, and RetrievePath.

00818 {
00819     CTreeCtrl& treeCtrl = GetTreeCtrl();
00820     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00821
00822     CStr path;
00823     RetrievePath(selItem, path);
00824     CvsCmdUnlockFolder(path);
00825 }

void CWinCvsBrowser::OnViewUpdate ( ) [protected]

Definition at line 767 of file WinCvsBrowser.cpp.

References CStr, CvsCmdUpdateFolder, and RetrievePath.

00768 {
00769     CTreeCtrl& treeCtrl = GetTreeCtrl();
00770     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00771
00772     CStr path;
00773     RetrievePath(selItem, path);
00774     CvsCmdUpdateFolder(path);
00775 }

void CWinCvsBrowser::OnViewWatchers ( ) [protected]

Definition at line 887 of file WinCvsBrowser.cpp.

References CStr, CvsCmdWatchersFolder, and RetrievePath.

00888 {
00889     CTreeCtrl& treeCtrl = GetTreeCtrl();
00890     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00891
00892     CStr path;
00893     RetrievePath(selItem, path);
00894     CvsCmdWatchersFolder(path);
00895 }

void CWinCvsBrowser::OnViewWatchOff ( ) [protected]

Definition at line 837 of file WinCvsBrowser.cpp.

References CStr, CvsCmdWatchOffFolder, and RetrievePath.

00838 {
00839     CTreeCtrl& treeCtrl = GetTreeCtrl();
00840     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00841
00842     CStr path;
00843     RetrievePath(selItem, path);
00844     CvsCmdWatchOffFolder(path);
00845 }

void CWinCvsBrowser::OnViewWatchOn ( ) [protected]

Definition at line 827 of file WinCvsBrowser.cpp.

References CStr, CvsCmdWatchOnFolder, and RetrievePath.

00828 {
00829     CTreeCtrl& treeCtrl = GetTreeCtrl();
00830     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00831
00832     CStr path;
00833     RetrievePath(selItem, path);
00834     CvsCmdWatchOnFolder(path);
00835 }

BOOL CWinCvsBrowser::PreCreateWindow ( CREATESTRUCT & cs ) [protected, virtual]

Definition at line 1281 of file WinCvsBrowser.cpp.

01282 {
01283     cs.style |= WS_TABSTOP | TVS_SHOWSELALWAYS;
01284
01285     return CTreeView::PreCreateWindow(cs);
01286 }

void CWinCvsBrowser::ResetBrowser | ( | const char * | path,
 |  | bool | notifyView = false
 | ) |

Definition at line 459 of file WinCvsBrowser.cpp.

References AskCreatePersistentSettings, CStr, DeleteAllItems, UStr::empty, UStr::endsWith, FileTraverse, CMainFrame::GetBrowseHistory, CWincvsApp::GetFileView, CWincvsApp::GetMainFrame, HasPersistentSettings, kTraversal, LoadPersistentSettings, m_root, CHistComboBoxEx::NewRoot, stat, stricmp, and VERIFY.

Referenced by CMainFrame::ChangeLocation, Create, CWincvsApp::InitInstance, CWincvsDoc::OnBrowserOpen, CMainFrame::OnClose, and ResetView.

00460 {
00461     CWaitCursor doWait;
00462
00463     // Must make a copy of 'path' before calling DeleteAllItems(), since
00464     // this function may have been called with 'm_root' passed as the first
00465     // parameter (in fact it is in several places in the code) whose value
00466     // gets deleted by the call to DeleteAllItems() below, making 'path'
00467     // point to an invalid memory location
00468     CStr pathCopy(path);
00469     DeleteAllItems();
00470     bool isReload = !pathCopy.empty() && !m_root.empty() && stricmp(m_root, pathCopy) == 0;
00471
00472     m_root = pathCopy;
00473
00474     if(pathCopy.empty())
00475         return;
00476
00477     if(!isReload)
00478     {
00479         if(HasPersistentSettings(m_root))
00480             LoadPersistentSettings(m_root);
00481         else
00482         {
00483             // check if the path has a CVS folder. If not,
00484             // we don't want the user to be prompted (like when
00485             // WinCvs is starting for the first time).
00486             UStr cvsFolder(m_root);
00487             if(!cvsFolder.endsWith(kPathDelimiter))
00488                 cvsFolder << kPathDelimiter;
00489             cvsFolder << "CVS";
00490             struct stat sb;
00491             if (stat(cvsFolder, &sb) != -1 && S_ISDIR(sb.st_mode))
00492                 AskCreatePersistentSettings(m_root);
00493         }
00494     }
00495
00496     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00497     CMainFrame* mainFrm = app->GetMainFrame();
00498     CHistComboBoxEx& hist = mainFrm->GetBrowseHistory();
00499     hist.NewRoot(m_root);
00500
00501     CTreeCtrl& treeCtrl = GetTreeCtrl();
00502     TBrowserFillDummy traverse(treeCtrl, 0L, 0L, 0L);
00503     kTraversal res = FileTraverse(m_root, traverse);
00504
00505     CBrowseFileView *fileView = app->GetFileView();
00506     if(fileView != 0L)
00507     {
00508         HTREEITEM root = treeCtrl.GetRootItem( );
00509         if(root != 0L)
00510         {
00511             treeCtrl.Expand(root, TVE_EXPAND);
00512             if(notifyView)
00513             {
00514                 VERIFY(treeCtrl.Select(root, TVGN_CARET));
00515             }
00516         }
00517     }
00518 }

void CWinCvsBrowser::ResetView | ( | bool | forceReload = false,
 |  | bool | notifyView = false
 | ) |

Definition at line 1170 of file WinCvsBrowser.cpp.

References CStr, CWincvsApp::GetFileView, GetItemByLocation, m_isResetViewPending, m_root, ResetBrowser, CBrowseFileView::ResetView, RetrievePath, StepToLocation, StoreExpanded, and VERIFY.

Referenced by OnResetView, OnViewReload, and CBrowseFileView::ResetView.

01171 {
01172     // no outstanding request to reset the view any more
01173     m_isResetViewPending = false;
01174
01175     CWaitCursor doWait;
01176     CWndRedrawMngr redrawMngr(this);
01177
01178     bool contentChanged = false;
01179     vector<CStr> allExpanded;
01180     StoreExpanded(allExpanded);
01181     CTreeCtrl& treeCtrl = GetTreeCtrl();
01182     CStr selPath;
01183     HTREEITEM selItem = treeCtrl.GetSelectedItem();
01184     if(selItem != 0L)
01185         RetrievePath(selItem, selPath);
01186
01187     if(forceReload)
01188     {
01189         ResetBrowser(m_root);
01190         contentChanged = true;
01191     }
01192
01193     if(contentChanged)
01194     {
01195         // restore the expanded paths and the selected item
01196         vector<CStr>::const_iterator i;
01197         for(i = allExpanded.begin(); i != allExpanded.end(); ++i)
01198         {
01199             StepToLocation(*i);
01200         }
01201         if(!selPath.empty())
01202         {
01203             selItem = GetItemByLocation(selPath);
01204             if(selItem != 0L)
01205             {
01206                 VERIFY(treeCtrl.Select(selItem, TVGN_CARET));
01207                 treeCtrl.EnsureVisible(selItem);
01208             }
01209         }
01210     }
01211
01212     // we don't need to notify the file view if we force the reload
01213     // because that's already done
01214     if(notifyView)
01215     {
01216         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01217         app->GetFileView()->ResetView();
01218     }
01219 }

void CWinCvsBrowser::RetrievePath | ( | HTREEITEM | item,
 |  | UStr & | path
 | ) |

Definition at line 533 of file WinCvsBrowser.cpp.

References CStr, m_root, and VERIFY.

Referenced by NotifySelectionChange, OnItemexpanding, OnUpdateCmd, OnUpdateMacro, OnViewAdd, OnViewCommit, OnViewDiff, OnViewEdit, OnViewEditors, OnViewExplore, OnViewForceedit, OnViewLog, OnViewQueryUpdate, OnViewRelease, OnViewReservededit, OnViewStatus, OnViewTagBranch, OnViewTagDelete, OnViewTagNew, OnViewUnedit, OnViewUnlock, OnViewUpdate, OnViewWatchers, OnViewWatchOff, OnViewWatchOn, ResetView, and StoreExpanded.

00534 {
00535     CTreeCtrl& treeCtrl = GetTreeCtrl();
00536     CStr tmp, newPath;
00537     path = "";
00538     TV_ITEM pItem;
00539     char name[512];
00540     do
00541     {
00542         pItem.hItem = item;
00543         pItem.pszText = name;
00544         pItem.cchTextMax = 512;
00545         pItem.mask = TVIF_HANDLE | TVIF_TEXT;
00546
00547         VERIFY(treeCtrl.GetItem(&pItem));
00548         item = treeCtrl.GetParentItem(item);
00549
00550         tmp = path;
00551         newPath = item == 0L ? (const char *)m_root : pItem.pszText;
00552         if(!newPath.endsWith(kPathDelimiter))
00553             newPath << kPathDelimiter;
00554         newPath << path;
00555         path = newPath;
00556     } while(item != 0L);
00557 }

void CWinCvsBrowser::SetNewStyle | ( | long | lStyleMask,
 |  | BOOL | bSetBits
 | ) |

Definition at line 520 of file WinCvsBrowser.cpp.

References NULL.

Referenced by Create.

00521 {
00522     long        lStyleOld;
00523
00524     lStyleOld = GetWindowLong(m_hWnd, GWL_STYLE);
00525     lStyleOld &= ~lStyleMask;
00526     if (bSetBits)
00527         lStyleOld |= lStyleMask;
00528
00529     SetWindowLong(m_hWnd, GWL_STYLE, lStyleOld);
00530     SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
00531 }

bool CWinCvsBrowser::StepToLocation | ( | const char * | path,
 |  | bool | notifyView = false
 | ) |

Definition at line 1003 of file WinCvsBrowser.cpp.

References CSelectionChangeNotifier, CStr, EntnodeData::kName, m_root, stricmp, strnicmp, and VERIFY.

Referenced by CWincvsApp::InitInstance, CMainFrame::OnDropFiles, ResetView, and CBrowseFileView::ResetView.

01004 {
01005     bool bRes = false;  //return
01006
01007     CStr root(m_root);
01008     if(!root.endsWith(kPathDelimiter))
01009         root << kPathDelimiter;
01010     CStr subpath(path);
01011     if(!subpath.endsWith(kPathDelimiter))
01012         subpath << kPathDelimiter;
01013
01014     // check if it is a sub-path
01015
01016     //JK - for windows case insensitive seems better
01017     if(strnicmp(root, subpath, root.length()) != 0)
01018         return false;
01019
01020     CTreeCtrl& treeCtrl = GetTreeCtrl();
01021     HTREEITEM item = treeCtrl.GetRootItem();
01022     HTREEITEM lastitem = 0L;
01023     if(item == 0L)
01024         return false;
01025
01026     if (stricmp(root, subpath) == 0)
01027     {
01028         // must select root node
01029         lastitem = item;
01030         treeCtrl.Expand(item, TVE_EXPAND);
01031     }
01032     else
01033     {
01034         // step inside synchronized
01035         const char *tmp = (const char *)subpath + root.length() - 1;
01036         while((tmp = strchr(tmp, kPathDelimiter)) != 0L)
01037         {
01038             const char *name = ++tmp;
01039             if(name[0] == '\0')
01040                 break;
01041
01042             CStr subname;
01043             const char *tmp2 = strchr(name, kPathDelimiter);
01044             if(tmp2 == 0L)
01045                 subname = name;
01046             else
01047                 subname.set(name, tmp2 - name);
01048
01049             HTREEITEM childItem = treeCtrl.GetNextItem(item, TVGN_CHILD);
01050
01051             // find the subitem which matches this name
01052             while(childItem != 0L)
01053             {
01054                 EntnodeData *data = (EntnodeData *)treeCtrl.GetItemData(childItem);
01055                 if(data != 0L)
01056                 {
01057                     if(_stricmp((*data)[EntnodeData::kName], subname) == 0)
01058                     {
01059                         // found it !
01060                         lastitem = item = childItem;
01061                         treeCtrl.Expand(item, TVE_EXPAND);
01062                         break;
01063                     }
01064                 }
01065
01066                 childItem = treeCtrl.GetNextItem(childItem, TVGN_NEXT);
01067             }
01068         }
01069     }
01070
01071     // in case this is called by the view, turn off notifying
01072     // when the item gets selected
01073     // JK - {!= 0} is for: Compiler Warning (level 3) C4800
01074     if(lastitem != 0L)
01075     {
01076         CSelectionChangeNotifier notifier(this, notifyView);
01077         VERIFY( bRes = (treeCtrl.Select(lastitem, TVGN_CARET) != 0) );
01078     }
01079
01080     return bRes;
01081 }

void CWinCvsBrowser::StoreExpanded | ( | std::vector< UStr > & | allExpanded,
 |  | HTREEITEM | root = 0L
 | ) | [protected]

Definition at line 1140 of file WinCvsBrowser.cpp.

References CStr, RetrievePath, and VERIFY.

Referenced by ResetView.

01141 {
01142     HTREEITEM item = root;
01143     CTreeCtrl& treeCtrl = GetTreeCtrl();
01144     if(item == 0L)
01145         item = treeCtrl.GetRootItem();
01146     if(item == 0L)
01147         return;
01148
01149     TV_ITEM pItem;
01150     pItem.hItem = item;
01151     pItem.mask = TVIF_STATE;
01152     VERIFY(treeCtrl.GetItem(&pItem));
01153
01154     if(pItem.state & TVIS_EXPANDED)
01155     {
01156         CStr path;
01157         RetrievePath(item, path);
01158         allExpanded.push_back(path);
01159     }
01160
01161     HTREEITEM childItem = treeCtrl.GetNextItem(item, TVGN_CHILD);
01162
01163     while(childItem != 0L)
01164     {
01165         StoreExpanded(allExpanded, childItem);
01166         childItem = treeCtrl.GetNextItem(childItem, TVGN_NEXT);
01167     }
01168 }

Member Data Documentation

friend CWinCvsBrowser::CSelectionChangeNotifier

Definition at line 62 of file WinCvsBrowser.h.

Referenced by DeleteAllItems, and StepToLocation.

CImageList CWinCvsBrowser::m_Imagelist [static, protected]

Definition at line 112 of file WinCvsBrowser.cpp.

Referenced by Create.

bool CWinCvsBrowser::m_isResetViewPending [protected]

Definition at line 78 of file WinCvsBrowser.h.

Referenced by OnIgnoreChanged, and ResetView.

bool CWinCvsBrowser::m_isSelectionChanged [protected]

Definition at line 74 of file WinCvsBrowser.h.

Referenced by CWinCvsBrowser::CSelectionChangeNotifier::CSelectionChangeNotifier, OnSelchanged, and CWinCvsBrowser::CSelectionChangeNotifier::~CSelectionChangeNotifier.

bool CWinCvsBrowser::m_isSelectionNotificationLocked [protected]

Definition at line 71 of file WinCvsBrowser.h.

Referenced by CWinCvsBrowser::CSelectionChangeNotifier::CSelectionChangeNotifier, NotifySelectionChange, and CWinCvsBrowser::CSelectionChangeNotifier::~CSelectionChangeNotifier.

UStr CWinCvsBrowser::m_root [protected]

Definition at line 127 of file WinCvsBrowser.h.

Referenced by GetItemByLocation, GetRoot, ResetBrowser, ResetView, RetrievePath, and StepToLocation.

The documentation for this class was generated from the following files:
  • WinCvs/WinCvsBrowser.h
  • WinCvs/WinCvsBrowser.cpp
Generated on Sun Feb 24 01:29:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CWinCvsBrowser::CSelectionChangeNotifier Class Reference

#include <WinCvsBrowser.h>

Collaboration diagram for CWinCvsBrowser::CSelectionChangeNotifier:

[legend]
List of all members.

Public Methods

CSelectionChangeNotifier (CWinCvsBrowser *view, bool notify)
~CSelectionChangeNotifier ()

Protected Attributes

bool | m_notify
bool | m_wasLocked
CWinCvsBrowser * m_view

Constructor & Destructor Documentation

CWinCvsBrowser::CSelectionChangeNotifier::CSelectionChangeNotifier | ( | CWinCvsBrowser * | view,
 |  | bool | notify
 | ) | [inline]

Definition at line 37 of file WinCvsBrowser.h.

References CWinCvsBrowser::m_isSelectionChanged, CWinCvsBrowser::m_isSelectionNotificationLocked, m_notify, and m_wasLocked.

00038         : m_notify(notify)
00039         , m_view(view)
00040         , m_wasLocked(view->m_isSelectionNotificationLocked)
00041         {
00042             if (!m_wasLocked)
00043             {
00044                 m_view->m_isSelectionChanged = false;
00045                 m_view->m_isSelectionNotificationLocked = true;
00046             }
00047         }

CWinCvsBrowser::CSelectionChangeNotifier::~CSelectionChangeNotifier ( ) [inline]

Definition at line 49 of file WinCvsBrowser.h.

References CWinCvsBrowser::m_isSelectionChanged, CWinCvsBrowser::m_isSelectionNotificationLocked, m_wasLocked, and CWinCvsBrowser::NotifySelectionChange.

00050         {
00051             m_view->m_isSelectionNotificationLocked = m_wasLocked;
00052             if (!m_wasLocked)
00053             {
00054                 if (m_notify)
00055                 {
00056                     m_view->NotifySelectionChange();
00057                 }
00058                 m_view->m_isSelectionChanged = false;
00059             }
00060         }

Member Data Documentation

bool CWinCvsBrowser::CSelectionChangeNotifier::m_notify [protected]

Definition at line 25 of file WinCvsBrowser.h.

Referenced by CSelectionChangeNotifier.

CWinCvsBrowser* CWinCvsBrowser::CSelectionChangeNotifier::m_view [protected]

Definition at line 31 of file WinCvsBrowser.h.

bool CWinCvsBrowser::CSelectionChangeNotifier::m_wasLocked [protected]

Definition at line 28 of file WinCvsBrowser.h.

Referenced by CSelectionChangeNotifier, and ~CSelectionChangeNotifier.

The documentation for this class was generated from the following file:
  • WinCvs/WinCvsBrowser.h
Generated on Sun Feb 24 01:29:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CWincvsDoc Class Reference

#include <wincvsDoc.h>

Inheritance diagram for CWincvsDoc:

[legend]
Collaboration diagram for CWincvsDoc:

[legend]
List of all members.

Public Methods

CWincvsDoc ()
virtual BOOL | OnNewDocument ()
virtual void | Serialize (CArchive &ar)
virtual | ~CWincvsDoc ()

Protected Methods

afx_msg void | OnAppPreferences ()
afx_msg void | OnAppRtagNew ()
afx_msg void | OnAppRtagDelete ()
afx_msg void | OnAppRtagBranch ()
afx_msg void | OnAppCmdline ()
afx_msg void | OnUpdateCvsCmd (CCmdUI *pCmdUI)
afx_msg void | OnUpdatePrefs (CCmdUI *pCmdUI)
afx_msg void | OnStopcvs ()
afx_msg void | OnUpdateStopcvs (CCmdUI *pCmdUI)
afx_msg void | OnBrowserOpen ()
afx_msg void | OnAppLogin ()
afx_msg BOOL | OnMacroAdmin (UINT nID)
afx_msg void | OnUpdateMacroAdmin (CCmdUI *pCmdUI)
afx_msg void | OnAppLogout ()
afx_msg void | OnViewInit ()
afx_msg void | OnSavesettings ()
afx_msg void | OnUpdateSavesettings (CCmdUI *pCmdUI)
afx_msg void | OnViewBrowselocationRemoveunwanted ()
afx_msg void | OnUsePyshell ()
afx_msg void | OnUpdateUsePyshell (CCmdUI *pCmdUI)
afx_msg void | OnUseTclshell ()
afx_msg void | OnUpdateUseTclshell (CCmdUI *pCmdUI)
afx_msg void | OnViewPathChanged ()

Protected Attributes

CString | m_viewPath

Constructor & Destructor Documentation

CWincvsDoc::CWincvsDoc ( )

Definition at line 112 of file wincvsDoc.cpp.

00113 {
00114     // Use OLE compound files
00115     //EnableCompoundFile();
00116
00117     // TODO: add one-time construction code here
00118
00119     //EnableAutomation();
00120
00121     //AfxOleLockApp();
00122 }

CWincvsDoc::~CWincvsDoc ( ) [virtual]

Definition at line 124 of file wincvsDoc.cpp.

00125 {
00126     //AfxOleUnlockApp();
00127 }

Member Function Documentation

void CWincvsDoc::OnAppCmdline ( ) [protected]

Definition at line 240 of file wincvsDoc.cpp.

References CvsCmdLine.

00241 {
00242     CvsCmdLine();
00243 }

void CWincvsDoc::OnAppLogin ( ) [protected]

Definition at line 245 of file wincvsDoc.cpp.

References CvsCmdLogin.

00246 {
00247     CvsCmdLogin();
00248 }

void CWincvsDoc::OnAppLogout ( ) [protected]

Definition at line 345 of file wincvsDoc.cpp.

References CvsCmdLogout.

00346 {
00347     CvsCmdLogout();
00348 }

void CWincvsDoc::OnAppPreferences ( ) [protected]

Definition at line 235 of file wincvsDoc.cpp.

References CompatGetPrefs.

00236 {
00237     CompatGetPrefs();
00238 }

void CWincvsDoc::OnAppRtagBranch ( ) [protected]

Definition at line 303 of file wincvsDoc.cpp.

References CvsCmdRtagBranch.

00304 {
00305     CvsCmdRtagBranch();
00306 }

void CWincvsDoc::OnAppRtagDelete ( ) [protected]

Definition at line 298 of file wincvsDoc.cpp.

References CvsCmdRtagDelete.

00299 {
00300     CvsCmdRtagDelete();
00301 }

void CWincvsDoc::OnAppRtagNew ( ) [protected]

Definition at line 293 of file wincvsDoc.cpp.

References CvsCmdRtagCreate.

00294 {
00295     CvsCmdRtagCreate();
00296 }

void CWincvsDoc::OnBrowserOpen ( ) [protected]

Definition at line 276 of file wincvsDoc.cpp.

References BrowserGetDirectory, CWincvsApp::GetBrowserView, and CWinCvsBrowser::ResetBrowser.

00277 {
00278     const char *newPath =
00279         BrowserGetDirectory("Select a folder to open with the browser");
00280     if(newPath == 0L)
00281         return;
00282
00283     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00284     app->GetBrowserView()->ResetBrowser(newPath, true);
00285 }

BOOL CWincvsDoc::OnMacroAdmin ( UINT nID ) [protected]

Definition at line 308 of file wincvsDoc.cpp.

References CvsCmdMacrosAdmin, ID_MACRO_ADMIN, and CMacroEntry::path.

00309 {
00310     CMacroEntry & entry = gMacrosAdmin.entries[nID - ID_MACRO_ADMIN];
00311     CvsCmdMacrosAdmin(entry.path);
00312
00313     return 1;
00314 }

BOOL CWincvsDoc::OnNewDocument ( ) [virtual]

Definition at line 134 of file wincvsDoc.cpp.

References FALSE, and TRUE.

00135 {
00136     if (!CDocument::OnNewDocument())
00137         return FALSE;
00138
00139     return TRUE;
00140 }

void CWincvsDoc::OnSavesettings ( ) [protected]

Definition at line 355 of file wincvsDoc.cpp.

References AskCreatePersistentSettings, CWincvsApp::GetBrowserView, and CWinCvsBrowser::GetRoot.

00356 {
00357     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00358     AskCreatePersistentSettings(app->GetBrowserView()->GetRoot());
00359 }

void CWincvsDoc::OnStopcvs ( ) [protected]

Definition at line 262 of file wincvsDoc.cpp.

References cvs_out, cvs_process_kill, CWincvsApp::gCvsProcess, and CWincvsApp::gCvsStopping.

00263 {
00264     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00265     app->gCvsStopping = true;
00266     cvs_process_kill(app->gCvsProcess);
00267     cvs_out("*****CVS stopped on user request !!! *****\n\n");
00268 }

void CWincvsDoc::OnUpdateCvsCmd ( CCmdUI * pCmdUI ) [protected]

Definition at line 250 of file wincvsDoc.cpp.

References FALSE, CWincvsApp::gCvsRunning, and TRUE.

00251 {
00252     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00253     pCmdUI->Enable(app->gCvsRunning || gCvsPrefs.empty() ? FALSE : TRUE);
00254 }

void CWincvsDoc::OnUpdateMacroAdmin ( CCmdUI * pCmdUI ) [protected]

Definition at line 316 of file wincvsDoc.cpp.

References FALSE, CWincvsApp::gCvsRunning, CTcl_Interp::IsAvail, and TRUE.

00317 {
00318     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00319     if(app->gCvsRunning || gCvsPrefs.empty() || !CTcl_Interp::IsAvail())
00320     {
00321         pCmdUI->Enable(FALSE);
00322         return;
00323     }
00324
00325     if(pCmdUI->m_pSubMenu != 0L || pCmdUI->m_pMenu == 0L)
00326         return;
00327
00328     int iMRUMax = pCmdUI->m_pMenu->GetMenuItemCount();
00329     for (int iMRU = 0; iMRU < iMRUMax; iMRU++)
00330         pCmdUI->m_pMenu->DeleteMenu(pCmdUI->m_nID + iMRU, MF_BYCOMMAND);
00331
00332     vector<CMacroEntry>::const_iterator i;
00333     for(i = gMacrosAdmin.entries.begin(); i != gMacrosAdmin.entries.end(); ++i)
00334     {
00335         pCmdUI->m_pMenu->InsertMenu(pCmdUI->m_nIndex++,
00336             MF_STRING | MF_BYPOSITION, pCmdUI->m_nID++,
00337             (*i).name);
00338     }
00339
00340     pCmdUI->m_nIndexMax = pCmdUI->m_pMenu->GetMenuItemCount();
00341     pCmdUI->m_nIndex--; // point to last menu added
00342     pCmdUI->m_bEnableChanged = TRUE;    // all the added items are enabled
00343 }

void CWincvsDoc::OnUpdatePrefs ( CCmdUI * pCmdUI ) [protected]

Definition at line 256 of file wincvsDoc.cpp.

References FALSE, CWincvsApp::gCvsRunning, and TRUE.

00257 {
00258     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00259     pCmdUI->Enable(app->gCvsRunning ? FALSE : TRUE);
00260 }

void CWincvsDoc::OnUpdateSavesettings ( CCmdUI * pCmdUI ) [protected]

Definition at line 361 of file wincvsDoc.cpp.

References CWincvsApp::gCvsRunning.

00362 {
00363     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00364     pCmdUI->Enable(!app->gCvsRunning && !gCvsPrefs.empty());
00365 }

void CWincvsDoc::OnUpdateStopcvs ( CCmdUI * pCmdUI ) [protected]

Definition at line 270 of file wincvsDoc.cpp.

References FALSE, CWincvsApp::gCvsRunning, CWincvsApp::gCvsStopping, and TRUE.

00271 {
00272     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00273     pCmdUI->Enable(app->gCvsRunning && !app->gCvsStopping ? TRUE : FALSE);
00274 }

void CWincvsDoc::OnUpdateUsePyshell ( CCmdUI * pCmdUI ) [protected]

Definition at line 378 of file wincvsDoc.cpp.

References CPython_Interp::IsAvail, and SHELL_PYTHON.

00379 {
00380     pCmdUI->Enable(CPython_Interp::IsAvail());
00381     pCmdUI->SetRadio(gCvsPrefs.GetUseShell() == SHELL_PYTHON);
00382 }

void CWincvsDoc::OnUpdateUseTclshell ( CCmdUI * pCmdUI ) [protected]

Definition at line 390 of file wincvsDoc.cpp.

References CTcl_Interp::IsAvail, and SHELL_TCL.

00391 {
00392     pCmdUI->Enable(CTcl_Interp::IsAvail());
00393     pCmdUI->SetRadio(gCvsPrefs.GetUseShell() == SHELL_TCL);
00394 }

void CWincvsDoc::OnUsePyshell ( ) [protected]

Definition at line 372 of file wincvsDoc.cpp.

References cvs_out, and SHELL_PYTHON.

00373 {
00374     gCvsPrefs.SetUseShell(SHELL_PYTHON);
00375     cvs_out("Switching the shell to Python...\n");
00376 }

void CWincvsDoc::OnUseTclshell ( ) [protected]

Definition at line 384 of file wincvsDoc.cpp.

References cvs_out, and SHELL_TCL.

00385 {
00386     gCvsPrefs.SetUseShell(SHELL_TCL);
00387     cvs_out("Switching the shell to TCL...\n");
00388 }

void CWincvsDoc::OnViewBrowselocationRemoveunwanted ( ) [protected]

Definition at line 367 of file wincvsDoc.cpp.

00368 {
00369     AfxMessageBox("To remove the unwanted location history items click DEL key when selecting from the combo box list.", MB_OK | MB_ICONINFORMATION);
00370 }

void CWincvsDoc::OnViewInit ( ) [protected]

Definition at line 350 of file wincvsDoc.cpp.

References CvsCmdInit.

00351 {
00352     CvsCmdInit();
00353 }

void CWincvsDoc::OnViewPathChanged ( ) [protected]

Definition at line 287 of file wincvsDoc.cpp.

00288 {
00289     // TODO: Add notification handler code
00290
00291 }

void CWincvsDoc::Serialize ( CArchive & ar ) [virtual]

Definition at line 186 of file wincvsDoc.cpp.

References EditStreamCallBack, and NULL.

00187 {
00188     if (ar.IsStoring())
00189     {
00190         POSITION pos = GetFirstViewPosition();
00191         CView* view;
00192         while((view = GetNextView(pos)) != NULL)
00193         {
00194             if(view->IsKindOf(RUNTIME_CLASS(CRichEditView)))
00195             {
00196                 int nFormat = SF_TEXT;
00197                 EDITSTREAM es = {0, 0, (EDITSTREAMCALLBACK)EditStreamCallBack};
00198                 _afxRichEditCookie cookie(ar);
00199                 es.dwCookie = (DWORD)&cookie;
00200                 ((CRichEditView *)view)->GetRichEditCtrl().StreamOut(nFormat, es);
00201                 break;
00202             }
00203         }
00204     }
00205     else
00206     {
00207         // We don't load right now
00208     }
00209
00210     // Calling the base class CDocument enables serialization
00211     //  of the container document's COleClientItem objects.
00212     // (but we don't have COleClientItem)
00213     CDocument::Serialize(ar);
00214 }

Member Data Documentation

CString CWincvsDoc::m_viewPath [protected]

Definition at line 93 of file wincvsDoc.h.

The documentation for this class was generated from the following files:
  • WinCvs/wincvsDoc.h
  • WinCvs/wincvsDoc.cpp
Generated on Sun Feb 24 01:29:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CWincvsView Class Reference

#include <wincvsView.h>

Inheritance diagram for CWincvsView:

[legend]
Collaboration diagram for CWincvsView:

[legend]
List of all members.

Public Methods

CWincvsDoc * GetDocument ()
void | OutConsole (const char *txt, long len, bool isStderr=false)
void | OutColor (const char *txt, long len)
void | OutColor (kConsoleColor color)
void | OutColor (CHARFORMAT &format)
CHARFORMAT | GetCurFormat (bool jumpEnd=true)
BOOL | CanPaste () const
virtual void | OnDraw (CDC *pDC)
virtual BOOL | PreCreateWindow (CREATESTRUCT &cs)
virtual | ~CWincvsView ()

Protected Methods

CWincvsView ()
virtual void | OnInitialUpdate ()
virtual BOOL | OnPreparePrinting (CPrintInfo *pInfo)
virtual void | OnBeginPrinting (CDC *pDC, CPrintInfo *pInfo)
virtual void | OnEndPrinting (CDC *pDC, CPrintInfo *pInfo)
virtual BOOL | IsSelected (const CObject *pDocItem) const
void | FeedThisLine (const char *buf, int numbuf, bool isStderr)
virtual HRESULT | QueryAcceptData (LPDATAOBJECT, CLIPFORMAT *, DWORD, BOOL, HGLOBAL)
afx_msg void | OnDestroy ()
afx_msg void | OnSetFocus (CWnd *pOldWnd)
afx_msg void | OnSize (UINT nType, int cx, int cy)
afx_msg void | OnMyFormatFont ()
afx_msg void | OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags)
afx_msg void | OnDropFiles (HDROP hDropInfo)
afx_msg void | OnEditClearAll ()
afx_msg void | OnRButtonDown (UINT nFlags, CPoint point)
afx_msg UINT | OnGetDlgCode ()

Protected Attributes

UINT | fRtfFormat

Static Protected Attributes

char * | sbuf = 0L
int | snumbuf = 0

Constructor & Destructor Documentation

CWincvsView::CWincvsView ( ) [protected]

Definition at line 109 of file wincvsView.cpp.

References fRtfFormat.

00110 {
00111     fRtfFormat = ::RegisterClipboardFormat(_T("Rich Text Format"));
00112 }

CWincvsView::~CWincvsView ( ) [virtual]

Definition at line 114 of file wincvsView.cpp.

References CPython_Interp::ClosePythonSupport, free, PyInvalUICache, sbuf, and snumbuf.

00115 {
00116     snumbuf = 0;
00117     if(sbuf != 0L)
00118     {
00119         free(sbuf);
00120         sbuf = 0L;
00121     }
00122     PyInvalUICache();
00123     CPython_Interp::ClosePythonSupport();
00124 }

Member Function Documentation

BOOL CWincvsView::CanPaste ( ) const

Definition at line 604 of file wincvsView.cpp.

References fRtfFormat.

00605 {
00606     return (CountClipboardFormats() != 0) &&
00607         (IsClipboardFormatAvailable(CF_TEXT) ||
00608         IsClipboardFormatAvailable(fRtfFormat) ||
00609         //IsClipboardFormatAvailable(_oleData.cfEmbedSource) ||
00610         //IsClipboardFormatAvailable(_oleData.cfEmbeddedObject) ||
00611         //IsClipboardFormatAvailable(_oleData.cfFileName) ||
00612         //IsClipboardFormatAvailable(_oleData.cfFileNameW) ||
00613         //IsClipboardFormatAvailable(CF_METAFILEPICT) ||
00614         //IsClipboardFormatAvailable(CF_DIB) ||
00615         //IsClipboardFormatAvailable(CF_BITMAP) ||
00616         GetRichEditCtrl().CanPaste());
00617 }

void CWincvsView::FeedThisLine | ( | const char * | buf,
 |  | int | numbuf,
 |  | bool | isStderr
 | ) | [protected]

Definition at line 269 of file wincvsView.cpp.

Referenced by OutConsole.

00270 {
00271     CRichEditCtrl& edit = GetRichEditCtrl();
00272     edit.SetSel(-1, -1);
00273
00274     CHARFORMAT cf;
00275     cf.cbSize = sizeof(CHARFORMAT);
00276     cf = GetCharFormatSelection();
00277
00278     bool colorChanged = false;
00279     COLORREF oldColor = cf.crTextColor;
00280     DWORD oldEffect = cf.dwEffects;
00281     CString s(buf, numbuf);
00282
00283     if(s.GetLength() >= 5 && s[1] == ' ' &&
00284         (s[0] == 'M' || s[0] == 'C' || s[0] == 'U' ||
00285         s[0] == 'P' || s[0] == 'N' || s[0] == 'A' ||
00286         s[0] == 'R' || s[0] == 'I' || s[0] == '?' ||
00287         s[0] == '<' || s[0] == '>'))
00288     {
00289         colorChanged = true;
00290         switch(s[0])
00291         {
00292         default:
00293         case '?' :
00294         case 'I' :
00295             cf.crTextColor = RGB(0x80, 0x80, 0x00);
00296             break;
00297         case 'U' :
00298         case 'N' :
00299             cf.crTextColor = RGB(0x00, 0xA0, 0x00);
00300             break;
00301         case 'M' :
00302         case 'A' :
00303         case 'R' :
00304             cf.crTextColor = RGB(0xFF, 0x00, 0xFF);
00305             break;
00306         case 'C' :
00307         case '<' :
00308             cf.crTextColor = RGB(0xFF, 0x00, 0x00);
00309             break;
00310         case '>' :
00311         case 'P' :
00312             cf.crTextColor = RGB(0x00, 0x00, 0xFF);
00313             break;
00314         }
00315         cf.dwMask = CFM_COLOR;
00316         cf.dwEffects = 0;
00317         SetCharFormat(cf);
00318     }
00319     else if(isStderr)
00320     {
00321         colorChanged = true;
00322         cf.crTextColor = RGB(0xFF, 0x80, 0x00);
00323         cf.dwMask = CFM_COLOR;
00324         cf.dwEffects = 0;
00325         SetCharFormat(cf);
00326     }
00327
00328     edit.ReplaceSel(s);
00329
00330     if(colorChanged)
00331     {
00332         cf.dwMask = CFM_COLOR;
00333         cf.crTextColor = oldColor;
00334         cf.dwEffects = oldEffect;
00335         SetCharFormat(cf);
00336     }
00337 }

CHARFORMAT CWincvsView::GetCurFormat ( bool jumpEnd = true )

Definition at line 339 of file wincvsView.cpp.

Referenced by CColorConsole::CColorConsole, and OutColor.

00340 {
00341     CRichEditCtrl& edit = GetRichEditCtrl();
00342     if(jumpEnd)
00343         edit.SetSel(-1, -1);
00344
00345     CHARFORMAT cf;
00346     cf.cbSize = sizeof(CHARFORMAT);
00347     return GetCharFormatSelection();
00348 }

CWincvsDoc * CWincvsView::GetDocument ( ) [inline]

Definition at line 128 of file wincvsView.h.

00129    { return (CWincvsDoc*)m_pDocument; }

BOOL CWincvsView::IsSelected ( const CObject * pDocItem ) const [protected, virtual]

Definition at line 213 of file wincvsView.cpp.

00214 {
00215     // The implementation below is adequate if your selection consists of
00216     //  only CWincvsCntrItem objects.  To handle different selection
00217     //  mechanisms, the implementation here should be replaced.
00218
00219     // TODO: implement this function that tests for a selected OLE client item
00220
00221     //return pDocItem == m_pSelection;
00222     return CRichEditView::IsSelected(pDocItem);
00223 }

void CWincvsView::OnBeginPrinting | ( | CDC * | pDC,
 |  | CPrintInfo * | pInfo
 | ) | [protected, virtual]

Definition at line 184 of file wincvsView.cpp.

00185 {
00186     // TODO: add extra initialization before printing
00187     CRichEditView::OnBeginPrinting(pDC, pInfo);
00188 }

void CWincvsView::OnDestroy ( ) [protected]

Definition at line 196 of file wincvsView.cpp.

00197 {
00198     // Deactivate the item on destruction; this is important
00199     // when a splitter view is being used.
00200     CRichEditView::OnDestroy();
00201     //COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
00202     //if (pActiveItem != NULL && pActiveItem->GetActiveView() == this)
00203     //{
00204     //  pActiveItem->Deactivate();
00205     //  ASSERT(GetDocument()->GetInPlaceActiveItem(this) == NULL);
00206     //}
00207 }

void CWincvsView::OnDraw ( CDC * pDC ) [virtual]

Definition at line 139 of file wincvsView.cpp.

00140 {
00141     //CWincvsDoc* pDoc = GetDocument();
00142     //ASSERT_VALID(pDoc);
00143
00144     // TODO: add draw code for native data here
00145     // TODO: also draw all OLE items in the document
00146
00147     // Draw the selection at an arbitrary position.  This code should be
00148     //  removed once your real drawing code is implemented.  This position
00149     //  corresponds exactly to the rectangle returned by CWincvsCntrItem,
00150     //  to give the effect of in-place editing.
00151
00152     // TODO: remove this code when final draw code is complete.
00153
00154     //if (m_pSelection == NULL)
00155     //{
00156     //  POSITION pos = pDoc->GetStartPosition();
00157     //  m_pSelection = (CWincvsCntrItem*)pDoc->GetNextClientItem(pos);
00158     //}
00159     //if (m_pSelection != NULL)
00160     //  m_pSelection->Draw(pDC, CRect(10, 10, 210, 210));
00161 }

void CWincvsView::OnDropFiles ( HDROP hDropInfo ) [protected]

Definition at line 619 of file wincvsView.cpp.

References CMainFrame::DropFiles, and NULL.

00620 {
00621     CWnd* pWnd = AfxGetMainWnd();   //look in InitInstance m_pMainWnd = m_mainFrame;
00622
00623     if( pWnd )
00624     {
00625         CMainFrame* pMainFrame = (CMainFrame*)pWnd;
00626
00627         if( pMainFrame->GetSafeHwnd() != NULL )
00628         {
00629             pMainFrame->DropFiles( hDropInfo );
00630         }
00631     }
00632
00633     //this cause the crash, remove
00634     //CRichEditView::OnDropFiles(hDropInfo);
00635 }

void CWincvsView::OnEditClearAll ( ) [protected]

Definition at line 637 of file wincvsView.cpp.

References TRUE.

00638 {
00639     CRichEditCtrl& edit = GetRichEditCtrl();
00640     edit.SetSel(0, -1);
00641     edit.ReplaceSel("", TRUE);
00642 }

void CWincvsView::OnEndPrinting | ( | CDC * | pDC,
 |  | CPrintInfo * | pInfo
 | ) | [protected, virtual]

Definition at line 190 of file wincvsView.cpp.

00191 {
00192     // TODO: add cleanup after printing
00193     CRichEditView::OnEndPrinting(pDC, pInfo);
00194 }

UINT CWincvsView::OnGetDlgCode ( ) [protected]

Definition at line 655 of file wincvsView.cpp.

00656 {
00657     LRESULT DlgCode;
00658     DlgCode = CRichEditView::OnGetDlgCode();
00659     if (0x8000 & GetKeyState(VK_TAB))
00660         return  DlgCode & ~(DLGC_WANTTAB | DLGC_WANTALLKEYS | DLGC_WANTCHARS);
00661     else
00662         return DlgCode;
00663 }

void CWincvsView::OnInitialUpdate ( ) [protected, virtual]

Definition at line 163 of file wincvsView.cpp.

References CPython_Interp::InitPythonSupport.

00164 {
00165     CRichEditView::OnInitialUpdate();
00166
00167     CRichEditCtrl& edit = GetRichEditCtrl();
00168     edit.SetSel(0, -1);
00169     SetCharFormat((CCharFormat)gViewFont);
00170     edit.SetSel(-1, -1);
00171
00172     CPython_Interp::InitPythonSupport();
00173 }

void CWincvsView::OnKeyDown | ( | UINT | nChar,
 |  | UINT | nRepCnt,
 |  | UINT | nFlags
 | ) | [protected]

Definition at line 513 of file wincvsView.cpp.

References CTcl_Interp::DoScript, CPython_Interp::DoScript, free, CTcl_Interp::IsAvail, CPython_Interp::IsAvail, malloc, OutConsole, SHELL_PYTHON, and SHELL_TCL.

00514 {
00515     CRichEditView::OnKeyDown(nChar, nRepCnt, nFlags);
00516
00517     if(nChar != VK_RETURN)
00518     {
00519         return;
00520     }
00521
00522     long len = GetTextLength();
00523     if(len == 0)
00524         return;
00525
00526     TCHAR *buf = (char *)malloc((len + 1) * sizeof(TCHAR));
00527     if(buf == 0L)
00528         return;
00529
00530     TEXTRANGE textRange;
00531     textRange.chrg.cpMin = 0;
00532     textRange.chrg.cpMax = len;
00533     textRange.lpstrText = buf;
00534     GetRichEditCtrl().SendMessage(EM_GETTEXTRANGE, 0, (LPARAM)&textRange);
00535
00536     long nStartChar, nEndChar;
00537     GetRichEditCtrl().GetSel(nStartChar, nEndChar);
00538
00539     if (nStartChar == nEndChar) // i.e. there is no selection
00540     {
00541         // get the end and the beginning of the line
00542         if(nStartChar > 0 && buf[nStartChar] == '\r')
00543             nStartChar--;
00544         while(nStartChar > 0 && buf[nStartChar] != '\n' && buf[nStartChar] != '\r')
00545             nStartChar--;
00546         if(buf[nStartChar] == '\n' || buf[nStartChar] == '\r')
00547             nStartChar++;
00548         while(nEndChar < len && buf[nEndChar] != '\n' && buf[nEndChar] != '\r')
00549             nEndChar++;
00550     }
00551
00552     long length = nEndChar - nStartChar;
00553     if(length > 0 && nStartChar < len)
00554     {
00555         OutConsole("\n", 1);
00556         buf[nEndChar] = '\0';
00557         if(gCvsPrefs.GetUseShell() == SHELL_PYTHON && CPython_Interp::IsAvail())
00558         {
00559             CPython_Interp interp;
00560             interp.DoScript(buf + nStartChar);
00561         }
00562         else if(gCvsPrefs.GetUseShell() == SHELL_TCL && CTcl_Interp::IsAvail())
00563         {
00564             CTcl_Interp interp;
00565             interp.DoScript(buf + nStartChar);
00566         }
00567     }
00568
00569     free(buf);
00570 }

void CWincvsView::OnMyFormatFont ( ) [protected]

Definition at line 503 of file wincvsView.cpp.

00504 {
00505     CRichEditCtrl& edit = GetRichEditCtrl();
00506     edit.SetSel(0, -1);
00507     CRichEditView::OnFormatFont();
00508     edit.SetSel(-1, -1);
00509     gViewFont = CCharFormat(GetCharFormatSelection());
00510     gCvsPrefs.save();
00511 }

BOOL CWincvsView::OnPreparePrinting ( CPrintInfo * pInfo ) [protected, virtual]

Definition at line 178 of file wincvsView.cpp.

00179 {
00180     return DoPreparePrinting(pInfo);
00181     //return CRichEditView::OnPreparePrinting(pInfo);
00182 }

void CWincvsView::OnRButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 644 of file wincvsView.cpp.

00645 {
00646     CWincvsApp* pApp=static_cast<CWincvsApp*>(AfxGetApp());
00647     CMenu* pSubMenu=::GetSubCMenu(ID_EDIT_UNDO,this);
00648     if (pSubMenu) {
00649         ClientToScreen(&point);
00650         pSubMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON, point.x, point.y, this);
00651     }
00652 //  CRichEditView::OnRButtonDown(nFlags, point);
00653 }

void CWincvsView::OnSetFocus ( CWnd * pOldWnd ) [protected]

Definition at line 243 of file wincvsView.cpp.

00244 {
00245 //  COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
00246 //  if (pActiveItem != NULL &&
00247 //      pActiveItem->GetItemState() == COleClientItem::activeUIState)
00248 //  {
00249         // need to set focus to this item if it is in the same view
00250 //      CWnd* pWnd = pActiveItem->GetInPlaceWindow();
00251 //      if (pWnd != NULL)
00252 //      {
00253 //          pWnd->SetFocus();   // don't call the base class
00254 //          return;
00255 //      }
00256 //  }
00257
00258     CRichEditView::OnSetFocus(pOldWnd);
00259 }

void CWincvsView::OnSize | ( | UINT | nType,
 |  | int | cx,
 |  | int | cy
 | ) | [protected]

Definition at line 261 of file wincvsView.cpp.

00262 {
00263     CRichEditView::OnSize(nType, cx, cy);
00264 //  COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
00265 //  if (pActiveItem != NULL)
00266 //      pActiveItem->SetItemRects();
00267 }

void CWincvsView::OutColor ( CHARFORMAT & format )

Definition at line 426 of file wincvsView.cpp.

00427 {
00428     CCvsThreadLock threadLock;
00429
00430     CRichEditCtrl& edit = GetRichEditCtrl();
00431     SetCharFormat(format);
00432 }

void CWincvsView::OutColor ( kConsoleColor color )

Definition at line 375 of file wincvsView.cpp.

References GetCurFormat, kBlue, kBold, kBrown, kConsoleColor, kGreen, kItalic, kMagenta, kRed, and kUnderline.

00376 {
00377     CCvsThreadLock threadLock;
00378
00379     CRichEditCtrl& edit = GetRichEditCtrl();
00380
00381     CHARFORMAT cf = GetCurFormat(false);
00382     cf.dwEffects = 0;
00383
00384     switch(color)
00385     {
00386         default:
00387             return;
00388             break;
00389         case kBrown :
00390             cf.dwMask = CFM_COLOR;
00391             cf.crTextColor = RGB(0x80, 0x80, 0x00);
00392             break;
00393         case kGreen :
00394             cf.dwMask = CFM_COLOR;
00395             cf.crTextColor = RGB(0x00, 0xA0, 0x00);
00396             break;
00397         case kMagenta :
00398             cf.dwMask = CFM_COLOR;
00399             cf.crTextColor = RGB(0xFF, 0x00, 0xFF);
00400             break;
00401         case kRed :
00402             cf.dwMask = CFM_COLOR;
00403             cf.crTextColor = RGB(0xFF, 0x00, 0x00);
00404             break;
00405         case kBlue :
00406             cf.dwMask = CFM_COLOR;
00407             cf.crTextColor = RGB(0x00, 0x00, 0xFF);
00408             break;
00409         case kBold :
00410             cf.dwMask = CFM_BOLD;
00411             cf.dwEffects = CFE_BOLD;
00412             break;
00413         case kItalic :
00414             cf.dwMask = CFM_ITALIC;
00415             cf.dwEffects = CFE_ITALIC;
00416             break;
00417         case kUnderline :
00418             cf.dwMask = CFM_UNDERLINE;
00419             cf.dwEffects = CFE_UNDERLINE;
00420             break;
00421     }
00422
00423     SetCharFormat(cf);
00424 }

void CWincvsView::OutColor | ( | const char * | txt,
 |  | long | len
 | ) |

Definition at line 350 of file wincvsView.cpp.

Referenced by CColorConsole::operator<<.

00351 {
00352     // synchonize it since the thread calls it
00353     CCvsThreadLock threadLock;
00354
00355     CString s;
00356     for(int i = 0; i < len; i++)
00357     {
00358         char c = *txt++;
00359         if(c == 0x0d || c == 0x0a)
00360         {
00361             s += (char)0x0d;
00362             s += (char)0x0a;
00363             // special case if we got already \r\n
00364             if((i+1) < len && c == 0x0d && txt[0] == 0x0a)
00365                 i++;
00366         }
00367         else
00368             s += c;
00369     }
00370
00371     CRichEditCtrl& edit = GetRichEditCtrl();
00372     edit.ReplaceSel(s);
00373 }

void CWincvsView::OutConsole | ( | const char * | txt,
 |  | long | len,
 |  | bool | isStderr = false
 | ) |

Definition at line 434 of file wincvsView.cpp.

References FeedThisLine, malloc, MAX_CHAR_BY_LINE, sbuf, and snumbuf.

Referenced by CGraphConsole::cvs_err, cvs_err, cvs_errstr, CGraphConsole::cvs_out, cvs_out, cvs_outstr, and OnKeyDown.

00435 {
00436     // synchonize it since the thread calls it
00437     CCvsThreadLock threadLock;
00438
00439     if(len == 0)
00440         return;
00441
00442     if(sbuf == 0L)
00443     {
00444         sbuf = (char *)malloc((MAX_CHAR_BY_LINE + 3) * sizeof(char));
00445         if(sbuf == 0L)
00446             return;
00447     }
00448
00449     int i = 0;
00450     char c;
00451 once_again:
00452     for(; i < len && snumbuf < MAX_CHAR_BY_LINE; snumbuf++)
00453     {
00454         c = txt[i++];
00455         if(c == 0x0d || c == 0x0a)
00456             break;
00457         sbuf[snumbuf] = c;
00458     }
00459
00460     // special case if we got already \r\n
00461     if(i < len && c == 0x0d && txt[i] == 0x0a)
00462         i++;
00463
00464     if(c == 0x0d || c == 0x0a || snumbuf == MAX_CHAR_BY_LINE)
00465     {
00466         sbuf[snumbuf++] = 0x0d;
00467         sbuf[snumbuf++] = 0x0a;
00468         sbuf[snumbuf++] = 0x00;
00469
00470         FeedThisLine(sbuf, snumbuf, isStderr);
00471         snumbuf = 0;
00472     }
00473
00474     if(i != len)
00475         goto once_again;
00476 }

BOOL CWincvsView::PreCreateWindow ( CREATESTRUCT & cs ) [virtual]

Definition at line 126 of file wincvsView.cpp.

00127 {
00128     // TODO: Modify the Window class or styles here by modifying
00129     //  the CREATESTRUCT cs
00130
00131     BOOL bRet = CRichEditView::PreCreateWindow(cs);
00132     cs.style |= WS_TABSTOP | ES_MULTILINE;
00133     return  bRet;
00134 }

HRESULT CWincvsView::QueryAcceptData | ( | LPDATAOBJECT | ,
 |  | CLIPFORMAT * | ,
 |  | DWORD | ,
 |  | BOOL | ,
 |  | HGLOBAL |
 | ) | [protected, virtual]

Definition at line 572 of file wincvsView.cpp.

References ASSERT, FALSE, fRtfFormat, and NULL.

00574 {
00575     ASSERT(lpcfFormat != NULL);
00576     if (!bReally) // not actually pasting
00577         return S_OK;
00578     // if direct pasting a particular native format allow it
00579     if (IsRichEditFormat(*lpcfFormat))
00580         return S_OK;
00581
00582     COleDataObject dataobj;
00583     dataobj.Attach(lpdataobj, FALSE);
00584     // if format is 0, then force particular formats if available
00585     if (*lpcfFormat == 0 && (m_nPasteType == 0))
00586     {
00587         if (fRtfFormat != 0 && dataobj.IsDataAvailable(fRtfFormat)) // native avail, let richedit do as it wants
00588         {
00589             *lpcfFormat = fRtfFormat;
00590             return S_OK;
00591         }
00592         else if (dataobj.IsDataAvailable(CF_TEXT))
00593         {
00594             *lpcfFormat = CF_TEXT;
00595             return S_OK;
00596         }
00597     }
00598     // *DO NOT* paste OLE formats
00599     // crash reported by Gerhard Möller
00600     //DoPaste(dataobj, *lpcfFormat, hMetaPict);
00601     return S_FALSE;
00602 }

Member Data Documentation

UINT CWincvsView::fRtfFormat [protected]

Definition at line 104 of file wincvsView.h.

Referenced by CanPaste, CWincvsView, and QueryAcceptData.

char * CWincvsView::sbuf = 0L [static, protected]

Definition at line 106 of file wincvsView.cpp.

Referenced by OutConsole, and ~CWincvsView.

int CWincvsView::snumbuf = 0 [static, protected]

Definition at line 107 of file wincvsView.cpp.

Referenced by OutConsole, and ~CWincvsView.

The documentation for this class was generated from the following files:
  • WinCvs/wincvsView.h
  • WinCvs/wincvsView.cpp
Generated on Sun Feb 24 01:29:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WINDOWPLACEMENT Class Reference

Inheritance diagram for WINDOWPLACEMENT:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/CJWindowPlacement.h
Generated on Sun Feb 24 01:29:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


WININFO Class Reference

Collaboration diagram for WININFO:

[legend]
List of all members.

Public Methods

WININFO (int w, int h)
virtual | ~WININFO ()
std::vector< TbEntry
* >::iterator 		Search (int cmd, int *dropindex=0L)

Public Attributes

std::vector< TbEntry * > entries
int | width
int | height

Constructor & Destructor Documentation

WININFO::WININFO | ( | int | w,
 |  | int | h
 | ) | [inline]

Definition at line 241 of file utoolbar.cpp.

References height, and width.

00241 : width(w), height(h) {}

virtual WININFO::~WININFO ( ) [inline, virtual]

Definition at line 242 of file utoolbar.cpp.

References entries.

00243     {
00244         std::vector<TbEntry *>::iterator i;
00245         for(i = entries.begin(); i != entries.end(); ++i)
00246         {
00247             delete (*i);
00248         }
00249     }

Member Function Documentation

std::vector<TbEntry *>::iterator WININFO::Search | ( | int | cmd,
 |  | int * | dropindex = 0L
 | ) | [inline]

Definition at line 251 of file utoolbar.cpp.

References awidget::cmd, entries, TbEntryDropDown::icons, TbEntry::kind, tbeButton, tbeDropDown, and TbEntryButton::wid.

Referenced by CDynToolBar::OnDropDownButton, UToolbar::OnSetTooltip, and UToolbar::UDispatchMessage.

00252     {
00253         std::vector<TbEntry *>::iterator i;
00254         for(i = entries.begin(); i != entries.end(); ++i)
00255         {
00256             TbEntry * entry = (*i);
00257             if(entry->kind == tbeDropDown)
00258             {
00259                 TbEntryDropDown *drop = (TbEntryDropDown *)entry;
00260                 std::vector<awidget>::iterator j;
00261                 int index;
00262
00263                 for(j = drop->icons.begin(), index = 0; j != drop->icons.end(); ++j, index++)
00264                 {
00265                     if((*j).cmd == cmd)
00266                     {
00267                         if(dropindex != 0L)
00268                             *dropindex = index;
00269                         return i;
00270                     }
00271                 }
00272             }
00273             else if(entry->kind == tbeButton)
00274             {
00275                 TbEntryButton *btn = (TbEntryButton *)entry;
00276                 if(btn->wid.cmd == cmd)
00277                     return i;
00278             }
00279         }
00280         return i;
00281     }

Member Data Documentation

std::vector<TbEntry *> WININFO::entries

Definition at line 283 of file utoolbar.cpp.

Referenced by CDynToolBar::OnDropDownButton, UToolbar::OnSetTooltip, UToolbar::OnTbButton, UToolbar::OnTbCheckBtn, UToolbar::OnTbDropDown, UToolbar::OnTbSeparator, UToolbar::OnUpdateUI, UToolbar::RebuildBar, Search, UToolbar::UDispatchMessage, and ~WININFO.

int WININFO::height

Definition at line 284 of file utoolbar.cpp.

Referenced by CDynToolBar::OnDropDownButton, UToolbar::RebuildBar, and WININFO.

int WININFO::width

Definition at line 284 of file utoolbar.cpp.

Referenced by CDynToolBar::OnDropDownButton, UToolbar::RebuildBar, and WININFO.

The documentation for this class was generated from the following file:
  • rf/utoolbar.cpp
Generated on Sun Feb 24 01:29:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CWinLogBranchData Class Reference

Inheritance diagram for CWinLogBranchData:

[legend]
Collaboration diagram for CWinLogBranchData:

[legend]
List of all members.

Public Methods

CWinLogBranchData (CLogNode *node)
virtual | ~CWinLogBranchData ()
CWinLogBranchData (CLogNode *node)
virtual | ~CWinLogBranchData ()

Protected Methods

virtual void | UpdateSelf (UDC &hdc, EntnodeData *entryInfo)
virtual USize | GetBoundsSelf (UDC &hdc, EntnodeData *entryInfo)
virtual void | UpdateSelf (CDC &hdc, EntnodeData *entryInfo)
virtual CSize | GetBoundsSelf (CDC &hdc, EntnodeData *entryInfo)

Constructor & Destructor Documentation

CWinLogBranchData::CWinLogBranchData ( CLogNode * node ) [inline]

Definition at line 182 of file UCvsGraph.cpp.

00182 : CWinLogData(node) {}

virtual CWinLogBranchData::~CWinLogBranchData ( ) [inline, virtual]

Definition at line 183 of file UCvsGraph.cpp.

00183 {}

CWinLogBranchData::CWinLogBranchData ( CLogNode * node ) [inline]

Definition at line 195 of file GraphView.cpp.

00195 : CWinLogData(node) {}

virtual CWinLogBranchData::~CWinLogBranchData ( ) [inline, virtual]

Definition at line 196 of file GraphView.cpp.

00196 {}

Member Function Documentation

CSize CWinLogBranchData::GetBoundsSelf | ( | CDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 432 of file GraphView.cpp.

00433 {
00434     CLogNodeBranch & branch = *(CLogNodeBranch *)fNode;
00435     return hdc.GetTextExtent(*branch, (*branch).length());
00436 }

USize CWinLogBranchData::GetBoundsSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 369 of file UCvsGraph.cpp.

References UDC::GetTextExtent.

00370 {
00371     CLogNodeBranch & branch = *(CLogNodeBranch *)fNode;
00372     return hdc.GetTextExtent(*branch, (*branch).length());
00373 }

void CWinLogBranchData::UpdateSelf | ( | CDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 438 of file GraphView.cpp.

References URect::CenterPoint, kOctangle, NULL, CWinLogData::sel, and CWinLogData::selfB.

00439 {
00440     // draw the node
00441     ::DrawNode(hdc, selfB, gGraphBranchColor, kOctangle, sel);
00442
00443     // draw the content of the node
00444     TEXTMETRIC tm;
00445     hdc.GetTextMetrics(&tm);
00446     CPoint center = selfB.CenterPoint();
00447     int nCenterX = center.x;
00448     int nCenterY = center.y - tm.tmHeight/2;
00449     CLogNodeBranch & branch = *(CLogNodeBranch *)fNode;
00450     hdc.ExtTextOut(nCenterX, nCenterY, ETO_CLIPPED, selfB,
00451         *branch, (*branch).length(), NULL);
00452 }

void CWinLogBranchData::UpdateSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 375 of file UCvsGraph.cpp.

References URect::CenterPoint, UDC::GetTextHeight, CWinLogData::sel, CWinLogData::selfB, UDC::TextOutClipped, URGB, UPOINT::x, and UPOINT::y.

00376 {
00377     // draw the node
00378     ::DrawNode(hdc, selfB, URGB(0, 0, 255), URGB(0, 0, 120), true, sel);
00379
00380     // draw the content of the node
00381     UPoint center = selfB.CenterPoint();
00382     int nCenterX = center.x;
00383     int nCenterY = center.y - hdc.GetTextHeight()/2;
00384     CLogNodeBranch & branch = *(CLogNodeBranch *)fNode;
00385     hdc.TextOutClipped(nCenterX, nCenterY, &selfB,
00386         *branch, (*branch).length());
00387 }

The documentation for this class was generated from the following files:
  • common/UCvsGraph.cpp
  • WinCvs/GraphView.cpp
Generated on Sun Feb 24 01:29:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CWinLogData Class Reference

Inheritance diagram for CWinLogData:

[legend]
Collaboration diagram for CWinLogData:

[legend]
List of all members.

Public Methods

CWinLogData (CLogNode *node)
virtual | ~CWinLogData ()
kLogNode | GetType (void) const
const char * | GetStr (void)
void | ComputeBounds (const UPoint &topLeft, UDC &hdc, EntnodeData *entryInfo=0L)
void | Offset (UPoint o)
void | Update (UDC &hdc, EntnodeData *entryInfo=0L)
URect & | Bounds (void)
URect & | SelfBounds (void)
bool | Selected (void) const
void | SetSelected (CScrollView *view, bool state)
void | UnselectAll (CScrollView *view)
CWinLogData * | HitTest (UPoint point)
bool | IsDiskNode (EntnodeData *entryInfo)
CWinLogData (CLogNode *node)
virtual | ~CWinLogData ()
kLogNode | GetType (void) const
const char * | GetStr (void)
void | ComputeBounds (const CPoint &topLeft, CDC &hdc, EntnodeData *entryInfo=0L)
void | Offset (CPoint o)
void | Update (CDC &hdc, EntnodeData *entryInfo=0L)
CRect & | Bounds (void)
CRect & | SelfBounds (void)
bool | Selected (void) const
void | SetSelected (CScrollView *view, bool state)
void | UnselectAll (CScrollView *view)
CWinLogData * | HitTest (CPoint point)
bool | IsDiskNode (EntnodeData *entryInfo)
bool | IsDeadNode ()
bool | IsUserState ()

Static Public Methods

CWinLogData * | CreateNewData (CLogNode *node)
CWinLogData * | CreateNewData (CLogNode *node)

Protected Methods

virtual void | UpdateSelf (UDC &hdc, EntnodeData *entryInfo)=0
virtual USize | GetBoundsSelf (UDC &hdc, EntnodeData *entryInfo)=0
CWinLogData * | GetData (CLogNode *node)
virtual void | UpdateSelf (CDC &hdc, EntnodeData *entryInfo)=0
virtual CSize | GetBoundsSelf (CDC &hdc, EntnodeData *entryInfo)=0
CWinLogData * | GetData (CLogNode *node)

Protected Attributes

URect selfB
URect totB
bool | sel
CRect | selfB
CRect | totB

Constructor & Destructor Documentation

CWinLogData::CWinLogData ( CLogNode * node )

Definition at line 389 of file UCvsGraph.cpp.

References sel, selfB, URect::SetRectEmpty, and totB.

00389                                        : CLogNodeData(node)
00390 {
00391     selfB.SetRectEmpty();
00392     totB.SetRectEmpty();
00393     sel = false;
00394 }

CWinLogData::~CWinLogData ( ) [virtual]

Definition at line 396 of file UCvsGraph.cpp.

00397 {
00398 }

CWinLogData::CWinLogData ( CLogNode * node )

virtual CWinLogData::~CWinLogData ( ) [virtual]

Member Function Documentation

CRect& CWinLogData::Bounds ( void ) [inline]

Definition at line 133 of file GraphView.cpp.

References totB.

00133 { return totB; }

URect& CWinLogData::Bounds ( void ) [inline]

Definition at line 122 of file UCvsGraph.cpp.

References totB.

Referenced by CGraphView::CalcImageSize, UCvsGraph::CalcImageSize, ComputeBounds, CGraphView::OnBeginPrinting, and TGraphRectSelect::TraverseNode.

00122 { return totB; }

void CWinLogData::ComputeBounds | ( | const CPoint & | topLeft,
 |  | CDC & | hdc,
 |  | EntnodeData * | entryInfo = 0L
 | ) |

Definition at line 723 of file GraphView.cpp.

References URect::BottomRight, Bounds, ComputeBounds, CreateNewData, GetBoundsSelf, GetData, URect::Height, kHChildSpace, kInflateNodeSpace, kVChildSpace, Offset, URect::OffsetRect, selfB, URect::SetRect, URect::SetRectEmpty, URect::TopLeft, totB, URect::UnionRect, URect::Width, UPOINT::x, and UPOINT::y.

00725 {
00726     CLogNode *subNode;
00727     CLogNode *nextNode = fNode->Next();
00728
00729     // first compute childrens bounds
00730     vector<CLogNode *>::iterator i;
00731     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00732     {
00733         subNode = *i;
00734         CWinLogData::CreateNewData(subNode);
00735         GetData(subNode)->ComputeBounds(topLeft, hdc, entryInfo);
00736     }
00737     if(nextNode != 0L)
00738         CWinLogData::CreateNewData(nextNode);
00739
00740     // compute self place
00741     selfB.SetRectEmpty();
00742     CSize size = GetBoundsSelf(hdc, entryInfo);
00743     size.cx += kInflateNodeSpace;
00744     size.cy += kInflateNodeSpace;
00745     selfB.SetRect(0, 0, size.cx, size.cy);
00746
00747     // offset to the place assigned to this node
00748     selfB.OffsetRect(topLeft - selfB.TopLeft());
00749
00750     // calculate the total height of the childrens
00751     int vSize = 0;
00752     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00753     {
00754         subNode = *i;
00755         CRect & b = GetData(subNode)->Bounds();
00756         vSize += b.Height();
00757     }
00758     if(!fNode->Childs().empty())
00759         vSize += (fNode->Childs().size() - 1) * kVChildSpace;
00760
00761     // offset the children relative to self
00762     CPoint startChilds(topLeft.x + selfB.Width() + kHChildSpace,
00763         /*selfB.CenterPoint().y - vSize / 2*/topLeft.y);
00764
00765     //place the first child at the bottom of the header node so it won't take so much space for long filenames
00766     if( fNode->GetType() == kNodeHeader )
00767     {
00768         startChilds = CPoint(topLeft.x + kHChildSpace, topLeft.y + selfB.Height() + kVChildSpace);
00769     }
00770
00771     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00772     {
00773         subNode = *i;
00774         CRect curPos = GetData(subNode)->Bounds();
00775         GetData(subNode)->Offset(startChilds - curPos.TopLeft());
00776         startChilds.y += curPos.Height() + kVChildSpace;
00777     }
00778
00779     // calculate the total bounds of the childrens
00780     CRect bc;
00781     bc.SetRectEmpty();
00782     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00783     {
00784         subNode = *i;
00785         CRect & b = GetData(subNode)->Bounds();
00786         bc.UnionRect(bc, b);
00787     }
00788
00789     // now we got the complete size
00790     totB.UnionRect(selfB, bc);
00791
00792     if(nextNode != 0L)
00793     {
00794         CPoint nextTopLeft;
00795         nextTopLeft.x = totB.TopLeft().x;
00796         nextTopLeft.y = totB.BottomRight().y + kVChildSpace;
00797         GetData(nextNode)->ComputeBounds(nextTopLeft, hdc, entryInfo);
00798
00799         totB.UnionRect(totB, GetData(nextNode)->Bounds());
00800     }
00801 }

void CWinLogData::ComputeBounds | ( | const UPoint & | topLeft,
 |  | UDC & | hdc,
 |  | EntnodeData * | entryInfo = 0L
 | ) |

Definition at line 619 of file UCvsGraph.cpp.

References URect::BottomRight, Bounds, CreateNewData, USIZE::cx, USIZE::cy, GetBoundsSelf, GetData, URect::Height, kHChildSpace, kInflateNodeSpace, kVChildSpace, Offset, URect::OffsetRect, selfB, URect::SetRect, URect::SetRectEmpty, URect::TopLeft, totB, URect::UnionRect, URect::Width, UPOINT::x, and UPOINT::y.

Referenced by CGraphView::CalcImageSize, UCvsGraph::CalcImageSize, ComputeBounds, and CGraphView::OnBeginPrinting.

00621 {
00622     CLogNode *subNode;
00623     CLogNode *nextNode = fNode->Next();
00624
00625     // first compute childrens bounds
00626     std::vector<CLogNode *>::iterator i;
00627     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00628     {
00629         subNode = *i;
00630         CWinLogData::CreateNewData(subNode);
00631         GetData(subNode)->ComputeBounds(topLeft, hdc, entryInfo);
00632     }
00633     if(nextNode != 0L)
00634         CWinLogData::CreateNewData(nextNode);
00635
00636     // compute self place
00637     selfB.SetRectEmpty();
00638     USize size = GetBoundsSelf(hdc, entryInfo);
00639     size.cx += kInflateNodeSpace;
00640     size.cy += kInflateNodeSpace;
00641     selfB.SetRect(0, 0, size.cx, size.cy);
00642
00643     // offset to the place assigned to this node
00644     selfB.OffsetRect(topLeft - selfB.TopLeft());
00645
00646     // calculate the total height of the childrens
00647     int vSize = 0;
00648     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00649     {
00650         subNode = *i;
00651         URect & b = GetData(subNode)->Bounds();
00652         vSize += b.Height();
00653     }
00654     if(!fNode->Childs().empty())
00655         vSize += (fNode->Childs().size() - 1) * kVChildSpace;
00656
00657     // offset the children relative to self
00658     UPoint startChilds(topLeft.x + selfB.Width() + kHChildSpace,
00659         /*selfB.CenterPoint().y - vSize / 2*/topLeft.y);
00660     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00661     {
00662         subNode = *i;
00663         URect curPos = GetData(subNode)->Bounds();
00664         GetData(subNode)->Offset(startChilds - curPos.TopLeft());
00665         startChilds.y += curPos.Height() + kVChildSpace;
00666     }
00667
00668     // calculate the total bounds of the childrens
00669     URect bc;
00670     bc.SetRectEmpty();
00671     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00672     {
00673         subNode = *i;
00674         URect & b = GetData(subNode)->Bounds();
00675         bc.UnionRect(&bc, &b);
00676     }
00677
00678     // now we got the complete size
00679     totB.UnionRect(&selfB, &bc);
00680
00681     if(nextNode != 0L)
00682     {
00683         UPoint nextTopLeft;
00684         nextTopLeft.x = totB.TopLeft().x;
00685         nextTopLeft.y = totB.BottomRight().y + kVChildSpace;
00686         GetData(nextNode)->ComputeBounds(nextTopLeft, hdc, entryInfo);
00687
00688         totB.UnionRect(&totB, &GetData(nextNode)->Bounds());
00689     }
00690 }

CWinLogData* CWinLogData::CreateNewData ( CLogNode * node ) [static]

CWinLogData * CWinLogData::CreateNewData ( CLogNode * node ) [static]

Definition at line 432 of file UCvsGraph.cpp.

Referenced by CGraphView::CalcImageSize, UCvsGraph::CalcImageSize, ComputeBounds, and CGraphView::OnBeginPrinting.

00433 {
00434     if(node->GetUserData() != 0L)
00435         return (CWinLogData *)node->GetUserData();
00436
00437     CWinLogData *res = 0L;
00438     switch(node->GetType())
00439     {
00440     case kNodeHeader :
00441         res = new CWinLogHeaderData(node);
00442         break;
00443     case kNodeBranch :
00444         res = new CWinLogBranchData(node);
00445         break;
00446     case kNodeRev :
00447         res = new CWinLogRevData(node);
00448         break;
00449     case kNodeTag :
00450         res = new CWinLogTagData(node);
00451         break;
00452     }
00453     node->SetUserData(res);
00454     return res;
00455 }

virtual CSize CWinLogData::GetBoundsSelf | ( | CDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, pure virtual]

Implemented in CWinLogHeaderData.

virtual USize CWinLogData::GetBoundsSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, pure virtual]

Implemented in CWinLogHeaderData.

Referenced by ComputeBounds.

CWinLogData* CWinLogData::GetData ( CLogNode * node ) [inline, protected]

Definition at line 151 of file GraphView.cpp.

00152         { return (CWinLogData *)node->GetUserData(); }

CWinLogData* CWinLogData::GetData ( CLogNode * node ) [inline, protected]

Definition at line 138 of file UCvsGraph.cpp.

Referenced by ComputeBounds, HitTest, Offset, UnselectAll, and Update.

00139         { return (CWinLogData *)node->GetUserData(); }

const char* CWinLogData::GetStr ( void )

const char * CWinLogData::GetStr ( void )

Definition at line 400 of file UCvsGraph.cpp.

References GetType.

Referenced by CGraphView::OnGraphChangelogmessage, CGraphView::OnGraphSetstate, CGraphView::OnQueryAnnotate, CGraphView::OnViewDiff, CGraphView::OnViewRetrieve, CGraphView::OnViewTag, CGraphView::OnViewUnlockf, and TGraphDelCmd::TraverseNode.

00401 {
00402     switch(GetType())
00403     {
00404         case kNodeHeader :
00405         {
00406             CLogNodeHeader & header = *(CLogNodeHeader *)fNode;
00407             return (*header).WorkingFile();
00408             break;
00409         }
00410         case kNodeBranch :
00411         {
00412             CLogNodeBranch & branch = *(CLogNodeBranch *)fNode;
00413             return *branch;
00414             break;
00415         }
00416         case kNodeRev :
00417         {
00418             CLogNodeRev & rev = *(CLogNodeRev *)fNode;
00419             return (*rev).RevNum().c_str();
00420             break;
00421         }
00422         case kNodeTag :
00423         {
00424             CLogNodeTag & tag = *(CLogNodeTag *)fNode;
00425             return *tag;
00426             break;
00427         }
00428     }
00429     return 0L;
00430 }

kLogNode CWinLogData::GetType ( void ) const [inline]

Definition at line 125 of file GraphView.cpp.

00125 { return fNode->GetType(); }

kLogNode CWinLogData::GetType ( void ) const [inline]

Definition at line 114 of file UCvsGraph.cpp.

Referenced by GetStr, IsDeadNode, IsDiskNode, CGraphView::IsSelSingleNode, IsUserState, CGraphView::OnContextMenu, CGraphView::OnUpdateViewDiff, TGraphSelNonSig::TraverseNode, and TGraphDelCmd::TraverseNode.

00114 { return fNode->GetType(); }

CWinLogData * CWinLogData::HitTest ( CPoint point )

Definition at line 594 of file GraphView.cpp.

References GetData, HitTest, URect::PtInRect, selfB, and totB.

00595 {
00596     if(!totB.PtInRect(point))
00597         return 0L;
00598     if(selfB.PtInRect(point))
00599         return this;
00600
00601     CWinLogData *result;
00602     vector<CLogNode *>::iterator i;
00603     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00604     {
00605         CLogNode *subNode = *i;
00606         result = GetData(subNode)->HitTest(point);
00607         if(result != 0L)
00608             return result;
00609     }
00610     if(fNode->Next() != 0L)
00611     {
00612         result = GetData(fNode->Next())->HitTest(point);
00613         if(result != 0L)
00614             return result;
00615     }
00616     return 0L;
00617 }

CWinLogData * CWinLogData::HitTest ( UPoint point )

Definition at line 512 of file UCvsGraph.cpp.

References GetData, URect::PtInRect, selfB, and totB.

Referenced by HitTest, CGraphView::OnContextMenu, and CGraphView::OnLButtonDown.

00513 {
00514     if(!totB.PtInRect(point))
00515         return 0L;
00516     if(selfB.PtInRect(point))
00517         return this;
00518
00519     CWinLogData *result;
00520     std::vector<CLogNode *>::iterator i;
00521     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00522     {
00523         CLogNode *subNode = *i;
00524         result = GetData(subNode)->HitTest(point);
00525         if(result != 0L)
00526             return result;
00527     }
00528     if(fNode->Next() != 0L)
00529     {
00530         result = GetData(fNode->Next())->HitTest(point);
00531         if(result != 0L)
00532             return result;
00533     }
00534     return 0L;
00535 }

bool CWinLogData::IsDeadNode ( )

Definition at line 533 of file GraphView.cpp.

References GetType.

Referenced by CWinLogRevData::UpdateSelf.

00534 {
00535     if(GetType() != kNodeRev)
00536         return false;
00537
00538     return strcmp("dead", (**(CLogNodeRev *)fNode).State()) == 0;
00539 }

bool CWinLogData::IsDiskNode ( EntnodeData * entryInfo )

bool CWinLogData::IsDiskNode ( EntnodeData * entryInfo )

Definition at line 457 of file UCvsGraph.cpp.

References GetType, and EntnodeFile::kVN.

Referenced by CWinLogRevData::GetBoundsSelf, and CWinLogRevData::UpdateSelf.

00458 {
00459     if(entryInfo == 0L || GetType() != kNodeRev)
00460         return false;
00461     const char *vn = (*entryInfo)[EntnodeFile::kVN];
00462     if(vn == 0L)
00463         return false;
00464
00465     return strcmp(vn, (**(CLogNodeRev *)fNode).RevNum().c_str()) == 0;
00466 }

bool CWinLogData::IsUserState ( )

Definition at line 541 of file GraphView.cpp.

References GetType.

Referenced by CWinLogRevData::UpdateSelf.

00542 {
00543     if(GetType() != kNodeRev)
00544         return false;
00545
00546     return !(strcmp("dead", (**(CLogNodeRev *)fNode).State()) == 0 ||
00547         strcmp("Exp", (**(CLogNodeRev *)fNode).State()) == 0);
00548 }

void CWinLogData::Offset ( CPoint o )

Definition at line 554 of file GraphView.cpp.

References GetData, Offset, URect::OffsetRect, selfB, and totB.

00555 {
00556     selfB.OffsetRect(o);
00557     totB.OffsetRect(o);
00558     vector<CLogNode *>::iterator i;
00559     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00560     {
00561         CLogNode *subNode = *i;
00562         GetData(subNode)->Offset(o);
00563     }
00564     if(fNode->Next() != 0L)
00565         GetData(fNode->Next())->Offset(o);
00566 }

void CWinLogData::Offset ( UPoint o )

Definition at line 472 of file UCvsGraph.cpp.

References GetData, URect::OffsetRect, selfB, and totB.

Referenced by CGraphView::CalcImageSize, UCvsGraph::CalcImageSize, ComputeBounds, and Offset.

00473 {
00474     selfB.OffsetRect(o);
00475     totB.OffsetRect(o);
00476     std::vector<CLogNode *>::iterator i;
00477     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00478     {
00479         CLogNode *subNode = *i;
00480         GetData(subNode)->Offset(o);
00481     }
00482     if(fNode->Next() != 0L)
00483         GetData(fNode->Next())->Offset(o);
00484 }

bool CWinLogData::Selected ( void ) const [inline]

Definition at line 136 of file GraphView.cpp.

References sel.

00136 { return sel; }

bool CWinLogData::Selected ( void ) const [inline]

Definition at line 125 of file UCvsGraph.cpp.

References sel.

Referenced by CGraphView::OnContextMenu, CGraphView::OnLButtonDown, TGraphDelCmd::TraverseNode, TGraphCmdStatus::TraverseNode, and TGraphRectSelect::TraverseNode.

00125 { return sel; }

CRect& CWinLogData::SelfBounds ( void ) [inline]

Definition at line 134 of file GraphView.cpp.

References selfB.

00134 { return selfB; }

URect& CWinLogData::SelfBounds ( void ) [inline]

Definition at line 123 of file UCvsGraph.cpp.

References selfB.

Referenced by TGraphRectSelect::TraverseNode, and Update.

00123 { return selfB; }

void CWinLogData::SetSelected | ( | CScrollView * | view,
 |  | bool | state
 | ) |

void CWinLogData::SetSelected | ( | CScrollView * | view,
 |  | bool | state
 | ) |

Definition at line 486 of file UCvsGraph.cpp.

References CScrollView::GetDeviceScrollPosition, CScrollView::InvalidateRect, URect::OffsetRect, sel, and selfB.

Referenced by CGraphView::OnContextMenu, CGraphView::OnLButtonDown, TGraphSelNonSig::TraverseNode, TGraphRectSelect::TraverseNode, and UnselectAll.

00487 {
00488     sel = state;
00489
00490     URect invalR = selfB;
00491     invalR.OffsetRect(-view->GetDeviceScrollPosition());
00492     view->InvalidateRect(&invalR);
00493 }

void CWinLogData::UnselectAll ( CScrollView * view )

void CWinLogData::UnselectAll ( CScrollView * view )

Definition at line 495 of file UCvsGraph.cpp.

References GetData, and SetSelected.

Referenced by CGraphView::OnContextMenu, CGraphView::OnLButtonDown, and CGraphView::OnViewSelnonsig.

00496 {
00497     if(sel)
00498     {
00499         SetSelected(view, false);
00500     }
00501
00502     std::vector<CLogNode *>::iterator i;
00503     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00504     {
00505         CLogNode *subNode = *i;
00506         GetData(subNode)->UnselectAll(view);
00507     }
00508     if(fNode->Next() != 0L)
00509         GetData(fNode->Next())->UnselectAll(view);
00510 }

void CWinLogData::Update | ( | CDC & | hdc,
 |  | EntnodeData * | entryInfo = 0L
 | ) |

Definition at line 619 of file GraphView.cpp.

References URect::BottomRight, URect::CenterPoint, GetData, kHChildSpace, selfB, SelfBounds, URect::TopLeft, Update, UpdateSelf, URect::Width, UPOINT::x, and UPOINT::y.

00620 {
00621     CLogNode *subNode;
00622     CLogNode *nextNode = fNode->Next();
00623     CPen *pOldPen = 0L;
00624     CBrush *pOldBrush = 0L;
00625     CPen pen, pen2;
00626     CBrush brush;
00627
00628     UpdateSelf(hdc, entryInfo);
00629
00630     TRY
00631     {
00632         pen.CreatePen(PS_SOLID, 2, RGB(0, 0, 255));
00633         pen2.CreatePen(PS_SOLID, 1, RGB(0, 0, 0));
00634         pOldPen = hdc.SelectObject(&pen);
00635
00636         int topY = selfB.TopLeft().y + 2;
00637         int botY = selfB.BottomRight().y - 2;
00638         int lefX = selfB.BottomRight().x + 4;
00639
00640         int count = 1;
00641         int tot = fNode->Childs().size() + 1;
00642
00643         // draw the children
00644         vector<CLogNode *>::iterator i;
00645         for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i, ++count)
00646         {
00647             subNode = *i;
00648
00649             // draw the link
00650             CRect & cb = GetData(subNode)->SelfBounds();
00651             if(subNode->GetType() == kNodeRev || subNode->GetType() == kNodeBranch)
00652                 hdc.SelectObject(&pen);
00653             else
00654                 hdc.SelectObject(&pen2);
00655             float y = (float)topY + (float)(botY - topY) *
00656                 (float)count / (float)tot;
00657             int rigX = cb.TopLeft().x - 4;
00658             float x = (float)rigX - (float)(rigX - lefX) *
00659                 (float)count / (float)tot;
00660
00661             //special drawing for the header node
00662             if( count == 1 && fNode->GetType() == kNodeHeader )
00663             {
00664                 hdc.MoveTo(selfB.TopLeft().x + kHChildSpace/2, selfB.BottomRight().y);
00665                 hdc.LineTo(selfB.TopLeft().x + kHChildSpace/2, cb.CenterPoint().y);
00666                 hdc.LineTo(cb.TopLeft().x, cb.CenterPoint().y);
00667             }
00668             else
00669             {
00670                 //int halfX = (cb.TopLeft().x - selfB.BottomRight().x) / 2;
00671                 hdc.MoveTo(selfB.BottomRight().x, (int)y);
00672                 hdc.LineTo(x, (int)y);
00673                 hdc.LineTo(x, cb.CenterPoint().y);
00674                 hdc.LineTo(cb.TopLeft().x, cb.CenterPoint().y);
00675             }
00676
00677             // draw the sub-node
00678             GetData(subNode)->Update(hdc, entryInfo);
00679         }
00680
00681         // draw the next node
00682         if(nextNode != 0L)
00683         {
00684             // draw the link
00685             CRect & nb = GetData(nextNode)->SelfBounds();
00686             if(nextNode->GetType() == kNodeRev || nextNode->GetType() == kNodeBranch)
00687                 hdc.SelectObject(&pen);
00688             else
00689                 hdc.SelectObject(&pen2);
00690             int centerX = selfB.Width() < nb.Width() ?
00691                 selfB.CenterPoint().x : nb.CenterPoint().x;
00692             hdc.MoveTo(centerX, selfB.BottomRight().y);
00693             hdc.LineTo(centerX, nb.TopLeft().y);
00694
00695             // draw the next node
00696             GetData(nextNode)->Update(hdc, entryInfo);
00697         }
00698
00699         if (pOldPen != 0L)
00700         {
00701             hdc.SelectObject(pOldPen);
00702             pOldPen = 0L;
00703         }
00704         if (pOldBrush != 0L)
00705         {
00706             hdc.SelectObject(pOldBrush);
00707             pOldBrush = 0L;
00708         }
00709
00710         pen.DeleteObject();
00711         pen2.DeleteObject();
00712     }
00713     CATCH_ALL(e)
00714     {
00715         if (pOldPen != 0L)
00716             hdc.SelectObject(pOldPen);
00717         if (pOldBrush != 0L)
00718             hdc.SelectObject(pOldBrush);
00719     }
00720     END_CATCH_ALL
00721 }

void CWinLogData::Update | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo = 0L
 | ) |

Definition at line 537 of file UCvsGraph.cpp.

References URect::BottomRight, URect::CenterPoint, UPen::CreatePen, UPen::DeleteObject, GetData, UDC::LineTo, UDC::MoveTo, UDC::SelectObject, selfB, SelfBounds, URect::TopLeft, UpdateSelf, UPS_SOLID, URGB, URect::Width, UPOINT::x, and UPOINT::y.

Referenced by CGraphView::OnDraw, UCvsGraph::OnDrawing, CGraphView::OnPrint, and Update.

00538 {
00539     CLogNode *subNode;
00540     CLogNode *nextNode = fNode->Next();
00541     UPen *pOldPen = 0L;
00542     UPen pen, pen2;
00543
00544     UpdateSelf(hdc, entryInfo);
00545
00546     try
00547     {
00548         pen.CreatePen(UPS_SOLID, 2, URGB(0, 0, 255));
00549         pen2.CreatePen(UPS_SOLID, 1, URGB(0, 0, 0));
00550         pOldPen = hdc.SelectObject(&pen);
00551
00552         int topY = selfB.TopLeft().y + 2;
00553         int botY = selfB.BottomRight().y - 2;
00554         int lefX = selfB.BottomRight().x + 4;
00555         int count = 1;
00556         int tot = fNode->Childs().size() + 1;
00557
00558         // draw the children
00559         std::vector<CLogNode *>::iterator i;
00560         for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i, ++count)
00561         {
00562             subNode = *i;
00563
00564             // draw the link
00565             URect & cb = GetData(subNode)->SelfBounds();
00566             if(subNode->GetType() == kNodeRev || subNode->GetType() == kNodeBranch)
00567                 hdc.SelectObject(&pen);
00568             else
00569                 hdc.SelectObject(&pen2);
00570             float y = (float)topY + (float)(botY - topY) *
00571                 (float)count / (float)tot;
00572             int rigX = cb.TopLeft().x - 4;
00573             float x = (float)rigX - (float)(rigX - lefX) *
00574                 (float)count / (float)tot;
00575             //int halfX = (cb.TopLeft().x - selfB.BottomRight().x) / 2;
00576             hdc.MoveTo(selfB.BottomRight().x, (int)y);
00577             hdc.LineTo((int)x, (int)y);
00578             hdc.LineTo((int)x, cb.CenterPoint().y);
00579             hdc.LineTo(cb.TopLeft().x, cb.CenterPoint().y);
00580
00581             // draw the sub-node
00582             GetData(subNode)->Update(hdc, entryInfo);
00583         }
00584
00585         // draw the next node
00586         if(nextNode != 0L)
00587         {
00588             // draw the link
00589             URect & nb = GetData(nextNode)->SelfBounds();
00590             if(nextNode->GetType() == kNodeRev || nextNode->GetType() == kNodeBranch)
00591                 hdc.SelectObject(&pen);
00592             else
00593                 hdc.SelectObject(&pen2);
00594             int centerX = selfB.Width() < nb.Width() ?
00595                 selfB.CenterPoint().x : nb.CenterPoint().x;
00596             hdc.MoveTo(centerX, selfB.BottomRight().y);
00597             hdc.LineTo(centerX, nb.TopLeft().y);
00598
00599             // draw the next node
00600             GetData(nextNode)->Update(hdc, entryInfo);
00601         }
00602
00603         if (pOldPen != 0L)
00604         {
00605             hdc.SelectObject(pOldPen);
00606             pOldPen = 0L;
00607         }
00608
00609         pen.DeleteObject();
00610         pen2.DeleteObject();
00611     }
00612     catch(...)
00613     {
00614         if (pOldPen != 0L)
00615             hdc.SelectObject(pOldPen);
00616     }
00617 }

virtual void CWinLogData::UpdateSelf | ( | CDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, pure virtual]

Implemented in CWinLogHeaderData.

virtual void CWinLogData::UpdateSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, pure virtual]

Implemented in CWinLogHeaderData.

Referenced by Update.

Member Data Documentation

bool CWinLogData::sel [protected]

Definition at line 156 of file GraphView.cpp.

Referenced by CWinLogData, Selected, SetSelected, CWinLogBranchData::UpdateSelf, CWinLogTagData::UpdateSelf, CWinLogRevData::UpdateSelf, and CWinLogHeaderData::UpdateSelf.

CRect CWinLogData::selfB [protected]

Definition at line 154 of file GraphView.cpp.

URect CWinLogData::selfB [protected]

Definition at line 141 of file UCvsGraph.cpp.

Referenced by ComputeBounds, CWinLogData, HitTest, Offset, SelfBounds, SetSelected, Update, CWinLogBranchData::UpdateSelf, CWinLogTagData::UpdateSelf, CWinLogRevData::UpdateSelf, and CWinLogHeaderData::UpdateSelf.

CRect CWinLogData::totB [protected]

Definition at line 155 of file GraphView.cpp.

URect CWinLogData::totB [protected]

Definition at line 142 of file UCvsGraph.cpp.

Referenced by Bounds, ComputeBounds, CWinLogData, HitTest, and Offset.

The documentation for this class was generated from the following files:
  • common/UCvsGraph.cpp
  • WinCvs/GraphView.cpp
Generated on Sun Feb 24 01:29:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CWinLogHeaderData Class Reference

Inheritance diagram for CWinLogHeaderData:

[legend]
Collaboration diagram for CWinLogHeaderData:

[legend]
List of all members.

Public Methods

CWinLogHeaderData (CLogNode *node)
virtual | ~CWinLogHeaderData ()
CWinLogHeaderData (CLogNode *node)
virtual | ~CWinLogHeaderData ()

Protected Methods

virtual void | UpdateSelf (UDC &hdc, EntnodeData *entryInfo)
virtual USize | GetBoundsSelf (UDC &hdc, EntnodeData *entryInfo)
virtual void | UpdateSelf (CDC &hdc, EntnodeData *entryInfo)
virtual CSize | GetBoundsSelf (CDC &hdc, EntnodeData *entryInfo)

Constructor & Destructor Documentation

CWinLogHeaderData::CWinLogHeaderData ( CLogNode * node ) [inline]

Definition at line 149 of file UCvsGraph.cpp.

00149 : CWinLogData(node) {}

virtual CWinLogHeaderData::~CWinLogHeaderData ( ) [inline, virtual]

Definition at line 150 of file UCvsGraph.cpp.

00150 {}

CWinLogHeaderData::CWinLogHeaderData ( CLogNode * node ) [inline]

Definition at line 162 of file GraphView.cpp.

00162 : CWinLogData(node) {}

virtual CWinLogHeaderData::~CWinLogHeaderData ( ) [inline, virtual]

Definition at line 163 of file GraphView.cpp.

00163 {}

Member Function Documentation

CSize CWinLogHeaderData::GetBoundsSelf | ( | CDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 203 of file GraphView.cpp.

00204 {
00205     CLogNodeHeader & header = *(CLogNodeHeader *)fNode;
00206     return hdc.GetTextExtent((*header).WorkingFile(),
00207         (*header).WorkingFile().length());
00208 }

USize CWinLogHeaderData::GetBoundsSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 190 of file UCvsGraph.cpp.

References UDC::GetTextExtent.

00191 {
00192     CLogNodeHeader & header = *(CLogNodeHeader *)fNode;
00193     return hdc.GetTextExtent((*header).WorkingFile(),
00194         (*header).WorkingFile().length());
00195 }

void CWinLogHeaderData::UpdateSelf | ( | CDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 333 of file GraphView.cpp.

References URect::CenterPoint, kRoundRect, NULL, CWinLogData::sel, and CWinLogData::selfB.

00334 {
00335     // draw the node
00336     ::DrawNode(hdc, selfB, gGraphHeaderColor, kRoundRect, sel);
00337
00338     // draw the content of the node
00339     TEXTMETRIC tm;
00340     hdc.GetTextMetrics(&tm);
00341     CPoint center = selfB.CenterPoint();
00342     int nCenterX = center.x;
00343     int nCenterY = center.y - tm.tmHeight/2;
00344     CLogNodeHeader & header = *(CLogNodeHeader *)fNode;
00345     hdc.ExtTextOut(nCenterX, nCenterY, ETO_CLIPPED, selfB,
00346         (*header).WorkingFile(), (*header).WorkingFile().length(), NULL);
00347 }

void CWinLogHeaderData::UpdateSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 292 of file UCvsGraph.cpp.

References URect::CenterPoint, UDC::GetTextHeight, CWinLogData::sel, CWinLogData::selfB, UDC::TextOutClipped, URGB, UPOINT::x, and UPOINT::y.

00293 {
00294     // draw the node
00295     ::DrawNode(hdc, selfB, URGB(255, 0, 0), URGB(120, 0, 0), true, sel);
00296
00297     // draw the content of the node
00298     UPoint center = selfB.CenterPoint();
00299     int nCenterX = center.x;
00300     int nCenterY = center.y - hdc.GetTextHeight()/2;
00301     CLogNodeHeader & header = *(CLogNodeHeader *)fNode;
00302     hdc.TextOutClipped(nCenterX, nCenterY, &selfB,
00303         (*header).WorkingFile(), (*header).WorkingFile().length());
00304 }

The documentation for this class was generated from the following files:
  • common/UCvsGraph.cpp
  • WinCvs/GraphView.cpp
Generated on Sun Feb 24 01:29:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CWinLogRevData Class Reference

Inheritance diagram for CWinLogRevData:

[legend]
Collaboration diagram for CWinLogRevData:

[legend]
List of all members.

Public Methods

CWinLogRevData (CLogNode *node)
virtual | ~CWinLogRevData ()
CWinLogRevData (CLogNode *node)
virtual | ~CWinLogRevData ()

Protected Methods

virtual void | UpdateSelf (UDC &hdc, EntnodeData *entryInfo)
virtual USize | GetBoundsSelf (UDC &hdc, EntnodeData *entryInfo)
virtual void | UpdateSelf (CDC &hdc, EntnodeData *entryInfo)
virtual CSize | GetBoundsSelf (CDC &hdc, EntnodeData *entryInfo)

Constructor & Destructor Documentation

CWinLogRevData::CWinLogRevData ( CLogNode * node ) [inline]

Definition at line 160 of file UCvsGraph.cpp.

00160 : CWinLogData(node) {}

virtual CWinLogRevData::~CWinLogRevData ( ) [inline, virtual]

Definition at line 161 of file UCvsGraph.cpp.

00161 {}

CWinLogRevData::CWinLogRevData ( CLogNode * node ) [inline]

Definition at line 173 of file GraphView.cpp.

00173 : CWinLogData(node) {}

virtual CWinLogRevData::~CWinLogRevData ( ) [inline, virtual]

Definition at line 174 of file GraphView.cpp.

00174 {}

Member Function Documentation

CSize CWinLogRevData::GetBoundsSelf | ( | CDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 349 of file GraphView.cpp.

References USIZE::cx, and CWinLogData::IsDiskNode.

00350 {
00351     CLogNodeRev & rev = *(CLogNodeRev *)fNode;
00352     CSize size = hdc.GetTextExtent((*rev).RevNum().c_str(),
00353         strlen((*rev).RevNum().c_str()));
00354     if(IsDiskNode(entryInfo))
00355     {
00356         size.cx += 2 + 16 + 2;
00357         size.cy = max(16, size.cy);
00358     }
00359     return size;
00360 }

USize CWinLogRevData::GetBoundsSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 306 of file UCvsGraph.cpp.

References USIZE::cx, USIZE::cy, UDC::GetTextExtent, and CWinLogData::IsDiskNode.

00307 {
00308     CLogNodeRev & rev = *(CLogNodeRev *)fNode;
00309     USize size = hdc.GetTextExtent((*rev).RevNum().c_str(),
00310         strlen((*rev).RevNum().c_str()));
00311     if(IsDiskNode(entryInfo))
00312     {
00313         size.cx += 2 + 16 + 2;
00314         size.cy = std::max(16, size.cy);
00315     }
00316     return size;
00317 }

void CWinLogRevData::UpdateSelf | ( | CDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 362 of file GraphView.cpp.

References CBrowseFileView::GetImageForEntry, CGraphView::GetImgList, URect::Height, CWinLogData::IsDeadNode, CWinLogData::IsDiskNode, CWinLogData::IsUserState, kRectangle, URECT::left, NULL, CWinLogData::sel, CWinLogData::selfB, STYLE_DEADNODE, STYLE_USERSTATENODE, and URect::TopLeft.

00363 {
00364     CRect txtRect = selfB;
00365
00366     if(IsDiskNode(entryInfo))
00367     {
00368         txtRect.left += 2 + 16 + 2;
00369     }
00370
00371     // draw the node
00372     COLORREF contour = gGraphNodeColor;
00373     int penStyle = PS_SOLID;
00374
00375     if(IsDeadNode())
00376     {
00377         contour = (COLORREF)gGraphDeadNodeColor;
00378         penStyle = STYLE_DEADNODE;
00379     }
00380     else if(IsUserState())
00381     {
00382         contour = (COLORREF)gGraphUserStateNodeColor;
00383         penStyle = STYLE_USERSTATENODE;
00384     }
00385
00386     ::DrawNode(hdc, selfB, contour, kRectangle, sel, penStyle);
00387
00388     // draw the state icon if it is the rev. of the disk
00389     if(IsDiskNode(entryInfo))
00390     {
00391         CImageList & list = CGraphView::GetImgList();
00392         CPoint w(selfB.TopLeft());
00393         w.x += 2;
00394         w.y += (selfB.Height() - 16) / 2;
00395         list.Draw(&hdc, CBrowseFileView::GetImageForEntry(entryInfo),
00396             w, ILD_TRANSPARENT);
00397     }
00398
00399     // draw the content of the node
00400     TEXTMETRIC tm;
00401     hdc.GetTextMetrics(&tm);
00402     CPoint center = txtRect.CenterPoint();
00403     int nCenterX = center.x;
00404     int nCenterY = center.y - tm.tmHeight/2;
00405     CLogNodeRev & rev = *(CLogNodeRev *)fNode;
00406     hdc.ExtTextOut(nCenterX, nCenterY, ETO_CLIPPED, txtRect,
00407             (*rev).RevNum().c_str(), strlen((*rev).RevNum().c_str()), NULL);
00408 }

void CWinLogRevData::UpdateSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 319 of file UCvsGraph.cpp.

References URect::CenterPoint, UDC::DrawBitmap, UCvsFiles::GetImageForEntry, UDC::GetTextHeight, URect::Height, CWinLogData::IsDiskNode, URECT::left, CWinLogData::sel, CWinLogData::selfB, UDC::TextOutClipped, URect::TopLeft, URGB, UPOINT::x, and UPOINT::y.

00320 {
00321     URect txtRect = selfB;
00322
00323     if(IsDiskNode(entryInfo))
00324     {
00325         txtRect.left += 2 + 16 + 2;
00326     }
00327
00328     // draw the node
00329     ::DrawNode(hdc, selfB, URGB(0, 0, 255), URGB(0, 0, 0), false, sel);
00330
00331     // draw the state icon if it is the rev. of the disk
00332     if(IsDiskNode(entryInfo))
00333     {
00334         UPoint w(selfB.TopLeft());
00335         w.x += 2;
00336         w.y += (selfB.Height() - 16) / 2;
00337         hdc.DrawBitmap(UCvsFiles::GetImageForEntry(entryInfo), w);
00338     }
00339
00340     // draw the content of the node
00341     UPoint center = txtRect.CenterPoint();
00342     int nCenterX = center.x;
00343     int nCenterY = center.y - hdc.GetTextHeight()/2;
00344     CLogNodeRev & rev = *(CLogNodeRev *)fNode;
00345     hdc.TextOutClipped(nCenterX, nCenterY, &txtRect,
00346             (*rev).RevNum().c_str(), strlen((*rev).RevNum().c_str()));
00347 }

The documentation for this class was generated from the following files:
  • common/UCvsGraph.cpp
  • WinCvs/GraphView.cpp
Generated on Sun Feb 24 01:29:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CWinLogTagData Class Reference

Inheritance diagram for CWinLogTagData:

[legend]
Collaboration diagram for CWinLogTagData:

[legend]
List of all members.

Public Methods

CWinLogTagData (CLogNode *node)
virtual | ~CWinLogTagData ()
CWinLogTagData (CLogNode *node)
virtual | ~CWinLogTagData ()

Protected Methods

virtual void | UpdateSelf (UDC &hdc, EntnodeData *entryInfo)
virtual USize | GetBoundsSelf (UDC &hdc, EntnodeData *entryInfo)
virtual void | UpdateSelf (CDC &hdc, EntnodeData *entryInfo)
virtual CSize | GetBoundsSelf (CDC &hdc, EntnodeData *entryInfo)

Constructor & Destructor Documentation

CWinLogTagData::CWinLogTagData ( CLogNode * node ) [inline]

Definition at line 171 of file UCvsGraph.cpp.

00171 : CWinLogData(node) {}

virtual CWinLogTagData::~CWinLogTagData ( ) [inline, virtual]

Definition at line 172 of file UCvsGraph.cpp.

00172 {}

CWinLogTagData::CWinLogTagData ( CLogNode * node ) [inline]

Definition at line 184 of file GraphView.cpp.

00184 : CWinLogData(node) {}

virtual CWinLogTagData::~CWinLogTagData ( ) [inline, virtual]

Definition at line 185 of file GraphView.cpp.

00185 {}

Member Function Documentation

CSize CWinLogTagData::GetBoundsSelf | ( | CDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 410 of file GraphView.cpp.

00411 {
00412     CLogNodeTag & tag = *(CLogNodeTag *)fNode;
00413     return hdc.GetTextExtent(*tag, (*tag).length());
00414 }

USize CWinLogTagData::GetBoundsSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 349 of file UCvsGraph.cpp.

References UDC::GetTextExtent.

00350 {
00351     CLogNodeTag & tag = *(CLogNodeTag *)fNode;
00352     return hdc.GetTextExtent(*tag, (*tag).length());
00353 }

void CWinLogTagData::UpdateSelf | ( | CDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 416 of file GraphView.cpp.

References URect::CenterPoint, kRoundRect, NULL, CWinLogData::sel, and CWinLogData::selfB.

00417 {
00418     // draw the node
00419     ::DrawNode(hdc, selfB, gGraphTagColor, kRoundRect, sel);
00420
00421     // draw the content of the node
00422     TEXTMETRIC tm;
00423     hdc.GetTextMetrics(&tm);
00424     CPoint center = selfB.CenterPoint();
00425     int nCenterX = center.x;
00426     int nCenterY = center.y - tm.tmHeight/2;
00427     CLogNodeTag & tag = *(CLogNodeTag *)fNode;
00428     hdc.ExtTextOut(nCenterX, nCenterY, ETO_CLIPPED, selfB,
00429         *tag, (*tag).length(), NULL);
00430 }

void CWinLogTagData::UpdateSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 355 of file UCvsGraph.cpp.

References URect::CenterPoint, UDC::GetTextHeight, CWinLogData::sel, CWinLogData::selfB, UDC::TextOutClipped, URGB, UPOINT::x, and UPOINT::y.

00356 {
00357     // draw the node
00358     ::DrawNode(hdc, selfB, URGB(0, 0, 0), URGB(120, 120, 120), true, sel);
00359
00360     // draw the content of the node
00361     UPoint center = selfB.CenterPoint();
00362     int nCenterX = center.x;
00363     int nCenterY = center.y - hdc.GetTextHeight()/2;
00364     CLogNodeTag & tag = *(CLogNodeTag *)fNode;
00365     hdc.TextOutClipped(nCenterX, nCenterY, &selfB,
00366         *tag, (*tag).length());
00367 }

The documentation for this class was generated from the following files:
  • common/UCvsGraph.cpp
  • WinCvs/GraphView.cpp
Generated on Sun Feb 24 01:29:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CWinPlacement Class Reference

Inheritance diagram for CWinPlacement:

[legend]
Collaboration diagram for CWinPlacement:

[legend]
List of all members.

Public Methods

CWinPlacement (const char *uniqueName)
virtual | ~CWinPlacement ()
virtual unsigned int | SizeOf (void) const
virtual const void * | GetData (void) const
virtual void | SetData (const void *ptr, unsigned int size)
CWinPlacement & | operator= (const WINDOWPLACEMENT &newplace)

Public Attributes

WINDOWPLACEMENT placement
bool | hasOne

Constructor & Destructor Documentation

CWinPlacement::CWinPlacement ( const char * uniqueName ) [inline]

Definition at line 64 of file MainFrm.cpp.

References hasOne, and kNoClass.

00064                                           : CPersistent(uniqueName, kNoClass)
00065     {
00066         hasOne = false;
00067     }

virtual CWinPlacement::~CWinPlacement ( ) [inline, virtual]

Definition at line 68 of file MainFrm.cpp.

00069     {
00070     }

Member Function Documentation

virtual const void* CWinPlacement::GetData ( void ) const [inline, virtual]

Implements CPersistent.

Definition at line 77 of file MainFrm.cpp.

References hasOne.

00078     {
00079         return hasOne ? &placement : 0L;
00080     }

CWinPlacement& CWinPlacement::operator= ( const WINDOWPLACEMENT & newplace ) [inline]

Definition at line 91 of file MainFrm.cpp.

References hasOne, and CPersistent::TouchTimeStamp.

00092     {
00093         TouchTimeStamp();
00094         memcpy(&placement, &newplace, sizeof(WINDOWPLACEMENT));
00095         hasOne = true;
00096         return *this;
00097     }

virtual void CWinPlacement::SetData | ( | const void * | ptr,
 |  | unsigned int | size
 | ) | [inline, virtual]

Implements CPersistent.

Definition at line 82 of file MainFrm.cpp.

References hasOne.

00083     {
00084         if(size == sizeof(WINDOWPLACEMENT))
00085         {
00086             memcpy(&placement, ptr, sizeof(WINDOWPLACEMENT));
00087             hasOne = true;
00088         }
00089     }

virtual unsigned int CWinPlacement::SizeOf ( void ) const [inline, virtual]

Implements CPersistent.

Definition at line 72 of file MainFrm.cpp.

References hasOne.

00073     {
00074         return hasOne ? sizeof(WINDOWPLACEMENT) : 0;
00075     }

Member Data Documentation

bool CWinPlacement::hasOne

Definition at line 62 of file MainFrm.cpp.

Referenced by CWinPlacement, GetData, CMainFrame::InitialShowWindow, operator=, SetData, and SizeOf.

WINDOWPLACEMENT CWinPlacement::placement

Definition at line 61 of file MainFrm.cpp.

Referenced by CMainFrame::InitialShowWindow.

The documentation for this class was generated from the following file:
  • WinCvs/MainFrm.cpp
Generated on Sun Feb 24 01:29:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CWinThread Class Reference

Inheritance diagram for CWinThread:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/wincvs.cpp
Generated on Sun Feb 24 01:29:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CWnd Class Reference

Inheritance diagram for CWnd:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CJLib/Include/GfxOutBarCtrl.h
Generated on Sun Feb 24 01:29:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CWndRedrawMngr Class Reference

CWndRedrawManager supports efficient drawing of CWnd based windows,. More...

#include <wincvs_winutil.h>

Collaboration diagram for CWndRedrawMngr:

[legend]
List of all members.

Public Methods

CWndRedrawMngr (CWnd *pWnd, BOOL bRedraw=FALSE)
Constructor sets the redraw to FALSE unless overrriden by bRedraw flag. More...

virtual | ~CWndRedrawMngr ()
Destructor will make sure that Redraw is set to TRUE when object goes out of scope. More...

void | SetRedraw (BOOL bRedraw)
Basic manupulation of the Redraw state. More...

Private Attributes

CWnd * m_pWnd

Detailed Description

CWndRedrawManager supports efficient drawing of CWnd based windows,.

Definition at line 30 of file wincvs_winutil.h.

Constructor & Destructor Documentation

CWndRedrawMngr::CWndRedrawMngr | ( | CWnd * | pWnd,
 |  | BOOL | bRedraw = FALSE
 | ) |

Constructor sets the redraw to FALSE unless overrriden by bRedraw flag.

Definition at line 536 of file wincvs_winutil.cpp.

References ASSERT, m_pWnd, and NULL.

00537 {
00538     ASSERT(pWnd != NULL);
00539     m_pWnd = pWnd;
00540
00541     if( m_pWnd )
00542     {
00543         m_pWnd->SetRedraw(bRedraw);
00544     }
00545 }

CWndRedrawMngr::~CWndRedrawMngr ( ) [virtual]

Destructor will make sure that Redraw is set to TRUE when object goes out of scope.

Definition at line 548 of file wincvs_winutil.cpp.

References m_pWnd, and TRUE.

00549 {
00550     if( m_pWnd )
00551     {
00552         m_pWnd->SetRedraw(TRUE);
00553     }
00554 }

Member Function Documentation

void CWndRedrawMngr::SetRedraw ( BOOL bRedraw )

Basic manupulation of the Redraw state.

Definition at line 557 of file wincvs_winutil.cpp.

References m_pWnd.

00558 {
00559     if( m_pWnd )
00560     {
00561         m_pWnd->SetRedraw(bRedraw);
00562     }
00563 }

Member Data Documentation

CWnd* CWndRedrawMngr::m_pWnd [private]

Definition at line 33 of file wincvs_winutil.h.

Referenced by CWndRedrawMngr, SetRedraw, and ~CWndRedrawMngr.

The documentation for this class was generated from the following files:
  • WinCvs/wincvs_winutil.h
  • WinCvs/wincvs_winutil.cpp
Generated on Sun Feb 24 01:29:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


wnt_stat Struct Reference

#include <StdAfx.h>

Collaboration diagram for wnt_stat:

[legend]
List of all members.

Public Attributes

_dev_t | st_dev
_ino_t | st_ino
unsigned short | st_mode
short | st_nlink
short | st_uid
short | st_gid
_dev_t | st_rdev
_off_t | st_size
time_t | st_atime
time_t | st_mtime
time_t | st_ctime

Member Data Documentation

time_t wnt_stat::st_atime

Definition at line 84 of file StdAfx.h.

time_t wnt_stat::st_ctime

Definition at line 86 of file StdAfx.h.

_dev_t wnt_stat::st_dev

Definition at line 76 of file StdAfx.h.

short wnt_stat::st_gid

Definition at line 81 of file StdAfx.h.

_ino_t wnt_stat::st_ino

Definition at line 77 of file StdAfx.h.

unsigned short wnt_stat::st_mode

Definition at line 78 of file StdAfx.h.

time_t wnt_stat::st_mtime

Definition at line 85 of file StdAfx.h.

Referenced by cvsgui_GetFileModTime, and tclGetFileModTimeProc.

short wnt_stat::st_nlink

Definition at line 79 of file StdAfx.h.

_dev_t wnt_stat::st_rdev

Definition at line 82 of file StdAfx.h.

_off_t wnt_stat::st_size

Definition at line 83 of file StdAfx.h.

short wnt_stat::st_uid

Definition at line 80 of file StdAfx.h.

The documentation for this struct was generated from the following file:
  • WinCvs/StdAfx.h
Generated on Sun Feb 24 01:29:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


std::wstring Class Reference

Inheritance diagram for std::wstring:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/Win32wstring.hpp
Generated on Sun Feb 24 01:29:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Hierarchical Index

WinCvs Source Class Hierarchy

Go to the graphical class hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically:

  • _afxRichEditCookie
  • _CvsProcess
  • _dircontents
  • _dirdesc
  • _frameRec
  • _IID
  • _MIDL_PROC_FORMAT_STRING
  • _MIDL_TYPE_FORMAT_STRING
  • _WireHandler
  • _WireMessage
  • AFX_DLLVERSIONINFO
  • CAllHandlers
  • CAllTargets
  • ansiAttrCvt
    • CTCP2Parse
  • ansiAttrCvt::AnsiSeq
  • AREF
  • aref
  • Authen
  • AuthenModel
    • AuthenGserver
    • AuthenKserver
    • AuthenLocal
    • AuthenNtserver
    • AuthenPserver
    • AuthenRhosts
    • AuthenSSH
  • CAuthenSetUp
  • awidget
  • UBrush
  • CBuffer
  • CButton
    • CCJBrowseButton
    • CCJColorPicker
    • CCJFlatButton
      • CCJCaptionButton
      • CCJCBarButton
      • CPseudoButton
        • CPseudoRotButton
        • CPseudoToggle
    • CCJMetaFileButton
  • CCJMenuData
  • CCJShellTree
    • CMyShellTree
  • CCJSortClass
  • CCJSortClass::CSortItem
  • CCJTreeCtrl::Color_Font
  • UCmdUI
  • CCmdUI
    • CCJToolCmdUI
  • UCOLOR
  • UColor
  • CColorConsole
  • CComboBox
    • CCJComboBoxEx
    • CCJFlatComboBox
    • CCJFontCombo
    • CSmartComboBox
  • CComboBoxEx
    • CHistComboBoxEx
    • CToolbarCombo
  • CComCoClass
    • CvsCoworker
  • CComModule
    • CCVS_CoworkerModule
  • CComObjectRootEx
    • CvsCoworker
  • CContentItems
  • CControlBar
    • CCJControlBar
      • CBarConsole
      • CCJExplorerBar
      • CCJTabCtrlBar
    • CCJToolBarBase
      • CCJReBar
      • CCJToolBar
        • CCJMenuBar
        • CDynToolBar
  • CCtrlView
    • CCJTabView
  • CCvsConsole
    • CGraphConsole
    • CPyCvsConsole
    • CRevisionConsole
    • CStreamConsole
    • CTCLCvsConsole
  • CCvsThreadLock
  • UDC
  • CDestroyThreadLock
  • CDialog
    • CAboutDlg
    • CAdminOptionDlg
    • CAskYesNo
    • CCustomizeMenus
    • CCVSAlert
    • CEditorMonDlg
    • CGraphOptDlg
    • CImportEntry
    • CImportFilterDlg
    • CImportWarning
    • CNoPython
    • CProgressDialog
    • CPseudoDlg
    • CReleaseDlg
    • CTipDlg
    • GetPassword
    • GetValue
  • direct
  • CDockBar
    • CCJDockBar
    • CCJSizeDockBar
  • CDockContext
    • CCJDockContext
  • CDocument
    • CGraphDoc
    • CWincvsDoc
  • DROPDOWNBUTTON
  • CDummyClass
  • CDummyInit
  • DYN_LIST
  • CEdit
    • CCJBrowseEdit
    • CCJHexEdit
    • CCJMaskEdit
      • CCJDateEdit
        • CCJTimeEdit
    • CGfxGroupEdit
    • CTbEdit
  • ENTNODE
  • EntnodeData
    • EntnodeFile
    • EntnodeFolder
  • EntnodePath
  • FileEntry
  • CFormView
    • CCJHtmlView
  • CFrameWnd
    • CCJFrameWnd
  • garbyRec
  • CGfxOutBarCtrl::CBarFolder
  • CGfxOutBarCtrl::CBarItem
  • GPT_CONSOLE
  • GPT_GETENV
  • GPT_QUIT
  • CHARFORMAT
    • CCharFormat
  • CHeaderCtrl
    • CCJFlatHeaderCtrl
    • CSortHeaderCtrl
  • ICvsCoworker
  • irciiAttrCvt
    • CTCP2Parse
  • ISupportErrorInfo
    • CvsCoworker
  • IUnknown
    • ICvsCoworker
      • CvsCoworker
  • Wincvs::IWincvs
  • CJX_COLORMAP
  • CJX_CONTROLPOS
  • KiColumn
    • KoConflictColumn
    • KoDateColumn
    • KoNameColumn
    • KoOptionColumn
    • KoPathColumn
    • KoRevisionColumn
    • KoStatusColumn
    • KoTagColumn
  • KiColumnModel
    • KoRecursiveModel
    • KoRegularModel
  • KiFilterModel
    • KoFilterModel
  • KiIgnoreModel
    • KoIgnoreModel
  • KiRecursionModel
    • KoRecursionModel
  • KiSelectionHandler
    • KoAddBinaryHandler
    • KoAddHandler
    • KoAddUnicodeHandler
    • KoAnnotateHandler
    • KoBranchTagHandler
    • KoCommitHandler
    • KoCreateTagHandler
    • KoDeleteTagHandler
    • KoDiffHandler
    • KoEditHandler
    • KoEditorsHandler
    • KoFileRemoveHandler
    • KoForceEditHandler
    • KoGraphHandler
    • KoLockHandler
    • KoLogHandler
    • KoMoveToTrashHandler
    • KoQueryUpdateHandler
    • KoReleaseHandler
    • KoReservedEditHandler
    • KoStatusHandler
    • KoUneditHandler
    • KoUnlockHandler
    • KoUpdateHandler
    • KoUpdateMoveToTrashHandler
    • KoWatchersHandler
    • KoWatchOffHandler
    • KoWatchOnHandler
  • KoColumnContext
  • KoTraversalContext
  • KoWatcher
  • LAttachment
    • LMainPseudoAttachment
    • LPseudoDrawAttachment
    • LPseudoWinAttachment
    • UPseudoPageHider
  • LBevelButton
    • UPseudoRotButton
  • LCommander
    • CMacBinTable
  • ULIST_INFO
  • ULIST_INSERT
  • CListBox
    • CCJListBox
    • CCJOutlookBar
  • CListCtrl
    • CCJListCtrl
    • CPseudoList
  • CListView
    • CBrowseFileView
    • CCJListView
  • LListener
    • LPseudoWinAttachment
    • UPseudoPageHider
    • UPseudoPlaceHolder
  • CLogNodeData
    • CWinLogData
      • CWinLogBranchData
      • CWinLogBranchData
      • CWinLogHeaderData
      • CWinLogHeaderData
      • CWinLogRevData
      • CWinLogRevData
      • CWinLogTagData
      • CWinLogTagData
    • CWinLogData
  • LOutlineItem
    • CMacBinItem
    • CPseudoItem
  • LOutlineTable
    • CMacBinTable
  • LPane
    • UPseudoFakePane
  • LPeriodical
    • LMainPseudoAttachment
  • LPlaceHolder
    • UPseudoPlaceHolder
  • MACBINMAP
  • MACBINMAPENTRIES
  • MacBinMaps
  • CMacroEntry
  • CMacroSet
  • CMapPtrToPtr
    • CSubclassWndMap
  • CMDIChildWnd
    • CCJMDIChildWnd
      • CGraphFrame
      • CLogFrame
  • CMDIFrameWnd
    • CCJMDIFrameWnd
      • CMainFrame
  • CMemFile
    • CCJMemFile
  • CMenu
    • CCJMenu
    • CColorMenu
  • UMessageMapFunctions
  • CMiniDockFrameWnd
    • CCJMiniDockFrameWnd
  • mircAttrCvt
    • CTCP2Parse
  • CMsg
  • UMSGMAP
  • UMSGMAP_ENTRY
  • MultiFiles
  • MultiFilesEntry
  • NotificationManager
  • NotificationManager::Node
  • CObject
    • CCJStatusBarPane
    • CCJStatusBarPaneControlInfo
    • CSubclassWnd
      • CCJMenuBarFrameHook
  • UObject
    • CPersistent
      • CMMenuString
      • CPersistentT< T >
      • CPersistentT< bool >
        • CPersistentBool
      • CPersistentT< int >
        • CPersistentInt
      • CWinPlacement
      • PCPStr
      • PCStr
      • TMPersistent< T >
      • TMString< T >
      • TMString< UPStr >
        • CMPString
      • TMString< UStr >
        • CMString
          • CKeyString
    • UCmdTarget
      • UWidget
        • UAuthen_Gserver
        • UAuthen_Kserver
        • UAuthen_Pserver
        • UAuthen_Rhosts
        • UAuthen_SSH
        • UCvsApp
        • UCvsConsole
        • UCvsFiles
        • UCvsFolders
        • UCvsFrame
        • UCvsGraph
        • UMenu
          • UCvsMenubar
          • UMacAppMenu
          • UPPMenu
        • UPromptMessage
          • UEditMessage
        • USaveSettings
        • UToolbar
          • UCvsToolbar
  • ColorTableEntry
  • option
  • OUTBAR_INFO
  • UPen
  • CPersistent::CPersistentEntry
  • UPOINT
    • UPoint
  • poolRec
  • CProgress
  • CPropertyPage
    • CAnnotate_MAIN
    • CCheckout_MAIN
    • CCheckout_OPTIONS
    • CCmdLine_MAIN
    • CCommit_MAIN
    • CCommit_OPTIONS
    • CDiff_MAIN
    • CGetPrefs_CVSCMD_DIALOGS
    • CGetPrefs_CVSROOT
    • CGetPrefs_GLOBALS
    • CGetPrefs_WINCVS
    • CImport_MAIN
    • CImport_OPTIONS
    • CInit_MAIN
    • CLogFilters
    • CLogMain
    • CRtag_MAIN
    • CRtag_OPTIONS
    • CTag_MAIN
    • CUpdateMain
    • CUpdateMerge
    • CUpdateSticky
  • CPropertySheet
    • COptionalPropertySheet
  • UPseudoCmdStatusWrapper
  • UPStr
    • PCPStr
  • PyAutoObject< T >
  • PyCmdUI::obj_t
  • PyColorConsole::obj_t
  • PyContainer
    • PyCmdUI
    • PyColorConsole
    • PyCvsEntry
    • PyMenuMgr
    • PyPersistent
  • PyCvsEntry::obj_t
  • PyMenuMgr::obj_t
  • PyPersistent::obj_t
  • PyRegistry
  • CPython_Interp
  • CPyThreadState
  • URECT
    • URect
  • CRectTracker
    • CGraphRectTracker
  • CRecursionLock
  • ReportConflict
  • ReportWarning
  • CRichEditView
    • CWincvsView
  • URuntimeClass
  • CScrollView
    • CGraphView
  • USemaphore
  • USIZE
    • USize
  • USLIDER
  • USmartCombo
    • CHistComboBoxEx
    • CSmartComboBox
  • CSortList< T >
  • CSortParam
  • CSplitterWnd
    • CCJFlatSplitterWnd
    • CGfxSplitterWnd
  • CStackThreadLock
  • CStatic
    • CCJCaption
    • CCJHyperLink
    • CColorStatic
    • CPseudoDraw
  • CStaticAllocT< T >
  • CStaticAllocT< char >
  • CStatusBar
    • CCJStatusBar
    • CCvsStatusBar
  • UStr
    • PCStr
  • CTabCtrl
    • CCJTabCtrl
  • TAdorner
    • TPseudoWinAdorner
  • tagCTV_ITEM
  • tagMENUITEMINFOA
    • CMenuItemInfo
  • tagTCB_ITEM
  • UTB_BUTTON
  • UTB_DROPDOWN
  • UTB_INIT
  • TBehavior
    • TPseudoAppBehavior
    • TPseudoWinBehavior
  • TbEntry
    • TbEntryButton
      • TbEntryChkButton
    • TbEntryDropDown
    • TbEntrySeparator
  • CTcl_Interp
  • CTCLBrowserEnt
  • CTCP2Parse::RGBColor
  • TEditText
    • TPseudoDoubleNumberText
  • CTempToggleBool
  • TGraph
    • TGraphCmdStatus
    • TGraphDelCmd
    • TGraphRectSelect
    • TGraphSelNonSig
  • TIconButton
    • TPseudoIconButton
      • TPseudoRotateIconButton
  • TIconCheckBox
    • TPseudoIconCheckBox
  • TIconPopup
    • TPseudoIconPopup
  • UTimer
  • CTmpFiles
  • CToolBarCtrl
    • CCJToolBarCtrl
  • CToolBarData
  • TOOLBARINFO
  • TPopup
    • TBuggyPopup
  • TraversalReport
    • CFillPyEntries
    • CFillTclEntries
    • CFindSettings
    • ImportReport
    • LSReport
    • MacroTraversal
    • TBrowserFill
    • TBrowserFill
    • TBrowserFillDummy
    • TBrowserFillDummy
    • TViewFill
    • TViewFill
  • UTREE_INFO
  • UTREE_INSERT
  • CTreeCtrl
    • CCJTreeCtrl
  • CTreeView
    • CWinCvsBrowser
  • TScrollBar
    • TPseudoScrollBar
  • TTextListView
    • TPseudoTextListView
  • CTurnOffDispatching
  • TView
    • TPseudoCustomView
  • CustInvertTable
  • vector
    • CCustInvertTable
  • CView
    • CBrowserBar
    • CExploreBar
  • CViewInfo
  • CvsArgs
    • ControlCvsArgs
      • AddBinCvsArgs
      • AddCvsArgs
      • AddUnicodeCvsArgs
    • RemoveCvsArgs
  • CvsFilenames
  • CvsPrefs
  • CvsProcessCallbacks
  • CvsProject
  • CvsString
  • CvsTrace
  • UWaitCursor
  • CWinApp
    • CWincvsApp
  • CWinCvsBrowser::CSelectionChangeNotifier
  • WINDOWPLACEMENT
    • CCJWindowPlacement
  • WININFO
  • CWinThread
    • CLogoutThread
  • CWnd
    • CCJCaptionPopupWnd
    • CCJColorPopup
    • CCJDateTimeCtrl
    • CCJFlatTabCtrl
    • CCJLogoPane
    • CCJMonthCalCtrl
    • CCJPagerCtrl
    • CCJReBarCtrl
    • CGfxOutBarCtrl
    • CSplashWnd
  • CWndRedrawMngr
  • wnt_stat
  • wstring
    • Win32wstring
Generated on Sun Feb 24 01:24:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Compound Member Index

WinCvs Source Compound Members

_ | a | b | c | d | e | f | g | h | i | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z | ~

Here is a list of all class members with links to the class documentation for each member:

- _ -

  • _AddBar() : CCJReBar
  • _AddButton() : PyMenuMgr
  • _AddPulldown() : PyMenuMgr
  • _AddSeparator() : PyMenuMgr
  • _AddToggle() : PyMenuMgr
  • _afxRichEditCookie() : _afxRichEditCookie
  • _Count() : PyMenuMgr
  • _d_entry : _dircontents
  • _d_next : _dircontents
  • _Delete() : PyMenuMgr
  • _DeleteByCmd() : PyMenuMgr
  • _Enable() : PyCmdUI
  • _GetBaseClass() : UCvsToolbar, UCvsMenubar, UCvsGraph, UCvsFrame, UCvsFolders, UCvsFiles, UCvsConsole, UCvsApp, CPersistentInt, CPersistentBool, CPersistent, USaveSettings, CMPString, CMString, PCStr, PCPStr, UAuthen_Gserver, UAuthen_Kserver, UAuthen_Rhosts, UAuthen_Pserver, UAuthen_SSH, UEditMessage, UPromptMessage, UWidget, UToolbar, UObject, UMenu, UCmdTarget, UMacAppMenu
  • _GetValue() : PyPersistent
  • _in : ansiAttrCvt
  • _messageEntries : UCvsToolbar, UCvsMenubar, UCvsGraph, UCvsFrame, UCvsFolders, UCvsFiles, UCvsConsole, UCvsApp, USaveSettings, UAuthen_Gserver, UAuthen_Kserver, UAuthen_Rhosts, UAuthen_Pserver, UAuthen_SSH, UEditMessage, UPromptMessage, UWidget, UToolbar, UMenu, UCmdTarget, UMacAppMenu
  • _notOf : ansiAttrCvt::AnsiSeq
  • _params : ansiAttrCvt::AnsiSeq
  • _Print() : PyColorConsole
  • _seq : ansiAttrCvt, ansiAttrCvt::AnsiSeq
  • _SetCheck() : PyCmdUI
  • _SetText() : PyCmdUI
  • _SetValue() : PyPersistent
  • _verb : ansiAttrCvt::AnsiSeq

- a -
  • ActivateBrowserView() : CWincvsApp
  • ActivateSelf() : UPseudoFakePane
  • AdaptToSuperFrameSize() : UPseudoFakePane
  • Add() : CSubclassWndMap, CMacroSet
  • add() : MultiFiles, MultiFilesEntry, CvsArgs
  • AddBar() : CCJReBar
  • AddBitmapToImageList() : CCJMenu
  • AddButton() : PyMenuMgr
  • AddButtons() : CCJToolBar
  • AddColumn() : CCJListView, CCJListCtrl
  • AddColumns() : CBrowseFileView
  • AddControl() : CCJStatusBar, CvsPrefs
  • AddDropDownButton() : CCJToolBar
  • AddEntry() : MacBinMaps
  • addfile() : RemoveCvsArgs, ControlCvsArgs, CvsArgs
  • AddFiles() : CvsCoworker, ICvsCoworker
  • addFiles() : CvsProject
  • AddFolder() : CGfxOutBarCtrl
  • AddFolderBar() : CGfxOutBarCtrl
  • AddFromToolBar() : CCJMenu
  • AddIndicator() : CCJStatusBar
  • AddListener() : UWidget
  • AddPage() : UWidget
  • AddPattern() : ReportConflict
  • AddPulldown() : PyMenuMgr
  • AddReplaceBitmap() : CCJToolBar
  • AddSeparator() : PyMenuMgr
  • AddString() : CHistComboBoxEx, CCJComboBoxEx
  • AddStrings() : CCJToolBar
  • AddTimer() : UWidget
  • AddToggle() : PyMenuMgr
  • AddTooltip() : UWidget
  • AddToolTip() : CCJTabCtrlBar
  • AddView() : CCJTabView, CCJTabCtrlBar
  • AddWarning() : ReportWarning
  • AdjustSize() : CStaticAllocT< T >
  • allfiles : CTmpFiles
  • AlwaysUseCvsroot() : CvsPrefs
  • AnimateFolderScroll() : CGfxOutBarCtrl
  • ansi2ctcp() : ansiAttrCvt
  • AnsiSeq() : ansiAttrCvt::AnsiSeq
  • append() : CBuffer
  • Append() : CCJMemFile
  • AppendColorMenuItem() : CColorMenu
  • AppendMenuA() : CCJMenu
  • AppendMenuW() : CCJMenu
  • AppendODMenuA() : CCJMenu
  • AppendODMenuW() : CCJMenu
  • AppendODPopupMenuA() : CCJMenu
  • AppendODPopupMenuW() : CCJMenu
  • aref() : aref
  • arFolder : CGfxOutBarCtrl
  • argc : _CvsProcess, CvsArgs
  • Argc() : CvsArgs
  • args : _CvsProcess
  • argv : CvsArgs
  • Argv() : CvsArgs
  • arItems : CGfxOutBarCtrl::CBarFolder
  • AskForQuitting() : UCvsFrame
  • AssociateImageIndexWithRuntimeClass() : CCJTabCtrlBar
  • Authen() : Authen
  • AuthenGserver() : AuthenGserver
  • AuthenKserver() : AuthenKserver
  • AuthenLocal() : AuthenLocal
  • AuthenModel() : AuthenModel
  • AuthenNtserver() : AuthenNtserver
  • AuthenPserver() : AuthenPserver
  • AuthenRhosts() : AuthenRhosts
  • AuthenSSH() : AuthenSSH
  • AutoDropWidth : USmartCombo
  • AutoSaveColumns() : CCJListView, CCJListCtrl
  • AutoSize() : CCJToolBar
  • AutoSizeColumn() : CCJListView, CCJListCtrl
  • awidget() : awidget

- b -
  • B : CTCP2Parse::RGBColor
  • b : UCOLOR, UColor
  • bDownArrow : CGfxOutBarCtrl
  • bDownPressed : CGfxOutBarCtrl
  • BeforeNavigate2() : CCJHtmlView
  • BeforeUpdateUI() : UWidget
  • begin() : TMString< T >
  • BeginDrag() : CCJReBarCtrl
  • bEscapeKey : CGfxGroupEdit
  • bg : CTCP2Parse
  • bgColorMap : ansiAttrCvt
  • bgDef : CTCP2Parse
  • bgLast : CTCP2Parse
  • bitmap : CCJMenuData, awidget, AREF
  • Black : CTCP2Parse
  • blink : ansiAttrCvt
  • blinkCnt : CTCP2Parse
  • blinkLast : CTCP2Parse
  • bLooping : CGfxOutBarCtrl
  • Blue : CTCP2Parse
  • bNoDown : CGfxGroupEdit
  • bold : UCvsConsole, ansiAttrCvt
  • boldCnt : CTCP2Parse
  • boldLast : CTCP2Parse
  • bottom : URECT
  • BottomRight() : URect
  • Bounds() : CWinLogData
  • bPressedHighlight : CGfxOutBarCtrl
  • brdrAllRaised : CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd
  • brdrFlatAll : CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd
  • brdrFlatBottom : CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd
  • brdrFlatHorizontal : CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd
  • brdrFlatLeft : CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd
  • brdrFlatRight : CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd
  • brdrFlatTop : CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd
  • brdrFlatVertical : CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd
  • Browser() : CvsPrefs
  • btns : UTB_DROPDOWN
  • btnText : TOOLBARINFO
  • bTRACE : CCJMenuBar
  • buf : CStaticAllocT< T >
  • BuildColumns() : CCJListView, CCJListCtrl
  • bUpArrow : CGfxOutBarCtrl
  • bUpPressed : CGfxOutBarCtrl
  • bWhiteLine : CGfxSplitterWnd

- c -
  • c : _IID
  • c_bShowSplashWnd : CSplashWnd
  • c_pSplashWnd : CSplashWnd
  • c_str() : UStr, UPStr
  • CAboutDlg() : CAboutDlg
  • CAdminOptionDlg() : CAdminOptionDlg
  • CalcDroppedWidth() : CHistComboBoxEx, CSmartComboBox, USmartCombo
  • CalcDynamicLayout() : CCJToolBar, CCJSizeDockBar, CCJReBar, CCJControlBar
  • CalcFixedLayout() : CCJToolBar, CCJReBar, CCJMenuBar, CCJDockBar
  • CalcImageSize() : CGraphView, UCvsGraph
  • CalcInsideRect() : CCJToolBarBase
  • CalcLayout() : CCJToolBar
  • CalcPos() : CCJHexEdit
  • CalcSize() : CCJToolBar
  • CalcSizeBarLayout() : CCJSizeDockBar
  • CalcViewRect() : CCJTabView
  • callbacks : _CvsProcess
  • CAllHandlers() : CAllHandlers
  • CallInitValues() : PyRegistry
  • CAllTargets() : CAllTargets
  • CancelMenuAndTrackNewOne() : CCJMenuBar
  • CanContinue() : UCmdUI
  • CanDockDockBar() : CCJDockContext
  • CAnnotate_MAIN() : CAnnotate_MAIN
  • CanPaste() : CWincvsView
  • CAskYesNo() : CAskYesNo
  • CAuthenSetUp() : CAuthenSetUp
  • CBarConsole() : CBarConsole
  • CBarFolder() : CGfxOutBarCtrl::CBarFolder
  • CBarItem() : CGfxOutBarCtrl::CBarItem
  • CBrowseFileView() : CBrowseFileView
  • CBrowserBar() : CBrowserBar
  • cbSize : AFX_DLLVERSIONINFO
  • CBuffer() : CBuffer
  • CCharFormat() : CCharFormat
  • CCheckout_MAIN() : CCheckout_MAIN
  • CCheckout_OPTIONS() : CCheckout_OPTIONS
  • CCJBrowseButton() : CCJBrowseButton
  • CCJBrowseEdit() : CCJBrowseEdit
  • CCJCaption() : CCJCaption
  • CCJCaptionPopupWnd() : CCJCaptionPopupWnd
  • CCJColorPicker() : CCJColorPicker
  • CCJColorPopup() : CCJColorPopup
  • CCJComboBoxEx() : CCJComboBoxEx
  • CCJControlBar() : CCJControlBar
  • CCJDateEdit() : CCJDateEdit
  • CCJDateTimeCtrl() : CCJDateTimeCtrl
  • CCJDockBar() : CCJDockBar
  • CCJDockContext() : CCJDockContext
  • CCJExplorerBar() : CCJExplorerBar
  • CCJFlatButton() : CCJFlatButton
  • CCJFlatComboBox() : CCJFlatComboBox
  • CCJFlatHeaderCtrl() : CCJFlatHeaderCtrl
  • CCJFlatSplitterWnd() : CCJFlatSplitterWnd
  • CCJFlatTabCtrl() : CCJFlatTabCtrl
  • CCJFontCombo() : CCJFontCombo
  • CCJFrameWnd() : CCJFrameWnd
  • CCJHexEdit() : CCJHexEdit
  • CCJHtmlView() : CCJHtmlView
  • CCJHyperLink() : CCJHyperLink
  • CCJListBox() : CCJListBox
  • CCJListCtrl() : CCJListCtrl
  • CCJListView() : CCJListView
  • CCJLogoPane() : CCJLogoPane
  • CCJMaskEdit() : CCJMaskEdit
  • CCJMDIChildWnd() : CCJMDIChildWnd
  • CCJMDIFrameWnd() : CCJMDIFrameWnd
  • CCJMemFile() : CCJMemFile
  • CCJMenu() : CCJMenu
  • CCJMenuBar : CCJMenuBar, CCJMenuBarFrameHook
  • CCJMenuBarFrameHook : CCJMenuBarFrameHook, CCJMenuBar
  • CCJMenuData() : CCJMenuData
  • CCJMetaFileButton() : CCJMetaFileButton
  • CCJMiniDockFrameWnd() : CCJMiniDockFrameWnd
  • CCJMonthCalCtrl() : CCJMonthCalCtrl
  • CCJOutlookBar() : CCJOutlookBar
  • CCJPagerCtrl() : CCJPagerCtrl
  • CCJReBar() : CCJReBar
  • CCJReBarCtrl() : CCJReBarCtrl
  • CCJSizeDockBar() : CCJSizeDockBar
  • CCJSortClass() : CCJSortClass
  • CCJStatusBar() : CCJStatusBar
  • CCJStatusBarPane() : CCJStatusBarPane
  • CCJStatusBarPaneControlInfo() : CCJStatusBarPaneControlInfo
  • CCJTabCtrl() : CCJTabCtrl
  • CCJTabCtrlBar() : CCJTabCtrlBar
  • CCJTabView() : CCJTabView
  • CCJTimeEdit() : CCJTimeEdit
  • CCJToolBar() : CCJToolBar
  • CCJToolBarBase() : CCJToolBarBase
  • CCJToolBarCtrl() : CCJToolBarCtrl
  • CCJTreeCtrl() : CCJTreeCtrl
  • CCJWindowPlacement() : CCJWindowPlacement
  • CCmdLine_MAIN() : CCmdLine_MAIN
  • CColorConsole() : CColorConsole
  • CColorMenu() : CColorMenu
  • CColorStatic() : CColorStatic
  • CCommit_MAIN() : CCommit_MAIN
  • CCommit_OPTIONS() : CCommit_OPTIONS
  • CContentItems() : CContentItems
  • CCustInvertTable() : CCustInvertTable
  • CCustomizeMenus() : CCustomizeMenus
  • CCVSAlert() : CCVSAlert
  • CCvsStatusBar() : CCvsStatusBar
  • CCvsThreadLock() : CCvsThreadLock
  • CDestroyThreadLock() : CDestroyThreadLock
  • CDiff_MAIN() : CDiff_MAIN
  • CDockBar : CCJMiniDockFrameWnd
  • CDummyClass() : CDummyClass
  • CDummyInit() : CDummyInit
  • CDynToolBar() : CDynToolBar
  • CEditorMonDlg() : CEditorMonDlg
  • CenterPoint() : URect
  • CExploreBar() : CExploreBar
  • CFillPyEntries() : CFillPyEntries
  • CFillTclEntries() : CFillTclEntries
  • CFindSettings() : CFindSettings
  • CGetPrefs_CVSCMD_DIALOGS() : CGetPrefs_CVSCMD_DIALOGS
  • CGetPrefs_CVSROOT() : CGetPrefs_CVSROOT
  • CGetPrefs_GLOBALS() : CGetPrefs_GLOBALS
  • CGetPrefs_WINCVS() : CGetPrefs_WINCVS
  • CGfxGroupEdit() : CGfxGroupEdit
  • CGfxOutBarCtrl() : CGfxOutBarCtrl
  • CGfxSplitterWnd() : CGfxSplitterWnd
  • CGraphConsole() : CGraphConsole
  • CGraphDoc() : CGraphDoc
  • CGraphFrame() : CGraphFrame
  • CGraphOptDlg() : CGraphOptDlg
  • CGraphRectTracker() : CGraphRectTracker
  • CGraphView() : CGraphView
  • ChangeLocation() : CMainFrame
  • ChangeSelection() : CCJColorPopup
  • CharSpacingType : CTCP2Parse
  • Check() : UCmdUI
  • CheckButton() : CCJToolBar
  • CheckChanges() : CBrowseFileView
  • CheckChar() : CCJMaskEdit
  • CheckIn() : NotificationManager
  • CheckinFiles() : CvsCoworker, ICvsCoworker
  • checkinFiles() : CvsProject
  • checkmaps : CCJMenu
  • checkmapsshare : CCJMenu
  • CheckOut() : NotificationManager
  • CheckoutFiles() : CvsCoworker, ICvsCoworker
  • checkoutFiles() : CvsProject
  • CheckoutRO() : CvsPrefs
  • CheckTextColor() : CCJColorPicker
  • CheckWindowSize() : LPseudoWinAttachment
  • child : UTREE_INFO
  • CHistComboBoxEx() : CHistComboBoxEx
  • CImport_MAIN() : CImport_MAIN
  • CImport_OPTIONS() : CImport_OPTIONS
  • CImportEntry() : CImportEntry
  • CImportFilterDlg() : CImportFilterDlg
  • CImportWarning() : CImportWarning
  • CInit_MAIN() : CInit_MAIN
  • cItem : CGfxOutBarCtrl::CBarItem
  • CKeyString() : CKeyString
  • class_ID : CMacBinTable, UPseudoPageHider, UPseudoPlaceHolder, UPseudoRotButton
  • classCMPString : CMPString
  • classCMString : CMString
  • classCPersistent : CPersistent
  • classCPersistentBool : CPersistentBool
  • classCPersistentInt : CPersistentInt
  • classPCPStr : PCPStr
  • classPCStr : PCStr
  • classUAuthen_Gserver : UAuthen_Gserver
  • classUAuthen_Kserver : UAuthen_Kserver
  • classUAuthen_Pserver : UAuthen_Pserver
  • classUAuthen_Rhosts : UAuthen_Rhosts
  • classUAuthen_SSH : UAuthen_SSH
  • classUCmdTarget : UCmdTarget
  • classUCvsApp : UCvsApp
  • classUCvsConsole : UCvsConsole
  • classUCvsFiles : UCvsFiles
  • classUCvsFolders : UCvsFolders
  • classUCvsFrame : UCvsFrame
  • classUCvsGraph : UCvsGraph
  • classUCvsMenubar : UCvsMenubar
  • classUCvsToolbar : UCvsToolbar
  • classUEditMessage : UEditMessage
  • classUMacAppMenu : UMacAppMenu
  • classUMenu : UMenu
  • classUObject : UObject
  • classUPromptMessage : UPromptMessage
  • classUSaveSettings : USaveSettings
  • classUToolbar : UToolbar
  • classUWidget : UWidget
  • ClearSelection() : CCJTreeCtrl
  • CLogFilters() : CLogFilters
  • CLogFrame() : CLogFrame
  • CLogMain() : CLogMain
  • CLogoutThread() : CLogoutThread
  • Close() : CCJMemFile
  • CloseProject() : CvsCoworker, ICvsCoworker
  • closeProject() : CvsProject
  • ClosePythonSupport() : CPython_Interp
  • CloseSplashScreen() : CSplashWnd
  • CMacBinItem() : CMacBinItem
  • CMacBinTable() : CMacBinTable
  • CMacroEntry() : CMacroEntry
  • CMacroSet() : CMacroSet
  • CMainFrame() : CMainFrame
  • cmd : CustInvertTable, awidget, UTB_BUTTON
  • CMenuItemInfo() : CMenuItemInfo
  • CMMenuString() : CMMenuString
  • CMPString() : CMPString
  • CMsg() : CMsg
  • CMString() : CMString
  • cName : CGfxOutBarCtrl::CBarFolder
  • CNoPython() : CNoPython
  • cnt : AREF
  • code : GPT_QUIT
  • col : UCvsConsole, ULIST_INFO, ULIST_INSERT
  • color : CCJTreeCtrl::Color_Font
  • ColorType : CTCP2Parse
  • CommandToIndex() : CCJToolBar
  • compare() : UStr
  • Compare() : CCJSortClass, CKeyString, TMString< T >, ENTNODE, EntnodeData, KiColumn, KoConflictColumn, KoDateColumn, KoTagColumn, KoStatusColumn, KoOptionColumn, KoRevisionColumn, KoPathColumn, KoNameColumn
  • ComputeBounds() : CWinLogData
  • ComputeMenuTrackPoint() : CCJMenuBar
  • Concatenate() : CKeyString
  • conflicts : ImportReport
  • consoleerr : CvsProcessCallbacks
  • consoleout : CvsProcessCallbacks
  • ControlCvsArgs() : ControlCvsArgs
  • convert() : Win32wstring
  • COptionalPropertySheet() : COptionalPropertySheet
  • CopyRect() : URect
  • CopyReturn() : PyAutoObject< T >
  • CopyRow() : CCJListView, CCJListCtrl
  • Count() : PyMenuMgr
  • cp : CTCP2Parse
  • cpDef : CTCP2Parse
  • CPersistent() : CPersistent
  • CPersistentBool() : CPersistentBool
  • CPersistentInt() : CPersistentInt
  • CPersistentT() : CPersistentT< T >
  • cpLast : CTCP2Parse
  • CProgress() : CProgress
  • CProgressDialog() : CProgressDialog
  • CPseudoButton() : CPseudoButton
  • CPseudoDlg() : CPseudoDlg
  • CPseudoDraw() : CPseudoDraw
  • CPseudoItem() : CPseudoItem
  • CPseudoList() : CPseudoList
  • CPseudoRotButton() : CPseudoRotButton
  • CPseudoToggle() : CPseudoToggle
  • CPyCvsConsole() : CPyCvsConsole
  • CPython_Interp() : CPython_Interp
  • CPyThreadState() : CPyThreadState
  • cr3dFace : CGfxOutBarCtrl
  • crBackGroundColor : CGfxOutBarCtrl
  • crBackGroundColor1 : CGfxOutBarCtrl
  • crColor : ColorTableEntry
  • crDkShadowBorder : CGfxOutBarCtrl
  • Create() : CWinCvsBrowser, CToolbarCombo, CSplashWnd, CProgressDialog, CExploreBar, CGfxOutBarCtrl, CCJToolBarCtrl, CCJToolBar, CCJTabCtrl, CCJReBarCtrl, CCJReBar, CCJPagerCtrl, CCJMiniDockFrameWnd, CCJMenuBar, CCJLogoPane, CCJHtmlView, CCJHexEdit, CCJExplorerBar, CCJMonthCalCtrl, CCJDateTimeCtrl, CCJControlBar, CCJComboBoxEx, CCJColorPopup, CCJCaptionPopupWnd, CCJCaption, CCJBrowseButton, CBrowserBar, PyPersistent, PyCmdUI, PyMenuMgr, PyColorConsole, PyCvsEntry
  • CreateAddressCaret() : CCJHexEdit
  • CreateEditCaret() : CCJHexEdit
  • CreateEx() : CCJToolBar, CCJMenuBar
  • CreateNewData() : CWinLogData
  • CreateObject() : UObject, URuntimeClass
  • CreatePen() : UPen
  • CreateSolidBrush() : UBrush
  • CreateTabFont() : CCJFlatTabCtrl
  • CreateTabListItem() : CCJTabCtrlBar
  • CreateTabView() : CCJTabCtrlBar
  • CreateToolTips() : CCJColorPopup
  • CRecursionLock() : CRecursionLock
  • CReleaseDlg() : CReleaseDlg
  • CRevisionConsole() : CRevisionConsole
  • crHilightBorder : CGfxOutBarCtrl
  • crLightBorder : CGfxOutBarCtrl
  • crShadowBorder : CGfxOutBarCtrl
  • CRtag_MAIN() : CRtag_MAIN
  • CRtag_OPTIONS() : CRtag_OPTIONS
  • crTextColor : CGfxOutBarCtrl
  • CSelectionChangeNotifier : CWinCvsBrowser::CSelectionChangeNotifier, CWinCvsBrowser
  • CSmartComboBox() : CSmartComboBox
  • CSortHeaderCtrl() : CSortHeaderCtrl
  • CSortItem() : CCJSortClass::CSortItem
  • CSortList() : CSortList< T >
  • CSortParam() : CSortParam
  • CSplashWnd() : CSplashWnd
  • CStackThreadLock() : CStackThreadLock
  • CStaticAllocT() : CStaticAllocT< T >
  • CStreamConsole() : CStreamConsole
  • CSubclassWnd() : CSubclassWnd
  • CSubclassWndMap : CSubclassWndMap, CSubclassWnd
  • CTag_MAIN() : CTag_MAIN
  • CTbEdit() : CTbEdit
  • CTcl_Interp() : CTcl_Interp
  • CTCLBrowserEnt() : CTCLBrowserEnt
  • CTCLCvsConsole() : CTCLCvsConsole
  • CTCP2Parse() : CTCP2Parse
  • CTempToggleBool() : CTempToggleBool
  • cText : OUTBAR_INFO
  • CTipDlg() : CTipDlg
  • CtlColor() : CCJHyperLink
  • CToolbarCombo() : CToolbarCombo
  • CTurnOffDispatching() : CTurnOffDispatching
  • CUpdateMain() : CUpdateMain
  • CUpdateMerge() : CUpdateMerge
  • CUpdateSticky() : CUpdateSticky
  • current : DYN_LIST, TbEntryDropDown
  • Customize() : CCJToolBar
  • cvs_err() : CRevisionConsole, CGraphConsole, CTCLCvsConsole, CPyCvsConsole, CCvsConsole, CStreamConsole
  • cvs_out() : CRevisionConsole, CGraphConsole, CTCLCvsConsole, CPyCvsConsole, CCvsConsole, CStreamConsole
  • CvsArgs() : CvsArgs
  • CvsConsole() : CvsPrefs
  • CvsCoworker() : CvsCoworker
  • CvsFilenames() : CvsFilenames
  • CvsPrefs() : CvsPrefs
  • CvsProject() : CvsProject
  • CvsString() : CvsString
  • CvsTrace() : CvsTrace
  • CvsVersion() : CvsPrefs
  • CWincvsApp() : CWincvsApp
  • CWinCvsBrowser() : CWinCvsBrowser
  • CWincvsDoc() : CWincvsDoc
  • CWincvsView() : CWincvsView
  • CWinLogBranchData() : CWinLogBranchData
  • CWinLogData() : CWinLogData
  • CWinLogHeaderData() : CWinLogHeaderData
  • CWinLogRevData() : CWinLogRevData
  • CWinLogTagData() : CWinLogTagData
  • CWinPlacement() : CWinPlacement
  • CWndRedrawMngr() : CWndRedrawMngr
  • cx : USIZE
  • cy : USIZE
  • Cyan : CTCP2Parse

- d -
  • d_ino : direct
  • d_name : direct
  • d_namlen : direct
  • d_reclen : direct
  • Data() : ENTNODE
  • data : _WireMessage, ULIST_INFO, UTREE_INFO, UTREE_INSERT
  • date : EntnodeFile
  • dd_contents : _dirdesc
  • dd_cp : _dirdesc
  • dd_id : _dirdesc
  • dd_loc : _dirdesc
  • DeactivateSelf() : UPseudoFakePane
  • dealloc() : PyPersistent, PyCmdUI, PyMenuMgr, PyColorConsole, PyCvsEntry
  • DECLARE_DYNAMIC() : CSubclassWnd
  • DECLARE_DYNCREATE() : CCJColorPicker
  • decodeColor() : CTCP2Parse
  • decodeToggle() : CTCP2Parse
  • Default() : CSubclassWnd
  • DefaultFeature : USmartCombo
  • defaultnumcells : DYN_LIST
  • DeflateRect() : URect
  • DelegateRun() : KoWatcher
  • Delete() : CLogoutThread, CSortList< T >, PyMenuMgr
  • DeleteAllItems() : CWinCvsBrowser, CCJFlatTabCtrl, UCvsFolders
  • DeleteBand() : CCJReBarCtrl
  • DeleteButton() : CCJToolBar
  • DeleteByCmd() : PyMenuMgr
  • DeleteColumns() : CBrowseFileView
  • DeleteItem() : CCJFlatTabCtrl, CCJComboBoxEx
  • DeleteMenu() : CCJMenu
  • DeleteMenuList() : CCJMenu
  • DeleteObject() : UBrush, UPen
  • DeleteView() : CCJTabCtrlBar
  • DelItemAt() : TPseudoTextListView
  • DelKeyTest() : CHistComboBoxEx, CSmartComboBox
  • desc : MACBINMAP, EntnodeData
  • destroy : _CvsProcess
  • destroy_func : _WireHandler
  • DestroyMenu() : CCJMenu
  • Deunixfy() : CTcl_Interp
  • DiffFile() : CvsCoworker, ICvsCoworker
  • diffFile() : CvsProject
  • dir : MultiFilesEntry
  • Dir() : CCJComboBoxEx
  • dirs : MultiFiles
  • DirtySupport() : CvsPrefs
  • disable_old_style : CCJMenu
  • DisableColumnSizing() : CCJListView, CCJListCtrl
  • DisableCommon() : CWinCvsBrowser, CGraphView, CExploreBar, CMyShellTree, CBrowseFileView
  • DisableFlatLook() : CCJFlatButton
  • DisableFlatStyle() : CCJFlatSplitterWnd
  • DisableGeneric() : UCvsFolders, UCvsFiles
  • DisableUpdate() : CGraphView
  • DisableUserSettings() : ReportConflict
  • Discard() : CCJMemFile
  • Dismiss() : UWidget
  • DitherBlt() : CCJMenu
  • DitherBlt2() : CCJMenu
  • do_C() : ansiAttrCvt
  • do_m() : ansiAttrCvt
  • DoAbort() : CProgress
  • DockControlBarLeftOf() : CMainFrame, CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd
  • DockFlatBorders : CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd
  • DockSizeBar() : CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd, CCJDockContext
  • DocumentComplete() : CCJHtmlView
  • DoDataExchange() : CAboutDlg, CTipDlg, CProgressDialog, CNoPython, CCustomizeMenus, CUpdateSticky, CUpdateMerge, CUpdateMain, CTag_MAIN, CRtag_OPTIONS, CRtag_MAIN, CReleaseDlg, USaveSettings, CLogFilters, CLogMain, CCmdLine_MAIN, CInit_MAIN, CImportEntry, CImportWarning, CImportFilterDlg, CImport_OPTIONS, CImport_MAIN, CGraphOptDlg, GetValue, CGetPrefs_CVSCMD_DIALOGS, CGetPrefs_WINCVS, CGetPrefs_GLOBALS, CGetPrefs_CVSROOT, GetPassword, CEditorMonDlg, CDiff_MAIN, CCVSAlert, CCommit_OPTIONS, CCommit_MAIN, CCheckout_OPTIONS, CCheckout_MAIN, UAuthen_Gserver, UAuthen_Kserver, UAuthen_Rhosts, UAuthen_Pserver, UAuthen_SSH, CAskYesNo, UEditMessage, UPromptMessage, CAnnotate_MAIN, CAdminOptionDlg, UWidget, CPseudoDlg
  • DoDrag() : CBrowseFileView
  • DoEvent() : TPseudoWinBehavior
  • DoFile() : CTcl_Interp, CPython_Interp
  • DoIdle() : TPseudoAppBehavior
  • DoKeyEvent() : TPseudoTextListView
  • DoMenuCommand() : TPseudoAppBehavior
  • DoModal() : COptionalPropertySheet, UWidget
  • DoMouseCommand() : TPseudoTextListView
  • DoMouseCommand_SelectCells() : TPseudoTextListView
  • DoPaint() : CCJToolBarBase, CCJSizeDockBar
  • DoPostCreate() : TBuggyPopup
  • DoRotate() : UPseudoPageHider, UPseudoPlaceHolder, UPseudoRotButton, CPseudoRotButton, TPseudoRotateIconButton
  • DoScript() : CTcl_Interp, CPython_Interp
  • DoScriptVar() : CTcl_Interp, CPython_Interp
  • DoSettings() : AuthenModel, AuthenGserver, AuthenKserver, AuthenRhosts, AuthenPserver, AuthenSSH
  • DoSetupMenus() : TPseudoAppBehavior
  • DoToolboxEvent() : TPseudoAppBehavior
  • DoubleClick() : CMacBinItem, CPseudoItem
  • DoValidUI() : UWidget
  • DragMove() : CCJReBarCtrl
  • Draw() : TPseudoCustomView
  • Draw3DCheckmark() : CCJMenu
  • DrawAnimItem() : CGfxOutBarCtrl
  • DrawBitmap() : UDC
  • DrawBorders() : CCJToolBarBase, CCJSizeDockBar, CCJControlBar
  • DrawButtonBitmap() : CCJFlatButton, CPseudoButton
  • DrawButtonIcon() : CCJFlatButton, CCJCBarButton
  • DrawButtonText() : CCJFlatButton, CCJCaptionButton
  • DrawCaptionBack() : CCJCaption
  • DrawCaptionIcon() : CCJCaption
  • DrawCaptionText() : CCJCaption
  • DrawCell() : CCJColorPopup, CPseudoItem
  • DrawCheckMark() : CCJMenu
  • DrawCombo() : CCJFlatComboBox
  • DrawDragArrow() : CGfxOutBarCtrl
  • DrawFlatBorder() : CCJFlatHeaderCtrl
  • DrawFolder() : CGfxOutBarCtrl
  • DrawGriperCaption() : CCJControlBar
  • DrawGripper() : CCJToolBarBase, CCJControlBar
  • DrawItem() : CSortHeaderCtrl, CCvsStatusBar, CGfxOutBarCtrl, CCJOutlookBar, CCJMetaFileButton, CCJMenu, CCJFontCombo, CCJFlatHeaderCtrl, CCJFlatButton, CCJColorPicker, CColorMenu, CPseudoToggle, CPseudoButton
  • DrawRadioDot() : CCJMenu
  • DrawRowAdornments() : CMacBinItem, CPseudoItem
  • DrawTab() : CCJFlatTabCtrl
  • drop : UTB_BUTTON
  • DropFiles() : CMainFrame
  • Duplicate() : CCJMemFile
  • dwBuildNumber : AFX_DLLVERSIONINFO
  • dwData : CGfxOutBarCtrl::CBarFolder, CGfxOutBarCtrl::CBarItem
  • dwDockBarMap : CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd
  • dwFlags : CGfxOutBarCtrl
  • dwMajorVersion : AFX_DLLVERSIONINFO
  • dwMinorVersion : AFX_DLLVERSIONINFO
  • dwPlatformID : AFX_DLLVERSIONINFO
  • dwThreadID : CCVS_CoworkerModule

- e -
  • EDIT_ASCII : CCJHexEdit
  • EDIT_HIGH : CCJHexEdit
  • EDIT_LOW : CCJHexEdit
  • EDIT_NONE : CCJHexEdit
  • EditCell() : CMacBinItem
  • EDITMODE : CCJHexEdit
  • EditSel() : CBrowseFileView, UCvsFiles
  • empty : CvsPrefs, UStr, UPStr, GPT_GETENV
  • Enable() : CCJToolCmdUI, PyCmdUI, UCmdUI
  • EnableAutoCompletion() : CCJFlatComboBox
  • EnableButton() : CCJToolBar
  • EnableButtons() : CCJFlatTabCtrl
  • EnableDocking() : CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd
  • EnableDockingOnSizeBar() : CCJControlBar
  • EnableDockingSizeBar() : CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd
  • EnableFlatLook() : CCJControlBar
  • EnableMultiSelect() : CCJTreeCtrl
  • EnableSaveState() : CCJControlBar
  • EnableSplashScreen() : CSplashWnd
  • EnableToolTips() : CCJTabCtrlBar
  • enc : CTCP2Parse
  • encDef : CTCP2Parse
  • encLast : CTCP2Parse
  • encod : MACBINMAP
  • EncodingType : CTCP2Parse
  • EncryptCommunication() : CvsPrefs
  • end() : TMString< T >
  • EndDrag() : CCJReBarCtrl
  • EndDragDockBar() : CCJDockContext
  • EndModal() : UWidget
  • EndSelection() : CCJColorPopup
  • endsWith() : UStr, UPStr
  • EnterDirectory() : TBrowserFill, TBrowserFillDummy, TViewFill, TBrowserFill, TBrowserFillDummy, TViewFill, LSReport, CFillTclEntries, CFillPyEntries, ImportReport, TraversalReport
  • ENTNODE() : ENTNODE
  • EntnodeData() : EntnodeData
  • EntnodeFile() : EntnodeFile
  • EntnodeFolder() : EntnodeFolder
  • EntnodePath() : EntnodePath
  • Entries() : MacBinMaps
  • entries : CMacroSet, MacBinMaps, WININFO
  • Entry() : CSortList< T >
  • entry : _frameRec
  • EnumFontProc() : CCJFontCombo
  • EqualRect() : URect
  • EraseNonClient() : CCJToolBarBase, CCJSizeDockBar, CCJControlBar
  • escSeq : ansiAttrCvt
  • Execute() : UCvsApp
  • ExecuteSelf() : LPseudoWinAttachment, LMainPseudoAttachment, UPseudoPageHider, LPseudoDrawAttachment
  • ExecWB() : CCJHtmlView
  • exit : CvsProcessCallbacks
  • ExitDirectory() : TBrowserFill, TBrowserFillDummy, TViewFill, TBrowserFill, TBrowserFillDummy, TViewFill, LSReport, CFillTclEntries, CFillPyEntries, ImportReport, TraversalReport
  • ExitInstance() : CWincvsApp
  • expanded : UTREE_INFO
  • ext : UMSGMAP_ENTRY
  • ext1 : UMSGMAP_ENTRY
  • ext2 : UMSGMAP_ENTRY
  • ExtDiff() : CvsPrefs
  • Extract() : CCJMemFile
  • extractcolor() : mircAttrCvt

- f -
  • fAddGroups : CGfxOutBarCtrl
  • fAllEntries : CPersistent
  • fAllItems : TMPersistent< T >
  • fAlloc : CTCLCvsConsole
  • fAllRevs : TGraphDelCmd
  • fAllStrs : CMMenuString, TMString< T >
  • False() : PyContainer
  • fAnimation : CGfxOutBarCtrl
  • fBuf : CMMenuString, TMString< T >, TMPersistent< T >
  • fButtonStep : TPseudoScrollBar
  • fClass : CPersistent::CPersistentEntry
  • fController : UPseudoPlaceHolder
  • fCountSel : TGraphDelCmd, TGraphCmdStatus
  • fcreator : ReportConflict
  • fCurrentIcon : UPseudoRotButton, TPseudoRotateIconButton
  • fCurrentView : UPseudoPlaceHolder
  • fCurSel : UPseudoPageHider
  • fCvsRunningCounter : CvsPrefs
  • fData : CGraphDoc
  • fDef : CSortList< T >
  • fDefValue : CPersistentT< T >
  • fDir : CGraphDoc
  • fDragItems : CGfxOutBarCtrl
  • Feature : USmartCombo
  • fEditGroups : CGfxOutBarCtrl
  • fEditItems : CGfxOutBarCtrl
  • FeedThisLine() : CWincvsView, UCvsConsole
  • fElems : CSortList< T >
  • fExitOnError : CTcl_Interp
  • fFirstTime : CGraphView
  • fg : CTCP2Parse
  • fgColorMap : ansiAttrCvt
  • fgDef : CTCP2Parse
  • fgLast : CTCP2Parse
  • fHasLoggedIn : CvsPrefs
  • fIconSuite : UPseudoRotButton, TPseudoRotateIconButton
  • file : FileEntry
  • FileEntry() : FileEntry
  • FileIsType() : AddUnicodeCvsArgs, AddBinCvsArgs, AddCvsArgs, ControlCvsArgs
  • files : MultiFilesEntry
  • FillFields() : CGetPrefs_CVSROOT
  • Find() : CPersistent, TMString< T >
  • FindBestRoot() : CHistComboBoxEx
  • FindCellFromColor() : CCJColorPopup
  • FindData() : CCJMemFile
  • FindDropDownButton() : CCJToolBar
  • FindItem() : CCJTreeCtrl
  • FindKeyboardShortcut() : CCJMenu
  • FindMenuList() : CCJMenu
  • FindMenuOption() : CCJMenu
  • FindMethod() : PyPersistent, PyCmdUI, PyMenuMgr, PyColorConsole, PyCvsEntry
  • FindOneOf() : CCVS_CoworkerModule
  • FindProject() : CvsProject
  • FindString() : CCJComboBoxEx
  • FinishCreateSelf() : CMacBinTable, UPseudoPlaceHolder
  • fInterp : CTcl_Interp, LSReport, CTCLCvsConsole, CPython_Interp
  • first : DYN_LIST
  • firstentry : poolRec
  • firstfree : poolRec
  • Fixed : CTCP2Parse
  • flag : option
  • fLargeIcon : CGfxOutBarCtrl
  • fLastErrorCode : CTcl_Interp
  • FlatBorder() : CCJSizeDockBar
  • fLen : CTCLCvsConsole
  • Flush() : CCJMemFile, CMacroSet
  • flush() : UStr, UPStr
  • fMap : CMacBinItem
  • fMax : CSortList< T >
  • fMaximum : TPseudoDoubleNumberText
  • fMaxStr : CMMenuString, TMString< T >
  • fMethod : CSortList< T >
  • fMinimum : TPseudoDoubleNumberText
  • fName : CGraphDoc
  • fNewOne : CSortList< T >
  • fNode : CGraphDoc
  • fntLast : CTCP2Parse
  • fntSize : CTCP2Parse
  • fNum : CSortList< T >
  • fOnlyRev : TGraphDelCmd
  • ForceBinary() : ReportConflict
  • forceBinary : ReportConflict
  • ForceNoKeywords() : ReportConflict
  • forceNoKeywords : ReportConflict
  • ForceText() : ReportConflict
  • forceText : ReportConflict
  • ForceUnicode() : ReportConflict
  • forceUnicode : ReportConflict
  • Format : _MIDL_PROC_FORMAT_STRING, _MIDL_TYPE_FORMAT_STRING
  • FormatOleDateTime() : CCJTimeEdit, CCJDateEdit
  • ForwardMouse() : CCJPagerCtrl
  • fOut : CRevisionConsole, CStreamConsole
  • fPageCtrl : UPseudoPageHider
  • fPageStep : TPseudoScrollBar
  • fPrecision : TPseudoDoubleNumberText
  • fRealWidth : TBuggyPopup
  • fRemoveGroups : CGfxOutBarCtrl
  • fRemoveItems : CGfxOutBarCtrl
  • FreshenFileMask() : CMainFrame
  • fromHex() : CTCP2Parse
  • fRtfFormat : CWincvsView
  • fSel1 : TGraphCmdStatus
  • fSel2 : TGraphCmdStatus
  • fSelHighlight : CGfxOutBarCtrl
  • fSmallIcon : CGfxOutBarCtrl
  • fState : LSReport
  • fStringContainer : TPseudoTextListView
  • fTclFileRunningCounter : CvsPrefs
  • fTimeStamp : CPersistent
  • ftype : ReportConflict
  • fullpathname : EntnodeData, EntnodePath
  • fUniqueName : CPersistent::CPersistentEntry
  • fValue : CPersistentT< T >, CPersistent::CPersistentEntry
  • fView : TGraphSelNonSig, CColorConsole
  • fViewSuite : UPseudoPageHider, UPseudoPlaceHolder
  • fWidid : UPseudoPageHider, UPseudoPlaceHolder
  • fWidID : TPseudoWinAdorner, TPseudoWinBehavior

- g -
  • G : CTCP2Parse::RGBColor
  • g : UCOLOR, UColor
  • gApp : UCvsApp
  • gCurCvs : UCvsApp
  • gCurMacBinMap : CMacBinTable
  • gCurRsaIdentity : AuthenSSH
  • gCvsProcess : CWincvsApp
  • gCvsRunning : CWincvsApp, UCvsApp
  • gCvsStopping : CWincvsApp, UCvsApp
  • get() : MultiFiles
  • Get() : CSortList< T >, CAllTargets
  • GetActiveView() : CCJTabView, CCJTabCtrlBar
  • GetAddressBar() : CCJHtmlView
  • GetAllColors() : CGraphOptDlg
  • GetAllInstances() : AuthenModel
  • GetAnchorHighlight() : CCJToolBarCtrl
  • GetAnimationTickCount() : CGfxOutBarCtrl
  • GetAppLibFolder() : UCvsApp
  • GetApplication() : CCJHtmlView
  • GetAppModule() : CWincvsApp
  • GetAppName() : UCvsApp
  • GetAppPath() : CWincvsApp
  • GetAppVersion() : CWincvsApp, UCvsApp
  • GetAt() : KiColumnModel, KoRecursiveModel, KoRegularModel
  • GetAttr() : PyCvsEntry, PyContainer
  • getattr() : PyPersistent, PyCmdUI, PyMenuMgr, PyColorConsole, PyCvsEntry
  • GetAutoSize() : CCJHyperLink
  • GetAvailableRect() : CCJSizeDockBar
  • GetBandBorders() : CCJReBarCtrl
  • GetBandCount() : CCJReBarCtrl
  • GetBandInfo() : CCJReBarCtrl
  • GetBarHeight() : CCJReBarCtrl
  • GetBarInfo() : CCJReBarCtrl
  • GetBaseMessageMap() : UCvsToolbar, UCvsMenubar, UCvsGraph, UCvsFrame, UCvsFolders, UCvsFiles, UCvsConsole, UCvsApp, USaveSettings, UAuthen_Gserver, UAuthen_Kserver, UAuthen_Rhosts, UAuthen_Pserver, UAuthen_SSH, UEditMessage, UPromptMessage, UWidget, UToolbar, UMenu, UCmdTarget, UMacAppMenu
  • GetBitmap() : CCJToolBar
  • GetBitmapFlags() : CCJToolBar
  • GetBitmapFromImageList() : CCJMenu
  • GetBkColor() : CCJReBarCtrl, CCJPagerCtrl, CCJColorPicker
  • GetBorder() : CCJPagerCtrl
  • GetBorders() : CCJToolBarBase
  • GetBoundsSelf() : CWinLogBranchData, CWinLogTagData, CWinLogRevData, CWinLogHeaderData, CWinLogData, CWinLogBranchData, CWinLogTagData, CWinLogRevData, CWinLogHeaderData, CWinLogData
  • GetBrowseHistory() : CMainFrame
  • GetBrowserView() : CWincvsApp, CMainFrame, CBrowserBar, UCvsApp
  • getBuffer() : CvsString
  • getBufferMax() : CvsString
  • GetBusy() : CCJHtmlView
  • GetButton() : CCJToolBar
  • GetButtonCount() : CCJToolBar
  • GetButtonInfo() : CCJToolBarCtrl, CCJToolBar
  • GetButtonRect() : CCJControlBar
  • GetButtonSize() : CCJToolBarCtrl, CCJToolBar, CCJPagerCtrl
  • GetButtonState() : CCJPagerCtrl
  • GetButtonStyle() : CCJToolBar
  • GetButtonText() : CCJToolBar
  • GetCellRect() : CCJColorPopup
  • GetChildRect() : CCJTabView, CCJTabCtrlBar, CCJExplorerBar, CCJControlBar
  • GetColor() : CColorStatic, CCJMonthCalCtrl, CCJColorPopup, CCJColorPicker
  • GetColorName() : CCJColorPopup
  • GetColorScheme() : CCJReBarCtrl
  • GetColumn() : CCJColorPopup, KiColumnModel
  • GetColumnCount() : CCJListView, CCJListCtrl
  • GetColumnModel() : CBrowseFileView
  • GetComboBoxCtrl() : CCJComboBoxEx
  • GetConflict() : EntnodeFile, EntnodeData
  • GetConsoleView() : CWincvsApp, CMainFrame
  • GetContainer() : CCJHtmlView
  • GetCount() : KiColumnModel, KoRecursiveModel, KoRegularModel
  • GetCountPerPage() : CGfxOutBarCtrl
  • GetCurFormat() : CWincvsView
  • GetCurModal() : UWidget
  • GetCurrent() : CPseudoRotButton
  • GetCurrentMap() : CMacBinTable
  • GetCurrentState() : UPseudoRotButton
  • GetCurrentView() : UPseudoPlaceHolder
  • GetCurSel() : CCJFlatTabCtrl, CCJMonthCalCtrl
  • GetCvsExitOnError() : CTcl_Interp
  • GetCvsLastErrorCode() : CTcl_Interp
  • GetData() : CWinPlacement, CWinLogData, CMMenuString, CCJHexEdit, CWinLogData, CTCLBrowserEnt, CPersistentT< T >, CPersistent, TMString< T >, TMPersistent< T >, PCStr, PCPStr
  • GetDateTime() : CCJDateEdit
  • GetDesc() : EntnodeData
  • GetDeviceScrollPosition() : CScrollView
  • GetDir() : CGraphDoc
  • GetDisabledImageList() : CCJToolBarCtrl
  • GetDisableOldStyle() : CCJMenu
  • GetDockBar() : CCJDockContext
  • GetDockedSizeBar() : CCJSizeDockBar
  • GetDocument() : CWincvsView, CWincvsApp
  • GetDragItemRect() : CGfxOutBarCtrl
  • GetDrawContentsSelf() : CMacBinItem, CPseudoItem
  • GetDropTarget() : CCJToolBarCtrl, CCJReBarCtrl, CCJPagerCtrl
  • GetEditCtrl() : CCJComboBoxEx
  • GetEntriesModTime() : CBrowseFileView, UCvsFiles
  • GetEntryInfo() : CGraphDoc
  • getenv : CvsProcessCallbacks
  • GetEnvMainThread() : CWincvsApp, CMainFrame
  • GetEnvPlainTypes() : MacBinMaps
  • GetEnvTypes() : MacBinMaps
  • GetErrorMessage() : CvsCoworker, ICvsCoworker
  • getErrorMessage() : CvsProject
  • GetExplorerView() : CWincvsApp, CMainFrame
  • GetExtendedStyle() : CCJToolBarCtrl, CCJListView, CCJListCtrl, CCJComboBoxEx
  • GetFileChanges() : CvsCoworker, ICvsCoworker
  • getFileChanges() : CvsProject
  • getFilename() : CvsFilenames
  • GetFilesToAdd() : CvsCoworker, ICvsCoworker
  • getFilesToAdd() : CvsProject
  • GetFilesView() : UCvsApp
  • GetFileView() : CWincvsApp
  • GetFilterModel() : CWincvsApp, CMainFrame
  • GetFirstDayOfWeek() : CCJMonthCalCtrl
  • GetFirstSelectedItem() : CCJTreeCtrl
  • GetFlag() : CGfxOutBarCtrl
  • GetFocus() : UWidget
  • GetFocusCmd() : UWidget
  • GetFolderChild() : CGfxOutBarCtrl
  • GetFolderCount() : CGfxOutBarCtrl
  • GetFolderData() : CGfxOutBarCtrl
  • GetFolderImageList() : CGfxOutBarCtrl
  • GetFolderPath() : EntnodeData, EntnodePath
  • GetFolderRect() : CGfxOutBarCtrl
  • GetFullName() : CCJHtmlView
  • GetFullPathName() : EntnodeData, EntnodePath
  • GetFullScreen() : CCJHtmlView
  • GetGripperRect() : CCJControlBar
  • GetGroup() : CPseudoToggle
  • GetHeight() : CCJHtmlView
  • GetHideCommandDlg() : COptionalPropertySheet
  • GetHookMap() : CSubclassWndMap
  • GetHorzSize() : CCJControlBar
  • GetHotImageList() : CCJToolBarCtrl
  • GetHotItem() : CCJToolBarCtrl, CCJToolBar
  • GetHoverColor() : CCJHyperLink
  • GetHtmlDocument() : CCJHtmlView
  • GetIcon() : CCustomizeMenus
  • GetIconRect() : CGfxOutBarCtrl
  • GetIdleTime() : CWincvsApp
  • GetIgnoreModel() : CWincvsApp, CMainFrame
  • GetImageForEntry() : CBrowseFileView, UCvsFiles
  • GetImageID() : CContentItems
  • GetImageIndexFromRuntimeClass() : CCJTabCtrlBar
  • GetImageList() : CGfxOutBarCtrl, CCJToolBarCtrl, CCJToolBar, CCJReBarCtrl, CCJComboBoxEx
  • GetImgList() : CGraphView
  • GetIndex() : CCJColorPopup
  • GetInitializedMenu() : CCJMDIChildWnd
  • GetInsertMark() : CCJToolBarCtrl
  • GetInsertMarkColor() : CCJToolBarCtrl
  • GetInsideRect() : CGfxSplitterWnd, CGfxOutBarCtrl
  • GetInstance() : AuthenModel
  • GetItem() : CCJComboBoxEx
  • GetItemBold() : CCJTreeCtrl
  • GetItemByLocation() : CWinCvsBrowser, UCvsFolders
  • GetItemColor() : CCJTreeCtrl
  • GetItemCount() : CGfxOutBarCtrl, CGfxOutBarCtrl::CBarFolder, CCJFlatTabCtrl
  • GetItemData() : CGfxOutBarCtrl
  • GetItemFont() : CCJTreeCtrl
  • GetItemID() : CCJToolBar
  • GetItemImage() : CGfxOutBarCtrl
  • GetItemRect() : CGfxOutBarCtrl, CCJToolBar, CCJFlatTabCtrl
  • GetItems() : USmartCombo
  • GetItemSize() : CGfxOutBarCtrl
  • GetItemText() : CToolbarCombo, CGfxOutBarCtrl, TPseudoTextListView
  • GetKind() : AuthenModel, AuthenGserver, AuthenNtserver, AuthenKserver, AuthenRhosts, AuthenPserver, AuthenSSH, AuthenLocal
  • GetLabelRect() : CGfxOutBarCtrl
  • GetLastError() : CvsCoworker, ICvsCoworker
  • getLastError() : CvsProject
  • GetLastItem() : CCJTreeCtrl
  • GetLeft() : CCJHtmlView
  • GetLinkColor() : CCJHyperLink
  • GetLinkCursor() : CCJHyperLink
  • GetList() : CMMenuString, TMString< T >, TMPersistent< T >
  • GetListCtrl() : TViewFill
  • GetLocationName() : CCJHtmlView
  • GetLocationURL() : CCJHtmlView
  • GetLogMsgID() : CCommit_MAIN
  • GetLogMsgWnd() : CCommit_MAIN
  • GetLogoText() : CCJLogoPane
  • GetMacCreator() : ReportConflict
  • GetMacType() : ReportConflict
  • GetMainFrame() : CWincvsApp, CBrowseFileView, CDynToolBar
  • GetManager() : CToolbarCombo
  • GetMaxSelCount() : CCJMonthCalCtrl
  • GetMaxSize() : CCJToolBarCtrl
  • GetMaxTextRows() : CCJToolBarCtrl
  • GetMenu() : CCJMenuBar
  • GetMenuBar() : CCJHtmlView
  • GetMenuID() : CCJTabCtrl, CCJMDIChildWnd, CCJFlatHeaderCtrl, CCJControlBar
  • GetMenuList() : CMainFrame
  • GetMenuText() : CCJMenu
  • GetMessageMap() : UCvsToolbar, UCvsMenubar, UCvsGraph, UCvsFrame, UCvsFolders, UCvsFiles, UCvsConsole, UCvsApp, USaveSettings, UAuthen_Gserver, UAuthen_Kserver, UAuthen_Rhosts, UAuthen_Pserver, UAuthen_SSH, UEditMessage, UPromptMessage, UWidget, UToolbar, UMenu, UCmdTarget, UMacAppMenu
  • GetMinExt() : CCJControlBar
  • GetMinReqRect() : CCJMonthCalCtrl
  • GetMonthCalColor() : CCJDateTimeCtrl
  • GetMonthCalCtrl() : CCJDateTimeCtrl
  • GetMonthCalFont() : CCJDateTimeCtrl
  • GetMonthDelta() : CCJMonthCalCtrl
  • GetMonthRange() : CCJMonthCalCtrl
  • GetName() : CGraphDoc, EntnodeData
  • GetNextID() : CCJBrowseButton
  • GetNextItem() : CCJTreeCtrl
  • GetNextOrPrevButton() : CCJMenuBar
  • GetNextSelectedItem() : CCJTreeCtrl
  • GetNextTipString() : CTipDlg
  • GetNode() : CGraphDoc
  • GetNormalized() : CTCLBrowserEnt
  • GetNotificationManager() : KoIgnoreModel, KoRecursionModel, KoFilterModel, KiIgnoreModel, KiRecursionModel, KiFilterModel
  • getNumberOfFilenames() : CvsFilenames
  • GetOffline() : CCJHtmlView
  • GetOldLoc() : CHistComboBoxEx
  • getOptionsAndFilename() : CvsFilenames
  • GetOverideList() : UWidget
  • GetPadding() : CCJToolBar
  • GetPageValue() : LPseudoWinAttachment
  • GetPalette() : CCJReBarCtrl
  • GetPanControl() : CCJStatusBar
  • GetParentBrowser() : CCJHtmlView
  • GetPassword() : GetPassword
  • GetPath() : CBrowseFileView
  • GetPattern() : ReportConflict
  • GetPos() : CCJPagerCtrl
  • GetPrevItem() : CCJTreeCtrl
  • GetPrevSelectedItem() : CCJTreeCtrl
  • GetProject() : CvsCoworker, ICvsCoworker
  • getProject() : CvsProject
  • getProjectHandle() : CvsProject
  • getProjectHome() : CvsProject
  • getProjectName() : CvsProject
  • GetProperty() : CCJHtmlView
  • GetPseudoID() : CDynToolBar
  • GetRange() : CCJMonthCalCtrl, CCJDateTimeCtrl
  • GetReadyState() : CCJHtmlView
  • GetReBarCtrl() : CCJReBar
  • GetRect() : CCJToolBar, CCJReBarCtrl
  • GetRecursionModel() : CWincvsApp, CMainFrame
  • GetRecursiveModel() : KiColumnModel
  • GetRegisterAsBrowser() : CCJHtmlView
  • GetRegisterAsDropTarget() : CCJHtmlView
  • GetRegKey() : CCJHyperLink
  • GetRegularModel() : KiColumnModel
  • GetRoot() : CWinCvsBrowser, CWincvsApp, UCvsFolders
  • GetRow() : CCJColorPopup
  • GetRowCount() : CCJReBarCtrl
  • GetRowHeight() : CCJReBarCtrl
  • GetRows() : CCJToolBar
  • GetRuntimeClass() : UCvsToolbar, UCvsMenubar, UCvsGraph, UCvsFrame, UCvsFolders, UCvsFiles, UCvsConsole, UCvsApp, CPersistentInt, CPersistentBool, CPersistent, USaveSettings, CMPString, CMString, PCStr, PCPStr, UAuthen_Gserver, UAuthen_Kserver, UAuthen_Rhosts, UAuthen_Pserver, UAuthen_SSH, UEditMessage, UPromptMessage, UWidget, UToolbar, UObject, UMenu, UCmdTarget, UMacAppMenu
  • GetSel() : CCJHexEdit
  • GetSelectionMode() : CCJColorPicker
  • GetSelFolder() : CGfxOutBarCtrl
  • GetSelFont() : CCJFontCombo
  • GetSelRange() : CCJMonthCalCtrl
  • GetSettingsDesc() : AuthenModel, AuthenGserver, AuthenKserver, AuthenRhosts, AuthenPserver, AuthenSSH
  • GetSetupData() : KiColumn, KoConflictColumn, KoDateColumn, KoTagColumn, KoStatusColumn, KoOptionColumn, KoRevisionColumn, KoPathColumn, KoNameColumn
  • GetSilent() : CCJHtmlView
  • GetStandardSignature() : TPseudoDoubleNumberText, TPseudoTextListView
  • GetState() : CCJToolBar, CPseudoToggle
  • GetStatusBar() : CWincvsApp, CMainFrame, CCJHtmlView
  • GetStatusPane() : CCJStatusBar
  • GetStoredWidth() : CCJListView, CCJListCtrl
  • GetStr() : CWinLogData
  • GetString() : CCJMenuData
  • GetStyle() : CCJToolBarCtrl
  • GetTabCtrl() : CCJTabView
  • GetTabFromPoint() : CCJTabCtrlBar
  • GetTabWidth() : CCJFlatTabCtrl
  • GetText() : CToolbarCombo, CContentItems, KiColumn, KoConflictColumn, KoDateColumn, KoTagColumn, KoStatusColumn, KoOptionColumn, KoRevisionColumn, KoPathColumn, KoNameColumn
  • GetTextColor() : CCJReBarCtrl, CCJColorPicker
  • GetTextExtent() : UDC
  • GetTextHeight() : UDC
  • GetTheaterMode() : CCJHtmlView
  • GetThisMessageMap() : UCvsToolbar, UCvsMenubar, UCvsGraph, UCvsFrame, UCvsFolders, UCvsFiles, UCvsConsole, UCvsApp, USaveSettings, UAuthen_Gserver, UAuthen_Kserver, UAuthen_Rhosts, UAuthen_Pserver, UAuthen_SSH, UEditMessage, UPromptMessage, UWidget, UToolbar, UMenu, UCmdTarget, UMacAppMenu
  • GetTime() : CCJDateTimeCtrl
  • GetTimers() : UWidget
  • GetTimeStamp() : CPersistent
  • GetTipText() : CCJFlatTabCtrl
  • GetToday() : CCJMonthCalCtrl
  • GetToken() : AuthenModel, AuthenGserver, AuthenNtserver, AuthenKserver, AuthenRhosts, AuthenPserver, AuthenSSH, AuthenLocal
  • GetToolBar() : CCJHtmlView
  • GetToolBarCtrl() : CCJToolBar
  • GetToolBarID() : CCJMDIChildWnd
  • GetToolBarIDs() : CCJMDIChildWnd
  • GetToolbarStyle() : CCJToolBar
  • GetTooltip() : UWidget
  • GetToolTip() : CCJTabCtrlBar
  • GetToolTips() : CCJToolBar, CCJReBarCtrl
  • GetTop() : CCJHtmlView
  • GetTopLevelContainer() : CCJHtmlView
  • GetTotalArrowWidth() : CCJFlatTabCtrl
  • GetTotalTabWidth() : CCJFlatTabCtrl
  • GetTrackingState() : CCJMenuBar
  • GetTrackSelection() : CCJColorPicker
  • GetTreeView() : CGraphDoc
  • GetType() : CWinLogData, CCJHtmlView, CWinLogData, PyPersistent, PyCmdUI, PyMenuMgr, PyColorConsole, PyCvsEntry, EntnodeFolder, EntnodeFile, EntnodeData, KiColumnModel, KoRecursiveModel, KoRegularModel
  • GetUnderline() : CCJHyperLink
  • GetURL() : CCJHyperLink
  • GetUseShell() : CvsPrefs
  • GetValidationError() : TPseudoDoubleNumberText
  • GetValue() : PyPersistent, GetValue, TPseudoDoubleNumberText
  • GetVertSize() : CCJControlBar
  • GetView() : CCJTabView, CCJTabCtrlBar, TViewFill, CColorConsole
  • GetViewName() : CCJTabCtrlBar
  • GetViewType() : CBrowseFileView
  • GetVisible() : CCJHtmlView
  • GetVisibleRange() : CGfxOutBarCtrl
  • GetVisited() : CCJHyperLink
  • GetVisitedColor() : CCJHyperLink
  • GetWideString() : CCJMenuData
  • GetWidget() : UWidget
  • GetWidgets() : UWidget
  • GetWidID() : UCmdTarget, TPseudoWinBehavior
  • GetWindowDateTime() : CCJDateEdit
  • GetWinInfo() : CDynToolBar
  • GetWorkspace() : CMainFrame
  • gLastCvsResult : CWincvsApp
  • gLogGraph : CWincvsApp
  • gLogHtml : CWincvsApp
  • gLogTempl : CWincvsApp
  • GoBack() : CCJHtmlView
  • GoForward() : CCJHtmlView
  • GoHome() : CCJHtmlView
  • GoSearch() : CCJHtmlView
  • GotoURL() : CCJHyperLink
  • Green : CTCP2Parse
  • Grey : CTCP2Parse
  • gRsaIdentity : AuthenSSH
  • gRsaIdentityFile : AuthenSSH
  • gRunning : TraversalReport
  • gSSHName : AuthenSSH
  • gSSHOptions : AuthenSSH

- h -
  • handler : NotificationManager::Node
  • has_arg : option
  • HasAborted() : CProgress
  • HasAdvancedOptionsForCommand() : CvsCoworker, ICvsCoworker
  • hasAdvancedOptionsForCommand() : CvsProject
  • HasConflict() : ReportConflict
  • hasConflict : ReportConflict
  • HasEditChanged() : CCJComboBoxEx
  • hasExtension : ReportConflict
  • HasFeature() : USmartCombo
  • HasFocus() : UWidget
  • HasForceBinary() : ReportConflict
  • HasForceNoKeywords() : ReportConflict
  • HasForceText() : ReportConflict
  • HasForceUnicode() : ReportConflict
  • HasHost() : AuthenModel, AuthenGserver, AuthenNtserver, AuthenKserver, AuthenRhosts, AuthenPserver, AuthenSSH
  • HasIgnore() : ReportConflict
  • hasIgnore : ReportConflict
  • HasLoogedIn() : CvsPrefs
  • HasModal() : UWidget
  • hasOne : CWinPlacement
  • HasProblem() : ControlCvsArgs
  • HasSettings() : AuthenModel, AuthenGserver, AuthenNtserver, AuthenKserver, AuthenRhosts, AuthenPserver, AuthenSSH
  • HasTypeCreatorConflict() : ReportConflict
  • hasTypeCreatorConflict : ReportConflict
  • HasUser() : AuthenModel, AuthenKserver, AuthenRhosts, AuthenPserver, AuthenSSH
  • hDragCursor : CGfxOutBarCtrl
  • height : WININFO
  • Height() : URect
  • heightbtn : UTB_INIT
  • Helper() : CvsPrefs
  • hHandCursor : CGfxOutBarCtrl
  • HideButton() : CCJToolBar
  • HideColumn() : CCJFlatSplitterWnd
  • HideCommandDlgAnnotate() : CvsPrefs
  • HideCommandDlgDiff() : CvsPrefs
  • HideCommandDlgGraph() : CvsPrefs
  • HideCommandDlgLog() : CvsPrefs
  • HideCommandDlgUpdate() : CvsPrefs
  • HideCommandDlgUseShift() : CvsPrefs
  • HideRow() : CCJFlatSplitterWnd
  • HideSplashScreen() : CSplashWnd
  • HighlightFolder() : CGfxOutBarCtrl
  • HighlightItem() : CGfxOutBarCtrl
  • his_read : _CvsProcess
  • his_write : _CvsProcess
  • HitTest() : CWinLogData, CCJToolBarCtrl, CCJToolBar, CCJSizeDockBar, CCJReBarCtrl, CCJMenuBar, CCJFlatTabCtrl, CCJMonthCalCtrl, CCJControlBar, CWinLogData
  • HitTestEx() : CGfxOutBarCtrl, CCJListView, CCJListCtrl
  • hNoDragCursor : CGfxOutBarCtrl
  • Home() : CCJFlatTabCtrl, CvsPrefs
  • HookWindow() : CSubclassWnd
  • HookWndProc : CSubclassWnd
  • htDownScroll : CGfxOutBarCtrl
  • htFolder : CGfxOutBarCtrl
  • htItem : CGfxOutBarCtrl
  • htNothing : CGfxOutBarCtrl
  • htUpScroll : CGfxOutBarCtrl
  • hWndParent : CProgressDialog

- i -
  • icon : ULIST_INSERT, UTREE_INFO, UTREE_INSERT, UTB_BUTTON
  • icons : TbEntryDropDown
  • ICTextOption() : CvsPrefs
  • idButton : DROPDOWNBUTTON
  • IDD : CAboutDlg, CProgressDialog, CNoPython, CCustomizeMenus, CUpdateSticky, CUpdateMerge, CUpdateMain, CTag_MAIN, CRtag_OPTIONS, CRtag_MAIN, CReleaseDlg, CLogFilters, CLogMain, CCmdLine_MAIN, CInit_MAIN, CImportEntry, CImportWarning, CImportFilterDlg, CImport_OPTIONS, CImport_MAIN, CGraphOptDlg, GetValue, CGetPrefs_CVSCMD_DIALOGS, CGetPrefs_WINCVS, CGetPrefs_GLOBALS, CGetPrefs_CVSROOT, GetPassword, CEditorMonDlg, CDiff_MAIN, CCVSAlert, CCommit_OPTIONS, CCommit_MAIN, CCheckout_OPTIONS, CCheckout_MAIN, CAskYesNo, CAnnotate_MAIN, CAdminOptionDlg
  • IdleCvsProgress() : CWincvsApp
  • idMenu : DROPDOWNBUTTON
  • iDragFrom : OUTBAR_INFO
  • iDragTo : OUTBAR_INFO
  • IDToIndex() : CCJReBarCtrl
  • iFirstItem : CGfxOutBarCtrl
  • iFolderHeight : CGfxOutBarCtrl
  • Ignore() : ReportConflict
  • ignored : EntnodeData
  • iHitInternal1 : CGfxOutBarCtrl
  • iHitInternal2 : CGfxOutBarCtrl
  • iImageIndex : CGfxOutBarCtrl::CBarItem
  • iIndex : CGfxGroupEdit
  • iLastDragItemDraw : CGfxOutBarCtrl
  • iLastDragItemDrawType : CGfxOutBarCtrl
  • iLastFolderHighlighted : CGfxOutBarCtrl
  • iLastItemHighlighted : CGfxOutBarCtrl
  • iLastSel : CGfxOutBarCtrl
  • iLastSelectedFolder : CGfxOutBarCtrl
  • Import() : CCJMemFile
  • ImportReport() : ImportReport
  • inc : USLIDER
  • Indeterminate() : CCJToolBar
  • index : OUTBAR_INFO
  • indexColor : CTCP2Parse
  • InflateRect() : URect
  • init() : CRevisionConsole
  • InitATL() : CWincvsApp
  • initialcmd : UTB_DROPDOWN
  • Initialise() : CCJColorPopup
  • Initialize() : CCustInvertTable
  • InitializeControl() : CCJBrowseEdit
  • InitializeDockingWindows() : CMainFrame
  • InitializeFonts() : CCJFontCombo
  • InitializeHeader() : CCJFlatHeaderCtrl
  • InitializeMenu() : CCJMDIFrameWnd, CCJFrameWnd
  • InitializeMenuList() : CCJMenu
  • InitialShowWindow() : CMainFrame
  • InitInstance() : CWincvsApp, CLogoutThread
  • InitItem() : TViewFill
  • InitPythonSupport() : CPython_Interp
  • InitValues() : PyPersistent, PyCmdUI, PyMenuMgr, PyColorConsole, PyCvsEntry
  • Insert() : CMMenuString, CCJMemFile, CSortList< T >, TMString< T >
  • InsertBand() : CCJReBarCtrl
  • InsertButton() : CCJToolBar
  • InsertControl() : CCJToolBar
  • InsertItem() : CGfxOutBarCtrl, CGfxOutBarCtrl::CBarFolder, CCJFlatTabCtrl, CCJComboBoxEx
  • InsertMarkHitTest() : CCJToolBarCtrl
  • InsertMenuA() : CCJMenu
  • InsertMenuW() : CCJMenu
  • InsertODMenuA() : CCJMenu
  • InsertODMenuW() : CCJMenu
  • InsertSpaces() : CCJMenu
  • InsertString() : CHistComboBoxEx, CCJComboBoxEx
  • Inside() : CSortList< T >
  • InsideAndInsert() : CSortList< T >
  • InsStringBefore() : TPseudoTextListView
  • InsStringFirst() : TPseudoTextListView
  • InsStringLast() : TPseudoTextListView
  • Install() : CCJMenuBarFrameHook
  • InterfaceSupportsErrorInfo() : CvsCoworker
  • IntersectRect() : URect
  • invalFlag : CMacroSet
  • InvalidateOldPos() : CCJToolBar
  • InvalidateRect() : CScrollView
  • InvalidateTabs() : CCJFlatTabCtrl
  • InvalidateView() : CBrowseFileView
  • InvalidCache() : LPseudoWinAttachment
  • ircAll : CGfxOutBarCtrl
  • ircIcon : CGfxOutBarCtrl
  • ircii2ctcp() : irciiAttrCvt
  • ircLabel : CGfxOutBarCtrl
  • IsAdded() : KoFilterModel
  • IsAvail() : CTcl_Interp, CPython_Interp
  • IsBinary() : ReportConflict
  • isBinary : ReportConflict
  • IsBottomDocked() : CCJControlBar
  • IsButtonChecked() : CCJToolBar
  • IsButtonEnabled() : CCJToolBar
  • IsButtonHidden() : CCJToolBar
  • IsButtonHighlighted() : CCJToolBarCtrl
  • IsButtonIndeterminate() : CCJToolBar
  • IsButtonPressed() : CCJToolBar
  • IsChanged() : KoFilterModel
  • ischeck : TbEntryButton
  • IsConflict() : KoFilterModel
  • IsCvsRunning() : UCvsApp, CvsPrefs
  • IsCvsStopping() : UCvsApp
  • IsDeadNode() : CWinLogData
  • IsDefaultAscending() : KiColumn, KoConflictColumn, KoDateColumn, KoTagColumn, KoStatusColumn, KoOptionColumn, KoRevisionColumn, KoPathColumn, KoNameColumn
  • IsDefaultMode() : KoFilterModel
  • IsDerivedFrom() : URuntimeClass
  • IsDiskNode() : CWinLogData
  • IsDockBar() : CCJSizeDockBar
  • IsDockSizeBar() : CCJSizeDockBar
  • iSelAnimCount : CGfxOutBarCtrl
  • iSelAnimTiming : CGfxOutBarCtrl
  • iSelFolder : CGfxOutBarCtrl
  • IsEnabled() : KoUpdateMoveToTrashHandler
  • IsEnteredTwice() : USemaphore
  • IsExtension() : ReportConflict
  • isFileDifferent() : CvsProject
  • IsFindValid() : CCJTreeCtrl
  • IsFloating() : CCJControlBar
  • IsHideUnknown() : KoFilterModel
  • IsHooked() : CSubclassWnd
  • IsHorzDocked() : CCJControlBar
  • IsIgnored() : EntnodeData
  • IsKindOf() : UObject
  • IsLastControlBar() : CCJSizeDockBar
  • IsLeftDocked() : CCJControlBar
  • IsLocked() : EntnodeData
  • IsMatch() : KoTraversalContext, KoFilterModel, KiFilterModel
  • IsMenu() : CCJMenu
  • IsMissing() : EntnodeData, KoFilterModel
  • IsModified() : KoFilterModel
  • IsNewShell() : CCJMenu
  • iso8859_1 : CTCP2Parse
  • iso8859_2 : CTCP2Parse
  • iso8859_3 : CTCP2Parse
  • iso8859_4 : CTCP2Parse
  • iso8859_5 : CTCP2Parse
  • iso8859_6 : CTCP2Parse
  • iso8859_7 : CTCP2Parse
  • iso8859_8 : CTCP2Parse
  • iso8859_9 : CTCP2Parse
  • IsoConvert() : CvsPrefs
  • IsRadio() : CPseudoToggle
  • IsRectEmpty() : URect
  • IsRectNull() : URect
  • IsRecursive() : TViewFill, KoTraversalContext
  • IsRemoved() : EntnodeData, KoFilterModel
  • IsRightDocked() : CCJControlBar
  • IsSamePath() : CTCLBrowserEnt
  • IsSelected() : CWincvsView, CCJHexEdit
  • IsSelSingleNode() : CGraphView
  • IsShowIgnored() : TViewFill, KoTraversalContext, KoIgnoreModel, KiIgnoreModel
  • IsShowRecursive() : KoRecursionModel, KiRecursionModel
  • IsSmallIconView() : CGfxOutBarCtrl
  • IsSortAscendant() : UCvsFiles
  • isStderr : GPT_CONSOLE
  • IsTclFileRunning() : CvsPrefs
  • IsTopDocked() : CCJControlBar
  • IsUIValid() : UWidget
  • IsUnicode() : ReportConflict
  • isUnicode : ReportConflict
  • IsUnknown() : EntnodeData, KoFilterModel
  • IsUnmodified() : EntnodeData
  • IsUserState() : CWinLogData
  • IsValid() : PyAutoObject< T >
  • IsValidButton() : CCJMenuBar
  • IsValidItem() : CGfxOutBarCtrl
  • IsVertDocked() : CCJControlBar
  • IsVisited() : EntnodeData
  • IsWin95() : CCJFlatComboBox
  • iSysColorTo : CJX_COLORMAP
  • italic : UCvsConsole, ansiAttrCvt
  • italicCnt : CTCP2Parse
  • italicLast : CTCP2Parse
  • item : UTREE_INFO
  • items() : CToolBarData

- k -
  • kBrowserPopup : UCvsFrame
  • kCancel : UAuthen_Gserver, UAuthen_Kserver, UAuthen_Rhosts, UAuthen_Pserver, UAuthen_SSH, UEditMessage, UPromptMessage
  • kCheckEncrypt : UAuthen_Gserver
  • kCheckPort : UAuthen_Kserver, UAuthen_Rhosts, UAuthen_Pserver
  • kCheckProxy : UAuthen_Pserver
  • kCheckRSHName : UAuthen_Rhosts
  • kCheckServerName : UAuthen_Rhosts
  • kConflict : EntnodeFile
  • kCopyFrom : USaveSettings
  • kCopyList : USaveSettings
  • kCopyPath : USaveSettings
  • kDefaultPrecision : TPseudoDoubleNumberText
  • kDirCombo : UCvsFrame
  • kDrawing : UCvsGraph
  • kEdit : UEditMessage
  • kEditPort : UAuthen_Kserver, UAuthen_Rhosts, UAuthen_Pserver
  • kEditProxy : UAuthen_Pserver
  • kEditRSHName : UAuthen_Rhosts
  • kEditServerName : UAuthen_Rhosts
  • key : CustInvertTable
  • KillChildWindow() : CCJCaption
  • KillThread() : CLogoutThread
  • Kind() : ReportWarning
  • kind : Authen, ReportWarning, TbEntry
  • kindstr() : Authen
  • kindToNum() : Authen
  • kindToToken() : Authen
  • kMsg : UEditMessage, UPromptMessage
  • kMultiClickSelection : TPseudoTextListView
  • kName : EntnodeData
  • kNameProxy : UAuthen_Pserver
  • KoColumnContext() : KoColumnContext
  • KoFilterModel() : KoFilterModel
  • KoIgnoreModel() : KoIgnoreModel
  • kOK : UAuthen_Gserver, UAuthen_Kserver, UAuthen_Rhosts, UAuthen_Pserver, UAuthen_SSH, UEditMessage, UPromptMessage
  • kOption : EntnodeFile
  • kOptionsCheck : UAuthen_SSH
  • kOptionsEdit : UAuthen_SSH
  • kOptionsText : UAuthen_SSH
  • KoRecursionModel() : KoRecursionModel
  • KoTraversalContext() : KoTraversalContext
  • KoUpdateMoveToTrashHandler() : KoUpdateMoveToTrashHandler
  • KoWatcher() : KoWatcher
  • kPath : EntnodeData
  • kProcessTimer : UCvsApp
  • kPseudoWinAdorner : TPseudoWinAdorner
  • kPseudoWinBehavior : TPseudoWinBehavior
  • kRSABtn : UAuthen_SSH
  • kRSACheck : UAuthen_SSH
  • kRSAEdit : UAuthen_SSH
  • kSelectionChanged : TPseudoTextListView
  • KserverPort() : CvsPrefs
  • kSettingName : USaveSettings
  • kSSHBtn : UAuthen_SSH
  • kSSHCheck : UAuthen_SSH
  • kSSHName : UAuthen_SSH
  • kStatus : EntnodeData
  • kStdDoubleNumberText : TPseudoDoubleNumberText
  • kTag : EntnodeFile
  • kTextStringListViewSignature : TPseudoTextListView
  • kTS : EntnodeFile
  • kUDispatchHandled : UCmdTarget
  • kUNoDispatchInfo : UCmdTarget
  • kVN : EntnodeFile

- l -
  • lAnimationTickCount : CGfxOutBarCtrl
  • LastWorkingDir() : CvsPrefs
  • Layout() : CCJToolBar
  • left : URECT
  • len : GPT_CONSOLE
  • length() : CvsPrefs, UStr, UPStr
  • LineTo() : UDC
  • list_t : TMString< T >, TMPersistent< T >
  • ListenToMessage() : LPseudoWinAttachment, UPseudoPageHider, UPseudoPlaceHolder
  • LMainPseudoAttachment() : LMainPseudoAttachment
  • load() : CvsPrefs
  • Load() : CCJMemFile
  • LoadAll() : CPersistent
  • LoadBarState() : CCJMDIFrameWnd, CCJFrameWnd, CCJControlBar
  • LoadBitmap() : CCJToolBar
  • LoadCheckmarkBitmap() : CCJMenu
  • LoadColumns() : CBrowseFileView
  • LoadColumnWidths() : CCJListView, CCJListCtrl
  • LoadDefaults() : MacBinMaps
  • LoadFromResource() : CCJHtmlView
  • LoadFromToolBar() : CCJMenu
  • loadIcon() : CPseudoButton
  • LoadMenu() : CCJMenuBar, CCJMenu
  • LoadSysColorBitmap() : CCJMenu
  • LoadToolbar() : CCJMenu
  • LoadToolBar() : CCJToolBar
  • LoadToolbars() : CCJMenu
  • LoadWindowPos() : CCJWindowPlacement
  • LoadXPM() : CPseudoButton
  • LoadXPMs() : CPseudoRotButton
  • Location() : CSortList< T >
  • Lock() : CCVS_CoworkerModule
  • locked : EntnodeData
  • logfont : CCJTreeCtrl::Color_Font
  • LogoutTimeOut() : CvsPrefs
  • LookForResourceFile() : CWincvsApp
  • Lookup() : CSubclassWndMap
  • lpEntries : UMSGMAP
  • LPseudoDrawAttachment() : LPseudoDrawAttachment
  • LPseudoWinAttachment() : LPseudoWinAttachment
  • LSReport() : LSReport
  • Lt_Blue : CTCP2Parse
  • Lt_Cyan : CTCP2Parse
  • Lt_Green : CTCP2Parse
  • Lt_Grey : CTCP2Parse
  • Lt_Magenta : CTCP2Parse
  • Lt_Red : CTCP2Parse
  • Lt_Yellow : CTCP2Parse

- m -
  • m_abort : CProgressDialog, CProgress
  • m_addbtn : CCustomizeMenus
  • m_all : PyRegistry
  • m_allowExtDiff : CDiff_MAIN
  • m_AllSubMenus : CCJMenu
  • m_alwaysroot : CGetPrefs_GLOBALS
  • m_aPans : CCJStatusBar
  • m_apply : CGraphOptDlg
  • m_ar : _afxRichEditCookie
  • m_arg1 : CMsg
  • m_arg2 : CMsg
  • m_arrayOffsetName : CvsFilenames
  • m_ArrowRect : CCJColorPicker
  • m_arStrings : CCJMenuBar
  • m_ascendant : CBrowseFileView, UCvsFiles
  • m_Attach : UPseudoFakePane
  • m_authen : CGetPrefs_CVSROOT
  • m_authenCombo : CGetPrefs_CVSROOT
  • m_bActive : CCJColorPicker
  • m_bAddressIsWide : CCJHexEdit
  • m_bAdjustToFit : CCJHyperLink
  • m_bAltColor : CCJFlatButton
  • m_bAscending : CCJListView, CCJListCtrl
  • m_bATLInited : CWincvsApp
  • m_bAutoComp : CCJFlatComboBox
  • m_bAutodelete : CCJStatusBarPaneControlInfo
  • m_bAutoRemoveFrameMenu : CCJMenuBar
  • m_bAutoSave : CCJListView, CCJListCtrl, CCJControlBar
  • m_bBoldFont : CCJFlatHeaderCtrl
  • m_bButtons : CCJControlBar
  • m_bDelayedButtonLayout : CCJToolBar
  • m_bDragging : CCJSizeDockBar, CCJControlBar
  • m_bEscapeWasPressed : CCJMenuBar
  • m_bExStyle : CCJToolBarBase
  • m_bFlatBorder : CCJSizeDockBar, CCJControlBar
  • m_bFlatGripper : CCJControlBar
  • m_bFlatLook : CCJFlatButton
  • m_bFlatSplitter : CCJFlatSplitterWnd
  • m_bFloating : CCJControlBar
  • m_bGripper : CCJControlBar
  • m_bHalfPage : CCJHexEdit
  • m_bHasArrows : CCJFlatTabCtrl
  • m_bHasFocus : CCJFlatComboBox
  • m_bHasHomeEnd : CCJFlatTabCtrl
  • m_bHilight : CCJOutlookBar
  • m_bInReBar : CCJToolBarBase
  • m_bIsDockBar : CCJSizeDockBar
  • m_bitmap : CSplashWnd, CDynToolBar, CPseudoButton
  • m_bitmapBackground : CCJMenu
  • m_bitmapBackgroundFlag : CCJMenu
  • m_bitmaps : CPseudoRotButton
  • m_bLBDown : CCJOutlookBar
  • m_bLBtnDown : CCJFlatHeaderCtrl, CCJFlatComboBox, CCJFlatButton, CCJColorPicker
  • m_bMaskKeyInProgress : CCJMaskEdit
  • m_bMaximized : CCJControlBar
  • m_bMouseOver : CCJFlatButton
  • m_bMultiSelect : CCJTreeCtrl
  • m_bNoAddressChange : CCJHexEdit
  • m_bNoColSizing : CCJListView, CCJListCtrl
  • m_bOkToDrag : CCJSizeDockBar, CCJControlBar
  • m_BoldFont : CCJFlatTabCtrl
  • m_bOpen : CCJMemFile
  • m_bOpenFileDialog : CCJBrowseButton
  • m_bOptionChecked : COptionalPropertySheet
  • m_bOverControl : CCJHyperLink
  • m_bPainted : CCJFlatComboBox, CCJFlatButton
  • m_bpr : CCJHexEdit
  • m_bProcessLeftArrow : CCJMenuBar
  • m_bProcessRightArrow : CCJMenuBar
  • m_branchColor : CGraphOptDlg
  • m_bRemoveDirectory : CReleaseDlg
  • m_bRestoreFocus : CMainFrame
  • m_browseHist : CMainFrame
  • m_browser : CBrowserBar
  • m_brush : UDC
  • m_bShowAddress : CCJHexEdit
  • m_bShowAscii : CCJHexEdit
  • m_bShowDropArrow : CCJToolBar
  • m_bShowHex : CCJHexEdit
  • m_bSortAsc : CSortHeaderCtrl, CCJFlatHeaderCtrl
  • m_bStartup : CTipDlg
  • m_bSwitchingWrap : CCommit_MAIN
  • m_bTabsOnBottom : CCJFlatTabCtrl
  • m_btnBrowse : CCJBrowseEdit
  • m_btnClose : CCJControlBar
  • m_btnMinim : CCJControlBar
  • m_bToFit : CCJControlBar
  • m_bToolTipsEnabled : CCJTabCtrlBar
  • m_bTrackSelection : CCJColorPicker
  • m_buf : UCvsConsole, CBuffer
  • m_bUnderline : CCJHyperLink
  • m_bUnique : CCJControlBar
  • m_bUpdate : CCJHexEdit
  • m_bUseMask : CCJMaskEdit
  • m_bVisited : CCJHyperLink
  • m_c : PyRegistry
  • m_CacheWidgets : LPseudoWinAttachment
  • m_Caption : CCJExplorerBar, CCJCaptionPopupWnd
  • m_CaptionButton : CCJExplorerBar, CCJCaptionPopupWnd, CCJCaption
  • m_cbBufferMax : CvsString
  • m_checkChanges : CBrowseFileView
  • m_checkoutDir : CCheckout_MAIN
  • m_checkoutro : CGetPrefs_GLOBALS
  • m_checkPath : CCmdLine_MAIN
  • m_checkUnmod : CTag_MAIN
  • m_checkUnmodCheck : CTag_MAIN
  • m_checkValidEdits : CCommit_OPTIONS
  • m_chkdiff : CGetPrefs_WINCVS
  • m_chkUseViewerAlways : CGetPrefs_WINCVS
  • m_ClassNameToImageIndexMap : CCJTabCtrlBar
  • m_clrAltHilite : CCJFlatButton
  • m_clrAltNormal : CCJFlatButton
  • m_clrAltShadow : CCJFlatButton
  • m_clrAltTextNm : CCJFlatButton
  • m_clrBackgnd : CCJCaption
  • m_clrBkgnd : CCJFontCombo
  • m_clrBorder : CCJCaption
  • m_clrBtnFace : CCJCaption
  • m_clrBtnHilite : CCJCaption
  • m_clrBtnShadow : CCJCaption
  • m_clrDkShad : CCJOutlookBar, CCJFlatButton
  • m_clrFont : CCJCaption
  • m_clrHilight : CCJFontCombo
  • m_clrHilightText : CCJFontCombo
  • m_clrHilite : CCJOutlookBar, CCJFlatComboBox, CCJFlatButton
  • m_clrNormal : CCJOutlookBar, CCJFlatComboBox, CCJFlatButton
  • m_clrNormalText : CCJFontCombo
  • m_clrShadow : CCJOutlookBar, CCJFlatComboBox, CCJFlatButton
  • m_clrText : CCJListView, CCJListCtrl
  • m_clrTextBk : CCJListView, CCJListCtrl
  • m_clrTextGy : CCJFlatButton
  • m_clrTextNm : CCJOutlookBar, CCJFlatButton
  • m_cmd : UTimer, CPseudoList
  • m_cmdid : CPseudoItem, LPseudoDrawAttachment, CPseudoDraw
  • m_cmdLine : CCmdLine_MAIN
  • m_cmdLineEdit : CCmdLine_MAIN
  • m_cmdsList : CCustomizeMenus
  • m_cmdui : PyCmdUI
  • m_cncl : UPromptMessage
  • m_cnclhit : CCVSAlert
  • m_cntladd : CGetPrefs_GLOBALS
  • m_color : CColorStatic
  • m_column : CSortParam
  • m_columnAlt : CSortParam
  • m_comboFilterMask : CMainFrame
  • m_console : PyColorConsole
  • m_consolebar : CMainFrame
  • m_context : TViewFill, CSortParam
  • m_continue : UCmdUI
  • m_copyFromPath : USaveSettings
  • m_count : KoWatcher
  • m_crColor : CCJColorPopup
  • m_crColorBk : CCJColorPicker
  • m_crColors : CCJColorPopup
  • m_crColorText : CCJColorPicker
  • m_createmissdir : CUpdateMain
  • m_crHoverColor : CCJHyperLink
  • m_crInitialColor : CCJColorPopup
  • m_crLinkColor : CCJHyperLink
  • m_crVisitedColor : CCJHyperLink
  • m_csText : CContentItems
  • m_cstr : PyPersistent
  • m_ctrlHeader : CBrowseFileView
  • m_curHSplitBar : CCJSizeDockBar
  • m_curindex : CPseudoRotButton
  • m_curModal : UWidget
  • m_currentAddress : CCJHexEdit
  • m_currentMode : CCJHexEdit
  • m_currentPage : UWidget
  • m_curSize : CBuffer
  • m_curVSplitBar : CCJSizeDockBar
  • m_CustomTextRect : CCJColorPopup
  • m_cvschk : CGetPrefs_WINCVS
  • m_cvsconsole : CGetPrefs_CVSROOT
  • m_cvsprog : CGetPrefs_WINCVS
  • m_cvsroot : CGetPrefs_CVSROOT
  • m_cvsrootCombo : CGetPrefs_CVSROOT
  • m_cvsvers : CGetPrefs_CVSROOT
  • m_cx : CCJCaption
  • m_cxOffset : CCJControlBar
  • m_cxText : CCJStatusBarPane
  • m_cy : CCJCaption
  • m_cyOffset : CCJControlBar
  • m_data : TBrowserFillDummy, UCvsGraph, TBrowserFillDummy, PyCvsEntry, CPseudoItem
  • m_date : CUpdateSticky, CRtag_OPTIONS, CLogFilters, CCheckout_OPTIONS
  • m_date1 : CUpdateMerge
  • m_date1Combo : CUpdateMerge
  • m_date2 : CUpdateMerge
  • m_date2Combo : CUpdateMerge
  • m_dateCombo : CUpdateSticky, CRtag_OPTIONS, CLogFilters, CCheckout_OPTIONS
  • m_deadNodeColor : CGraphOptDlg
  • m_DefaultTextRect : CCJColorPopup
  • m_defbranch : CLogMain
  • m_defhit : CCVSAlert
  • m_delsticky : CUpdateMain
  • m_desc : CImportEntry, CImportWarning
  • m_destroylock : CDummyInit
  • m_didInteract : CGetPrefs_CVSCMD_DIALOGS, CGetPrefs_WINCVS, CGetPrefs_GLOBALS, CGetPrefs_CVSROOT
  • m_didSetIt : CTempToggleBool, CTurnOffDispatching
  • m_didSetSemaphore : USemaphore
  • m_diff : CDiff_MAIN
  • m_diffprog : CGetPrefs_WINCVS
  • m_dir : UCvsGraph
  • m_dirname : TBrowserFillDummy
  • m_dirty : CGetPrefs_GLOBALS
  • m_disbitmap : CPseudoButton
  • m_disbitmaps : CPseudoRotButton
  • m_dlg : CProgress
  • m_doc : PyPersistent, PyCmdUI, PyMenuMgr, PyColorConsole, PyCvsEntry, PyRegistry
  • m_downbtn : CCustomizeMenus
  • m_dwData : CCJSortClass::CSortItem
  • m_dwDragStart : CCJTreeCtrl
  • m_dwError : _afxRichEditCookie
  • m_dwExStyle : CCJCaption
  • m_dwFlags : CCJBrowseButton
  • m_dwTextStyle : CCJCaption
  • m_eAuxIndex : CCJControlBar
  • m_eChildBorder : CCJControlBar
  • m_edit : CToolbarCombo, CImportFilterDlg, UEditMessage
  • m_editlogout : CGetPrefs_GLOBALS
  • m_editPath : CCheckout_MAIN
  • m_editPos : CCJHexEdit
  • m_empty : TBrowserFillDummy
  • m_enteredTwice : USemaphore
  • m_entries : TBrowserFill, TViewFill, TBrowserFill, UCvsFiles, TViewFill, CFillTclEntries, CFillPyEntries, CImportFilterDlg
  • m_entriesLogMod : CBrowseFileView, UCvsFiles
  • m_entriesMod : CBrowseFileView, UCvsFiles
  • m_err : CPyCvsConsole
  • m_eType : CCJBrowseEdit, CCJBrowseButton
  • m_ev : CMsg
  • m_eventStartWatching : KoWatcher
  • m_eventTerminate : KoWatcher
  • m_export : CCheckout_OPTIONS
  • m_extdiff : CDiff_MAIN
  • m_extdiffctl : CDiff_MAIN
  • m_fAccendant : CSortParam
  • m_feature : USmartCombo
  • m_fGroupSubDir : CSortParam
  • m_File : CCJMemFile
  • m_fileToDiffCombo : CCommit_MAIN
  • m_filter : CMainFrame, KoTraversalContext
  • m_firstTimeCmdline : CCmdLine_MAIN
  • m_flag : CGetPrefs_CVSROOT, CPseudoToggle
  • m_folderLoc : CCmdLine_MAIN
  • m_Font : CCJTabCtrl, CCJOutlookBar, CCJMenuBar, CCJMaskEdit, CCJLogoPane, CCJHyperLink, CCJHexEdit, CCJFlatTabCtrl, CCJFlatHeaderCtrl, CCJFlatButton, CCJColorPopup, CCJCaption, CCJBrowseButton
  • m_fontNormal : CMainFrame
  • m_force : CAnnotate_MAIN
  • m_forceCommit : CCommit_OPTIONS
  • m_forceRecurse : CCommit_OPTIONS
  • m_forceRevision : CCommit_OPTIONS
  • m_forceRoot : CCheckout_OPTIONS
  • m_forceroot : CInit_MAIN
  • m_foundIt : CFindSettings
  • m_frameHook : CCJMenuBar
  • m_garbage : CCustInvertTable
  • m_getcleancopy : CUpdateMain
  • m_gotProblem : ControlCvsArgs
  • m_group : CPseudoToggle
  • m_grpBox : CTag_MAIN, CRtag_OPTIONS, CRtag_MAIN
  • m_handles : KoWatcher
  • m_hascvs : TBrowserFill, TBrowserFillDummy
  • m_hasDate : CRtag_OPTIONS, CCheckout_OPTIONS
  • m_hasdate : CUpdateSticky, CLogFilters
  • m_hasDate1 : CUpdateMerge
  • m_hasDate2 : CUpdateMerge
  • m_hasrev : CUpdateSticky, CLogFilters
  • m_hasRev : CRtag_OPTIONS, CCheckout_OPTIONS, CAnnotate_MAIN
  • m_hasstate : CLogFilters
  • m_hasuser : CLogFilters
  • m_hAuxIcon : CCJControlBar
  • m_hbmImageWell : CCJToolBar
  • m_hCursor : CCJFlatButton
  • m_headerColor : CGraphOptDlg
  • m_height : CColorMenu
  • m_heightOfLines : CBrowseFileView
  • m_helpinit : CInit_MAIN
  • m_hEndArrow : CCJFlatTabCtrl
  • m_hEndArrowDisabled : CCJFlatTabCtrl
  • m_hEnhMetaFile : CCJMetaFileButton
  • m_hEnhMetaFileDisabled : CCJMetaFileButton
  • m_hEnhMetaFileFocus : CCJMetaFileButton
  • m_hEnhMetaFileSel : CCJMetaFileButton
  • m_hHomeArrow : CCJFlatTabCtrl
  • m_hHomeArrowDisabled : CCJFlatTabCtrl
  • m_hIcon : CCJExplorerBar, CCJControlBar, CCJCaption, CCJBrowseButton
  • m_hIconOff : CCJCaptionPopupWnd
  • m_hIconOn : CCJCaptionPopupWnd
  • m_hideAnnotate : CGetPrefs_CVSCMD_DIALOGS
  • m_hideDiff : CGetPrefs_CVSCMD_DIALOGS
  • m_hideGraph : CGetPrefs_CVSCMD_DIALOGS
  • m_hideLog : CGetPrefs_CVSCMD_DIALOGS
  • m_hideUpdate : CGetPrefs_CVSCMD_DIALOGS
  • m_hInstImageWell : CCJToolBar
  • m_hItemFirstSel : CCJTreeCtrl
  • m_hKeyRoot : CCJToolBar
  • m_hLeftArrow : CCJFlatTabCtrl
  • m_hLeftArrowDisabled : CCJFlatTabCtrl
  • m_hLinkCursor : CCJHyperLink
  • m_hMenu : CCJMDIChildWnd
  • m_hMenuTracking : CCJMenuBar
  • m_home : CGetPrefs_WINCVS
  • m_host : CGetPrefs_CVSROOT
  • m_hProcess : CEditorMonDlg
  • m_hProject : CvsProject
  • m_hPushed : CCJFlatButton
  • m_hRightArrow : CCJFlatTabCtrl
  • m_hRightArrowDisabled : CCJFlatTabCtrl
  • m_hRsrcImageWell : CCJToolBar
  • m_hWnd : KoWatcher, CSubclassWnd
  • m_iActualSize : CCJSizeDockBar
  • m_iClientHeight : CCJFlatTabCtrl
  • m_iClientWidth : CCJFlatTabCtrl
  • m_iconX : CCJMenu
  • m_iconY : CCJMenu
  • m_iCurSel : CCJFlatTabCtrl
  • m_idletime : CWincvsApp
  • m_Ignlist : ImportReport
  • m_ignlist : TBrowserFill, TViewFill, TBrowserFill, TViewFill, CFillTclEntries, CFillPyEntries
  • m_ignore : CMainFrame
  • m_ignoreCase : CDiff_MAIN
  • m_iLastError : CvsProject
  • m_ImageList : CHistComboBoxEx, CGraphView, CCJControlBar, CImportFilterDlg
  • m_Imagelist : CWinCvsBrowser
  • m_indic : CCvsStatusBar
  • m_iNewPopup : CCJMenuBar
  • m_info : CDynToolBar
  • m_instances : AuthenModel
  • m_iPopupTracking : CCJMenuBar
  • m_isAdded : KoFilterModel
  • m_iSafeSpace : CCJSizeDockBar
  • m_isBackgroundProcess : CWincvsApp
  • m_isChanged : KoFilterModel
  • m_isCheckout : CUpdateMerge
  • m_isConflicts : KoFilterModel
  • m_isDate : CAnnotate_MAIN
  • m_isDate1 : CDiff_MAIN
  • m_isDate2 : CDiff_MAIN
  • m_isFiles : KoUpdateMoveToTrashHandler
  • m_isFilesChange : CBrowseFileView
  • m_isFolders : KoUpdateMoveToTrashHandler
  • m_isHideUnknown : KoFilterModel
  • m_isIgnore : KoIgnoreModel
  • m_isMissing : KoFilterModel
  • m_isRecursive : KoWatcher, CBrowseFileView, KoTraversalContext, KoRecursionModel
  • m_isRemoved : KoFilterModel
  • m_isResetViewLocked : CBrowseFileView
  • m_isResetViewPending : CWinCvsBrowser, CBrowseFileView
  • m_isSelectionChanged : CWinCvsBrowser
  • m_isSelectionNotificationLocked : CWinCvsBrowser
  • m_isShowIgnored : TBrowserFill, KoTraversalContext
  • m_isUnknown : KoFilterModel
  • m_item : TBrowserFill, TBrowserFillDummy, TBrowserFill, TBrowserFillDummy
  • m_iTotalTabWidth : CCJFlatTabCtrl
  • m_iTrackingState : CCJMenuBar
  • m_iXOffset : CCJFlatTabCtrl
  • m_keyForce : CGetPrefs_CVSCMD_DIALOGS
  • m_lap : UTimer
  • m_lastlap : UTimer
  • m_lastRect : LPseudoWinAttachment
  • m_length : CCJHexEdit
  • m_lineHeight : CCJHexEdit
  • m_list : CFindSettings, USaveSettings, CImportFilterDlg
  • m_listCtrl : TViewFill
  • m_listeners : UWidget
  • m_lock : CCvsThreadLock
  • m_login : CGetPrefs_CVSROOT
  • m_logmsg : CImport_MAIN
  • m_logMsg : CCommit_MAIN
  • m_logMsgCtrl : CCommit_MAIN
  • m_logMsgCtrlWrap : CCommit_MAIN
  • m_logout : CGetPrefs_GLOBALS
  • m_lookAttic : CRtag_MAIN
  • m_lpp : CCJHexEdit
  • m_lpszClassName : URuntimeClass
  • m_mainFrame : CWincvsApp
  • m_mainInterpreter : CPython_Interp
  • m_manager : CToolbarCombo, KoIgnoreModel, KoRecursionModel, KoFilterModel
  • m_mapColorFont : CCJTreeCtrl
  • m_mask : KoFilterModel
  • m_match : CUpdateSticky, CCheckout_OPTIONS, KoFilterModel
  • m_Menu : CCustomizeMenus
  • m_menu : CCJFrameWnd, PyMenuMgr
  • m_menuList : CCustomizeMenus, CCJMDIFrameWnd
  • m_MenuList : CCJMenu
  • m_merge : CUpdateMerge
  • m_methods : PyPersistent, PyCmdUI, PyMenuMgr, PyColorConsole, PyCvsEntry
  • m_modalRes : UWidget
  • m_modelColumns : CBrowseFileView
  • m_modname : CImport_MAIN
  • m_modnameCombo : CImport_MAIN
  • m_moduleCombo : CRtag_MAIN, CCheckout_MAIN
  • m_moduleDescStatic : CRtag_MAIN
  • m_moduleName : CRtag_MAIN, CCheckout_MAIN
  • m_msg : UPromptMessage
  • m_nActiveTab : CCJTabView, CCJTabCtrlBar
  • m_name : UCvsGraph
  • m_nBarNumber : CCJToolBar
  • m_nBorder : CCJCaption
  • m_nBoxSize : CCJColorPopup
  • m_nButtons : CCJToolBar
  • m_nChosenColorSel : CCJColorPopup
  • m_nCount : CCJMDIChildWnd
  • m_nCurrentSel : CCJColorPopup
  • m_next : PyRegistry
  • m_nFilenames : CvsFilenames
  • m_nFlags : CCJStatusBarPane
  • m_nHeight : CCJPagerCtrl
  • m_nHiddenCol : CCJFlatSplitterWnd
  • m_nHiddenRow : CCJFlatSplitterWnd
  • m_nID : CCJStatusBarPane, CCJControlBar, CCJBrowseButton, UCmdUI
  • m_nImageID : CContentItems
  • m_nIndex : CCJOutlookBar
  • m_nMargin : CCJColorPopup
  • m_nMaxColWidth : CCJListView, CCJListCtrl
  • m_nMenu : CCJBrowseEdit, CCJBrowseButton
  • m_nMenuID : CCJMenuBar, CCJMDIChildWnd
  • m_nMinColWidth : CCJListView, CCJListCtrl
  • m_nMinSize : CCJListView, CCJListCtrl
  • m_nNextToolTipId : CCJTabCtrlBar
  • m_nNumColors : CCJColorPopup
  • m_nNumColumns : CCJColorPopup
  • m_nNumItems : CCJOutlookBar
  • m_nNumRows : CCJColorPopup
  • m_nObjectSize : URuntimeClass
  • m_node : UCvsGraph
  • m_nodeColor : CGraphOptDlg
  • m_nodes : NotificationManager
  • m_noDispatch : UWidget
  • m_nOffset : CCJFlatHeaderCtrl, CCJCaption
  • m_noModuleProgram : CCommit_OPTIONS
  • m_noRecurs : CTag_MAIN, CRtag_MAIN
  • m_norecurs : CUpdateMain, CLogMain, CDiff_MAIN
  • m_noRecurse : CCommit_OPTIONS, CCheckout_MAIN, CAnnotate_MAIN
  • m_notags : CLogMain
  • m_notify : CWinCvsBrowser::CSelectionChangeNotifier
  • m_nousers : CLogMain
  • m_noWhiteSpace : CDiff_MAIN
  • m_nPaneID : CCJStatusBarPaneControlInfo
  • m_nPointTab : CCJTabCtrlBar
  • m_nPos : CCJTabCtrl, CCJFlatHeaderCtrl, CCJControlBar
  • m_nSelectionMode : CCJColorPicker
  • m_nSortCol : CSortHeaderCtrl, CCJFlatHeaderCtrl
  • m_nSortedCol : CCJListView, CCJListCtrl
  • m_nStyle : CCJStatusBarPane
  • m_nSubMenuIndx : CCJBrowseEdit, CCJBrowseButton
  • m_nToolBarID : CCJMDIChildWnd
  • m_nToolBarIDs : CCJMDIChildWnd
  • m_nullWidth : CCJHexEdit
  • m_numberByPages : CBrowseFileView
  • m_numberOfLines : CBrowseFileView
  • m_numberOfPages : CGraphView, CBrowseFileView
  • m_numbuf : UCvsConsole
  • m_nWidth : CCJPagerCtrl
  • m_o : PyAutoObject< T >
  • m_object : PyPersistent::obj_t, PyCmdUI::obj_t, PyMenuMgr::obj_t, PyColorConsole::obj_t, PyCvsEntry::obj_t
  • m_offAddress : CCJHexEdit
  • m_offAscii : CCJHexEdit
  • m_offHex : CCJHexEdit
  • m_ok : UPromptMessage
  • m_oldname : USaveSettings
  • m_onlyrcs : CLogMain
  • m_optionCheck : COptionalPropertySheet
  • m_optionDescription : CAdminOptionDlg
  • m_options : UAuthen_SSH
  • m_optionString : CAdminOptionDlg
  • m_origBranchColor : CGraphOptDlg
  • m_origDeadNodeColor : CGraphOptDlg
  • m_origHeaderColor : CGraphOptDlg
  • m_origNodeColor : CGraphOptDlg
  • m_origSelColor : CGraphOptDlg
  • m_origShadowColor : CGraphOptDlg
  • m_origTagColor : CGraphOptDlg
  • m_origUserStateNodeColor : CGraphOptDlg
  • m_out : CPyCvsConsole
  • m_overide : UWidget
  • m_overrideCheckoutDir : CCheckout_MAIN
  • m_overwriteExisting : CTag_MAIN, CRtag_MAIN
  • m_overwriteExistingCheck : CTag_MAIN, CRtag_MAIN
  • m_p : CPyThreadState
  • m_pActiveView : CCJTabView, CCJTabCtrlBar
  • m_pageHeight : CGraphView
  • m_PageValues : LPseudoWinAttachment
  • m_Palette : CCJColorPopup
  • m_passwd : GetPassword, CAskYesNo
  • m_path : KoWatcher, CBrowseFileView, UCvsFiles, USaveSettings, CImport_OPTIONS, CGetPrefs_CVSROOT, CCheckout_MAIN, KoColumnContext
  • m_pathToFind : CFindSettings
  • m_pBarInfo : CCJToolBar
  • m_pBrowserApp : CCJHtmlView
  • m_pChildParent : CCJCaptionPopupWnd
  • m_pChildWnd : CCJControlBar, CCJCaptionPopupWnd, CCJCaption
  • m_pContents : CCJOutlookBar
  • m_pControls : CCJToolBar
  • m_pData : CCJHexEdit
  • m_pDropButtons : CCJToolBar
  • m_pEditWnd : CCJBrowseButton
  • m_pen : UDC
  • m_pEndButton : CCJFlatTabCtrl
  • m_pError : CCJMemFile
  • m_pfnCreateObject : URuntimeClass
  • m_pfnGetBaseClass : URuntimeClass
  • m_pFont : CCJFlatButton, CCJCaption
  • m_pHeaderCtrl : CCJListView, CCJListCtrl
  • m_pHomeButton : CCJFlatTabCtrl
  • m_pImageListLarge : CCJOutlookBar
  • m_pImageListSmall : CCJOutlookBar
  • m_pLeftButton : CCJFlatTabCtrl
  • m_pListCtrl : CCJListView, CCJListCtrl
  • m_pMenuBar : CCJMenuBarFrameHook
  • m_pmfarg : CCommit_MAIN
  • m_pname : UAuthen_Pserver
  • m_pNext : CSubclassWnd
  • m_pNextClass : URuntimeClass
  • m_pNextProject : CvsProject
  • m_pNotifyWnd : CCJCaption
  • m_point : CCJOutlookBar
  • m_pOldWndProc : CSubclassWnd
  • m_popToolbarID : CCJTabCtrl, CCJFlatHeaderCtrl, CCJControlBar
  • m_popupMenu : CGfxOutBarCtrl, CCJTabCtrl, CCJMenuBar, CCJFlatHeaderCtrl, CCJControlBar
  • m_popupMenuID : CCJTabCtrl, CCJFlatHeaderCtrl, CCJControlBar
  • m_port : UAuthen_Kserver, UAuthen_Rhosts, UAuthen_Pserver
  • m_pOwner : CCJOutlookBar
  • m_pParent : CProgressDialog, CCJColorPopup
  • m_pParentWnd : CCJFlatHeaderCtrl, CCJColorPicker, CCJCaptionPopupWnd, CCJBrowseButton
  • m_pport : UAuthen_Pserver
  • m_prevCmdCombo : CCmdLine_MAIN
  • m_previewInfo : CCommit_MAIN
  • m_prevLogsCombo : CCommit_MAIN
  • m_pRightButton : CCJFlatTabCtrl
  • m_progress : CProgressDialog
  • m_prompt : GetValue, CCVSAlert
  • m_prune : CGetPrefs_GLOBALS
  • m_pseudo : CPseudoDraw, CPseudoDlg
  • m_pStream : CTipDlg
  • m_pStringMap : CCJToolBar
  • m_pstrItems : USmartCombo
  • m_pTabCtrl : CCJTabView
  • m_ptCurDrag : CCJSizeDockBar, CCJControlBar
  • m_ptCurrent : CCJSizeDockBar
  • m_ptMouse : CCJMenuBar
  • m_pToolTip : CCJTabView
  • m_ptOrig : CCJDockContext
  • m_ptStartDrag : CCJSizeDockBar, CCJControlBar
  • m_pWnd : CWndRedrawMngr, CCJStatusBarPaneControlInfo, CCJSortClass
  • m_pWndPopDown : CCJCaption
  • m_quiet : CGetPrefs_GLOBALS
  • m_radio : CPseudoToggle
  • m_radios : CImportEntry
  • m_rcChild : CCJCaption
  • m_rcClient : CCJCaption
  • m_rcOldPos : CCJToolBar
  • m_rcOldSize : CCJFlatHeaderCtrl
  • m_rcTrack : CCJSizeDockBar, CCJControlBar
  • m_recursion : CMainFrame
  • m_registry : PyPersistent, PyCmdUI, PyMenuMgr, PyColorConsole, PyCvsEntry
  • m_remind : CNoPython
  • m_removebtn : CCustomizeMenus
  • m_rev : CUpdateSticky, CRtag_OPTIONS, CLogFilters, CCommit_OPTIONS, CCheckout_OPTIONS
  • m_rev1 : CUpdateMerge, CDiff_MAIN
  • m_rev1Combo : CUpdateMerge, CDiff_MAIN
  • m_rev2 : CUpdateMerge, CDiff_MAIN
  • m_rev2Combo : CUpdateMerge, CDiff_MAIN
  • m_revCombo : CUpdateSticky, CRtag_OPTIONS, CLogFilters, CCommit_OPTIONS, CCheckout_OPTIONS, CAnnotate_MAIN
  • m_rgbBranch : CGraphOptDlg
  • m_rgbDead : CGraphOptDlg
  • m_rgbHeader : CGraphOptDlg
  • m_rgbNode : CGraphOptDlg
  • m_rgbSelection : CGraphOptDlg
  • m_rgbShadow : CGraphOptDlg
  • m_rgbState : CGraphOptDlg
  • m_rgbTag : CGraphOptDlg
  • m_root : CWinCvsBrowser, TBrowserFill, TBrowserFillDummy, UCvsFolders, TBrowserFill, TBrowserFillDummy
  • m_rsaidentity : UAuthen_SSH
  • m_rsaidentityfile : UAuthen_SSH
  • m_rshname : UAuthen_Rhosts
  • m_rtag : CImport_MAIN
  • m_rtagCombo : CImport_MAIN
  • m_sBuffer : CvsString, CvsFilenames
  • m_section : KoWatcher
  • m_selColor : CGraphOptDlg
  • m_selectcheck : CCJMenu
  • m_selEnd : CCJHexEdit
  • m_selFolder : CCmdLine_MAIN
  • m_selStart : CCJHexEdit
  • m_semaphore : CRecursionLock, USemaphore
  • m_server : CWincvsApp
  • m_servername : UAuthen_Rhosts
  • m_settimer : CCvsStatusBar
  • m_settingName : USaveSettings
  • m_settingsFile : CFindSettings
  • m_shadowColor : CGraphOptDlg
  • m_singeLine : CAdminOptionDlg
  • m_sizeButton : CCJToolBar
  • m_sizeDesired : CCJControlBar
  • m_sizeFloat : CCJControlBar
  • m_sizeHorz : CCJControlBar
  • m_sizeIcon : CCJFlatButton
  • m_sizeImage : CCJToolBar
  • m_sizeNormal : CCJControlBar
  • m_sizeVert : CCJControlBar
  • m_SmallImageList : CCustomizeMenus, CBrowseFileView
  • m_sort : CBrowseFileView, UCvsFiles
  • m_sOuter : CvsTrace
  • m_spin : CGetPrefs_GLOBALS
  • m_sProjectHome : CvsProject
  • m_sProjectName : CvsProject
  • m_stacklock : CDummyInit
  • m_state : CMainFrame, CLogFilters
  • m_stateCombo : CLogFilters
  • m_StateImageList : CBrowseFileView
  • m_stdout : CUpdateMain, CCheckout_MAIN
  • m_step : CCvsStatusBar
  • m_stopable : CProgressDialog
  • m_strCaption : CCJExplorerBar
  • m_strCustomText : CCJColorPopup, CCJColorPicker
  • m_strDefault : CCJListView, CCJListCtrl
  • m_strDefaultText : CCJColorPopup, CCJColorPicker
  • m_strDefExt : CCJBrowseButton
  • m_strDirectory : CReleaseDlg
  • m_strEntry : CCJListView, CCJListCtrl
  • m_strFileName : CCJBrowseButton
  • m_strFilter : CCJBrowseButton
  • m_strFormat : CCJWindowPlacement
  • m_strHours : CCJTimeEdit
  • m_strItemText : CCJSortClass::CSortItem
  • m_strLiteral : CCJMaskEdit
  • m_strLogoText : CCJLogoPane
  • m_strMask : CCJMaskEdit
  • m_strMaskLiteral : CCJMaskEdit
  • m_strMins : CCJTimeEdit
  • m_strRemoveItem : CGfxOutBarCtrl
  • m_strRenameItem : CGfxOutBarCtrl
  • m_strRev : CAnnotate_MAIN
  • m_strSection : CCJWindowPlacement, CCJListView, CCJListCtrl, CCJControlBar
  • m_strSubKey : CCJToolBar
  • m_strText : CCJStatusBarPane
  • m_strTip : CTipDlg
  • m_strTitle : CCJBrowseButton
  • m_strURL : CCJHyperLink
  • m_strValid : CCJMaskEdit
  • m_strValueName : CCJToolBar
  • m_strWindowText : CCJMaskEdit
  • m_strWindText : CCJCaption
  • m_strWndPos : CCJWindowPlacement
  • m_style : UPen
  • m_SubMenus : CCJMenu
  • m_sUsername : CvsProject
  • m_szMenuText : CCJMenuData
  • m_TabCtrl : CCJTabCtrlBar
  • m_TabFont : CCJTabView
  • m_TabImages : CMainFrame
  • m_TabList : CCJFlatTabCtrl
  • m_tabs : UWidget
  • m_TabTipList : CCJFlatTabCtrl
  • m_tagColor : CGraphOptDlg
  • m_tagCombo : CTag_MAIN, CRtag_MAIN
  • m_tagDescStatic : CTag_MAIN, CRtag_MAIN
  • m_tagName : CTag_MAIN, CRtag_MAIN
  • m_tcpip : CGetPrefs_GLOBALS
  • m_tempFile : CEditorMonDlg
  • m_term : CLogoutThread
  • m_text : CToolbarCombo
  • m_texts : CPseudoItem
  • m_timer : CEditorMonDlg
  • m_timers : UWidget
  • m_title : UPromptMessage, CAdminOptionDlg
  • m_tmplPath : CCommit_MAIN
  • m_ToolTip : CCJHyperLink, CCJFlatTabCtrl, CCJControlBar, CCJColorPopup
  • m_tooltips : UWidget
  • m_topfolder : CFindSettings
  • m_topindex : CCJHexEdit
  • m_tracking : CDynToolBar
  • m_TreeCtrl : CExploreBar
  • m_treeCtrl : TBrowserFill, TBrowserFillDummy, TBrowserFill, TBrowserFillDummy
  • m_type : CTag_MAIN, CRtag_OPTIONS, CRtag_MAIN, PyRegistry, CAdminOptionDlg
  • m_uiFilechangeTimer : CBrowseFileView
  • m_uiOpenFlags : CCJMemFile
  • m_unixlf : CGetPrefs_GLOBALS
  • m_unselectcheck : CCJMenu
  • m_upBorder : CGfxSplitterWnd
  • m_upbtn : CCustomizeMenus
  • m_url : CAboutDlg, CNoPython
  • m_useDefIgnore : CImport_OPTIONS
  • m_useFilesTime : CImport_OPTIONS
  • m_useMostRecent : CRtag_OPTIONS
  • m_user : CLogFilters
  • m_userCombo : CLogFilters
  • m_userStateNodeColor : CGraphOptDlg
  • m_v : PyRegistry
  • m_value : CTempToggleBool, GetValue
  • m_vers : CAboutDlg
  • m_versCombo : CGetPrefs_CVSROOT
  • m_view : CWinCvsBrowser::CSelectionChangeNotifier, CBarConsole, KoTraversalContext
  • m_viewer : CGetPrefs_WINCVS
  • m_viewList : CCJTabCtrlBar
  • m_viewPath : CWincvsDoc
  • m_views : CCJTabView
  • m_vtag : CImport_MAIN
  • m_vtagCombo : CImport_MAIN
  • m_warnings : CImportFilterDlg
  • m_wasLocked : CWinCvsBrowser::CSelectionChangeNotifier
  • m_watch : CBrowseFileView
  • m_wid : CMsg, UDC, CPseudoList
  • m_widget : UCmdUI
  • m_widgets : UWidget
  • m_widid : CDynToolBar, UCmdTarget, CPseudoItem, LPseudoWinAttachment, LPseudoDrawAttachment
  • m_width : CColorMenu, UPen
  • m_WindowRect : CCJColorPopup
  • m_winInfo : UToolbar
  • m_wndBrowser : CMainFrame, CCJHtmlView
  • m_wndFilter : CMainFrame
  • m_wndList : CMainFrame
  • m_wndMenuBar : CCJMDIFrameWnd, CCJFrameWnd
  • m_wndMultiUser : CMainFrame
  • m_wndStatusBar : CMainFrame
  • m_wndTags : CMainFrame
  • m_wndToolBar : CMainFrame, UToolbar
  • m_wndWorkspace : CMainFrame
  • m_wordWrap : CCommit_MAIN
  • m_wordWrapCtrl : CCommit_MAIN
  • m_zlevel : CGetPrefs_GLOBALS
  • m_zspin : CGetPrefs_GLOBALS
  • MA_DECLARE_CLASS : TPseudoDoubleNumberText, TPseudoTextListView, TPseudoCustomView, TPseudoWinAdorner, TPseudoWinBehavior, TPseudoAppBehavior, TPseudoIconCheckBox, TPseudoRotateIconButton, TPseudoIconButton, TPseudoIconPopup, TPseudoScrollBar, TBuggyPopup
  • MacBinEncoding() : CvsPrefs
  • MacBinMaps() : MacBinMaps
  • MacLF() : CvsPrefs
  • Magenta : CTCP2Parse
  • MapAccelerator() : CCJToolBarCtrl, CCJToolBar
  • maps : MACBINMAPENTRIES
  • MarkButton() : CCJToolBarCtrl
  • Match() : ReportConflict
  • max : USLIDER
  • MAX_CHAR_BY_LINE : UCvsConsole
  • Maximize() : CCJSizeDockBar, CCJControlBar
  • MaximizeBand() : CCJReBarCtrl
  • maxWarnings : ReportWarning
  • MeasureItem() : CCJOutlookBar, CCJMenu, CCJFontCombo, CColorMenu
  • menuIconNormal : CCJMenuData
  • MenuInputFilter() : CCJMenuBar
  • messageMap : UCvsToolbar, UCvsMenubar, UCvsGraph, UCvsFrame, UCvsFolders, UCvsFiles, UCvsConsole, UCvsApp, USaveSettings, UAuthen_Gserver, UAuthen_Kserver, UAuthen_Rhosts, UAuthen_Pserver, UAuthen_SSH, UEditMessage, UPromptMessage, UWidget, UToolbar, UMenu, UCmdTarget, UMacAppMenu
  • min : USLIDER
  • Minimize() : CCJControlBar
  • MinimizeBand() : CCJReBarCtrl
  • mirc2ctcp() : mircAttrCvt
  • mirc2ctcpmap : mircAttrCvt
  • missing : EntnodeData
  • ModifyCaptionStyle() : CCJCaption
  • ModifyFlag() : CGfxOutBarCtrl
  • ModifyODMenuA() : CCJMenu
  • ModifyODMenuW() : CCJMenu
  • ModifyTabStyle() : CCJTabView, CCJTabCtrlBar
  • Move() : CCJHexEdit
  • MoveBand() : CCJReBarCtrl
  • MoveButton() : CCJToolBarCtrl
  • MoveDockBar() : CCJDockContext
  • MoveRow() : CCJListView, CCJListCtrl
  • MoveTo() : UDC
  • mR : TGraphRectSelect
  • msgSend : CGfxGroupEdit
  • mShiftOn : TGraphRectSelect
  • MulDiv() : URect
  • MultiFiles() : MultiFiles
  • MultiFilesEntry() : MultiFilesEntry
  • mView : TGraphRectSelect, CGraphRectTracker
  • my_read : _CvsProcess
  • my_write : _CvsProcess

- n -
  • name : CMacroEntry, option
  • Navigate() : CCJHtmlView
  • Navigate2() : CCJHtmlView
  • NavigateComplete2() : CCJHtmlView
  • NeedSave() : CPersistent
  • New() : PyPersistent, PyCmdUI, PyMenuMgr, PyColorConsole, PyCvsEntry
  • newdir() : MultiFiles
  • newfile() : MultiFiles
  • NewMenu() : CCJMDIFrameWnd, CCJFrameWnd
  • NewODMenu() : CCJMenu
  • NewRoot() : CHistComboBoxEx
  • next : MultiFiles, DROPDOWNBUTTON, ReportWarning, ReportConflict, DYN_LIST, _frameRec, UTREE_INFO
  • nFlags : CCJMenuData
  • nID : CCJMenuData, CJX_CONTROLPOS
  • nIndex : CJX_CONTROLPOS
  • nMessage : UMSGMAP_ENTRY
  • noConflict : ReportConflict
  • node : CTCLBrowserEnt
  • Node() : NotificationManager::Node
  • None : USmartCombo
  • NORMAL : CCJFlatComboBox
  • Normalize() : CCJSizeDockBar, CCJControlBar
  • NormalizeRect() : URect
  • NormalizeSel() : CCJHexEdit
  • NotificationManager() : NotificationManager
  • NotifyAll() : NotificationManager
  • NotifySelectionChange() : CWinCvsBrowser
  • nSig : UMSGMAP_ENTRY
  • nul_void_ignore : CTCP2Parse::RGBColor
  • numbuf : CStaticAllocT< T >
  • numentries : DYN_LIST
  • NumFiles() : MultiFiles
  • numMaps : MACBINMAPENTRIES
  • NumNodes() : CGraphDoc
  • NumOfElements() : CSortList< T >
  • numToKind() : Authen

- o -
  • observer : NotificationManager::Node
  • Offset() : CWinLogData, UPoint
  • OffsetRect() : URect
  • oldFormat : CColorConsole
  • OnActivate() : CMainFrame
  • OnActivateApp() : CCJColorPopup
  • OnAdd() : CCustomizeMenus
  • OnAlias() : TViewFill, CFillTclEntries, CFillPyEntries, ImportReport, TraversalReport
  • OnAltcvschk() : CGetPrefs_WINCVS
  • OnAltcvssel() : CGetPrefs_WINCVS
  • OnAnyDevice() : LSReport, TraversalReport
  • OnAppAbout() : CWincvsApp
  • OnAppCmdline() : CWincvsDoc
  • OnAppCopyrights() : CWincvsApp
  • OnAppCredits() : CWincvsApp
  • OnAppLogin() : CWincvsDoc
  • OnAppLogout() : CWincvsDoc
  • OnApply() : CGraphOptDlg
  • OnAppPreferences() : CWincvsDoc
  • OnAppRtagBranch() : CWincvsDoc
  • OnAppRtagDelete() : CWincvsDoc
  • OnAppRtagNew() : CWincvsDoc
  • OnBarStyleChange() : CCJToolBar, CCJMenuBar
  • OnBeforeNavigate2() : CCJHtmlView
  • OnBegindrag() : CBrowseFileView
  • OnBegindragMenulist() : CCustomizeMenus
  • OnBeginPrinting() : CWincvsView, CGraphView, CBrowseFileView
  • OnBeginrdrag() : CBrowseFileView
  • OnBranch() : CGraphOptDlg
  • OnBroadcastCmdMsg() : CMainFrame
  • OnBrowserOpen() : CWincvsDoc
  • OnBrowserPopup() : UCvsFrame
  • OnBtnhome() : CGetPrefs_WINCVS
  • OnBtnName() : UAuthen_SSH
  • OnBtnpath() : CImport_OPTIONS
  • OnBtnPath() : CCheckout_MAIN
  • OnBtnRSA() : UAuthen_SSH
  • OnBtnviewer() : CGetPrefs_WINCVS
  • OnButtonClose() : CCJExplorerBar, CCJControlBar
  • OnButtonMinimize() : CCJControlBar
  • OnCancel() : CGraphOptDlg, UPromptMessage
  • OnCaptButton() : CCJCaptionPopupWnd, CCJCaption
  • OnChangedRect() : CGraphRectTracker
  • OnChangeFields() : CGetPrefs_CVSROOT
  • OnChangeHost() : CGetPrefs_CVSROOT
  • OnChangeLogin() : CGetPrefs_CVSROOT
  • OnChangePath() : CGetPrefs_CVSROOT
  • OnChar() : CGfxGroupEdit, CCJMaskEdit, CCJHexEdit, CPseudoToggle
  • OnCheck1() : CDiff_MAIN
  • OnCheck2() : CDiff_MAIN
  • OnCheckdate1() : CUpdateMerge
  • OnCheckdate2() : CUpdateMerge
  • OnCheckName() : UAuthen_SSH
  • OnCheckOptions() : UAuthen_SSH
  • OnCheckOverridecheckoutdir() : CCheckout_MAIN
  • OnCheckpath() : CCmdLine_MAIN
  • OnCheckPort() : UAuthen_Kserver, UAuthen_Rhosts, UAuthen_Pserver
  • OnCheckProxy() : UAuthen_Pserver
  • OnCheckRSA() : UAuthen_SSH
  • OnCheckRshName() : UAuthen_Rhosts
  • OnCheckServerName() : UAuthen_Rhosts
  • OnCheckunixlf() : CGetPrefs_GLOBALS
  • OnChgCursor() : UWidget
  • OnChgFocus() : UWidget
  • OnClicked() : CCJHyperLink, CCJColorPicker, CCJBrowseButton
  • OnClose() : CMainFrame, CLogFrame, CCJMDIFrameWnd, CCJFrameWnd
  • OnCmdAdd() : UCvsFolders, UCvsFiles
  • OnCmdAddb() : UCvsFiles
  • OnCmdCheckout() : UCvsFolders
  • OnCmdCmdline() : UCvsFrame
  • OnCmdCommit() : UCvsFolders, UCvsFiles
  • OnCmdDiff() : UCvsFolders, UCvsFiles
  • OnCmdEdit() : UCvsFolders, UCvsFiles
  • OnCmdEditors() : UCvsFolders, UCvsFiles
  • OnCmdEditsel() : UCvsFiles
  • OnCmdEditseldef() : UCvsFiles
  • OnCmdExplore() : UCvsFolders, UCvsFiles
  • OnCmdGraph() : UCvsFiles
  • OnCmdIgnore() : UCvsFolders, UCvsFiles
  • OnCmdImport() : UCvsFolders
  • OnCmdInit() : UCvsFrame
  • OnCmdLock() : UCvsFolders, UCvsFiles
  • OnCmdLog() : UCvsFolders, UCvsFiles
  • OnCmdLogin() : UCvsFrame
  • OnCmdLogout() : UCvsFrame
  • OnCmdMacroAdmin() : UCvsFrame
  • OnCmdMacrosSel() : UCvsFolders
  • OnCmdMsg() : CLogFrame, CGraphFrame
  • OnCmdPreferences() : UCvsFrame
  • OnCmdQueryUpdate() : UCvsFolders, UCvsFiles
  • OnCmdRelease() : UCvsFolders, UCvsFiles
  • OnCmdReload() : UCvsFolders, UCvsFiles
  • OnCmdRmv() : UCvsFiles
  • OnCmdRtagBranch() : UCvsFrame
  • OnCmdRtagDelete() : UCvsFrame
  • OnCmdRtagNew() : UCvsFrame
  • OnCmdSaveSettings() : UCvsFrame
  • OnCmdStatus() : UCvsFolders, UCvsFiles
  • OnCmdStopcvs() : UCvsFrame
  • OnCmdTagBranch() : UCvsFolders, UCvsFiles
  • OnCmdTagDelete() : UCvsFolders, UCvsFiles
  • OnCmdTagNew() : UCvsFolders, UCvsFiles
  • OnCmdTrash() : UCvsFiles
  • OnCmdUIAdd() : UCvsFolders, UCvsFiles
  • OnCmdUIAddB() : UCvsFiles
  • OnCmdUIAnytime() : UCvsFrame
  • OnCmdUICheckout() : UCvsFolders
  • OnCmdUICvsCmd() : UCvsFrame
  • OnCmdUIEditseldef() : UCvsFiles
  • OnCmdUIExplore() : UCvsFolders, UCvsFiles
  • OnCmdUIGraph() : UCvsFiles
  • OnCmdUIIgnore() : UCvsFolders, UCvsFiles
  • OnCmdUIImport() : UCvsFolders
  • OnCmdUIMacroAdmin() : UCvsFrame
  • OnCmdUIMacroSel() : UCvsFiles
  • OnCmdUIMacrosSel() : UCvsFolders
  • OnCmdUIQuit() : UCvsFrame
  • OnCmdUIRelease() : UCvsFiles
  • OnCmdUIReload() : UCvsFolders, UCvsFiles
  • OnCmdUIRmv() : UCvsFiles
  • OnCmdUIStopcvs() : UCvsFrame
  • OnCmdUITrash() : UCvsFiles
  • OnCmdUIUpdate() : UCvsFolders, UCvsFiles
  • OnCmdUIUpone() : UCvsFiles
  • OnCmdUnedit() : UCvsFolders, UCvsFiles
  • OnCmdUnlock() : UCvsFolders, UCvsFiles
  • OnCmdUpdate() : UCvsFolders, UCvsFiles
  • OnCmdUpone() : UCvsFiles
  • OnCmdWatchers() : UCvsFolders, UCvsFiles
  • OnCmdWatchOff() : UCvsFolders, UCvsFiles
  • OnCmdWatchOn() : UCvsFolders, UCvsFiles
  • OnColumnclick() : CBrowseFileView
  • OnComboAppend() : UWidget
  • OnComboDelSel() : UWidget
  • OnComboEnableSel() : UWidget
  • OnComboGetCount() : UWidget
  • OnComboGetMenu() : UWidget
  • OnComboGetPos() : UWidget
  • OnComboResetAll() : UWidget
  • OnComboSelDir() : UCvsFrame
  • OnComboSetPos() : UWidget
  • OnCommand() : COptionalPropertySheet
  • OnCommands() : UToolbar, UMenu
  • OnCommandStateChange() : CCJHtmlView
  • OnContentChange() : CToolbarCombo
  • OnContextMenu() : CGraphView, CCJHexEdit
  • OnCopyFrom() : USaveSettings
  • OnCopyrights() : UCvsFrame
  • OnCreate() : CSplashWnd, CMainFrame, CBarConsole, CGfxOutBarCtrl, CGfxGroupEdit, CCJToolBarCtrl, CCJTabView, CCJTabCtrlBar, CCJFontCombo, CCJFlatTabCtrl, CCJFlatHeaderCtrl, CCJExplorerBar, CCJControlBar, CCJColorPicker, CCJBrowseEdit, UCvsToolbar, UCvsMenubar, UCvsGraph, UCvsFolders, UCvsFiles, UCvsConsole
  • OnCreateClient() : CLogFrame
  • OnCredits() : UCvsFrame
  • OnCtlColor() : CTipDlg
  • OnCustomDraw() : CCJListView, CCJListCtrl
  • OnCustomize() : CWinCvsBrowser, CBrowseFileView
  • OnDate() : CUpdateSticky, CRtag_OPTIONS, CLogFilters, CCheckout_OPTIONS
  • OnDblClick() : UCvsFiles
  • OnDblclkAllcmds() : CCustomizeMenus
  • OnDblclkListentries() : CImportFilterDlg
  • OnDblclkMenulist() : CCustomizeMenus
  • OnDead() : CGraphOptDlg
  • OnDeleteitem() : CMyShellTree, CBrowseFileView
  • OnDestroy() : CWincvsView, CWinCvsBrowser, CCJToolBar, CCJListView, CCJListCtrl, CCJHtmlView, CCJFontCombo, CCJCaptionPopupWnd, CBrowserBar, CBrowseFileView, UCvsToolbar, UCvsMenubar, UCvsGraph, UCvsFrame, UCvsFolders, UCvsFiles, UCvsConsole, CEditorMonDlg, UToolbar, CDynToolBar
  • OnDiff() : CCommit_MAIN
  • OnDiff1() : CDiff_MAIN
  • OnDiff2() : CDiff_MAIN
  • OnDiff3() : CDiff_MAIN
  • OnDirectory() : TBrowserFill, TBrowserFillDummy, TViewFill, TBrowserFill, TBrowserFillDummy, TViewFill, CFillTclEntries, CFillPyEntries, ImportReport, TraversalReport
  • OnDocumentComplete() : CCJHtmlView
  • OnDown() : CCustomizeMenus
  • OnDownloadBegin() : CCJHtmlView
  • OnDownloadComplete() : CCJHtmlView
  • OnDraw() : CWincvsView, CWinCvsBrowser, CGraphView, CExploreBar, CCJListView, CCJHtmlView, CBrowserBar
  • OnDrawing() : UCvsGraph
  • OnDrawSplitter() : CGfxSplitterWnd, CCJFlatSplitterWnd
  • OnDropdown() : CHistComboBoxEx, CSmartComboBox
  • OnDropDownButton() : CCJToolBar, CDynToolBar
  • OnDropFiles() : CWincvsView, CMainFrame
  • OnEditchangeComboroot() : CGetPrefs_CVSROOT
  • OnEditClear() : CCJHexEdit
  • OnEditClearAll() : CWincvsView
  • OnEditCopy() : CCJHexEdit
  • OnEditCut() : CCJHexEdit
  • OnEditentry() : CImportFilterDlg
  • OnEditPaste() : CCJHexEdit
  • OnEditSelectAll() : CCJHexEdit, CBrowseFileView
  • OnEditUndo() : CCJHexEdit
  • OnEditUpdate() : CCJFlatComboBox
  • OnEnable() : CCJBrowseEdit
  • OnEnableCmd() : UWidget
  • OnEndArrow() : CCJFlatTabCtrl
  • OnEndLabelEdit() : CGfxOutBarCtrl
  • OnEndPrinting() : CWincvsView, CGraphView
  • OnEraseBkgnd() : CGfxSplitterWnd, CGfxOutBarCtrl, CCJTreeCtrl, CCJToolBar, CCJTabView, CCJTabCtrl, CCJReBar, CCJOutlookBar, CCJMetaFileButton, CCJMDIChildWnd, CCJMaskEdit, CCJListView, CCJListCtrl, CCJListBox, CCJHtmlView, CCJHexEdit, CCJFontCombo, CCJFlatHeaderCtrl, CCJFlatComboBox, CCJFlatButton, CCJExplorerBar, CCJControlBar, CCJColorPopup, CCJColorPicker, CCJCaption, CCommit_MAIN
  • OnError() : TBrowserFill, TBrowserFillDummy, TViewFill, TBrowserFill, TBrowserFillDummy, TViewFill, LSReport, CFillTclEntries, CFillPyEntries, CFindSettings, MacroTraversal, ImportReport, TraversalReport
  • OnExtdiff() : CGetPrefs_WINCVS, CDiff_MAIN
  • OnExtdiffsel() : CGetPrefs_WINCVS
  • OnFetchCmd() : UWidget
  • OnFile() : TViewFill, CFillTclEntries, CFillPyEntries, CFindSettings, MacroTraversal, ImportReport, TraversalReport
  • OnFileChange() : CBrowseFileView
  • OnFileNew() : CWincvsApp
  • OnFilePrint() : CCJHtmlView
  • OnFiles() : KoAnnotateHandler, KoQueryUpdateHandler, KoUpdateHandler, KoCommitHandler, KoAddUnicodeHandler, KoAddBinaryHandler, KoAddHandler, KoUnlockHandler, KoLockHandler, KoFileRemoveHandler, KoStatusHandler, KoGraphHandler, KoLogHandler, KoDiffHandler, KoWatchOffHandler, KoWatchOnHandler, KoEditorsHandler, KoWatchersHandler, KoReleaseHandler, KoUneditHandler, KoForceEditHandler, KoReservedEditHandler, KoEditHandler, KoBranchTagHandler, KoDeleteTagHandler, KoCreateTagHandler, KoUpdateMoveToTrashHandler, KoMoveToTrashHandler, KiSelectionHandler
  • OnFilteringChanged() : CBrowseFileView
  • OnFilterMaskEntered() : CMainFrame
  • OnFolder() : KoAnnotateHandler, KoQueryUpdateHandler, KoUpdateHandler, KoCommitHandler, KoAddUnicodeHandler, KoAddBinaryHandler, KoAddHandler, KoUnlockHandler, KoLockHandler, KoFileRemoveHandler, KoStatusHandler, KoGraphHandler, KoLogHandler, KoDiffHandler, KoWatchOffHandler, KoWatchOnHandler, KoEditorsHandler, KoWatchersHandler, KoReleaseHandler, KoUneditHandler, KoForceEditHandler, KoReservedEditHandler, KoEditHandler, KoBranchTagHandler, KoDeleteTagHandler, KoCreateTagHandler, KoUpdateMoveToTrashHandler, KoMoveToTrashHandler, KiSelectionHandler
  • OnForcerevision() : CCommit_OPTIONS
  • OnFullScreen() : CCJHtmlView
  • OnGetDlgCode() : CWincvsView, CCJHexEdit
  • OnGetEnv() : AuthenModel, AuthenGserver, AuthenNtserver, AuthenKserver, AuthenRhosts, AuthenPserver, AuthenSSH
  • OnGetFloat() : UWidget
  • OnGetLoc() : UWidget
  • OnGetSliderProperty() : UWidget
  • OnGetState() : UWidget
  • OnGetText() : UWidget
  • OnGfxLargeicon() : CGfxOutBarCtrl
  • OnGfxRemoveitem() : CGfxOutBarCtrl
  • OnGfxRenameitem() : CGfxOutBarCtrl
  • OnGfxSmallicon() : CGfxOutBarCtrl
  • OnGraphChangelogmessage() : CGraphView
  • OnGraphGraphoptions() : CGraphView
  • OnGraphSetdescription() : CGraphView
  • OnGraphSetstate() : CGraphView
  • OnHeader() : CGraphOptDlg
  • OnHeightChange() : CCJReBar
  • OnHelpCvs() : CWincvsApp
  • OnHelpCvsclient() : CWincvsApp
  • OnHistorySelect() : CMainFrame
  • OnHomeArrow() : CCJFlatTabCtrl
  • OnHScroll() : CCJHexEdit
  • OnIdle() : TBrowserFill, TBrowserFillDummy, TViewFill, TBrowserFill, TBrowserFillDummy, TViewFill, LSReport, CFillTclEntries, CFillPyEntries, ImportReport, TraversalReport
  • OnIgnoreChanged() : CWinCvsBrowser
  • OnInitDialog() : CAboutDlg, CTipDlg, CProgressDialog, CNoPython, CCustomizeMenus, CTag_MAIN, CRtag_OPTIONS, CRtag_MAIN, COptionalPropertySheet, CCmdLine_MAIN, CImportFilterDlg, CGetPrefs_GLOBALS, GetPassword, CEditorMonDlg, CCommit_MAIN, CAdminOptionDlg, CPseudoDlg
  • OnInitialUpdate() : CWincvsView, CWinCvsBrowser, CGraphView, CCJListView, CBrowseFileView
  • OnInitMenu() : CMainFrame
  • OnInitMenuPopup() : CGraphView, CCJTabCtrl, CCJMDIFrameWnd, CCJFrameWnd, CCJFlatHeaderCtrl, CCJControlBar
  • OnInitTabWidget() : UWidget
  • OnInitWidget() : UWidget
  • OnInvalidate() : UWidget
  • OnInvertTracker() : CGfxSplitterWnd, CCJSizeDockBar, CCJControlBar
  • OnIsdate() : CAnnotate_MAIN
  • OnItemchangedAllcmds() : CCustomizeMenus
  • OnItemchangedMenulist() : CCustomizeMenus
  • OnItemexpanding() : CWinCvsBrowser, CMyShellTree
  • OnKeydown() : CBrowseFileView
  • OnKeyDown() : CWincvsView, CCJMaskEdit, CCJHexEdit, CCJColorPopup, CPseudoToggle
  • OnKillFocus() : CGfxGroupEdit, CCJHexEdit, CCJFlatComboBox, CCJColorPopup
  • OnLauncheditor() : CCommit_MAIN
  • OnLButtonDblClk() : CCJMetaFileButton, CCJHexEdit, CCJFlatButton, CBrowseFileView, CPseudoList
  • OnLButtonDown() : CGraphView, CGfxOutBarCtrl, CCJTreeCtrl, CCJOutlookBar, CCJMenuBar, CCJHexEdit, CCJFlatTabCtrl, CCJFlatComboBox, CCJFlatButton, CCJExplorerBar, CCJControlBar, CBrowseFileView
  • OnLButtonUp() : CCJSizeDockBar, CCJOutlookBar, CCJHexEdit, CCJFlatComboBox, CCJFlatButton, CCJExplorerBar, CCJControlBar, CCJColorPopup, CPseudoToggle
  • OnLeftArrow() : CCJFlatTabCtrl
  • OnListAddColumns() : UWidget
  • OnListAddSel() : UWidget
  • OnListDelRow() : UWidget
  • OnListGetInfo() : UWidget
  • OnListGetNext() : UWidget
  • OnListGetNextSel() : UWidget
  • OnListInsert() : UWidget
  • OnListNewRow() : UWidget
  • OnListResetAll() : UWidget
  • OnListResort() : UWidget
  • OnListRowGetData() : UWidget
  • OnListRowSetData() : UWidget
  • OnListSetColTitle() : UWidget
  • OnListSetColWidth() : UWidget
  • OnListSetFeedback() : UWidget
  • OnLogout() : CGetPrefs_GLOBALS
  • OnLogWindowIsPresent() : CWincvsApp
  • OnMacro() : CWinCvsBrowser, CBrowseFileView
  • OnMacroAdmin() : CWincvsDoc
  • OnMacroSel() : UCvsFiles
  • OnMainTimer() : UCvsApp
  • OnMeasureItem() : CCJTabCtrl, CCJMDIFrameWnd, CCJFrameWnd, CCJFlatHeaderCtrl, CCJControlBar
  • OnMenuBar() : CCJHtmlView
  • OnMenuChar() : CCJTabCtrl, CCJMDIFrameWnd, CCJFrameWnd, CCJFlatHeaderCtrl, CCJControlBar
  • OnMenuInput() : CCJMenuBar
  • OnMenuSelect() : CCJMenuBar
  • OnMerge() : CUpdateMerge
  • OnMerge1() : CUpdateMerge
  • OnMerge2() : CUpdateMerge
  • OnMouseMove() : CGfxOutBarCtrl, CCJSizeDockBar, CCJOutlookBar, CCJMenuBar, CCJHyperLink, CCJHexEdit, CCJFlatComboBox, CCJFlatButton, CCJControlBar, CCJColorPopup
  • OnMove() : CCustomizeMenus
  • OnMyFormatFont() : CWincvsView
  • OnNavigateComplete2() : CCJHtmlView
  • OnNcCalcSize() : CCJToolBar, CCJSizeDockBar, CCJReBar
  • OnNcCreate() : CCJToolBar, CCJReBar
  • OnNcDestroy() : CCJColorPopup
  • OnNcHitTest() : CCJToolBar, CCJSizeDockBar, CCJControlBar
  • OnNcLButtonDblClk() : CCJMiniDockFrameWnd
  • OnNcLButtonDown() : CCJSizeDockBar, CCJMiniDockFrameWnd
  • OnNcPaint() : CCJToolBar, CCJSizeDockBar, CCJReBar, CCJControlBar
  • OnNewDocument() : CWincvsDoc, CGraphDoc
  • OnNewWindow2() : CCJHtmlView
  • OnNextTip() : CTipDlg
  • OnNode() : CGraphOptDlg
  • OnNotify() : CCJListView, CCJListCtrl
  • OnOK() : CTipDlg, CProgressDialog, CCustomizeMenus, CGraphOptDlg, UPromptMessage
  • OnPageChanged() : UWidget
  • OnPagerCalcSize() : CCJPagerCtrl
  • OnPagerScroll() : CCJPagerCtrl
  • OnPaint() : CTipDlg, CSplashWnd, CColorStatic, CGfxSplitterWnd, CGfxOutBarCtrl, CCJTreeCtrl, CCJToolBarBase, CCJToolBar, CCJTabCtrl, CCJReBar, CCJOutlookBar, CCJMetaFileButton, CCJMaskEdit, CCJLogoPane, CCJListCtrl, CCJListBox, CCJHtmlView, CCJHexEdit, CCJFontCombo, CCJFlatTabCtrl, CCJFlatSplitterWnd, CCJFlatHeaderCtrl, CCJFlatComboBox, CCJFlatButton, CCJControlBar, CCJColorPopup, CCJColorPicker, CCJCaptionPopupWnd, CCJCaption, CBrowserBar, CPseudoDraw
  • OnPaletteChanged() : CCJColorPopup
  • OnPreparePrinting() : CWincvsView, CGraphView, CBrowseFileView
  • OnPreserveZeroBorderHelper() : CCJToolBar
  • OnPrint() : CGraphView, CBrowseFileView
  • OnProgressChange() : CCJHtmlView
  • OnPropertyChange() : CCJHtmlView
  • OnPushPinButton() : CCJCaption
  • OnPushPinCancel() : CCJCaption
  • OnQueryAnnotate() : CGraphView, CBrowseFileView
  • OnQueryNewPalette() : CCJColorPopup
  • OnQuit() : CCJHtmlView, UCvsFrame
  • OnRButtonDown() : CWincvsView, CWinCvsBrowser, CGfxOutBarCtrl, CCJToolBar, CCJTabCtrl, CCJFlatHeaderCtrl, CCJControlBar, CBrowseFileView
  • OnRclick() : CMyShellTree
  • OnRecalcParent() : CCJReBar
  • OnRedraw() : UWidget
  • OnRemove() : CCustomizeMenus
  • OnReset() : CGraphOptDlg
  • OnResetView() : CWinCvsBrowser, CBrowseFileView
  • OnRestoreEnv() : AuthenModel, AuthenRhosts, AuthenPserver, AuthenSSH
  • OnRev() : CUpdateSticky, CRtag_OPTIONS, CLogFilters, CCheckout_OPTIONS
  • OnRightArrow() : CCJFlatTabCtrl
  • OnSavesettings() : CWincvsDoc
  • OnSelChange() : CCJColorPicker
  • OnSelchange() : CCJTabView
  • OnSelchangeAuthen() : CGetPrefs_CVSROOT
  • OnSelchangeCombo() : CCommit_MAIN
  • OnSelchangeComboroot() : CGetPrefs_CVSROOT
  • OnSelchanged() : CWinCvsBrowser, CMyShellTree
  • OnSelchangeFiletodiff() : CCommit_MAIN
  • OnSelchangePrevcmd() : CCmdLine_MAIN
  • OnSelchanging() : CWinCvsBrowser
  • OnSelColumn() : UCvsFiles
  • OnSelection() : CGraphOptDlg
  • OnSelEndCancel() : CCJColorPicker
  • OnSelendcancel() : CToolbarCombo
  • OnSelEndOK() : CCJColorPicker
  • OnSelendok() : CToolbarCombo
  • OnSelfolder() : CCmdLine_MAIN
  • OnSetBitmapSize() : CCJToolBar
  • OnSetButtonSize() : CCJToolBar
  • OnSetCursor() : CWinCvsBrowser, CGfxOutBarCtrl, CCJSizeDockBar, CCJHyperLink, CCJFlatButton, CCJControlBar, CBrowseFileView
  • OnSetFeature() : CSmartComboBox
  • OnSetFloat() : UWidget
  • OnSetFocus() : CWincvsView, CCJHexEdit, CCJFlatComboBox
  • OnSetfocusCmdline() : CCmdLine_MAIN
  • OnSetItems() : CSmartComboBox
  • OnSetLoc() : UWidget
  • OnSetReadOnly() : CSmartComboBox
  • OnSetSizeHelper() : CCJToolBar
  • OnSetSlider() : UWidget
  • OnSetSliderProperty() : UWidget
  • OnSetState() : UWidget
  • OnSetText() : UWidget
  • OnSettings() : CGetPrefs_CVSROOT
  • OnSetTooltip() : UWidget, UToolbar
  • OnSetupEnv() : AuthenModel, AuthenRhosts, AuthenPserver, AuthenSSH
  • OnShadow() : CGraphOptDlg
  • OnShowBand() : CCJReBar
  • OnShowWidget() : UWidget
  • OnShowWindow() : CCJBrowseEdit
  • OnSize() : CWincvsView, CGfxOutBarCtrl, CCJStatusBar, CCJMenuBar, CCJHtmlView, CCJFlatTabCtrl, CCJCaption
  • OnSmartComboSetFeature() : UWidget
  • OnSmartComboSetItems() : UWidget
  • OnSmartComboSetReadOnly() : UWidget
  • OnSpecifyRev() : CAnnotate_MAIN
  • OnState() : CLogFilters, CGraphOptDlg
  • OnStatusBar() : CCJHtmlView
  • OnStatusTextChange() : CCJHtmlView
  • OnStopcvs() : CWincvsDoc
  • OnSysColorChange() : CGfxOutBarCtrl, CCJToolBar, CCJOutlookBar, CCJFlatComboBox, CCJFlatButton, CCJCaption, CCJCaptionButton
  • OnSysCommand() : CMainFrame
  • OnTabSelChange() : CCJTabCtrlBar
  • OnTag() : CGraphOptDlg
  • OnTbButton() : UToolbar
  • OnTbCheckBtn() : UToolbar
  • OnTbDropDown() : UToolbar
  • OnTbEnd() : UToolbar
  • OnTbInit() : UToolbar
  • OnTbSeparator() : UToolbar
  • OnTcpip() : CGetPrefs_GLOBALS
  • OnTemplate() : CCommit_MAIN
  • OnTheaterMode() : CCJHtmlView
  • OnTimer() : CSplashWnd, CMainFrame, CCvsStatusBar, CGfxOutBarCtrl, CCJOutlookBar, CCJFlatComboBox, CCJFlatButton, CCJCaptionPopupWnd, CBrowseFileView, CEditorMonDlg
  • OnTitleChange() : CCJHtmlView
  • OnToolBar() : CCJHtmlView
  • OnToolBarBeginAdjust() : CCJToolBar
  • OnToolBarBeginDrag() : CCJToolBar
  • OnToolBarBtnDropDown() : CCJToolBar
  • OnToolBarChange() : CCJToolBar
  • OnToolBarCustomHelp() : CCJToolBar
  • OnToolBarEndAdjust() : CCJToolBar
  • OnToolBarEndDrag() : CCJToolBar
  • OnToolBarGetButtonInfo() : CCJToolBar
  • OnToolBarQueryDelete() : CCJToolBar
  • OnToolBarQueryInsert() : CCJToolBar
  • OnToolBarReset() : CCJToolBar
  • OnToolHitTest() : CCJToolBar, CCJReBar
  • OnTreeDelete() : UWidget
  • OnTreeExpand() : UWidget
  • OnTreeExpanding() : UCvsFolders
  • OnTreeGetInfo() : UWidget
  • OnTreeGetSel() : UWidget
  • OnTreeInsert() : UWidget
  • OnTreeResetAll() : UWidget
  • OnTreeSelect() : UWidget
  • OnTreeSelecting() : UCvsFolders
  • OnTreeSetData() : UWidget
  • OnTreeSetIcon() : UWidget
  • OnUp() : CCustomizeMenus
  • OnUpdateButtonClose() : CCJExplorerBar, CCJControlBar
  • OnUpdateButtonMinimize() : CCJControlBar
  • OnUpdateCmd() : CWinCvsBrowser, CExploreBar
  • OnUpdateCmdUI() : CCJToolBar, CCJReBar, CCJControlBar
  • OnUpdateCustomize() : CWinCvsBrowser, CBrowseFileView
  • OnUpdateCvsCmd() : CWincvsDoc
  • OnUpdateFilterMask() : CMainFrame
  • OnUpdateFocus() : UWidget
  • OnUpdateGeneric() : UCvsFolders
  • OnUpdateGfxLargeicon() : CGfxOutBarCtrl
  • OnUpdateGfxRemoveitem() : CGfxOutBarCtrl
  • OnUpdateGfxRenameitem() : CGfxOutBarCtrl
  • OnUpdateGfxSmallicon() : CGfxOutBarCtrl
  • OnUpdateGraphChangelogmessage() : CGraphView
  • OnUpdateGraphSetdescription() : CGraphView
  • OnUpdateGraphSetstate() : CGraphView
  • OnUpdateHistory() : CMainFrame
  • OnUpdateMacro() : CWinCvsBrowser, CBrowseFileView
  • OnUpdateMacroAdmin() : CWincvsDoc
  • OnUpdateMenuButton() : CCJMenuBar
  • OnUpdatePrefs() : CWincvsDoc
  • OnUpdateQueryAnnotate() : CGraphView, CBrowseFileView
  • OnUpdateSavesettings() : CWincvsDoc
  • OnUpdateStopcvs() : CWincvsDoc
  • OnUpdateUI() : UWidget, UToolbar, UMenu, UMacAppMenu
  • OnUpdateUsePyshell() : CWincvsDoc
  • OnUpdateUseTclshell() : CWincvsDoc
  • OnUpdateViewAdd() : CWinCvsBrowser, CBrowseFileView
  • OnUpdateViewAddB() : CBrowseFileView
  • OnUpdateViewAdded() : CMainFrame
  • OnUpdateViewChanged() : CMainFrame
  • OnUpdateViewCheckout() : CWinCvsBrowser, CExploreBar, CBrowseFileView
  • OnUpdateViewConflict() : CMainFrame
  • OnUpdateViewDelrev() : CGraphView
  • OnUpdateViewDiff() : CGraphView
  • OnUpdateViewEditseldef() : CBrowseFileView
  • OnUpdateViewExplore() : CWinCvsBrowser, CBrowseFileView
  • OnUpdateViewFullRowDetails() : CBrowseFileView
  • OnUpdateViewGraph() : CBrowseFileView
  • OnUpdateViewHideunknown() : CMainFrame
  • OnUpdateViewIgnore() : CMainFrame
  • OnUpdateViewImport() : CWinCvsBrowser, CExploreBar, CBrowseFileView
  • OnUpdateViewList() : CBrowseFileView
  • OnUpdateViewMissing() : CMainFrame
  • OnUpdateViewModified() : CMainFrame
  • OnUpdateViewRecursive() : CMainFrame
  • OnUpdateViewRelease() : CBrowseFileView
  • OnUpdateViewReload() : CWinCvsBrowser, CGraphView, CBrowseFileView
  • OnUpdateViewRemoved() : CMainFrame
  • OnUpdateViewRetrieve() : CGraphView
  • OnUpdateViewRmv() : CBrowseFileView
  • OnUpdateViewSelnonsig() : CGraphView
  • OnUpdateViewSmallIcons() : CBrowseFileView
  • OnUpdateViewTag() : CGraphView
  • OnUpdateViewTrash() : CBrowseFileView
  • OnUpdateViewUnknown() : CMainFrame
  • OnUpdateViewUnlockf() : CGraphView
  • OnUpdateViewUpdate() : CWinCvsBrowser, CGraphView, CBrowseFileView
  • OnUpdateViewUpone() : CBrowseFileView
  • OnUsePyshell() : CWincvsDoc
  • OnUser() : CLogFilters
  • OnUseTclshell() : CWincvsDoc
  • OnViewAdd() : CWinCvsBrowser, CBrowseFileView
  • OnViewAddb() : CBrowseFileView
  • OnViewAdded() : CMainFrame
  • OnViewAddu() : CBrowseFileView
  • OnViewBrowselocationRemoveunwanted() : CWincvsDoc
  • OnViewChanged() : CMainFrame
  • OnViewCheckout() : CWinCvsBrowser, CExploreBar, CBrowseFileView
  • OnViewCommit() : CWinCvsBrowser, CBrowseFileView
  • OnViewConflict() : CMainFrame
  • OnViewDelrev() : CGraphView
  • OnViewDiff() : CWinCvsBrowser, CGraphView, CBrowseFileView
  • OnViewEdit() : CWinCvsBrowser, CBrowseFileView
  • OnViewEditors() : CWinCvsBrowser, CBrowseFileView
  • OnViewEditsel() : CBrowseFileView
  • OnViewEditseldef() : CBrowseFileView
  • OnViewExplore() : CWinCvsBrowser, CBrowseFileView
  • OnViewForceedit() : CWinCvsBrowser, CBrowseFileView
  • OnViewFullRowDetails() : CBrowseFileView
  • OnViewGraph() : CBrowseFileView
  • OnViewHideunknown() : CMainFrame
  • OnViewIgnore() : CMainFrame
  • OnViewImport() : CWinCvsBrowser, CExploreBar, CBrowseFileView
  • OnViewInit() : CWincvsDoc
  • OnViewList() : CBrowseFileView
  • OnViewLog() : CWinCvsBrowser, CBrowseFileView
  • OnViewMissing() : CMainFrame
  • OnViewModified() : CMainFrame
  • OnViewPathChanged() : CWincvsDoc
  • OnViewQueryUpdate() : CWinCvsBrowser, CBrowseFileView
  • OnViewRecursive() : CMainFrame
  • OnViewRelease() : CWinCvsBrowser, CBrowseFileView
  • OnViewReload() : CWinCvsBrowser, CGraphView, CBrowseFileView
  • OnViewRemoved() : CMainFrame
  • OnViewReservededit() : CWinCvsBrowser, CBrowseFileView
  • OnViewRetrieve() : CGraphView
  • OnViewRmv() : CBrowseFileView
  • OnViewSelnonsig() : CGraphView
  • OnViewSmallIcons() : CBrowseFileView
  • OnViewStatus() : CWinCvsBrowser, CBrowseFileView
  • OnViewTag() : CGraphView
  • OnViewTagBranch() : CWinCvsBrowser, CBrowseFileView
  • OnViewTagDelete() : CWinCvsBrowser, CBrowseFileView
  • OnViewTagNew() : CWinCvsBrowser, CBrowseFileView
  • OnViewTrash() : CBrowseFileView
  • OnViewUnedit() : CWinCvsBrowser, CBrowseFileView
  • OnViewUnknown() : CMainFrame
  • OnViewUnlock() : CWinCvsBrowser, CBrowseFileView
  • OnViewUnlockf() : CGraphView
  • OnViewUpdate() : CWinCvsBrowser, CGraphView, CBrowseFileView
  • OnViewUpone() : CBrowseFileView
  • OnViewWatchers() : CWinCvsBrowser, CBrowseFileView
  • OnViewWatchOff() : CWinCvsBrowser, CBrowseFileView
  • OnViewWatchOn() : CWinCvsBrowser, CBrowseFileView
  • OnVisible() : CCJHtmlView
  • OnVScroll() : CCJHexEdit
  • OnWindowPosChanged() : CExploreBar, CCJToolBar, CCJTabView, CCJTabCtrlBar, CCJFlatHeaderCtrl, CCJExplorerBar, CCJControlBar, CBrowserBar
  • OnWindowPosChanging() : CCJToolBarBase, CCJToolBar
  • OnWordwrap() : CCommit_MAIN
  • Open() : CCJMemFile
  • open : _CvsProcess
  • OpenProject() : CvsCoworker, ICvsCoworker
  • openProject() : CvsProject
  • operator &() : URect
  • operator &=() : URect
  • operator char *() : CBuffer, PCStr, PCPStr, UStr, UPStr
  • operator CHARFORMAT &() : CCharFormat
  • operator const bool &() : CPersistentBool
  • operator const char *() : CvsString, CvsPrefs, PCStr, PCPStr, UStr, UPStr
  • operator const int &() : CPersistentInt
  • operator const T &() : CPersistentT< T >
  • operator const T *() : CStaticAllocT< T >
  • operator const unsigned char *() : CvsPrefs, PCPStr, UPStr
  • operator const URECT *() : URect
  • operator CRect() : URect
  • operator EntnodeData *() : PyCvsEntry, ENTNODE
  • operator HBITMAP() : aref
  • operator PyThreadState *() : CPython_Interp
  • operator T *() : PyAutoObject< T >, CStaticAllocT< T >
  • operator Tcl_Interp *() : CTcl_Interp
  • operator UMENU() : PyMenuMgr
  • operator unsigned char *() : PCPStr, UPStr
  • operator URECT *() : URect
  • operator!=() : UStr, URect, UPoint, USize
  • operator+() : CvsString, URect, UPoint, USize
  • operator+=() : CvsString, CCJMemFile, URect, UPoint, USize
  • operator-() : URect, UPoint, USize
  • operator-=() : URect, UPoint, USize
  • operator->() : PyAutoObject< T >, CPersistentInt, CPersistentBool, CPersistentT< T >
  • operator<() : CMacroEntry, UStr
  • operator<<() : CColorConsole, UStr, UPStr
  • operator=() : CWinPlacement, CvsString, CCJStatusBarPane, CContentItems, CCJMemFile, CTCLBrowserEnt, PyAutoObject< T >, CPersistentInt, CPersistentBool, CPersistentT< T >, MultiFilesEntry, FileEntry, CMacroEntry, MacBinMaps, CMacBinItem, CMacBinTable, CvsPrefs, ENTNODE, PCStr, PCPStr, NotificationManager::Node, UTimer, awidget, aref, UStr, UPStr, CMsg, URect, CPseudoItem
  • operator==() : CvsString, CPersistentInt, CPersistentBool, CPersistentT< T >, CMacroEntry, UStr, URect, UPoint, USize
  • operator>() : UStr
  • operator[]() : CvsString, CCJMemFile, EntnodeFolder, EntnodeFile, EntnodeData
  • operator|() : URect
  • operator|=() : URect
  • option : EntnodeFile
  • out : UCvsConsole
  • OutColor() : CWincvsView, UCvsConsole
  • OutConsole() : CWincvsView, UCvsConsole
  • outEnabled : UPseudoCmdStatusWrapper
  • outMark : UPseudoCmdStatusWrapper
  • outName : UPseudoCmdStatusWrapper
  • outUsesMark : UPseudoCmdStatusWrapper
  • overCnt : CTCP2Parse
  • OverideMapWidget() : UWidget
  • OverkillAssert() : CCJTabCtrlBar
  • overLast : CTCP2Parse

- p -
  • p_str() : UPStr
  • Pad : _MIDL_PROC_FORMAT_STRING, _MIDL_TYPE_FORMAT_STRING
  • PaintItems() : CGfxOutBarCtrl
  • param() : ansiAttrCvt::AnsiSeq
  • paramc() : ansiAttrCvt::AnsiSeq
  • parent : UTREE_INFO, UTREE_INSERT
  • parse_cvsroot() : Authen
  • ParseIt() : CTCP2Parse
  • path : CMacroEntry
  • pattern : ReportConflict
  • pBaseMap : UMSGMAP
  • pBlackPen : CGfxOutBarCtrl
  • pChild : CGfxOutBarCtrl::CBarFolder
  • pCmdUI : UCmdUI
  • PCPStr() : PCPStr
  • PCStr() : PCStr
  • PeekPumpAndIdle() : CWincvsApp
  • pfn : UMSGMAP_ENTRY, UMessageMapFunctions
  • pfni_i : UMessageMapFunctions
  • pfni_ii : UMessageMapFunctions
  • pfni_iVP : UMessageMapFunctions
  • pfni_V : UMessageMapFunctions
  • pfni_VP : UMessageMapFunctions
  • pfnV_i : UMessageMapFunctions
  • pfnV_ii : UMessageMapFunctions
  • pfnV_iii : UMessageMapFunctions
  • pfnV_iiVP : UMessageMapFunctions
  • pfnV_iVP : UMessageMapFunctions
  • pfnV_V : UMessageMapFunctions
  • pfnV_VP : UMessageMapFunctions
  • pid : _CvsProcess
  • placement : CWinPlacement
  • plainBin : MACBINMAP
  • pLargeImageList : CGfxOutBarCtrl, CGfxOutBarCtrl::CBarFolder
  • pNMHDR : UCmdUI
  • PointInRect() : CCJFlatComboBox
  • pool : poolRec
  • pools : garbyRec
  • pos : MultiFiles, ansiAttrCvt, USLIDER
  • PositionControls() : CCJStatusBar
  • PositionWindow() : CCJHyperLink
  • PostNcDestroy() : CSplashWnd, CProgressDialog, CGfxGroupEdit
  • PreCreateWindow() : CWincvsView, CWinCvsBrowser, CMainFrame, CCJTreeCtrl, CCJToolBar, CCJMDIFrameWnd, CCJHexEdit, CCJFrameWnd, CCJFlatTabCtrl, CBrowseFileView
  • PrepareNew() : CGraphDoc
  • PressButton() : CCJToolBar
  • PRESSED : CCJFlatComboBox
  • PreSubclassWindow() : CCJHyperLink, CCJFontCombo, CCJFlatHeaderCtrl, CCJColorPicker, CCJBrowseEdit, CSmartComboBox
  • PreTranslateAppMessage() : CSplashWnd
  • PreTranslateMessage() : CWincvsApp, CTbEdit, CLogFrame, CHistComboBoxEx, CGfxGroupEdit, CCJTabCtrlBar, CCJHyperLink, CCJFrameWnd, CCJFlatTabCtrl, CCJFlatComboBox, CCJControlBar, CCJColorPopup, CSmartComboBox, CCmdLine_MAIN, CCommit_MAIN
  • Print() : PyColorConsole
  • print() : CvsArgs
  • PrintOut() : ReportWarning, ReportConflict
  • ProcessMask() : CCJTimeEdit, CCJDateEdit, CCJMaskEdit
  • ProcessSelectionCommand() : CBrowseFileView
  • PromptForColor() : CGraphOptDlg
  • Proportional : CTCP2Parse
  • ProxyHost() : CvsPrefs
  • ProxyPort() : CvsPrefs
  • PruneOption() : CvsPrefs
  • PserverPort() : CvsPrefs
  • pSmallImageList : CGfxOutBarCtrl, CGfxOutBarCtrl::CBarFolder
  • pstderr : _CvsProcess
  • pstdin : _CvsProcess
  • pstdout : _CvsProcess
  • PtInRect() : URect
  • push_back() : CTmpFiles
  • PushBackgroundColor() : CTCP2Parse
  • PushBlink() : CTCP2Parse
  • PushBold() : CTCP2Parse
  • PushEncoding() : CTCP2Parse
  • PushFontSize() : CTCP2Parse
  • PushForegroundColor() : CTCP2Parse
  • PushItalic() : CTCP2Parse
  • PushOut() : CTCP2Parse
  • PushOverstrike() : CTCP2Parse
  • PushReverse() : CTCP2Parse
  • PushSpacing() : CTCP2Parse
  • PushStart() : CTCP2Parse
  • PushTextSegment() : CTCP2Parse
  • PushUnderline() : CTCP2Parse
  • PushURL() : CTCP2Parse
  • PutProperty() : CCJHtmlView
  • pWnd : tagCTV_ITEM, tagTCB_ITEM
  • PyAutoObject() : PyAutoObject< T >
  • PyCmdUI() : PyCmdUI
  • PyColorConsole() : PyColorConsole
  • PyContainer() : PyContainer
  • PyCvsEntry() : PyCvsEntry
  • PyMenuMgr() : PyMenuMgr
  • PyPersistent() : PyPersistent
  • PyRegistry() : PyRegistry

- q -
  • QsortMethod : CSortList< T >
  • QueryAcceptData() : CWincvsView
  • QueryStatusWB() : CCJHtmlView
  • QuietOption() : CvsPrefs

- r -
  • r : UCOLOR, UColor
  • R : CTCP2Parse::RGBColor
  • RAISED : CCJFlatComboBox
  • rcDownArrow : CGfxOutBarCtrl
  • rcUpArrow : CGfxOutBarCtrl
  • read_func : _WireHandler
  • ReadFields() : TPseudoDoubleNumberText, TPseudoIconCheckBox, TPseudoRotateIconButton, TPseudoIconButton, TPseudoIconPopup, TBuggyPopup
  • ReadIconsID() : UPseudoRotButton
  • ReadOleDateTime() : CCJDateEdit
  • ReadOnly : USmartCombo
  • ReadString() : CCJMemFile
  • RebuildBar() : UToolbar
  • RecalcAllExcept() : CCJSizeDockBar, CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd
  • RecalcLayout() : CGfxSplitterWnd, CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd
  • RecalcSize() : CCJPagerCtrl
  • RecomputeMenuLayout() : CCJMenuBar
  • RecomputeToolbarSize() : CCJMenuBar
  • Rectangle() : UDC
  • rectOldPos : CJX_CONTROLPOS
  • recycle() : CvsString
  • Red : CTCP2Parse
  • Ref() : PyAutoObject< T >, EntnodeData, EntnodePath, aref
  • ref : EntnodeData, EntnodePath, aref
  • Refresh() : CCJHtmlView
  • Refresh2() : CCJHtmlView
  • Register() : CPersistent
  • RegisterAllObjects() : PyRegistry
  • RegisterValue() : PyContainer
  • Remove() : CSubclassWndMap, TMString< T >
  • RemoveAll() : CSubclassWndMap, TPseudoTextListView
  • RemoveAllTabs() : CCJTabCtrlBar
  • RemoveCell() : CMacBinItem
  • removed : EntnodeData
  • RemoveEntry() : MacBinMaps
  • RemoveFiles() : CvsCoworker, ICvsCoworker
  • removeFiles() : CvsProject
  • RemoveFolder() : CGfxOutBarCtrl
  • RemoveItem() : CGfxOutBarCtrl, USmartCombo
  • RemoveItems : USmartCombo
  • RemoveListItem() : CCJTabCtrlBar
  • RemoveMenu() : CCJMenu
  • RemovePane() : CCJStatusBar
  • RemoveTimer() : UWidget
  • RemoveView() : CCJTabView, CCJTabCtrlBar
  • renameFile() : CvsProject
  • RenameFile() : CvsCoworker, ICvsCoworker
  • replace() : UStr, UPStr
  • ReplaceView() : CCJFlatSplitterWnd
  • ReportConflict() : ReportConflict
  • ReportError() : CCJHyperLink
  • ReportWarning() : ReportWarning
  • RepositionCaret() : CCJHexEdit
  • requireSize() : CvsString
  • Reset() : CSortList< T >, MacBinMaps
  • reset() : MultiFiles, CvsArgs
  • ResetBrowser() : CWinCvsBrowser, UCvsFolders
  • ResetIdleTime() : CWincvsApp
  • ResetText() : CToolbarCombo
  • ResetTimeStamp() : CPersistent
  • ResetToolTips() : CCJTabCtrlBar
  • ResetView() : CWinCvsBrowser, CBrowseFileView, UCvsFolders, UCvsFiles
  • resize() : CvsString
  • ResizeWindow() : CCJFlatHeaderCtrl
  • Resort() : CBrowseFileView, UCvsFiles
  • RestoreState() : CCJToolBar
  • Result() : CSortList< T >
  • result : UTREE_INSERT
  • RetrievePath() : CWinCvsBrowser, UCvsFolders
  • revcmp() : KoRevisionColumn
  • revCnt : CTCP2Parse
  • reverse : ansiAttrCvt
  • revLast : CTCP2Parse
  • rewind() : MultiFiles
  • RGB : CTCP2Parse::RGBColor
  • rgbqFrom : CJX_COLORMAP
  • RhostPort() : CvsPrefs
  • right : URECT
  • RoundRect() : UDC
  • row : ULIST_INFO, ULIST_INSERT
  • RsaIdentityFile() : AuthenSSH
  • RshName() : CvsPrefs
  • rtCMPString() : CMPString
  • rtCMString() : CMString
  • rtCPersistent() : CPersistent
  • rtCPersistentBool() : CPersistentBool
  • rtCPersistentInt() : CPersistentInt
  • rtPCPStr() : PCPStr
  • rtPCStr() : PCStr
  • rtUAuthen_Gserver() : UAuthen_Gserver
  • rtUAuthen_Kserver() : UAuthen_Kserver
  • rtUAuthen_Pserver() : UAuthen_Pserver
  • rtUAuthen_Rhosts() : UAuthen_Rhosts
  • rtUAuthen_SSH() : UAuthen_SSH
  • rtUCmdTarget() : UCmdTarget
  • rtUCvsApp() : UCvsApp
  • rtUCvsConsole() : UCvsConsole
  • rtUCvsFiles() : UCvsFiles
  • rtUCvsFolders() : UCvsFolders
  • rtUCvsFrame() : UCvsFrame
  • rtUCvsGraph() : UCvsGraph
  • rtUCvsMenubar() : UCvsMenubar
  • rtUCvsToolbar() : UCvsToolbar
  • rtUEditMessage() : UEditMessage
  • rtUMacAppMenu() : UMacAppMenu
  • rtUMenu() : UMenu
  • rtUObject() : UObject
  • rtUPromptMessage() : UPromptMessage
  • rtUSaveSettings() : USaveSettings
  • rtUToolbar() : UToolbar
  • rtUWidget() : UWidget
  • Run() : KoWatcher

- s -
  • s1 : _IID
  • s2 : _IID
  • sAllURuntimeClass : URuntimeClass
  • sample1 : ReportConflict
  • sample2 : ReportConflict
  • samples : ReportWarning
  • save() : CvsPrefs
  • Save() : CCJMemFile
  • SaveAll() : CPersistent
  • SaveAllModified() : CWincvsApp
  • SaveAllSettings() : CPersistent
  • SaveBarState() : CCJMDIFrameWnd, CCJFrameWnd, CCJControlBar
  • SaveColumns() : CBrowseFileView
  • SaveColumnWidths() : CCJListView, CCJListCtrl
  • SaveDefaults() : MacBinMaps
  • SaveState() : CCJToolBar
  • SaveWindowPos() : CCJWindowPlacement
  • SayWelcome() : UCvsApp
  • sbuf : CWincvsView
  • sbuffer : EntnodeData
  • ScrollIntoView() : CCJHexEdit
  • Search() : UCvsFiles, WININFO
  • searchAllPath() : CFindSettings
  • searchPath() : CFindSettings
  • SearchWidID() : LPseudoWinAttachment
  • segment : CTCP2Parse
  • sel : CWinLogData
  • SelDelete() : CCJHexEdit
  • Selected() : CWinLogData
  • SelectItems() : CCJTreeCtrl
  • SelectObject() : UDC
  • selfB : CWinLogData
  • SelfBounds() : CWinLogData
  • SelInsert() : CCJHexEdit
  • SendChar() : CCJMaskEdit
  • SendMessageC() : CCJToolBar
  • seq() : ansiAttrCvt::AnsiSeq
  • Serialize() : CWincvsDoc, CGraphDoc
  • ServerName() : CvsPrefs
  • set() : UStr, UPStr
  • SetActiveView() : CCJTabView, CCJTabCtrlBar
  • SetActualSize() : CCJSizeDockBar
  • SetAddControl() : CvsPrefs
  • SetAddressBar() : CCJHtmlView
  • SetAlternateColors() : CCJFlatButton
  • SetAlwaysUseCvsroot() : CvsPrefs
  • SetAnchorHighlight() : CCJToolBarCtrl
  • SetAnimationTickCount() : CGfxOutBarCtrl
  • SetAnimSelHighlight() : CGfxOutBarCtrl
  • SetAnsiString() : CCJMenuData
  • SetAutoSize() : CCJHyperLink
  • SetBandInfo() : CCJReBarCtrl
  • SetBarInfo() : CCJReBarCtrl
  • SetBitmap() : CCJToolBar
  • SetBitmapBackground() : CCJMenu
  • SetBitmapSize() : CCJToolBar
  • SetBkColor() : CCJReBarCtrl, CCJPagerCtrl, CCJColorPicker
  • SetBorder() : CCJPagerCtrl
  • SetBorders() : CCJToolBarBase
  • SetBPR() : CCJHexEdit
  • SetBrowser() : CvsPrefs
  • SetButton() : CCJToolBar
  • SetButtonFont() : CCJFlatButton
  • SetButtonInfo() : CCJToolBarCtrl, CCJToolBar
  • SetButtons() : CCJToolBar
  • SetButtonSize() : CCJToolBar, CCJPagerCtrl
  • SetButtonStructSize() : CCJToolBar
  • SetButtonStyle() : CCJToolBar, CCJCaptionButton
  • SetButtonText() : CCJToolBar
  • SetButtonWidth() : CCJToolBarCtrl
  • SetCaptionColors() : CCJCaption
  • SetCheck() : CCJToolCmdUI, PyCmdUI
  • SetCheckoutRO() : CvsPrefs
  • SetChild() : CCJPagerCtrl, CCJControlBar
  • SetChildWindow() : CCJCaption
  • SetCmdID() : CCJToolBar
  • SetColor() : CColorStatic, CCJMonthCalCtrl, CCJColorPicker
  • SetColors() : CCJHyperLink
  • SetColorScheme() : CCJReBarCtrl
  • SetColumnWidth() : CCJListView, CCJListCtrl
  • SetConflict() : ReportConflict
  • SetContinue() : UCmdUI
  • SetCurrentMap() : CMacBinTable
  • SetCurSel() : CCJFlatTabCtrl, CCJMonthCalCtrl
  • SetCustomText() : CCJColorPicker
  • SetCvsConsole() : CvsPrefs
  • SetCvsExitOnError() : CTcl_Interp
  • SetCvsLastErrorCode() : CTcl_Interp
  • SetCvsRunning() : UCvsApp, CvsPrefs
  • SetCvsStopping() : UCvsApp
  • SetCvsVersion() : CvsPrefs
  • SetData() : CWinPlacement, CMMenuString, CCJHexEdit, CPersistentT< T >, CPersistent, TMString< T >, TMPersistent< T >, PCStr, PCPStr
  • SetDateTime() : CCJDateEdit
  • SetDayState() : CCJMonthCalCtrl
  • SetDefaultCursor() : CCJHyperLink
  • SetDefaultRoot() : UCvsFolders
  • SetDefaults() : CTCP2Parse
  • SetDefaultText() : CCJColorPicker
  • SetDesc() : EntnodeData
  • setdir() : MultiFilesEntry
  • SetDirtySupport() : CvsPrefs
  • SetDisabledImageList() : CCJToolBarCtrl
  • SetDisableOldStyle() : CCJMenu
  • SetDlgDefExt() : CCJBrowseEdit
  • SetDlgFileName() : CCJBrowseEdit
  • SetDlgFilter() : CCJBrowseEdit
  • SetDlgOpenFile() : CCJBrowseEdit
  • SetDlgOwner() : CCJBrowseEdit
  • SetDlgStyle() : CCJBrowseEdit
  • SetDlgTitle() : CCJBrowseEdit
  • SetDrawTextFlags() : CCJToolBarCtrl
  • SetEditMask() : CCJMaskEdit
  • SetEditSel() : CCJComboBoxEx
  • SetEncryptCommunication() : CvsPrefs
  • SetExtDiff() : CvsPrefs
  • SetExtendedStyle() : CCJToolBarCtrl, CCJToolBar, CCJListView, CCJListCtrl, CCJComboBoxEx
  • SetFeature() : USmartCombo
  • SetFirstDayOfWeek() : CCJMonthCalCtrl
  • SetFolderImageList() : CGfxOutBarCtrl
  • SetFolderText() : CGfxOutBarCtrl
  • SetFontBold() : CCJFlatHeaderCtrl
  • SetFormat() : CCJDateTimeCtrl
  • SetFullRowSel() : CBrowseFileView
  • SetFullScreen() : CCJHtmlView
  • SetGroup() : CPseudoToggle
  • SetHasLoogedIn() : CvsPrefs
  • SetHeight() : CCJToolBar, CCJHtmlView
  • SetHelper() : CvsPrefs
  • SetHideCommandDlgAnnotate() : CvsPrefs
  • SetHideCommandDlgDiff() : CvsPrefs
  • SetHideCommandDlgGraph() : CvsPrefs
  • SetHideCommandDlgLog() : CvsPrefs
  • SetHideCommandDlgUpdate() : CvsPrefs
  • SetHideCommandDlgUseShift() : CvsPrefs
  • SetHilightColors() : CCJFontCombo
  • SetHome() : CvsPrefs
  • SetHotImageList() : CCJToolBarCtrl
  • SetHotItem() : CCJToolBarCtrl, CCJToolBar
  • SetHours() : CCJTimeEdit
  • SetIcon() : CHistComboBoxEx, CCJFlatButton
  • SetIconSize() : CCJMenu
  • SetICTextOption() : CvsPrefs
  • SetIgnored() : EntnodeData
  • SetImageList() : CGfxOutBarCtrl, CCJToolBarCtrl, CCJToolBar, CCJReBarCtrl, CCJComboBoxEx
  • SetImageLists() : CCJOutlookBar
  • SetIndent() : CCJToolBarCtrl, CCJToolBar
  • SetInsertMark() : CCJToolBarCtrl
  • SetInsertMarkColor() : CCJToolBarCtrl
  • SetIsoConvert() : CvsPrefs
  • SetItem() : CCJComboBoxEx
  • SetItemBold() : CCJTreeCtrl
  • SetItemColor() : CCJTreeCtrl
  • SetItemData() : CGfxOutBarCtrl
  • SetItemFont() : CCJTreeCtrl
  • SetItemImage() : CGfxOutBarCtrl
  • SetItems() : CCJOutlookBar, USmartCombo
  • SetItemText() : CGfxOutBarCtrl
  • setkind() : Authen
  • SetKserverPort() : CvsPrefs
  • SetLastWorkingDir() : CvsPrefs
  • SetLeft() : CCJHtmlView
  • SetLinkCursor() : CCJHyperLink
  • SetLocked() : EntnodeData
  • SetLogoFont() : CCJLogoPane
  • SetLogoText() : CCJLogoPane
  • SetLogoutTimeOut() : CvsPrefs
  • SetMacBinEncoding() : CvsPrefs
  • SetMacLF() : CvsPrefs
  • SetMask() : KoFilterModel
  • SetMaxSelCount() : CCJMonthCalCtrl
  • SetMaxTextRows() : CCJToolBarCtrl
  • SetMenuBar() : CCJHtmlView
  • SetMenuID() : CCJTabCtrl, CCJFlatHeaderCtrl, CCJControlBar
  • SetMetaFiles() : CCJMetaFileButton
  • SetMinimumColSize() : CCJListView, CCJListCtrl
  • SetMins() : CCJTimeEdit
  • SetMissing() : EntnodeData
  • SetMonthCalColor() : CCJDateTimeCtrl
  • SetMonthCalFont() : CCJDateTimeCtrl
  • SetMonthDelta() : CCJMonthCalCtrl
  • SetNewStyle() : CWinCvsBrowser
  • SetNode() : CGraphDoc
  • SetNormalColors() : CCJFontCombo
  • SetNormalSize() : CCJControlBar
  • SetOffline() : CCJHtmlView
  • SetOptions() : CCJHexEdit
  • SetOwner() : CCJToolBar, CCJReBarCtrl, CCJOutlookBar
  • SetPadding() : CCJToolBar
  • SetPageValue() : LPseudoWinAttachment
  • SetPalette() : CCJReBarCtrl
  • SetPaneWidth() : CCJStatusBar
  • SetPos() : CCJPagerCtrl
  • SetProblem() : ControlCvsArgs
  • SetProgress() : CProgress
  • SetProxyHost() : CvsPrefs
  • SetProxyPort() : CvsPrefs
  • SetPruneOption() : CvsPrefs
  • SetPserverPort() : CvsPrefs
  • SetPseudoID() : CDynToolBar
  • SetPseudoWidget() : TPseudoWinAdorner, TPseudoWinBehavior
  • SetQuietOption() : CvsPrefs
  • SetRadio() : CPseudoToggle
  • SetRange() : CCJMonthCalCtrl, CCJDateTimeCtrl
  • SetReadOnly() : CSmartComboBox, USmartCombo
  • SetRect() : URect
  • SetRectEmpty() : URect
  • SetRecursive() : CBrowseFileView
  • SetRedraw() : CWndRedrawMngr
  • SetRegisterAsBrowser() : CCJHtmlView
  • SetRegisterAsDropTarget() : CCJHtmlView
  • SetRemoved() : EntnodeData
  • SetResourceIDs() : CCJMDIChildWnd
  • SetRhostPort() : CvsPrefs
  • SetRowColors() : CCJListView, CCJListCtrl
  • SetRows() : CCJToolBar
  • SetRshName() : CvsPrefs
  • SetScrollArea() : CCJPagerCtrl
  • SetSearchType() : CCJBrowseEdit
  • SetSel() : CCJHexEdit
  • SetSelected() : CWinLogData
  • SetSelection() : TPseudoTextListView
  • SetSelectionMode() : CCJColorPicker
  • SetSelFolder() : CGfxOutBarCtrl
  • SetSelRange() : CCJMonthCalCtrl
  • SetServerName() : CvsPrefs
  • SetSilent() : CCJHtmlView
  • SetSizes() : CCJToolBar
  • SetSmallIconView() : CGfxOutBarCtrl
  • SetSortImage() : CSortHeaderCtrl, CCJFlatHeaderCtrl
  • SetState() : CCJToolBar, CPseudoToggle
  • SetStatusBar() : CCJHtmlView
  • SetStyle() : CCJToolBarCtrl
  • SetTabImageList() : CCJTabView, CCJTabCtrlBar
  • SetTabMenuID() : CCJTabCtrlBar
  • SetTclFileRunning() : CvsPrefs
  • SetText() : CToolbarCombo, CCJToolCmdUI, PyCmdUI, UCmdUI
  • SetTextColor() : CCJReBarCtrl, CCJColorPicker
  • SetTextStyle() : CCJCaption
  • SetTheaterMode() : CCJHtmlView
  • SetTime() : CCJDateTimeCtrl
  • SetTipText() : CCJFlatTabCtrl
  • SetToday() : CCJMonthCalCtrl
  • SetToolBar() : CCJHtmlView
  • SetToolbarStyle() : CCJToolBar
  • SetTooltip() : UCmdUI
  • SetToolTips() : CCJToolBar, CCJReBarCtrl
  • SetTop() : CCJHtmlView
  • SetTrackingState() : CCJMenuBar
  • SetTrackSelection() : CCJColorPicker
  • SetTypeCreatorConflict() : ReportConflict
  • SetUnderline() : CCJHyperLink
  • SetUnixLF() : CvsPrefs
  • SetUnknown() : EntnodeData
  • SetUnmodified() : EntnodeData
  • SetURL() : CCJHyperLink
  • SetUseAltCvs() : CvsPrefs
  • SetUseProxy() : CvsPrefs
  • SetUseShell() : CvsPrefs
  • SetUseViewerAlways() : CvsPrefs
  • SetValue() : PyPersistent, TPseudoDoubleNumberText
  • SetViewer() : CvsPrefs
  • SetViewToolTip() : CCJTabCtrlBar
  • SetViewType() : CBrowseFileView
  • SetVisible() : CCJHtmlView
  • SetVisited() : CCJHyperLink, EntnodeData
  • SetWhichCvs() : CvsPrefs
  • SetWideString() : CCJMenuData
  • SetWidID() : UPseudoPageHider, UPseudoPlaceHolder
  • SetWindowSize() : CCJColorPopup, CCJColorPicker
  • SetWinInfo() : CDynToolBar
  • SetWordWrapLogMsg() : CvsPrefs
  • SetZ9Option() : CvsPrefs
  • SetZLevel() : CvsPrefs
  • sFocusCmdID : UWidget
  • sFocusWidID : UWidget
  • shareData : ENTNODE
  • ShowAdvancedOptionsForCommand() : CvsCoworker, ICvsCoworker
  • showAdvancedOptionsForCommand() : CvsProject
  • ShowBand() : CCJReBarCtrl
  • ShowColumn() : CCJFlatSplitterWnd
  • showFileHistory() : CvsProject
  • ShowFileHistory() : CvsCoworker, ICvsCoworker
  • ShowFileProperties() : CvsCoworker, ICvsCoworker
  • showFileProperties() : CvsProject
  • ShowFrameControls() : CCJControlBar
  • ShowRow() : CCJFlatSplitterWnd
  • ShowSplashScreen() : CSplashWnd
  • ShowTipAtStartup() : CWincvsApp
  • ShowTipOfTheDay() : CWincvsApp
  • showUserInterface() : CvsProject
  • ShowUserInterface() : CvsCoworker, ICvsCoworker
  • sig : MACBINMAP
  • SignalStartWatch() : KoWatcher
  • SignalTerminate() : KoWatcher
  • SingleClick() : CPseudoItem
  • size() : CBuffer, CStaticAllocT< T >
  • Size() : URect
  • SizeMinReq() : CCJMonthCalCtrl
  • SizeOf() : CWinPlacement, CMMenuString, CPersistentT< T >, CPersistent, TMString< T >, TMPersistent< T >, PCStr, PCPStr
  • sizeofcell : DYN_LIST
  • SizeTabView() : CCJTabCtrlBar
  • SizeToolBar() : CCJToolBar
  • SizeToRect() : CCJReBarCtrl
  • skiptoken() : Authen
  • sMAMenuWidID : UMacAppMenu
  • snumbuf : CWincvsView
  • Sort() : CCJSortClass
  • SortList() : CCJListView, CCJListCtrl
  • spec : FileEntry
  • SpendTime() : LMainPseudoAttachment
  • Split() : CKeyString
  • sPPMenuWidID : UPPMenu
  • st_atime : wnt_stat
  • st_ctime : wnt_stat
  • st_dev : wnt_stat
  • st_gid : wnt_stat
  • st_ino : wnt_stat
  • st_mode : wnt_stat
  • st_mtime : wnt_stat
  • st_nlink : wnt_stat
  • st_rdev : wnt_stat
  • st_size : wnt_stat
  • st_uid : wnt_stat
  • StartDragDockBar() : CCJDockContext
  • StartGroupEdit() : CGfxOutBarCtrl
  • starting : _CvsProcess
  • StartItemEdit() : CGfxOutBarCtrl
  • StartResize() : CCJDockContext
  • StartWatch() : KoWatcher
  • STATE : CCJFlatComboBox
  • status : ReportConflict
  • StepToLocation() : CWinCvsBrowser, UCvsFolders
  • Stop() : CCJHtmlView
  • StopWatch() : KoWatcher
  • StoreExpanded() : CWinCvsBrowser, UCvsFolders
  • StoreValues() : CGetPrefs_CVSCMD_DIALOGS, CGetPrefs_WINCVS, CGetPrefs_GLOBALS, CGetPrefs_CVSROOT
  • str : GPT_CONSOLE, GPT_GETENV, UStr, UPStr
  • strcat() : CvsString
  • strcpy() : CvsString
  • Stretch() : CCJDockContext
  • strlen() : CvsString
  • strncpy() : CvsString
  • SubclassHeader() : CCJListView, CCJListCtrl
  • sValidMenu : UWidget
  • SwitchView() : CCJFlatSplitterWnd
  • SwitchWrapEdit() : CCommit_MAIN
  • syncflag : CCJMenuData
  • SynchronizeMenu() : CCJMenu
  • szLabel : tagCTV_ITEM
  • szName : ColorTableEntry
  • szTabLabel : tagTCB_ITEM
  • szToolTipLabel : tagTCB_ITEM

- t -
  • tag : EntnodeFile
  • targets : CAllTargets
  • tbButton : TOOLBARINFO
  • TbEntry() : TbEntry
  • TbEntryButton() : TbEntryButton
  • TbEntryChkButton() : TbEntryChkButton
  • TbEntryDropDown() : TbEntryDropDown
  • TbEntrySeparator() : TbEntrySeparator
  • TBrowserFill() : TBrowserFill
  • TBrowserFillDummy() : TBrowserFillDummy
  • TBuggyPopup() : TBuggyPopup
  • text : CGfxGroupEdit
  • TextOutClipped() : UDC
  • TGraphCmdStatus() : TGraphCmdStatus
  • TGraphDelCmd() : TGraphDelCmd
  • TGraphRectSelect() : TGraphRectSelect
  • TGraphSelNonSig() : TGraphSelNonSig
  • threads : _CvsProcess
  • threadsID : _CvsProcess
  • title : CustInvertTable, ULIST_INFO, ULIST_INSERT, UTREE_INFO, UTREE_INSERT, UTB_INIT
  • TMPersistent() : TMPersistent< T >
  • TMString() : TMString< T >
  • ToggleAdded() : KoFilterModel
  • ToggleBtn() : CPseudoToggle
  • ToggleChanged() : KoFilterModel
  • ToggleConflict() : KoFilterModel
  • ToggleDocking() : CCJDockContext
  • ToggleHideUnknown() : KoFilterModel
  • ToggleIgnore() : KoIgnoreModel
  • ToggleMissing() : KoFilterModel
  • ToggleModified() : KoFilterModel
  • ToggleRecursion() : KoRecursionModel
  • ToggleRemoved() : KoFilterModel
  • ToggleTrackButtonMode() : CCJMenuBar
  • ToggleUnknown() : KoFilterModel
  • token() : Authen
  • tokens : irciiAttrCvt, mircAttrCvt
  • tokenToKind() : Authen
  • tooltip : awidget, UTB_BUTTON
  • tooMuchWarnings : ReportWarning
  • top : URECT
  • TopLeft() : URect
  • totB : CWinLogData
  • totpage : DYN_LIST
  • TouchTimeStamp() : CPersistent
  • TPseudoAppBehavior() : TPseudoAppBehavior
  • TPseudoCustomView() : TPseudoCustomView
  • TPseudoDoubleNumberText() : TPseudoDoubleNumberText
  • TPseudoIconButton() : TPseudoIconButton
  • TPseudoIconCheckBox() : TPseudoIconCheckBox
  • TPseudoIconPopup() : TPseudoIconPopup
  • TPseudoRotateIconButton() : TPseudoRotateIconButton
  • TPseudoScrollBar() : TPseudoScrollBar
  • TPseudoTextListView() : TPseudoTextListView
  • TPseudoWinAdorner() : TPseudoWinAdorner
  • TPseudoWinBehavior() : TPseudoWinBehavior
  • TrackDockBar() : CCJDockContext
  • TrackPopup() : CCJMenuBar
  • TrackScrollBar() : TPseudoScrollBar
  • TranslateFrameMessage() : CCJMenuBar
  • TraverseGraph() : TGraph
  • TraverseNode() : TGraphSelNonSig, TGraphDelCmd, TGraphCmdStatus, TGraphRectSelect, TGraph
  • True() : PyContainer
  • ts : EntnodeFile
  • ts_conflict : EntnodeFile
  • TViewFill() : TViewFill
  • type : _WireMessage, _WireHandler
  • TypeDesc() : AddUnicodeCvsArgs, AddBinCvsArgs, AddCvsArgs, ControlCvsArgs

- u -
  • UAuthen_Gserver() : UAuthen_Gserver
  • UAuthen_Kserver() : UAuthen_Kserver
  • UAuthen_Pserver() : UAuthen_Pserver
  • UAuthen_Rhosts() : UAuthen_Rhosts
  • UAuthen_SSH() : UAuthen_SSH
  • UBrush() : UBrush
  • UCmdTarget() : UCmdTarget
  • UCmdUI() : UCmdUI
  • UCOLOR() : UCOLOR
  • UCvsApp() : UCvsApp
  • UCvsConsole() : UCvsConsole
  • UCvsFiles() : UCvsFiles
  • UCvsFolders() : UCvsFolders
  • UCvsFrame() : UCvsFrame
  • UCvsGraph() : UCvsGraph
  • UCvsMenubar() : UCvsMenubar
  • UCvsToolbar() : UCvsToolbar
  • UDC : UDC, UBrush, UPen
  • UDispatchInfo : UCmdTarget
  • UDispatchMessage() : UWidget, UToolbar, UCmdTarget
  • UEditMessage() : UEditMessage
  • uiToolTipId : tagTCB_ITEM
  • UMacAppMenu() : UMacAppMenu
  • UMenu() : UMenu
  • UncheckoutFiles() : CvsCoworker, ICvsCoworker
  • uncheckoutFiles() : CvsProject
  • underCnt : CTCP2Parse
  • underLast : CTCP2Parse
  • underline : UCvsConsole, ansiAttrCvt
  • UnionRect() : URect
  • Unixfy() : CTcl_Interp
  • UnixLF() : CvsPrefs
  • unknown : EntnodeData
  • Unlock() : CCVS_CoworkerModule
  • unmodified : EntnodeData
  • UnRef() : PyAutoObject< T >, EntnodeData, EntnodePath, aref
  • UnRegister() : CPersistent
  • UnselectAll() : CWinLogData
  • UnSetBitmapBackground() : CCJMenu
  • UnSetDisableOldStyle() : CCJMenu
  • UObject() : UObject
  • Update() : CWinLogData
  • UpdateAllDocsView() : CWincvsApp
  • UpdateCaption() : CCJCaption
  • UpdateCaptionBack() : CCJCaption
  • UpdateCaptionText() : CCJCaption
  • updateFiles() : CvsProject
  • UpdateFiles() : CvsCoworker, ICvsCoworker
  • UpdateFont() : CCJTabCtrl, CCJOutlookBar, CCJMenuBar, CCJMaskEdit, CCJFlatButton, CCJColorPopup, CCJCaption, CCJBrowseButton
  • UpdateInfo() : CCommit_MAIN
  • UpdateMenu() : CCJMenu
  • UpdatePreviewInfo() : CCommit_MAIN
  • UpdateScrollbars() : CCJHexEdit
  • UpdateSelf() : CWinLogBranchData, CWinLogTagData, CWinLogRevData, CWinLogHeaderData, CWinLogData, CWinLogBranchData, CWinLogTagData, CWinLogRevData, CWinLogHeaderData, CWinLogData
  • UPen() : UPen
  • UPoint() : UPoint
  • UPPMenu() : UPPMenu
  • UPromptMessage() : UPromptMessage
  • UPseudoFakePane() : UPseudoFakePane
  • UPseudoPageHider() : UPseudoPageHider
  • UPseudoPlaceHolder() : UPseudoPlaceHolder
  • UPseudoRotButton() : UPseudoRotButton
  • UPStr() : UPStr
  • URect() : URect
  • urlCnt : CTCP2Parse
  • urlLast : CTCP2Parse
  • URuntimeClass() : URuntimeClass
  • USaveSettings() : USaveSettings
  • UseAltCvs() : CvsPrefs
  • useDefault : MACBINMAP
  • UseKeyChain() : CvsPrefs
  • USemaphore() : USemaphore
  • UseProxy() : CvsPrefs
  • user : EntnodeData
  • userFlags : ReportConflict
  • UseViewerAlways() : CvsPrefs
  • USize() : USize
  • USmartCombo() : USmartCombo
  • UStr() : UStr
  • UTF_8 : CTCP2Parse
  • UTimer() : UTimer
  • UToolbar() : UToolbar
  • UWaitCursor() : UWaitCursor
  • UWidget : UWidget, TPseudoWinAdorner, TPseudoWinBehavior
  • UWinPseudoWindowProc : UWidget

- v -
  • val : option
  • var : awidget
  • varcode : UTB_BUTTON
  • verb() : ansiAttrCvt::AnsiSeq
  • view : CGraphConsole, CViewInfo
  • ViewChangedFrame() : TPseudoWinAdorner
  • Viewer() : CvsPrefs
  • ViewPath : Wincvs::IWincvs
  • visited : EntnodeData
  • vn : EntnodeFile
  • Void() : PyContainer

- w -
  • warnings : ImportReport
  • wHeight : CToolBarData
  • WhichCvs() : CvsPrefs
  • WhichVersion() : CvsPrefs
  • White : CTCP2Parse
  • wid : TbEntryButton
  • WidgetIsActive() : UWidget
  • Width() : URect
  • width : WININFO
  • widthbtn : UTB_INIT
  • Win32wstring() : Win32wstring
  • WindowProc() : CSubclassWnd, CCJToolBarBase, CCJReBar, CCJMenuBarFrameHook, CPseudoDlg
  • winid : UTB_INIT
  • WININFO() : WININFO
  • wire_ht : CAllHandlers
  • wItemCount : CToolBarData
  • WM_CONTENTCHANGE : CTbEdit
  • WM_FILECHANGE : KoWatcher
  • WordWrapLogMsg() : CvsPrefs
  • WrapToolBar() : CCJToolBar
  • write_buffer : _CvsProcess
  • write_buffer_index : _CvsProcess
  • write_func : _WireHandler
  • WriteFields() : TPseudoDoubleNumberText, TPseudoIconCheckBox, TPseudoRotateIconButton, TPseudoIconButton, TPseudoIconPopup, TBuggyPopup
  • WriteString() : CCJMemFile
  • wVersion : CToolBarData
  • wWidth : CToolBarData

- x -
  • x : _IID, UPOINT
  • xLeftMargin : CGfxOutBarCtrl
  • xoffset : CCJMenuData
  • xSmallIconLabelOffset : CGfxOutBarCtrl

- y -
  • y : UPOINT
  • Yellow : CTCP2Parse
  • yLargeIconLabelOffset : CGfxOutBarCtrl
  • yLargeIconSpacing : CGfxOutBarCtrl
  • ySmallIconSpacing : CGfxOutBarCtrl
  • yTopMargin : CGfxOutBarCtrl

- z -
  • Z9Option() : CvsPrefs
  • ZLevel() : CvsPrefs

- ~ -
  • ~AnsiSeq() : ansiAttrCvt::AnsiSeq
  • ~aref() : aref
  • ~AuthenGserver() : AuthenGserver
  • ~AuthenKserver() : AuthenKserver
  • ~AuthenLocal() : AuthenLocal
  • ~AuthenModel() : AuthenModel
  • ~AuthenNtserver() : AuthenNtserver
  • ~AuthenPserver() : AuthenPserver
  • ~AuthenRhosts() : AuthenRhosts
  • ~AuthenSSH() : AuthenSSH
  • ~awidget() : awidget
  • ~CAllHandlers() : CAllHandlers
  • ~CAllTargets() : CAllTargets
  • ~CAnnotate_MAIN() : CAnnotate_MAIN
  • ~CAuthenSetUp() : CAuthenSetUp
  • ~CBarConsole() : CBarConsole
  • ~CBarFolder() : CGfxOutBarCtrl::CBarFolder
  • ~CBarItem() : CGfxOutBarCtrl::CBarItem
  • ~CBrowseFileView() : CBrowseFileView
  • ~CBrowserBar() : CBrowserBar
  • ~CCheckout_MAIN() : CCheckout_MAIN
  • ~CCheckout_OPTIONS() : CCheckout_OPTIONS
  • ~CCJBrowseButton() : CCJBrowseButton
  • ~CCJBrowseEdit() : CCJBrowseEdit
  • ~CCJCaption() : CCJCaption
  • ~CCJCaptionPopupWnd() : CCJCaptionPopupWnd
  • ~CCJColorPicker() : CCJColorPicker
  • ~CCJColorPopup() : CCJColorPopup
  • ~CCJComboBoxEx() : CCJComboBoxEx
  • ~CCJControlBar() : CCJControlBar
  • ~CCJDateTimeCtrl() : CCJDateTimeCtrl
  • ~CCJDockBar() : CCJDockBar
  • ~CCJDockContext() : CCJDockContext
  • ~CCJExplorerBar() : CCJExplorerBar
  • ~CCJFlatButton() : CCJFlatButton
  • ~CCJFlatComboBox() : CCJFlatComboBox
  • ~CCJFlatHeaderCtrl() : CCJFlatHeaderCtrl
  • ~CCJFlatSplitterWnd() : CCJFlatSplitterWnd
  • ~CCJFlatTabCtrl() : CCJFlatTabCtrl
  • ~CCJFontCombo() : CCJFontCombo
  • ~CCJFrameWnd() : CCJFrameWnd
  • ~CCJHexEdit() : CCJHexEdit
  • ~CCJHtmlView() : CCJHtmlView
  • ~CCJHyperLink() : CCJHyperLink
  • ~CCJListBox() : CCJListBox
  • ~CCJListCtrl() : CCJListCtrl
  • ~CCJListView() : CCJListView
  • ~CCJLogoPane() : CCJLogoPane
  • ~CCJMaskEdit() : CCJMaskEdit
  • ~CCJMDIChildWnd() : CCJMDIChildWnd
  • ~CCJMDIFrameWnd() : CCJMDIFrameWnd
  • ~CCJMemFile() : CCJMemFile
  • ~CCJMenu() : CCJMenu
  • ~CCJMenuBar() : CCJMenuBar
  • ~CCJMenuBarFrameHook() : CCJMenuBarFrameHook
  • ~CCJMenuData() : CCJMenuData
  • ~CCJMetaFileButton() : CCJMetaFileButton
  • ~CCJMiniDockFrameWnd() : CCJMiniDockFrameWnd
  • ~CCJMonthCalCtrl() : CCJMonthCalCtrl
  • ~CCJOutlookBar() : CCJOutlookBar
  • ~CCJPagerCtrl() : CCJPagerCtrl
  • ~CCJSizeDockBar() : CCJSizeDockBar
  • ~CCJSortClass() : CCJSortClass
  • ~CCJStatusBar() : CCJStatusBar
  • ~CCJStatusBarPane() : CCJStatusBarPane
  • ~CCJStatusBarPaneControlInfo() : CCJStatusBarPaneControlInfo
  • ~CCJTabCtrl() : CCJTabCtrl
  • ~CCJTabCtrlBar() : CCJTabCtrlBar
  • ~CCJTabView() : CCJTabView
  • ~CCJToolBar() : CCJToolBar
  • ~CCJToolBarBase() : CCJToolBarBase
  • ~CCJToolBarCtrl() : CCJToolBarCtrl
  • ~CCJTreeCtrl() : CCJTreeCtrl
  • ~CCJWindowPlacement() : CCJWindowPlacement
  • ~CCmdLine_MAIN() : CCmdLine_MAIN
  • ~CColorConsole() : CColorConsole
  • ~CColorMenu() : CColorMenu
  • ~CColorStatic() : CColorStatic
  • ~CCommit_MAIN() : CCommit_MAIN
  • ~CCommit_OPTIONS() : CCommit_OPTIONS
  • ~CCustInvertTable() : CCustInvertTable
  • ~CCvsStatusBar() : CCvsStatusBar
  • ~CCvsThreadLock() : CCvsThreadLock
  • ~CDestroyThreadLock() : CDestroyThreadLock
  • ~CDiff_MAIN() : CDiff_MAIN
  • ~CDummyInit() : CDummyInit
  • ~CDynToolBar() : CDynToolBar
  • ~CExploreBar() : CExploreBar
  • ~CFillPyEntries() : CFillPyEntries
  • ~CFillTclEntries() : CFillTclEntries
  • ~CFindSettings() : CFindSettings
  • ~CGetPrefs_CVSCMD_DIALOGS() : CGetPrefs_CVSCMD_DIALOGS
  • ~CGetPrefs_CVSROOT() : CGetPrefs_CVSROOT
  • ~CGetPrefs_GLOBALS() : CGetPrefs_GLOBALS
  • ~CGetPrefs_WINCVS() : CGetPrefs_WINCVS
  • ~CGfxGroupEdit() : CGfxGroupEdit
  • ~CGfxOutBarCtrl() : CGfxOutBarCtrl
  • ~CGfxSplitterWnd() : CGfxSplitterWnd
  • ~CGraphDoc() : CGraphDoc
  • ~CGraphFrame() : CGraphFrame
  • ~CGraphView() : CGraphView
  • ~CHistComboBoxEx() : CHistComboBoxEx
  • ~CImport_MAIN() : CImport_MAIN
  • ~CImport_OPTIONS() : CImport_OPTIONS
  • ~CKeyString() : CKeyString
  • ~CLogFilters() : CLogFilters
  • ~CLogFrame() : CLogFrame
  • ~CLogMain() : CLogMain
  • ~CLogoutThread() : CLogoutThread
  • ~CMacBinItem() : CMacBinItem
  • ~CMacBinTable() : CMacBinTable
  • ~CMainFrame() : CMainFrame
  • ~CMMenuString() : CMMenuString
  • ~CMPString() : CMPString
  • ~CMString() : CMString
  • ~COptionalPropertySheet() : COptionalPropertySheet
  • ~CPersistent() : CPersistent
  • ~CPersistentBool() : CPersistentBool
  • ~CPersistentInt() : CPersistentInt
  • ~CPersistentT() : CPersistentT< T >
  • ~CProgress() : CProgress
  • ~CPseudoButton() : CPseudoButton
  • ~CPseudoDlg() : CPseudoDlg
  • ~CPseudoDraw() : CPseudoDraw
  • ~CPseudoItem() : CPseudoItem
  • ~CPseudoList() : CPseudoList
  • ~CPseudoRotButton() : CPseudoRotButton
  • ~CPseudoToggle() : CPseudoToggle
  • ~CPyCvsConsole() : CPyCvsConsole
  • ~CPython_Interp() : CPython_Interp
  • ~CPyThreadState() : CPyThreadState
  • ~CRecursionLock() : CRecursionLock
  • ~CRevisionConsole() : CRevisionConsole
  • ~CRtag_MAIN() : CRtag_MAIN
  • ~CRtag_OPTIONS() : CRtag_OPTIONS
  • ~CSelectionChangeNotifier() : CWinCvsBrowser::CSelectionChangeNotifier
  • ~CSmartComboBox() : CSmartComboBox
  • ~CSortHeaderCtrl() : CSortHeaderCtrl
  • ~CSortList() : CSortList< T >
  • ~CSplashWnd() : CSplashWnd
  • ~CStackThreadLock() : CStackThreadLock
  • ~CStaticAllocT() : CStaticAllocT< T >
  • ~CSubclassWnd() : CSubclassWnd
  • ~CSubclassWndMap() : CSubclassWndMap
  • ~CTag_MAIN() : CTag_MAIN
  • ~CTbEdit() : CTbEdit
  • ~CTcl_Interp() : CTcl_Interp
  • ~CTCLBrowserEnt() : CTCLBrowserEnt
  • ~CTCLCvsConsole() : CTCLCvsConsole
  • ~CTempToggleBool() : CTempToggleBool
  • ~CTipDlg() : CTipDlg
  • ~CTmpFiles() : CTmpFiles
  • ~CToolbarCombo() : CToolbarCombo
  • ~CTurnOffDispatching() : CTurnOffDispatching
  • ~CUpdateMain() : CUpdateMain
  • ~CUpdateMerge() : CUpdateMerge
  • ~CUpdateSticky() : CUpdateSticky
  • ~CvsArgs() : CvsArgs
  • ~CvsFilenames() : CvsFilenames
  • ~CvsPrefs() : CvsPrefs
  • ~CvsProject() : CvsProject
  • ~CvsString() : CvsString
  • ~CvsTrace() : CvsTrace
  • ~CWinCvsBrowser() : CWinCvsBrowser
  • ~CWincvsDoc() : CWincvsDoc
  • ~CWincvsView() : CWincvsView
  • ~CWinLogBranchData() : CWinLogBranchData
  • ~CWinLogData() : CWinLogData
  • ~CWinLogHeaderData() : CWinLogHeaderData
  • ~CWinLogRevData() : CWinLogRevData
  • ~CWinLogTagData() : CWinLogTagData
  • ~CWinPlacement() : CWinPlacement
  • ~CWndRedrawMngr() : CWndRedrawMngr
  • ~ENTNODE() : ENTNODE
  • ~EntnodeData() : EntnodeData
  • ~EntnodeFile() : EntnodeFile
  • ~EntnodeFolder() : EntnodeFolder
  • ~EntnodePath() : EntnodePath
  • ~ImportReport() : ImportReport
  • ~KoFilterModel() : KoFilterModel
  • ~KoIgnoreModel() : KoIgnoreModel
  • ~KoRecursionModel() : KoRecursionModel
  • ~KoWatcher() : KoWatcher
  • ~LMainPseudoAttachment() : LMainPseudoAttachment
  • ~LPseudoDrawAttachment() : LPseudoDrawAttachment
  • ~LPseudoWinAttachment() : LPseudoWinAttachment
  • ~MacBinMaps() : MacBinMaps
  • ~PCPStr() : PCPStr
  • ~PCStr() : PCStr
  • ~PyAutoObject() : PyAutoObject< T >
  • ~PyCmdUI() : PyCmdUI
  • ~PyColorConsole() : PyColorConsole
  • ~PyContainer() : PyContainer
  • ~PyCvsEntry() : PyCvsEntry
  • ~PyMenuMgr() : PyMenuMgr
  • ~PyPersistent() : PyPersistent
  • ~PyRegistry() : PyRegistry
  • ~ReportConflict() : ReportConflict
  • ~ReportWarning() : ReportWarning
  • ~TbEntry() : TbEntry
  • ~TbEntryButton() : TbEntryButton
  • ~TbEntryChkButton() : TbEntryChkButton
  • ~TbEntryDropDown() : TbEntryDropDown
  • ~TbEntrySeparator() : TbEntrySeparator
  • ~TBrowserFill() : TBrowserFill
  • ~TBrowserFillDummy() : TBrowserFillDummy
  • ~TBuggyPopup() : TBuggyPopup
  • ~TMPersistent() : TMPersistent< T >
  • ~TMString() : TMString< T >
  • ~TPseudoAppBehavior() : TPseudoAppBehavior
  • ~TPseudoCustomView() : TPseudoCustomView
  • ~TPseudoDoubleNumberText() : TPseudoDoubleNumberText
  • ~TPseudoIconButton() : TPseudoIconButton
  • ~TPseudoIconCheckBox() : TPseudoIconCheckBox
  • ~TPseudoIconPopup() : TPseudoIconPopup
  • ~TPseudoRotateIconButton() : TPseudoRotateIconButton
  • ~TPseudoScrollBar() : TPseudoScrollBar
  • ~TPseudoTextListView() : TPseudoTextListView
  • ~TPseudoWinAdorner() : TPseudoWinAdorner
  • ~TPseudoWinBehavior() : TPseudoWinBehavior
  • ~TViewFill() : TViewFill
  • ~UAuthen_Gserver() : UAuthen_Gserver
  • ~UAuthen_Kserver() : UAuthen_Kserver
  • ~UAuthen_Pserver() : UAuthen_Pserver
  • ~UAuthen_Rhosts() : UAuthen_Rhosts
  • ~UAuthen_SSH() : UAuthen_SSH
  • ~UBrush() : UBrush
  • ~UCmdTarget() : UCmdTarget
  • ~UCmdUI() : UCmdUI
  • ~UCvsApp() : UCvsApp
  • ~UCvsConsole() : UCvsConsole
  • ~UCvsFiles() : UCvsFiles
  • ~UCvsFolders() : UCvsFolders
  • ~UCvsFrame() : UCvsFrame
  • ~UCvsGraph() : UCvsGraph
  • ~UCvsMenubar() : UCvsMenubar
  • ~UCvsToolbar() : UCvsToolbar
  • ~UDC() : UDC
  • ~UEditMessage() : UEditMessage
  • ~UMacAppMenu() : UMacAppMenu
  • ~UMenu() : UMenu
  • ~UObject() : UObject
  • ~UPen() : UPen
  • ~UPPMenu() : UPPMenu
  • ~UPromptMessage() : UPromptMessage
  • ~UPseudoFakePane() : UPseudoFakePane
  • ~UPseudoPageHider() : UPseudoPageHider
  • ~UPseudoPlaceHolder() : UPseudoPlaceHolder
  • ~UPseudoRotButton() : UPseudoRotButton
  • ~UPStr() : UPStr
  • ~URuntimeClass() : URuntimeClass
  • ~USaveSettings() : USaveSettings
  • ~USemaphore() : USemaphore
  • ~USmartCombo() : USmartCombo
  • ~UStr() : UStr
  • ~UToolbar() : UToolbar
  • ~UWaitCursor() : UWaitCursor
  • ~UWidget() : UWidget
  • ~WININFO() : WININFO
Generated on Sun Feb 24 01:24:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Namespace Index

WinCvs Source Namespace List

Here is a list of all namespaces with brief descriptions:
CVS_COWORKERLib
Wincvs
Generated on Sun Feb 24 01:29:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


CVS_COWORKERLib Namespace Reference

Functions

importlib ("stdole32.tlb")
importlib ("stdole2.tlb")

Function Documentation

importlib ( "stdole2.tlb" )

importlib ( "stdole32.tlb" )

Generated on Sun Feb 24 01:29:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Wincvs Namespace Reference

Compounds

interface Wincvs::IWincvs

Functions

importlib ("stdole32.tlb")

Function Documentation

importlib ( "stdole32.tlb" )

Generated on Sun Feb 24 01:29:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/AdminOptionDlg.cpp Source File

common/AdminOptionDlg.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- October 2001
00019  */
00020
00021 /*
00022  * AdminOptionDlg.cpp --- admin options dialog
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef WIN32
00028 #include "wincvs.h"
00029 #include "AdminOptionDlg.h"
00030 #endif /* WIN32 */
00031
00032 #ifdef _DEBUG
00033 #define new DEBUG_NEW
00034 #undef THIS_FILE
00035 static char THIS_FILE[] = __FILE__;
00036 #endif
00037
00039 // CAdminOptionDlg dialog
00040
00041 #ifdef WIN32
00042
00043 CAdminOptionDlg::CAdminOptionDlg(kAdminOptionDlgType type,
00044                                  CWnd* pParent /*=NULL*/)
00045     : CDialog(CAdminOptionDlg::IDD, pParent)
00046 {
00047     //{{AFX_DATA_INIT(CAdminOptionDlg)
00048     //}}AFX_DATA_INIT
00049
00050     m_optionString = _T("");
00051     m_type = type;
00052     m_singeLine = FALSE;
00053 }
00054
00055
00056 void CAdminOptionDlg::DoDataExchange(CDataExchange* pDX)
00057 {
00058     CDialog::DoDataExchange(pDX);
00059     //{{AFX_DATA_MAP(CAdminOptionDlg)
00060     //}}AFX_DATA_MAP
00061
00062     DDX_Text(pDX, m_singeLine ? IDC_OPTIONSTRING_SL : IDC_OPTIONSTRING, m_optionString);
00063
00064     if( pDX->m_bSaveAndValidate )
00065     {
00066         if( kSetState == m_type && m_optionString.Find(" ") > -1 )
00067         {
00068             AfxMessageBox( "State can't contain the spaces.", MB_ICONSTOP );
00069             pDX->Fail();
00070         }
00071     }
00072 }
00073
00074
00075 BEGIN_MESSAGE_MAP(CAdminOptionDlg, CDialog)
00076     //{{AFX_MSG_MAP(CAdminOptionDlg)
00077     //}}AFX_MSG_MAP
00078 END_MESSAGE_MAP()
00079
00081 // CAdminOptionDlg message handlers
00082
00083 BOOL CAdminOptionDlg::OnInitDialog()
00084 {
00085     //set the title and description
00086     switch( m_type )
00087     {
00088     case kChangeLog:
00089         m_title = "Change log message";
00090         m_optionDescription = "&Log message:";
00091         break;
00092     case kSetState:
00093         m_title = "Set state";
00094         m_optionDescription = "&State:";
00095         m_singeLine = TRUE;
00096         break;
00097     case kSetDescription:
00098         m_title = "Set Description";
00099         m_optionDescription = "&Description";
00100         break;
00101     default:
00102         ASSERT(FALSE); //unknown type
00103         return FALSE;
00104     }
00105
00106     //hide the unneccessary controls and re-position the window if neccessary
00107     GetDlgItem(m_singeLine ? IDC_OPTIONSTRING : IDC_OPTIONSTRING_SL)->EnableWindow(FALSE);
00108     GetDlgItem(m_singeLine ? IDC_OPTIONSTRING : IDC_OPTIONSTRING_SL)->ShowWindow(SW_HIDE);
00109     if( m_singeLine )
00110     {
00111         CRect rectSingleLine;
00112         CRect rectMultiLine;
00113         GetDlgItem(IDC_OPTIONSTRING_SL)->GetWindowRect(rectSingleLine);
00114         GetDlgItem(IDC_OPTIONSTRING)->GetWindowRect(rectMultiLine);
00115         int diff = rectMultiLine.Height() - rectSingleLine.Height();
00116
00117         CRect rect;
00118         GetWindowRect(rect);
00119         SetWindowPos(NULL, 0, 0, rect.Width(), rect.Height() - diff, SWP_NOMOVE | SWP_NOZORDER);
00120         GetDlgItem(IDC_OPTIONDESC)->GetWindowRect(rect);
00121         GetDlgItem(IDC_OPTIONDESC)->SetWindowPos(NULL, 0, 0, rect.Width(), rect.Height() - diff, SWP_NOMOVE | SWP_NOZORDER);
00122         GetDlgItem(IDOK)->GetWindowRect(rect);
00123         ScreenToClient(rect);
00124         rect.OffsetRect(0, -diff);
00125         GetDlgItem(IDOK)->MoveWindow(rect);
00126         GetDlgItem(IDCANCEL)->GetWindowRect(rect);
00127         ScreenToClient(rect);
00128         rect.OffsetRect(0, -diff);
00129         GetDlgItem(IDCANCEL)->MoveWindow(rect);
00130     }
00131
00132     //fix the line endings
00133     m_optionString.Replace("\n", "\r\n");
00134
00135     CDialog::OnInitDialog();
00136
00137     if( !m_title.IsEmpty() )
00138     {
00139         SetWindowText(m_title);
00140     }
00141
00142     if( !m_optionDescription.IsEmpty() )
00143     {
00144         GetDlgItem(IDC_OPTIONDESC)->SetWindowText(m_optionDescription);
00145     }
00146
00147     return TRUE;  // return TRUE unless you set the focus to a control
00148                   // EXCEPTION: OCX Property Pages should return FALSE
00149 }
00150
00151 #endif /* WIN32 */
00152
00153 bool CompatGetAdminOptions(kAdminOptionDlgType type, CPStr& optionString)
00154 {
00155     bool userHitOK = false;
00156
00157 #ifdef WIN32
00158     CAdminOptionDlg adminOptionDlg(type);
00159     adminOptionDlg.m_optionString = (const char*)optionString;
00160     if( adminOptionDlg.DoModal() == IDOK )
00161     {
00162         optionString = (const char*)adminOptionDlg.m_optionString;
00163         userHitOK = true;
00164     }
00165 #endif /* WIN32 */
00166 #ifdef qMacCvsPP
00167 #endif /* qMacCvsPP */
00168 #if qUnix
00169 #endif // qUnix
00170
00171     return userHitOK;
00172 }
Generated on Sun Feb 24 01:21:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/AdminOptionDlg.h Source File

common/AdminOptionDlg.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- October 2001
00019  */
00020
00021 /*
00022  * AdminOptionDlg.h --- admin options dialog
00023  */
00024
00025 #if !defined(AFX_ADMINOPTIONDLG_H__C9A89564_F0A4_4294_8C6C_18469D18BCB3__INCLUDED_)
00026 #define AFX_ADMINOPTIONDLG_H__C9A89564_F0A4_4294_8C6C_18469D18BCB3__INCLUDED_
00027
00028 #if _MSC_VER > 1000
00029 #pragma once
00030 #endif // _MSC_VER > 1000
00031 // AdminOptionDlg.h : header file
00032 //
00033
00034 typedef enum
00035 {
00036     kChangeLog,
00037     kSetState,
00038     kSetDescription
00039 } kAdminOptionDlgType;
00040
00041 bool CompatGetAdminOptions(kAdminOptionDlgType type, CPStr& optionString);
00042     // get the admin options...
00043
00044
00045 #ifdef WIN32
00046
00048 // CAdminOptionDlg dialog
00049
00050 class CAdminOptionDlg : public CDialog
00051 {
00052 // Construction
00053 public:
00054     CAdminOptionDlg(kAdminOptionDlgType type,
00055         CWnd* pParent = NULL);   // standard constructor
00056
00057 // Dialog Data
00058     //{{AFX_DATA(CAdminOptionDlg)
00059     enum { IDD = IDD_ADMINOPTION };
00060     //}}AFX_DATA
00061
00062
00063 // Overrides
00064     // ClassWizard generated virtual function overrides
00065     //{{AFX_VIRTUAL(CAdminOptionDlg)
00066     protected:
00067     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00068     //}}AFX_VIRTUAL
00069
00070 // Implementation
00071 protected:
00072
00073     // Generated message map functions
00074     //{{AFX_MSG(CAdminOptionDlg)
00075     virtual BOOL OnInitDialog();
00076     //}}AFX_MSG
00077     DECLARE_MESSAGE_MAP()
00078 public:
00079     CString m_optionString;
00080 private:
00081     kAdminOptionDlgType m_type;
00082     BOOL m_singeLine;
00083
00084     CString m_title;
00085     CString m_optionDescription;
00086 };
00087
00088 //{{AFX_INSERT_LOCATION}}
00089 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00090
00091 #endif /* WIN32 */
00092
00093 #endif // !defined(AFX_ADMINOPTIONDLG_H__C9A89564_F0A4_4294_8C6C_18469D18BCB3__INCLUDED_)
Generated on Sun Feb 24 01:21:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/AnnotateDlg.cpp Source File

common/AnnotateDlg.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- June 2001
00019  */
00020
00021 /*
00022  * AnnotateDlg.cpp : the cvs annotate dialog
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef WIN32
00028 #   include "wincvs.h"
00029 #   include "OptionalPropertySheet.h"
00030 #endif /* WIN32 */
00031
00032 #if qUnix
00033 #   include "UCvsDialogs.h"
00034 #endif
00035
00036 #ifdef qMacCvsPP
00037 #   include <UModalDialogs.h>
00038 #   include <LRadioButton.h>
00039 #   include <LEditText.h>
00040 #   include <LCheckBox.h>
00041 #   include <LMultiPanelView.h>
00042 #   include <LPopupGroupBox.h>
00043 #   include "LPopupFiller.h"
00044
00045 #   include "MacCvsApp.h"
00046 #endif /* qMacCvsPP */
00047
00048 #include "AnnotateDlg.h"
00049 #include "CvsPrefs.h"
00050
00051
00052 #ifdef WIN32
00053 #include "GetPrefs.h"
00054
00055 #ifdef _DEBUG
00056 #define new DEBUG_NEW
00057 #undef THIS_FILE
00058 static char THIS_FILE[] = __FILE__;
00059 #endif
00060
00062 // CAnnotate_MAIN property page
00063
00064 IMPLEMENT_DYNCREATE(CAnnotate_MAIN, CPropertyPage)
00065
00066 CAnnotate_MAIN::CAnnotate_MAIN() : CPropertyPage(CAnnotate_MAIN::IDD)
00067 {
00068     //{{AFX_DATA_INIT(CAnnotate_MAIN)
00069     m_hasRev = FALSE;
00070     m_isDate = FALSE;
00071     m_force = FALSE;
00072     m_noRecurse = FALSE;
00073     m_strRev = _T("");
00074     //}}AFX_DATA_INIT
00075 }
00076
00077 CAnnotate_MAIN::CAnnotate_MAIN(const char *rev, bool isDate)
00078     : CPropertyPage(CAnnotate_MAIN::IDD)
00079 {
00080     m_hasRev = FALSE;
00081     m_isDate = isDate;
00082     m_strRev = rev;
00083     m_force = FALSE;
00084     m_noRecurse = FALSE;
00085
00086     m_revCombo.SetItems(m_isDate ? &gDateNames : &gRevNames);
00087 }
00088
00089 CAnnotate_MAIN::~CAnnotate_MAIN()
00090 {
00091 }
00092
00093 void CAnnotate_MAIN::DoDataExchange(CDataExchange* pDX)
00094 {
00095     CPropertyPage::DoDataExchange(pDX);
00096     //{{AFX_DATA_MAP(CAnnotate_MAIN)
00097     DDX_Control(pDX, IDC_COMBO_REV, m_revCombo);
00098     DDX_Check(pDX, IDC_SPECIFY_REV, m_hasRev);
00099     DDX_Check(pDX, IDC_ISDATE, m_isDate);
00100     DDX_Check(pDX, IDC_FORCE, m_force);
00101     DDX_Check(pDX, IDC_NORECURS, m_noRecurse);
00102     DDX_CBString(pDX, IDC_COMBO_REV, m_strRev);
00103     //}}AFX_DATA_MAP
00104
00105     if( m_hasRev )
00106     {
00107         DDV_MinChars(pDX, m_strRev, 1);
00108     }
00109
00110     DDX_ComboMString(pDX, IDC_COMBO_REV, m_revCombo);
00111
00112     if( !pDX->m_bSaveAndValidate )
00113     {
00114         OnSpecifyRev();
00115     }
00116 }
00117
00118
00119 BEGIN_MESSAGE_MAP(CAnnotate_MAIN, CPropertyPage)
00120 //{{AFX_MSG_MAP(CAnnotate_MAIN)
00121 ON_BN_CLICKED(IDC_SPECIFY_REV, OnSpecifyRev)
00122 ON_BN_CLICKED(IDC_ISDATE, OnIsdate)
00123 //}}AFX_MSG_MAP
00124 END_MESSAGE_MAP()
00125
00127 // CAnnotate_MAIN message handlers
00128
00129 void CAnnotate_MAIN::OnSpecifyRev()
00130 {
00131     CButton* btnHasRev = (CButton*)GetDlgItem(IDC_SPECIFY_REV);
00132     CWnd* wndIsDate = GetDlgItem(IDC_ISDATE);
00133     CWnd* wndRev = GetDlgItem(IDC_COMBO_REV);
00134     CWnd* wndForce = GetDlgItem(IDC_FORCE);
00135
00136     BOOL bEnable = btnHasRev->GetCheck();
00137
00138     wndIsDate->EnableWindow(bEnable);
00139     wndRev->EnableWindow(bEnable);
00140     wndForce->EnableWindow(bEnable);
00141 }
00142
00143 void CAnnotate_MAIN::OnIsdate()
00144 {
00145     CButton* btnIsDate = (CButton*)GetDlgItem(IDC_ISDATE);
00146     BOOL isDate = btnIsDate->GetCheck();
00147
00148     m_revCombo.SetItems(isDate ? &gDateNames : &gRevNames);
00149     DDX_ComboMString(NULL, IDC_COMBO_REV, m_revCombo);
00150 }
00151
00152 #endif /* WIN32 */
00153
00154 bool CompatGetAnnotate(bool & noRecurs, bool & isDate, CPStr & rev, bool & force)
00155 {
00156     bool userHitOK = false;
00157
00158     static CPStr sLastRev;
00159     static bool bIsDate = false;
00160
00161     rev = "";
00162     noRecurs = false;
00163     force = false;
00164     bool hasRev = false;
00165     isDate = bIsDate;
00166
00167 #ifdef WIN32
00168     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgAnnotate(), "Annotate settings");
00169     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00170     CAnnotate_MAIN page1(sLastRev, isDate);
00171     CGetPrefs_GLOBALS page2;
00172     pages.AddPage(&page1);
00173     pages.AddPage(&page2);
00174     if(pages.DoModal() == IDOK)
00175     {
00176         noRecurs = page1.m_noRecurse == TRUE;
00177
00178         sLastRev = page1.m_strRev;
00179         isDate = page1.m_isDate == TRUE;
00180         hasRev = page1.m_hasRev == TRUE;
00181         force = page1.m_force == TRUE;
00182
00183         page2.StoreValues();
00184         gCvsPrefs.SetHideCommandDlgAnnotate(pages.GetHideCommandDlg());
00185         userHitOK = true;
00186     }
00187 #endif /* WIN32 */
00188
00189 #ifdef qMacCvsPP
00190 #endif /* qMacCvsPP */
00191
00192 #if qUnix
00193 #endif // qUnix
00194
00195     if(userHitOK)
00196     {
00197         if(hasRev)
00198             rev = sLastRev;
00199         bIsDate = isDate;
00200
00201         gCvsPrefs.save();
00202     }
00203
00204     return userHitOK;
00205 }
Generated on Sun Feb 24 01:21:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/AnnotateDlg.h Source File

common/AnnotateDlg.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- June 2001
00019  */
00020
00021 /*
00022  * AnnotateDlg.h : the cvs annotate dialog
00023  */
00024
00025 #if !defined(AFX_ANNOTATEDLG_H__864729EE_838B_473D_8723_E1269829F781__INCLUDED_)
00026 #define AFX_ANNOTATEDLG_H__864729EE_838B_473D_8723_E1269829F781__INCLUDED_
00027
00028 #if _MSC_VER > 1000
00029 #pragma once
00030 #endif // _MSC_VER > 1000
00031
00032 #include "CPStr.h"
00033 #include "MultiString.h"
00034 #include "SmartComboBox.h"
00035
00036 bool CompatGetAnnotate(bool & noRecurs, bool & isDate, CPStr & rev, bool & force);
00037     // get the annotate options...
00038
00039 extern CMString gRevNames;
00040 extern CMString gDateNames;
00041     // persistent default values for the dates, tags...
00042
00043 #ifdef WIN32
00044
00046 // CAnnotate_MAIN dialog
00047
00048 class CAnnotate_MAIN : public CPropertyPage
00049 {
00050     DECLARE_DYNCREATE(CAnnotate_MAIN)
00051
00052 // Construction
00053 public:
00054     CAnnotate_MAIN(const char *rev, bool isDate);
00055     CAnnotate_MAIN();
00056     ~CAnnotate_MAIN();
00057
00058 // Dialog Data
00059     //{{AFX_DATA(CAnnotate_MAIN)
00060     enum { IDD = IDD_ANNOTATE_MAIN };
00061     CSmartComboBox  m_revCombo;
00062     BOOL    m_hasRev;
00063     BOOL    m_isDate;
00064     BOOL    m_force;
00065     BOOL    m_noRecurse;
00066     CString m_strRev;
00067     //}}AFX_DATA
00068
00069
00070 // Overrides
00071     // ClassWizard generate virtual function overrides
00072     //{{AFX_VIRTUAL(CAnnotate_MAIN)
00073     protected:
00074     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00075     //}}AFX_VIRTUAL
00076
00077 // Implementation
00078 protected:
00079     // Generated message map functions
00080     //{{AFX_MSG(CAnnotate_MAIN)
00081     afx_msg void OnSpecifyRev();
00082     afx_msg void OnIsdate();
00083     //}}AFX_MSG
00084     DECLARE_MESSAGE_MAP()
00085
00086 };
00087
00088 //{{AFX_INSERT_LOCATION}}
00089 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00090 #endif /* WIN32 */
00091
00092 #endif // !defined(AFX_ANNOTATEDLG_H__864729EE_838B_473D_8723_E1269829F781__INCLUDED_)
Generated on Sun Feb 24 01:21:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/AppConsole.cpp Source File

common/AppConsole.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * AppConsole.cpp --- output to the console
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef qMacCvsPP
00028 #   include "MacCvsApp.h"
00029 #   include "LogWindow.h"
00030 #endif /* qMacCvsPP */
00031
00032 #ifdef qUnix
00033 #   include "UCvsConsole.h"
00034 #   include "UCvsCommands.h"
00035 #   include "uconsole.h"
00036 #endif /* qUnix */
00037
00038 #include <string.h>
00039 #include <stdarg.h>
00040 #include <stdio.h>
00041 #include "AppConsole.h"
00042
00043 #ifdef WIN32
00044 #   include "wincvs.h"
00045 #   include "wincvsView.h"
00046
00047 #   ifdef _DEBUG
00048 #   define new DEBUG_NEW
00049 #   undef THIS_FILE
00050     static char THIS_FILE[] = __FILE__;
00051 #   endif
00052 #endif /* WIN32 */
00053
00054 void cvs_out(const char *format, ...)
00055 {
00056     va_list args;
00057     char mess[1024] = {'\0'};
00058
00059     va_start (args, format);
00060     vsprintf (mess, format, args);
00061     va_end (args);
00062
00063 #ifdef WIN32
00064     CWinApp* app = AfxGetApp();
00065     //ASSERT(app->IsKindOf(RUNTIME_CLASS(CWincvsApp)));
00066     CWincvsView *view = ((CWincvsApp *)app)->GetConsoleView();
00067     if(view == NULL)
00068         return;
00069
00070     view->OutConsole(mess, strlen(mess));
00071 #endif /* WIN32 */
00072 #ifdef qMacCvsPP
00073     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00074     if(log == 0L)
00075         return;
00076     log->WriteCharsToConsole(mess, strlen(mess));
00077 #endif /* qMacCvsPP */
00078 #ifdef qUnix
00079     UCvsConsole* console = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00080     if(console == 0L)
00081     {
00082         UAppConsole(mess);
00083         return;
00084     }
00085
00086     console->OutConsole(mess, strlen(mess));
00087 #endif /* qUnix */
00088 }
00089
00090 void cvs_err(const char *format, ...)
00091 {
00092     va_list args;
00093     char mess[1024] = {'\0'};
00094
00095     va_start (args, format);
00096     vsprintf (mess, format, args);
00097     va_end (args);
00098
00099 #ifdef WIN32
00100     CWinApp* app = AfxGetApp();
00101     //ASSERT(app->IsKindOf(RUNTIME_CLASS(CWincvsApp)));
00102     CWincvsView *view = ((CWincvsApp *)app)->GetConsoleView();
00103     if(view == NULL)
00104         return;
00105
00106     view->OutConsole(mess, strlen(mess), true);
00107 #endif /* WIN32 */
00108 #ifdef qMacCvsPP
00109     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00110     if(log == 0L)
00111         return;
00112     log->WriteCharsToConsole(mess, strlen(mess), true);
00113 #endif /* qMacCvsPP */
00114 #ifdef qUnix
00115     UCvsConsole* console = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00116     if(console == 0L)
00117     {
00118         UAppConsole(mess);
00119         return;
00120     }
00121
00122     console->OutConsole(mess, strlen(mess), true);
00123 #endif /* qUnix */
00124 }
00125
00126 void cvs_outstr(const char *str, size_t len)
00127 {
00128 #ifdef WIN32
00129     CWinApp* app = AfxGetApp();
00130     //ASSERT(app->IsKindOf(RUNTIME_CLASS(CWincvsApp)));
00131     CWincvsView *view = ((CWincvsApp *)app)->GetConsoleView();
00132     if(view == NULL)
00133         return;
00134
00135     view->OutConsole(str, len);
00136 #endif /* WIN32 */
00137 #ifdef qMacCvsPP
00138     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00139     if(log == 0L)
00140         return;
00141     log->WriteCharsToConsole(str, len);
00142 #endif /* qMacCvsPP */
00143 #ifdef qUnix
00144     UCvsConsole* console = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00145     if(console == 0L)
00146     {
00147         UAppConsole(str);
00148         return;
00149     }
00150
00151     console->OutConsole(str, len);
00152 #endif /* qUnix */
00153 }
00154
00155 void cvs_errstr(const char *str, size_t len)
00156 {
00157 #ifdef WIN32
00158     CWinApp* app = AfxGetApp();
00159     //ASSERT(app->IsKindOf(RUNTIME_CLASS(CWincvsApp)));
00160     CWincvsView *view = ((CWincvsApp *)app)->GetConsoleView();
00161     if(view == NULL)
00162         return;
00163
00164     view->OutConsole(str, len, true);
00165 #endif /* WIN32 */
00166 #ifdef qMacCvsPP
00167     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00168     if(log == 0L)
00169         return;
00170     log->WriteCharsToConsole(str, len, true);
00171 #endif /* qMacCvsPP */
00172 #ifdef qUnix
00173     UCvsConsole* console = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00174     if(console == 0L)
00175     {
00176         UAppConsole(str);
00177         return;
00178     }
00179
00180     console->OutConsole(str, len, true);
00181 #endif /* qUnix */
00182 }
00183
00184 #ifdef WIN32
00185 CWincvsView * CColorConsole::GetView()
00186 {
00187     CWinApp* app = AfxGetApp();
00188     CWincvsView *view = fView != 0L ? fView : ((CWincvsApp *)app)->GetConsoleView();
00189     if(view && view->m_hWnd == 0L)
00190         view = 0L;
00191     return view;
00192 }
00193 #endif /* WIN32 */
00194
00195 CColorConsole::CColorConsole()
00196 {
00197 #ifdef WIN32
00198     fView = 0L;
00199     CWincvsView *view = GetView();
00200     if(view == 0L)
00201         return;
00202
00203     oldFormat = view->GetCurFormat();
00204 #else /* !WIN32 */
00205     *this << kNormal;
00206 #endif /* !WIN32 */
00207 }
00208
00209 #ifdef WIN32
00210 CColorConsole::CColorConsole(CWincvsView * aview)
00211 {
00212     fView = aview;
00213     CWincvsView *view = GetView();
00214     if(view == 0L)
00215         return;
00216
00217     oldFormat = view->GetCurFormat();
00218 }
00219 #endif /* WIN32 */
00220
00221 CColorConsole::~CColorConsole()
00222 {
00223     *this << kNormal;
00224 }
00225
00226 CColorConsole & CColorConsole::operator<<(char c)
00227 {
00228 #ifdef WIN32
00229     CWincvsView *view = GetView();
00230     if(view == 0L)
00231         return *this;
00232
00233     view->OutColor(&c, 1);
00234 #endif /* WIN32 */
00235 #ifdef qMacCvsPP
00236     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00237     if(log == 0L)
00238         return *this;
00239
00240     log->OutColor(&c, 1);
00241 #endif /* qMacCvsPP */
00242 #ifdef qUnix
00243     UCvsConsole *log = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00244     if(log == 0L)
00245         return *this;
00246
00247     log->OutColor(&c, 1);
00248 #endif /* qUnix */
00249
00250     return *this;
00251 }
00252
00253 CColorConsole & CColorConsole::operator<<(kConsoleColor color)
00254 {
00255 #ifdef WIN32
00256     CWincvsView *view = GetView();
00257     if(view == 0L)
00258         return *this;
00259
00260     if(color == kNL)
00261     {
00262         char tmp[2] = {0x0a};
00263         view->OutColor(tmp, 1);
00264     }
00265     else if(color == kNormal)
00266     {
00267         oldFormat.dwMask = CFM_COLOR | CFM_BOLD | CFM_ITALIC | CFE_UNDERLINE;
00268         view->OutColor(oldFormat);
00269     }
00270     else
00271         view->OutColor(color);
00272 #endif /* WIN32 */
00273 #ifdef qMacCvsPP
00274     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00275     if(log == 0L)
00276         return *this;
00277
00278     if(color == kNL)
00279     {
00280         char tmp[1] = {0x0d};
00281         log->OutColor(tmp, 1);
00282     }
00283     else
00284         log->OutColor(color);
00285 #endif /* qMacCvsPP */
00286 #ifdef qUnix
00287     UCvsConsole *log = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00288     if(log == 0L)
00289         return *this;
00290
00291     if(color == kNL)
00292     {
00293         char tmp[1] = {0x0a};
00294         log->OutColor(tmp, 1);
00295     }
00296     else
00297         log->OutColor(color);
00298 #endif /* qUnix */
00299
00300     return *this;
00301 }
00302
00303 CColorConsole & CColorConsole::operator<<(const char *str)
00304 {
00305 #ifdef WIN32
00306     CWincvsView *view = GetView();
00307     if(view == 0L)
00308         return *this;
00309
00310     view->OutColor(str, strlen(str));
00311 #endif /* WIN32 */
00312 #ifdef qMacCvsPP
00313     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00314     if(log == 0L)
00315         return *this;
00316
00317     log->OutColor(str, strlen(str));
00318 #endif /* qMacCvsPP */
00319 #ifdef qUnix
00320     UCvsConsole *log = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00321     if(log == 0L)
00322         return *this;
00323
00324     log->OutColor(str, strlen(str));
00325 #endif /* qUnix */
00326
00327     return *this;
00328 }
00329
00330 CColorConsole & CColorConsole::operator<<(int value)
00331 {
00332 #ifdef WIN32
00333     CWincvsView *view = GetView();
00334     if(view == 0L)
00335         return *this;
00336
00337     char tmp[20] = {'\0'};
00338     sprintf(tmp, "%d", value);
00339     view->OutColor(tmp, strlen(tmp));
00340 #endif /* WIN32 */
00341 #ifdef qMacCvsPP
00342     CLogWindow *log = CMacCvsApp::gApp != 0L ? CMacCvsApp::gApp->GetLogWindow() : 0L;
00343     if(log == 0L)
00344         return *this;
00345
00346     char tmp[20] = {'\0'};
00347     sprintf(tmp, "%d", value);
00348     log->OutColor(tmp, strlen(tmp));
00349 #endif /* qMacCvsPP */
00350 #ifdef qUnix
00351     UCvsConsole *log = (UCvsConsole *)::UEventQueryWidget(kUMainConsoleID);
00352     if(log == 0L)
00353         return *this;
00354
00355     char tmp[20] = {'\0'};
00356     sprintf(tmp, "%d", value);
00357     log->OutColor(tmp, strlen(tmp));
00358 #endif /* qUnix */
00359
00360     return *this;
00361 }
00362
Generated on Sun Feb 24 01:21:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/AppConsole.h Source File

common/AppConsole.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * AppConsole.h --- output to the console
00023  */
00024
00025 #ifndef APPCONSOLE_H
00026 #define APPCONSOLE_H
00027
00028 #include <stdio.h>
00029
00030 void cvs_out(const char *format, ...);
00031 void cvs_err(const char *format, ...);
00032 void cvs_outstr(const char *str, size_t len);
00033 void cvs_errstr(const char *str, size_t len);
00034
00035 typedef enum
00036 {
00037     kNormal,
00038     kBrown,
00039     kGreen,
00040     kMagenta,
00041     kRed,
00042     kBlue,
00043     kBold,
00044     kItalic,
00045     kUnderline,
00046     kNL // newline
00047 } kConsoleColor;
00048
00049 #ifdef WIN32
00050 class CWincvsView;
00051 #endif /* WIN32 */
00052
00053 class CColorConsole
00054 {
00055 public:
00056     CColorConsole();
00057     virtual ~CColorConsole();
00058
00059     CColorConsole & operator<<(char c);
00060     CColorConsole & operator<<(kConsoleColor color);
00061     CColorConsole & operator<<(const char *str);
00062     CColorConsole & operator<<(int value);
00063 protected:
00064 #ifdef WIN32
00065     CWincvsView * fView;
00066     CWincvsView * GetView();
00067     CHARFORMAT oldFormat;
00068 public:
00069     CColorConsole(CWincvsView * aview);
00070 #endif /* WIN32 */
00071 };
00072
00073 #if defined(macintosh) && !defined(qMacCvsPP)
00074     // for the mpw tools
00075 #   define cvs_out printf
00076 #   define cvs_err printf
00077 #endif /* macintosh && !qMacCvsPP */
00078
00079 #endif /* APPCONSOLE_H */
Generated on Sun Feb 24 01:21:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/AppGlue.cpp Source File

common/AppGlue.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * AppGlue.cpp --- glue code to access CVS services
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef macintosh
00028 #   include <TextUtils.h>
00029 #   include <Strings.h>
00030 #   include <Dialogs.h>
00031 #   include <unistd.h>
00032 #   include <errno.h>
00033 #   include <console.h>
00034 #   include <ctype.h>
00035 #   include "mktemp.h"
00036 #   include "dll_process.h"
00037 #   include "AppGlue.mac.h"
00038 #   include "MacMisc.h"
00039 #endif /* macintosh */
00040
00041 #ifdef qMacCvsPP
00042 #   include "MacCvsApp.h"
00043 #   include "LogWindow.h"
00044 #   include "MacBinEncoding.h"
00045 #   include "MacCvsAE.h"
00046 #endif /* qMacCvsPP */
00047
00048 #ifdef WIN32
00049 #   include "wincvs.h"
00050 #   include "wincvsView.h"
00051 #   include "PromptFiles.h"
00052 #   include "BrowseFileView.h"
00053 #   include <process.h>
00054 #   include <direct.h>
00055
00056 #   ifdef _DEBUG
00057 #   define new DEBUG_NEW
00058 #   undef THIS_FILE
00059     static char THIS_FILE[] = __FILE__;
00060 #   endif
00061 #endif /* WIN32 */
00062
00063 #if !TARGET_RT_MAC_CFM
00064 #   include "cvsgui_process.h"
00065 #endif
00066
00067 #if qUnix
00068 #   include "UCvsApp.h"
00069 #   include "UCvsFiles.h"
00070 #   include <ctype.h>
00071 #endif /* qUnix */
00072
00073 #include <stdio.h>
00074 #include <stdlib.h>
00075 #include <string.h>
00076 #include <stdarg.h>
00077
00078 #ifdef HAVE_ERRNO_H
00079 #   include <errno.h>
00080 #endif
00081
00082 #ifdef HAVE_UNISTD_H
00083 #   include <unistd.h>
00084 #endif
00085
00086 #include <vector>
00087
00088 #include "Authen.h"
00089 #include "CvsPrefs.h"
00090 #include "AppGlue.h"
00091 #include "AppConsole.h"
00092 #include "GetPassword.h"
00093 #include "AskYesNo.h"
00094 #include "CvsArgs.h"
00095 #include "FileTraversal.h"
00096
00097 // overide console
00098 CCvsConsole * gConsole = 0L;
00099 static int sLastExitCode;
00100
00101 #ifdef _MSC_VER
00102 #   define CVS_EXTERN_C extern "C"
00103 #else
00104 #   define CVS_EXTERN_C
00105 #endif
00106
00107 #if !TARGET_RT_MAC_CFM
00108 static CvsProcessCallbacks sCallTable = {
00109     glue_consoleout,
00110     glue_consoleerr,
00111     glue_getenv,
00112     glue_exit
00113 };
00114 #endif
00115
00116 CVS_EXTERN_C void glue_exit(int code)
00117 {
00118     if(!gCvsPrefs.IsTclFileRunning())
00119         cvs_out("\n*****CVS exited normally with code %d*****\n\n", code);
00120     sLastExitCode = code;
00121 }
00122
00123 CVS_EXTERN_C long glue_consoleout(char *txt, long len)
00124 {
00125     if(gConsole != 0L)
00126         return gConsole->cvs_out(txt, len);
00127
00128 #ifdef macintosh
00129     // apple event output
00130     long newlen;
00131     if((newlen = ae_consoleout(txt, len)) != -1)
00132         return newlen;
00133 #endif
00134
00135     cvs_outstr(txt, len);
00136
00137     return len;
00138 }
00139
00140 CVS_EXTERN_C long glue_consoleerr(char *txt, long len)
00141 {
00142     if(gConsole != 0L)
00143         return gConsole->cvs_err(txt, len);
00144
00145 #ifdef macintosh
00146     // apple event output
00147     long newlen;
00148     if((newlen = ae_consoleout(txt, len)) != -1)
00149         return newlen;
00150 #endif
00151
00152     cvs_errstr(txt, len);
00153
00154     return len;
00155 }
00156
00157 CVS_EXTERN_C long glue_consolein(char *txt, long len)
00158 {
00159 #ifdef macintosh
00160     // apple event input
00161     long newlen;
00162     if((newlen = ae_consolein(txt, len)) != -1)
00163         return newlen;
00164 #endif /* !macintosh */
00165
00166     return 0;
00167 }
00168
00169 #ifdef macintosh
00170 #   define isGlobalEnvVariable(name) ( \
00171         strcmp(name, "CVS_PSERVER_PORT") == 0 || \
00172         strcmp(name, "CVS_RCMD_PORT") == 0 || \
00173         strcmp(name, "CVS_SERVER") == 0 || \
00174         strcmp(name, "CVS_RSH") == 0 || \
00175         strcmp(name, "CVS_RSA_IDENTITY") == 0 || \
00176         strcmp(name, "HOME") == 0 || \
00177         strcmp(name, "ISO8859") == 0 || \
00178         strcmp(name, "IC_ON_TXT") == 0 || \
00179         strcmp(name, "MAC_DEFAULT_RESOURCE_ENCODING") == 0 || \
00180         strcmp(name, "MAC_BINARY_TYPES_SINGLE") == 0 || \
00181         strcmp(name, "MAC_BINARY_TYPES_HQX") == 0 || \
00182         strcmp(name, "MAC_BINARY_TYPES_PLAIN") == 0 || \
00183         strcmp(name, "CVSUSEUNIXLF") == 0 || \
00184         strcmp(name, "DIRTY_MCP") == 0 \
00185         )
00186 #endif /* macintosh */
00187
00188 CVS_EXTERN_C const char *glue_getenv(char *name)
00189 {
00190     if(name == NULL)
00191         return NULL;
00192
00193 #ifdef WIN32
00194     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00195     if(::GetCurrentThreadId() != app->m_nThreadID &&
00196         (strcmp(name, "CVS_GETPASS") == 0 || strcmp(name, "CVSLIB_YESNO") == 0 ||
00197         strcmp(name, "HOME") == 0))
00198     {
00199         // synchonize it since the thread calls and
00200         // we call some MFC objects in it (prompt
00201         // password, get path...)
00202         CCvsThreadLock threadLock;
00203
00204         return app->GetEnvMainThread(name);
00205     }
00206 #endif /* WIN32 */
00207
00208 #ifdef macintosh
00209     char *result;
00210     if((result = ae_getenv(name)) != (char *)-1)
00211     {
00212         if(result == 0L && isGlobalEnvVariable(name))
00213         {
00214             // in this case only we let continue
00215             // to get the MacCVS settings. So the CWCVS
00216             // users (or any AppleEvent user) can set
00217             // these variables in MacCVS but still can overide
00218             // them using Apple Events.
00219         }
00220         else
00221             return result;
00222     }
00223 #endif /* macintosh */
00224
00225     // new : give a chance for the new AuthenModel to react to the getenv
00226     // callback
00227     AuthenModel *curModel = AuthenModel::GetInstance(gAuthen.kind());
00228     std::vector<AuthenModel *> & allInstances = AuthenModel::GetAllInstances();
00229     std::vector<AuthenModel *>::const_iterator i;
00230
00231     if(curModel != 0L)
00232     {
00233         const char *res = curModel->OnGetEnv(name);
00234         if(res != 0L)
00235             return res;
00236     }
00237
00238     for(i = allInstances.begin(); i != allInstances.end(); ++i)
00239     {
00240         AuthenModel *model = *i;
00241
00242         if(model == curModel)
00243             continue;
00244
00245         const char *res = model->OnGetEnv(name);
00246         if(res != 0L)
00247             return res;
00248     }
00249
00250     if(strcmp(name, "USER") == 0
00251 #ifdef WIN32
00252         // I do that (and see the "STRATA_HACK" in
00253         // subr.c) because people get tired on Windows
00254         // to have to check their Windows login :
00255         // this is only for .rhosts authentication.
00256         || strcmp(name, "LOGNAME") == 0
00257 #endif /* WIN32 */
00258         )
00259     {
00260         static char user[64];
00261
00262         // extract from the cvsroot
00263         const char *ccvsroot = gCvsPrefs;
00264         ccvsroot = Authen::skiptoken(ccvsroot);
00265         char *login = strchr(ccvsroot, '@');
00266         if(login == NULL)
00267         {
00268             // for WIN32 this means the CVSROOT is local
00269 #ifdef macintosh
00270             cvs_err("MacCvs: Cannot extract login from cvsroot %s !\n", ccvsroot);
00271 #endif /* macintosh */
00272             return NULL;
00273         }
00274         int length = login - ccvsroot;
00275         memcpy(user, ccvsroot, length * sizeof(char));
00276         user[length] = '\0';
00277         return user;
00278     }
00279     else if(strcmp(name, "CVSROOT") == 0)
00280     {
00281         static CStr root;
00282
00283         // extract from the cvsroot
00284         const char *ccvsroot = gCvsPrefs;
00285         ccvsroot = Authen::skiptoken(ccvsroot);
00286         root = gAuthen.token();
00287         root << ccvsroot;
00288         return root;
00289     }
00290     else if(strcmp(name, "CVSREAD") == 0)
00291     {
00292         return gCvsPrefs.CheckoutRO() ? (char *)"1" : 0L;
00293     }
00294     else if(strncmp(name, "CVS_GETPASS", strlen("CVS_GETPASS")) == 0)
00295     {
00296         UStr str("Enter the password:");
00297         char *tmp;
00298         if((tmp = strchr(name, '=')) != 0L)
00299         {
00300             str = ++tmp;
00301         }
00302         return CompatGetPassword(str);
00303     }
00304     else if(strcmp(name, "CVSLIB_YESNO") == 0)
00305     {
00306         return (char *)AskYesNo();
00307     }
00308     else if(strcmp(name, "DIRTY_MCP") == 0)
00309     {
00310         return gCvsPrefs.DirtySupport() ? (char *)"yes" : (char *)"no";
00311     }
00312 #ifdef WIN32
00313     else if(strcmp(name, "HOME") == 0)
00314     {
00315         // prompt for home the first time
00316         if(gCvsPrefs.Home() == 0L)
00317         {
00318             char oldpath[512];
00319             getcwd(oldpath, 511);
00320             const char *chome = BrowserGetDirectory("Select your home directory :");
00321             if(chome == 0L)
00322             {
00323                 chdir(oldpath);
00324                 return 0L;
00325             }
00326
00327             gCvsPrefs.SetHome(chome);
00328             gCvsPrefs.save();
00329             chdir(oldpath);
00330         }
00331
00332         // Windows 98 doesn't like C:\/.cvspass
00333         static CStr home;
00334         home = gCvsPrefs.Home();
00335         if(home.endsWith(kPathDelimiter))
00336         {
00337             home[home.length() - 1] = '\0';
00338         }
00339
00340         return home;
00341     }
00342     else if(strcmp(name, "CVSUSEUNIXLF") == 0)
00343     {
00344         return gCvsPrefs.UnixLF() ? (char *)"1" : 0L;
00345     }
00346 #endif /*WIN32 */
00347 #if TARGET_RT_MAC_MACHO
00348     else if(strcmp(name, "CVS_MACLF") == 0)
00349     {
00350         return gCvsPrefs.MacLF() ? (char *)"1" : 0L;
00351     }
00352 #endif
00353 #if TARGET_RT_MAC_CFM
00354     else if(strcmp(name, "HOME") == 0)
00355     {
00356         UFSSpec theFolder;
00357         static UStr thePath;
00358
00359         if(MacGetPrefsFolder(theFolder, thePath) != noErr)
00360         {
00361             cvs_err("Unable to locate the preferences folder !\n");
00362             return 0L;
00363         }
00364
00365         // We do not use any more the "@@@" trick. Instead
00366         // we let cvs convert it to a Unix path.
00367         //strcpy(thePath, "@@@");
00368         return thePath;
00369     }
00370     else if(strcmp(name, "CVSUSEUNIXLF") == 0)
00371     {
00372         return gCvsPrefs.UnixLF() ? (char *)"1" : 0L;
00373     }
00374 #endif
00375 #ifdef macintosh
00376     else if(strcmp(name, "ISO8859") == 0)
00377     {
00378         static char iso[6];
00379
00380         if(gCvsPrefs.IsoConvert() == ISO8559_none)
00381             return 0L;
00382
00383         sprintf(iso, "%d", (int)gCvsPrefs.IsoConvert());
00384         return iso;
00385     }
00386     else if(strcmp(name, "IC_ON_TXT") == 0)
00387     {
00388         return gCvsPrefs.ICTextOption() ? (char *)"1" : 0L;
00389     }
00390     else if(strcmp(name, "MAC_DEFAULT_RESOURCE_ENCODING") == 0)
00391     {
00392         switch(gCvsPrefs.MacBinEncoding())
00393         {
00394             case MAC_HQX:
00395                 return (char *)"HQX";
00396                 break;
00397             case MAC_APPSINGLE:
00398                 return (char *)"AppleSingle";
00399                 break;
00400         }
00401         return 0L;
00402     }
00403     else if(strcmp(name, "MAC_BINARY_TYPES_SINGLE") == 0)
00404     {
00405         return (char *)MacBinMaps::GetEnvTypes(MAC_APPSINGLE);
00406     }
00407     else if(strcmp(name, "MAC_BINARY_TYPES_HQX") == 0)
00408     {
00409         return (char *)MacBinMaps::GetEnvTypes(MAC_HQX);
00410     }
00411     else if(strcmp(name, "MAC_BINARY_TYPES_PLAIN") == 0)
00412     {
00413         return (char *)MacBinMaps::GetEnvPlainTypes();
00414     }
00415 #endif /* macintosh */
00416     else {
00417         char *res;
00418         res = getenv(name);
00419         return res;
00420     }
00421
00422     return NULL;
00423 }
00424
00425 class CAuthenSetUp
00426 {
00427 public:
00428     CAuthenSetUp()
00429     {
00430         AuthenModel *curModel = AuthenModel::GetInstance(gAuthen.kind());
00431         if(curModel != 0L)
00432             curModel->OnSetupEnv();
00433     }
00434
00435     ~CAuthenSetUp()
00436     {
00437         AuthenModel *curModel = AuthenModel::GetInstance(gAuthen.kind());
00438         if(curModel != 0L)
00439             curModel->OnRestoreEnv();
00440     }
00441 };
00442
00443 int testCVS(const char *cvsfile, int argc, char * const *argv)
00444 {
00445     CAuthenSetUp setupEnv;
00446
00447 #ifdef macintosh
00448     return -1;
00449 #elif defined(WIN32) || defined qUnix
00450     CStr cvscmd(cvsfile);
00451
00452     sLastExitCode = 1;
00453
00454 #ifdef WIN32
00455     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00456     if( app->gCvsRunning && cvs_process_is_active(app->gCvsProcess) )   {
00457         cvs_err("Error : cvs is already running !\n");
00458         return -1;
00459     }
00460
00461     app->gCvsStopping = false;
00462 #elif qUnix
00463     if(UCvsApp::gApp->IsCvsRunning())   {
00464         cvs_err("Error : cvs is already running !\n");
00465         return errInternal;
00466     }
00467
00468     UCvsApp::gApp->SetCvsStopping(false);
00469 #endif
00470
00471     struct stat sb;
00472
00473     if(stat(cvscmd, &sb) == -1 ||
00474 #ifdef qUnix
00475          S_ISLNK(sb.st_mode) ||
00476 #endif
00477          !(S_ISREG(sb.st_mode)))
00478     {
00479         cvs_err("Unable to find the cvs process in : (error %d)\n", errno);
00480         cvs_err("1) %s\n", (const char *)cvscmd);
00481         return -1;
00482     }
00483
00484     //CvsProcess *proc = cvs_process_test(cvscmd, argc - 1, (char **)argv + 1, &sCallTable);
00485     CvsProcess *proc = cvs_process_open(cvscmd, argc - 1, (char **)argv + 1,
00486         &sCallTable, gCvsPrefs.CvsConsole(), NULL);
00487
00488     if(proc == 0L)
00489     {
00490         cvs_err("Unable to initialize the cvs process (error %d)\n", errno);
00491         cvs_err("The cvs used is : %s\n", (const char *)cvscmd);
00492     }
00493     else
00494     {
00495 #ifdef WIN32
00496         app->gCvsRunning = true;
00497         app->gCvsProcess = proc;
00498 #endif
00499
00500         time_t start = time(NULL);
00501
00502         while( (time(NULL) - start ) < 20) {
00503 #ifdef WIN32
00504             app->PeekPumpAndIdle();
00505 #endif
00506             cvs_process_give_time();
00507
00508             if( !cvs_process_is_active(proc) )
00509                 break;
00510
00511             if( (time(NULL) - start ) > 10 ) {
00512                 cvs_err("testing cvs timed out");
00513                 cvs_process_kill( proc );
00514             }
00515         }
00516
00517 /*#ifdef qUnix
00518         else {
00519             UCvsApp::gApp->SetCvsRunning(true);
00520             UCvsApp::gCurCvs = proc;
00521         }
00522 #endif*/
00523     }
00524
00525     return sLastExitCode;
00526 #endif
00527 }
00528
00529 int launchCVS(const char *path, int argc, char * const *argv, CCvsConsole * console)
00530 {
00531     CAuthenSetUp setupEnv;
00532
00533     gConsole = console;
00534
00535 #if TARGET_RT_MAC_CFM
00536     CompatConnectID connID;
00537
00538     if(!loadCVS(connID))
00539         return errInternal;
00540
00541     int exitc = 0;
00542
00543     // call the main
00544     if(!CompatCallLibrary3(connID, exitc, uppMainProcInfo, "dllglue_main",
00545         dllglue_main_func, path, argc, (char **)argv))
00546     {
00547         cvs_err("Error : Cannot find symbol ""dllglue_main""\n");
00548         exitc = errInternal;
00549     }
00550
00551
00552     unloadCVS(connID, exitc);
00553
00554     return exitc;
00555 #elif qUnix_old
00556     CStr cvscmd;
00557
00558     sLastExitCode = 0;
00559
00560     if(UCvsApp::gApp->IsCvsRunning())
00561     {
00562         cvs_err("Error : cvs is already running !\n");
00563         return errInternal;
00564     }
00565
00566     if(path != 0L && chdir(path) != 0)
00567     {
00568         cvs_err("Error : cannot chdir to %s (error %d)!\n", path, errno);
00569     }
00570
00571     UCvsApp::gApp->SetCvsStopping(false);
00572
00573     struct stat sb;
00574     cvscmd = "/home/bruenen/PRIVAT/cvsgui/cvsunix/src/cvs"; //UCvsApp::gApp->GetAppLibFolder();
00575     if(!cvscmd.endsWith(kPathDelimiter))
00576         cvscmd << kPathDelimiter;
00577     cvscmd << "cvs";
00578     UStr firstCmd = cvscmd;
00579     if(stat(cvscmd, &sb) == -1 || !(S_ISREG(sb.st_mode) || S_ISLNK(sb.st_mode)))
00580     {
00581         cvscmd = PACKAGE_SOURCE_DIR;
00582         CStr uppath, folder;
00583         SplitPath(cvscmd, uppath, folder);
00584         cvscmd = uppath;
00585         if(!cvscmd.endsWith(kPathDelimiter))
00586             cvscmd << kPathDelimiter;
00587         cvscmd << "cvsunix/src/cvs";
00588     }
00589
00590     if(stat(cvscmd, &sb) == -1 || !(S_ISREG(sb.st_mode) || S_ISLNK(sb.st_mode)))
00591     {
00592         cvs_err("Unable to find the cvs process in : (error %d)\n", errno);
00593         cvs_err("1) %s\n", (const char *)firstCmd);
00594         cvs_err("2) %s\n", (const char *)cvscmd);
00595     }
00596
00597     CvsProcess *proc = cvs_process_open(cvscmd, argc - 1, (char **)argv + 1, &sCallTable, false, 0L);
00598     if(proc == 0L)
00599     {
00600         cvs_err("Unable to initialize the cvs process (error %d)\n", errno);
00601         cvs_err("The cvs used is : %s\n", (const char *)cvscmd);
00602     }
00603     else if(console != 0L)
00604     {
00605         while(true)
00606         {
00607             cvs_process_give_time();
00608             if(!cvs_process_is_active(proc))
00609                 break;
00610         }
00611     }
00612     else
00613     {
00614         UCvsApp::gApp->SetCvsRunning(true);
00615         UCvsApp::gCurCvs = proc;
00616     }
00617
00618     return sLastExitCode;
00619 #elif defined(WIN32) || defined(qUnix) || TARGET_RT_MAC_MACHO
00620     CStr cvscmd;
00621
00622     sLastExitCode = 0;
00623
00624 #ifdef WIN32
00625     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00626     if( app->gCvsRunning && cvs_process_is_active(app->gCvsProcess) )   {
00627         cvs_err("Error : cvs is already running !\n");
00628         return -1;
00629     }
00630     //Jerzy - we don't want to chdir, on windows we can use the "currentDirectory" parameter
00631 #if _0_
00632     if(path != 0L && chdir(path) != 0) {
00633         cvs_err("Error : cannot chdir to %s (error %d)!\n", path, errno);
00634     }
00635 #endif // _0_
00636
00637     app->gCvsStopping = false;
00638 #elif qUnix
00639     if(UCvsApp::gApp->IsCvsRunning())   {
00640         cvs_err("Error : cvs is already running !\n");
00641         return errInternal;
00642     }
00643
00644     if(path != 0L && chdir(path) != 0){
00645         cvs_err("Error : cannot chdir to %s (error %d)!\n", path, errno);
00646     }
00647
00648     UCvsApp::gApp->SetCvsStopping(false);
00649 #elif TARGET_RT_MAC_MACHO
00650     if(CMacCvsApp::gApp->IsCvsRunning())    {
00651         cvs_err("Error : cvs is already running !\n");
00652         return errInternal;
00653     }
00654
00655     if(path != 0L && chdir(path) != 0){
00656         cvs_err("Error : cannot chdir to %s (error %d)!\n", path, errno);
00657     }
00658
00659     CMacCvsApp::gApp->SetCvsStopping(false);
00660 #endif
00661
00662     gCvsPrefs.WhichCvs(cvscmd, gCvsPrefs.UseAltCvs());
00663
00664     struct stat sb;
00665
00666     if(stat(cvscmd, &sb) == -1 ||
00667 #if qUnix || TARGET_RT_MAC_MACHO
00668          S_ISLNK(sb.st_mode) ||
00669 #endif
00670          !(S_ISREG(sb.st_mode)))
00671     {
00672         cvs_err("Unable to find the cvs process in : (error %d)\n", errno);
00673         cvs_err("1) %s\n", (const char *)cvscmd);
00674     }
00675
00676     CvsProcess *proc = cvs_process_open(cvscmd, argc - 1, (char **)argv + 1,
00677         &sCallTable, gCvsPrefs.CvsConsole(), path);
00678     if(proc == 0L)
00679     {
00680         cvs_err("Unable to initialize the cvs process (error %d)\n", errno);
00681         cvs_err("The cvs used is : %s\n", (const char *)cvscmd);
00682     }
00683     else
00684     {
00685 #if qUnix
00686         UCvsApp::gApp->SetCvsRunning(true);
00687         UCvsApp::gCurCvs = proc;
00688 #elif TARGET_RT_MAC_MACHO
00689         CMacCvsApp::gApp->SetCvsRunning(true);
00690         CMacCvsApp::gCurCvs = proc;
00691         UInt32 start = ::TickCount ();
00692
00693     if(console != 0L )
00694 #else
00695         app->gCvsRunning = true;
00696         app->gCvsProcess = proc;
00697
00698     if(console != 0L )
00699 #endif
00700         while( TRUE ) {
00701 #ifdef WIN32
00702             app->PeekPumpAndIdle();
00703 #endif
00704 #if TARGET_RT_MAC_MACHO
00705             if((::TickCount () - start) > 40)
00706             {
00707                 glue_eventdispatcher(0L);
00708                 start = ::TickCount ();
00709             }
00710 #endif
00711             cvs_process_give_time();
00712
00713             if( !cvs_process_is_active(proc) )
00714                 break;
00715         }
00716     /*}
00717 #ifdef qUnix
00718         else {
00719             UCvsApp::gApp->SetCvsRunning(true);
00720             UCvsApp::gCurCvs = proc;
00721         }
00722 #endif*/
00723     }
00724
00725     return sLastExitCode;
00726 #endif
00727 }
00728
00729 class CStreamConsole : public CCvsConsole
00730 {
00731 public:
00732     CStreamConsole(FILE *out) : fOut(out) {}
00733
00734     virtual long cvs_out(char *txt, long len)
00735     {
00736         fwrite(txt, sizeof(char), len, fOut);
00737         return len;
00738     }
00739     virtual long cvs_err(char *txt, long len)
00740     {
00741         cvs_errstr(txt, len);
00742         return len;
00743     }
00744 protected:
00745     FILE *fOut;
00746 };
00747
00748 FILE *launchCVS(const char *dir, const CvsArgs & args, CStr & tmpFile, const char *prefix, const char *extension)
00749 {
00750     if(!MakeTmpFile(tmpFile, prefix, extension))
00751         return 0L;
00752
00753     FILE * res = fopen(tmpFile, "w+");
00754     if(res == 0L)
00755     {
00756         cvs_err("Impossible to open for write the temp file '%s' (error %d)",
00757             (const char *)tmpFile, errno);
00758         return 0L;
00759     }
00760
00761     CStreamConsole myconsole(res);
00762
00763     launchCVS(dir, args.Argc(), args.Argv(), &myconsole);
00764
00765     fseek(res, 0L, SEEK_SET);
00766
00767     return res;
00768 }
00769
00770 class CTmpFiles
00771 {
00772 public:
00773     ~CTmpFiles()
00774     {
00775         std::vector<CStr>::const_iterator i;
00776         for(i = allfiles.begin(); i != allfiles.end(); ++i)
00777         {
00778             const char *file = *i;
00779             unlink((char *)file);
00780         }
00781     }
00782
00783     inline const char *push_back(const char *file)
00784     {
00785         allfiles.push_back(file);
00786         return allfiles[allfiles.size() - 1];
00787     }
00788 protected:
00789     std::vector<CStr> allfiles;
00790 } sTmpList;
00791
00792 const char *launchCVS(const char *dir, const CvsArgs & args, const char *prefix, const char *extension)
00793 {
00794     CStr filename;
00795     FILE *file = launchCVS(dir, args, filename, prefix, extension);
00796     if(file == 0L)
00797         return 0L;
00798
00799     fclose(file);
00800     return sTmpList.push_back(filename);
00801 }
00802
00803 #ifdef WIN32
00804 void WaitForCvs(void)
00805 {
00806     // pump messages manually
00807     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00808
00809     while(1)
00810     {
00811         if(app->gCvsProcess == 0L)
00812             return;
00813
00814         if(!cvs_process_is_active(app->gCvsProcess))
00815             return;
00816
00817         Sleep(100);
00818     }
00819 }
00820 #endif
00821
00822 #if TARGET_RT_MAC_MACHO
00823 void WaitForCvs(void)
00824 {
00825     while(cvs_process_is_active (CMacCvsApp::gCurCvs))
00826     {
00827         UInt32 start = ::TickCount ();
00828
00829         while(cvs_process_give_time ())
00830         {
00831             if((::TickCount () - start) >= 60)
00832                 break;
00833         }
00834         glue_eventdispatcher(0L);
00835     }
00836     CMacCvsApp::gApp->SetCvsRunning (false);
00837 }
00838 #endif
Generated on Sun Feb 24 01:21:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/AppGlue.h Source File

common/AppGlue.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * AppGlue.h --- glue code to access CVS services
00023  */
00024
00025 #ifndef APPGLUE_H
00026 #define APPGLUE_H
00027
00028 #include <stdio.h>
00029
00030 class CCvsConsole
00031 {
00032 public:
00033     virtual long cvs_out(char *txt, long len) = 0L;
00034     virtual long cvs_err(char *txt, long len) = 0L;
00035 };
00036
00037 #define errInternal -99
00038 #define errThreadRunning -98
00039
00040 int testCVS(const char *path, int argc, char * const *argv);
00041     // checks if '-cvsgui' is supported
00042     // return the exit() error code.
00043
00044 int launchCVS(const char *path, int argc, char * const *argv,
00045     CCvsConsole * console = 0L);
00046     // return the exit() error code.
00047     // Optionally overides the default console.
00048
00049 class CvsArgs;
00050 class UStr;
00051
00052 FILE *launchCVS(const char *dir, const CvsArgs & args, UStr & tmpFile, const char *prefix = 0L,
00053                 const char *extension = 0L);
00054     // make a stream of the cvs output in a temporary file.
00055
00056 const char *launchCVS(const char *dir, const CvsArgs & args, const char *prefix = 0L,
00057                       const char *extension = 0L);
00058     // put the cvs output in a temp file (the temp file is automatically
00059     // removed when quitting)
00060
00061 // hooks for cvs
00062 extern "C" {
00063     extern long glue_consoleout(char *txt, long len);
00064     extern long glue_consoleerr(char *txt, long len);
00065     extern long glue_consolein(char *txt, long len);
00066     extern const char *glue_getenv(char *name);
00067     extern void glue_exit(int code);
00068 }
00069
00070 extern CCvsConsole *gConsole;
00071     // console is which the currebt cvs process write
00072
00073 #if defined(WIN32) || TARGET_RT_MAC_MACHO
00074     void WaitForCvs(void);
00075         // wait for the cvs thread to terminate
00076 #else
00077 #   define WaitForCvs()
00078 #endif
00079
00080 #endif /* APPGLUE_H */
Generated on Sun Feb 24 01:21:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/AppGlue.mac.cpp Source File

common/AppGlue.mac.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * AppGlue.mac.cpp --- glue code to access CVS shared library
00023  */
00024
00025 /* here should be a define, to recorgnize if this file is needed in development-tools */
00026 #ifdef macintosh
00027
00028 #include "stdafx.h"
00029 #include "AppGlue.mac.h"
00030 #include "AppGlue.h"
00031 #include "MacCvsApp.h"
00032 #include "AppConsole.h"
00033 #include "dll_process.h"
00034 #include "FileTraversal.h"
00035
00036 #if TARGET_RT_MAC_CFM
00037 #   include "GUSIMSLSetup.h"
00038 #endif
00039
00040 int glue_eventdispatcher(EventRecord *ev)
00041 {
00042     if(CMacCvsApp::gApp == 0L || !(CMacCvsApp::gApp->IsCvsRunning() || TraversalReport::gRunning))
00043         return 0;
00044
00045     EventRecord localEvent;
00046     if (!ev) {
00047         //  Spin callback
00048         UInt32  kSpinSleep = TraversalReport::gRunning ? CMacCvsApp::gApp->GetSleepTime() : 6;
00049             // for CWCVS, we want to go fast on background. But for a traversal operation,
00050             // we want to be smooth
00051         static  UInt32  spinTicks = 0;
00052         if ((::TickCount () - spinTicks) < kSpinSleep)
00053             return 0;
00054
00055         ev = &localEvent;
00056         ::WaitNextEvent (everyEvent, ev, kSpinSleep, nil);
00057         spinTicks = ::TickCount ();
00058     } // if
00059
00060     if(ev->what == mouseDown)
00061     {
00062         WindowPtr macWindowP;
00063         SInt16 thePart = ::FindWindow(ev->where, &macWindowP);
00064         switch (thePart)
00065         {
00066             case inDrag:
00067             case inGrow:
00068             case inZoomIn:
00069             case inZoomOut:
00070                 CMacCvsApp::gApp->DispatchEvent(*ev);
00071                 break;
00072             case inContent:
00073                 if (macWindowP != ::FrontWindow())
00074                 {
00075                     // Clicked Window is not the front one
00076                     LWindow *frontW = LWindow::FetchWindowObject(macWindowP);
00077                     if (frontW != nil && !UDesktop::WindowIsSelected(frontW))
00078                         CMacCvsApp::gApp->DispatchEvent(*ev);
00079                 }
00080                 break;
00081         }
00082         return 0;
00083     }
00084     else if(ev->what == nullEvent)
00085     {
00086         CMacCvsApp::gApp->DoSpinCursor();
00087     }
00088     else if(ev->what != keyDown && ev->what != keyUp && ev->what != mouseUp)
00089     {
00090         CMacCvsApp::gApp->DispatchEvent(*ev);
00091     }
00092     return 0;
00093 }
00094
00095 bool loadCVS(CompatConnectID & connID)
00096 {
00097     int result = 0;
00098     const char *name_dll2;
00099
00100 #if TARGET_RT_MAC_CFM
00101     // restore it in case it was not restored correctly by lsh
00102     GusiMSLSetWriteConsole(GUSIMSL_WriteConsoleHook);
00103     GusiMSLSetErrConsole(GUSIMSL_WriteErrHook);
00104     GusiMSLSetHandleEvent(GUSIMSL_HandleEventHook);
00105 #endif
00106
00107     // get cvs shared library
00108 #if qCarbon
00109 #   if qCvsDebug
00110         name_dll2 = "cvsXDbgLib";
00111 #   else
00112         name_dll2 = "cvsXLib";
00113 #   endif
00114 #else
00115 #   if qCvsDebug
00116         name_dll2 = "cvs2DbgLib";
00117 #   else
00118         name_dll2 = "cvs2Lib";
00119 #   endif
00120 #endif
00121
00122     // open the library
00123     if(!CompatLoadLibrary(&connID, name_dll2))
00124     {
00125         cvs_err("Error: Unable to load the library %s\n", name_dll2);
00126         return false;
00127     }
00128
00129     // set the console out
00130     if(!CompatCallLibrary1(connID, result, uppSetGlueProcInfo, "dllglue_setconsoleout",
00131         dllglue_setglue_func, CompatFuncArg(uppConsoleOutProcInfo, glue_consoleout)))
00132     {
00133         cvs_err("Error : Cannot find symbol ""dllglue_setconsoleout""\n");
00134         goto closeandfail;
00135     }
00136
00137     // set the console err
00138     if(!CompatCallLibrary1(connID, result, uppSetGlueProcInfo, "dllglue_setconsoleerr",
00139         dllglue_setglue_func, CompatFuncArg(uppConsoleOutProcInfo, glue_consoleerr)))
00140     {
00141         cvs_err("Error : Cannot find symbol ""dllglue_setconsoleerr""\n");
00142         goto closeandfail;
00143     }
00144
00145     // set the console in
00146     if(!CompatCallLibrary1(connID, result, uppSetGlueProcInfo, "dllglue_setconsolein",
00147         dllglue_setglue_func, CompatFuncArg(uppConsoleInProcInfo, glue_consolein)))
00148     {
00149         cvs_err("Error : Cannot find symbol ""dllglue_setconsolein""\n");
00150         goto closeandfail;
00151     }
00152
00153     // set the getenv
00154     if(!CompatCallLibrary1(connID, result, uppSetGlueProcInfo, "dllglue_setgetenv",
00155         dllglue_setglue_func, CompatFuncArg(uppGetEnvProcInfo, glue_getenv)))
00156     {
00157         cvs_err("Error : Cannot find symbol ""dllglue_setgetenv""\n");
00158         goto closeandfail;
00159     }
00160
00161     // set the event dispatcher
00162     if(!CompatCallLibrary1(connID, result, uppSetGlueProcInfo, "dllglue_seteventdispatch",
00163         dllglue_setglue_func, CompatFuncArg(uppEventDispatchProcInfo, glue_eventdispatcher)))
00164     {
00165         cvs_err("Error : Cannot find symbol ""dllglue_seteventdispatch""\n");
00166         goto closeandfail;
00167     }
00168
00169     CMacCvsApp::gApp->SetCvsRunning(true);
00170
00171     return true;
00172
00173 closeandfail:
00174     CompatCloseLibrary(&connID);
00175     return false;
00176 }
00177
00178 void unloadCVS(CompatConnectID connID, int exitc)
00179 {
00180 #if TARGET_RT_MAC_CFM
00181     // restore it in case it was not restored correctly by lsh
00182     GusiMSLSetWriteConsole(GUSIMSL_WriteConsoleHook);
00183     GusiMSLSetErrConsole(GUSIMSL_WriteErrHook);
00184     GusiMSLSetHandleEvent(GUSIMSL_HandleEventHook);
00185 #endif
00186
00187     CompatCloseLibrary(&connID);
00188
00189     glue_exit(exitc);
00190
00191     CMacCvsApp::gApp->SetCvsRunning(false);
00192     CMacCvsApp::gApp->RefreshBrowsers();
00193 }
00194
00195 int decodeCVS(char* path)
00196 {
00197     gConsole = 0;
00198
00199     CompatConnectID connID;
00200
00201     if(!loadCVS(connID))
00202         return errInternal;
00203
00204     int exitc = 0;
00205
00206     // call the main
00207     if(!CompatCallLibrary1(connID, exitc, uppDecodeFileProcInfo, "dllglue_decode_file",
00208         dllglue_decode_file_func, path))
00209     {
00210         cvs_err("Error : Cannot find symbol ""dllglue_decode_file""\n");
00211         exitc = errInternal;
00212     }
00213
00214     unloadCVS(connID, exitc);
00215
00216     return exitc;
00217 }
00218
00219 long GUSIMSL_WriteConsoleHook(char *buffer, long n)
00220 {
00221     return glue_consoleout(buffer, n);
00222 }
00223 long GUSIMSL_WriteErrHook(char *buffer, long n)
00224 {
00225     return glue_consoleerr(buffer, n);
00226 }
00227 int GUSIMSL_HandleEventHook(EventRecord *ev)
00228 {
00229     return glue_eventdispatcher(ev);
00230 }
00231
00232 #endif /* macintosh */
Generated on Sun Feb 24 01:21:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/AppGlue.mac.h Source File

common/AppGlue.mac.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * AppGlue.mac.h --- glue code to access CVS shared library
00023  */
00024
00025 #ifndef APPGLUEMAC_H
00026 #define APPGLUEMAC_H
00027
00028 #include "dll_loader.h"
00029
00030 extern "C"
00031 {
00032     long GUSIMSL_WriteConsoleHook(char *buffer, long n);
00033     long GUSIMSL_WriteErrHook(char *buffer, long n);
00034     int GUSIMSL_HandleEventHook(EventRecord *ev);
00035 }
00036
00037 extern "C" int glue_eventdispatcher(EventRecord *ev);
00038
00039 bool loadCVS(CompatConnectID & connID);
00040 void unloadCVS(CompatConnectID connID, int exitc);
00041 int decodeCVS(char* path);
00042
00043 #endif /* APPGLUEMAC_H */
Generated on Sun Feb 24 01:21:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/AskYesNo.cpp Source File

common/AskYesNo.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 1998
00019  */
00020
00021 // AskYesNo.cpp : ask yes or no !
00022
00023 #include "stdafx.h"
00024
00025 #ifdef WIN32
00026 #   include "resource.h"
00027 #endif /* WIN32 */
00028
00029 #ifdef qUnix
00030 #   include "CvsAlert.h"
00031 #   include "memory"
00032 #endif /* qUnix */
00033
00034 #ifdef qMacCvsPP
00035 #   include <UModalDialogs.h>
00036
00037 #   include "MacCvsApp.h"
00038 #   include "MacCvsConstant.h"
00039 #endif /* qMacCvsPP */
00040
00041 #include "AskYesNo.h"
00042 #include "uwidget.h"
00043
00044 #ifdef _DEBUG
00045 #define new DEBUG_NEW
00046 #undef THIS_FILE
00047 static char THIS_FILE[] = __FILE__;
00048 #endif
00049
00050 #ifdef WIN32
00051
00052 // CAskYesNo dialog
00053
00054
00055 CAskYesNo::CAskYesNo(CWnd* pParent /*=NULL*/)
00056     : CDialog(CAskYesNo::IDD, pParent)
00057 {
00058     //{{AFX_DATA_INIT(CAskYesNo)
00059     //}}AFX_DATA_INIT
00060 }
00061
00062
00063 void CAskYesNo::DoDataExchange(CDataExchange* pDX)
00064 {
00065     CDialog::DoDataExchange(pDX);
00066     //{{AFX_DATA_MAP(CAskYesNo)
00067     //}}AFX_DATA_MAP
00068 }
00069
00070
00071 BEGIN_MESSAGE_MAP(CAskYesNo, CDialog)
00072     //{{AFX_MSG_MAP(CAskYesNo)
00073         // NOTE: the ClassWizard will add message map macros here
00074     //}}AFX_MSG_MAP
00075 END_MESSAGE_MAP()
00076
00078 // CAskYesNo message handlers
00079 #endif /* WIN32 */
00080
00081 const char *AskYesNo(void)
00082 {
00083 #ifdef WIN32
00084     CAskYesNo gp;
00085     return gp.DoModal() == IDOK ? "yes" : "no";
00086 #endif /* WIN32 */
00087 #ifdef qMacCvsPP
00088     if(!CMacCvsApp::gApp->IsFrontProcess() && CMacCvsApp::gApp->NotifyUser(0L))
00089     {
00090         while(!CMacCvsApp::gApp->IsFrontProcess())
00091         {
00092             CMacCvsApp::gApp->SpendSomeTime();
00093         }
00094     }
00095
00096     StDialogHandler theHandler(dlg_YesNo, LCommander::GetTopCommander());
00097     LWindow *theDialog = theHandler.GetDialog();
00098     ThrowIfNil_(theDialog);
00099
00100     theDialog->Show();
00101     MessageT hitMessage;
00102     while (true)
00103     {       // Let DialogHandler process events
00104         hitMessage = theHandler.DoDialog();
00105
00106         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00107             break;
00108     }
00109     theDialog->Hide();
00110
00111     return hitMessage == msg_OK ? "yes" : "no";
00112 #endif /* qMacCvsPP */
00113 #ifdef qUnix
00114     return CvsAlert("cvs is requiring you to answer yes or no (see the console for details)", "No", "Yes") ?
00115         "no" : "yes";
00116 #endif /* qUnix */
00117 }
00118
00119 class UPromptMessage : public UWidget
00120 {
00121     UDECLARE_DYNAMIC(UPromptMessage)
00122 public:
00123     UPromptMessage(const char *msg, const char *title, const char *def,
00124         const char *cncl) : UWidget(UEventGetWidID()), m_msg(msg), m_title(title),
00125         m_ok(def), m_cncl(cncl)
00126     {
00127     }
00128
00129     virtual ~UPromptMessage() {}
00130
00131     enum
00132     {
00133         kOK = EV_COMMAND_START, // 0
00134         kCancel,                // 1
00135         kMsg                    // 2
00136     };
00137
00138     virtual void DoDataExchange(bool fill)
00139     {
00140         if(fill)
00141         {
00142             UEventSendMessage(GetWidID(), EV_SETTEXT, kOK, (void *)m_ok.c_str());
00143             UEventSendMessage(GetWidID(), EV_SETTEXT, kUMainWidget, (void *)m_title.c_str());
00144             UEventSendMessage(GetWidID(), EV_SETTEXT, kCancel, (void *)m_cncl.c_str());
00145             UEventSendMessage(GetWidID(), EV_SETTEXT, kMsg, (void *)m_msg.c_str());
00146         }
00147         else
00148         {
00149         }
00150     }
00151
00152 protected:
00153     UStr m_msg, m_title, m_ok, m_cncl;
00154
00155     ev_msg int OnOK(void);
00156     ev_msg int OnCancel(void);
00157
00158     UDECLARE_MESSAGE_MAP()
00159 };
00160
00161 UIMPLEMENT_DYNAMIC(UPromptMessage, UWidget)
00162
00163 UBEGIN_MESSAGE_MAP(UPromptMessage, UWidget)
00164     ON_UCOMMAND(kOK, UPromptMessage::OnOK)
00165     ON_UCOMMAND(kCancel, UPromptMessage::OnCancel)
00166 UEND_MESSAGE_MAP()
00167
00168 int UPromptMessage::OnOK(void)
00169 {
00170     EndModal(true);
00171     return 0;
00172 }
00173
00174 int UPromptMessage::OnCancel(void)
00175 {
00176     EndModal(false);
00177     return 0;
00178 }
00179
00180 bool PromptMessage(const char *msg, const char *title, const char *def, const char *cncl)
00181 {
00182     std::auto_ptr<UPromptMessage> dlg(new UPromptMessage(msg, title, def, cncl));
00183     bool res = false;
00184
00185 #ifdef WIN32
00186     res = dlg->DoModal(IDD_PROMPTMESSAGE);
00187 #endif
00188 #ifdef qMacCvsPP
00189     res = dlg->DoModal(dlg_PromptCommand);
00190 #endif
00191
00192     return res;
00193 }
00194
00195 class UEditMessage : public UPromptMessage
00196 {
00197     UDECLARE_DYNAMIC(UEditMessage)
00198 public:
00199     UEditMessage(const char *msg, const char *edit, const char *title, const char *def,
00200         const char *cncl) : m_edit(edit), UPromptMessage(msg, title, def, cncl)
00201     {
00202     }
00203
00204     virtual ~UEditMessage() {}
00205
00206     enum
00207     {
00208         kOK = EV_COMMAND_START, // 0
00209         kCancel,                // 1
00210         kMsg,                   // 2
00211         kEdit                   // 3
00212     };
00213
00214     virtual void DoDataExchange(bool fill)
00215     {
00216         UPromptMessage::DoDataExchange(fill);
00217
00218         if(fill)
00219         {
00220             UEventSendMessage(GetWidID(), EV_SETTEXT, kEdit, (void *)m_edit.c_str());
00221         }
00222         else
00223         {
00224             UEventSendMessage(GetWidID(), EV_GETTEXT, kEdit, &m_edit);
00225         }
00226     }
00227
00228     UStr m_edit;
00229
00230 protected:
00231
00232     UDECLARE_MESSAGE_MAP()
00233 };
00234
00235 UIMPLEMENT_DYNAMIC(UEditMessage, UPromptMessage)
00236
00237 UBEGIN_MESSAGE_MAP(UEditMessage, UPromptMessage)
00238 UEND_MESSAGE_MAP()
00239
00240 bool PromptEditMessage(const char *msg, UStr & edit, const char *title, const char *def, const char *cncl)
00241 {
00242     std::auto_ptr<UEditMessage> dlg(new UEditMessage(msg, edit, title, def, cncl));
00243     bool res = false;
00244
00245 #ifdef WIN32
00246     res = dlg->DoModal(IDD_EDITMESSAGE);
00247 #endif
00248 #ifdef qMacCvsPP
00249     res = dlg->DoModal(dlg_PromptEditCommand);
00250 #endif
00251
00252     if(res)
00253         edit = dlg->m_edit;
00254
00255     return res;
00256 }
Generated on Sun Feb 24 01:21:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/AskYesNo.h Source File

common/AskYesNo.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 1998
00019  */
00020
00021 // AskYesNo.h : ask yes or no !
00022
00023 #if !defined(AFX_ASKYESNO_H__5946A8C4_8517_11D1_8949_444553540000__INCLUDED_)
00024 #define AFX_ASKYESNO_H__5946A8C4_8517_11D1_8949_444553540000__INCLUDED_
00025
00026 #if _MSC_VER >= 1000
00027 #pragma once
00028 #endif // _MSC_VER >= 1000
00029
00030 class UStr;
00031
00032 const char *AskYesNo(void);
00033     // prompt for yes or no, returns "yes" or "no"
00034
00035 bool PromptMessage(const char *msg, const char *title = "Message",
00036                    const char *def = "OK", const char *cncl = "Cancel");
00037     // prompt for yes or no, returns "yes" or "no"
00038
00039 bool PromptEditMessage(const char *msg, UStr & edit, const char *title = "Message",
00040                    const char *def = "OK", const char *cncl = "Cancel");
00041     // prompt for yes or no, returns "yes" or "no" and the value of the edit
00042     // field.
00043
00044 #ifdef WIN32
00045
00046 // CAskYesNo dialog
00047
00048 class CAskYesNo : public CDialog
00049 {
00050 // Construction
00051 public:
00052     CAskYesNo(CWnd* pParent = NULL);   // standard constructor
00053
00054 // Dialog Data
00055     //{{AFX_DATA(CAskYesNo)
00056     enum { IDD = IDD_YESNO };
00057     CString m_passwd;
00058     //}}AFX_DATA
00059
00060
00061 // Overrides
00062     // ClassWizard generated virtual function overrides
00063     //{{AFX_VIRTUAL(CAskYesNo)
00064     protected:
00065     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00066     //}}AFX_VIRTUAL
00067
00068 // Implementation
00069 protected:
00070
00071     // Generated message map functions
00072     //{{AFX_MSG(CAskYesNo)
00073         // NOTE: the ClassWizard will add member functions here
00074     //}}AFX_MSG
00075     DECLARE_MESSAGE_MAP()
00076 };
00077
00078 //{{AFX_INSERT_LOCATION}}
00079 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00080 #endif /* WIN32 */
00081
00082 #endif // !defined(AFX_ASKYESNO_H__5946A8C4_8517_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/Authen.cpp Source File

common/Authen.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * Authen.cpp --- class to manage CVS authentication kind
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #include <string.h>
00028 #include <ctype.h>
00029 #include <errno.h>
00030 #include "Authen.h"
00031 #include "CvsPrefs.h"
00032 #include "AppConsole.h"
00033 #include "MultiFiles.h"
00034 #include "PromptFiles.h"
00035 #include "CvsArgs.h"
00036 #include "TextBinary.h"
00037 #include "uwidget.h"
00038 #include "SmartComboBox.h"
00039
00040 #include <algorithm>
00041
00042 #ifdef WIN32
00043 #   include "resource.h"
00044 #endif
00045
00046 static CPersistentT<AuthenKind> gAuthenKind("P_Authen",
00047 #ifdef macintosh
00048     rhosts,
00049 #else /* !macintosh */
00050     local,
00051 #endif /* !macintosh */
00052     kNoClass);
00053
00054 #ifdef WIN32
00055 #   ifdef _DEBUG
00056 #   define new DEBUG_NEW
00057 #   undef THIS_FILE
00058     static char THIS_FILE[] = __FILE__;
00059 #   endif
00060 #endif /* WIN32 */
00061
00062 #ifdef macintosh
00063 #define putenv(a)
00064 #endif
00065
00066 Authen gAuthen;
00067
00068 // authentication class
00069 AuthenKind Authen::kind(void)
00070 {
00071     return gAuthenKind;
00072 }
00073
00074 void Authen::setkind(AuthenKind newkind)
00075 {
00076     gAuthenKind = newkind;
00077 }
00078
00079 const char * Authen::kindstr(void)
00080 {
00081     static CStr res;
00082
00083     switch( kind() )
00084     {
00085     default:
00086     case rhosts:
00087         res = ".rhosts authentication";
00088         break;
00089     case pserver:
00090         res = "password authentication";
00091         break;
00092     case kserver:
00093         res = "kerberos authentication";
00094         break;
00095     case local:
00096         res = "local mounted directory";
00097         break;
00098     case ssh:
00099         res = "ssh authentication";
00100         break;
00101     case ntserver:
00102         res = "NT server services";
00103         break;
00104     case gserver:
00105         res = "GSSAPI authentication";
00106         break;
00107     }
00108
00109     if( kind() == pserver && gCvsPrefs.UseProxy() )
00110     {
00111         res << " using a proxy";
00112     }
00113
00114     return res;
00115 }
00116
00117 const char * Authen::token(void)
00118 {
00119     return Authen::token(kind());
00120 }
00121
00122 const char * Authen::token(AuthenKind kind)
00123 {
00124     static CStr res;
00125
00126     switch( kind )
00127     {
00128     default :
00129     case rhosts:
00130         res = "";
00131         break;
00132     case pserver :
00133         res = ":pserver";
00134         if(gCvsPrefs.UseProxy())
00135         {
00136             res << ";proxy=";
00137             res << gCvsPrefs.ProxyHost();
00138             res << ";proxyport=";
00139             res << gCvsPrefs.ProxyPort();
00140         }
00141         res << ':';
00142         break;
00143     case kserver:
00144         res = ":kserver:";
00145         break;
00146     case local:
00147         res = ":local:";
00148         break;
00149     case ssh: res = ":ext:";
00150         break;
00151     case ntserver:
00152         res = ":ntserver:";
00153         break;
00154     case gserver:
00155         res = ":gserver:";
00156         break;
00157     }
00158
00159     return res;
00160 }
00161
00162 const char * Authen::skiptoken(const char *cvsroot)
00163 {
00164     const char *secondColon;
00165     if(cvsroot[0] != ':' || (secondColon = strchr(cvsroot + 1, ':')) == NULL)
00166         return cvsroot;
00167     return secondColon + 1;
00168 }
00169
00170 const char *Authen::kindToToken(AuthenKind kind)
00171 {
00172     AuthenModel *model = AuthenModel::GetInstance(kind);
00173     return model->GetToken();
00174 }
00175
00176 AuthenKind Authen::tokenToKind(const char *token)
00177 {
00178     std::vector<AuthenModel *> & allInstances = AuthenModel::GetAllInstances();
00179     std::vector<AuthenModel *>::const_iterator i;
00180     for(i = allInstances.begin(); i != allInstances.end(); ++i)
00181     {
00182         AuthenModel *model = *i;
00183         if(strcmp(model->GetToken(), token) == 0)
00184             return model->GetKind();
00185     }
00186
00187     cvs_err("Unknown authentication kind '%s'\n", token);
00188     return local;
00189 }
00190
00191 short Authen::kindToNum(AuthenKind kind)
00192 {
00193     std::vector<AuthenModel *> & allInstances = AuthenModel::GetAllInstances();
00194     std::vector<AuthenModel *>::const_iterator i;
00195     int cnt = 0;
00196     for(i = allInstances.begin(); i != allInstances.end(); ++i, cnt++)
00197     {
00198         AuthenModel *model = *i;
00199         if(model->GetKind() == kind)
00200             return cnt;
00201     }
00202
00203     return 0;
00204 }
00205
00206 AuthenKind Authen::numToKind(short num)
00207 {
00208     std::vector<AuthenModel *> & allInstances = AuthenModel::GetAllInstances();
00209     std::vector<AuthenModel *>::const_iterator i;
00210     int cnt = 0;
00211     for(i = allInstances.begin(); i != allInstances.end(); ++i, cnt++)
00212     {
00213         AuthenModel *model = *i;
00214         if(cnt == num)
00215             return model->GetKind();
00216     }
00217
00218     return local;
00219 }
00220
00221 bool Authen::parse_cvsroot (const char *CVSroot, UStr & theMethod, UStr & theUser, UStr & theHost, UStr & thePath)
00222 {
00223     char *p;
00224     UStr copyroot(CVSroot);
00225     char *cvsroot_copy = copyroot;
00226
00227     theMethod = "";
00228     theUser = "";
00229     theHost = "";
00230     thePath = "";
00231
00232     if (*cvsroot_copy == ':')
00233     {
00234         char *method = ++cvsroot_copy;
00235         bool have_semicolon;
00236
00237         /* Access method specified, as in
00238         * "cvs -d :pserver:user@host:/path",
00239         * "cvs -d :local:e:\path",
00240         * "cvs -d :kserver:user@host:/path", or
00241         * "cvs -d :fork:/path".
00242         * We need to get past that part of CVSroot before parsing the
00243         * rest of it.
00244         */
00245
00246         if (! (p = strchr (method, ':')))
00247             return false;
00248
00249         p = strpbrk (method, ":;#");
00250         if (p == 0L)
00251             return false;
00252
00253         have_semicolon = (*p == ';' || *p == '#');
00254         *p = '\0';
00255         cvsroot_copy = ++p;
00256
00257         theMethod = method;
00258
00259         while (have_semicolon)
00260         {
00261             /* More elaborate implementation would allow multiple
00262             semicolons, for example:
00263
00264             :server;rsh=34;command=cvs-1.6:
00265
00266             we will allow
00267             :server;port=22;proxy=www-proxy;proxyport=8080:
00268
00269             we will also allow # as well as ; as a separator to
00270             avoid having to quote the root in a shell.
00271             */
00272             /* FIXME: lots of error conditions should be better handled,
00273             e.g. garbage after the number or no valid number.
00274
00275             Would be nice to have testcases for some of these cases
00276             including the error cases.  */
00277             p = strpbrk (cvsroot_copy, ":;#");
00278             if (p == NULL)
00279                 return false;
00280
00281             /* pick up more options if we have them */
00282             have_semicolon = (*p == ';' || *p == '#');
00283             *p = '\0';
00284
00285             cvsroot_copy = ++p;
00286         }
00287     }
00288
00289     if (theMethod != "local")
00290     {
00291         /* Check to see if there is a username in the string. */
00292
00293         if ((p = strchr (cvsroot_copy, '@')) != NULL)
00294         {
00295             *p = '\0';
00296             theUser = cvsroot_copy;
00297             cvsroot_copy = ++p;
00298         }
00299
00300         if ((p = strchr (cvsroot_copy, ':')) != NULL)
00301         {
00302             *p = '\0';
00303             theHost = cvsroot_copy;
00304             cvsroot_copy = ++p;
00305         }
00306     }
00307
00308     thePath = cvsroot_copy;
00309
00310     return true;
00311 }
00312
00313 std::vector<AuthenModel *> * AuthenModel::m_instances = 0L;
00314
00315 AuthenModel::AuthenModel()
00316 {
00317     if(m_instances == 0L)
00318     {
00319         m_instances = new std::vector<AuthenModel *>;
00320         if(m_instances == 0L)
00321             throw std::bad_alloc();
00322     }
00323
00324     m_instances->push_back(this);
00325 }
00326
00327 AuthenModel::~AuthenModel()
00328 {
00329     std::vector<AuthenModel *>::iterator i;
00330     i = std::find(m_instances->begin(), m_instances->end(), this);
00331     if(i != m_instances->end())
00332         m_instances->erase(i);
00333
00334     if(m_instances->empty())
00335         delete m_instances;
00336 }
00337
00338 std::vector<AuthenModel *> & AuthenModel::GetAllInstances(void)
00339 {
00340     return *AuthenModel::m_instances;
00341 }
00342
00343 AuthenModel *AuthenModel::GetInstance(AuthenKind k)
00344 {
00345     std::vector<AuthenModel *> & allInstances = GetAllInstances();
00346     std::vector<AuthenModel *>::const_iterator i;
00347     for(i = allInstances.begin(); i != allInstances.end(); ++i)
00348     {
00349         AuthenModel *model = *i;
00350         if(model->GetKind() == k)
00351             return model;
00352     }
00353
00354     // default to local
00355     cvs_err("Unknown authentication kind %d\n", k);
00356     return GetInstance(local);
00357 }
00358
00359 void AuthenModel::OnSetupEnv(void)
00360 {
00361     static UStr home;
00362     home = "HOME=";
00363     home << gCvsPrefs.Home();
00364     putenv(home);
00365 }
00366
00367 void AuthenModel::OnRestoreEnv(void)
00368 {
00369     putenv("HOME=");
00370 }
00371
00372 class AuthenLocal : public AuthenModel
00373 {
00374 public :
00375     AuthenLocal() {}
00376     virtual ~AuthenLocal() {}
00377
00378     virtual AuthenKind GetKind(void) const { return local; }
00379     virtual const char *GetToken(void) const { return "local"; }
00380 };
00381
00382 #if TARGET_RT_MAC_CFM
00383 class AuthenLSH : public AuthenModel
00384 {
00385 public :
00386     AuthenLSH() {}
00387     virtual ~AuthenLSH() {}
00388
00389     virtual AuthenKind GetKind(void) const { return ssh; }
00390     virtual const char *GetToken(void) const { return "ssh"; }
00391
00392     virtual bool HasSettings(void) const { return true; }
00393     virtual bool HasHost(void) const { return true; }
00394     virtual bool HasUser(void) const { return true; }
00395
00396     virtual void DoSettings(void);
00397     virtual void GetSettingsDesc(UStr & desc);
00398
00399     virtual char * OnGetEnv(char *env);
00400
00401     static CPersistentInt gLSHEncrypt;
00402     static CPersistentInt gLSHAuthen;
00403     static CPersistentInt gLSHCompress;
00404     static CPersistentInt gLSHPort;
00405     static CPersistentBool gLSHVerbose;
00406     static CPersistentBool gLSHTrace;
00407     static CPersistentBool gLSHDebug;
00408     static CPersistentBool gLSHKeychain;
00409     static CPersistentBool gLSHIdentity;
00410
00411 };
00412
00413 class UAuthen_LSH : public UWidget
00414 {
00415     UDECLARE_DYNAMIC(UAuthen_LSH)
00416 public:
00417     UAuthen_LSH();
00418     virtual ~UAuthen_LSH() {}
00419
00420     enum
00421     {
00422         kOK = EV_COMMAND_START, // 0
00423         kCancel,            // 1
00424         kEncryptPopup,      // 2
00425         kAuthenPopup,       // 3
00426         kCompressPopup,     // 4
00427         kCheckPort,         // 5
00428         kEditPort,          // 6
00429         kCheckVerbose,      // 7
00430         kCheckTrace,        // 8
00431         kCheckDebug,        // 9
00432         kKeychain,          // 10
00433         kSendIdentity       // 11
00434     };
00435
00436     virtual void DoDataExchange(bool fill);
00437
00438 protected:
00439
00440     ev_msg int OnCheckPort(void);
00441
00442     UDECLARE_MESSAGE_MAP()
00443 };
00444
00445 UIMPLEMENT_DYNAMIC(UAuthen_LSH, UWidget)
00446
00447 UBEGIN_MESSAGE_MAP(UAuthen_LSH, UWidget)
00448     ON_UCOMMAND(kCheckPort, UAuthen_LSH::OnCheckPort)
00449 UEND_MESSAGE_MAP()
00450
00451 UAuthen_LSH::UAuthen_LSH() : UWidget(::UEventGetWidID())
00452 {
00453 }
00454
00455 void UAuthen_LSH::DoDataExchange(bool fill)
00456 {
00457     if(fill)
00458     {
00459         UEventSendMessage(GetWidID(), EV_COMBO_SETSEL, UMAKEINT(kEncryptPopup, (int)AuthenLSH::gLSHEncrypt), 0L);
00460         UEventSendMessage(GetWidID(), EV_COMBO_SETSEL, UMAKEINT(kAuthenPopup, (int)AuthenLSH::gLSHAuthen), 0L);
00461         UEventSendMessage(GetWidID(), EV_COMBO_SETSEL, UMAKEINT(kCompressPopup, (int)AuthenLSH::gLSHCompress), 0L);
00462
00463         int port = (int)AuthenLSH::gLSHPort > 0 ? (int)AuthenLSH::gLSHPort : -1;
00464         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, port != -1), 0L);
00465         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kEditPort, port == -1 ? 0 : port), 0L);
00466         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckPort, port != -1), 0L);
00467
00468         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckVerbose, (bool)AuthenLSH::gLSHVerbose), 0L);
00469         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckTrace, (bool)AuthenLSH::gLSHTrace), 0L);
00470         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckDebug, (bool)AuthenLSH::gLSHDebug), 0L);
00471         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kKeychain, (bool)AuthenLSH::gLSHKeychain), 0L);
00472         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kSendIdentity, (bool)AuthenLSH::gLSHIdentity), 0L);
00473     }
00474     else
00475     {
00476         AuthenLSH::gLSHEncrypt = UEventSendMessage(GetWidID(), EV_COMBO_GETSEL, kEncryptPopup, 0L);
00477         AuthenLSH::gLSHAuthen = UEventSendMessage(GetWidID(), EV_COMBO_GETSEL, kAuthenPopup, 0L);
00478         AuthenLSH::gLSHCompress = UEventSendMessage(GetWidID(), EV_COMBO_GETSEL, kCompressPopup, 0L);
00479
00480         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
00481         int value = UEventSendMessage(GetWidID(), EV_GETINTEGER, kEditPort, 0L);
00482         AuthenLSH::gLSHPort = state ? value : -1;
00483
00484         AuthenLSH::gLSHVerbose = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckVerbose, 0L) != 0;
00485         AuthenLSH::gLSHTrace = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckTrace, 0L) != 0;
00486         AuthenLSH::gLSHDebug = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDebug, 0L) != 0;
00487         AuthenLSH::gLSHKeychain = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kKeychain, 0L) != 0;
00488         AuthenLSH::gLSHIdentity = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kSendIdentity, 0L) != 0;
00489     }
00490 }
00491
00492 int UAuthen_LSH::OnCheckPort(void)
00493 {
00494     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
00495     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, state), 0L);
00496
00497     return 0;
00498 }
00499
00500 void AuthenLSH::DoSettings(void)
00501 {
00502     UAuthen_LSH *dlg = new UAuthen_LSH();
00503
00504     try
00505     {
00506         dlg->DoModal(3004);
00507     }
00508     catch(...)
00509     {
00510     }
00511
00512     delete dlg;
00513 }
00514
00515 void AuthenLSH::GetSettingsDesc(UStr & desc)
00516 {
00517     if((int)gLSHPort <= 0)
00518         desc << "Using default port";
00519     else
00520         desc << "Using port " << (int)gLSHPort;
00521
00522     if((bool)gLSHKeychain)
00523         desc << " and key chain";
00524
00525     if((bool)gLSHIdentity)
00526         desc << " and identity file";
00527 }
00528
00529 char * AuthenLSH::OnGetEnv(char *env)
00530 {
00531     if(strcmp(env, "LSH_SEND_IDENTITY") == 0)
00532     {
00533         return (bool)gLSHIdentity ? (char *)"yes" : (char *)"no";
00534     }
00535     else if(strcmp(env, "LSH_ENCRYPTION") == 0)
00536     {
00537         static char *encryptions[] =
00538         {
00539             "-call",
00540             "-c3des",
00541             "-ctwofish",
00542             "-ccast128",
00543             "-cserpent",
00544             "-crijndael",
00545             "-cblowfish",
00546             "-carcfour",
00547             "-cnone"
00548         };
00549         return encryptions[(int)gLSHEncrypt];
00550     }
00551     else if(strcmp(env, "LSH_AUTHENTICATION") == 0)
00552     {
00553         static char *authentications[] =
00554         {
00555             "",
00556             "-msha1",
00557             "-mmd5",
00558             "-mnone"
00559         };
00560         return authentications[(int)gLSHAuthen];
00561     }
00562     else if(strcmp(env, "LSH_ZLIB") == 0)
00563     {
00564         static char *zlib[] =
00565         {
00566             "",
00567             "-znone",
00568             "-zzlib"
00569         };
00570         return zlib[(int)gLSHCompress];
00571     }
00572     else if(strcmp(env, "LSH_MORE_ARGS") == 0)
00573     {
00574         static UStr res;
00575
00576         res = "";
00577         if((bool)gLSHVerbose)
00578             res << " --verbose";
00579         if((bool)gLSHTrace)
00580             res << " --trace";
00581         if((bool)gLSHDebug)
00582             res << " --debug";
00583
00584         return res;
00585     }
00586     else if(strcmp(env, "LSH_PORT") == 0)
00587     {
00588         int port = (int)gLSHPort;
00589         if(port > 0)
00590         {
00591             static char portstr[10];
00592             sprintf(portstr, "%d", port);
00593             return portstr;
00594         }
00595     }
00596
00597     return 0L;
00598 }
00599
00600 CPersistentInt AuthenLSH::gLSHEncrypt("P_LSHEncrypt", 0, kAddSettings);
00601 CPersistentInt AuthenLSH::gLSHAuthen("P_LSHAuthen", 0, kAddSettings);
00602 CPersistentInt AuthenLSH::gLSHCompress("P_LSHCompress", 2, kAddSettings);
00603 CPersistentInt AuthenLSH::gLSHPort("P_LSHPort", -1, kAddSettings);
00604 CPersistentBool AuthenLSH::gLSHVerbose("P_LSHVerbose", false, kAddSettings);
00605 CPersistentBool AuthenLSH::gLSHTrace("P_LSHTrace", false, kAddSettings);
00606 CPersistentBool AuthenLSH::gLSHDebug("P_LSHDebug", false, kAddSettings);
00607 CPersistentBool AuthenLSH::gLSHKeychain("P_LSHKeychain", false, kAddSettings);
00608 CPersistentBool AuthenLSH::gLSHIdentity("P_LSHIdentity", true, kAddSettings);
00609 #else // !TARGET_RT_MAC_CFM
00610 class AuthenSSH : public AuthenModel
00611 {
00612 public :
00613     AuthenSSH() {}
00614     virtual ~AuthenSSH() {}
00615
00616     virtual AuthenKind GetKind(void) const { return ssh; }
00617     virtual const char *GetToken(void) const { return "ssh"; }
00618
00619     virtual bool HasSettings(void) const { return true; }
00620     virtual bool HasHost(void) const { return true; }
00621     virtual bool HasUser(void) const { return true; }
00622
00623     virtual void DoSettings(void);
00624     virtual void GetSettingsDesc(UStr & desc);
00625
00626     virtual const char * OnGetEnv(char *env);
00627
00628     virtual void OnSetupEnv(void);
00629     virtual void OnRestoreEnv(void);
00630
00631     static PCStr gSSHName;
00632     static PCStr gSSHOptions;
00633     static CPersistentBool gRsaIdentity;
00634     static CMString gRsaIdentityFile;
00635     static PCStr gCurRsaIdentity;
00636
00637     static const char * RsaIdentityFile(void);
00638 };
00639
00640 PCStr AuthenSSH::gSSHName("P_SSHName", "ssh", kAddSettings);
00641 PCStr AuthenSSH::gSSHOptions("P_SSHOptions", "", kAddSettings);
00642 CPersistentBool AuthenSSH::gRsaIdentity("P_RsaIdentity", false, kAddSettings);
00643 CMString AuthenSSH::gRsaIdentityFile(10, "P_RsaIdentityFiles");
00644 PCStr AuthenSSH::gCurRsaIdentity("P_CurrentRsaIdentity", 0L, kAddSettings);
00645
00646 const char * AuthenSSH::RsaIdentityFile(void)
00647 {
00648     if(gRsaIdentityFile.GetList().size() != 0)
00649         gCurRsaIdentity = gRsaIdentityFile.GetList()[0];
00650
00651 #ifdef WIN32
00652     // Fill in a default value, if one empty slot
00653     if( gCurRsaIdentity.empty())
00654     {
00655         char *env = getenv( "HOME" );
00656         if(env != 0L )
00657         {
00658             char default_identity_folder[] = ".ssh/identity";
00659             char default_identity[ MAX_PATH ];
00660             _makepath( default_identity, NULL, env, default_identity_folder, NULL );
00661             gCurRsaIdentity = default_identity;
00662         }
00663     }
00664 #endif
00665
00666     return gCurRsaIdentity.empty() ? 0L : (const char *)gCurRsaIdentity;
00667 }
00668
00669 class UAuthen_SSH : public UWidget
00670 {
00671     UDECLARE_DYNAMIC(UAuthen_SSH)
00672 public:
00673     UAuthen_SSH();
00674     virtual ~UAuthen_SSH() {}
00675
00676     enum
00677     {
00678         kOK = EV_COMMAND_START, // 0
00679         kCancel,            // 1
00680         kRSACheck,          // 2
00681         kRSAEdit,           // 3
00682         kRSABtn,            // 4
00683         kSSHCheck,          // 5
00684         kSSHName,           // 6
00685         kOptionsText,       // 7
00686         kOptionsCheck,      // 8
00687         kOptionsEdit,       // 9
00688         kSSHBtn,            // 10
00689     };
00690
00691     virtual void DoDataExchange(bool fill);
00692
00693 protected:
00694     bool m_rsaidentity;
00695     UStr m_rsaidentityfile;
00696     UStr m_options;
00697
00698     ev_msg int OnCheckRSA(void);
00699     ev_msg int OnBtnRSA(void);
00700     ev_msg int OnCheckName(void);
00701     ev_msg int OnBtnName(void);
00702     ev_msg int OnCheckOptions(void);
00703
00704     UDECLARE_MESSAGE_MAP()
00705 };
00706
00707 UIMPLEMENT_DYNAMIC(UAuthen_SSH, UWidget)
00708
00709 UBEGIN_MESSAGE_MAP(UAuthen_SSH, UWidget)
00710     ON_UCOMMAND(kRSACheck, UAuthen_SSH::OnCheckRSA)
00711     ON_UCOMMAND(kRSABtn, UAuthen_SSH::OnBtnRSA)
00712     ON_UCOMMAND(kSSHCheck, UAuthen_SSH::OnCheckName)
00713     ON_UCOMMAND(kSSHBtn, UAuthen_SSH::OnBtnName)
00714     ON_UCOMMAND(kOptionsCheck, UAuthen_SSH::OnCheckOptions)
00715 UEND_MESSAGE_MAP()
00716
00717 UAuthen_SSH::UAuthen_SSH() : UWidget(::UEventGetWidID())
00718 {
00719 }
00720
00721 int UAuthen_SSH::OnCheckRSA(void)
00722 {
00723     m_rsaidentity = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRSACheck, 0L) != 0;
00724     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kRSAEdit, m_rsaidentity), 0L);
00725     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kRSABtn, m_rsaidentity), 0L);
00726
00727     return 0;
00728 }
00729
00730 int UAuthen_SSH::OnCheckName(void)
00731 {
00732     bool state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kSSHCheck, 0L) != 0;
00733     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kSSHName, state), 0L);
00734     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kSSHBtn, state), 0L);
00735
00736     return 0;
00737 }
00738
00739 int UAuthen_SSH::OnCheckOptions(void)
00740 {
00741     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kOptionsCheck, 0L);
00742     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kOptionsEdit, state), 0L);
00743     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kOptionsText, state), 0L);
00744
00745     return 0;
00746 }
00747
00748 int UAuthen_SSH::OnBtnRSA(void)
00749 {
00750     MultiFiles mf;
00751     if(!BrowserGetMultiFiles("Select a RSA identity :", mf))
00752         return 0;
00753
00754     CvsArgs args(false);
00755     mf.next();
00756     const char *dir = mf.add(args);
00757     char * const *argv = args.Argv();
00758     UStr fullpath;
00759     fullpath = dir;
00760     if(!fullpath.endsWith(kPathDelimiter))
00761         fullpath << kPathDelimiter;
00762     fullpath << argv[0];
00763
00764     UEventSendMessage(GetWidID(), EV_SETTEXT, kRSAEdit, (void *)fullpath.c_str());
00765
00766     return 0;
00767 }
00768
00769 int UAuthen_SSH::OnBtnName(void)
00770 {
00771     MultiFiles mf;
00772 #ifdef WIN32
00773     if(!BrowserGetMultiFiles("Select SSH :", mf, "Executable Files (*.exe)|*.exe|All Files (*.*)|*.*||"))
00774         return 0;
00775 #else
00776     if(!BrowserGetMultiFiles("Select SSH :", mf))
00777         return 0;
00778 #endif
00779
00780     CvsArgs args(false);
00781     mf.next();
00782     const char *dir = mf.add(args);
00783     char * const *argv = args.Argv();
00784     UStr fullpath;
00785     fullpath = dir;
00786     if(!fullpath.endsWith(kPathDelimiter))
00787         fullpath << kPathDelimiter;
00788     fullpath << argv[0];
00789
00790     UEventSendMessage(GetWidID(), EV_SETTEXT, kSSHName, (void *)fullpath.c_str());
00791
00792     return 0;
00793 }
00794
00795 void UAuthen_SSH::DoDataExchange(bool fill)
00796 {
00797     if(fill)
00798     {
00799         m_rsaidentity = AuthenSSH::gRsaIdentity;
00800         m_rsaidentityfile = AuthenSSH::RsaIdentityFile();
00801         UStr helpMsg = "* Some Cygwin/OpenSSH options :\n"
00802             "-v : Verbose mode\n"
00803             "-C : Request compression\n"
00804             "-1 : Forces ssh to try protocol version 1 only\n"
00805             "-2 : Forces ssh to try protocol version 2 only\n"
00806             "-4 : Forces ssh to try protocol version 2 only\n"
00807             "-6 : Forces ssh to use IPv6 addresses only";
00808
00809         UEventSendMessage(GetWidID(), EV_SETTEXT, kOptionsText, (void *)helpMsg.c_str());
00810
00811         UEventSendMessage(GetWidID(), EV_SMARTCOMBO_SETFEATURE, kRSAEdit, (void*)USmartCombo::DefaultFeature);
00812         UEventSendMessage(GetWidID(), EV_SMARTCOMBO_SETITEMS, kRSAEdit, (void*)&AuthenSSH::gRsaIdentityFile);
00813
00814         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kRSAEdit, 0L);
00815         const CMString::list_t & rsastrings = AuthenSSH::gRsaIdentityFile.GetList();
00816         CMString::list_t::const_iterator i;
00817         for(i = rsastrings.begin(); i != rsastrings.end(); ++i)
00818         {
00819             UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kRSAEdit,
00820                 (void *)(const char *)*i);
00821         }
00822
00823         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kRSACheck, m_rsaidentity), 0L);
00824         UEventSendMessage(GetWidID(), EV_SETTEXT, kRSAEdit, (void *)m_rsaidentityfile.c_str());
00825
00826         if(!AuthenSSH::gSSHName.empty())
00827         {
00828             UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kSSHCheck, 1), 0L);
00829             UEventSendMessage(GetWidID(), EV_SETTEXT, kSSHName, (void *)AuthenSSH::gSSHName.c_str());
00830         }
00831
00832         if(!AuthenSSH::gSSHOptions.empty())
00833         {
00834             UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kOptionsCheck, 1), 0L);
00835             UEventSendMessage(GetWidID(), EV_SETTEXT, kOptionsEdit, (void *)AuthenSSH::gSSHOptions.c_str());
00836         }
00837
00838         OnCheckRSA();
00839         OnCheckName();
00840         OnCheckOptions();
00841     }
00842     else
00843     {
00844         AuthenSSH::gRsaIdentity = m_rsaidentity;
00845         if(m_rsaidentity)
00846         {
00847             UEventSendMessage(GetWidID(), EV_GETTEXT, kRSAEdit, &m_rsaidentityfile);
00848             AuthenSSH::gRsaIdentityFile.Insert(m_rsaidentityfile);
00849             AuthenSSH::gCurRsaIdentity = m_rsaidentityfile;
00850         }
00851
00852         if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kSSHCheck, 0L))
00853             UEventSendMessage(GetWidID(), EV_GETTEXT, kSSHName, &AuthenSSH::gSSHName);
00854         else
00855             AuthenSSH::gSSHName = "";
00856
00857         if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kOptionsCheck, 0L))
00858             UEventSendMessage(GetWidID(), EV_GETTEXT, kOptionsEdit, &AuthenSSH::gSSHOptions);
00859         else
00860             AuthenSSH::gSSHOptions = "";
00861     }
00862 }
00863
00864 void AuthenSSH::DoSettings(void)
00865 {
00866     UAuthen_SSH *dlg = new UAuthen_SSH();
00867
00868     try
00869     {
00870 #ifdef WIN32
00871         dlg->DoModal(IDD_SSH);
00872 #endif
00873     }
00874     catch(...)
00875     {
00876     }
00877
00878     delete dlg;
00879 }
00880
00881 void AuthenSSH::GetSettingsDesc(UStr & desc)
00882 {
00883     if(!gSSHOptions.empty())
00884     {
00885         desc << "Using ";
00886         desc << gSSHOptions.c_str();
00887         desc << " ";
00888     }
00889
00890     if((bool)gRsaIdentity)
00891     {
00892         if(gSSHOptions.empty())
00893             desc << "Using ";
00894         desc << "-i ";
00895         desc << RsaIdentityFile();
00896     }
00897 }
00898
00899 void AuthenSSH::OnSetupEnv(void)
00900 {
00901     AuthenModel::OnSetupEnv();
00902
00903     static UStr rsh;
00904     static UStr options;
00905     static UStr identity;
00906
00907     rsh = "CVS_RSH=";
00908
00909     if(gSSHName.empty())
00910         rsh << "ssh";
00911     else
00912         rsh << gSSHName.c_str();
00913
00914     putenv(rsh);
00915
00916     if(!gSSHOptions.empty())
00917     {
00918         options = "CVS_RSA_OPTIONS=";
00919         options << gSSHOptions.c_str();
00920         putenv(options);
00921     }
00922
00923     if((bool)gRsaIdentity)
00924     {
00925         identity = "CVS_RSA_IDENTITY=";
00926         identity << RsaIdentityFile();
00927         putenv(identity);
00928     }
00929 }
00930
00931 void AuthenSSH::OnRestoreEnv(void)
00932 {
00933     AuthenModel::OnRestoreEnv();
00934
00935     putenv("CVS_RSH=");
00936     putenv("CVS_RSA_OPTIONS=");
00937     putenv("CVS_RSA_IDENTITY=");
00938 }
00939
00940 const char * AuthenSSH::OnGetEnv(char *env)
00941 {
00942     if(strcmp(env, "CVS_RSH") == 0)
00943     {
00944         return gSSHName.empty() ? "ssh" : (char *)gSSHName.c_str();
00945     }
00946     else if( strcmp(env, "CVS_RSA_OPTIONS") == 0)
00947     {
00948         return gSSHOptions.empty() ? 0L : (char *)gSSHOptions.c_str();
00949     }
00950     else if( strcmp(env, "CVS_RSA_IDENTITY") == 0 && (bool)gRsaIdentity)
00951     {
00952         const char *tmp = RsaIdentityFile();
00953         if( tmp && *tmp )
00954         {
00955 #ifdef WIN32
00956             while( *tmp && iswspace( *tmp ) )
00957 #else
00958             while( *tmp && isspace( *tmp ) )
00959 #endif
00960                 tmp++;
00961
00962             return *tmp ? (char *)tmp : 0L;
00963         }
00964         return 0L;
00965     }
00966     return 0L;
00967 }
00968 #endif // qMacCvsPP
00969
00970 bool CvsPrefs::UseKeyChain(void) const
00971 {
00972 #if TARGET_RT_MAC_CFM
00973     return (bool)AuthenLSH::gLSHKeychain;
00974 #else
00975     return false;
00976 #endif
00977 }
00978
00979 class AuthenPserver : public AuthenModel
00980 {
00981 public :
00982     AuthenPserver() {}
00983     virtual ~AuthenPserver() {}
00984
00985     virtual AuthenKind GetKind(void) const { return pserver; }
00986     virtual const char *GetToken(void) const { return "pserver"; }
00987
00988     virtual bool HasSettings(void) const { return true; }
00989     virtual bool HasHost(void) const { return true; }
00990     virtual bool HasUser(void) const { return true; }
00991
00992     virtual void DoSettings(void);
00993     virtual void GetSettingsDesc(UStr & desc);
00994
00995     virtual const char * OnGetEnv(char *env);
00996
00997     virtual void OnSetupEnv(void);
00998     virtual void OnRestoreEnv(void);
00999 };
01000
01001 class UAuthen_Pserver : public UWidget
01002 {
01003     UDECLARE_DYNAMIC(UAuthen_Pserver)
01004 public:
01005     UAuthen_Pserver();
01006     virtual ~UAuthen_Pserver() {}
01007
01008     enum
01009     {
01010         kOK = EV_COMMAND_START, // 0
01011         kCancel,            // 1
01012         kCheckPort,         // 2
01013         kEditPort,          // 3
01014         kCheckProxy,        // 4
01015         kNameProxy,         // 5
01016         kEditProxy          // 6
01017     };
01018
01019     virtual void DoDataExchange(bool fill);
01020
01021 protected:
01022     int m_port;
01023     int m_pport;
01024     UStr m_pname;
01025
01026     ev_msg int OnCheckPort(void);
01027     ev_msg int OnCheckProxy(void);
01028
01029     UDECLARE_MESSAGE_MAP()
01030 };
01031
01032 UIMPLEMENT_DYNAMIC(UAuthen_Pserver, UWidget)
01033
01034 UBEGIN_MESSAGE_MAP(UAuthen_Pserver, UWidget)
01035     ON_UCOMMAND(kCheckPort, UAuthen_Pserver::OnCheckPort)
01036     ON_UCOMMAND(kCheckProxy,  UAuthen_Pserver::OnCheckProxy)
01037 UEND_MESSAGE_MAP()
01038
01039 UAuthen_Pserver::UAuthen_Pserver() : UWidget(::UEventGetWidID())
01040 {
01041 }
01042
01043 int UAuthen_Pserver::OnCheckPort(void)
01044 {
01045     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01046     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, state), 0L);
01047
01048     return 0;
01049 }
01050
01051 int UAuthen_Pserver::OnCheckProxy(void)
01052 {
01053     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckProxy, 0L);
01054     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kNameProxy, state), 0L);
01055     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditProxy, state), 0L);
01056
01057     return 0;
01058 }
01059
01060 void UAuthen_Pserver::DoDataExchange(bool fill)
01061 {
01062     if(fill)
01063     {
01064         m_port = gCvsPrefs.PserverPort();
01065
01066         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, m_port != -1), 0L);
01067         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kEditPort, m_port == -1 ? 2401 : m_port), 0L);
01068         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckPort, m_port != -1), 0L);
01069
01070         m_pport = gCvsPrefs.ProxyPort();
01071         m_pname = gCvsPrefs.ProxyHost();
01072         bool useProxy = gCvsPrefs.UseProxy();
01073         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditProxy, useProxy), 0L);
01074         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kNameProxy, useProxy), 0L);
01075         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kEditProxy, m_pport), 0L);
01076         UEventSendMessage(GetWidID(), EV_SETTEXT, kNameProxy, (void *)(const char *)m_pname);
01077         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckProxy, useProxy), 0L);
01078     }
01079     else
01080     {
01081         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01082         int value = UEventSendMessage(GetWidID(), EV_GETINTEGER, kEditPort, 0L);
01083         gCvsPrefs.SetPserverPort(state ? value : -1);
01084
01085         state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckProxy, 0L);
01086         value = UEventSendMessage(GetWidID(), EV_GETINTEGER, kEditProxy, 0L);
01087         UEventSendMessage(GetWidID(), EV_GETTEXT, kNameProxy, &m_pname);
01088         gCvsPrefs.SetUseProxy(state != 0);
01089         if(state != 0)
01090         {
01091             gCvsPrefs.SetProxyHost(m_pname);
01092             gCvsPrefs.SetProxyPort(value);
01093         }
01094     }
01095 }
01096
01097 void AuthenPserver::DoSettings(void)
01098 {
01099     UAuthen_Pserver *dlg = new UAuthen_Pserver();
01100
01101     try
01102     {
01103 #if qMacCvsPP
01104         dlg->DoModal(3002);
01105 #endif
01106 #ifdef WIN32
01107         dlg->DoModal(IDD_PSERVER);
01108 #endif
01109     }
01110     catch(...)
01111     {
01112     }
01113
01114     delete dlg;
01115 }
01116
01117 void AuthenPserver::GetSettingsDesc(UStr & desc)
01118 {
01119     if(gCvsPrefs.PserverPort() == -1)
01120         desc << "Using default port and ";
01121     else
01122         desc << "Using port " << gCvsPrefs.PserverPort() << " and ";
01123
01124     if(!gCvsPrefs.UseProxy())
01125         desc << "no proxy";
01126     else
01127         desc << "using proxy host " << gCvsPrefs.ProxyHost() << " with port " << gCvsPrefs.ProxyPort();
01128 }
01129
01130 void AuthenPserver::OnSetupEnv(void)
01131 {
01132     AuthenModel::OnSetupEnv();
01133
01134     static UStr options;
01135
01136     if(gCvsPrefs.PserverPort() != -1)
01137     {
01138         options = "CVS_PSERVER_PORT=";
01139         options << gCvsPrefs.PserverPort();
01140         putenv(options);
01141     }
01142
01143 }
01144
01145 void AuthenPserver::OnRestoreEnv(void)
01146 {
01147     AuthenModel::OnRestoreEnv();
01148
01149     putenv("CVS_PSERVER_PORT=");
01150 }
01151
01152 const char * AuthenPserver::OnGetEnv(char *env)
01153 {
01154     if(strcmp(env, "CVS_PSERVER_PORT") == 0)
01155     {
01156         if(gCvsPrefs.PserverPort() != -1)
01157         {
01158             static char port[10];
01159             sprintf(port, "%d", gCvsPrefs.PserverPort());
01160             return port;
01161         }
01162
01163         return 0L;
01164     }
01165     return 0L;
01166 }
01167
01168 class AuthenRhosts : public AuthenModel
01169 {
01170 public :
01171     AuthenRhosts() {}
01172     virtual ~AuthenRhosts() {}
01173
01174     virtual AuthenKind GetKind(void) const { return rhosts; }
01175     virtual const char *GetToken(void) const { return "rhosts"; }
01176
01177     virtual bool HasSettings(void) const { return true; }
01178     virtual bool HasHost(void) const { return true; }
01179     virtual bool HasUser(void) const { return true; }
01180
01181     virtual void DoSettings(void);
01182     virtual void GetSettingsDesc(UStr & desc);
01183
01184     virtual const char * OnGetEnv(char *env);
01185
01186     virtual void OnSetupEnv(void);
01187     virtual void OnRestoreEnv(void);
01188 };
01189
01190 class UAuthen_Rhosts : public UWidget
01191 {
01192     UDECLARE_DYNAMIC(UAuthen_Rhosts)
01193 public:
01194     UAuthen_Rhosts();
01195     virtual ~UAuthen_Rhosts() {}
01196
01197     enum
01198     {
01199         kOK = EV_COMMAND_START, // 0
01200         kCancel,            // 1
01201         kCheckPort,         // 2
01202         kEditPort,          // 3
01203         kCheckRSHName,      // 4
01204         kEditRSHName,       // 5
01205         kCheckServerName,   // 6
01206         kEditServerName     // 7
01207     };
01208
01209     virtual void DoDataExchange(bool fill);
01210
01211 protected:
01212     int m_port;
01213     UStr m_rshname;
01214     UStr m_servername;
01215
01216     ev_msg int OnCheckPort(void);
01217     ev_msg int OnCheckRshName(void);
01218     ev_msg int OnCheckServerName(void);
01219
01220     UDECLARE_MESSAGE_MAP()
01221 };
01222
01223 UIMPLEMENT_DYNAMIC(UAuthen_Rhosts, UWidget)
01224
01225 UBEGIN_MESSAGE_MAP(UAuthen_Rhosts, UWidget)
01226     ON_UCOMMAND(kCheckPort, UAuthen_Rhosts::OnCheckPort)
01227     ON_UCOMMAND(kCheckRSHName, UAuthen_Rhosts::OnCheckRshName)
01228     ON_UCOMMAND(kCheckServerName, UAuthen_Rhosts::OnCheckServerName)
01229 UEND_MESSAGE_MAP()
01230
01231 UAuthen_Rhosts::UAuthen_Rhosts() : UWidget(::UEventGetWidID())
01232 {
01233 }
01234
01235 int UAuthen_Rhosts::OnCheckPort(void)
01236 {
01237     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01238     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, state), 0L);
01239
01240     return 0;
01241 }
01242
01243 int UAuthen_Rhosts::OnCheckRshName(void)
01244 {
01245     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRSHName, 0L);
01246     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditRSHName, state), 0L);
01247
01248     return 0;
01249 }
01250
01251 int UAuthen_Rhosts::OnCheckServerName(void)
01252 {
01253     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckServerName, 0L);
01254     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditServerName, state), 0L);
01255
01256     return 0;
01257 }
01258
01259 void UAuthen_Rhosts::DoDataExchange(bool fill)
01260 {
01261     if(fill)
01262     {
01263         m_port = gCvsPrefs.RhostPort();
01264         m_rshname = gCvsPrefs.RshName();
01265         m_servername = gCvsPrefs.ServerName();
01266
01267         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, m_port != -1), 0L);
01268         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kEditPort, m_port == -1 ? 0 : m_port), 0L);
01269         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckPort, m_port != -1), 0L);
01270
01271         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditRSHName, !m_rshname.empty()), 0L);
01272         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditRSHName, (void *)m_rshname.c_str());
01273         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRSHName, !m_rshname.empty()), 0L);
01274
01275         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditServerName, !m_servername.empty()), 0L);
01276         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditServerName, (void *)m_servername.c_str());
01277         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckServerName, !m_servername.empty()), 0L);
01278     }
01279     else
01280     {
01281         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01282         int value = UEventSendMessage(GetWidID(), EV_GETINTEGER, kEditPort, 0L);
01283         gCvsPrefs.SetRhostPort(state ? value : -1);
01284
01285         state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRSHName, 0L);
01286         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditRSHName, &m_rshname);
01287         gCvsPrefs.SetRshName(state ? m_rshname.c_str() : "");
01288
01289         state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckServerName, 0L);
01290         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditServerName, &m_servername);
01291         gCvsPrefs.SetServerName(state ? m_servername.c_str() : "");
01292     }
01293 }
01294
01295 void AuthenRhosts::DoSettings(void)
01296 {
01297     UAuthen_Rhosts *dlg = new UAuthen_Rhosts();
01298
01299     try
01300     {
01301 #if qMacCvsPP
01302         dlg->DoModal(3001);
01303 #endif
01304 #if WIN32
01305         dlg->DoModal(IDD_RSH);
01306 #endif
01307     }
01308     catch(...)
01309     {
01310     }
01311
01312     delete dlg;
01313 }
01314
01315 void AuthenRhosts::GetSettingsDesc(UStr & desc)
01316 {
01317     if(gCvsPrefs.RhostPort() == -1)
01318         desc << "Using default port and ";
01319     else
01320         desc << "Using port " << gCvsPrefs.RhostPort() << " and ";
01321
01322     if(gCvsPrefs.RshName() == 0L)
01323         desc << "default shell name";
01324     else
01325         desc << "shell named " << gCvsPrefs.RshName();
01326 }
01327
01328 void AuthenRhosts::OnSetupEnv(void)
01329 {
01330     AuthenModel::OnSetupEnv();
01331
01332     static UStr rsh;
01333     static UStr port;
01334     static UStr server;
01335
01336     if(gCvsPrefs.RshName() != 0L)
01337     {
01338         rsh = "CVS_RSH=";
01339         rsh << gCvsPrefs.RshName();
01340         putenv(rsh);
01341     }
01342
01343     if(gCvsPrefs.RhostPort() != -1)
01344     {
01345         port = "CVS_RCMD_PORT=";
01346         port << gCvsPrefs.RhostPort();
01347         putenv(port);
01348     }
01349
01350     if(gCvsPrefs.ServerName() != 0L)
01351     {
01352         server = "CVS_SERVER=";
01353         server << gCvsPrefs.ServerName();
01354         putenv(server);
01355     }
01356 }
01357
01358 void AuthenRhosts::OnRestoreEnv(void)
01359 {
01360     AuthenModel::OnRestoreEnv();
01361
01362     putenv("CVS_RSH=");
01363     putenv("CVS_RCMD_PORT=");
01364     putenv("CVS_SERVER=");
01365 }
01366
01367 const char * AuthenRhosts::OnGetEnv(char *env)
01368 {
01369     if(strcmp(env, "CVS_RSH") == 0)
01370     {
01371         return (char *)gCvsPrefs.RshName();
01372     }
01373     else if(strcmp(env, "CVS_RCMD_PORT") == 0)
01374     {
01375         if(gCvsPrefs.RhostPort() != -1)
01376         {
01377             static char port[10];
01378             sprintf(port, "%d", gCvsPrefs.RhostPort());
01379             return port;
01380         }
01381
01382         return 0L;
01383     }
01384     else if(strcmp(env, "CVS_SERVER") == 0)
01385     {
01386         return (char *)gCvsPrefs.ServerName();
01387     }
01388     return 0L;
01389 }
01390
01391 class AuthenKserver : public AuthenModel
01392 {
01393 public :
01394     AuthenKserver() {}
01395     virtual ~AuthenKserver() {}
01396
01397     virtual AuthenKind GetKind(void) const { return kserver; }
01398     virtual const char *GetToken(void) const { return "kserver"; }
01399
01400     virtual bool HasSettings(void) const { return true; }
01401     virtual bool HasHost(void) const { return true; }
01402     virtual bool HasUser(void) const { return true; }
01403
01404     virtual void DoSettings(void);
01405     virtual void GetSettingsDesc(UStr & desc);
01406
01407     virtual const char * OnGetEnv(char *env);
01408 };
01409
01410 class UAuthen_Kserver : public UWidget
01411 {
01412     UDECLARE_DYNAMIC(UAuthen_Kserver)
01413 public:
01414     UAuthen_Kserver();
01415     virtual ~UAuthen_Kserver() {}
01416
01417     enum
01418     {
01419         kOK = EV_COMMAND_START, // 0
01420         kCancel,            // 1
01421         kCheckPort,         // 2
01422         kEditPort           // 3
01423     };
01424
01425     virtual void DoDataExchange(bool fill);
01426
01427 protected:
01428     int m_port;
01429
01430     ev_msg int OnCheckPort(void);
01431
01432     UDECLARE_MESSAGE_MAP()
01433 };
01434
01435 UIMPLEMENT_DYNAMIC(UAuthen_Kserver, UWidget)
01436
01437 UBEGIN_MESSAGE_MAP(UAuthen_Kserver, UWidget)
01438     ON_UCOMMAND(kCheckPort, UAuthen_Kserver::OnCheckPort)
01439 UEND_MESSAGE_MAP()
01440
01441 UAuthen_Kserver::UAuthen_Kserver() : UWidget(::UEventGetWidID())
01442 {
01443 }
01444
01445 int UAuthen_Kserver::OnCheckPort(void)
01446 {
01447     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01448     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, state), 0L);
01449
01450     return 0;
01451 }
01452
01453 void UAuthen_Kserver::DoDataExchange(bool fill)
01454 {
01455     if(fill)
01456     {
01457         m_port = gCvsPrefs.KserverPort();
01458
01459         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, m_port != -1), 0L);
01460         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kEditPort, m_port == -1 ? 0 : m_port), 0L);
01461         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckPort, m_port != -1), 0L);
01462     }
01463     else
01464     {
01465         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01466         int value = UEventSendMessage(GetWidID(), EV_GETINTEGER, kEditPort, 0L);
01467         gCvsPrefs.SetKserverPort(state ? value : -1);
01468     }
01469 }
01470
01471 void AuthenKserver::DoSettings(void)
01472 {
01473     UAuthen_Kserver *dlg = new UAuthen_Kserver();
01474
01475     try
01476     {
01477 #if qMacCvsPP
01478         dlg->DoModal(3003);
01479 #endif
01480     }
01481     catch(...)
01482     {
01483     }
01484
01485     delete dlg;
01486 }
01487
01488 void AuthenKserver::GetSettingsDesc(UStr & desc)
01489 {
01490     if(gCvsPrefs.KserverPort() == -1)
01491         desc << "Using default port";
01492     else
01493         desc << "Using port " << gCvsPrefs.KserverPort();
01494 }
01495
01496 const char * AuthenKserver::OnGetEnv(char *env)
01497 {
01498     return 0L;
01499 }
01500
01501 class AuthenNtserver : public AuthenModel
01502 {
01503 public :
01504     AuthenNtserver() {}
01505     virtual ~AuthenNtserver() {}
01506
01507     virtual AuthenKind GetKind(void) const { return ntserver; }
01508     virtual const char *GetToken(void) const { return "ntserver"; }
01509
01510     virtual bool HasSettings(void) const { return false; }
01511     virtual bool HasHost(void) const { return true; }
01512
01513     virtual const char * OnGetEnv(char *env);
01514 };
01515
01516 const char * AuthenNtserver::OnGetEnv(char *env)
01517 {
01518     return 0L;
01519 }
01520
01521 class AuthenGserver : public AuthenModel
01522 {
01523 public :
01524     AuthenGserver() {}
01525     virtual ~AuthenGserver() {}
01526
01527     virtual AuthenKind GetKind(void) const { return gserver; }
01528     virtual const char *GetToken(void) const { return "gserver"; }
01529
01530     virtual bool HasSettings(void) const { return true; }
01531     virtual bool HasHost(void) const { return true; }
01532
01533     virtual void DoSettings(void);
01534     virtual void GetSettingsDesc(UStr & desc);
01535
01536     virtual const char * OnGetEnv(char *env);
01537 };
01538
01539 void AuthenGserver::GetSettingsDesc(UStr & desc)
01540 {
01541     if( gCvsPrefs.EncryptCommunication() )
01542         desc << "Encryption turned on";
01543     else
01544         desc << "Encryption turned off";
01545 }
01546
01547 const char * AuthenGserver::OnGetEnv(char *env)
01548 {
01549     return 0L;
01550 }
01551
01552 class UAuthen_Gserver : public UWidget
01553 {
01554     UDECLARE_DYNAMIC(UAuthen_Gserver)
01555 public:
01556     UAuthen_Gserver();
01557     virtual ~UAuthen_Gserver() {}
01558
01559     enum
01560     {
01561         kOK = EV_COMMAND_START, // 0
01562         kCancel,                // 1
01563         kCheckEncrypt           // 2
01564     };
01565
01566     virtual void DoDataExchange(bool fill);
01567
01568 protected:
01569     UDECLARE_MESSAGE_MAP()
01570 };
01571
01572 UIMPLEMENT_DYNAMIC(UAuthen_Gserver, UWidget)
01573
01574 UBEGIN_MESSAGE_MAP(UAuthen_Gserver, UWidget)
01575 UEND_MESSAGE_MAP()
01576
01577 UAuthen_Gserver::UAuthen_Gserver() : UWidget(::UEventGetWidID())
01578 {
01579 }
01580
01581
01582 void UAuthen_Gserver::DoDataExchange(bool fill)
01583 {
01584     if( fill )
01585     {
01586         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckEncrypt, gCvsPrefs.EncryptCommunication()), 0L);
01587     }
01588     else
01589     {
01590         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckEncrypt, 0L);
01591         gCvsPrefs.SetEncryptCommunication(state);
01592     }
01593 }
01594
01595 void AuthenGserver::DoSettings(void)
01596 {
01597     UAuthen_Gserver *dlg = new UAuthen_Gserver();
01598
01599     try
01600     {
01601 #if WIN32
01602         dlg->DoModal(IDD_GSERVER);
01603 #endif
01604     }
01605     catch(...)
01606     {
01607     }
01608
01609     delete dlg;
01610 }
01611
01612 static AuthenLocal localInstance;
01613 static AuthenPserver pserverInstance;
01614 static AuthenRhosts rhostsInstance;
01615
01616 #ifndef WIN32
01617 static AuthenKserver kserverInstance;
01618 #else
01619 static AuthenNtserver ntserverInstance;
01620 static AuthenGserver gserverInstance;
01621 #endif
01622
01623 #if TARGET_RT_MAC_CFM
01624 static AuthenLSH sshInstance;
01625 #else
01626 static AuthenSSH sshInstance;
01627 #endif
Generated on Sun Feb 24 01:21:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/Authen.h Source File

common/Authen.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * Authen.h --- class to manage CVS authentication kind
00023  */
00024
00025 #ifndef AUTHEN_H
00026 #define AUTHEN_H
00027
00028 #include "MultiString.h"
00029
00031
00032 typedef enum
00033 {
00034     rhosts,
00035     pserver,
00036     kserver,
00037     local,
00038     ssh,
00039     ntserver,
00040     gserver
00041 } AuthenKind;
00042
00046 class Authen
00047 {
00048 public :
00049     Authen() {}
00050
00051     AuthenKind kind(void);
00052     const char *kindstr(void);
00053     void setkind(AuthenKind newkind);
00054
00055     static const char *kindToToken(AuthenKind k);
00056     static AuthenKind tokenToKind(const char *t);
00057     static short kindToNum(AuthenKind k);
00058     static AuthenKind numToKind(short num);
00059
00060     static bool parse_cvsroot (const char *CVSroot,
00061         UStr & theMethod, UStr & theUser, UStr & theHost, UStr & thePath);
00062
00063     // ":pserver:", ":kserver:"
00064     const char *token(void);
00065     static const char *token(AuthenKind k);
00066     static const char * skiptoken(const char *cvsroot);
00067 };
00068
00072 class AuthenModel
00073 {
00074 public :
00075     AuthenModel();
00076     virtual ~AuthenModel();
00077
00078     static std::vector<AuthenModel *> & GetAllInstances(void);
00079     static AuthenModel *GetInstance(AuthenKind k);
00080
00081     virtual AuthenKind GetKind(void) const = 0;
00082     virtual const char *GetToken(void) const = 0;
00083
00084     virtual bool HasSettings(void) const { return false; }
00085     virtual bool HasHost(void) const { return false; }
00086     virtual bool HasUser(void) const { return false; }
00087
00088     virtual void DoSettings(void) {}
00089     virtual void GetSettingsDesc(UStr & desc) { desc = ""; }
00090
00091     virtual const char * OnGetEnv(char *env) { return 0L; }
00092
00093     /* This is intended for "cvs release". This command spawns
00094     another cvs and use the output for doing the release. The
00095     problem is that it beats the cvsgui protocol and thus we need
00096     to set up the env. variable correctly */
00097     virtual void OnSetupEnv(void);
00098     virtual void OnRestoreEnv(void);
00099 protected:
00100     static std::vector<AuthenModel *> * m_instances;
00101 };
00102
00103 extern Authen gAuthen;
00104
00105 #endif /* AUTHEN_H */
Generated on Sun Feb 24 01:21:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/BrowseViewColumn.cpp Source File

common/BrowseViewColumn.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 #include "stdafx.h"
00018
00019 #include "BrowseViewColumn.h"
00020 #include "CvsEntries.h"
00021
00022 #if TIME_WITH_SYS_TIME
00023 #   include <sys/time.h>
00024 #   include <time.h>
00025 #elif HAVE_SYS_TIME_H
00026 #   include <sys/time.h>
00027 #else
00028 #   include <time.h>
00029 #endif
00030
00031 #if qMacPP
00032 #   include "MacMisc.h"
00033 #endif
00034
00035 #ifndef _countof
00036 #   define _countof(array) (sizeof(array)/sizeof(array[0]))
00037 #endif
00038
00039 extern "C" time_t get_date(const char *date, struct timeb *now);
00040     // Jonathan M. Gilligan <jonathan.gilligan@vanderbilt.edu>
00041
00042 static void SafeCopy(char* buffer, const char *value, int bufferSize)
00043 {
00044     if (value && *value)
00045     {
00046         strncpy(buffer, value, bufferSize);
00047     }
00048     else
00049     {
00050         *buffer = 0;
00051     }
00052 }
00053
00054 #ifdef WIN32
00055 static bool IsLargeFonts()
00056 {
00057     //JK - large fonts support for Windows
00058     static bool bLargeFonts = false;
00059     static bool defined = false;
00060     if (!defined)
00061     {
00062         defined = true;
00063         HWND hDesktop = ::GetDesktopWindow();
00064         HDC hDesktopDC = ::GetDC(hDesktop);
00065         short nLogPixels = ::GetDeviceCaps(hDesktopDC, LOGPIXELSX);
00066         ::ReleaseDC(hDesktop, hDesktopDC);
00067         bLargeFonts = (nLogPixels > 96);
00068     }
00069     return bLargeFonts;
00070 }
00071 #endif
00072
00073 const class KoNameColumn : public KiColumn
00074 {
00075 // Interfaces
00076 public:
00077 #ifdef WIN32
00078     // retrieve column label
00079     virtual void GetSetupData(LV_COLUMN* lvc) const
00080     {
00081         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00082         lvc->pszText = _T("Name");
00083         lvc->cx = 150;
00084         lvc->fmt = LVCFMT_LEFT;
00085     }
00086 #else
00087     // retrieve column label
00088     virtual void GetSetupData(LV_COLUMN* lvc) const
00089     {
00090         lvc->name = "Name";
00091         lvc->width = 210;
00092     }
00093 #endif
00094
00095     // retrieve formatted text as pertained to a node
00096     virtual void GetText(KoColumnContext* /*context*/, EntnodeData* data, char* buffer, int bufferSize) const
00097     {
00098         SafeCopy(buffer, data->GetName(), bufferSize);
00099     }
00100
00101     // compare two nodes (-1,0,+1)
00102     virtual int Compare(KoColumnContext* /*context*/, EntnodeData* d1, EntnodeData* d2) const
00103     {
00104         int res = stricmp(d1->GetName(), d2->GetName());
00105         return res;
00106     }
00107
00108     // tells if the column shall be sorted ascending initially
00109     virtual bool IsDefaultAscending() const
00110     {
00111         return false;
00112     }
00113
00114 } nameColumn;
00115
00116 const class KoPathColumn : public KiColumn
00117 {
00118 // Interfaces
00119 public:
00120     // retrieve column label
00121 #ifdef WIN32
00122     virtual void GetSetupData(LV_COLUMN* lvc) const
00123     {
00124         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00125         lvc->pszText = _T("Path");
00126         lvc->cx = 150;
00127         lvc->fmt = LVCFMT_LEFT;
00128     }
00129 #else
00130     // retrieve column label
00131     virtual void GetSetupData(LV_COLUMN* lvc) const
00132     {
00133         lvc->name = "Path";
00134         lvc->width = 300;
00135     }
00136 #endif
00137
00138     // retrieve formatted text as pertained to a node
00139     virtual void GetText(KoColumnContext* context, EntnodeData* data, char* buffer, int bufferSize) const
00140     {
00141         UStr buf;
00142         const char *fullpath = data->GetFullPathName(buf);
00143         int len = context->m_path.length();
00144         fullpath += len;
00145         if (*fullpath == '\\')
00146         {
00147             fullpath++;
00148         }
00149         SafeCopy(buffer, fullpath, bufferSize);
00150         const char *name = data->GetName();
00151         if (name)
00152         {
00153             int lenName = strlen(name) + 1;
00154             int lenPath = strlen(buffer);
00155             if (lenPath <= lenName)
00156             {
00157                 strncpy(buffer, ".", bufferSize);
00158             }
00159             else
00160             {
00161                 buffer[lenPath - lenName] = 0;
00162             }
00163         }
00164     }
00165
00166     // compare two nodes (-1,0,+1)
00167     virtual int Compare(KoColumnContext* context, EntnodeData* d1, EntnodeData* d2) const
00168     {
00169         char text1[256];
00170         GetText(context, d1, text1, 256);
00171         char text2[256];
00172         GetText(context, d2, text2, 256);
00173         int res = stricmp(text1, text2);
00174         return res;
00175     }
00176
00177     // tells if the column shall be sorted ascending initially
00178     virtual bool IsDefaultAscending() const
00179     {
00180         return false;
00181     }
00182
00183 } pathColumn;
00184
00185
00186 const class KoRevisionColumn : public KiColumn
00187 {
00188 // Interfaces
00189 public:
00190     // retrieve column label
00191 #ifdef WIN32
00192     virtual void GetSetupData(LV_COLUMN* lvc) const
00193     {
00194         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00195         lvc->pszText = _T("Rev.");
00196         lvc->cx = 50;
00197         lvc->fmt = LVCFMT_LEFT;
00198     }
00199 #else
00200     // retrieve column label
00201     virtual void GetSetupData(LV_COLUMN* lvc) const
00202     {
00203         lvc->name = "Rev.";
00204         lvc->width = 70;
00205     }
00206 #endif
00207
00208     // retrieve formatted text as pertained to a node
00209     virtual void GetText(KoColumnContext* /*context*/, EntnodeData* data, char* buffer, int bufferSize) const
00210     {
00211         SafeCopy(buffer, (*data)[EntnodeFile::kVN], bufferSize);
00212     }
00213
00214     // compare two nodes (-1,0,+1)
00215     virtual int Compare(KoColumnContext* /*context*/, EntnodeData* d1, EntnodeData* d2) const
00216     {
00217         const char *s1 = (*d1)[EntnodeFile::kVN];
00218         const char *s2 = (*d2)[EntnodeFile::kVN];
00219         int res;
00220         if(s1 != 0L && s2 != 0L)
00221             res = revcmp(s1, s2);
00222         else
00223             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00224         return res;
00225     }
00226
00227
00228     static int revcmp(const char *rev1, const char *rev2)
00229     {
00230         if(rev1 == 0L && rev2 == 0L)
00231             return 0;
00232         else if(rev1 == 0L || rev2 == 0L)
00233             return rev1 == 0L ? -1 : 1;
00234
00235         CStr r1(rev1), r2(rev2);
00236         CStr q1, q2;
00237         char *tmp;
00238         int v1, v2;
00239
00240         if((tmp = strchr(r1, '.')) != 0L)
00241         {
00242             tmp[0] = '\0';
00243             q1 = tmp + 1;
00244         }
00245
00246         v1 = atoi(r1);
00247
00248         if((tmp = strchr(r2, '.')) != 0L)
00249         {
00250             tmp[0] = '\0';
00251             q2 = tmp + 1;
00252         }
00253         v2 = atoi(r2);
00254
00255         if(v1 == v2)
00256             return revcmp(q1.empty() ? (char *)0L : q1, q2.empty() ? (char *)0L : q2);
00257
00258         return v1 < v2 ? -1 : 1;
00259     }
00260
00261     // tells if the column shall be sorted ascending initially
00262     virtual bool IsDefaultAscending() const
00263     {
00264         return true;
00265     }
00266
00267 } revisionColumn;
00268
00269 const class KoOptionColumn : public KiColumn
00270 {
00271 // Interfaces
00272 public:
00273     // retrieve column label
00274 #ifdef WIN32
00275     virtual void GetSetupData(LV_COLUMN* lvc) const
00276     {
00277         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00278         lvc->pszText = _T("Option");
00279         lvc->cx = 50;
00280         lvc->fmt = LVCFMT_LEFT;
00281     }
00282 #else
00283     // retrieve column label
00284     virtual void GetSetupData(LV_COLUMN* lvc) const
00285     {
00286         lvc->name = "Option";
00287         lvc->width = 55;
00288     }
00289 #endif
00290
00291     // retrieve formatted text as pertained to a node
00292     virtual void GetText(KoColumnContext* /*context*/, EntnodeData* data, char* buffer, int bufferSize) const
00293     {
00294         SafeCopy(buffer, (*data)[EntnodeFile::kOption], bufferSize);
00295     }
00296
00297     // compare two nodes (-1,0,+1)
00298     virtual int Compare(KoColumnContext* /*context*/, EntnodeData* d1, EntnodeData* d2) const
00299     {
00300         const char *s1 = (*d1)[EntnodeFile::kOption];
00301         const char *s2 = (*d2)[EntnodeFile::kOption];
00302         int res;
00303         if(s1 != 0L && s2 != 0L)
00304             res = strcmp(s1, s2);
00305         else
00306             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00307         return res;
00308     }
00309
00310     // tells if the column shall be sorted ascending initially
00311     virtual bool IsDefaultAscending() const
00312     {
00313         return true;
00314     }
00315
00316 } optionColumn;
00317
00318 const class KoStatusColumn : public KiColumn
00319 {
00320 // Interfaces
00321 public:
00322     // retrieve column label
00323 #ifdef WIN32
00324     virtual void GetSetupData(LV_COLUMN* lvc) const
00325     {
00326         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00327         lvc->pszText = _T("Status");
00328         lvc->cx = 100;
00329         lvc->fmt = LVCFMT_LEFT;
00330     }
00331 #else
00332     // retrieve column label
00333     virtual void GetSetupData(LV_COLUMN* lvc) const
00334     {
00335         lvc->name = "Status";
00336         lvc->width = 70;
00337     }
00338 #endif
00339
00340     // retrieve formatted text as pertained to a node
00341     virtual void GetText(KoColumnContext* /*context*/, EntnodeData* data, char* buffer, int bufferSize) const
00342     {
00343         SafeCopy(buffer, (*data)[EntnodeData::kStatus], bufferSize);
00344     }
00345
00346     // compare two nodes (-1,0,+1)
00347     virtual int Compare(KoColumnContext* /*context*/, EntnodeData* d1, EntnodeData* d2) const
00348     {
00349         int res = stricmp((*d1)[EntnodeData::kStatus], (*d2)[EntnodeData::kStatus]);
00350         return res;
00351     }
00352
00353     // tells if the column shall be sorted ascending initially
00354     virtual bool IsDefaultAscending() const
00355     {
00356         return true;
00357     }
00358
00359 } statusColumn;
00360
00361 const class KoTagColumn : public KiColumn
00362 {
00363 // Interfaces
00364 public:
00365     // retrieve column label
00366 #ifdef WIN32
00367     virtual void GetSetupData(LV_COLUMN* lvc) const
00368     {
00369         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00370         lvc->pszText = _T("Tag");
00371         lvc->cx = 150;
00372         lvc->fmt = LVCFMT_LEFT;
00373     }
00374 #else
00375     // retrieve column label
00376     virtual void GetSetupData(LV_COLUMN* lvc) const
00377     {
00378         lvc->name = "Tag";
00379         lvc->width = 90;
00380     }
00381 #endif
00382
00383     // retrieve formatted text as pertained to a node
00384     virtual void GetText(KoColumnContext* /*context*/, EntnodeData* data, char* buffer, int bufferSize) const
00385     {
00386         SafeCopy(buffer, (*data)[EntnodeFile::kTag], bufferSize);
00387     }
00388
00389     // compare two nodes (-1,0,+1)
00390     virtual int Compare(KoColumnContext* /*context*/, EntnodeData* d1, EntnodeData* d2) const
00391     {
00392         const char *s1 = (*d1)[EntnodeFile::kTag];
00393         const char *s2 = (*d2)[EntnodeFile::kTag];
00394         int res;
00395         if(s1 != 0L && s2 != 0L)
00396             res = strcmp(s1, s2);
00397         else
00398             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00399         return res;
00400
00401     }
00402
00403     // tells if the column shall be sorted ascending initially
00404     virtual bool IsDefaultAscending() const
00405     {
00406         return true;
00407     }
00408
00409 } tagColumn;
00410
00411
00412 const class KoDateColumn : public KiColumn
00413 {
00414 // Interfaces
00415 public:
00416     // retrieve column label
00417 #ifdef WIN32
00418     virtual void GetSetupData(LV_COLUMN* lvc) const
00419     {
00420         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00421         lvc->pszText = _T("Date");
00422         lvc->cx = (IsLargeFonts()) ? 170 : 150;
00423         lvc->fmt = LVCFMT_LEFT;
00424     }
00425 #else
00426     // retrieve column label
00427     virtual void GetSetupData(LV_COLUMN* lvc) const
00428     {
00429         lvc->name = "Date";
00430         lvc->width = 135;
00431     }
00432 #endif
00433
00434     // retrieve formatted text as pertained to a node
00435     virtual void GetText(KoColumnContext* /*context*/, EntnodeData* data, char* buffer, int bufferSize) const
00436     {
00437         SafeCopy(buffer, (*data)[EntnodeFile::kTS], bufferSize);
00438     }
00439
00440     // compare two nodes (-1,0,+1)
00441     virtual int Compare(KoColumnContext* /*context*/, EntnodeData* d1, EntnodeData* d2) const
00442     {
00443         const char *s1 = (*d1)[EntnodeFile::kTS];
00444         const char *s2 = (*d2)[EntnodeFile::kTS];
00445         int res;
00446
00447         if(s1 != 0L && s2 != 0L) {
00448             time_t t1 = get_date(s1,(struct timeb *)NULL);
00449             time_t t2 = get_date(s2,(struct timeb *)NULL);
00450
00451             res = t1 < t2 ? -1 : (t1 > t2 ? 1 : 0);
00452         }
00453         else
00454             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00455         return res;
00456     }
00457
00458     // tells if the column shall be sorted ascending initially
00459     virtual bool IsDefaultAscending() const
00460     {
00461         return true;
00462     }
00463
00464
00465 } dateColumn;
00466
00467 const class KoConflictColumn : public KiColumn
00468 {
00469 // Interfaces
00470 public:
00471     // retrieve column label
00472 #ifdef WIN32
00473     virtual void GetSetupData(LV_COLUMN* lvc) const
00474     {
00475         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00476         lvc->pszText = _T("Conflict");
00477         lvc->cx = 150;
00478         lvc->fmt = LVCFMT_LEFT;
00479     }
00480 #else
00481     // retrieve column label
00482     virtual void GetSetupData(LV_COLUMN* lvc) const
00483     {
00484         lvc->name = "Conflict";
00485         lvc->width = 100;
00486     }
00487 #endif
00488
00489     // retrieve formatted text as pertained to a node
00490     virtual void GetText(KoColumnContext* /*context*/, EntnodeData* data, char* buffer, int bufferSize) const
00491     {
00492         SafeCopy(buffer, data->GetConflict(), bufferSize);
00493     }
00494
00495     // compare two nodes (-1,0,+1)
00496     virtual int Compare(KoColumnContext* /*context*/, EntnodeData* d1, EntnodeData* d2) const
00497     {
00498         const char *s1 = d1->GetConflict();
00499         const char *s2 = d2->GetConflict();
00500         int res;
00501         if(s1 != 0L && s2 != 0L)
00502             res = strcmp(s1, s2);
00503         else
00504             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00505         return res;
00506     }
00507
00508     // tells if the column shall be sorted ascending initially
00509     virtual bool IsDefaultAscending() const
00510     {
00511         return true;
00512     }
00513
00514
00515 } conflictColumn;
00516
00517 // all known columns for view's perusal
00518 static const KiColumn* columnsRegular[] = {
00519     &nameColumn, &revisionColumn, &optionColumn, &statusColumn, &tagColumn, &dateColumn, &conflictColumn
00520 };
00521
00522 static const int typesRegular[] = {
00523     EntnodeData::kName, EntnodeFile::kVN, EntnodeFile::kOption, EntnodeData::kStatus,
00524     EntnodeFile::kTag, EntnodeFile::kTS, EntnodeFile::kConflict
00525 };
00526
00527 static const KiColumn* columnsRecursive[] = {
00528     &nameColumn, &pathColumn, &revisionColumn, &optionColumn, &statusColumn, &tagColumn, &dateColumn, &conflictColumn
00529 };
00530
00531 static const int typesRecursive[] = {
00532     EntnodeData::kName, EntnodeFile::kPath, EntnodeFile::kVN, EntnodeFile::kOption, EntnodeData::kStatus,
00533     EntnodeFile::kTag, EntnodeFile::kTS, EntnodeFile::kConflict
00534 };
00535
00536 // regular columnar model
00537 class KoRegularModel : public KiColumnModel
00538 {
00539
00540
00541 // Interfaces
00542 public:
00543     virtual const KiColumn* GetAt(int pos) const
00544     {
00545         return columnsRegular[pos];
00546     }
00547
00548
00549     virtual int GetType(int pos) const
00550     {
00551         return typesRegular[pos];
00552     }
00553
00554
00555     virtual int GetCount() const
00556     {
00557         return _countof(columnsRegular);
00558     }
00559
00560 } modelRegular;
00561
00562 // recursive columnar model
00563 class KoRecursiveModel : public KiColumnModel
00564 {
00565 // Interfaces
00566 public:
00567     virtual const KiColumn* GetAt(int pos) const
00568     {
00569         return columnsRecursive[pos];
00570     }
00571
00572
00573     virtual int GetType(int pos) const
00574     {
00575         return typesRecursive[pos];
00576     }
00577
00578
00579     virtual int GetCount() const
00580     {
00581         return _countof(columnsRecursive);
00582     }
00583
00584 } modelRecursive;
00585
00587 // instantiation
00588 KiColumnModel* KiColumnModel::GetRecursiveModel()
00589 {
00590     return &modelRecursive;
00591 }
00592
00593 KiColumnModel* KiColumnModel::GetRegularModel()
00594 {
00595     return &modelRegular;
00596 }
00597
00598 int KiColumnModel::GetColumn(int type) const
00599 {
00600     int numColumns = GetCount();
00601     for(int i = 0; i < numColumns; i++)
00602     {
00603         if(type == GetType(i))
00604             return i;
00605     }
00606     return 0;
00607 }
00608
00609 #ifdef WIN32
00610 int CALLBACK _Compare(LPARAM data1, LPARAM data2, LPARAM data)
00611 #else
00612 int _Compare(void *data1, void *data2, void *data)
00613 #endif
00614 {
00615     int res = 0;
00616     bool fOneDirOnly = false;
00617
00618     EntnodeData *d1 = (EntnodeData *)data1;
00619     EntnodeData *d2 = (EntnodeData *)data2;
00620
00621     const CSortParam *pSortParam = (CSortParam*)data;
00622
00623     //  Group sub dirs ?
00624     if (pSortParam->m_fGroupSubDir)
00625     {
00626         int d1IsDir = d1->GetType()==ENT_SUBDIR;
00627         int d2IsDir = d2->GetType()==ENT_SUBDIR;
00628
00629         if( (d1IsDir + d2IsDir) == 1)
00630         {
00631             //  One (and only one of them) is a directory
00632             fOneDirOnly = true;
00633             res = d1IsDir ? -1 : 1;
00634         }
00635     }
00636
00637     if (!res)
00638     {
00639         res = pSortParam->m_column->Compare(pSortParam->m_context, d1, d2);
00640     }
00641
00642     if (res==0 && pSortParam->m_column != pSortParam->m_columnAlt)
00643         res = pSortParam->m_columnAlt->Compare(pSortParam->m_context, d1, d2);
00644     else if (!fOneDirOnly)
00645         res = pSortParam->m_fAccendant ? -res : res;
00646     return res;
00647 }
Generated on Sun Feb 24 01:21:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/BrowseViewColumn.h Source File

common/BrowseViewColumn.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 #ifndef __BROWSEVIEW_COLUMN_H__
00018 #define __BROWSEVIEW_COLUMN_H__
00019
00020 class EntnodeData;
00021
00022 #include "ustr.h"
00023
00024 // context in which a collumn is accessed
00025 class KoColumnContext
00026 {
00027 // Attributes
00028 public:
00029     UStr m_path;
00030     // current path
00031
00032 public:
00033     KoColumnContext(const char *path)
00034     : m_path(path)
00035     {}
00036 };
00037
00038 #ifndef WIN32
00039     struct LV_COLUMN
00040     {
00041         int width;
00042         const char *name;
00043     };
00044 #endif
00045
00046 //  column descriptor interface
00047 class KiColumn
00048 {
00049 // Interfaces
00050 public:
00051     // retrieve setup data
00052     virtual void GetSetupData(LV_COLUMN* lvc) const = 0;
00053
00054     // tells if the column shall be sorted ascending initially
00055     virtual bool IsDefaultAscending() const = 0;
00056
00057     // retrieve formatted text as pertained to a node
00058     virtual void GetText(KoColumnContext* context, EntnodeData* data, char* buffer, int buffersize) const = 0;
00059
00060     // compare two nodes (-1,0,+1)
00061     virtual int Compare(KoColumnContext* context, EntnodeData* d1, EntnodeData* d2) const = 0;
00062 };
00063
00064 // columnar model of the data
00065 class KiColumnModel
00066 {
00067 // Interfaces
00068 public:
00069     virtual const KiColumn* GetAt(int pos) const = 0;
00070     // gets column descriptor by its index
00071
00072     virtual int GetType(int pos) const = 0;
00073     // gets column type by its index
00074
00075     virtual int GetCount() const = 0;
00076     // returns count of the columns
00077
00078     virtual int GetColumn(int type) const;
00079     // gets column index by its type
00080
00081 // Factory methods
00082 public:
00083     static KiColumnModel* GetRecursiveModel();
00084     static KiColumnModel* GetRegularModel();
00085 };
00086
00087 struct CSortParam
00088 {
00089     CSortParam (bool fAccendant, bool fGroupSubDir, const KiColumn* column, const KiColumn* columnAlt, KoColumnContext* context)
00090     : m_fAccendant(fAccendant)
00091     , m_fGroupSubDir(fGroupSubDir)
00092     , m_column(column)
00093     , m_columnAlt(columnAlt)
00094     , m_context(context)
00095     {};
00096
00097     const KiColumn* m_column;     // descriptor of the column being sorted
00098     const KiColumn* m_columnAlt;// descriptor of the alternate sorting column
00099     KoColumnContext* m_context;
00100     bool m_fAccendant;
00101     bool m_fGroupSubDir;
00102 };
00103
00104 #ifdef WIN32
00105 int CALLBACK _Compare(LPARAM data1, LPARAM data2, LPARAM data);
00106 #else
00107 int _Compare(void *data1, void *data2, void *data);
00108 #endif
00109
00110 #endif
00111 // __BROWSEVIEW_COLUMN_H__
Generated on Sun Feb 24 01:21:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/BrowseViewHandlers.h Source File

common/BrowseViewHandlers.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 #ifndef _BROWSEVIEWHANDLERS_H_
00018 #define _BROWSEVIEWHANDLERS_H_
00019
00020 # include "CvsAlert.h"
00021
00022 // interface describing a handler to process a selection-related command
00023 class KiSelectionHandler
00024 {
00025 public:
00026     // called for each folder in selection
00027     virtual void OnFolder(const char* fullpath) = 0;
00028
00029     // called after all folders are processed and there are selected files
00030     virtual void OnFiles(MultiFiles* mf) = 0;
00031 };
00032
00033
00034 // handles moving files to trash
00035 class KoMoveToTrashHandler : public KiSelectionHandler
00036 {
00037 public:
00038     // called for each folder in selection
00039     virtual void OnFolder(const char* fullpath)
00040     { /* ignore */ }
00041
00042     // called after all folders are processed and there are selected files
00043     virtual void OnFiles(MultiFiles* mf)
00044     {
00045         if( !CvsAlert("Are you sure you want to erase selected files?", "Yes", "No") )
00046         {
00047             return;
00048         }
00049
00050         while(mf->next())
00051         {
00052             int count = mf->NumFiles();
00053             for (int i = 0; i < count; i++)
00054             {
00055                 CStr path, fileName;
00056                 if (mf->get(i, path, fileName))
00057                 {
00058                     char fn[_MAX_PATH];
00059                     _makepath(fn, NULL, path, fileName, NULL);
00060                     if(!CompatMoveToTrash(fn))
00061                     {
00062                         cvs_err("Unable to remove '%s' (error %d)\n", fn, errno);
00063                     }
00064                     else
00065                     {
00066                         cvs_out("'%s' has been moved successfully to the recycle bin...\n", fn);
00067                     }
00068                 }
00069             }
00070         }
00071     }
00072
00073 };
00074
00075 // handles figuring out if moving files to trash is enabled
00076 class KoUpdateMoveToTrashHandler  : public KiSelectionHandler
00077 {
00078 // Attributes
00079     bool m_isFolders, m_isFiles;
00080
00081 public:
00082     KoUpdateMoveToTrashHandler()
00083     : m_isFolders(false), m_isFiles(false)
00084     {}
00085
00086     virtual void OnFolder(const char* fullpath)
00087     {
00088         m_isFolders = true;
00089     }
00090
00091     // called after all folders are processed and there are selected files
00092     virtual void OnFiles(MultiFiles* /*mf*/)
00093     {
00094         m_isFiles = true;
00095     }
00096
00097     bool IsEnabled() const
00098     {
00099         return !m_isFolders && m_isFiles;
00100     }
00101 };
00102
00103
00104 // handles create tag request on the selected items
00105 class KoCreateTagHandler : public KiSelectionHandler
00106 {
00107     virtual void OnFolder(const char* fullpath)
00108     {
00109         CvsCmdTagCreateFolder(fullpath);
00110     }
00111
00112     virtual void OnFiles(MultiFiles* pmf)
00113     {
00114         CvsCmdTagCreateFiles(pmf);
00115     }
00116 };
00117
00118 // handles delete tag request on the selected items
00119 class KoDeleteTagHandler : public KiSelectionHandler
00120 {
00121     virtual void OnFolder(const char* fullpath)
00122     {
00123         CvsCmdTagDeleteFolder(fullpath);
00124     }
00125
00126     virtual void OnFiles(MultiFiles* pmf)
00127     {
00128         CvsCmdTagDeleteFiles(pmf);
00129     }
00130 };
00131
00132 // handles branch request on the selected items
00133 class KoBranchTagHandler : public KiSelectionHandler
00134 {
00135     virtual void OnFolder(const char* fullpath)
00136     {
00137         CvsCmdTagBranchFolder(fullpath);
00138     }
00139
00140     virtual void OnFiles(MultiFiles* pmf)
00141     {
00142         CvsCmdTagBranchFiles(pmf);
00143     }
00144 };
00145
00146 // handles edit start request on the selected items
00147 class KoEditHandler : public KiSelectionHandler
00148 {
00149     virtual void OnFolder(const char* fullpath)
00150     {
00151         CvsCmdEditFolder(fullpath);
00152     }
00153
00154     virtual void OnFiles(MultiFiles* pmf)
00155     {
00156         CvsCmdEditFiles(pmf);
00157     }
00158 };
00159
00160 // handles reserved edit start request on the selected items
00161 class KoReservedEditHandler : public KiSelectionHandler
00162 {
00163     virtual void OnFolder(const char* fullpath)
00164     {
00165         CvsCmdEditFolder(fullpath, kEditReserved);
00166     }
00167
00168     virtual void OnFiles(MultiFiles* pmf)
00169     {
00170         CvsCmdEditFiles(pmf, kEditReserved);
00171     }
00172 };
00173
00174 // handles force edit start request on the selected items
00175 class KoForceEditHandler : public KiSelectionHandler
00176 {
00177     virtual void OnFolder(const char* fullpath)
00178     {
00179         CvsCmdEditFolder(fullpath, kEditForce);
00180     }
00181
00182     virtual void OnFiles(MultiFiles* pmf)
00183     {
00184         CvsCmdEditFiles(pmf, kEditForce);
00185     }
00186 };
00187
00188 // handles edit stop request on the selected items
00189 class KoUneditHandler : public KiSelectionHandler
00190 {
00191     virtual void OnFolder(const char* fullpath)
00192     {
00193         CvsCmdUneditFolder(fullpath);
00194     }
00195
00196     virtual void OnFiles(MultiFiles* pmf)
00197     {
00198         CvsCmdUneditFiles(pmf);
00199     }
00200 };
00201
00202 // handles releasing on the selected items
00203 class KoReleaseHandler : public KiSelectionHandler
00204 {
00205     virtual void OnFolder(const char* fullpath)
00206     {
00207         CvsCmdReleaseFolder(fullpath);
00208     }
00209
00210     virtual void OnFiles(MultiFiles* /*pmf*/)
00211     {   }
00212 };
00213
00214 // handles watchers on the selected items
00215 class KoWatchersHandler : public KiSelectionHandler
00216 {
00217     virtual void OnFolder(const char* fullpath)
00218     {
00219         CvsCmdWatchersFolder(fullpath);
00220     }
00221
00222     virtual void OnFiles(MultiFiles* pmf)
00223     {
00224         CvsCmdWatchersFiles(pmf);
00225     }
00226 };
00227
00228 // handles editors on the selected items
00229 class KoEditorsHandler : public KiSelectionHandler
00230 {
00231     virtual void OnFolder(const char* fullpath)
00232     {
00233         CvsCmdEditorsFolder(fullpath);
00234     }
00235
00236     virtual void OnFiles(MultiFiles* pmf)
00237     {
00238         CvsCmdEditorsFiles(pmf);
00239     }
00240 };
00241
00242 // handles watch on on the selected items
00243 class KoWatchOnHandler : public KiSelectionHandler
00244 {
00245     virtual void OnFolder(const char* fullpath)
00246     {
00247         CvsCmdWatchOnFolder(fullpath);
00248     }
00249
00250     virtual void OnFiles(MultiFiles* pmf)
00251     {
00252         CvsCmdWatchOnFiles(pmf);
00253     }
00254 };
00255
00256 // handles watch off on the selected items
00257 class KoWatchOffHandler : public KiSelectionHandler
00258 {
00259     virtual void OnFolder(const char* fullpath)
00260     {
00261         CvsCmdWatchOffFolder(fullpath);
00262     }
00263
00264     virtual void OnFiles(MultiFiles* pmf)
00265     {
00266         CvsCmdWatchOffFiles(pmf);
00267     }
00268 };
00269
00270 // handles diffing on the selected items
00271 class KoDiffHandler : public KiSelectionHandler
00272 {
00273     virtual void OnFolder(const char* fullpath)
00274     {
00275         CvsCmdDiffFolder(fullpath);
00276     }
00277
00278     virtual void OnFiles(MultiFiles* pmf)
00279     {
00280         CvsCmdDiffFiles(pmf);
00281     }
00282 };
00283
00284 // handles log queries on the selected items
00285 class KoLogHandler : public KiSelectionHandler
00286 {
00287     virtual void OnFolder(const char* fullpath)
00288     {
00289         CvsCmdLogFolder(fullpath);
00290     }
00291
00292     virtual void OnFiles(MultiFiles* pmf)
00293     {
00294         CvsCmdLogFiles(pmf);
00295     }
00296 };
00297
00298 // handles graph log queries on the selected items
00299 class KoGraphHandler : public KiSelectionHandler
00300 {
00301     virtual void OnFolder(const char* /*fullpath*/)
00302     {
00303         /*we avoid processing directory*/
00304     }
00305
00306     virtual void OnFiles(MultiFiles* pmf)
00307     {
00308         CvsCmdLogFiles(pmf, true);
00309     }
00310 };
00311
00312 // handles status queries on the selected items
00313 class KoStatusHandler : public KiSelectionHandler
00314 {
00315     virtual void OnFolder(const char* fullpath)
00316     {
00317         CvsCmdStatusFolder(fullpath);
00318     }
00319
00320     virtual void OnFiles(MultiFiles* pmf)
00321     {
00322         CvsCmdStatusFiles(pmf);
00323     }
00324 };
00325
00326 // handles file remove requests
00327 class KoFileRemoveHandler : public KiSelectionHandler
00328 {
00329     virtual void OnFolder(const char* fullpath)
00330     { /*folder cannot be removed */ }
00331
00332     virtual void OnFiles(MultiFiles* pmf)
00333     {
00334         CvsCmdRemoveFiles(pmf);
00335     }
00336 };
00337
00338 // handles locking on the selected items
00339 class KoLockHandler : public KiSelectionHandler
00340 {
00341     virtual void OnFolder(const char* fullpath)
00342     {
00343         CvsCmdLockFolder(fullpath);
00344     }
00345
00346     virtual void OnFiles(MultiFiles* pmf)
00347     {
00348         CvsCmdLockFiles(pmf);
00349     }
00350 };
00351
00352 // handles unlocking on the selected items
00353 class KoUnlockHandler : public KiSelectionHandler
00354 {
00355     virtual void OnFolder(const char* fullpath)
00356     {
00357         CvsCmdUnlockFolder(fullpath);
00358     }
00359
00360     virtual void OnFiles(MultiFiles* pmf)
00361     {
00362         CvsCmdUnlockFiles(pmf);
00363     }
00364 };
00365
00366 // handles addition of the selected items
00367 class KoAddHandler : public KiSelectionHandler
00368 {
00369     virtual void OnFolder(const char* fullpath)
00370     {
00371         CvsCmdAddFolder(fullpath);
00372     }
00373
00374     virtual void OnFiles(MultiFiles* pmf)
00375     {
00376         CvsCmdAddFiles(pmf);
00377     }
00378 };
00379
00380 // handles binary addition of the selected items
00381 class KoAddBinaryHandler : public KiSelectionHandler
00382 {
00383     virtual void OnFolder(const char* fullpath)
00384     {
00385         CvsCmdAddFolder(fullpath);
00386     }
00387
00388     virtual void OnFiles(MultiFiles* pmf)
00389     {
00390         CvsCmdAddBinaryFiles(pmf);
00391     }
00392 };
00393
00394 // handles unicode addition of the selected items
00395 class KoAddUnicodeHandler : public KiSelectionHandler
00396 {
00397     virtual void OnFolder(const char* fullpath)
00398     {
00399         CvsCmdAddFolder(fullpath);
00400     }
00401
00402     virtual void OnFiles(MultiFiles* pmf)
00403     {
00404         CvsCmdAddUnicodeFiles(pmf);
00405     }
00406 };
00407
00408 // handles commits of the selected items
00409 class KoCommitHandler : public KiSelectionHandler
00410 {
00411     virtual void OnFolder(const char* fullpath)
00412     {
00413         CvsCmdCommitFolder(fullpath);
00414     }
00415
00416     virtual void OnFiles(MultiFiles* pmf)
00417     {
00418         CvsCmdCommitFiles(pmf);
00419     }
00420 };
00421
00422 // handles updates on the selected items
00423 class KoUpdateHandler : public KiSelectionHandler
00424 {
00425     virtual void OnFolder(const char* fullpath)
00426     {
00427         CvsCmdUpdateFolder(fullpath);
00428     }
00429
00430     virtual void OnFiles(MultiFiles* pmf)
00431     {
00432         CvsCmdUpdateFiles(pmf);
00433     }
00434 };
00435
00436 // handles query updates on the selected items
00437 class KoQueryUpdateHandler : public KiSelectionHandler
00438 {
00439     virtual void OnFolder(const char* fullpath)
00440     {
00441         CvsCmdUpdateFolder(fullpath, true);
00442     }
00443
00444     virtual void OnFiles(MultiFiles* pmf)
00445     {
00446         CvsCmdUpdateFiles(pmf, true);
00447     }
00448 };
00449
00450 // handles annotate on the selected items
00451 class KoAnnotateHandler : public KiSelectionHandler
00452 {
00453     virtual void OnFolder(const char* /*fullpath*/)
00454     {
00455         /*we avoid processing directory*/
00456     }
00457
00458     virtual void OnFiles(MultiFiles* pmf)
00459     {
00460         CvsCmdAnnotateFiles(pmf);
00461     }
00462 };
00463
00464 #endif
00465 // OWSEVIEWHANDLERS_H_
Generated on Sun Feb 24 01:21:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/BrowseViewModel.cpp Source File

common/BrowseViewModel.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 #include "stdafx.h"
00018
00019 #include "BrowseViewModel.h"
00020 #include "Persistent.h"
00021 #include "CvsEntries.h"
00022
00023 #if qMacPP
00024 #   include "MacMisc.h"
00025 #endif
00026
00028 // KoFilterModel implementation
00029 static CPersistentBool persistentChanged("P_ViewChanged", false);
00030 static CPersistentBool persistentAdded("P_ViewAdded", false);
00031 static CPersistentBool persistentRemoved("P_ViewRemoved", false);
00032 static CPersistentBool persistentConflicts("P_ViewConflicts", false);
00033 static CPersistentBool persistentUnknown("P_ViewUnknown", false);
00034 static CPersistentBool persistentHideUnknown("P_ViewHideUnknown", false);
00035 static CPersistentBool persistentMissing("P_ViewMissing", false);
00036
00037 KoFilterModel::KoFilterModel()
00038 : m_isChanged(persistentChanged)
00039 , m_isAdded(persistentAdded)
00040 , m_isRemoved(persistentRemoved)
00041 , m_isConflicts(persistentConflicts)
00042 , m_isUnknown(persistentUnknown)
00043 , m_isMissing(persistentMissing)
00044 , m_isHideUnknown(persistentHideUnknown)
00045 {}
00046
00047 KoFilterModel::~KoFilterModel()
00048 {
00049     persistentChanged = m_isChanged;
00050     persistentAdded = m_isAdded;
00051     persistentRemoved = m_isRemoved;
00052     persistentConflicts = m_isConflicts;
00053     persistentUnknown = m_isUnknown;
00054     persistentMissing = m_isMissing;
00055     persistentHideUnknown = m_isHideUnknown;
00056 }
00057
00058 bool KoFilterModel::IsDefaultMode() const
00059 {
00060     return !m_isConflicts && !m_isChanged && !m_isMissing && !m_isAdded && !m_isRemoved;
00061 }
00062
00063 bool KoFilterModel::IsMatch(EntnodeData* data)
00064 {
00065     // check to see if file name matches
00066     if (m_match.size() && !MatchIgnoredList(data->GetName(), m_match))
00067     {
00068         return false;
00069     }
00070
00071     if (IsDefaultMode() && !m_isUnknown)
00072     {
00073         // check if unknown files are to be hidden
00074         if (data->IsUnknown() && m_isHideUnknown)
00075         {
00076             // unknown item match
00077             return false;
00078         }
00079
00080         return true;
00081     }
00082
00083     if (data->IsMissing() && data->IsRemoved() && m_isRemoved)
00084     {
00085         // removed item match
00086         return true;
00087     }
00088
00089     if (data->IsMissing() && !data->IsRemoved() && m_isMissing)
00090     {
00091         // missing item match
00092         return true;
00093     }
00094
00095     if (data->IsUnknown() && m_isUnknown)
00096     {
00097         // unknown item match
00098         return true;
00099     }
00100
00101     if ((data->GetConflict() != NULL) && m_isConflicts)
00102     {
00103         // conflict match
00104         return true;
00105     }
00106
00107     if (!data->IsUnmodified())
00108     {
00109         // can be either changed or added
00110         const char* vn = (*data)[EntnodeFile::kVN];
00111         bool isAdded = vn && (strcmp(vn, "0") == 0);
00112         if (isAdded && m_isAdded)
00113         {
00114             // added file match
00115             return true;
00116         }
00117         if (!isAdded && m_isChanged)
00118         {
00119             // changed file match
00120             return true;
00121         }
00122     }
00123
00124     // no match
00125     return false;
00126 }
00127
00128 // toggles hide unknown flag
00129 void KoFilterModel::ToggleHideUnknown()
00130 {
00131     m_isHideUnknown = !m_isHideUnknown;
00132     if (m_isHideUnknown)
00133     {
00134         m_isUnknown = false;
00135     }
00136 }
00137
00138 // toggles show conflict flag
00139 void KoFilterModel::ToggleUnknown()
00140 {
00141     m_isUnknown = !m_isUnknown;
00142     if (m_isUnknown)
00143     {
00144         m_isHideUnknown = false;
00145     }
00146 }
00147
00148
00149 void KoFilterModel::ToggleModified()
00150 {
00151     m_isAdded =
00152     m_isChanged =
00153     m_isRemoved =
00154     m_isConflicts = !IsModified();
00155 }
00156
00157 //accessor for modified flag
00158 bool KoFilterModel::IsModified() const
00159 {
00160     bool isModified = m_isAdded && m_isChanged && m_isRemoved && m_isConflicts;
00161     return isModified;
00162 }
00163
00164 NotificationManager* KoFilterModel::GetNotificationManager()
00165 {
00166     return &m_manager;
00167 }
00168
00169 bool KoFilterModel::SetMask(const char *fileMask)
00170 {
00171     bool changed = m_mask.empty() || fileMask == 0L || stricmp(m_mask, fileMask) != 0;
00172     if (changed)
00173     {
00174         m_mask = fileMask;
00175         m_match.clear();
00176         if (!m_mask.empty())
00177         {
00178             // build match list
00179             UStr mask = fileMask;
00180             char * buffer = mask;
00181             static const char separators[] = " \t;";
00182             for (char * token = strtok(buffer, separators); token; token = strtok(NULL, separators))
00183             {
00184                 m_match.push_back(UStr(token));
00185             }
00186         }
00187     }
00188     return changed;
00189 }
00190
00192 // recursion model implementation
00193 static CPersistentBool persistentRecursive("P_DisplayRecursive", false);
00194
00195 KoRecursionModel::KoRecursionModel()
00196 : m_isRecursive(persistentRecursive)
00197 {}
00198
00199 KoRecursionModel::~KoRecursionModel()
00200 {
00201     persistentRecursive = m_isRecursive;
00202 }
00203
00204 bool KoRecursionModel::IsShowRecursive()
00205 {
00206     return m_isRecursive;
00207 }
00208
00209 NotificationManager* KoRecursionModel::GetNotificationManager()
00210 {
00211     return &m_manager;
00212 }
00213
00214 void KoRecursionModel::ToggleRecursion()
00215 {
00216     m_isRecursive = !m_isRecursive;
00217 };
00218
00220 // ignore model implementation
00221 static CPersistentBool persistentIgnore("P_FileViewIgnore", true);
00222
00223 KoIgnoreModel::KoIgnoreModel()
00224 : m_isIgnore(persistentIgnore)
00225 {}
00226
00227 KoIgnoreModel::~KoIgnoreModel()
00228 {
00229     persistentIgnore =  m_isIgnore;
00230 }
00231
00232 bool KoIgnoreModel::IsShowIgnored()
00233 {
00234     return m_isIgnore;
00235 }
00236
00237 NotificationManager* KoIgnoreModel::GetNotificationManager()
00238 {
00239     return &m_manager;
00240 }
00241
00242 void KoIgnoreModel::ToggleIgnore()
00243 {
00244     m_isIgnore = !m_isIgnore;
00245 };
Generated on Sun Feb 24 01:21:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/BrowseViewModel.h Source File

common/BrowseViewModel.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 #ifndef __MODEL__H__
00018 #define __MODEL__H__
00019
00020 #include "UStr.h"
00021 #include <vector>
00022
00023 // forward references
00024 class EntnodeData;
00025
00026 #if qMacPP
00027 #define CObject LPane
00028 #endif
00029
00030 // use this to cast to proper notification handler
00031 typedef void (*FNOBSERVER)(CObject*);
00032
00033
00034 // notification handler
00035 //template <class TObserver>
00036 class NotificationManager
00037 {
00038 // used types
00039 public:
00040
00041 private:
00042     // node describing observer registration
00043     struct Node
00044     {
00045         CObject* observer;
00046         // observer
00047
00048         FNOBSERVER handler;
00049         // its notification handler
00050
00051         // default constructor just zeroes everything
00052         Node()
00053         : observer(NULL), handler(NULL)
00054         {}
00055
00056         // full-blown construction
00057         Node(CObject* o, FNOBSERVER h)
00058         : observer(o), handler(h)
00059         {}
00060
00061         Node(const Node & n)
00062         {
00063             observer = n.observer;
00064             handler = n.handler;
00065         }
00066
00067         Node & operator=(const Node & n)
00068         {
00069             observer = n.observer;
00070             handler = n.handler;
00071             return *this;
00072         }
00073
00074     };
00075
00076 // Attributes
00077 private:
00078     std::vector<Node> m_nodes;
00079
00080 // Construction
00081 public:
00082     NotificationManager()   {}
00083
00084 // Operations
00085 public:
00086     // register an observer
00087     void CheckIn(CObject* observer, FNOBSERVER handler)
00088     {
00089         m_nodes.push_back(Node(observer, handler));
00090     }
00091
00092     // unregister an observer
00093     void CheckOut(CObject* observer)
00094     {
00095         for (std::vector<Node>::iterator i = m_nodes.begin(); i != m_nodes.end(); i++)
00096         {
00097             if ((*i).observer == observer)
00098             {
00099                 m_nodes.erase(i);
00100                 break;
00101             }
00102         }
00103     }
00104
00105     // fire up a notification once done with changes in observable
00106     void NotifyAll()
00107     {
00108         for (std::vector<Node>::iterator i = m_nodes.begin(); i != m_nodes.end(); i++)
00109         {
00110             // make a local copy so that observers can freely unregister during the process
00111             Node & node = *i;
00112             node.handler(node.observer);
00113         }
00114     }
00115
00116 };
00117
00118 // interface to filtering entries
00119 class KiFilterModel
00120 {
00121 // Interfaces
00122 public:
00123     // checks to see if an item satisfies current filtering criteria
00124     virtual bool IsMatch(EntnodeData* data) = 0;
00125
00126     // retrieves notification manager for observing changes in the
00127     virtual NotificationManager* GetNotificationManager() = 0;
00128 };
00129
00130 // interface to recursive display of entries
00131 class KiRecursionModel
00132 {
00133 // Interfaces
00134 public:
00135     // returns true if displaying files recursively
00136     virtual bool IsShowRecursive() = 0;
00137
00138     // retrieves notification manager for observing changes in the
00139     virtual NotificationManager* GetNotificationManager() = 0;
00140 };
00141
00142 // interface to recursive display of entries
00143 class KiIgnoreModel
00144 {
00145 // Interfaces
00146 public:
00147     // returns true if displaying ignored files
00148     virtual bool IsShowIgnored() = 0;
00149
00150     // retrieves notification manager for observing changes in the
00151     virtual NotificationManager* GetNotificationManager() = 0;
00152 };
00153
00154 // interface to filtering entries
00155 class KoFilterModel : public KiFilterModel
00156 {
00157 // Attributes
00158 protected:
00159     NotificationManager m_manager; // manager for filter change notifications
00160     UStr m_mask;             // current file mask
00161     std::vector<UStr> m_match;  // itemized array of file masks to display as found
00162     bool m_isChanged;       // flag to tell if only changed files are to be displayed
00163     bool m_isAdded;         // flag to tell if only added files are to be displayed
00164     bool m_isRemoved;       // flag to tell if only removed files are to be displayed
00165     bool m_isConflicts;     // flag to tell if conflicting files shall be displayed
00166
00167     bool m_isUnknown;       // flag to tell if unknown files have to be shown
00168     bool m_isHideUnknown;   // flag to tell if unknown files have to be hidden, mutually
00169                             // exclusive with above
00170     bool m_isMissing;       // flag to tell if missing files have to be shown
00171
00172 // Construction
00173 public:
00174     KoFilterModel();
00175     ~KoFilterModel();
00176
00177 // Interfaces
00178 public:
00179     // checks to see if an item satisfies current filtering criteria
00180     virtual bool IsMatch(EntnodeData* data);
00181
00182     // retrieves notification manager for observing changes in the
00183     virtual NotificationManager* GetNotificationManager();
00184
00185 // Operations
00186 public:
00187     // tells if the filter is in default mode - fo show flags are set
00188     bool IsDefaultMode() const;
00189
00190     // toggles modified flag
00191     void ToggleModified();
00192
00193     //accessor for modified flag
00194     bool IsModified() const;
00195
00196     // sets new file mask, returns true if changed
00197     bool SetMask(const char *mask);
00198
00199     // toggles show conflict flag
00200     void ToggleConflict()
00201     {
00202         m_isConflicts = !m_isConflicts;
00203     }
00204
00205     //accessor for show conflict flag
00206     bool IsConflict() const
00207     {
00208         return m_isConflicts;
00209     }
00210
00211     // toggles show conflict flag
00212     void ToggleUnknown();
00213
00214     //accessor for show unknown flag
00215     bool IsUnknown() const
00216     {
00217         return m_isUnknown;
00218     }
00219
00220     // toggles hide unknown flag
00221     void ToggleHideUnknown();
00222
00223     //accessor for hide unknown flag
00224     bool IsHideUnknown() const
00225     {
00226         return m_isHideUnknown;
00227     }
00228
00229
00230     // toggles show conflict flag
00231     void ToggleMissing()
00232     {
00233         m_isMissing = !m_isMissing;
00234     }
00235
00236     //accessor for show unknown flag
00237     bool IsMissing() const
00238     {
00239         return m_isMissing;
00240     }
00241
00242     void ToggleChanged()
00243     {
00244         m_isChanged = !m_isChanged;
00245     }
00246
00247     bool IsChanged() const
00248     {
00249         return m_isChanged;
00250     }
00251
00252     void ToggleAdded()
00253     {
00254         m_isAdded = !m_isAdded;
00255     }
00256
00257     bool IsAdded() const
00258     {
00259         return m_isAdded;
00260     }
00261
00262     void ToggleRemoved()
00263     {
00264         m_isRemoved = !m_isRemoved;
00265     }
00266
00267     bool IsRemoved() const
00268     {
00269         return m_isRemoved;
00270     }
00271 };
00272
00273 // interface to recursive display of entries
00274 class KoRecursionModel : public KiRecursionModel
00275 {
00276     NotificationManager m_manager;
00277     // manager for change notifications
00278
00279     bool m_isRecursive;
00280     // flag to tell if files in subfolders shall be iterated
00281 // Construction
00282 public:
00283     KoRecursionModel();
00284     ~KoRecursionModel();
00285
00286 // Interfaces
00287 public:
00288     // returns true if displaying files recursively
00289     virtual bool IsShowRecursive();
00290
00291     // retrieves notification manager for observing changes in the
00292     virtual NotificationManager* GetNotificationManager();
00293
00294     // toggle recursion switch
00295     void ToggleRecursion();
00296
00297 };
00298
00299 // interface to r\ecursive display of entries
00300 class KoIgnoreModel : public KiIgnoreModel
00301 {
00302     NotificationManager m_manager;
00303     // manager for change notifications
00304
00305     bool m_isIgnore;
00306     // flag to tell if ignored files are displayed
00307
00308 // Construction
00309 public:
00310     KoIgnoreModel();
00311     ~KoIgnoreModel();
00312
00313 // Interfaces
00314 public:
00315     // returns true if displaying ignored files
00316     virtual bool IsShowIgnored();
00317
00318     // retrieves notification manager for observing changes in the
00319     virtual NotificationManager* GetNotificationManager();
00320
00321     // toggle recursion switch
00322     void ToggleIgnore();
00323 };
00324 #endif
00325 // __MODEL__H__
00326
Generated on Sun Feb 24 01:21:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CheckoutDlg.cpp Source File

common/CheckoutDlg.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00019  */
00020
00021 /*
00022  * CheckoutDlg.h : the cvs checkout dialog
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef WIN32
00028 #   include "wincvs.h"
00029 #   include <sys\stat.h>
00030 #   include <direct.h>
00031 #   include <errno.h>
00032 #endif /* WIN32 */
00033
00034 #if qUnix
00035 #   include "UCvsDialogs.h"
00036 #endif
00037
00038 #ifdef qMacCvsPP
00039 #   include <UModalDialogs.h>
00040 #   include <LMultiPanelView.h>
00041 #   include <LPopupGroupBox.h>
00042 #   include <LCheckBox.h>
00043 #   include <LTextEditView.h>
00044 #   include <LEditText.h>
00045 #   include <LPushButton.h>
00046 #   include "LPopupFiller.h"
00047
00048 #   include "MacCvsConstant.h"
00049 #endif /* qMacCvsPP */
00050
00051 #include "CheckoutDlg.h"
00052 #include "CvsPrefs.h"
00053 #include "UpdateDlg.h"
00054 #include "MultiString.h"
00055 #include "PromptFiles.h"
00056
00057 CMString gOldModules(10, "P_OldModules");
00058
00059 #ifdef WIN32
00060 #   include "GetPrefs.h"
00061 #   ifdef _DEBUG
00062 #   define new DEBUG_NEW
00063 #   undef THIS_FILE
00064     static char THIS_FILE[] = __FILE__;
00065 #   endif
00066
00067 IMPLEMENT_DYNCREATE(CCheckout_MAIN, CPropertyPage)
00068
00069 CCheckout_MAIN::CCheckout_MAIN(const char * modname, const char * path) :
00070     CPropertyPage(CCheckout_MAIN::IDD)
00071 {
00072     //{{AFX_DATA_INIT(CCheckout_MAIN)
00073     m_noRecurse = FALSE;
00074     m_stdout = FALSE;
00075     m_overrideCheckoutDir = FALSE;
00076     m_checkoutDir = _T("");
00077     //}}AFX_DATA_INIT
00078
00079     m_moduleName = modname;
00080     m_path = path;
00081     if( m_path.IsEmpty() )
00082     {
00083         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00084         if( 0L != app )
00085             m_path = app->GetRoot();
00086     }
00087
00088     m_moduleCombo.SetItems(&gOldModules);
00089 }
00090
00091 CCheckout_MAIN::CCheckout_MAIN() : CPropertyPage(CCheckout_MAIN::IDD)
00092 {
00093 }
00094
00095 CCheckout_MAIN::~CCheckout_MAIN()
00096 {
00097 }
00098
00099 void CCheckout_MAIN::DoDataExchange(CDataExchange* pDX)
00100 {
00101     CPropertyPage::DoDataExchange(pDX);
00102
00103     //{{AFX_DATA_MAP(CCheckout_MAIN)
00104     DDX_Control(pDX, IDC_PATH, m_editPath);
00105     DDX_Control(pDX, IDC_MODNAME, m_moduleCombo);
00106     DDX_Text(pDX, IDC_MODNAME, m_moduleName);
00107     DDX_Text(pDX, IDC_PATH, m_path);
00108     DDX_Check(pDX, IDC_NORECURS, m_noRecurse);
00109     DDX_Check(pDX, IDC_STDOUT, m_stdout);
00110     DDX_Check(pDX, IDC_CHECK_OVERRIDECHECKOUTDIR, m_overrideCheckoutDir);
00111     DDX_Text(pDX, IDC_EDIT_CHECKOUTDIR, m_checkoutDir);
00112     //}}AFX_DATA_MAP
00113
00114     DDV_MinChars(pDX, m_moduleName, 1);
00115     DDX_ComboMString(pDX, IDC_MODNAME, m_moduleCombo);
00116     DDV_CheckPathExists(pDX, IDC_PATH, m_path);
00117
00118     if( !pDX->m_bSaveAndValidate )
00119     {
00120         //see if we are overriding the checkout directory
00121         OnCheckOverridecheckoutdir();
00122     }
00123 }
00124
00125
00126 BEGIN_MESSAGE_MAP(CCheckout_MAIN, CPropertyPage)
00127     //{{AFX_MSG_MAP(CCheckout_MAIN)
00128     ON_BN_CLICKED(IDC_BTNPATH, OnBtnPath)
00129     ON_BN_CLICKED(IDC_CHECK_OVERRIDECHECKOUTDIR, OnCheckOverridecheckoutdir)
00130     //}}AFX_MSG_MAP
00131 END_MESSAGE_MAP()
00132
00134 // CCheckout_MAIN message handlers
00135
00136 void CCheckout_MAIN::OnBtnPath()
00137 {
00138     // copy controls to member variables, then update those and finally refresh controls
00139     TCHAR path[_MAX_PATH];
00140     m_editPath.GetWindowText(path, _MAX_PATH);
00141     BOOL selected = BrowserGetDirectory("Select a directory to checkout :", path, MAX_PATH, IsWindow(this->m_hWnd) ? this : NULL );
00142     if (selected)
00143     {
00144         m_path = path;
00145         m_editPath.SetWindowText(path);
00146     }
00147 }
00148
00149 void CCheckout_MAIN::OnCheckOverridecheckoutdir()
00150 {
00151     CButton* but = (CButton *)GetDlgItem(IDC_CHECK_OVERRIDECHECKOUTDIR);
00152     CWnd* wnd = GetDlgItem(IDC_EDIT_CHECKOUTDIR);
00153     BOOL enableCheckoutDir = but->GetCheck() == 1;
00154
00155     wnd->EnableWindow(enableCheckoutDir);
00156     if( enableCheckoutDir )
00157     {
00158         CString strCheckoutDir;
00159         wnd->GetWindowText(strCheckoutDir);
00160         if( strCheckoutDir.IsEmpty() )
00161         {
00162             CString strModuleName;
00163             if( GetDlgItemText(IDC_MODNAME, strModuleName) )
00164             {
00165                 wnd->SetWindowText(strModuleName);
00166                 GotoDlgCtrl(wnd);
00167             }
00168         }
00169     }
00170 }
00171
00172 IMPLEMENT_DYNCREATE(CCheckout_OPTIONS, CPropertyPage)
00173
00174 CCheckout_OPTIONS::CCheckout_OPTIONS(const char *rev, const char *date) : CPropertyPage(CCheckout_OPTIONS::IDD)
00175 {
00176     //{{AFX_DATA_INIT(CCheckout_OPTIONS)
00177     m_date = date;
00178     m_rev = rev;
00179     m_hasDate = FALSE;
00180     m_match = FALSE;
00181     m_hasRev = FALSE;
00182     m_export = FALSE;
00183     m_forceRoot = FALSE;
00184     //}}AFX_DATA_INIT
00185
00186     m_revCombo.SetItems(&gRevNames);
00187     m_dateCombo.SetItems(&gDateNames);
00188 }
00189
00190 CCheckout_OPTIONS::CCheckout_OPTIONS() : CPropertyPage(CCheckout_OPTIONS::IDD)
00191 {
00192 }
00193
00194 CCheckout_OPTIONS::~CCheckout_OPTIONS()
00195 {
00196 }
00197
00198 void CCheckout_OPTIONS::DoDataExchange(CDataExchange* pDX)
00199 {
00200     CPropertyPage::DoDataExchange(pDX);
00201     //{{AFX_DATA_MAP(CCheckout_OPTIONS)
00202     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00203     DDX_Control(pDX, IDC_COMBODATE, m_dateCombo);
00204     DDX_CBString(pDX, IDC_COMBODATE, m_date);
00205     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00206     DDX_Check(pDX, IDC_DATE, m_hasDate);
00207     DDX_Check(pDX, IDC_MATCH, m_match);
00208     DDX_Check(pDX, IDC_REV, m_hasRev);
00209     DDX_Check(pDX, IDC_EXPORT, m_export);
00210     DDX_Check(pDX, IDC_FORCEROOT, m_forceRoot);
00211     //}}AFX_DATA_MAP
00212
00213     if( m_hasRev )
00214     {
00215         DDV_MinChars(pDX, m_rev, 1);
00216     }
00217
00218     if( m_hasDate )
00219     {
00220         DDV_MinChars(pDX, m_date, 1);
00221     }
00222
00223     if( !pDX->m_bSaveAndValidate )
00224     {
00225         OnDate();
00226         OnRev();
00227     }
00228
00229     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00230     DDX_ComboMString(pDX, IDC_COMBODATE, m_dateCombo);
00231 }
00232
00233
00234 BEGIN_MESSAGE_MAP(CCheckout_OPTIONS, CPropertyPage)
00235     //{{AFX_MSG_MAP(CCheckout_OPTIONS)
00236     ON_BN_CLICKED(IDC_DATE, OnDate)
00237     ON_BN_CLICKED(IDC_REV, OnRev)
00238     //}}AFX_MSG_MAP
00239 END_MESSAGE_MAP()
00240
00242 // CCheckout_OPTIONS message handlers
00243
00244 void CCheckout_OPTIONS::OnDate()
00245 {
00246     CButton* but = (CButton *)GetDlgItem(IDC_DATE);
00247     CWnd* wnd = GetDlgItem(IDC_COMBODATE);
00248     wnd->EnableWindow(but->GetCheck() == 1);
00249 }
00250
00251 void CCheckout_OPTIONS::OnRev()
00252 {
00253     CButton* but = (CButton *)GetDlgItem(IDC_REV);
00254     CWnd* wnd = GetDlgItem(IDC_COMBOREV);
00255     wnd->EnableWindow(but->GetCheck() == 1);
00256 }
00257
00258 #endif /* WIN32 */
00259
00260 #ifdef qMacCvsPP
00261 static void DoDataExchange_CheckoutMain(LWindow *theDialog, CPStr & modname,
00262     bool & norecurs, bool & toStdout, bool & overrideCheckoutDir, CPStr & checkoutDir, bool putValue)
00263 {
00264     LEditText *mname = dynamic_cast<LEditText*>
00265         (theDialog->FindPaneByID(item_ModuleName));
00266     LPopupFiller *filler = dynamic_cast<LPopupFiller*>
00267         (theDialog->FindPaneByID(item_PopModName));
00268
00269     filler->DoDataExchange(gOldModules, putValue);
00270
00271     DoDataExchange (theDialog, item_NoRecurs, norecurs, putValue);
00272     DoDataExchange (theDialog, item_ToStout, toStdout, putValue);
00273     DoDataExchange (theDialog, item_CheckGroupPath, overrideCheckoutDir, putValue);
00274     DoDataExchange (theDialog, item_EditPath, checkoutDir, putValue);
00275
00276     if(putValue)
00277     {
00278         mname->SetText((Ptr)(const char *)modname, modname.length());
00279         theDialog->SetLatentSub(mname);
00280
00281         // this will take care about an empty module name
00282         mname->AddListener(GetDlgHandler());
00283         if(modname.length() == 0)
00284         {
00285             LPushButton *theOK = dynamic_cast<LPushButton*>
00286                                         (theDialog->FindPaneByID(item_OK));
00287             Assert_(theOK != 0L);
00288             theOK->Disable();
00289         }
00290     }
00291     else
00292     {
00293         char buf[512];
00294         Size len;
00295         mname->GetText(buf, 511, &len);
00296         modname.set(buf, len);
00297         }
00298 }
00299
00300
00301
00302 static void
00303 DoDataExchange_CheckoutOptions(
00304
00305     LView *theDialog,
00306     bool & hasDate,
00307     bool & hasRev,
00308     CPStr & sLastDate,
00309     CPStr & sLastRev,
00310     bool & useMostRecent,
00311     bool & doexport,
00312     bool & forceCvsroot,
00313     bool putValue)
00314
00315 {
00316     LPopupFiller *fillTag = dynamic_cast<LPopupFiller*>
00317         (theDialog->FindPaneByID(item_FillerTag));
00318     LPopupFiller *fillDate = dynamic_cast<LPopupFiller*>
00319         (theDialog->FindPaneByID(item_FillerDate));
00320
00321     fillTag->DoDataExchange(gRevNames, putValue);
00322     fillDate->DoDataExchange(gDateNames, putValue);
00323
00324     DoDataExchange (theDialog, item_CheckDate, hasDate, putValue);
00325     DoDataExchange (theDialog, item_CheckRevTag, hasRev, putValue);
00326     DoDataExchange (theDialog, item_EditDate, sLastDate, putValue);
00327     DoDataExchange (theDialog, item_EditRevTag, sLastRev, putValue);
00328     DoDataExchange (theDialog, item_MostRecentRev, useMostRecent, putValue);
00329     DoDataExchange (theDialog, item_CheckForceRoot, forceCvsroot, putValue);
00330     DoDataExchange (theDialog, item_CheckExport, doexport, putValue);
00331
00332 }
00333 #endif /* qMacCvsPP */
00334
00335 #if qUnix
00336 class UCvsCheckout : public UWidget
00337 {
00338     UDECLARE_DYNAMIC(UCvsCheckout)
00339 public:
00340     UCvsCheckout() : UWidget(::UEventGetWidID()) {}
00341     virtual ~UCvsCheckout() {}
00342
00343     enum
00344     {
00345         kOK = EV_COMMAND_START, // 0
00346         kCancel,                // 1
00347         kTabGeneral             // 2
00348     };
00349
00350     virtual void DoDataExchange(bool fill);
00351
00352 protected:
00353     ev_msg int OnOK(void);
00354     ev_msg int OnCancel(void);
00355
00356     UDECLARE_MESSAGE_MAP()
00357 };
00358
00359 UIMPLEMENT_DYNAMIC(UCvsCheckout, UWidget)
00360
00361 UBEGIN_MESSAGE_MAP(UCvsCheckout, UWidget)
00362     ON_UCOMMAND(UCvsCheckout::kOK, UCvsCheckout::OnOK)
00363     ON_UCOMMAND(UCvsCheckout::kCancel, UCvsCheckout::OnCancel)
00364 UEND_MESSAGE_MAP()
00365
00366 int UCvsCheckout::OnOK(void)
00367 {
00368     EndModal(true);
00369     return 0;
00370 }
00371
00372 int UCvsCheckout::OnCancel(void)
00373 {
00374     EndModal(false);
00375     return 0;
00376 }
00377
00378 void UCvsCheckout::DoDataExchange(bool fill)
00379 {
00380     if(fill)
00381     {
00382     }
00383     else
00384     {
00385     }
00386 }
00387
00388 class UCvsCheckout_MAIN : public UWidget
00389 {
00390     UDECLARE_DYNAMIC(UCvsCheckout_MAIN)
00391 public:
00392     UCvsCheckout_MAIN(const char * modname, const char * path);
00393     virtual ~UCvsCheckout_MAIN() {}
00394
00395     enum
00396     {
00397         kComboPath = EV_COMMAND_START,  // 0
00398         kStaticPath,            // 1
00399         kBtnPath,               // 2
00400         kCheckStdout,           // 3
00401         kCheckRecurse           // 4
00402     };
00403
00404     virtual void DoDataExchange(bool fill);
00405
00406     UStr m_path;
00407     UStr m_modname;
00408     bool m_norecurs;
00409     bool m_stdout;
00410
00411 protected:
00412     ev_msg int OnPath(void);
00413
00414     UDECLARE_MESSAGE_MAP()
00415 };
00416
00417 UIMPLEMENT_DYNAMIC(UCvsCheckout_MAIN, UWidget)
00418
00419 UBEGIN_MESSAGE_MAP(UCvsCheckout_MAIN, UWidget)
00420     ON_UCOMMAND(UCvsCheckout_MAIN::kBtnPath, UCvsCheckout_MAIN::OnPath)
00421 UEND_MESSAGE_MAP()
00422
00423 UCvsCheckout_MAIN::UCvsCheckout_MAIN(const char * modname, const char * path) : UWidget(::UEventGetWidID())
00424 {
00425     m_path = path;
00426     m_modname = modname;
00427     m_norecurs = false;
00428     m_stdout = false;
00429 }
00430
00431 int UCvsCheckout_MAIN::OnPath(void)
00432 {
00433     const char *dir = BrowserGetDirectory("Select a directory to checkout to :");
00434     if(dir != 0L)
00435         UEventSendMessage(GetWidID(), EV_SETTEXT, kStaticPath, (void *)dir);
00436
00437     return 0;
00438 }
00439
00440 void UCvsCheckout_MAIN::DoDataExchange(bool fill)
00441 {
00442     ::DoDataExchange(fill, GetWidID(), kComboPath, gOldModules);
00443
00444     if(fill)
00445     {
00446         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckStdout, m_stdout), 0L);
00447         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurse, m_norecurs), 0L);
00448
00449         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboPath, (void *)(const char *)m_modname);
00450         UEventSendMessage(GetWidID(), EV_SETTEXT, kStaticPath, (void *)(const char *)m_path);
00451     }
00452     else
00453     {
00454         m_stdout = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckStdout, 0L) != 0;
00455         m_norecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurse, 0L) != 0;
00456
00457         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboPath, &m_modname);
00458         UEventSendMessage(GetWidID(), EV_GETTEXT, kStaticPath, &m_path);
00459     }
00460 }
00461
00462 class UCvsCheckout_STICKY : public UWidget
00463 {
00464     UDECLARE_DYNAMIC(UCvsCheckout_STICKY)
00465 public:
00466     UCvsCheckout_STICKY(const char *rev, const char *date);
00467     virtual ~UCvsCheckout_STICKY() {}
00468
00469     enum
00470     {
00471         kCheckDate = EV_COMMAND_START,  // 0
00472         kComboDate,         // 1
00473         kCheckRev,          // 2
00474         kComboRev,          // 3
00475         kCheckMatch         // 4
00476     };
00477
00478     virtual void DoDataExchange(bool fill);
00479
00480     UStr m_date;
00481     UStr m_rev;
00482     bool m_hasdate;
00483     bool m_hasrev;
00484     bool m_match;
00485 protected:
00486
00487     ev_msg int OnDate(void);
00488     ev_msg int OnRev(void);
00489
00490     UDECLARE_MESSAGE_MAP()
00491 };
00492
00493 UIMPLEMENT_DYNAMIC(UCvsCheckout_STICKY, UWidget)
00494
00495 UBEGIN_MESSAGE_MAP(UCvsCheckout_STICKY, UWidget)
00496     ON_UCOMMAND(UCvsCheckout_STICKY::kCheckDate, UCvsCheckout_STICKY::OnDate)
00497     ON_UCOMMAND(UCvsCheckout_STICKY::kCheckRev, UCvsCheckout_STICKY::OnRev)
00498 UEND_MESSAGE_MAP()
00499
00500 UCvsCheckout_STICKY::UCvsCheckout_STICKY(const char *rev, const char *date) : UWidget(::UEventGetWidID())
00501 {
00502     m_date = date;
00503     m_rev = rev;
00504     m_hasdate = false;
00505     m_hasrev = false;
00506     m_match = false;
00507 }
00508
00509 int UCvsCheckout_STICKY::OnDate()
00510 {
00511     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDate, 0L);
00512     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboDate, state), 0L);
00513     return 0;
00514 }
00515
00516 int UCvsCheckout_STICKY::OnRev()
00517 {
00518     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRev, 0L);
00519     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev, state), 0L);
00520     return 0;
00521 }
00522
00523 void UCvsCheckout_STICKY::DoDataExchange(bool fill)
00524 {
00525     ::DoDataExchange(fill, GetWidID(), kComboRev, gRevNames);
00526     ::DoDataExchange(fill, GetWidID(), kComboDate, gDateNames);
00527
00528     if(fill)
00529     {
00530         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckDate, m_hasdate), 0L);
00531         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRev, m_hasrev), 0L);
00532         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckMatch, m_match), 0L);
00533
00534         OnDate();
00535         OnRev();
00536     }
00537     else
00538     {
00539         m_hasdate = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDate, 0L);
00540         m_hasrev = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRev, 0L);
00541         m_match = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckMatch, 0L);
00542
00543         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboDate, &m_date);
00544         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboRev, &m_rev);
00545     }
00546 }
00547
00548 class UCvsCheckout_OPTIONS : public UWidget
00549 {
00550     UDECLARE_DYNAMIC(UCvsCheckout_OPTIONS)
00551 public:
00552     UCvsCheckout_OPTIONS();
00553     virtual ~UCvsCheckout_OPTIONS() {}
00554
00555     enum
00556     {
00557         kCheckForce = EV_COMMAND_START, // 0
00558         kCheckExport        // 1
00559     };
00560
00561     virtual void DoDataExchange(bool fill);
00562
00563     bool m_export;
00564     bool m_forceroot;
00565 protected:
00566
00567     UDECLARE_MESSAGE_MAP()
00568 };
00569
00570 UIMPLEMENT_DYNAMIC(UCvsCheckout_OPTIONS, UWidget)
00571
00572 UBEGIN_MESSAGE_MAP(UCvsCheckout_OPTIONS, UWidget)
00573 UEND_MESSAGE_MAP()
00574
00575 UCvsCheckout_OPTIONS::UCvsCheckout_OPTIONS() : UWidget(::UEventGetWidID())
00576 {
00577     m_export = false;
00578     m_forceroot = false;
00579 }
00580
00581 void UCvsCheckout_OPTIONS::DoDataExchange(bool fill)
00582 {
00583     if(fill)
00584     {
00585         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckForce, m_forceroot), 0L);
00586         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckExport, m_export), 0L);
00587     }
00588     else
00589     {
00590         m_forceroot = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckForce, 0L);
00591         m_export = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckExport, 0L);
00592     }
00593 }
00594 #endif // qUnix
00595
00596 bool CompatGetCheckout(CPStr & modname, CPStr & path, bool & norecurs,
00597                        bool & toStdout, CPStr & date, CPStr & rev,
00598                        bool & useMostRecent,
00599                        CPStr & rev1, CPStr & rev2,
00600                        bool & doexport, bool & forceCvsroot,
00601                        bool & overrideCheckoutDir, CPStr & checkoutDir)
00602 {
00603     bool userHitOK = false;
00604
00605     date = "";
00606     rev = "";
00607     modname = "";
00608     norecurs = false;
00609     toStdout = false;
00610     useMostRecent = false;
00611     doexport = false;
00612     forceCvsroot = false;
00613     overrideCheckoutDir = false;
00614
00615     static CPStr sLastModName;
00616     static CPStr sLastRev;
00617     static CPStr sLastDate;
00618     static CPStr sLastRev1;
00619     static CPStr sLastRev2;
00620     static CPStr sLastDate1;
00621     static CPStr sLastDate2;
00622
00623     bool hasDate = false;
00624     bool hasRev = false;
00625     bool merge1 = false;
00626     bool merge2 = false;
00627     bool hasDate1 = false;
00628     bool hasDate2 = false;
00629
00630 #ifdef WIN32
00631     CPropertySheet pages("Checkout settings");
00632     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00633     CCheckout_MAIN page1(sLastModName, path);
00634     CCheckout_OPTIONS page2(sLastRev, sLastDate);
00635     CUpdateMerge page3(true, sLastRev1, sLastRev2, sLastDate1, sLastDate2);
00636     CGetPrefs_CVSROOT page4;
00637     CGetPrefs_GLOBALS page5;
00638     pages.AddPage(&page1);
00639     pages.AddPage(&page2);
00640     pages.AddPage(&page3);
00641     pages.AddPage(&page4);
00642     pages.AddPage(&page5);
00643     if(pages.DoModal() == IDOK)
00644     {
00645         sLastModName = (const char *)page1.m_moduleName;
00646         path = (const char *)page1.m_path;
00647         norecurs = page1.m_noRecurse == TRUE;
00648         toStdout = page1.m_stdout == TRUE;
00649         overrideCheckoutDir = page1.m_overrideCheckoutDir == TRUE;
00650         checkoutDir = (const char *)page1.m_checkoutDir;
00651
00652         sLastDate = page2.m_date;
00653         sLastRev = page2.m_rev;
00654         hasDate = page2.m_hasDate == TRUE;
00655         hasRev = page2.m_hasRev == TRUE;
00656         useMostRecent = page2.m_match == TRUE;
00657         doexport = page2.m_export == TRUE;
00658         forceCvsroot = page2.m_forceRoot == TRUE;
00659
00660         merge1 = page3.m_merge >= 1;
00661         merge2 = page3.m_merge == 2;
00662         sLastRev1 = page3.m_rev1;
00663         sLastRev2 = page3.m_rev2;
00664         hasDate1 = page3.m_hasDate1 == TRUE;
00665         hasDate2 = page3.m_hasDate2 == TRUE;
00666         sLastDate1 = page3.m_date1;
00667         sLastDate2 = page3.m_date2;
00668
00669         page4.StoreValues();
00670         page5.StoreValues();
00671         userHitOK = true;
00672     }
00673 #endif /* WIN32 */
00674 #ifdef qMacCvsPP
00675     StDialogHandler theHandler(dlg_Checkout, LCommander::GetTopCommander());
00676     LWindow *theDialog = theHandler.GetDialog();
00677     ThrowIfNil_(theDialog);
00678     static UInt16 sRuntimePanel = 1;
00679
00680     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00681         (theDialog->FindPaneByID(item_MultiViewPrefs));
00682     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00683
00684     multiView->SwitchToPanel(3);
00685     DoDataExchange_Globals(theDialog, true);
00686     multiView->SwitchToPanel(2);
00687     DoDataExchange_CheckoutOptions(theDialog, hasDate, hasRev,
00688         sLastDate, sLastRev, useMostRecent, doexport, forceCvsroot, true);
00689     multiView->SwitchToPanel(1);
00690     DoDataExchange_CheckoutMain(theDialog, sLastModName, norecurs, toStdout, overrideCheckoutDir, checkoutDir, true);
00691     dynamic_cast<LBroadcaster*> (theDialog->FindPaneByID (item_EditPath))->AddListener (&theHandler);
00692     dynamic_cast<LBroadcaster*> (theDialog->FindPaneByID (item_CheckGroupPath))->AddListener (&theHandler);
00693
00694
00695     groupView->SetValue(sRuntimePanel);
00696     theDialog->Show();
00697     MessageT hitMessage;
00698     while (true)
00699     {       // Let DialogHandler process events
00700         hitMessage = theHandler.DoDialog();
00701
00702         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00703             break;
00704
00705         if(hitMessage == item_CheckGroupPath || hitMessage == item_EditPath)
00706         {
00707             if(theDialog->GetValueForPaneID(item_CheckGroupPath) == Button_Off)
00708             {
00709                 continue;
00710             }
00711
00712             const char* dir = BrowserGetDirectory("Select the checkout directory :");
00713             if(dir != 0L)
00714             {
00715                 CPStr tmp(dir);
00716                 theDialog->SetDescriptorForPaneID(item_EditPath, tmp);
00717             }
00718             else if(hitMessage == item_CheckGroupPath)
00719             {
00720                 theDialog->SetValueForPaneID(item_CheckGroupPath, Button_Off);
00721             }
00722         }
00723     }
00724     theDialog->Hide();
00725     sRuntimePanel = groupView->GetValue();
00726
00727     if(hitMessage == msg_OK)
00728     {
00729         multiView->SwitchToPanel(1);
00730         DoDataExchange_CheckoutMain(theDialog, sLastModName, norecurs, toStdout, overrideCheckoutDir, checkoutDir, false);
00731         multiView->SwitchToPanel(2);
00732         DoDataExchange_CheckoutOptions(theDialog, hasDate, hasRev,
00733             sLastDate, sLastRev, useMostRecent, doexport, forceCvsroot, false);
00734         multiView->SwitchToPanel(3);
00735         DoDataExchange_Globals(theDialog, false);
00736
00737         Assert_(sLastModName.length() != 0);
00738
00739         userHitOK = true;
00740     }
00741 #endif /* qMacCvsPP */
00742 #if qUnix
00743     void *wid = UCreate_CheckoutDlg();
00744
00745     UCvsCheckout *dlg = new UCvsCheckout();
00746     UCvsCheckout_MAIN *tab1 = new UCvsCheckout_MAIN(sLastModName, path);
00747     UCvsCheckout_STICKY *tab2 = new UCvsCheckout_STICKY(sLastRev, sLastDate);
00748     UCvsCheckout_OPTIONS *tab3 = new UCvsCheckout_OPTIONS();
00749     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00750     dlg->AddPage(tab1, UCvsCheckout::kTabGeneral, 0);
00751     dlg->AddPage(tab2, UCvsCheckout::kTabGeneral, 1);
00752     dlg->AddPage(tab3, UCvsCheckout::kTabGeneral, 2);
00753
00754     if(dlg->DoModal())
00755     {
00756         sLastModName = tab1->m_modname;
00757         path = tab1->m_path;
00758         norecurs = tab1->m_norecurs;
00759         toStdout = tab1->m_stdout;
00760
00761         sLastDate = tab2->m_date;
00762         sLastRev = tab2->m_rev;
00763         hasDate = tab2->m_hasdate;
00764         hasRev = tab2->m_hasrev;
00765         useMostRecent = tab2->m_match;
00766
00767         doexport = tab3->m_export;
00768         forceCvsroot = tab3->m_forceroot;
00769
00770         userHitOK = true;
00771     }
00772
00773     delete dlg;
00774 #endif // qUnix
00775
00776     if(userHitOK)
00777     {
00778         if(hasDate && !sLastDate.empty())
00779             date = sLastDate;
00780
00781         if(hasRev && !sLastRev.empty())
00782             rev = sLastRev;
00783
00784         modname = sLastModName;
00785
00786         if(merge1 && merge2 && !sLastRev1.empty() && !sLastRev2.empty())
00787         {
00788             rev1 = sLastRev1;
00789             rev2 = sLastRev2;
00790
00791             if( hasDate1 )
00792                 rev1 << ":" << sLastDate1;
00793
00794             if( hasDate2 )
00795                 rev2 << ":" << sLastDate2;
00796
00797         }
00798
00799         if(merge1 && !merge2 && !sLastRev1.empty())
00800         {
00801             rev1 = sLastRev1;
00802
00803             if( hasDate1 )
00804                 rev1 << ":" << sLastDate1;
00805         }
00806
00807         gCvsPrefs.save();
00808     }
00809
00810     return userHitOK;
00811 }
00812
00813
Generated on Sun Feb 24 01:21:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CheckoutDlg.h Source File

common/CheckoutDlg.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00019  */
00020
00021 /*
00022  * CheckoutDlg.cpp : the cvs checkout dialog
00023  */
00024
00025 #if !defined(AFX_CHECKOUTDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
00026 #define AFX_CHECKOUTDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif // _MSC_VER >= 1000
00031
00032 #include "CPStr.h"
00033 #include "MultiString.h"
00034 #include "SmartComboBox.h"
00035
00036 bool CompatGetCheckout(CPStr & modname, CPStr & path, bool & norecurs,
00037                        bool & toStdout, CPStr & date, CPStr & rev,
00038                        bool & useMostRecent,
00039                        CPStr & rev1, CPStr & rev2,
00040                        bool & doexport, bool & forceCvsroot,
00041                        bool & overrideCheckoutDir, CPStr & checkoutDir);
00042     // get the checkout module name and misc options...
00043
00044 extern CMString gOldModules;
00045
00046 #ifdef WIN32
00047
00048 class CCheckout_MAIN : public CPropertyPage
00049 {
00050     DECLARE_DYNCREATE(CCheckout_MAIN)
00051
00052 // Construction
00053 public:
00054     CCheckout_MAIN();
00055     CCheckout_MAIN(const char * modname, const char * path);
00056     ~CCheckout_MAIN();
00057
00058 // Dialog Data
00059     //{{AFX_DATA(CCheckout_MAIN)
00060     enum { IDD = IDD_CHECKOUT_MAIN };
00061     CEdit   m_editPath;
00062     CSmartComboBox  m_moduleCombo;
00063     CString m_moduleName;
00064     CString m_path;
00065     BOOL    m_noRecurse;
00066     BOOL    m_stdout;
00067     BOOL    m_overrideCheckoutDir;
00068     CString m_checkoutDir;
00069     //}}AFX_DATA
00070
00071
00072 // Overrides
00073     // ClassWizard generate virtual function overrides
00074     //{{AFX_VIRTUAL(CCheckout_MAIN)
00075     protected:
00076     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00077     //}}AFX_VIRTUAL
00078
00079 // Implementation
00080 protected:
00081     // Generated message map functions
00082     //{{AFX_MSG(CCheckout_MAIN)
00083     afx_msg void OnBtnPath();
00084     afx_msg void OnCheckOverridecheckoutdir();
00085     //}}AFX_MSG
00086     DECLARE_MESSAGE_MAP()
00087
00088 };
00089
00090 class CCheckout_OPTIONS : public CPropertyPage
00091 {
00092     DECLARE_DYNCREATE(CCheckout_OPTIONS)
00093
00094 // Construction
00095 public:
00096     CCheckout_OPTIONS(const char *rev, const char *date);
00097     CCheckout_OPTIONS();
00098     ~CCheckout_OPTIONS();
00099
00100 // Dialog Data
00101     //{{AFX_DATA(CCheckout_OPTIONS)
00102     enum { IDD = IDD_CHECKOUT_OPTIONS };
00103     CSmartComboBox  m_revCombo;
00104     CSmartComboBox  m_dateCombo;
00105     CString m_date;
00106     CString m_rev;
00107     BOOL    m_hasDate;
00108     BOOL    m_match;
00109     BOOL    m_hasRev;
00110     BOOL    m_export;
00111     BOOL    m_forceRoot;
00112     //}}AFX_DATA
00113
00114
00115 // Overrides
00116     // ClassWizard generate virtual function overrides
00117     //{{AFX_VIRTUAL(CCheckout_OPTIONS)
00118     protected:
00119     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00120     //}}AFX_VIRTUAL
00121
00122 // Implementation
00123 protected:
00124     // Generated message map functions
00125     //{{AFX_MSG(CCheckout_OPTIONS)
00126     afx_msg void OnDate();
00127     afx_msg void OnRev();
00128     //}}AFX_MSG
00129     DECLARE_MESSAGE_MAP()
00130
00131 };
00132
00133 //{{AFX_INSERT_LOCATION}}
00134 #endif /* WIN32 */
00135
00136 #endif // !defined(AFX_CHECKOUTDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CommitDlg.cpp Source File

common/CommitDlg.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 1998
00019  */
00020
00021 /*
00022  * CommitDlg.cpp : the cvs commit dialog
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef WIN32
00028 #   include "wincvs.h"
00029 #   include <process.h>
00030 #else /* !WIN32 */
00031 #   include <ctype.h>
00032 #endif /* !WIN32 */
00033
00034 #if qUnix
00035 #   include "UCvsDialogs.h"
00036 #endif
00037
00038 #ifdef qMacCvsPP
00039 #   include <UModalDialogs.h>
00040 #   include <LMultiPanelView.h>
00041 #   include <LPopupGroupBox.h>
00042 #   include <LCheckBox.h>
00043 #   include <LTextEditView.h>
00044 #   include "LPopupFiller.h"
00045
00046 #   include "MacCvsConstant.h"
00047 #endif /* qMacCvsPP */
00048
00049 #include "CommitDlg.h"
00050 #include "CvsPrefs.h"
00051 #include "getline.h"
00052 #include "TextBinary.h"
00053 #include "MultiString.h"
00054 #include "CvsCommands.h"
00055 #include "EditorMonDlg.h"
00056
00057 static CMString gCommitLogs(10, "P_CommitLogs");
00058 static CPersistentBool gCheckValidEdits("P_CheckValidEdits", false);
00059
00060 void combozify(CStr & str)
00061 {
00062     // extract the first xxx words
00063     const char *tmp = str;
00064     CStr result;
00065     int numWords = 0;
00066 #   define HOWMUCH_WORDS 5
00067     while(*tmp != '\0' && numWords < HOWMUCH_WORDS)
00068     {
00069         while(*tmp != '\0' && isspace(*tmp))
00070             tmp++;
00071
00072         while(*tmp != '\0' && !isspace(*tmp))
00073             result << *tmp ++;
00074
00075         if(*tmp != '\0')
00076             result << ' ';
00077
00078         numWords++;
00079     }
00080
00081     if(*tmp != '\0')
00082     {
00083         result << "...";
00084     }
00085     str = result;
00086 }
00087
00088 #ifdef WIN32
00089 #   include "GetPrefs.h"
00090 #   ifdef _DEBUG
00091 #       define new DEBUG_NEW
00092 #       undef THIS_FILE
00093         static char THIS_FILE[] = __FILE__;
00094 #   endif
00095
00096 IMPLEMENT_DYNCREATE(CCommit_MAIN, CPropertyPage)
00097
00098 CCommit_MAIN::CCommit_MAIN() : CPropertyPage(CCommit_MAIN::IDD)
00099 {
00100 }
00101
00102 CCommit_MAIN::CCommit_MAIN(const char *logMsg, const char *pathTmpl, MultiFiles *mf)
00103     : m_fileToDiffCombo(USmartCombo::AutoDropWidth | USmartCombo::ReadOnly),
00104     CPropertyPage(CCommit_MAIN::IDD)
00105 {
00106     //{{AFX_DATA_INIT(CCommit_MAIN)
00107     m_logMsg = logMsg;
00108     m_wordWrap = FALSE;
00109     //}}AFX_DATA_INIT
00110
00111     m_tmplPath = pathTmpl;
00112     if(!m_tmplPath.empty())
00113     {
00114         if(!m_tmplPath.endsWith(kPathDelimiter))
00115             m_tmplPath << kPathDelimiter;
00116         m_tmplPath << "CVS";
00117         m_tmplPath << kPathDelimiter;
00118         m_tmplPath << "Template";
00119     }
00120     m_pmfarg = mf;
00121
00122     m_bSwitchingWrap = FALSE;
00123     m_wordWrap = gCvsPrefs.WordWrapLogMsg();
00124
00125     m_prevLogsCombo.SetItems(&gCommitLogs);
00126 }
00127
00128 CCommit_MAIN::~CCommit_MAIN()
00129 {
00130 }
00131
00132 void CCommit_MAIN::DoDataExchange(CDataExchange* pDX)
00133 {
00134     CPropertyPage::DoDataExchange(pDX);
00135     //{{AFX_DATA_MAP(CCommit_MAIN)
00136     DDX_Control(pDX, IDC_PREVIEWINFO, m_previewInfo);
00137     DDX_Control(pDX, IDC_FILETODIFF, m_fileToDiffCombo);
00138     DDX_Control(pDX, IDC_WORDWRAP, m_wordWrapCtrl);
00139     DDX_Control(pDX, IDC_LOGMSG_WRAP, m_logMsgCtrlWrap);
00140     DDX_Control(pDX, IDC_LOGMSG, m_logMsgCtrl);
00141     DDX_Control(pDX, IDC_COMBO, m_prevLogsCombo);
00142     DDX_Check(pDX, IDC_WORDWRAP, m_wordWrap);
00143     //}}AFX_DATA_MAP
00144
00145     if( !pDX->m_bSaveAndValidate )
00146     {
00147         DDX_Text(pDX, IDC_LOGMSG_WRAP, m_logMsg);
00148         DDX_Text(pDX, IDC_LOGMSG, m_logMsg);
00149     }
00150     else
00151     {
00152         DDX_Text(pDX, GetLogMsgID(), m_logMsg);
00153     }
00154
00155     if( pDX->m_bSaveAndValidate )
00156     {
00157         if( !m_logMsg.IsEmpty() )
00158         {
00159             gCommitLogs.Insert(m_logMsg);
00160         }
00161     }
00162     else
00163     {
00164         DDX_ComboMString(pDX, IDC_COMBO, m_prevLogsCombo);
00165     }
00166 }
00167
00168 void CCommit_MAIN::OnSelchangeCombo()
00169 {
00170     int sel = m_prevLogsCombo.GetCurSel();
00171     if( sel == CB_ERR )
00172         return;
00173
00174     CEdit* pEdit = (CEdit*)GetLogMsgWnd();
00175     pEdit->SetSel(0, -1);
00176
00177     const NAMESPACE(std) vector<CStr> & list = gCommitLogs.GetList();
00178     pEdit->ReplaceSel(list[sel]);
00179 }
00180
00181 BEGIN_MESSAGE_MAP(CCommit_MAIN, CPropertyPage)
00182     //{{AFX_MSG_MAP(CCommit_MAIN)
00183     ON_CBN_SELCHANGE(IDC_COMBO, OnSelchangeCombo)
00184     ON_BN_CLICKED(IDC_LAUNCHEDITOR, OnLauncheditor)
00185     ON_WM_ERASEBKGND()
00186     ON_BN_CLICKED(IDC_WORDWRAP, OnWordwrap)
00187     ON_BN_CLICKED(IDC_DIFF, OnDiff)
00188     ON_CBN_SELCHANGE(IDC_FILETODIFF, OnSelchangeFiletodiff)
00189     ON_BN_CLICKED(IDC_TEMPLATE, OnTemplate)
00190     //}}AFX_MSG_MAP
00191 END_MESSAGE_MAP()
00192
00193 BOOL CCommit_MAIN::PreTranslateMessage(MSG* pMsg)
00194 {
00195     if( pMsg->message >= WM_KEYFIRST ||
00196         pMsg->message <= WM_KEYLAST ||
00197         pMsg->message == WM_COPY || pMsg->message == WM_CUT || pMsg->message == WM_PASTE )
00198     {
00199         UpdateInfo();
00200     }
00201
00202     //dialog can be dismissed by Esc key
00203     if( pMsg->message == WM_KEYDOWN &&
00204         (int)pMsg->wParam == VK_ESCAPE )
00205     {
00206         EndDialog(IDCANCEL);
00207     }
00208
00209     return CPropertyPage::PreTranslateMessage(pMsg);
00210 }
00211
00212 void CCommit_MAIN::UpdateInfo()
00213 {
00214     CEdit* pEdit = (CEdit*)GetLogMsgWnd();
00215
00216     CString strOldInfo;
00217     CString strInfo;
00218     int nLineNumber = pEdit->LineFromChar();
00219     int nLineLenght = pEdit->LineLength( pEdit->LineIndex() );
00220
00221     strInfo.Format( "Line %d (%d chars)", nLineNumber + 1, nLineLenght );
00222
00223     GetDlgItemText( IDC_EDIT_POSITION, strOldInfo );
00224     if( strOldInfo != strInfo )
00225     {
00226         SetDlgItemText( IDC_EDIT_POSITION, strInfo );
00227     }
00228 }
00229
00230 void CCommit_MAIN::UpdatePreviewInfo()
00231 {
00232     CString strPreviewInfo;
00233     int nSelInfo = m_fileToDiffCombo.GetCurSel();
00234     if( nSelInfo < 0 || !m_fileToDiffCombo.GetCount() )
00235     {
00236         nSelInfo = 0;
00237     }
00238     else
00239     {
00240         nSelInfo++;
00241     }
00242
00243     strPreviewInfo.Format("Preview file changes (%d/%d):", nSelInfo, m_fileToDiffCombo.GetCount());
00244     m_previewInfo.SetWindowText(strPreviewInfo);
00245 }
00246
00247 void CCommit_MAIN::OnSelchangeFiletodiff()
00248 {
00249     UpdatePreviewInfo();
00250 }
00251
00252 void CCommit_MAIN::OnLauncheditor()
00253 {
00254     UStr message;
00255
00256     if( CompatGetEditorMsg(message) )
00257     {
00258         CString strMessage(message);
00259         strMessage.Replace("\n", "\r\n");
00260
00261         if( !strMessage.IsEmpty() )
00262         {
00263             CEdit* pEdit = (CEdit*)GetLogMsgWnd();
00264             pEdit->SetSel(0, -1);
00265             pEdit->ReplaceSel(strMessage);
00266         }
00267     }
00268
00269     GotoDlgCtrl( GetLogMsgWnd() );
00270 }
00271
00273 void CCommit_MAIN::SwitchWrapEdit(BOOL bWordWrap)
00274 {
00275     CString strMessage;
00276
00277     if( bWordWrap )
00278     {
00279         m_logMsgCtrl.GetWindowText(strMessage);
00280         m_logMsgCtrlWrap.SetWindowText(strMessage);
00281
00282         m_bSwitchingWrap = TRUE;
00283         m_logMsgCtrl.ShowWindow(SW_HIDE);
00284         m_logMsgCtrlWrap.ShowWindow(SW_SHOW);
00285         m_bSwitchingWrap = FALSE;
00286     }
00287     else
00288     {
00289         m_logMsgCtrlWrap.GetWindowText(strMessage);
00290         m_logMsgCtrl.SetWindowText(strMessage);
00291
00292         m_bSwitchingWrap = TRUE;
00293         m_logMsgCtrlWrap.ShowWindow(SW_HIDE);
00294         m_logMsgCtrl.ShowWindow(SW_SHOW);
00295         m_bSwitchingWrap = FALSE;
00296     }
00297 }
00298
00299 int CCommit_MAIN::GetLogMsgID()
00300 {
00301     return m_wordWrapCtrl.GetCheck() ? IDC_LOGMSG_WRAP : IDC_LOGMSG;
00302 }
00303
00304 CWnd* CCommit_MAIN::GetLogMsgWnd()
00305 {
00306     return GetDlgItem( GetLogMsgID() );
00307 }
00308
00309 BOOL CCommit_MAIN::OnEraseBkgnd(CDC* pDC)
00310 {
00311     if( m_bSwitchingWrap )
00312     {
00313         return TRUE;
00314     }
00315
00316     return CPropertyPage::OnEraseBkgnd(pDC);
00317 }
00318
00319 void CCommit_MAIN::OnWordwrap()
00320 {
00321     gCvsPrefs.SetWordWrapLogMsg(m_wordWrapCtrl.GetCheck());
00322     SwitchWrapEdit(gCvsPrefs.WordWrapLogMsg());
00323 }
00324
00325 void CCommit_MAIN::OnDiff()
00326 {
00327     const int nComboIndex = m_fileToDiffCombo.GetCurSel();
00328     if( nComboIndex > CB_ERR )
00329     {
00330         int nIndex = (int)m_fileToDiffCombo.GetItemData(nComboIndex);
00331         CStr path;
00332         CStr fileName;
00333         if( m_pmfarg->get(nIndex, path, fileName) )
00334         {
00335             MultiFiles mf;
00336             mf.newdir(path);
00337             mf.newfile(fileName);
00338
00339             CvsCmdDiffFiles(&mf);
00340         }
00341     }
00342 }
00343
00344 BOOL CCommit_MAIN::OnInitDialog()
00345 {
00346     CPropertyPage::OnInitDialog();
00347
00348     // Extra initialization here
00349     SwitchWrapEdit( gCvsPrefs.WordWrapLogMsg() );
00350     if( m_pmfarg )
00351     {
00352         for( int nIndex = 0; nIndex < m_pmfarg->NumFiles(); nIndex++ )
00353         {
00354             CStr path;
00355             CStr fileName;
00356             m_pmfarg->get(nIndex, path, fileName);
00357             int nComboIndex = m_fileToDiffCombo.AddString(CString(path) + CString(fileName));
00358             m_fileToDiffCombo.SetItemData(nComboIndex, (DWORD)nIndex);
00359         }
00360     }
00361
00362     if( m_fileToDiffCombo.GetCount() )
00363     {
00364         m_fileToDiffCombo.SetCurSel(0);
00365     }
00366     else
00367     {
00368         m_fileToDiffCombo.EnableWindow(FALSE);
00369         CWnd* pButton = GetDlgItem(IDC_DIFF);
00370         if( pButton )
00371         {
00372             pButton->EnableWindow(FALSE);
00373         }
00374     }
00375
00376     //enable template button
00377     {
00378         CWnd* pTemplateButton = GetDlgItem(IDC_TEMPLATE);
00379         if( pTemplateButton )
00380         {
00381             FILE* templateFile = fopen(m_tmplPath, "r");
00382             pTemplateButton->EnableWindow(NULL != templateFile);
00383             if( templateFile )
00384             {
00385                 fclose(templateFile);
00386             }
00387         }
00388     }
00389
00390     UpdatePreviewInfo();
00391
00392     return TRUE;  // return TRUE unless you set the focus to a control
00393                   // EXCEPTION: OCX Property Pages should return FALSE
00394 }
00395
00396 void CCommit_MAIN::OnTemplate()
00397 {
00398     CEdit* pEdit = (CEdit*)GetLogMsgWnd();
00399     pEdit->SetSel(0, -1);
00400
00401     bool gotIt = false;
00402     FILE* output;
00403
00404     if( !m_tmplPath.empty() && (output = fopen(m_tmplPath, "r")) != 0L )
00405     {
00406         char *line = 0L;
00407         size_t line_chars_allocated = 0;
00408         int line_length;
00409         while ((line_length = getline (&line, &line_chars_allocated, output)) > 0)
00410         {
00411             //correct the new line characters for edit box and insert the line
00412             CString strLine(line);
00413             strLine.Replace( "\n", "\r\n" );
00414             pEdit->ReplaceSel(strLine);
00415         }
00416
00417         gotIt = true;
00418         if (line_length < 0 && !feof (output))
00419             gotIt = false;
00420
00421         if(line != 0L)
00422             free (line);
00423
00424         fclose(output);
00425     }
00426
00427     if( !gotIt )
00428     {
00429         pEdit->ReplaceSel("*CVS/Template file not found*");
00430     }
00431 }
00432
00434 // CCommit_OPTIONS property page
00435
00436 IMPLEMENT_DYNCREATE(CCommit_OPTIONS, CPropertyPage)
00437
00438 CCommit_OPTIONS::CCommit_OPTIONS() : CPropertyPage(CCommit_OPTIONS::IDD)
00439 {
00440     //{{AFX_DATA_INIT(CCommit_OPTIONS)
00441     m_forceCommit = FALSE;
00442     m_rev = _T("");
00443     m_forceRecurse = FALSE;
00444     m_forceRevision = FALSE;
00445     m_noModuleProgram = FALSE;
00446     m_noRecurse = FALSE;
00447     m_checkValidEdits = FALSE;
00448     //}}AFX_DATA_INIT
00449
00450     m_checkValidEdits = (bool)gCheckValidEdits;
00451     m_revCombo.SetItems(&gRevNames);
00452 }
00453
00454 CCommit_OPTIONS::~CCommit_OPTIONS()
00455 {
00456 }
00457
00458 void CCommit_OPTIONS::DoDataExchange(CDataExchange* pDX)
00459 {
00460     CPropertyPage::DoDataExchange(pDX);
00461     //{{AFX_DATA_MAP(CCommit_OPTIONS)
00462     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00463     DDX_Check(pDX, IDC_FORCECOMMIT, m_forceCommit);
00464     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00465     DDX_Check(pDX, IDC_FORCERECURSE, m_forceRecurse);
00466     DDX_Check(pDX, IDC_FORCEREVISION, m_forceRevision);
00467     DDX_Check(pDX, IDC_NOMODULEPROGRAM, m_noModuleProgram);
00468     DDX_Check(pDX, IDC_NORECURS, m_noRecurse);
00469     DDX_Check(pDX, IDC_CHECKVALIDEDITS, m_checkValidEdits);
00470     //}}AFX_DATA_MAP
00471
00472     if( m_forceRevision )
00473     {
00474         DDV_MinChars(pDX, m_rev, 1);
00475     }
00476
00477     if( !pDX->m_bSaveAndValidate )
00478     {
00479         OnForcerevision();
00480     }
00481
00482     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00483 }
00484
00485
00486 BEGIN_MESSAGE_MAP(CCommit_OPTIONS, CPropertyPage)
00487 //{{AFX_MSG_MAP(CCommit_OPTIONS)
00488     ON_BN_CLICKED(IDC_FORCEREVISION, OnForcerevision)
00489     //}}AFX_MSG_MAP
00490 END_MESSAGE_MAP()
00491
00493 // CCommit_OPTIONS message handlers
00494
00495 void CCommit_OPTIONS::OnForcerevision()
00496 {
00497     CButton* but = (CButton *)GetDlgItem(IDC_FORCEREVISION);
00498     CWnd* wnd = GetDlgItem(IDC_COMBOREV);
00499     wnd->EnableWindow(but->GetCheck() == 1);
00500 }
00501
00502 #endif /* WIN32 */
00503
00504 #ifdef qMacCvsPP
00505 class LLogFillerWrapper : public LFillerWrapper
00506 {
00507 public:
00508     LLogFillerWrapper(LMenuController *menu, CMString & mstr, const char *pathTmpl) :
00509         LFillerWrapper(menu), fMStr(mstr), fFirstTime(true)
00510     {
00511         fTmplPath = pathTmpl;
00512         if(!fTmplPath.empty())
00513         {
00514             if(!fTmplPath.endsWith(kPathDelimiter))
00515                 fTmplPath << kPathDelimiter;
00516             fTmplPath << "CVS";
00517             fTmplPath << kPathDelimiter;
00518             fTmplPath << "Template";
00519         }
00520
00521     }
00522
00523     virtual void OnAddingItem(CStr & str)
00524     {
00525         if(fFirstTime)
00526         {
00527             fMenu->InsertMenuItem("\pInsert CVS/Template", max_Int16);
00528             fMenu->InsertMenuItem("\p(-", max_Int16, false);
00529             fFirstTime = false;
00530         }
00531
00532         combozify(str);
00533         CPStr pstr(str);
00534         fMenu->InsertMenuItem(pstr, max_Int16);
00535     }
00536
00537     virtual bool OnSelectingItem(SInt32 inItem, CStr & str)
00538     {
00539         str = "";
00540         if(inItem == 2)
00541         {
00542             bool gotIt = false;
00543             FILE *output;
00544             if(!fTmplPath.empty() && (output = fopen(fTmplPath, "r")) != 0L)
00545             {
00546                 char *line = 0L;
00547                 size_t line_chars_allocated = 0;
00548                 int line_length;
00549                 while ((line_length = getline (&line, &line_chars_allocated, output)) > 0)
00550                 {
00551                     str << line;
00552                 }
00553
00554                 gotIt = true;
00555                 if (line_length < 0 && !feof (output))
00556                     gotIt = false;
00557
00558                 if(line != 0L)
00559                     free (line);
00560
00561                 fclose(output);
00562             }
00563             if(!gotIt)
00564                 str << "*found no CVS/Template file*";
00565             return true;
00566         }
00567         else if(inItem >= 4)
00568         {
00569             str = fMStr.GetList()[inItem - 4];
00570             return true;
00571         }
00572
00573         return false;
00574     }
00575 protected:
00576     CMString & fMStr;
00577     CStr fTmplPath;
00578     bool fFirstTime;
00579 };
00580
00581 static void DoDataExchange_Commit(LWindow *theDialog, CStr & commit, bool & norecurs,
00582     const char *pathTmpl, bool putValue)
00583 {
00584     LCheckBox *chkNoRecurs = dynamic_cast<LCheckBox*>
00585         (theDialog->FindPaneByID(item_NoRecurs));
00586     LTextEditView *editLog = dynamic_cast<LTextEditView*>
00587         (theDialog->FindPaneByID(item_LogMsg));
00588     LPopupFiller *fillLog = dynamic_cast<LPopupFiller*>
00589         (theDialog->FindPaneByID(item_FillerRev1));
00590     LLogFillerWrapper *wrapper = putValue ? NEW LLogFillerWrapper(fillLog, gCommitLogs, pathTmpl) : 0L;
00591
00592     fillLog->DoDataExchange(gCommitLogs, putValue, wrapper);
00593
00594     if(putValue)
00595     {
00596         chkNoRecurs->SetValue(norecurs ? Button_On : Button_Off);
00597         editLog->SetTextPtr((Ptr)(const char *)commit, commit.length());
00598         theDialog->SetLatentSub(editLog);
00599     }
00600     else
00601     {
00602         norecurs = chkNoRecurs->GetValue() == Button_On;
00603         Handle hdl = editLog->GetTextHandle();
00604         Assert_(hdl != 0L);
00605         commit.set(*hdl, GetHandleSize(hdl));
00606
00607     }
00608 }
00609
00610 static void
00611 DoDataExchange_CommitOptions(
00612
00613     LView *theDialog,
00614     bool & forceCommit,
00615     bool & forceRecurse,
00616     bool & hasRev,
00617     CPStr & lastRev,
00618     bool & noModuleProgram,
00619     bool putValue)
00620 {
00621     LPopupFiller *fillTag = dynamic_cast<LPopupFiller*> (theDialog->FindPaneByID(item_FillerTag));
00622     fillTag->DoDataExchange(gRevNames, putValue);
00623
00624     DoDataExchange (theDialog, item_ForceCommit, forceCommit, putValue);
00625     DoDataExchange (theDialog, item_ForceRecurse, forceRecurse, putValue);
00626     DoDataExchange (theDialog, item_NoModuleProgram, noModuleProgram, putValue);
00627     DoDataExchange (theDialog, item_CheckRevTag, hasRev, putValue);
00628     DoDataExchange (theDialog, item_EditRevTag, lastRev, putValue);
00629 }
00630 #endif /* qMacCvsPP */
00631
00632 #if qUnix
00633 class UCvsCommit : public UWidget
00634 {
00635     UDECLARE_DYNAMIC(UCvsCommit)
00636 public:
00637     UCvsCommit() : UWidget(::UEventGetWidID()) {}
00638     virtual ~UCvsCommit() {}
00639
00640     enum
00641     {
00642         kOK = EV_COMMAND_START, // 0
00643         kCancel,                // 1
00644         kTabGeneral             // 2
00645     };
00646
00647     virtual void DoDataExchange(bool fill);
00648
00649 protected:
00650     ev_msg int OnOK(void);
00651     ev_msg int OnCancel(void);
00652
00653     UDECLARE_MESSAGE_MAP()
00654 };
00655
00656 UIMPLEMENT_DYNAMIC(UCvsCommit, UWidget)
00657
00658 UBEGIN_MESSAGE_MAP(UCvsCommit, UWidget)
00659     ON_UCOMMAND(UCvsCommit::kOK, UCvsCommit::OnOK)
00660     ON_UCOMMAND(UCvsCommit::kCancel, UCvsCommit::OnCancel)
00661 UEND_MESSAGE_MAP()
00662
00663 int UCvsCommit::OnOK(void)
00664 {
00665     EndModal(true);
00666     return 0;
00667 }
00668
00669 int UCvsCommit::OnCancel(void)
00670 {
00671     EndModal(false);
00672     return 0;
00673 }
00674
00675 void UCvsCommit::DoDataExchange(bool fill)
00676 {
00677     if(fill)
00678     {
00679     }
00680     else
00681     {
00682     }
00683 }
00684
00685 class UCvsCommit_MAIN : public UWidget
00686 {
00687     UDECLARE_DYNAMIC(UCvsCommit_MAIN)
00688 public:
00689     UCvsCommit_MAIN(const char *logmsg, const char *pathTmpl);
00690     virtual ~UCvsCommit_MAIN() {}
00691
00692     enum
00693     {
00694         kEditLog = EV_COMMAND_START,    // 0
00695         kComboLog,              // 1
00696         kCheckRecurs            // 2
00697     };
00698
00699     virtual void DoDataExchange(bool fill);
00700
00701     UStr m_logmsg;
00702     bool m_norecurs;
00703     UStr m_tmplPath;
00704 protected:
00705
00706     ev_msg void OnComboSel(int pos, const char *txt);
00707
00708     UDECLARE_MESSAGE_MAP()
00709 };
00710
00711 UIMPLEMENT_DYNAMIC(UCvsCommit_MAIN, UWidget)
00712
00713 UBEGIN_MESSAGE_MAP(UCvsCommit_MAIN, UWidget)
00714     ON_COMBO_SEL(UCvsCommit_MAIN::kComboLog, UCvsCommit_MAIN::OnComboSel)
00715 UEND_MESSAGE_MAP()
00716
00717 UCvsCommit_MAIN::UCvsCommit_MAIN(const char *logmsg, const char *pathTmpl) : UWidget(::UEventGetWidID())
00718 {
00719     m_logmsg = logmsg;
00720     m_norecurs = false;
00721     m_tmplPath = pathTmpl;
00722     if(!m_tmplPath.empty())
00723     {
00724         if(!m_tmplPath.endsWith(kPathDelimiter))
00725             m_tmplPath << kPathDelimiter;
00726         m_tmplPath << "CVS";
00727         m_tmplPath << kPathDelimiter;
00728         m_tmplPath << "Template";
00729     }
00730 }
00731
00732 void UCvsCommit_MAIN::OnComboSel(int pos, const char *txt)
00733 {
00734     if(pos == 0)
00735     {
00736         bool gotIt = false;
00737         FILE *output;
00738
00739         if(!m_tmplPath.empty() && (output = fopen(m_tmplPath, "r")) != 0L)
00740         {
00741             char *line = 0L;
00742             size_t line_chars_allocated = 0;
00743             int line_length;
00744             while ((line_length = getline (&line, &line_chars_allocated, output)) > 0)
00745             {
00746                 UEventSendMessage(GetWidID(), EV_SETTEXT, kEditLog, line);
00747             }
00748
00749             gotIt = true;
00750             if (line_length < 0 && !feof (output))
00751                 gotIt = false;
00752
00753             if(line != 0L)
00754                 free (line);
00755
00756             fclose(output);
00757         }
00758         if(!gotIt)
00759             UEventSendMessage(GetWidID(), EV_SETTEXT, kEditLog, (void *)"*found no CVS/Template file*");
00760     }
00761     else
00762     {
00763         const std::vector<CStr> & list = gCommitLogs.GetList();
00764         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditLog, (void *)(const char *)list[pos - 1]);
00765     }
00766 }
00767
00768 void UCvsCommit_MAIN::DoDataExchange(bool fill)
00769 {
00770     if(fill)
00771     {
00772         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditLog, (void *)(const char *)m_logmsg);
00773
00774         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kComboLog, 0L);
00775         UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kComboLog,
00776                           (void *)"Insert CVS/Template");
00777         const std::vector<CStr> & list = gCommitLogs.GetList();
00778         std::vector<CStr>::const_iterator i;
00779         for(i = list.begin(); i != list.end(); ++i)
00780         {
00781             CStr str = *i;
00782             combozify(str);
00783             UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kComboLog, (void *)(const char *)str);
00784         }
00785
00786         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurs, m_norecurs), 0L);
00787     }
00788     else
00789     {
00790         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditLog, &m_logmsg);
00791         if(!m_logmsg.empty())
00792             gCommitLogs.Insert(m_logmsg);
00793
00794         m_norecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurs, 0L) != 0;
00795     }
00796 }
00797
00798 #endif // qUnix
00799
00800 bool CompatGetCommit(CStr & commit, bool & norecurs,
00801                      bool & forceCommit, bool & forceRecurse, CPStr & rev, bool & noModuleProgram,
00802                      bool & checkValidEdits,
00803                      const char *pathTmpl,
00804                      MultiFiles *mf)
00805 {
00806     bool userHitOK = false;
00807
00808     static CStr sLastMsg;
00809     static CPStr sLastRev;
00810
00811     bool hasRev = false;
00812
00813     norecurs = false;
00814     commit = "";
00815     forceCommit = false;
00816     forceRecurse = false;
00817     rev = "";
00818     noModuleProgram = false;
00819     checkValidEdits = (bool)gCheckValidEdits;
00820
00821 #ifdef WIN32
00822     CPropertySheet pages("Commit settings");
00823     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00824     CCommit_MAIN page1(sLastMsg, pathTmpl, mf);
00825     CCommit_OPTIONS page2;
00826     CGetPrefs_GLOBALS page3;
00827     pages.AddPage(&page1);
00828     pages.AddPage(&page2);
00829     pages.AddPage(&page3);
00830     if(pages.DoModal() == IDOK)
00831     {
00832         commit = (const char *)page1.m_logMsg;
00833         sLastMsg = (const char *)page1.m_logMsg;
00834         norecurs = page2.m_noRecurse ? true : false;
00835         forceCommit = page2.m_forceCommit ? true : false;
00836         forceRecurse = page2.m_forceRecurse ? true : false;
00837         hasRev = page2.m_forceRevision ? true : false;
00838         sLastRev = page2.m_rev;
00839         noModuleProgram = page2.m_noModuleProgram ? true : false;
00840         gCheckValidEdits = page2.m_checkValidEdits ? true : false;
00841         page3.StoreValues();
00842
00843         userHitOK = true;
00844     }
00845 #endif /* WIN32 */
00846 #ifdef qMacCvsPP
00847     StDialogHandler theHandler(dlg_Commit, LCommander::GetTopCommander());
00848     LWindow *theDialog = theHandler.GetDialog();
00849     ThrowIfNil_(theDialog);
00850     static UInt16 sRuntimePanel = 1;
00851
00852     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00853         (theDialog->FindPaneByID(item_MultiViewPrefs));
00854     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00855
00856     multiView->SwitchToPanel(3);
00857     DoDataExchange_Globals(theDialog, true);
00858     multiView->SwitchToPanel(2);
00859     DoDataExchange_CommitOptions(theDialog, forceCommit, forceRecurse, hasRev, sLastRev, noModuleProgram, true);
00860     multiView->SwitchToPanel(1);
00861     DoDataExchange_Commit(theDialog, sLastMsg, norecurs, pathTmpl, true);
00862
00863     groupView->SetValue(sRuntimePanel);
00864     theDialog->Show();
00865     MessageT hitMessage;
00866     while (true)
00867     {       // Let DialogHandler process events
00868         hitMessage = theHandler.DoDialog();
00869
00870         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00871             break;
00872     }
00873     theDialog->Hide();
00874     sRuntimePanel = groupView->GetValue();
00875
00876     if(hitMessage == msg_OK)
00877     {
00878         multiView->SwitchToPanel(1);
00879         DoDataExchange_Commit(theDialog, sLastMsg, norecurs, pathTmpl, false);
00880         multiView->SwitchToPanel(2);
00881         DoDataExchange_CommitOptions(theDialog, forceCommit, forceRecurse, hasRev, sLastRev, noModuleProgram, false);
00882         multiView->SwitchToPanel(3);
00883         DoDataExchange_Globals(theDialog, false);
00884         commit = sLastMsg;
00885         commit.replace('\015', '\012');
00886         userHitOK = true;
00887     }
00888 #endif /* qMacCvsPP */
00889 #if qUnix
00890     void *wid = UCreate_CommitDlg();
00891
00892     UCvsCommit *dlg = new UCvsCommit();
00893     UCvsCommit_MAIN *tab1 = new UCvsCommit_MAIN(sLastMsg, pathTmpl);
00894     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00895     dlg->AddPage(tab1, UCvsCommit::kTabGeneral, 0);
00896
00897     if(dlg->DoModal())
00898     {
00899         commit = tab1->m_logmsg;
00900         sLastMsg = tab1->m_logmsg;
00901         norecurs = tab1->m_norecurs;
00902
00903         userHitOK = true;
00904     }
00905
00906     delete dlg;
00907 #endif // qUnix
00908
00909     if(userHitOK)
00910     {
00911         if(commit.length() == 0)
00912             commit = "no message";
00913
00914         if(hasRev && !sLastRev.empty())
00915             rev = sLastRev;
00916
00917         checkValidEdits = (bool)gCheckValidEdits;
00918
00919         gCvsPrefs.save();
00920     }
00921
00922     return userHitOK;
00923 }
Generated on Sun Feb 24 01:21:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CommitDlg.h Source File

common/CommitDlg.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 1998
00019  */
00020
00021 /*
00022  * CommitDlg.h : the cvs commit dialog
00023  */
00024
00025 #if !defined(AFX_COMMITDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
00026 #define AFX_COMMITDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif // _MSC_VER >= 1000
00031
00032 #include "CPStr.h"
00033 #include "MultiString.h"
00034 #include "MultiFiles.h"
00035 #include "SmartComboBox.h"
00036
00037 bool CompatGetCommit(CStr & commit, bool & norecurs,
00038                      bool & forceCommit, bool & forceRecurse, CPStr & rev, bool & noModuleProgram,
00039                      bool & checkValidEdits,
00040                      const char *pathTmpl = 0L,
00041                      MultiFiles *mf = 0L);
00042     // get the commit log and misc options...
00043     // the path is used to read the /path/CVS/Template optionally
00044
00045 void combozify(CStr & str);
00046     // strip the string with the few first words.
00047
00048 extern CMString gRevNames;
00049
00050 #ifdef WIN32
00051 class CCommit_MAIN : public CPropertyPage
00052 {
00053     DECLARE_DYNCREATE(CCommit_MAIN)
00054
00055 // Construction
00056 public:
00057     CCommit_MAIN();
00058     CCommit_MAIN(const char *logMsg, const char *pathTmpl = 0L, MultiFiles *mf = 0L);
00059     ~CCommit_MAIN();
00060
00061 // Dialog Data
00062     //{{AFX_DATA(CCommit_MAIN)
00063     enum { IDD = IDD_COMMIT_MAIN };
00064     CButton m_previewInfo;
00065     CSmartComboBox  m_fileToDiffCombo;
00066     CButton m_wordWrapCtrl;
00067     CEdit   m_logMsgCtrlWrap;
00068     CEdit   m_logMsgCtrl;
00069     CSmartComboBox  m_prevLogsCombo;
00070     CString m_logMsg;
00071     BOOL    m_wordWrap;
00072     //}}AFX_DATA
00073
00074     CStr m_tmplPath;
00075     MultiFiles *m_pmfarg;
00076
00077 // Overrides
00078     // ClassWizard generate virtual function overrides
00079     //{{AFX_VIRTUAL(CCommit_MAIN)
00080     public:
00081     virtual BOOL PreTranslateMessage(MSG* pMsg);
00082     protected:
00083     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00084     //}}AFX_VIRTUAL
00085
00086 // Implementation
00087 protected:
00088     // Generated message map functions
00089     //{{AFX_MSG(CCommit_MAIN)
00090     afx_msg void OnSelchangeCombo();
00091     afx_msg void OnLauncheditor();
00092     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00093     afx_msg void OnWordwrap();
00094     virtual BOOL OnInitDialog();
00095     afx_msg void OnDiff();
00096     afx_msg void OnSelchangeFiletodiff();
00097     afx_msg void OnTemplate();
00098     //}}AFX_MSG
00099     DECLARE_MESSAGE_MAP()
00100
00101 private:
00102     void UpdateInfo();
00103     void UpdatePreviewInfo();
00104     void SwitchWrapEdit(BOOL bWordWrap);
00105     int GetLogMsgID();
00106     CWnd* GetLogMsgWnd();
00107
00108     BOOL m_bSwitchingWrap;
00109 };
00110
00112 // CCommit_OPTIONS dialog
00113
00114 class CCommit_OPTIONS : public CPropertyPage
00115 {
00116     DECLARE_DYNCREATE(CCommit_OPTIONS)
00117
00118 // Construction
00119 public:
00120     CCommit_OPTIONS();
00121     ~CCommit_OPTIONS();
00122
00123 // Dialog Data
00124     //{{AFX_DATA(CCommit_OPTIONS)
00125     enum { IDD = IDD_COMMIT_OPTIONS };
00126     CSmartComboBox  m_revCombo;
00127     BOOL    m_forceCommit;
00128     CString m_rev;
00129     BOOL    m_forceRecurse;
00130     BOOL    m_forceRevision;
00131     BOOL    m_noModuleProgram;
00132     BOOL    m_noRecurse;
00133     BOOL    m_checkValidEdits;
00134     //}}AFX_DATA
00135
00136
00137 // Overrides
00138     // ClassWizard generate virtual function overrides
00139     //{{AFX_VIRTUAL(CCommit_OPTIONS)
00140     protected:
00141     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00142     //}}AFX_VIRTUAL
00143
00144 // Implementation
00145 protected:
00146     // Generated message map functions
00147     //{{AFX_MSG(CCommit_OPTIONS)
00148     afx_msg void OnForcerevision();
00149     //}}AFX_MSG
00150     DECLARE_MESSAGE_MAP()
00151
00152 };
00153 //{{AFX_INSERT_LOCATION}}
00154 #endif /* WIN32 */
00155
00156 #endif // !defined(AFX_COMMITDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CPStr.cpp Source File

common/CPStr.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- January 1997
00019  */
00020
00021 /*
00022  * CPStr.cpp --- simple Pascal-C string
00023  * Moved in ustr.cpp
00024  */
00025
00026 #include "stdafx.h"
00027
00028 #include "CPStr.h"
Generated on Sun Feb 24 01:21:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CPStr.h Source File

common/CPStr.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- January 1997
00019  */
00020
00021 /*
00022  * CPStr.h --- simple Pascal-C string
00023  */
00024
00025 #ifndef CPSTR_H
00026 #define CPSTR_H
00027
00028 #include <string.h>
00029 #include <stdlib.h>
00030
00031 #include "Persistent.h"
00032
00033 #include "ustr.h"
00034 #include <exception>
00035 #define CPStr UPStr
00036 #define CStr UStr
00037
00038 // the persistent version
00039 class PCPStr : public CPStr, public CPersistent
00040 {
00041     UDECLARE_DYNAMIC(PCPStr)
00042 public:
00043     PCPStr(const char *uniqueName, const char *defValue = 0L, kClassPersistent pclass = kNoClass) : CPStr(),
00044         CPersistent(uniqueName, pclass)
00045     {
00046         if(defValue != 0L)
00047             *(CPStr *)this = defValue;
00048     }
00049     virtual ~PCPStr()
00050     {
00051     }
00052
00053     virtual unsigned int SizeOf(void) const
00054     {
00055         return str != 0L ? length() + 1 : 1;
00056     }
00057
00058     virtual const void *GetData(void) const
00059     {
00060         const void *res = (const char *)(*(CPStr *)this);
00061         return res == 0L ? "" : res;
00062     }
00063
00064     virtual void SetData(const void *ptr, unsigned int size)
00065     {
00066         if(strlen((const char *)ptr) == (size - 1))
00067             *(CPStr *)this = (const char *)ptr;
00068     }
00069
00070     inline operator const unsigned char *() const
00071         { return *(CPStr *)this; }
00072     inline operator unsigned char *() EGCS_CONST
00073         { return *(CPStr *)this; }
00074         // as a P string
00075
00076     inline operator const char *() const { return *(CPStr *)this; }
00077     inline operator char *() EGCS_CONST { return *(CPStr *)this; }
00078         // as a C string
00079
00080     inline const char *operator=(const char *newstr)
00081         { return ((CPStr *)this)->operator=(newstr); }
00082         // set from a C String (0L is OK)
00083     inline const unsigned char *operator=(const unsigned char *newstr)
00084         { return ((CPStr *)this)->operator=(newstr); }
00085         // set from a P String (0L is OK)
00086 };
00087
00088 class PCStr : public CStr, public CPersistent
00089 {
00090     UDECLARE_DYNAMIC(PCStr)
00091 public:
00092     PCStr(const char *uniqueName, const char *defValue = 0L, kClassPersistent pclass = kNoClass) : CStr(),
00093         CPersistent(uniqueName, pclass)
00094     {
00095         if(defValue != 0L)
00096             *(CStr *)this = defValue;
00097     }
00098     virtual ~PCStr()
00099     {
00100     }
00101
00102     virtual unsigned int SizeOf(void) const
00103     {
00104         return str != 0L ? length() + 1 : 0;
00105     }
00106
00107     virtual const void *GetData(void) const
00108     {
00109         const void *res = (const char *)(*(CStr *)this);
00110         return res == 0L ? "" : res;
00111     }
00112
00113     virtual void SetData(const void *ptr, unsigned int size)
00114     {
00115         if(strlen((const char *)ptr) == (size - 1))
00116             *(CStr *)this = (const char *)ptr;
00117     }
00118
00119     inline operator const char *() const { return *(CStr *)this; }
00120     inline operator char *() EGCS_CONST { return *(CStr *)this; }
00121         // as a C string
00122
00123     inline const char *operator=(const char *newstr)
00124     {
00125         TouchTimeStamp();
00126         return ((CStr *)this)->operator=(newstr);
00127     }
00128         // set from a C String (0L is OK)
00129     inline const char *operator=(const unsigned char *newstr)
00130     {
00131         TouchTimeStamp();
00132         return ((CStr *)this)->operator=(newstr);
00133     }
00134         // set from a P String (0L is OK)
00135 };
00136
00137 // class to use when fed-up with realloc, malloc...
00138 template <class T>
00139 class CStaticAllocT
00140 {
00141 public:
00142     CStaticAllocT()
00143     {
00144         buf = 0L;
00145         numbuf = 0;
00146     }
00147
00148     ~CStaticAllocT()
00149     {
00150         if(buf != 0L)
00151             free(buf);
00152     }
00153
00154     void AdjustSize(size_t size)
00155     {
00156         if(numbuf < size)
00157         {
00158             if(buf == 0L)
00159                 buf = (T *)malloc(size * sizeof(T));
00160             else
00161                 buf = (T *)realloc(buf, size * sizeof(T));
00162             if(buf == 0L)
00163                 throw std::bad_alloc();
00164             numbuf = size;
00165         }
00166     }
00167
00168     inline operator T *(void) const /* egcs const */ { return buf; }
00169     inline operator const T *(void) const { return buf; }
00170 #ifdef __GNUC__
00171     inline const T & operator[](int i) const { return buf[i]; }
00172     inline T & operator[](int i) { return buf[i]; }
00173 #endif
00174
00175     inline size_t size() const { return numbuf; }
00176 protected:
00177     T *buf;
00178     size_t numbuf;
00179 };
00180
00181 #endif /* CPSTR_H */
Generated on Sun Feb 24 01:21:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CTCP2Parse.cpp Source File

common/CTCP2Parse.cpp

Go to the documentation of this file.
00001 /*
00002  ------------------------------------------------------------------------------
00003  * CTCP2Parse.cpp  --
00004  *
00005  *  a C++ implementation of the Text attribute section of the CTCP/2
00006  *  draft by Robey Pointer (that eggdrop dude) and friends.  This code
00007  *  is based directly from Robey's Java example.  This code includes
00008  *  full support for decoding mIrc, ANSI, and ircII attributes as well.
00009  *
00010  *  See --> http://www.lag.net/~robey/ctcp
00011  *      --> http://www.egroups.com/group/ctcp2
00012  *
00013  *  Depends: STL string template, no OS specifics.
00014  *
00015  *  This source is under BSD license and has no restrictions the way
00016  *  the GPL does.  Sell it for all I care.  Just be nice and give me
00017  *  credit for it.  Although it's not a requirement.
00018  *
00019  *  Author: David Gravereaux <davygrvy@pobox.com>
00020  *      Tomahawk Software Group
00021  *
00022  *  Conversion routines donated by Keith Lea <keith@cs.oswego.edu>
00023  *
00024  * RCS: @(#) $Id: CTCP2Parse.cpp,v 1.4 2001/01/14 15:33:39 davygrvy Exp $
00025  ------------------------------------------------------------------------------
00026  */
00027
00028 #include "stdafx.h"
00029 #include "CTCP2Parse.hpp"
00030
00031 CTCP2Parse::CTCP2Parse ()
00032 {
00033     boldCnt = revCnt = overCnt = underCnt = italicCnt = blinkCnt = urlCnt = 0;
00034     boldLast = revLast = overLast = underLast = italicLast = blinkLast = urlLast = 0;
00035     fntSize = fntLast = 0;
00036
00037     fg.RGB = fgLast.RGB = fgDef.RGB = Lt_Grey;
00038     bg.RGB = bgLast.RGB = bgDef.RGB = Black;
00039
00040     cp = cpLast = cpDef = Fixed;
00041     enc = encLast = encDef = iso8859_1;
00042 }
00043
00044 void CTCP2Parse::SetDefaults (
00045     unsigned char fgR, unsigned char fgG, unsigned char fgB,    // default foreground color
00046     unsigned char bgR, unsigned char bgG, unsigned char bgB,    // default background color
00047     CharSpacingType cpDef_,
00048     EncodingType encDef_)
00049 {
00050
00051     // reassemble the seperate RGB values into our internal rep.
00052
00053     fg.R = fgLast.R = fgDef.R = fgR;
00054     fg.G = fgLast.G = fgDef.G = fgG;
00055     fg.B = fgLast.B = fgDef.B = fgB;
00056
00057     bg.R = bgLast.R = bgDef.R = bgR;
00058     bg.G = bgLast.G = bgDef.G = bgG;
00059     bg.B = bgLast.B = bgDef.B = bgB;
00060
00061     cp = cpLast = cpDef = cpDef_;
00062     enc = encLast = encDef = encDef_;
00063 }
00064
00065 void CTCP2Parse::ParseIt (std::string *line)
00066 {
00067     int parseFrmChar = 0, parseEndChar = 0, parseStart = 0;
00068     int fntVal, fntDir = 1;
00069     int rollBack;
00070
00071     // Pre-parse and replace other attribute standards with
00072     // the ctcp2 equivalents for display.
00073     mirc2ctcp(line);
00074     ircii2ctcp(line);
00075     ansi2ctcp(line);
00076
00077
00078     // find an opening ctcp/2 format character (^F)
00079     parseFrmChar = line->find_first_of("\006");
00080
00081     // do we have any?
00082     while (parseFrmChar != std::string::npos)
00083     {
00084         // find the closing ctcp/2 format character (^F)
00085         parseEndChar = line->find_first_of("\006", parseFrmChar+1);
00086
00087         if (parseEndChar == std::string::npos)
00088         {
00089             // an opening without a closing is bogus
00090             // so remove it and fallout of the while loop
00091             line->replace(parseFrmChar, 1, "");
00092             break;
00093         }
00094
00095         // check for text before this format character
00096         // and after the last format character (or index 0 for
00097         // the first iteration.
00098         if (parseFrmChar > parseStart)
00099         {
00100             // yes.. we got a text segment ready to push.
00101             segment = new std::string(line->substr(parseStart, (parseFrmChar - parseStart)));
00102             PushOut();
00103             delete segment;
00104         }
00105
00106         // now, interpret this format code and decode this attribute
00107         // (and options, if any).
00108
00109
00110         parseFrmChar++;  // consume the first ^F.
00111
00112
00113         switch (line->at(parseFrmChar)) {
00114
00115 #   define CTCP2_TOGGLE(ch, var)  \
00116         case (ch): \
00117         decodeToggle(line, &parseFrmChar, &parseEndChar, &(var)); \
00118             break;
00119
00120         // bold
00121         CTCP2_TOGGLE('B', boldCnt);
00122
00123         // reverse
00124         CTCP2_TOGGLE('V', revCnt);
00125
00126         // underline
00127         CTCP2_TOGGLE('U', underCnt);
00128
00129         // over-strike
00130         CTCP2_TOGGLE('S', overCnt);
00131
00132         // italics
00133         CTCP2_TOGGLE('I', italicCnt);
00134
00135         // blink
00136         CTCP2_TOGGLE('K', blinkCnt);
00137
00138         // URL
00139         CTCP2_TOGGLE('L', urlCnt);
00140
00141 #   undef CTCP2_TOGGLE
00142
00143         // color
00144         case 'C':
00145             parseFrmChar++;   // consume the 'C'
00146             if (parseFrmChar < parseEndChar)
00147             {
00148                 if (line->at(parseFrmChar) == '.')
00149                 {
00150                     // reset to default
00151                     fg.RGB = fgDef.RGB;
00152                     parseFrmChar++;  // consume the '.'
00153                 }
00154                 else if (line->at(parseFrmChar) == '-')
00155                 {
00156                     // ignore
00157                     parseFrmChar++;   // consume the '-'
00158                 }
00159                 else
00160                 {
00161                     if (rollBack = decodeColor(line, &parseFrmChar, &parseEndChar, &fg))
00162                     {
00163                         // rollback the error to the 'C'
00164                         parseFrmChar -= rollBack;
00165                         fg.RGB = fgDef.RGB;
00166                         break;
00167                     }
00168                 }
00169
00170
00171                 // background color?
00172                 if (parseFrmChar < parseEndChar)
00173                 {
00174                     if (line->at(parseFrmChar) == '.')
00175                     {
00176                         bg.RGB = bgDef.RGB;
00177                         parseFrmChar++;  // consume the '.'
00178                     }
00179                     else if (line->at(parseFrmChar) == '-')
00180                     {
00181                         // ignore
00182                         parseFrmChar++;   // consume the '-'
00183                     }
00184                     else
00185                     {
00186                         if (rollBack = decodeColor(line, &parseFrmChar, &parseEndChar, &bg))
00187                         {
00188                             // rollback the error to the 'C'
00189                             parseFrmChar -= rollBack;
00190                             bg.RGB = bgDef.RGB;
00191                             break;
00192                         }
00193                     }
00194                 }
00195                 else
00196                     parseFrmChar--;   // rollback one
00197             }
00198             else
00199             {
00200                 // no colors were specified: reset to normal
00201                 fg.RGB = fgDef.RGB;
00202                 bg.RGB = bgDef.RGB;
00203             }
00204
00205             // if fg/bg are too similar, reset to defaults.
00206             // (this is in the ctcp2 draft).  These calculations
00207             // are DIRECTLY from ctcp2's draft.
00208             if ((fg.R >= bg.R - 8) && (fg.R <= bg.R + 8) &&
00209                 (fg.G >= bg.G - 8) && (fg.G <= bg.G + 8) &&
00210                 (fg.B >= bg.B - 8) && (fg.B <= bg.B + 8))
00211             {
00212                 fg.RGB = fgDef.RGB;
00213                 bg.RGB = bgDef.RGB;
00214             }
00215             break;
00216
00217         // font size
00218         case 'F':
00219             parseFrmChar++;
00220             if (parseFrmChar < parseEndChar)
00221             {
00222                 if (line->at(parseFrmChar) == '+') fntDir = 1;
00223                 else fntDir = -1;
00224                 parseFrmChar++;
00225                 if (parseFrmChar < parseEndChar)
00226                 {
00227                     fntVal = line->at(parseFrmChar) - 48;
00228                     if (fntVal > 4) fntVal = 4;
00229                 } else {
00230                     // no amount -- assume 1
00231                     fntVal = 1;
00232                     parseFrmChar--;
00233                 }
00234                 fntSize += (fntDir*fntVal);
00235             } else {
00236                 // no parameters -- reset to normal
00237                 fntSize = 0;
00238                 parseFrmChar--;
00239             }
00240             break;
00241
00242         // character spacing
00243         case 'P':
00244             parseFrmChar++;   // consume it
00245             if (parseFrmChar < parseEndChar)
00246             {
00247                 switch (line->at(parseFrmChar))
00248                 {
00249                 case 'P':
00250                     cp = Proportional; parseFrmChar++; break;
00251                 case 'F':
00252                     cp = Fixed; parseFrmChar++; break;
00253                 default:
00254                     // rollback to show the error.
00255                     parseFrmChar -= 2;
00256                 }
00257             } else {
00258                 // no parameters -- reset to normal
00259                 cp = cpDef;
00260             }
00261             break;
00262
00263         // text encoding
00264         case 'E':
00265             parseFrmChar++;   // consume it
00266             switch (line->at(parseFrmChar))
00267             {
00268             case '1':
00269                 if (line->at(parseFrmChar+1) == '0') parseFrmChar++; // what's iso8859-10 ???
00270                 enc = iso8859_1; parseFrmChar++; break;
00271             case '2':
00272                 enc = iso8859_2; parseFrmChar++; break;
00273             case '3':
00274                 enc = iso8859_3; parseFrmChar++; break;
00275             case '4':
00276                 enc = iso8859_4; parseFrmChar++; break;
00277             case '5':
00278                 enc = iso8859_5; parseFrmChar++; break;
00279             case '6':
00280                 enc = iso8859_6; parseFrmChar++; break;
00281             case '7':
00282                 enc = iso8859_7; parseFrmChar++; break;
00283             case '8':
00284                 enc = iso8859_8; parseFrmChar++; break;
00285             case '9':
00286                 enc = iso8859_9; parseFrmChar++; break;
00287             case 'U':
00288                 enc = UTF_8; parseFrmChar++; break;
00289             default:
00290                 // rollback to show the error.
00291                 parseFrmChar -= 2;
00292             }
00293             break;
00294
00295         // revert to normal
00296         case 'N':
00297             parseFrmChar++;   // consume it
00298             boldCnt = revCnt = overCnt = underCnt = italicCnt = blinkCnt = urlCnt = 0;
00299             enc = encDef;
00300             fg.RGB = fgDef.RGB;
00301             bg.RGB = bgDef.RGB;
00302             cp = cpDef;
00303             break;
00304
00305         // client extensions
00306         case 'X':
00307             //  no extensions are defined at this time.
00308             /*
00309             parseFrmChar++;
00310             switch (line->at(parseFrmChar)) {
00311             case '':
00312             default:
00313                  rollback to show the error.
00314                 parseFrmChar -= 2;
00315             }
00316             */
00317             parseFrmChar--;
00318             break;
00319
00320         // error condition...
00321         default:
00322             // rollback one.  unrecognized format specifier.
00323             parseFrmChar--;
00324         }
00325
00326         // extra params? include them in the text surrounded by "[ ]"
00327         // (This is recommended, in case someone chooses to "hide" a
00328         //    message by doing "^FNsell yoyodyne stocks!^F" -- this code
00329         //    effectively "unhides" it, and is [yet again] recommended
00330         //    by the CTCP2 draft.)
00331
00332         parseFrmChar++;
00333         if (parseFrmChar < parseEndChar)
00334         {
00335             line->replace(parseFrmChar, parseEndChar - parseFrmChar,
00336                 std::string("\006[") +
00337                 line->substr(parseFrmChar, parseEndChar-parseFrmChar) +
00338                 std::string("]"));
00339
00340             parseEndChar = parseFrmChar;
00341         }
00342
00343         // save old end position
00344         parseStart = parseEndChar+1;
00345
00346         // got any more?
00347         parseFrmChar = line->find_first_of("\006", parseStart);
00348     };
00349
00350
00351
00352     // anything left?
00353     if (parseStart < line->length())
00354     {
00355         // last text segment is ready to push.
00356         segment = new std::string(line->substr(parseStart));
00357         PushOut();
00358         delete segment;
00359     }
00360 };
00361
00362 const CTCP2Parse::RGBColor CTCP2Parse::indexColor[16] = {
00363     Black, Blue, Green, Cyan, Red, Magenta, Yellow, Lt_Grey, Grey,
00364     Lt_Blue, Lt_Green, Lt_Cyan, Lt_Red, Lt_Magenta, Lt_Yellow, White
00365 };
00366
00367
00368
00369 #define CCOLOR (char)3  // ctr-c
00370 #define CCTCP2 (char)6  // ctr-f
00371 #define MIRC_TRANSPARENT    16
00372 #define isn(ch) ((ch) >= '0' && (ch) <= '9')
00373
00374
00375 const char
00376 mircAttrCvt::tokens[2] = {
00377     CCOLOR, 0
00378 };
00379
00380
00381 const char *
00382 mircAttrCvt::mirc2ctcpmap[17] = {
00383     "F",        // white
00384     "0",        // black
00385     "1",        // blue
00386     "2",        // green
00387     "C",        // bright red
00388     "#7F3F3F",  // brown   (not exactly red (7F0000))
00389     "5",        // purple
00390     "#FF7F00",  // orange  (definately not yellow (7F7F00))
00391     "E",        // bright yellow
00392     "A",        // bright green
00393     "3",        // cyan
00394     "B",        // bright cyan
00395     "9",        // bright blue
00396     "#FF7FC0",  // pink    (not really bright magenta (FF00FF))
00397     "8",        // grey
00398     "7",        // light grey
00399     "."     // return to default (^K99)
00400 };
00401
00402
00403 void
00404 mircAttrCvt::mirc2ctcp(std::string *in)
00405 {
00406     int col;
00407     char f[20];
00408     bool eqf, eqb;
00409     short oldfg, oldbg, fg = -1, bg = -1;
00410     int pos;
00411
00412     pos = in->find_first_of(tokens);
00413
00414     while (pos != std::string::npos)
00415     {
00416         oldfg = fg;
00417         oldbg = bg;
00418         col = extractcolor(in, pos+1, &fg, &bg);
00419         eqf = (oldfg == fg);
00420         eqb = (oldbg == bg);
00421
00422         if (col && (!eqf || !eqb))
00423         {
00424             // if the color hasn't changed, we insert a - which means
00425             // basically "ignore me"
00426             sprintf(f, "C%s%s",
00427                 eqf ? "-" : mirc2ctcpmap[fg],
00428                 eqb ? (eqf ? 0 : "-") : mirc2ctcpmap[bg]);
00429
00430             in->replace(pos, col+1,
00431                 std::string("") + CCTCP2 + f + CCTCP2);
00432             pos += (2 + strlen(f));   // consume the additions
00433         }
00434         else
00435         {
00436             in->replace(pos, 1, std::string("") + CCTCP2 + 'C' + CCTCP2);
00437             pos += 2;   // consume the additions
00438         }
00439         pos = in->find_first_of(tokens, pos);
00440     }
00441 };
00442
00443
00444 int
00445 mircAttrCvt::extractcolor (std::string *in, int start, short *fg, short *bg)
00446 {
00447     int ptr = start, len = in->length(), preColor;
00448
00449     if (ptr == len) return 0;
00450
00451     if (isn(in->at(ptr)))
00452     {
00453         // there's a foreground
00454
00455         if (ptr + 1 < len && isn(in->at(ptr + 1)))
00456         {
00457             // it's 2 digits
00458             preColor = (((in->at(ptr) - '0') * 10) + (in->at(ptr + 1) - '0'));
00459             if (preColor == 99) *fg = MIRC_TRANSPARENT;
00460             else *fg = preColor % 16;
00461             ptr += 2;
00462         }
00463         else
00464         {
00465             // it's 1 digit
00466             *fg = in->at(ptr) - '0';
00467             ptr++;
00468         }
00469         if (ptr + 1 < len && in->at(ptr) == ',' && isn(in->at(ptr + 1)))
00470         {
00471             // there's a background
00472             ptr++; // the comma
00473
00474             if (ptr + 1 < len && isn(in->at(ptr + 1)))
00475             {
00476                 // it's 2 digits
00477                 preColor = (((in->at(ptr) - '0') * 10) + (in->at(ptr + 1) - '0'));
00478                 if (preColor == 99) *bg = MIRC_TRANSPARENT;
00479                 else *bg = preColor % 16;
00480                 ptr += 2;
00481             }
00482             else
00483             {
00484                 // it's 1 digit
00485                 *bg = in->at(ptr) - '0';
00486                 ptr++;
00487             }
00488         }
00489     }
00490     return (ptr - start);
00491 };
00492
00493
00494 // ------------------------------ macro definitions -------------------
00495 #define CBOLD  (char)2  // ctr-b
00496 #define CCTCP2 (char)6  // ctr-f
00497 #define CSTOP  (char)15 // ctr-o
00498 #define CREV   (char)22 // ctr-v, reverse
00499 #define CUNDR  (char)31 // ctr-underscore
00500
00501
00502 const char irciiAttrCvt::tokens[5] = {
00503     CBOLD, CUNDR, CREV, CSTOP, 0
00504 };
00505
00506 void
00507 irciiAttrCvt::ircii2ctcp (std::string *in)
00508 {
00509     int pos, bold = 0, under = 0, rev = 0;
00510
00511     pos = in->find_first_of(tokens);
00512
00513     while (pos != std::string::npos)
00514     {
00515         switch (in->at(pos))
00516         {
00517         case CBOLD:
00518             bold = !bold;
00519             in->replace(pos, 1,
00520                 std::string("") + CCTCP2 + 'B' + (bold?'+':'-') + CCTCP2);
00521             pos += 3;   // consume the additions
00522             break;
00523
00524         case CUNDR:
00525             under = !under;
00526             in->replace(pos, 1,
00527                 std::string("") + CCTCP2 + 'U' + (under?'+':'-') + CCTCP2);
00528             pos += 3;   // consume the additions
00529             break;
00530
00531         case CREV:
00532             rev = !rev;
00533             in->replace(pos, 1,
00534                 std::string("") + CCTCP2 + 'V' + (rev?'+':'-') + CCTCP2);
00535             pos += 3;   // consume the additions
00536             break;
00537
00538         case CSTOP:
00539             bold = under = rev = 0;
00540             in->replace(pos, 1, std::string("") + CCTCP2 + 'N' + CCTCP2);
00541             pos += 2;   // consume the additions
00542         }
00543         pos = in->find_first_of(tokens,++pos);
00544     }
00545 }
00546
00547
00548 // See http://www.delorie.com/gnu/docs/screen/screen_48.html for a good list of ansi escapes.
00549 // We're not supporting everything, though.  Just the small bit about colors and cursor move right.
00550
00551
00552 #define INVALID_SEQUENCE    -1
00553 const char *ansiAttrCvt::AnsiSeq::_notOf = "1234567890=;";
00554
00555 ansiAttrCvt::AnsiSeq::AnsiSeq (std::string *in, int pos)
00556     : _seq(0), _verb(0)
00557 {
00558     int verbPos;
00559     int seqLen;
00560     int pos1, pos2;
00561
00562     verbPos = in->find_first_not_of(_notOf, pos + 2);
00563
00564     if (verbPos == std::string::npos || in->at(verbPos) == '\033')
00565     {
00566         _verb = INVALID_SEQUENCE;
00567         in->replace(pos, 2, "");
00568         return;
00569     }
00570
00571     seqLen = verbPos - pos - 1;
00572
00573     // get a copy of the ansi sequence without the "esc["
00574     _seq = new std::string(in->substr(pos + 2, seqLen));
00575
00576     // remove it from the original, now that we have the needed info
00577     in->replace(pos, verbPos - pos + 1, "");
00578
00579     // set the verb
00580     _verb = _seq->at(seqLen - 1);
00581
00582     for (pos1 = 0, pos2 = 0; pos2 < seqLen; pos2++)
00583     {
00584         if (_seq->at(pos2) != ';' && pos2 < (seqLen - 1)) continue;
00585         _params.push_back(atoi(_seq->substr(pos1, pos2 - pos1).c_str()));
00586         pos1 = pos2 + 1;
00587     }
00588
00589 }
00590
00591
00592 ansiAttrCvt::AnsiSeq::~AnsiSeq ()
00593 {
00594     if (_seq) delete _seq;
00595 }
00596
00597
00598 #define ANSI_SGM_TA_RESET   0
00599 #define ANSI_SGM_TA_BOLD    1
00600 #define ANSI_SGM_TA_FAINT   2
00601 #define ANSI_SGM_TA_ITALIC  3
00602 #define ANSI_SGM_TA_ULINE   4
00603 #define ANSI_SGM_TA_BLINK   5
00604 #define ANSI_SGM_TA_REV     7
00605 #define ANSI_SGM_TA_CONSEAL 8
00606 #define ANSI_SGM_TA_NORMAL  22
00607 #define ANSI_SGM_TA_ITALIC_OFF  23
00608 #define ANSI_SGM_TA_ULINE_OFF   24
00609 #define ANSI_SGM_TA_BLINK_OFF   25
00610 #define ANSI_SGM_TA_REV_OFF 27
00611
00612 #define ANSI_SGM_FC_BLK     30
00613 #define ANSI_SGM_FC_RED     31
00614 #define ANSI_SGM_FC_GRN     32
00615 #define ANSI_SGM_FC_YEL     33
00616 #define ANSI_SGM_FC_BLU     34
00617 #define ANSI_SGM_FC_MAG     35
00618 #define ANSI_SGM_FC_CYN     36
00619 #define ANSI_SGM_FC_WHT     37
00620 #define ANSI_SGM_FC_DEFAULT 39
00621
00622 #define ANSI_SGM_BC_BLK     40
00623 #define ANSI_SGM_BC_RED     41
00624 #define ANSI_SGM_BC_GRN     42
00625 #define ANSI_SGM_BC_YEL     43
00626 #define ANSI_SGM_BC_BLU     44
00627 #define ANSI_SGM_BC_MAG     45
00628 #define ANSI_SGM_BC_CYN     46
00629 #define ANSI_SGM_BC_WHT     47
00630 #define ANSI_SGM_BC_DEFAULT 49
00631
00632
00633 const char *ansiAttrCvt::escSeq = "\033\133";
00634
00635 void
00636 ansiAttrCvt::ansi2ctcp (std::string *in)
00637 {
00638     bold = underline = reverse = blink = italic = 0;
00639     _in = in;
00640
00641     pos = in->find(escSeq);
00642
00643     while (pos != std::string::npos)
00644     {
00645         _seq = new AnsiSeq(in, pos);
00646
00647         switch (_seq->verb())
00648         {
00649         case INVALID_SEQUENCE:
00650             break;
00651
00652         case 'm':       // set graphic mode
00653             do_m();
00654             break;
00655         case 'C':       // move cursor right
00656             do_C();
00657             break;
00658         case 'f':       // move to cursor position
00659         case 'H':       //          "
00660         case 'A':       // move cursor up
00661         case 'B':       // move cursor down
00662         case 'D':       // move cursor left
00663         case 's':       // save cursor position
00664         case 'u':       // restore cursor position
00665         case 'J':       // erase display and goto home
00666         case 'K':       // erase line
00667         case 'h':       // set display mode
00668         case 'l':       // reset display mode
00669         default:
00670             std::string errmsg(std::string ("[ansi error: '") + _seq->seq() +
00671                 "' sequence unsupported]");
00672             in->insert(pos, errmsg);
00673             pos += errmsg.length();
00674         }
00675         delete _seq;
00676         pos = in->find(escSeq, pos);
00677     }
00678 };
00679
00680 const char *ansiAttrCvt::fgColorMap[16] = {
00681     "C0-",      // Black
00682     "C4-",      // Red
00683     "C2-",      // Green
00684     "C6-",      // Yellow
00685     "C1-",      // Blue
00686     "C5-",      // Magenta
00687     "C3-",      // Cyan
00688     "C7-",      // Light Grey
00689     "C8-",      // Grey
00690     "CC-",      // Light Red
00691     "CA-",      // Light Green
00692     "CE-",      // Light Yellow
00693     "C9-",      // Light Blue
00694     "CD-",      // Light Magenta
00695     "CB-",      // Light Cyan
00696     "CF-"       // White
00697 };
00698
00699 const char *ansiAttrCvt::bgColorMap[8] = {
00700     "C-0",      // Black
00701     "C-4",      // Red
00702     "C-2",      // Green
00703     "C-6",      // Yellow
00704     "C-1",      // Blue
00705     "C-5",      // Magenta
00706     "C-3",      // Cyan
00707     "C-7"       // Light Grey
00708 };
00709
00710 void
00711 ansiAttrCvt::do_m ()
00712 {
00713     int i;
00714     for (i = 0; i < _seq->paramc(); i++)
00715     {
00716         switch (_seq->param(i))
00717         {
00718         // reset
00719         case ANSI_SGM_TA_RESET:
00720             bold = underline = reverse = blink = 0;
00721             _in->insert(pos, std::string("") + CCTCP2 + 'N' + CCTCP2);
00722             pos += 3;
00723             break;
00724
00725         // bold intensity
00726         case ANSI_SGM_TA_BOLD:
00727             if (!bold) bold = 1;
00728             break;
00729
00730         // bold intensity
00731         case ANSI_SGM_TA_FAINT:
00732             // TODO: what do I do for this ???
00733             break;
00734
00735         // bold + faint off (normal intensity)
00736         case ANSI_SGM_TA_NORMAL:
00737             if (bold) bold = 0;
00738             break;
00739
00740         // standout (italic)
00741         case ANSI_SGM_TA_ITALIC:
00742             if (!italic)
00743             {
00744                 italic = 1;
00745                 _in->insert(pos, std::string("") + CCTCP2 + "I+" + CCTCP2);
00746                 pos += 4;       // consume the additions
00747             }
00748             break;
00749
00750         // standout (italic) off
00751         case ANSI_SGM_TA_ITALIC_OFF:
00752             if (italic)
00753             {
00754                 italic = 0;
00755                 _in->insert(pos, std::string("") + CCTCP2 + "I-" + CCTCP2);
00756                 pos += 4;       // consume the additions
00757             }
00758             break;
00759
00760         // underline
00761         case ANSI_SGM_TA_ULINE:
00762             if (!underline)
00763             {
00764                 underline = 1;
00765                 _in->insert(pos, std::string("") + CCTCP2 + "U+" + CCTCP2);
00766                 pos += 4;       // consume the additions
00767             }
00768             break;
00769
00770         // underline off
00771         case ANSI_SGM_TA_ULINE_OFF:
00772             if (underline)
00773             {
00774                 underline = 0;
00775                 _in->insert(pos, std::string("") + CCTCP2 + "U-" + CCTCP2);
00776                 pos += 4;       // consume the additions
00777             }
00778             break;
00779
00780         // blink
00781         case ANSI_SGM_TA_BLINK:
00782             if (!blink)
00783             {
00784                 blink = 1;
00785                 _in->insert(pos, std::string("") + CCTCP2 + "K+" + CCTCP2);
00786                 pos += 4;   // consume additions.
00787             }
00788             break;
00789
00790         // blink off
00791         case ANSI_SGM_TA_BLINK_OFF:
00792             if (blink)
00793             {
00794                 blink = 0;
00795                 _in->insert(pos, std::string("") + CCTCP2 + "K-" + CCTCP2);
00796                 pos += 4;   // consume additions.
00797             }
00798             break;
00799
00800         // reverse
00801         case ANSI_SGM_TA_REV:
00802             if (!reverse)
00803             {
00804                 reverse = 1;
00805                 _in->insert(pos, std::string("") + CCTCP2 + "V+" + CCTCP2);
00806                 pos += 4;   // consume the additions
00807             }
00808             break;
00809
00810         // reverse off
00811         case ANSI_SGM_TA_REV_OFF:
00812             if (reverse)
00813             {
00814                 reverse = 0;
00815                 _in->insert(pos, std::string("") + CCTCP2 + "V-" + CCTCP2);
00816                 pos += 4;   // consume the additions
00817             }
00818             break;
00819
00820         // concealed
00821         case ANSI_SGM_TA_CONSEAL:
00822             // TODO: wtf is this?  make foreground same color as back?
00823             break;
00824
00825         case ANSI_SGM_FC_BLK:
00826         case ANSI_SGM_FC_RED:
00827         case ANSI_SGM_FC_GRN:
00828         case ANSI_SGM_FC_YEL:
00829         case ANSI_SGM_FC_BLU:
00830         case ANSI_SGM_FC_MAG:
00831         case ANSI_SGM_FC_CYN:
00832         case ANSI_SGM_FC_WHT:
00833             _in->insert(pos, std::string("") + CCTCP2 +
00834                 fgColorMap[_seq->param(i) - 30 + (bold ? 8 : 0)] +
00835                 CCTCP2);
00836             pos += 5;       // consume the additions
00837             break;
00838
00839         case ANSI_SGM_FC_DEFAULT:
00840             _in->insert(pos, std::string("") + CCTCP2 + "C.-" + CCTCP2);
00841             pos += 5;       // consume the additions
00842             break;
00843
00844         case ANSI_SGM_BC_BLK:
00845         case ANSI_SGM_BC_RED:
00846         case ANSI_SGM_BC_GRN:
00847         case ANSI_SGM_BC_YEL:
00848         case ANSI_SGM_BC_BLU:
00849         case ANSI_SGM_BC_MAG:
00850         case ANSI_SGM_BC_CYN:
00851         case ANSI_SGM_BC_WHT:
00852             _in->insert(pos, std::string("") +
00853                 CCTCP2 + bgColorMap[_seq->param(i) - 40] + CCTCP2);
00854             pos += 5;       // consume the additions
00855             break;
00856
00857         case ANSI_SGM_BC_DEFAULT:
00858             _in->insert(pos, std::string("") + CCTCP2 + "C-." + CCTCP2);
00859             pos += 5;       // consume the additions
00860             break;
00861
00862         }
00863     }
00864 }
00865
00866
00867 void
00868 ansiAttrCvt::do_C ()
00869 {
00870     for (int i = 0; i < _seq->param(_seq->paramc() - 1); i++)
00871         _in->insert(pos++, " ");
00872 }
Generated on Sun Feb 24 01:21:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CTCP2Parse.hpp Source File

common/CTCP2Parse.hpp

Go to the documentation of this file.
00001 /*
00002  ------------------------------------------------------------------------------
00003  * CTCP2Parse.hpp --
00004  *
00005  *  a C++ implementation of the Text attribute section of the CTCP/2
00006  *  draft by Robey Pointer (that eggdrop dude) and friends.  This code
00007  *  is based directly from Robey's Java example.  This code includes
00008  *  full support for decoding mIrc, ANSI, and ircII attributes as well.
00009  *
00010  *  See -+-> http://www.lag.net/~robey/ctcp
00011  *       +-> http://www.egroups.com/group/ctcp2
00012  *
00013  *  Depends: STL string template, no OS specifics.
00014  *
00015  *  This source is under BSD license and has no restrictions the way
00016  *  the GPL does.  Sell it for all I care.  Just be nice and give me
00017  *  credit for it.  Although it's not a requirement.
00018  *
00019  *  Author: David Gravereaux <davygrvy@pobox.com>
00020  *      Tomahawk Software Group
00021  *
00022  *  Conversion routines donated by Keith Lea <keith@cs.oswego.edu>
00023  *
00024  * RCS: @(#) $Id: CTCP2Parse.hpp,v 1.4 2001/02/04 10:19:57 davygrvy Exp $
00025  ------------------------------------------------------------------------------
00026  */
00027
00028
00029 #ifndef Inc_CTCP2Parse_hpp__
00030 #define Inc_CTCP2Parse_hpp__
00031
00032 #include <string>
00033 #include <vector>
00034
00035
00036 // mIrc to CTCP/2 attribute convertor
00037 class mircAttrCvt
00038 {
00039 public:
00040     void mirc2ctcp(std::string *in);
00041 private:
00042     static const char tokens[2];
00043     static const char *mirc2ctcpmap[17];
00044     int extractcolor (std::string *in, int start, short *fg, short *bg);
00045 };
00046
00047
00048 // ircII to CTCP/2 attribute convertor
00049 class irciiAttrCvt
00050 {
00051 public:
00052     void ircii2ctcp(std::string *in);
00053 private:
00054     static const char tokens[5];
00055 };
00056
00057
00058 // ANSI escape sequences to CTCP/2 attribute convertor
00059 class ansiAttrCvt
00060 {
00061 public:
00062     void ansi2ctcp(std::string *in);
00063 private:
00064     void do_m ();
00065     void do_C ();
00066
00067     const static char *escSeq;
00068     const static char *fgColorMap[16];
00069     const static char *bgColorMap[8];
00070
00071     int pos;
00072     int bold, underline, reverse, blink, italic;
00073
00074     std::string *_in;
00075
00076     //  A simple ansi escape sequence extractor class
00077     class AnsiSeq
00078     {
00079         std::string *_seq;
00080         std::vector<int> _params;
00081         char _verb;
00082         static const char *_notOf;
00083
00084     public:
00085         AnsiSeq (std::string *in, int pos);
00086         ~AnsiSeq ();
00087
00088         char verb () { return _verb; }
00089         const char *seq () { return _seq->c_str(); }
00090         int paramc () { return _params.size(); }
00091         int param (int index) { return _params[index]; }
00092     };
00093
00094     AnsiSeq *_seq;
00095 };
00096
00097
00098 // CTCP/2 embedded attribute parser and action invoker.
00099 //
00100 class CTCP2Parse : protected mircAttrCvt, irciiAttrCvt, ansiAttrCvt
00101 {
00102 protected:
00103     // encoding flags.
00104     enum EncodingType
00105     {
00106         iso8859_1, iso8859_2, iso8859_3, iso8859_4, iso8859_5, iso8859_6,
00107         iso8859_7, iso8859_8, iso8859_9, UTF_8
00108     };
00109
00110     // Character spacing.
00111     enum CharSpacingType { Fixed, Proportional };
00112
00113     // 24-bit colors (initialized here as integers for clarity)
00114     enum ColorType
00115     {
00116         Black      = 0x000000,
00117         Blue       = 0x00007F,
00118         Green      = 0x007F00,
00119         Cyan       = 0x007F7F,
00120         Red        = 0x7F0000,
00121         Magenta    = 0x7F007F,
00122         Yellow     = 0x7F7F00,
00123         Lt_Grey    = 0xC0C0C0,
00124         Grey       = 0x7F7F7F,
00125         Lt_Blue    = 0x0000FF,
00126         Lt_Green   = 0x00FF00,
00127         Lt_Cyan    = 0x00FFFF,
00128         Lt_Red     = 0xFF0000,
00129         Lt_Magenta = 0xFF00FF,
00130         Lt_Yellow  = 0xFFFF00,
00131         White      = 0xFFFFFF
00132     };
00133
00134     CTCP2Parse();
00135
00136     void SetDefaults (
00137         unsigned char fgR = (unsigned char) ((Lt_Grey & 0xFF0000) >> 16),
00138         unsigned char fgG = (unsigned char) ((Lt_Grey & 0x00FF00) >> 8),
00139         unsigned char fgB = (unsigned char) (Lt_Grey & 0x0000FF),       // default foreground color.
00140
00141         unsigned char bgR = (unsigned char) ((Black & 0xFF0000) >> 16),
00142         unsigned char bgG = (unsigned char) ((Black & 0x00FF00) >> 8),
00143         unsigned char bgB = (unsigned char) (Black & 0x0000FF),     // default background color.
00144
00145         CharSpacingType cpDef_ = Fixed,     // default spacing.
00146         EncodingType encDef_ = iso8859_1    // default encoding.
00147         );
00148
00149     void ParseIt(std::string *line);
00150
00151     virtual void PushStart () = 0;
00152     virtual void PushBold (bool) = 0;
00153     virtual void PushReverse (bool) = 0;
00154     virtual void PushUnderline (bool) = 0;
00155     virtual void PushOverstrike (bool) = 0;
00156     virtual void PushItalic (bool) = 0;
00157     virtual void PushBlink (bool) = 0;
00158     virtual void PushURL (bool) = 0;
00159     virtual void PushEncoding (EncodingType) = 0;
00160     virtual void PushSpacing (CharSpacingType) = 0;
00161     virtual void PushFontSize (int) = 0;
00162     virtual void PushForegroundColor (unsigned char R, unsigned char G, unsigned char B) = 0;
00163     virtual void PushBackgroundColor (unsigned char R, unsigned char G, unsigned char B) = 0;
00164     virtual void PushTextSegment (std::string *) = 0;
00165
00166 private:
00167     typedef struct
00168     {
00169         union
00170         {
00171             // don't assume the sizeof(int)
00172             __int32 RGB;
00173             struct
00174             {
00175 #ifdef _M_IX86  /* little endien */
00176                 unsigned char B;
00177                 unsigned char G;
00178                 unsigned char R;
00179                 unsigned char nul_void_ignore;
00180 #else           /* big endien */
00181                 unsigned char nul_void_ignore;
00182                 unsigned char R;
00183                 unsigned char G;
00184                 unsigned char B;
00185 #endif
00186             };
00187         };
00188     } RGBColor;
00189
00190     inline void decodeToggle (std::string *line, int *parseFrmChar, int *parseEndChar, int *varCnt)
00191     {
00192         (*parseFrmChar)++;   // consume the attribute
00193         if (*parseFrmChar < *parseEndChar)
00194         {
00195             if (line->at(*parseFrmChar) == '+')
00196             {
00197                 (*varCnt)++;
00198                 (*parseFrmChar)++;   // consume the '+'
00199             }
00200             else if (line->at(*parseFrmChar) == '-')
00201             {
00202                 if ((*varCnt) > 0)
00203                     (*varCnt)--;
00204                 (*parseFrmChar)++;   // consume the '-'
00205             }
00206         }
00207         else
00208             (*varCnt)++;  // default to a '+'
00209     }
00210
00211     inline int decodeColor
00212         (std::string *line, int *parseFrmChar, int *parseEndChar, RGBColor *c)
00213     {
00214         if (line->at(*parseFrmChar) == '#')
00215         {
00216             (*parseFrmChar)++;   // consume it
00217             if (*parseFrmChar + 6 <= *parseEndChar)
00218             {
00219                 unsigned char C = 0;
00220
00221                 c->RGB = 0;     // start with a clean plate
00222
00223                 // hi-byte red
00224                 if (!fromHex(line->at(*parseFrmChar), &C)) return 3;
00225                 (*parseFrmChar)++;  // consume the hex character
00226                 c->R |= (C << 4);
00227
00228                 // lo-byte red
00229                 if (!fromHex(line->at(*parseFrmChar), &C)) return 4;
00230                 (*parseFrmChar)++;  // consume the hex character
00231                 c->R |= C;
00232
00233                 // hi-byte green
00234                 if (!fromHex(line->at(*parseFrmChar), &C)) return 5;
00235                 (*parseFrmChar)++;  // consume the hex character
00236                 c->G |= (C << 4);
00237
00238                 // lo-byte green
00239                 if (!fromHex(line->at(*parseFrmChar), &C)) return 6;
00240                 (*parseFrmChar)++;  // consume the hex character
00241                 c->G |= C;
00242
00243                 // hi-byte blue
00244                 if (!fromHex(line->at(*parseFrmChar), &C)) return 7;
00245                 (*parseFrmChar)++;  // consume the hex character
00246                 c->B |= (C << 4);
00247
00248                 // lo-byte blue
00249                 if (!fromHex(line->at(*parseFrmChar), &C)) return 8;
00250                 (*parseFrmChar)++;  // consume the hex character
00251                 c->B |= C;
00252             } else {
00253                 // rollback the error...
00254                 return 3;
00255             }
00256         } else {
00257             unsigned char index = 0;
00258             if (!fromHex(line->at(*parseFrmChar), &index)) return 3;
00259             (*parseFrmChar)++;  // consume the hex character
00260             c->RGB = indexColor[index].RGB;
00261         }
00262         return 0;
00263     }
00264
00265     inline int fromHex(unsigned char h, unsigned char *val)
00266     {
00267         // 0 - 9
00268         if (h > 47 && h < 58) *val = (h - 48);
00269         // A - F
00270         else if (h > 64 && h < 71) *val = (h - 55);
00271         else return 0;   // throw a little conversion exception
00272         return 1;
00273     }
00274
00275     inline void PushOut (void)
00276     {
00277         // notify the derived class, we are about to start a new attribute set.
00278         PushStart();
00279
00280         // never push-out ALL the attributes -- only the CHANGED ones.
00281
00282         if ((boldCnt > 0) ^ boldLast) PushBold (boldLast = !boldLast ? true : false);
00283         if ((revCnt > 0) ^ revLast) PushReverse (revLast = !revLast ? true : false);
00284         if ((underCnt > 0) ^ underLast) PushUnderline (underLast = !underLast ? true : false);
00285         if ((overCnt > 0) ^ overLast) PushOverstrike (overLast = !overLast ? true : false);
00286         if ((italicCnt > 0) ^ italicLast) PushItalic (italicLast = !italicLast ? true : false);
00287         if ((blinkCnt > 0) ^ blinkLast) PushBlink (blinkLast = !blinkLast ? true : false);
00288         if ((urlCnt > 0) ^ urlLast) PushURL (urlLast = !urlLast ? true : false);
00289         if (enc ^ encLast) PushEncoding (encLast = enc);
00290         if (cp ^ cpLast) PushSpacing (cpLast = cp);
00291         if (fntSize ^ fntLast) PushFontSize (fntLast = fntSize);
00292
00293         if (fg.RGB ^ fgLast.RGB)
00294         {
00295             fgLast.RGB = fg.RGB;
00296             PushForegroundColor(fg.R, fg.G, fg.B);
00297         }
00298         if (bg.RGB ^ bgLast.RGB)
00299         {
00300             bgLast.RGB = bg.RGB;
00301             PushBackgroundColor(bg.R, bg.G, bg.B);
00302         }
00303
00304         PushTextSegment(segment);
00305     }
00306
00307     static const RGBColor indexColor[16];   // Array for indexing the color values
00308     EncodingType enc, encLast, encDef;  // storage for the encoding type
00309
00310     // storage for the toggle states
00311     int boldCnt,  revCnt,  overCnt,  underCnt,  italicCnt,  blinkCnt,  urlCnt;
00312     int boldLast, revLast, overLast, underLast, italicLast, blinkLast, urlLast;
00313     int fntSize, fntLast;
00314
00315     CharSpacingType cp, cpLast, cpDef;  // storage for font spacing type
00316
00317     RGBColor    fg, fgLast, fgDef, bg, bgLast, bgDef;
00318
00319     std::string *segment;
00320 };
00321
00322 #endif
Generated on Sun Feb 24 01:21:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CvsAlert.cpp Source File

common/CvsAlert.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 // CvsAlert.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025
00026 #ifdef macintosh
00027 #   define kDlgIdAlert 129
00028 #   include <Dialogs.h>
00029 #   include <TextUtils.h>
00030 #   include <string.h>
00031 #   include "MacMisc.h"
00032 #endif /* macintosh */
00033
00034 #if qUnix
00035 #   include "UCvsDialogs.h"
00036 #endif
00037
00038 #ifdef WIN32
00039 #   include "resource.h"
00040
00041 #   ifdef _DEBUG
00042 #   define new DEBUG_NEW
00043 #   undef THIS_FILE
00044     static char THIS_FILE[] = __FILE__;
00045 #   endif
00046 #endif /* WIN32 */
00047
00048 #include "CvsAlert.h"
00049
00050 #ifdef WIN32
00051
00052 // CCVSAlert dialog
00053
00054
00055 CCVSAlert::CCVSAlert(const char *prompt, const char *defhit, const char *cnclhit,
00056                      CWnd* pParent /*=NULL*/)
00057     : CDialog(CCVSAlert::IDD, pParent)
00058 {
00059     //{{AFX_DATA_INIT(CCVSAlert)
00060     m_prompt = prompt != NULL ? prompt : "";
00061     m_cnclhit = cnclhit != NULL ? cnclhit : "";
00062     m_defhit = defhit != NULL ? defhit : "";
00063     //}}AFX_DATA_INIT
00064 }
00065
00066
00067 void CCVSAlert::DoDataExchange(CDataExchange* pDX)
00068 {
00069     CDialog::DoDataExchange(pDX);
00070     //{{AFX_DATA_MAP(CCVSAlert)
00071     DDX_Text(pDX, IDC_ALRTMSG, m_prompt);
00072     DDX_Text(pDX, IDCANCEL, m_cnclhit);
00073     DDX_Text(pDX, IDOK, m_defhit);
00074     //}}AFX_DATA_MAP
00075 }
00076
00077
00078 BEGIN_MESSAGE_MAP(CCVSAlert, CDialog)
00079     //{{AFX_MSG_MAP(CCVSAlert)
00080         // NOTE: the ClassWizard will add message map macros here
00081     //}}AFX_MSG_MAP
00082 END_MESSAGE_MAP()
00083
00085 // CCVSAlert message handlers
00086 #endif /* WIN32 */
00087
00088 #ifdef macintosh
00089     static const char *sPrompt = 0L, *sDefhit = 0L, *sCnclhit = 0L;
00090
00091     static pascal Boolean AlertModalFilter(DialogPtr dlog, EventRecord *event, short *itemHit)
00092     {
00093         DialogPtr evtDlog;
00094         short selStart,selEnd;
00095
00096         if (event->what == activateEvt && (event->modifiers & activeFlag) != 0)
00097         {
00098             Str255 pp, pd, pc;
00099             c2pstrcpy(pp, sPrompt);
00100             c2pstrcpy(pd, sDefhit);
00101             c2pstrcpy(pc, sCnclhit);
00102
00103             SetControlTitle(GetDItemCtrlHdl(dlog, 1), pd);
00104             SetControlTitle(GetDItemCtrlHdl(dlog, 2), pc);
00105             SetDialogItemText(GetDItemHdl(dlog, 3), pp);
00106         }
00107
00108         return false;          // For all non-keyDown events
00109     }
00110 #endif /* macintosh */
00111
00112 #if qUnix
00113 class UAskYesNo : public UWidget
00114 {
00115     UDECLARE_DYNAMIC(UAskYesNo)
00116 public:
00117     UAskYesNo() : UWidget(::UEventGetWidID()) {}
00118     virtual ~UAskYesNo() {}
00119
00120     enum
00121     {
00122         kOK = EV_COMMAND_START, // 0
00123         kCancel,                // 1
00124         kText                   // 2
00125     };
00126
00127 protected:
00128     ev_msg int OnOK(void);
00129     ev_msg int OnCancel(void);
00130
00131     UDECLARE_MESSAGE_MAP()
00132 };
00133
00134 UIMPLEMENT_DYNAMIC(UAskYesNo, UWidget)
00135
00136 UBEGIN_MESSAGE_MAP(UAskYesNo, UWidget)
00137     ON_UCOMMAND(UAskYesNo::kOK, UAskYesNo::OnOK)
00138     ON_UCOMMAND(UAskYesNo::kCancel, UAskYesNo::OnCancel)
00139 UEND_MESSAGE_MAP()
00140
00141 int UAskYesNo::OnOK(void)
00142 {
00143     EndModal(true);
00144     return 0;
00145 }
00146
00147 int UAskYesNo::OnCancel(void)
00148 {
00149     EndModal(false);
00150     return 0;
00151 }
00152 #endif
00153
00154 bool CvsAlert(const char *prompt, const char *defhit, const char *cnclhit)
00155 {
00156 #ifdef WIN32
00157     CCVSAlert gv(prompt, defhit, cnclhit);
00158     return gv.DoModal() == IDOK;
00159 #endif /* WIN32 */
00160 #ifdef macintosh
00161     static ModalFilterUPP filter = NULL;
00162
00163     if(filter == NULL)
00164         filter = NewModalFilterUPP(AlertModalFilter);
00165
00166     sPrompt = prompt;
00167     sDefhit = defhit;
00168     sCnclhit = cnclhit;
00169
00170     return CautionAlert(kDlgIdAlert, filter) == 1;
00171 #endif /* macintosh */
00172 #if qUnix
00173     void *wid = UCreate_AskYesNo();
00174
00175     UAskYesNo *dlg = new UAskYesNo();
00176     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00177     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, kUMainWidget, (void *)"Alert");
00178     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, UAskYesNo::kOK, (void *)defhit);
00179     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, UAskYesNo::kCancel, (void *)cnclhit);
00180     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, UAskYesNo::kText, (void *)prompt);
00181
00182     bool res = dlg->DoModal();
00183     delete dlg;
00184     return res;
00185 #endif
00186 }
Generated on Sun Feb 24 01:21:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CvsAlert.h Source File

common/CvsAlert.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 // CvsAlert.h : header file
00022 //
00023
00024 #if !defined(AFX_CVSALERT_H__ACFE8C41_9836_11D1_AE50_00C0F0067852__INCLUDED_)
00025 #define AFX_CVSALERT_H__ACFE8C41_9836_11D1_AE50_00C0F0067852__INCLUDED_
00026
00027 #if _MSC_VER >= 1000
00028 #pragma once
00029 #endif // _MSC_VER >= 1000
00030
00031 bool CvsAlert(const char *prompt, const char *defhit, const char *cnclhit);
00032     // return true if defhit is hit.
00033
00034 #ifdef WIN32
00035
00036 // CCVSAlert dialog
00037
00038 class CCVSAlert : public CDialog
00039 {
00040 // Construction
00041 public:
00042     CCVSAlert(const char *prompt, const char *defhit, const char *cnclhit,
00043         CWnd* pParent = NULL);   // standard constructor
00044
00045 // Dialog Data
00046     //{{AFX_DATA(CCVSAlert)
00047     enum { IDD = IDD_ALERT };
00048     CString m_prompt;
00049     CString m_defhit;
00050     CString m_cnclhit;
00051     //}}AFX_DATA
00052
00053
00054 // Overrides
00055     // ClassWizard generated virtual function overrides
00056     //{{AFX_VIRTUAL(CCVSAlert)
00057     protected:
00058     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00059     //}}AFX_VIRTUAL
00060
00061 // Implementation
00062 protected:
00063
00064     // Generated message map functions
00065     //{{AFX_MSG(CCVSAlert)
00066         // NOTE: the ClassWizard will add member functions here
00067     //}}AFX_MSG
00068     DECLARE_MESSAGE_MAP()
00069 };
00070
00071 //{{AFX_INSERT_LOCATION}}
00072 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00073 #endif /* WIN32 */
00074
00075 #endif // !defined(AFX_CVSALERT_H__ACFE8C41_9836_11D1_AE50_00C0F0067852__INCLUDED_)
Generated on Sun Feb 24 01:21:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CvsArgs.cpp Source File

common/CvsArgs.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * CvsArgs.cpp --- class to handle cvs arguments
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #include <stdlib.h>
00028 #include <string.h>
00029
00030 #include "CvsPrefs.h"
00031 #include "CvsArgs.h"
00032 #include "AppConsole.h"
00033 #include "Authen.h"
00034
00035 #ifdef WIN32
00036 #   ifdef _DEBUG
00037 #   define new DEBUG_NEW
00038 #   undef THIS_FILE
00039     static char THIS_FILE[] = __FILE__;
00040 #   endif
00041 #endif /* WIN32 */
00042
00043 static char *mystrdup(const char *string)
00044 {
00045     int size = strlen(string);
00046     char *result = (char *)malloc((size + 1) * sizeof(char));
00047     if(result == NULL)
00048     {
00049         cvs_err("Impossible to allocate %d bytes !\n", size + 1);
00050         exit(1);
00051     }
00052     strcpy(result, string);
00053     return result;
00054 }
00055
00056 CvsArgs::CvsArgs(bool defargs)
00057 {
00058     argv = NULL;
00059     argc = 0;
00060
00061     reset(defargs);
00062 }
00063
00064 CvsArgs::CvsArgs(char * const *fromargv, int fromargc)
00065 {
00066     argv = NULL;
00067     argc = 0;
00068
00069     reset(false);
00070
00071     for(int i = 0; i < fromargc; i++)
00072     {
00073         add(fromargv[i]);
00074     }
00075 }
00076
00077 CvsArgs::~CvsArgs()
00078 {
00079     reset(false);
00080 }
00081
00082 void CvsArgs::reset(bool defargs)
00083 {
00084     if(argv != 0L)
00085     {
00086         for(int i = 0; i < argc; i++)
00087         {
00088             if(argv[i] != 0L)
00089                 free(argv[i]);
00090         }
00091         free(argv);
00092     }
00093
00094     argc = 0;
00095     argv = NULL;
00096
00097     if(defargs)
00098     {
00099         int numargs = 1;
00100
00101         if(gCvsPrefs.Z9Option())
00102             numargs++;
00103         if(gCvsPrefs.QuietOption())
00104             numargs++;
00105         if(gCvsPrefs.EncryptCommunication() && gAuthen.kind() == gserver)
00106             numargs++;
00107         if(gCvsPrefs.AlwaysUseCvsroot())
00108             numargs += 2;
00109
00110         argv = (char **)malloc(numargs * sizeof(char *));
00111         argv[argc++] = mystrdup("cvs");
00112         if(gCvsPrefs.AlwaysUseCvsroot())
00113         {
00114             argv[argc++] = mystrdup("-d");
00115             CStr root;
00116             const char *ccvsroot = gCvsPrefs;
00117             ccvsroot = Authen::skiptoken(ccvsroot);
00118             root = gAuthen.token();
00119             root << ccvsroot;
00120             argv[argc++] = mystrdup(root);
00121         }
00122         if(gCvsPrefs.Z9Option())
00123         {
00124             CStr zlev("-z");
00125             zlev << gCvsPrefs.ZLevel();
00126             argv[argc++] = mystrdup(zlev);
00127         }
00128         if(gCvsPrefs.QuietOption())
00129             argv[argc++] = mystrdup("-q");
00130         if(gCvsPrefs.EncryptCommunication() && gAuthen.kind() == gserver)
00131             argv[argc++] = mystrdup("-x");
00132     }
00133 }
00134
00135 // reduce a long string for printing, add "..." if the length
00136 // is up the limit
00137 #define MAX_PRINT_ARG 80
00138 static char *reduceString(const char *str, CStaticAllocT<char> & buf)
00139 {
00140     buf.AdjustSize(MAX_PRINT_ARG + 4); // "..." + '\0'
00141     size_t len = strlen(str);
00142     if(len < MAX_PRINT_ARG)
00143     {
00144         strcpy(buf, str);
00145     }
00146     else
00147     {
00148         memcpy((char *)buf, str, MAX_PRINT_ARG * sizeof(char));
00149         char *tmp = (char *)buf + MAX_PRINT_ARG;
00150         *tmp++ = '.';
00151         *tmp++ = '.';
00152         *tmp++ = '.';
00153         *tmp = '\0';
00154     }
00155
00156     return buf;
00157 }
00158
00159 // replace \n by "\n" so it's readable
00160 static char *expandLF(const char *str, CStaticAllocT<char> & buf)
00161 {
00162     int numLFs = 0;
00163     const char *runner = str;
00164     while((runner = strchr(runner, '\n')) != 0L)
00165     {
00166         numLFs++;
00167         runner++;
00168     }
00169
00170     size_t len = strlen(str);
00171     buf.AdjustSize(len + numLFs + 1); // numLFs * "\n" + '\0'
00172
00173     char *tmp = buf;
00174     char c;
00175     runner = str;
00176     while((c = *runner++) != '\0')
00177     {
00178         if(c == '\n')
00179         {
00180             *tmp++ = '\\';
00181             *tmp++ = 'n';
00182         }
00183         else
00184             *tmp++ = c;
00185     }
00186     *tmp++ = '\0';
00187
00188     return buf;
00189 }
00190
00191 static CStaticAllocT<char> buf;
00192
00193 void CvsArgs::print(const char *indirectory)
00194 {
00195     static CStaticAllocT<char> buf;
00196
00197     for(int i = 0; i < argc; i++)
00198     {
00199         CStr newarg;
00200         newarg = argv[i];
00201         bool hasLF = strchr(newarg, '\n') != 0L;
00202         size_t len = newarg.length();
00203
00204         if(len > MAX_PRINT_ARG)
00205             newarg = reduceString(newarg, buf);
00206
00207         if(hasLF)
00208             newarg = expandLF(newarg, buf);
00209
00210         bool hasSpace = strchr(newarg, ' ') != 0L;
00211         if(hasSpace)
00212             cvs_out("\"");
00213         cvs_outstr(newarg, newarg.length());
00214         if(hasSpace)
00215             cvs_out("\"");
00216         cvs_out(" ");
00217     }
00218     if(indirectory != NULL)
00219         cvs_out("(in directory %s)", indirectory);
00220     cvs_out("\n");
00221 }
00222
00223 void CvsArgs::add(const char *arg)
00224 {
00225     if(argv == 0L)
00226         argv = (char **)malloc(2 * sizeof(char *));
00227     else
00228         argv = (char **)realloc(argv, (argc + 2) * sizeof(char *));
00229     argv[argc++] = arg != 0L ? mystrdup(arg) : 0L;
00230     argv[argc] = 0L;
00231 }
00232
00233 void CvsArgs::addfile(const char *arg, const char * /*dir*/, const UFSSpec * /*spec*/)
00234 {
00235     add(arg);
00236 }
Generated on Sun Feb 24 01:21:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CvsArgs.h Source File

common/CvsArgs.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * CvsArgs.h --- class to handle cvs arguments
00023  */
00024
00025 #ifndef CVSARGS_H
00026 #define CVSARGS_H
00027
00028 #include "TextBinary.h"
00029
00030 class CvsArgs
00031 {
00032 public :
00033     CvsArgs(bool defargs = true);
00034         // append "cvs" and misc options
00035         // defined by preferences ("-z9" for example)
00036     CvsArgs(char * const *fromargv, int fromargc);
00037     virtual ~CvsArgs();
00038
00039     // add arguments
00040     virtual void add(const char *arg);
00041     virtual void addfile(const char *arg, const char *dir = 0L,
00042         const UFSSpec *spec = 0L);
00043
00044     void reset(bool defargs = true);
00045         // see the constructor
00046
00047     void print(const char *indirectory = 0L);
00048         // print the command line to the console
00049
00050     char * const *Argv(void) const {return argv;}
00051     int Argc(void) const {return argc;}
00052 protected:
00053     char **argv;
00054     int argc;
00055 };
00056
00057 #endif /* CVSPREFS_H */
Generated on Sun Feb 24 01:21:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CvsCommands.cpp Source File

common/CvsCommands.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * CvsCommands.cpp --- set of CVS commands
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #include <errno.h>
00028
00029 #ifdef WIN32
00030 #   include "wincvs.h"
00031
00032 #   ifdef _DEBUG
00033 #   define new DEBUG_NEW
00034 #   undef THIS_FILE
00035     static char THIS_FILE[] = __FILE__;
00036 #   endif
00037 #endif /* WIN32 */
00038
00039 #include "CvsCommands.h"
00040 #include "CvsPrefs.h"
00041 #include "Authen.h"
00042 #include "CvsArgs.h"
00043 #include "MultiFiles.h"
00044 #include "PromptFiles.h"
00045 #include "AppConsole.h"
00046 #include "AppGlue.h"
00047 #include "MoveToTrash.h"
00048 #include "LineCmd.h"
00049 #include "CvsAlert.h"
00050 #include "TextBinary.h"
00051 #include "CommitDlg.h"
00052 #include "ImportDlg.h"
00053 #include "CheckoutDlg.h"
00054 #include "TclGlue.h"
00055 #include "ImportFilterDlg.h"
00056 #include "UpdateDlg.h"
00057 #include "LogDlg.h"
00058 #include "DiffDlg.h"
00059 #include "LogParse.h"
00060 #include "RtagDlg.h"
00061 #include "TagDlg.h"
00062 #include "InitDlg.h"
00063 #include "ReleaseDlg.h"
00064 #include "AnnotateDlg.h"
00065
00066 #ifdef qMacCvsPP
00067 #   include "AppGlue.mac.h"
00068 #endif
00069
00070 // - clean up the log message for the server.
00071 // - put the good line feeds
00072 // - TODO mac : ISO conversion
00073 char *cleanUpLogMsg(const char *msg)
00074 {
00075     static CStaticAllocT<char> buf;
00076
00077     size_t len = strlen(msg);
00078     buf.AdjustSize(len + 1);
00079
00080     char *tmp = buf;
00081     char c;
00082     while((c = *msg++) != '\0')
00083     {
00084 #ifdef WIN32
00085         if(c == '\r')
00086             continue;
00087 #endif /* WIN32 */
00088 #ifdef macintosh
00089         if(c == '\r')
00090             c = '\n';
00091 #endif /* macintosh */
00092         *tmp++ = c;
00093     }
00094     *tmp++ = '\0';
00095
00096     return buf;
00097 }
00098
00099 void
00100 CvsCmdUpdateFolder(const char *dir, bool queryOnly)
00101 {
00102     if(gCvsPrefs.empty())
00103         return;
00104
00105     if(dir == 0L)
00106         dir = BrowserGetDirectory("Select a directory to update :");
00107     if(dir == 0L)
00108         return;
00109
00110     bool toStdout;
00111     bool noRecurs;
00112     bool resetSticky;
00113     CPStr date;
00114     CPStr rev;
00115     bool useMostRecent;
00116     CPStr rev1;
00117     CPStr rev2;
00118     bool createMissDir;
00119     bool getCleanCopy;
00120
00121     if(!queryOnly && !CompatGetUpdate(toStdout, noRecurs, resetSticky,
00122         date, rev, useMostRecent, rev1, rev2, createMissDir, getCleanCopy))
00123         return;
00124
00125     CvsArgs args;
00126     if(queryOnly)
00127         args.add("-n");
00128     args.add("update");
00129     if(gCvsPrefs.PruneOption())
00130         args.add("-P");
00131
00132     if(!queryOnly)
00133     {
00134         if(resetSticky)
00135             args.add("-A");
00136         if(createMissDir)
00137             args.add("-d");
00138         if(getCleanCopy)
00139             args.add("-C");
00140         if(!date.empty())
00141         {
00142             args.add("-D");
00143             args.add(date);
00144         }
00145         if(useMostRecent)
00146             args.add("-f");
00147         if(!rev1.empty())
00148         {
00149             CPStr tmp;
00150             tmp = "-j";
00151             tmp << rev1;
00152             args.add(tmp);
00153         }
00154         if(!rev2.empty())
00155         {
00156             CPStr tmp;
00157             tmp = "-j";
00158             tmp << rev2;
00159             args.add(tmp);
00160         }
00161         if(noRecurs)
00162             args.add("-l");
00163         if(toStdout)
00164             args.add("-p");
00165         if(!rev.empty())
00166         {
00167             args.add("-r");
00168             args.add(rev);
00169         }
00170     }
00171
00172     args.print(dir);
00173     launchCVS(dir, args.Argc(), args.Argv());
00174 }
00175
00176 void
00177 CvsCmdCommitFolder(const char *dir)
00178 {
00179     if(gCvsPrefs.empty())
00180         return;
00181
00182     if(dir == 0L)
00183         dir = BrowserGetDirectory("Select a directory to commit :");
00184     if(dir == 0L)
00185         return;
00186
00187     bool norecurs;
00188     CStr logmsg;
00189     bool forceCommit;
00190     bool forceRecurse;
00191     CPStr rev;
00192     bool noModuleProgram;
00193     bool checkValidEdits;
00194
00195     if( !CompatGetCommit(logmsg, norecurs, forceCommit, forceRecurse, rev, noModuleProgram, checkValidEdits, dir) )
00196         return;
00197
00198     CvsArgs args;
00199     args.add("commit");
00200     if(checkValidEdits)
00201         args.add("-c");
00202     if(norecurs)
00203         args.add("-l");
00204     if(noModuleProgram)
00205         args.add("-n");
00206     if(forceRecurse)
00207         args.add("-R");
00208     if(forceCommit)
00209         args.add("-f");
00210     args.add("-m");
00211     args.add(cleanUpLogMsg(logmsg));
00212     if(!rev.empty())
00213     {
00214         args.add("-r");
00215         args.add(rev);
00216     }
00217     args.print(dir);
00218     launchCVS(dir, args.Argc(), args.Argv());
00219 }
00220
00221 void
00222 CvsCmdDiffFolder(const char *dir)
00223 {
00224     if(gCvsPrefs.empty())
00225         return;
00226
00227     if(dir == 0L)
00228         dir = BrowserGetDirectory("Select a directory to diff :");
00229
00230     if(dir == 0L)
00231         return;
00232
00233     bool noRecurs;
00234     bool isDate1;
00235     bool isDate2;
00236     bool useExtDiff;
00237     CPStr rev1;
00238     CPStr rev2;
00239     bool noWhiteSpace;
00240     bool ignoreCase;
00241
00242     if(!CompatGetDiff(noRecurs, isDate1, isDate2, rev1, rev2, useExtDiff, noWhiteSpace, ignoreCase))
00243         return;
00244
00245     CvsArgs args;
00246     args.add("diff");
00247
00248     if(noRecurs)
00249         args.add("-l");
00250     if(!rev1.empty())
00251     {
00252         args.add(isDate1 ? "-D" : "-r");
00253         args.add(rev1);
00254     }
00255     if(!rev2.empty())
00256     {
00257         args.add(isDate2 ? "-D" : "-r");
00258         args.add(rev2);
00259     }
00260     if(noWhiteSpace)
00261         args.add("-w"); //--ignore-all-space
00262     if(ignoreCase)
00263         args.add("-i"); //--ignore-case
00264
00265     args.print(dir);
00266     launchCVS(dir, args.Argc(), args.Argv());
00267 }
00268
00269 void
00270 CvsCmdAddFolder(const char *dir)
00271 {
00272     if(gCvsPrefs.empty())
00273         return;
00274
00275     if(dir == 0L)
00276         dir = BrowserGetDirectory("Select a directory to add :");
00277     if(dir == 0L)
00278         return;
00279
00280     CStr uppath, folder;
00281     if(!SplitPath(dir, uppath, folder))
00282     {
00283         cvs_err("Unable to convert path name '%s'\n", dir);
00284         return;
00285     }
00286
00287     CvsArgs args;
00288     args.add("add");
00289     args.add(folder);
00290     args.print(uppath);
00291     launchCVS(uppath, args.Argc(), args.Argv());
00292 }
00293
00294 void
00295 CvsCmdInit(const char *dir)
00296 {
00297     if(gCvsPrefs.empty())
00298         return;
00299
00300     bool forceCvsroot;
00301
00302     if(!CompatGetInit(forceCvsroot))
00303         return;
00304
00305     CvsArgs args;
00306
00307     if(forceCvsroot)
00308     {
00309         CStr root;
00310
00311         // extract from the cvsroot
00312         const char *ccvsroot = gCvsPrefs;
00313         ccvsroot = Authen::skiptoken(ccvsroot);
00314         root = gAuthen.token();
00315         root << ccvsroot;
00316         args.add("-d");
00317         args.add(root);
00318     }
00319
00320     args.add("init");
00321     args.print();
00322     launchCVS(0L, args.Argc(), args.Argv());
00323 }
00324
00325 void
00326 CvsCmdImportModule(const char *dir)
00327 {
00328     if(gCvsPrefs.empty())
00329         return;
00330
00331     if(dir == 0L)
00332         dir = BrowserGetDirectory("Select a directory to import :");
00333     if(dir == 0L)
00334         return;
00335
00336     ReportConflict * entries;
00337     ReportWarning * warnings;
00338
00339     if(!CompatImportFilter(dir, entries, warnings))
00340         return;
00341
00342     CPStr modname, vendortag, reltag, path(dir);
00343     CStr logmsg;
00344     bool useDefIgnore;
00345     bool useFilesTime;
00346
00347     if( !CompatGetImport(modname, logmsg, vendortag, reltag, path, useDefIgnore, useFilesTime) )
00348         return;
00349
00350     CvsArgs args;
00351     args.add("import");
00352
00353     if( useFilesTime )
00354     {
00355         args.add("-d");
00356     }
00357
00358     // fill the wrappers
00359     ReportConflict * tmpentry = entries;
00360     if( !useDefIgnore )
00361     {
00362         args.add("-I"); // no default (core, *.o...)
00363         args.add("!");
00364         args.add("-I"); // but ignore the CVS folders
00365         args.add("CVS");
00366     }
00367     while(tmpentry != 0L)
00368     {
00369         if(tmpentry->HasIgnore())
00370         {
00371             CPStr ign;
00372             args.add("-I");
00373             if(tmpentry->IsExtension())
00374                 ign << '*';
00375             ign << tmpentry->GetPattern();
00376             args.add(ign);
00377         }
00378         else if( !tmpentry->HasForceText() &&
00379             (tmpentry->IsBinary() || tmpentry->HasForceBinary() || tmpentry->HasForceNoKeywords() ||
00380             tmpentry->IsUnicode() || tmpentry->HasForceUnicode()) )
00381         {
00382             CPStr wrap;
00383             const char *pattern = tmpentry->GetPattern();
00384             bool hasSpace = strchr(pattern, ' ') != 0L;
00385             args.add("-W");
00386
00387             if( hasSpace )
00388                 wrap << '"';
00389
00390             if( tmpentry->IsExtension() )
00391                 wrap << '*';
00392
00393             wrap << pattern;
00394
00395             if( hasSpace )
00396                 wrap << '"';
00397
00398             if( tmpentry->HasForceNoKeywords() )
00399                 wrap << " -k 'o'";
00400             else if( tmpentry->IsUnicode() || tmpentry->HasForceUnicode() )
00401                 wrap << " -k 'u'";
00402             else
00403                 wrap << " -k 'b'";
00404
00405             args.add(wrap);
00406         }
00407         tmpentry = tmpentry->next;
00408     }
00409
00410     free_list_types(warnings, entries);
00411
00412     args.add("-m");
00413     args.add(cleanUpLogMsg(logmsg));
00414     args.add(modname);
00415     args.add(vendortag);
00416     args.add(reltag);
00417     args.print(path);
00418     launchCVS(path, args.Argc(), args.Argv());
00419 }
00420
00421 void
00422 CvsCmdCheckoutModule(const char *dir)
00423 {
00424     if(gCvsPrefs.empty())
00425         return;
00426
00427 #ifndef WIN32
00428     if(dir == 0L)
00429         dir = BrowserGetDirectory("Select a directory to checkout to :");
00430     if(dir == 0L)
00431         return;
00432 #endif
00433
00434     bool norecurs;
00435     CPStr modname;
00436     CPStr path(dir);
00437     bool toStdout;
00438     CPStr date;
00439     CPStr rev;
00440     bool useMostRecent;
00441     CPStr rev1;
00442     CPStr rev2;
00443     bool doexport;
00444     bool forceCvsroot;
00445     bool overrideCheckoutDir;
00446     CPStr checkoutDir;
00447
00448     if( !CompatGetCheckout(modname, path, norecurs,
00449         toStdout, date, rev, useMostRecent, rev1, rev2, doexport, forceCvsroot,
00450         overrideCheckoutDir, checkoutDir) )
00451     {
00452         return;
00453     }
00454
00455     CvsArgs args;
00456
00457     if(forceCvsroot)
00458     {
00459         CStr root;
00460
00461         // extract from the cvsroot
00462         const char *ccvsroot = gCvsPrefs;
00463         ccvsroot = Authen::skiptoken(ccvsroot);
00464         root = gAuthen.token();
00465         root << ccvsroot;
00466         args.add("-d");
00467         args.add(root);
00468     }
00469
00470     args.add(doexport ? "export" : "checkout");
00471
00472     if(gCvsPrefs.PruneOption() && !doexport)
00473         args.add("-P");
00474
00475     if(norecurs)
00476         args.add("-l");
00477
00478     if(toStdout)
00479         args.add("-p");
00480
00481     if(useMostRecent)
00482         args.add("-f");
00483
00484     if(!rev1.empty())
00485     {
00486         CPStr tmp;
00487         tmp = "-j";
00488         tmp << rev1;
00489         args.add(tmp);
00490     }
00491
00492     if(!rev2.empty())
00493     {
00494         CPStr tmp;
00495         tmp = "-j";
00496         tmp << rev2;
00497         args.add(tmp);
00498     }
00499
00500     if(!date.empty())
00501     {
00502         args.add("-D");
00503         args.add(date);
00504     }
00505
00506     if(!rev.empty())
00507     {
00508         args.add("-r");
00509         args.add(rev);
00510     }
00511
00512     if(doexport && rev.empty() && date.empty())
00513     {
00514         args.add("-r");
00515         args.add("HEAD");
00516     }
00517
00518     if( overrideCheckoutDir )
00519     {
00520         args.add("-d");
00521         args.add(checkoutDir);
00522     }
00523
00524     args.add(modname);
00525     args.print(path);
00526     launchCVS(path, args.Argc(), args.Argv());
00527 }
00528
00529 void
00530 CvsCmdRtagCreate(void)
00531 {
00532     if(gCvsPrefs.empty())
00533         return;
00534
00535     bool norecurs;
00536     bool useMostRecent;
00537     bool overwriteExisting;
00538     bool lookAttic;
00539     CPStr modname;
00540     CPStr tagname;
00541     CPStr date;
00542     CPStr rev;
00543
00544     if(!CompatRtagCreate(norecurs, overwriteExisting, tagname, modname, date, rev,
00545         useMostRecent, lookAttic))
00546             return;
00547
00548     CvsArgs args;
00549     args.add("rtag");
00550     if(norecurs)
00551         args.add("-l");
00552     if(useMostRecent)
00553         args.add("-f");
00554     if(overwriteExisting)
00555         args.add("-F");
00556     if(lookAttic)
00557         args.add("-a");
00558     if(!date.empty())
00559     {
00560         args.add("-D");
00561         args.add(date);
00562     }
00563     if(!rev.empty())
00564     {
00565         args.add("-r");
00566         args.add(rev);
00567     }
00568
00569     args.add(tagname);
00570     args.add(modname);
00571     args.print();
00572     launchCVS(0L, args.Argc(), args.Argv());
00573 }
00574
00575 void
00576 CvsCmdRtagDelete(void)
00577 {
00578     if(gCvsPrefs.empty())
00579         return;
00580
00581     bool norecurs;
00582     bool lookAttic;
00583     CPStr modname;
00584     CPStr tagname;
00585
00586     if(!CompatRtagDelete(norecurs, lookAttic, tagname, modname))
00587             return;
00588
00589     CvsArgs args;
00590     args.add("rtag");
00591     args.add("-d");
00592     if(norecurs)
00593         args.add("-l");
00594     if(lookAttic)
00595         args.add("-a");
00596
00597     args.add(tagname);
00598     args.add(modname);
00599     args.print();
00600     launchCVS(0L, args.Argc(), args.Argv());
00601 }
00602
00603 void
00604 CvsCmdRtagBranch(void)
00605 {
00606     if(gCvsPrefs.empty())
00607         return;
00608
00609     bool norecurs;
00610     bool useMostRecent;
00611     bool lookAttic;
00612     CPStr modname;
00613     CPStr branchname;
00614     CPStr date;
00615     CPStr rev;
00616
00617     if(!CompatRtagBranch(norecurs, branchname, modname, date, rev,
00618         useMostRecent, lookAttic))
00619             return;
00620
00621     CvsArgs args;
00622     args.add("rtag");
00623     args.add("-b");
00624     if(norecurs)
00625         args.add("-l");
00626     if(useMostRecent)
00627         args.add("-f");
00628     if(lookAttic)
00629         args.add("-a");
00630     if(!date.empty())
00631     {
00632         args.add("-D");
00633         args.add(date);
00634     }
00635     if(!rev.empty())
00636     {
00637         args.add("-r");
00638         args.add(rev);
00639     }
00640
00641     args.add(branchname);
00642     args.add(modname);
00643     args.print();
00644     launchCVS(0L, args.Argc(), args.Argv());
00645 }
00646
00647 void
00648 CvsCmdLogin(void)
00649 {
00650     if(gCvsPrefs.empty())
00651         return;
00652
00653     if(gAuthen.kind() != pserver)
00654     {
00655         cvs_err("Logging in is only required with pserver authentication (see Preferences dialog).\n"
00656             "Please consult the CVS manual for more details.\n");
00657         return;
00658     }
00659
00660     if(gCvsPrefs.HasLoogedIn() && gCvsPrefs.LogoutTimeOut() > 0)
00661     {
00662         cvs_err("Making automatic logout:\n");
00663         CvsCmdLogout();
00664         WaitForCvs();
00665     }
00666     gCvsPrefs.SetHasLoogedIn(true);
00667
00668     CvsArgs args;
00669     args.add("login");
00670     args.print();
00671     launchCVS(0L, args.Argc(), args.Argv());
00672 }
00673
00674 void
00675 CvsCmdLogout(void)
00676 {
00677     if(gCvsPrefs.empty())
00678         return;
00679
00680     if(gAuthen.kind() != pserver)
00681     {
00682         cvs_err("Logging out requires pserver authentication (see Preferences dialog).\n"
00683             "Please consult the CVS manual for more details.\n");
00684         return;
00685     }
00686
00687     gCvsPrefs.SetHasLoogedIn(false);
00688
00689     CvsArgs args;
00690     args.add("logout");
00691     args.print();
00692     launchCVS(0L, args.Argc(), args.Argv());
00693 }
00694
00695 void
00696 CvsCmdUpdateFiles(MultiFiles *mfarg, bool queryOnly)
00697 {
00698     if(gCvsPrefs.empty())
00699         return;
00700
00701     MultiFiles mf;
00702     if(mfarg == 0L)
00703     {
00704         if(!BrowserGetMultiFiles("Select files to update :", mf))
00705             return;
00706         mfarg = &mf;
00707     }
00708
00709     bool toStdout;
00710     bool noRecurs;
00711     bool resetSticky;
00712     CPStr date;
00713     CPStr rev;
00714     bool useMostRecent;
00715     CPStr rev1;
00716     CPStr rev2;
00717     bool createMissDir;
00718     bool getCleanCopy;
00719
00720     if(!queryOnly && !CompatGetUpdate(toStdout, noRecurs, resetSticky,
00721         date, rev, useMostRecent, rev1, rev2, createMissDir, getCleanCopy))
00722         return;
00723
00724     while(mfarg->next())
00725     {
00726         CvsArgs args;
00727
00728         if(queryOnly)
00729             args.add("-n");
00730
00731         args.add("update");
00732
00733         if(!queryOnly)
00734         {
00735             if(resetSticky)
00736                 args.add("-A");
00737
00738             if(createMissDir)
00739                 args.add("-d");
00740
00741             if(getCleanCopy)
00742                 args.add("-C");
00743
00744             if(!date.empty())
00745             {
00746                 args.add("-D");
00747                 args.add(date);
00748             }
00749
00750             if(useMostRecent)
00751                 args.add("-f");
00752
00753             if(!rev1.empty())
00754             {
00755                 CPStr tmp;
00756                 tmp = "-j";
00757                 tmp << rev1;
00758                 args.add(tmp);
00759             }
00760
00761             if(!rev2.empty())
00762             {
00763                 CPStr tmp;
00764                 tmp = "-j";
00765                 tmp << rev2;
00766                 args.add(tmp);
00767             }
00768
00769             /*if(noRecurs)
00770                 args.add("-l");*/
00771
00772             if(toStdout)
00773                 args.add("-p");
00774
00775             if(!rev.empty())
00776             {
00777                 args.add("-r");
00778                 args.add(rev);
00779             }
00780         }
00781
00782         const char *dir = mfarg->add(args);
00783         args.print(dir);
00784         launchCVS(dir, args.Argc(), args.Argv());
00785     }
00786 }
00787
00788 void
00789 CvsCmdCommitFiles(MultiFiles *mfarg)
00790 {
00791     if(gCvsPrefs.empty())
00792         return;
00793
00794     MultiFiles mf;
00795     if(mfarg == 0L)
00796     {
00797         if(!BrowserGetMultiFiles("Select files to commit :", mf))
00798             return;
00799         mfarg = &mf;
00800     }
00801
00802     bool firstTime = true;
00803     bool norecurs;
00804     CStr logmsg;
00805     bool forceCommit;
00806     bool forceRecurse;
00807     CPStr rev;
00808     bool noModuleProgram;
00809     bool checkValidEdits;
00810
00811     while(mfarg->next())
00812     {
00813         if(firstTime)
00814         {
00815             // we have to give the path where the commit is done is
00816             // the user expects to fill the CVS/Template file. we just
00817             // grab the first one for this purpose.
00818             const char *tmplDir = 0L;
00819             CStr pathTmpl, dontCareFile;
00820             if(mfarg->get(0, pathTmpl, dontCareFile))
00821                 tmplDir = pathTmpl;
00822
00823             if( !CompatGetCommit(logmsg, norecurs, forceCommit, forceRecurse, rev, noModuleProgram, checkValidEdits, tmplDir, mfarg) )
00824                 return;
00825
00826             firstTime = false;
00827         }
00828
00829         CvsArgs args;
00830         args.add("commit");
00831         if(checkValidEdits)
00832             args.add("-c");
00833         if(norecurs)
00834             args.add("-l");
00835         if(noModuleProgram)
00836             args.add("-n");
00837         if(forceRecurse)
00838             args.add("-R");
00839         if(forceCommit)
00840             args.add("-f");
00841         args.add("-m");
00842         args.add(cleanUpLogMsg(logmsg));
00843         if(!rev.empty())
00844         {
00845             args.add("-r");
00846             args.add(rev);
00847         }
00848         const char *dir = mfarg->add(args);
00849         args.print(dir);
00850         launchCVS(dir, args.Argc(), args.Argv());
00851     }
00852 }
00853
00854 #ifdef WIN32
00855 // Windows client may provide file names pointing into subfolders.
00856 // The function below removes folder separators by replacing them with dots,
00857 // the reason is that temporary file could be created without creating
00858 // matching subfolders in the temporary file folder
00859 static
00860 void
00861 FlatenSubFolders(CStr& tmpf)
00862 {
00863     char* cp = (char*)tmpf;
00864     if (cp)
00865     {
00866         while(*cp)
00867         {
00868             if (*cp == kPathDelimiter)
00869             {
00870                 *cp = '.';
00871             }
00872             cp++;
00873         }
00874     }
00875 }
00876 #else
00877 #define FlatenSubFolders(tmpf) // no-op on other platforms
00878 #endif
00879
00880 void
00881 CvsCmdDiffFiles(MultiFiles *mfarg)
00882 {
00883     if(gCvsPrefs.empty())
00884         return;
00885
00886     MultiFiles mf;
00887     if(mfarg == 0L)
00888     {
00889         if(!BrowserGetMultiFiles("Select files to diff :", mf))
00890             return;
00891         mfarg = &mf;
00892     }
00893
00894     bool noRecurs;
00895     bool isDate1;
00896     bool isDate2;
00897     bool useExtDiff;
00898     CPStr rev1;
00899     CPStr rev2;
00900     bool noWhiteSpace;
00901     bool ignoreCase;
00902     bool extDiffResult;
00903
00904     if(!CompatGetDiff(noRecurs, isDate1, isDate2, rev1, rev2, useExtDiff, noWhiteSpace, ignoreCase, true))
00905         return;
00906
00907     while(mfarg->next())
00908     {
00909         extDiffResult = false;
00910
00911         if (useExtDiff)
00912         {
00913             CStr path, filename, ext, base;
00914             CStr file1, file2;
00915             for(int i = 0; ; i++)
00916             {
00917                 if(!mfarg->get(i, path, filename))
00918                     break;
00919                 // note that filename can contain subfolders
00920
00921                 GetExtension(filename, base, ext);
00922
00923                 CvsArgs args;
00924                 CStr tmpf(base);
00925                 if(!rev1.empty())
00926                 {
00927                     tmpf << '_';
00928                     tmpf << rev1;
00929                     tmpf << '_';
00930                 }
00931                 else
00932                     tmpf << "_orig_";
00933
00934                 // convert subfolder names to regular name
00935                 FlatenSubFolders(tmpf);
00936
00937                 args.add("update");
00938                 args.add("-p");
00939                 if(!rev1.empty())
00940                 {
00941                     args.add(isDate1 ? "-D" : "-r");
00942                     args.add(rev1);
00943                 }
00944                 args.add(filename);
00945                 args.print(path);
00946                 file1 = launchCVS(path, args, (const char *)tmpf, ext);
00947 #ifdef qMacCvsPP
00948                 decodeCVS (file1);
00949 #endif
00950
00951                 if(rev2.empty())
00952                 {
00953                     file2 = path;
00954                     if(!file2.endsWith(kPathDelimiter))
00955                         file2 << kPathDelimiter;
00956                     file2 << filename;
00957                 }
00958                 else
00959                 {
00960                     CvsArgs args2;
00961
00962                     tmpf = base;
00963                     tmpf << '_';
00964                     tmpf << rev2;
00965                     tmpf << '_';
00966
00967                     // convert subfolder names to regular name
00968                     FlatenSubFolders(tmpf);
00969
00970                     args2.add("update");
00971                     args2.add("-p");
00972                     args2.add(isDate2 ? "-D" : "-r");
00973                     args2.add(rev2);
00974                     args2.add(filename);
00975                     args2.print(path);
00976                     file2 = launchCVS(path, args2, (const char *)tmpf, ext);
00977 #ifdef qMacCvsPP
00978                     decodeCVS (file2);
00979 #endif
00980                 }
00981
00982                 if(file1.empty() || file2.empty())
00983                     continue;
00984
00985                 extDiffResult = LaunchDiff(file1, file2);
00986             }
00987         }
00988
00989         if (!useExtDiff || !extDiffResult)
00990         {
00991             CvsArgs args;
00992             args.add("diff");
00993
00994             if(noRecurs)
00995                 args.add("-l");
00996             if(!rev1.empty())
00997             {
00998                 args.add(isDate1 ? "-D" : "-r");
00999                 args.add(rev1);
01000             }
01001             if(!rev2.empty())
01002             {
01003                 args.add(isDate2 ? "-D" : "-r");
01004                 args.add(rev2);
01005             }
01006             if(noWhiteSpace)
01007                 args.add("-w"); //--ignore-all-space
01008             if(ignoreCase)
01009                 args.add("-i"); //--ignore-case
01010
01011             const char *dir = mfarg->add(args);
01012             args.print(dir);
01013             launchCVS(dir, args.Argc(), args.Argv());
01014         }
01015     }
01016 }
01017
01018 void
01019 CvsCmdLogFiles(MultiFiles *mfarg, bool outGraph, void *defWnd)
01020 {
01021     if(gCvsPrefs.empty())
01022         return;
01023
01024     MultiFiles mf;
01025     if(mfarg == 0L)
01026     {
01027         if(!BrowserGetMultiFiles("Select files to log :", mf))
01028             return;
01029         mfarg = &mf;
01030     }
01031
01032     bool noRecurs;
01033     bool defBranch;
01034     CPStr date;
01035     bool headerOnly;
01036     bool noTags;
01037     bool onlyRCSfile;
01038     bool hasRev;
01039     CPStr rev;
01040     CPStr states;
01041     bool hasUser;
01042     CPStr users;
01043
01044     if( !CompatGetLog(noRecurs, defBranch, date,
01045         headerOnly, noTags, onlyRCSfile, hasRev,
01046         rev, states, hasUser, users,
01047         outGraph) )
01048     {
01049         return;
01050     }
01051
01052     while(mfarg->next())
01053     {
01054         CvsArgs args;
01055         args.add("log");
01056
01057         if(noRecurs)
01058             args.add("-l");
01059         if(defBranch)
01060             args.add("-b");
01061         if(headerOnly)
01062             args.add("-h");
01063         if(noTags)
01064             args.add("-N");
01065         if(onlyRCSfile)
01066             args.add("-R");
01067
01068         if(!date.empty())
01069         {
01070             args.add("-d");
01071             args.add(date);
01072         }
01073         if(!states.empty())
01074         {
01075             args.add("-s");
01076             args.add(states);
01077         }
01078         if(hasRev)
01079         {
01080             CPStr tmp;
01081             tmp = "-r";
01082             tmp << rev;
01083             args.add(tmp);
01084         }
01085         if(hasUser)
01086         {
01087             CPStr tmp;
01088             tmp = "-w";
01089             tmp << users;
01090             args.add(tmp);
01091         }
01092
01093         const char *dir = mfarg->add(args);
01094         args.print(dir);
01095         CvsLogParse(dir, args, outGraph, defWnd);
01096     }
01097 }
01098
01099 class ControlCvsArgs : public CvsArgs
01100 {
01101 public:
01102     ControlCvsArgs() : m_gotProblem(false) { }
01103
01104     virtual void addfile(const char* arg, const char* dir = 0L, const UFSSpec* spec = 0L);
01105
01106     inline bool HasProblem(void) const
01107     {
01108         return m_gotProblem;
01109     }
01110
01111     inline void SetProblem(bool newState)
01112     {
01113         m_gotProblem = newState;
01114     }
01115
01116 protected:
01117     virtual kTextBinTYPE FileIsType(const char* arg, const char* dir, const UFSSpec* spec = 0L) = 0;
01118     virtual const char* TypeDesc() = 0;
01119
01120 private:
01121     bool m_gotProblem;
01122 };
01123
01124 void ControlCvsArgs::addfile(const char* arg, const char* dir, const UFSSpec* spec)
01125 {
01126     CvsArgs::addfile(arg, dir, spec);
01127
01128     if(!gCvsPrefs.AddControl())
01129         return;
01130
01131 #if TARGET_RT_MAC_CFM
01132     // here a bug of MSL : it refuses to open a file beginning by
01133     // ".". So we skip this file out of the test and warn the user.
01134     if(arg[0] == '.')
01135     {
01136         cvs_out("Warning : \'%s\' cannot be verified due to a bug in MW MSL, please\n", arg);
01137         cvs_out("          verify manually \'%s\' *is* a %s file\n", arg, TypeDesc());
01138         return;
01139     }
01140 #endif
01141
01142     kTextBinTYPE state = FileIsType(arg, dir, spec);
01143     switch(state)
01144     {
01145     case kFileIsOK:
01146         break;
01147     case kFileMissing:
01148         // we can resurect a file which is missing by re-adding it
01149         break;
01150     case kFileIsAlias:
01151         cvs_err("Warning : \'%s\' is an alias\n", arg);
01152         SetProblem(true);
01153         break;
01154     case kFileInvalidName:
01155         cvs_err("Warning : \'%s\' has an invalid name\n", arg);
01156         SetProblem(true);
01157         break;
01158     case kTextWrongLF:
01159         cvs_err("Warning : \'%s\' seems to have the wrong line feed for this machine, you should correct it first\n", arg);
01160         SetProblem(true);
01161         break;
01162     case kUnicodeIsBinary: // fall thru intentional
01163     case kTextIsBinary:
01164         cvs_err("Warning : \'%s\' seems to be \'binary\', you should use the \'Add binary\' command instead...\n", arg);
01165         SetProblem(true);
01166         break;
01167     case kTextEscapeChar:
01168 #ifdef macintosh
01169         if(gCvsPrefs.IsoConvert() == ISO8559_none)
01170         {
01171             cvs_err("Warning : \'%s\' has some escape characters in it (0x00-0x20, 0x80-0xFF),\n", arg);
01172             cvs_err("Warning   so you may need to have the ISO8559 translation option set in the preferences\n");
01173             cvs_err("Warning   before commiting\n");
01174         }
01175 #else /* !macintosh */
01176         cvs_err("Warning : \'%s\' has some escape characters in it (0x00-0x20, 0x80-0xFF), you should correct it first\n", arg);
01177 #endif /* !macintosh */
01178         break;
01179     case kTextWrongSig:
01180         cvs_err("Warning : \'%s\' has a file type different from \'TEXT\', you should correct it first\n", arg);
01181         SetProblem(true);
01182         break;
01183     case kUnicodeIsText: // fall thru intentional
01184     case kBinIsText:
01185         cvs_err("Warning : \'%s\' seems to be a text file, you should consider to use the \'Add selection\' command instead\n", arg);
01186         SetProblem(true);
01187         break;
01188     case kBinWrongSig:
01189         cvs_err("Warning : \'%s\' has a file type of \'TEXT\', you should correct it first\n", arg);
01190         SetProblem(true);
01191         break;
01192     case kTextIsUnicode: // fall thru intentional
01193     case kBinIsUnicode:
01194         cvs_err("Warning : \'%s\' seems to be an Unicode file, you should consider to use the \'Add unicode\' command instead\n", arg);
01195         SetProblem(true);
01196         break;
01197     default:
01198         cvs_err("Warning : \'%s\' has some unknown problems\n", arg);
01199         SetProblem(true);
01200         break;
01201     }
01202 }
01203
01204
01205 class AddCvsArgs : public ControlCvsArgs
01206 {
01207 protected:
01208     virtual kTextBinTYPE FileIsType(const char* arg, const char* dir, const UFSSpec* spec = 0L)
01209     {
01210         return FileIsText(arg, dir, spec);
01211     }
01212
01213     virtual const char* TypeDesc()
01214     {
01215         return "TEXT";
01216     }
01217 };
01218
01219 void CvsCmdAddFiles(MultiFiles *mfarg)
01220 {
01221     if(gCvsPrefs.empty())
01222         return;
01223
01224     MultiFiles mf;
01225     if(mfarg == 0L)
01226     {
01227         if(!BrowserGetMultiFiles("Select files to add :", mf))
01228             return;
01229         mfarg = &mf;
01230     }
01231
01232     while(mfarg->next())
01233     {
01234         AddCvsArgs args;
01235         args.add("add");
01236         const char *dir = mfarg->add(args);
01237
01238         if(!args.HasProblem() || !CvsAlert("Some problems have been found while adding files and should be corrected",
01239                 "Cancel", "Ignore"))
01240         {
01241             args.print(dir);
01242             launchCVS(dir, args.Argc(), args.Argv());
01243         }
01244     }
01245 }
01246
01247 class AddBinCvsArgs : public ControlCvsArgs
01248 {
01249 protected:
01250     virtual kTextBinTYPE FileIsType(const char* arg, const char* dir, const UFSSpec* spec = 0L)
01251     {
01252         return FileIsBinary(arg, dir, spec);
01253     }
01254
01255     virtual const char* TypeDesc()
01256     {
01257         return "binary";
01258     }
01259 };
01260
01261 void CvsCmdAddBinaryFiles(MultiFiles *mfarg)
01262 {
01263     if(gCvsPrefs.empty())
01264         return;
01265
01266     MultiFiles mf;
01267     if(mfarg == 0L)
01268     {
01269         if(!BrowserGetMultiFiles("Select binary files to add :", mf))
01270             return;
01271         mfarg = &mf;
01272     }
01273
01274     while(mfarg->next())
01275     {
01276         AddBinCvsArgs args;
01277         args.add("add");
01278         args.add("-kb");
01279         const char *dir = mfarg->add(args);
01280
01281         if(!args.HasProblem() || !CvsAlert("Some problems have been found while adding binary files and should be corrected",
01282                 "Cancel", "Ignore"))
01283         {
01284             args.print(dir);
01285             launchCVS(dir, args.Argc(), args.Argv());
01286         }
01287     }
01288 }
01289
01290 class AddUnicodeCvsArgs : public ControlCvsArgs
01291 {
01292 protected:
01293     virtual kTextBinTYPE FileIsType(const char* arg, const char* dir, const UFSSpec* spec = 0L)
01294     {
01295         return FileIsUnicode(arg, dir, spec);
01296     }
01297
01298     virtual const char* TypeDesc()
01299     {
01300         return "Unicode";
01301     }
01302 };
01303
01304 void CvsCmdAddUnicodeFiles(MultiFiles *mfarg)
01305 {
01306     if(gCvsPrefs.empty())
01307         return;
01308
01309     MultiFiles mf;
01310     if(mfarg == 0L)
01311     {
01312         if(!BrowserGetMultiFiles("Select unicode files to add :", mf))
01313             return;
01314         mfarg = &mf;
01315     }
01316
01317     while(mfarg->next())
01318     {
01319         AddUnicodeCvsArgs args;
01320         args.add("add");
01321         args.add("-ku");
01322         const char *dir = mfarg->add(args);
01323
01324         if(!args.HasProblem() || !CvsAlert("Some problems have been found while adding unicode files and should be corrected",
01325                 "Cancel", "Ignore"))
01326         {
01327             args.print(dir);
01328             launchCVS(dir, args.Argc(), args.Argv());
01329         }
01330     }
01331 }
01332
01333 class RemoveCvsArgs : public CvsArgs
01334 {
01335 public:
01336     virtual void addfile(const char *arg, const char *dir = 0L,
01337         const UFSSpec *spec = 0L);
01338 };
01339
01340 void RemoveCvsArgs::addfile(const char *arg, const char *dir, const UFSSpec *spec)
01341 {
01342     CvsArgs::addfile(arg, dir, spec);
01343
01344     CStr fullpath(dir);
01345     if(!fullpath.endsWith(kPathDelimiter))
01346         fullpath << kPathDelimiter;
01347     fullpath << arg;
01348
01349     // check the file is not already deleted
01350     struct stat sb;
01351     if (stat(dir, &sb) != -1 && S_ISDIR(sb.st_mode) &&
01352         stat(fullpath, &sb) == -1 && errno == ENOENT)
01353     {
01354         return;
01355     }
01356
01357     if(!CompatMoveToTrash(arg, dir, spec))
01358 #ifdef WIN32
01359         cvs_err("Unable to send \'%s\' to the recycle bin\n", arg);
01360     else
01361         cvs_out("\'%s\' has been moved successfully to the recycle bin...\n", arg);
01362 #elif !defined(macintosh)
01363         cvs_err("Unable to send \'%s\' to the trash\n", arg);
01364     else
01365         cvs_out("\'%s\' has been moved successfully to trash...\n", arg);
01366 #else
01367     {}
01368 #endif
01369 }
01370
01371 void
01372 CvsCmdRemoveFiles(MultiFiles *mfarg)
01373 {
01374     if(gCvsPrefs.empty())
01375         return;
01376
01377     MultiFiles mf;
01378     if(mfarg == 0L)
01379     {
01380         if(!BrowserGetMultiFiles("Select files to remove :", mf))
01381             return;
01382         mfarg = &mf;
01383     }
01384
01385     while(mfarg->next())
01386     {
01387         RemoveCvsArgs args;
01388
01389         CompatBeginMoveToTrash();
01390
01391         args.add("remove");
01392         const char *dir = mfarg->add(args);
01393         args.print(dir);
01394
01395         CompatEndMoveToTrash();
01396
01397         launchCVS(dir, args.Argc(), args.Argv());
01398     }
01399 }
01400
01401 void
01402 CvsCmdStatusFiles(MultiFiles *mfarg)
01403 {
01404     if(gCvsPrefs.empty())
01405         return;
01406
01407     MultiFiles mf;
01408     if(mfarg == 0L)
01409     {
01410         if(!BrowserGetMultiFiles("Select files to status :", mf))
01411             return;
01412         mfarg = &mf;
01413     }
01414
01415     while(mfarg->next())
01416     {
01417         CvsArgs args;
01418         args.add("status");
01419         args.add("-v");
01420         const char *dir = mfarg->add(args);
01421         args.print(dir);
01422         launchCVS(dir, args.Argc(), args.Argv());
01423     }
01424 }
01425
01426 void
01427 CvsCmdCancelChangesFiles(MultiFiles *mfarg)
01428 {
01429     if(gCvsPrefs.empty())
01430         return;
01431
01432     MultiFiles mf;
01433     if(mfarg == 0L)
01434     {
01435         if(!BrowserGetMultiFiles("Select files to cancel changes :", mf))
01436             return;
01437         mfarg = &mf;
01438     }
01439
01440     while(mfarg->next())
01441     {
01442         RemoveCvsArgs args;
01443         args.add("update");
01444         const char *dir = mfarg->add(args);
01445         args.print(dir);
01446         launchCVS(dir, args.Argc(), args.Argv());
01447     }
01448 }
01449
01450 void CvsCmdLine(void)
01451 {
01452     CvsArgs args(false);
01453     const char *dir;
01454     if(!CompatGetCommand(args, dir))
01455         return;
01456     args.print(dir);
01457     launchCVS(dir, args.Argc(), args.Argv());
01458 }
01459
01460 void
01461 CvsCmdLogFolder(const char *dir)
01462 {
01463     if(gCvsPrefs.empty())
01464         return;
01465
01466     if(dir == 0L)
01467         dir = BrowserGetDirectory("Select a directory to log :");
01468     if(dir == 0L)
01469         return;
01470
01471     bool noRecurs;
01472     bool defBranch;
01473     CPStr date;
01474     bool headerOnly;
01475     bool noTags;
01476     bool onlyRCSfile;
01477     bool hasRev;
01478     CPStr rev;
01479     CPStr states;
01480     bool hasUser;
01481     CPStr users;
01482
01483     if(!CompatGetLog(noRecurs, defBranch, date,
01484         headerOnly, noTags, onlyRCSfile, hasRev,
01485         rev, states, hasUser, users))
01486             return;
01487
01488     CvsArgs args;
01489     args.add("log");
01490
01491     if(noRecurs)
01492         args.add("-l");
01493     if(defBranch)
01494         args.add("-b");
01495     if(headerOnly)
01496         args.add("-h");
01497     if(noTags)
01498         args.add("-N");
01499     if(onlyRCSfile)
01500         args.add("-R");
01501
01502     if(!date.empty())
01503     {
01504         args.add("-d");
01505         args.add(date);
01506     }
01507     if(!states.empty())
01508     {
01509         args.add("-s");
01510         args.add(states);
01511     }
01512     if(hasRev)
01513     {
01514         CPStr tmp;
01515         tmp = "-r";
01516         tmp << rev;
01517         args.add(tmp);
01518     }
01519     if(hasUser)
01520     {
01521         CPStr tmp;
01522         tmp = "-w";
01523         tmp << users;
01524         args.add(tmp);
01525     }
01526
01527     args.print(dir);
01528     CvsLogParse(dir, args, false, NULL);
01529 }
01530
01531 void
01532 CvsCmdStatusFolder(const char *dir)
01533 {
01534     if(gCvsPrefs.empty())
01535         return;
01536
01537     if(dir == 0L)
01538         dir = BrowserGetDirectory("Select a directory to get status :");
01539     if(dir == 0L)
01540         return;
01541
01542     CvsArgs args;
01543     args.add("status");
01544     args.add("-v");
01545
01546     args.print(dir);
01547     launchCVS(dir, args.Argc(), args.Argv());
01548 }
01549
01550 void
01551 CvsCmdLockFiles(MultiFiles *mfarg)
01552 {
01553     if(gCvsPrefs.empty())
01554         return;
01555
01556     MultiFiles mf;
01557     if(mfarg == 0L)
01558     {
01559         if(!BrowserGetMultiFiles("Select files to lock :", mf))
01560             return;
01561         mfarg = &mf;
01562     }
01563
01564     while(mfarg->next())
01565     {
01566         CvsArgs args;
01567         args.add("admin");
01568         args.add("-l");
01569
01570         const char *dir = mfarg->add(args);
01571         args.print(dir);
01572         launchCVS(dir, args.Argc(), args.Argv());
01573     }
01574 }
01575
01576 void
01577 CvsCmdUnlockFiles(MultiFiles *mfarg)
01578 {
01579     if(gCvsPrefs.empty())
01580         return;
01581
01582     MultiFiles mf;
01583     if(mfarg == 0L)
01584     {
01585         if(!BrowserGetMultiFiles("Select files to unlock :", mf))
01586             return;
01587         mfarg = &mf;
01588     }
01589
01590     while(mfarg->next())
01591     {
01592         CvsArgs args;
01593         args.add("admin");
01594         args.add("-u");
01595
01596         const char *dir = mfarg->add(args);
01597         args.print(dir);
01598         launchCVS(dir, args.Argc(), args.Argv());
01599     }
01600 }
01601
01602 void
01603 CvsCmdTagCreateFiles(MultiFiles *mfarg)
01604 {
01605     if(gCvsPrefs.empty())
01606         return;
01607
01608     MultiFiles mf;
01609     if(mfarg == 0L)
01610     {
01611         if(!BrowserGetMultiFiles("Select files to tag :", mf))
01612             return;
01613         mfarg = &mf;
01614     }
01615
01616     bool noRecurs, overwriteExisting, checkUnmod;
01617     CPStr tagName;
01618     if(!CompatTagCreate(noRecurs, overwriteExisting, tagName, checkUnmod))
01619         return;
01620
01621     while(mfarg->next())
01622     {
01623         CvsArgs args;
01624         args.add("tag");
01625         if(noRecurs)
01626             args.add("-l");
01627         if(overwriteExisting)
01628             args.add("-F");
01629         if(checkUnmod)
01630             args.add("-c");
01631         args.add(tagName);
01632
01633         const char *dir = mfarg->add(args);
01634         args.print(dir);
01635         launchCVS(dir, args.Argc(), args.Argv());
01636     }
01637 }
01638
01639 void
01640 CvsCmdTagDeleteFiles(MultiFiles *mfarg)
01641 {
01642     if(gCvsPrefs.empty())
01643         return;
01644
01645     MultiFiles mf;
01646     if(mfarg == 0L)
01647     {
01648         if(!BrowserGetMultiFiles("Select files to untag :", mf))
01649             return;
01650         mfarg = &mf;
01651     }
01652
01653     bool noRecurs;
01654     CPStr tagName;
01655     if(!CompatTagDelete(noRecurs, tagName))
01656         return;
01657
01658     while(mfarg->next())
01659     {
01660         CvsArgs args;
01661         args.add("tag");
01662         args.add("-d");
01663         if(noRecurs)
01664             args.add("-l");
01665         args.add(tagName);
01666
01667         const char *dir = mfarg->add(args);
01668         args.print(dir);
01669         launchCVS(dir, args.Argc(), args.Argv());
01670     }
01671 }
01672
01673 void
01674 CvsCmdTagBranchFiles(MultiFiles *mfarg)
01675 {
01676     if(gCvsPrefs.empty())
01677         return;
01678
01679     MultiFiles mf;
01680     if(mfarg == 0L)
01681     {
01682         if(!BrowserGetMultiFiles("Select files to branch :", mf))
01683             return;
01684         mfarg = &mf;
01685     }
01686
01687     bool noRecurs, checkUnmod;
01688     CPStr branchName;
01689     if(!CompatTagBranch(noRecurs, branchName, checkUnmod))
01690         return;
01691
01692     while(mfarg->next())
01693     {
01694         CvsArgs args;
01695         args.add("tag");
01696         args.add("-b");
01697         if(noRecurs)
01698             args.add("-l");
01699         if(checkUnmod)
01700             args.add("-c");
01701         args.add(branchName);
01702
01703         const char *dir = mfarg->add(args);
01704         args.print(dir);
01705         launchCVS(dir, args.Argc(), args.Argv());
01706     }
01707 }
01708
01709 void
01710 CvsCmdLockFolder(const char *dir)
01711 {
01712     if(gCvsPrefs.empty())
01713         return;
01714
01715     if(dir == 0L)
01716         dir = BrowserGetDirectory("Select a directory to lock :");
01717     if(dir == 0L)
01718         return;
01719
01720     CvsArgs args;
01721     args.add("admin");
01722     args.add("-l");
01723
01724     args.print(dir);
01725     launchCVS(dir, args.Argc(), args.Argv());
01726 }
01727
01728 void
01729 CvsCmdUnlockFolder(const char *dir)
01730 {
01731     if(gCvsPrefs.empty())
01732         return;
01733
01734     if(dir == 0L)
01735         dir = BrowserGetDirectory("Select a directory to unlock :");
01736     if(dir == 0L)
01737         return;
01738
01739     CvsArgs args;
01740     args.add("admin");
01741     args.add("-u");
01742
01743     args.print(dir);
01744     launchCVS(dir, args.Argc(), args.Argv());
01745 }
01746
01747 void
01748 CvsCmdTagCreateFolder(const char *dir)
01749 {
01750     if(gCvsPrefs.empty())
01751         return;
01752
01753     if(dir == 0L)
01754         dir = BrowserGetDirectory("Select a directory to tag :");
01755     if(dir == 0L)
01756         return;
01757
01758     bool noRecurs, overwriteExisting, checkUnmod;
01759     CPStr tagName;
01760     if(!CompatTagCreate(noRecurs, overwriteExisting, tagName, checkUnmod))
01761         return;
01762
01763     CvsArgs args;
01764     args.add("tag");
01765     if(noRecurs)
01766         args.add("-l");
01767     if(overwriteExisting)
01768         args.add("-F");
01769     if(checkUnmod)
01770         args.add("-c");
01771     args.add(tagName);
01772
01773     args.print(dir);
01774     launchCVS(dir, args.Argc(), args.Argv());
01775 }
01776
01777 void
01778 CvsCmdTagDeleteFolder(const char *dir)
01779 {
01780     if(gCvsPrefs.empty())
01781         return;
01782
01783     if(dir == 0L)
01784         dir = BrowserGetDirectory("Select a directory to untag :");
01785     if(dir == 0L)
01786         return;
01787
01788     bool noRecurs;
01789     CPStr tagName;
01790     if(!CompatTagDelete(noRecurs, tagName))
01791         return;
01792
01793     CvsArgs args;
01794     args.add("tag");
01795     args.add("-d");
01796     if(noRecurs)
01797         args.add("-l");
01798     args.add(tagName);
01799
01800     args.print(dir);
01801     launchCVS(dir, args.Argc(), args.Argv());
01802 }
01803
01804 void
01805 CvsCmdTagBranchFolder(const char *dir)
01806 {
01807     if(gCvsPrefs.empty())
01808         return;
01809
01810     if(dir == 0L)
01811         dir = BrowserGetDirectory("Select a directory to branch :");
01812     if(dir == 0L)
01813         return;
01814
01815     bool noRecurs, checkUnmod;
01816     CPStr tagName;
01817     if(!CompatTagBranch(noRecurs, tagName, checkUnmod))
01818         return;
01819
01820     CvsArgs args;
01821     args.add("tag");
01822     args.add("-b");
01823     if(noRecurs)
01824         args.add("-l");
01825     if(checkUnmod)
01826         args.add("-c");
01827     args.add(tagName);
01828
01829     args.print(dir);
01830     launchCVS(dir, args.Argc(), args.Argv());
01831 }
01832
01833 void CvsCmdEditFiles(MultiFiles *mfarg /*= 0L*/, kEditCmdType editType /*= kNormal*/)
01834 {
01835     if(gCvsPrefs.empty())
01836         return;
01837
01838     MultiFiles mf;
01839     if(mfarg == 0L)
01840     {
01841         if(!BrowserGetMultiFiles("Select the files to edit :", mf))
01842             return;
01843         mfarg = &mf;
01844     }
01845
01846     while(mfarg->next())
01847     {
01848         CvsArgs args;
01849         args.add("edit");
01850
01851         switch( editType )
01852         {
01853         default:
01854         case kEditNormal:
01855             // intentionally blank
01856             break;
01857         case kEditReserved:
01858             args.add("-c");
01859             break;
01860         case kEditForce:
01861             args.add("-f");
01862             break;
01863         }
01864
01865         const char *dir = mfarg->add(args);
01866         args.print(dir);
01867         launchCVS(dir, args.Argc(), args.Argv());
01868     }
01869 }
01870
01871 void CvsCmdUneditFiles(MultiFiles *mfarg)
01872 {
01873     if(gCvsPrefs.empty())
01874         return;
01875
01876     MultiFiles mf;
01877     if(mfarg == 0L)
01878     {
01879         if(!BrowserGetMultiFiles("Select the files to unedit :", mf))
01880             return;
01881         mfarg = &mf;
01882     }
01883
01884     while(mfarg->next())
01885     {
01886         CvsArgs args;
01887         args.add("unedit");
01888
01889         const char *dir = mfarg->add(args);
01890         args.print(dir);
01891         launchCVS(dir, args.Argc(), args.Argv());
01892     }
01893 }
01894
01895 void CvsCmdWatchOnFiles(MultiFiles *mfarg)
01896 {
01897     if(gCvsPrefs.empty())
01898         return;
01899
01900     MultiFiles mf;
01901     if(mfarg == 0L)
01902     {
01903         if(!BrowserGetMultiFiles("Select the files to watch :", mf))
01904             return;
01905         mfarg = &mf;
01906     }
01907
01908     while(mfarg->next())
01909     {
01910         CvsArgs args;
01911         args.add("watch");
01912         args.add("add");
01913
01914         const char *dir = mfarg->add(args);
01915         args.print(dir);
01916         launchCVS(dir, args.Argc(), args.Argv());
01917     }
01918 }
01919
01920 void CvsCmdWatchOffFiles(MultiFiles *mfarg)
01921 {
01922     if(gCvsPrefs.empty())
01923         return;
01924
01925     MultiFiles mf;
01926     if(mfarg == 0L)
01927     {
01928         if(!BrowserGetMultiFiles("Select the files to unwatch :", mf))
01929             return;
01930         mfarg = &mf;
01931     }
01932
01933     while(mfarg->next())
01934     {
01935         CvsArgs args;
01936         args.add("watch");
01937         args.add("remove");
01938
01939         const char *dir = mfarg->add(args);
01940         args.print(dir);
01941         launchCVS(dir, args.Argc(), args.Argv());
01942     }
01943 }
01944
01945 void CvsCmdWatchersFiles(MultiFiles *mfarg)
01946 {
01947     if(gCvsPrefs.empty())
01948         return;
01949
01950     MultiFiles mf;
01951     if(mfarg == 0L)
01952     {
01953         if(!BrowserGetMultiFiles("Select the files to get the watchers from :", mf))
01954             return;
01955         mfarg = &mf;
01956     }
01957
01958     while(mfarg->next())
01959     {
01960         CvsArgs args;
01961         args.add("watchers");
01962
01963         const char *dir = mfarg->add(args);
01964         args.print(dir);
01965         launchCVS(dir, args.Argc(), args.Argv());
01966     }
01967 }
01968
01969 void CvsCmdEditorsFiles(MultiFiles *mfarg)
01970 {
01971     if(gCvsPrefs.empty())
01972         return;
01973
01974     MultiFiles mf;
01975     if(mfarg == 0L)
01976     {
01977         if(!BrowserGetMultiFiles("Select the files to get the editors from :", mf))
01978             return;
01979         mfarg = &mf;
01980     }
01981
01982     while(mfarg->next())
01983     {
01984         CvsArgs args;
01985         args.add("editors");
01986
01987         const char *dir = mfarg->add(args);
01988         args.print(dir);
01989         launchCVS(dir, args.Argc(), args.Argv());
01990     }
01991 }
01992
01993 void CvsCmdEditFolder(const char *dir /*= 0L*/, kEditCmdType editType /*= kEditNormal*/)
01994 {
01995     if(gCvsPrefs.empty())
01996         return;
01997
01998     if(dir == 0L)
01999         dir = BrowserGetDirectory("Select a directory to edit :");
02000     if(dir == 0L)
02001         return;
02002
02003     CvsArgs args;
02004     args.add("edit");
02005
02006     switch( editType )
02007     {
02008     default:
02009     case kEditNormal:
02010         // intentionally blank
02011         break;
02012     case kEditReserved:
02013         args.add("-c");
02014         break;
02015     case kEditForce:
02016         args.add("-f");
02017         break;
02018     }
02019
02020     args.print(dir);
02021     launchCVS(dir, args.Argc(), args.Argv());
02022 }
02023
02024 void CvsCmdUneditFolder(const char *dir)
02025 {
02026     if(gCvsPrefs.empty())
02027         return;
02028
02029     if(dir == 0L)
02030         dir = BrowserGetDirectory("Select a directory to unedit :");
02031     if(dir == 0L)
02032         return;
02033
02034     CvsArgs args;
02035     args.add("unedit");
02036
02037     args.print(dir);
02038     launchCVS(dir, args.Argc(), args.Argv());
02039 }
02040
02041 void CvsCmdWatchOnFolder(const char *dir)
02042 {
02043     if(gCvsPrefs.empty())
02044         return;
02045
02046     if(dir == 0L)
02047         dir = BrowserGetDirectory("Select a directory to watch :");
02048     if(dir == 0L)
02049         return;
02050
02051     CvsArgs args;
02052     args.add("watch");
02053     args.add("add");
02054
02055     args.print(dir);
02056     launchCVS(dir, args.Argc(), args.Argv());
02057 }
02058
02059 void CvsCmdWatchOffFolder(const char *dir)
02060 {
02061     if(gCvsPrefs.empty())
02062         return;
02063
02064     if(dir == 0L)
02065         dir = BrowserGetDirectory("Select a directory to unwatch :");
02066     if(dir == 0L)
02067         return;
02068
02069     CvsArgs args;
02070     args.add("watch");
02071     args.add("remove");
02072
02073     args.print(dir);
02074     launchCVS(dir, args.Argc(), args.Argv());
02075 }
02076
02077 void CvsCmdReleaseFolder(const char *dir)
02078 {
02079     if(gCvsPrefs.empty())
02080         return;
02081
02082     if(dir == 0L)
02083         dir = BrowserGetDirectory("Select a directory to release :");
02084     if(dir == 0L)
02085         return;
02086
02087     CStr uppath, folder;
02088     if( !SplitPath(dir, uppath, folder) )
02089     {
02090         cvs_err("Unable to convert path name '%s'\n", dir);
02091         //even thought something didn't work we will try to continue and put all the responsibility onto the user
02092         uppath = dir;
02093         folder = ".";
02094     }
02095
02096     bool removeDirectory = false;
02097
02098     if( !CompatGetRelease(dir, removeDirectory) )
02099     {
02100         return;
02101     }
02102
02103     CvsArgs args;
02104     args.add("release");
02105     if( removeDirectory )
02106         args.add("-d");
02107     args.add(folder);
02108
02109     args.print(uppath);
02110     launchCVS(uppath, args.Argc(), args.Argv());
02111 }
02112
02113 void CvsCmdWatchersFolder(const char *dir)
02114 {
02115     if(gCvsPrefs.empty())
02116         return;
02117
02118     if(dir == 0L)
02119         dir = BrowserGetDirectory("Select a directory to get the watchers from :");
02120     if(dir == 0L)
02121         return;
02122
02123     CvsArgs args;
02124     args.add("watchers");
02125
02126     args.print(dir);
02127     launchCVS(dir, args.Argc(), args.Argv());
02128 }
02129
02130 void CvsCmdEditorsFolder(const char *dir)
02131 {
02132     if(gCvsPrefs.empty())
02133         return;
02134
02135     if(dir == 0L)
02136         dir = BrowserGetDirectory("Select a directory to get the editors from :");
02137     if(dir == 0L)
02138         return;
02139
02140     CvsArgs args;
02141     args.add("editors");
02142
02143     args.print(dir);
02144     launchCVS(dir, args.Argc(), args.Argv());
02145 }
02146
02147 void CvsCmdMacrosAdmin(const char *macroName)
02148 {
02149     if(gCvsPrefs.empty() || !CTcl_Interp::IsAvail())
02150         return;
02151
02152     CTcl_Interp interp;
02153     CStr path = macroName;
02154     CTcl_Interp::Unixfy(path);
02155     interp.DoScriptVar("source \"%s\"", (const char *)path);
02156 }
02157
02158 void
02159 CvsCmdAnnotateFiles(MultiFiles *mfarg)
02160 {
02161     if(gCvsPrefs.empty())
02162         return;
02163
02164     MultiFiles mf;
02165     if(mfarg == 0L)
02166     {
02167         if(!BrowserGetMultiFiles("Select files to annotate :", mf))
02168             return;
02169         mfarg = &mf;
02170     }
02171
02172     bool noRecurs;
02173     bool isDate;
02174     CPStr rev;
02175     bool force;
02176
02177     if(!CompatGetAnnotate(noRecurs, isDate, rev, force))
02178         return;
02179
02180     while(mfarg->next())
02181     {
02182         CStr path, filename, ext, base;
02183         CStr file;
02184         for(int i = 0; ; i++)
02185         {
02186             if(!mfarg->get(i, path, filename))
02187                 break;
02188             // note that filename can contain subfolders
02189
02190             GetExtension(filename, base, ext);
02191
02192             CvsArgs args;
02193             CStr tmpf(base);
02194             if(!rev.empty())
02195             {
02196                 tmpf << "_ann_";
02197                 tmpf << rev;
02198                 tmpf << '_';
02199             }
02200             else
02201                 tmpf << "_ann_";
02202
02203             // convert subfolder names to regular name
02204             FlatenSubFolders(tmpf);
02205
02206             args.add("annotate");
02207             if(noRecurs)
02208             {
02209                 args.add("-l");
02210             }
02211             if(force)
02212             {
02213                 args.add("-f");
02214             }
02215             if(!rev.empty())
02216             {
02217                 args.add(isDate ? "-D" : "-r");
02218                 args.add(rev);
02219             }
02220             args.add(filename);
02221             args.print(path);
02222             file = launchCVS(path, args, (const char *)tmpf, ext);
02223 #ifdef qMacCvsPP
02224             decodeCVS (file);
02225 #endif
02226
02227             if(file.empty())
02228                 continue;
02229
02230             LaunchViewer(file, true);
02231         }
02232     }
02233 }
Generated on Sun Feb 24 01:21:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CvsCommands.h Source File

common/CvsCommands.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * CvsCommands.h --- set of CVS commands
00023  */
00024
00025 #ifndef CVSCOMMANDS_H
00026 #define CVSCOMMANDS_H
00027
00029 typedef enum
00030 {
00031     kEditNormal,
00032     kEditReserved,
00033     kEditForce
00034 } kEditCmdType;
00035
00036 class MultiFiles;
00037
00038 char *cleanUpLogMsg(const char *msg);
00039
00040 void CvsCmdUpdateFolder(const char *dir = 0L, bool queryOnly = false);
00041 void CvsCmdCommitFolder(const char *dir = 0L);
00042 void CvsCmdDiffFolder(const char *dir = 0L);
00043 void CvsCmdAddFolder(const char *dir = 0L);
00044 void CvsCmdLogFolder(const char *dir = 0L);
00045 void CvsCmdStatusFolder(const char *dir = 0L);
00046 void CvsCmdLockFolder(const char *dir = 0L);
00047 void CvsCmdUnlockFolder(const char *dir = 0L);
00048 void CvsCmdTagCreateFolder(const char *dir = 0L);
00049 void CvsCmdTagDeleteFolder(const char *dir = 0L);
00050 void CvsCmdTagBranchFolder(const char *dir = 0L);
00051
00052 void CvsCmdInit(const char *dir = 0L);
00053 void CvsCmdImportModule(const char *dir = 0L);
00054 void CvsCmdCheckoutModule(const char *dir = 0L);
00055 void CvsCmdRtagCreate(void);
00056 void CvsCmdRtagDelete(void);
00057 void CvsCmdRtagBranch(void);
00058
00059 void CvsCmdLogin(void);
00060 void CvsCmdLogout(void);
00061
00062 void CvsCmdUpdateFiles(MultiFiles *mf = 0L, bool queryOnly = false);
00063 void CvsCmdCommitFiles(MultiFiles *mf = 0L);
00064 void CvsCmdDiffFiles(MultiFiles *mf = 0L);
00065 void CvsCmdAnnotateFiles(MultiFiles *mf = 0L);
00066 void CvsCmdLogFiles(MultiFiles *mf = 0L, bool outGraph = false, void *defWnd = 0L);
00067 void CvsCmdAddFiles(MultiFiles *mf = 0L);
00068 void CvsCmdAddBinaryFiles(MultiFiles *mf = 0L);
00069 void CvsCmdAddUnicodeFiles(MultiFiles *mf = 0L);
00070 void CvsCmdRemoveFiles(MultiFiles *mf = 0L);
00071 void CvsCmdStatusFiles(MultiFiles *mf = 0L);
00072 void CvsCmdCancelChangesFiles(MultiFiles *mf = 0L);
00073 void CvsCmdLockFiles(MultiFiles *mf = 0L);
00074 void CvsCmdUnlockFiles(MultiFiles *mf = 0L);
00075 void CvsCmdTagCreateFiles(MultiFiles *mf = 0L);
00076 void CvsCmdTagDeleteFiles(MultiFiles *mf = 0L);
00077 void CvsCmdTagBranchFiles(MultiFiles *mf = 0L);
00078
00079 void CvsCmdLine(void);
00080
00081 void CvsCmdEditFiles(MultiFiles *mf = 0L, kEditCmdType editType = kEditNormal);
00082 void CvsCmdUneditFiles(MultiFiles *mf = 0L);
00083 void CvsCmdWatchOnFiles(MultiFiles *mf = 0L);
00084 void CvsCmdWatchOffFiles(MultiFiles *mf = 0L);
00085 void CvsCmdWatchersFiles(MultiFiles *mf = 0L);
00086 void CvsCmdEditorsFiles(MultiFiles *mf = 0L);
00087
00088 void CvsCmdEditFolder(const char *dir = 0L, kEditCmdType editType = kEditNormal);
00089 void CvsCmdUneditFolder(const char *dir = 0L);
00090 void CvsCmdWatchOnFolder(const char *dir = 0L);
00091 void CvsCmdWatchOffFolder(const char *dir = 0L);
00092 void CvsCmdReleaseFolder(const char *dir = 0L);
00093 void CvsCmdWatchersFolder(const char *dir = 0L);
00094 void CvsCmdEditorsFolder(const char *dir = 0L);
00095
00096 void CvsCmdMacrosAdmin(const char *macroName);
00097     // TO_OBSOLETE
00098
00099 #endif /* CVSCOMMANDS_H */
Generated on Sun Feb 24 01:21:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CvsEntries.cpp Source File

common/CvsEntries.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 1998
00019  */
00020
00021 /*
00022  * CvsEntries.cpp --- adaptation from cvs/src/entries.c
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef macintosh
00028 #   include "GUSIInternal.h"
00029 #   include "GUSIFileSpec.h"
00030 #   define S_IWRITE S_IWUSR
00031 #endif
00032
00033 #include <stdlib.h>
00034 #include <string.h>
00035 #include <sys/types.h>
00036 #include <sys/stat.h>
00037
00038 #include "CvsEntries.h"
00039 #include "AppConsole.h"
00040 #include "getline.h"
00041 #include "FileTraversal.h"
00042
00043 #ifdef WIN32
00044 #   ifdef _DEBUG
00045 #       define new DEBUG_NEW
00046 #       undef THIS_FILE
00047         static char THIS_FILE[] = __FILE__;
00048 #   endif
00049 #   include "WinCvsDebug.h"
00050 #endif /* WIN32 */
00051
00052 #if TIME_WITH_SYS_TIME
00053 #   include <sys/time.h>
00054 #   include <time.h>
00055 #elif HAVE_SYS_TIME_H
00056 #   include <sys/time.h>
00057 #else
00058 #   include <time.h>
00059 #endif
00060
00061 #ifndef NEW
00062 #define NEW new
00063 #endif
00064
00065 static const char* cloneStr(const char* cp)
00066 {
00067     if(cp && *cp)
00068     {
00069         cp = strdup(cp);
00070         if (!cp)
00071         {
00072             throw std::bad_alloc();
00073         }
00074     }
00075     else
00076     {
00077         cp = 0L;
00078     }
00079     return cp;
00080 }
00081
00082 static void disposeStr(const char* cp)
00083 {
00084     if (cp)
00085     {
00086         free((void*)cp);
00087     }
00088 }
00089
00090 EntnodePath::EntnodePath(const char* path) : fullpathname(0L), ref(1)
00091 {
00092     fullpathname = cloneStr(path);
00093 }
00094
00095 EntnodePath::~EntnodePath()
00096 {
00097     disposeStr(fullpathname);
00098 }
00099
00100 const char* EntnodePath::GetFullPathName(UStr & resPath, const char* name) const
00101 {
00102     resPath = fullpathname;
00103     if(!resPath.endsWith(kPathDelimiter))
00104         resPath << kPathDelimiter;
00105     resPath << name;
00106
00107     return resPath;
00108 }
00109
00110 EntnodeData::EntnodeData(const char* name, EntnodePath *path)
00111     : ref(1), missing(false), visited(false), unknown(false),
00112       unmodified(true), ignored(false), locked(false), removed(false),
00113       user(0L), desc(0L), fullpathname(0L)
00114 {
00115 #if TARGET_RT_MAC_CFM
00116     macspec.vRefNum = 0;
00117     macspec.parID = 0;
00118     macspec.name[0] = '\0';
00119 #endif
00120 #if TARGET_RT_MAC_MACHO
00121     memset(&macspec, 0, sizeof(macspec));
00122 #endif
00123     user = cloneStr(name);
00124     fullpathname = path->Ref();
00125 }
00126
00127 EntnodeData::~EntnodeData()
00128 {
00129     disposeStr(user);
00130     if(fullpathname)
00131         fullpathname->UnRef();
00132 }
00133
00134 void EntnodeData::SetDesc(const char *newdesc)
00135 {
00136     desc = newdesc;
00137 }
00138
00139 UStr EntnodeData::sbuffer;
00140
00141 EntnodeFile::~EntnodeFile()
00142 {
00143     disposeStr(vn);
00144     disposeStr(ts);
00145     disposeStr(option);
00146     disposeStr(tag);
00147     disposeStr(date);
00148     disposeStr(ts_conflict);
00149 }
00150
00151 EntnodeFile::EntnodeFile(const char* name, EntnodePath *path, const char *newvn,
00152     const char *newts, const char *newoptions, const char *newtag,
00153     const char *newdate, const char *newts_conflict) : EntnodeData(name, path)
00154 {
00155     vn = 0L;
00156     ts = 0L;
00157     option = 0L;
00158     tag = 0L;
00159     date = 0L;
00160     ts_conflict = 0L;
00161
00162     vn = cloneStr(newvn);
00163     ts = cloneStr(newts);
00164     option = cloneStr(newoptions);
00165     tag = cloneStr(newtag);
00166     date = cloneStr(newdate);
00167     ts_conflict = cloneStr(newts_conflict);
00168
00169     if(newvn != 0L && newvn[0] == '-')
00170         SetRemoved(true);
00171 }
00172
00173 EntnodeFolder::~EntnodeFolder()
00174 {
00175 }
00176
00177 EntnodeFolder::EntnodeFolder(const char* name, EntnodePath *path, const char *newvn,
00178     const char *newts, const char *newoptions, const char *newtag,
00179     const char *newdate, const char *newts_conflict) : EntnodeData(name, path)
00180 {
00181 }
00182
00183 /* Return the next real Entries line.  On end of file, returns NULL.
00184    On error, prints an error message and returns NULL.  */
00185
00186 static EntnodeData * fgetentent(FILE *fpin, const char* path, char *cmd = 0L)
00187 {
00188     EntnodeData *ent;
00189     char *line = 0L;
00190     size_t line_chars_allocated = 0;
00191     register char *cp;
00192     ent_type type;
00193     char *l, *user, *vn, *ts, *options;
00194     char *tag_or_date, *tag, *date, *ts_conflict;
00195     int line_length;
00196
00197     EntnodePath *thePath = new EntnodePath(path);
00198
00199     ent = 0L;
00200     while ((line_length = getline (&line, &line_chars_allocated, fpin)) > 0)
00201     {
00202         l = line;
00203
00204         /* If CMD is not NULL, we are reading an Entries.Log file.
00205         Each line in the Entries.Log file starts with a single
00206         character command followed by a space.  For backward
00207         compatibility, the absence of a space indicates an add
00208         command.  */
00209         if (cmd != 0L)
00210         {
00211             if (l[1] != ' ')
00212                 *cmd = 'A';
00213             else
00214             {
00215                 *cmd = l[0];
00216                 l += 2;
00217             }
00218         }
00219         type = ENT_FILE;
00220
00221         if (l[0] == 'D')
00222         {
00223             type = ENT_SUBDIR;
00224             ++l;
00225             /* An empty D line is permitted; it is a signal that this
00226             Entries file lists all known subdirectories.  */
00227         }
00228
00229         if (l[0] != '/')
00230             continue;
00231
00232         user = l + 1;
00233         if ((cp = strchr (user, '/')) == 0L)
00234             continue;
00235         *cp++ = '\0';
00236         vn = cp;
00237         if ((cp = strchr (vn, '/')) == 0L)
00238             continue;
00239         *cp++ = '\0';
00240         ts = cp;
00241         if ((cp = strchr (ts, '/')) == 0L)
00242             continue;
00243         *cp++ = '\0';
00244         options = cp;
00245         if ((cp = strchr (options, '/')) == 0L)
00246             continue;
00247         *cp++ = '\0';
00248         tag_or_date = cp;
00249         if ((cp = strchr (tag_or_date, '\n')) == 0L
00250 #ifdef macintosh
00251             && (cp = strchr (tag_or_date, '\r')) == 0L
00252 #endif
00253         )
00254             continue;
00255         *cp = '\0';
00256         tag = (char *) 0L;
00257         date = (char *) 0L;
00258         if (*tag_or_date == 'T')
00259             tag = tag_or_date + 1;
00260         else if (*tag_or_date == 'D')
00261             date = tag_or_date + 1;
00262
00263         if ((ts_conflict = strchr (ts, '+')))
00264             *ts_conflict++ = '\0';
00265
00266         if(type == ENT_SUBDIR)
00267             ent = NEW EntnodeFolder(user, thePath);
00268         else
00269             ent = NEW EntnodeFile(user, thePath, vn, ts, options,
00270                 tag, date, ts_conflict);
00271         break;
00272     }
00273
00274     if (line_length < 0 && !feof (fpin))
00275         cvs_err("Cannot read entries file (error %d)\n", errno);
00276
00277     free (line);
00278
00279     thePath->UnRef();
00280
00281     return ent;
00282 }
00283
00284 /* Read the entries file into a list, hashing on the file name.
00285
00286    UPDATE_DIR is the name of the current directory, for use in error
00287    messages, or NULL if not known (that is, noone has gotten around
00288    to updating the caller to pass in the information).  */
00289 bool Entries_Open (CSortList<ENTNODE> & entries, const char *fullpath)
00290 {
00291     EntnodeData *ent;
00292
00293     UStr adminPath(fullpath);
00294     if(!adminPath.endsWith(kPathDelimiter))
00295         adminPath << kPathDelimiter;
00296     adminPath << "CVS";
00297     adminPath << kPathDelimiter;
00298
00299     entries.Reset();
00300     UStr filename = adminPath;
00301     filename << "Entries";
00302     FILE *fpin = fopen(filename, "r");
00303     if (fpin == 0L)
00304         return false;
00305
00306     while ((ent = fgetentent (fpin, fullpath)) != 0L)
00307     {
00308         ENTNODE newnode(ent);
00309         ent->UnRef();
00310
00311         if(entries.InsideAndInsert(newnode))
00312         {
00313             cvs_err("Warning : duplicated entry in the 'CVS/Entries' file in directory '%s'\n",
00314                 fullpath);
00315         }
00316     }
00317
00318     fclose (fpin);
00319
00320     filename = adminPath;
00321     filename << "Entries.log";
00322     fpin = fopen(filename, "r");
00323     if (fpin != 0L)
00324     {
00325         char cmd;
00326
00327         while ((ent = fgetentent (fpin, &cmd)) != 0L)
00328         {
00329             ENTNODE newnode(ent);
00330             ent->UnRef();
00331
00332             switch (cmd)
00333             {
00334             case 'A':
00335                 if(entries.InsideAndInsert(newnode))
00336                 {
00337                     // dont care
00338                 }
00339                 break;
00340             case 'R':
00341                 entries.Delete(newnode);
00342                 break;
00343             default:
00344                 /* Ignore unrecognized commands.  */
00345                 break;
00346             }
00347         }
00348         fclose (fpin);
00349     }
00350     return true;
00351 }
00352
00353 // mostly the cvs one...
00354 static bool unmodified(const struct stat & sb, const char *ts)
00355 {
00356     char *cp;
00357     struct tm *tm_p;
00358     struct tm local_tm;
00359     /* We want to use the same timestamp format as is stored in the
00360     st_mtime.  For unix (and NT I think) this *must* be universal
00361     time (UT), so that files don't appear to be modified merely
00362     because the timezone has changed.  For VMS, or hopefully other
00363     systems where gmtime returns NULL, the modification time is
00364     stored in local time, and therefore it is not possible to cause
00365     st_mtime to be out of sync by changing the timezone.  */
00366     tm_p = gmtime (&sb.st_mtime);
00367     if (tm_p)
00368     {
00369         memcpy (&local_tm, tm_p, sizeof (local_tm));
00370         cp = asctime (&local_tm);   /* copy in the modify time */
00371     }
00372     else
00373         cp = ctime(&sb.st_mtime);
00374
00375     cp[24] = 0;
00376
00377 // [6/8/2001] Jerzy K. - the code has been replaced by the version from cvsnt
00378 //which seems simpler and giving the same effect
00379 //keep it here for a while and remove eventually
00380 #if 0
00381 // Bug 432
00382     if( cp[8]=='0') cp[8]=' ';
00383 //  The C Standard Library and the Unix/cygwin versions of CVS
00384 //  write a padding space before days 1-9; Visual C++ libraries use
00385 //  a leading 0.  This affects ctime() and asctime() calls.  Bug 432
00386 //  adopts the padding space standard.  The following allows for backward
00387 //  compatibility with a WinCVS working area checked out prior to the
00388 //  Bug 432 fix.  (cp is the timestamp from the stat of the working file;
00389 //  ts is the timestamp as read from CVS/Entries).
00390     char *ns = (char *)malloc( (strlen(ts) + 1) * sizeof( char ) );
00391     if ( ns == NULL ) {
00392         cvs_err("Could not allocate memory for string ns\n");
00393         return 1;
00394     }
00395     strcpy( ns, ts );
00396     if( ns[8]=='0') ns[8]=' ';
00397     int compare_result = strcmp(ns, cp);
00398     free( ns );
00399     return compare_result == 0;
00400 // Bug 432
00401 #else
00402
00403     /* Deal with the differences in timestamps - posix uses space filled, NT uses zero filled */
00404     if(cp[8]=='0' && ts[8]==' ')
00405         cp[8]=' ';
00406     if(cp[8]==' ' && ts[8]=='0')
00407         cp[8]='0';
00408
00409     return strcmp(cp, ts) == 0;
00410 #endif
00411 }
00412
00413 EntnodeData *Entries_SetVisited(const char *path, CSortList<ENTNODE> & entries, const char *name,
00414     const struct stat & finfo, bool isFolder, const std::vector<CStr> * ignlist)
00415 {
00416     int index;
00417     bool isCvs = false;
00418
00419     EntnodePath *thePath = new EntnodePath(path);
00420
00421     if(isFolder)
00422     {
00423         EntnodeFolder *adata = NEW EntnodeFolder(name, thePath);
00424         ENTNODE anode(adata);
00425         adata->UnRef();
00426         isCvs = entries.InsideAndInsert(anode, &index);
00427     }
00428     else
00429     {
00430         EntnodeFile *adata = NEW EntnodeFile(name, thePath);
00431         ENTNODE anode(adata);
00432         adata->UnRef();
00433         isCvs = entries.InsideAndInsert(anode, &index);
00434     }
00435
00436     thePath->UnRef();
00437
00438     const ENTNODE & theNode = entries.Get(index);
00439     EntnodeData *data = theNode.Data();
00440     data->SetVisited(true);
00441     if(!isCvs)
00442     {
00443         data->SetUnknown(true);
00444         if(ignlist != 0L && MatchIgnoredList(name, *ignlist))
00445             data->SetIgnored(true);
00446
00447         // the folder may have some cvs informations in it, despite the fact
00448         // that it is not referenced by the parent directory, so try
00449         // to figure it.
00450
00451         if(!data->IsIgnored())
00452         {
00453             CStr cvsFile(path);
00454             if(!cvsFile.endsWith(kPathDelimiter))
00455                 cvsFile << kPathDelimiter;
00456             cvsFile << name;
00457             if(!cvsFile.endsWith(kPathDelimiter))
00458                 cvsFile << kPathDelimiter;
00459             cvsFile << "CVS";
00460             struct stat sb;
00461             if (stat(cvsFile, &sb) != -1 && S_ISDIR(sb.st_mode))
00462             {
00463                 data->SetUnknown(false);
00464             }
00465         }
00466     }
00467
00468     if(isFolder)
00469     {
00470         if(data->IsIgnored())
00471         {
00472             data->SetDesc("Ignored Folder");
00473         }
00474         else if(data->IsUnknown())
00475         {
00476             data->SetDesc("NonCvs Folder");
00477         }
00478         else
00479         {
00480             data->SetDesc("Folder");
00481         }
00482     }
00483     else
00484     {
00485         const char *ts = (*data)[EntnodeFile::kTS];
00486         if(ts == 0L)
00487             data->SetUnmodified(true);
00488         else
00489             data->SetUnmodified(unmodified(finfo, ts));
00490
00491 #if defined(WIN32)
00492         if (GetWinCvsDebugMaskBit(wcvsdbg_trace_modified_checks_bit))
00493         {
00494             char scratch[128];
00495
00496             /* copied from unmodified... */
00497             char *cp;
00498             struct tm *tm_p;
00499             struct tm local_tm;
00500             tm_p = gmtime (& finfo.st_mtime);
00501             if (tm_p)
00502             {
00503                 memcpy (&local_tm, tm_p, sizeof (local_tm));
00504                 cp = asctime (&local_tm);   /* copy in the modify time */
00505             }
00506             else
00507             {
00508                 cp = "NULL";
00509             }
00510
00511             _snprintf(scratch, 128,
00512                 "Checking timestamps for %s: Entries: %s, file: %s --> %s\n",
00513                 name, ts, cp,
00514                 data->IsUnmodified() ? "unmodified" : "modified");
00515             cvs_err(scratch);
00516             OutputDebugString(scratch);
00517         }
00518 #endif
00519
00520         data->SetLocked((finfo.st_mode & S_IWRITE) == 0);
00521
00522         const char *info = 0L;
00523         if(data->IsIgnored())
00524         {
00525             data->SetDesc("Ignored");
00526         }
00527         else if(data->IsUnknown())
00528         {
00529             data->SetDesc("NonCvs file");
00530         }
00531         else if(data->GetConflict() != 0L)
00532         {
00533             data->SetDesc("Conflict");
00534         }
00535         else if((info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-kb") == 0)
00536         {
00537             data->SetDesc(data->IsUnmodified() ? "Binary" : "Mod. Binary");
00538         }
00539         else if((info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-ku") == 0)
00540         {
00541             data->SetDesc(data->IsUnmodified() ? "Unicode" : "Mod. Unicode");
00542         }
00543         else
00544         {
00545             data->SetDesc(data->IsUnmodified() ? "File" : "Mod. File");
00546         }
00547     }
00548
00549     return data;
00550 }
00551
00552 void Entries_SetMissing(CSortList<ENTNODE> & entries)
00553 {
00554     int numEntries = entries.NumOfElements();
00555     for(int i = 0; i < numEntries; i++)
00556     {
00557         const ENTNODE & theNode = entries.Get(i);
00558         EntnodeData *data = theNode.Data();
00559         if(data->IsVisited())
00560             continue;
00561
00562         data->SetMissing(true);
00563         data->SetDesc(data->IsRemoved() ? "Removed" : "Missing");
00564     }
00565 }
00566
00567 bool Tag_Open(CStr & tag, const char *fullpath)
00568 {
00569     tag = "";
00570     CStr tagFile(fullpath);
00571     if(!tagFile.endsWith(kPathDelimiter))
00572         tagFile << kPathDelimiter;
00573     tagFile << "Tag";
00574
00575     FILE *fpin = fopen(tagFile, "r");
00576     if (fpin == 0L)
00577         return false;
00578
00579     char *line = 0L;
00580     size_t line_chars_allocated = 0;
00581     int line_length;
00582     if((line_length = getline (&line, &line_chars_allocated, fpin)) > 0)
00583     {
00584         char *tmp = strchr(line, '\n');
00585         if(tmp != 0L)
00586             *tmp = '\0';
00587         if(line[0] == 'T')
00588             tag = line + 1;
00589     }
00590     if(line != 0L)
00591         free(line);
00592     if (line_length < 0 && !feof (fpin))
00593     {
00594         cvs_err("Cannot open Tag file in '%s' (error %d)\n", fullpath, errno);
00595         return false;
00596     }
00597
00598     fclose (fpin);
00599     return !tag.empty();
00600 }
Generated on Sun Feb 24 01:21:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CvsEntries.h Source File

common/CvsEntries.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 1998
00019  * Modified: Jerzy Kaczorowski <kaczoroj@hotmail.com> - 27 Jan 2001 - fix warning C4800 (Add "0 != " for all the int variables forced to bool value)
00020  */
00021
00022 /*
00023  * CvsEntries.h --- adaptation from cvs/src/entries.c
00024  */
00025
00026 #ifndef CVSENTRIES_H
00027 #define CVSENTRIES_H
00028
00029 #include "SortList.h"
00030 #include "CvsIgnore.h"
00031 #include "TextBinary.h"
00032
00033 typedef enum
00034 {
00035     ENT_FILE,
00036     ENT_SUBDIR
00037 } ent_type;
00038
00039 // ref counted full path description, see below
00040 class EntnodePath
00041 {
00042 protected:
00043     // reference counted, we don't use delete on it.
00044     ~EntnodePath();
00045 public:
00046     EntnodePath(const char* path);
00047
00048     // ref counting
00049     inline EntnodePath *Ref(void) {++ref; return this;}
00050     inline EntnodePath *UnRef(void)
00051     {
00052         if(--ref == 0)
00053         {
00054             delete this;
00055             return 0L;
00056         }
00057         return this;
00058     }
00059
00060     const char* GetFullPathName(UStr & resPath, const char* name) const;
00061     inline const char* GetFolderPath(void) const { return fullpathname; }
00062
00063 protected:
00064     const char* fullpathname; // fully qualified pathname of the folder containing the item
00065     int ref;
00066 };
00067
00068 class EntnodeData
00069 {
00070 // Construction
00071 protected:
00072     // used by derived classes only
00073     EntnodeData(const char* name, EntnodePath *path);
00074
00075     // cannot use 'delete', use UnRef() instead.
00076     virtual ~EntnodeData();
00077
00078 public:
00079
00080     enum
00081     {
00082         kName = 0,
00083         kStatus = 3,
00084         kPath = 7
00085     };
00086
00087     virtual ent_type GetType(void) const = 0;
00088     inline static int Compare(const EntnodeData & node1, const EntnodeData & node2)
00089     {
00090 #ifdef WIN32
00091         return stricmp(node1.user, node2.user);
00092 #else /* !WIN32 */
00093         return strcmp(node1.user, node2.user);
00094 #endif /* !WIN32 */
00095     }
00096     inline EntnodeData *Ref(void) {++ref; return this;}
00097     inline EntnodeData *UnRef(void)
00098     {
00099         if(--ref == 0)
00100         {
00101             delete this;
00102             return 0L;
00103         }
00104         return this;
00105     }
00106
00107     virtual const char *operator[](int index) const
00108     {
00109         if(index == kName)
00110             return user;
00111         else if(index == kStatus)
00112             return desc;
00113         else if(index == kPath)
00114             return GetFullPathName(sbuffer);
00115         return 0L;
00116     }
00117
00118     inline void SetMissing(bool state) {missing = state;}
00119     inline bool IsMissing(void) const {return 0 != missing;}
00120     inline void SetVisited(bool state) {visited = state;}
00121     inline bool IsVisited(void) const {return 0 != visited;}
00122     inline void SetUnknown(bool state) {unknown = state;}
00123     inline bool IsUnknown(void) const {return 0 != unknown;}
00124     inline void SetIgnored(bool state) {ignored = state;}
00125     inline bool IsIgnored(void) const {return 0 != ignored;}
00126     inline void SetLocked(bool state) {locked = state;}
00127     inline bool IsLocked(void) const {return 0 != locked;}
00128     inline void SetRemoved(bool state) {removed = state;}
00129     inline bool IsRemoved(void) const {return 0 != removed;}
00130     void SetDesc(const char *newdesc);
00131     inline const char *GetDesc(void) const {return desc;}
00132
00133     // accessor for item name
00134     const char* GetName(void) const
00135     {
00136         return user;
00137     }
00138
00139     // accessor for fully qualified item name
00140     const char* GetFullPathName(UStr & resPath) const
00141     {
00142         return fullpathname->GetFullPathName(resPath, user);
00143     }
00144
00145     // accessor for fully qualified folder name of the item
00146     inline const char* GetFolderPath(void) const
00147     {
00148         return fullpathname->GetFolderPath();
00149     }
00150
00151     // returns non-null if this is a files that is marked as having merge conflict
00152     virtual const char* GetConflict() const
00153     {
00154         return 0L;
00155     }
00156
00157     inline void SetUnmodified(bool state) {unmodified = state;}
00158     inline bool IsUnmodified(void) const {return 0 != unmodified;}
00159
00160 #ifdef macintosh
00161     UFSSpec & MacSpec(void) {return macspec;}
00162     const UFSSpec & GetMacSpec(void) const {return macspec;}
00163 #endif /* macintosh */
00164 protected:
00165     int ref;
00166     int missing : 1;
00167     int visited : 1;
00168     int unknown : 1;
00169     int unmodified : 1;
00170     int ignored : 1;
00171     int locked : 1;
00172     int removed : 1;
00173 #ifdef macintosh
00174     UFSSpec macspec;
00175 #endif /* macintosh */
00176 private:
00177     const char* user; // name of this item
00178     const char* desc; // its description
00179     EntnodePath *fullpathname; // fully qualified pathname of the folder containing the item
00180
00181     static UStr sbuffer;
00182 };
00183
00184 class EntnodeFile : public EntnodeData
00185 {
00186 public:
00187     EntnodeFile(const char* name, EntnodePath *path, const char *newvn = 0L,
00188         const char *newts = 0L, const char *newoptions = 0L,
00189         const char *newtag = 0L, const char *newdate = 0L,
00190         const char *newts_conflict = 0L);
00191 protected:
00192     // cannot use 'delete', use UnRef() instead.
00193     virtual ~EntnodeFile();
00194
00195 // Attribute access
00196 public:
00197
00198     enum
00199     {
00200         kVN = 1,
00201         kTS = 5,
00202         kOption = 2,
00203         kTag = 4,
00204         kConflict = 6
00205     };
00206
00207     // access fields
00208     virtual const char *operator[](int index) const
00209     {
00210         if(index == kVN)
00211             return vn;
00212         else if(index == kTS)
00213             return ts;
00214         else if(index == kOption)
00215             return option;
00216         else if(index == kTag)
00217             return tag != 0L ? tag : date;
00218         else if(index == kConflict)
00219             return ts_conflict;
00220
00221         return EntnodeData::operator[](index);
00222     }
00223
00224     virtual ent_type GetType(void) const
00225     {
00226         return ENT_FILE;
00227     }
00228
00229     // returns non-null if this is a files that is marked as having merge conflict
00230     virtual const char* GetConflict() const
00231     {
00232         return ts_conflict;
00233     }
00234
00235 protected:
00236     const char *vn;
00237     const char *ts;
00238     const char *option;
00239     const char *tag; // can be nil
00240     const char *date; // can be nil
00241     const char *ts_conflict; // can be nil
00242 };
00243
00244 class EntnodeFolder : public EntnodeData
00245 {
00246 // Construction
00247 public:
00248     EntnodeFolder(const char* name, EntnodePath * path, const char *newvn = 0L,
00249         const char *newts = 0L, const char *newoptions = 0L, const char *newtag = 0L,
00250         const char *newdate = 0L, const char *newts_conflict = 0L);
00251
00252 protected:
00253     // cannot use 'delete', use UnRef() instead.
00254     virtual ~EntnodeFolder();
00255
00256 // Attribute access
00257 public:
00258     // access fields
00259     virtual const char *operator[](int index) const
00260     {
00261         return EntnodeData::operator[](index);
00262     }
00263
00264     virtual ent_type GetType(void) const
00265     {
00266         return ENT_SUBDIR;
00267     }
00268
00269 protected:
00270 };
00271
00272 // ENTNODE gets a node file or a node folder
00273 // and reference it.
00274 class ENTNODE
00275 {
00276 public:
00277     ENTNODE() : shareData(0L) {}
00278     ENTNODE(EntnodeData *data) : shareData(data->Ref()) {}
00279     ENTNODE(EntnodeData & data) : shareData(data.Ref()) {}
00280     ENTNODE(const ENTNODE & anode) : shareData(0L)
00281     {
00282         *this = anode;
00283     }
00284     ~ENTNODE()
00285     {
00286         if(shareData != 0L)
00287             shareData->UnRef();
00288     }
00289
00290     inline static int Compare(const ENTNODE & node1, const ENTNODE & node2)
00291     {
00292         return EntnodeData::Compare(*node1.shareData, *node2.shareData);
00293     }
00294
00295     inline ENTNODE & operator=(const ENTNODE & anode)
00296     {
00297         EntnodeData* oldData = shareData;
00298         shareData = anode.shareData;
00299         if(shareData != 0L)
00300         {
00301             shareData->Ref();
00302         }
00303         if(oldData != 0L)
00304         {
00305             oldData->UnRef();
00306         }
00307         return *this;
00308     }
00309
00310     inline EntnodeData* Data() const { return shareData; }
00311     inline operator EntnodeData *() const { return shareData; }
00312
00313 protected:
00314     EntnodeData *shareData;
00315 };
00316
00317 bool Entries_Open (CSortList<ENTNODE> & entries, const char *fullpath);
00318     // return false if no CVS/Entries
00319
00320 EntnodeData *Entries_SetVisited(const char *path, CSortList<ENTNODE> & entries, const char *name,
00321     const struct stat & finfo, bool isFolder, const std::vector<CStr> * ignlist = 0L);
00322     // fill an ENTNODE when the file appears on the disk : it set
00323     // some flags like "visited", "unknown", "ignored"... and return
00324     // a reference to the node.
00325
00326 void Entries_SetMissing(CSortList<ENTNODE> & entries);
00327     // After the traversal and for the entries which didn't have a
00328     // "Entries_SetVisited" call associated with, mark them to be "missing".
00329
00330 bool Tag_Open(CStr & tag, const char *fullpath);
00331     // return false if no CVS/Tag
00332
00333 #endif /* CVSENTRIES_H */
Generated on Sun Feb 24 01:21:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/cvsgui.c Source File

common/cvsgui.c

Go to the documentation of this file.
00001 /*
00002 ** The cvsgui protocol used by WinCvs
00003 **
00004 ** This library is free software; you can redistribute it and/or
00005 ** modify it under the terms of the GNU Lesser General Public
00006 ** License as published by the Free Software Foundation; either
00007 ** version 2.1 of the License, or (at your option) any later version.
00008 **
00009 ** This library is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 ** Lesser General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU Lesser General Public
00015 ** License along with this library; if not, write to the Free Software
00016 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 */
00018
00019 /*
00020  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- November 1999
00021  */
00022
00023 /*
00024  * cvsgui.c --- glue code for communicating with cvs over pipes
00025  */
00026
00027 #ifdef HAVE_CONFIG_H
00028 #include "config.h"
00029 #endif
00030
00031 #include <string.h>
00032 #include <stdio.h>
00033 #include <limits.h>
00034
00035 #if defined(WIN32) && !defined(PATH_MAX)
00036 #   ifdef _MAX_PATH
00037 #       define PATH_MAX _MAX_PATH
00038 #   else
00039 #       define PATH_MAX 512
00040 #   endif
00041 #endif
00042
00043 #include "cvsgui_process.h"
00044 #include "cvsgui_protocol.h"
00045
00046 #undef main
00047 #undef getpass
00048 #undef getenv
00049 #undef exit
00050
00051 #ifdef WIN32
00052     extern char *getpass(const char *prompt);
00053 #endif
00054
00055 pipe_t _cvsgui_readfd = 0;
00056 pipe_t _cvsgui_writefd = 0;
00057
00058 static long outseek;
00059 static long errseek;
00060 static char outname[PATH_MAX] = {0};
00061 static char errname[PATH_MAX] = {0};
00062 static FILE *outlog;
00063 static FILE *errlog;
00064
00065 char * cvsguiglue_getenv(const char *env)
00066 {
00067     char *res = 0L;
00068
00069     if(_cvsgui_readfd == 0)
00070         return getenv(env);
00071
00072     cvsguiglue_flushconsole(0);
00073
00074     if(env && gp_getenv_write (_cvsgui_writefd, env))
00075     {
00076         res = gp_getenv_read(_cvsgui_readfd);;
00077     }
00078
00079     return res;
00080 }
00081
00082 char * cvsguiglue_getpass(const char *prompt)
00083 {
00084     cvsguiglue_flushconsole(0);
00085
00086     if(_cvsgui_readfd == 0)
00087         return getpass(prompt);
00088
00089     return cvsguiglue_getenv("CVS_GETPASS");
00090 }
00091
00092 void cvsguiglue_exit(int code)
00093 {
00094     cvsguiglue_flushconsole(1);
00095
00096     if(_cvsgui_writefd != 0)
00097         gp_quit_write (_cvsgui_writefd, code);
00098     exit(code);
00099 }
00100
00101 static void reopen_consoles(void)
00102 {
00103 #if !defined(WIN32) && !defined(__GNUC__)
00104     strcpy(outname, tempnam(0L, 0L));
00105     strcpy(errname, tempnam(0L, 0L));
00106     strcat(outname, ".out");
00107     strcat(errname, ".err");
00108
00109     outlog = freopen(outname, "w+", stdout);
00110     if(outlog == 0L)
00111     {
00112         fprintf(stderr, "Unable to reopen stdout !\n");
00113         exit(1);
00114     }
00115     errlog = freopen(errname, "w+", stderr);
00116     if(errlog == 0L)
00117     {
00118         fprintf(stderr, "Unable to reopen stderr !\n");
00119         exit(1);
00120     }
00121
00122     outseek = 0;
00123     errseek = 0;
00124 #endif
00125 }
00126
00127 static void
00128 close_consoles(void)
00129 {
00130 #if !defined(WIN32) && !defined(__GNUC__)
00131     if(outlog != 0L)
00132         fclose(outlog);
00133     if(errlog != 0L)
00134         fclose(errlog);
00135     if(outname[0])
00136         unlink(outname);
00137     if(errname[0])
00138         unlink(errname);
00139     outlog = 0L;
00140     errlog = 0L;
00141     outname[0] = '\0';
00142     errname[0] = '\0';
00143 #endif
00144 }
00145
00146 static void
00147 myflush(FILE *log, long *oldpos)
00148 {
00149     long newpos, pos;
00150 #   define BUF_SIZE 8000
00151     char buf[BUF_SIZE];
00152     size_t len;
00153
00154     pos = fseek(log, *oldpos, SEEK_SET);
00155     if(pos != 0)
00156         goto fail;
00157
00158     while(!feof(log) && !ferror(log))
00159     {
00160         len = fread(buf, sizeof(char), BUF_SIZE, log);
00161         if(len > 0)
00162         {
00163             if(log == outlog)
00164                 gp_console_write (_cvsgui_writefd, buf, len, 0);
00165             if(log == errlog)
00166                 gp_console_write (_cvsgui_writefd, buf, len, 1);
00167         }
00168     }
00169
00170     if(ferror(log))
00171         goto fail;
00172
00173     newpos = ftell(log);
00174     if(newpos < 0)
00175         goto fail;
00176
00177     *oldpos = newpos;
00178     return;
00179 fail:
00180     fprintf(stderr, "Unable to redirect stdout/stderr !\n");
00181 }
00182
00183 void
00184 cvsguiglue_flushconsole(int closeit)
00185 {
00186     fflush(stdout);
00187     fflush(stderr);
00188
00189 #if !defined(WIN32) && !defined(__GNUC__)
00190     if(outlog != 0L)
00191         myflush(outlog, &outseek);
00192     if(errlog != 0L)
00193         myflush(errlog, &errseek);
00194     if(closeit)
00195         close_consoles();
00196 #endif
00197 }
00198
00199 int main(int argc, char *argv[])
00200 {
00201     int res;
00202     char **tmparg = 0L;
00203
00204     if(argc >= 4 && strcmp(argv[1], "-cvsgui") == 0)
00205     {
00206         int i;
00207
00208         _cvsgui_readfd = (pipe_t)atoi (argv[2]);
00209         _cvsgui_writefd = (pipe_t)atoi (argv[3]);
00210
00211         tmparg = (char **)malloc((argc - 2) * sizeof(char *));
00212         if(tmparg == 0L)
00213             goto ignore;
00214
00215         tmparg[0] = argv[0];
00216         for(i = 4; i < argc; i++)
00217         {
00218             tmparg[i - 3] = argv[i];
00219         }
00220         tmparg[argc - 3] = 0L;
00221         argc -= 3;
00222
00223         cvs_process_init();
00224         reopen_consoles();
00225     }
00226
00227 ignore:
00228     res = cvsguiglue_main(argc, tmparg != 0L ? tmparg :  argv);
00229
00230     if(tmparg != 0L)
00231     {
00232         cvsguiglue_flushconsole(1);
00233         if(_cvsgui_writefd != 0)
00234             gp_quit_write (_cvsgui_writefd, res);
00235         free(tmparg);
00236     }
00237
00238     return res;
00239 }
Generated on Sun Feb 24 01:21:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/cvsgui.h Source File

common/cvsgui.h

Go to the documentation of this file.
00001 /*
00002 ** The cvsgui protocol used by WinCvs
00003 **
00004 ** This library is free software; you can redistribute it and/or
00005 ** modify it under the terms of the GNU Lesser General Public
00006 ** License as published by the Free Software Foundation; either
00007 ** version 2.1 of the License, or (at your option) any later version.
00008 **
00009 ** This library is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 ** Lesser General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU Lesser General Public
00015 ** License along with this library; if not, write to the Free Software
00016 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 */
00018
00019 /*
00020  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- November 1999
00021  */
00022
00023 /*
00024  * cvsgui.h --- glue code for communicating with cvs over pipes
00025  */
00026
00027 #ifndef CVSGUI_H
00028 #define CVSGUI_H
00029
00030 #include <stdlib.h>
00031
00032 #ifdef HAVE_UNISTD_H
00033 #   include <unistd.h>
00034 #endif
00035
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039
00040 /*
00041  * glue code to intercept some low level calls and tunnel them
00042  * inside the communication pipes.
00043  */
00044 #define getenv cvsguiglue_getenv
00045 #define getpass cvsguiglue_getpass
00046
00047 // RCH - extra #define for Solaris
00048 #define getpassphrase cvsguiglue_getpass
00049
00050 #define main cvsguiglue_main
00051 #define exit cvsguiglue_exit
00052
00053 extern char * cvsguiglue_getenv(const char *env);
00054 extern char * cvsguiglue_getpass(const char *prompt);
00055 extern int cvsguiglue_main(int argc, char *argv[]);
00056 extern void cvsguiglue_exit(int code);
00057 extern void cvsguiglue_flushconsole(int closeit);
00058
00059 // Mach-o OSX
00060 #if TARGET_RT_MAC_MACHO
00061 #   define CVSGUI_PIPE                      // cvs protocol
00062 #   define BINHEX_STUFF                     // resource fork encoding/deconding
00063 #   define O_BINARY 0x8000                  // not defined on OSX
00064 #   define BROKEN_READWRITE_CONVERSION      // required for BINHEX_STUFF
00065 #   define MACOS                            // Necessary for Z Library
00066 #endif
00067
00068 #ifdef __cplusplus
00069 }
00070 #endif
00071
00072 #endif /* CVSGUI_H */
Generated on Sun Feb 24 01:21:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/cvsgui_process.cpp Source File

common/cvsgui_process.cpp

Go to the documentation of this file.
00001 /*
00002 ** The cvsgui protocol used by WinCvs
00003 **
00004 ** This library is free software; you can redistribute it and/or
00005 ** modify it under the terms of the GNU Lesser General Public
00006 ** License as published by the Free Software Foundation; either
00007 ** version 2.1 of the License, or (at your option) any later version.
00008 **
00009 ** This library is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 ** Lesser General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU Lesser General Public
00015 ** License along with this library; if not, write to the Free Software
00016 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 */
00018
00019 /*
00020  * plugin.c from the GIMP modified for the cvsgui project by :
00021  * Alexandre Parenteau <aubonbeurre@hotmail.com> --- November 1999
00022  */
00023
00024 #ifdef HAVE_CONFIG_H
00025 #include "config.h"
00026 #endif
00027
00028 #ifdef HAVE_STRINGS_H
00029 #include <strings.h>
00030 #endif
00031
00032 #include <errno.h>
00033 #include <signal.h>
00034 #include <stdlib.h>
00035 #include <stdio.h>
00036 #include <string.h>
00037 #include <sys/types.h>
00038 #include <sys/stat.h>
00039 #include <time.h>
00040
00041 #ifndef WIN32
00042 #   include <sys/wait.h>
00043 #   include <sys/time.h>
00044 #   include <sys/param.h>
00045 #   include <unistd.h>
00046 #endif
00047
00048 #include <stack>
00049 #include <vector>
00050 #include <algorithm>
00051
00052 #if TARGET_RT_MAC_MACHO
00053 #   define STD_STL std::
00054     // probable transitory problem with MWERKS on Mach-O
00055 #else
00056 #   define STD_STL std::
00057 #endif
00058
00059 #include "cvsgui_process.h"
00060 #include "cvsgui_protocol.h"
00061
00062 static int  cvs_process_write                 (pipe_t                fd,
00063                                            guint8            *buf,
00064                                            gulong             count);
00065 static int  cvs_process_flush                 (pipe_t                fd);
00066 static void cvs_process_push                  (CvsProcess            *cvs_process);
00067 static void cvs_process_pop                   (void);
00068 static void cvs_process_recv_message          (CvsProcess *p);
00069 static void cvs_process_handle_message        (WireMessage       *msg);
00070 static void cvs_process_close (CvsProcess *cvs_process, int kill_it);
00071 static void cvs_process_destroy (CvsProcess *cvs_process);
00072 static CvsProcess* cvs_process_new (char *name, int argc, char **argv);
00073
00074 static STD_STL deque<CvsProcess *> cvs_process_stack;
00075 static STD_STL vector<CvsProcess *> open_cvs_process;
00076 static CvsProcess *current_cvs_process = NULL;
00077 static int current_write_buffer_index = 0;
00078 static char *current_write_buffer = NULL;
00079
00080 static char process_write_buffer[WRITE_BUFFER_SIZE];    /* Buffer for writing, only for the process */
00081
00082 #ifdef WIN32
00083 // use the runtime to initialize/delete a critical section
00084 class CDummyInit
00085 {
00086 public:
00087     CDummyInit()
00088     {
00089         ::InitializeCriticalSection(&m_destroylock);
00090         ::InitializeCriticalSection(&m_stacklock);
00091     }
00092
00093     ~CDummyInit()
00094     {
00095         ::DeleteCriticalSection(&m_destroylock);
00096         ::DeleteCriticalSection(&m_stacklock);
00097     }
00098
00099     static CRITICAL_SECTION m_destroylock;
00100     static CRITICAL_SECTION m_stacklock;
00101 } sDummyObject;
00102
00103 CRITICAL_SECTION CDummyInit::m_destroylock;
00104 CRITICAL_SECTION CDummyInit::m_stacklock;
00105 #endif
00106
00107 #ifdef WIN32
00108 static int write(pipe_t fd, const void *buf, int count)
00109 {
00110     DWORD dwrite;
00111     if(!WriteFile(fd,buf,count,&dwrite,NULL))
00112     {
00113         errno = EINVAL;
00114         return -1;
00115     }
00116     return dwrite;
00117 }
00118 #endif
00119
00120 #ifndef WIN32
00121 struct CDestroyThreadLock
00122 {
00123 public:
00124     inline CDestroyThreadLock()
00125     {
00126     }
00127     inline ~CDestroyThreadLock()
00128     {
00129     }
00130 };
00131 struct CStackThreadLock
00132 {
00133 public:
00134     inline CStackThreadLock()
00135     {
00136     }
00137     inline ~CStackThreadLock()
00138     {
00139     }
00140 };
00141 #else
00142 struct CDestroyThreadLock
00143 {
00144 public:
00145     inline CDestroyThreadLock()
00146     {
00147         EnterCriticalSection(&CDummyInit::m_destroylock);
00148     }
00149     inline ~CDestroyThreadLock()
00150     {
00151         LeaveCriticalSection(&CDummyInit::m_destroylock);
00152     }
00153 };
00154 struct CStackThreadLock
00155 {
00156 public:
00157     inline CStackThreadLock()
00158     {
00159         EnterCriticalSection(&CDummyInit::m_stacklock);
00160     }
00161     inline ~CStackThreadLock()
00162     {
00163         LeaveCriticalSection(&CDummyInit::m_stacklock);
00164     }
00165 };
00166 #endif
00167
00168 static void
00169 _gp_quit_read (pipe_t fd, WireMessage *msg)
00170 {
00171     GPT_QUIT *t = (GPT_QUIT *)malloc(sizeof(GPT_QUIT));
00172     if(t == 0L)
00173         return;
00174
00175     if (!wire_read_int32 (fd, (guint32 *)&t->code, 1))
00176         return;
00177
00178     msg->data = t;
00179 }
00180
00181 static void
00182 _gp_quit_write (pipe_t fd, WireMessage *msg)
00183 {
00184     GPT_QUIT *t = (GPT_QUIT *)msg->data;
00185     if (!wire_write_int32 (fd, (guint32 *)&t->code, 1))
00186         return;
00187 }
00188
00189 static void
00190 _gp_quit_destroy (WireMessage *msg)
00191 {
00192     free(msg->data);
00193 }
00194
00195 static void
00196 _gp_getenv_read (pipe_t fd, WireMessage *msg)
00197 {
00198     GPT_GETENV *t = (GPT_GETENV *)malloc(sizeof(GPT_GETENV));
00199     if(t == 0L)
00200         return;
00201
00202     if (!wire_read_int8 (fd, &t->empty, 1))
00203         return;
00204     if (!wire_read_string (fd, &t->str, 1))
00205         return;
00206
00207     msg->data = t;
00208 }
00209
00210 static void
00211 _gp_getenv_write (pipe_t fd, WireMessage *msg)
00212 {
00213     GPT_GETENV *t = (GPT_GETENV *)msg->data;
00214     if (!wire_write_int8 (fd, &t->empty, 1))
00215         return;
00216     if (!wire_write_string (fd, &t->str, 1))
00217         return;
00218 }
00219
00220 static void
00221 _gp_getenv_destroy (WireMessage *msg)
00222 {
00223     GPT_GETENV *t = (GPT_GETENV *)msg->data;
00224     free(t->str);
00225     free(t);
00226 }
00227
00228 static void
00229 _gp_console_read (pipe_t fd, WireMessage *msg)
00230 {
00231     GPT_CONSOLE *t = (GPT_CONSOLE *)malloc(sizeof(GPT_CONSOLE));
00232     if(t == 0L)
00233         return;
00234
00235     if (!wire_read_int8 (fd, &t->isStderr, 1))
00236         return;
00237     if (!wire_read_int32 (fd, &t->len, 1))
00238         return;
00239     if (!wire_read_string (fd, &t->str, 1))
00240         return;
00241
00242     msg->data = t;
00243 }
00244
00245 static void
00246 _gp_console_write (pipe_t fd, WireMessage *msg)
00247 {
00248     GPT_CONSOLE *t = (GPT_CONSOLE *)msg->data;
00249     if (!wire_write_int8 (fd, &t->isStderr, 1))
00250         return;
00251     if (!wire_write_int32 (fd, &t->len, 1))
00252         return;
00253     if (!wire_write_string (fd, &t->str, 1))
00254         return;
00255 }
00256
00257 static void
00258 _gp_console_destroy (WireMessage *msg)
00259 {
00260     GPT_CONSOLE *t = (GPT_CONSOLE *)msg->data;
00261     free(t->str);
00262     free(t);
00263 }
00264
00265 static void
00266 gp_init ()
00267 {
00268     wire_register (GP_QUIT,
00269                    _gp_quit_read,
00270                    _gp_quit_write,
00271                    _gp_quit_destroy);
00272     wire_register (GP_GETENV,
00273                    _gp_getenv_read,
00274                    _gp_getenv_write,
00275                    _gp_getenv_destroy);
00276     wire_register (GP_CONSOLE,
00277                    _gp_console_read,
00278                    _gp_console_write,
00279                    _gp_console_destroy);
00280 }
00281
00282 int
00283 gp_quit_write (pipe_t fd, int code)
00284 {
00285     WireMessage msg;
00286     GPT_QUIT *t = (GPT_QUIT *)malloc(sizeof(GPT_QUIT));
00287
00288     msg.type = GP_QUIT;
00289     msg.data = t;
00290
00291     t->code = code;
00292
00293     if (!wire_write_msg (fd, &msg))
00294         return FALSE;
00295     if (!wire_flush (fd))
00296         return FALSE;
00297
00298     return TRUE;
00299 }
00300
00301 int
00302 gp_getenv_write (pipe_t fd, const char *env)
00303 {
00304     WireMessage msg;
00305     GPT_GETENV *t = (GPT_GETENV *)malloc(sizeof(GPT_GETENV));
00306
00307     msg.type = GP_GETENV;
00308     msg.data = t;
00309
00310     t->empty = env == 0L;
00311     t->str = strdup(env == 0L ? "" : env);
00312
00313     if (!wire_write_msg (fd, &msg))
00314         return FALSE;
00315     wire_destroy (&msg);
00316     if (!wire_flush (fd))
00317         return FALSE;
00318     return TRUE;
00319 }
00320
00321 char *
00322 gp_getenv_read (pipe_t fd)
00323 {
00324     WireMessage msg;
00325     char *res;
00326
00327     memset (&msg, 0, sizeof (WireMessage));
00328     if (!wire_read_msg (fd, &msg) || msg.type != GP_GETENV)
00329     {
00330         fprintf(stderr, "cvsgui protocol error !\n");
00331         exit(-1);
00332     }
00333     GPT_GETENV *t = (GPT_GETENV *)msg.data;
00334     res = t->empty ? 0L : strdup(t->str);
00335     wire_destroy (&msg);
00336
00337     return res;
00338 }
00339
00340 #ifdef WIN32
00341 extern "C"
00342 #endif
00343 int  gp_console_write (pipe_t fd, const char *str, int len, int isStderr)
00344 {
00345     WireMessage msg;
00346     GPT_CONSOLE *t = (GPT_CONSOLE *)malloc(sizeof(GPT_CONSOLE));
00347
00348     msg.type = GP_CONSOLE;
00349     msg.data = t;
00350
00351     t->isStderr = isStderr;
00352     t->len = len;
00353     t->str = (char *)malloc((len + 1) * sizeof(char));
00354     memcpy(t->str, str, len * sizeof(char));
00355     t->str[len] = '\0';
00356
00357     if (!wire_write_msg (fd, &msg))
00358         return FALSE;
00359     if (!wire_flush (fd))
00360         return FALSE;
00361     return TRUE;
00362 }
00363
00364 void
00365 cvs_process_init ()
00366 {
00367     /* initialize the gimp protocol library and set the read and
00368      *  write handlers.
00369      */
00370     gp_init ();
00371     wire_set_writer (cvs_process_write);
00372     wire_set_flusher (cvs_process_flush);
00373 }
00374
00375 static CvsProcess*
00376 cvs_process_new (char *path, int argc, char **argv)
00377 {
00378     CvsProcess *cvs_process;
00379
00380     cvs_process_init();
00381
00382     cvs_process = (CvsProcess *)malloc(sizeof(CvsProcess));
00383     if(cvs_process == 0L)
00384         return 0L;
00385
00386     cvs_process->open = FALSE;
00387     cvs_process->destroy = FALSE;
00388 #ifdef WIN32
00389     cvs_process->starting = TRUE;
00390 #endif
00391     cvs_process->pid = 0;
00392     cvs_process->callbacks = 0L;
00393     cvs_process->argc = argc + 4;
00394     cvs_process->args = (char **)malloc((cvs_process->argc + 1) * sizeof(char *));
00395     cvs_process->args[0] = strdup (path);
00396     cvs_process->args[1] = strdup ("-cvsgui");
00397     cvs_process->args[2] = (char *)malloc(16 * sizeof(char));
00398     cvs_process->args[3] = (char *)malloc(16 * sizeof(char));
00399     for(int i = 0; i < argc; i++)
00400     {
00401         cvs_process->args[4 + i] = strdup(argv[i]);
00402     }
00403
00404     cvs_process->args[cvs_process->argc] = 0L;
00405     cvs_process->my_read = 0;
00406     cvs_process->my_write = 0;
00407     cvs_process->his_read = 0;
00408     cvs_process->his_write = 0;
00409     cvs_process->write_buffer_index = 0;
00410     cvs_process->pstdin = 0;
00411     cvs_process->pstdout = 0;
00412     cvs_process->pstderr = 0;
00413 #ifdef WIN32
00414     memset(cvs_process->threads, 0, sizeof(cvs_process->threads));
00415     memset(cvs_process->threadsID, 0, sizeof(cvs_process->threadsID));
00416 #endif
00417
00418     return cvs_process;
00419 }
00420
00421 static void
00422 cvs_process_destroy (CvsProcess *cvs_process)
00423 {
00424     if (cvs_process)
00425     {
00426         cvs_process_close (cvs_process, TRUE);
00427
00428         if(cvs_process->args != 0L)
00429         {
00430             for(int i = 0; i < cvs_process->argc; i++)
00431             {
00432                 if (cvs_process->args[i])
00433                 {
00434                     free (cvs_process->args[i]);
00435                     cvs_process->args[i] = 0L;
00436                 }
00437             }
00438             free(cvs_process->args);
00439             cvs_process->args = 0L;
00440         }
00441
00442         if (cvs_process == current_cvs_process)
00443             cvs_process_pop ();
00444
00445         if (!cvs_process->destroy)
00446         {
00447             cvs_process->destroy = TRUE;
00448 #ifdef WIN32
00449             // wait so the threads do not continue to use the pointer
00450             HANDLE WaitH[4];
00451             int cnt = 0;
00452             DWORD curT = GetCurrentThreadId();
00453             for(int i = 0; i < 4; i++)
00454             {
00455                 if(cvs_process->threads[i] && curT != cvs_process->threadsID[i])
00456                     WaitH[cnt++] = cvs_process->threads[i];
00457             }
00458             WaitForMultipleObjects(cnt, WaitH, TRUE, INFINITE);
00459
00460             //close the handles
00461             for(i = 0; i < 4; i++)
00462             {
00463                 if( cvs_process->threads[i] && CloseHandle(cvs_process->threads[i]) )
00464                 {
00465                     cvs_process->threads[i] = NULL;
00466                 }
00467             }
00468 #endif
00469             free (cvs_process);
00470         }
00471     }
00472 }
00473
00474 #ifdef WIN32
00475 /* Given an array of arguments that one might pass to spawnv,
00476    construct a command line that one might pass to CreateProcess.
00477    Try to quote things appropriately.  */
00478 static char *
00479 build_command (int argc, char * const *argv)
00480 {
00481     int len;
00482
00483     /* Compute the total length the command will have.  */
00484     {
00485         int i;
00486
00487         len = 0;
00488         for (i = 0; i < argc; i++)
00489         {
00490             char *p;
00491
00492             len += 2;  /* for the double quotes */
00493
00494             for (p = argv[i]; *p; p++)
00495             {
00496                 if (*p == '"')
00497                     len += 2;
00498                 else
00499                     len++;
00500             }
00501             len++;  /* for the space or the '\0'  */
00502         }
00503     }
00504
00505     {
00506         /* The + 10 is in case len is 0.  */
00507         char *command = (char *) malloc (len + 10);
00508         int i;
00509         char *p;
00510
00511         if (! command)
00512         {
00513             errno = ENOMEM;
00514             return command;
00515         }
00516
00517         p = command;
00518         *p = '\0';
00519         /* copy each element of argv to command, putting each command
00520         in double quotes, and backslashing any quotes that appear
00521         within an argument.  */
00522         for (i = 0; i < argc; i++)
00523         {
00524             char *a;
00525             *p++ = '"';
00526             for (a = argv[i]; *a; a++)
00527             {
00528                 if (*a == '"')
00529                     *p++ = '\\', *p++ = '"';
00530                 else
00531                     *p++ = *a;
00532             }
00533             *p++ = '"';
00534             *p++ = ' ';
00535         }
00536         if (p > command)
00537             p[-1] = '\0';
00538
00539         return command;
00540     }
00541 }
00542
00543 #define BUFFSIZE 1024
00544
00545 static DWORD
00546 GetChldOutput(
00547     CvsProcess *process
00548     )
00549 {
00550     char  buff[BUFFSIZE];
00551     DWORD dread;
00552
00553     while(ReadFile(process->pstdout,buff,BUFFSIZE-1,&dread,NULL))
00554     {
00555         buff[dread]='\0';
00556         process->callbacks->consoleout(buff, dread);
00557     }
00558     return(1);
00559 }
00560
00561 static DWORD
00562 GetChldError(
00563     CvsProcess *process
00564     )
00565 {
00566     char  buff[BUFFSIZE];
00567     DWORD dread;
00568
00569     while(ReadFile(process->pstderr,buff,BUFFSIZE-1,&dread,NULL))
00570     {
00571         buff[dread]='\0';
00572         process->callbacks->consoleerr(buff, dread);
00573     }
00574     return(1);
00575 }
00576
00577 static DWORD
00578 WaitChld(
00579     CvsProcess *process
00580     )
00581 {
00582     WaitForSingleObject(process->pid, INFINITE);
00583     cvs_process_destroy(process);
00584     return(1);
00585 }
00586
00587 static DWORD
00588 ServeProtocol(
00589     CvsProcess *process
00590     )
00591 {
00592     while(process->starting)
00593     {
00594         Sleep(20);
00595         continue;
00596     }
00597
00598     DWORD avail;
00599     while(cvs_process_is_active(process) && process->open)
00600     {
00601         if(!PeekNamedPipe(process->my_read, 0L, 0 , 0L, &avail, 0L))
00602             break;
00603
00604         if(avail == 0)
00605         {
00606             Sleep(20);
00607             continue;
00608         }
00609
00610         cvs_process_recv_message(process);
00611     }
00612     return(1);
00613 }
00614 #endif
00615
00616 #ifdef _0_
00617 CvsProcess *
00618 cvs_process_test (char *name, int argc, char **argv, CvsProcessCallbacks *callbacks)
00619 {
00620     CvsProcess *cvs_process = cvs_process_new(name, argc, argv);
00621
00622     if (!cvs_process)
00623         return 0L;
00624
00625     cvs_process->callbacks = callbacks;
00626
00627 #ifndef WIN32
00628
00629     cvs_process->my_read   = 0;
00630     cvs_process->my_write  = 0;
00631     cvs_process->his_read  = 0;
00632     cvs_process->his_write = 0;
00633
00634     /* Remember the file descriptors for the pipes.
00635          */
00636     sprintf (cvs_process->args[2], "0");
00637     sprintf (cvs_process->args[3], "0");
00638
00639         /* Fork another process. We'll remember the process id
00640          *  so that we can later use it to kill the filter if
00641          *  necessary.
00642          */
00643     cvs_process->pid = fork ();
00644
00645     if (cvs_process->pid == 0)
00646     {
00647         close(cvs_process->my_read);
00648         close(cvs_process->my_write);
00649         /* Execute the filter. The "_exit" call should never
00650          *  be reached, unless some strange error condition
00651          *  exists.
00652          */
00653         execvp (cvs_process->args[0], cvs_process->args);
00654         _exit (1);
00655     }
00656     else if (cvs_process->pid == -1)
00657     {
00658         cvs_process_destroy (cvs_process);
00659         return 0L;
00660     }
00661
00662     close(cvs_process->his_read);  cvs_process->his_read  = -1;
00663     close(cvs_process->his_write); cvs_process->his_write = -1;
00664 #else
00665     SECURITY_ATTRIBUTES lsa;
00666     STARTUPINFO         si;
00667     PROCESS_INFORMATION pi;
00668
00669     HANDLE dupIn = 0L, dupOut = 0L;
00670     HANDLE stdChildIn = 0L, stdChildOut = 0L, stdChildErr = 0L;
00671     HANDLE stdoldIn = 0L, stdoldOut = 0L, stdoldErr = 0L;
00672     HANDLE stddupIn = 0L, stddupOut = 0L, stddupErr = 0L;
00673     char *command = 0L;
00674     BOOL resCreate;
00675     int cnt, i;
00676     LPTHREAD_START_ROUTINE threadsFunc[4];
00677
00678     lsa.nLength=sizeof(SECURITY_ATTRIBUTES);
00679     lsa.lpSecurityDescriptor=NULL;
00680     lsa.bInheritHandle=TRUE;
00681
00682     // create the pipes used for the cvsgui protocol
00683     if (!CreatePipe(&cvs_process->his_read,&dupIn,&lsa,0))
00684         goto error;
00685     if (!CreatePipe(&dupOut,&cvs_process->his_write,&lsa,0))
00686         goto error;
00687
00688     // duplicate the App side handles so they lose the inheritance
00689     if(!DuplicateHandle(GetCurrentProcess(), dupIn,
00690         GetCurrentProcess(), &cvs_process->my_write, 0, FALSE, DUPLICATE_SAME_ACCESS))
00691             goto error;
00692     CloseHandle(dupIn);
00693     dupIn = 0;
00694     if(!DuplicateHandle(GetCurrentProcess(), dupOut,
00695         GetCurrentProcess(), &cvs_process->my_read, 0, FALSE, DUPLICATE_SAME_ACCESS))
00696             goto error;
00697     CloseHandle(dupOut);
00698     dupOut = 0;
00699
00700     if(!hasTty)
00701     {
00702         // redirect stdout, stderr, stdin
00703         if (!CreatePipe(&stdChildIn,&stddupIn,&lsa,0))
00704             goto error;
00705         if (!CreatePipe(&stddupOut,&stdChildOut,&lsa,0))
00706             goto error;
00707         if (!CreatePipe(&stddupErr,&stdChildErr, &lsa,0))
00708             goto error;
00709
00710         // same thing as above
00711         if(!DuplicateHandle(GetCurrentProcess(), stddupIn,
00712             GetCurrentProcess(), &cvs_process->pstdin, 0, FALSE, DUPLICATE_SAME_ACCESS))
00713                 goto error;
00714         CloseHandle(stddupIn);
00715         stddupIn = 0;
00716         if(!DuplicateHandle(GetCurrentProcess(), stddupOut,
00717             GetCurrentProcess(), &cvs_process->pstdout, 0, FALSE, DUPLICATE_SAME_ACCESS))
00718                 goto error;
00719         CloseHandle(stddupOut);
00720         stddupOut = 0;
00721         if(!DuplicateHandle(GetCurrentProcess(), stddupErr,
00722             GetCurrentProcess(), &cvs_process->pstderr, 0, FALSE, DUPLICATE_SAME_ACCESS))
00723                 goto error;
00724         CloseHandle(stddupErr);
00725         stddupErr = 0;
00726     }
00727
00728     // Build the arguments for cvs
00729     sprintf (cvs_process->args[2], "%d", cvs_process->his_read);
00730     sprintf (cvs_process->args[3], "%d", cvs_process->his_write);
00731
00732     command = build_command(cvs_process->argc, cvs_process->args);
00733     if(command == 0L)
00734         goto error;
00735
00736     // Lets Redirect Console StdHandles and set the start options
00737     memset(&si,0,sizeof(STARTUPINFO));
00738     si.cb=sizeof(STARTUPINFO);
00739     si.dwFlags=hasTty ? 0 : STARTF_USESTDHANDLES;
00740     si.hStdInput =stdChildIn;
00741     si.hStdOutput=stdChildOut;
00742     si.hStdError =stdChildErr;
00743     if(!hasTty)
00744     {
00745         si.dwFlags|=STARTF_USESHOWWINDOW;
00746         si.wShowWindow = SW_SHOWMINNOACTIVE;
00747     }
00748
00749     if(!hasTty)
00750     {
00751         stdoldIn = GetStdHandle(STD_INPUT_HANDLE);
00752         stdoldOut = GetStdHandle(STD_OUTPUT_HANDLE);
00753         stdoldErr = GetStdHandle(STD_ERROR_HANDLE);
00754         SetStdHandle(STD_INPUT_HANDLE, stdChildIn);
00755         SetStdHandle(STD_OUTPUT_HANDLE, stdChildOut);
00756         SetStdHandle(STD_ERROR_HANDLE, stdChildErr);
00757     }
00758
00759     //Create Child Process
00760     resCreate = CreateProcess
00761          (
00762             NULL,
00763             command,
00764             NULL,
00765             NULL,
00766             TRUE,
00767             NORMAL_PRIORITY_CLASS,
00768             NULL,
00769             currentDirectory,
00770             &si,
00771             &pi);
00772
00773     if(!hasTty)
00774     {
00775         SetStdHandle(STD_INPUT_HANDLE, stdoldIn);
00776         SetStdHandle(STD_OUTPUT_HANDLE, stdoldOut);
00777         SetStdHandle(STD_ERROR_HANDLE, stdoldErr);
00778     }
00779
00780     if(!resCreate)
00781         goto error;
00782
00783     cvs_process->pid = pi.hProcess;
00784
00785     cnt = 0;
00786
00787     // now open-up threads which will serve the pipes
00788     threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)ServeProtocol;
00789     threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)WaitChld;
00790     if(!hasTty)
00791     {
00792         threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)GetChldOutput;
00793         threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)GetChldError;
00794     }
00795
00796     for(i = 0; i < cnt; i++)
00797     {
00798         if ((cvs_process->threads[i]=::CreateThread
00799                       (
00800                          (LPSECURITY_ATTRIBUTES)NULL,           // No security attributes.
00801                          (DWORD)0,                              // Use same stack size.
00802                          (LPTHREAD_START_ROUTINE)threadsFunc[i], // Thread procedure.
00803                          (LPVOID)cvs_process,                   // Parameter to pass.
00804                          (DWORD)0,                              // Run immediately.
00805                          (LPDWORD)&cvs_process->threadsID[i])
00806                       )==NULL)
00807         {
00808             TerminateProcess(cvs_process->pid,0);
00809             goto error;
00810         }
00811     }
00812
00813     //Close unneccesary Handles
00814     CloseHandle(cvs_process->his_read);
00815     cvs_process->his_read = 0;
00816     CloseHandle(cvs_process->his_write);
00817     cvs_process->his_write = 0;
00818
00819     if(!hasTty)
00820     {
00821         CloseHandle(stdChildIn);
00822         CloseHandle(stdChildOut);
00823         CloseHandle(stdChildErr);
00824     }
00825
00826     CloseHandle(pi.hThread);
00827
00828     free(command);
00829
00830     goto goodboy;
00831
00832 error:
00833     if(cvs_process->his_read != 0L)
00834         CloseHandle(cvs_process->his_read);
00835     if(cvs_process->his_write != 0L)
00836         CloseHandle(cvs_process->his_write);
00837     if(dupIn != 0L)
00838         CloseHandle(dupIn);
00839     if(dupOut != 0L)
00840         CloseHandle(dupOut);
00841     if(cvs_process->my_read != 0L)
00842         CloseHandle(cvs_process->my_read);
00843     if(cvs_process->my_write != 0L)
00844         CloseHandle(cvs_process->my_write);
00845     if(command != 0L)
00846         free(command);
00847     if(stdChildIn != 0L)
00848         CloseHandle(stdChildIn);
00849     if(stdChildOut != 0L)
00850         CloseHandle(stdChildOut);
00851     if(stdChildErr != 0L)
00852         CloseHandle(stdChildErr);
00853     if(stddupIn != 0L)
00854         CloseHandle(stddupIn);
00855     if(stddupOut != 0L)
00856         CloseHandle(stddupOut);
00857     if(stddupErr != 0L)
00858         CloseHandle(stddupErr);
00859     if(cvs_process->pstdin != 0L)
00860         CloseHandle(cvs_process->pstdin);
00861     if(cvs_process->pstdout != 0L)
00862         CloseHandle(cvs_process->pstdout);
00863     if(cvs_process->pstderr != 0L)
00864         CloseHandle(cvs_process->pstderr);
00865
00866     cvs_process_destroy (cvs_process);
00867     return 0L;
00868
00869 goodboy:
00870 #endif
00871
00872     {
00873         CStackThreadLock locker;
00874
00875         open_cvs_process.push_back(cvs_process);
00876     }
00877
00878     cvs_process->open = TRUE;
00879 #ifdef WIN32
00880     cvs_process->starting = FALSE;
00881 #endif
00882
00883     return cvs_process;
00884 }
00885
00886 #endif
00887
00888 CvsProcess *
00889 cvs_process_open (char *name, int argc, char **argv, CvsProcessCallbacks *callbacks, int hasTty, const char* currentDirectory)
00890 {
00891     CvsProcess *cvs_process = cvs_process_new(name, argc, argv);
00892
00893     if (!cvs_process)
00894         return 0L;
00895
00896     cvs_process->callbacks = callbacks;
00897
00898 #ifndef WIN32
00899     int my_read[2];
00900     int my_write[2];
00901
00902     /* Open two pipes. (Bidirectional communication).
00903          */
00904     if ((pipe (my_read) == -1) || (pipe (my_write) == -1))
00905     {
00906         fprintf(stderr, "unable to open pipe\n");
00907         cvs_process_destroy (cvs_process);
00908         return 0L;
00909     }
00910
00911     cvs_process->my_read = my_read[0];
00912     cvs_process->my_write = my_write[1];
00913     cvs_process->his_read = my_write[0];
00914     cvs_process->his_write = my_read[1];
00915
00916     /* Remember the file descriptors for the pipes.
00917          */
00918     sprintf (cvs_process->args[2], "%d", cvs_process->his_read);
00919     sprintf (cvs_process->args[3], "%d", cvs_process->his_write);
00920
00921         /* Fork another process. We'll remember the process id
00922          *  so that we can later use it to kill the filter if
00923          *  necessary.
00924          */
00925     cvs_process->pid = fork ();
00926
00927     if (cvs_process->pid == 0)
00928     {
00929         close(cvs_process->my_read);
00930         close(cvs_process->my_write);
00931         /* Execute the filter. The "_exit" call should never
00932          *  be reached, unless some strange error condition
00933          *  exists.
00934          */
00935         execvp (cvs_process->args[0], cvs_process->args);
00936         _exit (1);
00937     }
00938     else if (cvs_process->pid == -1)
00939     {
00940         cvs_process_destroy (cvs_process);
00941         return 0L;
00942     }
00943
00944     close(cvs_process->his_read);  cvs_process->his_read  = -1;
00945     close(cvs_process->his_write); cvs_process->his_write = -1;
00946 #else
00947     SECURITY_ATTRIBUTES lsa;
00948     STARTUPINFO         si;
00949     PROCESS_INFORMATION pi;
00950
00951     HANDLE dupIn = 0L, dupOut = 0L;
00952     HANDLE stdChildIn = 0L, stdChildOut = 0L, stdChildErr = 0L;
00953     HANDLE stdoldIn = 0L, stdoldOut = 0L, stdoldErr = 0L;
00954     HANDLE stddupIn = 0L, stddupOut = 0L, stddupErr = 0L;
00955     char *command = 0L;
00956     BOOL resCreate;
00957     int cnt, i;
00958     LPTHREAD_START_ROUTINE threadsFunc[4];
00959
00960     lsa.nLength=sizeof(SECURITY_ATTRIBUTES);
00961     lsa.lpSecurityDescriptor=NULL;
00962     lsa.bInheritHandle=TRUE;
00963
00964     // create the pipes used for the cvsgui protocol
00965     if (!CreatePipe(&cvs_process->his_read,&dupIn,&lsa,0))
00966         goto error;
00967     if (!CreatePipe(&dupOut,&cvs_process->his_write,&lsa,0))
00968         goto error;
00969
00970     // duplicate the App side handles so they lose the inheritance
00971     if(!DuplicateHandle(GetCurrentProcess(), dupIn,
00972         GetCurrentProcess(), &cvs_process->my_write, 0, FALSE, DUPLICATE_SAME_ACCESS))
00973             goto error;
00974     CloseHandle(dupIn);
00975     dupIn = 0;
00976     if(!DuplicateHandle(GetCurrentProcess(), dupOut,
00977         GetCurrentProcess(), &cvs_process->my_read, 0, FALSE, DUPLICATE_SAME_ACCESS))
00978             goto error;
00979     CloseHandle(dupOut);
00980     dupOut = 0;
00981
00982     if(!hasTty)
00983     {
00984         // redirect stdout, stderr, stdin
00985         if (!CreatePipe(&stdChildIn,&stddupIn,&lsa,0))
00986             goto error;
00987         if (!CreatePipe(&stddupOut,&stdChildOut,&lsa,0))
00988             goto error;
00989         if (!CreatePipe(&stddupErr,&stdChildErr, &lsa,0))
00990             goto error;
00991
00992         // same thing as above
00993         if(!DuplicateHandle(GetCurrentProcess(), stddupIn,
00994             GetCurrentProcess(), &cvs_process->pstdin, 0, FALSE, DUPLICATE_SAME_ACCESS))
00995                 goto error;
00996         CloseHandle(stddupIn);
00997         stddupIn = 0;
00998         if(!DuplicateHandle(GetCurrentProcess(), stddupOut,
00999             GetCurrentProcess(), &cvs_process->pstdout, 0, FALSE, DUPLICATE_SAME_ACCESS))
01000                 goto error;
01001         CloseHandle(stddupOut);
01002         stddupOut = 0;
01003         if(!DuplicateHandle(GetCurrentProcess(), stddupErr,
01004             GetCurrentProcess(), &cvs_process->pstderr, 0, FALSE, DUPLICATE_SAME_ACCESS))
01005                 goto error;
01006         CloseHandle(stddupErr);
01007         stddupErr = 0;
01008     }
01009
01010     // Build the arguments for cvs
01011     sprintf (cvs_process->args[2], "%d", cvs_process->his_read);
01012     sprintf (cvs_process->args[3], "%d", cvs_process->his_write);
01013
01014     command = build_command(cvs_process->argc, cvs_process->args);
01015     if(command == 0L)
01016         goto error;
01017
01018     // Lets Redirect Console StdHandles and set the start options
01019     memset(&si,0,sizeof(STARTUPINFO));
01020     si.cb=sizeof(STARTUPINFO);
01021     si.dwFlags=hasTty ? 0 : STARTF_USESTDHANDLES;
01022     si.hStdInput =stdChildIn;
01023     si.hStdOutput=stdChildOut;
01024     si.hStdError =stdChildErr;
01025     if(!hasTty)
01026     {
01027         si.dwFlags|=STARTF_USESHOWWINDOW;
01028         si.wShowWindow = SW_SHOWMINNOACTIVE;
01029     }
01030
01031     if(!hasTty)
01032     {
01033         stdoldIn = GetStdHandle(STD_INPUT_HANDLE);
01034         stdoldOut = GetStdHandle(STD_OUTPUT_HANDLE);
01035         stdoldErr = GetStdHandle(STD_ERROR_HANDLE);
01036         SetStdHandle(STD_INPUT_HANDLE, stdChildIn);
01037         SetStdHandle(STD_OUTPUT_HANDLE, stdChildOut);
01038         SetStdHandle(STD_ERROR_HANDLE, stdChildErr);
01039     }
01040
01041     //Create Child Process
01042     resCreate = CreateProcess
01043          (
01044             NULL,
01045             command,
01046             NULL,
01047             NULL,
01048             TRUE,
01049             NORMAL_PRIORITY_CLASS,
01050             NULL,
01051             currentDirectory,
01052             &si,
01053             &pi);
01054
01055     if(!hasTty)
01056     {
01057         SetStdHandle(STD_INPUT_HANDLE, stdoldIn);
01058         SetStdHandle(STD_OUTPUT_HANDLE, stdoldOut);
01059         SetStdHandle(STD_ERROR_HANDLE, stdoldErr);
01060     }
01061
01062     if(!resCreate)
01063         goto error;
01064
01065     cvs_process->pid = pi.hProcess;
01066
01067     cnt = 0;
01068
01069     // now open-up threads which will serve the pipes
01070     threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)ServeProtocol;
01071     threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)WaitChld;
01072     if(!hasTty)
01073     {
01074         threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)GetChldOutput;
01075         threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)GetChldError;
01076     }
01077
01078     for(i = 0; i < cnt; i++)
01079     {
01080         if ((cvs_process->threads[i]=::CreateThread
01081                       (
01082                          (LPSECURITY_ATTRIBUTES)NULL,           // No security attributes.
01083                          (DWORD)0,                              // Use same stack size.
01084                          (LPTHREAD_START_ROUTINE)threadsFunc[i], // Thread procedure.
01085                          (LPVOID)cvs_process,                   // Parameter to pass.
01086                          (DWORD)0,                              // Run immediately.
01087                          (LPDWORD)&cvs_process->threadsID[i])
01088                       )==NULL)
01089         {
01090             TerminateProcess(cvs_process->pid,0);
01091             goto error;
01092         }
01093     }
01094
01095     //Close unneccesary Handles
01096     CloseHandle(cvs_process->his_read);
01097     cvs_process->his_read = 0;
01098     CloseHandle(cvs_process->his_write);
01099     cvs_process->his_write = 0;
01100
01101     if(!hasTty)
01102     {
01103         CloseHandle(stdChildIn);
01104         CloseHandle(stdChildOut);
01105         CloseHandle(stdChildErr);
01106     }
01107
01108     CloseHandle(pi.hThread);
01109
01110     free(command);
01111
01112     goto goodboy;
01113
01114 error:
01115     if(cvs_process->his_read != 0L)
01116         CloseHandle(cvs_process->his_read);
01117     if(cvs_process->his_write != 0L)
01118         CloseHandle(cvs_process->his_write);
01119     if(dupIn != 0L)
01120         CloseHandle(dupIn);
01121     if(dupOut != 0L)
01122         CloseHandle(dupOut);
01123     if(cvs_process->my_read != 0L)
01124         CloseHandle(cvs_process->my_read);
01125     if(cvs_process->my_write != 0L)
01126         CloseHandle(cvs_process->my_write);
01127     if(command != 0L)
01128         free(command);
01129     if(stdChildIn != 0L)
01130         CloseHandle(stdChildIn);
01131     if(stdChildOut != 0L)
01132         CloseHandle(stdChildOut);
01133     if(stdChildErr != 0L)
01134         CloseHandle(stdChildErr);
01135     if(stddupIn != 0L)
01136         CloseHandle(stddupIn);
01137     if(stddupOut != 0L)
01138         CloseHandle(stddupOut);
01139     if(stddupErr != 0L)
01140         CloseHandle(stddupErr);
01141     if(cvs_process->pstdin != 0L)
01142         CloseHandle(cvs_process->pstdin);
01143     if(cvs_process->pstdout != 0L)
01144         CloseHandle(cvs_process->pstdout);
01145     if(cvs_process->pstderr != 0L)
01146         CloseHandle(cvs_process->pstderr);
01147
01148     cvs_process_destroy (cvs_process);
01149     return 0L;
01150
01151 goodboy:
01152 #endif
01153
01154     {
01155         CStackThreadLock locker;
01156
01157         open_cvs_process.push_back(cvs_process);
01158     }
01159
01160     cvs_process->open = TRUE;
01161 #ifdef WIN32
01162     cvs_process->starting = FALSE;
01163 #endif
01164
01165     return cvs_process;
01166 }
01167
01168 static void
01169 cvs_process_close (CvsProcess *cvs_process,
01170                int     kill_it)
01171 {
01172     CDestroyThreadLock locker;
01173
01174     if (cvs_process && cvs_process->open)
01175     {
01176 #ifdef WIN32
01177         if(GetCurrentThreadId() != cvs_process->threadsID[0])
01178         {
01179             // we wait for all the protocol to be over before we close
01180             // the process and the pipe.
01181             WaitForSingleObject(cvs_process->threads[0], 500);
01182             cvs_process->open = FALSE;
01183             WaitForSingleObject(cvs_process->threads[0], 500);
01184         }
01185 #endif
01186
01187         cvs_process->open = FALSE;
01188
01189 #ifndef WIN32
01190         int status;
01191
01192         /* If necessary, kill the filter.
01193          */
01194         if (kill_it && cvs_process->pid)
01195             status = kill (cvs_process->pid, SIGKILL);
01196
01197         /* Wait for the process to exit. This will happen
01198          *  immediately if it was just killed.
01199          */
01200         if (cvs_process->pid)
01201             waitpid (cvs_process->pid, &status, 0);
01202
01203         /* Close the pipes.
01204          */
01205         if (cvs_process->my_read)
01206             close (cvs_process->my_read);
01207         if (cvs_process->my_write)
01208             close (cvs_process->my_write);
01209         if (cvs_process->his_read)
01210             close (cvs_process->his_read);
01211         if (cvs_process->his_write)
01212             close (cvs_process->his_write);
01213 #else
01214         cvs_process->starting = TRUE;
01215
01216         // this is bad to do that, cvs won't have a chance
01217         // to raise the KILL signal (sigh...)
01218         if (kill_it && cvs_process->pid)
01219         {
01220             TerminateProcess(cvs_process->pid, -1);
01221         }
01222
01223         if (cvs_process->pid)
01224             CloseHandle(cvs_process->pid);
01225         if (cvs_process->my_read)
01226             CloseHandle(cvs_process->my_read);
01227         if (cvs_process->my_write)
01228             CloseHandle(cvs_process->my_write);
01229         if (cvs_process->his_read)
01230             CloseHandle(cvs_process->his_read);
01231         if (cvs_process->his_write)
01232             CloseHandle(cvs_process->his_write);
01233         if (cvs_process->pstdin)
01234             CloseHandle(cvs_process->pstdin);
01235         if (cvs_process->pstdout)
01236             CloseHandle(cvs_process->pstdout);
01237         if (cvs_process->pstderr)
01238             CloseHandle(cvs_process->pstderr);
01239 #endif
01240
01241         wire_clear_error();
01242
01243         /* Set the fields to null values.
01244          */
01245         cvs_process->pid = 0;
01246         cvs_process->my_read = 0;
01247         cvs_process->my_write = 0;
01248         cvs_process->his_read = 0;
01249         cvs_process->his_write = 0;
01250         cvs_process->pstdin = 0;
01251         cvs_process->pstdout = 0;
01252         cvs_process->pstderr = 0;
01253
01254         {
01255             CStackThreadLock locker;
01256
01257             STD_STL vector<CvsProcess *>::iterator i = STD_STL find(open_cvs_process.begin(), open_cvs_process.end(), cvs_process);
01258             if(i != open_cvs_process.end())
01259                 open_cvs_process.erase(i);
01260         }
01261     }
01262 }
01263
01264 int
01265 cvs_process_is_active(CvsProcess *cvs_process)
01266 {
01267     int res;
01268
01269     {
01270         CStackThreadLock locker;
01271
01272         STD_STL vector<CvsProcess *>::iterator i =
01273             STD_STL find(open_cvs_process.begin(), open_cvs_process.end(), cvs_process);
01274         res = i != open_cvs_process.end() ? 1 : 0;
01275     }
01276
01277     return res;
01278 }
01279
01280 void
01281 cvs_process_kill(CvsProcess *cvs_process)
01282 {
01283     if(cvs_process_is_active(cvs_process))
01284     {
01285         cvs_process_destroy(cvs_process);
01286     }
01287 }
01288
01289 int
01290 cvs_process_give_time(void)
01291 {
01292 #ifndef WIN32
01293     fd_set rset;
01294     int ready;
01295     int maxfd = 0;
01296     int fd;
01297     struct timeval tv;
01298     int didone = 0;
01299
01300     FD_ZERO (&rset);
01301
01302     STD_STL vector<CvsProcess *>::iterator i;
01303
01304     for (i = open_cvs_process.begin(); i != open_cvs_process.end(); ++i)
01305     {
01306         fd = (*i)->my_read;
01307
01308         FD_SET (fd, &rset);
01309         if (fd > maxfd)
01310             maxfd = fd;
01311     }
01312
01313     tv.tv_sec = 0;
01314     tv.tv_usec = 100000;
01315     ready = select (maxfd + 1, &rset, 0L, 0L, &tv);
01316
01317     STD_STL vector<CvsProcess *> toFire;
01318     if (ready > 0)
01319     {
01320         for (i = open_cvs_process.begin(); i != open_cvs_process.end(); ++i)
01321         {
01322             fd = (*i)->my_read;
01323
01324             if (FD_ISSET (fd, &rset))
01325                 toFire.push_back(*i);
01326         }
01327     }
01328
01329     for (i = toFire.begin(); i != toFire.end(); ++i)
01330     {
01331         fd = (*i)->my_read;
01332
01333         if (FD_ISSET (fd, &rset))
01334         {
01335             cvs_process_recv_message (*i);
01336             didone = 1;
01337         }
01338     }
01339
01340     return didone;
01341 #else
01342     // we don't have to do yield since we use preemptive threads
01343     return 0;
01344 #endif
01345 }
01346
01347 static void
01348 cvs_process_recv_message (CvsProcess *p)
01349 {
01350     WireMessage msg;
01351
01352     cvs_process_push (p);
01353
01354     memset (&msg, 0, sizeof (WireMessage));
01355     if (!wire_read_msg (p->my_read, &msg))
01356     {
01357         cvs_process_close (p, TRUE);
01358     }
01359     else
01360     {
01361         cvs_process_handle_message (&msg);
01362         wire_destroy (&msg);
01363     }
01364
01365     if(cvs_process_is_active(current_cvs_process))
01366     {
01367         if (!current_cvs_process->open)
01368         {
01369 #ifndef WIN32
01370             cvs_process_destroy (current_cvs_process);
01371 #endif
01372         }
01373         else
01374             cvs_process_pop ();
01375     }
01376 }
01377
01378 static void
01379 cvs_process_handle_message (WireMessage *msg)
01380 {
01381     switch (msg->type)
01382     {
01383     case GP_QUIT:
01384     {
01385         GPT_QUIT *t = (GPT_QUIT *)msg->data;
01386         current_cvs_process->callbacks->exit(t->code);
01387         cvs_process_close (current_cvs_process, FALSE);
01388         break;
01389     }
01390     case GP_GETENV:
01391     {
01392         GPT_GETENV *t = (GPT_GETENV *)msg->data;
01393         cvs_process_push (current_cvs_process);
01394         gp_getenv_write (current_cvs_process->my_write,
01395                          current_cvs_process->callbacks->getenv(t->str));
01396         cvs_process_pop ();
01397         break;
01398     }
01399     case GP_CONSOLE:
01400     {
01401         GPT_CONSOLE *t = (GPT_CONSOLE *)msg->data;
01402         if(t->isStderr)
01403             current_cvs_process->callbacks->consoleerr(t->str, t->len);
01404         else
01405             current_cvs_process->callbacks->consoleout(t->str, t->len);
01406         break;
01407     }
01408     }
01409 }
01410
01411 static int
01412 cvs_process_write (pipe_t     fd,
01413                guint8 *buf,
01414                gulong  count)
01415 {
01416     gulong bytes;
01417
01418     if(current_write_buffer == 0L)
01419         current_write_buffer = process_write_buffer;
01420
01421     while (count > 0)
01422     {
01423         if ((current_write_buffer_index + count) >= WRITE_BUFFER_SIZE)
01424         {
01425             bytes = WRITE_BUFFER_SIZE - current_write_buffer_index;
01426             memcpy (&current_write_buffer[current_write_buffer_index], buf, bytes);
01427             current_write_buffer_index += bytes;
01428             if (!wire_flush (fd))
01429                 return FALSE;
01430         }
01431         else
01432         {
01433             bytes = count;
01434             memcpy (&current_write_buffer[current_write_buffer_index], buf, bytes);
01435             current_write_buffer_index += bytes;
01436         }
01437
01438         buf += bytes;
01439         count -= bytes;
01440     }
01441
01442     return TRUE;
01443 }
01444
01445 static int
01446 cvs_process_flush (pipe_t fd)
01447 {
01448     int count;
01449     int bytes;
01450
01451     if (current_write_buffer_index > 0)
01452     {
01453         count = 0;
01454         while (count != current_write_buffer_index)
01455         {
01456             do {
01457                 bytes = write (fd, &current_write_buffer[count],
01458                                (current_write_buffer_index - count));
01459             } while ((bytes == -1) && (errno == EAGAIN));
01460
01461             if (bytes == -1)
01462                 return FALSE;
01463
01464             count += bytes;
01465         }
01466
01467         current_write_buffer_index = 0;
01468     }
01469
01470     return TRUE;
01471 }
01472
01473 static void
01474 cvs_process_push (CvsProcess *cvs_process)
01475 {
01476     CStackThreadLock locker;
01477
01478     if (cvs_process)
01479     {
01480         current_cvs_process = cvs_process;
01481
01482         cvs_process_stack.push_back(current_cvs_process);
01483
01484         current_write_buffer_index = current_cvs_process->write_buffer_index;
01485         current_write_buffer = current_cvs_process->write_buffer;
01486     }
01487     else
01488     {
01489         current_write_buffer_index = 0;
01490         current_write_buffer = NULL;
01491     }
01492 }
01493
01494 static void
01495 cvs_process_pop ()
01496 {
01497     CStackThreadLock locker;
01498
01499     if (current_cvs_process)
01500     {
01501         current_cvs_process->write_buffer_index = current_write_buffer_index;
01502
01503         cvs_process_stack.pop_back();
01504     }
01505
01506     if (!cvs_process_stack.empty())
01507     {
01508         current_cvs_process = cvs_process_stack.back();
01509         current_write_buffer_index = current_cvs_process->write_buffer_index;
01510         current_write_buffer = current_cvs_process->write_buffer;
01511     }
01512     else
01513     {
01514         current_cvs_process = NULL;
01515         current_write_buffer_index = 0;
01516         current_write_buffer = NULL;
01517     }
01518 }
Generated on Sun Feb 24 01:21:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/cvsgui_process.h Source File

common/cvsgui_process.h

Go to the documentation of this file.
00001 /*
00002 ** The cvsgui protocol used by WinCvs
00003 **
00004 ** This library is free software; you can redistribute it and/or
00005 ** modify it under the terms of the GNU Lesser General Public
00006 ** License as published by the Free Software Foundation; either
00007 ** version 2.1 of the License, or (at your option) any later version.
00008 **
00009 ** This library is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 ** Lesser General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU Lesser General Public
00015 ** License along with this library; if not, write to the Free Software
00016 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 */
00018
00019 /*
00020  * plugin.h from the GIMP modified for the cvsgui project by :
00021  * Alexandre Parenteau <aubonbeurre@hotmail.com> --- November 1999
00022  */
00023
00024 #ifndef CVSGUI_PROCESS_H
00025 #define CVSGUI_PROCESS_H
00026
00027 #include <sys/types.h>
00028 #include "cvsgui_wire.h"
00029
00030 #define WRITE_BUFFER_SIZE  512
00031
00032 typedef struct _CvsProcess             CvsProcess;
00033
00034 typedef struct
00035 {
00036     long (*consoleout)(char *txt, long len);    /* Get cvs stdout */
00037     long (*consoleerr)(char *txt, long len);    /* Get cvs stderr */
00038     const char *(*getenv)(char *name);              /* Ask about env. variable */
00039     void (*exit)(int code);                     /* Tells the exit code */
00040 } CvsProcessCallbacks;
00041
00042 struct _CvsProcess
00043 {
00044     unsigned int open : 1;                  /* Is the process open */
00045     unsigned int destroy : 1;               /* Should the process by destroyed */
00046 #ifdef WIN32
00047     unsigned int starting : 1;              /* Is the process starting or not */
00048 #endif
00049     pid_t pid;                              /* process process id */
00050     char **args;                            /* process command line arguments */
00051     int argc;
00052
00053     pipe_t my_read, my_write;               /* Apps read and write file descriptors */
00054     pipe_t his_read, his_write;             /* process read and write file descriptors */
00055     pipe_t pstdin, pstdout, pstderr;        /* tty descriptors used by the child */
00056
00057     char write_buffer[WRITE_BUFFER_SIZE];   /* Buffer for writing */
00058     int write_buffer_index;                 /* Buffer index for writing */
00059     CvsProcessCallbacks *callbacks;         /* Jump table */
00060 #ifdef WIN32
00061     HANDLE threads[4];
00062     DWORD threadsID[4];
00063 #endif
00064 };
00065
00066 #ifdef __cplusplus
00067 extern "C" {
00068 #endif
00069
00070 /* Open a process. This cause the process to run.
00071  * Optionnally, let the child have a TTY (console)
00072  */
00073 CvsProcess *cvs_process_open (char *name, int argc, char **argv,
00074                               CvsProcessCallbacks *callbacks, int hasTty, const char* currentDirectory);
00075
00076 #ifdef _0_
00077     /* Open a process for testing '-cvsgui'. This cause the process
00078  * to start and exit with '0' if supported.
00079  */
00080 CvsProcess *cvs_process_test (char *name, int argc, char **argv, CvsProcessCallbacks *callbacks);
00081 #endif
00082
00083 /* Close a process. This kills the process and releases
00084  *  its resources.
00085  */
00086 void cvs_process_kill(CvsProcess *cvs_process);
00087
00088 /* Initialize initialize the protocol library (both for the
00089  * process and the application)
00090  */
00091 void cvs_process_init (void);
00092
00093 /*
00094  * Called by the application to answer calls from the process.
00095  * Returns 1 if a message from cvs was handled, 0 otherwise
00096  */
00097 int cvs_process_give_time(void);
00098
00099 /*
00100  * Tells if the process is still alive
00101  */
00102 int cvs_process_is_active(CvsProcess *cvs_process);
00103
00104 /*
00105  * Kills the process
00106  */
00107
00108 #ifdef __cplusplus
00109 }
00110 #endif
00111
00112 #endif /* CVSGUI_PROCESS_H */
Generated on Sun Feb 24 01:21:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/cvsgui_protocol.h Source File

common/cvsgui_protocol.h

Go to the documentation of this file.
00001 /*
00002 ** The cvsgui protocol used by WinCvs
00003 **
00004 ** This library is free software; you can redistribute it and/or
00005 ** modify it under the terms of the GNU Lesser General Public
00006 ** License as published by the Free Software Foundation; either
00007 ** version 2.1 of the License, or (at your option) any later version.
00008 **
00009 ** This library is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 ** Lesser General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU Lesser General Public
00015 ** License along with this library; if not, write to the Free Software
00016 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 */
00018
00019 /*
00020  * gimpprotocol.h from the GIMP modified for the cvsgui project by :
00021  * Alexandre Parenteau <aubonbeurre@hotmail.com> --- January 2000
00022  */
00023
00024 #ifndef CVSGUI_PROTOCOL_H
00025 #define CVSGUI_PROTOCOL_H
00026
00027 #include "cvsgui_wire.h"
00028
00029 enum {
00030     GP_QUIT,
00031     GP_GETENV,
00032     GP_CONSOLE
00033 };
00034
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038
00039 typedef struct
00040 {
00041     gint32 code;
00042 } GPT_QUIT;
00043
00044 typedef struct
00045 {
00046     guint8 empty;
00047     char *str;
00048 } GPT_GETENV;
00049
00050 typedef struct
00051 {
00052     guint8 isStderr;
00053     guint32 len;
00054     char *str;
00055 } GPT_CONSOLE;
00056
00057 int  gp_quit_write (pipe_t fd, int code);
00058 int  gp_getenv_write (pipe_t fd, const char *env);
00059 int  gp_console_write (pipe_t fd, const char *str, int len, int isStderr);
00060 char *gp_getenv_read (pipe_t fd);
00061
00062 extern pipe_t _cvsgui_readfd;
00063 extern pipe_t _cvsgui_writefd;
00064
00065 #ifdef __cplusplus
00066 }
00067 #endif
00068
00069 #endif /* CVSGUI_PROTOCOL_H */
Generated on Sun Feb 24 01:21:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/cvsgui_wire.cpp Source File

common/cvsgui_wire.cpp

Go to the documentation of this file.
00001 /*
00002 ** The cvsgui protocol used by WinCvs
00003 **
00004 ** This library is free software; you can redistribute it and/or
00005 ** modify it under the terms of the GNU Lesser General Public
00006 ** License as published by the Free Software Foundation; either
00007 ** version 2.1 of the License, or (at your option) any later version.
00008 **
00009 ** This library is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 ** Lesser General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU Lesser General Public
00015 ** License along with this library; if not, write to the Free Software
00016 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 */
00018
00019 /*
00020  * gimpwire.c from the GIMP modified for the cvsgui project by :
00021  * Alexandre Parenteau <aubonbeurre@hotmail.com> --- November 1999
00022  */
00023
00024 #ifdef HAVE_CONFIG_H
00025 #include "config.h"
00026 #endif
00027
00028 #include <errno.h>
00029 #include <stdio.h>
00030 #include <stdlib.h>
00031 #include <string.h>
00032
00033 #include <sys/types.h>
00034 #include "cvsgui_wire.h"
00035
00036 #ifndef WIN32
00037 #   include <unistd.h>
00038 #   include <sys/param.h>
00039 #   include <netinet/in.h>
00040 #else
00041 #   pragma warning (disable : 4786)
00042 #endif
00043
00044 #include <map>
00045
00046 #if TARGET_RT_MAC_MACHO
00047 #   define STD_STL std::
00048     // probable transitory problem with MWERKS on Mach-O
00049 #else
00050 #   define STD_STL std::
00051 #endif
00052
00053 #ifdef WIN32
00054 static int read(pipe_t fd, void *buf, int count)
00055 {
00056     DWORD dread;
00057     if(!ReadFile(fd,buf,count,&dread,NULL))
00058     {
00059         DWORD err = GetLastError();
00060         errno = EINVAL;
00061         return -1;
00062     }
00063     return dread;
00064 }
00065
00066 static int write(pipe_t fd, const void *buf, int count)
00067 {
00068     DWORD dwrite;
00069     if(!WriteFile(fd,buf,count,&dwrite,NULL))
00070     {
00071         errno = EINVAL;
00072         return -1;
00073     }
00074     return dwrite;
00075 }
00076 #endif
00077
00078 typedef struct _WireHandler  WireHandler;
00079
00080 struct _WireHandler
00081 {
00082     guint32 type;
00083     WireReadFunc read_func;
00084     WireWriteFunc write_func;
00085     WireDestroyFunc destroy_func;
00086 };
00087
00088 static WireIOFunc wire_read_func = NULL;
00089 static WireIOFunc wire_write_func = NULL;
00090 static WireFlushFunc wire_flush_func = NULL;
00091 static int wire_error_val = FALSE;
00092
00093 struct CAllHandlers
00094 {
00095 public:
00096     CAllHandlers() {}
00097     ~CAllHandlers()
00098     {
00099         STD_STL map<guint32, WireHandler *>::iterator i;
00100         for(i = wire_ht.begin(); i != wire_ht.end(); ++i)
00101         {
00102             WireHandler *handler = (*i).second;
00103             free(handler);
00104         }
00105     }
00106
00107     STD_STL map<guint32, WireHandler *> wire_ht;
00108 } sHandlers;
00109
00110 void
00111 wire_register (guint32         type,
00112                WireReadFunc    read_func,
00113                WireWriteFunc   write_func,
00114                WireDestroyFunc destroy_func)
00115 {
00116     WireHandler *handler;
00117
00118     STD_STL map<guint32, WireHandler *>::iterator i = sHandlers.wire_ht.find(type);
00119     if(i == sHandlers.wire_ht.end())
00120         handler = (WireHandler *)malloc(sizeof(WireHandler));
00121     else
00122         handler = (*i).second;
00123
00124     handler->type = type;
00125     handler->read_func = read_func;
00126     handler->write_func = write_func;
00127     handler->destroy_func = destroy_func;
00128
00129     sHandlers.wire_ht.insert(STD_STL map<guint32, WireHandler *>::value_type(type, handler));
00130 }
00131
00132 void
00133 wire_set_reader (WireIOFunc read_func)
00134 {
00135     wire_read_func = read_func;
00136 }
00137
00138 void
00139 wire_set_writer (WireIOFunc write_func)
00140 {
00141     wire_write_func = write_func;
00142 }
00143
00144 void
00145 wire_set_flusher (WireFlushFunc flush_func)
00146 {
00147     wire_flush_func = flush_func;
00148 }
00149
00150 int
00151 wire_read (pipe_t fd,
00152            guint8 *buf,
00153            gulong  count)
00154 {
00155     if (wire_read_func)
00156     {
00157         if (!(* wire_read_func) (fd, buf, count))
00158         {
00159             //g_print ("wire_read: error\n");
00160             wire_error_val = TRUE;
00161             return FALSE;
00162         }
00163     }
00164     else
00165     {
00166         int bytes;
00167
00168         while (count > 0)
00169         {
00170             do {
00171                 bytes = read (fd, (char*) buf, count);
00172             } while ((bytes == -1) && ((errno == EAGAIN) || (errno == EINTR)));
00173
00174             if (bytes == -1)
00175             {
00176                 //g_print ("wire_read: error\n");
00177                 wire_error_val = TRUE;
00178                 return FALSE;
00179             }
00180
00181             if (bytes == 0)
00182             {
00183                 //g_print ("wire_read: unexpected EOF (plug-in crashed?)\n");
00184                 wire_error_val = TRUE;
00185                 return FALSE;
00186             }
00187
00188             count -= bytes;
00189             buf += bytes;
00190         }
00191     }
00192
00193     return TRUE;
00194 }
00195
00196 int
00197 wire_write (pipe_t fd,
00198             guint8 *buf,
00199             gulong  count)
00200 {
00201     if (wire_write_func)
00202     {
00203         if (!(* wire_write_func) (fd, buf, count))
00204         {
00205             //g_print ("wire_write: error\n");
00206             wire_error_val = TRUE;
00207             return FALSE;
00208         }
00209     }
00210     else
00211     {
00212         int bytes;
00213
00214         while (count > 0)
00215         {
00216             do {
00217                 bytes = write (fd, (char*) buf, count);
00218             } while ((bytes == -1) && ((errno == EAGAIN) || (errno == EINTR)));
00219
00220             if (bytes == -1)
00221             {
00222                 //g_print ("wire_write: error\n");
00223                 wire_error_val = TRUE;
00224                 return FALSE;
00225             }
00226
00227             count -= bytes;
00228             buf += bytes;
00229         }
00230     }
00231
00232     return TRUE;
00233 }
00234
00235 int
00236 wire_flush (pipe_t fd)
00237 {
00238     if (wire_flush_func)
00239         return (* wire_flush_func) (fd);
00240     return FALSE;
00241 }
00242
00243 int
00244 wire_error ()
00245 {
00246     return wire_error_val;
00247 }
00248
00249 void
00250 wire_clear_error ()
00251 {
00252     wire_error_val = FALSE;
00253 }
00254
00255 int
00256 wire_read_msg (pipe_t       fd,
00257                WireMessage *msg)
00258 {
00259     WireHandler *handler;
00260
00261     if (wire_error_val)
00262         return !wire_error_val;
00263
00264     if (!wire_read_int32 (fd, &msg->type, 1))
00265         return FALSE;
00266
00267     STD_STL map<guint32, WireHandler *>::iterator i = sHandlers.wire_ht.find(msg->type);
00268     if(i == sHandlers.wire_ht.end())
00269         return FALSE;
00270
00271     handler = (*i).second;
00272     (* handler->read_func) (fd, msg);
00273
00274     return !wire_error_val;
00275 }
00276
00277 int
00278 wire_write_msg (pipe_t       fd,
00279                 WireMessage *msg)
00280 {
00281     WireHandler *handler;
00282
00283     if (wire_error_val)
00284         return !wire_error_val;
00285
00286     STD_STL map<guint32, WireHandler *>::iterator i = sHandlers.wire_ht.find(msg->type);
00287     if(i == sHandlers.wire_ht.end())
00288         return FALSE;
00289
00290     handler = (*i).second;
00291
00292     if (!wire_write_int32 (fd, &msg->type, 1))
00293         return FALSE;
00294
00295     (* handler->write_func) (fd, msg);
00296
00297     return !wire_error_val;
00298 }
00299
00300 void
00301 wire_destroy (WireMessage *msg)
00302 {
00303     WireHandler *handler;
00304
00305     STD_STL map<guint32, WireHandler *>::iterator i = sHandlers.wire_ht.find(msg->type);
00306     if(i == sHandlers.wire_ht.end())
00307         return;
00308
00309     handler = (*i).second;
00310     (* handler->destroy_func) (msg);
00311 }
00312
00313 int
00314 wire_read_int32 (pipe_t   fd,
00315                  guint32 *data,
00316                  gint     count)
00317 {
00318     if (count > 0)
00319     {
00320         if (!wire_read_int8 (fd, (guint8*) data, count * 4))
00321             return FALSE;
00322
00323         while (count--)
00324         {
00325             *data = ntohl (*data);
00326             data++;
00327         }
00328     }
00329
00330     return TRUE;
00331 }
00332
00333 int
00334 wire_read_int16 (pipe_t   fd,
00335                  guint16 *data,
00336                  gint     count)
00337 {
00338     if (count > 0)
00339     {
00340         if (!wire_read_int8 (fd, (guint8*) data, count * 2))
00341             return FALSE;
00342
00343         while (count--)
00344         {
00345             *data = ntohs (*data);
00346             data++;
00347         }
00348     }
00349
00350     return TRUE;
00351 }
00352
00353 int
00354 wire_read_int8 (pipe_t fd,
00355                 guint8 *data,
00356                 gint    count)
00357 {
00358     return wire_read (fd, data, count);
00359 }
00360
00361 int
00362 wire_read_double (pipe_t   fd,
00363                   gdouble *data,
00364                   gint     count)
00365 {
00366     char *str;
00367     int i;
00368
00369     for (i = 0; i < count; i++)
00370     {
00371         if (!wire_read_string (fd, &str, 1))
00372             return FALSE;
00373         sscanf (str, "%le", &data[i]);
00374         free (str);
00375     }
00376
00377     return TRUE;
00378 }
00379
00380 int
00381 wire_read_string (pipe_t fd,
00382                   gchar **data,
00383                   gint    count)
00384 {
00385     guint32 tmp;
00386     int i;
00387
00388     for (i = 0; i < count; i++)
00389     {
00390         if (!wire_read_int32 (fd, &tmp, 1))
00391             return FALSE;
00392
00393         if (tmp > 0)
00394         {
00395             data[i] = (gchar *)malloc(tmp * sizeof(gchar));
00396             if (!wire_read_int8 (fd, (guint8*) data[i], tmp))
00397             {
00398                 free (data[i]);
00399                 return FALSE;
00400             }
00401         }
00402         else
00403         {
00404             data[i] = NULL;
00405         }
00406     }
00407
00408     return TRUE;
00409 }
00410
00411 int
00412 wire_write_int32 (pipe_t   fd,
00413                   guint32 *data,
00414                   gint     count)
00415 {
00416     guint32 tmp;
00417     int i;
00418
00419     if (count > 0)
00420     {
00421         for (i = 0; i < count; i++)
00422         {
00423             tmp = htonl (data[i]);
00424             if (!wire_write_int8 (fd, (guint8*) &tmp, 4))
00425                 return FALSE;
00426         }
00427     }
00428
00429     return TRUE;
00430 }
00431
00432 int
00433 wire_write_int16 (pipe_t   fd,
00434                   guint16 *data,
00435                   gint     count)
00436 {
00437     guint16 tmp;
00438     int i;
00439
00440     if (count > 0)
00441     {
00442         for (i = 0; i < count; i++)
00443         {
00444             tmp = htons (data[i]);
00445             if (!wire_write_int8 (fd, (guint8*) &tmp, 2))
00446                 return FALSE;
00447         }
00448     }
00449
00450     return TRUE;
00451 }
00452
00453 int
00454 wire_write_int8 (pipe_t fd,
00455                  guint8 *data,
00456                  gint    count)
00457 {
00458     return wire_write (fd, data, count);
00459 }
00460
00461 int
00462 wire_write_double (pipe_t   fd,
00463                    gdouble *data,
00464                    gint     count)
00465 {
00466     gchar *t, buf[128];
00467     int i;
00468
00469     t = buf;
00470     for (i = 0; i < count; i++)
00471     {
00472         sprintf (buf, "%0.50e", data[i]);
00473         if (!wire_write_string (fd, &t, 1))
00474             return FALSE;
00475     }
00476
00477     return TRUE;
00478 }
00479
00480 int
00481 wire_write_string (pipe_t fd,
00482                    gchar **data,
00483                    gint    count)
00484 {
00485     guint32 tmp;
00486     int i;
00487
00488     for (i = 0; i < count; i++)
00489     {
00490         if (data[i])
00491             tmp = strlen (data[i]) + 1;
00492         else
00493             tmp = 0;
00494
00495         if (!wire_write_int32 (fd, &tmp, 1))
00496             return FALSE;
00497         if (tmp > 0)
00498             if (!wire_write_int8 (fd, (guint8*) data[i], tmp))
00499                 return FALSE;
00500     }
00501
00502     return TRUE;
00503 }
Generated on Sun Feb 24 01:21:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/cvsgui_wire.h Source File

common/cvsgui_wire.h

Go to the documentation of this file.
00001 /*
00002 ** The cvsgui protocol used by WinCvs
00003 **
00004 ** This library is free software; you can redistribute it and/or
00005 ** modify it under the terms of the GNU Lesser General Public
00006 ** License as published by the Free Software Foundation; either
00007 ** version 2.1 of the License, or (at your option) any later version.
00008 **
00009 ** This library is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 ** Lesser General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU Lesser General Public
00015 ** License along with this library; if not, write to the Free Software
00016 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 */
00018
00019 /*
00020  * gimpwire.h from the GIMP modified for the cvsgui project by :
00021  * Alexandre Parenteau <aubonbeurre@hotmail.com> --- November 1999
00022  */
00023
00024 #ifndef CVSGUI_WIRE_H
00025 #define CVSGUI_WIRE_H
00026
00027 #ifdef WIN32
00028 #   include <Windows.h>
00029 #endif
00030
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034
00035 #ifndef __G_LIB_H__
00036 typedef signed char gint8;
00037 typedef unsigned char guint8;
00038 typedef signed short gint16;
00039 typedef unsigned short guint16;
00040 typedef signed int gint32;
00041 typedef unsigned int guint32;
00042
00043 typedef char   gchar;
00044 typedef short  gshort;
00045 typedef long   glong;
00046 typedef int    gint;
00047 typedef gint   gboolean;
00048
00049 typedef unsigned char   guchar;
00050 typedef unsigned short  gushort;
00051 typedef unsigned long   gulong;
00052 typedef unsigned int    guint;
00053
00054 typedef float   gfloat;
00055 typedef double  gdouble;
00056
00057 typedef void* gpointer;
00058 typedef const void *gconstpointer;
00059
00060 #ifndef FALSE
00061 #define FALSE   (0)
00062 #endif
00063
00064 #ifndef TRUE
00065 #define TRUE    (!FALSE)
00066 #endif
00067 #endif // !__G_LIB_H__
00068
00069 #ifdef WIN32
00070 #   ifdef pid_t
00071 #       undef pid_t // config.h of cvs
00072 #   endif
00073     typedef HANDLE pid_t;
00074     typedef HANDLE pipe_t;
00075 #else
00076     typedef int pipe_t;
00077 #endif
00078
00079 typedef struct _WireMessage  WireMessage;
00080
00081 typedef void (* WireReadFunc)    (pipe_t fd, WireMessage *msg);
00082 typedef void (* WireWriteFunc)   (pipe_t fd, WireMessage *msg);
00083 typedef void (* WireDestroyFunc) (WireMessage *msg);
00084 typedef int  (* WireIOFunc)      (pipe_t fd, guint8 *buf, gulong count);
00085 typedef int  (* WireFlushFunc)   (pipe_t fd);
00086
00087
00088 struct _WireMessage
00089 {
00090   guint32 type;
00091   gpointer data;
00092 };
00093
00094
00095 void wire_register     (guint32          type,
00096                 WireReadFunc     read_func,
00097                 WireWriteFunc    write_func,
00098                 WireDestroyFunc  destroy_func);
00099 void wire_set_reader   (WireIOFunc       read_func);
00100 void wire_set_writer   (WireIOFunc       write_func);
00101 void wire_set_flusher  (WireFlushFunc    flush_func);
00102 int  wire_read         (pipe_t              fd,
00103             guint8          *buf,
00104             gulong           count);
00105 int  wire_write        (pipe_t              fd,
00106             guint8          *buf,
00107             gulong           count);
00108 int  wire_flush        (pipe_t              fd);
00109 int  wire_error        (void);
00110 void wire_clear_error  (void);
00111 int  wire_read_msg     (pipe_t              fd,
00112                 WireMessage     *msg);
00113 int  wire_write_msg    (pipe_t              fd,
00114                 WireMessage     *msg);
00115 void wire_destroy      (WireMessage     *msg);
00116 int  wire_read_int32   (pipe_t              fd,
00117                 guint32         *data,
00118                 gint             count);
00119 int  wire_read_int16   (pipe_t              fd,
00120                 guint16         *data,
00121                 gint             count);
00122 int  wire_read_int8    (pipe_t              fd,
00123                 guint8          *data,
00124                 gint             count);
00125 int  wire_read_double  (pipe_t              fd,
00126                 gdouble         *data,
00127                 gint             count);
00128 int  wire_read_string  (pipe_t              fd,
00129             gchar          **data,
00130             gint             count);
00131 int  wire_write_int32  (pipe_t              fd,
00132                 guint32         *data,
00133                 gint             count);
00134 int  wire_write_int16  (pipe_t              fd,
00135                 guint16         *data,
00136                 gint             count);
00137 int  wire_write_int8   (pipe_t              fd,
00138                 guint8          *data,
00139                 gint             count);
00140 int  wire_write_double (pipe_t              fd,
00141             gdouble         *data,
00142             gint             count);
00143 int  wire_write_string (pipe_t              fd,
00144             gchar          **data,
00145             gint             count);
00146
00147 #ifdef __cplusplus
00148 }
00149 #endif
00150
00151 #endif /* CVSGUI_WIRE_H */
Generated on Sun Feb 24 01:21:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CvsIgnore.cpp Source File

common/CvsIgnore.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- June 1998
00019  */
00020
00021 /*
00022  * CvsIgnore.cpp --- parse the .cvsignore
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #include <stdlib.h>
00028 #include <string.h>
00029
00030 #include "FileTraversal.h"
00031 #include "AppConsole.h"
00032 #include "CvsIgnore.h"
00033 #include "getline.h"
00034 #include "fnmatch.h"
00035 #include "CvsPrefs.h"
00036
00037 #ifndef WIN32
00038 #   include <ctype.h>
00039 #endif /* !WIN32 */
00040
00041 #ifdef qMacCvsPP
00042 #       include "MacCvsApp.h"
00043 #       include "MacMisc.h"
00044 #endif /* qMacCvsPP */
00045
00046 #ifdef WIN32
00047 #   include "wincvs.h"
00048
00049 #   ifdef _DEBUG
00050 #       define new DEBUG_NEW
00051 #       undef THIS_FILE
00052         static char THIS_FILE[] = __FILE__;
00053 #   endif
00054 #endif /* WIN32 */
00055
00056 /* Parse a line of space-separated wildcards and add them to the list. */
00057 /* mostly duplicated from cvs/src/ignore.c */
00058 static void ign_add (char *ign, bool hold, std::vector<CStr> & ignlist)
00059 {
00060     if (!ign || !*ign)
00061         return;
00062
00063     int ign_hold = ignlist.size() == 0 ? -1 : (int)ignlist.size();
00064
00065     for (; *ign; ign++)
00066     {
00067         char *mark;
00068         char save;
00069
00070         /* ignore whitespace before the token */
00071         if (isspace (*ign))
00072             continue;
00073
00074         /*
00075         * if we find a single character !, we must re-set the ignore list
00076         * (saving it if necessary).  We also catch * as a special case in a
00077         * global ignore file as an optimization
00078         */
00079         if ((!*(ign+1) || isspace (*(ign+1))) && (*ign == '!' || *ign == '*'))
00080         {
00081             if (!hold)
00082             {
00083                 /* permanently reset the ignore list */
00084                 ignlist.erase(ignlist.begin(), ignlist.end());
00085
00086                 /* if we are doing a '!', continue; otherwise add the '*' */
00087                 if (*ign == '!')
00088                 {
00089                     continue;
00090                 }
00091             }
00092             else if (*ign == '!')
00093             {
00094                 /* temporarily reset the ignore list */
00095                 if (ign_hold >= 0)
00096                 {
00097                     ignlist.erase(ignlist.begin(), ignlist.begin() + ign_hold);
00098                     ign_hold = -1;
00099                 }
00100                 continue;
00101             }
00102         }
00103
00104         /* find the end of this token */
00105         for (mark = ign; *mark && !isspace (*mark); mark++)
00106             /* do nothing */ ;
00107
00108         save = *mark;
00109         *mark = '\0';
00110
00111         ignlist.push_back(CStr(ign));
00112
00113         *mark = save;
00114         if (save)
00115             ign = mark;
00116         else
00117             ign = mark - 1;
00118     }
00119 }
00120
00121
00122 // Read .cvsignore file and append entries to ignlist
00123 static bool ReadIgnoredFile(const char* fileName, std::vector<CStr> & ignlist)
00124 {
00125     FILE *fp;
00126     char *line = NULL;
00127     size_t line_allocated = 0;
00128
00129     fp = fopen(fileName, "r");
00130     if(fp != 0L)
00131     {
00132         while (getline (&line, &line_allocated, fp) >= 0)
00133             ign_add (line, false, ignlist);
00134
00135         if (ferror (fp))
00136             cvs_err("Problem while parsing '%s'", fileName);
00137
00138         fclose (fp);
00139     }
00140
00141     if(line != 0L)
00142         free (line);
00143
00144     return(fp != 0L);
00145 }
00146
00147
00148 void BuildIgnoredList(std::vector<CStr> & ignlist, const char *path)
00149 {
00150     ignlist.erase(ignlist.begin(), ignlist.end());
00151
00152     static std::vector<CStr> deflist;
00153     static bool deflistparsed = false;
00154
00155     if(!deflistparsed)
00156     {
00157 #ifdef macintosh
00158         UFSSpec theFolder;
00159         CStr home;
00160
00161         if(MacGetPrefsFolder(theFolder, home) == noErr)
00162         {
00163 #else /* !macintosh */
00164         if(gCvsPrefs.Home() != 0L)
00165         {
00166             CStr home(gCvsPrefs.Home());
00167 #endif /* !macintosh */
00168             struct stat sb;
00169             if (stat(home, &sb) != 0 || !S_ISDIR(sb.st_mode))
00170             {
00171                 cvs_err("Warning : unable to access your HOME path '%s'\n", gCvsPrefs.Home());
00172                 cvs_err("          ~/.cvsignore will not be read\n");
00173             }
00174             if(!home.empty() && !home.endsWith(kPathDelimiter))
00175                 home << kPathDelimiter;
00176             home << ".cvsignore";
00177
00178             // Read .cvsignore file from HOME directory.
00179             // If HOME dir doesn't have such a file then
00180             // try to read global file from executable path.
00181             if(ReadIgnoredFile(home, deflist) == false)
00182             {
00183                 CStr appPath;
00184
00185 #ifdef WIN32
00186                 ((CWincvsApp *)AfxGetApp())->GetAppPath(appPath);
00187 #elif defined(qUnix)
00188                 // Unix version uses only .cvsignore file in HOME dir
00189 #else
00190 #   ifdef qMacCvsPP
00191                 appPath = CMacCvsApp::GetAppPath();
00192 #   endif /* qMacCvsPP */
00193 #endif
00194                 if(!appPath.empty())
00195                 {
00196                     if(!appPath.endsWith(kPathDelimiter))
00197                         appPath << kPathDelimiter;
00198
00199                     appPath << ".cvsignore";
00200
00201                     ReadIgnoredFile(appPath, deflist);
00202                 }
00203             }
00204         }
00205         deflistparsed = true;
00206     }
00207     else
00208         ignlist = deflist;
00209
00210 #if qUnix
00211     // from cvs/src/ignore.c
00212     CStr ign_default(". .. core RCSLOG tags TAGS RCS SCCS .make.state\
00213  .nse_depinfo #* .#* cvslog.* ,* CVS CVS.adm .del-* *.a *.olb *.o *.obj\
00214  *.so *.Z *~ *.old *.elc *.ln *.bak *.BAK *.orig *.rej *.exe _$* *$");
00215     ign_add (ign_default, false, ignlist);
00216 #endif
00217
00218     UStr ignPath(path);
00219     if(!ignPath.endsWith(kPathDelimiter))
00220         ignPath << kPathDelimiter;
00221     ignPath << ".cvsignore";
00222
00223     // load the file from the current source directory
00224     ReadIgnoredFile(ignPath, ignlist);
00225 }
00226
00227 bool MatchIgnoredList(const char * filename, const std::vector<CStr> & ignlist)
00228 {
00229     std::vector<CStr>::const_iterator i;
00230     for(i = ignlist.begin(); i != ignlist.end(); ++i)
00231     {
00232         if(fnmatch (*i, filename, 0) == 0)
00233             return true;
00234     }
00235     return false;
00236 }
Generated on Sun Feb 24 01:21:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CvsIgnore.h Source File

common/CvsIgnore.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- June 1998
00019  */
00020
00021 /*
00022  * CvsIgnore.h --- parse the .cvsignore
00023  */
00024
00025 #ifndef CVSIGNORE_H
00026 #define CVSIGNORE_H
00027
00028 #include <vector>
00029 #include "CPStr.h"
00030
00031 #ifdef _MSC_VER
00032     using namespace std;
00033 #endif
00034
00035 void BuildIgnoredList(std::vector<CStr> & ignlist, const char *path);
00036     // open and parse the .cvsignore in the current folder
00037
00038 bool MatchIgnoredList(const char * filename, const std::vector<CStr> & ignlist);
00039     // tells if the name match the .cvsignore
00040
00041 #endif /* CVSIGNORE_H */
Generated on Sun Feb 24 01:21:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CvsPrefs.cpp Source File

common/CvsPrefs.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * CvsPrefs.cpp --- class to handle CVS settings
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #include <string.h>
00028 #include <stdlib.h>
00029 #include "CvsPrefs.h"
00030 #include "Authen.h"
00031 #include "AppConsole.h"
00032 #include "CvsArgs.h"
00033 #include "MultiString.h"
00034 #include "FileTraversal.h"
00035
00036 #ifdef macintosh
00037 #   define PCVS "\pCVSROOT"
00038 #   include <Resources.h>
00039 #   include <Folders.h>
00040 #   include <MacErrors.h>
00041 #   include <TextUtils.h>
00042 #   include "VolsPaths.h"
00043 #   include "MacMisc.h"
00044 #   include "AppGlue.h"
00045 #endif /* macintosh */
00046
00047 #ifdef HAVE_UNISTD_H
00048 #   include <unistd.h>
00049 #endif
00050
00051 #ifdef HAVE_PWD_H
00052 #   include <pwd.h>
00053 #endif
00054
00055 #ifdef WIN32
00056 #   include <process.h>
00057 #   include "WinCvsBrowser.h"
00058 #   include "wincvs.h"
00059 #   include "TextBinary.h"
00060 #   ifdef _DEBUG
00061 #   define new DEBUG_NEW
00062 #   undef THIS_FILE
00063     static char THIS_FILE[] = __FILE__;
00064 #   endif
00065 #endif /* WIN32 */
00066
00067 #ifdef qMacCvsPP
00068 #   include "GUSIInternal.h"
00069 #   include "GUSIFileSpec.h"
00070 #   include "MacCvsApp.h"
00071 #   include <UProcess.h>
00072 #endif
00073
00074 #if qUnix
00075 #   include "UCvsApp.h"
00076 #   include "UCvsFolders.h"
00077 #endif
00078
00079 CvsPrefs gCvsPrefs;
00080
00081 static CPersistentInt gPersistentShema("P_PersistentShema", SCHEMA_0);
00082
00083 static CPersistentBool gCheckoutRO("P_CheckoutRO", true, kAddSettings);
00084 static CPersistentBool gZ9Option("P_Z9Option", false, kAddSettings);
00085 static CPersistentBool gPruneOption("P_PruneOption", true, kAddSettings);
00086 static CPersistentBool gQuietOption("P_QuietOption", false);
00087 static CPersistentInt gIsoConvert("P_NIsoConvert", ISO8559_none, kAddSettings);
00088 static CPersistentBool gICTextOption("P_ICTextOption", false, kAddSettings);
00089 static CPersistentBool gAddBinControl("P_AddBinControl", true);
00090 static CPersistentBool gUseViewerAlways("P_UseViewerAlways", false, kAddSettings);
00091 static CPersistentInt gMacBinEncoding("P_NMacBinEncoding", MAC_HQX, kAddSettings);
00092 static CPersistentInt gUseShell("P_UseShell", SHELL_TCL);
00093
00094 static PCPStr gCvsroot("P_Cvsroot");
00095 CMString gOldCvsroots(20, "P_OldCvsroots");
00096
00097 // migration
00098 #ifndef MIGRATECVSROOTLIST
00099 static PCPStr gCvsroot1("P_Cvsroot1");
00100 static PCPStr gCvsroot2("P_Cvsroot2");
00101 static PCPStr gCvsroot3("P_Cvsroot3");
00102 static PCPStr gCvsroot4("P_Cvsroot4");
00103 static PCPStr gCvsroot5("P_Cvsroot5");
00104 static PCPStr gCvsroot6("P_Cvsroot6");
00105 static PCPStr gCvsroot7("P_Cvsroot7");
00106 static PCPStr gCvsroot8("P_Cvsroot8");
00107 static PCPStr gCvsroot9("P_Cvsroot9");
00108 static PCPStr gCvsroot10("P_Cvsroot10");
00109 static PCPStr gCvsroot11("P_Cvsroot11");
00110 static PCPStr gCvsroot12("P_Cvsroot12");
00111 static PCPStr gCvsroot13("P_Cvsroot13");
00112 static PCPStr gCvsroot14("P_Cvsroot14");
00113 static PCPStr gCvsroot15("P_Cvsroot15");
00114 static PCPStr gCvsroot16("P_Cvsroot16");
00115 static PCPStr gCvsroot17("P_Cvsroot17");
00116 static PCPStr gCvsroot18("P_Cvsroot18");
00117 static PCPStr gCvsroot19("P_Cvsroot19");
00118 static PCPStr gCvsroot20("P_Cvsroot20");
00119 #endif
00120
00121 static CPersistentInt gKserverPort("P_KserverPort", -1, kAddSettings);
00122 static CPersistentInt gPserverPort("P_PserverPort", -1, kAddSettings);
00123 static CPersistentInt gRhostPort("P_RhostPort", -1, kAddSettings);
00124 static PCPStr gServerName("P_ServerName", 0L, kAddSettings);
00125 static PCStr gRshName("P_RshName", 0L, kAddSettings);
00126 static CPersistentBool gEncryptCommunication("P_EncryptCommunication", false, kAddSettings);
00127
00128 #ifndef qUnix
00129 static PCStr gHome("P_Home", 0L, kAddSettings);
00130 #endif /* !qUnix */
00131 #ifdef qUnix
00132 static PCStr gViewer("P_Viewer", "emacs"); // not vi ;-)
00133 #else
00134 static PCStr gViewer("P_Viewer", "Notepad");
00135 #endif
00136 static PCStr gHelper("P_Helper", "netscape");
00137 static PCStr gBrowser("P_Browser", "gmc");
00138 #ifdef qUnix
00139 static PCStr gExtdiff("P_Extdiff", "emacs");
00140 #else
00141 static PCStr gExtdiff("P_Extdiff", "");
00142 #endif
00143 static CPersistentBool gDirtySupport("P_DirtySupport", true, kAddSettings);
00144 static CPersistentBool gAlwaysUseCvsroot("P_AlwaysUseCvsroot", false, kAddSettings);
00145 static CPersistentInt gLogoutTimeOut("P_LogoutTimeOut", 0);
00146 static PCStr gProxyHost("P_ProxyHost", "www.mydomain", kAddSettings);
00147 static CPersistentInt gProxyPort("P_ProxyPort", 8888, kAddSettings);
00148 static CPersistentBool gUseProxy("P_UseProxy", false, kAddSettings);
00149 static CPersistentBool gUnixLF("P_UnixLF", false, kAddSettings);
00150 static CPersistentBool gMacLF("P_MacLF", false, kAddSettings);
00151 static CPersistentInt gZLevel("P_ZLevel", 9, kAddSettings);
00152 static CPersistentInt gCvsVersion("P_CvsVersion", 0, kAddSettings);
00153 static CPersistentBool gCvsConsole("P_CvsConsole", false, kAddSettings);
00154 static CPersistentInt gWordWrapLogMsg("P_WordWrapLogMsg", 0, kAddSettings);
00155 static PCStr gLastWorkingDir("P_LastWorkingDir", 0L, kAddSettings);
00156
00157 static CPersistentBool gHideCommandDlgUpdate("P_HideCommandDlgUpdate", false);
00158 static CPersistentBool gHideCommandDlgDiff("P_HideCommandDlgDiff", false);
00159 static CPersistentBool gHideCommandDlgLog("P_HideCommandDlgLog", false);
00160 static CPersistentBool gHideCommandDlgGraph("P_HideCommandDlgGraph", false);
00161 static CPersistentBool gHideCommandDlgAnnotate("P_HideCommandDlgAnnotate", false);
00162 static CPersistentBool gHideCommandDlgUseShift("P_HideCommandDlgUseShift", true);
00163
00164 static CKeyString gWhichCvs(10, "P_WhichCvs" );
00165 static CPersistentBool gUseAltCvs("P_UseAltCvs", false, kAddSettings);
00166
00167 bool CvsPrefs::CheckoutRO(void) const {return gCheckoutRO;}
00168 bool CvsPrefs::Z9Option(void) const
00169 {
00170 #ifdef macintosh
00171     // because of the problem with LSH...
00172     return true;
00173 #endif
00174     return gZ9Option;
00175 }
00176 bool CvsPrefs::PruneOption(void) const {return gPruneOption;}
00177 bool CvsPrefs::QuietOption(void) const {return gQuietOption;}
00178 ISO8559 CvsPrefs::IsoConvert(void) const {return (ISO8559)(int)gIsoConvert;}
00179 bool CvsPrefs::ICTextOption(void) const {return gICTextOption;}
00180 bool CvsPrefs::AddControl(void) const {return gAddBinControl;}
00181 bool CvsPrefs::UseViewerAlways(void) const {return gUseViewerAlways;}
00182 MACENCODING CvsPrefs::MacBinEncoding(void) const {return (MACENCODING)(int)gMacBinEncoding;}
00183 int CvsPrefs::KserverPort(void) const {return gKserverPort;}
00184 int CvsPrefs::PserverPort(void) const {return gPserverPort;}
00185 int CvsPrefs::RhostPort(void) const {return gRhostPort;}
00186
00187 const char * CvsPrefs::ServerName(void) const
00188 {
00189     return gServerName.empty() ? 0L : (const char *)gServerName;
00190 }
00191 const char * CvsPrefs::RshName(void) const
00192 {
00193     return gRshName.empty() ? 0L : (const char *)gRshName;
00194 }
00195 bool CvsPrefs::EncryptCommunication(void) const {return gEncryptCommunication;}
00196
00197 const char * CvsPrefs::Home(void) const
00198 {
00199 #if !qUnix && !TARGET_RT_MAC_MACHO
00200 #   ifdef WIN32
00201     // Windows 98 doesn't like C:\/.cvspass
00202     if(!gHome.empty() && gHome.endsWith(kPathDelimiter))
00203     {
00204         gHome[gHome.length() - 1] = '\0';
00205     }
00206 #   endif
00207     return gHome.empty() ? 0L : (const char *)gHome;
00208 #else /* qUnix */
00209     static CStr home;
00210     if (!home.empty())
00211         return home;
00212
00213     char *env = getenv ("HOME");
00214     struct passwd *pw;
00215     if (env)
00216         home = env;
00217     else if ((pw = (struct passwd *) getpwuid (getuid ()))
00218              && pw->pw_dir)
00219         home = pw->pw_dir;
00220     else
00221         return 0L;
00222
00223     return home;
00224 #endif /* qUnix */
00225 }
00226 const char * CvsPrefs::Viewer(void) const
00227 {
00228     return gViewer.empty() ? 0L : (const char *)gViewer;
00229 }
00230 const char * CvsPrefs::Helper(void) const
00231 {
00232     return gHelper.empty() ? 0L : (const char *)gHelper;
00233 }
00234 const char * CvsPrefs::Browser(void) const
00235 {
00236     return gBrowser.empty() ? 0L : (const char *)gBrowser;
00237 }
00238 const char * CvsPrefs::ExtDiff(void) const
00239 {
00240     return gExtdiff.empty() ? 0L : (const char *)gExtdiff;
00241 }
00242 bool CvsPrefs::DirtySupport(void) const {return gDirtySupport;}
00243 int CvsPrefs::LogoutTimeOut(void) const {return gLogoutTimeOut;}
00244 bool CvsPrefs::AlwaysUseCvsroot(void) const {return gAlwaysUseCvsroot;}
00245 const char *CvsPrefs::ProxyHost(void) const {return gProxyHost;}
00246 int CvsPrefs::ProxyPort(void) const {return gProxyPort;}
00247 bool CvsPrefs::UseProxy(void) const {return gUseProxy;}
00248 bool CvsPrefs::UnixLF(void) const {return gUnixLF;}
00249 bool CvsPrefs::MacLF(void) const {return gMacLF;}
00250 int CvsPrefs::ZLevel(void) const {return gZLevel;}
00251 int CvsPrefs::CvsVersion(void) const {return gCvsVersion;}
00252 bool CvsPrefs::CvsConsole(void) const {return gCvsConsole;}
00253 int CvsPrefs::WordWrapLogMsg(void) const {return gWordWrapLogMsg;}
00254 SHELL_KIND CvsPrefs::GetUseShell(void) const {return (SHELL_KIND)(int)gUseShell;}
00255
00256 /* Return the current working dir (last working dir).   */
00257 /* This directory is automatically selected when WinCVS */
00258 /* is opened the next time. */
00259 const char * CvsPrefs::LastWorkingDir(void) const
00260 {
00261     return gLastWorkingDir.empty() ? 0L : (const char *)gLastWorkingDir;
00262 }
00263
00264 bool CvsPrefs::HideCommandDlgUpdate(void) const {return gHideCommandDlgUpdate;}
00265 bool CvsPrefs::HideCommandDlgDiff(void) const {return gHideCommandDlgDiff;}
00266 bool CvsPrefs::HideCommandDlgLog(void) const {return gHideCommandDlgLog;}
00267 bool CvsPrefs::HideCommandDlgGraph(void) const {return gHideCommandDlgGraph;}
00268 bool CvsPrefs::HideCommandDlgAnnotate(void) const {return gHideCommandDlgAnnotate;}
00269 bool CvsPrefs::HideCommandDlgUseShift(void) const {return gHideCommandDlgUseShift;}
00270
00271 void CvsPrefs::SetCheckoutRO(bool newState) {gCheckoutRO = newState;}
00272 void CvsPrefs::SetZ9Option(bool newState) {gZ9Option = newState;}
00273 void CvsPrefs::SetPruneOption(bool newState) {gPruneOption = newState;}
00274 void CvsPrefs::SetQuietOption(bool newState) {gQuietOption = newState;}
00275 void CvsPrefs::SetIsoConvert(ISO8559 newState) {gIsoConvert = (int)newState;}
00276 void CvsPrefs::SetICTextOption(bool newState) {gICTextOption = newState;}
00277 void CvsPrefs::SetAddControl(bool newState) {gAddBinControl = newState;}
00278 void CvsPrefs::SetUseViewerAlways(bool newState) {gUseViewerAlways = newState;}
00279 void CvsPrefs::SetMacBinEncoding(MACENCODING newState) {gMacBinEncoding = (int)newState;}
00280 void CvsPrefs::SetKserverPort(int newState) {gKserverPort = newState;}
00281 void CvsPrefs::SetPserverPort(int newState) {gPserverPort = newState;}
00282 void CvsPrefs::SetRhostPort(int newState) {gRhostPort = newState;}
00283 void CvsPrefs::SetServerName(const char *newservername) {gServerName = newservername;}
00284 void CvsPrefs::SetRshName(const char *newrshname) {gRshName = newrshname;}
00285 void CvsPrefs::SetEncryptCommunication(bool newState) {gEncryptCommunication = newState;}
00286 void CvsPrefs::SetHome(const char *newhome)
00287 {
00288 #ifndef qUnix
00289     gHome = newhome;
00290 #   ifdef WIN32
00291     // Windows 98 doesn't like C:\/.cvspass
00292     if(!gHome.empty() && gHome.endsWith(kPathDelimiter))
00293     {
00294         gHome[gHome.length() - 1] = '\0';
00295     }
00296 #   endif
00297 #endif /* !qUnix */
00298 }
00299 void CvsPrefs::SetViewer(const char *newviewer) {gViewer = newviewer;}
00300 void CvsPrefs::SetBrowser(const char *newviewer) {gBrowser = newviewer;}
00301 void CvsPrefs::SetHelper(const char *newviewer) {gHelper = newviewer;}
00302 void CvsPrefs::SetExtDiff(const char *newdiff) {gExtdiff = newdiff;}
00303 void CvsPrefs::SetDirtySupport(bool newState) {gDirtySupport = newState;}
00304 void CvsPrefs::SetLogoutTimeOut(int newTimeout) {gLogoutTimeOut = newTimeout;}
00305 void CvsPrefs::SetAlwaysUseCvsroot(bool newState) {gAlwaysUseCvsroot = newState;}
00306 void CvsPrefs::SetUseProxy(bool useit) {gUseProxy = useit;}
00307 void CvsPrefs::SetUnixLF(bool useit) {gUnixLF = useit;}
00308 void CvsPrefs::SetMacLF(bool useit) {gMacLF = useit;}
00309 void CvsPrefs::SetZLevel(int level) {gZLevel = level;}
00310 void CvsPrefs::SetProxyHost(const char *newhost) {gProxyHost = newhost;}
00311 void CvsPrefs::SetProxyPort(int newport) {gProxyPort = newport;}
00312 void CvsPrefs::SetCvsVersion(int vers) {gCvsVersion = vers;}
00313 void CvsPrefs::SetCvsConsole(bool console) {gCvsConsole = console;}
00314 void CvsPrefs::SetWordWrapLogMsg(int wordwrap) {gWordWrapLogMsg = wordwrap;}
00315 void CvsPrefs::SetLastWorkingDir(const char *workdir) {gLastWorkingDir = workdir;}
00316 void CvsPrefs::SetUseShell(SHELL_KIND shell) {gUseShell = shell;}
00317
00318 void CvsPrefs::SetHideCommandDlgUpdate(bool newState) {gHideCommandDlgUpdate = newState;}
00319 void CvsPrefs::SetHideCommandDlgDiff(bool newState) {gHideCommandDlgDiff = newState;}
00320 void CvsPrefs::SetHideCommandDlgLog(bool newState) {gHideCommandDlgLog = newState;}
00321 void CvsPrefs::SetHideCommandDlgGraph(bool newState) {gHideCommandDlgGraph = newState;}
00322 void CvsPrefs::SetHideCommandDlgAnnotate(bool newState) {gHideCommandDlgAnnotate = newState;}
00323 void CvsPrefs::SetHideCommandDlgUseShift(bool newState) {gHideCommandDlgUseShift = newState;}
00324
00325 bool CvsPrefs::empty(void) const  { return gCvsroot.empty();  }
00326 int  CvsPrefs::length(void) const { return gCvsroot.length(); }
00327 CvsPrefs::operator const char *() const {   return (const char *)gCvsroot; }
00328 CvsPrefs::operator const unsigned char *() const {return (const unsigned char *)gCvsroot;}
00329 const char *CvsPrefs::operator=(const char *newstr) {   return gCvsroot = newstr; }
00330 const unsigned char *CvsPrefs::operator=(const unsigned char *newstr) { return gCvsroot = newstr; }
00331
00332 // migration
00333 #ifndef MIGRATECVSROOTLIST
00334 CPStr & CvsPrefs::get_cvsroot_list(int entry)
00335 {
00336     switch(entry)   {
00337     case  0: return gCvsroot1;  break;
00338     case  1: return gCvsroot2;  break;
00339     case  2: return gCvsroot3;  break;
00340     case  3: return gCvsroot4;  break;
00341     case  4: return gCvsroot5;  break;
00342     case  5: return gCvsroot6;  break;
00343     case  6: return gCvsroot7;  break;
00344     case  7: return gCvsroot8;  break;
00345     case  8: return gCvsroot9;  break;
00346     case  9: return gCvsroot10; break;
00347     case 10: return gCvsroot11; break;
00348     case 11: return gCvsroot12; break;
00349     case 12: return gCvsroot13; break;
00350     case 13: return gCvsroot14; break;
00351     case 14: return gCvsroot15; break;
00352     case 15: return gCvsroot16; break;
00353     case 16: return gCvsroot17; break;
00354     case 17: return gCvsroot18; break;
00355     case 18: return gCvsroot19; break;
00356     case 19: return gCvsroot20; break;
00357     }
00358     return gCvsroot1;
00359 }
00360
00361 bool CvsPrefs::has_cvsroot_in_list(const char *cvsroot, int & entry)
00362 {
00363     for(int i = 0; i < NUM_CVSROOT; i++)
00364     {
00365         CPStr & str = get_cvsroot_list(i);
00366         if(str.empty())
00367             continue;
00368         if(strcmp(str, cvsroot) == 0)
00369         {
00370             entry = i;
00371             return true;
00372         }
00373     }
00374     return false;
00375 }
00376
00377 void CvsPrefs::insert_cvsroot_in_list(const char *cvsroot)
00378 {
00379     int entry;
00380
00381     if(has_cvsroot_in_list(cvsroot, entry))
00382     {
00383         // move to the first entry
00384         CPStr tmp;
00385         tmp = get_cvsroot_list(0);
00386         get_cvsroot_list(0) = get_cvsroot_list(entry);
00387         get_cvsroot_list(entry) = tmp;
00388     }
00389     else
00390     {
00391         // push back the entry
00392         for(int i = (NUM_CVSROOT - 1); i >= 1; i--)
00393         {
00394             get_cvsroot_list(i) = get_cvsroot_list(i - 1);
00395         }
00396         get_cvsroot_list(0) = cvsroot;
00397     }
00398 }
00399
00400 void CvsPrefs::flush_list(void)
00401 {
00402     for(int i = 0; i < NUM_CVSROOT; i++)
00403     {
00404         get_cvsroot_list(i) = "";
00405     }
00406 }
00407
00408 #endif /* MIGRATECVSROOTLIST */
00409
00410
00411 void CvsPrefs::save(void)
00412 {
00413     if(empty())
00414         return;
00415
00416     if( SCHEMA_1 != gPersistentShema )
00417     {
00418         gPersistentShema = SCHEMA_1;
00419     }
00420
00421     bool needSave = CPersistent::NeedSave();
00422     bool needSaveSettings = CPersistent::NeedSave(true);
00423     if(!needSave)
00424         return;
00425
00426 // migration
00427 #ifndef MIGRATECVSROOTLIST
00428     // update the CVSROOT list
00429     insert_cvsroot_in_list((const char *)*this);
00430 #endif
00431
00432     CPersistent::SaveAll();
00433
00434     if(!needSaveSettings)
00435         return;
00436
00437 #ifdef WIN32
00438     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00439     SavePersistentSettings(app->GetBrowserView()->GetRoot());
00440 #endif
00441 #ifdef qMacCvsPP
00442     CMacCvsApp::SavePersistentSettings();
00443 #endif /* qMacCvsPP */
00444 #if qUnix
00445     UCvsFolders *browser = UCvsApp::gApp->GetBrowserView();
00446     if(browser != 0L && browser->GetRoot() != 0L)
00447         SavePersistentSettings(browser->GetRoot());
00448 #endif
00449 }
00450
00451 void CvsPrefs::load(void)
00452 {
00453 // migration
00454 #ifndef MIGRATECVSROOTLIST
00455     // flush the CVSROOT list, it will be filled later
00456     flush_list();
00457 #endif
00458
00459     bool loaded = CPersistent::LoadAll();
00460
00461     if( loaded )
00462     {
00463         if( SCHEMA_0 == gPersistentShema )
00464         {
00465             MigrateCvsrootList();
00466         }
00467
00468         return;
00469     }
00470
00471     // backward compatibility
00472 #ifdef WIN32
00473     UINT value;
00474
00475     CString cstr = AfxGetApp()->GetProfileString(PROFILE_NAME, "CVSROOT");
00476     if(!cstr.IsEmpty())
00477         *this = (const char *)cstr;
00478
00479     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "CheckoutRO", -1)) != -1)
00480         SetCheckoutRO(value ? 1 : 0);
00481     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "Z9Option", -1)) != -1)
00482         SetZ9Option(value ? 1 : 0);
00483     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "QuietOption", -1)) != -1)
00484         SetQuietOption(value ? 1 : 0);
00485     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "PruneOption", -1)) != -1)
00486         SetPruneOption(value ? 1 : 0);
00487     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "Authentication", -1)) != -1)
00488         gAuthen.setkind((AuthenKind)value);
00489     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "AddControl", -1)) != -1)
00490         SetAddControl(value ? 1 : 0);
00491
00492     char tmp[20];
00493     for(int i = 0; i < NUM_CVSROOT; i++)
00494     {
00495         sprintf(tmp, "CVSROOTLIST%d", i);
00496         cstr = AfxGetApp()->GetProfileString(PROFILE_NAME, tmp);
00497         if(!cstr.IsEmpty())
00498             gOldCvsroots.Insert((const char *)cstr);
00499     }
00500
00501 #endif /* WIN32 */
00502
00503 #if defined(macintosh) && !TARGET_API_MAC_CARBON
00504     FSSpec theFolder;
00505     short FRef;
00506     Handle hdl;
00507     OSErr err;
00508     Str255 thePath;
00509
00510     err = MacGetPrefsFolder(theFolder, thePath);
00511     if(err != noErr)
00512         return;
00513
00514     err = HSetVol(NULL, theFolder.vRefNum, theFolder.parID);
00515     FRef = OpenResFile(PCVS);
00516     if(FRef < 0)
00517         return;
00518
00519     hdl = GetResource('CVS ', 128);
00520     if(hdl != NULL)
00521     {
00522         Str255 str;
00523         HLock(hdl);
00524         BlockMove(*hdl, str, (*hdl)[0] + 1);
00525         str[str[0] + 1] = '\0';
00526         *this = (const char *)str + 1;
00527         HUnlock(hdl);
00528     }
00529     hdl = GetResource('CHRO', 128);
00530     if(hdl != NULL)
00531     {
00532         SetCheckoutRO(**hdl);
00533     }
00534     hdl = GetResource('Z9OP', 128);
00535     if(hdl != NULL)
00536     {
00537         SetZ9Option(**hdl);
00538     }
00539     hdl = GetResource('QUIE', 128);
00540     if(hdl != NULL)
00541     {
00542         SetQuietOption(**hdl);
00543     }
00544     hdl = GetResource('POPT', 128);
00545     if(hdl != NULL)
00546     {
00547         SetPruneOption(**hdl);
00548     }
00549     hdl = GetResource('AUTH', 128);
00550     if(hdl != NULL)
00551     {
00552         gAuthen.setkind((AuthenKind)**hdl);
00553     }
00554     hdl = GetResource('ISOC', 128);
00555     if(hdl != NULL)
00556     {
00557         SetIsoConvert((ISO8559)**hdl);
00558     }
00559     hdl = GetResource('ICTO', 128);
00560     if(hdl != NULL)
00561     {
00562         SetICTextOption(**hdl);
00563     }
00564     hdl = GetResource('ACTL', 128);
00565     if(hdl != NULL)
00566     {
00567         SetAddControl(**hdl);
00568     }
00569
00570     for(int i = 0; i < NUM_CVSROOT; i++)
00571     {
00572         hdl = GetResource('CROL', 128 + i);
00573         if(hdl != NULL)
00574         {
00575             HLock(hdl);
00576             get_cvsroot_list(i) = (const char *)*hdl;
00577             HUnlock(hdl);
00578         }
00579     }
00580     CloseResFile (FRef);
00581 #endif /* macintosh && !TARGET_API_MAC_CARBON */
00582 }
00583
00585 void MigrateCvsrootList()
00586 {
00587     for(int nIndex = 0; nIndex <= NUM_CVSROOT; nIndex++)
00588     {
00589         CStr cvsroot;
00590 #ifdef WIN32
00591         char tmp[20];
00592         sprintf(tmp, "P_Cvsroot%d", nIndex);
00593         BYTE* ppData;
00594         UINT pBytes = 0;
00595
00596         if( !AfxGetApp()->GetProfileBinary(PROFILE_NAME, tmp, &ppData, &pBytes) )
00597         {
00598             continue;
00599         }
00600
00601         cvsroot = (char*)ppData;
00602         delete ppData;
00603 #endif /* WIN32 */
00604
00605 #if qUnix
00606 #endif // qUnix
00607
00608 #if qMacCvsPP
00609 #endif // qMacCvsPP
00610
00611         if( !cvsroot.empty() )
00612         {
00613             gOldCvsroots.Insert(cvsroot);
00614         }
00615     }
00616 }
00617
00618 #ifdef WIN32
00619 kWinVersion CvsPrefs::WhichVersion()
00620 {
00621     DWORD dwVersion = GetVersion(); // Get major and minor version numbers of Windows
00622     DWORD dwWindowsMajorVersion =  (DWORD)(LOBYTE(LOWORD(dwVersion)));
00623     DWORD dwWindowsMinorVersion =  (DWORD)(HIBYTE(LOWORD(dwVersion)));
00624     DWORD dwBuild;
00625
00626     // Get build numbers for Windows NT or Win32s
00627     if (dwVersion < 0x80000000)                // Windows NT
00628     {
00629         dwBuild = (DWORD)(HIWORD(dwVersion));
00630         return dwWindowsMajorVersion == 3 ? kWinNT35 : kWinNT4;
00631     }
00632     else if (dwWindowsMajorVersion < 4)        // Win16s
00633     {
00634         dwBuild = (DWORD)(HIWORD(dwVersion));
00635         return kWin16;
00636     }
00637
00638     // Windows 95 -- No build numbers provided    dwBuild =  0;
00639     return kWin32;
00640 }
00641 #endif /* WIN32 */
00642
00643
00644 //
00645 // TODO: If we sometimes implement multi-threaded CVS/TCL macro
00646 // execution then we have to implement thread synchronization in
00647 // IsXXXRunning and SetXXXRunning methods.
00648 //
00649 // NOTE! IsCvsRunning and SetCvsRunning methods are not yet
00650 // used in Mac/Unix/WinCVS. Each of these version have had
00651 // their own app.gCvsRunning variable. I haven't cleaned up
00652 // the code and changed them to use this "one and only"
00653 // CvsRunning methods.
00654 //
00655 bool CvsPrefs::IsCvsRunning(void) const
00656 {
00657     return(fCvsRunningCounter > 0);
00658 }
00659
00660 int  CvsPrefs::SetCvsRunning(bool launched)
00661 {
00662     if(launched)
00663         fCvsRunningCounter++;
00664     else if(fCvsRunningCounter > 0)
00665         fCvsRunningCounter--;
00666
00667     return fCvsRunningCounter;
00668 }
00669
00670 bool CvsPrefs::IsTclFileRunning(void) const
00671 {
00672     return(fTclFileRunningCounter > 0);
00673 }
00674
00675 int  CvsPrefs::SetTclFileRunning(bool launched)
00676 {
00677     if(launched)
00678         fTclFileRunningCounter++;
00679     else if(fTclFileRunningCounter > 0)
00680         fTclFileRunningCounter--;
00681
00682     return fTclFileRunningCounter;
00683 }
00684
00685
00686 bool LaunchDiff(const char *f1, const char *f2)
00687 {
00688 #ifdef qMacCvsPP
00689     const   OSType      kBBEditDiffCreatorCode  = FOUR_CHAR_CODE('BBds');
00690     const   OSType      kResourcererCreatorCode = FOUR_CHAR_CODE('Doug');
00691
00692     //  Resourcerer's Compare suite
00693     const   DescType    kAECompareClass = 'Comp';
00694     const   DescType    kAECompareEvent = 'Comp';
00695         const   DescType    keyNewer        = 'kNew';
00696         const   DescType    keyOlder        = 'kOld';
00697         const   DescType    keyShowDiff     = 'kShD';
00698         const   DescType    keyReturnDiff   = 'kRtD';
00699
00700     OSErr               e = noErr;
00701
00702     try {
00703         //  Convert to file specs
00704         Boolean             inShowDiffs = true;
00705 #if TARGET_RT_MAC_CFM
00706         FSSpec              spec1 = GUSIFileSpec (f1);
00707         FSSpec              spec2 = GUSIFileSpec (f2);
00708 #else
00709         FSRef               ref1 = GUSIFileSpec (f1);
00710         FSRef               ref2 = GUSIFileSpec (f2);
00711         FSSpec              spec1;
00712         FSSpec              spec2;
00713
00714         ThrowIfOSErr_(FSGetCatalogInfo(&ref1, kFSCatInfoNone, NULL, NULL, &spec1, NULL));
00715         ThrowIfOSErr_(FSGetCatalogInfo(&ref2, kFSCatInfoNone, NULL, NULL, &spec2, NULL));
00716 #endif
00717
00718         //  Find the file type
00719         FInfo   info;
00720         e = ::FSpGetFInfo (&spec2, &info);
00721         ThrowIfOSErr_(e);
00722
00723         //  Decide on the application
00724         OSType              applCreator = FOUR_CHAR_CODE('????');
00725         switch (info.fdType) {
00726             case 'TEXT':
00727                 applCreator = kBBEditDiffCreatorCode;
00728                 break;
00729
00730             default:
00731                 applCreator = kResourcererCreatorCode;
00732                 break;
00733             } // switch
00734
00735         //  Try to launch it
00736         LaunchFlags         launchFlags = launchContinue + launchNoFileFlags;
00737         OSType              applType = FOUR_CHAR_CODE('APPL');
00738         FSSpec              applSpec;
00739         ProcessSerialNumber applPSN;
00740         if (!UProcess::Launch (applCreator, applType, launchFlags, &applSpec, &applPSN)) Throw_(fnfErr);
00741
00742         //  Now, diff the files.  We use the Resourcerer suite and a BBEdit glue applet.
00743             //  Create the parameters
00744         StAEDescriptor  newerDesc (spec1);
00745         StAEDescriptor  olderDesc (spec2);
00746         StAEDescriptor  showDesc (inShowDiffs);
00747
00748             //  Create the event
00749         StAEDescriptor  addressDesc (typeProcessSerialNumber, &applPSN, sizeof (applPSN));
00750
00751         StAEDescriptor  diffEvent;
00752         e = ::AECreateAppleEvent (kAECompareClass, kAECompareEvent, addressDesc, kAutoGenerateReturnID, kAnyTransactionID, diffEvent);
00753         ThrowIfOSErr_(e);
00754
00755             //  Add the parameters
00756         e = ::AEPutParamDesc (diffEvent, keyNewer, newerDesc);
00757         ThrowIfOSErr_(e);
00758         e = ::AEPutParamDesc (diffEvent, keyOlder, olderDesc);
00759         ThrowIfOSErr_(e);
00760         e = ::AEPutParamDesc (diffEvent, keyShowDiff, showDesc);
00761         ThrowIfOSErr_(e);
00762
00763             //  Send the event
00764         UAppleEventsMgr::SendAppleEvent (diffEvent);
00765
00766         return true;
00767         } // try
00768
00769     catch (LException ex) {
00770         } // catch
00771 #endif
00772     if(gCvsPrefs.ExtDiff() == 0L)
00773     {
00774         cvs_err("The external diff program is not defined,\n");
00775         cvs_err("you need to set it in the preferences dialog.\n");
00776         return false;
00777     }
00778 #ifdef WIN32
00779     CString args;
00780     CStr program, file1, file2;
00781     if(strchr(gCvsPrefs.ExtDiff(), ' ') != 0L)
00782     {
00783         program << '\"';
00784         program << gCvsPrefs.ExtDiff();
00785         program << '\"';
00786     }
00787     else
00788         program = gCvsPrefs.ExtDiff();
00789
00790     if(strchr(f1, ' ') != 0L)
00791     {
00792         file1 << '\"';
00793         file1 << f1;
00794         file1 << '\"';
00795     }
00796     else
00797         file1 = f1;
00798
00799     if(strchr(f2, ' ') != 0L)
00800     {
00801         file2 << '\"';
00802         file2 << f2;
00803         file2 << '\"';
00804     }
00805     else
00806         file2 = f2;
00807
00808     args += file1;
00809     args += " ";
00810     args += file2;
00811
00812     HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), NULL, gCvsPrefs.ExtDiff(), args,
00813                         NULL, SW_SHOWDEFAULT);
00814
00815     if((UINT)hInst < 32)
00816     {
00817         // ExtDiff app was not found. Let's try to execute it from
00818         // the application path. However, this is done only when ExtDiff
00819         // value doesn't contain absolute path ("c:\subdir\" or "\subdir\").
00820         if(strchr(gCvsPrefs.ExtDiff(), ':') == 0L && (gCvsPrefs.ExtDiff()[0]) != '\\')
00821         {
00822             CStr appPath;
00823
00824             ((CWincvsApp *)AfxGetApp())->GetAppPath(appPath);
00825             if(!appPath.endsWith(kPathDelimiter))
00826                 appPath << kPathDelimiter;
00827
00828             appPath << gCvsPrefs.ExtDiff();
00829
00830             hInst = ShellExecute(*AfxGetMainWnd(), NULL, appPath, args,
00831                     NULL, SW_SHOWDEFAULT);
00832         }
00833     }
00834
00835     if((UINT)hInst < 32)
00836     {
00837         LPVOID lpMsgBuf;
00838         FormatMessage(
00839             FORMAT_MESSAGE_ALLOCATE_BUFFER |
00840             FORMAT_MESSAGE_FROM_SYSTEM |
00841             FORMAT_MESSAGE_IGNORE_INSERTS,
00842             NULL,
00843             GetLastError(),
00844             MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
00845             (LPTSTR) &lpMsgBuf,
00846             0,
00847             NULL
00848             );
00849         cvs_err("Unable to open '%s' (%s), using console instead\n",
00850             (char *)gCvsPrefs.ExtDiff(), (LPCSTR)lpMsgBuf);
00851         // Free the buffer.
00852         LocalFree( lpMsgBuf );
00853         return false;
00854     }
00855
00856     return true;
00857 #elif qUnix
00858     CvsArgs args(false);
00859     args.add(gCvsPrefs.ExtDiff());
00860     args.add(f1);
00861     args.add(f2);
00862     UCvsApp::gApp->Execute(args.Argc(), args.Argv());
00863     return true;
00864 #else
00865     return false;
00866 #endif
00867 }
00868
00869 bool LaunchViewer(const char *fullpath,bool useDefault /*= false*/)
00870 {
00871 #ifdef WIN32
00872     bool done = false;
00873
00874     if( !gCvsPrefs.UseViewerAlways() )
00875     {
00876         char viewer[_MAX_PATH];
00877         UStr buf;
00878         CStr uppath, folder;
00879         SplitPath(fullpath, uppath, folder);
00880
00881         HINSTANCE hInst = FindExecutable(fullpath, folder, viewer);
00882         if(!useDefault && (UINT)hInst >= 32)
00883         {
00884             // see Article ID: Q140724 for the problem desc of FindExecutable
00885             struct stat sb;
00886             HINSTANCE hInst;
00887             if (stat(viewer, &sb) != -1 && S_ISREG(sb.st_mode))
00888             {
00889                 CStr fullpathQuote;
00890                 if(strchr(fullpath, ' ') != 0L)
00891                 {
00892                     fullpathQuote << '\"';
00893                     fullpathQuote << fullpath;
00894                     fullpathQuote << '\"';
00895                 }
00896                 else
00897                     fullpathQuote = fullpath;
00898
00899                 hInst = ShellExecute(*AfxGetMainWnd(), "open", viewer, fullpathQuote,
00900                     folder, SW_SHOWDEFAULT);
00901             }
00902             else
00903                 hInst = ShellExecute(*AfxGetMainWnd(), "open", fullpath, 0L,
00904                     folder, SW_SHOWDEFAULT);
00905
00906             if((long)hInst < 32)
00907             {
00908                 cvs_err("Unable to open '%s' (error %d), using default viewer instead\n", (char *)fullpath, GetLastError());
00909             }
00910             else
00911                 done = true;
00912         }
00913     }
00914
00915     if(!done)
00916     {
00917         if(gCvsPrefs.Viewer() == 0L)
00918         {
00919             cvs_err("You need to define a default viewer for this file in the preferences\n");
00920             return false;
00921         }
00922
00923         const char * argv[3] = {0L, 0L, 0L};
00924         CStr program, file;
00925         if(strchr(gCvsPrefs.Viewer(), ' ') != 0L)
00926         {
00927             program << '\"';
00928             program << gCvsPrefs.Viewer();
00929             program << '\"';
00930         }
00931         else
00932             program = gCvsPrefs.Viewer();
00933         if(strchr(fullpath, ' ') != 0L)
00934         {
00935             file << '\"';
00936             file << fullpath;
00937             file << '\"';
00938         }
00939         else
00940             file = fullpath;
00941         argv[0] = program;
00942         argv[1] = file;
00943         int process = _spawnvp(_P_NOWAIT, gCvsPrefs.Viewer(), argv);
00944     }
00945
00946     return true;
00947 #endif /* WIN32 */
00948
00949 #ifdef qMacCvsPP
00950     return true;
00951 #endif /* qMacCvsPP */
00952
00953 #if qUnix
00954     return true;
00955 #endif // qUnix
00956 }
00957
00958 bool LaunchEditor(const char* tmpFile, void* par /*= 0L*/)
00959 {
00960     CStr program, file;
00961     if(strchr(gCvsPrefs.Viewer(), ' ') != 0L)
00962     {
00963         program << '\"';
00964         program << gCvsPrefs.Viewer();
00965         program << '\"';
00966     }
00967     else
00968         program = gCvsPrefs.Viewer();
00969     if(strchr(tmpFile, ' ') != 0L)
00970     {
00971         file << '\"';
00972         file << tmpFile;
00973         file << '\"';
00974     }
00975     else
00976         file = tmpFile;
00977
00978     CStr command;
00979     command << program;
00980     command << " ";
00981     command << file;
00982
00983 #ifdef WIN32
00984     STARTUPINFO sStartupInfo;
00985     PROCESS_INFORMATION sProcessInformation;
00986
00987     // Execute the command with a call to the CreateProcess API call.
00988     memset( &sStartupInfo, 0, sizeof(sStartupInfo) );
00989     sStartupInfo.cb = sizeof( sStartupInfo );
00990     sStartupInfo.dwFlags = STARTF_USESHOWWINDOW;
00991     sStartupInfo.wShowWindow = SW_SHOWNORMAL;
00992
00993     if( !CreateProcess( NULL,
00994         (char*)command,
00995         NULL,
00996         NULL,
00997         FALSE,
00998         0,
00999         NULL,
01000         NULL,
01001         &sStartupInfo,
01002         &sProcessInformation) )
01003     {
01004         sProcessInformation.hProcess = INVALID_HANDLE_VALUE;
01005         sProcessInformation.hThread = INVALID_HANDLE_VALUE;
01006     }
01007
01008     *((PROCESS_INFORMATION*)par) = sProcessInformation;
01009     return sProcessInformation.hProcess != INVALID_HANDLE_VALUE;
01010 #endif /* WIN32 */
01011
01012 #ifdef qMacCvsPP
01013     return true;
01014 #endif /* qMacCvsPP */
01015
01016 #if qUnix
01017     return true;
01018 #endif // qUnix
01019 }
01020
01021 bool CvsPrefs::UseAltCvs(void) const {return gUseAltCvs;}
01022 void CvsPrefs::SetUseAltCvs(bool useit) {gUseAltCvs = useit;}
01023
01024 void CvsPrefs::SetWhichCvs(const char *cvsPath)
01025 {
01026     UStr appPath;
01027
01028 #ifdef WIN32
01029     HINSTANCE hInst = ::AfxGetInstanceHandle();
01030     char apath[512];
01031     DWORD len;
01032     if(hInst != 0L && (len = ::GetModuleFileName(hInst, apath, 512)) > 0)
01033     {
01034         CString tmp(apath);
01035         tmp.MakeLower();
01036         appPath = tmp;
01037     }
01038 #elif qUnix
01039     appPath << EXECLIB << "/" << "cvs";
01040 #elif TARGET_RT_MAC_MACHO
01041     appPath = CMacCvsApp::gApp->GetAppPath();
01042 #endif
01043
01044     if(!appPath.empty()) {
01045         UStr value;
01046         gWhichCvs.Concatenate(value, appPath, cvsPath);
01047         gWhichCvs.Insert(value);
01048     } else {
01049         gWhichCvs.Insert( cvsPath );
01050     }
01051 }
01052
01053 const char *CvsPrefs::WhichCvs(UStr & path, bool userOnly) const
01054 {
01055     path = "";
01056
01057     UStr appPath = "";
01058
01059 #ifdef WIN32
01060     HINSTANCE hInst = ::AfxGetInstanceHandle();
01061     char apath[512];
01062     DWORD len;
01063     if(hInst != 0L && (len = ::GetModuleFileName(hInst, apath, 512)) > 0)
01064     {
01065         CString tmp(apath);
01066         tmp.MakeLower();
01067         appPath = tmp;
01068     }
01069 #elif qUnix
01070     appPath << EXECLIB << "/" << "cvs";
01071 #elif TARGET_RT_MAC_MACHO
01072     appPath = CMacCvsApp::gApp->GetAppPath();
01073 #endif
01074
01075     // search if beside the default cvs, the user defined one to use
01076     // with this application only.
01077     UStr candidate;
01078     if(!appPath.empty())
01079     {
01080         UStr value;
01081         gWhichCvs.Concatenate(value, appPath, "");
01082         TMString<UStr>::list_t::const_iterator i = gWhichCvs.Find(value);
01083         if(i != gWhichCvs.end())
01084         {
01085             UStr key;
01086             gWhichCvs.Split(*i, key, candidate);
01087         }
01088     }
01089
01090     // verify this cvs exe is still there
01091     struct stat sb;
01092     if(!candidate.empty() && stat(candidate, &sb) != -1 && S_ISREG(sb.st_mode))
01093     {
01094         path = candidate;
01095         return path.c_str();
01096     }
01097
01098     // fallback to the default one.
01099     if(userOnly)
01100         return 0L;
01101
01102 #ifdef WIN32
01103     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
01104
01105     app->GetAppPath(path);
01106     if(!path.endsWith(kPathDelimiter))
01107         path << kPathDelimiter;
01108     path << (gCvsPrefs.WhichVersion() == kWin32 ? "cvs95.exe" : "cvs.exe");
01109 #elif qUnix
01110     if( path.empty() )
01111         path = EXECLIB;
01112
01113     if(!path.endsWith(kPathDelimiter))
01114         path << kPathDelimiter;
01115
01116     path << "cvs";
01117 #elif TARGET_RT_MAC_MACHO
01118     path = CMacCvsApp::gApp->GetAppPath();
01119     if(!path.endsWith(kPathDelimiter))
01120         path << kPathDelimiter;
01121 #   if qCvsDebug
01122     path << "cvsguidbg";
01123 #   else
01124     path << "cvsgui";
01125 #   endif
01126 #endif
01127
01128     return path.c_str();
01129 }
01130
01131
01132
01133
Generated on Sun Feb 24 01:21:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/CvsPrefs.h Source File

common/CvsPrefs.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * CvsPrefs.h --- class to handle CVS settings
00023  */
00024
00025 #ifndef CVSPREFS_H
00026 #define CVSPREFS_H
00027
00028 #include <string.h>
00029
00030 #include "CPStr.h"
00031 #include "Persistent.h"
00032
00033 #ifdef macintosh
00034 #   include <Files.h>
00035 #endif /* macintosh */
00036
00037 #if defined(WIN32) || TARGET_OS_MAC
00038 // add additional platforms here when the modification will be completed for it
00039 // when all are ready remove the code contained in conditional compilation blocks
00040 #define MIGRATECVSROOTLIST
00041
00042 #endif /* WIN32 */
00043
00044 typedef enum
00045 {
00046     SCHEMA_0,   //default
00047     SCHEMA_1    //WinCvs 1.3b7 and greater
00048 } SCHEMA_NUMBER;
00049
00050 typedef enum
00051 {
00052     ISO8559_none, // no conversion
00053     ISO8559_1, // Latin1
00054     ISO8559_1_MacCvsPro, // Latin1
00055     ISO8559_2, // Latin2
00056     ISO8559_3, // Latin3
00057     ISO8559_4, // Latin4
00058     ISO8559_5, // Cyrillic
00059     ISO8559_6, // Arabic
00060     ISO8559_7, // Greek
00061     ISO8559_8, // Hebrew
00062     ISO8559_9, // Latin5 (Turkish)
00063     ISO8559_10 // Latin6 (Nordic)
00064 } ISO8559;
00065
00066 typedef enum
00067 {
00068     MAC_HQX, // HQX (7bits)
00069     MAC_APPSINGLE // Apple Single
00070 } MACENCODING;
00071
00072 typedef enum
00073 {
00074     SHELL_TCL,
00075     SHELL_PYTHON
00076 } SHELL_KIND;
00077
00078 #define NUM_CVSROOT 20
00079
00080 #ifdef WIN32
00081     typedef enum
00082     {
00083         kWin16,
00084         kWinNT35,
00085         kWinNT4,
00086         kWin32
00087     } kWinVersion;
00088 #endif /* WIN32 */
00089
00090 class CMString;
00091 extern CMString gOldCvsroots;
00092
00093 void MigrateCvsrootList();
00094     // copy the previous cvsroot list data to the new schema
00095
00096 class CKeyString;
00097
00098 class CvsPrefs
00099 {
00100
00101 public :
00102     inline CvsPrefs() : fHasLoggedIn(false),
00103         fCvsRunningCounter(0), fTclFileRunningCounter(0) {}
00104     inline ~CvsPrefs() {}
00105
00106     // CVSROOT
00107     bool empty(void) const;
00108     int length(void) const;
00109
00110     const char *operator=(const char *newstr);
00111         // set to a new C String (0L is OK)
00112     const unsigned char *operator=(const unsigned char *newstr);
00113         // set to a new P String (0L is OK)
00114
00115     operator const char *() const;
00116         // as a C string
00117     operator const unsigned char *() const;
00118         // as a P string
00119
00120     // misc. options
00121     bool CheckoutRO(void) const;
00122     bool Z9Option(void) const;
00123     bool PruneOption(void) const;
00124     bool QuietOption(void) const;
00125     ISO8559 IsoConvert(void) const;
00126     bool ICTextOption(void) const;
00127     bool AddControl(void) const;
00128     bool UseViewerAlways(void) const;
00129     MACENCODING MacBinEncoding(void) const;
00130     int KserverPort(void) const;
00131     int PserverPort(void) const;
00132     int RhostPort(void) const;
00133     const char * ServerName(void) const;
00134     const char * RshName(void) const;
00135     bool EncryptCommunication(void) const;
00136     const char * Home(void) const;
00137     const char * Viewer(void) const;
00138     const char * ExtDiff(void) const;
00139     const char * Helper(void) const;
00140     const char * Browser(void) const;
00141     bool DirtySupport(void) const;
00142     int LogoutTimeOut(void) const;
00143     bool AlwaysUseCvsroot(void) const;
00144     bool UseProxy(void) const;
00145     const char *ProxyHost(void) const;
00146     int ProxyPort(void) const;
00147     bool UnixLF(void) const;
00148     bool MacLF(void) const;
00149     int ZLevel(void) const;
00150     int CvsVersion(void) const;
00151     bool CvsConsole(void) const;
00152     int WordWrapLogMsg(void) const;
00153     const char * LastWorkingDir(void) const;
00154     bool UseKeyChain(void) const; // on mac
00155     bool HideCommandDlgUpdate(void) const;
00156     bool HideCommandDlgDiff(void) const;
00157     bool HideCommandDlgLog(void) const;
00158     bool HideCommandDlgGraph(void) const;
00159     bool HideCommandDlgAnnotate(void) const;
00160     bool HideCommandDlgUseShift(void) const;
00161     SHELL_KIND GetUseShell(void) const;
00162
00163     void SetCheckoutRO(bool newState);
00164     void SetZ9Option(bool newState);
00165     void SetPruneOption(bool newState);
00166     void SetQuietOption(bool newState);
00167     void SetIsoConvert(ISO8559 newState);
00168     void SetICTextOption(bool newState);
00169     void SetAddControl(bool newState);
00170     void SetUseViewerAlways(bool newState);
00171     void SetMacBinEncoding(MACENCODING newState);
00172     void SetKserverPort(int newState);
00173     void SetPserverPort(int newState);
00174     void SetRhostPort(int newState);
00175     void SetServerName(const char *newservername);
00176     void SetRshName(const char *newrshname);
00177     void SetEncryptCommunication(bool newState);
00178     void SetHome(const char *newhome);
00179     void SetViewer(const char *newviewer);
00180     void SetExtDiff(const char *newdiff);
00181     void SetHelper(const char *newhelper);
00182     void SetBrowser(const char *newbrowser);
00183     void SetDirtySupport(bool newState);
00184     void SetLogoutTimeOut(int newTimeout);
00185     void SetAlwaysUseCvsroot(bool newState);
00186     void SetUseProxy(bool useit);
00187     void SetProxyHost(const char *newhost);
00188     void SetProxyPort(int newport);
00189     void SetUnixLF(bool useit);
00190     void SetMacLF(bool useit);
00191     void SetZLevel(int level);
00192     void SetCvsVersion(int version);
00193     void SetCvsConsole(bool console);
00194     void SetWordWrapLogMsg(int wordwrap);
00195     void SetLastWorkingDir(const char *workdir);
00196     void SetHideCommandDlgUpdate(bool newState);
00197     void SetHideCommandDlgDiff(bool newState);
00198     void SetHideCommandDlgLog(bool newState);
00199     void SetHideCommandDlgGraph(bool newState);
00200     void SetHideCommandDlgAnnotate(bool newState);
00201     void SetHideCommandDlgUseShift(bool newState);
00202     void SetUseShell(SHELL_KIND shell);
00203
00204 #ifdef WIN32
00205     kWinVersion WhichVersion();
00206 #endif /* WIN32 */
00207
00208     bool UseAltCvs(void) const;
00209     void SetUseAltCvs(bool useit);
00210     const char *WhichCvs(UStr & path, bool userOnly = false) const;
00211     void SetWhichCvs(const char *cvsPath);
00212         // full path of the cvs used
00213
00214     // login/logout flag in order to manage auto-logout
00215     inline bool HasLoogedIn(void) const { return fHasLoggedIn; }
00216     inline void SetHasLoogedIn(bool newstate) { fHasLoggedIn = newstate; }
00217
00218     // Usage counter flags for CVS commands and TCL macro files.
00219     // Each SetCvsRunning(TRUE) must have equivalent
00220     // SetCvsRunning(FALSE) call.
00221     bool IsCvsRunning(void) const;
00222     int  SetCvsRunning(bool launched);
00223     bool IsTclFileRunning(void) const;
00224     int  SetTclFileRunning(bool launched);
00225
00226     // save/load preferences
00227     void save(void);
00228     void load(void);
00229
00230 #ifndef MIGRATECVSROOTLIST
00231     // access the CVSROOT list
00232     inline const CPStr & get_cvsroot_list(int entry) const
00233         {return ((CvsPrefs *)this)->get_cvsroot_list(entry);}
00234 #endif
00235
00236 protected :
00237     bool fHasLoggedIn;
00238
00239     int  fCvsRunningCounter;      // Usage counters to CVS commands
00240     int  fTclFileRunningCounter;  // and Tcl macro file executions
00241
00242 #ifndef MIGRATECVSROOTLIST
00243     CPStr & get_cvsroot_list(int entry);
00244
00245     bool has_cvsroot_in_list(const char *cvsroot, int & entry);
00246     void insert_cvsroot_in_list(const char *cvsroot);
00247     void flush_list(void);
00248 #endif
00249
00250 };
00251
00252 extern CvsPrefs gCvsPrefs;
00253
00254 bool LaunchDiff(const char *file1, const char *file2);
00255     // launch a two diff files
00256
00257 bool LaunchViewer(const char *fullpath,bool useDefault = false);
00258     // launch a viewer for file
00259
00260 bool LaunchEditor(const char* tmpFile, void* par = 0L);
00261     // launch an editor for a file
00262
00263 #endif /* CVSPREFS_H */
Generated on Sun Feb 24 01:21:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/DiffDlg.cpp Source File

common/DiffDlg.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00019  */
00020
00021 /*
00022  * DiffDlg.cpp : the cvs diff dialog
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef WIN32
00028 #   include "wincvs.h"
00029 #   include "OptionalPropertySheet.h"
00030 #endif /* WIN32 */
00031
00032 #if qUnix
00033 #   include "UCvsDialogs.h"
00034 #endif
00035
00036 #ifdef qMacCvsPP
00037 #   include <UModalDialogs.h>
00038 #   include <LRadioButton.h>
00039 #   include <LEditText.h>
00040 #   include <LCheckBox.h>
00041 #   include <LMultiPanelView.h>
00042 #   include <LPopupGroupBox.h>
00043 #   include "LPopupFiller.h"
00044
00045 #   include "MacCvsConstant.h"
00046 #endif /* qMacCvsPP */
00047
00048 #include "DiffDlg.h"
00049 #include "CvsPrefs.h"
00050 #include "UpdateDlg.h"
00051
00052 static CPersistentBool gUseExtDiff("P_DiffUseExtDiff", false);
00053 static CPersistentBool gIgnoreCase("P_IgnoreCase", false);
00054 static CPersistentBool gNoWhiteSpace("P_NoWhiteSpace", false);
00055
00056 #ifdef WIN32
00057 #include "GetPrefs.h"
00058
00059 #ifdef _DEBUG
00060 #define new DEBUG_NEW
00061 #undef THIS_FILE
00062 static char THIS_FILE[] = __FILE__;
00063 #endif
00064
00065 IMPLEMENT_DYNCREATE(CDiff_MAIN, CPropertyPage)
00066
00067 CDiff_MAIN::CDiff_MAIN(const char *rev1, const char *rev2, bool allowExtDiff, bool noWhiteSpace, bool ignoreCase) :
00068     CPropertyPage(CDiff_MAIN::IDD), m_allowExtDiff(allowExtDiff)
00069 {
00070     //{{AFX_DATA_INIT(CDiff_MAIN)
00071     m_isDate1 = FALSE;
00072     m_isDate2 = FALSE;
00073     m_rev1 = rev1;
00074     m_rev2 = rev2;
00075     m_diff = 0;
00076     m_norecurs = FALSE;
00077     m_extdiff = (bool)gUseExtDiff;
00078     m_noWhiteSpace = noWhiteSpace;
00079     m_ignoreCase = ignoreCase;
00080     //}}AFX_DATA_INIT
00081
00082     m_rev1Combo.SetItems(m_isDate1 ? &gDateNames : &gRevNames);
00083     m_rev2Combo.SetItems(m_isDate2 ? &gDateNames : &gRevNames);
00084 }
00085
00086 CDiff_MAIN::CDiff_MAIN() : CPropertyPage(CDiff_MAIN::IDD)
00087 {
00088 }
00089
00090 CDiff_MAIN::~CDiff_MAIN()
00091 {
00092 }
00093
00094 void CDiff_MAIN::DoDataExchange(CDataExchange* pDX)
00095 {
00096     CPropertyPage::DoDataExchange(pDX);
00097     //{{AFX_DATA_MAP(CDiff_MAIN)
00098     DDX_Control(pDX, IDC_EXTDIFF, m_extdiffctl);
00099     DDX_Control(pDX, IDC_COMBO2, m_rev2Combo);
00100     DDX_Control(pDX, IDC_COMBO1, m_rev1Combo);
00101     DDX_Check(pDX, IDC_CHECK1, m_isDate1);
00102     DDX_Check(pDX, IDC_CHECK2, m_isDate2);
00103     DDX_CBString(pDX, IDC_COMBO1, m_rev1);
00104     DDX_CBString(pDX, IDC_COMBO2, m_rev2);
00105     DDX_Radio(pDX, IDC_DIFF1, m_diff);
00106     DDX_Check(pDX, IDC_NORECURS, m_norecurs);
00107     DDX_Check(pDX, IDC_EXTDIFF, m_extdiff);
00108     DDX_Check(pDX, IDC_IGNOREWHITESPACE, m_noWhiteSpace);
00109     DDX_Check(pDX, IDC_IGNORECASE, m_ignoreCase);
00110     //}}AFX_DATA_MAP
00111     if( m_diff == 1 || m_diff == 2 )
00112     {
00113         DDV_MinChars(pDX, m_rev1, 1);
00114     }
00115
00116     if( m_diff == 2 )
00117     {
00118         DDV_MinChars(pDX, m_rev2, 1);
00119     }
00120
00121     if( !pDX->m_bSaveAndValidate )
00122     {
00123         OnDiff1();
00124     }
00125
00126     DDX_ComboMString(pDX, IDC_COMBO1, m_rev1Combo);
00127     DDX_ComboMString(pDX, IDC_COMBO2, m_rev2Combo);
00128
00129     m_extdiffctl.EnableWindow(m_allowExtDiff ? true : false);
00130     OnExtdiff();
00131 }
00132
00133 BEGIN_MESSAGE_MAP(CDiff_MAIN, CPropertyPage)
00134     //{{AFX_MSG_MAP(CDiff_MAIN)
00135     ON_BN_CLICKED(IDC_DIFF1, OnDiff1)
00136     ON_BN_CLICKED(IDC_DIFF2, OnDiff2)
00137     ON_BN_CLICKED(IDC_DIFF3, OnDiff3)
00138     ON_BN_CLICKED(IDC_EXTDIFF, OnExtdiff)
00139     ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
00140     ON_BN_CLICKED(IDC_CHECK2, OnCheck2)
00141     //}}AFX_MSG_MAP
00142 END_MESSAGE_MAP()
00143
00145 // CDiff_MAIN message handlers
00146
00147 void CDiff_MAIN::OnDiff1()
00148 {
00149     CButton* but = (CButton *)GetDlgItem(IDC_DIFF1);
00150     CButton* but1 = (CButton *)GetDlgItem(IDC_DIFF2);
00151     CButton* but2 = (CButton *)GetDlgItem(IDC_DIFF3);
00152     CWnd* wnd1 = GetDlgItem(IDC_COMBO1);
00153     CWnd* wnd2 = GetDlgItem(IDC_COMBO2);
00154     CWnd* wnd3 = GetDlgItem(IDC_CHECK1);
00155     CWnd* wnd4 = GetDlgItem(IDC_CHECK2);
00156     if(but->GetCheck() == 1)
00157     {
00158         wnd1->EnableWindow(FALSE);
00159         wnd2->EnableWindow(FALSE);
00160         wnd3->EnableWindow(FALSE);
00161         wnd4->EnableWindow(FALSE);
00162     }
00163     else if(but1->GetCheck() == 1)
00164     {
00165         wnd1->EnableWindow(TRUE);
00166         wnd2->EnableWindow(FALSE);
00167         wnd3->EnableWindow(TRUE);
00168         wnd4->EnableWindow(FALSE);
00169     }
00170     else
00171     {
00172         wnd1->EnableWindow(TRUE);
00173         wnd2->EnableWindow(TRUE);
00174         wnd3->EnableWindow(TRUE);
00175         wnd4->EnableWindow(TRUE);
00176     }
00177 }
00178
00179 void CDiff_MAIN::OnDiff2()
00180 {
00181     OnDiff1();
00182 }
00183
00184 void CDiff_MAIN::OnDiff3()
00185 {
00186     OnDiff1();
00187 }
00188
00189 void CDiff_MAIN::OnExtdiff()
00190 {
00191     CButton* but = (CButton *)GetDlgItem(IDC_EXTDIFF);
00192     CWnd* wnd1 = GetDlgItem(IDC_IGNOREWHITESPACE);
00193     CWnd* wnd2 = GetDlgItem(IDC_IGNORECASE);
00194     BOOL bEnableDiffOptions = ( !but->GetCheck() || !but->IsWindowEnabled() );
00195     wnd1->EnableWindow(bEnableDiffOptions);
00196     wnd2->EnableWindow(bEnableDiffOptions);
00197 }
00198
00199 void CDiff_MAIN::OnCheck1()
00200 {
00201     CButton* btnIsDate = (CButton*)GetDlgItem(IDC_CHECK1);
00202     BOOL isDate = btnIsDate->GetCheck();
00203
00204     m_rev1Combo.SetItems(isDate ? &gDateNames : &gRevNames);
00205     DDX_ComboMString(NULL, IDC_COMBO1, m_rev1Combo);
00206 }
00207
00208 void CDiff_MAIN::OnCheck2()
00209 {
00210     CButton* btnIsDate = (CButton*)GetDlgItem(IDC_CHECK2);
00211     BOOL isDate = btnIsDate->GetCheck();
00212
00213     m_rev2Combo.SetItems(isDate ? &gDateNames : &gRevNames);
00214     DDX_ComboMString(NULL, IDC_COMBO2, m_rev2Combo);
00215 }
00216
00217 #endif /* WIN32 */
00218
00219 #ifdef qMacCvsPP
00220 static void DoDataExchange_DiffMain(LWindow *theDialog, bool & noRecurs, bool & isDate1, bool & isDate2,
00221     CPStr & sLastRev1, CPStr & sLastRev2, bool & hasRev1, bool & hasRev2, bool putValue)
00222 {
00223     LRadioButton *chkHasRev = dynamic_cast<LRadioButton*>
00224         (theDialog->FindPaneByID(item_CheckRevTag1));
00225     LEditText *editRev = dynamic_cast<LEditText*>
00226         (theDialog->FindPaneByID(item_EditRevTag1));
00227     LRadioButton *chkHasRev2 = dynamic_cast<LRadioButton*>
00228         (theDialog->FindPaneByID(item_CheckRevTag2));
00229     LEditText *editRev2 = dynamic_cast<LEditText*>
00230         (theDialog->FindPaneByID(item_EditRevTag2));
00231     LCheckBox *chkHasDate1 = dynamic_cast<LCheckBox*>
00232         (theDialog->FindPaneByID(item_CheckDate1));
00233     LCheckBox *chkHasDate2 = dynamic_cast<LCheckBox*>
00234         (theDialog->FindPaneByID(item_CheckDate2));
00235     LPopupFiller *fill1 = dynamic_cast<LPopupFiller*>
00236         (theDialog->FindPaneByID(item_FillerRev1));
00237     LPopupFiller *fill2 = dynamic_cast<LPopupFiller*>
00238         (theDialog->FindPaneByID(item_FillerRev2));
00239     LPane *extDiff = theDialog->FindPaneByID(item_DiffExternal);
00240
00241     if(putValue)
00242     {
00243         chkHasDate1->SetValue(isDate1 ? Button_On : Button_Off);
00244         chkHasDate2->SetValue(isDate2 ? Button_On : Button_Off);
00245         if(hasRev1 && hasRev2)
00246             theDialog->SetValueForPaneID (item_CheckRevTag2, Button_On);
00247         else if(hasRev1)
00248             theDialog->SetValueForPaneID (item_CheckRevTag1, Button_On);
00249         else
00250             theDialog->SetValueForPaneID (item_MergeNone, Button_On);
00251
00252         editRev->SetText((Ptr)(const char *)sLastRev1, sLastRev1.length());
00253         editRev2->SetText((Ptr)(const char *)sLastRev2, sLastRev2.length());
00254
00255         fill1->DoDataExchange(gRevNames, putValue);
00256         fill2->DoDataExchange(gRevNames, putValue);
00257
00258         extDiff->SetValue ((bool)gUseExtDiff ? Button_On : Button_Off);
00259     }
00260     else
00261     {
00262         isDate1 = chkHasDate1->GetValue() == Button_On;
00263         isDate2 = chkHasDate2->GetValue() == Button_On;
00264
00265         if(theDialog->GetValueForPaneID (item_CheckRevTag2) == Button_On)
00266         {
00267             hasRev1 = hasRev2 = true;
00268         }
00269         else if (theDialog->GetValueForPaneID (item_CheckRevTag1) == Button_On)
00270         {
00271             hasRev1 = true;
00272             hasRev2 = false;
00273         }
00274         else
00275         {
00276             hasRev1 = hasRev2 = false;
00277         }
00278
00279         fill1->DoDataExchange(isDate1 ? gDateNames : gRevNames, putValue);
00280         fill2->DoDataExchange(isDate2 ? gDateNames : gRevNames, putValue);
00281
00282         char str[255];
00283         Size len;
00284
00285         editRev->GetText(str, 254, &len);
00286         sLastRev1.set(str, len);
00287         editRev2->GetText(str, 254, &len);
00288         sLastRev2.set(str, len);
00289
00290         gUseExtDiff = extDiff->GetValue () == Button_On;
00291     }
00292 }
00293 #endif /* qMacCvsPP */
00294
00295 #if qUnix
00296 class UCvsDiff : public UWidget
00297 {
00298     UDECLARE_DYNAMIC(UCvsDiff)
00299 public:
00300     UCvsDiff() : UWidget(::UEventGetWidID()) {}
00301     virtual ~UCvsDiff() {}
00302
00303     enum
00304     {
00305         kOK = EV_COMMAND_START, // 0
00306         kCancel,                // 1
00307         kTabGeneral             // 2
00308     };
00309
00310     virtual void DoDataExchange(bool fill);
00311
00312 protected:
00313     ev_msg int OnOK(void);
00314     ev_msg int OnCancel(void);
00315
00316     UDECLARE_MESSAGE_MAP()
00317 };
00318
00319 UIMPLEMENT_DYNAMIC(UCvsDiff, UWidget)
00320
00321 UBEGIN_MESSAGE_MAP(UCvsDiff, UWidget)
00322     ON_UCOMMAND(UCvsDiff::kOK, UCvsDiff::OnOK)
00323     ON_UCOMMAND(UCvsDiff::kCancel, UCvsDiff::OnCancel)
00324 UEND_MESSAGE_MAP()
00325
00326 int UCvsDiff::OnOK(void)
00327 {
00328     EndModal(true);
00329     return 0;
00330 }
00331
00332 int UCvsDiff::OnCancel(void)
00333 {
00334     EndModal(false);
00335     return 0;
00336 }
00337
00338 void UCvsDiff::DoDataExchange(bool fill)
00339 {
00340
00341     if(fill)
00342     {
00343     }
00344     else
00345     {
00346     }
00347 }
00348
00349 class UCvsDiff_MAIN : public UWidget
00350 {
00351     UDECLARE_DYNAMIC(UCvsDiff_MAIN)
00352 public:
00353     UCvsDiff_MAIN(const char *rev1, const char *rev2, bool allowExtDiff);
00354     virtual ~UCvsDiff_MAIN() {}
00355
00356     enum
00357     {
00358         kCheckDiff1 = EV_COMMAND_START, // 0
00359         kCheckDiff2,            // 1
00360         kCheckDiff3,            // 2
00361         kCheckDate1,            // 3
00362         kCheckDate2,            // 4
00363         kComboRev1,             // 5
00364         kComboRev2,             // 6
00365         kCheckRecurs,           // 7
00366         kCheckExtDiff,          // 8
00367         kCheckNoWhiteSpace,     // 9
00368         kCheckIgnoreCase        // 10
00369     };
00370
00371     virtual void DoDataExchange(bool fill);
00372
00373     bool m_check1;
00374     bool m_check2;
00375     UStr m_str1;
00376     UStr m_str2;
00377     int m_diff;
00378     bool m_norecurs;
00379     bool m_extdiff;
00380     bool m_allowExtDiff;
00381     bool m_noWhiteSpace;
00382     bool m_ignoreCase;
00383
00384 protected:
00385     ev_msg int OnDiff(int cmd);
00386
00387     UDECLARE_MESSAGE_MAP()
00388 };
00389
00390 UIMPLEMENT_DYNAMIC(UCvsDiff_MAIN, UWidget)
00391
00392 UBEGIN_MESSAGE_MAP(UCvsDiff_MAIN, UWidget)
00393     ON_UCOMMAND_RANGE(UCvsDiff_MAIN::kCheckDiff1, UCvsDiff_MAIN::kCheckDiff2, UCvsDiff_MAIN::OnDiff)
00394 UEND_MESSAGE_MAP()
00395
00396 UCvsDiff_MAIN::UCvsDiff_MAIN(const char *rev1, const char *rev2, bool allowExtDiff) : UWidget(::UEventGetWidID())
00397 {
00398     m_check1 = false;
00399     m_check2 = false;
00400     m_str1 = rev1;
00401     m_str2 = rev2;
00402     m_diff = 0;
00403     m_noWhiteSpace = gNoWhiteSpace;
00404     m_ignoreCase = gIgnoreCase;
00405     m_norecurs = false;
00406     m_extdiff = gUseExtDiff;
00407     m_allowExtDiff = allowExtDiff;
00408
00409 }
00410
00411 int UCvsDiff_MAIN::OnDiff(int cmd)
00412 {
00413     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDiff1, 0L);
00414     if(state)
00415     {
00416         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kCheckDate1, 0), 0L);
00417         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev1, 0), 0L);
00418         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kCheckDate2, 0), 0L);
00419         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev2, 0), 0L);
00420     }
00421     else
00422     {
00423         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kCheckDate1, 1), 0L);
00424         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev1, 1), 0L);
00425         state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDiff2, 0L);
00426         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kCheckDate2, state == 0), 0L);
00427         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev2, state == 0), 0L);
00428     }
00429     return 0;
00430 }
00431
00432 void UCvsDiff_MAIN::DoDataExchange(bool fill)
00433 {
00434     ::DoDataExchange(fill, GetWidID(), kComboRev1, gDateOrRevNames);
00435     ::DoDataExchange(fill, GetWidID(), kComboRev2, gDateOrRevNames);
00436
00437     if(fill)
00438     {
00439         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kCheckExtDiff, m_allowExtDiff), 0L);
00440
00441         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckDate1, m_check1), 0L);
00442         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckDate2, m_check2), 0L);
00443         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurs, m_norecurs), 0L);
00444         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckExtDiff, m_extdiff), 0L);
00445         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckDiff1 + m_diff, 1), 0L);
00446         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckNoWhiteSpace, m_noWhiteSpace), 0L);
00447         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckIgnoreCase, m_ignoreCase), 0L);
00448
00449         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboRev1, (void *)(const char *)m_str1);
00450         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboRev2, (void *)(const char *)m_str2);
00451
00452         OnDiff(kCheckDiff1 + m_diff);
00453     }
00454     else
00455     {
00456         m_check1 = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDate1, 0L);
00457         m_check2 = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDate2, 0L);
00458         m_norecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurs, 0L);
00459         m_extdiff = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckExtDiff, 0L);
00460         m_noWhiteSpace = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckNoWhiteSpace, 0L);
00461         m_ignoreCase = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckIgnoreCase, 0L);
00462
00463         if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDiff1, 0L))
00464             m_diff = 0;
00465         else if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDiff2, 0L))
00466             m_diff = 1;
00467         else
00468             m_diff = 2;
00469
00470         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboRev1, &m_str1);
00471         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboRev2, &m_str2);
00472     }
00473 }
00474 #endif // qUnix
00475
00476 bool CompatGetDiff(bool & noRecurs, bool & isDate1, bool & isDate2,
00477                    CPStr & rev1, CPStr & rev2, bool & useExtDiff,
00478                    bool & noWhiteSpace, bool & ignoreCase,
00479                    bool allowExtDiff)
00480 {
00481     bool userHitOK = false;
00482
00483     static CPStr sLastRev1;
00484     static CPStr sLastRev2;
00485     static bool bNoWhiteSpace = false;
00486     static bool bIgnoreCase = false;
00487
00488     rev1 = "";
00489     rev2 = "";
00490     noRecurs = false;
00491     isDate1 = false;
00492     isDate2 = false;
00493     useExtDiff = (bool)gUseExtDiff;
00494     noWhiteSpace = bNoWhiteSpace;
00495     ignoreCase = bIgnoreCase;
00496     bool hasRev1 = false;
00497     bool hasRev2 = false;
00498
00499 #ifdef WIN32
00500     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgDiff(), "Diff settings");
00501     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00502     CDiff_MAIN page1(sLastRev1, sLastRev2, allowExtDiff, noWhiteSpace, ignoreCase);
00503     CGetPrefs_GLOBALS page2;
00504     pages.AddPage(&page1);
00505     pages.AddPage(&page2);
00506     if(pages.DoModal() == IDOK)
00507     {
00508         noRecurs = page1.m_norecurs == TRUE;
00509
00510         sLastRev1 = page1.m_rev1;
00511         sLastRev2 = page1.m_rev2;
00512         isDate1 = page1.m_isDate1 == TRUE;
00513         isDate2 = page1.m_isDate2 == TRUE;
00514         gUseExtDiff = page1.m_extdiff == TRUE;
00515
00516         if(page1.m_diff == 0)
00517         {
00518             hasRev1 = hasRev2 = false;
00519         }
00520         else if(page1.m_diff == 1)
00521         {
00522             hasRev1 = true;
00523             hasRev2 = false;
00524         }
00525         else
00526         {
00527             hasRev1 = true;
00528             hasRev2 = true;
00529         }
00530
00531         noWhiteSpace = page1.m_noWhiteSpace == TRUE;
00532         ignoreCase = page1.m_ignoreCase == TRUE;
00533
00534         page2.StoreValues();
00535         gCvsPrefs.SetHideCommandDlgDiff(pages.GetHideCommandDlg());
00536         userHitOK = true;
00537     }
00538 #endif /* WIN32 */
00539 #ifdef qMacCvsPP
00540     StDialogHandler theHandler(dlg_Diff, LCommander::GetTopCommander());
00541     LWindow *theDialog = theHandler.GetDialog();
00542     ThrowIfNil_(theDialog);
00543     static UInt16 sRuntimePanel = 1;
00544
00545     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00546         (theDialog->FindPaneByID(item_MultiViewPrefs));
00547     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00548
00549     multiView->SwitchToPanel(2);
00550     DoDataExchange_Globals(theDialog, true);
00551     multiView->SwitchToPanel(1);
00552     DoDataExchange_DiffMain(theDialog, noRecurs, isDate1, isDate2, sLastRev1, sLastRev2,
00553         hasRev1, hasRev2, true);
00554
00555     groupView->SetValue(sRuntimePanel);
00556     theDialog->Show();
00557     MessageT hitMessage;
00558     while (true)
00559     {       // Let DialogHandler process events
00560         hitMessage = theHandler.DoDialog();
00561
00562         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00563             break;
00564     }
00565     theDialog->Hide();
00566     sRuntimePanel = groupView->GetValue();
00567
00568     if(hitMessage == msg_OK)
00569     {
00570         multiView->SwitchToPanel(1);
00571         DoDataExchange_DiffMain(theDialog, noRecurs, isDate1, isDate2, sLastRev1, sLastRev2,
00572             hasRev1, hasRev2, false);
00573         multiView->SwitchToPanel(2);
00574         DoDataExchange_Globals(theDialog, false);
00575         userHitOK = true;
00576     }
00577 #endif /* qMacCvsPP */
00578 #if qUnix
00579     void *wid = UCreate_DiffDlg();
00580
00581     UCvsDiff *dlg = new UCvsDiff();
00582     UCvsDiff_MAIN *tab1 = new UCvsDiff_MAIN(sLastRev1, sLastRev2, allowExtDiff);
00583     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00584     dlg->AddPage(tab1, UCvsDiff::kTabGeneral, 0);
00585
00586     if(dlg->DoModal())
00587     {
00588         noRecurs = tab1->m_norecurs;
00589
00590
00591         noWhiteSpace = tab1->m_noWhiteSpace != 0;
00592         ignoreCase = tab1->m_ignoreCase != 0;
00593
00594         sLastRev1 = tab1->m_str1;
00595         sLastRev2 = tab1->m_str2;
00596         isDate1 = tab1->m_check1;
00597         isDate2 = tab1->m_check2;
00598         gUseExtDiff = tab1->m_extdiff;
00599         if(tab1->m_diff == 0)
00600         {
00601             hasRev1 = hasRev2 = false;
00602         }
00603         else if(tab1->m_diff == 1)
00604         {
00605             hasRev1 = true;
00606             hasRev2 = false;
00607         }
00608         else
00609         {
00610             hasRev1 = true;
00611             hasRev2 = true;
00612         }
00613
00614         userHitOK = true;
00615     }
00616
00617     delete dlg;
00618 #endif // qUnix
00619
00620     if(userHitOK)
00621     {
00622         if(hasRev1)
00623             rev1 = sLastRev1;
00624         if(hasRev2)
00625             rev2 = sLastRev2;
00626         useExtDiff = (bool)gUseExtDiff;
00627
00628         bNoWhiteSpace = noWhiteSpace;
00629         bIgnoreCase = ignoreCase;
00630
00631         gCvsPrefs.save();
00632     }
00633
00634     return userHitOK;
00635 }
Generated on Sun Feb 24 01:21:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/DiffDlg.h Source File

common/DiffDlg.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00019  */
00020
00021 /*
00022  * DiffDlg.h : the cvs diff dialog
00023  */
00024
00025 #if !defined(AFX_DIFFDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
00026 #define AFX_DIFFDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif // _MSC_VER >= 1000
00031
00032 #include "CPStr.h"
00033 #include "SmartComboBox.h"
00034
00035 bool CompatGetDiff(bool & noRecurs, bool & isDate1, bool & isDate2,
00036                    CPStr & rev1, CPStr & rev2, bool & useExtDiff,
00037                    bool & noWhiteSpace, bool & ignoreCase,
00038                    bool allowExtDiff = false);
00039     // get the diff options...
00040
00041 #ifdef WIN32
00042
00043 class CDiff_MAIN : public CPropertyPage
00044 {
00045     DECLARE_DYNCREATE(CDiff_MAIN)
00046
00047 // Construction
00048 public:
00049     CDiff_MAIN(const char *rev1, const char *rev2, bool allowExtDiff, bool noWhiteSpace, bool ignoreCare);
00050     CDiff_MAIN();
00051     ~CDiff_MAIN();
00052
00053 // Dialog Data
00054     //{{AFX_DATA(CDiff_MAIN)
00055     enum { IDD = IDD_DIFF_MAIN };
00056     CButton m_extdiffctl;
00057     CSmartComboBox  m_rev2Combo;
00058     CSmartComboBox  m_rev1Combo;
00059     BOOL    m_isDate1;
00060     BOOL    m_isDate2;
00061     CString m_rev1;
00062     CString m_rev2;
00063     int     m_diff;
00064     BOOL    m_norecurs;
00065     BOOL    m_extdiff;
00066     BOOL    m_noWhiteSpace;
00067     BOOL    m_ignoreCase;
00068     //}}AFX_DATA
00069
00070     bool m_allowExtDiff;
00071
00072 // Overrides
00073     // ClassWizard generate virtual function overrides
00074     //{{AFX_VIRTUAL(CDiff_MAIN)
00075     protected:
00076     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00077     //}}AFX_VIRTUAL
00078
00079 // Implementation
00080 protected:
00081     // Generated message map functions
00082     //{{AFX_MSG(CDiff_MAIN)
00083     afx_msg void OnDiff1();
00084     afx_msg void OnDiff2();
00085     afx_msg void OnDiff3();
00086     afx_msg void OnExtdiff();
00087     afx_msg void OnCheck1();
00088     afx_msg void OnCheck2();
00089     //}}AFX_MSG
00090     DECLARE_MESSAGE_MAP()
00091
00092 };
00093
00094 //{{AFX_INSERT_LOCATION}}
00095 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00096 #endif /* WIN32 */
00097
00098 #endif // !defined(AFX_DIFFDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/dll_garbage.c Source File

common/dll_garbage.c

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * dll_garbage.c --- memory garbage collection for the dll
00023  */
00024
00025 #ifdef HAVE_CONFIG_H
00026 #include "config.h"
00027 #endif /* HAVE_CONFIG_H */
00028
00029 #include <stdio.h>
00030
00031 #ifdef HAVE_STRING_H
00032 #   include <string.h>
00033 #endif /* HAVE_STRING_H */
00034
00035 #include "dll_garbage.h"
00036
00037 #undef malloc
00038 #undef free
00039 #undef calloc
00040 #undef realloc
00041
00042 #if qMFC || qCvsDebug
00043     /* to intercept static C++ allocations */
00044 #   define AUTO_INITALIZE 1
00045 #else /* !macintosh */
00046 #   define AUTO_INITALIZE 0
00047 #endif /* !macintosh */
00048
00049 #if qCvsDebug && defined(macintosh)
00050 #   define qRangeCheck 0
00051 #else /* !qCvsDebug */
00052 #   define qRangeCheck 0
00053 #endif /* !qCvsDebug */
00054
00055 #if qRangeCheck && defined(macintosh)
00056 #include <MacMemory.h>
00057 static void *   platform_calloc(size_t nmemb, size_t size)
00058 {
00059     size_t tot = nmemb * size;
00060     void *res = NewPtr(tot);
00061     if(res != 0L)
00062         memset(res, 0, tot);
00063     return res;
00064 }
00065
00066 static void *   platform_malloc(size_t size)
00067 {
00068     return NewPtr(size);
00069 }
00070
00071 static void *   platform_realloc(void * ptr, size_t size)
00072 {
00073     void *newptr = NewPtr(size);
00074     if(newptr != 0L && ptr != 0L)
00075     {
00076         Size oldS = GetPtrSize((Ptr)ptr);
00077         if(oldS != 0)
00078         {
00079             size_t copySize = size < oldS ? size : oldS;
00080             memcpy(newptr, ptr, copySize);
00081         }
00082         DisposePtr((Ptr)ptr);
00083     }
00084     return newptr;
00085 }
00086
00087 static void platform_free(void *ptr)
00088 {
00089     if(ptr != 0L)
00090         DisposePtr((Ptr)ptr);
00091 }
00092 #else
00093 #   define platform_calloc(s1, s2) calloc(s1, s2)
00094 #   define platform_malloc(s) malloc(s)
00095 #   define platform_realloc(p, s) realloc(p, s)
00096 #   define platform_free(p) free(p)
00097 #endif
00098
00099 #if qRangeCheck
00100 #   include <assert.h>
00101 #   ifdef macintosh
00102 #       define ASSERT_RANGE(cond) do {if(!(cond)) DebugStr("\pRange check failed !");} while(0)
00103 #   else /* !macintosh */
00104 #       define ASSERT_RANGE(cond) assert(cond)
00105 #   endif /* !macintosh */
00106     static void garbyRangeCheck(void);
00107
00108 #   define RANGE_MAGIC_SIZE (3 * sizeof(size_t))
00109 #   define RANGE_TO_PTR(ptr) ((void *)(((size_t *)(ptr))+2))
00110 #   define PTR_TO_RANGE(ptr) ((void *)(((size_t *)(ptr))-2))
00111 #   define SIZE_FROM_PTR(ptr) (((size_t *)(ptr))[-2])
00112 #   define MAGIC1_FROM_PTR(ptr) ((void *)&(((size_t *)(ptr))[-1]))
00113 #   define MAGIC2_FROM_PTR(ptr) ((void *)&(((char *)(ptr))[SIZE_FROM_PTR(ptr)]))
00114 #   define RANGE_MAGIC ((char)0xFC)
00115     static void FILL_MAGIC(void *ptr)
00116     {
00117         char *tmp = (char *)ptr;
00118         *tmp++ = RANGE_MAGIC;
00119         *tmp++ = RANGE_MAGIC;
00120         *tmp++ = RANGE_MAGIC;
00121         *tmp = RANGE_MAGIC;
00122     }
00123
00124     static void CHECK_MAGIC(void *ptr)
00125     {
00126         char *tmp = (char *)ptr;
00127         ASSERT_RANGE(*tmp++ == RANGE_MAGIC);
00128         ASSERT_RANGE(*tmp++ == RANGE_MAGIC);
00129         ASSERT_RANGE(*tmp++ == RANGE_MAGIC);
00130         ASSERT_RANGE(*tmp == RANGE_MAGIC);
00131     }
00132
00133     static void *malloc_check(size_t size)
00134     {
00135         void *result, *range;
00136
00137         garbyRangeCheck();
00138
00139         if(size == 0)
00140             return 0L;
00141
00142         range = platform_malloc(size + RANGE_MAGIC_SIZE);
00143         if(range == 0L)
00144             return 0L;
00145
00146         result = RANGE_TO_PTR(range);
00147         SIZE_FROM_PTR(result) = size;
00148         FILL_MAGIC(MAGIC1_FROM_PTR(result));
00149         FILL_MAGIC(MAGIC2_FROM_PTR(result));
00150
00151         return result;
00152     }
00153
00154     static void *calloc_check(size_t nmemb, size_t size)
00155     {
00156         void *result;
00157         size_t totsize = nmemb * size;
00158
00159         garbyRangeCheck();
00160
00161         if(totsize == 0)
00162             return 0L;
00163
00164         result = malloc_check(totsize);
00165         if(result == 0L)
00166             return 0L;
00167
00168         memset(result, 0, totsize);
00169         return result;
00170     }
00171
00172     static void free_check(void *ptr)
00173     {
00174         void *range;
00175
00176         garbyRangeCheck();
00177
00178         if(ptr == 0L)
00179             return;
00180
00181         ASSERT_RANGE(SIZE_FROM_PTR(ptr) > 0);
00182         CHECK_MAGIC(MAGIC1_FROM_PTR(ptr));
00183         CHECK_MAGIC(MAGIC2_FROM_PTR(ptr));
00184
00185         range = PTR_TO_RANGE(ptr);
00186         memset(range, 0xFC, SIZE_FROM_PTR(ptr) + RANGE_MAGIC_SIZE);
00187         platform_free(range);
00188     }
00189
00190     static void *realloc_check(void *ptr, size_t size)
00191     {
00192         void *result, *range;
00193
00194         garbyRangeCheck();
00195
00196         if(ptr == 0L)
00197             return malloc_check(size);
00198         if(size == 0)
00199         {
00200             free_check(ptr);
00201             return 0L;
00202         }
00203
00204         ASSERT_RANGE(SIZE_FROM_PTR(ptr) > 0);
00205         CHECK_MAGIC(MAGIC1_FROM_PTR(ptr));
00206         CHECK_MAGIC(MAGIC2_FROM_PTR(ptr));
00207
00208         range = PTR_TO_RANGE(ptr);
00209         range = platform_realloc(range, size + RANGE_MAGIC_SIZE);
00210         if(range == 0L)
00211             return 0L;
00212
00213         result = RANGE_TO_PTR(range);
00214         SIZE_FROM_PTR(result) = size;
00215         FILL_MAGIC(MAGIC1_FROM_PTR(result));
00216         FILL_MAGIC(MAGIC2_FROM_PTR(result));
00217
00218         return result;
00219     }
00220 #   define platform_malloc malloc_check
00221 #   define platform_free free_check
00222 #   define platform_calloc calloc_check
00223 #   define platform_realloc realloc_check
00224 #endif /* qRangeCheck */
00225
00226 #if qRangeCheck && defined(macintosh)
00227 #ifdef __cplusplus
00228 extern "C"
00229 #endif
00230 void *  calloc(size_t nmemb, size_t   s)
00231 {
00232     return shl_calloc(nmemb, s, 0, 0L);
00233 }
00234
00235 #ifdef __cplusplus
00236 extern "C"
00237 #endif
00238 void    free(void *  p)
00239 {
00240     shl_free(p);
00241 }
00242
00243 #ifdef __cplusplus
00244 extern "C"
00245 #endif
00246 void *  malloc(size_t   s)
00247 {
00248     return shl_malloc(s, 0, 0L);
00249 }
00250
00251 #ifdef __cplusplus
00252 extern "C"
00253 #endif
00254 void *  realloc(void *   p, size_t   s)
00255 {
00256     return shl_realloc(p, s, 0, 0L);
00257 }
00258
00259 #endif
00260
00261 #define GARBY_DEF_ALLOC 20
00262 #define GARBY_DEF_POOL 20
00263 #define MODULE_SIZE 8
00264
00265 typedef struct _frameRec
00266 {
00267     void *entry;
00268 #if qCvsDebug
00269     char module[MODULE_SIZE];
00270     short line;
00271 #endif
00272     struct _frameRec *next;
00273 } frameRec;
00274
00275 typedef struct DYN_LIST
00276 {
00277     int numentries;
00278     int defaultnumcells;
00279     int sizeofcell;
00280     int totpage;
00281
00282     void *first;
00283     struct DYN_LIST *next;
00284     struct DYN_LIST *current;
00285 #ifdef hpux /* align 8 bytes for hpux */
00286     void *nothing;
00287 #endif /* hpux */
00288 } DYN_LIST;
00289
00290 typedef struct
00291 {
00292     frameRec *firstentry;
00293     frameRec *firstfree;
00294     DYN_LIST *pool;
00295 } poolRec, *poolPtr;
00296
00297 typedef struct
00298 {
00299     poolRec pools[GARBY_DEF_POOL];
00300 } garbyRec, *garbyPtr;
00301
00302 static garbyPtr gGarbage = NULL;
00303
00304 static DYN_LIST *
00305 listNew(int sizeOfCell, int numOfDefaultCell)
00306 {
00307     DYN_LIST *result;
00308
00309     result = (DYN_LIST *)platform_malloc(sizeof(DYN_LIST) + sizeOfCell * numOfDefaultCell);
00310     if(result == NULL)
00311     {
00312         fprintf(stderr, "failed to allocate %d bytes\n", sizeof(DYN_LIST) + sizeOfCell * numOfDefaultCell);
00313         exit(-1);
00314     }
00315
00316     result->numentries = result->totpage = 0;
00317     result->defaultnumcells = numOfDefaultCell;
00318     result->sizeofcell = sizeOfCell;
00319     result->next = NULL;
00320     result->current = result;
00321
00322     return result;
00323 }
00324
00325 static void
00326 listFree(DYN_LIST *list)
00327 {
00328     DYN_LIST *ptc1, *ptc2;
00329
00330     ptc1 = list;
00331     while(ptc1 != NULL)
00332     {
00333         ptc2 = ptc1;
00334         ptc1 = ptc1->next;
00335         platform_free(ptc2);
00336     }
00337 }
00338
00339 static void *
00340 listAddCell(DYN_LIST *list)
00341 {
00342     DYN_LIST *current;
00343
00344     current = list->current;
00345
00346     if(current->numentries == list->defaultnumcells)
00347     {
00348         current->next = (DYN_LIST *)platform_malloc(sizeof(DYN_LIST) + list->sizeofcell * list->defaultnumcells);
00349         if(current->next == NULL)
00350         {
00351             fprintf(stderr, "failed to allocate %d bytes\n", sizeof(DYN_LIST) + list->sizeofcell * list->defaultnumcells);
00352             exit(-1);
00353         }
00354
00355         current = current->next;
00356         current->numentries = 0;
00357         current->next = NULL;
00358         list->current = current;
00359         list->totpage++;
00360     }
00361
00362     return (char *)(current + 1) + current->numentries++ * list->sizeofcell;
00363 }
00364
00365 static int
00366 GARBY_KEY(void *address)
00367 {
00368     register unsigned long add = (unsigned long)address;
00369
00370     return (add >> 8) % GARBY_DEF_POOL;
00371 }
00372
00373 void
00374 garbyNew(void)
00375 {
00376     int i;
00377
00378 #if AUTO_INITALIZE
00379     if(gGarbage != 0L)
00380         return;
00381 #endif /* AUTO_INITALIZE */
00382
00383     gGarbage = (garbyPtr) platform_malloc(sizeof(garbyRec));
00384     if(gGarbage == NULL)
00385     {
00386         fprintf(stderr, "failed to allocate %d bytes\n", sizeof(garbyRec));
00387         exit(-1);
00388     }
00389
00390 #if qRangeCheck
00391     for(i = 0; i < GARBY_DEF_POOL; i++)
00392     {
00393         gGarbage->pools[i].firstentry = NULL;
00394         gGarbage->pools[i].firstfree = NULL;
00395         gGarbage->pools[i].pool = 0L;
00396     }
00397 #endif /* qRangeCheck */
00398     for(i = 0; i < GARBY_DEF_POOL; i++)
00399     {
00400         gGarbage->pools[i].firstentry = NULL;
00401         gGarbage->pools[i].firstfree = NULL;
00402         gGarbage->pools[i].pool = listNew(sizeof(frameRec), GARBY_DEF_ALLOC);
00403     }
00404 }
00405
00406 static void
00407 poolRemove(poolPtr collector, int reallyRemove, int verboseMemoryLeak, int *numLeaks)
00408 {
00409     frameRec *frame = collector->firstentry;
00410
00411 #if qRangeCheck
00412     DYN_LIST *pool;
00413     if(reallyRemove)
00414     {
00415         collector->firstentry = 0L;
00416         collector->firstfree = 0L;
00417     }
00418 #endif /* qRangeCheck */
00419
00420     while(frame != NULL)
00421     {
00422 #if qCvsDebug
00423         if(verboseMemoryLeak)
00424             fprintf(stderr, "MEMORY LEAK!: %s line:%d\n", frame->module, frame->line);
00425 #endif
00426         if(reallyRemove)
00427             platform_free(frame->entry);
00428         frame = frame->next;
00429         (*numLeaks)++;
00430     }
00431     if(reallyRemove)
00432     {
00433 #if qRangeCheck
00434         pool = collector->pool;
00435         collector->pool = 0L;
00436         listFree(pool);
00437 #else /* !qRangeCheck */
00438         listFree(collector->pool);
00439 #endif /* !qRangeCheck */
00440     }
00441 }
00442
00443 void
00444 garbyRemove(int verboseSummary, int verboseMemoryLeak)
00445 {
00446     int i;
00447     int numLeaks = 0;
00448     int reallyRemove = !verboseSummary;
00449
00450     if(gGarbage == NULL)
00451         return;
00452
00453     for(i = 0; i < GARBY_DEF_POOL; i++)
00454         poolRemove(&gGarbage->pools[i], reallyRemove, verboseMemoryLeak, &numLeaks);
00455
00456     if(reallyRemove)
00457     {
00458         platform_free(gGarbage);
00459         gGarbage = NULL;
00460     }
00461
00462 #if qCvsDebug
00463     if(verboseSummary)
00464         fprintf(stderr, "\nGarbage collection : purged %d allocations\n", numLeaks);
00465 #endif
00466 }
00467
00468 #if qRangeCheck
00469 static void
00470 garbyRangeCheck(void)
00471 {
00472     poolPtr collector;
00473     frameRec *frame;
00474     DYN_LIST *pool;
00475     int i;
00476
00477     if(gGarbage == 0L)
00478         return;
00479
00480     for(i = 0; i < GARBY_DEF_POOL; i++)
00481     {
00482         collector = &gGarbage->pools[i];
00483         pool = collector->pool;
00484         while(pool != 0L)
00485         {
00486             ASSERT_RANGE(SIZE_FROM_PTR(pool) > 0);
00487             CHECK_MAGIC(MAGIC1_FROM_PTR(pool));
00488             CHECK_MAGIC(MAGIC2_FROM_PTR(pool));
00489             pool = pool->next;
00490         }
00491
00492         frame = collector->firstentry;
00493
00494         while(frame != NULL)
00495         {
00496             ASSERT_RANGE(SIZE_FROM_PTR(frame->entry) > 0);
00497             CHECK_MAGIC(MAGIC1_FROM_PTR(frame->entry));
00498             CHECK_MAGIC(MAGIC2_FROM_PTR(frame->entry));
00499             frame = frame->next;
00500         }
00501     }
00502 }
00503 #endif /* qRangeCheck */
00504
00505 static void
00506 setModule(char *where, const char *what)
00507 {
00508     int len, cp;
00509
00510     if(what == 0L)
00511     {
00512         strcpy(where, "Unknown");
00513         return;
00514     }
00515
00516     cp = len = strlen(what);
00517     if(len > (MODULE_SIZE - 1))
00518         cp = MODULE_SIZE - 1;
00519
00520     memcpy(where, what + len - cp, cp * sizeof(char));
00521     where[cp] = '\0';
00522 }
00523
00524 #if qCvsDebug
00525 static void * poolAlloc(poolPtr pool, void *ptr, int line, const char *file)
00526 #else
00527 static void * poolAlloc(poolPtr pool, void *ptr)
00528 #endif
00529 {
00530     frameRec *newframe;
00531
00532     if(pool->firstfree != NULL)
00533     {
00534         /*
00535          * there is place already free inside collector
00536          */
00537         newframe = pool->firstfree;
00538         pool->firstfree = newframe->next;
00539     }
00540     else
00541     {
00542         /*
00543          * create a new entry into the pool
00544          */
00545         newframe = (frameRec *)listAddCell(pool->pool);
00546     }
00547
00548     newframe->entry = ptr;
00549     newframe->next = pool->firstentry;
00550     pool->firstentry = newframe;
00551
00552 #if qCvsDebug
00553     setModule(newframe->module, file);
00554     newframe->line = line;
00555 #endif
00556
00557     return ptr;
00558 }
00559
00560 static void * poolFree(register poolPtr garb, void *ptr)
00561 {
00562     frameRec *frame, *prev;
00563
00564     /*
00565      * if failed, collector is corrupted
00566      */
00567     frame = garb->firstentry;
00568     if(frame == NULL)
00569     {
00570 #ifdef macintosh
00571         /* only  on mac cause we are sure to intercept every allocations */
00572         fprintf(stderr, "panic ! memory collector is corrupted !\n");
00573         return NULL;
00574 #else /* !macintosh */
00575         return ptr;
00576 #endif /* !macintosh */
00577     }
00578
00579     /*
00580      * - we mark the entry to be free
00581      */
00582     if(frame->entry == ptr)
00583     {
00584         frame = garb->firstentry;
00585         garb->firstentry = frame->next;
00586     }
00587     else
00588     {
00589         prev = NULL;
00590         while(frame->entry != ptr)
00591         {
00592             prev = frame;
00593             frame = frame->next;
00594             /*
00595              * if failed, collector is corrupted
00596              */
00597             if(frame == NULL)
00598             {
00599 #ifdef macintosh
00600                 /* only  on mac cause we are sure to intercept every allocations */
00601                 fprintf(stderr, "panic ! memory collector is corrupted !\n");
00602                 return NULL;
00603 #else /* !macintosh */
00604                 return ptr;
00605 #endif /* !macintosh */
00606             }
00607         }
00608         prev->next = frame->next;
00609     }
00610
00611     /*
00612      * insert frame into free list
00613      */
00614     frame->next = garb->firstfree;
00615     garb->firstfree = frame;
00616
00617     return ptr;
00618 }
00619
00620 static void *garby_free(void *ptr);
00621 #define garbyFree(ptr) garby_free(ptr)
00622
00623 #if qCvsDebug
00624     static void *garby_alloc(void *ptr, int line, const char *file);
00625     static void *garby_realloc(void *ptr, void *newptr, int line, const char *file);
00626
00627 #   define garbyAlloc(ptr, line, file) garby_alloc(ptr, line, file)
00628 #   define garbyRealloc(ptr, NewPtr, line, file) garby_realloc(ptr, NewPtr, line, file)
00629 #else
00630     static void *garby_alloc(void *ptr);
00631     static void *garby_realloc(void *ptr, void *newptr);
00632
00633 #   define garbyAlloc(ptr, line, file) garby_alloc(ptr)
00634 #   define garbyRealloc(ptr, NewPtr, line, file) garby_realloc(ptr, NewPtr)
00635 #endif
00636
00637 #if qCvsDebug
00638 static void *garby_alloc(void *ptr, int line, const char *file)
00639 #else
00640 static void *garby_alloc(void *ptr)
00641 #endif
00642 {
00643 #if AUTO_INITALIZE
00644     if(gGarbage == 0L)
00645         garbyNew();
00646 #endif /* AUTO_INITALIZE */
00647
00648     if(gGarbage == NULL || ptr == NULL)
00649         return ptr;
00650
00651 #if qCvsDebug
00652     return poolAlloc(&gGarbage->pools[GARBY_KEY(ptr)], ptr, line, file);
00653 #else
00654     return poolAlloc(&gGarbage->pools[GARBY_KEY(ptr)], ptr);
00655 #endif
00656 }
00657
00658 static void *garby_free(void *ptr)
00659 {
00660     if(gGarbage == NULL || ptr == NULL)
00661         return ptr;
00662
00663     return poolFree(&gGarbage->pools[GARBY_KEY(ptr)], ptr);
00664 }
00665
00666 #if qCvsDebug
00667 static void *garby_realloc(void *ptr, void *newptr, int line, const char *file)
00668 #else
00669 static void *garby_realloc(void *ptr, void *newptr)
00670 #endif
00671 {
00672 #if AUTO_INITALIZE
00673     if(gGarbage == 0L)
00674         garbyNew();
00675 #endif /* AUTO_INITALIZE */
00676
00677     garby_free(ptr);
00678 #if qCvsDebug
00679     return garby_alloc(newptr, line, file);
00680 #else
00681     return garby_alloc(newptr);
00682 #endif
00683 }
00684
00685 #if qCvsDebug
00686 void *  shl_malloc(size_t size, int line, const char *file)
00687 #else
00688 void *  shl_malloc(size_t size)
00689 #endif
00690 {
00691     char *ptr;
00692
00693     if (size == 0)
00694         return NULL;
00695
00696     ptr = (char *)platform_malloc(size);
00697     return garbyAlloc(ptr, line, file);
00698 }
00699
00700 #if qCvsDebug
00701 void *  shl_calloc(size_t nmemb, size_t size, int line, const char *file)
00702 #else
00703 void *  shl_calloc(size_t nmemb, size_t size)
00704 #endif
00705 {
00706     char *ptr;
00707
00708     if (nmemb == 0 || size == 0)
00709         return NULL;
00710
00711     ptr = (char *)platform_calloc(nmemb, size);
00712     return garbyAlloc(ptr, line, file);
00713 }
00714
00715 #if qCvsDebug
00716 void *  shl_realloc(void * ptr, size_t size, int line, const char *file)
00717 #else
00718 void *  shl_realloc(void * ptr, size_t size)
00719 #endif
00720 {
00721     char *Newptr;
00722
00723     if (ptr == NULL)
00724     {
00725         Newptr = (char *)platform_malloc(size);
00726         return garbyAlloc(Newptr, line, file);
00727     }
00728
00729     if (size == 0)
00730     {
00731         platform_free(garbyFree(ptr));
00732         return NULL;
00733     }
00734
00735     Newptr = (char *)platform_realloc(ptr, size);
00736     if(Newptr == ptr)
00737         return ptr;
00738
00739     return garbyRealloc(ptr, Newptr, line, file);
00740 }
00741
00742 void    shl_free(void *ptr)
00743 {
00744     if (ptr != NULL)
00745         platform_free (garbyFree(ptr));
00746 }
00747
Generated on Sun Feb 24 01:21:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/dll_garbage.h Source File

common/dll_garbage.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * dll_garbage.h --- memory garbage collection for the dll
00023  */
00024
00025 #ifndef DLL_GARBAGE_H
00026 #define DLL_GARBAGE_H
00027
00028 #include <stdlib.h>
00029 #ifdef WIN32
00030 #   include <malloc.h>
00031 #endif /* WIN32 */
00032
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00037 #if qCvsDebug
00038 #   define malloc(s) shl_malloc(s, __LINE__, __FILE__)
00039 #   define calloc(m, s) shl_calloc(m, s, __LINE__, __FILE__)
00040 #   define realloc(p, s) shl_realloc(p, s, __LINE__, __FILE__)
00041     void *  shl_calloc(size_t nmemb, size_t size, int line, const char *file);
00042     void *  shl_malloc(size_t size, int line, const char *file);
00043     void *  shl_realloc(void * ptr, size_t size, int line, const char *file);
00044 #else /* !qCvsDebug */
00045 #   define malloc shl_malloc
00046 #   define calloc shl_calloc
00047 #   define realloc shl_realloc
00048     void *  shl_calloc(size_t nmemb, size_t size);
00049     void *  shl_malloc(size_t size);
00050     void *  shl_realloc(void * ptr, size_t size);
00051 #endif /* !qCvsDebug */
00052
00053 #define free shl_free
00054 void shl_free(void *ptr);
00055
00056 void garbyNew(void);
00057 void garbyRemove(int verboseSummary, int verboseMemoryLeak);
00058
00059 #ifdef __cplusplus
00060 }
00061 #endif
00062
00063 #endif /* DLL_GARBAGE_H */
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/dll_glue.c Source File

common/dll_glue.c

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * dll_glue.cpp --- glue code for the dll to communicate with the caller
00023  */
00024
00025 #ifdef HAVE_CONFIG_H
00026 #include "config.h"
00027 #endif /* HAVE_CONFIG_H */
00028
00029 #include <unistd.h>
00030 #include <stdio.h>
00031 #include <setjmp.h>
00032 #include <errno.h>
00033
00034 #include "dll_glue.h"
00035 #include "dll_garbage.h"
00036 #include "GUSIMSLSetup.h"
00037
00038 #if !TARGET_API_MAC_CARBON
00039     static UniversalProcPtr __glue_getenv = 0L;
00040     static UniversalProcPtr __glue_consoleout = 0L;
00041     static UniversalProcPtr __glue_consoleerr = 0L;
00042     static UniversalProcPtr __glue_consolein = 0L;
00043     static UniversalProcPtr __glue_eventdispatch = 0L;
00044 #else /* TARGET_API_MAC_CARBON */
00045     static dllglue_getenv_func __glue_getenv = 0L;
00046     static dllglue_consoleout_func __glue_consoleout = 0L;
00047     static dllglue_consoleout_func __glue_consoleerr = 0L;
00048     static dllglue_consolein_func __glue_consolein = 0L;
00049     static dllglue_eventdispath_func __glue_eventdispatch = 0L;
00050 #endif /* TARGET_API_MAC_CARBON */
00051
00052 static int __glue_exit_code = 0;
00053 static jmp_buf _glue_buf;
00054
00055 extern int __no_msl_lf_convert; // GUSIMSLSetup.cpp
00056
00057 extern int main(int argc, char **argv);
00058
00059 void
00060 dllglue_flushconsole(void)
00061 {
00062     fflush(stdout);
00063     fflush(stderr);
00064 }
00065
00066 static void initialize_all(void)
00067 {
00068     GusiMSLSetWriteConsole(dllglue_consoleout);
00069     GusiMSLSetErrConsole(dllglue_consoleerr);
00070     GusiMSLSetInConsole(dllglue_consolein);
00071     GusiMSLSetHandleEvent(dllglue_dispatchevent);
00072
00073     // create text files with the Unix LF (0x0A)
00074     // the default is CR on Classic/Carbon-CFM
00075     if(getenv("CVSUSEUNIXLF") != NULL)
00076     {
00077         __no_msl_lf_convert = 1;
00078     }
00079 }
00080
00081 static void flush_all(void)
00082 {
00083     garbyRemove(true, false);
00084     dllglue_flushconsole();
00085     dllglue_setgetenv(0L);
00086     dllglue_setconsoleout(0L);
00087     dllglue_setconsoleerr(0L);
00088     dllglue_setconsolein(0L);
00089     dllglue_seteventdispatch(0L);
00090 }
00091
00092 void
00093 dllglue_exit(int code)
00094 {
00095     __glue_exit_code = code;
00096     longjmp(_glue_buf, 1);
00097 }
00098
00099 char *
00100 dllglue_getenv(const char * name)
00101 {
00102     if(__glue_getenv != 0L)
00103     {
00104 #if !TARGET_API_MAC_CARBON
00105         return (char *)CallUniversalProc(__glue_getenv, uppGetEnvProcInfo, name);
00106 #else /* TARGET_API_MAC_CARBON */
00107         return __glue_getenv(name);
00108 #endif /* TARGET_API_MAC_CARBON */
00109     }
00110     return 0L;
00111 }
00112
00113 long dllglue_consoleout(char *buffer, long n)
00114 {
00115 #if !TARGET_API_MAC_CARBON
00116     if(__glue_consoleout != 0L)
00117     {
00118         return (int)CallUniversalProc(__glue_consoleout, uppConsoleOutProcInfo, buffer, n);
00119     }
00120 #else
00121     if(__glue_consoleout != 0L)
00122     {
00123         return __glue_consoleout(buffer, n);
00124     }
00125 #endif
00126     return 0;
00127 }
00128
00129 long dllglue_consoleerr(char *buffer, long n)
00130 {
00131 #if !TARGET_API_MAC_CARBON
00132     if(__glue_consoleerr != 0L)
00133     {
00134         return (int)CallUniversalProc(__glue_consoleerr, uppConsoleOutProcInfo, buffer, n);
00135     }
00136 #else
00137     if(__glue_consoleerr != 0L)
00138     {
00139         return __glue_consoleerr(buffer, n);
00140     }
00141 #endif
00142     return 0;
00143 }
00144
00145 long dllglue_consolein(char *buffer, long n)
00146 {
00147 #if !TARGET_API_MAC_CARBON
00148     if(__glue_consolein != 0L)
00149     {
00150         return (int)CallUniversalProc(__glue_consolein, uppConsoleInProcInfo, buffer, n);
00151     }
00152 #else
00153     if(__glue_consolein != 0L)
00154     {
00155         return __glue_consolein(buffer, n);
00156     }
00157 #endif
00158     return 0;
00159 }
00160
00161 int dllglue_dispatchevent(EventRecord *userevent)
00162 {
00163 #if !TARGET_API_MAC_CARBON
00164     if(__glue_eventdispatch != 0L)
00165     {
00166         return (int)CallUniversalProc(__glue_eventdispatch, uppEventDispatchProcInfo, userevent);
00167     }
00168 #else
00169     if(__glue_eventdispatch != 0L)
00170     {
00171         return __glue_eventdispatch(userevent);
00172     }
00173 #endif
00174     return 0;
00175 }
00176
00177 int
00178 dllglue_main(const char *path, int argc, char **argv)
00179 {
00180     if(setjmp(_glue_buf) == 0)
00181     {
00182         initialize_all();
00183
00184         if(path != 0L && chdir(path) != 0)
00185         {
00186             fprintf(stderr, "Error: Unable to chdir %s (error %d)\n", path, errno);
00187             exit(1);
00188         }
00189
00190         main(argc, argv);
00191     }
00192     else
00193     {
00194     }
00195
00196     flush_all();
00197
00198     return __glue_exit_code;
00199 }
00200
00201 int
00202 dllglue_decode_file(char *infile)
00203 {
00204     if(setjmp(_glue_buf) == 0)
00205     {
00206         initialize_all();
00207
00208         __glue_exit_code = decode_file (infile);
00209     }
00210     else
00211     {
00212     }
00213
00214     flush_all();
00215
00216     return __glue_exit_code;
00217 }
00218
00219 int
00220 #if !TARGET_API_MAC_CARBON
00221 dllglue_setgetenv(UniversalProcPtr agetenv)
00222 #else /* TARGET_API_MAC_CARBON */
00223 dllglue_setgetenv(dllglue_getenv_func agetenv)
00224 #endif /* TARGET_API_MAC_CARBON */
00225 {
00226     if(__glue_getenv != 0L)
00227     {
00228 #if !TARGET_API_MAC_CARBON
00229         DisposeRoutineDescriptor(__glue_getenv);
00230 #endif /* !TARGET_API_MAC_CARBON */
00231         __glue_getenv = 0L;
00232     }
00233     __glue_getenv = agetenv;
00234     return 0;
00235 }
00236
00237 #if !TARGET_API_MAC_CARBON
00238 int
00239 dllglue_seteventdispatch(UniversalProcPtr aeventdispatch)
00240 #else
00241 int
00242 dllglue_seteventdispatch(dllglue_eventdispath_func aeventdispatch)
00243 #endif
00244 {
00245 #if !TARGET_API_MAC_CARBON
00246     if(__glue_eventdispatch != 0L)
00247     {
00248         DisposeRoutineDescriptor(__glue_eventdispatch);
00249         __glue_eventdispatch = 0L;
00250     }
00251 #endif
00252     __glue_eventdispatch = aeventdispatch;
00253     return 0;
00254 }
00255
00256 int
00257 #if !TARGET_API_MAC_CARBON
00258 dllglue_setconsoleout(UniversalProcPtr aconsoleout)
00259 #else /* TARGET_API_MAC_CARBON */
00260 dllglue_setconsoleout(dllglue_consoleout_func aconsoleout)
00261 #endif /* TARGET_API_MAC_CARBON */
00262 {
00263     if(__glue_consoleout != 0L)
00264     {
00265 #if !TARGET_API_MAC_CARBON
00266         DisposeRoutineDescriptor(__glue_consoleout);
00267 #endif /* !TARGET_API_MAC_CARBON */
00268         __glue_consoleout = 0L;
00269     }
00270     __glue_consoleout = aconsoleout;
00271     return 0;
00272 }
00273
00274 int
00275 #if !TARGET_API_MAC_CARBON
00276 dllglue_setconsoleerr(UniversalProcPtr aconsoleerr)
00277 #else /* TARGET_API_MAC_CARBON */
00278 dllglue_setconsoleerr(dllglue_consoleout_func aconsoleerr)
00279 #endif /* TARGET_API_MAC_CARBON */
00280 {
00281     if(__glue_consoleerr != 0L)
00282     {
00283 #if !TARGET_API_MAC_CARBON
00284         DisposeRoutineDescriptor(__glue_consoleerr);
00285 #endif /* !TARGET_API_MAC_CARBON */
00286         __glue_consoleerr = 0L;
00287     }
00288     __glue_consoleerr = aconsoleerr;
00289     return 0;
00290 }
00291
00292 int
00293 #if !TARGET_API_MAC_CARBON
00294 dllglue_setconsolein(UniversalProcPtr aconsolein)
00295 #else /* TARGET_API_MAC_CARBON */
00296 dllglue_setconsolein(dllglue_consolein_func aconsolein)
00297 #endif /* TARGET_API_MAC_CARBON */
00298 {
00299     if(__glue_consolein != 0L)
00300     {
00301 #if !TARGET_API_MAC_CARBON
00302         DisposeRoutineDescriptor(__glue_consolein);
00303 #endif /* !TARGET_API_MAC_CARBON */
00304         __glue_consolein = 0L;
00305     }
00306     __glue_consolein = aconsolein;
00307     return 0;
00308 }
00309
00310 //
00311 // Runtime intialization
00312 //
00313
00314 // from Metrowerks runtime
00315 extern pascal OSErr __initialize(CFragConnectionID connID);
00316 extern pascal void __terminate(void);
00317
00318 // for cvs
00319 pascal OSErr __cvs_initialize(const CFragInitBlock * theInitBlock);
00320 pascal void __cvs_terminate(void);
00321
00322 FSSpec sCvsContainerFileSpec;
00323
00324 pascal OSErr __cvs_initialize(const CFragInitBlock * theInitBlock)
00325 {
00326     OSErr result = noErr;
00327
00328     if(CFragHasFileLocation(theInitBlock->fragLocator.where) &&
00329         theInitBlock->fragLocator.u.onDisk.fileSpec != 0L)
00330     {
00331         sCvsContainerFileSpec = *theInitBlock->fragLocator.u.onDisk.fileSpec;
00332     }
00333     garbyNew();
00334
00335     result = __initialize(theInitBlock->connectionID);
00336
00337     return result;
00338 }
00339
00340 pascal void __cvs_terminate(void)
00341 {
00342     __terminate();
00343
00344     garbyRemove(false, false);
00345 }
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/dll_glue.h Source File

common/dll_glue.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * dll_glue.h --- glue code for the dll to communicate with the caller
00023  */
00024
00025 #ifndef DLL_GLUE_H
00026 #define DLL_GLUE_H
00027
00028 #include <stdlib.h>
00029 #include "dll_process.h"
00030 #include <Events.h>
00031
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035
00036 #pragma export on
00037
00038 int dllglue_decode_file (char *infile);
00039 int dllglue_main(const char *path, int argc, char **argv);
00040 #if !TARGET_API_MAC_CARBON
00041     int dllglue_setgetenv(UniversalProcPtr agetenv);
00042     int dllglue_setconsoleout(UniversalProcPtr aconsoleout);
00043     int dllglue_setconsoleerr(UniversalProcPtr aconsoleerr);
00044     int dllglue_setconsolein(UniversalProcPtr aconsolein);
00045     int dllglue_seteventdispatch(UniversalProcPtr adispatch);
00046 #else /* TARGET_API_MAC_CARBON */
00047     int dllglue_setgetenv(dllglue_getenv_func agetenv);
00048     int dllglue_setconsoleout(dllglue_consoleout_func aconsoleout);
00049     int dllglue_setconsoleerr(dllglue_consoleout_func aconsoleerr);
00050     int dllglue_setconsolein(dllglue_consolein_func aconsolein);
00051     int dllglue_seteventdispatch(dllglue_eventdispath_func adispatch);
00052 #endif /* TARGET_API_MAC_CARBON */
00053
00054 #pragma export reset
00055
00056 /* glue code to intercept the getenv and exit */
00057 #define exit dllglue_exit
00058 #define getenv dllglue_getenv
00059
00060 void dllglue_exit(int code);
00061 char * dllglue_getenv(const char *);
00062
00063 int dllglue_dispatchevent(EventRecord *userevent);
00064 long dllglue_consoleout(char *buffer, long n);
00065 long dllglue_consoleerr(char *buffer, long n);
00066 long dllglue_consolein(char *buffer, long n);
00067
00068 /* console management, captures stdout and stderr */
00069 void dllglue_flushconsole(void);
00070
00071 #ifdef __cplusplus
00072 }
00073 #endif
00074
00075 #endif /* DLL_GLUE_H */
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/dll_loader.c Source File

common/dll_loader.c

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * dll_loader.cpp --- code to load dynamic code
00023  */
00024
00025 #ifdef HAVE_CONFIG_H
00026 #   include "config.h"
00027 #endif /* HAVE_CONFIG_H */
00028
00029 #if !defined(WIN32) && !defined(macintosh)
00030 #   include "dynl.h"
00031 #endif /* !WIN32 && !macintosh */
00032
00033 #ifdef WIN32
00034 #   include <windows.h>
00035 #endif /* WIN32 */
00036
00037 #include <string.h>
00038
00039 #include "dll_loader.h"
00040
00041 #if defined(macintosh) && !TARGET_API_MAC_CARBON
00042     RoutineDescriptor sCompatProcRD;
00043     UniversalProcPtr sCompatProc;
00044 #else /* !macintosh || TARGET_API_MAC_CARBON */
00045     void *sCompatProc;
00046 #endif /* !macintosh || TARGET_API_MAC_CARBON */
00047
00048 #ifdef macintosh
00049 #   include <TextUtils.h>
00050     static ProcPtr getSymFunction(CompatConnectID connID, const Str255 name)
00051     {
00052         long symCount;
00053         Ptr symAddr;
00054         int i;
00055         OSErr err = CountSymbols(connID, &symCount);
00056         if(err != noErr)
00057             return 0L;
00058
00059         for(i = 0; i < symCount; i++)
00060         {
00061             CFragSymbolClass symClass;
00062             Str255 symName;
00063             err = GetIndSymbol(connID, i, symName, &symAddr, &symClass);
00064             if(err != noErr)
00065                 return 0L;
00066             if(memcmp(symName, name, name[0]) == 0)
00067                 break;
00068         }
00069         if(i == symCount)
00070             return 0L;
00071         return (ProcPtr)symAddr;
00072     }
00073 #endif /* macintosh */
00074
00075 int
00076 CompatLoadLibrary(CompatConnectID * connID, const char *name_dll)
00077 {
00078     if(connID == 0L)
00079         return 0;
00080
00081 #ifdef macintosh
00082     {
00083     OSErr err;
00084     Ptr mainAddr;
00085     Str255 errMessage;
00086     Str255 pname;
00087
00088     c2pstrcpy(pname, name_dll);
00089     err = GetSharedLibrary(pname, kPowerPCCFragArch, kPrivateCFragCopy, connID, &mainAddr, errMessage);
00090     return err == noErr;
00091     }
00092 #elif defined(WIN32)
00093     *connID = LoadLibrary(name_dll);
00094
00095     return (*connID) != 0L;
00096 #else /* !WIN32 && !macintosh */
00097     *connID = dynl_link(name_dll);
00098     return (*connID) != 0L;
00099 #endif /* !WIN32 && !macintosh */
00100 }
00101
00102 int
00103 CompatCloseLibrary(CompatConnectID * connID)
00104 {
00105     if(connID == 0L)
00106         return 0;
00107
00108 #ifdef macintosh
00109     CloseConnection(connID);
00110     return 1;
00111 #elif defined(WIN32)
00112     FreeLibrary(*connID);
00113     connID = 0L;
00114     return 1;
00115 #else /* !WIN32 && !macintosh */
00116     dynl_unlink(*connID);
00117     connID = 0L;
00118     return 1;
00119 #endif /* !WIN32 && !macintosh */
00120 }
00121
00122 #if defined(macintosh) && !TARGET_API_MAC_CARBON
00123 UniversalProcPtr
00124 _CompatCallLibrary(CompatConnectID connID, long id_func, const char *name_func)
00125 #else /* !macintosh || TARGET_API_MAC_CARBON */
00126 void *
00127 _CompatCallLibrary(CompatConnectID connID, const char *name_func)
00128 #endif /* !macintosh || TARGET_API_MAC_CARBON */
00129 {
00130 #ifdef macintosh
00131     ProcPtr symAddr;
00132     UniversalProcPtr proc;
00133     Str255 pname;
00134
00135     c2pstrcpy(pname, name_func);
00136
00137     symAddr = getSymFunction(connID, pname);
00138 #   if TARGET_API_MAC_CARBON
00139     return symAddr;
00140 #   else
00141     if(symAddr == 0L)
00142         return 0L;
00143
00144     proc = NewRoutineDescriptor(symAddr, id_func, kPowerPCISA);
00145     return proc;
00146 #   endif
00147 #elif defined(WIN32)
00148     return GetProcAddress(connID, name_func);
00149 #else /* !WIN32 && !macintosh */
00150     return dynl_func(name_func, connID);
00151 #endif /* !WIN32 && !macintosh */
00152 }
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/dll_loader.h Source File

common/dll_loader.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * dll_loader.h --- code to load dynamic code
00023  */
00024
00025 #ifndef DLLLOADER_H
00026 #define DLLLOADER_H
00027
00028 #ifdef macintosh
00029 #   include <CodeFragments.h>
00030     typedef CFragConnectionID CompatConnectID;
00031 #elif defined(WIN32)
00032     typedef HINSTANCE CompatConnectID;
00033 #else /* !macintosh && !WIN32 */
00034 #   include <dlfcn.h>
00035     typedef void *CompatConnectID;
00036 #endif /* !macintosh && !WIN32 */
00037
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041
00042 int CompatLoadLibrary(CompatConnectID * connID, const char *name_dll);
00043     // return false if failed
00044     // mac : name_dll is the fragment name of the shared library
00045     // others : name_dll is the filename of the library
00046
00047 int CompatCloseLibrary(CompatConnectID * connID);
00048     // unload the shared library, connID should not
00049     // be used anymore after this call
00050
00051 // CompatCallLibrary(CompatConnectID ID, <atype> result, macFuncDescInfo idf,
00052 //     const char *nf, <atype> tf, <arguments...>
00053 //
00054 // Call a function named "nf", prototype "tf", macDescInfo idf (0 if not mac)
00055 // with the arguments "a1", "a2"... and put the result in "res"
00056
00057 #if defined(macintosh) && !TARGET_API_MAC_CARBON
00058     extern UniversalProcPtr sCompatProc;
00059 #   define CompatCallLibrary1(ID, res, idf, nf, tf, a1) \
00060         ( \
00061             sCompatProc = _CompatCallLibrary(ID, idf, nf), \
00062             res = sCompatProc != NULL ? \
00063                 CallUniversalProc(sCompatProc, idf, a1) : res, \
00064             sCompatProc != NULL ? (DisposeRoutineDescriptor(sCompatProc), true) : false \
00065         )
00066 #   define CompatCallLibrary2(ID, res, idf, nf, tf, a1, a2) \
00067         ( \
00068             sCompatProc = _CompatCallLibrary(ID, idf, nf), \
00069             res = sCompatProc != NULL ? \
00070                 CallUniversalProc(sCompatProc, idf, a1, a2) : res, \
00071             sCompatProc != NULL ? (DisposeRoutineDescriptor(sCompatProc), true) : false \
00072         )
00073 #   define CompatCallLibrary3(ID, res, idf, nf, tf, a1, a2, a3) \
00074         ( \
00075             sCompatProc = _CompatCallLibrary(ID, idf, nf), \
00076             res = sCompatProc != NULL ? \
00077                 CallUniversalProc(sCompatProc, idf, a1, a2, a3) : res, \
00078             sCompatProc != NULL ? (DisposeRoutineDescriptor(sCompatProc), true) : false \
00079         )
00080     UniversalProcPtr _CompatCallLibrary(CompatConnectID connID, long id_func, const char *name_func);
00081 #else /* !macintosh || TARGET_API_MAC_CARBON */
00082     extern void *sCompatProc;
00083 #   define CompatCallLibrary1(ID, res, idf, nf, tf, a1) \
00084         ( \
00085             sCompatProc = _CompatCallLibrary(ID, nf), \
00086             res = sCompatProc != NULL ? \
00087                 ((tf)sCompatProc)(a1) : res, \
00088             sCompatProc != NULL \
00089         )
00090 #   define CompatCallLibrary2(ID, res, idf, nf, tf, a1, a2) \
00091         ( \
00092             sCompatProc = _CompatCallLibrary(ID, nf), \
00093             res = sCompatProc != NULL ? \
00094                 ((tf)sCompatProc)(a1, a2) : res, \
00095             sCompatProc != NULL \
00096         )
00097 #   define CompatCallLibrary3(ID, res, idf, nf, tf, a1, a2, a3) \
00098         ( \
00099             sCompatProc = _CompatCallLibrary(ID, nf), \
00100             res = sCompatProc != NULL ? \
00101                 ((tf)sCompatProc)(a1, a2, a3) : res, \
00102             sCompatProc != NULL \
00103         )
00104     void *_CompatCallLibrary(CompatConnectID connID, const char *name_func);
00105 #endif /* !macintosh || TARGET_API_MAC_CARBON */
00106
00107 // used with CompatCallLibrary when you want to give a function
00108 // as an argument : for mac funcInfo is the desc. of the function
00109 // arguments, if not 0
00110
00111 #if defined(macintosh) && !TARGET_API_MAC_CARBON
00112 #   define CompatFuncArg(funcInfo, func) \
00113         NewRoutineDescriptor((ProcPtr)func, funcInfo, kPowerPCISA)
00114 #else /* !macintosh || TARGET_API_MAC_CARBON */
00115 #   define CompatFuncArg(funcInfo, func) func
00116 #endif /* macintosh || TARGET_API_MAC_CARBON */
00117
00118 #ifdef __cplusplus
00119 }
00120 #endif
00121
00122 #endif /* DLLLOADER_H */
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/dll_process.h Source File

common/dll_process.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00019  */
00020
00021 /*
00022  * dll_process.h --- allow to simulate a process using the dll mechanism
00023  */
00024
00025 #ifndef DLL_PROCESS_H
00026 #define DLL_PROCESS_H
00027
00028 #ifdef macintosh
00029 #   include <CodeFragments.h>
00030 #   include <Events.h>
00031 #endif
00032
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00037 #if defined(macintosh) && !TARGET_API_MAC_CARBON
00038     enum {
00039         uppGetEnvProcInfo = kCStackBased
00040             | RESULT_SIZE(SIZE_CODE(sizeof(char *)))
00041             | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(char *)))
00042     };
00043
00044     enum {
00045         uppConsoleOutProcInfo = kCStackBased
00046             | RESULT_SIZE(SIZE_CODE(sizeof(long)))
00047             | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(char *)))
00048             | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
00049     };
00050
00051     enum {
00052         uppConsoleInProcInfo = kCStackBased
00053             | RESULT_SIZE(SIZE_CODE(sizeof(long)))
00054             | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(char *)))
00055             | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
00056     };
00057
00058     enum {
00059         uppMainProcInfo = kCStackBased
00060             | RESULT_SIZE(SIZE_CODE(sizeof(int)))
00061             | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(char *)))
00062             | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(int)))
00063             | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(char **)))
00064     };
00065
00066     enum {
00067         uppSetGlueProcInfo = kCStackBased
00068             | RESULT_SIZE(SIZE_CODE(sizeof(int)))
00069             | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(UniversalProcPtr)))
00070     };
00071
00072     enum {
00073         uppEventDispatchProcInfo = kCStackBased
00074             | RESULT_SIZE(SIZE_CODE(sizeof(int)))
00075             | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void */*EventRecord **/)))
00076     };
00077
00078     enum {
00079         uppDecodeFileProcInfo = kCStackBased
00080             | RESULT_SIZE(SIZE_CODE(sizeof(int)))
00081             | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(char *)))
00082     };
00083 #else /* !macintosh || TARGET_API_MAC_CARBON */
00084     typedef char * (*dllglue_getenv_func) (const char *);
00085     typedef long (*dllglue_consoleout_func) (char *, long);
00086     typedef long (*dllglue_consolein_func) (char *, long);
00087     typedef int (*dllglue_main_func) (const char *, int, char**);
00088     typedef int (*dllglue_setglue_func) (void *);
00089 #   if TARGET_API_MAC_CARBON
00090     typedef int (*dllglue_eventdispath_func) (EventRecord *);
00091     typedef int (*dllglue_decode_file_func) (char *);
00092 #   endif
00093 #endif /* !macintosh || TARGET_API_MAC_CARBON */
00094
00095 #ifdef __cplusplus
00096 }
00097 #endif
00098
00099 #endif /* DLL_PROCESS_H */
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/EditorMonDlg.cpp Source File

common/EditorMonDlg.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- October 2001
00019  */
00020
00021 /*
00022  * EditorMonDlg.cpp --- editor monitor dialog
00023  */
00024
00025 #include "stdafx.h"
00026 #include "CvsPrefs.h"
00027 #include "TextBinary.h"
00028
00029 #ifdef WIN32
00030 #include "wincvs.h"
00031 #include "EditorMonDlg.h"
00032 #endif /* WIN32 */
00033
00034 #ifdef _DEBUG
00035 #define new DEBUG_NEW
00036 #undef THIS_FILE
00037 static char THIS_FILE[] = __FILE__;
00038 #endif
00039
00041 // CEditorMonDlg dialog
00042
00043 #ifdef WIN32
00044
00045 CEditorMonDlg::CEditorMonDlg(CWnd* pParent /*=NULL*/)
00046     : CDialog(CEditorMonDlg::IDD, pParent)
00047 {
00048     //{{AFX_DATA_INIT(CEditorMonDlg)
00049     m_tempFile = _T("");
00050     //}}AFX_DATA_INIT
00051 }
00052
00053
00054 void CEditorMonDlg::DoDataExchange(CDataExchange* pDX)
00055 {
00056     CDialog::DoDataExchange(pDX);
00057     //{{AFX_DATA_MAP(CEditorMonDlg)
00058     DDX_Text(pDX, IDC_TEMPFILE, m_tempFile);
00059     //}}AFX_DATA_MAP
00060 }
00061
00062
00063 BEGIN_MESSAGE_MAP(CEditorMonDlg, CDialog)
00064     //{{AFX_MSG_MAP(CEditorMonDlg)
00065     ON_WM_DESTROY()
00066     ON_WM_TIMER()
00067     //}}AFX_MSG_MAP
00068 END_MESSAGE_MAP()
00069
00071 // CEditorMonDlg message handlers
00072
00073 void CEditorMonDlg::OnDestroy()
00074 {
00075     if( m_timer )
00076     {
00077         KillTimer(m_timer);
00078     }
00079
00080     CDialog::OnDestroy();
00081 }
00082
00083 BOOL CEditorMonDlg::OnInitDialog()
00084 {
00085     CDialog::OnInitDialog();
00086
00087     // Extra initialization here
00088     m_timer = SetTimer(2048, 200, NULL);
00089
00090     return TRUE;  // return TRUE unless you set the focus to a control
00091                   // EXCEPTION: OCX Property Pages should return FALSE
00092 }
00093
00094 void CEditorMonDlg::OnTimer(UINT nIDEvent)
00095 {
00096     if( nIDEvent == m_timer && INVALID_HANDLE_VALUE != m_hProcess )
00097     {
00098         int status = WaitForSingleObject( m_hProcess, 0 );
00099         if( status == WAIT_OBJECT_0 )   //have been terminated...
00100         {
00101             EndDialog(IDOK);
00102         }
00103     }
00104
00105     CDialog::OnTimer(nIDEvent);
00106 }
00107
00108 #endif /* WIN32 */
00109
00110 bool CompatGetEditorMsg(UStr& message)
00111 {
00112     bool msgOK = false;
00113
00114 #ifdef WIN32
00115
00116     if(gCvsPrefs.Viewer() == 0L)
00117     {
00118         AfxMessageBox("You need to define a default viewer in the preferences", MB_OK | MB_ICONSTOP);
00119         return msgOK;
00120     }
00121
00122     CStr tmpFile;
00123     if( MakeTmpFile(tmpFile, "LogMsg", "tmp", true) )
00124     {
00125         //launch editor
00126         PROCESS_INFORMATION sProcessInformation;
00127         if( LaunchEditor( tmpFile, (void*)&sProcessInformation ) )
00128         {
00129             //we don't need the thread's handle so close it now
00130             CloseHandle( sProcessInformation.hThread );
00131
00132             //track the editor until it closes
00133             CStr uppath, folder;
00134             SplitPath(tmpFile, uppath, folder);
00135
00136             CEditorMonDlg editorMonDlg;
00137             editorMonDlg.m_hProcess = sProcessInformation.hProcess;
00138             editorMonDlg.m_tempFile = folder;
00139
00140             if( editorMonDlg.DoModal() == IDOK )
00141             {
00142                 msgOK = true;
00143             }
00144             else
00145             {
00146                 if( PostThreadMessage(sProcessInformation.dwThreadId, WM_QUIT, (WPARAM)EXIT_SUCCESS, 0) )
00147                 {
00148                     WaitForSingleObject( sProcessInformation.hProcess, 500 );
00149                 }
00150
00151                 int nStatus = WaitForSingleObject( sProcessInformation.hProcess, 0 );
00152                 if( nStatus != WAIT_OBJECT_0 )
00153                 {
00154                     TerminateProcess(sProcessInformation.hProcess, EXIT_SUCCESS);
00155                 }
00156             }
00157
00158             CloseHandle(sProcessInformation.hProcess);
00159         }
00160
00161         //copy the file into message string
00162         FILE* stream = fopen(tmpFile, "r");
00163         if( stream )
00164         {
00165             char line[100];
00166             while( fgets(line, 100, stream) )
00167             {
00168                 message << line;
00169             }
00170             fclose(stream);
00171         }
00172
00173         //cleanup
00174         ::DeleteFile(tmpFile);
00175     }
00176
00177 #if 0
00178     adminOptionDlg.m_optionString = (const char*)optionString;
00179     if( adminOptionDlg.DoModal() == IDOK )
00180     {
00181         optionString = (const char*)adminOptionDlg.m_optionString;
00182         userHitOK = true;
00183     }
00184 #endif
00185
00186 #endif /* WIN32 */
00187
00188 // the code below might help to do stuff on Unix or Mac later on
00189 #if 0
00190     const char * argv[2] = { 0L, 0L };
00191     CStr program;
00192     if(strchr(gCvsPrefs.Viewer(), ' ') != 0L)
00193     {
00194         program << '\"';
00195         program << gCvsPrefs.Viewer();
00196         program << '\"';
00197     }
00198     else
00199         program = gCvsPrefs.Viewer();
00200
00201     argv[0] = program;
00202     int process = _spawnvp(_P_NOWAIT, gCvsPrefs.Viewer(), argv);
00203 #endif
00204
00205
00206 #ifdef qMacCvsPP
00207 #endif /* qMacCvsPP */
00208 #if qUnix
00209 #endif // qUnix
00210
00211     return msgOK;
00212 }
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/EditorMonDlg.h Source File

common/EditorMonDlg.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- October 2001
00019  */
00020
00021 /*
00022  * EditorMonDlg.h --- editor monitor dialog
00023  */
00024
00025 #if !defined(AFX_EDITORMONDLG_H__5146BF16_567B_4017_A1FD_619A7BD07906__INCLUDED_)
00026 #define AFX_EDITORMONDLG_H__5146BF16_567B_4017_A1FD_619A7BD07906__INCLUDED_
00027
00028 #if _MSC_VER > 1000
00029 #pragma once
00030 #endif // _MSC_VER > 1000
00031 // EditorMonDlg.h : header file
00032 //
00033
00034 bool CompatGetEditorMsg(UStr& message);
00035     // launch and monitor editor to get log message
00036
00038 // CEditorMonDlg dialog
00039
00040 #ifdef WIN32
00041
00042 class CEditorMonDlg : public CDialog
00043 {
00044 // Construction
00045 public:
00046     CEditorMonDlg(CWnd* pParent = NULL);   // standard constructor
00047
00048 // Dialog Data
00049     //{{AFX_DATA(CEditorMonDlg)
00050     enum { IDD = IDD_EDITORMON };
00051     CString m_tempFile;
00052     //}}AFX_DATA
00053
00054
00055 // Overrides
00056     // ClassWizard generated virtual function overrides
00057     //{{AFX_VIRTUAL(CEditorMonDlg)
00058     protected:
00059     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00060     //}}AFX_VIRTUAL
00061
00062 // Implementation
00063 protected:
00064
00065     // Generated message map functions
00066     //{{AFX_MSG(CEditorMonDlg)
00067     afx_msg void OnDestroy();
00068     virtual BOOL OnInitDialog();
00069     afx_msg void OnTimer(UINT nIDEvent);
00070     //}}AFX_MSG
00071     DECLARE_MESSAGE_MAP()
00072 public:
00073     HANDLE m_hProcess;
00074 private:
00075     UINT m_timer;
00076 };
00077
00078 //{{AFX_INSERT_LOCATION}}
00079 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00080
00081 #endif /* WIN32 */
00082
00083 #endif // !defined(AFX_EDITORMONDLG_H__5146BF16_567B_4017_A1FD_619A7BD07906__INCLUDED_)
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/FileTraversal.cpp Source File

common/FileTraversal.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 1998
00019  */
00020
00021 /*
00022  * FileTraversal.cpp : class to traverse a file hierarchy
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef WIN32
00028 #   include "resource.h"
00029 #endif /* WIN32 */
00030
00031 #if TARGET_OS_MAC
00032 #   include "GUSIInternal.h"
00033 #   include "GUSIFileSpec.h"
00034 #endif
00035
00036 #if TARGET_RT_MAC_CFM
00037 #   include "GUSIDevice.h"
00038 #endif /* TARGET_RT_MAC_CFM */
00039
00040 #ifdef HAVE_UNISTD_H
00041 #   include <unistd.h>
00042 #endif /* HAVE_UNISTD_H */
00043
00044 #ifdef HAVE_ERRNO_H
00045 #   include <errno.h>
00046 #endif /* HAVE_ERRNO_H */
00047
00048 #include "FileTraversal.h"
00049 #include "CPStr.h"
00050 #include "umain.h"
00051
00052 #ifdef WIN32
00053 #   include "AppConsole.h"
00054 #   include "wincvsdebug.h"
00055
00056 #   ifdef _DEBUG
00057 #   define new DEBUG_NEW
00058 #   undef THIS_FILE
00059     static char THIS_FILE[] = __FILE__;
00060 #   endif
00061 #endif /* WIN32 */
00062
00063 // in order to accelerate GUSI, we avoid using full paths
00064 #if TARGET_RT_MAC_CFM
00065 typedef GUSIDirectory * GUSIDirPtr;
00066
00067 static DIR * opendir(const GUSIFileSpec & spec)
00068 {
00069     GUSIFileToken   file(spec, GUSIFileToken::kWillOpendir);
00070
00071     GUSIDirectory * dir;
00072     if (GUSIDevice * device = file.Device())
00073         dir = device->opendir(file);
00074     else
00075     {
00076         GUSISetPosixError(ENOENT);
00077         dir = static_cast<GUSIDirectory *>(nil);
00078     }
00079
00080     return dir ? reinterpret_cast<DIR *>(new GUSIDirPtr(dir)) : 0;
00081 }
00082
00083 static int stat(const GUSIFileSpec & inspec, struct stat * sb)
00084 {
00085     GUSIFileToken   file(inspec, GUSIFileToken::kWillStat);
00086
00087     if (GUSIDevice * device = file.Device())
00088         return device->stat(file, sb);
00089
00090     GUSISetPosixError(ENOENT);
00091     return -1;
00092 }
00093 #endif
00094
00095 bool TraversalReport::gRunning = false;
00096
00097 kTraversal FileTraverse(const char *path, TraversalReport & report, const UFSSpec * macDirSpec)
00098 {
00099     DIR *dirp = 0L;
00100     STRUCT_DIRENT *dp;
00101     struct stat sb;
00102     CStr fullname, errstr, dirname, tmpname;
00103     kTraversal res = kContinueTraversal;
00104     char *tmp;
00105     const UFSSpec *macspec = 0L;
00106 #if defined(WIN32)
00107     unsigned long dbg_mask = GetWinCvsDebugMask(false);
00108     CStr tracestr;
00109 #endif
00110
00111     // used to restore the current directory
00112     static bool getPathFlag = false;
00113     char* szOriginalPath = NULL;
00114     USemaphore policeman(getPathFlag);
00115     USemaphore runstate(TraversalReport::gRunning);
00116
00117     if(!policeman.IsEnteredTwice())
00118     {
00119         szOriginalPath = getcwd(NULL, MAX_PATH);
00120     }
00121
00122 #if !TARGET_OS_MAC
00123     if(path == 0L || (dirp = opendir(path)) == 0L)
00124 #elif TARGET_RT_MAC_CFM
00125     GUSIFileSpec folderspec;
00126     UFSSpec foldermacspec;
00127     if(macDirSpec != 0L)
00128         folderspec = *macDirSpec;
00129     else if(path != 0L)
00130         folderspec = path;
00131     foldermacspec = folderspec;
00132     macspec = &foldermacspec;
00133
00134     if((dirp = opendir(folderspec)) == 0L)
00135 #else
00136     FSRef foldermacspec;
00137     if(macDirSpec != 0L)
00138         foldermacspec = *macDirSpec;
00139     else if(path != 0L)
00140         FSPathMakeRef(posix_to_utf8(path), &foldermacspec, NULL);
00141     macspec = &foldermacspec;
00142     if(path == 0L || (dirp = opendir(path)) == 0L)
00143 #endif
00144     {
00145         errstr = "Error while accessing ";
00146         errstr << path;
00147         errstr << " (error " << errno << ')';
00148         res =  report.OnError(errstr, errno);
00149         goto exit;
00150     }
00151
00152     tmpname = path;
00153     tmp = tmpname;
00154     char *next;
00155     if(tmpname.endsWith(kPathDelimiter))
00156         tmp[strlen(tmp) - 1] = '\0';
00157     next = tmp;
00158     while((tmp = strchr(next, kPathDelimiter)) != 0L)
00159     {
00160         next = ++tmp;
00161     }
00162     dirname = next;
00163
00164     res = report.EnterDirectory(path, dirname, macspec);
00165     if(res != kContinueTraversal)
00166         goto abort;
00167
00168     while ((dp = readdir (dirp)) != NULL)
00169     {
00170         res = report.OnIdle(path);
00171         if(res != kContinueTraversal)
00172             goto abort;
00173
00174 #if !TARGET_RT_MAC_CFM
00175         if(strcmp(dp->d_name, ".") == 0 || strcmp(dp->d_name, "..") == 0)
00176             continue;
00177 #endif /* !TARGET_RT_MAC_CFM */
00178
00179         fullname = path;
00180         if(!fullname.endsWith(kPathDelimiter))
00181             fullname << kPathDelimiter;
00182         fullname << dp->d_name;
00183
00184         macspec = 0L;
00185         int statres;
00186
00187 #if TARGET_RT_MAC_CFM
00188         GUSIFileSpec inspec(folderspec);
00189         inspec += dp->d_name;
00190         UFSSpec infspec = inspec;
00191         macspec = &infspec;
00192
00193         statres = stat(inspec, &sb);
00194 #elif TARGET_RT_MAC_MACHO
00195         FSRef infspec;
00196         FSPathMakeRef(posix_to_utf8(fullname.c_str()), &infspec, NULL);
00197         macspec = &infspec;
00198
00199         statres = stat(fullname, &sb);
00200 #else
00201 #   if defined(WIN32)
00202         if ( (dbg_mask & wcvsdbg_trace_modified_checks) && (dbg_mask & wcvsdbg_verbose) )
00203         {
00204             AppendWinCvsDebugMask(wcvsdbg_trace_dst_checks
00205                                     | wcvsdbg_trace_stat);
00206             tracestr = "Stat(";
00207             tracestr << static_cast<const char *>(fullname);
00208             tracestr << ") ...\n";
00209             cvs_err(tracestr);
00210             OutputDebugString(tracestr);
00211         }
00212 #   endif   // defined(WIN32)
00213
00214         statres = stat(fullname, &sb);
00215 #endif
00216
00217         if (statres != -1)
00218         {
00219             if(S_ISDIR(sb.st_mode))
00220             {
00221                 res = report.OnDirectory(path, fullname, dp->d_name, sb, macspec);
00222
00223                 if(res == kSkipFile)
00224                     continue;
00225                 if(res != kContinueTraversal)
00226                     goto abort;
00227
00228                 res = FileTraverse(fullname, report, macspec);
00229                 if(res != kContinueTraversal)
00230                     goto abort;
00231
00232             }
00233             else if(S_ISREG(sb.st_mode))
00234             {
00235                 res = report.OnFile(path, fullname, dp->d_name, sb, macspec);
00236                 if(res == kSkipFile)
00237                     continue;
00238                 if(res != kContinueTraversal)
00239                     goto abort;
00240             }
00241 #ifdef S_ISLNK
00242             else if(S_ISLNK(sb.st_mode))
00243             {
00244                 res = report.OnAlias(path, fullname, dp->d_name, sb, macspec);
00245                 if(res == kSkipFile)
00246                     continue;
00247                 if(res != kContinueTraversal)
00248                     goto abort;
00249             }
00250 #endif /* S_ISLNK */
00251             else
00252             {
00253                 /* TODO : Unix devices */
00254                 errstr = "Error while accessing ";
00255                 errstr << fullname;
00256                 errstr << " (error " << errno << ')';
00257                 res = report.OnError(errstr, errno);
00258                 goto abort;
00259             }
00260         }
00261         else
00262         {
00263             errstr = "Error while accessing ";
00264             errstr << fullname;
00265             errstr << " (error " << errno << ')';
00266             res = report.OnError(errstr, errno);
00267             goto abort;
00268         }
00269     }
00270
00271     res = report.ExitDirectory(path);
00272
00273 abort:
00274     closedir (dirp);
00275 exit:
00276     if(0L != szOriginalPath)
00277     {
00278 #if !TARGET_RT_MAC_CFM
00279         chdir(szOriginalPath);
00280 #endif
00281         free(szOriginalPath);
00282         szOriginalPath = NULL;
00283     }
00284
00285 #if defined(WIN32)
00286     SetWinCvsDebugMask(dbg_mask);
00287 #endif  // defined(WIN32)
00288
00289     return res;
00290 }
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/FileTraversal.h Source File

common/FileTraversal.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 1998
00019  */
00020
00021 /*
00022  * FileTraversal.h : class to traverse a file hierarchy
00023  */
00024
00025 #if !defined(AFX_FILETRAVERSAL_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
00026 #define AFX_FILETRAVERSAL_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif // _MSC_VER >= 1000
00031
00032 #include "TextBinary.h"
00033
00034 #include <sys/stat.h>
00035
00036 #if !defined(S_ISDIR) && defined(S_IFDIR)
00037 #   if defined(S_IFMT)
00038 #       define  S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
00039 #   else
00040 #       define S_ISDIR(m) ((m) & S_IFDIR)
00041 #   endif
00042 #endif
00043
00044 #if !defined(S_ISREG) && defined(S_IFREG)
00045 #   if defined(S_IFMT)
00046 #       define  S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
00047 #   else
00048 #       define S_ISREG(m) ((m) & S_IFREG)
00049 #   endif
00050 #endif
00051
00052 #if !defined(S_ISLNK) && defined(S_IFLNK)
00053 #   if defined(S_IFMT)
00054 #       define  S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
00055 #   else
00056 #       define S_ISLNK(m) ((m) & S_IFLNK)
00057 #   endif
00058 #endif
00059
00060 #ifndef MAX_PATH
00061 #   ifdef PATH_MAX
00062 #       define MAX_PATH PATH_MAX
00063 #   else
00064 #       define MAX_PATH 5000
00065 #   endif
00066 #endif
00067
00068 #ifdef WIN32
00069 #   include "ndir.h"
00070 #   include <direct.h>
00071 #   define STRUCT_DIRENT struct direct
00072 #else /* !WIN32 */
00073 #   include <dirent.h>
00074 #   define STRUCT_DIRENT struct dirent
00075 #endif /* !WIN32 */
00076
00077 typedef enum
00078 {
00079     kContinueTraversal,
00080     kStopTraversal,
00081     kSkipFile,
00082     kTraversalError
00083 } kTraversal;
00084
00085 class TraversalReport
00086 {
00087 public:
00088     static bool gRunning;
00089         // says that a traversal is ongoing
00090
00091     virtual kTraversal EnterDirectory(const char *fullpath, const char *dirname, const UFSSpec * macspec)
00092     {
00093         return kContinueTraversal;
00094     }
00095
00096     virtual kTraversal ExitDirectory(const char *fullpath)
00097     {
00098         return kContinueTraversal;
00099     }
00100
00101     virtual kTraversal OnError(const char *err, int errcode)
00102     {
00103         return kTraversalError;
00104     }
00105
00106     virtual kTraversal OnIdle(const char *fullpath)
00107     {
00108         return kContinueTraversal;
00109     }
00110
00111     virtual kTraversal OnAnyDevice(const char *fullpath,
00112         const char *fullname,
00113         const char *name,
00114         const struct stat & dir, const UFSSpec * macspec)
00115     {
00116         return kContinueTraversal;
00117     }
00118
00119     virtual kTraversal OnDirectory(const char *fullpath,
00120         const char *fullname,
00121         const char *name,
00122         const struct stat & dir, const UFSSpec * macspec)
00123     {
00124         return OnAnyDevice(fullpath, fullname, name, dir, macspec);
00125     }
00126
00127     virtual kTraversal OnFile(const char *fullpath,
00128         const char *fullname,
00129         const char *name,
00130         const struct stat & dir, const UFSSpec * macspec)
00131     {
00132         return OnAnyDevice(fullpath, fullname, name, dir, macspec);
00133     }
00134
00135     virtual kTraversal OnAlias(const char *fullpath,
00136         const char *fullname,
00137         const char *name,
00138         const struct stat & dir, const UFSSpec * macspec)
00139     {
00140         return OnAnyDevice(fullpath, fullname, name, dir, macspec);
00141     }
00142 };
00143
00144 kTraversal FileTraverse(const char *path, TraversalReport & report, const UFSSpec * macDirSpec = 0L);
00145
00146 #endif // !defined(AFX_FILETRAVERSAL_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/fnmatch.c Source File

common/fnmatch.c

Go to the documentation of this file.
00001 /* Copyright (C) 1992 Free Software Foundation, Inc.
00002 This file is part of the GNU C Library.
00003
00004 The GNU C Library is free software; you can redistribute it and/or
00005 modify it under the terms of the GNU Library General Public License as
00006 published by the Free Software Foundation; either version 2 of the
00007 License, or (at your option) any later version.
00008
00009 The GNU C Library is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 Library General Public License for more details.  */
00013
00014 /* Modified slightly by Brian Berliner <berliner@sun.com> and
00015    Jim Blandy <jimb@cyclic.com> for CVS use */
00016
00017 /*
00018  * Modified for WinCvs/MacCVS : Alexandre Parenteau <aubonbeurre@hotmail.com> --- June 1998
00019  */
00020
00021 #ifdef HAVE_CONFIG_H
00022 #include "config.h"
00023 #endif
00024
00025 /* IGNORE(@ */
00026 /* #include <ansidecl.h> */
00027 /* @) */
00028 #include <errno.h>
00029 #include "fnmatch.h"
00030 #ifdef macintosh
00031 #   define not notnot
00032 #endif /* macintosh */
00033
00034 /* Some file systems are case-insensitive.  If FOLD_FN_CHAR is
00035    #defined, it maps the character C onto its "canonical" form.  In a
00036    case-insensitive system, it would map all alphanumeric characters
00037    to lower case.  Under Windows NT, / and \ are both path component
00038    separators, so FOLD_FN_CHAR would map them both to /.  */
00039 #ifndef FOLD_FN_CHAR
00040 #define FOLD_FN_CHAR(c) (c)
00041 #endif
00042
00043 #if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS) && !defined(WIN32) && !defined(macintosh)
00044 extern int errno;
00045 #endif
00046
00047 /* Match STRING against the filename pattern PATTERN, returning zero if
00048    it matches, nonzero if not.  */
00049 int
00050 #if __STDC__
00051 fnmatch (const char *pattern, const char *string, int flags)
00052 #else
00053 fnmatch (pattern, string, flags)
00054     char *pattern;
00055     char *string;
00056     int flags;
00057 #endif
00058 {
00059   register const char *p = pattern, *n = string;
00060   register char c;
00061
00062   if ((flags & ~__FNM_FLAGS) != 0)
00063     {
00064       errno = EINVAL;
00065       return -1;
00066     }
00067
00068   while ((c = *p++) != '\0')
00069     {
00070       switch (c)
00071     {
00072     case '?':
00073       if (*n == '\0')
00074         return FNM_NOMATCH;
00075       else if ((flags & FNM_PATHNAME) && *n == '/')
00076         return FNM_NOMATCH;
00077       else if ((flags & FNM_PERIOD) && *n == '.' &&
00078            (n == string || ((flags & FNM_PATHNAME) && n[-1] == '/')))
00079         return FNM_NOMATCH;
00080       break;
00081
00082     case '\\':
00083       if (!(flags & FNM_NOESCAPE))
00084         c = *p++;
00085       if (*n != c)
00086         return FNM_NOMATCH;
00087       break;
00088
00089     case '*':
00090       if ((flags & FNM_PERIOD) && *n == '.' &&
00091           (n == string || ((flags & FNM_PATHNAME) && n[-1] == '/')))
00092         return FNM_NOMATCH;
00093
00094       for (c = *p++; c == '?' || c == '*'; c = *p++, ++n)
00095         if (((flags & FNM_PATHNAME) && *n == '/') ||
00096         (c == '?' && *n == '\0'))
00097           return FNM_NOMATCH;
00098
00099       if (c == '\0')
00100         return 0;
00101
00102       {
00103         char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
00104         for (--p; *n != '\0'; ++n)
00105           if ((c == '[' || *n == c1) &&
00106           fnmatch(p, n, flags & ~FNM_PERIOD) == 0)
00107         return 0;
00108         return FNM_NOMATCH;
00109       }
00110
00111     case '[':
00112       {
00113         /* Nonzero if the sense of the character class is inverted.  */
00114         register int not;
00115
00116         if (*n == '\0')
00117           return FNM_NOMATCH;
00118
00119         if ((flags & FNM_PERIOD) && *n == '.' &&
00120         (n == string || ((flags & FNM_PATHNAME) && n[-1] == '/')))
00121           return FNM_NOMATCH;
00122
00123         not = (*p == '!' || *p == '^');
00124         if (not)
00125           ++p;
00126
00127         c = *p++;
00128         for (;;)
00129           {
00130         register char cstart = c, cend = c;
00131
00132         if (!(flags & FNM_NOESCAPE) && c == '\\')
00133           cstart = cend = *p++;
00134
00135         if (c == '\0')
00136           /* [ (unterminated) loses.  */
00137           return FNM_NOMATCH;
00138
00139         c = *p++;
00140
00141         if ((flags & FNM_PATHNAME) && c == '/')
00142           /* [/] can never match.  */
00143           return FNM_NOMATCH;
00144
00145         if (c == '-' && *p != ']')
00146           {
00147             cend = *p++;
00148             if (!(flags & FNM_NOESCAPE) && cend == '\\')
00149               cend = *p++;
00150             if (cend == '\0')
00151               return FNM_NOMATCH;
00152             c = *p++;
00153           }
00154
00155         if (*n >= cstart && *n <= cend)
00156           goto matched;
00157
00158         if (c == ']')
00159           break;
00160           }
00161         if (!not)
00162           return FNM_NOMATCH;
00163         break;
00164
00165       matched:;
00166         /* Skip the rest of the [...] that already matched.  */
00167         while (c != ']')
00168           {
00169         if (c == '\0')
00170           /* [... (unterminated) loses.  */
00171           return FNM_NOMATCH;
00172
00173         c = *p++;
00174         if (!(flags & FNM_NOESCAPE) && c == '\\')
00175           /* 1003.2d11 is unclear if this is right.  %%% */
00176           ++p;
00177           }
00178         if (not)
00179           return FNM_NOMATCH;
00180       }
00181       break;
00182
00183     default:
00184       if (FOLD_FN_CHAR (c) != FOLD_FN_CHAR (*n))
00185         return FNM_NOMATCH;
00186     }
00187
00188       ++n;
00189     }
00190
00191   if (*n == '\0')
00192     return 0;
00193
00194   return FNM_NOMATCH;
00195 }
00196
00197 #if defined (__CYGWIN32__) || defined (WIN32)
00198 #if 0
00199 main ()
00200 {
00201   int c;
00202
00203   for (c = 0; c < 256; c++)
00204     {
00205       int t;
00206
00207       if (c == '\\')
00208         t = '/';
00209       else
00210         t = tolower (c);
00211
00212       if ((c & 0x7) == 0x0)
00213          printf ("    ");
00214       printf ("0x%02x,", t);
00215       if ((c & 0x7) == 0x7)
00216          putchar ('\n');
00217       else if ((c & 0x7) == 0x3)
00218          putchar (' ');
00219     }
00220 }
00221 #endif
00222
00223 unsigned char
00224 WNT_filename_classes[] =
00225 {
00226     0x00,0x01,0x02,0x03, 0x04,0x05,0x06,0x07,
00227     0x08,0x09,0x0a,0x0b, 0x0c,0x0d,0x0e,0x0f,
00228     0x10,0x11,0x12,0x13, 0x14,0x15,0x16,0x17,
00229     0x18,0x19,0x1a,0x1b, 0x1c,0x1d,0x1e,0x1f,
00230     0x20,0x21,0x22,0x23, 0x24,0x25,0x26,0x27,
00231     0x28,0x29,0x2a,0x2b, 0x2c,0x2d,0x2e,0x2f,
00232     0x30,0x31,0x32,0x33, 0x34,0x35,0x36,0x37,
00233     0x38,0x39,0x3a,0x3b, 0x3c,0x3d,0x3e,0x3f,
00234     0x40,0x61,0x62,0x63, 0x64,0x65,0x66,0x67,
00235     0x68,0x69,0x6a,0x6b, 0x6c,0x6d,0x6e,0x6f,
00236     0x70,0x71,0x72,0x73, 0x74,0x75,0x76,0x77,
00237     0x78,0x79,0x7a,0x5b, 0x2f,0x5d,0x5e,0x5f,
00238     0x60,0x61,0x62,0x63, 0x64,0x65,0x66,0x67,
00239     0x68,0x69,0x6a,0x6b, 0x6c,0x6d,0x6e,0x6f,
00240     0x70,0x71,0x72,0x73, 0x74,0x75,0x76,0x77,
00241     0x78,0x79,0x7a,0x7b, 0x7c,0x7d,0x7e,0x7f,
00242     0x80,0x81,0x82,0x83, 0x84,0x85,0x86,0x87,
00243     0x88,0x89,0x8a,0x8b, 0x8c,0x8d,0x8e,0x8f,
00244     0x90,0x91,0x92,0x93, 0x94,0x95,0x96,0x97,
00245     0x98,0x99,0x9a,0x9b, 0x9c,0x9d,0x9e,0x9f,
00246     0xa0,0xa1,0xa2,0xa3, 0xa4,0xa5,0xa6,0xa7,
00247     0xa8,0xa9,0xaa,0xab, 0xac,0xad,0xae,0xaf,
00248     0xb0,0xb1,0xb2,0xb3, 0xb4,0xb5,0xb6,0xb7,
00249     0xb8,0xb9,0xba,0xbb, 0xbc,0xbd,0xbe,0xbf,
00250     0xc0,0xc1,0xc2,0xc3, 0xc4,0xc5,0xc6,0xc7,
00251     0xc8,0xc9,0xca,0xcb, 0xcc,0xcd,0xce,0xcf,
00252     0xd0,0xd1,0xd2,0xd3, 0xd4,0xd5,0xd6,0xd7,
00253     0xd8,0xd9,0xda,0xdb, 0xdc,0xdd,0xde,0xdf,
00254     0xe0,0xe1,0xe2,0xe3, 0xe4,0xe5,0xe6,0xe7,
00255     0xe8,0xe9,0xea,0xeb, 0xec,0xed,0xee,0xef,
00256     0xf0,0xf1,0xf2,0xf3, 0xf4,0xf5,0xf6,0xf7,
00257     0xf8,0xf9,0xfa,0xfb, 0xfc,0xfd,0xfe,0xff,
00258 };
00259 #endif /* (__CYGWIN32__) || defined (WIN32) */
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/fnmatch.h Source File

common/fnmatch.h

Go to the documentation of this file.
00001 /* Copyright (C) 1992 Free Software Foundation, Inc.
00002 This file is part of the GNU C Library.
00003
00004 The GNU C Library is free software; you can redistribute it and/or
00005 modify it under the terms of the GNU Library General Public License as
00006 published by the Free Software Foundation; either version 2 of the
00007 License, or (at your option) any later version.
00008
00009 The GNU C Library is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 Library General Public License for more details.  */
00013
00014 /*
00015  * Modified for WinCvs/MacCVS : Alexandre Parenteau <aubonbeurre@hotmail.com> --- June 1998
00016  */
00017
00018 #ifndef _FNMATCH_H
00019
00020 #define _FNMATCH_H  1
00021
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025
00026 /* Bits set in the FLAGS argument to `fnmatch'.  */
00027 #undef FNM_PATHNAME
00028 #define FNM_PATHNAME    (1 << 0)/* No wildcard can ever match `/'.  */
00029 #undef FNM_NOESCAPE
00030 #define FNM_NOESCAPE    (1 << 1)/* Backslashes don't quote special chars.  */
00031 #undef FNM_PERIOD
00032 #define FNM_PERIOD  (1 << 2)/* Leading `.' is matched only explicitly.  */
00033 #undef __FNM_FLAGS
00034 #define __FNM_FLAGS (FNM_PATHNAME|FNM_NOESCAPE|FNM_PERIOD)
00035
00036 /* Value returned by `fnmatch' if STRING does not match PATTERN.  */
00037 #undef FNM_NOMATCH
00038 #define FNM_NOMATCH 1
00039
00040 #if !defined(__STDC__) && (defined(WIN32)|| defined(macintosh))
00041 #   define __STDC__ 1
00042 #endif
00043
00044 /* Match STRING against the filename pattern PATTERN,
00045    returning zero if it matches, FNM_NOMATCH if not.  */
00046 #if __STDC__
00047 extern int fnmatch (const char *pattern, const char *string, int flags);
00048 #else
00049 extern int fnmatch ();
00050 #endif
00051
00052 #if defined (__CYGWIN32__) || defined (WIN32)
00053     /* Under Windows NT, filenames are case-insensitive, and both / and \
00054        are path component separators.  */
00055
00056 #   define FOLD_FN_CHAR(c) (WNT_filename_classes[(unsigned char) (c)])
00057     extern unsigned char WNT_filename_classes[];
00058 #endif /* defined (__CYGWIN32__) || defined (WIN32) */
00059
00060 #ifdef __cplusplus
00061 }
00062 #endif
00063
00064 #endif  /* fnmatch.h */
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/getline.c Source File

common/getline.c

Go to the documentation of this file.
00001 /* getline.c -- Replacement for GNU C library function getline
00002
00003 Copyright (C) 1993 Free Software Foundation, Inc.
00004
00005 This program is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU General Public License as
00007 published by the Free Software Foundation; either version 2 of the
00008 License, or (at your option) any later version.
00009
00010 This program is distributed in the hope that it will be useful, but
00011 WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 General Public License for more details.  */
00014
00015 /* Written by Jan Brittenson, bson@gnu.ai.mit.edu.  */
00016
00017 /*
00018  * Modified for WinCvs/MacCVS : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 1998
00019  */
00020
00021 #ifdef HAVE_CONFIG_H
00022 #include <config.h>
00023 #endif
00024
00025 #include <sys/types.h>
00026
00027 #include <stdio.h>
00028 #include <assert.h>
00029 #include <errno.h>
00030
00031 #if STDC_HEADERS || defined(WIN32) || defined(macintosh)
00032 #include <stdlib.h>
00033 #else
00034 char *malloc (), *realloc ();
00035 #endif
00036
00037 #include "getline.h"
00038
00039 /* Always add at least this many bytes when extending the buffer.  */
00040 #define MIN_CHUNK 64
00041
00042 /* Read up to (and including) a TERMINATOR from STREAM into *LINEPTR
00043    + OFFSET (and null-terminate it). *LINEPTR is a pointer returned from
00044    malloc (or NULL), pointing to *N characters of space.  It is realloc'd
00045    as necessary.  Return the number of characters read (not including the
00046    null terminator), or -1 on error or EOF.  On a -1 return, the caller
00047    should check feof(), if not then errno has been set to indicate
00048    the error.  */
00049
00050 int
00051 getstr (char **lineptr, size_t *n, FILE *stream, char terminator, int offset)
00052 {
00053   int nchars_avail;     /* Allocated but unused chars in *LINEPTR.  */
00054   char *read_pos;       /* Where we're reading into *LINEPTR. */
00055   int ret;
00056
00057   if (!lineptr || !n || !stream)
00058     {
00059       errno = EINVAL;
00060       return -1;
00061     }
00062
00063   if (!*lineptr)
00064     {
00065       *n = MIN_CHUNK;
00066       *lineptr = (char *)malloc (*n);
00067       if (!*lineptr)
00068     {
00069       errno = ENOMEM;
00070       return -1;
00071     }
00072     }
00073
00074   nchars_avail = *n - offset;
00075   read_pos = *lineptr + offset;
00076
00077   for (;;)
00078     {
00079       int save_errno;
00080       register int c = getc (stream);
00081
00082       save_errno = errno;
00083
00084       /* We always want at least one char left in the buffer, since we
00085      always (unless we get an error while reading the first char)
00086      NUL-terminate the line buffer.  */
00087
00088       assert((*lineptr + *n) == (read_pos + nchars_avail));
00089       if (nchars_avail < 2)
00090     {
00091       if (*n > MIN_CHUNK)
00092         *n *= 2;
00093       else
00094         *n += MIN_CHUNK;
00095
00096       nchars_avail = *n + *lineptr - read_pos;
00097       *lineptr = (char *)realloc (*lineptr, *n);
00098       if (!*lineptr)
00099         {
00100           errno = ENOMEM;
00101           return -1;
00102         }
00103       read_pos = *n - nchars_avail + *lineptr;
00104       assert((*lineptr + *n) == (read_pos + nchars_avail));
00105     }
00106
00107       if (ferror (stream))
00108     {
00109       /* Might like to return partial line, but there is no
00110          place for us to store errno.  And we don't want to just
00111          lose errno.  */
00112       errno = save_errno;
00113       return -1;
00114     }
00115
00116       if (c == EOF)
00117     {
00118       /* Return partial line, if any.  */
00119       if (read_pos == *lineptr)
00120         return -1;
00121       else
00122         break;
00123     }
00124
00125 #ifdef macintosh
00126       if (terminator == '\n' && c == '\r')
00127     c = '\n';
00128 #endif
00129
00130       *read_pos++ = c;
00131       nchars_avail--;
00132
00133       if (c == terminator)
00134     /* Return the line.  */
00135     break;
00136    }
00137
00138   /* Done - NUL terminate and return the number of chars read.  */
00139   *read_pos = '\0';
00140
00141   ret = read_pos - (*lineptr + offset);
00142   return ret;
00143 }
00144
00145 int
00146 getline (char **lineptr, size_t *n, FILE *stream)
00147 {
00148   return getstr (lineptr, n, stream, '\n', 0);
00149 }
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/getline.h Source File

common/getline.h

Go to the documentation of this file.
00001 /* getline.c -- Replacement for GNU C library function getline
00002
00003 Copyright (C) 1993 Free Software Foundation, Inc.
00004
00005 This program is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU General Public License as
00007 published by the Free Software Foundation; either version 2 of the
00008 License, or (at your option) any later version.
00009
00010 This program is distributed in the hope that it will be useful, but
00011 WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 General Public License for more details.  */
00014
00015 /* Written by Jan Brittenson, bson@gnu.ai.mit.edu.  */
00016
00017 /*
00018  * Modified for WinCvs/MacCVS : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 1998
00019  */
00020
00021 #ifndef _getline_h_
00022 #define _getline_h_ 1
00023
00024 #include <stdio.h>
00025
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029
00030 #if defined (__GNUC__) || (defined (__STDC__) && __STDC__) || defined(__cplusplus)
00031 #define __PROTO(args) args
00032 #else
00033 #define __PROTO(args) ()
00034 #endif  /* GCC.  */
00035
00036 int
00037   getline __PROTO ((char **_lineptr, size_t *_n, FILE *_stream));
00038 int
00039   getstr __PROTO ((char **_lineptr, size_t *_n, FILE *_stream,
00040            char _terminator, int _offset));
00041
00042 #ifdef __cplusplus
00043 }
00044 #endif
00045
00046 #endif /* _getline_h_ */
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/getopt.c Source File

common/getopt.c

Go to the documentation of this file.
00001 /* Getopt for GNU.
00002    NOTE: getopt is now part of the C library, so if you don't know what
00003    "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
00004    before changing it!
00005
00006    Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94
00007     Free Software Foundation, Inc.
00008
00009    This program is free software; you can redistribute it and/or modify it
00010    under the terms of the GNU General Public License as published by the
00011    Free Software Foundation; either version 2, or (at your option) any
00012    later version.
00013
00014    This program is distributed in the hope that it will be useful,
00015    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017    GNU General Public License for more details.  */
00018
00019 /*
00020  * Modified for WinCvs/MacCVS : Alexandre Parenteau <aubonbeurre@hotmail.com> --- August 1998
00021  */
00022 /* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
00023    Ditto for AIX 3.2 and <stdlib.h>.  */
00024 #ifndef _NO_PROTO
00025 #define _NO_PROTO
00026 #endif
00027
00028 #ifdef HAVE_CONFIG_H
00029 #if defined (emacs) || defined (CONFIG_BROKETS)
00030 /* We use <config.h> instead of "config.h" so that a compilation
00031    using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
00032    (which it would do because it found this file in $srcdir).  */
00033 #include <config.h>
00034 #else
00035 #include "config.h"
00036 #endif
00037 #endif
00038
00039 #ifndef __STDC__
00040 /* This is a separate conditional since some stdc systems
00041    reject `defined (const)'.  */
00042 #ifndef const
00043 #define const
00044 #endif
00045 #endif
00046
00047 #include <stdio.h>
00048
00049 #ifdef HAVE_STRING_H
00050 #include <string.h>
00051 #endif
00052
00053 #if defined(macintosh) || defined(WIN32)
00054 #include <stdlib.h>
00055 #endif /* macintosh || WIN32 */
00056
00057 /* Comment out all this code if we are using the GNU C Library, and are not
00058    actually compiling the library itself.  This code is part of the GNU C
00059    Library, but also included in many other GNU distributions.  Compiling
00060    and linking in this code is a waste when using the GNU C library
00061    (especially if it is a shared library).  Rather than having every GNU
00062    program understand `configure --with-gnu-libc' and omit the object files,
00063    it is simpler to just do this in the source for each such file.  */
00064
00065 #if defined (_LIBC) || !defined (__GNU_LIBRARY__)
00066
00067
00068 /* This needs to come after some library #include
00069    to get __GNU_LIBRARY__ defined.  */
00070 #ifdef  __GNU_LIBRARY__
00071 /* Don't include stdlib.h for non-GNU C libraries because some of them
00072    contain conflicting prototypes for getopt.  */
00073 #include <stdlib.h>
00074 #endif  /* GNU C library.  */
00075
00076 /* This version of `getopt' appears to the caller like standard Unix `getopt'
00077    but it behaves differently for the user, since it allows the user
00078    to intersperse the options with the other arguments.
00079
00080    As `getopt' works, it permutes the elements of ARGV so that,
00081    when it is done, all the options precede everything else.  Thus
00082    all application programs are extended to handle flexible argument order.
00083
00084    Setting the environment variable POSIXLY_CORRECT disables permutation.
00085    Then the behavior is completely standard.
00086
00087    GNU application programs can use a third alternative mode in which
00088    they can distinguish the relative order of options and other arguments.  */
00089
00090 #include "getopt.h"
00091
00092 /* For communication from `getopt' to the caller.
00093    When `getopt' finds an option that takes an argument,
00094    the argument value is returned here.
00095    Also, when `ordering' is RETURN_IN_ORDER,
00096    each non-option ARGV-element is returned here.  */
00097
00098 char *optarg = NULL;
00099
00100 /* Index in ARGV of the next element to be scanned.
00101    This is used for communication to and from the caller
00102    and for communication between successive calls to `getopt'.
00103
00104    On entry to `getopt', zero means this is the first call; initialize.
00105
00106    When `getopt' returns EOF, this is the index of the first of the
00107    non-option elements that the caller should itself scan.
00108
00109    Otherwise, `optind' communicates from one call to the next
00110    how much of ARGV has been scanned so far.  */
00111
00112 /* XXX 1003.2 says this must be 1 before any call.  */
00113 int optind = 0;
00114
00115 /* The next char to be scanned in the option-element
00116    in which the last option character we returned was found.
00117    This allows us to pick up the scan where we left off.
00118
00119    If this is zero, or a null string, it means resume the scan
00120    by advancing to the next ARGV-element.  */
00121
00122 static char *nextchar;
00123
00124 /* Callers store zero here to inhibit the error message
00125    for unrecognized options.  */
00126
00127 int opterr = 1;
00128
00129 /* Set to an option character which was unrecognized.
00130    This must be initialized on some systems to avoid linking in the
00131    system's own getopt implementation.  */
00132
00133 int optopt = '?';
00134
00135 /* Describe how to deal with options that follow non-option ARGV-elements.
00136
00137    If the caller did not specify anything,
00138    the default is REQUIRE_ORDER if the environment variable
00139    POSIXLY_CORRECT is defined, PERMUTE otherwise.
00140
00141    REQUIRE_ORDER means don't recognize them as options;
00142    stop option processing when the first non-option is seen.
00143    This is what Unix does.
00144    This mode of operation is selected by either setting the environment
00145    variable POSIXLY_CORRECT, or using `+' as the first character
00146    of the list of option characters.
00147
00148    PERMUTE is the default.  We permute the contents of ARGV as we scan,
00149    so that eventually all the non-options are at the end.  This allows options
00150    to be given in any order, even with programs that were not written to
00151    expect this.
00152
00153    RETURN_IN_ORDER is an option available to programs that were written
00154    to expect options and other ARGV-elements in any order and that care about
00155    the ordering of the two.  We describe each non-option ARGV-element
00156    as if it were the argument of an option with character code 1.
00157    Using `-' as the first character of the list of option characters
00158    selects this mode of operation.
00159
00160    The special argument `--' forces an end of option-scanning regardless
00161    of the value of `ordering'.  In the case of RETURN_IN_ORDER, only
00162    `--' can cause `getopt' to return EOF with `optind' != ARGC.  */
00163
00164 static enum
00165 {
00166   REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
00167 } ordering;
00168
00169 /* Value of POSIXLY_CORRECT environment variable.  */
00170 static char *posixly_correct;
00171
00172 #ifdef  __GNU_LIBRARY__
00173 /* We want to avoid inclusion of string.h with non-GNU libraries
00174    because there are many ways it can cause trouble.
00175    On some systems, it contains special magic macros that don't work
00176    in GCC.  */
00177 #include <string.h>
00178 #define my_index    strchr
00179 #else
00180
00181 /* Avoid depending on library functions or files
00182    whose names are inconsistent.  */
00183
00184 #ifndef macintosh
00185 char *getenv ();
00186 #endif /* !macintosh */
00187
00188 #ifndef __STDC__
00189 static char *
00190 my_index (str, chr)
00191      const char *str;
00192      int chr;
00193 #else /* __STDC__ */
00194 static char *
00195 my_index (const char *str, int chr)
00196 #endif /* __STDC__ */
00197 {
00198   while (*str)
00199     {
00200       if (*str == chr)
00201     return (char *) str;
00202       str++;
00203     }
00204   return 0;
00205 }
00206
00207 /* If using GCC, we can safely declare strlen this way.
00208    If not using GCC, it is ok not to declare it.  */
00209 #ifdef __GNUC__
00210 /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
00211    That was relevant to code that was here before.  */
00212 #ifndef __STDC__
00213 /* gcc with -traditional declares the built-in strlen to return int,
00214    and has done so at least since version 2.4.5. -- rms.  */
00215 extern int strlen (const char *);
00216 #endif /* not __STDC__ */
00217 #endif /* __GNUC__ */
00218
00219 #endif /* not __GNU_LIBRARY__ */
00220
00221 /* Handle permutation of arguments.  */
00222
00223 /* Describe the part of ARGV that contains non-options that have
00224    been skipped.  `first_nonopt' is the index in ARGV of the first of them;
00225    `last_nonopt' is the index after the last of them.  */
00226
00227 static int first_nonopt;
00228 static int last_nonopt;
00229
00230 /* Exchange two adjacent subsequences of ARGV.
00231    One subsequence is elements [first_nonopt,last_nonopt)
00232    which contains all the non-options that have been skipped so far.
00233    The other is elements [last_nonopt,optind), which contains all
00234    the options processed since those non-options were skipped.
00235
00236    `first_nonopt' and `last_nonopt' are relocated so that they describe
00237    the new indices of the non-options in ARGV after they are moved.  */
00238
00239 #ifndef __STDC__
00240 static void
00241 exchange (argv)
00242      char **argv;
00243 #else /* __STDC__ */
00244 static void
00245 exchange (char **argv)
00246 #endif /* __STDC__ */
00247 {
00248   int bottom = first_nonopt;
00249   int middle = last_nonopt;
00250   int top = optind;
00251   char *tem;
00252
00253   /* Exchange the shorter segment with the far end of the longer segment.
00254      That puts the shorter segment into the right place.
00255      It leaves the longer segment in the right place overall,
00256      but it consists of two parts that need to be swapped next.  */
00257
00258   while (top > middle && middle > bottom)
00259     {
00260       if (top - middle > middle - bottom)
00261     {
00262       /* Bottom segment is the short one.  */
00263       int len = middle - bottom;
00264       register int i;
00265
00266       /* Swap it with the top part of the top segment.  */
00267       for (i = 0; i < len; i++)
00268         {
00269           tem = argv[bottom + i];
00270           argv[bottom + i] = argv[top - (middle - bottom) + i];
00271           argv[top - (middle - bottom) + i] = tem;
00272         }
00273       /* Exclude the moved bottom segment from further swapping.  */
00274       top -= len;
00275     }
00276       else
00277     {
00278       /* Top segment is the short one.  */
00279       int len = top - middle;
00280       register int i;
00281
00282       /* Swap it with the bottom part of the bottom segment.  */
00283       for (i = 0; i < len; i++)
00284         {
00285           tem = argv[bottom + i];
00286           argv[bottom + i] = argv[middle + i];
00287           argv[middle + i] = tem;
00288         }
00289       /* Exclude the moved top segment from further swapping.  */
00290       bottom += len;
00291     }
00292     }
00293
00294   /* Update records for the slots the non-options now occupy.  */
00295
00296   first_nonopt += (optind - last_nonopt);
00297   last_nonopt = optind;
00298 }
00299
00300 /* Initialize the internal data when the first call is made.  */
00301
00302 #ifndef __STDC__
00303 static const char *
00304 _getopt_initialize (optstring)
00305      const char *optstring;
00306 #else /* __STDC__ */
00307 static const char *
00308 _getopt_initialize (const char *optstring)
00309 #endif /* __STDC__ */
00310 {
00311   /* Start processing options with ARGV-element 1 (since ARGV-element 0
00312      is the program name); the sequence of previously skipped
00313      non-option ARGV-elements is empty.  */
00314
00315   first_nonopt = last_nonopt = optind = 1;
00316
00317   nextchar = NULL;
00318
00319   posixly_correct = getenv ("POSIXLY_CORRECT");
00320
00321   /* Determine how to handle the ordering of options and nonoptions.  */
00322
00323   if (optstring[0] == '-')
00324     {
00325       ordering = RETURN_IN_ORDER;
00326       ++optstring;
00327     }
00328   else if (optstring[0] == '+')
00329     {
00330       ordering = REQUIRE_ORDER;
00331       ++optstring;
00332     }
00333   else if (posixly_correct != NULL)
00334     ordering = REQUIRE_ORDER;
00335   else
00336     ordering = PERMUTE;
00337
00338   return optstring;
00339 }
00340
00341 /* Scan elements of ARGV (whose length is ARGC) for option characters
00342    given in OPTSTRING.
00343
00344    If an element of ARGV starts with '-', and is not exactly "-" or "--",
00345    then it is an option element.  The characters of this element
00346    (aside from the initial '-') are option characters.  If `getopt'
00347    is called repeatedly, it returns successively each of the option characters
00348    from each of the option elements.
00349
00350    If `getopt' finds another option character, it returns that character,
00351    updating `optind' and `nextchar' so that the next call to `getopt' can
00352    resume the scan with the following option character or ARGV-element.
00353
00354    If there are no more option characters, `getopt' returns `EOF'.
00355    Then `optind' is the index in ARGV of the first ARGV-element
00356    that is not an option.  (The ARGV-elements have been permuted
00357    so that those that are not options now come last.)
00358
00359    OPTSTRING is a string containing the legitimate option characters.
00360    If an option character is seen that is not listed in OPTSTRING,
00361    return '?' after printing an error message.  If you set `opterr' to
00362    zero, the error message is suppressed but we still return '?'.
00363
00364    If a char in OPTSTRING is followed by a colon, that means it wants an arg,
00365    so the following text in the same ARGV-element, or the text of the following
00366    ARGV-element, is returned in `optarg'.  Two colons mean an option that
00367    wants an optional arg; if there is text in the current ARGV-element,
00368    it is returned in `optarg', otherwise `optarg' is set to zero.
00369
00370    If OPTSTRING starts with `-' or `+', it requests different methods of
00371    handling the non-option ARGV-elements.
00372    See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
00373
00374    Long-named options begin with `--' instead of `-'.
00375    Their names may be abbreviated as long as the abbreviation is unique
00376    or is an exact match for some defined option.  If they have an
00377    argument, it follows the option name in the same ARGV-element, separated
00378    from the option name by a `=', or else the in next ARGV-element.
00379    When `getopt' finds a long-named option, it returns 0 if that option's
00380    `flag' field is nonzero, the value of the option's `val' field
00381    if the `flag' field is zero.
00382
00383    The elements of ARGV aren't really const, because we permute them.
00384    But we pretend they're const in the prototype to be compatible
00385    with other systems.
00386
00387    LONGOPTS is a vector of `struct option' terminated by an
00388    element containing a name which is zero.
00389
00390    LONGIND returns the index in LONGOPT of the long-named option found.
00391    It is only valid when a long-named option has been found by the most
00392    recent call.
00393
00394    If LONG_ONLY is nonzero, '-' as well as '--' can introduce
00395    long-named options.  */
00396
00397 #ifndef __STDC__
00398 int
00399 _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
00400      int argc;
00401      char *const *argv;
00402      const char *optstring;
00403      const struct option *longopts;
00404      int *longind;
00405      int long_only;
00406 #else /* __STDC__ */
00407 int
00408 _getopt_internal (int argc, char *const *argv, const char *optstring,
00409      const struct option *longopts, int *longind, int long_only)
00410 #endif /* __STDC__ */
00411 {
00412   optarg = NULL;
00413
00414   if (optind == 0)
00415     optstring = _getopt_initialize (optstring);
00416
00417   if (nextchar == NULL || *nextchar == '\0')
00418     {
00419       /* Advance to the next ARGV-element.  */
00420
00421       if (ordering == PERMUTE)
00422     {
00423       /* If we have just processed some options following some non-options,
00424          exchange them so that the options come first.  */
00425
00426       if (first_nonopt != last_nonopt && last_nonopt != optind)
00427         exchange ((char **) argv);
00428       else if (last_nonopt != optind)
00429         first_nonopt = optind;
00430
00431       /* Skip any additional non-options
00432          and extend the range of non-options previously skipped.  */
00433
00434       while (optind < argc
00435          && (argv[optind][0] != '-' || argv[optind][1] == '\0'))
00436         optind++;
00437       last_nonopt = optind;
00438     }
00439
00440       /* The special ARGV-element `--' means premature end of options.
00441      Skip it like a null option,
00442      then exchange with previous non-options as if it were an option,
00443      then skip everything else like a non-option.  */
00444
00445       if (optind != argc && !strcmp (argv[optind], "--"))
00446     {
00447       optind++;
00448
00449       if (first_nonopt != last_nonopt && last_nonopt != optind)
00450         exchange ((char **) argv);
00451       else if (first_nonopt == last_nonopt)
00452         first_nonopt = optind;
00453       last_nonopt = argc;
00454
00455       optind = argc;
00456     }
00457
00458       /* If we have done all the ARGV-elements, stop the scan
00459      and back over any non-options that we skipped and permuted.  */
00460
00461       if (optind == argc)
00462     {
00463       /* Set the next-arg-index to point at the non-options
00464          that we previously skipped, so the caller will digest them.  */
00465       if (first_nonopt != last_nonopt)
00466         optind = first_nonopt;
00467       return EOF;
00468     }
00469
00470       /* If we have come to a non-option and did not permute it,
00471      either stop the scan or describe it to the caller and pass it by.  */
00472
00473       if ((argv[optind][0] != '-' || argv[optind][1] == '\0'))
00474     {
00475       if (ordering == REQUIRE_ORDER)
00476         return EOF;
00477       optarg = argv[optind++];
00478       return 1;
00479     }
00480
00481       /* We have found another option-ARGV-element.
00482      Skip the initial punctuation.  */
00483
00484       nextchar = (argv[optind] + 1
00485           + (longopts != NULL && argv[optind][1] == '-'));
00486     }
00487
00488   /* Decode the current option-ARGV-element.  */
00489
00490   /* Check whether the ARGV-element is a long option.
00491
00492      If long_only and the ARGV-element has the form "-f", where f is
00493      a valid short option, don't consider it an abbreviated form of
00494      a long option that starts with f.  Otherwise there would be no
00495      way to give the -f short option.
00496
00497      On the other hand, if there's a long option "fubar" and
00498      the ARGV-element is "-fu", do consider that an abbreviation of
00499      the long option, just like "--fu", and not "-f" with arg "u".
00500
00501      This distinction seems to be the most useful approach.  */
00502
00503   if (longopts != NULL
00504       && (argv[optind][1] == '-'
00505       || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
00506     {
00507       char *nameend;
00508       const struct option *p;
00509       const struct option *pfound = NULL;
00510       int exact = 0;
00511       int ambig = 0;
00512       int indfound;
00513       int option_index;
00514
00515       for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
00516     /* Do nothing.  */ ;
00517
00518       /* Test all long options for either exact match
00519      or abbreviated matches.  */
00520       for (p = longopts, option_index = 0; p->name; p++, option_index++)
00521     if (!strncmp (p->name, nextchar, nameend - nextchar))
00522       {
00523         if (nameend - nextchar == (int) strlen (p->name))
00524           {
00525         /* Exact match found.  */
00526         pfound = p;
00527         indfound = option_index;
00528         exact = 1;
00529         break;
00530           }
00531         else if (pfound == NULL)
00532           {
00533         /* First nonexact match found.  */
00534         pfound = p;
00535         indfound = option_index;
00536           }
00537         else
00538           /* Second or later nonexact match found.  */
00539           ambig = 1;
00540       }
00541
00542       if (ambig && !exact)
00543     {
00544       if (opterr)
00545         fprintf (stderr, "%s: option `%s' is ambiguous\n",
00546              argv[0], argv[optind]);
00547       nextchar += strlen (nextchar);
00548       optind++;
00549       return '?';
00550     }
00551
00552       if (pfound != NULL)
00553     {
00554       option_index = indfound;
00555       optind++;
00556       if (*nameend)
00557         {
00558           /* Don't test has_arg with >, because some C compilers don't
00559          allow it to be used on enums.  */
00560           if (pfound->has_arg)
00561         optarg = nameend + 1;
00562           else
00563         {
00564           if (opterr)
00565             {
00566               if (argv[optind - 1][1] == '-')
00567             /* --option */
00568             fprintf (stderr,
00569                  "%s: option `--%s' doesn't allow an argument\n",
00570                  argv[0], pfound->name);
00571               else
00572             /* +option or -option */
00573             fprintf (stderr,
00574                  "%s: option `%c%s' doesn't allow an argument\n",
00575                  argv[0], argv[optind - 1][0], pfound->name);
00576             }
00577           nextchar += strlen (nextchar);
00578           return '?';
00579         }
00580         }
00581       else if (pfound->has_arg == 1)
00582         {
00583           if (optind < argc)
00584         optarg = argv[optind++];
00585           else
00586         {
00587           if (opterr)
00588             fprintf (stderr, "%s: option `%s' requires an argument\n",
00589                  argv[0], argv[optind - 1]);
00590           nextchar += strlen (nextchar);
00591           return optstring[0] == ':' ? ':' : '?';
00592         }
00593         }
00594       nextchar += strlen (nextchar);
00595       if (longind != NULL)
00596         *longind = option_index;
00597       if (pfound->flag)
00598         {
00599           *(pfound->flag) = pfound->val;
00600           return 0;
00601         }
00602       return pfound->val;
00603     }
00604
00605       /* Can't find it as a long option.  If this is not getopt_long_only,
00606      or the option starts with '--' or is not a valid short
00607      option, then it's an error.
00608      Otherwise interpret it as a short option.  */
00609       if (!long_only || argv[optind][1] == '-'
00610       || my_index (optstring, *nextchar) == NULL)
00611     {
00612       if (opterr)
00613         {
00614           if (argv[optind][1] == '-')
00615         /* --option */
00616         fprintf (stderr, "%s: unrecognized option `--%s'\n",
00617              argv[0], nextchar);
00618           else
00619         /* +option or -option */
00620         fprintf (stderr, "%s: unrecognized option `%c%s'\n",
00621              argv[0], argv[optind][0], nextchar);
00622         }
00623       nextchar = (char *) "";
00624       optind++;
00625       return '?';
00626     }
00627     }
00628
00629   /* Look at and handle the next short option-character.  */
00630
00631   {
00632     char c = *nextchar++;
00633     char *temp = my_index (optstring, c);
00634
00635     /* Increment `optind' when we start to process its last character.  */
00636     if (*nextchar == '\0')
00637       ++optind;
00638
00639     if (temp == NULL || c == ':')
00640       {
00641     if (opterr)
00642       {
00643         if (posixly_correct)
00644           /* 1003.2 specifies the format of this message.  */
00645           fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c);
00646         else
00647           fprintf (stderr, "%s: invalid option -- %c\n", argv[0], c);
00648       }
00649     optopt = c;
00650     return '?';
00651       }
00652     if (temp[1] == ':')
00653       {
00654     if (temp[2] == ':')
00655       {
00656         /* This is an option that accepts an argument optionally.  */
00657         if (*nextchar != '\0')
00658           {
00659         optarg = nextchar;
00660         optind++;
00661           }
00662         else
00663           optarg = NULL;
00664         nextchar = NULL;
00665       }
00666     else
00667       {
00668         /* This is an option that requires an argument.  */
00669         if (*nextchar != '\0')
00670           {
00671         optarg = nextchar;
00672         /* If we end this ARGV-element by taking the rest as an arg,
00673            we must advance to the next element now.  */
00674         optind++;
00675           }
00676         else if (optind == argc)
00677           {
00678         if (opterr)
00679           {
00680             /* 1003.2 specifies the format of this message.  */
00681             fprintf (stderr, "%s: option requires an argument -- %c\n",
00682                  argv[0], c);
00683           }
00684         optopt = c;
00685         if (optstring[0] == ':')
00686           c = ':';
00687         else
00688           c = '?';
00689           }
00690         else
00691           /* We already incremented `optind' once;
00692          increment it again when taking next ARGV-elt as argument.  */
00693           optarg = argv[optind++];
00694         nextchar = NULL;
00695       }
00696       }
00697     return c;
00698   }
00699 }
00700
00701 #ifndef __STDC__
00702 int
00703 getopt (argc, argv, optstring)
00704      int argc;
00705      char *const *argv;
00706      const char *optstring;
00707 #else /* __STDC__ */
00708 int getopt (int argc, char *const *argv, const char *optstring)
00709 #endif /* __STDC__ */
00710 {
00711   return _getopt_internal (argc, argv, optstring,
00712                (const struct option *) 0,
00713                (int *) 0,
00714                0);
00715 }
00716
00717 #endif  /* _LIBC or not __GNU_LIBRARY__.  */
00718
00719 #ifdef TEST
00720
00721 /* Compile with -DTEST to make an executable for use in testing
00722    the above definition of `getopt'.  */
00723
00724 int
00725 main (argc, argv)
00726      int argc;
00727      char **argv;
00728 {
00729   int c;
00730   int digit_optind = 0;
00731
00732   while (1)
00733     {
00734       int this_option_optind = optind ? optind : 1;
00735
00736       c = getopt (argc, argv, "abc:d:0123456789");
00737       if (c == EOF)
00738     break;
00739
00740       switch (c)
00741     {
00742     case '0':
00743     case '1':
00744     case '2':
00745     case '3':
00746     case '4':
00747     case '5':
00748     case '6':
00749     case '7':
00750     case '8':
00751     case '9':
00752       if (digit_optind != 0 && digit_optind != this_option_optind)
00753         printf ("digits occur in two different argv-elements.\n");
00754       digit_optind = this_option_optind;
00755       printf ("option %c\n", c);
00756       break;
00757
00758     case 'a':
00759       printf ("option a\n");
00760       break;
00761
00762     case 'b':
00763       printf ("option b\n");
00764       break;
00765
00766     case 'c':
00767       printf ("option c with value `%s'\n", optarg);
00768       break;
00769
00770     case '?':
00771       break;
00772
00773     default:
00774       printf ("?? getopt returned character code 0%o ??\n", c);
00775     }
00776     }
00777
00778   if (optind < argc)
00779     {
00780       printf ("non-option ARGV-elements: ");
00781       while (optind < argc)
00782     printf ("%s ", argv[optind++]);
00783       printf ("\n");
00784     }
00785
00786   exit (0);
00787 }
00788
00789 #endif /* TEST */
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/getopt.h Source File

common/getopt.h

Go to the documentation of this file.
00001 /* Declarations for getopt.
00002    Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
00003
00004    This program is free software; you can redistribute it and/or modify it
00005    under the terms of the GNU General Public License as published by the
00006    Free Software Foundation; either version 2, or (at your option) any
00007    later version.
00008
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012    GNU General Public License for more details.  */
00013
00014 #ifndef _GETOPT_H
00015 #define _GETOPT_H 1
00016
00017 #ifdef  __cplusplus
00018 extern "C" {
00019 #endif
00020
00021 #if !defined(__STDC__) && (defined(macintosh) || defined(WIN32))
00022 #   define __STDC__ 1
00023 #   define __GNU_LIBRARY__ 1
00024 #   define _LIBC 1
00025 #endif
00026
00027 /* For communication from `getopt' to the caller.
00028    When `getopt' finds an option that takes an argument,
00029    the argument value is returned here.
00030    Also, when `ordering' is RETURN_IN_ORDER,
00031    each non-option ARGV-element is returned here.  */
00032
00033 extern char *optarg;
00034
00035 /* Index in ARGV of the next element to be scanned.
00036    This is used for communication to and from the caller
00037    and for communication between successive calls to `getopt'.
00038
00039    On entry to `getopt', zero means this is the first call; initialize.
00040
00041    When `getopt' returns EOF, this is the index of the first of the
00042    non-option elements that the caller should itself scan.
00043
00044    Otherwise, `optind' communicates from one call to the next
00045    how much of ARGV has been scanned so far.  */
00046
00047 extern int optind;
00048
00049 /* Callers store zero here to inhibit the error message `getopt' prints
00050    for unrecognized options.  */
00051
00052 extern int opterr;
00053
00054 /* Set to an option character which was unrecognized.  */
00055
00056 extern int optopt;
00057
00058 /* Describe the long-named options requested by the application.
00059    The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
00060    of `struct option' terminated by an element containing a name which is
00061    zero.
00062
00063    The field `has_arg' is:
00064    no_argument      (or 0) if the option does not take an argument,
00065    required_argument    (or 1) if the option requires an argument,
00066    optional_argument    (or 2) if the option takes an optional argument.
00067
00068    If the field `flag' is not NULL, it points to a variable that is set
00069    to the value given in the field `val' when the option is found, but
00070    left unchanged if the option is not found.
00071
00072    To have a long-named option do something other than set an `int' to
00073    a compiled-in constant, such as set a value from `optarg', set the
00074    option's `flag' field to zero and its `val' field to a nonzero
00075    value (the equivalent single-letter option character, if there is
00076    one).  For long options that have a zero `flag' field, `getopt'
00077    returns the contents of the `val' field.  */
00078
00079 struct option
00080 {
00081 #if __STDC__
00082   const char *name;
00083 #else
00084   char *name;
00085 #endif
00086   /* has_arg can't be an enum because some compilers complain about
00087      type mismatches in all the code that assumes it is an int.  */
00088   int has_arg;
00089   int *flag;
00090   int val;
00091 };
00092
00093 /* Names for the values of the `has_arg' field of `struct option'.  */
00094
00095 #define no_argument     0
00096 #define required_argument   1
00097 #define optional_argument   2
00098
00099 #if __STDC__
00100 #if defined(__GNU_LIBRARY__)
00101 /* Many other libraries have conflicting prototypes for getopt, with
00102    differences in the consts, in stdlib.h.  To avoid compilation
00103    errors, only prototype getopt for the GNU C library.  */
00104 extern int getopt (int argc, char *const *argv, const char *shortopts);
00105 #else /* not __GNU_LIBRARY__ */
00106 extern int getopt ();
00107 #endif /* not __GNU_LIBRARY__ */
00108 extern int getopt_long (int argc, char *const *argv, const char *shortopts,
00109                 const struct option *longopts, int *longind);
00110 extern int getopt_long_only (int argc, char *const *argv,
00111                  const char *shortopts,
00112                      const struct option *longopts, int *longind);
00113
00114 /* Internal only.  Users should not call this directly.  */
00115 extern int _getopt_internal (int argc, char *const *argv,
00116                  const char *shortopts,
00117                      const struct option *longopts, int *longind,
00118                  int long_only);
00119 #else /* not __STDC__ */
00120 extern int getopt ();
00121 extern int getopt_long ();
00122 extern int getopt_long_only ();
00123
00124 extern int _getopt_internal ();
00125 #endif /* not __STDC__ */
00126
00127 #ifdef  __cplusplus
00128 }
00129 #endif
00130
00131 #endif /* _GETOPT_H */
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/getopt1.c Source File

common/getopt1.c

Go to the documentation of this file.
00001 /* getopt_long and getopt_long_only entry points for GNU getopt.
00002    Copyright (C) 1987, 88, 89, 90, 91, 92, 1993
00003     Free Software Foundation, Inc.
00004
00005    This program is free software; you can redistribute it and/or modify it
00006    under the terms of the GNU General Public License as published by the
00007    Free Software Foundation; either version 2, or (at your option) any
00008    later version.
00009
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.  */
00014
00015 #ifdef HAVE_CONFIG_H
00016 #if defined (emacs) || defined (CONFIG_BROKETS)
00017 /* We use <config.h> instead of "config.h" so that a compilation
00018    using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
00019    (which it would do because it found this file in $srcdir).  */
00020 #include <config.h>
00021 #else
00022 #include "config.h"
00023 #endif
00024 #endif
00025
00026 #include "getopt.h"
00027
00028 #ifndef __STDC__
00029 /* This is a separate conditional since some stdc systems
00030    reject `defined (const)'.  */
00031 #ifndef const
00032 #define const
00033 #endif
00034 #endif
00035
00036 #include <stdio.h>
00037
00038 /* Comment out all this code if we are using the GNU C Library, and are not
00039    actually compiling the library itself.  This code is part of the GNU C
00040    Library, but also included in many other GNU distributions.  Compiling
00041    and linking in this code is a waste when using the GNU C library
00042    (especially if it is a shared library).  Rather than having every GNU
00043    program understand `configure --with-gnu-libc' and omit the object files,
00044    it is simpler to just do this in the source for each such file.  */
00045
00046 #if defined (_LIBC) || !defined (__GNU_LIBRARY__)
00047
00048
00049 /* This needs to come after some library #include
00050    to get __GNU_LIBRARY__ defined.  */
00051 #ifdef __GNU_LIBRARY__
00052 #include <stdlib.h>
00053 #else
00054 char *getenv ();
00055 #endif
00056
00057 #ifndef NULL
00058 #define NULL 0
00059 #endif
00060
00061 #ifndef __STDC__
00062 int
00063 getopt_long (argc, argv, options, long_options, opt_index)
00064      int argc;
00065      char *const *argv;
00066      const char *options;
00067      const struct option *long_options;
00068      int *opt_index;
00069 #else /* __STDC__ */
00070 int
00071 getopt_long (int argc, char *const *argv, const char *options,
00072      const struct option *long_options, int *opt_index)
00073 #endif /* __STDC__ */
00074 {
00075   return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
00076 }
00077
00078 /* Like getopt_long, but '-' as well as '--' can indicate a long option.
00079    If an option that starts with '-' (not '--') doesn't match a long option,
00080    but does match a short option, it is parsed as a short option
00081    instead.  */
00082
00083 #ifndef __STDC__
00084 int
00085 getopt_long_only (argc, argv, options, long_options, opt_index)
00086      int argc;
00087      char *const *argv;
00088      const char *options;
00089      const struct option *long_options;
00090      int *opt_index;
00091 #else /* __STDC__ */
00092 int
00093 getopt_long_only (int argc, char *const *argv, const char *options,
00094      const struct option *long_options, int *opt_index)
00095 #endif /* __STDC__ */
00096 {
00097   return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
00098 }
00099
00100
00101 #endif  /* _LIBC or not __GNU_LIBRARY__.  */
00102
00103 #ifdef TEST
00104
00105 #include <stdio.h>
00106
00107 int
00108 main (argc, argv)
00109      int argc;
00110      char **argv;
00111 {
00112   int c;
00113   int digit_optind = 0;
00114
00115   while (1)
00116     {
00117       int this_option_optind = optind ? optind : 1;
00118       int option_index = 0;
00119       static struct option long_options[] =
00120       {
00121     {"add", 1, 0, 0},
00122     {"append", 0, 0, 0},
00123     {"delete", 1, 0, 0},
00124     {"verbose", 0, 0, 0},
00125     {"create", 0, 0, 0},
00126     {"file", 1, 0, 0},
00127     {0, 0, 0, 0}
00128       };
00129
00130       c = getopt_long (argc, argv, "abc:d:0123456789",
00131                long_options, &option_index);
00132       if (c == EOF)
00133     break;
00134
00135       switch (c)
00136     {
00137     case 0:
00138       printf ("option %s", long_options[option_index].name);
00139       if (optarg)
00140         printf (" with arg %s", optarg);
00141       printf ("\n");
00142       break;
00143
00144     case '0':
00145     case '1':
00146     case '2':
00147     case '3':
00148     case '4':
00149     case '5':
00150     case '6':
00151     case '7':
00152     case '8':
00153     case '9':
00154       if (digit_optind != 0 && digit_optind != this_option_optind)
00155         printf ("digits occur in two different argv-elements.\n");
00156       digit_optind = this_option_optind;
00157       printf ("option %c\n", c);
00158       break;
00159
00160     case 'a':
00161       printf ("option a\n");
00162       break;
00163
00164     case 'b':
00165       printf ("option b\n");
00166       break;
00167
00168     case 'c':
00169       printf ("option c with value `%s'\n", optarg);
00170       break;
00171
00172     case 'd':
00173       printf ("option d with value `%s'\n", optarg);
00174       break;
00175
00176     case '?':
00177       break;
00178
00179     default:
00180       printf ("?? getopt returned character code 0%o ??\n", c);
00181     }
00182     }
00183
00184   if (optind < argc)
00185     {
00186       printf ("non-option ARGV-elements: ");
00187       while (optind < argc)
00188     printf ("%s ", argv[optind++]);
00189       printf ("\n");
00190     }
00191
00192   exit (0);
00193 }
00194
00195 #endif /* TEST */
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/GetPassword.cpp Source File

common/GetPassword.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 // GetPassword.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025
00026 #ifdef WIN32
00027 #   include "wincvs.h"
00028 #endif /* WIN32 */
00029
00030 #ifdef qMacCvsPP
00031 #   include <UModalDialogs.h>
00032 #   include <LEditText.h>
00033 #   include <LStaticText.h>
00034 #   if TARGET_RT_MAC_CFM
00035 #       include <Keychain.h>
00036 #   endif
00037
00038 #   include "MacCvsApp.h"
00039 #   include "MacCvsConstant.h"
00040 #   include "TextBinary.h"
00041 #endif /* qMacCvsPP */
00042
00043 #if qUnix
00044 #   include "UCvsDialogs.h"
00045 #endif
00046
00047 #include "GetPassword.h"
00048 #include "CPStr.h"
00049
00050 #ifdef WIN32
00051 #   ifdef _DEBUG
00052 #   define new DEBUG_NEW
00053 #   undef THIS_FILE
00054     static char THIS_FILE[] = __FILE__;
00055 #   endif
00056 #endif /* WIN32 */
00057
00058 #ifdef WIN32
00059
00060 // GetPassword dialog
00061
00062
00063 GetPassword::GetPassword(CWnd* pParent /*=NULL*/)
00064     : CDialog(GetPassword::IDD, pParent)
00065 {
00066     //{{AFX_DATA_INIT(GetPassword)
00067     m_passwd = _T("");
00068     //}}AFX_DATA_INIT
00069 }
00070
00071
00072 void GetPassword::DoDataExchange(CDataExchange* pDX)
00073 {
00074     CDialog::DoDataExchange(pDX);
00075     //{{AFX_DATA_MAP(GetPassword)
00076     DDX_Text(pDX, IDC_PASSWD, m_passwd);
00077     //}}AFX_DATA_MAP
00078 }
00079
00080
00081 BEGIN_MESSAGE_MAP(GetPassword, CDialog)
00082     //{{AFX_MSG_MAP(GetPassword)
00083     //}}AFX_MSG_MAP
00084 END_MESSAGE_MAP()
00085
00087 // GetPassword message handlers
00088
00089 BOOL GetPassword::OnInitDialog()
00090 {
00091     CDialog::OnInitDialog();
00092
00093     // Extra initialization here
00094
00095     //force the window to the foreground in case it was covered by terminal or DOS box
00096     if( !IsWindowVisible() )
00097     {
00098         SetForegroundWindow();
00099     }
00100
00101     return TRUE;  // return TRUE unless you set the focus to a control
00102     // EXCEPTION: OCX Property Pages should return FALSE
00103 }
00104
00105 #endif /* WIN32 */
00106
00107 #if qUnix
00108 class UCvsGetPasswd : public UWidget
00109 {
00110     UDECLARE_DYNAMIC(UCvsGetPasswd)
00111 public:
00112     UCvsGetPasswd() : UWidget(::UEventGetWidID()) {}
00113     virtual ~UCvsGetPasswd() {}
00114
00115     enum
00116     {
00117         kOK = EV_COMMAND_START, // 0
00118         kCancel,                // 1
00119         kPasswd                 // 2
00120     };
00121
00122     virtual void DoDataExchange(bool fill);
00123
00124     UStr m_passwd;
00125
00126 protected:
00127     ev_msg int OnOK(void);
00128     ev_msg int OnCancel(void);
00129
00130     UDECLARE_MESSAGE_MAP()
00131 };
00132
00133 UIMPLEMENT_DYNAMIC(UCvsGetPasswd, UWidget)
00134
00135 UBEGIN_MESSAGE_MAP(UCvsGetPasswd, UWidget)
00136     ON_UCOMMAND(UCvsGetPasswd::kOK, UCvsGetPasswd::OnOK)
00137     ON_UCOMMAND(UCvsGetPasswd::kCancel, UCvsGetPasswd::OnCancel)
00138 UEND_MESSAGE_MAP()
00139
00140 int UCvsGetPasswd::OnOK(void)
00141 {
00142     EndModal(true);
00143     return 0;
00144 }
00145
00146 int UCvsGetPasswd::OnCancel(void)
00147 {
00148     EndModal(false);
00149     return 0;
00150 }
00151
00152 void UCvsGetPasswd::DoDataExchange(bool fill)
00153 {
00154     if(fill)
00155     {
00156     }
00157     else
00158     {
00159         UEventSendMessage(GetWidID(), EV_GETTEXT, kPasswd, &m_passwd);
00160     }
00161 }
00162 #endif // qUnix
00163
00164 char *CompatGetPassword(const char *prompt)
00165 {
00166 #ifdef WIN32
00167     static char passwd[255];
00168     GetPassword gp;
00169     if(gp.DoModal() == IDOK)
00170     {
00171         strcpy(passwd, gp.m_passwd);
00172         return passwd;
00173     }
00174     return "";
00175 #endif /* WIN32 */
00176 #ifdef qMacCvsPP
00177     if(!CMacCvsApp::gApp->IsFrontProcess() && CMacCvsApp::gApp->NotifyUser(0L))
00178     {
00179         while(!CMacCvsApp::gApp->IsFrontProcess())
00180         {
00181             CMacCvsApp::gApp->SpendSomeTime();
00182         }
00183     }
00184
00185     static UStr thepasswd;
00186     KCItemRef theItem               = NULL;
00187
00188     LStr255 pstr;
00189     UStr realPrompt;
00190 #if !qCarbon || UNIVERSAL_INTERFACES_VERSION >= 0x0334
00191     LStr255 phost, puser;
00192     bool doUseKeyChain = false;
00193     OSStatus theStatus;
00194     UStr loopKey;
00195 #endif
00196
00197     if(GetEnvValue(prompt, "prompt", realPrompt))
00198     {
00199         pstr = realPrompt;
00200
00201 #if !qCarbon || UNIVERSAL_INTERFACES_VERSION >= 0x0334
00202         // copied from MacCvsPro::CMacCVSDoc.cpp
00203         UStr host, user, authen;
00204         if(CMacCvsApp::CanUseKeychain() &&
00205             GetEnvValue(prompt, "host", host) &&
00206             GetEnvValue(prompt, "user", user))
00207         {
00208             doUseKeyChain = true;
00209
00210             OSStatus theStatus;
00211             UInt32 theLength;
00212
00213             phost = host;
00214             puser = user;
00215
00216             UStr authen;
00217             if(GetEnvValue(prompt, "authen", authen))
00218             {
00219                 phost += ":";
00220                 phost += authen;
00221             }
00222
00223             UStr dir;
00224             if(GetEnvValue(prompt, "dir", dir))
00225             {
00226                 phost += ":";
00227                 phost += dir;
00228             }
00229
00230             static char ppass[255];
00231
00232             theStatus = KCFindGenericPassword(phost, puser, sizeof(ppass) - 1,
00233                 ppass, &theLength, &theItem);
00234
00235             user = puser;
00236             host = phost;
00237             loopKey = user;
00238             loopKey << '@';
00239             loopKey << host;
00240             // we could have an endless loop is the password is not valid
00241             if (theStatus == noErr && CMacCvsApp::gApp->CheckLoopingPassword(loopKey))
00242             {
00243                 if (theItem != NULL)
00244                     KCReleaseItem(&theItem);
00245
00246                 ppass[theLength] = '\0';
00247
00248                 return ppass;
00249             }
00250         }
00251 #endif
00252     }
00253     else
00254         pstr = prompt;
00255
00256     StDialogHandler theHandler(dlg_Passwd, LCommander::GetTopCommander());
00257     LWindow *theDialog = theHandler.GetDialog();
00258     ThrowIfNil_(theDialog);
00259
00260     LEditText *passwd = dynamic_cast<LEditText*>
00261         (theDialog->FindPaneByID(item_GetPasswd));
00262     LStaticText *promptbox = dynamic_cast<LStaticText*>
00263         (theDialog->FindPaneByID('PROM'));
00264     theDialog->SetLatentSub(passwd);
00265
00266     promptbox->SetText(pstr);
00267
00268     theDialog->Show();
00269     MessageT hitMessage;
00270     while (true)
00271     {       // Let DialogHandler process events
00272         hitMessage = theHandler.DoDialog();
00273
00274         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00275             break;
00276     }
00277     theDialog->Hide();
00278
00279     if(hitMessage == msg_OK)
00280     {
00281         passwd->GetText(pstr);
00282
00283 #if !qCarbon || UNIVERSAL_INTERFACES_VERSION >= 0x0334
00284         if (doUseKeyChain && CMacCvsApp::CanUseKeychain())
00285         {
00286             if (theItem != NULL)
00287             {
00288                 theStatus = KCSetData(theItem, pstr[0], &pstr[1]);
00289
00290                 if (theStatus == noErr)
00291                     theStatus = KCUpdateItem(theItem);
00292             }
00293             else
00294             {
00295                 theStatus = KCAddGenericPassword(phost, puser,
00296                     pstr[0], &pstr[1], &theItem);
00297
00298                 KCAttribute theAttribute;
00299
00300                 if (theStatus == noErr)
00301                 {
00302                     UStr theDescriptionText("MacCVS password");
00303                     theAttribute.tag = kDescriptionKCItemAttr;
00304                     theAttribute.length = theDescriptionText.length();
00305                     theAttribute.data = (void *)(const char *)theDescriptionText;
00306                     theStatus = KCSetAttribute(theItem, &theAttribute);
00307                 }
00308
00309                 OSType theTypeCreator;
00310
00311                 if (theStatus == noErr)
00312                 {
00313                     theTypeCreator = 'mCVS';
00314                     theAttribute.tag = kCreatorKCItemAttr;
00315                     theAttribute.length = sizeof(theTypeCreator);
00316                     theAttribute.data = &theTypeCreator;
00317                     theStatus = KCSetAttribute(theItem, &theAttribute);
00318                 }
00319
00320                 if (theStatus == noErr)
00321                 {
00322                     theTypeCreator = 'APPL';
00323                     theAttribute.tag = kTypeKCItemAttr;
00324                     theStatus = KCSetAttribute(theItem, &theAttribute);
00325                 }
00326
00327                 if (theStatus == noErr)
00328                 {
00329                     Boolean theCustomIcon = true;
00330                     theAttribute.tag = kCustomIconKCItemAttr;
00331                     theAttribute.length = sizeof(theCustomIcon);
00332                     theAttribute.data = &theCustomIcon;
00333                     theStatus = KCSetAttribute(theItem, &theAttribute);
00334                 }
00335
00336                 if (theStatus == noErr)
00337                     theStatus = KCUpdateItem(theItem);
00338             }
00339
00340             if (theItem != NULL)
00341                 KCReleaseItem(&theItem);
00342
00343             CMacCvsApp::gApp->PushValidPassword(loopKey);
00344         }
00345 #endif
00346
00347         thepasswd = pstr;
00348         return thepasswd.length() == 0 ? (char *)"" : (char *)thepasswd;
00349     }
00350
00351 #if !qCarbon || UNIVERSAL_INTERFACES_VERSION >= 0x0334
00352     if (theItem != NULL)
00353         KCReleaseItem(&theItem);
00354 #endif
00355
00356     return "";
00357 #endif /* qMacCvsPP */
00358 #if qUnix
00359     static char passwd[255];
00360     void *wid = UCreate_PasswdDlg();
00361
00362     UCvsGetPasswd *dlg = new UCvsGetPasswd();
00363     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00364
00365     if(dlg->DoModal())
00366     {
00367         strcpy(passwd, dlg->m_passwd);
00368     }
00369     else
00370         strcpy(passwd, "");
00371
00372     delete dlg;
00373     return passwd;
00374 #endif // qUnix
00375 }
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/GetPassword.h Source File

common/GetPassword.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 #if !defined(AFX_GETPASSWORD_H__5946A8C4_8517_11D1_8949_444553540000__INCLUDED_)
00022 #define AFX_GETPASSWORD_H__5946A8C4_8517_11D1_8949_444553540000__INCLUDED_
00023
00024 #if _MSC_VER >= 1000
00025 #pragma once
00026 #endif // _MSC_VER >= 1000
00027 // GetPassword.h : header file
00028 //
00029
00030 char *CompatGetPassword(const char *prompt);
00031     // prompt for a password
00032
00033 #ifdef WIN32
00034
00035 // GetPassword dialog
00036
00037 class GetPassword : public CDialog
00038 {
00039 // Construction
00040 public:
00041     GetPassword(CWnd* pParent = NULL);   // standard constructor
00042
00043 // Dialog Data
00044     //{{AFX_DATA(GetPassword)
00045     enum { IDD = IDD_PASSWRD };
00046     CString m_passwd;
00047     //}}AFX_DATA
00048
00049
00050 // Overrides
00051     // ClassWizard generated virtual function overrides
00052     //{{AFX_VIRTUAL(GetPassword)
00053     protected:
00054     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00055     //}}AFX_VIRTUAL
00056
00057 // Implementation
00058 protected:
00059
00060     // Generated message map functions
00061     //{{AFX_MSG(GetPassword)
00062     virtual BOOL OnInitDialog();
00063     //}}AFX_MSG
00064     DECLARE_MESSAGE_MAP()
00065 };
00066
00067 //{{AFX_INSERT_LOCATION}}
00068 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00069 #endif /* WIN32 */
00070
00071 #endif // !defined(AFX_GETPASSWORD_H__5946A8C4_8517_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/GetPrefs.cpp Source File

common/GetPrefs.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 // GetPrefs.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025
00026 #ifdef qMacCvsPP
00027 #   include <UModalDialogs.h>
00028 #   include <LMultiPanelView.h>
00029 #   include <LPopupGroupBox.h>
00030
00031 #   include "MacCvsConstant.h"
00032 #   include "MacBinEncoding.h"
00033 #   include "uwidget.h"
00034 #endif /* qMacCvsPP */
00035
00036 #if qUnix
00037 #   include "UCvsDialogs.h"
00038 #endif
00039
00040 #ifdef WIN32
00041 #   include "wincvs.h"
00042 #   include "umain.h"
00043 #   include <afxdao.h>
00044 #endif /* WIN32 */
00045
00046 #include "GetPrefs.h"
00047 #include "CvsPrefs.h"
00048 #include "Authen.h"
00049 #include "AppConsole.h"
00050 #include "AppGlue.h"
00051 #include "PromptFiles.h"
00052 #include "MultiFiles.h"
00053 #include "CvsArgs.h"
00054 #include "FileTraversal.h"
00055
00056 #ifdef WIN32
00057
00058 #ifdef _DEBUG
00059 #define new DEBUG_NEW
00060 #undef THIS_FILE
00061 static char THIS_FILE[] = __FILE__;
00062 #endif
00063
00064 // CVSROOT page
00065 IMPLEMENT_DYNCREATE(CGetPrefs_CVSROOT, CPropertyPage)
00066
00067 CGetPrefs_CVSROOT::CGetPrefs_CVSROOT()
00068     : m_versCombo(USmartCombo::AutoDropWidth), m_authenCombo(USmartCombo::AutoDropWidth),
00069     CPropertyPage(CGetPrefs_CVSROOT::IDD), m_didInteract(false)
00070 {
00071     //{{AFX_DATA_INIT(CGetPrefs_CVSROOT)
00072     m_cvsroot = (const char *)gCvsPrefs;
00073     m_cvsvers = gCvsPrefs.CvsVersion();
00074     m_cvsconsole = gCvsPrefs.CvsConsole();
00075     m_authen = gAuthen.kind();
00076     m_host = _T("");
00077     m_login = _T("");
00078     m_path = _T("");
00079     //}}AFX_DATA_INIT
00080
00081     m_flag = false;
00082     m_cvsrootCombo.SetItems(&gOldCvsroots);
00083 }
00084
00085 CGetPrefs_CVSROOT::~CGetPrefs_CVSROOT()
00086 {
00087 }
00088
00089
00090 void CGetPrefs_CVSROOT::DoDataExchange(CDataExchange* pDX)
00091 {
00092     m_didInteract = true;
00093
00094     CPropertyPage::DoDataExchange(pDX);
00095
00096     //{{AFX_DATA_MAP(CGetPrefs_CVSROOT)
00097     DDX_Control(pDX, IDC_CVSVERS, m_versCombo);
00098     DDX_Control(pDX, IDC_AUTHEN, m_authenCombo);
00099     DDX_Control(pDX, IDC_COMBOROOT, m_cvsrootCombo);
00100     DDX_CBString(pDX, IDC_COMBOROOT, m_cvsroot);
00101     DDV_MinChars(pDX, m_cvsroot, 1);
00102     DDX_Text(pDX, IDC_HOST, m_host);
00103     DDX_Text(pDX, IDC_LOGIN, m_login);
00104     DDX_Text(pDX, IDC_PATH, m_path);
00105     DDX_Check(pDX, IDC_CONSOLE, m_cvsconsole);
00106     //}}AFX_DATA_MAP
00107
00108     DDV_CheckCVSROOT(pDX, m_cvsroot);
00109
00110     if( pDX->m_bSaveAndValidate )
00111     {
00112         //in case the CVSROOT was modified by DDV rutine we need to refill the fields
00113         FillFields();
00114
00115         m_cvsvers = m_versCombo.GetCurSel();
00116
00117         if( !m_cvsroot.IsEmpty() )
00118         {
00119             gOldCvsroots.Insert(m_cvsroot);
00120         }
00121     }
00122     else
00123     {
00124         DDX_ComboMString(pDX, IDC_COMBOROOT, m_cvsrootCombo);
00125
00126         m_versCombo.SetCurSel(m_cvsvers);
00127
00128         m_authenCombo.ResetContent();
00129         std::vector<AuthenModel *> & allAuthen = AuthenModel::GetAllInstances();
00130         std::vector<AuthenModel *>::iterator j;
00131         for(j = allAuthen.begin(); j != allAuthen.end(); ++j)
00132         {
00133             m_authenCombo.InsertString(-1, (*j)->GetToken());
00134         }
00135
00136         AuthenModel *model = AuthenModel::GetInstance(m_authen);
00137         m_authenCombo.SetCurSel(Authen::kindToNum(m_authen));
00138
00139         FillFields();
00140         OnSelchangeAuthen();
00141     }
00142 }
00143
00144 void CGetPrefs_CVSROOT::StoreValues()
00145 {
00146     if(!m_didInteract)
00147         return;
00148
00149     gCvsPrefs = (const char *)m_cvsroot;
00150     gAuthen.setkind(m_authen);
00151     gCvsPrefs.SetCvsVersion(m_cvsvers);
00152     gCvsPrefs.SetCvsConsole(m_cvsconsole != 0);
00153 }
00154
00155 void CGetPrefs_CVSROOT::OnSelchangeAuthen()
00156 {
00157     m_authen = Authen::numToKind(m_authenCombo.GetCurSel());
00158
00159     AuthenModel *model = AuthenModel::GetInstance(m_authen);
00160
00161     GetDlgItem(IDC_HOST)->EnableWindow(model->HasHost());
00162     GetDlgItem(IDC_LOGIN)->EnableWindow(model->HasUser());
00163     GetDlgItem(IDC_SETTINGS)->EnableWindow(model->HasSettings());
00164
00165     if(!model->HasHost())
00166         GetDlgItem(IDC_HOST)->SetWindowText("");
00167
00168     if(!model->HasUser())
00169         GetDlgItem(IDC_LOGIN)->SetWindowText("");
00170
00171     UStr desc;
00172     model->GetSettingsDesc(desc);
00173     GetDlgItem(IDC_AUTHENDESC)->SetWindowText(desc);
00174
00175     // ntserver
00176     // the default *is* ntserver now
00177     // TODO : something more elaborated that is querying cvs
00178 #if 0
00179     if(m_authen == ntserver && m_combovers.GetCurSel() != 1)
00180     {
00181         AfxMessageBox("For the ntserver support, you got to switch the cvs used from"
00182             " \"cvs-1.10 (Standard)\" to \"cvs-1.10 (NT server)\". Check"
00183             " http://www.cvsnt.org for more informations."
00184             , MB_ICONEXCLAMATION | MB_OK);
00185     }
00186 #endif
00187 }
00188
00189 void CGetPrefs_CVSROOT::OnChangePath()
00190 {
00191     OnChangeFields();
00192 }
00193
00194 void CGetPrefs_CVSROOT::OnChangeHost()
00195 {
00196     OnChangeFields();
00197 }
00198
00199 void CGetPrefs_CVSROOT::OnChangeLogin()
00200 {
00201     OnChangeFields();
00202 }
00203
00204 void CGetPrefs_CVSROOT::OnSettings()
00205 {
00206     AuthenModel *model = AuthenModel::GetInstance(m_authen);
00207     model->DoSettings();
00208     UStr desc;
00209     model->GetSettingsDesc(desc);
00210     GetDlgItem(IDC_AUTHENDESC)->SetWindowText(desc);
00211 }
00212
00213 void CGetPrefs_CVSROOT::FillFields(void)
00214 {
00215     UStr theMethod, theUser, theHost, thePath;
00216     USemaphore policeman(m_flag);
00217     if(policeman.IsEnteredTwice())
00218         return;
00219
00220     UStr root;
00221     root = Authen::token(m_authen);
00222     root << Authen::skiptoken(m_cvsroot);
00223
00224     if(Authen::parse_cvsroot(root, theMethod, theUser, theHost, thePath))
00225     {
00226         GetDlgItem(IDC_PATH)->SetWindowText(thePath);
00227         GetDlgItem(IDC_HOST)->SetWindowText(theHost);
00228         GetDlgItem(IDC_LOGIN)->SetWindowText(theUser);
00229     }
00230 }
00231
00232 void CGetPrefs_CVSROOT::OnEditchangeComboroot()
00233 {
00234     m_cvsrootCombo.GetWindowText(m_cvsroot);
00235     FillFields();
00236 }
00237
00238 void CGetPrefs_CVSROOT::OnChangeFields(void)
00239 {
00240     USemaphore policeman(m_flag);
00241     if(policeman.IsEnteredTwice())
00242         return;
00243
00244     CString theUser, theHost, thePath;
00245
00246     GetDlgItem(IDC_PATH)->GetWindowText(thePath);
00247     GetDlgItem(IDC_HOST)->GetWindowText(theHost);
00248     GetDlgItem(IDC_LOGIN)->GetWindowText(theUser);
00249
00250     m_cvsroot = "";
00251     AuthenModel *model = AuthenModel::GetInstance(m_authen);
00252     if(model->HasUser())
00253     {
00254         m_cvsroot += theUser;
00255
00256         if(model->HasHost())
00257         {
00258             m_cvsroot += '@';
00259         }
00260     }
00261
00262     if(model->HasHost())
00263     {
00264         m_cvsroot += theHost;
00265     }
00266
00267     if(model->HasUser() || model->HasHost())
00268         m_cvsroot += ':';
00269
00270     m_cvsroot += thePath;
00271
00272     m_cvsrootCombo.SetWindowText(m_cvsroot);
00273 }
00274
00275 void CGetPrefs_CVSROOT::OnSelchangeComboroot()
00276 {
00277     int nCurSel = m_cvsrootCombo.GetCurSel();
00278     m_cvsrootCombo.GetLBText(nCurSel, m_cvsroot);
00279     FillFields();
00280 }
00281
00282 BEGIN_MESSAGE_MAP(CGetPrefs_CVSROOT, CPropertyPage)
00283     //{{AFX_MSG_MAP(CGetPrefs_CVSROOT)
00284     ON_CBN_SELCHANGE(IDC_AUTHEN, OnSelchangeAuthen)
00285     ON_EN_CHANGE(IDC_PATH, OnChangePath)
00286     ON_EN_CHANGE(IDC_HOST, OnChangeHost)
00287     ON_EN_CHANGE(IDC_LOGIN, OnChangeLogin)
00288     ON_BN_CLICKED(IDC_SETTINGS, OnSettings)
00289     ON_CBN_SELCHANGE(IDC_COMBOROOT, OnSelchangeComboroot)
00290     ON_CBN_EDITCHANGE(IDC_COMBOROOT, OnEditchangeComboroot)
00291     //}}AFX_MSG_MAP
00292 END_MESSAGE_MAP()
00293
00294 // Globals options page
00295 IMPLEMENT_DYNCREATE(CGetPrefs_GLOBALS, CPropertyPage)
00296
00297 CGetPrefs_GLOBALS::CGetPrefs_GLOBALS() : CPropertyPage(CGetPrefs_GLOBALS::IDD), m_didInteract(false)
00298 {
00299     //{{AFX_DATA_INIT(CGetPrefs_GLOBALS)
00300     m_checkoutro = gCvsPrefs.CheckoutRO();
00301     m_prune = gCvsPrefs.PruneOption();
00302     m_tcpip = gCvsPrefs.Z9Option();
00303     m_quiet = gCvsPrefs.QuietOption();
00304     m_cntladd = gCvsPrefs.AddControl();
00305     m_dirty = gCvsPrefs.DirtySupport();
00306     m_alwaysroot = gCvsPrefs.AlwaysUseCvsroot();
00307     m_logout = gCvsPrefs.LogoutTimeOut() > 0;
00308     m_editlogout = gCvsPrefs.LogoutTimeOut();
00309     m_unixlf = gCvsPrefs.UnixLF();
00310     m_zlevel = gCvsPrefs.ZLevel();
00311     //}}AFX_DATA_INIT
00312 }
00313
00314 CGetPrefs_GLOBALS::~CGetPrefs_GLOBALS()
00315 {
00316 }
00317
00318 void CGetPrefs_GLOBALS::DoDataExchange(CDataExchange* pDX)
00319 {
00320     m_didInteract = true;
00321
00322     CPropertyPage::DoDataExchange(pDX);
00323
00324     //{{AFX_DATA_MAP(CGetPrefs_GLOBALS)
00325     DDX_Control(pDX, IDC_ZSPIN, m_zspin);
00326     DDX_Control(pDX, IDC_SPINLOGOUT, m_spin);
00327     DDX_Check(pDX, IDC_CHECKOUTRO, m_checkoutro);
00328     DDX_Check(pDX, IDC_PRUNE, m_prune);
00329     DDX_Check(pDX, IDC_TCPIP, m_tcpip);
00330     DDX_Check(pDX, IDC_QUIET, m_quiet);
00331     DDX_Check(pDX, IDC_CTNLADD, m_cntladd);
00332     DDX_Check(pDX, IDC_DIRTYSUPPORT, m_dirty);
00333     DDX_Check(pDX, IDC_ALWAYSROOT, m_alwaysroot);
00334     DDX_Check(pDX, IDC_LOGOUT, m_logout);
00335     DDX_Text(pDX, IDC_EDITLOGOUT, m_editlogout);
00336     DDV_MinMaxUInt(pDX, m_editlogout, 0, 999999);
00337     DDX_Check(pDX, IDC_CHECKUNIXLF, m_unixlf);
00338     DDX_Text(pDX, IDC_ZLEVEL, m_zlevel);
00339     DDV_MinMaxUInt(pDX, m_zlevel, 1, 9);
00340     //}}AFX_DATA_MAP
00341
00342     if(!pDX->m_bSaveAndValidate)
00343     {
00344         OnTcpip();
00345         OnLogout();
00346     }
00347 }
00348
00349 void CGetPrefs_GLOBALS::StoreValues()
00350 {
00351     if(!m_didInteract)
00352         return;
00353
00354     gCvsPrefs.SetCheckoutRO(m_checkoutro ? true : false);
00355     gCvsPrefs.SetPruneOption(m_prune ? true : false);
00356     gCvsPrefs.SetZ9Option(m_tcpip ? true : false);
00357     gCvsPrefs.SetQuietOption(m_quiet ? true : false);
00358     gCvsPrefs.SetAddControl(m_cntladd ? true : false);
00359     gCvsPrefs.SetDirtySupport(m_dirty ? true : false);
00360     gCvsPrefs.SetAlwaysUseCvsroot(m_alwaysroot ? true : false);
00361     gCvsPrefs.SetLogoutTimeOut(m_logout ? (int)m_editlogout : 0);
00362     gCvsPrefs.SetUnixLF(m_unixlf != 0);
00363     gCvsPrefs.SetZLevel(m_zlevel);
00364 }
00365
00366 BEGIN_MESSAGE_MAP(CGetPrefs_GLOBALS, CPropertyPage)
00367     //{{AFX_MSG_MAP(CGetPrefs_GLOBALS)
00368     ON_BN_CLICKED(IDC_LOGOUT, OnLogout)
00369     ON_BN_CLICKED(IDC_CHECKUNIXLF, OnCheckunixlf)
00370     ON_BN_CLICKED(IDC_TCPIP, OnTcpip)
00371     //}}AFX_MSG_MAP
00372 END_MESSAGE_MAP()
00373
00374 BOOL CGetPrefs_GLOBALS::OnInitDialog()
00375 {
00376     CPropertyPage::OnInitDialog();
00377
00378     // Extra initialization
00379     m_spin.SetBase(10);
00380     m_spin.SetRange(0, 30000);
00381
00382     m_zspin.SetBase(1);
00383     m_zspin.SetRange(1, 9);
00384
00385     return TRUE;  // return TRUE unless you set the focus to a control
00386                   // EXCEPTION: OCX Property Pages should return FALSE
00387 }
00388
00389 void CGetPrefs_GLOBALS::OnTcpip()
00390 {
00391     CButton* but = (CButton *)GetDlgItem(IDC_TCPIP);
00392     CWnd* wnd = (CButton *)GetDlgItem(IDC_ZLEVEL);
00393     wnd->EnableWindow(but->GetCheck() == 1);
00394     wnd = (CButton *)GetDlgItem(IDC_ZSPIN);
00395     wnd->EnableWindow(but->GetCheck() == 1);
00396 }
00397
00398 void CGetPrefs_GLOBALS::OnLogout()
00399 {
00400     CButton* but = (CButton *)GetDlgItem(IDC_LOGOUT);
00401     CWnd* wnd = (CButton *)GetDlgItem(IDC_EDITLOGOUT);
00402     wnd->EnableWindow(but->GetCheck() == 1);
00403     wnd = (CButton *)GetDlgItem(IDC_SPINLOGOUT);
00404     wnd->EnableWindow(but->GetCheck() == 1);
00405 }
00406
00407 void CGetPrefs_GLOBALS::OnCheckunixlf()
00408 {
00409     AfxMessageBox("Be carefull when toggling this option : you *CANNOT* use WinCvs in"
00410         " both mode. You got to use either one or the other. If you experience some"
00411         " problems, try to remove the global cvs files (such as .cvspass) because they probably"
00412         " don't match the new line feeds.", MB_ICONEXCLAMATION | MB_OK);
00413 }
00414
00415 // WinCvs options page
00416 IMPLEMENT_DYNCREATE(CGetPrefs_WINCVS, CPropertyPage)
00417
00418 CGetPrefs_WINCVS::CGetPrefs_WINCVS() : CPropertyPage(CGetPrefs_WINCVS::IDD), m_didInteract(false)
00419 {
00420     UStr cvsPath;
00421     //{{AFX_DATA_INIT(CGetPrefs_WINCVS)
00422     m_viewer = gCvsPrefs.Viewer() != 0L ? gCvsPrefs.Viewer() : "";
00423     m_diffprog = gCvsPrefs.ExtDiff() != 0L ? gCvsPrefs.ExtDiff() : "";
00424     m_chkdiff = gCvsPrefs.ExtDiff() != 0L;
00425     m_home = gCvsPrefs.Home() != 0L ? gCvsPrefs.Home() : "";
00426     m_chkUseViewerAlways = gCvsPrefs.UseViewerAlways() != 0L;
00427     m_cvschk = gCvsPrefs.WhichCvs(cvsPath, true) != 0L;
00428     m_cvsprog = gCvsPrefs.WhichCvs(cvsPath);
00429     //}}AFX_DATA_INIT
00430 }
00431
00432 CGetPrefs_WINCVS::~CGetPrefs_WINCVS()
00433 {
00434 }
00435
00436 void CGetPrefs_WINCVS::DoDataExchange(CDataExchange* pDX)
00437 {
00438     m_didInteract = true;
00439
00440     CPropertyPage::DoDataExchange(pDX);
00441
00442     //{{AFX_DATA_MAP(CGetPrefs_WINCVS)
00443     DDX_Text(pDX, IDC_PROGRAM, m_viewer);
00444     DDX_Text(pDX, IDC_DIFFPROG, m_diffprog);
00445     DDX_Check(pDX, IDC_EXTDIFF, m_chkdiff);
00446     DDX_Text(pDX, IDC_HOME, m_home);
00447     DDX_Check(pDX, IDC_USE_VIEWER_ALWAYS, m_chkUseViewerAlways);
00448     DDX_Check(pDX, IDC_ALTCVSCHK, m_cvschk);
00449     DDX_Text(pDX, IDC_ALTCVSPROG, m_cvsprog);
00450     //}}AFX_DATA_MAP
00451
00452     DDV_CheckPathExists(pDX, IDC_HOME, m_home);
00453
00454     if( !pDX->m_bSaveAndValidate )
00455     {
00456         OnExtdiff();
00457         OnAltcvschk();
00458     }
00459 }
00460
00461 void CGetPrefs_WINCVS::StoreValues()
00462 {
00463     if(!m_didInteract)
00464         return;
00465
00466     if(!m_viewer.IsEmpty())
00467         gCvsPrefs.SetViewer(m_viewer);
00468     else
00469         gCvsPrefs.SetViewer(0L);
00470     if(m_chkdiff && !m_diffprog.IsEmpty())
00471         gCvsPrefs.SetExtDiff(m_diffprog);
00472     else
00473         gCvsPrefs.SetExtDiff(0L);
00474     if(!m_home.IsEmpty())
00475         gCvsPrefs.SetHome(m_home);
00476     gCvsPrefs.SetUseViewerAlways(m_chkUseViewerAlways ? true : false);
00477
00478     if(m_cvschk && !m_cvsprog.IsEmpty())
00479         gCvsPrefs.SetWhichCvs(m_cvsprog);
00480     else
00481         gCvsPrefs.SetWhichCvs("");
00482 }
00483
00484 BEGIN_MESSAGE_MAP(CGetPrefs_WINCVS, CPropertyPage)
00485     //{{AFX_MSG_MAP(CGetPrefs_WINCVS)
00486     ON_BN_CLICKED(IDC_BTNPROGRAM, OnBtnviewer)
00487     ON_BN_CLICKED(IDC_EXTDIFFSEL, OnExtdiffsel)
00488     ON_BN_CLICKED(IDC_EXTDIFF, OnExtdiff)
00489     ON_BN_CLICKED(IDC_BTNHOME, OnBtnhome)
00490     ON_BN_CLICKED(IDC_ALTCVSCHK, OnAltcvschk)
00491     ON_BN_CLICKED(IDC_ALTCVSSEL, OnAltcvssel)
00492     //}}AFX_MSG_MAP
00493 END_MESSAGE_MAP()
00494
00495 void CGetPrefs_WINCVS::OnBtnviewer()
00496 {
00497     MultiFiles mf;
00498     if(!BrowserGetMultiFiles("Select a program :", mf, "Executable Files (*.exe)|*.exe|All Files (*.*)|*.*||"))
00499         return;
00500
00501     CvsArgs args(false);
00502     mf.next();
00503     const char *dir = mf.add(args);
00504     char * const *argv = args.Argv();
00505     CStr fullpath;
00506     fullpath = dir;
00507     if(!fullpath.endsWith(kPathDelimiter))
00508         fullpath << kPathDelimiter;
00509     fullpath << argv[0];
00510
00511     SetDlgItemText(IDC_PROGRAM, fullpath);
00512 }
00513
00514 void CGetPrefs_WINCVS::OnExtdiffsel()
00515 {
00516     MultiFiles mf;
00517     if(!BrowserGetMultiFiles("Select a diff program :", mf, "Executable Files (*.exe)|*.exe|All Files (*.*)|*.*||"))
00518         return;
00519
00520     CvsArgs args(false);
00521     mf.next();
00522     const char *dir = mf.add(args);
00523     char * const *argv = args.Argv();
00524     CStr fullpath;
00525     fullpath = dir;
00526     if(!fullpath.endsWith(kPathDelimiter))
00527         fullpath << kPathDelimiter;
00528     fullpath << argv[0];
00529
00530     SetDlgItemText(IDC_DIFFPROG, fullpath);
00531 }
00532
00533 void CGetPrefs_WINCVS::OnExtdiff()
00534 {
00535     CButton* but = (CButton *)GetDlgItem(IDC_EXTDIFF);
00536     CWnd* wnd = GetDlgItem(IDC_DIFFPROG);
00537     wnd->EnableWindow(but->GetCheck() == 1);
00538     wnd = GetDlgItem(IDC_EXTDIFFSEL);
00539     wnd->EnableWindow(but->GetCheck() == 1);
00540 }
00541
00542 void CGetPrefs_WINCVS::OnBtnhome()
00543 {
00544     const char *dir = BrowserGetDirectory("Select a directory to be the HOME :");
00545     if(dir != NULL)
00546         SetDlgItemText(IDC_HOME, dir);
00547 }
00548
00549 void CGetPrefs_WINCVS::OnAltcvschk()
00550 {
00551     CButton* but = (CButton *)GetDlgItem(IDC_ALTCVSCHK);
00552     CWnd* wnd = GetDlgItem(IDC_ALTCVSPROG);
00553     wnd->EnableWindow(but->GetCheck() == 1);
00554     wnd = GetDlgItem(IDC_ALTCVSSEL);
00555     wnd->EnableWindow(but->GetCheck() == 1);
00556 }
00557
00558 void CGetPrefs_WINCVS::OnAltcvssel()
00559 {
00560     MultiFiles mf;
00561     if(!BrowserGetMultiFiles("Select a cvs program :", mf, "Executable Files (*.exe)|*.exe|All Files (*.*)|*.*||"))
00562         return;
00563
00564     CvsArgs args(false);
00565     mf.next();
00566     const char *dir = mf.add(args);
00567     char * const *argv = args.Argv();
00568     CStr fullpath;
00569     fullpath = dir;
00570     if(!fullpath.endsWith(kPathDelimiter))
00571         fullpath << kPathDelimiter;
00572     fullpath << argv[0];
00573
00574     SetDlgItemText(IDC_ALTCVSPROG, fullpath);
00575 }
00576
00577 // Command Dialogs options page
00578 IMPLEMENT_DYNCREATE(CGetPrefs_CVSCMD_DIALOGS, CPropertyPage)
00579
00580 CGetPrefs_CVSCMD_DIALOGS::CGetPrefs_CVSCMD_DIALOGS() : CPropertyPage(CGetPrefs_CVSCMD_DIALOGS::IDD), m_didInteract(false)
00581 {
00582     //{{AFX_DATA_INIT(CGetPrefs_CVSCMD_DIALOGS)
00583     m_hideUpdate = gCvsPrefs.HideCommandDlgUpdate() != 0L;
00584     m_hideDiff = gCvsPrefs.HideCommandDlgDiff() != 0L;
00585     m_hideGraph = gCvsPrefs.HideCommandDlgGraph() != 0L;
00586     m_hideLog = gCvsPrefs.HideCommandDlgLog() != 0L;
00587     m_keyForce = gCvsPrefs.HideCommandDlgUseShift() != 0L ? 0 : 1;
00588     m_hideAnnotate = gCvsPrefs.HideCommandDlgAnnotate() != 0L;
00589     //}}AFX_DATA_INIT
00590 }
00591
00592 CGetPrefs_CVSCMD_DIALOGS::~CGetPrefs_CVSCMD_DIALOGS()
00593 {
00594 }
00595
00596 void CGetPrefs_CVSCMD_DIALOGS::DoDataExchange(CDataExchange* pDX)
00597 {
00598     m_didInteract = true;
00599
00600     CPropertyPage::DoDataExchange(pDX);
00601     //{{AFX_DATA_MAP(CGetPrefs_CVSCMD_DIALOGS)
00602     DDX_Check(pDX, IDC_CHECKUPDATE, m_hideUpdate);
00603     DDX_Check(pDX, IDC_CHECKDIFF, m_hideDiff);
00604     DDX_Check(pDX, IDC_CHECKGRAPH, m_hideGraph);
00605     DDX_Check(pDX, IDC_CHECKLOG, m_hideLog);
00606     DDX_Radio(pDX, IDC_RADIOSHIFT, m_keyForce);
00607     DDX_Check(pDX, IDC_CHECKANNOTATE, m_hideAnnotate);
00608     //}}AFX_DATA_MAP
00609 }
00610
00611 void CGetPrefs_CVSCMD_DIALOGS::StoreValues()
00612 {
00613     if(!m_didInteract)
00614         return;
00615
00616     gCvsPrefs.SetHideCommandDlgUpdate(m_hideUpdate ? true : false);
00617     gCvsPrefs.SetHideCommandDlgDiff(m_hideDiff ? true : false);
00618     gCvsPrefs.SetHideCommandDlgGraph(m_hideGraph ? true : false);
00619     gCvsPrefs.SetHideCommandDlgAnnotate(m_hideAnnotate ? true : false);
00620     gCvsPrefs.SetHideCommandDlgLog(m_hideLog ? true : false);
00621     gCvsPrefs.SetHideCommandDlgUseShift(m_keyForce == 0);
00622 }
00623
00624 BEGIN_MESSAGE_MAP(CGetPrefs_CVSCMD_DIALOGS, CPropertyPage)
00625 //{{AFX_MSG_MAP(CGetPrefs_CVSCMD_DIALOGS)
00626 // NOTE: the ClassWizard will add message map macros here
00627 //}}AFX_MSG_MAP
00628 END_MESSAGE_MAP()
00629
00630 #endif /* WIN32 */
00631
00632 #if qUnix
00633 class UCvsPrefs_MAIN : public UWidget
00634 {
00635     UDECLARE_DYNAMIC(UCvsPrefs_MAIN)
00636 public:
00637     UCvsPrefs_MAIN() : UWidget(::UEventGetWidID()) {}
00638     virtual ~UCvsPrefs_MAIN() {}
00639
00640     enum
00641     {
00642         kOK = EV_COMMAND_START, // 0
00643         kCancel,                // 1
00644         kTabGeneral             // 2
00645     };
00646
00647     virtual void DoDataExchange(bool fill);
00648
00649 protected:
00650     ev_msg int OnOK(void);
00651     ev_msg int OnCancel(void);
00652
00653     UDECLARE_MESSAGE_MAP()
00654 };
00655
00656 UIMPLEMENT_DYNAMIC(UCvsPrefs_MAIN, UWidget)
00657
00658 UBEGIN_MESSAGE_MAP(UCvsPrefs_MAIN, UWidget)
00659     ON_UCOMMAND(UCvsPrefs_MAIN::kOK, UCvsPrefs_MAIN::OnOK)
00660     ON_UCOMMAND(UCvsPrefs_MAIN::kCancel, UCvsPrefs_MAIN::OnCancel)
00661 UEND_MESSAGE_MAP()
00662
00663 int UCvsPrefs_MAIN::OnOK(void)
00664 {
00665     EndModal(true);
00666     return 0;
00667 }
00668
00669 int UCvsPrefs_MAIN::OnCancel(void)
00670 {
00671     EndModal(false);
00672     return 0;
00673 }
00674
00675 void UCvsPrefs_MAIN::DoDataExchange(bool fill)
00676 {
00677     if(fill)
00678     {
00679     }
00680     else
00681     {
00682     }
00683 }
00684
00685 class UCvsPrefs_CVSROOT : public UWidget
00686 {
00687     UDECLARE_DYNAMIC(UCvsPrefs_CVSROOT)
00688 public:
00689     UCvsPrefs_CVSROOT();
00690     virtual ~UCvsPrefs_CVSROOT() {}
00691
00692     enum
00693     {
00694         kCvsrootCombo = EV_COMMAND_START,   // 0
00695         kRshRadio,              // 1
00696         kPserverRadio,          // 2
00697         kLocalRadio,            // 3
00698         kSshRadio,              // 4
00699         kKerberosRadio,         // 5
00700         kCvsVersionCombo        // 6
00701     };
00702
00703     virtual void DoDataExchange(bool fill);
00704
00705     void StoreValues(void);
00706
00707 protected:
00708     UStr m_cvsroot;
00709     AuthenKind m_kind;
00710
00711     UDECLARE_MESSAGE_MAP()
00712 };
00713
00714 UIMPLEMENT_DYNAMIC(UCvsPrefs_CVSROOT, UWidget)
00715
00716 UBEGIN_MESSAGE_MAP(UCvsPrefs_CVSROOT, UWidget)
00717 UEND_MESSAGE_MAP()
00718
00719 UCvsPrefs_CVSROOT::UCvsPrefs_CVSROOT() : UWidget(::UEventGetWidID())
00720 {
00721     if(!gCvsPrefs.empty())
00722         m_cvsroot = (const char *)gCvsPrefs;
00723     m_kind = gAuthen.kind();
00724 }
00725
00726 void UCvsPrefs_CVSROOT::StoreValues(void)
00727 {
00728     gCvsPrefs = m_cvsroot;
00729     gAuthen.setkind(m_kind);
00730 }
00731
00732 void UCvsPrefs_CVSROOT::DoDataExchange(bool fill)
00733 {
00734     if(fill)
00735     {
00736         UEventSendMessage(GetWidID(), EV_SETTEXT, kCvsrootCombo, (void *)(const char *)m_cvsroot);
00737         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kCvsrootCombo, 0L);
00738         for(int i = 0; i < NUM_CVSROOT; i++)
00739         {
00740             const CPStr & strroot =
00741                 (*(const CvsPrefs *)&gCvsPrefs).get_cvsroot_list(i);
00742             if(!strroot.empty())
00743                 UEventSendMessage(GetWidID(), EV_COMBO_APPEND,
00744                                   kCvsrootCombo, (void *)(const char *)strroot);
00745         }
00746
00747         int item = kLocalRadio;
00748         switch(m_kind)
00749         {
00750         case local: item = kLocalRadio; break;
00751         case kserver: item = kKerberosRadio; break;
00752         case rhosts: item = kRshRadio; break;
00753         case pserver: item = kPserverRadio; break;
00754         case ssh: item = kSshRadio; break;
00755         case ntserver: item = kLocalRadio; break;
00756         }
00757
00758         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(item, 1), 0L);
00759     }
00760     else
00761     {
00762         UEventSendMessage(GetWidID(), EV_GETTEXT, kCvsrootCombo, &m_cvsroot);
00763
00764         m_kind = local;
00765         if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kLocalRadio, 0L))
00766             m_kind = local;
00767         else if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kKerberosRadio, 0L))
00768             m_kind = kserver;
00769         else if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRshRadio, 0L))
00770             m_kind = rhosts;
00771         else if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kPserverRadio, 0L))
00772             m_kind = pserver;
00773         else if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kSshRadio, 0L))
00774             m_kind = ssh;
00775     }
00776 }
00777
00778 class UCvsPrefs_GLOBALS : public UWidget
00779 {
00780     UDECLARE_DYNAMIC(UCvsPrefs_GLOBALS)
00781 public:
00782     UCvsPrefs_GLOBALS();
00783     virtual ~UCvsPrefs_GLOBALS() {}
00784
00785     enum
00786     {
00787         kcheckoutro = EV_COMMAND_START, // 0
00788         kdirty,                 // 1
00789         ktcpip,                 // 2
00790         kprune,                 // 3
00791         kquiet,                 // 4
00792         kcntladd,               // 5
00793         kzlevel                 // 6
00794     };
00795
00796     virtual void DoDataExchange(bool fill);
00797
00798     void StoreValues(void);
00799     int  OnTcpip(void);
00800
00801 protected:
00802     bool m_checkoutro;
00803     bool m_dirty;
00804     bool m_tcpip;
00805     bool m_prune;
00806     bool m_quiet;
00807     bool m_cntladd;
00808     int  m_zlevel;
00809
00810     UDECLARE_MESSAGE_MAP()
00811 };
00812
00813 UIMPLEMENT_DYNAMIC(UCvsPrefs_GLOBALS, UWidget)
00814
00815 UBEGIN_MESSAGE_MAP(UCvsPrefs_GLOBALS, UWidget)
00816     ON_UCOMMAND(UCvsPrefs_GLOBALS::ktcpip, UCvsPrefs_GLOBALS::OnTcpip)
00817 UEND_MESSAGE_MAP()
00818
00819 UCvsPrefs_GLOBALS::UCvsPrefs_GLOBALS() : UWidget(::UEventGetWidID())
00820 {
00821     m_checkoutro = gCvsPrefs.CheckoutRO();
00822     m_prune = gCvsPrefs.PruneOption();
00823     m_tcpip = gCvsPrefs.Z9Option();
00824     m_quiet = gCvsPrefs.QuietOption();
00825     m_cntladd = gCvsPrefs.AddControl();
00826     m_dirty = gCvsPrefs.DirtySupport();
00827     m_zlevel= gCvsPrefs.ZLevel();
00828 }
00829
00830 void UCvsPrefs_GLOBALS::StoreValues(void)
00831 {
00832     gCvsPrefs.SetCheckoutRO(m_checkoutro);
00833     gCvsPrefs.SetPruneOption(m_prune);
00834     gCvsPrefs.SetZ9Option(m_tcpip);
00835     gCvsPrefs.SetQuietOption(m_quiet);
00836     gCvsPrefs.SetAddControl(m_cntladd);
00837     gCvsPrefs.SetDirtySupport(m_dirty);
00838     gCvsPrefs.SetZLevel(m_zlevel);
00839 }
00840
00841 void UCvsPrefs_GLOBALS::DoDataExchange(bool fill)
00842 {
00843     if(fill)
00844     {
00845         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kcheckoutro, m_checkoutro), 0L);
00846         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kprune, m_prune), 0L);
00847         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(ktcpip, m_tcpip), 0L);
00848         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kquiet, m_quiet), 0L);
00849         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kcntladd, m_cntladd), 0L);
00850         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kdirty, m_dirty), 0L);
00851         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kzlevel, m_zlevel), 0L);
00852     }
00853     else
00854     {
00855         m_checkoutro = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kcheckoutro, 0L) != 0;
00856         m_prune = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kprune, 0L) != 0;
00857         m_tcpip = UEventSendMessage(GetWidID(), EV_QUERYSTATE, ktcpip, 0L) != 0;
00858         m_quiet = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kquiet, 0L) != 0;
00859         m_cntladd = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kcntladd, 0L) != 0;
00860         m_dirty = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kdirty, 0L) != 0;
00861         m_zlevel = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kzlevel, 0L) != 0;
00862     }
00863 }
00864
00865
00866 int UCvsPrefs_GLOBALS::OnTcpip(void)
00867 {
00868     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, ktcpip, 0L);
00869     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kzlevel, state), 0L);
00870     return 0;
00871 }
00872
00873 class UCvsPrefs_PORTS : public UWidget
00874 {
00875     UDECLARE_DYNAMIC(UCvsPrefs_PORTS)
00876 public:
00877     UCvsPrefs_PORTS();
00878     virtual ~UCvsPrefs_PORTS() {}
00879
00880     enum
00881     {
00882         kcheckrhost = EV_COMMAND_START, // 0
00883         kcheckpserver,          // 1
00884         kcheckkserver,          // 2
00885         kchecksname,            // 3
00886         kcheckrsh,              // 4
00887
00888         kportrhost,             // 5
00889         kportpserver,           // 6
00890         kportkserver,           // 7
00891
00892         ksname,                 // 8
00893         krshname                // 9
00894     };
00895
00896     virtual void DoDataExchange(bool fill);
00897
00898     void StoreValues(void);
00899
00900 protected:
00901     bool m_checkrhost;
00902     bool m_checkpserver;
00903     bool m_checkkserver;
00904     bool m_checksname;
00905     bool m_checkrsh;
00906     int m_portrhost;
00907     int m_portpserver;
00908     int m_portkserver;
00909     UStr m_sname;
00910     UStr m_rshname;
00911
00912     ev_msg int OnCheckPorts(int cmd);
00913
00914     UDECLARE_MESSAGE_MAP()
00915 };
00916
00917 UIMPLEMENT_DYNAMIC(UCvsPrefs_PORTS, UWidget)
00918
00919 UBEGIN_MESSAGE_MAP(UCvsPrefs_PORTS, UWidget)
00920     ON_UCOMMAND_RANGE(UCvsPrefs_PORTS::kcheckrhost, UCvsPrefs_PORTS::kcheckrsh, UCvsPrefs_PORTS::OnCheckPorts)
00921 UEND_MESSAGE_MAP()
00922
00923 UCvsPrefs_PORTS::UCvsPrefs_PORTS() : UWidget(::UEventGetWidID())
00924 {
00925     m_checkkserver = gCvsPrefs.KserverPort() != -1;
00926     m_checkpserver = gCvsPrefs.PserverPort() != -1;
00927     m_checkrhost = gCvsPrefs.RhostPort() != -1;
00928     m_checksname = gCvsPrefs.ServerName() != 0L;
00929     m_checkrsh = gCvsPrefs.RshName() != 0L;
00930
00931     m_portkserver = gCvsPrefs.KserverPort() != -1 ? gCvsPrefs.KserverPort() : 0;
00932     m_portpserver = gCvsPrefs.PserverPort() != -1 ? gCvsPrefs.PserverPort() : 0;
00933     m_portrhost = gCvsPrefs.RhostPort() != -1 ? gCvsPrefs.RhostPort() : 0;
00934     m_sname = gCvsPrefs.ServerName() == 0L ? "cvs" : gCvsPrefs.ServerName();
00935     m_rshname = gCvsPrefs.RshName() == 0L ? "ssh" : gCvsPrefs.RshName();
00936 }
00937
00938 void UCvsPrefs_PORTS::StoreValues(void)
00939 {
00940     gCvsPrefs.SetKserverPort(m_checkkserver ? m_portkserver : -1);
00941     gCvsPrefs.SetPserverPort(m_checkpserver ? m_portpserver : -1);
00942     gCvsPrefs.SetRhostPort(m_checkrhost ? m_portrhost : -1);
00943
00944     gCvsPrefs.SetServerName(m_checksname ? (const char *)m_sname : 0L);
00945     gCvsPrefs.SetRshName(m_checkrsh ? (const char *)m_rshname : 0L);
00946 }
00947
00948 int UCvsPrefs_PORTS::OnCheckPorts(int cmd)
00949 {
00950     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, cmd, 0L);
00951     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(cmd + (kportrhost-kcheckrhost), state), 0L);
00952
00953     if( cmd == kcheckrhost ) {
00954         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kchecksname, state), 0L);
00955         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kcheckrsh, state), 0L);
00956     }
00957
00958     return 0;
00959 }
00960
00961 void UCvsPrefs_PORTS::DoDataExchange(bool fill)
00962 {
00963     if(fill)
00964     {
00965         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kcheckkserver, m_checkkserver), 0L);
00966         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kcheckpserver, m_checkpserver), 0L);
00967         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kcheckrhost, m_checkrhost), 0L);
00968         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kchecksname, m_checksname), 0L);
00969         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kcheckrsh, m_checkrsh), 0L);
00970
00971         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kportkserver, m_portkserver), 0L);
00972         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kportpserver, m_portpserver), 0L);
00973         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kportrhost, m_portrhost), 0L);
00974         UEventSendMessage(GetWidID(), EV_SETTEXT, ksname, (void *)(const char *)m_sname);
00975         UEventSendMessage(GetWidID(), EV_SETTEXT, krshname, (void *)(const char *)m_rshname);
00976
00977         OnCheckPorts(kcheckrhost);
00978         OnCheckPorts(kcheckpserver);
00979         OnCheckPorts(kcheckkserver);
00980         OnCheckPorts(kchecksname);
00981         OnCheckPorts(kcheckrsh);
00982     }
00983     else
00984     {
00985         m_checkkserver = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kcheckkserver, 0L) != 0;
00986         m_portkserver = UEventSendMessage(GetWidID(), EV_GETINTEGER, kportkserver, 0L);
00987         m_checkpserver = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kcheckpserver, 0L) != 0;
00988         m_portpserver = UEventSendMessage(GetWidID(), EV_GETINTEGER, kportpserver, 0L);
00989         m_checkrhost = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kcheckrhost, 0L) != 0;
00990         m_portrhost = UEventSendMessage(GetWidID(), EV_GETINTEGER, kportrhost, 0L);
00991
00992         UEventSendMessage(GetWidID(), EV_GETTEXT, ksname, &m_sname);
00993         m_checksname = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kchecksname, 0L) != 0;
00994         UEventSendMessage(GetWidID(), EV_GETTEXT, krshname, &m_rshname);
00995         m_checkrsh = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kcheckrsh, 0L) != 0;
00996     }
00997 }
00998
00999 class UCvsPrefs_PROXY : public UWidget
01000 {
01001     UDECLARE_DYNAMIC(UCvsPrefs_PROXY)
01002 public:
01003     UCvsPrefs_PROXY();
01004     virtual ~UCvsPrefs_PROXY() {}
01005
01006     enum
01007     {
01008         kuseproxy = EV_COMMAND_START,   // 0
01009         kproxyhost,             // 1
01010         kproxyport              // 2
01011     };
01012
01013     virtual void DoDataExchange(bool fill);
01014
01015     void StoreValues(void);
01016
01017 protected:
01018     bool m_useproxy;
01019     UStr m_proxyhost;
01020     int m_proxyport;
01021
01022     ev_msg int OnUseProxy(void);
01023
01024     UDECLARE_MESSAGE_MAP()
01025 };
01026
01027 UIMPLEMENT_DYNAMIC(UCvsPrefs_PROXY, UWidget)
01028
01029 UBEGIN_MESSAGE_MAP(UCvsPrefs_PROXY, UWidget)
01030     ON_UCOMMAND(UCvsPrefs_PROXY::kuseproxy, UCvsPrefs_PROXY::OnUseProxy)
01031 UEND_MESSAGE_MAP()
01032
01033 UCvsPrefs_PROXY::UCvsPrefs_PROXY() : UWidget(::UEventGetWidID())
01034 {
01035     m_useproxy = gCvsPrefs.UseProxy();
01036     m_proxyport = gCvsPrefs.ProxyPort();
01037     m_proxyhost = gCvsPrefs.ProxyHost();
01038 }
01039
01040 void UCvsPrefs_PROXY::StoreValues(void)
01041 {
01042     gCvsPrefs.SetUseProxy(m_useproxy);
01043     gCvsPrefs.SetProxyHost(m_proxyhost);
01044     gCvsPrefs.SetProxyPort(m_proxyport);
01045 }
01046
01047 int UCvsPrefs_PROXY::OnUseProxy(void)
01048 {
01049     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kuseproxy, 0L);
01050     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kproxyhost, state), 0L);
01051     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kproxyport, state), 0L);
01052     return 0;
01053 }
01054
01055 void UCvsPrefs_PROXY::DoDataExchange(bool fill)
01056 {
01057     if(fill)
01058     {
01059         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kuseproxy, m_useproxy), 0L);
01060         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kproxyport, m_proxyport), 0L);
01061         UEventSendMessage(GetWidID(), EV_SETTEXT, kproxyhost, (void *)(const char *)m_proxyhost);
01062
01063         OnUseProxy();
01064     }
01065     else
01066     {
01067         CStr str;
01068         m_useproxy = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kuseproxy, 0L) != 0;
01069         UEventSendMessage(GetWidID(), EV_GETTEXT, kproxyhost, &m_proxyhost);
01070         m_proxyport = UEventSendMessage(GetWidID(), EV_GETINTEGER, kproxyport, 0L);
01071     }
01072 }
01073
01074 class UCvsPrefs_GCVS : public UWidget
01075 {
01076     UDECLARE_DYNAMIC(UCvsPrefs_GCVS)
01077 public:
01078     UCvsPrefs_GCVS();
01079     virtual ~UCvsPrefs_GCVS() {}
01080
01081     enum
01082     {
01083         // program paths
01084         kdiffApp = EV_COMMAND_START,  // 0
01085         kviewerApp,                   // 1
01086         kbrowserApp,                  // 2
01087         khelpApp,                     // 3
01088         kcvsApp,                      // 4
01089
01090         // browse button
01091         kdiffBtn,                     // 5
01092         kviewerBtn,                   // 6
01093         kbrowserBtn,                  // 7
01094         khelpBtn,                     // 8
01095         kcvsBtn,                      // 9
01096
01097         kuseAltCvs                    // 10
01098     };
01099
01100     virtual void DoDataExchange(bool fill);
01101
01102     void StoreValues(void);
01103
01104 protected:
01105     UStr m_diffApp;
01106     UStr m_viewerApp;
01107     UStr m_browserApp;
01108     UStr m_helpApp;
01109     bool m_useAltCvs;
01110     UStr m_cvsApp;
01111
01112     ev_msg int OnPickProgram(int cmd);
01113     ev_msg int OnUseAlternateCvs(void);
01114
01115     bool checkCVS(const char* filename);
01116
01117     UDECLARE_MESSAGE_MAP()
01118 };
01119
01120 UIMPLEMENT_DYNAMIC(UCvsPrefs_GCVS, UWidget)
01121
01122 UBEGIN_MESSAGE_MAP(UCvsPrefs_GCVS, UWidget)
01123     ON_UCOMMAND_RANGE(UCvsPrefs_GCVS::kdiffBtn, UCvsPrefs_GCVS::kcvsBtn, UCvsPrefs_GCVS::OnPickProgram)
01124     ON_UCOMMAND(UCvsPrefs_GCVS::kuseAltCvs, UCvsPrefs_GCVS::OnUseAlternateCvs)
01125 UEND_MESSAGE_MAP()
01126
01127 UCvsPrefs_GCVS::UCvsPrefs_GCVS() : UWidget(::UEventGetWidID())
01128 {
01129     UStr cvsPath;
01130     m_diffApp    = gCvsPrefs.ExtDiff();
01131     m_viewerApp  = gCvsPrefs.Viewer();
01132     m_browserApp = gCvsPrefs.Browser();
01133     m_helpApp    = gCvsPrefs.Helper();
01134     m_useAltCvs  = gCvsPrefs.WhichCvs(cvsPath, true) != 0L;
01135     m_cvsApp     = gCvsPrefs.WhichCvs(cvsPath);
01136 }
01137
01138
01139 bool UCvsPrefs_GCVS::checkCVS(const char *filename)
01140 {
01141     CvsArgs args;
01142     int status;
01143
01144     cvs_out("checking cvs\n");
01145
01146     args.add("-v");
01147
01148     status = testCVS(filename, args.Argc(), args.Argv());
01149     switch( status ) {
01150         case 0:
01151             break; // all OK
01152         case 1:
01153             cvs_err( "alternate cvs have no support for GUI-pipes.\n");
01154             cvs_err( "Please select another binary or uncheck the 'alternate cvs'!\n\n");
01155             break;
01156         default:
01157             break;
01158     }
01159
01160     return ( status == 0 ? true : false );
01161 }
01162 void UCvsPrefs_GCVS::StoreValues(void)
01163 {
01164     gCvsPrefs.SetExtDiff(m_diffApp);
01165     gCvsPrefs.SetViewer(m_viewerApp);
01166     gCvsPrefs.SetBrowser(m_browserApp);
01167     gCvsPrefs.SetHelper(m_helpApp);
01168     gCvsPrefs.SetUseAltCvs(m_useAltCvs);
01169
01170 #ifdef qUnix
01171     // use selected cvs only if it supports '-cvsgui'
01172     if( checkCVS( m_cvsApp ) )
01173         gCvsPrefs.SetWhichCvs( m_cvsApp );
01174 #else
01175     gCvsPrefs.SetWhichCvs(m_cvsApp);
01176 #endif
01177 }
01178
01179 int UCvsPrefs_GCVS::OnPickProgram(int cmd)
01180 {
01181     MultiFiles mf;
01182     if(!BrowserGetMultiFiles("Select a program :", mf))
01183         return 0;
01184
01185     CvsArgs args(false);
01186     mf.next();
01187     const char *dir = mf.add(args);
01188     char * const *argv = args.Argv();
01189     CStr fullpath;
01190     fullpath = dir;
01191     if(!fullpath.endsWith(kPathDelimiter))
01192         fullpath << kPathDelimiter;
01193     fullpath << argv[0];
01194
01195 #ifdef qUnix
01196     // use selected cvs only if it supports '-cvsgui'
01197     if( ( cmd == kcvsBtn ) && !checkCVS( fullpath.c_str() ) )
01198         return 0;
01199 #endif
01200
01201     UEventSendMessage(GetWidID(), EV_SETTEXT, cmd - kdiffBtn + kdiffApp, (void *)(const char *)fullpath);
01202
01203     return 0;
01204 }
01205
01206 int UCvsPrefs_GCVS::OnUseAlternateCvs(void)
01207 {
01208     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kuseAltCvs, 0L);
01209     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kcvsApp, state), 0L);
01210     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kcvsBtn, state), 0L);
01211     return 0;
01212 }
01213
01214 void UCvsPrefs_GCVS::DoDataExchange(bool fill)
01215 {
01216     if(fill)
01217     {
01218         UEventSendMessage(GetWidID(), EV_SETTEXT, kdiffApp, (void *)(const char *)m_diffApp);
01219         UEventSendMessage(GetWidID(), EV_SETTEXT, kviewerApp, (void *)(const char *)m_viewerApp);
01220         UEventSendMessage(GetWidID(), EV_SETTEXT, kbrowserApp, (void *)(const char *)m_browserApp);
01221         UEventSendMessage(GetWidID(), EV_SETTEXT, khelpApp, (void *)(const char *)m_helpApp);
01222         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kuseAltCvs, m_useAltCvs), 0L);
01223         UEventSendMessage(GetWidID(), EV_SETTEXT, kcvsApp, (void *)(const char *)m_cvsApp);
01224         OnUseAlternateCvs();
01225     }
01226     else
01227     {
01228         UEventSendMessage(GetWidID(), EV_GETTEXT, kdiffApp, &m_diffApp);
01229         UEventSendMessage(GetWidID(), EV_GETTEXT, kviewerApp, &m_viewerApp);
01230         UEventSendMessage(GetWidID(), EV_GETTEXT, kbrowserApp, &m_browserApp);
01231         UEventSendMessage(GetWidID(), EV_GETTEXT, khelpApp, &m_helpApp);
01232         m_useAltCvs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kuseAltCvs, 0L) != 0;
01233         UEventSendMessage(GetWidID(), EV_GETTEXT, kcvsApp, &m_cvsApp);
01234     }
01235 }
01236
01237 #endif // qUnix
01238 #if qMacCvsPP
01239
01240 class UCvsPrefs_CVSROOT : public UWidget
01241 {
01242     UDECLARE_DYNAMIC(UCvsPrefs_CVSROOT)
01243 public:
01244     UCvsPrefs_CVSROOT();
01245     virtual ~UCvsPrefs_CVSROOT() {}
01246
01247     enum
01248     {
01249         kAuthenPopup = EV_COMMAND_START + 40,   // 40
01250         kPath,              // 41
01251         kHost,              // 42
01252         kUser,              // 43
01253         kRootPopup,         // 44
01254         kRootStat,          // 45
01255         kCvsVers,           // 46
01256         kAuthenSettings,    // 47
01257         kAuthenDesc         // 48
01258     };
01259
01260     virtual void DoDataExchange(bool fill);
01261
01262 protected:
01263     UStr m_cvsroot;
01264     AuthenKind m_kind;
01265
01266     ev_msg void OnAuthenPopup(int pos, const char *txt);
01267     ev_msg void OnRootPopup(int pos, const char *txt);
01268     ev_msg void OnEditChange(int cmd);
01269     ev_msg int OnAuthenSettings(void);
01270     ev_msg void OnDestroy(void);
01271
01272     UDECLARE_MESSAGE_MAP()
01273 };
01274
01275 UIMPLEMENT_DYNAMIC(UCvsPrefs_CVSROOT, UWidget)
01276
01277 UBEGIN_MESSAGE_MAP(UCvsPrefs_CVSROOT, UWidget)
01278     ON_COMBO_SEL(kAuthenPopup, OnAuthenPopup)
01279     ON_COMBO_SEL(kRootPopup, OnRootPopup)
01280     ON_EDITCHANGE_RANGE(kPath, kUser, OnEditChange)
01281     ON_UCOMMAND(kAuthenSettings, OnAuthenSettings)
01282     ON_UDESTROY(UCvsPrefs_CVSROOT)
01283 UEND_MESSAGE_MAP()
01284
01285 UCvsPrefs_CVSROOT::UCvsPrefs_CVSROOT() : UWidget(::UEventGetWidID())
01286 {
01287 }
01288
01289 void UCvsPrefs_CVSROOT::OnAuthenPopup(int pos, const char *txt)
01290 {
01291     m_kind = Authen::numToKind(pos);
01292     AuthenModel *model = AuthenModel::GetInstance(m_kind);
01293     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kHost, model->HasHost()), 0L);
01294     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kUser, model->HasUser()), 0L);
01295     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kAuthenSettings, model->HasSettings()), 0L);
01296
01297     if(!model->HasHost())
01298         UEventSendMessage(GetWidID(), EV_SETTEXT, kHost, (void *)"");
01299     if(!model->HasUser())
01300         UEventSendMessage(GetWidID(), EV_SETTEXT, kUser, (void *)"");
01301     UStr desc;
01302     model->GetSettingsDesc(desc);
01303     UEventSendMessage(GetWidID(), EV_SETTEXT, kAuthenDesc, (void *)(const char *)desc);
01304 }
01305
01306 void UCvsPrefs_CVSROOT::OnRootPopup(int pos, const char *txt)
01307 {
01308     m_cvsroot = txt;
01309     UEventSendMessage(GetWidID(), EV_SETTEXT, kRootStat, (void *)txt);
01310
01311     UStr theMethod, theUser, theHost, thePath;
01312
01313     if(Authen::parse_cvsroot(txt, theMethod, theUser, theHost, thePath))
01314     {
01315         UEventSendMessage(GetWidID(), EV_SETTEXT, kPath, (void *)(const char *)thePath);
01316         UEventSendMessage(GetWidID(), EV_SETTEXT, kHost, (void *)(const char *)theHost);
01317         UEventSendMessage(GetWidID(), EV_SETTEXT, kUser, (void *)(const char *)theUser);
01318         if (theMethod.length () > 0)
01319             UEventSendMessage(GetWidID(), EV_COMBO_SETSEL,
01320                               UMAKEINT(kAuthenPopup, Authen::kindToNum(Authen::tokenToKind (theMethod.c_str ()))), 0L);
01321     }
01322 }
01323
01324 void UCvsPrefs_CVSROOT::OnEditChange(int cmd)
01325 {
01326     UStr theUser, theHost, thePath;
01327
01328     UEventSendMessage(GetWidID(), EV_GETTEXT, kPath, &thePath);
01329     UEventSendMessage(GetWidID(), EV_GETTEXT, kHost, &theHost);
01330     UEventSendMessage(GetWidID(), EV_GETTEXT, kUser, &theUser);
01331
01332     m_cvsroot = "";
01333     AuthenModel *model = AuthenModel::GetInstance(m_kind);
01334     if(model->HasUser())
01335         m_cvsroot << theUser;
01336     if(model->HasHost())
01337     {
01338         m_cvsroot << '@';
01339         m_cvsroot << theHost;
01340     }
01341     if(model->HasUser() || model->HasHost())
01342         m_cvsroot << ':';
01343     m_cvsroot << thePath;
01344     UEventSendMessage(GetWidID(), EV_SETTEXT, kRootStat, (void *)(const char *)m_cvsroot);
01345 }
01346
01347 int UCvsPrefs_CVSROOT::OnAuthenSettings(void)
01348 {
01349     AuthenModel *model = AuthenModel::GetInstance(m_kind);
01350     model->DoSettings();
01351     UStr desc;
01352     model->GetSettingsDesc(desc);
01353     UEventSendMessage(GetWidID(), EV_SETTEXT, kAuthenDesc, (void *)(const char *)desc);
01354     return 0;
01355 }
01356
01357 void UCvsPrefs_CVSROOT::OnDestroy(void)
01358 {
01359     delete this;
01360 }
01361
01362 void UCvsPrefs_CVSROOT::DoDataExchange(bool fill)
01363 {
01364     if(fill)
01365     {
01366         if(!gCvsPrefs.empty())
01367             m_cvsroot = (const char *)gCvsPrefs;
01368         m_kind = gAuthen.kind();
01369
01370         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kAuthenPopup, 0L);
01371         std::vector<AuthenModel *> & allAuthen = AuthenModel::GetAllInstances();
01372         std::vector<AuthenModel *>::iterator i;
01373         for(i = allAuthen.begin(); i != allAuthen.end(); ++i)
01374         {
01375             UEventSendMessage(GetWidID(), EV_COMBO_APPEND,
01376                               kAuthenPopup, (void *)(*i)->GetToken());
01377         }
01378
01379         AuthenModel *model = AuthenModel::GetInstance(m_kind);
01380         UEventSendMessage(GetWidID(), EV_COMBO_SETSEL,
01381                           UMAKEINT(kAuthenPopup, Authen::kindToNum(model->GetKind())), 0L);
01382
01383         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kRootPopup, 0L);
01384 #ifndef MIGRATECVSROOTLIST
01385         for(int i = 0; i < NUM_CVSROOT; i++)
01386         {
01387             const CPStr & strroot =
01388                 (*(const CvsPrefs *)&gCvsPrefs).get_cvsroot_list(i);
01389             if(!strroot.empty())
01390                 UEventSendMessage(GetWidID(), EV_COMBO_APPEND,
01391                                   kRootPopup, (void *)(const char *)strroot);
01392         }
01393 #else
01394         std::vector<CStr>::const_iterator haley;
01395         const std::vector<CStr> & alex = gOldCvsroots.GetList();
01396         for(haley = alex.begin(); haley != alex.end(); ++haley)
01397         {
01398             if(!(*haley).empty())
01399                 UEventSendMessage(GetWidID(), EV_COMBO_APPEND,
01400                                   kRootPopup, (void *)(*haley).c_str());
01401         }
01402 #endif
01403
01404         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCvsVers, 1), 0L);
01405
01406         UStr tmp(m_cvsroot);
01407         OnRootPopup(0, tmp);
01408         OnAuthenPopup(Authen::kindToNum(m_kind), 0L);
01409
01410         UEventSendMessage(GetWidID(), EV_CHGFOCUS, kPath, 0L);
01411     }
01412     else
01413     {
01414         gAuthen.setkind(m_kind);
01415
01416         UStr theUser, theHost, thePath;
01417
01418         UEventSendMessage(GetWidID(), EV_GETTEXT, kPath, &thePath);
01419         UEventSendMessage(GetWidID(), EV_GETTEXT, kHost, &theHost);
01420         UEventSendMessage(GetWidID(), EV_GETTEXT, kUser, &theUser);
01421
01422         UStr root;
01423         if(m_kind != local)
01424         {
01425             root << theUser;
01426             root << '@';
01427             root << theHost;
01428             root << ':';
01429             root << thePath;
01430         }
01431         else
01432             root = thePath;
01433
01434         gCvsPrefs = root;
01435
01436 #ifdef MIGRATECVSROOTLIST
01437         if( !root.empty() )
01438             gOldCvsroots.Insert(root);
01439 #endif
01440     }
01441 }
01442
01443 static void DoDataExchange_Cvsroot(UCvsPrefs_CVSROOT *handler, bool putValue)
01444 {
01445     handler->DoDataExchange(putValue);
01446 }
01447 #endif // qMacCvsPP
01448
01449 void CompatGetPrefs(void)
01450 {
01451     bool userHitOK = false;
01452
01453 #ifdef WIN32
01454     CPropertySheet pages("WinCvs Preferences");
01455     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01456     CGetPrefs_CVSROOT page1;
01457     CGetPrefs_GLOBALS page2;
01458     CGetPrefs_WINCVS page4;
01459     CGetPrefs_CVSCMD_DIALOGS page5;
01460     pages.AddPage(&page1);
01461     pages.AddPage(&page2);
01462     pages.AddPage(&page4);
01463     pages.AddPage(&page5);
01464     if(pages.DoModal() == IDOK)
01465     {
01466         page1.StoreValues();
01467         page2.StoreValues();
01468         page4.StoreValues();
01469         page5.StoreValues();
01470         userHitOK = true;
01471     }
01472 #endif /* WIN32 */
01473 #ifdef qMacCvsPP
01474     MacBinMaps maps;
01475     maps.LoadDefaults();
01476     CMacBinTable::SetCurrentMap(&maps);
01477
01478     StDialogHandler theHandler(dlg_Prefs, LCommander::GetTopCommander());
01479     LWindow *theDialog = theHandler.GetDialog();
01480     ThrowIfNil_(theDialog);
01481     static UInt16 sRuntimePanel = 1;
01482
01483     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01484         (theDialog->FindPaneByID(item_MultiViewPrefs));
01485     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01486
01487     UCvsPrefs_CVSROOT *handler = new UCvsPrefs_CVSROOT;
01488     ThrowIfNil_(handler);
01489
01490     UEventSendMessage(handler->GetWidID(), EV_INIT_WIDGET, 0, theDialog);
01491
01492     multiView->SwitchToPanel(5);
01493     DoDataExchange_Fonts(theDialog, true);
01494     multiView->SwitchToPanel(4);
01495     DoDataExchange_BinFiles(theDialog, maps, true);
01496     multiView->SwitchToPanel(3);
01497     DoDataExchange_TextFiles(theDialog, true);
01498     multiView->SwitchToPanel(2);
01499     DoDataExchange_Globals(theDialog, true);
01500     multiView->SwitchToPanel(1);
01501     DoDataExchange_Cvsroot(handler, true);
01502
01503     groupView->SetValue(sRuntimePanel);
01504     theDialog->Show();
01505     MessageT hitMessage;
01506     while (true)
01507     {       // Let DialogHandler process events
01508         hitMessage = theHandler.DoDialog();
01509
01510         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01511             break;
01512     }
01513     theDialog->Hide();
01514     sRuntimePanel = groupView->GetValue();
01515
01516     if(hitMessage == msg_OK)
01517     {
01518         userHitOK = true;
01519
01520         multiView->SwitchToPanel(1);
01521         DoDataExchange_Cvsroot(handler, false);
01522         multiView->SwitchToPanel(2);
01523         DoDataExchange_Globals(theDialog, false);
01524         multiView->SwitchToPanel(3);
01525         DoDataExchange_TextFiles(theDialog, false);
01526         multiView->SwitchToPanel(4);
01527         DoDataExchange_BinFiles(theDialog, maps, false);
01528         multiView->SwitchToPanel(5);
01529         DoDataExchange_Fonts(theDialog, false);
01530
01531         maps.SaveDefaults();
01532     }
01533 #endif /* qMacCvsPP */
01534 #if qUnix
01535     void *wid = UCreate_gcvs_Settings();
01536
01537     UCvsPrefs_MAIN *dlg = new UCvsPrefs_MAIN();
01538     UCvsPrefs_CVSROOT *tab1 = new UCvsPrefs_CVSROOT();
01539     UCvsPrefs_GLOBALS *tab2 = new UCvsPrefs_GLOBALS();
01540     UCvsPrefs_PORTS *tab3 = new UCvsPrefs_PORTS();
01541     UCvsPrefs_PROXY *tab4 = new UCvsPrefs_PROXY();
01542     UCvsPrefs_GCVS *tab5 = new UCvsPrefs_GCVS();
01543     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01544     dlg->AddPage(tab1, UCvsPrefs_MAIN::kTabGeneral, 0);
01545     dlg->AddPage(tab2, UCvsPrefs_MAIN::kTabGeneral, 1);
01546     dlg->AddPage(tab3, UCvsPrefs_MAIN::kTabGeneral, 2);
01547     dlg->AddPage(tab4, UCvsPrefs_MAIN::kTabGeneral, 3);
01548     dlg->AddPage(tab5, UCvsPrefs_MAIN::kTabGeneral, 4);
01549
01550     if(dlg->DoModal())
01551     {
01552         tab1->StoreValues();
01553         tab2->StoreValues();
01554         tab3->StoreValues();
01555         tab4->StoreValues();
01556         tab5->StoreValues();
01557
01558         userHitOK = true;
01559     }
01560     delete dlg;
01561 #endif // qUnix
01562
01563     if(userHitOK && !gCvsPrefs.empty())
01564     {
01565         cvs_out("NEW CVSROOT: %s (%s)\n", (const char *)gCvsPrefs, gAuthen.kindstr());
01566         gCvsPrefs.save();
01567     }
01568 }
Generated on Sun Feb 24 01:21:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/GetPrefs.h Source File

common/GetPrefs.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 #if !defined(AFX_GETPREFS_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
00022 #define AFX_GETPREFS_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_
00023
00024 #if _MSC_VER >= 1000
00025 #pragma once
00026 #endif // _MSC_VER >= 1000
00027
00028 #include "SmartComboBox.h"
00029
00030 #ifdef WIN32
00031 #include "Authen.h"
00032 #endif
00033
00034 void CompatGetPrefs(void);
00035     // get the CVSROOT, authentication, and misc options...
00036
00037 #ifdef WIN32
00038
00039 class CGetPrefs_CVSROOT : public CPropertyPage
00040 {
00041     DECLARE_DYNCREATE(CGetPrefs_CVSROOT)
00042
00043 // Construction
00044 public:
00045     CGetPrefs_CVSROOT();
00046     ~CGetPrefs_CVSROOT();
00047
00048     void StoreValues();
00049
00050     // Dialog Data
00051     //{{AFX_DATA(CGetPrefs_CVSROOT)
00052     enum { IDD = IDD_PREFS_CVSROOT };
00053     CSmartComboBox  m_versCombo;
00054     CSmartComboBox  m_authenCombo;
00055     CSmartComboBox  m_cvsrootCombo;
00056     CString     m_cvsroot;
00057     int         m_cvsvers;
00058     AuthenKind  m_authen;
00059     CString m_host;
00060     CString m_login;
00061     CString m_path;
00062     BOOL        m_cvsconsole;
00063     //}}AFX_DATA
00064
00065 // Overrides
00066     // ClassWizard generate virtual function overrides
00067     //{{AFX_VIRTUAL(CGetPrefs_CVSROOT)
00068     protected:
00069     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00070     //}}AFX_VIRTUAL
00071
00072 // Implementation
00073 protected:
00074     bool m_didInteract;
00075     bool m_flag;
00076
00077     void FillFields(void);
00078     void OnChangeFields(void);
00079
00080     // Generated message map functions
00081     //{{AFX_MSG(CGetPrefs_CVSROOT)
00082     afx_msg void OnSelchangeAuthen();
00083     afx_msg void OnChangePath();
00084     afx_msg void OnChangeHost();
00085     afx_msg void OnChangeLogin();
00086     afx_msg void OnSettings();
00087     afx_msg void OnSelchangeComboroot();
00088     afx_msg void OnEditchangeComboroot();
00089     //}}AFX_MSG
00090     DECLARE_MESSAGE_MAP()
00091 };
00092
00093 class CGetPrefs_GLOBALS : public CPropertyPage
00094 {
00095     DECLARE_DYNCREATE(CGetPrefs_GLOBALS)
00096
00097 // Construction
00098 public:
00099     CGetPrefs_GLOBALS();
00100     ~CGetPrefs_GLOBALS();
00101
00102     void StoreValues();
00103
00104 // Dialog Data
00105     //{{AFX_DATA(CGetPrefs_GLOBALS)
00106     enum { IDD = IDD_PREFS_GLOBALS };
00107     CSpinButtonCtrl m_zspin;
00108     CSpinButtonCtrl m_spin;
00109     BOOL    m_checkoutro;
00110     BOOL    m_prune;
00111     BOOL    m_tcpip;
00112     BOOL    m_quiet;
00113     BOOL    m_cntladd;
00114     BOOL    m_dirty;
00115         BOOL    m_alwaysroot;
00116     BOOL    m_logout;
00117     UINT    m_editlogout;
00118     BOOL    m_unixlf;
00119     UINT    m_zlevel;
00120     //}}AFX_DATA
00121
00122
00123 // Overrides
00124     // ClassWizard generate virtual function overrides
00125     //{{AFX_VIRTUAL(CGetPrefs_GLOBALS)
00126     protected:
00127     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00128     //}}AFX_VIRTUAL
00129
00130 // Implementation
00131 protected:
00132     bool m_didInteract;
00133
00134     // Generated message map functions
00135     //{{AFX_MSG(CGetPrefs_GLOBALS)
00136     afx_msg void OnLogout();
00137     afx_msg void OnCheckunixlf();
00138     afx_msg void OnTcpip();
00139     virtual BOOL OnInitDialog();
00140     //}}AFX_MSG
00141     DECLARE_MESSAGE_MAP()
00142
00143 };
00144
00145 class CGetPrefs_WINCVS : public CPropertyPage
00146 {
00147     DECLARE_DYNCREATE(CGetPrefs_WINCVS)
00148
00149 // Construction
00150 public:
00151     CGetPrefs_WINCVS();
00152     ~CGetPrefs_WINCVS();
00153
00154     void StoreValues();
00155
00156 // Dialog Data
00157     //{{AFX_DATA(CGetPrefs_WINCVS)
00158     enum { IDD = IDD_PREFS_WINCVS };
00159     CString m_viewer;
00160     CString m_diffprog;
00161     BOOL    m_chkdiff;
00162     CString m_home;
00163     BOOL    m_chkUseViewerAlways;
00164     BOOL    m_cvschk;
00165     CString m_cvsprog;
00166     //}}AFX_DATA
00167
00168
00169 // Overrides
00170     // ClassWizard generate virtual function overrides
00171     //{{AFX_VIRTUAL(CGetPrefs_WINCVS)
00172     protected:
00173     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00174     //}}AFX_VIRTUAL
00175
00176 // Implementation
00177 protected:
00178     bool m_didInteract;
00179
00180     // Generated message map functions
00181     //{{AFX_MSG(CGetPrefs_WINCVS)
00182     afx_msg void OnBtnviewer();
00183     afx_msg void OnExtdiffsel();
00184     afx_msg void OnExtdiff();
00185     afx_msg void OnBtnhome();
00186     afx_msg void OnAltcvschk();
00187     afx_msg void OnAltcvssel();
00188     //}}AFX_MSG
00189     DECLARE_MESSAGE_MAP()
00190
00191 };
00192
00193 class CGetPrefs_CVSCMD_DIALOGS : public CPropertyPage
00194 {
00195     DECLARE_DYNCREATE(CGetPrefs_CVSCMD_DIALOGS)
00196
00197 // Construction
00198 public:
00199     CGetPrefs_CVSCMD_DIALOGS();
00200     ~CGetPrefs_CVSCMD_DIALOGS();
00201
00202     void StoreValues();
00203
00204 // Dialog Data
00205     //{{AFX_DATA(CGetPrefs_CVSCMD_DIALOGS)
00206     enum { IDD = IDD_PREFS_CVSCMD_DIALOGS };
00207     BOOL    m_hideUpdate;
00208     BOOL    m_hideDiff;
00209     BOOL    m_hideGraph;
00210     BOOL    m_hideLog;
00211     int     m_keyForce;
00212     BOOL    m_hideAnnotate;
00213     //}}AFX_DATA
00214
00215
00216 // Overrides
00217     // ClassWizard generate virtual function overrides
00218     //{{AFX_VIRTUAL(CGetPrefs_CVSCMD_DIALOGS)
00219     protected:
00220     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00221     //}}AFX_VIRTUAL
00222
00223 // Implementation
00224 protected:
00225     bool m_didInteract;
00226
00227     // Generated message map functions
00228     //{{AFX_MSG(CGetPrefs_CVSCMD_DIALOGS)
00229         // NOTE: the ClassWizard will add member functions here
00230     //}}AFX_MSG
00231     DECLARE_MESSAGE_MAP()
00232
00233 };
00234 //{{AFX_INSERT_LOCATION}}
00235 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00236
00237 #endif /* WIN32 */
00238
00239 #endif // !defined(AFX_GETPREFS_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/GetValue.cpp Source File

common/GetValue.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 // GetValue.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025
00026 #ifdef macintosh
00027 #   define kDlgIdGetValue 128
00028 #   include <Dialogs.h>
00029 #   include <TextUtils.h>
00030 #   include <string.h>
00031 #   include "MacMisc.h"
00032 #endif /* macintosh */
00033
00034 #ifdef WIN32
00035 #   include "wincvs.h"
00036 #endif /* WIN32 */
00037
00038 #include "GetValue.h"
00039
00040 #ifdef _DEBUG
00041 #define new DEBUG_NEW
00042 #undef THIS_FILE
00043 static char THIS_FILE[] = __FILE__;
00044 #endif
00045
00046 #ifdef WIN32
00047
00048 // GetValue dialog
00049
00050
00051 GetValue::GetValue(const char *defvalue, const char *title, CWnd* pParent /*=NULL*/)
00052     : CDialog(GetValue::IDD, pParent)
00053 {
00054     //{{AFX_DATA_INIT(GetValue)
00055     m_value = defvalue != NULL ? defvalue : "";
00056     m_prompt = title != NULL ? title : "";
00057     //}}AFX_DATA_INIT
00058 }
00059
00060 //BOOL GetValue::OnInitDialog()
00061 //{
00062 //  BOOL result = CDialog::OnInitDialog();
00063 //
00064 //  if (result)
00065 //      GotoDlgCtrl(GetDlgItem(IDC_PROMPTEDIT));
00066 //
00067 //  return result;
00068 //}
00069
00070 void GetValue::DoDataExchange(CDataExchange* pDX)
00071 {
00072     CDialog::DoDataExchange(pDX);
00073
00074     //{{AFX_DATA_MAP(GetValue)
00075     DDX_Text(pDX, IDC_PROMPTVALUE, m_prompt);
00076     DDX_Text(pDX, IDC_PROMPTEDIT, m_value);
00077     DDV_MinChars(pDX, m_value, 1);
00078     //}}AFX_DATA_MAP
00079 }
00080
00081
00082 BEGIN_MESSAGE_MAP(GetValue, CDialog)
00083     //{{AFX_MSG_MAP(GetValue)
00084         // NOTE: the ClassWizard will add message map macros here
00085     //}}AFX_MSG_MAP
00086 END_MESSAGE_MAP()
00087
00089 // GetValue message handlers
00090 #endif /* WIN32 */
00091
00092 bool CompatGetValue(char *value, const char *defvalue, const char *title)
00093 {
00094 #ifdef WIN32
00095     GetValue gv(defvalue, title);
00096     if(gv.DoModal() == IDOK)
00097     {
00098         strcpy(value, gv.m_value);
00099         return true;
00100     }
00101     return false;
00102 #endif /* WIN32 */
00103 #ifdef macintosh
00104     GrafPtr     OldPort;
00105     DialogPtr   alertDialog;
00106     short       WhichItem = 0;
00107     Str255 pdef = {'\0'}, ptitle = {'\0'}, pvalue;
00108
00109     if(defvalue != NULL)
00110     {
00111         strcpy((char *)pdef, defvalue);
00112         c2pstr((char *)pdef);
00113     }
00114     if(title != NULL)
00115     {
00116         strcpy((char *)ptitle, title);
00117         c2pstr((char *)ptitle);
00118     }
00119
00120     GetPort(&OldPort);
00121     alertDialog = GetNewDialog(kDlgIdGetValue, NULL, (WindowPtr)-1);
00122     SetPort(alertDialog);
00123
00124     SetDialogItemText(GetDItemHdl(alertDialog, 3), pdef);
00125     SetDialogItemText(GetDItemHdl(alertDialog, 4), ptitle);
00126
00127     while(WhichItem != 1 && WhichItem != 2)
00128     {
00129         ModalDialog(NULL, &WhichItem);
00130
00131         if(WhichItem == 1)
00132         {
00133             GetDialogItemText(GetDItemHdl(alertDialog, 3), pvalue);
00134             if(pvalue[0] == '\0')
00135                 WhichItem = 0;
00136         }
00137     }
00138
00139     if(WhichItem == 1)
00140     {
00141         GetDialogItemText(GetDItemHdl(alertDialog, 3), pvalue);
00142         p2cstr(pvalue);
00143         strcpy(value, (char *)pvalue);
00144     }
00145
00146     DisposeDialog(alertDialog);
00147     SetPort(OldPort);
00148
00149     return WhichItem == 1;
00150 #endif /* macintosh */
00151 #ifdef UNIX_CVS
00152     return false;
00153 #endif /* UNIX_CVS */
00154 }
Generated on Sun Feb 24 01:21:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/GetValue.h Source File

common/GetValue.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 #if !defined(AFX_GETVALUE_H__5946A8C3_8517_11D1_8949_444553540000__INCLUDED_)
00022 #define AFX_GETVALUE_H__5946A8C3_8517_11D1_8949_444553540000__INCLUDED_
00023
00024 #if _MSC_VER >= 1000
00025 #pragma once
00026 #endif // _MSC_VER >= 1000
00027 // GetValue.h : header file
00028 //
00029
00030 #ifdef macintosh
00031 #   define MAX_VALUE_LEN 255
00032 #else /* !macintosh */
00033 #   define MAX_VALUE_LEN 1024
00034 #endif /* !macintosh */
00035
00036 bool CompatGetValue(char *value, const char *defvalue = 0L, const char *title = 0L);
00037
00038 #ifdef WIN32
00039
00040 // GetValue dialog
00041
00042 class GetValue : public CDialog
00043 {
00044 // Construction
00045 public:
00046     GetValue(const char *defvalue, const char *title, CWnd* pParent = NULL);   // standard constructor
00047
00048 // Dialog Data
00049     //{{AFX_DATA(GetValue)
00050     enum { IDD = IDD_GETVALUE };
00051     CString m_prompt;
00052     CString m_value;
00053     //}}AFX_DATA
00054
00055
00056 // Overrides
00057     // ClassWizard generated virtual function overrides
00058     //{{AFX_VIRTUAL(GetValue)
00059     protected:
00060     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00061     //}}AFX_VIRTUAL
00062
00063 // Implementation
00064 protected:
00065
00066     // Generated message map functions
00067     //{{AFX_MSG(GetValue)
00068         // NOTE: the ClassWizard will add member functions here
00069     //}}AFX_MSG
00070     DECLARE_MESSAGE_MAP()
00071 };
00072
00073 //{{AFX_INSERT_LOCATION}}
00074 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00075 #endif /* WIN32 */
00076
00077 #endif // !defined(AFX_GETVALUE_H__5946A8C3_8517_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/GraphOptDlg.cpp Source File

common/GraphOptDlg.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- September 2001
00019  */
00020
00021 /*
00022  * GraphOptDlg.cpp --- graph options dialog
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef WIN32
00028 #include "wincvs.h"
00029 #include "MainFrm.h"
00030 #include "GraphView.h"
00031 #endif /* WIN32 */
00032
00033 #include "GraphOptDlg.h"
00034 #include "CvsPrefs.h"
00035
00036
00037 #ifdef _DEBUG
00038 #define new DEBUG_NEW
00039 #undef THIS_FILE
00040 static char THIS_FILE[] = __FILE__;
00041 #endif
00042
00044 // CGraphOptDlg dialog
00045
00046 #ifdef WIN32
00047
00048 CGraphOptDlg::CGraphOptDlg(CPersistentInt& selColor, CPersistentInt& shadowColor,
00049                            CPersistentInt& headerColor, CPersistentInt& tagColor, CPersistentInt& branchColor,
00050                            CPersistentInt& nodeColor, CPersistentInt& deadNodeColor, CPersistentInt& userStateNodeColor,
00051                            CWnd* pParent /*=NULL*/)
00052     : CDialog(CGraphOptDlg::IDD, pParent),
00053     m_selColor(selColor), m_shadowColor(shadowColor),
00054     m_headerColor(headerColor), m_tagColor(tagColor), m_branchColor(branchColor),
00055     m_nodeColor(nodeColor), m_deadNodeColor(deadNodeColor), m_userStateNodeColor(userStateNodeColor)
00056 {
00057     //{{AFX_DATA_INIT(CGraphOptDlg)
00058         // NOTE: the ClassWizard will add member initialization here
00059     //}}AFX_DATA_INIT
00060
00061     m_rgbShadow.SetColor((int)m_shadowColor);
00062     m_rgbSelection.SetColor((int)m_selColor);
00063     m_rgbState.SetColor((int)m_userStateNodeColor);
00064     m_rgbDead.SetColor((int)m_deadNodeColor);
00065     m_rgbNode.SetColor((int)m_nodeColor);
00066     m_rgbBranch.SetColor((int)m_branchColor);
00067     m_rgbTag.SetColor((int)m_tagColor);
00068     m_rgbHeader.SetColor((int)m_headerColor);
00069
00070     m_origSelColor = m_selColor;
00071     m_origShadowColor = m_shadowColor;
00072     m_origHeaderColor = m_headerColor;
00073     m_origTagColor = m_tagColor;
00074     m_origBranchColor = m_branchColor;
00075     m_origNodeColor = m_deadNodeColor;
00076     m_origDeadNodeColor = m_deadNodeColor;
00077     m_origUserStateNodeColor = m_userStateNodeColor;
00078 }
00079
00080
00081 void CGraphOptDlg::DoDataExchange(CDataExchange* pDX)
00082 {
00083     CDialog::DoDataExchange(pDX);
00084     //{{AFX_DATA_MAP(CGraphOptDlg)
00085     DDX_Control(pDX, IDC_APPLY, m_apply);
00086     DDX_Control(pDX, IDC_RGBSHADOW, m_rgbShadow);
00087     DDX_Control(pDX, IDC_RGBSELECTION, m_rgbSelection);
00088     DDX_Control(pDX, IDC_RGBSTATE, m_rgbState);
00089     DDX_Control(pDX, IDC_RGBDEAD, m_rgbDead);
00090     DDX_Control(pDX, IDC_RGBNODE, m_rgbNode);
00091     DDX_Control(pDX, IDC_RGBBRANCH, m_rgbBranch);
00092     DDX_Control(pDX, IDC_RGBTAG, m_rgbTag);
00093     DDX_Control(pDX, IDC_RGBHEADER, m_rgbHeader);
00094     //}}AFX_DATA_MAP
00095 }
00096
00097
00098 BEGIN_MESSAGE_MAP(CGraphOptDlg, CDialog)
00099     //{{AFX_MSG_MAP(CGraphOptDlg)
00100     ON_BN_CLICKED(IDC_APPLY, OnApply)
00101     ON_BN_CLICKED(IDC_HEADER, OnHeader)
00102     ON_BN_CLICKED(IDC_TAG, OnTag)
00103     ON_BN_CLICKED(IDC_BRANCH, OnBranch)
00104     ON_BN_CLICKED(IDC_NODE, OnNode)
00105     ON_BN_CLICKED(IDC_DEAD, OnDead)
00106     ON_BN_CLICKED(IDC_STATE, OnState)
00107     ON_BN_CLICKED(IDC_SELECTION, OnSelection)
00108     ON_BN_CLICKED(IDC_SHADOW, OnShadow)
00109     ON_BN_CLICKED(IDC_RESET, OnReset)
00110     //}}AFX_MSG_MAP
00111 END_MESSAGE_MAP()
00112
00114 // CGraphOptDlg message handlers
00115
00116 void CGraphOptDlg::GetAllColors()
00117 {
00118     m_shadowColor = (int)m_rgbShadow.GetColor();
00119     m_selColor = (int)m_rgbSelection.GetColor();
00120     m_userStateNodeColor = (int)m_rgbState.GetColor();
00121     m_deadNodeColor = (int)m_rgbDead.GetColor();
00122     m_nodeColor = (int)m_rgbNode.GetColor();
00123     m_branchColor = (int)m_rgbBranch.GetColor();
00124     m_tagColor = (int)m_rgbTag.GetColor();
00125     m_headerColor = (int)m_rgbHeader.GetColor();
00126 }
00127
00128 void CGraphOptDlg::OnOK()
00129 {
00130     GetAllColors();
00131
00132     CDialog::OnOK();
00133 }
00134
00135 void CGraphOptDlg::OnApply()
00136 {
00137     GetAllColors();
00138
00139     CWincvsApp* pApp = (CWincvsApp*)AfxGetApp();
00140     if( pApp )
00141     {
00142         pApp->UpdateAllDocsView();
00143     }
00144
00145     m_apply.EnableWindow(FALSE);
00146 }
00147
00148 void CGraphOptDlg::OnCancel()
00149 {
00150     m_selColor = m_origSelColor;
00151     m_shadowColor = m_origShadowColor;
00152     m_headerColor = m_origHeaderColor;
00153     m_tagColor = m_origTagColor;
00154     m_branchColor = m_origBranchColor;
00155     m_deadNodeColor = m_origNodeColor;
00156     m_deadNodeColor = m_origDeadNodeColor;
00157     m_userStateNodeColor = m_origUserStateNodeColor;
00158
00159     CDialog::OnCancel();
00160 }
00161
00162 void CGraphOptDlg::PromptForColor(CColorStatic& colorStatic)
00163 {
00164     CColorDialog colorDialog(colorStatic.GetColor());
00165     if( colorDialog.DoModal() == IDOK )
00166     {
00167         if( colorDialog.GetColor() != colorStatic.GetColor() )
00168         {
00169             colorStatic.SetColor(colorDialog.GetColor());
00170             m_apply.EnableWindow();
00171         }
00172     }
00173 }
00174
00175 void CGraphOptDlg::OnHeader()
00176 {
00177     PromptForColor(m_rgbHeader);
00178 }
00179
00180 void CGraphOptDlg::OnTag()
00181 {
00182     PromptForColor(m_rgbTag);
00183 }
00184
00185 void CGraphOptDlg::OnBranch()
00186 {
00187     PromptForColor(m_rgbBranch);
00188 }
00189
00190 void CGraphOptDlg::OnNode()
00191 {
00192     PromptForColor(m_rgbNode);
00193 }
00194
00195 void CGraphOptDlg::OnDead()
00196 {
00197     PromptForColor(m_rgbDead);
00198 }
00199
00200 void CGraphOptDlg::OnState()
00201 {
00202     PromptForColor(m_rgbState);
00203 }
00204
00205 void CGraphOptDlg::OnSelection()
00206 {
00207     PromptForColor(m_rgbSelection);
00208 }
00209
00210 void CGraphOptDlg::OnShadow()
00211 {
00212     PromptForColor(m_rgbShadow);
00213 }
00214
00215 void CGraphOptDlg::OnReset()
00216 {
00217     m_rgbShadow.SetColor(RGB_DEF_SHADOW);
00218     m_rgbSelection.SetColor(RGB_DEF_SEL);
00219     m_rgbState.SetColor(RGB_DEF_USERSTATENODE);
00220     m_rgbDead.SetColor(RGB_DEF_DEADNODE);
00221     m_rgbNode.SetColor(RGB_DEF_NODE);
00222     m_rgbBranch.SetColor(RGB_DEF_BRANCH);
00223     m_rgbTag.SetColor(RGB_DEF_TAG);
00224     m_rgbHeader.SetColor(RGB_DEF_HEADER);
00225
00226     m_apply.EnableWindow();
00227 }
00228
00229 #endif /* WIN32 */
00230
00231 bool CompatGetGraphOptions(CPersistentInt& selColor, CPersistentInt& shadowColor,
00232                            CPersistentInt& headerColor, CPersistentInt& tagColor, CPersistentInt& branchColor,
00233                            CPersistentInt& nodeColor, CPersistentInt& deadNodeColor, CPersistentInt& userStateNodeColor)
00234 {
00235     bool userHitOK = false;
00236
00237 #ifdef WIN32
00238     CGraphOptDlg graphOptDlg(selColor, shadowColor,
00239         headerColor, tagColor, branchColor,
00240         nodeColor, deadNodeColor, userStateNodeColor);
00241     if( graphOptDlg.DoModal() == IDOK )
00242     {
00243         userHitOK = true;
00244     }
00245 #endif /* WIN32 */
00246 #ifdef qMacCvsPP
00247 #endif /* qMacCvsPP */
00248 #if qUnix
00249 #endif // qUnix
00250
00251     return userHitOK && !gCvsPrefs.empty();
00252 }
00253
00254
Generated on Sun Feb 24 01:21:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/GraphOptDlg.h Source File

common/GraphOptDlg.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- September 2001
00019  */
00020
00021 /*
00022  * GraphOptDlg.h --- graph options dialog
00023  */
00024
00025 #if !defined(AFX_GRAPHOPTDLG_H__E05908EC_20A6_43FE_93C7_0964E6ABB6B1__INCLUDED_)
00026 #define AFX_GRAPHOPTDLG_H__E05908EC_20A6_43FE_93C7_0964E6ABB6B1__INCLUDED_
00027
00028 #if _MSC_VER > 1000
00029 #pragma once
00030 #endif // _MSC_VER > 1000
00031
00032 #ifdef WIN32
00033 #include "ColorStatic.h"
00034 #endif /* WIN32 */
00035
00036 bool CompatGetGraphOptions(CPersistentInt& selColor, CPersistentInt& shadowColor,
00037                            CPersistentInt& headerColor, CPersistentInt& tagColor, CPersistentInt& branchColor,
00038                            CPersistentInt& nodeColor, CPersistentInt& deadNodeColor, CPersistentInt& userStateNodeColor);
00039    // get the graph options...
00040
00041
00042 #ifdef WIN32
00043
00045 // CGraphOptDlg dialog
00046
00047 class CGraphOptDlg : public CDialog
00048 {
00049 // Construction
00050 public:
00051     CGraphOptDlg(CPersistentInt& selColor, CPersistentInt& shadowColor,
00052         CPersistentInt& headerColor, CPersistentInt& tagColor, CPersistentInt& branchColor,
00053         CPersistentInt& nodeColor, CPersistentInt& deadNodeColor, CPersistentInt& userStateNodeColor,
00054         CWnd* pParent = NULL);   // standard constructor
00055
00056 // Dialog Data
00057     //{{AFX_DATA(CGraphOptDlg)
00058     enum { IDD = IDD_GRAPH_OPTIONS };
00059     CButton m_apply;
00060     CColorStatic    m_rgbShadow;
00061     CColorStatic    m_rgbSelection;
00062     CColorStatic    m_rgbState;
00063     CColorStatic    m_rgbDead;
00064     CColorStatic    m_rgbNode;
00065     CColorStatic    m_rgbBranch;
00066     CColorStatic    m_rgbTag;
00067     CColorStatic    m_rgbHeader;
00068     //}}AFX_DATA
00069
00070
00071 // Overrides
00072     // ClassWizard generated virtual function overrides
00073     //{{AFX_VIRTUAL(CGraphOptDlg)
00074     protected:
00075     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00076     //}}AFX_VIRTUAL
00077
00078 // Implementation
00079 protected:
00080
00081     // Generated message map functions
00082     //{{AFX_MSG(CGraphOptDlg)
00083     virtual void OnOK();
00084     afx_msg void OnApply();
00085     afx_msg void OnHeader();
00086     afx_msg void OnTag();
00087     afx_msg void OnBranch();
00088     afx_msg void OnNode();
00089     afx_msg void OnDead();
00090     afx_msg void OnState();
00091     afx_msg void OnSelection();
00092     afx_msg void OnShadow();
00093     afx_msg void OnReset();
00094     virtual void OnCancel();
00095     //}}AFX_MSG
00096     DECLARE_MESSAGE_MAP()
00097 private:
00098     CPersistentInt& m_selColor;
00099     CPersistentInt& m_shadowColor;
00100     CPersistentInt& m_headerColor;
00101     CPersistentInt& m_tagColor;
00102     CPersistentInt& m_branchColor;
00103     CPersistentInt& m_nodeColor;
00104     CPersistentInt& m_deadNodeColor;
00105     CPersistentInt& m_userStateNodeColor;
00106
00107     int m_origSelColor;
00108     int m_origShadowColor;
00109     int m_origHeaderColor;
00110     int m_origTagColor;
00111     int m_origBranchColor;
00112     int m_origNodeColor;
00113     int m_origDeadNodeColor;
00114     int m_origUserStateNodeColor;
00115
00116     void PromptForColor(CColorStatic& colorStatic);
00117         // select the color
00118
00119     void GetAllColors();
00120         // retrieve all colors
00121 };
00122
00123 //{{AFX_INSERT_LOCATION}}
00124 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00125
00126 #endif /* WIN32 */
00127
00128 #endif // !defined(AFX_GRAPHOPTDLG_H__E05908EC_20A6_43FE_93C7_0964E6ABB6B1__INCLUDED_)
Generated on Sun Feb 24 01:21:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/ImportDlg.cpp Source File

common/ImportDlg.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00019  */
00020
00021 /*
00022  * ImportDlg.cpp : the cvs import dialog
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef WIN32
00028 #   include "wincvs.h"
00029 #endif /* WIN32 */
00030
00031 #if qUnix
00032 #   include "UCvsDialogs.h"
00033 #   include "CheckoutDlg.h"
00034 #endif
00035
00036 #ifdef qMacCvsPP
00037 #   include <UModalDialogs.h>
00038 #   include <LMultiPanelView.h>
00039 #   include <LPopupGroupBox.h>
00040 #   include <LCheckBox.h>
00041 #   include <LTextEditView.h>
00042 #   include <LEditText.h>
00043 #   include <LPushButton.h>
00044
00045 #   include "MacCvsConstant.h"
00046 #endif /* qMacCvsPP */
00047
00048 #include "ImportDlg.h"
00049 #include "CvsPrefs.h"
00050 #include "MultiString.h"
00051 #include "PromptFiles.h"
00052 #include "TextBinary.h"
00053
00054 static char *sDefReleases[] =
00055 {
00056     "V10",
00057     "V101",
00058     0L
00059 };
00060
00061 static char *sDefVendors[] =
00062 {
00063     "GNU",
00064     0L
00065 };
00066
00067 static char *sDefModuleNames[] =
00068 {
00069     "Module",
00070     "Project",
00071     0L
00072 };
00073
00074 static CMString gVendorNames(10, "P_VendorNames", sDefVendors);
00075 CMString gReleasesNames(10, "P_ReleaseNames", sDefReleases);
00076 static CMString gImportModuleNames(10, "P_ImportModuleNames", sDefModuleNames);
00077
00078 #ifdef WIN32
00079 #   include "GetPrefs.h"
00080 #   ifdef _DEBUG
00081 #   define new DEBUG_NEW
00082 #   undef THIS_FILE
00083     static char THIS_FILE[] = __FILE__;
00084 #   endif
00085
00086 IMPLEMENT_DYNCREATE(CImport_MAIN, CPropertyPage)
00087
00088 CImport_MAIN::CImport_MAIN(const char *logmsg, const char *modname,
00089                            const char *rtag, const char *vtag) :
00090     CPropertyPage(CImport_MAIN::IDD)
00091 {
00092     //{{AFX_DATA_INIT(CImport_MAIN)
00093     m_logmsg = logmsg;
00094     m_vtag = vtag;
00095     m_rtag = rtag;
00096     m_modname = modname;
00097     //}}AFX_DATA_INIT
00098
00099     m_modnameCombo.SetItems(&gImportModuleNames);
00100     m_rtagCombo.SetItems(&gReleasesNames);
00101     m_vtagCombo.SetItems(&gVendorNames);
00102 }
00103
00104 CImport_MAIN::CImport_MAIN() : CPropertyPage(CImport_MAIN::IDD)
00105 {
00106 }
00107
00108 CImport_MAIN::~CImport_MAIN()
00109 {
00110 }
00111
00112 void CImport_MAIN::DoDataExchange(CDataExchange* pDX)
00113 {
00114     CPropertyPage::DoDataExchange(pDX);
00115
00116     //{{AFX_DATA_MAP(CImport_MAIN)
00117     DDX_Control(pDX, IDC_COMBOMODNAME, m_modnameCombo);
00118     DDX_Control(pDX, IDC_COMBORTAG, m_rtagCombo);
00119     DDX_Control(pDX, IDC_COMBOVTAG, m_vtagCombo);
00120     DDX_Text(pDX, IDC_LOGMSG, m_logmsg);
00121     DDX_CBString(pDX, IDC_COMBOVTAG, m_vtag);
00122     DDX_CBString(pDX, IDC_COMBORTAG, m_rtag);
00123     DDX_CBString(pDX, IDC_COMBOMODNAME, m_modname);
00124     //}}AFX_DATA_MAP
00125
00126     DDV_MinChars(pDX, m_modname, 1);
00127     DDV_MinChars(pDX, m_rtag, 1);
00128     DDV_MinChars(pDX, m_vtag, 1);
00129     DDX_ComboMString(pDX, IDC_COMBOMODNAME, m_modnameCombo);
00130     DDX_ComboMString(pDX, IDC_COMBOVTAG, m_vtagCombo);
00131     DDX_ComboMString(pDX, IDC_COMBORTAG, m_rtagCombo);
00132
00133     //error if the vendor and release tags are same
00134     if( pDX->m_bSaveAndValidate )
00135     {
00136         if( m_vtag == m_rtag )
00137         {
00138             AfxMessageBox("Vendor Tag and Release Tag can't have the same values.", MB_ICONEXCLAMATION, AFX_IDP_PARSE_STRING_SIZE);
00139             pDX->Fail();
00140         }
00141     }
00142 }
00143
00144
00145 BEGIN_MESSAGE_MAP(CImport_MAIN, CPropertyPage)
00146     //{{AFX_MSG_MAP(CImport_MAIN)
00147         // NOTE: the ClassWizard will add message map macros here
00148     //}}AFX_MSG_MAP
00149 END_MESSAGE_MAP()
00150
00151 IMPLEMENT_DYNCREATE(CImport_OPTIONS, CPropertyPage)
00152
00153 CImport_OPTIONS::CImport_OPTIONS(const char *path, const bool useDefIgnore, const bool useFilesTime) :
00154     CPropertyPage(CImport_OPTIONS::IDD)
00155 {
00156     //{{AFX_DATA_INIT(CImport_OPTIONS)
00157     m_path = path;
00158     m_useDefIgnore = useDefIgnore;
00159     m_useFilesTime = useFilesTime;
00160     //}}AFX_DATA_INIT
00161 }
00162
00163 CImport_OPTIONS::CImport_OPTIONS() : CPropertyPage(CImport_OPTIONS::IDD)
00164 {
00165 }
00166
00167 CImport_OPTIONS::~CImport_OPTIONS()
00168 {
00169 }
00170
00171 void CImport_OPTIONS::DoDataExchange(CDataExchange* pDX)
00172 {
00173     CPropertyPage::DoDataExchange(pDX);
00174
00175     //{{AFX_DATA_MAP(CImport_OPTIONS)
00176     DDX_Text(pDX, IDC_PATH, m_path);
00177     DDX_Check(pDX, IDC_USEDEFIGNORE, m_useDefIgnore);
00178     DDX_Check(pDX, IDC_USEFILESTIME, m_useFilesTime);
00179     //}}AFX_DATA_MAP
00180
00181     DDV_CheckPathExists(pDX, IDC_PATH, m_path, false);
00182 }
00183
00184
00185 BEGIN_MESSAGE_MAP(CImport_OPTIONS, CPropertyPage)
00186     //{{AFX_MSG_MAP(CImport_OPTIONS)
00187     ON_BN_CLICKED(IDC_BTNPATH2, OnBtnpath)
00188     //}}AFX_MSG_MAP
00189 END_MESSAGE_MAP()
00190
00192 // CImport_OPTIONS message handlers
00193
00194 void CImport_OPTIONS::OnBtnpath()
00195 {
00196     const char *dir = BrowserGetDirectory("Select a directory to import :", IsWindow(this->m_hWnd) ? this : NULL);
00197     if(dir != NULL)
00198         SetDlgItemText(IDC_PATH, dir);
00199 }
00200 #endif /* WIN32 */
00201
00202 #ifdef qMacCvsPP
00203 static void DoDataExchange_ImportMain(LWindow *theDialog, CPStr & modname, CStr & logmsg, bool putValue)
00204 {
00205     LEditText *mname = dynamic_cast<LEditText*>
00206         (theDialog->FindPaneByID(item_ModuleName));
00207     LTextEditView *editLog = dynamic_cast<LTextEditView*>
00208         (theDialog->FindPaneByID(item_LogMsg));
00209
00210     if(putValue)
00211     {
00212         mname->SetText((Ptr)(const char *)modname, modname.length());
00213         editLog->SetTextPtr((Ptr)(const char *)logmsg, logmsg.length());
00214         theDialog->SetLatentSub(mname);
00215
00216         // this will take care about an empty module name
00217         mname->AddListener(GetDlgHandler());
00218         if(modname.length() == 0)
00219         {
00220             LPushButton *theOK = dynamic_cast<LPushButton*>
00221                                         (theDialog->FindPaneByID(item_OK));
00222             Assert_(theOK != 0L);
00223             theOK->Disable();
00224         }
00225     }
00226     else
00227     {
00228         Handle hdl = editLog->GetTextHandle();
00229         Assert_(hdl != 0L);
00230         logmsg.set(*hdl, GetHandleSize(hdl));
00231
00232         char buf[512];
00233         Size len;
00234         mname->GetText(buf, 511, &len);
00235         modname.set(buf, len);
00236
00237     }
00238 }
00239
00240 static void DoDataExchange_ImportTags(LWindow *theDialog, CPStr & vendortag, CPStr & reltag, bool putValue)
00241 {
00242     LEditText *vtag = dynamic_cast<LEditText*>
00243         (theDialog->FindPaneByID(item_Vendortag));
00244     LEditText *rtag = dynamic_cast<LEditText*>
00245         (theDialog->FindPaneByID(item_Reltag));
00246
00247     if(putValue)
00248     {
00249         vtag->SetText((Ptr)(const char *)vendortag, vendortag.length());
00250         rtag->SetText((Ptr)(const char *)reltag, reltag.length());
00251         theDialog->SetLatentSub(vtag);
00252     }
00253     else
00254     {
00255         char buf[512];
00256         Size len;
00257         vtag->GetText(buf, 511, &len);
00258         vendortag.set(buf, len);
00259         rtag->GetText(buf, 511, &len);
00260         reltag.set(buf, len);
00261
00262     }
00263 }
00264 #endif /* qMacCvsPP */
00265 #if qUnix
00266 class UCvsImport : public UWidget
00267 {
00268     UDECLARE_DYNAMIC(UCvsImport)
00269 public:
00270     UCvsImport() : UWidget(::UEventGetWidID()) {}
00271     virtual ~UCvsImport() {}
00272
00273     enum
00274     {
00275         kOK = EV_COMMAND_START, // 0
00276         kCancel,                // 1
00277         kTabGeneral             // 2
00278     };
00279
00280     virtual void DoDataExchange(bool fill);
00281
00282 protected:
00283     ev_msg int OnOK(void);
00284     ev_msg int OnCancel(void);
00285
00286     UDECLARE_MESSAGE_MAP()
00287 };
00288
00289 UIMPLEMENT_DYNAMIC(UCvsImport, UWidget)
00290
00291 UBEGIN_MESSAGE_MAP(UCvsImport, UWidget)
00292     ON_UCOMMAND(UCvsImport::kOK, UCvsImport::OnOK)
00293     ON_UCOMMAND(UCvsImport::kCancel, UCvsImport::OnCancel)
00294 UEND_MESSAGE_MAP()
00295
00296 int UCvsImport::OnOK(void)
00297 {
00298     EndModal(true);
00299     return 0;
00300 }
00301
00302 int UCvsImport::OnCancel(void)
00303 {
00304     EndModal(false);
00305     return 0;
00306 }
00307
00308 void UCvsImport::DoDataExchange(bool fill)
00309 {
00310     if(fill)
00311     {
00312     }
00313     else
00314     {
00315     }
00316 }
00317
00318 class UCvsImport_MAIN : public UWidget
00319 {
00320     UDECLARE_DYNAMIC(UCvsImport_MAIN)
00321 public:
00322     UCvsImport_MAIN(const char *logmsg, const char *modname,
00323                     const char *rtag, const char *vtag);
00324     virtual ~UCvsImport_MAIN() {}
00325
00326     enum
00327     {
00328         kEditModule = EV_COMMAND_START, // 0
00329         kEditLog,                       // 1
00330         kEditVendor,                    // 2
00331         kEditRelease                    // 3
00332     };
00333
00334     virtual void DoDataExchange(bool fill);
00335
00336     UStr m_logmsg;
00337     UStr m_modname;
00338     UStr m_rtag;
00339     UStr m_vtag;
00340 protected:
00341
00342     UDECLARE_MESSAGE_MAP()
00343 };
00344
00345 UIMPLEMENT_DYNAMIC(UCvsImport_MAIN, UWidget)
00346
00347 UBEGIN_MESSAGE_MAP(UCvsImport_MAIN, UWidget)
00348 UEND_MESSAGE_MAP()
00349
00350 UCvsImport_MAIN::UCvsImport_MAIN(const char *logmsg, const char *modname,
00351                                  const char *rtag, const char *vtag) : UWidget(::UEventGetWidID())
00352 {
00353     m_logmsg = logmsg;
00354     m_modname = modname;
00355     m_rtag = rtag;
00356     m_vtag = vtag;
00357 }
00358
00359 void UCvsImport_MAIN::DoDataExchange(bool fill)
00360 {
00361     ::DoDataExchange(fill, GetWidID(), kEditModule, gOldModules);
00362     ::DoDataExchange(fill, GetWidID(), kEditRelease, gReleasesNames);
00363     ::DoDataExchange(fill, GetWidID(), kEditVendor, gVendorNames);
00364
00365     if(fill)
00366     {
00367         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditLog, (void *)(const char *)m_logmsg);
00368         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditModule, (void *)(const char *)m_modname);
00369         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditRelease, (void *)(const char *)m_rtag);
00370         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditVendor, (void *)(const char *)m_vtag);
00371     }
00372     else
00373     {
00374         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditLog, &m_logmsg);
00375         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditModule, &m_modname);
00376         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditRelease, &m_rtag);
00377         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditVendor, &m_vtag);
00378     }
00379 }
00380
00381 class UCvsImport_OPTIONS : public UWidget
00382 {
00383     UDECLARE_DYNAMIC(UCvsImport_OPTIONS)
00384 public:
00385     UCvsImport_OPTIONS(const char *path);
00386     virtual ~UCvsImport_OPTIONS() {}
00387
00388     enum
00389     {
00390         kStatPath = EV_COMMAND_START,   // 0
00391         kBtnChange                      // 1
00392     };
00393
00394     virtual void DoDataExchange(bool fill);
00395
00396     UStr m_path;
00397 protected:
00398
00399     ev_msg int OnChange(void);
00400
00401     UDECLARE_MESSAGE_MAP()
00402 };
00403
00404 UIMPLEMENT_DYNAMIC(UCvsImport_OPTIONS, UWidget)
00405
00406 UBEGIN_MESSAGE_MAP(UCvsImport_OPTIONS, UWidget)
00407     ON_UCOMMAND(UCvsImport_OPTIONS::kBtnChange, UCvsImport_OPTIONS::OnChange)
00408 UEND_MESSAGE_MAP()
00409
00410 UCvsImport_OPTIONS::UCvsImport_OPTIONS(const char *path) : UWidget(::UEventGetWidID())
00411 {
00412     m_path = path;
00413 }
00414
00415 int UCvsImport_OPTIONS::OnChange()
00416 {
00417     const char *dir = BrowserGetDirectory("Select a directory to import :");
00418     if(dir != 0L)
00419         UEventSendMessage(GetWidID(), EV_SETTEXT, kStatPath, (void *)dir);
00420     return 0;
00421 }
00422
00423 void UCvsImport_OPTIONS::DoDataExchange(bool fill)
00424 {
00425     if(fill)
00426     {
00427         UEventSendMessage(GetWidID(), EV_SETTEXT, kStatPath, (void *)(const char *)m_path);
00428     }
00429     else
00430     {
00431         UEventSendMessage(GetWidID(), EV_GETTEXT, kStatPath, &m_path);
00432     }
00433 }
00434 #endif // qUnix
00435
00436 bool CompatGetImport(CPStr & modname, CStr & logmsg, CPStr & vendortag,
00437                     CPStr & reltag, CPStr & path,
00438                     bool& useDefIgnore, bool& useFilesTime)
00439 {
00440     bool userHitOK = false;
00441     modname = "";
00442     logmsg = "";
00443     vendortag = "";
00444     reltag = "";
00445     useDefIgnore = false;
00446     useFilesTime = false;
00447
00448     static CPStr sLastModName;  /*Obsolete - remove it and always use sFolder! Get rid after all platforms have combo boxes for recent modules!*/
00449
00450     static CPStr sFolder;
00451     static CStr sLastMsg;
00452     static CPStr sLastVTag("avendor");
00453     static CPStr sLastRTag("arelease");
00454
00455     //dig out the folder so we can suggest the module name
00456     CStr uppath, folder;
00457     if( SplitPath(path, uppath, folder) )
00458         sFolder = folder;
00459
00460     if( sLastModName.length() == 0L )   /*Obsolete - see above*/
00461     {
00462         sLastModName = folder;
00463     }
00464 #ifdef WIN32
00465     CPropertySheet pages("Import settings");
00466     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00467     CImport_MAIN page1(sLastMsg, sFolder, sLastRTag, sLastVTag);
00468     CImport_OPTIONS page2(path, useDefIgnore, useFilesTime);
00469     CGetPrefs_CVSROOT page3;
00470     CGetPrefs_GLOBALS page4;
00471     pages.AddPage(&page1);
00472     pages.AddPage(&page2);
00473     pages.AddPage(&page3);
00474     pages.AddPage(&page4);
00475     if(pages.DoModal() == IDOK)
00476     {
00477         sLastModName = (const char *)page1.m_modname;
00478         sLastMsg = (const char *)page1.m_logmsg;
00479         sLastVTag = (const char *)page1.m_vtag;
00480         sLastRTag = (const char *)page1.m_rtag;
00481         path = (const char *)page2.m_path;
00482         useDefIgnore = page2.m_useDefIgnore == TRUE;
00483         useFilesTime = page2.m_useFilesTime == TRUE;
00484
00485         page3.StoreValues();
00486         page4.StoreValues();
00487         userHitOK = true;
00488     }
00489 #endif /* WIN32 */
00490 #ifdef qMacCvsPP
00491     StDialogHandler theHandler(dlg_Import, LCommander::GetTopCommander());
00492     LWindow *theDialog = theHandler.GetDialog();
00493     ThrowIfNil_(theDialog);
00494     static UInt16 sRuntimePanel = 1;
00495
00496     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00497         (theDialog->FindPaneByID(item_MultiViewPrefs));
00498     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00499
00500     multiView->SwitchToPanel(3);
00501     DoDataExchange_Globals(theDialog, true);
00502     multiView->SwitchToPanel(2);
00503     DoDataExchange (theDialog, item_ImportCvsIgnore, useDefIgnore, true);
00504     DoDataExchange (theDialog, item_EditPath, path, true);
00505     dynamic_cast<LControl*> (theDialog->FindPaneByID (item_EditPath))->AddListener (&theHandler);
00506
00507     multiView->SwitchToPanel(1);
00508     DoDataExchange_ImportMain(theDialog, sLastModName, sLastMsg, true);
00509     DoDataExchange_ImportTags(theDialog, sLastVTag, sLastRTag, true);
00510
00511
00512     groupView->SetValue(sRuntimePanel);
00513     theDialog->Show();
00514     MessageT hitMessage;
00515     while (true)
00516     {       // Let DialogHandler process events
00517         hitMessage = theHandler.DoDialog();
00518
00519         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00520             break;
00521
00522         if(hitMessage == item_EditPath)
00523         {
00524             const char * dir = BrowserGetDirectory("Choose folder to import :");
00525             if(dir != 0L)
00526             {
00527                 CPStr tmp(dir);
00528                 theDialog->SetDescriptorForPaneID(item_EditPath, tmp);
00529             }
00530         }
00531     }
00532     theDialog->Hide();
00533     sRuntimePanel = groupView->GetValue();
00534
00535     if(hitMessage == msg_OK)
00536     {
00537         multiView->SwitchToPanel(1);
00538         DoDataExchange_ImportMain(theDialog, sLastModName, sLastMsg, false);
00539         DoDataExchange_ImportTags(theDialog, sLastVTag, sLastRTag, false);
00540         multiView->SwitchToPanel(2);
00541         DoDataExchange (theDialog, item_ImportCvsIgnore, useDefIgnore, false);
00542         DoDataExchange (theDialog, item_EditPath, path, false);
00543         multiView->SwitchToPanel(3);
00544         DoDataExchange_Globals(theDialog, false);
00545
00546         Assert_(sLastModName.length() != 0);
00547
00548         userHitOK = true;
00549     }
00550 #endif /* qMacCvsPP */
00551 #if qUnix
00552     void *wid = UCreate_ImportDlg();
00553
00554     UCvsImport *dlg = new UCvsImport();
00555     UCvsImport_MAIN *tab1 = new UCvsImport_MAIN(sLastMsg, sLastModName, sLastRTag, sLastVTag);
00556     UCvsImport_OPTIONS *tab2 = new UCvsImport_OPTIONS(path);
00557     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00558     dlg->AddPage(tab1, UCvsImport::kTabGeneral, 0);
00559     dlg->AddPage(tab2, UCvsImport::kTabGeneral, 1);
00560
00561     if(dlg->DoModal())
00562     {
00563         sLastModName = tab1->m_modname;
00564         sLastMsg = tab1->m_logmsg;
00565         sLastVTag = tab1->m_vtag;
00566         sLastRTag = tab1->m_rtag;
00567         path = tab2->m_path;
00568
00569         userHitOK = true;
00570     }
00571
00572     delete dlg;
00573 #endif // qUnix
00574
00575     if(userHitOK)
00576     {
00577         gCvsPrefs.save();
00578         if(sLastMsg.length() == 0)
00579             sLastMsg = "no message";
00580         if(sLastVTag.length() == 0)
00581             sLastVTag = "initial";
00582         if(sLastRTag.length() == 0)
00583             sLastRTag = "start";
00584
00585         modname = sLastModName;
00586         logmsg = sLastMsg;
00587         vendortag = sLastVTag;
00588         reltag = sLastRTag;
00589 #ifdef macintosh
00590         logmsg.replace('\015', '\012');
00591 #endif /* macintosh */
00592     }
00593     return userHitOK;
00594 }
Generated on Sun Feb 24 01:21:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/ImportDlg.h Source File

common/ImportDlg.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00019  */
00020
00021 /*
00022  * ImportDlg.h : the cvs import dialog
00023  */
00024
00025 #if !defined(AFX_IMPORTDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
00026 #define AFX_IMPORTDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif // _MSC_VER >= 1000
00031
00032 #include "CPStr.h"
00033 #include "SmartComboBox.h"
00034
00035 bool CompatGetImport(CPStr & modname, CStr & logmsg,
00036                      CPStr & vendortag, CPStr & reltag, CPStr & path,
00037                      bool& useDefIgnore, bool& useFilesTime);
00038     // get the import module name and misc options...
00039
00040 #ifdef WIN32
00041
00042 class CImport_MAIN : public CPropertyPage
00043 {
00044     DECLARE_DYNCREATE(CImport_MAIN)
00045
00046 // Construction
00047 public:
00048     CImport_MAIN(const char *logmsg, const char *modname,
00049         const char *rtag, const char *vtag);
00050     CImport_MAIN();
00051     ~CImport_MAIN();
00052
00053 // Dialog Data
00054     //{{AFX_DATA(CImport_MAIN)
00055     enum { IDD = IDD_IMPORT_MAIN };
00056     CSmartComboBox  m_modnameCombo;
00057     CSmartComboBox  m_rtagCombo;
00058     CSmartComboBox  m_vtagCombo;
00059     CString m_logmsg;
00060     CString m_vtag;
00061     CString m_rtag;
00062     CString m_modname;
00063     //}}AFX_DATA
00064
00065
00066 // Overrides
00067     // ClassWizard generate virtual function overrides
00068     //{{AFX_VIRTUAL(CImport_MAIN)
00069     protected:
00070     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00071     //}}AFX_VIRTUAL
00072
00073 // Implementation
00074 protected:
00075     // Generated message map functions
00076     //{{AFX_MSG(CImport_MAIN)
00077         // NOTE: the ClassWizard will add member functions here
00078     //}}AFX_MSG
00079     DECLARE_MESSAGE_MAP()
00080
00081 };
00082
00083 class CImport_OPTIONS : public CPropertyPage
00084 {
00085     DECLARE_DYNCREATE(CImport_OPTIONS)
00086
00087 // Construction
00088 public:
00089     CImport_OPTIONS(const char *path, const bool useDefIgnore, const bool useFilesTime);
00090     CImport_OPTIONS();
00091     ~CImport_OPTIONS();
00092
00093 // Dialog Data
00094     //{{AFX_DATA(CImport_OPTIONS)
00095     enum { IDD = IDD_IMPORT_OPTIONS };
00096     CString m_path;
00097     BOOL    m_useDefIgnore;
00098     BOOL    m_useFilesTime;
00099     //}}AFX_DATA
00100
00101
00102 // Overrides
00103     // ClassWizard generate virtual function overrides
00104     //{{AFX_VIRTUAL(CImport_OPTIONS)
00105     protected:
00106     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00107     //}}AFX_VIRTUAL
00108
00109 // Implementation
00110 protected:
00111     // Generated message map functions
00112     //{{AFX_MSG(CImport_OPTIONS)
00113     afx_msg void OnBtnpath();
00114     //}}AFX_MSG
00115     DECLARE_MESSAGE_MAP()
00116
00117 };
00118
00119 //{{AFX_INSERT_LOCATION}}
00120 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00121 #endif /* WIN32 */
00122
00123 #endif // !defined(AFX_IMPORTDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/ImportFilter.cpp Source File

common/ImportFilter.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00019  */
00020
00021 /*
00022  * ImportFilter.cpp : filter the imported files before importing
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef WIN32
00028 #   include "resource.h"
00029 #endif /* WIN32 */
00030
00031 #ifdef macintosh
00032 #   include "GUSIInternal.h"
00033 #   include "GUSIFileSpec.h"
00034 #   include "MacMisc.h"
00035 #endif /* macintosh */
00036
00037 #include "ImportFilter.h"
00038 #include "AppConsole.h"
00039
00040 //
00041 // MN - Apply $HOME/.cvsignore to import filter
00042 //
00043 // list_add_type function uses ignore filter to decided whether
00044 // a file should be ignored in importing (user can change this
00045 // in import dialogbox, but this is a default). If user imports
00046 // a whole subdirectory instead of a file then this will
00047 // eliminate ignored files.
00048 //
00049 #include "CvsIgnore.h"
00050
00051 #if qCvsDebug
00052 #   include "CvsAlert.h"
00053 #endif /* qCvsDebug */
00054
00055 #ifdef macintosh
00056     static const char *lf = "\r";
00057 #elif defined(WIN32)
00058     static const char *lf = "\r\n";
00059 #else
00060     static const char *lf = "\n";
00061 #endif
00062
00063 #ifdef WIN32
00064 #   ifdef _DEBUG
00065 #   define new DEBUG_NEW
00066 #   undef THIS_FILE
00067     static char THIS_FILE[] = __FILE__;
00068 #   endif
00069 #endif /* WIN32 */
00070
00071 #ifndef NEW
00072 #define NEW new
00073 #endif
00074
00075 ReportConflict::ReportConflict(int mac_type, int mac_creator)
00076 {
00077     next = 0L;
00078     status = noConflict;
00079     ftype = mac_type;
00080     fcreator = mac_creator;
00081 }
00082
00083 void ReportConflict::PrintOut(CStr & out) const
00084 {
00085     out = "";
00086     if(HasConflict())
00087     {
00088         out << "Text/Binary conflict, at least these files :";
00089         out << lf;
00090         if(!sample1.empty() && !sample2.empty())
00091         {
00092             out << "    ";
00093             out << sample1;
00094             out << " and ";
00095             out << sample2;
00096             out << lf;
00097         }
00098     }
00099     else if(HasTypeCreatorConflict())
00100     {
00101         out << "Mac signature mismatch for this type, at least these files :";
00102         out << lf;
00103         if(!sample1.empty() && !sample2.empty())
00104         {
00105             out << "    ";
00106             out << sample1;
00107             out << " and ";
00108             out << sample2;
00109             out << lf;
00110         }
00111     }
00112 }
00113
00114 #if qCvsDebug
00115 void ReportConflict::PrintOut(void) const
00116 {
00117     if(pattern.empty())
00118         return;
00119
00120     cvs_out("  New type : %s%s (%s)\n",
00121         (status & hasExtension) ? "*" : "",
00122         (const char *)pattern,
00123         (status & isBinary) ? "BINARY" : "TEXT"
00124     );
00125     if(!sample1.empty() && !sample2.empty())
00126     {
00127         if(HasConflict())
00128             cvs_out("    Text/Binary CONFLICT ! %s and %s\n",
00129                     (const char *)sample1, (const char *)sample2);
00130         else if(HasTypeCreatorConflict())
00131             cvs_out("    Mac signature mismatch ! %s and %s\n",
00132                     (const char *)sample1, (const char *)sample2);
00133     }
00134 }
00135 #endif /* qCvsDebug */
00136
00137 ReportConflict::~ReportConflict()
00138 {
00139 }
00140
00141 void ReportConflict::AddPattern(const char *newpat, kFileType fileType, bool isExt, const char *sample)
00142 {
00143     pattern = newpat;
00144     sample1 = sample;
00145
00146     switch( fileType )
00147     {
00148     case kFileTypeBin:
00149         status |= isBinary;
00150         break;
00151     case kFileTypeUnicode:
00152         status |= isUnicode;
00153         break;
00154     default:
00155         // nothing to do
00156         break;
00157     }
00158
00159     if(isExt)
00160         status |= hasExtension;
00161 }
00162
00163 bool ReportConflict::Match(const char *pat)
00164 {
00165     if(pat == 0L || pattern.empty())
00166         return false;
00167
00168     int len = strlen(pat);
00169     int patlen = pattern.length();
00170
00171     if(status & hasExtension)
00172     {
00173         if(len < patlen)
00174             return false;
00175         // since it is the server who compares against the pattern,
00176         // that might be a case compare
00177 #if 0 //def WIN32
00178         return stricmp(pattern, pat + len - patlen) == 0;
00179 #else /* !WIN32 */
00180         return strcmp(pattern, pat + len - patlen) == 0;
00181 #endif /* !WIN32 */
00182     }
00183
00184 #if 0 //def WIN32
00185     return stricmp(pattern, pat) == 0;
00186 #else /* !WIN32 */
00187     return strcmp(pattern, pat) == 0;
00188 #endif /* !WIN32 */
00189 }
00190
00191 void ReportConflict::SetConflict(const char *sample)
00192 {
00193     // one is enough !
00194     if(HasConflict())
00195         return;
00196
00197     sample2 = sample;
00198     status |= hasConflict;
00199 }
00200
00201 void ReportConflict::SetTypeCreatorConflict(const char *sample)
00202 {
00203     // one is enough !
00204     if(HasTypeCreatorConflict() || HasConflict())
00205         return;
00206
00207     sample2 = sample;
00208     status |= hasTypeCreatorConflict;
00209 }
00210
00211 const size_t ReportWarning::maxWarnings = 10;
00212
00213 ReportWarning::ReportWarning(kTextBinTYPE akind)
00214 {
00215     kind = akind;
00216     next = 0L;
00217     tooMuchWarnings = false;
00218 }
00219
00220 ReportWarning::~ReportWarning()
00221 {
00222 }
00223
00224 void ReportWarning::PrintOut(CStr & out) const
00225 {
00226     out = "";
00227
00228     if(samples.size() == 0)
00229         return;
00230
00231     out = "Warning : ";
00232     switch(kind)
00233     {
00234     default:
00235     case kFileIsOK:
00236         out << "Files are OK";
00237         break;
00238     case kFileMissing:
00239         out << "Files are missing or unreadable";
00240         break;
00241     case kFileIsAlias:
00242         out << "Files are aliases";
00243         break;
00244     case kFileInvalidName:
00245         out << "Files have invalid name";
00246         break;
00247     case kTextWrongLF:
00248         out << "Files have the wrong line feed";
00249         break;
00250     case kTextIsBinary:
00251         out << "Files are binary";
00252         break;
00253     case kTextEscapeChar:
00254         out << "Files have escape characters in it";
00255         break;
00256     case kTextWrongSig:
00257         out << "Text files have the wrong signature";
00258         break;
00259     case kBinIsText:
00260         out << "Files are text, should be binary";
00261         break;
00262     case kBinWrongSig:
00263         out << "Binary files have the wrong signature";
00264         break;
00265     case kTextIsUnicode:
00266         out << "Files are unicode, should be text";
00267         break;
00268     case kBinIsUnicode:
00269         out << "Files are unicode, should be binary";
00270         break;
00271     }
00272     out << lf;
00273
00274     std::vector<CStr>::const_iterator i;
00275     for(i = samples.begin(); i != samples.end(); ++i)
00276     {
00277         out << "    ";
00278         out << *i;
00279         out << lf;
00280     }
00281
00282     if(tooMuchWarnings)
00283     {
00284         out << "    More files follow";
00285         out << lf;
00286     }
00287 }
00288
00289 #if qCvsDebug
00290 void ReportWarning::PrintOut(void) const
00291 {
00292     if(samples.size() == 0)
00293         return;
00294
00295     cvs_out("  Warning : ");
00296     switch(kind)
00297     {
00298     default:
00299     case kFileIsOK:
00300         cvs_out("Files are OK\n");
00301         break;
00302     case kFileMissing:
00303         cvs_out("Files are missing or unreadable\n");
00304         break;
00305     case kFileIsAlias:
00306         cvs_out("Files are aliases\n");
00307         break;
00308     case kFileInvalidName:
00309         cvs_out("Files have invalid name\n");
00310         break;
00311     case kTextWrongLF:
00312         cvs_out("Files have the wrong line feed\n");
00313         break;
00314     case kTextIsBinary:
00315         cvs_out("Files are binary\n");
00316         break;
00317     case kTextEscapeChar:
00318         cvs_out("Files have escape characters in it\n");
00319         break;
00320     case kTextWrongSig:
00321         cvs_out("Text files have the wrong signature\n");
00322         break;
00323     case kBinIsText:
00324         cvs_out("Files are text, should be binary\n");
00325         break;
00326     case kBinWrongSig:
00327         cvs_out("Binary files have the wrong signature\n");
00328         break;
00329     case kTextIsUnicode:
00330         cvs_out("Files are unicode, should be text\n");
00331         break;
00332     case kBinIsUnicode:
00333         cvs_out("Files are unicode, should be binary\n");
00334         break;
00335     }
00336
00337     std::vector<CStr>::const_iterator i;
00338     for(i = samples.begin(); i != samples.end(); ++i)
00339     {
00340         cvs_out("    %s\n", (const char *)(*i));
00341     }
00342
00343     if(tooMuchWarnings)
00344         cvs_out("    More files follow\n");
00345 }
00346 #endif /* qCvsDebug */
00347
00348 void ReportWarning::AddWarning(const char *sample)
00349 {
00350     // it's enough !
00351     if(samples.size() >= maxWarnings)
00352     {
00353         tooMuchWarnings = true;
00354         return;
00355     }
00356
00357     samples.push_back(CStr(sample));
00358 }
00359
00360 static void list_add_warning(ReportWarning *& warnings, kTextBinTYPE warn, const char *sample)
00361 {
00362     // find if it exists already a same kind of warning
00363     ReportWarning *tmp = warnings;
00364     while(tmp != 0L)
00365     {
00366         if(tmp->Kind() == warn)
00367             break;
00368         tmp = tmp->next;
00369     }
00370     if(tmp != 0L && tmp->Kind() == warn)
00371     {
00372         tmp->AddWarning(sample);
00373         return;
00374     }
00375
00376     // insert new one
00377     tmp = NEW ReportWarning(warn);
00378     if(tmp == 0L)
00379     {
00380         cvs_err("Impossible to allocate %d bytes !\n", sizeof(ReportWarning));
00381         return;
00382     }
00383
00384     tmp->AddWarning(sample);
00385     if(warnings == 0L)
00386     {
00387         warnings = tmp;
00388     }
00389     else
00390     {
00391         tmp->next = warnings;
00392         warnings = tmp;
00393     }
00394 }
00395
00396 class ImportReport;
00397
00398 static void list_add_type(ImportReport *impReport, ReportConflict *& conflicts, kFileType fileType,
00399                           const char *sample, const char *fullname,
00400                           int mac_type, int mac_creator);
00401
00402 class ImportReport : public TraversalReport
00403 {
00404 public:
00405     ImportReport(const char *path, ReportWarning *& w, ReportConflict *& c) : warnings(w), conflicts(c)
00406     {
00407         // MN - Apply ignore filter to import file list
00408         BuildIgnoredList(m_Ignlist, path);
00409     }
00410     virtual ~ImportReport() {}
00411
00412     ReportWarning *& warnings;
00413     ReportConflict *& conflicts;
00414     std::vector<CStr> m_Ignlist;
00415         // MN - Ignore list
00416
00417     virtual kTraversal EnterDirectory(const char *fullpath, const char *dirname, const FSSpec * macspec)
00418     {
00419         cvs_out("Filtering \'%s\'...\n", fullpath);
00420         return kContinueTraversal;
00421     }
00422
00423     virtual kTraversal ExitDirectory(const char *fullpath)
00424     {
00425         return kContinueTraversal;
00426     }
00427
00428     virtual kTraversal OnError(const char *err, int errcode)
00429     {
00430         list_add_warning(warnings, kFileMissing, err);
00431         return kContinueTraversal;
00432     }
00433
00434     virtual kTraversal OnIdle(const char *fullpath)
00435     {
00436         return kContinueTraversal;
00437     }
00438
00439     virtual kTraversal OnDirectory(const char *fullpath,
00440         const char *fullname,
00441         const char *name,
00442         const struct stat & dir, const FSSpec * macspec)
00443     {
00444 #if defined(WIN32) || defined(macintosh)
00445         if(stricmp(name, "CVS") == 0)
00446 #else
00447         if(strcmp(name, "CVS") == 0)
00448 #endif
00449             return kSkipFile;
00450         return kContinueTraversal;
00451     }
00452
00453     virtual kTraversal OnFile(const char *fullpath,
00454         const char *fullname,
00455         const char *name,
00456         const struct stat & dir, const FSSpec * macspec)
00457     {
00458         int mac_type = 0;
00459         int mac_creator = 0;
00460 #ifdef macintosh
00461 #   define MACSPEC , &fsSpec
00462         GUSIFileSpec inspec(fullname);
00463 #   if TARGET_RT_MAC_CFM
00464         mac_type = inspec.CatInfo()->FileInfo().ioFlFndrInfo.fdType;
00465         mac_creator = inspec.CatInfo()->FileInfo().ioFlFndrInfo.fdCreator;
00466 #   else
00467         FInfo finfo;
00468         memcpy(&finfo, inspec.CatInfo()->Info().finderInfo, 2 * sizeof(OSType));
00469         mac_type = finfo.fdType;
00470         mac_creator = finfo.fdCreator;
00471 #   endif
00472         UFSSpec fsSpec = inspec;
00473 #else /* !macintosh */
00474 #   define MACSPEC
00475 #endif /* !macintosh */
00476
00477         kFileType newType = kFileTypeText;
00478         kTextBinTYPE filetype = FileIsText(name, fullpath MACSPEC);
00479         if( kTextIsBinary == filetype || kTextWrongSig == filetype )
00480         {
00481             kTextBinTYPE bintype = FileIsBinary(name, fullpath MACSPEC);
00482             if( kFileIsOK != bintype )
00483             {
00484                 list_add_warning(warnings, bintype, fullname);
00485             }
00486             else if( kTextWrongSig == filetype )
00487             {
00488                 list_add_warning(warnings, filetype, fullname);
00489                 filetype = kTextIsBinary;
00490                 newType = kFileTypeBin;
00491             }
00492
00493             if( kFileIsOK == bintype )
00494             {
00495                 newType = kFileTypeBin;
00496             }
00497         }
00498         else if( kTextIsUnicode == filetype )
00499         {
00500             newType = kFileTypeUnicode;
00501         }
00502         else if( kFileIsOK != filetype )
00503         {
00504             list_add_warning(warnings, filetype, fullname);
00505         }
00506
00507         // add the type
00508         list_add_type(this, conflicts, newType, name, fullname, mac_type, mac_creator);
00509
00510         return kContinueTraversal;
00511     }
00512
00513     virtual kTraversal OnAlias(const char *fullpath,
00514         const char *fullname,
00515         const char *name,
00516         const struct stat & dir, const FSSpec * macspec)
00517     {
00518         list_add_warning(warnings, kFileIsAlias, fullname);
00519         return kContinueTraversal;
00520     }
00521 };
00522
00523 //
00524 // MN - Had to move this function after class ImportReport, because
00525 // this function uses a variable of that type.
00526 //
00527 // When a file is added to warning/conflict list, it is also
00528 // processed through ignore filter. If file should be ignored
00529 // then the initial state is "IGNORE" in import dialogbox.
00530 //
00531 static void list_add_type(ImportReport *impReport, ReportConflict *& conflicts, kFileType fileType,
00532                           const char *sample, const char *fullname,
00533                           int mac_type, int mac_creator)
00534 {
00535     // look for a matching entry
00536     ReportConflict *entry = conflicts;
00537     while(entry != 0L)
00538     {
00539         if(entry->Match(sample))
00540         {
00541             if(entry->HasConflict())
00542                 return;
00543
00544             if(entry->IsBinary() ^ (kFileTypeBin == fileType))
00545                 entry->SetConflict(fullname);
00546
00547             if(entry->IsUnicode() ^ (kFileTypeUnicode == fileType))
00548                 entry->SetConflict(fullname);
00549
00550             // mac only
00551             if(entry->GetMacType() != mac_type || entry->GetMacCreator() != mac_creator)
00552                 entry->SetTypeCreatorConflict(fullname);
00553
00554             // it matches perfectly
00555             return;
00556         }
00557
00558         entry = entry->next;
00559     }
00560
00561     // find the extension
00562     const char *tmp = sample, *ext = 0L;
00563     while((tmp = strchr(tmp, '.')) != 0L)
00564     {
00565         ext = tmp++;
00566     }
00567
00568     // add a new entry
00569     ReportConflict *newc = NEW ReportConflict(mac_type, mac_creator);
00570     if(newc == 0L)
00571     {
00572         cvs_err("Impossible to allocate %d bytes !\n", sizeof(ReportConflict));
00573         return;
00574     }
00575
00576     newc->AddPattern(ext != 0L ? ext : sample, fileType, ext != 0L, fullname);
00577     if(conflicts == 0L)
00578         conflicts = newc;
00579     else
00580     {
00581         newc->next = conflicts;
00582         conflicts = newc;
00583     }
00584
00585     // MN - Apply ignore filter. If $HOME/.cvsignore tells that
00586     // file should be ignored then set object to ignored state.
00587     if(MatchIgnoredList(sample, impReport->m_Ignlist))
00588         newc->Ignore();
00589 }
00590
00591 kTraversal list_all_types_recur(const char *path, ReportWarning *& warnings,
00592                                 ReportConflict *& conflicts)
00593 {
00594     ImportReport report(path, warnings, conflicts);
00595     return FileTraverse(path, report);
00596 }
00597
00598 void free_list_types(ReportWarning * warnings, ReportConflict * conflicts)
00599 {
00600     ReportWarning *tmpwarn;
00601     ReportWarning *warn = warnings;
00602     while(warn != 0L)
00603     {
00604         tmpwarn = warn;
00605         warn = warn->next;
00606         delete tmpwarn;
00607     }
00608
00609     ReportConflict *tmpconf;
00610     ReportConflict *conf = conflicts;
00611     while(conf != 0L)
00612     {
00613         tmpconf = conf;
00614         conf = conf->next;
00615         delete tmpconf;
00616     }
00617 }
00618
00619 #if qCvsDebug
00620 bool list_all_types(const char *path)
00621 {
00622     ReportWarning * warnings = 0L;
00623     ReportConflict * conflicts = 0L;
00624     list_all_types_recur(path, warnings, conflicts);
00625
00626     cvs_out("Reporting warnings :\n");
00627     ReportWarning *warn = warnings;
00628     while(warn != 0L)
00629     {
00630         warn->PrintOut();
00631         warn = warn->next;
00632     }
00633
00634     cvs_out("Reporting types :\n");
00635     ReportConflict *conf = conflicts;
00636     while(conf != 0L)
00637     {
00638         conf->PrintOut();
00639         conf = conf->next;
00640     }
00641
00642     free_list_types(warnings, conflicts);
00643
00644     return !CvsAlert("Continue importing ?", "Cancel", "Continue");
00645 }
00646 #endif /* qCvsDebug */
Generated on Sun Feb 24 01:21:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/ImportFilter.h Source File

common/ImportFilter.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00019  */
00020
00021 /*
00022  * ImportFilter.h : filter the imported files before importing
00023  */
00024
00025 #if !defined(AFX_IMPORTFILTER_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
00026 #define AFX_IMPORTFILTER_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif // _MSC_VER >= 1000
00031
00032 #include <vector>
00033 #include "TextBinary.h"
00034 #include "CPStr.h"
00035 #include "FileTraversal.h"
00036
00037 #ifdef _MSC_VER
00038     using namespace std;
00039 #endif
00040
00041 // include a type (like *.c or ChangeLog) + several informations
00042 // like : if several files of this type are conflicting (i.e. are
00043 // binary AND text), if it is a binary or text type...
00044 class ReportConflict
00045 {
00046 public:
00047     ReportConflict(int mac_type, int mac_creator);
00048     ~ReportConflict();
00049
00050     ReportConflict *next;
00051
00052     enum
00053     {
00054         noConflict =                0x0000,
00055         hasConflict =               0x0001,
00056         hasExtension =              0x0002,
00057         isBinary =                  0x0004,
00058         forceBinary =               0x0008,
00059         forceText =                 0x0010,
00060         hasIgnore =                 0x0020,
00061         hasTypeCreatorConflict =    0x0040, /* mac only */
00062         forceNoKeywords =           0x0080,
00063         isUnicode =                 0x0100,
00064         forceUnicode =              0x0200,
00065         userFlags =     forceText | forceBinary | forceUnicode | hasIgnore | forceNoKeywords
00066     };
00067
00068     void AddPattern(const char *newpat, kFileType fileType, bool isExtension, const char *sample);
00069     void SetConflict(const char *sample);
00070     void SetTypeCreatorConflict(const char *sample); /* mac only */
00071     bool Match(const char *pat);
00072
00073     inline bool HasConflict(void) const
00074     {
00075         return (status & hasConflict) != 0;
00076     }
00077     inline bool HasTypeCreatorConflict(void) const /* mac only */
00078     {
00079         return (status & hasTypeCreatorConflict) != 0;
00080     }
00081     inline bool IsBinary(void) const
00082     {
00083         return (status & isBinary) != 0;
00084     }
00085     inline bool IsUnicode(void) const
00086     {
00087         return (status & isUnicode) != 0;
00088     }
00089     inline bool IsExtension(void) const
00090     {
00091         return (status & hasExtension) != 0;
00092     }
00093     inline const char *GetPattern(void) const
00094     {
00095         return pattern;
00096     }
00097     inline int GetMacType(void) const /* mac only */
00098     {
00099         return ftype;
00100     }
00101     inline int GetMacCreator(void) const /* mac only */
00102     {
00103         return fcreator;
00104     }
00105
00106     inline void ForceBinary(void)
00107     {
00108         status &= ~(int)userFlags;
00109         status |= (int)forceBinary;
00110     }
00111     inline void ForceText(void)
00112     {
00113         status &= ~(int)userFlags;
00114         status |= (int)forceText;
00115     }
00116     inline void ForceUnicode(void)
00117     {
00118         status &= ~(int)userFlags;
00119         status |= (int)forceUnicode;
00120     }
00121     inline void Ignore(void)
00122     {
00123         status &= ~(int)userFlags;
00124         status |= (int)hasIgnore;
00125     }
00126     inline void ForceNoKeywords(void)
00127     {
00128         status &= ~(int)userFlags;
00129         status |= (int)forceNoKeywords;
00130     }
00131     inline bool HasForceBinary(void) const
00132     {
00133         return (status & forceBinary) != 0;
00134     }
00135     inline bool HasForceText(void) const
00136     {
00137         return (status & forceText) != 0;
00138     }
00139     inline bool HasForceUnicode(void) const
00140     {
00141         return (status & forceUnicode) != 0;
00142     }
00143     inline bool HasIgnore(void) const
00144     {
00145         return (status & hasIgnore) != 0;
00146     }
00147     inline bool HasForceNoKeywords(void) const
00148     {
00149         return (status & forceNoKeywords) != 0;
00150     }
00151     inline void DisableUserSettings(void)
00152     {
00153         status &= ~(int)userFlags;
00154     }
00155
00156     void PrintOut(CStr & out) const;
00157 #if qCvsDebug
00158     void PrintOut(void) const;
00159 #endif /* qCvsDebug */
00160
00161 protected:
00162     int status;
00163
00164     CStr pattern;
00165         // an extension or a whole name (hasExtension)
00166     CStr sample1;
00167         // a sample for this entry
00168     CStr sample2;
00169         // another sample (if hasConflict)
00170
00171     int ftype, fcreator; /* mac only */
00172 };
00173
00174 // a warning contains a kind of warning (i.e. wrong line feed,
00175 // has escape characters...) + a set of files which illustrates
00176 // this warning.
00177
00178 class ReportWarning
00179 {
00180 public:
00181     ReportWarning(kTextBinTYPE akind);
00182     ~ReportWarning();
00183
00184     ReportWarning *next;
00185     static const size_t maxWarnings;
00186
00187     void AddWarning(const char *sample);
00188     inline kTextBinTYPE Kind(void) const {return kind;}
00189
00190     void PrintOut(CStr & out) const;
00191 #if qCvsDebug
00192     void PrintOut(void) const;
00193 #endif /* qCvsDebug */
00194
00195 protected:
00196     kTextBinTYPE kind;
00197
00198     std::vector<CStr> samples;
00199     bool tooMuchWarnings;
00200 };
00201
00202 kTraversal list_all_types_recur(const char *path, ReportWarning *& warnings,
00203                          ReportConflict *& conflicts);
00204 void free_list_types(ReportWarning * warnings, ReportConflict * conflicts);
00205
00206 #if qCvsDebug
00207     bool list_all_types(const char *path);
00208 #endif /* qCvsDebug */
00209
00210 #endif // !defined(AFX_IMPORTFILTER_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/ImportFilterDlg.cpp Source File

common/ImportFilterDlg.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00019  */
00020
00021 /*
00022  * ImportFilterDlg.cpp - edit filtered import
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef WIN32
00028 #   include "wincvs.h"
00029 #endif /* WIN32 */
00030
00031 #if qUnix
00032 #   include "UCvsDialogs.h"
00033 #endif
00034
00035 #ifdef qMacCvsPP
00036 #   include <Icons.h>
00037
00038 #   include <UModalDialogs.h>
00039 #   include <LTableMultiGeometry.h>
00040 #   include <LOutlineKeySelector.h>
00041 #   include <LTableSingleSelector.h>
00042 #   include <LOutlineRowSelector.h>
00043 #   include <UAttachments.h>
00044 #   include <UGAColorRamp.h>
00045 #   include <LTextEditView.h>
00046
00047 #   include "MacCvsConstant.h"
00048 #endif /* qMacCvsPP */
00049
00050 #include "ImportFilterDlg.h"
00051
00052 #ifdef WIN32
00053 #   ifdef _DEBUG
00054 #   define new DEBUG_NEW
00055 #   undef THIS_FILE
00056     static char THIS_FILE[] = __FILE__;
00057 #   endif
00058 #endif /* WIN32 */
00059
00060 #ifdef WIN32
00061 CImportWarning::CImportWarning(ReportWarning * warn, CWnd* pParent /*=NULL*/)
00062     : CDialog(CImportWarning::IDD, pParent)
00063 {
00064     CStr print;
00065     warn->PrintOut(print);
00066     //{{AFX_DATA_INIT(CImportWarning)
00067     m_desc = print;
00068     //}}AFX_DATA_INIT
00069 }
00070
00071
00072 void CImportWarning::DoDataExchange(CDataExchange* pDX)
00073 {
00074     CDialog::DoDataExchange(pDX);
00075     //{{AFX_DATA_MAP(CImportWarning)
00076     DDX_Text(pDX, IDC_WARNINGDESC, m_desc);
00077     //}}AFX_DATA_MAP
00078 }
00079
00080
00081 BEGIN_MESSAGE_MAP(CImportWarning, CDialog)
00082     //{{AFX_MSG_MAP(CImportWarning)
00083         // NOTE: the ClassWizard will add message map macros here
00084     //}}AFX_MSG_MAP
00085 END_MESSAGE_MAP()
00086
00087 CImportEntry::CImportEntry(ReportConflict * entry, CWnd* pParent /*=NULL*/)
00088     : CDialog(CImportEntry::IDD, pParent)
00089 {
00090     CStr print;
00091     entry->PrintOut(print);
00092
00093     //{{AFX_DATA_INIT(CImportEntry)
00094     //}}AFX_DATA_INIT
00095
00096     //keep these outside MFC remarks
00097     m_desc = print;
00098     if(entry->HasForceBinary())
00099         m_radios = 1;
00100     else if(entry->HasForceUnicode())
00101         m_radios = 2;
00102     else if(entry->HasForceText())
00103         m_radios = 3;
00104     else if(entry->HasForceNoKeywords())
00105         m_radios = 4;
00106     else if(entry->HasIgnore())
00107         m_radios = 5;
00108     else
00109         m_radios = 0;
00110 }
00111
00112
00113 void CImportEntry::DoDataExchange(CDataExchange* pDX)
00114 {
00115     CDialog::DoDataExchange(pDX);
00116     //{{AFX_DATA_MAP(CImportEntry)
00117     DDX_Text(pDX, IDC_WARNINGDESC, m_desc);
00118     DDX_Radio(pDX, IDC_ENTRYSTATE, m_radios);
00119     //}}AFX_DATA_MAP
00120 }
00121
00122
00123 BEGIN_MESSAGE_MAP(CImportEntry, CDialog)
00124     //{{AFX_MSG_MAP(CImportEntry)
00125         // NOTE: the ClassWizard will add message map macros here
00126     //}}AFX_MSG_MAP
00127 END_MESSAGE_MAP()
00128
00130 // CImportFilterDlg dialog
00131
00132
00133 CImportFilterDlg::CImportFilterDlg(ReportConflict * entries, ReportWarning * warnings,
00134                                    CWnd* pParent /*=NULL*/)
00135     : CDialog(CImportFilterDlg::IDD, pParent)
00136 {
00137     //{{AFX_DATA_INIT(CImportFilterDlg)
00138     m_entries = entries;
00139     m_warnings = warnings;
00140     //}}AFX_DATA_INIT
00141 }
00142
00143
00144 void CImportFilterDlg::DoDataExchange(CDataExchange* pDX)
00145 {
00146     CDialog::DoDataExchange(pDX);
00147     //{{AFX_DATA_MAP(CImportFilterDlg)
00148     DDX_Control(pDX, IDC_LISTENTRIES, m_list);
00149     DDX_Control(pDX, IDC_EDITENTRY, m_edit);
00150     //}}AFX_DATA_MAP
00151 }
00152
00153
00154 BEGIN_MESSAGE_MAP(CImportFilterDlg, CDialog)
00155     //{{AFX_MSG_MAP(CImportFilterDlg)
00156     ON_BN_CLICKED(IDC_EDITENTRY, OnEditentry)
00157     ON_NOTIFY(NM_DBLCLK, IDC_LISTENTRIES, OnDblclkListentries)
00158     //}}AFX_MSG_MAP
00159 END_MESSAGE_MAP()
00160
00162 // CImportFilterDlg message handlers
00163
00164 void CImportFilterDlg::OnEditentry()
00165 {
00166     // The user wants to edit an entry.
00167     // Start at the top of the list and walk through it until an item
00168     // that is selected is found.
00169     int nItem = m_list.GetNextItem(-1, LVNI_ALL);
00170     while (nItem != -1)
00171     {
00172         UINT nState = m_list.GetItemState(nItem, LVIS_SELECTED);
00173         if ((nState & LVIS_SELECTED) == LVIS_SELECTED)
00174             break;
00175
00176         nItem = m_list.GetNextItem(nItem, LVNI_ALL);
00177     }
00178     if(nItem == -1)
00179         return;
00180
00181     int i = 0;
00182     ReportWarning * warn = m_warnings;
00183     while(warn != 0L)
00184     {
00185         if(i == nItem)
00186         {
00187             CImportWarning dlg(warn);
00188             dlg.DoModal();
00189             return;
00190         }
00191         warn = warn->next;
00192         i++;
00193     }
00194
00195     ReportConflict * conf = m_entries;
00196     while(conf != 0L)
00197     {
00198         if(i == nItem)
00199         {
00200             CImportEntry dlg(conf);
00201             if(dlg.DoModal() == IDOK)
00202             {
00203                 switch(dlg.m_radios)
00204                 {
00205                 case 0:
00206                     conf->DisableUserSettings();
00207                     m_list.SetItem(nItem, 2, LVIF_TEXT, conf->IsBinary() ? "BINARY" : "TEXT", 0, 0, 0, 0);
00208                     break;
00209                 case 1:
00210                     conf->ForceBinary();
00211                     m_list.SetItem(nItem, 2, LVIF_TEXT, "FORCE BINARY", 0, 0, 0, 0);
00212                     break;
00213                 case 2:
00214                     conf->ForceUnicode();
00215                     m_list.SetItem(nItem, 2, LVIF_TEXT, "FORCE UNICODE", 0, 0, 0, 0);
00216                     break;
00217                 case 3:
00218                     conf->ForceText();
00219                     m_list.SetItem(nItem, 2, LVIF_TEXT, "FORCE TEXT", 0, 0, 0, 0);
00220                     break;
00221                 case 4:
00222                     conf->ForceNoKeywords();
00223                     m_list.SetItem(nItem, 2, LVIF_TEXT, "FORCE NO KEYWORDS", 0, 0, 0, 0);
00224                     break;
00225                 case 5:
00226                     conf->Ignore();
00227                     m_list.SetItem(nItem, 2, LVIF_TEXT, "IGNORE", 0, 0, 0, 0);
00228                     break;
00229                 }
00230             }
00231             return;
00232         }
00233
00234         conf = conf->next;
00235         i++;
00236     }
00237 }
00238
00239 void CImportFilterDlg::OnDblclkListentries(NMHDR* pNMHDR, LRESULT* pResult)
00240 {
00241     OnEditentry();
00242     *pResult = 0;
00243 }
00244
00245 BOOL CImportFilterDlg::OnInitDialog()
00246 {
00247     CDialog::OnInitDialog();
00248
00249     // Need to set up to display the little icons next to each entry
00250     HICON hIcon = AfxGetApp()->LoadIcon(IDI_CVSERROR);
00251     m_ImageList.Create(16, 16, ILC_COLOR, 1, 1);
00252     m_ImageList.SetBkColor(GetSysColor(COLOR_WINDOW));
00253     m_ImageList.Add(hIcon);
00254     hIcon = AfxGetApp()->LoadIcon(IDI_CVSWARNING);
00255     m_ImageList.Add(hIcon);
00256     m_list.SetImageList(&m_ImageList, LVSIL_SMALL);
00257
00258     //full row selection
00259     m_list.SetExtendedStyle( LVS_EX_FULLROWSELECT |
00260         LVS_EX_ONECLICKACTIVATE |
00261         LVS_EX_UNDERLINEHOT );
00262
00263     // Set up columns inside the list view
00264     m_list.InsertColumn(0, "Entry state", LVCFMT_LEFT, 80);
00265     m_list.InsertColumn(1, "Entry description", LVCFMT_LEFT, 270);
00266     m_list.InsertColumn(2, "Entry kind", LVCFMT_LEFT, 140);
00267
00268     int i = 0;
00269     ReportWarning * warn = m_warnings;
00270     while(warn != 0L)
00271     {
00272         const char *desc;
00273         bool isError = true;
00274
00275         switch(warn->Kind())
00276         {
00277         case kFileIsOK:
00278             isError = false; // should not happen
00279             desc = "File is OK";
00280             break;
00281         case kFileMissing:
00282             desc = "File is missing or unreadable";
00283             break;
00284         case kFileIsAlias:
00285             desc = "File is an alias";
00286             break;
00287         case kFileInvalidName:
00288             desc = "File has an invalid name";
00289             break;
00290         case kTextWrongLF:
00291             desc = "File has the wrong line feed for this machine";
00292             break;
00293         case kTextIsBinary:
00294             desc = "File seems to be binary, while expecting text";
00295             break;
00296         case kTextEscapeChar:
00297             desc = "File has some escape characters in it (0x00-0x20, 0x80-0xFF)";
00298             isError = false;
00299             break;
00300         case kTextIsUnicode:
00301             desc = "File seems to be unicode, while expecting text";
00302             break;
00303         case kBinIsUnicode:
00304             desc = "File seems to be unicode, while expecting binary";
00305             break;
00306         default:
00307             desc = "File has some unknown problem";
00308             break;
00309         }
00310
00311         // Store this information in the list view
00312         m_list.InsertItem(i, "", isError ? 0 : 1);
00313
00314         m_list.SetItem(i, 1, LVIF_TEXT, desc, 0, 0, 0, 0);
00315         m_list.SetItem(i, 0, LVIF_TEXT, isError ? "Error" : "Warning", 0, 0, 0, 0);
00316
00317         warn = warn->next;
00318         i++;
00319     }
00320
00321     ReportConflict * conf = m_entries;
00322     while(conf != 0L)
00323     {
00324         CPStr desc;
00325
00326         desc << "Type ";
00327         desc << (conf->IsExtension() ? "*" : "");
00328         desc << conf->GetPattern();
00329
00330         // Store this information in the list view
00331         m_list.InsertItem(i, "", conf->HasConflict() ? 0 : 1);
00332
00333         if( conf->HasIgnore() )
00334         {
00335             m_list.SetItem(i, 2, LVIF_TEXT, "IGNORE", 0, 0, 0, 0);
00336         }
00337         else
00338         {
00339             CPStr kind;
00340
00341             if( conf->IsBinary() )
00342             {
00343                 kind << "BINARY";
00344             }
00345             else if( conf->IsUnicode() )
00346             {
00347                 kind << "UNICODE";
00348             }
00349             else
00350             {
00351                 kind << "TEXT";
00352             }
00353
00354             m_list.SetItem(i, 2, LVIF_TEXT, kind, 0, 0, 0, 0);
00355         }
00356
00357         m_list.SetItem(i, 1, LVIF_TEXT, desc, 0, 0, 0, 0);
00358         m_list.SetItem(i, 0, LVIF_TEXT, conf->HasConflict() ? "Error" : "OK", 0, 0, 0, 0);
00359
00360         conf = conf->next;
00361         i++;
00362     }
00363
00364     return TRUE;  // return TRUE unless you set the focus to a control
00365                   // EXCEPTION: OCX Property Pages should return FALSE
00366 }
00367 #endif /* WIN32 */
00368
00369 #ifdef qMacCvsPP
00370 static ReportConflict * gEntries;
00371 static ReportWarning * gWarnings;
00372
00373 COutlineTable::COutlineTable(
00374     LStream *inStream )
00375         : LOutlineTable( inStream )
00376 {
00377     // set the table geometry
00378     LTableMultiGeometry *geom = NEW LTableMultiGeometry(this, 50, 20);
00379     ThrowIfNil_(geom);
00380     SetTableGeometry(geom);
00381
00382     // set the table selector
00383     SetTableSelector(NEW LTableSingleSelector( this )/*LOutlineRowSelector*/ );
00384
00385     // and note that we don't set the table storage....
00386
00387     // most of the table classes not only maintain the graphical
00388     // representation of your data but also the data itself. But
00389     // LOutlineTable doesn't really do this...it mostly handles
00390     // graphical representation... you need to handle your data
00391     // maintenance elsewhere by yourself.
00392
00393     // insert a couple columns (name and size)
00394     InsertCols( 3, 0, nil, nil, false );
00395     geom->SetColWidth(80, 1, 1);
00396     geom->SetColWidth(310, 2, 2);
00397     geom->SetColWidth(90, 3, 3);
00398
00399     // Set up keyboard selection and scrolling.
00400     AddAttachment(NEW LOutlineKeySelector(this, msg_AnyMessage));
00401     AddAttachment(NEW LKeyScrollAttachment(this));
00402
00403     // Try to become default commander in the window.
00404     if (mSuperCommander != nil)
00405         mSuperCommander->SetLatentSub(this);
00406
00407     mIconWarning = nil;
00408     mIconError = nil;
00409
00410     OSErr err = ::GetIconSuite( &mIconError, icons_Error, kSelectorAllAvailableData );
00411     ThrowIfOSErr_(err);
00412     ThrowIfResFail_(mIconError);
00413     err = ::GetIconSuite( &mIconWarning, icons_Warning, kSelectorAllAvailableData );
00414     ThrowIfOSErr_(err);
00415     ThrowIfResFail_(mIconWarning);
00416 }
00417
00418 COutlineTable::~COutlineTable()
00419 {
00420     if (mIconWarning != 0L)
00421         ::DisposeIconSuite(mIconWarning, true);
00422     if (mIconError != 0L)
00423         ::DisposeIconSuite(mIconError, true);
00424 }
00425
00426 void COutlineTable::FinishCreateSelf()
00427 {
00428     // insert the root level of the disk into the table
00429     LOutlineItem *theItem = nil;
00430     LOutlineItem *lastItem = nil;
00431
00432     ReportWarning * warn = gWarnings;
00433     while(warn != 0L)
00434     {
00435         // Store this information in the list view
00436         CWarningItem *theItem = NEW CWarningItem(warn, mIconWarning, mIconError);
00437         ThrowIfNil_(theItem);
00438
00439         // and insert it at the end of the table
00440         InsertItem( theItem, nil, lastItem );
00441         lastItem = theItem;
00442
00443         warn = warn->next;
00444     }
00445
00446     ReportConflict * conf = gEntries;
00447     while(conf != 0L)
00448     {
00449         // Store this information in the list view
00450         CEntryItem *theItem = NEW CEntryItem(conf, mIconWarning, mIconError);
00451         ThrowIfNil_(theItem);
00452
00453         // and insert it at the end of the table
00454         InsertItem( theItem, nil, lastItem );
00455         lastItem = theItem;
00456
00457         conf = conf->next;
00458     }
00459 }
00460
00461 CWarningItem::CWarningItem(ReportWarning * entry, Handle war_icon, Handle err_icon)
00462 {
00463     mEntry = entry;
00464     mErrIcon = err_icon;
00465     mWarnIcon = war_icon;
00466 }
00467
00468 CWarningItem::~CWarningItem()
00469 {
00470 }
00471
00472 // this is the routine called to know what to draw within the
00473 // table cell. See the comments in LOutlineItem.cp for more info.
00474 void
00475 CWarningItem::GetDrawContentsSelf(
00476     const STableCell&       inCell,
00477     SOutlineDrawContents&   ioDrawContents)
00478 {
00479     CPStr desc;
00480
00481     switch (inCell.col)
00482     {
00483     case 1:
00484         bool isError = mEntry->Kind() != kFileIsOK && mEntry->Kind() != kTextEscapeChar;
00485         ioDrawContents.outShowSelection = true;
00486         ioDrawContents.outHasIcon = true;
00487         ioDrawContents.outIconSuite = isError ? mErrIcon : mWarnIcon;
00488
00489         if(isError)
00490         {
00491             LString::CopyPStr("\pError", ioDrawContents.outTextString);
00492             ioDrawContents.outTextTraits.style = bold;
00493         }
00494         else
00495         {
00496             LString::CopyPStr("\pWarning", ioDrawContents.outTextString);
00497             ioDrawContents.outTextTraits.style = 0;
00498         }
00499         break;
00500
00501     case 2:
00502         ioDrawContents.outShowSelection = true;
00503         ioDrawContents.outTextTraits.style = 0;
00504
00505         switch(mEntry->Kind())
00506         {
00507         case kFileIsOK:
00508             desc = "File is OK"; // should not happen
00509             break;
00510         case kFileMissing:
00511             desc = "File is missing or unreadable";
00512             break;
00513         case kFileIsAlias:
00514             desc = "File is an alias";
00515             break;
00516         case kFileInvalidName:
00517             desc = "File has an invalid name";
00518             break;
00519         case kTextWrongLF:
00520             desc = "File has the wrong line feed for this machine";
00521             break;
00522         case kTextIsBinary:
00523             desc = "File seems to be binary, while expecting text";
00524             break;
00525         case kTextEscapeChar:
00526             desc = "File has some escape characters in it (0x00-0x20, 0x80-0xFF)";
00527             break;
00528         case kTextWrongSig:
00529             desc = "Text File has a wrong mac signature";
00530             break;
00531         case kBinWrongSig:
00532             desc = "Binary File has a wrong mac signature";
00533             break;
00534         default:
00535             desc = "File has some unknown problem";
00536             break;
00537         }
00538         LString::CopyPStr(desc, ioDrawContents.outTextString);
00539         break;
00540     case 3:
00541         ioDrawContents.outShowSelection = false;
00542         break;
00543     }
00544 }
00545
00546 // just to be cute, we'll draw an adornment (again, see the LOutlineItem.cp
00547 // comments for more information). We'll draw a groovy gray background
00548 void
00549 CWarningItem::DrawRowAdornments(
00550     const Rect&     inLocalRowRect )
00551 {
00552     ShadeRow(UGAColorRamp::GetColor(0), inLocalRowRect);
00553 }
00554
00555 void CWarningItem::EditImportCell(void)
00556 {
00557     StDialogHandler theHandler(dlg_ImpFilterWarn, LCommander::GetTopCommander());
00558     LWindow *theDialog = theHandler.GetDialog();
00559     ThrowIfNil_(theDialog);
00560
00561     LTextEditView *warn = dynamic_cast<LTextEditView*>
00562         (theDialog->FindPaneByID(item_ImpEditWarn));
00563     CStr print;
00564     mEntry->PrintOut(print);
00565     warn->SetTextPtr((Ptr)(const char *)print, print.length());
00566
00567     theDialog->Show();
00568     MessageT hitMessage;
00569     while (true)
00570     {       // Let DialogHandler process events
00571         hitMessage = theHandler.DoDialog();
00572
00573         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00574             break;
00575     }
00576     theDialog->Hide();
00577 }
00578
00579 void
00580 CWarningItem::DoubleClick(
00581     const STableCell&           /* inCell */,
00582     const SMouseDownEvent&      /* inMouseDown */,
00583     const SOutlineDrawContents& /* inDrawContents */,
00584     Boolean                     /* inHitText */)
00585 {
00586     EditImportCell();
00587 }
00588
00589 CEntryItem::CEntryItem( ReportConflict * entry, Handle war_icon, Handle err_icon)
00590 {
00591     mEntry = entry;
00592     mErrIcon = err_icon;
00593     mWarnIcon = war_icon;
00594 }
00595
00596 CEntryItem::~CEntryItem()
00597 {
00598 }
00599
00600 // this is the routine called to know what to draw within the
00601 // table cell. See the comments in LOutlineItem.cp for more info.
00602 void
00603 CEntryItem::GetDrawContentsSelf(
00604     const STableCell&       inCell,
00605     SOutlineDrawContents&   ioDrawContents)
00606 {
00607     CPStr str;
00608
00609     switch (inCell.col)
00610     {
00611     case 1:
00612         ioDrawContents.outShowSelection = true;
00613         ioDrawContents.outHasIcon = true;
00614         ioDrawContents.outIconSuite = mEntry->HasConflict() ? mErrIcon : mWarnIcon;
00615
00616         if(mEntry->HasConflict())
00617         {
00618             str << "Conflict";
00619             ioDrawContents.outTextTraits.style = bold;
00620         }
00621         else if(mEntry->HasTypeCreatorConflict())
00622         {
00623             str << "Warning";
00624             ioDrawContents.outTextTraits.style = 0;
00625         }
00626         else
00627         {
00628             str << "OK";
00629             ioDrawContents.outTextTraits.style = 0;
00630         }
00631         LString::CopyPStr(str, ioDrawContents.outTextString);
00632         break;
00633
00634     case 2:
00635         ioDrawContents.outShowSelection = true;
00636         ioDrawContents.outHasIcon = false/*true*/;
00637         ioDrawContents.outIconSuite = 0L/*mIconH*/;
00638         ioDrawContents.outTextTraits.style = 0;
00639
00640         str << "Type ";
00641         str << (mEntry->IsExtension() ? "*" : "");
00642         str << mEntry->GetPattern();
00643         LString::CopyPStr(str, ioDrawContents.outTextString);
00644         break;
00645
00646     case 3:
00647         ioDrawContents.outShowSelection = true;
00648         ioDrawContents.outHasIcon = false;
00649         ioDrawContents.outTextTraits.style = 0;
00650
00651         if(mEntry->HasForceBinary())
00652         {
00653             LString::CopyPStr("\pFORCE BINARY", ioDrawContents.outTextString);
00654             ioDrawContents.outTextTraits.style = bold;
00655         }
00656         else if(mEntry->HasForceText())
00657         {
00658             LString::CopyPStr("\pFORCE TEXT", ioDrawContents.outTextString);
00659             ioDrawContents.outTextTraits.style = bold;
00660         }
00661         else if(mEntry->HasIgnore())
00662         {
00663             LString::CopyPStr("\pIGNORE", ioDrawContents.outTextString);
00664             ioDrawContents.outTextTraits.style = bold;
00665         }
00666         else if(mEntry->IsBinary())
00667         {
00668             LString::CopyPStr("\pBINARY", ioDrawContents.outTextString);
00669             ioDrawContents.outTextTraits.style = 0;
00670         }
00671         else
00672         {
00673             LString::CopyPStr("\pTEXT", ioDrawContents.outTextString);
00674             ioDrawContents.outTextTraits.style = 0;
00675         }
00676         break;
00677     }
00678 }
00679
00680 // just to be cute, we'll draw an adornment (again, see the LOutlineItem.cp
00681 // comments for more information). We'll draw a groovy gray background
00682 void
00683 CEntryItem::DrawRowAdornments(
00684     const Rect&     inLocalRowRect )
00685 {
00686     ShadeRow(UGAColorRamp::GetColor(0), inLocalRowRect);
00687 }
00688
00689 static void DoDataExchange_ImpEditEntry(LWindow *theDialog, ReportConflict * mEntry, bool putValue)
00690 {
00691     LTextEditView *warn = dynamic_cast<LTextEditView*>
00692         (theDialog->FindPaneByID(item_ImpEditWarn));
00693
00694     if(putValue)
00695     {
00696         if(mEntry->HasForceBinary())
00697             theDialog->SetValueForPaneID (item_ImpEntryFBin, Button_On);
00698         else if(mEntry->HasForceText())
00699             theDialog->SetValueForPaneID (item_ImpEntryFText, Button_On);
00700         else if(mEntry->HasIgnore())
00701             theDialog->SetValueForPaneID (item_ImpEntryFIgn, Button_On);
00702         else
00703             theDialog->SetValueForPaneID (item_ImpEntryUnch, Button_On);
00704         CStr print;
00705         mEntry->PrintOut(print);
00706         warn->SetTextPtr((Ptr)(const char *)print, print.length());
00707     }
00708     else
00709     {
00710         if(theDialog->GetValueForPaneID (item_ImpEntryFBin) == Button_On)
00711             mEntry->ForceBinary();
00712         else if(theDialog->GetValueForPaneID (item_ImpEntryFText) == Button_On)
00713             mEntry->ForceText();
00714         else if(theDialog->GetValueForPaneID (item_ImpEntryFIgn) == Button_On)
00715             mEntry->Ignore();
00716         else
00717             mEntry->DisableUserSettings();
00718     }
00719 }
00720
00721 void CEntryItem::EditImportCell(void)
00722 {
00723     StDialogHandler theHandler(dlg_ImpFilterEntry, LCommander::GetTopCommander());
00724     LWindow *theDialog = theHandler.GetDialog();
00725     ThrowIfNil_(theDialog);
00726
00727     DoDataExchange_ImpEditEntry(theDialog, mEntry, true);
00728
00729     theDialog->Show();
00730     MessageT hitMessage;
00731     while (true)
00732     {       // Let DialogHandler process events
00733         hitMessage = theHandler.DoDialog();
00734
00735         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00736             break;
00737     }
00738     theDialog->Hide();
00739
00740     if(hitMessage == msg_OK)
00741     {
00742         DoDataExchange_ImpEditEntry(theDialog, mEntry, false);
00743         mOutlineTable->Refresh();
00744     }
00745 }
00746
00747 void
00748 CEntryItem::DoubleClick(
00749     const STableCell&           /* inCell */,
00750     const SMouseDownEvent&      /* inMouseDown */,
00751     const SOutlineDrawContents& /* inDrawContents */,
00752     Boolean                     /* inHitText */)
00753 {
00754     EditImportCell();
00755 }
00756 #endif /* qMacCvsPP */
00757
00758 #if qUnix
00759 class UCvsImpWarning : public UWidget
00760 {
00761     UDECLARE_DYNAMIC(UCvsImpWarning)
00762 public:
00763     UCvsImpWarning(ReportWarning * warn);
00764     virtual ~UCvsImpWarning() {}
00765
00766     enum
00767     {
00768         kOK = EV_COMMAND_START, // 0
00769         kDesc                   // 1
00770     };
00771
00772     virtual void DoDataExchange(bool fill);
00773
00774 protected:
00775     UStr m_desc;
00776
00777     ev_msg int OnOK(void);
00778
00779     UDECLARE_MESSAGE_MAP()
00780 };
00781
00782 UIMPLEMENT_DYNAMIC(UCvsImpWarning, UWidget)
00783
00784 UBEGIN_MESSAGE_MAP(UCvsImpWarning, UWidget)
00785     ON_UCOMMAND(UCvsImpWarning::kOK, UCvsImpWarning::OnOK)
00786 UEND_MESSAGE_MAP()
00787
00788 UCvsImpWarning::UCvsImpWarning(ReportWarning * warn) : UWidget(::UEventGetWidID())
00789 {
00790     warn->PrintOut(m_desc);
00791 }
00792
00793 int UCvsImpWarning::OnOK(void)
00794 {
00795     EndModal(true);
00796     return 0;
00797 }
00798
00799 void UCvsImpWarning::DoDataExchange(bool fill)
00800 {
00801     if(fill)
00802     {
00803         UEventSendMessage(GetWidID(), EV_SETTEXT, kDesc, (void *)(const char *)m_desc);
00804     }
00805     else
00806     {
00807     }
00808 }
00809
00810 class UCvsImpEntry : public UWidget
00811 {
00812     UDECLARE_DYNAMIC(UCvsImpEntry)
00813 public:
00814     UCvsImpEntry(ReportConflict * entry);
00815     virtual ~UCvsImpEntry() {}
00816
00817     enum
00818     {
00819         kOK = EV_COMMAND_START, // 0
00820         kCancel,                // 1
00821         kRadUnchanged,          // 2
00822         kRadBinary,             // 3
00823         kRadText,               // 4
00824         kRadIgnore,             // 5
00825         kDesc                   // 6
00826     };
00827
00828     virtual void DoDataExchange(bool fill);
00829
00830     int m_radios;
00831 protected:
00832     UStr m_desc;
00833
00834     ev_msg int OnOK(void);
00835     ev_msg int OnCancel(void);
00836     ev_msg int OnRadios(int cmd);
00837
00838     UDECLARE_MESSAGE_MAP()
00839 };
00840
00841 UIMPLEMENT_DYNAMIC(UCvsImpEntry, UWidget)
00842
00843 UBEGIN_MESSAGE_MAP(UCvsImpEntry, UWidget)
00844     ON_UCOMMAND(UCvsImpEntry::kOK, UCvsImpEntry::OnOK)
00845     ON_UCOMMAND(UCvsImpEntry::kCancel, UCvsImpEntry::OnCancel)
00846     ON_UCOMMAND_RANGE(UCvsImpEntry::kRadUnchanged, UCvsImpEntry::kRadIgnore, UCvsImpEntry::OnRadios)
00847 UEND_MESSAGE_MAP()
00848
00849 UCvsImpEntry::UCvsImpEntry(ReportConflict * entry) : UWidget(::UEventGetWidID())
00850 {
00851     entry->PrintOut(m_desc);
00852
00853     if(entry->HasForceBinary())
00854         m_radios = 1;
00855     else if(entry->HasForceText())
00856         m_radios = 2;
00857     else if(entry->HasIgnore())
00858         m_radios = 3;
00859     else
00860         m_radios = 0;
00861 }
00862
00863 int UCvsImpEntry::OnOK(void)
00864 {
00865     EndModal(true);
00866     return 0;
00867 }
00868
00869 int UCvsImpEntry::OnCancel(void)
00870 {
00871     EndModal(false);
00872     return 0;
00873 }
00874
00875 int UCvsImpEntry::OnRadios(int cmd)
00876 {
00877     m_radios = cmd - kRadUnchanged;
00878     return 0;
00879 }
00880
00881 void UCvsImpEntry::DoDataExchange(bool fill)
00882 {
00883     if(fill)
00884     {
00885         UEventSendMessage(GetWidID(), EV_SETTEXT, kDesc, (void *)(const char *)m_desc);
00886         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kRadUnchanged + m_radios, 1), 0L);
00887     }
00888     else
00889     {
00890     }
00891 }
00892
00893 #define NUM_COLUMNS 3
00894
00895 static char *_gszColumnLabel[NUM_COLUMNS] =
00896 {
00897     "Entry state", "Entry description", "Entry kind"
00898 };
00899
00900 static int _gnColumnWidth[NUM_COLUMNS] =
00901 {
00902     80, 270, 80
00903 };
00904
00905 #if qGTK
00906 static void *sWarningIcon;
00907 static void *sErrorIcon;
00908 #endif
00909
00910 class UCvsImpFilter : public UWidget
00911 {
00912     UDECLARE_DYNAMIC(UCvsImpFilter)
00913 public:
00914     UCvsImpFilter(ReportConflict * entries, ReportWarning * warnings);
00915     virtual ~UCvsImpFilter() {}
00916
00917     enum
00918     {
00919         kOK = EV_COMMAND_START, // 0
00920         kCancel,                // 1
00921         kList,                  // 2
00922         kEdit                   // 3
00923     };
00924
00925     virtual void DoDataExchange(bool fill);
00926
00927 protected:
00928     ReportConflict *m_entries;
00929     ReportWarning *m_warnings;
00930
00931     ev_msg int OnOK(void);
00932     ev_msg int OnCancel(void);
00933     ev_msg int OnEdit(void);
00934     ev_msg void OnDblClick(void);
00935
00936     UDECLARE_MESSAGE_MAP()
00937 };
00938
00939 UIMPLEMENT_DYNAMIC(UCvsImpFilter, UWidget)
00940
00941 UBEGIN_MESSAGE_MAP(UCvsImpFilter, UWidget)
00942     ON_UCOMMAND(UCvsImpFilter::kOK, UCvsImpFilter::OnOK)
00943     ON_UCOMMAND(UCvsImpFilter::kCancel, UCvsImpFilter::OnCancel)
00944     ON_UCOMMAND(UCvsImpFilter::kEdit, UCvsImpFilter::OnEdit)
00945     ON_LIST_DBLCLICK(UCvsImpFilter::kList, UCvsImpFilter::OnDblClick)
00946 UEND_MESSAGE_MAP()
00947
00948 UCvsImpFilter::UCvsImpFilter(ReportConflict * entries, ReportWarning * warnings) :
00949     UWidget(::UEventGetWidID())
00950 {
00951     m_entries = entries;
00952     m_warnings = warnings;
00953 }
00954
00955 int UCvsImpFilter::OnOK(void)
00956 {
00957     EndModal(true);
00958     return 0;
00959 }
00960
00961 int UCvsImpFilter::OnCancel(void)
00962 {
00963     EndModal(false);
00964     return 0;
00965 }
00966
00967 void UCvsImpFilter::OnDblClick(void)
00968 {
00969     OnEdit();
00970 }
00971
00972 void UCvsImpFilter::DoDataExchange(bool fill)
00973 {
00974     if(sWarningIcon == 0L)
00975     {
00976         sWarningIcon = UCreate_pixmap(this, "warning.xpm");
00977         sErrorIcon = UCreate_pixmap(this, "error.xpm");
00978     }
00979
00980     if(fill)
00981     {
00982         UEventSendMessage(GetWidID(), EV_LIST_SETFEEDBACK, UMAKEINT(kList, 0), 0L);
00983         UEventSendMessage(GetWidID(), EV_LIST_ADDCOLUMNS, UMAKEINT(kList, NUM_COLUMNS), 0L);
00984         for(int i = 0; i < NUM_COLUMNS; i++)
00985         {
00986             UEventSendMessage(GetWidID(), EV_LIST_SETCOLTITLE, UMAKEINT(kList, i),
00987                               _gszColumnLabel[i]);
00988             UEventSendMessage(GetWidID(), EV_LIST_SETCOLWIDTH, UMAKEINT(kList, i),
00989                               (void *)_gnColumnWidth[i]);
00990         }
00991         UEventSendMessage(GetWidID(), EV_LIST_SETFEEDBACK, UMAKEINT(kList, 1), 0L);
00992
00993         UEventSendMessage(GetWidID(), EV_LIST_RESETALL, kList, 0L);
00994
00995         ReportWarning * warn = m_warnings;
00996         while(warn != 0L)
00997         {
00998             const char *desc;
00999             bool isError = true;
01000
01001             switch(warn->Kind())
01002             {
01003             case kFileIsOK:
01004                 isError = false; // should not happen
01005                 desc = "File is OK";
01006                 break;
01007             case kFileMissing:
01008                 desc = "File is missing or unreadable";
01009                 break;
01010             case kFileIsAlias:
01011                 desc = "File is an alias";
01012                 break;
01013             case kFileInvalidName:
01014                 desc = "File has an invalid name";
01015                 break;
01016             case kTextWrongLF:
01017                 desc = "File has the wrong line feed for this machine";
01018                 break;
01019             case kTextIsBinary:
01020                 desc = "File seems to be binary, while expecting text";
01021                 break;
01022             case kTextEscapeChar:
01023                 desc = "File has some escape characters in it (0x00-0x20, 0x80-0xFF)";
01024                 isError = false;
01025                 break;
01026             default:
01027                 desc = "File has some unknown problem";
01028                 break;
01029             }
01030
01031             int rownum;
01032             UEventSendMessage(GetWidID(), EV_LIST_NEWROW, kList, &rownum);
01033             UEventSendMessage(GetWidID(), EV_LIST_ROWSETDATA, UMAKEINT(kList, rownum), warn);
01034             ULIST_INSERT entry;
01035             entry.row = rownum;
01036
01037             entry.col = 0;
01038             entry.title = isError ? "Error" : "Warning";
01039             entry.icon = 0L;
01040 #if qGTK
01041             entry.icon = isError ? sErrorIcon : sWarningIcon;
01042 #endif
01043             UEventSendMessage(GetWidID(), EV_LIST_INSERT, kList, &entry);
01044
01045             entry.col = 1;
01046             entry.title = desc;
01047             entry.icon = 0L;
01048             UEventSendMessage(GetWidID(), EV_LIST_INSERT, kList, &entry);
01049
01050             warn = warn->next;
01051         }
01052
01053         ReportConflict * conf = m_entries;
01054         while(conf != 0L)
01055         {
01056             UStr desc;
01057
01058             desc << "Type ";
01059             desc << (conf->IsExtension() ? "*" : "");
01060             desc << conf->GetPattern();
01061
01062             int rownum;
01063             UEventSendMessage(GetWidID(), EV_LIST_NEWROW, kList, &rownum);
01064             UEventSendMessage(GetWidID(), EV_LIST_ROWSETDATA, UMAKEINT(kList, rownum), conf);
01065             ULIST_INSERT entry;
01066             entry.row = rownum;
01067
01068             entry.col = 0;
01069             entry.title = conf->HasConflict() ? "Error" : "OK";
01070             entry.icon = 0L;
01071 #if qGTK
01072             entry.icon = conf->HasConflict() ? sErrorIcon : sWarningIcon;
01073 #endif
01074             UEventSendMessage(GetWidID(), EV_LIST_INSERT, kList, &entry);
01075
01076             entry.col = 1;
01077             entry.title = desc;
01078             entry.icon = 0L;
01079             UEventSendMessage(GetWidID(), EV_LIST_INSERT, kList, &entry);
01080
01081             entry.col = 2;
01082             entry.title = conf->HasIgnore() ? "IGNORE" : (conf->IsBinary() ? "BINARY" : "TEXT");
01083             entry.icon = 0L;
01084             UEventSendMessage(GetWidID(), EV_LIST_INSERT, kList, &entry);
01085
01086             conf = conf->next;
01087         }
01088     }
01089     else
01090     {
01091     }
01092 }
01093
01094 int UCvsImpFilter::OnEdit()
01095 {
01096     int row = -1;
01097     if((row = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL,
01098                                 UMAKEINT(kList, row), 0L)) == -1)
01099         return 0;
01100
01101     ULIST_INFO info;
01102     info.col = 0;
01103     info.row = row;
01104     UEventSendMessage(GetWidID(), EV_LIST_GETINFO, kList, &info);
01105
01106     ReportWarning * warn = m_warnings;
01107     while(warn != 0L)
01108     {
01109         if(warn == info.data)
01110         {
01111             void *wid = UCreate_ImpWarningDlg();
01112             UCvsImpWarning *dlg = new UCvsImpWarning(warn);
01113             UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01114             dlg->DoModal();
01115             delete dlg;
01116             return 0;
01117         }
01118         warn = warn->next;
01119     }
01120
01121     ReportConflict * conf = m_entries;
01122     while(conf != 0L)
01123     {
01124         if(conf == info.data)
01125         {
01126             void *wid = UCreate_ImpEntryDlg();
01127             UCvsImpEntry *dlg = new UCvsImpEntry(conf);
01128             UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01129             if(dlg->DoModal())
01130             {
01131                 ULIST_INSERT entry;
01132                 entry.row = row;
01133
01134                 entry.col = 2;
01135                 entry.title = 0L;
01136                 entry.icon = /*UCvsFiles::GetImageForEntry(data)*/0L;
01137                 switch(dlg->m_radios)
01138                 {
01139                 case 0:
01140                     conf->DisableUserSettings();
01141                     entry.title = conf->IsBinary() ? "BINARY" : "TEXT";
01142                     break;
01143                 case 1:
01144                     conf->ForceBinary();
01145                     entry.title = "FORCE BINARY";
01146                     break;
01147                 case 2:
01148                     conf->ForceText();
01149                     entry.title = "FORCE TEXT";
01150                     break;
01151                 case 3:
01152                     conf->Ignore();
01153                     entry.title = "IGNORE";
01154                     break;
01155                 }
01156                 if(entry.title != 0L)
01157                     UEventSendMessage(GetWidID(), EV_LIST_INSERT, kList, &entry);
01158             }
01159             delete dlg;
01160             return 0;
01161         }
01162
01163         conf = conf->next;
01164     }
01165     return 0;
01166 }
01167 #endif /* qUnix */
01168
01169 bool CompatImportFilter(const char *path, ReportConflict *& entries,
01170                         ReportWarning *& warnings)
01171 {
01172     bool result = false;
01173     entries = 0L;
01174     warnings = 0L;
01175
01176     list_all_types_recur(path, warnings, entries);
01177     if(entries == 0L && warnings == 0L)
01178         return false;
01179
01180 #ifdef WIN32
01181     CImportFilterDlg pages(entries, warnings);
01182     if(pages.DoModal() == IDOK)
01183     {
01184         result = true;
01185     }
01186 #endif /* WIN32 */
01187 #ifdef qMacCvsPP
01188     gWarnings = warnings;
01189     gEntries = entries;
01190
01191     StDialogHandler theHandler(dlg_ImpFilter, LCommander::GetTopCommander());
01192     LWindow *theDialog = theHandler.GetDialog();
01193     ThrowIfNil_(theDialog);
01194
01195     theDialog->Show();
01196     MessageT hitMessage;
01197     while (true)
01198     {       // Let DialogHandler process events
01199         hitMessage = theHandler.DoDialog();
01200
01201         if(hitMessage == item_ImpPushEdit)
01202         {
01203             // simulate dbl click
01204             LOutlineTable *tab = dynamic_cast<LOutlineTable*>
01205                 (theDialog->FindPaneByID(item_ImpFilterList));
01206
01207             STableCell  cell = tab->GetFirstSelectedCell();
01208             if(!cell.IsNullCell())
01209             {
01210                 //TableIndexT index;
01211                 //tab->CellToIndex(cell, index);
01212                 CImportItem *item = dynamic_cast<CImportItem*>(tab->FindItemForRow(cell.row));
01213                 Assert_(item != 0L);
01214                 if(item != 0L)
01215                     item->EditImportCell();
01216             }
01217         }
01218
01219         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01220             break;
01221     }
01222     theDialog->Hide();
01223
01224     if(hitMessage == msg_OK)
01225     {
01226         result = true;
01227     }
01228 #endif /* qMacCvsPP */
01229 #if qUnix
01230     void *wid = UCreate_ImportFilterDlg();
01231
01232     UCvsImpFilter *dlg = new UCvsImpFilter(entries, warnings);
01233     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01234
01235     if(dlg->DoModal())
01236     {
01237         result = true;
01238     }
01239
01240     delete dlg;
01241 #endif // qUnix
01242
01243     if(!result)
01244     {
01245         free_list_types(warnings, entries);
01246         entries = 0L;
01247         warnings = 0L;
01248     }
01249
01250     return result;
01251 }
Generated on Sun Feb 24 01:21:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/ImportFilterDlg.h Source File

common/ImportFilterDlg.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00019  */
00020
00021 /*
00022  * ImportFilterDlg.h - edit filtered import
00023  */
00024
00025 #if !defined(AFX_IMPORTFILDERDLG_H__CFB7AA41_BDDB_11D1_B965_0020AF51D9DA__INCLUDED_)
00026 #define AFX_IMPORTFILDERDLG_H__CFB7AA41_BDDB_11D1_B965_0020AF51D9DA__INCLUDED_
00027
00028 #include "ImportFilter.h"
00029
00030 bool CompatImportFilter(const char *path, ReportConflict *& entries,
00031                         ReportWarning *& warnings);
00032     // - return false if the user canceled.
00033     // - if the user hits OK, all the conflicts should be resolved
00034     // by the dialog session.
00035
00036 #if _MSC_VER >= 1000
00037 #pragma once
00038 #endif // _MSC_VER >= 1000
00039
00040 #ifdef WIN32
00041
00042 // CImportFilterDlg dialog
00043
00044 class CImportFilterDlg : public CDialog
00045 {
00046 // Construction
00047 public:
00048     CImportFilterDlg(ReportConflict * entries, ReportWarning * warnings,
00049         CWnd* pParent = NULL);   // standard constructor
00050
00051 // Dialog Data
00052     //{{AFX_DATA(CImportFilterDlg)
00053     enum { IDD = IDD_IMPORTFILTER };
00054     CListCtrl   m_list;
00055     CButton m_edit;
00056     //}}AFX_DATA
00057
00058
00059 // Overrides
00060     // ClassWizard generated virtual function overrides
00061     //{{AFX_VIRTUAL(CImportFilterDlg)
00062     protected:
00063     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00064     //}}AFX_VIRTUAL
00065
00066 // Implementation
00067 protected:
00068     CImageList m_ImageList;
00069     ReportConflict * m_entries;
00070     ReportWarning * m_warnings;
00071
00072     // Generated message map functions
00073     //{{AFX_MSG(CImportFilterDlg)
00074     afx_msg void OnEditentry();
00075     virtual BOOL OnInitDialog();
00076     afx_msg void OnDblclkListentries(NMHDR* pNMHDR, LRESULT* pResult);
00077     //}}AFX_MSG
00078     DECLARE_MESSAGE_MAP()
00079 };
00080
00081 class CImportWarning : public CDialog
00082 {
00083 // Construction
00084 public:
00085     CImportWarning(ReportWarning * warn, CWnd* pParent = NULL);   // standard constructor
00086
00087 // Dialog Data
00088     //{{AFX_DATA(CImportWarning)
00089     enum { IDD = IDD_WARNINGDESC };
00090     CString m_desc;
00091     //}}AFX_DATA
00092
00093
00094 // Overrides
00095     // ClassWizard generated virtual function overrides
00096     //{{AFX_VIRTUAL(CImportWarning)
00097     protected:
00098     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00099     //}}AFX_VIRTUAL
00100
00101 // Implementation
00102 protected:
00103
00104     // Generated message map functions
00105     //{{AFX_MSG(CImportWarning)
00106         // NOTE: the ClassWizard will add member functions here
00107     //}}AFX_MSG
00108     DECLARE_MESSAGE_MAP()
00109 };
00110
00111 class CImportEntry : public CDialog
00112 {
00113 // Construction
00114 public:
00115     CImportEntry(ReportConflict * entry, CWnd* pParent = NULL);   // standard constructor
00116
00117 // Dialog Data
00118     //{{AFX_DATA(CImportEntry)
00119     enum { IDD = IDD_ENTRYDESC };
00120     CString m_desc;
00121     int m_radios;
00122     //}}AFX_DATA
00123
00124
00125 // Overrides
00126     // ClassWizard generated virtual function overrides
00127     //{{AFX_VIRTUAL(CImportEntry)
00128     protected:
00129     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00130     //}}AFX_VIRTUAL
00131
00132 // Implementation
00133 protected:
00134
00135     // Generated message map functions
00136     //{{AFX_MSG(CImportEntry)
00137         // NOTE: the ClassWizard will add member functions here
00138     //}}AFX_MSG
00139     DECLARE_MESSAGE_MAP()
00140 };
00141
00142 //{{AFX_INSERT_LOCATION}}
00143 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00144
00145 #endif /* WIN32 */
00146
00147 #ifdef qMacCvsPP
00148 #include <LOutlineTable.h>
00149 #include <LCommander.h>
00150 #include <LOutlineItem.h>
00151 #include <LString.h>
00152
00153 class COutlineTable : public LOutlineTable, public LCommander
00154 {
00155 public:
00156     enum { class_ID = 'Cout' };
00157
00158     COutlineTable( LStream *inStream );
00159     virtual ~COutlineTable();
00160 protected:
00161     virtual void FinishCreateSelf();
00162
00163     Handle mIconWarning;
00164     Handle mIconError;
00165 private:
00166     // defensive programming
00167     COutlineTable();
00168     COutlineTable( const COutlineTable &inOriginal );
00169     COutlineTable&      operator=( const COutlineTable &inOriginal );
00170 };
00171
00172 class CImportItem : public LOutlineItem
00173 {
00174 public:
00175     virtual void EditImportCell(void) = 0;
00176 };
00177
00178 class CEntryItem : public CImportItem
00179 {
00180 public:
00181     CEntryItem(ReportConflict * entry, Handle war_icon, Handle err_icon);
00182     virtual ~CEntryItem();
00183
00184     virtual void EditImportCell(void);
00185 protected:
00186
00187     virtual void GetDrawContentsSelf(const STableCell& inCell, SOutlineDrawContents& ioDrawContents);
00188
00189     virtual void DrawRowAdornments(const Rect& inLocalRowRect);
00190
00191     virtual void DoubleClick(const STableCell& inCell, const SMouseDownEvent& inMouseDown,
00192         const SOutlineDrawContents& inDrawContents, Boolean inHitText);
00193
00194     ReportConflict * mEntry;
00195     Handle mErrIcon;
00196     Handle mWarnIcon;
00197 private:
00198     // defensive programming
00199     CEntryItem();
00200     CEntryItem( const CEntryItem &inOriginal );
00201     CEntryItem& operator=( const CEntryItem &inOriginal );
00202 };
00203
00204 class CWarningItem : public CImportItem
00205 {
00206 public:
00207     CWarningItem(ReportWarning * warn, Handle war_icon, Handle err_icon);
00208     virtual ~CWarningItem();
00209
00210     virtual void EditImportCell(void);
00211 protected:
00212
00213     virtual void GetDrawContentsSelf(const STableCell& inCell, SOutlineDrawContents& ioDrawContents);
00214
00215     virtual void DrawRowAdornments(const Rect& inLocalRowRect);
00216
00217     virtual void DoubleClick(const STableCell& inCell, const SMouseDownEvent& inMouseDown,
00218         const SOutlineDrawContents& inDrawContents, Boolean inHitText);
00219
00220     ReportWarning * mEntry;
00221     Handle mErrIcon;
00222     Handle mWarnIcon;
00223 private:
00224     // defensive programming
00225     CWarningItem();
00226     CWarningItem( const CWarningItem &inOriginal );
00227     CWarningItem&   operator=( const CWarningItem &inOriginal );
00228 };
00229 #endif /* qMacCvsPP */
00230
00231 #endif // !defined(AFX_IMPORTFILDERDLG_H__CFB7AA41_BDDB_11D1_B965_0020AF51D9DA__INCLUDED_)
Generated on Sun Feb 24 01:21:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/InitDlg.cpp Source File

common/InitDlg.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- June 1999
00019  */
00020
00021 /*
00022  * InitDlg.cpp : the cvs init dialog
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef WIN32
00028 #   include "wincvs.h"
00029 #endif /* WIN32 */
00030
00031 #include "InitDlg.h"
00032 #include "CvsPrefs.h"
00033
00034 #ifdef WIN32
00035 #   include "GetPrefs.h"
00036 #   include "PromptFiles.h"
00037 #   ifdef _DEBUG
00038 #   define new DEBUG_NEW
00039 #   undef THIS_FILE
00040     static char THIS_FILE[] = __FILE__;
00041 #   endif
00042
00044 // CInit_MAIN dialog
00045
00046
00047 CInit_MAIN::CInit_MAIN()
00048     : CPropertyPage(CInit_MAIN::IDD)
00049 {
00050     //{{AFX_DATA_INIT(CInit_MAIN)
00051     m_forceroot = FALSE;
00052     m_helpinit = _T("");
00053     //}}AFX_DATA_INIT
00054 }
00055
00056 CInit_MAIN::CInit_MAIN(bool forceRoot)
00057     : CPropertyPage(CInit_MAIN::IDD)
00058 {
00059     m_forceroot = forceRoot;
00060     m_helpinit = _T("If the CVSROOT (see next tab) is set to ""local"", "
00061         "the CVSROOT should be a Windows path (i.e. c:\\cvsroot). "
00062         "If the CVSROOT points on a remote machine, the path should be a Unix path "
00063         "(i.e. /fscvs/cvsroot : make sure you got the relevant security rights in "
00064         "order to create such a directory on the remote machine.");
00065 }
00066
00067 void CInit_MAIN::DoDataExchange(CDataExchange* pDX)
00068 {
00069     CPropertyPage::DoDataExchange(pDX);
00070     //{{AFX_DATA_MAP(CInit_MAIN)
00071     DDX_Check(pDX, IDC_FORCEROOT, m_forceroot);
00072     DDX_Text(pDX, IDC_HELPINIT, m_helpinit);
00073     //}}AFX_DATA_MAP
00074 }
00075
00076 BEGIN_MESSAGE_MAP(CInit_MAIN, CPropertyPage)
00077     //{{AFX_MSG_MAP(CInit_MAIN)
00078     //}}AFX_MSG_MAP
00079 END_MESSAGE_MAP()
00080
00081 IMPLEMENT_DYNCREATE(CInit_MAIN, CPropertyPage)
00082
00084 // CInit_MAIN message handlers
00085 #endif
00086
00087 bool CompatGetInit(bool & forceCvsroot)
00088 {
00089     bool userHitOK = false;
00090
00091     forceCvsroot = true;
00092
00093 #ifdef WIN32
00094     CPropertySheet pages("Init settings");
00095     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00096     CInit_MAIN page1(forceCvsroot);
00097     CGetPrefs_CVSROOT page2;
00098     CGetPrefs_GLOBALS page3;
00099     pages.AddPage(&page1);
00100     pages.AddPage(&page2);
00101     pages.AddPage(&page3);
00102     if(pages.DoModal() == IDOK)
00103     {
00104         forceCvsroot = page1.m_forceroot == TRUE;
00105
00106         page2.StoreValues();
00107         page3.StoreValues();
00108         userHitOK = true;
00109     }
00110 #endif /* WIN32 */
00111
00112     if(userHitOK)
00113     {
00114         gCvsPrefs.save();
00115     }
00116     return userHitOK;
00117 }
Generated on Sun Feb 24 01:21:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/InitDlg.h Source File

common/InitDlg.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- June 1999
00019  */
00020
00021 /*
00022  * InitDlg.cpp : the cvs init dialog
00023  */
00024
00025 #if !defined(AFX_INITDLG_H__155D02C3_2323_11D3_B1A6_004095463819__INCLUDED_)
00026 #define AFX_INITDLG_H__155D02C3_2323_11D3_B1A6_004095463819__INCLUDED_
00027
00028 #if _MSC_VER > 1000
00029 #pragma once
00030 #endif // _MSC_VER > 1000
00031
00032 #include "CPStr.h"
00033
00034 bool CompatGetInit(bool & forceCvsroot);
00035     // get the init path and misc options...
00036
00037 #ifdef WIN32
00038
00039 // CInit_MAIN dialog
00040
00041 class CInit_MAIN : public CPropertyPage
00042 {
00043     DECLARE_DYNCREATE(CInit_MAIN)
00044
00045 // Construction
00046 public:
00047     CInit_MAIN();   // standard constructor
00048     CInit_MAIN(bool forceRoot);
00049
00050 // Dialog Data
00051     //{{AFX_DATA(CInit_MAIN)
00052     enum { IDD = IDD_INIT_MAIN };
00053     BOOL    m_forceroot;
00054     CString m_helpinit;
00055     //}}AFX_DATA
00056
00057
00058 // Overrides
00059     // ClassWizard generated virtual function overrides
00060     //{{AFX_VIRTUAL(CInit_MAIN)
00061     protected:
00062     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00063     //}}AFX_VIRTUAL
00064
00065 // Implementation
00066 protected:
00067
00068     // Generated message map functions
00069     //{{AFX_MSG(CInit_MAIN)
00070     //}}AFX_MSG
00071     DECLARE_MESSAGE_MAP()
00072 };
00073
00074 //{{AFX_INSERT_LOCATION}}
00075 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00076 #endif
00077
00078 #endif // !defined(AFX_INITDLG_H__155D02C3_2323_11D3_B1A6_004095463819__INCLUDED_)
Generated on Sun Feb 24 01:21:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/LineCmd.cpp Source File

common/LineCmd.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 // LineCmd.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025
00026 #ifdef WIN32
00027 #   include "wincvs.h"
00028 #endif /* WIN32 */
00029
00030 #ifdef qMacCvsPP
00031 #   include <UModalDialogs.h>
00032 #   include <LCheckBoxGroupBox.h>
00033 #   include <LTextEditView.h>
00034 #   include <LPushButton.h>
00035 #   include <LMultiPanelView.h>
00036 #   include <LPopupGroupBox.h>
00037
00038 #   include "MacCvsConstant.h"
00039 #endif /* qMacCvsPP */
00040
00041 #include "MultiString.h"
00042 #include "LineCmd.h"
00043 #include "CvsArgs.h"
00044 #include "PromptFiles.h"
00045 #include "CPStr.h"
00046 #include "TextBinary.h"
00047
00048 #if qUnix
00049 #   include "UCvsDialogs.h"
00050 #endif
00051
00052 char *sDefPrevCvsCmd[] =
00053 {
00054     "cvs --help-options",
00055     "cvs --help-commands",
00056     "cvs --help-synonyms",
00057     "cvs -H <cvs_command>",
00058     0L
00059 };
00060
00061 static CMString gPrevCvsCmd(20, "P_PrevCvsCmd", sDefPrevCvsCmd);
00062
00063 #ifdef WIN32
00064 #   ifdef _DEBUG
00065 #   define new DEBUG_NEW
00066 #   undef THIS_FILE
00067     static char THIS_FILE[] = __FILE__;
00068 #   endif
00069 #endif /* WIN32 */
00070
00071 #ifdef qMacCvsPP
00072 static void DoDataExchange_CmdlineMain(LWindow *theDialog, CStr & cmdline, CPStr & path, bool & hasPath, bool putValue)
00073 {
00074     LCheckBoxGroupBox *cbox = dynamic_cast<LCheckBoxGroupBox*>
00075         (theDialog->FindPaneByID(item_CheckGroupPath));
00076     LPushButton *epath = dynamic_cast<LPushButton*>
00077         (theDialog->FindPaneByID(item_EditPath));
00078     LTextEditView *cline = dynamic_cast<LTextEditView*>
00079         (theDialog->FindPaneByID(item_NonEmptyTextEdit));
00080
00081     if(putValue)
00082     {
00083         cline->SetTextPtr((Ptr)(const char *)cmdline, cmdline.length());
00084         cbox->SetValue(hasPath ? Button_On : Button_Off);
00085         epath->SetDescriptor(path);
00086
00087         // this will take care about an empty module name
00088         theDialog->SetLatentSub(cline);
00089         //cline->AddListener(LCommander::GetTopCommander());
00090         if(cmdline.length() == 0)
00091         {
00092             LPushButton *theOK = dynamic_cast<LPushButton*>
00093                                         (theDialog->FindPaneByID(item_OK));
00094             Assert_(theOK != 0L);
00095             theOK->Disable();
00096         }
00097     }
00098     else
00099     {
00100         Handle hdl = cline->GetTextHandle();
00101         Assert_(hdl != 0L);
00102         cmdline.set(*hdl, GetHandleSize(hdl));
00103
00104         Str255 outDescriptor;
00105         epath->GetDescriptor(outDescriptor);
00106         path = outDescriptor;
00107         hasPath = cbox->GetValue() == Button_On;
00108     }
00109 }
00110 #endif /* qMacCvsPP */
00111
00112 #ifdef WIN32
00113 #include "GetPrefs.h"
00114 #include "CvsPrefs.h"
00115
00116 IMPLEMENT_DYNCREATE(CCmdLine_MAIN, CPropertyPage)
00117
00118 CCmdLine_MAIN::CCmdLine_MAIN(const char *lastcmd, bool hasPath, const char *lastpath)
00119     : CPropertyPage(CCmdLine_MAIN::IDD)
00120 {
00121     //{{AFX_DATA_INIT(CCmdLine_MAIN)
00122     m_checkPath = hasPath;
00123     m_cmdLine = lastcmd;
00124     m_folderLoc = lastpath;
00125     //}}AFX_DATA_INIT
00126
00127     m_firstTimeCmdline = true;
00128     m_prevCmdCombo.SetItems(&gPrevCvsCmd);
00129 }
00130
00131 CCmdLine_MAIN::CCmdLine_MAIN() : CPropertyPage(CCmdLine_MAIN::IDD)
00132 {
00133 }
00134
00135 CCmdLine_MAIN::~CCmdLine_MAIN()
00136 {
00137 }
00138
00139 void CCmdLine_MAIN::DoDataExchange(CDataExchange* pDX)
00140 {
00141     CPropertyPage::DoDataExchange(pDX);
00142     //{{AFX_DATA_MAP(CCmdLine_MAIN)
00143     DDX_Control(pDX, IDC_CMDLINE, m_cmdLineEdit);
00144     DDX_Control(pDX, IDC_PREVCMD, m_prevCmdCombo);
00145     DDX_Control(pDX, IDC_SELFOLDER, m_selFolder);
00146     DDX_Check(pDX, IDC_CHECKPATH, m_checkPath);
00147     DDX_Text(pDX, IDC_CMDLINE, m_cmdLine);
00148     DDV_MinChars(pDX, m_cmdLine, 1);
00149     DDX_Text(pDX, IDC_FOLDERLOC, m_folderLoc);
00150     //}}AFX_DATA_MAP
00151
00152     if( pDX->m_bSaveAndValidate )
00153     {
00154         if( !m_cmdLine.IsEmpty() && DEF_CVS_CMD != m_cmdLine )
00155         {
00156             gPrevCvsCmd.Insert(m_cmdLine);
00157         }
00158     }
00159     else
00160     {
00161         DDX_ComboMString(pDX, IDC_PREVCMD, m_prevCmdCombo);
00162     }
00163
00164     if( m_checkPath )
00165     {
00166         DDV_MinChars(pDX, m_folderLoc, 1);
00167         DDV_CheckPathExists(pDX, IDC_FOLDERLOC, m_folderLoc);
00168     }
00169
00170     if( !pDX->m_bSaveAndValidate )
00171     {
00172         m_selFolder.EnableWindow(m_checkPath);
00173     }
00174 }
00175
00176
00177 BEGIN_MESSAGE_MAP(CCmdLine_MAIN, CPropertyPage)
00178     //{{AFX_MSG_MAP(CCmdLine_MAIN)
00179     ON_BN_CLICKED(IDC_CHECKPATH, OnCheckpath)
00180     ON_BN_CLICKED(IDC_SELFOLDER, OnSelfolder)
00181     ON_CBN_SELCHANGE(IDC_PREVCMD, OnSelchangePrevcmd)
00182     ON_EN_SETFOCUS(IDC_CMDLINE, OnSetfocusCmdline)
00183     //}}AFX_MSG_MAP
00184 END_MESSAGE_MAP()
00185
00187 // CCmdLine_MAIN message handlers
00188
00189 void CCmdLine_MAIN::OnCheckpath()
00190 {
00191     CButton* button = (CButton *)GetDlgItem(IDC_CHECKPATH);
00192     int isChecked = button->GetCheck();
00193     CWnd* folderLoc = GetDlgItem(IDC_FOLDERLOC);
00194
00195     m_selFolder.EnableWindow(isChecked);
00196     folderLoc->EnableWindow(isChecked);
00197     m_selFolder.EnableWindow(isChecked);
00198 }
00199
00200 void CCmdLine_MAIN::OnSelfolder()
00201 {
00202     const char *dir = BrowserGetDirectory("Select where to execute:", IsWindow(this->m_hWnd) ? this : NULL);
00203     if( dir != 0L )
00204     {
00205         SetDlgItemText(IDC_FOLDERLOC, dir);
00206     }
00207 }
00208
00209 BOOL CCmdLine_MAIN::PreTranslateMessage(MSG* pMsg)
00210 {
00211     if( pMsg->message == WM_KEYDOWN )
00212     {
00213         switch( (int)pMsg->wParam )
00214         {
00215         case VK_ESCAPE:     //dialog can be dismissed by Esc key
00216             EndDialog(IDCANCEL);
00217             break;
00218         case VK_RETURN:     //command can be executed with Enter key
00219             UpdateData();
00220             EndDialog(IDOK);
00221             break;
00222         default:
00223             break;
00224         }
00225     }
00226
00227     return CPropertyPage::PreTranslateMessage(pMsg);
00228 }
00229
00230 BOOL CCmdLine_MAIN::OnInitDialog()
00231 {
00232     CPropertyPage::OnInitDialog();
00233
00234     // Extra initialization
00235     OnCheckpath();
00236
00237     return TRUE;  // return TRUE unless you set the focus to a control
00238                   // EXCEPTION: OCX Property Pages should return FALSE
00239 }
00240
00241 void CCmdLine_MAIN::OnSelchangePrevcmd()
00242 {
00243     int sel = m_prevCmdCombo.GetCurSel();
00244     if( sel == CB_ERR )
00245         return;
00246
00247     m_cmdLineEdit.SetSel(0, -1);
00248     const NAMESPACE(std) vector<CStr> & list = gPrevCvsCmd.GetList();
00249     m_cmdLineEdit.ReplaceSel(list[sel]);
00250 }
00251
00252 void CCmdLine_MAIN::OnSetfocusCmdline()
00253 {
00254     if( m_firstTimeCmdline )
00255     {
00256         m_firstTimeCmdline = false;
00257
00258         CString cmdLine;
00259         m_cmdLineEdit.GetWindowText(cmdLine);
00260
00261         if( DEF_CVS_CMD == cmdLine )
00262         {
00263             m_cmdLineEdit.SetSel(-1, -1);
00264         }
00265     }
00266 }
00267
00268 #endif /* WIN32 */
00269
00270 #if qUnix
00271 class UCvsCmdline : public UWidget
00272 {
00273     UDECLARE_DYNAMIC(UCvsCmdline)
00274 public:
00275     UCvsCmdline() : UWidget(::UEventGetWidID()) {}
00276     virtual ~UCvsCmdline() {}
00277
00278     enum
00279     {
00280         kOK = EV_COMMAND_START, // 0
00281         kCancel,                // 1
00282         kTabGeneral             // 2
00283     };
00284
00285     virtual void DoDataExchange(bool fill);
00286
00287 protected:
00288     ev_msg int OnOK(void);
00289     ev_msg int OnCancel(void);
00290
00291     UDECLARE_MESSAGE_MAP()
00292 };
00293
00294 UIMPLEMENT_DYNAMIC(UCvsCmdline, UWidget)
00295
00296 UBEGIN_MESSAGE_MAP(UCvsCmdline, UWidget)
00297     ON_UCOMMAND(UCvsCmdline::kOK, UCvsCmdline::OnOK)
00298     ON_UCOMMAND(UCvsCmdline::kCancel, UCvsCmdline::OnCancel)
00299 UEND_MESSAGE_MAP()
00300
00301 int UCvsCmdline::OnOK(void)
00302 {
00303     EndModal(true);
00304     return 0;
00305 }
00306
00307 int UCvsCmdline::OnCancel(void)
00308 {
00309     EndModal(false);
00310     return 0;
00311 }
00312
00313 void UCvsCmdline::DoDataExchange(bool fill)
00314 {
00315     if(fill)
00316     {
00317     }
00318     else
00319     {
00320     }
00321 }
00322
00323 class UCvsCmdline_MAIN : public UWidget
00324 {
00325     UDECLARE_DYNAMIC(UCvsCmdline_MAIN)
00326 public:
00327     UCvsCmdline_MAIN(const char *lastcmd, bool hasPath,
00328                      const char *lastpath);
00329     virtual ~UCvsCmdline_MAIN() {}
00330
00331     enum
00332     {
00333         kEditCmd = EV_COMMAND_START,    // 0
00334         kCheckPath,         // 1
00335         kStatPath,          // 2
00336         kBtnPath            // 3
00337     };
00338
00339     virtual void DoDataExchange(bool fill);
00340
00341     bool m_checkpath;
00342     UStr m_cmdline;
00343     UStr m_folderloc;
00344 protected:
00345     ev_msg int OnCheckPath(void);
00346     ev_msg int OnBtnPath(void);
00347
00348     UDECLARE_MESSAGE_MAP()
00349 };
00350
00351 UIMPLEMENT_DYNAMIC(UCvsCmdline_MAIN, UWidget)
00352
00353 UBEGIN_MESSAGE_MAP(UCvsCmdline_MAIN, UWidget)
00354     ON_UCOMMAND(UCvsCmdline_MAIN::kCheckPath, UCvsCmdline_MAIN::OnCheckPath)
00355     ON_UCOMMAND(UCvsCmdline_MAIN::kBtnPath, UCvsCmdline_MAIN::OnBtnPath)
00356 UEND_MESSAGE_MAP()
00357
00358 UCvsCmdline_MAIN::UCvsCmdline_MAIN(const char *lastcmd, bool hasPath,
00359                              const char *lastpath) : UWidget(::UEventGetWidID())
00360 {
00361     m_checkpath = hasPath;
00362     m_cmdline = lastcmd;
00363     m_folderloc = lastpath;
00364 }
00365
00366 int UCvsCmdline_MAIN::OnCheckPath()
00367 {
00368     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPath, 0L);
00369     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kStatPath, state), 0L);
00370     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kBtnPath, state), 0L);
00371     return 0;
00372 }
00373
00374 int UCvsCmdline_MAIN::OnBtnPath()
00375 {
00376     const char *dir = BrowserGetDirectory("Select where to execute :");
00377     if(dir != 0L)
00378         UEventSendMessage(GetWidID(), EV_SETTEXT, kStatPath, (void *)dir);
00379     return 0;
00380 }
00381
00382 void UCvsCmdline_MAIN::DoDataExchange(bool fill)
00383 {
00384     if(fill)
00385     {
00386         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckPath, m_checkpath), 0L);
00387         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditCmd, (void *)(const char *)m_cmdline);
00388         UEventSendMessage(GetWidID(), EV_SETTEXT, kStatPath, (void *)(const char *)m_folderloc);
00389
00390         OnCheckPath();
00391     }
00392     else
00393     {
00394         m_checkpath = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPath, 0L) != 0;
00395         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditCmd, &m_cmdline);
00396         UEventSendMessage(GetWidID(), EV_GETTEXT, kStatPath, &m_folderloc);
00397     }
00398 }
00399 #endif // qUnix
00400
00401 bool CompatGetCommand(CvsArgs &args, const char * &dir)
00402 {
00403     char cmd[MAX_CMD_LEN] = {'\0'};
00404     dir = 0L;
00405
00406     static CStr sLastCmdline(DEF_CVS_CMD);
00407 #ifdef macintosh
00408     static CPStr sLastPath("pick:a:mac:path:");
00409 #else /* !macintosh */
00410     static CPStr sLastPath("");
00411 #endif /* !macintosh */
00412     static bool sLastHasPath = false;
00413
00414 #ifdef WIN32
00415     CPropertySheet pages("Command line settings");
00416     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00417     CCmdLine_MAIN page1(sLastCmdline, sLastHasPath, sLastPath);
00418     CGetPrefs_GLOBALS page2;
00419     pages.AddPage(&page1);
00420     pages.AddPage(&page2);
00421     if( pages.DoModal() == IDOK )
00422     {
00423         sLastCmdline = page1.m_cmdLine;
00424         sLastHasPath = page1.m_checkPath == TRUE;
00425         sLastPath = page1.m_folderLoc;
00426
00427         dir = page1.m_checkPath ? (const char *)sLastPath : 0L;
00428         strcpy(cmd, page1.m_cmdLine);
00429
00430         page2.StoreValues();
00431         gCvsPrefs.save();
00432     }
00433     else
00434         return false;
00435 #endif /* WIN32 */
00436 #if qUnix
00437     void *wid = UCreate_CmdlineDlg();
00438
00439     UCvsCmdline *dlg = new UCvsCmdline();
00440     UCvsCmdline_MAIN *tab1 = new UCvsCmdline_MAIN(sLastCmdline, sLastHasPath, sLastPath);
00441     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00442     dlg->AddPage(tab1, UCvsCmdline::kTabGeneral, 0);
00443
00444     if(dlg->DoModal())
00445     {
00446         sLastCmdline = tab1->m_cmdline;
00447         sLastHasPath = tab1->m_checkpath;
00448         sLastPath = tab1->m_folderloc;
00449
00450         dir = tab1->m_checkpath ? (const char *)sLastPath : 0L;
00451         strcpy(cmd, tab1->m_cmdline);
00452     }
00453     else
00454     {
00455         delete dlg;
00456         return false;
00457     }
00458
00459     delete dlg;
00460 #endif // qUnix
00461 #ifdef qMacCvsPP
00462     StDialogHandler theHandler(dlg_Cmdline, LCommander::GetTopCommander());
00463     LWindow *theDialog = theHandler.GetDialog();
00464     ThrowIfNil_(theDialog);
00465     static UInt16 sRuntimePanel = 1;
00466
00467     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00468         (theDialog->FindPaneByID(item_MultiViewPrefs));
00469     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00470
00471     multiView->SwitchToPanel(2);
00472     DoDataExchange_Globals(theDialog, true);
00473     multiView->SwitchToPanel(1);
00474     DoDataExchange_CmdlineMain(theDialog, sLastCmdline, sLastPath, sLastHasPath, true);
00475
00476     LCheckBoxGroupBox *cbox = dynamic_cast<LCheckBoxGroupBox*>
00477         (theDialog->FindPaneByID(item_CheckGroupPath));
00478     LPushButton *epath = dynamic_cast<LPushButton*>
00479         (theDialog->FindPaneByID(item_EditPath));
00480     epath->AddListener(&theHandler);
00481     cbox->AddListener(&theHandler);
00482
00483     groupView->SetValue(sRuntimePanel);
00484     theDialog->Show();
00485     MessageT hitMessage;
00486     while (true)
00487     {       // Let DialogHandler process events
00488         hitMessage = theHandler.DoDialog();
00489
00490         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00491             break;
00492
00493         if(hitMessage == item_CheckGroupPath || hitMessage == item_EditPath)
00494         {
00495             cbox = dynamic_cast<LCheckBoxGroupBox*>
00496                 (theDialog->FindPaneByID(item_CheckGroupPath));
00497             epath = dynamic_cast<LPushButton*>
00498                 (theDialog->FindPaneByID(item_EditPath));
00499             if(cbox->GetValue() == Button_Off)
00500             {
00501                 dir = 0L;
00502                 continue;
00503             }
00504
00505             dir = BrowserGetDirectory("Select where to execute :");
00506             if(dir != 0L)
00507             {
00508                 CPStr tmp(dir);
00509                 epath->SetDescriptor(tmp);
00510             }
00511             else if(hitMessage == item_CheckGroupPath)
00512             {
00513                 cbox->SetValue(Button_Off);
00514             }
00515         }
00516
00517     }
00518     theDialog->Hide();
00519     sRuntimePanel = groupView->GetValue();
00520
00521     if(hitMessage == msg_OK)
00522     {
00523         multiView->SwitchToPanel(1);
00524         DoDataExchange_CmdlineMain(theDialog, sLastCmdline, sLastPath, sLastHasPath, false);
00525         multiView->SwitchToPanel(2);
00526         DoDataExchange_Globals(theDialog, false);
00527
00528         strcpy(cmd, sLastCmdline);
00529         Assert_(sLastCmdline.length() != 0);
00530         dir = sLastHasPath ? (const char *)sLastPath : 0L;
00531     }
00532     else
00533         return false;
00534 #endif /* qMacCvsPP */
00535
00536     if(cmd[0] == '\0' || (dir != 0L && dir[0] == '\0'))
00537         return false;
00538
00539     char *argv[MAX_ARGS];
00540     int argc = StringToArgv(cmd, argv);
00541
00542     for (int i = 0; i < argc; i++)
00543         args.add(argv[i]);
00544
00545     return true;
00546 }
Generated on Sun Feb 24 01:21:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/LineCmd.h Source File

common/LineCmd.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 #if !defined(AFX_LINECMD_H__5946A8C5_8517_11D1_8949_444553540000__INCLUDED_)
00022 #define AFX_LINECMD_H__5946A8C5_8517_11D1_8949_444553540000__INCLUDED_
00023
00024 #if _MSC_VER >= 1000
00025 #pragma once
00026 #endif // _MSC_VER >= 1000
00027 // LineCmd.h : header file
00028 //
00029
00030 #include "SmartComboBox.h"
00031
00032 #define DEF_CVS_CMD "cvs "
00033
00034 class CvsArgs;
00035
00036 bool CompatGetCommand(CvsArgs &args, const char * &dir);
00037     // return the directory, false if the user canceled
00038
00039 #ifdef WIN32
00040
00041 class CCmdLine_MAIN : public CPropertyPage
00042 {
00043     DECLARE_DYNCREATE(CCmdLine_MAIN)
00044
00045 // Construction
00046 public:
00047     CCmdLine_MAIN();
00048     CCmdLine_MAIN(const char *lastcmd, bool hasPath, const char *lastpath);
00049     ~CCmdLine_MAIN();
00050
00051 // Dialog Data
00052     //{{AFX_DATA(CCmdLine_MAIN)
00053     enum { IDD = IDD_CMDLINE_MAIN };
00054     CEdit   m_cmdLineEdit;
00055     CSmartComboBox  m_prevCmdCombo;
00056     CButton m_selFolder;
00057     BOOL    m_checkPath;
00058     CString m_cmdLine;
00059     CString m_folderLoc;
00060     //}}AFX_DATA
00061
00062
00063 // Overrides
00064     // ClassWizard generate virtual function overrides
00065     //{{AFX_VIRTUAL(CCmdLine_MAIN)
00066     public:
00067     virtual BOOL PreTranslateMessage(MSG* pMsg);
00068     protected:
00069     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00070     //}}AFX_VIRTUAL
00071
00072 // Implementation
00073 protected:
00074     // Generated message map functions
00075     //{{AFX_MSG(CCmdLine_MAIN)
00076     afx_msg void OnCheckpath();
00077     afx_msg void OnSelfolder();
00078     virtual BOOL OnInitDialog();
00079     afx_msg void OnSelchangePrevcmd();
00080     afx_msg void OnSetfocusCmdline();
00081     //}}AFX_MSG
00082     DECLARE_MESSAGE_MAP()
00083 private:
00084     bool m_firstTimeCmdline;
00085 };
00086
00087 //{{AFX_INSERT_LOCATION}}
00088 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00089 #endif /* WIN32 */
00090
00091 #endif // !defined(AFX_LINECMD_H__5946A8C5_8517_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/LogDlg.cpp Source File

common/LogDlg.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00019  */
00020
00021 /*
00022  * LogDlg.cpp : the cvs log dialog
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef WIN32
00028 #   include "wincvs.h"
00029 #   include "OptionalPropertySheet.h"
00030 #endif /* WIN32 */
00031
00032 #ifdef qMacCvsPP
00033 #   include <UModalDialogs.h>
00034 #   include <LMultiPanelView.h>
00035 #   include <LCheckBox.h>
00036 #   include <LEditText.h>
00037 #   include <LPopupGroupBox.h>
00038 #   include <LRadioButton.h>
00039 #   include "LPopupFiller.h"
00040
00041 #   include "MacCvsConstant.h"
00042 #endif /* qMacCvsPP */
00043
00044 #ifdef WIN32
00045 #   ifdef _DEBUG
00046 #   define new DEBUG_NEW
00047 #   undef THIS_FILE
00048     static char THIS_FILE[] = __FILE__;
00049 #   endif
00050 #endif /* WIN32 */
00051
00052 #if qUnix
00053 #   include "UCvsDialogs.h"
00054 #endif
00055
00056 #include "LogDlg.h"
00057 #include "CvsPrefs.h"
00058 #include "MultiString.h"
00059
00060 char *sDefLogTagNames[] =
00061 {
00062     "1.32:1.35",
00063     "1.32:",
00064     ":1.35",
00065     "branch-release1-0",
00066     "HEAD",
00067     0L
00068 };
00069
00070 char *sDefLogDateNames[] =
00071 {
00072     ">1998-3-24",
00073     "<1998-1-24",
00074     "1998-1-24<1998-3-24",
00075     "<=3-24",
00076     0L
00077 };
00078
00079 char *sDefLogStateNames[] =
00080 {
00081     "mystate",
00082     "dead",
00083     "exp",
00084     "mystate,mystate2",
00085     0L
00086 };
00087
00088 char *sDefLogUserNames[] =
00089 {
00090     "johna",
00091     "garyb",
00092     "johna,garyb",
00093     0L
00094 };
00095
00096 static CMString gLogRevNames(10, "P_LogTagNames", sDefLogTagNames);
00097 static CMString gLogDateNames(10, "P_LogDateNames", sDefLogDateNames);
00098 static CMString gLogStateNames(10, "P_LogStateNames", sDefLogStateNames);
00099 static CMString gLogUserNames(10, "P_LogUserNames", sDefLogUserNames);
00100
00101 #ifdef WIN32
00102 #include "GetPrefs.h"
00103
00104 IMPLEMENT_DYNCREATE(CLogMain, CPropertyPage)
00105
00106 CLogMain::CLogMain() : CPropertyPage(CLogMain::IDD)
00107 {
00108     //{{AFX_DATA_INIT(CLogMain)
00109     m_defbranch = FALSE;
00110     m_norecurs = FALSE;
00111     m_notags = FALSE;
00112     m_nousers = FALSE;
00113     m_onlyrcs = FALSE;
00114     //}}AFX_DATA_INIT
00115 }
00116
00117 CLogMain::~CLogMain()
00118 {
00119 }
00120
00121 void CLogMain::DoDataExchange(CDataExchange* pDX)
00122 {
00123     CPropertyPage::DoDataExchange(pDX);
00124     //{{AFX_DATA_MAP(CLogMain)
00125     DDX_Check(pDX, IDC_DEFBRANCH, m_defbranch);
00126     DDX_Check(pDX, IDC_NORECURS, m_norecurs);
00127     DDX_Check(pDX, IDC_NOTAGS, m_notags);
00128     DDX_Check(pDX, IDC_NOUSERS, m_nousers);
00129     DDX_Check(pDX, IDC_ONLYRCS, m_onlyrcs);
00130     //}}AFX_DATA_MAP
00131 }
00132
00133
00134 BEGIN_MESSAGE_MAP(CLogMain, CPropertyPage)
00135     //{{AFX_MSG_MAP(CLogMain)
00136         // NOTE: the ClassWizard will add message map macros here
00137     //}}AFX_MSG_MAP
00138 END_MESSAGE_MAP()
00139
00140 IMPLEMENT_DYNCREATE(CLogFilters, CPropertyPage)
00141
00142 CLogFilters::CLogFilters(const char * sLastDate, const char * sLastRev,
00143         const char * sLastUsers, const char * sLastStates) : CPropertyPage(CLogFilters::IDD)
00144 {
00145     //{{AFX_DATA_INIT(CLogFilters)
00146     m_date = sLastDate;
00147     m_rev = sLastRev;
00148     m_state = sLastStates;
00149     m_user = sLastUsers;
00150     //}}AFX_DATA_INIT
00151
00152     m_hasdate = FALSE;
00153     m_hasrev = FALSE;
00154     m_hasstate = FALSE;
00155     m_hasuser = FALSE;
00156
00157     m_revCombo.SetItems(&gLogRevNames);
00158     m_dateCombo.SetItems(&gLogDateNames);
00159     m_userCombo.SetItems(&gLogUserNames);
00160     m_stateCombo.SetItems(&gLogStateNames);
00161 }
00162
00163 CLogFilters::CLogFilters() : CPropertyPage(CLogFilters::IDD)
00164 {
00165 }
00166
00167 CLogFilters::~CLogFilters()
00168 {
00169 }
00170
00171 void CLogFilters::DoDataExchange(CDataExchange* pDX)
00172 {
00173     CPropertyPage::DoDataExchange(pDX);
00174     //{{AFX_DATA_MAP(CLogFilters)
00175     DDX_Control(pDX, IDC_COMBOUSER, m_userCombo);
00176     DDX_Control(pDX, IDC_COMBOSTATE, m_stateCombo);
00177     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00178     DDX_Control(pDX, IDC_COMBODATE, m_dateCombo);
00179     DDX_CBString(pDX, IDC_COMBODATE, m_date);
00180     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00181     DDX_CBString(pDX, IDC_COMBOSTATE, m_state);
00182     DDX_CBString(pDX, IDC_COMBOUSER, m_user);
00183     DDX_Check(pDX, IDC_DATE, m_hasdate);
00184     DDX_Check(pDX, IDC_REV, m_hasrev);
00185     DDX_Check(pDX, IDC_STATE, m_hasstate);
00186     DDX_Check(pDX, IDC_USER, m_hasuser);
00187     //}}AFX_DATA_MAP
00188
00189     if( m_hasstate )
00190     {
00191         DDV_MinChars(pDX, m_state, 1);
00192     }
00193
00194     if( m_hasdate )
00195     {
00196         DDV_MinChars(pDX, m_date, 1);
00197     }
00198
00199     if( !pDX->m_bSaveAndValidate )
00200     {
00201         OnRev();
00202         OnDate();
00203         OnState();
00204         OnUser();
00205     }
00206
00207     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00208     DDX_ComboMString(pDX, IDC_COMBODATE, m_dateCombo);
00209     DDX_ComboMString(pDX, IDC_COMBOUSER, m_userCombo);
00210     DDX_ComboMString(pDX, IDC_COMBOSTATE, m_stateCombo);
00211 }
00212
00213
00214 BEGIN_MESSAGE_MAP(CLogFilters, CPropertyPage)
00215     //{{AFX_MSG_MAP(CLogFilters)
00216     ON_BN_CLICKED(IDC_DATE, OnDate)
00217     ON_BN_CLICKED(IDC_REV, OnRev)
00218     ON_BN_CLICKED(IDC_STATE, OnState)
00219     ON_BN_CLICKED(IDC_USER, OnUser)
00220     //}}AFX_MSG_MAP
00221 END_MESSAGE_MAP()
00222
00224 // CLogFilters message handlers
00225
00226 void CLogFilters::OnDate()
00227 {
00228     CButton* but = (CButton *)GetDlgItem(IDC_DATE);
00229     CWnd* wnd = GetDlgItem(IDC_COMBODATE);
00230     wnd->EnableWindow(but->GetCheck() == 1);
00231 }
00232
00233 void CLogFilters::OnRev()
00234 {
00235     CButton* but = (CButton *)GetDlgItem(IDC_REV);
00236     CWnd* wnd = GetDlgItem(IDC_COMBOREV);
00237     wnd->EnableWindow(but->GetCheck() == 1);
00238 }
00239
00240 void CLogFilters::OnState()
00241 {
00242     CButton* but = (CButton *)GetDlgItem(IDC_STATE);
00243     CWnd* wnd = GetDlgItem(IDC_COMBOSTATE);
00244     wnd->EnableWindow(but->GetCheck() == 1);
00245 }
00246
00247 void CLogFilters::OnUser()
00248 {
00249     CButton* but = (CButton *)GetDlgItem(IDC_USER);
00250     CWnd* wnd = GetDlgItem(IDC_COMBOUSER);
00251     wnd->EnableWindow(but->GetCheck() == 1);
00252 }
00253 #endif /* WIN32 */
00254
00255 #ifdef qMacCvsPP
00256 static void DoDataExchange_LogFilters(LWindow *theDialog, bool & hasDate, bool & hasStates,
00257         bool & hasRev, bool & hasUsers,
00258         CPStr & sLastDate, CPStr & sLastRev,
00259         CPStr & sLastUsers, CPStr & sLastStates, bool putValue)
00260 {
00261     LCheckBox *chkd = dynamic_cast<LCheckBox*>
00262         (theDialog->FindPaneByID(item_LogCheckByDate));
00263     LEditText *editd = dynamic_cast<LEditText*>
00264         (theDialog->FindPaneByID(item_LogEditByDate));
00265     LCheckBox *chks = dynamic_cast<LCheckBox*>
00266         (theDialog->FindPaneByID(item_LogCheckByState));
00267     LEditText *edits = dynamic_cast<LEditText*>
00268         (theDialog->FindPaneByID(item_LogEditByState));
00269     LCheckBox *chkr = dynamic_cast<LCheckBox*>
00270         (theDialog->FindPaneByID(item_LogCheckByRev));
00271     LEditText *editr = dynamic_cast<LEditText*>
00272         (theDialog->FindPaneByID(item_LogEditByRev));
00273     LCheckBox *chku = dynamic_cast<LCheckBox*>
00274         (theDialog->FindPaneByID(item_LogCheckByUser));
00275     LEditText *editu = dynamic_cast<LEditText*>
00276         (theDialog->FindPaneByID(item_LogEditByUser));
00277     LPopupFiller *fillDate = dynamic_cast<LPopupFiller*>
00278         (theDialog->FindPaneByID(item_LogFillByDate));
00279     LPopupFiller *fillState = dynamic_cast<LPopupFiller*>
00280         (theDialog->FindPaneByID(item_LogFillByState));
00281     LPopupFiller *fillRev = dynamic_cast<LPopupFiller*>
00282         (theDialog->FindPaneByID(item_LogFillByRev));
00283     LPopupFiller *fillUser = dynamic_cast<LPopupFiller*>
00284         (theDialog->FindPaneByID(item_LogFillByUser));
00285
00286     fillDate->DoDataExchange(gLogDateNames, putValue);
00287     fillState->DoDataExchange(gLogStateNames, putValue);
00288     fillRev->DoDataExchange(gLogRevNames, putValue);
00289     fillUser->DoDataExchange(gLogUserNames, putValue);
00290
00291     if(putValue)
00292     {
00293         chkd->SetValue(hasDate ? Button_On : Button_Off);
00294         editd->SetText((Ptr)(const char *)sLastDate, sLastDate.length());
00295
00296         chks->SetValue(hasStates ? Button_On : Button_Off);
00297         edits->SetText((Ptr)(const char *)sLastStates, sLastStates.length());
00298
00299         chkr->SetValue(hasRev ? Button_On : Button_Off);
00300         editr->SetText((Ptr)(const char *)sLastRev, sLastRev.length());
00301
00302         chku->SetValue(hasUsers ? Button_On : Button_Off);
00303         editu->SetText((Ptr)(const char *)sLastUsers, sLastUsers.length());
00304     }
00305     else
00306     {
00307         char str[255];
00308         Size len;
00309
00310         hasDate = chkd->GetValue() == Button_On;
00311         editd->GetText(str, 254, &len);
00312         sLastDate.set(str, len);
00313
00314         hasStates = chks->GetValue() == Button_On;
00315         edits->GetText(str, 254, &len);
00316         sLastStates.set(str, len);
00317
00318         hasRev = chkr->GetValue() == Button_On;
00319         editr->GetText(str, 254, &len);
00320         sLastRev.set(str, len);
00321
00322         hasUsers = chku->GetValue() == Button_On;
00323         editu->GetText(str, 254, &len);
00324         sLastUsers.set(str, len);
00325     }
00326 }
00327
00328 static void DoDataExchange_LogSettings(LWindow *theDialog, bool & noRecurs, bool & defBranch,
00329     bool & headerOnly, bool & noTags, bool & onlyRCSfile, bool putValue)
00330 {
00331     LCheckBox *chkNoRecurs = dynamic_cast<LCheckBox*>
00332         (theDialog->FindPaneByID(item_NoRecurs));
00333     LCheckBox *chkDefBranch = dynamic_cast<LCheckBox*>
00334         (theDialog->FindPaneByID(item_LogDefBranch));
00335     LCheckBox *chkHeaderOnly = dynamic_cast<LCheckBox*>
00336         (theDialog->FindPaneByID(item_LogNoUserLogs));
00337     LCheckBox *chkNoTags = dynamic_cast<LCheckBox*>
00338         (theDialog->FindPaneByID(item_LogNoTags));
00339     LCheckBox *chkOnlyRCSfile = dynamic_cast<LCheckBox*>
00340         (theDialog->FindPaneByID(item_LogOnlyRcs));
00341
00342     if(putValue)
00343     {
00344         chkNoRecurs->SetValue(noRecurs ? Button_On : Button_Off);
00345         chkDefBranch->SetValue(defBranch ? Button_On : Button_Off);
00346         chkHeaderOnly->SetValue(headerOnly ? Button_On : Button_Off);
00347         chkNoTags->SetValue(noTags ? Button_On : Button_Off);
00348         chkOnlyRCSfile->SetValue(onlyRCSfile ? Button_On : Button_Off);
00349     }
00350     else
00351     {
00352         noRecurs = chkNoRecurs->GetValue() == Button_On;
00353         defBranch = chkDefBranch->GetValue() == Button_On;
00354         headerOnly = chkHeaderOnly->GetValue() == Button_On;
00355         noTags = chkNoTags->GetValue() == Button_On;
00356         onlyRCSfile = chkOnlyRCSfile->GetValue() == Button_On;
00357     }
00358 }
00359 #endif /* qMacCvsPP */
00360
00361 #if qUnix
00362 class UCvsLog : public UWidget
00363 {
00364     UDECLARE_DYNAMIC(UCvsLog)
00365 public:
00366     UCvsLog() : UWidget(::UEventGetWidID()) {}
00367     virtual ~UCvsLog() {}
00368
00369     enum
00370     {
00371         kOK = EV_COMMAND_START, // 0
00372         kCancel,                // 1
00373         kTabGeneral             // 2
00374     };
00375
00376     virtual void DoDataExchange(bool fill);
00377
00378 protected:
00379     ev_msg int OnOK(void);
00380     ev_msg int OnCancel(void);
00381
00382     UDECLARE_MESSAGE_MAP()
00383 };
00384
00385 UIMPLEMENT_DYNAMIC(UCvsLog, UWidget)
00386
00387 UBEGIN_MESSAGE_MAP(UCvsLog, UWidget)
00388     ON_UCOMMAND(UCvsLog::kOK, UCvsLog::OnOK)
00389     ON_UCOMMAND(UCvsLog::kCancel, UCvsLog::OnCancel)
00390 UEND_MESSAGE_MAP()
00391
00392 int UCvsLog::OnOK(void)
00393 {
00394     EndModal(true);
00395     return 0;
00396 }
00397
00398 int UCvsLog::OnCancel(void)
00399 {
00400     EndModal(false);
00401     return 0;
00402 }
00403
00404 void UCvsLog::DoDataExchange(bool fill)
00405 {
00406     if(fill)
00407     {
00408     }
00409     else
00410     {
00411     }
00412 }
00413
00414 class UCvsLog_MAIN : public UWidget
00415 {
00416     UDECLARE_DYNAMIC(UCvsLog_MAIN)
00417 public:
00418     UCvsLog_MAIN();
00419     virtual ~UCvsLog_MAIN() {}
00420
00421     enum
00422     {
00423         kCheckBranch = EV_COMMAND_START,    // 0
00424         kCheckRecurs,           // 1
00425         kCheckRCS,              // 2
00426         kCheckTags,             // 3
00427         kCheckUsers             // 4
00428     };
00429
00430     virtual void DoDataExchange(bool fill);
00431
00432     bool m_defbranch;
00433     bool m_norecurs;
00434     bool m_notags;
00435     bool m_nousers;
00436     bool m_onlyrcs;
00437
00438 protected:
00439     UDECLARE_MESSAGE_MAP()
00440 };
00441
00442 UIMPLEMENT_DYNAMIC(UCvsLog_MAIN, UWidget)
00443
00444 UBEGIN_MESSAGE_MAP(UCvsLog_MAIN, UWidget)
00445 UEND_MESSAGE_MAP()
00446
00447 UCvsLog_MAIN::UCvsLog_MAIN() : UWidget(::UEventGetWidID())
00448 {
00449     m_defbranch = false;
00450     m_norecurs = false;
00451     m_notags = false;
00452     m_nousers = false;
00453     m_onlyrcs = false;
00454 }
00455
00456 void UCvsLog_MAIN::DoDataExchange(bool fill)
00457 {
00458     if(fill)
00459     {
00460         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckBranch, m_defbranch), 0L);
00461         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurs, m_norecurs), 0L);
00462         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckTags, m_notags), 0L);
00463         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckUsers, m_nousers), 0L);
00464         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRCS, m_onlyrcs), 0L);
00465     }
00466     else
00467     {
00468         m_defbranch = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckBranch, 0L);
00469         m_norecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurs, 0L);
00470         m_notags = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckTags, 0L);
00471         m_nousers = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckUsers, 0L);
00472         m_onlyrcs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRCS, 0L);
00473     }
00474 }
00475
00476 class UCvsLog_FILTERS : public UWidget
00477 {
00478     UDECLARE_DYNAMIC(UCvsLog_FILTERS)
00479 public:
00480     UCvsLog_FILTERS(const char * sLastDate, const char * sLastRev,
00481         const char * sLastUsers, const char * sLastStates);
00482     virtual ~UCvsLog_FILTERS() {}
00483
00484     enum
00485     {
00486         kCheckTag = EV_COMMAND_START,   // 0
00487         kCheckDate,         // 1
00488         kCheckState,        // 2
00489         kCheckUser,         // 3
00490         kComboTag,          // 4
00491         kComboDate,         // 5
00492         kComboState,        // 6
00493         kComboUser          // 7
00494     };
00495
00496     virtual void DoDataExchange(bool fill);
00497
00498     UStr m_date;
00499     UStr m_rev;
00500     UStr m_state;
00501     UStr m_user;
00502     bool m_hasrev;
00503     bool m_hasuser;
00504     bool m_hasdate;
00505     bool m_hasstate;
00506 protected:
00507
00508     ev_msg int OnSelect(int cmd);
00509
00510     UDECLARE_MESSAGE_MAP()
00511 };
00512
00513 UIMPLEMENT_DYNAMIC(UCvsLog_FILTERS, UWidget)
00514
00515 UBEGIN_MESSAGE_MAP(UCvsLog_FILTERS, UWidget)
00516     ON_UCOMMAND_RANGE(UCvsLog_FILTERS::kCheckTag, UCvsLog_FILTERS::kCheckUser, UCvsLog_FILTERS::OnSelect)
00517 UEND_MESSAGE_MAP()
00518
00519 UCvsLog_FILTERS::UCvsLog_FILTERS(const char * sLastDate, const char * sLastRev,
00520         const char * sLastUsers, const char * sLastStates) : UWidget(::UEventGetWidID())
00521 {
00522     m_date = sLastDate;
00523     m_rev = sLastRev;
00524     m_state = sLastStates;
00525     m_user = sLastUsers;
00526     m_hasrev = false;
00527     m_hasuser = false;
00528     m_hasdate = false;
00529     m_hasstate = false;
00530 }
00531
00532 int UCvsLog_FILTERS::OnSelect(int cmd)
00533 {
00534     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, cmd, 0L);
00535     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(cmd + 4, state), 0L);
00536     return 0;
00537 }
00538
00539 void UCvsLog_FILTERS::DoDataExchange(bool fill)
00540 {
00541     ::DoDataExchange(fill, GetWidID(), kComboTag, gLogRevNames);
00542     ::DoDataExchange(fill, GetWidID(), kComboDate, gLogDateNames);
00543     ::DoDataExchange(fill, GetWidID(), kComboUser, gLogUserNames);
00544     ::DoDataExchange(fill, GetWidID(), kComboState, gLogStateNames);
00545
00546     if(fill)
00547     {
00548         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckDate, m_hasdate), 0L);
00549         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckTag, m_hasrev), 0L);
00550         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckState, m_hasstate), 0L);
00551         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckUser, m_hasuser), 0L);
00552
00553         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboDate, (void *)(const char *)m_date);
00554         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboTag, (void *)(const char *)m_rev);
00555         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboState, (void *)(const char *)m_state);
00556         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboUser, (void *)(const char *)m_user);
00557
00558         OnSelect(kCheckDate);
00559         OnSelect(kCheckTag);
00560         OnSelect(kCheckUser);
00561         OnSelect(kCheckState);
00562     }
00563     else
00564     {
00565         m_hasdate = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDate, 0L);
00566         m_hasrev = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckTag, 0L);
00567         m_hasstate = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckState, 0L);
00568         m_hasuser = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckUser, 0L);
00569
00570         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboDate, &m_date);
00571         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboTag, &m_rev);
00572         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboState, &m_state);
00573         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboUser, &m_user);
00574     }
00575 }
00576 #endif // qUnix
00577
00578 bool CompatGetLog(bool & noRecurs, bool & defBranch, CPStr & date,
00579     bool & headerOnly, bool & noTags, bool & onlyRCSfile, bool & hasRev,
00580     CPStr & rev, CPStr & states, bool & hasUsers, CPStr & users,
00581     bool outGraph /*= false*/)
00582 {
00583     bool userHitOK = false;
00584
00585     static CPStr sLastDate;
00586     static CPStr sLastRev;
00587     static CPStr sLastUsers;
00588     static CPStr sLastStates;
00589
00590     bool hasDate = false;
00591     bool hasStates = false;
00592
00593     hasRev = false;
00594     hasUsers = false;
00595     date = "";
00596     rev = "";
00597     states = "";
00598     users = "";
00599     noRecurs = false;
00600     defBranch = false;
00601     headerOnly = false;
00602     noTags = false;
00603     onlyRCSfile = false;
00604
00605 #ifdef WIN32
00606     COptionalPropertySheet pages(outGraph ? gCvsPrefs.HideCommandDlgGraph() : gCvsPrefs.HideCommandDlgLog(),
00607         outGraph ? "Graph settings" : "Log settings");
00608     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00609     CLogMain page1;
00610     CLogFilters page2(sLastDate, sLastRev, sLastUsers, sLastStates);
00611     CGetPrefs_GLOBALS page3;
00612     pages.AddPage(&page1);
00613     pages.AddPage(&page2);
00614     pages.AddPage(&page3);
00615     if(pages.DoModal() == IDOK)
00616     {
00617         noRecurs = page1.m_norecurs == TRUE;
00618         defBranch = page1.m_defbranch == TRUE;
00619         headerOnly = page1.m_nousers == TRUE;
00620         noTags = page1.m_notags == TRUE;
00621         onlyRCSfile = page1.m_onlyrcs == TRUE;
00622
00623         sLastDate = page2.m_date;
00624         sLastRev = page2.m_rev;
00625         sLastUsers = page2.m_user;
00626         sLastStates = page2.m_state;
00627
00628         hasRev = page2.m_hasrev == TRUE;
00629         hasUsers = page2.m_hasuser == TRUE;
00630         hasDate = page2.m_hasdate == TRUE;
00631         hasStates = page2.m_hasstate == TRUE;
00632
00633         page3.StoreValues();
00634         if( outGraph )
00635         {
00636             gCvsPrefs.SetHideCommandDlgGraph(pages.GetHideCommandDlg());
00637         }
00638         else
00639         {
00640             gCvsPrefs.SetHideCommandDlgLog(pages.GetHideCommandDlg());
00641         }
00642         userHitOK = true;
00643     }
00644 #endif /* WIN32 */
00645 #ifdef qMacCvsPP
00646     StDialogHandler theHandler(dlg_Log, LCommander::GetTopCommander());
00647     LWindow *theDialog = theHandler.GetDialog();
00648     ThrowIfNil_(theDialog);
00649     static UInt16 sRuntimePanel = 1;
00650
00651     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00652         (theDialog->FindPaneByID(item_MultiViewPrefs));
00653     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00654
00655     multiView->SwitchToPanel(3);
00656     DoDataExchange_Globals(theDialog, true);
00657     multiView->SwitchToPanel(2);
00658     DoDataExchange_LogFilters(theDialog, hasDate, hasStates, hasRev, hasUsers,
00659         sLastDate, sLastRev, sLastUsers, sLastStates, true);
00660     multiView->SwitchToPanel(1);
00661     DoDataExchange_LogSettings(theDialog, noRecurs, defBranch, headerOnly, noTags, onlyRCSfile, true);
00662
00663     groupView->SetValue(sRuntimePanel);
00664     theDialog->Show();
00665     MessageT hitMessage;
00666     while (true)
00667     {       // Let DialogHandler process events
00668         hitMessage = theHandler.DoDialog();
00669
00670         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00671             break;
00672     }
00673     theDialog->Hide();
00674     sRuntimePanel = groupView->GetValue();
00675
00676     if(hitMessage == msg_OK)
00677     {
00678         multiView->SwitchToPanel(1);
00679         DoDataExchange_LogSettings(theDialog, noRecurs, defBranch, headerOnly, noTags, onlyRCSfile, false);
00680         multiView->SwitchToPanel(2);
00681         DoDataExchange_LogFilters(theDialog, hasDate, hasStates, hasRev, hasUsers,
00682         sLastDate, sLastRev, sLastUsers, sLastStates, false);
00683         multiView->SwitchToPanel(3);
00684         DoDataExchange_Globals(theDialog, false);
00685         userHitOK = true;
00686     }
00687 #endif /* qMacCvsPP */
00688 #if qUnix
00689     void *wid = UCreate_LogDlg();
00690
00691     UCvsLog *dlg = new UCvsLog();
00692     UCvsLog_MAIN *tab1 = new UCvsLog_MAIN();
00693     UCvsLog_FILTERS *tab2 = new UCvsLog_FILTERS(sLastDate, sLastRev, sLastUsers, sLastStates);
00694     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00695     dlg->AddPage(tab1, UCvsLog::kTabGeneral, 0);
00696     dlg->AddPage(tab2, UCvsLog::kTabGeneral, 1);
00697
00698     if(dlg->DoModal())
00699     {
00700         noRecurs = tab1->m_norecurs;
00701         defBranch = tab1->m_defbranch;
00702         headerOnly = tab1->m_nousers;
00703         noTags = tab1->m_notags;
00704         onlyRCSfile = tab1->m_onlyrcs;
00705
00706         sLastDate = tab2->m_date;
00707         sLastRev = tab2->m_rev;
00708         sLastUsers = tab2->m_user;
00709         sLastStates = tab2->m_state;
00710
00711         hasRev = tab2->m_hasrev;
00712         hasUsers = tab2->m_hasuser;
00713         hasDate = tab2->m_hasdate;
00714         hasStates = tab2->m_hasstate;
00715
00716         userHitOK = true;
00717     }
00718
00719     delete dlg;
00720 #endif // qUnix
00721
00722     if(userHitOK)
00723     {
00724         if(hasDate && !sLastDate.empty())
00725             date = sLastDate;
00726         if(hasRev)
00727             rev = sLastRev;
00728         if(hasUsers)
00729             users = sLastUsers;
00730         if(hasStates && !sLastStates.empty())
00731             states = sLastStates;
00732
00733         gCvsPrefs.save();
00734     }
00735
00736     return userHitOK;
00737 }
Generated on Sun Feb 24 01:21:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/LogDlg.h Source File

common/LogDlg.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00019  */
00020
00021 /*
00022  * LogDlg.h : the cvs log dialog
00023  */
00024
00025 #if !defined(AFX_LOGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
00026 #define AFX_LOGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif // _MSC_VER >= 1000
00031
00032 #include "CPStr.h"
00033 #include "SmartComboBox.h"
00034
00035 bool CompatGetLog(bool & noRecurs, bool & defBranch, CPStr & date,
00036     bool & headerOnly, bool & noTags, bool & onlyRCSfile, bool & hasRev,
00037     CPStr & rev, CPStr & states, bool & hasUser, CPStr & users,
00038     bool outGraph = false);
00039     // get the log options...
00040
00041 #ifdef WIN32
00042 class CLogMain : public CPropertyPage
00043 {
00044     DECLARE_DYNCREATE(CLogMain)
00045
00046 // Construction
00047 public:
00048     CLogMain();
00049     ~CLogMain();
00050
00051 // Dialog Data
00052     //{{AFX_DATA(CLogMain)
00053     enum { IDD = IDD_LOG_MAIN };
00054     BOOL    m_defbranch;
00055     BOOL    m_norecurs;
00056     BOOL    m_notags;
00057     BOOL    m_nousers;
00058     BOOL    m_onlyrcs;
00059     //}}AFX_DATA
00060
00061
00062 // Overrides
00063     // ClassWizard generate virtual function overrides
00064     //{{AFX_VIRTUAL(CLogMain)
00065     protected:
00066     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00067     //}}AFX_VIRTUAL
00068
00069 // Implementation
00070 protected:
00071     // Generated message map functions
00072     //{{AFX_MSG(CLogMain)
00073         // NOTE: the ClassWizard will add member functions here
00074     //}}AFX_MSG
00075     DECLARE_MESSAGE_MAP()
00076
00077 };
00078
00079 class CLogFilters : public CPropertyPage
00080 {
00081     DECLARE_DYNCREATE(CLogFilters)
00082
00083 // Construction
00084 public:
00085     CLogFilters(const char * sLastDate, const char * sLastRev,
00086         const char * sLastUsers, const char * sLastStates);
00087     CLogFilters();
00088     ~CLogFilters();
00089
00090 // Dialog Data
00091     //{{AFX_DATA(CLogFilters)
00092     enum { IDD = IDD_LOG_FILTERS };
00093     CSmartComboBox  m_userCombo;
00094     CSmartComboBox  m_stateCombo;
00095     CSmartComboBox  m_revCombo;
00096     CSmartComboBox  m_dateCombo;
00097     CString m_date;
00098     CString m_rev;
00099     CString m_state;
00100     CString m_user;
00101     BOOL    m_hasdate;
00102     BOOL    m_hasrev;
00103     BOOL    m_hasstate;
00104     BOOL    m_hasuser;
00105     //}}AFX_DATA
00106
00107
00108 // Overrides
00109     // ClassWizard generate virtual function overrides
00110     //{{AFX_VIRTUAL(CLogFilters)
00111     protected:
00112     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00113     //}}AFX_VIRTUAL
00114
00115 // Implementation
00116 protected:
00117     // Generated message map functions
00118     //{{AFX_MSG(CLogFilters)
00119     afx_msg void OnDate();
00120     afx_msg void OnRev();
00121     afx_msg void OnState();
00122     afx_msg void OnUser();
00123     //}}AFX_MSG
00124     DECLARE_MESSAGE_MAP()
00125
00126 };
00127 //{{AFX_INSERT_LOCATION}}
00128 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00129 #endif /* WIN32 */
00130
00131 #endif // !defined(AFX_LOGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/LogParse.cpp Source File

common/LogParse.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00019  */
00020
00021 /*
00022  * LogParse.cpp : parse the cvs log output
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #include <errno.h>
00028 #include <stdio.h>
00029
00030 #ifdef HAVE_UNISTD_H
00031 #include <unistd.h>
00032 #endif
00033
00034 #ifdef WIN32
00035 #   include "wincvs.h"
00036 #   include "GraphDoc.h"
00037 #endif /* WIN32 */
00038
00039 #ifdef macintosh
00040 #   include <unistd.h>
00041 #   include "MacCvsApp.h"
00042 #   include "CTreeView.h"
00043 #endif /* macintosh */
00044
00045 #if qUnix
00046 #   include "UCvsDialogs.h"
00047 #   include "UCvsGraph.h"
00048 #endif
00049
00050 #include "LogParse.h"
00051 #include "CvsArgs.h"
00052 #include "CvsLog.h"
00053 #include "AppGlue.h"
00054 #include "AppConsole.h"
00055 #include "CPStr.h"
00056 #include "getline.h"
00057
00058 #ifdef WIN32
00059 #   ifdef _DEBUG
00060 #   define new DEBUG_NEW
00061 #   undef THIS_FILE
00062     static char THIS_FILE[] = __FILE__;
00063 #   endif
00064 #endif /* WIN32 */
00065
00066 static void print(CColorConsole & out, const CRevFile & rev)
00067 {
00068     out << kBlue << "----------------------------" << kNormal << kNL;
00069     out << "Revision : " << kBold << kRed << rev.RevNum().c_str() << kNormal << kNL;
00070     if(!rev.Locker().empty())
00071         out << "Locked by : '" << kBold << rev.Locker() << kNormal << '\'' << kNL;
00072     out << "Date : " << kBold <<
00073         (rev.RevTime().tm_year + 1900) << '/' <<
00074         rev.RevTime().tm_mon << '/' <<
00075         rev.RevTime().tm_mday << ' ' <<
00076         rev.RevTime().tm_hour << ':' <<
00077         rev.RevTime().tm_min << ':' <<
00078         rev.RevTime().tm_sec << kNormal << kNL;
00079     out << "Author : '" << kBold << rev.Author() << kNormal << '\'' << kNL;
00080     out << "State : '" << kBold << rev.State() << kNormal << '\'' << kNL;
00081     out << "Lines : +" << kBold << rev.ChgPos() << ' ' << rev.ChgNeg() << kNormal << kNL;
00082
00083     if(!rev.BranchesList().empty())
00084     {
00085         out << "Branches :" << kNL;
00086         std::vector<CRevNumber>::const_iterator s;
00087         for(s = rev.BranchesList().begin(); s != rev.BranchesList().end(); ++s)
00088         {
00089             const CRevNumber & branch = *s;
00090             out << '\t' << kBold << branch.c_str() << kNormal << kNL;
00091         }
00092     }
00093
00094     out << "Description :" << kNL << kBrown << rev.DescLog() << kNormal << kNL;
00095 }
00096
00097 static void print(CColorConsole & out, const CRcsFile & rcs, bool recurse = true)
00098 {
00099     out << "Rcs file : '" << kRed << rcs.RcsFile() << kNormal << '\'' << kNL;
00100     out << "Working file : '" << kBold << rcs.WorkingFile() << kNormal << '\'' << kNL;
00101     out << "Head revision : " << kBold << kRed << rcs.HeadRev().c_str() << kNormal << kNL;
00102     out << "Branch revision : " << kBold << rcs.BranchRev().c_str() << kNormal << kNL;
00103
00104     out << "Locks :" << kBold << (rcs.LockStrict() ? " strict" : "") << kNormal << kNL;
00105     std::vector<CRevNumber>::const_iterator s;
00106     for(s = rcs.LocksList().begin(); s != rcs.LocksList().end(); ++s)
00107     {
00108         const CRevNumber & lock = *s;
00109         out << '\t' << kBold << lock.c_str() << " : '" << lock.Tag() << '\'' << kNormal << kNL;
00110     }
00111
00112     out << "Access :" << kNL;
00113     std::vector<CLogStr>::const_iterator a;
00114     for(a = rcs.AccessList().begin(); a != rcs.AccessList().end(); ++a)
00115     {
00116         out << "\t'" << kBold << *a << kNormal << '\'' << kNL;
00117     }
00118
00119     if(!rcs.SymbolicList().empty())
00120     {
00121         out << "Symbolic names :" << kNL;
00122         std::vector<CRevNumber>::const_iterator n;
00123         for(n = rcs.SymbolicList().begin(); n != rcs.SymbolicList().end(); ++n)
00124         {
00125             const CRevNumber & symb = *n;
00126             out << '\t' << kBold << symb.c_str() << " : '" << symb.Tag() << '\'' << kNormal << kNL;
00127         }
00128     }
00129
00130     out << "Keyword substitution : '" << kBold << rcs.KeywordSubst() << kNormal << '\'' << kNL;
00131     out << "Total revisions : " << kBold << rcs.TotRevisions() << kNormal << kNL;
00132     out << "Selected revisions : " << kBold << rcs.SelRevisions() << kNormal << kNL;
00133     out << "Description :" << kNL << kBrown << rcs.DescLog() << kNormal << kNL;
00134
00135     std::vector<CRevFile>::const_iterator i;
00136     if(recurse) for(i = rcs.AllRevs().begin(); i != rcs.AllRevs().end(); ++i)
00137     {
00138         print(out, *i);
00139     }
00140
00141     out << kGreen << "===============================================" << kNormal << kNL;
00142 }
00143
00144 static void print(CColorConsole & out, const CLogNode * node, CStr & offset)
00145 {
00146     out << offset;
00147     switch(node->GetType())
00148     {
00149         case kNodeHeader :
00150         {
00151             CLogNodeHeader *header = (CLogNodeHeader *)node;
00152             out << offset << "Rcs file : '" << kRed << (**header).RcsFile() << kNormal << '\'' << kNL;
00153             break;
00154         }
00155         case kNodeBranch :
00156             break;
00157         case kNodeRev :
00158         {
00159             CLogNodeRev *rev = (CLogNodeRev *)node;
00160             out << offset << kBold << (**rev).RevNum().c_str() << kNormal << kNL;
00161             break;
00162         }
00163         case kNodeTag :
00164             break;
00165     }
00166
00167     CStr newOffset;
00168     newOffset = offset;
00169     newOffset << "    ";
00170     std::vector<CLogNode *>::const_iterator i;
00171     for(i = node->Childs().begin(); i != node->Childs().end(); ++i)
00172     {
00173         print(out, *i, newOffset);
00174         newOffset << ' ';
00175     }
00176
00177     if(node->Next() != 0L)
00178     {
00179         print(out, node->Next(), offset);
00180     }
00181 }
00182
00183 void CvsLogOutput(CColorConsole & out, CLogNode *node)
00184 {
00185     switch(node->GetType())
00186     {
00187         case kNodeHeader :
00188         {
00189             CRcsFile & rcs = **(CLogNodeHeader *)node;
00190             print(out, rcs, false);
00191             break;
00192         }
00193         case kNodeBranch :
00194             break;
00195         case kNodeRev :
00196         {
00197             CRevFile & rev = **(CLogNodeRev *)node;
00198             print(out, rev);
00199             break;
00200         }
00201         case kNodeTag :
00202             break;
00203     }
00204 }
00205
00206 void CvsLogParse(const char *dir, const CvsArgs & args, bool outGraph, void *defWnd)
00207 {
00208     // make a stream of the cvs log output
00209     CStr tmpFile;
00210     FILE *output;
00211     output = launchCVS(dir, args, tmpFile);
00212     if(output == 0L)
00213         return;
00214
00215     // parse
00216     std::vector<CRcsFile> & allRcs = CvsLogParse(output);
00217
00218     // maybe something went wrong or may be the user
00219     // asked to print only the RCS names, so print the
00220     // output directly whithout parsing../
00221     if(allRcs.empty())
00222     {
00223         char *line = 0L;
00224         size_t line_chars_allocated = 0;
00225         int line_length;
00226         fseek(output, SEEK_SET, 0);
00227         while ((line_length = getline (&line, &line_chars_allocated, output)) > 0)
00228         {
00229             cvs_outstr(line, line_length);
00230             cvs_outstr("\n", 1);
00231         }
00232
00233         if (line_length < 0 && !feof (output))
00234             cvs_err("Cannot read output file (error %d)\n", errno);
00235
00236         if(line != 0L)
00237             free (line);
00238     }
00239
00240     // close the temp file
00241     fclose(output);
00242     if(unlink(tmpFile) != 0)
00243     {
00244         cvs_err("Impossible to delete the file '%s' (error %d)",
00245             (const char *)tmpFile, errno);
00246     }
00247
00248     if(allRcs.empty())
00249         return;
00250
00251     // output the result
00252     CColorConsole out;
00253     std::vector<CRcsFile>::iterator i;
00254     for(i = allRcs.begin(); i != allRcs.end(); ++i)
00255     {
00256         CRcsFile & rcs = *i;
00257         if(!outGraph)
00258             print(out, rcs);
00259         else
00260         {
00261             CLogNode *node = CvsLogGraph(rcs);
00262             if(node == 0L)
00263             {
00264                 cvs_err("Impossible to create a graph for %s\n",
00265                     (const char *)rcs.WorkingFile());
00266             }
00267
00268 #ifdef WIN32
00269             CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00270             CGraphDoc *doc;
00271             if(defWnd != 0L)
00272                 doc = (CGraphDoc *)defWnd;
00273             else
00274                 doc = (CGraphDoc*)app->gLogGraph->OpenDocumentFile(NULL);
00275             doc->SetNode(node, dir);
00276 #elif qMacCvsPP
00277             if(defWnd != 0L)
00278                 ((CTreeView *)defWnd)->SetNode(node, dir);
00279             else
00280                 CMacCvsApp::gApp->NewLogTree(node, dir);
00281 #elif qUnix
00282             UCvsGraph * graph = new UCvsGraph(node, dir);
00283             void *win = UCreate_GraphWindow();
00284             UEventSendMessage(graph->GetWidID(), EV_INIT_WIDGET, kUMainWidget, win);
00285             UEventSendMessage(graph->GetWidID(), EV_SHOW_WIDGET, UMAKEINT(kUMainWidget, 1), 0L);
00286 #else
00287             CStr offset;
00288             print(out, node, offset);
00289             delete node;
00290 #endif
00291         }
00292     }
00293
00294     // reset the parser
00295     CvsLogReset();
00296 }
Generated on Sun Feb 24 01:21:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/LogParse.h Source File

common/LogParse.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00019  */
00020
00021 /*
00022  * LogParse.h : parse the cvs log output
00023  */
00024
00025 #if !defined(AFX_LOGPARSE_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
00026 #define AFX_LOGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_
00027
00028 #if _MSC_VER >= 1000
00029 #   pragma once
00030 #endif // _MSC_VER >= 1000
00031
00032 class CvsArgs;
00033 class CLogNode;
00034 class CColorConsole;
00035
00036 void CvsLogParse(const char *dir, const CvsArgs & args, bool outGraph = false,
00037         void *defWnd = 0L);
00038     // launch a cvs log command, parse the output, output a graph
00039     // or a syntax colored of the cvs log output
00040
00041 void CvsLogOutput(CColorConsole & out, CLogNode *node);
00042     // print a syntax colored of the cvs log node
00043
00044 #endif // !defined(AFX_LOGPARSE_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/MacBinEncoding.cpp Source File

common/MacBinEncoding.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 1998
00019  */
00020
00021 /*
00022  * MacBinEncoding.cpp --- class to store the mac binary encoding mappings
00023  */
00024
00025 /* here should be a define, to recorgnize if this file is needed in dev-tools */
00026 #ifdef macintosh
00027
00028 #include <stdlib.h>
00029
00030 #include <UModalDialogs.h>
00031 #include <LTableMultiGeometry.h>
00032 #include <LOutlineKeySelector.h>
00033 #include <LTableSingleSelector.h>
00034 #include <LOutlineRowSelector.h>
00035 #include <UAttachments.h>
00036 #include <UGAColorRamp.h>
00037 #include <LEditText.h>
00038
00039 #include "MacCvsConstant.h"
00040 #include "MacBinEncoding.h"
00041
00042 MacBinMaps *CMacBinTable::gCurMacBinMap = 0L;
00043
00044 CMacBinTable::CMacBinTable(LStream *inStream) : LOutlineTable(inStream)
00045 {
00046     // set the table geometry
00047     LTableMultiGeometry *geom = NEW LTableMultiGeometry(this, 50, 20);
00048     ThrowIfNil_(geom);
00049     SetTableGeometry(geom);
00050
00051     // set the table selector
00052     SetTableSelector(NEW LTableSingleSelector( this )/*LOutlineRowSelector*/ );
00053
00054     // and note that we don't set the table storage....
00055
00056     // most of the table classes not only maintain the graphical
00057     // representation of your data but also the data itself. But
00058     // LOutlineTable doesn't really do this...it mostly handles
00059     // graphical representation... you need to handle your data
00060     // maintenance elsewhere by yourself.
00061
00062     // insert a couple columns (name and size)
00063     InsertCols( 3, 0, nil, nil, false );
00064     geom->SetColWidth(60, 1, 1);
00065     geom->SetColWidth(237, 2, 2);
00066     geom->SetColWidth(120, 3, 3);
00067
00068     // Set up keyboard selection and scrolling.
00069     AddAttachment(NEW LOutlineKeySelector(this, msg_AnyMessage));
00070     AddAttachment(NEW LKeyScrollAttachment(this));
00071
00072     // Try to become default commander in the window.
00073     if (mSuperCommander != nil)
00074         mSuperCommander->SetLatentSub(this);
00075 }
00076
00077 CMacBinTable::~CMacBinTable()
00078 {
00079 }
00080
00081 void CMacBinTable::FinishCreateSelf()
00082 {
00083     // insert the root level of the disk into the table
00084     CMacBinItem *theItem = nil;
00085     CMacBinItem *lastItem = nil;
00086
00087     const MACBINMAPENTRIES * entries = gCurMacBinMap->Entries();
00088
00089     if(entries != 0L) for(int i = 0; i < entries->numMaps; i++)
00090     {
00091         // Store this information in the list view
00092         theItem = NEW CMacBinItem(entries->maps[i]);
00093         ThrowIfNil_(theItem);
00094
00095         // and insert it at the end of the table
00096         InsertItem( theItem, nil, lastItem );
00097         lastItem = theItem;
00098     }
00099 }
00100
00101 CMacBinItem::CMacBinItem(const MACBINMAP & map) :fMap(map)
00102 {
00103 }
00104
00105 CMacBinItem::~CMacBinItem()
00106 {
00107 }
00108
00109 // this is the routine called to know what to draw within the
00110 // table cell. See the comments in LOutlineItem.cp for more info.
00111 void
00112 CMacBinItem::GetDrawContentsSelf(
00113     const STableCell&       inCell,
00114     SOutlineDrawContents&   ioDrawContents)
00115 {
00116     CPStr desc;
00117
00118     switch (inCell.col)
00119     {
00120     case 1:
00121         ioDrawContents.outShowSelection = true;
00122         ioDrawContents.outHasIcon = false;
00123         //ioDrawContents.outIconSuite = ;
00124         ioDrawContents.outTextTraits.style = bold;
00125
00126         unsigned char *ptr = ioDrawContents.outTextString;
00127         *ptr++ = 4;
00128         *ptr++ = ((unsigned char *)&fMap.sig)[0];
00129         *ptr++ = ((unsigned char *)&fMap.sig)[1];
00130         *ptr++ = ((unsigned char *)&fMap.sig)[2];
00131         *ptr++ = ((unsigned char *)&fMap.sig)[3];
00132         break;
00133
00134     case 2:
00135         ioDrawContents.outShowSelection = true;
00136         ioDrawContents.outTextTraits.style = 0;
00137         c2pstrcpy(ioDrawContents.outTextString, fMap.desc);
00138         break;
00139     case 3:
00140         ioDrawContents.outShowSelection = true;
00141         ioDrawContents.outTextTraits.style = 0;
00142         if(fMap.plainBin)
00143         {
00144             ioDrawContents.outTextTraits.style = bold;
00145             LString::CopyPStr("\pPlain binary", ioDrawContents.outTextString);
00146         }
00147         else if(fMap.useDefault)
00148         {
00149             LString::CopyPStr("\pDefault encoding", ioDrawContents.outTextString);
00150         }
00151         else if(fMap.encod == MAC_HQX)
00152         {
00153             ioDrawContents.outTextTraits.style = bold;
00154             LString::CopyPStr("\pHQX encoding", ioDrawContents.outTextString);
00155         }
00156         else
00157         {
00158             ioDrawContents.outTextTraits.style = bold;
00159             LString::CopyPStr("\pAppleSingle encoding", ioDrawContents.outTextString);
00160         }
00161         break;
00162     }
00163 }
00164
00165 // just to be cute, we'll draw an adornment (again, see the LOutlineItem.cp
00166 // comments for more information). We'll draw a groovy gray background
00167 void CMacBinItem::DrawRowAdornments(const Rect & inLocalRowRect)
00168 {
00169     ShadeRow(UGAColorRamp::GetColor(0), inLocalRowRect);
00170 }
00171
00172 bool CMacBinItem::EditCell(void)
00173 {
00174     StDialogHandler theHandler(dlg_MacBinEntry, LCommander::GetTopCommander());
00175     LWindow *theDialog = theHandler.GetDialog();
00176     ThrowIfNil_(theDialog);
00177
00178     LEditText *typ = dynamic_cast<LEditText*>
00179         (theDialog->FindPaneByID(item_MacBinType));
00180     LEditText *desc = dynamic_cast<LEditText*>
00181         (theDialog->FindPaneByID(item_MacBinDesc));
00182
00183     typ->SetText((Ptr)&fMap.sig, 4);
00184     desc->SetText((Ptr)fMap.desc, strlen(fMap.desc));
00185
00186     OSType oldsig = fMap.sig;
00187
00188     if(fMap.plainBin)
00189         theDialog->SetValueForPaneID (item_MacBinPlain, Button_On);
00190     else if(fMap.useDefault)
00191         theDialog->SetValueForPaneID (item_MacBinDefault, Button_On);
00192     else if(fMap.encod == MAC_HQX)
00193         theDialog->SetValueForPaneID (item_MacBinHQX, Button_On);
00194     else
00195         theDialog->SetValueForPaneID (item_MacBinAS, Button_On);
00196
00197     theDialog->Show();
00198     MessageT hitMessage;
00199     while (true)
00200     {       // Let DialogHandler process events
00201         hitMessage = theHandler.DoDialog();
00202
00203         if (hitMessage == msg_OK)
00204         {
00205             char buf[255];
00206             Size len;
00207             typ->GetText(buf, 254, &len);
00208             if(len != 4 || ((OSType *)buf)[0] == '????' || buf[0] == ';' || buf[1] == ';' ||
00209                 buf[2] == ';' || buf[3] == ';')
00210             {
00211                 SysBeep(10);
00212                 continue;
00213             }
00214
00215         }
00216
00217         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00218             break;
00219     }
00220     theDialog->Hide();
00221
00222     if(hitMessage == msg_OK)
00223     {
00224         char buf[255];
00225         Size len;
00226
00227         typ->GetText(buf, 254, &len);
00228         if(len == 4)
00229         {
00230             ((char *)&fMap.sig)[0] = buf[0];
00231             ((char *)&fMap.sig)[1] = buf[1];
00232             ((char *)&fMap.sig)[2] = buf[2];
00233             ((char *)&fMap.sig)[3] = buf[3];
00234         }
00235         desc->GetText(buf, 254, &len);
00236         buf[len] = '\0';
00237         strncpy(fMap.desc, buf, MAX_MACBIN_DESC);
00238
00239         fMap.useDefault = true;
00240         fMap.plainBin = false;
00241
00242         if(theDialog->GetValueForPaneID (item_MacBinPlain) == Button_On)
00243         {
00244             fMap.plainBin = true;
00245         }
00246         else if(theDialog->GetValueForPaneID (item_MacBinDefault) == Button_On)
00247         {
00248         }
00249         else if(theDialog->GetValueForPaneID (item_MacBinHQX) == Button_On)
00250         {
00251             fMap.useDefault = false;
00252             fMap.encod = MAC_HQX;
00253         }
00254         else
00255         {
00256             fMap.useDefault = false;
00257             fMap.encod = MAC_APPSINGLE;
00258         }
00259
00260         CMacBinTable *list = dynamic_cast<CMacBinTable*>(mOutlineTable);
00261         if(list != 0L)
00262         {
00263             list->GetCurrentMap()->RemoveEntry(oldsig);
00264             list->GetCurrentMap()->AddEntry(fMap.sig, fMap.desc, fMap.encod, fMap.plainBin, fMap.useDefault);
00265         }
00266         return true;
00267     }
00268     return false;
00269 }
00270
00271 void CMacBinItem::RemoveCell(void)
00272 {
00273     CMacBinTable *list = dynamic_cast<CMacBinTable*>(mOutlineTable);
00274     if(list != 0L)
00275     {
00276         list->GetCurrentMap()->RemoveEntry(fMap.sig);
00277     }
00278 }
00279
00280 void CMacBinItem::DoubleClick(
00281     const STableCell&           /* inCell */,
00282     const SMouseDownEvent&      /* inMouseDown */,
00283     const SOutlineDrawContents& /* inDrawContents */,
00284     Boolean                     /* inHitText */)
00285 {
00286     EditCell();
00287 }
00288
00289 #endif /* macintosh */
Generated on Sun Feb 24 01:21:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/MacBinEncoding.h Source File

common/MacBinEncoding.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 1998
00019  */
00020
00021 /*
00022  * MacBinEncoding.h --- class to store the mac binary encoding mappings
00023  */
00024
00025 #ifndef MACBINENCODING_H
00026 #define MACBINENCODING_H
00027
00028 #include <LOutlineTable.h>
00029 #include <LCommander.h>
00030 #include <LOutlineItem.h>
00031 #include <LString.h>
00032
00033 #include "MacBinMaps.h"
00034
00035 class CMacBinTable : public LOutlineTable, public LCommander
00036 {
00037 public:
00038     enum { class_ID = 'MBTA' };
00039
00040     CMacBinTable( LStream *inStream );
00041     virtual ~CMacBinTable();
00042
00043     static void SetCurrentMap(MacBinMaps *map) {gCurMacBinMap = map;}
00044     static MacBinMaps * GetCurrentMap(void) {return gCurMacBinMap;}
00045 protected:
00046     static MacBinMaps *gCurMacBinMap;
00047
00048     virtual void FinishCreateSelf();
00049
00050 private:
00051     // defensive programming
00052     CMacBinTable();
00053     CMacBinTable( const CMacBinTable &inOriginal );
00054     CMacBinTable&       operator=( const CMacBinTable &inOriginal );
00055 };
00056
00057 class CMacBinItem : public LOutlineItem
00058 {
00059 public:
00060     CMacBinItem(const MACBINMAP & map);
00061     virtual ~CMacBinItem();
00062
00063     virtual bool EditCell(void);
00064         // return false if user canceled
00065     virtual void RemoveCell(void);
00066
00067 protected:
00068     virtual void GetDrawContentsSelf(const STableCell& inCell, SOutlineDrawContents& ioDrawContents);
00069     virtual void DrawRowAdornments(const Rect& inLocalRowRect);
00070     virtual void DoubleClick(const STableCell& inCell, const SMouseDownEvent& inMouseDown,
00071         const SOutlineDrawContents& inDrawContents, Boolean inHitText);
00072
00073     MACBINMAP fMap;
00074 private:
00075     // defensive programming
00076     CMacBinItem();
00077     CMacBinItem( const CMacBinItem &inOriginal );
00078     CMacBinItem&    operator=( const CMacBinItem &inOriginal );
00079 };
00080
00081 #endif /* MACBINENCODING_H */
Generated on Sun Feb 24 01:21:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/MacBinMaps.cpp Source File

common/MacBinMaps.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 1998
00019  */
00020
00021 /*
00022  * MacBinMaps.cpp --- class to store the mac binary encoding mappings
00023  */
00024
00025 /* here should be a define, to recorgnize if this file is needed in dev-tools */
00026 #ifdef macintosh
00027
00028 #include <stdlib.h>
00029 #include <Resources.h>
00030 #include <TextUtils.h>
00031
00032 #include "MacBinMaps.h"
00033 #include "Persistent.h"
00034
00035 static const    OSType      kTypesListResType   = 'bin#';
00036 static const    short       kTypesListResID     = 128;
00037 static const    short       kTypesDescResID     = 128;
00038
00039 class PMacBinMaps : public MacBinMaps, public CPersistent
00040 {
00041 public:
00042     PMacBinMaps(const char *uniqueName) : CPersistent(uniqueName, kNoClass)
00043     {
00044         if(entries != 0L)
00045         {
00046             free(entries);
00047             entries = 0L;
00048         }
00049     }
00050
00051     virtual ~PMacBinMaps()
00052     {
00053     }
00054
00055     virtual unsigned int SizeOf(void) const
00056     {
00057         if(entries == 0L)
00058             return 0;
00059         return sizeof(MACBINMAPENTRIES) + (entries->numMaps - 1) * sizeof(MACBINMAP);
00060     }
00061
00062     virtual const void *GetData(void) const
00063     {
00064         return entries;
00065     }
00066     virtual void SetData(const void *ptr, unsigned int size)
00067     {
00068         if(entries != 0L)
00069         {
00070             free(entries);
00071             entries = 0L;
00072         }
00073
00074         if(size < sizeof(int))
00075             return;
00076         MACBINMAPENTRIES *newEntries = (MACBINMAPENTRIES *)ptr;
00077         if((sizeof(MACBINMAPENTRIES) + (newEntries->numMaps - 1) * sizeof(MACBINMAP)) != size)
00078             return;
00079
00080         entries = (MACBINMAPENTRIES *)malloc(size);
00081         if(entries == 0L)
00082             return;
00083
00084         memcpy(entries, ptr, size);
00085     }
00086 } gAllBinMaps("P_MacBinMaps");
00087
00088 MacBinMaps::MacBinMaps()
00089 {
00090     Reset();
00091 }
00092
00093 MacBinMaps::~MacBinMaps()
00094 {
00095     if(entries != 0L)
00096         free(entries);
00097 }
00098
00099 void MacBinMaps::Reset(void)
00100 {
00101     entries = (MACBINMAPENTRIES *)malloc(sizeof(int));
00102     if(entries == 0L)
00103         return;
00104     entries->numMaps = 0;
00105 }
00106
00107 const char *MacBinMaps::GetEnvPlainTypes(void)
00108 {
00109     static CStr result;
00110     result = "";
00111     const MACBINMAPENTRIES * allEntries = gAllBinMaps.Entries();
00112     if(allEntries == 0L)
00113         return 0L;
00114
00115     int i;
00116     for(i = 0; i < allEntries->numMaps; i++)
00117     {
00118         const MACBINMAP & curmap = allEntries->maps[i];
00119         if(curmap.plainBin)
00120         {
00121             result << ((char *)&curmap.sig)[0];
00122             result << ((char *)&curmap.sig)[1];
00123             result << ((char *)&curmap.sig)[2];
00124             result << ((char *)&curmap.sig)[3];
00125             result << ';';
00126         }
00127     }
00128     return result;
00129 }
00130
00131 const char *MacBinMaps::GetEnvTypes(MACENCODING type)
00132 {
00133     static CStr result;
00134     result = "";
00135     const MACBINMAPENTRIES * allEntries = gAllBinMaps.Entries();
00136     if(allEntries == 0L)
00137         return 0L;
00138
00139     int i;
00140     for(i = 0; i < allEntries->numMaps; i++)
00141     {
00142         const MACBINMAP & curmap = allEntries->maps[i];
00143         if(!curmap.plainBin && !curmap.useDefault && curmap.encod == type)
00144         {
00145             result << ((char *)&curmap.sig)[0];
00146             result << ((char *)&curmap.sig)[1];
00147             result << ((char *)&curmap.sig)[2];
00148             result << ((char *)&curmap.sig)[3];
00149             result << ';';
00150         }
00151     }
00152     return result;
00153 }
00154
00155 void MacBinMaps::LoadDefaults(void)
00156 {
00157     if(gAllBinMaps.SizeOf() == 0L)
00158     {
00159         short index = 1;
00160
00161         // take defaults from the '#bin' resource
00162         Handle  typesHandle = Get1Resource (kTypesListResType, kTypesListResID);
00163         if (typesHandle == nil)
00164             return;
00165
00166         HLock(typesHandle);
00167         Ptr typesPtr = *typesHandle;
00168
00169         short       typesCount = *(short*)typesPtr;
00170         typesPtr += (2 * sizeof(short)) / sizeof(char); // count + align
00171         OSType*     walker = (OSType *)typesPtr;
00172
00173         while (typesCount-- > 0)
00174         {
00175             Str255 theString;
00176             char theCString[256];
00177             theString[0] = '\0';
00178             GetIndString(theString, kTypesDescResID, index++);
00179             p2cstrcpy(theCString, theString);
00180
00181             AddEntry(*walker++, theCString[0] != '\0' ? theCString : "Default type",
00182                 MAC_HQX, true, true);
00183         }
00184         HUnlock(typesHandle);
00185     }
00186     else
00187     {
00188         *this = gAllBinMaps;
00189     }
00190 }
00191
00192 void MacBinMaps::SaveDefaults(void)
00193 {
00194     *(MacBinMaps *)&gAllBinMaps = *this;
00195 }
00196
00197 const MACBINMAP *MacBinMaps::AddEntry(OSType sig, const char *desc, MACENCODING encod, bool plainBin, bool useDefault)
00198 {
00199     if(entries == 0L)
00200         return 0L;
00201
00202     int i;
00203     for(i = 0; i < entries->numMaps; i++)
00204     {
00205         if(entries->maps[i].sig == sig)
00206             break;
00207     }
00208
00209     if(i != entries->numMaps)
00210     {
00211         MACBINMAP & curmap = entries->maps[i];
00212         curmap.sig = sig;
00213         curmap.desc[0] = '\0';
00214         if(desc != 0L)
00215             strncpy(curmap.desc, desc, MAX_MACBIN_DESC);
00216         curmap.encod = encod;
00217         curmap.plainBin = plainBin;
00218         curmap.useDefault = useDefault;
00219         return &curmap;
00220     }
00221
00222     entries = (MACBINMAPENTRIES *)realloc(entries, sizeof(MACBINMAPENTRIES) + entries->numMaps * sizeof(MACBINMAP));
00223     if(entries == 0L)
00224         return 0L;
00225
00226     MACBINMAP & newmap = entries->maps[entries->numMaps++];
00227     newmap.sig = sig;
00228     newmap.desc[0] = '\0';
00229     if(desc != 0L)
00230         strncpy(newmap.desc, desc, MAX_MACBIN_DESC);
00231     newmap.encod = encod;
00232     newmap.plainBin = plainBin;
00233     newmap.useDefault = useDefault;
00234     return &newmap;
00235 }
00236
00237 void MacBinMaps::RemoveEntry(OSType sig)
00238 {
00239     if(entries == 0L)
00240         return;
00241
00242     int i;
00243     for(i = 0; i < entries->numMaps; i++)
00244     {
00245         if(entries->maps[i].sig == sig)
00246             break;
00247     }
00248
00249     if(i == entries->numMaps)
00250         return;
00251
00252     memmove(&entries->maps[i], &entries->maps[i + 1],
00253         (entries->numMaps - i - 1) * sizeof(MACBINMAP));
00254     entries->numMaps--;
00255     entries = (MACBINMAPENTRIES *)realloc(entries, sizeof(MACBINMAPENTRIES) + (entries->numMaps - 1) * sizeof(MACBINMAP));
00256 }
00257
00258 MacBinMaps & MacBinMaps::operator=(const MacBinMaps & otherMap)
00259 {
00260     if(entries != 0L)
00261         free(entries);
00262     Reset();
00263     if(entries == 0L)
00264         return *this;
00265
00266     const MACBINMAPENTRIES *theseEntries = otherMap.Entries();
00267     if(theseEntries != 0L) for(int i = 0; i < theseEntries->numMaps; i++)
00268     {
00269         const MACBINMAP & newmap = theseEntries->maps[i];
00270         AddEntry(newmap.sig, newmap.desc, newmap.encod, newmap.plainBin, newmap.useDefault);
00271     }
00272     return *this;
00273 }
00274
00275 #endif /* macintosh */
Generated on Sun Feb 24 01:21:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/MacBinMaps.h Source File

common/MacBinMaps.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 1998
00019  */
00020
00021 /*
00022  * MacBinMaps.h --- class to store the mac binary encoding mappings
00023  */
00024
00025 #ifndef MACBINMAPS_H
00026 #define MACBINMAPS_H
00027
00028 #include "CvsPrefs.h"
00029
00030 typedef struct
00031 {
00032 #   define MAX_MACBIN_DESC 63
00033     OSType sig;
00034     char desc[MAX_MACBIN_DESC + 1];
00035     MACENCODING encod;
00036     bool plainBin;
00037     bool useDefault;
00038 } MACBINMAP;
00039
00040 typedef struct
00041 {
00042     int numMaps;
00043     MACBINMAP maps[1];
00044 } MACBINMAPENTRIES;
00045
00046 class MacBinMaps
00047 {
00048 public:
00049     MacBinMaps();
00050     ~MacBinMaps();
00051
00052     void LoadDefaults(void);
00053         // fill with the persistent defaults
00054
00055     void SaveDefaults(void);
00056         // store as defaults
00057
00058     const MACBINMAP *AddEntry(OSType sig, const char *desc, MACENCODING encod, bool plainBin, bool useDefault);
00059         // an an entry
00060
00061     void RemoveEntry(OSType sig);
00062         // remove an entry
00063
00064     MacBinMaps & operator=(const MacBinMaps & otherMap);
00065         // replace by this map
00066
00067     inline const MACBINMAPENTRIES * Entries(void) const {return entries;}
00068         // return the entries
00069
00070     static const char *GetEnvPlainTypes(void);
00071         // return all the plain binaries types with a semi-colon
00072         // between each ones.
00073
00074     static const char *GetEnvTypes(MACENCODING type);
00075         // return all the plain binaries types with a semi-colon
00076         // between each ones.
00077 protected:
00078     void Reset(void);
00079
00080     MACBINMAPENTRIES *entries;
00081 };
00082
00083 #endif /* MACBINMAPS_H */
Generated on Sun Feb 24 01:21:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/MacMisc.cpp Source File

common/MacMisc.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * MacMisc.cpp --- misc. utilities for mac
00023  */
00024
00025 /* here should be a define, to recorgnize if this file is needed in dev-tools */
00026 #ifdef macintosh
00027
00028 #include "GUSIInternal.h"
00029 #include "GUSIFileSpec.h"
00030 #include "Persistent.h"
00031 #include "AppConsole.h"
00032
00033 #include "MacMisc.h"
00034 #include "VolsPaths.h"
00035
00036 Handle
00037 GetDItemHdl(DialogPtr dlg, SInt16 Id)
00038 {
00039     SInt16  type;
00040     Handle  item;
00041     Rect    box;
00042
00043     GetDialogItem(dlg, Id, &type, &item, &box);
00044     return item;
00045 }
00046
00047 ControlHandle
00048 GetDItemCtrlHdl(DialogPtr dlg, SInt16 Id)
00049 {
00050     SInt16  type;
00051     Handle  item;
00052     Rect    box;
00053
00054     GetDialogItem(dlg, Id, &type, &item, &box);
00055     return (ControlHandle)item;
00056 }
00057
00058 SInt16 GetDItemMenuSel(DialogPtr dlg, SInt16 Id)
00059 {
00060     ControlHandle ctrl = GetDItemCtrlHdl(dlg, Id);
00061     return ctrl != 0L ? GetControlValue(ctrl) : 0;
00062 }
00063
00064 void SetDItemMenuSel(DialogPtr dlg, SInt16 Id, SInt16 sel)
00065 {
00066     ControlHandle ctrl = GetDItemCtrlHdl(dlg, Id);
00067     if(ctrl != 0L)
00068         SetControlValue(ctrl, sel);
00069 }
00070
00071 #if TARGET_RT_MAC_CFM
00072 pascal  OSErr   FSMakeFSSpecCompat(short vRefNum,
00073                                    long dirID,
00074                                    ConstStr255Param fileName,
00075                                    FSSpec & spec)
00076 {
00077     OSErr   result;
00078
00079     /* Let the file system create the FSSpec if it can since it does the job */
00080     /* much more efficiently than I can. */
00081     result = FSMakeFSSpec(vRefNum, dirID, fileName, &spec);
00082     /* Fix a bug in Macintosh PC Exchange's MakeFSSpec code where 0 is */
00083     /* returned in the parID field when making an FSSpec to the volume's */
00084     /* root directory by passing a full pathname in MakeFSSpec's */
00085     /* fileName parameter. */
00086     if ( (result == noErr) && (spec.parID == 0) )
00087         spec.parID = fsRtParID;
00088
00089     return ( result );
00090 }
00091
00092 int stricmp(const char *str1, const char *str2)
00093 {
00094     unsigned char c1, c2;
00095
00096     while(1)
00097     {
00098         c1 = (unsigned char)*str1++;
00099         c2 = (unsigned char)*str2++;
00100         if(c1 == '\0' || c2 == '\0') break;
00101
00102         if((c1 < 'A' || c1 > 'Z') && (c1 < 'a' || c1 > 'z'))
00103         {
00104             if(c1 != c2) break;
00105         }
00106         else if((c2 < 'A' || c2 > 'Z') && (c2 < 'a' || c2 > 'z'))
00107             break;
00108         else
00109         {
00110             c1 &= 0xDF;
00111             c2 &= 0xDF;
00112             if(c1 != c2)
00113                 break;
00114         }
00115     }
00116
00117     return c1 == c2 ? 0 : (c1 < c2 ? -1 : 1);
00118 }
00119
00120 int strnicmp(const char *str1, const char *str2, unsigned long n)
00121 {
00122     unsigned char c1 = 0, c2 = 0;
00123
00124     while(n--)
00125     {
00126         c1 = (unsigned char)*str1++;
00127         c2 = (unsigned char)*str2++;
00128         if(c1 == '\0' || c2 == '\0') break;
00129
00130         if((c1 < 'A' || c1 > 'Z') && (c1 < 'a' || c1 > 'z'))
00131         {
00132             if(c1 != c2) break;
00133         }
00134         else if((c2 < 'A' || c2 > 'Z') && (c2 < 'a' || c2 > 'z'))
00135             break;
00136         else
00137         {
00138             c1 &= 0xDF;
00139             c2 &= 0xDF;
00140             if(c1 != c2)
00141                 break;
00142         }
00143     }
00144
00145     return c1 == c2 ? 0 : (c1 < c2 ? -1 : 1);
00146 }
00147 #endif // TARGET_RT_MAC_CFM
00148
00149 OSErr
00150 MacGetSpecialFolder(UFSSpec & theFolder, UStr & thePath, OSType inType, const char* inDesc)
00151 {
00152     OSErr err;
00153 #if TARGET_RT_MAC_CFM
00154     short foundVRefNum;
00155     long foundDirID;
00156     char theCPath[256];
00157
00158     err = FindFolder(kOnSystemDisk, inType,
00159         kDontCreateFolder, &foundVRefNum, &foundDirID);
00160     if (err != noErr)
00161     {
00162         cvs_err("MacCvs: Unable to find the %s folder (error %d)\n", inDesc, err);
00163         return err;
00164     }
00165
00166     if(PathNameFromDirID(foundDirID, foundVRefNum, theCPath) != noErr)
00167     {
00168         cvs_err("MacCvs: Unable to convert path name\n");
00169         return fnfErr;
00170     }
00171     thePath = theCPath;
00172
00173     err = FSMakeFSSpecCompat(foundVRefNum, foundDirID, "\p", theFolder);
00174 #else
00175     err = ::FSFindFolder(kOnAppropriateDisk, inType,
00176                     kDontCreateFolder, &theFolder);
00177     if (err != noErr)
00178     {
00179         cvs_err("MacCvs: Unable to find the %s folder (error %d)\n", inDesc, err);
00180         return err;
00181     }
00182
00183     GUSIFileSpec spec(theFolder);
00184     thePath = spec.FullPath();
00185 #endif
00186
00187     return err;
00188 }
00189
00190 OSErr
00191 MacGetTempFolder(UFSSpec & theFolder, UStr & thePath)
00192 {
00193     static UFSSpec cacheFile = {0, 0, '\0'};
00194     static UStr cachePath;
00195     if(!cachePath.empty())
00196     {
00197         theFolder = cacheFile;
00198         thePath = cachePath;
00199         return noErr;
00200     }
00201
00202     OSErr err = MacGetSpecialFolder (theFolder, thePath, kTemporaryFolderType, "temporary");
00203     if(err == noErr)
00204     {
00205         cacheFile = theFolder;
00206         cachePath = thePath;
00207     }
00208
00209     return err;
00210 }
00211
00212 OSErr
00213 MacGetPrefsFolder(UFSSpec & theFolder, UStr & thePath)
00214 {
00215     static UFSSpec cacheFile = {0, 0, '\0'};
00216     static UStr cachePath;
00217     if(!cachePath.empty())
00218     {
00219         theFolder = cacheFile;
00220         thePath = cachePath;
00221         return noErr;
00222     }
00223
00224     OSErr err = MacGetSpecialFolder (theFolder, thePath, kPreferencesFolderType, "preferences");
00225     if(err == noErr)
00226     {
00227         cacheFile = theFolder;
00228         cachePath = thePath;
00229     }
00230
00231     return err;
00232 }
00233
00234 #endif /* macintosh */
Generated on Sun Feb 24 01:21:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/MacMisc.h Source File

common/MacMisc.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * MacMisc.cpp --- misc. utilities for mac
00023  */
00024
00025 #ifndef MACMISC_H
00026 #define MACMISC_H
00027
00028 #include "TextBinary.h"
00029 #include "ustr.h"
00030 #include <Dialogs.h>
00031
00032 Handle GetDItemHdl(DialogPtr dlg, SInt16 Id);
00033 ControlHandle GetDItemCtrlHdl(DialogPtr dlg, SInt16 Id);
00034 SInt16 GetDItemMenuSel(DialogPtr dlg, SInt16 Id);
00035 void SetDItemMenuSel(DialogPtr dlg, SInt16 Id, SInt16 sel);
00036
00037 #if TARGET_RT_MAC_CFM
00038     pascal  OSErr   FSMakeFSSpecCompat(short vRefNum,
00039                                        long dirID,
00040                                        ConstStr255Param fileName,
00041                                        FSSpec & spec);
00042
00043     extern "C" int stricmp(const char *str1, const char *str2);
00044     extern "C" int strnicmp(const char *str1, const char *str2, unsigned long size);
00045 #else
00046 #   include <string.h>
00047 #   define stricmp strcasecmp
00048 #   define strnicmp strncasecmp
00049 #endif
00050
00051 OSErr MacGetSpecialFolder(UFSSpec & theFolder, UStr & thePath, OSType inType, const char* inDesc);
00052 OSErr MacGetTempFolder(UFSSpec & theFolder, UStr & thePath);
00053 OSErr MacGetPrefsFolder(UFSSpec & theFolder, UStr & thePath);
00054
00055 #endif /* MACMISC_H */
Generated on Sun Feb 24 01:21:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/MacrosSetup.cpp Source File

common/MacrosSetup.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- August 1998
00019  */
00020
00021 /*
00022  * MacrosSetup.cpp --- hook the macros files
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifndef WIN32
00028 #   include <ctype.h>
00029 #endif /* !WIN32 */
00030
00031 #ifdef HAVE_STRING_H
00032 #   include <string.h>
00033 #endif
00034
00035 #ifdef HAVE_STRINGS_H
00036 #   include <strings.h>
00037 #endif
00038
00039 #ifdef HAVE_ERRNO_H
00040 #   include <errno.h>
00041 #endif
00042
00043 #include "MacrosSetup.h"
00044 #include "AppConsole.h"
00045 #include "FileTraversal.h"
00046 #include "getline.h"
00047 #include "CvsArgs.h"
00048
00049 #ifdef macintosh
00050 #   include "MacMisc.h"
00051 #   include <errno.h>
00052 #endif
00053
00054 #ifdef qMacCvsPP
00055 #   include "MacCvsApp.h"
00056 #endif /* qMacCvsPP */
00057
00058 #include "getopt.h"
00059
00060 #ifdef WIN32
00061 #   include "wincvs.h"
00062 #   ifdef _DEBUG
00063 #   define new DEBUG_NEW
00064 #   undef THIS_FILE
00065     static char THIS_FILE[] = __FILE__;
00066 #   endif
00067 #endif /* WIN32 */
00068
00069 CMacroSet gMacrosAdmin;
00070 CMacroSet gMacrosSel;
00071
00072 static void getLoc(CStr & path, const char *subFolder)
00073 {
00074     path = "";
00075 #ifdef WIN32
00076     CWincvsApp* pApp = (CWincvsApp *)AfxGetApp();
00077     pApp->GetAppPath(path);
00078
00079     CString appPath = path;
00080     // first the macro folder may be ./macro
00081     CString test = appPath;
00082     test.TrimRight('\\');
00083     test += "\\";
00084     test += subFolder;
00085
00086     struct stat sb;
00087     if(stat(test, &sb) != -1 && S_ISDIR(sb.st_mode))
00088     {
00089         path = test;
00090         return;
00091     }
00092
00093     CStr uppath, file;
00094     while(SplitPath(appPath, uppath, file) && !uppath.empty())
00095     {
00096         test = uppath;
00097         test.TrimRight('\\');
00098         test += "\\";
00099         test += subFolder;
00100
00101         if(stat(test, &sb) != -1 && S_ISDIR(sb.st_mode))
00102         {
00103             path = test;
00104             return;
00105         }
00106         appPath = uppath;
00107     }
00108     path = test;
00109 #elif defined(qUnix)
00110     struct stat sb;
00111     path = PACKAGE_DATA_DIR;
00112     if(stat(path, &sb) == -1 || !S_ISDIR(sb.st_mode))
00113     {
00114         path = PACKAGE_SOURCE_DIR;
00115         CStr uppath, folder;
00116         SplitPath(path, uppath, folder);
00117         path = uppath;
00118         if(!path.endsWith(kPathDelimiter))
00119             path << kPathDelimiter;
00120         path << subFolder;
00121     }
00122 #elif qMacCvsPP
00123     UStr appPath = CMacCvsApp::GetAppPath();
00124     if(!appPath.endsWith(kPathDelimiter))
00125         appPath << kPathDelimiter;
00126     UStr test = appPath;
00127     test << subFolder;
00128
00129     struct stat sb;
00130     if(stat(test, &sb) != -1 && S_ISDIR(sb.st_mode))
00131     {
00132         path = test;
00133         return;
00134     }
00135
00136     UStr uppath, file;
00137     while(SplitPath(appPath, uppath, file) && !uppath.empty())
00138     {
00139         test = uppath;
00140         if(!test.endsWith(kPathDelimiter))
00141             test << kPathDelimiter;
00142         test << subFolder;
00143
00144         if(stat(test, &sb) != -1 && S_ISDIR(sb.st_mode))
00145         {
00146             path = test;
00147             return;
00148         }
00149         appPath = uppath;
00150     }
00151     path = test;
00152 #else
00153     if(!path.empty() && !path.endsWith(kPathDelimiter))
00154     {
00155         path << kPathDelimiter;
00156     }
00157     path << subFolder;
00158 #endif
00159 }
00160
00161 void MacrosGetLoc(CStr & path)
00162 {
00163     getLoc(path, MACROS_FOLDER);
00164 }
00165
00166 void PythonLibGetLoc(CStr & path)
00167 {
00168     getLoc(path, PYTHONLIB_FOLDER);
00169 }
00170
00171 static void MacrosFlushAll(void)
00172 {
00173     gMacrosAdmin.Flush();
00174     gMacrosSel.Flush();
00175 }
00176
00177 class MacroTraversal : public TraversalReport
00178 {
00179 public:
00180     virtual kTraversal OnError(const char *err, int errcode)
00181     {
00182         cvs_err(err);
00183         cvs_err("\n");
00184         return kTraversalError;
00185     }
00186
00187     virtual kTraversal OnFile(const char *fullpath,
00188         const char *fullname,
00189         const char *name,
00190         const struct stat & dir, const UFSSpec * macspec);
00191 };
00192
00193 kTraversal MacroTraversal::OnFile(const char *fullpath,
00194     const char *fullname,
00195     const char *name,
00196     const struct stat & dir, const UFSSpec * macspec)
00197 {
00198     if(stricmp(name + strlen(name) - 4, ".tcl"))
00199         return kContinueTraversal;
00200
00201     FILE *fpin = fopen(fullname, "r");
00202     if(fpin == 0L)
00203     {
00204         cvs_err("Impossible to open '%s' (error %d)\n", fullname, errno);
00205         return kContinueTraversal;
00206     }
00207
00208     char *oldline = 0L;
00209     int line_length;
00210     size_t line_chars_allocated = 0;
00211     CvsArgs args(false);
00212     args.add("dummy");
00213
00214     if((line_length = getline (&oldline, &line_chars_allocated, fpin)) > 0 &&
00215         strnicmp(oldline, "#!CVSGUI1.0", strlen("#!CVSGUI1.0")) == 0)
00216     {
00217         char *line = oldline + strlen("#!CVSGUI1.0");
00218
00219         while(*line)
00220         {
00221             int hasQuote = 0;
00222             char *temp;
00223
00224             // Search for the non space char
00225             while(*line && isspace(*line))
00226                 ++line;
00227
00228             // handle the quote
00229             if((*line) == '"')
00230             {
00231                 hasQuote = 1;
00232                 line++;
00233             }
00234             for(temp=line;*line;++line)
00235             {
00236                 if((*line) == '"')
00237                 {
00238                     if(hasQuote)
00239                     {
00240                         hasQuote = 0; /* ok doc */
00241                         break;
00242                     }
00243                 }
00244                 if(isspace(*line) && !hasQuote)
00245                     break;
00246             }
00247             if(hasQuote) /* mismatch quote */
00248                 temp = line;
00249
00250             if(temp != line)
00251             {
00252                 CStr arg;
00253                 arg.set(temp, line - temp);
00254                 args.add(arg);
00255             }
00256         }
00257
00258         static struct option long_options[] =
00259         {
00260             {"admin", no_argument, 0L, 1},
00261             {"selection", no_argument, 0L, 2},
00262             {"name", required_argument, 0L, 3},
00263             {0, 0, 0, 0}
00264         };
00265         bool hasAdmin = false;
00266         bool hasSel = false;
00267         CStr dispname;
00268
00269         optind = 0;
00270         int option_index = 0, c;
00271         while ((c = getopt_long
00272             (args.Argc(), args.Argv(), "+", long_options, &option_index)) != EOF)
00273         {
00274             switch (c)
00275             {
00276             case 1:
00277                 hasAdmin = true;
00278                 break;
00279             case 2:
00280                 hasSel = true;
00281                 break;
00282             case 3:
00283                 dispname = optarg;
00284                 break;
00285             default:
00286                 cvs_err("Warning : unknown option in the file '%s'\n", fullname);
00287                 break;
00288             }
00289         }
00290
00291         if(dispname.empty())
00292         {
00293             dispname = name;
00294         }
00295
00296         if(hasAdmin)
00297         {
00298             gMacrosAdmin.Add(fullname, dispname);
00299         }
00300         else if(hasSel)
00301         {
00302             gMacrosSel.Add(fullname, dispname);
00303         }
00304         else
00305         {
00306             cvs_err("Warning : no option <admin|selection> in the file '%s'\n", fullname);
00307         }
00308     }
00309
00310     free (oldline);
00311
00312     fclose(fpin);
00313
00314     return kContinueTraversal;
00315 }
00316
00317 void MacrosReloadAll(void)
00318 {
00319     MacrosFlushAll();
00320
00321     // get the macro folder
00322     CStr path;
00323     MacrosGetLoc(path);
00324
00325     // traverse the macro folder
00326     MacroTraversal traverse;
00327     FileTraverse(path, traverse);
00328 }
Generated on Sun Feb 24 01:21:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/MacrosSetup.h Source File

common/MacrosSetup.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- August 1998
00019  */
00020
00021 /*
00022  * MacrosSetup.h --- hook the macros files
00023  */
00024
00025 #ifndef MACROSSETUP_H
00026 #define MACROSSETUP_H
00027
00028 #ifdef _MSC_VER
00029     using namespace std;
00030 #endif
00031
00032 #include <vector>
00033 #include "CPStr.h"
00034
00035 #define MACROS_FOLDER "Macros"
00036 #define PYTHONLIB_FOLDER "PythonLib"
00037
00038 // a macro is a file + a display name
00039 class CMacroEntry
00040 {
00041 public:
00042     CMacroEntry() {}
00043     CMacroEntry(const char *fullname, const char *dispname)
00044     {
00045         path = fullname;
00046         name = dispname;
00047     }
00048     CMacroEntry(const CMacroEntry & anentry)
00049     {
00050         *this = anentry;
00051     }
00052
00053     inline CMacroEntry & operator=(const CMacroEntry & anentry)
00054     {
00055         path = anentry.path;
00056         name = anentry.name;
00057         return *this;
00058     }
00059
00060     inline bool operator<(const CMacroEntry & anentry) const
00061     {
00062         return false;
00063     }
00064
00065     inline bool operator==(const CMacroEntry & anentry) const
00066     {
00067         return path.compare(anentry.path) == 0 && name.compare(anentry.name) == 0;
00068     }
00069
00070     CStr path;
00071     CStr name;
00072 };
00073
00074 // a set of macros + a flag to reload menus
00075 class CMacroSet
00076 {
00077 public:
00078     CMacroSet()
00079     {
00080         invalFlag = true;
00081     }
00082
00083     std::vector<CMacroEntry> entries;
00084     bool invalFlag;
00085
00086     void Flush(void)
00087     {
00088         entries.erase(entries.begin(), entries.end());
00089         invalFlag = true;
00090     }
00091
00092     void Add(const char *fullname, const char *name)
00093     {
00094         entries.push_back(CMacroEntry(fullname, name));
00095     }
00096 };
00097
00098 extern CMacroSet gMacrosAdmin;
00099 extern CMacroSet gMacrosSel;
00100
00101 void MacrosReloadAll(void);
00102     // reload the available macros
00103     // TO_OBSOLETE
00104
00105 void MacrosGetLoc(CStr & path);
00106     // return the macros location
00107
00108 void PythonLibGetLoc(CStr & path);
00109     // return python library root path
00110
00111 #endif /* MACROSSETUP_H */
Generated on Sun Feb 24 01:21:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/MakeSurePathExists.cpp Source File

common/MakeSurePathExists.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * MakeSurePathExists.cpp --- check if the directory exists and prompt to create one if it doesn't
00019  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- January 27, 2001
00020  * Modified :
00021  */
00022
00023 #include "stdafx.h"
00024
00025 #ifdef WIN32
00026 #   include "wincvs.h"
00027 #   include <sys\stat.h>
00028 #   include <direct.h>
00029 #   include <errno.h>
00030 #endif /* WIN32 */
00031
00032 #if qUnix
00033 #endif
00034
00035 #ifdef qMacCvsPP
00036 #endif /* qMacCvsPP */
00037
00038 #include "MakeSurePathExists.h"
00039 #include "FileTraversal.h"
00040
00041 // common interface to check whether the specified path exists,
00042 // if promptForCreation is set to true it will prompt for creation
00043 // return true if the path exists, false if not
00044 bool CompatMakeSurePathExists( const char* path, bool promptForCreation /*= true*/ )
00045 {
00046     bool valid = false;
00047
00048 #ifdef WIN32
00049     TCHAR fn[MAX_PATH];
00050     if (_tfullpath(fn, path, MAX_PATH))
00051     {
00052         struct _tstat dirstat;
00053         if (_tstat(fn, &dirstat) == 0)
00054         {
00055             if (dirstat.st_mode & _S_IFDIR)
00056             {
00057                 valid = true;
00058             }
00059         }
00060         else
00061         {
00062             // not found, ask for permission to create
00063             if( promptForCreation &&
00064                 AfxMessageBox("Folder " +
00065                 CString(path) +
00066                 " not found.\nDo you want to create it?", MB_YESNO) == IDYES )
00067             {
00068                 valid = CreateFolder(fn);
00069             }
00070         }
00071     }
00072 #endif
00073
00074     return valid;
00075 }
00076
00077 //basic rutine to create path leading to the folder
00078 bool CreateFolder(const char* fn)
00079 {
00080 #ifdef WIN32
00081     // remove possible trailing separator
00082     TCHAR folder[MAX_PATH];
00083     _tcscpy(folder, fn);
00084     int len = _tcslen(folder);
00085     if (len > 1)
00086     {
00087         switch (folder[len - 1])
00088         {
00089         case _T('\\'):
00090         case _T('/'):
00091             folder[len - 1] = 0;
00092             break;
00093         }
00094     }
00095
00096     // try to create
00097     if (_tmkdir(folder) == 0)
00098     {
00099         return true;
00100     }
00101
00102     // if path does not exist, create parent folder and then try again
00103     if (errno == ENOENT)
00104     {
00105         TCHAR drive[_MAX_DRIVE];
00106         TCHAR dir[_MAX_PATH];
00107         TCHAR fname[_MAX_PATH];
00108         _tsplitpath(folder, drive, dir, fname, NULL);
00109         if (!*fname)
00110         {
00111             return false;
00112         }
00113         _tmakepath(fname, drive, dir, NULL, NULL);
00114         if (!CreateFolder(fname))
00115         {
00116             return false;
00117         }
00118
00119         return _tmkdir(folder) == 0;
00120     }
00121 #endif
00122     // not possible to create
00123     return false;
00124 }
Generated on Sun Feb 24 01:21:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/MakeSurePathExists.h Source File

common/MakeSurePathExists.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * MakeSurePathExists.h --- check if the directory exists and prompt to create one if it doesn't
00019  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- January 27, 2001
00020  * Modified :
00021  */
00022
00023 #ifndef __MAKESUREPATHEXISTS_H__
00024 #define __MAKESUREPATHEXISTS_H__
00025
00026 bool CreateFolder(const char* fn);
00027 bool CompatMakeSurePathExists( const char* path, bool promptForCreation = true );
00028
00029 #endif //__MAKESUREPATHEXISTS_H__
Generated on Sun Feb 24 01:21:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/MoveToTrash.cpp Source File

common/MoveToTrash.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * MoveToTrash.cpp --- send the files to the trash
00019  * Author : Miro Jurisic <meeroh@MIT.EDU> --- December 1997
00020  * Modified : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00021  */
00022
00023 #include "stdafx.h"
00024
00025 #ifdef macintosh
00026 #   include <Files.h>
00027 #   include <Folders.h>
00028 #   include <AERegistry.h>
00029 #   include <AEPackObject.h>
00030 #   include <AEObjects.h>
00031 #endif /* macintosh */
00032
00033 #ifdef qUnix
00034 #   include <stdio.h>
00035 #endif /* qUnix */
00036
00037 #ifdef HAVE_UNISTD_H
00038 #   include <unistd.h>
00039 #endif
00040
00041 #include "MoveToTrash.h"
00042 #include "CPStr.h"
00043 #include "FileTraversal.h"
00044 #include "AppConsole.h"
00045
00046 #ifdef WIN32
00047 #   include <direct.h>
00048 #endif /* WIN32 */
00049
00050 #ifdef WIN32
00051 #   ifdef _DEBUG
00052 #   define new DEBUG_NEW
00053 #   undef THIS_FILE
00054     static char THIS_FILE[] = __FILE__;
00055 #   endif
00056 #endif /* WIN32 */
00057
00058 #ifdef macintosh
00059     static OSErr    GetAddressOfFinder (
00060         AEAddressDesc*  outFinderAddress);
00061     static OSErr    SendFilesToTrash (
00062         AEAddressDesc const*    inFinderAddress,
00063         short                   inFileCount,
00064         const UFSSpec*          inFileList);
00065     static OSErr    PutFilesInAE (
00066         short           inFileCount,
00067         const UFSSpec*  inFileList,
00068         AppleEvent  *   ioAppleEvent);
00069     static OSErr ToolboxMoveToTrash(const UFSSpec* spec);
00070
00071     const   OSType  kFinderSignature    =   'MACS';
00072
00073     static std::vector<UFSSpec> sToTrash;
00074     static bool sTrashRetainer = false;
00075
00076     static OSErr    MoveToTrash (const std::vector<UFSSpec> & inFiles)
00077     {
00078         OSErr   err = noErr;
00079         AEDesc  finderAddress = {typeNull, nil};
00080
00081         /*  First unlock the file so that the Finder can rename it
00082             if there are already files of that name in the Trash */
00083         std::vector<UFSSpec>::const_iterator i;
00084         for(i = inFiles.begin(); i != inFiles.end(); ++i)
00085         {
00086 #if TARGET_RT_MAC_CFM
00087             err = FSpRstFLock (&*i);
00088 #else
00089             FSCatalogInfo info;
00090             if((err = FSGetCatalogInfo(&*i, kFSCatInfoNodeFlags, &info, NULL, NULL, NULL)) == noErr &&
00091                 (info.nodeFlags & kFSNodeLockedMask) != 0)
00092             {
00093                 info.nodeFlags = info.nodeFlags & ~kFSNodeLockedMask;
00094                 err = FSSetCatalogInfo(&*i, kFSCatInfoNodeFlags, &info);
00095             }
00096 #endif
00097             if (err != noErr)
00098                 goto cleanup;
00099         }
00100
00101         err = GetAddressOfFinder (&finderAddress);
00102         if (err != noErr)
00103             goto cleanup;
00104
00105         err = SendFilesToTrash (&finderAddress, inFiles.size(), &inFiles[0]);
00106         if (err != noErr)
00107             goto cleanup;
00108
00109     cleanup:
00110         if (finderAddress.dataHandle != nil) {
00111             AEDisposeDesc (&finderAddress);
00112         }
00113         if(err != noErr)
00114         {
00115             /* try the toolbox way */
00116             for(i = inFiles.begin(); i != inFiles.end(); ++i)
00117             {
00118                 err = ToolboxMoveToTrash(&*i);
00119             }
00120         }
00121
00122         return err;
00123     }
00124
00125     static OSErr    MoveToTrash (const UFSSpec* inFile)
00126     {
00127         OSErr   err = noErr;
00128         AEDesc  finderAddress = {typeNull, nil};
00129
00130         /*  First unlock the file so that the Finder can rename it
00131             if there are already files of that name in the Trash */
00132
00133 #if TARGET_RT_MAC_CFM
00134         err = FSpRstFLock (inFile);
00135 #else
00136         FSCatalogInfo info;
00137         if((err = FSGetCatalogInfo(inFile, kFSCatInfoNodeFlags, &info, NULL, NULL, NULL)) == noErr &&
00138             (info.nodeFlags & kFSNodeLockedMask) != 0)
00139         {
00140             info.nodeFlags = info.nodeFlags & ~kFSNodeLockedMask;
00141             err = FSSetCatalogInfo(inFile, kFSCatInfoNodeFlags, &info);
00142         }
00143 #endif
00144         if (err != noErr)
00145             goto cleanup;
00146
00147         err = GetAddressOfFinder (&finderAddress);
00148         if (err != noErr)
00149             goto cleanup;
00150
00151         err = SendFilesToTrash (&finderAddress, 1, inFile);
00152         if (err != noErr)
00153             goto cleanup;
00154
00155     cleanup:
00156         if (finderAddress.dataHandle != nil) {
00157             AEDisposeDesc (&finderAddress);
00158         }
00159         if(err != noErr)
00160         {
00161             /* try the toolbox way */
00162             err = ToolboxMoveToTrash(inFile);
00163         }
00164
00165         return err;
00166     }
00167
00168     static OSErr
00169     ToolboxMoveToTrash(const UFSSpec* spec)
00170     {
00171         OSErr err;
00172
00173 #if TARGET_RT_MAC_CFM
00174         short foundVRefNum;
00175         long foundDirID;
00176
00177         err = FindFolder(spec->vRefNum, kTrashFolderType, kDontCreateFolder,
00178             &foundVRefNum, &foundDirID);
00179
00180         if(err != noErr)
00181             return err;
00182
00183         err = CatMove(spec->vRefNum, spec->parID, spec->name, foundDirID, "\p:"/*spec.name*/);
00184 #else
00185         FSRef folder;
00186
00187         err = FSFindFolder(kOnAppropriateDisk, kTrashFolderType, kDontCreateFolder,
00188             &folder);
00189
00190         if(err != noErr)
00191             return err;
00192
00193         err = FSMoveObject(spec, &folder, NULL);
00194 #endif
00195
00196         return err;
00197     }
00198
00199     /* get address of the Finder (to use as the destination of our appleevents) */
00200
00201     static OSErr
00202     GetAddressOfFinder (
00203         AEAddressDesc*  outFinderAddress)
00204     {
00205         return (AECreateDesc (typeApplSignature, (Ptr) &kFinderSignature, sizeof (long), outFinderAddress));
00206     }
00207
00208     /* Tell Finder to send a list of files to the trash */
00209
00210     static OSErr
00211     SendFilesToTrash (
00212         AEAddressDesc const*    inFinderAddress,
00213         short                   inFileCount,
00214         const UFSSpec*          inFileList)
00215     {
00216         OSErr       err = noErr;
00217         AppleEvent  theAppleEvent = {typeNull, nil};
00218         AppleEvent  theReply = {typeNull, nil};
00219         DescType    trashType = kTrashFolderType;
00220         AEDesc      keyData = {typeNull, nil};
00221         AEDesc      trashSpecifier = {typeNull, nil};
00222         AEDesc      nullDescriptor = {typeNull, nil};
00223
00224
00225         /* create the appleevent */
00226         err = AECreateAppleEvent (kAECoreSuite, kAEMove, inFinderAddress, kAutoGenerateReturnID, kAnyTransactionID, &theAppleEvent);
00227         if (err != noErr)
00228             goto cleanup;
00229
00230         /* put the files into the direct object of the appleevent */
00231         err = PutFilesInAE (inFileCount, inFileList, &theAppleEvent);
00232         if (err != noErr)
00233             goto cleanup;
00234
00235         /* create a descriptor for trash */
00236         err = AECreateDesc (typeType, (Ptr) &trashType, sizeof (DescType) , &keyData);
00237         if (err != noErr)
00238             goto cleanup;
00239
00240         /* get specifier for trash object */
00241         err = CreateObjSpecifier (typeProperty, &nullDescriptor, formPropertyID, &keyData, true, &trashSpecifier);
00242         if (err != noErr)
00243             goto cleanup;
00244
00245         /* put the trash specifier as the indirect object in the appleevent */
00246         err = AEPutParamDesc (&theAppleEvent, keyAEInsertHere, &trashSpecifier);
00247         if (err != noErr)
00248             goto cleanup;
00249
00250         /* send the appleevent */
00251         err = AESend (&theAppleEvent, &theReply, kAEWaitReply, kAENormalPriority, kAEDefaultTimeout, nil, nil);
00252         if (err != noErr)
00253             goto cleanup;
00254
00255         /* ignore the reply */
00256
00257     cleanup:
00258
00259         /* dispose of the stuff that we allocated */
00260         if (theAppleEvent.dataHandle != nil) {
00261             AEDisposeDesc (&theAppleEvent);
00262         }
00263         if (theReply.dataHandle != nil) {
00264             AEDisposeDesc (&theReply);
00265         }
00266         if (keyData.dataHandle != nil) {
00267             AEDisposeDesc (&keyData);
00268         }
00269         if (trashSpecifier.dataHandle != nil) {
00270             AEDisposeDesc (&trashSpecifier);
00271         }
00272         /* don't have to dispose of nullDescriptor because it's null */
00273
00274         return err;
00275     }
00276
00277     /* put a list of files into the direct object of an apple event */
00278
00279     static OSErr
00280     PutFilesInAE (
00281         short               inFileCount,
00282         const UFSSpec*      inFileList,
00283         AppleEvent*         ioAppleEvent)
00284     {
00285         OSErr       err;
00286         AEDescList  fileList = {typeNull, nil};
00287         short       i;
00288 #if TARGET_RT_MAC_MACHO
00289         AliasHandle alias;
00290 #endif
00291
00292         err = AECreateList(nil, 0, false, &fileList);
00293         if (err != noErr) return err;
00294
00295         for (i = 1; i <= inFileCount; i++) {
00296 #if TARGET_RT_MAC_CFM
00297             err = AEPutPtr(&fileList, i, typeFSS,
00298                             (Ptr) (inFileList + i - 1), sizeof(UFSSpec));
00299 #else
00300             err = ::FSNewAlias(NULL, inFileList + i - 1, &alias);
00301             if (err != noErr) goto cleanup;
00302
00303             ::HLock((Handle)alias);
00304             err = AEPutPtr(&fileList, i, typeAlias, *alias, ::GetHandleSize((Handle)alias));
00305             ::HUnlock((Handle)alias);
00306
00307             ::DisposeHandle((Handle)alias);
00308 #endif
00309             if (err != noErr) goto cleanup;
00310         }
00311
00312         err = AEPutParamDesc(ioAppleEvent, keyDirectObject, &fileList);
00313
00314     cleanup:
00315         if (fileList.dataHandle != nil) {
00316             AEDisposeDesc(&fileList);
00317         }
00318
00319         return err;
00320     }
00321 #endif /* macintosh */
00322
00323 void CompatBeginMoveToTrash(void)
00324 {
00325 #ifdef macintosh
00326     sToTrash.erase(sToTrash.begin(), sToTrash.end());
00327     sTrashRetainer = true;
00328 #endif
00329 }
00330
00331 void CompatEndMoveToTrash(void)
00332 {
00333 #ifdef macintosh
00334     if(sToTrash.size() > 0)
00335     {
00336         OSErr err;
00337         err = MoveToTrash(sToTrash);
00338         if(err != noErr)
00339             cvs_err("Unable to send files to the trash (Error %d)\n", err);
00340         else
00341             cvs_out("Files has been moved successfully to the trash...\n");
00342     }
00343
00344     sToTrash.erase(sToTrash.begin(), sToTrash.end());
00345     sTrashRetainer = false;
00346 #endif
00347 }
00348
00349 bool CompatMoveToTrash(const char *file, const char *dir, const UFSSpec *spec)
00350 {
00351 #ifdef macintosh
00352     if(sTrashRetainer)
00353     {
00354         sToTrash.push_back(*spec);
00355         return true;
00356     }
00357
00358     return spec != NULL ? MoveToTrash(spec) == noErr : false;
00359 #elif defined(WIN32)
00360     SHFILEOPSTRUCT fileop;
00361     CStr fullpath(dir);
00362     if(!fullpath.empty() && !fullpath.endsWith(kPathDelimiter))
00363     {
00364         fullpath << kPathDelimiter;
00365     }
00366     fullpath << file;
00367     fullpath << ' ';
00368     fullpath[fullpath.length() - 1] = '\0';
00369
00370     fileop.hwnd     = *AfxGetMainWnd();
00371     fileop.wFunc    = FO_DELETE;
00372     fileop.pFrom    = fullpath;
00373     fileop.pTo      = 0L;
00374     fileop.fFlags   = FOF_ALLOWUNDO | FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI;
00375
00376     if(SHFileOperation(&fileop) != 0)
00377     {
00378         if(dir != 0L && chdir(dir) != 0)
00379             return false;
00380
00381         cvs_err("Unable to send \'%s\' to the recycle bin (error %d)\n",
00382             file, GetLastError());
00383         cvs_err("Trying now to delete \'%s\' instead\n", file);
00384         return remove(file) == 0;
00385     }
00386     return true;
00387 #else /* !macintosh && !WIN32 */
00388     CStr fullpath(dir);
00389     if(!fullpath.empty() && !fullpath.endsWith(kPathDelimiter))
00390     {
00391         fullpath << kPathDelimiter;
00392     }
00393     fullpath << file;
00394
00395     return remove(fullpath) == 0;
00396 #endif /* !macintosh && !WIN32 */
00397 }
Generated on Sun Feb 24 01:21:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/MoveToTrash.h Source File

common/MoveToTrash.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * MoveToTrash.h --- send the files to the trash
00019  * Author : Miro Jurisic <meeroh@MIT.EDU> --- December 1997
00020  * Modified : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00021  */
00022
00023 #ifndef MOVETOTRASH_H
00024 #define MOVETOTRASH_H
00025
00026 #include "TextBinary.h"
00027
00028 bool CompatMoveToTrash(const char *file, const char *dir = 0L, const UFSSpec *spec = 0L);
00029     // return false if failed
00030
00031 void CompatBeginMoveToTrash(void);
00032 void CompatEndMoveToTrash(void);
00033
00034 #endif /* MOVETOTRASH_H */
Generated on Sun Feb 24 01:21:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/MultiFiles.cpp Source File

common/MultiFiles.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * MultiFiles.h --- class to store multiple files by directory
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #include <stdlib.h>
00028 #include <string.h>
00029
00030 #include "MultiFiles.h"
00031 #include "CvsArgs.h"
00032 #include "AppConsole.h"
00033 #include "CPStr.h"
00034 #include "AppGlue.h"
00035
00036 #include <errno.h>
00037
00038 #ifdef WIN32
00039 #   ifdef _DEBUG
00040 #   define new DEBUG_NEW
00041 #   undef THIS_FILE
00042     static char THIS_FILE[] = __FILE__;
00043 #   endif
00044 #endif /* WIN32 */
00045
00046 void MultiFilesEntry::setdir(const char *newdir)
00047 {
00048     dir = newdir;
00049 }
00050
00051 void MultiFilesEntry::add(const char *file, const UFSSpec *spec)
00052 {
00053     FileEntry entry(file, spec);
00054     files.push_back(entry);
00055 }
00056
00057 void MultiFiles::newdir(const char *dir)
00058 {
00059     MultiFilesEntry entry(dir);
00060     dirs.push_back(dir);
00061 }
00062
00063 void MultiFiles::newfile(const char *file, const UFSSpec *spec)
00064 {
00065     if(dirs.size() == 0)
00066         return;
00067
00068     MultiFilesEntry & entry = dirs[dirs.size() - 1];
00069     entry.add(file, spec);
00070 }
00071
00072 bool MultiFiles::next(void)
00073 {
00074     if(pos == -1)
00075         pos = 0;
00076     else
00077     {
00078         // only the mac uses MultiFiles for now in such a fashion.
00079         // it also means that cvs should be finished with the last round.
00080         ++pos;
00081         if((size_t)pos < dirs.size())
00082             WaitForCvs();
00083     }
00084
00085     return (size_t)pos < dirs.size();
00086 }
00087
00088 char *MultiFiles::add(CvsArgs & args)
00089 {
00090     if(pos < 0 || (size_t)pos >= dirs.size())
00091         return 0L;
00092
00093     MultiFilesEntry & entry = dirs[pos];
00094     std::vector<FileEntry>::const_iterator i;
00095     for(i = entry.files.begin(); i != entry.files.end(); ++i)
00096     {
00097         args.addfile((*i).file, entry.dir, &(*i).spec);
00098     }
00099     return entry.dir;
00100 }
00101
00102 bool MultiFiles::get (int index, CStr & path, CStr & fileName)
00103 {
00104     if(pos < 0 || (size_t)pos >= dirs.size())
00105         return false;
00106
00107     MultiFilesEntry & entry = dirs[pos];
00108     if(index < 0 || (size_t)index >= entry.files.size())
00109         return false;
00110
00111     path = entry.dir;
00112     fileName = entry.files[index].file;
00113     return true;
00114 }
00115
00116 int MultiFiles::NumFiles(void) const
00117 {
00118     int locpos = pos;
00119     if(locpos == -1)
00120         locpos = 0;
00121     if((size_t)locpos >= dirs.size())
00122         return 0;
00123
00124     const MultiFilesEntry & entry = dirs[locpos];
00125     return entry.files.size();
00126 }
00127
00128 void MultiFiles::reset()
00129 {
00130     dirs.erase(dirs.begin(), dirs.end());
00131     pos = -1;
00132 }
Generated on Sun Feb 24 01:21:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/MultiFiles.h Source File

common/MultiFiles.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * MultiFiles.h --- class to store multiple files by directory
00023  */
00024
00025 #ifndef MULTIFILES_H
00026 #define MULTIFILES_H
00027
00028 #include "TextBinary.h"
00029
00030 #include "CPStr.h"
00031 #include <vector>
00032
00033 #ifdef _MSC_VER
00034     using namespace std;
00035 #endif
00036
00037 class CvsArgs;
00038
00039 // used internally
00040 class FileEntry
00041 {
00042 public:
00043     FileEntry() {}
00044     FileEntry(const char *filename, const UFSSpec *macspec = 0L)
00045     {
00046         file = filename;
00047         if(macspec != 0L)
00048             spec = *macspec;
00049     }
00050     FileEntry(const FileEntry & entry)
00051     {
00052         *this = entry;
00053     }
00054
00055     FileEntry & operator=(const FileEntry & entry)
00056     {
00057         file = entry.file;
00058         spec = entry.spec;
00059         return *this;
00060     }
00061
00062     CStr file;
00063     UFSSpec spec;
00064 };
00065
00066 // used internally
00067 class MultiFilesEntry
00068 {
00069 public:
00070     MultiFilesEntry() {}
00071     MultiFilesEntry(const char *path)
00072     {
00073         dir = path;
00074     }
00075     MultiFilesEntry(const MultiFilesEntry & entries)
00076     {
00077         *this = entries;
00078     }
00079
00080     MultiFilesEntry & operator=(const MultiFilesEntry & entries)
00081     {
00082         dir = entries.dir;
00083         files = entries.files;
00084         return *this;
00085     }
00086
00087     void setdir(const char *newdir);
00088     void add(const char *file, const UFSSpec *spec = 0L);
00089
00090     CStr dir;
00091     std::vector<FileEntry> files;
00092 };
00093
00094 class MultiFiles
00095 {
00096 public:
00097     MultiFiles() : pos(-1) {}
00098
00099     void newdir(const char *dir);
00100         // add a new directory
00101     void newfile(const char *file, const UFSSpec *spec = 0L);
00102         // add a new file to the current directory
00103
00104     inline void rewind(void) {pos = -1;}
00105         // rewind to first directory
00106     bool next(void);
00107         // return false if no more directories
00108     char *add (CvsArgs & args);
00109         // add the files to a CvsArgs, return the directory
00110     bool get (int index, CStr & path, CStr & fileName);
00111         // return the file in the current directory (false if failed)
00112
00113     int NumFiles(void) const;
00114         // number of files in the current dir
00115
00116     void reset();
00117         // reset for reuse.
00118 protected:
00119     int pos;
00120     std::vector<MultiFilesEntry> dirs;
00121 };
00122
00123 #endif /* MULTIFILES_H */
Generated on Sun Feb 24 01:21:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/MultiString.cpp Source File

common/MultiString.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- August 1998
00019  */
00020
00021 /*
00022  * MultiString.cpp --- remember several unique persistents strings
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #include "MultiString.h"
00028
00029 #if qUnix
00030 #   include "uwidget.h"
00031 #endif
00032
00033 #ifdef WIN32
00034 #   ifdef _DEBUG
00035 #   define new DEBUG_NEW
00036 #   undef THIS_FILE
00037     static char THIS_FILE[] = __FILE__;
00038 #   endif
00039 #   pragma warning (disable : 4660)
00040 #endif /* WIN32 */
00041
00042 template<class T>
00043 TMString<T>::TMString(unsigned int maxstr, const char *uniqueName, char * const *defaultStr,
00044     kClassPersistent pclass) : CPersistent(uniqueName, pclass), fMaxStr(maxstr)
00045 {
00046     if(defaultStr != 0L)
00047     {
00048         int i = 0;
00049         while(defaultStr[i] != 0L)
00050         {
00051             Insert(defaultStr[i++]);
00052         }
00053     }
00054 }
00055
00056 template<class T>
00057 TMString<T>::~TMString()
00058 {
00059 }
00060
00061 template<class T>
00062 unsigned int TMString<T>::SizeOf(void) const
00063 {
00064     NAMESPACE(std) vector<T>::const_iterator i;
00065     unsigned int thesize = sizeof(int);
00066
00067     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00068     {
00069         thesize += (*i).length() + 1;
00070     }
00071     return thesize;
00072 }
00073
00074 template<class T>
00075 const void *TMString<T>::GetData(void) const
00076 {
00077     unsigned int thesize = SizeOf(), tmpsize;
00078     ((TMString *)this)->fBuf.AdjustSize(thesize);
00079     char *tmp = ((TMString *)this)->fBuf;
00080     *(int *)tmp = fAllStrs.size();
00081     tmp += sizeof(int) / sizeof(char);
00082
00083     NAMESPACE(std) vector<T>::const_iterator i;
00084     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00085     {
00086         tmpsize = (*i).length() + 1;
00087         memcpy(tmp, (const char *)(*i), tmpsize * sizeof(char));
00088         tmp += tmpsize;
00089     }
00090
00091     return (char *)fBuf;
00092 }
00093
00094 template<class T>
00095 void TMString<T>::SetData(const void *ptr, unsigned int size)
00096 {
00097     const char *tmp = (char *)ptr;
00098     unsigned int thesize;
00099     fAllStrs.erase(fAllStrs.begin(), fAllStrs.end());
00100     thesize = *(int *)tmp;
00101     tmp += sizeof(int) / sizeof(char);
00102     for(unsigned int i = 0; i < thesize && i < fMaxStr; i++)
00103     {
00104         fAllStrs.push_back(T(tmp));
00105         tmp += strlen(tmp) + 1;
00106     }
00107 }
00108
00109 //  The string classes have too many operators to use std::find.
00110 template<class T>
00111 typename TMString<T>::list_t::const_iterator TMString<T>::Find(const char *instr) const
00112 {
00113     TMString<T>::list_t::const_iterator i;
00114     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00115         if(Compare(*i, instr) == 0) break;
00116
00117     return i;
00118 }
00119
00120 template<class T>
00121 void TMString<T>::Insert(const char *newstr)
00122 {
00123     TouchTimeStamp();
00124
00125     NAMESPACE(std) vector<T>::iterator i;
00126     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00127     {
00128         if(Compare(*i, newstr) == 0)
00129         {
00130             fAllStrs.erase(i);
00131             fAllStrs.insert(fAllStrs.begin(), T(newstr));
00132             return;
00133         }
00134     }
00135     fAllStrs.insert(fAllStrs.begin(), T(newstr));
00136     if(fAllStrs.size() > fMaxStr)
00137     {
00138         fAllStrs.erase(fAllStrs.begin() + fMaxStr, fAllStrs.end());
00139     }
00140 }
00141
00142 template<class T>
00143 bool TMString<T>::Remove(const char *newstr)
00144 {
00145
00146     NAMESPACE(std) vector<T>::iterator i;
00147     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00148     {
00149         if(Compare(*i, newstr) == 0)
00150         {
00151             TouchTimeStamp();
00152             fAllStrs.erase(i);
00153             return true;
00154         }
00155     }
00156
00157     return false;
00158 }
00159
00160 template class TMString<CStr>;
00161 template class TMString<CPStr>;
00162
00163 UIMPLEMENT_DYNAMIC(CMString, CPersistent)
00164 UIMPLEMENT_DYNAMIC(CMPString, CPersistent)
00165
00166 void CKeyString::Concatenate(UStr & res, const char *key, const char *value)
00167 {
00168     char c;
00169     while((c = *key++) != '\0')
00170     {
00171         if(c == '@' || c == '\\')
00172             res << '\\';
00173         res << c;
00174     }
00175     res << '@';
00176     while((c = *value++) != '\0')
00177     {
00178         if(c == '@' || c == '\\')
00179             res << '\\';
00180         res << c;
00181     }
00182 }
00183
00184 void CKeyString::Split(const char *str, UStr & key, UStr & value)
00185 {
00186     key = "";
00187     value = "";
00188     char c;
00189     bool inKey = true;
00190     while((c = *str++) != 0)
00191     {
00192         if(c == '\\')
00193             c = *str++;
00194         else if(c == '@')
00195         {
00196             inKey = false;
00197             continue;
00198         }
00199
00200         if(inKey)
00201             key << c;
00202         else
00203             value << c;
00204     }
00205 }
00206
00207 int CKeyString::Compare(const char *s1, const char *s2) const
00208 {
00209     UStr key1, key2, val1, val2;
00210     Split(s1, key1, val1);
00211     Split(s2, key2, val2);
00212     return strcmp(key1, key2);
00213 }
00214
00215 #if qUnix
00216 void DoDataExchange(bool fill, int widid, int cmdid, CMString & mstr)
00217 {
00218     if(fill)
00219     {
00220         UEventSendMessage(widid, EV_COMBO_RESETALL, cmdid, 0L);
00221         const NAMESPACE(std) vector<CStr> & list = mstr.GetList();
00222                 NAMESPACE(std) vector<CStr>::const_iterator i;
00223         for(i = list.begin(); i != list.end(); ++i)
00224         {
00225             UEventSendMessage(widid, EV_COMBO_APPEND, cmdid, (void *)(const char *)*i);
00226         }
00227     }
00228     else
00229     {
00230         UStr value;
00231         UEventSendMessage(widid, EV_GETTEXT, cmdid, &value);
00232         if(!value.empty())
00233         {
00234             mstr.Insert(value);
00235         }
00236     }
00237 }
00238 #endif // qUnix
Generated on Sun Feb 24 01:21:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/MultiString.h Source File

common/MultiString.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- August 1998
00019  */
00020
00021 /*
00022  * MultiString.h --- remember several unique persistents strings
00023  */
00024
00025 #ifndef MULTISTRING_H
00026 #define MULTISTRING_H
00027
00028 #include <vector>
00029 #include "Persistent.h"
00030 #include "CPStr.h"
00031
00032 #ifndef NAMESPACE
00033 #   if defined(_MSC_VER) || defined(__MWERKS__) || (__GNUC__ > 2)
00034 #       define NAMESPACE(w) w::
00035 #   else
00036 #       define NAMESPACE(w) ::
00037 #   endif
00038 #endif
00039
00040 //  Persistent array
00041 template<class T>
00042 class TMPersistent : public CPersistent
00043 {
00044 public:
00045     typedef NAMESPACE(std) vector<T>    list_t;
00046
00047     TMPersistent(const char *uniqueName, kClassPersistent pclass = kNoClass)
00048     : CPersistent(uniqueName, pclass) {};
00049
00050     virtual ~TMPersistent() {};
00051
00052     virtual unsigned int SizeOf(void) const {return sizeof (int) + sizeof (T) * fAllItems.size ();};
00053     virtual const void *GetData(void) const
00054         {
00055             fBuf.AdjustSize(SizeOf());
00056             char *tmp = fBuf;
00057             *(int *) tmp = fAllItems.size();
00058             tmp += sizeof(int) / sizeof(char);
00059
00060             for(list_t::const_iterator i = fAllItems.begin(); i != fAllItems.end(); ++i)
00061             {
00062                 memcpy(tmp, (const char *)(&*i), sizeof (T));
00063                 tmp += sizeof (T);
00064             }
00065
00066             return (char *)fBuf;
00067         };
00068
00069     virtual void SetData(const void *ptr, unsigned int size)
00070         {
00071             const char *tmp = (char *)ptr;
00072             fAllItems.erase(fAllItems.begin(), fAllItems.end());
00073             unsigned int thesize = *(int *)tmp;
00074             tmp += sizeof(int) / sizeof(char);
00075             for(unsigned int i = 0; i < thesize; ++i)
00076             {
00077                 fAllItems.push_back(*((T*)tmp));
00078                 tmp += sizeof (T);
00079             }
00080         };
00081         // persistent interface
00082
00083     inline const list_t & GetList(void) const { return fAllItems; }
00084     inline list_t & GetList(void) { return fAllItems; }
00085
00086 protected:
00087     list_t                      fAllItems;
00088     mutable CStaticAllocT<char> fBuf;
00089 };
00090
00091 template<class T>
00092 class TMString : public CPersistent
00093 {
00094 public:
00095     typedef NAMESPACE(std) vector<T> list_t;
00096
00097     TMString(unsigned int maxstr, const char *uniqueName,
00098         char * const *defaultStr = 0L, kClassPersistent pclass = kNoClass);
00099         // defaultStr is a null terminated set of strings
00100
00101     virtual ~TMString();
00102
00103     virtual unsigned int SizeOf(void) const;
00104     virtual const void *GetData(void) const;
00105     virtual void SetData(const void *ptr, unsigned int size);
00106         // persistent interface
00107
00108     void Insert(const char *newstr);
00109         // add a new string
00110
00111     bool Remove(const char *newstr);
00112         // remove a new string, true if it was found
00113
00114     typename list_t::const_iterator Find(const char *instr) const;
00115         // find a string
00116
00117     inline const list_t & GetList(void) const { return fAllStrs; }
00118     inline list_t::const_iterator begin() const { return GetList ().begin ();};
00119     inline list_t::const_iterator end() const { return GetList ().end ();};
00120
00121 protected:
00122     virtual int Compare(const char *s1, const char *s2) const
00123     {
00124         return strcmp(s1, s2);
00125     }
00126
00127     list_t fAllStrs;
00128     mutable CStaticAllocT<char> fBuf;
00129     unsigned int fMaxStr;
00130 };
00131
00132 class CMString : public TMString<CStr>
00133 {
00134     UDECLARE_DYNAMIC(CMString)
00135 public:
00136     CMString(unsigned int maxstr, const char *uniqueName,
00137         char * const *defaultStr = 0L, kClassPersistent pclass = kNoClass) :
00138         TMString<CStr>(maxstr, uniqueName, defaultStr, pclass)
00139     {
00140     }
00141
00142     virtual ~CMString()
00143     {
00144     }
00145 };
00146
00147 class CMPString : public TMString<CPStr>
00148 {
00149     UDECLARE_DYNAMIC(CMPString)
00150 public:
00151     CMPString(unsigned int maxstr, const char *uniqueName,
00152         char * const *defaultStr = 0L, kClassPersistent pclass = kNoClass) :
00153         TMString<CPStr>(maxstr, uniqueName, defaultStr, pclass)
00154     {
00155     }
00156
00157     virtual ~CMPString()
00158     {
00159     }
00160 };
00161
00162 // this is a multi-string for storing map (i.e. dictionary)
00163 class CKeyString : public CMString
00164 {
00165 public:
00166     CKeyString(unsigned int maxstr, const char *uniqueName,
00167         char * const *defaultStr = 0L, kClassPersistent pclass = kNoClass) :
00168         CMString(maxstr, uniqueName, defaultStr, pclass)
00169     {
00170     }
00171
00172     virtual ~CKeyString()
00173     {
00174     }
00175
00176     static void Concatenate(UStr & res, const char *key, const char *value);
00177     static void Split(const char *str, UStr & key, UStr & value);
00178 protected:
00179     virtual int Compare(const char *s1, const char *s2) const;
00180 };
00181
00182 #if qUnix
00183     void DoDataExchange(bool fill, int widid, int cmdid, CMString & mstr);
00184 #endif // qUnix
00185
00186 #endif /* AUTHEN_H */
Generated on Sun Feb 24 01:21:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/OptionalPropertySheet.cpp Source File

common/OptionalPropertySheet.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- June 2001
00019  */
00020
00021 // OptionalPropertySheet.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025 #include "wincvs.h"
00026 #include "OptionalPropertySheet.h"
00027
00028 #include "CvsPrefs.h"
00029
00030 #ifdef _DEBUG
00031 #define new DEBUG_NEW
00032 #undef THIS_FILE
00033 static char THIS_FILE[] = __FILE__;
00034 #endif
00035
00037 // COptionalPropertySheet
00038
00039 IMPLEMENT_DYNAMIC(COptionalPropertySheet, CPropertySheet)
00040
00041 COptionalPropertySheet::COptionalPropertySheet(bool bOptionChecked, UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
00042     :CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
00043 {
00044     m_bOptionChecked = bOptionChecked;
00045 }
00046
00047 COptionalPropertySheet::COptionalPropertySheet(bool bOptionChecked, LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
00048     :CPropertySheet(pszCaption, pParentWnd, iSelectPage)
00049 {
00050     m_bOptionChecked = bOptionChecked;
00051 }
00052
00053 COptionalPropertySheet::~COptionalPropertySheet()
00054 {
00055 }
00056
00057
00058 BEGIN_MESSAGE_MAP(COptionalPropertySheet, CPropertySheet)
00059 //{{AFX_MSG_MAP(COptionalPropertySheet)
00060 //}}AFX_MSG_MAP
00061 END_MESSAGE_MAP()
00062
00064 // COptionalPropertySheet message handlers
00065
00066 BOOL COptionalPropertySheet::OnInitDialog()
00067 {
00068     CPropertySheet::OnInitDialog();
00069
00070     // Add the option check box
00071     CRect rectWnd;
00072     GetClientRect(rectWnd);
00073
00074     rectWnd.bottom -= 13;
00075     rectWnd.left   += 7;
00076     rectWnd.top     = rectWnd.bottom - 12;
00077     rectWnd.right   = rectWnd.left   + 180;
00078
00079     CString strOptionText;
00080     strOptionText.Format(_T("Display only if %s key is down"),
00081         gCvsPrefs.HideCommandDlgUseShift() ? "Shift" : "Ctrl");
00082     m_optionCheck.Create(strOptionText,
00083         WS_CHILD|WS_VISIBLE|BS_AUTOCHECKBOX|WS_TABSTOP,
00084         rectWnd, this, 4);
00085
00086     m_optionCheck.SetFont( GetFont() );
00087
00088     // Set the checkbox
00089     m_optionCheck.SetCheck(m_bOptionChecked);
00090
00091     return TRUE;  // return TRUE unless you set the focus to a control
00092     // EXCEPTION: OCX Property Pages should return FALSE
00093 }
00094
00095 int COptionalPropertySheet::DoModal()
00096 {
00097     bool bDisplayDlg = true;
00098
00099     // See if the option flag is set
00100     //m_bOptionChecked = !!AfxGetApp()->GetProfileInt(PROFILE_NAME, m_psh.pszCaption, (int)false);
00101
00102     if (m_bOptionChecked)
00103     {
00104         // See if the ctrl key is down
00105         bDisplayDlg = (::GetKeyState(gCvsPrefs.HideCommandDlgUseShift() ? VK_SHIFT : VK_CONTROL) < 0);
00106     }
00107
00108     if (bDisplayDlg)
00109         return CPropertySheet::DoModal();
00110     else
00111         return IDOK;
00112 }
00113
00114 BOOL COptionalPropertySheet::OnCommand(WPARAM wParam, LPARAM lParam)
00115 {
00116     if (wParam == IDOK)
00117     {
00118         // Save the check state of the display option
00119         m_bOptionChecked = (m_optionCheck.GetCheck() == 1);
00120         //AfxGetApp()->WriteProfileInt(PROFILE_NAME, m_psh.pszCaption, bChecked);
00121     }
00122
00123     return CPropertySheet::OnCommand(wParam, lParam);
00124 }
00125
00126 bool COptionalPropertySheet::GetHideCommandDlg()
00127 {
00128     return m_bOptionChecked;
00129 }
Generated on Sun Feb 24 01:21:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/OptionalPropertySheet.h Source File

common/OptionalPropertySheet.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- June 2001
00019  */
00020
00021 #if !defined(AFX_OPTIONALPROPERTYSHEET_H__F82DC8BB_73CD_4AEA_8635_1A0932F24C7D__INCLUDED_)
00022 #define AFX_OPTIONALPROPERTYSHEET_H__F82DC8BB_73CD_4AEA_8635_1A0932F24C7D__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 // OptionalPropertySheet.h : header file
00028 //
00029
00031 // COptionalPropertySheet
00032
00033 class COptionalPropertySheet : public CPropertySheet
00034 {
00035     DECLARE_DYNAMIC(COptionalPropertySheet)
00036
00037 // Construction
00038 public:
00039     COptionalPropertySheet(bool bOptionChecked, UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
00040     COptionalPropertySheet(bool bOptionChecked, LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
00041
00042 // Attributes
00043 public:
00044
00045 // Operations
00046 public:
00047
00048 // Overrides
00049     // ClassWizard generated virtual function overrides
00050     //{{AFX_VIRTUAL(COptionalPropertySheet)
00051     public:
00052     virtual int DoModal();
00053     protected:
00054     virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
00055     //}}AFX_VIRTUAL
00056
00057 // Implementation
00058 public:
00059     virtual ~COptionalPropertySheet();
00060
00061     // Generated message map functions
00062 protected:
00063     //{{AFX_MSG(COptionalPropertySheet)
00064     virtual BOOL OnInitDialog();
00065     //}}AFX_MSG
00066     DECLARE_MESSAGE_MAP()
00067 protected:
00068     bool m_bOptionChecked; // The initial state of the option check box
00069     CButton m_optionCheck; // The object wrapping the option check box
00070 public:
00071     bool GetHideCommandDlg();
00072 };
00073
00075
00076 //{{AFX_INSERT_LOCATION}}
00077 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00078
00079 #endif // !defined(AFX_OPTIONALPROPERTYSHEET_H__F82DC8BB_73CD_4AEA_8635_1A0932F24C7D__INCLUDED_)
Generated on Sun Feb 24 01:21:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/Persistent.cpp Source File

common/Persistent.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 1998
00019  */
00020
00021 /*
00022  * Persistent.cpp --- utilities to store persitent values
00023  */
00024
00025 #ifdef macintosh
00026 #   include "GUSIInternal.h"
00027 #   include "GUSIFileSpec.h"
00028 #endif
00029
00030 #include "stdafx.h"
00031 #include <stdlib.h>
00032 #include <string.h>
00033 #include <map>
00034
00035 #if defined(HAVE_ERRNO_H) || defined(WIN32)
00036 #   include <errno.h>
00037 #endif
00038
00039 #ifdef HAVE_UNISTD_H
00040 #   include <unistd.h>
00041 #endif
00042
00043 #ifndef WIN32
00044 #   include <ctype.h>
00045 #endif /* !WIN32 */
00046
00047 #ifdef WIN32
00048 #   include "wincvs.h"
00049 #endif
00050
00051 #include "Persistent.h"
00052 #include "AppConsole.h"
00053 #include "CPStr.h"
00054 #include "uconsole.h"
00055 #include "uwidget.h"
00056 #include "FileTraversal.h"
00057 #include "Authen.h"
00058 #include "CvsPrefs.h"
00059 #include "getline.h"
00060 #include "CvsAlert.h"
00061
00062 #ifdef macintosh
00063 #   include <Resources.h>
00064 #   include <TextUtils.h>
00065 #   include <Folders.h>
00066 #   include "VolsPaths.h"
00067 #   include "MacMisc.h"
00068 #   ifndef Assert_ // for mpw
00069 #       include <assert.h>
00070 #       define Assert_(cond) assert(cond)
00071 #   endif
00072 #endif /* macintosh */
00073
00074 #if qMacCvsPP
00075 #   include "MacCvsApp.h"
00076 #   include "MacCvsConstant.h"
00077 #endif
00078
00079 #if qUnix
00080 #   include "UCvsDialogs.h"
00081 #endif
00082
00083 #ifdef WIN32
00084 #   ifdef _DEBUG
00085 #   define new DEBUG_NEW
00086 #   undef THIS_FILE
00087     static char THIS_FILE[] = __FILE__;
00088 #   endif
00089 #endif /* WIN32 */
00090
00091 #ifndef NEW
00092 #define NEW new
00093 #endif
00094
00095 std::vector<CPersistent::CPersistentEntry> *CPersistent::fAllEntries = 0L;
00096
00097 UIMPLEMENT_DYNAMIC(CPersistent, UObject)
00098 UIMPLEMENT_DYNAMIC(CPersistentInt, CPersistent)
00099 UIMPLEMENT_DYNAMIC(CPersistentBool, CPersistent)
00100 UIMPLEMENT_DYNAMIC(PCStr, CPersistent)
00101 UIMPLEMENT_DYNAMIC(PCPStr, CPersistent)
00102
00103 CPersistent::CPersistent(const char *uniqueName, kClassPersistent pclass) : fTimeStamp(0)
00104 {
00105     Register(this, uniqueName, pclass);
00106     TouchTimeStamp();
00107 }
00108
00109 CPersistent::~CPersistent()
00110 {
00111     UnRegister(this);
00112 }
00113
00114 void CPersistent::Register(CPersistent *value, const char *uniqueName, kClassPersistent pclass)
00115 {
00116     std::vector<CPersistentEntry>::const_iterator i;
00117     if(fAllEntries == 0L)
00118         fAllEntries = NEW std::vector<CPersistentEntry>;
00119     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00120     {
00121         if(strcmp(uniqueName, (*i).fUniqueName) == 0)
00122         {
00123             UAppConsole("Error : duplicate persistent %s !\n", uniqueName);
00124         }
00125     }
00126     CPersistentEntry newentry;
00127     newentry.fClass = pclass;
00128     newentry.fUniqueName = uniqueName;
00129     newentry.fValue = value;
00130     fAllEntries->push_back(newentry);
00131 }
00132
00133 void CPersistent::UnRegister(CPersistent *value)
00134 {
00135     std::vector<CPersistentEntry>::iterator i;
00136     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00137     {
00138         if(value == (*i).fValue)
00139             break;
00140     }
00141
00142     if(i == fAllEntries->end())
00143     {
00144         UAppConsole("Error : Unknown persistent value !\n");
00145         return;
00146     }
00147
00148     fAllEntries->erase(i);
00149     if(fAllEntries->size() == 0)
00150     {
00151         delete fAllEntries;
00152         fAllEntries = 0L;
00153     }
00154 }
00155
00156 // very simple diff
00157 static int simple_diff(const char *file1, const char *file2)
00158 {
00159     FILE *f1 = fopen(file1, "rb");
00160     if(f1 == 0L)
00161         return -1;
00162
00163     FILE *f2 = fopen(file2, "rb");
00164     if(f2 == 0L)
00165     {
00166         fclose(f1);
00167         return 1;
00168     }
00169
00170     int res = -1;
00171     char buf1[8000];
00172     char buf2[8000];
00173     size_t num1, num2;
00174     while(!feof(f1) && !feof(f2) && !ferror(f1) && !ferror(f2))
00175     {
00176         num1 = fread(buf1, sizeof(char), 8000, f1);
00177         num2 = fread(buf2, sizeof(char), 8000, f2);
00178         if(num1 != num2 || (res = memcmp(buf1, buf2, num1 * sizeof(char))) != 0)
00179             goto fail;
00180     }
00181
00182     if(ferror(f1) || ferror(f2))
00183         goto fail;
00184
00185     if(feof(f1) ^ feof(f2))
00186         goto fail;
00187
00188     res = 0;
00189 fail:
00190     fclose(f1);
00191     fclose(f2);
00192     return res;
00193 }
00194
00195 bool CPersistent::SaveAllSettings(const char *settingFileName, const char *forPath)
00196 {
00197     UStr tmpSettingsFile(settingFileName);
00198     tmpSettingsFile << "__";
00199     FILE *fd = fopen(tmpSettingsFile, "w");
00200     if(fd == 0L)
00201     {
00202         cvs_err("Failed to open the setting file '%s' for writing (error %d)",
00203             (const char *)tmpSettingsFile, errno);
00204         return false;
00205     }
00206
00207     fprintf(fd, "VERSION=%d\n", 1);
00208
00209     UStr path(forPath);
00210     if(path.endsWith(kPathDelimiter))
00211         path[path.length() - 1] = '\0';
00212     fprintf(fd, "PATH=%s\n", (const char *)path);
00213
00214     fprintf(fd, "AUTHENTICATION=%s\n",
00215         (const char *)Authen::kindToToken(gAuthen.kind()));
00216
00217     fprintf(fd, "CVSROOT=%s\n", (const char *)gCvsPrefs);
00218
00219     std::vector<CPersistentEntry>::const_iterator i;
00220     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00221     {
00222         const CPersistentEntry & entry = *i;
00223         if((entry.fClass & kAddSettings) == 0)
00224             continue;
00225
00226         if(entry.fValue->IsKindOf(URUNTIME_CLASS(CPersistentBool)))
00227         {
00228             CPersistentBool *pbool = (CPersistentBool *)entry.fValue;
00229             bool state = *pbool;
00230             fprintf(fd, "%s=%s\n", entry.fUniqueName, state ? "true" : "false");
00231         }
00232         else if(entry.fValue->IsKindOf(URUNTIME_CLASS(CPersistentInt)))
00233         {
00234             CPersistentInt *pint = (CPersistentInt *)entry.fValue;
00235             int val = *pint;
00236             fprintf(fd, "%s=%d\n", entry.fUniqueName, val);
00237         }
00238         else if(entry.fValue->IsKindOf(URUNTIME_CLASS(PCStr)))
00239         {
00240             PCStr *pstr = (PCStr *)entry.fValue;
00241             const char *str = *pstr;
00242             fprintf(fd, "%s=%s\n", entry.fUniqueName, (const char *)(str == 0L ? "" : str));
00243         }
00244         else if(entry.fValue->IsKindOf(URUNTIME_CLASS(PCPStr)))
00245         {
00246             PCPStr *pstr = (PCPStr *)entry.fValue;
00247             const char *str = *pstr;
00248             fprintf(fd, "%s=%s\n", entry.fUniqueName, (const char *)(str == 0L ? "" : str));
00249         }
00250         else
00251         {
00252             cvs_err("Unknown persistent value '%s'\n", entry.fUniqueName);
00253         }
00254     }
00255     fclose(fd);
00256
00257     if(simple_diff(tmpSettingsFile, settingFileName) == 0)
00258     {
00259         if(unlink(tmpSettingsFile) != 0 && errno != ENOENT)
00260             cvs_err("Could not remove file '%s' (error %d)\n", (const char *)tmpSettingsFile, errno);
00261
00262         return false;
00263     }
00264
00265     if(unlink(settingFileName) != 0 && errno != ENOENT)
00266     {
00267         cvs_err("Could not remove file '%s' (error %d)\n", (const char *)settingFileName, errno);
00268         return false;
00269     }
00270
00271     if(rename(tmpSettingsFile, settingFileName) != 0)
00272     {
00273         cvs_err("Could not rename file '%s' (error %d)\n", (const char *)tmpSettingsFile, errno);
00274         return false;
00275     }
00276
00277     return true;
00278 }
00279
00280 #ifdef macintosh
00281     static OSErr GetPreferencesFile(UFSSpec & mMacFileSpec)
00282     {
00283         OSErr   theErr;
00284     #if TARGET_RT_MAC_CFM
00285         short   theVRef;
00286         long    theDirID;
00287         Str255 name = {'\0'};
00288
00289         theErr = ::FindFolder(kOnSystemDisk, kPreferencesFolderType,
00290                         kDontCreateFolder, &theVRef, &theDirID);
00291
00292         if (theErr == noErr)
00293         {
00294             GUSIFileSpec spec(theVRef, theDirID, name);
00295             theErr = spec.Error();
00296             if (theErr == noErr)
00297             {
00298                 spec += kCVS_prefName;
00299                 theErr = spec.Error();
00300                 if (theErr == noErr || theErr == fnfErr)
00301                 {
00302                     mMacFileSpec = spec;
00303                 }
00304             }
00305         }
00306     #else
00307         FSRef ref;
00308         theErr = ::FSFindFolder(kOnAppropriateDisk, kPreferencesFolderType,
00309                         kDontCreateFolder, &ref);
00310
00311         if (theErr == noErr)
00312         {
00313             GUSIFileSpec spec(ref);
00314             theErr = spec.Error();
00315             if (theErr == noErr)
00316             {
00317                 spec += kCVS_prefName;
00318                 theErr = spec.Error();
00319                 if (theErr == noErr || theErr == fnfErr)
00320                 {
00321                     mMacFileSpec = spec;
00322                 }
00323             }
00324         }
00325     #endif
00326
00327         return theErr;
00328
00329     }
00330 #endif // macintosh
00331
00332 void CPersistent::SaveAll(void)
00333 {
00334 #ifdef macintosh
00335     short FRef, oldRef;
00336     Handle hdl;
00337     OSErr err;
00338     FSSpec thePrefFile;
00339
00340 #if TARGET_RT_MAC_CFM
00341     err = GetPreferencesFile(thePrefFile);
00342 #else
00343     FSRef thePrefRef;
00344     err = GetPreferencesFile(thePrefRef);
00345     if(err == noErr)
00346         err = FSGetCatalogInfo(&thePrefRef, kFSCatInfoNone, NULL, NULL, &thePrefFile, NULL);
00347 #endif
00348     if(err != noErr)
00349     {
00350         cvs_err("Error while searching preference folder (error %d)!\n", err);
00351         return;
00352     }
00353
00354     oldRef = CurResFile();
00355
00356     FRef = FSpOpenResFile(&thePrefFile, fsRdWrPerm);
00357     if(FRef < 0)
00358     {
00359         ::FSpCreateResFile (&thePrefFile, 'mCVS', 'pref', smRoman);
00360         FRef = FSpOpenResFile(&thePrefFile, fsRdWrPerm);
00361         if(FRef < 0)
00362         {
00363             cvs_err("Error while saving preferences (error %d)!\n", ResError());
00364             return;
00365         }
00366     }
00367
00368     UseResFile (FRef);
00369     CPStr name;
00370
00371     std::vector<CPersistentEntry>::iterator i;
00372     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00373     {
00374         CPersistentEntry & entry = *i;
00375         int size = entry.fValue->SizeOf();
00376         if(size <= 0)
00377             continue;
00378
00379         //short id = Unique1ID(kCVS_prefID);
00380         name = entry.fUniqueName;
00381
00382         Handle removing = Get1NamedResource(kCVS_prefID, name);
00383
00384         if (removing != nil)
00385         {
00386             RemoveResource(removing);
00387             Assert_(ResError() == noErr);
00388             DisposeHandle(removing);
00389         }
00390
00391         short theID;
00392         do
00393         {
00394             theID = Unique1ID(kCVS_prefID);
00395         }
00396         while (theID <= 127);
00397
00398         Handle hdl = NewHandle(size);
00399         Assert_(hdl != 0L);
00400         HLock(hdl);
00401         BlockMove(entry.fValue->GetData(), *hdl, size);
00402         HUnlock(hdl);
00403         AddResource(hdl, kCVS_prefID, theID, name);
00404         Assert_(ResError() == noErr);
00405         UpdateResFile(FRef);
00406         Assert_(ResError() == noErr);
00407         ReleaseResource(hdl);
00408         Assert_(ResError() == noErr);
00409     }
00410
00411     UseResFile(oldRef);
00412     Assert_(ResError() == noErr);
00413     CloseResFile (FRef);
00414     Assert_(ResError() == noErr);
00415 #endif /* macintosh */
00416 #ifdef WIN32
00417     std::vector<CPersistentEntry>::iterator i;
00418     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00419     {
00420         CPersistentEntry & entry = *i;
00421         unsigned int size = entry.fValue->SizeOf();
00422         if(size == 0)
00423             continue;
00424
00425         if(!AfxGetApp()->WriteProfileBinary(PROFILE_NAME, entry.fUniqueName,
00426             (BYTE *)entry.fValue->GetData(), size))
00427         {
00428             cvs_err("Error while saving preferences !\n");
00429             break;
00430         }
00431     }
00432 #endif /* WIN32 */
00433 #ifdef qUnix
00434     CStr home;
00435     home = gCvsPrefs.Home();
00436     if(!home.endsWith(kPathDelimiter))
00437         home << kPathDelimiter;
00438     home << ".gcvsrc";
00439     FILE *out = fopen(home, "wb");
00440     if(out == 0L)
00441     {
00442         cvs_err("Unable to open '%s' for writing (error %d)", (char *)home, errno);
00443         return;
00444     }
00445     int version = 1;
00446     fwrite(&version, sizeof(int), 1, out);
00447     int numEntries = fAllEntries->size();
00448     fwrite(&numEntries, sizeof(int), 1, out);
00449     std::vector<CPersistentEntry>::iterator i;
00450     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00451     {
00452         CPersistentEntry & entry = *i;
00453         unsigned int size = entry.fValue->SizeOf();
00454
00455         fwrite(entry.fUniqueName, sizeof(char), strlen(entry.fUniqueName) + 1, out);
00456         fwrite(&size, sizeof(unsigned int), 1, out);
00457         fwrite(entry.fValue->GetData(), 1, size, out);
00458     }
00459
00460     if(ferror(out))
00461         cvs_err("Error while writing '%s' (error %d)", (char *)home, errno);
00462     fclose(out);
00463 #endif /* qUnix */
00464
00465     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00466     {
00467         CPersistentEntry & entry = *i;
00468         entry.fValue->ResetTimeStamp();
00469     }
00470 }
00471
00472 bool CPersistent::LoadAll(void)
00473 {
00474 #ifdef macintosh
00475     FSSpec thePrefFile;
00476     short FRef, oldRef;
00477     Handle hdl;
00478     OSErr err;
00479
00480 #if TARGET_RT_MAC_CFM
00481     err = GetPreferencesFile(thePrefFile);
00482 #else
00483     FSRef thePrefRef;
00484     err = GetPreferencesFile(thePrefRef);
00485     if(err == noErr)
00486         err = FSGetCatalogInfo(&thePrefRef, kFSCatInfoNone, NULL, NULL, &thePrefFile, NULL);
00487 #endif
00488     if(err != noErr)
00489         return false;
00490
00491     oldRef = CurResFile();
00492     FRef = FSpOpenResFile(&thePrefFile, fsRdPerm);
00493     if(FRef < 0)
00494         return false;
00495
00496     CPStr name;
00497     UseResFile(FRef);
00498
00499     std::vector<CPersistentEntry>::iterator i;
00500     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00501     {
00502         CPersistentEntry & entry = *i;
00503         name = entry.fUniqueName;
00504
00505         Handle hdl = Get1NamedResource(kCVS_prefID, name);
00506         if(hdl == 0L)
00507             continue;
00508
00509         HLock(hdl);
00510         entry.fValue->SetData(*hdl, GetHandleSize(hdl));
00511         entry.fValue->ResetTimeStamp();
00512         HUnlock(hdl);
00513     }
00514
00515     // migrate to the new gOldCvsroots container
00516     if(gOldCvsroots.GetList().size() == 0)
00517     {
00518         for(int nIndex = 0; nIndex <= NUM_CVSROOT; nIndex++)
00519         {
00520             char tmp[20];
00521             sprintf(tmp, "P_Cvsroot%d", nIndex);
00522
00523             CPStr pstr(tmp);
00524             Handle hdl = Get1NamedResource(kCVS_prefID, pstr);
00525             if(hdl == 0L)
00526                 continue;
00527
00528             CStr root((char *)*hdl);
00529             if( !root.empty() )
00530                 gOldCvsroots.Insert(root);
00531         }
00532     }
00533
00534     CloseResFile (FRef);
00535     UseResFile(oldRef);
00536     return true;
00537 #endif /* macintosh */
00538 #ifdef WIN32
00539     bool found_one = false;
00540     std::vector<CPersistentEntry>::iterator i;
00541     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00542     {
00543         CPersistentEntry & entry = *i;
00544         BYTE* ppData;
00545         UINT pBytes;
00546
00547         if(!AfxGetApp()->GetProfileBinary(PROFILE_NAME, entry.fUniqueName,
00548             &ppData, &pBytes))
00549         {
00550             continue;
00551         }
00552         found_one = true;
00553         entry.fValue->SetData(ppData, pBytes);
00554         entry.fValue->ResetTimeStamp();
00555         delete ppData;
00556     }
00557     return found_one;
00558 #endif /* WIN32 */
00559 #ifdef qUnix
00560     CStr home;
00561     home = gCvsPrefs.Home();
00562     if(!home.endsWith(kPathDelimiter))
00563         home << kPathDelimiter;
00564     home << ".gcvsrc";
00565     FILE *out = fopen(home, "rb");
00566     if(out == 0L)
00567         return false;
00568
00569     int version;
00570     int numEntries;
00571     CStaticAllocT<char> alloc;
00572
00573     fread(&version, sizeof(int), 1, out);
00574     if(version != 1)
00575     {
00576         cvs_err("Unexpected version %d in the file '%s'\n", version, (char *)home);
00577         goto close;
00578     }
00579     fread(&numEntries, sizeof(int), 1, out);
00580     if(numEntries < 0)
00581     {
00582         cvs_err("Unexpected # %d in the file '%s'\n", numEntries, (char *)home);
00583         goto close;
00584     }
00585     for(int i = 0; i < numEntries; i++)
00586     {
00587         CStr name;
00588         while(!feof(out) && !ferror(out))
00589         {
00590             int c = getc(out);
00591             name << (char)c;
00592             if(c == '\0')
00593                 break;
00594         }
00595         if(feof(out))
00596         {
00597             cvs_err("Unexpected end of file in '%s'\n", (char *)home);
00598             goto close;
00599         }
00600         if(ferror(out))
00601         {
00602             cvs_err("Unexpected error %d in '%s'\n", errno, (char *)home);
00603             goto close;
00604         }
00605         CPersistentEntry * entry = CPersistent::Find(name);
00606         if(entry == 0L)
00607         {
00608             cvs_err("Unexpected token '%s' in '%s'\n", (char *)name, (char *)home);
00609         }
00610
00611         unsigned int size;
00612         fread(&size, sizeof(unsigned int), 1, out);
00613
00614         alloc.AdjustSize(size);
00615         fread((char *)alloc, 1, size, out);
00616         if(entry != 0L)
00617         {
00618             entry->fValue->SetData((char *)alloc, size);
00619             entry->fValue->ResetTimeStamp();
00620         }
00621     }
00622
00623     if(ferror(out))
00624         cvs_err("Error while reading '%s' (error %d)", (char *)home, errno);
00625     fclose(out);
00626     return true;
00627 close:
00628     fclose(out);
00629 #endif /* qUnix */
00630     return false;
00631 }
00632
00633 CPersistent::CPersistentEntry * CPersistent::Find(const char *uniqueName)
00634 {
00635     std::vector<CPersistentEntry>::iterator i;
00636     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00637     {
00638         CPersistentEntry & entry = *i;
00639         if(!strcmp(uniqueName, entry.fUniqueName))
00640             return &entry;
00641     }
00642     return 0L;
00643 }
00644
00645 bool CPersistent::NeedSave(bool onlySettings)
00646 {
00647     std::vector<CPersistentEntry>::const_iterator i;
00648     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00649     {
00650         const CPersistentEntry & entry = *i;
00651         if(onlySettings && (entry.fClass & kAddSettings) == 0)
00652             continue;
00653
00654         if(entry.fValue->fTimeStamp != 0)
00655             return true;
00656     }
00657     return false;
00658 }
00659
00660 #if !qMPWCvs
00661 //
00662 // Settings management
00663 //
00664
00665 #define SETTINGS_FOLDER "Settings"
00666
00667 static bool SettingsGetLoc(CStr & path)
00668 {
00669     struct stat sb;
00670
00671     path = "";
00672 #ifdef WIN32
00673     CWincvsApp* pApp = (CWincvsApp *)AfxGetApp();
00674     pApp->GetAppPath(path);
00675     if(!path.empty() && !path.endsWith(kPathDelimiter))
00676     {
00677         path << kPathDelimiter;
00678     }
00679     path << SETTINGS_FOLDER;
00680 #elif defined(qUnix)
00681     path = gCvsPrefs.Home();
00682     if(!path.endsWith(kPathDelimiter))
00683         path << kPathDelimiter;
00684     path << ".gcvs";
00685
00686     if(stat(path, &sb) != -1)
00687     {
00688         if(!S_ISDIR(sb.st_mode))
00689         {
00690             cvs_err("The file '%s' already exists and is not a directory", (char *)path, errno);
00691             return false;
00692         }
00693     }
00694     else if(mkdir(path, 0750) != 0)
00695     {
00696         cvs_err("Unable to create the directory '%s' (error %d)", (char *)path, errno);
00697         return false;
00698     }
00699
00700     if(!path.endsWith(kPathDelimiter))
00701         path << kPathDelimiter;
00702     path << SETTINGS_FOLDER;
00703 #else
00704 #   ifdef qMacCvsPP
00705     path = CMacCvsApp::GetAppPath();
00706 #   endif /* qMacCvsPP */
00707
00708     if(!path.empty() && !path.endsWith(kPathDelimiter))
00709     {
00710         path << kPathDelimiter;
00711     }
00712     path << SETTINGS_FOLDER;
00713 #endif
00714
00715     if(stat(path, &sb) != -1 && S_ISDIR(sb.st_mode))
00716         return true;
00717
00718 #if qUnix || TARGET_RT_MAC_MACHO
00719     if(mkdir(path, 0750) != 0)
00720 #else
00721     if(mkdir(path) != 0)
00722 #endif
00723     {
00724         cvs_err("Failed to create the setting folder '%s' (error %d)",
00725             (const char *)path, errno);
00726         return false;
00727     }
00728     return true;
00729 }
00730
00731 class USaveSettings : public UWidget
00732 {
00733 public:
00734     UDECLARE_DYNAMIC(USaveSettings)
00735 public:
00736     USaveSettings(const char *path, const char *oldname);
00737     virtual ~USaveSettings();
00738
00739     virtual void DoDataExchange(bool fill);
00740
00741     enum
00742     {
00743 #if qUnix
00744         kOK = EV_COMMAND_START,
00745         kCancel,
00746         kSettingName,
00747 #else
00748         kSettingName = EV_COMMAND_START,
00749 #endif
00750         kCopyPath,
00751         kCopyFrom,
00752         kCopyList
00753     };
00754
00755     UStr m_settingName;
00756     UStr m_copyFromPath;
00757
00758 protected:
00759     UStr m_path;
00760     UStr m_oldname;
00761     std::map<UStr, UStr> m_list;
00762
00763     ev_msg int OnCopyFrom(void);
00764 #if qUnix
00765     ev_msg int OnOK(void);
00766     ev_msg int OnCancel(void);
00767 #endif
00768
00769     UDECLARE_MESSAGE_MAP()
00770 };
00771
00772 UIMPLEMENT_DYNAMIC(USaveSettings, UWidget)
00773
00774 UBEGIN_MESSAGE_MAP(USaveSettings, UWidget)
00775     ON_UCOMMAND(USaveSettings::kCopyFrom, USaveSettings::OnCopyFrom)
00776 #if qUnix
00777     ON_UCOMMAND(USaveSettings::kOK, USaveSettings::OnOK)
00778     ON_UCOMMAND(USaveSettings::kCancel, USaveSettings::OnCancel)
00779 #endif
00780 UEND_MESSAGE_MAP()
00781
00782 #if qUnix
00783 int USaveSettings::OnOK(void)
00784 {
00785     EndModal(true);
00786     return 0;
00787 }
00788
00789 int USaveSettings::OnCancel(void)
00790 {
00791     EndModal(false);
00792     return 0;
00793 }
00794 #endif
00795
00796 USaveSettings::USaveSettings(const char *path, const char *oldname) :
00797     UWidget(::UEventGetWidID()), m_path(path), m_oldname(oldname)
00798 {
00799 }
00800
00801 USaveSettings::~USaveSettings()
00802 {
00803 }
00804
00805 static bool GetAllPersistentSettings(std::map<UStr, UStr> & res);
00806
00807 void USaveSettings::DoDataExchange(bool fill)
00808 {
00809     if(fill)
00810     {
00811         UEventSendMessage(GetWidID(), EV_SETTEXT, kCopyPath,
00812             (void *)(const char *)m_path);
00813
00814         UStr defname;
00815         if(m_oldname.empty())
00816         {
00817             UStr uppath;
00818             SplitPath(m_path, uppath, defname);
00819         }
00820         else
00821             defname = m_oldname;
00822
00823         UEventSendMessage(GetWidID(), EV_SETTEXT, kSettingName,
00824             (void *)(const char *)defname);
00825
00826         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kCopyList, 0), 0L);
00827
00828         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kCopyList, 0L);
00829
00830         if(GetAllPersistentSettings(m_list))
00831         {
00832             std::map<UStr, UStr>::const_iterator i;
00833             for(i = m_list.begin(); i != m_list.end(); ++i)
00834             {
00835                 UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kCopyList,
00836                     (void *)(const char *)(*i).first);
00837             }
00838         }
00839     }
00840     else
00841     {
00842         UEventSendMessage(GetWidID(), EV_GETTEXT, kSettingName,
00843             &m_settingName);
00844         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCopyFrom, 0L);
00845         if(state)
00846         {
00847             UStr what;
00848             UEventSendMessage(GetWidID(), EV_COMBO_GETSEL, kCopyList, &what);
00849
00850             std::map<UStr, UStr>::const_iterator i;
00851             i = m_list.find(what);
00852             if(i != m_list.end())
00853             {
00854                 m_copyFromPath = (*i).second;
00855             }
00856         }
00857     }
00858 }
00859
00860 int USaveSettings::OnCopyFrom(void)
00861 {
00862     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCopyFrom, 0L);
00863     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kCopyList, state), 0L);
00864     return 1;
00865 }
00866
00867 static bool loadSettingsInternal(const char *fullname,
00868     bool (*func)(const char *token, const char *value, void *data), void *data)
00869 {
00870     bool res = false;
00871     int line_length;
00872     char *line = 0L;
00873     size_t line_chars_allocated = 0;
00874     FILE *fp = fopen(fullname, "r");
00875
00876     if(fp == 0L)
00877     {
00878         cvs_err("Failed to open the setting file '%s' for reading (error %d)",
00879             fullname, errno);
00880         goto fail;
00881     }
00882
00883     while ((line_length = getline (&line, &line_chars_allocated, fp)) > 0)
00884     {
00885         // read each token=value
00886         char *tmp = 0L;
00887
00888         if((tmp = strchr(line, '\n')) != 0L)
00889             *tmp = '\0';
00890
00891         tmp = line;
00892         while(isspace(*tmp) && *tmp != '\0')
00893             tmp++;
00894         if(*tmp == '\0' || *tmp == '#')
00895             continue;
00896
00897         UStr token;
00898         UStr value;
00899         const char *tmp2 = strchr(tmp, '=');
00900         if(tmp2 == 0L)
00901             continue;
00902
00903         token.set(tmp, tmp2 - tmp);
00904         value = tmp2 + 1;
00905
00906         // check version
00907         if(strcmp(token, "VERSION") == 0)
00908         {
00909             if(atoi(value) != 1)
00910             {
00911                 cvs_err("Newer format than expected in the setting file '%s'\n", fullname);
00912                 goto fail;
00913             }
00914             continue;
00915         }
00916
00917         if(func(token, value, data))
00918             break;
00919     }
00920
00921     if (line_length < 0 && !feof (fp))
00922     {
00923         cvs_err("Cannot read file (error %d)\n", errno);
00924         goto fail;
00925     }
00926
00927     res = true;
00928 fail:
00929     if(line != 0L)
00930         free(line);
00931     if(fp!= 0L)
00932         fclose(fp);
00933     return res;
00934 }
00935
00936 static void getSettingName(const char *fromfile, UStr & res)
00937 {
00938     CStr base, ext, uppath, filename;
00939     SplitPath(fromfile, uppath, filename);
00940     GetExtension(filename, base, ext);
00941     if(!base.empty() && stricmp(ext, "txt") == 0)
00942         res = base;
00943     else
00944         res = filename;
00945 }
00946
00947 class CFindSettings : public TraversalReport
00948 {
00949 public:
00950     CFindSettings(const char *findPath) : m_pathToFind(findPath), m_list(0L)
00951     {
00952         if(m_pathToFind.endsWith(kPathDelimiter))
00953             m_pathToFind[m_pathToFind.length() - 1] = '\0';
00954     }
00955
00956     CFindSettings(std::map<UStr, UStr> & list) : m_list(&list)
00957     {
00958     }
00959
00960     virtual ~CFindSettings() {}
00961
00962     virtual kTraversal OnError(const char *err, int errcode)
00963     {
00964         cvs_err(err);
00965         cvs_err("\n");
00966         return kTraversalError;
00967     }
00968
00969     virtual kTraversal OnFile(const char *fullpath,
00970         const char *fullname,
00971         const char *name,
00972         const struct stat & dir, const UFSSpec * macspec);
00973
00974     static bool searchPath(const char *token, const char *value, void *data);
00975     static bool searchAllPath(const char *token, const char *value, void *data);
00976
00977     UStr m_pathToFind;
00978     UStr m_settingsFile;
00979     bool m_foundIt;
00980     UStr m_topfolder;
00981     std::map<UStr, UStr> *m_list;
00982 };
00983
00984 bool CFindSettings::searchPath(const char *token, const char *value, void *data)
00985 {
00986     CFindSettings *loader = (CFindSettings *)data;
00987     // if we give a sub-folder to look for, it will return the
00988     // top folder's settings
00989     if(strcmp(token, "PATH") == 0 &&
00990 #if qUnix
00991         strncmp(value, loader->m_pathToFind, strlen(value)) == 0
00992 #else
00993         strnicmp(value, loader->m_pathToFind, strlen(value)) == 0
00994 #endif
00995         )
00996     {
00997         loader->m_foundIt = true;
00998         loader->m_topfolder = value;
00999         return true;
01000     }
01001     return false;
01002 }
01003
01004 bool CFindSettings::searchAllPath(const char *token, const char *value, void *data)
01005 {
01006     CFindSettings *loader = (CFindSettings *)data;
01007     if(strcmp(token, "PATH") == 0)
01008     {
01009         getSettingName(loader->m_settingsFile, loader->m_settingsFile);
01010         std::map<UStr, UStr>::value_type v(loader->m_settingsFile, UStr(value));
01011         loader->m_list->insert(v);
01012         return true;
01013     }
01014     return false;
01015 }
01016
01017 kTraversal CFindSettings::OnFile(const char *fullpath,
01018         const char *fullname,
01019         const char *name,
01020         const struct stat & dir, const UFSSpec * macspec)
01021 {
01022     m_foundIt = false;
01023     if(m_list == 0L)
01024     {
01025         loadSettingsInternal(fullname, searchPath, this);
01026     }
01027     else
01028     {
01029         m_settingsFile = fullname;
01030         loadSettingsInternal(fullname, searchAllPath, this);
01031     }
01032
01033     if(m_foundIt)
01034         m_settingsFile = fullname;
01035
01036     return m_foundIt ? kStopTraversal : kContinueTraversal;
01037 }
01038
01039 static bool GetAllPersistentSettings(std::map<UStr, UStr> & res)
01040 {
01041     UStr settingsDir;
01042     if(!SettingsGetLoc(settingsDir))
01043         return false;
01044
01045     CFindSettings finder(res);
01046     FileTraverse(settingsDir, finder);
01047
01048     return !res.empty();
01049 }
01050
01051 bool HasPersistentSettings(const char *path)
01052 {
01053     UStr settingsDir;
01054     if(!SettingsGetLoc(settingsDir))
01055         return false;
01056
01057     CFindSettings finder(path);
01058     FileTraverse(settingsDir, finder);
01059
01060     return !finder.m_settingsFile.empty();
01061 }
01062
01063 static bool _loadPersistentSettings(const char *token, const char *value, void *data)
01064 {
01065     if(strcmp(token, "CVSROOT") == 0)
01066     {
01067         gCvsPrefs = value;
01068     }
01069     else if(strcmp(token, "AUTHENTICATION") == 0)
01070     {
01071         gAuthen.setkind(Authen::tokenToKind(value));
01072     }
01073     else if(strcmp(token, "PATH") == 0)
01074     {
01075     }
01076     else
01077     {
01078         CPersistent::CPersistentEntry *entry = CPersistent::Find(token);
01079         if(entry == 0L)
01080         {
01081             //cvs_err("Persistent value '%s' is not registred\n", token);
01082         }
01083         else
01084         {
01085             if(entry->fValue->IsKindOf(URUNTIME_CLASS(CPersistentBool)))
01086             {
01087                 CPersistentBool *pbool = (CPersistentBool *)entry->fValue;
01088                 if(strcmp(value, "true") == 0)
01089                     *pbool = true;
01090                 else if(strcmp(value, "false") == 0)
01091                     *pbool = false;
01092                 else
01093                     cvs_err("Invalid value '%s' for persistent '%s'\n",
01094                         (const char *)value, entry->fUniqueName);
01095             }
01096             else if(entry->fValue->IsKindOf(URUNTIME_CLASS(CPersistentInt)))
01097             {
01098                 CPersistentInt *pint = (CPersistentInt *)entry->fValue;
01099                 int aint;
01100                 int check = sscanf(value, "%d", &aint);
01101                 if(check == 1)
01102                     *pint = aint;
01103                 else
01104                     cvs_err("Invalid value '%s' for persistent '%s'\n",
01105                         (const char *)value, entry->fUniqueName);
01106             }
01107             else if(entry->fValue->IsKindOf(URUNTIME_CLASS(PCStr)))
01108             {
01109                 PCStr *pstr = (PCStr *)entry->fValue;
01110                 *pstr = value;
01111             }
01112             else if(entry->fValue->IsKindOf(URUNTIME_CLASS(PCPStr)))
01113             {
01114                 PCPStr *pstr = (PCPStr *)entry->fValue;
01115                 *pstr = value;
01116             }
01117             else
01118             {
01119                 cvs_err("Unknown persistent value '%s'\n", entry->fUniqueName);
01120             }
01121         }
01122     }
01123
01124     return false;
01125 }
01126
01127 void LoadPersistentSettings(const char *path, bool quiet)
01128 {
01129     UStr settingsDir;
01130     if(!SettingsGetLoc(settingsDir))
01131         return;
01132
01133     CFindSettings finder(path);
01134     FileTraverse(settingsDir, finder);
01135
01136     if(finder.m_settingsFile.empty())
01137         return;
01138
01139     if(loadSettingsInternal(finder.m_settingsFile, _loadPersistentSettings, 0L) && !quiet)
01140     {
01141         CColorConsole out;
01142         out << kBold << "Loaded settings for " << kNormal << kUnderline << path << kNormal << kBold << " successfully..." << kNormal << kNL;
01143     }
01144 }
01145
01146 static void SaveAsPersistentSettings(const char *name, const char *path)
01147 {
01148     UStr settingFileName;
01149     if(!SettingsGetLoc(settingFileName))
01150         return;
01151
01152     if(!settingFileName.empty() && !settingFileName.endsWith(kPathDelimiter))
01153         settingFileName << kPathDelimiter;
01154     settingFileName << name;
01155     settingFileName << ".txt";
01156
01157     if(CPersistent::SaveAllSettings(settingFileName, path))
01158     {
01159         CColorConsole out;
01160         out << kBold << "Saved settings for " << kNormal << kUnderline << path << kNormal << kBold << " successfully..." << kNormal << kNL;
01161     }
01162 }
01163
01164 void AskCreatePersistentSettings(const char *path)
01165 {
01166     UStr settingsDir;
01167     if(!SettingsGetLoc(settingsDir))
01168         return;
01169
01170     int id = 0;
01171 #ifdef WIN32
01172     id = IDD_SAVESETTINGS;
01173 #endif
01174 #ifdef qMacCvsPP
01175     id = dlg_SaveSettings;
01176 #endif
01177     CFindSettings finder(path);
01178     FileTraverse(settingsDir, finder);
01179
01180     UStr oldName;
01181
01182     if(!finder.m_settingsFile.empty())
01183     {
01184         getSettingName(finder.m_settingsFile, oldName);
01185     }
01186
01187     USaveSettings *dlg = NEW USaveSettings(path, oldName);
01188
01189 #if qUnix
01190     void *wid;
01191 #   if qGTK
01192     wid = UCreate_SettingsDlg();
01193 #   endif
01194
01195     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01196 #endif
01197
01198     if(dlg->DoModal(id))
01199     {
01200         UStr name = dlg->m_settingName;
01201         UStr fileToDelete;
01202
01203         if(!name.empty())
01204         {
01205             if(!oldName.empty())
01206             {
01207                 if(stricmp(oldName, name) != 0)
01208                 {
01209                     UStr prompt("The setting '");
01210                     prompt << oldName;
01211                     prompt << "' already points on the same folder. ";
01212                     prompt << "Press 'Delete' if you want to overide this setting ";
01213                     prompt << "(two settings cannot point on the same location).";
01214                     if(CvsAlert(prompt, "Cancel", "Delete"))
01215                     {
01216                         delete dlg;
01217                         return;
01218                     }
01219                     fileToDelete = finder.m_settingsFile;
01220                 }
01221             }
01222
01223             if(!dlg->m_copyFromPath.empty())
01224                 LoadPersistentSettings(dlg->m_copyFromPath);
01225             SaveAsPersistentSettings(name, path);
01226
01227             if(!fileToDelete.empty())
01228             {
01229                 if(remove(fileToDelete) != 0)
01230                     cvs_err("Error while deleting '%s' (error %d)\n", (const char *)fileToDelete, errno);
01231             }
01232         }
01233     }
01234     delete dlg;
01235 }
01236
01237 void SavePersistentSettings(const char *path)
01238 {
01239     UStr settingsDir;
01240     if(!SettingsGetLoc(settingsDir))
01241         return;
01242
01243     CFindSettings finder(path);
01244     FileTraverse(settingsDir, finder);
01245
01246     if(finder.m_settingsFile.empty())
01247         return;
01248
01249     if(CPersistent::SaveAllSettings(finder.m_settingsFile, finder.m_topfolder))
01250     {
01251         CColorConsole out;
01252         out << kBold << "Saved settings for " << kNormal << kUnderline << path << kNormal << kBold << " successfully..." << kNormal << kNL;
01253     }
01254 }
01255 #endif // !qMPWCvs
Generated on Sun Feb 24 01:21:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/Persistent.h Source File

common/Persistent.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * Persistent.h --- utilities to store persitent values
00023  */
00024
00025 #ifndef PERSISTENT_H
00026 #define PERSISTENT_H
00027
00028 #include <string.h>
00029 #include <vector>
00030 #include "uobject.h"
00031
00032 #ifdef macintosh
00033 #   include <Files.h>
00034 #endif /* macintosh */
00035
00036 typedef enum
00037 {
00038     kNoClass = 0x00,
00039     kAddSettings = 0x01
00040 } kClassPersistent;
00041
00042 // virtual class to access the persistent data to load/save
00043 class CPersistent : public UObject
00044 {
00045     UDECLARE_DYNAMIC(CPersistent)
00046 public:
00047     CPersistent(const char *uniqueName, kClassPersistent pclass);
00048     virtual ~CPersistent();
00049
00050     virtual unsigned int SizeOf(void) const = 0L;
00051     virtual const void *GetData(void) const = 0L;
00052     virtual void SetData(const void *ptr, unsigned int size) = 0L;
00053         // virtual access
00054
00055     static void SaveAll(void);
00056     static bool LoadAll(void);
00057         // save/load the registred values
00058
00059     static bool SaveAllSettings(const char *settingFileName, const char *forPath);
00060         // save all the persistent values with the class 'kAddSettings'
00061
00062     struct CPersistentEntry
00063     {
00064         const char *fUniqueName;
00065         CPersistent *fValue;
00066         kClassPersistent fClass;
00067     };
00068
00069     static CPersistentEntry * Find(const char *uniqueName);
00070
00071     // handle modification flag (see if we really need to save it)
00072     inline void ResetTimeStamp() { fTimeStamp = 0; }
00073     inline long GetTimeStamp() const { return fTimeStamp; }
00074     inline void TouchTimeStamp() { fTimeStamp++; }
00075
00076     static bool NeedSave(bool onlySettings = false);
00077
00078 private:
00079     static void Register(CPersistent *value, const char *uniqueName,
00080         kClassPersistent pclass);
00081     static void UnRegister(CPersistent *value);
00082         // register/unregister a value to store/load
00083
00084 protected:
00085     long fTimeStamp;
00086     static std::vector<CPersistentEntry> *fAllEntries;
00087 };
00088
00089 #define PERSISTENT_CAST(T) \
00090     inline operator const T &() const {return fValue;} \
00091     inline const T * operator ->() const {return &fValue;} \
00092     inline T & operator=(const T & val) { TouchTimeStamp(); return fValue = val;} \
00093     inline bool operator==(const T & val) const {return fValue == val;}
00094
00095 // this is OK for most of the persistant values
00096
00097 template <class T>
00098 class CPersistentT : public CPersistent
00099 {
00100 public:
00101     CPersistentT(const char *uniqueName, T defValue, kClassPersistent pclass) : CPersistent(uniqueName, pclass)
00102     {
00103         fValue = fDefValue = defValue;
00104     }
00105     virtual ~CPersistentT()
00106     {
00107     }
00108
00109     PERSISTENT_CAST(T)
00110
00111     virtual unsigned int SizeOf(void) const {return sizeof(T);}
00112     virtual const void *GetData(void) const {return &fValue;}
00113     virtual void SetData(const void *ptr, unsigned int size)
00114     {
00115         if(size == sizeof(T))
00116             memcpy(&fValue, ptr, size);
00117     }
00118
00119 protected:
00120     T fDefValue, fValue;
00121 };
00122
00123 class CPersistentBool : public CPersistentT<bool>
00124 {
00125     UDECLARE_DYNAMIC(CPersistentBool)
00126 public:
00127     CPersistentBool(const char *uniqueName, bool defValue,
00128         kClassPersistent pclass = kNoClass) :
00129       CPersistentT<bool>(uniqueName, defValue, pclass)
00130     {
00131     }
00132     virtual ~CPersistentBool()
00133     {
00134     }
00135
00136     PERSISTENT_CAST(bool)
00137 };
00138
00139 class CPersistentInt : public CPersistentT<int>
00140 {
00141     UDECLARE_DYNAMIC(CPersistentInt)
00142 public:
00143     CPersistentInt(const char *uniqueName, int defValue,
00144         kClassPersistent pclass = kNoClass) :
00145             CPersistentT<int>(uniqueName, defValue, pclass)
00146     {
00147     }
00148     virtual ~CPersistentInt()
00149     {
00150     }
00151
00152     PERSISTENT_CAST(int)
00153 };
00154
00155 #ifdef WIN32
00156 #   define PROFILE_NAME "CVS settings"
00157 #endif /* WIN32 */
00158
00159 #if TARGET_OS_MAC
00160 #   define kCVS_prefID 'cprf'
00161 #   define kCVS_prefName "\pMacCvs Prefs"
00162 #endif
00163
00164 // Persistent settings API
00165 void LoadPersistentSettings(const char *path, bool quiet = false);
00166 bool HasPersistentSettings(const char *path);
00167 void AskCreatePersistentSettings(const char *path);
00168 void SavePersistentSettings(const char *path);
00169
00170 #endif /* PERSISTENT_H */
Generated on Sun Feb 24 01:21:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/PromptFiles.cpp Source File

common/PromptFiles.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * PromptFiles.cpp --- class to pick set of files and folder
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef macintosh
00028 #   include "GUSIInternal.h"
00029 #   include "GUSIFileSpec.h"
00030 #   include <string.h>
00031 #   include <TextUtils.h>
00032 #   include <LowMem.h>
00033 #   include "stdfolder.h"
00034 #   include "stdmfiles.h"
00035 #   include "VolsPaths.h"
00036 #endif /* macintosh */
00037
00038 #if qMacPP
00039 #   include <UConditionalDialogs.h>
00040 #   include <UNavServicesDialogs.h>
00041 #endif
00042
00043 #include "PromptFiles.h"
00044 #include "MultiFiles.h"
00045 #include "AppConsole.h"
00046
00047 #ifdef qQT
00048 #   include "qcvsapp.h"
00049 #   include "CPStr.h"
00050 #   include "TextBinary.h"
00051 #   include <qfiledialog.h>
00052 #   include <vector>
00053 #   include <stdlib.h>
00054 #endif /* qQT */
00055
00056 #ifdef qGTK
00057 #   include <gtk/gtk.h>
00058 #   include <sys/stat.h>
00059 #   include "TextBinary.h"
00060 #endif /* qGTK */
00061
00062 #ifdef WIN32
00063 #   ifdef _DEBUG
00064 #   define new DEBUG_NEW
00065 #   undef THIS_FILE
00066     static char THIS_FILE[] = __FILE__;
00067 #   endif
00068 #endif /* WIN32 */
00069
00070 #ifdef macintosh
00071     const char *
00072     BrowserGetDirectory(const char *prompt)
00073     {
00074 #   if qMacPP
00075 #       if !qCarbon
00076         if(UConditionalDialogs::UseNavServices())
00077 #       else
00078         if(1)
00079 #       endif
00080         {
00081             UNavServicesDialogs::LFileChooser chooser;
00082
00083             FSSpec folderReply;
00084             SInt32 outFolderDirID;
00085             if(!chooser.AskChooseFolder(folderReply, outFolderDirID))
00086                 return 0L;
00087
00088             static char cres[256];
00089             GUSIFileSpec dirSpec(folderReply);
00090             strcpy(cres, dirSpec.FullPath());
00091             return cres;
00092         }
00093 #   endif
00094 #   if !qCarbon
00095         FSSpec folderReply;
00096         Point apt = {-1, -1};
00097         Str255 pprompt;
00098
00099         strcpy((char *)pprompt, prompt);
00100         c2pstr((char *)pprompt);
00101         if(!SF_PromptForFolder(apt, pprompt, &folderReply))
00102             return NULL;
00103
00104         GUSIFileSpec spec = folderReply;
00105
00106         static char aPath[512];
00107         strcpy(aPath, spec.FullPath());
00108         if(spec.Error() != noErr)
00109         {
00110             cvs_err("MacCvs: Unable to convert path name\n");
00111             return NULL;
00112         }
00113
00114         return aPath;
00115 #   else
00116         return 0L;
00117 #   endif
00118     }
00119
00120     // enumerate the multiple files
00121     extern "C" {
00122         static void
00123         MacEnumFiles_hook(UFSSpec *newFile, MultiFiles *mf)
00124         {
00125 #if TARGET_RT_MAC_CFM
00126             char cname[64];
00127             p2cstrcpy(cname, newFile->name);
00128             mf->newfile(cname, newFile);
00129 #else
00130             UInt8 utf8path[PATH_MAX];
00131             if(FSRefMakePath(newFile, utf8path, sizeof(utf8path)) == noErr)
00132             {
00133                 UStr uppath, cname;
00134                 SplitPath(utf8_to_posix(utf8path), uppath, cname);
00135                 mf->newfile(cname, newFile);
00136             }
00137 #endif
00138         }
00139     }
00140
00141     // prompt for multiple files
00142     bool
00143     BrowserGetMultiFiles(const char *prompt, MultiFiles & mf)
00144     {
00145         Point apt = {-1, -1};
00146         Str255 pprompt;
00147
00148         c2pstrcpy(pprompt, prompt);
00149
00150         if(!SF_PromptForMFiles(apt, pprompt))
00151             return false;
00152
00153         SF_PFMF_INFO info;
00154         UFSSpec dirSpec;
00155
00156         SF_PFMF_BeginTraversal(&info);
00157         while(1)
00158         {
00159             if(!SF_PFMF_GetCurrentDir(&info, &dirSpec))
00160                 break;
00161
00162             char aPath[255];
00163             GUSIFileSpec spec = dirSpec;
00164             strcpy(aPath, spec.FullPath());
00165             if(spec.Error() != noErr)
00166             {
00167                 cvs_err("MacCvs: Unable to convert path name\n");
00168                 return false;
00169             }
00170             mf.newdir(aPath);
00171
00172             if(!SF_PFMF_DoTraversal(&info, true, (SF_PFMF_HOOK)MacEnumFiles_hook, &mf))
00173                 return false;
00174         }
00175         SF_PFMF_EndTraversal(&info);
00176
00177         return true;
00178     }
00179 #endif /* macintosh */
00180
00181 #ifdef WIN32
00182 #   if oldWay
00183
00184     static BOOL CALLBACK APIENTRY
00185     MyDirOpen(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
00186     {
00187         switch (message)
00188         {
00189             case WM_INITDIALOG:
00190                 {
00191                     LPOPENFILENAME pofn = (LPOPENFILENAME)lParam;
00192                     if(pofn && pofn->lpstrTitle)
00193                     {
00194                         SetDlgItemText (hDlg, 1090, pofn->lpstrTitle);
00195                     }
00196                     return TRUE;
00197                 }
00198             case WM_COMMAND:
00199                 {
00200                     if (LOWORD(wParam) == IDOK)
00201                     {
00202                         EndDialog(hDlg, wParam);
00203                         return TRUE;
00204                     }
00205                 }
00206         }
00207         return FALSE;
00208     }
00209
00210     bool BrowserGetDirectory(const char * prompt, char* fileName, int size)
00211     {
00212         OPENFILENAME ofn;
00213
00214         // set default informations
00215         memset(&ofn, 0, sizeof(OPENFILENAME));
00216         ofn.lStructSize     = sizeof(OPENFILENAME);
00217         ofn.hwndOwner       = *AfxGetMainWnd();
00218         ofn.lpstrFilter     = NULL;
00219         ofn.nFilterIndex    = 0;
00220         ofn.lpstrFile       = fileName;
00221         ofn.nMaxFile        = size;
00222         ofn.lpstrFileTitle  = NULL;
00223         ofn.nMaxFileTitle   = 0;
00224         ofn.lpstrInitialDir = (fileName[0]) ? fileName : NULL;
00225         ofn.lpstrTitle      = prompt;
00226         ofn.lpTemplateName  = "MYFOLDEROPENORD";
00227         ofn.hInstance       = AfxGetResourceHandle();
00228         ofn.lpfnHook        =  (LPOFNHOOKPROC)MyDirOpen;
00229         ofn.Flags = OFN_ENABLEHOOK | OFN_ENABLETEMPLATE;
00230
00231         if (GetOpenFileName( &ofn ))
00232         {
00233             GetCurrentDirectory(size, fileName);
00234             return true;
00235         }
00236         else
00237         {
00238             // LM
00239             TRACE("Retrun error of GetOpenFileName() = %0x\n", CommDlgExtendedError());
00240             // CDERR_DIALOGFAILURE
00241         }
00242
00243         return false;
00244     }
00245 #   else // !oldWay
00246
00247     bool BrowserGetDirectory(const char* prompt, char* fileName, int size, CWnd* pParentWnd)
00248     {
00249         CCJShell m_shell;
00250         m_shell.m_strTitle = (prompt) ? prompt : "";
00251
00252         if (fileName[0])
00253         {
00254             m_shell.m_strSelDir = fileName;
00255         }
00256
00257         if( m_shell.BrowseForFolder(pParentWnd != 0L ? pParentWnd : AfxGetMainWnd()) )
00258         {
00259             lstrcpyn(fileName, m_shell.m_strPath, size);
00260             return true;
00261         }
00262
00263         return false;
00264     }
00265 #   endif // !oldWay
00266
00267     static char sDefaultPath[MAX_PATH];
00268
00269     const char *
00270     BrowserGetDirectory(const char *prompt, CWnd* pParentWnd)
00271     {
00272         BOOL selected = BrowserGetDirectory(prompt, sDefaultPath, MAX_PATH, pParentWnd);
00273         return (selected) ? sDefaultPath : NULL;
00274     }
00275
00276
00277     bool BrowserGetMultiFiles(const char *prompt, MultiFiles & mf, const char* lpszFilter)
00278     {
00279         bool result = false;
00280         CFileDialog fd(true, NULL, NULL,
00281             OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_ALLOWMULTISELECT |
00282             OFN_FILEMUSTEXIST,
00283             lpszFilter );
00284
00285         fd.m_ofn.nMaxFile = 38000 * sizeof(char);
00286         fd.m_ofn.lpstrFile = (char *)malloc(fd.m_ofn.nMaxFile * sizeof(char));
00287         fd.m_ofn.lpstrTitle = prompt;
00288         fd.m_ofn.lpstrInitialDir = sDefaultPath[0] != '\0' ? sDefaultPath : NULL;
00289         fd.m_ofn.nMaxFileTitle   = 38000;
00290         fd.m_ofn.lpstrFileTitle  = (char *)malloc(fd.m_ofn.nMaxFileTitle * sizeof(char));
00291         if(fd.m_ofn.lpstrFile == NULL || fd.m_ofn.lpstrFileTitle == NULL)
00292         {
00293             cvs_err("Impossible to allocate %d bytes !\n", 38000 * sizeof(char));
00294             exit(1);
00295         }
00296
00297         // add the directory and the files
00298         fd.m_ofn.lpstrFile[0] = '\0';
00299         fd.m_ofn.lpstrFileTitle[0] = '\0';
00300         if(fd.DoModal() == IDOK)
00301         {
00302             GetCurrentDirectory(sizeof(sDefaultPath), sDefaultPath);
00303             const char *tmp = fd.m_ofn.lpstrFile;
00304             if(fd.m_ofn.lpstrFileTitle[0] == '\0')
00305             {
00306                 mf.newdir(tmp);
00307                 tmp += strlen(tmp) + 1;
00308                 while(tmp[0] != '\0')
00309                 {
00310                     mf.newfile(tmp);
00311                     tmp += strlen(tmp) + 1;
00312                 }
00313             }
00314             else
00315             {
00316                 mf.newdir(sDefaultPath);
00317                 mf.newfile(tmp + fd.m_ofn.nFileOffset);
00318             }
00319             result = true;
00320         }
00321
00322         free(fd.m_ofn.lpstrFile);
00323         free(fd.m_ofn.lpstrFileTitle);
00324         return result;
00325     }
00326 #endif /* WIN32 */
00327
00328 #ifdef qQT
00329     const char *
00330     BrowserGetDirectory(const char *prompt)
00331     {
00332         QFileDialog::Mode mode = QFileDialog::Directory;
00333         QString start(QDir::currentDirPath());
00334         QString filter("*");
00335         QString caption(prompt);
00336
00337         QFileDialog fd(start, filter, 0, 0L, TRUE );
00338         fd.setMode(mode);
00339         fd.setCaption(caption);
00340         fd.setSelection(start);
00341         if (fd.exec() == QDialog::Accepted)
00342         {
00343             static CStr result;
00344             result = fd.dirPath();
00345             return result;
00346         }
00347         return 0L;
00348     }
00349
00350     extern "C"
00351     {
00352         static int compareCStr(const CStr *s1, const CStr *s2)
00353         {
00354             return strcmp(*s1, *s2);
00355         }
00356     }
00357
00358     bool
00359     BrowserGetMultiFiles(const char *prompt, MultiFiles & mf)
00360     {
00361         QStringList s = QFileDialog::getOpenFileNames();
00362         vector <CStr> allpaths;
00363         QStringList::Iterator f;
00364         for (f = s.begin(); f != s.end(); f++)
00365         {
00366             allpaths.push_back(CStr(*f));
00367         }
00368         if(allpaths.size() == 0)
00369             return false;
00370
00371         qsort(&allpaths[0], allpaths.size(), sizeof(CStr), (int (*)(const void *, const void *))compareCStr);
00372
00373         vector<CStr>::const_iterator i;
00374         CStr uppath, file, oldpath;
00375         for(i = allpaths.begin(); i != allpaths.end(); ++i)
00376         {
00377             SplitPath(*i, uppath, file);
00378             if(strcmp(uppath, oldpath) != 0)
00379                 mf.newdir(uppath);
00380             oldpath = uppath;
00381             mf.newfile(file);
00382         }
00383         return true;
00384     }
00385 #endif /* qQT */
00386
00387 #ifdef qGTK
00388     static CStr gtksel;
00389     static bool gtkModalLoop;
00390
00391     static gint gtkcancel(GtkWidget *widget, gpointer data)
00392     {
00393         gtkModalLoop = false;
00394         return TRUE;
00395     }
00396
00397     static void file_ok_sel (GtkWidget *w, gpointer data)
00398     {
00399         gtkModalLoop = false;
00400         gtksel = gtk_file_selection_get_filename(GTK_FILE_SELECTION (data));
00401     }
00402
00403     static void file_cancel_sel (GtkWidget *w, gpointer data)
00404     {
00405         gtkModalLoop = false;
00406     }
00407
00408     const char *
00409     BrowserGetDirectory(const char *prompt)
00410     {
00411         /* Create a new file selection widget */
00412         GtkWidget *filew = gtk_file_selection_new (prompt);
00413
00414         gtk_signal_connect(GTK_OBJECT(filew), "delete_event",
00415                            GTK_SIGNAL_FUNC(gtkcancel), 0L);
00416
00417         /* Connect the ok_button to file_ok_sel function */
00418         gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button),
00419                             "clicked", (GtkSignalFunc) file_ok_sel, filew);
00420         gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button),
00421                             "clicked", (GtkSignalFunc) file_cancel_sel, filew);
00422
00423         gtkModalLoop = true;
00424         gtksel = "";
00425         gtk_widget_show(filew);
00426         gtk_grab_add (filew);
00427         while (gtkModalLoop)
00428         {
00429             gtk_main_iteration_do(TRUE);
00430         }
00431         gtk_grab_remove (filew);
00432         gtk_widget_destroy(filew);
00433
00434         if(!gtksel.empty())
00435         {
00436             static CStr fname;
00437
00438             fname = gtksel;
00439             if(fname.empty())
00440                 return 0L;
00441
00442             struct stat sb;
00443             if (stat(fname, &sb) != -1 && S_ISREG(sb.st_mode))
00444             {
00445                 CStr uppath, file;
00446                 SplitPath(fname, uppath, file);
00447                 fname = uppath;
00448             }
00449
00450             if(fname.endsWith(kPathDelimiter))
00451                 fname[fname.length() - 1] = '\0';
00452
00453             return fname;
00454         }
00455
00456         return 0L;
00457     }
00458
00459     bool
00460     BrowserGetMultiFiles(const char *prompt, MultiFiles & mf)
00461     {
00462         /* Create a new file selection widget */
00463         GtkWidget *filew = gtk_file_selection_new (prompt);
00464
00465         gtk_signal_connect(GTK_OBJECT(filew), "delete_event",
00466                            GTK_SIGNAL_FUNC(gtkcancel), 0L);
00467
00468         /* Connect the ok_button to file_ok_sel function */
00469         gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button),
00470                             "clicked", (GtkSignalFunc) file_ok_sel, filew);
00471         gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button),
00472                             "clicked", (GtkSignalFunc) file_cancel_sel, filew);
00473
00474         gtkModalLoop = true;
00475         gtksel = "";
00476         gtk_widget_show(filew);
00477         gtk_grab_add (filew);
00478         while (gtkModalLoop)
00479         {
00480             gtk_main_iteration_do(TRUE);
00481         }
00482         gtk_grab_remove (filew);
00483         gtk_widget_destroy(filew);
00484
00485         if(!gtksel.empty())
00486         {
00487             CStr fname = gtksel;
00488             if(fname.empty())
00489                 return false;
00490
00491             CStr uppath, file;
00492             SplitPath(fname, uppath, file);
00493             mf.newdir(uppath);
00494             mf.newfile(file);
00495
00496             return true;
00497         }
00498
00499         return false;
00500     }
00501 #endif /* qUnix */
Generated on Sun Feb 24 01:21:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/PromptFiles.h Source File

common/PromptFiles.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * PromptFiles.h --- class to pick set of files and folder
00023  */
00024
00025 #ifndef PROMPTFILES_H
00026 #define PROMPTFILES_H
00027
00028 class MultiFiles;
00029 class CWnd;
00030
00031 #ifdef WIN32
00032 const char *BrowserGetDirectory(const char *prompt, CWnd* pParentWnd = 0L);
00033     // return a directory, the prompt is a caption for the dialog
00034
00035 bool BrowserGetDirectory(const char* prompt, char* fileName, int size, CWnd* pParentWnd = 0L);
00036 // prompts the user for directory selection
00037 // Parameters
00038 //      prompt - dialog caption
00039 //      fileName   - IN  : initial directory
00040 //                   OUT : selected directory if selection done
00041 //      size       - size of the fileName buffer
00042 //      pParentWnd - parent for the dialog, important if you call it from within the dialog
00043 // Return
00044 //  true if selection done, false otherwise
00045 // Notes
00046 //  single-argument version should probably be deprecated after implementing this one
00047 //  on all platforms
00048
00049 bool BrowserGetMultiFiles(const char *prompt, MultiFiles & mf, const char* lpszFilter = NULL);
00050     // return a set of files, sorted by directory (class MultiFiles).
00051 #else
00052 const char *BrowserGetDirectory(const char *prompt);
00053     // return a directory, the prompt is a caption for the dialog
00054
00055 bool BrowserGetMultiFiles(const char *prompt, MultiFiles & mf);
00056     // return a set of files, sorted by directory (class MultiFiles).
00057 #endif /* WIN32 */
00058
00059 #endif /* PROMPTFILES_H */
Generated on Sun Feb 24 01:21:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/PythonContainer.cpp Source File

common/PythonContainer.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- September 2001
00019  */
00020
00021 #include "stdafx.h"
00022
00023 #include "PythonContainer.h"
00024
00025 #if USE_PYTHON
00026 #include <vector>
00027
00028 PyObject *gCvsguiErr = NULL;
00029
00030 PyRegistry *PyRegistry::m_all = NULL;
00031
00032 PyRegistry::PyRegistry(const char *name, size_t size, destructor d, getattrfunc g,
00033     PyRegistry_InitValues v, PyCFunction c, const char *doc) : m_v(v), m_c(c), m_doc(doc)
00034 {
00035     m_next = m_all;
00036     m_all = this;
00037
00038     PyTypeObject deftype =
00039     {
00040         PyObject_HEAD_INIT(0)
00041         0,
00042         (char *)name,
00043         size,
00044         0, \
00045         d,                           /*tp_dealloc*/
00046         0,                              /*tp_print*/
00047         g,                            /*tp_getattr*/
00048         0,                              /*tp_setattr*/
00049         0,                              /*tp_compare*/
00050         0,                              /*tp_repr*/
00051         0,                              /*tp_as_number*/
00052         0,                              /*tp_as_sequence*/
00053         0,                              /*tp_as_mapping*/
00054     };
00055
00056     m_type = deftype;
00057     m_type.ob_type = GetPyType_Type();
00058 }
00059
00060 PyRegistry::~PyRegistry()
00061 {
00062 }
00063
00064 void PyRegistry::RegisterAllObjects(std::vector<PyMethodDef> & methods)
00065 {
00066     PyRegistry *tmp = m_all;
00067     PyMethodDef def;
00068     while(tmp != 0L)
00069     {
00070         def.ml_name = tmp->m_type.tp_name;
00071         def.ml_meth = tmp->m_c;
00072         def.ml_flags = METH_VARARGS;
00073         def.ml_doc = (char *)tmp->m_doc;
00074
00075         methods.push_back(def);
00076
00077         tmp = tmp->m_next;
00078     }
00079
00080     memset(&def, 0, sizeof(def));
00081     methods.push_back(def);
00082 }
00083
00084 void PyRegistry::CallInitValues(PyObject *d)
00085 {
00086     PyRegistry *tmp = m_all;
00087     while(tmp != 0L)
00088     {
00089         tmp->m_v(d);
00090         tmp = tmp->m_next;
00091     }
00092 }
00093
00094 /* Convenience routine to export an integer value.
00095    For simplicity, errors (which are unlikely anyway) are ignored. */
00096 void PyContainer::RegisterValue(PyObject *d, char *name, int value)
00097 {
00098     PyObject *v = PyInt_FromLong((long) value);
00099     if (v == NULL) {
00100         /* Don't bother reporting this error */
00101         PyErr_Clear();
00102     }
00103     else {
00104         PyDict_SetItemString(d, name, v);
00105         Py_DECREF(v);
00106     }
00107 }
00108
00109 #ifdef WIN32
00110 void PyHandleCvsguiError(CException* e)
00111 {
00112     char tmp[256];
00113     if(e->GetErrorMessage(tmp, sizeof(tmp)))
00114         PyErr_SetString(gCvsguiErr, tmp);
00115     else
00116         PyErr_SetString(gCvsguiErr, "Unknown error");
00117 }
00118 #else
00119 void PyHandleCvsguiError(const std::exception & e)
00120 {
00121     PyErr_SetString(gCvsguiErr, e.what());
00122 }
00123 #endif
00124
00125 void PyHandleCvsguiError(const char *msg)
00126 {
00127     PyErr_SetString(gCvsguiErr, msg);
00128 }
00129
00130 #endif // USE_PYTHON
Generated on Sun Feb 24 01:21:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/PythonContainer.h Source File

common/PythonContainer.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- September 2001
00019  */
00020
00021 #ifndef __PY_CONTAINER
00022 #define __PY_CONTAINER
00023
00024 #if TARGET_RT_MAC_MACHO // OSXTODO
00025 #   define USE_PYTHON 0
00026 #endif
00027
00028 #if !defined(USE_PYTHON)
00029 #   define USE_PYTHON 1
00030 #endif
00031
00032 #if defined(WIN32) && !qCvsDebug /* || qCarbon */
00033     // force to not import Python
00034 #   define USE_DL_EXPORT
00035 #endif
00036
00037 #if USE_PYTHON
00038 #include <Python.h>
00039 #include <exception>
00040 #include <vector>
00041 #include "PythonMacros.h"
00042 #include "PythonGlue.impl.h"
00043
00044 typedef void (*PyRegistry_InitValues)(PyObject *d);
00045
00046 /*
00047  * Each C++ for Python has a registry which help us registring
00048  * the object to Python
00049  */
00050
00051 class PyRegistry
00052 {
00053 public:
00054     PyRegistry(const char *name, size_t size, destructor d, getattrfunc g,
00055         PyRegistry_InitValues v, PyCFunction c, const char *doc);
00056     ~PyRegistry();
00057
00058     PyTypeObject m_type;
00059
00060     static void RegisterAllObjects(std::vector<PyMethodDef> & methods);
00061         // initialize each wrapper class and return a method table
00062         // for the module
00063
00064     static void CallInitValues(PyObject *dict);
00065         // give a chance for each container to make some registrations
00066
00067 protected:
00068     PyRegistry *m_next;
00069     PyRegistry_InitValues m_v;
00070     PyCFunction m_c;
00071     const char *m_doc;
00072
00073     static PyRegistry *m_all;
00074 };
00075
00076 /*
00077  * Base for a C++ container wrapper
00078  */
00079
00080 class PyContainer
00081 {
00082 public:
00083     PyContainer() {}
00084     virtual ~PyContainer() {}
00085
00086     virtual PyObject *GetAttr(char *name) { return NULL; }
00087         // overide to implement attributes
00088
00089     static PyObject *True() { Py_INCREF(GetPyTrue()); return GetPyTrue(); }
00090     static PyObject *False() { Py_INCREF(GetPyFalse()); return GetPyFalse(); }
00091     static PyObject *Void() { Py_INCREF(GetPyNone()); return GetPyNone(); }
00092         // goodies for returning void or boolean to python
00093
00094     static void RegisterValue(PyObject *d, char *name, int value);
00095         // register a single constant value in the module dictionary
00096 };
00097
00098 // smart pointer for python PyObject
00099 template <class T>
00100 class PyAutoObject
00101 {
00102 public:
00103     inline PyAutoObject() : m_o(NULL)
00104     {
00105     }
00106
00107     inline PyAutoObject(T *o) : m_o(o)
00108     {
00109         Ref();
00110     }
00111
00112     inline PyAutoObject(PyObject *o) : m_o((T *)o)
00113     {
00114         Ref();
00115     }
00116
00117     inline PyAutoObject(PyAutoObject & obj) : m_o((T *)obj.CopyReturn())
00118     {
00119     }
00120
00121     inline operator T*() const  { return m_o; }
00122
00123     inline ~PyAutoObject()
00124     {
00125         UnRef();
00126     }
00127
00128     inline PyAutoObject & operator=(T *o)
00129     {
00130         UnRef();
00131         m_o = o;
00132         Ref();
00133         return *this;
00134     }
00135
00136     inline PyAutoObject & operator=(PyObject *o)
00137     {
00138         UnRef();
00139         m_o = (T *)o;
00140         Ref();
00141         return *this;
00142     }
00143
00144     inline PyAutoObject & operator=(PyAutoObject & obj)
00145     {
00146         UnRef();
00147         m_o = (T *)obj.CopyReturn();
00148         return *this;
00149     }
00150
00151     inline PyObject *CopyReturn(void)
00152     {
00153         Ref();
00154         return (PyObject *)m_o;
00155     }
00156
00157     inline bool IsValid(void)
00158     {
00159         return m_o != 0L;
00160     }
00161
00162     inline T *operator->(void)
00163     {
00164         return m_o;
00165     }
00166
00167 protected:
00168     inline void Ref(void)
00169     {
00170         if(m_o)
00171             Py_INCREF(m_o);
00172     }
00173
00174     inline void UnRef(void)
00175     {
00176         if(m_o)
00177         {
00178             Py_DECREF(m_o);
00179             m_o = NULL;
00180         }
00181     }
00182
00183     T *m_o;
00184 };
00185
00186 extern PyObject *gCvsguiErr;
00187 #endif // USE_PYTHON
00188
00189 #endif
Generated on Sun Feb 24 01:21:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/PythonGlue.cpp Source File

common/PythonGlue.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- August 2001
00019  */
00020
00021 /*
00022  * PythonGlue.cpp --- glue to the Python language
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #include <stdarg.h>
00028 #include <string.h>
00029 #include <stdlib.h>
00030
00031 #ifdef HAVE_UNISTD_H
00032 #include <unistd.h>
00033 #endif
00034
00035 #ifdef WIN32
00036 #   include "resource.h"
00037 #   include "NoPython.h"
00038 #endif /* WIN32 */
00039
00040 #include "PythonGlue.h"
00041 #include "CvsLog.h"
00042 #include "AppConsole.h"
00043 #include "MacrosSetup.h"
00044 #include "umenu.h"
00045 #include "PythonContainer.h"
00046 #include "PythonImpl.h"
00047 #include "TclGlue.h"
00048 #include "AppGlue.h"
00049 #include "CvsArgs.h"
00050 #include "FileTraversal.h"
00051 #include "AskYesNo.h"
00052 #include "dll_loader.h"
00053 #include "CvsPrefs.h"
00054
00055 #if USE_PYTHON
00056 #include <Python.h>
00057 #include <osdefs.h>
00058 #   if qMacCvsPP
00059 #       include <macglue.h>
00060 #   endif
00061 #endif
00062
00063 #if qMacCvsPP
00064 #   include "MacCvsApp.h"
00065 #   include "MacCvsConstant.h"
00066 #   include "MacMisc.h"
00067 #endif
00068
00069 #ifdef WIN32
00070 #   ifdef _DEBUG
00071 #   define new DEBUG_NEW
00072 #   undef THIS_FILE
00073     static char THIS_FILE[] = __FILE__;
00074 #   endif
00075 #   include "wincvs_winutil.h"
00076 #endif /* WIN32 */
00077
00078 #ifndef NEW
00079 #define NEW new
00080 #endif
00081
00082 #if USE_PYTHON
00083
00084 PyThreadState *CPython_Interp::m_mainInterpreter = 0L;
00085 static bool gUICacheValid = false;
00086 static std::vector<ENTNODE> gUICache;
00087 static PyObject *gUICacheObj = NULL;
00088
00089 class CPyThreadState
00090 {
00091 public:
00092     CPyThreadState(PyThreadState *p) : m_p(p)
00093     {
00094         m_p = PyThreadState_Swap(p);
00095     }
00096     ~CPyThreadState()
00097     {
00098         PyThreadState_Swap(m_p);
00099     }
00100 protected:
00101     PyThreadState *m_p;
00102 };
00103
00104 enum
00105 {
00106     _stdout_style = 15,
00107     _stderr_style = 16,
00108     _trace_style = 17
00109 };
00110
00111 static PyObject *cvsgui_write(PyObject *self, PyObject *args)
00112 {
00113     char *str;
00114     int style;
00115     PyObject *shell;
00116
00117     if(!PyArg_ParseTuple(args, "siO", &str, &style, &shell))
00118         return NULL;
00119
00120     TRY
00121     {
00122         if(style == _stdout_style)
00123             cvs_outstr(str, strlen(str));
00124         else
00125             cvs_errstr(str, strlen(str));
00126     }
00127     CATCH_ALL(e)
00128     {
00129         PyHandleCvsguiError(e);
00130         return NULL;
00131     }
00132     END_CATCH_ALL
00133
00134     return PyContainer::Void();
00135 }
00136
00137 static PyObject *cvsgui_GetMainMenuWidget(PyObject *self, PyObject *args)
00138 {
00139     int res = 0;
00140
00141     if(!PyArg_ParseTuple(args, ""))
00142         return NULL;
00143
00144     TRY
00145     {
00146     }
00147     CATCH_ALL(e)
00148     {
00149         PyHandleCvsguiError(e);
00150         return NULL;
00151     }
00152     END_CATCH_ALL
00153
00154     return PyInt_FromLong(res);
00155 }
00156
00157 static PyObject *cvsgui_GetTopMacroSelectionMenu(PyObject *self, PyObject *args)
00158 {
00159     static UMENU macroMenu = 0L;
00160
00161     if(!PyArg_ParseTuple(args, ""))
00162         return NULL;
00163
00164     PyAutoObject<PyMenuMgr::obj_t> res = PyMenuMgr::New();
00165     if (!res.IsValid())
00166         return NULL;
00167
00168     TRY
00169     {
00170 #ifdef WIN32
00171         int pos;
00172         if(macroMenu == 0L)
00173         {
00174             CMenu *top = GetMenuEntry(ID_MACRO_SEL, pos);
00175             if(top)
00176             {
00177                 top->DeleteMenu(pos, MF_BYPOSITION);
00178                 macroMenu = (UMENU)(HMENU)*top;
00179             }
00180         }
00181 #endif
00182 #if qMacCvsPP
00183         if(macroMenu == 0L)
00184         {
00185             LMenuBar *menuBar   = LMenuBar::GetCurrentMenuBar();
00186             LMenu *menu = menuBar->FetchMenu(menu_MacroSel);
00187             if(menu)
00188                 macroMenu = menu->GetMenuID();
00189         }
00190 #endif
00191
00192         res->m_object = new PyMenuMgr(macroMenu);
00193     }
00194     CATCH_ALL(e)
00195     {
00196         PyHandleCvsguiError(e);
00197         return NULL;
00198     }
00199     END_CATCH_ALL
00200
00201     return res.CopyReturn();
00202 }
00203
00204 static PyObject *cvsgui_GetTopMacroAdminMenu(PyObject *self, PyObject *args)
00205 {
00206     static UMENU macroMenu = 0L;
00207
00208     if(!PyArg_ParseTuple(args, ""))
00209         return NULL;
00210
00211     PyAutoObject<PyMenuMgr::obj_t> res = PyMenuMgr::New();
00212     if (!res.IsValid())
00213         return NULL;
00214
00215     TRY
00216     {
00217 #ifdef WIN32
00218         int pos;
00219         if(macroMenu == 0L)
00220         {
00221             CMenu *top = GetMenuEntry(ID_MACRO_ADMIN, pos);
00222             if(top)
00223             {
00224                 top->DeleteMenu(pos, MF_BYPOSITION);
00225                 macroMenu = (UMENU)(HMENU)*top;
00226             }
00227         }
00228 #endif
00229 #if qMacCvsPP
00230         if(macroMenu == 0L)
00231         {
00232             LMenuBar *menuBar   = LMenuBar::GetCurrentMenuBar();
00233             LMenu *menu = menuBar->FetchMenu(menu_MacroAdmin);
00234             if(menu)
00235                 macroMenu = menu->GetMenuID();
00236         }
00237 #endif
00238         res->m_object = new PyMenuMgr(macroMenu);
00239     }
00240     CATCH_ALL(e)
00241     {
00242         PyHandleCvsguiError(e);
00243         return NULL;
00244     }
00245     END_CATCH_ALL
00246
00247     return res.CopyReturn();
00248 }
00249
00250 static PyObject *cvsgui_GetSelection(PyObject *self, PyObject *args)
00251 {
00252     if(!PyArg_ParseTuple(args, ""))
00253         return NULL;
00254
00255     if(gUICacheObj != 0L)
00256     {
00257         Py_INCREF(gUICacheObj);
00258         return gUICacheObj;
00259     }
00260
00261     gUICacheObj = PyTuple_New(gUICache.size());
00262     if(gUICacheObj == NULL)
00263         return NULL;
00264
00265     std::vector<ENTNODE>::const_iterator i;
00266     int cnt;
00267     for(cnt = 0, i = gUICache.begin(); i != gUICache.end(); ++i, ++cnt)
00268     {
00269         PyAutoObject<PyCvsEntry::obj_t> res = PyCvsEntry::New();
00270         if (!res.IsValid())
00271             return NULL;
00272
00273         res->m_object = new PyCvsEntry(*i);
00274
00275         PyTuple_SET_ITEM(gUICacheObj, cnt, res.CopyReturn());
00276     }
00277
00278     Py_INCREF(gUICacheObj);
00279     return gUICacheObj;
00280 }
00281
00282 class CFillPyEntries : public TraversalReport
00283 {
00284 public:
00285     CSortList<ENTNODE> & m_entries;
00286     std::vector<CStr> m_ignlist;
00287
00288     CFillPyEntries(CSortList<ENTNODE> & entries) :
00289         m_entries(entries) {}
00290
00291     virtual ~CFillPyEntries() {}
00292
00293     virtual kTraversal EnterDirectory(const char *fullpath, const char *dirname, const FSSpec * macspec)
00294     {
00295         Entries_Open (m_entries, fullpath);
00296         BuildIgnoredList(m_ignlist, fullpath);
00297         return kContinueTraversal;
00298     }
00299
00300     virtual kTraversal ExitDirectory(const char *fullpath)
00301     {
00302         m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00303         return kContinueTraversal;
00304     }
00305
00306     virtual kTraversal OnError(const char *err, int errcode)
00307     {
00308         return kTraversalError;
00309     }
00310
00311     virtual kTraversal OnIdle(const char *fullpath)
00312     {
00313         return kContinueTraversal;
00314     }
00315
00316     virtual kTraversal OnDirectory(const char *fullpath,
00317         const char *fullname,
00318         const char *name,
00319         const struct stat & dir, const FSSpec * macspec)
00320     {
00321 #if defined(WIN32) || defined(macintosh)
00322         if(stricmp(name, "CVS") == 0)
00323 #else
00324         if(strcmp(name, "CVS") == 0)
00325 #endif
00326             return kSkipFile;
00327
00328         /*EntnodeData *data = */Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00329
00330         return kSkipFile;
00331     }
00332
00333     virtual kTraversal OnAlias(const char *fullpath,
00334         const char *fullname,
00335         const char *name,
00336         const struct stat & dir, const FSSpec * macspec)
00337     {
00338         return OnFile(fullpath, fullname, name, dir, macspec);
00339     }
00340
00341     virtual kTraversal OnFile(const char *fullpath,
00342         const char *fullname,
00343         const char *name,
00344         const struct stat & dir, const FSSpec * macspec)
00345     {
00346         /*EntnodeData *data = */Entries_SetVisited(fullpath, m_entries, name, dir, false, &m_ignlist);
00347
00348         return kContinueTraversal;
00349     }
00350 };
00351
00352 static PyObject *cvsgui_GetCvsEntries(PyObject *self, PyObject *args)
00353 {
00354     char *path;
00355
00356     if(!PyArg_ParseTuple(args, "s", &path))
00357         return NULL;
00358
00359     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00360     CFillPyEntries traverse(entries);
00361     /*kTraversal res = */FileTraverse(path, traverse);
00362
00363     // add the missing files
00364     Entries_SetMissing(entries);
00365
00366     int numEntries = entries.NumOfElements();
00367     PyObject *obj = PyTuple_New(numEntries);
00368     if(obj == NULL)
00369         return NULL;
00370
00371     for(int i = 0; i < numEntries; i++)
00372     {
00373         const ENTNODE & theNode = entries.Get(i);
00374         EntnodeData *data = theNode.Data();
00375
00376         PyAutoObject<PyCvsEntry::obj_t> res = PyCvsEntry::New();
00377         if (!res.IsValid())
00378             return NULL;
00379
00380         res->m_object = new PyCvsEntry(data);
00381
00382         PyTuple_SET_ITEM(obj, i, res.CopyReturn());
00383     }
00384
00385     return obj;
00386 }
00387
00388 #if defined(WIN32)
00389 //
00390 // Get correct (UTC) file modification time.
00391 // Used for dealing with notorious DST bug.
00392 //
00393 static PyObject * cvsgui_GetFileModTime(PyObject *self, PyObject *args)
00394 {
00395     struct wnt_stat sb;
00396     struct tm * p_utc = NULL;
00397
00398     const char *path;
00399
00400 // PyObject_Length exists only for debugging version (ActiveState Python 2.1)
00401 #if defined(_DEBUG)
00402     int len = PyObject_Length(args);
00403     if (len < 1)
00404     {
00405         char errstr[255];
00406         sprintf(errstr, "Too few arguments (%d, expected 1)", len);
00407         PyErr_SetString(gCvsguiErr, errstr);
00408         return NULL;
00409     }
00410     else if (len > 1)
00411     {
00412         char errstr[255];
00413         sprintf(errstr, "Too many arguments (%d, expected 1)", len);
00414         PyErr_SetString(gCvsguiErr, errstr);
00415         return NULL;
00416     }
00417 #endif
00418
00419     if(!PyArg_ParseTuple(args, "s", &path))
00420         return NULL;
00421
00422     if (wnt_stat(path, &sb) != 0)
00423     {
00424         char errstr[255];
00425         sprintf(errstr, "Could not find file \"%s\"", path);
00426         PyErr_SetString(gCvsguiErr, errstr);
00427         return NULL;
00428     }
00429
00430     p_utc = gmtime(& sb.st_mtime);
00431     return Py_BuildValue("s", asctime(p_utc));
00432 }
00433 #endif  // defined(_WIN32)
00434
00435 static PyObject *cvsgui_LaunchTclMacro(PyObject *self, PyObject *args)
00436 {
00437     char *macroName;
00438
00439     if(!PyArg_ParseTuple(args, "s", &macroName) || !CTcl_Interp::IsAvail())
00440         return NULL;
00441
00442     std::vector<ENTNODE>::const_iterator i;
00443     TclBrowserReset();
00444     for(i = gUICache.begin(); i != gUICache.end(); ++i)
00445     {
00446         EntnodeData *data = *i;
00447         TclBrowserAppend((*data)[EntnodeData::kPath], data);
00448     }
00449
00450     CTcl_Interp interp;
00451     CStr path = macroName;
00452     CTcl_Interp::Unixfy(path);
00453     interp.DoScriptVar("source \"%s\"", (const char *)path);
00454
00455     return PyContainer::Void();
00456 }
00457
00458 class CBuffer
00459 {
00460 public:
00461     CBuffer() : m_curSize(0)
00462     {
00463     }
00464
00465     void append(const char *ptr, size_t s)
00466     {
00467         if((s + m_curSize) > m_buf.size())
00468         {
00469             size_t step = s > 1024 ? s : 1024;
00470             m_buf.AdjustSize(m_buf.size() + step);
00471         }
00472 #ifdef WIN32
00473         char *tmp = (char *)m_buf + m_curSize;
00474         size_t incs = 0;
00475         while(s--)
00476         {
00477             char c = *ptr++;
00478             if(c == '\r')
00479                 continue;
00480             *tmp++ = c;
00481             incs++;
00482         }
00483         m_curSize += incs;
00484 #elif defined(macintosh)
00485         char *tmp = (char *)m_buf + m_curSize;
00486         size_t cnt = s;
00487         while(cnt--)
00488         {
00489             char c = *ptr++;
00490             if(c == '\r')
00491                 c = '\n';
00492             *tmp++ = c;
00493         }
00494         m_curSize += s;
00495 #else
00496         memcpy((char *)m_buf + m_curSize, ptr, s * sizeof(char));
00497         m_curSize += s;
00498 #endif
00499     }
00500
00501     inline size_t size() const { return m_curSize; }
00502     inline operator char *(void) const { return m_buf; }
00503
00504 protected:
00505     size_t m_curSize;
00506     CStaticAllocT<char> m_buf;
00507 };
00508
00509 class CPyCvsConsole : public CCvsConsole
00510 {
00511 public:
00512     CPyCvsConsole() {}
00513     virtual ~CPyCvsConsole() {}
00514
00515     virtual long cvs_out(char *txt, long len)
00516     {
00517         m_out.append(txt, len);
00518         return len;
00519     }
00520
00521     virtual long cvs_err(char *txt, long len)
00522     {
00523         m_err.append(txt, len);
00524         return len;
00525     }
00526
00527     CBuffer m_out;
00528     CBuffer m_err;
00529 };
00530
00531 static PyObject *cvsgui_PromptMessage(PyObject *self, PyObject *args)
00532 {
00533     char *msg, *title, *ok, *cncl;
00534
00535     if(!PyArg_ParseTuple(args, "ssss", &msg, &title, &ok, &cncl))
00536         return NULL;
00537
00538     bool res;
00539
00540     TRY
00541     {
00542         res = PromptMessage(msg, title, ok, cncl);
00543     }
00544     CATCH_ALL(e)
00545     {
00546         PyHandleCvsguiError(e);
00547         return NULL;
00548     }
00549     END_CATCH_ALL
00550
00551     if(res)
00552     {
00553         return PyContainer::True();
00554     }
00555
00556     return PyContainer::False();
00557 }
00558
00559 static PyObject *cvsgui_PromptEditMessage(PyObject *self, PyObject *args)
00560 {
00561     char *msg, *title, *ok, *cncl, *edit;
00562
00563     if(!PyArg_ParseTuple(args, "sssss", &msg, &edit, &title, &ok, &cncl))
00564         return NULL;
00565
00566     bool res;
00567     UStr ed;
00568
00569     TRY
00570     {
00571         ed = edit;
00572         res = PromptEditMessage(msg, ed, title, ok, cncl);
00573     }
00574     CATCH_ALL(e)
00575     {
00576         PyHandleCvsguiError(e);
00577         return NULL;
00578     }
00579     END_CATCH_ALL
00580
00581     return Py_BuildValue("(is)", res ? 1 : 0, ed.empty() ? "" : ed.c_str());
00582 }
00583
00584 static PyObject *cvsgui_LaunchBrowser(PyObject *self, PyObject *args)
00585 {
00586     char *url;
00587
00588     if(!PyArg_ParseTuple(args, "s", &url))
00589         return NULL;
00590
00591 #ifdef WIN32
00592     ShellExecute(NULL, "open", url, /*postData*/0L, NULL, SW_SHOWNORMAL);
00593 #endif
00594
00595     return PyContainer::Void();
00596 }
00597
00598 static void outputXML(FILE *out, CLogNode *node)
00599 {
00600     switch(node->GetType())
00601     {
00602         case kNodeHeader :
00603         {
00604             fputs("<RCS>\n", out);
00605             const CRcsFile rcs = **(CLogNodeHeader *)node;
00606             fprintf(out, "<RCSFILE>%s</RCSFILE>\n", rcs.RcsFile().c_str());
00607             fprintf(out, "<WORKINGFILE>%s</WORKINGFILE>\n", rcs.WorkingFile().c_str());
00608             fprintf(out, "<HEADREV>%s</HEADREV>\n", rcs.HeadRev().c_str());
00609             fprintf(out, "<BRANCHREV>%s</BRANCHREV>\n", rcs.BranchRev().c_str());
00610             fprintf(out, "<KEYWORDSUBST>%s</KEYWORDSUBST>\n", rcs.KeywordSubst().c_str());
00611             fprintf(out, "<DESCRIPTION>%s</DESCRIPTION>\n", rcs.DescLog().c_str());
00612             fprintf(out, "<SELREVISIONS>%d</SELREVISIONS>\n", rcs.SelRevisions());
00613             fprintf(out, "<TOTREVISIONS>%d</TOTREVISIONS>\n", rcs.TotRevisions());
00614             fprintf(out, "<LOCKSTRICT>%d</LOCKSTRICT>\n", rcs.LockStrict() ? 1 : 0);
00615
00616             fputs("<ACCESSLIST>\n", out);
00617             const std::vector<CLogStr> & ac = rcs.AccessList();
00618             std::vector<CLogStr>::const_iterator i;
00619             for(i = ac.begin(); i != ac.end(); ++i)
00620             {
00621                 fprintf(out, "<ACCESS>%s</ACCESS>\n", (*i).c_str());
00622             }
00623             fputs("</ACCESSLIST>\n", out);
00624
00625             fputs("<SYMBOLICLIST>\n", out);
00626             const std::vector<CRevNumber> & sy = rcs.SymbolicList();
00627             std::vector<CRevNumber>::const_iterator j;
00628             for(j = sy.begin(); j != sy.end(); ++j)
00629             {
00630                 fprintf(out, "<SYMBOLIC>%s</SYMBOLIC>\n", (*j).c_str());
00631             }
00632             fputs("</SYMBOLICLIST>\n", out);
00633
00634             fputs("<LOCKLIST>\n", out);
00635             const std::vector<CRevNumber> & lo = rcs.LocksList();
00636             for(j = lo.begin(); j != lo.end(); ++j)
00637             {
00638                 fprintf(out, "<LOCK>%s</LOCK>\n", (*j).c_str());
00639             }
00640             fputs("</LOCKLIST>\n", out);
00641             break;
00642         }
00643         case kNodeRev :
00644         {
00645             const CRevFile & rev = **(CLogNodeRev *)node;
00646             fputs("<REVISION>\n", out);
00647             fprintf(out, "<NUMBER>%s</NUMBER>\n", rev.RevNum().c_str());
00648             const struct tm & tm = rev.RevTime();
00649             fprintf(out, "<DATE>%d/%d/%d %d:%d:%d</DATE>\n", (tm.tm_year + 1900),
00650                 tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
00651             fprintf(out, "<AUTHOR>%s</AUTHOR>\n", rev.Author().c_str());
00652             fprintf(out, "<STATE>%s</STATE>\n", rev.State().c_str());
00653             fprintf(out, "<CHANGES>+%d%d</CHANGES>\n", rev.ChgPos(), rev.ChgNeg());
00654             fprintf(out, "<DESCRIPTION>%s</DESCRIPTION>\n", rev.DescLog().c_str());
00655
00656             fputs("<BRANCHLIST>\n", out);
00657             const std::vector<CRevNumber> & sy = rev.BranchesList();
00658             std::vector<CRevNumber>::const_iterator j;
00659             for(j = sy.begin(); j != sy.end(); ++j)
00660             {
00661                 fprintf(out, "<REVBRANCH>%s</REVBRANCH>\n", (*j).c_str());
00662             }
00663             fputs("</BRANCHLIST>\n", out);
00664             break;
00665         }
00666         case kNodeBranch :
00667         {
00668             fputs("<BRANCH>\n", out);
00669             const CLogStr & branch = **(CLogNodeBranch *)node;
00670             fprintf(out, "<BRANCHNAME>%s</BRANCHNAME>\n", branch.c_str());
00671             break;
00672         }
00673         case kNodeTag :
00674         {
00675             fputs("<TAG>\n", out);
00676             const CLogStr & tag = **(CLogNodeTag *)node;
00677             fprintf(out, "<TAGNAME>%s</TAGNAME>\n", tag.c_str());
00678             break;
00679         }
00680     }
00681
00682     if(node->Childs().size() > 0)
00683     {
00684         fputs("<REVISIONS>\n", out);
00685         std::vector<CLogNode *>::const_iterator i;
00686         for(i = node->Childs().begin(); i != node->Childs().end(); ++i)
00687         {
00688             outputXML(out, *i);
00689         }
00690         fputs("</REVISIONS>\n", out);
00691     }
00692
00693     switch(node->GetType())
00694     {
00695         case kNodeHeader :
00696             fputs("</RCS>\n", out);
00697             break;
00698         case kNodeRev :
00699             fputs("</REVISION>\n", out);
00700             break;
00701         case kNodeBranch :
00702             fputs("</BRANCH>\n", out);
00703             break;
00704         case kNodeTag :
00705             fputs("</TAG>\n", out);
00706             break;
00707     }
00708
00709     if(node->Next() != 0L)
00710     {
00711         outputXML(out, node->Next());
00712     }
00713 }
00714
00715 static PyObject *cvsgui_GetHistoryAsXML(PyObject *self, PyObject *args)
00716 {
00717     PyObject *logfile, *xmlfile;
00718
00719     if(!PyArg_ParseTuple(args, "O!O!", GetPyFile_Type(), &logfile,
00720         GetPyFile_Type(), &xmlfile))
00721             return NULL;
00722
00723     TRY
00724     {
00725         std::vector<CRcsFile> & allRcs = CvsLogParse(PyFile_AsFile(logfile));
00726
00727         std::vector<CRcsFile>::iterator i;
00728         FILE *xml = PyFile_AsFile(xmlfile);
00729         fputs("<ROOT>\n", xml);
00730         for(i = allRcs.begin(); i != allRcs.end(); ++i)
00731         {
00732             std::auto_ptr<CLogNode> node(CvsLogGraph(*i));
00733             outputXML(xml, node.get());
00734         }
00735         fputs("</ROOT>\n", xml);
00736
00737         CvsLogReset();
00738     }
00739     CATCH_ALL(e)
00740     {
00741         PyHandleCvsguiError(e);
00742         return NULL;
00743     }
00744     END_CATCH_ALL
00745
00746     return PyContainer::Void();
00747 }
00748
00749 static PyObject *cvsgui_RunCvs(PyObject *self, PyObject *args)
00750 {
00751     CvsArgs arg;
00752     PyObject *cargs;
00753     int exitOnError = 1;
00754     int exitc;
00755     CPyCvsConsole console;
00756
00757     if(!PyArg_ParseTuple(args, "O!|i", GetPyTuple_Type(), &cargs, &exitOnError))
00758         return NULL;
00759
00760     TRY
00761     {
00762         int argc = PyTuple_Size(cargs);
00763         for(int i = 0; i < argc; i++)
00764         {
00765             PyObject *o = PyTuple_GET_ITEM(cargs, i);
00766             if(!PyString_Check(o))
00767             {
00768                 PyErr_SetString(gCvsguiErr, "Wrong argument type, should be string");
00769                 return NULL;
00770             }
00771
00772             arg.add(PyString_AsString(o));
00773         }
00774
00775         exitc = launchCVS(0L, arg.Argc(), arg.Argv(), &console);
00776
00777         if(exitOnError && exitc != 0)
00778         {
00779             UStr str;
00780             str.set(console.m_err, console.m_err.size());
00781             str << "cvs returned an non-zero error code (";
00782             str << exitc;
00783             str << ")\n";
00784             PyErr_SetString(gCvsguiErr, str);
00785             return NULL;
00786         }
00787     }
00788     CATCH_ALL(e)
00789     {
00790         PyHandleCvsguiError(e);
00791         return NULL;
00792     }
00793     END_CATCH_ALL
00794
00795     return Py_BuildValue("(is#s#)", exitc, (char *)console.m_out, console.m_out.size(),
00796         (char *)console.m_err, console.m_err.size());
00797 }
00798
00799 static PyMethodDef cvsgui_methods[] =
00800 {
00801     {"write", (PyCFunction)cvsgui_write, METH_VARARGS, ""},
00802     {"GetMainMenuWidget", (PyCFunction)cvsgui_GetMainMenuWidget, METH_VARARGS, ""},
00803     {"GetTopMacroSelectionMenu", (PyCFunction)cvsgui_GetTopMacroSelectionMenu, METH_VARARGS, ""},
00804     {"GetTopMacroAdminMenu", (PyCFunction)cvsgui_GetTopMacroAdminMenu, METH_VARARGS, ""},
00805     {"GetSelection", (PyCFunction)cvsgui_GetSelection, METH_VARARGS, ""},
00806     {"GetCvsEntries", (PyCFunction)cvsgui_GetCvsEntries, METH_VARARGS, ""},
00807 #if defined(WIN32)
00808     {"GetFileModTime", (PyCFunction)cvsgui_GetFileModTime, METH_VARARGS, ""},
00809 #endif
00810     {"LaunchTclMacro", (PyCFunction)cvsgui_LaunchTclMacro, METH_VARARGS, ""},
00811     {"RunCvs", (PyCFunction)cvsgui_RunCvs, METH_VARARGS, ""},
00812     {"PromptMessage", (PyCFunction)cvsgui_PromptMessage, METH_VARARGS, ""},
00813     {"PromptEditMessage", (PyCFunction)cvsgui_PromptEditMessage, METH_VARARGS, ""},
00814     {"LaunchBrowser", (PyCFunction)cvsgui_LaunchBrowser, METH_VARARGS, ""},
00815     {"GetHistoryAsXML", (PyCFunction)cvsgui_GetHistoryAsXML, METH_VARARGS, ""},
00816     {NULL, NULL}
00817 };
00818
00819 static std::vector<PyMethodDef> gAllMethods;
00820
00821 static void InitializeInterp(PyThreadState *interp)
00822 {
00823     CPyThreadState lock(interp);
00824
00825     // first time, create the method table for cvsgui module
00826     if(gAllMethods.empty())
00827     {
00828         PyMethodDef *tmp = cvsgui_methods;
00829         while(tmp->ml_name)
00830         {
00831             gAllMethods.push_back(*tmp);
00832             tmp++;
00833         }
00834
00835         PyRegistry::RegisterAllObjects(gAllMethods);
00836     }
00837
00838     // this module contains the glue code functions
00839     PyObject *m = Py_InitModule4("_cvsgui", &gAllMethods[0],
00840         "The cvsgui glue functions", (PyObject*)NULL,PYTHON_API_VERSION);
00841
00842     if(m == NULL)
00843     {
00844         cvs_err("Could not create the Python cvsgui module !\n");
00845         return;
00846     }
00847
00848     // this is the exception we raised when the error comes from us
00849     PyObject *d = PyModule_GetDict(m);
00850     if(gCvsguiErr == NULL)
00851         gCvsguiErr = PyErr_NewException("_cvsgui.error", NULL, NULL);
00852     if (gCvsguiErr != NULL)
00853         PyDict_SetItemString(d, "error", gCvsguiErr);
00854
00855     PyRegistry::CallInitValues(d);
00856
00857     // Ideally we need to use Jonathan's mechanism
00858     PyObject *ver = PyString_FromString("1.3");
00859     if (ver != NULL) {
00860         PyDict_SetItemString(d, "CVSGUI_VERSION", ver);
00861         Py_DECREF(ver);
00862     }
00863
00864     char *script = NULL;
00865
00866 #ifdef WIN32
00867     HINSTANCE hInst = ::AfxGetInstanceHandle();
00868     HRSRC rsrc = FindResource(hInst, "PYSHELL", "PYSCRIPT");
00869
00870     if(rsrc)
00871     {
00872         HGLOBAL h = LoadResource(hInst, rsrc);
00873         if(h)
00874         {
00875             DWORD size = SizeofResource(hInst, rsrc);
00876             script = (char *)malloc(size + 1);
00877             char *ptr = (char *)LockResource(h);
00878
00879             if(script)
00880             {
00881                 char *tmp = script;
00882                 while(size--)
00883                 {
00884                     char c = *ptr++;
00885                     if(c == '\r')
00886                         continue;
00887                     *tmp++ = c;
00888                 }
00889                 *tmp = '\0';
00890             }
00891
00892             FreeResource(h);
00893         }
00894     }
00895
00896 #endif // WIN32
00897 #if qMacCvsPP
00898     StResource rsrcH(FOUR_CHAR_CODE('PYTH'), 128);
00899     size_t size = GetHandleSize(rsrcH);
00900     script = (char *)malloc(size + 1);
00901     if(script)
00902     {
00903         char *ptr = (char *)*rsrcH;
00904         char *tmp = script;
00905         while(size--)
00906         {
00907             char c = *ptr++;
00908             if(c == '\r')
00909                 c = '\n';
00910             *tmp++ = c;
00911         }
00912         *tmp = '\0';
00913     }
00914 #endif
00915
00916     // augment the library path of python with our library
00917     CStr ourLibPath;
00918     PythonLibGetLoc(ourLibPath);
00919
00920     UStr libPath = Py_GetPath();
00921     if(!ourLibPath.empty())
00922     {
00923         libPath << DELIM;
00924         libPath << ourLibPath;
00925         PySys_SetPath((char *)(const char *)libPath);
00926     }
00927
00928     // this is the script to setup stdout/stderr and reroute it
00929     // to the console window
00930     if(script)
00931     {
00932         PyRun_SimpleString(script);
00933
00934         free(script);
00935     }
00936     else
00937     {
00938         cvs_err("Could not initialize properly the Python interpreter !\n");
00939     }
00940 }
00941 #endif // USE_PYTHON
00942
00943 CPython_Interp::CPython_Interp(bool mainInterp)
00944 {
00945     fInterp = 0L;
00946
00947 #if USE_PYTHON
00948     if(!CPython_Interp::IsAvail())
00949     {
00950         cvs_err("Python is not available !\n");
00951         return;
00952     }
00953
00954     if(mainInterp)
00955     {
00956         fInterp = m_mainInterpreter;
00957         gCvsPrefs.SetTclFileRunning(true);
00958         return;
00959     }
00960
00961     {
00962         CPyThreadState lock(0L);
00963
00964         fInterp = Py_NewInterpreter();
00965         if(fInterp == NULL)
00966             return;
00967     }
00968
00969     InitializeInterp(fInterp);
00970     gCvsPrefs.SetTclFileRunning(true);
00971 #endif
00972 }
00973
00974 CPython_Interp::~CPython_Interp()
00975 {
00976 #if USE_PYTHON
00977     if(fInterp != 0L)
00978     {
00979         gCvsPrefs.SetTclFileRunning(false);
00980
00981         if(fInterp != m_mainInterpreter)
00982         {
00983             CPyThreadState lock(fInterp);
00984
00985             Py_EndInterpreter(fInterp);
00986         }
00987     }
00988 #endif
00989 }
00990
00991 bool CPython_Interp::IsAvail(void)
00992 {
00993 #if USE_PYTHON
00994 #   if qMacCvsPP
00995     return PyThreadState_Swap != 0L;
00996 #   elif defined(WIN32) && !qCvsDebug /* || qCarbon */
00997     static bool firstTime = true;
00998     static bool pyAvail = false;
00999     if(firstTime)
01000     {
01001 #   if defined(WIN32) || qCarbon
01002         CompatConnectID connID;
01003 #   endif
01004
01005 #   ifdef WIN32
01006         if(!pyAvail)
01007             pyAvail = CompatLoadLibrary(&connID, "python21.dll") != 0 ||
01008                 CompatLoadLibrary(&connID, "python22.dll") != 0;
01009 #   endif
01010
01011 #   if qCarbon
01012         if (UEnvironment::GetOSVersion() >= 0x1000)
01013             pyAvail = CompatLoadLibrary(&connID, "/System/Library/Frameworks/Tcl.framework");
01014         else
01015             pyAvail = CompatLoadLibrary(&connID, "tcl8.3");
01016 #   endif
01017
01018 #   if defined(WIN32) || qCarbon
01019 #   define LOAD_CODEFRAG(name) \
01020         if(pyAvail) \
01021             pyAvail = (*(void **)&name##_glue = \
01022                 _CompatCallLibrary(connID, #name)) != 0L
01023 #   endif
01024 #   if defined(WIN32) || TARGET_API_MAC_CARBON
01025         LOAD_CODEFRAG(PyThreadState_Swap);
01026         LOAD_CODEFRAG(PyDict_SetItemString);
01027         LOAD_CODEFRAG(PyErr_Clear);
01028         LOAD_CODEFRAG(PyInt_FromLong);
01029         LOAD_CODEFRAG(PyErr_SetString);
01030         LOAD_CODEFRAG(PyArg_ParseTuple);
01031         LOAD_CODEFRAG(PyTuple_New);
01032         LOAD_CODEFRAG(Py_BuildValue);
01033         LOAD_CODEFRAG(PyFile_AsFile);
01034         LOAD_CODEFRAG(PyString_AsString);
01035         LOAD_CODEFRAG(PyTuple_Size);
01036         LOAD_CODEFRAG(PyRun_SimpleString);
01037         LOAD_CODEFRAG(PyRun_SimpleFile);
01038         LOAD_CODEFRAG(Py_SetProgramName);
01039         LOAD_CODEFRAG(Py_Initialize);
01040         LOAD_CODEFRAG(Py_Finalize);
01041         LOAD_CODEFRAG(Py_IsInitialized);
01042         LOAD_CODEFRAG(Py_NewInterpreter);
01043         LOAD_CODEFRAG(Py_EndInterpreter);
01044         LOAD_CODEFRAG(PyString_FromString);
01045         LOAD_CODEFRAG(PyErr_NewException);
01046         LOAD_CODEFRAG(PyModule_GetDict);
01047         LOAD_CODEFRAG(Py_InitModule4);
01048         LOAD_CODEFRAG(PyEval_InitThreads);
01049         LOAD_CODEFRAG(Py_FindMethod);
01050         LOAD_CODEFRAG(_PyObject_New);
01051         LOAD_CODEFRAG(_PyObject_Del);
01052         LOAD_CODEFRAG(PySys_SetPath);
01053         LOAD_CODEFRAG(Py_GetPath);
01054
01055         LOAD_CODEFRAG(PyType_Type);
01056         LOAD_CODEFRAG(PyFile_Type);
01057         LOAD_CODEFRAG(PyString_Type);
01058         LOAD_CODEFRAG(PyTuple_Type);
01059         LOAD_CODEFRAG(PyInt_Type);
01060         LOAD_CODEFRAG(_Py_NoneStruct);
01061         LOAD_CODEFRAG(_Py_ZeroStruct);
01062         LOAD_CODEFRAG(_Py_TrueStruct);
01063
01064         if(!pyAvail)
01065         {
01066             WarnNoPython();
01067         }
01068 #   endif /* WIN32 */
01069
01070         firstTime = false;
01071     }
01072
01073     return pyAvail;
01074 #   else
01075     return true;
01076 #   endif
01077 #else // !USE_PYTHON
01078     return false;
01079 #endif // !USE_PYTHON
01080 }
01081
01082 int CPython_Interp::DoScript(const char *script)
01083 {
01084 #if USE_PYTHON
01085     if(fInterp == 0L)
01086         return -1;
01087
01088     CPyThreadState lock(fInterp);
01089
01090     PyRun_SimpleString((char *)script);
01091
01092     return 0;
01093 #else
01094     return -1;
01095 #endif
01096 }
01097
01098 int CPython_Interp::DoScriptVar(const char *format, ...)
01099 {
01100 #if USE_PYTHON
01101     if(fInterp == 0L)
01102         return -1;
01103
01104     va_list args;
01105     char script[1024] = {'\0'};
01106
01107     va_start (args, format);
01108     vsprintf (script, format, args);
01109     va_end (args);
01110
01111     return DoScript(script);
01112 #else
01113     return -1;
01114 #endif
01115 }
01116
01117 int CPython_Interp::DoFile(const char *file)
01118 {
01119 #if USE_PYTHON
01120     if(fInterp == 0L)
01121         return -1;
01122
01123     CPyThreadState lock(fInterp);
01124
01125     FILE *f = fopen(file, "r");
01126     if(f)
01127     {
01128         PyRun_SimpleFile(f, (char *)file);
01129         fclose(f);
01130     }
01131
01132     return 0;
01133 #else
01134     return -1;
01135 #endif
01136 }
01137
01138 #if qMacCvsPP
01139     // work around for a bug of Python 2.2 which draws the
01140     // Sioux menu even though we have a custom console
01141 extern int console_output_state;
01142 #endif
01143
01144 void CPython_Interp::InitPythonSupport(void)
01145 {
01146 #if USE_PYTHON
01147     if(!CPython_Interp::IsAvail())
01148         return;
01149
01150 #ifdef WIN32
01151     Py_SetProgramName("wincvs");
01152     Py_Initialize();
01153 #elif qMacCvsPP
01154     console_output_state = 1;
01155
01156     PyMac_SetConsoleHandler(PyMac_DummyReadHandler, PyMac_DummyWriteHandler,
01157         PyMac_DummyWriteHandler);
01158
01159     PyMacSchedParams scp;
01160
01161     PyMac_GetSchedParams(&scp);
01162     scp.process_events = 0;
01163     PyMac_SetSchedParams(&scp);
01164
01165     Py_SetProgramName("maccvs");
01166     PyMac_Initialize();
01167 #else
01168     Py_SetProgramName("gcvs");
01169     Py_Initialize();
01170 #endif
01171
01172     PyEval_InitThreads();
01173     m_mainInterpreter = PyThreadState_Swap(NULL);
01174
01175     InitializeInterp(m_mainInterpreter);
01176 #endif
01177 }
01178
01179 void CPython_Interp::ClosePythonSupport(void)
01180 {
01181 #if USE_PYTHON
01182     if(!CPython_Interp::IsAvail())
01183         return;
01184
01185     PyThreadState_Swap(m_mainInterpreter);
01186 //  PyEval_ReleaseLock();
01187
01188     PyInvalUICache();
01189
01190     Py_Finalize();
01191     m_mainInterpreter = 0L;
01192 #endif
01193 }
01194
01195 void PyMacrosReloadAll(void)
01196 {
01197     // get the macro folder
01198     UStr path;
01199     MacrosGetLoc(path);
01200
01201 #ifdef WIN32
01202     CString newpath(path);
01203     newpath.Replace("\\", "\\\\");
01204     path = newpath;
01205 #endif
01206
01207     CPython_Interp interp;
01208     interp.DoScriptVar("from cvsgui.MacroRegistry import *; "
01209         "gMacroRegistry.LoadMacros(\"%s\")", (char *)path.c_str());;
01210 }
01211
01212 void PyDoCmdUI(UCmdUI *ucmdui)
01213 {
01214     CPython_Interp interp;
01215     interp.DoScriptVar("from cvsgui.MacroRegistry import *; "
01216         "from cvsgui.CmdUI import *; "
01217         "gMacroRegistry.DoCmdUI(CmdUI(%d), %d)", (long)ucmdui, ucmdui->m_nID);
01218 }
01219
01220 void PyDoPython(int cmd)
01221 {
01222     CPython_Interp interp;
01223     interp.DoScriptVar("from cvsgui.MacroRegistry import *; "
01224         "gMacroRegistry.DoCmd(%d)", cmd);
01225 }
01226
01227 bool PyIsUICacheValid()
01228 {
01229 #if USE_PYTHON
01230     return gUICacheValid;
01231 #else
01232     return false;
01233 #endif
01234 }
01235
01236 void PyValidUICache()
01237 {
01238 #if USE_PYTHON
01239     gUICacheValid = true;
01240 #endif
01241 }
01242
01243 void PyInvalUICache()
01244 {
01245 #if USE_PYTHON
01246     gUICache.erase(gUICache.begin(), gUICache.end());
01247     gUICacheValid = false;
01248     Py_XDECREF(gUICacheObj);
01249     gUICacheObj = 0L;
01250 #endif
01251 }
01252
01253 void PyAppendCache(EntnodeData *data)
01254 {
01255 #if USE_PYTHON
01256     Py_XDECREF(gUICacheObj);
01257     gUICacheObj = 0L;
01258     gUICache.push_back(ENTNODE(data));
01259     gUICacheValid = true;
01260 #endif
01261 }
Generated on Sun Feb 24 01:21:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/PythonGlue.h Source File

common/PythonGlue.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- August 2001
00019  */
00020
00021 /*
00022  * PythonGlue.h --- glue to the Python language
00023  */
00024
00025 #ifndef PYTHONGLUE_H
00026 #define PYTHONGLUE_H
00027
00028 class UCmdUI;
00029 class EntnodeData;
00030 typedef struct _ts PyThreadState;
00031
00032 class CPython_Interp
00033 {
00034 public:
00035     CPython_Interp(bool mainInterp = true);
00036     ~CPython_Interp();
00037
00038     static bool IsAvail(void);
00039         // tells if Python is available
00040
00041     int DoScriptVar(const char *format, ...);
00042     int DoScript(const char *script);
00043     int DoFile(const char *file);
00044         // execute a Python script, returns false on error
00045
00046     static void InitPythonSupport(void);
00047     static void ClosePythonSupport(void);
00048
00049     inline operator PyThreadState *(void) {return fInterp;}
00050
00051 protected:
00052     PyThreadState *fInterp;
00053
00054     static PyThreadState *m_mainInterpreter;
00055 };
00056
00057 void PyMacrosReloadAll(void);
00058     // reload the available macros
00059
00060 void PyDoCmdUI(UCmdUI *ucmdui);
00061     // update a menu state (call python)
00062
00063 void PyDoPython(int cmd);
00064     // call python because a command has been trigerred (by the menu or an icon)
00065
00066 bool PyIsUICacheValid();
00067 void PyValidUICache();
00068 void PyInvalUICache();
00069 void PyAppendCache(EntnodeData *data);
00070     // call for Python to invalidate selection cache (the current selection
00071     // in the file and folder browser)
00072
00073 #endif /* PYTHONGLUE_H */
Generated on Sun Feb 24 01:21:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/PythonGlue.impl.h Source File

common/PythonGlue.impl.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- October 2001
00019  */
00020
00021 /*
00022  * PythonGlue.impl.h --- wrappers to the Python library
00023  */
00024
00025 #ifndef PYTHONGLUE_IMPL_H
00026 #define PYTHONGLUE_IMPL_H
00027
00028 #ifndef PYTHONGLUE_EXTERN
00029 #   define PYTHONGLUE_EXTERN extern
00030 #endif
00031
00032 #if defined(WIN32) && !qCvsDebug /* || qCarbon */
00033 #   define DEC_GLUE(f) (*f##_glue)
00034 #   define VAR_GLUE(f) f##_glue
00035
00036     PYTHONGLUE_EXTERN PyThreadState * DEC_GLUE(PyThreadState_Swap) (PyThreadState *);
00037     PYTHONGLUE_EXTERN int DEC_GLUE(PyDict_SetItemString) (PyObject *dp, char *key, PyObject *item);
00038     PYTHONGLUE_EXTERN void  DEC_GLUE(PyErr_Clear) (void);
00039     PYTHONGLUE_EXTERN PyObject * DEC_GLUE(PyInt_FromLong) (long);
00040     PYTHONGLUE_EXTERN void DEC_GLUE(PyErr_SetString) (PyObject *, const char *);
00041     PYTHONGLUE_EXTERN int DEC_GLUE(PyArg_ParseTuple) (PyObject *, char *, ...);
00042     PYTHONGLUE_EXTERN PyObject * DEC_GLUE(PyTuple_New) (int size);
00043     PYTHONGLUE_EXTERN PyObject * DEC_GLUE(Py_BuildValue) (char *, ...);
00044     PYTHONGLUE_EXTERN FILE * DEC_GLUE(PyFile_AsFile) (PyObject *);
00045     PYTHONGLUE_EXTERN char * DEC_GLUE(PyString_AsString) (PyObject *);
00046     PYTHONGLUE_EXTERN int DEC_GLUE(PyTuple_Size) (PyObject *);
00047     PYTHONGLUE_EXTERN int DEC_GLUE(PyRun_SimpleString) (char *);
00048     PYTHONGLUE_EXTERN int DEC_GLUE(PyRun_SimpleFile) (FILE *, char *);
00049     PYTHONGLUE_EXTERN void DEC_GLUE(Py_SetProgramName) (char *);
00050     PYTHONGLUE_EXTERN void DEC_GLUE(Py_Initialize) (void);
00051     PYTHONGLUE_EXTERN void DEC_GLUE(Py_Finalize) (void);
00052     PYTHONGLUE_EXTERN int DEC_GLUE(Py_IsInitialized) (void);
00053     PYTHONGLUE_EXTERN PyThreadState * DEC_GLUE(Py_NewInterpreter) (void);
00054     PYTHONGLUE_EXTERN void DEC_GLUE(Py_EndInterpreter) (PyThreadState *);
00055     PYTHONGLUE_EXTERN PyObject * DEC_GLUE(PyString_FromString) (const char *);
00056     PYTHONGLUE_EXTERN PyObject * DEC_GLUE(PyErr_NewException) (char *name, PyObject *base, PyObject *dict);
00057     PYTHONGLUE_EXTERN PyObject * DEC_GLUE(PyModule_GetDict) (PyObject *);
00058     PYTHONGLUE_EXTERN PyObject * DEC_GLUE(Py_InitModule4) (char *name, PyMethodDef *methods, char *doc, PyObject *self, int apiver);
00059     PYTHONGLUE_EXTERN void DEC_GLUE(PyEval_InitThreads) (void);
00060     PYTHONGLUE_EXTERN PyObject * DEC_GLUE(Py_FindMethod) (PyMethodDef[], PyObject *, char *);
00061     PYTHONGLUE_EXTERN PyObject * DEC_GLUE(_PyObject_New) (PyTypeObject *);
00062     PYTHONGLUE_EXTERN void DEC_GLUE(_PyObject_Del) (PyObject *);
00063     PYTHONGLUE_EXTERN void DEC_GLUE(PySys_SetPath) (char *);
00064     PYTHONGLUE_EXTERN char * DEC_GLUE(Py_GetPath) (void);
00065
00066     PYTHONGLUE_EXTERN PyTypeObject * VAR_GLUE(PyType_Type);
00067     PYTHONGLUE_EXTERN PyTypeObject * VAR_GLUE(PyFile_Type);
00068     PYTHONGLUE_EXTERN PyTypeObject * VAR_GLUE(PyString_Type);
00069     PYTHONGLUE_EXTERN PyTypeObject * VAR_GLUE(PyTuple_Type);
00070     PYTHONGLUE_EXTERN PyTypeObject * VAR_GLUE(PyInt_Type);
00071     PYTHONGLUE_EXTERN PyObject * VAR_GLUE(_Py_NoneStruct);
00072     PYTHONGLUE_EXTERN PyObject * VAR_GLUE(_Py_ZeroStruct);
00073     PYTHONGLUE_EXTERN PyObject * VAR_GLUE(_Py_TrueStruct);
00074
00075 #   define GLUE_WRAP(f) f##_glue
00076
00077 #   define PyThreadState_Swap GLUE_WRAP(PyThreadState_Swap)
00078 #   define PyDict_SetItemString GLUE_WRAP(PyDict_SetItemString)
00079 #   define PyErr_Clear GLUE_WRAP(PyErr_Clear)
00080 #   define PyInt_FromLong GLUE_WRAP(PyInt_FromLong)
00081 #   define PyErr_SetString GLUE_WRAP(PyErr_SetString)
00082 #   define PyArg_ParseTuple GLUE_WRAP(PyArg_ParseTuple)
00083 #   define PyTuple_New GLUE_WRAP(PyTuple_New)
00084 #   define Py_BuildValue GLUE_WRAP(Py_BuildValue)
00085 #   define PyFile_AsFile GLUE_WRAP(PyFile_AsFile)
00086 #   define PyString_AsString GLUE_WRAP(PyString_AsString)
00087 #   define PyTuple_Size GLUE_WRAP(PyTuple_Size)
00088 #   define PyRun_SimpleString GLUE_WRAP(PyRun_SimpleString)
00089 #   define PyRun_SimpleFile GLUE_WRAP(PyRun_SimpleFile)
00090 #   define Py_SetProgramName GLUE_WRAP(Py_SetProgramName)
00091 #   define Py_Initialize GLUE_WRAP(Py_Initialize)
00092 #   define Py_Finalize GLUE_WRAP(Py_Finalize)
00093 #   define Py_IsInitialized GLUE_WRAP(Py_IsInitialized)
00094 #   define Py_NewInterpreter GLUE_WRAP(Py_NewInterpreter)
00095 #   define Py_EndInterpreter GLUE_WRAP(Py_EndInterpreter)
00096 #   define PyString_FromString GLUE_WRAP(PyString_FromString)
00097 #   define PyErr_NewException GLUE_WRAP(PyErr_NewException)
00098 #   define PyModule_GetDict GLUE_WRAP(PyModule_GetDict)
00099 #   define Py_InitModule4 GLUE_WRAP(Py_InitModule4)
00100 #   define PyEval_InitThreads GLUE_WRAP(PyEval_InitThreads)
00101 #   define Py_FindMethod GLUE_WRAP(Py_FindMethod)
00102 #   define _PyObject_New GLUE_WRAP(_PyObject_New)
00103 #   define _PyObject_Del GLUE_WRAP(_PyObject_Del)
00104 #   define PySys_SetPath GLUE_WRAP(PySys_SetPath)
00105 #   define Py_GetPath GLUE_WRAP(Py_GetPath)
00106
00107     extern PyTypeObject *GetPyType_Type();
00108     extern PyTypeObject *GetPyFile_Type();
00109     extern PyTypeObject *GetPyString_Type();
00110     extern PyTypeObject *GetPyTuple_Type();
00111     extern PyTypeObject *GetPyInt_Type();
00112     extern PyObject *GetPyNone();
00113     extern PyObject *GetPyTrue();
00114     extern PyObject *GetPyFalse();
00115
00116 #   undef PyString_Check
00117 #   define PyString_Check(op) ((op)->ob_type == GetPyString_Type())
00118 #   undef PyTuple_Check
00119 #   define PyTuple_Check(op) ((op)->ob_type == GetPyTuple_Type())
00120 #   undef PyInt_Check
00121 #   define PyInt_Check(op) ((op)->ob_type == GetPyInt_Type())
00122
00123 #else /* !WIN32 || qCvsDebug */
00124     inline PyTypeObject *GetPyType_Type() { return &PyType_Type; }
00125     inline PyTypeObject *GetPyFile_Type() { return &PyFile_Type; }
00126     inline PyTypeObject *GetPyString_Type() { return &PyString_Type; }
00127     inline PyTypeObject *GetPyTuple_Type() { return &PyTuple_Type; }
00128     inline PyTypeObject *GetPyInt_Type() { return &PyInt_Type; }
00129     inline PyObject *GetPyNone() { return Py_None; }
00130     inline PyObject *GetPyTrue() { return Py_True; }
00131     inline PyObject *GetPyFalse() { return Py_False; }
00132 #endif /* !WIN32 || qCvsDebug */
00133
00134 #endif /* PYTHONGLUE_IMPL_H */
Generated on Sun Feb 24 01:21:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/PythonImpl.cpp Source File

common/PythonImpl.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- September 2001
00019  */
00020
00021 #include "stdafx.h"
00022
00023 #include "PythonImpl.h"
00024 #include "CvsPrefs.h"
00025 #include "umenu.h"
00026
00027 #if USE_PYTHON
00028
00029 PY_IMPL_CLASS(CvsEntry, "Class for an entry in CVS/Entries")
00030
00031 PY_BEGIN_IMPL_METHOD(CvsEntry)
00032 PY_END_IMPL_METHOD
00033
00034 PyObject *PyCvsEntry::Create(PyObject *selfptr, PyObject *args)
00035 {
00036     if (!PyArg_ParseTuple(args, ":CCvsEntry"))
00037         return NULL;
00038
00039     PyAutoObject<PyCvsEntry::obj_t> self = PyCvsEntry::New();
00040     if (!self.IsValid())
00041         return NULL;
00042
00043     TRY
00044     {
00045         self->m_object = new PyCvsEntry(0L);
00046     }
00047     CATCH_ALL(e)
00048     {
00049         PyHandleCvsguiError(e);
00050         return NULL;
00051     }
00052     END_CATCH_ALL
00053
00054     return self.CopyReturn();
00055 }
00056
00057 void PyCvsEntry::InitValues(PyObject *d)
00058 {
00059 }
00060
00061 PyObject *PyCvsEntry::GetAttr(char *name)
00062 {
00063     UStr buf;
00064     EntnodeData *data = m_data;
00065
00066     if(strcmp(name, "name") == 0)
00067         return PyString_FromString(data->GetName());
00068     else if(strcmp(name, "fullname") == 0)
00069         return PyString_FromString(data->GetFullPathName(buf));
00070     else if(strcmp(name, "version") == 0)
00071     {
00072         const char *str = (*data)[EntnodeFile::kVN];
00073         return PyString_FromString(str ? str : "");
00074     }
00075     else if(strcmp(name, "timeutc") == 0)
00076     {
00077         const char *str = (*data)[EntnodeFile::kTS];
00078         return PyString_FromString(str ? str : "");
00079     }
00080     else if(strcmp(name, "keyword") == 0)
00081     {
00082         const char *str = (*data)[EntnodeFile::kOption];
00083         return PyString_FromString(str ? str : "");
00084     }
00085     else if(strcmp(name, "tag") == 0)
00086     {
00087         const char *str = (*data)[EntnodeFile::kTag];
00088         return PyString_FromString(str ? str : "");
00089     }
00090     else if(strcmp(name, "isfile") == 0)
00091         return data->GetType() == ENT_FILE ? True() : False();
00092     else if(strcmp(name, "modified") == 0)
00093         return data->IsUnmodified() ? False() : True();
00094     else if(strcmp(name, "missing") == 0)
00095         return data->IsMissing() ? True() : False();
00096     else if(strcmp(name, "unknown") == 0)
00097         return data->IsUnknown() ? True() : False();
00098     else if(strcmp(name, "ignored") == 0)
00099         return data->IsIgnored() ? True() : False();
00100     else if(strcmp(name, "readonly") == 0)
00101         return data->IsLocked() ? True() : False();
00102     else if(strcmp(name, "removed") == 0)
00103         return data->IsRemoved() ? True() : False();
00104     else if(strcmp(name, "added") == 0)
00105     {
00106         const char* vn = (*data)[EntnodeFile::kVN];
00107         bool isAdded = vn && (strcmp(vn, "0") == 0);
00108         return isAdded ? True() : False();
00109     }
00110     else if(strcmp(name, "desc") == 0)
00111         return PyString_FromString(data->GetDesc() ? data->GetDesc() : "");
00112     else if(strcmp(name, "conflict") == 0)
00113         return PyString_FromString(data->GetConflict() ? data->GetConflict() : "");
00114
00115     return NULL;
00116 }
00117
00118 PY_IMPL_CLASS(ColorConsole, "Class printing in color in the console")
00119
00120 PY_BEGIN_IMPL_METHOD(ColorConsole)
00121     PY_IMPL_METHOD(ColorConsole, Print, "Print in color")
00122 PY_END_IMPL_METHOD
00123
00124 PyObject *PyColorConsole::Create(PyObject *selfptr, PyObject *args)
00125 {
00126     if (!PyArg_ParseTuple(args, ":CColorConsole"))
00127         return NULL;
00128
00129     PyAutoObject<PyColorConsole::obj_t> self = PyColorConsole::New();
00130     if (!self.IsValid())
00131         return NULL;
00132
00133     TRY
00134     {
00135         self->m_object = new PyColorConsole();
00136     }
00137     CATCH_ALL(e)
00138     {
00139         PyHandleCvsguiError(e);
00140         return NULL;
00141     }
00142     END_CATCH_ALL
00143
00144     return self.CopyReturn();
00145 }
00146
00147
00148 void PyColorConsole::InitValues(PyObject *d)
00149 {
00150     RegisterValue(d, "kNormal", kNormal);
00151     RegisterValue(d, "kBrown", kBrown);
00152     RegisterValue(d, "kGreen", kGreen);
00153     RegisterValue(d, "kMagenta", kMagenta);
00154     RegisterValue(d, "kRed", kRed);
00155     RegisterValue(d, "kBlue", kBlue);
00156     RegisterValue(d, "kBold", kBold);
00157     RegisterValue(d, "kItalic", kItalic);
00158     RegisterValue(d, "kUnderline", kUnderline);
00159     RegisterValue(d, "kNL", kNL);
00160 }
00161
00162 PyObject *PyColorConsole::Print(PyObject *args)
00163 {
00164     int style;
00165
00166     if(PyArg_ParseTuple(args, "i", &style))
00167     {
00168         m_console << kConsoleColor(style);
00169         return Void();
00170     }
00171
00172     PyErr_Clear();
00173
00174     char *str;
00175     if(PyArg_ParseTuple(args, "s", &str))
00176     {
00177         m_console << str;
00178         return Void();
00179     }
00180
00181     return NULL;
00182 }
00183
00184 PY_IMPL_CLASS(MenuMgr, "Class to manipulate menus")
00185
00186 PY_BEGIN_IMPL_METHOD(MenuMgr)
00187     PY_IMPL_METHOD(MenuMgr, AddPulldown, "Add a new menu")
00188     PY_IMPL_METHOD(MenuMgr, AddToggle, "Add a toggle menu entry")
00189     PY_IMPL_METHOD(MenuMgr, AddButton, "Add a regular menu entry")
00190     PY_IMPL_METHOD(MenuMgr, AddSeparator, "Add a separator menu entry")
00191     PY_IMPL_METHOD(MenuMgr, Delete, "Delete a menu entry by index")
00192     PY_IMPL_METHOD(MenuMgr, DeleteByCmd, "Delete a menu entry by command")
00193     PY_IMPL_METHOD(MenuMgr, Count, "Count the number of entries in the menu")
00194 PY_END_IMPL_METHOD
00195
00196 static int ParseUMENU(PyObject *v, UMENU *menu)
00197 {
00198     if(v->ob_type == PyMenuMgr::GetType())
00199     {
00200         *menu = *((PyMenuMgr::obj_t *)v)->m_object;
00201         return 1;
00202     }
00203
00204     return 0;
00205 }
00206
00207 PyObject *PyMenuMgr::Create(PyObject *selfptr, PyObject *args)
00208 {
00209     UMENU menu;
00210
00211     if (!PyArg_ParseTuple(args, "i:CMenuMgr", &menu))
00212         return NULL;
00213
00214     PyAutoObject<PyMenuMgr::obj_t> self = PyMenuMgr::New();
00215     if (!self.IsValid())
00216         return NULL;
00217
00218     TRY
00219     {
00220         self->m_object = new PyMenuMgr(menu);
00221     }
00222     CATCH_ALL(e)
00223     {
00224         PyHandleCvsguiError(e);
00225         return NULL;
00226     }
00227     END_CATCH_ALL
00228
00229     return self.CopyReturn();
00230 }
00231
00232 void PyMenuMgr::InitValues(PyObject *d)
00233 {
00234 }
00235
00236 PyObject *PyMenuMgr::AddPulldown(PyObject *args)
00237 {
00238     int widid;
00239     char *name;
00240
00241     if (!PyArg_ParseTuple(args, "is", &widid, &name))
00242         return NULL;
00243
00244     PyAutoObject<PyMenuMgr::obj_t> res = PyMenuMgr::New();
00245     if (!res.IsValid())
00246         return NULL;
00247
00248     res->m_object = new PyMenuMgr(UMenuAddPulldown(widid, name, m_menu));
00249
00250     return res.CopyReturn();
00251 }
00252
00253 PyObject *PyMenuMgr::AddToggle(PyObject *args)
00254 {
00255     int widid, cmd;
00256     char *name, *pixmap = 0L;
00257
00258     if (!PyArg_ParseTuple(args, "isi|s", &widid, &name, &cmd, &pixmap))
00259         return NULL;
00260
00261     UMenuAddToggle(widid, name, m_menu, pixmap, cmd);
00262
00263     return Void();
00264 }
00265
00266 PyObject *PyMenuMgr::AddButton(PyObject *args)
00267 {
00268     int widid, cmd;
00269     char *name, *pixmap = 0L;
00270
00271     if (!PyArg_ParseTuple(args, "isi|s", &widid, &name, &cmd, &pixmap))
00272         return NULL;
00273
00274     UMenuAddButton(widid, name, m_menu, pixmap, cmd);
00275
00276     return Void();
00277 }
00278
00279 PyObject *PyMenuMgr::AddSeparator(PyObject *args)
00280 {
00281     int widid;
00282
00283     if (!PyArg_ParseTuple(args, "i", &widid))
00284         return NULL;
00285
00286     UMenuAddSeparator(widid, m_menu);
00287
00288     return Void();
00289 }
00290
00291 PyObject *PyMenuMgr::Delete(PyObject *args)
00292 {
00293     int afterIndex;
00294
00295     if (!PyArg_ParseTuple(args, "i", &afterIndex))
00296         return NULL;
00297
00298     UMenuDelete(m_menu, afterIndex);
00299
00300     return Void();
00301 }
00302
00303 PyObject *PyMenuMgr::DeleteByCmd(PyObject *args)
00304 {
00305     int cmd;
00306
00307     if (!PyArg_ParseTuple(args, "i", &cmd))
00308         return NULL;
00309
00310     UMenuDeleteByCmd(m_menu, cmd);
00311
00312     return Void();
00313 }
00314
00315 PyObject *PyMenuMgr::Count(PyObject *args)
00316 {
00317     int res;
00318
00319     if (!PyArg_ParseTuple(args, ""))
00320         return NULL;
00321
00322     res = UMenuCount(m_menu);
00323
00324     return PyInt_FromLong(res);
00325 }
00326
00327 PY_IMPL_CLASS(CmdUI, "Class to update an interface object state")
00328
00329 PY_BEGIN_IMPL_METHOD(CmdUI)
00330     PY_IMPL_METHOD(CmdUI, Enable, "Enable/Disable the object")
00331     PY_IMPL_METHOD(CmdUI, SetCheck, "Check/uncheck the object")
00332     PY_IMPL_METHOD(CmdUI, SetText, "Rename the object")
00333 PY_END_IMPL_METHOD
00334
00335 PyObject *PyCmdUI::Create(PyObject *selfptr, PyObject *args)
00336 {
00337     UCmdUI *cmdui;
00338
00339     if (!PyArg_ParseTuple(args, "i:CCmdUI", &cmdui))
00340         return NULL;
00341
00342     PyAutoObject<PyCmdUI::obj_t> self = PyCmdUI::New();
00343     if (!self.IsValid())
00344         return NULL;
00345
00346     TRY
00347     {
00348         self->m_object = new PyCmdUI(cmdui);
00349     }
00350     CATCH_ALL(e)
00351     {
00352         PyHandleCvsguiError(e);
00353         return NULL;
00354     }
00355     END_CATCH_ALL
00356
00357     return self.CopyReturn();
00358 }
00359
00360 void PyCmdUI::InitValues(PyObject *d)
00361 {
00362 }
00363
00364 PyObject *PyCmdUI::Enable(PyObject *args)
00365 {
00366     int state;
00367
00368     if (!PyArg_ParseTuple(args, "i", &state))
00369         return NULL;
00370
00371     m_cmdui->Enable(state != 0);
00372
00373     return Void();
00374 }
00375
00376 PyObject *PyCmdUI::SetCheck(PyObject *args)
00377 {
00378     int state;
00379
00380     if (!PyArg_ParseTuple(args, "i", &state))
00381         return NULL;
00382
00383     m_cmdui->Check(state != 0);
00384
00385     return Void();
00386 }
00387
00388 PyObject *PyCmdUI::SetText(PyObject *args)
00389 {
00390     char *text;
00391
00392     if (!PyArg_ParseTuple(args, "s", &text))
00393         return NULL;
00394
00395     m_cmdui->SetText(text);
00396
00397     return Void();
00398 }
00399
00400 PY_IMPL_CLASS(Persistent, "Class to store persistent values on disk")
00401
00402 PY_BEGIN_IMPL_METHOD(Persistent)
00403     PY_IMPL_METHOD(Persistent, GetValue, "Get the persistent value")
00404     PY_IMPL_METHOD(Persistent, SetValue, "Set the persistent value")
00405 PY_END_IMPL_METHOD
00406
00407 PyObject *PyPersistent::Create(PyObject *selfptr, PyObject *args)
00408 {
00409     char *uniqueName, *defValue = 0L;
00410     int addToSettings = 0;
00411
00412     if (!PyArg_ParseTuple(args, "s|si:CPersistent", &uniqueName, &defValue,
00413         &addToSettings))
00414         return NULL;
00415
00416     PyAutoObject<PyPersistent::obj_t> self = PyPersistent::New();
00417     if (!self.IsValid())
00418         return NULL;
00419
00420     TRY
00421     {
00422         self->m_object = new PyPersistent(uniqueName, defValue,
00423             addToSettings ? kAddSettings : kNoClass);
00424     }
00425     CATCH_ALL(e)
00426     {
00427         PyHandleCvsguiError(e);
00428         return NULL;
00429     }
00430     END_CATCH_ALL
00431
00432     return self.CopyReturn();
00433 }
00434
00435 void PyPersistent::InitValues(PyObject *d)
00436 {
00437 }
00438
00439 PyObject *PyPersistent::SetValue(PyObject *args)
00440 {
00441     char *s;
00442
00443     if (!PyArg_ParseTuple(args, "s", &s))
00444         return NULL;
00445
00446     m_cstr = s;
00447     gCvsPrefs.save();
00448
00449     return Void();
00450 }
00451
00452 PyObject *PyPersistent::GetValue(PyObject *args)
00453 {
00454     if (!PyArg_ParseTuple(args, ""))
00455         return NULL;
00456
00457     return PyString_FromString(m_cstr);
00458 }
00459
00460 #if defined(WIN32) && !qCvsDebug
00461
00462 #undef PYTHONGLUE_IMPL_H
00463 #undef PYTHONGLUE_EXTERN
00464 #define PYTHONGLUE_EXTERN
00465 #include "PythonGlue.impl.h"
00466
00467 PyTypeObject *GetPyType_Type()
00468 {
00469     return PyType_Type_glue;
00470 }
00471
00472 PyTypeObject *GetPyFile_Type()
00473 {
00474     return PyFile_Type_glue;
00475 }
00476
00477 PyTypeObject *GetPyString_Type()
00478 {
00479     return PyString_Type_glue;
00480 }
00481
00482 PyTypeObject *GetPyTuple_Type()
00483 {
00484     return PyTuple_Type_glue;
00485 }
00486
00487 PyTypeObject *GetPyInt_Type()
00488 {
00489     return PyInt_Type_glue;
00490 }
00491
00492 PyObject *GetPyNone()
00493 {
00494     return _Py_NoneStruct_glue;
00495 }
00496
00497 PyObject *GetPyTrue()
00498 {
00499     return _Py_TrueStruct_glue;
00500 }
00501
00502 PyObject *GetPyFalse()
00503 {
00504     return _Py_ZeroStruct_glue;
00505 }
00506 #endif // WIN32 && !qCvsDebug
00507
00508 #endif // USE_PYTHON
Generated on Sun Feb 24 01:21:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/PythonImpl.h Source File

common/PythonImpl.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- September 2001
00019  */
00020
00021 #ifndef __PYIMPL
00022 #define __PYIMPL
00023
00024 #include "PythonContainer.h"
00025
00026 #if USE_PYTHON
00027 #include "CvsEntries.h"
00028 #include "AppConsole.h"
00029 #include "CPStr.h"
00030 #include "umain.h"
00031
00032 class PyCvsEntry : public PyContainer
00033 {
00034     PY_DECL_CLASS(CvsEntry)
00035 public:
00036     PyCvsEntry(EntnodeData *data) : m_data(data)
00037     {
00038     }
00039
00040     virtual ~PyCvsEntry()
00041     {
00042     }
00043
00044     virtual PyObject *GetAttr(char *name);
00045
00046     inline operator EntnodeData *(void) const { return m_data; }
00047
00048 protected:
00049     ENTNODE m_data;
00050 };
00051
00052 class PyColorConsole : public PyContainer
00053 {
00054     PY_DECL_CLASS(ColorConsole)
00055     PY_DECL_METHOD(ColorConsole, Print)
00056 public:
00057     PyColorConsole()
00058     {
00059     }
00060
00061     virtual ~PyColorConsole()
00062     {
00063     }
00064
00065 protected:
00066     CColorConsole m_console;
00067 };
00068
00069 class PyMenuMgr : public PyContainer
00070 {
00071     PY_DECL_CLASS(MenuMgr)
00072     PY_DECL_METHOD(MenuMgr, AddPulldown)
00073     PY_DECL_METHOD(MenuMgr, AddToggle)
00074     PY_DECL_METHOD(MenuMgr, AddButton)
00075     PY_DECL_METHOD(MenuMgr, AddSeparator)
00076     PY_DECL_METHOD(MenuMgr, Delete)
00077     PY_DECL_METHOD(MenuMgr, DeleteByCmd)
00078     PY_DECL_METHOD(MenuMgr, Count)
00079
00080 public:
00081     PyMenuMgr(UMENU menu) : m_menu(menu)
00082     {
00083     }
00084
00085     virtual ~PyMenuMgr()
00086     {
00087     }
00088
00089     inline operator UMENU() const { return m_menu; }
00090 protected:
00091     UMENU m_menu;
00092 };
00093
00094 class PyCmdUI : public PyContainer
00095 {
00096     PY_DECL_CLASS(CmdUI)
00097     PY_DECL_METHOD(CmdUI, Enable)
00098     PY_DECL_METHOD(CmdUI, SetCheck)
00099     PY_DECL_METHOD(CmdUI, SetText)
00100 public:
00101     PyCmdUI(UCmdUI *cmdui) : m_cmdui(cmdui)
00102     {
00103     }
00104
00105     virtual ~PyCmdUI()
00106     {
00107     }
00108
00109 protected:
00110     UCmdUI *m_cmdui;
00111 };
00112
00113 class PyPersistent : public PyContainer
00114 {
00115     PY_DECL_CLASS(Persistent)
00116     PY_DECL_METHOD(Persistent, GetValue)
00117     PY_DECL_METHOD(Persistent, SetValue)
00118 public:
00119     PyPersistent(const char *uniqueName, const char *defValue, kClassPersistent pclass) :
00120         m_cstr(uniqueName, defValue, pclass)
00121     {
00122     }
00123
00124     virtual ~PyPersistent()
00125     {
00126     }
00127
00128 protected:
00129     PCStr m_cstr;
00130 };
00131 #endif // USE_PYTHON
00132
00133 #endif
Generated on Sun Feb 24 01:21:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/PythonMacros.h Source File

common/PythonMacros.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- September 2001
00019  */
00020
00021 #ifndef __PY_MACROS
00022 #define __PY_MACROS
00023
00024 // it is important with Python to not throw, instead we need
00025 // to intercept each exception and turn it into a Python exception
00026 #ifdef WIN32
00027     extern void PyHandleCvsguiError(CException* e);
00028 #else
00029     extern void PyHandleCvsguiError(const std::exception & e);
00030 #   define TRY try
00031 #   define CATCH_ALL(e) catch(const std::exception & e)
00032 #   define END_CATCH_ALL
00033 #endif
00034 extern void PyHandleCvsguiError(const char *msg);
00035
00036 /*
00037  * PY_DECL_CLASS : declate a python wrapper class
00038  * PY_IMPL_CLASS : implement python wrapper class
00039  */
00040
00041 #define _COMMON_PY_DECL_CLASS(c) \
00042 public: \
00043     typedef struct \
00044     { \
00045         PyObject_HEAD \
00046         Py##c *m_object; \
00047     } obj_t; \
00048     static const char *m_doc; \
00049     static void dealloc(obj_t *self); \
00050     static PyObject *getattr(obj_t *self, char *name); \
00051     static PyAutoObject<obj_t> New(void); \
00052     static PyMethodDef m_methods[]; \
00053     static PyRegistry m_registry; \
00054     static inline PyTypeObject *GetType(void) { return &m_registry.m_type; } \
00055     static PyObject *Create(PyObject *selfptr, PyObject *args); \
00056     static void InitValues(PyObject *d);
00057
00058 #define PY_DECL_CLASS_INHERITED(c, a) \
00059     _COMMON_PY_DECL_CLASS(c) \
00060     static PyObject *FindMethod(PyObject *self, char *name) \
00061     { \
00062         PyObject *res = Py_FindMethod(m_methods, self, name); \
00063         if(res != NULL) \
00064             return res; \
00065         PyErr_Clear(); \
00066         return Py##a::FindMethod(self, name); \
00067     }
00068
00069 #define PY_DECL_CLASS(c) \
00070     _COMMON_PY_DECL_CLASS(c) \
00071     static PyObject *FindMethod(PyObject *self, char *name) \
00072     { \
00073         return Py_FindMethod(m_methods, self, name); \
00074     }
00075
00076
00077 #define PY_IMPL_CLASS(c, adoc) \
00078     PyRegistry Py##c::m_registry("C"#c, sizeof(Py##c::obj_t), (destructor)Py##c::dealloc, (getattrfunc)Py##c::getattr, \
00079         Py##c::InitValues, (PyCFunction)Py##c::Create, Py##c::m_doc); \
00080     PyAutoObject<Py##c::obj_t> Py##c::New(void) \
00081     { \
00082         Py##c::obj_t *self = PyObject_New(Py##c::obj_t, Py##c::GetType()); \
00083         self->m_object = NULL; \
00084         PyAutoObject<Py##c::obj_t> res(self); \
00085         Py_DECREF(self); \
00086         return res; \
00087     } \
00088     const char *Py##c::m_doc = adoc; \
00089  \
00090     void Py##c::dealloc(obj_t *self) \
00091     { \
00092         delete self->m_object; \
00093         PyObject_Del(self); \
00094     } \
00095  \
00096     PyObject *Py##c::getattr(obj_t *self, char *name) \
00097     { \
00098         if(self->m_object) \
00099         { \
00100             TRY \
00101             { \
00102                 PyObject *res = self->m_object->GetAttr(name); \
00103                 if(res) \
00104                     return res; \
00105             } \
00106             CATCH_ALL(e) \
00107             { \
00108                 PyHandleCvsguiError(e); \
00109                 return NULL; \
00110             } \
00111             END_CATCH_ALL \
00112         } \
00113         return Py##c::FindMethod((PyObject *)self, name); \
00114     }
00115
00116 #define PY_DECL_METHOD(c, m) \
00117 protected: \
00118     static PyObject *_##m(obj_t *self, PyObject *args) \
00119     { \
00120         TRY \
00121         { \
00122             if(self->m_object) \
00123                 return self->m_object->##m(args); \
00124         } \
00125         CATCH_ALL(e) \
00126         { \
00127             PyHandleCvsguiError(e); \
00128             return NULL; \
00129         } \
00130         END_CATCH_ALL \
00131         return NULL; \
00132     } \
00133 public: \
00134     PyObject *m(PyObject *args);
00135
00136 #define PY_BEGIN_IMPL_METHOD(c) \
00137     PyMethodDef Py##c::m_methods[] = \
00138     {
00139
00140 #define PY_IMPL_METHOD(c, m, adoc) \
00141     {#m, (binaryfunc)Py##c::_##m, METH_VARARGS, (char *)adoc},
00142
00143 #define PY_END_IMPL_METHOD \
00144         {NULL, NULL} \
00145     };
00146
00147 #endif
Generated on Sun Feb 24 01:21:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/ReleaseDlg.cpp Source File

common/ReleaseDlg.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- October 2000
00019  */
00020
00021 /*
00022  * ReleaseDlg.cpp : the cvs release dialog
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef WIN32
00028 #   include "wincvs.h"
00029 #endif /* WIN32 */
00030
00031 #include "ReleaseDlg.h"
00032
00033 #ifdef WIN32
00034 #   ifdef _DEBUG
00035 #   define new DEBUG_NEW
00036 #   undef THIS_FILE
00037     static char THIS_FILE[] = __FILE__;
00038 #   endif
00039 #endif /* WIN32 */
00040
00041 #ifdef WIN32
00042
00043 // CReleaseDlg dialog
00044
00045 CReleaseDlg::CReleaseDlg(CWnd* pParent /*=NULL*/)
00046     : CDialog(CReleaseDlg::IDD, pParent)
00047 {
00048     //{{AFX_DATA_INIT(CReleaseDlg)
00049     m_strDirectory = _T("");
00050     m_bRemoveDirectory = FALSE;
00051     //}}AFX_DATA_INIT
00052 }
00053
00054
00055 void CReleaseDlg::DoDataExchange(CDataExchange* pDX)
00056 {
00057     CDialog::DoDataExchange(pDX);
00058     //{{AFX_DATA_MAP(CReleaseDlg)
00059     DDX_Text(pDX, IDC_DIRECTORY, m_strDirectory);
00060     DDX_Check(pDX, IDC_REMOVE, m_bRemoveDirectory);
00061     //}}AFX_DATA_MAP
00062 }
00063
00064
00065 BEGIN_MESSAGE_MAP(CReleaseDlg, CDialog)
00066     //{{AFX_MSG_MAP(CReleaseDlg)
00067         // NOTE: the ClassWizard will add message map macros here
00068     //}}AFX_MSG_MAP
00069 END_MESSAGE_MAP()
00070
00072 // CReleaseDlg message handlers
00073
00074 #endif /* WIN32 */
00075
00076 bool CompatGetRelease( const char* dir, bool& removeDirectory )
00077 {
00078     bool userHitOK = false;
00079
00080 #ifdef WIN32
00081     CReleaseDlg oReleaseDlg;
00082     oReleaseDlg.m_strDirectory = dir;
00083
00084     if(oReleaseDlg.DoModal() == IDOK)
00085     {
00086         removeDirectory = oReleaseDlg.m_bRemoveDirectory == TRUE;
00087         userHitOK = true;
00088     }
00089 #endif /* WIN32 */
00090
00091 #ifdef qMacCvsPP
00092     userHitOK = true;
00093 #endif /* qMacCvsPP */
00094
00095 #if qUnix
00096     userHitOK = true;
00097 #endif // qUnix
00098
00099     return userHitOK;
00100 }
Generated on Sun Feb 24 01:21:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/ReleaseDlg.h Source File

common/ReleaseDlg.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- October 2000
00019  */
00020
00021 /*
00022  * ReleaseDlg.h : the cvs release dialog
00023  */
00024
00025 #if !defined(AFX_RELEASEDLG_H__12B5FA97_703E_4616_B361_F2917D45E54A__INCLUDED_)
00026 #define AFX_RELEASEDLG_H__12B5FA97_703E_4616_B361_F2917D45E54A__INCLUDED_
00027
00028 #if _MSC_VER > 1000
00029 #pragma once
00030 #endif // _MSC_VER > 1000
00031
00032 bool CompatGetRelease( const char* dir, bool& removeDirectory );
00033     // get the release options...
00034
00035 #ifdef WIN32
00036
00037 // CReleaseDlg dialog
00038
00039 class CReleaseDlg : public CDialog
00040 {
00041 // Construction
00042 public:
00043     CReleaseDlg(CWnd* pParent = NULL);   // standard constructor
00044
00045 // Dialog Data
00046     //{{AFX_DATA(CReleaseDlg)
00047     enum { IDD = IDD_RELEASE };
00048     CString m_strDirectory;
00049     BOOL    m_bRemoveDirectory;
00050     //}}AFX_DATA
00051
00052
00053 // Overrides
00054     // ClassWizard generated virtual function overrides
00055     //{{AFX_VIRTUAL(CReleaseDlg)
00056     protected:
00057     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00058     //}}AFX_VIRTUAL
00059
00060 // Implementation
00061 protected:
00062
00063     // Generated message map functions
00064     //{{AFX_MSG(CReleaseDlg)
00065         // NOTE: the ClassWizard will add member functions here
00066     //}}AFX_MSG
00067     DECLARE_MESSAGE_MAP()
00068 };
00069
00070 //{{AFX_INSERT_LOCATION}}
00071 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00072
00073 #endif /* WIN32 */
00074
00075
00076 #endif // !defined(AFX_RELEASEDLG_H__12B5FA97_703E_4616_B361_F2917D45E54A__INCLUDED_)
Generated on Sun Feb 24 01:21:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/RtagDlg.cpp Source File

common/RtagDlg.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- July 1998
00019  */
00020
00021 /*
00022  * RtagDlg.cpp : the cvs rtag dialog
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef WIN32
00028 #   include "wincvs.h"
00029 #   include "GetPrefs.h"
00030 #endif /* WIN32 */
00031
00032 #ifdef qMacCvsPP
00033 #   include <UModalDialogs.h>
00034 #   include <LMultiPanelView.h>
00035 #   include <LCheckBox.h>
00036 #   include <LEditText.h>
00037 #   include <LPopupGroupBox.h>
00038 #   include <LRadioButton.h>
00039 #   include "LPopupFiller.h"
00040
00041 #   include "MacCvsApp.h"
00042 #   include "MacCvsConstant.h"
00043 #endif /* qMacCvsPP */
00044
00045 #if qUnix
00046 #   include "UCvsDialogs.h"
00047 #endif
00048
00049 #include "RtagDlg.h"
00050 #include "CvsPrefs.h"
00051 #include "UpdateDlg.h"
00052
00053 #ifdef WIN32
00054 #   ifdef _DEBUG
00055 #   define new DEBUG_NEW
00056 #   undef THIS_FILE
00057     static char THIS_FILE[] = __FILE__;
00058 #   endif
00059 #endif /* WIN32 */
00060
00061 #ifdef WIN32
00062
00063 // CRtag_MAIN property page
00064
00065 IMPLEMENT_DYNCREATE(CRtag_MAIN, CPropertyPage)
00066
00067 CRtag_MAIN::CRtag_MAIN(kRtagDlgType type,
00068         const char *sLastModule, const char *sLastTag,
00069         bool noRecurs, bool lookAttic, bool overwriteExist /*= false*/)
00070         : CPropertyPage(CRtag_MAIN::IDD)
00071 {
00072     m_type = type;
00073
00074     m_tagName = sLastTag;
00075     m_moduleName = sLastModule;
00076     m_noRecurs = noRecurs;
00077     m_lookAttic = lookAttic;
00078     m_overwriteExisting = overwriteExist;
00079
00080     m_moduleCombo.SetItems(&gOldModules);
00081     m_tagCombo.SetItems(&gRevNames);
00082 }
00083
00084 CRtag_MAIN::CRtag_MAIN() : CPropertyPage(CRtag_MAIN::IDD)
00085 {
00086     //{{AFX_DATA_INIT(CRtag_MAIN)
00087     m_tagName = _T("");
00088     m_moduleName = _T("");
00089     m_noRecurs = FALSE;
00090     m_lookAttic = FALSE;
00091     m_overwriteExisting = FALSE;
00092     //}}AFX_DATA_INIT
00093 }
00094
00095 CRtag_MAIN::~CRtag_MAIN()
00096 {
00097 }
00098
00099 void CRtag_MAIN::DoDataExchange(CDataExchange* pDX)
00100 {
00101     CPropertyPage::DoDataExchange(pDX);
00102     //{{AFX_DATA_MAP(CRtag_MAIN)
00103     DDX_Control(pDX, IDC_OVERWRITE, m_overwriteExistingCheck);
00104     DDX_Control(pDX, IDC_MODULEDESC_TEXT, m_moduleDescStatic);
00105     DDX_Control(pDX, IDC_TAGDESC_TEXT, m_tagDescStatic);
00106     DDX_Control(pDX, IDC_GRPBOX_TEXT, m_grpBox);
00107     DDX_Control(pDX, IDC_MODNAME, m_moduleCombo);
00108     DDX_Control(pDX, IDC_TAGNAME, m_tagCombo);
00109     DDX_CBString(pDX, IDC_TAGNAME, m_tagName);
00110     DDX_CBString(pDX, IDC_MODNAME, m_moduleName);
00111     DDX_Check(pDX, IDC_NORECURS, m_noRecurs);
00112     DDX_Check(pDX, IDC_ATTIC, m_lookAttic);
00113     DDX_Check(pDX, IDC_OVERWRITE, m_overwriteExisting);
00114     //}}AFX_DATA_MAP
00115
00116     DDV_MinChars(pDX, m_moduleName, 1);
00117     DDV_MinChars(pDX, m_tagName, 1);
00118
00119     DDX_ComboMString(pDX, IDC_MODNAME, m_moduleCombo);
00120     DDX_ComboMString(pDX, IDC_TAGNAME, m_tagCombo);
00121 }
00122
00123
00124 BEGIN_MESSAGE_MAP(CRtag_MAIN, CPropertyPage)
00125     //{{AFX_MSG_MAP(CRtag_MAIN)
00126     //}}AFX_MSG_MAP
00127 END_MESSAGE_MAP()
00128
00130 // CRtag_MAIN message handlers
00131
00132 BOOL CRtag_MAIN::OnInitDialog()
00133 {
00134     CPropertyPage::OnInitDialog();
00135
00136     // set the type-specific data
00137     CString strGrpBox;
00138     CString strTagDesc;
00139     CString strmoduleDesc;
00140
00141     switch( m_type )
00142     {
00143     case kRtagAdd:
00144         strGrpBox = "Enter the tag name and which module to tag:";
00145         strTagDesc = "New &tag name:";
00146         strmoduleDesc = "&Module to tag:";
00147         break;
00148     case kRtagDelete:
00149         strGrpBox = "Enter the tag name to delete and which module to untag:";
00150         strTagDesc = "Delete &tag name:";
00151         strmoduleDesc = "&Module to untag:";
00152
00153         m_overwriteExistingCheck.ShowWindow(SW_HIDE);
00154         break;
00155     case kRtagFork:
00156         strGrpBox = "Enter the branch name and which module to fork:";
00157         strTagDesc = "New &branch name:";
00158         strmoduleDesc = "&Module to fork:";
00159
00160         m_overwriteExistingCheck.ShowWindow(SW_HIDE);
00161         break;
00162     default:
00163         ASSERT(FALSE); //unknown type
00164     }
00165
00166     m_grpBox.SetWindowText(strGrpBox);
00167     m_tagDescStatic.SetWindowText(strTagDesc);
00168     m_moduleDescStatic.SetWindowText(strmoduleDesc);;
00169
00170     return TRUE;  // return TRUE unless you set the focus to a control
00171                   // EXCEPTION: OCX Property Pages should return FALSE
00172 }
00173
00175 // CRtag_OPTIONS property page
00176
00177 IMPLEMENT_DYNCREATE(CRtag_OPTIONS, CPropertyPage)
00178
00179 CRtag_OPTIONS::CRtag_OPTIONS(kRtagDlgType type,
00180         bool hasDate, bool hasRev,
00181         const char *sLastDate, const char *sLastRev,
00182         bool useMostRecent) : CPropertyPage(CRtag_OPTIONS::IDD)
00183 {
00184     m_type = type;
00185
00186     m_date = sLastDate;
00187     m_rev = sLastRev;
00188     m_hasDate = hasDate;
00189     m_hasRev = hasRev;
00190     m_useMostRecent = useMostRecent;
00191
00192     m_revCombo.SetItems(&gRevNames);
00193     m_dateCombo.SetItems(&gDateNames);
00194 }
00195
00196 CRtag_OPTIONS::CRtag_OPTIONS() : CPropertyPage(CRtag_OPTIONS::IDD)
00197 {
00198     //{{AFX_DATA_INIT(CRtag_OPTIONS)
00199     m_date = _T("");
00200     m_rev = _T("");
00201     m_hasDate = FALSE;
00202     m_hasRev = FALSE;
00203     m_useMostRecent = FALSE;
00204     //}}AFX_DATA_INIT
00205 }
00206
00207 CRtag_OPTIONS::~CRtag_OPTIONS()
00208 {
00209 }
00210
00211 void CRtag_OPTIONS::DoDataExchange(CDataExchange* pDX)
00212 {
00213     CPropertyPage::DoDataExchange(pDX);
00214     //{{AFX_DATA_MAP(CRtag_OPTIONS)
00215     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00216     DDX_Control(pDX, IDC_COMBODATE, m_dateCombo);
00217     DDX_Control(pDX, IDC_GRPBOX_TEXT, m_grpBox);
00218     DDX_CBString(pDX, IDC_COMBODATE, m_date);
00219     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00220     DDX_Check(pDX, IDC_DATE, m_hasDate);
00221     DDX_Check(pDX, IDC_REV, m_hasRev);
00222     DDX_Check(pDX, IDC_MATCH, m_useMostRecent);
00223     //}}AFX_DATA_MAP
00224
00225     if( m_hasRev )
00226     {
00227         DDV_MinChars(pDX, m_rev, 1);
00228     }
00229
00230     if( m_hasDate )
00231     {
00232         DDV_MinChars(pDX, m_date, 1);
00233     }
00234
00235     if( !pDX->m_bSaveAndValidate )
00236     {
00237         OnDate();
00238         OnRev();
00239     }
00240
00241     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00242     DDX_ComboMString(pDX, IDC_COMBODATE, m_dateCombo);
00243 }
00244
00245
00246 BEGIN_MESSAGE_MAP(CRtag_OPTIONS, CPropertyPage)
00247     //{{AFX_MSG_MAP(CRtag_OPTIONS)
00248     ON_BN_CLICKED(IDC_DATE, OnDate)
00249     ON_BN_CLICKED(IDC_REV, OnRev)
00250     //}}AFX_MSG_MAP
00251 END_MESSAGE_MAP()
00252
00254 // CRtag_OPTIONS message handlers
00255
00256 void CRtag_OPTIONS::OnDate()
00257 {
00258     CButton* but = (CButton *)GetDlgItem(IDC_DATE);
00259     CWnd* wnd = GetDlgItem(IDC_COMBODATE);
00260     wnd->EnableWindow(but->GetCheck() == 1);
00261 }
00262
00263 void CRtag_OPTIONS::OnRev()
00264 {
00265     CButton* but = (CButton *)GetDlgItem(IDC_REV);
00266     CWnd* wnd = GetDlgItem(IDC_COMBOREV);
00267     wnd->EnableWindow(but->GetCheck() == 1);
00268 }
00269
00270 BOOL CRtag_OPTIONS::OnInitDialog()
00271 {
00272     CPropertyPage::OnInitDialog();
00273
00274     // set the type-specific data
00275     CString strGrpBox;
00276
00277     switch( m_type )
00278     {
00279     case kRtagAdd:
00280         strGrpBox = "Optionally use this revision/tag/date to create the tag:";
00281         break;
00282     case kRtagDelete:
00283         ASSERT(FALSE); //delete tag has no options
00284         break;
00285     case kRtagFork:
00286         strGrpBox = "Optionally use this revision/tag/date to create the branch:";
00287         break;
00288     default:
00289         ASSERT(FALSE); //unknown type
00290     }
00291
00292     m_grpBox.SetWindowText(strGrpBox);
00293
00294     return TRUE;  // return TRUE unless you set the focus to a control
00295                   // EXCEPTION: OCX Property Pages should return FALSE
00296 }
00297
00298 #endif /* WIN32 */
00299
00300 #ifdef qMacCvsPP
00301 static void DoDataExchange_RtagCreateMain(LWindow *theDialog,
00302     CPStr & sLastModule, CPStr & sLastTag,
00303     bool & hasDate, bool & hasRev,
00304     CPStr & sLastDate, CPStr & sLastRev,
00305     bool & useMostRecent, bool & lookAttic, bool putValue)
00306 {
00307     LEditText *mname = dynamic_cast<LEditText*>
00308         (theDialog->FindPaneByID(item_ModuleName));
00309     LEditText *tname = dynamic_cast<LEditText*>
00310         (theDialog->FindPaneByID(item_BranchRev));
00311     LCheckBox *chkHasDate = dynamic_cast<LCheckBox*>
00312         (theDialog->FindPaneByID(item_CheckDate));
00313     LCheckBox *chkHasRev = dynamic_cast<LCheckBox*>
00314         (theDialog->FindPaneByID(item_CheckRevTag));
00315     LCheckBox *chkMostRecent = dynamic_cast<LCheckBox*>
00316         (theDialog->FindPaneByID(item_MostRecentRev));
00317     LCheckBox *chkLookAttic = dynamic_cast<LCheckBox*>
00318         (theDialog->FindPaneByID(item_InAttic));
00319     LEditText *editDate = dynamic_cast<LEditText*>
00320         (theDialog->FindPaneByID(item_EditDate));
00321     LEditText *editRev = dynamic_cast<LEditText*>
00322         (theDialog->FindPaneByID(item_EditRevTag));
00323     LPopupFiller *fillRev = dynamic_cast<LPopupFiller*>
00324         (theDialog->FindPaneByID(item_FillerRev1));
00325     LPopupFiller *fillTag = dynamic_cast<LPopupFiller*>
00326         (theDialog->FindPaneByID(item_FillerTag));
00327     LPopupFiller *fillDate = dynamic_cast<LPopupFiller*>
00328         (theDialog->FindPaneByID(item_FillerDate));
00329
00330     fillRev->DoDataExchange(gRevNames, putValue);
00331     fillTag->DoDataExchange(gRevNames, putValue);
00332     fillDate->DoDataExchange(gDateNames, putValue);
00333
00334     if(putValue)
00335     {
00336         mname->SetText((Ptr)(const char *)sLastModule, sLastModule.length());
00337         tname->SetText((Ptr)(const char *)sLastTag, sLastTag.length());
00338         chkHasDate->SetValue(hasDate ? Button_On : Button_Off);
00339         chkHasRev->SetValue(hasRev ? Button_On : Button_Off);
00340         chkMostRecent->SetValue(useMostRecent ? Button_On : Button_Off);
00341         chkLookAttic->SetValue(lookAttic ? Button_On : Button_Off);
00342         editDate->SetText((Ptr)(const char *)sLastDate, sLastDate.length());
00343         editRev->SetText((Ptr)(const char *)sLastRev, sLastRev.length());
00344     }
00345     else
00346     {
00347         hasDate = chkHasDate->GetValue() == Button_On;
00348         hasRev = chkHasRev->GetValue() == Button_On;
00349         useMostRecent = chkMostRecent->GetValue() == Button_On;
00350         lookAttic = chkLookAttic->GetValue() == Button_On;
00351
00352         char str[255];
00353         Size len;
00354
00355         mname->GetText(str, 254, &len);
00356         sLastModule.set(str, len);
00357         tname->GetText(str, 254, &len);
00358         sLastTag.set(str, len);
00359         editDate->GetText(str, 254, &len);
00360         sLastDate.set(str, len);
00361         editRev->GetText(str, 254, &len);
00362         sLastRev.set(str, len);
00363     }
00364 }
00365
00366 static void DoDataExchange_RtagCreateOptions(LWindow *theDialog,
00367     bool & noRecurs, bool & overwriteExist, bool putValue)
00368 {
00369     LCheckBox *chkNoRecurs = dynamic_cast<LCheckBox*>
00370         (theDialog->FindPaneByID(item_NoRecurs));
00371     LCheckBox *chkOverwrite = dynamic_cast<LCheckBox*>
00372         (theDialog->FindPaneByID(item_OverwriteRev));
00373
00374     if(putValue)
00375     {
00376         chkNoRecurs->SetValue(noRecurs ? Button_On : Button_Off);
00377         chkOverwrite->SetValue(overwriteExist ? Button_On : Button_Off);
00378     }
00379     else
00380     {
00381         noRecurs = chkNoRecurs->GetValue() == Button_On;
00382         overwriteExist = chkOverwrite->GetValue() == Button_On;
00383     }
00384 }
00385
00386 static void DoDataExchange_RtagDeleteMain(LWindow *theDialog,
00387     CPStr & sLastModule, CPStr & sLastTag,
00388     bool & noRecurs, bool & lookAttic, bool putValue)
00389 {
00390     LEditText *mname = dynamic_cast<LEditText*>
00391         (theDialog->FindPaneByID(item_ModuleName));
00392     LEditText *tname = dynamic_cast<LEditText*>
00393         (theDialog->FindPaneByID(item_BranchRev));
00394     LCheckBox *chkLookAttic = dynamic_cast<LCheckBox*>
00395         (theDialog->FindPaneByID(item_InAttic));
00396     LCheckBox *chkNoRecurs = dynamic_cast<LCheckBox*>
00397         (theDialog->FindPaneByID(item_NoRecurs));
00398     LPopupFiller *fillTag = dynamic_cast<LPopupFiller*>
00399         (theDialog->FindPaneByID(item_FillerTag));
00400
00401     fillTag->DoDataExchange(gRevNames, putValue);
00402
00403     if(putValue)
00404     {
00405         mname->SetText((Ptr)(const char *)sLastModule, sLastModule.length());
00406         tname->SetText((Ptr)(const char *)sLastTag, sLastTag.length());
00407         chkLookAttic->SetValue(lookAttic ? Button_On : Button_Off);
00408         chkNoRecurs->SetValue(noRecurs ? Button_On : Button_Off);
00409     }
00410     else
00411     {
00412         lookAttic = chkLookAttic->GetValue() == Button_On;
00413         noRecurs = chkNoRecurs->GetValue() == Button_On;
00414
00415         char str[255];
00416         Size len;
00417
00418         mname->GetText(str, 254, &len);
00419         sLastModule.set(str, len);
00420         tname->GetText(str, 254, &len);
00421         sLastTag.set(str, len);
00422     }
00423 }
00424
00425 static void DoDataExchange_RtagBranchMain(LWindow *theDialog,
00426     CPStr & sLastModule, CPStr & sLastBranch,
00427     bool & hasDate, bool & hasRev,
00428     CPStr & sLastDate, CPStr & sLastRev,
00429     bool & useMostRecent, bool & lookAttic, bool putValue)
00430 {
00431     LEditText *mname = dynamic_cast<LEditText*>
00432         (theDialog->FindPaneByID(item_ModuleName));
00433     LEditText *tname = dynamic_cast<LEditText*>
00434         (theDialog->FindPaneByID(item_BranchRev));
00435     LCheckBox *chkHasDate = dynamic_cast<LCheckBox*>
00436         (theDialog->FindPaneByID(item_CheckDate));
00437     LCheckBox *chkHasRev = dynamic_cast<LCheckBox*>
00438         (theDialog->FindPaneByID(item_CheckRevTag));
00439     LCheckBox *chkMostRecent = dynamic_cast<LCheckBox*>
00440         (theDialog->FindPaneByID(item_MostRecentRev));
00441     LCheckBox *chkLookAttic = dynamic_cast<LCheckBox*>
00442         (theDialog->FindPaneByID(item_InAttic));
00443     LEditText *editDate = dynamic_cast<LEditText*>
00444         (theDialog->FindPaneByID(item_EditDate));
00445     LEditText *editRev = dynamic_cast<LEditText*>
00446         (theDialog->FindPaneByID(item_EditRevTag));
00447     LPopupFiller *fillRev = dynamic_cast<LPopupFiller*>
00448         (theDialog->FindPaneByID(item_FillerRev1));
00449     LPopupFiller *fillTag = dynamic_cast<LPopupFiller*>
00450         (theDialog->FindPaneByID(item_FillerTag));
00451     LPopupFiller *fillDate = dynamic_cast<LPopupFiller*>
00452         (theDialog->FindPaneByID(item_FillerDate));
00453
00454     fillRev->DoDataExchange(gRevNames, putValue);
00455     fillTag->DoDataExchange(gRevNames, putValue);
00456     fillDate->DoDataExchange(gDateNames, putValue);
00457
00458     if(putValue)
00459     {
00460         mname->SetText((Ptr)(const char *)sLastModule, sLastModule.length());
00461         tname->SetText((Ptr)(const char *)sLastBranch, sLastBranch.length());
00462         chkHasDate->SetValue(hasDate ? Button_On : Button_Off);
00463         chkHasRev->SetValue(hasRev ? Button_On : Button_Off);
00464         chkMostRecent->SetValue(useMostRecent ? Button_On : Button_Off);
00465         chkLookAttic->SetValue(lookAttic ? Button_On : Button_Off);
00466         editDate->SetText((Ptr)(const char *)sLastDate, sLastDate.length());
00467         editRev->SetText((Ptr)(const char *)sLastRev, sLastRev.length());
00468     }
00469     else
00470     {
00471         hasDate = chkHasDate->GetValue() == Button_On;
00472         hasRev = chkHasRev->GetValue() == Button_On;
00473         useMostRecent = chkMostRecent->GetValue() == Button_On;
00474         lookAttic = chkLookAttic->GetValue() == Button_On;
00475
00476         char str[255];
00477         Size len;
00478
00479         mname->GetText(str, 254, &len);
00480         sLastModule.set(str, len);
00481         tname->GetText(str, 254, &len);
00482         sLastBranch.set(str, len);
00483         editDate->GetText(str, 254, &len);
00484         sLastDate.set(str, len);
00485         editRev->GetText(str, 254, &len);
00486         sLastRev.set(str, len);
00487     }
00488 }
00489
00490 static void DoDataExchange_RtagBranchOptions(LWindow *theDialog,
00491     bool & noRecurs, bool putValue)
00492 {
00493     LCheckBox *chkNoRecurs = dynamic_cast<LCheckBox*>
00494         (theDialog->FindPaneByID(item_NoRecurs));
00495
00496     if(putValue)
00497     {
00498         chkNoRecurs->SetValue(noRecurs ? Button_On : Button_Off);
00499     }
00500     else
00501     {
00502         noRecurs = chkNoRecurs->GetValue() == Button_On;
00503     }
00504 }
00505 #endif /* qMacCvsPP */
00506
00507 #if qUnix
00508 class UCvsRtagCreate : public UWidget
00509 {
00510     UDECLARE_DYNAMIC(UCvsRtagCreate)
00511 public:
00512     UCvsRtagCreate() : UWidget(::UEventGetWidID()) {}
00513     virtual ~UCvsRtagCreate() {}
00514
00515     enum
00516     {
00517         kOK = EV_COMMAND_START, // 0
00518         kCancel,                // 1
00519         kTabGeneral             // 2
00520     };
00521
00522     virtual void DoDataExchange(bool fill);
00523
00524 protected:
00525     ev_msg int OnOK(void);
00526     ev_msg int OnCancel(void);
00527
00528     UDECLARE_MESSAGE_MAP()
00529 };
00530
00531 UIMPLEMENT_DYNAMIC(UCvsRtagCreate, UWidget)
00532
00533 UBEGIN_MESSAGE_MAP(UCvsRtagCreate, UWidget)
00534     ON_UCOMMAND(UCvsRtagCreate::kOK, UCvsRtagCreate::OnOK)
00535     ON_UCOMMAND(UCvsRtagCreate::kCancel, UCvsRtagCreate::OnCancel)
00536 UEND_MESSAGE_MAP()
00537
00538 int UCvsRtagCreate::OnOK(void)
00539 {
00540     EndModal(true);
00541     return 0;
00542 }
00543
00544 int UCvsRtagCreate::OnCancel(void)
00545 {
00546     EndModal(false);
00547     return 0;
00548 }
00549
00550 void UCvsRtagCreate::DoDataExchange(bool fill)
00551 {
00552     if(fill)
00553     {
00554     }
00555     else
00556     {
00557     }
00558 }
00559
00560 class UCvsRtagCreate_MAIN : public UWidget
00561 {
00562     UDECLARE_DYNAMIC(UCvsRtagCreate_MAIN)
00563 public:
00564     UCvsRtagCreate_MAIN(const char * sLastModule, const char * sLastTag,
00565                         bool hasDate, bool hasRev,
00566                         const char * sLastDate, const char * sLastRev,
00567                         bool noRecurs, bool overwriteExist,
00568                         bool useMostRecent, bool lookAttic);
00569     virtual ~UCvsRtagCreate_MAIN() {}
00570
00571     enum
00572     {
00573         kEditTag = EV_COMMAND_START,    // 0
00574         kEditMod,           // 1
00575         kCheckRev,          // 2
00576         kCheckDate,         // 3
00577         kComboRev,          // 4
00578         kComboDate,         // 5
00579         kCheckRecurs,       // 6
00580         kCheckAttic,        // 7
00581         kCheckOverwrite,    // 8
00582         kCheckMatch         // 9
00583     };
00584
00585     virtual void DoDataExchange(bool fill);
00586
00587     bool m_attic;
00588     UStr m_date;
00589     UStr m_rev;
00590     bool m_hasdate;
00591     bool m_hasrev;
00592     bool m_norecurs;
00593     bool m_match;
00594     UStr m_modname;
00595     UStr m_tagname;
00596     bool m_overwrite;
00597 protected:
00598     ev_msg int OnChecks(int cmd);
00599
00600     UDECLARE_MESSAGE_MAP()
00601 };
00602
00603 UIMPLEMENT_DYNAMIC(UCvsRtagCreate_MAIN, UWidget)
00604
00605 UBEGIN_MESSAGE_MAP(UCvsRtagCreate_MAIN, UWidget)
00606     ON_UCOMMAND_RANGE(UCvsRtagCreate_MAIN::kCheckRev, UCvsRtagCreate_MAIN::kCheckDate, UCvsRtagCreate_MAIN::OnChecks)
00607 UEND_MESSAGE_MAP()
00608
00609 UCvsRtagCreate_MAIN::UCvsRtagCreate_MAIN(const char * sLastModule, const char * sLastTag,
00610                                          bool hasDate, bool hasRev,
00611                                          const char * sLastDate, const char * sLastRev,
00612                                          bool noRecurs, bool overwriteExist,
00613                                          bool useMostRecent, bool lookAttic) : UWidget(::UEventGetWidID())
00614 {
00615     m_attic = lookAttic;
00616     m_date = sLastDate;
00617     m_rev = sLastRev;
00618     m_hasdate = hasDate;
00619     m_hasrev = hasRev;
00620     m_norecurs = noRecurs;
00621     m_match = useMostRecent;
00622     m_modname = sLastModule;
00623     m_tagname = sLastTag;
00624     m_overwrite = overwriteExist;
00625 }
00626
00627 int UCvsRtagCreate_MAIN::OnChecks(int cmd)
00628 {
00629     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, cmd, 0L);
00630     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(cmd + 2, state), 0L);
00631     return 0;
00632 }
00633
00634 void UCvsRtagCreate_MAIN::DoDataExchange(bool fill)
00635 {
00636     ::DoDataExchange(fill, GetWidID(), kComboRev, gRevNames);
00637     ::DoDataExchange(fill, GetWidID(), kComboDate, gDateNames);
00638
00639     if(fill)
00640     {
00641         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditTag, (void *)(const char *)m_tagname);
00642         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditMod, (void *)(const char *)m_modname);
00643         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboRev, (void *)(const char *)m_rev);
00644         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboDate, (void *)(const char *)m_date);
00645
00646         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckDate, m_hasdate), 0L);
00647         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRev, m_hasrev), 0L);
00648         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckAttic, m_attic), 0L);
00649         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurs, m_norecurs), 0L);
00650         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckOverwrite, m_overwrite), 0L);
00651         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckMatch, m_match), 0L);
00652
00653         OnChecks(kCheckRev);
00654         OnChecks(kCheckDate);
00655     }
00656     else
00657     {
00658         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditTag, &m_tagname);
00659         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditMod, &m_modname);
00660         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboRev, &m_rev);
00661         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboDate, &m_date);
00662
00663         m_hasdate = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDate, 0L);
00664         m_hasrev = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRev, 0L);
00665         m_attic = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckAttic, 0L);
00666         m_norecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurs, 0L);
00667         m_overwrite = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckOverwrite, 0L);
00668         m_match = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckMatch, 0L);
00669     }
00670 }
00671
00672 class UCvsRtagDel : public UWidget
00673 {
00674     UDECLARE_DYNAMIC(UCvsRtagDel)
00675 public:
00676     UCvsRtagDel() : UWidget(::UEventGetWidID()) {}
00677     virtual ~UCvsRtagDel() {}
00678
00679     enum
00680     {
00681         kOK = EV_COMMAND_START, // 0
00682         kCancel,                // 1
00683         kTabGeneral             // 2
00684     };
00685
00686     virtual void DoDataExchange(bool fill);
00687
00688 protected:
00689     ev_msg int OnOK(void);
00690     ev_msg int OnCancel(void);
00691
00692     UDECLARE_MESSAGE_MAP()
00693 };
00694
00695 UIMPLEMENT_DYNAMIC(UCvsRtagDel, UWidget)
00696
00697 UBEGIN_MESSAGE_MAP(UCvsRtagDel, UWidget)
00698     ON_UCOMMAND(UCvsRtagDel::kOK, UCvsRtagDel::OnOK)
00699     ON_UCOMMAND(UCvsRtagDel::kCancel, UCvsRtagDel::OnCancel)
00700 UEND_MESSAGE_MAP()
00701
00702 int UCvsRtagDel::OnOK(void)
00703 {
00704     EndModal(true);
00705     return 0;
00706 }
00707
00708 int UCvsRtagDel::OnCancel(void)
00709 {
00710     EndModal(false);
00711     return 0;
00712 }
00713
00714 void UCvsRtagDel::DoDataExchange(bool fill)
00715 {
00716     if(fill)
00717     {
00718     }
00719     else
00720     {
00721     }
00722 }
00723
00724 class UCvsRtagDel_MAIN : public UWidget
00725 {
00726     UDECLARE_DYNAMIC(UCvsRtagDel_MAIN)
00727 public:
00728     UCvsRtagDel_MAIN(const char * sLastModule,
00729                      const char * sLastTag, bool noRecurs,
00730                      bool lookAttic);
00731     virtual ~UCvsRtagDel_MAIN() {}
00732
00733     enum
00734     {
00735         kEditTag = EV_COMMAND_START,    // 0
00736         kEditMod,           // 1
00737         kCheckRecurs,       // 2
00738         kCheckAttic         // 3
00739     };
00740
00741     virtual void DoDataExchange(bool fill);
00742
00743     bool m_attic;
00744     bool m_norecurs;
00745     UStr m_modname;
00746     UStr m_tagname;
00747 protected:
00748
00749     UDECLARE_MESSAGE_MAP()
00750 };
00751
00752 UIMPLEMENT_DYNAMIC(UCvsRtagDel_MAIN, UWidget)
00753
00754 UBEGIN_MESSAGE_MAP(UCvsRtagDel_MAIN, UWidget)
00755 UEND_MESSAGE_MAP()
00756
00757 UCvsRtagDel_MAIN::UCvsRtagDel_MAIN(const char * sLastModule,
00758                                    const char * sLastTag, bool noRecurs,
00759                                    bool lookAttic) : UWidget(::UEventGetWidID())
00760 {
00761     m_attic = lookAttic;
00762     m_norecurs = noRecurs;
00763     m_modname = sLastModule;
00764     m_tagname = sLastTag;
00765 }
00766
00767 void UCvsRtagDel_MAIN::DoDataExchange(bool fill)
00768 {
00769     if(fill)
00770     {
00771         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditTag, (void *)(const char *)m_tagname);
00772         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditMod, (void *)(const char *)m_modname);
00773
00774         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckAttic, m_attic), 0L);
00775         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurs, m_norecurs), 0L);
00776     }
00777     else
00778     {
00779         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditTag, &m_tagname);
00780         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditMod, &m_modname);
00781
00782         m_attic = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckAttic, 0L);
00783         m_norecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurs, 0L);
00784     }
00785 }
00786
00787 class UCvsRtagBranch : public UWidget
00788 {
00789     UDECLARE_DYNAMIC(UCvsRtagBranch)
00790 public:
00791     UCvsRtagBranch() : UWidget(::UEventGetWidID()) {}
00792     virtual ~UCvsRtagBranch() {}
00793
00794     enum
00795     {
00796         kOK = EV_COMMAND_START, // 0
00797         kCancel,                // 1
00798         kTabGeneral             // 2
00799     };
00800
00801     virtual void DoDataExchange(bool fill);
00802
00803 protected:
00804     ev_msg int OnOK(void);
00805     ev_msg int OnCancel(void);
00806
00807     UDECLARE_MESSAGE_MAP()
00808 };
00809
00810 UIMPLEMENT_DYNAMIC(UCvsRtagBranch, UWidget)
00811
00812 UBEGIN_MESSAGE_MAP(UCvsRtagBranch, UWidget)
00813     ON_UCOMMAND(UCvsRtagBranch::kOK, UCvsRtagBranch::OnOK)
00814     ON_UCOMMAND(UCvsRtagBranch::kCancel, UCvsRtagBranch::OnCancel)
00815 UEND_MESSAGE_MAP()
00816
00817 int UCvsRtagBranch::OnOK(void)
00818 {
00819     EndModal(true);
00820     return 0;
00821 }
00822
00823 int UCvsRtagBranch::OnCancel(void)
00824 {
00825     EndModal(false);
00826     return 0;
00827 }
00828
00829 void UCvsRtagBranch::DoDataExchange(bool fill)
00830 {
00831     if(fill)
00832     {
00833     }
00834     else
00835     {
00836     }
00837 }
00838
00839 class UCvsRtagBranch_MAIN : public UWidget
00840 {
00841     UDECLARE_DYNAMIC(UCvsRtagBranch_MAIN)
00842 public:
00843     UCvsRtagBranch_MAIN(const char * sLastModule, const char * sLastTag,
00844                         bool hasDate, bool hasRev,
00845                         const char * sLastDate, const char * sLastRev,
00846                         bool noRecurs, bool useMostRecent, bool lookAttic);
00847     virtual ~UCvsRtagBranch_MAIN() {}
00848
00849     enum
00850     {
00851         kEditTag = EV_COMMAND_START,    // 0
00852         kEditMod,           // 1
00853         kCheckRev,          // 2
00854         kCheckDate,         // 3
00855         kComboRev,          // 4
00856         kComboDate,         // 5
00857         kCheckRecurs,       // 6
00858         kCheckAttic,        // 7
00859         kCheckMatch         // 9
00860     };
00861
00862     virtual void DoDataExchange(bool fill);
00863
00864     bool m_attic;
00865     UStr m_date;
00866     UStr m_rev;
00867     bool m_hasdate;
00868     bool m_hasrev;
00869     bool m_norecurs;
00870     bool m_match;
00871     UStr m_modname;
00872     UStr m_tagname;
00873 protected:
00874     ev_msg int OnChecks(int cmd);
00875
00876     UDECLARE_MESSAGE_MAP()
00877 };
00878
00879 UIMPLEMENT_DYNAMIC(UCvsRtagBranch_MAIN, UWidget)
00880
00881 UBEGIN_MESSAGE_MAP(UCvsRtagBranch_MAIN, UWidget)
00882     ON_UCOMMAND_RANGE(UCvsRtagBranch_MAIN::kCheckRev, UCvsRtagBranch_MAIN::kCheckDate, UCvsRtagBranch_MAIN::OnChecks)
00883 UEND_MESSAGE_MAP()
00884
00885 UCvsRtagBranch_MAIN::UCvsRtagBranch_MAIN(const char * sLastModule, const char * sLastTag,
00886                                              bool hasDate, bool hasRev, const char * sLastDate,
00887                                              const char * sLastRev, bool noRecurs, bool useMostRecent,
00888                                              bool lookAttic) : UWidget(::UEventGetWidID())
00889 {
00890     m_attic = lookAttic;
00891     m_date = sLastDate;
00892     m_rev = sLastRev;
00893     m_hasdate = hasDate;
00894     m_hasrev = hasRev;
00895     m_norecurs = noRecurs;
00896     m_match = useMostRecent;
00897     m_modname = sLastModule;
00898     m_tagname = sLastTag;
00899 }
00900
00901 int UCvsRtagBranch_MAIN::OnChecks(int cmd)
00902 {
00903     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, cmd, 0L);
00904     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(cmd + 2, state), 0L);
00905     return 0;
00906 }
00907
00908 void UCvsRtagBranch_MAIN::DoDataExchange(bool fill)
00909 {
00910     ::DoDataExchange(fill, GetWidID(), kComboRev, gRevNames);
00911     ::DoDataExchange(fill, GetWidID(), kComboDate, gDateNames);
00912
00913     if(fill)
00914     {
00915         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditTag, (void *)(const char *)m_tagname);
00916         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditMod, (void *)(const char *)m_modname);
00917         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboRev, (void *)(const char *)m_rev);
00918         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboDate, (void *)(const char *)m_date);
00919
00920         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckDate, m_hasdate), 0L);
00921         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRev, m_hasrev), 0L);
00922         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckAttic, m_attic), 0L);
00923         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurs, m_norecurs), 0L);
00924         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckMatch, m_match), 0L);
00925
00926         OnChecks(kCheckRev);
00927         OnChecks(kCheckDate);
00928     }
00929     else
00930     {
00931         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditTag, &m_tagname);
00932         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditMod, &m_modname);
00933         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboRev, &m_rev);
00934         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboDate, &m_date);
00935
00936         m_hasdate = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDate, 0L);
00937         m_hasrev = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRev, 0L);
00938         m_attic = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckAttic, 0L);
00939         m_norecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurs, 0L);
00940         m_match = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckMatch, 0L);
00941     }
00942 }
00943
00944 #endif // qUnix
00945
00946 bool CompatRtagCreate(bool & noRecurs, bool & overwriteExisting, CPStr & tagName,
00947                      CPStr & modName, CPStr & date, CPStr & rev,
00948                      bool & useMostRecent, bool & lookAttic)
00949 {
00950     bool userHitOK = false;
00951
00952     static CPStr sLastModule;
00953     static CPStr sLastTag;
00954     static CPStr sLastDate;
00955     static CPStr sLastRev;
00956
00957     bool hasDate = false;
00958     bool hasRev = false;
00959
00960     date = "";
00961     rev = "";
00962     tagName = "";
00963     modName = "";
00964     noRecurs = false;
00965     overwriteExisting = false;
00966     useMostRecent = false;
00967     lookAttic = false;
00968
00969 #ifdef WIN32
00970     CPropertySheet pages("Create tag settings");
00971     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00972     CRtag_MAIN page1(kRtagAdd, sLastModule, sLastTag, noRecurs, lookAttic, overwriteExisting);
00973     CRtag_OPTIONS page2(kRtagAdd, hasDate, hasRev, sLastDate, sLastRev, useMostRecent);
00974     CGetPrefs_GLOBALS page3;
00975     pages.AddPage(&page1);
00976     pages.AddPage(&page2);
00977     pages.AddPage(&page3);
00978     if(pages.DoModal() == IDOK)
00979     {
00980         sLastModule = page1.m_moduleName;
00981         sLastTag = page1.m_tagName;
00982         noRecurs = page1.m_noRecurs == TRUE;
00983         overwriteExisting = page1.m_overwriteExisting == TRUE;
00984         lookAttic = page1.m_lookAttic == TRUE;
00985
00986         sLastDate = page2.m_date;
00987         sLastRev = page2.m_rev;
00988         hasDate = page2.m_hasDate == TRUE;
00989         hasRev = page2.m_hasRev == TRUE;
00990         useMostRecent = page2.m_useMostRecent == TRUE;
00991
00992         page3.StoreValues();
00993         userHitOK = true;
00994     }
00995 #endif /* WIN32 */
00996 #if qUnix
00997     void *wid = UCreate_TagModDlg();
00998
00999     UCvsRtagCreate *dlg = new UCvsRtagCreate();
01000     UCvsRtagCreate_MAIN *tab1 =
01001         new UCvsRtagCreate_MAIN(sLastModule, sLastTag, hasDate, hasRev,
01002                                 sLastDate, sLastRev, noRecurs, overwriteExisting,
01003                                 useMostRecent, lookAttic);
01004     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01005     dlg->AddPage(tab1, UCvsRtagCreate::kTabGeneral, 0);
01006
01007     if(dlg->DoModal())
01008     {
01009         lookAttic = tab1->m_attic;
01010         sLastDate = tab1->m_date;
01011         sLastRev = tab1->m_rev;
01012         hasDate = tab1->m_hasdate;
01013         hasRev = tab1->m_hasrev;
01014         noRecurs = tab1->m_norecurs;
01015         useMostRecent = tab1->m_match;
01016         sLastModule = tab1->m_modname;
01017         sLastTag = tab1->m_tagname;
01018         overwriteExisting = tab1->m_overwrite;
01019
01020         userHitOK = true;
01021     }
01022
01023     delete dlg;
01024 #endif // qUnix
01025 #ifdef qMacCvsPP
01026     StDialogHandler theHandler(dlg_RtagCreate, LCommander::GetTopCommander());
01027     LWindow *theDialog = theHandler.GetDialog();
01028     ThrowIfNil_(theDialog);
01029     static UInt16 sRuntimePanel = 1;
01030
01031     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01032         (theDialog->FindPaneByID(item_MultiViewPrefs));
01033     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01034
01035     multiView->SwitchToPanel(3);
01036     DoDataExchange_Globals(theDialog, true);
01037     multiView->SwitchToPanel(2);
01038     DoDataExchange_RtagCreateOptions(theDialog, noRecurs, overwriteExisting, true);
01039     multiView->SwitchToPanel(1);
01040     DoDataExchange_RtagCreateMain(theDialog, sLastModule, sLastTag,
01041         hasDate, hasRev, sLastDate, sLastRev,
01042         useMostRecent, lookAttic, true);
01043
01044     groupView->SetValue(sRuntimePanel);
01045     theDialog->Show();
01046     MessageT hitMessage;
01047     while (true)
01048     {       // Let DialogHandler process events
01049         hitMessage = theHandler.DoDialog();
01050
01051         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01052             break;
01053     }
01054     theDialog->Hide();
01055     sRuntimePanel = groupView->GetValue();
01056
01057     if(hitMessage == msg_OK)
01058     {
01059         multiView->SwitchToPanel(1);
01060         DoDataExchange_RtagCreateMain(theDialog, sLastModule, sLastTag,
01061             hasDate, hasRev, sLastDate, sLastRev,
01062             useMostRecent, lookAttic, false);
01063         multiView->SwitchToPanel(2);
01064         DoDataExchange_RtagCreateOptions(theDialog, noRecurs, overwriteExisting, false);
01065         multiView->SwitchToPanel(3);
01066         DoDataExchange_Globals(theDialog, false);
01067         userHitOK = true;
01068     }
01069 #endif /* qMacCvsPP */
01070
01071     if(userHitOK)
01072     {
01073         if(hasDate && !sLastDate.empty())
01074             date = sLastDate;
01075         if(hasRev && !sLastRev.empty())
01076             rev = sLastRev;
01077
01078         tagName = sLastTag;
01079         modName = sLastModule;
01080
01081         gCvsPrefs.save();
01082     }
01083
01084     return userHitOK;
01085 }
01086
01087 bool CompatRtagDelete(bool & noRecurs, bool & lookAttic,
01088                      CPStr & tagName, CPStr & modName)
01089 {
01090
01091     bool userHitOK = false;
01092
01093     static CPStr sLastModule;
01094     static CPStr sLastTag;
01095
01096     tagName = "";
01097     modName = "";
01098     noRecurs = false;
01099     lookAttic = false;
01100
01101 #ifdef WIN32
01102     CPropertySheet pages("Delete tag settings");
01103     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01104     CRtag_MAIN page1(kRtagDelete, sLastModule, sLastTag, noRecurs, lookAttic);
01105     CGetPrefs_GLOBALS page2;
01106     pages.AddPage(&page1);
01107     pages.AddPage(&page2);
01108     if(pages.DoModal() == IDOK)
01109     {
01110         lookAttic = page1.m_lookAttic == TRUE;
01111         noRecurs = page1.m_noRecurs == TRUE;
01112         sLastModule = page1.m_moduleName;
01113         sLastTag = page1.m_tagName;
01114
01115         page2.StoreValues();
01116         userHitOK = true;
01117     }
01118 #endif /* WIN32 */
01119 #if qUnix
01120     void *wid = UCreate_UntagModDlg();
01121
01122     UCvsRtagDel *dlg = new UCvsRtagDel();
01123     UCvsRtagDel_MAIN *tab1 = new UCvsRtagDel_MAIN(sLastModule, sLastTag,
01124                                                   noRecurs, lookAttic);
01125     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01126     dlg->AddPage(tab1, UCvsRtagDel::kTabGeneral, 0);
01127
01128     if(dlg->DoModal())
01129     {
01130         lookAttic = tab1->m_attic;
01131         noRecurs = tab1->m_norecurs;
01132         sLastModule = tab1->m_modname;
01133         sLastTag = tab1->m_tagname;
01134
01135         userHitOK = true;
01136     }
01137
01138     delete dlg;
01139 #endif // qUnix
01140 #ifdef qMacCvsPP
01141     StDialogHandler theHandler(dlg_RtagDelete, LCommander::GetTopCommander());
01142     LWindow *theDialog = theHandler.GetDialog();
01143     ThrowIfNil_(theDialog);
01144     static UInt16 sRuntimePanel = 1;
01145
01146     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01147         (theDialog->FindPaneByID(item_MultiViewPrefs));
01148     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01149
01150     multiView->SwitchToPanel(2);
01151     DoDataExchange_Globals(theDialog, true);
01152     multiView->SwitchToPanel(1);
01153     DoDataExchange_RtagDeleteMain(theDialog, sLastModule, sLastTag,
01154         noRecurs, lookAttic, true);
01155
01156     groupView->SetValue(sRuntimePanel);
01157     theDialog->Show();
01158     MessageT hitMessage;
01159     while (true)
01160     {       // Let DialogHandler process events
01161         hitMessage = theHandler.DoDialog();
01162
01163         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01164             break;
01165     }
01166     theDialog->Hide();
01167     sRuntimePanel = groupView->GetValue();
01168
01169     if(hitMessage == msg_OK)
01170     {
01171         multiView->SwitchToPanel(1);
01172         DoDataExchange_RtagDeleteMain(theDialog, sLastModule, sLastTag,
01173             noRecurs, lookAttic, false);
01174         multiView->SwitchToPanel(2);
01175         DoDataExchange_Globals(theDialog, false);
01176         userHitOK = true;
01177     }
01178 #endif /* qMacCvsPP */
01179
01180     if(userHitOK)
01181     {
01182         tagName = sLastTag;
01183         modName = sLastModule;
01184
01185         gCvsPrefs.save();
01186     }
01187
01188     return userHitOK;
01189 }
01190
01191 bool CompatRtagBranch(bool & noRecurs, CPStr & branchName,
01192                      CPStr & modName, CPStr & date, CPStr & rev,
01193                      bool & useMostRecent, bool & lookAttic)
01194 {
01195     bool userHitOK = false;
01196
01197     static CPStr sLastModule;
01198     static CPStr sLastBranch;
01199     static CPStr sLastDate;
01200     static CPStr sLastRev;
01201
01202     bool hasDate = false;
01203     bool hasRev = false;
01204
01205     date = "";
01206     rev = "";
01207     branchName = "";
01208     modName = "";
01209     noRecurs = false;
01210     useMostRecent = false;
01211     lookAttic = false;
01212
01213 #ifdef WIN32
01214     CPropertySheet pages("Create branch settings");
01215     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01216
01217     CRtag_MAIN page1(kRtagFork, sLastModule, sLastBranch, noRecurs, lookAttic);
01218     CRtag_OPTIONS page2(kRtagFork, hasDate, hasRev, sLastDate, sLastRev, useMostRecent);
01219     CGetPrefs_GLOBALS page3;
01220     pages.AddPage(&page1);
01221     pages.AddPage(&page2);
01222     pages.AddPage(&page3);
01223     if(pages.DoModal() == IDOK)
01224     {
01225         sLastModule = page1.m_moduleName;
01226         sLastBranch = page1.m_tagName;
01227         noRecurs = page1.m_noRecurs == TRUE;
01228         lookAttic = page1.m_lookAttic == TRUE;
01229         sLastDate = page2.m_date;
01230         sLastRev = page2.m_rev;
01231         hasDate = page2.m_hasDate == TRUE;
01232         hasRev = page2.m_hasRev == TRUE;
01233         useMostRecent = page2.m_useMostRecent == TRUE;
01234
01235         page3.StoreValues();
01236         userHitOK = true;
01237     }
01238 #endif /* WIN32 */
01239 #if qUnix
01240     void *wid = UCreate_BranchModDlg();
01241
01242     UCvsRtagBranch *dlg = new UCvsRtagBranch();
01243     UCvsRtagBranch_MAIN *tab1 =
01244         new UCvsRtagBranch_MAIN(sLastModule, sLastBranch, hasDate, hasRev,
01245                                   sLastDate, sLastRev, noRecurs, useMostRecent,
01246                                   lookAttic);
01247     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01248     dlg->AddPage(tab1, UCvsRtagBranch::kTabGeneral, 0);
01249
01250     if(dlg->DoModal())
01251     {
01252         lookAttic = tab1->m_attic;
01253         sLastDate = tab1->m_date;
01254         sLastRev = tab1->m_rev;
01255         hasDate = tab1->m_hasdate;
01256         hasRev = tab1->m_hasrev;
01257         noRecurs = tab1->m_norecurs;
01258         useMostRecent = tab1->m_match;
01259         sLastModule = tab1->m_modname;
01260         sLastBranch = tab1->m_tagname;
01261
01262         userHitOK = true;
01263     }
01264
01265     delete dlg;
01266 #endif // qUnix
01267 #ifdef qMacCvsPP
01268     StDialogHandler theHandler(dlg_RtagBranch, LCommander::GetTopCommander());
01269     LWindow *theDialog = theHandler.GetDialog();
01270     ThrowIfNil_(theDialog);
01271     static UInt16 sRuntimePanel = 1;
01272
01273     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01274         (theDialog->FindPaneByID(item_MultiViewPrefs));
01275     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01276
01277     multiView->SwitchToPanel(3);
01278     DoDataExchange_Globals(theDialog, true);
01279     multiView->SwitchToPanel(2);
01280     DoDataExchange_RtagBranchOptions(theDialog, noRecurs, true);
01281     multiView->SwitchToPanel(1);
01282     DoDataExchange_RtagBranchMain(theDialog, sLastModule, sLastBranch,
01283         hasDate, hasRev, sLastDate, sLastRev,
01284         useMostRecent, lookAttic, true);
01285
01286     groupView->SetValue(sRuntimePanel);
01287     theDialog->Show();
01288     MessageT hitMessage;
01289     while (true)
01290     {       // Let DialogHandler process events
01291         hitMessage = theHandler.DoDialog();
01292
01293         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01294             break;
01295     }
01296     theDialog->Hide();
01297     sRuntimePanel = groupView->GetValue();
01298
01299     if(hitMessage == msg_OK)
01300     {
01301         multiView->SwitchToPanel(1);
01302         DoDataExchange_RtagBranchMain(theDialog, sLastModule, sLastBranch,
01303             hasDate, hasRev, sLastDate, sLastRev,
01304             useMostRecent, lookAttic, false);
01305         multiView->SwitchToPanel(2);
01306         DoDataExchange_RtagBranchOptions(theDialog, noRecurs, false);
01307         multiView->SwitchToPanel(3);
01308         DoDataExchange_Globals(theDialog, false);
01309         userHitOK = true;
01310     }
01311 #endif /* qMacCvsPP */
01312
01313     if(userHitOK)
01314     {
01315         if(hasDate && !sLastDate.empty())
01316             date = sLastDate;
01317         if(hasRev && !sLastRev.empty())
01318             rev = sLastRev;
01319
01320         branchName = sLastBranch;
01321         modName = sLastModule;
01322
01323         gCvsPrefs.save();
01324     }
01325
01326     return userHitOK;
01327 }
Generated on Sun Feb 24 01:21:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/RtagDlg.h Source File

common/RtagDlg.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- July 1998
00019  */
00020
00021 /*
00022  * RtagDlg.h : the cvs rtag dialog
00023  */
00024
00025 #if !defined(AFX_RTAGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
00026 #define AFX_RTAGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif // _MSC_VER >= 1000
00031
00032 #include "CPStr.h"
00033 #include "SmartComboBox.h"
00034
00035 bool CompatRtagCreate(bool & noRecurs, bool & overwriteExisting, CPStr & tagName,
00036                      CPStr & modName, CPStr & date, CPStr & rev,
00037                      bool & useMostRecent, bool & lookAttic);
00038
00039 bool CompatRtagDelete(bool & noRecurs, bool & lookAttic,
00040                      CPStr & tagName, CPStr & modName);
00041
00042 bool CompatRtagBranch(bool & noRecurs, CPStr & branchName,
00043                      CPStr & modName, CPStr & date, CPStr & rev,
00044                      bool & useMostRecent, bool & lookAttic);
00045     // get the rtag options...
00046
00047 extern CMString gOldModules;
00048
00049 typedef enum
00050 {
00051     kRtagAdd,
00052     kRtagDelete,
00053     kRtagFork
00054 } kRtagDlgType;
00055
00056 #ifdef WIN32
00057
00058 // CRtag_MAIN dialog
00059
00060 class CRtag_MAIN : public CPropertyPage
00061 {
00062     DECLARE_DYNCREATE(CRtag_MAIN)
00063
00064 // Construction
00065 public:
00066     CRtag_MAIN(kRtagDlgType type,
00067         const char *sLastModule, const char *sLastTag,
00068         bool noRecurs, bool lookAttic, bool overwriteExist = false);
00069     CRtag_MAIN();
00070     ~CRtag_MAIN();
00071
00072 // Dialog Data
00073     //{{AFX_DATA(CRtag_MAIN)
00074     enum { IDD = IDD_RTAG_MAIN };
00075     CButton m_overwriteExistingCheck;
00076     CStatic m_moduleDescStatic;
00077     CStatic m_tagDescStatic;
00078     CButton m_grpBox;
00079     CSmartComboBox  m_moduleCombo;
00080     CSmartComboBox  m_tagCombo;
00081     CString m_tagName;
00082     CString m_moduleName;
00083     BOOL    m_noRecurs;
00084     BOOL    m_lookAttic;
00085     BOOL    m_overwriteExisting;
00086     //}}AFX_DATA
00087
00088
00089 // Overrides
00090     // ClassWizard generate virtual function overrides
00091     //{{AFX_VIRTUAL(CRtag_MAIN)
00092     protected:
00093     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00094     //}}AFX_VIRTUAL
00095
00096 // Implementation
00097 protected:
00098     // Generated message map functions
00099     //{{AFX_MSG(CRtag_MAIN)
00100     virtual BOOL OnInitDialog();
00101     //}}AFX_MSG
00102     DECLARE_MESSAGE_MAP()
00103 private:
00104     kRtagDlgType m_type;
00105 };
00106
00108 // CRtag_OPTIONS dialog
00109
00110 class CRtag_OPTIONS : public CPropertyPage
00111 {
00112     DECLARE_DYNCREATE(CRtag_OPTIONS)
00113
00114 // Construction
00115 public:
00116     CRtag_OPTIONS(kRtagDlgType type,
00117         bool hasDate, bool hasRev,
00118         const char *sLastDate, const char *sLastRev,
00119         bool useMostRecent);
00120     CRtag_OPTIONS();
00121     ~CRtag_OPTIONS();
00122
00123 // Dialog Data
00124     //{{AFX_DATA(CRtag_OPTIONS)
00125     enum { IDD = IDD_RTAG_OPTIONS };
00126     CSmartComboBox  m_revCombo;
00127     CSmartComboBox  m_dateCombo;
00128     CButton m_grpBox;
00129     CString m_date;
00130     CString m_rev;
00131     BOOL    m_hasDate;
00132     BOOL    m_hasRev;
00133     BOOL    m_useMostRecent;
00134     //}}AFX_DATA
00135
00136
00137 // Overrides
00138     // ClassWizard generate virtual function overrides
00139     //{{AFX_VIRTUAL(CRtag_OPTIONS)
00140     protected:
00141     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00142     //}}AFX_VIRTUAL
00143
00144 // Implementation
00145 protected:
00146     // Generated message map functions
00147     //{{AFX_MSG(CRtag_OPTIONS)
00148     afx_msg void OnDate();
00149     afx_msg void OnRev();
00150     virtual BOOL OnInitDialog();
00151     //}}AFX_MSG
00152     DECLARE_MESSAGE_MAP()
00153 private:
00154     kRtagDlgType m_type;
00155 };
00156
00157 //{{AFX_INSERT_LOCATION}}
00158 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00159 #endif /* WIN32 */
00160
00161 #endif // !defined(AFX_RTAGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/SmartComboBox.cpp Source File

common/SmartComboBox.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- December 2001
00019  */
00020
00021 // SmartComboBox.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025 #include "SmartComboBox.h"
00026
00027 #ifdef WIN32
00028 #   include "resource.h"
00029 #endif /* WIN32 */
00030
00031 #include "MultiString.h"
00032 #include "CvsAlert.h"
00033
00034 #ifdef WIN32
00035
00036 #ifdef _DEBUG
00037 #define new DEBUG_NEW
00038 #undef THIS_FILE
00039 static char THIS_FILE[] = __FILE__;
00040 #endif
00041
00042 #endif /* WIN32 */
00043
00045 USmartCombo::USmartCombo(int feature)
00046     : m_feature(feature)
00047 {
00048     m_pstrItems = NULL;
00049 }
00050
00052 USmartCombo::~USmartCombo()
00053 {
00054 }
00055
00060 void USmartCombo::SetFeature(int feature)
00061 {
00062     m_feature = feature;
00063     SetReadOnly(0 != (m_feature & USmartCombo::ReadOnly));
00064 }
00065
00070 bool USmartCombo::HasFeature(int feature) const
00071 {
00072     return (m_feature & feature) != 0;
00073 }
00074
00082 void USmartCombo::SetItems(CMString* pstrItems)
00083 {
00084     m_pstrItems = pstrItems;
00085     if( m_pstrItems )
00086     {
00087         m_feature |= USmartCombo::RemoveItems;
00088     }
00089     else
00090     {
00091         m_feature &= ~USmartCombo::RemoveItems;
00092     }
00093 }
00094
00101 CMString* USmartCombo::GetItems()
00102 {
00103     return m_pstrItems;
00104 }
00105
00106
00112 int USmartCombo::CalcDroppedWidth()
00113 {
00114     return 0;
00115 }
00116
00121 void USmartCombo::SetReadOnly(bool readOnly /*= true*/)
00122 {
00123     if( readOnly )
00124     {
00125         m_feature |= USmartCombo::ReadOnly;
00126     }
00127     else
00128     {
00129         m_feature &= ~USmartCombo::ReadOnly;
00130     }
00131 }
00132
00138 bool USmartCombo::RemoveItem(const char* strItem)
00139 {
00140     UStr prompt("Do you want to remove that item from the list?\n");
00141     prompt << "Item: ";
00142     prompt << strItem;
00143
00144     bool res = CvsAlert(prompt, "Yes", "No");
00145     if( res )
00146     {
00147         m_pstrItems->Remove(strItem);
00148     }
00149
00150     return res;
00151 }
00152
00153 #ifdef WIN32
00154
00155 // CSmartComboBox
00156
00157 CSmartComboBox::CSmartComboBox(int feature /*= USmartCombo::DefaultFeature*/)
00158     : USmartCombo(feature)
00159 {
00160 }
00161
00162 CSmartComboBox::~CSmartComboBox()
00163 {
00164 }
00165
00166
00167 BEGIN_MESSAGE_MAP(CSmartComboBox, CComboBox)
00168     //{{AFX_MSG_MAP(CSmartComboBox)
00169     ON_CONTROL_REFLECT(CBN_DROPDOWN, OnDropdown)
00170     //}}AFX_MSG_MAP
00171     ON_MESSAGE(WM_SMCB_SETFEATURE, OnSetFeature)
00172     ON_MESSAGE(WM_SMCB_SETITEMS, OnSetItems)
00173     ON_MESSAGE(WM_SMCB_SETREADONLY, OnSetReadOnly)
00174 END_MESSAGE_MAP()
00175
00177 // CSmartComboBox message handlers
00178
00183 void CSmartComboBox::OnDropdown()
00184 {
00185     if( HasFeature(USmartCombo::AutoDropWidth) )
00186     {
00187         SetDroppedWidth(CalcDroppedWidth());
00188     }
00189 }
00190
00195 BOOL CSmartComboBox::PreTranslateMessage(MSG* pMsg)
00196 {
00197     if( HasFeature(USmartCombo::RemoveItems) )
00198     {
00199         if( DelKeyTest(pMsg) )
00200         {
00201             return TRUE;
00202         }
00203     }
00204
00205     return CComboBox::PreTranslateMessage(pMsg);
00206 }
00207
00213 int CSmartComboBox::CalcDroppedWidth()
00214 {
00215     int maxSize = 0;
00216
00217     CClientDC ClientDC(this);
00218     int savedDC = ClientDC.SaveDC();
00219     ClientDC.SelectObject(GetFont());
00220
00221     CString strLBText;
00222     for( int nIndex = 0; nIndex < GetCount(); nIndex++ )
00223     {
00224         GetLBText( nIndex, strLBText );
00225         CSize size = ClientDC.GetTextExtent(strLBText);
00226
00227         if( size.cx > maxSize )
00228         {
00229             maxSize = size.cx;
00230         }
00231     }
00232     ClientDC.RestoreDC(savedDC);
00233
00234     maxSize += ::GetSystemMetrics(SM_CXVSCROLL) + 3*::GetSystemMetrics(SM_CXEDGE);
00235
00236     CRect rect;
00237     GetWindowRect(rect);
00238     maxSize = min(ClientDC.GetDeviceCaps(HORZRES) - rect.TopLeft().x, maxSize);
00239
00240     return maxSize;
00241 }
00242
00249 BOOL CSmartComboBox::DelKeyTest(MSG* pMsg)
00250 {
00251     CMString* pstrItems = GetItems();
00252     ASSERT(pstrItems != NULL);
00253
00254     BOOL bRes = FALSE;
00255
00256     if( WM_KEYDOWN == pMsg->message &&
00257         VK_DELETE == (int)pMsg->wParam &&
00258         pstrItems &&
00259         GetDroppedState() )
00260     {
00261         int sel = GetCurSel();
00262         if( CB_ERR < sel )
00263         {
00264             CString strItem;
00265             GetLBText(sel, strItem);
00266
00267             if( RemoveItem(strItem) )
00268             {
00269                 DeleteString(sel);
00270             }
00271
00272             //we have to prevent it going to another window
00273             bRes = TRUE;
00274         }
00275     }
00276
00277     return bRes;
00278 }
00279
00284 void CSmartComboBox::PreSubclassWindow()
00285 {
00286     if( HasFeature(USmartCombo::ReadOnly) )
00287     {
00288         SetReadOnly();
00289     }
00290
00291     CComboBox::PreSubclassWindow();
00292 }
00293
00300 void CSmartComboBox::SetReadOnly(bool readOnly /*= true*/)
00301 {
00302     USmartCombo::SetReadOnly(readOnly);
00303
00304     if( IsWindow(m_hWnd) )
00305     {
00306         CEdit* pEdit = (CEdit*)GetDlgItem(1001);
00307         if( pEdit && IsWindow(pEdit->m_hWnd) )
00308         {
00309             pEdit->SetReadOnly(readOnly);
00310         }
00311     }
00312 }
00313
00319 LRESULT CSmartComboBox::OnSetFeature(WPARAM wParam, LPARAM lParam)
00320 {
00321     SetFeature((int)wParam);
00322     return 0;
00323 }
00324
00330 LRESULT CSmartComboBox::OnSetItems(WPARAM wParam, LPARAM lParam)
00331 {
00332     SetItems((CMString*)wParam);
00333     return 0;
00334 }
00335
00341 LRESULT CSmartComboBox::OnSetReadOnly(WPARAM wParam, LPARAM lParam)
00342 {
00343     SetReadOnly(0 != wParam);
00344     return 0;
00345 }
00346
00347 #endif /* WIN32 */
Generated on Sun Feb 24 01:21:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/SmartComboBox.h Source File

common/SmartComboBox.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Jerzy Kaczorowski <kaczoroj@hotmail.com> --- December 2001
00019  */
00020
00021 #if !defined(AFX_SMARTCOMBOBOX_H__E3F8DAE6_C2EF_49CE_AE52_3AE54F5A629C__INCLUDED_)
00022 #define AFX_SMARTCOMBOBOX_H__E3F8DAE6_C2EF_49CE_AE52_3AE54F5A629C__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 // SmartComboBox.h : header file
00028 //
00029
00030 //forward declaration
00031 class CMString;
00032
00042 class USmartCombo
00043 {
00044 public:
00045     // Construction / Destruction
00046     USmartCombo(int feature);
00047     virtual ~USmartCombo();
00048
00049 private:
00050     int m_feature;
00051     CMString* m_pstrItems;
00052
00053 public:
00055
00056     enum Feature{
00057         None =          0x00,
00058         AutoDropWidth = 0x01,
00059         RemoveItems =   0x02,
00060         ReadOnly =      0x04,
00061         //
00062         DefaultFeature = AutoDropWidth | RemoveItems
00063     };
00064
00065 public:
00066     // Get / Set methods
00067     void SetFeature(int feature);
00068     bool HasFeature(int feature) const;
00069
00070     void SetItems(CMString* pstrItems);
00071     CMString* GetItems();
00072
00073     // Overrides
00074     virtual int CalcDroppedWidth();
00075     virtual void SetReadOnly(bool readOnly = true);
00076     virtual bool RemoveItem(const char* strItem);
00077 };
00078
00079 #ifdef WIN32
00080
00085 #define WM_SMCB_SETFEATURE  WM_USER + 1
00086
00091 #define WM_SMCB_SETITEMS    WM_USER + 2
00092
00097 #define WM_SMCB_SETREADONLY WM_USER + 3
00098
00100 // CSmartComboBox window
00101
00114 class CSmartComboBox : public CComboBox, public USmartCombo
00115 {
00116 // Construction
00117 public:
00118     CSmartComboBox(int feature = USmartCombo::DefaultFeature);
00119
00120 // Attributes
00121 public:
00122
00123 // Operations
00124 public:
00125
00126 // Overrides
00127     // ClassWizard generated virtual function overrides
00128     //{{AFX_VIRTUAL(CSmartComboBox)
00129     public:
00130     virtual BOOL PreTranslateMessage(MSG* pMsg);
00131     protected:
00132     virtual void PreSubclassWindow();
00133     //}}AFX_VIRTUAL
00134
00135 // Implementation
00136 public:
00137     virtual ~CSmartComboBox();
00138
00139     // Generated message map functions
00140 protected:
00141     //{{AFX_MSG(CSmartComboBox)
00142     afx_msg void OnDropdown();
00143     //}}AFX_MSG
00144     afx_msg LRESULT OnSetFeature(WPARAM wParam, LPARAM lParam);
00145     afx_msg LRESULT OnSetItems(WPARAM wParam, LPARAM lParam);
00146     afx_msg LRESULT OnSetReadOnly(WPARAM wParam, LPARAM lParam);
00147
00148     DECLARE_MESSAGE_MAP()
00149 private:
00150     virtual int CalcDroppedWidth();
00151     BOOL DelKeyTest(MSG* pMsg);
00152
00153 public:
00154     virtual void SetReadOnly(bool readOnly = true);
00155 };
00156
00158
00159 //{{AFX_INSERT_LOCATION}}
00160 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00161 #endif /* WIN32 */
00162
00163 #endif // !defined(AFX_SMARTCOMBOBOX_H__E3F8DAE6_C2EF_49CE_AE52_3AE54F5A629C__INCLUDED_)
Generated on Sun Feb 24 01:21:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/SortList.h Source File

common/SortList.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- April 1998
00019  */
00020
00021 /*
00022  * SortList.cpp --- sorted list using binary sort
00023  */
00024
00025 #ifndef SORTLIST_H
00026 #define SORTLIST_H
00027
00028 #include <stdlib.h>
00029 #include <string.h>
00030 #include <errno.h>
00031
00032 #include <assert.h>
00033
00034 // Note : this templates require to have a ref. counting
00035 // and a correct operator= if the instancied class
00036 // has some allocations inside.
00037
00038 typedef enum
00039 {
00040     computeNone,
00041     computeLR
00042 } computeSort;
00043
00044 template <class T> class CSortList
00045 {
00046 public :
00047     // method to sort elements (similar to qsort, return -1, 0, 1)
00048     typedef int (*QsortMethod)(const T &, const T &);
00049
00050     CSortList(int def_size, QsortMethod method_sort)
00051     {
00052         assert(def_size > 1 && method_sort != 0L);
00053
00054         fDef = def_size;
00055         fMethod = method_sort;
00056         fMax = fNum = 0;
00057         fElems = 0L;
00058         fNewOne = false;
00059     }
00060
00061     ~CSortList()
00062     {
00063         Reset();
00064     }
00065
00066     // - insert or ignore (if already exists) an element in the list.
00067     // - return the location of the element in the list.
00068     int Insert(const T & entry, bool replaceIfAlreadyExists = false)
00069     {
00070         int index = Location(entry), i;
00071
00072         if(!fNewOne)
00073         {
00074             if(replaceIfAlreadyExists)
00075                 fElems[index] = entry;
00076
00077             return index;
00078         }
00079
00080         // check memory
00081         if(fNum == fMax)
00082         {
00083             T *newElems = 0L;
00084
00085             try
00086             {
00087                 newElems = new T[fMax + fDef];
00088
00089                 for(i = 0; i < fNum + 1; i++)
00090                 {
00091                     if(i < index)
00092                         newElems[i] = fElems[i];
00093                     else if(i == index)
00094                         newElems[i] = entry;
00095                     else
00096                         newElems[i] = fElems[i - 1];
00097                 }
00098             }
00099             catch(...)
00100             {
00101                 if(newElems != 0L)
00102                     delete[] newElems;
00103                 throw;
00104             }
00105
00106             fMax += fDef;
00107             fNum++;
00108             if(fElems != 0L)
00109                 delete[] fElems;
00110             fElems = newElems;
00111             return index;
00112         }
00113
00114         for(i = fNum - 1; i >= index; i--)
00115         {
00116             fElems[i + 1] = fElems[i];
00117         }
00118
00119         fElems[index] = entry;
00120         fNum++;
00121         return index;
00122     }
00123
00124     // say if this entry is already in the list
00125     // and return its index in the list (does not
00126     // change the row list).
00127     bool Inside(const T & entry, int *indexptr = 0L) const
00128     {
00129         int index = ((CSortList*)this)->Location(entry);
00130
00131         if(indexptr != 0L)
00132             *indexptr = fNewOne ? -1 : index;
00133
00134         return !fNewOne;
00135     }
00136
00137     // - insert or ignore (if already exists) an element in the list.
00138     // - return true if the information was ALREADY in the sorted list.
00139     bool InsideAndInsert(const T & entry, int * indexptr = 0L,
00140         bool replaceIfAlreadyExists = false)
00141     {
00142         int index = Insert(entry, replaceIfAlreadyExists);
00143         if(indexptr != 0L)
00144             *indexptr = index;
00145
00146         return !fNewOne;
00147     }
00148
00149     // delete the entry from the sorted list which matches
00150     // this entry. Returns false if no matching entry was found.
00151     bool Delete(const T & entry)
00152     {
00153         int index = Location(entry), i;
00154
00155         if(fNewOne)
00156             return false;
00157
00158         if(fNum == 1)
00159         {
00160             Reset();
00161             return true;
00162         }
00163
00164         for(i = index; i < fNum - 1; i++)
00165         {
00166             fElems[i] = fElems[i + 1];
00167         }
00168         --fNum;
00169         return true;
00170     }
00171
00172     // return an allocated copy of the sorted list.
00173     T *Result(int *num_elem)
00174     {
00175         *num_elem = 0;
00176
00177         if(fNum == 0)
00178             return 0L;
00179
00180         *num_elem = fNum;
00181         T *res = new T[fNum];
00182         for(int i = 0; i < fNum; i++)
00183         {
00184             res[i] = fElems[i];
00185         }
00186
00187         return res;
00188     }
00189
00190     // return an element of the list.
00191     inline const T & Get(int index) const
00192     {
00193         return Entry(index);
00194     }
00195
00196     // get ready for a new sorted list (another "Init" call is not necessary,
00197     // but you can do it to start another kind of sorted list)
00198     void Reset(void)
00199     {
00200         if(fElems != 0L)
00201             delete[] fElems;
00202         fMax = fNum = 0;
00203         fElems = 0L;
00204     }
00205
00206     // # elements in the sorted list at this time
00207     inline int NumOfElements(void) {return fNum;}
00208 private :
00209     QsortMethod fMethod;
00210     int fDef;       // default num of elem (ex: 100)
00211     int fNum;       // number of element
00212     int fMax;       // number of element allocated
00213     T *fElems;      // elements stored
00214     bool fNewOne;   // set by 'Location'
00215
00216     // return the element pointer by index.
00217     inline const T & Entry(int num_elem) const
00218     {
00219         assert(num_elem >= 0 && num_elem < fNum);
00220
00221         return fElems[num_elem];
00222     }
00223
00224     // - return the location of the element in the
00225     // sorted list (does not change the list).
00226     int Location(const T & entry)
00227     {
00228         int left, right, cmp_left = 0, cmp_right = 0;
00229         int cmp_middle, middle;
00230         computeSort compute;
00231
00232         if(fNum == 0)
00233         {
00234             fNewOne = true;
00235             return 0;
00236         }
00237
00238         fNewOne = false;
00239         left = 0;
00240         right = fNum - 1;
00241         compute = computeLR;
00242
00243         while(1)
00244         {
00245             middle = (left + right) / 2;
00246
00247             if(compute == computeLR)
00248             {
00249                 // firstime only
00250                 cmp_left = fMethod(Entry(left), entry);
00251                 cmp_right = fMethod(Entry(right), entry);
00252             }
00253             cmp_middle = fMethod(Entry(middle), entry);
00254
00255             // entry already exist (E == L || E == R)
00256             if(cmp_left == 0 || cmp_right == 0)
00257             {
00258                 return cmp_left == 0 ? left : right;
00259             }
00260
00261             // found an entry superior to the right (E > R && E < R + 1)
00262             if(cmp_right < 0)
00263             {
00264                 fNewOne = true;
00265                 return right + 1;
00266             }
00267
00268             // found an entry inferior to the left (L - 1 < E < L)
00269             if(cmp_left > 0)
00270             {
00271                 fNewOne = true;
00272                 return left;
00273             }
00274
00275             // found an entry inferior to the right (E > R - 1 && E < R)
00276             if(middle == left)
00277             {
00278                 fNewOne = true;
00279                 return right;
00280             }
00281
00282             // entry already exist (E == M)
00283             if(cmp_middle == 0)
00284                 return middle;
00285             // restart search (E > M && E < R)
00286             else if(cmp_middle < 0)
00287             {
00288                 compute = computeNone;
00289                 left = middle;
00290                 cmp_left = cmp_middle;
00291                 cmp_right = 1;
00292             }
00293             // restart search (E > L && E < M)
00294             else
00295             {
00296                 compute = computeNone;
00297                 right = middle;
00298                 cmp_right = cmp_middle;
00299                 cmp_left = -1;
00300             }
00301         }
00302         assert(0);
00303         return 0;
00304     }
00305 };
00306
00307 #endif // SORTLIST_H
Generated on Sun Feb 24 01:21:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/TagDlg.cpp Source File

common/TagDlg.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- July 1998
00019  */
00020
00021 /*
00022  * TagDlg.cpp : the cvs tag dialog
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef WIN32
00028 #   include "wincvs.h"
00029 #   include "GetPrefs.h"
00030 #endif /* WIN32 */
00031
00032 #if qUnix
00033 #   include "UCvsDialogs.h"
00034 #endif
00035
00036 #ifdef qMacCvsPP
00037 #   include <UModalDialogs.h>
00038 #   include <LMultiPanelView.h>
00039 #   include <LCheckBox.h>
00040 #   include <LEditText.h>
00041 #   include <LPopupGroupBox.h>
00042 #   include <LRadioButton.h>
00043 #   include "LPopupFiller.h"
00044
00045 #   include "MacCvsConstant.h"
00046 #endif /* qMacCvsPP */
00047
00048 #include "TagDlg.h"
00049 #include "CvsPrefs.h"
00050 #include "UpdateDlg.h"
00051
00052 #ifdef WIN32
00053 #   ifdef _DEBUG
00054 #   define new DEBUG_NEW
00055 #   undef THIS_FILE
00056     static char THIS_FILE[] = __FILE__;
00057 #   endif
00058 #endif /* WIN32 */
00059
00060 #ifdef WIN32
00061
00063 // CTag_MAIN property page
00064
00065 IMPLEMENT_DYNCREATE(CTag_MAIN, CPropertyPage)
00066
00067 CTag_MAIN::CTag_MAIN(kTagDlgType type,
00068         const char* sLastTag,
00069         bool noRecurs, bool checkUnmod /*= false*/, bool overwriteExisting /*= false*/)
00070         : CPropertyPage(CTag_MAIN::IDD)
00071 {
00072     m_type = type;
00073
00074     m_noRecurs = noRecurs;
00075     m_checkUnmod = checkUnmod;
00076     m_overwriteExisting = overwriteExisting;
00077     m_tagName = sLastTag;
00078
00079     m_tagCombo.SetItems(&gRevNames);
00080 }
00081
00082 CTag_MAIN::CTag_MAIN() : CPropertyPage(CTag_MAIN::IDD)
00083 {
00084     //{{AFX_DATA_INIT(CTag_MAIN)
00085     m_noRecurs = FALSE;
00086     m_checkUnmod = FALSE;
00087     m_overwriteExisting = FALSE;
00088     m_tagName = _T("");
00089     //}}AFX_DATA_INIT
00090 }
00091
00092 CTag_MAIN::~CTag_MAIN()
00093 {
00094 }
00095
00096 void CTag_MAIN::DoDataExchange(CDataExchange* pDX)
00097 {
00098     CPropertyPage::DoDataExchange(pDX);
00099     //{{AFX_DATA_MAP(CTag_MAIN)
00100     DDX_Control(pDX, IDC_TAGDESC_TEXT, m_tagDescStatic);
00101     DDX_Control(pDX, IDC_GRPBOX_TEXT, m_grpBox);
00102     DDX_Control(pDX, IDC_OVERWRITE, m_overwriteExistingCheck);
00103     DDX_Control(pDX, IDC_CHECKUNMOD, m_checkUnmodCheck);
00104     DDX_Control(pDX, IDC_TAGNAME, m_tagCombo);
00105     DDX_Check(pDX, IDC_NORECURS, m_noRecurs);
00106     DDX_Check(pDX, IDC_CHECKUNMOD, m_checkUnmod);
00107     DDX_Check(pDX, IDC_OVERWRITE, m_overwriteExisting);
00108     DDX_CBString(pDX, IDC_TAGNAME, m_tagName);
00109     //}}AFX_DATA_MAP
00110
00111     DDV_MinChars(pDX, m_tagName, 1);
00112     DDX_ComboMString(pDX, IDC_TAGNAME, m_tagCombo);
00113 }
00114
00115
00116 BEGIN_MESSAGE_MAP(CTag_MAIN, CPropertyPage)
00117     //{{AFX_MSG_MAP(CTag_MAIN)
00118     //}}AFX_MSG_MAP
00119 END_MESSAGE_MAP()
00120
00122 // CTag_MAIN message handlers
00123
00124 BOOL CTag_MAIN::OnInitDialog()
00125 {
00126     CPropertyPage::OnInitDialog();
00127
00128     // set the type-specific data
00129     CString strGrpBox;
00130     CString strTagDesc;
00131
00132     switch( m_type )
00133     {
00134     case kTagAdd:
00135         strGrpBox = "Enter the tag name to create:";
00136         strTagDesc = "New tag &name:";
00137         break;
00138     case kTagDelete:
00139         strGrpBox = "Enter the tag name to delete:";
00140         strTagDesc = "Delete tag &name:";
00141
00142         m_checkUnmodCheck.ShowWindow(SW_HIDE);
00143         m_overwriteExistingCheck.ShowWindow(SW_HIDE);
00144         break;
00145     case kTagFork:
00146         strGrpBox = "Enter the branch name to create:";
00147         strTagDesc = "New branch &name:";
00148
00149         m_overwriteExistingCheck.ShowWindow(SW_HIDE);
00150         break;
00151     default:
00152         ASSERT(FALSE); //unknown type
00153     }
00154
00155     m_grpBox.SetWindowText(strGrpBox);
00156     m_tagDescStatic.SetWindowText(strTagDesc);
00157
00158     return TRUE;  // return TRUE unless you set the focus to a control
00159                   // EXCEPTION: OCX Property Pages should return FALSE
00160 }
00161
00162 #endif /* WIN32 */
00163
00164 #ifdef qMacCvsPP
00165 static void DoDataExchange_TagCreateMain(LWindow *theDialog,
00166     CPStr & sLastTag, bool & noRecurs, bool & overwriteExist,
00167     bool & checkUnmod, bool putValue)
00168 {
00169     LEditText *tname = dynamic_cast<LEditText*>
00170         (theDialog->FindPaneByID(item_BranchRev));
00171     LCheckBox *chkNoRecurs = dynamic_cast<LCheckBox*>
00172         (theDialog->FindPaneByID(item_NoRecurs));
00173     LCheckBox *chkOverwrite = dynamic_cast<LCheckBox*>
00174         (theDialog->FindPaneByID(item_OverwriteRev));
00175     LCheckBox *chkUnmod = dynamic_cast<LCheckBox*>
00176         (theDialog->FindPaneByID(item_CheckUnmod));
00177     LPopupFiller *fillTag = dynamic_cast<LPopupFiller*>
00178         (theDialog->FindPaneByID(item_FillerTag));
00179
00180     fillTag->DoDataExchange(gRevNames, putValue);
00181
00182     if(putValue)
00183     {
00184         chkNoRecurs->SetValue(noRecurs ? Button_On : Button_Off);
00185         chkOverwrite->SetValue(overwriteExist ? Button_On : Button_Off);
00186         chkUnmod->SetValue(checkUnmod ? Button_On : Button_Off);
00187         tname->SetText((Ptr)(const char *)sLastTag, sLastTag.length());
00188     }
00189     else
00190     {
00191         char str[255];
00192         Size len;
00193
00194         tname->GetText(str, 254, &len);
00195         sLastTag.set(str, len);
00196         noRecurs = chkNoRecurs->GetValue() == Button_On;
00197         overwriteExist = chkOverwrite->GetValue() == Button_On;
00198         checkUnmod = chkUnmod->GetValue() == Button_On;
00199     }
00200 }
00201
00202 static void DoDataExchange_TagDeleteMain(LWindow *theDialog,
00203     CPStr & sLastTag, bool & noRecurs, bool putValue)
00204 {
00205     LEditText *tname = dynamic_cast<LEditText*>
00206         (theDialog->FindPaneByID(item_BranchRev));
00207     LCheckBox *chkNoRecurs = dynamic_cast<LCheckBox*>
00208         (theDialog->FindPaneByID(item_NoRecurs));
00209     LPopupFiller *fillTag = dynamic_cast<LPopupFiller*>
00210         (theDialog->FindPaneByID(item_FillerTag));
00211
00212     fillTag->DoDataExchange(gRevNames, putValue);
00213
00214     if(putValue)
00215     {
00216         tname->SetText((Ptr)(const char *)sLastTag, sLastTag.length());
00217         chkNoRecurs->SetValue(noRecurs ? Button_On : Button_Off);
00218     }
00219     else
00220     {
00221         noRecurs = chkNoRecurs->GetValue() == Button_On;
00222
00223         char str[255];
00224         Size len;
00225
00226         tname->GetText(str, 254, &len);
00227         sLastTag.set(str, len);
00228     }
00229 }
00230
00231 static void DoDataExchange_TagBranchMain(LWindow *theDialog,
00232     CPStr & sLastBranch, bool & noRecurs, bool & checkUnmod, bool putValue)
00233 {
00234     LEditText *tname = dynamic_cast<LEditText*>
00235         (theDialog->FindPaneByID(item_BranchRev));
00236     LCheckBox *chkNoRecurs = dynamic_cast<LCheckBox*>
00237         (theDialog->FindPaneByID(item_NoRecurs));
00238     LCheckBox *chkUnmod = dynamic_cast<LCheckBox*>
00239         (theDialog->FindPaneByID(item_CheckUnmod));
00240     LPopupFiller *fillTag = dynamic_cast<LPopupFiller*>
00241         (theDialog->FindPaneByID(item_FillerTag));
00242
00243     fillTag->DoDataExchange(gRevNames, putValue);
00244
00245     if(putValue)
00246     {
00247         chkNoRecurs->SetValue(noRecurs ? Button_On : Button_Off);
00248         chkUnmod->SetValue(checkUnmod ? Button_On : Button_Off);
00249         tname->SetText((Ptr)(const char *)sLastBranch, sLastBranch.length());
00250     }
00251     else
00252     {
00253         char str[255];
00254         Size len;
00255
00256         tname->GetText(str, 254, &len);
00257         sLastBranch.set(str, len);
00258         noRecurs = chkNoRecurs->GetValue() == Button_On;
00259         checkUnmod = chkUnmod->GetValue() == Button_On;
00260     }
00261 }
00262
00263 static void DoDataExchange_TagBranchOptions(LWindow *theDialog,
00264     bool & noRecurs, bool putValue)
00265 {
00266     LCheckBox *chkNoRecurs = dynamic_cast<LCheckBox*>
00267         (theDialog->FindPaneByID(item_NoRecurs));
00268
00269     if(putValue)
00270     {
00271         chkNoRecurs->SetValue(noRecurs ? Button_On : Button_Off);
00272     }
00273     else
00274     {
00275         noRecurs = chkNoRecurs->GetValue() == Button_On;
00276     }
00277 }
00278 #endif /* qMacCvsPP */
00279
00280 #if qUnix
00281 class UCvsTagCreate : public UWidget
00282 {
00283     UDECLARE_DYNAMIC(UCvsTagCreate)
00284 public:
00285     UCvsTagCreate() : UWidget(::UEventGetWidID()) {}
00286     virtual ~UCvsTagCreate() {}
00287
00288     enum
00289     {
00290         kOK = EV_COMMAND_START, // 0
00291         kCancel,                // 1
00292         kTabGeneral             // 2
00293     };
00294
00295     virtual void DoDataExchange(bool fill);
00296
00297 protected:
00298     ev_msg int OnOK(void);
00299     ev_msg int OnCancel(void);
00300
00301     UDECLARE_MESSAGE_MAP()
00302 };
00303
00304 UIMPLEMENT_DYNAMIC(UCvsTagCreate, UWidget)
00305
00306 UBEGIN_MESSAGE_MAP(UCvsTagCreate, UWidget)
00307     ON_UCOMMAND(UCvsTagCreate::kOK, UCvsTagCreate::OnOK)
00308     ON_UCOMMAND(UCvsTagCreate::kCancel, UCvsTagCreate::OnCancel)
00309 UEND_MESSAGE_MAP()
00310
00311 int UCvsTagCreate::OnOK(void)
00312 {
00313     EndModal(true);
00314     return 0;
00315 }
00316
00317 int UCvsTagCreate::OnCancel(void)
00318 {
00319     EndModal(false);
00320     return 0;
00321 }
00322
00323 void UCvsTagCreate::DoDataExchange(bool fill)
00324 {
00325     if(fill)
00326     {
00327     }
00328     else
00329     {
00330     }
00331 }
00332
00333 class UCvsTagCreate_MAIN : public UWidget
00334 {
00335     UDECLARE_DYNAMIC(UCvsTagCreate_MAIN)
00336 public:
00337     UCvsTagCreate_MAIN(const char * sLastTag, bool noRecurs,
00338                        bool overwriteExist, bool checkUnmod);
00339     virtual ~UCvsTagCreate_MAIN() {}
00340
00341     enum
00342     {
00343         kEditTag = EV_COMMAND_START,    // 0
00344         kCheckRecurs,       // 1
00345         kCheckUnmod,        // 2
00346         kCheckOverwrite,    // 3
00347     };
00348
00349     virtual void DoDataExchange(bool fill);
00350
00351     UStr m_tagname;
00352     bool m_norecurs;
00353     bool m_checkunmod;
00354     bool m_overwrite;
00355 protected:
00356
00357     UDECLARE_MESSAGE_MAP()
00358 };
00359
00360 UIMPLEMENT_DYNAMIC(UCvsTagCreate_MAIN, UWidget)
00361
00362 UBEGIN_MESSAGE_MAP(UCvsTagCreate_MAIN, UWidget)
00363 UEND_MESSAGE_MAP()
00364
00365 UCvsTagCreate_MAIN::UCvsTagCreate_MAIN(const char * sLastTag, bool noRecurs,
00366                        bool overwriteExist, bool checkUnmod) : UWidget(::UEventGetWidID())
00367 {
00368     m_tagname = sLastTag;
00369     m_norecurs = noRecurs;
00370     m_checkunmod = checkUnmod;
00371     m_overwrite = overwriteExist;
00372 }
00373
00374 void UCvsTagCreate_MAIN::DoDataExchange(bool fill)
00375 {
00376     ::DoDataExchange(fill, GetWidID(), kEditTag, gRevNames);
00377
00378     if(fill)
00379     {
00380         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditTag, (void *)(const char *)m_tagname);
00381
00382         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckUnmod, m_checkunmod), 0L);
00383         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurs, m_norecurs), 0L);
00384         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckOverwrite, m_overwrite), 0L);
00385     }
00386     else
00387     {
00388         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditTag, &m_tagname);
00389
00390         m_checkunmod = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckUnmod, 0L);
00391         m_norecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurs, 0L);
00392         m_overwrite = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckOverwrite, 0L);
00393     }
00394 }
00395
00396 class UCvsTagDel : public UWidget
00397 {
00398     UDECLARE_DYNAMIC(UCvsTagDel)
00399 public:
00400     UCvsTagDel() : UWidget(::UEventGetWidID()) {}
00401     virtual ~UCvsTagDel() {}
00402
00403     enum
00404     {
00405         kOK = EV_COMMAND_START, // 0
00406         kCancel,                // 1
00407         kTabGeneral             // 2
00408     };
00409
00410     virtual void DoDataExchange(bool fill);
00411
00412 protected:
00413     ev_msg int OnOK(void);
00414     ev_msg int OnCancel(void);
00415
00416     UDECLARE_MESSAGE_MAP()
00417 };
00418
00419 UIMPLEMENT_DYNAMIC(UCvsTagDel, UWidget)
00420
00421 UBEGIN_MESSAGE_MAP(UCvsTagDel, UWidget)
00422     ON_UCOMMAND(UCvsTagDel::kOK, UCvsTagDel::OnOK)
00423     ON_UCOMMAND(UCvsTagDel::kCancel, UCvsTagDel::OnCancel)
00424 UEND_MESSAGE_MAP()
00425
00426 int UCvsTagDel::OnOK(void)
00427 {
00428     EndModal(true);
00429     return 0;
00430 }
00431
00432 int UCvsTagDel::OnCancel(void)
00433 {
00434     EndModal(false);
00435     return 0;
00436 }
00437
00438 void UCvsTagDel::DoDataExchange(bool fill)
00439 {
00440     if(fill)
00441     {
00442     }
00443     else
00444     {
00445     }
00446 }
00447
00448 class UCvsTagDel_MAIN : public UWidget
00449 {
00450     UDECLARE_DYNAMIC(UCvsTagDel_MAIN)
00451 public:
00452     UCvsTagDel_MAIN(const char * sLastTag, bool noRecurs);
00453     virtual ~UCvsTagDel_MAIN() {}
00454
00455     enum
00456     {
00457         kEditTag = EV_COMMAND_START,    // 0
00458         kCheckRecurs        // 1
00459     };
00460
00461     virtual void DoDataExchange(bool fill);
00462
00463     bool m_norecurs;
00464     UStr m_tagname;
00465 protected:
00466
00467     UDECLARE_MESSAGE_MAP()
00468 };
00469
00470 UIMPLEMENT_DYNAMIC(UCvsTagDel_MAIN, UWidget)
00471
00472 UBEGIN_MESSAGE_MAP(UCvsTagDel_MAIN, UWidget)
00473 UEND_MESSAGE_MAP()
00474
00475 UCvsTagDel_MAIN::UCvsTagDel_MAIN(const char * sLastTag, bool noRecurs) : UWidget(::UEventGetWidID())
00476 {
00477     m_norecurs = noRecurs;
00478     m_tagname = sLastTag;
00479 }
00480
00481 void UCvsTagDel_MAIN::DoDataExchange(bool fill)
00482 {
00483     ::DoDataExchange(fill, GetWidID(), kEditTag, gRevNames);
00484     if(fill)
00485     {
00486         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditTag, (void *)(const char *)m_tagname);
00487
00488         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurs, m_norecurs), 0L);
00489     }
00490     else
00491     {
00492         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditTag, &m_tagname);
00493
00494         m_norecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurs, 0L);
00495     }
00496 }
00497
00498 class UCvsTagBranch : public UWidget
00499 {
00500     UDECLARE_DYNAMIC(UCvsTagBranch)
00501 public:
00502     UCvsTagBranch() : UWidget(::UEventGetWidID()) {}
00503     virtual ~UCvsTagBranch() {}
00504
00505     enum
00506     {
00507         kOK = EV_COMMAND_START, // 0
00508         kCancel,                // 1
00509         kTabGeneral             // 2
00510     };
00511
00512     virtual void DoDataExchange(bool fill);
00513
00514 protected:
00515     ev_msg int OnOK(void);
00516     ev_msg int OnCancel(void);
00517
00518     UDECLARE_MESSAGE_MAP()
00519 };
00520
00521 UIMPLEMENT_DYNAMIC(UCvsTagBranch, UWidget)
00522
00523 UBEGIN_MESSAGE_MAP(UCvsTagBranch, UWidget)
00524     ON_UCOMMAND(UCvsTagBranch::kOK, UCvsTagBranch::OnOK)
00525     ON_UCOMMAND(UCvsTagBranch::kCancel, UCvsTagBranch::OnCancel)
00526 UEND_MESSAGE_MAP()
00527
00528 int UCvsTagBranch::OnOK(void)
00529 {
00530     EndModal(true);
00531     return 0;
00532 }
00533
00534 int UCvsTagBranch::OnCancel(void)
00535 {
00536     EndModal(false);
00537     return 0;
00538 }
00539
00540 void UCvsTagBranch::DoDataExchange(bool fill)
00541 {
00542     if(fill)
00543     {
00544     }
00545     else
00546     {
00547     }
00548 }
00549
00550 class UCvsTagBranch_MAIN : public UWidget
00551 {
00552     UDECLARE_DYNAMIC(UCvsTagBranch_MAIN)
00553 public:
00554     UCvsTagBranch_MAIN(const char * sLastTag, bool noRecurs,
00555                        bool checkUnmod);
00556     virtual ~UCvsTagBranch_MAIN() {}
00557
00558     enum
00559     {
00560         kEditTag = EV_COMMAND_START,    // 0
00561         kCheckRecurs,       // 1
00562         kCheckUnmod         // 2
00563     };
00564
00565     virtual void DoDataExchange(bool fill);
00566
00567     UStr m_tagname;
00568     bool m_norecurs;
00569     bool m_checkunmod;
00570 protected:
00571
00572     UDECLARE_MESSAGE_MAP()
00573 };
00574
00575 UIMPLEMENT_DYNAMIC(UCvsTagBranch_MAIN, UWidget)
00576
00577 UBEGIN_MESSAGE_MAP(UCvsTagBranch_MAIN, UWidget)
00578 UEND_MESSAGE_MAP()
00579
00580 UCvsTagBranch_MAIN::UCvsTagBranch_MAIN(const char * sLastTag, bool noRecurs,
00581                                        bool checkUnmod) : UWidget(::UEventGetWidID())
00582 {
00583     m_tagname = sLastTag;
00584     m_norecurs = noRecurs;
00585     m_checkunmod = checkUnmod;
00586 }
00587
00588 void UCvsTagBranch_MAIN::DoDataExchange(bool fill)
00589 {
00590     ::DoDataExchange(fill, GetWidID(), kEditTag, gRevNames);
00591
00592     if(fill)
00593     {
00594         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditTag, (void *)(const char *)m_tagname);
00595
00596         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckUnmod, m_checkunmod), 0L);
00597         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurs, m_norecurs), 0L);
00598     }
00599     else
00600     {
00601         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditTag, &m_tagname);
00602
00603         m_checkunmod = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckUnmod, 0L);
00604         m_norecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurs, 0L);
00605     }
00606 }
00607 #endif // qUnix
00608
00609 bool CompatTagCreate(bool & noRecurs, bool & overwriteExisting,
00610                      CPStr & tagName, bool & checkUnmod)
00611 {
00612     bool userHitOK = false;
00613
00614     static CPStr sLastTag;
00615
00616     tagName = "";
00617     noRecurs = false;
00618     overwriteExisting = false;
00619     checkUnmod = false;
00620
00621 #ifdef WIN32
00622     CPropertySheet pages("Create tag settings");
00623     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00624     CTag_MAIN page1(kTagAdd, sLastTag, noRecurs, checkUnmod, overwriteExisting);
00625     CGetPrefs_GLOBALS page2;
00626     pages.AddPage(&page1);
00627     pages.AddPage(&page2);
00628     if(pages.DoModal() == IDOK)
00629     {
00630         checkUnmod = page1.m_checkUnmod == TRUE;
00631         noRecurs = page1.m_noRecurs == TRUE;
00632         sLastTag = page1.m_tagName;
00633         overwriteExisting = page1.m_overwriteExisting == TRUE;
00634
00635         page2.StoreValues();
00636         userHitOK = true;
00637     }
00638 #endif /* WIN32 */
00639 #if qUnix
00640     void *wid = UCreate_TagDlg();
00641
00642     UCvsTagCreate *dlg = new UCvsTagCreate();
00643     UCvsTagCreate_MAIN *tab1 =
00644         new UCvsTagCreate_MAIN(sLastTag, noRecurs, overwriteExisting, checkUnmod);
00645     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00646     dlg->AddPage(tab1, UCvsTagCreate::kTabGeneral, 0);
00647
00648     if(dlg->DoModal())
00649     {
00650         checkUnmod = tab1->m_checkunmod;
00651         noRecurs = tab1->m_norecurs;
00652         sLastTag = tab1->m_tagname;
00653         overwriteExisting = tab1->m_overwrite;
00654
00655         userHitOK = true;
00656     }
00657
00658     delete dlg;
00659 #endif // qUnix
00660 #ifdef qMacCvsPP
00661     StDialogHandler theHandler(dlg_TagCreate, LCommander::GetTopCommander());
00662     LWindow *theDialog = theHandler.GetDialog();
00663     ThrowIfNil_(theDialog);
00664     static UInt16 sRuntimePanel = 1;
00665
00666     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00667         (theDialog->FindPaneByID(item_MultiViewPrefs));
00668     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00669
00670     multiView->SwitchToPanel(2);
00671     DoDataExchange_Globals(theDialog, true);
00672     multiView->SwitchToPanel(1);
00673     DoDataExchange_TagCreateMain(theDialog, sLastTag,
00674         noRecurs, overwriteExisting, checkUnmod, true);
00675
00676     groupView->SetValue(sRuntimePanel);
00677     theDialog->Show();
00678     MessageT hitMessage;
00679     while (true)
00680     {       // Let DialogHandler process events
00681         hitMessage = theHandler.DoDialog();
00682
00683         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00684             break;
00685     }
00686     theDialog->Hide();
00687     sRuntimePanel = groupView->GetValue();
00688
00689     if(hitMessage == msg_OK)
00690     {
00691         multiView->SwitchToPanel(1);
00692         DoDataExchange_TagCreateMain(theDialog, sLastTag,
00693             noRecurs, overwriteExisting, checkUnmod, false);
00694         multiView->SwitchToPanel(2);
00695         DoDataExchange_Globals(theDialog, false);
00696         userHitOK = true;
00697     }
00698 #endif /* qMacCvsPP */
00699
00700     if(userHitOK)
00701     {
00702         tagName = sLastTag;
00703
00704         gCvsPrefs.save();
00705     }
00706
00707     return userHitOK;
00708 }
00709
00710 bool CompatTagDelete(bool & noRecurs, CPStr & tagName)
00711 {
00712
00713     bool userHitOK = false;
00714
00715     static CPStr sLastTag;
00716
00717     tagName = "";
00718     noRecurs = false;
00719
00720 #ifdef WIN32
00721     CPropertySheet pages("Delete tag settings");
00722     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00723     CTag_MAIN page1(kTagDelete, sLastTag, noRecurs);
00724     CGetPrefs_GLOBALS page2;
00725     pages.AddPage(&page1);
00726     pages.AddPage(&page2);
00727     if(pages.DoModal() == IDOK)
00728     {
00729         noRecurs = page1.m_noRecurs == TRUE;
00730         sLastTag = page1.m_tagName;
00731
00732         page2.StoreValues();
00733         userHitOK = true;
00734     }
00735 #endif /* WIN32 */
00736 #if qUnix
00737     void *wid = UCreate_UntagDlg();
00738
00739     UCvsTagDel *dlg = new UCvsTagDel();
00740     UCvsTagDel_MAIN *tab1 = new UCvsTagDel_MAIN(sLastTag, noRecurs);
00741     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00742     dlg->AddPage(tab1, UCvsTagDel::kTabGeneral, 0);
00743
00744     if(dlg->DoModal())
00745     {
00746         noRecurs = tab1->m_norecurs;
00747         sLastTag = tab1->m_tagname;
00748
00749         userHitOK = true;
00750     }
00751
00752     delete dlg;
00753 #endif // qUnix
00754 #ifdef qMacCvsPP
00755     StDialogHandler theHandler(dlg_TagDelete, LCommander::GetTopCommander());
00756     LWindow *theDialog = theHandler.GetDialog();
00757     ThrowIfNil_(theDialog);
00758     static UInt16 sRuntimePanel = 1;
00759
00760     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00761         (theDialog->FindPaneByID(item_MultiViewPrefs));
00762     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00763
00764     multiView->SwitchToPanel(2);
00765     DoDataExchange_Globals(theDialog, true);
00766     multiView->SwitchToPanel(1);
00767     DoDataExchange_TagDeleteMain(theDialog, sLastTag, noRecurs, true);
00768
00769     groupView->SetValue(sRuntimePanel);
00770     theDialog->Show();
00771     MessageT hitMessage;
00772     while (true)
00773     {       // Let DialogHandler process events
00774         hitMessage = theHandler.DoDialog();
00775
00776         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00777             break;
00778     }
00779     theDialog->Hide();
00780     sRuntimePanel = groupView->GetValue();
00781
00782     if(hitMessage == msg_OK)
00783     {
00784         multiView->SwitchToPanel(1);
00785         DoDataExchange_TagDeleteMain(theDialog, sLastTag, noRecurs, false);
00786         multiView->SwitchToPanel(2);
00787         DoDataExchange_Globals(theDialog, false);
00788         userHitOK = true;
00789     }
00790 #endif /* qMacCvsPP */
00791
00792     if(userHitOK)
00793     {
00794         tagName = sLastTag;
00795
00796         gCvsPrefs.save();
00797     }
00798
00799     return userHitOK;
00800 }
00801
00802 bool CompatTagBranch(bool & noRecurs, CPStr & branchName,
00803                      bool & checkUnmod)
00804 {
00805     bool userHitOK = false;
00806
00807     static CPStr sLastBranch;
00808
00809     branchName = "";
00810     noRecurs = false;
00811     checkUnmod = false;
00812
00813 #ifdef WIN32
00814     CPropertySheet pages("Create branch settings");
00815     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00816     CTag_MAIN page1(kTagFork, sLastBranch, noRecurs, checkUnmod);
00817     CGetPrefs_GLOBALS page2;
00818     pages.AddPage(&page1);
00819     pages.AddPage(&page2);
00820     if(pages.DoModal() == IDOK)
00821     {
00822         checkUnmod = page1.m_checkUnmod == TRUE;
00823         noRecurs = page1.m_noRecurs == TRUE;
00824         sLastBranch = page1.m_tagName;
00825
00826         page2.StoreValues();
00827         userHitOK = true;
00828     }
00829 #endif /* WIN32 */
00830 #if qUnix
00831     void *wid = UCreate_BranchDlg();
00832
00833     UCvsTagBranch *dlg = new UCvsTagBranch();
00834     UCvsTagBranch_MAIN *tab1 = new UCvsTagBranch_MAIN(sLastBranch, noRecurs, checkUnmod);
00835     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00836     dlg->AddPage(tab1, UCvsTagBranch::kTabGeneral, 0);
00837
00838     if(dlg->DoModal())
00839     {
00840         checkUnmod = tab1->m_checkunmod;
00841         noRecurs = tab1->m_norecurs;
00842         sLastBranch = tab1->m_tagname;
00843
00844         userHitOK = true;
00845     }
00846
00847     delete dlg;
00848 #endif // qUnix
00849 #ifdef qMacCvsPP
00850     StDialogHandler theHandler(dlg_TagBranch, LCommander::GetTopCommander());
00851     LWindow *theDialog = theHandler.GetDialog();
00852     ThrowIfNil_(theDialog);
00853     static UInt16 sRuntimePanel = 1;
00854
00855     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00856         (theDialog->FindPaneByID(item_MultiViewPrefs));
00857     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00858
00859     multiView->SwitchToPanel(2);
00860     DoDataExchange_Globals(theDialog, true);
00861     multiView->SwitchToPanel(1);
00862     DoDataExchange_TagBranchMain(theDialog, sLastBranch,
00863         noRecurs, checkUnmod, true);
00864
00865     groupView->SetValue(sRuntimePanel);
00866     theDialog->Show();
00867     MessageT hitMessage;
00868     while (true)
00869     {       // Let DialogHandler process events
00870         hitMessage = theHandler.DoDialog();
00871
00872         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00873             break;
00874     }
00875     theDialog->Hide();
00876     sRuntimePanel = groupView->GetValue();
00877
00878     if(hitMessage == msg_OK)
00879     {
00880         multiView->SwitchToPanel(1);
00881         DoDataExchange_TagBranchMain(theDialog, sLastBranch,
00882             noRecurs, checkUnmod, false);
00883         multiView->SwitchToPanel(2);
00884         DoDataExchange_Globals(theDialog, false);
00885         userHitOK = true;
00886     }
00887 #endif /* qMacCvsPP */
00888
00889     if(userHitOK)
00890     {
00891         branchName = sLastBranch;
00892
00893         gCvsPrefs.save();
00894     }
00895
00896     return userHitOK;
00897 }
Generated on Sun Feb 24 01:21:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/TagDlg.h Source File

common/TagDlg.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- July 1998
00019  */
00020
00021 /*
00022  * TagDlg.h : the cvs tag dialog
00023  */
00024
00025 #if !defined(AFX_TAGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
00026 #define AFX_TAGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif // _MSC_VER >= 1000
00031
00032 #include "CPStr.h"
00033 #include "SmartComboBox.h"
00034
00035 bool CompatTagCreate(bool & noRecurs, bool & overwriteExisting,
00036                      CPStr & tagName, bool & checkUnmod);
00037
00038 bool CompatTagDelete(bool & noRecurs, CPStr & tagName);
00039
00040 bool CompatTagBranch(bool & noRecurs, CPStr & branchName,
00041                      bool & checkUnmod);
00042     // get the tag options...
00043
00044 typedef enum
00045 {
00046     kTagAdd,
00047     kTagDelete,
00048     kTagFork
00049 } kTagDlgType;
00050
00051 #ifdef WIN32
00052
00054 // CTag_MAIN dialog
00055
00056 class CTag_MAIN : public CPropertyPage
00057 {
00058     DECLARE_DYNCREATE(CTag_MAIN)
00059
00060 // Construction
00061 public:
00062     CTag_MAIN(kTagDlgType type,
00063         const char* sLastTag,
00064         bool noRecurs, bool checkUnmod = false, bool overwriteExisting = false);
00065     CTag_MAIN();
00066     ~CTag_MAIN();
00067
00068 // Dialog Data
00069     //{{AFX_DATA(CTag_MAIN)
00070     enum { IDD = IDD_TAG_MAIN };
00071     CStatic m_tagDescStatic;
00072     CButton m_grpBox;
00073     CButton m_overwriteExistingCheck;
00074     CButton m_checkUnmodCheck;
00075     CSmartComboBox  m_tagCombo;
00076     BOOL    m_noRecurs;
00077     BOOL    m_checkUnmod;
00078     BOOL    m_overwriteExisting;
00079     CString m_tagName;
00080     //}}AFX_DATA
00081
00082
00083 // Overrides
00084     // ClassWizard generate virtual function overrides
00085     //{{AFX_VIRTUAL(CTag_MAIN)
00086     protected:
00087     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00088     //}}AFX_VIRTUAL
00089
00090 // Implementation
00091 protected:
00092     // Generated message map functions
00093     //{{AFX_MSG(CTag_MAIN)
00094     virtual BOOL OnInitDialog();
00095     //}}AFX_MSG
00096     DECLARE_MESSAGE_MAP()
00097 private:
00098     kTagDlgType m_type;
00099 };
00100
00101 //{{AFX_INSERT_LOCATION}}
00102 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00103 #endif /* WIN32 */
00104
00105 #endif // !defined(AFX_TAGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/TclGlue.cpp Source File

common/TclGlue.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- May 1998
00019  * Modified : David Gravereaux <davygrvy@bigfoot.com> -- May 1999
00020  */
00021
00022 /*
00023  * TclGlue.cpp --- glue to the TCL language
00024  */
00025 #include "stdafx.h"
00026
00027 #ifdef macintosh
00028 #   include "MacMisc.h"
00029 #endif
00030
00031 #include <stdarg.h>
00032 #include <string.h>
00033 #include <stdlib.h>
00034
00035 #ifdef HAVE_UNISTD_H
00036 #include <unistd.h>
00037 #endif
00038
00039 #if !defined(USE_TCL)
00040 #   define USE_TCL 1
00041 #endif
00042
00043 #ifdef qMacCvsPP
00044 #   include "MacCvsApp.h"
00045 #endif /* qMacCvsPP */
00046
00047 #if qCarbon
00048 #   include "TclGlue.mac.h"
00049 #endif
00050
00051 // this cannot work before the stub library is linked with wrong libraries
00052 // and it causes WinCvs to crash
00053 //#define USE_TCL_STUBS
00054
00055 #if !defined(__STDC__) && (defined(macintosh) || defined(WIN32))
00056 #   define __STDC__ 1
00057 #   define UNDEF_STDC
00058 #endif
00059
00060 #if USE_TCL
00061 #include "tcl.h"
00062
00063 #if TCL_MAJOR_VERSION != 8 && TCL_MINOR_VERSION < 1
00064 #   error "You need the Tcl 8.1.x header (or above) from Scriptics for this"
00065 #endif
00066 #endif
00067
00068 #ifdef UNDEF_STDC
00069 #   undef __STDC__
00070 #   define __STDC__ 0
00071 #
00072 #endif
00073
00074 #if 0//def WIN32
00075 //  this comes with the Scriptic release, or
00076 //  you can compile your own from generic/tclStubLib.c
00077 //  in the source release of Tcl and build it with any
00078 //  combination of the C runtime to match WinCVS, so you
00079 //  don't get those:
00080 // LINK : warning LNK4098: defaultlib "LIBCMTD" conflicts with use of other libs; use /NODEFAULTLIB:library
00081 #pragma comment(lib,"tclstub81.lib")
00082 #endif
00083
00084 #include "TclGlue.h"
00085 #include "AppConsole.h"
00086 #include "AppGlue.h"
00087 #include "CvsArgs.h"
00088 #include "CvsEntries.h"
00089 #include "dll_loader.h"
00090 #include "FileTraversal.h"
00091 #include "MacrosSetup.h"
00092 #include "MoveToTrash.h"
00093 #include "CvsPrefs.h"
00094
00095 #ifdef WIN32
00096 #   include "wincvs.h"
00097 #   include "wincvsdebug.h"
00098
00099 #   ifdef _DEBUG
00100 #   define new DEBUG_NEW
00101 #   undef THIS_FILE
00102     static char THIS_FILE[] = __FILE__;
00103 #   endif
00104 #endif /* WIN32 */
00105
00106 #ifndef NEW
00107 #define NEW new
00108 #endif
00109
00110 #if defined(_MSC_VER) || qCarbon
00111 #   define DECLC extern "C"
00112 #else
00113 #   define DECLC
00114 #endif
00115
00116 #if defined(WIN32) || qCarbon
00117 #   define DEC_GLUE(f) (*f##_glue)
00118
00119     Tcl_Command DEC_GLUE(Tcl_CreateCommand)
00120         _ANSI_ARGS_((Tcl_Interp *interp, char *cmdName, Tcl_CmdProc *proc,
00121             ClientData clientData, Tcl_CmdDeleteProc *deleteProc));
00122     Tcl_Interp * DEC_GLUE(Tcl_CreateInterp) _ANSI_ARGS_((void));
00123     void DEC_GLUE(Tcl_AppendResult) _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp));
00124     void DEC_GLUE(Tcl_SetResult) _ANSI_ARGS_((Tcl_Interp *interp, char *string, Tcl_FreeProc *freeProc));
00125     void DEC_GLUE(Tcl_DeleteInterp) _ANSI_ARGS_((Tcl_Interp *interp));
00126     int DEC_GLUE(Tcl_Eval) _ANSI_ARGS_((Tcl_Interp *interp, char *string));
00127     int DEC_GLUE(Tcl_EvalFile) _ANSI_ARGS_((Tcl_Interp *interp, char *fileName));
00128     char *      DEC_GLUE(Tcl_Alloc) _ANSI_ARGS_((unsigned int size));
00129     void        DEC_GLUE(Tcl_Free) _ANSI_ARGS_((char *ptr));
00130     char *      DEC_GLUE(Tcl_Realloc) _ANSI_ARGS_((char *ptr,
00131                     unsigned int size));
00132     int     DEC_GLUE(Tcl_ExprLong) _ANSI_ARGS_((Tcl_Interp *interp,
00133                 char *string, long *ptr));
00134     char *      DEC_GLUE(Tcl_Concat) _ANSI_ARGS_((int argc, char **argv));
00135     char *      DEC_GLUE(Tcl_SetVar2) _ANSI_ARGS_((Tcl_Interp *interp,
00136                 char *part1, char *part2, char *newValue,
00137                 int flags));
00138     void        DEC_GLUE(Tcl_DStringStartSublist) _ANSI_ARGS_((
00139                 Tcl_DString *dsPtr));
00140     void        DEC_GLUE(Tcl_DStringEndSublist) _ANSI_ARGS_((Tcl_DString *dsPtr));
00141     void        DEC_GLUE(Tcl_DStringFree) _ANSI_ARGS_((Tcl_DString *dsPtr));
00142     void        DEC_GLUE(Tcl_DStringInit) _ANSI_ARGS_((Tcl_DString *dsPtr));
00143     void        DEC_GLUE(Tcl_DStringResult) _ANSI_ARGS_((Tcl_Interp *interp,
00144                 Tcl_DString *dsPtr));
00145     char *      DEC_GLUE(Tcl_DStringAppendElement) _ANSI_ARGS_((
00146                 Tcl_DString *dsPtr, CONST char *string));
00147     void        DEC_GLUE(TclFreeObj) _ANSI_ARGS_((Tcl_Obj *objPtr));
00148     void        DEC_GLUE(Tcl_SetObjResult) _ANSI_ARGS_((Tcl_Interp *interp,
00149                 Tcl_Obj *resultObjPtr));
00150     Tcl_Obj *   DEC_GLUE(Tcl_NewStringObj) _ANSI_ARGS_((CONST char *bytes,
00151                 int length));
00152     Tcl_Obj *   DEC_GLUE(Tcl_NewListObj) _ANSI_ARGS_((int objc,
00153                 Tcl_Obj *CONST objv[]));
00154     int     DEC_GLUE(Tcl_ListObjAppendElement) _ANSI_ARGS_((
00155                 Tcl_Interp *interp, Tcl_Obj *listPtr,
00156                 Tcl_Obj *objPtr));
00157
00158     void        DEC_GLUE(Tcl_SourceRCFile) _ANSI_ARGS_((Tcl_Interp * interp));
00159     int     DEC_GLUE(Tcl_Init) _ANSI_ARGS_((Tcl_Interp * interp));
00160     char *      DEC_GLUE(Tcl_SetVar) _ANSI_ARGS_((Tcl_Interp * interp,
00161                 char * varName, char * newValue, int flags));
00162     void        DEC_GLUE(Tcl_FindExecutable) _ANSI_ARGS_((CONST char * argv0));
00163
00164 #   define GLUE_WRAP(f) f##_glue
00165 #   define Tcl_CreateCommand GLUE_WRAP(Tcl_CreateCommand)
00166 #   define Tcl_CreateInterp GLUE_WRAP(Tcl_CreateInterp)
00167 #   define Tcl_AppendResult GLUE_WRAP(Tcl_AppendResult)
00168 #   define Tcl_SetResult GLUE_WRAP(Tcl_SetResult)
00169 #   define Tcl_DeleteInterp GLUE_WRAP(Tcl_DeleteInterp)
00170 #   define Tcl_Eval GLUE_WRAP(Tcl_Eval)
00171 #   define Tcl_EvalFile GLUE_WRAP(Tcl_EvalFile)
00172 #   define Tcl_Alloc GLUE_WRAP(Tcl_Alloc)
00173 #   define Tcl_Free GLUE_WRAP(Tcl_Free)
00174 #   define Tcl_Realloc GLUE_WRAP(Tcl_Realloc)
00175 #   define Tcl_ExprLong GLUE_WRAP(Tcl_ExprLong)
00176 #   define Tcl_Concat GLUE_WRAP(Tcl_Concat)
00177 #   define Tcl_SetVar2 GLUE_WRAP(Tcl_SetVar2)
00178 #   define Tcl_DStringStartSublist GLUE_WRAP(Tcl_DStringStartSublist)
00179 #   define Tcl_DStringEndSublist GLUE_WRAP(Tcl_DStringEndSublist)
00180 #   define Tcl_DStringFree GLUE_WRAP(Tcl_DStringFree)
00181 #   define Tcl_DStringInit GLUE_WRAP(Tcl_DStringInit)
00182 #   define Tcl_DStringResult GLUE_WRAP(Tcl_DStringResult)
00183 #   define Tcl_DStringAppendElement GLUE_WRAP(Tcl_DStringAppendElement)
00184 #   define TclFreeObj GLUE_WRAP(TclFreeObj)
00185 #   define Tcl_SetObjResult GLUE_WRAP(Tcl_SetObjResult)
00186 #   define Tcl_NewStringObj GLUE_WRAP(Tcl_NewStringObj)
00187 #   define Tcl_NewListObj GLUE_WRAP(Tcl_NewListObj)
00188 #   define Tcl_ListObjAppendElement GLUE_WRAP(Tcl_ListObjAppendElement)
00189 #   define Tcl_SourceRCFile GLUE_WRAP(Tcl_SourceRCFile)
00190 #   define Tcl_Init GLUE_WRAP(Tcl_Init)
00191 #   define Tcl_SetVar GLUE_WRAP(Tcl_SetVar)
00192 #   define Tcl_FindExecutable GLUE_WRAP(Tcl_FindExecutable)
00193 #endif /* WIN32 */
00194
00195 #if USE_TCL
00196
00197 // our app on OSX is CFM, while TCL is mach-o. We need to re-encode the function pointer
00198 // we give to the mach-o code
00199 #if qCarbon
00200 #   define _TCL_CALLBACK(f) ((Tcl_CmdProc *)_tcl_cfm_macho(f))
00201 #   define CompatLoadLibrary CarbonCompatLoadLibrary
00202 #   define CompatCloseLibrary CarbonCompatCloseLibrary
00203 #   define _CompatCallLibrary _CarbonCompatCallLibrary
00204 #else
00205 #   define _TCL_CALLBACK(f) f
00206 #endif
00207
00208 extern "C"
00209 {
00210     static int tclCvsProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]);
00211     static int tclHelpProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]);
00212     static int tclCvsOutProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]);
00213     static int tclCvsErrProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]);
00214     static int tclCvsBrowserProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]);
00215     static int tclCvsEntriesProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]);
00216     static void tclCvsEntriesDeleteProc(ClientData clientData);
00217 #ifdef WIN32
00218     static int tclDirProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]);
00219 #endif /* WIN32 */
00220
00221     static int tclCvsExitOnErrorProc(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]);
00222     static int tclCvsLastErrorCodeProc(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]);
00223     /* not used at the moment
00224        static int tclSetDebugLevelProc(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]); */
00225 }
00226
00227 // the tcl browser class entity
00228 class CTCLBrowserEnt
00229 {
00230 public:
00231     CTCLBrowserEnt()
00232     {}
00233
00234     CTCLBrowserEnt(EntnodeData *data)
00235     : node(data)
00236     {}
00237
00238     CTCLBrowserEnt(const CTCLBrowserEnt & ent)
00239     : node(ent.node)
00240     {}
00241
00242     ~CTCLBrowserEnt()
00243     {}
00244
00245     CTCLBrowserEnt & operator=(const CTCLBrowserEnt & ent)
00246     {
00247         node = ent.node;
00248         return *this;
00249     }
00250
00251     bool IsSamePath(const char * pathstr) const
00252     {
00253         CStr path = pathstr;
00254         CTcl_Interp::Deunixfy(path);
00255
00256         CStr file;
00257         node.Data()->GetFullPathName(file);
00258         CTcl_Interp::Deunixfy(file);
00259
00260         return path.compare(file) == 0;
00261     }
00262
00263     EntnodeData* GetData() const
00264     {
00265         return node.Data();
00266     }
00267
00268     // returns normalized path and file name (GetName() may return relative path)
00269     void GetNormalized(CStr& path, CStr& fname) const
00270     {
00271         CStr file;
00272         node.Data()->GetFullPathName(file);
00273         CTcl_Interp::Deunixfy(file);
00274         SplitPath(file, path, fname);
00275     }
00276
00277 private:
00278     ENTNODE node;
00279 };
00280
00281 static std::vector<CTCLBrowserEnt> sTclBrowser;
00282
00283 class CTCLCvsConsole : public CCvsConsole
00284 {
00285 public:
00286     CTCLCvsConsole(Tcl_Interp *interp) : fInterp(interp)
00287     {
00288         fLen = 100;
00289         fAlloc = (char *)malloc((fLen + 1) * sizeof(char));
00290     }
00291     virtual ~CTCLCvsConsole()
00292     {
00293         if(fAlloc != 0L)
00294             free(fAlloc);
00295     }
00296
00297     virtual long cvs_out(char *txt, long len)
00298     {
00299         if(fAlloc == 0L)
00300             return 0;
00301
00302         if(len > fLen)
00303         {
00304             fLen = len;
00305             fAlloc = (char *)realloc(fAlloc, (fLen + 1) * sizeof(char));
00306         }
00307         if(fAlloc == 0L)
00308             return 0;
00309
00310         memcpy(fAlloc, txt, len * sizeof(char));
00311         fAlloc[len] = '\0';
00312
00313         Tcl_AppendResult(fInterp, fAlloc, 0L);
00314         return len;
00315     }
00316
00317     virtual long cvs_err(char *txt, long len)
00318     {
00319         return cvs_out(txt, len);
00320     }
00321 protected:
00322     Tcl_Interp *fInterp;
00323     int fLen;
00324     char *fAlloc;
00325 };
00326
00327 DECLC static int tclCvsProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
00328 {
00329     CTcl_Interp *tcl_interp = (CTcl_Interp*) clientData;
00330     CvsArgs args;
00331
00332     for(int i = 1; i < argc; i++)
00333     {
00334         args.add(argv[i]);
00335     }
00336
00337     CTCLCvsConsole console(interp);
00338     int exitc = launchCVS(0L, args.Argc(), args.Argv(), &console);
00339
00340     //
00341     // Set CvsLastErrorCode value. TCL script can query
00342     // this value using cvslasterrorcode command
00343     //
00344     tcl_interp->SetCvsLastErrorCode(exitc);
00345
00346     //
00347     // If command succeeded then return always TCL_OK and
00348     // proceed with script. If command failed (exitc != 0)
00349     // then exit only if CvsExitOnError is TRUE.
00350     //
00351     if(exitc == 0)
00352         return TCL_OK;
00353     else
00354         return tcl_interp->GetCvsExitOnError() ? TCL_ERROR : TCL_OK;
00355 }
00356
00357 DECLC static int tclHelpProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
00358 {
00359     Tcl_AppendResult(interp, "Help :\n", 0L);
00360     Tcl_AppendResult(interp, "   cvs  : the cvs tool.\n", 0L);
00361     Tcl_AppendResult(interp, "   help : this help.\n", 0L);
00362     Tcl_AppendResult(interp, "Others commands :\n", 0L);
00363     Tcl_AppendResult(interp, "   cd   : change directory\n", 0L);
00364     Tcl_AppendResult(interp, "   pwd  : print current directory\n", 0L);
00365     Tcl_AppendResult(interp, "   ls   : list the current directory\n", 0L);
00366     Tcl_AppendResult(interp, "   info ?  : misc. informations\n", 0L);
00367     Tcl_AppendResult(interp, "   info commands : all the TCL commands\n", 0L);
00368     return TCL_OK;
00369 }
00370
00371 DECLC static int tclCvsOutProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
00372 {
00373     for(int i = 1; i < argc; i++)
00374     {
00375         cvs_outstr(argv[i], strlen(argv[i]));
00376     }
00377     return TCL_OK;
00378 }
00379
00380 DECLC static int tclCvsErrProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
00381 {
00382     for(int i = 1; i < argc; i++)
00383     {
00384         cvs_errstr(argv[i], strlen(argv[i]));
00385     }
00386     return TCL_OK;
00387 }
00388
00389 DECLC static int tclCvsBrowserProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
00390 {
00391     if(argc < 2)
00392     {
00393         Tcl_AppendResult(interp, argv[0], " : Missing arguments\n", 0L);
00394         return TCL_ERROR;
00395     }
00396
00397     std::vector<CTCLBrowserEnt> & browser = clientData != 0L ?
00398         *(std::vector<CTCLBrowserEnt> *)clientData : sTclBrowser;
00399     if(strcmp(argv[1], "get") == 0)
00400     {
00401         if(argc != 2)
00402         {
00403             char *str = Tcl_Concat(argc, argv);
00404             Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00405             Tcl_Free(str);
00406             return TCL_ERROR;
00407         }
00408
00409         Tcl_Obj *list = Tcl_NewListObj(0, 0L);
00410         std::vector<CTCLBrowserEnt>::const_iterator i;
00411         for(i = browser.begin(); i != browser.end(); ++i)
00412         {
00413             const std::vector<CTCLBrowserEnt>::const_iterator entry = i;
00414             CStr path;
00415             entry->GetData()->GetFullPathName(path);
00416             CTcl_Interp::Unixfy(path);
00417
00418             Tcl_Obj * obj = Tcl_NewStringObj(path, path.length());
00419             Tcl_ListObjAppendElement(interp, list, obj);
00420             //TclFreeObj(obj);
00421         }
00422         Tcl_SetObjResult(interp, list);
00423         //TclFreeObj(list);
00424     }
00425     else if(strcmp(argv[1], "info") == 0)
00426     {
00427         if(argc != 4)
00428         {
00429             char *str = Tcl_Concat(argc, argv);
00430             Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00431             Tcl_Free(str);
00432             return TCL_ERROR;
00433         }
00434
00435         std::vector<CTCLBrowserEnt>::const_iterator i;
00436         for(i = browser.begin(); i != browser.end(); ++i)
00437         {
00438             const std::vector<CTCLBrowserEnt>::const_iterator entry = i;
00439             if(entry->IsSamePath(argv[2]))
00440             {
00441                 EntnodeData* data = entry->GetData();
00442                 CStr path, fname, value;
00443                 entry->GetNormalized(path, fname);
00444                 char *res = Tcl_SetVar2(interp, argv[3], "name", fname, 0);
00445                 if(res == 0L)
00446                     goto err1;
00447
00448                 value = data->GetType() == ENT_FILE ? "file" : "folder";
00449                 res = Tcl_SetVar2(interp, argv[3], "kind", value, 0);
00450                 if(res == 0L)
00451                     goto err1;
00452
00453                 res = Tcl_SetVar2(interp, argv[3], "path", path, 0);
00454                 if(res == 0L)
00455                     goto err1;
00456
00457                 value = (*data)[EntnodeData::kStatus];
00458                 res = Tcl_SetVar2(interp, argv[3], "status", value, 0);
00459                 if(res == 0L)
00460                     goto err1;
00461
00462                 value = data->IsMissing() ? "1" : "0";
00463                 res = Tcl_SetVar2(interp, argv[3], "missing", value, 0);
00464                 if(res == 0L)
00465                     goto err1;
00466
00467                 value = data->IsUnknown() ? "1" : "0";
00468                 res = Tcl_SetVar2(interp, argv[3], "unknown", value, 0);
00469                 if(res == 0L)
00470                     goto err1;
00471
00472                 value = data->IsIgnored() ? "1" : "0";
00473                 res = Tcl_SetVar2(interp, argv[3], "ignored", value, 0);
00474                 if(res == 0L)
00475                     goto err1;
00476
00477                 value = data->IsLocked() ? "1" : "0";
00478                 res = Tcl_SetVar2(interp, argv[3], "locked", value, 0);
00479                 if(res == 0L)
00480                     goto err1;
00481
00482                 value = data->IsUnmodified() ? "0" : "1";
00483                 res = Tcl_SetVar2(interp, argv[3], "modified", value, 0);
00484                 if(res == 0L)
00485                     goto err1;
00486
00487                 value = data->GetDesc();
00488                 res = Tcl_SetVar2(interp, argv[3], "status", value, 0);
00489                 if(res == 0L)
00490                     goto err1;
00491
00492                 if(data->GetType() == ENT_FILE)
00493                 {
00494                     value = (*data)[EntnodeFile::kVN];
00495                     res = Tcl_SetVar2(interp, argv[3], "revision", value, 0);
00496                     if(res == 0L)
00497                         goto err1;
00498
00499                     value = (*data)[EntnodeFile::kTS];
00500                     res = Tcl_SetVar2(interp, argv[3], "timestamp", value, 0);
00501                     if(res == 0L)
00502                         goto err1;
00503
00504                     value = (*data)[EntnodeFile::kOption];
00505                     res = Tcl_SetVar2(interp, argv[3], "option", value, 0);
00506                     if(res == 0L)
00507                         goto err1;
00508
00509                     value = (*data)[EntnodeFile::kTag];
00510                     res = Tcl_SetVar2(interp, argv[3], "tag", value, 0);
00511                     if(res == 0L)
00512                         goto err1;
00513
00514                     value = (*data)[EntnodeFile::kConflict];
00515                     res = Tcl_SetVar2(interp, argv[3], "conflict", value, 0);
00516                     if(res == 0L)
00517                         goto err1;
00518                 }
00519
00520                 goto ok1;
00521 err1:
00522                 Tcl_AppendResult(interp, argv[0], " : Error while creating '", argv[3], "'\n", 0L);
00523                 return TCL_ERROR;
00524 ok1:
00525                 break;
00526             }
00527         }
00528     }
00529     else
00530     {
00531         char *str = Tcl_Concat(argc, argv);
00532         Tcl_AppendResult(interp, argv[0], " : Wrong arguments : '", str, "'\n", 0L);
00533         Tcl_Free(str);
00534         return TCL_ERROR;
00535     }
00536     return TCL_OK;
00537 }
00538
00539 class CFillTclEntries : public TraversalReport
00540 {
00541 public:
00542     CSortList<ENTNODE> & m_entries;
00543     std::vector<CStr> m_ignlist;
00544
00545     CFillTclEntries(CSortList<ENTNODE> & entries) :
00546         m_entries(entries) {}
00547
00548     virtual ~CFillTclEntries() {}
00549
00550     virtual kTraversal EnterDirectory(const char *fullpath, const char *dirname, const FSSpec * macspec)
00551     {
00552         Entries_Open (m_entries, fullpath);
00553         BuildIgnoredList(m_ignlist, fullpath);
00554         return kContinueTraversal;
00555     }
00556
00557     virtual kTraversal ExitDirectory(const char *fullpath)
00558     {
00559         m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00560         return kContinueTraversal;
00561     }
00562
00563     virtual kTraversal OnError(const char *err, int errcode)
00564     {
00565         return kTraversalError;
00566     }
00567
00568     virtual kTraversal OnIdle(const char *fullpath)
00569     {
00570         return kContinueTraversal;
00571     }
00572
00573     virtual kTraversal OnDirectory(const char *fullpath,
00574         const char *fullname,
00575         const char *name,
00576         const struct stat & dir, const FSSpec * macspec)
00577     {
00578 #if defined(WIN32) || defined(macintosh)
00579         if(stricmp(name, "CVS") == 0)
00580 #else
00581         if(strcmp(name, "CVS") == 0)
00582 #endif
00583             return kSkipFile;
00584
00585         /*EntnodeData *data = */Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00586
00587         return kSkipFile;
00588     }
00589
00590     virtual kTraversal OnAlias(const char *fullpath,
00591         const char *fullname,
00592         const char *name,
00593         const struct stat & dir, const FSSpec * macspec)
00594     {
00595         return OnFile(fullpath, fullname, name, dir, macspec);
00596     }
00597
00598     virtual kTraversal OnFile(const char *fullpath,
00599         const char *fullname,
00600         const char *name,
00601         const struct stat & dir, const FSSpec * macspec)
00602     {
00603         /*EntnodeData *data = */Entries_SetVisited(fullpath, m_entries, name, dir, false, &m_ignlist);
00604
00605         return kContinueTraversal;
00606     }
00607 };
00608
00609
00610 DECLC static void tclCvsEntriesDeleteProc(ClientData clientData)
00611 {
00612     if(clientData != 0L)
00613         delete (std::vector<CTCLBrowserEnt> *)clientData;
00614 }
00615
00616 DECLC static int tclCvsEntriesProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
00617 {
00618     if(argc != 3)
00619     {
00620         Tcl_AppendResult(interp, argv[0], " : Wrong # of arguments\n", 0L);
00621         return TCL_ERROR;
00622     }
00623
00624     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00625
00626     // refetch all items
00627     CFillTclEntries traverse(entries);
00628     CStr path(argv[1]);
00629     CTcl_Interp::Deunixfy(path);
00630     /*kTraversal res = */FileTraverse(path, traverse);
00631
00632     // add the missing files
00633     Entries_SetMissing(entries);
00634
00635     // now make the TCL entries
00636     std::vector<CTCLBrowserEnt> *browser = NEW std::vector<CTCLBrowserEnt>;
00637
00638     int numEntries = entries.NumOfElements();
00639     for(int i = 0; i < numEntries; i++)
00640     {
00641         const ENTNODE & theNode = entries.Get(i);
00642         EntnodeData *data = theNode.Data();
00643         browser->push_back(CTCLBrowserEnt(data));
00644     }
00645
00646     Tcl_Command cmd = Tcl_CreateCommand (interp, argv[2], _TCL_CALLBACK(tclCvsBrowserProc),
00647         (ClientData)browser, tclCvsEntriesDeleteProc);
00648
00649     return cmd != 0L ? TCL_OK : TCL_ERROR;
00650 }
00651
00652 #ifdef WIN32
00653 class LSReport : public TraversalReport
00654 {
00655 public:
00656     Tcl_Interp *fInterp;
00657     int fState;
00658
00659     LSReport(Tcl_Interp *interp) : fInterp(interp), fState(TCL_OK) {}
00660
00661     virtual kTraversal EnterDirectory(const char *fullpath, const char *dirname, const FSSpec * macspec)
00662     {
00663         return kContinueTraversal;
00664     }
00665
00666     virtual kTraversal ExitDirectory(const char *fullpath)
00667     {
00668         return kContinueTraversal;
00669     }
00670
00671     virtual kTraversal OnError(const char *err, int errcode)
00672     {
00673         fState = TCL_ERROR;
00674         Tcl_AppendResult(fInterp, err, "\n", 0L);
00675         return kTraversalError;
00676     }
00677
00678     virtual kTraversal OnIdle(const char *fullpath)
00679     {
00680         return kContinueTraversal;
00681     }
00682
00683     virtual kTraversal OnAnyDevice(const char *fullpath,
00684         const char *fullname,
00685         const char *name,
00686         const struct stat & dir, const FSSpec * macspec)
00687     {
00688         Tcl_AppendResult(fInterp, name, "\n", 0L);
00689         return kSkipFile;
00690     }
00691 };
00692
00693 DECLC static int tclDirProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
00694 {
00695     LSReport report(interp);
00696     char path[256];
00697     getcwd(path, 256);
00698     kTraversal res = FileTraverse(path, report);
00699     return report.fState;
00700 }
00701 #endif /* WIN32 */
00702
00703 DECLC static int tclSafeRemove (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
00704 {
00705     if(argc < 2)
00706     {
00707         Tcl_AppendResult(interp, argv[0], " : Missing list of files\n", 0L);
00708         return TCL_ERROR;
00709     }
00710
00711     for(int i = 1; i < argc; i++)
00712     {
00713         CStr fn(argv[i]);
00714         CTcl_Interp::Deunixfy(fn);
00715         if(!CompatMoveToTrash(fn, 0))  // dir is not needed, TCL profides fully qualified file name
00716         {
00717             cvs_err("Unable to trash '%s'\n", (char *)fn);
00718         }
00719     }
00720
00721     return TCL_OK;
00722 }
00723
00724 DECLC static int tclCvsExitOnErrorProc(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
00725 {
00726     CTcl_Interp *tcl_interp = (CTcl_Interp*) clientData;
00727
00728     //
00729     // CvsExitOnError command can be used to define whether TCL macro
00730     // is automatically terminated if CVS command returned error (non zero).
00731     //
00732     // CvsExitOnError has following modes:
00733     //   false  = Do not exit automaticaly. CvsLastErrorCode constains the last error code.
00734     //   true   = Exit TCL script in error (default).
00735     //
00736     if(argc < 2)
00737     {
00738         Tcl_AppendResult(interp, argv[0], " : Missing argument (true|false)\n", 0L);
00739         return TCL_ERROR;
00740     }
00741
00742     if(strcmp(argv[1], "true") == 0)
00743         tcl_interp->SetCvsExitOnError(true);
00744     else if(strcmp(argv[1], "false") == 0)
00745         tcl_interp->SetCvsExitOnError(false);
00746     else
00747     {
00748         char *str = Tcl_Concat(argc, argv);
00749         Tcl_AppendResult(interp, argv[0], " : Wrong argument : '", str, "'\n", 0L);
00750         Tcl_Free(str);
00751
00752         return TCL_ERROR;
00753     }
00754
00755     return TCL_OK;
00756 }
00757
00758 DECLC static int tclCvsLastErrorCodeProc(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
00759 {
00760     CTcl_Interp *tcl_interp = (CTcl_Interp*) clientData;
00761
00762     if(argc < 2)
00763     {
00764         char value[35];
00765
00766         // CvsLastErrorCode called without arguments, so return current value
00767         sprintf(value, "%d", tcl_interp->GetCvsLastErrorCode());
00768         Tcl_AppendResult(interp, value, 0L);
00769     }
00770     else
00771     {
00772         // Set the value of LastErrorCode variable
00773         tcl_interp->SetCvsLastErrorCode(atoi(argv[1]));
00774     }
00775
00776     return TCL_OK;
00777 }
00778
00779 #if defined(WIN32)
00780 DECLC static int tclGetFileModTimeProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
00781 {
00782     struct wnt_stat sb;
00783     struct tm * p_utc = NULL;
00784
00785     if (argc < 2)
00786     {
00787         Tcl_AppendResult(interp, argv[0], " : Missing argument (int)\n", 0L);
00788         return TCL_ERROR;
00789     }
00790
00791     if (argc > 2)
00792     {
00793         char * str = Tcl_Concat(argc, argv);
00794         Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00795         Tcl_Free(str);
00796         return TCL_ERROR;
00797     }
00798
00799     if (wnt_stat(argv[1], &sb) != 0)
00800     {
00801         Tcl_AppendResult(interp, argv[0], " : Could not find file : '", argv[1], "'\n", 0L);
00802         return TCL_ERROR;
00803     }
00804
00805     p_utc = gmtime(& sb.st_mtime);
00806     Tcl_AppendResult(interp, asctime(p_utc), 0L);
00807     return TCL_OK;
00808 }
00809
00810 DECLC static int tclSetDebugMaskProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
00811 {
00812     if (argc < 2)
00813     {
00814         Tcl_AppendResult(interp, argv[0], " : Missing argument (int)\n", 0L);
00815         return TCL_ERROR;
00816     }
00817
00818     if (argc > 3)
00819     {
00820         char * str = Tcl_Concat(argc, argv);
00821         Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00822         Tcl_Free(str);
00823         return TCL_ERROR;
00824     }
00825
00826     char * endc = NULL;
00827     unsigned long n;
00828     bool b;
00829
00830     n = strtoul(argv[1], & endc, 0);
00831     if (*endc)
00832     {
00833         Tcl_AppendResult(interp, argv[0], " : Could not understand argument '", argv[1], "'\n", 0L);
00834         return TCL_ERROR;
00835     }
00836
00837     if (argc == 2)
00838     {
00839         SetWinCvsDebugMask(n);
00840         return TCL_OK;
00841     }
00842
00843
00844     if (!stricmp(argv[2], "true"))
00845     {
00846         b = true;
00847     }
00848     else if (!stricmp(argv[2], "false"))
00849     {
00850         b = false;
00851     }
00852     else
00853     {
00854         b = strtoul(argv[2], & endc, 0) != 0;
00855         if (*endc)
00856         {
00857             Tcl_AppendResult(interp, argv[0], " : Could not understand argument '", argv[2], "'\n", 0L);
00858             return TCL_ERROR;
00859         }
00860     }
00861
00862     SetWinCvsDebugMaskBit(n,b);
00863     return TCL_OK;
00864 }
00865
00866 DECLC static int tclGetDebugMaskProc (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
00867 {
00868     char retstr[32];
00869     if (argc < 2)
00870     {
00871         _snprintf(retstr,32,"%u",GetWinCvsDebugMask());
00872         Tcl_AppendResult(interp, retstr, 0L);
00873         return TCL_OK;
00874     }
00875
00876     if (argc > 3)
00877     {
00878         char * str = Tcl_Concat(argc, argv);
00879         Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00880         Tcl_Free(str);
00881         return TCL_ERROR;
00882     }
00883
00884     char * endc = NULL;
00885     unsigned long n;
00886
00887     n = strtoul(argv[1], & endc, 0);
00888     if (*endc)
00889     {
00890         Tcl_AppendResult(interp, argv[0], " : Could not understand argument '", argv[1], "'\n", 0L);
00891         return TCL_ERROR;
00892     }
00893
00894     _snprintf(retstr, 32, "%u", GetWinCvsDebugMaskBit(n));
00895     Tcl_AppendResult(interp, retstr, 0L);
00896
00897     return TCL_OK;
00898 }
00899 #endif  // WIN32
00900
00901 #endif // USE_TCL
00902
00903 void TclBrowserReset(void)
00904 {
00905 #if USE_TCL
00906     sTclBrowser.erase(sTclBrowser.begin(), sTclBrowser.end());
00907 #endif
00908 }
00909
00910 // note that although 'path' is not used here any longer, it makes sense to retain
00911 // that attribute since it gives you an option to figure out relative filename,
00912 // relative to 'path' that designates the folder in which the operation takes place
00913 void TclBrowserAppend(const char * /*path*/, EntnodeData *data)
00914 {
00915 #if USE_TCL
00916     sTclBrowser.push_back(CTCLBrowserEnt(data));
00917 #endif
00918 }
00919
00920 static Tcl_Interp *myTcl_CreateInterp(void)
00921 {
00922 #   ifdef WIN32
00923     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00924     CStr path;
00925     app->GetAppModule(path);
00926     Tcl_FindExecutable(path);
00927 #   endif
00928
00929 #   ifdef qMacCvsPP
00930     CStr appPath = CMacCvsApp::GetAppPath();
00931     Tcl_FindExecutable(appPath);
00932 #   endif
00933
00934 #   if USE_TCL
00935     Tcl_Interp *res = Tcl_CreateInterp();
00936     return res;
00937 #   else
00938     return NULL;
00939 #   endif
00940 }
00941
00942 CTcl_Interp::CTcl_Interp()
00943 {
00944     fInterp = 0L;
00945
00946     fExitOnError = true;
00947     fLastErrorCode = 0;
00948
00949 #if USE_TCL
00950     if(!CTcl_Interp::IsAvail())
00951     {
00952         cvs_err("TCL is not available !\n");
00953         return;
00954     }
00955
00956     fInterp = myTcl_CreateInterp();
00957     if(fInterp == 0L)
00958     {
00959         cvs_err("Unable to create a new TCL interpreter !\n");
00960         return;
00961     }
00962
00963     Tcl_Command cmd;
00964
00965     // this parameter is used to get access to CTcl_Interp::SetCvsLastErrorCode
00966     // in tclCvsProc method
00967     cmd = Tcl_CreateCommand (fInterp, "cvs", _TCL_CALLBACK(tclCvsProc),
00968         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
00969
00970     cmd = Tcl_CreateCommand (fInterp, "help", _TCL_CALLBACK(tclHelpProc),
00971         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00972     cmd = Tcl_CreateCommand (fInterp, "cvsout", _TCL_CALLBACK(tclCvsOutProc),
00973         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00974     cmd = Tcl_CreateCommand (fInterp, "cvserr", _TCL_CALLBACK(tclCvsErrProc),
00975         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00976     cmd = Tcl_CreateCommand (fInterp, "cvsbrowser", _TCL_CALLBACK(tclCvsBrowserProc),
00977         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00978     cmd = Tcl_CreateCommand (fInterp, "cvsentries", _TCL_CALLBACK(tclCvsEntriesProc),
00979         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00980 #ifdef WIN32
00981     cmd = Tcl_CreateCommand (fInterp, "ls", _TCL_CALLBACK(tclDirProc),
00982         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00983     cmd = Tcl_CreateCommand (fInterp, "dir", _TCL_CALLBACK(tclDirProc),
00984         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00985 #endif /* WIN32 */
00986     cmd = Tcl_CreateCommand (fInterp, "trash", _TCL_CALLBACK(tclSafeRemove),
00987         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00988
00989     cmd = Tcl_CreateCommand (fInterp, "cvsexitonerror", _TCL_CALLBACK(tclCvsExitOnErrorProc),
00990         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
00991
00992     cmd = Tcl_CreateCommand (fInterp, "cvslasterrorcode", _TCL_CALLBACK(tclCvsLastErrorCodeProc),
00993         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
00994 #if defined(WIN32)
00995     cmd = Tcl_CreateCommand (fInterp, "cvssetdebugmask", _TCL_CALLBACK(tclSetDebugMaskProc),
00996         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
00997     cmd = Tcl_CreateCommand (fInterp, "cvsgetdebugmask", _TCL_CALLBACK(tclGetDebugMaskProc),
00998         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
00999     cmd = Tcl_CreateCommand (fInterp, "cvsfilemodtime", _TCL_CALLBACK(tclGetFileModTimeProc),
01000         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
01001 #endif  // defined(WIN32)
01002
01003     CStr rcfile;
01004     MacrosGetLoc(rcfile);
01005     if(!rcfile.endsWith(kPathDelimiter))
01006         rcfile << kPathDelimiter;
01007     rcfile << "startup.tcl";
01008     Tcl_SetVar(fInterp, "tcl_rcFileName", rcfile, TCL_GLOBAL_ONLY);
01009     Tcl_SetVar(fInterp, "tcl_interactive", "1", TCL_GLOBAL_ONLY);
01010     Tcl_Init(fInterp);
01011     Tcl_SourceRCFile(fInterp);
01012 #endif
01013 }
01014
01015 CTcl_Interp::~CTcl_Interp()
01016 {
01017 #if USE_TCL
01018     if(fInterp != 0L)
01019         Tcl_DeleteInterp(fInterp);
01020 #endif
01021 }
01022
01023 bool CTcl_Interp::IsAvail(void)
01024 {
01025 #if USE_TCL
01026 #if defined(macintosh) && !qCarbon
01027     return Tcl_CreateInterp != 0L;
01028 #else /* !macintosh */
01029     static bool firstTime = true;
01030     static bool tclAvail = false;
01031     if(firstTime)
01032     {
01033 #   if defined(WIN32) || qCarbon
01034         CompatConnectID connID;
01035 #   endif
01036
01037 #   ifdef WIN32
01038         extern char *findTcl (char *_minVer, int _exact, int _dbgOnly);
01039         char *tclver = 0L;
01040         try
01041         {
01042             tclver = findTcl("8.1", 0, 0);
01043         }
01044         catch(...)
01045         {
01046         }
01047
01048         if(tclver != 0L)
01049             tclAvail = CompatLoadLibrary(&connID, tclver) != 0;
01050
01051         if(!tclAvail)
01052             tclAvail = CompatLoadLibrary(&connID, "tcl87.dll") != 0 ||
01053             CompatLoadLibrary(&connID, "tcl86.dll") != 0 ||
01054             CompatLoadLibrary(&connID, "tcl85.dll") != 0 ||
01055             CompatLoadLibrary(&connID, "tcl84.dll") != 0 ||
01056             CompatLoadLibrary(&connID, "tcl83.dll") != 0 ||
01057             CompatLoadLibrary(&connID, "tcl82.dll") != 0 ||
01058             CompatLoadLibrary(&connID, "tcl81.dll") != 0;
01059 #   endif
01060
01061 #   if qCarbon
01062         if (UEnvironment::GetOSVersion() >= 0x1000)
01063             tclAvail = CompatLoadLibrary(&connID, "/System/Library/Frameworks/Tcl.framework");
01064         else
01065             tclAvail = CompatLoadLibrary(&connID, "tcl8.3");
01066 #   endif
01067
01068 #   if defined(WIN32) || qCarbon
01069 #   define LOAD_CODEFRAG(name) \
01070         if(tclAvail) \
01071             tclAvail = (*(void **)&name##_glue = \
01072                 _CompatCallLibrary(connID, #name)) != 0L
01073 #   endif
01074 #   if defined(WIN32) || TARGET_API_MAC_CARBON
01075         LOAD_CODEFRAG(Tcl_CreateCommand);
01076         LOAD_CODEFRAG(Tcl_CreateInterp);
01077         LOAD_CODEFRAG(Tcl_AppendResult);
01078         LOAD_CODEFRAG(Tcl_SetResult);
01079         LOAD_CODEFRAG(Tcl_DeleteInterp);
01080         LOAD_CODEFRAG(Tcl_Eval);
01081         LOAD_CODEFRAG(Tcl_EvalFile);
01082         LOAD_CODEFRAG(Tcl_Alloc);
01083         LOAD_CODEFRAG(Tcl_Free);
01084         LOAD_CODEFRAG(Tcl_Realloc);
01085         LOAD_CODEFRAG(Tcl_ExprLong);
01086         LOAD_CODEFRAG(Tcl_Concat);
01087         LOAD_CODEFRAG(Tcl_SetVar2);
01088         LOAD_CODEFRAG(Tcl_DStringStartSublist);
01089         LOAD_CODEFRAG(Tcl_DStringEndSublist);
01090         LOAD_CODEFRAG(Tcl_DStringFree);
01091         LOAD_CODEFRAG(Tcl_DStringInit);
01092         LOAD_CODEFRAG(Tcl_DStringResult);
01093         LOAD_CODEFRAG(Tcl_DStringAppendElement);
01094         LOAD_CODEFRAG(TclFreeObj);
01095         LOAD_CODEFRAG(Tcl_SetObjResult);
01096         LOAD_CODEFRAG(Tcl_NewStringObj);
01097         LOAD_CODEFRAG(Tcl_NewListObj);
01098         LOAD_CODEFRAG(Tcl_ListObjAppendElement);
01099         LOAD_CODEFRAG(Tcl_SourceRCFile);
01100         LOAD_CODEFRAG(Tcl_Init);
01101         LOAD_CODEFRAG(Tcl_SetVar);
01102         LOAD_CODEFRAG(Tcl_FindExecutable);
01103
01104         if(!tclAvail)
01105             return false;
01106 #   endif /* WIN32 */
01107
01108         Tcl_Interp *interp = myTcl_CreateInterp();
01109         tclAvail = interp != 0L;
01110         if (!tclAvail)
01111             return false;
01112
01113         Tcl_Init(interp);
01114
01115         /* Destroy the interp we needed just for this */
01116         Tcl_DeleteInterp(interp);
01117
01118         firstTime = false;
01119     }
01120
01121     return tclAvail;
01122 #endif /* !macintosh */
01123 #else
01124     return false;
01125 #endif
01126 }
01127
01128 kTclRes CTcl_Interp::DoScript(const char *script)
01129 {
01130 #if USE_TCL
01131     bool bTclFileStarted;
01132
01133     if(fInterp == 0L)
01134         return false;
01135
01136     // If script cmd begins with "source " then this
01137     // must be TCL file execution.
01138     bTclFileStarted = (strncmp(script, "source ", 7) == 0);
01139     if(bTclFileStarted)
01140         gCvsPrefs.SetTclFileRunning(true);
01141
01142     int exitc = Tcl_Eval(fInterp, (char *)script);
01143
01144     if(bTclFileStarted)
01145         gCvsPrefs.SetTclFileRunning(false);
01146
01147     size_t len = strlen(fInterp->result);
01148     if(exitc == TCL_ERROR)
01149     {
01150         cvs_errstr(fInterp->result, len);
01151         if(len != 0 && fInterp->result[len - 1] != '\n')
01152             cvs_errstr("\n", 1);
01153     }
01154     else
01155     {
01156         cvs_outstr(fInterp->result, len);
01157         if(len != 0 && fInterp->result[len - 1] != '\n')
01158             cvs_outstr("\n", 1);
01159     }
01160
01161     return exitc;
01162 #else
01163     return false;
01164 #endif
01165 }
01166
01167 kTclRes CTcl_Interp::DoScriptVar(const char *format, ...)
01168 {
01169 #if USE_TCL
01170     if(fInterp == 0L)
01171         return false;
01172
01173     va_list args;
01174     char script[1024] = {'\0'};
01175
01176     va_start (args, format);
01177     vsprintf (script, format, args);
01178     va_end (args);
01179
01180     return DoScript(script);
01181 #else
01182     return false;
01183 #endif
01184 }
01185
01186 kTclRes CTcl_Interp::DoFile(const char *file)
01187 {
01188 #if USE_TCL
01189     if(fInterp == 0L)
01190         return false;
01191
01192     int exitc = Tcl_EvalFile(fInterp, (char *)file);
01193     size_t len = strlen(fInterp->result);
01194     if(exitc == TCL_ERROR)
01195     {
01196         cvs_errstr(fInterp->result, len);
01197         if(len != 0 && fInterp->result[len - 1] != '\n')
01198             cvs_errstr("\n", 1);
01199     }
01200     else
01201     {
01202         cvs_outstr(fInterp->result, len);
01203         if(len != 0 && fInterp->result[len - 1] != '\n')
01204             cvs_outstr("\n", 1);
01205     }
01206
01207     return exitc;
01208 #else
01209     return false;
01210 #endif
01211 }
01212
01213 void CTcl_Interp::Unixfy(CStr & path)
01214 {
01215     char *ptr = path;
01216     while((ptr = strchr(ptr, kPathDelimiter)) != 0L)
01217     {
01218         *ptr++ = kTCLPathDelimiter;
01219     }
01220     ptr = (char *)path + path.length() - 1;
01221     if(*ptr == kTCLPathDelimiter)
01222     {
01223         *ptr = '\0';
01224     }
01225 }
01226
01227 void CTcl_Interp::Deunixfy(CStr & path)
01228 {
01229     char *ptr = path;
01230     while((ptr = strchr(ptr, kTCLPathDelimiter)) != 0L)
01231     {
01232         *ptr++ = kPathDelimiter;
01233     }
01234 }
Generated on Sun Feb 24 01:21:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/TclGlue.h Source File

common/TclGlue.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * TclGlue.h --- glue to the TCL language
00023  */
00024
00025 #ifndef TCLGLUE_H
00026 #define TCLGLUE_H
00027
00028 class UStr;
00029 class EntnodeData;
00030
00031 #ifndef _TCL
00032 #   define TCL_OK       0
00033 #   define TCL_ERROR    1
00034 #   define TCL_RETURN   2
00035 #   define TCL_BREAK    3
00036 #   define TCL_CONTINUE 4
00037 #endif
00038
00039 typedef int kTclRes;
00040
00041 #ifndef macintosh
00042 #   define kTCLPathDelimiter '/'
00043 #else
00044 #   define kTCLPathDelimiter ':'
00045 #endif
00046
00047 struct Tcl_Interp;
00048
00049 class CTcl_Interp
00050 {
00051 public:
00052     CTcl_Interp();
00053     ~CTcl_Interp();
00054
00055     static bool IsAvail(void);
00056         // tells if TCL is available
00057
00058     kTclRes DoScriptVar(const char *format, ...);
00059     kTclRes DoScript(const char *script);
00060     kTclRes DoFile(const char *file);
00061         // execute a TCL script, returns false on error
00062
00063     inline operator Tcl_Interp *(void) {return fInterp;}
00064
00065     inline int  GetCvsLastErrorCode()  { return fLastErrorCode; }
00066     inline void SetCvsLastErrorCode(int value)  { fLastErrorCode = value; }
00067
00068     inline bool GetCvsExitOnError()  { return fExitOnError; }
00069     inline void SetCvsExitOnError(bool value) { fExitOnError = value; }
00070
00071     static void Unixfy(UStr & path);
00072     static void Deunixfy(UStr & path);
00073         // changes the \ into a /
00074 protected:
00075     Tcl_Interp *fInterp;
00076
00077     int  fLastErrorCode;    // ErrorCode value from the last CVS command (cvslaunch)
00078     bool fExitOnError;      // TRUE = Exit TCL macro automatically in error, FALSE = Do not exit
00079 };
00080
00081 // browser filler
00082 void TclBrowserReset(void);
00083 void TclBrowserAppend(const char *path, EntnodeData *data);
00084     // TO_OBSOLETE
00085
00086 #endif /* TCLGLUE_H */
Generated on Sun Feb 24 01:21:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/TclGlue.mac.cpp Source File

common/TclGlue.mac.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2001
00019  */
00020
00021 /*
00022  * TclGlue.mac.cpp --- glue to the TCL language specific to mac/carbon
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #if qCarbon
00028
00029 #ifndef NEW
00030 #define NEW new
00031 #endif
00032
00033 #include "TclGlue.mac.h"
00034 #include <CFBundle.h>
00035 #include <stdlib.h>
00036 #include <string.h>
00037
00038 // our app on OSX is CFM, while TCL is mach-o. We need to re-encode the function pointer
00039 // we give to the mach-o code
00040 typedef struct _CompatConnectID
00041 {
00042     CFURLRef        bundleURL;
00043     CFBundleRef     myBundle;
00044 };
00045
00046 static ProcPtr getSymFunction(CompatConnectID connID, const Str255 name)
00047 {
00048     long symCount;
00049     Ptr symAddr;
00050     int i;
00051     OSErr err = CountSymbols(connID, &symCount);
00052     if(err != noErr)
00053         return 0L;
00054
00055     for(i = 0; i < symCount; i++)
00056     {
00057         CFragSymbolClass symClass;
00058         Str255 symName;
00059         err = GetIndSymbol(connID, i, symName, &symAddr, &symClass);
00060         if(err != noErr)
00061             return 0L;
00062         if(memcmp(symName, name, name[0]) == 0)
00063             break;
00064     }
00065     if(i == symCount)
00066         return 0L;
00067     return (ProcPtr)symAddr;
00068 }
00069
00070 int CarbonCompatLoadLibrary(CompatConnectID * connID, const char *name_dll)
00071 {
00072     if(connID == 0L)
00073         return 0;
00074
00075     if (UEnvironment::GetOSVersion() < 0x1000)
00076     {
00077         OSErr err;
00078         Ptr mainAddr;
00079         Str255 errMessage;
00080         Str255 pname;
00081
00082         c2pstrcpy(pname, name_dll);
00083         err = GetSharedLibrary(pname, kPowerPCCFragArch, kPrivateCFragCopy, connID, &mainAddr, errMessage);
00084         return err == noErr;
00085     }
00086     else
00087     {
00088         *connID = 0L;
00089
00090          *connID = (CompatConnectID)malloc(sizeof(_CompatConnectID));
00091
00092         struct _CompatConnectID *c = (struct _CompatConnectID *)*connID;
00093
00094         if(c == 0L)
00095             return 0;
00096
00097         c->bundleURL = 0L;
00098         c->myBundle = 0L;
00099
00100         CFStringRef s = CFStringCreateWithCString(0L, name_dll, kCFStringEncodingMacRoman);
00101         if(s == 0L)
00102             goto fail;
00103
00104         c->bundleURL    = CFURLCreateWithFileSystemPath(0L, s, kCFURLPOSIXPathStyle, false );
00105         if(c->bundleURL == 0L)
00106             goto fail;
00107
00108         c->myBundle = CFBundleCreate(0L, c->bundleURL );
00109         if(c->myBundle == 0L)
00110             goto fail;
00111
00112         if(!CFBundleLoadExecutable( c->myBundle ))
00113             goto fail;
00114
00115         CFRelease( s );
00116         return 1;
00117     fail:
00118         if(s != 0L)
00119             CFRelease( s );
00120         if(c != 0L)
00121         {
00122             if(c->bundleURL != 0L)
00123                 CFRelease( c->bundleURL );
00124             if(c->myBundle != 0L)
00125                 CFRelease( c->myBundle );
00126             *connID = 0L;
00127             free(c);
00128         }
00129         return 0;
00130     }
00131 }
00132
00133 int CarbonCompatCloseLibrary(CompatConnectID * connID)
00134 {
00135     if(connID == 0L)
00136         return 0;
00137
00138     if (UEnvironment::GetOSVersion() < 0x1000)
00139     {
00140         CloseConnection(connID);
00141     }
00142     else
00143     {
00144         struct _CompatConnectID *c = (struct _CompatConnectID *)*connID;
00145         if(c != 0L)
00146         {
00147             CFBundleUnloadExecutable( c->myBundle );
00148             CFRelease( c->bundleURL );
00149             CFRelease( c->myBundle );
00150             free(c);
00151         }
00152         *connID = 0L;
00153     }
00154     return 1;
00155 }
00156
00157 void *_CarbonCompatCallLibrary(CompatConnectID connID, const char *name_func)
00158 {
00159     if (UEnvironment::GetOSVersion() < 0x1000)
00160     {
00161         ProcPtr symAddr;
00162         UniversalProcPtr proc;
00163         Str255 pname;
00164
00165         c2pstrcpy(pname, name_func);
00166
00167         symAddr = getSymFunction(connID, pname);
00168         return symAddr;
00169     }
00170     else
00171     {
00172         CFStringRef s = CFStringCreateWithCString(0L, name_func, kCFStringEncodingMacRoman);
00173         if(s == 0L)
00174             return 0L;
00175
00176         struct _CompatConnectID *c = (struct _CompatConnectID *)connID;
00177         void *ptr = CFBundleGetFunctionPointerForName(c->myBundle, s);
00178         CFRelease( s );
00179
00180         return ptr;
00181     }
00182
00183     return 0L;
00184 }
00185
00186 #define CompatLoadLibrary CarbonCompatLoadLibrary
00187 #define CompatCloseLibrary CarbonCompatCloseLibrary
00188 #define _CompatCallLibrary _CarbonCompatCallLibrary
00189
00190 void *_tcl_cfm_macho(void *func)
00191 {
00192     static UInt32 templ[6] = {0x3D800000, 0x618C0000, 0x800C0000, 0x804C0004, 0x7C0903A6, 0x4E800420};
00193
00194     // nothing to do on OS9, cause we call a CFM code in this case
00195     if (UEnvironment::GetOSVersion() < 0x1000)
00196         return func;
00197
00198 #pragma message(" Memory leak here, fix me !")
00199     UInt32  *mfp = (UInt32*) NewPtr( sizeof(templ) );       //  Must later dispose of allocated memory
00200     if(mfp == 0L)
00201         return 0L;
00202
00203     mfp[0] = templ[0] | ((UInt32)func >> 16);
00204     mfp[1] = templ[1] | ((UInt32)func & 0xFFFF);
00205     mfp[2] = templ[2];
00206     mfp[3] = templ[3];
00207     mfp[4] = templ[4];
00208     mfp[5] = templ[5];
00209     MakeDataExecutable( mfp, sizeof(templ) );
00210
00211     return mfp;
00212 }
00213
00214 #endif // qCarbon
Generated on Sun Feb 24 01:21:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/TclGlue.mac.h Source File

common/TclGlue.mac.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2001
00019  */
00020
00021 /*
00022  * TclGlue.mac.h --- glue to the TCL language specific to mac/carbon
00023  */
00024
00025 #ifndef TCLGLUEMAC_H
00026 #define TCLGLUEMAC_H
00027
00028 #include "dll_loader.h"
00029
00030 int CarbonCompatLoadLibrary(CompatConnectID * connID, const char *name_dll);
00031 int CarbonCompatCloseLibrary(CompatConnectID * connID);
00032 void *_CarbonCompatCallLibrary(CompatConnectID connID, const char *name_func);
00033 void *_tcl_cfm_macho(void *func);
00034
00035 #endif // TCLGLUEMAC_H
Generated on Sun Feb 24 01:21:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/TextBinary.cpp Source File

common/TextBinary.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * TextBinary.cpp --- utilities to ckeck if files are binary or text
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef WIN32
00028 #   include <sys/stat.h>
00029 #   include <direct.h>
00030 #   include <io.h>
00031 #endif /* WIN32 */
00032
00033 #ifdef macintosh
00034 #   include <Resources.h>
00035 #   include <unistd.h>
00036 #   include <sys/types.h>
00037 #   include <sys/stat.h>
00038 #   include "MacMisc.h"
00039 #endif /* macintosh */
00040
00041 #ifdef HAVE_UNISTD_H
00042 #   include <unistd.h>
00043 #endif
00044
00045 #include <stdio.h>
00046 #include <errno.h>
00047 #include <stdlib.h>
00048 #include <string.h>
00049
00050 #include "TextBinary.h"
00051 #include "FileTraversal.h"
00052 #include "AppConsole.h"
00053 #include "CPStr.h"
00054 #include "CvsPrefs.h"
00055
00056 #if !defined(S_ISLNK) && defined(S_IFLNK)
00057 #   if defined(S_IFMT)
00058 #       define  S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
00059 #   else
00060 #       define S_ISLNK(m) ((m) & S_IFLNK)
00061 #   endif
00062 #endif
00063
00064 #define MAX_TEST_SIZE 100000
00065
00066 #ifdef WIN32
00067 #   ifdef _DEBUG
00068 #   define new DEBUG_NEW
00069 #   undef THIS_FILE
00070     static char THIS_FILE[] = __FILE__;
00071 #   endif
00072 #endif /* WIN32 */
00073
00074 static CStaticAllocT<char> sBuf;
00075 static int sBufSize;
00076
00077 static kTextBinTYPE FillBuffer(const char *arg, const char *dir, const UFSSpec * spec, bool bin)
00078 {
00079     sBuf.AdjustSize(MAX_TEST_SIZE);
00080
00081     if(chdir(dir) != 0)
00082     {
00083         cvs_err("Unable to chdir to ""%s"" (error %d)\n", dir, errno);
00084         return kFileMissing;
00085     }
00086
00087     FILE *samp = fopen(arg, bin ? "rb" : "r");
00088     if(samp == 0L)
00089     {
00090         return kFileMissing;
00091     }
00092
00093     sBufSize = fread(sBuf, sizeof(char), MAX_TEST_SIZE, samp);
00094     if(sBufSize < 0)
00095     {
00096         cvs_err("Unable to read ""%s"" (error %d)\n", arg, errno);
00097         return kFileMissing;
00098     }
00099
00100     fclose(samp);
00101     return kFileIsOK;
00102 }
00103
00104 static kTextBinTYPE TestBuffer(const char *arg, const char *dir, const UFSSpec * spec, kFileType expectType)
00105 {
00106     if(sBufSize == 0)
00107         return kFileIsOK;
00108
00109     bool isUnicode = false;
00110 #ifdef WIN32
00111     isUnicode = gCvsPrefs.WhichVersion() == kWin32 ? false : IsTextUnicode(sBuf, sBufSize, NULL);
00112 #endif /* WIN32 */
00113
00114     // Windows : fread skips the \r, so we don't care.
00115     // Mac : MSL exchanges when reading the \r and \n,
00116     // so we look for \n
00117     // Others : default to \n
00118
00119     const unsigned char nativeNL = '\n';
00120     const unsigned char nonnativeNL = '\r';
00121
00122     float percent = 0;
00123     int numBinChars = 0;
00124     int numTextChars = 0;
00125
00126     if( !isUnicode )
00127     {
00128         // figure if it is binary
00129         int i;
00130         unsigned char c;
00131         char *tmp;
00132
00133         for(tmp = sBuf, i = 0; i < sBufSize; i++)
00134         {
00135             c = (unsigned char)*tmp++;
00136             if((c < 0x20 && c != nativeNL && c != nonnativeNL && c != '\t') || (c >= 0x80
00137 #ifdef macintosh
00138                 && c != (unsigned char)'Ñ' && c != (unsigned char)'¥' /* powerplant */
00139 #endif /* macintosh */
00140                 ))
00141                 numBinChars++;
00142             else
00143                 numTextChars++;
00144         }
00145
00146         percent = (float)numBinChars / (float)sBufSize;
00147     }
00148
00149     // more than 5% binary makes binary
00150     bool isbin = percent >= 0.05;
00151
00152     switch( expectType )
00153     {
00154     case kFileTypeText:
00155         if( isUnicode )
00156         {
00157             return kTextIsUnicode;
00158         }
00159         else if( isbin )
00160         {
00161             return kTextIsBinary;
00162         }
00163         break;
00164     case kFileTypeBin:
00165         if( isUnicode )
00166         {
00167             return kBinIsUnicode;
00168         }
00169         else if( !isbin )
00170         {
00171             return kBinIsText;
00172         }
00173         break;
00174     case kFileTypeUnicode:
00175         if( !isUnicode )
00176         {
00177             return isbin ? kUnicodeIsBinary : kUnicodeIsText;
00178         }
00179         break;
00180     default:
00181 #ifdef WIN32
00182         ASSERT(FALSE); // uknown type
00183 #endif
00184         break;
00185     }
00186
00187     // for the text files, check if the new lines are good
00188     if(kFileTypeText == expectType)
00189     {
00190         int i;
00191         unsigned char c;
00192         char *tmp;
00193         int numNonNative = 0, numNative = 0;
00194         for(tmp = sBuf, i = 0; i < sBufSize; i++)
00195         {
00196             c = (unsigned char)*tmp++;
00197             if(c == nonnativeNL)
00198                 numNonNative++;
00199             else if(c == nativeNL)
00200                 numNative++;
00201         }
00202         if(numNative == 0)
00203         {
00204             if(numNonNative > 0)
00205                 return kTextWrongLF;
00206         }
00207         else
00208         {
00209             percent = (float)numNonNative / (float)numNative;
00210             if(percent >= 0.1)
00211                 return kTextWrongLF;
00212         }
00213
00214         if(numBinChars > 0)
00215             return kTextEscapeChar;
00216     }
00217
00218     return kFileIsOK;
00219 }
00220
00221 #if TARGET_RT_MAC_CFM
00222 static kTextBinTYPE GetMacSig(const char *arg, const char *dir, const UFSSpec * spec, bool expectbin)
00223 {
00224     CInfoPBRec info;
00225
00226     info.dirInfo.ioVRefNum      = spec->vRefNum;
00227     info.dirInfo.ioDrDirID      = spec->parID;
00228     info.dirInfo.ioNamePtr      = (StringPtr)spec->name;
00229     info.dirInfo.ioFDirIndex    = 0;
00230     info.dirInfo.ioACUser       = 0;
00231
00232     OSErr err = PBGetCatInfoSync(&info);
00233     if(err != noErr || (info.dirInfo.ioFlAttrib & 0x10)/*folder*/)
00234     {
00235         cvs_err("Unable to get info on ""%s"" (error %d)\n", arg, err);
00236         return kFileMissing;
00237     }
00238
00239     if(info.hFileInfo.ioFlFndrInfo.fdFlags & (1 << 15))
00240     {
00241         return kFileIsAlias;
00242     }
00243
00244     if(expectbin)
00245     {
00246         if(info.hFileInfo.ioFlFndrInfo.fdType == 'TEXT')
00247             return kBinWrongSig;
00248     }
00249     else
00250     {
00251         if(info.hFileInfo.ioFlRLgLen > 0 && info.hFileInfo.ioFlLgLen == 0)
00252             return kTextIsBinary;
00253
00254
00255         if(info.hFileInfo.ioFlFndrInfo.fdType != 'TEXT')
00256             return kTextWrongSig;
00257     }
00258
00259     return kFileIsOK;
00260 }
00261 #endif /* TARGET_RT_MAC_CFM */
00262
00263 #if TARGET_RT_MAC_MACHO
00264 static kTextBinTYPE GetMacSig(const char *arg, const char *dir, const UFSSpec * spec, bool expectbin)
00265 {
00266     FSCatalogInfo info;
00267     FInfo finfo;
00268
00269     OSErr err = FSGetCatalogInfo(spec, kFSCatInfoNodeFlags | kFSCatInfoFinderInfo |
00270         kFSCatInfoDataSizes | kFSCatInfoRsrcSizes, &info, NULL, NULL, NULL);
00271     if(err != noErr || (info.nodeFlags & kFSNodeIsDirectoryMask))
00272     {
00273         cvs_err("Unable to get info on ""%s"" (error %d)\n", arg, err);
00274         return kFileMissing;
00275     }
00276
00277     memcpy(&finfo, &info.finderInfo, 2 * sizeof(OSType));
00278
00279     if(expectbin)
00280     {
00281         if(finfo.fdType == 'TEXT')
00282             return kBinWrongSig;
00283     }
00284     else
00285     {
00286         if(info.rsrcPhysicalSize > 0 && info.dataPhysicalSize == 0)
00287             return kTextIsBinary;
00288
00289         if(finfo.fdType != 'TEXT' && finfo.fdType != '    ')
00290             return kTextWrongSig;
00291     }
00292
00293     return kFileIsOK;
00294 }
00295 #endif /* TARGET_RT_MAC_MACHO */
00296
00297
00298 static kTextBinTYPE TestValidName(const char *filename)
00299 {
00300     kTextBinTYPE result = kFileIsOK;
00301
00302     if(strchr(filename, '/') != 0L)
00303         result = kFileInvalidName;
00304     if(strchr(filename, '\n') != 0L)
00305         result = kFileInvalidName;
00306
00307 #ifdef macintosh
00308     if(strchr(filename, '\r') != 0L)
00309         result = kFileInvalidName;
00310     if(strcmp(filename, ".") == 0 || strcmp(filename, "..") == 0)
00311         result = kFileInvalidName;
00312     if(strcmp(filename, "CVS") != 0 && stricmp(filename, "cvs") == 0)
00313         result = kFileInvalidName;
00314 #endif /* !macintosh */
00315
00316     return result;
00317 }
00318
00319 static kTextBinTYPE TestFileIsAlias(const char *arg, const char *dir, const UFSSpec * spec)
00320 {
00321     kTextBinTYPE result = kFileIsOK;
00322
00323 #ifdef S_ISLNK
00324     CPStr fullname;
00325     struct stat sb;
00326
00327     fullname = dir;
00328     if(!fullname.endsWith(kPathDelimiter))
00329         fullname << kPathDelimiter;
00330     fullname << arg;
00331
00332     if (stat(fullname, &sb) == -1)
00333         result = kFileMissing;
00334     else if(S_ISLNK(sb.st_mode))
00335         result = kFileIsAlias;
00336 #endif /* S_ISLNK */
00337
00338     return result;
00339 }
00340
00341 kTextBinTYPE FileIsText(const char *arg, const char *dir, const UFSSpec * spec)
00342 {
00343     kTextBinTYPE state;
00344
00345 #ifdef macintosh
00346     state = GetMacSig(arg, dir, spec, false);
00347     if(state != kFileIsOK)
00348         return state;
00349 #endif /* macintosh */
00350
00351     state = FillBuffer(arg, dir, spec, false);
00352     if(state != kFileIsOK)
00353         return state;
00354
00355     if(sBufSize == 0)
00356         return kFileIsOK;
00357
00358     state = TestBuffer(arg, dir, spec, kFileTypeText);
00359     if(state != kFileIsOK)
00360         return state;
00361
00362     state = TestValidName(arg);
00363     if(state != kFileIsOK)
00364         return state;
00365
00366     state = TestFileIsAlias(arg, dir, spec);
00367     if(state != kFileIsOK)
00368         return state;
00369
00370     return kFileIsOK;
00371 }
00372
00373 kTextBinTYPE FileIsBinary(const char *arg, const char *dir, const UFSSpec * spec)
00374 {
00375     kTextBinTYPE state;
00376
00377     state = FillBuffer(arg, dir, spec, true);
00378     if(state != kFileIsOK)
00379         return state;
00380
00381     state = TestBuffer(arg, dir, spec, kFileTypeBin);
00382
00383 #ifdef macintosh
00384     kTextBinTYPE sigstate = GetMacSig(arg, dir, spec, true);
00385     if(sigstate != kFileIsOK)
00386         return state;
00387     if(state != kFileIsOK && state != kBinIsText)
00388         return state;
00389 #else /* !macintosh */
00390     if(state != kFileIsOK)
00391         return state;
00392 #endif /* !macintosh */
00393
00394     state = TestValidName(arg);
00395     if(state != kFileIsOK)
00396         return state;
00397
00398     state = TestFileIsAlias(arg, dir, spec);
00399     if(state != kFileIsOK)
00400         return state;
00401
00402     return kFileIsOK;
00403 }
00404
00405 kTextBinTYPE FileIsUnicode(const char *arg, const char *dir, const UFSSpec * spec /*= 0L*/)
00406 {
00407     kTextBinTYPE state;
00408
00409     state = FillBuffer(arg, dir, spec, true);
00410     if(state != kFileIsOK)
00411         return state;
00412
00413     state = TestBuffer(arg, dir, spec, kFileTypeUnicode);
00414
00415 #ifdef macintosh
00416     kTextBinTYPE sigstate = GetMacSig(arg, dir, spec, true);
00417     if(sigstate != kFileIsOK)
00418         return state;
00419     if(state != kFileIsOK && state != kBinIsText)
00420         return state;
00421 #else /* !macintosh */
00422     if(state != kFileIsOK)
00423         return state;
00424 #endif /* !macintosh */
00425
00426     state = TestValidName(arg);
00427     if(state != kFileIsOK)
00428         return state;
00429
00430     state = TestFileIsAlias(arg, dir, spec);
00431     if(state != kFileIsOK)
00432         return state;
00433
00434     return kFileIsOK;
00435 }
00436
00437 bool SplitPath(const char *dir, CStr & uppath, CStr & folder)
00438 {
00439     char newdir[512];
00440     char olddir[512];
00441     char newfile[256];
00442     int lendir = strlen(dir);
00443     strcpy(olddir, dir);
00444     if(dir[lendir - 1] == kPathDelimiter)
00445     {
00446         olddir[lendir - 1] = '\0';
00447         --lendir;
00448     }
00449     const char *tmp = olddir, *prev = olddir;
00450
00451     while((tmp = strchr(tmp, kPathDelimiter)) != 0L)
00452         prev = ++tmp;
00453
00454     strcpy(newdir, olddir);
00455     newdir[prev - olddir] = '\0';
00456     strcpy(newfile, prev);
00457
00458     uppath = newdir;
00459     folder = newfile;
00460
00461     return true;
00462 }
00463
00464 void GetExtension(const char *file, CStr & base, CStr & ext)
00465 {
00466     char *tmp = strrchr(file, '.');
00467     if(tmp == 0L)
00468     {
00469         ext = "";
00470         base = file;
00471     }
00472     else
00473     {
00474         ext = tmp + 1;
00475         base = file;
00476         base[tmp - file] = '\0';
00477     }
00478 }
00479
00480 bool MakeTmpFile(CStr & file, const char *prefix, const char *extension /*= 0L*/, bool create /*= false*/)
00481 {
00482     static int count = 0;
00483     char filename[256];
00484
00485     CStr tmpPath;
00486     CStr ext;
00487     CStr prf;
00488
00489     if(extension != 0L && extension[0] != '\0')
00490     {
00491         if(extension[0] != '.')
00492             ext = ".";
00493         ext << extension;
00494     }
00495
00496     if(prefix != 0L && prefix[0] != '\0')
00497     {
00498         prf = prefix;
00499     }
00500     else
00501         prf = "cvsgui";
00502
00503 #ifdef WIN32
00504     char *ptr;
00505     ptr = getenv(_T("TMP"));
00506     if (ptr != 0L && _access( ptr, 0 ) != -1 )
00507         tmpPath = ptr;
00508     else
00509         tmpPath = ".";
00510 #endif /* !WIN32 */
00511 #ifdef macintosh
00512     UFSSpec theFolder;
00513     OSErr err;
00514
00515     if((err = MacGetTempFolder(theFolder, tmpPath)) != noErr)
00516     {
00517         cvs_err("Unable to locate the preferences folder (error %d) !\n", err);
00518         return 0L;
00519     }
00520
00521     for (;;) {
00522         sprintf(filename, "%s%d%s", (const char *)prf, count, (const char *)ext);
00523         if (::strlen (filename) <= 31) break;
00524
00525         if (prf.length () == 0) {
00526             cvs_err("Unable to truncate temp file !\n");
00527             return 0L;
00528             } // if
00529
00530         prf.set (prf, prf.length () - 1);
00531         } // for
00532 #endif /* !macintosh */
00533 #if qUnix
00534     tmpPath = "/tmp";
00535 #endif
00536
00537     struct stat sb;
00538     if (stat(tmpPath, &sb) == -1 || !S_ISDIR(sb.st_mode))
00539     {
00540         cvs_err("Unable to access '%s' (error %d) !\n", (const char *)tmpPath, errno);
00541         return false;
00542     }
00543
00544     if(!tmpPath.endsWith(kPathDelimiter))
00545         tmpPath << kPathDelimiter;
00546
00547     int maxtry = 10000;
00548     while(1)
00549     {
00550         sprintf(filename, "%s%d%s", (const char *)prf, count++, (const char *)ext);
00551         file = tmpPath;
00552         file << filename;
00553         if (stat(file, &sb) == -1 && errno == ENOENT)
00554         {
00555             if( create )
00556             {
00557                 FILE* stream = fopen(file, "w");
00558                 if( stream )
00559                 {
00560                     fclose(stream);
00561                 }
00562             }
00563             return true;
00564         }
00565
00566         if(maxtry-- == 0)
00567         {
00568             cvs_err("Time out to access '%s' !\n", (const char *)tmpPath);
00569             break;
00570         }
00571     }
00572
00573     return false;
00574 }
00575
00576 bool GetEnvValue(const char *cmd, const char *key, UStr & value)
00577 {
00578     const char *tmp = strstr(cmd, key);
00579     if(tmp == 0L)
00580         return false;
00581     tmp = strchr(tmp, '=');
00582     if(tmp == 0L)
00583         return false;
00584     tmp++;
00585     const char *tmp2 = strchr(tmp, '&');
00586     if(tmp2 == 0L)
00587         value = tmp;
00588     else
00589         value.set(tmp, tmp2 - tmp);
00590     return true;
00591 }
00592
00593 int StringToArgv(const char *cmdLine, char **argv)
00594 {
00595     int argc = 0;
00596
00597     char    Quote = '\0';               /*  Contains the quote character if we are
00598                                             inside "" or '', or \0 otherwise */
00599     const char* walker1 = cmdLine;      /*  walker1 traverses the original
00600                                             command line */
00601     char*   walker2;                    /*  walker2 traverses the parsed copy of
00602                                             the command line */
00603     char    theChar;                    /*  theChar is the character we are currently
00604                                             parsing */
00605     char    arguments [MAX_CMD_LEN];            /*  will contain a parsed copy of the
00606                                             command line */
00607
00608     walker2 = arguments;                                        /*  copy into arguments */
00609     while ((theChar = *walker1++) != '\0') {                    /*  parse command line to \0 */
00610         if (theChar == ' ')                                     /*  skip leading space before an argument */
00611             continue;
00612         argv [argc++] = walker2;                                /*  set argv to point to the space
00613                                                                     where we copy the next argument */
00614         if (argc > MAX_ARGS) {                                  /*  if we filled argv, skip the rest */
00615             argc--;
00616             break;
00617         }
00618         do {                                                    /*  parse an argument */
00619             if (theChar == '\\' && *walker1++)                  /*  skip \s */
00620                 theChar = *walker1++;
00621             else
00622                 if ((theChar == '"') || (theChar == '\'')) {    /*  when we find a quote... */
00623                     if (Quote == '\0') {                        /*  if we are not inside quotes already, */
00624                         Quote = theChar;                        /*  remember we are inside quotes now */
00625                         continue;                               /*  go to the next character */
00626                     }
00627                     if (theChar == Quote) {                     /*  if we are already inside that kind of quotes */
00628                         Quote = '\0';                           /*  close quotes */
00629                         continue;                               /*  go to the next character */
00630                     }
00631                 }
00632             *walker2++ = theChar;                               /*  copy the character into args */
00633                                                                 /*  repeat until we reach the end of arguments
00634                                                                     or we reach a space that is not inside quotes */
00635         } while ((*walker1 != '\0') && (((theChar = *walker1++) != ' ') || (Quote != '\0')));
00636         *walker2++ = 0;                                         /* null-terminate the last argument */
00637     }
00638
00639     return argc;
00640 }
Generated on Sun Feb 24 01:21:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/TextBinary.h Source File

common/TextBinary.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00019  */
00020
00021 /*
00022  * TextBinary.h --- utilities to ckeck if files are binary or text
00023  */
00024
00025 #ifndef TEXTBINARY_H
00026 #define TEXTBINARY_H
00027
00028 #include "CPStr.h"
00029
00030 #ifdef macintosh
00031 #   include <Files.h>
00032 #   if TARGET_API_MAC_OSX
00033 #       define UFSSpec FSRef
00034 #   else
00035 #       define UFSSpec FSSpec
00036 #   endif
00037 #else /* !macintosh */
00038     typedef int FSSpec;
00039 #   define UFSSpec FSSpec
00040 #endif /* !macintosh */
00041
00042 #ifdef WIN32
00043     static const char kPathDelimiter = '\\';
00044 #elif TARGET_RT_MAC_CFM
00045     static const char kPathDelimiter = ':';
00046 #else
00047     static const char kPathDelimiter = '/';
00048 #endif
00049
00051 typedef enum
00052 {
00053     // text and binary flags
00054     kFileIsOK,
00055     kFileMissing,
00056     kFileIsAlias,
00057     kFileInvalidName,
00059     // text flags
00060     kTextWrongLF,
00061     kTextIsBinary,
00062     kTextEscapeChar,
00063     kTextWrongSig,
00064     kTextIsUnicode,
00066     // binary flags
00067     kBinIsText,
00068     kBinWrongSig,
00069     kBinIsUnicode,
00071     // unicode flags
00072     kUnicodeIsText,
00073     kUnicodeIsBinary
00074 } kTextBinTYPE;
00075
00077 typedef enum
00078 {
00079     kFileTypeText,
00080     kFileTypeBin,
00081     kFileTypeUnicode
00082 } kFileType;
00083
00084 kTextBinTYPE FileIsText(const char *arg, const char *dir, const UFSSpec * spec = 0L);
00085 kTextBinTYPE FileIsBinary(const char *arg, const char *dir, const UFSSpec * spec = 0L);
00086 kTextBinTYPE FileIsUnicode(const char *arg, const char *dir, const UFSSpec * spec = 0L);
00087
00088 bool SplitPath(const char *dir, CStr & uppath, CStr & folder);
00089     // split the path with the up-directory and the folder.
00090     // returns false if failed
00091
00092 bool MakeTmpFile(CStr & file, const char *prefix, const char *extension = 0L, bool create = false);
00093     // find a unique name for a temp file
00094
00095 void GetExtension(const char *file, CStr & base, CStr & ext);
00096     // extract the extension from the filename
00097
00098 bool GetEnvValue(const char *cmd, const char *key, UStr & value);
00099     // utility function, parse a command like 'user=who&host=cvs'
00100
00101 #define MAX_ARGS 40
00102 #define MAX_CMD_LEN 2048
00103
00104 int StringToArgv(const char *cmdLine, char **argv);
00105     // convert a command line (possibly quoted) into
00106     // regular argc, argv arguments
00107
00108 #endif /* TEXTBINARY_H */
Generated on Sun Feb 24 01:21:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UCvsApp.cpp Source File

common/UCvsApp.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 /*
00022  *
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef HAVE_UNISTD_H
00028 #include <unistd.h>
00029 #endif
00030
00031 #ifdef HAVE_FCNTL_H
00032 #include <fcntl.h>
00033 #endif
00034
00035 #ifdef HAVE_SYS_WAIT_H
00036 #include <sys/wait.h>
00037 #endif
00038
00039 #if qGTK
00040 #include <gtk/gtk.h>
00041 #include <signal.h>
00042 // glade generated that
00043 extern "C"
00044 {
00045 #include "support.h"
00046 #include "interface.h"
00047 }
00048 #endif
00049
00050 #include "UCvsApp.h"
00051 #include "UCvsCommands.h"
00052 #include "UCvsFolders.h"
00053 #include "UCvsFiles.h"
00054 #include "TclGlue.h"
00055 #include "GetPrefs.h"
00056 #include "CvsPrefs.h"
00057 #include "AppConsole.h"
00058 #include "MacrosSetup.h"
00059 #include "Authen.h"
00060 #include "getopt.h"
00061
00062 UIMPLEMENT_DYNAMIC (UCvsApp, UWidget)
00063 UBEGIN_MESSAGE_MAP (UCvsApp, UWidget)
00064 ON_TIMER (UCvsApp::kProcessTimer, UCvsApp::OnMainTimer)
00065 UEND_MESSAGE_MAP ()
00066      UCvsApp *UCvsApp::gApp = 0L;
00067      CvsProcess *UCvsApp::gCurCvs = 0L;
00068
00069      static void usage (void)
00070 {
00071     fprintf (stderr, "gcvs [--root=path]\n");
00072 }
00073
00074 UCvsApp::UCvsApp (int argc, char **argv):
00075 UWidget (::UEventGetWidID ()),
00076 gCvsRunning (false),
00077 gCvsStopping (false)
00078 {
00079     gApp = this;
00080
00081 #if qGTK
00082     add_pixmap_directory (PACKAGE_DATA_DIR "/pixmaps");
00083     add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps");
00084 #endif
00085
00086     // load the persistent values (i.e. preferences) and the locate the macros
00087     gCvsPrefs.load ();
00088     MacrosReloadAll ();
00089
00090     AddTimer (50, kProcessTimer);
00091
00092     if (argc > 0)
00093     {
00094         static struct option long_options[] = {
00095             {"root", required_argument, 0L, 1},
00096             {0, 0, 0, 0}
00097         };
00098         optind = 0;
00099         int option_index = 0, c;
00100         while ((c = getopt_long
00101             (argc, argv, "+", long_options,
00102              &option_index)) != EOF)
00103         {
00104             switch (c)
00105             {
00106             case 1:
00107                 UCvsFolders::SetDefaultRoot (optarg);
00108                 break;
00109             default:
00110                 cvs_err ("Warning : unknown option\n");
00111                 usage ();
00112                 break;
00113             }
00114         }
00115
00116     }
00117 }
00118
00119 UCvsApp::~UCvsApp ()
00120 {
00121 }
00122
00123 void
00124 UCvsApp::SayWelcome (void)
00125 {
00126     // say hello from the application, optionnaly prompt for the CVSROOT
00127     cvs_out ("Welcome to %s %s\n", PACKAGE, VERSION);
00128     if (gCvsPrefs.empty ())
00129         CompatGetPrefs ();
00130     else
00131         cvs_out ("CVSROOT: %s (%s)\n", (const char *) gCvsPrefs,
00132              gAuthen.kindstr ());
00133
00134     if (CTcl_Interp::IsAvail ())
00135     {
00136         cvs_out ("TCL is available, shell and macros are enabled : help (select and press enter)\n");
00137     }
00138     else
00139     {
00140         cvs_err ("TCL is *not* available, shell and macros are disabled\n");
00141     }
00142 }
00143
00144 void
00145 UCvsApp::SetCvsRunning (bool state)
00146 {
00147     if (state ^ gCvsRunning)
00148     {
00149         gCvsRunning = state;
00150     }
00151 }
00152
00153 void
00154 UCvsApp::SetCvsStopping (bool state)
00155 {
00156     if (state ^ gCvsStopping)
00157     {
00158         gCvsStopping = state;
00159     }
00160 }
00161
00162 UCvsFolders *
00163 UCvsApp::GetBrowserView (void)
00164 {
00165     UCmdTarget *cmd = UEventQueryWidget (kUCvsFoldersID);
00166     if (cmd != 0L && cmd->IsKindOf (URUNTIME_CLASS (UCvsFolders)))
00167         return (UCvsFolders *) cmd;
00168
00169     return 0L;
00170 }
00171
00172 UCvsFiles *
00173 UCvsApp::GetFilesView (void)
00174 {
00175     UCmdTarget *cmd = UEventQueryWidget (kUCvsFilesID);
00176     if (cmd != 0L && cmd->IsKindOf (URUNTIME_CLASS (UCvsFiles)))
00177         return (UCvsFiles *) cmd;
00178
00179     return 0L;
00180 }
00181
00182 const char *
00183 UCvsApp::GetAppName () const
00184 {
00185 #ifdef macintosh
00186     return "MacCvs";
00187 #elif defined(WIN32)
00188     return "WinCvs";
00189 #elif defined(qUnix)
00190     return PACKAGE;
00191 #endif
00192 }
00193
00194 const char *
00195 UCvsApp::GetAppVersion () const
00196 {
00197 #ifdef macintosh
00198
00199 #elif defined(WIN32)
00200
00201 #elif defined(qUnix)
00202     return VERSION;
00203 #endif
00204 }
00205
00206 /*const char *
00207 UCvsApp::GetAppLibFolder () const
00208 {
00209 #if qUnix
00210     return EXECLIB;
00211 #else
00212     return 0L;
00213 #endif
00214 }*/
00215
00216 #if qUnix
00217 static void
00218 set_cloexec (gint fd)
00219 {
00220     fcntl (fd, F_SETFD, FD_CLOEXEC);
00221 }
00222
00223 static int
00224 gnome_execute_async_with_env_fds (const char *dir, int argc,
00225                   char *const argv[], int envc,
00226                   char *const envv[], gboolean close_fds)
00227 {
00228     int parent_comm_pipes[2], child_comm_pipes[2];
00229     int child_errno, itmp, i, open_max;
00230     int res;
00231     char **cpargv;
00232     pid_t child_pid, immediate_child_pid;   /* XXX this routine assumes
00233                          * pid_t is signed */
00234
00235     if (pipe (parent_comm_pipes))
00236         return -1;
00237
00238     child_pid = immediate_child_pid = fork ();
00239
00240     switch (child_pid)
00241     {
00242     case -1:
00243         close (parent_comm_pipes[0]);
00244         close (parent_comm_pipes[1]);
00245         return -1;
00246
00247     case 0:     /* START PROCESS 1: child */
00248         child_pid = -1;
00249         res = pipe (child_comm_pipes);
00250         close (parent_comm_pipes[0]);
00251         if (!res)
00252             child_pid = fork ();
00253
00254         switch (child_pid)
00255         {
00256         case -1:
00257             itmp = errno;
00258             child_pid = -1; /* simplify parent code */
00259             write (parent_comm_pipes[1], &child_pid,
00260                    sizeof (child_pid));
00261             write (parent_comm_pipes[1], &itmp, sizeof (itmp));
00262             close (child_comm_pipes[0]);
00263             close (child_comm_pipes[1]);
00264             _exit (0);
00265             break;  /* END PROCESS 1: monkey in the middle dies */
00266
00267         default:
00268         {
00269             char buf[16];
00270
00271             close (child_comm_pipes[1]);
00272             while ((res =
00273                 read (child_comm_pipes[0], buf,
00274                       sizeof (buf))) > 0)
00275                 write (parent_comm_pipes[1], buf, res);
00276             close (child_comm_pipes[0]);
00277             _exit (0);  /* END PROCESS 1: monkey in the middle dies */
00278         }
00279             break;
00280
00281         case 0: /* START PROCESS 2: child of child */
00282             close (parent_comm_pipes[1]);
00283             /* pre-exec setup */
00284             close (child_comm_pipes[0]);
00285             set_cloexec (child_comm_pipes[1]);
00286             child_pid = getpid ();
00287             res = write (child_comm_pipes[1], &child_pid,
00288                      sizeof (child_pid));
00289
00290             if (envv)
00291             {
00292                 for (itmp = 0; itmp < envc; itmp++)
00293                     putenv (envv[itmp]);
00294             }
00295
00296             if (dir)
00297                 chdir (dir);
00298
00299             cpargv = (char **) malloc ((argc + 1) *
00300                            sizeof (char *));
00301             memcpy (cpargv, argv, argc * sizeof (char *));
00302             cpargv[argc] = NULL;
00303
00304             if (close_fds)
00305             {
00306                 int stdinfd;
00307                 /* Close all file descriptors but stdin stdout and stderr */
00308                 open_max = sysconf (_SC_OPEN_MAX);
00309                 for (i = 3; i < open_max; i++)
00310                     set_cloexec (i);
00311
00312                 if (child_comm_pipes[1] != 0)
00313                 {
00314                     close (0);
00315                     /* Open stdin as being nothingness, so that if someone tries to
00316                      * read from this they don't hang up the whole GNOME session. BUGFIX #1548 */
00317                     stdinfd =
00318                         open ("/dev/null", O_RDONLY);
00319                     g_assert (stdinfd >= 0);
00320                     if (stdinfd != 0)
00321                     {
00322                         dup2 (stdinfd, 0);
00323                         close (stdinfd);
00324                     }
00325                 }
00326             }
00327             signal (SIGPIPE, SIG_DFL);
00328             /* doit */
00329             execvp (cpargv[0], cpargv);
00330             free (cpargv);
00331
00332             /* failed */
00333             itmp = errno;
00334             write (child_comm_pipes[1], &itmp, sizeof (itmp));
00335             _exit (1);
00336             break;  /* END PROCESS 2 */
00337         }
00338         break;
00339
00340     default:        /* parent process */
00341         /* do nothing */
00342         break;
00343     }
00344
00345     close (parent_comm_pipes[1]);
00346
00347     res = read (parent_comm_pipes[0], &child_pid, sizeof (child_pid));
00348     if (res != sizeof (child_pid))
00349     {
00350         g_message ("res is %d instead of %d", res,
00351                sizeof (child_pid));
00352         child_pid = -1; /* really weird things happened */
00353     }
00354     else if (read
00355          (parent_comm_pipes[0], &child_errno,
00356           sizeof (child_errno)) == sizeof (child_errno))
00357     {
00358         errno = child_errno;
00359         child_pid = -1;
00360     }
00361
00362     /* do this after the read's in case some OS's handle blocking on pipe writes
00363      * differently */
00364     waitpid (immediate_child_pid, &itmp, 0);    /* eat zombies */
00365
00366     close (parent_comm_pipes[0]);
00367
00368     if (child_pid < 0)
00369         g_message ("gnome_execute_async_with_env_fds: returning %d",
00370                child_pid);
00371
00372     return child_pid;
00373 }
00374 #endif
00375
00376 void
00377 UCvsApp::Execute (int argc, char *const *argv)
00378 {
00379 #if qUnix
00380     gnome_execute_async_with_env_fds (0L, argc, argv, 0, 0L, true);
00381 #endif
00382 }
00383
00384 void
00385 UCvsApp::OnMainTimer (long time)
00386 {
00387     if (gCurCvs != 0L)
00388     {
00389         cvs_process_give_time ();
00390         if (!cvs_process_is_active (gCurCvs))
00391         {
00392             UCvsApp::gApp->SetCvsRunning (false);
00393             gCurCvs = 0L;
00394             UWidget::DoValidUI (false);
00395             UCvsApp::gApp->GetFilesView ()->ResetView ();
00396         }
00397     }
00398 }
00399
00400 #if qGTK
00401 #   define NEWDLG(name) \
00402     void *UCreate_##name(void) \
00403     { \
00404         return create_##name(); \
00405     }
00406 NEWDLG (MainWindow)
00407 NEWDLG (GraphWindow)
00408 NEWDLG (AskYesNo)
00409 NEWDLG (gcvs_Settings)
00410 NEWDLG (UpdateDlg)
00411 NEWDLG (PasswdDlg)
00412 NEWDLG (CommitDlg)
00413 NEWDLG (DiffDlg)
00414 NEWDLG (CheckoutDlg)
00415 NEWDLG (LogDlg)
00416 NEWDLG (ImportFilterDlg)
00417 NEWDLG (ImpWarningDlg)
00418 NEWDLG (ImpEntryDlg)
00419 NEWDLG (ImportDlg)
00420 NEWDLG (CmdlineDlg)
00421 NEWDLG (TagModDlg)
00422 NEWDLG (BranchModDlg)
00423 NEWDLG (UntagModDlg)
00424 NEWDLG (TagDlg)
00425 NEWDLG (BranchDlg)
00426 NEWDLG (UntagDlg)
00427 NEWDLG (SettingsDlg)
00428 #endif
00429      void *
00430      UCreate_pixmap (UWidget * parent, const char *fileIcon)
00431 {
00432 #if qGTK
00433     GtkWidget *wid = (GtkWidget *) parent->GetWidget (kUMainWidget);
00434     return GTK_PIXMAP (create_pixmap (wid, fileIcon));
00435 #else
00436     return 0L;
00437 #endif
00438 }
Generated on Sun Feb 24 01:21:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UCvsApp.h Source File

common/UCvsApp.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 /*
00022  *
00023  */
00024
00025 #ifndef UCVSAPP_H
00026 #define UCVSAPP_H
00027
00028 #include "uwidget.h"
00029 #include "cvsgui_process.h"
00030
00031 class UCvsFolders;
00032 class UCvsFiles;
00033
00034 class UCvsApp : public UWidget
00035 {
00036     UDECLARE_DYNAMIC(UCvsApp)
00037 public:
00038     UCvsApp(int argc, char **argv);
00039     virtual ~UCvsApp();
00040
00041     static UCvsApp *gApp;
00042         // a pointer on the pseudo application
00043
00044     static CvsProcess *gCurCvs;
00045         // the running process (if any)
00046
00047     void SayWelcome(void);
00048         // make the greetings and ask for the CVSROOT if necessary
00049
00050     void SetCvsRunning(bool state);
00051     inline bool IsCvsRunning(void) { return gCvsRunning; }
00052         // when the cvs processus (or thread) is running
00053
00054     void SetCvsStopping(bool state);
00055     inline bool IsCvsStopping(void) { return gCvsStopping; }
00056         // when the cvs processus is stopping (it may take a while)
00057
00058     UCvsFolders *GetBrowserView(void);
00059         // get the left pane browser tree
00060
00061     UCvsFiles *GetFilesView(void);
00062         // get the right pane file list
00063
00064     const char *GetAppName(void) const;
00065     const char *GetAppLibFolder(void) const;
00066     const char *GetAppVersion(void) const;
00067
00068     void Execute(int argc, char * const *argv);
00069
00070     enum
00071     {
00072         kProcessTimer = EV_COMMAND_START
00073     };
00074
00075 protected:
00076     bool gCvsRunning;
00077     bool gCvsStopping;
00078
00079     ev_msg void OnMainTimer(long time);
00080
00081     UDECLARE_MESSAGE_MAP()
00082 };
00083
00084 #endif
Generated on Sun Feb 24 01:21:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UCvsCommands.h Source File

common/UCvsCommands.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 /*
00022  *
00023  */
00024
00025 #ifndef UCVSCOMMANDS_H
00026 #define UCVSCOMMANDS_H
00027
00028 #include "umain.h"
00029
00030 // the global pseudo-widgets have fixed assigned IDs in order
00031 // to be able to access them from anywhere.
00032 enum
00033 {
00034     kUCvsFrameID = 1,           /* the main frane */
00035     kUMainConsoleID,            /* the pseudo-console */
00036     kUCvsFoldersID,             /* the folder tree */
00037     kUCvsFilesID,               /* the files list */
00038     kUCvsToolbarID,             /* the toolbar */
00039     kUCvsMenubarID              /* the menubar */
00040 };
00041
00042 // commands shared over the pseudo-widgets : thse commands are dispatched
00043 // mainly by the toolbar and the menubar.
00044 enum
00045 {
00046     cmdSAVE = EV_COMMAND_START + 100,
00047     cmdSAVE_AS,
00048     cmdPRINT,
00049     cmdPRINT_PREVIEW,
00050     cmdPRINT_SETUP,
00051     cmdSEND_MAIL,
00052     cmdEXIT,
00053     cmdUNDO,
00054     cmdCUT,
00055     cmdCOPY,
00056     cmdPASTE,
00057     cmdSELECT_ALL,
00058     cmdCLEAR_ALL,
00059     cmdFIND,
00060     cmdREPEAT,
00061     cmdFONT,
00062     cmdTOOLBAR,
00063     cmdSTATUS_BAR,
00064     cmdBROWSER_BAR,
00065     cmdFILES_BAR,
00066     cmdMULTI_BAR,
00067     cmdTAGS_BAR,
00068     cmdCONSOLE_BAR,
00069     cmdWORKSPACE,
00070     cmdOPEN,
00071     cmdPREFERENCES,
00072     cmdCMDLINE,
00073     cmdLOGIN,
00074     cmdLOGOUT,
00075     cmdSTOPCVS,
00076     cmdINIT,
00077     cmdIMPORT,
00078     cmdCHECKOUT,
00079     cmdRTAGCREATE,
00080     cmdRTAGDELETE,
00081     cmdRTAGBRANCH,
00082     cmdUPDATE,
00083     cmdCOMMIT,
00084     cmdADD,
00085     cmdADDB,
00086     cmdRMV,
00087     cmdTRASH,
00088     cmdTAGNEW,
00089     cmdTAGDELETE,
00090     cmdTAGBRANCH,
00091     cmdEXPLORE,
00092     cmdQUERYUPDATE,
00093     cmdRELOAD,
00094     cmdEDITSEL,
00095     cmdEDITSELDEF,
00096     cmdDIFF,
00097     cmdLOG,
00098     cmdSTATUS,
00099     cmdGRAPH,
00100     cmdLOCKF,
00101     cmdUNLOCKF,
00102     cmdEDIT,
00103     cmdUNEDIT,
00104     cmdWATCHON,
00105     cmdWATCHOFF,
00106     cmdRELEASE,
00107     cmdWATCHERS,
00108     cmdEDITORS,
00109     cmdCASCADE,
00110     cmdTILE_HORZ,
00111     cmdARRANGE,
00112     cmdFINDER,
00113     cmdCVS,
00114     cmdCVSCLIENT,
00115     cmdABOUT,
00116     cmdIGNORE,
00117     cmdUPFOLDER,
00118     cmdSAVESETTINGS,
00119
00120     cmdSELMACRO, // contiguous BEGIN
00121     cmdSELMACROEND = cmdSELMACRO + 30,
00122
00123     cmdMACROADMIN, // contiguous BEGIN
00124     cmdMACROADMINEND = cmdMACROADMIN + 20,
00125
00126     cmdCREDITS, // contiguous BEGIN
00127     cmdCOPYRIGHTS // END
00128 };
00129
00130 #endif
Generated on Sun Feb 24 01:21:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UCvsConsole.cpp Source File

common/UCvsConsole.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 /*
00022  *
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #if qGTK
00028 #   include <gtk/gtk.h>
00029 #   include <gdk/gdkkeysyms.h>
00030 #endif
00031
00032 #include "UCvsConsole.h"
00033 #include "UCvsCommands.h"
00034 #include "uconsole.h"
00035 #include "TclGlue.h"
00036
00037 UIMPLEMENT_DYNAMIC(UCvsConsole, UWidget)
00038
00039 UBEGIN_MESSAGE_MAP(UCvsConsole, UWidget)
00040     ON_UDESTROY(UCvsConsole)
00041     ON_UCREATE(UCvsConsole)
00042 UEND_MESSAGE_MAP()
00043
00044 UCvsConsole::UCvsConsole() : UWidget(kUMainConsoleID), m_buf(0L), m_numbuf(0)
00045 {
00046     out.col = UCOLOR(0, 0, 0);
00047     out.bold = false;
00048     out.italic = false;
00049     out.underline = false;
00050 }
00051
00052 UCvsConsole::~UCvsConsole()
00053 {
00054     m_numbuf = 0;
00055     if(m_buf != 0L)
00056     {
00057         free(m_buf);
00058         m_buf = 0L;
00059     }
00060 }
00061
00062 void UCvsConsole::FeedThisLine(const char *buf, size_t numbuf, bool isStderr)
00063 {
00064     void *wid = GetWidget(kUMainWidget);
00065     if(wid == 0L)
00066     {
00067         UAppConsole("The console is not here !\n");
00068         return;
00069     }
00070
00071 #if qGTK
00072     if(!GTK_IS_TEXT(wid))
00073     {
00074         g_warning("The pseudo-console is not here !\n");
00075         return;
00076     }
00077
00078     GtkText *w = GTK_TEXT(wid);
00079     gtk_text_set_point(w, gtk_text_get_length(w));
00080 #endif
00081
00082     UCOLOR color(0, 0, 0);
00083     bool colorChanged = false;
00084     UStr s;
00085     s.set(buf, numbuf);
00086
00087     if(s.length() >= 5 && s[1] == ' ' &&
00088         (s[0] == 'M' || s[0] == 'C' || s[0] == 'U' ||
00089         s[0] == 'P' || s[0] == 'N' || s[0] == 'A' ||
00090         s[0] == 'R' || s[0] == 'I' || s[0] == '?' ||
00091         s[0] == '<' || s[0] == '>'))
00092     {
00093         colorChanged = true;
00094         switch(s[0])
00095         {
00096         default:
00097         case '?' :
00098         case 'I' :
00099             color = UCOLOR(0x80, 0x80, 0x00);
00100             break;
00101         case 'U' :
00102         case 'N' :
00103             color = UCOLOR(0x00, 0xA0, 0x00);
00104             break;
00105         case 'M' :
00106         case 'A' :
00107         case 'R' :
00108             color = UCOLOR(0xFF, 0x00, 0xFF);
00109             break;
00110         case 'C' :
00111         case '<' :
00112             color = UCOLOR(0xFF, 0x00, 0x00);
00113             break;
00114         case '>' :
00115         case 'P' :
00116             color = UCOLOR(0x00, 0x00, 0xFF);
00117             break;
00118         }
00119     }
00120     else if(isStderr)
00121     {
00122         colorChanged = true;
00123         color = UCOLOR(0xFF, 0x80, 0x00);
00124     }
00125
00126 #if qGTK
00127     GdkColormap *cmap;
00128     GdkColor col;
00129     cmap = gdk_colormap_get_system();
00130     col.red = ((unsigned int)color.r) << 8;
00131     col.green = ((unsigned int)color.g) << 8;
00132     col.blue = ((unsigned int)color.b) << 8;
00133     if(color.r != 0 || color.g != 0 || color.b != 0)
00134     {
00135         if (!gdk_color_alloc(cmap, &col)) {
00136             g_error("Couldn't allocate color\n");
00137         }
00138         gtk_text_insert(w, NULL, &col, NULL, s, -1);
00139     }
00140     else
00141         gtk_text_insert(w, NULL, &GTK_WIDGET(w)->style->black, NULL, s, -1);
00142 #endif
00143 }
00144
00145 void UCvsConsole::OutConsole(const char *txt, size_t len, bool isStderr)
00146 {
00147     if(len == 0)
00148         return;
00149
00150     if(m_buf == 0L)
00151     {
00152         m_buf = (char *)malloc((MAX_CHAR_BY_LINE + 3) * sizeof(char));
00153         if(m_buf == 0L)
00154             return;
00155     }
00156
00157     size_t i = 0;
00158     char c = 0;
00159 once_again:
00160     for(; i < len && m_numbuf < MAX_CHAR_BY_LINE; m_numbuf++)
00161     {
00162         c = txt[i++];
00163         if(c == 0x0a)
00164             break;
00165         m_buf[m_numbuf] = c;
00166     }
00167
00168     if(c == 0x0a || m_numbuf == MAX_CHAR_BY_LINE)
00169     {
00170         m_buf[m_numbuf++] = 0x0a;
00171         m_buf[m_numbuf++] = 0x00;
00172
00173         FeedThisLine(m_buf, m_numbuf, isStderr);
00174         m_numbuf = 0;
00175     }
00176
00177     if(i != len)
00178         goto once_again;
00179 }
00180
00181 void UCvsConsole::OnDestroy(void)
00182 {
00183     delete this;
00184 }
00185
00186 #if qGTK
00187 extern "C"
00188 {
00189     static int gtkkeypress(GtkWidget *widget, GdkEventKey * event, gpointer user_data)
00190     {
00191         UCvsConsole *wid = (UCvsConsole *)user_data;
00192
00193         if (event->keyval != GDK_Return && event->keyval != GDK_KP_Enter)
00194             return FALSE;
00195
00196         if(!CTcl_Interp::IsAvail())
00197             return FALSE;
00198
00199         if(!GTK_IS_TEXT(widget))
00200         {
00201             g_warning("The pseudo-console is not here !\n");
00202             return FALSE;
00203         }
00204
00205         GtkText *text = GTK_TEXT(widget);
00206         const GtkEditable & w = text->editable;
00207         guint len = gtk_text_get_length(text);
00208         if(len == 0)
00209             return FALSE;
00210
00211         guint nStartChar, nEndChar;
00212
00213         if (!w.has_selection)
00214         {
00215             // get the end and the beginning of the line
00216             nStartChar = nEndChar = w.current_pos;
00217
00218             if(nStartChar > 0 && GTK_TEXT_INDEX(text, nStartChar) == '\n')
00219                 nStartChar--;
00220             while(nStartChar > 0 && GTK_TEXT_INDEX(text, nStartChar) != '\n')
00221                 nStartChar--;
00222             if(GTK_TEXT_INDEX(text, nStartChar) == '\n')
00223                 nStartChar++;
00224             while(nEndChar < len && GTK_TEXT_INDEX(text, nEndChar) != '\n')
00225                 nEndChar++;
00226         }
00227         else
00228         {
00229             nStartChar = w.selection_start_pos;
00230             nEndChar = w.selection_end_pos;
00231         }
00232
00233         guint long length = nEndChar - nStartChar;
00234         if(length > 0 && nStartChar < len)
00235         {
00236             char *buf = (char *)malloc((length + 1) * sizeof(char));
00237             if(buf != 0L)
00238             {
00239                 char *tmp = buf;
00240                 while(nStartChar < nEndChar)
00241                 {
00242                     *tmp++ = GTK_TEXT_INDEX(text, nStartChar);
00243                     nStartChar++;
00244                 }
00245                 *tmp++ = '\0';
00246
00247                 wid->OutConsole("\n", 1);
00248                 CTcl_Interp interp;
00249                 interp.DoScript(buf);
00250                 free(buf);
00251             }
00252         }
00253
00254         return FALSE;
00255     }
00256 }
00257 #endif
00258
00259 void UCvsConsole::OnCreate(void)
00260 {
00261     void *wid = GetWidget(kUMainWidget);
00262     if(wid == 0L)
00263     {
00264         UAppConsole("The console is not here !\n");
00265         return;
00266     }
00267
00268 #if qGTK
00269     gtk_signal_connect (GTK_OBJECT (wid), "key_press_event",
00270                         GTK_SIGNAL_FUNC(gtkkeypress), (gpointer)this);
00271 #endif
00272 }
00273
00274 void UCvsConsole::OutColor(const char *txt, long len)
00275 {
00276     void *wid = GetWidget(kUMainWidget);
00277     if(wid == 0L)
00278     {
00279         UAppConsole("The console is not here !\n");
00280         return;
00281     }
00282
00283 #if qGTK
00284     if(!GTK_IS_TEXT(wid))
00285     {
00286         g_warning("The pseudo-console is not here !\n");
00287         return;
00288     }
00289
00290     GtkText *w = GTK_TEXT(wid);
00291     gtk_text_set_point(w, gtk_text_get_length(w));
00292
00293     GdkColormap *cmap;
00294     GdkColor col;
00295     cmap = gdk_colormap_get_system();
00296     col.red = ((unsigned int)out.col.r) << 8;
00297     col.green = ((unsigned int)out.col.g) << 8;
00298     col.blue = ((unsigned int)out.col.b) << 8;
00299     if(out.col.r != 0 || out.col.g != 0 || out.col.b != 0)
00300     {
00301         if (!gdk_color_alloc(cmap, &col)) {
00302             g_error("Couldn't allocate color\n");
00303         }
00304         gtk_text_insert(w, NULL, &col, NULL, txt, len);
00305     }
00306     else
00307         gtk_text_insert(w, NULL, &GTK_WIDGET(w)->style->black, NULL, txt, len);
00308 #endif
00309 }
00310
00311 void UCvsConsole::OutColor(kConsoleColor color)
00312 {
00313     switch(color)
00314     {
00315     case kBrown :
00316         out.col = UCOLOR(0x80, 0x80, 0x00);
00317         break;
00318     case kGreen :
00319         out.col = UCOLOR(0x00, 0xA0, 0x00);
00320         break;
00321     case kMagenta :
00322         out.col = UCOLOR(0xFF, 0x00, 0xFF);
00323         break;
00324     case kRed :
00325         out.col = UCOLOR(0xFF, 0x00, 0x00);
00326         break;
00327     case kBlue :
00328         out.col = UCOLOR(0x00, 0x00, 0xFF);
00329         break;
00330     case kBold :
00331         out.bold = true;
00332         break;
00333     case kItalic :
00334         out.italic = true;
00335         break;
00336     case kUnderline :
00337         out.underline = true;
00338         break;
00339     case kNormal:
00340         out.col = UCOLOR(0, 0, 0);
00341         out.bold = false;
00342         out.italic = false;
00343         out.underline = false;
00344         break;
00345     case kNL :
00346         break;
00347     }
00348 }
Generated on Sun Feb 24 01:21:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UCvsConsole.h Source File

common/UCvsConsole.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 /*
00022  *
00023  */
00024
00025 #ifndef UCVSCONSOLE_H
00026 #define UCVSCONSOLE_H
00027
00028 #include "uwidget.h"
00029 #include "AppConsole.h"
00030
00031 struct UCOLOR
00032 {
00033     UCOLOR() {}
00034     UCOLOR(char _r, char _g, char _b) : r(_r), g(_g), b(_b) {}
00035
00036     unsigned char r;
00037     unsigned char g;
00038     unsigned char b;
00039 };
00040
00041 class UCvsConsole : public UWidget
00042 {
00043     UDECLARE_DYNAMIC(UCvsConsole)
00044 public:
00045     UCvsConsole();
00046     virtual ~UCvsConsole();
00047
00048     void OutConsole(const char *txt, size_t len, bool isStderr = false);
00049
00050     void OutColor(const char *txt, long len);
00051     void OutColor(kConsoleColor color);
00052         // colorized output
00053 protected:
00054     void FeedThisLine(const char *buf, size_t numbuf, bool isStderr);
00055
00056     enum
00057     {
00058         MAX_CHAR_BY_LINE = 1024
00059     };
00060
00061     char *m_buf;
00062     size_t m_numbuf;
00063
00064     struct
00065     {
00066         UCOLOR col;
00067         bool bold, italic, underline;
00068     } out;
00069
00070     ev_msg void OnDestroy();
00071     ev_msg void OnCreate();
00072
00073     UDECLARE_MESSAGE_MAP()
00074 };
00075
00076 #endif
Generated on Sun Feb 24 01:21:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UCvsDialogs.h Source File

common/UCvsDialogs.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 /*
00022  *
00023  */
00024
00025 #ifndef UCVSDIALOGS_H
00026 #define UCVSDIALOGS_H
00027
00028 #include "uwidget.h"
00029
00030 // the pixmaps creations
00031 void *UCreate_pixmap(UWidget *parent, const char *fileIcon);
00032
00033 // the dialogs creationj
00034 extern void *UCreate_MainWindow (void);
00035 extern void *UCreate_GraphWindow (void);
00036 extern void *UCreate_AskYesNo (void);
00037 extern void *UCreate_gcvs_Settings (void);
00038 extern void *UCreate_UpdateDlg (void);
00039 extern void *UCreate_PasswdDlg (void);
00040 extern void *UCreate_CommitDlg (void);
00041 extern void *UCreate_DiffDlg (void);
00042 extern void *UCreate_CheckoutDlg (void);
00043 extern void *UCreate_LogDlg (void);
00044 extern void *UCreate_ImportFilterDlg (void);
00045 extern void *UCreate_ImpWarningDlg (void);
00046 extern void *UCreate_ImpEntryDlg (void);
00047 extern void *UCreate_ImportDlg (void);
00048 extern void *UCreate_CmdlineDlg (void);
00049 extern void *UCreate_TagModDlg (void);
00050 extern void *UCreate_UntagModDlg (void);
00051 extern void *UCreate_BranchModDlg (void);
00052 extern void *UCreate_TagDlg (void);
00053 extern void *UCreate_UntagDlg (void);
00054 extern void *UCreate_BranchDlg (void);
00055 extern void *UCreate_SettingsDlg (void);
00056
00057 #endif
Generated on Sun Feb 24 01:21:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UCvsFiles.cpp Source File

common/UCvsFiles.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 /*
00022  *
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #if qGTK
00028 #   include <gtk/gtk.h>
00029 #endif
00030
00031 #ifdef HAVE_UNISTD_H
00032 #include <unistd.h>
00033 #endif
00034
00035 #ifdef HAVE_STRINGS_H
00036 #include <strings.h>
00037 #endif
00038
00039 #include "UCvsFiles.h"
00040 #include "UCvsDialogs.h"
00041 #include "UCvsFolders.h"
00042 #include "UCvsCommands.h"
00043 #include "UCvsFrame.h"
00044 #include "UCvsApp.h"
00045 #include "CvsPrefs.h"
00046 #include "FileTraversal.h"
00047 #include "MultiFiles.h"
00048 #include "CvsCommands.h"
00049 #include "CvsArgs.h"
00050 #include "TclGlue.h"
00051 #include "AppConsole.h"
00052 #include "MoveToTrash.h"
00053 #include "MacrosSetup.h"
00054
00055 #ifndef NAMESPACE
00056 #       if defined(_MSC_VER) || defined(__MWERKS__) || (__GNUC__ > 2)
00057 #               define NAMESPACE(w) w::
00058 #       else
00059 #               define NAMESPACE(w) ::
00060 #       endif
00061 #endif
00062
00063 UIMPLEMENT_DYNAMIC(UCvsFiles, UWidget)
00064
00065 UBEGIN_MESSAGE_MAP(UCvsFiles, UWidget)
00066     ON_UUPDATECMD(cmdUPDATE, UCvsFiles::OnCmdUIUpdate)
00067     ON_UUPDATECMD(cmdCOMMIT, UCvsFiles::OnCmdUIUpdate)
00068     ON_UUPDATECMD(cmdDIFF, UCvsFiles::OnCmdUIUpdate)
00069     ON_UUPDATECMD(cmdEDIT, UCvsFiles::OnCmdUIUpdate)
00070     ON_UUPDATECMD(cmdEDITORS, UCvsFiles::OnCmdUIUpdate)
00071     ON_UUPDATECMD(cmdLOCKF, UCvsFiles::OnCmdUIUpdate)
00072     ON_UUPDATECMD(cmdLOG, UCvsFiles::OnCmdUIUpdate)
00073     ON_UUPDATECMD(cmdTAGNEW, UCvsFiles::OnCmdUIUpdate)
00074     ON_UUPDATECMD(cmdTAGDELETE, UCvsFiles::OnCmdUIUpdate)
00075     ON_UUPDATECMD(cmdTAGBRANCH, UCvsFiles::OnCmdUIUpdate)
00076     ON_UUPDATECMD(cmdSTATUS, UCvsFiles::OnCmdUIUpdate)
00077     ON_UUPDATECMD(cmdUNEDIT, UCvsFiles::OnCmdUIUpdate)
00078     ON_UUPDATECMD(cmdQUERYUPDATE, UCvsFiles::OnCmdUIUpdate)
00079     ON_UUPDATECMD(cmdUNLOCKF, UCvsFiles::OnCmdUIUpdate)
00080     ON_UUPDATECMD(cmdWATCHERS, UCvsFiles::OnCmdUIUpdate)
00081     ON_UUPDATECMD(cmdWATCHON, UCvsFiles::OnCmdUIUpdate)
00082     ON_UUPDATECMD(cmdWATCHOFF, UCvsFiles::OnCmdUIUpdate)
00083     ON_UUPDATECMD(cmdADD, UCvsFiles::OnCmdUIAdd)
00084     ON_UUPDATECMD(cmdADDB, UCvsFiles::OnCmdUIAddB)
00085     ON_UUPDATECMD(cmdRELEASE, UCvsFiles::OnCmdUIRelease)
00086     ON_UUPDATECMD(cmdRMV, UCvsFiles::OnCmdUIRmv)
00087     ON_UUPDATECMD(cmdGRAPH, UCvsFiles::OnCmdUIGraph)
00088     ON_UUPDATECMD(cmdEDITSELDEF, UCvsFiles::OnCmdUIEditseldef)
00089     ON_UUPDATECMD(cmdRELOAD, UCvsFiles::OnCmdUIReload)
00090     ON_UUPDATECMD(cmdUPFOLDER, UCvsFiles::OnCmdUIUpone)
00091     ON_UUPDATECMD(cmdTRASH, UCvsFiles::OnCmdUITrash)
00092     ON_UUPDATECMD(cmdEXPLORE, UCvsFiles::OnCmdUIExplore)
00093     ON_UUPDATECMD(cmdIGNORE, UCvsFiles::OnCmdUIIgnore)
00094     ON_UUPDATECMD(cmdEDITSEL, UCvsFiles::OnCmdUITrash)
00095     ON_UUPDATECMD_RANGE(cmdSELMACRO, cmdSELMACROEND, UCvsFiles::OnCmdUIMacroSel)
00096     ON_UCOMMAND(cmdUPDATE, UCvsFiles::OnCmdUpdate)
00097     ON_UCOMMAND(cmdADD, UCvsFiles::OnCmdAdd)
00098     ON_UCOMMAND(cmdADDB, UCvsFiles::OnCmdAddb)
00099     ON_UCOMMAND(cmdCOMMIT, UCvsFiles::OnCmdCommit)
00100     ON_UCOMMAND(cmdRMV, UCvsFiles::OnCmdRmv)
00101     ON_UCOMMAND(cmdQUERYUPDATE, UCvsFiles::OnCmdQueryUpdate)
00102     ON_UCOMMAND(cmdRELOAD, UCvsFiles::OnCmdReload)
00103     ON_UCOMMAND(cmdUPFOLDER, UCvsFiles::OnCmdUpone)
00104     ON_UCOMMAND(cmdTRASH, UCvsFiles::OnCmdTrash)
00105     ON_UCOMMAND(cmdDIFF, UCvsFiles::OnCmdDiff)
00106     ON_UCOMMAND(cmdLOG, UCvsFiles::OnCmdLog)
00107     ON_UCOMMAND(cmdGRAPH, UCvsFiles::OnCmdGraph)
00108     ON_UCOMMAND(cmdSTATUS, UCvsFiles::OnCmdStatus)
00109     ON_UCOMMAND(cmdLOCKF, UCvsFiles::OnCmdLock)
00110     ON_UCOMMAND(cmdUNLOCKF, UCvsFiles::OnCmdUnlock)
00111     ON_UCOMMAND(cmdWATCHON, UCvsFiles::OnCmdWatchOn)
00112     ON_UCOMMAND(cmdWATCHOFF, UCvsFiles::OnCmdWatchOff)
00113     ON_UCOMMAND(cmdEDIT, UCvsFiles::OnCmdEdit)
00114     ON_UCOMMAND(cmdUNEDIT, UCvsFiles::OnCmdUnedit)
00115     ON_UCOMMAND(cmdWATCHERS, UCvsFiles::OnCmdWatchers)
00116     ON_UCOMMAND(cmdEDITORS, UCvsFiles::OnCmdEditors)
00117     ON_UCOMMAND(cmdRELEASE, UCvsFiles::OnCmdRelease)
00118     ON_UCOMMAND(cmdTAGNEW, UCvsFiles::OnCmdTagNew)
00119     ON_UCOMMAND(cmdTAGDELETE, UCvsFiles::OnCmdTagDelete)
00120     ON_UCOMMAND(cmdTAGBRANCH, UCvsFiles::OnCmdTagBranch)
00121     ON_UCOMMAND(cmdEXPLORE, UCvsFiles::OnCmdExplore)
00122     ON_UCOMMAND(cmdIGNORE, UCvsFiles::OnCmdIgnore)
00123     ON_UCOMMAND(cmdEDITSEL, UCvsFiles::OnCmdEditsel)
00124     ON_UCOMMAND(cmdEDITSELDEF, UCvsFiles::OnCmdEditseldef)
00125     ON_UCOMMAND_RANGE(cmdSELMACRO, cmdSELMACROEND, UCvsFiles::OnMacroSel)
00126     ON_LIST_DBLCLICK(kUMainWidget, UCvsFiles::OnDblClick)
00127     ON_LIST_SELCOLUMN(kUMainWidget, UCvsFiles::OnSelColumn)
00128     ON_UDESTROY(UCvsFiles)
00129     ON_UCREATE(UCvsFiles)
00130 UEND_MESSAGE_MAP()
00131
00132 #if 0
00133     ON_UUPDATECMD(cmdSMALLICONS, OnCmdUISmallIcons)
00134     ON_UUPDATECMD(cmdFULLLIST, OnCmdUIList)
00135     ON_UUPDATECMD(cmdROWDETAILS, OnCmdUIFullRowDetails)
00136     ON_COMMAND(ID_VIEW_SMALLICONS, OnViewSmallIcons)
00137     ON_COMMAND(ID_VIEW_FULLLIST, OnViewList)
00138     ON_COMMAND(ID_VIEW_ROWDETAILS, OnViewFullRowDetails)
00139     ON_WM_LBUTTONDOWN()
00140     ON_WM_RBUTTONDOWN()
00141     ON_NOTIFY_REFLECT(LVN_COLUMNCLICK, OnColumnclick)
00142     ON_NOTIFY_REFLECT(LVN_KEYDOWN, OnKeydown)
00143     ON_WM_TIMER()
00144
00145     //}}AFX_MSG_MAP
00146     ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
00147     ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
00148 #endif
00149
00150 static void *sFileIconTextIcon;
00151 static void *sFileIconBinaryIcon;
00152 static void *sFileIconUnknownIcon;
00153 static void *sFileIconAddedIcon;
00154 static void *sFileIconConflictIcon;
00155 static void *sFileIconMissIcon;
00156 static void *sFolderIconIcon;
00157 static void *sFolderIconUnknownIcon;
00158 static void *sFolderIconMissIcon;
00159 static void *sFileIconTextModIcon;
00160 static void *sFileIconBinaryModIcon;
00161 static void *sFileIconIgnoredIcon;
00162 static void *sFolderIconIgnoredIcon;
00163 static void *sFileIconRemovedIcon;
00164
00165 /*
00166 kFileIconText,cvsfile
00167 kFileIconBinary,binfile
00168 kFileIconUnknown,unkfile
00169 kFileIconAdded,addfile
00170 kFileIconConflict,conflict
00171 kFileIconMiss,missfile
00172 kFolderIcon,folder
00173 kFolderIconUnknown,foldunk
00174 kFolderIconMiss,foldmiss
00175 kFileIconTextMod,modfile
00176 kFileIconBinaryMod,modbin
00177 kFileIconIgnored,ignfile
00178 kFolderIconIgnored,foldign
00179 kFileIconRemoved,delfile
00180 */
00181
00182 enum
00183 {
00184     kFileIconText = 0,
00185     kFileIconBinary,
00186     kFileIconUnknown,
00187     kFileIconAdded,
00188     kFileIconConflict,
00189     kFileIconMiss,
00190     kFolderIcon,
00191     kFolderIconUnknown,
00192     kFolderIconMiss,
00193     kFileIconTextMod,
00194     kFileIconBinaryMod,
00195     kFileIconIgnored,
00196     kFolderIconIgnored,
00197     kFileIconRemoved
00198 };
00199
00200 #define NUM_COLUMNS 7
00201
00202 static char *_gszColumnLabel[NUM_COLUMNS] =
00203 {
00204     "Name", "Rev.", "Option", "Status", "Tag", "Date", "Conflict"
00205 };
00206
00207 static int _gnColumnWidth[NUM_COLUMNS] =
00208 {
00209     150, 50, 50, 100, 150, 150, 150
00210 };
00211
00212 CPersistentBool gFileViewIgnore("P_FileViewIgnore", true);
00213 CPersistentInt gFileViewSort("P_FileViewSort", EntnodeData::kName);
00214 CPersistentBool gFileViewSortAsc("P_FileViewSortAsc", true);
00215
00216 class TViewFill : public TraversalReport
00217 {
00218 public:
00219     UCvsFiles *m_listCtrl;
00220     CSortList<ENTNODE> & m_entries;
00221     NAMESPACE(std) vector<CStr> m_ignlist;
00222
00223     TViewFill(UCvsFiles *listCtrl, CSortList<ENTNODE> & entries) :
00224         m_listCtrl(listCtrl), m_entries(entries) {}
00225
00226     virtual ~TViewFill() {}
00227
00228     virtual kTraversal EnterDirectory(const char *fullpath, const char *dirname, const FSSpec * macspec)
00229     {
00230         Entries_Open (m_entries, fullpath);
00231         BuildIgnoredList(m_ignlist, fullpath);
00232
00233         return kContinueTraversal;
00234     }
00235
00236     virtual kTraversal ExitDirectory(const char *fullpath)
00237     {
00238         m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00239         return kContinueTraversal;
00240     }
00241
00242     virtual kTraversal OnError(const char *err, int errcode)
00243     {
00244         return kTraversalError;
00245     }
00246
00247     virtual kTraversal OnIdle(const char *fullpath)
00248     {
00249         return kContinueTraversal;
00250     }
00251
00252     virtual kTraversal OnDirectory(const char *fullpath,
00253         const char *fullname,
00254         const char *name,
00255         const struct stat & dir, const FSSpec * macspec)
00256     {
00257 #if qUnix
00258         if(strcmp(name, "CVS") == 0)
00259 #else
00260         if(stricmp(name, "CVS") == 0)
00261 #endif
00262             return kSkipFile;
00263
00264         EntnodeData *data = Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00265         if(!(bool)gFileViewIgnore && data->IsIgnored())
00266             return kSkipFile;
00267
00268         // get the tag
00269         CStr subCVS;
00270         CStr tagName;
00271         subCVS = fullname;
00272         if(!subCVS.endsWith(kPathDelimiter))
00273             subCVS << kPathDelimiter;
00274         subCVS << "CVS";
00275         if(chdir(subCVS) == 0)
00276             Tag_Open(tagName, subCVS);
00277         if(chdir(fullpath) != 0)
00278             return kTraversalError;
00279
00280         int rownum;
00281         UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_NEWROW, kUMainWidget, &rownum);
00282         UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_ROWSETDATA, UMAKEINT(kUMainWidget, rownum), data);
00283         ULIST_INSERT entry;
00284         entry.row = rownum;
00285
00286         entry.col = 0;
00287         entry.title = name;
00288         entry.icon = UCvsFiles::GetImageForEntry(data);
00289         UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00290
00291         entry.icon = 0L;
00292
00293         // set item text for additional columns
00294         for(int j = 1; j < NUM_COLUMNS; j++)
00295         {
00296             const char *info = (*data)[j];
00297             if(info != 0L)
00298             {
00299                 entry.col = j;
00300                 entry.title = info;
00301                 UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00302             }
00303         }
00304         entry.col = EntnodeData::kStatus;
00305         entry.title = data->GetDesc();
00306         UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00307         entry.col = EntnodeFile::kTag;
00308         entry.title = tagName.empty() ? "" : (const char *)tagName;
00309         UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00310
00311         return kSkipFile;
00312     }
00313
00314     virtual kTraversal OnAlias(const char *fullpath,
00315         const char *fullname,
00316         const char *name,
00317         const struct stat & dir, const FSSpec * macspec)
00318     {
00319         return OnFile(fullpath, fullname, name, dir, macspec);
00320     }
00321
00322     virtual kTraversal OnFile(const char *fullpath,
00323         const char *fullname,
00324         const char *name,
00325         const struct stat & dir, const FSSpec * macspec)
00326     {
00327         EntnodeData *data = Entries_SetVisited(fullpath, m_entries, name, dir, false, &m_ignlist);
00328         if(!(bool)gFileViewIgnore && data->IsIgnored())
00329             return kContinueTraversal;
00330
00331         int rownum;
00332         UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_NEWROW, kUMainWidget, &rownum);
00333         UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_ROWSETDATA, UMAKEINT(kUMainWidget, rownum), data);
00334         ULIST_INSERT entry;
00335         entry.row = rownum;
00336
00337         entry.col = 0;
00338         entry.title = name;
00339         entry.icon = UCvsFiles::GetImageForEntry(data);
00340         UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00341
00342         entry.icon = 0L;
00343
00344 #if 0 /* TODO */
00345         lvi.state = data->IsLocked() ?
00346             INDEXTOSTATEIMAGEMASK(2) : INDEXTOSTATEIMAGEMASK(1);
00347 #endif
00348
00349         // set item text for additional columns
00350         for(int j = 1; j < NUM_COLUMNS; j++)
00351         {
00352             const char *info = (*data)[j];
00353             if(info != 0L)
00354             {
00355                 entry.col = j;
00356                 entry.title = info;
00357                 UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00358             }
00359         }
00360         entry.col = EntnodeData::kStatus;
00361         entry.title = data->GetDesc();
00362         UEventSendMessage(m_listCtrl->GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00363
00364         return kContinueTraversal;
00365     }
00366 };
00367
00368 UCvsFiles::UCvsFiles() : UWidget(kUCvsFilesID), m_entries(200, ENTNODE::Compare), m_entriesMod(0), m_entriesLogMod(0)
00369
00370 {
00371     m_sort = (int)gFileViewSort;
00372     m_ascendant = (bool)gFileViewSortAsc;
00373 }
00374
00375 UCvsFiles::~UCvsFiles()
00376 {
00377     gFileViewSort = m_sort;
00378     gFileViewSortAsc = m_ascendant;
00379 }
00380
00381 void UCvsFiles::OnDestroy(void)
00382 {
00383     delete this;
00384 }
00385
00386 void UCvsFiles::OnCreate(void)
00387 {
00388     if(sFileIconTextIcon == 0L)
00389     {
00390         sFileIconTextIcon = UCreate_pixmap(this, "cvsfile.xpm");
00391         sFileIconBinaryIcon = UCreate_pixmap(this, "binfile.xpm");
00392         sFileIconUnknownIcon = UCreate_pixmap(this, "unkfile.xpm");
00393         sFileIconAddedIcon = UCreate_pixmap(this, "addfile.xpm");
00394         sFileIconConflictIcon = UCreate_pixmap(this, "conflict.xpm");
00395         sFileIconMissIcon = UCreate_pixmap(this, "missfile.xpm");
00396         sFolderIconIcon = UCreate_pixmap(this, "folder.xpm");
00397         sFolderIconUnknownIcon = UCreate_pixmap(this, "foldunk.xpm");
00398         sFolderIconMissIcon = UCreate_pixmap(this, "foldmiss.xpm");
00399         sFileIconTextModIcon = UCreate_pixmap(this, "modfile.xpm");
00400         sFileIconBinaryModIcon = UCreate_pixmap(this, "modbin.xpm");
00401         sFileIconIgnoredIcon = UCreate_pixmap(this, "ignfile.xpm");
00402         sFolderIconIgnoredIcon = UCreate_pixmap(this, "foldign.xpm");
00403         sFileIconRemovedIcon = UCreate_pixmap(this, "delfile.xpm");
00404     }
00405
00406     UEventSendMessage(GetWidID(), EV_LIST_SETFEEDBACK, UMAKEINT(kUMainWidget, 0), 0L);
00407     UEventSendMessage(GetWidID(), EV_LIST_ADDCOLUMNS, UMAKEINT(kUMainWidget, NUM_COLUMNS), 0L);
00408     for(int i = 0; i < NUM_COLUMNS; i++)
00409     {
00410         UEventSendMessage(GetWidID(), EV_LIST_SETCOLTITLE, UMAKEINT(kUMainWidget, i), _gszColumnLabel[i]);
00411         UEventSendMessage(GetWidID(), EV_LIST_SETCOLWIDTH, UMAKEINT(kUMainWidget, i), (void *)_gnColumnWidth[i]);
00412     }
00413     UEventSendMessage(GetWidID(), EV_LIST_SETFEEDBACK, UMAKEINT(kUMainWidget, 1), 0L);
00414 }
00415
00416 void UCvsFiles::ResetView(const char *path, bool notifyBrowser)
00417 {
00418     m_path = path;
00419     ResetView(true);
00420
00421     UStr title(UCvsApp::gApp->GetAppName());
00422     title << ": ";
00423     title << m_path;
00424     UEventSendMessage(kUCvsFrameID, EV_SETTEXT, kUMainWidget, (void *)(const char *)title);
00425
00426     if(notifyBrowser)
00427     {
00428         // notify the tree
00429         UCvsApp::gApp->GetBrowserView()->StepToLocation(path);
00430     }
00431 }
00432
00433 void UCvsFiles::GetEntriesModTime(time_t & newEntriesMod, time_t & newEntriesLogMod)
00434 {
00435     newEntriesMod = 0;
00436     newEntriesLogMod = 0;
00437     if(chdir(m_path) != 0)
00438         return;
00439     if(chdir("CVS") != 0)
00440         return;
00441
00442     struct stat sb;
00443     if (stat("Entries", &sb) != -1)
00444         newEntriesMod = sb.st_mtime;
00445     if (stat("Entries.log", &sb) != -1)
00446         newEntriesLogMod = sb.st_mtime;
00447     chdir(m_path);
00448 }
00449
00450 int UCvsFiles::Search(const char *title)
00451 {
00452     int row = -1;
00453     while((row = UEventSendMessage(GetWidID(), EV_LIST_GETNEXT,
00454                                      UMAKEINT(kUMainWidget, row), 0L)) != -1)
00455     {
00456         ULIST_INFO info;
00457         info.col = 0;
00458         info.row = row;
00459         UEventSendMessage(GetWidID(), EV_LIST_GETINFO, kUMainWidget, &info);
00460         if(info.title == 0L)
00461             continue;
00462
00463 #if qUnix
00464         if(strcmp(title, info.title) == 0)
00465 #else
00466         if(stricmp(title, info.title) == 0)
00467 #endif
00468             return row;
00469     }
00470
00471     return -1;
00472 }
00473
00474 void UCvsFiles::ResetView(bool forceReload, bool notifyBrowser)
00475 {
00476     UWaitCursor wait;
00477
00478     static bool sSemaphore = false;
00479     USemaphore policeman(sSemaphore);
00480     if(policeman.IsEnteredTwice())
00481         return;
00482
00483     // - check if we really need to reload (forceReload == false)
00484     // - wait a bit for the watcher in order to let him tell us
00485     // if something was modified.
00486     time_t newEntriesMod;
00487     time_t newEntriesLogMod;
00488     GetEntriesModTime(newEntriesMod, newEntriesLogMod);
00489     if(!forceReload)
00490     {
00491         if(m_entriesMod == newEntriesMod && m_entriesLogMod == newEntriesLogMod)
00492             return;
00493     }
00494
00495     // reset all the watchers
00496     m_entriesMod = newEntriesMod;
00497     m_entriesLogMod = newEntriesLogMod;
00498
00499     // get the selection to later try to restore it
00500     CvsArgs selection(false);
00501     int nItem = -1;
00502
00503     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL,
00504                                      UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00505     {
00506         EntnodeData *data;
00507         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00508         selection.add((*data)[EntnodeData::kName]);
00509     }
00510
00511     UEventSendMessage(GetWidID(), EV_LIST_RESETALL, kUMainWidget, 0L);
00512
00513     // refetch all items
00514     TViewFill traverse(this, m_entries);
00515     /*kTraversal res = */FileTraverse(m_path, traverse);
00516
00517     // add the missing files
00518     Entries_SetMissing(m_entries);
00519
00520     int numEntries = m_entries.NumOfElements();
00521     for(int i = 0; i < numEntries; i++)
00522     {
00523         const ENTNODE & theNode = m_entries.Get(i);
00524         EntnodeData *data = ((ENTNODE *)&theNode)->Data();
00525         if(!data->IsMissing())
00526             continue;
00527
00528         int rownum;
00529         UEventSendMessage(GetWidID(), EV_LIST_NEWROW, kUMainWidget, &rownum);
00530         UEventSendMessage(GetWidID(), EV_LIST_ROWSETDATA, UMAKEINT(kUMainWidget, rownum), data);
00531         ULIST_INSERT entry;
00532         entry.row = rownum;
00533
00534         entry.col = 0;
00535         entry.title = (*data)[EntnodeData::kName];
00536         entry.icon = UCvsFiles::GetImageForEntry(data);
00537         UEventSendMessage(GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00538
00539         entry.icon = 0L;
00540
00541         // set item text for additional columns
00542         for(int j = 1; j < NUM_COLUMNS; j++)
00543         {
00544             const char *info = (*data)[j];
00545             if(info != 0L)
00546             {
00547                 entry.col = j;
00548                 entry.title = info;
00549                 UEventSendMessage(GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00550             }
00551         }
00552         entry.col = EntnodeData::kStatus;
00553         entry.title = data->GetDesc();
00554         UEventSendMessage(GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00555     }
00556
00557     Resort();
00558
00559     // now restore the selection
00560     int argc = selection.Argc(), c;
00561     char * const *argv = selection.Argv();
00562     for(c = 0; c < argc; c++)
00563     {
00564         int row = Search(argv[c]);
00565         if(row != -1)
00566             UEventSendMessage(GetWidID(), EV_LIST_ADDSEL, UMAKEINT(kUMainWidget, row), 0L);
00567     }
00568
00569     if(notifyBrowser)
00570     {
00571         // notify the tree
00572         UCvsApp::gApp->GetBrowserView()->ResetView(forceReload);
00573     }
00574 }
00575
00576 void *UCvsFiles::GetImageForEntry(EntnodeData *data)
00577 {
00578     int result;
00579     void *resIcon = 0L;
00580
00581     if(data->GetType() == ENT_FILE)
00582     {
00583         const char *info = 0L;
00584         if(data->IsIgnored())
00585         {
00586             result = kFileIconIgnored;
00587         }
00588         else if(data->IsUnknown())
00589         {
00590             result = kFileIconUnknown;
00591         }
00592         else if(data->IsMissing())
00593         {
00594             result = data->IsRemoved() ? kFileIconRemoved : kFileIconMiss;
00595         }
00596         else if((*data)[EntnodeFile::kConflict] != 0L)
00597         {
00598             result = kFileIconConflict;
00599         }
00600         else if(data->IsRemoved())
00601         {
00602             result = kFileIconRemoved;
00603         }
00604         else if((info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-kb") == 0)
00605         {
00606             result = data->IsUnmodified() ? kFileIconBinary : kFileIconBinaryMod;
00607         }
00608         else
00609         {
00610             result = data->IsUnmodified() ? kFileIconText : kFileIconTextMod;
00611         }
00612     }
00613     else
00614     {
00615         if(data->IsIgnored())
00616         {
00617             result = kFolderIconIgnored;
00618         }
00619         else if(data->IsUnknown())
00620         {
00621             result = kFolderIconUnknown;
00622         }
00623         else if(data->IsMissing())
00624         {
00625             result = kFolderIconMiss;
00626         }
00627         else
00628         {
00629             result = kFolderIcon;
00630         }
00631     }
00632
00633 #if qGTK
00634     void *pixmap = 0L;
00635     switch(result)
00636     {
00637     case kFileIconText:
00638         pixmap = sFileIconTextIcon;
00639         break;
00640     case kFileIconBinary:
00641         pixmap = sFileIconBinaryIcon;
00642         break;
00643     case kFileIconUnknown:
00644         pixmap = sFileIconUnknownIcon;
00645         break;
00646     case kFileIconAdded:
00647         pixmap = sFileIconAddedIcon;
00648         break;
00649     case kFileIconConflict:
00650         pixmap = sFileIconConflictIcon;
00651         break;
00652     case kFileIconMiss:
00653         pixmap = sFileIconMissIcon;
00654         break;
00655     case kFolderIcon:
00656         pixmap = sFolderIconIcon;
00657         break;
00658     case kFolderIconUnknown:
00659         pixmap = sFolderIconUnknownIcon;
00660         break;
00661     case kFolderIconMiss:
00662         pixmap = sFolderIconMissIcon;
00663         break;
00664     case kFileIconTextMod:
00665         pixmap = sFileIconTextModIcon;
00666         break;
00667     case kFileIconBinaryMod:
00668         pixmap = sFileIconBinaryModIcon;
00669         break;
00670     case kFileIconIgnored:
00671         pixmap = sFileIconIgnoredIcon;
00672         break;
00673     case kFolderIconIgnored:
00674         pixmap = sFolderIconIgnoredIcon;
00675         break;
00676     case kFileIconRemoved:
00677         pixmap = sFileIconRemovedIcon;
00678         break;
00679     }
00680     if(pixmap != 0L)
00681     {
00682         resIcon = gtk_pixmap_new (GTK_PIXMAP(pixmap)->pixmap, GTK_PIXMAP(pixmap)->mask);
00683     }
00684 #endif
00685
00686     return resIcon;
00687 }
00688
00689
00690 int UCvsFiles::OnCmdUpdate(void)
00691 {
00692     int nItem = -1;
00693
00694     MultiFiles mf;
00695     mf.newdir(m_path);
00696
00697     // first add the folders
00698     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00699     {
00700         EntnodeData *data;
00701         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00702
00703         if(data->GetType() == ENT_SUBDIR)
00704         {
00705             CStr fullpath;
00706             fullpath = m_path;
00707             if(!fullpath.endsWith(kPathDelimiter))
00708                 fullpath << kPathDelimiter;
00709             fullpath << (*data)[EntnodeData::kName];
00710             CvsCmdUpdateFolder(fullpath);
00711         }
00712         else
00713         {
00714             mf.newfile((*data)[EntnodeData::kName]);
00715         }
00716     }
00717     if(mf.NumFiles() != 0)
00718     {
00719         CvsCmdUpdateFiles(&mf);
00720     }
00721     return 0;
00722 }
00723
00724 bool UCvsFiles::DisableGeneric()
00725 {
00726     return UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, -1), 0L) == -1 ||
00727         UCvsApp::gApp->IsCvsRunning() || gCvsPrefs.empty() || !HasFocus();
00728 }
00729
00730 void UCvsFiles::OnCmdUIUpdate(UCmdUI *pCmdUI)
00731 {
00732     if(DisableGeneric())
00733     {
00734         pCmdUI->Enable(false);
00735         return;
00736     }
00737
00738     int nItem = -1;
00739     bool res = true;
00740     int numFiles = 0;
00741     int numFolders = 0;
00742
00743     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00744     {
00745         EntnodeData *data;
00746         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00747
00748         if(data->IsUnknown())
00749         {
00750             res = false;
00751             break;
00752         }
00753         if(data->GetType() == ENT_FILE)
00754             numFiles++;
00755         else
00756             numFolders++;
00757
00758         if((numFiles != 0 && numFolders != 0) || numFolders > 1)
00759         {
00760             res = false;
00761             break;
00762         }
00763     }
00764
00765     pCmdUI->Enable(res);
00766 }
00767
00768 void UCvsFiles::OnCmdUIAdd(UCmdUI *pCmdUI)
00769 {
00770     if(DisableGeneric())
00771     {
00772         pCmdUI->Enable(false);
00773         return;
00774     }
00775
00776     int nItem = -1;
00777     bool res = true;
00778     int numFiles = 0;
00779     int numFolders = 0;
00780
00781     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00782     {
00783         EntnodeData *data;
00784         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00785
00786         if(!(data->IsUnknown() || (data->IsRemoved() && data->IsMissing())))
00787         {
00788             res = false;
00789             break;
00790         }
00791         if(data->GetType() == ENT_FILE)
00792         {
00793             numFiles++;
00794         }
00795         else
00796             numFolders++;
00797
00798         if((numFiles != 0 && numFolders != 0) || numFolders > 1)
00799         {
00800             res = false;
00801             break;
00802         }
00803     }
00804
00805     pCmdUI->Enable(res);
00806 }
00807
00808 void UCvsFiles::OnCmdUIAddB(UCmdUI *pCmdUI)
00809 {
00810     if(DisableGeneric())
00811     {
00812         pCmdUI->Enable(false);
00813         return;
00814     }
00815
00816     int nItem = -1;
00817     bool res = true;
00818
00819     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00820     {
00821         EntnodeData *data;
00822         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00823
00824         if(data->GetType() != ENT_FILE)
00825         {
00826             res = false;
00827             break;
00828         }
00829         if(!(data->IsUnknown() || (data->IsRemoved() && data->IsMissing())))
00830         {
00831             res = false;
00832             break;
00833         }
00834     }
00835
00836     pCmdUI->Enable(res);
00837 }
00838
00839 void UCvsFiles::OnCmdUIRelease(UCmdUI *pCmdUI)
00840 {
00841     if(DisableGeneric())
00842     {
00843         pCmdUI->Enable(false);
00844         return;
00845     }
00846
00847     int nItem = -1;
00848     bool res = true;
00849     int numFolders = 0;
00850
00851     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00852     {
00853         EntnodeData *data;
00854         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00855
00856         if(data->IsUnknown() || data->GetType() != ENT_SUBDIR)
00857         {
00858             res = false;
00859             break;
00860         }
00861         numFolders++;
00862
00863         if(numFolders > 1)
00864         {
00865             res = false;
00866             break;
00867         }
00868     }
00869
00870     pCmdUI->Enable(res);
00871 }
00872
00873 void UCvsFiles::OnCmdUIRmv(UCmdUI *pCmdUI)
00874 {
00875     if(DisableGeneric())
00876     {
00877         pCmdUI->Enable(false);
00878         return;
00879     }
00880
00881     int nItem = -1;
00882     bool res = true;
00883
00884     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00885     {
00886         EntnodeData *data;
00887         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00888
00889         if(data->IsUnknown() || data->IsRemoved() || data->GetType() == ENT_SUBDIR)
00890         {
00891             res = false;
00892             break;
00893         }
00894     }
00895
00896     pCmdUI->Enable(res);
00897 }
00898
00899 void UCvsFiles::OnCmdUIGraph(UCmdUI *pCmdUI)
00900 {
00901     if(DisableGeneric())
00902     {
00903         pCmdUI->Enable(false);
00904         return;
00905     }
00906
00907     int nItem = -1;
00908     bool res = true;
00909
00910     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00911     {
00912         EntnodeData *data;
00913         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00914
00915         if(data->IsUnknown() || data->GetType() == ENT_SUBDIR)
00916         {
00917             res = false;
00918             break;
00919         }
00920     }
00921
00922     pCmdUI->Enable(res);
00923 }
00924
00925 void UCvsFiles::OnCmdUIEditseldef(UCmdUI *pCmdUI)
00926 {
00927     if(DisableGeneric())
00928     {
00929         pCmdUI->Enable(false);
00930         return;
00931     }
00932
00933     int nItem = -1;
00934     bool res = true;
00935
00936     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00937     {
00938         EntnodeData *data;
00939         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00940
00941         if(data->GetType() == ENT_SUBDIR || data->IsMissing())
00942         {
00943             res = false;
00944             break;
00945         }
00946     }
00947
00948     pCmdUI->Enable(res);
00949     if(gCvsPrefs.Viewer() != 0L)
00950     {
00951         CStr title("Edit with ");
00952         title << gCvsPrefs.Viewer();
00953         pCmdUI->SetText(title);
00954     }
00955 }
00956
00957 void UCvsFiles::OnCmdUIReload(UCmdUI *pCmdUI)
00958 {
00959     pCmdUI->Enable(!DisableGeneric());
00960 }
00961
00962 void UCvsFiles::OnCmdUIUpone(UCmdUI *pCmdUI)
00963 {
00964     pCmdUI->Enable(!DisableGeneric());
00965 }
00966
00967 void UCvsFiles::OnCmdUITrash(UCmdUI *pCmdUI)
00968 {
00969     if(DisableGeneric())
00970     {
00971         pCmdUI->Enable(false);
00972         return;
00973     }
00974
00975     int nItem = -1;
00976     bool res = true;
00977
00978     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00979     {
00980         EntnodeData *data;
00981         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00982         if(data->GetType() == ENT_SUBDIR || data->IsMissing())
00983         {
00984             res = false;
00985             break;
00986         }
00987     }
00988
00989     pCmdUI->Enable(res);
00990 }
00991
00992 void UCvsFiles::OnCmdUIExplore(UCmdUI *pCmdUI)
00993 {
00994     if(DisableGeneric())
00995     {
00996         pCmdUI->Enable(false);
00997         return;
00998     }
00999
01000     int nItem = -1;
01001     bool res = true;
01002     int numItem = 0;
01003
01004     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01005     {
01006         EntnodeData *data;
01007         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01008
01009         if(data->IsMissing() || ++numItem > 1)
01010         {
01011             res = false;
01012             break;
01013         }
01014     }
01015
01016     pCmdUI->Enable(res);
01017 }
01018
01019 void UCvsFiles::OnCmdUIIgnore(UCmdUI *pCmdUI)
01020 {
01021     pCmdUI->Enable(!DisableGeneric());
01022     pCmdUI->Check(gFileViewIgnore);
01023 }
01024
01025 void UCvsFiles::OnCmdUIMacroSel(int cmd, UCmdUI *pCmdUI)
01026 {
01027     if(DisableGeneric())
01028     {
01029         pCmdUI->Enable(false);
01030         return;
01031     }
01032
01033     int nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, -1), 0L);
01034     pCmdUI->Enable(nItem != -1 && CTcl_Interp::IsAvail());
01035 }
01036
01037 int UCvsFiles::OnCmdAdd(void)
01038 {
01039     int nItem = -1;
01040
01041     MultiFiles mf;
01042     mf.newdir(m_path);
01043
01044     // first add the folders
01045     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01046     {
01047         EntnodeData *data;
01048         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01049
01050         if(data->GetType() == ENT_SUBDIR)
01051         {
01052             CStr fullpath;
01053             fullpath = m_path;
01054             if(!fullpath.endsWith(kPathDelimiter))
01055                 fullpath << kPathDelimiter;
01056             fullpath << (*data)[EntnodeData::kName];
01057             CvsCmdAddFolder(fullpath);
01058         }
01059         else
01060         {
01061             mf.newfile((*data)[EntnodeData::kName]);
01062         }
01063     }
01064     if(mf.NumFiles() != 0)
01065     {
01066         CvsCmdAddFiles(&mf);
01067     }
01068     return 0;
01069 }
01070
01071 int UCvsFiles::OnCmdAddb(void)
01072 {
01073     int nItem = -1;
01074
01075     MultiFiles mf;
01076     mf.newdir(m_path);
01077
01078     // first add the folders
01079     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01080     {
01081         EntnodeData *data;
01082         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01083
01084         if(data->GetType() == ENT_SUBDIR)
01085         {
01086             CStr fullpath;
01087             fullpath = m_path;
01088             if(!fullpath.endsWith(kPathDelimiter))
01089                 fullpath << kPathDelimiter;
01090             fullpath << (*data)[EntnodeData::kName];
01091             CvsCmdAddFolder(fullpath);
01092         }
01093         else
01094         {
01095             mf.newfile((*data)[EntnodeData::kName]);
01096         }
01097     }
01098     if(mf.NumFiles() != 0)
01099     {
01100         CvsCmdAddBinaryFiles(&mf);
01101     }
01102     return 0;
01103 }
01104
01105 int UCvsFiles::OnCmdCommit(void)
01106 {
01107     int nItem = -1;
01108
01109     MultiFiles mf;
01110     mf.newdir(m_path);
01111
01112     // first add the folders
01113     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01114     {
01115         EntnodeData *data;
01116         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01117
01118         if(data->GetType() == ENT_SUBDIR)
01119         {
01120             CStr fullpath;
01121             fullpath = m_path;
01122             if(!fullpath.endsWith(kPathDelimiter))
01123                 fullpath << kPathDelimiter;
01124             fullpath << (*data)[EntnodeData::kName];
01125             CvsCmdCommitFolder(fullpath);
01126         }
01127         else
01128         {
01129             mf.newfile((*data)[EntnodeData::kName]);
01130         }
01131     }
01132     if(mf.NumFiles() != 0)
01133     {
01134         CvsCmdCommitFiles(&mf);
01135     }
01136     return 0;
01137 }
01138
01139 int UCvsFiles::OnCmdRmv(void)
01140 {
01141     int nItem = -1;
01142
01143     MultiFiles mf;
01144     mf.newdir(m_path);
01145
01146     // first add the folders
01147     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01148     {
01149         EntnodeData *data;
01150         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01151
01152         if(data->GetType() != ENT_FILE)
01153             continue;
01154
01155         mf.newfile((*data)[EntnodeData::kName]);
01156     }
01157     if(mf.NumFiles() != 0)
01158     {
01159         CvsCmdRemoveFiles(&mf);
01160     }
01161     return 0;
01162 }
01163
01164 int UCvsFiles::OnCmdQueryUpdate(void)
01165 {
01166     int nItem = -1;
01167
01168     MultiFiles mf;
01169     mf.newdir(m_path);
01170
01171     // first add the folders
01172     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01173     {
01174         EntnodeData *data;
01175         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01176
01177         if(data->GetType() == ENT_SUBDIR)
01178         {
01179             CStr fullpath;
01180             fullpath = m_path;
01181             if(!fullpath.endsWith(kPathDelimiter))
01182                 fullpath << kPathDelimiter;
01183             fullpath << (*data)[EntnodeData::kName];
01184             CvsCmdUpdateFolder(fullpath, true);
01185         }
01186         else
01187         {
01188             mf.newfile((*data)[EntnodeData::kName]);
01189         }
01190     }
01191     if(mf.NumFiles() != 0)
01192     {
01193         CvsCmdUpdateFiles(&mf, true);
01194     }
01195     return 0;
01196 }
01197
01198 int UCvsFiles::OnCmdReload(void)
01199 {
01200     ResetView(true, true);
01201     return 0;
01202 }
01203
01204 int UCvsFiles::OnCmdUpone(void)
01205 {
01206     UStr uppath, filename;
01207     SplitPath(m_path, uppath, filename);
01208     ResetView(uppath, true);
01209     return 0;
01210 }
01211
01212 int UCvsFiles::OnCmdTrash(void)
01213 {
01214     int nItem = -1;
01215
01216     MultiFiles mf;
01217     mf.newdir(m_path);
01218
01219     // first add the folders
01220     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01221     {
01222         EntnodeData *data;
01223         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01224
01225         if(data->GetType() != ENT_FILE)
01226             continue;
01227
01228         mf.newfile((*data)[EntnodeData::kName]);
01229     }
01230
01231     if(mf.NumFiles() != 0)
01232     {
01233         CvsArgs args(false);
01234         mf.next();
01235         const char *dir = mf.add(args);
01236         char * const *argv = args.Argv();
01237         int argc = args.Argc();
01238         for(int i = 0; i < argc; i++)
01239         {
01240             CStr fullpath(dir);
01241             if(!fullpath.empty() && !fullpath.endsWith(kPathDelimiter))
01242             {
01243                 fullpath << kPathDelimiter;
01244             }
01245             fullpath << argv[i];
01246
01247             if(chmod(fullpath, 0666) != 0)
01248             {
01249                 cvs_err("Unable to change permission on '%s' (error %d)\n", (const char *)fullpath, errno);
01250                 continue;
01251             }
01252
01253             if(!CompatMoveToTrash(argv[i], dir))
01254                 cvs_err("Unable to remove '%s' (error %d)\n", (const char *)fullpath, errno);
01255             else
01256 #ifdef WIN32
01257                 cvs_out("'%s' has been moved successfully to the recycle bin...\n", (const char *)fullpath);
01258 #else
01259                 cvs_out("'%s' has been deleted successfully...\n", (const char *)fullpath);
01260 #endif
01261             }
01262
01263         ResetView(true);
01264     }
01265     return 0;
01266 }
01267
01268 int UCvsFiles::OnCmdDiff(void)
01269 {
01270     int nItem = -1;
01271
01272     MultiFiles mf;
01273     mf.newdir(m_path);
01274
01275     // first add the folders
01276     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01277     {
01278         EntnodeData *data;
01279         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01280
01281         if(data->GetType() == ENT_SUBDIR)
01282         {
01283             CStr fullpath;
01284             fullpath = m_path;
01285             if(!fullpath.endsWith(kPathDelimiter))
01286                 fullpath << kPathDelimiter;
01287             fullpath << (*data)[EntnodeData::kName];
01288             CvsCmdDiffFolder(fullpath);
01289         }
01290         else
01291         {
01292             mf.newfile((*data)[EntnodeData::kName]);
01293         }
01294     }
01295     if(mf.NumFiles() != 0)
01296     {
01297         CvsCmdDiffFiles(&mf);
01298     }
01299     return 0;
01300 }
01301
01302 int UCvsFiles::OnCmdLog(void)
01303 {
01304     int nItem = -1;
01305
01306     MultiFiles mf;
01307     mf.newdir(m_path);
01308
01309     // first add the folders
01310     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01311     {
01312         EntnodeData *data;
01313         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01314
01315         if(data->GetType() == ENT_SUBDIR)
01316         {
01317             CStr fullpath;
01318             fullpath = m_path;
01319             if(!fullpath.endsWith(kPathDelimiter))
01320                 fullpath << kPathDelimiter;
01321             fullpath << (*data)[EntnodeData::kName];
01322             CvsCmdLogFolder(fullpath);
01323         }
01324         else
01325         {
01326             mf.newfile((*data)[EntnodeData::kName]);
01327         }
01328     }
01329     if(mf.NumFiles() != 0)
01330     {
01331         CvsCmdLogFiles(&mf);
01332     }
01333     return 0;
01334 }
01335
01336 int UCvsFiles::OnCmdGraph(void)
01337 {
01338     int nItem = -1;
01339
01340     MultiFiles mf;
01341     mf.newdir(m_path);
01342
01343     // first add the folders
01344     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01345     {
01346         EntnodeData *data;
01347         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01348
01349         if(data->GetType() != ENT_FILE)
01350             continue;
01351
01352         mf.newfile((*data)[EntnodeData::kName]);
01353     }
01354     if(mf.NumFiles() != 0)
01355     {
01356         CvsCmdLogFiles(&mf, true);
01357     }
01358     return 0;
01359 }
01360
01361 int UCvsFiles::OnCmdStatus(void)
01362 {
01363     int nItem = -1;
01364
01365     MultiFiles mf;
01366     mf.newdir(m_path);
01367
01368     // first add the folders
01369     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01370     {
01371         EntnodeData *data;
01372         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01373
01374         if(data->GetType() == ENT_SUBDIR)
01375         {
01376             CStr fullpath;
01377             fullpath = m_path;
01378             if(!fullpath.endsWith(kPathDelimiter))
01379                 fullpath << kPathDelimiter;
01380             fullpath << (*data)[EntnodeData::kName];
01381             CvsCmdStatusFolder(fullpath);
01382         }
01383         else
01384         {
01385             mf.newfile((*data)[EntnodeData::kName]);
01386         }
01387     }
01388     if(mf.NumFiles() != 0)
01389     {
01390         CvsCmdStatusFiles(&mf);
01391     }
01392     return 0;
01393 }
01394
01395 int UCvsFiles::OnCmdLock(void)
01396 {
01397     int nItem = -1;
01398
01399     MultiFiles mf;
01400     mf.newdir(m_path);
01401
01402     // first add the folders
01403     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01404     {
01405         EntnodeData *data;
01406         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01407
01408         if(data->GetType() == ENT_SUBDIR)
01409         {
01410             CStr fullpath;
01411             fullpath = m_path;
01412             if(!fullpath.endsWith(kPathDelimiter))
01413                 fullpath << kPathDelimiter;
01414             fullpath << (*data)[EntnodeData::kName];
01415             CvsCmdLockFolder(fullpath);
01416         }
01417         else
01418         {
01419             mf.newfile((*data)[EntnodeData::kName]);
01420         }
01421     }
01422     if(mf.NumFiles() != 0)
01423     {
01424         CvsCmdLockFiles(&mf);
01425     }
01426     return 0;
01427 }
01428
01429 int UCvsFiles::OnCmdUnlock(void)
01430 {
01431     int nItem = -1;
01432
01433     MultiFiles mf;
01434     mf.newdir(m_path);
01435
01436     // first add the folders
01437     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01438     {
01439         EntnodeData *data;
01440         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01441
01442         if(data->GetType() == ENT_SUBDIR)
01443         {
01444             CStr fullpath;
01445             fullpath = m_path;
01446             if(!fullpath.endsWith(kPathDelimiter))
01447                 fullpath << kPathDelimiter;
01448             fullpath << (*data)[EntnodeData::kName];
01449             CvsCmdUnlockFolder(fullpath);
01450         }
01451         else
01452         {
01453             mf.newfile((*data)[EntnodeData::kName]);
01454         }
01455     }
01456     if(mf.NumFiles() != 0)
01457     {
01458         CvsCmdUnlockFiles(&mf);
01459     }
01460     return 0;
01461 }
01462
01463 int UCvsFiles::OnCmdWatchOn(void)
01464 {
01465     int nItem = -1;
01466
01467     MultiFiles mf;
01468     mf.newdir(m_path);
01469
01470     // first add the folders
01471     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01472     {
01473         EntnodeData *data;
01474         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01475
01476         if(data->GetType() == ENT_SUBDIR)
01477         {
01478             CStr fullpath;
01479             fullpath = m_path;
01480             if(!fullpath.endsWith(kPathDelimiter))
01481                 fullpath << kPathDelimiter;
01482             fullpath << (*data)[EntnodeData::kName];
01483             CvsCmdWatchOnFolder(fullpath);
01484         }
01485         else
01486         {
01487             mf.newfile((*data)[EntnodeData::kName]);
01488         }
01489     }
01490     if(mf.NumFiles() != 0)
01491     {
01492         CvsCmdWatchOnFiles(&mf);
01493     }
01494     return 0;
01495 }
01496
01497 int UCvsFiles::OnCmdWatchOff(void)
01498 {
01499     int nItem = -1;
01500
01501     MultiFiles mf;
01502     mf.newdir(m_path);
01503
01504     // first add the folders
01505     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01506     {
01507         EntnodeData *data;
01508         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01509
01510         if(data->GetType() == ENT_SUBDIR)
01511         {
01512             CStr fullpath;
01513             fullpath = m_path;
01514             if(!fullpath.endsWith(kPathDelimiter))
01515                 fullpath << kPathDelimiter;
01516             fullpath << (*data)[EntnodeData::kName];
01517             CvsCmdWatchOffFolder(fullpath);
01518         }
01519         else
01520         {
01521             mf.newfile((*data)[EntnodeData::kName]);
01522         }
01523     }
01524     if(mf.NumFiles() != 0)
01525     {
01526         CvsCmdWatchOffFiles(&mf);
01527     }
01528     return 0;
01529 }
01530
01531 int UCvsFiles::OnCmdEdit(void)
01532 {
01533     int nItem = -1;
01534
01535     MultiFiles mf;
01536     mf.newdir(m_path);
01537
01538     // first add the folders
01539     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01540     {
01541         EntnodeData *data;
01542         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01543
01544         if(data->GetType() == ENT_SUBDIR)
01545         {
01546             CStr fullpath;
01547             fullpath = m_path;
01548             if(!fullpath.endsWith(kPathDelimiter))
01549                 fullpath << kPathDelimiter;
01550             fullpath << (*data)[EntnodeData::kName];
01551             CvsCmdEditFolder(fullpath);
01552         }
01553         else
01554         {
01555             mf.newfile((*data)[EntnodeData::kName]);
01556         }
01557     }
01558     if(mf.NumFiles() != 0)
01559     {
01560         CvsCmdEditFiles(&mf);
01561     }
01562     return 0;
01563 }
01564
01565 int UCvsFiles::OnCmdUnedit(void)
01566 {
01567     int nItem = -1;
01568
01569     MultiFiles mf;
01570     mf.newdir(m_path);
01571
01572     // first add the folders
01573     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01574     {
01575         EntnodeData *data;
01576         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01577
01578         if(data->GetType() == ENT_SUBDIR)
01579         {
01580             CStr fullpath;
01581             fullpath = m_path;
01582             if(!fullpath.endsWith(kPathDelimiter))
01583                 fullpath << kPathDelimiter;
01584             fullpath << (*data)[EntnodeData::kName];
01585             CvsCmdUneditFolder(fullpath);
01586         }
01587         else
01588         {
01589             mf.newfile((*data)[EntnodeData::kName]);
01590         }
01591     }
01592     if(mf.NumFiles() != 0)
01593     {
01594         CvsCmdUneditFiles(&mf);
01595     }
01596     return 0;
01597 }
01598
01599 int UCvsFiles::OnCmdWatchers(void)
01600 {
01601     int nItem = -1;
01602
01603     MultiFiles mf;
01604     mf.newdir(m_path);
01605
01606     // first add the folders
01607     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01608     {
01609         EntnodeData *data;
01610         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01611
01612         if(data->GetType() == ENT_SUBDIR)
01613         {
01614             CStr fullpath;
01615             fullpath = m_path;
01616             if(!fullpath.endsWith(kPathDelimiter))
01617                 fullpath << kPathDelimiter;
01618             fullpath << (*data)[EntnodeData::kName];
01619             CvsCmdWatchersFolder(fullpath);
01620         }
01621         else
01622         {
01623             mf.newfile((*data)[EntnodeData::kName]);
01624         }
01625     }
01626     if(mf.NumFiles() != 0)
01627     {
01628         CvsCmdWatchersFiles(&mf);
01629     }
01630     return 0;
01631 }
01632
01633 int UCvsFiles::OnCmdEditors(void)
01634 {
01635     int nItem = -1;
01636
01637     MultiFiles mf;
01638     mf.newdir(m_path);
01639
01640     // first add the folders
01641     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01642     {
01643         EntnodeData *data;
01644         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01645
01646         if(data->GetType() == ENT_SUBDIR)
01647         {
01648             CStr fullpath;
01649             fullpath = m_path;
01650             if(!fullpath.endsWith(kPathDelimiter))
01651                 fullpath << kPathDelimiter;
01652             fullpath << (*data)[EntnodeData::kName];
01653             CvsCmdEditorsFolder(fullpath);
01654         }
01655         else
01656         {
01657             mf.newfile((*data)[EntnodeData::kName]);
01658         }
01659     }
01660     if(mf.NumFiles() != 0)
01661     {
01662         CvsCmdEditorsFiles(&mf);
01663     }
01664     return 0;
01665 }
01666
01667 int UCvsFiles::OnCmdRelease(void)
01668 {
01669     int nItem = -1;
01670
01671     // first add the folders
01672     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01673     {
01674         EntnodeData *data;
01675         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01676
01677         if(data->GetType() == ENT_SUBDIR)
01678         {
01679             CStr fullpath;
01680             fullpath = m_path;
01681             if(!fullpath.endsWith(kPathDelimiter))
01682                 fullpath << kPathDelimiter;
01683             fullpath << (*data)[EntnodeData::kName];
01684             CvsCmdReleaseFolder(fullpath);
01685         }
01686     }
01687     return 0;
01688 }
01689
01690 int UCvsFiles::OnCmdTagNew(void)
01691 {
01692     int nItem = -1;
01693
01694     MultiFiles mf;
01695     mf.newdir(m_path);
01696
01697     // first add the folders
01698     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01699     {
01700         EntnodeData *data;
01701         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01702
01703         if(data->GetType() == ENT_SUBDIR)
01704         {
01705             CStr fullpath;
01706             fullpath = m_path;
01707             if(!fullpath.endsWith(kPathDelimiter))
01708                 fullpath << kPathDelimiter;
01709             fullpath << (*data)[EntnodeData::kName];
01710             CvsCmdTagCreateFolder(fullpath);
01711         }
01712         else
01713         {
01714             mf.newfile((*data)[EntnodeData::kName]);
01715         }
01716     }
01717     if(mf.NumFiles() != 0)
01718     {
01719         CvsCmdTagCreateFiles(&mf);
01720     }
01721     return 0;
01722 }
01723
01724 int UCvsFiles::OnCmdTagDelete(void)
01725 {
01726     int nItem = -1;
01727
01728     MultiFiles mf;
01729     mf.newdir(m_path);
01730
01731     // first add the folders
01732     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01733     {
01734         EntnodeData *data;
01735         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01736
01737         if(data->GetType() == ENT_SUBDIR)
01738         {
01739             CStr fullpath;
01740             fullpath = m_path;
01741             if(!fullpath.endsWith(kPathDelimiter))
01742                 fullpath << kPathDelimiter;
01743             fullpath << (*data)[EntnodeData::kName];
01744             CvsCmdTagDeleteFolder(fullpath);
01745         }
01746         else
01747         {
01748             mf.newfile((*data)[EntnodeData::kName]);
01749         }
01750     }
01751     if(mf.NumFiles() != 0)
01752     {
01753         CvsCmdTagDeleteFiles(&mf);
01754     }
01755     return 0;
01756 }
01757
01758 int UCvsFiles::OnCmdTagBranch(void)
01759 {
01760     int nItem = -1;
01761
01762     MultiFiles mf;
01763     mf.newdir(m_path);
01764
01765     // first add the folders
01766     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01767     {
01768         EntnodeData *data;
01769         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01770
01771         if(data->GetType() == ENT_SUBDIR)
01772         {
01773             CStr fullpath;
01774             fullpath = m_path;
01775             if(!fullpath.endsWith(kPathDelimiter))
01776                 fullpath << kPathDelimiter;
01777             fullpath << (*data)[EntnodeData::kName];
01778             CvsCmdTagBranchFolder(fullpath);
01779         }
01780         else
01781         {
01782             mf.newfile((*data)[EntnodeData::kName]);
01783         }
01784     }
01785     if(mf.NumFiles() != 0)
01786     {
01787         CvsCmdTagBranchFiles(&mf);
01788     }
01789     return 0;
01790 }
01791
01792 int UCvsFiles::OnCmdExplore(void)
01793 {
01794     int nItem = -1;
01795
01796     // first add the folders
01797     if((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01798     {
01799         EntnodeData *data;
01800         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01801
01802         CStr fullpath;
01803         fullpath = m_path;
01804         if(!fullpath.endsWith(kPathDelimiter))
01805             fullpath << kPathDelimiter;
01806         fullpath << (*data)[EntnodeData::kName];
01807
01808 #ifdef WIN32
01809         HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), "explore", fullpath,
01810                                        0L, 0L, SW_SHOWDEFAULT);
01811         if((long)hInst < 32)
01812         {
01813             cvs_err("Unable to explore '%s' (error %d)\n", (char *)m_path, GetLastError());
01814         }
01815 #endif
01816 #ifdef qUnix
01817         CvsArgs args(false);
01818         args.add(gCvsPrefs.Browser());
01819         args.add(fullpath);
01820         UCvsApp::gApp->Execute(args.Argc(), args.Argv());
01821 #endif
01822     }
01823     return 0;
01824 }
01825
01826 int UCvsFiles::OnCmdIgnore(void)
01827 {
01828     gFileViewIgnore = !(bool)gFileViewIgnore;
01829     ResetView(true, true);
01830     return 0;
01831 }
01832
01833 int UCvsFiles::OnCmdEditsel(void)
01834 {
01835     int nItem = -1;
01836
01837     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01838     {
01839         EntnodeData *data;
01840         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01841         EditSel(data);
01842     }
01843     return 0;
01844 }
01845
01846 int UCvsFiles::OnCmdEditseldef(void)
01847 {
01848     int nItem = -1;
01849
01850     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01851     {
01852         EntnodeData *data;
01853         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01854         EditSel(data, true);
01855     }
01856     return 0;
01857 }
01858
01859 int UCvsFiles::OnMacroSel(int cmd)
01860 {
01861     CTcl_Interp interp;
01862     CMacroEntry & entry = gMacrosSel.entries[cmd - cmdSELMACRO];
01863     CStr path = entry.path;
01864     CTcl_Interp::Unixfy(path);
01865
01866     TclBrowserReset();
01867
01868     int nItem = -1;
01869     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01870     {
01871         EntnodeData *data;
01872         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01873         TclBrowserAppend(m_path, data);
01874     }
01875
01876     interp.DoScriptVar("source \"%s\"", (const char *)path);
01877     return 0;
01878 }
01879
01880 void UCvsFiles::EditSel(EntnodeData *data, bool useDefault)
01881 {
01882     CStr fullpath;
01883     fullpath = m_path;
01884     if(!fullpath.endsWith(kPathDelimiter))
01885         fullpath << kPathDelimiter;
01886     fullpath << (*data)[EntnodeData::kName];
01887     if(data->GetType() == ENT_SUBDIR)
01888     {
01889         ResetView(fullpath, true);
01890     }
01891     else
01892     {
01893 #ifdef WIN32
01894         char viewer[_MAX_PATH];
01895         HINSTANCE hInst = FindExecutable((*data)[EntnodeData::kName],
01896             m_path, viewer);
01897         bool done = false;
01898         if(!useDefault && (UINT)hInst >= 32)
01899         {
01900             HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), "open", (*data)[EntnodeData::kName],
01901                 NULL, m_path, SW_SHOWDEFAULT);
01902             if((long)hInst < 32)
01903             {
01904                 cvs_err("Unable to open '%s' (error %d), using default viewer instead\n", (char *)fullpath, GetLastError());
01905             }
01906             else
01907                 done = true;
01908         }
01909
01910         if(!done)
01911         {
01912             const char * argv[3] = {0L, 0L, 0L};
01913             CStr program, file;
01914             if(strchr(gCvsPrefs.Viewer(), ' ') != 0L)
01915             {
01916                 program << '\"';
01917                 program << gCvsPrefs.Viewer();
01918                 program << '\"';
01919             }
01920             else
01921                 program = gCvsPrefs.Viewer();
01922             if(strchr(fullpath, ' ') != 0L)
01923             {
01924                 file << '\"';
01925                 file << fullpath;
01926                 file << '\"';
01927             }
01928             else
01929                 file = fullpath;
01930             argv[0] = program;
01931             argv[1] = file;
01932             int process = _spawnvp(_P_NOWAIT, gCvsPrefs.Viewer(), argv);
01933         }
01934 #endif
01935 #ifdef qUnix
01936         CStr fullpath;
01937         fullpath = m_path;
01938         if(!fullpath.endsWith(kPathDelimiter))
01939             fullpath << kPathDelimiter;
01940         fullpath << (*data)[EntnodeData::kName];
01941
01942         CvsArgs args(false);
01943         args.add(gCvsPrefs.Viewer());
01944         args.add(fullpath);
01945         UCvsApp::gApp->Execute(args.Argc(), args.Argv());
01946 #endif
01947     }
01948 }
01949
01950 void UCvsFiles::OnDblClick(void)
01951 {
01952     int nItem = -1;
01953
01954     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01955     {
01956         EntnodeData *data;
01957         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01958         EditSel(data);
01959     }
01960 }
01961
01962 static int compareName(UWidget *wid, void *data1, void *data2)
01963 {
01964     UCvsFiles *w = (UCvsFiles *)wid;
01965     EntnodeData *d1 = (EntnodeData *)data1;
01966     EntnodeData *d2 = (EntnodeData *)data2;
01967     int res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
01968     return w->IsSortAscendant() ? res : -res;
01969 }
01970
01971 static int compareStatus(UWidget *wid, void *data1, void *data2)
01972 {
01973     UCvsFiles *w = (UCvsFiles *)wid;
01974     EntnodeData *d1 = (EntnodeData *)data1;
01975     EntnodeData *d2 = (EntnodeData *)data2;
01976     int res = stricmp((*d1)[EntnodeData::kStatus], (*d2)[EntnodeData::kStatus]);
01977     if(res == 0)
01978         res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
01979     return w->IsSortAscendant() ? res : -res;
01980 }
01981
01982 static int compareOption(UWidget *wid, void *data1, void *data2)
01983 {
01984     UCvsFiles *w = (UCvsFiles *)wid;
01985     EntnodeData *d1 = (EntnodeData *)data1;
01986     EntnodeData *d2 = (EntnodeData *)data2;
01987     const char *s1 = (*d1)[EntnodeFile::kOption];
01988     const char *s2 = (*d2)[EntnodeFile::kOption];
01989     int res;
01990     if(s1 != 0L && s2 != 0L)
01991         res = strcmp(s1, s2);
01992     else
01993         res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
01994     if(res == 0)
01995         res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
01996     return w->IsSortAscendant() ? res : -res;
01997 }
01998
01999 static int revcmp(const char *rev1, const char *rev2)
02000 {
02001     if(rev1 == 0L && rev2 == 0L)
02002         return 0;
02003     else if(rev1 == 0L || rev2 == 0L)
02004         return rev1 == 0L ? -1 : 1;
02005
02006     CStr r1(rev1), r2(rev2);
02007     CStr q1, q2;
02008     char *tmp;
02009     int v1, v2;
02010
02011     if((tmp = strchr(r1, '.')) != 0L)
02012     {
02013         tmp[0] = '\0';
02014         q1 = tmp + 1;
02015     }
02016
02017     v1 = atoi(r1);
02018
02019     if((tmp = strchr(r2, '.')) != 0L)
02020     {
02021         tmp[0] = '\0';
02022         q2 = tmp + 1;
02023     }
02024     v2 = atoi(r2);
02025
02026     if(v1 == v2)
02027         return revcmp(q1.empty() ? (char *)0L : (const char *)q1, q2.empty() ? (char *)0L : (const char *)q2);
02028
02029     return v1 < v2 ? -1 : 1;
02030 }
02031
02032 static int compareRevs(UWidget *wid, void * data1, void * data2)
02033 {
02034     UCvsFiles *w = (UCvsFiles *)wid;
02035     EntnodeData *d1 = (EntnodeData *)data1;
02036     EntnodeData *d2 = (EntnodeData *)data2;
02037     const char *s1 = (*d1)[EntnodeFile::kVN];
02038     const char *s2 = (*d2)[EntnodeFile::kVN];
02039     int res;
02040     if(s1 != 0L && s2 != 0L)
02041         res = revcmp(s1, s2);
02042     else
02043         res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
02044     if(res == 0)
02045         res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
02046     return w->IsSortAscendant() ? res : -res;
02047 }
02048
02049 static int compareTag(UWidget *wid, void * data1, void * data2)
02050 {
02051     UCvsFiles *w = (UCvsFiles *)wid;
02052     EntnodeData *d1 = (EntnodeData *)data1;
02053     EntnodeData *d2 = (EntnodeData *)data2;
02054     const char *s1 = (*d1)[EntnodeFile::kTag];
02055     const char *s2 = (*d2)[EntnodeFile::kTag];
02056     int res;
02057     if(s1 != 0L && s2 != 0L)
02058         res = strcmp(s1, s2);
02059     else
02060         res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
02061     if(res == 0)
02062         res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
02063     return w->IsSortAscendant() ? res : -res;
02064 }
02065
02066 static int compareConflict(UWidget *wid, void * data1, void * data2)
02067 {
02068     UCvsFiles *w = (UCvsFiles *)wid;
02069     EntnodeData *d1 = (EntnodeData *)data1;
02070     EntnodeData *d2 = (EntnodeData *)data2;
02071     const char *s1 = (*d1)[EntnodeFile::kConflict];
02072     const char *s2 = (*d2)[EntnodeFile::kConflict];
02073     int res;
02074     if(s1 != 0L && s2 != 0L)
02075         res = strcmp(s1, s2);
02076     else
02077         res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
02078     if(res == 0)
02079         res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
02080     return w->IsSortAscendant() ? res : -res;
02081 }
02082
02083 void UCvsFiles::Resort(void)
02084 {
02085     UListSorter fsort = 0L;
02086     switch(m_sort)
02087     {
02088     case EntnodeData::kName:
02089         fsort = compareName;
02090         break;
02091     case EntnodeFile::kVN:
02092         fsort = compareRevs;
02093         break;
02094     case EntnodeData::kStatus:
02095         fsort = compareStatus;
02096         break;
02097     case EntnodeFile::kOption:
02098         fsort = compareOption;
02099         break;
02100     case EntnodeFile::kTag:
02101         fsort = compareTag;
02102         break;
02103     case EntnodeFile::kConflict:
02104         fsort = compareConflict;
02105         break;
02106     }
02107     if(fsort != 0L)
02108         UEventSendMessage(GetWidID(), EV_LIST_RESORT, UMAKEINT(kUMainWidget, m_sort), (void *)fsort);
02109 }
02110
02111 void UCvsFiles::OnSelColumn(int column)
02112 {
02113     if(column == m_sort)
02114         m_ascendant = !m_ascendant;
02115     else
02116     {
02117         m_ascendant = true;
02118         switch(column)
02119         {
02120         case EntnodeData::kName:
02121         case EntnodeData::kStatus:
02122         case EntnodeFile::kOption:
02123         case EntnodeFile::kTag:
02124         case EntnodeFile::kConflict:
02125         case EntnodeFile::kVN:
02126             m_sort = column;
02127             break;
02128         }
02129     }
02130
02131     Resort();
02132 }
Generated on Sun Feb 24 01:21:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UCvsFiles.h Source File

common/UCvsFiles.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 /*
00022  *
00023  */
00024
00025 #ifndef UCVSFILES_H
00026 #define UCVSFILES_H
00027
00028 #include "uwidget.h"
00029 #include "CvsEntries.h"
00030
00031 class UCvsFiles : public UWidget
00032 {
00033     UDECLARE_DYNAMIC(UCvsFiles)
00034 public:
00035     UCvsFiles();
00036     virtual ~UCvsFiles();
00037
00038     void ResetView(const char *path, bool notifyBrowser = false);
00039         // reset to this path and notify optionally the directories tree
00040
00041     void ResetView(bool forceReload = false, bool notifyBrowser = false);
00042         // - reload and try to guess if something changed
00043         // according to the mod. time of CVS
00044         // - notify optionally the directories tree
00045
00046     static void *GetImageForEntry(EntnodeData *data);
00047         // return the icon of the image which symbolizes the
00048         // state of the file/directory
00049
00050     inline bool IsSortAscendant(void) { return m_ascendant; }
00051
00052 protected:
00053     void GetEntriesModTime(time_t & newEntriesMod, time_t & newEntriesLogMod);
00054         // used internally to get the time stamp of the CVS/Entries
00055
00056     void EditSel(EntnodeData *data, bool useDefault = false);
00057         // used internally to open a file
00058
00059     void Resort(void);
00060         // resort according to the current key
00061
00062     CSortList<ENTNODE> m_entries;
00063         // CVS/Entries infos
00064     CStr m_path;
00065         // current path
00066     time_t m_entriesMod;
00067     time_t m_entriesLogMod;
00068         // time stamp of CVS/
00069     int m_sort;
00070         // sort key
00071     bool m_ascendant;
00072         // sort flag
00073
00074     bool DisableGeneric();
00075         // used for the handling of EV_UPDTCMD
00076
00077     int Search(const char *title);
00078
00079     ev_msg void OnDestroy();
00080     ev_msg void OnCreate();
00081     ev_msg int OnCmdUpdate(void);
00082     ev_msg int OnCmdAdd(void);
00083     ev_msg int OnCmdAddb(void);
00084     ev_msg int OnCmdCommit(void);
00085     ev_msg int OnCmdRmv(void);
00086     ev_msg int OnCmdQueryUpdate(void);
00087     ev_msg int OnCmdReload(void);
00088     ev_msg int OnCmdUpone(void);
00089     ev_msg int OnCmdTrash(void);
00090     ev_msg int OnCmdDiff(void);
00091     ev_msg int OnCmdLog(void);
00092     ev_msg int OnCmdGraph(void);
00093     ev_msg int OnCmdStatus(void);
00094     ev_msg int OnCmdLock(void);
00095     ev_msg int OnCmdUnlock(void);
00096     ev_msg int OnCmdWatchOn(void);
00097     ev_msg int OnCmdWatchOff(void);
00098     ev_msg int OnCmdEdit(void);
00099     ev_msg int OnCmdUnedit(void);
00100     ev_msg int OnCmdWatchers(void);
00101     ev_msg int OnCmdEditors(void);
00102     ev_msg int OnCmdRelease(void);
00103     ev_msg int OnCmdTagNew(void);
00104     ev_msg int OnCmdTagDelete(void);
00105     ev_msg int OnCmdTagBranch(void);
00106     ev_msg int OnCmdExplore(void);
00107     ev_msg int OnCmdIgnore(void);
00108     ev_msg int OnCmdEditsel(void);
00109     ev_msg int OnCmdEditseldef(void);
00110     ev_msg int OnMacroSel(int cmd);
00111     ev_msg void OnCmdUIUpdate(UCmdUI *pCmdUI);
00112     ev_msg void OnCmdUIAdd(UCmdUI *pCmdUI);
00113     ev_msg void OnCmdUIAddB(UCmdUI *pCmdUI);
00114     ev_msg void OnCmdUIRelease(UCmdUI *pCmdUI);
00115     ev_msg void OnCmdUIRmv(UCmdUI *pCmdUI);
00116     ev_msg void OnCmdUIGraph(UCmdUI *pCmdUI);
00117     ev_msg void OnCmdUIEditseldef(UCmdUI *pCmdUI);
00118     ev_msg void OnCmdUIReload(UCmdUI *pCmdUI);
00119     ev_msg void OnCmdUIUpone(UCmdUI *pCmdUI);
00120     ev_msg void OnCmdUITrash(UCmdUI *pCmdUI);
00121     ev_msg void OnCmdUIExplore(UCmdUI *pCmdUI);
00122     ev_msg void OnCmdUIIgnore(UCmdUI *pCmdUI);
00123     ev_msg void OnCmdUIMacroSel(int cmd, UCmdUI *pCmdUI);
00124     ev_msg void OnDblClick(void);
00125     ev_msg void OnSelColumn(int column);
00126
00127     UDECLARE_MESSAGE_MAP()
00128 };
00129
00130 extern CPersistentBool gFileViewIgnore;
00131
00132 #endif
Generated on Sun Feb 24 01:21:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UCvsFolders.cpp Source File

common/UCvsFolders.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 /*
00022  *
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #if qGTK
00028 #   include <gtk/gtk.h>
00029 #endif
00030
00031 #ifdef HAVE_UNISTD_H
00032 #include <unistd.h>
00033 #endif
00034
00035 #include "UCvsFolders.h"
00036 #include "UCvsDialogs.h"
00037 #include "UCvsApp.h"
00038 #include "UCvsFiles.h"
00039 #include "UCvsCommands.h"
00040 #include "UCvsFrame.h"
00041 #include "MultiString.h"
00042 #include "FileTraversal.h"
00043 #include "CvsEntries.h"
00044 #include "CvsPrefs.h"
00045 #include "AppConsole.h"
00046 #include "CvsCommands.h"
00047 #include "TclGlue.h"
00048 #include "MacrosSetup.h"
00049 #include "CvsArgs.h"
00050
00051 #ifdef WIN32
00052 static PCPStr gOldLoc("P_BrowserLoc", "C:\\");
00053 #endif
00054
00055 #ifdef qUnix
00056 static PCPStr gOldLoc("P_BrowserLoc");
00057 #endif
00058
00059 static const char *gDummyFile = "@@@dummy file@@@";
00060
00061 static CMString gHistoryLocs(100, "P_BrowserLocs");
00062
00063 static void *sFolderIcon;
00064 static void *sFolderUnknownIcon;
00065 static void *sFolderIgnoredIcon;
00066 static void *sFolderMissingIcon;
00067
00068 enum
00069 {
00070     kIconFolderClosed,
00071     kIconFolderOpened,
00072     kIconFolderCVSClosed,
00073     kIconFolderCVSOpened,
00074     kIconFolderIgnoreClosed,
00075     kIconFolderIgnoreOpened,
00076     kIconFolderIgnoreLost
00077 };
00078
00079 UIMPLEMENT_DYNAMIC(UCvsFolders, UWidget)
00080
00081 UBEGIN_MESSAGE_MAP(UCvsFolders, UWidget)
00082     ON_UUPDATECMD(cmdUPDATE, UCvsFolders::OnCmdUIUpdate)
00083     ON_UUPDATECMD(cmdCOMMIT, UCvsFolders::OnCmdUIUpdate)
00084     ON_UUPDATECMD(cmdDIFF, UCvsFolders::OnCmdUIUpdate)
00085     ON_UUPDATECMD(cmdEDIT, UCvsFolders::OnCmdUIUpdate)
00086     ON_UUPDATECMD(cmdEDITORS, UCvsFolders::OnCmdUIUpdate)
00087     ON_UUPDATECMD(cmdLOCKF, UCvsFolders::OnCmdUIUpdate)
00088     ON_UUPDATECMD(cmdLOG, UCvsFolders::OnCmdUIUpdate)
00089     ON_UUPDATECMD(cmdRELEASE, UCvsFolders::OnCmdUIUpdate)
00090     ON_UUPDATECMD(cmdSTATUS, UCvsFolders::OnCmdUIUpdate)
00091     ON_UUPDATECMD(cmdUNEDIT, UCvsFolders::OnCmdUIUpdate)
00092     ON_UUPDATECMD(cmdUPDATE, UCvsFolders::OnCmdUIUpdate)
00093     ON_UUPDATECMD(cmdQUERYUPDATE, UCvsFolders::OnCmdUIUpdate)
00094     ON_UUPDATECMD(cmdUNLOCKF, UCvsFolders::OnCmdUIUpdate)
00095     ON_UUPDATECMD(cmdWATCHERS, UCvsFolders::OnCmdUIUpdate)
00096     ON_UUPDATECMD(cmdWATCHON, UCvsFolders::OnCmdUIUpdate)
00097     ON_UUPDATECMD(cmdWATCHOFF, UCvsFolders::OnCmdUIUpdate)
00098     ON_UUPDATECMD(cmdTAGNEW, UCvsFolders::OnCmdUIUpdate)
00099     ON_UUPDATECMD(cmdTAGDELETE, UCvsFolders::OnCmdUIUpdate)
00100     ON_UUPDATECMD(cmdTAGBRANCH, UCvsFolders::OnCmdUIUpdate)
00101     ON_UUPDATECMD(cmdADD, UCvsFolders::OnCmdUIAdd)
00102     ON_UUPDATECMD(cmdEXPLORE, UCvsFolders::OnCmdUIExplore)
00103     ON_UUPDATECMD(cmdRELOAD, UCvsFolders::OnCmdUIReload)
00104     ON_UUPDATECMD(cmdIGNORE, UCvsFolders::OnCmdUIIgnore)
00105     ON_UUPDATECMD(cmdCHECKOUT, UCvsFolders::OnCmdUICheckout)
00106     ON_UUPDATECMD(cmdIMPORT, UCvsFolders::OnCmdUIImport)
00107     ON_UUPDATECMD_RANGE(cmdSELMACRO, cmdSELMACROEND, UCvsFolders::OnCmdUIMacrosSel)
00108     ON_UDESTROY(UCvsFolders)
00109     ON_UCREATE(UCvsFolders)
00110     ON_TREE_EXPANDING(kUMainWidget, UCvsFolders::OnTreeExpanding)
00111     ON_TREE_SELECTING(kUMainWidget, UCvsFolders::OnTreeSelecting)
00112     ON_UCOMMAND(cmdUPDATE, UCvsFolders::OnCmdUpdate)
00113     ON_UCOMMAND(cmdADD, UCvsFolders::OnCmdAdd)
00114     ON_UCOMMAND(cmdCOMMIT, UCvsFolders::OnCmdCommit)
00115     ON_UCOMMAND(cmdQUERYUPDATE, UCvsFolders::OnCmdQueryUpdate)
00116     ON_UCOMMAND(cmdDIFF, UCvsFolders::OnCmdDiff)
00117     ON_UCOMMAND(cmdLOG, UCvsFolders::OnCmdLog)
00118     ON_UCOMMAND(cmdSTATUS, UCvsFolders::OnCmdStatus)
00119     ON_UCOMMAND(cmdLOCKF, UCvsFolders::OnCmdLock)
00120     ON_UCOMMAND(cmdUNLOCKF, UCvsFolders::OnCmdUnlock)
00121     ON_UCOMMAND(cmdWATCHON, UCvsFolders::OnCmdWatchOn)
00122     ON_UCOMMAND(cmdWATCHOFF, UCvsFolders::OnCmdWatchOff)
00123     ON_UCOMMAND(cmdEDIT, UCvsFolders::OnCmdEdit)
00124     ON_UCOMMAND(cmdUNEDIT, UCvsFolders::OnCmdUnedit)
00125     ON_UCOMMAND(cmdWATCHERS, UCvsFolders::OnCmdWatchers)
00126     ON_UCOMMAND(cmdEDITORS, UCvsFolders::OnCmdEditors)
00127     ON_UCOMMAND(cmdRELEASE, UCvsFolders::OnCmdRelease)
00128     ON_UCOMMAND(cmdTAGNEW, UCvsFolders::OnCmdTagNew)
00129     ON_UCOMMAND(cmdTAGDELETE, UCvsFolders::OnCmdTagDelete)
00130     ON_UCOMMAND(cmdTAGBRANCH, UCvsFolders::OnCmdTagBranch)
00131     ON_UCOMMAND(cmdEXPLORE, UCvsFolders::OnCmdExplore)
00132     ON_UCOMMAND(cmdRELOAD, UCvsFolders::OnCmdReload)
00133     ON_UCOMMAND(cmdIGNORE, UCvsFolders::OnCmdIgnore)
00134     ON_UCOMMAND(cmdCHECKOUT, UCvsFolders::OnCmdCheckout)
00135     ON_UCOMMAND(cmdIMPORT, UCvsFolders::OnCmdImport)
00136     ON_UCOMMAND_RANGE(cmdSELMACRO, cmdSELMACROEND, UCvsFolders::OnCmdMacrosSel)
00137 UEND_MESSAGE_MAP()
00138
00139 #if 0
00140     ON_WM_RBUTTONDOWN() // TODO
00141 #endif
00142
00143 static bool sTemporaryTurnOffNotify = false;
00144
00145 class CTempToggleBool
00146 {
00147 public:
00148     CTempToggleBool(bool & value) : m_value(value), m_didSetIt(false)
00149     {
00150         if(!m_value)
00151         {
00152             m_didSetIt = true;
00153             m_value = true;
00154         }
00155     }
00156
00157     ~CTempToggleBool()
00158     {
00159         if(m_didSetIt)
00160             m_value = false;
00161     }
00162 protected:
00163     bool & m_value;
00164     bool m_didSetIt;
00165 };
00166
00167 static void *GetIcon(UCvsFolders *treeCrtl, UTREEITEM item, bool hasCvsInfos, bool expand, EntnodeData *data)
00168 {
00169     int newImage;
00170     void *result = 0L;
00171
00172     if(data == 0L)
00173     {
00174         if(expand)
00175             newImage = hasCvsInfos ? kIconFolderCVSOpened : kIconFolderOpened;
00176         else
00177             newImage = hasCvsInfos ? kIconFolderCVSClosed : kIconFolderClosed;
00178     }
00179     else
00180     {
00181         if(expand)
00182         {
00183             if(data->IsIgnored())
00184                 newImage = kIconFolderIgnoreOpened;
00185             else if(data->IsUnknown())
00186                 newImage = kIconFolderOpened;
00187             else if(data->IsMissing())
00188                 newImage = kIconFolderIgnoreLost;
00189             else
00190                 newImage = kIconFolderCVSOpened;
00191         }
00192         else
00193         {
00194             if(data->IsIgnored())
00195                 newImage = kIconFolderIgnoreClosed;
00196             else if(data->IsUnknown())
00197                 newImage = kIconFolderClosed;
00198             else if(data->IsMissing())
00199                 newImage = kIconFolderIgnoreLost;
00200             else
00201                 newImage = kIconFolderCVSClosed;
00202         }
00203     }
00204
00205 #if qGTK
00206     void *pixmap = 0L;
00207     switch(newImage)
00208     {
00209     case kIconFolderClosed:
00210     case kIconFolderOpened:
00211         pixmap = sFolderUnknownIcon;
00212         break;
00213     case kIconFolderCVSClosed:
00214     case kIconFolderCVSOpened:
00215         pixmap = sFolderIcon;
00216         break;
00217     case kIconFolderIgnoreClosed:
00218     case kIconFolderIgnoreOpened:
00219         pixmap = sFolderIgnoredIcon;
00220         break;
00221     case kIconFolderIgnoreLost:
00222         pixmap = sFolderMissingIcon;
00223         break;
00224     }
00225     if(pixmap != 0L)
00226     {
00227         result = gtk_pixmap_new (GTK_PIXMAP(pixmap)->pixmap, GTK_PIXMAP(pixmap)->mask);
00228     }
00229 #endif
00230
00231     return result;
00232 }
00233
00234 // regarding a path and a root item, create an
00235 // item with a dummy item inside if and only if
00236 // the folder is not empty.
00237 class TBrowserFillDummy : public TraversalReport
00238 {
00239 public:
00240     UTREEITEM   m_root;
00241     UTREEITEM   m_item;
00242     UCvsFolders *m_treeCtrl;
00243     bool        m_empty;
00244     bool        m_hascvs;
00245     EntnodeData *m_data;
00246     UStr        m_dirname;
00247
00248     TBrowserFillDummy(UCvsFolders *treeCtrl, UTREEITEM root, UTREEITEM item, EntnodeData *data) :
00249         m_root(root), m_item(item), m_treeCtrl(treeCtrl), m_empty(true),
00250         m_hascvs(false), m_data(data) {}
00251
00252     virtual ~TBrowserFillDummy() {}
00253
00254     virtual kTraversal EnterDirectory(const char *fullpath, const char *dirname, const FSSpec * macspec)
00255     {
00256         m_dirname = dirname;
00257 #if qUnix
00258         if(m_dirname.empty())
00259             m_dirname = fullpath; // '/'
00260 #endif
00261         return kContinueTraversal;
00262     }
00263
00264     virtual kTraversal ExitDirectory(const char *fullpath)
00265     {
00266         if(m_item == 0L)
00267         {
00268             UTREE_INSERT insert;
00269             insert.parent = m_root;
00270             insert.icon = GetIcon(m_treeCtrl, m_item, m_hascvs, false, m_data);
00271             insert.title = m_dirname;
00272             insert.data = 0L;
00273             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_INSERT, kUMainWidget, &insert);
00274             m_item = insert.result;
00275         }
00276
00277         // assign the entries to this item
00278         UTREE_INFO query;
00279         query.item = m_item;
00280         if(m_data != 0L)
00281         {
00282             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00283             EntnodeData *data = (EntnodeData *)query.data;
00284
00285             if(m_data != 0L)
00286                 m_data->Ref();
00287
00288             query.data = m_data;
00289             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_SETDATA, kUMainWidget, &query);
00290
00291             if(data != 0L)
00292                 data->UnRef();
00293         }
00294         else
00295         {
00296             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00297             m_data = (EntnodeData *)query.data;
00298         }
00299
00300         if(m_empty)
00301             return kContinueTraversal;
00302
00303         // add a dummy item to simulate the folder
00304         // is not empty. This dummy item will be
00305         // replaced by a complete listing when the
00306         // node is expanding...
00307
00308         UTREE_INSERT insert;
00309         insert.parent = m_item;
00310         insert.icon = 0L;
00311         insert.title = gDummyFile;
00312         insert.data = 0L;
00313         UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_INSERT, kUMainWidget, &insert);
00314
00315         return kContinueTraversal;
00316     }
00317
00318     virtual kTraversal OnError(const char *err, int errcode)
00319     {
00320         return kTraversalError;
00321     }
00322
00323     virtual kTraversal OnIdle(const char *fullpath)
00324     {
00325         return kContinueTraversal;
00326     }
00327
00328     virtual kTraversal OnDirectory(const char *fullpath,
00329         const char *fullname,
00330         const char *name,
00331         const struct stat & dir, const FSSpec * macspec)
00332     {
00333 #if qUnix
00334         if(strcmp(name, "CVS") == 0)
00335 #else
00336         if(stricmp(name, "cvs") == 0)
00337 #endif
00338             m_hascvs = true;
00339         else
00340             m_empty = false;
00341
00342         return kSkipFile;
00343     }
00344 };
00345
00346 // regarding a path and a root item, create an
00347 // item with all the subdirectories inside.
00348 class TBrowserFill : public TraversalReport
00349 {
00350 public:
00351     UTREEITEM m_root;
00352     UTREEITEM m_item;
00353     UCvsFolders *m_treeCtrl;
00354     CSortList<ENTNODE> & m_entries;
00355     std::vector<UStr> m_ignlist;
00356
00357     TBrowserFill(UCvsFolders *treeCtrl, UTREEITEM root, UTREEITEM item, CSortList<ENTNODE> & entries) :
00358             m_root(root), m_item(item), m_treeCtrl(treeCtrl),
00359             m_entries(entries) {}
00360
00361     virtual ~TBrowserFill() {}
00362
00363     virtual kTraversal EnterDirectory(const char *fullpath, const char *dirname, const FSSpec * macspec)
00364     {
00365         ASSERT(m_item != 0L);
00366
00367         // assign the entries to this item
00368         Entries_Open (m_entries, fullpath);
00369         BuildIgnoredList(m_ignlist, fullpath);
00370
00371         return kContinueTraversal;
00372     }
00373
00374     virtual kTraversal ExitDirectory(const char *fullpath)
00375     {
00376         m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00377
00378         UTREE_INFO query;
00379         query.item = m_item;
00380         UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00381         query.icon = GetIcon(m_treeCtrl, m_item, true /*ignored*/, true, (EntnodeData *)query.data);
00382         UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_SETICON, kUMainWidget, &query);
00383
00384         return kContinueTraversal;
00385     }
00386
00387     virtual kTraversal OnError(const char *err, int errcode)
00388     {
00389         return kTraversalError;
00390     }
00391
00392     virtual kTraversal OnIdle(const char *fullpath)
00393     {
00394         return kContinueTraversal;
00395     }
00396
00397     virtual kTraversal OnDirectory(const char *fullpath,
00398         const char *fullname,
00399         const char *name,
00400         const struct stat & dir, const FSSpec * macspec)
00401     {
00402 #if qUnix
00403         if(strcmp(name, "CVS") == 0)
00404 #else
00405         if(stricmp(name, "cvs") == 0)
00406 #endif
00407             return kSkipFile;
00408
00409         // is the sub-directory ignored ?
00410         EntnodeData *data = Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00411         if(!(bool)gFileViewIgnore && data->IsIgnored())
00412             return kSkipFile;
00413
00414         // create the item for the sub-directory
00415         TBrowserFillDummy traverse(m_treeCtrl, m_item, 0L, data);
00416         /*kTraversal res = */FileTraverse(fullname, traverse);
00417
00418         // assign the icon regarding our Entries info
00419         if(traverse.m_item != 0L)
00420         {
00421             UTREE_INFO query;
00422             query.item = traverse.m_item;
00423             query.icon = GetIcon(m_treeCtrl, m_item, true /*ignored*/, false, data);
00424             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_SETICON, kUMainWidget, &query);
00425         }
00426
00427         return kSkipFile;
00428     }
00429 };
00430
00431 UCvsFolders::UCvsFolders() : UWidget(kUCvsFoldersID)
00432 {
00433 }
00434
00435 UCvsFolders::~UCvsFolders()
00436 {
00437 }
00438
00439 void UCvsFolders::OnDestroy(void)
00440 {
00441     delete this;
00442 }
00443
00444 void UCvsFolders::OnCreate(void)
00445 {
00446     if(sFolderIcon == 0L)
00447     {
00448         sFolderIcon = UCreate_pixmap(this, "folder.xpm");
00449         sFolderUnknownIcon = UCreate_pixmap(this, "foldunk.xpm");
00450         sFolderIgnoredIcon = UCreate_pixmap(this, "foldign.xpm");
00451         sFolderMissingIcon = UCreate_pixmap(this, "foldmiss.xpm");
00452     }
00453
00454     UStr newpath;
00455     newpath = (const char *)gOldLoc;
00456     if(newpath.empty())
00457         newpath = gCvsPrefs.Home();
00458
00459     // set the initial root
00460     ResetBrowser(newpath, true);
00461 }
00462
00463 void UCvsFolders::ResetBrowser(const char *path, bool notifyView)
00464 {
00465     UWaitCursor wait;
00466
00467     DeleteAllItems();
00468     bool isReload = path != 0L && !m_root.empty() && stricmp(m_root, path) == 0;
00469
00470     m_root = path;
00471
00472     if(path == 0L)
00473         return;
00474
00475     if(!isReload)
00476     {
00477         if(HasPersistentSettings(m_root))
00478             LoadPersistentSettings(m_root);
00479         else
00480         {
00481             // check if the path has a CVS folder. If not,
00482             // we don't want the user to be prompted (like when
00483             // WinCvs is starting for the first time).
00484             UStr cvsFolder(m_root);
00485             if(!cvsFolder.endsWith(kPathDelimiter))
00486                 cvsFolder << kPathDelimiter;
00487             cvsFolder << "CVS";
00488             struct stat sb;
00489             if (stat(cvsFolder, &sb) != -1 && S_ISDIR(sb.st_mode))
00490                 AskCreatePersistentSettings(m_root);
00491         }
00492     }
00493
00494     if(stricmp(gOldLoc, m_root) != 0)
00495         gOldLoc = m_root;
00496
00497     // update the history combo
00498     gHistoryLocs.Insert(m_root);
00499     UEventSendMessage(kUCvsFrameID, EV_COMBO_RESETALL, UCvsFrame::kDirCombo, 0L);
00500     const std::vector<UStr> & list = gHistoryLocs.GetList();
00501     std::vector<UStr>::const_iterator i;
00502     int pos = 0;
00503     for(i = list.begin(); i != list.end(); ++i, pos++)
00504     {
00505         UEventSendMessage(kUCvsFrameID, EV_COMBO_APPEND,
00506                           UCvsFrame::kDirCombo, (void *)(const char *)*i);
00507     }
00508     UEventSendMessage(kUCvsFrameID, EV_COMBO_SETSEL, UMAKEINT(UCvsFrame::kDirCombo, 0), 0L);
00509
00510     // fill the browser
00511     TBrowserFillDummy traverse(this, 0L, 0L, 0L);
00512     /*kTraversal res = */FileTraverse(m_root, traverse);
00513
00514     if(traverse.m_item != 0L)
00515     {
00516         UEventSendMessage(GetWidID(), EV_TREE_EXPAND, UMAKEINT(kUMainWidget, 0), traverse.m_item);
00517         if(notifyView && UCvsApp::gApp->GetFilesView())
00518             UCvsApp::gApp->GetFilesView()->ResetView(path);
00519     }
00520 }
00521
00522 void UCvsFolders::ResetView(bool forceReload, bool notifyView)
00523 {
00524     UWaitCursor doWait;
00525
00526     std::vector<UStr> allExpanded;
00527     StoreExpanded(allExpanded);
00528
00529     bool contentChanged = false;
00530     UStr selPath;
00531     UTREEITEM selItem;
00532     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &selItem);
00533     if(selItem != 0L)
00534         RetrievePath(selItem, selPath);
00535
00536     if(forceReload)
00537     {
00538         ResetBrowser(m_root);
00539         contentChanged = true;
00540     }
00541
00542     if(contentChanged)
00543     {
00544         // restore the expanded paths and the selected item
00545         std::vector<UStr>::const_iterator i;
00546         for(i = allExpanded.begin(); i != allExpanded.end(); ++i)
00547         {
00548             StepToLocation(*i);
00549         }
00550         if(!selPath.empty())
00551         {
00552             selItem = GetItemByLocation(selPath);
00553             if(selItem != 0L)
00554                 UEventSendMessage(GetWidID(), EV_TREE_SELECT, UMAKEINT(kUMainWidget, 0), selItem);
00555         }
00556     }
00557
00558     // we don't need to notify the file view if we force the reload
00559     // because that's already done
00560     if(notifyView)
00561     {
00562         UCvsApp::gApp->GetFilesView()->ResetView(forceReload);
00563     }
00564     UEventSendMessage(GetWidID(), EV_CHGFOCUS, kUMainWidget, 0L);
00565 }
00566
00567 void UCvsFolders::StoreExpanded(std::vector<UStr> & allExpanded, UTREEITEM root)
00568 {
00569     UTREE_INFO query;
00570     query.item = root;
00571     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00572
00573     UTREEITEM item = query.item;
00574     if(item == 0L)
00575         return;
00576
00577     if(query.expanded)
00578     {
00579         UStr path;
00580         RetrievePath(item, path);
00581         allExpanded.push_back(path);
00582     }
00583
00584     UTREEITEM childItem = query.child;
00585
00586     while(childItem != 0L)
00587     {
00588         StoreExpanded(allExpanded, childItem);
00589         query.item = childItem;
00590         UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00591         childItem = query.next;
00592     }
00593 }
00594
00595 void UCvsFolders::StepToLocation(const char *path, bool notifyView)
00596 {
00597     UStr root(m_root);
00598     if(!root.endsWith(kPathDelimiter))
00599         root << kPathDelimiter;
00600     UStr subpath(path);
00601     if(!subpath.endsWith(kPathDelimiter))
00602         subpath << kPathDelimiter;
00603
00604     // check if it is a sub-path
00605     if(strncmp(root, subpath, root.length()) != 0)
00606         return;
00607
00608     UTREE_INFO query;
00609     query.item = 0L;
00610     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00611
00612     UTREEITEM item = query.item;
00613     UTREEITEM lastitem = 0L;
00614     if(item == 0L)
00615         return;
00616
00617     // step inside synchronized
00618     const char *tmp = (const char *)subpath + root.length() - 1;
00619     while((tmp = strchr(tmp, kPathDelimiter)) != 0L)
00620     {
00621         const char *name = ++tmp;
00622         if(name[0] == '\0')
00623             break;
00624
00625         UStr subname;
00626         const char *tmp2 = strchr(name, kPathDelimiter);
00627         if(tmp2 == 0L)
00628             subname = name;
00629         else
00630             subname.set(name, tmp2 - name);
00631
00632         query.item = item;
00633         UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00634         UTREEITEM childItem = query.child;
00635
00636         // find the subitem which matches this name
00637         while(childItem != 0L)
00638         {
00639             query.item = childItem;
00640             UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00641             EntnodeData *data = (EntnodeData *)query.data;
00642             if(data != 0L)
00643             {
00644 #ifdef qUnix
00645                 if(strcmp((*data)[EntnodeData::kName], subname) == 0)
00646 #else
00647                 if(_stricmp((*data)[EntnodeData::kName], subname) == 0)
00648 #endif
00649                 {
00650                     // found it !
00651                     lastitem = item = childItem;
00652                     UEventSendMessage(GetWidID(), EV_TREE_EXPAND, UMAKEINT(kUMainWidget, 0), item);
00653                     break;
00654                 }
00655             }
00656
00657             childItem = query.next;
00658         }
00659     }
00660
00661     // in case this is called by the view, turn off notifying
00662     // when the item gets selected
00663     if(lastitem != 0L)
00664     {
00665         if(!notifyView)
00666         {
00667             CTempToggleBool toggler(sTemporaryTurnOffNotify);
00668             UEventSendMessage(GetWidID(), EV_TREE_SELECT, UMAKEINT(kUMainWidget, 0), lastitem);
00669         }
00670         else
00671         {
00672             UEventSendMessage(GetWidID(), EV_TREE_SELECT, UMAKEINT(kUMainWidget, 0), lastitem);
00673         }
00674     }
00675 }
00676
00677 UTREEITEM UCvsFolders::GetItemByLocation(const char *path)
00678 {
00679     UStr root(m_root);
00680     if(!root.endsWith(kPathDelimiter))
00681         root << kPathDelimiter;
00682     UStr subpath(path);
00683     if(!subpath.endsWith(kPathDelimiter))
00684         subpath << kPathDelimiter;
00685
00686     // check if it is a sub-path
00687     if(strncmp(root, subpath, root.length()) != 0)
00688         return 0L;
00689
00690     UTREE_INFO query;
00691     query.item = 0L;
00692     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00693     UTREEITEM item = query.item;
00694     if(item == 0L)
00695         return 0L;
00696
00697     // step inside synchronized
00698     const char *tmp = (const char *)subpath + root.length() - 1;
00699     while((tmp = strchr(tmp, kPathDelimiter)) != 0L)
00700     {
00701         const char *name = ++tmp;
00702         if(name[0] == '\0')
00703             break;
00704
00705         CStr subname;
00706         const char *tmp2 = strchr(name, kPathDelimiter);
00707         if(tmp2 == 0L)
00708             subname = name;
00709         else
00710             subname.set(name, tmp2 - name);
00711
00712         UTREEITEM childItem = query.child;
00713
00714         // find the subitem which matches this name
00715         while(childItem != 0L)
00716         {
00717             query.item = childItem;
00718             UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00719             EntnodeData *data = (EntnodeData *)query.data;
00720             if(data != 0L)
00721             {
00722 #if qUnix
00723                 if(strcmp((*data)[EntnodeData::kName], subname) == 0)
00724 #else
00725                 if(_stricmp((*data)[EntnodeData::kName], subname) == 0)
00726 #endif
00727                 {
00728                     item = childItem;
00729                     break;
00730                 }
00731             }
00732
00733             childItem = query.next;
00734         }
00735         if(childItem == 0L)
00736             return 0L;
00737     }
00738
00739     return item;
00740 }
00741
00742 void UCvsFolders::OnTreeExpanding(int collapse, UTREEITEM item)
00743 {
00744     // many situations make that we enter here twice. Fortunately enough
00745     // we only dare the first signal.
00746     static bool sSemaphore = false;
00747     USemaphore policeman(sSemaphore);
00748     if(policeman.IsEnteredTwice())
00749         return;
00750
00751     UWaitCursor wait;
00752
00753     UTREE_INFO query;
00754     query.item = item;
00755     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00756     EntnodeData *data = (EntnodeData *)query.data;
00757
00758     // we refuse to expand in this case cause the folder is not really here
00759     if(data != 0L && data->IsMissing())
00760     {
00761         UEventSendMessage(GetWidID(), EV_TREE_EXPAND, UMAKEINT(kUMainWidget, 1), item);
00762         return;
00763     }
00764
00765     // erase all the childs
00766     DeleteAllItems(item);
00767
00768     UStr path;
00769     RetrievePath(item, path);
00770
00771     if(collapse)
00772     {
00773         TBrowserFillDummy traverse(this, 0L, item, 0L);
00774         /*kTraversal res = */FileTraverse(path, traverse);
00775     }
00776     else
00777     {
00778         CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00779         TBrowserFill traverse(this, 0L, item, entries);
00780         /*kTraversal res = */FileTraverse(path, traverse);
00781
00782 #if qGTK
00783         // gtk is closing the tree when we removed everything in it
00784         UEventSendMessage(GetWidID(), EV_TREE_EXPAND, UMAKEINT(kUMainWidget, 0), item);
00785 #endif
00786
00787         // add the missing folders
00788         Entries_SetMissing(entries);
00789         int numEntries = entries.NumOfElements();
00790         for(int i = 0; i < numEntries; i++)
00791         {
00792             const ENTNODE & theNode = entries.Get(i);
00793             EntnodeData *data = ((ENTNODE *)&theNode)->Data();
00794             if(!data->IsMissing() || data->GetType() != ENT_SUBDIR)
00795                 continue;
00796
00797             UTREE_INSERT insert;
00798             insert.parent = item;
00799             insert.icon = GetIcon(this, item, false, false, data->Ref());
00800             insert.title = (*data)[EntnodeData::kName];
00801             insert.data = data;
00802             UEventSendMessage(GetWidID(), EV_TREE_INSERT, kUMainWidget, &insert);
00803         }
00804     }
00805 }
00806
00807 void UCvsFolders::OnTreeSelecting(int deselect, UTREEITEM item)
00808 {
00809     if(deselect)
00810         return;
00811
00812     UTREE_INFO query;
00813     query.item = item;
00814     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00815     EntnodeData *data = (EntnodeData *)query.data;
00816     if(data != 0L && data->IsMissing())
00817         return;
00818
00819     if(!sTemporaryTurnOffNotify)
00820     {
00821         UStr path;
00822         RetrievePath(item, path);
00823         UCvsFiles *fileView = (UCvsFiles *)UEventQueryWidget(kUCvsFilesID);
00824         if(fileView != 0L)
00825         {
00826             ASSERT(fileView->IsKindOf(URUNTIME_CLASS(UCvsFiles)));
00827             fileView->ResetView(path);
00828         }
00829     }
00830
00831 }
00832
00833 void UCvsFolders::SetDefaultRoot(const char *root)
00834 {
00835     struct stat sb;
00836
00837     if (stat(root, &sb) == -1 || !S_ISDIR(sb.st_mode))
00838     {
00839         cvs_err("Cannot access directory '%s' (error %d)\n", root, errno);
00840         return;
00841     }
00842
00843     gOldLoc = root;
00844 }
00845
00846 void UCvsFolders::RetrievePath(UTREEITEM item, UStr & path)
00847 {
00848     UStr tmp, newPath;
00849     path = "";
00850
00851     do
00852     {
00853         UTREE_INFO query;
00854         query.item = item;
00855         UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00856
00857         item = query.parent;
00858
00859         tmp = path;
00860         newPath = item == 0L ? (const char *)m_root : query.title;
00861         if(!newPath.endsWith(kPathDelimiter))
00862             newPath << kPathDelimiter;
00863         newPath << path;
00864         path = newPath;
00865     } while(item != 0L);
00866 }
00867
00868 void UCvsFolders::DeleteAllItems(UTREEITEM root = 0L)
00869 {
00870     // we don't want the file view to be notified when things get deleted
00871     CTempToggleBool toggler(sTemporaryTurnOffNotify);
00872
00873     UTREE_INFO query;
00874     bool eraseRoot = false;
00875     query.item = root;
00876     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00877     if(root == 0L)
00878     {
00879         root = query.item;
00880         eraseRoot = true;
00881     }
00882
00883     if(root == 0L)
00884         return;
00885
00886     UTREEITEM childItem = query.child;
00887
00888     // erase all the childs
00889     while(childItem != 0L)
00890     {
00891         UTREE_INFO queryChild;
00892         queryChild.item = childItem;
00893         UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &queryChild);
00894
00895         EntnodeData *data = (EntnodeData *)queryChild.data;
00896         if(data != 0L)
00897         {
00898             queryChild.data = 0L; // So that subsequent references after UnRef() won't SEGV
00899             UEventSendMessage(GetWidID(), EV_TREE_SETDATA, kUMainWidget, &queryChild);
00900             data->UnRef();  // Or move this one after DeleteAllItems? so we don't loose one system call. For now, safe way
00901         }
00902
00903         DeleteAllItems(childItem);
00904
00905         UEventSendMessage(GetWidID(), EV_TREE_DELETE, kUMainWidget, childItem);
00906         childItem = queryChild.next;
00907     }
00908
00909     // erase the root only if initially root was 0L
00910     if(eraseRoot)
00911     {
00912         EntnodeData *data = (EntnodeData *)query.data;
00913         ASSERT(data == 0L);
00914
00915         UEventSendMessage(GetWidID(), EV_TREE_DELETE, kUMainWidget, root);
00916     }
00917 }
00918
00919 bool UCvsFolders::DisableGeneric()
00920 {
00921     UCvsApp *app = UCvsApp::gApp;
00922     return app->IsCvsRunning() || gCvsPrefs.empty() || !HasFocus();
00923 }
00924
00925 void UCvsFolders::OnUpdateGeneric(UCmdUI* pCmdUI, bool needCvsInfos)
00926 {
00927     if(DisableGeneric())
00928     {
00929         pCmdUI->Enable(false);
00930         return;
00931     }
00932
00933     UTREEITEM *item;
00934     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
00935     if(item == 0L)
00936     {
00937         pCmdUI->Enable(false);
00938         return;
00939     }
00940
00941     UStr path;
00942     RetrievePath(item, path);
00943     if(!path.endsWith(kPathDelimiter))
00944         path << kPathDelimiter;
00945     path << "CVS";
00946
00947     struct stat sb;
00948     if (stat(path, &sb) == -1 || !S_ISDIR(sb.st_mode))
00949         pCmdUI->Enable(!needCvsInfos);
00950     else
00951         pCmdUI->Enable(needCvsInfos);
00952 }
00953
00954 int UCvsFolders::OnCmdUpdate(void)
00955 {
00956     UTREEITEM *item;
00957     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
00958     ASSERT(item != 0L);
00959
00960     UStr path;
00961     RetrievePath(item, path);
00962     CvsCmdUpdateFolder(path);
00963     return 0;
00964 }
00965
00966 void UCvsFolders::OnCmdUIUpdate(UCmdUI *pCmdUI)
00967 {
00968     OnUpdateGeneric(pCmdUI, true);
00969 }
00970
00971 int UCvsFolders::OnCmdAdd(void)
00972 {
00973     UTREEITEM *item;
00974     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
00975     ASSERT(item != 0L);
00976
00977     UStr path;
00978     RetrievePath(item, path);
00979     CvsCmdAddFolder(path);
00980     return 0;
00981 }
00982
00983 int UCvsFolders::OnCmdCommit(void)
00984 {
00985     UTREEITEM *item;
00986     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
00987     ASSERT(item != 0L);
00988
00989     UStr path;
00990     RetrievePath(item, path);
00991     CvsCmdCommitFolder(path);
00992     return 0;
00993 }
00994
00995 int UCvsFolders::OnCmdQueryUpdate(void)
00996 {
00997     UTREEITEM *item;
00998     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
00999     ASSERT(item != 0L);
01000
01001     UStr path;
01002     RetrievePath(item, path);
01003     CvsCmdUpdateFolder(path, true);
01004     return 0;
01005 }
01006
01007 int UCvsFolders::OnCmdDiff(void)
01008 {
01009     UTREEITEM *item;
01010     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01011     ASSERT(item != 0L);
01012
01013     UStr path;
01014     RetrievePath(item, path);
01015     CvsCmdDiffFolder(path);
01016     return 0;
01017 }
01018
01019 int UCvsFolders::OnCmdLog(void)
01020 {
01021     UTREEITEM *item;
01022     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01023     ASSERT(item != 0L);
01024
01025     UStr path;
01026     RetrievePath(item, path);
01027     CvsCmdLogFolder(path);
01028     return 0;
01029 }
01030
01031 int UCvsFolders::OnCmdStatus(void)
01032 {
01033     UTREEITEM *item;
01034     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01035     ASSERT(item != 0L);
01036
01037     UStr path;
01038     RetrievePath(item, path);
01039     CvsCmdStatusFolder(path);
01040     return 0;
01041 }
01042
01043 int UCvsFolders::OnCmdLock(void)
01044 {
01045     UTREEITEM *item;
01046     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01047     ASSERT(item != 0L);
01048
01049     UStr path;
01050     RetrievePath(item, path);
01051     CvsCmdLockFolder(path);
01052     return 0;
01053 }
01054
01055 int UCvsFolders::OnCmdUnlock(void)
01056 {
01057     UTREEITEM *item;
01058     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01059     ASSERT(item != 0L);
01060
01061     UStr path;
01062     RetrievePath(item, path);
01063     CvsCmdUnlockFolder(path);
01064     return 0;
01065 }
01066
01067 int UCvsFolders::OnCmdWatchOn(void)
01068 {
01069     UTREEITEM *item;
01070     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01071     ASSERT(item != 0L);
01072
01073     UStr path;
01074     RetrievePath(item, path);
01075     CvsCmdWatchOnFolder(path);
01076     return 0;
01077 }
01078
01079 int UCvsFolders::OnCmdWatchOff(void)
01080 {
01081     UTREEITEM *item;
01082     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01083     ASSERT(item != 0L);
01084
01085     UStr path;
01086     RetrievePath(item, path);
01087     CvsCmdWatchOffFolder(path);
01088     return 0;
01089 }
01090
01091 int UCvsFolders::OnCmdEdit(void)
01092 {
01093     UTREEITEM *item;
01094     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01095     ASSERT(item != 0L);
01096
01097     UStr path;
01098     RetrievePath(item, path);
01099     CvsCmdEditFolder(path);
01100     return 0;
01101 }
01102
01103 int UCvsFolders::OnCmdUnedit(void)
01104 {
01105     UTREEITEM *item;
01106     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01107     ASSERT(item != 0L);
01108
01109     UStr path;
01110     RetrievePath(item, path);
01111     CvsCmdUneditFolder(path);
01112     return 0;
01113 }
01114
01115 int UCvsFolders::OnCmdWatchers(void)
01116 {
01117     UTREEITEM *item;
01118     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01119     ASSERT(item != 0L);
01120
01121     UStr path;
01122     RetrievePath(item, path);
01123     CvsCmdWatchersFolder(path);
01124     return 0;
01125 }
01126
01127 int UCvsFolders::OnCmdEditors(void)
01128 {
01129     UTREEITEM *item;
01130     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01131     ASSERT(item != 0L);
01132
01133     UStr path;
01134     RetrievePath(item, path);
01135     CvsCmdEditorsFolder(path);
01136     return 0;
01137 }
01138
01139 int UCvsFolders::OnCmdRelease(void)
01140 {
01141     UTREEITEM *item;
01142     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01143     ASSERT(item != 0L);
01144
01145     UStr path;
01146     RetrievePath(item, path);
01147     CvsCmdReleaseFolder(path);
01148     return 0;
01149 }
01150
01151 int UCvsFolders::OnCmdTagNew(void)
01152 {
01153     UTREEITEM *item;
01154     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01155     ASSERT(item != 0L);
01156
01157     UStr path;
01158     RetrievePath(item, path);
01159     CvsCmdTagCreateFolder(path);
01160     return 0;
01161 }
01162
01163 int UCvsFolders::OnCmdTagDelete(void)
01164 {
01165     UTREEITEM *item;
01166     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01167     ASSERT(item != 0L);
01168
01169     UStr path;
01170     RetrievePath(item, path);
01171     CvsCmdTagDeleteFolder(path);
01172     return 0;
01173 }
01174
01175 int UCvsFolders::OnCmdTagBranch(void)
01176 {
01177     UTREEITEM *item;
01178     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01179     ASSERT(item != 0L);
01180
01181     UStr path;
01182     RetrievePath(item, path);
01183     CvsCmdTagBranchFolder(path);
01184     return 0;
01185 }
01186
01187 int UCvsFolders::OnCmdExplore(void)
01188 {
01189     UTREEITEM *item;
01190     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01191     ASSERT(item != 0L);
01192
01193     UStr path;
01194     RetrievePath(item, path);
01195
01196 #ifdef WIN32
01197     HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), "explore", path,
01198             0L, 0L, SW_SHOWDEFAULT);
01199     if((long)hInst < 32)
01200     {
01201         cvs_err("Unable to explore '%s' (error %d)\n", (const char *)path, GetLastError());
01202     }
01203 #endif
01204 #ifdef qUnix
01205     CvsArgs args(false);
01206     args.add(gCvsPrefs.Browser());
01207     args.add(path);
01208     UCvsApp::gApp->Execute(args.Argc(), args.Argv());
01209 #endif
01210
01211     return 0;
01212 }
01213
01214 int UCvsFolders::OnCmdReload(void)
01215 {
01216     ResetView(true);
01217     return 0;
01218 }
01219
01220 int UCvsFolders::OnCmdIgnore(void)
01221 {
01222     gFileViewIgnore = !(bool)gFileViewIgnore;
01223     ResetView(true, true);
01224     return 0;
01225 }
01226
01227 int UCvsFolders::OnCmdCheckout(void)
01228 {
01229     CvsCmdCheckoutModule();
01230     return 0;
01231 }
01232
01233 int UCvsFolders::OnCmdImport(void)
01234 {
01235     CvsCmdImportModule();
01236     return 0;
01237 }
01238
01239 void UCvsFolders::OnCmdUIAdd(UCmdUI *pCmdUI)
01240 {
01241     OnUpdateGeneric(pCmdUI, false);
01242 }
01243
01244 void UCvsFolders::OnCmdUIExplore(UCmdUI *pCmdUI)
01245 {
01246     if(DisableGeneric())
01247     {
01248         pCmdUI->Enable(false);
01249         return;
01250     }
01251     UTREEITEM selItem;
01252     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &selItem);
01253     pCmdUI->Enable(selItem != 0L);
01254 }
01255
01256 void UCvsFolders::OnCmdUIReload(UCmdUI *pCmdUI)
01257 {
01258     UCvsApp *app = UCvsApp::gApp;
01259     pCmdUI->Enable(!app->IsCvsRunning());
01260 }
01261
01262 void UCvsFolders::OnCmdUIIgnore(UCmdUI *pCmdUI)
01263 {
01264     pCmdUI->Enable(!DisableGeneric());
01265     pCmdUI->Check(gFileViewIgnore);
01266 }
01267
01268 void UCvsFolders::OnCmdUICheckout(UCmdUI *pCmdUI)
01269 {
01270     UCvsApp *app = UCvsApp::gApp;
01271     pCmdUI->Enable(!app->IsCvsRunning() && !gCvsPrefs.empty());
01272 }
01273
01274 void UCvsFolders::OnCmdUIImport(UCmdUI *pCmdUI)
01275 {
01276     UCvsApp *app = UCvsApp::gApp;
01277     pCmdUI->Enable(!app->IsCvsRunning() && !gCvsPrefs.empty());
01278 }
01279
01280 void UCvsFolders::OnCmdUIMacrosSel(int cmd, UCmdUI *pCmdUI)
01281 {
01282     if(DisableGeneric())
01283     {
01284         pCmdUI->Enable(false);
01285         return;
01286     }
01287     UTREEITEM selItem;
01288     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &selItem);
01289     pCmdUI->Enable(selItem != 0L && CTcl_Interp::IsAvail());
01290 }
01291
01292 int UCvsFolders::OnCmdMacrosSel(int cmd)
01293 {
01294     CTcl_Interp interp;
01295     CMacroEntry & entry = gMacrosSel.entries[cmd - cmdSELMACRO];
01296     CStr path = entry.path;
01297     CTcl_Interp::Unixfy(path);
01298
01299     UTREEITEM selItem;
01300     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &selItem);
01301
01302     CStr selPath;
01303     RetrievePath(selItem, selPath);
01304     CStr uppath, folder;
01305     SplitPath(selPath, uppath, folder);
01306
01307     UTREE_INFO query;
01308     query.item = selItem;
01309     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
01310     bool deleteData = false;
01311     EntnodeData *data = (EntnodeData *)query.data;
01312     if(data == 0L)
01313     {
01314         deleteData = true;
01315         EntnodePath *apath = new EntnodePath(uppath);
01316         data = new EntnodeFolder(folder, apath);
01317         apath->UnRef();
01318     }
01319
01320     TclBrowserReset();
01321     TclBrowserAppend(uppath, data);
01322
01323     interp.DoScriptVar("source \"%s\"", (const char *)path);
01324
01325     if(deleteData)
01326         data->UnRef();
01327
01328     return 0;
01329 }
Generated on Sun Feb 24 01:21:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UCvsFolders.h Source File

common/UCvsFolders.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 /*
00022  *
00023  */
00024
00025 #ifndef UCVSFOLDER_H
00026 #define UCVSFOLDER_H
00027
00028 #include "uwidget.h"
00029
00030 class UCvsFolders : public UWidget
00031 {
00032     UDECLARE_DYNAMIC(UCvsFolders)
00033 public:
00034     UCvsFolders();
00035     virtual ~UCvsFolders();
00036
00037     void ResetBrowser(const char *path, bool notifyView = false);
00038         // set the browser root path.
00039
00040     inline const char *GetRoot(void) const { return m_root; }
00041         // get the base of the browser
00042
00043     static void SetDefaultRoot(const char *root);
00044         // set the opening root
00045
00046     void RetrievePath(UTREEITEM item, UStr & path);
00047         // given an item of the tree, guess the full path.
00048
00049     void StepToLocation(const char *path, bool notifyView = false);
00050         // expand and select the path and optionally synchronize the
00051         // file view.
00052
00053     void DeleteAllItems(UTREEITEM root = 0L);
00054         // used when resetting and take care about our item data
00055         // if root != 0L : delete all childs of root (except root)
00056         // if root == 0L : delete all
00057
00058     void ResetView(bool forceReload = false, bool notifyView = false);
00059         // force reload or check modifications before redrawing
00060         // and optionally synchronize the file view.
00061 protected:
00062     UStr m_root;
00063         // current path of the browser
00064
00065     void OnUpdateGeneric(UCmdUI* pCmdUI, bool needCvsInfos);
00066     bool DisableGeneric();
00067         // used for the handling of EV_UPDTCMD
00068
00069     void StoreExpanded(std::vector<UStr> & allExpanded, UTREEITEM root = 0L);
00070     UTREEITEM GetItemByLocation(const char *path);
00071         // used internally
00072
00073     ev_msg void OnDestroy();
00074     ev_msg void OnCreate();
00075     ev_msg void OnTreeExpanding(int collapse, UTREEITEM item);
00076     ev_msg void OnTreeSelecting(int deselect, UTREEITEM item);
00077     ev_msg void OnCmdUIMacrosSel(int cmd, UCmdUI *pCmdUI);
00078     ev_msg void OnCmdUIUpdate(UCmdUI *pCmdUI);
00079     ev_msg void OnCmdUIAdd(UCmdUI *pCmdUI);
00080     ev_msg void OnCmdUIExplore(UCmdUI *pCmdUI);
00081     ev_msg void OnCmdUIReload(UCmdUI *pCmdUI);
00082     ev_msg void OnCmdUIIgnore(UCmdUI *pCmdUI);
00083     ev_msg void OnCmdUICheckout(UCmdUI *pCmdUI);
00084     ev_msg void OnCmdUIImport(UCmdUI *pCmdUI);
00085     ev_msg int OnCmdUpdate(void);
00086     ev_msg int OnCmdAdd(void);
00087     ev_msg int OnCmdCommit(void);
00088     ev_msg int OnCmdQueryUpdate(void);
00089     ev_msg int OnCmdDiff(void);
00090     ev_msg int OnCmdLog(void);
00091     ev_msg int OnCmdStatus(void);
00092     ev_msg int OnCmdLock(void);
00093     ev_msg int OnCmdUnlock(void);
00094     ev_msg int OnCmdWatchOn(void);
00095     ev_msg int OnCmdWatchOff(void);
00096     ev_msg int OnCmdEdit(void);
00097     ev_msg int OnCmdUnedit(void);
00098     ev_msg int OnCmdWatchers(void);
00099     ev_msg int OnCmdEditors(void);
00100     ev_msg int OnCmdRelease(void);
00101     ev_msg int OnCmdTagNew(void);
00102     ev_msg int OnCmdTagDelete(void);
00103     ev_msg int OnCmdTagBranch(void);
00104     ev_msg int OnCmdExplore(void);
00105     ev_msg int OnCmdReload(void);
00106     ev_msg int OnCmdIgnore(void);
00107     ev_msg int OnCmdCheckout(void);
00108     ev_msg int OnCmdImport(void);
00109     ev_msg int OnCmdMacrosSel(int cmd);
00110
00111     UDECLARE_MESSAGE_MAP()
00112 };
00113
00114 #endif
Generated on Sun Feb 24 01:21:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UCvsFrame.cpp Source File

common/UCvsFrame.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 /*
00022  *
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #if qGTK
00028 #   include <gtk/gtk.h>
00029 #endif
00030
00031 #include "UCvsFrame.h"
00032 #include "UCvsApp.h"
00033 #include "UCvsCommands.h"
00034 #include "UCvsFolders.h"
00035 #include "CvsAlert.h"
00036 #include "PromptFiles.h"
00037 #include "CvsPrefs.h"
00038 #include "AppConsole.h"
00039 #include "CvsCommands.h"
00040 #include "TclGlue.h"
00041 #include "MacrosSetup.h"
00042 #include "GetPrefs.h"
00043 #include "UCvsDialogs.h"
00044
00045 UIMPLEMENT_DYNAMIC(UCvsFrame, UWidget)
00046
00047 UBEGIN_MESSAGE_MAP(UCvsFrame, UWidget)
00048     ON_UUPDATECMD_RANGE(cmdCREDITS, cmdCOPYRIGHTS, UCvsFrame::OnCmdUIAnytime)
00049     ON_UUPDATECMD_RANGE(UCvsFrame::kDirCombo, UCvsFrame::kBrowserPopup, UCvsFrame::OnCmdUIAnytime)
00050     ON_UUPDATECMD(cmdEXIT, UCvsFrame::OnCmdUIQuit)
00051     ON_UUPDATECMD_RANGE(cmdPREFERENCES, cmdPREFERENCES, UCvsFrame::OnCmdUIAnytime)
00052     ON_UUPDATECMD(cmdSTOPCVS, UCvsFrame::OnCmdUIStopcvs)
00053     ON_UUPDATECMD(cmdRTAGCREATE, UCvsFrame::OnCmdUICvsCmd)
00054     ON_UUPDATECMD(cmdSAVESETTINGS, UCvsFrame::OnCmdUICvsCmd)
00055     ON_UUPDATECMD(cmdINIT, UCvsFrame::OnCmdUICvsCmd)
00056     ON_UUPDATECMD(cmdRTAGDELETE, UCvsFrame::OnCmdUICvsCmd)
00057     ON_UUPDATECMD(cmdRTAGBRANCH, UCvsFrame::OnCmdUICvsCmd)
00058     ON_UUPDATECMD(cmdCMDLINE, UCvsFrame::OnCmdUICvsCmd)
00059     ON_UUPDATECMD(cmdLOGIN, UCvsFrame::OnCmdUICvsCmd)
00060     ON_UUPDATECMD(cmdLOGOUT, UCvsFrame::OnCmdUICvsCmd)
00061     ON_UUPDATECMD_RANGE(cmdMACROADMIN, cmdMACROADMINEND, UCvsFrame::OnCmdUIMacroAdmin)
00062     ON_COMBO_SEL(UCvsFrame::kDirCombo, UCvsFrame::OnComboSelDir)
00063     ON_UCOMMAND(UCvsFrame::kBrowserPopup, UCvsFrame::OnBrowserPopup)
00064     ON_UCOMMAND(cmdCOPYRIGHTS, UCvsFrame::OnCopyrights)
00065     ON_UCOMMAND(cmdCREDITS, UCvsFrame::OnCredits)
00066     ON_UCOMMAND(cmdEXIT, UCvsFrame::OnQuit)
00067     ON_UCOMMAND(cmdPREFERENCES, UCvsFrame::OnCmdPreferences)
00068     ON_UCOMMAND(cmdSAVESETTINGS, UCvsFrame::OnCmdSaveSettings)
00069     ON_UCOMMAND(cmdRTAGCREATE, UCvsFrame::OnCmdRtagNew)
00070     ON_UCOMMAND(cmdRTAGDELETE, UCvsFrame::OnCmdRtagDelete)
00071     ON_UCOMMAND(cmdRTAGBRANCH, UCvsFrame::OnCmdRtagBranch)
00072     ON_UCOMMAND(cmdCMDLINE, UCvsFrame::OnCmdCmdline)
00073     ON_UCOMMAND(cmdLOGIN, UCvsFrame::OnCmdLogin)
00074     ON_UCOMMAND(cmdLOGOUT, UCvsFrame::OnCmdLogout)
00075     ON_UCOMMAND(cmdSTOPCVS, UCvsFrame::OnCmdStopcvs)
00076     ON_UCOMMAND(cmdINIT, UCvsFrame::OnCmdInit)
00077     ON_UCOMMAND_RANGE(cmdMACROADMIN, cmdMACROADMINEND, UCvsFrame::OnCmdMacroAdmin)
00078     ON_UDESTROY(UCvsFrame)
00079 UEND_MESSAGE_MAP()
00080
00081 #if 0
00082     //}}AFX_MSG_MAP
00083     // Enable default OLE container implementation
00084     //ON_UPDATE_COMMAND_UI(ID_EDIT_PASTE, CDocument::OnUpdatePasteMenu)
00085     ON_COMMAND_EX_RANGE(ID_MACRO_ADMIN, ID_MACRO_ADMIN + 99, OnMacroAdmin)
00086     ON_COMMAND(ID_FILE_SEND_MAIL, OnFileSendMail)
00087     ON_UPDATE_COMMAND_UI(ID_FILE_SEND_MAIL, OnUpdateFileSendMail)
00088 #endif
00089
00090 UCvsFrame::UCvsFrame() : UWidget(kUCvsFrameID)
00091 {
00092 }
00093
00094 UCvsFrame::~UCvsFrame()
00095 {
00096 }
00097
00098 void UCvsFrame::OnDestroy(void)
00099 {
00100 #if qGTK
00101     gtk_main_quit();
00102 #endif /* qGTK */
00103     delete this;
00104 }
00105
00106 bool UCvsFrame::AskForQuitting(void)
00107 {
00108     bool res = true;
00109
00110     if(UCvsApp::gApp->IsCvsRunning())
00111         res = !CvsAlert("Cvs is currently running. Are-you sure you want to quit ?", "Cancel", "Quit");
00112
00113     gCvsPrefs.save();
00114
00115     return res;
00116 }
00117
00118 void UCvsFrame::OnComboSelDir(int pos, const char *txt)
00119 {
00120     UCvsApp::gApp->GetBrowserView()->ResetBrowser(txt, true);
00121 }
00122
00123 int UCvsFrame::OnBrowserPopup(void)
00124 {
00125     const char *newPath =
00126         BrowserGetDirectory("Select a folder to open with the browser");
00127     if(newPath == 0L)
00128         return 0;
00129
00130     UCvsApp::gApp->GetBrowserView()->ResetBrowser(newPath, true);
00131
00132     return 0;
00133 }
00134
00135 int UCvsFrame::OnQuit(void)
00136 {
00137     if(!AskForQuitting())
00138         return 0;
00139
00140 #if qGTK
00141     gtk_main_quit();
00142 #endif /* qGTK */
00143
00144     return 0;
00145 }
00146
00147 void UCvsFrame::OnCmdUIQuit(UCmdUI *pCmdUI)
00148 {
00149     pCmdUI->Enable(true);
00150 }
00151
00152 void UCvsFrame::OnCmdUIAnytime(int cmd, UCmdUI *pCmdUI)
00153 {
00154     pCmdUI->Enable(!UCvsApp::gApp->IsCvsRunning());
00155 }
00156
00157 int UCvsFrame::OnCopyrights()
00158 {
00159     const char *appName = UCvsApp::gApp->GetAppName();
00160
00161     cvs_out("\nBoth %s and CVS are distributed under the terms of\n", appName);
00162     cvs_out("the GNU General Public Licence (GPL).\n\n");
00163     cvs_out("* %s : maintained by Alexandre Parenteau (aubonbeurre@hotmail.com)\n", appName);
00164     cvs_out("* CVS : Copyright © 1989-1998 Brian Berliner, david d `zoo' zuhn,\n");
00165     cvs_out("        Jeff Polk, and other authors\n");
00166 #ifdef macintosh
00167     printf("* MacCVS : Mike Ladwig, Matthias Neeracher, Alexandre Parenteau\n");
00168     printf("* GUSI : Copyright © 1992-1997 Matthias Neeracher\n");
00169     printf("* Waste : Copyright © 1993-1998 Marco Piovanelli\n");
00170     printf("* CWASTEEdit : Copyright © 1995-1997 Timothy Paustian\n");
00171     printf("* ABalloon : Freeware of James W. Walker (jwwalker@kagi.com)\n");
00172     printf("* Metrowerks Standard Library, PowerPlant & CodeWarrior :\n");
00173     printf("    Copyright © 1996-1997 Metrowerks Inc.\n");
00174     printf("* MPW, MoreFiles : Copyright © Apple Computer Inc.\n");
00175 #endif
00176 #ifdef WIN32
00177     cvs_out("* WinCvs documentation : Copyright © 1999 Don Harper <don@lamrc.com>.\n");
00178     cvs_out("* CJLIB : Copyright © 1998-99 Kirk Stowell <kstowell@codejockeys.com>\n");
00179     cvs_out("* MFC : Copyright © 1992-1997 Microsoft Corporation\n");
00180 #endif
00181     cvs_out("* Kerberos : Copyright © 1997 the Massachusetts Institute of Technology\n");
00182     cvs_out("* TCL : Copyright © Sun Microsystems Inc.\n");
00183     cvs_out("\nSome others copyrights may apply, check the source code for details.\n");
00184     return 0;
00185 }
00186
00187 int UCvsFrame::OnCredits()
00188 {
00189     const char *appName = UCvsApp::gApp->GetAppName();
00190     const char *appVers = UCvsApp::gApp->GetAppVersion();
00191
00192 #ifndef macintosh
00193     cvs_out("\n%s %s - Client/Local\n", appName, appVers);
00194 #else
00195     cvs_out("\n%s %s - Client\n", appName, appVers);
00196 #endif
00197     cvs_out("%s is maintained by Alexandre Parenteau\n", appName);
00198     cvs_out("- WinCvs/MacCvs/gcvs page : http://www.wincvs.org\n");
00199     cvs_out("- cvs page : http://www.cyclic.com\n");
00200 #ifdef WIN32
00201     cvs_out("- WinCvs documentation : Don Harper <don@lamrc.com>.\n");
00202     cvs_out("- WinHelp cvs documentation : Norbert Klamann.\n");
00203 #endif
00204 #ifdef macintosh
00205     printf("- Mac port :\n");
00206     printf("\t* Mike Ladwig <mike@twinpeaks.prc.com>\n");
00207     printf("\t* Matthias Neeracher <neeri@iis.ee.ethz.ch>\n");
00208     printf("\t* Alexandre Parenteau <aubonbeurre@hotmail.com>\n");
00209     printf("- With contributions of :\n");
00210     printf("\t* Miro Jurisic <meeroh@mit.edu> (Kerberos)\n");
00211     printf("\t* Aleks Totic <atotic@netscape.com> (AppleSingle)\n");
00212     printf("\t* Jocelyn Houle <houlejo@IRO.UMontreal.CA> (Help balloons)\n");
00213 #endif
00214     cvs_out("- Special thanks to :\n");
00215     cvs_out("\t* Gary Bringhurst from C3D Digital who gives me time, resources,\n");
00216     cvs_out("\t  help and ideas for doing this project (http://www.3d.com)\n");
00217     cvs_out("\t* The Freeware community for providing cvs, Linux, Perl, GTK, gcc\n");
00218     cvs_out("\t  and so many others valuables tools\n");
00219     cvs_out("\t* The users of the CvsGui project (WinCvs, MacCvs, gcvs) who have\n");
00220     cvs_out("\t  defined all the functionnalities and help every day to enhance it\n");
00221     cvs_out("- Cvs contributors :\n");
00222     cvs_out("\t* Too many to be listed here, see the 'ChangeLog' instead !\n");
00223     return 0;
00224 }
00225
00226 int UCvsFrame::OnCmdPreferences(void)
00227 {
00228     CompatGetPrefs();
00229     return 0;
00230 }
00231
00232 int UCvsFrame::OnCmdSaveSettings(void)
00233 {
00234     UCvsFolders *browser = UCvsApp::gApp->GetBrowserView();
00235     if(browser != 0L && browser->GetRoot() != 0L)
00236         AskCreatePersistentSettings(browser->GetRoot());
00237     return 0;
00238 }
00239
00240 int UCvsFrame::OnCmdRtagNew(void)
00241 {
00242     CvsCmdRtagCreate();
00243     return 0;
00244 }
00245
00246 int UCvsFrame::OnCmdRtagDelete(void)
00247 {
00248     CvsCmdRtagDelete();
00249     return 0;
00250 }
00251
00252 int UCvsFrame::OnCmdRtagBranch(void)
00253 {
00254     CvsCmdRtagBranch();
00255     return 0;
00256 }
00257
00258 int UCvsFrame::OnCmdCmdline(void)
00259 {
00260     CvsCmdLine();
00261     return 0;
00262 }
00263
00264 int UCvsFrame::OnCmdLogin(void)
00265 {
00266     CvsCmdLogin();
00267     return 0;
00268 }
00269
00270 int UCvsFrame::OnCmdLogout(void)
00271 {
00272     CvsCmdLogout();
00273     return 0;
00274 }
00275
00276 int UCvsFrame::OnCmdStopcvs(void)
00277 {
00278     UCvsApp::gApp->SetCvsStopping(true);
00279     if(UCvsApp::gCurCvs != 0L && cvs_process_is_active(UCvsApp::gCurCvs))
00280     {
00281         cvs_process_kill(UCvsApp::gCurCvs);
00282         cvs_out("*****CVS stopped on user request !!! *****\n\n");
00283     }
00284
00285     return 0;
00286 }
00287
00288 int UCvsFrame::OnCmdInit(void)
00289 {
00290     CvsCmdInit();
00291     return 0;
00292 }
00293
00294 int UCvsFrame::OnCmdMacroAdmin(int cmd)
00295 {
00296     CMacroEntry & entry = gMacrosAdmin.entries[cmd - cmdMACROADMIN];
00297     CvsCmdMacrosAdmin(entry.path);
00298     return 0;
00299 }
00300
00301 void UCvsFrame::OnCmdUIStopcvs(UCmdUI *pCmdUI)
00302 {
00303     UCvsApp *app = UCvsApp::gApp;
00304     pCmdUI->Enable(app->IsCvsRunning() && !app->IsCvsStopping());
00305 }
00306
00307 void UCvsFrame::OnCmdUICvsCmd(UCmdUI *pCmdUI)
00308 {
00309     pCmdUI->Enable(!UCvsApp::gApp->IsCvsRunning() && !gCvsPrefs.empty());
00310 }
00311
00312 void UCvsFrame::OnCmdUIMacroAdmin(int cmd, UCmdUI *pCmdUI)
00313 {
00314     pCmdUI->Enable(!UCvsApp::gApp->IsCvsRunning() && !gCvsPrefs.empty() && CTcl_Interp::IsAvail());
00315 }
Generated on Sun Feb 24 01:21:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UCvsFrame.h Source File

common/UCvsFrame.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 /*
00022  *
00023  */
00024
00025 #ifndef UCVSFRAME_H
00026 #define UCVSFRAME_H
00027
00028 #include "uwidget.h"
00029 #include "UCvsCommands.h"
00030
00031 class UCvsFrame : public UWidget
00032 {
00033     UDECLARE_DYNAMIC(UCvsFrame)
00034 public:
00035     UCvsFrame();
00036     virtual ~UCvsFrame();
00037
00038     bool AskForQuitting(void);
00039         // true if we can quit the application
00040
00041     enum
00042     {
00043         kDirCombo = EV_COMMAND_START,   // 0
00044         kBrowserPopup                   // 1
00045     };
00046
00047 protected:
00048     ev_msg void OnCmdUIAnytime(int cmd, UCmdUI *pCmdUI);
00049     ev_msg void OnCmdUIQuit(UCmdUI *pCmdUI);
00050     ev_msg void OnCmdUIStopcvs(UCmdUI *pCmdUI);
00051     ev_msg void OnCmdUICvsCmd(UCmdUI *pCmdUI);
00052     ev_msg void OnCmdUIMacroAdmin(int cmd, UCmdUI *pCmdUI);
00053     ev_msg void OnDestroy(void);
00054     ev_msg int OnQuit(void);
00055     ev_msg int OnCopyrights(void);
00056     ev_msg int OnCredits(void);
00057     ev_msg void OnComboSelDir(int pos, const char *txt);
00058     ev_msg int OnBrowserPopup(void);
00059     ev_msg int OnCmdPreferences(void);
00060     ev_msg int OnCmdSaveSettings(void);
00061     ev_msg int OnCmdRtagNew(void);
00062     ev_msg int OnCmdRtagDelete(void);
00063     ev_msg int OnCmdRtagBranch(void);
00064     ev_msg int OnCmdCmdline(void);
00065     ev_msg int OnCmdLogin(void);
00066     ev_msg int OnCmdLogout(void);
00067     ev_msg int OnCmdStopcvs(void);
00068     ev_msg int OnCmdInit(void);
00069     ev_msg int OnCmdMacroAdmin(int cmd);
00070
00071     UDECLARE_MESSAGE_MAP()
00072 };
00073
00074 // little class to get the cursor to wait during the existence of the object
00075 class UWaitCursor
00076 {
00077 public:
00078     UWaitCursor()
00079     {
00080         UEventSendMessage(kUCvsFrameID, EV_CHGCURSOR, UMAKEINT(kUMainWidget, uCursWatch), 0L);
00081     }
00082     virtual ~UWaitCursor()
00083     {
00084         UEventSendMessage(kUCvsFrameID, EV_CHGCURSOR, UMAKEINT(kUMainWidget, uCursArrow), 0L);
00085     }
00086 };
00087
00088 #endif
Generated on Sun Feb 24 01:21:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UCvsGraph.cpp Source File

common/UCvsGraph.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 /*
00022  *
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #include <sys/stat.h>
00028
00029 #ifdef HAVE_UNISTD_H
00030 #include <unistd.h>
00031 #endif
00032
00033 #include "UCvsGraph.h"
00034 #include "UCvsFiles.h"
00035 #include "CvsEntries.h"
00036 #include "CvsLog.h"
00037 #include "AppConsole.h"
00038 #include "udraw.h"
00039
00040 UIMPLEMENT_DYNAMIC(UCvsGraph, UWidget)
00041
00042 UBEGIN_MESSAGE_MAP(UCvsGraph, UWidget)
00043     ON_UDESTROY(UCvsGraph)
00044     ON_UCREATE(UCvsGraph)
00045     ON_CUSTOM_DRAW(UCvsGraph::kDrawing, UCvsGraph::OnDrawing)
00046 UEND_MESSAGE_MAP()
00047
00048 UCvsGraph::UCvsGraph(CLogNode *node, const char *dir) :
00049     UWidget(::UEventGetWidID()), m_node(node), m_dir(dir), m_data(0L)
00050 {
00051     // get the CVS/Entries infos for this file
00052     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00053     if(!Entries_Open (entries, dir))
00054     {
00055         cvs_err("Warning : Error while accessing the CVS folder in '%s'\n", dir);
00056     }
00057     else
00058     {
00059         if(node->GetType() != kNodeHeader)
00060         {
00061             cvs_err("Warning : Top node is not a RCS file description !\n");
00062         }
00063         else
00064         {
00065             const char *name = (**(CLogNodeHeader *)node).WorkingFile();
00066             struct stat sb;
00067             if (stat(name, &sb) == -1)
00068             {
00069                 cvs_err("Warning : Unknown file '%s'\n", name);
00070             }
00071             else
00072             {
00073                 m_data = Entries_SetVisited(dir, entries, name, sb, false);
00074                 m_data->Ref();
00075                 m_name = name;
00076             }
00077         }
00078     }
00079 }
00080
00081 UCvsGraph::~UCvsGraph()
00082 {
00083     if(m_node != 0L)
00084         delete m_node;
00085     if(m_data != 0L)
00086         m_data->UnRef();
00087 }
00088
00089 void UCvsGraph::OnDestroy(void)
00090 {
00091     delete this;
00092 }
00093
00094 void UCvsGraph::OnCreate(void)
00095 {
00096     UStr title("Graph log : ");
00097     title << m_name;
00098     UEventSendMessage(GetWidID(), EV_SETTEXT, kUMainWidget, (void *)(const char *)title);
00099 }
00100
00101 class CScrollView
00102 {
00103 public:
00104     UPoint GetDeviceScrollPosition() { return UPoint(0, 0); }
00105     void InvalidateRect(const URECT *r) {}
00106 };
00107
00108 class CWinLogData : public CLogNodeData
00109 {
00110 public:
00111     CWinLogData(CLogNode *node);
00112     virtual ~CWinLogData();
00113
00114     inline kLogNode GetType(void) const { return fNode->GetType(); }
00115     const char *GetStr(void);
00116
00117     void ComputeBounds(const UPoint & topLeft, UDC & hdc,
00118         EntnodeData *entryInfo = 0L);
00119     void Offset(UPoint o);
00120     void Update(UDC & hdc, EntnodeData *entryInfo = 0L);
00121
00122     inline URect & Bounds(void) { return totB; }
00123     inline URect & SelfBounds(void) { return selfB; }
00124
00125     inline bool Selected(void) const { return sel; }
00126     void SetSelected(CScrollView *view, bool state);
00127     void UnselectAll(CScrollView *view);
00128     CWinLogData *HitTest(UPoint point);
00129
00130     static CWinLogData *CreateNewData(CLogNode *node);
00131
00132     bool IsDiskNode(EntnodeData *entryInfo);
00133
00134 protected:
00135     virtual void UpdateSelf(UDC & hdc, EntnodeData *entryInfo) = 0;
00136     virtual USize GetBoundsSelf(UDC & hdc, EntnodeData *entryInfo) = 0;
00137
00138     inline CWinLogData *GetData(CLogNode *node)
00139         { return (CWinLogData *)node->GetUserData(); }
00140
00141     URect selfB;
00142     URect totB;
00143     bool sel;
00144 };
00145
00146 class CWinLogHeaderData : public CWinLogData
00147 {
00148 public:
00149     CWinLogHeaderData(CLogNode *node) : CWinLogData(node) {}
00150     virtual ~CWinLogHeaderData() {}
00151
00152 protected:
00153     virtual void UpdateSelf(UDC & hdc, EntnodeData *entryInfo);
00154     virtual USize GetBoundsSelf(UDC & hdc, EntnodeData *entryInfo);
00155 };
00156
00157 class CWinLogRevData : public CWinLogData
00158 {
00159 public:
00160     CWinLogRevData(CLogNode *node) : CWinLogData(node) {}
00161     virtual ~CWinLogRevData() {}
00162
00163 protected:
00164     virtual void UpdateSelf(UDC & hdc, EntnodeData *entryInfo);
00165     virtual USize GetBoundsSelf(UDC & hdc, EntnodeData *entryInfo);
00166 };
00167
00168 class CWinLogTagData : public CWinLogData
00169 {
00170 public:
00171     CWinLogTagData(CLogNode *node) : CWinLogData(node) {}
00172     virtual ~CWinLogTagData() {}
00173
00174 protected:
00175     virtual void UpdateSelf(UDC & hdc, EntnodeData *entryInfo);
00176     virtual USize GetBoundsSelf(UDC & hdc, EntnodeData *entryInfo);
00177 };
00178
00179 class CWinLogBranchData : public CWinLogData
00180 {
00181 public:
00182     CWinLogBranchData(CLogNode *node) : CWinLogData(node) {}
00183     virtual ~CWinLogBranchData() {}
00184
00185 protected:
00186     virtual void UpdateSelf(UDC & hdc, EntnodeData *entryInfo);
00187     virtual USize GetBoundsSelf(UDC & hdc, EntnodeData *entryInfo);
00188 };
00189
00190 USize CWinLogHeaderData::GetBoundsSelf(UDC & hdc, EntnodeData *entryInfo)
00191 {
00192     CLogNodeHeader & header = *(CLogNodeHeader *)fNode;
00193     return hdc.GetTextExtent((*header).WorkingFile(),
00194         (*header).WorkingFile().length());
00195 }
00196
00197 static void DrawNode(UDC & hdc, const URect & selfB,
00198                      UCOLORREF contour, UCOLORREF shadowc,
00199                      bool isRounded, bool issel)
00200 {
00201     UPen *pOldPen = 0L;
00202     UBrush *pOldBrush = 0L;
00203     UPen pen, pen2;
00204     UBrush brush;
00205     UCOLORREF selcolor = URGB(160, 160, 160);
00206     UCOLORREF wcolor = URGB(255, 255, 255);
00207
00208     try
00209     {
00210         if(!isRounded)
00211         {
00212             if(!issel)
00213             {
00214                 brush.CreateSolidBrush(wcolor);
00215                 pOldBrush = hdc.SelectObject(&brush);
00216                 pen.CreatePen(UPS_SOLID, 1, contour);
00217                 pOldPen = hdc.SelectObject(&pen);
00218                 hdc.Rectangle(selfB);
00219             }
00220             else
00221             {
00222                 brush.CreateSolidBrush(selcolor);
00223                 pOldBrush = hdc.SelectObject(&brush);
00224                 pen.CreatePen(UPS_SOLID, 1, contour);
00225                 pOldPen = hdc.SelectObject(&pen);
00226                 hdc.Rectangle(selfB);
00227             }
00228         }
00229         else
00230         {
00231             URect shadow;
00232             if(!issel)
00233             {
00234                 brush.CreateSolidBrush(shadowc);
00235                 pOldBrush = hdc.SelectObject(&brush);
00236                 pen.CreatePen(UPS_SOLID, 1, shadowc);
00237                 pOldPen = hdc.SelectObject(&pen);
00238                 shadow = selfB;
00239                 shadow.OffsetRect(UPoint(2, 2));
00240                 hdc.RoundRect(&shadow, UPoint(6, 6));
00241
00242                 brush.DeleteObject();
00243                 brush.CreateSolidBrush(wcolor);
00244                 hdc.SelectObject(&brush);
00245                 pen2.CreatePen(UPS_SOLID, 1, contour);
00246                 hdc.SelectObject(&pen2);
00247                 hdc.RoundRect(selfB, UPoint(6, 6));
00248             }
00249             else
00250             {
00251                 brush.CreateSolidBrush(shadowc);
00252                 pOldBrush = hdc.SelectObject(&brush);
00253                 pen.CreatePen(UPS_SOLID, 1, shadowc);
00254                 pOldPen = hdc.SelectObject(&pen);
00255                 shadow = selfB;
00256                 shadow.OffsetRect(UPoint(2, 2));
00257                 hdc.RoundRect(&shadow, UPoint(6, 6));
00258
00259                 brush.DeleteObject();
00260                 brush.CreateSolidBrush(selcolor);
00261                 hdc.SelectObject(&brush);
00262                 pen2.CreatePen(UPS_SOLID, 1, contour);
00263                 hdc.SelectObject(&pen2);
00264                 hdc.RoundRect(selfB, UPoint(6, 6));
00265             }
00266         }
00267
00268         if (pOldPen != 0L)
00269         {
00270             hdc.SelectObject(pOldPen);
00271             pOldPen = 0L;
00272         }
00273         if (pOldBrush != 0L)
00274         {
00275             hdc.SelectObject(pOldBrush);
00276             pOldBrush = 0L;
00277         }
00278
00279         pen.DeleteObject();
00280         pen2.DeleteObject();
00281         brush.DeleteObject();
00282     }
00283     catch(...)
00284     {
00285         if (pOldPen != 0L)
00286             hdc.SelectObject(pOldPen);
00287         if (pOldBrush != 0L)
00288             hdc.SelectObject(pOldBrush);
00289     }
00290 }
00291
00292 void CWinLogHeaderData::UpdateSelf(UDC & hdc, EntnodeData *entryInfo)
00293 {
00294     // draw the node
00295     ::DrawNode(hdc, selfB, URGB(255, 0, 0), URGB(120, 0, 0), true, sel);
00296
00297     // draw the content of the node
00298     UPoint center = selfB.CenterPoint();
00299     int nCenterX = center.x;
00300     int nCenterY = center.y - hdc.GetTextHeight()/2;
00301     CLogNodeHeader & header = *(CLogNodeHeader *)fNode;
00302     hdc.TextOutClipped(nCenterX, nCenterY, &selfB,
00303         (*header).WorkingFile(), (*header).WorkingFile().length());
00304 }
00305
00306 USize CWinLogRevData::GetBoundsSelf(UDC & hdc, EntnodeData *entryInfo)
00307 {
00308     CLogNodeRev & rev = *(CLogNodeRev *)fNode;
00309     USize size = hdc.GetTextExtent((*rev).RevNum().c_str(),
00310         strlen((*rev).RevNum().c_str()));
00311     if(IsDiskNode(entryInfo))
00312     {
00313         size.cx += 2 + 16 + 2;
00314         size.cy = std::max(16, size.cy);
00315     }
00316     return size;
00317 }
00318
00319 void CWinLogRevData::UpdateSelf(UDC & hdc, EntnodeData *entryInfo)
00320 {
00321     URect txtRect = selfB;
00322
00323     if(IsDiskNode(entryInfo))
00324     {
00325         txtRect.left += 2 + 16 + 2;
00326     }
00327
00328     // draw the node
00329     ::DrawNode(hdc, selfB, URGB(0, 0, 255), URGB(0, 0, 0), false, sel);
00330
00331     // draw the state icon if it is the rev. of the disk
00332     if(IsDiskNode(entryInfo))
00333     {
00334         UPoint w(selfB.TopLeft());
00335         w.x += 2;
00336         w.y += (selfB.Height() - 16) / 2;
00337         hdc.DrawBitmap(UCvsFiles::GetImageForEntry(entryInfo), w);
00338     }
00339
00340     // draw the content of the node
00341     UPoint center = txtRect.CenterPoint();
00342     int nCenterX = center.x;
00343     int nCenterY = center.y - hdc.GetTextHeight()/2;
00344     CLogNodeRev & rev = *(CLogNodeRev *)fNode;
00345     hdc.TextOutClipped(nCenterX, nCenterY, &txtRect,
00346             (*rev).RevNum().c_str(), strlen((*rev).RevNum().c_str()));
00347 }
00348
00349 USize CWinLogTagData::GetBoundsSelf(UDC & hdc, EntnodeData *entryInfo)
00350 {
00351     CLogNodeTag & tag = *(CLogNodeTag *)fNode;
00352     return hdc.GetTextExtent(*tag, (*tag).length());
00353 }
00354
00355 void CWinLogTagData::UpdateSelf(UDC & hdc, EntnodeData *entryInfo)
00356 {
00357     // draw the node
00358     ::DrawNode(hdc, selfB, URGB(0, 0, 0), URGB(120, 120, 120), true, sel);
00359
00360     // draw the content of the node
00361     UPoint center = selfB.CenterPoint();
00362     int nCenterX = center.x;
00363     int nCenterY = center.y - hdc.GetTextHeight()/2;
00364     CLogNodeTag & tag = *(CLogNodeTag *)fNode;
00365     hdc.TextOutClipped(nCenterX, nCenterY, &selfB,
00366         *tag, (*tag).length());
00367 }
00368
00369 USize CWinLogBranchData::GetBoundsSelf(UDC & hdc, EntnodeData *entryInfo)
00370 {
00371     CLogNodeBranch & branch = *(CLogNodeBranch *)fNode;
00372     return hdc.GetTextExtent(*branch, (*branch).length());
00373 }
00374
00375 void CWinLogBranchData::UpdateSelf(UDC & hdc, EntnodeData *entryInfo)
00376 {
00377     // draw the node
00378     ::DrawNode(hdc, selfB, URGB(0, 0, 255), URGB(0, 0, 120), true, sel);
00379
00380     // draw the content of the node
00381     UPoint center = selfB.CenterPoint();
00382     int nCenterX = center.x;
00383     int nCenterY = center.y - hdc.GetTextHeight()/2;
00384     CLogNodeBranch & branch = *(CLogNodeBranch *)fNode;
00385     hdc.TextOutClipped(nCenterX, nCenterY, &selfB,
00386         *branch, (*branch).length());
00387 }
00388
00389 CWinLogData::CWinLogData(CLogNode *node) : CLogNodeData(node)
00390 {
00391     selfB.SetRectEmpty();
00392     totB.SetRectEmpty();
00393     sel = false;
00394 }
00395
00396 CWinLogData::~CWinLogData()
00397 {
00398 }
00399
00400 const char *CWinLogData::GetStr(void)
00401 {
00402     switch(GetType())
00403     {
00404         case kNodeHeader :
00405         {
00406             CLogNodeHeader & header = *(CLogNodeHeader *)fNode;
00407             return (*header).WorkingFile();
00408             break;
00409         }
00410         case kNodeBranch :
00411         {
00412             CLogNodeBranch & branch = *(CLogNodeBranch *)fNode;
00413             return *branch;
00414             break;
00415         }
00416         case kNodeRev :
00417         {
00418             CLogNodeRev & rev = *(CLogNodeRev *)fNode;
00419             return (*rev).RevNum().c_str();
00420             break;
00421         }
00422         case kNodeTag :
00423         {
00424             CLogNodeTag & tag = *(CLogNodeTag *)fNode;
00425             return *tag;
00426             break;
00427         }
00428     }
00429     return 0L;
00430 }
00431
00432 CWinLogData * CWinLogData::CreateNewData(CLogNode *node)
00433 {
00434     if(node->GetUserData() != 0L)
00435         return (CWinLogData *)node->GetUserData();
00436
00437     CWinLogData *res = 0L;
00438     switch(node->GetType())
00439     {
00440     case kNodeHeader :
00441         res = new CWinLogHeaderData(node);
00442         break;
00443     case kNodeBranch :
00444         res = new CWinLogBranchData(node);
00445         break;
00446     case kNodeRev :
00447         res = new CWinLogRevData(node);
00448         break;
00449     case kNodeTag :
00450         res = new CWinLogTagData(node);
00451         break;
00452     }
00453     node->SetUserData(res);
00454     return res;
00455 }
00456
00457 bool CWinLogData::IsDiskNode(EntnodeData *entryInfo)
00458 {
00459     if(entryInfo == 0L || GetType() != kNodeRev)
00460         return false;
00461     const char *vn = (*entryInfo)[EntnodeFile::kVN];
00462     if(vn == 0L)
00463         return false;
00464
00465     return strcmp(vn, (**(CLogNodeRev *)fNode).RevNum().c_str()) == 0;
00466 }
00467
00468 const int kVChildSpace = 8;
00469 const int kHChildSpace = 40;
00470 const int kInflateNodeSpace = 8;
00471
00472 void CWinLogData::Offset(UPoint o)
00473 {
00474     selfB.OffsetRect(o);
00475     totB.OffsetRect(o);
00476     std::vector<CLogNode *>::iterator i;
00477     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00478     {
00479         CLogNode *subNode = *i;
00480         GetData(subNode)->Offset(o);
00481     }
00482     if(fNode->Next() != 0L)
00483         GetData(fNode->Next())->Offset(o);
00484 }
00485
00486 void CWinLogData::SetSelected(CScrollView *view, bool state)
00487 {
00488     sel = state;
00489
00490     URect invalR = selfB;
00491     invalR.OffsetRect(-view->GetDeviceScrollPosition());
00492     view->InvalidateRect(&invalR);
00493 }
00494
00495 void CWinLogData::UnselectAll(CScrollView *view)
00496 {
00497     if(sel)
00498     {
00499         SetSelected(view, false);
00500     }
00501
00502     std::vector<CLogNode *>::iterator i;
00503     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00504     {
00505         CLogNode *subNode = *i;
00506         GetData(subNode)->UnselectAll(view);
00507     }
00508     if(fNode->Next() != 0L)
00509         GetData(fNode->Next())->UnselectAll(view);
00510 }
00511
00512 CWinLogData *CWinLogData::HitTest(UPoint point)
00513 {
00514     if(!totB.PtInRect(point))
00515         return 0L;
00516     if(selfB.PtInRect(point))
00517         return this;
00518
00519     CWinLogData *result;
00520     std::vector<CLogNode *>::iterator i;
00521     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00522     {
00523         CLogNode *subNode = *i;
00524         result = GetData(subNode)->HitTest(point);
00525         if(result != 0L)
00526             return result;
00527     }
00528     if(fNode->Next() != 0L)
00529     {
00530         result = GetData(fNode->Next())->HitTest(point);
00531         if(result != 0L)
00532             return result;
00533     }
00534     return 0L;
00535 }
00536
00537 void CWinLogData::Update(UDC & hdc, EntnodeData *entryInfo)
00538 {
00539     CLogNode *subNode;
00540     CLogNode *nextNode = fNode->Next();
00541     UPen *pOldPen = 0L;
00542     UPen pen, pen2;
00543
00544     UpdateSelf(hdc, entryInfo);
00545
00546     try
00547     {
00548         pen.CreatePen(UPS_SOLID, 2, URGB(0, 0, 255));
00549         pen2.CreatePen(UPS_SOLID, 1, URGB(0, 0, 0));
00550         pOldPen = hdc.SelectObject(&pen);
00551
00552         int topY = selfB.TopLeft().y + 2;
00553         int botY = selfB.BottomRight().y - 2;
00554         int lefX = selfB.BottomRight().x + 4;
00555         int count = 1;
00556         int tot = fNode->Childs().size() + 1;
00557
00558         // draw the children
00559         std::vector<CLogNode *>::iterator i;
00560         for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i, ++count)
00561         {
00562             subNode = *i;
00563
00564             // draw the link
00565             URect & cb = GetData(subNode)->SelfBounds();
00566             if(subNode->GetType() == kNodeRev || subNode->GetType() == kNodeBranch)
00567                 hdc.SelectObject(&pen);
00568             else
00569                 hdc.SelectObject(&pen2);
00570             float y = (float)topY + (float)(botY - topY) *
00571                 (float)count / (float)tot;
00572             int rigX = cb.TopLeft().x - 4;
00573             float x = (float)rigX - (float)(rigX - lefX) *
00574                 (float)count / (float)tot;
00575             //int halfX = (cb.TopLeft().x - selfB.BottomRight().x) / 2;
00576             hdc.MoveTo(selfB.BottomRight().x, (int)y);
00577             hdc.LineTo((int)x, (int)y);
00578             hdc.LineTo((int)x, cb.CenterPoint().y);
00579             hdc.LineTo(cb.TopLeft().x, cb.CenterPoint().y);
00580
00581             // draw the sub-node
00582             GetData(subNode)->Update(hdc, entryInfo);
00583         }
00584
00585         // draw the next node
00586         if(nextNode != 0L)
00587         {
00588             // draw the link
00589             URect & nb = GetData(nextNode)->SelfBounds();
00590             if(nextNode->GetType() == kNodeRev || nextNode->GetType() == kNodeBranch)
00591                 hdc.SelectObject(&pen);
00592             else
00593                 hdc.SelectObject(&pen2);
00594             int centerX = selfB.Width() < nb.Width() ?
00595                 selfB.CenterPoint().x : nb.CenterPoint().x;
00596             hdc.MoveTo(centerX, selfB.BottomRight().y);
00597             hdc.LineTo(centerX, nb.TopLeft().y);
00598
00599             // draw the next node
00600             GetData(nextNode)->Update(hdc, entryInfo);
00601         }
00602
00603         if (pOldPen != 0L)
00604         {
00605             hdc.SelectObject(pOldPen);
00606             pOldPen = 0L;
00607         }
00608
00609         pen.DeleteObject();
00610         pen2.DeleteObject();
00611     }
00612     catch(...)
00613     {
00614         if (pOldPen != 0L)
00615             hdc.SelectObject(pOldPen);
00616     }
00617 }
00618
00619 void CWinLogData::ComputeBounds(const UPoint & topLeft, UDC & hdc,
00620                                 EntnodeData *entryInfo)
00621 {
00622     CLogNode *subNode;
00623     CLogNode *nextNode = fNode->Next();
00624
00625     // first compute childrens bounds
00626     std::vector<CLogNode *>::iterator i;
00627     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00628     {
00629         subNode = *i;
00630         CWinLogData::CreateNewData(subNode);
00631         GetData(subNode)->ComputeBounds(topLeft, hdc, entryInfo);
00632     }
00633     if(nextNode != 0L)
00634         CWinLogData::CreateNewData(nextNode);
00635
00636     // compute self place
00637     selfB.SetRectEmpty();
00638     USize size = GetBoundsSelf(hdc, entryInfo);
00639     size.cx += kInflateNodeSpace;
00640     size.cy += kInflateNodeSpace;
00641     selfB.SetRect(0, 0, size.cx, size.cy);
00642
00643     // offset to the place assigned to this node
00644     selfB.OffsetRect(topLeft - selfB.TopLeft());
00645
00646     // calculate the total height of the childrens
00647     int vSize = 0;
00648     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00649     {
00650         subNode = *i;
00651         URect & b = GetData(subNode)->Bounds();
00652         vSize += b.Height();
00653     }
00654     if(!fNode->Childs().empty())
00655         vSize += (fNode->Childs().size() - 1) * kVChildSpace;
00656
00657     // offset the children relative to self
00658     UPoint startChilds(topLeft.x + selfB.Width() + kHChildSpace,
00659         /*selfB.CenterPoint().y - vSize / 2*/topLeft.y);
00660     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00661     {
00662         subNode = *i;
00663         URect curPos = GetData(subNode)->Bounds();
00664         GetData(subNode)->Offset(startChilds - curPos.TopLeft());
00665         startChilds.y += curPos.Height() + kVChildSpace;
00666     }
00667
00668     // calculate the total bounds of the childrens
00669     URect bc;
00670     bc.SetRectEmpty();
00671     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00672     {
00673         subNode = *i;
00674         URect & b = GetData(subNode)->Bounds();
00675         bc.UnionRect(&bc, &b);
00676     }
00677
00678     // now we got the complete size
00679     totB.UnionRect(&selfB, &bc);
00680
00681     if(nextNode != 0L)
00682     {
00683         UPoint nextTopLeft;
00684         nextTopLeft.x = totB.TopLeft().x;
00685         nextTopLeft.y = totB.BottomRight().y + kVChildSpace;
00686         GetData(nextNode)->ComputeBounds(nextTopLeft, hdc, entryInfo);
00687
00688         totB.UnionRect(&totB, &GetData(nextNode)->Bounds());
00689     }
00690 }
00691
00692 void UCvsGraph::CalcImageSize(void)
00693 {
00694     if(m_node == 0L)
00695         return;
00696
00697     // set all the bounds locations
00698     UDC dc(GetWidID(), kDrawing);
00699     CWinLogData *data = CWinLogData::CreateNewData(m_node);
00700     m_node->SetUserData(data);
00701     UPoint start(5, 5);
00702     data->ComputeBounds(start, dc, m_data);
00703
00704     // reoffset from (0, 0)
00705     URect bounds = data->Bounds();
00706     data->Offset(start - bounds.TopLeft());
00707     bounds = data->Bounds();
00708
00709 #if qGTK
00710     GtkWidget *layout = (GtkWidget *)GetWidget(kDrawing);
00711     gtk_layout_set_size (GTK_LAYOUT (layout), bounds.Width(), bounds.Height());
00712 #endif
00713 #if 0
00714     // set the scroll size
00715     SetScrollSizes(MM_TEXT, bounds.Size() + USize(5, 5));
00716 #endif
00717 }
00718
00719 void UCvsGraph::OnDrawing(void *info)
00720 {
00721 #if qGTK
00722     GdkEventExpose *event = (GdkEventExpose *)info;
00723     GtkLayout *layout = GTK_LAYOUT(GetWidget(kDrawing));
00724     gdk_window_clear_area (layout->bin_window,
00725                            event->area.x, event->area.y,
00726                            event->area.width, event->area.height);
00727 #endif
00728     CalcImageSize();
00729
00730     if(m_node == 0L || m_node->GetUserData() == 0L)
00731         return;
00732
00733     UDC dc(GetWidID(), kDrawing);
00734     CWinLogData *data = (CWinLogData *)m_node->GetUserData();
00735     data->Update(dc, m_data);
00736
00737 /*  GtkWidget *widget = (GtkWidget *)GetWidget(kDrawing);
00738     if(widget == 0L)
00739         return;
00740
00741     GtkDrawingArea *darea;
00742     GdkDrawable *drawable;
00743     GdkGC *black_gc;
00744     GdkGC *gray_gc;
00745     GdkGC *white_gc;
00746     guint max_width;
00747     guint max_height;
00748
00749     g_return_if_fail (widget != NULL);
00750     g_return_if_fail (GTK_IS_DRAWING_AREA (widget));
00751
00752     darea = GTK_DRAWING_AREA (widget);
00753     drawable = widget->window;
00754     white_gc = widget->style->white_gc;
00755     gray_gc = widget->style->bg_gc[GTK_STATE_NORMAL];
00756     black_gc = widget->style->black_gc;
00757     max_width = widget->allocation.width;
00758     max_height = widget->allocation.height;
00759     gdk_draw_rectangle (drawable, black_gc,
00760                         TRUE,
00761                         0,
00762                         max_height / 2,
00763                         max_width,
00764                         max_height / 2);*/
00765 }
Generated on Sun Feb 24 01:21:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UCvsGraph.h Source File

common/UCvsGraph.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 /*
00022  *
00023  */
00024
00025 #ifndef UCVSGRAPH_H
00026 #define UCVSGRAPH_H
00027
00028 #include "uwidget.h"
00029
00030 class CLogNode;
00031 class EntnodeData;
00032
00033 class UCvsGraph : public UWidget
00034 {
00035     UDECLARE_DYNAMIC(UCvsGraph)
00036 public:
00037     UCvsGraph(CLogNode *node, const char *dir);
00038     virtual ~UCvsGraph();
00039
00040     enum
00041     {
00042         kDrawing = EV_COMMAND_START // 0
00043     };
00044 protected:
00045     CLogNode *m_node;
00046     UStr m_dir;
00047     UStr m_name;
00048     EntnodeData *m_data;
00049
00050     void CalcImageSize(void);
00051
00052     ev_msg void OnDestroy();
00053     ev_msg void OnCreate();
00054     ev_msg void OnDrawing(void *info);
00055
00056     UDECLARE_MESSAGE_MAP()
00057 };
00058
00059 #endif
Generated on Sun Feb 24 01:21:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UCvsMenubar.cpp Source File

common/UCvsMenubar.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 /*
00022  *
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #include "UCvsMenubar.h"
00028 #include "UCvsCommands.h"
00029 #include "MacrosSetup.h"
00030
00031 UIMPLEMENT_DYNAMIC(UCvsMenubar, UMenu)
00032
00033 UBEGIN_MESSAGE_MAP(UCvsMenubar, UMenu)
00034     ON_UDESTROY(UCvsMenubar)
00035     ON_UCREATE(UCvsMenubar)
00036 UEND_MESSAGE_MAP()
00037
00038 UCvsMenubar::UCvsMenubar() : UMenu(kUCvsMenubarID)
00039 {
00040 }
00041
00042 UCvsMenubar::~UCvsMenubar()
00043 {
00044 }
00045
00046 void UCvsMenubar::OnDestroy(void)
00047 {
00048     delete this;
00049 }
00050
00051 void UCvsMenubar::OnCreate(void)
00052 {
00053 }
00054
00055 void CreateMainMenubar(int widid)
00056 {
00057     std::vector<CMacroEntry>::const_iterator i;
00058     int cnt;
00059
00060     UMENU menu = UMenuAddPulldown(widid, "&File", UMENU_NULL);
00061     UMenuAddButton(widid, "&Save\tCtrl+S", menu, 0L, cmdSAVE);
00062     UMenuAddButton(widid, "Save &As...", menu, 0L, cmdSAVE_AS);
00063     UMenuAddSeparator(widid, menu);
00064     UMenuAddButton(widid, "&Print...\tCtrl+P", menu, 0L, cmdPRINT);
00065     UMenuAddButton(widid, "Print Pre&view", menu, 0L, cmdPRINT_PREVIEW);
00066     UMenuAddButton(widid, "P&rint Setup...", menu, 0L, cmdPRINT_SETUP);
00067     UMenuAddSeparator(widid, menu);
00068     UMenuAddButton(widid, "Sen&d...", menu, 0L, cmdSEND_MAIL);
00069     UMenuAddSeparator(widid, menu);
00070     UMenuAddButton(widid, "E&xit\tCtrl+Q", menu, 0L, cmdEXIT);
00071
00072     menu = UMenuAddPulldown(widid, "&Edit", UMENU_NULL);
00073     UMenuAddButton(widid, "&Undo\tCtrl+Z", menu, 0L, cmdUNDO);
00074     UMenuAddSeparator(widid, menu);
00075     UMenuAddButton(widid, "Cu&t\tCtrl+X", menu, 0L, cmdCUT);
00076     UMenuAddButton(widid, "&Copy\tCtrl+C", menu, 0L, cmdCOPY);
00077     UMenuAddButton(widid, "&Paste\tCtrl+V", menu, 0L, cmdPASTE);
00078     UMenuAddSeparator(widid, menu);
00079     UMenuAddButton(widid, "Select &All\tCtrl+A", menu, 0L, cmdSELECT_ALL);
00080     UMenuAddButton(widid, "&Erase all", menu, 0L, cmdCLEAR_ALL);
00081     UMenuAddSeparator(widid, menu);
00082     UMenuAddButton(widid, "&Find...\tCtrl+F", menu, 0L, cmdFIND);
00083     UMenuAddButton(widid, "Find next\tF3", menu, 0L, cmdREPEAT);
00084     UMenuAddSeparator(widid, menu);
00085     UMenuAddButton(widid, "F&ont...", menu, 0L, cmdFONT);
00086
00087     menu = UMenuAddPulldown(widid, "&View", UMENU_NULL);
00088     UMenuAddButton(widid, "&Toolbar", menu, 0L, cmdTOOLBAR);
00089     UMenuAddButton(widid, "&Status Bar", menu, 0L, cmdSTATUS_BAR);
00090     UMenuAddButton(widid, "&Browser Bar", menu, 0L, cmdBROWSER_BAR);
00091     UMenuAddButton(widid, "&Files Bar", menu, 0L, cmdFILES_BAR);
00092     UMenuAddButton(widid, "&Multi-Users Bar", menu, 0L, cmdMULTI_BAR);
00093     UMenuAddButton(widid, "T&ags Bar", menu, 0L, cmdTAGS_BAR);
00094     UMenuAddButton(widid, "&Console Bar", menu, 0L, cmdCONSOLE_BAR);
00095     UMenuAddButton(widid, "&Workspace Bar", menu, 0L, cmdWORKSPACE);
00096     UMenuAddSeparator(widid, menu);
00097     UMenuAddButton(widid, "Change browser &location...", menu, 0L, cmdOPEN);
00098     UMenuAddButton(widid, "S&ave settings for location...", menu, 0L, cmdSAVESETTINGS);
00099
00100     menu = UMenuAddPulldown(widid, "&Admin", UMENU_NULL);
00101     UMenuAddButton(widid, "Pr&eferences...\tCtrl+F1", menu, 0L, cmdPREFERENCES);
00102     UMenuAddButton(widid, "&Command Line...", menu, 0L, cmdCMDLINE);
00103     UMenuAddSeparator(widid, menu);
00104     UMenuAddButton(widid, "&Login...", menu, 0L, cmdLOGIN);
00105     UMenuAddButton(widid, "Lo&gout", menu, 0L, cmdLOGOUT);
00106     UMenuAddSeparator(widid, menu);
00107     UMenuAddButton(widid, "&Stop cvs", menu, 0L, cmdSTOPCVS);
00108     menu = UMenuAddPulldown(widid, "Macros admin", menu);
00109     for(cnt = 0, i = gMacrosAdmin.entries.begin(); i != gMacrosAdmin.entries.end(); ++i, cnt++)
00110     {
00111         UMenuAddButton(widid, (*i).name, menu, 0L, cmdMACROADMIN + cnt);
00112     }
00113
00114     menu = UMenuAddPulldown(widid, "&Create", UMENU_NULL);
00115     UMenuAddButton(widid, "&Create a new repository...", menu, 0L, cmdINIT);
00116     UMenuAddSeparator(widid, menu);
00117     UMenuAddButton(widid, "Import module...", menu, 0L, cmdIMPORT);
00118     UMenuAddButton(widid, "Checkout module...", menu, 0L, cmdCHECKOUT);
00119     UMenuAddSeparator(widid, menu);
00120     UMenuAddButton(widid, "&Create a tag by module...", menu, 0L, cmdRTAGCREATE);
00121     UMenuAddButton(widid, "&Delete a tag by module...", menu, 0L, cmdRTAGDELETE);
00122     UMenuAddButton(widid, "Create a &branch by module...", menu, 0L, cmdRTAGBRANCH);
00123
00124     menu = UMenuAddPulldown(widid, "&Modify", UMENU_NULL);
00125     UMenuAddButton(widid, "&Update selection...\tCtrl+U", menu, 0L, cmdUPDATE);
00126     UMenuAddButton(widid, "Co&mmit selection...\tCtrl+M", menu, 0L, cmdCOMMIT);
00127     UMenuAddSeparator(widid, menu);
00128     UMenuAddButton(widid, "&Add selection", menu, 0L, cmdADD);
00129     UMenuAddButton(widid, "Add selection binar&y", menu, 0L, cmdADDB);
00130     UMenuAddButton(widid, "&Remove selection", menu, 0L, cmdRMV);
00131     UMenuAddSeparator(widid, menu);
00132     UMenuAddButton(widid, "Erase &selection\tCtrl+Backspace", menu, 0L, cmdTRASH);
00133     UMenuAddSeparator(widid, menu);
00134     UMenuAddButton(widid, "&Create a tag on selection...", menu, 0L, cmdTAGNEW);
00135     UMenuAddButton(widid, "&Delete a tag on selection...", menu, 0L, cmdTAGDELETE);
00136     UMenuAddButton(widid, "Create a &branch on selection...", menu, 0L, cmdTAGBRANCH);
00137
00138     menu = UMenuAddPulldown(widid, "&Query", UMENU_NULL);
00139     UMenuAddButton(widid, "E&xplore selection\tF2", menu, 0L, cmdEXPLORE);
00140     UMenuAddButton(widid, "&Query Update\tF4", menu, 0L, cmdQUERYUPDATE);
00141     UMenuAddButton(widid, "R&eload view\tF5", menu, 0L, cmdRELOAD);
00142     UMenuAddSeparator(widid, menu);
00143     UMenuAddButton(widid, "View selection\tF7", menu, 0L, cmdEDITSEL);
00144     UMenuAddButton(widid, "View default", menu, 0L, cmdEDITSELDEF);
00145     UMenuAddSeparator(widid, menu);
00146     UMenuAddButton(widid, "&Diff selection\tAlt+=", menu, 0L, cmdDIFF);
00147     UMenuAddButton(widid, "&Log selection", menu, 0L, cmdLOG);
00148     UMenuAddButton(widid, "Status sele&ction", menu, 0L, cmdSTATUS);
00149     UMenuAddButton(widid, "Graph selection\tCtrl+G", menu, 0L, cmdGRAPH);
00150
00151     menu = UMenuAddPulldown(widid, "&Trace", UMENU_NULL);
00152     UMenuAddButton(widid, "Lock selection", menu, 0L, cmdLOCKF);
00153     UMenuAddButton(widid, "Unlock selection", menu, 0L, cmdUNLOCKF);
00154     UMenuAddButton(widid, "Edit selection", menu, 0L, cmdEDIT);
00155     UMenuAddButton(widid, "Unedit selection", menu, 0L, cmdUNEDIT);
00156     UMenuAddButton(widid, "Add a Watch on selection", menu, 0L, cmdWATCHON);
00157     UMenuAddButton(widid, "Remove a watch from selection", menu, 0L, cmdWATCHOFF);
00158     UMenuAddSeparator(widid, menu);
00159     UMenuAddButton(widid, "Release selection", menu, 0L, cmdRELEASE);
00160     UMenuAddSeparator(widid, menu);
00161     UMenuAddButton(widid, "Watchers of selection", menu, 0L, cmdWATCHERS);
00162     UMenuAddButton(widid, "Editors of selection", menu, 0L, cmdEDITORS);
00163
00164     menu = UMenuAddPulldown(widid, "Macro&s", UMENU_NULL);
00165     for(cnt = 0, i = gMacrosSel.entries.begin(); i != gMacrosSel.entries.end(); ++i, cnt++)
00166     {
00167         UMenuAddButton(widid, (*i).name, menu, 0L, cmdSELMACRO + cnt);
00168     }
00169
00170     menu = UMenuAddPulldown(widid, "&Window", UMENU_NULL);
00171     UMenuAddButton(widid, "&Cascade", menu, 0L, cmdCASCADE);
00172     UMenuAddButton(widid, "&Tile", menu, 0L, cmdTILE_HORZ);
00173     UMenuAddButton(widid, "&Arrange Icons", menu, 0L, cmdARRANGE);
00174
00175     menu = UMenuAddPulldown(widid, "&Help", UMENU_NULL);
00176     UMenuAddButton(widid, "&Help Topics", menu, 0L, cmdFINDER);
00177     UMenuAddButton(widid, "Help on cvs-1.10", menu, 0L, cmdCVS);
00178     UMenuAddButton(widid, "Help on cvs client", menu, 0L, cmdCVSCLIENT);
00179     UMenuAddSeparator(widid, menu);
00180     UMenuAddButton(widid, "&About wincvs...", menu, 0L, cmdABOUT);
00181     UMenuAddButton(widid, "&Credits", menu, 0L, cmdCREDITS);
00182     UMenuAddButton(widid, "C&opyrights", menu, 0L, cmdCOPYRIGHTS);
00183 }
Generated on Sun Feb 24 01:21:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UCvsMenubar.h Source File

common/UCvsMenubar.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 /*
00022  *
00023  */
00024
00025 #ifndef UCVSMENU_H
00026 #define UCVSMENU_H
00027
00028 #include "umenu.h"
00029
00030 class UCvsMenubar : public UMenu
00031 {
00032     UDECLARE_DYNAMIC(UCvsMenubar)
00033 public:
00034     UCvsMenubar();
00035     virtual ~UCvsMenubar();
00036
00037 protected:
00038
00039     ev_msg void OnDestroy();
00040     ev_msg void OnCreate();
00041
00042     UDECLARE_MESSAGE_MAP()
00043 };
00044
00045 void CreateMainMenubar(int widid);
00046
00047 #endif
Generated on Sun Feb 24 01:21:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UCvsToolbar.cpp Source File

common/UCvsToolbar.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 /*
00022  *
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #include "UCvsToolbar.h"
00028 #include "UCvsCommands.h"
00029
00030 UIMPLEMENT_DYNAMIC(UCvsToolbar, UToolbar)
00031
00032 UBEGIN_MESSAGE_MAP(UCvsToolbar, UToolbar)
00033     ON_UDESTROY(UCvsToolbar)
00034     ON_UCREATE(UCvsToolbar)
00035 UEND_MESSAGE_MAP()
00036
00037 UCvsToolbar::UCvsToolbar() : UToolbar(kUCvsToolbarID)
00038 {
00039 }
00040
00041 UCvsToolbar::~UCvsToolbar()
00042 {
00043 }
00044
00045 void UCvsToolbar::OnDestroy(void)
00046 {
00047     delete this;
00048 }
00049
00050 void UCvsToolbar::OnCreate(void)
00051 {
00052 }
00053
00054 void CreateMainToolbar(void)
00055 {
00056     UTB_INIT init;
00057     init.widthbtn = 16;
00058     init.heightbtn = 16;
00059     init.title = "Main Toolbar";
00060     UEventSendMessage(kUCvsToolbarID, EV_TB_INIT, 0, &init);
00061
00062     UTB_BUTTON updtBtn = {
00063         "update.xpm",
00064         cmdUPDATE,
00065         DDV_NONE,
00066         DDD_NONE,
00067         "Update the selected items, changes your disk only\nUpdate selected"
00068     };
00069     UTB_BUTTON commitBtn = {
00070         "commit.xpm",
00071         cmdCOMMIT,
00072         DDV_NONE,
00073         DDD_NONE,
00074         "Commit the selected items, changes the remote repository\nCommit selected"
00075     };
00076     UTB_BUTTON stopBtn = {
00077         "stop.xpm",
00078         cmdSTOPCVS,
00079         DDV_NONE,
00080         DDD_NONE,
00081         "Stop when cvs is running...\nStop cvs..."
00082     };
00083     UTB_BUTTON ignoreBtn = {
00084         "ignore.xpm",
00085         cmdIGNORE,
00086         DDV_NONE,
00087         DDD_NONE,
00088         "View or hide the cvs ignored files/folders\nIgnore switch"
00089     };
00090     UTB_BUTTON reloadBtn = {
00091         "reload.xpm",
00092         cmdRELOAD,
00093         DDV_NONE,
00094         DDD_NONE,
00095         "Refresh the views, updating the contents\nRefresh view"
00096     };
00097     UTB_BUTTON exploreBtn = {
00098         "explore.xpm",
00099         cmdEXPLORE,
00100         DDV_NONE,
00101         DDD_NONE,
00102         "Open an explorer window for this selection\nExplore selection"
00103     };
00104     UTB_BUTTON upBtn = {
00105         "upfolder.xpm",
00106         cmdUPFOLDER,
00107         DDV_NONE,
00108         DDD_NONE,
00109         "Go to the upper folder and refresh\nUp one level"
00110     };
00111     UTB_BUTTON diffBtn = {
00112         "diff.xpm",
00113         cmdDIFF,
00114         DDV_NONE,
00115         DDD_NONE,
00116         "Print the differences with the CVS remote repository\nDiff selected"
00117     };
00118     UTB_BUTTON logBtn = {
00119         "log.xpm",
00120         cmdLOG,
00121         DDV_NONE,
00122         DDD_NONE,
00123         "Print the history of the selected files\nLog selected"
00124     };
00125     UTB_BUTTON statusBtn = {
00126         "status.xpm",
00127         cmdSTATUS,
00128         DDV_NONE,
00129         DDD_NONE,
00130         "Print the current status of the selected files\nStatus selected"
00131     };
00132     UTB_BUTTON graphBtn = {
00133         "graph.xpm",
00134         cmdGRAPH,
00135         DDV_NONE,
00136         DDD_NONE,
00137         "Print the history as a graph of the selected files\nGraph selected"
00138     };
00139     UTB_BUTTON trashBtn = {
00140         "trash.xpm",
00141         cmdTRASH,
00142         DDV_NONE,
00143         DDD_NONE,
00144         "Erase the selection from your disk\nErase selected"
00145     };
00146     UTB_BUTTON addBtn = {
00147         "add.xpm",
00148         cmdADD,
00149         DDV_NONE,
00150         DDD_NONE,
00151         "Add the selected items to the remote CVS repository\nAdd selected"
00152     };
00153     UTB_BUTTON addbBtn = {
00154         "addb.xpm",
00155         cmdADDB,
00156         DDV_NONE,
00157         DDD_NONE,
00158         "Add the selected binary items to the remote CVS repository\nAdd selected binary"
00159     };
00160     UTB_BUTTON rmvBtn = {
00161         "remove.xpm",
00162         cmdRMV,
00163         DDV_NONE,
00164         DDD_NONE,
00165         "Remove the selected items to the remote CVS repository\nRemove selected"
00166     };
00167     UTB_BUTTON tagBtn = {
00168         "tag.xpm",
00169         cmdTAGNEW,
00170         DDV_NONE,
00171         DDD_NONE,
00172         "Create/move a tag on the selection\nTag selection"
00173     };
00174     UTB_BUTTON untagBtn = {
00175         "untag.xpm",
00176         cmdTAGDELETE,
00177         DDV_NONE,
00178         DDD_NONE,
00179         "Remove a tag on the selection\nUntag selection"
00180     };
00181     UTB_BUTTON branchBtn = {
00182         "branch.xpm",
00183         cmdTAGBRANCH,
00184         DDV_NONE,
00185         DDD_NONE,
00186         "Open (fork) a branch on the selection\nFork selection"
00187     };
00188     UTB_BUTTON lockBtn = {
00189         "lock.xpm",
00190         cmdLOCKF,
00191         DDV_NONE,
00192         DDD_NONE,
00193         "Lock the selected file on the remote repository until next commit\nLock selection"
00194     };
00195     UTB_BUTTON unlockBtn = {
00196         "unlock.xpm",
00197         cmdUNLOCKF,
00198         DDV_NONE,
00199         DDD_NONE,
00200         "Unlock the selected file on the remote repository\nUnlock selection"
00201     };
00202     UTB_BUTTON watchBtn = {
00203         "watch.xpm",
00204         cmdWATCHON,
00205         DDV_NONE,
00206         DDD_NONE,
00207         "Put a watch on the selected files\nWatch selection"
00208     };
00209     UTB_BUTTON unwatchBtn = {
00210         "unwatch.xpm",
00211         cmdWATCHOFF,
00212         DDV_NONE,
00213         DDD_NONE,
00214         "Release a watch on the selected files\nRelease watch selection"
00215     };
00216     UTB_BUTTON editBtn = {
00217         "edit.xpm",
00218         cmdEDIT,
00219         DDV_NONE,
00220         DDD_NONE,
00221         "Edit the selected files\nEdit selection"
00222     };
00223     UTB_BUTTON uneditBtn = {
00224         "unedit.xpm",
00225         cmdUNEDIT,
00226         DDV_NONE,
00227         DDD_NONE,
00228         "Unedit the selected files\nUnedit selection"
00229     };
00230     UTB_BUTTON releaseBtn = {
00231         "release.xpm",
00232         cmdRELEASE,
00233         DDV_NONE,
00234         DDD_NONE,
00235         "Release the selected files\nRelease selection"
00236     };
00237     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &updtBtn);
00238     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &commitBtn);
00239     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00240     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &stopBtn);
00241     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00242     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &addBtn);
00243     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &addbBtn);
00244     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &rmvBtn);
00245     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00246     UEventSendMessage(kUCvsToolbarID, EV_TB_CHECKBTN, 0, &ignoreBtn);
00247     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &reloadBtn);
00248     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &exploreBtn);
00249     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &upBtn);
00250     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00251     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &diffBtn);
00252     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &logBtn);
00253     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &statusBtn);
00254     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00255     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &graphBtn);
00256     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00257     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &trashBtn);
00258     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00259     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &tagBtn);
00260     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &untagBtn);
00261     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &branchBtn);
00262     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00263     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &lockBtn);
00264     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &unlockBtn);
00265     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00266     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &watchBtn);
00267     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &unwatchBtn);
00268     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00269     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &editBtn);
00270     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &uneditBtn);
00271     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00272     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &releaseBtn);
00273
00274     UEventSendMessage(kUCvsToolbarID, EV_TB_END, 0, 0L);
00275 }
Generated on Sun Feb 24 01:21:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UCvsToolbar.h Source File

common/UCvsToolbar.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- February 2000
00019  */
00020
00021 /*
00022  *
00023  */
00024
00025 #ifndef UCVSTOOLBAR_H
00026 #define UCVSTOOLBAR_H
00027
00028 #include "utoolbar.h"
00029
00030 class UCvsToolbar : public UToolbar
00031 {
00032     UDECLARE_DYNAMIC(UCvsToolbar)
00033 public:
00034     UCvsToolbar();
00035     virtual ~UCvsToolbar();
00036
00037 protected:
00038
00039     ev_msg void OnDestroy();
00040     ev_msg void OnCreate();
00041
00042     UDECLARE_MESSAGE_MAP()
00043 };
00044
00045 void CreateMainToolbar(void);
00046
00047 #endif
Generated on Sun Feb 24 01:21:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UpdateDlg.cpp Source File

common/UpdateDlg.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00019  */
00020
00021 /*
00022  * UpdateDlg.cpp : the cvs update dialog
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef WIN32
00028 #   include "wincvs.h"
00029 #   include "OptionalPropertySheet.h"
00030 #endif /* WIN32 */
00031
00032 #if qUnix
00033 #   include "UCvsDialogs.h"
00034 #endif
00035
00036 #ifdef qMacCvsPP
00037 #   include <UModalDialogs.h>
00038 #   include <LMultiPanelView.h>
00039 #   include <LCheckBox.h>
00040 #   include <LEditText.h>
00041 #   include <LPopupGroupBox.h>
00042 #   include <LRadioButton.h>
00043 #   include "LPopupFiller.h"
00044
00045 #   include "MacCvsConstant.h"
00046 #endif /* qMacCvsPP */
00047
00048 #include "UpdateDlg.h"
00049 #include "CvsPrefs.h"
00050
00051 #ifdef WIN32
00052 #   ifdef _DEBUG
00053 #   define new DEBUG_NEW
00054 #   undef THIS_FILE
00055     static char THIS_FILE[] = __FILE__;
00056 #   endif
00057 #endif /* WIN32 */
00058
00059 char *sDefTagNames[] =
00060 {
00061     "1.1",
00062     "1.6.2.4",
00063     "HEAD",
00064     "branch-release-1-0",
00065     0L
00066 };
00067
00068 char *sDefDateNames[] =
00069 {
00070     "1998-3",
00071     "1998-3-24",
00072     "1998-3-24 20:55",
00073     "24 Mar",
00074     "24 Mar 1998",
00075     "<=1998-3-24",
00076     0L
00077 };
00078
00079 char *sDefRevDateNames[] =
00080 {
00081     "1.1",
00082     "1.6.2.4",
00083     "HEAD",
00084     "branch-release-1-0",
00085     "1998-3",
00086     "1998-3-24",
00087     "1998-3-24 20:55",
00088     "24 Mar",
00089     "24 Mar 1998",
00090     "<=1998-3-24",
00091     0L
00092 };
00093
00094 CMString gRevNames(10, "P_TagNames", sDefTagNames);
00095 CMString gDateNames(10, "P_DateNames", sDefDateNames);
00096 CMString gDateOrRevNames(20, "P_RebDateNames", sDefRevDateNames);
00097
00098 #ifdef WIN32
00099 #include "GetPrefs.h"
00100
00101 IMPLEMENT_DYNCREATE(CUpdateMain, CPropertyPage)
00102
00103 CUpdateMain::CUpdateMain() : CPropertyPage(CUpdateMain::IDD)
00104 {
00105     //{{AFX_DATA_INIT(CUpdateMain)
00106     m_delsticky = FALSE;
00107     m_norecurs = FALSE;
00108     m_stdout = FALSE;
00109     m_createmissdir = FALSE;
00110     m_getcleancopy = FALSE;
00111     //}}AFX_DATA_INIT
00112 }
00113
00114 CUpdateMain::~CUpdateMain()
00115 {
00116 }
00117
00118 void CUpdateMain::DoDataExchange(CDataExchange* pDX)
00119 {
00120     CPropertyPage::DoDataExchange(pDX);
00121     //{{AFX_DATA_MAP(CUpdateMain)
00122     DDX_Check(pDX, IDC_DELSTICKY, m_delsticky);
00123     DDX_Check(pDX, IDC_NORECURS, m_norecurs);
00124     DDX_Check(pDX, IDC_STDOUT, m_stdout);
00125     DDX_Check(pDX, IDC_CREATEMISSDIR, m_createmissdir);
00126     DDX_Check(pDX, IDC_CLEANCOPY, m_getcleancopy);
00127     //}}AFX_DATA_MAP
00128 }
00129
00130
00131 BEGIN_MESSAGE_MAP(CUpdateMain, CPropertyPage)
00132     //{{AFX_MSG_MAP(CUpdateMain)
00133         // NOTE: the ClassWizard will add message map macros here
00134     //}}AFX_MSG_MAP
00135 END_MESSAGE_MAP()
00136
00137 IMPLEMENT_DYNCREATE(CUpdateSticky, CPropertyPage)
00138
00139 CUpdateSticky::CUpdateSticky(const char *rev, const char *date) : CPropertyPage(CUpdateSticky::IDD)
00140 {
00141     //{{AFX_DATA_INIT(CUpdateSticky)
00142     m_date = date;
00143     m_rev = rev;
00144     m_hasdate = FALSE;
00145     m_hasrev = FALSE;
00146     m_match = FALSE;
00147     //}}AFX_DATA_INIT
00148
00149     m_revCombo.SetItems(&gRevNames);
00150     m_dateCombo.SetItems(&gDateNames);
00151 }
00152
00153 CUpdateSticky::CUpdateSticky() : CPropertyPage(CUpdateSticky::IDD)
00154 {
00155 }
00156
00157 CUpdateSticky::~CUpdateSticky()
00158 {
00159 }
00160
00161 void CUpdateSticky::DoDataExchange(CDataExchange* pDX)
00162 {
00163     CPropertyPage::DoDataExchange(pDX);
00164     //{{AFX_DATA_MAP(CUpdateSticky)
00165     DDX_Control(pDX, IDC_COMBODATE, m_dateCombo);
00166     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00167     DDX_CBString(pDX, IDC_COMBODATE, m_date);
00168     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00169     DDX_Check(pDX, IDC_DATE, m_hasdate);
00170     DDX_Check(pDX, IDC_REV, m_hasrev);
00171     DDX_Check(pDX, IDC_MATCH, m_match);
00172     //}}AFX_DATA_MAP
00173
00174     if( m_hasrev )
00175     {
00176         DDV_MinChars(pDX, m_rev, 1);
00177     }
00178
00179     if( m_hasdate )
00180     {
00181         DDV_MinChars(pDX, m_date, 1);
00182     }
00183
00184     if( !pDX->m_bSaveAndValidate )
00185     {
00186         OnDate();
00187         OnRev();
00188     }
00189
00190     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00191     DDX_ComboMString(pDX, IDC_COMBODATE, m_dateCombo);
00192 }
00193
00194 BEGIN_MESSAGE_MAP(CUpdateSticky, CPropertyPage)
00195     //{{AFX_MSG_MAP(CUpdateSticky)
00196     ON_BN_CLICKED(IDC_DATE, OnDate)
00197     ON_BN_CLICKED(IDC_REV, OnRev)
00198     //}}AFX_MSG_MAP
00199 END_MESSAGE_MAP()
00200
00201
00202 void CUpdateSticky::OnDate()
00203 {
00204     CButton* but = (CButton *)GetDlgItem(IDC_DATE);
00205     CWnd* wnd = GetDlgItem(IDC_COMBODATE);
00206     wnd->EnableWindow(but->GetCheck() == 1);
00207 }
00208
00209 void CUpdateSticky::OnRev()
00210 {
00211     CButton* but = (CButton *)GetDlgItem(IDC_REV);
00212     CWnd* wnd = GetDlgItem(IDC_COMBOREV);
00213     wnd->EnableWindow(but->GetCheck() == 1);
00214 }
00215
00216 IMPLEMENT_DYNCREATE(CUpdateMerge, CPropertyPage)
00217
00218 CUpdateMerge::CUpdateMerge(bool isCheckout, const char *rev1, const char *rev2, const char *date1, const char *date2)
00219     : CPropertyPage(CUpdateMerge::IDD)
00220 {
00221     //{{AFX_DATA_INIT(CUpdateMerge)
00222     m_rev1 = rev1;
00223     m_rev2 = rev2;
00224     m_merge = 0;
00225     m_hasDate1 = FALSE;
00226     m_hasDate2 = FALSE;
00227     m_date1 = _T("");
00228     m_date2 = _T("");
00229     //}}AFX_DATA_INIT
00230
00231     m_isCheckout = isCheckout;
00232
00233     m_rev1Combo.SetItems(m_isCheckout ? &gReleasesNames : &gRevNames);
00234     m_rev2Combo.SetItems(m_isCheckout ? &gReleasesNames : &gRevNames);
00235     m_date1Combo.SetItems(&gDateNames);
00236     m_date2Combo.SetItems(&gDateNames);
00237 }
00238
00239 CUpdateMerge::CUpdateMerge() : CPropertyPage(CUpdateMerge::IDD)
00240 {
00241 }
00242
00243 CUpdateMerge::~CUpdateMerge()
00244 {
00245 }
00246
00247 void CUpdateMerge::DoDataExchange(CDataExchange* pDX)
00248 {
00249     CPropertyPage::DoDataExchange(pDX);
00250     //{{AFX_DATA_MAP(CUpdateMerge)
00251     DDX_Control(pDX, IDC_COMBODATE2, m_date2Combo);
00252     DDX_Control(pDX, IDC_COMBODATE1, m_date1Combo);
00253     DDX_Control(pDX, IDC_COMBOREV2, m_rev2Combo);
00254     DDX_Control(pDX, IDC_COMBOREV, m_rev1Combo);
00255     DDX_CBString(pDX, IDC_COMBOREV, m_rev1);
00256     DDX_CBString(pDX, IDC_COMBOREV2, m_rev2);
00257     DDX_Radio(pDX, IDC_MERGE, m_merge);
00258     DDX_Check(pDX, IDC_CHECKDATE1, m_hasDate1);
00259     DDX_Check(pDX, IDC_CHECKDATE2, m_hasDate2);
00260     DDX_CBString(pDX, IDC_COMBODATE1, m_date1);
00261     DDX_CBString(pDX, IDC_COMBODATE2, m_date2);
00262     //}}AFX_DATA_MAP
00263
00264     if( m_merge == 1 || m_merge == 2 )
00265     {
00266         DDV_MinChars(pDX, m_rev1, 1);
00267         if( m_hasDate1 )
00268         {
00269             DDV_MinChars(pDX, m_date1, 1);
00270         }
00271     }
00272
00273     if( m_merge == 2 )
00274     {
00275         DDV_MinChars(pDX, m_rev2, 1);
00276         if( m_hasDate2 )
00277         {
00278             DDV_MinChars(pDX, m_date2, 1);
00279         }
00280     }
00281
00282     if( !pDX->m_bSaveAndValidate )
00283     {
00284         OnMerge();
00285     }
00286
00287     DDX_ComboMString(pDX, IDC_COMBOREV, m_rev1Combo);
00288     DDX_ComboMString(pDX, IDC_COMBOREV2, m_rev2Combo);
00289     DDX_ComboMString(pDX, IDC_COMBODATE1, m_date1Combo);
00290     DDX_ComboMString(pDX, IDC_COMBODATE2, m_date2Combo);
00291 }
00292
00293 void CUpdateMerge::OnMerge()
00294 {
00295     CButton* chkMerge1 = (CButton*)GetDlgItem(IDC_MERGE1);
00296     CButton* chkMerge2 = (CButton*)GetDlgItem(IDC_MERGE2);
00297     CWnd* wndRev1 = GetDlgItem(IDC_COMBOREV);
00298     CWnd* wndRev2 = GetDlgItem(IDC_COMBOREV2);
00299
00300     CButton* chkDate1 = (CButton*)GetDlgItem(IDC_CHECKDATE1);
00301     CButton* chkDate2 = (CButton*)GetDlgItem(IDC_CHECKDATE2);
00302     CWnd* wndDate1 = GetDlgItem(IDC_COMBODATE1);
00303     CWnd* wndDate2 = GetDlgItem(IDC_COMBODATE2);
00304
00305     if( chkMerge1->GetCheck() == 1 )
00306     {
00307         wndRev1->EnableWindow(TRUE);
00308         wndRev2->EnableWindow(FALSE);
00309     }
00310     else if( chkMerge2->GetCheck() == 1 )
00311     {
00312         wndRev1->EnableWindow(TRUE);
00313         wndRev2->EnableWindow(TRUE);
00314     }
00315     else
00316     {
00317         wndRev1->EnableWindow(FALSE);
00318         wndRev2->EnableWindow(FALSE);
00319     }
00320
00321     chkDate1->EnableWindow(wndRev1->IsWindowEnabled());
00322     chkDate2->EnableWindow(wndRev2->IsWindowEnabled());
00323     wndDate1->EnableWindow(wndRev1->IsWindowEnabled() && chkDate1->GetCheck());
00324     wndDate2->EnableWindow(wndRev2->IsWindowEnabled() && chkDate2->GetCheck());
00325 }
00326
00327 void CUpdateMerge::OnMerge1()
00328 {
00329     OnMerge();
00330 }
00331
00332 void CUpdateMerge::OnMerge2()
00333 {
00334     OnMerge();
00335 }
00336
00337 void CUpdateMerge::OnCheckdate1()
00338 {
00339     OnMerge();
00340 }
00341
00342 void CUpdateMerge::OnCheckdate2()
00343 {
00344     OnMerge();
00345 }
00346
00347 BEGIN_MESSAGE_MAP(CUpdateMerge, CPropertyPage)
00348     //{{AFX_MSG_MAP(CUpdateMerge)
00349     ON_BN_CLICKED(IDC_MERGE, OnMerge)
00350     ON_BN_CLICKED(IDC_MERGE1, OnMerge1)
00351     ON_BN_CLICKED(IDC_MERGE2, OnMerge2)
00352     ON_BN_CLICKED(IDC_CHECKDATE1, OnCheckdate1)
00353     ON_BN_CLICKED(IDC_CHECKDATE2, OnCheckdate2)
00354     //}}AFX_MSG_MAP
00355 END_MESSAGE_MAP()
00356
00357 #endif /* WIN32 */
00358
00359 #ifdef qMacCvsPP
00360 static void DoDataExchange_UpdateMerge(LWindow *theDialog, bool & merge1, bool & merge2,
00361     CPStr & sLastRev1, CPStr & sLastRev2, bool putValue)
00362 {
00363     LRadioButton *chkHasRev = dynamic_cast<LRadioButton*>
00364         (theDialog->FindPaneByID(item_CheckRevTag1));
00365     LEditText *editRev = dynamic_cast<LEditText*>
00366         (theDialog->FindPaneByID(item_EditRevTag1));
00367     LRadioButton *chkHasRev2 = dynamic_cast<LRadioButton*>
00368         (theDialog->FindPaneByID(item_CheckRevTag2));
00369     LEditText *editRev2 = dynamic_cast<LEditText*>
00370         (theDialog->FindPaneByID(item_EditRevTag2));
00371     LPopupFiller *fill1 = dynamic_cast<LPopupFiller*>
00372         (theDialog->FindPaneByID(item_FillerRev1));
00373     LPopupFiller *fill2 = dynamic_cast<LPopupFiller*>
00374         (theDialog->FindPaneByID(item_FillerRev2));
00375
00376     fill1->DoDataExchange(gRevNames, putValue);
00377     fill2->DoDataExchange(gRevNames, putValue);
00378
00379     if(putValue)
00380     {
00381         if(merge1 && merge2)
00382             theDialog->SetValueForPaneID (item_CheckRevTag2, Button_On);
00383         else if(merge1)
00384             theDialog->SetValueForPaneID (item_CheckRevTag1, Button_On);
00385         else
00386             theDialog->SetValueForPaneID (item_MergeNone, Button_On);
00387
00388         editRev->SetText((Ptr)(const char *)sLastRev1, sLastRev1.length());
00389         editRev2->SetText((Ptr)(const char *)sLastRev2, sLastRev2.length());
00390     }
00391     else
00392     {
00393         if(theDialog->GetValueForPaneID(item_CheckRevTag2) == Button_On)
00394         {
00395             merge1 = merge2 = true;
00396         }
00397         else if (theDialog->GetValueForPaneID(item_CheckRevTag1) == Button_On)
00398         {
00399             merge1 = true;
00400             merge2 = false;
00401         }
00402         else
00403         {
00404             merge1 = merge2 = false;
00405         }
00406
00407         char str[255];
00408         Size len;
00409
00410         editRev->GetText(str, 254, &len);
00411         sLastRev1.set(str, len);
00412         editRev2->GetText(str, 254, &len);
00413         sLastRev2.set(str, len);
00414     }
00415 }
00416
00417 static void DoDataExchange_UpdateSticky(LWindow *theDialog, bool & hasDate, bool & hasRev,
00418     CPStr & sLastDate, CPStr & sLastRev, bool & useMostRecent, bool putValue)
00419 {
00420     LCheckBox *chkHasDate = dynamic_cast<LCheckBox*>
00421         (theDialog->FindPaneByID(item_CheckDate));
00422     LCheckBox *chkHasRev = dynamic_cast<LCheckBox*>
00423         (theDialog->FindPaneByID(item_CheckRevTag));
00424     LCheckBox *chkMostRecent = dynamic_cast<LCheckBox*>
00425         (theDialog->FindPaneByID(item_MostRecentRev));
00426     LEditText *editDate = dynamic_cast<LEditText*>
00427         (theDialog->FindPaneByID(item_EditDate));
00428     LEditText *editRev = dynamic_cast<LEditText*>
00429         (theDialog->FindPaneByID(item_EditRevTag));
00430     LPopupFiller *fillTag = dynamic_cast<LPopupFiller*>
00431         (theDialog->FindPaneByID(item_FillerTag));
00432     LPopupFiller *fillDate = dynamic_cast<LPopupFiller*>
00433         (theDialog->FindPaneByID(item_FillerDate));
00434
00435     fillTag->DoDataExchange(gRevNames, putValue);
00436     fillDate->DoDataExchange(gDateNames, putValue);
00437
00438     if(putValue)
00439     {
00440         chkHasDate->SetValue(hasDate ? Button_On : Button_Off);
00441         chkHasRev->SetValue(hasRev ? Button_On : Button_Off);
00442         chkMostRecent->SetValue(useMostRecent ? Button_On : Button_Off);
00443         editDate->SetText((Ptr)(const char *)sLastDate, sLastDate.length());
00444         editRev->SetText((Ptr)(const char *)sLastRev, sLastRev.length());
00445     }
00446     else
00447     {
00448         hasDate = chkHasDate->GetValue() == Button_On;
00449         hasRev = chkHasRev->GetValue() == Button_On;
00450         useMostRecent = chkMostRecent->GetValue() == Button_On;
00451
00452         char str[255];
00453         Size len;
00454
00455         editDate->GetText(str, 254, &len);
00456         sLastDate.set(str, len);
00457         editRev->GetText(str, 254, &len);
00458         sLastRev.set(str, len);
00459     }
00460 }
00461
00462 static void DoDataExchange_UpdateSettings(LWindow *theDialog, bool & toStdout, bool & noRecurs,
00463     bool & resetSticky, bool & createMissDir, bool & getCleanCopy, bool putValue)
00464 {
00465     DoDataExchange (theDialog, item_NoRecurs, noRecurs, putValue);
00466     DoDataExchange (theDialog, item_ToStout, toStdout, putValue);
00467     DoDataExchange (theDialog, item_ResetSticky, resetSticky, putValue);
00468     DoDataExchange (theDialog, item_CreateMissDir, createMissDir, putValue);
00469     DoDataExchange (theDialog, item_GetCleanCopy, getCleanCopy, putValue);
00470
00471 }
00472 #endif /* qMacCvsPP */
00473
00474 #if qUnix
00475 class UCvsUpdate : public UWidget
00476 {
00477     UDECLARE_DYNAMIC(UCvsUpdate)
00478 public:
00479     UCvsUpdate() : UWidget(::UEventGetWidID()) {}
00480     virtual ~UCvsUpdate() {}
00481
00482     enum
00483     {
00484         kOK = EV_COMMAND_START, // 0
00485         kCancel,                // 1
00486         kTabGeneral             // 2
00487     };
00488
00489     virtual void DoDataExchange(bool fill);
00490
00491 protected:
00492     ev_msg int OnOK(void);
00493     ev_msg int OnCancel(void);
00494
00495     UDECLARE_MESSAGE_MAP()
00496 };
00497
00498 UIMPLEMENT_DYNAMIC(UCvsUpdate, UWidget)
00499
00500 UBEGIN_MESSAGE_MAP(UCvsUpdate, UWidget)
00501     ON_UCOMMAND(UCvsUpdate::kOK, UCvsUpdate::OnOK)
00502     ON_UCOMMAND(UCvsUpdate::kCancel, UCvsUpdate::OnCancel)
00503 UEND_MESSAGE_MAP()
00504
00505 int UCvsUpdate::OnOK(void)
00506 {
00507     EndModal(true);
00508     return 0;
00509 }
00510
00511 int UCvsUpdate::OnCancel(void)
00512 {
00513     EndModal(false);
00514     return 0;
00515 }
00516
00517 void UCvsUpdate::DoDataExchange(bool fill)
00518 {
00519     if(fill)
00520     {
00521     }
00522     else
00523     {
00524     }
00525 }
00526
00527 class UCvsUpdate_MAIN : public UWidget
00528 {
00529     UDECLARE_DYNAMIC(UCvsUpdate_MAIN)
00530 public:
00531     UCvsUpdate_MAIN() : UWidget(::UEventGetWidID()) {}
00532     virtual ~UCvsUpdate_MAIN() {}
00533
00534     enum
00535     {
00536         kCheckStdout = EV_COMMAND_START,    // 0
00537         kCheckRecurse,          // 1
00538         kCheckReset,            // 2
00539         kCheckMissing           // 3
00540     };
00541
00542     virtual void DoDataExchange(bool fill);
00543
00544     bool m_toStdout;
00545     bool m_noRecurs;
00546     bool m_resetSticky;
00547     bool m_createMissDir;
00548 protected:
00549
00550     UDECLARE_MESSAGE_MAP()
00551 };
00552
00553 UIMPLEMENT_DYNAMIC(UCvsUpdate_MAIN, UWidget)
00554
00555 UBEGIN_MESSAGE_MAP(UCvsUpdate_MAIN, UWidget)
00556 UEND_MESSAGE_MAP()
00557
00558 void UCvsUpdate_MAIN::DoDataExchange(bool fill)
00559 {
00560     if(fill)
00561     {
00562         m_toStdout = false;
00563         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckStdout, m_toStdout), 0L);
00564         m_noRecurs = false;
00565         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurse, m_noRecurs), 0L);
00566         m_resetSticky = false;
00567         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckReset, m_resetSticky), 0L);
00568         m_createMissDir = false;
00569         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckMissing, m_createMissDir), 0L);
00570     }
00571     else
00572     {
00573         m_toStdout = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckStdout, 0L) != 0;
00574         m_noRecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurse, 0L) != 0;
00575         m_resetSticky = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckReset, 0L) != 0;
00576         m_createMissDir = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckMissing, 0L) != 0;
00577     }
00578 }
00579
00580 class UCvsUpdate_STICKY : public UWidget
00581 {
00582     UDECLARE_DYNAMIC(UCvsUpdate_STICKY)
00583 public:
00584     UCvsUpdate_STICKY(const char *rev, const char *date);
00585     virtual ~UCvsUpdate_STICKY() {}
00586
00587     enum
00588     {
00589         kCheckDate = EV_COMMAND_START,  // 0
00590         kComboDate,         // 1
00591         kCheckRev,          // 2
00592         kComboRev,          // 3
00593         kCheckMatch         // 4
00594     };
00595
00596     virtual void DoDataExchange(bool fill);
00597
00598     UStr m_date;
00599     UStr m_rev;
00600     bool m_hasdate;
00601     bool m_hasrev;
00602     bool m_match;
00603 protected:
00604
00605     ev_msg int OnDate(void);
00606     ev_msg int OnRev(void);
00607
00608     UDECLARE_MESSAGE_MAP()
00609 };
00610
00611 UIMPLEMENT_DYNAMIC(UCvsUpdate_STICKY, UWidget)
00612
00613 UBEGIN_MESSAGE_MAP(UCvsUpdate_STICKY, UWidget)
00614     ON_UCOMMAND(UCvsUpdate_STICKY::kCheckDate, UCvsUpdate_STICKY::OnDate)
00615     ON_UCOMMAND(UCvsUpdate_STICKY::kCheckRev, UCvsUpdate_STICKY::OnRev)
00616 UEND_MESSAGE_MAP()
00617
00618 UCvsUpdate_STICKY::UCvsUpdate_STICKY(const char *rev, const char *date) : UWidget(::UEventGetWidID())
00619 {
00620     m_date = date;
00621     m_rev = rev;
00622     m_hasdate = false;
00623     m_hasrev = false;
00624     m_match = false;
00625 }
00626
00627 int UCvsUpdate_STICKY::OnDate()
00628 {
00629     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDate, 0L);
00630     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboDate, state), 0L);
00631     return 0;
00632 }
00633
00634 int UCvsUpdate_STICKY::OnRev()
00635 {
00636     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRev, 0L);
00637     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev, state), 0L);
00638     return 0;
00639 }
00640
00641 void UCvsUpdate_STICKY::DoDataExchange(bool fill)
00642 {
00643     ::DoDataExchange(fill, GetWidID(), kComboRev, gRevNames);
00644     ::DoDataExchange(fill, GetWidID(), kComboDate, gDateNames);
00645
00646     if(fill)
00647     {
00648         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckDate, m_hasdate), 0L);
00649         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRev, m_hasrev), 0L);
00650         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckMatch, m_match), 0L);
00651
00652         OnDate();
00653         OnRev();
00654     }
00655     else
00656     {
00657         m_hasdate = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDate, 0L);
00658         m_hasrev = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRev, 0L);
00659         m_match = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckMatch, 0L);
00660
00661         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboDate, &m_date);
00662         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboRev, &m_rev);
00663     }
00664 }
00665
00666 class UCvsUpdate_MERGE : public UWidget
00667 {
00668     UDECLARE_DYNAMIC(UCvsUpdate_MERGE)
00669 public:
00670     UCvsUpdate_MERGE(const char *rev1, const char *rev2);
00671     virtual ~UCvsUpdate_MERGE() {}
00672
00673     enum
00674     {
00675         kRadioNone = EV_COMMAND_START,  // 0
00676         kRadioMerge1,       // 1
00677         kRadioMerge2,       // 2
00678         kComboRev1,         // 3
00679         kComboRev2          // 4
00680     };
00681
00682     virtual void DoDataExchange(bool fill);
00683
00684     UStr m_rev1;
00685     UStr m_rev2;
00686     int m_merge;
00687 protected:
00688
00689     ev_msg int OnMerge(int cmd);
00690
00691     UDECLARE_MESSAGE_MAP()
00692 };
00693
00694 UIMPLEMENT_DYNAMIC(UCvsUpdate_MERGE, UWidget)
00695
00696 UBEGIN_MESSAGE_MAP(UCvsUpdate_MERGE, UWidget)
00697     ON_UCOMMAND_RANGE(UCvsUpdate_MERGE::kRadioNone, UCvsUpdate_MERGE::kRadioMerge2, UCvsUpdate_MERGE::OnMerge)
00698 UEND_MESSAGE_MAP()
00699
00700 UCvsUpdate_MERGE::UCvsUpdate_MERGE(const char *rev1, const char *rev2) : UWidget(::UEventGetWidID())
00701 {
00702     m_rev1 = rev1;
00703     m_rev2 = rev2;
00704     m_merge = 0;
00705 }
00706
00707 int UCvsUpdate_MERGE::OnMerge(int cmd)
00708 {
00709     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRadioNone, 0L);
00710     if(state)
00711     {
00712         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev1, 0), 0L);
00713         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev2, 0), 0L);
00714     }
00715     else
00716     {
00717         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev1, 1), 0L);
00718         state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRadioMerge1, 0L);
00719         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev2, state == 0), 0L);
00720     }
00721     return 0;
00722 }
00723
00724 void UCvsUpdate_MERGE::DoDataExchange(bool fill)
00725 {
00726     ::DoDataExchange(fill, GetWidID(), kComboRev1, gRevNames);
00727     ::DoDataExchange(fill, GetWidID(), kComboRev2, gRevNames);
00728
00729     if(fill)
00730     {
00731         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kRadioNone + m_merge, 1), 0L);
00732
00733         OnMerge(kRadioNone + m_merge);
00734     }
00735     else
00736     {
00737         if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRadioNone, 0L))
00738             m_merge = 0;
00739         else if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRadioMerge1, 0L))
00740             m_merge = 1;
00741         else
00742             m_merge = 2;
00743
00744         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboRev1, &m_rev1);
00745         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboRev2, &m_rev2);
00746     }
00747 }
00748 #endif // qUnix
00749
00750 bool CompatGetUpdate(bool & toStdout, bool & noRecurs, bool & resetSticky,
00751                      CPStr & date, CPStr & rev,
00752                      bool & useMostRecent,
00753                      CPStr & rev1, CPStr & rev2,
00754                      bool & createMissDir,
00755                      bool & getCleanCopy)
00756 {
00757     bool userHitOK = false;
00758
00759     static CPStr sLastDate;
00760     static CPStr sLastRev;
00761     static CPStr sLastRev1;
00762     static CPStr sLastRev2;
00763     static CPStr sLastDate1;
00764     static CPStr sLastDate2;
00765
00766     bool hasDate = false;
00767     bool hasRev = false;
00768     bool merge1 = false;
00769     bool merge2 = false;
00770     bool hasDate1 = false;
00771     bool hasDate2 = false;
00772
00773     date = "";
00774     rev = "";
00775     rev1 = "";
00776     rev2 = "";
00777     toStdout = false;
00778     noRecurs = false;
00779     resetSticky = false;
00780     useMostRecent = false;
00781     createMissDir = false;
00782     getCleanCopy = false;
00783
00784 #ifdef WIN32
00785     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgUpdate(), "Update settings");
00786     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00787     CUpdateMain page1;
00788     CUpdateSticky page2(sLastRev, sLastDate);
00789     CUpdateMerge page3(false, sLastRev1, sLastRev2, sLastDate1, sLastDate2);
00790     CGetPrefs_GLOBALS page4;
00791     pages.AddPage(&page1);
00792     pages.AddPage(&page2);
00793     pages.AddPage(&page3);
00794     pages.AddPage(&page4);
00795     if(pages.DoModal() == IDOK)
00796     {
00797         toStdout = page1.m_stdout == TRUE;
00798         noRecurs = page1.m_norecurs == TRUE;
00799         resetSticky = page1.m_delsticky == TRUE;
00800         createMissDir = page1.m_createmissdir == TRUE;
00801         getCleanCopy = page1.m_getcleancopy == TRUE;
00802
00803         sLastDate = page2.m_date;
00804         sLastRev = page2.m_rev;
00805         hasDate = page2.m_hasdate == TRUE;
00806         hasRev = page2.m_hasrev == TRUE;
00807         useMostRecent = page2.m_match == TRUE;
00808
00809         merge1 = page3.m_merge >= 1;
00810         merge2 = page3.m_merge == 2;
00811         sLastRev1 = page3.m_rev1;
00812         sLastRev2 = page3.m_rev2;
00813         hasDate1 = page3.m_hasDate1 == TRUE;
00814         hasDate2 = page3.m_hasDate2 == TRUE;
00815         sLastDate1 = page3.m_date1;
00816         sLastDate2 = page3.m_date2;
00817
00818         page4.StoreValues();
00819         gCvsPrefs.SetHideCommandDlgUpdate(pages.GetHideCommandDlg());
00820         userHitOK = true;
00821     }
00822 #endif /* WIN32 */
00823 #ifdef qMacCvsPP
00824     StDialogHandler theHandler(dlg_Update, LCommander::GetTopCommander());
00825     LWindow *theDialog = theHandler.GetDialog();
00826     ThrowIfNil_(theDialog);
00827     static UInt16 sRuntimePanel = 1;
00828
00829     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00830         (theDialog->FindPaneByID(item_MultiViewPrefs));
00831     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00832
00833     multiView->SwitchToPanel(4);
00834     DoDataExchange_Globals(theDialog, true);
00835     multiView->SwitchToPanel(3);
00836     DoDataExchange_UpdateMerge(theDialog, merge1, merge2, sLastRev1, sLastRev2, true);
00837     multiView->SwitchToPanel(2);
00838     DoDataExchange_UpdateSticky(theDialog, hasDate, hasRev, sLastDate, sLastRev, useMostRecent, true);
00839     multiView->SwitchToPanel(1);
00840     DoDataExchange_UpdateSettings(theDialog, toStdout, noRecurs, resetSticky, createMissDir, getCleanCopy, true);
00841
00842     groupView->SetValue(sRuntimePanel);
00843     theDialog->Show();
00844     MessageT hitMessage;
00845     while (true)
00846     {       // Let DialogHandler process events
00847         hitMessage = theHandler.DoDialog();
00848
00849         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00850             break;
00851     }
00852     theDialog->Hide();
00853     sRuntimePanel = groupView->GetValue();
00854
00855     if(hitMessage == msg_OK)
00856     {
00857         multiView->SwitchToPanel(1);
00858         DoDataExchange_UpdateSettings(theDialog, toStdout, noRecurs, resetSticky, createMissDir, getCleanCopy, false);
00859         multiView->SwitchToPanel(2);
00860         DoDataExchange_UpdateSticky(theDialog, hasDate, hasRev, sLastDate, sLastRev, useMostRecent, false);
00861         multiView->SwitchToPanel(3);
00862         DoDataExchange_UpdateMerge(theDialog, merge1, merge2, sLastRev1, sLastRev2, false);
00863         multiView->SwitchToPanel(4);
00864         DoDataExchange_Globals(theDialog, false);
00865         userHitOK = true;
00866     }
00867 #endif /* qMacCvsPP */
00868 #if qUnix
00869     void *wid;
00870 #   if qGTK
00871     wid = UCreate_UpdateDlg();
00872 #   endif
00873
00874     UCvsUpdate *dlg = new UCvsUpdate();
00875     UCvsUpdate_MAIN *tab1 = new UCvsUpdate_MAIN();
00876     UCvsUpdate_STICKY *tab2 = new UCvsUpdate_STICKY(sLastRev, sLastDate);
00877     UCvsUpdate_MERGE *tab3 = new UCvsUpdate_MERGE(sLastRev1, sLastRev2);
00878     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00879     dlg->AddPage(tab1, UCvsUpdate::kTabGeneral, 0);
00880     dlg->AddPage(tab2, UCvsUpdate::kTabGeneral, 1);
00881     dlg->AddPage(tab3, UCvsUpdate::kTabGeneral, 2);
00882
00883     if(dlg->DoModal())
00884     {
00885         toStdout = tab1->m_toStdout;
00886         noRecurs = tab1->m_noRecurs;
00887         resetSticky = tab1->m_resetSticky;
00888         createMissDir = tab1->m_createMissDir;
00889
00890         sLastDate = tab2->m_date;
00891         sLastRev = tab2->m_rev;
00892         hasDate = tab2->m_hasdate;
00893         hasRev = tab2->m_hasrev;
00894         useMostRecent = tab2->m_match;
00895
00896         merge1 = tab3->m_merge >= 1;
00897         merge2 = tab3->m_merge == 2;
00898         sLastRev1 = tab3->m_rev1;
00899         sLastRev2 = tab3->m_rev2;
00900
00901         userHitOK = true;
00902     }
00903
00904     delete dlg;
00905 #endif // qUnix
00906
00907     if(userHitOK)
00908     {
00909         if(hasDate && !sLastDate.empty())
00910             date = sLastDate;
00911
00912         if(hasRev && !sLastRev.empty())
00913             rev = sLastRev;
00914
00915         if(merge1 && merge2 && !sLastRev1.empty() && !sLastRev2.empty())
00916         {
00917             rev1 = sLastRev1;
00918             rev2 = sLastRev2;
00919
00920             if( hasDate1 )
00921                 rev1 << ":" << sLastDate1;
00922
00923             if( hasDate2 )
00924                 rev2 << ":" << sLastDate2;
00925         }
00926
00927         if(merge1 && !merge2 && !sLastRev1.empty())
00928         {
00929             rev1 = sLastRev1;
00930
00931             if( hasDate1 )
00932                 rev1 << ":" << sLastDate1;
00933         }
00934
00935         gCvsPrefs.save();
00936     }
00937
00938     return userHitOK;
00939 }
Generated on Sun Feb 24 01:21:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/UpdateDlg.h Source File

common/UpdateDlg.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 1998
00019  */
00020
00021 /*
00022  * UpdateDlg.h : the cvs update dialog
00023  */
00024
00025 #if !defined(AFX_UPDATEDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
00026 #define AFX_UPDATEDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif // _MSC_VER >= 1000
00031
00032 #include "CPStr.h"
00033 #include "MultiString.h"
00034 #include "SmartComboBox.h"
00035
00036 bool CompatGetUpdate(bool & toStdout, bool & noRecurs, bool & resetSticky,
00037                      CPStr & date, CPStr & rev,
00038                      bool & useMostRecent,
00039                      CPStr & rev1, CPStr & rev2,
00040                      bool & createMissDir,
00041                      bool & getCleanCopy);
00042     // get the update options...
00043
00044 extern CMString gRevNames;
00045 extern CMString gReleasesNames;
00046 extern CMString gDateNames;
00047 extern CMString gDateOrRevNames;
00048     // persistent default values for the dates, tags...
00049
00050 #ifdef WIN32
00051 class CUpdateMain : public CPropertyPage
00052 {
00053     DECLARE_DYNCREATE(CUpdateMain)
00054
00055 // Construction
00056 public:
00057     CUpdateMain();
00058     ~CUpdateMain();
00059
00060 // Dialog Data
00061     //{{AFX_DATA(CUpdateMain)
00062     enum { IDD = IDD_UPDATE_MAIN };
00063     BOOL    m_delsticky;
00064     BOOL    m_norecurs;
00065     BOOL    m_stdout;
00066     BOOL    m_createmissdir;
00067     BOOL    m_getcleancopy;
00068     //}}AFX_DATA
00069
00070
00071 // Overrides
00072     // ClassWizard generate virtual function overrides
00073     //{{AFX_VIRTUAL(CUpdateMain)
00074     protected:
00075     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00076     //}}AFX_VIRTUAL
00077
00078 // Implementation
00079 protected:
00080     // Generated message map functions
00081     //{{AFX_MSG(CUpdateMain)
00082         // NOTE: the ClassWizard will add member functions here
00083     //}}AFX_MSG
00084     DECLARE_MESSAGE_MAP()
00085
00086 };
00087
00088 class CUpdateMerge : public CPropertyPage
00089 {
00090     DECLARE_DYNCREATE(CUpdateMerge)
00091
00092 // Construction
00093 public:
00094     CUpdateMerge(bool isCheckout, const char *rev1, const char *rev2, const char *date1, const char *date2);
00095     CUpdateMerge();
00096     ~CUpdateMerge();
00097
00098 // Dialog Data
00099     //{{AFX_DATA(CUpdateMerge)
00100     enum { IDD = IDD_UPDATE_MERGE };
00101     CSmartComboBox  m_date2Combo;
00102     CSmartComboBox  m_date1Combo;
00103     CSmartComboBox  m_rev2Combo;
00104     CSmartComboBox  m_rev1Combo;
00105     CString m_rev1;
00106     CString m_rev2;
00107     int m_merge;
00108     BOOL    m_hasDate1;
00109     BOOL    m_hasDate2;
00110     CString m_date1;
00111     CString m_date2;
00112     //}}AFX_DATA
00113
00114
00115 // Overrides
00116     // ClassWizard generate virtual function overrides
00117     //{{AFX_VIRTUAL(CUpdateMerge)
00118     protected:
00119     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00120     //}}AFX_VIRTUAL
00121
00122 // Implementation
00123 protected:
00124     // Generated message map functions
00125     //{{AFX_MSG(CUpdateMerge)
00126     afx_msg void OnMerge();
00127     afx_msg void OnMerge1();
00128     afx_msg void OnMerge2();
00129     afx_msg void OnCheckdate1();
00130     afx_msg void OnCheckdate2();
00131     //}}AFX_MSG
00132     DECLARE_MESSAGE_MAP()
00133 private:
00134     bool m_isCheckout;
00135 };
00136
00137 class CUpdateSticky : public CPropertyPage
00138 {
00139     DECLARE_DYNCREATE(CUpdateSticky)
00140
00141 // Construction
00142 public:
00143     CUpdateSticky(const char *rev, const char *date);
00144     CUpdateSticky();
00145     ~CUpdateSticky();
00146
00147 // Dialog Data
00148     //{{AFX_DATA(CUpdateSticky)
00149     enum { IDD = IDD_UPDATE_STICKY };
00150     CSmartComboBox  m_dateCombo;
00151     CSmartComboBox  m_revCombo;
00152     CString m_date;
00153     CString m_rev;
00154     BOOL    m_hasdate;
00155     BOOL    m_hasrev;
00156     BOOL    m_match;
00157     //}}AFX_DATA
00158
00159
00160 // Overrides
00161     // ClassWizard generate virtual function overrides
00162     //{{AFX_VIRTUAL(CUpdateSticky)
00163     protected:
00164     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00165     //}}AFX_VIRTUAL
00166
00167 // Implementation
00168 protected:
00169     // Generated message map functions
00170     //{{AFX_MSG(CUpdateSticky)
00171     afx_msg void OnDate();
00172     afx_msg void OnRev();
00173     //}}AFX_MSG
00174     DECLARE_MESSAGE_MAP()
00175
00176 };
00177 //{{AFX_INSERT_LOCATION}}
00178 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00179 #endif /* WIN32 */
00180
00181 #endif // !defined(AFX_UPDATEDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Sun Feb 24 01:21:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/VolsPaths.c Source File

common/VolsPaths.c

Go to the documentation of this file.
00001 /*
00002  * Stollen from POV and added to MacCVS by
00003  * Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00004  */
00005
00006 /*==============================================================================
00007 Project:    POV-Ray
00008
00009 Version:    3
00010
00011 File:   VolsPaths.c
00012
00013 Description:
00014     Various volume and pathname handling routines.
00015 ------------------------------------------------------------------------------
00016 Author:
00017     Eduard [esp] Schwan
00018 ------------------------------------------------------------------------------
00019     from Persistence of Vision(tm) Ray Tracer
00020     Copyright 1996 Persistence of Vision Team
00021 ------------------------------------------------------------------------------
00022     NOTICE: This source code file is provided so that users may experiment
00023     with enhancements to POV-Ray and to port the software to platforms other
00024     than those supported by the POV-Ray Team.  There are strict rules under
00025     which you are permitted to use this file.  The rules are in the file
00026     named POVLEGAL.DOC which should be distributed with this file. If
00027     POVLEGAL.DOC is not available or for more info please contact the POV-Ray
00028     Team Coordinator by leaving a message in CompuServe's Graphics Developer's
00029     Forum.  The latest version of POV-Ray may be found there as well.
00030
00031     This program is based on the popular DKB raytracer version 2.12.
00032     DKBTrace was originally written by David K. Buck.
00033     DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
00034 ------------------------------------------------------------------------------
00035 Change History:
00036     941221  [esp]   Created
00037 ==============================================================================*/
00038
00039 #define VOLSPATHS_C
00040
00041 /*==== my header =====*/
00042 #include "VolsPaths.h"
00043
00044
00045 /*==== Macintosh-specific headers ====*/
00046 #include <Types.h>
00047 #include <Files.h>
00048 #include <Resources.h>
00049 #include <errors.h>         /* dupFNErr, etc */
00050 #include <Memory.h>         /* NewPtr, etc */
00051 #include <string.h>         /* strcpy/cat */
00052 #include <strings.h>        /* p2cstr */
00053 #include <TextUtils.h>      /* Munger */
00054
00055
00056 /*==== Standard C headers ====*/
00057
00058
00059 /*==== General definitions ====*/
00060
00061
00062 /*==== Global variables (external scope) ====*/
00063
00064
00065 /*==== Global variables (local scope) ====*/
00066
00067
00068 // ---------------------------------------------------------------------
00069 // VRef2VolName
00070 // ---------------------------------------------------------------------
00071 OSErr VRef2VolName(short theVRef, StringPtr theVolName)
00072 {
00073     OSErr           anError;
00074     HVolumeParam    pbVInfo;
00075
00076     pbVInfo.ioCompletion = NULL;
00077     theVolName[0] = '\0';
00078     pbVInfo.ioNamePtr = theVolName;
00079     pbVInfo.ioVRefNum = theVRef;
00080     pbVInfo.ioVolIndex = 0; // use VRefNum only
00081     anError = PBHGetVInfoSync((HParmBlkPtr)&pbVInfo);
00082
00083     return anError;
00084 } // VRef2VolName
00085
00086
00087 // ---------------------------------------------------------------------
00088 // VolName2VRef
00089 // ---------------------------------------------------------------------
00090 OSErr VolName2VRef(StringPtr myPVolName, short * theVRefPtr)
00091 {
00092     OSErr           anError = noErr;
00093     Boolean         foundIt = false;
00094     short           theDriveNum;
00095     short           theVRefNum;
00096     HParamBlockRec  aParamBlk;
00097     char            myCVolName[32], theCVolName[32];
00098     Str31           theVolName;
00099
00100     // convert passed vol name from P 2 C string for compare
00101     p2cstrcpy(myCVolName, myPVolName);
00102
00103     // loop through all mounted volumes, see if myPVolName matches one
00104     for (theDriveNum = 1; !foundIt && (anError==noErr); theDriveNum++)
00105     {
00106         theVolName[0] = '\0';
00107         aParamBlk.volumeParam.ioNamePtr = (StringPtr)&theVolName;
00108         aParamBlk.volumeParam.ioVolIndex = theDriveNum;
00109
00110         anError = PBHGetVInfoSync((HParmBlkPtr)&aParamBlk);
00111         if (anError == noErr)
00112         {
00113             p2cstrcpy(theCVolName, theVolName);
00114             if (strcmp(theCVolName, myCVolName)==0)
00115             {
00116                 foundIt = true;
00117                 theVRefNum = aParamBlk.volumeParam.ioVRefNum;
00118             }
00119         }
00120     }
00121
00122     if (foundIt)
00123         *theVRefPtr = theVRefNum;
00124     else
00125         *theVRefPtr = 0;
00126
00127     if (anError == nsvErr) // no such vol, just bumped end of volume list
00128         anError = noErr;
00129
00130     return anError;
00131 } // VolName2VRef
00132
00133
00134 // ---------------------------------------------------------------------
00135 // PathNameFromDirID
00136 // ---------------------------------------------------------------------
00137 /*
00138 Function:   PathNameFromDirID
00139
00140 Parameters:
00141     aDirID      the directory ID to start at
00142     avRefNum    the volume ref # to start at
00143     aPathStyle  The style of pathname to format (based on OS)
00144     aPath       the final path string is placed in this buffer
00145
00146 Return Value:
00147     zero is returned if OK, else an error is returned
00148
00149 Purpose/Description:
00150     PathNameFromDirID takes a real vRefNum and a DirID and returns
00151     the full pathname that corresponds to it.  It does this by calling
00152     _PBGetCatInfo for the given directory and finding out its name and
00153     the DirID of its parent. It then performs the same operation on the
00154     parent, sticking its name onto the beginning of the first directory.
00155     This whole process is continued until we have processed everything up
00156     to the root directory (identified with a DirID of 2).
00157 */
00158 OSErr PathNameFromDirID(const long          aDirID,
00159                         const short         avRefNum,
00160                         char                * aPath)
00161 {
00162     Handle      strHandle = NULL;
00163     OSErr       anError = noErr;
00164     long        currDirID = 0,
00165                 nextDirID = 0;
00166     Size        theLen = 0;     // GetHandleSize
00167     char        tempName[64];   // directory or volume name
00168     CInfoPBRec  aPBblock;
00169
00170     /* create an empty string handle for Munger */
00171     strHandle = NewHandle(0);
00172
00173     if (strHandle == NULL)
00174     {
00175         anError = MemError();
00176     }
00177     else
00178     {
00179         *aPath = '\0';
00180         aPBblock.dirInfo.ioCompletion   = NULL;
00181         aPBblock.dirInfo.ioNamePtr      = (StringPtr)tempName;  // temp destination buffer
00182         nextDirID                       = aDirID;   // start at DirID passed in..
00183
00184         /* walk up the directories, collecting dir names as we go, until we hit the top (volname) */
00185         do {
00186
00187             aPBblock.dirInfo.ioVRefNum      = avRefNum;
00188             aPBblock.dirInfo.ioFDirIndex    = -1; // ignore ioNamePtr input, use ioDirID
00189             aPBblock.dirInfo.ioDrDirID      = nextDirID;
00190
00191             anError = PBGetCatInfoSync(&aPBblock);
00192             currDirID   = aPBblock.dirInfo.ioDrDirID;   // remember current
00193             nextDirID   = aPBblock.dirInfo.ioDrParID;   // find parent for next loop
00194
00195             if (anError != noErr)
00196                 break;
00197
00198             /* Insert a separator in front of the Directory Entry */
00199             Munger(strHandle, 0L, NULL, 0L, ":", 1L);
00200
00201             /* Insert the next directory/volume name into the front of the string */
00202             Munger(strHandle, 0L, NULL, 0L, &(tempName[1]), (long)tempName[0]);
00203
00204             /* NOTE: fsRtDirID is defined in Files.h */
00205         } while (currDirID != fsRtDirID);
00206
00207         /* now move the string into the parameter */
00208         theLen = GetHandleSize(strHandle);
00209         if (!anError && theLen)
00210         {
00211             BlockMove(&(**strHandle), aPath, theLen);
00212             anError = MemError();
00213         }
00214         aPath[theLen] = '\0';   /* set C string length */
00215
00216         /* dispose of temp storage */
00217         DisposeHandle(strHandle);
00218
00219     } /*else NULL*/
00220
00221     return(anError);
00222
00223 } /* PathNameFromDirID */
00224
00225
00226 // ---------------------------------------------------------------------
00227 // PathNameFromWD
00228 // ---------------------------------------------------------------------
00229 /*
00230 Function:   PathNameFromWD
00231
00232 Parameters:
00233     avRefNum    the volume ref # to start at (Assumes WD is set)
00234     aPathStyle  The style of pathname to format (based on OS)
00235     aPath       the final path string is placed in this buffer
00236
00237 Return Value:
00238     Describe the value returned, or void
00239
00240 Purpose/Description:
00241     PathNameFromWD takes an HFS Working Directory ID and returns
00242     the full pathname that corresponds to it.  It does this by calling
00243     _PBGetWDInfo to get the vRefNum and DirID of the real directory.
00244     It then calls PathNameFromDirID and returns its result.
00245 */
00246 #if !TARGET_API_MAC_CARBON
00247 OSErr PathNameFromWD(   const short         avRefNum,
00248                         char                * aPath)
00249 {
00250     WDPBRec aPBblock;
00251     OSErr   anError = noErr;
00252
00253 /*
00254  PBGetWDInfo has a bug under A/UX 1.1.  If vRefNum is a real vRefNum
00255  and not a wdRefNum, then it returns garbage.  Since A/UX has only 1
00256  volume (in the Macintosh sense) and only 1 root directory, this can
00257  occur only when a file has been selected in the root directory (/).
00258  So we look for this and hard code the DirID and vRefNum.
00259  */
00260 #if defined(AUX)
00261     if ((aPathStyle == ePathTypeAUX) && (avRefNum == -1))
00262     {
00263         anError = PathNameFromDirID(fsRtDirID, -1, aPath);
00264     }
00265     else
00266 #endif
00267     {
00268         aPBblock.ioCompletion = NULL;
00269         aPBblock.ioNamePtr = NULL;
00270         aPBblock.ioVRefNum = avRefNum;
00271         aPBblock.ioWDIndex = 0;
00272         aPBblock.ioWDProcID = 0;
00273
00274         /* Change the Working Directory number in vRefnum into a real vRefnum */
00275         /* and DirID. The real vRefnum is returned in ioVRefnum, and the real */
00276         /* DirID is returned in ioWDDirID. */
00277
00278         anError = PBGetWDInfoSync(&aPBblock);
00279         if (anError == noErr)
00280             anError = PathNameFromDirID(aPBblock.ioWDDirID,
00281                                         aPBblock.ioWDVRefNum,
00282                                         aPath);
00283     }
00284
00285     return(anError);
00286
00287 } /* PathNameFromWD */
00288 #endif
Generated on Sun Feb 24 01:21:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


common/VolsPaths.h Source File

common/VolsPaths.h

Go to the documentation of this file.
00001 /*
00002  * Stollen from POV and added to MacCVS by
00003  * Alexandre Parenteau <aubonbeurre@hotmail.com> --- December 1997
00004  */
00005
00006 /*==============================================================================
00007 Project:    POV-Ray
00008
00009 Version:    3
00010
00011 File:   VolsPaths.h
00012
00013 Description:
00014     Various volume and pathname handling routines.
00015 ------------------------------------------------------------------------------
00016 Author:
00017     Eduard [esp] Schwan
00018 ------------------------------------------------------------------------------
00019     from Persistence of Vision(tm) Ray Tracer
00020     Copyright 1996 Persistence of Vision Team
00021 ------------------------------------------------------------------------------
00022     NOTICE: This source code file is provided so that users may experiment
00023     with enhancements to POV-Ray and to port the software to platforms other
00024     than those supported by the POV-Ray Team.  There are strict rules under
00025     which you are permitted to use this file.  The rules are in the file
00026     named POVLEGAL.DOC which should be distributed with this file. If
00027     POVLEGAL.DOC is not available or for more info please contact the POV-Ray
00028     Team Coordinator by leaving a message in CompuServe's Graphics Developer's
00029     Forum.  The latest version of POV-Ray may be found there as well.
00030
00031     This program is based on the popular DKB raytracer version 2.12.
00032     DKBTrace was originally written by David K. Buck.
00033     DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
00034 ------------------------------------------------------------------------------
00035 Change History:
00036     941221  [esp]   Created
00037 ==============================================================================*/
00038
00039 #ifndef VOLSPATHS_H
00040 #define VOLSPATHS_H
00041
00042
00043 /*==== Macintosh-specific headers ====*/
00044 #include <MacTypes.h>
00045
00046 #ifdef __cplusplus
00047 extern "C" {
00048 #endif
00049
00050 /*==== Prototypes =====*/
00051
00052 OSErr VRef2VolName(short theVRef, StringPtr theVolName);
00053
00054 OSErr VolName2VRef(StringPtr myPVolName, short * theVRefPtr);
00055
00056 OSErr PathNameFromDirID(const long          aDirID,
00057                         const short         avRefNum,
00058                         char                * aPath);
00059
00060 #if !TARGET_API_MAC_CARBON
00061 OSErr PathNameFromWD(   const short         avRefNum,
00062                         char                * aPath);
00063 #endif
00064
00065 #ifdef __cplusplus
00066 }
00067 #endif
00068
00069 #endif //  VOLSPATHS_H
00070
Generated on Sun Feb 24 01:21:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/uconfig.h Source File

rf/uconfig.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- May 1999
00019  */
00020
00021 #ifndef UCONFIG_H
00022 #define UCONFIG_H
00023
00024 #if defined(_MSC_VER) || defined(__MWERKS__)
00025 #   define UEXPORT __declspec(dllexport)
00026 #else
00027 #   define UEXPORT
00028 #endif
00029
00030 #endif /* UCONFIG_H */
Generated on Sun Feb 24 01:21:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/uconsole.cpp Source File

rf/uconsole.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- May 1999
00019  */
00020
00021 #include "stdafx.h"
00022
00023 #ifdef HAVE_CONFIG_H
00024 #include "config.h"
00025 #endif
00026
00027 #ifdef WIN32
00028 #   ifdef _DEBUG
00029 #       include <crtdbg.h>
00030 #   endif
00031 #endif
00032
00033 #if qMacAPP && qDebug
00034 #   include "Debug_AC.h"
00035 #endif
00036
00037 #include <stdio.h>
00038 #include <stdarg.h>
00039
00040 #include "uconsole.h"
00041
00042 void UAppConsole(const char *format, ...)
00043 {
00044     va_list args;
00045     char mess[1024] = {'\0'};
00046
00047     UASSERT(format != NULL);
00048
00049     va_start (args, format);
00050     vsprintf (mess, format, args);
00051     va_end (args);
00052
00053 #if qGTK
00054     g_warning(mess);
00055 #elif defined(qUnix)
00056 #elif qMacAPP
00057 #   if qDebug
00058     DebugWarning_AC(1, mess, __FILE__, __LINE__);
00059 #   endif
00060 #elif qMacPP
00061     SignalString_(mess);
00062 #elif defined(WIN32)
00063 #   ifdef _DEBUG
00064     _CrtDbgReport(_CRT_WARN, __FILE__, __LINE__, NULL, mess);
00065 #   endif
00066 #else
00067     (void)printf(mess);
00068     (void)fflush(stdout);
00069 #endif
00070 }
00071
Generated on Sun Feb 24 01:21:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/uconsole.h Source File

rf/uconsole.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- May 1999
00019  */
00020
00021 #ifndef UCONSOLE_H_
00022 #define UCONSOLE_H_
00023
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027
00028 extern void UAppConsole(const char *format, ...);
00029
00030 #ifndef UTHROW
00031 #   define UTHROW(a) throw a
00032 #endif
00033
00034 #ifdef __cplusplus
00035 }
00036 #endif
00037
00038 #endif /*UCONSOLE_H_*/
Generated on Sun Feb 24 01:21:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/udraw.cpp Source File

rf/udraw.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 2000
00019  */
00020
00021 #include "stdafx.h"
00022
00023 #ifdef HAVE_CONFIG_H
00024 #include "config.h"
00025 #endif
00026
00027 #include "udraw.h"
00028 #include "uwidget.h"
00029
00030 #ifndef MIN
00031 #   define MIN(a, b) ((a) < (b) ? (a) : (b))
00032 #endif
00033
00034 #ifndef MAX
00035 #   define MAX(a, b) ((a) > (b) ? (a) : (b))
00036 #endif
00037
00038 bool PtInRect(const URECT *r, UPOINT pt)
00039 {
00040     return pt.x >= r->left && pt.x < r->right &&
00041         pt.y >= r->top && pt.y < r->bottom;
00042 }
00043
00044 void SetRect(URECT *r, int x1, int y1, int x2, int y2)
00045 {
00046     r->left = x1;
00047     r->top = y1;
00048     r->right = x2;
00049     r->bottom = y2;
00050     if(r->left > r->right)
00051         r->left = r->right;
00052     if(r->top > r->bottom)
00053         r->top = r->bottom;
00054 }
00055
00056 void SetRectEmpty(URECT *r)
00057 {
00058     r->left = 0;
00059     r->top = 0;
00060     r->right = 0;
00061     r->bottom = 0;
00062 }
00063
00064 bool EqualRect(const URECT *r1, const URECT *r2)
00065 {
00066     return r1->left == r2->left && r1->top == r2->top &&
00067         r1->right == r2->right && r1->bottom == r2->bottom;
00068 }
00069 void InflateRect(URECT *r, int x, int y)
00070 {
00071     r->left += x;
00072     r->top += y;
00073     r->right -= x;
00074     r->bottom -= y;
00075     if(r->left > r->right)
00076         r->left = r->right;
00077     if(r->top > r->bottom)
00078         r->top = r->bottom;
00079 }
00080
00081 void OffsetRect(URECT *r, int x, int y)
00082 {
00083     r->left += x;
00084     r->right += x;
00085     r->top += y;
00086     r->bottom += y;
00087 }
00088
00089 inline bool IsRectEmpty(const URECT *r)
00090 {
00091     return r->left == r->right || r->top == r->bottom;
00092 }
00093
00094 bool UnionRect(URECT *dest, const URECT *src1, const URECT *src2)
00095 {
00096     if(::IsRectEmpty(src1))
00097     {
00098         *dest = *src2;
00099         return true;
00100     }
00101     if(::IsRectEmpty(src2))
00102     {
00103         *dest = *src1;
00104         return true;
00105     }
00106     dest->left = MIN (src1->left, src2->left);
00107     dest->top = MIN (src1->top, src2->top);
00108     dest->right = MAX (src1->right, src2->right);
00109     dest->bottom = MAX (src1->bottom, src2->bottom);
00110     return true;
00111 }
00112
00113 bool IntersectRect(URECT *dest, const URECT *src1, const URECT *src2)
00114 {
00115     const URECT *temp;
00116     bool return_val = false;
00117
00118     if (src2->left < src1->left)
00119     {
00120         temp = src1;
00121         src1 = src2;
00122         src2 = temp;
00123     }
00124     dest->left = src2->left;
00125
00126     if (src2->left < src1->right)
00127     {
00128         if (src1->right < src2->right)
00129             dest->right = src1->right;
00130         else
00131             dest->right = src2->right;
00132
00133         if (src2->top < src1->top)
00134         {
00135             temp = src1;
00136             src1 = src2;
00137             src2 = temp;
00138         }
00139         dest->top = src2->top;
00140
00141         if (src2->top < src1->bottom)
00142         {
00143             return_val = true;
00144
00145             if (src1->bottom < src2->bottom)
00146                 dest->bottom = src1->bottom;
00147             else
00148                 dest->bottom = src2->bottom;
00149
00150             if (dest->left == dest->right)
00151                 return_val = false;
00152             if (dest->top == dest->bottom)
00153                 return_val = false;
00154         }
00155     }
00156
00157     return return_val;
00158 }
00159
00160 UDC::UDC(int widid, int cmdid) : m_wid(0L), m_pen(0L), m_brush(0L)
00161 #if qGTK
00162     , m_gc(0L), m_penloc(0, 0), m_drawable(0L), m_orig(0, 0)
00163 #endif
00164 {
00165     UCmdTarget *target = UEventQueryWidget(widid);
00166     if(target == 0L || !target->IsKindOf(URUNTIME_CLASS(UWidget)))
00167         return;
00168
00169     m_wid = ((UWidget *)target)->GetWidget(cmdid);
00170 #if qGTK
00171     if(m_wid != 0L)
00172     {
00173         GtkWidget *widget = GTK_WIDGET(m_wid);
00174         if(GTK_IS_LAYOUT(widget))
00175         {
00176             GtkLayout *layout = GTK_LAYOUT(widget);
00177             m_drawable = layout->bin_window;
00178             m_orig.x = -layout->xoffset;
00179             m_orig.y = -layout->yoffset;
00180         }
00181         else
00182             m_drawable = m_drawable;
00183         m_gc = gdk_gc_new(m_drawable);
00184         if(m_gc == 0L)
00185             m_wid = 0L;
00186         else
00187         {
00188             GdkGCValues values;
00189             gdk_gc_get_values(m_gc, &values);
00190             m_foreground = values.foreground;
00191             m_background = values.background;
00192             m_font = gdk_font_load ("-adobe-*-medium-r-normal--*-120-*-*-*-*-iso8859-*");
00193             if(m_font == 0L)
00194                 m_font = gdk_font_load ("-adobe-courier-medium-r-normal--*-120-*-*-*-*-*-*");
00195             if(m_font != 0L)
00196                 gdk_gc_set_font(m_gc, m_font);
00197         }
00198     }
00199 #endif
00200 }
00201
00202 UPen *UDC::SelectObject(UPen* pPen)
00203 {
00204     if(m_wid == 0L)
00205         return 0L;
00206
00207     UPen *oldpen = m_pen;
00208     m_pen = pPen;
00209
00210 #if qGTK
00211     if(m_pen != 0L && m_pen->m_set)
00212         gdk_gc_set_foreground(m_gc, &m_pen->m_col);
00213     else
00214         gdk_gc_set_foreground(m_gc, &m_foreground);
00215 #endif
00216
00217     return oldpen;
00218 }
00219
00220 UBrush *UDC::SelectObject(UBrush* pBrush)
00221 {
00222     if(m_wid == 0L)
00223         return 0L;
00224
00225     UBrush *oldbrush = m_brush;
00226     m_brush = pBrush;
00227
00228 #if qGTK
00229     if(m_brush != 0L && m_brush->m_set)
00230         gdk_gc_set_background(m_gc, &m_brush->m_col);
00231     else
00232         gdk_gc_set_background(m_gc, &m_background);
00233 #endif
00234
00235     return oldbrush;
00236 }
00237
00238 UDC::~UDC()
00239 {
00240 #if qGTK
00241     if(m_gc != 0L)
00242         gdk_gc_destroy(m_gc);
00243     if(m_font != 0L)
00244         gdk_font_unref (m_font);
00245 #endif
00246 }
00247
00248 bool UDC::Rectangle(const URECT *lpRect)
00249 {
00250     if(m_wid == 0L)
00251         return false;
00252
00253 #if qGTK
00254     URect r(*lpRect);
00255     if(m_brush != 0L && m_brush->m_set)
00256     {
00257         gdk_gc_set_foreground(m_gc, &m_brush->m_col);
00258         gdk_draw_rectangle (m_drawable, m_gc, TRUE,
00259                             r.left + m_orig.x, r.top + m_orig.y, r.Width(), r.Height());
00260         SelectObject(m_pen);
00261     }
00262     gdk_draw_rectangle (m_drawable, m_gc, FALSE,
00263                         r.left + m_orig.x, r.top + m_orig.y, r.Width(), r.Height());
00264 #endif
00265     return true;
00266 }
00267
00268 bool UDC::RoundRect(const URECT *lpRect, UPOINT point)
00269 {
00270     if(m_wid == 0L)
00271         return false;
00272
00273 #if qGTK
00274     URect r(*lpRect);
00275     if(m_brush != 0L && m_brush->m_set)
00276     {
00277         gdk_gc_set_foreground(m_gc, &m_brush->m_col);
00278         gdk_draw_rectangle (m_drawable, m_gc, TRUE,
00279                             r.left + m_orig.x, r.top + m_orig.y, r.Width(), r.Height());
00280         SelectObject(m_pen);
00281     }
00282     gdk_draw_rectangle (m_drawable, m_gc, FALSE,
00283                         r.left + m_orig.x, r.top + m_orig.y, r.Width(), r.Height());
00284 #endif
00285     return true;
00286 }
00287
00288 void UDC::MoveTo(int x, int y)
00289 {
00290     if(m_wid == 0L)
00291         return;
00292
00293 #if qGTK
00294     m_penloc.x = x + m_orig.x;
00295     m_penloc.y = y + m_orig.y;
00296 #endif
00297 }
00298
00299 void UDC::LineTo(int x, int y)
00300 {
00301     if(m_wid == 0L)
00302         return;
00303
00304 #if qGTK
00305     gdk_draw_line(m_drawable, m_gc,
00306                   m_penloc.x, m_penloc.y, x + m_orig.x, y + m_orig.y);
00307     m_penloc.x = x + m_orig.x;
00308     m_penloc.y = y + m_orig.y;
00309 #endif
00310 }
00311
00312 USize UDC::GetTextExtent(const char *lpszString, int nCount) const
00313 {
00314     USize res(0, 0);
00315     if(m_wid == 0L)
00316         return res;
00317
00318 #if qGTK
00319     if(m_font == 0L)
00320         return res;
00321
00322     res.cx = gdk_text_width(m_font, lpszString, nCount);
00323     res.cy = gdk_text_height(m_font, lpszString, nCount);
00324 #endif
00325
00326     return res;
00327 }
00328
00329 int UDC::GetTextHeight(void) const
00330 {
00331     int res = 0;
00332     if(m_wid == 0L)
00333         return res;
00334
00335 #if qGTK
00336     if(m_font == 0L)
00337         return res;
00338
00339     res = m_font->ascent + m_font->descent;
00340 #endif
00341
00342     return res;
00343 }
00344
00345 bool UDC::TextOutClipped(int x, int y, const URECT *lpRect,
00346                          const char *lpszString, int nCount)
00347 {
00348     if(m_wid == 0L)
00349         return false;
00350
00351 #if qGTK
00352     if(m_font == 0L)
00353         return false;
00354
00355     USize size = GetTextExtent(lpszString, nCount);
00356     URect r(*lpRect);
00357     UPoint out(r.left, r.bottom);
00358     out += UPoint((r.Width() - size.cx) / 2, -(r.Height() - size.cy) / 2);
00359     gdk_draw_text(m_drawable, m_font, m_gc, out.x + m_orig.x, out.y + m_orig.y,
00360                   lpszString, nCount);
00361 #endif
00362
00363     return true;
00364 }
00365
00366 bool UDC::DrawBitmap(void *bitmap, UPOINT where)
00367 {
00368     if(m_wid == 0L)
00369         return false;
00370
00371 #if qGTK
00372     if(m_font == 0L)
00373         return false;
00374
00375     gdk_draw_pixmap(m_drawable, m_gc, GTK_PIXMAP(bitmap)->pixmap,
00376                     0, 0, where.x + m_orig.x, where.y + m_orig.y, -1, -1);
00377 #endif
00378
00379     return true;
00380 }
00381
00382 UPen::UPen()
00383 #if qGTK
00384     : m_set(false)
00385 #endif
00386 {
00387 }
00388
00389 UPen::~UPen()
00390 {
00391     DeleteObject();
00392 }
00393
00394 bool UPen::DeleteObject(void)
00395 {
00396     bool res = false;
00397 #if qGTK
00398     if(m_set)
00399     {
00400         m_set = false;
00401         GdkColormap *cmap = gdk_colormap_get_system();
00402         if(cmap != 0L)
00403         {
00404             gdk_colormap_free_colors(cmap, &m_col, 1);
00405             res = true;
00406         }
00407     }
00408     else
00409         res = true;
00410 #endif
00411     return res;
00412 }
00413
00414 bool UPen::CreatePen(int nPenStyle, int nWidth, UCOLORREF crColor)
00415 {
00416     bool res = false;
00417
00418     m_width = nWidth;
00419     m_style = nPenStyle;
00420
00421 #if qGTK
00422     DeleteObject();
00423     GdkColormap *cmap = gdk_colormap_get_system();
00424     if(cmap != 0L)
00425     {
00426         m_col.red = UGetRValue(crColor) << 8;
00427         m_col.green = UGetGValue(crColor) << 8;
00428         m_col.blue = UGetBValue(crColor) << 8;
00429         if(gdk_color_alloc(cmap, &m_col))
00430             m_set = true;
00431     }
00432     res = m_set;
00433 #endif
00434     return res;
00435 }
00436
00437 UBrush::UBrush()
00438 #if qGTK
00439     : m_set(false)
00440 #endif
00441 {
00442 }
00443
00444 UBrush::~UBrush()
00445 {
00446     DeleteObject();
00447 }
00448
00449 bool UBrush::DeleteObject(void)
00450 {
00451     bool res = false;
00452 #if qGTK
00453     if(m_set)
00454     {
00455         m_set = false;
00456         GdkColormap *cmap = gdk_colormap_get_system();
00457         if(cmap != 0L)
00458         {
00459             gdk_colormap_free_colors(cmap, &m_col, 1);
00460             res = true;
00461         }
00462     }
00463     else
00464         res = true;
00465 #endif
00466     return res;
00467 }
00468
00469 bool UBrush::CreateSolidBrush(UCOLORREF crColor)
00470 {
00471     bool res = false;
00472
00473 #if qGTK
00474     DeleteObject();
00475     GdkColormap *cmap = gdk_colormap_get_system();
00476     if(cmap != 0L)
00477     {
00478         m_col.red = UGetRValue(crColor) << 8;
00479         m_col.green = UGetGValue(crColor) << 8;
00480         m_col.blue = UGetBValue(crColor) << 8;
00481         if(gdk_color_alloc(cmap, &m_col))
00482             m_set = true;
00483     }
00484     res = m_set;
00485 #endif
00486     return res;
00487 }
Generated on Sun Feb 24 01:21:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/udraw.h Source File

rf/udraw.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- March 2000
00019  */
00020
00021 #ifndef UDRAW_H
00022 #define UDRAW_H
00023
00024 #include "uconfig.h"
00025 #include "umain.h"
00026
00027 #if qGTK
00028 #   include <gtk/gtk.h>
00029 #endif
00030
00031 #ifdef __cplusplus
00032
00033 extern UEXPORT bool PtInRect(const URECT *r, UPOINT pt);
00034 extern UEXPORT void SetRect(URECT *r, int x1, int y1, int x2, int y2);
00035 extern UEXPORT void SetRectEmpty(URECT *r);
00036 extern UEXPORT bool EqualRect(const URECT *r1, const URECT *r2);
00037 extern UEXPORT void InflateRect(URECT *r, int x, int y);
00038 extern UEXPORT void OffsetRect(URECT *r, int x, int y);
00039 extern UEXPORT bool UnionRect(URECT *dest, const URECT *src1, const URECT *src2);
00040 extern UEXPORT bool IntersectRect(URECT *dest, const URECT *src1, const URECT *src2);
00041
00042 inline void CopyRect(URECT *dst, const URECT *src) { *dst = *src; }
00043
00044 class UPoint;
00045 class URect;
00046
00047 class USize : public USIZE
00048 {
00049 public:
00050
00051 /* Constructors */
00052     /* construct an uninitialized size */
00053     USize();
00054     /* create from two integers */
00055     USize(int initCX, int initCY);
00056     /* create from another size */
00057     USize(USIZE initSize);
00058     /* create from a point */
00059     USize(UPOINT initPt);
00060
00061 /* Operations */
00062     bool operator==(USIZE size) const;
00063     bool operator!=(USIZE size) const;
00064     void operator+=(USIZE size);
00065     void operator-=(USIZE size);
00066
00067 /* Operators returning USize values */
00068     USize operator+(USIZE size) const;
00069     USize operator-(USIZE size) const;
00070     USize operator-() const;
00071
00072 /* Operators returning UPoint values */
00073     UPoint operator+(UPOINT point) const;
00074     UPoint operator-(UPOINT point) const;
00075
00076 /* Operators returning URect values */
00077     URect operator+(const URECT* lpRect) const;
00078     URect operator-(const URECT* lpRect) const;
00079 };
00080
00081 class UPoint : public UPOINT
00082 {
00083 public:
00084 /* Constructors */
00085
00086     /* create an uninitialized point */
00087     UPoint();
00088     /* create from two integers */
00089     UPoint(int initX, int initY);
00090     /* create from another point */
00091     UPoint(UPOINT initPt);
00092     /* create from a size */
00093     UPoint(USIZE initSize);
00094
00095 /* Operations */
00096
00097 /* translate the point */
00098     void Offset(int xOffset, int yOffset);
00099     void Offset(UPOINT point);
00100     void Offset(USIZE size);
00101
00102     bool operator==(UPOINT point) const;
00103     bool operator!=(UPOINT point) const;
00104     void operator+=(USIZE size);
00105     void operator-=(USIZE size);
00106     void operator+=(UPOINT point);
00107     void operator-=(UPOINT point);
00108
00109 /* Operators returning UPoint values */
00110     UPoint operator+(USIZE size) const;
00111     UPoint operator-(USIZE size) const;
00112     UPoint operator-() const;
00113     UPoint operator+(UPOINT point) const;
00114
00115 /* Operators returning USize values */
00116     USize operator-(UPOINT point) const;
00117
00118 /* Operators returning URect values */
00119     URect operator+(const URECT* lpRect) const;
00120     URect operator-(const URECT* lpRect) const;
00121 };
00122
00123 class URect : public URECT
00124 {
00125 public:
00126
00127 /* Constructors */
00128
00129     /* uninitialized rectangle */
00130     URect();
00131     /* from left, top, right, and bottom */
00132     URect(int l, int t, int r, int b);
00133     /* copy constructor */
00134     URect(const URECT& srURect);
00135     /* from a pointer to another rect */
00136     URect(const URECT* lpSrURect);
00137     /* from a point and size */
00138     URect(UPOINT point, USIZE size);
00139     /* from two points */
00140     URect(UPOINT topLeft, UPOINT bottomRight);
00141 #ifdef __QUICKDRAW__
00142     URect(const Rect & macRect);
00143 #endif
00144 #ifdef __AFX_H__
00145     URect(const CRect & winRect);
00146 #endif
00147
00148 /* Attributes (in addition to RECT members) */
00149
00150     /* retrieves the width */
00151     int Width() const;
00152     /* returns the height */
00153     int Height() const;
00154     /* returns the size */
00155     USize Size() const;
00156     /* reference to the top-left point */
00157     UPoint& TopLeft();
00158     /* reference to the bottom-right point */
00159     UPoint& BottomRight();
00160     /* const reference to the top-left point */
00161     const UPoint& TopLeft() const;
00162     /* const reference to the bottom-right point */
00163     const UPoint& BottomRight() const;
00164     /* the geometric center point of the rectangle */
00165     UPoint CenterPoint() const;
00166
00167     /* convert between URect and LPRECT/const RECT* (no need for &) */
00168     operator URECT*();
00169     operator const URECT*() const;
00170 #ifdef __QUICKDRAW__
00171     operator Rect() const;
00172 #endif
00173 #ifdef __AFX_H__
00174     operator CRect() const;
00175 #endif
00176
00177     /* returns TRUE if rectangle has no area */
00178     bool IsRectEmpty() const;
00179     /* returns TRUE if rectangle is at (0,0) and has no area */
00180     bool IsRectNull() const;
00181     /* returns TRUE if point is within rectangle */
00182     bool PtInRect(UPOINT point) const;
00183
00184 /* Operations */
00185
00186     /* set rectangle from left, top, right, and bottom */
00187     void SetRect(int x1, int y1, int x2, int y2);
00188     void SetRect(UPOINT topLeft, UPOINT bottomRight);
00189     /* empty the rectangle */
00190     void SetRectEmpty();
00191     /* copy from another rectangle */
00192     void CopyRect(const URECT* lpSrURect);
00193     /* TRUE if exactly the same as another rectangle */
00194     bool EqualRect(const URECT* lpRect) const;
00195
00196     /* inflate rectangle's width and height without */
00197     /* moving its top or left */
00198     void InflateRect(int x, int y);
00199     void InflateRect(USIZE size);
00200     void InflateRect(const URECT* lpRect);
00201     void InflateRect(int l, int t, int r, int b);
00202     /* deflate the rectangle's width and height without */
00203     /* moving its top or left */
00204     void DeflateRect(int x, int y);
00205     void DeflateRect(USIZE size);
00206     void DeflateRect(const URECT* lpRect);
00207     void DeflateRect(int l, int t, int r, int b);
00208
00209     /* translate the rectangle by moving its top and left */
00210     void OffsetRect(int x, int y);
00211     void OffsetRect(USIZE size);
00212     void OffsetRect(UPOINT point);
00213     void NormalizeRect();
00214
00215     /* set this rectangle to intersection of two others */
00216     bool IntersectRect(const URECT* lpRect1, const URECT* lpRect2);
00217
00218     /* set this rectangle to bounding union of two others */
00219     bool UnionRect(const URECT* lpRect1, const URECT* lpRect2);
00220
00221     /* set this rectangle to minimum of two others */
00222 /*      bool SubtractRect(const RECT* lpRectSrc1, const RECT* lpRectSrc2); */
00223
00224 /* Additional Operations */
00225     void operator=(const URECT& srURect);
00226     bool operator==(const URECT& rect) const;
00227     bool operator!=(const URECT& rect) const;
00228     void operator+=(UPOINT point);
00229     void operator+=(USIZE size);
00230     void operator+=(const URECT* lpRect);
00231     void operator-=(UPOINT point);
00232     void operator-=(USIZE size);
00233     void operator-=(const URECT* lpRect);
00234     void operator&=(const URECT& rect);
00235     void operator|=(const URECT& rect);
00236
00237 /* Operators returning URect values */
00238     URect operator+(UPOINT point) const;
00239     URect operator-(UPOINT point) const;
00240     URect operator+(const URECT* lpRect) const;
00241     URect operator+(USIZE size) const;
00242     URect operator-(USIZE size) const;
00243     URect operator-(const URECT* lpRect) const;
00244     URect operator&(const URECT& rect2) const;
00245     URect operator|(const URECT& rect2) const;
00246     URect MulDiv(int nMultiplier, int nDivisor) const;
00247 };
00248
00249 /* USize */
00250 inline USize::USize()
00251     { /* random filled */ }
00252 inline USize::USize(int initCX, int initCY)
00253     { cx = initCX; cy = initCY; }
00254 inline USize::USize(USIZE initSize)
00255     { *(USIZE*)this = initSize; }
00256 inline USize::USize(UPOINT initPt)
00257     { *(UPOINT*)this = initPt; }
00258 inline bool USize::operator==(USIZE size) const
00259     { return (cx == size.cx && cy == size.cy); }
00260 inline bool USize::operator!=(USIZE size) const
00261     { return (cx != size.cx || cy != size.cy); }
00262 inline void USize::operator+=(USIZE size)
00263     { cx += size.cx; cy += size.cy; }
00264 inline void USize::operator-=(USIZE size)
00265     { cx -= size.cx; cy -= size.cy; }
00266 inline USize USize::operator+(USIZE size) const
00267     { return USize(cx + size.cx, cy + size.cy); }
00268 inline USize USize::operator-(USIZE size) const
00269     { return USize(cx - size.cx, cy - size.cy); }
00270 inline USize USize::operator-() const
00271     { return USize(-cx, -cy); }
00272 inline UPoint USize::operator+(UPOINT point) const
00273     { return UPoint(cx + point.x, cy + point.y); }
00274 inline UPoint USize::operator-(UPOINT point) const
00275     { return UPoint(cx - point.x, cy - point.y); }
00276 inline URect USize::operator+(const URECT* lpRect) const
00277     { return URect(lpRect) + *this; }
00278 inline URect USize::operator-(const URECT* lpRect) const
00279     { return URect(lpRect) - *this; }
00280
00281 /* UPoint */
00282 inline UPoint::UPoint()
00283     { /* random filled */ }
00284 inline UPoint::UPoint(int initX, int initY)
00285     { x = initX; y = initY; }
00286 inline UPoint::UPoint(UPOINT initPt)
00287     { *(UPOINT*)this = initPt; }
00288 inline UPoint::UPoint(USIZE initSize)
00289     { *(USIZE*)this = initSize; }
00290 inline void UPoint::Offset(int xOffset, int yOffset)
00291     { x += xOffset; y += yOffset; }
00292 inline void UPoint::Offset(UPOINT point)
00293     { x += point.x; y += point.y; }
00294 inline void UPoint::Offset(USIZE size)
00295     { x += size.cx; y += size.cy; }
00296 inline bool UPoint::operator==(UPOINT point) const
00297     { return (x == point.x && y == point.y); }
00298 inline bool UPoint::operator!=(UPOINT point) const
00299     { return (x != point.x || y != point.y); }
00300 inline void UPoint::operator+=(USIZE size)
00301     { x += size.cx; y += size.cy; }
00302 inline void UPoint::operator-=(USIZE size)
00303     { x -= size.cx; y -= size.cy; }
00304 inline void UPoint::operator+=(UPOINT point)
00305     { x += point.x; y += point.y; }
00306 inline void UPoint::operator-=(UPOINT point)
00307     { x -= point.x; y -= point.y; }
00308 inline UPoint UPoint::operator+(USIZE size) const
00309     { return UPoint(x + size.cx, y + size.cy); }
00310 inline UPoint UPoint::operator-(USIZE size) const
00311     { return UPoint(x - size.cx, y - size.cy); }
00312 inline UPoint UPoint::operator-() const
00313     { return UPoint(-x, -y); }
00314 inline UPoint UPoint::operator+(UPOINT point) const
00315     { return UPoint(x + point.x, y + point.y); }
00316 inline USize UPoint::operator-(UPOINT point) const
00317     { return USize(x - point.x, y - point.y); }
00318 inline URect UPoint::operator+(const URECT* lpRect) const
00319     { return URect(lpRect) + *this; }
00320 inline URect UPoint::operator-(const URECT* lpRect) const
00321     { return URect(lpRect) - *this; }
00322
00323 /* URect */
00324 inline URect::URect()
00325     { /* random filled */ }
00326 inline URect::URect(int l, int t, int r, int b)
00327     { left = l; top = t; right = r; bottom = b; }
00328 inline URect::URect(const URECT& srURect)
00329     { ::CopyRect(this, &srURect); }
00330 inline URect::URect(const URECT* lpSrURect)
00331     { ::CopyRect(this, lpSrURect); }
00332 inline URect::URect(UPOINT point, USIZE size)
00333     { right = (left = point.x) + size.cx; bottom = (top = point.y) + size.cy; }
00334 inline URect::URect(UPOINT topLeft, UPOINT bottomRight)
00335     { left = topLeft.x; top = topLeft.y;
00336         right = bottomRight.x; bottom = bottomRight.y; }
00337 #ifdef __QUICKDRAW__
00338 inline URect::URect(const Rect & macRect)
00339     { left = macRect.left; right = macRect.right; top = macRect.top; bottom = macRect.bottom; }
00340 #endif
00341 #ifdef __AFX_H__
00342 inline URect::URect(const CRect & winRect)
00343     { left = winRect.left; right = winRect.right; top = winRect.top; bottom = winRect.bottom; }
00344 #endif
00345 inline int URect::Width() const
00346     { return right - left; }
00347 inline int URect::Height() const
00348     { return bottom - top; }
00349 inline USize URect::Size() const
00350     { return USize(right - left, bottom - top); }
00351 inline UPoint& URect::TopLeft()
00352     { return *((UPoint*)this); }
00353 inline UPoint& URect::BottomRight()
00354     { return *((UPoint*)this+1); }
00355 inline const UPoint& URect::TopLeft() const
00356     { return *((UPoint*)this); }
00357 inline const UPoint& URect::BottomRight() const
00358     { return *((UPoint*)this+1); }
00359 inline UPoint URect::CenterPoint() const
00360     { return UPoint((left+right)/2, (top+bottom)/2); }
00361 inline URect::operator URECT*()
00362     { return this; }
00363 inline URect::operator const URECT*() const
00364     { return this; }
00365 #ifdef __QUICKDRAW__
00366 inline URect::operator Rect() const
00367 {
00368     Rect r; ::MacSetRect(&r, left, top, right, bottom); return r;
00369 }
00370 #endif
00371 #ifdef __AFX_H__
00372 inline URect::operator CRect() const
00373 {
00374     return CRect(left, top, right, bottom);
00375 }
00376 #endif
00377 inline bool URect::IsRectEmpty() const
00378     { return left == right || top == bottom; }
00379 inline bool URect::IsRectNull() const
00380     { return (left == 0 && right == 0 && top == 0 && bottom == 0); }
00381 inline bool URect::PtInRect(UPOINT point) const
00382     { return ::PtInRect(this, point); }
00383 inline void URect::SetRect(int x1, int y1, int x2, int y2)
00384     { ::SetRect(this, x1, y1, x2, y2); }
00385 inline void URect::SetRect(UPOINT topLeft, UPOINT bottomRight)
00386     { ::SetRect(this, topLeft.x, topLeft.y, bottomRight.x, bottomRight.y); }
00387 inline void URect::SetRectEmpty()
00388     { ::SetRectEmpty(this); }
00389 inline void URect::CopyRect(const URECT* lpSrURect)
00390     { ::CopyRect(this, lpSrURect); }
00391 inline bool URect::EqualRect(const URECT* lpRect) const
00392     { return ::EqualRect(this, lpRect); }
00393 inline void URect::InflateRect(int x, int y)
00394     { ::InflateRect(this, x, y); }
00395 inline void URect::InflateRect(USIZE size)
00396     { ::InflateRect(this, size.cx, size.cy); }
00397 inline void URect::DeflateRect(int x, int y)
00398     { ::InflateRect(this, -x, -y); }
00399 inline void URect::DeflateRect(USIZE size)
00400     { ::InflateRect(this, -size.cx, -size.cy); }
00401 inline void URect::OffsetRect(int x, int y)
00402     { ::OffsetRect(this, x, y); }
00403 inline void URect::OffsetRect(UPOINT point)
00404     { ::OffsetRect(this, point.x, point.y); }
00405 inline void URect::OffsetRect(USIZE size)
00406     { ::OffsetRect(this, size.cx, size.cy); }
00407 inline bool URect::IntersectRect(const URECT* lpRect1, const URECT* lpRect2)
00408     { return ::IntersectRect(this, lpRect1, lpRect2);}
00409 inline bool URect::UnionRect(const URECT* lpRect1, const URECT* lpRect2)
00410     { return ::UnionRect(this, lpRect1, lpRect2); }
00411 inline void URect::operator=(const URECT& srURect)
00412     { ::CopyRect(this, &srURect); }
00413 inline bool URect::operator==(const URECT& rect) const
00414     { return ::EqualRect(this, &rect); }
00415 inline bool URect::operator!=(const URECT& rect) const
00416     { return !::EqualRect(this, &rect); }
00417 inline void URect::operator+=(UPOINT point)
00418     { ::OffsetRect(this, point.x, point.y); }
00419 inline void URect::operator+=(USIZE size)
00420     { ::OffsetRect(this, size.cx, size.cy); }
00421 inline void URect::operator+=(const URECT* lpRect)
00422     { InflateRect(lpRect); }
00423 inline void URect::operator-=(UPOINT point)
00424     { ::OffsetRect(this, -point.x, -point.y); }
00425 inline void URect::operator-=(USIZE size)
00426     { ::OffsetRect(this, -size.cx, -size.cy); }
00427 inline void URect::operator-=(const URECT* lpRect)
00428     { DeflateRect(lpRect); }
00429 inline void URect::operator&=(const URECT& rect)
00430     { ::IntersectRect(this, this, &rect); }
00431 inline void URect::operator|=(const URECT& rect)
00432     { ::UnionRect(this, this, &rect); }
00433 inline URect URect::operator+(UPOINT pt) const
00434     { URect rect(*this); ::OffsetRect(&rect, pt.x, pt.y); return rect; }
00435 inline URect URect::operator-(UPOINT pt) const
00436     { URect rect(*this); ::OffsetRect(&rect, -pt.x, -pt.y); return rect; }
00437 inline URect URect::operator+(USIZE size) const
00438     { URect rect(*this); ::OffsetRect(&rect, size.cx, size.cy); return rect; }
00439 inline URect URect::operator-(USIZE size) const
00440     { URect rect(*this); ::OffsetRect(&rect, -size.cx, -size.cy); return rect; }
00441 inline URect URect::operator+(const URECT* lpRect) const
00442     { URect rect(this); rect.InflateRect(lpRect); return rect; }
00443 inline URect URect::operator-(const URECT* lpRect) const
00444     { URect rect(this); rect.DeflateRect(lpRect); return rect; }
00445 inline URect URect::operator&(const URECT& rect2) const
00446     { URect rect; ::IntersectRect(&rect, this, &rect2);
00447         return rect; }
00448 inline URect URect::operator|(const URECT& rect2) const
00449     { URect rect; ::UnionRect(&rect, this, &rect2);
00450         return rect; }
00451 /*  inline bool URect::SubtractRect(const URECT* lpRectSrc1, const URECT* lpRectSrc2)
00452     { return ::SubtractRect(this, lpRectSrc1, lpRectSrc2); }*/
00453
00454 typedef long UCOLORREF;
00455 #define URGB(r,g,b) ((UCOLORREF)(((unsigned char)(r)|((unsigned short)((unsigned char)(g))<<8))|(((unsigned int)(unsigned char)(b))<<16)))
00456 #define UGetRValue(rgb)      ((unsigned char)(rgb))
00457 #define UGetGValue(rgb)      ((unsigned char)(((unsigned short)(rgb)) >> 8))
00458 #define UGetBValue(rgb)      ((unsigned char)((rgb)>>16))
00459
00460 #define UPS_SOLID 0
00461
00462 class UPen
00463 {
00464 public:
00465     UPen();
00466     ~UPen();
00467
00468     bool DeleteObject(void);
00469
00470     bool CreatePen(int nPenStyle, int nWidth, UCOLORREF crColor);
00471 protected:
00472     int m_width;
00473     int m_style;
00474 #if qGTK
00475     GdkColor m_col;
00476     bool m_set;
00477 #endif
00478
00479 friend class UDC;
00480 };
00481
00482 class UBrush
00483 {
00484 public:
00485     UBrush();
00486     ~UBrush();
00487
00488     bool DeleteObject(void);
00489
00490     bool CreateSolidBrush(UCOLORREF crColor);
00491 protected:
00492 #if qGTK
00493     GdkColor m_col;
00494     bool m_set;
00495 #endif
00496
00497 friend class UDC;
00498 };
00499
00500 class UWidget;
00501
00502 class UDC
00503 {
00504 public:
00505     UDC(int widid, int cmdid);
00506     ~UDC();
00507
00508     USize GetTextExtent(const char *lpszString, int nCount) const;
00509     int GetTextHeight(void) const;
00510     bool TextOutClipped(int x, int y, const URECT *lpRect,
00511                         const char *lpszString, int nCount);
00512
00513     void MoveTo(int x, int y);
00514     void LineTo(int x, int y);
00515     bool DrawBitmap(void *bitmap, UPOINT where);
00516
00517     UPen *SelectObject(UPen* pPen);
00518     UBrush *SelectObject(UBrush* pBrush);
00519
00520     bool Rectangle(const URECT *lpRect);
00521     bool RoundRect(const URECT *lpRect, UPOINT point);
00522 protected:
00523     void *m_wid;
00524     UPen *m_pen;
00525     UBrush *m_brush;
00526 #if qGTK
00527     GdkGC *m_gc;
00528     UPoint m_penloc;
00529     GdkColor m_foreground, m_background;
00530     GdkFont *m_font;
00531     GdkDrawable *m_drawable;
00532     UPoint m_orig;
00533 #endif
00534 };
00535 #endif /* __cplusplus */
00536
00537 #endif /* UDRAW_H */
Generated on Sun Feb 24 01:21:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/uevent.cpp Source File

rf/uevent.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- May 1999
00019  */
00020
00021 #include "stdafx.h"
00022
00023 #ifdef HAVE_CONFIG_H
00024 #include "config.h"
00025 #endif
00026
00027 #if TIME_WITH_SYS_TIME
00028 # include <sys/time.h>
00029 # include <time.h>
00030 #else
00031 # if HAVE_SYS_TIME_H
00032 #  include <sys/time.h>
00033 # else
00034 #  include <time.h>
00035 # endif
00036 #endif
00037
00038 #include "umain.h"
00039 #include "uconsole.h"
00040 #include "uwidget.h"
00041
00042 #include <map>
00043
00044 #if defined(_DEBUG) && defined(WIN32)
00045 #   define new DEBUG_NEW
00046 #   undef THIS_FILE
00047     static char THIS_FILE[] = __FILE__;
00048 #endif
00049
00050 #if qMacAPP
00051 #   include "UMenuMgr.h"
00052 #   include "UCheckBox.h"
00053 #   include "URadio.h"
00054 #endif
00055
00056 #ifdef qMacPP
00057 #   include "UPseudoSupport.h"
00058 #   include <LCheckBox.h>
00059 #   include <LRadioButton.h>
00060 #   include <LEditText.h>
00061 #   include <LStaticText.h>
00062 #   include <LCheckBoxGroupBox.h>
00063 #endif
00064
00065 #ifdef WIN32
00066 #   include "PseudoButton.h"
00067 #endif
00068
00074 #define MIN_IDLE 100
00075
00076 static long sLastIdle = 0;
00077
00078 // handler to forward the tooltip (usually the status bar)
00079 extern "C"
00080 {
00081     static void (*sTooltipHandler) (const char *) = 0L;
00082 }
00083
00084 // all the framework widgets are located there
00085 class CAllTargets
00086 {
00087 public:
00088     CAllTargets() {}
00089     ~CAllTargets()
00090     {
00091         // delete the remaining widgets at exit.
00092         // we don't make a loop because the widget gets
00093         // removed from the map when calling the destructor.
00094         STD map<int, UCmdTarget *>::iterator i;
00095         while(targets.size() != 0)
00096         {
00097             i = targets.begin();
00098             delete (*i).second;
00099         }
00100     }
00101
00102     inline STD map<int, UCmdTarget *> & Get(void) { return targets; }
00103     inline const STD map<int, UCmdTarget *> & Get(void) const { return targets; }
00104 protected:
00105     STD map<int, UCmdTarget *> targets;
00106 } sAllTargets;
00107
00108 const UMSGMAP* UCmdTarget::GetBaseMessageMap()
00109     { return 0L; }
00110 const UMSGMAP* UCmdTarget::GetThisMessageMap()
00111     { return &UCmdTarget::messageMap; }
00112 const UMSGMAP* UCmdTarget::GetMessageMap() const
00113     { return &UCmdTarget::messageMap; }
00114 const UMSGMAP UCmdTarget::messageMap =
00115 { 0L, &UCmdTarget::_messageEntries[0] };
00116 const UMSGMAP_ENTRY UCmdTarget::_messageEntries[] =
00117 {
00118     {EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }
00119 };
00120
00121 static bool sTurnOffDispatching = false;
00122
00123 class CTurnOffDispatching
00124 {
00125 public:
00126     CTurnOffDispatching() : m_didSetIt(false)
00127     {
00128         if(!sTurnOffDispatching)
00129         {
00130             m_didSetIt = true;
00131             sTurnOffDispatching = true;
00132         }
00133     }
00134
00135     ~CTurnOffDispatching()
00136     {
00137         if(m_didSetIt)
00138             sTurnOffDispatching = false;
00139     }
00140 protected:
00141     bool m_didSetIt;
00142 };
00143
00144 UIMPLEMENT_DYNAMIC(UCmdTarget, UObject)
00145
00146 // the message class used to post retained messages
00147 class CMsg
00148 {
00149 public:
00150     CMsg(int wid, int ev, int arg1, void *arg2) : m_wid(wid), m_ev(ev), m_arg1(arg1), m_arg2(arg2)
00151     {
00152     }
00153
00154     CMsg() : m_wid(0), m_ev(0), m_arg1(0), m_arg2(0L)
00155     {
00156     }
00157
00158     CMsg(const CMsg & msg) : m_wid(0), m_ev(0), m_arg1(0), m_arg2(0L)
00159     {
00160         *this = msg;
00161     }
00162
00163     CMsg & operator=(const CMsg & msg)
00164     {
00165         m_wid = msg.m_wid;
00166         m_ev = msg.m_ev;
00167         m_arg1 = msg.m_arg1;
00168         m_arg2 = msg.m_arg2;
00169
00170         return *this;
00171     }
00172
00173     int m_wid, m_ev, m_arg1;
00174     void *m_arg2;
00175
00176 };
00177
00178 static std::vector<CMsg> sRetainedMsgs;
00179
00180 union UMessageMapFunctions
00181 {
00182     UPMSG pfn;   // generic member function pointer
00183
00184     // specific type safe variants
00185     void(UCmdTarget::*pfnV_V)(void);
00186     void(UCmdTarget::*pfnV_VP)(void *);
00187     void(UCmdTarget::*pfnV_iVP)(int,void *);
00188     void(UCmdTarget::*pfnV_i)(int);
00189     void(UCmdTarget::*pfnV_ii)(int, int);
00190     void(UCmdTarget::*pfnV_iii)(int, int, int);
00191     void(UCmdTarget::*pfnV_iiVP)(int, int, void *);
00192     int(UCmdTarget::*pfni_ii)(int, int);
00193     int(UCmdTarget::*pfni_i)(int);
00194     int(UCmdTarget::*pfni_V)();
00195     int(UCmdTarget::*pfni_iVP)(int,void *);
00196     int(UCmdTarget::*pfni_VP)(void *);
00197 };
00198
00199 int UEventSendMessage(int wid, int/*UEventType*/ evt, int arg1, void *arg2)
00200 {
00201     if(sTurnOffDispatching)
00202         return 0;
00203
00204     const STD map<int, UCmdTarget *> & targets = sAllTargets.Get();
00205     STD map< int, UCmdTarget * >::const_iterator iter = targets.find(wid);
00206     int res = 0;
00207
00208     if(iter != targets.end())
00209     {
00210         UCmdTarget *target = (*iter).second;
00211         UCmdTarget::UDispatchInfo dispatchInfo = UCmdTarget::kUNoDispatchInfo;
00212 #if qDebug
00213         try {
00214 #endif
00215         res = target->UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00216 #if qDebug
00217         } catch(...) {
00218             UASSERT(0);
00219             throw;
00220         }
00221 #endif
00222     }
00223     else
00224     {
00225         UAppConsole("Unknown widget id : %d\n", wid);
00226     }
00227
00228     return res;
00229 }
00230
00231 int UEventSendMessageExt(int wid, int/*UEventType*/ evt, int arg1, void *arg2, int * handledFlag)
00232 {
00233     const STD map<int, UCmdTarget *> & targets = sAllTargets.Get();
00234     STD map< int, UCmdTarget * >::const_iterator iter = targets.find(wid);
00235     int res = 0;
00236     UCmdTarget::UDispatchInfo dispatchInfo = UCmdTarget::kUNoDispatchInfo;
00237
00238     if(iter != targets.end())
00239     {
00240         UCmdTarget *target = (*iter).second;
00241 #if qDebug
00242         try {
00243 #endif
00244         res = target->UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00245 #if qDebug
00246         } catch(...) {
00247             UASSERT(0);
00248             throw;
00249         }
00250 #endif
00251     }
00252     else
00253     {
00254         UAppConsole("Unknown widget id : %d\n", wid);
00255     }
00256
00257     *handledFlag = (dispatchInfo & UCmdTarget::kUDispatchHandled) != 0;
00258     return res;
00259 }
00260
00261 // for the retained messages
00262 int UEventPostMessage(int wid, int/*UEventType*/ evt, int arg1, void *arg2)
00263 {
00264     sRetainedMsgs.push_back(CMsg(wid, evt, arg1, arg2));
00265     return 0;
00266 }
00267
00268 // a notify message get broadcasted to every in the map.
00269 int UEventNotifyMessage(int/*UEventType*/ evt, int arg1, void *arg2)
00270 {
00271     STD map< int, UCmdTarget * >::const_iterator iter;
00272     const STD map<int, UCmdTarget *> & targets = sAllTargets.Get();
00273     int res = 0;
00274
00275     for(iter = targets.begin(); iter != targets.end(); ++iter)
00276     {
00277         UCmdTarget *target = (*iter).second;
00278         UCmdTarget::UDispatchInfo dispatchInfo = UCmdTarget::kUNoDispatchInfo;
00279 #if qDebug
00280         try {
00281 #endif
00282         res = target->UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00283 #if qDebug
00284         } catch(...) {
00285             UASSERT(0);
00286             throw;
00287         }
00288 #endif
00289         if(res)
00290             break;
00291     }
00292
00293     return res;
00294 }
00295
00296 int UEventGetWidID(void)
00297 {
00298     static int newid = 100;
00299     return newid++;
00300 }
00301
00302 UCmdTarget *UEventQueryWidget(int widid)
00303 {
00304     const STD map<int, UCmdTarget *> & targets = sAllTargets.Get();
00305     STD map< int, UCmdTarget * >::const_iterator iter = targets.find(widid);
00306     if(iter != targets.end())
00307     {
00308         UCmdTarget *target = (*iter).second;
00309         return target;
00310     }
00311     return 0L;
00312 }
00313
00314 void UEventRemoveWidID(int widid)
00315 {
00316     STD map<int, UCmdTarget *> & targets = sAllTargets.Get();
00317     STD map<int, UCmdTarget *>::iterator i = targets.find(widid);
00318     if(i == targets.end())
00319         return;
00320     targets.erase(i);
00321 }
00322
00323 int UCmdTarget::UDispatchMessage(int/*UEventType*/ evt, int arg1, void *arg2, UDispatchInfo & dispatchInfo)
00324 {
00325     const UMSGMAP* themap;
00326     const UMSGMAP_ENTRY *entries;
00327     for(themap = GetMessageMap(); themap != 0L; themap = themap->pBaseMap)
00328     {
00329         entries = themap->lpEntries;
00330         while(entries->nMessage != EV_NONE)
00331         {
00332             if(entries->ext == UMSG_RANGE)
00333             {
00334                 int cmd = (unsigned short)ULOWORD(arg1);
00335                 if(evt == entries->nMessage &&
00336                     cmd >= entries->ext1 &&
00337                     cmd <= entries->ext2)
00338                         goto dispatch;
00339             }
00340             else if(entries->nMessage == evt)
00341                 goto dispatch;
00342             entries++;
00343         }
00344     }
00345     return 0;
00346
00347 dispatch:
00348     union UMessageMapFunctions mmf;
00349     mmf.pfn = entries->pfn;
00350     int res = 0;
00351
00352     dispatchInfo = UDispatchInfo((int)dispatchInfo | UCmdTarget::kUDispatchHandled);
00353
00354     switch(entries->nSig)
00355     {
00356     case epV_V:
00357         (this->*mmf.pfnV_V)();
00358         break;
00359     case epV_VP:
00360         (this->*mmf.pfnV_VP)(arg2);
00361         break;
00362     case epV_iVP:
00363         (this->*mmf.pfnV_iVP)(arg1, arg2);
00364         break;
00365     case epV_IVP:
00366         (this->*mmf.pfnV_iVP)(UHIWORD(arg1), arg2);
00367         break;
00368     case epV_i:
00369         (this->*mmf.pfnV_i)(arg1);
00370         break;
00371     case epV_I:
00372         (this->*mmf.pfnV_i)(UHIWORD(arg1));
00373         break;
00374     case epV_ii:
00375         (this->*mmf.pfnV_ii)(ULOWORD(arg1), UHIWORD(arg1));
00376         break;
00377     case epV_iii:
00378         (this->*mmf.pfnV_iii)(ULOWORD(arg1), UHIWORD(arg1), (int)arg2);
00379         break;
00380     case epV_iiVP:
00381         (this->*mmf.pfnV_iiVP)(ULOWORD(arg1), UHIWORD(arg1), arg2);
00382         break;
00383     case epi_ii:
00384         res = (this->*mmf.pfni_ii)(ULOWORD(arg1), UHIWORD(arg1));
00385         break;
00386     case epi_i:
00387         res = (this->*mmf.pfni_i)(arg1);
00388         break;
00389     case epi_V:
00390         res = (this->*mmf.pfni_V)();
00391         break;
00392     case epi_iVP:
00393         res = (this->*mmf.pfni_iVP)(arg1, arg2);
00394         break;
00395     case epi_VP:
00396         res = (this->*mmf.pfni_VP)(arg2);
00397         break;
00398     default:
00399         UAppConsole("Unknown event cast : %d\n", entries->nSig);
00400         break;
00401     }
00402
00403     return res;
00404 }
00405
00406 UCmdTarget::UCmdTarget(int widid) : m_widid(widid)
00407 {
00408     std::map<int, UCmdTarget *>::value_type val(widid, this);
00409     sAllTargets.Get().insert(val);
00410 }
00411
00412 UCmdTarget::~UCmdTarget()
00413 {
00414     UEventRemoveWidID(m_widid);
00415 }
00416
00417 void UCmdUI::Enable(bool bOn)
00418 {
00419     m_continue = false;
00420
00421 #ifdef qMacAPP
00422     if((long)m_widget <= 2L)
00423     {
00424         // this is a menu
00425         ::Enable(m_nID, bOn);
00426         m_widget = (void *)(bOn ? 1L : 2L);
00427             // see UCmdUI::Check
00428     }
00429     else
00430     {
00431         TView *view = (TView *)m_widget;
00432         if(MA_MEMBER(view, TView))
00433         {
00434             view->SetActiveState(bOn, kRedraw);
00435         }
00436     }
00437 #endif
00438 #ifdef qMacPP
00439     if(m_wrapper != 0L)
00440     {
00441         // this is a menu
00442         *m_wrapper->outEnabled = bOn;
00443     }
00444     else
00445     {
00446         LPane *view = (LPane *)m_widget;
00447         if(view != 0L)
00448         {
00449             if(bOn)
00450                 view->Enable();
00451             else
00452                 view->Disable();
00453         }
00454     }
00455 #endif
00456 #ifdef WIN32
00457     if(pCmdUI != 0L)
00458     {
00459         // this is a menu
00460         pCmdUI->Enable(bOn);
00461     }
00462     else if(m_widget)
00463     {
00464         // this something else
00465         CWnd *wid = (CWnd *)m_widget;
00466         BOOL state = bOn;
00467         if(state != wid->IsWindowEnabled())
00468             wid->EnableWindow(state);
00469     }
00470 #endif
00471 #ifdef qGTK
00472     if(m_widget != 0L)
00473     {
00474         if(GTK_IS_WIDGET(m_widget))
00475         {
00476             gtk_widget_set_sensitive(GTK_WIDGET(m_widget), bOn);
00477         }
00478     }
00479 #endif
00480 }
00481
00482 void UCmdUI::Check(bool bOn)
00483 {
00484     m_continue = false;
00485
00486 #ifdef qMacAPP
00487     if((long)m_widget <= 2L)
00488     {
00489         // this is a menu
00490         if(m_widget == 0L)
00491         {
00492             UASSERT("You need to call UCmdUI::Enable before UCmdUI::Check !\n");
00493         }
00494         else
00495         {
00496             ::EnableCheck(m_nID, m_widget == (void *)1L, bOn);
00497         }
00498     }
00499     else
00500     {
00501         TView *view = (TView *)m_widget;
00502         if(MA_MEMBER(view, TCheckBox))
00503         {
00504             ((TCheckBox *)view)->SetState(bOn, kRedraw);
00505         }
00506         else if(MA_MEMBER(view, TRadio))
00507         {
00508             ((TRadio *)view)->SetState(bOn, kRedraw);
00509         }
00510     }
00511 #endif
00512 #ifdef qMacPP
00513     if(m_wrapper != 0L)
00514     {
00515         // this is a menu
00516         *m_wrapper->outUsesMark = true;
00517         *m_wrapper->outMark = bOn ? checkMark : noMark;
00518     }
00519     else
00520     {
00521         LPane *view = (LPane *)m_widget;
00522         if(dynamic_cast<LCheckBox*>(view) != 0L ||
00523             dynamic_cast<LRadioButton*>(view) != 0L ||
00524             dynamic_cast<LCheckBoxGroupBox*>(view) != 0L ||
00525             dynamic_cast<LBevelButton*>(view) != 0L)
00526         {
00527             USemaphore policeman(gTurnOffBroadcast);
00528
00529             view->SetValue(bOn ? Button_On : Button_Off);
00530         }
00531     }
00532 #endif
00533 #ifdef WIN32
00534     if(pCmdUI != 0L)
00535     {
00536         // this is a menu
00537         pCmdUI->SetCheck(bOn ? 1 : 0);
00538     }
00539     else if(m_widget)
00540     {
00541         CWnd *wnd = (CWnd *)m_widget;
00542         if(wnd->IsKindOf(RUNTIME_CLASS(CPseudoToggle)))
00543         {
00544             CPseudoToggle *btn = (CPseudoToggle *)wnd;
00545             btn->SetState(bOn);
00546         }
00547         else if(wnd->IsKindOf(RUNTIME_CLASS(CButton)))
00548         {
00549             CButton *btn = (CButton *)wnd;
00550             btn->SetCheck(bOn ? BST_CHECKED : BST_UNCHECKED);
00551         }
00552     }
00553 #endif
00554 #ifdef qGTK
00555     if(m_widget != 0L)
00556     {
00557         if(GTK_IS_TOGGLE_BUTTON(m_widget))
00558         {
00559             CTurnOffDispatching turnOff;
00560             gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_widget), bOn);
00561         }
00562     }
00563 #endif
00564 }
00565
00566 void UCmdUI::SetText(const char *title)
00567 {
00568     m_continue = false;
00569
00570 #ifdef qMacAPP
00571     if((long)m_widget <= 2L)
00572     {
00573         // this is a menu
00574         CStr255_AC pstr(title);
00575         SetCommandName(m_nID, pstr);
00576     }
00577     else
00578     {
00579         TCtlMgr *view = (TCtlMgr *)m_widget;
00580         if(MA_MEMBER(view, TCtlMgr))
00581         {
00582             view->SetText(CStr255_AC(title), kRedraw);
00583         }
00584     }
00585 #endif
00586 #ifdef qGTK
00587     if(m_widget != 0L)
00588     {
00589         if(GTK_IS_TOGGLE_BUTTON(m_widget))
00590         {
00591             GtkLabel *label = getLabelFromContainer(GTK_CONTAINER(m_widget));
00592             if(label != 0L)
00593                 gtk_label_set_text(label, title);
00594         }
00595     }
00596 #endif
00597 #ifdef qMacPP
00598     if(m_wrapper != 0L)
00599     {
00600         // this is a menu
00601         LStr255 pstr(title);
00602         LString::CopyPStr(pstr, m_wrapper->outName);
00603     }
00604     else
00605     {
00606         LPane *view = (LPane *)m_widget;
00607         LEditText *edit;
00608         LStaticText *stat;
00609         if((edit = dynamic_cast<LEditText*>(view)) != 0L)
00610         {
00611             edit->SetText((Ptr)title, strlen(title));
00612         }
00613         else if((stat = dynamic_cast<LStaticText*>(view)) != 0L)
00614         {
00615             stat->SetText((Ptr)title, strlen(title));
00616         }
00617     }
00618 #endif
00619 #ifdef WIN32
00620     if(pCmdUI != 0L)
00621     {
00622         // this is a menu
00623         if(title != 0L && *title != '\0')
00624             pCmdUI->SetText(title);
00625     }
00626 #endif
00627 }
00628
00629 void UCmdUI::SetTooltip(const char *tooltip)
00630 {
00631     if(tooltip == 0L)
00632         return;
00633
00634     char status[256] = {'\0'};
00635     char prompt[256] = {'\0'};
00636
00637     strcpy(status, tooltip);
00638     char *cr = strchr(status, '\n');
00639     if(cr != 0L)
00640     {
00641         strcpy(prompt, cr + 1);
00642         *cr = '\0';
00643     }
00644 #ifdef WIN32
00645 #   define _countof(array) (sizeof(array)/sizeof(array[0]))
00646     NMHDR *hdr = (NMHDR *)pNMHDR;
00647     ASSERT(hdr->code == TTN_NEEDTEXTA || hdr->code == TTN_NEEDTEXTW);
00648
00649     TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)hdr;
00650     TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)hdr;
00651 #   ifndef _UNICODE
00652     if (hdr->code == TTN_NEEDTEXTA)
00653         lstrcpyn(pTTTA->szText, prompt, _countof(pTTTA->szText));
00654     else
00655         _mbstowcsz(pTTTW->szText, prompt, _countof(pTTTW->szText));
00656 #   else
00657     if (hdr->code == TTN_NEEDTEXTA)
00658         _wcstombsz(pTTTA->szText, prompt, _countof(pTTTA->szText));
00659     else
00660         lstrcpyn(pTTTW->szText, prompt, _countof(pTTTW->szText));
00661 #   endif
00662 #endif
00663
00664     if(sTooltipHandler != 0L)
00665         sTooltipHandler(status);
00666 }
00667
00668 void UEventSetTooltipHandler(void (*handler) (const char *))
00669 {
00670     sTooltipHandler = handler;
00671 }
00672
00673 void UEventGiveTime(void)
00674 {
00675     STD map< int, UCmdTarget * >::const_iterator iter;
00676     const STD map<int, UCmdTarget *> & targets = sAllTargets.Get();
00677
00678     // post the retained events
00679     while(!sRetainedMsgs.empty())
00680     {
00681         CMsg msg = *sRetainedMsgs.begin();
00682         sRetainedMsgs.erase(sRetainedMsgs.begin());
00683         UEventSendMessage(msg.m_wid, msg.m_ev, msg.m_arg1, msg.m_arg2);
00684     }
00685
00686     // take care about the EV_UPDATEUI notification
00687     if(!UWidget::IsUIValid())
00688     {
00689         UWidget::DoValidUI(true);
00690
00691         // warn the widget it's going to happen so they can cache
00692         // some informations.
00693         for(iter = targets.begin(); iter != targets.end(); ++iter)
00694         {
00695             UCmdTarget *target = (*iter).second;
00696             if(!target->IsKindOf(URUNTIME_CLASS(UWidget)))
00697                 continue;
00698
00699             UWidget *wid = (UWidget *)target;
00700             wid->BeforeUpdateUI();
00701         }
00702
00703         for(iter = targets.begin(); iter != targets.end(); ++iter)
00704         {
00705             UCmdTarget *target = (*iter).second;
00706             if(!target->IsKindOf(URUNTIME_CLASS(UWidget)))
00707                 continue;
00708
00709             UWidget *wid = (UWidget *)target;
00710             UEventSendMessage(wid->GetWidID(), EV_UPDATEUI, 0, 0L);
00711         }
00712     }
00713
00714     long thisIdle = UTickCount();
00715     if((thisIdle - sLastIdle) < MIN_IDLE)
00716         return;
00717
00718     // search the timers
00719     for(iter = targets.begin(); iter != targets.end(); ++iter)
00720     {
00721         UCmdTarget *target = (*iter).second;
00722         if(!target->IsKindOf(URUNTIME_CLASS(UWidget)))
00723             continue;
00724
00725         UWidget *wid = (UWidget *)target;
00726         std::vector<UTimer> & timers = wid->GetTimers();
00727         std::vector<UTimer>::iterator t;
00728         for(t = timers.begin(); t != timers.end(); ++t)
00729         {
00730             UTimer & timer = *t;
00731             if((thisIdle - timer.m_lastlap) >= timer.m_lap)
00732             {
00733                 // trigger the timer
00734                 timer.m_lastlap = thisIdle;
00735                 UEventSendMessage(wid->GetWidID(), EV_TIMER, timer.m_cmd, (void *)thisIdle);
00736             }
00737         }
00738     }
00739
00740     sLastIdle = thisIdle;
00741 }
00742
00743 long UTickCount(void)
00744 {
00745 #ifdef WIN32
00746     return ::GetTickCount();
00747 #elif defined(macintosh)
00748     long res = ::TickCount();
00749     return res = (float)res * (1000.0 / 60.0);
00750 #else
00751     struct timeval tval;
00752     static long refcount;
00753
00754     gettimeofday(&tval, 0L);
00755
00756     if(refcount == 0)
00757         refcount = tval.tv_sec;
00758
00759     return (tval.tv_sec - refcount) * 1000 + tval.tv_usec / 1000;
00760 #endif
00761 }
00762
00763 const STD map<int, UCmdTarget *> & UEventGetTargets(void)
00764 {
00765     return sAllTargets.Get();
00766 }
Generated on Sun Feb 24 01:21:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/umain.h Source File

rf/umain.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- May 1999
00019  */
00020
00021 #ifndef UEVENT_H
00022 #define UEVENT_H
00023
00024 #include "uobject.h"
00025
00026 /*
00027  * The routing of the messages is copied from the MFC scheme :
00028  * A message has a sort of "prototype" associated with it and
00029  * is dispatched using a virtual message map : the message goes
00030  * to the child first, then get up to the parents if it was not handled.
00031  */
00032
00033 typedef enum
00034 {
00035     EV_NONE,
00036
00037     /* system events */
00038     EV_CREATE,      /* void OnCreate(void) */
00039     EV_DESTROY,     /* void OnDestroy(void) */
00040     EV_ENTER,       /* void OnEnter(void *data) */
00041     EV_LEAVE,       /* void OnLeave(void) */
00042     EV_EXPOSE,      /* void OnExpose(void) */
00043     EV_MMOVE,       /* void OnMouseMove(int x, int y, int mod) */
00044     EV_BTNDOWN,     /* void OnBtnDown(int x, int y, int mod) */
00045     EV_BTNUP,       /* void OnBtnUp(int x, int y, int mod) */
00046     EV_BTNDBLDOWN,  /* void OnBtnDblDown(int x, int y, int mod) */
00047     EV_KEYDOWN,     /* void OnKeyDown(int c) */
00048     EV_SETCURSOR,   /* void OnSetCursor(void) */
00049     EV_CHGCURSOR,   /* void OnChgCursor(int cmd, UCURSOR cursor) */
00050     EV_RESIZE,      /* void OnResize(const URECT * r) */
00051     EV_GETLOC,      /* void OnGetLoc<Cmd>(int cmd, URECT *) */
00052     EV_SETLOC,      /* void OnSetLoc<Cmd>(int cmd, const URECT *) */
00053
00054     /* generic */
00055     EV_CMD,         /* int On<Cmd>(void) */
00056     EV_UPDTCMD,     /* void OnUpdate<Cmd>(UCmdUI *pCmdUI) */
00057     EV_ENABLECMD,   /* void OnEnableCmd<Cmd>(int cmd, int enabled) */
00058     EV_FETCHCMD,    /* int OnFetchCmd(int cmd, void *widget) */
00059     EV_SETTOOLTIP,  /* void OnSetTooltip<Cmd>(int cmd, UCmdUI *pCmdUI) */
00060     EV_QUERYSTATE,  /* int OnQueryState<Cmd>(int cmd) */
00061     EV_GETINTEGER = EV_QUERYSTATE,
00062     EV_SETSTATE,    /* void OnSetState<Cmd>(int cmd, int state) */
00063     EV_SETINTEGER = EV_SETSTATE,
00064     EV_CHGFOCUS,    /* void OnChgFocus(int cmd) */
00065     EV_INVALIDATE,  /* void OnInvalidate(int cmd) */
00066     EV_REDRAW,      /* void OnRedraw(int cmd) */
00067     EV_GETTEXT,     /* void OnGetText(int cmd, UStr *text); */
00068     EV_SETTEXT,     /* void OnSetText(int cmd, const char *text); */
00069     EV_GETFLOAT,    /* void OnGetFloat(int cmd, float *f); */
00070     EV_SETFLOAT,    /* void OnSetFloat(int cmd, const float *f); */
00071     EV_INIT_WIDGET, /* void OnInitWidget(int cmd, void *widget); */
00072     EV_INIT_TAB_WIDGET, /* void OnInitTabWidget(int cmd, int page, void *widget); */
00073     EV_SHOW_WIDGET, /* void OnShowWidget<Cmd>(int cmd, int state) */
00074     EV_PAGE_CHANGED,    /* void OnPageChanged<Cmd>(int cmd, int pagenum) */
00075
00076     /* notifying */
00077     EV_NOTIFY,          /* void OnNotify<Cmd>(void) */
00078     EV_EDITCHANGE,      /* void OnEditChange<Cmd>(void) */
00079     EV_EDITACTIVATE,    /* void OnEditActivate<Cmd>(void) */
00080     EV_TIMER,           /* void OnTimer<Cmd>(long time) */
00081     EV_UPDATEUI,        /* void OnUpdateUI(void) */
00082     EV_UPDATEFOCUS,     /* int OnUpdateFocus(int leave, void *widget) */
00083
00084     /* drag'n drop */
00085     EV_DRAGQUERY,       /* void OnDragQuery<Cmd>(UDragable *) */
00086     EV_DROPQUERY,       /* void OnDropQuery<Cmd>(UDropable **) */
00087     EV_DROPIT,          /* void OnDropIt<Cmd>(const UDragable *) */
00088     EV_DROPQUERY_CMDID, /* void OnDropQueryCmdID<Cmd>(int x, int y, int *cmdid) */
00089     EV_DROPREF,     /* void OnDropRef<Cmd>(int cmd, int nbref, long *ref) */
00090
00091     /* toolbar manager */
00092     EV_TB_INIT,         /* void OnTbInit(UTB_INIT *info) */
00093     EV_TB_END,          /* void OnTbEnd(void) */
00094     EV_TB_BUTTON,       /* void OnTbButton(UTB_BUTTON *info) */
00095     EV_TB_DROPDOWN,     /* void OnTbDropDown(UTB_DROPDOWN *info) */
00096     EV_TB_CHECKBTN,     /* void OnTbCheckBtn(UTB_BUTTON *info) */
00097     EV_TB_SEPARATOR,    /* void OnTbSeparator(void) */
00098     EV_TB_GETCOLOR,     /* void OnTbGetColor(int cmd, float *color) */
00099
00100     /* slider */
00101     EV_SET_SLIDER,      /* void OnSetSlider(int cmd, int pos) */
00102     EV_GET_SLIDERPROP,  /* void OnGetSliderProperty(int cmd, USLIDER *prop) */
00103     EV_SET_SLIDERPROP,  /* void OnSetSliderProperty(int cmd, const USLIDER *prop) */
00104     EV_SCROLLCHANGE,    /* void OnScrollChange<Cmd>(int pos) */
00105
00106     /* custom drawing */
00107     EV_CUSTOM_DRAW,     /* void OnCustomDraw<Cmd>(void *drawInfo) */
00108
00109     /* tree */
00110     EV_TREE_RESETALL,   /* void OnTreeResetAll(int cmd) */
00111     EV_TREE_INSERT,     /* void OnTreeInsert(int cmd, UTREE_INSERT *data) */
00112     EV_TREE_GETINFO,    /* void OnTreeGetInfo(int cmd, UTREE_INFO *data) */
00113     EV_TREE_SETDATA,    /* void OnTreeSetData(int cmd, UTREE_INFO *data) */
00114     EV_TREE_SETICON,    /* void OnTreeSetIcon(int cmd, UTREE_INFO *data) */
00115     EV_TREE_DELETE,     /* void OnTreeDelete(int cmd, UTREEITEM item) */
00116     EV_TREE_EXPANDING,  /* void OnTreeExpanding<cmd>(int collapse, UTREEITEM item) */
00117     EV_TREE_SELECTING,  /* void OnTreeSelecting<cmd>(int deselecting, UTREEITEM item) */
00118     EV_TREE_EXPAND,     /* void OnTreeExpand(int cmd, int collapse, UTREEITEM item) */
00119     EV_TREE_SELECT,     /* void OnTreeSelect(int cmd, int deselect, UTREEITEM item) */
00120     EV_TREE_GETSEL,     /* void OnTreeGetSel(int cmd, UTREEITEM *item) */
00121
00122     /* list */
00123     EV_LIST_SELECTING,      /* void OnListChange<Cmd>(int entry, const char *txt) */
00124     EV_LIST_SELCOLUMN,      /* void OnListSelColumn<Cmd>(int entry) */
00125     EV_LIST_RESORT,         /* void OnListResort(int cmd, int column, UListSorter s) */
00126     EV_LIST_DBLCLICK,       /* void OnListDblClick<Cmd>(void) */
00127     EV_LIST_RESETALL,       /* void OnListResetAll(int cmd) */
00128     EV_LIST_SETFEEDBACK,    /* void OnListSetFeedback(int cmd, int turnOn) */
00129     EV_LIST_ADDCOLUMNS,     /* void OnListAddColumns(int cmd, int num) */
00130     EV_LIST_SETCOLTITLE,    /* void OnListSetColTitle(int cmd, int num, const char *title) */
00131     EV_LIST_SETCOLWIDTH,    /* void OnListSetColWidth(int cmd, int num, int width) */
00132     EV_LIST_NEWROW,         /* void OnListNewRow(int cmd, int *num) */
00133     EV_LIST_ROWSETDATA,     /* void OnListRowSetData(int cmd, int row, void *data) */
00134     EV_LIST_ROWGETDATA,     /* void OnListRowGetData(int cmd, int row, void **data) */
00135     EV_LIST_INSERT,         /* void OnListInsert(int cmd, ULIST_INSERT *data) */
00136     EV_LIST_ADDSEL,         /* void OnListAddSel(int cmd, int entry) */
00137     EV_LIST_DELROW,         /* void OnListDelRow(int cmd, int row) */
00138     EV_LIST_GETNEXTSEL,     /* int OnListGetNextSel(int cmd, int selectedCell) */
00139     EV_LIST_GETINFO,        /* void OnListGetInfo(int cmd, ULIST_INFO *data) */
00140     EV_LIST_GETNEXT,        /* int OnListGetNext(int cmd, int whichCell) */
00141
00142     /* combo */
00143     EV_COMBO_RESETALL,  /* void OnComboResetAll(int cmd) */
00144     EV_COMBO_APPEND,    /* void OnComboAppend(int cmd, const char *str) */
00145     EV_COMBO_SETSEL,    /* void OnComboSetPos(int cmd, int pos) */
00146     EV_COMBO_GETSEL,    /* int OnComboGetPos(int cmd, UStr *txt) */
00147     EV_COMBO_SEL,       /* void OnComboSel<Cmd>(int pos, const char *txt) */
00148     EV_COMBO_GETCOUNT,  /* int OnComboGetCount(int cmd) */
00149     EV_COMBO_DELSEL,    /* void OnComboDelSel(int cmd, int pos) */
00150     EV_COMBO_ENABLESEL, /* void OnComboEnableSel(int cmd, int pos, int state) */
00151     EV_COMBO_GETMENU,   /* void OnComboGetMenu(int cmd, UMENU *menu) */
00152
00153     /* smart combo (Win32 only at the moment)*/
00154     EV_SMARTCOMBO_SETFEATURE,   /* void OnSmartComboSetFeature(int cmd, int feature) */
00155     EV_SMARTCOMBO_SETITEMS  ,   /* void OnSmartComboSetItems(int cmd, CMString* items) */
00156     EV_SMARTCOMBO_SETREADONLY,  /* void OnSmartComboSetReadOnly(int cmd, bool readOnly) */
00157
00158     /* user defined */
00159     EV_COMMAND_START = 1000
00160 } UEventType;
00161
00162 #ifdef __cplusplus
00163
00164 #ifndef STD
00165 #   define STD std::
00166 #endif
00167
00168 class UCmdTarget;
00169 class UWidget;
00170 class UDragable;
00171 class UDropable;
00172
00173 typedef void (UCmdTarget::*UPMSG)(void);
00174
00175 #define ON_UCREATE(baseClass) \
00176     { EV_CREATE, epV_V, UMSG_NOEXT, 0, 0, \
00177         (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnCreate },
00178
00179 #define ON_UDESTROY(baseClass) \
00180     { EV_DESTROY, epV_V, UMSG_NOEXT, 0, 0, \
00181         (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnDestroy },
00182
00183 #define ON_UENTER(baseClass) \
00184     { EV_ENTER, epV_VP, UMSG_NOEXT, 0, 0, \
00185         (UPMSG)(void (UCmdTarget::*)(void *))&baseClass::OnEnter },
00186
00187 #define ON_ULEAVE(baseClass) \
00188     { EV_LEAVE, epV_V, UMSG_NOEXT, 0, 0, \
00189         (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnLeave },
00190
00191 #define ON_UEXPOSE(baseClass) \
00192     { EV_EXPOSE, epV_V, UMSG_NOEXT, 0, 0, \
00193         (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnExpose },
00194
00195 #define ON_UMMOVE(baseClass) \
00196     { EV_MMOVE, epV_iii, UMSG_NOEXT, 0, 0, \
00197         (UPMSG)(void (UCmdTarget::*)(int x, int y, int mod))&baseClass::OnMouseMove },
00198
00199 #define ON_UBTNDOWN(baseClass) \
00200     { EV_BTNDOWN, epV_iii, UMSG_NOEXT, 0, 0, \
00201         (UPMSG)(void (UCmdTarget::*)(int x, int y, int mod))&baseClass::OnBtnDown },
00202
00203 #define ON_UBTNUP(baseClass) \
00204     { EV_BTNUP, epV_iii, UMSG_NOEXT, 0, 0, \
00205         (UPMSG)(void (UCmdTarget::*)(int x, int y, int mod))&baseClass::OnBtnUp },
00206
00207 #define ON_UBTNDBLDOWN(baseClass) \
00208     { EV_BTNDBLDOWN, epV_iii, UMSG_NOEXT, 0, 0, \
00209         (UPMSG)(void (UCmdTarget::*)(int x, int y, int mod))&baseClass::OnBtnDblDown },
00210
00211 #define ON_KEYDOWN(baseClass) \
00212     { EV_KEYDOWN, epV_i, UMSG_NOEXT, 0, 0, \
00213         (UPMSG)(void (UCmdTarget::*)(int c))&baseClass::OnKeyDown },
00214
00215 #define ON_RESIZE(cmd, hook) \
00216     { EV_RESIZE, epV_VP, UMSG_RANGE, cmd, cmd, \
00217         (UPMSG)(void (UCmdTarget::*)(const URECT * r))&hook },
00218
00219 #define ON_SETCURSOR(baseClass) \
00220     { EV_SETCURSOR, epV_V, UMSG_NOEXT, 0, 0, \
00221         (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnSetCursor },
00222
00223 #define ON_CHGCURSOR(baseClass, cmdmin, cmdmax) \
00224     { EV_CHGCURSOR, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00225         (UPMSG)(void (UCmdTarget::*)(int cmd, UCURSOR cursor))&baseClass::OnChgCursor },
00226
00227 #define ON_TB_INIT(baseClass) \
00228     { EV_TB_INIT, epV_VP, UMSG_NOEXT, 0, 0, \
00229         (UPMSG)(void (UCmdTarget::*)(UTB_INIT *info))&baseClass::OnTbInit },
00230
00231 #define ON_TB_END(baseClass) \
00232     { EV_TB_END, epV_V, UMSG_NOEXT, 0, 0, \
00233         (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnTbEnd },
00234
00235 #define ON_TB_BUTTON(baseClass) \
00236     { EV_TB_BUTTON, epV_VP, UMSG_NOEXT, 0, 0, \
00237         (UPMSG)(void (UCmdTarget::*)(UTB_BUTTON *info))&baseClass::OnTbButton },
00238
00239 #define ON_TB_DROPDOWN(baseClass) \
00240     { EV_TB_DROPDOWN, epV_VP, UMSG_NOEXT, 0, 0, \
00241         (UPMSG)(void (UCmdTarget::*)(UTB_DROPDOWN *info))&baseClass::OnTbDropDown },
00242
00243 #define ON_TB_CHECKBTN(baseClass) \
00244     { EV_TB_CHECKBTN, epV_VP, UMSG_NOEXT, 0, 0, \
00245         (UPMSG)(void (UCmdTarget::*)(UTB_BUTTON *info))&baseClass::OnTbCheckBtn },
00246
00247 #define ON_TB_GETCOLOR(baseClass) \
00248     { EV_TB_GETCOLOR, epV_iVP, UMSG_NOEXT, 0, 0, \
00249         (UPMSG)(void (UCmdTarget::*)(int cmd, float *color))&baseClass::OnTbGetColor },
00250
00251 #define ON_TB_SEPARATOR(baseClass) \
00252     { EV_TB_SEPARATOR, epV_V, UMSG_NOEXT, 0, 0, \
00253         (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnTbSeparator },
00254
00255 #define ON_UCOMMAND(cmd, hook) \
00256     { EV_CMD, epi_V, UMSG_RANGE, cmd, cmd, \
00257         (UPMSG)(int (UCmdTarget::*)(void))&hook },
00258
00259 #define ON_UCOMMAND_RANGE(cmdmin, cmdmax, hook) \
00260     { EV_CMD, epi_i, UMSG_RANGE, cmdmin, cmdmax, \
00261         (UPMSG)(int (UCmdTarget::*)(int cmd))&hook },
00262
00263 #define ON_UCOMMAND_RANGEEX(cmdmin, cmdmax, hook) \
00264     { EV_CMD, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00265         (UPMSG)(int (UCmdTarget::*)(int cmd, void *data))&hook },
00266
00267 #define ON_UUPDATECMD(cmd, hook) \
00268     { EV_UPDTCMD, epV_VP, UMSG_RANGE, cmd, cmd, \
00269         (UPMSG)(void (UCmdTarget::*)(UCmdUI *pCmdUI))&hook },
00270
00271 #define ON_FETCHCMD(baseClass, cmdmin, cmdmax) \
00272     { EV_FETCHCMD, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00273         (UPMSG)(int (UCmdTarget::*)(int cmd, void *widget))&baseClass::OnFetchCmd },
00274
00275 #define ON_UUPDATECMD_RANGE(cmdmin, cmdmax, hook) \
00276     { EV_UPDTCMD, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00277         (UPMSG)(void (UCmdTarget::*)(int cmd, UCmdUI *pCmdUI))&hook },
00278
00279 #define ON_USETTOOLTIP(cmdmin, cmdmax, hook) \
00280     { EV_SETTOOLTIP, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00281         (UPMSG)(void (UCmdTarget::*)(int cmd, UCmdUI *pCmdUI))&hook },
00282
00283 #define ON_UGETLLOC(cmdmin, cmdmax, hook) \
00284     { EV_GETLOC, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00285         (UPMSG)(void (UCmdTarget::*)(int cmd, URECT *r))&hook },
00286
00287 #define ON_USETLLOC(cmdmin, cmdmax, hook) \
00288     { EV_SETLOC, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00289         (UPMSG)(void (UCmdTarget::*)(int cmd, const URECT *r))&hook },
00290
00291 #define ON_QUERYSTATE(cmdmin, cmdmax, hook) \
00292     { EV_QUERYSTATE, epi_i, UMSG_RANGE, cmdmin, cmdmax, \
00293         (UPMSG)(int (UCmdTarget::*)(int cmd))&hook },
00294
00295 #define ON_EDITCHANGE(cmd, hook) \
00296     { EV_EDITCHANGE, epV_V, UMSG_RANGE, cmd, cmd, \
00297         (UPMSG)(void (UCmdTarget::*)(void))&hook },
00298
00299 #define ON_EDITCHANGE_RANGE(cmdmin, cmdmax, hook) \
00300     { EV_EDITCHANGE, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
00301         (UPMSG)(void (UCmdTarget::*)(int cmd))&hook },
00302
00303 #define ON_EDITACTIVATE(cmd, hook) \
00304     { EV_EDITACTIVATE, epV_V, UMSG_RANGE, cmd, cmd, \
00305         (UPMSG)(void (UCmdTarget::*)(void))&hook },
00306
00307 #define ON_EDITACTIVATE_RANGE(cmdmin, cmdmax, hook) \
00308     { EV_EDITACTIVATE, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
00309         (UPMSG)(void (UCmdTarget::*)(int cmd))&hook },
00310
00311 #define ON_SCROLLCHANGE(cmd, hook) \
00312     { EV_SCROLLCHANGE, epV_VP, UMSG_RANGE, cmd, cmd, \
00313         (UPMSG)(void (UCmdTarget::*)(int pos))&hook },
00314
00315 #define ON_SCROLLCHANGE_RANGE(cmdmin, cmdmax, hook) \
00316     { EV_SCROLLCHANGE, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00317         (UPMSG)(void (UCmdTarget::*)(int cmd, int pos))&hook },
00318
00319 #define ON_TIMER(cmd, hook) \
00320     { EV_TIMER, epV_VP, UMSG_RANGE, cmd, cmd, \
00321         (UPMSG)(void (UCmdTarget::*)(long time))&hook },
00322
00323 #define ON_UPDATEUI(baseClass) \
00324     { EV_UPDATEUI, epV_V, UMSG_NOEXT, 0, 0, \
00325         (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnUpdateUI },
00326
00327 #define ON_UPDATEFOCUS(baseClass) \
00328     { EV_UPDATEFOCUS, epi_iVP, UMSG_NOEXT, 0, 0, \
00329         (UPMSG)(int (UCmdTarget::*)(int leave, void *widget))&baseClass::OnUpdateFocus },
00330
00331 #define ON_SETSTATE(cmdmin, cmdmax, hook) \
00332     { EV_SETSTATE, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00333         (UPMSG)(void (UCmdTarget::*)(int cmd, int state))&hook },
00334
00335 #define ON_ENABLECMD(cmdmin, cmdmax, hook) \
00336     { EV_ENABLECMD, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00337         (UPMSG)(void (UCmdTarget::*)(int cmd, int state))&hook },
00338
00339 #define ON_CHGFOCUS(baseClass, cmdmin, cmdmax) \
00340     { EV_CHGFOCUS, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
00341         (UPMSG)(void (UCmdTarget::*)(int cmd))&baseClass::OnChgFocus },
00342
00343 #define ON_INVALIDATE(baseClass, cmdmin, cmdmax) \
00344     { EV_INVALIDATE, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
00345         (UPMSG)(void (UCmdTarget::*)(int cmd))&baseClass::OnInvalidate },
00346
00347 #define ON_REDRAW(baseClass, cmdmin, cmdmax) \
00348     { EV_REDRAW, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
00349         (UPMSG)(void (UCmdTarget::*)(int cmd))&baseClass::OnRedraw },
00350
00351 #define ON_SHOW_WIDGET(cmd, hook) \
00352     { EV_SHOW_WIDGET, epV_I, UMSG_RANGE, cmd, cmd, \
00353         (UPMSG)(void (UCmdTarget::*)(int state))&hook },
00354
00355 #define ON_PAGE_CHANGED(baseClass, cmdmin, cmdmax) \
00356     { EV_PAGE_CHANGED, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00357         (UPMSG)(void (UCmdTarget::*)(int cmd, int pagenum))&baseClass::OnPageChanged },
00358
00359 #define ON_SHOW_WIDGET_RANGE(cmdmin, cmdmax, hook) \
00360     { EV_SHOW_WIDGET, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00361         (UPMSG)(void (UCmdTarget::*)(int cmd, int state))&hook },
00362
00363 #define ON_DROPREF(cmdmin, cmdmax, hook) \
00364     { EV_DROPREF, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00365         (UPMSG)(void (UCmdTarget::*)(int cmd, int numref, long *refs))&hook },
00366
00367 #define ON_UNOTIFY(cmd, hook) \
00368     { EV_NOTIFY, epV_V, UMSG_RANGE, cmd, cmd, \
00369         (UPMSG)(void (UCmdTarget::*)(void))&hook },
00370
00371 #define ON_INIT_WIDGET(baseClass, cmdmin, cmdmax) \
00372     { EV_INIT_WIDGET, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00373         (UPMSG)(void (UCmdTarget::*)(int, void *))&baseClass::OnInitWidget },
00374
00375 #define ON_INIT_TAB_WIDGET(baseClass, cmdmin, cmdmax) \
00376     { EV_INIT_TAB_WIDGET, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00377         (UPMSG)(void (UCmdTarget::*)(int, int, void *))&baseClass::OnInitTabWidget },
00378
00379 #define ON_SETTEXT(cmdmin, cmdmax, hook) \
00380     { EV_SETTEXT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00381         (UPMSG)(void (UCmdTarget::*)(int, const char *))&hook },
00382
00383 #define ON_GETTEXT(cmdmin, cmdmax, hook) \
00384     { EV_GETTEXT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00385         (UPMSG)(void (UCmdTarget::*)(int, UStr *))&hook },
00386
00387 #define ON_SETFLOAT(baseClass, cmdmin, cmdmax) \
00388     { EV_SETFLOAT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00389         (UPMSG)(void (UCmdTarget::*)(int cmd, const float *f))&baseClass::OnSetFloat },
00390
00391 #define ON_GETFLOAT(baseClass, cmdmin, cmdmax) \
00392     { EV_GETFLOAT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00393         (UPMSG)(void (UCmdTarget::*)(int cmd, float *f))&baseClass::OnGetFloat },
00394
00395 #define ON_DRAGQUERY(cmd, hook) \
00396     { EV_DRAGQUERY, epV_VP, UMSG_RANGE, cmd, cmd, \
00397         (UPMSG)(void (UCmdTarget::*)(UDragable *))&hook },
00398
00399 #define ON_DROPQUERY(cmd, hook) \
00400     { EV_DROPQUERY, epV_VP, UMSG_RANGE, cmd, cmd, \
00401         (UPMSG)(void (UCmdTarget::*)(UDropable **))&hook },
00402
00403 #define ON_DROPIT(cmd, hook) \
00404     { EV_DROPIT, epV_VP, UMSG_RANGE, cmd, cmd, \
00405         (UPMSG)(void (UCmdTarget::*)(const UDragable *))&hook },
00406
00407 #define ON_DRAGQUERY_RANGE(cmdmin, cmdmax, hook) \
00408     { EV_DRAGQUERY, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00409         (UPMSG)(void (UCmdTarget::*)(int, UDragable *))&hook },
00410
00411 #define ON_DROPQUERY_RANGE(cmdmin, cmdmax, hook) \
00412     { EV_DROPQUERY, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00413         (UPMSG)(void (UCmdTarget::*)(int, UDropable **))&hook },
00414
00415 #define ON_DROPIT_RANGE(cmdmin, cmdmax, hook) \
00416     { EV_DROPIT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00417         (UPMSG)(void (UCmdTarget::*)(int, const UDragable *))&hook },
00418
00419 #define ON_DROPQUERY_CMDID(baseClass) \
00420     { EV_DROPQUERY_CMDID, epV_iiVP, UMSG_NOEXT, 0, 0, \
00421         (UPMSG)(void (UCmdTarget::*)(int, int, int *))&baseClass::OnDropQueryCmdID },
00422
00423 #define ON_SET_SLIDER(baseClass, cmdmin, cmdmax) \
00424     { EV_SET_SLIDER, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00425         (UPMSG)(void (UCmdTarget::*)(int cmd, int pos))&baseClass::OnSetSlider },
00426
00427 #define ON_GET_SLIDERPROP(baseClass, cmdmin, cmdmax) \
00428     { EV_GET_SLIDERPROP, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00429         (UPMSG)(void (UCmdTarget::*)(int cmd, USLIDER *prop))&baseClass::OnGetSliderProperty },
00430
00431 #define ON_SET_SLIDERPROP(baseClass, cmdmin, cmdmax) \
00432     { EV_SET_SLIDERPROP, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00433         (UPMSG)(void (UCmdTarget::*)(int cmd, const USLIDER *prop))&baseClass::OnSetSliderProperty },
00434
00435 #define ON_TREE_RESETALL(baseClass, cmdmin, cmdmax) \
00436     { EV_TREE_RESETALL, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
00437         (UPMSG)(void (UCmdTarget::*)(int cmd))&baseClass::OnTreeResetAll },
00438
00439 #define ON_TREE_INSERT(baseClass, cmdmin, cmdmax) \
00440     { EV_TREE_INSERT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00441         (UPMSG)(void (UCmdTarget::*)(int cmd, UTREE_INSERT *data))&baseClass::OnTreeInsert },
00442
00443 #define ON_TREE_GETINFO(baseClass, cmdmin, cmdmax) \
00444     { EV_TREE_GETINFO, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00445         (UPMSG)(void (UCmdTarget::*)(int cmd, UTREE_INFO *data))&baseClass::OnTreeGetInfo },
00446
00447 #define ON_TREE_SETDATA(baseClass, cmdmin, cmdmax) \
00448     { EV_TREE_SETDATA, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00449         (UPMSG)(void (UCmdTarget::*)(int cmd, UTREE_INFO *data))&baseClass::OnTreeSetData },
00450
00451 #define ON_TREE_SETICON(baseClass, cmdmin, cmdmax) \
00452     { EV_TREE_SETICON, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00453         (UPMSG)(void (UCmdTarget::*)(int cmd, UTREE_INFO *data))&baseClass::OnTreeSetIcon },
00454
00455 #define ON_TREE_DELETE(baseClass, cmdmin, cmdmax) \
00456     { EV_TREE_DELETE, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00457         (UPMSG)(void (UCmdTarget::*)(int cmd, UTREEITEM item))&baseClass::OnTreeDelete },
00458
00459 #define ON_TREE_EXPAND(baseClass, cmdmin, cmdmax) \
00460     { EV_TREE_EXPAND, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00461         (UPMSG)(void (UCmdTarget::*)(int cmd, int collapse, UTREEITEM item))&baseClass::OnTreeExpand },
00462
00463 #define ON_TREE_SELECT(baseClass, cmdmin, cmdmax) \
00464     { EV_TREE_SELECT, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00465         (UPMSG)(void (UCmdTarget::*)(int cmd, int deselect, UTREEITEM item))&baseClass::OnTreeSelect },
00466
00467 #define ON_TREE_GETSEL(baseClass, cmdmin, cmdmax) \
00468     { EV_TREE_GETSEL, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00469         (UPMSG)(void (UCmdTarget::*)(int cmd, UTREEITEM *item))&baseClass::OnTreeGetSel },
00470
00471 #define ON_TREE_EXPANDING(cmd, hook) \
00472     { EV_TREE_EXPANDING, epV_IVP, UMSG_RANGE, cmd, cmd, \
00473         (UPMSG)(void (UCmdTarget::*)(int collapse, UTREEITEM item))&hook },
00474
00475 #define ON_TREE_SELECTING(cmd, hook) \
00476     { EV_TREE_SELECTING, epV_IVP, UMSG_RANGE, cmd, cmd, \
00477         (UPMSG)(void (UCmdTarget::*)(int deselect, UTREEITEM item))&hook },
00478
00479 #define ON_LIST_SELECTING(cmd, hook) \
00480     { EV_LIST_SELECTING, epV_IVP, UMSG_RANGE, cmd, cmd, \
00481         (UPMSG)(void (UCmdTarget::*)(int entry, const char *txt))&hook },
00482
00483 #define ON_LIST_SELCOLUMN(cmd, hook) \
00484     { EV_LIST_SELCOLUMN, epV_I, UMSG_RANGE, cmd, cmd, \
00485         (UPMSG)(void (UCmdTarget::*)(int entry))&hook },
00486
00487 #define ON_LIST_RESORT(baseClass, cmdmin, cmdmax) \
00488     { EV_LIST_RESORT, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00489         (UPMSG)(void (UCmdTarget::*)(int cmd, int column, UListSorter s))&baseClass::OnListResort },
00490
00491 #define ON_LIST_DBLCLICK(cmd, hook) \
00492     { EV_LIST_DBLCLICK, epV_V, UMSG_RANGE, cmd, cmd, \
00493         (UPMSG)(void (UCmdTarget::*)(void))&hook },
00494
00495 #define ON_LIST_ADDSEL(baseClass, cmdmin, cmdmax) \
00496     { EV_LIST_ADDSEL, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00497         (UPMSG)(void (UCmdTarget::*)(int cmd, int entry))&baseClass::OnListAddSel },
00498
00499 #define ON_LIST_DELROW(baseClass, cmdmin, cmdmax) \
00500     { EV_LIST_DELROW, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00501         (UPMSG)(void (UCmdTarget::*)(int cmd, int row))&baseClass::OnListDelRow },
00502
00503 #define ON_LIST_RESETALL(baseClass, cmdmin, cmdmax) \
00504     { EV_LIST_RESETALL, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
00505         (UPMSG)(void (UCmdTarget::*)(int cmd))&baseClass::OnListResetAll },
00506
00507 #define ON_LIST_ADDCOLUMNS(baseClass, cmdmin, cmdmax) \
00508     { EV_LIST_ADDCOLUMNS, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00509         (UPMSG)(void (UCmdTarget::*)(int cmd, int num))&baseClass::OnListAddColumns },
00510
00511 #define ON_LIST_SETFEEDBACK(baseClass, cmdmin, cmdmax) \
00512     { EV_LIST_SETFEEDBACK, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00513         (UPMSG)(void (UCmdTarget::*)(int cmd, int turnOn))&baseClass::OnListSetFeedback },
00514
00515 #define ON_LIST_SETCOLTITLE(baseClass, cmdmin, cmdmax) \
00516     { EV_LIST_SETCOLTITLE, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00517         (UPMSG)(void (UCmdTarget::*)(int cmd, int num, const char *title))&baseClass::OnListSetColTitle },
00518
00519 #define ON_LIST_SETCOLWIDTH(baseClass, cmdmin, cmdmax) \
00520     { EV_LIST_SETCOLWIDTH, epV_iii, UMSG_RANGE, cmdmin, cmdmax, \
00521         (UPMSG)(void (UCmdTarget::*)(int cmd, int num, int width))&baseClass::OnListSetColWidth },
00522
00523 #define ON_LIST_NEWROW(baseClass, cmdmin, cmdmax) \
00524     { EV_LIST_NEWROW, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00525         (UPMSG)(void (UCmdTarget::*)(int cmd, int *num))&baseClass::OnListNewRow },
00526
00527 #define ON_LIST_ROWSETDATA(baseClass, cmdmin, cmdmax) \
00528     { EV_LIST_ROWSETDATA, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00529         (UPMSG)(void (UCmdTarget::*)(int cmd, int row, void *data))&baseClass::OnListRowSetData },
00530
00531 #define ON_LIST_ROWGETDATA(baseClass, cmdmin, cmdmax) \
00532     { EV_LIST_ROWGETDATA, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00533         (UPMSG)(void (UCmdTarget::*)(int cmd, int row, void **data))&baseClass::OnListRowGetData },
00534
00535 #define ON_LIST_INSERT(baseClass, cmdmin, cmdmax) \
00536     { EV_LIST_INSERT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00537         (UPMSG)(void (UCmdTarget::*)(int cmd, ULIST_INSERT *data))&baseClass::OnListInsert },
00538
00539 #define ON_LIST_GETNEXTSEL(baseClass, cmdmin, cmdmax) \
00540     { EV_LIST_GETNEXTSEL, epi_ii, UMSG_RANGE, cmdmin, cmdmax, \
00541         (UPMSG)(int (UCmdTarget::*)(int cmd, int selectedCell))&baseClass::OnListGetNextSel },
00542
00543 #define ON_LIST_GETNEXT(baseClass, cmdmin, cmdmax) \
00544     { EV_LIST_GETNEXT, epi_ii, UMSG_RANGE, cmdmin, cmdmax, \
00545         (UPMSG)(int (UCmdTarget::*)(int cmd, int whichCell))&baseClass::OnListGetNext },
00546
00547 #define ON_LIST_GETINFO(baseClass, cmdmin, cmdmax) \
00548     { EV_LIST_GETINFO, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00549         (UPMSG)(void (UCmdTarget::*)(int cmd, ULIST_INFO *data))&baseClass::OnListGetInfo },
00550
00551 #define ON_COMBO_RESETALL(baseClass, cmdmin, cmdmax) \
00552     { EV_COMBO_RESETALL, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
00553         (UPMSG)(void (UCmdTarget::*)(int cmd))&baseClass::OnComboResetAll },
00554
00555 #define ON_COMBO_APPEND(baseClass, cmdmin, cmdmax) \
00556     { EV_COMBO_APPEND, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00557         (UPMSG)(void (UCmdTarget::*)(int cmd, const char *txt))&baseClass::OnComboAppend },
00558
00559 #define ON_COMBO_SETSEL(baseClass, cmdmin, cmdmax) \
00560     { EV_COMBO_SETSEL, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00561         (UPMSG)(void (UCmdTarget::*)(int cmd, int sel))&baseClass::OnComboSetPos },
00562
00563 #define ON_COMBO_DELSEL(baseClass, cmdmin, cmdmax) \
00564     { EV_COMBO_DELSEL, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00565         (UPMSG)(void (UCmdTarget::*)(int cmd, int sel))&baseClass::OnComboDelSel },
00566
00567 #define ON_COMBO_ENABLESEL(baseClass, cmdmin, cmdmax) \
00568     { EV_COMBO_ENABLESEL, epV_iii, UMSG_RANGE, cmdmin, cmdmax, \
00569         (UPMSG)(void (UCmdTarget::*)(int cmd, int sel, int state))&baseClass::OnComboEnableSel },
00570
00571 #define ON_COMBO_GETSEL(baseClass, cmdmin, cmdmax) \
00572     { EV_COMBO_GETSEL, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00573         (UPMSG)(int (UCmdTarget::*)(int cmd, UStr *txt))&baseClass::OnComboGetPos },
00574
00575 #define ON_COMBO_GETMENU(baseClass, cmdmin, cmdmax) \
00576     { EV_COMBO_GETMENU, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00577         (UPMSG)(void (UCmdTarget::*)(int cmd, UMENU *menu))&baseClass::OnComboGetMenu },
00578
00579 #define ON_COMBO_GETCOUNT(baseClass, cmdmin, cmdmax) \
00580     { EV_COMBO_GETCOUNT, epi_i, UMSG_RANGE, cmdmin, cmdmax, \
00581         (UPMSG)(int (UCmdTarget::*)(int cmd))&baseClass::OnComboGetCount },
00582
00583 #define ON_COMBO_SEL(cmd, hook) \
00584     { EV_COMBO_SEL, epV_IVP, UMSG_RANGE, cmd, cmd, \
00585         (UPMSG)(void (UCmdTarget::*)(int pos, const char *txt))&hook },
00586
00587 #define ON_COMBO_SEL_RANGE(cmdmin, cmdmax, hook) \
00588     { EV_COMBO_SEL, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00589         (UPMSG)(void (UCmdTarget::*)(int cmd, int pos, const char *txt))&hook },
00590
00591 #define ON_SMARTCOMBO_SETFEATURE(baseClass, cmdmin, cmdmax) \
00592     { EV_SMARTCOMBO_SETFEATURE, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00593         (UPMSG)(void (UCmdTarget::*)(int cmd, int feature))&baseClass::OnSmartComboSetFeature },
00594
00595 #define ON_SMARTCOMBO_SETITEMS(baseClass, cmdmin, cmdmax) \
00596     { EV_SMARTCOMBO_SETITEMS, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00597         (UPMSG)(void (UCmdTarget::*)(int cmd, CMString* items))&baseClass::OnSmartComboSetItems },
00598
00599 #define ON_SMARTCOMBO_SETREADONLY(baseClass, cmdmin, cmdmax) \
00600     { EV_SMARTCOMBO_SETREADONLY, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00601         (UPMSG)(void (UCmdTarget::*)(int cmd, bool readOnly))&baseClass::OnSmartComboSetReadOnly },
00602
00603 #define ON_CUSTOM_DRAW(cmd, hook) \
00604     { EV_CUSTOM_DRAW, epV_VP, UMSG_RANGE, cmd, cmd, \
00605         (UPMSG)(void (UCmdTarget::*)(void *drawInfo))&hook },
00606
00607 #define ON_CUSTOM_DRAW_RANGE(cmdmin, cmdmax, hook) \
00608     { EV_CUSTOM_DRAW, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00609         (UPMSG)(void (UCmdTarget::*)(int cmd, void *drawInfo))&hook },
00610
00611 typedef enum
00612 {
00613     epNone,
00614     epV_V,      // void (void)
00615     epV_VP,     // void (arg2)
00616     epV_iVP,    // void (arg1, arg2)
00617     epV_IVP,    // void (HI(arg1), arg2)
00618     epV_i,      // void (arg1)
00619     epV_I,      // void (HI(arg1))
00620     epV_ii,     // void (LO(arg1), HI(arg1))
00621     epV_iii,    // void (LO(arg1), HI(arg1), (int)arg2)
00622     epV_iiVP,   // void (LO(arg1), HI(arg1), arg2)
00623     epi_i,      // int (arg1)
00624     epi_V,      // int (void)
00625     epi_ii,     // int (LO(arg1), HI(arg1))
00626     epi_iVP,    // int (arg1, arg2)
00627     epi_VP      // int (arg2)
00628 } UEventParam;
00629
00630 typedef enum
00631 {
00632     UMSG_NOEXT,
00633     UMSG_RANGE
00634 } UMSG_EXT;
00635
00636 struct UMSGMAP_ENTRY
00637 {
00638     int/*UEventType*/ nMessage;   // message
00639     UEventParam nSig;       // signature type (parameters)
00640     UMSG_EXT ext;
00641     int ext1;
00642     int ext2;
00643     UPMSG pfn;    // routine to call
00644 };
00645
00646 struct UMSGMAP
00647 {
00648     const UMSGMAP* pBaseMap;
00649     const UMSGMAP_ENTRY* lpEntries;
00650 };
00651
00652 #define UDECLARE_MESSAGE_MAP() \
00653 private: \
00654     static const UMSGMAP_ENTRY _messageEntries[]; \
00655 protected: \
00656     static const UMSGMAP messageMap; \
00657     static const UMSGMAP* GetBaseMessageMap(); \
00658     static const UMSGMAP* GetThisMessageMap(); \
00659     virtual const UMSGMAP* GetMessageMap() const; \
00660
00661 #define UBEGIN_MESSAGE_MAP(theClass, baseClass) \
00662     const UMSGMAP* theClass::GetBaseMessageMap() \
00663         { return baseClass::GetThisMessageMap(); } \
00664     const UMSGMAP* theClass::GetThisMessageMap() \
00665         { return &theClass::messageMap; } \
00666     const UMSGMAP* theClass::GetMessageMap() const \
00667         { return &theClass::messageMap; } \
00668     const UMSGMAP theClass::messageMap = \
00669     { baseClass::GetThisMessageMap(), &theClass::_messageEntries[0] }; \
00670     const UMSGMAP_ENTRY theClass::_messageEntries[] = \
00671     { \
00672
00673 #define UEND_MESSAGE_MAP() \
00674         {EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 } \
00675     }; \
00676
00677 #define ev_msg // intentional placeholder
00678
00679 class UEXPORT UCmdTarget : public UObject
00680 {
00681     UDECLARE_DYNAMIC(UCmdTarget)
00682 public:
00683     UCmdTarget(int widid);
00684     virtual ~UCmdTarget();
00685
00686     typedef enum
00687     {
00688         kUNoDispatchInfo,
00689         kUDispatchHandled = 0x01
00690     } UDispatchInfo;
00691
00693     virtual int UDispatchMessage(int/*UEventType*/ evt, int arg1, void *arg2, UDispatchInfo & dispatchInfo);
00694
00695     inline int GetWidID(void) const { return m_widid; }
00696 private:
00697     int m_widid;
00698
00699     UDECLARE_MESSAGE_MAP()
00700 };
00701
00702 // the interface will ask regularly the widget if they want to be
00703 // disabled, checked (EV_UPDTCMD)...
00704 class UCmdUI
00705 {
00706 public:
00707     UCmdUI(int id) : m_nID(id)
00708 #ifdef WIN32
00709     , pCmdUI(0L)
00710     , pNMHDR(0L)
00711 #endif
00712 #ifdef qMacPP
00713     , m_wrapper(0L)
00714 #endif
00715     , m_widget(0L)
00716     , m_continue(true)
00717         {}
00718     virtual ~UCmdUI() {}
00719
00720 // Attributes
00721     int m_nID;
00722
00723 // Operations to do in ON_UUPDATECMD
00724     virtual void Enable(bool bOn = true);
00725     virtual void Check(bool bOn = true);
00726     virtual void SetText(const char *title);
00727         // by default this sets the continue state to false.
00728
00729     inline void SetContinue(bool state) { m_continue = state; }
00730     inline bool CanContinue(void) { return m_continue; }
00731
00732 // Operations to do in ON_USETTOOLTIP
00733     virtual void SetTooltip(const char *tooltip);
00734 #ifdef WIN32
00735     class CCmdUI *pCmdUI;
00736     void *pNMHDR;
00737 #endif
00738 #ifdef qMacPP
00739     struct UPseudoCmdStatusWrapper *m_wrapper;
00740 #endif
00741     void *m_widget;
00742     bool m_continue;
00743 };
00744
00745 class USemaphore
00746 {
00747 public:
00748     USemaphore(bool & semaphore) : m_semaphore(semaphore), m_didSetSemaphore(false),
00749         m_enteredTwice(false)
00750     {
00751         if(m_semaphore)
00752         {
00753             m_enteredTwice = true;
00754             return;
00755         }
00756         m_semaphore = true;
00757         m_didSetSemaphore = true;
00758     }
00759
00760     ~USemaphore()
00761     {
00762         if(m_didSetSemaphore)
00763             m_semaphore = false;
00764     }
00765
00766     inline bool IsEnteredTwice() const { return m_enteredTwice; }
00767
00768 protected:
00769     bool & m_semaphore;
00770     bool m_didSetSemaphore;
00771     bool m_enteredTwice;
00772 };
00773 #endif /* __cplusplus */
00774
00775 #define UMAKEINT(a, b)       ((int)(((short)(a)) | ((int)((short)(b))) << 16))
00776 #define ULOWORD(l)           ((short)(l))
00777 #define UHIWORD(l)           ((short)(((int)(l) >> 16) & 0xFFFF))
00778
00779 /* Modifier codes */
00780 #define UK_LBUTTON        0x01
00781 #define UK_MBUTTON        0x02
00782 #define UK_RBUTTON        0x04
00783 #define UK_CONTROL        0x08
00784 #define UK_SHIFT          0x10
00785 #define UK_ALT            0x20
00786
00787 /* Keyboard codes (non listed are ASCII codes) */
00788 #define UK_CANCEL         0x03
00789 #define UK_BACK           0x08
00790 #define UK_TAB            0x09
00791 #define UK_CLEAR          0x0C
00792 #define UK_RETURN         0x0D
00793 #define UK_ESCAPE         0x1B
00794 #define UK_SPACE          0x20
00795 #define UK_PRIOR          0x21
00796 #define UK_NEXT           0x22
00797 #define UK_END            0x23
00798 #define UK_HOME           0x24
00799 #define UK_LEFT           0x25
00800 #define UK_UP             0x26
00801 #define UK_RIGHT          0x27
00802 #define UK_DOWN           0x28
00803 #define UK_INSERT         0x2D
00804 #define UK_DELETE         0x2E
00805 #define UK_HELP           0x2F
00806
00807 #define UK_PLUS           0x6B
00808 #define UK_MINUS          0x6D
00809
00810 #define UK_NUMPAD0        0x60
00811 #define UK_NUMPAD1        0x61
00812 #define UK_NUMPAD2        0x62
00813 #define UK_NUMPAD3        0x63
00814 #define UK_NUMPAD4        0x64
00815 #define UK_NUMPAD5        0x65
00816 #define UK_NUMPAD6        0x66
00817 #define UK_NUMPAD7        0x67
00818 #define UK_NUMPAD8        0x68
00819 #define UK_NUMPAD9        0x69
00820 #define UK_MULTIPLY       0x6A
00821 #define UK_ADD            0x6B
00822 #define UK_SEPARATOR      0x6C
00823 #define UK_SUBTRACT       0x6D
00824 #define UK_DECIMAL        0x6E
00825 #define UK_DIVIDE         0x6F
00826 #define UK_F1             0x70
00827 #define UK_F2             0x71
00828 #define UK_F3             0x72
00829 #define UK_F4             0x73
00830 #define UK_F5             0x74
00831 #define UK_F6             0x75
00832 #define UK_F7             0x76
00833 #define UK_F8             0x77
00834 #define UK_F9             0x78
00835 #define UK_F10            0x79
00836 #define UK_F11            0x7A
00837 #define UK_F12            0x7B
00838 #define UK_F13            0x7C
00839 #define UK_F14            0x7D
00840 #define UK_F15            0x7E
00841 #define UK_F16            0x7F
00842 #define UK_F17            0x80
00843 #define UK_F18            0x81
00844 #define UK_F19            0x82
00845 #define UK_F20            0x83
00846 #define UK_F21            0x84
00847 #define UK_F22            0x85
00848 #define UK_F23            0x86
00849 #define UK_F24            0x87
00850
00851 #ifdef WIN32
00852 #   define WINCMD_DLG_START 2000
00853 #   define WINCMD_DLG_END 3000
00854 #   define UCMD_to_WINCMD(cmd) (cmd)
00855 #   define WINCMD_to_UCMD(cmd) (cmd)
00856 #   define UCMD_to_WINCTL(cmd) ((cmd)-EV_COMMAND_START+WINCMD_DLG_START)
00857 #   define WINCTL_to_UCMD(cmd) ((cmd)-WINCMD_DLG_START+EV_COMMAND_START)
00858 #endif
00859
00860 /* see umenu.h */
00861 typedef long UMENU;
00862 #define UMENU_NULL ((UMENU)0L)
00863
00864 /* toolbar manager */
00865 #define UTB_SEPARATOR (-1)
00866 typedef struct
00867 {
00868     int widthbtn, heightbtn;    /* dimensions of each icon */
00869     const char *title;          /* title bar */
00870 #ifdef WIN32
00871     int winid;                  /* if for the toolbar (WIN32 only) */
00872 #endif
00873 } UTB_INIT;
00874
00875 typedef enum
00876 {
00877     DDV_NONE
00878 } UTB_VAR;
00879
00880 typedef enum
00881 {
00882     DDD_NONE = 0x00
00883 } UTB_DROP;
00884
00885 typedef struct
00886 {
00887     const void *icon;       /* icon data (XPM) */
00888     int cmd;                /* associated command */
00889     UTB_VAR varcode;        /* misc. option */
00890     UTB_DROP drop;          /* for drag'n drop */
00891     const char *tooltip;    /* status tooltip/nprompt tooltip */
00892 } UTB_BUTTON;
00893
00894 typedef struct
00895 {
00896     int initialcmd;     /* initial value */
00897     UTB_BUTTON *btns;   /* all the dropdown buttons */
00898 } UTB_DROPDOWN;
00899
00900 typedef struct
00901 {
00902     int max; /* maximum of the scroll range */
00903     int min; /* minimum of the scroll range */
00904     int inc; /* increment of the scroll */
00905     int pos; /* current position of the slider */
00906 } USLIDER;
00907
00908 typedef enum
00909 {
00910     uCursArrow,
00911     uCursWatch
00912 } UCURSOR;
00913
00914 typedef struct
00915 {
00916     int cx, cy;
00917 } USIZE;
00918
00919 typedef struct
00920 {
00921     int x, y;
00922 } UPOINT;
00923
00924 typedef struct
00925 {
00926     int left, top, right, bottom;
00927 } URECT;
00928
00929 typedef void *UTREEITEM;
00930
00931 typedef struct
00932 {
00933     const char *title;          /* tree item title */
00934     UTREEITEM parent;           /* 0L if root */
00935     UTREEITEM result;           /* pointer on the result item */
00936     void *icon;                 /* icon of the item, 0L if any */
00937     void *data;                 /* user data of the item, 0L if any */
00938 } UTREE_INSERT;
00939
00940 typedef struct
00941 {
00942     UTREEITEM item;         /* pointer on the item */
00943     UTREEITEM parent;       /* pointer on the parent (0L if any) */
00944     UTREEITEM next;         /* pointer on the next item (0L if any) */
00945     UTREEITEM child;        /* pointer on the first child item (0L if any) */
00946     void *data;             /* data of the item */
00947     char *title;            /* title of the item */
00948     void *icon;             /* icon of the item */
00949     int expanded;           /* item is expanded */
00950 } UTREE_INFO;
00951
00952 typedef struct
00953 {
00954     int row, col;               /* the coordinates of the entry */
00955     const char *title;          /* the title of the entry (0L if any) */
00956     void *icon;                 /* the icon of the entry (0L if any) */
00957 } ULIST_INSERT;
00958
00959 typedef int (*UListSorter)(UWidget *wid, void *data1, void *data2);
00960
00961 typedef struct
00962 {
00963     int row, col;               /* the coordinates of the entry */
00964     const char *title;          /* the title of the entry (0L if any) */
00965     void *data;                 /* the user data */
00966 } ULIST_INFO;
00967
00968 #ifdef __cplusplus
00969 extern "C" {
00970 #endif
00971
00972 UEXPORT int UEventSendMessage(int wid, int/*UEventType*/ evt, int arg1, void *arg2);
00973     /* send a message to a pseudo-widget */
00974
00975 UEXPORT int UEventSendMessageExt(int wid, int/*UEventType*/ evt, int arg1, void *arg2, int * handledFlag);
00976     /* send a message to a pseudo-widget and tells if the message was handled */
00977
00978 UEXPORT int UEventPostMessage(int wid, int/*UEventType*/ evt, int arg1, void *arg2);
00979     /* post a message to a pseudo-widget (get executed later) */
00980
00981 UEXPORT int UEventNotifyMessage(int/*UEventType*/ evt, int arg1, void *arg2);
00982     /* send a message to all the current pseudo-widget */
00983
00984 UEXPORT int UEventGetWidID(void);
00985     /* create a new widget id */
00986
00987 UEXPORT void UEventRemoveWidID(int widid);
00988     /* remove the widget from the broadcast list */
00989
00990 UEXPORT void UEventSetTooltipHandler(void (*handler) (const char *));
00991     /* set the handler (usually a status bar) called when happens a tooltip call */
00992
00993 UEXPORT void UEventGiveTime(void);
00994     /* give some time to the event manager for handling internal timers */
00995
00996 UEXPORT long UTickCount(void);
00997     /* in milliseconds */
00998
00999 #ifdef __cplusplus
01000 }
01001 #endif
01002
01003 #ifdef __cplusplus
01004 #   include <map>
01005
01006     UEXPORT UCmdTarget *UEventQueryWidget(int widid);
01007         /* search for a widget (0L if failed) */
01008
01009     UEXPORT const STD map<int, UCmdTarget *> & UEventGetTargets(void);
01010         /* return the list of the current pseudo targets */
01011
01012 #   ifdef WIN32
01013         // XPM wrappers
01014         UEXPORT HBITMAP UMakeBitmap(const char *icon);
01015         UEXPORT HBITMAP UMakeBitmap(char **icon);
01016         UEXPORT HBITMAP UMakeBitmap(char **icon, int & width, int & height, COLORREF back);
01017 #   else /* !WIN32 */
01018 #       define UMakeBitmap(b) 0L
01019 #   endif /* !WIN32 */
01020 #endif
01021
01022 #endif /* UEVENT_H */
Generated on Sun Feb 24 01:21:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/umenu.cpp Source File

rf/umenu.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- May 1999
00019  */
00020
00021 #include "stdafx.h"
00022
00023 #ifdef HAVE_CONFIG_H
00024 #include "config.h"
00025 #endif
00026
00027 #include <stdlib.h>
00028 #include <stdio.h>
00029 #include <math.h>
00030 #include <string.h>
00031 #include <float.h>
00032 #include <vector>
00033 #include <map>
00034
00035 #ifdef HAVE_MALLOC_H
00036 #include <malloc.h>
00037 #endif
00038
00039 #ifdef HAVE_UNISTD_H
00040 #include <unistd.h>
00041 #endif
00042
00043 #include "umenu.h"
00044 #include "uconsole.h"
00045
00046 #ifdef WIN32
00047 #include "dib.h"
00048 #endif
00049
00050 #ifdef qMacAPP
00051 #include "UMenuMgr.h"
00052 #include "UDispatcher.h"
00053 #endif
00054
00055 #if qMacPP
00056 #include <UConditionalMenus.h>
00057 #include <UAppearanceMenus.h>
00058 #endif
00059
00060 #ifdef qGTK
00061 extern "C"
00062 {
00063     // from glade's support.h
00064     GtkWidget *create_pixmap(GtkWidget *widget, const gchar *filename);
00065 }
00066 #endif
00067
00068 #if defined(_DEBUG) && defined(WIN32)
00069 #   define new DEBUG_NEW
00070 #   undef THIS_FILE
00071     static char THIS_FILE[] = __FILE__;
00072 #endif
00073
00074 UIMPLEMENT_DYNAMIC(UMenu, UWidget)
00075
00076 UBEGIN_MESSAGE_MAP(UMenu, UWidget)
00077     ON_UPDATEUI(UMenu)
00078     ON_UCOMMAND_RANGE(0, 0xFFFF, UMenu::OnCommands)
00079 UEND_MESSAGE_MAP()
00080
00081 UMenu::UMenu(int widid) : UWidget(widid)
00082 #if qGTK
00083     , fAccelGroup(0L)
00084 #endif
00085 {
00086 #if qGTK
00087     fAccelGroup = gtk_accel_group_new ();
00088 #endif
00089 }
00090
00091 UMenu::~UMenu()
00092 {
00093 }
00094
00095 #ifdef WIN32
00096 // create a HBITMAP from a pixmap
00097 HBITMAP UMakeBitmap(char **icon, int & width, int & height, COLORREF back)
00098 {
00099     BYTE **src = (BYTE **)icon;
00100
00101     // read the header
00102     int w, h, nc, cpp, i, x, y;
00103     if(sscanf((char *)*src++, "%d%d%d%d", &w, &h, &nc, &cpp) != 4)
00104         return 0L;
00105
00106     width = w;
00107     height = h;
00108
00109     HBITMAP hbitmap = CreateDIB(w, h, 8, 0L);
00110     LPBITMAPINFO header = (LPBITMAPINFO)GlobalLock(hbitmap);
00111     BYTE *image = (LPBYTE)header + header->bmiHeader.biSize + PaletteSize(header);
00112     RGBQUAD *pRgb = (RGBQUAD *)((LPBYTE)header + header->bmiHeader.biSize);
00113
00114     // read the colormap
00115     std::map<short, BYTE> colors;
00116     for(i = 0; i < nc; i++)
00117     {
00118         const BYTE *line = *src++;
00119         short aref;
00120         if(cpp == 1)
00121         {
00122             aref = line[0];
00123             line += 4;
00124         }
00125         else if(cpp == 2)
00126         {
00127             aref = ((short)line[1] << 8)  | line[0];
00128             line += 5;
00129         }
00130         else
00131             ASSERT(0);
00132
00133         COLORREF color;
00134
00135         if(strcmp((char *)line, "None") == 0)
00136         {
00137             color = back;
00138         }
00139         else
00140         {
00141             if(*line++ != '#')
00142                 return 0L;
00143
00144             if(strlen((char *)line) < 6)
00145                 return 0L;
00146
00147             int comp[6], c;
00148             int j;
00149             for(j = 0; j < 6; j++)
00150             {
00151                 c = *line++;
00152                 if(c >= '0' && c <= '9')
00153                     comp[j] = c - '0';
00154                 else if(c >= 'a' && c <= 'f')
00155                     comp[j] = c - 'a' + 10;
00156                 else if(c >= 'A' && c <= 'F')
00157                     comp[j] = c - 'A' + 10;
00158                 else
00159                     return 0L;
00160             }
00161
00162             color = RGB(comp[0]*16+comp[1],comp[2]*16+comp[3],comp[4]*16+comp[5]);
00163         }
00164
00165         colors.insert(std::make_pair(aref, i));
00166
00167         pRgb->rgbRed = GetRValue(color);
00168         pRgb->rgbGreen = GetGValue(color);
00169         pRgb->rgbBlue = GetBValue(color);
00170         pRgb->rgbReserved = 0;
00171         pRgb++;
00172     }
00173
00174     if(nc != colors.size() || nc > 256)
00175         return 0L;
00176
00177     // make the bitmap
00178     for(y = 0; y < h; y++)
00179     {
00180         const BYTE *line = *src++;
00181         BYTE *ptr = image + WIDTHBYTES(w * 8) * (h - y - 1);
00182         for(x = 0; x < w; x++)
00183         {
00184             short aref;
00185             if(cpp == 1)
00186             {
00187                 aref = line[0];
00188                 line++;
00189             }
00190             else if(cpp == 2)
00191             {
00192                 aref = ((short)line[1] << 8)  | line[0];
00193                 line += 2;
00194             }
00195             std::map<short, BYTE>::iterator pos = colors.find(aref);
00196             if(pos == colors.end())
00197                 return 0L;
00198             *ptr++ = (*pos).second;
00199         }
00200     }
00201
00202     GlobalUnlock(hbitmap);
00203
00204     HBITMAP ddbbmap = DIBToBitmap(hbitmap);
00205     GlobalFree((HGLOBAL)hbitmap);
00206
00207     return ddbbmap;
00208 }
00209
00210 HBITMAP UMakeBitmap(char **icon)
00211 {
00212     int w, h;
00213     return UMakeBitmap(icon, w, h, ::GetSysColor(COLOR_BTNFACE));
00214 }
00215
00216 UEXPORT HBITMAP UMakeBitmap(const char *icon)
00217 {
00218     std::vector<UStr> icstr;
00219     const char *tmp;
00220     while((tmp = strchr(icon, '\n')) != 0L)
00221     {
00222         UStr str;
00223         str.set(icon, tmp - icon);
00224         icon = tmp + 1;
00225         icstr.push_back(str);
00226     }
00227     if(icon[0] != '\0')
00228     {
00229         icstr.push_back(UStr(icon));
00230     }
00231
00232     std::vector<UStr>::const_iterator i;
00233     std::vector<const char *> ic;
00234     for(i = icstr.begin(); i != icstr.end(); ++i)
00235     {
00236         ic.push_back((*i).c_str());
00237     }
00238     return UMakeBitmap((char **)&ic[0]);
00239 }
00240 #endif
00241
00242 #define CTRLALT_STROKE "Ctrl+Alt+"
00243 #define CTRL_STROKE "Ctrl+"
00244 #define ALT_STROKE "Alt+"
00245
00246 static void GetMenuTitle(const char *name, UStr & title, int cmd,
00247                          char & mnemonic, int & mod, int & key)
00248 {
00249     title = "";
00250     mod = 0;
00251     key = 0;
00252     mnemonic = '\0';
00253
00254     // get the accelerator
00255     UStr copy(name);
00256     char *tmp;
00257     if((tmp = strchr(copy, '\t')) != 0L)
00258     {
00259         *tmp++ = '\0';
00260         if(strncmp(tmp, CTRLALT_STROKE, strlen(CTRLALT_STROKE)) == 0)
00261         {
00262             mod = UK_CONTROL | UK_ALT;
00263             key = tmp[strlen(CTRLALT_STROKE)];
00264         }
00265         else if(strncmp(tmp, CTRL_STROKE, strlen(CTRL_STROKE)) == 0)
00266         {
00267             mod = UK_CONTROL;
00268             key = tmp[strlen(CTRL_STROKE)];
00269         }
00270         else if(strncmp(tmp, ALT_STROKE, strlen(ALT_STROKE)) == 0)
00271         {
00272             mod = UK_ALT;
00273             key = tmp[strlen(ALT_STROKE)];
00274         }
00275         name = copy;
00276     }
00277
00278     title = name;
00279 #ifndef WIN32
00280     if((tmp = strchr(title, '&')) != 0L)
00281     {
00282         size_t l = tmp - (const char *)title;
00283         memmove(&title[l], &title[l + 1], title.length() - l);
00284     }
00285 #endif
00286 }
00287
00288 UMENU UMenuAddPulldown(int widid, const char *name, UMENU top)
00289 {
00290     UStr title;
00291     int  mod, key;
00292     char mnemonic;
00293     GetMenuTitle(name, title, 0, mnemonic, mod, key);
00294
00295 #ifdef qMacAPP
00296     return UMENU_NULL;
00297 #endif
00298 #ifdef qMacPP
00299     if(top == UMENU_NULL)
00300     {
00301         Assert_(0); // TODO
00302     }
00303     else
00304     {
00305         LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00306         LMenu *menu = menuBar->FetchMenu(top);
00307         if(menu == 0L)
00308             return UMENU_NULL;
00309
00310         LStr255 pstr(name);
00311         LMenu *newMenu = new LMenu(::UniqueID('MENU'), pstr);
00312         menuBar->InstallMenu(newMenu, hierMenu);
00313
00314         menu->InsertCommand(pstr, cmd_UseMenuItem, max_Int16 - 1);
00315 #if TARGET_API_MAC_CARBON
00316         UAppearanceMenus::SetItemHierID(menu->GetMacMenuH(), ::CountMenuItems(menu->GetMacMenuH()),
00317             newMenu->GetMenuID());
00318 #else
00319         UConditionalMenus::SetItemHierID(menu->GetMacMenuH(), ::CountMenuItems(menu->GetMacMenuH()),
00320             newMenu->GetMenuID());
00321 #endif
00322         return newMenu->GetMenuID();
00323     }
00324     return UMENU_NULL;
00325 #endif
00326 #ifdef qGTK
00327     GtkWidget *parent = 0L;
00328
00329     if(top == UMENU_NULL)
00330     {
00331         // try to find the menubar : the menu bar should be mapped
00332         // to a UMenu object as the main widget
00333         const UCmdTarget *target = UEventQueryWidget(widid);
00334         UMenu *menu = 0L;
00335         if(target == 0L || !target->IsKindOf(URUNTIME_CLASS(UMenu)))
00336             return UMENU_NULL;
00337
00338         menu = (UMenu *)target;
00339         if(menu == 0L)
00340             return UMENU_NULL;
00341
00342         GtkWidget *wid = (GtkWidget *)menu->GetWidget(kUMainWidget);
00343         if(wid == 0L || !GTK_IS_MENU_SHELL(wid))
00344             return UMENU_NULL;
00345
00346         parent = wid;
00347     }
00348     else
00349     {
00350         if(!GTK_IS_MENU_SHELL(top))
00351             return UMENU_NULL;
00352         parent = (GtkWidget *)top;
00353     }
00354
00355     GtkWidget *menuitem = gtk_menu_item_new_with_label(title);
00356     gtk_widget_show(menuitem);
00357     gtk_container_add(GTK_CONTAINER (parent), menuitem);
00358
00359     GtkWidget *menu = gtk_menu_new();
00360     gtk_menu_item_set_submenu(GTK_MENU_ITEM (menuitem), menu);
00361     /*GtkAccelGroup *accel_group = */gtk_menu_ensure_uline_accel_group (GTK_MENU (menu));
00362
00363     return (UMENU)menu;
00364 #endif
00365 #ifdef WIN32
00366     if(top == UMENU_NULL)
00367     {
00368         CMenu* pTopMenu = AfxGetMainWnd()->GetMenu();
00369         CMenu menu;
00370         menu.CreatePopupMenu();
00371         pTopMenu->AppendMenu(MF_POPUP, (UINT)menu.GetSafeHmenu(), name);
00372
00373         static bool firsttime = true;
00374         if(firsttime)
00375         {
00376             pTopMenu->DeleteMenu(0, MF_BYPOSITION);
00377             firsttime = false;
00378         }
00379         return (UMENU)menu.Detach();
00380     }
00381     else
00382     {
00383         HMENU menuhdl = (HMENU)top;
00384         CMenu parent;
00385         CMenu menu;
00386         menu.CreatePopupMenu();
00387         VERIFY(parent.Attach(menuhdl));
00388         parent.AppendMenu(MF_POPUP, (UINT)menu.GetSafeHmenu(), name);
00389         parent.Detach();
00390         return (UMENU)menu.Detach();
00391     }
00392 #endif
00393 }
00394
00395 #ifdef WIN32
00396 static void addAccel(int cmd, int mod, int key)
00397 {
00398     if(key == 0)
00399         return;
00400
00401     // Save the current accelerator table.
00402     CWnd *wnd = AfxGetMainWnd();
00403     CFrameWnd *frame = 0L;
00404     if(wnd->IsKindOf(RUNTIME_CLASS(CFrameWnd)))
00405         frame = (CFrameWnd *)wnd;
00406     else
00407         frame = wnd->GetParentFrame();
00408     if(frame == 0L)
00409         return;
00410
00411     HACCEL haccelOld = frame->m_hAccelTable;
00412
00413     // Count the number of entries in the current
00414     // table, allocate a buffer for the table, and
00415     // then copy the table into the buffer.
00416
00417     int cAccelerators = CopyAcceleratorTable(haccelOld, NULL, 0);
00418     LPACCEL lpaccelNew = (LPACCEL) LocalAlloc(LPTR, (cAccelerators + 1) * sizeof(ACCEL));
00419     if (lpaccelNew == NULL)
00420         return;
00421
00422     CopyAcceleratorTable(haccelOld, lpaccelNew, cAccelerators);
00423
00424     // Find the accelerator that the user modified
00425     // and change its flags and virtual-key code
00426     // as appropriate.
00427
00428     for (int i = 0; i < cAccelerators; i++)
00429     {
00430         if(lpaccelNew[i].cmd == cmd)
00431         {
00432             lpaccelNew[i].fVirt = FVIRTKEY;
00433             if(mod & UK_ALT)
00434                 lpaccelNew[i].fVirt |= FALT;
00435             if(mod & UK_CONTROL)
00436                 lpaccelNew[i].fVirt |= FCONTROL;
00437             lpaccelNew[i].key = key;
00438             break;
00439         }
00440     }
00441
00442     if(i == cAccelerators)
00443     {
00444         lpaccelNew[i].cmd = cmd;
00445         lpaccelNew[i].fVirt = FVIRTKEY;
00446         if(mod & UK_ALT)
00447             lpaccelNew[i].fVirt |= FALT;
00448         if(mod & UK_CONTROL)
00449             lpaccelNew[i].fVirt |= FCONTROL;
00450         lpaccelNew[i].key = key;
00451         cAccelerators++;
00452     }
00453
00454     // Create the new accelerator table, and
00455     // destroy the old one.
00456     DestroyAcceleratorTable(haccelOld);
00457     frame->m_hAccelTable = CreateAcceleratorTable(lpaccelNew, cAccelerators);
00458     LocalFree(lpaccelNew);
00459 }
00460 #endif
00461
00462 #ifdef qGTK
00463 static void addToAccelGroup(GtkAccelGroup *accelGroup, GtkWidget *menuitem, int mod, int key)
00464 {
00465     if(key == 0 || accelGroup == 0L)
00466         return;
00467
00468     int gdkmod = 0;
00469     if(mod & UK_CONTROL)
00470         gdkmod |= GDK_CONTROL_MASK;
00471     if(mod & UK_ALT)
00472         gdkmod |= GDK_MOD1_MASK;
00473
00474     gtk_widget_add_accelerator (menuitem, "activate",
00475                                 accelGroup, key, gdkmod, GTK_ACCEL_VISIBLE);
00476 }
00477
00478 static GtkWidget* gtk_menu_item_new_with_label_pixmap(const gchar *label, const void *pixmap)
00479 {
00480 // FIX ME !
00481 #if 1
00482     return gtk_menu_item_new_with_label(label);
00483 #else
00484     if(pixmap == 0L)
00485         return gtk_menu_item_new_with_label(label);
00486
00487     GtkWidget *menu_item = gtk_menu_item_new ();
00488
00489     GtkPixmap *gtkpix = GTK_PIXMAP(create_pixmap(menu_item, (const gchar *)pixmap));
00490     gtk_misc_set_alignment (GTK_MISC (gtkpix), 0.0, 0.5);
00491     gtk_container_add (GTK_CONTAINER (menu_item), GTK_WIDGET(gtkpix));
00492     gtk_widget_show (GTK_WIDGET(gtkpix));
00493
00494     GtkWidget *accel_label = gtk_accel_label_new (label);
00495     gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
00496
00497     gtk_container_add (GTK_CONTAINER (menu_item), accel_label);
00498     gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label), menu_item);
00499     gtk_widget_show (accel_label);
00500
00501     return menu_item;
00502 #endif
00503 }
00504 #endif // qGTK
00505
00506 void UMenuDelete(UMENU top, int afterIndex)
00507 {
00508     UASSERT(top != UMENU_NULL);
00509
00510 #ifdef qMacAPP
00511     MenuRef menu = MAGetMenu(top);
00512     if(menu)
00513     {
00514         short numItems = ::CountMenuItems(menu);
00515         afterIndex++;
00516         while (numItems >= afterIndex)
00517         {
00518             ::DeleteMenuItem(menu, numItems);
00519             --numItems;
00520         }
00521     }
00522 #endif
00523 #ifdef qMacPP
00524     LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00525     LMenu *menu = menuBar->FetchMenu(top);
00526     if(menu)
00527     {
00528         short numItems = ::CountMenuItems(menu->GetMacMenuH());
00529         afterIndex++;
00530         while (numItems >= afterIndex)
00531         {
00532             menu->RemoveItem(numItems);
00533             --numItems;
00534         }
00535     }
00536     else
00537     {
00538         MenuHandle mhdl = ::GetMenu(top);
00539         if(mhdl != 0L)
00540         {
00541             short numItems = ::CountMenuItems(mhdl);
00542             afterIndex++;
00543             while (numItems >= afterIndex)
00544             {
00545                 ::DeleteMenuItem(mhdl, numItems);
00546                 --numItems;
00547             }
00548         }
00549     }
00550 #endif
00551 #ifdef WIN32
00552     CMenu parent;
00553     HMENU menuhdl = (HMENU)top;
00554     VERIFY(parent.Attach(menuhdl));
00555
00556     int numItems = (int)parent.GetMenuItemCount() - 1;
00557     while (numItems >= afterIndex)
00558     {
00559         VERIFY(parent.DeleteMenu(numItems, MF_BYPOSITION));
00560         --numItems;
00561     }
00562     parent.Detach();
00563 #endif
00564 }
00565
00566 int UMenuCount(UMENU top)
00567 {
00568     UASSERT(top != UMENU_NULL);
00569
00570 #ifdef qMacAPP
00571     MenuRef menu = MAGetMenu(top);
00572     if(menu)
00573     {
00574         return ::CountMenuItems(menu);
00575     }
00576 #endif
00577 #ifdef qMacPP
00578     LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00579     LMenu *menu = menuBar->FetchMenu(top);
00580     if(menu)
00581     {
00582         return ::CountMenuItems(menu->GetMacMenuH());
00583     }
00584     else
00585     {
00586         MenuHandle mhdl = ::GetMenu(top);
00587         if(mhdl != 0L)
00588         {
00589             return ::CountMenuItems(mhdl);
00590         }
00591     }
00592 #endif
00593 #ifdef WIN32
00594     CMenu parent;
00595     HMENU menuhdl = (HMENU)top;
00596     VERIFY(parent.Attach(menuhdl));
00597
00598     UINT numItems = parent.GetMenuItemCount();
00599     parent.Detach();
00600
00601     return numItems;
00602 #endif
00603
00604     return 0;
00605 }
00606
00607 void UMenuDeleteByCmd(UMENU top, int cmd)
00608 {
00609     UASSERT(top != UMENU_NULL);
00610
00611 #ifdef qMacAPP
00612     MenuID menuNo;
00613     short itemNo;
00614     MenuRef menu = CommandToComponents(cmd, menuNo, itemNo);
00615     if(menu)
00616     {
00617         ::DeleteMenuItem(menu, itemNo);
00618     }
00619 #endif
00620 #ifdef qMacPP
00621     LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00622     LMenu *menu = menuBar->FetchMenu(top);
00623     if(menu)
00624     {
00625         menu->RemoveCommand(cmd);
00626     }
00627 #endif
00628 #ifdef WIN32
00629     CMenu parent;
00630     HMENU menuhdl = (HMENU)top;
00631     VERIFY(parent.Attach(menuhdl));
00632
00633     VERIFY(parent.DeleteMenu(cmd, MF_BYCOMMAND));
00634
00635     parent.Detach();
00636 #endif
00637 }
00638
00639 UMENU UMenuAddButton(int widid, const char *name, UMENU top, const void *pixmap, int cmd)
00640 {
00641     UStr title;
00642     int  mod, key;
00643     char mnemonic;
00644     GetMenuTitle(name, title, cmd, mnemonic, mod, key);
00645
00646     UASSERT(top != UMENU_NULL);
00647
00648 #ifdef qMacPP
00649     LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00650     LMenu *menu = menuBar->FetchMenu(top);
00651     if(menu)
00652     {
00653         LStr255 pstr(title);
00654         menu->InsertCommand(pstr, cmd, max_Int16 - 1);
00655     }
00656     else
00657     {
00658         MenuHandle mhdl = ::GetMenu(top);
00659         if(mhdl != 0L)
00660         {
00661             SInt16  menuLength = ::CountMenuItems(mhdl);
00662             LStr255 pstr(title);
00663             ::MacInsertMenuItem(mhdl, pstr, menuLength);
00664         }
00665     }
00666
00667     return UMENU_NULL;
00668 #endif
00669 #ifdef qMacAPP
00670     MenuRef menu = MAGetMenu(top);
00671     if(menu)
00672     {
00673         CStr255_AC pstr(title);
00674         gDispatcher->DoMakeMenuBarManager();
00675         TMenuBarManager::fgMenuBarManager->AddMenuItem(pstr, top, ::CountMenuItems(menu), cmd);
00676     }
00677
00678     return UMENU_NULL;
00679 #endif
00680 #ifdef qGTK
00681     UCmdTarget *target = UEventQueryWidget(widid);
00682     if(target == 0L || !target->IsKindOf(URUNTIME_CLASS(UMenu)))
00683         return UMENU_NULL;
00684     UMenu *pmenu = (UMenu *)target;
00685
00686     if(!GTK_IS_MENU_SHELL(top))
00687         return UMENU_NULL;
00688     GtkWidget *parent = (GtkWidget *)top;
00689
00690     GtkWidget *menuitem = gtk_menu_item_new_with_label_pixmap(title, pixmap);
00691     gtk_widget_show (menuitem);
00692     gtk_container_add (GTK_CONTAINER (parent), menuitem);
00693     addToAccelGroup((GtkAccelGroup *)pmenu->GetAccelGroup(), menuitem, mod, key);
00694 //      gtk_tooltips_set_tip (tooltips, quit1, "Quit the application", NULL);
00695     UEventSendMessage(widid, EV_INIT_WIDGET, cmd, menuitem);
00696
00697     return UMENU_NULL;
00698 #endif
00699 #ifdef WIN32
00700     HMENU menuhdl = (HMENU)top;
00701     CMenu parent;
00702     VERIFY(parent.Attach(menuhdl));
00703
00704     parent.AppendMenu(MF_STRING, UCMD_to_WINCMD(cmd), name);
00705     addAccel(UCMD_to_WINCMD(cmd), mod, key);
00706
00707     if(pixmap != 0L && strlen((const char *)pixmap))
00708     {
00709         HBITMAP bmap = UMakeBitmap((const char *)pixmap);
00710         CBitmap b;
00711         VERIFY(b.Attach(bmap));
00712         parent.SetMenuItemBitmaps(UCMD_to_WINCMD(cmd), MF_BYCOMMAND, &b, &b);
00713         b.Detach();
00714     }
00715
00716     parent.Detach();
00717     return UMENU_NULL;
00718 #endif
00719 }
00720
00721 UMENU UMenuAddToggle(int widid, const char *name, UMENU top, const void *pixmap, int cmd)
00722 {
00723     UStr title;
00724     int  mod, key;
00725     char mnemonic;
00726     GetMenuTitle(name, title, cmd, mnemonic, mod, key);
00727
00728 #ifdef qMacPP
00729     LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00730     LMenu *menu = menuBar->FetchMenu(top);
00731     if(menu)
00732     {
00733         LStr255 pstr(title);
00734         menu->InsertCommand(pstr, cmd, max_Int16 - 1);
00735     }
00736     else
00737     {
00738         MenuHandle mhdl = ::GetMenu(top);
00739         if(mhdl != 0L)
00740         {
00741             SInt16  menuLength = ::CountMenuItems(mhdl);
00742             LStr255 pstr(title);
00743             ::MacInsertMenuItem(mhdl, pstr, menuLength);
00744         }
00745     }
00746
00747     return UMENU_NULL;
00748 #endif
00749 #ifdef qMacAPP
00750     MenuRef menu = MAGetMenu(top);
00751     if(menu)
00752     {
00753         CStr255_AC pstr(title);
00754         gDispatcher->DoMakeMenuBarManager();
00755         TMenuBarManager::fgMenuBarManager->AddMenuItem(pstr, top, ::CountMenuItems(menu), cmd);
00756     }
00757
00758     return UMENU_NULL;
00759 #endif
00760 #ifdef qGTK
00761     UCmdTarget *target = UEventQueryWidget(widid);
00762     if(target == 0L || !target->IsKindOf(URUNTIME_CLASS(UMenu)))
00763         return UMENU_NULL;
00764     UMenu *pmenu = (UMenu *)target;
00765
00766     if(!GTK_IS_MENU_SHELL(top))
00767         return UMENU_NULL;
00768     GtkWidget *parent = (GtkWidget *)top;
00769
00770     GtkWidget *menuitem = gtk_check_menu_item_new_with_label(title);
00771     gtk_widget_show(menuitem);
00772     gtk_container_add(GTK_CONTAINER (parent), menuitem);
00773     addToAccelGroup((GtkAccelGroup *)pmenu->GetAccelGroup(), menuitem, mod, key);
00774 //      gtk_tooltips_set_tip (tooltips, quit1, "Quit the application", NULL);
00775     UEventSendMessage(widid, EV_INIT_WIDGET, cmd, menuitem);
00776
00777     return UMENU_NULL;
00778 #endif
00779 #ifdef WIN32
00780     ASSERT(top != UMENU_NULL);
00781
00782     HMENU menuhdl = (HMENU)top;
00783     CMenu parent;
00784     VERIFY(parent.Attach(menuhdl));
00785
00786     parent.AppendMenu(MF_STRING, UCMD_to_WINCMD(cmd), name);
00787     addAccel(UCMD_to_WINCMD(cmd), mod, key);
00788
00789     if(pixmap != 0L && strlen((const char *)pixmap))
00790     {
00791         HBITMAP bmap = UMakeBitmap((const char *)pixmap);
00792         CBitmap b;
00793         VERIFY(b.Attach(bmap));
00794         parent.SetMenuItemBitmaps(UCMD_to_WINCMD(cmd), MF_BYCOMMAND, &b, &b);
00795         b.Detach();
00796     }
00797
00798     parent.Detach();
00799     return UMENU_NULL;
00800 #endif
00801 }
00802
00803 UMENU UMenuAddSeparator(int widid, UMENU top)
00804 {
00805     UASSERT(top != UMENU_NULL);
00806
00807 #ifdef qMacPP
00808     LMenuBar *menuBar = LMenuBar::GetCurrentMenuBar();
00809     LMenu *menu = menuBar->FetchMenu(top);
00810     if(menu)
00811     {
00812         menu->InsertCommand("\p-", 0, max_Int16 - 1);
00813     }
00814     else
00815     {
00816         MenuHandle mhdl = ::GetMenu(top);
00817         if(mhdl != 0L)
00818         {
00819             SInt16  menuLength = ::CountMenuItems(mhdl);
00820             ::MacInsertMenuItem(mhdl, "\p-", menuLength);
00821         }
00822     }
00823
00824     return UMENU_NULL;
00825 #endif
00826 #ifdef qMacAPP
00827     MenuRef menu = MAGetMenu(top);
00828     if(menu)
00829     {
00830         CStr255_AC pstr("-");
00831         gDispatcher->DoMakeMenuBarManager();
00832         TMenuBarManager::fgMenuBarManager->AddMenuItem(pstr, top, ::CountMenuItems(menu), 0);
00833     }
00834
00835     return UMENU_NULL;
00836 #endif
00837 #ifdef qGTK
00838     if(!GTK_IS_MENU_SHELL(top))
00839         return UMENU_NULL;
00840     GtkWidget *parent = (GtkWidget *)top;
00841
00842     GtkWidget *menuitem = gtk_menu_item_new();
00843     gtk_widget_show(menuitem);
00844     gtk_container_add(GTK_CONTAINER (parent), menuitem);
00845     gtk_widget_set_sensitive(menuitem, FALSE);
00846     return UMENU_NULL;
00847 #endif
00848 #ifdef WIN32
00849     HMENU menuhdl = (HMENU)top;
00850     CMenu parent;
00851     VERIFY(parent.Attach(menuhdl));
00852     parent.AppendMenu(MF_SEPARATOR);
00853     parent.Detach();
00854     return UMENU_NULL;
00855 #endif
00856 }
00857
00858 void UMenu::OnUpdateUI()
00859 {
00860     // for WIN32, the UpdateUI on the menus is better handled by MFC
00861 #ifndef WIN32
00862     static bool sSemaphore = false;
00863     USemaphore policeman(sSemaphore);
00864     if(policeman.IsEnteredTwice())
00865         return;
00866
00867     // this is the interesting thing about the toolbar : it resends the
00868     // update UI to other widgets according to the focus information and
00869     // allows the update to be handled several times if the handler asks for it
00870     // (by using UCmdUI::SetContinue)
00871
00872     const STD map<int, UCmdTarget *> & targets = UEventGetTargets();
00873     std::map<int, void *>::iterator w;
00874     int cmdid;
00875
00876     for(w = m_widgets.begin(); w != m_widgets.end(); ++w)
00877     {
00878         void *widget = (*w).second;
00879         cmdid = (*w).first;
00880
00881         if(cmdid == kUMainWidget)
00882             continue;
00883
00884 #if qGTK
00885         if(!GTK_IS_MENU_ITEM(widget))
00886             continue;
00887 #endif
00888
00889         // first forward the command to the focused widget : if it doesn't want it
00890         // we give it to the next pseudo widget.
00891         if(sFocusWidID != -1 && sFocusWidID != GetWidID())
00892         {
00893             UCmdUI pUI(cmdid);
00894             pUI.m_widget = widget;
00895             UEventSendMessage(sFocusWidID, EV_UPDTCMD, pUI.m_nID, &pUI);
00896             if(!pUI.CanContinue())
00897                 continue;
00898         }
00899
00900         STD map<int, UCmdTarget *>::const_iterator i;
00901         for(i = targets.begin(); i != targets.end(); ++i)
00902         {
00903             int widid = (*i).first;
00904             if(widid == sFocusWidID || widid == GetWidID())
00905                 continue;
00906
00907             UCmdUI pUI(cmdid);
00908             pUI.m_widget = widget;
00909             UEventSendMessage(widid, EV_UPDTCMD, pUI.m_nID, &pUI);
00910             if(!pUI.CanContinue())
00911                 break;
00912         }
00913         if(i == targets.end())
00914         {
00915             //UAppConsole("The cmd %d of the menubar has no update handler, it's gonna be disabled\n", cmdid);
00916             UCmdUI pUI(cmdid);
00917             pUI.m_widget = widget;
00918             pUI.Enable(false);
00919         }
00920     }
00921 #endif
00922 }
00923
00924 int UMenu::OnCommands(int cmd)
00925 {
00926     static bool sSemaphore = false;
00927     USemaphore policeman(sSemaphore);
00928     if(policeman.IsEnteredTwice())
00929         return 1;
00930
00931     // this is the interesting thing about the toolbar : it resends the
00932     // commands to other widgets according to the focus information and
00933     // allows the command to be handled several times if the handler return 1
00934
00935     const STD map<int, UCmdTarget *> & targets = UEventGetTargets();
00936     int res = 0;
00937     int handledFlag;
00938
00939     // first forward the command to the focused widget : if it doesn't want it
00940     // we give it to the next pseudo widget.
00941     if(sFocusWidID != -1 && sFocusWidID != GetWidID())
00942     {
00943         res = UEventSendMessageExt(sFocusWidID, EV_CMD, cmd, 0L, &handledFlag);
00944         if(res == 0 && handledFlag)
00945             return 0;
00946     }
00947
00948     STD map<int, UCmdTarget *>::const_iterator i;
00949     for(i = targets.begin(); i != targets.end(); ++i)
00950     {
00951         int widid = (*i).first;
00952         if(widid == sFocusWidID || widid == GetWidID())
00953             continue;
00954         res = UEventSendMessageExt(widid, EV_CMD, cmd, 0L, &handledFlag);
00955         if(res == 0 && handledFlag)
00956             return 0;
00957     }
00958
00959     //UAppConsole("The cmd %d of the menubar has no command handler\n", cmd);
00960
00961     return 1;
00962 }
00963
Generated on Sun Feb 24 01:21:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/umenu.h Source File

rf/umenu.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- May 1999
00019  */
00020
00021 #ifndef UMENU_H
00022 #define UMENU_H
00023
00024 #include "uwidget.h"
00025
00026 #ifdef __cplusplus
00027
00028 class UMenu : public UWidget
00029 {
00030     UDECLARE_DYNAMIC(UMenu)
00031 public:
00032     UMenu(int widid);
00033     virtual ~UMenu();
00034
00035 #if qGTK
00036     inline void *GetAccelGroup(void) const { return fAccelGroup; }
00037         // maintain an accelerator group (GtkAccelGroup)
00038         // that you can add to your window.
00039 #endif
00040
00041 protected:
00042 #if qGTK
00043     void *fAccelGroup;
00044 #endif
00045
00046     ev_msg void OnUpdateUI(void);
00047     ev_msg int OnCommands(int cmd);
00048
00049     UDECLARE_MESSAGE_MAP()
00050 };
00051 #endif /* __cplusplus */
00052
00053 #ifdef __cplusplus
00054 extern "C" {
00055 #endif
00056
00057 UMENU UMenuAddPulldown(int widid, const char *name, UMENU top);
00058 UMENU UMenuAddToggle(int widid, const char *name, UMENU top, const void *pixmap, int cmd);
00059 UMENU UMenuAddButton(int widid, const char *name, UMENU top, const void *pixmap, int cmd);
00060 UMENU UMenuAddSeparator(int widid, UMENU top);
00061 void UMenuDelete(UMENU top, int afterIndex);
00062 void UMenuDeleteByCmd(UMENU top, int cmd);
00063 int UMenuCount(UMENU top);
00064
00065 #ifdef __cplusplus
00066 }
00067 #endif
00068
00069 #endif /* UMenu_H */
Generated on Sun Feb 24 01:21:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/uobject.cpp Source File

rf/uobject.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- May 1999
00019  */
00020
00021 #include "stdafx.h"
00022
00023 #ifdef HAVE_CONFIG_H
00024 #include "config.h"
00025 #endif
00026
00027 #include <string.h>
00028
00029 #include "uobject.h"
00030
00031 URuntimeClass *URuntimeClass::sAllURuntimeClass = 0L;
00032
00033 const URuntimeClass* UObject::_GetBaseClass()
00034     { return 0L; }
00035 const URuntimeClass UObject::classUObject(
00036     "UObject", sizeof(UObject), 0L, &UObject::_GetBaseClass);
00037 const URuntimeClass *UObject::rtUObject()
00038     { return &UObject::classUObject; }
00039
00040 UObject* UObject::CreateObject(const char *className)
00041 {
00042     URuntimeClass *next = URuntimeClass::sAllURuntimeClass;
00043     while(next != 0L)
00044     {
00045         if(strcmp(next->m_lpszClassName, className) == 0)
00046             return next->CreateObject();
00047
00048         next = next->m_pNextClass;
00049     }
00050     return 0L;
00051 }
00052
00053 const URuntimeClass* UObject::GetRuntimeClass() const
00054 {
00055     return URUNTIME_CLASS(UObject);
00056 }
00057
00058 bool UObject::IsKindOf(const URuntimeClass* pClass) const
00059 {
00060     // simple SI case
00061     const URuntimeClass* pClassThis = GetRuntimeClass();
00062     return pClassThis->IsDerivedFrom(pClass);
00063 }
00064
00065 URuntimeClass::URuntimeClass(const char *lpszClassName, int nObjectSize,
00066         UObject* (*pfnCreateObject)(), const URuntimeClass* (*pfnGetBaseClass)())
00067 {
00068     m_lpszClassName = lpszClassName;
00069     m_nObjectSize = nObjectSize;
00070     m_pfnCreateObject = pfnCreateObject;
00071     m_pfnGetBaseClass = pfnGetBaseClass;
00072     m_pNextClass = sAllURuntimeClass;
00073
00074     sAllURuntimeClass = this;
00075 }
00076
00077 URuntimeClass::~URuntimeClass()
00078 {
00079     URuntimeClass *next = sAllURuntimeClass;
00080     URuntimeClass *prev = 0L;
00081     while(next != 0L)
00082     {
00083         if(next == this)
00084         {
00085             if(prev == 0L)
00086                 sAllURuntimeClass = m_pNextClass;
00087             else
00088                 prev->m_pNextClass = m_pNextClass;
00089             break;
00090         }
00091
00092         prev = next;
00093         next = next->m_pNextClass;
00094     }
00095 }
00096
00097 UObject* URuntimeClass::CreateObject()
00098 {
00099     if (m_pfnCreateObject == 0L)
00100     {
00101         return 0L;
00102     }
00103
00104     UObject* pObject = 0L;
00105     try
00106     {
00107         pObject = (*m_pfnCreateObject)();
00108     }
00109     catch(...)
00110     {
00111     }
00112
00113     return pObject;
00114 }
00115
00116 bool URuntimeClass::IsDerivedFrom(const URuntimeClass* pBaseClass) const
00117 {
00118     // simple SI case
00119     const URuntimeClass* pClassThis = this;
00120     while (pClassThis != 0L)
00121     {
00122         if (pClassThis == pBaseClass)
00123             return true;
00124         pClassThis = (*pClassThis->m_pfnGetBaseClass)();
00125     }
00126     return false;       // walked to the top, no match
00127 }
Generated on Sun Feb 24 01:21:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/uobject.h Source File

rf/uobject.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- May 1999
00019  */
00020
00021 #ifndef UOBJECT_H
00022 #define UOBJECT_H
00023
00024 #include "uconfig.h"
00025
00026 #ifdef __cplusplus
00027
00028 class UObject;
00029
00030 class UEXPORT URuntimeClass
00031 {
00032 public:
00033     URuntimeClass(const char *lpszClassName, int nObjectSize,
00034         UObject* (*pfnCreateObject)(), const URuntimeClass* (*pfnGetBaseClass)());
00035     ~URuntimeClass();
00036
00037 // Attributes
00038     const char *m_lpszClassName;
00039     int m_nObjectSize;
00040     UObject* (* m_pfnCreateObject)(); // 0L => abstract class
00041     const URuntimeClass* (* m_pfnGetBaseClass)();
00042
00043 // Operations
00044     UObject* CreateObject();
00045     bool IsDerivedFrom(const URuntimeClass* pBaseClass) const;
00046
00047     // CRuntimeClass objects linked together in simple list
00048     URuntimeClass* m_pNextClass;       // linked list of registered classes
00049
00050     // linked list of all the registred runtime classes
00051     static URuntimeClass *sAllURuntimeClass;
00052 };
00053
00054 #define URUNTIME_CLASS(class_name) (class_name::rt##class_name())
00055
00056 #define UDECLARE_DYNAMIC(class_name) \
00057 protected: \
00058     static const URuntimeClass* _GetBaseClass(); \
00059     static const URuntimeClass class##class_name; \
00060 public: \
00061     static const URuntimeClass *rt##class_name(void); \
00062     virtual const URuntimeClass* GetRuntimeClass() const; \
00063
00064 // dynamically constructable
00065 #define UDECLARE_DYNCREATE(class_name) \
00066     UDECLARE_DYNAMIC(class_name) \
00067     static UObject* CreateObject(); \
00068
00069 #define UIMPLEMENT_RUNTIMECLASS(class_name, base_class_name, pfnNew) \
00070     const URuntimeClass *class_name::rt##class_name(void) \
00071         { return &class_name::class##class_name; } \
00072     const URuntimeClass* class_name::_GetBaseClass() \
00073         { return URUNTIME_CLASS(base_class_name); } \
00074     const URuntimeClass class_name::class##class_name( \
00075         #class_name, sizeof(class class_name), pfnNew, \
00076             &class_name::_GetBaseClass); \
00077     const URuntimeClass* class_name::GetRuntimeClass() const \
00078         { return URUNTIME_CLASS(class_name); } \
00079
00080 #define UIMPLEMENT_DYNAMIC(class_name, base_class_name) \
00081     UIMPLEMENT_RUNTIMECLASS(class_name, base_class_name, 0L)
00082
00083 #define UIMPLEMENT_DYNCREATE(class_name, base_class_name) \
00084     UObject* class_name::CreateObject() \
00085         { return new class_name; } \
00086     UIMPLEMENT_RUNTIMECLASS(class_name, base_class_name, \
00087         class_name::CreateObject)
00088
00089 class UEXPORT UObject
00090 {
00091 public:
00092     virtual const URuntimeClass* GetRuntimeClass() const;
00093     virtual ~UObject() {}
00094
00095     static const URuntimeClass *rtUObject();
00096     static const URuntimeClass* _GetBaseClass();
00097     static UObject* CreateObject(const char *className);
00098
00099     bool IsKindOf(const URuntimeClass* pClass) const;
00100 protected:
00101     static const URuntimeClass classUObject;
00102     UObject() {}
00103 };
00104
00105 #define UDYNAMIC_CAST(TYPE, EXPR) \
00106     ((TYPE *)((EXPR) == 0L ? 0L : ((EXPR)->IsKindOf(URUNTIME_CLASS(TYPE)) ? (TYPE *)EXPR : 0L)))
00107
00108 #endif /* __cplusplus */
00109
00110 #ifdef __cplusplus
00111 extern "C" {
00112 #endif
00113
00114 #ifdef __cplusplus
00115 }
00116 #endif
00117
00118 #endif /* UOBJECT_H */
Generated on Sun Feb 24 01:21:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/ustr.cpp Source File

rf/ustr.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- January 1997
00019  */
00020
00021 #include "stdafx.h"
00022
00023 #include <stdlib.h>
00024 #include <errno.h>
00025 #include <string.h>
00026 #include <stdio.h>
00027 #include <new>
00028
00029 #include "ustr.h"
00030 #include "uconsole.h"
00031
00032 #if qMacAPP
00033 #   include <Errors.h>
00034 #endif
00035
00036 #ifdef WIN32
00037 #   ifdef _DEBUG
00038 #   define new DEBUG_NEW
00039 #   undef THIS_FILE
00040     static char THIS_FILE[] = __FILE__;
00041 #   endif
00042 #endif /* WIN32 */
00043
00044 static const unsigned int kMaxChar = 255;
00045
00046 void UPStr::flush(void)
00047 {
00048     if(str == 0L)
00049         return;
00050     free(str);
00051     str = 0L;
00052 }
00053
00054 const char *UPStr::operator=(const char *newstr)
00055 {
00056     if(newstr == 0L)
00057         newstr = "";
00058
00059     size_t l = strlen(newstr);
00060     if(l > kMaxChar)
00061         l = kMaxChar;
00062
00063     char *newvalue = (char *)malloc((l + 2) * sizeof(char));
00064     if(newvalue == 0L)
00065         UTHROW(std::bad_alloc());
00066
00067     strncpy(newvalue + 1, newstr, l);
00068     newvalue[0] = l;
00069     newvalue[l + 1] = '\0';
00070
00071     flush();
00072     str = newvalue;
00073
00074     return *this;
00075 }
00076
00077 const unsigned char *UPStr::operator=(const unsigned char *newstr)
00078 {
00079     if(newstr == 0L)
00080         newstr = (unsigned char *)"";
00081
00082     int l = newstr[0];
00083     char *newvalue = (char *)malloc((l + 2) * sizeof(char));
00084     if(newvalue == 0L)
00085         UTHROW(std::bad_alloc());
00086
00087     memcpy(newvalue + 1, (char *)newstr + 1, l * sizeof(char));
00088     newvalue[0] = l;
00089     newvalue[l + 1] = '\0';
00090
00091     flush();
00092     str = newvalue;
00093
00094     return *this;
00095 }
00096
00097 const UPStr & UPStr::operator=(const UPStr & newstr)
00098 {
00099     *this = (const char *)newstr;
00100     return *this;
00101 }
00102
00103 const UPStr & UPStr::set(const char *buf, unsigned int len)
00104 {
00105     flush();
00106     if(len == 0)
00107     {
00108         *this = "";
00109         return *this;
00110     }
00111     if(len > kMaxChar)
00112         len = kMaxChar;
00113
00114     str = (char *)malloc((len + 2) * sizeof(char));
00115     if(str == 0L)
00116     {
00117         UAppConsole("Impossible to allocate %d bytes !\n", (len + 2) * sizeof(char));
00118         return *this;
00119     }
00120
00121     memcpy(str + 1, buf, len * sizeof(char));
00122     str[0] = len;
00123     str[len + 1] = '\0';
00124
00125     return *this;
00126 }
00127
00128 const UPStr & UPStr::replace(char which, char bywhich)
00129 {
00130     if(str == 0L)
00131         return *this;
00132
00133     char *buf = str + 1;
00134     while(*buf)
00135     {
00136         if(*buf == which)
00137             *buf++ = bywhich;
00138         else
00139             buf++;
00140     }
00141     return *this;
00142 }
00143
00144 UPStr & UPStr::operator<<(const char *addToStr)
00145 {
00146     if(addToStr == 0L)
00147         return *this;
00148
00149     if(str == 0L)
00150     {
00151         *this = addToStr;
00152         return *this;
00153     }
00154
00155     size_t len = strlen(addToStr);
00156     unsigned curlen = length();
00157     if(len + length() > kMaxChar)
00158         len = kMaxChar - length();
00159     if(len == 0)
00160         return *this;
00161
00162     str = (char *)realloc(str, (len + curlen + 2) * sizeof(char));
00163     memcpy(str + curlen + 1, addToStr, len * sizeof(char));
00164     str[0] = len + curlen;
00165     str[len + curlen + 1] = '\0';
00166
00167     return *this;
00168 }
00169
00170 UPStr & UPStr::operator<<(char addToStr)
00171 {
00172     char astr[2] = {'\0', '\0'};
00173     astr[0] = addToStr;
00174     return *this << astr;
00175 }
00176
00177 UPStr & UPStr::operator<<(int addToStr)
00178 {
00179     char astr[50];
00180     sprintf(astr, "%d", addToStr);
00181     return *this << astr;
00182 }
00183
00184 void UStr::flush(void)
00185 {
00186     if(str == 0L)
00187         return;
00188     free(str);
00189     str = 0L;
00190 }
00191
00192 const char *UStr::operator=(const char *newstr)
00193 {
00194     if(newstr == 0L)
00195         newstr = "";
00196
00197     int l = strlen(newstr);
00198     char *newvalue = (char *)malloc((l + 1) * sizeof(char));
00199     if(newvalue == 0L)
00200         UTHROW(std::bad_alloc());
00201
00202     strcpy(newvalue, newstr);
00203
00204     flush();
00205     str = newvalue;
00206
00207     return *this;
00208 }
00209
00210 const char *UStr::operator=(const unsigned char *newstr)
00211 {
00212     if(newstr == 0L)
00213         newstr = (unsigned char *)"";
00214
00215     int l = newstr[0];
00216     char *newvalue = (char *)malloc((l + 1) * sizeof(char));
00217     if(newvalue == 0L)
00218         UTHROW(std::bad_alloc());
00219
00220     memcpy(newvalue, newstr + 1, l * sizeof(char));
00221     newvalue[l] = '\0';
00222
00223     flush();
00224     str = newvalue;
00225
00226     return *this;
00227 }
00228
00229 const UStr & UStr::operator=(const UStr & newstr)
00230 {
00231     *this = (const char *)newstr;
00232     return *this;
00233 }
00234
00235 const UStr & UStr::set(const char *buf, unsigned int len)
00236 {
00237     flush();
00238     if(len == 0)
00239         return *this;
00240
00241     str = (char *)malloc((len + 1) * sizeof(char));
00242     if(str == 0L)
00243     {
00244         UAppConsole("Impossible to allocate %d bytes !\n", (len + 1) * sizeof(char));
00245         return *this;
00246     }
00247
00248     memcpy(str, buf, len * sizeof(char));
00249     str[len] = '\0';
00250
00251     return *this;
00252 }
00253
00254 const UStr & UStr::replace(char which, char bywhich)
00255 {
00256     if(str == 0L)
00257         return *this;
00258
00259     char *buf = str;
00260     while(*buf)
00261     {
00262         if(*buf == which)
00263             *buf++ = bywhich;
00264         else
00265             buf++;
00266     }
00267     return *this;
00268 }
00269
00270 UStr & UStr::operator<<(const char *addToStr)
00271 {
00272     if(addToStr == 0L)
00273         return *this;
00274
00275     if(str == 0L)
00276     {
00277         *this = addToStr;
00278         return *this;
00279     }
00280
00281     unsigned int len = strlen(addToStr);
00282     if(len == 0)
00283         return *this;
00284
00285     unsigned int curlen = length();
00286     char *newstr = (char *)malloc((len + curlen + 1) * sizeof(char));
00287     if(newstr == 0L)
00288         UTHROW(std::bad_alloc());
00289     memcpy(newstr, str, curlen * sizeof(char));
00290     memcpy(newstr + curlen, addToStr, len * sizeof(char));
00291     newstr[len + curlen] = '\0';
00292
00293     if(str != 0L)
00294         free(str);
00295     str = newstr;
00296
00297     return *this;
00298 }
00299
00300 UStr & UStr::operator<<(char addToStr)
00301 {
00302     char astr[2] = {'\0', '\0'};
00303     astr[0] = addToStr;
00304     return *this << astr;
00305 }
00306
00307 UStr & UStr::operator<<(int addToStr)
00308 {
00309     char astr[50];
00310     sprintf(astr, "%d", addToStr);
00311     return *this << astr;
00312 }
00313
00314 bool UStr::operator<(const UStr & str) const
00315 {
00316     return strcmp(*this, str) < 0;
00317 }
00318
00319 bool UStr::operator>(const UStr & str) const
00320 {
00321     return strcmp(*this, str) > 0;
00322 }
00323
00324 bool UStr::operator==(const UStr & str) const
00325 {
00326     return strcmp(*this, str) == 0;
00327 }
00328
00329 bool UStr::operator==(const char *str) const
00330 {
00331     return strcmp(*this, str) == 0;
00332 }
00333
00334 bool UStr::operator!=(const UStr & str) const
00335 {
00336     return strcmp(*this, str) != 0;
00337 }
00338
00339 bool UStr::operator!=(const char *str) const
00340 {
00341     return strcmp(*this, str) != 0;
00342 }
Generated on Sun Feb 24 01:21:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/ustr.h Source File

rf/ustr.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- May 1999
00019  */
00020
00021 #ifndef USTR_H
00022 #define USTR_H
00023
00024 #include "uconfig.h"
00025
00026 #ifdef __GNUC__
00027 #   define EGCS_CONST const
00028 #else
00029 #   define EGCS_CONST
00030 #endif
00031
00032 #include <string.h>
00033
00039 class UEXPORT UPStr
00040 {
00041 public :
00042     inline UPStr() : str(0L) {}
00043     inline UPStr(const char *newstr)
00044     {
00045         str = 0L;
00046         *this = newstr;
00047     }
00048     inline UPStr(const unsigned char *newstr)
00049     {
00050         str = 0L;
00051         *this = newstr;
00052     }
00053     inline UPStr(const UPStr & newstr)
00054     {
00055         str = 0L;
00056         *this = newstr;
00057     }
00058     virtual ~UPStr() {flush();}
00059
00060     inline bool empty(void) const {return str == 0L || str[0] == '\0';}
00061     inline unsigned int length(void) const {return str == 0L ? 0 : (unsigned char)str[0];}
00062
00064     const char *operator=(const char *newstr);
00066     const unsigned char *operator=(const unsigned char *newstr);
00068     const UPStr & operator=(const UPStr & newstr);
00070     const UPStr & set(const char *buf, unsigned int len);
00071
00073     inline operator const char *() const {return str == 0L ? "" : str + 1;}
00075     inline operator char *() EGCS_CONST {return str == 0L ? 0L : str + 1;}
00077     inline const char *c_str() const {return str == 0L ? "" : str + 1;}
00078
00080     inline operator const unsigned char *() const
00081         {return str == 0L ? (unsigned char *)"" : (unsigned char *)str;}
00083     inline operator unsigned char *() EGCS_CONST
00084         {return str == 0L ? (unsigned char *)"" : (unsigned char *)str;}
00086     inline const unsigned char *p_str() const
00087         {return str == 0L ? (unsigned char *)"" : (unsigned char *)str;}
00088
00090     UPStr & operator<<(const char *addToStr);
00092     UPStr & operator<<(char addToStr);
00094     UPStr & operator<<(int addToStr);
00095
00096     inline bool endsWith(char c) const {return str == 0L ? false : str[str[0]] == c;}
00097
00099     const UPStr & replace(char which, char bywhich);
00100
00101 protected :
00102     void flush(void);
00103
00105     char *str;
00106 };
00107
00113 class UEXPORT UStr
00114 {
00115 public :
00116     inline UStr() : str(0L) {}
00117     inline UStr(const char *newstr)
00118     {
00119         str = 0L;
00120         *this = newstr;
00121     }
00122     inline UStr(const unsigned char *newstr)
00123     {
00124         str = 0L;
00125         set((const char *)newstr + 1, newstr[0]);
00126     }
00127     inline UStr(const UStr & newstr)
00128     {
00129         str = 0L;
00130         *this = newstr;
00131     }
00132     virtual ~UStr() {flush();}
00133
00134     inline bool empty(void) const {return str == 0L || str[0] == '\0';}
00135     inline unsigned int length(void) const {return str == 0L ? 0 : strlen(str);}
00136
00138     const char *operator=(const char *newstr);
00140     const char *operator=(const unsigned char *newstr);
00142     const UStr & operator=(const UStr & newstr);
00144     const UStr & set(const char *buf, unsigned int len);
00145
00147     bool operator<(const UStr & str) const;
00149     bool operator>(const UStr & str) const;
00151     bool operator==(const UStr & str) const;
00153     bool operator==(const char *str) const;
00155     bool operator!=(const UStr & str) const;
00157     bool operator!=(const char *str) const;
00158
00159 #if (defined(__MWERKS__) && __MWERKS__ < 0x2400) || defined(__GNUC__)
00160     inline char operator[](int index) const { return str[index]; }
00161     inline char & operator[](int index) { return str[index]; }
00162 #endif /* macintosh */
00163
00165     inline operator const char *() const { return str == 0L ? "" : str; }
00167     inline operator char *() EGCS_CONST { return str == 0L ? 0L : str; }
00169     inline const char *c_str() const { return str == 0L ? "" : str; }
00170
00172     UStr & operator<<(const char *addToStr);
00174     UStr & operator<<(char addToStr);
00176     UStr & operator<<(int addToStr);
00177
00179     inline int compare(const char *thestr) const { return strcmp(*this, thestr); }
00180
00181     inline bool endsWith(char c) const {return !length() ? false : str[length()-1] == c;}
00182
00184     const UStr & replace(char which, char bywhich);
00185
00186 protected :
00187     void flush(void);
00189     char *str;
00190 };
00191
00192 #endif /* USTR_H */
Generated on Sun Feb 24 01:21:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/utoolbar.cpp Source File

rf/utoolbar.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- May 1999
00019  */
00020
00021 #include "stdafx.h"
00022
00023 #ifdef HAVE_CONFIG_H
00024 #include "config.h"
00025 #endif
00026
00027 #include <stdlib.h>
00028 #include <stdio.h>
00029 #include <math.h>
00030 #include <string.h>
00031 #include <float.h>
00032
00033 #ifdef HAVE_MALLOC_H
00034 #include <malloc.h>
00035 #endif
00036
00037 #include "utoolbar.h"
00038 #include "uconsole.h"
00039
00040 #include <vector>
00041 #include <map>
00042
00043 #if qGTK
00044     extern "C" GtkWidget* create_pixmap(GtkWidget *widget, const gchar *filename);
00045 #endif
00046
00047 #if defined(_DEBUG) && defined(WIN32)
00048 #   define new DEBUG_NEW
00049 #   undef THIS_FILE
00050     static char THIS_FILE[] = __FILE__;
00051 #endif
00052
00053 #ifndef NEW
00054 #define NEW new
00055 #endif
00056
00057 UIMPLEMENT_DYNAMIC(UToolbar, UWidget)
00058
00059 UBEGIN_MESSAGE_MAP(UToolbar, UWidget)
00060     ON_UPDATEUI(UToolbar)
00061     ON_UCOMMAND_RANGE(0, 0xFFFF, UToolbar::OnCommands)
00062     ON_UDESTROY(UToolbar)
00063     ON_TB_INIT(UToolbar)
00064     ON_TB_END(UToolbar)
00065     ON_TB_BUTTON(UToolbar)
00066     ON_TB_DROPDOWN(UToolbar)
00067     ON_TB_CHECKBTN(UToolbar)
00068     ON_TB_SEPARATOR(UToolbar)
00069     ON_USETTOOLTIP(0, 0xFFFF, UToolbar::OnSetTooltip)
00070 UEND_MESSAGE_MAP()
00071
00072 typedef enum
00073 {
00074     tbeDropDown,
00075     tbeButton,
00076     tbeSeparator
00077 } tbeKind;
00078
00079 class TbEntry
00080 {
00081 public:
00082     TbEntry(tbeKind k) : kind(k) {}
00083     virtual ~TbEntry() {}
00084
00085     tbeKind kind;
00086 };
00087
00088 #ifndef WIN32
00089     typedef void *HBITMAP;
00090 #endif
00091
00092 typedef struct
00093 {
00094     int cnt;
00095     HBITMAP bitmap;
00096 } AREF;
00097
00098 class aref
00099 {
00100 public:
00101     aref() : ref(0L)
00102     {
00103     }
00104     aref(HBITMAP b)
00105     {
00106         ref = NEW AREF;
00107         ref->cnt = 1;
00108         ref->bitmap = b;
00109     }
00110     aref(const aref & src)
00111     {
00112         ref = src.Ref();
00113     }
00114     virtual ~aref()
00115     {
00116         UnRef();
00117     }
00118     AREF *Ref(void) const
00119     {
00120         if(ref != 0L)
00121             ref->cnt++;
00122         return ref;
00123     }
00124     AREF *UnRef(void) const
00125     {
00126         if(ref != 0L && --ref->cnt == 0)
00127         {
00128 #ifdef WIN32
00129             if(ref->bitmap != 0L)
00130                 ::DeleteObject(ref->bitmap);
00131 #endif
00132             delete ref;
00133             ((aref *)this)->ref = 0L;
00134         }
00135         return ref;
00136     }
00137     aref & operator=(const aref & src)
00138     {
00139         UnRef();
00140         ref = src.Ref();
00141         return *this;
00142     }
00143     operator HBITMAP()
00144     {
00145         return ref != 0L ? ref->bitmap : 0L;
00146     }
00147 protected:
00148     AREF *ref;
00149 };
00150
00151 class awidget
00152 {
00153 public:
00154     awidget(HBITMAP b, int c, const char *t, UTB_VAR v) :
00155         bitmap(b), cmd(c), tooltip(0L), var(v)
00156     {
00157         if(t != 0L)
00158             tooltip = strdup(t);
00159     }
00160     awidget() : bitmap(0L), cmd(0), tooltip(0L)
00161     {
00162     }
00163     awidget(const awidget & src)
00164     {
00165         *this = src;
00166     }
00167
00168     virtual ~awidget()
00169     {
00170         if(tooltip != 0L)
00171             free(tooltip);
00172     }
00173
00174     awidget & operator=(const awidget & src)
00175     {
00176         bitmap = src.bitmap;
00177         cmd = src.cmd;
00178         var = src.var;
00179         tooltip = src.tooltip != 0L ? strdup(src.tooltip) : 0L;
00180
00181         return *this;
00182     }
00183     aref bitmap;
00184     int cmd;
00185     char *tooltip;
00186     UTB_VAR var;
00187 };
00188
00189 class TbEntryButton : public TbEntry
00190 {
00191 public:
00192     TbEntryButton(HBITMAP b, int c, const char *t, UTB_VAR v) :
00193         TbEntry(tbeButton), wid(b, c, t, v), ischeck(false)
00194     {
00195     }
00196     virtual ~TbEntryButton()
00197     {
00198     }
00199
00200     awidget wid;
00201     bool ischeck;
00202 };
00203
00204 class TbEntryChkButton : public TbEntryButton
00205 {
00206 public:
00207     TbEntryChkButton(HBITMAP b, int c, const char *t, UTB_VAR v) :
00208         TbEntryButton(b, c, t, v)
00209     {
00210         ischeck = true;
00211     }
00212     virtual ~TbEntryChkButton()
00213     {
00214     }
00215 };
00216
00217 class TbEntryDropDown : public TbEntry
00218 {
00219 public:
00220     TbEntryDropDown() : TbEntry(tbeDropDown), current(0) {}
00221     virtual ~TbEntryDropDown()
00222     {
00223     }
00224
00225     std::vector<awidget> icons;
00226     int current;
00227 };
00228
00229 class TbEntrySeparator : public TbEntry
00230 {
00231 public:
00232     TbEntrySeparator() : TbEntry(tbeSeparator) {}
00233     virtual ~TbEntrySeparator()
00234     {
00235     }
00236 };
00237
00238 class WININFO
00239 {
00240 public:
00241     WININFO(int w, int h) : width(w), height(h) {}
00242     virtual ~WININFO()
00243     {
00244         std::vector<TbEntry *>::iterator i;
00245         for(i = entries.begin(); i != entries.end(); ++i)
00246         {
00247             delete (*i);
00248         }
00249     }
00250
00251     std::vector<TbEntry *>::iterator Search(int cmd, int *dropindex = 0L)
00252     {
00253         std::vector<TbEntry *>::iterator i;
00254         for(i = entries.begin(); i != entries.end(); ++i)
00255         {
00256             TbEntry * entry = (*i);
00257             if(entry->kind == tbeDropDown)
00258             {
00259                 TbEntryDropDown *drop = (TbEntryDropDown *)entry;
00260                 std::vector<awidget>::iterator j;
00261                 int index;
00262
00263                 for(j = drop->icons.begin(), index = 0; j != drop->icons.end(); ++j, index++)
00264                 {
00265                     if((*j).cmd == cmd)
00266                     {
00267                         if(dropindex != 0L)
00268                             *dropindex = index;
00269                         return i;
00270                     }
00271                 }
00272             }
00273             else if(entry->kind == tbeButton)
00274             {
00275                 TbEntryButton *btn = (TbEntryButton *)entry;
00276                 if(btn->wid.cmd == cmd)
00277                     return i;
00278             }
00279         }
00280         return i;
00281     }
00282
00283     std::vector<TbEntry *> entries;
00284     int width, height;
00285 };
00286
00287 #ifdef WIN32
00288 class CColorMenu : public CMenu
00289 {
00290 public:
00291 // Operations
00292     void AppendColorMenuItem(UINT nID, awidget *what);
00293
00294 // Implementation
00295     virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMIS);
00296     virtual void DrawItem(LPDRAWITEMSTRUCT lpDIS);
00297     CColorMenu(int width, int height);
00298     virtual ~CColorMenu();
00299
00300     int m_width;
00301     int m_height;
00302 };
00303
00304 CColorMenu::CColorMenu(int width, int height) : m_width(width), m_height(height)
00305 {
00306     VERIFY(CreatePopupMenu());
00307 }
00308
00309 CColorMenu::~CColorMenu()
00310 {
00311 }
00312
00313 void CColorMenu::AppendColorMenuItem(UINT nID, awidget *what)
00314 {
00315     VERIFY(AppendMenu(MF_ENABLED | MF_OWNERDRAW, nID, (LPCTSTR)what));
00316 }
00317
00318 void CColorMenu::MeasureItem(LPMEASUREITEMSTRUCT lpMIS)
00319 {
00320     // all items are of fixed size
00321     lpMIS->itemWidth = m_width + 4;
00322     lpMIS->itemHeight = m_height + 4;
00323 }
00324
00325 void CColorMenu::DrawItem(LPDRAWITEMSTRUCT lpDIS)
00326 {
00327     CDC* pDC = CDC::FromHandle(lpDIS->hDC);
00328     awidget *what = (awidget *)lpDIS->itemData;
00329
00330     if (!(lpDIS->itemState & ODS_SELECTED) &&
00331         (lpDIS->itemAction & ODA_SELECT))
00332     {
00333         COLORREF crHilite = ::GetSysColor(COLOR_MENU);
00334         CBrush br(crHilite);
00335         CRect r(lpDIS->rcItem);
00336         r.DeflateRect(1, 1);
00337         pDC->FrameRect(&r, &br);
00338     }
00339
00340     if (lpDIS->itemAction & ODA_DRAWENTIRE)
00341     {
00342         // Paint the color item in the color requested
00343         CRect r(lpDIS->rcItem);
00344         r.OffsetRect((r.Width() - m_width) / 2, (r.Height() - m_height) / 2);
00345         CDC memdc;
00346         memdc.CreateCompatibleDC(pDC);
00347         CBitmap bmap;
00348         VERIFY(bmap.Attach(what->bitmap));
00349         CBitmap *old = memdc.SelectObject(&bmap);
00350         pDC->BitBlt(r.left, r.top, r.Width(), r.Height(), &memdc, 0, 0, SRCCOPY);
00351         memdc.SelectObject(old);
00352         bmap.Detach();
00353         VERIFY(memdc.DeleteDC());
00354     }
00355
00356     if ((lpDIS->itemState & ODS_SELECTED) &&
00357         (lpDIS->itemAction & (ODA_SELECT | ODA_DRAWENTIRE)))
00358     {
00359         // item has been selected - hilite frame
00360         COLORREF crHilite = ::GetSysColor(COLOR_HIGHLIGHT);
00361         CBrush br(crHilite);
00362         CRect r(lpDIS->rcItem);
00363         r.DeflateRect(1, 1);
00364         pDC->FrameRect(&r, &br);
00365     }
00366 }
00367
00368 IMPLEMENT_DYNAMIC(CDynToolBar, CCJToolBar)
00369
00370 BEGIN_MESSAGE_MAP(CDynToolBar, CCJToolBar)
00371     //{{AFX_MSG_MAP(CDynToolBar)
00372     ON_WM_DESTROY()
00373     //}}AFX_MSG_MAP
00374 END_MESSAGE_MAP()
00375
00376 CDynToolBar::CDynToolBar() : m_info(0L), m_bitmap(0L),
00377     m_tracking(false), m_widid(0)
00378 {
00379 }
00380
00381 CDynToolBar::~CDynToolBar()
00382 {
00383     //if(m_bitmap != 0L)
00384         //::DeleteObject(m_bitmap);
00385 }
00386
00387 void CDynToolBar::OnDestroy(void)
00388 {
00389     UEventSendMessage(GetPseudoID(), EV_DESTROY, 0, NULL);
00390
00391     CCJToolBar::OnDestroy();
00392 }
00393
00394 void CDynToolBar::OnDropDownButton(const NMTOOLBAR& nmtb, UINT nID, CRect rc)
00395 {
00396     std::vector<TbEntry *>::iterator f = m_info->Search(WINCMD_to_UCMD(nID));
00397     if(f == m_info->entries.end())
00398     {
00399         TRACE("Unknown id");
00400         return;
00401     }
00402
00403     TbEntryDropDown *entry = (TbEntryDropDown *)(*f);
00404     if(entry->kind != tbeDropDown)
00405     {
00406         TRACE("Unknown kind");
00407         return;
00408     }
00409
00410     CColorMenu menu(m_info->width, m_info->height);
00411     std::vector<awidget>::iterator i;
00412     for(i = entry->icons.begin(); i != entry->icons.end(); ++i)
00413     {
00414         menu.AppendColorMenuItem(UCMD_to_WINCMD((*i).cmd), i);
00415     }
00416
00417     m_tracking = true;
00418     menu.TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_VERTICAL,
00419         rc.left, rc.bottom, GetOwner(), &rc);
00420     m_tracking = false;
00421 }
00422 #endif
00423
00424 UToolbar::UToolbar(int widid) : UWidget(widid), m_winInfo(0L)
00425 #ifdef WIN32
00426     , m_wndToolBar(0L)
00427 #endif
00428 {
00429 }
00430
00431 UToolbar::~UToolbar()
00432 {
00433 }
00434
00435 void UToolbar::OnTbInit(UTB_INIT *info)
00436 {
00437     m_winInfo = NEW WININFO(info->widthbtn, info->heightbtn);
00438
00439 #ifdef WIN32
00440     WININFO & tb = *m_winInfo;
00441     m_wndToolBar = new CDynToolBar;
00442     CFrameWnd *f = m_wndToolBar->GetMainFrame();
00443     VERIFY(m_wndToolBar->Create(f, WS_CHILD | WS_VISIBLE | CBRS_TOP, info->winid));
00444     m_wndToolBar->SetBarStyle(m_wndToolBar->GetBarStyle() |
00445         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
00446     m_wndToolBar->EnableDocking(CBRS_ALIGN_ANY);
00447     m_wndToolBar->SetWinInfo(m_winInfo);
00448     m_wndToolBar->SetPseudoID(GetWidID());
00449     f->DockControlBar(m_wndToolBar);
00450
00451     // configure the Win32 toolbar
00452     if(info->title != 0L)
00453         m_wndToolBar->SetWindowText(info->title);
00454     m_wndToolBar->SetSizes(CSize(info->widthbtn+7,info->heightbtn+6),
00455         CSize(info->widthbtn,info->heightbtn));
00456 #endif
00457 #ifdef qGTK
00458     void *wid = GetWidget(kUMainWidget);
00459     g_assert(wid != 0L && GTK_IS_TOOLBAR(wid));
00460 #endif
00461 }
00462
00463 #ifdef WIN32
00464 void UToolbar::RebuildBar(bool onlyBitmap)
00465 {
00466     WININFO & tb = *m_winInfo;
00467
00468     ASSERT(m_wndToolBar != 0L);
00469     // create the bitmap associated with the toolbar
00470     CClientDC dc(m_wndToolBar);
00471     CBitmap* pbmOld = NULL;
00472
00473     CDC dcDest;
00474     VERIFY(dcDest.CreateCompatibleDC(&dc));
00475     CDC dcSrc;
00476     VERIFY(dcSrc.CreateCompatibleDC(&dc));
00477
00478     std::vector<UINT> styles;
00479     std::vector<TbEntry *>::iterator i;
00480     int numicons = 0;
00481     for(i = tb.entries.begin(); i != tb.entries.end(); ++i)
00482     {
00483         TbEntry * entry = *i;
00484
00485         if(entry->kind == tbeDropDown)
00486         {
00487             TbEntryDropDown *drop = (TbEntryDropDown *)entry;
00488             styles.push_back(UCMD_to_WINCMD(drop->icons[drop->current].cmd));
00489             numicons++;
00490         }
00491         else if(entry->kind == tbeButton)
00492         {
00493             TbEntryButton *btn = (TbEntryButton *)entry;
00494             if(btn->wid.var != DDV_NONE)
00495             {
00496                 styles.push_back(UTB_SEPARATOR);
00497             }
00498             else
00499             {
00500                 numicons++;
00501                 styles.push_back(btn->wid.cmd);
00502             }
00503         }
00504         else if(entry->kind == tbeSeparator)
00505         {
00506             styles.push_back(UTB_SEPARATOR);
00507         }
00508         else
00509         {
00510             ASSERT(0);
00511         }
00512     }
00513
00514     if(!onlyBitmap)
00515     {
00516         // create the Win32 toolbar
00517         m_wndToolBar->SetButtons(styles.begin(), styles.size());
00518     }
00519
00520     CBitmap bdest;
00521     bdest.CreateCompatibleBitmap(&dc, tb.width * numicons, tb.height);
00522     ASSERT(bdest.m_hObject != NULL);
00523     CBitmap *pbmOldDest = dcDest.SelectObject(&bdest);
00524
00525     int cnt = 0, index = 0;
00526     for(i = tb.entries.begin(); i != tb.entries.end(); ++i, index++)
00527     {
00528         TbEntry * entry = *i;
00529         HBITMAP bmap = 0L;
00530         int cmd;
00531         bool dropdown = false;
00532         bool ischeck = false;
00533
00534         if(entry->kind == tbeDropDown)
00535         {
00536             TbEntryDropDown *drop = (TbEntryDropDown *)entry;
00537             bmap = drop->icons[drop->current].bitmap;
00538             cmd = drop->icons[drop->current].cmd;
00539             dropdown = true;
00540         }
00541         else if(entry->kind == tbeButton)
00542         {
00543             TbEntryButton *btn = (TbEntryButton *)entry;
00544             if(btn->wid.var != DDV_NONE)
00545             {
00546                 if(!onlyBitmap)
00547                 {
00548                     m_wndToolBar->SetButtonInfo(index, ID_SEPARATOR,
00549                         TBBS_SEPARATOR, tb.width);
00550                     CRect rect;
00551                     m_wndToolBar->GetItemRect(index, &rect);
00552                     /*VERIFY(Create("",
00553                             WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_OWNERDRAW,
00554                             rect, m_wndToolBar, UCMD_to_WINCMD(btn->wid.cmd)));*/
00555                 }
00556                 continue;
00557             }
00558
00559             bmap = btn->wid.bitmap;
00560             cmd = btn->wid.cmd;
00561             ischeck = btn->ischeck;
00562         }
00563         else if(entry->kind == tbeSeparator)
00564         {
00565             m_wndToolBar->SetButtonInfo(index, ID_SEPARATOR,
00566                 TBBS_SEPARATOR, 0);
00567             continue;
00568         }
00569         else
00570         {
00571             continue;
00572             ASSERT(0);
00573         }
00574
00575         if(bmap != 0L)
00576         {
00577             CBitmap bsrc;
00578             VERIFY(bsrc.Attach(bmap));
00579             CBitmap *pbmOldSrc = dcSrc.SelectObject(&bsrc);
00580
00581             dcDest.BitBlt(tb.width * cnt, 0, tb.width, tb.height,
00582                     &dcSrc, 0, 0, SRCCOPY);
00583             bsrc.Detach();
00584
00585             dcSrc.SelectObject(pbmOldSrc);
00586         }
00587
00588         DWORD dwStyle = m_wndToolBar->GetButtonStyle(index);
00589         if(ischeck)
00590         {
00591             dwStyle &= ~TBBS_BUTTON;
00592             dwStyle |= TBBS_CHECKBOX;
00593         }
00594         m_wndToolBar->SetButtonInfo(index, UCMD_to_WINCMD(cmd),
00595             dwStyle, cnt);
00596
00597         if(dropdown)
00598             m_wndToolBar->AddDropDownButton(UCMD_to_WINCMD(cmd), -1, TRUE);
00599
00600         cnt++;
00601     }
00602
00603     dcDest.SelectObject(pbmOldDest);
00604     VERIFY(dcDest.DeleteDC());
00605     VERIFY(dcSrc.DeleteDC());
00606
00607     HBITMAP finalbmap = (HBITMAP)bdest.Detach();
00608     m_wndToolBar->SetBitmap(finalbmap);
00609
00610     if(m_wndToolBar->m_bitmap != 0L)
00611         ::DeleteObject(m_wndToolBar->m_bitmap);
00612     m_wndToolBar->m_bitmap = finalbmap;
00613
00614 }
00615 #endif
00616
00617 void UToolbar::OnTbEnd(void)
00618 {
00619 #ifdef WIN32
00620     RebuildBar(false);
00621 #endif
00622 }
00623
00624 void UToolbar::OnTbButton(UTB_BUTTON *info)
00625 {
00626 #ifdef WIN32
00627     ASSERT(m_wndToolBar != 0L);
00628 #endif
00629
00630     WININFO & tb = *m_winInfo;
00631     HBITMAP bitmap = UMakeBitmap((char **)info->icon);
00632     TbEntryButton *btn = NEW TbEntryButton(bitmap, info->cmd,
00633         info->tooltip, info->varcode);
00634     tb.entries.push_back(btn);
00635
00636 #ifdef qGTK
00637     char status[256] = {'\0'};
00638     char prompt[256] = {'\0'};
00639
00640     strcpy(status, info->tooltip);
00641     char *cr = strchr(status, '\n');
00642     if(cr != 0L)
00643     {
00644         strcpy(prompt, cr + 1);
00645         *cr = '\0';
00646     }
00647     GtkToolbar *toolbar = GTK_TOOLBAR(GetWidget(kUMainWidget));
00648     GtkWidget *tmp_toolbar_icon = info->icon != 0L ?
00649         create_pixmap(GTK_WIDGET(toolbar), (const char *)info->icon) : 0L;
00650     GtkWidget *wid = gtk_toolbar_append_element(toolbar, GTK_TOOLBAR_CHILD_BUTTON, 0L,
00651                                                 prompt, status, 0L,
00652                                                 tmp_toolbar_icon, 0L, 0L);
00653     UEventSendMessage(GetWidID(), EV_INIT_WIDGET, info->cmd, wid);
00654 #endif
00655 }
00656
00657 void UToolbar::OnTbSeparator(void)
00658 {
00659 #ifdef WIN32
00660     ASSERT(m_wndToolBar != 0L);
00661 #endif
00662
00663     WININFO & tb = *m_winInfo;
00664     TbEntrySeparator *btn = NEW TbEntrySeparator();
00665     tb.entries.push_back(btn);
00666
00667 #ifdef qGTK
00668     GtkToolbar *toolbar = GTK_TOOLBAR(GetWidget(kUMainWidget));
00669     /*GtkWidget *wid = */gtk_toolbar_append_element(toolbar, GTK_TOOLBAR_CHILD_SPACE, 0L,
00670                                                 0L, 0L, 0L,
00671                                                 0L, 0L, 0L);
00672 #endif
00673 }
00674
00675 void UToolbar::OnTbDropDown(UTB_DROPDOWN *info)
00676 {
00677 #ifdef WIN32
00678     ASSERT(m_wndToolBar != 0L);
00679 #endif
00680
00681     WININFO & tb = *m_winInfo;
00682     TbEntryDropDown *drop = NEW TbEntryDropDown();
00683     tb.entries.push_back(drop);
00684     int current = 0;
00685
00686     UTB_BUTTON *btns = info->btns;
00687     while(btns->icon != 0L)
00688     {
00689         HBITMAP bitmap = UMakeBitmap((char **)btns->icon);
00690         awidget ad(bitmap, btns->cmd, btns->tooltip, btns->varcode);
00691         drop->icons.push_back(ad);
00692         if(btns->cmd == info->initialcmd)
00693             drop->current = current;
00694         btns++;
00695         current++;
00696     }
00697 }
00698
00699 void UToolbar::OnTbCheckBtn(UTB_BUTTON *info)
00700 {
00701 #ifdef WIN32
00702     ASSERT(m_wndToolBar != 0L);
00703 #endif
00704
00705     WININFO & tb = *m_winInfo;
00706     HBITMAP bitmap = UMakeBitmap((char **)info->icon);
00707     TbEntryButton *btn = NEW TbEntryChkButton(bitmap, info->cmd,
00708         info->tooltip, info->varcode);
00709     tb.entries.push_back(btn);
00710
00711 #ifdef qGTK
00712     char status[256] = {'\0'};
00713     char prompt[256] = {'\0'};
00714
00715     strcpy(status, info->tooltip);
00716     char *cr = strchr(status, '\n');
00717     if(cr != 0L)
00718     {
00719         strcpy(prompt, cr + 1);
00720         *cr = '\0';
00721     }
00722     GtkToolbar *toolbar = GTK_TOOLBAR(GetWidget(kUMainWidget));
00723     GtkWidget *tmp_toolbar_icon = info->icon != 0L ?
00724         create_pixmap(GTK_WIDGET(toolbar), (const char *)info->icon) : 0L;
00725     GtkWidget *wid = gtk_toolbar_append_element(toolbar, GTK_TOOLBAR_CHILD_TOGGLEBUTTON, 0L,
00726                                                 prompt, status, 0L,
00727                                                 tmp_toolbar_icon, 0L, 0L);
00728     UEventSendMessage(GetWidID(), EV_INIT_WIDGET, info->cmd, wid);
00729 #endif
00730 }
00731
00732
00733 void UToolbar::OnDestroy(void)
00734 {
00735     if(m_winInfo != 0L)
00736         delete m_winInfo;
00737 }
00738
00739 int UToolbar::UDispatchMessage(int/*UEventType*/ evt, int arg1, void *arg2, UDispatchInfo & dispatchInfo)
00740 {
00741     if(evt == EV_CMD)
00742     {
00743         WININFO *info = m_winInfo;
00744         if(info != 0L)
00745         {
00746             int index;
00747             std::vector<TbEntry *>::iterator f = info->Search(arg1, &index);
00748             if(f != info->entries.end())
00749             {
00750                 TbEntryDropDown *entry = (TbEntryDropDown *)*f;
00751                 if(entry->kind == tbeDropDown)
00752                 {
00753                     // toggle the current bitmap
00754                     if(entry->current != index)
00755                     {
00756                         entry->current = index;
00757 #ifdef WIN32
00758                         RebuildBar();
00759 #endif
00760                     }
00761                 }
00762             }
00763         }
00764     }
00765
00766     return UWidget::UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00767 }
00768
00769 void UToolbar::OnSetTooltip(int cmd, UCmdUI *pCmdUI)
00770 {
00771     WININFO *info = m_winInfo;
00772     if(info == 0L)
00773         return;
00774
00775     int index;
00776     std::vector<TbEntry *>::iterator f = info->Search(cmd, &index);
00777     if(f == info->entries.end())
00778         return;
00779
00780     TbEntry * entry = *f;
00781     if(entry->kind == tbeDropDown)
00782     {
00783         TbEntryDropDown *drop = (TbEntryDropDown *)entry;
00784         awidget & wid = drop->icons[index];
00785         pCmdUI->SetTooltip(wid.tooltip);
00786     }
00787     else if(entry->kind == tbeButton)
00788     {
00789         TbEntryButton *btn = (TbEntryButton *)entry;
00790         pCmdUI->SetTooltip(btn->wid.tooltip);
00791     }
00792 }
00793
00794 int UToolbar::OnCommands(int cmd)
00795 {
00796     static bool sSemaphore = false;
00797     USemaphore policeman(sSemaphore);
00798     if(policeman.IsEnteredTwice())
00799         return 1;
00800
00801     // this is the interesting thing about the toolbar : it resends the
00802     // commands to other widgets according to the focus information and
00803     // allows the command to be handled several times if the handler return 1
00804
00805     const STD map<int, UCmdTarget *> & targets = UEventGetTargets();
00806     int res = 0;
00807     int handledFlag;
00808
00809     // first forward the command to the focused widget : if it soesn't want it
00810     // we give it to the next pseudo widget.
00811     if(sFocusWidID != -1 && sFocusWidID != GetWidID())
00812     {
00813         res = UEventSendMessageExt(sFocusWidID, EV_CMD, cmd, 0L, &handledFlag);
00814         if(res == 0 && handledFlag)
00815             return 0;
00816     }
00817
00818     STD map<int, UCmdTarget *>::const_iterator i;
00819     for(i = targets.begin(); i != targets.end(); ++i)
00820     {
00821         int widid = (*i).first;
00822         if(widid == sFocusWidID || widid == GetWidID())
00823             continue;
00824         res = UEventSendMessageExt(widid, EV_CMD, cmd, 0L, &handledFlag);
00825         if(res == 0 && handledFlag)
00826             return 0;
00827     }
00828
00829     UAppConsole("The cmd %d of the toolbar has no command handler\n", cmd);
00830
00831     return 0;
00832 }
00833
00834 void UToolbar::OnUpdateUI()
00835 {
00836 // on Windows the update UI is sent by MFC
00837 #ifndef WIN32
00838     WININFO *info = m_winInfo;
00839     if(info == 0L)
00840         return;
00841
00842     static bool sSemaphore = false;
00843     USemaphore policeman(sSemaphore);
00844     if(policeman.IsEnteredTwice())
00845         return;
00846
00847     // this is the interesting thing about the toolbar : it resends the
00848     // update UI to other widgets according to the focus information and
00849     // allows the update to be handled several times if the handler asks for it
00850     // (by using UCmdUI::SetContinue)
00851
00852     const STD map<int, UCmdTarget *> & targets = UEventGetTargets();
00853     std::vector<TbEntry *>::const_iterator f;
00854     int cmdid;
00855
00856     for(f = info->entries.begin(); f != info->entries.end(); ++f)
00857     {
00858         TbEntry * entry = *f;
00859         if(entry->kind == tbeButton)
00860         {
00861             TbEntryButton *btn = (TbEntryButton *)entry;
00862             cmdid = btn->wid.cmd;
00863         }
00864         else
00865             continue;
00866
00867         void *widget = GetWidget(cmdid);
00868         if(widget == 0L)
00869             continue;
00870
00871         // first forward the command to the focused widget : if it doesn't want it
00872         // we give it to the next pseudo widget.
00873         if(sFocusWidID != -1 && sFocusWidID != GetWidID())
00874         {
00875             UCmdUI pUI(cmdid);
00876             pUI.m_widget = widget;
00877             UEventSendMessage(sFocusWidID, EV_UPDTCMD, pUI.m_nID, &pUI);
00878             if(!pUI.CanContinue())
00879                 continue;
00880         }
00881
00882         STD map<int, UCmdTarget *>::const_iterator i;
00883         for(i = targets.begin(); i != targets.end(); ++i)
00884         {
00885             int widid = (*i).first;
00886             if(widid == sFocusWidID || widid == GetWidID())
00887                 continue;
00888
00889             UCmdUI pUI(cmdid);
00890             pUI.m_widget = widget;
00891             UEventSendMessage(widid, EV_UPDTCMD, pUI.m_nID, &pUI);
00892             if(!pUI.CanContinue())
00893                 break;
00894         }
00895         if(i == targets.end())
00896         {
00897             //UAppConsole("The cmd %d of the toolbar has no update handler, it's gonna be disabled\n", cmdid);
00898             UCmdUI pUI(cmdid);
00899             pUI.m_widget = widget;
00900             pUI.Enable(false);
00901         }
00902     }
00903 #endif // !WIN32
00904 }
Generated on Sun Feb 24 01:21:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/utoolbar.h Source File

rf/utoolbar.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- May 1999
00019  */
00020
00021 #ifndef UTOOLBAR_H
00022 #define UTOOLBAR_H
00023
00024 #include "uwidget.h"
00025
00026 #ifdef __cplusplus
00027
00028 class WININFO;
00029
00030 #ifdef __AFX_H__
00031 class CDynToolBar : public CCJToolBar
00032 {
00033     DECLARE_DYNAMIC(CDynToolBar)
00034
00035 // Construction
00036 public:
00037     CDynToolBar();
00038
00039 // Attributes
00040 public:
00041 protected:
00042
00043 // Operations
00044 public:
00045
00046 // Overrides
00047     // ClassWizard generated virtual function overrides
00048     //{{AFX_VIRTUAL(CDynToolBar)
00049     //}}AFX_VIRTUAL
00050
00051 // Implementation
00052 public:
00053     virtual ~CDynToolBar();
00054
00055     HBITMAP m_bitmap;
00056     bool m_tracking;
00057
00058     inline int GetPseudoID(void) const { return m_widid; }
00059     inline void SetPseudoID(int id) { m_widid = id; }
00060     inline WININFO *GetWinInfo(void) const { return m_info; }
00061     inline void SetWinInfo(WININFO *info) { m_info = info; }
00062     inline CFrameWnd *GetMainFrame() { return GetRoutingFrame(); }
00063
00064 // Generated message map functions
00065 protected:
00066     WININFO *m_info;
00067     int m_widid;
00068
00069     virtual void OnDropDownButton(const NMTOOLBAR& nmtb, UINT nID, CRect rc);
00070
00071     //{{AFX_MSG(CDynToolBar)
00072     afx_msg void OnDestroy(void);
00073     //}}AFX_MSG
00074     DECLARE_MESSAGE_MAP()
00075
00076 };
00077 #else /* ! __AFX_H__ */
00078 class CDynToolBar;
00079 #endif /* !__AFX_H__ */
00080
00081 class UToolbar : public UWidget
00082 {
00083     UDECLARE_DYNAMIC(UToolbar)
00084 public:
00085     UToolbar(int widid);
00086     virtual ~UToolbar();
00087
00088     virtual int UDispatchMessage(int/*UEventType*/ evt, int arg1, void *arg2, UDispatchInfo & dispatchInfo);
00089
00090 protected:
00091     ev_msg void OnDestroy();
00092     ev_msg void OnTbInit(UTB_INIT *info);
00093     ev_msg void OnTbEnd(void);
00094     ev_msg void OnTbButton(UTB_BUTTON *info);
00095     ev_msg void OnTbDropDown(UTB_DROPDOWN *info);
00096     ev_msg void OnTbCheckBtn(UTB_BUTTON *info);
00097     ev_msg void OnTbSeparator(void);
00098     ev_msg void OnSetTooltip(int cmd, UCmdUI *pCmdUI);
00099     ev_msg int OnCommands(int cmd);
00100     ev_msg void OnUpdateUI(void);
00101
00102     WININFO *m_winInfo;
00103
00104 #ifdef WIN32
00105     CDynToolBar *m_wndToolBar;
00106
00107     void RebuildBar(bool onlyBitmap = true);
00108 #endif
00109
00110     UDECLARE_MESSAGE_MAP()
00111 };
00112 #endif /* __cplusplus */
00113
00114 #ifdef __cplusplus
00115 extern "C" {
00116 #endif
00117
00118 #ifdef __cplusplus
00119 }
00120 #endif
00121
00122 #endif /* UTOOLBAR_H */
Generated on Sun Feb 24 01:21:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/uwidget.cpp Source File

rf/uwidget.cpp

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- May 1999
00019  */
00020
00021 #include "stdafx.h"
00022
00023 #ifdef HAVE_CONFIG_H
00024 #include "config.h"
00025 #endif
00026
00027 #include <stdio.h>
00028
00029 #include "uwidget.h"
00030 #include "uconsole.h"
00031 #include "udraw.h"
00032 #include "umenu.h"
00033 #include "SmartComboBox.h"
00034
00035 #if qMacAPP
00036 #   include "UPseudoSupport.h"
00037 #   include "UButton.h"
00038 #   include "UDialogBehavior.h"
00039 #   include "URadio.h"
00040 #   include "UCheckbox.h"
00041 #   include "UNumberText.h"
00042 #   include "UPopup.h"
00043 #   include "UWindow.h"
00044 #   include "UViewServer.h"
00045 #   include "USlider.h"
00046 #   include "UDispatcher.h"
00047 #   include "UTabbedView.h"
00048 #   include "UProgressIndicator.h"
00049 #endif
00050
00051 #ifdef qMacPP
00052 #   include "UPseudoSupport.h"
00053 #   include <LCheckBox.h>
00054 #   include <LRadioButton.h>
00055 #   include <LEditText.h>
00056 #   include <LStaticText.h>
00057 #   include <UModalDialogs.h>
00058 #   include <LPopupButton.h>
00059 #   include <LOutlineTable.h>
00060 #   include <LOutlineItem.h>
00061 #   include <UTableHelpers.h>
00062 #   include <LTextTableView.h>
00063 #   include <LCheckBoxGroupBox.h>
00064 #   include <LPageController.h>
00065 #   include <LTabsControl.h>
00066 #endif
00067
00068 #ifdef WIN32
00069 #   include "PseudoDlg.h"
00070 #   include "PseudoButton.h"
00071 #endif
00072
00073 #if defined(_DEBUG) && defined(WIN32)
00074 #   define new DEBUG_NEW
00075 #   undef THIS_FILE
00076     static char THIS_FILE[] = __FILE__;
00077 #endif
00078
00079 #ifndef NEW
00080 #   define NEW new
00081 #endif
00082
00083 UIMPLEMENT_DYNAMIC(UWidget, UCmdTarget)
00084
00085 UBEGIN_MESSAGE_MAP(UWidget, UCmdTarget)
00086     ON_UPDATEUI(UWidget)
00087     ON_UPDATEFOCUS(UWidget)
00088     ON_INIT_WIDGET(UWidget, 0, 0xFFFF)
00089     ON_INIT_TAB_WIDGET(UWidget, 0, 0xFFFF)
00090     ON_PAGE_CHANGED(UWidget, 0, 0xFFFF)
00091     ON_FETCHCMD(UWidget, 0, 0xFFFF)
00092     ON_QUERYSTATE(0, 0xFFFF, UWidget::OnGetState)
00093     ON_SETSTATE(0, 0xFFFF, UWidget::OnSetState)
00094     ON_ENABLECMD(0, 0xFFFF, UWidget::OnEnableCmd)
00095     ON_CHGFOCUS(UWidget, 0, 0xFFFF)
00096     ON_INVALIDATE(UWidget, 0, 0xFFFF)
00097     ON_REDRAW(UWidget, 0, 0xFFFF)
00098     ON_SHOW_WIDGET_RANGE(0, 0xFFFF, UWidget::OnShowWidget)
00099     ON_SETTEXT(0, 0xFFFF, UWidget::OnSetText)
00100     ON_GETTEXT(0, 0xFFFF, UWidget::OnGetText)
00101     ON_SETFLOAT(UWidget, 0, 0xFFFF)
00102     ON_GETFLOAT(UWidget, 0, 0xFFFF)
00103     ON_SET_SLIDER(UWidget, 0, 0xFFFF)
00104     ON_GET_SLIDERPROP(UWidget, 0, 0xFFFF)
00105     ON_SET_SLIDERPROP(UWidget, 0, 0xFFFF)
00106     ON_CHGCURSOR(UWidget, 0, 0xFFFF)
00107     ON_USETTOOLTIP(0, 0xFFFF, UWidget::OnSetTooltip)
00108     ON_USETLLOC(0, 0xFFFF, UWidget::OnSetLoc)
00109     ON_UGETLLOC(0, 0xFFFF, UWidget::OnGetLoc)
00110     ON_TREE_RESETALL(UWidget, 0, 0xFFFF)
00111     ON_TREE_INSERT(UWidget, 0, 0xFFFF)
00112     ON_TREE_GETINFO(UWidget, 0, 0xFFFF)
00113     ON_TREE_DELETE(UWidget, 0, 0xFFFF)
00114     ON_TREE_EXPAND(UWidget, 0, 0xFFFF)
00115     ON_TREE_SELECT(UWidget, 0, 0xFFFF)
00116     ON_TREE_SETDATA(UWidget, 0, 0xFFFF)
00117     ON_TREE_SETICON(UWidget, 0, 0xFFFF)
00118     ON_TREE_GETSEL(UWidget, 0, 0xFFFF)
00119     ON_LIST_SETCOLTITLE(UWidget, 0, 0xFFFF)
00120     ON_LIST_SETCOLTITLE(UWidget, 0, 0xFFFF)
00121     ON_LIST_SETCOLWIDTH(UWidget, 0, 0xFFFF)
00122     ON_LIST_RESETALL(UWidget, 0, 0xFFFF)
00123     ON_LIST_ADDSEL(UWidget, 0, 0xFFFF)
00124     ON_LIST_DELROW(UWidget, 0, 0xFFFF)
00125     ON_LIST_SETFEEDBACK(UWidget, 0, 0xFFFF)
00126     ON_LIST_NEWROW(UWidget, 0, 0xFFFF)
00127     ON_LIST_INSERT(UWidget, 0, 0xFFFF)
00128     ON_LIST_ROWSETDATA(UWidget, 0, 0xFFFF)
00129     ON_LIST_ROWGETDATA(UWidget, 0, 0xFFFF)
00130     ON_LIST_GETNEXTSEL(UWidget, 0, 0xFFFF)
00131     ON_LIST_GETNEXT(UWidget, 0, 0xFFFF)
00132     ON_LIST_GETINFO(UWidget, 0, 0xFFFF)
00133     ON_LIST_ADDCOLUMNS(UWidget, 0, 0xFFFF)
00134     ON_LIST_RESORT(UWidget, 0, 0xFFFF)
00135     ON_COMBO_RESETALL(UWidget, 0, 0xFFFF)
00136     ON_COMBO_APPEND(UWidget, 0, 0xFFFF)
00137     ON_COMBO_SETSEL(UWidget, 0, 0xFFFF)
00138     ON_COMBO_GETSEL(UWidget, 0, 0xFFFF)
00139     ON_COMBO_GETCOUNT(UWidget, 0, 0xFFFF)
00140     ON_COMBO_DELSEL(UWidget, 0, 0xFFFF)
00141     ON_COMBO_ENABLESEL(UWidget, 0, 0xFFFF)
00142     ON_COMBO_GETMENU(UWidget, 0, 0xFFFF)
00143     ON_SMARTCOMBO_SETFEATURE(UWidget, 0, 0xFFFF)
00144     ON_SMARTCOMBO_SETITEMS(UWidget, 0, 0xFFFF)
00145     ON_SMARTCOMBO_SETREADONLY(UWidget, 0, 0xFFFF)
00146 UEND_MESSAGE_MAP()
00147
00148 bool UWidget::sValidMenu = false;
00149 int UWidget::sFocusWidID = -1;
00150 int UWidget::sFocusCmdID;
00151
00152 bool UWidget::IsUIValid() { return sValidMenu; }
00153 void UWidget::DoValidUI(bool how) { sValidMenu = how; }
00154 int UWidget::GetFocus(void) { return sFocusWidID; }
00155 int UWidget::GetFocusCmd(void) { return sFocusCmdID; }
00156
00157 #if qGTK
00158 extern "C"
00159 {
00160     static void gtkdestroy(GtkWidget *widget, gpointer user_data)
00161     {
00162         UWidget *wid = (UWidget *)user_data;
00163         UEventSendMessage(wid->GetWidID(), EV_DESTROY, 0, 0L);
00164     }
00165
00166     static int gtkkeypress(GtkWidget *widget, GdkEventKey * event, gpointer user_data)
00167     {
00168         UWidget *wid = (UWidget *)user_data;
00169         UEventSendMessage(wid->GetWidID(), EV_KEYDOWN, event->keyval, 0L);
00170         return FALSE;
00171     }
00172
00173     static guint focus_in_signal_id;
00174     static guint focus_out_signal_id;
00175
00176     static gboolean gtkeventwatcher(GtkObject *object, guint signal_id, guint n_params, GtkArg *params, gpointer data)
00177     {
00178 #if 0
00179         g_print ("Watch: \"%s\" emitted for %s\n",
00180                  gtk_signal_name (signal_id),
00181                  gtk_type_name (GTK_OBJECT_TYPE (object)));
00182 #endif
00183
00184         // for a tree, we are interested to know about the tree, not just the item
00185         if(GTK_IS_TREE_ITEM(object))
00186         {
00187             GtkTree *parent = GTK_TREE(GTK_WIDGET(object)->parent);
00188             // now find the upper tree
00189             while(1)
00190             {
00191                 gpointer data = gtk_object_get_data(GTK_OBJECT(parent), "rf_treeparent");
00192                 if(data != 0L)
00193                     parent = GTK_TREE(GTK_WIDGET(data)->parent);
00194                 else
00195                     break;
00196             }
00197             object = GTK_OBJECT(parent);
00198         }
00199
00200         if(signal_id == focus_out_signal_id)
00201         {
00202             UEventNotifyMessage(EV_UPDATEFOCUS, 1, object);
00203         }
00204         else if(signal_id == focus_in_signal_id)
00205         {
00206             UEventNotifyMessage(EV_UPDATEFOCUS, 0, object);
00207         }
00208
00209         return TRUE;
00210     }
00211
00212     static void gtkmaindoevent(GdkEvent *event)
00213     {
00214         gtk_main_do_event(event);
00215
00216         switch(event->type)
00217         {
00218         case GDK_BUTTON_PRESS:
00219         case GDK_2BUTTON_PRESS:
00220         case GDK_3BUTTON_PRESS:
00221         case GDK_BUTTON_RELEASE:
00222         case GDK_KEY_PRESS:
00223         case GDK_KEY_RELEASE:
00224         case GDK_FOCUS_CHANGE:
00225             UWidget::DoValidUI(false);
00226             break;
00227         default:
00228             break;
00229         }
00230     }
00231
00232     static void gtkclicked(GtkButton *button, gpointer user_data)
00233     {
00234         int widid = ULOWORD((int)user_data);
00235         int cmdid = UHIWORD((int)user_data);
00236         UEventSendMessage(widid, EV_CMD, cmdid, 0L);
00237     }
00238
00239     static void gtkmenuitemactivate(GtkMenuItem *menuitem, gpointer user_data)
00240     {
00241         int widid = ULOWORD((int)user_data);
00242         int cmdid = UHIWORD((int)user_data);
00243         UEventSendMessage(widid, EV_CMD, cmdid, 0L);
00244     }
00245
00246     static void gtkselectclist(GtkWidget *clist, gint row, gint column,
00247                                GdkEventButton *event, gpointer user_data)
00248     {
00249         int widid = ULOWORD((int)user_data);
00250         int cmdid = UHIWORD((int)user_data);
00251         gchar *text;
00252         gtk_clist_get_text(GTK_CLIST(clist), row, column, &text);
00253         UEventSendMessage(widid, EV_LIST_SELECTING, UMAKEINT(cmdid, row), text);
00254     }
00255
00256     static void gtkselectclistcolumn(GtkCList *clist, gint column, gpointer user_data)
00257     {
00258         int widid = ULOWORD((int)user_data);
00259         int cmdid = UHIWORD((int)user_data);
00260         UEventSendMessage(widid, EV_LIST_SELCOLUMN, UMAKEINT(cmdid, column), 0L);
00261     }
00262
00263     static gint gtkclistdblclick(GtkWidget *widget, GdkEventButton *event, gpointer data)
00264     {
00265         int widid = ULOWORD((int)data);
00266         int cmdid = UHIWORD((int)data);
00267         if (event->type == GDK_2BUTTON_PRESS)
00268         {
00269             UEventSendMessage(widid, EV_LIST_DBLCLICK, cmdid, 0L);
00270             return FALSE;
00271         }
00272         return TRUE;
00273     }
00274
00275     static void gtkcomboclicked(GtkWidget *widget, gpointer user_data)
00276     {
00277         int widid = ULOWORD((int)user_data);
00278         int cmdid = UHIWORD((int)user_data);
00279
00280         GtkList *list = GTK_LIST(widget->parent);
00281         GList *selection = list->selection;
00282         int count = -1;
00283         UStr selTxt;
00284         if (selection)
00285         {
00286             GtkBin *bin = GTK_BIN( selection->data );
00287             gchar *txt;
00288             gtk_label_get(GTK_LABEL(bin->child), &txt);
00289             selTxt = txt;
00290             GList *child = list->children;
00291             count = 0;
00292             while (child)
00293             {
00294                 if (child->data == selection->data)
00295                     break;
00296                 count++;
00297                 child = child->next;
00298             }
00299             g_assert(child != 0L);
00300         }
00301         UEventSendMessage(widid, EV_COMBO_SEL, UMAKEINT(cmdid, count), (void *)(const char *)selTxt);
00302     }
00303
00304     GtkLabel *getLabelFromContainer(GtkContainer *w)
00305     {
00306         GList *list = gtk_container_children(w);
00307         GtkLabel *label = 0L;
00308         while(list != 0L)
00309         {
00310             GtkWidget *wid = GTK_WIDGET(list->data);
00311             if(GTK_IS_LABEL(wid))
00312             {
00313                 label = GTK_LABEL(wid);
00314                 break;
00315             }
00316             list = (GList *)g_list_next(list);
00317         }
00318         return label;
00319     }
00320
00321     static void gtkmenuactivated(GtkWidget *widget, gpointer user_data)
00322     {
00323         int widid = ULOWORD((int)user_data);
00324         int cmdid = UHIWORD((int)user_data);
00325
00326         UStr selTxt;
00327
00328         // fix me: where to find the label of the item ?
00329 #if 1
00330         selTxt = (char *)gtk_object_get_data(GTK_OBJECT(widget), "rf_menuitemtext");
00331 #else
00332         GtkLabel *label = getLabelFromContainer(GTK_CONTAINER(widget));
00333         gchar *txt;
00334         gtk_label_get(label, &txt);
00335         selTxt = txt;
00336 #endif
00337
00338         GtkMenu *menu = GTK_MENU(widget->parent);
00339         GList *list = GTK_MENU_SHELL(menu)->children;
00340         int count = 0;
00341         while(list != 0L)
00342         {
00343             GtkWidget *wid = GTK_WIDGET(list->data);
00344             if(wid == widget)
00345                 break;
00346             list = (GList *)g_list_next(list);
00347             count++;
00348         }
00349         g_assert(list != 0L);
00350         UEventSendMessage(widid, EV_COMBO_SEL, UMAKEINT(cmdid, count), (void *)(const char *)selTxt);
00351     }
00352
00353     static gint gtkcancel(GtkWidget *widget, gpointer user_data)
00354     {
00355         static bool sSemaphore = false;
00356         USemaphore policeman(sSemaphore);
00357         if(policeman.IsEnteredTwice())
00358             return TRUE;
00359
00360         UWidget *wid = (UWidget *)user_data;
00361         wid->EndModal(false);
00362         return FALSE;
00363     }
00364
00365     static bool matchToken(const char *str, int &cmd)
00366     {
00367         if(str == 0L)
00368             return false;
00369
00370         const char *origStr = str;
00371         size_t len = strlen(kUgtkPrefixToken);
00372         if(strncmp(str, kUgtkPrefixToken, len) != 0)
00373             return false;
00374
00375         str += len;
00376         if(*str && *str != '_')
00377             str++;
00378         if(*str && *str == '_')
00379             str++;
00380
00381         if(sscanf(str, "%d", &cmd) == 1 && cmd >=0 && cmd < (32767 - EV_COMMAND_START))
00382         {
00383             cmd += EV_COMMAND_START;
00384             return true;
00385         }
00386         else
00387             g_warning("The widget '%s' has a wrong pseudo command '%d'\n", origStr, cmd);
00388
00389         return false;
00390     }
00391
00392     static void dataForeach(GQuark key_id, gpointer data, gpointer user_data)
00393     {
00394         const char *str = g_quark_to_string(key_id);
00395         int id = (int)user_data;
00396         int cmd;
00397         if(matchToken(str, cmd))
00398         {
00399             UASSERT(GTK_IS_WIDGET(data));
00400
00401             GtkWidget *w = (GtkWidget *)data;
00402             w = w->parent;
00403             while(w != 0L)
00404             {
00405                 if(GTK_IS_NOTEBOOK(w))
00406                 {
00407                     // don't extract widgets children of a notebook at this point
00408                     return;
00409                 }
00410                 w = w->parent;
00411             }
00412
00413             UEventSendMessage(id, EV_INIT_WIDGET, cmd, data);
00414         }
00415     }
00416
00417     typedef struct
00418     {
00419         int widid;
00420         int pageid;
00421         int pagenum;
00422     } _dataTabForeach;
00423
00424     static void dataTabForeach(GQuark key_id, gpointer data, gpointer user_data)
00425     {
00426         const char *str = g_quark_to_string(key_id);
00427         _dataTabForeach *mydata = (_dataTabForeach *)user_data;
00428         int cmd;
00429         if(matchToken(str, cmd))
00430         {
00431             UASSERT(GTK_IS_WIDGET(data));
00432             GtkWidget *w = (GtkWidget *)data;
00433             w = w->parent;
00434             while(w != 0L)
00435             {
00436                 if(GTK_IS_NOTEBOOK(w))
00437                 {
00438                     break;
00439                 }
00440                 w = w->parent;
00441             }
00442             if(w == 0L)
00443             {
00444                 // this is not a child of a notebook
00445                 return;
00446             }
00447
00448             gchar *name = gtk_widget_get_name(w);
00449             int pagecmd;
00450             if(!matchToken(name, pagecmd) || pagecmd != mydata->pageid)
00451                 return;
00452
00453             GtkNotebook *n = GTK_NOTEBOOK(w);
00454             w = (GtkWidget *)data;
00455             int pagenum = -1;
00456             while(w != 0L && pagenum == -1)
00457             {
00458                 int i = 0;
00459                 GtkWidget *p;
00460                 while((p = gtk_notebook_get_nth_page(n, i)) != 0L)
00461                 {
00462                     if(w == p)
00463                     {
00464                         pagenum = i;
00465                         break;
00466                     }
00467                     i++;
00468                 }
00469                 w = w->parent;
00470             }
00471
00472             if(pagenum == -1)
00473             {
00474                 g_warning("Could not find the page of the widget '%s'\n", str);
00475                 return;
00476             }
00477
00478             if(pagenum != mydata->pagenum)
00479                 return;
00480
00481             UEventSendMessage(mydata->widid, EV_INIT_WIDGET, cmd, data);
00482         }
00483     }
00484
00485     static void gtkpacktreeitem(GtkBox *m_box, const char *title, GtkPixmap *icon)
00486     {
00487         if(icon != 0L)
00488         {
00489             gtk_misc_set_alignment (GTK_MISC (icon), 0.0, 0.5);
00490             gtk_box_pack_start(m_box, GTK_WIDGET(icon), FALSE, FALSE, 0);
00491             gtk_widget_show (GTK_WIDGET(icon));
00492         }
00493
00494         GtkLabel *m_label_widget = GTK_LABEL(gtk_label_new (title != 0L ? title : ""));
00495         gtk_misc_set_alignment (GTK_MISC (m_label_widget), 0.5, 0.5);
00496         gtk_box_pack_start(m_box, GTK_WIDGET(m_label_widget), FALSE, FALSE, 0);
00497         gtk_widget_show (GTK_WIDGET(m_label_widget));
00498
00499         gtk_widget_show(GTK_WIDGET(m_box));
00500     }
00501
00502     static GtkTreeItem *gtknewtreeitem(const char *title, GtkPixmap *icon)
00503     {
00504         GtkTreeItem *item;
00505         item = GTK_TREE_ITEM(gtk_tree_item_new());
00506
00507         GtkHBox *m_box = GTK_HBOX(gtk_hbox_new(FALSE, 2));
00508         gtk_container_add (GTK_CONTAINER (item), GTK_WIDGET(m_box));
00509
00510         gtkpacktreeitem(GTK_BOX(m_box), title, icon);
00511
00512         return item;
00513     }
00514
00515     static void gtktreeexpand(GtkWidget *item, gpointer user_data)
00516     {
00517         int widid = ULOWORD((int)user_data);
00518         int cmdid = UHIWORD((int)user_data);
00519         g_assert(GTK_IS_TREE_ITEM(item));
00520         UEventSendMessage(widid, EV_TREE_EXPANDING, UMAKEINT(cmdid, 0), item);
00521     }
00522
00523     static void gtktreecollapse(GtkWidget *item, gpointer user_data)
00524     {
00525         int widid = ULOWORD((int)user_data);
00526         int cmdid = UHIWORD((int)user_data);
00527         g_assert(GTK_IS_TREE_ITEM(item));
00528         UEventSendMessage(widid, EV_TREE_EXPANDING, UMAKEINT(cmdid, 1), item);
00529     }
00530
00531     static void gtktreeselect(GtkWidget *item, gpointer user_data)
00532     {
00533         int widid = ULOWORD((int)user_data);
00534         int cmdid = UHIWORD((int)user_data);
00535         g_assert(GTK_IS_TREE_ITEM(item));
00536         UEventSendMessage(widid, EV_TREE_SELECTING, UMAKEINT(cmdid, 0), item);
00537     }
00538
00539     static void gtktreedeselect(GtkWidget *item, gpointer user_data)
00540     {
00541         int widid = ULOWORD((int)user_data);
00542         int cmdid = UHIWORD((int)user_data);
00543         g_assert(GTK_IS_TREE_ITEM(item));
00544         UEventSendMessage(widid, EV_TREE_SELECTING, UMAKEINT(cmdid, 1), item);
00545     }
00546
00547     static GtkLabel *gtktreegetlabel(GtkWidget *item)
00548     {
00549         GtkBox *box = GTK_BOX (GTK_BIN (item)->child);
00550         GList *list = box->children;
00551         GtkLabel *label = 0L;
00552         while(list != 0L)
00553         {
00554             GtkWidget *wid = ((GtkBoxChild *)list->data)->widget;
00555             if(GTK_IS_LABEL(wid))
00556             {
00557                 label = (GtkLabel *)wid;
00558                 break;
00559             }
00560             list = (GList *)g_list_next(list);
00561         }
00562         return label;
00563     }
00564
00565     static void gtksettreeitemicon(GtkTreeItem *item, GtkPixmap *icon)
00566     {
00567         gchar *title = 0L;
00568         GtkLabel *label = gtktreegetlabel(GTK_WIDGET(item));
00569         if(label != 0L)
00570             gtk_label_get(label, &title);
00571         UStr str(title);
00572
00573         GtkBox *m_box = GTK_BOX(GTK_BIN (item)->child);
00574         GList *list = g_list_copy(m_box->children);
00575         while(list != 0L)
00576         {
00577             GtkWidget *wid = ((GtkBoxChild *)list->data)->widget;
00578             gtk_container_remove(GTK_CONTAINER(m_box), wid);
00579
00580             list = (GList *)g_list_next(list);
00581         }
00582         g_list_free(list);
00583
00584         gtkpacktreeitem(m_box, str, icon);
00585     }
00586
00587     // TODO: remove that when the GTK one is working
00588     static gint gtk_clist_get_text_is_buggy(GtkCList  *clist,
00589                                             gint       row,
00590                                             gint       column,
00591                                             gchar    **text)
00592     {
00593         GtkCListRow *clist_row;
00594
00595         g_return_val_if_fail (clist != NULL, 0);
00596         g_return_val_if_fail (GTK_IS_CLIST (clist), 0);
00597
00598         if (row < 0 || row >= clist->rows)
00599             return 0;
00600         if (column < 0 || column >= clist->columns)
00601             return 0;
00602
00603         clist_row = (GtkCListRow *)(g_list_nth (clist->row_list, row))->data;
00604
00605         if (clist_row->cell[column].type == GTK_CELL_TEXT)
00606         {
00607             if (text)
00608                 *text = GTK_CELL_TEXT (clist_row->cell[column])->text;
00609         }
00610         else if (clist_row->cell[column].type == GTK_CELL_PIXTEXT)
00611         {
00612             if (text)
00613                 *text = GTK_CELL_PIXTEXT(clist_row->cell[column])->text;
00614         }
00615         else
00616             return 0;
00617
00618         return 1;
00619     }
00620
00621     static void
00622     gtkswitchpage(GtkWidget       *w,
00623                   GtkNotebookPage *page,
00624                   gint             page_num,
00625                   gpointer         data)
00626     {
00627         int widid = ULOWORD((int)data);
00628         int cmdid = UHIWORD((int)data);
00629
00630         UEventSendMessage(widid, EV_PAGE_CHANGED, UMAKEINT(cmdid, page_num), 0L);
00631     }
00632
00633     static UListSorter sGtkClistDiff = 0L;
00634     static UWidget *sGtkClistWid = 0L;
00635
00636     static gint gtkclistdefcompare(GtkCList *clist, gconstpointer ptr1, gconstpointer ptr2)
00637     {
00638         if(sGtkClistDiff == 0L)
00639             return 0;
00640
00641         GtkCListRow *row1 = (GtkCListRow *) ptr1;
00642         GtkCListRow *row2 = (GtkCListRow *) ptr2;
00643         return sGtkClistDiff(sGtkClistWid, row1->data, row2->data);
00644     }
00645
00646     static gint gtkexposeevent(GtkWidget *widget, GdkEvent *event, gpointer user_data)
00647     {
00648         int widid = ULOWORD((int)user_data);
00649         int cmdid = UHIWORD((int)user_data);
00650
00651         UEventSendMessage(widid, EV_CUSTOM_DRAW, cmdid, event);
00652         return TRUE;
00653     }
00654 } // extern "C"
00655
00656 #endif /* qGTK */
00657
00658 #if qMacAPP
00659     static bool macapp_getcmdid(TView *view, int & cmdid)
00660     {
00661         IDType atype = view->GetIdentifier();
00662         const char *atypestr = (char *)&atype;
00663         if(atypestr[0] != 'p' && atypestr[1] != 's')
00664             return false;
00665
00666         char cmd[3] = {atypestr[2], atypestr[3], 0};
00667         return sscanf(cmd, "%d", &cmdid) == 1;
00668     }
00669
00670     static void macapp_fecthview(int widid, TView *view)
00671     {
00672         if(view == 0L)
00673             return;
00674
00675         int cmdid;
00676         if(macapp_getcmdid(view, cmdid))
00677         {
00678             UEventSendMessage(widid, EV_INIT_WIDGET, cmdid + EV_COMMAND_START, view);
00679         }
00680
00681         if(MA_MEMBER(view, TTabbedView))
00682         {
00683             TTabbedView *tab = (TTabbedView *)view;
00684             TView *tabview;
00685             SInt32 tabIndex = 1;
00686             while((tabview = tab->GetPanelView(tabIndex++)) != 0L)
00687             {
00688                 macapp_fecthview(widid, tabview);
00689             }
00690         }
00691
00692         macapp_fecthview(widid, view->GetNextView());
00693         macapp_fecthview(widid, view->GetSubView());
00694     }
00695 #endif /* qMacAPP */
00696
00697 UWidget::UWidget(int widid) : UCmdTarget(widid), m_currentPage(-1)
00698 #if qGTK || qMacPP
00699     , m_modalLoop(false)
00700 #endif
00701 #ifdef WIN32
00702     , m_curModal(0L), m_noDispatch(false)
00703 #endif
00704 {
00705 #if qMacAPP
00706     static bool firstTime = true;
00707     if(firstTime)
00708     {
00709         firstTime = false;
00710         gDispatcher->AddBehavior(new TPseudoAppBehavior);
00711             // this behavior takes care about menu routing and giving time
00712             // to the pseudo-events.
00713         new UMacAppMenu();
00714             // for MacApp, we can create automatically the pseudo menu handling.
00715     }
00716 #endif
00717 #if qMacPP
00718     static bool firstTime = true;
00719     if(firstTime && LCommander::GetTopCommander() != 0L)
00720     {
00721         firstTime = false;
00722         LCommander::GetTopCommander()->AddAttachment(NEW LMainPseudoAttachment());
00723     }
00724 #endif
00725 }
00726
00727 UWidget::~UWidget()
00728 {
00729     std::vector<UCmdTarget *>::iterator i;
00730     for(i = m_listeners.begin(); i != m_listeners.end(); ++i)
00731     {
00732         delete *i;
00733     }
00734     std::map<int, UWidget *>::iterator j;
00735     for(j = m_tabs.begin(); j != m_tabs.end(); ++j)
00736     {
00737         delete (*j).second;
00738     }
00739     if(HasFocus())
00740         sFocusWidID = -1;
00741 }
00742
00743 void UWidget::AddListener(UCmdTarget * listener)
00744 {
00745     m_listeners.push_back(listener);
00746 }
00747
00748 int UWidget::UDispatchMessage(int/*UEventType*/ evt, int arg1, void *arg2, UDispatchInfo & dispatchInfo)
00749 {
00750     std::vector<UCmdTarget *>::iterator i;
00751     for(i = m_listeners.begin(); i != m_listeners.end(); ++i)
00752     {
00753         (*i)->UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00754     }
00755     return UCmdTarget::UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00756 }
00757
00758 void *UWidget::GetWidget(int cmd) const
00759 {
00760     std::map<int, void *>::const_iterator i = m_widgets.find(cmd);
00761     if(i == m_widgets.end())
00762     {
00763         UAppConsole("Unable to find widget id : %d (file %s:%d)\n", cmd, __FILE__, __LINE__);
00764         return 0L;
00765     }
00766     return (*i).second;
00767 }
00768
00769 const char *UWidget::GetTooltip(int cmd) const
00770 {
00771     std::map<int, UStr>::const_iterator i = m_tooltips.find(cmd);
00772     if(i == m_tooltips.end())
00773     {
00774         UAppConsole("Unable to find widget id : %d (file %s:%d)\n", cmd, __FILE__, __LINE__);
00775         return 0L;
00776     }
00777     return (*i).second;
00778 }
00779
00780 void UWidget::OnGetLoc(int cmd, URECT * r)
00781 {
00782     r->left = 0; // sanity
00783     r->right = 0;
00784     r->top = 0;
00785     r->bottom = 0;
00786
00787     void *w = GetWidget(cmd);
00788     if(w == 0L)
00789         return;
00790
00791 #if qMacAPP
00792     TView *view = (TView *)w;
00793     CViewRect mr = view->GetFrame();
00794     view->SuperViewToLocal(mr);
00795     view->LocalToRootView(mr);
00796     r->left = mr.left;
00797     r->right = mr.right;
00798     r->top = mr.top;
00799     r->bottom = mr.bottom;
00800 #endif
00801 #if qMacPP
00802     LPane *view = (LPane *)w;
00803     SPoint32 outLocation;
00804     SDimension16 outSize;
00805     view->GetFrameLocation(outLocation);
00806     view->GetFrameSize(outSize);
00807
00808     *r = URect(UPoint(outLocation.h, outLocation.v), USize(outSize.width, outSize.height));
00809 #endif
00810 #ifdef WIN32
00811     CRect mr;
00812     CWnd *wnd = (CWnd *)w;
00813     wnd->GetClientRect(mr);
00814     CWnd *parent = wnd->GetParent();
00815     if(parent != 0L)
00816     {
00817         wnd->ClientToScreen(mr);
00818         parent->ScreenToClient(mr);
00819     }
00820     r->left = mr.left;
00821     r->right = mr.right;
00822     r->top = mr.top;
00823     r->bottom = mr.bottom;
00824 #endif
00825 }
00826
00827 void UWidget::OnSetLoc(int cmd, const URECT * r)
00828 {
00829     void *w = GetWidget(cmd);
00830     if(w == 0L)
00831         return;
00832
00833 #if qMacAPP
00834     TView *view = (TView *)w;
00835     CViewRect mr(r->left, r->top, r->right, r->bottom);
00836     if(mr.right < mr.left)
00837         mr.right = mr.left;
00838     if(mr.bottom < mr.top)
00839         mr.bottom = mr.top;
00840     view->RootViewToLocal(mr);
00841     view->LocalToSuperView(mr);
00842     view->SetFrame(mr, true);
00843 #endif
00844 #if qMacPP
00845     LPane *view = (LPane *)w;
00846     SPoint32 oldLocation;
00847     view->GetFrameLocation(oldLocation);
00848     URect newDim(*r);
00849     UPoint offset = newDim.TopLeft() - UPoint(oldLocation.h, oldLocation.v);
00850     view->ResizeFrameTo(newDim.Width(), newDim.Height(), true);
00851     view->MoveBy(offset.x, offset.y, true);
00852 #endif
00853 #ifdef WIN32
00854     CRect wr(r->left, r->top, r->right, r->bottom);
00855     CWnd *wnd = (CWnd *)w;
00856     wnd->MoveWindow(wr, TRUE);
00857 #endif
00858 }
00859
00860 void UWidget::OnSetTooltip(int cmd, UCmdUI *pCmdUI)
00861 {
00862     const char *tooltip = GetTooltip(cmd);
00863     if(tooltip == 0L)
00864         return;
00865
00866     pCmdUI->SetTooltip(tooltip);
00867 }
00868
00869 bool UWidget::WidgetIsActive(int cmd) const
00870 {
00871     void *w = GetWidget(cmd);
00872     if(w == 0L)
00873         return false;
00874
00875 #ifdef WIN32
00876     CWnd *wnd = (CWnd *)w;
00877
00878     bool res = false;
00879
00880     CWnd* parent = wnd->GetOwner();
00881     if(parent && (HWND)*parent->GetFocus() == (HWND)*wnd)
00882         res = true;
00883
00884     return res;
00885 #endif
00886     return false;
00887 }
00888
00889 void UWidget::AddTooltip(int cmd, const char *tooltipID)
00890 {
00891     std::map<int, UStr>::value_type val(cmd, UStr(tooltipID));
00892     m_tooltips.insert(val);
00893 }
00894
00895 void UWidget::OnInitWidget(int cmd, void *widget)
00896 {
00897     std::map<int, void *>::value_type val(cmd, widget);
00898     m_widgets.insert(val);
00899
00900 #ifdef WIN32
00901
00902 #endif
00903 #if qMacPP
00904     LPane *view = (LPane *)widget;
00905     if(view != 0L)
00906     {
00907         // fetch the inside widgets and add them the the widget list
00908         static bool sSemaphore = false;
00909         USemaphore policeman(sSemaphore);
00910         if(!policeman.IsEnteredTwice())
00911         {
00912             macpp_fecthview(GetWidID(), view);
00913         }
00914
00915         LWindow *wind = dynamic_cast<LWindow*>(view);
00916         if(wind != 0L)
00917         {
00918             LPseudoWinAttachment *attach = NEW LPseudoWinAttachment(GetWidID());
00919             wind->AddAttachment(attach);
00920             macpp_linkbroadcasters(wind, attach);
00921
00922             SPaneInfo inPaneInfo;
00923             memset(&inPaneInfo, 0, sizeof(SPaneInfo));
00924             inPaneInfo.superView = wind;
00925             NEW UPseudoFakePane(inPaneInfo, attach);
00926
00927             // call the create callback
00928             UEventSendMessage(GetWidID(), EV_CREATE, 0, 0L);
00929         }
00930     }
00931 #endif
00932 #if qMacAPP
00933     TView *view = (TView *)widget;
00934     if(MA_MEMBER(view, TView))
00935     {
00936         // fetch the inside widgets and add them the the widget list
00937         static bool sSemaphore = false;
00938         USemaphore policeman(sSemaphore);
00939         if(!policeman.IsEnteredTwice())
00940         {
00941             macapp_fecthview(GetWidID(), view);
00942             //macapp_workaround_adlib_bug(view);
00943         }
00944
00945         if(MA_MEMBER(view, TWindow))
00946         {
00947             // add the pseudo behaviour which re-routes the events to the pseudo-widget
00948             TPseudoWinBehavior *psbehavior = dynamic_cast_AC(TPseudoWinBehavior*,
00949                 view->GetBehaviorWithIdentifier(TPseudoWinBehavior::kPseudoWinBehavior));
00950
00951             if(psbehavior == 0L)
00952             {
00953                 psbehavior = TH_new TPseudoWinBehavior;
00954                 view->AddBehavior(psbehavior);
00955             }
00956             psbehavior->SetPseudoWidget(GetWidID());
00957
00958             // add the pseudo adorner which intercepts the frame size changes
00959             TPseudoWinAdorner *psadorner = dynamic_cast_AC(TPseudoWinAdorner*,
00960                 view->AdornerWithID(TPseudoWinAdorner::kPseudoWinAdorner));
00961
00962             if(psadorner == 0L)
00963             {
00964                 psadorner = TH_new TPseudoWinAdorner;
00965                 view->AddAdorner(psadorner, kAdornLast, false);
00966             }
00967             psadorner->SetPseudoWidget(GetWidID());
00968
00969             // call the create callback
00970             UEventSendMessage(GetWidID(), EV_CREATE, 0, 0L);
00971         }
00972     }
00973 #endif
00974 #if qGTK
00975     static bool firstTime = true;
00976     if(firstTime)
00977     {
00978         // for the disable/enable handling notification (EV_UPDATEUI)
00979         gdk_event_handler_set((GdkEventFunc)gtkmaindoevent, NULL, NULL);
00980
00981         // listen focus events
00982         focus_in_signal_id = gtk_signal_lookup ("focus_in_event", GTK_TYPE_WIDGET);
00983         gtk_signal_add_emission_hook (focus_in_signal_id, gtkeventwatcher, NULL);
00984         focus_out_signal_id = gtk_signal_lookup ("focus_out_event", GTK_TYPE_WIDGET);
00985         gtk_signal_add_emission_hook (focus_out_signal_id, gtkeventwatcher, NULL);
00986
00987         firstTime = false;
00988     }
00989
00990     // so for every widget mapped, we'll be able to find the pseudo-widget associated with.
00991     gtk_object_set_data(GTK_OBJECT(widget), kUgtkDataToken, (gpointer)UMAKEINT(GetWidID(), cmd));
00992
00993     // we are only interesting about the main widgets here
00994     if(GTK_IS_WIDGET(widget))
00995     {
00996         if(cmd == kUMainWidget)
00997         {
00998             // extract and map to the pseudo widget the sub-widgets begining with 'kUgtkPrefixToken'
00999             g_datalist_foreach (&GTK_OBJECT(widget)->object_data, dataForeach, (gpointer)GetWidID());
01000
01001             // map the destroy callback
01002             gtk_signal_connect (GTK_OBJECT(widget), "destroy",
01003                                 GTK_SIGNAL_FUNC(gtkdestroy), (gpointer)this);
01004
01005             gtk_signal_connect (GTK_OBJECT (widget), "key_press_event",
01006                                 GTK_SIGNAL_FUNC(gtkkeypress), (gpointer)this);
01007
01008             // call the create callback
01009             UEventSendMessage(GetWidID(), EV_CREATE, 0, 0L);
01010         }
01011     }
01012
01013     if(GTK_IS_NOTEBOOK(widget))
01014     {
01015         gtk_signal_connect (GTK_OBJECT (widget), "switch_page",
01016                             GTK_SIGNAL_FUNC(gtkswitchpage),
01017                             (gpointer)UMAKEINT(GetWidID(), cmd));
01018     }
01019
01020     if(GTK_IS_BUTTON(widget))
01021     {
01022         gtk_signal_connect (GTK_OBJECT(widget), "clicked",
01023             GTK_SIGNAL_FUNC(gtkclicked), (gpointer)UMAKEINT(GetWidID(), cmd));
01024     }
01025
01026     if(GTK_IS_MENU_ITEM(widget))
01027     {
01028         gtk_signal_connect(GTK_OBJECT(widget), "activate",
01029             GTK_SIGNAL_FUNC(gtkmenuitemactivate), (gpointer)UMAKEINT(GetWidID(), cmd));
01030     }
01031
01032     if(GTK_IS_CLIST(widget))
01033     {
01034         gtk_signal_connect (GTK_OBJECT(widget), "select_row",
01035             GTK_SIGNAL_FUNC(gtkselectclist), (gpointer)UMAKEINT(GetWidID(), cmd));
01036
01037         gtk_signal_connect (GTK_OBJECT(widget), "click_column",
01038             GTK_SIGNAL_FUNC(gtkselectclistcolumn), (gpointer)UMAKEINT(GetWidID(), cmd));
01039
01040         gtk_signal_connect_after (GTK_OBJECT (widget), "button_press_event",
01041                                   GTK_SIGNAL_FUNC (gtkclistdblclick), (gpointer)UMAKEINT(GetWidID(), cmd));
01042     }
01043
01044     if(GTK_IS_DRAWING_AREA(widget))
01045     {
01046         gtk_signal_connect (GTK_OBJECT(widget), "expose_event",
01047                             GTK_SIGNAL_FUNC (gtkexposeevent), (gpointer)UMAKEINT(GetWidID(), cmd));
01048         gtk_widget_set_events (GTK_WIDGET(widget), GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK);
01049     }
01050
01051     if(GTK_IS_LAYOUT(widget))
01052     {
01053         gtk_signal_connect (GTK_OBJECT(widget), "expose_event",
01054                             GTK_SIGNAL_FUNC (gtkexposeevent), (gpointer)UMAKEINT(GetWidID(), cmd));
01055         gtk_widget_set_events (GTK_WIDGET(widget), GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK);
01056     }
01057 #endif /* qGTK */
01058 }
01059
01060 void UWidget::OnInitTabWidget(int cmd, int page, void *widget)
01061 {
01062 #if qGTK
01063     if(GTK_IS_WIDGET(widget))
01064     {
01065         // extract and map to the pseudo widget the sub-widgets begining with 'kUgtkPrefixToken'
01066         _dataTabForeach data = {GetWidID(), cmd, page};
01067         g_datalist_foreach (&GTK_OBJECT(widget)->object_data, dataTabForeach, (gpointer)&data);
01068     }
01069 #endif /* qGTK */
01070 }
01071
01072 int UWidget::OnGetState(int cmd)
01073 {
01074     void *w = GetWidget(cmd);
01075     if(w == 0L)
01076         return 0;
01077
01078     int state = 0; // sanity
01079
01080 #ifdef WIN32
01081     CWnd *wnd = (CWnd *)w;
01082
01083     if(wnd->IsKindOf(RUNTIME_CLASS(CPseudoRotButton)))
01084     {
01085         CPseudoRotButton *btn = (CPseudoRotButton *)wnd;
01086         state = btn->GetCurrent();
01087     }
01088     else if(wnd->IsKindOf(RUNTIME_CLASS(CPseudoToggle)))
01089     {
01090         CPseudoToggle *btn = (CPseudoToggle *)wnd;
01091         state = btn->GetState();
01092     }
01093     else if(wnd->IsKindOf(RUNTIME_CLASS(CButton)))
01094     {
01095         CButton *btn = (CButton *)wnd;
01096         state = btn->GetCheck() != 0;
01097     }
01098     else
01099     {
01100         CString s;
01101         wnd->GetWindowText(s);
01102         sscanf(s, "%d", &state);
01103     }
01104 #endif
01105 #if qGTK
01106     if(GTK_IS_TOGGLE_BUTTON(w))
01107     {
01108         state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)) != 0;
01109     }
01110     else if(GTK_IS_ENTRY(w))
01111     {
01112         gchar *text = gtk_entry_get_text(GTK_ENTRY(w));
01113         sscanf(text, "%d", &state);
01114     }
01115 #endif
01116 #if qMacPP
01117     LPane *view = (LPane *)w;
01118     LCheckBox *check;
01119     LRadioButton *rad;
01120     LEditText *edit;
01121     LStaticText *stat;
01122     LBevelButton *bevel;
01123     UPseudoRotButton *rot;
01124     LCheckBoxGroupBox *groupbox;
01125     LPageController *tabctrl;
01126     LTabsControl *tabctrl2;
01127     LControl *ctrl;
01128     if((check = dynamic_cast<LCheckBox *>(view)) != 0L)
01129     {
01130         state = check->GetValue() == Button_On ? 1 : 0;
01131     }
01132     else if((rad = dynamic_cast<LRadioButton *>(view)) != 0L)
01133     {
01134         state = rad->GetValue() == Button_On ? 1 : 0;
01135     }
01136     else if((edit = dynamic_cast<LEditText *>(view)) != 0L)
01137     {
01138         LStr255 pstr;
01139         edit->GetText(pstr);
01140         state = (SInt32)pstr;
01141     }
01142     else if((stat = dynamic_cast<LStaticText *>(view)) != 0L)
01143     {
01144         LStr255 pstr;
01145         stat->GetText(pstr);
01146         state = (SInt32)pstr;
01147     }
01148     else if((groupbox = dynamic_cast<LCheckBoxGroupBox *>(view)) != 0L)
01149     {
01150         state = groupbox->GetValue() == Button_On ? 1 : 0;
01151     }
01152     else if((rot = dynamic_cast<UPseudoRotButton *>(view)) != 0L)
01153     {
01154         state = rot->GetCurrentState();
01155     }
01156     else if((bevel = dynamic_cast<LBevelButton *>(view)) != 0L)
01157     {
01158         state = bevel->GetValue() == Button_On ? 1 : 0;
01159     }
01160     else if((tabctrl = dynamic_cast<LPageController *>(view)) != 0L)
01161     {
01162         state = tabctrl->GetCurrentPageIndex() - 1;
01163     }
01164     else if((tabctrl2 = dynamic_cast<LTabsControl *>(view)) != 0L)
01165     {
01166         state = tabctrl2->GetValue() - 1;
01167     }
01168     else if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01169     {
01170         state = ctrl->GetValue();
01171     }
01172 #endif
01173 #if qMacAPP
01174     TView *view = (TView *)w;
01175     if(MA_MEMBER(view, TCheckBox))
01176     {
01177         TCheckBox *check = (TCheckBox *)view;
01178         state = check->GetState();
01179     }
01180     else if(MA_MEMBER(view, TRadio))
01181     {
01182         TRadio *rad = (TRadio *)view;
01183         state = rad->GetState();
01184     }
01185     else if(MA_MEMBER(view, TNumberText))
01186     {
01187         TNumberText *num = (TNumberText *)view;
01188         state = num->GetValue();
01189     }
01190 #endif
01191
01192     return state;
01193 }
01194
01195 void UWidget::OnGetFloat(int cmd, float *f)
01196 {
01197     *f = 0.0; // sanity
01198
01199     void *w = GetWidget(cmd);
01200     if(w == 0L)
01201         return;
01202
01203 #if qMacPP
01204     LPane *view = (LPane *)w;
01205     LEditText *edit;
01206     LStaticText *stat;
01207     if((edit = dynamic_cast<LEditText *>(view)) != 0L)
01208     {
01209         LStr255 pstr;
01210         edit->GetText(pstr);
01211         *f = (double)pstr;
01212     }
01213     else if((stat = dynamic_cast<LStaticText *>(view)) != 0L)
01214     {
01215         LStr255 pstr;
01216         stat->GetText(pstr);
01217         *f = (double)pstr;
01218     }
01219 #endif
01220 #if qMacAPP
01221     TView *view = (TView *)w;
01222     if(MA_MEMBER(view, TPseudoDoubleNumberText))
01223     {
01224         TPseudoDoubleNumberText *num = (TPseudoDoubleNumberText *)view;
01225         *f = num->GetValue();
01226     }
01227 #endif
01228 #ifdef WIN32
01229     CWnd *wnd = (CWnd *)w;
01230
01231     CString s;
01232     wnd->GetWindowText(s);
01233     sscanf(s, "%f", f);
01234 #endif
01235 }
01236
01237 void UWidget::OnSetState(int cmd, int state)
01238 {
01239     void *w = GetWidget(cmd);
01240     if(w == 0L)
01241         return;
01242
01243 #ifdef WIN32
01244     CWnd *wnd = (CWnd *)w;
01245
01246     if(wnd->IsKindOf(RUNTIME_CLASS(CPseudoRotButton)))
01247     {
01248         CPseudoRotButton *btn = (CPseudoRotButton *)wnd;
01249         btn->DoRotate(state);
01250     }
01251     else if(wnd->IsKindOf(RUNTIME_CLASS(CPseudoToggle)))
01252     {
01253         CPseudoToggle *btn = (CPseudoToggle *)wnd;
01254         btn->SetState(state);
01255     }
01256     else if(wnd->IsKindOf(RUNTIME_CLASS(CButton)))
01257     {
01258         CButton *btn = (CButton *)wnd;
01259         btn->SetCheck(state != 0);
01260     }
01261     else
01262     {
01263         USemaphore policeman(m_noDispatch);
01264         char tmp[100];
01265         sprintf(tmp, "%d", state);
01266         wnd->SetWindowText(tmp);
01267     }
01268 #endif
01269 #if qGTK
01270     if(GTK_IS_TOGGLE_BUTTON(w))
01271     {
01272         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), state != 0);
01273     }
01274     else if(GTK_IS_ENTRY(w))
01275     {
01276         char tmp[20];
01277         sprintf(tmp, "%d", state);
01278         gtk_entry_set_text(GTK_ENTRY(w), tmp);
01279     }
01280 #endif
01281 #if qMacPP
01282     USemaphore policeman(gTurnOffBroadcast);
01283
01284     LPane *view = (LPane *)w;
01285     LCheckBox *check;
01286     LRadioButton *rad;
01287     LEditText *edit;
01288     LStaticText *stat;
01289     UPseudoRotButton *rot;
01290     LCheckBoxGroupBox *groupbox;
01291     LPageController *tabctrl;
01292     LTabsControl *tabctrl2;
01293     LControl *ctrl;
01294     if((check = dynamic_cast<LCheckBox *>(view)) != 0L)
01295     {
01296         check->SetValue(state ? Button_On : Button_Off);
01297     }
01298     else if((rad = dynamic_cast<LRadioButton *>(view)) != 0L)
01299     {
01300         rad->SetValue(state ? Button_On : Button_Off);
01301     }
01302     else if((groupbox = dynamic_cast<LCheckBoxGroupBox *>(view)) != 0L)
01303     {
01304         groupbox->SetValue(state ? Button_On : Button_Off);
01305     }
01306     else if((edit = dynamic_cast<LEditText *>(view)) != 0L)
01307     {
01308         LStr255 pstr((SInt32)state);
01309         edit->SetText(pstr);
01310     }
01311     else if((stat = dynamic_cast<LStaticText *>(view)) != 0L)
01312     {
01313         LStr255 pstr((SInt32)state);
01314         stat->SetText(pstr);
01315     }
01316     else if((rot = dynamic_cast<UPseudoRotButton *>(view)) != 0L)
01317     {
01318         rot->DoRotate(state);
01319     }
01320     else if((tabctrl = dynamic_cast<LPageController *>(view)) != 0L)
01321     {
01322         tabctrl->SetSelectedPageButtonByIndex(state + 1, false);
01323     }
01324     else if((tabctrl2 = dynamic_cast<LTabsControl *>(view)) != 0L)
01325     {
01326         tabctrl2->SetValue(state + 1);
01327     }
01328     else if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01329     {
01330         ctrl->SetValue(state);
01331     }
01332 #endif
01333 #if qMacAPP
01334     TView *view = (TView *)w;
01335     if(MA_MEMBER(view, TCheckBox))
01336     {
01337         TCheckBox *check = (TCheckBox *)view;
01338         check->SetState(state, true);
01339     }
01340     else if(MA_MEMBER(view, TRadio))
01341     {
01342         TRadio *rad = (TRadio *)view;
01343         rad->SetState(state, true);
01344     }
01345     else if(MA_MEMBER(view, TNumberText))
01346     {
01347         TNumberText *num = (TNumberText *)view;
01348         num->SetValue(state, true);
01349     }
01350     else if(MA_MEMBER(view, TPseudoRotateIconButton))
01351     {
01352         TPseudoRotateIconButton *rot = (TPseudoRotateIconButton *)view;
01353         rot->DoRotate(state);
01354     }
01355     else if(MA_MEMBER(view, TProgressIndicator))
01356     {
01357         TProgressIndicator *progress = (TProgressIndicator *)view;
01358         progress->SetValue(state, true);
01359     }
01360 #endif
01361 }
01362
01363 void UWidget::OnSetFloat(int cmd, const float *f)
01364 {
01365     void *w = GetWidget(cmd);
01366     if(w == 0L)
01367         return;
01368
01369 #if qMacAPP
01370     TView *view = (TView *)w;
01371     if(MA_MEMBER(view, TPseudoDoubleNumberText))
01372     {
01373         TPseudoDoubleNumberText *num = (TPseudoDoubleNumberText *)view;
01374         num->SetValue(*f, true);
01375     }
01376 #endif
01377 #if qMacPP
01378     USemaphore policeman(gTurnOffBroadcast);
01379
01380     LPane *view = (LPane *)w;
01381     LEditText *edit;
01382     LStaticText *stat;
01383     if((edit = dynamic_cast<LEditText *>(view)) != 0L)
01384     {
01385         LStr255 pstr((long double)*f, "\p#####.##");
01386         edit->SetText(pstr);
01387     }
01388     else if((stat = dynamic_cast<LStaticText *>(view)) != 0L)
01389     {
01390         LStr255 pstr((long double)*f, "\p#####.##");
01391         stat->SetText(pstr);
01392     }
01393 #endif
01394 #ifdef WIN32
01395     USemaphore policeman(m_noDispatch);
01396     CWnd *wnd = (CWnd *)w;
01397
01398     char tmp[100];
01399     sprintf(tmp, "%f", *f);
01400     wnd->SetWindowText(tmp);
01401 #endif
01402 }
01403
01404 void UWidget::OnEnableCmd(int cmd, int state)
01405 {
01406     void *w = GetWidget(cmd);
01407     if(w == 0L)
01408         return;
01409
01410 #if qMacPP
01411     LPane *view = (LPane *)w;
01412     if(state)
01413         view->Enable();
01414     else
01415         view->Disable();
01416 #endif
01417 #if qMacAPP
01418     TView *view = (TView *)w;
01419     if(MA_MEMBER(view, TView))
01420     {
01421         view->SetActiveState(state != 0, true);
01422     }
01423 #endif
01424 #if qGTK
01425     if(GTK_IS_WIDGET(w))
01426     {
01427         gtk_widget_set_sensitive(GTK_WIDGET(w), state != 0);
01428     }
01429 #endif
01430 #ifdef WIN32
01431     CWnd *wnd = (CWnd *)w;
01432
01433     wnd->EnableWindow(state != 0);
01434 #endif
01435 }
01436
01437 void UWidget::OnChgFocus(int cmd)
01438 {
01439     void *w = GetWidget(cmd);
01440     if(w == 0L)
01441         return;
01442
01443 #if qMacPP
01444     LPane *pane = (LPane *)w;
01445     LCommander *target = dynamic_cast<LCommander *>(pane);
01446     if(target != 0L)
01447     {
01448         LCommander::SwitchTarget(target);
01449     }
01450 #endif
01451 #if qMacAPP
01452     TView *view = (TView *)w;
01453     if(MA_MEMBER(view, TView))
01454     {
01455         if(view->GetWindow() != 0L)
01456             view->GetWindow()->SetWindowTarget(view);
01457     }
01458 #endif
01459 #if qGTK
01460     if(GTK_IS_WIDGET(w))
01461     {
01462         gtk_widget_grab_focus(GTK_WIDGET(w)); // TODO doesn't work
01463     }
01464 #endif
01465 #ifdef WIN32
01466     CWnd *wnd = (CWnd *)w;
01467
01468     wnd->SetFocus();
01469 #endif
01470 }
01471
01472 void UWidget::OnInvalidate(int cmd)
01473 {
01474     void *w = GetWidget(cmd);
01475     if(w == 0L)
01476         return;
01477
01478 #if qMacAPP
01479     TView *view = (TView *)w;
01480     if(MA_MEMBER(view, TView))
01481     {
01482         view->ForceRedraw();
01483     }
01484 #endif
01485 #if qMacPP
01486     LPane *pane = (LPane *)w;
01487     pane->Refresh();
01488 #endif
01489 #ifdef WIN32
01490     CWnd *wnd = (CWnd *)w;
01491
01492     wnd->Invalidate();
01493 #endif
01494 }
01495
01496 void UWidget::OnRedraw(int cmd)
01497 {
01498     void *w = GetWidget(cmd);
01499     if(w == 0L)
01500         return;
01501
01502 #if qMacAPP
01503     TView *view = (TView *)w;
01504     if(MA_MEMBER(view, TView))
01505     {
01506         view->ForceRedraw();
01507     }
01508 #endif
01509 #if qMacPP
01510     LPane *pane = (LPane *)w;
01511     pane->Draw(nil);
01512 #endif
01513 #ifdef WIN32
01514     CWnd *wnd = (CWnd *)w;
01515
01516     wnd->Invalidate();
01517 #endif
01518 }
01519
01520 void UWidget::OnSetText(int cmd, const char *text)
01521 {
01522     void *w = GetWidget(cmd);
01523     if(w == 0L)
01524         return;
01525
01526 #ifdef WIN32
01527     USemaphore policeman(m_noDispatch);
01528     CWnd *wnd = (CWnd *)w;
01529     wnd->SetWindowText(text);
01530 #endif
01531 #if qGTK
01532     if(GTK_IS_WINDOW(w))
01533     {
01534         gtk_window_set_title(GTK_WINDOW(w), text);
01535     }
01536     else if(GTK_IS_BUTTON(w))
01537     {
01538         GtkLabel *label = getLabelFromContainer(GTK_CONTAINER(w));
01539         if(label != 0L)
01540             gtk_label_set_text(label, text);
01541         else
01542             g_warning("Cannot find the label of '%s'\n", gtk_widget_get_name(GTK_WIDGET(w)));
01543     }
01544     else if(GTK_IS_TEXT(w))
01545     {
01546         GtkText *t = GTK_TEXT(w);
01547         gtk_text_set_point(t, 0);
01548         gtk_text_forward_delete(t, gtk_text_get_length(t));
01549         gtk_text_insert(t, 0L, 0L, 0L, text, -1);
01550     }
01551     else if(GTK_IS_ENTRY(w))
01552     {
01553         gtk_entry_set_text(GTK_ENTRY(w), text);
01554     }
01555     else if(GTK_IS_COMBO(w))
01556     {
01557         gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(w)->entry), text);
01558     }
01559     else if(GTK_IS_LABEL(w))
01560     {
01561         GtkLabel *t = GTK_LABEL(w);
01562         gtk_label_set_text(t, text);
01563     }
01564 #endif
01565 #if qMacPP
01566     USemaphore policeman(gTurnOffBroadcast);
01567
01568     LPane *view = (LPane *)w;
01569     LTextEditView *txt;
01570     if((txt = dynamic_cast<LTextEditView *>(view)) != 0L)
01571     {
01572         txt->SetTextPtr((Ptr)text, strlen(text));
01573     }
01574     else
01575     {
01576         LStr255 pstr(text);
01577         LStr255 oldstr;
01578         view->GetDescriptor(oldstr);
01579         if(oldstr != pstr)
01580             view->SetDescriptor(pstr);
01581     }
01582 #endif
01583 #if qMacAPP
01584     TView *view = (TView *)w;
01585     if(MA_MEMBER(view, TCtlMgr))
01586     {
01587         TCtlMgr *ctrl = (TCtlMgr *)view;
01588         CStr255_AC pstr(text);
01589         ctrl->SetText(pstr, true);
01590     }
01591     else if(MA_MEMBER(view, TStaticText))
01592     {
01593         TStaticText *ctrl = (TStaticText *)view;
01594         CStr255_AC pstr(text);
01595         ctrl->SetText(pstr, true);
01596     }
01597     else if(MA_MEMBER(view, TWindow))
01598     {
01599         TWindow *ctrl = (TWindow *)view;
01600         CStr255_AC pstr(text);
01601         ctrl->SetTitle(pstr);
01602     }
01603 #endif
01604 }
01605
01606 void UWidget::OnGetText(int cmd, UStr *text)
01607 {
01608     *text = ""; // sanity
01609
01610     void *w = GetWidget(cmd);
01611     if(w == 0L)
01612         return;
01613
01614 #ifdef WIN32
01615     CWnd *wnd = (CWnd *)w;
01616
01617     CString s;
01618     wnd->GetWindowText(s);
01619     *text = s;
01620 #endif
01621 #if qGTK
01622     if(GTK_IS_WINDOW(w))
01623     {
01624         *text = GTK_WINDOW(w)->title;
01625     }
01626     else if(GTK_IS_BUTTON(w))
01627     {
01628         GtkLabel *label = getLabelFromContainer(GTK_CONTAINER(w));
01629         if(label != 0L)
01630         {
01631             gchar *str;
01632             gtk_label_get(label, &str);
01633             if(str != 0L)
01634                 *text = str;
01635         }
01636         else
01637             g_warning("Cannot find the label of '%s'\n", gtk_widget_get_name(GTK_WIDGET(w)));
01638     }
01639     else if(GTK_IS_ENTRY(w))
01640     {
01641         *text = gtk_entry_get_text(GTK_ENTRY(w));
01642     }
01643     else if(GTK_IS_COMBO(w))
01644     {
01645         *text = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(w)->entry));
01646     }
01647     else if(GTK_IS_TEXT(w))
01648     {
01649         GtkText *t = GTK_TEXT(w);
01650         size_t size = gtk_text_get_length(t);
01651         if(size > 0)
01652             text->set((char *)t->text.ch, size);
01653     }
01654     else if(GTK_IS_LABEL(w))
01655     {
01656         GtkLabel *t = GTK_LABEL(w);
01657         gchar *str;
01658         gtk_label_get(t, &str);
01659         if(str != 0L)
01660             *text = str;
01661     }
01662 #endif
01663 #if qMacPP
01664     LPane *view = (LPane *)w;
01665     LTextEditView *txt;
01666     if((txt = dynamic_cast<LTextEditView *>(view)) != 0L)
01667     {
01668         LStr255 pstr;
01669         Handle hdl = txt->GetTextHandle();
01670         text->set((const char *)*hdl, ::GetHandleSize(hdl));
01671     }
01672     else
01673     {
01674         LStr255 pstr;
01675         view->GetDescriptor(pstr);
01676         *text = pstr;
01677     }
01678 #endif
01679 #if qMacAPP
01680     TView *view = (TView *)w;
01681     if(MA_MEMBER(view, TCtlMgr))
01682     {
01683         TCtlMgr *ctrl = (TCtlMgr *)view;
01684         CStr255_AC pstr = ctrl->GetText();
01685         *text = pstr;
01686     }
01687     else if(MA_MEMBER(view, TStaticText))
01688     {
01689         TStaticText *ctrl = (TStaticText *)view;
01690         CStr255_AC pstr = ctrl->GetText();
01691         *text = pstr;
01692     }
01693     else if(MA_MEMBER(view, TWindow))
01694     {
01695         TWindow *ctrl = (TWindow *)view;
01696         CStr255_AC pstr = ctrl->GetTitle();
01697         *text = pstr;
01698     }
01699 #endif
01700 }
01701
01702 void UWidget::OnShowWidget(int cmd, int state)
01703 {
01704     void *w = GetWidget(cmd);
01705     if(w == 0L)
01706         return;
01707
01708 #ifdef WIN32
01709     CWnd *wnd = (CWnd *)w;
01710
01711     wnd->ShowWindow(state ? SW_SHOWNORMAL : SW_HIDE);
01712 #endif
01713 #if qGTK
01714     GtkWidget *wid = (GtkWidget *)w;
01715     if(state)
01716         gtk_widget_show(wid);
01717     else
01718         gtk_widget_hide(wid);
01719 #endif
01720 #if qMacAPP
01721     TView *view = (TView *)w;
01722     view->Show(state != 0, true);
01723 #endif
01724 #if qMacPP
01725     LPane *view = (LPane *)w;
01726     if(state)
01727         view->Show();
01728     else
01729         view->Hide();
01730 #endif
01731 }
01732
01733
01734 void UWidget::OnSetSlider(int cmd, int pos)
01735 {
01736     void *w = GetWidget(cmd);
01737     if(w == 0L)
01738         return;
01739
01740 #ifdef WIN32
01741     CWnd *wnd = (CWnd *)w;
01742
01743     if(wnd->IsKindOf(RUNTIME_CLASS(CSliderCtrl)))
01744     {
01745         CSliderCtrl *slider = (CSliderCtrl *)wnd;
01746         slider->SetPos(pos);
01747     }
01748     else if(wnd->IsKindOf(RUNTIME_CLASS(CScrollBar)))
01749     {
01750         CScrollBar *scroll = (CScrollBar *)wnd;
01751         scroll->SetScrollPos(pos);
01752     }
01753 #endif
01754 #if qMacAPP
01755     TView *view = (TView *)w;
01756     if(MA_MEMBER(view, TSlider) || MA_MEMBER(view, TScrollBar))
01757     {
01758         TCtlMgr *ctrl = (TCtlMgr *)view;
01759         ctrl->SetValue(pos, true);
01760     }
01761 #endif
01762 #if qMacPP
01763     USemaphore policeman(gTurnOffBroadcast);
01764
01765     LPane *view = (LPane *)w;
01766     LControl *ctrl;
01767     if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01768     {
01769         ctrl->SetValue(pos);
01770     }
01771 #endif
01772 }
01773
01774
01775 void UWidget::OnGetSliderProperty(int cmd, USLIDER *prop)
01776 {
01777     void *w = GetWidget(cmd);
01778     if(w == 0L)
01779         return;
01780
01781 #ifdef WIN32
01782     CWnd *wnd = (CWnd *)w;
01783
01784     if(wnd->IsKindOf(RUNTIME_CLASS(CSliderCtrl)))
01785     {
01786         CSliderCtrl *slider = (CSliderCtrl *)wnd;
01787         prop->max = slider->GetRangeMax();
01788         prop->min = slider->GetRangeMin();
01789         prop->inc = slider->GetPageSize();
01790         prop->pos = slider->GetPos();
01791     }
01792     else if(wnd->IsKindOf(RUNTIME_CLASS(CScrollBar)))
01793     {
01794         SCROLLINFO info;
01795         CScrollBar *scroll = (CScrollBar *)wnd;
01796         VERIFY(scroll->GetScrollInfo(&info));
01797         prop->max = info.nMax;
01798         prop->min = info.nMin;
01799         prop->inc = info.nPage;
01800         prop->pos = info.nPos;
01801     }
01802 #endif
01803 #if qMacAPP
01804     TView *view = (TView *)w;
01805     if(MA_MEMBER(view, TSlider) || MA_MEMBER(view, TScrollBar))
01806     {
01807         TCtlMgr *ctrl = (TCtlMgr *)view;
01808         prop->max = ctrl->GetMaximum();
01809         prop->min = ctrl->GetMinimum();
01810         if(MA_MEMBER(ctrl, TPseudoScrollBar))
01811             prop->inc = ((TPseudoScrollBar *)ctrl)->fPageStep;
01812         else
01813             prop->inc = 1;
01814         prop->pos = ctrl->GetValue();
01815     }
01816 #endif
01817 #if qMacPP
01818     LPane *view = (LPane *)w;
01819     LControl *ctrl;
01820     if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01821     {
01822         prop->max = ctrl->GetMaxValue();
01823         prop->min = ctrl->GetMinValue();
01824         LPseudoWinAttachment *attach = macpp_getattachwindow(this);
01825         prop->inc = attach != 0L ? attach->GetPageValue(cmd) : 1;
01826         prop->pos = ctrl->GetValue();
01827     }
01828 #endif
01829 }
01830
01831 void UWidget::OnSetSliderProperty(int cmd, const USLIDER *prop)
01832 {
01833     void *w = GetWidget(cmd);
01834     if(w == 0L)
01835         return;
01836
01837 #ifdef WIN32
01838     CWnd *wnd = (CWnd *)w;
01839
01840     if(wnd->IsKindOf(RUNTIME_CLASS(CSliderCtrl)))
01841     {
01842         CSliderCtrl *slider = (CSliderCtrl *)wnd;
01843         slider->SetRange(prop->min, prop->max);
01844         slider->SetPos(prop->pos);
01845         slider->SetPageSize(prop->inc);
01846     }
01847     else if(wnd->IsKindOf(RUNTIME_CLASS(CScrollBar)))
01848     {
01849         SCROLLINFO info;
01850         memset(&info, 0, sizeof(info));
01851         info.cbSize = sizeof(info);
01852         info.fMask = SIF_DISABLENOSCROLL | SIF_PAGE | SIF_POS | SIF_RANGE;
01853         info.nMax = prop->max;
01854         info.nMin = prop->min;
01855         info.nPos = prop->pos;
01856         info.nPage = prop->inc;
01857         if(info.nPage > (info.nMax - info.nMin))
01858             info.nPage = (info.nMax - info.nMin) / 2;
01859         CScrollBar *scroll = (CScrollBar *)wnd;
01860         VERIFY(scroll->SetScrollInfo(&info));
01861         if(prop->max != prop->min)
01862             scroll->EnableWindow(TRUE);
01863     }
01864 #endif
01865 #if qMacAPP
01866     TView *view = (TView *)w;
01867     if(MA_MEMBER(view, TSlider) || MA_MEMBER(view, TScrollBar))
01868     {
01869         TCtlMgr *ctrl = (TCtlMgr *)view;
01870         ctrl->SetValues(prop->pos, prop->min, prop->max, true);
01871         if(MA_MEMBER(ctrl, TPseudoScrollBar))
01872             ((TPseudoScrollBar *)ctrl)->fPageStep = prop->inc;
01873     }
01874 #endif
01875 #if qMacPP
01876     USemaphore policeman(gTurnOffBroadcast);
01877
01878     LPane *view = (LPane *)w;
01879     LControl *ctrl;
01880     if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01881     {
01882         ctrl->SetMaxValue(prop->max);
01883         ctrl->SetMinValue(prop->min);
01884         ctrl->SetValue(prop->pos);
01885         LPseudoWinAttachment *attach = macpp_getattachwindow(this);
01886         if(attach != 0L)
01887             attach->SetPageValue(cmd, prop->inc);
01888     }
01889 #endif
01890 }
01891
01892 void UWidget::AddTimer(long lap, int cmd)
01893 {
01894     UTimer timer(lap, ::UTickCount(), cmd);
01895     m_timers.push_back(timer);
01896 }
01897
01898 void UWidget::RemoveTimer(int cmd)
01899 {
01900     std::vector<UTimer>::iterator i;
01901     for(i = m_timers.begin(); i != m_timers.end(); i++)
01902     {
01903         if((*i).m_cmd == cmd)
01904         {
01905             (*i).m_cmd = 0; // delay removing
01906             break;
01907         }
01908     }
01909 }
01910
01911 std::vector<UTimer> & UWidget::GetTimers(void)
01912 {
01913     // removed the delayed items
01914     std::vector<UTimer>::iterator i;
01915     for(i = m_timers.begin(); i != m_timers.end(); ++i)
01916     {
01917         if((*i).m_cmd == 0)
01918         {
01919             m_timers.erase(i);
01920             break;
01921         }
01922     }
01923
01924     return m_timers;
01925 }
01926
01927 void UWidget::OnUpdateUI()
01928 {
01929     std::map<int, void *>::const_iterator i;
01930     for(i = m_widgets.begin(); i != m_widgets.end(); ++i)
01931     {
01932         UCmdUI pUI((*i).first);
01933         pUI.m_widget = (*i).second;
01934         UEventSendMessage(GetWidID(), EV_UPDTCMD, pUI.m_nID, &pUI);
01935     }
01936 }
01937
01938 bool UWidget::DoModal(int id)
01939 {
01940     bool result = false;
01941
01942 #if !defined(qMacAPP) && !defined(qMacPP) && !defined(WIN32)
01943     void *w = GetWidget(kUMainWidget);
01944     if(w == 0L)
01945     {
01946         UAppConsole("Unable to find widget id : %d (file %s:%d)\n", kUMainWidget, __FILE__, __LINE__);
01947         return result;
01948     }
01949 #endif // !qMacAPP && !WIN32
01950
01951 #if qGTK || qMacPP
01952     if(m_modalLoop)
01953     {
01954         UAppConsole("Trying to break a modal state\n");
01955         return result;
01956     }
01957 #endif
01958
01959 #ifdef WIN32
01960     CPseudoDlg dlg(id, this);
01961     m_curModal = &dlg;
01962     result = dlg.DoModal() == IDOK;
01963     if(!result)
01964         Dismiss();
01965     m_curModal = 0L;
01966 #endif
01967 #if qMacAPP
01968     TWindow *view = gViewServer->NewTemplateWindow(id, nil);
01969     ThrowIfNULL_AC(view);
01970
01971     UEventSendMessage(GetWidID(), EV_INIT_WIDGET, kUMainWidget, view);
01972
01973     DoDataExchange(true);
01974     IDType resid = view->PoseModally();
01975
01976     TDialogBehavior* dlgb;
01977     if((dlgb = view->GetDialogBehavior()) != 0L)
01978     {
01979         result = resid == dlgb->fDefaultItem;
01980     }
01981
01982     if(result)
01983         DoDataExchange(false);
01984     else
01985         Dismiss();
01986
01987     view->Close();
01988 #endif
01989 #if qMacPP
01990     StDialogHandler theHandler(id, LCommander::GetTopCommander());
01991     LWindow *theDialog = theHandler.GetDialog();
01992
01993     if(theDialog != 0L)
01994     {
01995         UEventSendMessage(GetWidID(), EV_INIT_WIDGET, kUMainWidget, theDialog);
01996
01997         DoDataExchange(true);
01998         theDialog->Show();
01999         theHandler.SetSleepTime(0);
02000
02001         m_modalLoop = true;
02002         MessageT hitMessage;
02003         while (m_modalLoop)
02004         {       // Let DialogHandler process events
02005             hitMessage = theHandler.DoDialog();
02006
02007             if (hitMessage == msg_OK || hitMessage == msg_Cancel)
02008                 break;
02009         }
02010
02011         result = m_modalLoop ? hitMessage == msg_OK : m_modalRes;
02012
02013         if(result)
02014             DoDataExchange(false);
02015         else
02016             Dismiss();
02017
02018         //theDialog->Hide();
02019         //theDialog->DoClose();
02020     }
02021 #endif
02022 #if qGTK
02023     if(GTK_IS_WINDOW(w))
02024     {
02025         // emulate the click in tab 1
02026         std::map<int, UWidget *>::iterator i;
02027         for(i = m_tabs.begin(); i != m_tabs.end(); ++i)
02028         {
02029             int cmdid = ULOWORD((*i).first);
02030             int pagenum = UHIWORD((*i).first);
02031             if(pagenum == 0)
02032             {
02033                 UEventSendMessage(GetWidID(), EV_PAGE_CHANGED, UMAKEINT(cmdid, pagenum), 0L);
02034                 break;
02035             }
02036         }
02037         gtk_signal_connect(GTK_OBJECT(w),"delete_event", GTK_SIGNAL_FUNC(gtkcancel), this);
02038         DoDataExchange(true);
02039         gtk_widget_show(GTK_WIDGET(w));
02040         m_modalLoop = true;
02041         gtk_grab_add (GTK_WIDGET(w));
02042         while (m_modalLoop)
02043         {
02044             gtk_main_iteration_do(TRUE);
02045         }
02046         gtk_grab_remove (GTK_WIDGET(w));
02047         result = m_modalRes;
02048         if(result)
02049         {
02050             UEventSendMessage(GetWidID(), EV_PAGE_CHANGED, UMAKEINT(0, -1), 0L);
02051             DoDataExchange(false);
02052         }
02053         else
02054             Dismiss();
02055         gtk_widget_destroy(GTK_WIDGET(w));
02056     }
02057     else
02058         g_warning("Trying to modal on a non-window\n");
02059 #endif
02060
02061     return result;
02062 }
02063
02064 void UWidget::EndModal(bool result)
02065 {
02066     m_modalRes = result;
02067 #if qGTK || qMacPP
02068     if(!m_modalLoop)
02069         UAppConsole("EndModal called twice\n");
02070
02071     m_modalLoop = false;
02072 #endif
02073 #if qMacAPP
02074     void *w = GetWidget(kUMainWidget);
02075     if(w == 0L)
02076         return;
02077
02078     TWindow *wind = (TWindow *)w;
02079     TDialogBehavior* dlgb;
02080     if(MA_MEMBER(wind, TWindow) && (dlgb = wind->GetDialogBehavior()) != 0L)
02081     {
02082         wind->Dismiss(result ? dlgb->fDefaultItem : dlgb->fCancelItem, result);
02083     }
02084 #endif
02085 #ifdef WIN32
02086     if(m_curModal != 0L)
02087     {
02088         if (result && !m_curModal->UpdateData(TRUE))
02089         {
02090             TRACE0("UpdateData failed during dialog termination.\n");
02091             // the UpdateData routine will set focus to correct item
02092             return;
02093         }
02094         m_curModal->EndDialog(result ? IDOK : IDCANCEL);
02095     }
02096 #endif
02097 }
02098
02099 void UWidget::OnChgCursor(int cmd, UCURSOR cursor)
02100 {
02101     void *w = GetWidget(cmd);
02102     if(w == 0L)
02103         return;
02104
02105 #if qGTK
02106     if(GTK_IS_WIDGET(w) && GTK_WIDGET(w)->window != 0L)
02107     {
02108         static GdkCursor *cursor_arrow;
02109         static GdkCursor *cursor_watch;
02110         if(cursor_arrow == 0L)
02111         {
02112             cursor_arrow = gdk_cursor_new (GDK_ARROW);
02113             cursor_watch = gdk_cursor_new (GDK_WATCH);
02114         }
02115         if(cursor == uCursArrow)
02116             gdk_window_set_cursor (GTK_WIDGET(w)->window, cursor_arrow);
02117         else if(cursor == uCursWatch)
02118             gdk_window_set_cursor (GTK_WIDGET(w)->window, cursor_watch);
02119     }
02120 #endif
02121 }
02122
02123 void UWidget::OnTreeResetAll(int cmd)
02124 {
02125     void *w = GetWidget(cmd);
02126     if(w == 0L)
02127         return;
02128
02129 #if qGTK
02130     if(!GTK_IS_TREE(w))
02131         return;
02132
02133     GtkTree *tree = GTK_TREE(w);
02134     GList *list = g_list_copy(tree->children);
02135     GList *head = list;
02136     while(list != 0L)
02137     {
02138         GtkWidget *wid = GTK_WIDGET(list->data);
02139         gtk_container_remove(GTK_CONTAINER(tree), wid);
02140         list = (GList *)g_list_next(list);
02141     }
02142     g_list_free(head);
02143 #endif
02144 }
02145
02146 void UWidget::OnTreeInsert(int cmd, UTREE_INSERT *data)
02147 {
02148     data->result = 0L; // sanity
02149
02150     void *w = GetWidget(cmd);
02151     if(w == 0L)
02152         return;
02153
02154 #if qGTK
02155     if(!GTK_IS_TREE(w))
02156         return;
02157
02158     GtkTree *root;
02159     if(data->parent == 0L)
02160         root = GTK_TREE(w);
02161     else
02162     {
02163         GtkTreeItem *item = GTK_TREE_ITEM(data->parent);
02164
02165         if(item->subtree != 0L)
02166             root = GTK_TREE(item->subtree);
02167         else
02168         {
02169             root = GTK_TREE(gtk_tree_new());
02170             gtk_object_set_data(GTK_OBJECT(root), "rf_treeparent", item);
02171             gtk_tree_set_selection_mode (root, GTK_SELECTION_BROWSE); // TODO : find out it with the root
02172             gtk_tree_set_view_mode (root, GTK_TREE_VIEW_ITEM); // TODO : find out it with the root
02173             gtk_tree_item_set_subtree (item, GTK_WIDGET(root));
02174         }
02175     }
02176     GtkTreeItem *item = gtknewtreeitem(data->title, data->icon == 0L ? 0L : GTK_PIXMAP(data->icon));
02177     gtk_object_set_data(GTK_OBJECT(item), "rf_treeitemdata", data->data);
02178     gtk_signal_connect(GTK_OBJECT(item), "select",
02179                        GTK_SIGNAL_FUNC(gtktreeselect), (gpointer)UMAKEINT(GetWidID(), cmd));
02180     gtk_signal_connect(GTK_OBJECT(item), "deselect",
02181                        GTK_SIGNAL_FUNC(gtktreedeselect), (gpointer)UMAKEINT(GetWidID(), cmd));
02182     gtk_signal_connect (GTK_OBJECT(item), "expand",
02183                         GTK_SIGNAL_FUNC(gtktreeexpand), (gpointer)UMAKEINT(GetWidID(), cmd));
02184     gtk_signal_connect (GTK_OBJECT(item), "collapse",
02185                         GTK_SIGNAL_FUNC(gtktreecollapse), (gpointer)UMAKEINT(GetWidID(), cmd));
02186     gtk_tree_append (GTK_TREE(root), GTK_WIDGET(item));
02187     gtk_widget_show (GTK_WIDGET(item));
02188     data->result = (UTREEITEM)item;
02189 #endif
02190 }
02191
02192 void UWidget::OnTreeSetData(int cmd, UTREE_INFO *data)
02193 {
02194     void *w = GetWidget(cmd);
02195     if(w == 0L)
02196         return;
02197
02198 #if qGTK
02199     if(!GTK_IS_TREE(w))
02200         return;
02201
02202     gtk_object_set_data(GTK_OBJECT(data->item), "rf_treeitemdata", data->data);
02203 #endif
02204 }
02205
02206 void UWidget::OnTreeSetIcon(int cmd, UTREE_INFO *data)
02207 {
02208     void *w = GetWidget(cmd);
02209     if(w == 0L)
02210         return;
02211
02212 #if qGTK
02213     if(!GTK_IS_TREE(w))
02214         return;
02215
02216     gtksettreeitemicon(GTK_TREE_ITEM(data->item), GTK_PIXMAP(data->icon));
02217 #endif
02218 }
02219
02220 void UWidget::OnTreeGetSel(int cmd, UTREEITEM *item)
02221 {
02222     *item = 0L; // sanity
02223
02224     void *w = GetWidget(cmd);
02225     if(w == 0L)
02226         return;
02227
02228 #if qGTK
02229     if(!GTK_IS_TREE(w))
02230         return;
02231
02232     GList *sel = GTK_TREE(w)->selection;
02233     if(sel == 0L || !GTK_IS_TREE_ITEM(sel->data))
02234         return;
02235
02236     *item = sel->data;
02237 #endif
02238 }
02239
02240 void UWidget::OnTreeGetInfo(int cmd, UTREE_INFO *desc)
02241 {
02242     // sanity
02243     desc->parent = 0L;
02244     desc->next = 0L;
02245     desc->child = 0L;
02246     desc->data = 0L;
02247     desc->title = 0L;
02248     desc->icon = 0L;
02249     desc->expanded = 0;
02250
02251     void *w = GetWidget(cmd);
02252     if(w == 0L)
02253         return;
02254
02255 #if qGTK
02256     if(!GTK_IS_TREE(w))
02257         return;
02258
02259     GtkTreeItem *item;
02260     if(desc->item == 0L)
02261     {
02262         GList *list = g_list_first(GTK_TREE(w)->children);
02263         GList *next = g_list_next(list);
02264         item = list != 0L ? GTK_TREE_ITEM(list->data) : 0L;
02265         desc->item = item;
02266         desc->next = next != 0L ? GTK_TREE_ITEM(next->data) : 0L;
02267     }
02268     else
02269     {
02270         GtkTree *parent = GTK_TREE(GTK_WIDGET(desc->item)->parent);
02271         GList *list = g_list_find(GTK_TREE(parent)->children, desc->item);
02272         GList *next = g_list_next(list);
02273         item = list != 0L ? GTK_TREE_ITEM(list->data) : 0L;
02274         desc->item = item;
02275         // the only way I found to guess the TREE_ITEM parent
02276         desc->parent = parent == w ? 0L : GTK_TREE_ITEM(gtk_object_get_data(GTK_OBJECT(parent), "rf_treeparent"));
02277         g_assert(desc->parent == 0L || GTK_IS_TREE_ITEM(desc->parent));
02278         desc->next = next != 0L ? GTK_TREE_ITEM(next->data) : 0L;
02279     }
02280     if(item != 0L)
02281     {
02282         if(item->subtree != 0L)
02283         {
02284             GtkTree *subtree = GTK_TREE(item->subtree);
02285             GList *list = g_list_first(GTK_TREE(subtree)->children);
02286             desc->child = list != 0L ? GTK_TREE_ITEM(list->data) : 0L;
02287         }
02288         desc->data = gtk_object_get_data(GTK_OBJECT(item), "rf_treeitemdata");
02289         GtkLabel *label = gtktreegetlabel(GTK_WIDGET(item));
02290         if(label != 0L)
02291             gtk_label_get(label, &desc->title);
02292         desc->expanded = item->expanded;
02293     }
02294 #endif
02295 }
02296
02297 void UWidget::OnTreeDelete(int cmd, UTREEITEM item)
02298 {
02299     // sanity
02300     void *w = GetWidget(cmd);
02301     if(w == 0L)
02302         return;
02303
02304 #if qGTK
02305     if(!GTK_IS_TREE(w) || item == 0L)
02306         return;
02307
02308     GtkTreeItem *i = GTK_TREE_ITEM(item);
02309
02310     GtkTree *parent = GTK_TREE(GTK_WIDGET(i)->parent);
02311     if (parent == 0L)
02312         return;
02313
02314     gtk_container_remove(GTK_CONTAINER(parent), GTK_WIDGET(i));
02315 #endif
02316 }
02317
02318 void UWidget::OnTreeExpand(int cmd, int collapse, UTREEITEM item)
02319 {
02320     // sanity
02321     void *w = GetWidget(cmd);
02322     if(w == 0L)
02323         return;
02324
02325 #if qGTK
02326     if(!GTK_IS_TREE(w) || item == 0L)
02327         return;
02328
02329     GtkTreeItem *i = GTK_TREE_ITEM(item);
02330     int collapsed = !i->expanded;
02331     if((collapsed != 0) ^ (collapse != 0))
02332     {
02333         if(!collapse)
02334             gtk_tree_item_expand(i);
02335         else
02336             gtk_tree_item_collapse(i);
02337     }
02338 #endif
02339 }
02340
02341 void UWidget::OnTreeSelect(int cmd, int deselect, UTREEITEM item)
02342 {
02343     // sanity
02344     void *w = GetWidget(cmd);
02345     if(w == 0L)
02346         return;
02347
02348 #if qGTK
02349     if(!GTK_IS_TREE(w) || item == 0L)
02350         return;
02351
02352 #if 0 // FIXME ! GTK is behaving strangely
02353     GList *sel = GTK_TREE(w)->selection;
02354     while(sel)
02355     {
02356         gtk_tree_item_deselect(GTK_TREE_ITEM(sel->data));
02357         sel = g_list_next(sel);
02358     }
02359
02360     GtkTreeItem *i = GTK_TREE_ITEM(item);
02361     if(!deselect)
02362         gtk_tree_item_select(i);
02363     else
02364         gtk_tree_item_deselect(i);
02365 #endif
02366 #endif
02367 }
02368
02369 void UWidget::OnComboResetAll(int cmd)
02370 {
02371     void *w = GetWidget(cmd);
02372     if(w == 0L)
02373         return;
02374
02375 #ifdef WIN32
02376     CWnd *wnd = (CWnd *)w;
02377
02378     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02379     {
02380         CComboBox *combo = (CComboBox *)wnd;
02381         combo->ResetContent();
02382     }
02383 #endif
02384 #if qGTK
02385     if(GTK_IS_COMBO(w))
02386     {
02387         GtkList *listbox = GTK_LIST( GTK_COMBO(w)->list );
02388         if(listbox && listbox->children != 0L)
02389             gtk_list_remove_items( listbox, g_list_copy(listbox->children));
02390     }
02391     else if(GTK_IS_OPTION_MENU(w))
02392     {
02393         GtkWidget *menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(w));
02394         GList *list = g_list_copy(GTK_MENU_SHELL(menu)->children);
02395         GList *head = list;
02396         while(list != 0L)
02397         {
02398             GtkWidget *wid = GTK_WIDGET(list->data);
02399             gtk_container_remove(GTK_CONTAINER(menu), wid);
02400             list = (GList *)g_list_next(list);
02401         }
02402         g_list_free(head);
02403     }
02404 #endif
02405 #if qMacPP
02406     LPane *view = (LPane *)w;
02407     LMenuController *popup;
02408     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02409     {
02410         USemaphore policeman(gTurnOffBroadcast);
02411
02412         popup->DeleteAllMenuItems();
02413     }
02414 #endif
02415 #if qMacAPP
02416     TView *view = (TView *)w;
02417     if(MA_MEMBER(view, TPopup))
02418     {
02419         TPopup *popup = (TPopup *)view;
02420         while(popup->GetNumberOfItems() > 0)
02421             popup->DeleteItem(1);
02422     }
02423 #endif
02424 }
02425
02426 void UWidget::OnComboAppend(int cmd, const char *txt)
02427 {
02428     void *w = GetWidget(cmd);
02429     if(w == 0L)
02430         return;
02431
02432 #ifdef WIN32
02433     CWnd *wnd = (CWnd *)w;
02434
02435     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02436     {
02437         CComboBox *combo = (CComboBox *)wnd;
02438         combo->InsertString(-1, txt);
02439     }
02440 #endif
02441 #if qGTK
02442     if(GTK_IS_COMBO(w))
02443     {
02444         GtkWidget *list = GTK_COMBO(w)->list;
02445         GtkWidget *list_item = gtk_list_item_new_with_label(txt);
02446         gtk_container_add( GTK_CONTAINER(list), list_item );
02447         gtk_widget_show( list_item );
02448
02449         gtk_signal_connect( GTK_OBJECT(list_item), "select",
02450                             GTK_SIGNAL_FUNC(gtkcomboclicked), (gpointer)UMAKEINT(GetWidID(), cmd) );
02451     }
02452     else if(GTK_IS_OPTION_MENU(w))
02453     {
02454         GtkWidget *menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(w));
02455         GtkWidget *item = gtk_menu_item_new_with_label(txt);
02456         // fix me: where to find the label of the item ?
02457         gtk_object_set_data_full(GTK_OBJECT(item), "rf_menuitemtext", strdup(txt), (GtkDestroyNotify)free);
02458         gtk_signal_connect (GTK_OBJECT(item), "activate",
02459             GTK_SIGNAL_FUNC(gtkmenuactivated), (gpointer)UMAKEINT(GetWidID(), cmd));
02460         gtk_widget_show(item);
02461         gtk_menu_append(GTK_MENU(menu), item);
02462     }
02463 #endif
02464 #if qMacPP
02465     LPane *view = (LPane *)w;
02466     LMenuController *popup;
02467     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02468     {
02469         USemaphore policeman(gTurnOffBroadcast);
02470
02471         if(strcmp(txt, "-") == 0)
02472             popup->InsertMenuItem("\p(-", max_Int16, false);
02473         else
02474             popup->InsertMenuItem(LStr255(txt), max_Int16);
02475     }
02476 #endif
02477 #if qMacAPP
02478     TView *view = (TView *)w;
02479     if(MA_MEMBER(view, TPopup))
02480     {
02481         TPopup *popup = (TPopup *)view;
02482         if(strcmp(txt, "-") == 0)
02483             popup->AddSeparator();
02484         else
02485             popup->AddItem(CStr255_AC(txt));
02486     }
02487 #endif
02488 }
02489
02490 void UWidget::OnComboSetPos(int cmd, int sel)
02491 {
02492     void *w = GetWidget(cmd);
02493     if(w == 0L)
02494         return;
02495
02496 #ifdef WIN32
02497     CWnd *wnd = (CWnd *)w;
02498
02499     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02500     {
02501         CComboBox *combo = (CComboBox *)wnd;
02502         combo->SetCurSel(sel);
02503     }
02504 #endif
02505 #if qGTK
02506     if(GTK_IS_COMBO(w))
02507     {
02508         GtkWidget *list = GTK_COMBO(w)->list;
02509         gtk_list_select_item(GTK_LIST(list), sel);
02510     }
02511     else if(GTK_IS_OPTION_MENU(w))
02512     {
02513         gtk_option_menu_set_history (GTK_OPTION_MENU(w), sel);
02514     }
02515
02516 #endif
02517 #if qMacAPP
02518     TView *view = (TView *)w;
02519     if(MA_MEMBER(view, TPopup))
02520     {
02521         TPopup *popup = (TPopup *)view;
02522         popup->SetCurrentItem(sel + 1, true);
02523     }
02524 #endif
02525 #if qMacPP
02526     LPane *view = (LPane *)w;
02527     LMenuController *popup;
02528     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02529     {
02530         USemaphore policeman(gTurnOffBroadcast);
02531
02532         popup->SetCurrentMenuItem(sel + 1);
02533     }
02534 #endif
02535 }
02536
02537 void UWidget::OnComboDelSel(int cmd, int sel)
02538 {
02539     void *w = GetWidget(cmd);
02540     if(w == 0L)
02541         return;
02542
02543 #ifdef WIN32
02544     CWnd *wnd = (CWnd *)w;
02545
02546     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02547     {
02548         CComboBox *combo = (CComboBox *)wnd;
02549         combo->DeleteString(sel);
02550     }
02551 #endif
02552 #if qMacPP
02553     LPane *view = (LPane *)w;
02554     LMenuController *popup;
02555     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02556     {
02557         USemaphore policeman(gTurnOffBroadcast);
02558
02559         popup->DeleteMenuItem(sel + 1);
02560     }
02561 #endif
02562 }
02563
02564 void UWidget::OnComboEnableSel(int cmd, int sel, int state)
02565 {
02566     void *w = GetWidget(cmd);
02567     if(w == 0L)
02568         return;
02569
02570 #ifdef WIN32
02571     CWnd *wnd = (CWnd *)w;
02572
02573     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02574     {
02575     }
02576 #endif
02577 #if qMacPP
02578     LPane *view = (LPane *)w;
02579     LMenuController *popup;
02580     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02581     {
02582         if(state)
02583             ::EnableMenuItem(popup->GetMacMenuH(), sel + 1);
02584         else
02585             ::DisableMenuItem(popup->GetMacMenuH(), sel + 1);
02586     }
02587 #endif
02588 }
02589
02590 void UWidget::OnComboGetMenu(int cmd, UMENU *menu)
02591 {
02592     *menu = UMENU_NULL; // sanity
02593
02594     void *w = GetWidget(cmd);
02595     if(w == 0L)
02596         return;
02597
02598 #ifdef WIN32
02599     CWnd *wnd = (CWnd *)w;
02600
02601     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02602     {
02603     }
02604 #endif
02605 #if qMacPP
02606     LPane *view = (LPane *)w;
02607     LMenuController *popup;
02608     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02609     {
02610         MenuHandle hdl = popup->GetMacMenuH();
02611         if(hdl != 0L)
02612 #   if ACCESSOR_CALLS_ARE_FUNCTIONS
02613             *menu = GetMenuID(hdl);
02614 #   else
02615             *menu = (**hdl).menuID;
02616 #   endif
02617     }
02618 #endif
02619 }
02620
02621 int UWidget::OnComboGetPos(int cmd, UStr *txt)
02622 {
02623     int res = -1; // sanity
02624     if(txt != 0L)
02625         *txt = "";
02626
02627     void *w = GetWidget(cmd);
02628     if(w == 0L)
02629         return res;
02630
02631 #ifdef WIN32
02632     CWnd *wnd = (CWnd *)w;
02633
02634     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02635     {
02636         CComboBox *combo = (CComboBox *)wnd;
02637         res = combo->GetCurSel();
02638         if(res != -1 && txt != 0L)
02639         {
02640             CString s;
02641             combo->GetLBText(res, s);
02642             *txt = s;
02643         }
02644     }
02645 #endif
02646 #if qMacAPP
02647     TView *view = (TView *)w;
02648     if(MA_MEMBER(view, TPopup))
02649     {
02650         TPopup *popup = (TPopup *)view;
02651         res = popup->GetCurrentItem() - 1;
02652         if(txt != 0L)
02653         {
02654             CStr255_AC pstr = popup->GetItemText(res + 1);
02655             *txt = pstr;
02656         }
02657     }
02658 #endif
02659 #if qMacPP
02660     LPane *view = (LPane *)w;
02661     LMenuController *popup;
02662     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02663     {
02664         res = popup->GetCurrentMenuItem() - 1;
02665         if(txt != 0L)
02666         {
02667             LStr255 pstr;
02668             popup->GetMenuItemText(res + 1, pstr);
02669             *txt = pstr;
02670         }
02671     }
02672 #endif
02673
02674     return res;
02675 }
02676
02677 int UWidget::OnComboGetCount(int cmd)
02678 {
02679     int res = 0; // sanity
02680
02681     void *w = GetWidget(cmd);
02682     if(w == 0L)
02683         return res;
02684
02685 #ifdef WIN32
02686     CWnd *wnd = (CWnd *)w;
02687
02688     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02689     {
02690         CComboBox *combo = (CComboBox *)wnd;
02691         res = combo->GetCount();
02692     }
02693 #endif
02694 #if qMacAPP
02695     TView *view = (TView *)w;
02696     if(MA_MEMBER(view, TPopup))
02697     {
02698         TPopup *popup = (TPopup *)view;
02699         res = popup->GetNumberOfItems();
02700     }
02701 #endif
02702 #if qMacPP
02703     LPane *view = (LPane *)w;
02704     LMenuController *popup;
02705     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02706     {
02707         res = ::CountMenuItems(popup->GetMacMenuH());
02708     }
02709 #endif
02710
02711     return res;
02712 }
02713
02714 void UWidget::OnSmartComboSetFeature(int cmd, int feature)
02715 {
02716     void *w = GetWidget(cmd);
02717     if( w == 0L )
02718         return;
02719
02720 #ifdef WIN32
02721     CWnd* wnd = (CWnd*)w;
02722
02723     if( wnd->IsKindOf(RUNTIME_CLASS(CComboBox)) )
02724     {
02725         CComboBox* combo = (CComboBox*)wnd;
02726         combo->SendMessage(WM_SMCB_SETFEATURE, WPARAM(feature));
02727     }
02728 #endif
02729 #if qMacPP
02730 #endif
02731 }
02732
02733 void UWidget::OnSmartComboSetItems(int cmd, CMString* items)
02734 {
02735     void *w = GetWidget(cmd);
02736     if( w == 0L )
02737         return;
02738
02739 #ifdef WIN32
02740     CWnd* wnd = (CWnd*)w;
02741
02742     if( wnd->IsKindOf(RUNTIME_CLASS(CComboBox)) )
02743     {
02744         CComboBox* combo = (CComboBox*)wnd;
02745         combo->SendMessage(WM_SMCB_SETITEMS, WPARAM(items));
02746     }
02747 #endif
02748 #if qMacPP
02749 #endif
02750 }
02751
02752 void UWidget::OnSmartComboSetReadOnly(int cmd, bool readOnly)
02753 {
02754     void *w = GetWidget(cmd);
02755     if( w == 0L )
02756         return;
02757
02758 #ifdef WIN32
02759     CWnd* wnd = (CWnd*)w;
02760
02761     if( wnd->IsKindOf(RUNTIME_CLASS(CComboBox)) )
02762     {
02763         CComboBox* combo = (CComboBox*)wnd;
02764         combo->SendMessage(WM_SMCB_SETREADONLY, WPARAM(readOnly));
02765     }
02766 #endif
02767 #if qMacPP
02768 #endif
02769 }
02770
02771 void UWidget::OnListAddColumns(int cmd, int num)
02772 {
02773     void *w = GetWidget(cmd);
02774     if(w == 0L)
02775         return;
02776
02777 #if qGTK
02778     if(!GTK_IS_CLIST(w))
02779         return;
02780
02781     //GtkCList *list = GTK_CLIST(w);
02782     // don't know how to do that, for now it relies on glade settings
02783 #endif
02784 #ifdef WIN32
02785     CWnd *wnd = (CWnd *)w;
02786
02787     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
02788     {
02789         CListCtrl *list = (CListCtrl *)wnd;
02790         DWORD dwExStyle = ListView_GetExtendedListViewStyle(list->m_hWnd);
02791         dwExStyle |= LVS_EX_FULLROWSELECT;
02792         ListView_SetExtendedListViewStyle(list->m_hWnd, dwExStyle);
02793
02794         while(num--)
02795             list->InsertColumn(0, "", LVCFMT_LEFT, 80);
02796     }
02797 #endif
02798 #if qMacPP
02799     LPane *view = (LPane *)w;
02800     LOutlineTable *table;
02801     LTextTableView *tabtext;
02802     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
02803     {
02804         macpp_preparetable(table);
02805         table->InsertCols( num, 0, nil, nil, false );
02806     }
02807     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
02808     {
02809         macpp_preparetable(GetWidget(kUMainWidget), tabtext);
02810         tabtext->InsertCols( num, 0, nil, nil, false );
02811     }
02812 #endif
02813 }
02814
02815 void UWidget::OnListSetColTitle(int cmd, int num, const char *title)
02816 {
02817     void *w = GetWidget(cmd);
02818     if(w == 0L)
02819         return;
02820
02821 #if qGTK
02822     if(!GTK_IS_CLIST(w))
02823         return;
02824
02825     GtkCList *list = GTK_CLIST(w);
02826     gtk_clist_set_column_title (list, num, title);
02827 #endif
02828 #ifdef WIN32
02829     CWnd *wnd = (CWnd *)w;
02830
02831     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
02832     {
02833         CListCtrl *list = (CListCtrl *)wnd;
02834         LVCOLUMN col;
02835         memset(&col, 0, sizeof(col));
02836         col.mask = LVCF_TEXT;
02837         col.pszText = (char *)title;
02838         VERIFY(list->SetColumn(num, &col));
02839     }
02840 #endif
02841 }
02842
02843 void UWidget::OnListSetColWidth(int cmd, int num, int width)
02844 {
02845     void *w = GetWidget(cmd);
02846     if(w == 0L)
02847         return;
02848
02849 #if qGTK
02850     if(!GTK_IS_CLIST(w))
02851         return;
02852
02853     GtkCList *list = GTK_CLIST(w);
02854     gtk_clist_set_column_width(list, num, width);
02855 #endif
02856 #ifdef WIN32
02857     CWnd *wnd = (CWnd *)w;
02858
02859     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
02860     {
02861         CListCtrl *list = (CListCtrl *)wnd;
02862         LVCOLUMN col;
02863         memset(&col, 0, sizeof(col));
02864         col.mask = LVCF_WIDTH;
02865         col.cx = width;
02866         VERIFY(list->SetColumn(num, &col));
02867     }
02868 #endif
02869 #if qMacPP
02870     LPane *view = (LPane *)w;
02871     LOutlineTable *table;
02872     LTextTableView *tabtext;
02873     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
02874     {
02875         macpp_preparetable(table);
02876         LTableGeometry *geom = table->GetTableGeometry();
02877         if(geom != 0L)
02878             geom->SetColWidth(width, num + 1, num + 1);
02879     }
02880     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
02881     {
02882         macpp_preparetable(GetWidget(kUMainWidget), tabtext);
02883         LTableGeometry *geom = tabtext->GetTableGeometry();
02884         if(geom != 0L)
02885             geom->SetColWidth(width, num + 1, num + 1);
02886     }
02887 #endif
02888 }
02889
02890 void UWidget::OnListResetAll(int cmd)
02891 {
02892     void *w = GetWidget(cmd);
02893     if(w == 0L)
02894         return;
02895
02896 #if qGTK
02897     if(!GTK_IS_CLIST(w))
02898         return;
02899
02900     GtkCList *list = GTK_CLIST(w);
02901     gtk_clist_clear(list);
02902 #endif
02903 #if qMacAPP
02904     TView *view = (TView *)w;
02905     if(MA_MEMBER(view, TPseudoTextListView))
02906     {
02907         TPseudoTextListView *txt = (TPseudoTextListView *)view;
02908         txt->RemoveAll();
02909     }
02910 #endif
02911 #if qMacPP
02912     LPane *view = (LPane *)w;
02913     LOutlineTable *table;
02914     LTextTableView *tabtext;
02915     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
02916     {
02917         macpp_preparetable(table);
02918         LArrayIterator iter(table->GetFirstLevelItems());
02919         LOutlineItem* item;
02920         while (iter.Next(&item))
02921         {
02922             table->RemoveItem(item, false, false);
02923         }
02924         table->AdjustImageSize(false);
02925         table->Refresh();
02926     }
02927     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
02928     {
02929         macpp_preparetable(GetWidget(kUMainWidget), tabtext);
02930         tabtext->RemoveAllRows(false);
02931         tabtext->Refresh();
02932     }
02933 #endif
02934 #ifdef WIN32
02935     CWnd *wnd = (CWnd *)w;
02936
02937     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
02938     {
02939         CListCtrl *list = (CListCtrl *)wnd;
02940         VERIFY(list->DeleteAllItems());
02941     }
02942 #endif
02943 }
02944
02945 void UWidget::OnListAddSel(int cmd, int entry)
02946 {
02947     void *w = GetWidget(cmd);
02948     if(w == 0L)
02949         return;
02950
02951 #if qMacAPP
02952     TView *view = (TView *)w;
02953     if(MA_MEMBER(view, TPseudoTextListView))
02954     {
02955         TPseudoTextListView *txt = (TPseudoTextListView *)view;
02956         txt->SelectItem(entry + 1, false, true, true);
02957     }
02958 #endif
02959 #if qGTK
02960     if(!GTK_IS_CLIST(w))
02961         return;
02962
02963     GtkCList *list = GTK_CLIST(w);
02964     gtk_clist_select_row(list, entry, 0);
02965 #endif
02966 #ifdef WIN32
02967     CWnd *wnd = (CWnd *)w;
02968
02969     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
02970     {
02971         CListCtrl *list = (CListCtrl *)wnd;
02972         VERIFY(list->SetItemState(entry, LVIS_SELECTED, LVIS_SELECTED));
02973         VERIFY(list->EnsureVisible(entry, true));
02974     }
02975 #endif
02976 #if qMacPP
02977     LPane *view = (LPane *)w;
02978     LTableView *table;
02979     if((table = dynamic_cast<LTableView *>(view)) != 0L)
02980     {
02981         STableCell cell(entry + 1, 1);
02982         table->SelectCell(cell);
02983         table->ScrollCellIntoFrame(cell);
02984     }
02985 #endif
02986 }
02987
02988 void UWidget::OnListDelRow(int cmd, int entry)
02989 {
02990     void *w = GetWidget(cmd);
02991     if(w == 0L)
02992         return;
02993
02994 #if qMacAPP
02995     TView *view = (TView *)w;
02996     if(MA_MEMBER(view, TPseudoTextListView))
02997     {
02998         TPseudoTextListView *txt = (TPseudoTextListView *)view;
02999         txt->DelItemAt(entry + 1, 1);
03000     }
03001 #endif
03002 #if qGTK
03003     if(!GTK_IS_CLIST(w))
03004         return;
03005
03006     GtkCList *list = GTK_CLIST(w);
03007     gtk_clist_remove(list, entry);
03008 #endif
03009 #ifdef WIN32
03010     CWnd *wnd = (CWnd *)w;
03011
03012     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03013     {
03014         CListCtrl *list = (CListCtrl *)wnd;
03015         VERIFY(list->DeleteItem(entry));
03016     }
03017 #endif
03018 #if qMacPP
03019     LPane *view = (LPane *)w;
03020     LOutlineTable *table;
03021     LTextTableView *tabtext;
03022     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03023     {
03024         LOutlineItem* item = table->FindItemForRow(entry + 1);
03025         if(item != 0L)
03026         {
03027             table->RemoveItem(item);
03028         }
03029     }
03030     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03031     {
03032         tabtext->RemoveRows(1, entry + 1, true);
03033     }
03034 #endif
03035 }
03036
03037 void UWidget::OnListSetFeedback(int cmd, int turnOn)
03038 {
03039     void *w = GetWidget(cmd);
03040     if(w == 0L)
03041         return;
03042
03043 #if qGTK
03044     if(!GTK_IS_CLIST(w))
03045         return;
03046
03047     GtkCList *list = GTK_CLIST(w);
03048     if(turnOn)
03049         gtk_clist_thaw(list);
03050     else
03051         gtk_clist_freeze(list);
03052 #endif
03053 }
03054
03055 void UWidget::OnListNewRow(int cmd, int *num)
03056 {
03057     *num = 0; // sanity
03058
03059     void *w = GetWidget(cmd);
03060     if(w == 0L)
03061         return;
03062
03063 #if qGTK
03064     if(!GTK_IS_CLIST(w))
03065         return;
03066
03067     gchar *emptyTxts[] = {"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""};
03068
03069     GtkCList *list = GTK_CLIST(w);
03070     *num = gtk_clist_append  (list, emptyTxts);
03071 #endif
03072 #if qMacAPP
03073     TView *view = (TView *)w;
03074     if(MA_MEMBER(view, TPseudoTextListView))
03075     {
03076         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03077         *num = txt->GetNumOfRows();
03078     }
03079 #endif
03080 #ifdef WIN32
03081     CWnd *wnd = (CWnd *)w;
03082
03083     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03084     {
03085         CListCtrl *list = (CListCtrl *)wnd;
03086         *num = list->GetItemCount();
03087     }
03088 #endif
03089 #if qMacPP
03090     LPane *view = (LPane *)w;
03091     LOutlineTable *table;
03092     LTextTableView *tabtext;
03093     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03094     {
03095         // Store this information in the list view
03096         CPseudoItem *theItem = NEW CPseudoItem(GetWidID(), cmd);
03097         if(theItem != 0L)
03098         {
03099             TableIndexT outRows, outCols;
03100             table->GetTableSize(outRows, outCols);
03101             // and insert it at the end of the table
03102             LOutlineItem *lastItem = table->FindItemForRow(outRows);
03103             table->InsertItem( theItem, nil, lastItem );
03104             *num = outRows;
03105         }
03106     }
03107     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03108     {
03109         TableIndexT outRows, outCols;
03110         tabtext->GetTableSize(outRows, outCols);
03111         tabtext->InsertRows(1, outRows);
03112         tabtext->AdjustImageSize(false);
03113         *num = outRows;
03114     }
03115 #endif
03116 }
03117
03118 void UWidget::OnListRowSetData(int cmd, int num, void *data)
03119 {
03120     void *w = GetWidget(cmd);
03121     if(w == 0L)
03122         return;
03123
03124 #if qGTK
03125     if(!GTK_IS_CLIST(w))
03126         return;
03127
03128     GtkCList *list = GTK_CLIST(w);
03129     gtk_clist_set_row_data(list, num, data);
03130 #endif
03131 #if qMacPP
03132     LPane *view = (LPane *)w;
03133     LOutlineTable *table;
03134     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03135     {
03136         // Store this information in the list view
03137         LOutlineItem *item = table->FindItemForRow(num + 1);
03138         CPseudoItem *theItem;
03139         if((theItem = dynamic_cast<CPseudoItem *>(item)) != 0L)
03140         {
03141             theItem->m_data = data;
03142         }
03143     }
03144 #endif
03145 }
03146
03147 void UWidget::OnListRowGetData(int cmd, int row, void **data)
03148 {
03149     *data = 0L; // sanity
03150
03151     void *w = GetWidget(cmd);
03152     if(w == 0L)
03153         return;
03154
03155 #if qGTK
03156     if(!GTK_IS_CLIST(w))
03157         return;
03158
03159     GtkCList *list = GTK_CLIST(w);
03160     *data = gtk_clist_get_row_data(list, row);
03161 #endif
03162 #if qMacPP
03163     LPane *view = (LPane *)w;
03164     LOutlineTable *table;
03165     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03166     {
03167         // Store this information in the list view
03168         LOutlineItem *item = table->FindItemForRow(row + 1);
03169         CPseudoItem *theItem;
03170         if((theItem = dynamic_cast<CPseudoItem *>(item)) != 0L)
03171         {
03172             *data = theItem->m_data;
03173         }
03174     }
03175 #endif
03176 }
03177
03178 int UWidget::OnListGetNextSel(int cmd, int selectedCell)
03179 {
03180     void *w = GetWidget(cmd);
03181     if(w == 0L)
03182         return -1;
03183
03184 #if qGTK
03185     if(!GTK_IS_CLIST(w))
03186         return -1;
03187
03188     GList *sel = GTK_CLIST(w)->selection;
03189     if(sel == 0L)
03190         return -1;
03191
03192     while(sel != 0L)
03193     {
03194         gint row = GPOINTER_TO_INT(sel->data);
03195         if(selectedCell == -1)
03196             return row;
03197
03198         sel = (GList *)g_list_next(sel);
03199
03200         if(selectedCell == row)
03201         {
03202             return sel == 0L ? -1 : GPOINTER_TO_INT(sel->data);
03203         }
03204     }
03205 #endif
03206 #if qMacAPP
03207     TView *view = (TView *)w;
03208     if(MA_MEMBER(view, TPseudoTextListView))
03209     {
03210         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03211         if(txt->FirstSelectedItem() == 0)
03212             return -1;
03213
03214         for(GridCoordinate c = 0; c < txt->GetNumOfRows(); ++c)
03215         {
03216             if(!txt->IsItemSelected(c + 1))
03217                 continue;
03218
03219             if(selectedCell == -1)
03220                 return c;
03221
03222             if(selectedCell == c)
03223                 selectedCell = -1; // so the next pick is the one
03224         }
03225     }
03226 #endif
03227 #ifdef WIN32
03228     CWnd *wnd = (CWnd *)w;
03229
03230     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03231     {
03232         CListCtrl *list = (CListCtrl *)wnd;
03233         return list->GetNextItem(selectedCell, LVNI_SELECTED);
03234     }
03235 #endif
03236 #if qMacPP
03237     LPane *view = (LPane *)w;
03238     LTableView *table;
03239     if((table = dynamic_cast<LTableView *>(view)) != 0L)
03240     {
03241         STableCell sel;
03242         if(selectedCell == -1)
03243         {
03244             sel = table->GetFirstSelectedCell();
03245             return sel.row - 1;
03246         }
03247
03248         sel.row = selectedCell + 1;
03249         sel.col = 1;
03250         while(table->GetNextSelectedCell(sel))
03251         {
03252             if(sel.row != selectedCell + 1)
03253                 return sel.row - 1;
03254         }
03255     }
03256 #endif
03257
03258     return -1;
03259 }
03260
03261 int UWidget::OnListGetNext(int cmd, int whichCell)
03262 {
03263     void *w = GetWidget(cmd);
03264     if(w == 0L)
03265         return -1;
03266
03267 #if qGTK
03268     if(!GTK_IS_CLIST(w))
03269         return -1;
03270
03271     if(whichCell == -1)
03272         whichCell = 0;
03273     else
03274         whichCell++;
03275
03276     if(whichCell >= GTK_CLIST(w)->rows)
03277         whichCell = -1;
03278
03279     return whichCell;
03280 #endif
03281 #ifdef WIN32
03282     CWnd *wnd = (CWnd *)w;
03283
03284     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03285     {
03286         CListCtrl *list = (CListCtrl *)wnd;
03287         return list->GetNextItem(whichCell, LVNI_ALL);
03288     }
03289 #endif
03290 #if qMacPP
03291     LPane *view = (LPane *)w;
03292     LTableView *table;
03293     if((table = dynamic_cast<LTableView *>(view)) != 0L)
03294     {
03295         STableCell sel;
03296
03297         if(whichCell != -1)
03298         {
03299             sel.row = whichCell + 1;
03300             sel.col = 1;
03301         }
03302
03303         while(table->GetNextCell(sel))
03304         {
03305             if(sel.row != whichCell + 1)
03306                 return sel.row - 1;
03307         }
03308     }
03309 #endif
03310
03311     return -1;
03312 }
03313
03314 void UWidget::OnListInsert(int cmd, ULIST_INSERT *data)
03315 {
03316     void *w = GetWidget(cmd);
03317     if(w == 0L)
03318         return;
03319
03320 #if qGTK
03321     if(!GTK_IS_CLIST(w))
03322         return;
03323
03324     GtkCList *list = GTK_CLIST(w);
03325
03326     if(data->title == 0L && data->icon == 0L)
03327         g_warning("Got an empty cell !\n");
03328     else if(data->title == 0L)
03329     {
03330         GtkPixmap *pix = GTK_PIXMAP(data->icon);
03331         gtk_clist_set_pixmap(list, data->row, data->col, pix->pixmap, pix->mask);
03332     }
03333     else if(data->icon == 0L)
03334     {
03335         gtk_clist_set_text(list, data->row, data->col, data->title);
03336     }
03337     else
03338     {
03339         GtkPixmap *pix = GTK_PIXMAP(data->icon);
03340         gtk_clist_set_pixtext(list, data->row, data->col, data->title, 2, pix->pixmap, pix->mask);
03341     }
03342 #endif
03343 #if qMacAPP
03344     TView *view = (TView *)w;
03345     if(MA_MEMBER(view, TPseudoTextListView))
03346     {
03347         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03348         //txt->InsStringBefore(data->row + 1, data->title);
03349         txt->InsStringLast(data->title);
03350     }
03351 #endif
03352 #ifdef WIN32
03353     CWnd *wnd = (CWnd *)w;
03354
03355     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03356     {
03357         CListCtrl *list = (CListCtrl *)wnd;
03358         if(data->col == 0)
03359         {
03360             LV_ITEM lvi;
03361             memset(&lvi, 0, sizeof(lvi));
03362             lvi.mask = LVIF_TEXT;
03363             lvi.iItem = data->row;
03364             lvi.iSubItem = 0;
03365             lvi.pszText = (char *)data->title;
03366
03367             list->InsertItem(&lvi);
03368         }
03369         else
03370         {
03371             list->SetItemText(data->row, data->col, data->title);
03372         }
03373     }
03374 #endif
03375 #if qMacPP
03376     LPane *view = (LPane *)w;
03377     LOutlineTable *table;
03378     LTextTableView *tabtext;
03379     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03380     {
03381         LOutlineItem *item = table->FindItemForRow(data->row + 1);
03382         CPseudoItem *theItem;
03383         if((theItem = dynamic_cast<CPseudoItem *>(item)) != 0L)
03384         {
03385             std::map<int, UStr>::value_type val(data->col + 1, UStr(data->title));
03386             theItem->m_texts.insert(val);
03387         }
03388     }
03389     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03390     {
03391         STableCell cell(data->row + 1, data->col + 1);
03392         tabtext->SetCellData(cell, data->title, strlen(data->title));
03393     }
03394 #endif
03395 }
03396
03397 void UWidget::OnListGetInfo(int cmd, ULIST_INFO *desc)
03398 {
03399     // sanity
03400     desc->data = 0L;
03401     desc->title = 0L;
03402
03403     void *w = GetWidget(cmd);
03404     if(w == 0L)
03405         return;
03406
03407 #if qMacAPP
03408     TView *view = (TView *)w;
03409     if(MA_MEMBER(view, TPseudoTextListView))
03410     {
03411         static UStr cstr; // no good
03412
03413         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03414         CStr255_AC name = txt->GetItemText(desc->row + 1);
03415         cstr = name;
03416         desc->title = cstr;
03417     }
03418 #endif
03419 #if qGTK
03420     if(!GTK_IS_CLIST(w))
03421         return;
03422
03423     GtkCList *list = GTK_CLIST(w);
03424     desc->data = gtk_clist_get_row_data(list, desc->row);
03425     gtk_clist_get_text_is_buggy(list, desc->row, desc->col, (gchar **)&desc->title);
03426 #endif
03427 #ifdef WIN32
03428     CWnd *wnd = (CWnd *)w;
03429
03430     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03431     {
03432         CListCtrl *list = (CListCtrl *)wnd;
03433
03434         desc->data = (void *)list->GetItemData(desc->row);
03435         static CString s;
03436         s = list->GetItemText(desc->row, desc->col);
03437         desc->title = s;
03438     }
03439 #endif
03440 #if qMacPP
03441     LPane *view = (LPane *)w;
03442     LOutlineTable *table;
03443     LTextTableView *tabtext;
03444     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03445     {
03446         LOutlineItem *item = table->FindItemForRow(desc->row + 1);
03447         CPseudoItem *theItem;
03448         if((theItem = dynamic_cast<CPseudoItem *>(item)) != 0L)
03449         {
03450             std::map<int, UStr>::iterator i = theItem->m_texts.find(desc->col + 1);
03451             if(i != theItem->m_texts.end())
03452             {
03453                 desc->title = (*i).second;
03454             }
03455             desc->data = theItem->m_data;
03456         }
03457     }
03458     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03459     {
03460         STableCell cell(desc->row + 1, desc->col + 1);
03461         UInt32 ioDataSize = 255;
03462         char tmp[255];
03463         tabtext->GetCellData(cell, tmp, ioDataSize);
03464         static UStr res;
03465         res.set(tmp, ioDataSize);
03466         desc->title = res;
03467     }
03468 #endif
03469 }
03470
03471 void UWidget::OnListResort(int cmd, int column, UListSorter s)
03472 {
03473     void *w = GetWidget(cmd);
03474     if(w == 0L)
03475         return;
03476
03477 #if qGTK
03478     if(!GTK_IS_CLIST(w))
03479         return;
03480
03481     GtkCList *list = GTK_CLIST(w);
03482
03483     sGtkClistDiff = s;
03484     sGtkClistWid = this;
03485     gtk_clist_set_compare_func(list, gtkclistdefcompare);
03486     gtk_clist_set_sort_column(list, column);
03487     gtk_clist_sort(list);
03488     gtk_clist_set_compare_func(list, 0L);
03489 #endif
03490 }
03491
03492 int UWidget::OnUpdateFocus(int leave, void *widget)
03493 {
03494     std::map<int, void *>::const_iterator i;
03495
03496     for(i = m_widgets.begin(); i != m_widgets.end(); ++i)
03497     {
03498         if((*i).second == widget)
03499             break;
03500     }
03501     if(i == m_widgets.end())
03502         return 0; // continue notification
03503
03504     if(leave)
03505     {
03506         if(sFocusWidID == GetWidID())
03507             sFocusWidID = -1;
03508     }
03509     else
03510     {
03511         sFocusWidID = GetWidID();
03512         sFocusCmdID = (*i).first;
03513     }
03514
03515     return 1; // stop notification
03516 }
03517
03518 bool UWidget::HasModal(void)
03519 {
03520 #if qGTK
03521     const STD map<int, UCmdTarget *> & targets = UEventGetTargets();
03522     STD map<int, UCmdTarget *>::const_iterator i;
03523     for(i = targets.begin(); i != targets.end(); ++i)
03524     {
03525         UCmdTarget *target = (*i).second;
03526         if(!target->IsKindOf(URUNTIME_CLASS(UWidget)))
03527             continue;
03528
03529         UWidget *wid = (UWidget *)target;
03530         if(wid->m_modalLoop)
03531             return true;
03532     }
03533 #endif
03534     return false;
03535 }
03536
03537 int UWidget::OnFetchCmd(int cmd, void *widget)
03538 {
03539     std::map<int, void *>::const_iterator i;
03540     for(i = m_widgets.begin(); i != m_widgets.end(); ++i)
03541     {
03542         if(widget == (*i).second)
03543             return (*i).first;
03544     }
03545     return -1;
03546 }
03547
03548 void UWidget::AddPage(UWidget *page, int pagecmd, int num_page)
03549 {
03550     void *wid = GetWidget(kUMainWidget);
03551     if(wid == 0L)
03552         return;
03553
03554     UEventSendMessage(page->GetWidID(), EV_INIT_TAB_WIDGET, UMAKEINT(pagecmd, num_page), wid);
03555     std::map<int, UWidget *>::value_type val(UMAKEINT(pagecmd, num_page), page);
03556     m_tabs.insert(val);
03557
03558 #if qMacPP
03559     // emulate the click in tab 1
03560     if(num_page == 0)
03561     {
03562         // emulate the click in tab 1
03563         UEventSendMessage(GetWidID(), EV_PAGE_CHANGED, UMAKEINT(pagecmd, num_page), 0L);
03564     }
03565 #endif /* qMacPP */
03566 }
03567
03568 void UWidget::OnPageChanged(int cmdid, int num_page)
03569 {
03570     if(m_currentPage == UMAKEINT(cmdid, num_page))
03571         return;
03572
03573     std::map<int, UWidget *>::iterator i;
03574     if(m_currentPage != -1)
03575     {
03576         i = m_tabs.find(m_currentPage);
03577         if(i != m_tabs.end())
03578         {
03579             UWidget *tab = (*i).second;
03580             tab->DoDataExchange(false);
03581
03582 #if qMacPP
03583             LPseudoWinAttachment *attach = macpp_getattachwindow(this);
03584             if(attach != 0L)
03585             {
03586                 attach->InvalidCache(tab);
03587             }
03588
03589             tab->m_widgets.erase(tab->m_widgets.begin(), tab->m_widgets.end());
03590 #endif /* qMacPP */
03591         }
03592     }
03593
03594     if(num_page == -1)
03595     {
03596         m_currentPage = -1;
03597         return;
03598     }
03599
03600     i = m_tabs.find(UMAKEINT(cmdid, num_page));
03601     if(i != m_tabs.end())
03602     {
03603         UWidget *tab = (*i).second;
03604
03605 #if qMacPP
03606         UPseudoPlaceHolder *holder = dynamic_cast<UPseudoPlaceHolder *>((LPane *)GetWidget(cmdid));
03607         if(holder != 0L)
03608         {
03609             macpp_fecthview(tab->GetWidID(), holder->GetCurrentView());
03610
03611             LPseudoWinAttachment *attach = macpp_getattachwindow(this);
03612             if(attach != 0L)
03613             {
03614                 macpp_linkbroadcasters(holder->GetCurrentView(), attach);
03615             }
03616         }
03617 #endif /* qMacPP */
03618
03619         tab->DoDataExchange(true);
03620     }
03621     m_currentPage = UMAKEINT(cmdid, num_page);
03622 }
03623
03624 #ifdef WIN32
03625 void UWidget::OverideMapWidget(int cmdid, CRuntimeClass *widClass)
03626 {
03627     std::map<int, CRuntimeClass *>::value_type val(cmdid, widClass);
03628     m_overide.insert(val);
03629 }
03630 #endif
03631
03632 #if qMacPP || qMacAPP
03633 SInt32 UWidget::GetPaneID(int cmdid)
03634 {
03635     cmdid -= EV_COMMAND_START;
03636     unsigned char tmp[50];
03637     unsigned char res[5] = {'p', 's', '\0', '\0', '\0'};
03638     sprintf((char *)tmp, "%d", cmdid);
03639     if(strlen((char *)tmp) > 2 || cmdid < 0)
03640     {
03641         UAppConsole("cmdid too big (%d)\n", cmdid);
03642     }
03643     else if(strlen((char *)tmp) == 2)
03644     {
03645         res[2] = tmp[0];
03646         res[3] = tmp[1];
03647     }
03648     else
03649     {
03650         res[2] = '0';
03651         res[3] = tmp[0];
03652     }
03653
03654     SInt32 num = (res[0] << 24) | (res[1] << 16) | (res[2] << 8) | res[3];
03655     return num;
03656 }
03657 #endif
Generated on Sun Feb 24 01:21:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


rf/uwidget.h Source File

rf/uwidget.h

Go to the documentation of this file.
00001 /*
00002 ** This program is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 1, or (at your option)
00005 ** any later version.
00006
00007 ** This program is distributed in the hope that it will be useful,
00008 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 ** GNU General Public License for more details.
00011
00012 ** You should have received a copy of the GNU General Public License
00013 ** along with this program; if not, write to the Free Software
00014 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00015 */
00016
00017 /*
00018  * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- May 1999
00019  */
00020
00021 #ifndef UWIDGET_H
00022 #define UWIDGET_H
00023
00024 #include "umain.h"
00025 #include "ustr.h"
00026
00027 #ifdef __cplusplus
00028 extern "C" {
00029 #endif
00030
00031 #ifdef WIN32
00032     LRESULT UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam);
00033         // - intercepts the messages and broadcast to the pseudo-widgets associated with.
00034         // - if it returns FALSE, you should return FALSE too.
00035         // - you need to overide the CWnd::WindowProc in order to use it.
00036 #endif
00037
00038 #ifdef __cplusplus
00039 }
00040 #endif
00041
00042 #ifdef __cplusplus
00043
00044 #ifdef _MSC_VER
00045 #   pragma warning (disable : 4786)
00046 #endif
00047
00048 #include <vector>
00049 #include <map>
00050
00051 class CMString;
00052
00057 class UTimer
00058 {
00059 public:
00060     UTimer(int lap, int lastlap, int cmd) : m_lap(lap), m_lastlap(lastlap), m_cmd(cmd) {}
00061     UTimer() : m_lap(0), m_lastlap(0), m_cmd(0) {}
00062     UTimer(const UTimer & src) : m_lap(src.m_lap), m_lastlap(src.m_lastlap), m_cmd(src.m_cmd) {}
00063
00064     UTimer & operator=(const UTimer & src)
00065     {
00066         m_lastlap = src.m_lastlap;
00067         m_lap = src.m_lap;
00068         m_cmd = src.m_cmd;
00069
00070         return *this;
00071     }
00072     long m_lap; // in millisecond
00073     long m_lastlap; // in millisecond
00074     int m_cmd; // command associated with
00075 };
00076
00082 struct UColor
00083 {
00084     unsigned char r, g, b;
00085 };
00086
00088 #define kUMainWidget 0
00089
00090 #if qGTK
00091 #   define kUgtkDataToken "_pseudoWidget"
00092 #   define kUgtkPrefixToken "pseudo" /* pseudo_0, pseudoA_0, pseudo<opt>_<cmdid> */
00093 #endif
00094 #ifdef WIN32
00095     class CDialog;
00096 #endif
00097
00109 class UEXPORT UWidget : public UCmdTarget
00110 {
00111     UDECLARE_DYNAMIC(UWidget)
00112 public:
00114     UWidget(int widid);
00115     virtual ~UWidget();
00116
00119     virtual void AddListener(UCmdTarget * listener);
00120
00122     virtual int UDispatchMessage(int/*UEventType*/ evt, int arg1, void *arg2, UDispatchInfo & dispatchInfo);
00123
00129     void *GetWidget(int cmd) const;
00130
00133     inline std::map<int, void *> & GetWidgets(void) { return m_widgets; }
00134
00138     bool WidgetIsActive(int cmd) const;
00139
00143     const char *GetTooltip(int cmd) const;
00144
00148     void AddTooltip(int cmd, const char *tooltipID);
00149
00153     // \note this timer is removed automatically when the object is removed.
00154     void AddTimer(long lap, int cmd);
00155
00158     void RemoveTimer(int cmd);
00159
00161     std::vector<UTimer> & GetTimers(void);
00162
00167     bool DoModal(int id = 0);
00168
00171     void EndModal(bool result);
00172
00175     virtual void DoDataExchange(bool /*fill*/) {}
00176
00178     virtual void Dismiss(void) {}
00179
00181     static bool HasModal(void);
00182
00186     static bool IsUIValid(); /*{ return sValidMenu; }*/
00187
00194     static void DoValidUI(bool how); /*{ sValidMenu = how; } */
00195
00199     virtual void BeforeUpdateUI(void) {}
00200
00204     static int GetFocus(void); /*{ return sFocusWidID; } */
00205     static int GetFocusCmd(void); /*{ return sFocusCmdID; }*/
00206
00208     inline bool HasFocus(void) { return GetFocus() == GetWidID(); }
00209
00211     inline bool HasFocus(int cmdid) { return GetFocus() == GetWidID() && GetFocusCmd() == cmdid; }
00212
00216     void AddPage(UWidget *page, int pagecmd, int num_page);
00217
00218 #ifdef WIN32
00219     void OverideMapWidget(int cmdid, CRuntimeClass *widClass);
00220     inline std::map<int, CRuntimeClass *> & GetOverideList(void) { return m_overide; }
00221         // use a class instead of the one by default for this item.
00222         // to call before DoModal, before the widgets get created.
00223
00224     inline CDialog *GetCurModal() const { return m_curModal; }
00225         // during DoModal, this value is set to the MFC dialog
00226 #endif
00227 #if qMacPP || qMacAPP
00228
00229     static SInt32 GetPaneID(int cmdid);
00230 #endif
00231 protected:
00232
00233     std::vector<UCmdTarget *> m_listeners;
00234     std::map<int, void *> m_widgets;
00235     std::map<int, UStr> m_tooltips;
00236     std::vector<UTimer> m_timers;
00237     std::map<int, UWidget *> m_tabs;
00238
00239     bool m_modalRes;
00240     int m_currentPage;
00241 #if qGTK || qMacPP
00242     bool m_modalLoop;
00243 #endif
00244 #ifdef WIN32
00245     CDialog *m_curModal;
00246     std::map<int, CRuntimeClass *> m_overide; // see WinInitWidgets
00247     bool m_noDispatch;
00248 #endif
00249     static bool sValidMenu;
00250
00251     static int sFocusWidID;
00252     static int sFocusCmdID;
00253
00257     ev_msg int OnGetState(int cmd);
00261     ev_msg void OnSetState(int cmd, int state);
00265     ev_msg void OnEnableCmd(int cmd, int state);
00268     ev_msg void OnChgFocus(int cmd);
00271     ev_msg void OnInvalidate(int cmd);
00274     ev_msg void OnRedraw(int cmd);
00278     ev_msg void OnSetText(int cmd, const char *text);
00282     ev_msg void OnGetText(int cmd, UStr *text);
00286     ev_msg void OnSetFloat(int cmd, const float *f);
00290     ev_msg void OnGetFloat(int cmd, float *f);
00294     ev_msg void OnInitWidget(int cmd, void *widget);
00300     ev_msg void OnInitTabWidget(int cmd, int page, void *widget);
00304     ev_msg void OnShowWidget(int cmd, int state);
00308     ev_msg void OnSetSlider(int cmd, int pos);
00312     ev_msg void OnGetSliderProperty(int cmd, USLIDER *prop);
00316     ev_msg void OnSetSliderProperty(int cmd, const USLIDER *prop);
00319     ev_msg void OnSetTooltip(int cmd, UCmdUI *pCmdUI);
00323     ev_msg void OnGetLoc(int cmd, URECT * r);
00327     ev_msg void OnSetLoc(int cmd, const URECT * r);
00332     ev_msg void OnChgCursor(int cmd, UCURSOR cursor);
00337     ev_msg void OnUpdateUI(void);
00339     ev_msg void OnTreeResetAll(int cmd);
00341     ev_msg void OnTreeInsert(int cmd, UTREE_INSERT *data);
00343     ev_msg void OnTreeGetInfo(int cmd, UTREE_INFO *data);
00345     ev_msg void OnTreeSetData(int cmd, UTREE_INFO *data);
00347     ev_msg void OnTreeSetIcon(int cmd, UTREE_INFO *data);
00349     ev_msg void OnTreeDelete(int cmd, UTREEITEM item);
00351     ev_msg void OnTreeExpand(int cmd, int collapse, UTREEITEM item);
00353     ev_msg void OnTreeSelect(int cmd, int deselect, UTREEITEM item);
00355     ev_msg void OnTreeGetSel(int cmd, UTREEITEM *item);
00357     ev_msg void OnListAddColumns(int cmd, int num);
00359     ev_msg void OnListSetColTitle(int cmd, int num, const char *title);
00361     ev_msg void OnListSetColWidth(int cmd, int num, int width);
00363     ev_msg void OnListResetAll(int cmd);
00365     ev_msg void OnListAddSel(int cmd, int entry);
00367     ev_msg void OnListDelRow(int cmd, int row);
00369     ev_msg void OnListSetFeedback(int cmd, int turnOn);
00371     ev_msg void OnListNewRow(int cmd, int *num);
00373     ev_msg void OnListRowSetData(int cmd, int row, void *data);
00375     ev_msg void OnListRowGetData(int cmd, int row, void **data);
00377     ev_msg void OnListInsert(int cmd, ULIST_INSERT *data);
00379     ev_msg void OnListGetInfo(int cmd, ULIST_INFO *desc);
00381     ev_msg int OnListGetNextSel(int cmd, int selectedCell);
00383     ev_msg int OnListGetNext(int cmd, int whichCell);
00385     ev_msg void OnListResort(int cmd, int column, UListSorter s);
00387     ev_msg void OnComboResetAll(int cmd);
00389     ev_msg void OnComboAppend(int cmd, const char *txt);
00391     ev_msg void OnComboSetPos(int cmd, int sel);
00393     ev_msg int OnComboGetPos(int cmd, UStr *txt);
00395     ev_msg int OnComboGetCount(int cmd);
00397     ev_msg void OnComboDelSel(int cmd, int sel);
00400     ev_msg void OnComboEnableSel(int cmd, int sel, int state);
00402     ev_msg void OnComboGetMenu(int cmd, UMENU *menu);
00404     ev_msg void OnSmartComboSetFeature(int cmd, int feature);
00406     ev_msg void OnSmartComboSetItems(int cmd, CMString* items);
00408     ev_msg void OnSmartComboSetReadOnly(int cmd, bool readOnly);
00410     ev_msg int OnUpdateFocus(int leave, void *widget);
00412     ev_msg int OnFetchCmd(int cmd, void *widget);
00414     ev_msg void OnPageChanged(int cmd, int pagenum);
00415
00416     UDECLARE_MESSAGE_MAP()
00417
00418 #if qMacPP
00419     friend class LPseudoWinAttachment;
00420 #endif
00421 #ifdef WIN32
00422     friend LRESULT UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam);
00423 #endif
00424 };
00425
00426 #endif /* __cplusplus */
00427
00428 #endif /* UWIDGET_H */
Generated on Sun Feb 24 01:21:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


File Member Index

WinCvs Source File Members

_ | a | b | c | d | e | f | g | h | i | k | l | m | n | o | p | q | r | s | t | u | v | w

Here is a list of all file members with links to the files they belong to:

- _ -

  • __Assert() : CvsTrace.h
  • __cvs_initialize() : dll_glue.c
  • __cvs_terminate() : dll_glue.c
  • __FNM_FLAGS : fnmatch.h
  • __glue_consoleerr : dll_glue.c
  • __glue_consolein : dll_glue.c
  • __glue_consoleout : dll_glue.c
  • __glue_eventdispatch : dll_glue.c
  • __glue_exit_code : dll_glue.c
  • __glue_getenv : dll_glue.c
  • __GNU_LIBRARY__ : getopt.h
  • __initialize() : dll_glue.c
  • __MIDL_itf_cvs_coworker_0000_v0_0_c_ifspec : cvs_coworker.h
  • __MIDL_itf_CVS_Coworker_0000_v0_0_c_ifspec : CVS_Coworker.h, CVS_Coworker_i.h
  • __MIDL_itf_cvs_coworker_0000_v0_0_s_ifspec : cvs_coworker.h
  • __MIDL_itf_CVS_Coworker_0000_v0_0_s_ifspec : CVS_Coworker.h, CVS_Coworker_i.h
  • __MIDL_ProcFormatString : CVS_Coworker_p.c
  • __MIDL_TypeFormatString : CVS_Coworker_p.c
  • __no_msl_lf_convert : dll_glue.c
  • __pad0__ : cvs_coworker.h
  • __pad1__ : CVS_Coworker_i.h
  • __pad2__ : CVS_Coworker.h
  • __PROTO : getline.h
  • __REQUIRED_RPCNDR_H_VERSION__ : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • __REQUIRED_RPCPROXY_H_VERSION__ : CVS_Coworker_p.c
  • __STDC__ : TclGlue.cpp, getopt.h, fnmatch.h
  • __terminate() : dll_glue.c
  • _AfxRelease() : CJHtmlView.cpp
  • _ANSI_ARGS_() : TclGlue.cpp
  • _ATL_APARTMENT_THREADED : StdAfx.h
  • _CarbonCompatCallLibrary() : TclGlue.mac.h
  • _CJX_COMMENT : CJLibrary.h
  • _CJX_EXT_CLASS : CJLibrary.h, StdAfx.h
  • _CJX_MESSAGE : CJLibrary.h
  • _CjxChildWindowFromPoint() : CJReBar.cpp
  • _CjxGetDlgCtrlID : CJReBar.cpp
  • _CJXLIB_INLINE : CJLibrary.h, StdAfx.h
  • _CLR_TO_RGBQUAD : CJToolBar.cpp
  • _ComCtlVersion : CJToolBar.h, CJToolBar.cpp
  • _COMMON_PY_DECL_CLASS : PythonMacros.h
  • _Compare() : CustomizeMenus.cpp, BrowseViewColumn.h, BrowseViewColumn.cpp
  • _CompatCallLibrary() : dll_loader.h, dll_loader.c
  • _countof : BrowseViewColumn.cpp, uevent.cpp
  • _cvs_coworker_CHECK_IID : CVS_Coworker_p.c
  • _CVS_Coworker_CHECK_IID : CVS_Coworker_p.c
  • _cvs_coworker_IID_Lookup() : CVS_Coworker_p.c
  • _CVS_Coworker_IID_Lookup() : CVS_Coworker_p.c
  • _cvs_coworker_InterfaceNamesList : CVS_Coworker_p.c
  • _CVS_Coworker_InterfaceNamesList : CVS_Coworker_p.c
  • _cvs_coworker_ProxyVtblList : CVS_Coworker_p.c
  • _CVS_Coworker_ProxyVtblList : CVS_Coworker_p.c
  • _cvs_coworker_StubVtblList : CVS_Coworker_p.c
  • _CVS_Coworker_StubVtblList : CVS_Coworker_p.c
  • _cvsgui_readfd : cvsgui_protocol.h, cvsgui.c
  • _cvsgui_writefd : cvsgui_protocol.h, cvsgui.c
  • _delete : CJLibrary.h, StdAfx.h
  • _destroyIcon : StdAfx.h
  • _dosmaperr() : Stat.cpp
  • _dropDownWidth : CJToolBar.cpp
  • _FNMATCH_H : fnmatch.h
  • _GetComCtlVersion() : CJToolBar.h, CJToolBar.cpp
  • _GetDropDownWidth() : CJToolBar.cpp
  • _getline_h_ : getline.h
  • _GetMenuEntryRecurs() : wincvs_winutil.cpp
  • _GETOPT_H : getopt.h
  • _getopt_initialize() : getopt.c
  • _getopt_internal() : getopt.h, getopt.c
  • _glue_buf : dll_glue.c
  • _gnColumnWidth : UCvsFiles.cpp
  • _gp_console_destroy() : cvsgui_process.cpp
  • _gp_console_read() : cvsgui_process.cpp
  • _gp_console_write() : cvsgui_process.cpp
  • _gp_getenv_destroy() : cvsgui_process.cpp
  • _gp_getenv_read() : cvsgui_process.cpp
  • _gp_getenv_write() : cvsgui_process.cpp
  • _gp_quit_destroy() : cvsgui_process.cpp
  • _gp_quit_read() : cvsgui_process.cpp
  • _gp_quit_write() : cvsgui_process.cpp
  • _gszColumnLabel : UCvsFiles.cpp
  • _ICvsCoworkerStubVtbl : CVS_Coworker_p.c
  • _LIBC : getopt.h
  • _loadPersistentSettings() : Persistent.cpp
  • _LoadSysColorBitmap() : CJToolBar.h, CJToolBar.cpp
  • _Module : wincvs.cpp, StdAfx.h
  • _Py_NoneStruct_glue : PythonGlue.impl.h
  • _Py_TrueStruct_glue : PythonGlue.impl.h
  • _Py_ZeroStruct_glue : PythonGlue.impl.h
  • _PyObject_Del : PythonGlue.impl.h
  • _PyObject_Del_glue : PythonGlue.impl.h
  • _PyObject_New : PythonGlue.impl.h
  • _PyObject_New_glue : PythonGlue.impl.h
  • _RGB_TO_RGBQUAD : CJToolBar.cpp
  • _RpcTransferSyntax : CVS_Coworker_p.c
  • _statcore() : Stat.cpp
  • _stderr_style : PythonGlue.cpp
  • _stdout_style : PythonGlue.cpp
  • _sysColorMap : CJToolBar.cpp
  • _TCL_CALLBACK : TclGlue.cpp
  • _tcl_cfm_macho() : TclGlue.mac.h
  • _trace_style : PythonGlue.cpp
  • _VC_VERSION_5 : CJLibrary.h, StdAfx.h

- a -
  • addAccel() : umenu.cpp
  • AddFiles() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • AddIndent() : CvsTrace.cpp
  • AddPrefix() : CvsTrace.cpp
  • AdjustRectangle() : CJDockContext.cpp
  • AFX_ADMINOPTIONDLG_H__C9A89564_F0A4_4294_8C6C_18469D18BCB3__INCLUDED_ : AdminOptionDlg.h
  • AFX_ANNOTATEDLG_H__864729EE_838B_473D_8723_E1269829F781__INCLUDED_ : AnnotateDlg.h
  • AFX_ASKYESNO_H__5946A8C4_8517_11D1_8949_444553540000__INCLUDED_ : AskYesNo.h
  • AFX_BROWSEFILEVIEW_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_ : BrowseFileView.h
  • AFX_BROWSERBAR_H__64721953_F9A8_11D2_BDEC_000000000000__INCLUDED_ : BrowserBar.h
  • AFX_CHECKOUTDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_ : CheckoutDlg.h
  • AFX_CHILDFRM_H__09F456BF_0018_11D2_BCAA_000000000000__INCLUDED_ : LogFrm.h
  • AFX_COLORSTATIC_H__4D2B055E_F042_428F_A662_09ABEA902DCE__INCLUDED_ : ColorStatic.h
  • AFX_COMMITDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_ : CommitDlg.h
  • AFX_CUSTOMIZEMENUS_H__28A6AE7E_C54B_47A5_A8F5_A127E2E9F3BF__INCLUDED_ : CustomizeMenus.h
  • AFX_CVSALERT_H__ACFE8C41_9836_11D1_AE50_00C0F0067852__INCLUDED_ : CvsAlert.h
  • AFX_CVSFILENAMES_H__582FF616_FAA5_11D2_B442_0080C6F9179D__INCLUDED_ : CvsFilenames.h
  • AFX_CVSPROJECT_H__582FF611_FAA5_11D2_B442_0080C6F9179D__INCLUDED_ : CvsProject.h
  • AFX_CVSSTATUSBAR_H__F549ACF2_ECFE_4933_A05D_5FC8248C3CD4__INCLUDED_ : CvsStatusBar.h
  • AFX_DIFFDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_ : DiffDlg.h
  • AFX_DLLGETVERSIONPROC : CJToolBar.cpp
  • AFX_EDITORMONDLG_H__5146BF16_567B_4017_A1FD_619A7BD07906__INCLUDED_ : EditorMonDlg.h
  • AFX_EXPLOREBAR_H__A132A164_1A90_11D3_B1A1_004095463819__INCLUDED_ : ExploreBar.h
  • AFX_FILETRAVERSAL_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_ : FileTraversal.h
  • AFX_GETPASSWORD_H__5946A8C4_8517_11D1_8949_444553540000__INCLUDED_ : GetPassword.h
  • AFX_GETPREFS_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_ : GetPrefs.h
  • AFX_GETVALUE_H__5946A8C3_8517_11D1_8949_444553540000__INCLUDED_ : GetValue.h
  • AFX_GRAPHDOC_H__09F456C1_0018_11D2_BCAA_000000000000__INCLUDED_ : GraphDoc.h
  • AFX_GRAPHFRM_H__09F456BF_0018_11D2_BCAA_000000000000__INCLUDED_ : GraphFrm.h
  • AFX_GRAPHOPTDLG_H__E05908EC_20A6_43FE_93C7_0964E6ABB6B1__INCLUDED_ : GraphOptDlg.h
  • AFX_GRAPHVIEW_H__7A07C311_03F9_11D2_BCB2_000000000000__INCLUDED_ : GraphView.h
  • AFX_HISTCOMBOBOXEX_H__E330E7B9_8C79_44CB_8F07_01D395975365__INCLUDED_ : HistComboBoxEx.h
  • AFX_IDW_SIZEBAR_BOTTOM : CJControlBar.h
  • AFX_IDW_SIZEBAR_LEFT : CJControlBar.h
  • AFX_IDW_SIZEBAR_RIGHT : CJControlBar.h
  • AFX_IDW_SIZEBAR_TOP : CJControlBar.h
  • AFX_IMPORTDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_ : ImportDlg.h
  • AFX_IMPORTFILDERDLG_H__CFB7AA41_BDDB_11D1_B965_0020AF51D9DA__INCLUDED_ : ImportFilterDlg.h
  • AFX_IMPORTFILTER_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_ : ImportFilter.h
  • AFX_INITDLG_H__155D02C3_2323_11D3_B1A6_004095463819__INCLUDED_ : InitDlg.h
  • AFX_LINECMD_H__5946A8C5_8517_11D1_8949_444553540000__INCLUDED_ : LineCmd.h
  • AFX_LOGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_ : LogParse.h, LogDlg.h
  • AFX_MAINFRM_H__D2D77DCC_8299_11D1_8949_444553540000__INCLUDED_ : MainFrm.h
  • AFX_NOPYTHON_H__F675DE42_0FA7_4785_8946_E8FC861BBA57__INCLUDED_ : NoPython.h
  • AFX_OPTIONALPROPERTYSHEET_H__F82DC8BB_73CD_4AEA_8635_1A0932F24C7D__INCLUDED_ : OptionalPropertySheet.h
  • AFX_PROGRESSDIALOG_H__09D80542_6467_11D3_85F5_00609419FCC1__INCLUDED_ : ProgressDialog.h
  • AFX_PSEUDODLG_H__9EDC5FE5_21FD_4ACE_9AEB_7A521350A2EE__INCLUDED_ : PseudoDlg.h
  • AFX_PSEUDOLIST_H__49AF86B3_E6AB_4885_843C_1CE5AC8C4980__INCLUDED_ : pseudolist.h
  • AFX_RELEASEDLG_H__12B5FA97_703E_4616_B361_F2917D45E54A__INCLUDED_ : ReleaseDlg.h
  • AFX_RTAGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_ : RtagDlg.h
  • AFX_SMARTCOMBOBOX_H__E3F8DAE6_C2EF_49CE_AE52_3AE54F5A629C__INCLUDED_ : SmartComboBox.h
  • AFX_STATICDRAW_H__8DCC3165_D42E_4FAA_BCCF_F4328685535E__INCLUDED_ : PseudoDraw.h
  • AFX_STDAFX_H__D2D77DCA_8299_11D1_8949_444553540000__INCLUDED_ : StdAfx.h
  • AFX_STDAFX_H__EDF5958A_92F6_11D3_9365_00C0F00AE104__INCLUDED_ : StdAfx.h
  • AFX_STDAFX_H__F235A078_2921_11D3_8733_000000000000__INCLUDED_ : StdAfx.h
  • AFX_TAGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_ : TagDlg.h
  • AFX_TBEDIT_H__AEA5EC19_1292_4A30_93EA_E209A6BAE000__INCLUDED_ : TbEdit.h
  • AFX_TOOLBARCOMBO_H__3AE857F3_B4BD_11D4_8200_005004D6EF6C__INCLUDED_ : ToolbarCombo.h
  • AFX_UPDATEDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_ : UpdateDlg.h
  • AFX_WINCVS_H__D2D77DC7_8299_11D1_8949_444553540000__INCLUDED_ : wincvs.h
  • AFX_WINCVSBROWSER_H__144A4971_CAB4_11D1_BC80_000000000000__INCLUDED_ : WinCvsBrowser.h
  • AFX_WINCVSDOC_H__D2D77DCE_8299_11D1_8949_444553540000__INCLUDED_ : wincvsDoc.h
  • AFX_WINCVSVIEW_H__D2D77DD0_8299_11D1_8949_444553540000__INCLUDED_ : wincvsView.h
  • ALT_STROKE : umenu.cpp
  • ANSI_SGM_BC_BLK : CTCP2Parse.cpp
  • ANSI_SGM_BC_BLU : CTCP2Parse.cpp
  • ANSI_SGM_BC_CYN : CTCP2Parse.cpp
  • ANSI_SGM_BC_DEFAULT : CTCP2Parse.cpp
  • ANSI_SGM_BC_GRN : CTCP2Parse.cpp
  • ANSI_SGM_BC_MAG : CTCP2Parse.cpp
  • ANSI_SGM_BC_RED : CTCP2Parse.cpp
  • ANSI_SGM_BC_WHT : CTCP2Parse.cpp
  • ANSI_SGM_BC_YEL : CTCP2Parse.cpp
  • ANSI_SGM_FC_BLK : CTCP2Parse.cpp
  • ANSI_SGM_FC_BLU : CTCP2Parse.cpp
  • ANSI_SGM_FC_CYN : CTCP2Parse.cpp
  • ANSI_SGM_FC_DEFAULT : CTCP2Parse.cpp
  • ANSI_SGM_FC_GRN : CTCP2Parse.cpp
  • ANSI_SGM_FC_MAG : CTCP2Parse.cpp
  • ANSI_SGM_FC_RED : CTCP2Parse.cpp
  • ANSI_SGM_FC_WHT : CTCP2Parse.cpp
  • ANSI_SGM_FC_YEL : CTCP2Parse.cpp
  • ANSI_SGM_TA_BLINK : CTCP2Parse.cpp
  • ANSI_SGM_TA_BLINK_OFF : CTCP2Parse.cpp
  • ANSI_SGM_TA_BOLD : CTCP2Parse.cpp
  • ANSI_SGM_TA_CONSEAL : CTCP2Parse.cpp
  • ANSI_SGM_TA_FAINT : CTCP2Parse.cpp
  • ANSI_SGM_TA_ITALIC : CTCP2Parse.cpp
  • ANSI_SGM_TA_ITALIC_OFF : CTCP2Parse.cpp
  • ANSI_SGM_TA_NORMAL : CTCP2Parse.cpp
  • ANSI_SGM_TA_RESET : CTCP2Parse.cpp
  • ANSI_SGM_TA_REV : CTCP2Parse.cpp
  • ANSI_SGM_TA_REV_OFF : CTCP2Parse.cpp
  • ANSI_SGM_TA_ULINE : CTCP2Parse.cpp
  • ANSI_SGM_TA_ULINE_OFF : CTCP2Parse.cpp
  • AppendMenu : CJMenu.h
  • AppendODMenu : CJMenu.h
  • AppendODPopupMenu : CJMenu.h
  • AppendWinCvsDebugMask() : WinCvsDebug.h, WinCvsDebug.cpp
  • AskCreatePersistentSettings() : Persistent.h, Persistent.cpp
  • AskYesNo() : AskYesNo.h, AskYesNo.cpp
  • ASSERT : CvsTrace.h
  • ATTRIBUTES : ndir.c
  • AuthenKind : Authen.h
  • AUTO_INITALIZE : dll_garbage.c

- b -
  • BFT_BITMAP : dib.h
  • biBits : dib.c
  • BM_ALLOC : dib.h
  • BM_FREE : dib.h
  • bNotWin4 : GfxSplitterWnd.cpp
  • BROWSE_TYPE : CJBrowseEdit.h
  • BrowserGetDirectory() : PromptFiles.h, PromptFiles.cpp
  • BrowserGetMultiFiles() : PromptFiles.h, PromptFiles.cpp
  • BT_DIRECTORY : CJBrowseEdit.h
  • BT_FILE : CJBrowseEdit.h
  • BT_POPUPMENU : CJBrowseEdit.h
  • BTN_IMG_INDEX : CJControlBar.h
  • buf : CvsArgs.cpp
  • BUF_SIZE : cvsgui.c
  • BUFFSIZE : cvsgui_process.cpp
  • build_command() : cvsgui_process.cpp
  • BuildIgnoredList() : CvsIgnore.h, CvsIgnore.cpp
  • buildTail() : findtcl.cpp
  • buildWildTail() : findtcl.cpp

- c -
  • calloc : dll_garbage.h
  • CarbonCompatCloseLibrary() : TclGlue.mac.h
  • CarbonCompatLoadLibrary() : TclGlue.mac.h
  • CATCH_EXCEPTIONS : CvsCoworker.cpp
  • cBOB : CvsString.cpp
  • CBOLD : CTCP2Parse.cpp
  • cbQuanta : CvsString.cpp
  • CCOLOR : CTCP2Parse.cpp
  • CCTCP2 : CTCP2Parse.cpp
  • cEOB : CvsString.cpp
  • CG_IDP_FILE_CORRUPT : resource.h
  • CG_IDS_DIDYOUKNOW : resource.h
  • CG_IDS_FILE_ABSENT : resource.h
  • CG_IDS_TIPOFTHEDAY : resource.h
  • CG_IDS_TIPOFTHEDAYHELP : resource.h
  • CG_IDS_TIPOFTHEDAYMENU : resource.h
  • CheckBuffer() : CvsString.cpp
  • CheckinFiles() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • CheckoutFiles() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • CHILD_BORDER : CJControlBar.h
  • CINTERFACE_PROXY_VTABLE() : CVS_Coworker_p.c
  • CJLibraryDLL : CJLibrary.cpp
  • cleanUpLogMsg() : CvsCommands.h, CvsCommands.cpp
  • CListViews : CJTabView.h
  • cloneStr() : CvsEntries.cpp
  • close_consoles() : cvsgui.c
  • closedir() : ndir.h, ndir.c
  • CloseProject() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • CLSID : CVS_Coworker_i.c
  • clsid : wincvs.cpp
  • CLSID_CvsCoworker : CVS_Coworker_i.c, CVS_Coworker.h, CVS_Coworker_i.h, CVS_Coworker_i.c, cvs_coworker.h
  • CM_ONPUSHPINBUTTON : CJCaptionPopupWnd.h
  • CM_ONPUSHPINCANCEL : CJCaptionPopupWnd.h
  • cmdABOUT : UCvsCommands.h
  • cmdADD : UCvsCommands.h
  • cmdADDB : UCvsCommands.h
  • cmdARRANGE : UCvsCommands.h
  • cmdBROWSER_BAR : UCvsCommands.h
  • cmdCASCADE : UCvsCommands.h
  • cmdCHECKOUT : UCvsCommands.h
  • cmdCLEAR_ALL : UCvsCommands.h
  • cmdCMDLINE : UCvsCommands.h
  • cmdCOMMIT : UCvsCommands.h
  • cmdCONSOLE_BAR : UCvsCommands.h
  • cmdCOPY : UCvsCommands.h
  • cmdCOPYRIGHTS : UCvsCommands.h
  • cmdCREDITS : UCvsCommands.h
  • cmdCUT : UCvsCommands.h
  • cmdCVS : UCvsCommands.h
  • cmdCVSCLIENT : UCvsCommands.h
  • cmdDIFF : UCvsCommands.h
  • cmdEDIT : UCvsCommands.h
  • cmdEDITORS : UCvsCommands.h
  • cmdEDITSEL : UCvsCommands.h
  • cmdEDITSELDEF : UCvsCommands.h
  • cmdEXIT : UCvsCommands.h
  • cmdEXPLORE : UCvsCommands.h
  • cmdFILES_BAR : UCvsCommands.h
  • cmdFIND : UCvsCommands.h
  • cmdFINDER : UCvsCommands.h
  • cmdFONT : UCvsCommands.h
  • cmdGRAPH : UCvsCommands.h
  • cmdIGNORE : UCvsCommands.h
  • CMDIMenuList : CJMDIFrameWnd.h
  • cmdIMPORT : UCvsCommands.h
  • cmdINIT : UCvsCommands.h
  • cmdLOCKF : UCvsCommands.h
  • cmdLOG : UCvsCommands.h
  • cmdLOGIN : UCvsCommands.h
  • cmdLOGOUT : UCvsCommands.h
  • cmdMACROADMIN : UCvsCommands.h
  • cmdMACROADMINEND : UCvsCommands.h
  • cmdMULTI_BAR : UCvsCommands.h
  • cmdOPEN : UCvsCommands.h
  • cmdPASTE : UCvsCommands.h
  • cmdPREFERENCES : UCvsCommands.h
  • cmdPRINT : UCvsCommands.h
  • cmdPRINT_PREVIEW : UCvsCommands.h
  • cmdPRINT_SETUP : UCvsCommands.h
  • cmdQUERYUPDATE : UCvsCommands.h
  • cmdRELEASE : UCvsCommands.h
  • cmdRELOAD : UCvsCommands.h
  • cmdREPEAT : UCvsCommands.h
  • cmdRMV : UCvsCommands.h
  • cmdRTAGBRANCH : UCvsCommands.h
  • cmdRTAGCREATE : UCvsCommands.h
  • cmdRTAGDELETE : UCvsCommands.h
  • cmdSAVE : UCvsCommands.h
  • cmdSAVE_AS : UCvsCommands.h
  • cmdSAVESETTINGS : UCvsCommands.h
  • cmdSELECT_ALL : UCvsCommands.h
  • cmdSELMACRO : UCvsCommands.h
  • cmdSELMACROEND : UCvsCommands.h
  • cmdSEND_MAIL : UCvsCommands.h
  • cmdSTATUS : UCvsCommands.h
  • cmdSTATUS_BAR : UCvsCommands.h
  • cmdSTOPCVS : UCvsCommands.h
  • cmdTAGBRANCH : UCvsCommands.h
  • cmdTAGDELETE : UCvsCommands.h
  • cmdTAGNEW : UCvsCommands.h
  • cmdTAGS_BAR : UCvsCommands.h
  • cmdTILE_HORZ : UCvsCommands.h
  • cmdTOOLBAR : UCvsCommands.h
  • cmdTRASH : UCvsCommands.h
  • cmdUNDO : UCvsCommands.h
  • cmdUNEDIT : UCvsCommands.h
  • cmdUNLOCKF : UCvsCommands.h
  • cmdUPDATE : UCvsCommands.h
  • cmdUPFOLDER : UCvsCommands.h
  • cmdWATCHERS : UCvsCommands.h
  • cmdWATCHOFF : UCvsCommands.h
  • cmdWATCHON : UCvsCommands.h
  • cmdWORKSPACE : UCvsCommands.h
  • COLOR_BLACK : CJControlBar.cpp
  • COLOR_WHITE : CJControlBar.cpp
  • columnsRecursive : BrowseViewColumn.cpp
  • columnsRegular : BrowseViewColumn.cpp
  • combozify() : CommitDlg.h, CommitDlg.cpp
  • compareConflict() : UCvsFiles.cpp
  • compareName() : UCvsFiles.cpp
  • compareOption() : UCvsFiles.cpp
  • compareRevs() : UCvsFiles.cpp
  • compareStatus() : UCvsFiles.cpp
  • compareTag() : UCvsFiles.cpp
  • CompareTargetDate() : Stat.cpp
  • CompatBeginMoveToTrash() : MoveToTrash.h, MoveToTrash.cpp
  • CompatCallLibrary1 : dll_loader.h
  • CompatCallLibrary2 : dll_loader.h
  • CompatCallLibrary3 : dll_loader.h
  • CompatCloseLibrary() : dll_loader.h, dll_loader.c
  • CompatConnectID : dll_loader.h
  • CompatEndMoveToTrash() : MoveToTrash.h, MoveToTrash.cpp
  • CompatFuncArg : dll_loader.h
  • CompatGetAdminOptions() : AdminOptionDlg.h, AdminOptionDlg.cpp
  • CompatGetAnnotate() : AnnotateDlg.h, AnnotateDlg.cpp
  • CompatGetCheckout() : CheckoutDlg.h, CheckoutDlg.cpp
  • CompatGetCommand() : LineCmd.h, LineCmd.cpp
  • CompatGetCommit() : CommitDlg.h, CommitDlg.cpp
  • CompatGetDiff() : DiffDlg.h, DiffDlg.cpp
  • CompatGetEditorMsg() : EditorMonDlg.h, EditorMonDlg.cpp
  • CompatGetGraphOptions() : GraphOptDlg.h, GraphOptDlg.cpp
  • CompatGetImport() : ImportDlg.h, ImportDlg.cpp
  • CompatGetInit() : InitDlg.h, InitDlg.cpp
  • CompatGetLog() : LogDlg.h, LogDlg.cpp
  • CompatGetPassword() : GetPassword.h, GetPassword.cpp
  • CompatGetPrefs() : GetPrefs.h, GetPrefs.cpp
  • CompatGetRelease() : ReleaseDlg.h, ReleaseDlg.cpp
  • CompatGetUpdate() : UpdateDlg.h, UpdateDlg.cpp
  • CompatGetValue() : GetValue.h, GetValue.cpp
  • CompatImportFilter() : ImportFilterDlg.h, ImportFilterDlg.cpp
  • CompatLoadLibrary() : dll_loader.h, dll_loader.c
  • CompatMakeSurePathExists() : MakeSurePathExists.h, MakeSurePathExists.cpp
  • CompatMoveToTrash() : MoveToTrash.h, MoveToTrash.cpp
  • CompatRtagBranch() : RtagDlg.h, RtagDlg.cpp
  • CompatRtagCreate() : RtagDlg.h, RtagDlg.cpp
  • CompatRtagDelete() : RtagDlg.h, RtagDlg.cpp
  • CompatTagBranch() : TagDlg.h, TagDlg.cpp
  • CompatTagCreate() : TagDlg.h, TagDlg.cpp
  • CompatTagDelete() : TagDlg.h, TagDlg.cpp
  • computeLR : SortList.h
  • computeNone : SortList.h
  • computeSort : SortList.h
  • conflictColumn : BrowseViewColumn.cpp
  • CopyRect() : udraw.h
  • CopyScreenToBitmap() : dib.h, dib.c
  • CopyString() : CvsCoworker.cpp
  • CP_MODE_BK : CJColorPicker.h
  • CP_MODE_TEXT : CJColorPicker.h
  • CPInfo : CJMenu.cpp
  • CPN_CLOSEUP : CJColorPopup.h
  • CPN_DROPDOWN : CJColorPopup.h
  • CPN_SELCHANGE : CJColorPopup.h
  • CPN_SELENDCANCEL : CJColorPopup.h
  • CPN_SELENDOK : CJColorPopup.h
  • CPStr : CPStr.h
  • CreateDIB() : dib.h, dib.c
  • CreateFolder() : MakeSurePathExists.h, MakeSurePathExists.cpp
  • CreateMainMenubar() : UCvsMenubar.h, UCvsMenubar.cpp
  • CreateMainToolbar() : UCvsToolbar.h, UCvsToolbar.cpp
  • CREV : CTCP2Parse.cpp
  • CSTOP : CTCP2Parse.cpp
  • CStr : CPStr.h
  • CTabList : CJFlatTabCtrl.h
  • CTabViews : CJTabCtrlBar.h
  • CTCP2_TOGGLE : CTCP2Parse.cpp
  • CTRL_STROKE : umenu.cpp
  • CTRLALT_STROKE : umenu.cpp
  • CTV_ITEM : CJTabView.h
  • CUNDR : CTCP2Parse.cpp
  • current_cvs_process : cvsgui_process.cpp
  • current_write_buffer : cvsgui_process.cpp
  • current_write_buffer_index : cvsgui_process.cpp
  • CustGetByKey() : CustomizeMenus.h, CustomizeMenus.cpp
  • CUSTOM_BOX_VALUE : CJColorPopup.cpp
  • CustomizeMenus() : wincvs_winutil.h, wincvs_winutil.cpp
  • cvs_coworker_ProxyFileInfo : CVS_Coworker_p.c
  • CVS_Coworker_ProxyFileInfo : CVS_Coworker_p.c
  • CVS_E_FAILED : CvsCoworkerErrors.h
  • CVS_E_FAILED_CHECKIN_DISALLOWED : CvsCoworkerErrors.h
  • CVS_E_FAILED_CHECKIN_FILES : CvsCoworkerErrors.h
  • CVS_E_FAILED_CHECKIN_NEED_UPDATE : CvsCoworkerErrors.h
  • CVS_E_FAILED_CHECKIN_NOT_IN_CVS : CvsCoworkerErrors.h
  • CVS_E_FAILED_CHECKOUT_DISALLOWED : CvsCoworkerErrors.h
  • CVS_E_FAILED_CHECKOUT_FILES : CvsCoworkerErrors.h
  • CVS_E_FAILED_CHECKOUT_NOT_IN_CVS : CvsCoworkerErrors.h
  • CVS_E_FAILED_CLOSE_PROJECT : CvsCoworkerErrors.h
  • CVS_E_FAILED_OPEN_BAD_PATH : CvsCoworkerErrors.h
  • CVS_E_FAILED_OPEN_CREATE : CvsCoworkerErrors.h
  • CVS_E_FAILED_OPEN_DISALLOWED : CvsCoworkerErrors.h
  • CVS_E_FAILED_OPEN_INVALID_USER : CvsCoworkerErrors.h
  • CVS_E_FAILED_OPEN_PROJECT : CvsCoworkerErrors.h
  • CVS_E_FAILED_PROJECT_INVALID : CvsCoworkerErrors.h
  • CVS_E_FAILED_UPDATE_DISALLOWED : CvsCoworkerErrors.h
  • CVS_E_FAILED_UPDATE_FILES : CvsCoworkerErrors.h
  • CVS_E_FAILED_UPDATE_NOT_IN_CVS : CvsCoworkerErrors.h
  • cvs_err() : AppConsole.h, AppConsole.cpp
  • cvs_errstr() : AppConsole.h, AppConsole.cpp
  • CVS_EXTERN_C : AppGlue.cpp
  • cvs_out() : AppConsole.h, AppConsole.cpp
  • cvs_outstr() : AppConsole.h, AppConsole.cpp
  • cvs_process_close() : cvsgui_process.cpp
  • cvs_process_destroy() : cvsgui_process.cpp
  • cvs_process_flush() : cvsgui_process.cpp
  • cvs_process_give_time() : cvsgui_process.h, cvsgui_process.cpp
  • cvs_process_handle_message() : cvsgui_process.cpp
  • cvs_process_init() : cvsgui_process.h, cvsgui_process.cpp
  • cvs_process_is_active() : cvsgui_process.h, cvsgui_process.cpp
  • cvs_process_kill() : cvsgui_process.h, cvsgui_process.cpp
  • cvs_process_new() : cvsgui_process.cpp
  • cvs_process_open() : cvsgui_process.h, cvsgui_process.cpp
  • cvs_process_pop() : cvsgui_process.cpp
  • cvs_process_push() : cvsgui_process.cpp
  • cvs_process_recv_message() : cvsgui_process.cpp
  • cvs_process_stack : cvsgui_process.cpp
  • cvs_process_write() : cvsgui_process.cpp
  • CvsAlert() : CvsAlert.h, CvsAlert.cpp
  • CvsCmdAddBinaryFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdAddFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdAddFolder() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdAddUnicodeFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdAnnotateFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdCancelChangesFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdCheckoutModule() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdCommitFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdCommitFolder() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdDiffFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdDiffFolder() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdEditFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdEditFolder() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdEditorsFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdEditorsFolder() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdImportModule() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdInit() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdLine() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdLockFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdLockFolder() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdLogFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdLogFolder() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdLogin() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdLogout() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdMacrosAdmin() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdReleaseFolder() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdRemoveFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdRtagBranch() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdRtagCreate() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdRtagDelete() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdStatusFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdStatusFolder() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdTagBranchFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdTagBranchFolder() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdTagCreateFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdTagCreateFolder() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdTagDeleteFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdTagDeleteFolder() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdUneditFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdUneditFolder() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdUnlockFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdUnlockFolder() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdUpdateFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdUpdateFolder() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdWatchersFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdWatchersFolder() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdWatchOffFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdWatchOffFolder() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdWatchOnFiles() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdWatchOnFolder() : CvsCommands.h, CvsCommands.cpp
  • CvsCommand : CVS_Coworker_i.h, CVS_Coworker.idl, cvs_coworker.h, CVS_Coworker.h, CVS_Coworker_i.h, CVS_Coworker.idl, cvs_coworker.h
  • cvsCommandAdd : CVS_Coworker_i.h, CVS_Coworker.idl, cvs_coworker.h
  • cvsCommandCheckin : CVS_Coworker_i.h, CVS_Coworker.idl, cvs_coworker.h
  • cvsCommandCheckout : CVS_Coworker_i.h, CVS_Coworker.idl, cvs_coworker.h
  • cvsCommandDiff : CVS_Coworker_i.h, CVS_Coworker.idl, cvs_coworker.h
  • cvsCommandHistory : CVS_Coworker_i.h, CVS_Coworker.idl, cvs_coworker.h
  • cvsCommandOptions : CVS_Coworker_i.h, CVS_Coworker.idl, cvs_coworker.h
  • cvsCommandProperties : CVS_Coworker_i.h, CVS_Coworker.idl, cvs_coworker.h
  • cvsCommandRemove : CVS_Coworker_i.h, CVS_Coworker.idl, cvs_coworker.h
  • cvsCommandRename : CVS_Coworker_i.h, CVS_Coworker.idl, cvs_coworker.h
  • cvsCommandUncheckout : CVS_Coworker_i.h, CVS_Coworker.idl, cvs_coworker.h
  • cvsCommandUpdate : CVS_Coworker_i.h, CVS_Coworker.idl, cvs_coworker.h
  • CvsCoworker : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • cvsgui_GetCvsEntries() : PythonGlue.cpp
  • cvsgui_GetFileModTime() : PythonGlue.cpp
  • cvsgui_GetHistoryAsXML() : PythonGlue.cpp
  • cvsgui_GetMainMenuWidget() : PythonGlue.cpp
  • cvsgui_GetSelection() : PythonGlue.cpp
  • cvsgui_GetTopMacroAdminMenu() : PythonGlue.cpp
  • cvsgui_GetTopMacroSelectionMenu() : PythonGlue.cpp
  • cvsgui_LaunchBrowser() : PythonGlue.cpp
  • cvsgui_LaunchTclMacro() : PythonGlue.cpp
  • cvsgui_methods : PythonGlue.cpp
  • cvsgui_PromptEditMessage() : PythonGlue.cpp
  • cvsgui_PromptMessage() : PythonGlue.cpp
  • cvsgui_RunCvs() : PythonGlue.cpp
  • cvsgui_write() : PythonGlue.cpp
  • cvsguiglue_exit() : cvsgui.h, cvsgui.c
  • cvsguiglue_flushconsole() : cvsgui.h, cvsgui.c
  • cvsguiglue_getenv() : cvsgui.h, cvsgui.c
  • cvsguiglue_getpass() : cvsgui.h, cvsgui.c
  • cvsguiglue_main() : cvsgui.h
  • CvsLogOutput() : LogParse.h, LogParse.cpp
  • CvsLogParse() : LogParse.h, LogParse.cpp
  • CVSNTDOS_BUILD : version_no.h
  • CVSNTDOS_FILE_MAJOR : version_no.h
  • CVSNTDOS_FILE_MINOR : version_no.h
  • CVSNTDOS_FILE_PATCHLEVEL : version_no.h
  • CVSNTDOS_FILEVERSION : version_fu.h
  • CVSNTDOS_FILEVERSION_STRING : version_fu.h
  • CvsOption : CVS_Coworker_i.h, CVS_Coworker.idl, cvs_coworker.h, CVS_Coworker.h, CVS_Coworker_i.h, CVS_Coworker.idl, cvs_coworker.h
  • cvsOptionCompareChecksum : CVS_Coworker_i.h, CVS_Coworker.idl, cvs_coworker.h
  • cvsOptionCompareContents : CVS_Coworker_i.h, CVS_Coworker.idl, cvs_coworker.h
  • cvsOptionCompareTimestamp : CVS_Coworker_i.h, CVS_Coworker.idl, cvs_coworker.h
  • CvsProcess : cvsgui_process.h
  • CX_BORDER : GfxSplitterWnd.cpp
  • CX_BORDER_GRIPPER : CJToolBarBase.cpp
  • CX_GRIPPER : CJToolBarBase.cpp
  • CX_OVERLAP : CJToolBar.cpp
  • CY_BORDER : GfxSplitterWnd.cpp
  • CY_BORDER_GRIPPER : CJToolBarBase.cpp
  • CY_GRIPPER : CJToolBarBase.cpp

- d -
  • DATA_TYPE : CJSortClass.h
  • dateColumn : BrowseViewColumn.cpp
  • dbgOnly : findtcl.cpp
  • DD_BMAP : PseudoButton.h
  • DD_END : PseudoButton.h
  • DD_PIXMAP : PseudoButton.h
  • DD_RGB : PseudoButton.h
  • DDBtoDIB() : dib.h
  • DDD_NONE : umain.h
  • DDV_CheckCVSROOT() : wincvs.h, wincvs.cpp
  • DDV_CheckPathExists() : wincvs.h, wincvs.cpp
  • DDV_CJMinMaxDateTime() : CJDateTimeCtrl.h, CJDateTimeCtrl.cpp
  • DDV_CJMinMaxMonth() : CJDateTimeCtrl.h, CJDateTimeCtrl.cpp
  • DDV_MinChars() : wincvs.h, wincvs.cpp
  • DDV_NONE : umain.h
  • DDX_CJColorPicker() : CJColorPicker.h, CJColorPicker.cpp
  • DDX_CJDateTimeCtrl() : CJDateTimeCtrl.h, CJDateTimeCtrl.cpp
  • DDX_CJMonthCalCtrl() : CJDateTimeCtrl.h, CJDateTimeCtrl.cpp
  • DDX_ComboMString() : wincvs.h, wincvs.cpp
  • DDX_OleDateTime() : CJMaskEdit.h, CJMaskEdit.cpp
  • DEBUG_MESSAGE : wincvs.cpp
  • DEC_GLUE : TclGlue.cpp, PythonGlue.impl.h
  • DECLC : TclGlue.cpp
  • DECLSPEC_UUID() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • decodeCVS() : AppGlue.mac.h
  • DEF_CVS_CMD : LineCmd.h
  • DEFAULT_BOX_VALUE : CJColorPopup.cpp
  • DeferClientPos() : GfxSplitterWnd.cpp
  • DIB_HEADER_MARKER : dib.h
  • DibCopyPalette() : dib.h, dib.c
  • DibGetPaletteSize() : dib.h, dib.c
  • DibNumColors() : dib.h, dib.c
  • DIBToBitmap() : dib.h, dib.c
  • DiffFile() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • DIR : ndir.h
  • disposeStr() : CvsEntries.cpp
  • dllglue_consoleerr() : dll_glue.h, dll_glue.c
  • dllglue_consolein() : dll_glue.h, dll_glue.c
  • dllglue_consolein_func : dll_process.h
  • dllglue_consoleout() : dll_glue.h, dll_glue.c
  • dllglue_consoleout_func : dll_process.h
  • dllglue_decode_file() : dll_glue.h, dll_glue.c
  • dllglue_dispatchevent() : dll_glue.h, dll_glue.c
  • dllglue_exit() : dll_glue.h, dll_glue.c
  • dllglue_flushconsole() : dll_glue.h, dll_glue.c
  • dllglue_getenv() : dll_glue.h, dll_glue.c
  • dllglue_getenv_func : dll_process.h
  • dllglue_main() : dll_glue.h, dll_glue.c
  • dllglue_main_func : dll_process.h
  • dllglue_setconsoleerr() : dll_glue.h, dll_glue.c
  • dllglue_setconsolein() : dll_glue.h, dll_glue.c
  • dllglue_setconsoleout() : dll_glue.h, dll_glue.c
  • dllglue_seteventdispatch() : dll_glue.h, dll_glue.c
  • dllglue_setgetenv() : dll_glue.h, dll_glue.c
  • dllglue_setglue_func : dll_process.h
  • DllMain() : CJLibrary.cpp
  • dos : Stat.cpp
  • DrawNode() : GraphView.cpp, UCvsGraph.cpp
  • DrawOctangle() : GraphView.cpp
  • DT_DATETIME : CJSortClass.h
  • DT_DEC : CJSortClass.h
  • DT_INT : CJSortClass.h
  • DT_STRING : CJSortClass.h
  • dwSizeBarMap : CJControlBar.h
  • DYN_LIST : dll_garbage.c

- e -
  • EditStreamCallBack() : wincvsDoc.cpp
  • EGCS_CONST : ustr.h
  • ENT_FILE : CvsEntries.h
  • ENT_SUBDIR : CvsEntries.h
  • ent_type : CvsEntries.h
  • Entries_Open() : CvsEntries.h, CvsEntries.cpp
  • Entries_SetMissing() : CvsEntries.h, CvsEntries.cpp
  • Entries_SetVisited() : CvsEntries.h, CvsEntries.cpp
  • epi_i : umain.h
  • epi_ii : umain.h
  • epi_iVP : umain.h
  • epi_V : umain.h
  • epi_VP : umain.h
  • epNone : umain.h
  • epV_i : umain.h
  • epV_I : umain.h
  • epV_ii : umain.h
  • epV_iii : umain.h
  • epV_iiVP : umain.h
  • epV_IVP : umain.h
  • epV_iVP : umain.h
  • epV_V : umain.h
  • epV_VP : umain.h
  • EqualRect() : udraw.h, udraw.cpp
  • err : Stat.cpp
  • errInternal : AppGlue.h
  • errlog : cvsgui.c
  • errname : cvsgui.c
  • errors : Stat.cpp
  • errseek : cvsgui.c
  • errThreadRunning : AppGlue.h
  • EV_BTNDBLDOWN : umain.h
  • EV_BTNDOWN : umain.h
  • EV_BTNUP : umain.h
  • EV_CHGCURSOR : umain.h
  • EV_CHGFOCUS : umain.h
  • EV_CMD : umain.h
  • EV_COMBO_APPEND : umain.h
  • EV_COMBO_DELSEL : umain.h
  • EV_COMBO_ENABLESEL : umain.h
  • EV_COMBO_GETCOUNT : umain.h
  • EV_COMBO_GETMENU : umain.h
  • EV_COMBO_GETSEL : umain.h
  • EV_COMBO_RESETALL : umain.h
  • EV_COMBO_SEL : umain.h
  • EV_COMBO_SETSEL : umain.h
  • EV_COMMAND_START : umain.h
  • EV_CREATE : umain.h
  • EV_CUSTOM_DRAW : umain.h
  • EV_DESTROY : umain.h
  • EV_DRAGQUERY : umain.h
  • EV_DROPIT : umain.h
  • EV_DROPQUERY : umain.h
  • EV_DROPQUERY_CMDID : umain.h
  • EV_DROPREF : umain.h
  • EV_EDITACTIVATE : umain.h
  • EV_EDITCHANGE : umain.h
  • EV_ENABLECMD : umain.h
  • EV_ENTER : umain.h
  • EV_EXPOSE : umain.h
  • EV_FETCHCMD : umain.h
  • EV_GET_SLIDERPROP : umain.h
  • EV_GETFLOAT : umain.h
  • EV_GETINTEGER : umain.h
  • EV_GETLOC : umain.h
  • EV_GETTEXT : umain.h
  • EV_INIT_TAB_WIDGET : umain.h
  • EV_INIT_WIDGET : umain.h
  • EV_INVALIDATE : umain.h
  • EV_KEYDOWN : umain.h
  • EV_LEAVE : umain.h
  • EV_LIST_ADDCOLUMNS : umain.h
  • EV_LIST_ADDSEL : umain.h
  • EV_LIST_DBLCLICK : umain.h
  • EV_LIST_DELROW : umain.h
  • EV_LIST_GETINFO : umain.h
  • EV_LIST_GETNEXT : umain.h
  • EV_LIST_GETNEXTSEL : umain.h
  • EV_LIST_INSERT : umain.h
  • EV_LIST_NEWROW : umain.h
  • EV_LIST_RESETALL : umain.h
  • EV_LIST_RESORT : umain.h
  • EV_LIST_ROWGETDATA : umain.h
  • EV_LIST_ROWSETDATA : umain.h
  • EV_LIST_SELCOLUMN : umain.h
  • EV_LIST_SELECTING : umain.h
  • EV_LIST_SETCOLTITLE : umain.h
  • EV_LIST_SETCOLWIDTH : umain.h
  • EV_LIST_SETFEEDBACK : umain.h
  • EV_MMOVE : umain.h
  • ev_msg : umain.h
  • EV_NONE : umain.h
  • EV_NOTIFY : umain.h
  • EV_PAGE_CHANGED : umain.h
  • EV_QUERYSTATE : umain.h
  • EV_REDRAW : umain.h
  • EV_RESIZE : umain.h
  • EV_SCROLLCHANGE : umain.h
  • EV_SET_SLIDER : umain.h
  • EV_SET_SLIDERPROP : umain.h
  • EV_SETCURSOR : umain.h
  • EV_SETFLOAT : umain.h
  • EV_SETINTEGER : umain.h
  • EV_SETLOC : umain.h
  • EV_SETSTATE : umain.h
  • EV_SETTEXT : umain.h
  • EV_SETTOOLTIP : umain.h
  • EV_SHOW_WIDGET : umain.h
  • EV_SMARTCOMBO_SETFEATURE : umain.h
  • EV_SMARTCOMBO_SETITEMS : umain.h
  • EV_SMARTCOMBO_SETREADONLY : umain.h
  • EV_TB_BUTTON : umain.h
  • EV_TB_CHECKBTN : umain.h
  • EV_TB_DROPDOWN : umain.h
  • EV_TB_END : umain.h
  • EV_TB_GETCOLOR : umain.h
  • EV_TB_INIT : umain.h
  • EV_TB_SEPARATOR : umain.h
  • EV_TIMER : umain.h
  • EV_TREE_DELETE : umain.h
  • EV_TREE_EXPAND : umain.h
  • EV_TREE_EXPANDING : umain.h
  • EV_TREE_GETINFO : umain.h
  • EV_TREE_GETSEL : umain.h
  • EV_TREE_INSERT : umain.h
  • EV_TREE_RESETALL : umain.h
  • EV_TREE_SELECT : umain.h
  • EV_TREE_SELECTING : umain.h
  • EV_TREE_SETDATA : umain.h
  • EV_TREE_SETICON : umain.h
  • EV_UPDATEFOCUS : umain.h
  • EV_UPDATEUI : umain.h
  • EV_UPDTCMD : umain.h
  • exact : findtcl.cpp
  • exchange() : getopt.c
  • exit : dll_glue.h, cvsgui.h
  • expandLF() : CvsArgs.cpp
  • extractInfos() : UPseudoSupport.cpp

- f -
  • FALSE : cvsgui_wire.h
  • fgetentent() : CvsEntries.cpp
  • FILECHANGE_TIMER : BrowseFileView.cpp
  • FileIsBinary() : TextBinary.h, TextBinary.cpp
  • FileIsText() : TextBinary.h, TextBinary.cpp
  • FileIsUnicode() : TextBinary.h, TextBinary.cpp
  • fileLess() : findtcl.cpp
  • fileRemove() : findtcl.cpp
  • FileTimeToUnixTime() : Stat.cpp
  • FileTraverse() : FileTraversal.h, FileTraversal.cpp
  • FillBuffer() : TextBinary.cpp
  • findIdForWnd() : PseudoDlg.cpp
  • findmostright() : UPseudoSupport.cpp
  • FindNextChildWindow() : wincvs_winutil.cpp
  • FindNextSiblingWindow() : wincvs_winutil.cpp
  • FindNextWindow() : wincvs_winutil.h, wincvs_winutil.cpp
  • FindPrevSiblingWindow() : wincvs_winutil.cpp
  • FindPrevWindow() : wincvs_winutil.h, wincvs_winutil.cpp
  • findTcl() : findtcl.cpp
  • first_nonopt : getopt.c
  • FlatenSubFolders() : CvsCommands.cpp
  • flush_all() : dll_glue.c
  • flushDisplay() : ProgressDialog.cpp
  • FNM_NOESCAPE : fnmatch.h
  • FNM_NOMATCH : fnmatch.h
  • FNM_PATHNAME : fnmatch.h
  • FNM_PERIOD : fnmatch.h
  • fnmatch() : fnmatch.h, fnmatch.c
  • FNOBSERVER : BrowseViewModel.h
  • FOLD_FN_CHAR : fnmatch.h
  • FormatMenuString() : wincvs_winutil.h, wincvs_winutil.cpp
  • frameRec : dll_garbage.c
  • free : dll_garbage.h
  • free_dircontents() : ndir.c
  • free_list_types() : ImportFilter.h, ImportFilter.cpp
  • FSSpec : TextBinary.h
  • fstat : StdAfx.h
  • FTS_BOTTOM : CJFlatTabCtrl.h
  • FTS_HASARROWS : CJFlatTabCtrl.h
  • FTS_HASHOMEEND : CJFlatTabCtrl.h

- g -
  • g_bLogUnbuffered : CvsTrace.cpp
  • g_hLogFile : CvsTrace.cpp
  • g_hMsgHook : CJMenuBar.cpp
  • g_hNextProject : CvsProject.cpp
  • g_nLevel : CvsTrace.cpp
  • g_pListOfFreeBuffers : CvsString.cpp
  • g_pMenuBar : CJMenuBar.cpp
  • g_pProjects : CvsProject.cpp
  • g_sCurrent : CvsTrace.cpp
  • g_sFilter : CvsTrace.cpp
  • g_Shell : CJMenu.cpp
  • gAddBinControl() : CvsPrefs.cpp
  • gAllMethods : PythonGlue.cpp
  • gAlwaysUseCvsroot() : CvsPrefs.cpp
  • GAP : CJMenu.cpp
  • garby_alloc() : dll_garbage.c
  • GARBY_DEF_ALLOC : dll_garbage.c
  • GARBY_DEF_POOL : dll_garbage.c
  • garby_free() : dll_garbage.c
  • GARBY_KEY() : dll_garbage.c
  • garby_realloc() : dll_garbage.c
  • garbyAlloc : dll_garbage.c
  • garbyFree : dll_garbage.c
  • garbyNew() : dll_garbage.h, dll_garbage.c
  • garbyPtr : dll_garbage.c
  • garbyRealloc : dll_garbage.c
  • garbyRemove() : dll_garbage.h, dll_garbage.c
  • gAuthen : Authen.h, Authen.cpp
  • gAuthenKind() : Authen.cpp
  • gboolean : cvsgui_wire.h
  • gBrowser() : CvsPrefs.cpp
  • gBrowserMenu() : wincvs_winutil.cpp
  • gc_nBitmapRightMargin() : Splash.cpp
  • gchar : cvsgui_wire.h
  • gCheckoutRO() : CvsPrefs.cpp
  • gCheckValidEdits() : CommitDlg.cpp
  • gCommitLogs() : CommitDlg.cpp
  • gConsole : AppGlue.h, AppGlue.cpp
  • gconstpointer : cvsgui_wire.h
  • gCvsConsole() : CvsPrefs.cpp
  • gCvsguiErr : PythonContainer.h, PythonContainer.cpp
  • gCvsPrefs : CvsPrefs.h, CvsPrefs.cpp
  • gCvsroot() : CvsPrefs.cpp
  • gCvsVersion() : CvsPrefs.cpp
  • gDateNames : UpdateDlg.cpp, UpdateDlg.h, AnnotateDlg.h
  • gDateOrRevNames : UpdateDlg.cpp, UpdateDlg.h
  • gDirtySupport() : CvsPrefs.cpp
  • gdouble : cvsgui_wire.h
  • gDummyFile : WinCvsBrowser.cpp, UCvsFolders.cpp
  • gEncryptCommunication() : CvsPrefs.cpp
  • get_date() : BrowseViewColumn.cpp
  • GetAllPersistentSettings() : Persistent.cpp
  • GetAsSystemTime() : CJDateTimeCtrl.cpp
  • GetChldError() : cvsgui_process.cpp
  • GetChldOutput() : cvsgui_process.cpp
  • GetCustomMenu() : wincvs_winutil.h, wincvs_winutil.cpp
  • GetDItemCtrlHdl() : MacMisc.h
  • GetDItemHdl() : MacMisc.h
  • GetDItemMenuSel() : MacMisc.h
  • GetEndOfDecendantWindow() : wincvs_winutil.cpp
  • getenv : dll_glue.h, cvsgui.h
  • GetEnvValue() : TextBinary.h, TextBinary.cpp
  • GetErrorMessage() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • GetExtension() : TextBinary.h, TextBinary.cpp
  • GetFileChanges() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • GetFilesToAdd() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • GetIcon() : UCvsFolders.cpp
  • GetInvString() : CustomizeMenus.cpp
  • getLabelFromContainer() : stdafx.h
  • getline() : getline.h, getline.c
  • getLoc() : MacrosSetup.cpp
  • GetMenuEntry() : wincvs_winutil.h, wincvs_winutil.cpp
  • GetMenuTitle() : umenu.cpp
  • GetNextParentWindow() : wincvs_winutil.cpp
  • getopt() : getopt.h, getopt.c
  • getopt_long() : getopt1.c, getopt.h
  • getopt_long_only() : getopt1.c, getopt.h
  • getpass : cvsgui.c, cvsgui.h
  • getpassphrase : cvsgui.h
  • GetPathLength() : BrowseFileView.cpp
  • GetPrevParentWindow() : wincvs_winutil.cpp
  • GetProject() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • GetPyFalse() : PythonImpl.cpp, PythonGlue.impl.h
  • GetPyFile_Type() : PythonImpl.cpp, PythonGlue.impl.h
  • GetPyInt_Type() : PythonImpl.cpp, PythonGlue.impl.h
  • GetPyNone() : PythonImpl.cpp, PythonGlue.impl.h
  • GetPyString_Type() : PythonImpl.cpp, PythonGlue.impl.h
  • GetPyTrue() : PythonImpl.cpp, PythonGlue.impl.h
  • GetPyTuple_Type() : PythonImpl.cpp, PythonGlue.impl.h
  • GetPyType_Type() : PythonImpl.cpp, PythonGlue.impl.h
  • GetRoot() : BrowseFileView.cpp
  • getSettingName() : Persistent.cpp
  • getstr() : getline.h, getline.c
  • GetSubCMenu() : wincvs_winutil.h, wincvs_winutil.cpp
  • GetTimeZoneBias() : Stat.cpp
  • GetWinCvsDebugMask() : WinCvsDebug.h, WinCvsDebug.cpp
  • GetWinCvsDebugMaskBit() : WinCvsDebug.h, WinCvsDebug.cpp
  • gExtdiff() : CvsPrefs.cpp
  • gFilesMenu() : wincvs_winutil.cpp
  • gFileViewIgnore : UCvsFiles.cpp, UCvsFiles.h
  • gFileViewSort() : BrowseFileView.cpp, UCvsFiles.cpp
  • gFileViewSortAsc() : BrowseFileView.cpp, UCvsFiles.cpp
  • gfloat : cvsgui_wire.h
  • gGarbage : dll_garbage.c
  • gGraphBranchColor() : GraphView.cpp
  • gGraphDeadNodeColor() : GraphView.cpp
  • gGraphHeaderColor() : GraphView.cpp
  • gGraphNodeColor() : GraphView.cpp
  • gGraphSelColor() : GraphView.cpp
  • gGraphShadowColor() : GraphView.cpp
  • gGraphTagColor() : GraphView.cpp
  • gGraphUserStateNodeColor() : GraphView.cpp
  • gHelper() : CvsPrefs.cpp
  • gHideCommandDlgAnnotate() : CvsPrefs.cpp
  • gHideCommandDlgDiff() : CvsPrefs.cpp
  • gHideCommandDlgGraph() : CvsPrefs.cpp
  • gHideCommandDlgLog() : CvsPrefs.cpp
  • gHideCommandDlgUpdate() : CvsPrefs.cpp
  • gHideCommandDlgUseShift() : CvsPrefs.cpp
  • gHistoryLocs() : MainFrm.cpp, UCvsFolders.cpp
  • gHome() : CvsPrefs.cpp
  • gICTextOption() : CvsPrefs.cpp
  • gIgnoreCase() : DiffDlg.cpp
  • gImportModuleNames() : ImportDlg.cpp
  • gint : cvsgui_wire.h
  • gint16 : cvsgui_wire.h
  • gint32 : cvsgui_wire.h
  • gint8 : cvsgui_wire.h
  • gIsoConvert() : CvsPrefs.cpp
  • gKserverPort() : CvsPrefs.cpp
  • gLastWorkingDir() : CvsPrefs.cpp
  • gLogDateNames() : LogDlg.cpp
  • gLogoutTimeOut() : CvsPrefs.cpp
  • gLogRevNames() : LogDlg.cpp
  • gLogStateNames() : LogDlg.cpp
  • gLogUserNames() : LogDlg.cpp
  • glong : cvsgui_wire.h
  • glue_consoleerr() : AppGlue.h, AppGlue.cpp
  • glue_consolein() : AppGlue.h, AppGlue.cpp
  • glue_consoleout() : AppGlue.h, AppGlue.cpp
  • glue_eventdispatcher() : AppGlue.mac.h
  • glue_exit() : AppGlue.h, AppGlue.cpp
  • glue_getenv() : AppGlue.h, AppGlue.cpp
  • GLUE_WRAP : TclGlue.cpp, PythonGlue.impl.h
  • gMacBinEncoding() : CvsPrefs.cpp
  • gMacLF() : CvsPrefs.cpp
  • gMacrosAdmin : MacrosSetup.h, MacrosSetup.cpp
  • gMacrosSel : MacrosSetup.h, MacrosSetup.cpp
  • gMainPlacement() : MainFrm.cpp
  • gNoWhiteSpace() : DiffDlg.cpp
  • gOldCvsroots : CvsPrefs.cpp, CvsPrefs.h
  • gOldLoc() : HistComboBoxEx.cpp, UCvsFolders.cpp
  • gOldModules : CheckoutDlg.cpp, RtagDlg.h, CheckoutDlg.h
  • GP_CONSOLE : cvsgui_protocol.h
  • gp_console_write() : cvsgui_protocol.h, cvsgui_process.cpp
  • GP_GETENV : cvsgui_protocol.h
  • gp_getenv_read() : cvsgui_protocol.h, cvsgui_process.cpp
  • gp_getenv_write() : cvsgui_protocol.h, cvsgui_process.cpp
  • gp_init() : cvsgui_process.cpp
  • GP_QUIT : cvsgui_protocol.h
  • gp_quit_write() : cvsgui_protocol.h, cvsgui_process.cpp
  • gPersistentShema() : CvsPrefs.cpp
  • gpointer : cvsgui_wire.h
  • gPrevCvsCmd() : LineCmd.cpp
  • gProxyHost() : CvsPrefs.cpp
  • gProxyPort() : CvsPrefs.cpp
  • gPruneOption() : CvsPrefs.cpp
  • gPserverPort() : CvsPrefs.cpp
  • gQuietOption() : CvsPrefs.cpp
  • gReleasesNames : ImportDlg.cpp, UpdateDlg.h
  • gRevNames : UpdateDlg.cpp, UpdateDlg.h, CommitDlg.h, AnnotateDlg.h
  • gRhostPort() : CvsPrefs.cpp
  • GRIP_INTRASPACING : CJControlBar.cpp
  • GRIP_SIZE : CJControlBar.cpp
  • GRIP_START : CJControlBar.cpp
  • gRshName() : CvsPrefs.cpp
  • gserver : Authen.h
  • gserverInstance : Authen.cpp
  • gServerName() : CvsPrefs.cpp
  • gshort : cvsgui_wire.h
  • gTurnOffBroadcast : UPseudoSupport.h, UPseudoSupport.cpp
  • guchar : cvsgui_wire.h
  • gUICache : PythonGlue.cpp
  • gUICacheObj : PythonGlue.cpp
  • gUICacheValid : PythonGlue.cpp
  • guint : cvsgui_wire.h
  • guint16 : cvsgui_wire.h
  • guint32 : cvsgui_wire.h
  • guint8 : cvsgui_wire.h
  • gulong : cvsgui_wire.h
  • gUnixLF() : CvsPrefs.cpp
  • gUseAltCvs() : CvsPrefs.cpp
  • gUseExtDiff() : DiffDlg.cpp
  • gUseProxy() : CvsPrefs.cpp
  • gUseShell() : CvsPrefs.cpp
  • gUseViewerAlways() : CvsPrefs.cpp
  • gushort : cvsgui_wire.h
  • GUSIMSL_HandleEventHook() : AppGlue.mac.h
  • GUSIMSL_WriteConsoleHook() : AppGlue.mac.h
  • GUSIMSL_WriteErrHook() : AppGlue.mac.h
  • gVendorNames() : ImportDlg.cpp
  • gViewer() : CvsPrefs.cpp
  • gViewFont() : wincvsView.cpp
  • gWarnPython() : NoPython.cpp
  • gWhichCvs() : CvsPrefs.cpp
  • gWordWrapLogMsg() : CvsPrefs.cpp
  • gZ9Option() : CvsPrefs.cpp
  • gZLevel() : CvsPrefs.cpp

- h -
  • HALF_SECOND : CJDateTimeCtrl.cpp
  • HasAdvancedOptionsForCommand() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • HasPersistentSettings() : Persistent.h, Persistent.cpp
  • hextable : CJHexEdit.cpp
  • HIDE_CONTRLBAR : CJControlBar.h
  • HIGHLIGHTSTYLE : CJMenu.h
  • HISTLOC_IMAGE_CX : HistComboBoxEx.h
  • HISTLOC_VISIBLEITEMS : HistComboBoxEx.h
  • HookWndProc() : Subclass.cpp
  • HORZF : CJDockContext.cpp
  • HOWMUCH_WORDS : CommitDlg.cpp
  • hPal : dib.c

- i -
  • ICvsCoworker : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_AddFiles_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_AddFiles_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_CheckinFiles_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_CheckinFiles_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_CheckoutFiles_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_CheckoutFiles_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_CloseProject_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_CloseProject_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_DiffFile_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_DiffFile_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_FormatStringOffsetTable : CVS_Coworker_p.c
  • ICvsCoworker_GetErrorMessage_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetErrorMessage_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetFileChanges_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetFileChanges_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetFilesToAdd_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetFilesToAdd_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetLastError_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetLastError_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetProject_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetProject_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_HasAdvancedOptionsForCommand_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_HasAdvancedOptionsForCommand_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_OpenProject_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_OpenProject_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_ProxyInfo : CVS_Coworker_p.c
  • ICvsCoworker_RemoveFiles_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_RemoveFiles_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_RenameFile_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_RenameFile_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_ServerInfo : CVS_Coworker_p.c
  • ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_ShowAdvancedOptionsForCommand_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_ShowFileHistory_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_ShowFileHistory_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_ShowFileProperties_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_ShowFileProperties_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_ShowUserInterface_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_ShowUserInterface_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_table : CVS_Coworker_p.c
  • ICvsCoworker_UncheckoutFiles_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_UncheckoutFiles_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_UpdateFiles_Proxy() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_UpdateFiles_Stub() : CVS_Coworker_p.c, CVS_Coworker.h, CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ID_ACCEL32911 : resource.h
  • ID_ADDBF : resource.h
  • ID_APP_CMDLINE : resource.h
  • ID_APP_COPYRIGHTS : resource.h
  • ID_APP_CREDITS : resource.h
  • ID_APP_LOGIN : resource.h
  • ID_APP_LOGOUT : resource.h
  • ID_APP_PREFERENCES : resource.h
  • ID_APP_RTAGBRANCH : resource.h
  • ID_APP_RTAGCREATE : resource.h
  • ID_APP_RTAGDELETE : resource.h
  • ID_BROWSER_OPEN : resource.h
  • ID_BUTTON32918 : resource.h
  • ID_BUTTON32919 : resource.h
  • ID_BUTTON32920 : resource.h
  • ID_BUTTON32921 : resource.h
  • ID_BUTTON32940 : resource.h
  • ID_CANCEL_EDIT_CNTR : resource.h
  • ID_COMMITBF : resource.h
  • ID_CUST_FILES_MENU : resource.h
  • ID_CUST_FOLDER_MENU : resource.h
  • ID_FILTERMASK : resource.h
  • ID_GFX_LARGEICON : CJResource.h
  • ID_GFX_REMOVEITEM : CJResource.h
  • ID_GFX_RENAMEITEM : CJResource.h
  • ID_GFX_SMALLICON : CJResource.h
  • ID_GRAPH_ADMINOPTIONS_CHANGELOGMESSAGE : resource.h
  • ID_GRAPH_ADMINOPTIONS_SETDESCRIPTION : resource.h
  • ID_GRAPH_ADMINOPTIONS_SETSTATE : resource.h
  • ID_GRAPH_CHANGELOGMESSAGE : resource.h
  • ID_GRAPH_CLOSE : resource.h
  • ID_GRAPH_GRAPHOPTIONS : resource.h
  • ID_GRAPH_SETDESCRIPTION : resource.h
  • ID_GRAPH_SETSTATE : resource.h
  • ID_HELP_CVS : resource.h
  • ID_HELP_CVSCLIENT : resource.h
  • ID_HISTORYBROWSE : resource.h
  • ID_MACRO_ADMIN : resource.h
  • ID_MACRO_END : resource.h
  • ID_MACRO_SEL : resource.h
  • ID_MACRO_START : resource.h
  • ID_MENUBAR : resource.h
  • ID_MENUITEM32840 : resource.h
  • ID_POPUP_CUSTOMIZE : CJResource.h
  • ID_QUERY_ANNOTATE : resource.h
  • ID_SAVESETTINGS : resource.h
  • ID_STOPCVS : resource.h
  • ID_UPDATEBF : resource.h
  • ID_USE_PYSHELL : resource.h
  • ID_USE_TCLSHELL : resource.h
  • ID_VIEW_ADD : resource.h
  • ID_VIEW_ADDB : resource.h
  • ID_VIEW_ADDED : resource.h
  • ID_VIEW_ADDU : resource.h
  • ID_VIEW_BROWSELOCATION_REMOVEUNWANTED : resource.h
  • ID_VIEW_BROWSER_BAR : resource.h
  • ID_VIEW_CHANGED : resource.h
  • ID_VIEW_CHECKOUT : resource.h
  • ID_VIEW_COMMIT : resource.h
  • ID_VIEW_CONFLICT : resource.h
  • ID_VIEW_CONSOLE_BAR : resource.h
  • ID_VIEW_DELREV : resource.h
  • ID_VIEW_DIFF : resource.h
  • ID_VIEW_EDIT : resource.h
  • ID_VIEW_EDITORS : resource.h
  • ID_VIEW_EDITSEL : resource.h
  • ID_VIEW_EDITSELDEF : resource.h
  • ID_VIEW_EXPLORE : resource.h
  • ID_VIEW_FILES_BAR : resource.h
  • ID_VIEW_FILTER_BAR : resource.h
  • ID_VIEW_FORCEEDIT : resource.h
  • ID_VIEW_FULLLIST : resource.h
  • ID_VIEW_GRAPH : resource.h
  • ID_VIEW_HIDEUNKNOWN : resource.h
  • ID_VIEW_IGNORE : resource.h
  • ID_VIEW_IMPORT : resource.h
  • ID_VIEW_INIT : resource.h
  • ID_VIEW_LOCKF : resource.h
  • ID_VIEW_LOG : resource.h
  • ID_VIEW_MISSING : resource.h
  • ID_VIEW_MODIFIED : resource.h
  • ID_VIEW_MULTI_BAR : resource.h
  • ID_VIEW_QUERYUPDATE : resource.h
  • ID_VIEW_RECURSIVE : resource.h
  • ID_VIEW_RELEASE : resource.h
  • ID_VIEW_RELOAD : resource.h
  • ID_VIEW_REMOVED : resource.h
  • ID_VIEW_RESERVEDEDIT : resource.h
  • ID_VIEW_RETRIEVE : resource.h
  • ID_VIEW_RMV : resource.h
  • ID_VIEW_ROWDETAILS : resource.h
  • ID_VIEW_SELNONSIG : resource.h
  • ID_VIEW_SMALLICONS : resource.h
  • ID_VIEW_STATUS : resource.h
  • ID_VIEW_TAG : resource.h
  • ID_VIEW_TAGBRANCH : resource.h
  • ID_VIEW_TAGDELETE : resource.h
  • ID_VIEW_TAGNEW : resource.h
  • ID_VIEW_TAGS_BAR : resource.h
  • ID_VIEW_TRASH : resource.h
  • ID_VIEW_UNEDIT : resource.h
  • ID_VIEW_UNKNOWN : resource.h
  • ID_VIEW_UNLOCKF : resource.h
  • ID_VIEW_UPDATE : resource.h
  • ID_VIEW_UPONE : resource.h
  • ID_VIEW_WATCHERS : resource.h
  • ID_VIEW_WATCHOFF : resource.h
  • ID_VIEW_WATCHON : resource.h
  • ID_VIEW_WORKSPACE : resource.h
  • ID_VIEWW_INIT : resource.h
  • IDB_ABOUT : resource.h
  • IDB_BTN_ARROW : CJResource.h
  • IDB_BTN_EXPLORER : CJResource.h
  • IDB_BUTTON_IMAGES : CJResource.h
  • IDB_HISTLOC : resource.h
  • IDB_IDLE : resource.h
  • IDB_LIGHTBULB : resource.h
  • IDB_LOCATE : resource.h
  • IDB_PUSHPIN : CJResource.h
  • IDB_PYTHON : resource.h
  • IDB_SMALLICONS : resource.h
  • IDB_SPLASH : resource.h
  • IDC_ADD : resource.h
  • IDC_ALERTCAPTION : resource.h
  • IDC_ALLCMDS : resource.h
  • IDC_ALRTMSG : resource.h
  • IDC_ALTCVSCHK : resource.h
  • IDC_ALTCVSPROG : resource.h
  • IDC_ALTCVSSEL : resource.h
  • IDC_ALWAYSROOT : resource.h
  • IDC_APPLY : resource.h
  • IDC_ATTIC : resource.h
  • IDC_AUTHEN : resource.h
  • IDC_AUTHENDESC : resource.h
  • IDC_BAR_BUTTON : CJResource.h
  • IDC_BAR_CAPTION : CJResource.h
  • IDC_BAR_TREE : resource.h
  • IDC_BRANCH : resource.h
  • IDC_BTNHOME : resource.h
  • IDC_BTNPATH : resource.h
  • IDC_BTNPATH2 : resource.h
  • IDC_BTNPROGRAM : resource.h
  • IDC_BULB : resource.h
  • IDC_BUTTON_HIDE : CJResource.h
  • IDC_BUTTON_MINI : CJResource.h
  • IDC_CAPT_BUTTON : CJResource.h
  • IDC_CHECK1 : resource.h
  • IDC_CHECK2 : resource.h
  • IDC_CHECK_OVERRIDECHECKOUTDIR : resource.h
  • IDC_CHECKANNOTATE : resource.h
  • IDC_CHECKDATE1 : resource.h
  • IDC_CHECKDATE2 : resource.h
  • IDC_CHECKDIFF : resource.h
  • IDC_CHECKGRAPH : resource.h
  • IDC_CHECKKSERVERPORT : resource.h
  • IDC_CHECKLOG : resource.h
  • IDC_CHECKOUTRO : resource.h
  • IDC_CHECKPATH : resource.h
  • IDC_CHECKPROXY : resource.h
  • IDC_CHECKPSERVERPORT : resource.h
  • IDC_CHECKRHOSTPORT : resource.h
  • IDC_CHECKRSHNAME : resource.h
  • IDC_CHECKSERVERNAME : resource.h
  • IDC_CHECKUNIXLF : resource.h
  • IDC_CHECKUNMOD : resource.h
  • IDC_CHECKUPDATE : resource.h
  • IDC_CHECKVALIDEDITS : resource.h
  • IDC_CLEANCOPY : resource.h
  • IDC_CMDLINE : resource.h
  • IDC_CMDMENU : resource.h
  • IDC_COMBO : resource.h
  • IDC_COMBO1 : resource.h
  • IDC_COMBO2 : resource.h
  • IDC_COMBO_REV : resource.h
  • IDC_COMBODATE : resource.h
  • IDC_COMBODATE1 : resource.h
  • IDC_COMBODATE2 : resource.h
  • IDC_COMBOMODNAME : resource.h
  • IDC_COMBOREV : resource.h
  • IDC_COMBOREV2 : resource.h
  • IDC_COMBOROOT : resource.h
  • IDC_COMBORSAIDENTITY : resource.h
  • IDC_COMBORTAG : resource.h
  • IDC_COMBOSTATE : resource.h
  • IDC_COMBOUSER : resource.h
  • IDC_COMBOVTAG : resource.h
  • IDC_CONSOLE : resource.h
  • IDC_CREATEMISSDIR : resource.h
  • IDC_CTNLADD : resource.h
  • IDC_CUSTOMIZE_BAR : CJToolBar.cpp
  • IDC_CVSROOT : resource.h
  • IDC_CVSVERS : resource.h
  • IDC_DATE : resource.h
  • IDC_DEAD : resource.h
  • IDC_DEFBRANCH : resource.h
  • IDC_DELETED : resource.h
  • IDC_DELSTICKY : resource.h
  • IDC_DIFF : resource.h
  • IDC_DIFF1 : resource.h
  • IDC_DIFF2 : resource.h
  • IDC_DIFF3 : resource.h
  • IDC_DIFFPROG : resource.h
  • IDC_DIRECTORY : resource.h
  • IDC_DIRTYSUPPORT : resource.h
  • IDC_DOWN : resource.h
  • IDC_DRAGGING : CJResource.h
  • IDC_EDIT_CHECKOUTDIR : resource.h
  • IDC_EDIT_POSITION : resource.h
  • IDC_EDITENTRY : resource.h
  • IDC_EDITHOST : resource.h
  • IDC_EDITLOGOUT : resource.h
  • IDC_EDITPORT : resource.h
  • IDC_ENDBUTTON : CJResource.h
  • IDC_ENTRYSTATE : resource.h
  • IDC_ENTRYSTATE2 : resource.h
  • IDC_ENTRYSTATE3 : resource.h
  • IDC_ENTRYSTATE4 : resource.h
  • IDC_ENTRYSTATE5 : resource.h
  • IDC_ENTRYSTATE6 : resource.h
  • IDC_EXPORT : resource.h
  • IDC_EXTDIFF : resource.h
  • IDC_EXTDIFFSEL : resource.h
  • IDC_FILETODIFF : resource.h
  • IDC_FOLDERLOC : resource.h
  • IDC_FORCE : resource.h
  • IDC_FORCECOMMIT : resource.h
  • IDC_FORCERECURSE : resource.h
  • IDC_FORCEREVISION : resource.h
  • IDC_FORCEROOT : resource.h
  • IDC_GRPBOX_TEXT : resource.h
  • IDC_HANDCUR : CJResource.h
  • IDC_HEADER : resource.h
  • IDC_HELPINIT : resource.h
  • IDC_HOME : resource.h
  • IDC_HOMEBUTTON : CJResource.h
  • IDC_HOST : resource.h
  • IDC_HSPLITBAR : CJResource.h
  • IDC_IGNORECASE : resource.h
  • IDC_IGNOREWHITESPACE : resource.h
  • IDC_ISDATE : resource.h
  • IDC_KSERVER : resource.h
  • IDC_KSERVERPORT : resource.h
  • IDC_LAUNCHEDITOR : resource.h
  • IDC_LEFTBUTTON : CJResource.h
  • IDC_LISTENTRIES : resource.h
  • IDC_LOCATE : resource.h
  • IDC_LOGIN : resource.h
  • IDC_LOGMSG : resource.h
  • IDC_LOGMSG_WRAP : resource.h
  • IDC_LOGOUT : resource.h
  • IDC_MATCH : resource.h
  • IDC_MENULIST : resource.h
  • IDC_MERGE : resource.h
  • IDC_MERGE1 : resource.h
  • IDC_MERGE2 : resource.h
  • IDC_MODNAME : resource.h
  • IDC_MODULEDESC_TEXT : resource.h
  • IDC_NEXTTIP : resource.h
  • IDC_NODE : resource.h
  • IDC_NODRAGGING : CJResource.h
  • IDC_NOMODULEPROGRAM : resource.h
  • IDC_NORECURS : resource.h
  • IDC_NOTAGS : resource.h
  • IDC_NOUSERS : resource.h
  • IDC_ONLYRCS : resource.h
  • IDC_OPTIONDESC : resource.h
  • IDC_OPTIONSTRING : resource.h
  • IDC_OPTIONSTRING_SL : resource.h
  • IDC_OVERWRITE : resource.h
  • IDC_PASSWD : resource.h
  • IDC_PATH : resource.h
  • IDC_PREVCMD : resource.h
  • IDC_PREVIEWINFO : resource.h
  • IDC_PROGRAM : resource.h
  • IDC_PROGRESS : resource.h
  • IDC_PROMPTEDIT : resource.h
  • IDC_PRUNE : resource.h
  • IDC_PSERVER : resource.h
  • IDC_PSERVERPORT : resource.h
  • IDC_PYTHONURL : resource.h
  • IDC_QUIET : resource.h
  • IDC_RADIOCONTROL : resource.h
  • IDC_RADIOSHIFT : resource.h
  • IDC_REMIND : resource.h
  • IDC_REMOVE : resource.h
  • IDC_RESET : resource.h
  • IDC_REV : resource.h
  • IDC_RGBBRANCH : resource.h
  • IDC_RGBDEAD : resource.h
  • IDC_RGBHEADER : resource.h
  • IDC_RGBNODE : resource.h
  • IDC_RGBSELECTION : resource.h
  • IDC_RGBSHADOW : resource.h
  • IDC_RGBSTATE : resource.h
  • IDC_RGBTAG : resource.h
  • IDC_RHOSTPORT : resource.h
  • IDC_RHOSTS : resource.h
  • IDC_RIGHTBUTTON : CJResource.h
  • IDC_RSAIDENTITY : resource.h
  • IDC_RSAIDENTITYSEL : resource.h
  • IDC_RSHNAME : resource.h
  • IDC_RTAG : resource.h
  • IDC_SELECTION : resource.h
  • IDC_SELFOLDER : resource.h
  • IDC_SERVERNAME : resource.h
  • IDC_SERVERNAME2 : resource.h
  • IDC_SETTINGS : resource.h
  • IDC_SHADOW : resource.h
  • IDC_SPECIFY_REV : resource.h
  • IDC_SPINLOGOUT : resource.h
  • IDC_STARTUP : resource.h
  • IDC_STATE : resource.h
  • IDC_STDOUT : resource.h
  • IDC_TAB_CONTROL : CJResource.h
  • IDC_TAG : resource.h
  • IDC_TAGDESC_TEXT : resource.h
  • IDC_TAGNAME : resource.h
  • IDC_TCPIP : resource.h
  • IDC_TEMPFILE : resource.h
  • IDC_TEMPLATE : resource.h
  • IDC_TIPSTRING : resource.h
  • IDC_UP : resource.h
  • IDC_URL_CODEJOCKEY : CJResource.h
  • IDC_USE_VIEWER_ALWAYS : resource.h
  • IDC_USEDEFIGNORE : resource.h
  • IDC_USEFILESTIME : resource.h
  • IDC_USER : resource.h
  • IDC_VSPLITBAR : CJResource.h
  • IDC_VTAG : resource.h
  • IDC_WARNINGDESC : resource.h
  • IDC_WINCVSURL : resource.h
  • IDC_WINCVSVER : resource.h
  • IDC_WORDWRAP : resource.h
  • IDC_ZLEVEL : resource.h
  • IDC_ZSPIN : resource.h
  • IDD_ABOUTBOX : resource.h
  • IDD_ADMINOPTION : resource.h
  • IDD_ALERT : resource.h
  • IDD_ANNOTATE_MAIN : resource.h
  • IDD_CHECKOUT_MAIN : resource.h
  • IDD_CHECKOUT_OPTIONS : resource.h
  • IDD_CMDLINE : resource.h
  • IDD_CMDLINE_MAIN : resource.h
  • IDD_COMMIT_MAIN : resource.h
  • IDD_COMMIT_OPTIONS : resource.h
  • IDD_CUSTOMIZE : resource.h
  • IDD_DIFF_MAIN : resource.h
  • IDD_DIFF_OPTIONS : resource.h
  • IDD_EDITMESSAGE : resource.h
  • IDD_EDITORMON : resource.h
  • IDD_ENTRYDESC : resource.h
  • IDD_GRAPH_OPTIONS : resource.h
  • IDD_GSERVER : resource.h
  • IDD_IMPORT_MAIN : resource.h
  • IDD_IMPORT_OPTIONS : resource.h
  • IDD_IMPORTFILTER : resource.h
  • IDD_INIT_MAIN : resource.h
  • IDD_LOG_FILTERS : resource.h
  • IDD_LOG_MAIN : resource.h
  • IDD_NOPYTHON : resource.h
  • IDD_PASSWRD : resource.h
  • IDD_PREFERENCES : resource.h
  • IDD_PREFS_CVSCMD_DIALOGS : resource.h
  • IDD_PREFS_CVSROOT : resource.h
  • IDD_PREFS_GLOBALS : resource.h
  • IDD_PREFS_WINCVS : resource.h
  • IDD_PROGRESS : resource.h
  • IDD_PROMPTMESSAGE : resource.h
  • IDD_PSERVER : resource.h
  • IDD_RELEASE : resource.h
  • IDD_RSH : resource.h
  • IDD_RTAG_MAIN : resource.h
  • IDD_RTAG_OPTIONS : resource.h
  • IDD_SAVESETTINGS : resource.h
  • IDD_SSH : resource.h
  • IDD_TAG_MAIN : resource.h
  • IDD_TIP : resource.h
  • IDD_UPDATE_MAIN : resource.h
  • IDD_UPDATE_MERGE : resource.h
  • IDD_UPDATE_STICKY : resource.h
  • IDD_WARNINGDESC : resource.h
  • IDD_YESNO : resource.h
  • IDI_CVSERROR : resource.h
  • IDI_CVSWARNING : resource.h
  • IDI_FOLDER : resource.h
  • IDI_FOLDERCVS : resource.h
  • IDI_FOLDERIGN : resource.h
  • IDI_FOLDERLOST : resource.h
  • IDI_FOLDERO : resource.h
  • IDI_FOLDEROCVS : resource.h
  • IDI_FOLDEROIGN : resource.h
  • IDM_CBAR_MENU : CJResource.h
  • IDP_FAILED_TO_CREATE : resource.h
  • IDP_OLE_INIT_FAILED : resource.h
  • IDP_SOCKETS_INIT_FAILED : resource.h
  • IDR_BROWSER : resource.h
  • IDR_CBAR_POPUP : CJResource.h
  • IDR_CNTR_INPLACE : resource.h
  • IDR_CUSTMENUS : resource.h
  • IDR_CVS_COWORKER : resource.h
  • IDR_CVSCOWORKER : resource.h
  • IDR_CVSGETOPTION : resource.h
  • IDR_FILELIST : resource.h
  • IDR_FILTER : resource.h
  • IDR_GFXOUTBAR : CJResource.h
  • IDR_GRAPH : resource.h
  • IDR_MAINFRAME : resource.h
  • IDR_MENUICONS : resource.h
  • IDR_MULTIUSER : resource.h
  • IDR_POPUP_HEX_EDIT : CJResource.h
  • IDR_POPUP_TOOLBAR : CJResource.h
  • IDR_STATEICONS : resource.h
  • IDR_TAGS : resource.h
  • IDR_WINCVSTYPE : resource.h
  • IDR_WORKSPACE : resource.h
  • IDS_COLOR_AUTO : CJResource.h
  • IDS_COLOR_CUST : CJResource.h
  • IDS_COMBOBROWSER : resource.h
  • IDS_CONTRACT : CJResource.h
  • IDS_DEFFONT : resource.h
  • IDS_ENTRY : CJResource.h
  • IDS_EXPAND : CJResource.h
  • IDS_HIDE : CJResource.h
  • IDS_INVALID_VER : CJResource.h
  • IDS_MODIFIED : CJResource.h
  • IDS_NAME : CJResource.h
  • IDS_REGKEY : CJResource.h
  • IDS_REMOVEITEM : CJResource.h
  • IDS_RENAMEITEM : CJResource.h
  • IDS_SECTION : CJResource.h
  • IDS_SETTINGS : CJResource.h
  • IDS_SIZE : CJResource.h
  • IDS_TBAR_SETTINGS : CJResource.h
  • IDS_TYPE : CJResource.h
  • IDS_WIN_PLACEMENT : CJResource.h
  • IDS_WNDPOS : CJResource.h
  • ign_add() : CvsIgnore.cpp
  • IID : CVS_Coworker_i.c
  • IID_ICvsCoworker : CVS_Coworker_i.c, CVS_Coworker.h, CVS_Coworker_i.h, CVS_Coworker_i.c, cvs_coworker.h
  • IID_ITest : GraphDoc.cpp
  • IID_IWincvs : wincvsDoc.cpp
  • IMPLEMENT_DYNAMIC() : wincvs.cpp, Subclass.cpp
  • InBetweenVSide() : UPseudoSupport.cpp
  • indicators : MainFrm.cpp
  • InFilter() : CvsTrace.cpp
  • InflateRect() : udraw.h, udraw.cpp
  • Inherited : UPseudoSupport.cpp
  • initialize_all() : dll_glue.c
  • InitializeInterp() : PythonGlue.cpp
  • InsertMenu : CJMenu.h
  • InsertODMenu : CJMenu.h
  • IntersectRect() : udraw.h, udraw.cpp
  • INVALID_Color : CJColorPopup.cpp
  • INVALID_SEQUENCE : CTCP2Parse.cpp
  • INVTAB : CustomizeMenus.cpp
  • IS_LOGGING : CvsTrace.cpp
  • IS_PSEUDO_CTL : PseudoDlg.cpp
  • IsAppEnabled() : MainFrm.cpp
  • IsDST() : Stat.cpp
  • IsInInvertList() : CustomizeMenus.cpp
  • IsKeyMovingFocus() : LogFrm.cpp
  • IsLargeFonts() : BrowseViewColumn.cpp
  • IsLeapYear() : Stat.cpp
  • isn : CTCP2Parse.cpp
  • ISO8559 : CvsPrefs.h
  • ISO8559_1 : CvsPrefs.h
  • ISO8559_10 : CvsPrefs.h
  • ISO8559_1_MacCvsPro : CvsPrefs.h
  • ISO8559_2 : CvsPrefs.h
  • ISO8559_3 : CvsPrefs.h
  • ISO8559_4 : CvsPrefs.h
  • ISO8559_5 : CvsPrefs.h
  • ISO8559_6 : CvsPrefs.h
  • ISO8559_7 : CvsPrefs.h
  • ISO8559_8 : CvsPrefs.h
  • ISO8559_9 : CvsPrefs.h
  • ISO8559_none : CvsPrefs.h
  • IsRectEmpty() : udraw.cpp
  • IsSamePath() : BrowseFileView.cpp
  • IsShellType() : CJMenu.cpp
  • IsTargetWindow() : wincvs_winutil.cpp
  • IsValidHandle() : wincvs.cpp

- k -
  • kAddSettings : Persistent.h
  • kAdminOptionDlgType : AdminOptionDlg.h
  • kBinIsText : TextBinary.h
  • kBinIsUnicode : TextBinary.h
  • kBinWrongSig : TextBinary.h
  • kBlue : AppConsole.h
  • kBold : AppConsole.h
  • kBrown : AppConsole.h
  • kChangeLog : AdminOptionDlg.h
  • kClassPersistent : Persistent.h
  • kConsoleColor : AppConsole.h
  • kContinueTraversal : FileTraversal.h
  • kCustomBrowserMenu : wincvs_winutil.h
  • kCustomFilesMenu : wincvs_winutil.h
  • kEditCmdType : CvsCommands.h
  • kEditForce : CvsCommands.h
  • kEditNormal : CvsCommands.h
  • kEditReserved : CvsCommands.h
  • kFileIconAdded : BrowseFileView.h, UCvsFiles.cpp
  • kFileIconBinary : BrowseFileView.h, UCvsFiles.cpp
  • kFileIconBinaryAdded : BrowseFileView.h
  • kFileIconBinaryMod : BrowseFileView.h, UCvsFiles.cpp
  • kFileIconConflict : BrowseFileView.h, UCvsFiles.cpp
  • kFileIconIgnored : BrowseFileView.h, UCvsFiles.cpp
  • kFileIconMiss : BrowseFileView.h, UCvsFiles.cpp
  • kFileIconRemoved : BrowseFileView.h, UCvsFiles.cpp
  • kFileIconText : BrowseFileView.h, UCvsFiles.cpp
  • kFileIconTextMod : BrowseFileView.h, UCvsFiles.cpp
  • kFileIconUnicode : BrowseFileView.h
  • kFileIconUnicodeAdded : BrowseFileView.h
  • kFileIconUnicodeMod : BrowseFileView.h
  • kFileIconUnknown : BrowseFileView.h, UCvsFiles.cpp
  • kFileInvalidName : TextBinary.h
  • kFileIsAlias : TextBinary.h
  • kFileIsOK : TextBinary.h
  • kFileMissing : TextBinary.h
  • kFileType : TextBinary.h
  • kFileTypeBin : TextBinary.h
  • kFileTypeText : TextBinary.h
  • kFileTypeUnicode : TextBinary.h
  • kFolderIcon : BrowseFileView.h, UCvsFiles.cpp
  • kFolderIconIgnored : BrowseFileView.h, UCvsFiles.cpp
  • kFolderIconMiss : BrowseFileView.h, UCvsFiles.cpp
  • kFolderIconUnknown : BrowseFileView.h, UCvsFiles.cpp
  • kGreen : AppConsole.h
  • kHChildSpace : GraphView.cpp, UCvsGraph.cpp
  • kHierarchicalMax : UPseudoSupport.cpp
  • kHierarchicalMin : UPseudoSupport.cpp
  • kIconFolderClosed : WinCvsBrowser.cpp, UCvsFolders.cpp
  • kIconFolderCVSClosed : WinCvsBrowser.cpp, UCvsFolders.cpp
  • kIconFolderCVSOpened : WinCvsBrowser.cpp, UCvsFolders.cpp
  • kIconFolderIgnoreClosed : WinCvsBrowser.cpp, UCvsFolders.cpp
  • kIconFolderIgnoreLost : WinCvsBrowser.cpp, UCvsFolders.cpp
  • kIconFolderIgnoreOpened : WinCvsBrowser.cpp, UCvsFolders.cpp
  • kIconFolderOpened : WinCvsBrowser.cpp, UCvsFolders.cpp
  • kInflateNodeSpace : GraphView.cpp, UCvsGraph.cpp
  • kItalic : AppConsole.h
  • kLocationIcon : HistComboBoxEx.h
  • kLocationIconErased : HistComboBoxEx.h
  • kLocationIconIgnored : HistComboBoxEx.h
  • kLocationIconMissing : HistComboBoxEx.h
  • kLocationIconUnknown : HistComboBoxEx.h
  • kMagenta : AppConsole.h
  • kMaxChar : ustr.cpp
  • kNL : AppConsole.h
  • kNoClass : Persistent.h
  • kNodeShape : GraphView.h
  • kNormal : AppConsole.h
  • kOctangle : GraphView.h
  • kPathDelimiter : TextBinary.h
  • kRectangle : GraphView.h
  • kRed : AppConsole.h
  • kRoundRect : GraphView.h
  • kRtagAdd : RtagDlg.h
  • kRtagDelete : RtagDlg.h
  • kRtagDlgType : RtagDlg.h
  • kRtagFork : RtagDlg.h
  • kserver : Authen.h
  • kSetDescription : AdminOptionDlg.h
  • kSetState : AdminOptionDlg.h
  • kSkipFile : FileTraversal.h
  • kSpc : BrowseFileView.cpp
  • kStopTraversal : FileTraversal.h
  • kTagAdd : TagDlg.h
  • kTagDelete : TagDlg.h
  • kTagDlgType : TagDlg.h
  • kTagFork : TagDlg.h
  • kTCLPathDelimiter : TclGlue.h
  • kTclRes : TclGlue.h
  • kTContinue : GraphView.cpp
  • kTextBinTYPE : TextBinary.h
  • kTextEscapeChar : TextBinary.h
  • kTextIsBinary : TextBinary.h
  • kTextIsUnicode : TextBinary.h
  • kTextWrongLF : TextBinary.h
  • kTextWrongSig : TextBinary.h
  • kTGetDown : GraphView.cpp
  • kTGraph : GraphView.cpp
  • kTraversal : FileTraversal.h
  • kTraversalError : FileTraversal.h
  • kTStop : GraphView.cpp
  • kUCvsFilesID : UCvsCommands.h
  • kUCvsFoldersID : UCvsCommands.h
  • kUCvsFrameID : UCvsCommands.h
  • kUCvsMenubarID : UCvsCommands.h
  • kUCvsToolbarID : UCvsCommands.h
  • kUMainConsoleID : UCvsCommands.h
  • kUMainWidget : uwidget.h
  • kUnderline : AppConsole.h
  • kUnicodeIsBinary : TextBinary.h
  • kUnicodeIsText : TextBinary.h
  • kVChildSpace : GraphView.cpp, UCvsGraph.cpp
  • kWin16 : CvsPrefs.h
  • kWin32 : CvsPrefs.h
  • kWinNT35 : CvsPrefs.h
  • kWinNT4 : CvsPrefs.h
  • kWinVersion : CvsPrefs.h

- l -
  • last_nonopt : getopt.c
  • launchCVS() : AppGlue.h, AppGlue.cpp
  • LaunchDiff() : CvsPrefs.h, CvsPrefs.cpp
  • LaunchEditor() : CvsPrefs.h, CvsPrefs.cpp
  • LaunchViewer() : CvsPrefs.h, CvsPrefs.cpp
  • LayoutRowCol() : GfxSplitterWnd.cpp
  • lf : ImportFilter.cpp
  • LIBID_CVS_COWORKERLib : CVS_Coworker_i.c, CVS_Coworker.h, CVS_Coworker_i.h, CVS_Coworker_i.c, cvs_coworker.h
  • list_add_type() : ImportFilter.cpp
  • list_add_warning() : ImportFilter.cpp
  • list_all_types_recur() : ImportFilter.h, ImportFilter.cpp
  • listAddCell() : dll_garbage.c
  • listFree() : dll_garbage.c
  • listNew() : dll_garbage.c
  • LOAD_CODEFRAG : TclGlue.cpp, PythonGlue.cpp
  • loadCVS() : AppGlue.mac.h
  • LoadDIB() : dib.h, dib.c
  • LoadPersistentSettings() : Persistent.h, Persistent.cpp
  • loadSettingsInternal() : Persistent.cpp
  • local : Authen.h
  • localInstance : Authen.cpp
  • LocalSystemTimeToUtcSystemTime() : Stat.cpp
  • LOG_API_FN : CvsTrace.h
  • LOG_API_N : CvsTrace.h
  • LOG_API_S : CvsTrace.h
  • LOG_API_X : CvsTrace.h
  • LOG_BUFFER : CvsTrace.h
  • Log_printf() : CvsTrace.h, CvsTrace.cpp
  • LogAttach() : CvsTrace.h
  • LogBuffer() : CvsTrace.h, CvsTrace.cpp
  • LogCleanup() : CvsTrace.h, CvsTrace.cpp
  • LogInitialize() : CvsTrace.h, CvsTrace.cpp
  • LogSetFilter() : CvsTrace.h, CvsTrace.cpp
  • LogString() : CvsTrace.h, CvsTrace.cpp
  • LogWrite() : CvsTrace.cpp
  • lstat : StdAfx.h

- m -
  • m_rectActualFrameSize : CJDockContext.cpp
  • m_rectActualSize : CJDockContext.cpp
  • m_rectFrameBorders : CJDockContext.cpp
  • m_rectRequestedSize : CJDockContext.cpp
  • MA_CHECK : UPseudoSupport.cpp
  • MA_DEFINE_CLASS_M0() : UPseudoSupport.cpp
  • MA_DEFINE_CLASS_M1() : UPseudoSupport.cpp
  • MAC_APPSINGLE : CvsPrefs.h
  • MAC_HQX : CvsPrefs.h
  • macapp_workaround_adlib_bug() : UPseudoSupport.h, UPseudoSupport.cpp
  • MACENCODING : CvsPrefs.h
  • MacGetPrefsFolder() : MacMisc.h
  • MacGetSpecialFolder() : MacMisc.h
  • MacGetTempFolder() : MacMisc.h
  • macpp_fecthview() : UPseudoSupport.h, UPseudoSupport.cpp
  • macpp_findwindow() : UPseudoSupport.cpp
  • macpp_getattachwindow() : UPseudoSupport.h, UPseudoSupport.cpp
  • macpp_getcmdid() : UPseudoSupport.cpp
  • macpp_linkbroadcasters() : UPseudoSupport.h, UPseudoSupport.cpp
  • macpp_preparetable() : UPseudoSupport.h, UPseudoSupport.cpp
  • MACROS_FOLDER : MacrosSetup.h
  • MacrosFlushAll() : MacrosSetup.cpp
  • MacrosGetLoc() : MacrosSetup.h, MacrosSetup.cpp
  • MacrosReloadAll() : MacrosSetup.h, MacrosSetup.cpp
  • MACSPEC : ImportFilter.cpp
  • main : dll_glue.c, cvsgui.c, cvsgui.h
  • MakeOleVariant() : CJHtmlView.cpp
  • MakeTmpFile() : TextBinary.h, TextBinary.cpp
  • malloc : dll_garbage.h
  • MatchIgnoredList() : CvsIgnore.h, CvsIgnore.cpp
  • MatchToken() : wincvs.cpp
  • MAX : udraw.cpp
  • MAX_ARGS : TextBinary.h
  • MAX_BUFLEN : TipDlg.cpp
  • MAX_CHAR_BY_LINE : wincvsView.h
  • MAX_CMD_LEN : TextBinary.h
  • MAX_ColorS : CJColorPopup.cpp
  • MAX_DATE : CJDateTimeCtrl.cpp
  • MAX_MACBIN_DESC : MacBinMaps.h
  • MAX_PATH : FileTraversal.h
  • MAX_PRINT_ARG : CvsArgs.cpp
  • MAX_TEST_SIZE : TextBinary.cpp
  • MAX_TIME_BUFFER_SIZE : CJDateTimeCtrl.cpp
  • MAX_VALUE_LEN : GetValue.h
  • MAXI_H_DISABLE : CJControlBar.h
  • MAXI_H_ENABLED : CJControlBar.h
  • MAXI_V_DISABLE : CJControlBar.h
  • MAXI_V_ENABLED : CJControlBar.h
  • MAXNAMLEN : ndir.h
  • MIDL_DEFINE_GUID : CVS_Coworker_i.c
  • MIDL_PROC_FORMAT_STRING : CVS_Coworker_p.c
  • MIDL_TYPE_FORMAT_STRING : CVS_Coworker_p.c
  • MIDL_user_allocate() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • MIDL_user_free() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • MigrateCvsrootList() : CvsPrefs.h, CvsPrefs.cpp
  • MIGRATECVSROOTLIST : CvsPrefs.h
  • MIN : udraw.cpp
  • MIN_CHUNK : getline.c
  • MIN_DATE : CJDateTimeCtrl.cpp
  • MIN_IDLE : uevent.cpp
  • minVer : findtcl.cpp
  • MIRC_TRANSPARENT : CTCP2Parse.cpp
  • modelRecursive : BrowseViewColumn.cpp
  • modelRegular : BrowseViewColumn.cpp
  • ModifyODMenu : CJMenu.h
  • MODULE_SIZE : dll_garbage.c
  • month_len : Stat.cpp
  • month_names : Stat.cpp
  • my_index : getopt.c
  • myflush() : cvsgui.c
  • mystrdup() : CvsArgs.cpp
  • myTcl_CreateInterp() : TclGlue.cpp

- n -
  • nameColumn : BrowseViewColumn.cpp
  • NAMESPACE : UCvsFiles.cpp, MultiString.h
  • NCOLORSHADES : CJControlBar.cpp
  • NEW : TclGlue.cpp, PythonGlue.cpp, Persistent.cpp, ImportFilter.cpp, CvsEntries.cpp, uwidget.cpp, utoolbar.cpp, UPseudoSupport.cpp
  • nextchar : getopt.c
  • nextLine() : PseudoButton.cpp
  • NM_FOLDERCHANGE : GfxOutBarCtrl.h
  • NM_OB_DRAGITEM : GfxOutBarCtrl.h
  • NM_OB_ITEMCLICK : GfxOutBarCtrl.h
  • NM_OB_ITEMHOVER : GfxOutBarCtrl.h
  • NM_OB_ONGROUPENDEDIT : GfxOutBarCtrl.h
  • NM_OB_ONLABELENDEDIT : GfxOutBarCtrl.h
  • nMonthDays : CJDateTimeCtrl.cpp
  • no_argument : getopt.h
  • NONE : CJControlBar.h
  • NORM_H_DISABLE : CJControlBar.h
  • NORM_H_ENABLED : CJControlBar.h
  • NORM_V_DISABLE : CJControlBar.h
  • NORM_V_ENABLED : CJControlBar.h
  • Normal : CJMenu.h
  • NormalizeFn() : GraphDoc.cpp
  • ntserver : Authen.h
  • ntserverInstance : Authen.cpp
  • NULL : getopt1.c
  • NUM_COLUMNS : CJColorPopup.cpp, UCvsFiles.cpp
  • NUM_CVSROOT : CvsPrefs.h
  • NumberToString_US() : UPseudoSupport.cpp

- o -
  • OB_CYBUTTON : CJOutlookBar.h
  • Object_StubDesc : CVS_Coworker_p.c
  • OBM_CHECK : CJMenu.cpp
  • OBN_SELENDOK : CJOutlookBar.h
  • OCTANGLE_COUNT : GraphView.h
  • OFFSET : UPseudoSupport.cpp
  • OffsetRect() : udraw.h, udraw.cpp
  • ON_CHGCURSOR : umain.h
  • ON_CHGFOCUS : umain.h
  • ON_COMBO_APPEND : umain.h
  • ON_COMBO_DELSEL : umain.h
  • ON_COMBO_ENABLESEL : umain.h
  • ON_COMBO_GETCOUNT : umain.h
  • ON_COMBO_GETMENU : umain.h
  • ON_COMBO_GETSEL : umain.h
  • ON_COMBO_RESETALL : umain.h
  • ON_COMBO_SEL : umain.h
  • ON_COMBO_SEL_RANGE : umain.h
  • ON_COMBO_SETSEL : umain.h
  • ON_CUSTOM_DRAW : umain.h
  • ON_CUSTOM_DRAW_RANGE : umain.h
  • ON_DRAGQUERY : umain.h
  • ON_DRAGQUERY_RANGE : umain.h
  • ON_DROPIT : umain.h
  • ON_DROPIT_RANGE : umain.h
  • ON_DROPQUERY : umain.h
  • ON_DROPQUERY_CMDID : umain.h
  • ON_DROPQUERY_RANGE : umain.h
  • ON_DROPREF : umain.h
  • ON_EDITACTIVATE : umain.h
  • ON_EDITACTIVATE_RANGE : umain.h
  • ON_EDITCHANGE : umain.h
  • ON_EDITCHANGE_RANGE : umain.h
  • ON_ENABLECMD : umain.h
  • ON_FETCHCMD : umain.h
  • ON_GET_SLIDERPROP : umain.h
  • ON_GETFLOAT : umain.h
  • ON_GETTEXT : umain.h
  • ON_INIT_TAB_WIDGET : umain.h
  • ON_INIT_WIDGET : umain.h
  • ON_INVALIDATE : umain.h
  • ON_KEYDOWN : umain.h
  • ON_LIST_ADDCOLUMNS : umain.h
  • ON_LIST_ADDSEL : umain.h
  • ON_LIST_DBLCLICK : umain.h
  • ON_LIST_DELROW : umain.h
  • ON_LIST_GETINFO : umain.h
  • ON_LIST_GETNEXT : umain.h
  • ON_LIST_GETNEXTSEL : umain.h
  • ON_LIST_INSERT : umain.h
  • ON_LIST_NEWROW : umain.h
  • ON_LIST_RESETALL : umain.h
  • ON_LIST_RESORT : umain.h
  • ON_LIST_ROWGETDATA : umain.h
  • ON_LIST_ROWSETDATA : umain.h
  • ON_LIST_SELCOLUMN : umain.h
  • ON_LIST_SELECTING : umain.h
  • ON_LIST_SETCOLTITLE : umain.h
  • ON_LIST_SETCOLWIDTH : umain.h
  • ON_LIST_SETFEEDBACK : umain.h
  • ON_PAGE_CHANGED : umain.h
  • ON_QUERYSTATE : umain.h
  • ON_REDRAW : umain.h
  • ON_RESIZE : umain.h
  • ON_SCROLLCHANGE : umain.h
  • ON_SCROLLCHANGE_RANGE : umain.h
  • ON_SET_SLIDER : umain.h
  • ON_SET_SLIDERPROP : umain.h
  • ON_SETCURSOR : umain.h
  • ON_SETFLOAT : umain.h
  • ON_SETSTATE : umain.h
  • ON_SETTEXT : umain.h
  • ON_SHOW_WIDGET : umain.h
  • ON_SHOW_WIDGET_RANGE : umain.h
  • ON_SMARTCOMBO_SETFEATURE : umain.h
  • ON_SMARTCOMBO_SETITEMS : umain.h
  • ON_SMARTCOMBO_SETREADONLY : umain.h
  • ON_TB_BUTTON : umain.h
  • ON_TB_CHECKBTN : umain.h
  • ON_TB_DROPDOWN : umain.h
  • ON_TB_END : umain.h
  • ON_TB_GETCOLOR : umain.h
  • ON_TB_INIT : umain.h
  • ON_TB_SEPARATOR : umain.h
  • ON_TIMER : umain.h
  • ON_TREE_DELETE : umain.h
  • ON_TREE_EXPAND : umain.h
  • ON_TREE_EXPANDING : umain.h
  • ON_TREE_GETINFO : umain.h
  • ON_TREE_GETSEL : umain.h
  • ON_TREE_INSERT : umain.h
  • ON_TREE_RESETALL : umain.h
  • ON_TREE_SELECT : umain.h
  • ON_TREE_SELECTING : umain.h
  • ON_TREE_SETDATA : umain.h
  • ON_TREE_SETICON : umain.h
  • ON_UBTNDBLDOWN : umain.h
  • ON_UBTNDOWN : umain.h
  • ON_UBTNUP : umain.h
  • ON_UCOMMAND : umain.h
  • ON_UCOMMAND_RANGE : umain.h
  • ON_UCOMMAND_RANGEEX : umain.h
  • ON_UCREATE : umain.h
  • ON_UDESTROY : umain.h
  • ON_UENTER : umain.h
  • ON_UEXPOSE : umain.h
  • ON_UGETLLOC : umain.h
  • ON_ULEAVE : umain.h
  • ON_UMMOVE : umain.h
  • ON_UNOTIFY : umain.h
  • ON_UPDATEFOCUS : umain.h
  • ON_UPDATEUI : umain.h
  • ON_USETLLOC : umain.h
  • ON_USETTOOLTIP : umain.h
  • ON_UUPDATECMD : umain.h
  • ON_UUPDATECMD_RANGE : umain.h
  • onFilteringChanged() : BrowseFileView.cpp
  • onFilterMaskEntered() : MainFrm.cpp
  • onIgnoreChanged() : WinCvsBrowser.cpp
  • open_cvs_process : cvsgui_process.cpp
  • opendir() : ndir.h, ndir.c
  • OpenProject() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • optarg : getopt.h, getopt.c
  • opterr : getopt.h, getopt.c
  • optind : getopt.h, getopt.c
  • optional_argument : getopt.h
  • optionColumn : BrowseViewColumn.cpp
  • optopt : getopt.h, getopt.c
  • ordering : getopt.c
  • OUTLINE : CJControlBar.h
  • outlog : cvsgui.c
  • outname : cvsgui.c
  • outputXML() : PythonGlue.cpp
  • outseek : cvsgui.c

- p -
  • PaletteSize() : dib.h, dib.c
  • ParseUMENU() : PythonImpl.cpp
  • PATH_MAX : cvsgui.c
  • pathColumn : BrowseViewColumn.cpp
  • PathNameFromDirID() : VolsPaths.h, VolsPaths.c
  • PathNameFromWD() : VolsPaths.h, VolsPaths.c
  • PERMUTE : getopt.c
  • PERSISTENT_CAST : Persistent.h
  • persistentAdded() : BrowseViewModel.cpp
  • persistentChanged() : BrowseViewModel.cpp
  • persistentConflicts() : BrowseViewModel.cpp
  • persistentHideUnknown() : BrowseViewModel.cpp
  • persistentIgnore() : BrowseViewModel.cpp
  • persistentMissing() : BrowseViewModel.cpp
  • persistentRecursive() : BrowseViewModel.cpp
  • persistentRemoved() : BrowseViewModel.cpp
  • persistentUnknown() : BrowseViewModel.cpp
  • pid_t : cvsgui_wire.h
  • piError : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • pipe_t : cvsgui_wire.h
  • platform_calloc : dll_garbage.c
  • platform_free : dll_garbage.c
  • platform_malloc : dll_garbage.c
  • platform_realloc : dll_garbage.c
  • poolAlloc() : dll_garbage.c
  • poolFree() : dll_garbage.c
  • poolPtr : dll_garbage.c
  • poolRemove() : dll_garbage.c
  • posixly_correct : getopt.c
  • PP_PASTE : version_fu.h
  • PP_STRINGIZE : version_fu.h
  • PREAMBLE : CvsCoworker.cpp
  • print() : LogParse.cpp
  • PROC_FORMAT_STRING_SIZE : CVS_Coworker_p.c
  • process_write_buffer : cvsgui_process.cpp
  • PROFILE_NAME : Persistent.h
  • PromptEditMessage() : AskYesNo.h, AskYesNo.cpp
  • PromptMessage() : AskYesNo.h, AskYesNo.cpp
  • pserver : Authen.h
  • pserverInstance : Authen.cpp
  • PtInRect() : udraw.h, udraw.cpp
  • PY_BEGIN_IMPL_METHOD : PythonMacros.h
  • Py_BuildValue : PythonGlue.impl.h
  • Py_BuildValue_glue : PythonGlue.impl.h
  • PY_DECL_CLASS : PythonMacros.h
  • PY_DECL_CLASS_INHERITED : PythonMacros.h
  • PY_DECL_METHOD : PythonMacros.h
  • PY_END_IMPL_METHOD : PythonMacros.h
  • Py_EndInterpreter : PythonGlue.impl.h
  • Py_EndInterpreter_glue : PythonGlue.impl.h
  • Py_Finalize : PythonGlue.impl.h
  • Py_Finalize_glue : PythonGlue.impl.h
  • Py_FindMethod : PythonGlue.impl.h
  • Py_FindMethod_glue : PythonGlue.impl.h
  • Py_GetPath : PythonGlue.impl.h
  • Py_GetPath_glue : PythonGlue.impl.h
  • PY_IMPL_CLASS : PythonMacros.h
  • PY_IMPL_METHOD : PythonMacros.h
  • Py_Initialize : PythonGlue.impl.h
  • Py_Initialize_glue : PythonGlue.impl.h
  • Py_InitModule4 : PythonGlue.impl.h
  • Py_InitModule4_glue : PythonGlue.impl.h
  • Py_IsInitialized : PythonGlue.impl.h
  • Py_IsInitialized_glue : PythonGlue.impl.h
  • Py_NewInterpreter : PythonGlue.impl.h
  • Py_NewInterpreter_glue : PythonGlue.impl.h
  • Py_SetProgramName : PythonGlue.impl.h
  • Py_SetProgramName_glue : PythonGlue.impl.h
  • PyAppendCache() : PythonGlue.h, PythonGlue.cpp
  • PyArg_ParseTuple : PythonGlue.impl.h
  • PyArg_ParseTuple_glue : PythonGlue.impl.h
  • PyDict_SetItemString : PythonGlue.impl.h
  • PyDict_SetItemString_glue : PythonGlue.impl.h
  • PyDoCmdUI() : PythonGlue.h, PythonGlue.cpp
  • PyDoPython() : PythonGlue.h, PythonGlue.cpp
  • PyErr_Clear : PythonGlue.impl.h
  • PyErr_Clear_glue : PythonGlue.impl.h
  • PyErr_NewException : PythonGlue.impl.h
  • PyErr_NewException_glue : PythonGlue.impl.h
  • PyErr_SetString : PythonGlue.impl.h
  • PyErr_SetString_glue : PythonGlue.impl.h
  • PyEval_InitThreads : PythonGlue.impl.h
  • PyEval_InitThreads_glue : PythonGlue.impl.h
  • PyFile_AsFile : PythonGlue.impl.h
  • PyFile_AsFile_glue : PythonGlue.impl.h
  • PyFile_Type_glue : PythonGlue.impl.h
  • PyHandleCvsguiError() : PythonMacros.h, PythonContainer.cpp
  • PyInt_Check : PythonGlue.impl.h
  • PyInt_FromLong : PythonGlue.impl.h
  • PyInt_FromLong_glue : PythonGlue.impl.h
  • PyInt_Type_glue : PythonGlue.impl.h
  • PyInvalUICache() : PythonGlue.h, PythonGlue.cpp
  • PyIsUICacheValid() : PythonGlue.h, PythonGlue.cpp
  • PyMacrosReloadAll() : PythonGlue.h, PythonGlue.cpp
  • PyModule_GetDict : PythonGlue.impl.h
  • PyModule_GetDict_glue : PythonGlue.impl.h
  • PyRegistry_InitValues : PythonContainer.h
  • PyRun_SimpleFile : PythonGlue.impl.h
  • PyRun_SimpleFile_glue : PythonGlue.impl.h
  • PyRun_SimpleString : PythonGlue.impl.h
  • PyRun_SimpleString_glue : PythonGlue.impl.h
  • PyString_AsString : PythonGlue.impl.h
  • PyString_AsString_glue : PythonGlue.impl.h
  • PyString_Check : PythonGlue.impl.h
  • PyString_FromString : PythonGlue.impl.h
  • PyString_FromString_glue : PythonGlue.impl.h
  • PyString_Type_glue : PythonGlue.impl.h
  • PySys_SetPath : PythonGlue.impl.h
  • PySys_SetPath_glue : PythonGlue.impl.h
  • PYTHONGLUE_EXTERN : PythonImpl.cpp, PythonGlue.impl.h
  • PYTHONLIB_FOLDER : MacrosSetup.h
  • PythonLibGetLoc() : MacrosSetup.h, MacrosSetup.cpp
  • PyThreadState : PythonGlue.h
  • PyThreadState_Swap : PythonGlue.impl.h
  • PyThreadState_Swap_glue : PythonGlue.impl.h
  • PyTuple_Check : PythonGlue.impl.h
  • PyTuple_New : PythonGlue.impl.h
  • PyTuple_New_glue : PythonGlue.impl.h
  • PyTuple_Size : PythonGlue.impl.h
  • PyTuple_Size_glue : PythonGlue.impl.h
  • PyTuple_Type_glue : PythonGlue.impl.h
  • PyType_Type_glue : PythonGlue.impl.h
  • PyValidUICache() : PythonGlue.h, PythonGlue.cpp

- q -
  • qCvsDebug : StdAfx.h
  • qDebug : StdAfx.h
  • qMacAPP : stdafx.h
  • qMacPP : stdafx.h
  • qRangeCheck : dll_garbage.c, stdafx.h
  • qRelease : stdafx.h
  • qReleaseBuild : stdafx.h
  • qTRACE : CvsTrace.h
  • qTRACE_FN : CvsTrace.h
  • qTRACE_N : CvsTrace.h
  • qTRACE_S : CvsTrace.h
  • qTRACE_X : CvsTrace.h

- r -
  • RAISED : CJControlBar.h
  • read() : cvsgui_wire.cpp
  • ReadDIBFile() : dib.h, dib.c
  • ReadDIBRsrc() : dib.h
  • readdir() : ndir.h, ndir.c
  • ReadIgnoredFile() : CvsIgnore.cpp
  • realloc : dll_garbage.h
  • reduceString() : CvsArgs.cpp
  • REFERENCE_PROXY_FILE() : dlldata.c
  • RELEASE : CJHtmlView.cpp
  • RemoveFiles() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • RenameFile() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • reopen_consoles() : cvsgui.c
  • REQUIRE_ORDER : getopt.c
  • required_argument : getopt.h
  • RETURN_IN_ORDER : getopt.c
  • revcmp() : UCvsFiles.cpp
  • revisionColumn : BrowseViewColumn.cpp
  • rewinddir : ndir.h
  • RGB_DEF_BRANCH : GraphView.h
  • RGB_DEF_DEADNODE : GraphView.h
  • RGB_DEF_HEADER : GraphView.h
  • RGB_DEF_NODE : GraphView.h
  • RGB_DEF_SEL : GraphView.h
  • RGB_DEF_SHADOW : GraphView.h
  • RGB_DEF_TAG : GraphView.h
  • RGB_DEF_USERSTATENODE : GraphView.h
  • rhosts : Authen.h
  • rhostsInstance : Authen.cpp
  • ROUND_RECT_PT : GraphView.h

- s -
  • SafeCopy() : BrowseViewColumn.cpp
  • sAllTargets : uevent.cpp
  • sAskingMainThread : MainFrm.cpp
  • SaveAsPersistentSettings() : Persistent.cpp
  • SaveBmpFromDDB() : dib.h, dib.c
  • SaveDIB() : dib.h, dib.c
  • SavePersistentSettings() : Persistent.h, Persistent.cpp
  • sBuf : TextBinary.cpp
  • sBufSize : TextBinary.cpp
  • sCallTable : AppGlue.cpp
  • SCHEMA_0 : CvsPrefs.h
  • SCHEMA_1 : CvsPrefs.h
  • SCHEMA_NUMBER : CvsPrefs.h
  • sCompatProc : dll_loader.h, dll_loader.c
  • sCvsContainerFileSpec : dll_glue.c
  • sDefaultPath : PromptFiles.cpp
  • sDefBrowserMenu : wincvs_winutil.cpp
  • sDefDateNames : UpdateDlg.cpp
  • sDefFilesMenu : wincvs_winutil.cpp
  • sDefLogDateNames : LogDlg.cpp
  • sDefLogStateNames : LogDlg.cpp
  • sDefLogTagNames : LogDlg.cpp
  • sDefLogUserNames : LogDlg.cpp
  • sDefModuleNames : ImportDlg.cpp
  • sDefPrevCvsCmd : LineCmd.cpp
  • sDefReleases : ImportDlg.cpp
  • sDefRevDateNames : UpdateDlg.cpp
  • sDefTagNames : UpdateDlg.cpp
  • sDefVendors : ImportDlg.cpp
  • sDummyObject : cvsgui_process.cpp
  • sDummyStarter : UPseudoSupport.cpp
  • seekdir() : ndir.h, ndir.c
  • ServeProtocol() : cvsgui_process.cpp
  • SetDItemMenuSel() : MacMisc.h
  • SetIcon() : WinCvsBrowser.cpp
  • setModule() : dll_garbage.c
  • SetRect() : udraw.h, udraw.cpp
  • SetRectEmpty() : udraw.h, udraw.cpp
  • SETTINGS_FOLDER : Persistent.cpp
  • SettingsGetLoc() : Persistent.cpp
  • SetWinCvsDebugMask() : WinCvsDebug.h, WinCvsDebug.cpp
  • SetWinCvsDebugMaskBit() : WinCvsDebug.h, WinCvsDebug.cpp
  • sFileIconAddedIcon : UCvsFiles.cpp
  • sFileIconBinaryIcon : UCvsFiles.cpp
  • sFileIconBinaryModIcon : UCvsFiles.cpp
  • sFileIconConflictIcon : UCvsFiles.cpp
  • sFileIconIgnoredIcon : UCvsFiles.cpp
  • sFileIconMissIcon : UCvsFiles.cpp
  • sFileIconRemovedIcon : UCvsFiles.cpp
  • sFileIconTextIcon : UCvsFiles.cpp
  • sFileIconTextModIcon : UCvsFiles.cpp
  • sFileIconUnknownIcon : UCvsFiles.cpp
  • sFolderIcon : UCvsFolders.cpp
  • sFolderIconIcon : UCvsFiles.cpp
  • sFolderIconIgnoredIcon : UCvsFiles.cpp
  • sFolderIconMissIcon : UCvsFiles.cpp
  • sFolderIconUnknownIcon : UCvsFiles.cpp
  • sFolderIgnoredIcon : UCvsFolders.cpp
  • sFolderMissingIcon : UCvsFolders.cpp
  • sFolderUnknownIcon : UCvsFolders.cpp
  • sGetEnv() : MainFrm.cpp
  • sGetEnvResult : MainFrm.cpp
  • SHADOW_OFFSET_PT : GraphView.h
  • sHandlers : cvsgui_wire.cpp
  • SHELL_KIND : CvsPrefs.h
  • SHELL_PYTHON : CvsPrefs.h
  • SHELL_TCL : CvsPrefs.h
  • sHex : CvsTrace.cpp
  • shl_calloc() : dll_garbage.h, dll_garbage.c
  • shl_free() : dll_garbage.h, dll_garbage.c
  • shl_malloc() : dll_garbage.h, dll_garbage.c
  • shl_realloc() : dll_garbage.h, dll_garbage.c
  • ShowAdvancedOptionsForCommand() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • ShowFileHistory() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • ShowFileProperties() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • ShowUserInterface() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • simple_diff() : Persistent.cpp
  • sInitInvTable : CustomizeMenus.cpp
  • sInvTable : CustomizeMenus.cpp
  • SIZEOF_BITMAPFILEHEADER_PACKED : dib.h
  • sLastExitCode : AppGlue.cpp
  • sLastIdle : uevent.cpp
  • sLogout : wincvs.cpp
  • SplitPath() : TextBinary.h, TextBinary.cpp
  • sRetainedMsgs : uevent.cpp
  • ssh : Authen.h
  • sshInstance : Authen.cpp
  • STARTPOINT_PT : GraphView.h
  • stat : StdAfx.h
  • statusColumn : BrowseViewColumn.cpp
  • sTclBrowser : TclGlue.cpp
  • STD : umain.h
  • STD_STL : cvsgui_wire.cpp, cvsgui_process.cpp
  • sTemporaryTurnOffNotify : UCvsFolders.cpp
  • sTmpList : AppGlue.cpp
  • sTooltipHandler : uevent.cpp
  • strdup() : stdafx.h, UPseudoSupport.cpp, stdafx.h
  • stricmp : MacMisc.h
  • StringToArgv() : TextBinary.h, TextBinary.cpp
  • strnicmp : MacMisc.h
  • STRUCT_DIRENT : FileTraversal.h
  • sTurnOffDispatching : uevent.cpp
  • STYLE_DEADNODE : GraphView.h
  • STYLE_USERSTATENODE : GraphView.h
  • SUNKEN : CJControlBar.h
  • systemtime_second : Stat.cpp
  • szIntFilePos : TipDlg.cpp
  • szIntStartup : TipDlg.cpp
  • szSection : TipDlg.cpp
  • szTimeStamp : TipDlg.cpp

- t -
  • TABVIEW_BORDER : CJTabView.h
  • Tag_Open() : CvsEntries.h, CvsEntries.cpp
  • tagColumn : BrowseViewColumn.cpp
  • TBBS_AUTOSIZE : CJToolBar.h
  • TBBS_BUTTON : CJToolBar.h
  • TBBS_CHECKBOX : CJToolBar.h
  • TBBS_CHECKED : CJToolBar.h
  • TBBS_CHECKGROUP : CJToolBar.h
  • TBBS_DISABLED : CJToolBar.h
  • TBBS_DROPDOWN : CJToolBar.h
  • TBBS_ELLIPSES : CJToolBar.h
  • TBBS_GROUP : CJToolBar.h
  • TBBS_HIDDEN : CJToolBar.h
  • TBBS_INDETERMINATE : CJToolBar.h
  • TBBS_MARKED : CJToolBar.h
  • TBBS_NOPREFIX : CJToolBar.h
  • TBBS_PRESSED : CJToolBar.h
  • TBBS_SEPARATOR : CJToolBar.h
  • TBBS_WRAPPED : CJToolBar.h
  • tbeButton : utoolbar.cpp
  • tbeDropDown : utoolbar.cpp
  • tbeKind : utoolbar.cpp
  • tbeSeparator : utoolbar.cpp
  • TCB_ITEM : CJTabCtrlBar.h
  • Tcl_Alloc : TclGlue.cpp
  • Tcl_AppendResult : TclGlue.cpp
  • TCL_BREAK : TclGlue.h
  • Tcl_Concat : TclGlue.cpp
  • TCL_CONTINUE : TclGlue.h
  • Tcl_CreateCommand : TclGlue.cpp
  • Tcl_CreateInterp : TclGlue.cpp
  • Tcl_DeleteInterp : TclGlue.cpp
  • Tcl_DStringAppendElement : TclGlue.cpp
  • Tcl_DStringEndSublist : TclGlue.cpp
  • Tcl_DStringFree : TclGlue.cpp
  • Tcl_DStringInit : TclGlue.cpp
  • Tcl_DStringResult : TclGlue.cpp
  • Tcl_DStringStartSublist : TclGlue.cpp
  • TCL_ERROR : TclGlue.h
  • Tcl_Eval : TclGlue.cpp
  • Tcl_EvalFile : TclGlue.cpp
  • Tcl_ExprLong : TclGlue.cpp
  • Tcl_FindExecutable : TclGlue.cpp
  • Tcl_Free : TclGlue.cpp
  • Tcl_Init : TclGlue.cpp
  • Tcl_ListObjAppendElement : TclGlue.cpp
  • Tcl_NewListObj : TclGlue.cpp
  • Tcl_NewStringObj : TclGlue.cpp
  • TCL_OK : TclGlue.h
  • Tcl_Realloc : TclGlue.cpp
  • TCL_RETURN : TclGlue.h
  • Tcl_SetObjResult : TclGlue.cpp
  • Tcl_SetResult : TclGlue.cpp
  • Tcl_SetVar : TclGlue.cpp
  • Tcl_SetVar2 : TclGlue.cpp
  • Tcl_SourceRCFile : TclGlue.cpp
  • TclBrowserAppend() : TclGlue.h, TclGlue.cpp
  • TclBrowserReset() : TclGlue.h, TclGlue.cpp
  • tclCvsBrowserProc() : TclGlue.cpp
  • tclCvsEntriesDeleteProc() : TclGlue.cpp
  • tclCvsEntriesProc() : TclGlue.cpp
  • tclCvsErrProc() : TclGlue.cpp
  • tclCvsExitOnErrorProc() : TclGlue.cpp
  • tclCvsLastErrorCodeProc() : TclGlue.cpp
  • tclCvsOutProc() : TclGlue.cpp
  • tclCvsProc() : TclGlue.cpp
  • tclDirProc() : TclGlue.cpp
  • TclFreeObj : TclGlue.cpp
  • tclGetDebugMaskProc() : TclGlue.cpp
  • tclGetFileModTimeProc() : TclGlue.cpp
  • tclHelpProc() : TclGlue.cpp
  • tclSafeRemove() : TclGlue.cpp
  • tclSetDebugMaskProc() : TclGlue.cpp
  • telldir() : ndir.h, ndir.c
  • TestBuffer() : TextBinary.cpp
  • testCVS() : AppGlue.h, AppGlue.cpp
  • TestFileIsAlias() : TextBinary.cpp
  • TestValidName() : TextBinary.cpp
  • TextOnly : CJMenu.h
  • theApp : wincvs.cpp
  • theHookMap : Subclass.cpp
  • TIPDLG_H_INCLUDED_ : TipDlg.h
  • TmFromOleDate() : CJDateTimeCtrl.cpp
  • TMString< UPStr > : MultiString.cpp
  • TMString< UStr > : MultiString.cpp
  • TOHEX : CJHexEdit.cpp
  • TOOLTIP_ID : CJHyperLink.cpp
  • TRACK_BORDER_SIZE : CJSizeDockBar.cpp, CJControlBar.cpp
  • TRACK_BUTTON : CJMenuBar.h
  • TRACK_NONE : CJMenuBar.h
  • TRACK_POPUP : CJMenuBar.h
  • TRACKINGSTATE : CJMenuBar.h
  • TRANSMIT_AS_TABLE_SIZE : CVS_Coworker_p.c
  • TraverseHistory() : HistComboBoxEx.cpp
  • TrimRight() : wincvs.cpp
  • TRUE : cvsgui_wire.h
  • TYPE_FORMAT_STRING_SIZE : CVS_Coworker_p.c
  • typesRecursive : BrowseViewColumn.cpp
  • typesRegular : BrowseViewColumn.cpp

- u -
  • UAppConsole() : uconsole.h, uconsole.cpp
  • UASSERT : StdAfx.h, stdafx.h, StdAfx.h, stdafx.h
  • UBEGIN_MESSAGE_MAP : umain.h
  • UCMD_to_WINCMD : umain.h
  • UCMD_to_WINCTL : umain.h
  • UCOLORREF : udraw.h
  • UCreate_AskYesNo() : UCvsDialogs.h
  • UCreate_BranchDlg() : UCvsDialogs.h
  • UCreate_BranchModDlg() : UCvsDialogs.h
  • UCreate_CheckoutDlg() : UCvsDialogs.h
  • UCreate_CmdlineDlg() : UCvsDialogs.h
  • UCreate_CommitDlg() : UCvsDialogs.h
  • UCreate_DiffDlg() : UCvsDialogs.h
  • UCreate_gcvs_Settings() : UCvsDialogs.h
  • UCreate_GraphWindow() : UCvsDialogs.h
  • UCreate_ImpEntryDlg() : UCvsDialogs.h
  • UCreate_ImportDlg() : UCvsDialogs.h
  • UCreate_ImportFilterDlg() : UCvsDialogs.h
  • UCreate_ImpWarningDlg() : UCvsDialogs.h
  • UCreate_LogDlg() : UCvsDialogs.h
  • UCreate_MainWindow() : UCvsDialogs.h
  • UCreate_PasswdDlg() : UCvsDialogs.h
  • UCreate_pixmap() : UCvsDialogs.h, UCvsApp.cpp
  • UCreate_SettingsDlg() : UCvsDialogs.h
  • UCreate_TagDlg() : UCvsDialogs.h
  • UCreate_TagModDlg() : UCvsDialogs.h
  • UCreate_UntagDlg() : UCvsDialogs.h
  • UCreate_UntagModDlg() : UCvsDialogs.h
  • UCreate_UpdateDlg() : UCvsDialogs.h
  • uCursArrow : umain.h
  • UCURSOR : umain.h
  • uCursWatch : umain.h
  • UDECLARE_DYNAMIC : uobject.h
  • UDECLARE_DYNCREATE : uobject.h
  • UDECLARE_MESSAGE_MAP : umain.h
  • UDYNAMIC_CAST : uobject.h
  • UEND_MESSAGE_MAP : umain.h
  • UEventGetTargets() : umain.h, uevent.cpp
  • UEventGetWidID() : umain.h, uevent.cpp
  • UEventGiveTime() : umain.h, uevent.cpp
  • UEventNotifyMessage() : umain.h, uevent.cpp
  • UEventParam : umain.h
  • UEventPostMessage() : umain.h, uevent.cpp
  • UEventQueryWidget() : umain.h, uevent.cpp
  • UEventRemoveWidID() : umain.h, uevent.cpp
  • UEventSendMessage() : umain.h, uevent.cpp
  • UEventSendMessageExt() : umain.h, uevent.cpp
  • UEventSetTooltipHandler() : umain.h, uevent.cpp
  • UEventType : umain.h
  • UEXPORT : uconfig.h
  • UFSSpec : TextBinary.h
  • UGetBValue : udraw.h
  • UGetGValue : udraw.h
  • UGetRValue : udraw.h
  • UHIWORD : umain.h
  • UIMPLEMENT_DYNAMIC : uobject.h
  • UIMPLEMENT_DYNCREATE : uobject.h
  • UIMPLEMENT_RUNTIMECLASS : uobject.h
  • UK_ADD : umain.h
  • UK_ALT : umain.h
  • UK_BACK : umain.h
  • UK_CANCEL : umain.h
  • UK_CLEAR : umain.h
  • UK_CONTROL : umain.h
  • UK_DECIMAL : umain.h
  • UK_DELETE : umain.h
  • UK_DIVIDE : umain.h
  • UK_DOWN : umain.h
  • UK_END : umain.h
  • UK_ESCAPE : umain.h
  • UK_F1 : umain.h
  • UK_F10 : umain.h
  • UK_F11 : umain.h
  • UK_F12 : umain.h
  • UK_F13 : umain.h
  • UK_F14 : umain.h
  • UK_F15 : umain.h
  • UK_F16 : umain.h
  • UK_F17 : umain.h
  • UK_F18 : umain.h
  • UK_F19 : umain.h
  • UK_F2 : umain.h
  • UK_F20 : umain.h
  • UK_F21 : umain.h
  • UK_F22 : umain.h
  • UK_F23 : umain.h
  • UK_F24 : umain.h
  • UK_F3 : umain.h
  • UK_F4 : umain.h
  • UK_F5 : umain.h
  • UK_F6 : umain.h
  • UK_F7 : umain.h
  • UK_F8 : umain.h
  • UK_F9 : umain.h
  • UK_HELP : umain.h
  • UK_HOME : umain.h
  • UK_INSERT : umain.h
  • UK_LBUTTON : umain.h
  • UK_LEFT : umain.h
  • UK_MBUTTON : umain.h
  • UK_MINUS : umain.h
  • UK_MULTIPLY : umain.h
  • UK_NEXT : umain.h
  • UK_NUMPAD0 : umain.h
  • UK_NUMPAD1 : umain.h
  • UK_NUMPAD2 : umain.h
  • UK_NUMPAD3 : umain.h
  • UK_NUMPAD4 : umain.h
  • UK_NUMPAD5 : umain.h
  • UK_NUMPAD6 : umain.h
  • UK_NUMPAD7 : umain.h
  • UK_NUMPAD8 : umain.h
  • UK_NUMPAD9 : umain.h
  • UK_PLUS : umain.h
  • UK_PRIOR : umain.h
  • UK_RBUTTON : umain.h
  • UK_RETURN : umain.h
  • UK_RIGHT : umain.h
  • UK_SEPARATOR : umain.h
  • UK_SHIFT : umain.h
  • UK_SPACE : umain.h
  • UK_SUBTRACT : umain.h
  • UK_TAB : umain.h
  • UK_UP : umain.h
  • UListSorter : umain.h
  • ULOWORD : umain.h
  • UMakeBitmap() : umenu.cpp, umain.h, PseudoButton.h, PseudoButton.cpp
  • UMAKEINT : umain.h
  • UMENU : umain.h
  • UMENU_NULL : umain.h
  • UMenuAddButton() : umenu.h, umenu.cpp
  • UMenuAddPulldown() : umenu.h, umenu.cpp
  • UMenuAddSeparator() : umenu.h, umenu.cpp
  • UMenuAddToggle() : umenu.h, umenu.cpp
  • UMenuCount() : umenu.h, umenu.cpp
  • UMenuDelete() : umenu.h, umenu.cpp
  • UMenuDeleteByCmd() : umenu.h, umenu.cpp
  • UMSG_EXT : umain.h
  • UMSG_NOEXT : umain.h
  • UMSG_RANGE : umain.h
  • UncheckoutFiles() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • UNDEF_STDC : TclGlue.cpp
  • UnionRect() : udraw.h, udraw.cpp
  • unloadCVS() : AppGlue.mac.h
  • unmodified() : CvsEntries.cpp
  • UpdateFiles() : CVS_Coworker.h, CVS_Coworker_i.h, cvs_coworker.h
  • updateUIMenu() : wincvs_winutil.cpp
  • UPMSG : umain.h
  • UPS_SOLID : udraw.h
  • URGB : udraw.h
  • URUNTIME_CLASS : uobject.h
  • usage() : UCvsApp.cpp
  • USE_DL_EXPORT : PythonContainer.h
  • USE_PYTHON : PythonContainer.h
  • USE_TCL : TclGlue.cpp
  • UTB_DROP : umain.h
  • UTB_KIND : PseudoButton.h
  • UTB_SEPARATOR : umain.h
  • UTB_VAR : umain.h
  • UTextTableView_DoubleClick : UPseudoSupport.h
  • UTextTableView_SingleClick : UPseudoSupport.h
  • UTHROW : uconsole.h, stdafx.h
  • UTickCount() : umain.h, uevent.cpp
  • UTREEITEM : umain.h
  • UWinPseudoWindowProc() : uwidget.h, PseudoDlg.cpp
  • UWinToUMod() : PseudoDlg.cpp

- v -
  • VAR_GLUE : PythonGlue.impl.h
  • VC_EXTRALEAN : StdAfx.h
  • VERIFY : CvsTrace.h
  • verLess() : findtcl.cpp
  • verRemove() : findtcl.cpp
  • VERSION_IE3 : CJToolBar.h
  • VERSION_IE4 : CJToolBar.h
  • VERSION_IE401 : CJToolBar.h
  • VERSION_WIN4 : CJToolBar.h
  • VERTF : CJDockContext.cpp
  • VolName2VRef() : VolsPaths.h, VolsPaths.c
  • VOLSPATHS_C : VolsPaths.c
  • VRef2VolName() : VolsPaths.h, VolsPaths.c

- w -
  • WaitChld() : cvsgui_process.cpp
  • WaitForCvs() : AppGlue.h, AppGlue.cpp
  • wantDebugging : stdafx.h
  • WarnNoPython() : NoPython.h, NoPython.cpp
  • WCVS_DEBUG_BUILD_STRING_PREFIX : version_fu.h
  • WCVS_DEBUG_FLAG : version_fu.h
  • wcvs_debug_mask_bits : WinCvsDebug.h
  • wcvs_debug_mask_flags : WinCvsDebug.h
  • WCVS_PATCHED_FLAG : version_fu.h
  • WCVS_PRERELEASE_BUILD_STRING_PREFIX : version_fu.h
  • WCVS_PRERELEASE_FLAG : version_fu.h
  • WCVS_PRIVATE_BUILD_FLAG : version_fu.h
  • WCVS_PRIVATE_BUILD_STRING : version_fu.h
  • WCVS_PRIVATE_BUILD_STRING_PREFIX : version_fu.h
  • WCVS_SPECIAL_BUILD_FLAG : version_fu.h
  • WCVS_SPECIAL_BUILD_STRING : version_fu.h
  • WCVS_SPECIAL_BUILD_STRING_PREFIX : version_fu.h
  • WCVS_UNICODE_BUILD_STRING_PREFIX : version_fu.h
  • wcvsdbg_one_shot : WinCvsDebug.h
  • wcvsdbg_one_shot_bit : WinCvsDebug.h
  • wcvsdbg_trace_dst_checks : WinCvsDebug.h
  • wcvsdbg_trace_dst_checks_bit : WinCvsDebug.h
  • wcvsdbg_trace_modified_checks : WinCvsDebug.h
  • wcvsdbg_trace_modified_checks_bit : WinCvsDebug.h
  • wcvsdbg_trace_stat : WinCvsDebug.h
  • wcvsdbg_trace_stat_bit : WinCvsDebug.h
  • wcvsdbg_verbose : WinCvsDebug.h
  • wcvsdbg_verbose_bit : WinCvsDebug.h
  • WIDTHBYTES : dib.h
  • WIDTHBYTES16 : dib.h
  • WIDTHBYTES8 : dib.h
  • Win32s : CJMenu.cpp
  • Win32Type : CJMenu.cpp
  • WINCMD_DLG_END : umain.h
  • WINCMD_DLG_START : umain.h
  • WINCMD_to_UCMD : umain.h
  • WINCTL_to_UCMD : umain.h
  • WINCVS_BETA_RELEASE : version_no.h
  • WINCVS_BUILD : version_no.h
  • wincvs_debug_mask : WinCvsDebug.cpp
  • WINCVS_FILE_MAJOR : version_no.h
  • WINCVS_FILE_MINOR : version_no.h
  • WINCVS_FILE_PATCHLEVEL : version_no.h
  • WINCVS_FILEVERSION : version_fu.h
  • WINCVS_FILEVERSION_STRING : version_fu.h
  • WINCVS_OFFICIAL_DISTRIBUTION : version_no.h
  • WINCVS_PRIVATE_BUILD : version_no.h
  • WINCVS_PRODUCT_MAJOR : version_no.h
  • WINCVS_PRODUCT_MINOR : version_no.h
  • WINCVS_PRODUCT_PATCHLEVEL : version_no.h
  • WINCVS_PRODUCTVERSION : version_fu.h
  • WINCVS_PRODUCTVERSION_STRING : version_fu.h
  • WINCVSDEBUG_H_INCLUDED : WinCvsDebug.h
  • Windoze95 : CJMenu.cpp
  • WinInitWidgets() : PseudoDlg.cpp
  • WinNT3 : CJMenu.cpp
  • WinNT4orHigher : CJMenu.cpp
  • wire_clear_error() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_destroy() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_error() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_error_val : cvsgui_wire.cpp
  • wire_flush() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_flush_func : cvsgui_wire.cpp
  • WIRE_MARSHAL_TABLE_SIZE : CVS_Coworker_p.c
  • wire_read() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_read_double() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_read_func : cvsgui_wire.cpp
  • wire_read_int16() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_read_int32() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_read_int8() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_read_msg() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_read_string() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_register() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_set_flusher() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_set_reader() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_set_writer() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_write() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_write_double() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_write_func : cvsgui_wire.cpp
  • wire_write_int16() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_write_int32() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_write_int8() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_write_msg() : cvsgui_wire.h, cvsgui_wire.cpp
  • wire_write_string() : cvsgui_wire.h, cvsgui_wire.cpp
  • WireDestroyFunc : cvsgui_wire.h
  • WireFlushFunc : cvsgui_wire.h
  • WireHandler : cvsgui_wire.cpp
  • WireIOFunc : cvsgui_wire.h
  • WireMessage : cvsgui_wire.h
  • WireReadFunc : cvsgui_wire.h
  • WireWriteFunc : cvsgui_wire.h
  • WM_OUTBAR_NOTIFY : GfxOutBarCtrl.h
  • WM_RESETVIEW : WinCvsBrowser.cpp, BrowseFileView.cpp
  • WM_SMCB_SETFEATURE : SmartComboBox.h
  • WM_SMCB_SETITEMS : SmartComboBox.h
  • WM_SMCB_SETREADONLY : SmartComboBox.h
  • WNT_filename_classes : fnmatch.h, fnmatch.c
  • wnt_fstat() : StdAfx.h, Stat.cpp
  • wnt_lstat() : StdAfx.h, Stat.cpp
  • wnt_stat() : StdAfx.h, Stat.cpp
  • write() : cvsgui_wire.cpp, cvsgui_process.cpp
  • WRITE_BUFFER_SIZE : cvsgui_process.h
  • WriteMapFileHeaderandConvertFromDwordAlignToPacked() : dib.h, dib.c
  • WS_EX_FLATEDGE : CJCaption.h
Generated on Sun Feb 24 01:29:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Namespace Member Index

WinCvs Source Namespace Members

i

Here is a list of all namespace members with links to the namespace documentation for each member:

- i -

  • importlib() : Wincvs, CVS_COWORKERLib
Generated on Sun Feb 24 01:29:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Graphical Class Hierarchy

WinCvs Source Graphical Class Hierarchy

Go to the textual class hierarchy

Generated on Sun Feb 24 01:29:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CDummyClass Member List

This is the complete list of members for CDummyClass, including all inherited members.
CDummyClass() | CDummyClass | [inline]
CDummyClass() | CDummyClass | [inline]
Generated on Sun Feb 24 01:25:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CViewInfo Member List

This is the complete list of members for CViewInfo, including all inherited members.
view CViewInfo
Generated on Sun Feb 24 01:28:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TBuggyPopup Member List

This is the complete list of members for TBuggyPopup, including all inherited members.
DoPostCreate(TDocument *itsDocument) | TBuggyPopup | [private, virtual]
fRealWidth | TBuggyPopup | [protected]
MA_DECLARE_CLASS | TBuggyPopup | [private]
ReadFields(CStream_AC *aStream) | TBuggyPopup | [private, virtual]
TBuggyPopup() | TBuggyPopup | [private]
WriteFields(CStream_AC *aStream) const | TBuggyPopup | [private, virtual]
~TBuggyPopup() | TBuggyPopup | [private, virtual]
Generated on Sun Feb 24 01:28:03 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TPseudoScrollBar Member List

This is the complete list of members for TPseudoScrollBar, including all inherited members.
fButtonStep | TPseudoScrollBar | [private]
fPageStep | TPseudoScrollBar | [private]
MA_DECLARE_CLASS | TPseudoScrollBar | [private]
TPseudoScrollBar() | TPseudoScrollBar | [private]
TrackScrollBar(short partCode) | TPseudoScrollBar | [private, virtual]
~TPseudoScrollBar() | TPseudoScrollBar | [private, virtual]
Generated on Sun Feb 24 01:28:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TPseudoIconPopup Member List

This is the complete list of members for TPseudoIconPopup, including all inherited members.
MA_DECLARE_CLASS | TPseudoIconPopup | [private]
ReadFields(CStream_AC *aStream) | TPseudoIconPopup | [private, virtual]
TPseudoIconPopup() | TPseudoIconPopup | [private]
WriteFields(CStream_AC *aStream) const | TPseudoIconPopup | [private, virtual]
~TPseudoIconPopup() | TPseudoIconPopup | [private, virtual]
Generated on Sun Feb 24 01:28:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TPseudoIconButton Member List

This is the complete list of members for TPseudoIconButton, including all inherited members.
MA_DECLARE_CLASS | TPseudoIconButton | [private]
ReadFields(CStream_AC *aStream) | TPseudoIconButton | [private, virtual]
TPseudoIconButton() | TPseudoIconButton | [private]
WriteFields(CStream_AC *aStream) const | TPseudoIconButton | [private, virtual]
~TPseudoIconButton() | TPseudoIconButton | [private, virtual]
Generated on Sun Feb 24 01:28:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TPseudoRotateIconButton Member List

This is the complete list of members for TPseudoRotateIconButton, including all inherited members.
DoRotate(int icon) | TPseudoRotateIconButton | [private]
fCurrentIcon | TPseudoRotateIconButton | [protected]
fIconSuite | TPseudoRotateIconButton | [protected]
MA_DECLARE_CLASS | TPseudoRotateIconButton | [private]
ReadFields(CStream_AC *aStream) | TPseudoRotateIconButton | [private, virtual]
TPseudoRotateIconButton() | TPseudoRotateIconButton | [private]
WriteFields(CStream_AC *aStream) const | TPseudoRotateIconButton | [private, virtual]
~TPseudoRotateIconButton() | TPseudoRotateIconButton | [private, virtual]
Generated on Sun Feb 24 01:28:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TPseudoIconCheckBox Member List

This is the complete list of members for TPseudoIconCheckBox, including all inherited members.
MA_DECLARE_CLASS | TPseudoIconCheckBox | [private]
ReadFields(CStream_AC *aStream) | TPseudoIconCheckBox | [private, virtual]
TPseudoIconCheckBox() | TPseudoIconCheckBox | [private]
WriteFields(CStream_AC *aStream) const | TPseudoIconCheckBox | [private, virtual]
~TPseudoIconCheckBox() | TPseudoIconCheckBox | [private, virtual]
Generated on Sun Feb 24 01:28:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UMacAppMenu Member List

This is the complete list of members for UMacAppMenu, including all inherited members.
_GetBaseClass() | UMacAppMenu | [protected, static]
_messageEntries | UMacAppMenu | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUCmdTarget | UCmdTarget | [protected, static]
classUMacAppMenu | UMacAppMenu | [protected, static]
classUMenu | UMenu | [protected, static]
classUObject | UObject | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool) | UWidget | [inline, virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UMacAppMenu | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UMacAppMenu | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UMacAppMenu | [virtual]
GetThisMessageMap() | UMacAppMenu | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_overide | UWidget | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | UMacAppMenu | [protected, static]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnCommands(int cmd) | UMenu | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UMacAppMenu |
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
rtUCmdTarget(void) | UCmdTarget | [static]
rtUMacAppMenu(void) | UMacAppMenu | [static]
rtUMenu(void) | UMenu | [static]
rtUObject() | UObject | [static]
rtUWidget(void) | UWidget | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sMAMenuWidID | UMacAppMenu | [static]
sValidMenu | UWidget | [protected, static]
UCmdTarget(int widid) | UCmdTarget |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
UMacAppMenu() | UMacAppMenu |
UMenu(int widid) | UMenu |
UObject() | UObject | [inline, protected]
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UCmdTarget() | UCmdTarget | [virtual]
~UMacAppMenu() | UMacAppMenu | [virtual]
~UMenu() | UMenu | [virtual]
~UObject() | UObject | [inline, virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:26:47 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TPseudoAppBehavior Member List

This is the complete list of members for TPseudoAppBehavior, including all inherited members.
DoIdle(IdlePhase phase) | TPseudoAppBehavior | [virtual]
DoMenuCommand(CommandNumber aCommandNumber) | TPseudoAppBehavior | [virtual]
DoSetupMenus() | TPseudoAppBehavior | [virtual]
DoToolboxEvent(TToolboxEvent *event) | TPseudoAppBehavior | [virtual]
MA_DECLARE_CLASS | TPseudoAppBehavior | [private]
TPseudoAppBehavior() | TPseudoAppBehavior |
~TPseudoAppBehavior() | TPseudoAppBehavior | [virtual]
Generated on Sun Feb 24 01:28:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TPseudoWinBehavior Member List

This is the complete list of members for TPseudoWinBehavior, including all inherited members.
DoEvent(EventNumber eventNumber, TEventHandler *source, TEvent *event) | TPseudoWinBehavior | [virtual]
fWidID | TPseudoWinBehavior | [protected]
GetWidID() const | TPseudoWinBehavior | [inline]
kPseudoWinBehavior enum value | TPseudoWinBehavior |
MA_DECLARE_CLASS | TPseudoWinBehavior | [private]
SetPseudoWidget(int widid) | TPseudoWinBehavior | [inline, protected]
TPseudoWinBehavior() | TPseudoWinBehavior |
UWidget class | TPseudoWinBehavior | [friend]
~TPseudoWinBehavior() | TPseudoWinBehavior | [virtual]
Generated on Sun Feb 24 01:28:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TPseudoWinAdorner Member List

This is the complete list of members for TPseudoWinAdorner, including all inherited members.
fWidID | TPseudoWinAdorner | [protected]
kPseudoWinAdorner enum value | TPseudoWinAdorner |
MA_DECLARE_CLASS | TPseudoWinAdorner | [private]
SetPseudoWidget(int widid) | TPseudoWinAdorner | [inline, protected]
TPseudoWinAdorner() | TPseudoWinAdorner |
UWidget class | TPseudoWinAdorner | [friend]
ViewChangedFrame(TView *itsView, const CViewRect &oldFrame, const CViewRect &newFrame, bool invalidate) | TPseudoWinAdorner | [virtual]
~TPseudoWinAdorner() | TPseudoWinAdorner | [virtual]
Generated on Sun Feb 24 01:28:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TPseudoCustomView Member List

This is the complete list of members for TPseudoCustomView, including all inherited members.
Draw(const CViewRect &area) | TPseudoCustomView | [virtual]
MA_DECLARE_CLASS | TPseudoCustomView | [private]
TPseudoCustomView() | TPseudoCustomView |
~TPseudoCustomView() | TPseudoCustomView | [virtual]
Generated on Sun Feb 24 01:28:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TPseudoTextListView Member List

This is the complete list of members for TPseudoTextListView, including all inherited members.
DelItemAt(GridCoordinate anItem, GridCoordinate numOfItems) | TPseudoTextListView | [virtual]
DoKeyEvent(TToolboxEvent *event) | TPseudoTextListView | [virtual]
DoMouseCommand(CViewPoint &theMouse, TToolboxEvent *event, CPoint_AC) | TPseudoTextListView | [virtual]
DoMouseCommand_SelectCells(GridCell whichCell, class TToolboxEvent *event) | TPseudoTextListView | [protected, virtual]
fStringContainer | TPseudoTextListView | [protected]
GetItemText(GridCoordinate) const | TPseudoTextListView | [virtual]
GetStandardSignature(void) const | TPseudoTextListView | [virtual]
InsStringBefore(short anItem, const char *string) | TPseudoTextListView | [virtual]
InsStringFirst(const char *string) | TPseudoTextListView | [virtual]
InsStringLast(const char *string) | TPseudoTextListView | [virtual]
kMultiClickSelection enum value | TPseudoTextListView |
kSelectionChanged enum value | TPseudoTextListView |
kTextStringListViewSignature enum value | TPseudoTextListView |
MA_DECLARE_CLASS | TPseudoTextListView | [private]
RemoveAll(void) | TPseudoTextListView | [virtual]
SetSelection(const TGridViewDesignator *cellsToSelect, bool extendSelection, bool highlight, bool select) | TPseudoTextListView | [virtual]
TPseudoTextListView() | TPseudoTextListView |
~TPseudoTextListView() | TPseudoTextListView | [virtual]
Generated on Sun Feb 24 01:28:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TPseudoDoubleNumberText Member List

This is the complete list of members for TPseudoDoubleNumberText, including all inherited members.
fMaximum | TPseudoDoubleNumberText | [protected]
fMinimum | TPseudoDoubleNumberText | [protected]
fPrecision | TPseudoDoubleNumberText | [protected]
GetStandardSignature() const | TPseudoDoubleNumberText | [virtual]
GetValidationError() | TPseudoDoubleNumberText | [virtual]
GetValue() | TPseudoDoubleNumberText | [virtual]
kDefaultPrecision enum value | TPseudoDoubleNumberText |
kStdDoubleNumberText enum value | TPseudoDoubleNumberText |
MA_DECLARE_CLASS | TPseudoDoubleNumberText | [private]
ReadFields(CStream_AC *aStream) | TPseudoDoubleNumberText | [virtual]
SetValue(double newValue, bool redraw) | TPseudoDoubleNumberText | [virtual]
TPseudoDoubleNumberText() | TPseudoDoubleNumberText |
WriteFields(CStream_AC *aStream) const | TPseudoDoubleNumberText | [virtual]
~TPseudoDoubleNumberText() | TPseudoDoubleNumberText | [virtual]
Generated on Sun Feb 24 01:28:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CPseudoButton Member List

This is the complete list of members for CPseudoButton, including all inherited members.
CCJFlatButton() | CCJFlatButton |
CPseudoButton() | CPseudoButton |
DisableFlatLook(BOOL bDisable=FALSE) | CCJFlatButton | [virtual]
DrawButtonBitmap(CDC *pDC, UINT nState, CRect &rcItem) | CPseudoButton | [protected, virtual]
DrawButtonIcon(CDC *pDC, UINT nState, CRect &rcItem) | CCJFlatButton | [protected, virtual]
DrawButtonText(CDC *pDC, UINT nState, CRect &rcItem) | CCJFlatButton | [protected, virtual]
DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) | CPseudoButton | [virtual]
loadIcon(CString &icon, int rsrcid) | CPseudoButton | [static]
LoadXPM(int rsrcid) | CPseudoButton | [virtual]
m_bAltColor | CCJFlatButton | [protected]
m_bFlatLook | CCJFlatButton | [protected]
m_bitmap | CPseudoButton | [protected]
m_bLBtnDown | CCJFlatButton | [protected]
m_bMouseOver | CCJFlatButton | [protected]
m_bPainted | CCJFlatButton | [protected]
m_clrAltHilite | CCJFlatButton | [protected]
m_clrAltNormal | CCJFlatButton | [protected]
m_clrAltShadow | CCJFlatButton | [protected]
m_clrAltTextNm | CCJFlatButton | [protected]
m_clrDkShad | CCJFlatButton | [protected]
m_clrHilite | CCJFlatButton | [protected]
m_clrNormal | CCJFlatButton | [protected]
m_clrShadow | CCJFlatButton | [protected]
m_clrTextGy | CCJFlatButton | [protected]
m_clrTextNm | CCJFlatButton | [protected]
m_disbitmap | CPseudoButton | [protected]
m_Font | CCJFlatButton | [protected]
m_hCursor | CCJFlatButton | [protected]
m_hPushed | CCJFlatButton | [protected]
m_pFont | CCJFlatButton | [protected]
m_sizeIcon | CCJFlatButton | [protected]
OnEraseBkgnd(CDC *pDC) | CCJFlatButton | [protected]
OnLButtonDblClk(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnLButtonDown(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnLButtonUp(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnMouseMove(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnPaint() | CCJFlatButton | [protected]
OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) | CCJFlatButton | [protected]
OnSysColorChange() | CCJFlatButton | [protected]
OnTimer(UINT nIDEvent) | CCJFlatButton | [protected]
SetAlternateColors(COLORREF clrAltNormal, COLORREF clrAltHilite, COLORREF clrAltShadow, COLORREF clrAltTextNm) | CCJFlatButton | [virtual]
SetButtonFont(CFont *pFont) | CCJFlatButton | [virtual]
SetIcon(HICON hIcon, CSize size) | CCJFlatButton | [virtual]
SetIcon(HICON hIcon, HICON hPushed, CSize size) | CCJFlatButton | [virtual]
UpdateFont() | CCJFlatButton | [protected, virtual]
~CCJFlatButton() | CCJFlatButton | [virtual]
~CPseudoButton() | CPseudoButton | [virtual]
Generated on Sun Feb 24 01:27:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CPseudoRotButton Member List

This is the complete list of members for CPseudoRotButton, including all inherited members.
CCJFlatButton() | CCJFlatButton |
CPseudoButton() | CPseudoButton |
CPseudoRotButton() | CPseudoRotButton |
DisableFlatLook(BOOL bDisable=FALSE) | CCJFlatButton | [virtual]
DoRotate(int index) | CPseudoRotButton | [virtual]
DrawButtonBitmap(CDC *pDC, UINT nState, CRect &rcItem) | CPseudoButton | [protected, virtual]
DrawButtonIcon(CDC *pDC, UINT nState, CRect &rcItem) | CCJFlatButton | [protected, virtual]
DrawButtonText(CDC *pDC, UINT nState, CRect &rcItem) | CCJFlatButton | [protected, virtual]
DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) | CPseudoButton | [virtual]
GetCurrent(void) const | CPseudoRotButton | [inline]
loadIcon(CString &icon, int rsrcid) | CPseudoButton | [static]
LoadXPM(int rsrcid) | CPseudoButton | [virtual]
LoadXPMs(const int *rsrcid, int numrsrc) | CPseudoRotButton | [virtual]
m_bAltColor | CCJFlatButton | [protected]
m_bFlatLook | CCJFlatButton | [protected]
m_bitmap | CPseudoButton | [protected]
m_bitmaps | CPseudoRotButton | [protected]
m_bLBtnDown | CCJFlatButton | [protected]
m_bMouseOver | CCJFlatButton | [protected]
m_bPainted | CCJFlatButton | [protected]
m_clrAltHilite | CCJFlatButton | [protected]
m_clrAltNormal | CCJFlatButton | [protected]
m_clrAltShadow | CCJFlatButton | [protected]
m_clrAltTextNm | CCJFlatButton | [protected]
m_clrDkShad | CCJFlatButton | [protected]
m_clrHilite | CCJFlatButton | [protected]
m_clrNormal | CCJFlatButton | [protected]
m_clrShadow | CCJFlatButton | [protected]
m_clrTextGy | CCJFlatButton | [protected]
m_clrTextNm | CCJFlatButton | [protected]
m_curindex | CPseudoRotButton | [protected]
m_disbitmap | CPseudoButton | [protected]
m_disbitmaps | CPseudoRotButton | [protected]
m_Font | CCJFlatButton | [protected]
m_hCursor | CCJFlatButton | [protected]
m_hPushed | CCJFlatButton | [protected]
m_pFont | CCJFlatButton | [protected]
m_sizeIcon | CCJFlatButton | [protected]
OnEraseBkgnd(CDC *pDC) | CCJFlatButton | [protected]
OnLButtonDblClk(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnLButtonDown(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnLButtonUp(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnMouseMove(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnPaint() | CCJFlatButton | [protected]
OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) | CCJFlatButton | [protected]
OnSysColorChange() | CCJFlatButton | [protected]
OnTimer(UINT nIDEvent) | CCJFlatButton | [protected]
SetAlternateColors(COLORREF clrAltNormal, COLORREF clrAltHilite, COLORREF clrAltShadow, COLORREF clrAltTextNm) | CCJFlatButton | [virtual]
SetButtonFont(CFont *pFont) | CCJFlatButton | [virtual]
SetIcon(HICON hIcon, CSize size) | CCJFlatButton | [virtual]
SetIcon(HICON hIcon, HICON hPushed, CSize size) | CCJFlatButton | [virtual]
UpdateFont() | CCJFlatButton | [protected, virtual]
~CCJFlatButton() | CCJFlatButton | [virtual]
~CPseudoButton() | CPseudoButton | [virtual]
~CPseudoRotButton() | CPseudoRotButton | [virtual]
Generated on Sun Feb 24 01:27:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CPseudoToggle Member List

This is the complete list of members for CPseudoToggle, including all inherited members.
CCJFlatButton() | CCJFlatButton |
CPseudoButton() | CPseudoButton |
CPseudoToggle() | CPseudoToggle |
DisableFlatLook(BOOL bDisable=FALSE) | CCJFlatButton | [virtual]
DrawButtonBitmap(CDC *pDC, UINT nState, CRect &rcItem) | CPseudoButton | [protected, virtual]
DrawButtonIcon(CDC *pDC, UINT nState, CRect &rcItem) | CCJFlatButton | [protected, virtual]
DrawButtonText(CDC *pDC, UINT nState, CRect &rcItem) | CCJFlatButton | [protected, virtual]
DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) | CPseudoToggle | [virtual]
GetGroup(void) const | CPseudoToggle | [inline]
GetState(void) const | CPseudoToggle | [inline]
IsRadio(void) const | CPseudoToggle | [inline]
loadIcon(CString &icon, int rsrcid) | CPseudoButton | [static]
LoadXPM(int rsrcid) | CPseudoButton | [virtual]
m_bAltColor | CCJFlatButton | [protected]
m_bFlatLook | CCJFlatButton | [protected]
m_bitmap | CPseudoButton | [protected]
m_bLBtnDown | CCJFlatButton | [protected]
m_bMouseOver | CCJFlatButton | [protected]
m_bPainted | CCJFlatButton | [protected]
m_clrAltHilite | CCJFlatButton | [protected]
m_clrAltNormal | CCJFlatButton | [protected]
m_clrAltShadow | CCJFlatButton | [protected]
m_clrAltTextNm | CCJFlatButton | [protected]
m_clrDkShad | CCJFlatButton | [protected]
m_clrHilite | CCJFlatButton | [protected]
m_clrNormal | CCJFlatButton | [protected]
m_clrShadow | CCJFlatButton | [protected]
m_clrTextGy | CCJFlatButton | [protected]
m_clrTextNm | CCJFlatButton | [protected]
m_disbitmap | CPseudoButton | [protected]
m_flag | CPseudoToggle | [protected]
m_Font | CCJFlatButton | [protected]
m_group | CPseudoToggle | [protected]
m_hCursor | CCJFlatButton | [protected]
m_hPushed | CCJFlatButton | [protected]
m_pFont | CCJFlatButton | [protected]
m_radio | CPseudoToggle | [protected]
m_sizeIcon | CCJFlatButton | [protected]
OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) | CPseudoToggle |
OnEraseBkgnd(CDC *pDC) | CCJFlatButton | [protected]
OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) | CPseudoToggle |
OnLButtonDblClk(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnLButtonDown(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnLButtonUp(UINT nFlags, CPoint point) | CPseudoToggle |
OnMouseMove(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnPaint() | CCJFlatButton | [protected]
OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) | CCJFlatButton | [protected]
OnSysColorChange() | CCJFlatButton | [protected]
OnTimer(UINT nIDEvent) | CCJFlatButton | [protected]
SetAlternateColors(COLORREF clrAltNormal, COLORREF clrAltHilite, COLORREF clrAltShadow, COLORREF clrAltTextNm) | CCJFlatButton | [virtual]
SetButtonFont(CFont *pFont) | CCJFlatButton | [virtual]
SetGroup(const char *group) | CPseudoToggle | [inline]
SetIcon(HICON hIcon, CSize size) | CCJFlatButton | [virtual]
SetIcon(HICON hIcon, HICON hPushed, CSize size) | CCJFlatButton | [virtual]
SetRadio(bool state) | CPseudoToggle | [inline]
SetState(int state) | CPseudoToggle | [virtual]
ToggleBtn() | CPseudoToggle | [inline]
UpdateFont() | CCJFlatButton | [protected, virtual]
~CCJFlatButton() | CCJFlatButton | [virtual]
~CPseudoButton() | CPseudoButton | [virtual]
~CPseudoToggle() | CPseudoToggle |
Generated on Sun Feb 24 01:27:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CPseudoDlg Member List

This is the complete list of members for CPseudoDlg, including all inherited members.
CPseudoDlg(int dlgid, UWidget *pseudo, CWnd *pParent=NULL) | CPseudoDlg |
DoDataExchange(CDataExchange *pDX) | CPseudoDlg | [protected, virtual]
m_pseudo | CPseudoDlg | [protected]
OnInitDialog() | CPseudoDlg | [protected, virtual]
WindowProc(UINT message, WPARAM wParam, LPARAM lParam) | CPseudoDlg | [protected, virtual]
~CPseudoDlg() | CPseudoDlg | [virtual]
Generated on Sun Feb 24 01:27:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CPseudoDraw Member List

This is the complete list of members for CPseudoDraw, including all inherited members.
CPseudoDraw(UWidget *pseudo, int cmdid) | CPseudoDraw |
m_cmdid | CPseudoDraw |
m_pseudo | CPseudoDraw |
OnPaint() | CPseudoDraw | [protected]
~CPseudoDraw() | CPseudoDraw | [virtual]
Generated on Sun Feb 24 01:27:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CPseudoList Member List

This is the complete list of members for CPseudoList, including all inherited members.
CPseudoList(int wid, int cmd) | CPseudoList |
m_cmd | CPseudoList | [protected]
m_wid | CPseudoList | [protected]
OnLButtonDblClk(UINT nFlags, CPoint point) | CPseudoList | [protected]
~CPseudoList() | CPseudoList | [virtual]
Generated on Sun Feb 24 01:27:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UPPMenu Member List

This is the complete list of members for UPPMenu, including all inherited members.
_GetBaseClass() | UMenu | [protected, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUCmdTarget | UCmdTarget | [protected, static]
classUMenu | UMenu | [protected, static]
classUObject | UObject | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool) | UWidget | [inline, virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UMenu | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UMenu | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UMenu | [virtual]
GetThisMessageMap() | UMenu | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_overide | UWidget | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | UMenu | [protected, static]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnCommands(int cmd) | UMenu | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UMenu | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
rtUCmdTarget(void) | UCmdTarget | [static]
rtUMenu(void) | UMenu | [static]
rtUObject() | UObject | [static]
rtUWidget(void) | UWidget | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sPPMenuWidID | UPPMenu | [static]
sValidMenu | UWidget | [protected, static]
UCmdTarget(int widid) | UCmdTarget |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
UMenu(int widid) | UMenu |
UObject() | UObject | [inline, protected]
UPPMenu() | UPPMenu |
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UCmdTarget() | UCmdTarget | [virtual]
~UMenu() | UMenu | [virtual]
~UObject() | UObject | [inline, virtual]
~UPPMenu() | UPPMenu | [virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:27:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

LPseudoDrawAttachment Member List

This is the complete list of members for LPseudoDrawAttachment, including all inherited members.
ExecuteSelf(MessageT inMessage, void *ioParam) | LPseudoDrawAttachment | [protected, virtual]
LPseudoDrawAttachment(int widid, int cmdid) | LPseudoDrawAttachment |
m_cmdid | LPseudoDrawAttachment | [protected]
m_widid | LPseudoDrawAttachment | [protected]
~LPseudoDrawAttachment() | LPseudoDrawAttachment | [virtual]
Generated on Sun Feb 24 01:26:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UPseudoCmdStatusWrapper Member List

This is the complete list of members for UPseudoCmdStatusWrapper, including all inherited members.
outEnabled | UPseudoCmdStatusWrapper
outMark | UPseudoCmdStatusWrapper
outName | UPseudoCmdStatusWrapper
outUsesMark | UPseudoCmdStatusWrapper
Generated on Sun Feb 24 01:27:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UPseudoRotButton Member List

This is the complete list of members for UPseudoRotButton, including all inherited members.
class_ID enum value | UPseudoRotButton |
DoRotate(int icon, bool refresh=true) | UPseudoRotButton | [virtual]
fCurrentIcon | UPseudoRotButton | [protected]
fIconSuite | UPseudoRotButton | [protected]
GetCurrentState(void) const | UPseudoRotButton | [inline]
ReadIconsID(LStream *inStream, std::vector< short > &res) | UPseudoRotButton | [protected]
UPseudoRotButton(LStream *inStream, ClassIDT inImpID=LBevelButton::imp_class_ID) | UPseudoRotButton |
~UPseudoRotButton() | UPseudoRotButton | [virtual]
Generated on Sun Feb 24 01:27:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UPseudoPlaceHolder Member List

This is the complete list of members for UPseudoPlaceHolder, including all inherited members.
class_ID enum value | UPseudoPlaceHolder |
DoRotate(int entry) | UPseudoPlaceHolder |
fController | UPseudoPlaceHolder | [protected]
fCurrentView | UPseudoPlaceHolder | [protected]
FinishCreateSelf() | UPseudoPlaceHolder | [protected, virtual]
fViewSuite | UPseudoPlaceHolder | [protected]
fWidid | UPseudoPlaceHolder | [protected]
GetCurrentView(void) | UPseudoPlaceHolder | [inline]
ListenToMessage(MessageT inMessage, void *ioParam) | UPseudoPlaceHolder | [virtual]
SetWidID(int widid) | UPseudoPlaceHolder | [inline]
UPseudoPlaceHolder(LStream *inStream) | UPseudoPlaceHolder |
~UPseudoPlaceHolder() | UPseudoPlaceHolder | [virtual]
Generated on Sun Feb 24 01:27:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UPseudoPageHider Member List

This is the complete list of members for UPseudoPageHider, including all inherited members.
class_ID enum value | UPseudoPageHider |
DoRotate(int entry) | UPseudoPageHider | [protected]
ExecuteSelf(MessageT inMessage, void *ioParam) | UPseudoPageHider | [protected, virtual]
fCurSel | UPseudoPageHider | [protected]
fPageCtrl | UPseudoPageHider | [protected]
fViewSuite | UPseudoPageHider | [protected]
fWidid | UPseudoPageHider | [protected]
ListenToMessage(MessageT inMessage, void *ioParam) | UPseudoPageHider | [virtual]
SetWidID(int widid) | UPseudoPageHider | [inline]
UPseudoPageHider(LStream *inStream) | UPseudoPageHider |
~UPseudoPageHider() | UPseudoPageHider | [virtual]
Generated on Sun Feb 24 01:27:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

LMainPseudoAttachment Member List

This is the complete list of members for LMainPseudoAttachment, including all inherited members.
ExecuteSelf(MessageT inMessage, void *ioParam) | LMainPseudoAttachment | [protected, virtual]
LMainPseudoAttachment() | LMainPseudoAttachment |
SpendTime(const EventRecord &inMacEvent) | LMainPseudoAttachment | [virtual]
~LMainPseudoAttachment() | LMainPseudoAttachment | [virtual]
Generated on Sun Feb 24 01:26:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

LPseudoWinAttachment Member List

This is the complete list of members for LPseudoWinAttachment, including all inherited members.
CheckWindowSize(void) | LPseudoWinAttachment |
ExecuteSelf(MessageT inMessage, void *ioParam) | LPseudoWinAttachment | [protected, virtual]
GetPageValue(int cmdid) const | LPseudoWinAttachment |
InvalidCache(UWidget *tab_wid) | LPseudoWinAttachment |
ListenToMessage(MessageT inMessage, void *ioParam) | LPseudoWinAttachment | [protected, virtual]
LPseudoWinAttachment(int widid) | LPseudoWinAttachment |
m_CacheWidgets | LPseudoWinAttachment | [protected]
m_lastRect | LPseudoWinAttachment | [protected]
m_PageValues | LPseudoWinAttachment | [protected]
m_widid | LPseudoWinAttachment | [protected]
SearchWidID(LPane *pane) | LPseudoWinAttachment |
SetPageValue(int cmdid, int value) | LPseudoWinAttachment |
~LPseudoWinAttachment() | LPseudoWinAttachment | [virtual]
Generated on Sun Feb 24 01:26:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UPseudoFakePane Member List

This is the complete list of members for UPseudoFakePane, including all inherited members.
ActivateSelf() | UPseudoFakePane | [protected, virtual]
AdaptToSuperFrameSize(SInt32 inSurrWidthDelta, SInt32 inSurrHeightDelta, Boolean inRefresh) | UPseudoFakePane | [virtual]
DeactivateSelf() | UPseudoFakePane | [protected, virtual]
m_Attach | UPseudoFakePane | [protected]
UPseudoFakePane(const SPaneInfo &inPaneInfo, LPseudoWinAttachment *inAttach) | UPseudoFakePane |
~UPseudoFakePane() | UPseudoFakePane | [virtual]
Generated on Sun Feb 24 01:27:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CPseudoItem Member List

This is the complete list of members for CPseudoItem, including all inherited members.
CPseudoItem(int widid, int cmdid) | CPseudoItem |
CPseudoItem() | CPseudoItem | [private]
CPseudoItem(const CPseudoItem &inOriginal) | CPseudoItem | [private]
DoubleClick(const STableCell &inCell, const SMouseDownEvent &inMouseDown, const SOutlineDrawContents &inDrawContents, Boolean inHitText) | CPseudoItem | [protected, virtual]
DrawCell(const STableCell &inCell, const Rect &inLocalCellRect) | CPseudoItem | [protected, virtual]
DrawRowAdornments(const Rect &inLocalRowRect) | CPseudoItem | [protected, virtual]
GetDrawContentsSelf(const STableCell &inCell, SOutlineDrawContents &ioDrawContents) | CPseudoItem | [protected, virtual]
m_cmdid | CPseudoItem | [protected]
m_data | CPseudoItem |
m_texts | CPseudoItem |
m_widid | CPseudoItem | [protected]
operator=(const CPseudoItem &inOriginal) | CPseudoItem | [private]
SingleClick(const STableCell &inCell, const SMouseDownEvent &inMouseDown, const SOutlineDrawContents &inDrawContents, Boolean inHitText) | CPseudoItem | [protected, virtual]
~CPseudoItem() | CPseudoItem | [virtual]
Generated on Sun Feb 24 01:27:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

USize Member List

This is the complete list of members for USize, including all inherited members.
cx | USIZE |
cy | USIZE |
operator!=(USIZE size) const | USize | [inline]
operator+(USIZE size) const | USize | [inline]
operator+(UPOINT point) const | USize | [inline]
operator+(const URECT *lpRect) const | USize | [inline]
operator+=(USIZE size) | USize | [inline]
operator-(USIZE size) const | USize | [inline]
operator-() const | USize | [inline]
operator-(UPOINT point) const | USize | [inline]
operator-(const URECT *lpRect) const | USize | [inline]
operator-=(USIZE size) | USize | [inline]
operator==(USIZE size) const | USize | [inline]
USize() | USize | [inline]
USize(int initCX, int initCY) | USize | [inline]
USize(USIZE initSize) | USize | [inline]
USize(UPOINT initPt) | USize | [inline]
Generated on Sun Feb 24 01:27:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UPoint Member List

This is the complete list of members for UPoint, including all inherited members.
Offset(int xOffset, int yOffset) | UPoint | [inline]
Offset(UPOINT point) | UPoint | [inline]
Offset(USIZE size) | UPoint | [inline]
operator!=(UPOINT point) const | UPoint | [inline]
operator+(USIZE size) const | UPoint | [inline]
operator+(UPOINT point) const | UPoint | [inline]
operator+(const URECT *lpRect) const | UPoint | [inline]
operator+=(USIZE size) | UPoint | [inline]
operator+=(UPOINT point) | UPoint | [inline]
operator-(USIZE size) const | UPoint | [inline]
operator-() const | UPoint | [inline]
operator-(UPOINT point) const | UPoint | [inline]
operator-(const URECT *lpRect) const | UPoint | [inline]
operator-=(USIZE size) | UPoint | [inline]
operator-=(UPOINT point) | UPoint | [inline]
operator==(UPOINT point) const | UPoint | [inline]
UPoint() | UPoint | [inline]
UPoint(int initX, int initY) | UPoint | [inline]
UPoint(UPOINT initPt) | UPoint | [inline]
UPoint(USIZE initSize) | UPoint | [inline]
x | UPOINT |
y | UPOINT |
Generated on Sun Feb 24 01:27:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

URect Member List

This is the complete list of members for URect, including all inherited members.
bottom | URECT |
BottomRight() | URect | [inline]
BottomRight() const | URect | [inline]
CenterPoint() const | URect | [inline]
CopyRect(const URECT *lpSrURect) | URect | [inline]
DeflateRect(int x, int y) | URect | [inline]
DeflateRect(USIZE size) | URect | [inline]
DeflateRect(const URECT *lpRect) | URect |
DeflateRect(int l, int t, int r, int b) | URect |
EqualRect(const URECT *lpRect) const | URect | [inline]
Height() const | URect | [inline]
InflateRect(int x, int y) | URect | [inline]
InflateRect(USIZE size) | URect | [inline]
InflateRect(const URECT *lpRect) | URect |
InflateRect(int l, int t, int r, int b) | URect |
IntersectRect(const URECT *lpRect1, const URECT *lpRect2) | URect | [inline]
IsRectEmpty() const | URect | [inline]
IsRectNull() const | URect | [inline]
left | URECT |
MulDiv(int nMultiplier, int nDivisor) const | URect |
NormalizeRect() | URect |
OffsetRect(int x, int y) | URect | [inline]
OffsetRect(USIZE size) | URect | [inline]
OffsetRect(UPOINT point) | URect | [inline]
operator &(const URECT &rect2) const | URect | [inline]
operator &=(const URECT &rect) | URect | [inline]
operator const URECT *() const | URect | [inline]
operator CRect() const | URect | [inline]
operator URECT *() | URect | [inline]
operator!=(const URECT &rect) const | URect | [inline]
operator+(UPOINT point) const | URect | [inline]
operator+(const URECT *lpRect) const | URect | [inline]
operator+(USIZE size) const | URect | [inline]
operator+=(UPOINT point) | URect | [inline]
operator+=(USIZE size) | URect | [inline]
operator+=(const URECT *lpRect) | URect | [inline]
operator-(UPOINT point) const | URect | [inline]
operator-(USIZE size) const | URect | [inline]
operator-(const URECT *lpRect) const | URect | [inline]
operator-=(UPOINT point) | URect | [inline]
operator-=(USIZE size) | URect | [inline]
operator-=(const URECT *lpRect) | URect | [inline]
operator=(const URECT &srURect) | URect | [inline]
operator==(const URECT &rect) const | URect | [inline]
operator|(const URECT &rect2) const | URect | [inline]
operator|=(const URECT &rect) | URect | [inline]
PtInRect(UPOINT point) const | URect | [inline]
right | URECT |
SetRect(int x1, int y1, int x2, int y2) | URect | [inline]
SetRect(UPOINT topLeft, UPOINT bottomRight) | URect | [inline]
SetRectEmpty() | URect | [inline]
Size() const | URect | [inline]
top | URECT |
TopLeft() | URect | [inline]
TopLeft() const | URect | [inline]
UnionRect(const URECT *lpRect1, const URECT *lpRect2) | URect | [inline]
URect() | URect | [inline]
URect(int l, int t, int r, int b) | URect | [inline]
URect(const URECT &srURect) | URect | [inline]
URect(const URECT *lpSrURect) | URect | [inline]
URect(UPOINT point, USIZE size) | URect | [inline]
URect(UPOINT topLeft, UPOINT bottomRight) | URect | [inline]
URect(const CRect &winRect) | URect | [inline]
Width() const | URect | [inline]
Generated on Sun Feb 24 01:27:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UPen Member List

This is the complete list of members for UPen, including all inherited members.
CreatePen(int nPenStyle, int nWidth, UCOLORREF crColor) | UPen |
DeleteObject(void) | UPen |
m_style | UPen | [protected]
m_width | UPen | [protected]
UDC class | UPen | [friend]
UPen() | UPen |
~UPen() | UPen |
Generated on Sun Feb 24 01:27:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UBrush Member List

This is the complete list of members for UBrush, including all inherited members.
CreateSolidBrush(UCOLORREF crColor) | UBrush |
DeleteObject(void) | UBrush |
UBrush() | UBrush |
UDC class | UBrush | [friend]
~UBrush() | UBrush |
Generated on Sun Feb 24 01:24:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UDC Member List

This is the complete list of members for UDC, including all inherited members.
DrawBitmap(void *bitmap, UPOINT where) | UDC |
GetTextExtent(const char *lpszString, int nCount) const | UDC |
GetTextHeight(void) const | UDC |
LineTo(int x, int y) | UDC |
m_brush | UDC | [protected]
m_pen | UDC | [protected]
m_wid | UDC | [protected]
MoveTo(int x, int y) | UDC |
Rectangle(const URECT *lpRect) | UDC |
RoundRect(const URECT *lpRect, UPOINT point) | UDC |
SelectObject(UPen *pPen) | UDC |
SelectObject(UBrush *pBrush) | UDC |
TextOutClipped(int x, int y, const URECT *lpRect, const char *lpszString, int nCount) | UDC |
UDC(int widid, int cmdid) | UDC |
~UDC() | UDC |
Generated on Sun Feb 24 01:25:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CAllTargets Member List

This is the complete list of members for CAllTargets, including all inherited members.
CAllTargets() | CAllTargets | [inline]
Get(void) | CAllTargets | [inline]
Get(void) const | CAllTargets | [inline]
targets | CAllTargets | [protected]
~CAllTargets() | CAllTargets | [inline]
Generated on Sun Feb 24 01:24:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CTurnOffDispatching Member List

This is the complete list of members for CTurnOffDispatching, including all inherited members.
CTurnOffDispatching() | CTurnOffDispatching | [inline]
m_didSetIt | CTurnOffDispatching | [protected]
~CTurnOffDispatching() | CTurnOffDispatching | [inline]
Generated on Sun Feb 24 01:28:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CMsg Member List

This is the complete list of members for CMsg, including all inherited members.
CMsg(int wid, int ev, int arg1, void *arg2) | CMsg | [inline]
CMsg() | CMsg | [inline]
CMsg(const CMsg &msg) | CMsg | [inline]
m_arg1 | CMsg |
m_arg2 | CMsg |
m_ev | CMsg |
m_wid | CMsg |
operator=(const CMsg &msg) | CMsg | [inline]
Generated on Sun Feb 24 01:26:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UMessageMapFunctions Member List

This is the complete list of members for UMessageMapFunctions, including all inherited members.
pfn | UMessageMapFunctions
pfni_i | UMessageMapFunctions
pfni_ii | UMessageMapFunctions
pfni_iVP | UMessageMapFunctions
pfni_V | UMessageMapFunctions
pfni_VP | UMessageMapFunctions
pfnV_i | UMessageMapFunctions
pfnV_ii | UMessageMapFunctions
pfnV_iii | UMessageMapFunctions
pfnV_iiVP | UMessageMapFunctions
pfnV_iVP | UMessageMapFunctions
pfnV_V | UMessageMapFunctions
pfnV_VP | UMessageMapFunctions
Generated on Sun Feb 24 01:26:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UMSGMAP_ENTRY Member List

This is the complete list of members for UMSGMAP_ENTRY, including all inherited members.
ext | UMSGMAP_ENTRY
ext1 | UMSGMAP_ENTRY
ext2 | UMSGMAP_ENTRY
nMessage | UMSGMAP_ENTRY
nSig | UMSGMAP_ENTRY
pfn | UMSGMAP_ENTRY
Generated on Sun Feb 24 01:26:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UMSGMAP Member List

This is the complete list of members for UMSGMAP, including all inherited members.
lpEntries | UMSGMAP
pBaseMap | UMSGMAP
Generated on Sun Feb 24 01:26:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UCmdTarget Member List

This is the complete list of members for UCmdTarget, including all inherited members.
_GetBaseClass() | UCmdTarget | [protected, static]
_messageEntries | UCmdTarget | [private, static]
classUCmdTarget | UCmdTarget | [protected, static]
classUObject | UObject | [protected, static]
CreateObject(const char *className) | UObject | [static]
GetBaseMessageMap() | UCmdTarget | [protected, static]
GetMessageMap() const | UCmdTarget | [protected, virtual]
GetRuntimeClass() const | UCmdTarget | [virtual]
GetThisMessageMap() | UCmdTarget | [protected, static]
GetWidID(void) const | UCmdTarget | [inline]
IsKindOf(const URuntimeClass *pClass) const | UObject |
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_widid | UCmdTarget | [private]
messageMap | UCmdTarget | [protected, static]
rtUCmdTarget(void) | UCmdTarget | [static]
rtUObject() | UObject | [static]
UCmdTarget(int widid) | UCmdTarget |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UCmdTarget | [virtual]
UObject() | UObject | [inline, protected]
~UCmdTarget() | UCmdTarget | [virtual]
~UObject() | UObject | [inline, virtual]
Generated on Sun Feb 24 01:25:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UCmdUI Member List

This is the complete list of members for UCmdUI, including all inherited members.
CanContinue(void) | UCmdUI | [inline]
Check(bool bOn=true) | UCmdUI | [virtual]
Enable(bool bOn=true) | UCmdUI | [virtual]
m_continue | UCmdUI |
m_nID | UCmdUI |
m_widget | UCmdUI |
pCmdUI | UCmdUI |
pNMHDR | UCmdUI |
SetContinue(bool state) | UCmdUI | [inline]
SetText(const char *title) | UCmdUI | [virtual]
SetTooltip(const char *tooltip) | UCmdUI | [virtual]
UCmdUI(int id) | UCmdUI | [inline]
~UCmdUI() | UCmdUI | [inline, virtual]
Generated on Sun Feb 24 01:25:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

USemaphore Member List

This is the complete list of members for USemaphore, including all inherited members.
IsEnteredTwice() const | USemaphore | [inline]
m_didSetSemaphore | USemaphore | [protected]
m_enteredTwice | USemaphore | [protected]
m_semaphore | USemaphore | [protected]
USemaphore(bool &semaphore) | USemaphore | [inline]
~USemaphore() | USemaphore | [inline]
Generated on Sun Feb 24 01:27:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UTB_INIT Member List

This is the complete list of members for UTB_INIT, including all inherited members.
heightbtn | UTB_INIT
title | UTB_INIT
widthbtn | UTB_INIT
winid | UTB_INIT
Generated on Sun Feb 24 01:27:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UTB_BUTTON Member List

This is the complete list of members for UTB_BUTTON, including all inherited members.
cmd | UTB_BUTTON
drop | UTB_BUTTON
icon | UTB_BUTTON
tooltip | UTB_BUTTON
varcode | UTB_BUTTON
Generated on Sun Feb 24 01:27:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UTB_DROPDOWN Member List

This is the complete list of members for UTB_DROPDOWN, including all inherited members.
btns | UTB_DROPDOWN
initialcmd | UTB_DROPDOWN
Generated on Sun Feb 24 01:27:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

USLIDER Member List

This is the complete list of members for USLIDER, including all inherited members.
inc | USLIDER
max | USLIDER
min | USLIDER
pos | USLIDER
Generated on Sun Feb 24 01:27:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

USIZE Member List

This is the complete list of members for USIZE, including all inherited members.
cx | USIZE
cy | USIZE
Generated on Sun Feb 24 01:27:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UPOINT Member List

This is the complete list of members for UPOINT, including all inherited members.
x | UPOINT
y | UPOINT
Generated on Sun Feb 24 01:27:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

URECT Member List

This is the complete list of members for URECT, including all inherited members.
bottom | URECT
left | URECT
right | URECT
top | URECT
Generated on Sun Feb 24 01:27:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UTREE_INSERT Member List

This is the complete list of members for UTREE_INSERT, including all inherited members.
data | UTREE_INSERT
icon | UTREE_INSERT
parent | UTREE_INSERT
result | UTREE_INSERT
title | UTREE_INSERT
Generated on Sun Feb 24 01:28:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UTREE_INFO Member List

This is the complete list of members for UTREE_INFO, including all inherited members.
child | UTREE_INFO
data | UTREE_INFO
expanded | UTREE_INFO
icon | UTREE_INFO
item | UTREE_INFO
next | UTREE_INFO
parent | UTREE_INFO
title | UTREE_INFO
Generated on Sun Feb 24 01:28:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

ULIST_INSERT Member List

This is the complete list of members for ULIST_INSERT, including all inherited members.
col | ULIST_INSERT
icon | ULIST_INSERT
row | ULIST_INSERT
title | ULIST_INSERT
Generated on Sun Feb 24 01:26:40 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

ULIST_INFO Member List

This is the complete list of members for ULIST_INFO, including all inherited members.
col | ULIST_INFO
data | ULIST_INFO
row | ULIST_INFO
title | ULIST_INFO
Generated on Sun Feb 24 01:26:40 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UMenu Member List

This is the complete list of members for UMenu, including all inherited members.
_GetBaseClass() | UMenu | [protected, static]
_messageEntries | UMenu | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUCmdTarget | UCmdTarget | [protected, static]
classUMenu | UMenu | [protected, static]
classUObject | UObject | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool) | UWidget | [inline, virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UMenu | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UMenu | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UMenu | [virtual]
GetThisMessageMap() | UMenu | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_overide | UWidget | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | UMenu | [protected, static]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnCommands(int cmd) | UMenu | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UMenu | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
rtUCmdTarget(void) | UCmdTarget | [static]
rtUMenu(void) | UMenu | [static]
rtUObject() | UObject | [static]
rtUWidget(void) | UWidget | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sValidMenu | UWidget | [protected, static]
UCmdTarget(int widid) | UCmdTarget |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
UMenu(int widid) | UMenu |
UObject() | UObject | [inline, protected]
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UCmdTarget() | UCmdTarget | [virtual]
~UMenu() | UMenu | [virtual]
~UObject() | UObject | [inline, virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:26:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

URuntimeClass Member List

This is the complete list of members for URuntimeClass, including all inherited members.
CreateObject() | URuntimeClass |
IsDerivedFrom(const URuntimeClass *pBaseClass) const | URuntimeClass |
m_lpszClassName | URuntimeClass |
m_nObjectSize | URuntimeClass |
m_pfnCreateObject | URuntimeClass |
m_pfnGetBaseClass | URuntimeClass |
m_pNextClass | URuntimeClass |
sAllURuntimeClass | URuntimeClass | [static]
URuntimeClass(const char *lpszClassName, int nObjectSize, UObject *(*pfnCreateObject)(), const URuntimeClass *(*pfnGetBaseClass)()) | URuntimeClass |
~URuntimeClass() | URuntimeClass |
Generated on Sun Feb 24 01:27:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UObject Member List

This is the complete list of members for UObject, including all inherited members.
_GetBaseClass() | UObject | [static]
classUObject | UObject | [protected, static]
CreateObject(const char *className) | UObject | [static]
GetRuntimeClass() const | UObject | [virtual]
IsKindOf(const URuntimeClass *pClass) const | UObject |
rtUObject() | UObject | [static]
UObject() | UObject | [inline, protected]
~UObject() | UObject | [inline, virtual]
Generated on Sun Feb 24 01:27:03 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UPStr Member List

This is the complete list of members for UPStr, including all inherited members.
c_str() const | UPStr | [inline]
empty(void) const | UPStr | [inline]
endsWith(char c) const | UPStr | [inline]
flush(void) | UPStr | [protected]
length(void) const | UPStr | [inline]
operator char *() | UPStr | [inline]
operator const char *() const | UPStr | [inline]
operator const unsigned char *() const | UPStr | [inline]
operator unsigned char *() | UPStr | [inline]
operator<<(const char *addToStr) | UPStr |
operator<<(char addToStr) | UPStr |
operator<<(int addToStr) | UPStr |
operator=(const char *newstr) | UPStr |
operator=(const unsigned char *newstr) | UPStr |
operator=(const UPStr &newstr) | UPStr |
p_str() const | UPStr | [inline]
replace(char which, char bywhich) | UPStr |
set(const char *buf, unsigned int len) | UPStr |
str | UPStr | [protected]
UPStr() | UPStr | [inline]
UPStr(const char *newstr) | UPStr | [inline]
UPStr(const unsigned char *newstr) | UPStr | [inline]
UPStr(const UPStr &newstr) | UPStr | [inline]
~UPStr() | UPStr | [inline, virtual]
Generated on Sun Feb 24 01:27:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UStr Member List

This is the complete list of members for UStr, including all inherited members.
c_str() const | UStr | [inline]
compare(const char *thestr) const | UStr | [inline]
empty(void) const | UStr | [inline]
endsWith(char c) const | UStr | [inline]
flush(void) | UStr | [protected]
length(void) const | UStr | [inline]
operator char *() | UStr | [inline]
operator const char *() const | UStr | [inline]
operator!=(const UStr &str) const | UStr |
operator!=(const char *str) const | UStr |
operator<(const UStr &str) const | UStr |
operator<<(const char *addToStr) | UStr |
operator<<(char addToStr) | UStr |
operator<<(int addToStr) | UStr |
operator=(const char *newstr) | UStr |
operator=(const unsigned char *newstr) | UStr |
operator=(const UStr &newstr) | UStr |
operator==(const UStr &str) const | UStr |
operator==(const char *str) const | UStr |
operator>(const UStr &str) const | UStr |
replace(char which, char bywhich) | UStr |
set(const char *buf, unsigned int len) | UStr |
str | UStr | [protected]
UStr() | UStr | [inline]
UStr(const char *newstr) | UStr | [inline]
UStr(const unsigned char *newstr) | UStr | [inline]
UStr(const UStr &newstr) | UStr | [inline]
~UStr() | UStr | [inline, virtual]
Generated on Sun Feb 24 01:27:53 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TbEntry Member List

This is the complete list of members for TbEntry, including all inherited members.
kind | TbEntry |
TbEntry(tbeKind k) | TbEntry | [inline]
~TbEntry() | TbEntry | [inline, virtual]
Generated on Sun Feb 24 01:27:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

AREF Member List

This is the complete list of members for AREF, including all inherited members.
bitmap | AREF
cnt | AREF
Generated on Sun Feb 24 01:24:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

aref Member List

This is the complete list of members for aref, including all inherited members.
aref() | aref | [inline]
aref(HBITMAP b) | aref | [inline]
aref(const aref &src) | aref | [inline]
operator HBITMAP() | aref | [inline]
operator=(const aref &src) | aref | [inline]
ref | aref | [protected]
Ref(void) const | aref | [inline]
UnRef(void) const | aref | [inline]
~aref() | aref | [inline, virtual]
Generated on Sun Feb 24 01:24:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

awidget Member List

This is the complete list of members for awidget, including all inherited members.
awidget(HBITMAP b, int c, const char *t, UTB_VAR v) | awidget | [inline]
awidget() | awidget | [inline]
awidget(const awidget &src) | awidget | [inline]
bitmap | awidget |
cmd | awidget |
operator=(const awidget &src) | awidget | [inline]
tooltip | awidget |
var | awidget |
~awidget() | awidget | [inline, virtual]
Generated on Sun Feb 24 01:24:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TbEntryButton Member List

This is the complete list of members for TbEntryButton, including all inherited members.
ischeck | TbEntryButton |
kind | TbEntry |
TbEntry(tbeKind k) | TbEntry | [inline]
TbEntryButton(HBITMAP b, int c, const char *t, UTB_VAR v) | TbEntryButton | [inline]
wid | TbEntryButton |
~TbEntry() | TbEntry | [inline, virtual]
~TbEntryButton() | TbEntryButton | [inline, virtual]
Generated on Sun Feb 24 01:27:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TbEntryChkButton Member List

This is the complete list of members for TbEntryChkButton, including all inherited members.
ischeck | TbEntryButton |
kind | TbEntry |
TbEntry(tbeKind k) | TbEntry | [inline]
TbEntryButton(HBITMAP b, int c, const char *t, UTB_VAR v) | TbEntryButton | [inline]
TbEntryChkButton(HBITMAP b, int c, const char *t, UTB_VAR v) | TbEntryChkButton | [inline]
wid | TbEntryButton |
~TbEntry() | TbEntry | [inline, virtual]
~TbEntryButton() | TbEntryButton | [inline, virtual]
~TbEntryChkButton() | TbEntryChkButton | [inline, virtual]
Generated on Sun Feb 24 01:27:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TbEntryDropDown Member List

This is the complete list of members for TbEntryDropDown, including all inherited members.
current | TbEntryDropDown |
icons | TbEntryDropDown |
kind | TbEntry |
TbEntry(tbeKind k) | TbEntry | [inline]
TbEntryDropDown() | TbEntryDropDown | [inline]
~TbEntry() | TbEntry | [inline, virtual]
~TbEntryDropDown() | TbEntryDropDown | [inline, virtual]
Generated on Sun Feb 24 01:28:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TbEntrySeparator Member List

This is the complete list of members for TbEntrySeparator, including all inherited members.
kind | TbEntry |
TbEntry(tbeKind k) | TbEntry | [inline]
TbEntrySeparator() | TbEntrySeparator | [inline]
~TbEntry() | TbEntry | [inline, virtual]
~TbEntrySeparator() | TbEntrySeparator | [inline, virtual]
Generated on Sun Feb 24 01:28:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

WININFO Member List

This is the complete list of members for WININFO, including all inherited members.
entries | WININFO |
height | WININFO |
Search(int cmd, int *dropindex=0L) | WININFO | [inline]
width | WININFO |
WININFO(int w, int h) | WININFO | [inline]
~WININFO() | WININFO | [inline, virtual]
Generated on Sun Feb 24 01:29:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CColorMenu Member List

This is the complete list of members for CColorMenu, including all inherited members.
AppendColorMenuItem(UINT nID, awidget *what) | CColorMenu |
CColorMenu(int width, int height) | CColorMenu |
DrawItem(LPDRAWITEMSTRUCT lpDIS) | CColorMenu | [virtual]
m_height | CColorMenu |
m_width | CColorMenu |
MeasureItem(LPMEASUREITEMSTRUCT lpMIS) | CColorMenu | [virtual]
~CColorMenu() | CColorMenu | [virtual]
Generated on Sun Feb 24 01:25:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CDynToolBar Member List

This is the complete list of members for CDynToolBar, including all inherited members.
AddButtons(int nNumButtons, LPTBBUTTON lpButtons) | CCJToolBar |
AddDropDownButton(UINT nIDButton, UINT nIDMenu, BOOL bArrow=TRUE) | CCJToolBar |
AddReplaceBitmap(HBITMAP hbmImageWell) | CCJToolBar |
AddStrings(LPCTSTR lpszStrings) | CCJToolBar |
AutoSize() | CCJToolBar |
CalcDynamicLayout(int nLength, DWORD nMode) | CCJToolBar | [virtual]
CalcFixedLayout(BOOL bStretch, BOOL bHorz) | CCJToolBar | [virtual]
CalcInsideRect(CRect &rect, BOOL bHorz) const | CCJToolBarBase |
CalcLayout(DWORD nMode, int nLength=-1) | CCJToolBar | [protected]
CalcSize(TBBUTTON *pData, int nCount) | CCJToolBar | [protected]
CCJToolBar() | CCJToolBar |
CCJToolBarBase() | CCJToolBarBase | [protected]
CDynToolBar() | CDynToolBar |
CheckButton(int nID, BOOL bCheck) | CCJToolBar |
CommandToIndex(UINT nIDFind) const | CCJToolBar |
Create(CWnd *pParentWnd, DWORD dwStyle=WS_CHILD|WS_VISIBLE|CBRS_TOP, UINT nID=AFX_IDW_TOOLBAR) | CCJToolBar | [virtual]
CreateEx(CWnd *pParentWnd, DWORD dwCtrlStyle=TBSTYLE_FLAT, DWORD dwStyle=WS_CHILD|WS_VISIBLE|CBRS_ALIGN_TOP, CRect rcBorders=CRect(0, 0, 0, 0), UINT nID=AFX_IDW_TOOLBAR) | CCJToolBar | [virtual]
Customize() | CCJToolBar |
DeleteButton(int nIndex) | CCJToolBar |
DoPaint(CDC *pDC) | CCJToolBarBase | [virtual]
DrawBorders(CDC *pDC, CRect &rect) | CCJToolBarBase |
DrawGripper(CDC *pDC, const CRect &rect) | CCJToolBarBase |
EnableButton(int nID, BOOL bEnable) | CCJToolBar |
EraseNonClient() | CCJToolBarBase |
FindDropDownButton(UINT nID) | CCJToolBar |
GetBitmap(UINT nIdButton) const | CCJToolBar |
GetBitmapFlags() const | CCJToolBar |
GetBorders() const | CCJToolBarBase | [protected]
GetButton(int nIndex, TBBUTTON *pButton) const | CCJToolBar |
GetButtonCount() const | CCJToolBar |
GetButtonInfo(int nIndex, UINT &nID, UINT &nStyle, int &iImage) const | CCJToolBar |
GetButtonSize(TBBUTTON *pData, int iButton) | CCJToolBar | [virtual]
GetButtonStyle(int nIndex) const | CCJToolBar |
GetButtonText(int nIndex) const | CCJToolBar |
GetButtonText(int nIndex, CString &rString) const | CCJToolBar |
GetHotItem() const | CCJToolBar |
GetImageList() const | CCJToolBar |
GetItemID(int nIndex) const | CCJToolBar |
GetItemRect(int nIndex, LPRECT lpRect) const | CCJToolBar | [virtual]
GetMainFrame() | CDynToolBar | [inline]
GetPadding() const | CCJToolBar |
GetPseudoID(void) const | CDynToolBar | [inline]
GetRect(UINT nIdButton, RECT &rc) const | CCJToolBar |
GetRows() const | CCJToolBar |
GetState(int nID) const | CCJToolBar |
GetToolBarCtrl() const | CCJToolBar |
GetToolbarStyle() const | CCJToolBar |
GetToolTips() const | CCJToolBar |
GetWinInfo(void) const | CDynToolBar | [inline]
HideButton(int nID, BOOL bHide) | CCJToolBar |
HitTest(CPoint p) const | CCJToolBar |
Indeterminate(int nID, BOOL bIndeterminate) | CCJToolBar |
InsertButton(int nIndex, LPTBBUTTON lpButton) | CCJToolBar |
InsertControl(CRuntimeClass *pClass, LPCTSTR lpszWindowName, CRect &rect, UINT nID, DWORD dwStyle) | CCJToolBar |
InsertControl(CWnd *pCtrl, CRect &rect, UINT nID) | CCJToolBar |
InvalidateOldPos(const CRect &rcInvalid) | CCJToolBar | [virtual]
IsButtonChecked(int nID) const | CCJToolBar |
IsButtonEnabled(int nID) const | CCJToolBar |
IsButtonHidden(int nID) const | CCJToolBar |
IsButtonIndeterminate(int nID) const | CCJToolBar |
IsButtonPressed(int nID) const | CCJToolBar |
Layout() | CCJToolBar | [protected]
LoadBitmap(LPCTSTR lpszResourceName) | CCJToolBar |
LoadBitmap(UINT nIDResource) | CCJToolBar |
LoadToolBar(LPCTSTR lpszResourceName, TOOLBARINFO *pBarInfo=NULL) | CCJToolBar |
LoadToolBar(UINT nIDResource, TOOLBARINFO *pBarInfo=NULL) | CCJToolBar |
m_bDelayedButtonLayout | CCJToolBar | [protected]
m_bExStyle | CCJToolBarBase |
m_bInReBar | CCJToolBarBase |
m_bitmap | CDynToolBar |
m_bShowDropArrow | CCJToolBar | [protected]
m_hbmImageWell | CCJToolBar | [protected]
m_hInstImageWell | CCJToolBar | [protected]
m_hKeyRoot | CCJToolBar | [protected]
m_hRsrcImageWell | CCJToolBar | [protected]
m_info | CDynToolBar | [protected]
m_nBarNumber | CCJToolBar | [protected, static]
m_nButtons | CCJToolBar | [protected]
m_pBarInfo | CCJToolBar | [protected]
m_pControls | CCJToolBar | [protected]
m_pDropButtons | CCJToolBar | [protected]
m_pStringMap | CCJToolBar | [protected]
m_rcOldPos | CCJToolBar | [protected]
m_sizeButton | CCJToolBar | [protected]
m_sizeImage | CCJToolBar | [protected]
m_strSubKey | CCJToolBar | [protected]
m_strValueName | CCJToolBar | [protected]
m_tracking | CDynToolBar |
m_widid | CDynToolBar | [protected]
MapAccelerator(TCHAR ch, UINT &nID) const | CCJToolBar |
OnBarStyleChange(DWORD dwOldStyle, DWORD dwNewStyle) | CCJToolBar | [virtual]
OnDestroy(void) | CDynToolBar | [protected]
OnDropDownButton(const NMTOOLBAR &nmtb, UINT nID, CRect rc) | CDynToolBar | [protected, virtual]
OnEraseBkgnd(CDC *pDC) | CCJToolBar | [protected]
OnNcCalcSize(BOOL, NCCALCSIZE_PARAMS *) | CCJToolBar | [protected]
OnNcCreate(LPCREATESTRUCT) | CCJToolBar | [protected]
OnNcHitTest(CPoint) | CCJToolBar | [protected]
OnNcPaint() | CCJToolBar | [protected]
OnPaint() | CCJToolBar | [protected]
OnPreserveZeroBorderHelper(WPARAM, LPARAM) | CCJToolBar | [protected]
OnRButtonDown(UINT nFlags, CPoint point) | CCJToolBar | [protected]
OnSetBitmapSize(WPARAM, LPARAM) | CCJToolBar | [protected]
OnSetButtonSize(WPARAM, LPARAM) | CCJToolBar | [protected]
OnSetSizeHelper(CSize &size, LPARAM lParam) | CCJToolBar | [protected]
OnSysColorChange() | CCJToolBar | [protected]
OnToolBarBeginAdjust(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarBeginDrag(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarBtnDropDown(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarChange(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarCustomHelp(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarEndAdjust(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarEndDrag(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarGetButtonInfo(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarQueryDelete(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarQueryInsert(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarReset(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolHitTest(CPoint point, TOOLINFO *pTI) const | CCJToolBar | [virtual]
OnUpdateCmdUI(CFrameWnd *pTarget, BOOL bDisableIfNoHndler) | CCJToolBar | [virtual]
OnWindowPosChanged(WINDOWPOS *lpwndpos) | CCJToolBar | [protected]
OnWindowPosChanging(LPWINDOWPOS) | CCJToolBar | [protected]
PreCreateWindow(CREATESTRUCT &cs) | CCJToolBar | [virtual]
PressButton(int nID, BOOL bPress) | CCJToolBar |
RestoreState() | CCJToolBar |
SaveState() | CCJToolBar |
SendMessageC(UINT m, WPARAM wp=0, LPARAM lp=0) const | CCJToolBar |
SetBitmap(HBITMAP hbmImageWell) | CCJToolBar |
SetBitmapSize(CSize sz) | CCJToolBar |
SetBorders(LPCRECT lpRect) | CCJToolBarBase | [protected]
SetBorders(int cxLeft=0, int cyTop=0, int cxRight=0, int cyBottom=0) | CCJToolBarBase | [protected]
SetButton(int nIndex, TBBUTTON *pButton) | CCJToolBar |
SetButtonInfo(int nIndex, UINT nID, UINT nStyle, int iImage) | CCJToolBar |
SetButtons(const UINT *lpIDArray, int nIDCount) | CCJToolBar |
SetButtonSize(CSize sz) | CCJToolBar |
SetButtonStructSize(int nSize) | CCJToolBar |
SetButtonStyle(int nIndex, UINT nStyle) | CCJToolBar |
SetButtonText(int nIndex, LPCTSTR lpszText) | CCJToolBar |
SetCmdID(int nIndex, UINT nID) | CCJToolBar |
SetExtendedStyle(DWORD dwStyle) | CCJToolBar |
SetHeight(int cyHeight) | CCJToolBar |
SetHotItem(int iHot) | CCJToolBar |
SetImageList(HIMAGELIST hImgList) | CCJToolBar |
SetIndent(int indent) | CCJToolBar |
SetOwner(CWnd *pOwnerWnd) | CCJToolBar |
SetPadding(CSize sz) | CCJToolBar |
SetPseudoID(int id) | CDynToolBar | [inline]
SetRows(int nRows, BOOL bLarger, LPRECT lpRect) | CCJToolBar |
SetSizes(SIZE sizeButton, SIZE sizeImage) | CCJToolBar |
SetState(int nID, UINT nState) | CCJToolBar |
SetToolbarStyle(DWORD dwStyle) | CCJToolBar |
SetToolTips(CToolTipCtrl *pTip) | CCJToolBar |
SetWinInfo(WININFO *info) | CDynToolBar | [inline]
SizeToolBar(TBBUTTON *pData, int nCount, int nLength, BOOL bVert=FALSE) | CCJToolBar | [protected]
WindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam) | CCJToolBarBase | [virtual]
WrapToolBar(TBBUTTON *pData, int nCount, int nWidth) | CCJToolBar | [protected]
~CCJToolBar() | CCJToolBar | [virtual]
~CCJToolBarBase() | CCJToolBarBase | [virtual]
~CDynToolBar() | CDynToolBar | [virtual]
Generated on Sun Feb 24 01:25:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UToolbar Member List

This is the complete list of members for UToolbar, including all inherited members.
_GetBaseClass() | UToolbar | [protected, static]
_messageEntries | UToolbar | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUCmdTarget | UCmdTarget | [protected, static]
classUObject | UObject | [protected, static]
classUToolbar | UToolbar | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool) | UWidget | [inline, virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UToolbar | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UToolbar | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UToolbar | [virtual]
GetThisMessageMap() | UToolbar | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_overide | UWidget | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
m_winInfo | UToolbar | [protected]
m_wndToolBar | UToolbar | [protected]
messageMap | UToolbar | [protected, static]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnCommands(int cmd) | UToolbar | [protected]
OnDestroy() | UToolbar | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UToolbar | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTbButton(UTB_BUTTON *info) | UToolbar | [protected]
OnTbCheckBtn(UTB_BUTTON *info) | UToolbar | [protected]
OnTbDropDown(UTB_DROPDOWN *info) | UToolbar | [protected]
OnTbEnd(void) | UToolbar | [protected]
OnTbInit(UTB_INIT *info) | UToolbar | [protected]
OnTbSeparator(void) | UToolbar | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UToolbar | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RebuildBar(bool onlyBitmap=true) | UToolbar | [protected]
RemoveTimer(int cmd) | UWidget |
rtUCmdTarget(void) | UCmdTarget | [static]
rtUObject() | UObject | [static]
rtUToolbar(void) | UToolbar | [static]
rtUWidget(void) | UWidget | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sValidMenu | UWidget | [protected, static]
UCmdTarget(int widid) | UCmdTarget |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UToolbar | [virtual]
UObject() | UObject | [inline, protected]
UToolbar(int widid) | UToolbar |
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UCmdTarget() | UCmdTarget | [virtual]
~UObject() | UObject | [inline, virtual]
~UToolbar() | UToolbar | [virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:28:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UTimer Member List

This is the complete list of members for UTimer, including all inherited members.
m_cmd | UTimer |
m_lap | UTimer |
m_lastlap | UTimer |
operator=(const UTimer &src) | UTimer | [inline]
UTimer(int lap, int lastlap, int cmd) | UTimer | [inline]
UTimer() | UTimer | [inline]
UTimer(const UTimer &src) | UTimer | [inline]
Generated on Sun Feb 24 01:28:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UColor Member List

This is the complete list of members for UColor, including all inherited members.
b | UColor
g | UColor
r | UColor
Generated on Sun Feb 24 01:25:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UWidget Member List

This is the complete list of members for UWidget, including all inherited members.
_GetBaseClass() | UWidget | [protected, static]
_messageEntries | UWidget | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUCmdTarget | UCmdTarget | [protected, static]
classUObject | UObject | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool) | UWidget | [inline, virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UWidget | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UWidget | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UWidget | [virtual]
GetThisMessageMap() | UWidget | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_overide | UWidget | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | UWidget | [protected, static]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UWidget | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
rtUCmdTarget(void) | UCmdTarget | [static]
rtUObject() | UObject | [static]
rtUWidget(void) | UWidget | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sValidMenu | UWidget | [protected, static]
UCmdTarget(int widid) | UCmdTarget |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
UObject() | UObject | [inline, protected]
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UCmdTarget() | UCmdTarget | [virtual]
~UObject() | UObject | [inline, virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:28:52 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CAdminOptionDlg Member List

This is the complete list of members for CAdminOptionDlg, including all inherited members.
CAdminOptionDlg(kAdminOptionDlgType type, CWnd *pParent=NULL) | CAdminOptionDlg |
DoDataExchange(CDataExchange *pDX) | CAdminOptionDlg | [protected, virtual]
IDD enum value | CAdminOptionDlg |
m_optionDescription | CAdminOptionDlg | [private]
m_optionString | CAdminOptionDlg |
m_singeLine | CAdminOptionDlg | [private]
m_title | CAdminOptionDlg | [private]
m_type | CAdminOptionDlg | [private]
OnInitDialog() | CAdminOptionDlg | [protected, virtual]
Generated on Sun Feb 24 01:24:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CAnnotate_MAIN Member List

This is the complete list of members for CAnnotate_MAIN, including all inherited members.
CAnnotate_MAIN(const char *rev, bool isDate) | CAnnotate_MAIN |
CAnnotate_MAIN() | CAnnotate_MAIN |
DoDataExchange(CDataExchange *pDX) | CAnnotate_MAIN | [protected, virtual]
IDD enum value | CAnnotate_MAIN |
m_force | CAnnotate_MAIN |
m_hasRev | CAnnotate_MAIN |
m_isDate | CAnnotate_MAIN |
m_noRecurse | CAnnotate_MAIN |
m_revCombo | CAnnotate_MAIN |
m_strRev | CAnnotate_MAIN |
OnIsdate() | CAnnotate_MAIN | [protected]
OnSpecifyRev() | CAnnotate_MAIN | [protected]
~CAnnotate_MAIN() | CAnnotate_MAIN |
Generated on Sun Feb 24 01:24:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CColorConsole Member List

This is the complete list of members for CColorConsole, including all inherited members.
CColorConsole() | CColorConsole |
CColorConsole(CWincvsView *aview) | CColorConsole |
fView | CColorConsole | [protected]
GetView() | CColorConsole | [protected]
oldFormat | CColorConsole | [protected]
operator<<(char c) | CColorConsole |
operator<<(kConsoleColor color) | CColorConsole |
operator<<(const char *str) | CColorConsole |
operator<<(int value) | CColorConsole |
~CColorConsole() | CColorConsole | [virtual]
Generated on Sun Feb 24 01:25:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CAuthenSetUp Member List

This is the complete list of members for CAuthenSetUp, including all inherited members.
CAuthenSetUp() | CAuthenSetUp | [inline]
~CAuthenSetUp() | CAuthenSetUp | [inline]
Generated on Sun Feb 24 01:24:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CStreamConsole Member List

This is the complete list of members for CStreamConsole, including all inherited members.
CStreamConsole(FILE *out) | CStreamConsole | [inline]
cvs_err(char *txt, long len) | CStreamConsole | [inline, virtual]
cvs_out(char *txt, long len) | CStreamConsole | [inline, virtual]
fOut | CStreamConsole | [protected]
Generated on Sun Feb 24 01:27:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CTmpFiles Member List

This is the complete list of members for CTmpFiles, including all inherited members.
allfiles | CTmpFiles | [protected]
push_back(const char *file) | CTmpFiles | [inline]
~CTmpFiles() | CTmpFiles | [inline]
Generated on Sun Feb 24 01:28:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCvsConsole Member List

This is the complete list of members for CCvsConsole, including all inherited members.
cvs_err(char *txt, long len)=0L | CCvsConsole | [pure virtual]
cvs_out(char *txt, long len)=0L | CCvsConsole | [pure virtual]
Generated on Sun Feb 24 01:25:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UPromptMessage Member List

This is the complete list of members for UPromptMessage, including all inherited members.
_GetBaseClass() | UPromptMessage | [protected, static]
_messageEntries | UPromptMessage | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUCmdTarget | UCmdTarget | [protected, static]
classUObject | UObject | [protected, static]
classUPromptMessage | UPromptMessage | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool fill) | UPromptMessage | [inline, virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UPromptMessage | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UPromptMessage | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UPromptMessage | [virtual]
GetThisMessageMap() | UPromptMessage | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kCancel enum value | UPromptMessage |
kMsg enum value | UPromptMessage |
kOK enum value | UPromptMessage |
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_cncl | UPromptMessage | [protected]
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_msg | UPromptMessage | [protected]
m_noDispatch | UWidget | [protected]
m_ok | UPromptMessage | [protected]
m_overide | UWidget | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_title | UPromptMessage | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | UPromptMessage | [protected, static]
OnCancel(void) | UPromptMessage | [protected]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnOK(void) | UPromptMessage | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UWidget | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
rtUCmdTarget(void) | UCmdTarget | [static]
rtUObject() | UObject | [static]
rtUPromptMessage(void) | UPromptMessage | [static]
rtUWidget(void) | UWidget | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sValidMenu | UWidget | [protected, static]
UCmdTarget(int widid) | UCmdTarget |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
UObject() | UObject | [inline, protected]
UPromptMessage(const char *msg, const char *title, const char *def, const char *cncl) | UPromptMessage | [inline]
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UCmdTarget() | UCmdTarget | [virtual]
~UObject() | UObject | [inline, virtual]
~UPromptMessage() | UPromptMessage | [inline, virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:27:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UEditMessage Member List

This is the complete list of members for UEditMessage, including all inherited members.
_GetBaseClass() | UEditMessage | [protected, static]
_messageEntries | UEditMessage | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUCmdTarget | UCmdTarget | [protected, static]
classUEditMessage | UEditMessage | [protected, static]
classUObject | UObject | [protected, static]
classUPromptMessage | UPromptMessage | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool fill) | UEditMessage | [inline, virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UEditMessage | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UEditMessage | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UEditMessage | [virtual]
GetThisMessageMap() | UEditMessage | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kCancel enum value | UEditMessage |
kEdit enum value | UEditMessage |
kMsg enum value | UEditMessage |
kOK enum value | UEditMessage |
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_cncl | UPromptMessage | [protected]
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_edit | UEditMessage |
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_msg | UPromptMessage | [protected]
m_noDispatch | UWidget | [protected]
m_ok | UPromptMessage | [protected]
m_overide | UWidget | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_title | UPromptMessage | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | UEditMessage | [protected, static]
OnCancel(void) | UPromptMessage | [protected]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnOK(void) | UPromptMessage | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UWidget | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
rtUCmdTarget(void) | UCmdTarget | [static]
rtUEditMessage(void) | UEditMessage | [static]
rtUObject() | UObject | [static]
rtUPromptMessage(void) | UPromptMessage | [static]
rtUWidget(void) | UWidget | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sValidMenu | UWidget | [protected, static]
UCmdTarget(int widid) | UCmdTarget |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
UEditMessage(const char *msg, const char *edit, const char *title, const char *def, const char *cncl) | UEditMessage | [inline]
UObject() | UObject | [inline, protected]
UPromptMessage(const char *msg, const char *title, const char *def, const char *cncl) | UPromptMessage | [inline]
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UCmdTarget() | UCmdTarget | [virtual]
~UEditMessage() | UEditMessage | [inline, virtual]
~UObject() | UObject | [inline, virtual]
~UPromptMessage() | UPromptMessage | [inline, virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:25:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CAskYesNo Member List

This is the complete list of members for CAskYesNo, including all inherited members.
CAskYesNo(CWnd *pParent=NULL) | CAskYesNo |
DoDataExchange(CDataExchange *pDX) | CAskYesNo | [protected, virtual]
IDD enum value | CAskYesNo |
m_passwd | CAskYesNo |
Generated on Sun Feb 24 01:24:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

AuthenLocal Member List

This is the complete list of members for AuthenLocal, including all inherited members.
AuthenLocal() | AuthenLocal | [inline]
AuthenModel() | AuthenModel |
DoSettings(void) | AuthenModel | [inline, virtual]
GetAllInstances(void) | AuthenModel | [static]
GetInstance(AuthenKind k) | AuthenModel | [static]
GetKind(void) const | AuthenLocal | [inline, virtual]
GetSettingsDesc(UStr &desc) | AuthenModel | [inline, virtual]
GetToken(void) const | AuthenLocal | [inline, virtual]
HasHost(void) const | AuthenModel | [inline, virtual]
HasSettings(void) const | AuthenModel | [inline, virtual]
HasUser(void) const | AuthenModel | [inline, virtual]
m_instances | AuthenModel | [protected, static]
OnGetEnv(char *env) | AuthenModel | [inline, virtual]
OnRestoreEnv(void) | AuthenModel | [virtual]
OnSetupEnv(void) | AuthenModel | [virtual]
~AuthenLocal() | AuthenLocal | [inline, virtual]
~AuthenModel() | AuthenModel | [virtual]
Generated on Sun Feb 24 01:24:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

AuthenSSH Member List

This is the complete list of members for AuthenSSH, including all inherited members.
AuthenModel() | AuthenModel |
AuthenSSH() | AuthenSSH | [inline]
DoSettings(void) | AuthenSSH | [virtual]
gCurRsaIdentity | AuthenSSH | [static]
GetAllInstances(void) | AuthenModel | [static]
GetInstance(AuthenKind k) | AuthenModel | [static]
GetKind(void) const | AuthenSSH | [inline, virtual]
GetSettingsDesc(UStr &desc) | AuthenSSH | [virtual]
GetToken(void) const | AuthenSSH | [inline, virtual]
gRsaIdentity | AuthenSSH | [static]
gRsaIdentityFile | AuthenSSH | [static]
gSSHName | AuthenSSH | [static]
gSSHOptions | AuthenSSH | [static]
HasHost(void) const | AuthenSSH | [inline, virtual]
HasSettings(void) const | AuthenSSH | [inline, virtual]
HasUser(void) const | AuthenSSH | [inline, virtual]
m_instances | AuthenModel | [protected, static]
OnGetEnv(char *env) | AuthenSSH | [virtual]
OnRestoreEnv(void) | AuthenSSH | [virtual]
OnSetupEnv(void) | AuthenSSH | [virtual]
RsaIdentityFile(void) | AuthenSSH | [static]
~AuthenModel() | AuthenModel | [virtual]
~AuthenSSH() | AuthenSSH | [inline, virtual]
Generated on Sun Feb 24 01:24:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UAuthen_SSH Member List

This is the complete list of members for UAuthen_SSH, including all inherited members.
_GetBaseClass() | UAuthen_SSH | [protected, static]
_messageEntries | UAuthen_SSH | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUAuthen_SSH | UAuthen_SSH | [protected, static]
classUCmdTarget | UCmdTarget | [protected, static]
classUObject | UObject | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool fill) | UAuthen_SSH | [virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UAuthen_SSH | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UAuthen_SSH | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UAuthen_SSH | [virtual]
GetThisMessageMap() | UAuthen_SSH | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kCancel enum value | UAuthen_SSH |
kOK enum value | UAuthen_SSH |
kOptionsCheck enum value | UAuthen_SSH |
kOptionsEdit enum value | UAuthen_SSH |
kOptionsText enum value | UAuthen_SSH |
kRSABtn enum value | UAuthen_SSH |
kRSACheck enum value | UAuthen_SSH |
kRSAEdit enum value | UAuthen_SSH |
kSSHBtn enum value | UAuthen_SSH |
kSSHCheck enum value | UAuthen_SSH |
kSSHName enum value | UAuthen_SSH |
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_options | UAuthen_SSH | [protected]
m_overide | UWidget | [protected]
m_rsaidentity | UAuthen_SSH | [protected]
m_rsaidentityfile | UAuthen_SSH | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | UAuthen_SSH | [protected, static]
OnBtnName(void) | UAuthen_SSH | [protected]
OnBtnRSA(void) | UAuthen_SSH | [protected]
OnCheckName(void) | UAuthen_SSH | [protected]
OnCheckOptions(void) | UAuthen_SSH | [protected]
OnCheckRSA(void) | UAuthen_SSH | [protected]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UWidget | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
rtUAuthen_SSH(void) | UAuthen_SSH | [static]
rtUCmdTarget(void) | UCmdTarget | [static]
rtUObject() | UObject | [static]
rtUWidget(void) | UWidget | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sValidMenu | UWidget | [protected, static]
UAuthen_SSH() | UAuthen_SSH |
UCmdTarget(int widid) | UCmdTarget |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
UObject() | UObject | [inline, protected]
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UAuthen_SSH() | UAuthen_SSH | [inline, virtual]
~UCmdTarget() | UCmdTarget | [virtual]
~UObject() | UObject | [inline, virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:24:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

AuthenPserver Member List

This is the complete list of members for AuthenPserver, including all inherited members.
AuthenModel() | AuthenModel |
AuthenPserver() | AuthenPserver | [inline]
DoSettings(void) | AuthenPserver | [virtual]
GetAllInstances(void) | AuthenModel | [static]
GetInstance(AuthenKind k) | AuthenModel | [static]
GetKind(void) const | AuthenPserver | [inline, virtual]
GetSettingsDesc(UStr &desc) | AuthenPserver | [virtual]
GetToken(void) const | AuthenPserver | [inline, virtual]
HasHost(void) const | AuthenPserver | [inline, virtual]
HasSettings(void) const | AuthenPserver | [inline, virtual]
HasUser(void) const | AuthenPserver | [inline, virtual]
m_instances | AuthenModel | [protected, static]
OnGetEnv(char *env) | AuthenPserver | [virtual]
OnRestoreEnv(void) | AuthenPserver | [virtual]
OnSetupEnv(void) | AuthenPserver | [virtual]
~AuthenModel() | AuthenModel | [virtual]
~AuthenPserver() | AuthenPserver | [inline, virtual]
Generated on Sun Feb 24 01:24:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UAuthen_Pserver Member List

This is the complete list of members for UAuthen_Pserver, including all inherited members.
_GetBaseClass() | UAuthen_Pserver | [protected, static]
_messageEntries | UAuthen_Pserver | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUAuthen_Pserver | UAuthen_Pserver | [protected, static]
classUCmdTarget | UCmdTarget | [protected, static]
classUObject | UObject | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool fill) | UAuthen_Pserver | [virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UAuthen_Pserver | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UAuthen_Pserver | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UAuthen_Pserver | [virtual]
GetThisMessageMap() | UAuthen_Pserver | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kCancel enum value | UAuthen_Pserver |
kCheckPort enum value | UAuthen_Pserver |
kCheckProxy enum value | UAuthen_Pserver |
kEditPort enum value | UAuthen_Pserver |
kEditProxy enum value | UAuthen_Pserver |
kNameProxy enum value | UAuthen_Pserver |
kOK enum value | UAuthen_Pserver |
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_overide | UWidget | [protected]
m_pname | UAuthen_Pserver | [protected]
m_port | UAuthen_Pserver | [protected]
m_pport | UAuthen_Pserver | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | UAuthen_Pserver | [protected, static]
OnCheckPort(void) | UAuthen_Pserver | [protected]
OnCheckProxy(void) | UAuthen_Pserver | [protected]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UWidget | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
rtUAuthen_Pserver(void) | UAuthen_Pserver | [static]
rtUCmdTarget(void) | UCmdTarget | [static]
rtUObject() | UObject | [static]
rtUWidget(void) | UWidget | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sValidMenu | UWidget | [protected, static]
UAuthen_Pserver() | UAuthen_Pserver |
UCmdTarget(int widid) | UCmdTarget |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
UObject() | UObject | [inline, protected]
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UAuthen_Pserver() | UAuthen_Pserver | [inline, virtual]
~UCmdTarget() | UCmdTarget | [virtual]
~UObject() | UObject | [inline, virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:24:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

AuthenRhosts Member List

This is the complete list of members for AuthenRhosts, including all inherited members.
AuthenModel() | AuthenModel |
AuthenRhosts() | AuthenRhosts | [inline]
DoSettings(void) | AuthenRhosts | [virtual]
GetAllInstances(void) | AuthenModel | [static]
GetInstance(AuthenKind k) | AuthenModel | [static]
GetKind(void) const | AuthenRhosts | [inline, virtual]
GetSettingsDesc(UStr &desc) | AuthenRhosts | [virtual]
GetToken(void) const | AuthenRhosts | [inline, virtual]
HasHost(void) const | AuthenRhosts | [inline, virtual]
HasSettings(void) const | AuthenRhosts | [inline, virtual]
HasUser(void) const | AuthenRhosts | [inline, virtual]
m_instances | AuthenModel | [protected, static]
OnGetEnv(char *env) | AuthenRhosts | [virtual]
OnRestoreEnv(void) | AuthenRhosts | [virtual]
OnSetupEnv(void) | AuthenRhosts | [virtual]
~AuthenModel() | AuthenModel | [virtual]
~AuthenRhosts() | AuthenRhosts | [inline, virtual]
Generated on Sun Feb 24 01:24:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UAuthen_Rhosts Member List

This is the complete list of members for UAuthen_Rhosts, including all inherited members.
_GetBaseClass() | UAuthen_Rhosts | [protected, static]
_messageEntries | UAuthen_Rhosts | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUAuthen_Rhosts | UAuthen_Rhosts | [protected, static]
classUCmdTarget | UCmdTarget | [protected, static]
classUObject | UObject | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool fill) | UAuthen_Rhosts | [virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UAuthen_Rhosts | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UAuthen_Rhosts | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UAuthen_Rhosts | [virtual]
GetThisMessageMap() | UAuthen_Rhosts | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kCancel enum value | UAuthen_Rhosts |
kCheckPort enum value | UAuthen_Rhosts |
kCheckRSHName enum value | UAuthen_Rhosts |
kCheckServerName enum value | UAuthen_Rhosts |
kEditPort enum value | UAuthen_Rhosts |
kEditRSHName enum value | UAuthen_Rhosts |
kEditServerName enum value | UAuthen_Rhosts |
kOK enum value | UAuthen_Rhosts |
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_overide | UWidget | [protected]
m_port | UAuthen_Rhosts | [protected]
m_rshname | UAuthen_Rhosts | [protected]
m_servername | UAuthen_Rhosts | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | UAuthen_Rhosts | [protected, static]
OnCheckPort(void) | UAuthen_Rhosts | [protected]
OnCheckRshName(void) | UAuthen_Rhosts | [protected]
OnCheckServerName(void) | UAuthen_Rhosts | [protected]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UWidget | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
rtUAuthen_Rhosts(void) | UAuthen_Rhosts | [static]
rtUCmdTarget(void) | UCmdTarget | [static]
rtUObject() | UObject | [static]
rtUWidget(void) | UWidget | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sValidMenu | UWidget | [protected, static]
UAuthen_Rhosts() | UAuthen_Rhosts |
UCmdTarget(int widid) | UCmdTarget |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
UObject() | UObject | [inline, protected]
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UAuthen_Rhosts() | UAuthen_Rhosts | [inline, virtual]
~UCmdTarget() | UCmdTarget | [virtual]
~UObject() | UObject | [inline, virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:24:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

AuthenKserver Member List

This is the complete list of members for AuthenKserver, including all inherited members.
AuthenKserver() | AuthenKserver | [inline]
AuthenModel() | AuthenModel |
DoSettings(void) | AuthenKserver | [virtual]
GetAllInstances(void) | AuthenModel | [static]
GetInstance(AuthenKind k) | AuthenModel | [static]
GetKind(void) const | AuthenKserver | [inline, virtual]
GetSettingsDesc(UStr &desc) | AuthenKserver | [virtual]
GetToken(void) const | AuthenKserver | [inline, virtual]
HasHost(void) const | AuthenKserver | [inline, virtual]
HasSettings(void) const | AuthenKserver | [inline, virtual]
HasUser(void) const | AuthenKserver | [inline, virtual]
m_instances | AuthenModel | [protected, static]
OnGetEnv(char *env) | AuthenKserver | [virtual]
OnRestoreEnv(void) | AuthenModel | [virtual]
OnSetupEnv(void) | AuthenModel | [virtual]
~AuthenKserver() | AuthenKserver | [inline, virtual]
~AuthenModel() | AuthenModel | [virtual]
Generated on Sun Feb 24 01:24:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UAuthen_Kserver Member List

This is the complete list of members for UAuthen_Kserver, including all inherited members.
_GetBaseClass() | UAuthen_Kserver | [protected, static]
_messageEntries | UAuthen_Kserver | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUAuthen_Kserver | UAuthen_Kserver | [protected, static]
classUCmdTarget | UCmdTarget | [protected, static]
classUObject | UObject | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool fill) | UAuthen_Kserver | [virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UAuthen_Kserver | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UAuthen_Kserver | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UAuthen_Kserver | [virtual]
GetThisMessageMap() | UAuthen_Kserver | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kCancel enum value | UAuthen_Kserver |
kCheckPort enum value | UAuthen_Kserver |
kEditPort enum value | UAuthen_Kserver |
kOK enum value | UAuthen_Kserver |
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_overide | UWidget | [protected]
m_port | UAuthen_Kserver | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | UAuthen_Kserver | [protected, static]
OnCheckPort(void) | UAuthen_Kserver | [protected]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UWidget | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
rtUAuthen_Kserver(void) | UAuthen_Kserver | [static]
rtUCmdTarget(void) | UCmdTarget | [static]
rtUObject() | UObject | [static]
rtUWidget(void) | UWidget | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sValidMenu | UWidget | [protected, static]
UAuthen_Kserver() | UAuthen_Kserver |
UCmdTarget(int widid) | UCmdTarget |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
UObject() | UObject | [inline, protected]
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UAuthen_Kserver() | UAuthen_Kserver | [inline, virtual]
~UCmdTarget() | UCmdTarget | [virtual]
~UObject() | UObject | [inline, virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:24:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

AuthenNtserver Member List

This is the complete list of members for AuthenNtserver, including all inherited members.
AuthenModel() | AuthenModel |
AuthenNtserver() | AuthenNtserver | [inline]
DoSettings(void) | AuthenModel | [inline, virtual]
GetAllInstances(void) | AuthenModel | [static]
GetInstance(AuthenKind k) | AuthenModel | [static]
GetKind(void) const | AuthenNtserver | [inline, virtual]
GetSettingsDesc(UStr &desc) | AuthenModel | [inline, virtual]
GetToken(void) const | AuthenNtserver | [inline, virtual]
HasHost(void) const | AuthenNtserver | [inline, virtual]
HasSettings(void) const | AuthenNtserver | [inline, virtual]
HasUser(void) const | AuthenModel | [inline, virtual]
m_instances | AuthenModel | [protected, static]
OnGetEnv(char *env) | AuthenNtserver | [virtual]
OnRestoreEnv(void) | AuthenModel | [virtual]
OnSetupEnv(void) | AuthenModel | [virtual]
~AuthenModel() | AuthenModel | [virtual]
~AuthenNtserver() | AuthenNtserver | [inline, virtual]
Generated on Sun Feb 24 01:24:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

AuthenGserver Member List

This is the complete list of members for AuthenGserver, including all inherited members.
AuthenGserver() | AuthenGserver | [inline]
AuthenModel() | AuthenModel |
DoSettings(void) | AuthenGserver | [virtual]
GetAllInstances(void) | AuthenModel | [static]
GetInstance(AuthenKind k) | AuthenModel | [static]
GetKind(void) const | AuthenGserver | [inline, virtual]
GetSettingsDesc(UStr &desc) | AuthenGserver | [virtual]
GetToken(void) const | AuthenGserver | [inline, virtual]
HasHost(void) const | AuthenGserver | [inline, virtual]
HasSettings(void) const | AuthenGserver | [inline, virtual]
HasUser(void) const | AuthenModel | [inline, virtual]
m_instances | AuthenModel | [protected, static]
OnGetEnv(char *env) | AuthenGserver | [virtual]
OnRestoreEnv(void) | AuthenModel | [virtual]
OnSetupEnv(void) | AuthenModel | [virtual]
~AuthenGserver() | AuthenGserver | [inline, virtual]
~AuthenModel() | AuthenModel | [virtual]
Generated on Sun Feb 24 01:24:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UAuthen_Gserver Member List

This is the complete list of members for UAuthen_Gserver, including all inherited members.
_GetBaseClass() | UAuthen_Gserver | [protected, static]
_messageEntries | UAuthen_Gserver | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUAuthen_Gserver | UAuthen_Gserver | [protected, static]
classUCmdTarget | UCmdTarget | [protected, static]
classUObject | UObject | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool fill) | UAuthen_Gserver | [virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UAuthen_Gserver | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UAuthen_Gserver | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UAuthen_Gserver | [virtual]
GetThisMessageMap() | UAuthen_Gserver | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kCancel enum value | UAuthen_Gserver |
kCheckEncrypt enum value | UAuthen_Gserver |
kOK enum value | UAuthen_Gserver |
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_overide | UWidget | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | UAuthen_Gserver | [protected, static]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UWidget | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
rtUAuthen_Gserver(void) | UAuthen_Gserver | [static]
rtUCmdTarget(void) | UCmdTarget | [static]
rtUObject() | UObject | [static]
rtUWidget(void) | UWidget | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sValidMenu | UWidget | [protected, static]
UAuthen_Gserver() | UAuthen_Gserver |
UCmdTarget(int widid) | UCmdTarget |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
UObject() | UObject | [inline, protected]
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UAuthen_Gserver() | UAuthen_Gserver | [inline, virtual]
~UCmdTarget() | UCmdTarget | [virtual]
~UObject() | UObject | [inline, virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:24:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

Authen Member List

This is the complete list of members for Authen, including all inherited members.
Authen() | Authen | [inline]
kind(void) | Authen |
kindstr(void) | Authen |
kindToNum(AuthenKind k) | Authen | [static]
kindToToken(AuthenKind k) | Authen | [static]
numToKind(short num) | Authen | [static]
parse_cvsroot(const char *CVSroot, UStr &theMethod, UStr &theUser, UStr &theHost, UStr &thePath) | Authen | [static]
setkind(AuthenKind newkind) | Authen |
skiptoken(const char *cvsroot) | Authen | [static]
token(void) | Authen |
token(AuthenKind k) | Authen | [static]
tokenToKind(const char *t) | Authen | [static]
Generated on Sun Feb 24 01:24:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

AuthenModel Member List

This is the complete list of members for AuthenModel, including all inherited members.
AuthenModel() | AuthenModel |
DoSettings(void) | AuthenModel | [inline, virtual]
GetAllInstances(void) | AuthenModel | [static]
GetInstance(AuthenKind k) | AuthenModel | [static]
GetKind(void) const=0 | AuthenModel | [pure virtual]
GetSettingsDesc(UStr &desc) | AuthenModel | [inline, virtual]
GetToken(void) const=0 | AuthenModel | [pure virtual]
HasHost(void) const | AuthenModel | [inline, virtual]
HasSettings(void) const | AuthenModel | [inline, virtual]
HasUser(void) const | AuthenModel | [inline, virtual]
m_instances | AuthenModel | [protected, static]
OnGetEnv(char *env) | AuthenModel | [inline, virtual]
OnRestoreEnv(void) | AuthenModel | [virtual]
OnSetupEnv(void) | AuthenModel | [virtual]
~AuthenModel() | AuthenModel | [virtual]
Generated on Sun Feb 24 01:24:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoNameColumn Member List

This is the complete list of members for KoNameColumn, including all inherited members.
Compare(KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const | KoNameColumn | [inline, virtual]
GetSetupData(LV_COLUMN *lvc) const | KoNameColumn | [inline, virtual]
GetText(KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const | KoNameColumn | [inline, virtual]
IsDefaultAscending() const | KoNameColumn | [inline, virtual]
Generated on Sun Feb 24 01:26:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoPathColumn Member List

This is the complete list of members for KoPathColumn, including all inherited members.
Compare(KoColumnContext *context, EntnodeData *d1, EntnodeData *d2) const | KoPathColumn | [inline, virtual]
GetSetupData(LV_COLUMN *lvc) const | KoPathColumn | [inline, virtual]
GetText(KoColumnContext *context, EntnodeData *data, char *buffer, int bufferSize) const | KoPathColumn | [inline, virtual]
IsDefaultAscending() const | KoPathColumn | [inline, virtual]
Generated on Sun Feb 24 01:26:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoRevisionColumn Member List

This is the complete list of members for KoRevisionColumn, including all inherited members.
Compare(KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const | KoRevisionColumn | [inline, virtual]
GetSetupData(LV_COLUMN *lvc) const | KoRevisionColumn | [inline, virtual]
GetText(KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const | KoRevisionColumn | [inline, virtual]
IsDefaultAscending() const | KoRevisionColumn | [inline, virtual]
revcmp(const char *rev1, const char *rev2) | KoRevisionColumn | [inline, static]
Generated on Sun Feb 24 01:26:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoOptionColumn Member List

This is the complete list of members for KoOptionColumn, including all inherited members.
Compare(KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const | KoOptionColumn | [inline, virtual]
GetSetupData(LV_COLUMN *lvc) const | KoOptionColumn | [inline, virtual]
GetText(KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const | KoOptionColumn | [inline, virtual]
IsDefaultAscending() const | KoOptionColumn | [inline, virtual]
Generated on Sun Feb 24 01:26:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoStatusColumn Member List

This is the complete list of members for KoStatusColumn, including all inherited members.
Compare(KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const | KoStatusColumn | [inline, virtual]
GetSetupData(LV_COLUMN *lvc) const | KoStatusColumn | [inline, virtual]
GetText(KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const | KoStatusColumn | [inline, virtual]
IsDefaultAscending() const | KoStatusColumn | [inline, virtual]
Generated on Sun Feb 24 01:26:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoTagColumn Member List

This is the complete list of members for KoTagColumn, including all inherited members.
Compare(KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const | KoTagColumn | [inline, virtual]
GetSetupData(LV_COLUMN *lvc) const | KoTagColumn | [inline, virtual]
GetText(KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const | KoTagColumn | [inline, virtual]
IsDefaultAscending() const | KoTagColumn | [inline, virtual]
Generated on Sun Feb 24 01:26:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoDateColumn Member List

This is the complete list of members for KoDateColumn, including all inherited members.
Compare(KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const | KoDateColumn | [inline, virtual]
GetSetupData(LV_COLUMN *lvc) const | KoDateColumn | [inline, virtual]
GetText(KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const | KoDateColumn | [inline, virtual]
IsDefaultAscending() const | KoDateColumn | [inline, virtual]
Generated on Sun Feb 24 01:26:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoConflictColumn Member List

This is the complete list of members for KoConflictColumn, including all inherited members.
Compare(KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const | KoConflictColumn | [inline, virtual]
GetSetupData(LV_COLUMN *lvc) const | KoConflictColumn | [inline, virtual]
GetText(KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const | KoConflictColumn | [inline, virtual]
IsDefaultAscending() const | KoConflictColumn | [inline, virtual]
Generated on Sun Feb 24 01:26:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoRegularModel Member List

This is the complete list of members for KoRegularModel, including all inherited members.
GetAt(int pos) const | KoRegularModel | [inline, virtual]
GetColumn(int type) const | KiColumnModel | [virtual]
GetCount() const | KoRegularModel | [inline, virtual]
GetRecursiveModel() | KiColumnModel | [static]
GetRegularModel() | KiColumnModel | [static]
GetType(int pos) const | KoRegularModel | [inline, virtual]
Generated on Sun Feb 24 01:26:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoRecursiveModel Member List

This is the complete list of members for KoRecursiveModel, including all inherited members.
GetAt(int pos) const | KoRecursiveModel | [inline, virtual]
GetColumn(int type) const | KiColumnModel | [virtual]
GetCount() const | KoRecursiveModel | [inline, virtual]
GetRecursiveModel() | KiColumnModel | [static]
GetRegularModel() | KiColumnModel | [static]
GetType(int pos) const | KoRecursiveModel | [inline, virtual]
Generated on Sun Feb 24 01:26:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoColumnContext Member List

This is the complete list of members for KoColumnContext, including all inherited members.
KoColumnContext(const char *path) | KoColumnContext | [inline]
m_path | KoColumnContext |
Generated on Sun Feb 24 01:26:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KiColumn Member List

This is the complete list of members for KiColumn, including all inherited members.
Compare(KoColumnContext *context, EntnodeData *d1, EntnodeData *d2) const=0 | KiColumn | [pure virtual]
GetSetupData(LV_COLUMN *lvc) const=0 | KiColumn | [pure virtual]
GetText(KoColumnContext *context, EntnodeData *data, char *buffer, int buffersize) const=0 | KiColumn | [pure virtual]
IsDefaultAscending() const=0 | KiColumn | [pure virtual]
Generated on Sun Feb 24 01:26:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KiColumnModel Member List

This is the complete list of members for KiColumnModel, including all inherited members.
GetAt(int pos) const=0 | KiColumnModel | [pure virtual]
GetColumn(int type) const | KiColumnModel | [virtual]
GetCount() const=0 | KiColumnModel | [pure virtual]
GetRecursiveModel() | KiColumnModel | [static]
GetRegularModel() | KiColumnModel | [static]
GetType(int pos) const=0 | KiColumnModel | [pure virtual]
Generated on Sun Feb 24 01:26:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CSortParam Member List

This is the complete list of members for CSortParam, including all inherited members.
CSortParam(bool fAccendant, bool fGroupSubDir, const KiColumn *column, const KiColumn *columnAlt, KoColumnContext *context) | CSortParam | [inline]
m_column | CSortParam |
m_columnAlt | CSortParam |
m_context | CSortParam |
m_fAccendant | CSortParam |
m_fGroupSubDir | CSortParam |
Generated on Sun Feb 24 01:27:50 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KiSelectionHandler Member List

This is the complete list of members for KiSelectionHandler, including all inherited members.
OnFiles(MultiFiles *mf)=0 | KiSelectionHandler | [pure virtual]
OnFolder(const char *fullpath)=0 | KiSelectionHandler | [pure virtual]
Generated on Sun Feb 24 01:26:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoMoveToTrashHandler Member List

This is the complete list of members for KoMoveToTrashHandler, including all inherited members.
OnFiles(MultiFiles *mf) | KoMoveToTrashHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoMoveToTrashHandler | [inline, virtual]
Generated on Sun Feb 24 01:26:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoUpdateMoveToTrashHandler Member List

This is the complete list of members for KoUpdateMoveToTrashHandler, including all inherited members.
IsEnabled() const | KoUpdateMoveToTrashHandler | [inline]
KoUpdateMoveToTrashHandler() | KoUpdateMoveToTrashHandler | [inline]
m_isFiles | KoUpdateMoveToTrashHandler | [private]
m_isFolders | KoUpdateMoveToTrashHandler | [private]
OnFiles(MultiFiles *) | KoUpdateMoveToTrashHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoUpdateMoveToTrashHandler | [inline, virtual]
Generated on Sun Feb 24 01:26:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoCreateTagHandler Member List

This is the complete list of members for KoCreateTagHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoCreateTagHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoCreateTagHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoDeleteTagHandler Member List

This is the complete list of members for KoDeleteTagHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoDeleteTagHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoDeleteTagHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoBranchTagHandler Member List

This is the complete list of members for KoBranchTagHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoBranchTagHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoBranchTagHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoEditHandler Member List

This is the complete list of members for KoEditHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoEditHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoEditHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoReservedEditHandler Member List

This is the complete list of members for KoReservedEditHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoReservedEditHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoReservedEditHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoForceEditHandler Member List

This is the complete list of members for KoForceEditHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoForceEditHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoForceEditHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoUneditHandler Member List

This is the complete list of members for KoUneditHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoUneditHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoUneditHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoReleaseHandler Member List

This is the complete list of members for KoReleaseHandler, including all inherited members.
OnFiles(MultiFiles *) | KoReleaseHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoReleaseHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoWatchersHandler Member List

This is the complete list of members for KoWatchersHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoWatchersHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoWatchersHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoEditorsHandler Member List

This is the complete list of members for KoEditorsHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoEditorsHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoEditorsHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoWatchOnHandler Member List

This is the complete list of members for KoWatchOnHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoWatchOnHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoWatchOnHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoWatchOffHandler Member List

This is the complete list of members for KoWatchOffHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoWatchOffHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoWatchOffHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoDiffHandler Member List

This is the complete list of members for KoDiffHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoDiffHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoDiffHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoLogHandler Member List

This is the complete list of members for KoLogHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoLogHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoLogHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoGraphHandler Member List

This is the complete list of members for KoGraphHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoGraphHandler | [inline, private, virtual]
OnFolder(const char *) | KoGraphHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoStatusHandler Member List

This is the complete list of members for KoStatusHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoStatusHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoStatusHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoFileRemoveHandler Member List

This is the complete list of members for KoFileRemoveHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoFileRemoveHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoFileRemoveHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoLockHandler Member List

This is the complete list of members for KoLockHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoLockHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoLockHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoUnlockHandler Member List

This is the complete list of members for KoUnlockHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoUnlockHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoUnlockHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoAddHandler Member List

This is the complete list of members for KoAddHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoAddHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoAddHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoAddBinaryHandler Member List

This is the complete list of members for KoAddBinaryHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoAddBinaryHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoAddBinaryHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoAddUnicodeHandler Member List

This is the complete list of members for KoAddUnicodeHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoAddUnicodeHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoAddUnicodeHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoCommitHandler Member List

This is the complete list of members for KoCommitHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoCommitHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoCommitHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoUpdateHandler Member List

This is the complete list of members for KoUpdateHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoUpdateHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoUpdateHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoQueryUpdateHandler Member List

This is the complete list of members for KoQueryUpdateHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoQueryUpdateHandler | [inline, private, virtual]
OnFolder(const char *fullpath) | KoQueryUpdateHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoAnnotateHandler Member List

This is the complete list of members for KoAnnotateHandler, including all inherited members.
OnFiles(MultiFiles *pmf) | KoAnnotateHandler | [inline, private, virtual]
OnFolder(const char *) | KoAnnotateHandler | [inline, private, virtual]
Generated on Sun Feb 24 01:26:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

NotificationManager Member List

This is the complete list of members for NotificationManager, including all inherited members.
CheckIn(CObject *observer, FNOBSERVER handler) | NotificationManager | [inline]
CheckOut(CObject *observer) | NotificationManager | [inline]
m_nodes | NotificationManager | [private]
NotificationManager() | NotificationManager | [inline]
NotifyAll() | NotificationManager | [inline]
Generated on Sun Feb 24 01:27:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

NotificationManager::Node Member List

This is the complete list of members for NotificationManager::Node, including all inherited members.
handler | NotificationManager::Node |
Node() | NotificationManager::Node | [inline]
Node(CObject *o, FNOBSERVER h) | NotificationManager::Node | [inline]
Node(const Node &n) | NotificationManager::Node | [inline]
observer | NotificationManager::Node |
operator=(const Node &n) | NotificationManager::Node | [inline]
Generated on Sun Feb 24 01:27:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KiFilterModel Member List

This is the complete list of members for KiFilterModel, including all inherited members.
GetNotificationManager()=0 | KiFilterModel | [pure virtual]
IsMatch(EntnodeData *data)=0 | KiFilterModel | [pure virtual]
Generated on Sun Feb 24 01:26:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KiRecursionModel Member List

This is the complete list of members for KiRecursionModel, including all inherited members.
GetNotificationManager()=0 | KiRecursionModel | [pure virtual]
IsShowRecursive()=0 | KiRecursionModel | [pure virtual]
Generated on Sun Feb 24 01:26:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KiIgnoreModel Member List

This is the complete list of members for KiIgnoreModel, including all inherited members.
GetNotificationManager()=0 | KiIgnoreModel | [pure virtual]
IsShowIgnored()=0 | KiIgnoreModel | [pure virtual]
Generated on Sun Feb 24 01:26:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoFilterModel Member List

This is the complete list of members for KoFilterModel, including all inherited members.
GetNotificationManager() | KoFilterModel | [virtual]
IsAdded() const | KoFilterModel | [inline]
IsChanged() const | KoFilterModel | [inline]
IsConflict() const | KoFilterModel | [inline]
IsDefaultMode() const | KoFilterModel |
IsHideUnknown() const | KoFilterModel | [inline]
IsMatch(EntnodeData *data) | KoFilterModel | [virtual]
IsMissing() const | KoFilterModel | [inline]
IsModified() const | KoFilterModel |
IsRemoved() const | KoFilterModel | [inline]
IsUnknown() const | KoFilterModel | [inline]
KoFilterModel() | KoFilterModel |
m_isAdded | KoFilterModel | [protected]
m_isChanged | KoFilterModel | [protected]
m_isConflicts | KoFilterModel | [protected]
m_isHideUnknown | KoFilterModel | [protected]
m_isMissing | KoFilterModel | [protected]
m_isRemoved | KoFilterModel | [protected]
m_isUnknown | KoFilterModel | [protected]
m_manager | KoFilterModel | [protected]
m_mask | KoFilterModel | [protected]
m_match | KoFilterModel | [protected]
SetMask(const char *mask) | KoFilterModel |
ToggleAdded() | KoFilterModel | [inline]
ToggleChanged() | KoFilterModel | [inline]
ToggleConflict() | KoFilterModel | [inline]
ToggleHideUnknown() | KoFilterModel |
ToggleMissing() | KoFilterModel | [inline]
ToggleModified() | KoFilterModel |
ToggleRemoved() | KoFilterModel | [inline]
ToggleUnknown() | KoFilterModel |
~KoFilterModel() | KoFilterModel |
Generated on Sun Feb 24 01:26:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoRecursionModel Member List

This is the complete list of members for KoRecursionModel, including all inherited members.
GetNotificationManager() | KoRecursionModel | [virtual]
IsShowRecursive() | KoRecursionModel | [virtual]
KoRecursionModel() | KoRecursionModel |
m_isRecursive | KoRecursionModel | [private]
m_manager | KoRecursionModel | [private]
ToggleRecursion() | KoRecursionModel |
~KoRecursionModel() | KoRecursionModel |
Generated on Sun Feb 24 01:26:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoIgnoreModel Member List

This is the complete list of members for KoIgnoreModel, including all inherited members.
GetNotificationManager() | KoIgnoreModel | [virtual]
IsShowIgnored() | KoIgnoreModel | [virtual]
KoIgnoreModel() | KoIgnoreModel |
m_isIgnore | KoIgnoreModel | [private]
m_manager | KoIgnoreModel | [private]
ToggleIgnore() | KoIgnoreModel |
~KoIgnoreModel() | KoIgnoreModel |
Generated on Sun Feb 24 01:26:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCheckout_MAIN Member List

This is the complete list of members for CCheckout_MAIN, including all inherited members.
CCheckout_MAIN() | CCheckout_MAIN |
CCheckout_MAIN(const char *modname, const char *path) | CCheckout_MAIN |
DoDataExchange(CDataExchange *pDX) | CCheckout_MAIN | [protected, virtual]
IDD enum value | CCheckout_MAIN |
m_checkoutDir | CCheckout_MAIN |
m_editPath | CCheckout_MAIN |
m_moduleCombo | CCheckout_MAIN |
m_moduleName | CCheckout_MAIN |
m_noRecurse | CCheckout_MAIN |
m_overrideCheckoutDir | CCheckout_MAIN |
m_path | CCheckout_MAIN |
m_stdout | CCheckout_MAIN |
OnBtnPath() | CCheckout_MAIN | [protected]
OnCheckOverridecheckoutdir() | CCheckout_MAIN | [protected]
~CCheckout_MAIN() | CCheckout_MAIN |
Generated on Sun Feb 24 01:24:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCheckout_OPTIONS Member List

This is the complete list of members for CCheckout_OPTIONS, including all inherited members.
CCheckout_OPTIONS(const char *rev, const char *date) | CCheckout_OPTIONS |
CCheckout_OPTIONS() | CCheckout_OPTIONS |
DoDataExchange(CDataExchange *pDX) | CCheckout_OPTIONS | [protected, virtual]
IDD enum value | CCheckout_OPTIONS |
m_date | CCheckout_OPTIONS |
m_dateCombo | CCheckout_OPTIONS |
m_export | CCheckout_OPTIONS |
m_forceRoot | CCheckout_OPTIONS |
m_hasDate | CCheckout_OPTIONS |
m_hasRev | CCheckout_OPTIONS |
m_match | CCheckout_OPTIONS |
m_rev | CCheckout_OPTIONS |
m_revCombo | CCheckout_OPTIONS |
OnDate() | CCheckout_OPTIONS | [protected]
OnRev() | CCheckout_OPTIONS | [protected]
~CCheckout_OPTIONS() | CCheckout_OPTIONS |
Generated on Sun Feb 24 01:24:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCommit_MAIN Member List

This is the complete list of members for CCommit_MAIN, including all inherited members.
CCommit_MAIN() | CCommit_MAIN |
CCommit_MAIN(const char *logMsg, const char *pathTmpl=0L, MultiFiles *mf=0L) | CCommit_MAIN |
DoDataExchange(CDataExchange *pDX) | CCommit_MAIN | [protected, virtual]
GetLogMsgID() | CCommit_MAIN | [private]
GetLogMsgWnd() | CCommit_MAIN | [private]
IDD enum value | CCommit_MAIN |
m_bSwitchingWrap | CCommit_MAIN | [private]
m_fileToDiffCombo | CCommit_MAIN |
m_logMsg | CCommit_MAIN |
m_logMsgCtrl | CCommit_MAIN |
m_logMsgCtrlWrap | CCommit_MAIN |
m_pmfarg | CCommit_MAIN |
m_previewInfo | CCommit_MAIN |
m_prevLogsCombo | CCommit_MAIN |
m_tmplPath | CCommit_MAIN |
m_wordWrap | CCommit_MAIN |
m_wordWrapCtrl | CCommit_MAIN |
OnDiff() | CCommit_MAIN | [protected]
OnEraseBkgnd(CDC *pDC) | CCommit_MAIN | [protected]
OnInitDialog() | CCommit_MAIN | [protected, virtual]
OnLauncheditor() | CCommit_MAIN | [protected]
OnSelchangeCombo() | CCommit_MAIN | [protected]
OnSelchangeFiletodiff() | CCommit_MAIN | [protected]
OnTemplate() | CCommit_MAIN | [protected]
OnWordwrap() | CCommit_MAIN | [protected]
PreTranslateMessage(MSG *pMsg) | CCommit_MAIN | [virtual]
SwitchWrapEdit(BOOL bWordWrap) | CCommit_MAIN | [private]
UpdateInfo() | CCommit_MAIN | [private]
UpdatePreviewInfo() | CCommit_MAIN | [private]
~CCommit_MAIN() | CCommit_MAIN |
Generated on Sun Feb 24 01:25:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCommit_OPTIONS Member List

This is the complete list of members for CCommit_OPTIONS, including all inherited members.
CCommit_OPTIONS() | CCommit_OPTIONS |
DoDataExchange(CDataExchange *pDX) | CCommit_OPTIONS | [protected, virtual]
IDD enum value | CCommit_OPTIONS |
m_checkValidEdits | CCommit_OPTIONS |
m_forceCommit | CCommit_OPTIONS |
m_forceRecurse | CCommit_OPTIONS |
m_forceRevision | CCommit_OPTIONS |
m_noModuleProgram | CCommit_OPTIONS |
m_noRecurse | CCommit_OPTIONS |
m_rev | CCommit_OPTIONS |
m_revCombo | CCommit_OPTIONS |
OnForcerevision() | CCommit_OPTIONS | [protected]
~CCommit_OPTIONS() | CCommit_OPTIONS |
Generated on Sun Feb 24 01:25:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

PCPStr Member List

This is the complete list of members for PCPStr, including all inherited members.
_GetBaseClass() | PCPStr | [protected, static]
c_str() const | UPStr | [inline]
classCPersistent | CPersistent | [protected, static]
classPCPStr | PCPStr | [protected, static]
classUObject | UObject | [protected, static]
CPersistent(const char *uniqueName, kClassPersistent pclass) | CPersistent |
CreateObject(const char *className) | UObject | [static]
empty(void) const | UPStr | [inline]
endsWith(char c) const | UPStr | [inline]
fAllEntries | CPersistent | [protected, static]
Find(const char *uniqueName) | CPersistent | [static]
flush(void) | UPStr | [protected]
fTimeStamp | CPersistent | [protected]
GetData(void) const | PCPStr | [inline, virtual]
GetRuntimeClass() const | PCPStr | [virtual]
GetTimeStamp() const | CPersistent | [inline]
IsKindOf(const URuntimeClass *pClass) const | UObject |
length(void) const | UPStr | [inline]
LoadAll(void) | CPersistent | [static]
NeedSave(bool onlySettings=false) | CPersistent | [static]
operator char *() | PCPStr | [inline]
operator const char *() const | PCPStr | [inline]
operator const unsigned char *() const | PCPStr | [inline]
operator unsigned char *() | PCPStr | [inline]
operator<<(const char *addToStr) | UPStr |
operator<<(char addToStr) | UPStr |
operator<<(int addToStr) | UPStr |
operator=(const char *newstr) | PCPStr | [inline]
operator=(const unsigned char *newstr) | PCPStr | [inline]
UPStr::operator=(const UPStr &newstr) | UPStr |
p_str() const | UPStr | [inline]
PCPStr(const char *uniqueName, const char *defValue=0L, kClassPersistent pclass=kNoClass) | PCPStr | [inline]
replace(char which, char bywhich) | UPStr |
ResetTimeStamp() | CPersistent | [inline]
rtCPersistent(void) | CPersistent | [static]
rtPCPStr(void) | PCPStr | [static]
rtUObject() | UObject | [static]
SaveAll(void) | CPersistent | [static]
SaveAllSettings(const char *settingFileName, const char *forPath) | CPersistent | [static]
set(const char *buf, unsigned int len) | UPStr |
SetData(const void *ptr, unsigned int size) | PCPStr | [inline, virtual]
SizeOf(void) const | PCPStr | [inline, virtual]
str | UPStr | [protected]
TouchTimeStamp() | CPersistent | [inline]
UObject() | UObject | [inline, protected]
UPStr() | UPStr | [inline]
UPStr(const char *newstr) | UPStr | [inline]
UPStr(const unsigned char *newstr) | UPStr | [inline]
UPStr(const UPStr &newstr) | UPStr | [inline]
~CPersistent() | CPersistent | [virtual]
~PCPStr() | PCPStr | [inline, virtual]
~UObject() | UObject | [inline, virtual]
~UPStr() | UPStr | [inline, virtual]
Generated on Sun Feb 24 01:27:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

PCStr Member List

This is the complete list of members for PCStr, including all inherited members.
_GetBaseClass() | PCStr | [protected, static]
c_str() const | UStr | [inline]
classCPersistent | CPersistent | [protected, static]
classPCStr | PCStr | [protected, static]
classUObject | UObject | [protected, static]
compare(const char *thestr) const | UStr | [inline]
CPersistent(const char *uniqueName, kClassPersistent pclass) | CPersistent |
CreateObject(const char *className) | UObject | [static]
empty(void) const | UStr | [inline]
endsWith(char c) const | UStr | [inline]
fAllEntries | CPersistent | [protected, static]
Find(const char *uniqueName) | CPersistent | [static]
flush(void) | UStr | [protected]
fTimeStamp | CPersistent | [protected]
GetData(void) const | PCStr | [inline, virtual]
GetRuntimeClass() const | PCStr | [virtual]
GetTimeStamp() const | CPersistent | [inline]
IsKindOf(const URuntimeClass *pClass) const | UObject |
length(void) const | UStr | [inline]
LoadAll(void) | CPersistent | [static]
NeedSave(bool onlySettings=false) | CPersistent | [static]
operator char *() | PCStr | [inline]
operator const char *() const | PCStr | [inline]
operator!=(const UStr &str) const | UStr |
operator!=(const char *str) const | UStr |
operator<(const UStr &str) const | UStr |
operator<<(const char *addToStr) | UStr |
operator<<(char addToStr) | UStr |
operator<<(int addToStr) | UStr |
operator=(const char *newstr) | PCStr | [inline]
operator=(const unsigned char *newstr) | PCStr | [inline]
UStr::operator=(const UStr &newstr) | UStr |
operator==(const UStr &str) const | UStr |
operator==(const char *str) const | UStr |
operator>(const UStr &str) const | UStr |
PCStr(const char *uniqueName, const char *defValue=0L, kClassPersistent pclass=kNoClass) | PCStr | [inline]
replace(char which, char bywhich) | UStr |
ResetTimeStamp() | CPersistent | [inline]
rtCPersistent(void) | CPersistent | [static]
rtPCStr(void) | PCStr | [static]
rtUObject() | UObject | [static]
SaveAll(void) | CPersistent | [static]
SaveAllSettings(const char *settingFileName, const char *forPath) | CPersistent | [static]
set(const char *buf, unsigned int len) | UStr |
SetData(const void *ptr, unsigned int size) | PCStr | [inline, virtual]
SizeOf(void) const | PCStr | [inline, virtual]
str | UStr | [protected]
TouchTimeStamp() | CPersistent | [inline]
UObject() | UObject | [inline, protected]
UStr() | UStr | [inline]
UStr(const char *newstr) | UStr | [inline]
UStr(const unsigned char *newstr) | UStr | [inline]
UStr(const UStr &newstr) | UStr | [inline]
~CPersistent() | CPersistent | [virtual]
~PCStr() | PCStr | [inline, virtual]
~UObject() | UObject | [inline, virtual]
~UStr() | UStr | [inline, virtual]
Generated on Sun Feb 24 01:27:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CStaticAllocT Member List

This is the complete list of members for CStaticAllocT, including all inherited members.
AdjustSize(size_t size) | CStaticAllocT | [inline]
buf | CStaticAllocT | [protected]
CStaticAllocT() | CStaticAllocT | [inline]
numbuf | CStaticAllocT | [protected]
operator const T *(void) const | CStaticAllocT | [inline]
operator T *(void) const | CStaticAllocT | [inline]
size() const | CStaticAllocT | [inline]
~CStaticAllocT() | CStaticAllocT | [inline]
Generated on Sun Feb 24 01:27:52 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

mircAttrCvt Member List

This is the complete list of members for mircAttrCvt, including all inherited members.
extractcolor(std::string *in, int start, short *fg, short *bg) | mircAttrCvt | [private]
mirc2ctcp(std::string *in) | mircAttrCvt |
mirc2ctcpmap | mircAttrCvt | [private, static]
tokens | mircAttrCvt | [private, static]
Generated on Sun Feb 24 01:26:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

irciiAttrCvt Member List

This is the complete list of members for irciiAttrCvt, including all inherited members.
ircii2ctcp(std::string *in) | irciiAttrCvt |
tokens | irciiAttrCvt | [private, static]
Generated on Sun Feb 24 01:26:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

ansiAttrCvt Member List

This is the complete list of members for ansiAttrCvt, including all inherited members.
_in | ansiAttrCvt | [private]
_seq | ansiAttrCvt | [private]
ansi2ctcp(std::string *in) | ansiAttrCvt |
bgColorMap | ansiAttrCvt | [private, static]
blink | ansiAttrCvt | [private]
bold | ansiAttrCvt | [private]
do_C() | ansiAttrCvt | [private]
do_m() | ansiAttrCvt | [private]
escSeq | ansiAttrCvt | [private, static]
fgColorMap | ansiAttrCvt | [private, static]
italic | ansiAttrCvt | [private]
pos | ansiAttrCvt | [private]
reverse | ansiAttrCvt | [private]
underline | ansiAttrCvt | [private]
Generated on Sun Feb 24 01:24:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

ansiAttrCvt::AnsiSeq Member List

This is the complete list of members for ansiAttrCvt::AnsiSeq, including all inherited members.
_notOf | ansiAttrCvt::AnsiSeq | [private, static]
_params | ansiAttrCvt::AnsiSeq | [private]
_seq | ansiAttrCvt::AnsiSeq | [private]
_verb | ansiAttrCvt::AnsiSeq | [private]
AnsiSeq(std::string *in, int pos) | ansiAttrCvt::AnsiSeq |
param(int index) | ansiAttrCvt::AnsiSeq | [inline]
paramc() | ansiAttrCvt::AnsiSeq | [inline]
seq() | ansiAttrCvt::AnsiSeq | [inline]
verb() | ansiAttrCvt::AnsiSeq | [inline]
~AnsiSeq() | ansiAttrCvt::AnsiSeq |
Generated on Sun Feb 24 01:24:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CTCP2Parse Member List

This is the complete list of members for CTCP2Parse, including all inherited members.
ansi2ctcp(std::string *in) | ansiAttrCvt | [private]
bg | CTCP2Parse | [private]
bgDef | CTCP2Parse | [private]
bgLast | CTCP2Parse | [private]
Black enum value | CTCP2Parse | [protected]
blinkCnt | CTCP2Parse | [private]
blinkLast | CTCP2Parse | [private]
Blue enum value | CTCP2Parse | [protected]
boldCnt | CTCP2Parse | [private]
boldLast | CTCP2Parse | [private]
CharSpacingType enum name | CTCP2Parse | [protected]
ColorType enum name | CTCP2Parse | [protected]
cp | CTCP2Parse | [private]
cpDef | CTCP2Parse | [private]
cpLast | CTCP2Parse | [private]
CTCP2Parse() | CTCP2Parse | [protected]
Cyan enum value | CTCP2Parse | [protected]
decodeColor(std::string *line, int *parseFrmChar, int *parseEndChar, RGBColor *c) | CTCP2Parse | [inline, private]
decodeToggle(std::string *line, int *parseFrmChar, int *parseEndChar, int *varCnt) | CTCP2Parse | [inline, private]
enc | CTCP2Parse | [private]
encDef | CTCP2Parse | [private]
encLast | CTCP2Parse | [private]
EncodingType enum name | CTCP2Parse | [protected]
fg | CTCP2Parse | [private]
fgDef | CTCP2Parse | [private]
fgLast | CTCP2Parse | [private]
Fixed enum value | CTCP2Parse | [protected]
fntLast | CTCP2Parse | [private]
fntSize | CTCP2Parse | [private]
fromHex(unsigned char h, unsigned char *val) | CTCP2Parse | [inline, private]
Green enum value | CTCP2Parse | [protected]
Grey enum value | CTCP2Parse | [protected]
indexColor | CTCP2Parse | [private, static]
ircii2ctcp(std::string *in) | irciiAttrCvt | [private]
iso8859_1 enum value | CTCP2Parse | [protected]
iso8859_2 enum value | CTCP2Parse | [protected]
iso8859_3 enum value | CTCP2Parse | [protected]
iso8859_4 enum value | CTCP2Parse | [protected]
iso8859_5 enum value | CTCP2Parse | [protected]
iso8859_6 enum value | CTCP2Parse | [protected]
iso8859_7 enum value | CTCP2Parse | [protected]
iso8859_8 enum value | CTCP2Parse | [protected]
iso8859_9 enum value | CTCP2Parse | [protected]
italicCnt | CTCP2Parse | [private]
italicLast | CTCP2Parse | [private]
Lt_Blue enum value | CTCP2Parse | [protected]
Lt_Cyan enum value | CTCP2Parse | [protected]
Lt_Green enum value | CTCP2Parse | [protected]
Lt_Grey enum value | CTCP2Parse | [protected]
Lt_Magenta enum value | CTCP2Parse | [protected]
Lt_Red enum value | CTCP2Parse | [protected]
Lt_Yellow enum value | CTCP2Parse | [protected]
Magenta enum value | CTCP2Parse | [protected]
mirc2ctcp(std::string *in) | mircAttrCvt | [protected]
overCnt | CTCP2Parse | [private]
overLast | CTCP2Parse | [private]
ParseIt(std::string *line) | CTCP2Parse | [protected]
Proportional enum value | CTCP2Parse | [protected]
PushBackgroundColor(unsigned char R, unsigned char G, unsigned char B)=0 | CTCP2Parse | [protected, pure virtual]
PushBlink(bool)=0 | CTCP2Parse | [protected, pure virtual]
PushBold(bool)=0 | CTCP2Parse | [protected, pure virtual]
PushEncoding(EncodingType)=0 | CTCP2Parse | [protected, pure virtual]
PushFontSize(int)=0 | CTCP2Parse | [protected, pure virtual]
PushForegroundColor(unsigned char R, unsigned char G, unsigned char B)=0 | CTCP2Parse | [protected, pure virtual]
PushItalic(bool)=0 | CTCP2Parse | [protected, pure virtual]
PushOut(void) | CTCP2Parse | [inline, private]
PushOverstrike(bool)=0 | CTCP2Parse | [protected, pure virtual]
PushReverse(bool)=0 | CTCP2Parse | [protected, pure virtual]
PushSpacing(CharSpacingType)=0 | CTCP2Parse | [protected, pure virtual]
PushStart()=0 | CTCP2Parse | [protected, pure virtual]
PushTextSegment(std::string *)=0 | CTCP2Parse | [protected, pure virtual]
PushUnderline(bool)=0 | CTCP2Parse | [protected, pure virtual]
PushURL(bool)=0 | CTCP2Parse | [protected, pure virtual]
Red enum value | CTCP2Parse | [protected]
revCnt | CTCP2Parse | [private]
revLast | CTCP2Parse | [private]
segment | CTCP2Parse | [private]
SetDefaults(unsigned char fgR=(unsigned char)((Lt_Grey &0xFF0000) >> 16), unsigned char fgG=(unsigned char)((Lt_Grey &0x00FF00) >> 8), unsigned char fgB=(unsigned char)(Lt_Grey &0x0000FF), unsigned char bgR=(unsigned char)((Black &0xFF0000) >> 16), unsigned char bgG=(unsigned char)((Black &0x00FF00) >> 8), unsigned char bgB=(unsigned char)(Black &0x0000FF), CharSpacingType cpDef_=Fixed, EncodingType encDef_=iso8859_1) | CTCP2Parse | [protected]
underCnt | CTCP2Parse | [private]
underLast | CTCP2Parse | [private]
urlCnt | CTCP2Parse | [private]
urlLast | CTCP2Parse | [private]
UTF_8 enum value | CTCP2Parse | [protected]
White enum value | CTCP2Parse | [protected]
Yellow enum value | CTCP2Parse | [protected]
Generated on Sun Feb 24 01:28:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CTCP2Parse::RGBColor Member List

This is the complete list of members for CTCP2Parse::RGBColor, including all inherited members.
B | CTCP2Parse::RGBColor
G | CTCP2Parse::RGBColor
nul_void_ignore | CTCP2Parse::RGBColor
R | CTCP2Parse::RGBColor
RGB | CTCP2Parse::RGBColor
Generated on Sun Feb 24 01:28:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCVSAlert Member List

This is the complete list of members for CCVSAlert, including all inherited members.
CCVSAlert(const char *prompt, const char *defhit, const char *cnclhit, CWnd *pParent=NULL) | CCVSAlert |
DoDataExchange(CDataExchange *pDX) | CCVSAlert | [protected, virtual]
IDD enum value | CCVSAlert |
m_cnclhit | CCVSAlert |
m_defhit | CCVSAlert |
m_prompt | CCVSAlert |
Generated on Sun Feb 24 01:25:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CvsArgs Member List

This is the complete list of members for CvsArgs, including all inherited members.
add(const char *arg) | CvsArgs | [virtual]
addfile(const char *arg, const char *dir=0L, const FSSpec *spec=0L) | CvsArgs | [virtual]
argc | CvsArgs | [protected]
Argc(void) const | CvsArgs | [inline]
Argv(void) const | CvsArgs | [inline]
argv | CvsArgs | [protected]
CvsArgs(bool defargs=true) | CvsArgs |
CvsArgs(char *const *fromargv, int fromargc) | CvsArgs |
print(const char *indirectory=0L) | CvsArgs |
reset(bool defargs=true) | CvsArgs |
~CvsArgs() | CvsArgs | [virtual]
Generated on Sun Feb 24 01:28:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

ControlCvsArgs Member List

This is the complete list of members for ControlCvsArgs, including all inherited members.
add(const char *arg) | CvsArgs | [virtual]
addfile(const char *arg, const char *dir=0L, const FSSpec *spec=0L) | ControlCvsArgs | [virtual]
argc | CvsArgs | [protected]
Argc(void) const | CvsArgs | [inline]
argv | CvsArgs | [protected]
Argv(void) const | CvsArgs | [inline]
ControlCvsArgs() | ControlCvsArgs | [inline]
CvsArgs(bool defargs=true) | CvsArgs |
CvsArgs(char *const *fromargv, int fromargc) | CvsArgs |
FileIsType(const char *arg, const char *dir, const FSSpec *spec=0L)=0 | ControlCvsArgs | [protected, pure virtual]
HasProblem(void) const | ControlCvsArgs | [inline]
m_gotProblem | ControlCvsArgs | [private]
print(const char *indirectory=0L) | CvsArgs |
reset(bool defargs=true) | CvsArgs |
SetProblem(bool newState) | ControlCvsArgs | [inline]
TypeDesc()=0 | ControlCvsArgs | [protected, pure virtual]
~CvsArgs() | CvsArgs | [virtual]
Generated on Sun Feb 24 01:27:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

AddCvsArgs Member List

This is the complete list of members for AddCvsArgs, including all inherited members.
add(const char *arg) | CvsArgs | [virtual]
addfile(const char *arg, const char *dir=0L, const FSSpec *spec=0L) | ControlCvsArgs | [virtual]
argc | CvsArgs | [protected]
Argc(void) const | CvsArgs | [inline]
argv | CvsArgs | [protected]
Argv(void) const | CvsArgs | [inline]
ControlCvsArgs() | ControlCvsArgs | [inline]
CvsArgs(bool defargs=true) | CvsArgs |
CvsArgs(char *const *fromargv, int fromargc) | CvsArgs |
FileIsType(const char *arg, const char *dir, const FSSpec *spec=0L) | AddCvsArgs | [inline, protected, virtual]
HasProblem(void) const | ControlCvsArgs | [inline]
print(const char *indirectory=0L) | CvsArgs |
reset(bool defargs=true) | CvsArgs |
SetProblem(bool newState) | ControlCvsArgs | [inline]
TypeDesc() | AddCvsArgs | [inline, protected, virtual]
~CvsArgs() | CvsArgs | [virtual]
Generated on Sun Feb 24 01:24:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

AddBinCvsArgs Member List

This is the complete list of members for AddBinCvsArgs, including all inherited members.
add(const char *arg) | CvsArgs | [virtual]
addfile(const char *arg, const char *dir=0L, const FSSpec *spec=0L) | ControlCvsArgs | [virtual]
argc | CvsArgs | [protected]
Argc(void) const | CvsArgs | [inline]
argv | CvsArgs | [protected]
Argv(void) const | CvsArgs | [inline]
ControlCvsArgs() | ControlCvsArgs | [inline]
CvsArgs(bool defargs=true) | CvsArgs |
CvsArgs(char *const *fromargv, int fromargc) | CvsArgs |
FileIsType(const char *arg, const char *dir, const FSSpec *spec=0L) | AddBinCvsArgs | [inline, protected, virtual]
HasProblem(void) const | ControlCvsArgs | [inline]
print(const char *indirectory=0L) | CvsArgs |
reset(bool defargs=true) | CvsArgs |
SetProblem(bool newState) | ControlCvsArgs | [inline]
TypeDesc() | AddBinCvsArgs | [inline, protected, virtual]
~CvsArgs() | CvsArgs | [virtual]
Generated on Sun Feb 24 01:24:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

AddUnicodeCvsArgs Member List

This is the complete list of members for AddUnicodeCvsArgs, including all inherited members.
add(const char *arg) | CvsArgs | [virtual]
addfile(const char *arg, const char *dir=0L, const FSSpec *spec=0L) | ControlCvsArgs | [virtual]
argc | CvsArgs | [protected]
Argc(void) const | CvsArgs | [inline]
argv | CvsArgs | [protected]
Argv(void) const | CvsArgs | [inline]
ControlCvsArgs() | ControlCvsArgs | [inline]
CvsArgs(bool defargs=true) | CvsArgs |
CvsArgs(char *const *fromargv, int fromargc) | CvsArgs |
FileIsType(const char *arg, const char *dir, const FSSpec *spec=0L) | AddUnicodeCvsArgs | [inline, protected, virtual]
HasProblem(void) const | ControlCvsArgs | [inline]
print(const char *indirectory=0L) | CvsArgs |
reset(bool defargs=true) | CvsArgs |
SetProblem(bool newState) | ControlCvsArgs | [inline]
TypeDesc() | AddUnicodeCvsArgs | [inline, protected, virtual]
~CvsArgs() | CvsArgs | [virtual]
Generated on Sun Feb 24 01:24:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

RemoveCvsArgs Member List

This is the complete list of members for RemoveCvsArgs, including all inherited members.
add(const char *arg) | CvsArgs | [virtual]
addfile(const char *arg, const char *dir=0L, const FSSpec *spec=0L) | RemoveCvsArgs | [virtual]
Argc(void) const | CvsArgs | [inline]
argc | CvsArgs | [protected]
Argv(void) const | CvsArgs | [inline]
argv | CvsArgs | [protected]
CvsArgs(bool defargs=true) | CvsArgs |
CvsArgs(char *const *fromargv, int fromargc) | CvsArgs |
print(const char *indirectory=0L) | CvsArgs |
reset(bool defargs=true) | CvsArgs |
~CvsArgs() | CvsArgs | [virtual]
Generated on Sun Feb 24 01:27:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

EntnodePath Member List

This is the complete list of members for EntnodePath, including all inherited members.
EntnodePath(const char *path) | EntnodePath |
fullpathname | EntnodePath | [protected]
GetFolderPath(void) const | EntnodePath | [inline]
GetFullPathName(UStr &resPath, const char *name) const | EntnodePath |
Ref(void) | EntnodePath | [inline]
ref | EntnodePath | [protected]
UnRef(void) | EntnodePath | [inline]
~EntnodePath() | EntnodePath | [protected]
Generated on Sun Feb 24 01:25:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

EntnodeData Member List

This is the complete list of members for EntnodeData, including all inherited members.
Compare(const EntnodeData &node1, const EntnodeData &node2) | EntnodeData | [inline, static]
desc | EntnodeData | [private]
EntnodeData(const char *name, EntnodePath *path) | EntnodeData | [protected]
fullpathname | EntnodeData | [private]
GetConflict() const | EntnodeData | [inline, virtual]
GetDesc(void) const | EntnodeData | [inline]
GetFolderPath(void) const | EntnodeData | [inline]
GetFullPathName(UStr &resPath) const | EntnodeData | [inline]
GetName(void) const | EntnodeData | [inline]
GetType(void) const=0 | EntnodeData | [pure virtual]
ignored | EntnodeData | [protected]
IsIgnored(void) const | EntnodeData | [inline]
IsLocked(void) const | EntnodeData | [inline]
IsMissing(void) const | EntnodeData | [inline]
IsRemoved(void) const | EntnodeData | [inline]
IsUnknown(void) const | EntnodeData | [inline]
IsUnmodified(void) const | EntnodeData | [inline]
IsVisited(void) const | EntnodeData | [inline]
kName enum value | EntnodeData |
kPath enum value | EntnodeData |
kStatus enum value | EntnodeData |
locked | EntnodeData | [protected]
missing | EntnodeData | [protected]
operator[](int index) const | EntnodeData | [inline, virtual]
Ref(void) | EntnodeData | [inline]
ref | EntnodeData | [protected]
removed | EntnodeData | [protected]
sbuffer | EntnodeData | [private, static]
SetDesc(const char *newdesc) | EntnodeData |
SetIgnored(bool state) | EntnodeData | [inline]
SetLocked(bool state) | EntnodeData | [inline]
SetMissing(bool state) | EntnodeData | [inline]
SetRemoved(bool state) | EntnodeData | [inline]
SetUnknown(bool state) | EntnodeData | [inline]
SetUnmodified(bool state) | EntnodeData | [inline]
SetVisited(bool state) | EntnodeData | [inline]
unknown | EntnodeData | [protected]
unmodified | EntnodeData | [protected]
UnRef(void) | EntnodeData | [inline]
user | EntnodeData | [private]
visited | EntnodeData | [protected]
~EntnodeData() | EntnodeData | [protected, virtual]
Generated on Sun Feb 24 01:25:53 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

EntnodeFile Member List

This is the complete list of members for EntnodeFile, including all inherited members.
Compare(const EntnodeData &node1, const EntnodeData &node2) | EntnodeData | [inline, static]
date | EntnodeFile | [protected]
EntnodeData(const char *name, EntnodePath *path) | EntnodeData | [protected]
EntnodeFile(const char *name, EntnodePath *path, const char *newvn=0L, const char *newts=0L, const char *newoptions=0L, const char *newtag=0L, const char *newdate=0L, const char *newts_conflict=0L) | EntnodeFile |
GetConflict() const | EntnodeFile | [inline, virtual]
GetDesc(void) const | EntnodeData | [inline]
GetFolderPath(void) const | EntnodeData | [inline]
GetFullPathName(UStr &resPath) const | EntnodeData | [inline]
GetName(void) const | EntnodeData | [inline]
GetType(void) const | EntnodeFile | [inline, virtual]
ignored | EntnodeData | [protected]
IsIgnored(void) const | EntnodeData | [inline]
IsLocked(void) const | EntnodeData | [inline]
IsMissing(void) const | EntnodeData | [inline]
IsRemoved(void) const | EntnodeData | [inline]
IsUnknown(void) const | EntnodeData | [inline]
IsUnmodified(void) const | EntnodeData | [inline]
IsVisited(void) const | EntnodeData | [inline]
kConflict enum value | EntnodeFile |
kName enum value | EntnodeData |
kOption enum value | EntnodeFile |
kPath enum value | EntnodeData |
kStatus enum value | EntnodeData |
kTag enum value | EntnodeFile |
kTS enum value | EntnodeFile |
kVN enum value | EntnodeFile |
locked | EntnodeData | [protected]
missing | EntnodeData | [protected]
operator[](int index) const | EntnodeFile | [inline, virtual]
option | EntnodeFile | [protected]
ref | EntnodeData | [protected]
Ref(void) | EntnodeData | [inline]
removed | EntnodeData | [protected]
SetDesc(const char *newdesc) | EntnodeData |
SetIgnored(bool state) | EntnodeData | [inline]
SetLocked(bool state) | EntnodeData | [inline]
SetMissing(bool state) | EntnodeData | [inline]
SetRemoved(bool state) | EntnodeData | [inline]
SetUnknown(bool state) | EntnodeData | [inline]
SetUnmodified(bool state) | EntnodeData | [inline]
SetVisited(bool state) | EntnodeData | [inline]
tag | EntnodeFile | [protected]
ts | EntnodeFile | [protected]
ts_conflict | EntnodeFile | [protected]
unknown | EntnodeData | [protected]
unmodified | EntnodeData | [protected]
UnRef(void) | EntnodeData | [inline]
visited | EntnodeData | [protected]
vn | EntnodeFile | [protected]
~EntnodeData() | EntnodeData | [protected, virtual]
~EntnodeFile() | EntnodeFile | [protected, virtual]
Generated on Sun Feb 24 01:25:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

EntnodeFolder Member List

This is the complete list of members for EntnodeFolder, including all inherited members.
Compare(const EntnodeData &node1, const EntnodeData &node2) | EntnodeData | [inline, static]
EntnodeData(const char *name, EntnodePath *path) | EntnodeData | [protected]
EntnodeFolder(const char *name, EntnodePath *path, const char *newvn=0L, const char *newts=0L, const char *newoptions=0L, const char *newtag=0L, const char *newdate=0L, const char *newts_conflict=0L) | EntnodeFolder |
GetConflict() const | EntnodeData | [inline, virtual]
GetDesc(void) const | EntnodeData | [inline]
GetFolderPath(void) const | EntnodeData | [inline]
GetFullPathName(UStr &resPath) const | EntnodeData | [inline]
GetName(void) const | EntnodeData | [inline]
GetType(void) const | EntnodeFolder | [inline, virtual]
ignored | EntnodeData | [protected]
IsIgnored(void) const | EntnodeData | [inline]
IsLocked(void) const | EntnodeData | [inline]
IsMissing(void) const | EntnodeData | [inline]
IsRemoved(void) const | EntnodeData | [inline]
IsUnknown(void) const | EntnodeData | [inline]
IsUnmodified(void) const | EntnodeData | [inline]
IsVisited(void) const | EntnodeData | [inline]
kName enum value | EntnodeData |
kPath enum value | EntnodeData |
kStatus enum value | EntnodeData |
locked | EntnodeData | [protected]
missing | EntnodeData | [protected]
operator[](int index) const | EntnodeFolder | [inline, virtual]
ref | EntnodeData | [protected]
Ref(void) | EntnodeData | [inline]
removed | EntnodeData | [protected]
SetDesc(const char *newdesc) | EntnodeData |
SetIgnored(bool state) | EntnodeData | [inline]
SetLocked(bool state) | EntnodeData | [inline]
SetMissing(bool state) | EntnodeData | [inline]
SetRemoved(bool state) | EntnodeData | [inline]
SetUnknown(bool state) | EntnodeData | [inline]
SetUnmodified(bool state) | EntnodeData | [inline]
SetVisited(bool state) | EntnodeData | [inline]
unknown | EntnodeData | [protected]
unmodified | EntnodeData | [protected]
UnRef(void) | EntnodeData | [inline]
visited | EntnodeData | [protected]
~EntnodeData() | EntnodeData | [protected, virtual]
~EntnodeFolder() | EntnodeFolder | [protected, virtual]
Generated on Sun Feb 24 01:25:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

ENTNODE Member List

This is the complete list of members for ENTNODE, including all inherited members.
Compare(const ENTNODE &node1, const ENTNODE &node2) | ENTNODE | [inline, static]
Data() const | ENTNODE | [inline]
ENTNODE() | ENTNODE | [inline]
ENTNODE(EntnodeData *data) | ENTNODE | [inline]
ENTNODE(EntnodeData &data) | ENTNODE | [inline]
ENTNODE(const ENTNODE &anode) | ENTNODE | [inline]
operator EntnodeData *() const | ENTNODE | [inline]
operator=(const ENTNODE &anode) | ENTNODE | [inline]
shareData | ENTNODE | [protected]
~ENTNODE() | ENTNODE | [inline]
Generated on Sun Feb 24 01:25:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CDummyInit Member List

This is the complete list of members for CDummyInit, including all inherited members.
CDummyInit() | CDummyInit | [inline]
m_destroylock | CDummyInit | [static]
m_stacklock | CDummyInit | [static]
~CDummyInit() | CDummyInit | [inline]
Generated on Sun Feb 24 01:25:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CDestroyThreadLock Member List

This is the complete list of members for CDestroyThreadLock, including all inherited members.
CDestroyThreadLock() | CDestroyThreadLock | [inline]
~CDestroyThreadLock() | CDestroyThreadLock | [inline]
Generated on Sun Feb 24 01:25:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CStackThreadLock Member List

This is the complete list of members for CStackThreadLock, including all inherited members.
CStackThreadLock() | CStackThreadLock | [inline]
~CStackThreadLock() | CStackThreadLock | [inline]
Generated on Sun Feb 24 01:27:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CvsProcessCallbacks Member List

This is the complete list of members for CvsProcessCallbacks, including all inherited members.
consoleerr | CvsProcessCallbacks
consoleout | CvsProcessCallbacks
exit | CvsProcessCallbacks
getenv | CvsProcessCallbacks
Generated on Sun Feb 24 01:28:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

_CvsProcess Member List

This is the complete list of members for _CvsProcess, including all inherited members.
argc | _CvsProcess
args | _CvsProcess
callbacks | _CvsProcess
destroy | _CvsProcess
his_read | _CvsProcess
his_write | _CvsProcess
my_read | _CvsProcess
my_write | _CvsProcess
open | _CvsProcess
pid | _CvsProcess
pstderr | _CvsProcess
pstdin | _CvsProcess
pstdout | _CvsProcess
starting | _CvsProcess
threads | _CvsProcess
threadsID | _CvsProcess
write_buffer | _CvsProcess
write_buffer_index | _CvsProcess
Generated on Sun Feb 24 01:24:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

GPT_QUIT Member List

This is the complete list of members for GPT_QUIT, including all inherited members.
code GPT_QUIT
Generated on Sun Feb 24 01:26:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

GPT_GETENV Member List

This is the complete list of members for GPT_GETENV, including all inherited members.
empty | GPT_GETENV
str | GPT_GETENV
Generated on Sun Feb 24 01:26:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

GPT_CONSOLE Member List

This is the complete list of members for GPT_CONSOLE, including all inherited members.
isStderr | GPT_CONSOLE
len | GPT_CONSOLE
str | GPT_CONSOLE
Generated on Sun Feb 24 01:26:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

_WireHandler Member List

This is the complete list of members for _WireHandler, including all inherited members.
destroy_func | _WireHandler
read_func | _WireHandler
type | _WireHandler
write_func | _WireHandler
Generated on Sun Feb 24 01:24:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CAllHandlers Member List

This is the complete list of members for CAllHandlers, including all inherited members.
CAllHandlers() | CAllHandlers | [inline]
wire_ht | CAllHandlers |
~CAllHandlers() | CAllHandlers | [inline]
Generated on Sun Feb 24 01:24:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

_WireMessage Member List

This is the complete list of members for _WireMessage, including all inherited members.
data | _WireMessage
type | _WireMessage
Generated on Sun Feb 24 01:24:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CvsPrefs Member List

This is the complete list of members for CvsPrefs, including all inherited members.
AddControl(void) const | CvsPrefs |
AlwaysUseCvsroot(void) const | CvsPrefs |
Browser(void) const | CvsPrefs |
CheckoutRO(void) const | CvsPrefs |
CvsConsole(void) const | CvsPrefs |
CvsPrefs() | CvsPrefs | [inline]
CvsVersion(void) const | CvsPrefs |
DirtySupport(void) const | CvsPrefs |
empty(void) const | CvsPrefs |
EncryptCommunication(void) const | CvsPrefs |
ExtDiff(void) const | CvsPrefs |
fCvsRunningCounter | CvsPrefs | [protected]
fHasLoggedIn | CvsPrefs | [protected]
fTclFileRunningCounter | CvsPrefs | [protected]
GetUseShell(void) const | CvsPrefs |
HasLoogedIn(void) const | CvsPrefs | [inline]
Helper(void) const | CvsPrefs |
HideCommandDlgAnnotate(void) const | CvsPrefs |
HideCommandDlgDiff(void) const | CvsPrefs |
HideCommandDlgGraph(void) const | CvsPrefs |
HideCommandDlgLog(void) const | CvsPrefs |
HideCommandDlgUpdate(void) const | CvsPrefs |
HideCommandDlgUseShift(void) const | CvsPrefs |
Home(void) const | CvsPrefs |
ICTextOption(void) const | CvsPrefs |
IsCvsRunning(void) const | CvsPrefs |
IsoConvert(void) const | CvsPrefs |
IsTclFileRunning(void) const | CvsPrefs |
KserverPort(void) const | CvsPrefs |
LastWorkingDir(void) const | CvsPrefs |
length(void) const | CvsPrefs |
load(void) | CvsPrefs |
LogoutTimeOut(void) const | CvsPrefs |
MacBinEncoding(void) const | CvsPrefs |
MacLF(void) const | CvsPrefs |
operator const char *() const | CvsPrefs |
operator const unsigned char *() const | CvsPrefs |
operator=(const char *newstr) | CvsPrefs |
operator=(const unsigned char *newstr) | CvsPrefs |
ProxyHost(void) const | CvsPrefs |
ProxyPort(void) const | CvsPrefs |
PruneOption(void) const | CvsPrefs |
PserverPort(void) const | CvsPrefs |
QuietOption(void) const | CvsPrefs |
RhostPort(void) const | CvsPrefs |
RshName(void) const | CvsPrefs |
save(void) | CvsPrefs |
ServerName(void) const | CvsPrefs |
SetAddControl(bool newState) | CvsPrefs |
SetAlwaysUseCvsroot(bool newState) | CvsPrefs |
SetBrowser(const char *newbrowser) | CvsPrefs |
SetCheckoutRO(bool newState) | CvsPrefs |
SetCvsConsole(bool console) | CvsPrefs |
SetCvsRunning(bool launched) | CvsPrefs |
SetCvsVersion(int version) | CvsPrefs |
SetDirtySupport(bool newState) | CvsPrefs |
SetEncryptCommunication(bool newState) | CvsPrefs |
SetExtDiff(const char *newdiff) | CvsPrefs |
SetHasLoogedIn(bool newstate) | CvsPrefs | [inline]
SetHelper(const char *newhelper) | CvsPrefs |
SetHideCommandDlgAnnotate(bool newState) | CvsPrefs |
SetHideCommandDlgDiff(bool newState) | CvsPrefs |
SetHideCommandDlgGraph(bool newState) | CvsPrefs |
SetHideCommandDlgLog(bool newState) | CvsPrefs |
SetHideCommandDlgUpdate(bool newState) | CvsPrefs |
SetHideCommandDlgUseShift(bool newState) | CvsPrefs |
SetHome(const char *newhome) | CvsPrefs |
SetICTextOption(bool newState) | CvsPrefs |
SetIsoConvert(ISO8559 newState) | CvsPrefs |
SetKserverPort(int newState) | CvsPrefs |
SetLastWorkingDir(const char *workdir) | CvsPrefs |
SetLogoutTimeOut(int newTimeout) | CvsPrefs |
SetMacBinEncoding(MACENCODING newState) | CvsPrefs |
SetMacLF(bool useit) | CvsPrefs |
SetProxyHost(const char *newhost) | CvsPrefs |
SetProxyPort(int newport) | CvsPrefs |
SetPruneOption(bool newState) | CvsPrefs |
SetPserverPort(int newState) | CvsPrefs |
SetQuietOption(bool newState) | CvsPrefs |
SetRhostPort(int newState) | CvsPrefs |
SetRshName(const char *newrshname) | CvsPrefs |
SetServerName(const char *newservername) | CvsPrefs |
SetTclFileRunning(bool launched) | CvsPrefs |
SetUnixLF(bool useit) | CvsPrefs |
SetUseAltCvs(bool useit) | CvsPrefs |
SetUseProxy(bool useit) | CvsPrefs |
SetUseShell(SHELL_KIND shell) | CvsPrefs |
SetUseViewerAlways(bool newState) | CvsPrefs |
SetViewer(const char *newviewer) | CvsPrefs |
SetWhichCvs(const char *cvsPath) | CvsPrefs |
SetWordWrapLogMsg(int wordwrap) | CvsPrefs |
SetZ9Option(bool newState) | CvsPrefs |
SetZLevel(int level) | CvsPrefs |
UnixLF(void) const | CvsPrefs |
UseAltCvs(void) const | CvsPrefs |
UseKeyChain(void) const | CvsPrefs |
UseProxy(void) const | CvsPrefs |
UseViewerAlways(void) const | CvsPrefs |
Viewer(void) const | CvsPrefs |
WhichCvs(UStr &path, bool userOnly=false) const | CvsPrefs |
WhichVersion() | CvsPrefs |
WordWrapLogMsg(void) const | CvsPrefs |
Z9Option(void) const | CvsPrefs |
ZLevel(void) const | CvsPrefs |
~CvsPrefs() | CvsPrefs | [inline]
Generated on Sun Feb 24 01:28:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CDiff_MAIN Member List

This is the complete list of members for CDiff_MAIN, including all inherited members.
CDiff_MAIN(const char *rev1, const char *rev2, bool allowExtDiff, bool noWhiteSpace, bool ignoreCare) | CDiff_MAIN |
CDiff_MAIN() | CDiff_MAIN |
DoDataExchange(CDataExchange *pDX) | CDiff_MAIN | [protected, virtual]
IDD enum value | CDiff_MAIN |
m_allowExtDiff | CDiff_MAIN |
m_diff | CDiff_MAIN |
m_extdiff | CDiff_MAIN |
m_extdiffctl | CDiff_MAIN |
m_ignoreCase | CDiff_MAIN |
m_isDate1 | CDiff_MAIN |
m_isDate2 | CDiff_MAIN |
m_norecurs | CDiff_MAIN |
m_noWhiteSpace | CDiff_MAIN |
m_rev1 | CDiff_MAIN |
m_rev1Combo | CDiff_MAIN |
m_rev2 | CDiff_MAIN |
m_rev2Combo | CDiff_MAIN |
OnCheck1() | CDiff_MAIN | [protected]
OnCheck2() | CDiff_MAIN | [protected]
OnDiff1() | CDiff_MAIN | [protected]
OnDiff2() | CDiff_MAIN | [protected]
OnDiff3() | CDiff_MAIN | [protected]
OnExtdiff() | CDiff_MAIN | [protected]
~CDiff_MAIN() | CDiff_MAIN |
Generated on Sun Feb 24 01:25:47 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

_frameRec Member List

This is the complete list of members for _frameRec, including all inherited members.
entry | _frameRec
next | _frameRec
Generated on Sun Feb 24 01:24:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

DYN_LIST Member List

This is the complete list of members for DYN_LIST, including all inherited members.
current | DYN_LIST
defaultnumcells | DYN_LIST
first | DYN_LIST
next | DYN_LIST
numentries | DYN_LIST
sizeofcell | DYN_LIST
totpage | DYN_LIST
Generated on Sun Feb 24 01:25:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

poolRec Member List

This is the complete list of members for poolRec, including all inherited members.
firstentry | poolRec
firstfree | poolRec
pool | poolRec
Generated on Sun Feb 24 01:27:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

garbyRec Member List

This is the complete list of members for garbyRec, including all inherited members.
pools garbyRec
Generated on Sun Feb 24 01:25:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CEditorMonDlg Member List

This is the complete list of members for CEditorMonDlg, including all inherited members.
CEditorMonDlg(CWnd *pParent=NULL) | CEditorMonDlg |
DoDataExchange(CDataExchange *pDX) | CEditorMonDlg | [protected, virtual]
IDD enum value | CEditorMonDlg |
m_hProcess | CEditorMonDlg |
m_tempFile | CEditorMonDlg |
m_timer | CEditorMonDlg | [private]
OnDestroy() | CEditorMonDlg | [protected]
OnInitDialog() | CEditorMonDlg | [protected, virtual]
OnTimer(UINT nIDEvent) | CEditorMonDlg | [protected]
Generated on Sun Feb 24 01:25:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TraversalReport Member List

This is the complete list of members for TraversalReport, including all inherited members.
EnterDirectory(const char *fullpath, const char *dirname, const FSSpec *macspec) | TraversalReport | [inline, virtual]
ExitDirectory(const char *fullpath) | TraversalReport | [inline, virtual]
gRunning | TraversalReport | [static]
OnAlias(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnAnyDevice(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnDirectory(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnError(const char *err, int errcode) | TraversalReport | [inline, virtual]
OnFile(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnIdle(const char *fullpath) | TraversalReport | [inline, virtual]
Generated on Sun Feb 24 01:28:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

option Member List

This is the complete list of members for option, including all inherited members.
flag | option
has_arg | option
name | option
val | option
Generated on Sun Feb 24 01:27:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

GetPassword Member List

This is the complete list of members for GetPassword, including all inherited members.
DoDataExchange(CDataExchange *pDX) | GetPassword | [protected, virtual]
GetPassword(CWnd *pParent=NULL) | GetPassword |
IDD enum value | GetPassword |
m_passwd | GetPassword |
OnInitDialog() | GetPassword | [protected, virtual]
Generated on Sun Feb 24 01:25:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CGetPrefs_CVSROOT Member List

This is the complete list of members for CGetPrefs_CVSROOT, including all inherited members.
CGetPrefs_CVSROOT() | CGetPrefs_CVSROOT |
DoDataExchange(CDataExchange *pDX) | CGetPrefs_CVSROOT | [protected, virtual]
FillFields(void) | CGetPrefs_CVSROOT | [protected]
IDD enum value | CGetPrefs_CVSROOT |
m_authen | CGetPrefs_CVSROOT |
m_authenCombo | CGetPrefs_CVSROOT |
m_cvsconsole | CGetPrefs_CVSROOT |
m_cvsroot | CGetPrefs_CVSROOT |
m_cvsrootCombo | CGetPrefs_CVSROOT |
m_cvsvers | CGetPrefs_CVSROOT |
m_didInteract | CGetPrefs_CVSROOT | [protected]
m_flag | CGetPrefs_CVSROOT | [protected]
m_host | CGetPrefs_CVSROOT |
m_login | CGetPrefs_CVSROOT |
m_path | CGetPrefs_CVSROOT |
m_versCombo | CGetPrefs_CVSROOT |
OnChangeFields(void) | CGetPrefs_CVSROOT | [protected]
OnChangeHost() | CGetPrefs_CVSROOT | [protected]
OnChangeLogin() | CGetPrefs_CVSROOT | [protected]
OnChangePath() | CGetPrefs_CVSROOT | [protected]
OnEditchangeComboroot() | CGetPrefs_CVSROOT | [protected]
OnSelchangeAuthen() | CGetPrefs_CVSROOT | [protected]
OnSelchangeComboroot() | CGetPrefs_CVSROOT | [protected]
OnSettings() | CGetPrefs_CVSROOT | [protected]
StoreValues() | CGetPrefs_CVSROOT |
~CGetPrefs_CVSROOT() | CGetPrefs_CVSROOT |
Generated on Sun Feb 24 01:26:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CGetPrefs_GLOBALS Member List

This is the complete list of members for CGetPrefs_GLOBALS, including all inherited members.
CGetPrefs_GLOBALS() | CGetPrefs_GLOBALS |
DoDataExchange(CDataExchange *pDX) | CGetPrefs_GLOBALS | [protected, virtual]
IDD enum value | CGetPrefs_GLOBALS |
m_alwaysroot | CGetPrefs_GLOBALS |
m_checkoutro | CGetPrefs_GLOBALS |
m_cntladd | CGetPrefs_GLOBALS |
m_didInteract | CGetPrefs_GLOBALS | [protected]
m_dirty | CGetPrefs_GLOBALS |
m_editlogout | CGetPrefs_GLOBALS |
m_logout | CGetPrefs_GLOBALS |
m_prune | CGetPrefs_GLOBALS |
m_quiet | CGetPrefs_GLOBALS |
m_spin | CGetPrefs_GLOBALS |
m_tcpip | CGetPrefs_GLOBALS |
m_unixlf | CGetPrefs_GLOBALS |
m_zlevel | CGetPrefs_GLOBALS |
m_zspin | CGetPrefs_GLOBALS |
OnCheckunixlf() | CGetPrefs_GLOBALS | [protected]
OnInitDialog() | CGetPrefs_GLOBALS | [protected, virtual]
OnLogout() | CGetPrefs_GLOBALS | [protected]
OnTcpip() | CGetPrefs_GLOBALS | [protected]
StoreValues() | CGetPrefs_GLOBALS |
~CGetPrefs_GLOBALS() | CGetPrefs_GLOBALS |
Generated on Sun Feb 24 01:26:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CGetPrefs_WINCVS Member List

This is the complete list of members for CGetPrefs_WINCVS, including all inherited members.
CGetPrefs_WINCVS() | CGetPrefs_WINCVS |
DoDataExchange(CDataExchange *pDX) | CGetPrefs_WINCVS | [protected, virtual]
IDD enum value | CGetPrefs_WINCVS |
m_chkdiff | CGetPrefs_WINCVS |
m_chkUseViewerAlways | CGetPrefs_WINCVS |
m_cvschk | CGetPrefs_WINCVS |
m_cvsprog | CGetPrefs_WINCVS |
m_didInteract | CGetPrefs_WINCVS | [protected]
m_diffprog | CGetPrefs_WINCVS |
m_home | CGetPrefs_WINCVS |
m_viewer | CGetPrefs_WINCVS |
OnAltcvschk() | CGetPrefs_WINCVS | [protected]
OnAltcvssel() | CGetPrefs_WINCVS | [protected]
OnBtnhome() | CGetPrefs_WINCVS | [protected]
OnBtnviewer() | CGetPrefs_WINCVS | [protected]
OnExtdiff() | CGetPrefs_WINCVS | [protected]
OnExtdiffsel() | CGetPrefs_WINCVS | [protected]
StoreValues() | CGetPrefs_WINCVS |
~CGetPrefs_WINCVS() | CGetPrefs_WINCVS |
Generated on Sun Feb 24 01:26:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CGetPrefs_CVSCMD_DIALOGS Member List

This is the complete list of members for CGetPrefs_CVSCMD_DIALOGS, including all inherited members.
CGetPrefs_CVSCMD_DIALOGS() | CGetPrefs_CVSCMD_DIALOGS |
DoDataExchange(CDataExchange *pDX) | CGetPrefs_CVSCMD_DIALOGS | [protected, virtual]
IDD enum value | CGetPrefs_CVSCMD_DIALOGS |
m_didInteract | CGetPrefs_CVSCMD_DIALOGS | [protected]
m_hideAnnotate | CGetPrefs_CVSCMD_DIALOGS |
m_hideDiff | CGetPrefs_CVSCMD_DIALOGS |
m_hideGraph | CGetPrefs_CVSCMD_DIALOGS |
m_hideLog | CGetPrefs_CVSCMD_DIALOGS |
m_hideUpdate | CGetPrefs_CVSCMD_DIALOGS |
m_keyForce | CGetPrefs_CVSCMD_DIALOGS |
StoreValues() | CGetPrefs_CVSCMD_DIALOGS |
~CGetPrefs_CVSCMD_DIALOGS() | CGetPrefs_CVSCMD_DIALOGS |
Generated on Sun Feb 24 01:25:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

GetValue Member List

This is the complete list of members for GetValue, including all inherited members.
DoDataExchange(CDataExchange *pDX) | GetValue | [protected, virtual]
GetValue(const char *defvalue, const char *title, CWnd *pParent=NULL) | GetValue |
IDD enum value | GetValue |
m_prompt | GetValue |
m_value | GetValue |
Generated on Sun Feb 24 01:26:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CGraphOptDlg Member List

This is the complete list of members for CGraphOptDlg, including all inherited members.
CGraphOptDlg(CPersistentInt &selColor, CPersistentInt &shadowColor, CPersistentInt &headerColor, CPersistentInt &tagColor, CPersistentInt &branchColor, CPersistentInt &nodeColor, CPersistentInt &deadNodeColor, CPersistentInt &userStateNodeColor, CWnd *pParent=NULL) | CGraphOptDlg |
DoDataExchange(CDataExchange *pDX) | CGraphOptDlg | [protected, virtual]
GetAllColors() | CGraphOptDlg | [private]
IDD enum value | CGraphOptDlg |
m_apply | CGraphOptDlg |
m_branchColor | CGraphOptDlg | [private]
m_deadNodeColor | CGraphOptDlg | [private]
m_headerColor | CGraphOptDlg | [private]
m_nodeColor | CGraphOptDlg | [private]
m_origBranchColor | CGraphOptDlg | [private]
m_origDeadNodeColor | CGraphOptDlg | [private]
m_origHeaderColor | CGraphOptDlg | [private]
m_origNodeColor | CGraphOptDlg | [private]
m_origSelColor | CGraphOptDlg | [private]
m_origShadowColor | CGraphOptDlg | [private]
m_origTagColor | CGraphOptDlg | [private]
m_origUserStateNodeColor | CGraphOptDlg | [private]
m_rgbBranch | CGraphOptDlg |
m_rgbDead | CGraphOptDlg |
m_rgbHeader | CGraphOptDlg |
m_rgbNode | CGraphOptDlg |
m_rgbSelection | CGraphOptDlg |
m_rgbShadow | CGraphOptDlg |
m_rgbState | CGraphOptDlg |
m_rgbTag | CGraphOptDlg |
m_selColor | CGraphOptDlg | [private]
m_shadowColor | CGraphOptDlg | [private]
m_tagColor | CGraphOptDlg | [private]
m_userStateNodeColor | CGraphOptDlg | [private]
OnApply() | CGraphOptDlg | [protected]
OnBranch() | CGraphOptDlg | [protected]
OnCancel() | CGraphOptDlg | [protected, virtual]
OnDead() | CGraphOptDlg | [protected]
OnHeader() | CGraphOptDlg | [protected]
OnNode() | CGraphOptDlg | [protected]
OnOK() | CGraphOptDlg | [protected, virtual]
OnReset() | CGraphOptDlg | [protected]
OnSelection() | CGraphOptDlg | [protected]
OnShadow() | CGraphOptDlg | [protected]
OnState() | CGraphOptDlg | [protected]
OnTag() | CGraphOptDlg | [protected]
PromptForColor(CColorStatic &colorStatic) | CGraphOptDlg | [private]
Generated on Sun Feb 24 01:26:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CImport_MAIN Member List

This is the complete list of members for CImport_MAIN, including all inherited members.
CImport_MAIN(const char *logmsg, const char *modname, const char *rtag, const char *vtag) | CImport_MAIN |
CImport_MAIN() | CImport_MAIN |
DoDataExchange(CDataExchange *pDX) | CImport_MAIN | [protected, virtual]
IDD enum value | CImport_MAIN |
m_logmsg | CImport_MAIN |
m_modname | CImport_MAIN |
m_modnameCombo | CImport_MAIN |
m_rtag | CImport_MAIN |
m_rtagCombo | CImport_MAIN |
m_vtag | CImport_MAIN |
m_vtagCombo | CImport_MAIN |
~CImport_MAIN() | CImport_MAIN |
Generated on Sun Feb 24 01:26:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CImport_OPTIONS Member List

This is the complete list of members for CImport_OPTIONS, including all inherited members.
CImport_OPTIONS(const char *path, const bool useDefIgnore, const bool useFilesTime) | CImport_OPTIONS |
CImport_OPTIONS() | CImport_OPTIONS |
DoDataExchange(CDataExchange *pDX) | CImport_OPTIONS | [protected, virtual]
IDD enum value | CImport_OPTIONS |
m_path | CImport_OPTIONS |
m_useDefIgnore | CImport_OPTIONS |
m_useFilesTime | CImport_OPTIONS |
OnBtnpath() | CImport_OPTIONS | [protected]
~CImport_OPTIONS() | CImport_OPTIONS |
Generated on Sun Feb 24 01:26:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

ImportReport Member List

This is the complete list of members for ImportReport, including all inherited members.
conflicts | ImportReport |
EnterDirectory(const char *fullpath, const char *dirname, const FSSpec *macspec) | ImportReport | [inline, virtual]
ExitDirectory(const char *fullpath) | ImportReport | [inline, virtual]
gRunning | TraversalReport | [static]
ImportReport(const char *path, ReportWarning *&w, ReportConflict *&c) | ImportReport | [inline]
m_Ignlist | ImportReport |
OnAlias(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | ImportReport | [inline, virtual]
OnAnyDevice(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnDirectory(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | ImportReport | [inline, virtual]
OnError(const char *err, int errcode) | ImportReport | [inline, virtual]
OnFile(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | ImportReport | [inline, virtual]
OnIdle(const char *fullpath) | ImportReport | [inline, virtual]
warnings | ImportReport |
~ImportReport() | ImportReport | [inline, virtual]
Generated on Sun Feb 24 01:26:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

ReportConflict Member List

This is the complete list of members for ReportConflict, including all inherited members.
AddPattern(const char *newpat, kFileType fileType, bool isExtension, const char *sample) | ReportConflict |
DisableUserSettings(void) | ReportConflict | [inline]
fcreator | ReportConflict | [protected]
ForceBinary(void) | ReportConflict | [inline]
forceBinary enum value | ReportConflict |
ForceNoKeywords(void) | ReportConflict | [inline]
forceNoKeywords enum value | ReportConflict |
ForceText(void) | ReportConflict | [inline]
forceText enum value | ReportConflict |
forceUnicode enum value | ReportConflict |
ForceUnicode(void) | ReportConflict | [inline]
ftype | ReportConflict | [protected]
GetMacCreator(void) const | ReportConflict | [inline]
GetMacType(void) const | ReportConflict | [inline]
GetPattern(void) const | ReportConflict | [inline]
hasConflict enum value | ReportConflict |
HasConflict(void) const | ReportConflict | [inline]
hasExtension enum value | ReportConflict |
HasForceBinary(void) const | ReportConflict | [inline]
HasForceNoKeywords(void) const | ReportConflict | [inline]
HasForceText(void) const | ReportConflict | [inline]
HasForceUnicode(void) const | ReportConflict | [inline]
HasIgnore(void) const | ReportConflict | [inline]
hasIgnore enum value | ReportConflict |
HasTypeCreatorConflict(void) const | ReportConflict | [inline]
hasTypeCreatorConflict enum value | ReportConflict |
Ignore(void) | ReportConflict | [inline]
isBinary enum value | ReportConflict |
IsBinary(void) const | ReportConflict | [inline]
IsExtension(void) const | ReportConflict | [inline]
IsUnicode(void) const | ReportConflict | [inline]
isUnicode enum value | ReportConflict |
Match(const char *pat) | ReportConflict |
next | ReportConflict |
noConflict enum value | ReportConflict |
pattern | ReportConflict | [protected]
PrintOut(UStr &out) const | ReportConflict |
ReportConflict(int mac_type, int mac_creator) | ReportConflict |
sample1 | ReportConflict | [protected]
sample2 | ReportConflict | [protected]
SetConflict(const char *sample) | ReportConflict |
SetTypeCreatorConflict(const char *sample) | ReportConflict |
status | ReportConflict | [protected]
userFlags enum value | ReportConflict |
~ReportConflict() | ReportConflict |
Generated on Sun Feb 24 01:27:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

ReportWarning Member List

This is the complete list of members for ReportWarning, including all inherited members.
AddWarning(const char *sample) | ReportWarning |
kind | ReportWarning | [protected]
Kind(void) const | ReportWarning | [inline]
maxWarnings | ReportWarning | [static]
next | ReportWarning |
PrintOut(UStr &out) const | ReportWarning |
ReportWarning(kTextBinTYPE akind) | ReportWarning |
samples | ReportWarning | [protected]
tooMuchWarnings | ReportWarning | [protected]
~ReportWarning() | ReportWarning |
Generated on Sun Feb 24 01:27:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CImportFilterDlg Member List

This is the complete list of members for CImportFilterDlg, including all inherited members.
CImportFilterDlg(ReportConflict *entries, ReportWarning *warnings, CWnd *pParent=NULL) | CImportFilterDlg |
DoDataExchange(CDataExchange *pDX) | CImportFilterDlg | [protected, virtual]
IDD enum value | CImportFilterDlg |
m_edit | CImportFilterDlg |
m_entries | CImportFilterDlg | [protected]
m_ImageList | CImportFilterDlg | [protected]
m_list | CImportFilterDlg |
m_warnings | CImportFilterDlg | [protected]
OnDblclkListentries(NMHDR *pNMHDR, LRESULT *pResult) | CImportFilterDlg | [protected]
OnEditentry() | CImportFilterDlg | [protected]
OnInitDialog() | CImportFilterDlg | [protected, virtual]
Generated on Sun Feb 24 01:26:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CImportWarning Member List

This is the complete list of members for CImportWarning, including all inherited members.
CImportWarning(ReportWarning *warn, CWnd *pParent=NULL) | CImportWarning |
DoDataExchange(CDataExchange *pDX) | CImportWarning | [protected, virtual]
IDD enum value | CImportWarning |
m_desc | CImportWarning |
Generated on Sun Feb 24 01:26:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CImportEntry Member List

This is the complete list of members for CImportEntry, including all inherited members.
CImportEntry(ReportConflict *entry, CWnd *pParent=NULL) | CImportEntry |
DoDataExchange(CDataExchange *pDX) | CImportEntry | [protected, virtual]
IDD enum value | CImportEntry |
m_desc | CImportEntry |
m_radios | CImportEntry |
Generated on Sun Feb 24 01:26:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CInit_MAIN Member List

This is the complete list of members for CInit_MAIN, including all inherited members.
CInit_MAIN() | CInit_MAIN |
CInit_MAIN(bool forceRoot) | CInit_MAIN |
DoDataExchange(CDataExchange *pDX) | CInit_MAIN | [protected, virtual]
IDD enum value | CInit_MAIN |
m_forceroot | CInit_MAIN |
m_helpinit | CInit_MAIN |
Generated on Sun Feb 24 01:26:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCmdLine_MAIN Member List

This is the complete list of members for CCmdLine_MAIN, including all inherited members.
CCmdLine_MAIN() | CCmdLine_MAIN |
CCmdLine_MAIN(const char *lastcmd, bool hasPath, const char *lastpath) | CCmdLine_MAIN |
DoDataExchange(CDataExchange *pDX) | CCmdLine_MAIN | [protected, virtual]
IDD enum value | CCmdLine_MAIN |
m_checkPath | CCmdLine_MAIN |
m_cmdLine | CCmdLine_MAIN |
m_cmdLineEdit | CCmdLine_MAIN |
m_firstTimeCmdline | CCmdLine_MAIN | [private]
m_folderLoc | CCmdLine_MAIN |
m_prevCmdCombo | CCmdLine_MAIN |
m_selFolder | CCmdLine_MAIN |
OnCheckpath() | CCmdLine_MAIN | [protected]
OnInitDialog() | CCmdLine_MAIN | [protected, virtual]
OnSelchangePrevcmd() | CCmdLine_MAIN | [protected]
OnSelfolder() | CCmdLine_MAIN | [protected]
OnSetfocusCmdline() | CCmdLine_MAIN | [protected]
PreTranslateMessage(MSG *pMsg) | CCmdLine_MAIN | [virtual]
~CCmdLine_MAIN() | CCmdLine_MAIN |
Generated on Sun Feb 24 01:25:20 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CLogMain Member List

This is the complete list of members for CLogMain, including all inherited members.
CLogMain() | CLogMain |
DoDataExchange(CDataExchange *pDX) | CLogMain | [protected, virtual]
IDD enum value | CLogMain |
m_defbranch | CLogMain |
m_norecurs | CLogMain |
m_notags | CLogMain |
m_nousers | CLogMain |
m_onlyrcs | CLogMain |
~CLogMain() | CLogMain |
Generated on Sun Feb 24 01:26:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CLogFilters Member List

This is the complete list of members for CLogFilters, including all inherited members.
CLogFilters(const char *sLastDate, const char *sLastRev, const char *sLastUsers, const char *sLastStates) | CLogFilters |
CLogFilters() | CLogFilters |
DoDataExchange(CDataExchange *pDX) | CLogFilters | [protected, virtual]
IDD enum value | CLogFilters |
m_date | CLogFilters |
m_dateCombo | CLogFilters |
m_hasdate | CLogFilters |
m_hasrev | CLogFilters |
m_hasstate | CLogFilters |
m_hasuser | CLogFilters |
m_rev | CLogFilters |
m_revCombo | CLogFilters |
m_state | CLogFilters |
m_stateCombo | CLogFilters |
m_user | CLogFilters |
m_userCombo | CLogFilters |
OnDate() | CLogFilters | [protected]
OnRev() | CLogFilters | [protected]
OnState() | CLogFilters | [protected]
OnUser() | CLogFilters | [protected]
~CLogFilters() | CLogFilters |
Generated on Sun Feb 24 01:26:42 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CMacBinTable Member List

This is the complete list of members for CMacBinTable, including all inherited members.
class_ID enum value | CMacBinTable |
CMacBinTable(LStream *inStream) | CMacBinTable |
CMacBinTable() | CMacBinTable | [private]
CMacBinTable(const CMacBinTable &inOriginal) | CMacBinTable | [private]
FinishCreateSelf() | CMacBinTable | [protected, virtual]
gCurMacBinMap | CMacBinTable | [protected, static]
GetCurrentMap(void) | CMacBinTable | [inline, static]
operator=(const CMacBinTable &inOriginal) | CMacBinTable | [private]
SetCurrentMap(MacBinMaps *map) | CMacBinTable | [inline, static]
~CMacBinTable() | CMacBinTable | [virtual]
Generated on Sun Feb 24 01:26:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CMacBinItem Member List

This is the complete list of members for CMacBinItem, including all inherited members.
CMacBinItem(const MACBINMAP &map) | CMacBinItem |
CMacBinItem() | CMacBinItem | [private]
CMacBinItem(const CMacBinItem &inOriginal) | CMacBinItem | [private]
DoubleClick(const STableCell &inCell, const SMouseDownEvent &inMouseDown, const SOutlineDrawContents &inDrawContents, Boolean inHitText) | CMacBinItem | [protected, virtual]
DrawRowAdornments(const Rect &inLocalRowRect) | CMacBinItem | [protected, virtual]
EditCell(void) | CMacBinItem | [virtual]
fMap | CMacBinItem | [protected]
GetDrawContentsSelf(const STableCell &inCell, SOutlineDrawContents &ioDrawContents) | CMacBinItem | [protected, virtual]
operator=(const CMacBinItem &inOriginal) | CMacBinItem | [private]
RemoveCell(void) | CMacBinItem | [virtual]
~CMacBinItem() | CMacBinItem | [virtual]
Generated on Sun Feb 24 01:26:47 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

MACBINMAP Member List

This is the complete list of members for MACBINMAP, including all inherited members.
desc | MACBINMAP
encod | MACBINMAP
plainBin | MACBINMAP
sig | MACBINMAP
useDefault | MACBINMAP
Generated on Sun Feb 24 01:26:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

MACBINMAPENTRIES Member List

This is the complete list of members for MACBINMAPENTRIES, including all inherited members.
maps | MACBINMAPENTRIES
numMaps | MACBINMAPENTRIES
Generated on Sun Feb 24 01:26:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

MacBinMaps Member List

This is the complete list of members for MacBinMaps, including all inherited members.
AddEntry(OSType sig, const char *desc, MACENCODING encod, bool plainBin, bool useDefault) | MacBinMaps |
Entries(void) const | MacBinMaps | [inline]
entries | MacBinMaps | [protected]
GetEnvPlainTypes(void) | MacBinMaps | [static]
GetEnvTypes(MACENCODING type) | MacBinMaps | [static]
LoadDefaults(void) | MacBinMaps |
MacBinMaps() | MacBinMaps |
operator=(const MacBinMaps &otherMap) | MacBinMaps |
RemoveEntry(OSType sig) | MacBinMaps |
Reset(void) | MacBinMaps | [protected]
SaveDefaults(void) | MacBinMaps |
~MacBinMaps() | MacBinMaps |
Generated on Sun Feb 24 01:26:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

MacroTraversal Member List

This is the complete list of members for MacroTraversal, including all inherited members.
EnterDirectory(const char *fullpath, const char *dirname, const FSSpec *macspec) | TraversalReport | [inline, virtual]
ExitDirectory(const char *fullpath) | TraversalReport | [inline, virtual]
gRunning | TraversalReport | [static]
OnAlias(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnAnyDevice(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnDirectory(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnError(const char *err, int errcode) | MacroTraversal | [inline, virtual]
OnFile(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | MacroTraversal | [virtual]
OnIdle(const char *fullpath) | TraversalReport | [inline, virtual]
Generated on Sun Feb 24 01:26:50 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CMacroEntry Member List

This is the complete list of members for CMacroEntry, including all inherited members.
CMacroEntry() | CMacroEntry | [inline]
CMacroEntry(const char *fullname, const char *dispname) | CMacroEntry | [inline]
CMacroEntry(const CMacroEntry &anentry) | CMacroEntry | [inline]
name | CMacroEntry |
operator<(const CMacroEntry &anentry) const | CMacroEntry | [inline]
operator=(const CMacroEntry &anentry) | CMacroEntry | [inline]
operator==(const CMacroEntry &anentry) const | CMacroEntry | [inline]
path | CMacroEntry |
Generated on Sun Feb 24 01:26:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CMacroSet Member List

This is the complete list of members for CMacroSet, including all inherited members.
Add(const char *fullname, const char *name) | CMacroSet | [inline]
CMacroSet() | CMacroSet | [inline]
entries | CMacroSet |
Flush(void) | CMacroSet | [inline]
invalFlag | CMacroSet |
Generated on Sun Feb 24 01:26:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

FileEntry Member List

This is the complete list of members for FileEntry, including all inherited members.
file | FileEntry |
FileEntry() | FileEntry | [inline]
FileEntry(const char *filename, const FSSpec *macspec=0L) | FileEntry | [inline]
FileEntry(const FileEntry &entry) | FileEntry | [inline]
operator=(const FileEntry &entry) | FileEntry | [inline]
spec | FileEntry |
Generated on Sun Feb 24 01:25:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

MultiFilesEntry Member List

This is the complete list of members for MultiFilesEntry, including all inherited members.
add(const char *file, const FSSpec *spec=0L) | MultiFilesEntry |
dir | MultiFilesEntry |
files | MultiFilesEntry |
MultiFilesEntry() | MultiFilesEntry | [inline]
MultiFilesEntry(const char *path) | MultiFilesEntry | [inline]
MultiFilesEntry(const MultiFilesEntry &entries) | MultiFilesEntry | [inline]
operator=(const MultiFilesEntry &entries) | MultiFilesEntry | [inline]
setdir(const char *newdir) | MultiFilesEntry |
Generated on Sun Feb 24 01:27:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

MultiFiles Member List

This is the complete list of members for MultiFiles, including all inherited members.
add(CvsArgs &args) | MultiFiles |
dirs | MultiFiles | [protected]
get(int index, UStr &path, UStr &fileName) | MultiFiles |
MultiFiles() | MultiFiles | [inline]
newdir(const char *dir) | MultiFiles |
newfile(const char *file, const FSSpec *spec=0L) | MultiFiles |
next(void) | MultiFiles |
NumFiles(void) const | MultiFiles |
pos | MultiFiles | [protected]
reset() | MultiFiles |
rewind(void) | MultiFiles | [inline]
Generated on Sun Feb 24 01:27:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TMPersistent Member List

This is the complete list of members for TMPersistent, including all inherited members.
_GetBaseClass() | CPersistent | [protected, static]
classCPersistent | CPersistent | [protected, static]
classUObject | UObject | [protected, static]
CPersistent(const char *uniqueName, kClassPersistent pclass) | CPersistent |
CreateObject(const char *className) | UObject | [static]
fAllEntries | CPersistent | [protected, static]
fAllItems | TMPersistent | [protected]
fBuf | TMPersistent | [protected]
Find(const char *uniqueName) | CPersistent | [static]
fTimeStamp | CPersistent | [protected]
GetData(void) const | TMPersistent | [inline, virtual]
GetList(void) const | TMPersistent | [inline]
GetList(void) | TMPersistent | [inline]
GetRuntimeClass() const | CPersistent | [virtual]
GetTimeStamp() const | CPersistent | [inline]
IsKindOf(const URuntimeClass *pClass) const | UObject |
list_t typedef | TMPersistent |
LoadAll(void) | CPersistent | [static]
NeedSave(bool onlySettings=false) | CPersistent | [static]
ResetTimeStamp() | CPersistent | [inline]
rtCPersistent(void) | CPersistent | [static]
rtUObject() | UObject | [static]
SaveAll(void) | CPersistent | [static]
SaveAllSettings(const char *settingFileName, const char *forPath) | CPersistent | [static]
SetData(const void *ptr, unsigned int size) | TMPersistent | [inline, virtual]
SizeOf(void) const | TMPersistent | [inline, virtual]
TMPersistent(const char *uniqueName, kClassPersistent pclass=kNoClass) | TMPersistent | [inline]
TouchTimeStamp() | CPersistent | [inline]
UObject() | UObject | [inline, protected]
~CPersistent() | CPersistent | [virtual]
~TMPersistent() | TMPersistent | [inline, virtual]
~UObject() | UObject | [inline, virtual]
Generated on Sun Feb 24 01:28:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TMString Member List

This is the complete list of members for TMString, including all inherited members.
_GetBaseClass() | CPersistent | [protected, static]
begin() const | TMString | [inline]
classCPersistent | CPersistent | [protected, static]
classUObject | UObject | [protected, static]
Compare(const char *s1, const char *s2) const | TMString | [inline, protected, virtual]
CPersistent(const char *uniqueName, kClassPersistent pclass) | CPersistent |
CreateObject(const char *className) | UObject | [static]
end() const | TMString | [inline]
fAllEntries | CPersistent | [protected, static]
fAllStrs | TMString | [protected]
fBuf | TMString | [protected]
Find(const char *instr) const | TMString |
CPersistent::Find(const char *uniqueName) | CPersistent | [static]
fMaxStr | TMString | [protected]
fTimeStamp | CPersistent | [protected]
GetData(void) const | TMString | [virtual]
GetList(void) const | TMString | [inline]
GetRuntimeClass() const | CPersistent | [virtual]
GetTimeStamp() const | CPersistent | [inline]
Insert(const char *newstr) | TMString |
IsKindOf(const URuntimeClass *pClass) const | UObject |
list_t typedef | TMString |
LoadAll(void) | CPersistent | [static]
NeedSave(bool onlySettings=false) | CPersistent | [static]
Remove(const char *newstr) | TMString |
ResetTimeStamp() | CPersistent | [inline]
rtCPersistent(void) | CPersistent | [static]
rtUObject() | UObject | [static]
SaveAll(void) | CPersistent | [static]
SaveAllSettings(const char *settingFileName, const char *forPath) | CPersistent | [static]
SetData(const void *ptr, unsigned int size) | TMString | [virtual]
SizeOf(void) const | TMString | [virtual]
TMString(unsigned int maxstr, const char *uniqueName, char *const *defaultStr=0L, kClassPersistent pclass=kNoClass) | TMString |
TouchTimeStamp() | CPersistent | [inline]
UObject() | UObject | [inline, protected]
~CPersistent() | CPersistent | [virtual]
~TMString() | TMString | [virtual]
~UObject() | UObject | [inline, virtual]
Generated on Sun Feb 24 01:28:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CMString Member List

This is the complete list of members for CMString, including all inherited members.
_GetBaseClass() | CMString | [protected, static]
begin() const | TMString< UStr > | [inline]
classCMString | CMString | [protected, static]
classCPersistent | CPersistent | [protected, static]
classUObject | UObject | [protected, static]
CMString(unsigned int maxstr, const char *uniqueName, char *const *defaultStr=0L, kClassPersistent pclass=kNoClass) | CMString | [inline]
Compare(const char *s1, const char *s2) const | TMString< UStr > | [inline, protected, virtual]
CPersistent(const char *uniqueName, kClassPersistent pclass) | CPersistent |
CreateObject(const char *className) | UObject | [static]
end() const | TMString< UStr > | [inline]
fAllEntries | CPersistent | [protected, static]
fAllStrs | TMString< UStr > | [protected]
fBuf | TMString< UStr > | [protected]
Find(const char *instr) const | TMString< UStr > |
CPersistent::Find(const char *uniqueName) | CPersistent | [static]
fMaxStr | TMString< UStr > | [protected]
fTimeStamp | CPersistent | [protected]
GetData(void) const | TMString< UStr > | [virtual]
GetList(void) const | TMString< UStr > | [inline]
GetRuntimeClass() const | CMString | [virtual]
GetTimeStamp() const | CPersistent | [inline]
Insert(const char *newstr) | TMString< UStr > |
IsKindOf(const URuntimeClass *pClass) const | UObject |
list_t typedef | TMString< UStr > |
LoadAll(void) | CPersistent | [static]
NeedSave(bool onlySettings=false) | CPersistent | [static]
Remove(const char *newstr) | TMString< UStr > |
ResetTimeStamp() | CPersistent | [inline]
rtCMString(void) | CMString | [static]
rtCPersistent(void) | CPersistent | [static]
rtUObject() | UObject | [static]
SaveAll(void) | CPersistent | [static]
SaveAllSettings(const char *settingFileName, const char *forPath) | CPersistent | [static]
SetData(const void *ptr, unsigned int size) | TMString< UStr > | [virtual]
SizeOf(void) const | TMString< UStr > | [virtual]
TMString(unsigned int maxstr, const char *uniqueName, char *const *defaultStr=0L, kClassPersistent pclass=kNoClass) | TMString< UStr > |
TouchTimeStamp() | CPersistent | [inline]
UObject() | UObject | [inline, protected]
~CMString() | CMString | [inline, virtual]
~CPersistent() | CPersistent | [virtual]
~TMString() | TMString< UStr > | [virtual]
~UObject() | UObject | [inline, virtual]
Generated on Sun Feb 24 01:27:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CMPString Member List

This is the complete list of members for CMPString, including all inherited members.
_GetBaseClass() | CMPString | [protected, static]
begin() const | TMString< UPStr > | [inline]
classCMPString | CMPString | [protected, static]
classCPersistent | CPersistent | [protected, static]
classUObject | UObject | [protected, static]
CMPString(unsigned int maxstr, const char *uniqueName, char *const *defaultStr=0L, kClassPersistent pclass=kNoClass) | CMPString | [inline]
Compare(const char *s1, const char *s2) const | TMString< UPStr > | [inline, protected, virtual]
CPersistent(const char *uniqueName, kClassPersistent pclass) | CPersistent |
CreateObject(const char *className) | UObject | [static]
end() const | TMString< UPStr > | [inline]
fAllEntries | CPersistent | [protected, static]
fAllStrs | TMString< UPStr > | [protected]
fBuf | TMString< UPStr > | [protected]
Find(const char *instr) const | TMString< UPStr > |
CPersistent::Find(const char *uniqueName) | CPersistent | [static]
fMaxStr | TMString< UPStr > | [protected]
fTimeStamp | CPersistent | [protected]
GetData(void) const | TMString< UPStr > | [virtual]
GetList(void) const | TMString< UPStr > | [inline]
GetRuntimeClass() const | CMPString | [virtual]
GetTimeStamp() const | CPersistent | [inline]
Insert(const char *newstr) | TMString< UPStr > |
IsKindOf(const URuntimeClass *pClass) const | UObject |
list_t typedef | TMString< UPStr > |
LoadAll(void) | CPersistent | [static]
NeedSave(bool onlySettings=false) | CPersistent | [static]
Remove(const char *newstr) | TMString< UPStr > |
ResetTimeStamp() | CPersistent | [inline]
rtCMPString(void) | CMPString | [static]
rtCPersistent(void) | CPersistent | [static]
rtUObject() | UObject | [static]
SaveAll(void) | CPersistent | [static]
SaveAllSettings(const char *settingFileName, const char *forPath) | CPersistent | [static]
SetData(const void *ptr, unsigned int size) | TMString< UPStr > | [virtual]
SizeOf(void) const | TMString< UPStr > | [virtual]
TMString(unsigned int maxstr, const char *uniqueName, char *const *defaultStr=0L, kClassPersistent pclass=kNoClass) | TMString< UPStr > |
TouchTimeStamp() | CPersistent | [inline]
UObject() | UObject | [inline, protected]
~CMPString() | CMPString | [inline, virtual]
~CPersistent() | CPersistent | [virtual]
~TMString() | TMString< UPStr > | [virtual]
~UObject() | UObject | [inline, virtual]
Generated on Sun Feb 24 01:26:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CKeyString Member List

This is the complete list of members for CKeyString, including all inherited members.
_GetBaseClass() | CMString | [protected, static]
begin() const | TMString< UStr > | [inline]
CKeyString(unsigned int maxstr, const char *uniqueName, char *const *defaultStr=0L, kClassPersistent pclass=kNoClass) | CKeyString | [inline]
classCMString | CMString | [protected, static]
classCPersistent | CPersistent | [protected, static]
classUObject | UObject | [protected, static]
CMString(unsigned int maxstr, const char *uniqueName, char *const *defaultStr=0L, kClassPersistent pclass=kNoClass) | CMString | [inline]
Compare(const char *s1, const char *s2) const | CKeyString | [protected, virtual]
Concatenate(UStr &res, const char *key, const char *value) | CKeyString | [static]
CPersistent(const char *uniqueName, kClassPersistent pclass) | CPersistent |
CreateObject(const char *className) | UObject | [static]
end() const | TMString< UStr > | [inline]
fAllEntries | CPersistent | [protected, static]
fAllStrs | TMString< UStr > | [protected]
fBuf | TMString< UStr > | [protected]
Find(const char *instr) const | TMString< UStr > |
CPersistent::Find(const char *uniqueName) | CPersistent | [static]
fMaxStr | TMString< UStr > | [protected]
fTimeStamp | CPersistent | [protected]
GetData(void) const | TMString< UStr > | [virtual]
GetList(void) const | TMString< UStr > | [inline]
GetRuntimeClass() const | CMString | [virtual]
GetTimeStamp() const | CPersistent | [inline]
Insert(const char *newstr) | TMString< UStr > |
IsKindOf(const URuntimeClass *pClass) const | UObject |
list_t typedef | TMString< UStr > |
LoadAll(void) | CPersistent | [static]
NeedSave(bool onlySettings=false) | CPersistent | [static]
Remove(const char *newstr) | TMString< UStr > |
ResetTimeStamp() | CPersistent | [inline]
rtCMString(void) | CMString | [static]
rtCPersistent(void) | CPersistent | [static]
rtUObject() | UObject | [static]
SaveAll(void) | CPersistent | [static]
SaveAllSettings(const char *settingFileName, const char *forPath) | CPersistent | [static]
SetData(const void *ptr, unsigned int size) | TMString< UStr > | [virtual]
SizeOf(void) const | TMString< UStr > | [virtual]
Split(const char *str, UStr &key, UStr &value) | CKeyString | [static]
TMString(unsigned int maxstr, const char *uniqueName, char *const *defaultStr=0L, kClassPersistent pclass=kNoClass) | TMString< UStr > |
TouchTimeStamp() | CPersistent | [inline]
UObject() | UObject | [inline, protected]
~CKeyString() | CKeyString | [inline, virtual]
~CMString() | CMString | [inline, virtual]
~CPersistent() | CPersistent | [virtual]
~TMString() | TMString< UStr > | [virtual]
~UObject() | UObject | [inline, virtual]
Generated on Sun Feb 24 01:26:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

COptionalPropertySheet Member List

This is the complete list of members for COptionalPropertySheet, including all inherited members.
COptionalPropertySheet(bool bOptionChecked, UINT nIDCaption, CWnd *pParentWnd=NULL, UINT iSelectPage=0) | COptionalPropertySheet |
COptionalPropertySheet(bool bOptionChecked, LPCTSTR pszCaption, CWnd *pParentWnd=NULL, UINT iSelectPage=0) | COptionalPropertySheet |
DoModal() | COptionalPropertySheet | [virtual]
GetHideCommandDlg() | COptionalPropertySheet |
m_bOptionChecked | COptionalPropertySheet | [protected]
m_optionCheck | COptionalPropertySheet | [protected]
OnCommand(WPARAM wParam, LPARAM lParam) | COptionalPropertySheet | [protected, virtual]
OnInitDialog() | COptionalPropertySheet | [protected, virtual]
~COptionalPropertySheet() | COptionalPropertySheet | [virtual]
Generated on Sun Feb 24 01:27:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

USaveSettings Member List

This is the complete list of members for USaveSettings, including all inherited members.
_GetBaseClass() | USaveSettings | [protected, static]
_messageEntries | USaveSettings | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUCmdTarget | UCmdTarget | [protected, static]
classUObject | UObject | [protected, static]
classUSaveSettings | USaveSettings | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool fill) | USaveSettings | [virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | USaveSettings | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | USaveSettings | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | USaveSettings | [virtual]
GetThisMessageMap() | USaveSettings | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kCopyFrom enum value | USaveSettings |
kCopyList enum value | USaveSettings |
kCopyPath enum value | USaveSettings |
kSettingName enum value | USaveSettings |
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_copyFromPath | USaveSettings |
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_list | USaveSettings | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_oldname | USaveSettings | [protected]
m_overide | UWidget | [protected]
m_path | USaveSettings | [protected]
m_settingName | USaveSettings |
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | USaveSettings | [protected, static]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnCopyFrom(void) | USaveSettings | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UWidget | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
rtUCmdTarget(void) | UCmdTarget | [static]
rtUObject() | UObject | [static]
rtUSaveSettings(void) | USaveSettings | [static]
rtUWidget(void) | UWidget | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sValidMenu | UWidget | [protected, static]
UCmdTarget(int widid) | UCmdTarget |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
UObject() | UObject | [inline, protected]
USaveSettings(const char *path, const char *oldname) | USaveSettings |
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UCmdTarget() | UCmdTarget | [virtual]
~UObject() | UObject | [inline, virtual]
~USaveSettings() | USaveSettings | [virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:27:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CFindSettings Member List

This is the complete list of members for CFindSettings, including all inherited members.
CFindSettings(const char *findPath) | CFindSettings | [inline]
CFindSettings(std::map< UStr, UStr > &list) | CFindSettings | [inline]
EnterDirectory(const char *fullpath, const char *dirname, const FSSpec *macspec) | TraversalReport | [inline, virtual]
ExitDirectory(const char *fullpath) | TraversalReport | [inline, virtual]
gRunning | TraversalReport | [static]
m_foundIt | CFindSettings |
m_list | CFindSettings |
m_pathToFind | CFindSettings |
m_settingsFile | CFindSettings |
m_topfolder | CFindSettings |
OnAlias(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnAnyDevice(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnDirectory(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnError(const char *err, int errcode) | CFindSettings | [inline, virtual]
OnFile(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | CFindSettings | [virtual]
OnIdle(const char *fullpath) | TraversalReport | [inline, virtual]
searchAllPath(const char *token, const char *value, void *data) | CFindSettings | [static]
searchPath(const char *token, const char *value, void *data) | CFindSettings | [static]
~CFindSettings() | CFindSettings | [inline, virtual]
Generated on Sun Feb 24 01:25:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CPersistent Member List

This is the complete list of members for CPersistent, including all inherited members.
_GetBaseClass() | CPersistent | [protected, static]
classCPersistent | CPersistent | [protected, static]
classUObject | UObject | [protected, static]
CPersistent(const char *uniqueName, kClassPersistent pclass) | CPersistent |
CreateObject(const char *className) | UObject | [static]
fAllEntries | CPersistent | [protected, static]
Find(const char *uniqueName) | CPersistent | [static]
fTimeStamp | CPersistent | [protected]
GetData(void) const=0L | CPersistent | [pure virtual]
GetRuntimeClass() const | CPersistent | [virtual]
GetTimeStamp() const | CPersistent | [inline]
IsKindOf(const URuntimeClass *pClass) const | UObject |
LoadAll(void) | CPersistent | [static]
NeedSave(bool onlySettings=false) | CPersistent | [static]
Register(CPersistent *value, const char *uniqueName, kClassPersistent pclass) | CPersistent | [private, static]
ResetTimeStamp() | CPersistent | [inline]
rtCPersistent(void) | CPersistent | [static]
rtUObject() | UObject | [static]
SaveAll(void) | CPersistent | [static]
SaveAllSettings(const char *settingFileName, const char *forPath) | CPersistent | [static]
SetData(const void *ptr, unsigned int size)=0L | CPersistent | [pure virtual]
SizeOf(void) const=0L | CPersistent | [pure virtual]
TouchTimeStamp() | CPersistent | [inline]
UnRegister(CPersistent *value) | CPersistent | [private, static]
UObject() | UObject | [inline, protected]
~CPersistent() | CPersistent | [virtual]
~UObject() | UObject | [inline, virtual]
Generated on Sun Feb 24 01:27:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CPersistent::CPersistentEntry Member List

This is the complete list of members for CPersistent::CPersistentEntry, including all inherited members.
fClass | CPersistent::CPersistentEntry
fUniqueName | CPersistent::CPersistentEntry
fValue | CPersistent::CPersistentEntry
Generated on Sun Feb 24 01:27:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CPersistentT Member List

This is the complete list of members for CPersistentT, including all inherited members.
_GetBaseClass() | CPersistent | [protected, static]
classCPersistent | CPersistent | [protected, static]
classUObject | UObject | [protected, static]
CPersistent(const char *uniqueName, kClassPersistent pclass) | CPersistent |
CPersistentT(const char *uniqueName, T defValue, kClassPersistent pclass) | CPersistentT | [inline]
CreateObject(const char *className) | UObject | [static]
fAllEntries | CPersistent | [protected, static]
fDefValue | CPersistentT | [protected]
Find(const char *uniqueName) | CPersistent | [static]
fTimeStamp | CPersistent | [protected]
fValue | CPersistentT | [protected]
GetData(void) const | CPersistentT | [inline, virtual]
GetRuntimeClass() const | CPersistent | [virtual]
GetTimeStamp() const | CPersistent | [inline]
IsKindOf(const URuntimeClass *pClass) const | UObject |
LoadAll(void) | CPersistent | [static]
NeedSave(bool onlySettings=false) | CPersistent | [static]
operator const T &() const | CPersistentT | [inline]
operator->() const | CPersistentT | [inline]
operator=(const T &val) | CPersistentT | [inline]
operator==(const T &val) const | CPersistentT | [inline]
ResetTimeStamp() | CPersistent | [inline]
rtCPersistent(void) | CPersistent | [static]
rtUObject() | UObject | [static]
SaveAll(void) | CPersistent | [static]
SaveAllSettings(const char *settingFileName, const char *forPath) | CPersistent | [static]
SetData(const void *ptr, unsigned int size) | CPersistentT | [inline, virtual]
SizeOf(void) const | CPersistentT | [inline, virtual]
TouchTimeStamp() | CPersistent | [inline]
UObject() | UObject | [inline, protected]
~CPersistent() | CPersistent | [virtual]
~CPersistentT() | CPersistentT | [inline, virtual]
~UObject() | UObject | [inline, virtual]
Generated on Sun Feb 24 01:27:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CPersistentBool Member List

This is the complete list of members for CPersistentBool, including all inherited members.
_GetBaseClass() | CPersistentBool | [protected, static]
classCPersistent | CPersistent | [protected, static]
classCPersistentBool | CPersistentBool | [protected, static]
classUObject | UObject | [protected, static]
CPersistent(const char *uniqueName, kClassPersistent pclass) | CPersistent |
CPersistentBool(const char *uniqueName, bool defValue, kClassPersistent pclass=kNoClass) | CPersistentBool | [inline]
CPersistentT(const char *uniqueName, bool defValue, kClassPersistent pclass) | CPersistentT< bool > | [inline]
CreateObject(const char *className) | UObject | [static]
fAllEntries | CPersistent | [protected, static]
fDefValue | CPersistentT< bool > | [protected]
Find(const char *uniqueName) | CPersistent | [static]
fTimeStamp | CPersistent | [protected]
fValue | CPersistentT< bool > | [protected]
GetData(void) const | CPersistentT< bool > | [inline, virtual]
GetRuntimeClass() const | CPersistentBool | [virtual]
GetTimeStamp() const | CPersistent | [inline]
IsKindOf(const URuntimeClass *pClass) const | UObject |
LoadAll(void) | CPersistent | [static]
NeedSave(bool onlySettings=false) | CPersistent | [static]
operator const bool &() const | CPersistentBool | [inline]
operator const T &() const | CPersistentT< bool > | [inline]
operator->() const | CPersistentBool | [inline]
operator=(const bool &val) | CPersistentBool | [inline]
operator==(const bool &val) const | CPersistentBool | [inline]
ResetTimeStamp() | CPersistent | [inline]
rtCPersistent(void) | CPersistent | [static]
rtCPersistentBool(void) | CPersistentBool | [static]
rtUObject() | UObject | [static]
SaveAll(void) | CPersistent | [static]
SaveAllSettings(const char *settingFileName, const char *forPath) | CPersistent | [static]
SetData(const void *ptr, unsigned int size) | CPersistentT< bool > | [inline, virtual]
SizeOf(void) const | CPersistentT< bool > | [inline, virtual]
TouchTimeStamp() | CPersistent | [inline]
UObject() | UObject | [inline, protected]
~CPersistent() | CPersistent | [virtual]
~CPersistentBool() | CPersistentBool | [inline, virtual]
~CPersistentT() | CPersistentT< bool > | [inline, virtual]
~UObject() | UObject | [inline, virtual]
Generated on Sun Feb 24 01:27:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CPersistentInt Member List

This is the complete list of members for CPersistentInt, including all inherited members.
_GetBaseClass() | CPersistentInt | [protected, static]
classCPersistent | CPersistent | [protected, static]
classCPersistentInt | CPersistentInt | [protected, static]
classUObject | UObject | [protected, static]
CPersistent(const char *uniqueName, kClassPersistent pclass) | CPersistent |
CPersistentInt(const char *uniqueName, int defValue, kClassPersistent pclass=kNoClass) | CPersistentInt | [inline]
CPersistentT(const char *uniqueName, int defValue, kClassPersistent pclass) | CPersistentT< int > | [inline]
CreateObject(const char *className) | UObject | [static]
fAllEntries | CPersistent | [protected, static]
fDefValue | CPersistentT< int > | [protected]
Find(const char *uniqueName) | CPersistent | [static]
fTimeStamp | CPersistent | [protected]
fValue | CPersistentT< int > | [protected]
GetData(void) const | CPersistentT< int > | [inline, virtual]
GetRuntimeClass() const | CPersistentInt | [virtual]
GetTimeStamp() const | CPersistent | [inline]
IsKindOf(const URuntimeClass *pClass) const | UObject |
LoadAll(void) | CPersistent | [static]
NeedSave(bool onlySettings=false) | CPersistent | [static]
operator const int &() const | CPersistentInt | [inline]
operator const T &() const | CPersistentT< int > | [inline]
operator->() const | CPersistentInt | [inline]
operator=(const int &val) | CPersistentInt | [inline]
operator==(const int &val) const | CPersistentInt | [inline]
ResetTimeStamp() | CPersistent | [inline]
rtCPersistent(void) | CPersistent | [static]
rtCPersistentInt(void) | CPersistentInt | [static]
rtUObject() | UObject | [static]
SaveAll(void) | CPersistent | [static]
SaveAllSettings(const char *settingFileName, const char *forPath) | CPersistent | [static]
SetData(const void *ptr, unsigned int size) | CPersistentT< int > | [inline, virtual]
SizeOf(void) const | CPersistentT< int > | [inline, virtual]
TouchTimeStamp() | CPersistent | [inline]
UObject() | UObject | [inline, protected]
~CPersistent() | CPersistent | [virtual]
~CPersistentInt() | CPersistentInt | [inline, virtual]
~CPersistentT() | CPersistentT< int > | [inline, virtual]
~UObject() | UObject | [inline, virtual]
Generated on Sun Feb 24 01:27:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

PyRegistry Member List

This is the complete list of members for PyRegistry, including all inherited members.
CallInitValues(PyObject *dict) | PyRegistry | [static]
m_all | PyRegistry | [protected, static]
m_c | PyRegistry | [protected]
m_doc | PyRegistry | [protected]
m_next | PyRegistry | [protected]
m_type | PyRegistry |
m_v | PyRegistry | [protected]
PyRegistry(const char *name, size_t size, destructor d, getattrfunc g, PyRegistry_InitValues v, PyCFunction c, const char *doc) | PyRegistry |
RegisterAllObjects(std::vector< PyMethodDef > &methods) | PyRegistry | [static]
~PyRegistry() | PyRegistry |
Generated on Sun Feb 24 01:27:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

PyContainer Member List

This is the complete list of members for PyContainer, including all inherited members.
False() | PyContainer | [inline, static]
GetAttr(char *name) | PyContainer | [inline, virtual]
PyContainer() | PyContainer | [inline]
RegisterValue(PyObject *d, char *name, int value) | PyContainer | [static]
True() | PyContainer | [inline, static]
Void() | PyContainer | [inline, static]
~PyContainer() | PyContainer | [inline, virtual]
Generated on Sun Feb 24 01:27:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

PyAutoObject Member List

This is the complete list of members for PyAutoObject, including all inherited members.
CopyReturn(void) | PyAutoObject | [inline]
IsValid(void) | PyAutoObject | [inline]
m_o | PyAutoObject | [protected]
operator T *() const | PyAutoObject | [inline]
operator->(void) | PyAutoObject | [inline]
operator=(T *o) | PyAutoObject | [inline]
operator=(PyObject *o) | PyAutoObject | [inline]
operator=(PyAutoObject &obj) | PyAutoObject | [inline]
PyAutoObject() | PyAutoObject | [inline]
PyAutoObject(T *o) | PyAutoObject | [inline]
PyAutoObject(PyObject *o) | PyAutoObject | [inline]
PyAutoObject(PyAutoObject &obj) | PyAutoObject | [inline]
Ref(void) | PyAutoObject | [inline, protected]
UnRef(void) | PyAutoObject | [inline, protected]
~PyAutoObject() | PyAutoObject | [inline]
Generated on Sun Feb 24 01:27:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CPyThreadState Member List

This is the complete list of members for CPyThreadState, including all inherited members.
CPyThreadState(PyThreadState *p) | CPyThreadState | [inline]
m_p | CPyThreadState | [protected]
~CPyThreadState() | CPyThreadState | [inline]
Generated on Sun Feb 24 01:27:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CFillPyEntries Member List

This is the complete list of members for CFillPyEntries, including all inherited members.
CFillPyEntries(CSortList< ENTNODE > &entries) | CFillPyEntries | [inline]
EnterDirectory(const char *fullpath, const char *dirname, const FSSpec *macspec) | CFillPyEntries | [inline, virtual]
ExitDirectory(const char *fullpath) | CFillPyEntries | [inline, virtual]
gRunning | TraversalReport | [static]
m_entries | CFillPyEntries |
m_ignlist | CFillPyEntries |
OnAlias(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | CFillPyEntries | [inline, virtual]
OnAnyDevice(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnDirectory(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | CFillPyEntries | [inline, virtual]
OnError(const char *err, int errcode) | CFillPyEntries | [inline, virtual]
OnFile(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | CFillPyEntries | [inline, virtual]
OnIdle(const char *fullpath) | CFillPyEntries | [inline, virtual]
~CFillPyEntries() | CFillPyEntries | [inline, virtual]
Generated on Sun Feb 24 01:25:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CBuffer Member List

This is the complete list of members for CBuffer, including all inherited members.
append(const char *ptr, size_t s) | CBuffer | [inline]
CBuffer() | CBuffer | [inline]
m_buf | CBuffer | [protected]
m_curSize | CBuffer | [protected]
operator char *(void) const | CBuffer | [inline]
size() const | CBuffer | [inline]
Generated on Sun Feb 24 01:24:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CPyCvsConsole Member List

This is the complete list of members for CPyCvsConsole, including all inherited members.
CPyCvsConsole() | CPyCvsConsole | [inline]
cvs_err(char *txt, long len) | CPyCvsConsole | [inline, virtual]
cvs_out(char *txt, long len) | CPyCvsConsole | [inline, virtual]
m_err | CPyCvsConsole |
m_out | CPyCvsConsole |
~CPyCvsConsole() | CPyCvsConsole | [inline, virtual]
Generated on Sun Feb 24 01:27:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CPython_Interp Member List

This is the complete list of members for CPython_Interp, including all inherited members.
ClosePythonSupport(void) | CPython_Interp | [static]
CPython_Interp(bool mainInterp=true) | CPython_Interp |
DoFile(const char *file) | CPython_Interp |
DoScript(const char *script) | CPython_Interp |
DoScriptVar(const char *format,...) | CPython_Interp |
fInterp | CPython_Interp | [protected]
InitPythonSupport(void) | CPython_Interp | [static]
IsAvail(void) | CPython_Interp | [static]
m_mainInterpreter | CPython_Interp | [protected, static]
operator PyThreadState *(void) | CPython_Interp | [inline]
~CPython_Interp() | CPython_Interp |
Generated on Sun Feb 24 01:27:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

PyCvsEntry Member List

This is the complete list of members for PyCvsEntry, including all inherited members.
Create(PyObject *selfptr, PyObject *args) | PyCvsEntry | [static]
dealloc(obj_t *self) | PyCvsEntry | [static]
False() | PyContainer | [inline, static]
FindMethod(PyObject *self, char *name) | PyCvsEntry | [inline, static]
getattr(obj_t *self, char *name) | PyCvsEntry | [static]
GetAttr(char *name) | PyCvsEntry | [virtual]
GetType(void) | PyCvsEntry | [inline, static]
InitValues(PyObject *d) | PyCvsEntry | [static]
m_data | PyCvsEntry | [protected]
m_doc | PyCvsEntry | [static]
m_methods | PyCvsEntry | [static]
m_registry | PyCvsEntry | [static]
New(void) | PyCvsEntry | [static]
operator EntnodeData *(void) const | PyCvsEntry | [inline]
PyContainer() | PyContainer | [inline]
PyCvsEntry(EntnodeData *data) | PyCvsEntry | [inline]
RegisterValue(PyObject *d, char *name, int value) | PyContainer | [static]
True() | PyContainer | [inline, static]
Void() | PyContainer | [inline, static]
~PyContainer() | PyContainer | [inline, virtual]
~PyCvsEntry() | PyCvsEntry | [inline, virtual]
Generated on Sun Feb 24 01:27:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

PyCvsEntry::obj_t Member List

This is the complete list of members for PyCvsEntry::obj_t, including all inherited members.
m_object PyCvsEntry::obj_t
Generated on Sun Feb 24 01:27:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

PyColorConsole Member List

This is the complete list of members for PyColorConsole, including all inherited members.
_Print(obj_t *self, PyObject *args) | PyColorConsole | [inline, protected, static]
Create(PyObject *selfptr, PyObject *args) | PyColorConsole | [static]
dealloc(obj_t *self) | PyColorConsole | [static]
False() | PyContainer | [inline, static]
FindMethod(PyObject *self, char *name) | PyColorConsole | [inline, static]
GetAttr(char *name) | PyContainer | [inline, virtual]
getattr(obj_t *self, char *name) | PyColorConsole | [static]
GetType(void) | PyColorConsole | [inline, static]
InitValues(PyObject *d) | PyColorConsole | [static]
m_console | PyColorConsole | [protected]
m_doc | PyColorConsole | [static]
m_methods | PyColorConsole | [static]
m_registry | PyColorConsole | [static]
New(void) | PyColorConsole | [static]
Print(PyObject *args) | PyColorConsole |
PyColorConsole() | PyColorConsole | [inline]
PyContainer() | PyContainer | [inline]
RegisterValue(PyObject *d, char *name, int value) | PyContainer | [static]
True() | PyContainer | [inline, static]
Void() | PyContainer | [inline, static]
~PyColorConsole() | PyColorConsole | [inline, virtual]
~PyContainer() | PyContainer | [inline, virtual]
Generated on Sun Feb 24 01:27:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

PyColorConsole::obj_t Member List

This is the complete list of members for PyColorConsole::obj_t, including all inherited members.
m_object PyColorConsole::obj_t
Generated on Sun Feb 24 01:27:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

PyMenuMgr Member List

This is the complete list of members for PyMenuMgr, including all inherited members.
_AddButton(obj_t *self, PyObject *args) | PyMenuMgr | [inline, protected, static]
_AddPulldown(obj_t *self, PyObject *args) | PyMenuMgr | [inline, protected, static]
_AddSeparator(obj_t *self, PyObject *args) | PyMenuMgr | [inline, protected, static]
_AddToggle(obj_t *self, PyObject *args) | PyMenuMgr | [inline, protected, static]
_Count(obj_t *self, PyObject *args) | PyMenuMgr | [inline, protected, static]
_Delete(obj_t *self, PyObject *args) | PyMenuMgr | [inline, protected, static]
_DeleteByCmd(obj_t *self, PyObject *args) | PyMenuMgr | [inline, protected, static]
AddButton(PyObject *args) | PyMenuMgr |
AddPulldown(PyObject *args) | PyMenuMgr |
AddSeparator(PyObject *args) | PyMenuMgr |
AddToggle(PyObject *args) | PyMenuMgr |
Count(PyObject *args) | PyMenuMgr |
Create(PyObject *selfptr, PyObject *args) | PyMenuMgr | [static]
dealloc(obj_t *self) | PyMenuMgr | [static]
Delete(PyObject *args) | PyMenuMgr |
DeleteByCmd(PyObject *args) | PyMenuMgr |
False() | PyContainer | [inline, static]
FindMethod(PyObject *self, char *name) | PyMenuMgr | [inline, static]
getattr(obj_t *self, char *name) | PyMenuMgr | [static]
GetAttr(char *name) | PyContainer | [inline, virtual]
GetType(void) | PyMenuMgr | [inline, static]
InitValues(PyObject *d) | PyMenuMgr | [static]
m_doc | PyMenuMgr | [static]
m_menu | PyMenuMgr | [protected]
m_methods | PyMenuMgr | [static]
m_registry | PyMenuMgr | [static]
New(void) | PyMenuMgr | [static]
operator UMENU() const | PyMenuMgr | [inline]
PyContainer() | PyContainer | [inline]
PyMenuMgr(UMENU menu) | PyMenuMgr | [inline]
RegisterValue(PyObject *d, char *name, int value) | PyContainer | [static]
True() | PyContainer | [inline, static]
Void() | PyContainer | [inline, static]
~PyContainer() | PyContainer | [inline, virtual]
~PyMenuMgr() | PyMenuMgr | [inline, virtual]
Generated on Sun Feb 24 01:27:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

PyMenuMgr::obj_t Member List

This is the complete list of members for PyMenuMgr::obj_t, including all inherited members.
m_object PyMenuMgr::obj_t
Generated on Sun Feb 24 01:27:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

PyCmdUI Member List

This is the complete list of members for PyCmdUI, including all inherited members.
_Enable(obj_t *self, PyObject *args) | PyCmdUI | [inline, protected, static]
_SetCheck(obj_t *self, PyObject *args) | PyCmdUI | [inline, protected, static]
_SetText(obj_t *self, PyObject *args) | PyCmdUI | [inline, protected, static]
Create(PyObject *selfptr, PyObject *args) | PyCmdUI | [static]
dealloc(obj_t *self) | PyCmdUI | [static]
Enable(PyObject *args) | PyCmdUI |
False() | PyContainer | [inline, static]
FindMethod(PyObject *self, char *name) | PyCmdUI | [inline, static]
GetAttr(char *name) | PyContainer | [inline, virtual]
getattr(obj_t *self, char *name) | PyCmdUI | [static]
GetType(void) | PyCmdUI | [inline, static]
InitValues(PyObject *d) | PyCmdUI | [static]
m_cmdui | PyCmdUI | [protected]
m_doc | PyCmdUI | [static]
m_methods | PyCmdUI | [static]
m_registry | PyCmdUI | [static]
New(void) | PyCmdUI | [static]
PyCmdUI(UCmdUI *cmdui) | PyCmdUI | [inline]
PyContainer() | PyContainer | [inline]
RegisterValue(PyObject *d, char *name, int value) | PyContainer | [static]
SetCheck(PyObject *args) | PyCmdUI |
SetText(PyObject *args) | PyCmdUI |
True() | PyContainer | [inline, static]
Void() | PyContainer | [inline, static]
~PyCmdUI() | PyCmdUI | [inline, virtual]
~PyContainer() | PyContainer | [inline, virtual]
Generated on Sun Feb 24 01:27:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

PyCmdUI::obj_t Member List

This is the complete list of members for PyCmdUI::obj_t, including all inherited members.
m_object PyCmdUI::obj_t
Generated on Sun Feb 24 01:27:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

PyPersistent Member List

This is the complete list of members for PyPersistent, including all inherited members.
_GetValue(obj_t *self, PyObject *args) | PyPersistent | [inline, protected, static]
_SetValue(obj_t *self, PyObject *args) | PyPersistent | [inline, protected, static]
Create(PyObject *selfptr, PyObject *args) | PyPersistent | [static]
dealloc(obj_t *self) | PyPersistent | [static]
False() | PyContainer | [inline, static]
FindMethod(PyObject *self, char *name) | PyPersistent | [inline, static]
GetAttr(char *name) | PyContainer | [inline, virtual]
getattr(obj_t *self, char *name) | PyPersistent | [static]
GetType(void) | PyPersistent | [inline, static]
GetValue(PyObject *args) | PyPersistent |
InitValues(PyObject *d) | PyPersistent | [static]
m_cstr | PyPersistent | [protected]
m_doc | PyPersistent | [static]
m_methods | PyPersistent | [static]
m_registry | PyPersistent | [static]
New(void) | PyPersistent | [static]
PyContainer() | PyContainer | [inline]
PyPersistent(const char *uniqueName, const char *defValue, kClassPersistent pclass) | PyPersistent | [inline]
RegisterValue(PyObject *d, char *name, int value) | PyContainer | [static]
SetValue(PyObject *args) | PyPersistent |
True() | PyContainer | [inline, static]
Void() | PyContainer | [inline, static]
~PyContainer() | PyContainer | [inline, virtual]
~PyPersistent() | PyPersistent | [inline, virtual]
Generated on Sun Feb 24 01:27:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

PyPersistent::obj_t Member List

This is the complete list of members for PyPersistent::obj_t, including all inherited members.
m_object PyPersistent::obj_t
Generated on Sun Feb 24 01:27:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CReleaseDlg Member List

This is the complete list of members for CReleaseDlg, including all inherited members.
CReleaseDlg(CWnd *pParent=NULL) | CReleaseDlg |
DoDataExchange(CDataExchange *pDX) | CReleaseDlg | [protected, virtual]
IDD enum value | CReleaseDlg |
m_bRemoveDirectory | CReleaseDlg |
m_strDirectory | CReleaseDlg |
Generated on Sun Feb 24 01:27:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CRtag_MAIN Member List

This is the complete list of members for CRtag_MAIN, including all inherited members.
CRtag_MAIN(kRtagDlgType type, const char *sLastModule, const char *sLastTag, bool noRecurs, bool lookAttic, bool overwriteExist=false) | CRtag_MAIN |
CRtag_MAIN() | CRtag_MAIN |
DoDataExchange(CDataExchange *pDX) | CRtag_MAIN | [protected, virtual]
IDD enum value | CRtag_MAIN |
m_grpBox | CRtag_MAIN |
m_lookAttic | CRtag_MAIN |
m_moduleCombo | CRtag_MAIN |
m_moduleDescStatic | CRtag_MAIN |
m_moduleName | CRtag_MAIN |
m_noRecurs | CRtag_MAIN |
m_overwriteExisting | CRtag_MAIN |
m_overwriteExistingCheck | CRtag_MAIN |
m_tagCombo | CRtag_MAIN |
m_tagDescStatic | CRtag_MAIN |
m_tagName | CRtag_MAIN |
m_type | CRtag_MAIN | [private]
OnInitDialog() | CRtag_MAIN | [protected, virtual]
~CRtag_MAIN() | CRtag_MAIN |
Generated on Sun Feb 24 01:27:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CRtag_OPTIONS Member List

This is the complete list of members for CRtag_OPTIONS, including all inherited members.
CRtag_OPTIONS(kRtagDlgType type, bool hasDate, bool hasRev, const char *sLastDate, const char *sLastRev, bool useMostRecent) | CRtag_OPTIONS |
CRtag_OPTIONS() | CRtag_OPTIONS |
DoDataExchange(CDataExchange *pDX) | CRtag_OPTIONS | [protected, virtual]
IDD enum value | CRtag_OPTIONS |
m_date | CRtag_OPTIONS |
m_dateCombo | CRtag_OPTIONS |
m_grpBox | CRtag_OPTIONS |
m_hasDate | CRtag_OPTIONS |
m_hasRev | CRtag_OPTIONS |
m_rev | CRtag_OPTIONS |
m_revCombo | CRtag_OPTIONS |
m_type | CRtag_OPTIONS | [private]
m_useMostRecent | CRtag_OPTIONS |
OnDate() | CRtag_OPTIONS | [protected]
OnInitDialog() | CRtag_OPTIONS | [protected, virtual]
OnRev() | CRtag_OPTIONS | [protected]
~CRtag_OPTIONS() | CRtag_OPTIONS |
Generated on Sun Feb 24 01:27:42 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

USmartCombo Member List

This is the complete list of members for USmartCombo, including all inherited members.
AutoDropWidth enum value | USmartCombo |
CalcDroppedWidth() | USmartCombo | [virtual]
DefaultFeature enum value | USmartCombo |
Feature enum name | USmartCombo |
GetItems() | USmartCombo |
HasFeature(int feature) const | USmartCombo |
m_feature | USmartCombo | [private]
m_pstrItems | USmartCombo | [private]
None enum value | USmartCombo |
ReadOnly enum value | USmartCombo |
RemoveItem(const char *strItem) | USmartCombo | [virtual]
RemoveItems enum value | USmartCombo |
SetFeature(int feature) | USmartCombo |
SetItems(CMString *pstrItems) | USmartCombo |
SetReadOnly(bool readOnly=true) | USmartCombo | [virtual]
USmartCombo(int feature) | USmartCombo |
~USmartCombo() | USmartCombo | [virtual]
Generated on Sun Feb 24 01:27:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CSmartComboBox Member List

This is the complete list of members for CSmartComboBox, including all inherited members.
AutoDropWidth enum value | USmartCombo |
CalcDroppedWidth() | CSmartComboBox | [private, virtual]
CSmartComboBox(int feature=USmartCombo::DefaultFeature) | CSmartComboBox |
DefaultFeature enum value | USmartCombo |
DelKeyTest(MSG *pMsg) | CSmartComboBox | [private]
Feature enum name | USmartCombo |
GetItems() | USmartCombo |
HasFeature(int feature) const | USmartCombo |
None enum value | USmartCombo |
OnDropdown() | CSmartComboBox | [protected]
OnSetFeature(WPARAM wParam, LPARAM lParam) | CSmartComboBox | [protected]
OnSetItems(WPARAM wParam, LPARAM lParam) | CSmartComboBox | [protected]
OnSetReadOnly(WPARAM wParam, LPARAM lParam) | CSmartComboBox | [protected]
PreSubclassWindow() | CSmartComboBox | [protected, virtual]
PreTranslateMessage(MSG *pMsg) | CSmartComboBox | [virtual]
ReadOnly enum value | USmartCombo |
RemoveItem(const char *strItem) | USmartCombo | [virtual]
RemoveItems enum value | USmartCombo |
SetFeature(int feature) | USmartCombo |
SetItems(CMString *pstrItems) | USmartCombo |
SetReadOnly(bool readOnly=true) | CSmartComboBox | [virtual]
USmartCombo(int feature) | USmartCombo |
~CSmartComboBox() | CSmartComboBox | [virtual]
~USmartCombo() | USmartCombo | [virtual]
Generated on Sun Feb 24 01:27:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CSortList Member List

This is the complete list of members for CSortList, including all inherited members.
CSortList(int def_size, QsortMethod method_sort) | CSortList | [inline]
Delete(const T &entry) | CSortList | [inline]
Entry(int num_elem) const | CSortList | [inline, private]
fDef | CSortList | [private]
fElems | CSortList | [private]
fMax | CSortList | [private]
fMethod | CSortList | [private]
fNewOne | CSortList | [private]
fNum | CSortList | [private]
Get(int index) const | CSortList | [inline]
Insert(const T &entry, bool replaceIfAlreadyExists=false) | CSortList | [inline]
Inside(const T &entry, int *indexptr=0L) const | CSortList | [inline]
InsideAndInsert(const T &entry, int *indexptr=0L, bool replaceIfAlreadyExists=false) | CSortList | [inline]
Location(const T &entry) | CSortList | [inline, private]
NumOfElements(void) | CSortList | [inline]
QsortMethod typedef | CSortList |
Reset(void) | CSortList | [inline]
Result(int *num_elem) | CSortList | [inline]
~CSortList() | CSortList | [inline]
Generated on Sun Feb 24 01:27:50 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CTag_MAIN Member List

This is the complete list of members for CTag_MAIN, including all inherited members.
CTag_MAIN(kTagDlgType type, const char *sLastTag, bool noRecurs, bool checkUnmod=false, bool overwriteExisting=false) | CTag_MAIN |
CTag_MAIN() | CTag_MAIN |
DoDataExchange(CDataExchange *pDX) | CTag_MAIN | [protected, virtual]
IDD enum value | CTag_MAIN |
m_checkUnmod | CTag_MAIN |
m_checkUnmodCheck | CTag_MAIN |
m_grpBox | CTag_MAIN |
m_noRecurs | CTag_MAIN |
m_overwriteExisting | CTag_MAIN |
m_overwriteExistingCheck | CTag_MAIN |
m_tagCombo | CTag_MAIN |
m_tagDescStatic | CTag_MAIN |
m_tagName | CTag_MAIN |
m_type | CTag_MAIN | [private]
OnInitDialog() | CTag_MAIN | [protected, virtual]
~CTag_MAIN() | CTag_MAIN |
Generated on Sun Feb 24 01:27:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CTCLBrowserEnt Member List

This is the complete list of members for CTCLBrowserEnt, including all inherited members.
CTCLBrowserEnt() | CTCLBrowserEnt | [inline]
CTCLBrowserEnt(EntnodeData *data) | CTCLBrowserEnt | [inline]
CTCLBrowserEnt(const CTCLBrowserEnt &ent) | CTCLBrowserEnt | [inline]
GetData() const | CTCLBrowserEnt | [inline]
GetNormalized(UStr &path, UStr &fname) const | CTCLBrowserEnt | [inline]
IsSamePath(const char *pathstr) const | CTCLBrowserEnt | [inline]
node | CTCLBrowserEnt | [private]
operator=(const CTCLBrowserEnt &ent) | CTCLBrowserEnt | [inline]
~CTCLBrowserEnt() | CTCLBrowserEnt | [inline]
Generated on Sun Feb 24 01:28:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CTCLCvsConsole Member List

This is the complete list of members for CTCLCvsConsole, including all inherited members.
CTCLCvsConsole(Tcl_Interp *interp) | CTCLCvsConsole | [inline]
cvs_err(char *txt, long len) | CTCLCvsConsole | [inline, virtual]
cvs_out(char *txt, long len) | CTCLCvsConsole | [inline, virtual]
fAlloc | CTCLCvsConsole | [protected]
fInterp | CTCLCvsConsole | [protected]
fLen | CTCLCvsConsole | [protected]
~CTCLCvsConsole() | CTCLCvsConsole | [inline, virtual]
Generated on Sun Feb 24 01:28:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CFillTclEntries Member List

This is the complete list of members for CFillTclEntries, including all inherited members.
CFillTclEntries(CSortList< ENTNODE > &entries) | CFillTclEntries | [inline]
EnterDirectory(const char *fullpath, const char *dirname, const FSSpec *macspec) | CFillTclEntries | [inline, virtual]
ExitDirectory(const char *fullpath) | CFillTclEntries | [inline, virtual]
gRunning | TraversalReport | [static]
m_entries | CFillTclEntries |
m_ignlist | CFillTclEntries |
OnAlias(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | CFillTclEntries | [inline, virtual]
OnAnyDevice(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnDirectory(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | CFillTclEntries | [inline, virtual]
OnError(const char *err, int errcode) | CFillTclEntries | [inline, virtual]
OnFile(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | CFillTclEntries | [inline, virtual]
OnIdle(const char *fullpath) | CFillTclEntries | [inline, virtual]
~CFillTclEntries() | CFillTclEntries | [inline, virtual]
Generated on Sun Feb 24 01:25:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

LSReport Member List

This is the complete list of members for LSReport, including all inherited members.
EnterDirectory(const char *fullpath, const char *dirname, const FSSpec *macspec) | LSReport | [inline, virtual]
ExitDirectory(const char *fullpath) | LSReport | [inline, virtual]
fInterp | LSReport |
fState | LSReport |
gRunning | TraversalReport | [static]
LSReport(Tcl_Interp *interp) | LSReport | [inline]
OnAlias(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnAnyDevice(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | LSReport | [inline, virtual]
OnDirectory(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnError(const char *err, int errcode) | LSReport | [inline, virtual]
OnFile(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnIdle(const char *fullpath) | LSReport | [inline, virtual]
Generated on Sun Feb 24 01:26:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CTcl_Interp Member List

This is the complete list of members for CTcl_Interp, including all inherited members.
CTcl_Interp() | CTcl_Interp |
Deunixfy(UStr &path) | CTcl_Interp | [static]
DoFile(const char *file) | CTcl_Interp |
DoScript(const char *script) | CTcl_Interp |
DoScriptVar(const char *format,...) | CTcl_Interp |
fExitOnError | CTcl_Interp | [protected]
fInterp | CTcl_Interp | [protected]
fLastErrorCode | CTcl_Interp | [protected]
GetCvsExitOnError() | CTcl_Interp | [inline]
GetCvsLastErrorCode() | CTcl_Interp | [inline]
IsAvail(void) | CTcl_Interp | [static]
operator Tcl_Interp *(void) | CTcl_Interp | [inline]
SetCvsExitOnError(bool value) | CTcl_Interp | [inline]
SetCvsLastErrorCode(int value) | CTcl_Interp | [inline]
Unixfy(UStr &path) | CTcl_Interp | [static]
~CTcl_Interp() | CTcl_Interp |
Generated on Sun Feb 24 01:28:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UCvsApp Member List

This is the complete list of members for UCvsApp, including all inherited members.
_GetBaseClass() | UCvsApp | [protected, static]
_messageEntries | UCvsApp | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUCmdTarget | UCmdTarget | [protected, static]
classUCvsApp | UCvsApp | [protected, static]
classUObject | UObject | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool) | UWidget | [inline, virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
Execute(int argc, char *const *argv) | UCvsApp |
gApp | UCvsApp | [static]
gCurCvs | UCvsApp | [static]
gCvsRunning | UCvsApp | [protected]
gCvsStopping | UCvsApp | [protected]
GetAppLibFolder(void) const | UCvsApp |
GetAppName(void) const | UCvsApp |
GetAppVersion(void) const | UCvsApp |
GetBaseMessageMap() | UCvsApp | [protected, static]
GetBrowserView(void) | UCvsApp |
GetCurModal() const | UWidget | [inline]
GetFilesView(void) | UCvsApp |
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UCvsApp | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UCvsApp | [virtual]
GetThisMessageMap() | UCvsApp | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsCvsRunning(void) | UCvsApp | [inline]
IsCvsStopping(void) | UCvsApp | [inline]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kProcessTimer enum value | UCvsApp |
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_overide | UWidget | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | UCvsApp | [protected, static]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnMainTimer(long time) | UCvsApp | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UWidget | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
rtUCmdTarget(void) | UCmdTarget | [static]
rtUCvsApp(void) | UCvsApp | [static]
rtUObject() | UObject | [static]
rtUWidget(void) | UWidget | [static]
SayWelcome(void) | UCvsApp |
SetCvsRunning(bool state) | UCvsApp |
SetCvsStopping(bool state) | UCvsApp |
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sValidMenu | UWidget | [protected, static]
UCmdTarget(int widid) | UCmdTarget |
UCvsApp(int argc, char **argv) | UCvsApp |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
UObject() | UObject | [inline, protected]
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UCmdTarget() | UCmdTarget | [virtual]
~UCvsApp() | UCvsApp | [virtual]
~UObject() | UObject | [inline, virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:25:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UCOLOR Member List

This is the complete list of members for UCOLOR, including all inherited members.
b | UCOLOR |
g | UCOLOR |
r | UCOLOR |
UCOLOR() | UCOLOR | [inline]
UCOLOR(char _r, char _g, char _b) | UCOLOR | [inline]
Generated on Sun Feb 24 01:25:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UCvsConsole Member List

This is the complete list of members for UCvsConsole, including all inherited members.
_GetBaseClass() | UCvsConsole | [protected, static]
_messageEntries | UCvsConsole | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
bold | UCvsConsole | [protected]
classUCmdTarget | UCmdTarget | [protected, static]
classUCvsConsole | UCvsConsole | [protected, static]
classUObject | UObject | [protected, static]
classUWidget | UWidget | [protected, static]
col | UCvsConsole | [protected]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool) | UWidget | [inline, virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
FeedThisLine(const char *buf, size_t numbuf, bool isStderr) | UCvsConsole | [protected]
GetBaseMessageMap() | UCvsConsole | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UCvsConsole | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UCvsConsole | [virtual]
GetThisMessageMap() | UCvsConsole | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
italic | UCvsConsole | [protected]
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_buf | UCvsConsole | [protected]
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_numbuf | UCvsConsole | [protected]
m_overide | UWidget | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
MAX_CHAR_BY_LINE enum value | UCvsConsole | [protected]
messageMap | UCvsConsole | [protected, static]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnCreate() | UCvsConsole | [protected]
OnDestroy() | UCvsConsole | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UWidget | [protected]
out | UCvsConsole | [protected]
OutColor(const char *txt, long len) | UCvsConsole |
OutColor(kConsoleColor color) | UCvsConsole |
OutConsole(const char *txt, size_t len, bool isStderr=false) | UCvsConsole |
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
rtUCmdTarget(void) | UCmdTarget | [static]
rtUCvsConsole(void) | UCvsConsole | [static]
rtUObject() | UObject | [static]
rtUWidget(void) | UWidget | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sValidMenu | UWidget | [protected, static]
UCmdTarget(int widid) | UCmdTarget |
UCvsConsole() | UCvsConsole |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
underline | UCvsConsole | [protected]
UObject() | UObject | [inline, protected]
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UCmdTarget() | UCmdTarget | [virtual]
~UCvsConsole() | UCvsConsole | [virtual]
~UObject() | UObject | [inline, virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:25:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TViewFill Member List

This is the complete list of members for TViewFill, including all inherited members.
EnterDirectory(const char *fullpath, const char *dirname, const FSSpec *macspec) | TViewFill | [inline, virtual]
EnterDirectory(const char *fullpath, const char *dirname, const FSSpec *macspec) | TViewFill | [inline, virtual]
ExitDirectory(const char *fullpath) | TViewFill | [inline, virtual]
ExitDirectory(const char *fullpath) | TViewFill | [inline, virtual]
GetListCtrl() const | TViewFill | [inline]
GetView() const | TViewFill | [inline]
gRunning | TraversalReport | [static]
InitItem(EntnodeData *data, int iImage, const char *tag=0L) | TViewFill | [inline]
IsRecursive() const | TViewFill | [inline]
IsShowIgnored() const | TViewFill | [inline]
m_context | TViewFill |
m_entries | TViewFill |
m_entries | TViewFill |
m_ignlist | TViewFill |
m_ignlist | TViewFill |
m_listCtrl | TViewFill |
OnAlias(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TViewFill | [inline, virtual]
OnAlias(const char *fullpath, const char *fullname, const char *name, const struct wnt_stat &dir, const FSSpec *macspec) | TViewFill | [inline, virtual]
OnAnyDevice(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnDirectory(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TViewFill | [inline, virtual]
OnDirectory(const char *fullpath, const char *fullname, const char *name, const struct wnt_stat &dir, const FSSpec *macspec) | TViewFill | [inline, virtual]
OnError(const char *err, int errcode) | TViewFill | [inline, virtual]
OnError(const char *err, int errcode) | TViewFill | [inline, virtual]
OnFile(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TViewFill | [inline, virtual]
OnFile(const char *fullpath, const char *fullname, const char *name, const struct wnt_stat &dir, const FSSpec *macspec) | TViewFill | [inline, virtual]
OnIdle(const char *fullpath) | TViewFill | [inline, virtual]
OnIdle(const char *fullpath) | TViewFill | [inline, virtual]
TViewFill(UCvsFiles *listCtrl, CSortList< ENTNODE > &entries) | TViewFill | [inline]
TViewFill(const KoTraversalContext *context) | TViewFill | [inline]
~TViewFill() | TViewFill | [inline, virtual]
Generated on Sun Feb 24 01:28:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UCvsFiles Member List

This is the complete list of members for UCvsFiles, including all inherited members.
_GetBaseClass() | UCvsFiles | [protected, static]
_messageEntries | UCvsFiles | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUCmdTarget | UCmdTarget | [protected, static]
classUCvsFiles | UCvsFiles | [protected, static]
classUObject | UObject | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
DisableGeneric() | UCvsFiles | [protected]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool) | UWidget | [inline, virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EditSel(EntnodeData *data, bool useDefault=false) | UCvsFiles | [protected]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UCvsFiles | [protected, static]
GetCurModal() const | UWidget | [inline]
GetEntriesModTime(time_t &newEntriesMod, time_t &newEntriesLogMod) | UCvsFiles | [protected]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetImageForEntry(EntnodeData *data) | UCvsFiles | [static]
GetMessageMap() const | UCvsFiles | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UCvsFiles | [virtual]
GetThisMessageMap() | UCvsFiles | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsSortAscendant(void) | UCvsFiles | [inline]
IsUIValid() | UWidget | [static]
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_ascendant | UCvsFiles | [protected]
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_entries | UCvsFiles | [protected]
m_entriesLogMod | UCvsFiles | [protected]
m_entriesMod | UCvsFiles | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_overide | UWidget | [protected]
m_path | UCvsFiles | [protected]
m_sort | UCvsFiles | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | UCvsFiles | [protected, static]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnCmdAdd(void) | UCvsFiles | [protected]
OnCmdAddb(void) | UCvsFiles | [protected]
OnCmdCommit(void) | UCvsFiles | [protected]
OnCmdDiff(void) | UCvsFiles | [protected]
OnCmdEdit(void) | UCvsFiles | [protected]
OnCmdEditors(void) | UCvsFiles | [protected]
OnCmdEditsel(void) | UCvsFiles | [protected]
OnCmdEditseldef(void) | UCvsFiles | [protected]
OnCmdExplore(void) | UCvsFiles | [protected]
OnCmdGraph(void) | UCvsFiles | [protected]
OnCmdIgnore(void) | UCvsFiles | [protected]
OnCmdLock(void) | UCvsFiles | [protected]
OnCmdLog(void) | UCvsFiles | [protected]
OnCmdQueryUpdate(void) | UCvsFiles | [protected]
OnCmdRelease(void) | UCvsFiles | [protected]
OnCmdReload(void) | UCvsFiles | [protected]
OnCmdRmv(void) | UCvsFiles | [protected]
OnCmdStatus(void) | UCvsFiles | [protected]
OnCmdTagBranch(void) | UCvsFiles | [protected]
OnCmdTagDelete(void) | UCvsFiles | [protected]
OnCmdTagNew(void) | UCvsFiles | [protected]
OnCmdTrash(void) | UCvsFiles | [protected]
OnCmdUIAdd(UCmdUI *pCmdUI) | UCvsFiles | [protected]
OnCmdUIAddB(UCmdUI *pCmdUI) | UCvsFiles | [protected]
OnCmdUIEditseldef(UCmdUI *pCmdUI) | UCvsFiles | [protected]
OnCmdUIExplore(UCmdUI *pCmdUI) | UCvsFiles | [protected]
OnCmdUIGraph(UCmdUI *pCmdUI) | UCvsFiles | [protected]
OnCmdUIIgnore(UCmdUI *pCmdUI) | UCvsFiles | [protected]
OnCmdUIMacroSel(int cmd, UCmdUI *pCmdUI) | UCvsFiles | [protected]
OnCmdUIRelease(UCmdUI *pCmdUI) | UCvsFiles | [protected]
OnCmdUIReload(UCmdUI *pCmdUI) | UCvsFiles | [protected]
OnCmdUIRmv(UCmdUI *pCmdUI) | UCvsFiles | [protected]
OnCmdUITrash(UCmdUI *pCmdUI) | UCvsFiles | [protected]
OnCmdUIUpdate(UCmdUI *pCmdUI) | UCvsFiles | [protected]
OnCmdUIUpone(UCmdUI *pCmdUI) | UCvsFiles | [protected]
OnCmdUnedit(void) | UCvsFiles | [protected]
OnCmdUnlock(void) | UCvsFiles | [protected]
OnCmdUpdate(void) | UCvsFiles | [protected]
OnCmdUpone(void) | UCvsFiles | [protected]
OnCmdWatchers(void) | UCvsFiles | [protected]
OnCmdWatchOff(void) | UCvsFiles | [protected]
OnCmdWatchOn(void) | UCvsFiles | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnCreate() | UCvsFiles | [protected]
OnDblClick(void) | UCvsFiles | [protected]
OnDestroy() | UCvsFiles | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnMacroSel(int cmd) | UCvsFiles | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSelColumn(int column) | UCvsFiles | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UWidget | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
ResetView(const char *path, bool notifyBrowser=false) | UCvsFiles |
ResetView(bool forceReload=false, bool notifyBrowser=false) | UCvsFiles |
Resort(void) | UCvsFiles | [protected]
rtUCmdTarget(void) | UCmdTarget | [static]
rtUCvsFiles(void) | UCvsFiles | [static]
rtUObject() | UObject | [static]
rtUWidget(void) | UWidget | [static]
Search(const char *title) | UCvsFiles | [protected]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sValidMenu | UWidget | [protected, static]
UCmdTarget(int widid) | UCmdTarget |
UCvsFiles() | UCvsFiles |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
UObject() | UObject | [inline, protected]
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UCmdTarget() | UCmdTarget | [virtual]
~UCvsFiles() | UCvsFiles | [virtual]
~UObject() | UObject | [inline, virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:25:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CTempToggleBool Member List

This is the complete list of members for CTempToggleBool, including all inherited members.
CTempToggleBool(bool &value) | CTempToggleBool | [inline]
m_didSetIt | CTempToggleBool | [protected]
m_value | CTempToggleBool | [protected]
~CTempToggleBool() | CTempToggleBool | [inline]
Generated on Sun Feb 24 01:28:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TBrowserFillDummy Member List

This is the complete list of members for TBrowserFillDummy, including all inherited members.
EnterDirectory(const char *fullpath, const char *dirname, const FSSpec *macspec) | TBrowserFillDummy | [inline, virtual]
EnterDirectory(const char *fullpath, const char *dirname, const FSSpec *macspec) | TBrowserFillDummy | [inline, virtual]
ExitDirectory(const char *fullpath) | TBrowserFillDummy | [inline, virtual]
ExitDirectory(const char *fullpath) | TBrowserFillDummy | [inline, virtual]
gRunning | TraversalReport | [static]
m_data | TBrowserFillDummy |
m_data | TBrowserFillDummy |
m_dirname | TBrowserFillDummy |
m_empty | TBrowserFillDummy |
m_hascvs | TBrowserFillDummy |
m_item | TBrowserFillDummy |
m_item | TBrowserFillDummy |
m_root | TBrowserFillDummy |
m_root | TBrowserFillDummy |
m_treeCtrl | TBrowserFillDummy |
m_treeCtrl | TBrowserFillDummy |
OnAlias(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnAnyDevice(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnDirectory(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TBrowserFillDummy | [inline, virtual]
OnDirectory(const char *fullpath, const char *fullname, const char *name, const struct wnt_stat &dir, const FSSpec *macspec) | TBrowserFillDummy | [inline, virtual]
OnError(const char *err, int errcode) | TBrowserFillDummy | [inline, virtual]
OnError(const char *err, int errcode) | TBrowserFillDummy | [inline, virtual]
OnFile(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnIdle(const char *fullpath) | TBrowserFillDummy | [inline, virtual]
OnIdle(const char *fullpath) | TBrowserFillDummy | [inline, virtual]
TBrowserFillDummy(UCvsFolders *treeCtrl, UTREEITEM root, UTREEITEM item, EntnodeData *data) | TBrowserFillDummy | [inline]
TBrowserFillDummy(CTreeCtrl &treeCtrl, HTREEITEM root, HTREEITEM item, EntnodeData *data) | TBrowserFillDummy | [inline]
~TBrowserFillDummy() | TBrowserFillDummy | [inline, virtual]
Generated on Sun Feb 24 01:28:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TBrowserFill Member List

This is the complete list of members for TBrowserFill, including all inherited members.
EnterDirectory(const char *fullpath, const char *dirname, const FSSpec *macspec) | TBrowserFill | [inline, virtual]
EnterDirectory(const char *fullpath, const char *dirname, const FSSpec *macspec) | TBrowserFill | [inline, virtual]
ExitDirectory(const char *fullpath) | TBrowserFill | [inline, virtual]
ExitDirectory(const char *fullpath) | TBrowserFill | [inline, virtual]
gRunning | TraversalReport | [static]
m_entries | TBrowserFill |
m_entries | TBrowserFill |
m_hascvs | TBrowserFill |
m_ignlist | TBrowserFill |
m_ignlist | TBrowserFill |
m_isShowIgnored | TBrowserFill |
m_item | TBrowserFill |
m_item | TBrowserFill |
m_root | TBrowserFill |
m_root | TBrowserFill |
m_treeCtrl | TBrowserFill |
m_treeCtrl | TBrowserFill |
OnAlias(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnAnyDevice(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnDirectory(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TBrowserFill | [inline, virtual]
OnDirectory(const char *fullpath, const char *fullname, const char *name, const struct wnt_stat &dir, const FSSpec *macspec) | TBrowserFill | [inline, virtual]
OnError(const char *err, int errcode) | TBrowserFill | [inline, virtual]
OnError(const char *err, int errcode) | TBrowserFill | [inline, virtual]
OnFile(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | TraversalReport | [inline, virtual]
OnIdle(const char *fullpath) | TBrowserFill | [inline, virtual]
OnIdle(const char *fullpath) | TBrowserFill | [inline, virtual]
TBrowserFill(UCvsFolders *treeCtrl, UTREEITEM root, UTREEITEM item, CSortList< ENTNODE > &entries) | TBrowserFill | [inline]
TBrowserFill(CTreeCtrl &treeCtrl, HTREEITEM root, HTREEITEM item, CSortList< ENTNODE > &entries) | TBrowserFill | [inline]
~TBrowserFill() | TBrowserFill | [inline, virtual]
Generated on Sun Feb 24 01:28:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UCvsFolders Member List

This is the complete list of members for UCvsFolders, including all inherited members.
_GetBaseClass() | UCvsFolders | [protected, static]
_messageEntries | UCvsFolders | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUCmdTarget | UCmdTarget | [protected, static]
classUCvsFolders | UCvsFolders | [protected, static]
classUObject | UObject | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
DeleteAllItems(UTREEITEM root=0L) | UCvsFolders |
DisableGeneric() | UCvsFolders | [protected]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool) | UWidget | [inline, virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UCvsFolders | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetItemByLocation(const char *path) | UCvsFolders | [protected]
GetMessageMap() const | UCvsFolders | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRoot(void) const | UCvsFolders | [inline]
GetRuntimeClass() const | UCvsFolders | [virtual]
GetThisMessageMap() | UCvsFolders | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_overide | UWidget | [protected]
m_root | UCvsFolders | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | UCvsFolders | [protected, static]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnCmdAdd(void) | UCvsFolders | [protected]
OnCmdCheckout(void) | UCvsFolders | [protected]
OnCmdCommit(void) | UCvsFolders | [protected]
OnCmdDiff(void) | UCvsFolders | [protected]
OnCmdEdit(void) | UCvsFolders | [protected]
OnCmdEditors(void) | UCvsFolders | [protected]
OnCmdExplore(void) | UCvsFolders | [protected]
OnCmdIgnore(void) | UCvsFolders | [protected]
OnCmdImport(void) | UCvsFolders | [protected]
OnCmdLock(void) | UCvsFolders | [protected]
OnCmdLog(void) | UCvsFolders | [protected]
OnCmdMacrosSel(int cmd) | UCvsFolders | [protected]
OnCmdQueryUpdate(void) | UCvsFolders | [protected]
OnCmdRelease(void) | UCvsFolders | [protected]
OnCmdReload(void) | UCvsFolders | [protected]
OnCmdStatus(void) | UCvsFolders | [protected]
OnCmdTagBranch(void) | UCvsFolders | [protected]
OnCmdTagDelete(void) | UCvsFolders | [protected]
OnCmdTagNew(void) | UCvsFolders | [protected]
OnCmdUIAdd(UCmdUI *pCmdUI) | UCvsFolders | [protected]
OnCmdUICheckout(UCmdUI *pCmdUI) | UCvsFolders | [protected]
OnCmdUIExplore(UCmdUI *pCmdUI) | UCvsFolders | [protected]
OnCmdUIIgnore(UCmdUI *pCmdUI) | UCvsFolders | [protected]
OnCmdUIImport(UCmdUI *pCmdUI) | UCvsFolders | [protected]
OnCmdUIMacrosSel(int cmd, UCmdUI *pCmdUI) | UCvsFolders | [protected]
OnCmdUIReload(UCmdUI *pCmdUI) | UCvsFolders | [protected]
OnCmdUIUpdate(UCmdUI *pCmdUI) | UCvsFolders | [protected]
OnCmdUnedit(void) | UCvsFolders | [protected]
OnCmdUnlock(void) | UCvsFolders | [protected]
OnCmdUpdate(void) | UCvsFolders | [protected]
OnCmdWatchers(void) | UCvsFolders | [protected]
OnCmdWatchOff(void) | UCvsFolders | [protected]
OnCmdWatchOn(void) | UCvsFolders | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnCreate() | UCvsFolders | [protected]
OnDestroy() | UCvsFolders | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeExpanding(int collapse, UTREEITEM item) | UCvsFolders | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSelecting(int deselect, UTREEITEM item) | UCvsFolders | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateGeneric(UCmdUI *pCmdUI, bool needCvsInfos) | UCvsFolders | [protected]
OnUpdateUI(void) | UWidget | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
ResetBrowser(const char *path, bool notifyView=false) | UCvsFolders |
ResetView(bool forceReload=false, bool notifyView=false) | UCvsFolders |
RetrievePath(UTREEITEM item, UStr &path) | UCvsFolders |
rtUCmdTarget(void) | UCmdTarget | [static]
rtUCvsFolders(void) | UCvsFolders | [static]
rtUObject() | UObject | [static]
rtUWidget(void) | UWidget | [static]
SetDefaultRoot(const char *root) | UCvsFolders | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
StepToLocation(const char *path, bool notifyView=false) | UCvsFolders |
StoreExpanded(std::vector< UStr > &allExpanded, UTREEITEM root=0L) | UCvsFolders | [protected]
sValidMenu | UWidget | [protected, static]
UCmdTarget(int widid) | UCmdTarget |
UCvsFolders() | UCvsFolders |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
UObject() | UObject | [inline, protected]
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UCmdTarget() | UCmdTarget | [virtual]
~UCvsFolders() | UCvsFolders | [virtual]
~UObject() | UObject | [inline, virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:25:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UCvsFrame Member List

This is the complete list of members for UCvsFrame, including all inherited members.
_GetBaseClass() | UCvsFrame | [protected, static]
_messageEntries | UCvsFrame | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
AskForQuitting(void) | UCvsFrame |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUCmdTarget | UCmdTarget | [protected, static]
classUCvsFrame | UCvsFrame | [protected, static]
classUObject | UObject | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool) | UWidget | [inline, virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UCvsFrame | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UCvsFrame | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UCvsFrame | [virtual]
GetThisMessageMap() | UCvsFrame | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kBrowserPopup enum value | UCvsFrame |
kDirCombo enum value | UCvsFrame |
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_overide | UWidget | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | UCvsFrame | [protected, static]
OnBrowserPopup(void) | UCvsFrame | [protected]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnCmdCmdline(void) | UCvsFrame | [protected]
OnCmdInit(void) | UCvsFrame | [protected]
OnCmdLogin(void) | UCvsFrame | [protected]
OnCmdLogout(void) | UCvsFrame | [protected]
OnCmdMacroAdmin(int cmd) | UCvsFrame | [protected]
OnCmdPreferences(void) | UCvsFrame | [protected]
OnCmdRtagBranch(void) | UCvsFrame | [protected]
OnCmdRtagDelete(void) | UCvsFrame | [protected]
OnCmdRtagNew(void) | UCvsFrame | [protected]
OnCmdSaveSettings(void) | UCvsFrame | [protected]
OnCmdStopcvs(void) | UCvsFrame | [protected]
OnCmdUIAnytime(int cmd, UCmdUI *pCmdUI) | UCvsFrame | [protected]
OnCmdUICvsCmd(UCmdUI *pCmdUI) | UCvsFrame | [protected]
OnCmdUIMacroAdmin(int cmd, UCmdUI *pCmdUI) | UCvsFrame | [protected]
OnCmdUIQuit(UCmdUI *pCmdUI) | UCvsFrame | [protected]
OnCmdUIStopcvs(UCmdUI *pCmdUI) | UCvsFrame | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSelDir(int pos, const char *txt) | UCvsFrame | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnCopyrights(void) | UCvsFrame | [protected]
OnCredits(void) | UCvsFrame | [protected]
OnDestroy(void) | UCvsFrame | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnQuit(void) | UCvsFrame | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UWidget | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
rtUCmdTarget(void) | UCmdTarget | [static]
rtUCvsFrame(void) | UCvsFrame | [static]
rtUObject() | UObject | [static]
rtUWidget(void) | UWidget | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sValidMenu | UWidget | [protected, static]
UCmdTarget(int widid) | UCmdTarget |
UCvsFrame() | UCvsFrame |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
UObject() | UObject | [inline, protected]
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UCmdTarget() | UCmdTarget | [virtual]
~UCvsFrame() | UCvsFrame | [virtual]
~UObject() | UObject | [inline, virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:25:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UWaitCursor Member List

This is the complete list of members for UWaitCursor, including all inherited members.
UWaitCursor() | UWaitCursor | [inline]
~UWaitCursor() | UWaitCursor | [inline, virtual]
Generated on Sun Feb 24 01:28:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CScrollView Member List

This is the complete list of members for CScrollView, including all inherited members.
GetDeviceScrollPosition() | CScrollView | [inline]
InvalidateRect(const URECT *r) | CScrollView | [inline]
Generated on Sun Feb 24 01:27:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CWinLogData Member List

This is the complete list of members for CWinLogData, including all inherited members.
Bounds(void) | CWinLogData | [inline]
Bounds(void) | CWinLogData | [inline]
ComputeBounds(const UPoint &topLeft, UDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
ComputeBounds(const CPoint &topLeft, CDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
CreateNewData(CLogNode *node) | CWinLogData | [static]
CreateNewData(CLogNode *node) | CWinLogData | [static]
CWinLogData(CLogNode *node) | CWinLogData |
CWinLogData(CLogNode *node) | CWinLogData |
GetBoundsSelf(UDC &hdc, EntnodeData *entryInfo)=0 | CWinLogData | [protected, pure virtual]
GetBoundsSelf(CDC &hdc, EntnodeData *entryInfo)=0 | CWinLogData | [protected, pure virtual]
GetData(CLogNode *node) | CWinLogData | [inline, protected]
GetData(CLogNode *node) | CWinLogData | [inline, protected]
GetStr(void) | CWinLogData |
GetStr(void) | CWinLogData |
GetType(void) const | CWinLogData | [inline]
GetType(void) const | CWinLogData | [inline]
HitTest(UPoint point) | CWinLogData |
HitTest(CPoint point) | CWinLogData |
IsDeadNode() | CWinLogData |
IsDiskNode(EntnodeData *entryInfo) | CWinLogData |
IsDiskNode(EntnodeData *entryInfo) | CWinLogData |
IsUserState() | CWinLogData |
Offset(UPoint o) | CWinLogData |
Offset(CPoint o) | CWinLogData |
sel | CWinLogData | [protected]
Selected(void) const | CWinLogData | [inline]
Selected(void) const | CWinLogData | [inline]
selfB | CWinLogData | [protected]
selfB | CWinLogData | [protected]
SelfBounds(void) | CWinLogData | [inline]
SelfBounds(void) | CWinLogData | [inline]
SetSelected(CScrollView *view, bool state) | CWinLogData |
SetSelected(CScrollView *view, bool state) | CWinLogData |
totB | CWinLogData | [protected]
totB | CWinLogData | [protected]
UnselectAll(CScrollView *view) | CWinLogData |
UnselectAll(CScrollView *view) | CWinLogData |
Update(UDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
Update(CDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
UpdateSelf(UDC &hdc, EntnodeData *entryInfo)=0 | CWinLogData | [protected, pure virtual]
UpdateSelf(CDC &hdc, EntnodeData *entryInfo)=0 | CWinLogData | [protected, pure virtual]
~CWinLogData() | CWinLogData | [virtual]
~CWinLogData() | CWinLogData | [virtual]
Generated on Sun Feb 24 01:29:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CWinLogHeaderData Member List

This is the complete list of members for CWinLogHeaderData, including all inherited members.
Bounds(void) | CWinLogData | [inline]
Bounds(void) | CWinLogData | [inline]
ComputeBounds(const UPoint &topLeft, UDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
ComputeBounds(const CPoint &topLeft, CDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
CreateNewData(CLogNode *node) | CWinLogData | [static]
CreateNewData(CLogNode *node) | CWinLogData | [static]
CWinLogData(CLogNode *node) | CWinLogData |
CWinLogData(CLogNode *node) | CWinLogData |
CWinLogHeaderData(CLogNode *node) | CWinLogHeaderData | [inline]
CWinLogHeaderData(CLogNode *node) | CWinLogHeaderData | [inline]
GetBoundsSelf(UDC &hdc, EntnodeData *entryInfo) | CWinLogHeaderData | [protected, virtual]
GetBoundsSelf(CDC &hdc, EntnodeData *entryInfo) | CWinLogHeaderData | [protected, virtual]
GetData(CLogNode *node) | CWinLogData | [inline, protected]
GetData(CLogNode *node) | CWinLogData | [inline, protected]
GetStr(void) | CWinLogData |
GetStr(void) | CWinLogData |
GetType(void) const | CWinLogData | [inline]
GetType(void) const | CWinLogData | [inline]
HitTest(UPoint point) | CWinLogData |
HitTest(CPoint point) | CWinLogData |
IsDeadNode() | CWinLogData |
IsDiskNode(EntnodeData *entryInfo) | CWinLogData |
IsDiskNode(EntnodeData *entryInfo) | CWinLogData |
IsUserState() | CWinLogData |
Offset(UPoint o) | CWinLogData |
Offset(CPoint o) | CWinLogData |
sel | CWinLogData | [protected]
Selected(void) const | CWinLogData | [inline]
Selected(void) const | CWinLogData | [inline]
selfB | CWinLogData | [protected]
selfB | CWinLogData | [protected]
SelfBounds(void) | CWinLogData | [inline]
SelfBounds(void) | CWinLogData | [inline]
SetSelected(CScrollView *view, bool state) | CWinLogData |
SetSelected(CScrollView *view, bool state) | CWinLogData |
totB | CWinLogData | [protected]
totB | CWinLogData | [protected]
UnselectAll(CScrollView *view) | CWinLogData |
UnselectAll(CScrollView *view) | CWinLogData |
Update(UDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
Update(CDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
UpdateSelf(UDC &hdc, EntnodeData *entryInfo) | CWinLogHeaderData | [protected, virtual]
UpdateSelf(CDC &hdc, EntnodeData *entryInfo) | CWinLogHeaderData | [protected, virtual]
~CWinLogData() | CWinLogData | [virtual]
~CWinLogData() | CWinLogData | [virtual]
~CWinLogHeaderData() | CWinLogHeaderData | [inline, virtual]
~CWinLogHeaderData() | CWinLogHeaderData | [inline, virtual]
Generated on Sun Feb 24 01:29:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CWinLogRevData Member List

This is the complete list of members for CWinLogRevData, including all inherited members.
Bounds(void) | CWinLogData | [inline]
Bounds(void) | CWinLogData | [inline]
ComputeBounds(const UPoint &topLeft, UDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
ComputeBounds(const CPoint &topLeft, CDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
CreateNewData(CLogNode *node) | CWinLogData | [static]
CreateNewData(CLogNode *node) | CWinLogData | [static]
CWinLogData(CLogNode *node) | CWinLogData |
CWinLogData(CLogNode *node) | CWinLogData |
CWinLogRevData(CLogNode *node) | CWinLogRevData | [inline]
CWinLogRevData(CLogNode *node) | CWinLogRevData | [inline]
GetBoundsSelf(UDC &hdc, EntnodeData *entryInfo) | CWinLogRevData | [protected, virtual]
GetBoundsSelf(CDC &hdc, EntnodeData *entryInfo) | CWinLogRevData | [protected, virtual]
GetData(CLogNode *node) | CWinLogData | [inline, protected]
GetData(CLogNode *node) | CWinLogData | [inline, protected]
GetStr(void) | CWinLogData |
GetStr(void) | CWinLogData |
GetType(void) const | CWinLogData | [inline]
GetType(void) const | CWinLogData | [inline]
HitTest(UPoint point) | CWinLogData |
HitTest(CPoint point) | CWinLogData |
IsDeadNode() | CWinLogData |
IsDiskNode(EntnodeData *entryInfo) | CWinLogData |
IsDiskNode(EntnodeData *entryInfo) | CWinLogData |
IsUserState() | CWinLogData |
Offset(UPoint o) | CWinLogData |
Offset(CPoint o) | CWinLogData |
sel | CWinLogData | [protected]
Selected(void) const | CWinLogData | [inline]
Selected(void) const | CWinLogData | [inline]
selfB | CWinLogData | [protected]
selfB | CWinLogData | [protected]
SelfBounds(void) | CWinLogData | [inline]
SelfBounds(void) | CWinLogData | [inline]
SetSelected(CScrollView *view, bool state) | CWinLogData |
SetSelected(CScrollView *view, bool state) | CWinLogData |
totB | CWinLogData | [protected]
totB | CWinLogData | [protected]
UnselectAll(CScrollView *view) | CWinLogData |
UnselectAll(CScrollView *view) | CWinLogData |
Update(UDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
Update(CDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
UpdateSelf(UDC &hdc, EntnodeData *entryInfo) | CWinLogRevData | [protected, virtual]
UpdateSelf(CDC &hdc, EntnodeData *entryInfo) | CWinLogRevData | [protected, virtual]
~CWinLogData() | CWinLogData | [virtual]
~CWinLogData() | CWinLogData | [virtual]
~CWinLogRevData() | CWinLogRevData | [inline, virtual]
~CWinLogRevData() | CWinLogRevData | [inline, virtual]
Generated on Sun Feb 24 01:29:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CWinLogTagData Member List

This is the complete list of members for CWinLogTagData, including all inherited members.
Bounds(void) | CWinLogData | [inline]
Bounds(void) | CWinLogData | [inline]
ComputeBounds(const UPoint &topLeft, UDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
ComputeBounds(const CPoint &topLeft, CDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
CreateNewData(CLogNode *node) | CWinLogData | [static]
CreateNewData(CLogNode *node) | CWinLogData | [static]
CWinLogData(CLogNode *node) | CWinLogData |
CWinLogData(CLogNode *node) | CWinLogData |
CWinLogTagData(CLogNode *node) | CWinLogTagData | [inline]
CWinLogTagData(CLogNode *node) | CWinLogTagData | [inline]
GetBoundsSelf(UDC &hdc, EntnodeData *entryInfo) | CWinLogTagData | [protected, virtual]
GetBoundsSelf(CDC &hdc, EntnodeData *entryInfo) | CWinLogTagData | [protected, virtual]
GetData(CLogNode *node) | CWinLogData | [inline, protected]
GetData(CLogNode *node) | CWinLogData | [inline, protected]
GetStr(void) | CWinLogData |
GetStr(void) | CWinLogData |
GetType(void) const | CWinLogData | [inline]
GetType(void) const | CWinLogData | [inline]
HitTest(UPoint point) | CWinLogData |
HitTest(CPoint point) | CWinLogData |
IsDeadNode() | CWinLogData |
IsDiskNode(EntnodeData *entryInfo) | CWinLogData |
IsDiskNode(EntnodeData *entryInfo) | CWinLogData |
IsUserState() | CWinLogData |
Offset(UPoint o) | CWinLogData |
Offset(CPoint o) | CWinLogData |
sel | CWinLogData | [protected]
Selected(void) const | CWinLogData | [inline]
Selected(void) const | CWinLogData | [inline]
selfB | CWinLogData | [protected]
selfB | CWinLogData | [protected]
SelfBounds(void) | CWinLogData | [inline]
SelfBounds(void) | CWinLogData | [inline]
SetSelected(CScrollView *view, bool state) | CWinLogData |
SetSelected(CScrollView *view, bool state) | CWinLogData |
totB | CWinLogData | [protected]
totB | CWinLogData | [protected]
UnselectAll(CScrollView *view) | CWinLogData |
UnselectAll(CScrollView *view) | CWinLogData |
Update(UDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
Update(CDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
UpdateSelf(UDC &hdc, EntnodeData *entryInfo) | CWinLogTagData | [protected, virtual]
UpdateSelf(CDC &hdc, EntnodeData *entryInfo) | CWinLogTagData | [protected, virtual]
~CWinLogData() | CWinLogData | [virtual]
~CWinLogData() | CWinLogData | [virtual]
~CWinLogTagData() | CWinLogTagData | [inline, virtual]
~CWinLogTagData() | CWinLogTagData | [inline, virtual]
Generated on Sun Feb 24 01:29:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CWinLogBranchData Member List

This is the complete list of members for CWinLogBranchData, including all inherited members.
Bounds(void) | CWinLogData | [inline]
Bounds(void) | CWinLogData | [inline]
ComputeBounds(const UPoint &topLeft, UDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
ComputeBounds(const CPoint &topLeft, CDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
CreateNewData(CLogNode *node) | CWinLogData | [static]
CreateNewData(CLogNode *node) | CWinLogData | [static]
CWinLogBranchData(CLogNode *node) | CWinLogBranchData | [inline]
CWinLogBranchData(CLogNode *node) | CWinLogBranchData | [inline]
CWinLogData(CLogNode *node) | CWinLogData |
CWinLogData(CLogNode *node) | CWinLogData |
GetBoundsSelf(UDC &hdc, EntnodeData *entryInfo) | CWinLogBranchData | [protected, virtual]
GetBoundsSelf(CDC &hdc, EntnodeData *entryInfo) | CWinLogBranchData | [protected, virtual]
GetData(CLogNode *node) | CWinLogData | [inline, protected]
GetData(CLogNode *node) | CWinLogData | [inline, protected]
GetStr(void) | CWinLogData |
GetStr(void) | CWinLogData |
GetType(void) const | CWinLogData | [inline]
GetType(void) const | CWinLogData | [inline]
HitTest(UPoint point) | CWinLogData |
HitTest(CPoint point) | CWinLogData |
IsDeadNode() | CWinLogData |
IsDiskNode(EntnodeData *entryInfo) | CWinLogData |
IsDiskNode(EntnodeData *entryInfo) | CWinLogData |
IsUserState() | CWinLogData |
Offset(UPoint o) | CWinLogData |
Offset(CPoint o) | CWinLogData |
sel | CWinLogData | [protected]
Selected(void) const | CWinLogData | [inline]
Selected(void) const | CWinLogData | [inline]
selfB | CWinLogData | [protected]
selfB | CWinLogData | [protected]
SelfBounds(void) | CWinLogData | [inline]
SelfBounds(void) | CWinLogData | [inline]
SetSelected(CScrollView *view, bool state) | CWinLogData |
SetSelected(CScrollView *view, bool state) | CWinLogData |
totB | CWinLogData | [protected]
totB | CWinLogData | [protected]
UnselectAll(CScrollView *view) | CWinLogData |
UnselectAll(CScrollView *view) | CWinLogData |
Update(UDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
Update(CDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
UpdateSelf(UDC &hdc, EntnodeData *entryInfo) | CWinLogBranchData | [protected, virtual]
UpdateSelf(CDC &hdc, EntnodeData *entryInfo) | CWinLogBranchData | [protected, virtual]
~CWinLogBranchData() | CWinLogBranchData | [inline, virtual]
~CWinLogBranchData() | CWinLogBranchData | [inline, virtual]
~CWinLogData() | CWinLogData | [virtual]
~CWinLogData() | CWinLogData | [virtual]
Generated on Sun Feb 24 01:29:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UCvsGraph Member List

This is the complete list of members for UCvsGraph, including all inherited members.
_GetBaseClass() | UCvsGraph | [protected, static]
_messageEntries | UCvsGraph | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
CalcImageSize(void) | UCvsGraph | [protected]
classUCmdTarget | UCmdTarget | [protected, static]
classUCvsGraph | UCvsGraph | [protected, static]
classUObject | UObject | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool) | UWidget | [inline, virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UCvsGraph | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UCvsGraph | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UCvsGraph | [virtual]
GetThisMessageMap() | UCvsGraph | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kDrawing enum value | UCvsGraph |
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_data | UCvsGraph | [protected]
m_dir | UCvsGraph | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_name | UCvsGraph | [protected]
m_node | UCvsGraph | [protected]
m_noDispatch | UWidget | [protected]
m_overide | UWidget | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | UCvsGraph | [protected, static]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnCreate() | UCvsGraph | [protected]
OnDestroy() | UCvsGraph | [protected]
OnDrawing(void *info) | UCvsGraph | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UWidget | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
rtUCmdTarget(void) | UCmdTarget | [static]
rtUCvsGraph(void) | UCvsGraph | [static]
rtUObject() | UObject | [static]
rtUWidget(void) | UWidget | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sValidMenu | UWidget | [protected, static]
UCmdTarget(int widid) | UCmdTarget |
UCvsGraph(CLogNode *node, const char *dir) | UCvsGraph |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
UObject() | UObject | [inline, protected]
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UCmdTarget() | UCmdTarget | [virtual]
~UCvsGraph() | UCvsGraph | [virtual]
~UObject() | UObject | [inline, virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:25:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UCvsMenubar Member List

This is the complete list of members for UCvsMenubar, including all inherited members.
_GetBaseClass() | UCvsMenubar | [protected, static]
_messageEntries | UCvsMenubar | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUCmdTarget | UCmdTarget | [protected, static]
classUCvsMenubar | UCvsMenubar | [protected, static]
classUMenu | UMenu | [protected, static]
classUObject | UObject | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool) | UWidget | [inline, virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UCvsMenubar | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UCvsMenubar | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UCvsMenubar | [virtual]
GetThisMessageMap() | UCvsMenubar | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_overide | UWidget | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | UCvsMenubar | [protected, static]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnCommands(int cmd) | UMenu | [protected]
OnCreate() | UCvsMenubar | [protected]
OnDestroy() | UCvsMenubar | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UWidget | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UMenu | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
rtUCmdTarget(void) | UCmdTarget | [static]
rtUCvsMenubar(void) | UCvsMenubar | [static]
rtUMenu(void) | UMenu | [static]
rtUObject() | UObject | [static]
rtUWidget(void) | UWidget | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sValidMenu | UWidget | [protected, static]
UCmdTarget(int widid) | UCmdTarget |
UCvsMenubar() | UCvsMenubar |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UWidget | [virtual]
UMenu(int widid) | UMenu |
UObject() | UObject | [inline, protected]
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UCmdTarget() | UCmdTarget | [virtual]
~UCvsMenubar() | UCvsMenubar | [virtual]
~UMenu() | UMenu | [virtual]
~UObject() | UObject | [inline, virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:25:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

UCvsToolbar Member List

This is the complete list of members for UCvsToolbar, including all inherited members.
_GetBaseClass() | UCvsToolbar | [protected, static]
_messageEntries | UCvsToolbar | [private, static]
AddListener(UCmdTarget *listener) | UWidget | [virtual]
AddPage(UWidget *page, int pagecmd, int num_page) | UWidget |
AddTimer(long lap, int cmd) | UWidget |
AddTooltip(int cmd, const char *tooltipID) | UWidget |
BeforeUpdateUI(void) | UWidget | [inline, virtual]
classUCmdTarget | UCmdTarget | [protected, static]
classUCvsToolbar | UCvsToolbar | [protected, static]
classUObject | UObject | [protected, static]
classUToolbar | UToolbar | [protected, static]
classUWidget | UWidget | [protected, static]
CreateObject(const char *className) | UObject | [static]
Dismiss(void) | UWidget | [inline, virtual]
DoDataExchange(bool) | UWidget | [inline, virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UCvsToolbar | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UCvsToolbar | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UCvsToolbar | [virtual]
GetThisMessageMap() | UCvsToolbar | [protected, static]
GetTimers(void) | UWidget |
GetTooltip(int cmd) const | UWidget |
GetWidget(int cmd) const | UWidget |
GetWidgets(void) | UWidget | [inline]
GetWidID(void) const | UCmdTarget | [inline]
HasFocus(void) | UWidget | [inline]
HasFocus(int cmdid) | UWidget | [inline]
HasModal(void) | UWidget | [static]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsUIValid() | UWidget | [static]
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
m_curModal | UWidget | [protected]
m_currentPage | UWidget | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_overide | UWidget | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
m_winInfo | UToolbar | [protected]
m_wndToolBar | UToolbar | [protected]
messageMap | UCvsToolbar | [protected, static]
OnChgCursor(int cmd, UCURSOR cursor) | UWidget | [protected]
OnChgFocus(int cmd) | UWidget | [protected]
OnComboAppend(int cmd, const char *txt) | UWidget | [protected]
OnComboDelSel(int cmd, int sel) | UWidget | [protected]
OnComboEnableSel(int cmd, int sel, int state) | UWidget | [protected]
OnComboGetCount(int cmd) | UWidget | [protected]
OnComboGetMenu(int cmd, UMENU *menu) | UWidget | [protected]
OnComboGetPos(int cmd, UStr *txt) | UWidget | [protected]
OnComboResetAll(int cmd) | UWidget | [protected]
OnComboSetPos(int cmd, int sel) | UWidget | [protected]
OnCommands(int cmd) | UToolbar | [protected]
OnCreate() | UCvsToolbar | [protected]
OnDestroy() | UCvsToolbar | [protected]
OnEnableCmd(int cmd, int state) | UWidget | [protected]
OnFetchCmd(int cmd, void *widget) | UWidget | [protected]
OnGetFloat(int cmd, float *f) | UWidget | [protected]
OnGetLoc(int cmd, URECT *r) | UWidget | [protected]
OnGetSliderProperty(int cmd, USLIDER *prop) | UWidget | [protected]
OnGetState(int cmd) | UWidget | [protected]
OnGetText(int cmd, UStr *text) | UWidget | [protected]
OnInitTabWidget(int cmd, int page, void *widget) | UWidget | [protected]
OnInitWidget(int cmd, void *widget) | UWidget | [protected]
OnInvalidate(int cmd) | UWidget | [protected]
OnListAddColumns(int cmd, int num) | UWidget | [protected]
OnListAddSel(int cmd, int entry) | UWidget | [protected]
OnListDelRow(int cmd, int row) | UWidget | [protected]
OnListGetInfo(int cmd, ULIST_INFO *desc) | UWidget | [protected]
OnListGetNext(int cmd, int whichCell) | UWidget | [protected]
OnListGetNextSel(int cmd, int selectedCell) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListResetAll(int cmd) | UWidget | [protected]
OnListResort(int cmd, int column, UListSorter s) | UWidget | [protected]
OnListRowGetData(int cmd, int row, void **data) | UWidget | [protected]
OnListRowSetData(int cmd, int row, void *data) | UWidget | [protected]
OnListSetColTitle(int cmd, int num, const char *title) | UWidget | [protected]
OnListSetColWidth(int cmd, int num, int width) | UWidget | [protected]
OnListSetFeedback(int cmd, int turnOn) | UWidget | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnRedraw(int cmd) | UWidget | [protected]
OnSetFloat(int cmd, const float *f) | UWidget | [protected]
OnSetLoc(int cmd, const URECT *r) | UWidget | [protected]
OnSetSlider(int cmd, int pos) | UWidget | [protected]
OnSetSliderProperty(int cmd, const USLIDER *prop) | UWidget | [protected]
OnSetState(int cmd, int state) | UWidget | [protected]
OnSetText(int cmd, const char *text) | UWidget | [protected]
OnSetTooltip(int cmd, UCmdUI *pCmdUI) | UToolbar | [protected]
OnShowWidget(int cmd, int state) | UWidget | [protected]
OnSmartComboSetFeature(int cmd, int feature) | UWidget | [protected]
OnSmartComboSetItems(int cmd, CMString *items) | UWidget | [protected]
OnSmartComboSetReadOnly(int cmd, bool readOnly) | UWidget | [protected]
OnTbButton(UTB_BUTTON *info) | UToolbar | [protected]
OnTbCheckBtn(UTB_BUTTON *info) | UToolbar | [protected]
OnTbDropDown(UTB_DROPDOWN *info) | UToolbar | [protected]
OnTbEnd(void) | UToolbar | [protected]
OnTbInit(UTB_INIT *info) | UToolbar | [protected]
OnTbSeparator(void) | UToolbar | [protected]
OnTreeDelete(int cmd, UTREEITEM item) | UWidget | [protected]
OnTreeExpand(int cmd, int collapse, UTREEITEM item) | UWidget | [protected]
OnTreeGetInfo(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeGetSel(int cmd, UTREEITEM *item) | UWidget | [protected]
OnTreeInsert(int cmd, UTREE_INSERT *data) | UWidget | [protected]
OnTreeResetAll(int cmd) | UWidget | [protected]
OnTreeSelect(int cmd, int deselect, UTREEITEM item) | UWidget | [protected]
OnTreeSetData(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnTreeSetIcon(int cmd, UTREE_INFO *data) | UWidget | [protected]
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UToolbar | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RebuildBar(bool onlyBitmap=true) | UToolbar | [protected]
RemoveTimer(int cmd) | UWidget |
rtUCmdTarget(void) | UCmdTarget | [static]
rtUCvsToolbar(void) | UCvsToolbar | [static]
rtUObject() | UObject | [static]
rtUToolbar(void) | UToolbar | [static]
rtUWidget(void) | UWidget | [static]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
sValidMenu | UWidget | [protected, static]
UCmdTarget(int widid) | UCmdTarget |
UCvsToolbar() | UCvsToolbar |
UDispatchInfo enum name | UCmdTarget |
UDispatchMessage(int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo) | UToolbar | [virtual]
UObject() | UObject | [inline, protected]
UToolbar(int widid) | UToolbar |
UWidget(int widid) | UWidget |
UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam) | UWidget | [friend]
WidgetIsActive(int cmd) const | UWidget |
~UCmdTarget() | UCmdTarget | [virtual]
~UCvsToolbar() | UCvsToolbar | [virtual]
~UObject() | UObject | [inline, virtual]
~UToolbar() | UToolbar | [virtual]
~UWidget() | UWidget | [virtual]
Generated on Sun Feb 24 01:25:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CUpdateMain Member List

This is the complete list of members for CUpdateMain, including all inherited members.
CUpdateMain() | CUpdateMain |
DoDataExchange(CDataExchange *pDX) | CUpdateMain | [protected, virtual]
IDD enum value | CUpdateMain |
m_createmissdir | CUpdateMain |
m_delsticky | CUpdateMain |
m_getcleancopy | CUpdateMain |
m_norecurs | CUpdateMain |
m_stdout | CUpdateMain |
~CUpdateMain() | CUpdateMain |
Generated on Sun Feb 24 01:28:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CUpdateMerge Member List

This is the complete list of members for CUpdateMerge, including all inherited members.
CUpdateMerge(bool isCheckout, const char *rev1, const char *rev2, const char *date1, const char *date2) | CUpdateMerge |
CUpdateMerge() | CUpdateMerge |
DoDataExchange(CDataExchange *pDX) | CUpdateMerge | [protected, virtual]
IDD enum value | CUpdateMerge |
m_date1 | CUpdateMerge |
m_date1Combo | CUpdateMerge |
m_date2 | CUpdateMerge |
m_date2Combo | CUpdateMerge |
m_hasDate1 | CUpdateMerge |
m_hasDate2 | CUpdateMerge |
m_isCheckout | CUpdateMerge | [private]
m_merge | CUpdateMerge |
m_rev1 | CUpdateMerge |
m_rev1Combo | CUpdateMerge |
m_rev2 | CUpdateMerge |
m_rev2Combo | CUpdateMerge |
OnCheckdate1() | CUpdateMerge | [protected]
OnCheckdate2() | CUpdateMerge | [protected]
OnMerge() | CUpdateMerge | [protected]
OnMerge1() | CUpdateMerge | [protected]
OnMerge2() | CUpdateMerge | [protected]
~CUpdateMerge() | CUpdateMerge |
Generated on Sun Feb 24 01:28:31 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CUpdateSticky Member List

This is the complete list of members for CUpdateSticky, including all inherited members.
CUpdateSticky(const char *rev, const char *date) | CUpdateSticky |
CUpdateSticky() | CUpdateSticky |
DoDataExchange(CDataExchange *pDX) | CUpdateSticky | [protected, virtual]
IDD enum value | CUpdateSticky |
m_date | CUpdateSticky |
m_dateCombo | CUpdateSticky |
m_hasdate | CUpdateSticky |
m_hasrev | CUpdateSticky |
m_match | CUpdateSticky |
m_rev | CUpdateSticky |
m_revCombo | CUpdateSticky |
OnDate() | CUpdateSticky | [protected]
OnRev() | CUpdateSticky | [protected]
~CUpdateSticky() | CUpdateSticky |
Generated on Sun Feb 24 01:28:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoTraversalContext Member List

This is the complete list of members for KoTraversalContext, including all inherited members.
IsMatch(EntnodeData *data) const | KoTraversalContext | [inline]
IsRecursive() const | KoTraversalContext | [inline]
IsShowIgnored() const | KoTraversalContext | [inline]
KoTraversalContext(CBrowseFileView *view) | KoTraversalContext | [inline]
m_filter | KoTraversalContext | [private]
m_isRecursive | KoTraversalContext | [private]
m_isShowIgnored | KoTraversalContext | [private]
m_view | KoTraversalContext |
Generated on Sun Feb 24 01:26:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CRecursionLock Member List

This is the complete list of members for CRecursionLock, including all inherited members.
CRecursionLock(bool &semaphore) | CRecursionLock | [inline]
m_semaphore | CRecursionLock | [private]
~CRecursionLock() | CRecursionLock | [inline]
Generated on Sun Feb 24 01:27:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CBrowseFileView Member List

This is the complete list of members for CBrowseFileView, including all inherited members.
AddColumns() | CBrowseFileView |
CBrowseFileView() | CBrowseFileView | [protected]
CheckChanges(void) | CBrowseFileView | [inline]
DeleteColumns() | CBrowseFileView |
DisableCommon(bool bCheckSelection=true) | CBrowseFileView | [protected]
DoDrag() | CBrowseFileView | [protected]
EditSel(EntnodeData *data, bool useDefault=false) | CBrowseFileView | [protected]
GetColumnModel() const | CBrowseFileView | [inline]
GetEntriesModTime(time_t &newEntriesMod, time_t &newEntriesLogMod) | CBrowseFileView | [protected]
GetImageForEntry(EntnodeData *data) | CBrowseFileView | [static]
GetMainFrame() | CBrowseFileView | [inline]
GetPath() const | CBrowseFileView | [inline]
GetViewType() | CBrowseFileView |
InvalidateView(void) | CBrowseFileView |
LoadColumns() | CBrowseFileView |
m_ascendant | CBrowseFileView | [protected]
m_checkChanges | CBrowseFileView | [protected]
m_ctrlHeader | CBrowseFileView | [protected]
m_entriesLogMod | CBrowseFileView | [protected]
m_entriesMod | CBrowseFileView | [protected]
m_heightOfLines | CBrowseFileView | [protected]
m_isFilesChange | CBrowseFileView | [protected]
m_isRecursive | CBrowseFileView | [protected]
m_isResetViewLocked | CBrowseFileView | [protected]
m_isResetViewPending | CBrowseFileView | [protected]
m_modelColumns | CBrowseFileView | [protected]
m_numberByPages | CBrowseFileView | [protected]
m_numberOfLines | CBrowseFileView | [protected]
m_numberOfPages | CBrowseFileView | [protected]
m_path | CBrowseFileView | [protected]
m_SmallImageList | CBrowseFileView | [protected, static]
m_sort | CBrowseFileView | [protected]
m_StateImageList | CBrowseFileView | [protected, static]
m_uiFilechangeTimer | CBrowseFileView | [protected]
m_watch | CBrowseFileView | [protected]
OnBegindrag(NMHDR *pNMHDR, LRESULT *pResult) | CBrowseFileView | [protected]
OnBeginPrinting(CDC *pDC, CPrintInfo *pInfo) | CBrowseFileView | [protected, virtual]
OnBeginrdrag(NMHDR *pNMHDR, LRESULT *pResult) | CBrowseFileView | [protected]
OnColumnclick(NMHDR *pNMHDR, LRESULT *pResult) | CBrowseFileView | [protected]
OnCustomize(UINT nID) | CBrowseFileView | [protected]
OnDeleteitem(NMHDR *pNMHDR, LRESULT *pResult) | CBrowseFileView | [protected]
OnDestroy() | CBrowseFileView | [protected]
OnEditSelectAll() | CBrowseFileView | [protected]
OnFileChange(WPARAM, LPARAM) | CBrowseFileView | [protected]
OnFilteringChanged() | CBrowseFileView |
OnInitialUpdate() | CBrowseFileView | [protected, virtual]
OnKeydown(NMHDR *pNMHDR, LRESULT *pResult) | CBrowseFileView | [protected]
OnLButtonDblClk(UINT nFlags, CPoint point) | CBrowseFileView | [protected]
OnLButtonDown(UINT nFlags, CPoint point) | CBrowseFileView | [protected]
OnMacro(UINT nID) | CBrowseFileView | [protected]
OnPreparePrinting(CPrintInfo *pInfo) | CBrowseFileView | [protected, virtual]
OnPrint(CDC *pDC, CPrintInfo *pInfo) | CBrowseFileView | [protected, virtual]
OnQueryAnnotate() | CBrowseFileView | [protected]
OnRButtonDown(UINT nFlags, CPoint point) | CBrowseFileView | [protected]
OnResetView(WPARAM, LPARAM) | CBrowseFileView | [protected]
OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) | CBrowseFileView | [protected]
OnTimer(UINT nIDEvent) | CBrowseFileView | [protected]
OnUpdateCustomize(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateMacro(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateQueryAnnotate(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewAdd(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewAddB(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewCheckout(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewEditseldef(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewExplore(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewFullRowDetails(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewGraph(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewImport(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewList(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewRelease(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewReload(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewRmv(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewSmallIcons(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewTrash(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewUpdate(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewUpone(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnViewAdd() | CBrowseFileView | [protected]
OnViewAddb() | CBrowseFileView | [protected]
OnViewAddu() | CBrowseFileView | [protected]
OnViewCheckout() | CBrowseFileView | [protected]
OnViewCommit() | CBrowseFileView | [protected]
OnViewDiff() | CBrowseFileView | [protected]
OnViewEdit() | CBrowseFileView | [protected]
OnViewEditors() | CBrowseFileView | [protected]
OnViewEditsel() | CBrowseFileView | [protected]
OnViewEditseldef() | CBrowseFileView | [protected]
OnViewExplore() | CBrowseFileView | [protected]
OnViewForceedit() | CBrowseFileView | [protected]
OnViewFullRowDetails() | CBrowseFileView | [protected]
OnViewGraph() | CBrowseFileView | [protected]
OnViewImport() | CBrowseFileView | [protected]
OnViewList() | CBrowseFileView | [protected]
OnViewLog() | CBrowseFileView | [protected]
OnViewQueryUpdate() | CBrowseFileView | [protected]
OnViewRelease() | CBrowseFileView | [protected]
OnViewReload() | CBrowseFileView | [protected]
OnViewReservededit() | CBrowseFileView | [protected]
OnViewRmv() | CBrowseFileView | [protected]
OnViewSmallIcons() | CBrowseFileView | [protected]
OnViewStatus() | CBrowseFileView | [protected]
OnViewTagBranch() | CBrowseFileView | [protected]
OnViewTagDelete() | CBrowseFileView | [protected]
OnViewTagNew() | CBrowseFileView | [protected]
OnViewTrash() | CBrowseFileView | [protected]
OnViewUnedit() | CBrowseFileView | [protected]
OnViewUnlock() | CBrowseFileView | [protected]
OnViewUpdate() | CBrowseFileView | [protected]
OnViewUpone() | CBrowseFileView | [protected]
OnViewWatchers() | CBrowseFileView | [protected]
OnViewWatchOff() | CBrowseFileView | [protected]
OnViewWatchOn() | CBrowseFileView | [protected]
PreCreateWindow(CREATESTRUCT &cs) | CBrowseFileView | [virtual]
ProcessSelectionCommand(KiSelectionHandler *handler) | CBrowseFileView |
ResetView(const char *path, bool notifyBrowser=false, const char *selectFile=0L) | CBrowseFileView |
ResetView(bool notifyBrowser=false, const char *selectFile=0L) | CBrowseFileView |
Resort(void) | CBrowseFileView |
SaveColumns() | CBrowseFileView |
SetFullRowSel(BOOL bFullRowSel) | CBrowseFileView | [protected]
SetRecursive(bool isRecursive) | CBrowseFileView | [protected]
SetViewType(DWORD dwViewType) | CBrowseFileView |
~CBrowseFileView() | CBrowseFileView | [virtual]
Generated on Sun Feb 24 01:24:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CBrowserBar Member List

This is the complete list of members for CBrowserBar, including all inherited members.
CBrowserBar() | CBrowserBar | [protected]
Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID, CCreateContext *pContext=NULL) | CBrowserBar | [virtual]
GetBrowserView() | CBrowserBar | [inline]
m_browser | CBrowserBar | [protected]
OnDestroy() | CBrowserBar | [protected]
OnDraw(CDC *pDC) | CBrowserBar | [protected, virtual]
OnPaint() | CBrowserBar | [protected]
OnWindowPosChanged(WINDOWPOS FAR *lpwndpos) | CBrowserBar | [protected]
~CBrowserBar() | CBrowserBar | [virtual]
Generated on Sun Feb 24 01:24:22 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CJX_COLORMAP Member List

This is the complete list of members for CJX_COLORMAP, including all inherited members.
iSysColorTo | CJX_COLORMAP
rgbqFrom | CJX_COLORMAP
Generated on Sun Feb 24 01:26:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

AFX_DLLVERSIONINFO Member List

This is the complete list of members for AFX_DLLVERSIONINFO, including all inherited members.
cbSize | AFX_DLLVERSIONINFO
dwBuildNumber | AFX_DLLVERSIONINFO
dwMajorVersion | AFX_DLLVERSIONINFO
dwMinorVersion | AFX_DLLVERSIONINFO
dwPlatformID | AFX_DLLVERSIONINFO
Generated on Sun Feb 24 01:24:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CJX_CONTROLPOS Member List

This is the complete list of members for CJX_CONTROLPOS, including all inherited members.
nID | CJX_CONTROLPOS
nIndex | CJX_CONTROLPOS
rectOldPos | CJX_CONTROLPOS
Generated on Sun Feb 24 01:26:21 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CToolBarData Member List

This is the complete list of members for CToolBarData, including all inherited members.
items() | CToolBarData | [inline]
wHeight | CToolBarData |
wItemCount | CToolBarData |
wVersion | CToolBarData |
wWidth | CToolBarData |
Generated on Sun Feb 24 01:28:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJToolCmdUI Member List

This is the complete list of members for CCJToolCmdUI, including all inherited members.
Enable(BOOL bOn) | CCJToolCmdUI | [virtual]
SetCheck(int nCheck) | CCJToolCmdUI | [virtual]
SetText(LPCTSTR lpszText) | CCJToolCmdUI | [virtual]
Generated on Sun Feb 24 01:25:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CSubclassWndMap Member List

This is the complete list of members for CSubclassWndMap, including all inherited members.
Add(HWND hwnd, CSubclassWnd *pSubclassWnd) | CSubclassWndMap |
CSubclassWndMap() | CSubclassWndMap |
GetHookMap() | CSubclassWndMap | [static]
Lookup(HWND hwnd) | CSubclassWndMap |
Remove(CSubclassWnd *pSubclassWnd) | CSubclassWndMap |
RemoveAll(HWND hwnd) | CSubclassWndMap |
~CSubclassWndMap() | CSubclassWndMap |
Generated on Sun Feb 24 01:27:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJBrowseButton Member List

This is the complete list of members for CCJBrowseButton, including all inherited members.
CCJBrowseButton() | CCJBrowseButton |
Create(CWnd *pWnd, BROWSE_TYPE eType, UINT nMenu, UINT nSubMenuIndx) | CCJBrowseButton | [virtual]
GetNextID(CWnd *pWnd) const | CCJBrowseButton | [virtual]
m_bOpenFileDialog | CCJBrowseButton |
m_dwFlags | CCJBrowseButton |
m_eType | CCJBrowseButton | [protected]
m_Font | CCJBrowseButton | [protected]
m_hIcon | CCJBrowseButton | [protected]
m_nID | CCJBrowseButton | [protected]
m_nMenu | CCJBrowseButton | [protected]
m_nSubMenuIndx | CCJBrowseButton | [protected]
m_pEditWnd | CCJBrowseButton | [protected]
m_pParentWnd | CCJBrowseButton |
m_strDefExt | CCJBrowseButton |
m_strFileName | CCJBrowseButton |
m_strFilter | CCJBrowseButton |
m_strTitle | CCJBrowseButton |
OnClicked() | CCJBrowseButton | [protected]
UpdateFont() | CCJBrowseButton | [virtual]
~CCJBrowseButton() | CCJBrowseButton | [virtual]
Generated on Sun Feb 24 01:24:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJBrowseEdit Member List

This is the complete list of members for CCJBrowseEdit, including all inherited members.
CCJBrowseEdit() | CCJBrowseEdit |
InitializeControl() | CCJBrowseEdit | [virtual]
m_btnBrowse | CCJBrowseEdit | [protected]
m_eType | CCJBrowseEdit | [protected]
m_nMenu | CCJBrowseEdit | [protected]
m_nSubMenuIndx | CCJBrowseEdit | [protected]
OnCreate(LPCREATESTRUCT lpCreateStruct) | CCJBrowseEdit | [protected]
OnEnable(BOOL bEnable) | CCJBrowseEdit | [protected]
OnShowWindow(BOOL bShow, UINT nStatus) | CCJBrowseEdit | [protected]
PreSubclassWindow() | CCJBrowseEdit | [protected, virtual]
SetDlgDefExt(LPCTSTR strDefExt) | CCJBrowseEdit | [virtual]
SetDlgFileName(LPCTSTR strFileName) | CCJBrowseEdit | [virtual]
SetDlgFilter(LPCTSTR strFilter) | CCJBrowseEdit | [virtual]
SetDlgOpenFile(BOOL bOpenFileDialog) | CCJBrowseEdit | [virtual]
SetDlgOwner(CWnd *pParentWnd) | CCJBrowseEdit | [virtual]
SetDlgStyle(DWORD dwFlags) | CCJBrowseEdit | [virtual]
SetDlgTitle(LPCTSTR strTitle) | CCJBrowseEdit | [virtual]
SetSearchType(BROWSE_TYPE eType, UINT nMenu=0, int nSubMenuIndx=0) | CCJBrowseEdit | [virtual]
~CCJBrowseEdit() | CCJBrowseEdit | [virtual]
Generated on Sun Feb 24 01:24:25 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJCaptionButton Member List

This is the complete list of members for CCJCaptionButton, including all inherited members.
CCJFlatButton() | CCJFlatButton |
DisableFlatLook(BOOL bDisable=FALSE) | CCJFlatButton | [virtual]
DrawButtonBitmap(CDC *pDC, UINT nState, CRect &rcItem) | CCJFlatButton | [protected, virtual]
DrawButtonIcon(CDC *pDC, UINT nState, CRect &rcItem) | CCJFlatButton | [protected, virtual]
DrawButtonText(CDC *pDC, UINT nState, CRect &rcItem) | CCJCaptionButton | [virtual]
DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) | CCJFlatButton | [virtual]
m_bAltColor | CCJFlatButton | [protected]
m_bFlatLook | CCJFlatButton | [protected]
m_bLBtnDown | CCJFlatButton | [protected]
m_bMouseOver | CCJFlatButton | [protected]
m_bPainted | CCJFlatButton | [protected]
m_clrAltHilite | CCJFlatButton | [protected]
m_clrAltNormal | CCJFlatButton | [protected]
m_clrAltShadow | CCJFlatButton | [protected]
m_clrAltTextNm | CCJFlatButton | [protected]
m_clrDkShad | CCJFlatButton | [protected]
m_clrHilite | CCJFlatButton | [protected]
m_clrNormal | CCJFlatButton | [protected]
m_clrShadow | CCJFlatButton | [protected]
m_clrTextGy | CCJFlatButton | [protected]
m_clrTextNm | CCJFlatButton | [protected]
m_Font | CCJFlatButton | [protected]
m_hCursor | CCJFlatButton | [protected]
m_hPushed | CCJFlatButton | [protected]
m_pFont | CCJFlatButton | [protected]
m_sizeIcon | CCJFlatButton | [protected]
OnEraseBkgnd(CDC *pDC) | CCJFlatButton | [protected]
OnLButtonDblClk(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnLButtonDown(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnLButtonUp(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnMouseMove(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnPaint() | CCJFlatButton | [protected]
OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) | CCJFlatButton | [protected]
OnSysColorChange() | CCJCaptionButton | [protected]
OnTimer(UINT nIDEvent) | CCJFlatButton | [protected]
SetAlternateColors(COLORREF clrAltNormal, COLORREF clrAltHilite, COLORREF clrAltShadow, COLORREF clrAltTextNm) | CCJFlatButton | [virtual]
SetButtonFont(CFont *pFont) | CCJFlatButton | [virtual]
SetButtonStyle(CFont *pFont, COLORREF clrBackground, COLORREF clrFont) | CCJCaptionButton | [virtual]
SetIcon(HICON hIcon, CSize size) | CCJFlatButton | [virtual]
SetIcon(HICON hIcon, HICON hPushed, CSize size) | CCJFlatButton | [virtual]
UpdateFont() | CCJFlatButton | [protected, virtual]
~CCJFlatButton() | CCJFlatButton | [virtual]
Generated on Sun Feb 24 01:24:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJCaption Member List

This is the complete list of members for CCJCaption, including all inherited members.
CCJCaption() | CCJCaption |
Create(CWnd *pParentWnd, LPCTSTR lpszWindowName, DWORD dwExStyle=0x01, DWORD dwStyle=WS_VISIBLE|SS_CENTER|SS_CENTERIMAGE, const CRect &rect=CRect(0, 0, 0, 0), UINT nID=0xffff) | CCJCaption | [virtual]
DrawCaptionBack(CDC *pDC, CRect &rcItem) | CCJCaption | [virtual]
DrawCaptionIcon(CDC *pDC, CRect &rcItem) | CCJCaption | [virtual]
DrawCaptionText(CDC *pDC, CRect &rcItem) | CCJCaption | [virtual]
KillChildWindow() | CCJCaption | [virtual]
m_CaptionButton | CCJCaption | [protected]
m_clrBackgnd | CCJCaption | [protected]
m_clrBorder | CCJCaption | [protected]
m_clrBtnFace | CCJCaption | [protected]
m_clrBtnHilite | CCJCaption | [protected]
m_clrBtnShadow | CCJCaption | [protected]
m_clrFont | CCJCaption | [protected]
m_cx | CCJCaption | [protected]
m_cy | CCJCaption | [protected]
m_dwExStyle | CCJCaption | [protected]
m_dwTextStyle | CCJCaption | [protected]
m_Font | CCJCaption | [protected]
m_hIcon | CCJCaption | [protected]
m_nBorder | CCJCaption | [protected]
m_nOffset | CCJCaption | [protected]
m_pChildWnd | CCJCaption | [protected]
m_pFont | CCJCaption | [protected]
m_pNotifyWnd | CCJCaption | [protected]
m_pWndPopDown | CCJCaption | [protected]
m_rcChild | CCJCaption | [protected]
m_rcClient | CCJCaption | [protected]
m_strWindText | CCJCaption | [protected]
ModifyCaptionStyle(int nBorderSize, CFont *pFont=NULL, LPCTSTR lpszWindText=NULL, HICON hIcon=NULL) | CCJCaption | [virtual]
OnCaptButton() | CCJCaption | [protected]
OnEraseBkgnd(CDC *pDC) | CCJCaption | [protected]
OnPaint() | CCJCaption | [protected]
OnPushPinButton(UINT lParam, LONG wParam) | CCJCaption | [protected]
OnPushPinCancel(UINT lParam, LONG wParam) | CCJCaption | [protected]
OnSize(UINT nType, int cx, int cy) | CCJCaption | [protected]
OnSysColorChange() | CCJCaption | [protected]
SetCaptionColors(COLORREF clrBorder, COLORREF clrBackground, COLORREF clrFont) | CCJCaption | [virtual]
SetChildWindow(CWnd *pChild, CWnd *pNotifyWnd) | CCJCaption | [virtual]
SetTextStyle(DWORD dwStyle) | CCJCaption | [virtual]
UpdateCaption(LPCTSTR lpszWindowText, HICON hIcon) | CCJCaption | [virtual]
UpdateCaptionBack(CDC *pDC, CRect &rcItem) | CCJCaption | [virtual]
UpdateCaptionText(CDC *pDC, CRect &rcItem) | CCJCaption | [virtual]
UpdateFont() | CCJCaption | [virtual]
~CCJCaption() | CCJCaption | [virtual]
Generated on Sun Feb 24 01:24:26 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJCaptionPopupWnd Member List

This is the complete list of members for CCJCaptionPopupWnd, including all inherited members.
CCJCaptionPopupWnd() | CCJCaptionPopupWnd |
Create(const CRect &rect, CWnd *pParentWnd, CWnd *pChildWnd) | CCJCaptionPopupWnd | [virtual]
m_Caption | CCJCaptionPopupWnd | [protected]
m_CaptionButton | CCJCaptionPopupWnd | [protected]
m_hIconOff | CCJCaptionPopupWnd | [protected]
m_hIconOn | CCJCaptionPopupWnd | [protected]
m_pChildParent | CCJCaptionPopupWnd |
m_pChildWnd | CCJCaptionPopupWnd |
m_pParentWnd | CCJCaptionPopupWnd |
OnCaptButton() | CCJCaptionPopupWnd | [protected]
OnDestroy() | CCJCaptionPopupWnd | [protected]
OnPaint() | CCJCaptionPopupWnd | [protected]
OnTimer(UINT nIDEvent) | CCJCaptionPopupWnd | [protected]
~CCJCaptionPopupWnd() | CCJCaptionPopupWnd | [virtual]
Generated on Sun Feb 24 01:24:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJColorPicker Member List

This is the complete list of members for CCJColorPicker, including all inherited members.
CCJColorPicker() | CCJColorPicker |
CheckTextColor(COLORREF crColor) | CCJColorPicker | [virtual]
DECLARE_DYNCREATE(CCJColorPicker) | CCJColorPicker |
DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) | CCJColorPicker | [virtual]
GetBkColor() | CCJColorPicker | [inline, virtual]
GetColor() | CCJColorPicker | [virtual]
GetSelectionMode() | CCJColorPicker | [inline, virtual]
GetTextColor() | CCJColorPicker | [inline, virtual]
GetTrackSelection() | CCJColorPicker | [inline, virtual]
m_ArrowRect | CCJColorPicker | [protected]
m_bActive | CCJColorPicker | [protected]
m_bLBtnDown | CCJColorPicker | [protected]
m_bTrackSelection | CCJColorPicker | [protected]
m_crColorBk | CCJColorPicker | [protected]
m_crColorText | CCJColorPicker | [protected]
m_nSelectionMode | CCJColorPicker | [protected]
m_pParentWnd | CCJColorPicker | [protected]
m_strCustomText | CCJColorPicker | [protected]
m_strDefaultText | CCJColorPicker | [protected]
OnClicked() | CCJColorPicker | [protected]
OnCreate(LPCREATESTRUCT lpCreateStruct) | CCJColorPicker | [protected]
OnEraseBkgnd(CDC *pDC) | CCJColorPicker | [protected]
OnPaint() | CCJColorPicker | [protected]
OnSelChange(UINT lParam, LONG wParam) | CCJColorPicker | [protected]
OnSelEndCancel(UINT lParam, LONG wParam) | CCJColorPicker | [protected]
OnSelEndOK(UINT lParam, LONG wParam) | CCJColorPicker | [protected]
PreSubclassWindow() | CCJColorPicker | [protected, virtual]
SetBkColor(COLORREF crColorBk) | CCJColorPicker | [virtual]
SetColor(COLORREF crColor) | CCJColorPicker | [virtual]
SetCustomText(LPCTSTR szCustomText) | CCJColorPicker | [virtual]
SetDefaultText(LPCTSTR szDefaultText) | CCJColorPicker | [virtual]
SetSelectionMode(UINT nMode) | CCJColorPicker | [inline, virtual]
SetTextColor(COLORREF crColorText) | CCJColorPicker | [virtual]
SetTrackSelection(BOOL bTracking=TRUE) | CCJColorPicker | [inline, virtual]
SetWindowSize() | CCJColorPicker | [protected]
~CCJColorPicker() | CCJColorPicker | [virtual]
Generated on Sun Feb 24 01:24:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

ColorTableEntry Member List

This is the complete list of members for ColorTableEntry, including all inherited members.
crColor | ColorTableEntry
szName | ColorTableEntry
Generated on Sun Feb 24 01:27:03 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJColorPopup Member List

This is the complete list of members for CCJColorPopup, including all inherited members.
CCJColorPopup() | CCJColorPopup |
CCJColorPopup(CPoint p, COLORREF crColor, CWnd *pParentWnd, LPCTSTR szDefaultText=NULL, LPCTSTR szCustomText=NULL) | CCJColorPopup |
ChangeSelection(int nIndex) | CCJColorPopup | [protected, virtual]
Create(CPoint p, COLORREF crColor, CWnd *pParentWnd, LPCTSTR szDefaultText=NULL, LPCTSTR szCustomText=NULL) | CCJColorPopup | [virtual]
CreateToolTips() | CCJColorPopup | [protected, virtual]
DrawCell(CDC *pDC, int nIndex) | CCJColorPopup | [protected, virtual]
EndSelection(int nMessage) | CCJColorPopup | [protected, virtual]
FindCellFromColor(COLORREF crColor) | CCJColorPopup | [protected, virtual]
GetCellRect(int nIndex, const LPRECT &rect) | CCJColorPopup | [protected, virtual]
GetColor(int nIndex) | CCJColorPopup | [inline, protected, virtual]
GetColorName(int nIndex) | CCJColorPopup | [inline, protected, virtual]
GetColumn(int nIndex) const | CCJColorPopup | [protected, virtual]
GetIndex(int row, int col) const | CCJColorPopup | [protected, virtual]
GetRow(int nIndex) const | CCJColorPopup | [protected, virtual]
Initialise() | CCJColorPopup | [virtual]
m_crColor | CCJColorPopup | [protected]
m_crColors | CCJColorPopup | [protected, static]
m_crInitialColor | CCJColorPopup | [protected]
m_CustomTextRect | CCJColorPopup | [protected]
m_DefaultTextRect | CCJColorPopup | [protected]
m_Font | CCJColorPopup | [protected]
m_nBoxSize | CCJColorPopup | [protected]
m_nChosenColorSel | CCJColorPopup | [protected]
m_nCurrentSel | CCJColorPopup | [protected]
m_nMargin | CCJColorPopup | [protected]
m_nNumColors | CCJColorPopup | [protected]
m_nNumColumns | CCJColorPopup | [protected]
m_nNumRows | CCJColorPopup | [protected]
m_Palette | CCJColorPopup | [protected]
m_pParent | CCJColorPopup | [protected]
m_strCustomText | CCJColorPopup | [protected]
m_strDefaultText | CCJColorPopup | [protected]
m_ToolTip | CCJColorPopup | [protected]
m_WindowRect | CCJColorPopup | [protected]
OnActivateApp(BOOL bActive, HTASK hTask) | CCJColorPopup | [protected]
OnEraseBkgnd(CDC *pDC) | CCJColorPopup | [protected]
OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) | CCJColorPopup | [protected]
OnKillFocus(CWnd *pNewWnd) | CCJColorPopup | [protected]
OnLButtonUp(UINT nFlags, CPoint point) | CCJColorPopup | [protected]
OnMouseMove(UINT nFlags, CPoint point) | CCJColorPopup | [protected]
OnNcDestroy() | CCJColorPopup | [protected]
OnPaint() | CCJColorPopup | [protected]
OnPaletteChanged(CWnd *pFocusWnd) | CCJColorPopup | [protected]
OnQueryNewPalette() | CCJColorPopup | [protected]
PreTranslateMessage(MSG *pMsg) | CCJColorPopup | [virtual]
SetWindowSize() | CCJColorPopup | [protected, virtual]
UpdateFont() | CCJColorPopup | [virtual]
~CCJColorPopup() | CCJColorPopup | [virtual]
Generated on Sun Feb 24 01:24:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJComboBoxEx Member List

This is the complete list of members for CCJComboBoxEx, including all inherited members.
AddString(LPCTSTR lpszString) | CCJComboBoxEx |
CCJComboBoxEx() | CCJComboBoxEx |
Create(DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID) | CCJComboBoxEx |
DeleteItem(int iIndex) | CCJComboBoxEx |
Dir(UINT attr, LPCTSTR lpszWildCard) | CCJComboBoxEx |
FindString(int nIndexStart, LPCTSTR lpszFind) const | CCJComboBoxEx |
GetComboBoxCtrl() | CCJComboBoxEx |
GetEditCtrl() | CCJComboBoxEx |
GetExtendedStyle() const | CCJComboBoxEx |
GetImageList() const | CCJComboBoxEx |
GetItem(COMBOBOXEXITEM *pCBItem) | CCJComboBoxEx |
HasEditChanged() | CCJComboBoxEx |
InsertItem(const COMBOBOXEXITEM *pCBItem) | CCJComboBoxEx |
InsertItem(int iItem, UINT nStringID, int iIndent=0, int iImage=0, int iSelectedImage=0, UINT mask=CBEIF_TEXT|CBEIF_IMAGE|CBEIF_SELECTEDIMAGE|CBEIF_INDENT) | CCJComboBoxEx |
InsertItem(int iItem, LPCTSTR lpszItem, int iIndent=0, int iImage=0, int iSelectedImage=0, UINT mask=CBEIF_TEXT|CBEIF_IMAGE|CBEIF_SELECTEDIMAGE|CBEIF_INDENT) | CCJComboBoxEx |
InsertString(int nIndex, LPCTSTR lpszString) | CCJComboBoxEx |
SetEditSel(int nStartChar, int nEndChar) | CCJComboBoxEx |
SetExtendedStyle(DWORD dwExMask, DWORD dwExStyles) | CCJComboBoxEx |
SetImageList(CImageList *pImageList) | CCJComboBoxEx |
SetItem(const COMBOBOXEXITEM *pCBItem) | CCJComboBoxEx |
~CCJComboBoxEx() | CCJComboBoxEx | [virtual]
Generated on Sun Feb 24 01:24:30 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJCBarButton Member List

This is the complete list of members for CCJCBarButton, including all inherited members.
CCJFlatButton() | CCJFlatButton |
DisableFlatLook(BOOL bDisable=FALSE) | CCJFlatButton | [virtual]
DrawButtonBitmap(CDC *pDC, UINT nState, CRect &rcItem) | CCJFlatButton | [protected, virtual]
DrawButtonIcon(CDC *pDC, UINT nState, CRect &rcItem) | CCJCBarButton | [protected, virtual]
DrawButtonText(CDC *pDC, UINT nState, CRect &rcItem) | CCJFlatButton | [protected, virtual]
DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) | CCJFlatButton | [virtual]
m_bAltColor | CCJFlatButton | [protected]
m_bFlatLook | CCJFlatButton | [protected]
m_bLBtnDown | CCJFlatButton | [protected]
m_bMouseOver | CCJFlatButton | [protected]
m_bPainted | CCJFlatButton | [protected]
m_clrAltHilite | CCJFlatButton | [protected]
m_clrAltNormal | CCJFlatButton | [protected]
m_clrAltShadow | CCJFlatButton | [protected]
m_clrAltTextNm | CCJFlatButton | [protected]
m_clrDkShad | CCJFlatButton | [protected]
m_clrHilite | CCJFlatButton | [protected]
m_clrNormal | CCJFlatButton | [protected]
m_clrShadow | CCJFlatButton | [protected]
m_clrTextGy | CCJFlatButton | [protected]
m_clrTextNm | CCJFlatButton | [protected]
m_Font | CCJFlatButton | [protected]
m_hCursor | CCJFlatButton | [protected]
m_hPushed | CCJFlatButton | [protected]
m_pFont | CCJFlatButton | [protected]
m_sizeIcon | CCJFlatButton | [protected]
OnEraseBkgnd(CDC *pDC) | CCJFlatButton | [protected]
OnLButtonDblClk(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnLButtonDown(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnLButtonUp(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnMouseMove(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnPaint() | CCJFlatButton | [protected]
OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) | CCJFlatButton | [protected]
OnSysColorChange() | CCJFlatButton | [protected]
OnTimer(UINT nIDEvent) | CCJFlatButton | [protected]
SetAlternateColors(COLORREF clrAltNormal, COLORREF clrAltHilite, COLORREF clrAltShadow, COLORREF clrAltTextNm) | CCJFlatButton | [virtual]
SetButtonFont(CFont *pFont) | CCJFlatButton | [virtual]
SetIcon(HICON hIcon, CSize size) | CCJFlatButton | [virtual]
SetIcon(HICON hIcon, HICON hPushed, CSize size) | CCJFlatButton | [virtual]
UpdateFont() | CCJFlatButton | [protected, virtual]
~CCJFlatButton() | CCJFlatButton | [virtual]
Generated on Sun Feb 24 01:24:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJControlBar Member List

This is the complete list of members for CCJControlBar, including all inherited members.
CalcDynamicLayout(int nLength, DWORD nMode) | CCJControlBar | [virtual]
CCJControlBar() | CCJControlBar |
Create(CWnd *pParentWnd, UINT nID, LPCTSTR lpszWindowName=NULL, CSize sizeDefault=CSize(200, 100), DWORD dwStyle=CBRS_LEFT, BOOL bFlatBorders=FALSE) | CCJControlBar | [virtual]
DrawBorders(CDC *pDC, CRect &rect) | CCJControlBar | [protected, virtual]
DrawGriperCaption(CDC *pDC, LPRECT pRect) | CCJControlBar | [protected, virtual]
DrawGripper(CDC *pDC) | CCJControlBar | [protected, virtual]
EnableDockingOnSizeBar(DWORD dwDockStyle) | CCJControlBar | [virtual]
EnableFlatLook(BOOL bFlat=TRUE) | CCJControlBar | [virtual]
EnableFlatLook(BOOL bGripper, BOOL bBorder, BOOL bButtons) | CCJControlBar | [virtual]
EnableSaveState(bool bAutoSave=true) | CCJControlBar | [virtual]
EraseNonClient() | CCJControlBar | [protected, virtual]
GetButtonRect() | CCJControlBar | [protected, virtual]
GetChildRect(CRect &rect) | CCJControlBar | [virtual]
GetGripperRect() | CCJControlBar | [protected, virtual]
GetHorzSize() | CCJControlBar | [virtual]
GetMenuID() | CCJControlBar | [virtual]
GetMinExt() | CCJControlBar | [virtual]
GetVertSize() | CCJControlBar | [virtual]
HitTest(CPoint &point) | CCJControlBar | [protected, virtual]
IsBottomDocked() const | CCJControlBar | [virtual]
IsFloating() const | CCJControlBar | [virtual]
IsHorzDocked() const | CCJControlBar | [virtual]
IsLeftDocked() const | CCJControlBar | [virtual]
IsRightDocked() const | CCJControlBar | [virtual]
IsTopDocked() const | CCJControlBar | [virtual]
IsVertDocked() const | CCJControlBar | [virtual]
LoadBarState(CSize &size, int nID) | CCJControlBar | [protected, virtual]
m_bAutoSave | CCJControlBar | [protected]
m_bButtons | CCJControlBar | [protected]
m_bDragging | CCJControlBar | [protected]
m_bFlatBorder | CCJControlBar | [protected]
m_bFlatGripper | CCJControlBar | [protected]
m_bFloating | CCJControlBar | [protected]
m_bGripper | CCJControlBar | [protected]
m_bMaximized | CCJControlBar | [protected]
m_bOkToDrag | CCJControlBar | [protected]
m_btnClose | CCJControlBar | [protected]
m_btnMinim | CCJControlBar | [protected]
m_bToFit | CCJControlBar |
m_bUnique | CCJControlBar |
m_cxOffset | CCJControlBar | [protected]
m_cyOffset | CCJControlBar | [protected]
m_eAuxIndex | CCJControlBar | [protected]
m_eChildBorder | CCJControlBar |
m_hAuxIcon | CCJControlBar | [protected]
m_hIcon | CCJControlBar | [protected]
m_ImageList | CCJControlBar | [protected]
m_nID | CCJControlBar | [protected]
m_nPos | CCJControlBar | [protected]
m_pChildWnd | CCJControlBar | [protected]
m_popToolbarID | CCJControlBar | [protected]
m_popupMenu | CCJControlBar | [protected]
m_popupMenuID | CCJControlBar | [protected]
m_ptCurDrag | CCJControlBar | [protected]
m_ptStartDrag | CCJControlBar | [protected]
m_rcTrack | CCJControlBar | [protected]
m_sizeDesired | CCJControlBar | [protected]
m_sizeFloat | CCJControlBar | [protected]
m_sizeHorz | CCJControlBar | [protected]
m_sizeNormal | CCJControlBar | [protected]
m_sizeVert | CCJControlBar | [protected]
m_strSection | CCJControlBar | [protected]
m_ToolTip | CCJControlBar | [protected]
Maximize(int size) | CCJControlBar | [virtual]
Minimize() | CCJControlBar | [virtual]
Normalize() | CCJControlBar | [virtual]
OnButtonClose() | CCJControlBar | [protected]
OnButtonMinimize() | CCJControlBar | [protected]
OnCreate(LPCREATESTRUCT lpCreateStruct) | CCJControlBar | [protected]
OnEraseBkgnd(CDC *pDC) | CCJControlBar | [protected]
OnInitMenuPopup(CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu) | CCJControlBar | [protected]
OnInvertTracker(const CRect &rect) | CCJControlBar | [protected, virtual]
OnLButtonDown(UINT nFlags, CPoint point) | CCJControlBar | [protected]
OnLButtonUp(UINT nFlags, CPoint point) | CCJControlBar | [protected]
OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct) | CCJControlBar | [protected]
OnMenuChar(UINT nChar, UINT nFlags, CMenu *pMenu) | CCJControlBar | [protected]
OnMouseMove(UINT nFlags, CPoint point) | CCJControlBar | [protected]
OnNcHitTest(CPoint point) | CCJControlBar | [protected]
OnNcPaint() | CCJControlBar | [protected]
OnPaint() | CCJControlBar | [protected]
OnRButtonDown(UINT nFlags, CPoint point) | CCJControlBar | [protected]
OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) | CCJControlBar | [protected]
OnUpdateButtonClose(CCmdUI *pCmdUI) | CCJControlBar | [protected]
OnUpdateButtonMinimize(CCmdUI *pCmdUI) | CCJControlBar | [protected]
OnUpdateCmdUI(CFrameWnd *pTarget, BOOL bDisableIfNoHndler) | CCJControlBar | [virtual]
OnWindowPosChanged(WINDOWPOS FAR *lpwndpos) | CCJControlBar | [protected]
PreTranslateMessage(MSG *pMsg) | CCJControlBar | [virtual]
SaveBarState(CSize &size) | CCJControlBar | [protected, virtual]
SetChild(CWnd *pWnd) | CCJControlBar | [protected, virtual]
SetMenuID(UINT popupMenuID, UINT popToolbarID=0, int nPos=0) | CCJControlBar | [virtual]
SetNormalSize(const CSize &cs) | CCJControlBar | [virtual]
ShowFrameControls(BOOL bGripper=TRUE, BOOL bButtons=TRUE) | CCJControlBar | [virtual]
~CCJControlBar() | CCJControlBar | [virtual]
Generated on Sun Feb 24 01:24:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJDateTimeCtrl Member List

This is the complete list of members for CCJDateTimeCtrl, including all inherited members.
CCJDateTimeCtrl() | CCJDateTimeCtrl |
Create(DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID) | CCJDateTimeCtrl |
GetMonthCalColor(int iColor) const | CCJDateTimeCtrl |
GetMonthCalCtrl() const | CCJDateTimeCtrl |
GetMonthCalFont() const | CCJDateTimeCtrl |
GetRange(COleDateTime *pMinRange, COleDateTime *pMaxRange) const | CCJDateTimeCtrl |
GetRange(CTime *pMinRange, CTime *pMaxRange) const | CCJDateTimeCtrl |
GetTime(CTime &timeDest) const | CCJDateTimeCtrl |
GetTime(COleDateTime &timeDest) const | CCJDateTimeCtrl |
GetTime(LPSYSTEMTIME pTimeDest) const | CCJDateTimeCtrl |
SetFormat(LPCTSTR pstrFormat) | CCJDateTimeCtrl |
SetMonthCalColor(int iColor, COLORREF ref) | CCJDateTimeCtrl |
SetMonthCalFont(HFONT hFont, BOOL bRedraw=TRUE) | CCJDateTimeCtrl |
SetRange(const COleDateTime *pMinRange, const COleDateTime *pMaxRange) | CCJDateTimeCtrl |
SetRange(const CTime *pMinRange, const CTime *pMaxRange) | CCJDateTimeCtrl |
SetTime(const CTime *pTimeNew) | CCJDateTimeCtrl |
SetTime(const COleDateTime &timeNew) | CCJDateTimeCtrl |
SetTime(LPSYSTEMTIME pTimeNew=NULL) | CCJDateTimeCtrl |
~CCJDateTimeCtrl() | CCJDateTimeCtrl | [virtual]
Generated on Sun Feb 24 01:24:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJMonthCalCtrl Member List

This is the complete list of members for CCJMonthCalCtrl, including all inherited members.
CCJMonthCalCtrl() | CCJMonthCalCtrl |
Create(DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID) | CCJMonthCalCtrl |
Create(DWORD dwStyle, const POINT &pt, CWnd *pParentWnd, UINT nID) | CCJMonthCalCtrl |
GetColor(int nRegion) const | CCJMonthCalCtrl |
GetCurSel(LPSYSTEMTIME pDateTime) const | CCJMonthCalCtrl |
GetCurSel(CTime &refDateTime) const | CCJMonthCalCtrl |
GetCurSel(COleDateTime &refDateTime) const | CCJMonthCalCtrl |
GetFirstDayOfWeek(BOOL *pbLocal=NULL) const | CCJMonthCalCtrl |
GetMaxSelCount() const | CCJMonthCalCtrl |
GetMinReqRect(RECT *pRect) const | CCJMonthCalCtrl |
GetMonthDelta() const | CCJMonthCalCtrl |
GetMonthRange(COleDateTime &refMinRange, COleDateTime &refMaxRange, DWORD dwFlags) const | CCJMonthCalCtrl |
GetMonthRange(CTime &refMinRange, CTime &refMaxRange, DWORD dwFlags) const | CCJMonthCalCtrl |
GetMonthRange(LPSYSTEMTIME pMinRange, LPSYSTEMTIME pMaxRange, DWORD dwFlags) const | CCJMonthCalCtrl |
GetRange(COleDateTime *pMinRange, COleDateTime *pMaxRange) const | CCJMonthCalCtrl |
GetRange(CTime *pMinRange, CTime *pMaxRange) const | CCJMonthCalCtrl |
GetRange(LPSYSTEMTIME pMinRange, LPSYSTEMTIME pMaxRange) const | CCJMonthCalCtrl |
GetSelRange(COleDateTime &refMinRange, COleDateTime &refMaxRange) const | CCJMonthCalCtrl |
GetSelRange(CTime &refMinRange, CTime &refMaxRange) const | CCJMonthCalCtrl |
GetSelRange(LPSYSTEMTIME pMinRange, LPSYSTEMTIME pMaxRange) const | CCJMonthCalCtrl |
GetToday(CTime &refTime) const | CCJMonthCalCtrl |
GetToday(COleDateTime &refDateTime) const | CCJMonthCalCtrl |
GetToday(LPSYSTEMTIME pDateTime) const | CCJMonthCalCtrl |
HitTest(PMCHITTESTINFO pMCHitTest) | CCJMonthCalCtrl |
SetColor(int nRegion, COLORREF ref) | CCJMonthCalCtrl |
SetCurSel(const LPSYSTEMTIME pDateTime) | CCJMonthCalCtrl |
SetCurSel(const CTime &refDateTime) | CCJMonthCalCtrl |
SetCurSel(const COleDateTime &refDateTime) | CCJMonthCalCtrl |
SetDayState(int nMonths, LPMONTHDAYSTATE pStates) | CCJMonthCalCtrl |
SetFirstDayOfWeek(int iDay, int *lpnOld=NULL) | CCJMonthCalCtrl |
SetMaxSelCount(int nMax) | CCJMonthCalCtrl |
SetMonthDelta(int iDelta) | CCJMonthCalCtrl |
SetRange(const COleDateTime *pMinRange, const COleDateTime *pMaxRange) | CCJMonthCalCtrl |
SetRange(const CTime *pMinRange, const CTime *pMaxRange) | CCJMonthCalCtrl |
SetRange(const LPSYSTEMTIME pMinRange, const LPSYSTEMTIME pMaxRange) | CCJMonthCalCtrl |
SetSelRange(const COleDateTime &pMinRange, const COleDateTime &pMaxRange) | CCJMonthCalCtrl |
SetSelRange(const CTime &pMinRange, const CTime &pMaxRange) | CCJMonthCalCtrl |
SetSelRange(const LPSYSTEMTIME pMinRange, const LPSYSTEMTIME pMaxRange) | CCJMonthCalCtrl |
SetToday(const COleDateTime &refDateTime) | CCJMonthCalCtrl |
SetToday(const CTime *pDateTime) | CCJMonthCalCtrl |
SetToday(const LPSYSTEMTIME pDateTime) | CCJMonthCalCtrl |
SizeMinReq(BOOL bRepaint=TRUE) | CCJMonthCalCtrl |
~CCJMonthCalCtrl() | CCJMonthCalCtrl | [virtual]
Generated on Sun Feb 24 01:24:59 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJDockBar Member List

This is the complete list of members for CCJDockBar, including all inherited members.
CalcFixedLayout(BOOL bStretch, BOOL bHorz) | CCJDockBar | [virtual]
CCJDockBar() | CCJDockBar |
~CCJDockBar() | CCJDockBar | [virtual]
Generated on Sun Feb 24 01:24:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJDockContext Member List

This is the complete list of members for CCJDockContext, including all inherited members.
CanDockDockBar() | CCJDockContext |
CanDockDockBar(CRect rect, DWORD dwDockStyle, CDockBar **ppDockBar=NULL) | CCJDockContext |
CCJDockContext(CControlBar *pBar) | CCJDockContext |
DockSizeBar(CControlBar *, CCJSizeDockBar *=NULL, LPRECT=NULL) | CCJDockContext |
EndDragDockBar() | CCJDockContext |
GetDockBar(DWORD dwOverDockStyle) | CCJDockContext |
m_ptOrig | CCJDockContext |
MoveDockBar(CPoint pt) | CCJDockContext |
StartDragDockBar(CPoint pt) | CCJDockContext |
StartResize(int nHitTest, CPoint pt) | CCJDockContext | [virtual]
Stretch(CPoint pt) | CCJDockContext |
ToggleDocking() | CCJDockContext | [virtual]
TrackDockBar() | CCJDockContext |
~CCJDockContext() | CCJDockContext | [virtual]
Generated on Sun Feb 24 01:24:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJExplorerBar Member List

This is the complete list of members for CCJExplorerBar, including all inherited members.
CalcDynamicLayout(int nLength, DWORD nMode) | CCJControlBar | [virtual]
CCJControlBar() | CCJControlBar |
CCJExplorerBar() | CCJExplorerBar |
Create(CWnd *pParentWnd, UINT nID, LPCTSTR lpszWindowName=NULL, CSize sizeDefault=CSize(200, 100), DWORD dwStyle=CBRS_LEFT) | CCJExplorerBar | [virtual]
CCJControlBar::Create(CWnd *pParentWnd, UINT nID, LPCTSTR lpszWindowName=NULL, CSize sizeDefault=CSize(200, 100), DWORD dwStyle=CBRS_LEFT, BOOL bFlatBorders=FALSE) | CCJControlBar | [virtual]
DrawBorders(CDC *pDC, CRect &rect) | CCJControlBar | [protected, virtual]
DrawGriperCaption(CDC *pDC, LPRECT pRect) | CCJControlBar | [protected, virtual]
DrawGripper(CDC *pDC) | CCJControlBar | [protected, virtual]
EnableDockingOnSizeBar(DWORD dwDockStyle) | CCJControlBar | [virtual]
EnableFlatLook(BOOL bFlat=TRUE) | CCJControlBar | [virtual]
EnableFlatLook(BOOL bGripper, BOOL bBorder, BOOL bButtons) | CCJControlBar | [virtual]
EnableSaveState(bool bAutoSave=true) | CCJControlBar | [virtual]
EraseNonClient() | CCJControlBar | [protected, virtual]
GetButtonRect() | CCJControlBar | [protected, virtual]
GetChildRect(CRect &rect) | CCJExplorerBar | [virtual]
GetGripperRect() | CCJControlBar | [protected, virtual]
GetHorzSize() | CCJControlBar | [virtual]
GetMenuID() | CCJControlBar | [virtual]
GetMinExt() | CCJControlBar | [virtual]
GetVertSize() | CCJControlBar | [virtual]
HitTest(CPoint &point) | CCJControlBar | [protected, virtual]
IsBottomDocked() const | CCJControlBar | [virtual]
IsFloating() const | CCJControlBar | [virtual]
IsHorzDocked() const | CCJControlBar | [virtual]
IsLeftDocked() const | CCJControlBar | [virtual]
IsRightDocked() const | CCJControlBar | [virtual]
IsTopDocked() const | CCJControlBar | [virtual]
IsVertDocked() const | CCJControlBar | [virtual]
LoadBarState(CSize &size, int nID) | CCJControlBar | [protected, virtual]
m_bAutoSave | CCJControlBar | [protected]
m_bButtons | CCJControlBar | [protected]
m_bDragging | CCJControlBar | [protected]
m_bFlatBorder | CCJControlBar | [protected]
m_bFlatGripper | CCJControlBar | [protected]
m_bFloating | CCJControlBar | [protected]
m_bGripper | CCJControlBar | [protected]
m_bMaximized | CCJControlBar | [protected]
m_bOkToDrag | CCJControlBar | [protected]
m_btnClose | CCJControlBar | [protected]
m_btnMinim | CCJControlBar | [protected]
m_bToFit | CCJControlBar |
m_bUnique | CCJControlBar |
m_Caption | CCJExplorerBar | [protected]
m_CaptionButton | CCJExplorerBar | [protected]
m_cxOffset | CCJControlBar | [protected]
m_cyOffset | CCJControlBar | [protected]
m_eAuxIndex | CCJControlBar | [protected]
m_eChildBorder | CCJControlBar |
m_hAuxIcon | CCJControlBar | [protected]
m_hIcon | CCJExplorerBar | [protected]
m_ImageList | CCJControlBar | [protected]
m_nID | CCJControlBar | [protected]
m_nPos | CCJControlBar | [protected]
m_pChildWnd | CCJControlBar | [protected]
m_popToolbarID | CCJControlBar | [protected]
m_popupMenu | CCJControlBar | [protected]
m_popupMenuID | CCJControlBar | [protected]
m_ptCurDrag | CCJControlBar | [protected]
m_ptStartDrag | CCJControlBar | [protected]
m_rcTrack | CCJControlBar | [protected]
m_sizeDesired | CCJControlBar | [protected]
m_sizeFloat | CCJControlBar | [protected]
m_sizeHorz | CCJControlBar | [protected]
m_sizeNormal | CCJControlBar | [protected]
m_sizeVert | CCJControlBar | [protected]
m_strCaption | CCJExplorerBar | [protected]
m_strSection | CCJControlBar | [protected]
m_ToolTip | CCJControlBar | [protected]
Maximize(int size) | CCJControlBar | [virtual]
Minimize() | CCJControlBar | [virtual]
Normalize() | CCJControlBar | [virtual]
OnButtonClose() | CCJExplorerBar | [protected]
OnButtonMinimize() | CCJControlBar | [protected]
OnCreate(LPCREATESTRUCT lpCreateStruct) | CCJExplorerBar | [protected]
OnEraseBkgnd(CDC *pDC) | CCJExplorerBar | [protected]
OnInitMenuPopup(CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu) | CCJControlBar | [protected]
OnInvertTracker(const CRect &rect) | CCJControlBar | [protected, virtual]
OnLButtonDown(UINT nFlags, CPoint point) | CCJExplorerBar | [protected]
OnLButtonUp(UINT nFlags, CPoint point) | CCJExplorerBar | [protected]
OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct) | CCJControlBar | [protected]
OnMenuChar(UINT nChar, UINT nFlags, CMenu *pMenu) | CCJControlBar | [protected]
OnMouseMove(UINT nFlags, CPoint point) | CCJControlBar | [protected]
OnNcHitTest(CPoint point) | CCJControlBar | [protected]
OnNcPaint() | CCJControlBar | [protected]
OnPaint() | CCJControlBar | [protected]
OnRButtonDown(UINT nFlags, CPoint point) | CCJControlBar | [protected]
OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) | CCJControlBar | [protected]
OnUpdateButtonClose(CCmdUI *pCmdUI) | CCJExplorerBar | [protected]
OnUpdateButtonMinimize(CCmdUI *pCmdUI) | CCJControlBar | [protected]
OnUpdateCmdUI(CFrameWnd *pTarget, BOOL bDisableIfNoHndler) | CCJControlBar | [virtual]
OnWindowPosChanged(WINDOWPOS FAR *lpwndpos) | CCJExplorerBar | [protected]
PreTranslateMessage(MSG *pMsg) | CCJControlBar | [virtual]
SaveBarState(CSize &size) | CCJControlBar | [protected, virtual]
SetChild(CWnd *pWnd) | CCJControlBar | [protected, virtual]
SetMenuID(UINT popupMenuID, UINT popToolbarID=0, int nPos=0) | CCJControlBar | [virtual]
SetNormalSize(const CSize &cs) | CCJControlBar | [virtual]
ShowFrameControls(BOOL bGripper=TRUE, BOOL bButtons=TRUE) | CCJControlBar | [virtual]
~CCJControlBar() | CCJControlBar | [virtual]
~CCJExplorerBar() | CCJExplorerBar | [virtual]
Generated on Sun Feb 24 01:24:34 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJFlatButton Member List

This is the complete list of members for CCJFlatButton, including all inherited members.
CCJFlatButton() | CCJFlatButton |
DisableFlatLook(BOOL bDisable=FALSE) | CCJFlatButton | [virtual]
DrawButtonBitmap(CDC *pDC, UINT nState, CRect &rcItem) | CCJFlatButton | [protected, virtual]
DrawButtonIcon(CDC *pDC, UINT nState, CRect &rcItem) | CCJFlatButton | [protected, virtual]
DrawButtonText(CDC *pDC, UINT nState, CRect &rcItem) | CCJFlatButton | [protected, virtual]
DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) | CCJFlatButton | [virtual]
m_bAltColor | CCJFlatButton | [protected]
m_bFlatLook | CCJFlatButton | [protected]
m_bLBtnDown | CCJFlatButton | [protected]
m_bMouseOver | CCJFlatButton | [protected]
m_bPainted | CCJFlatButton | [protected]
m_clrAltHilite | CCJFlatButton | [protected]
m_clrAltNormal | CCJFlatButton | [protected]
m_clrAltShadow | CCJFlatButton | [protected]
m_clrAltTextNm | CCJFlatButton | [protected]
m_clrDkShad | CCJFlatButton | [protected]
m_clrHilite | CCJFlatButton | [protected]
m_clrNormal | CCJFlatButton | [protected]
m_clrShadow | CCJFlatButton | [protected]
m_clrTextGy | CCJFlatButton | [protected]
m_clrTextNm | CCJFlatButton | [protected]
m_Font | CCJFlatButton | [protected]
m_hCursor | CCJFlatButton | [protected]
m_hPushed | CCJFlatButton | [protected]
m_pFont | CCJFlatButton | [protected]
m_sizeIcon | CCJFlatButton | [protected]
OnEraseBkgnd(CDC *pDC) | CCJFlatButton | [protected]
OnLButtonDblClk(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnLButtonDown(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnLButtonUp(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnMouseMove(UINT nFlags, CPoint point) | CCJFlatButton | [protected]
OnPaint() | CCJFlatButton | [protected]
OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) | CCJFlatButton | [protected]
OnSysColorChange() | CCJFlatButton | [protected]
OnTimer(UINT nIDEvent) | CCJFlatButton | [protected]
SetAlternateColors(COLORREF clrAltNormal, COLORREF clrAltHilite, COLORREF clrAltShadow, COLORREF clrAltTextNm) | CCJFlatButton | [virtual]
SetButtonFont(CFont *pFont) | CCJFlatButton | [virtual]
SetIcon(HICON hIcon, CSize size) | CCJFlatButton | [virtual]
SetIcon(HICON hIcon, HICON hPushed, CSize size) | CCJFlatButton | [virtual]
UpdateFont() | CCJFlatButton | [protected, virtual]
~CCJFlatButton() | CCJFlatButton | [virtual]
Generated on Sun Feb 24 01:24:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJFlatComboBox Member List

This is the complete list of members for CCJFlatComboBox, including all inherited members.
CCJFlatComboBox() | CCJFlatComboBox |
DrawCombo(STATE eState, COLORREF clrTopLeft, COLORREF clrBottomRight, CDC *pDC=NULL) | CCJFlatComboBox | [protected, virtual]
EnableAutoCompletion(BOOL bEnable=TRUE) | CCJFlatComboBox | [virtual]
IsWin95() | CCJFlatComboBox |
m_bAutoComp | CCJFlatComboBox | [protected]
m_bHasFocus | CCJFlatComboBox | [protected]
m_bLBtnDown | CCJFlatComboBox | [protected]
m_bPainted | CCJFlatComboBox | [protected]
m_clrHilite | CCJFlatComboBox | [protected]
m_clrNormal | CCJFlatComboBox | [protected]
m_clrShadow | CCJFlatComboBox | [protected]
NORMAL enum value | CCJFlatComboBox | [protected]
OnEditUpdate() | CCJFlatComboBox | [protected]
OnEraseBkgnd(CDC *pDC) | CCJFlatComboBox | [protected]
OnKillFocus() | CCJFlatComboBox | [protected]
OnLButtonDown(UINT nFlags, CPoint point) | CCJFlatComboBox | [protected]
OnLButtonUp(UINT nFlags, CPoint point) | CCJFlatComboBox | [protected]
OnMouseMove(UINT nFlags, CPoint point) | CCJFlatComboBox | [protected]
OnPaint() | CCJFlatComboBox | [protected]
OnSetFocus() | CCJFlatComboBox | [protected]
OnSysColorChange() | CCJFlatComboBox | [protected]
OnTimer(UINT nIDEvent) | CCJFlatComboBox | [protected]
PointInRect() | CCJFlatComboBox | [virtual]
PRESSED enum value | CCJFlatComboBox | [protected]
PreTranslateMessage(MSG *pMsg) | CCJFlatComboBox | [virtual]
RAISED enum value | CCJFlatComboBox | [protected]
STATE enum name | CCJFlatComboBox | [protected]
~CCJFlatComboBox() | CCJFlatComboBox | [virtual]
Generated on Sun Feb 24 01:24:36 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJFlatHeaderCtrl Member List

This is the complete list of members for CCJFlatHeaderCtrl, including all inherited members.
CCJFlatHeaderCtrl() | CCJFlatHeaderCtrl |
DrawFlatBorder(CDC *pDC) | CCJFlatHeaderCtrl | [protected, virtual]
DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) | CCJFlatHeaderCtrl | [virtual]
GetMenuID() | CCJFlatHeaderCtrl | [virtual]
InitializeHeader(bool bBoldFont) | CCJFlatHeaderCtrl | [virtual]
m_bBoldFont | CCJFlatHeaderCtrl | [protected]
m_bLBtnDown | CCJFlatHeaderCtrl | [protected]
m_bSortAsc | CCJFlatHeaderCtrl | [protected]
m_Font | CCJFlatHeaderCtrl | [protected]
m_nOffset | CCJFlatHeaderCtrl | [protected]
m_nPos | CCJFlatHeaderCtrl | [protected]
m_nSortCol | CCJFlatHeaderCtrl | [protected]
m_popToolbarID | CCJFlatHeaderCtrl | [protected]
m_popupMenu | CCJFlatHeaderCtrl | [protected]
m_popupMenuID | CCJFlatHeaderCtrl | [protected]
m_pParentWnd | CCJFlatHeaderCtrl | [protected]
m_rcOldSize | CCJFlatHeaderCtrl | [protected]
OnCreate(LPCREATESTRUCT lpCreateStruct) | CCJFlatHeaderCtrl | [protected]
OnEraseBkgnd(CDC *pDC) | CCJFlatHeaderCtrl | [protected]
OnInitMenuPopup(CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu) | CCJFlatHeaderCtrl | [protected]
OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct) | CCJFlatHeaderCtrl | [protected]
OnMenuChar(UINT nChar, UINT nFlags, CMenu *pMenu) | CCJFlatHeaderCtrl | [protected]
OnPaint() | CCJFlatHeaderCtrl | [protected]
OnRButtonDown(UINT nFlags, CPoint point) | CCJFlatHeaderCtrl | [protected]
OnWindowPosChanged(WINDOWPOS FAR *lpwndpos) | CCJFlatHeaderCtrl | [protected]
PreSubclassWindow() | CCJFlatHeaderCtrl | [protected, virtual]
ResizeWindow() | CCJFlatHeaderCtrl | [protected, virtual]
SetFontBold(BOOL bBoldFont=TRUE) | CCJFlatHeaderCtrl | [virtual]
SetMenuID(UINT popupMenuID, UINT popToolbarID=0, int nPos=0) | CCJFlatHeaderCtrl | [virtual]
SetSortImage(int nCol, BOOL bAsc) | CCJFlatHeaderCtrl | [virtual]
~CCJFlatHeaderCtrl() | CCJFlatHeaderCtrl | [virtual]
Generated on Sun Feb 24 01:24:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJFlatSplitterWnd Member List

This is the complete list of members for CCJFlatSplitterWnd, including all inherited members.
CCJFlatSplitterWnd() | CCJFlatSplitterWnd |
DisableFlatStyle(BOOL bDisable=TRUE) | CCJFlatSplitterWnd | [virtual]
HideColumn(int nColHide) | CCJFlatSplitterWnd | [virtual]
HideRow(int nRowHide) | CCJFlatSplitterWnd | [virtual]
m_bFlatSplitter | CCJFlatSplitterWnd | [protected]
m_nHiddenCol | CCJFlatSplitterWnd | [protected]
m_nHiddenRow | CCJFlatSplitterWnd | [protected]
OnDrawSplitter(CDC *pDC, ESplitType nType, const CRect &rect) | CCJFlatSplitterWnd | [virtual]
OnPaint() | CCJFlatSplitterWnd | [protected]
ReplaceView(int nRow, int nCol, CRuntimeClass *pViewClass) | CCJFlatSplitterWnd | [virtual]
ShowColumn() | CCJFlatSplitterWnd | [virtual]
ShowRow() | CCJFlatSplitterWnd | [virtual]
SwitchView(int nRow, int nCol, CView *pNewView) | CCJFlatSplitterWnd | [virtual]
~CCJFlatSplitterWnd() | CCJFlatSplitterWnd | [virtual]
Generated on Sun Feb 24 01:24:37 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJFlatTabCtrl Member List

This is the complete list of members for CCJFlatTabCtrl, including all inherited members.
CCJFlatTabCtrl() | CCJFlatTabCtrl |
CreateTabFont(const int iTabHeight) | CCJFlatTabCtrl | [private]
DeleteAllItems() | CCJFlatTabCtrl | [virtual]
DeleteItem(int nItem) | CCJFlatTabCtrl | [virtual]
DrawTab(CDC &dc, const int x, const int y, const int iHeight, bool bSelected, bool bBottom, LPCTSTR lpszTab) const | CCJFlatTabCtrl | [private]
EnableButtons(void) | CCJFlatTabCtrl | [private]
GetCurSel() const | CCJFlatTabCtrl | [inline, virtual]
GetItemCount() const | CCJFlatTabCtrl | [inline, virtual]
GetItemRect(int nItem, LPRECT lpRect) | CCJFlatTabCtrl | [virtual]
GetTabWidth(const int nItem) const | CCJFlatTabCtrl | [private]
GetTipText(int nItem) | CCJFlatTabCtrl | [virtual]
GetTotalArrowWidth(void) const | CCJFlatTabCtrl | [private]
GetTotalTabWidth(void) const | CCJFlatTabCtrl | [private]
HitTest(TCHITTESTINFO *pHitTestInfo) const | CCJFlatTabCtrl | [virtual]
Home() | CCJFlatTabCtrl | [virtual]
InsertItem(const int nItem, LPCTSTR lpszItem) | CCJFlatTabCtrl | [virtual]
InvalidateTabs(void) | CCJFlatTabCtrl | [private]
m_bHasArrows | CCJFlatTabCtrl | [private]
m_bHasHomeEnd | CCJFlatTabCtrl | [private]
m_BoldFont | CCJFlatTabCtrl | [private]
m_bTabsOnBottom | CCJFlatTabCtrl | [private]
m_Font | CCJFlatTabCtrl | [private]
m_hEndArrow | CCJFlatTabCtrl | [private]
m_hEndArrowDisabled | CCJFlatTabCtrl | [private]
m_hHomeArrow | CCJFlatTabCtrl | [private]
m_hHomeArrowDisabled | CCJFlatTabCtrl | [private]
m_hLeftArrow | CCJFlatTabCtrl | [private]
m_hLeftArrowDisabled | CCJFlatTabCtrl | [private]
m_hRightArrow | CCJFlatTabCtrl | [private]
m_hRightArrowDisabled | CCJFlatTabCtrl | [private]
m_iClientHeight | CCJFlatTabCtrl | [private]
m_iClientWidth | CCJFlatTabCtrl | [private]
m_iCurSel | CCJFlatTabCtrl | [private]
m_iTotalTabWidth | CCJFlatTabCtrl | [private]
m_iXOffset | CCJFlatTabCtrl | [private]
m_pEndButton | CCJFlatTabCtrl | [private]
m_pHomeButton | CCJFlatTabCtrl | [private]
m_pLeftButton | CCJFlatTabCtrl | [private]
m_pRightButton | CCJFlatTabCtrl | [private]
m_TabList | CCJFlatTabCtrl | [private]
m_TabTipList | CCJFlatTabCtrl | [private]
m_ToolTip | CCJFlatTabCtrl | [private]
OnCreate(LPCREATESTRUCT lpCreateStruct) | CCJFlatTabCtrl | [protected]
OnEndArrow() | CCJFlatTabCtrl | [protected]
OnHomeArrow() | CCJFlatTabCtrl | [protected]
OnLButtonDown(UINT nFlags, CPoint point) | CCJFlatTabCtrl | [protected]
OnLeftArrow() | CCJFlatTabCtrl | [protected]
OnPaint() | CCJFlatTabCtrl | [protected]
OnRightArrow() | CCJFlatTabCtrl | [protected]
OnSize(UINT nType, int cx, int cy) | CCJFlatTabCtrl | [protected]
PreCreateWindow(CREATESTRUCT &cs) | CCJFlatTabCtrl | [protected, virtual]
PreTranslateMessage(MSG *pMsg) | CCJFlatTabCtrl | [protected, virtual]
SetCurSel(int nItem) | CCJFlatTabCtrl | [virtual]
SetTipText(int nItem, LPCTSTR lpszTabTip) | CCJFlatTabCtrl | [virtual]
~CCJFlatTabCtrl() | CCJFlatTabCtrl | [virtual]
Generated on Sun Feb 24 01:24:39 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJFontCombo Member List

This is the complete list of members for CCJFontCombo, including all inherited members.
CCJFontCombo() | CCJFontCombo |
DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) | CCJFontCombo | [virtual]
EnumFontProc(LPLOGFONT lpLogFont, LPTEXTMETRIC lpTextMetric, short nFontType, LPHANDLE lpData) | CCJFontCombo | [static]
GetSelFont(LOGFONT &logFont) | CCJFontCombo | [virtual]
InitializeFonts() | CCJFontCombo | [protected, virtual]
m_clrBkgnd | CCJFontCombo | [protected]
m_clrHilight | CCJFontCombo | [protected]
m_clrHilightText | CCJFontCombo | [protected]
m_clrNormalText | CCJFontCombo | [protected]
MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct) | CCJFontCombo | [virtual]
OnCreate(LPCREATESTRUCT lpCreateStruct) | CCJFontCombo | [protected]
OnDestroy() | CCJFontCombo | [protected]
OnEraseBkgnd(CDC *pDC) | CCJFontCombo | [protected]
OnPaint() | CCJFontCombo | [protected]
PreSubclassWindow() | CCJFontCombo | [protected, virtual]
SetHilightColors(COLORREF clrHilight, COLORREF clrHilightText) | CCJFontCombo | [virtual]
SetNormalColors(COLORREF clrBkgnd, COLORREF clrNormalText) | CCJFontCombo | [virtual]
~CCJFontCombo() | CCJFontCombo | [virtual]
Generated on Sun Feb 24 01:24:40 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJFrameWnd Member List

This is the complete list of members for CCJFrameWnd, including all inherited members.
brdrAllRaised enum value | CCJFrameWnd | [protected]
brdrFlatAll enum value | CCJFrameWnd | [protected]
brdrFlatBottom enum value | CCJFrameWnd | [protected]
brdrFlatHorizontal enum value | CCJFrameWnd | [protected]
brdrFlatLeft enum value | CCJFrameWnd | [protected]
brdrFlatRight enum value | CCJFrameWnd | [protected]
brdrFlatTop enum value | CCJFrameWnd | [protected]
brdrFlatVertical enum value | CCJFrameWnd | [protected]
CCJFrameWnd() | CCJFrameWnd |
DockControlBarLeftOf(CControlBar *Bar, CControlBar *LeftOf) | CCJFrameWnd | [virtual]
DockFlatBorders enum name | CCJFrameWnd | [protected]
DockSizeBar(CControlBar *pBar, CCJSizeDockBar *pDockBar=NULL, LPRECT lpRect=NULL) | CCJFrameWnd | [virtual]
dwDockBarMap | CCJFrameWnd | [protected, static]
EnableDocking(DWORD dwDockStyle) | CCJFrameWnd | [virtual]
EnableDockingSizeBar(DWORD dwDockStyle, DockFlatBorders FlatFlags=brdrAllRaised) | CCJFrameWnd | [virtual]
InitializeMenu(UINT nMenuID, UINT *nToolbarIDs=NULL, int nSize=0) | CCJFrameWnd | [virtual]
InitializeMenu(UINT nMenuID, UINT nToolbarID=NULL) | CCJFrameWnd | [virtual]
LoadBarState(LPCTSTR lpszProfileName) | CCJFrameWnd | [virtual]
m_menu | CCJFrameWnd | [protected]
m_wndMenuBar | CCJFrameWnd | [protected]
NewMenu(UINT nMenuID, UINT *nToolbarIDs=NULL, int nSize=0) | CCJFrameWnd | [protected, virtual]
NewMenu(UINT nMenuID, UINT nToolbarID=NULL) | CCJFrameWnd | [protected, virtual]
OnClose() | CCJFrameWnd | [protected]
OnInitMenuPopup(CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu) | CCJFrameWnd | [protected]
OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct) | CCJFrameWnd | [protected]
OnMenuChar(UINT nChar, UINT nFlags, CMenu *pMenu) | CCJFrameWnd | [protected]
PreCreateWindow(CREATESTRUCT &cs) | CCJFrameWnd | [protected, virtual]
PreCreateWindow(CREATESTRUCT &cs, UINT nIconID) | CCJFrameWnd | [protected, virtual]
PreTranslateMessage(MSG *pMsg) | CCJFrameWnd | [virtual]
RecalcAllExcept(CCJSizeDockBar *pBar) | CCJFrameWnd | [virtual]
RecalcLayout(BOOL bNotify=TRUE) | CCJFrameWnd | [virtual]
SaveBarState(LPCTSTR lpszProfileName) const | CCJFrameWnd | [virtual]
~CCJFrameWnd() | CCJFrameWnd | [virtual]
Generated on Sun Feb 24 01:24:41 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJHexEdit Member List

This is the complete list of members for CCJHexEdit, including all inherited members.
CalcPos(int x, int y) | CCJHexEdit | [protected, virtual]
CCJHexEdit() | CCJHexEdit |
Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID, CCreateContext *pContext=NULL) | CCJHexEdit | [virtual]
CreateAddressCaret(void) | CCJHexEdit | [protected, virtual]
CreateEditCaret(void) | CCJHexEdit | [protected, virtual]
EDIT_ASCII enum value | CCJHexEdit |
EDIT_HIGH enum value | CCJHexEdit |
EDIT_LOW enum value | CCJHexEdit |
EDIT_NONE enum value | CCJHexEdit |
EDITMODE enum name | CCJHexEdit |
GetData(LPBYTE p, int len) | CCJHexEdit | [virtual]
GetSel(void) | CCJHexEdit | [virtual]
IsSelected(void) | CCJHexEdit | [protected, virtual]
m_bAddressIsWide | CCJHexEdit |
m_bHalfPage | CCJHexEdit |
m_bNoAddressChange | CCJHexEdit |
m_bpr | CCJHexEdit |
m_bShowAddress | CCJHexEdit |
m_bShowAscii | CCJHexEdit |
m_bShowHex | CCJHexEdit |
m_bUpdate | CCJHexEdit |
m_currentAddress | CCJHexEdit |
m_currentMode | CCJHexEdit |
m_editPos | CCJHexEdit |
m_Font | CCJHexEdit |
m_length | CCJHexEdit |
m_lineHeight | CCJHexEdit |
m_lpp | CCJHexEdit |
m_nullWidth | CCJHexEdit |
m_offAddress | CCJHexEdit |
m_offAscii | CCJHexEdit |
m_offHex | CCJHexEdit |
m_pData | CCJHexEdit |
m_selEnd | CCJHexEdit |
m_selStart | CCJHexEdit |
m_topindex | CCJHexEdit |
Move(int x, int y) | CCJHexEdit | [protected, virtual]
NormalizeSel(void) | CCJHexEdit | [protected, virtual]
OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) | CCJHexEdit | [protected]
OnContextMenu(CWnd *, CPoint point) | CCJHexEdit | [protected]
OnEditClear() | CCJHexEdit | [protected]
OnEditCopy() | CCJHexEdit | [protected]
OnEditCut() | CCJHexEdit | [protected]
OnEditPaste() | CCJHexEdit | [protected]
OnEditSelectAll() | CCJHexEdit | [protected]
OnEditUndo() | CCJHexEdit | [protected]
OnEraseBkgnd(CDC *pDC) | CCJHexEdit | [protected]
OnGetDlgCode() | CCJHexEdit | [protected]
OnHScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar) | CCJHexEdit | [protected]
OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) | CCJHexEdit | [protected]
OnKillFocus(CWnd *pNewWnd) | CCJHexEdit | [protected]
OnLButtonDblClk(UINT nFlags, CPoint point) | CCJHexEdit | [protected]
OnLButtonDown(UINT nFlags, CPoint point) | CCJHexEdit | [protected]
OnLButtonUp(UINT nFlags, CPoint point) | CCJHexEdit | [protected]
OnMouseMove(UINT nFlags, CPoint point) | CCJHexEdit | [protected]
OnPaint() | CCJHexEdit | [protected]
OnSetFocus(CWnd *pOldWnd) | CCJHexEdit | [protected]
OnVScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar) | CCJHexEdit | [protected]
PreCreateWindow(CREATESTRUCT &cs) | CCJHexEdit | [protected, virtual]
RepositionCaret(int p) | CCJHexEdit | [protected, virtual]
ScrollIntoView(int p) | CCJHexEdit | [protected, virtual]
SelDelete(int s, int e) | CCJHexEdit | [protected, virtual]
SelInsert(int s, int l) | CCJHexEdit | [protected, virtual]
SetBPR(int bpr) | CCJHexEdit | [virtual]
SetData(LPBYTE p, int len) | CCJHexEdit | [virtual]
SetOptions(BOOL a, BOOL h, BOOL c, BOOL w) | CCJHexEdit | [virtual]
SetSel(int s, int e) | CCJHexEdit | [virtual]
UpdateScrollbars(void) | CCJHexEdit | [protected, virtual]
~CCJHexEdit() | CCJHexEdit | [virtual]
Generated on Sun Feb 24 01:24:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJHtmlView Member List

This is the complete list of members for CCJHtmlView, including all inherited members.
BeforeNavigate2(LPDISPATCH pDisp, VARIANT *URL, VARIANT *Flags, VARIANT *TargetFrameName, VARIANT *PostData, VARIANT *Headers, BOOL *Cancel) | CCJHtmlView | [protected, virtual]
CCJHtmlView() | CCJHtmlView | [protected]
Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID, CCreateContext *pContext=NULL) | CCJHtmlView | [virtual]
DocumentComplete(LPDISPATCH pDisp, VARIANT *URL) | CCJHtmlView | [protected, virtual]
ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) | CCJHtmlView |
GetAddressBar() const | CCJHtmlView |
GetApplication() const | CCJHtmlView |
GetBusy() const | CCJHtmlView |
GetContainer() const | CCJHtmlView |
GetFullName() const | CCJHtmlView |
GetFullScreen() const | CCJHtmlView |
GetHeight() const | CCJHtmlView |
GetHtmlDocument() const | CCJHtmlView |
GetLeft() const | CCJHtmlView |
GetLocationName() const | CCJHtmlView |
GetLocationURL() const | CCJHtmlView |
GetMenuBar() const | CCJHtmlView |
GetOffline() const | CCJHtmlView |
GetParentBrowser() const | CCJHtmlView |
GetProperty(LPCTSTR lpszProperty, CString &strValue) | CCJHtmlView |
GetProperty(LPCTSTR lpszProperty) | CCJHtmlView |
GetReadyState() const | CCJHtmlView |
GetRegisterAsBrowser() const | CCJHtmlView |
GetRegisterAsDropTarget() const | CCJHtmlView |
GetSilent() const | CCJHtmlView |
GetStatusBar() const | CCJHtmlView |
GetTheaterMode() const | CCJHtmlView |
GetToolBar() const | CCJHtmlView |
GetTop() const | CCJHtmlView |
GetTopLevelContainer() const | CCJHtmlView |
GetType() const | CCJHtmlView |
GetVisible() const | CCJHtmlView |
GoBack() | CCJHtmlView |
GoForward() | CCJHtmlView |
GoHome() | CCJHtmlView |
GoSearch() | CCJHtmlView |
LoadFromResource(LPCTSTR lpszResource) | CCJHtmlView |
LoadFromResource(UINT nRes) | CCJHtmlView |
m_pBrowserApp | CCJHtmlView | [protected]
m_wndBrowser | CCJHtmlView |
Navigate(LPCTSTR URL, DWORD dwFlags=0, LPCTSTR lpszTargetFrameName=NULL, LPCTSTR lpszHeaders=NULL, LPVOID lpvPostData=NULL, DWORD dwPostDataLen=0) | CCJHtmlView |
Navigate2(LPITEMIDLIST pIDL, DWORD dwFlags=0, LPCTSTR lpszTargetFrameName=NULL) | CCJHtmlView |
Navigate2(LPCTSTR lpszURL, DWORD dwFlags=0, LPCTSTR lpszTargetFrameName=NULL, LPCTSTR lpszHeaders=NULL, LPVOID lpvPostData=NULL, DWORD dwPostDataLen=0) | CCJHtmlView |
Navigate2(LPCTSTR lpszURL, DWORD dwFlags, CByteArray &baPostedData, LPCTSTR lpszTargetFrameName=NULL, LPCTSTR lpszHeader=NULL) | CCJHtmlView |
NavigateComplete2(LPDISPATCH pDisp, VARIANT *URL) | CCJHtmlView | [protected, virtual]
OnBeforeNavigate2(LPCTSTR lpszURL, DWORD nFlags, LPCTSTR lpszTargetFrameName, CByteArray &baPostedData, LPCTSTR lpszHeaders, BOOL *pbCancel) | CCJHtmlView | [virtual]
OnCommandStateChange(long nCommand, BOOL bEnable) | CCJHtmlView | [virtual]
OnDestroy() | CCJHtmlView | [protected]
OnDocumentComplete(LPCTSTR lpszURL) | CCJHtmlView | [virtual]
OnDownloadBegin() | CCJHtmlView | [virtual]
OnDownloadComplete() | CCJHtmlView | [virtual]
OnDraw(CDC *pDC) | CCJHtmlView | [virtual]
OnEraseBkgnd(CDC *pDC) | CCJHtmlView | [protected]
OnFilePrint() | CCJHtmlView | [protected]
OnFullScreen(BOOL bFullScreen) | CCJHtmlView | [virtual]
OnMenuBar(BOOL bMenuBar) | CCJHtmlView | [virtual]
OnNavigateComplete2(LPCTSTR strURL) | CCJHtmlView | [virtual]
OnNewWindow2(LPDISPATCH *ppDisp, BOOL *Cancel) | CCJHtmlView | [virtual]
OnPaint() | CCJHtmlView | [protected]
OnProgressChange(long nProgress, long nProgressMax) | CCJHtmlView | [virtual]
OnPropertyChange(LPCTSTR lpszProperty) | CCJHtmlView | [virtual]
OnQuit() | CCJHtmlView | [virtual]
OnSize(UINT nType, int cx, int cy) | CCJHtmlView | [protected]
OnStatusBar(BOOL bStatusBar) | CCJHtmlView | [virtual]
OnStatusTextChange(LPCTSTR lpszText) | CCJHtmlView | [virtual]
OnTheaterMode(BOOL bTheaterMode) | CCJHtmlView | [virtual]
OnTitleChange(LPCTSTR lpszText) | CCJHtmlView | [virtual]
OnToolBar(BOOL bToolBar) | CCJHtmlView | [virtual]
OnVisible(BOOL bVisible) | CCJHtmlView | [virtual]
PutProperty(LPCTSTR lpszProperty, const VARIANT &vtValue) | CCJHtmlView |
PutProperty(LPCTSTR lpszPropertyName, double dValue) | CCJHtmlView |
PutProperty(LPCTSTR lpszPropertyName, LPCTSTR lpszValue) | CCJHtmlView |
PutProperty(LPCTSTR lpszPropertyName, long lValue) | CCJHtmlView |
PutProperty(LPCTSTR lpszPropertyName, short nValue) | CCJHtmlView |
QueryStatusWB(OLECMDID cmdID) const | CCJHtmlView |
Refresh() | CCJHtmlView |
Refresh2(int nLevel) | CCJHtmlView |
SetAddressBar(BOOL bNewValue) | CCJHtmlView |
SetFullScreen(BOOL bNewValue) | CCJHtmlView |
SetHeight(long nNewValue) | CCJHtmlView |
SetLeft(long nNewValue) | CCJHtmlView |
SetMenuBar(BOOL bNewValue) | CCJHtmlView |
SetOffline(BOOL bNewValue) | CCJHtmlView |
SetRegisterAsBrowser(BOOL bNewValue) | CCJHtmlView |
SetRegisterAsDropTarget(BOOL bNewValue) | CCJHtmlView |
SetSilent(BOOL bNewValue) | CCJHtmlView |
SetStatusBar(BOOL bNewValue) | CCJHtmlView |
SetTheaterMode(BOOL bNewValue) | CCJHtmlView |
SetToolBar(int nNewValue) | CCJHtmlView |
SetTop(long nNewValue) | CCJHtmlView |
SetVisible(BOOL bNewValue) | CCJHtmlView |
Stop() | CCJHtmlView |
~CCJHtmlView() | CCJHtmlView | [protected, virtual]
Generated on Sun Feb 24 01:24:45 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJHyperLink Member List

This is the complete list of members for CCJHyperLink, including all inherited members.
CCJHyperLink() | CCJHyperLink |
CtlColor(CDC *pDC, UINT nCtlColor) | CCJHyperLink | [protected]
GetAutoSize() const | CCJHyperLink | [virtual]
GetHoverColor() const | CCJHyperLink | [virtual]
GetLinkColor() const | CCJHyperLink | [virtual]
GetLinkCursor() const | CCJHyperLink | [virtual]
GetRegKey(HKEY key, LPCTSTR subkey, LPTSTR retdata) | CCJHyperLink | [protected, virtual]
GetUnderline() const | CCJHyperLink | [virtual]
GetURL() const | CCJHyperLink | [virtual]
GetVisited() const | CCJHyperLink | [virtual]
GetVisitedColor() const | CCJHyperLink | [virtual]
GotoURL(LPCTSTR url, int showcmd) | CCJHyperLink | [virtual]
m_bAdjustToFit | CCJHyperLink | [protected]
m_bOverControl | CCJHyperLink | [protected]
m_bUnderline | CCJHyperLink | [protected]
m_bVisited | CCJHyperLink | [protected]
m_crHoverColor | CCJHyperLink | [protected]
m_crLinkColor | CCJHyperLink | [protected]
m_crVisitedColor | CCJHyperLink | [protected]
m_Font | CCJHyperLink | [protected]
m_hLinkCursor | CCJHyperLink | [protected]
m_strURL | CCJHyperLink | [protected]
m_ToolTip | CCJHyperLink | [protected]
OnClicked() | CCJHyperLink | [protected]
OnMouseMove(UINT nFlags, CPoint point) | CCJHyperLink | [protected]
OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) | CCJHyperLink | [protected]
PositionWindow() | CCJHyperLink | [protected, virtual]
PreSubclassWindow() | CCJHyperLink | [protected, virtual]
PreTranslateMessage(MSG *pMsg) | CCJHyperLink | [virtual]
ReportError(int nError) | CCJHyperLink | [protected, virtual]
SetAutoSize(BOOL bAutoSize=TRUE) | CCJHyperLink | [virtual]
SetColors(COLORREF crLinkColor, COLORREF crVisitedColor, COLORREF crHoverColor=-1) | CCJHyperLink | [virtual]
SetDefaultCursor() | CCJHyperLink | [protected, virtual]
SetLinkCursor(HCURSOR hCursor) | CCJHyperLink | [virtual]
SetUnderline(BOOL bUnderline=TRUE) | CCJHyperLink | [virtual]
SetURL(CString strURL) | CCJHyperLink | [virtual]
SetVisited(BOOL bVisited=TRUE) | CCJHyperLink | [virtual]
~CCJHyperLink() | CCJHyperLink | [virtual]
Generated on Sun Feb 24 01:24:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJListBox Member List

This is the complete list of members for CCJListBox, including all inherited members.
CCJListBox() | CCJListBox |
OnEraseBkgnd(CDC *pDC) | CCJListBox | [protected]
OnPaint() | CCJListBox | [protected]
~CCJListBox() | CCJListBox | [virtual]
Generated on Sun Feb 24 01:24:46 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJListCtrl Member List

This is the complete list of members for CCJListCtrl, including all inherited members.
AddColumn(LPCTSTR lpszColHeading, int nWidth=-1, int nFormat=LVCFMT_LEFT) | CCJListCtrl | [virtual]
AutoSaveColumns(LPCTSTR lpszSection=NULL, LPCTSTR lpszEntry=NULL, LPCTSTR lpszDefault=NULL) | CCJListCtrl | [virtual]
AutoSizeColumn(int nCol=-1) | CCJListCtrl | [virtual]
BuildColumns(int nCols, int *nWidth, CString *strColString) | CCJListCtrl | [virtual]
BuildColumns(int nCols, int *nWidth, int *nColString) | CCJListCtrl | [virtual]
CCJListCtrl() | CCJListCtrl |
CopyRow(int nFrom, int nTo) | CCJListCtrl | [virtual]
DisableColumnSizing(bool bDisable) | CCJListCtrl | [virtual]
GetColumnCount() const | CCJListCtrl | [virtual]
GetExtendedStyle() | CCJListCtrl | [virtual]
GetStoredWidth(int nCol) | CCJListCtrl | [virtual]
HitTestEx(CPoint &point, int *col) const | CCJListCtrl | [virtual]
LoadColumnWidths() | CCJListCtrl | [virtual]
m_bAscending | CCJListCtrl | [protected]
m_bAutoSave | CCJListCtrl | [private]
m_bNoColSizing | CCJListCtrl | [protected]
m_clrText | CCJListCtrl | [protected]
m_clrTextBk | CCJListCtrl | [protected]
m_nMaxColWidth | CCJListCtrl | [protected]
m_nMinColWidth | CCJListCtrl | [protected]
m_nMinSize | CCJListCtrl | [protected]
m_nSortedCol | CCJListCtrl | [protected]
m_pHeaderCtrl | CCJListCtrl | [protected]
m_pListCtrl | CCJListCtrl | [protected]
m_strDefault | CCJListCtrl | [protected]
m_strEntry | CCJListCtrl | [protected]
m_strSection | CCJListCtrl | [protected]
MoveRow(int nFrom, int nTo) | CCJListCtrl | [virtual]
OnCustomDraw(NMHDR *pNMHDR, LRESULT *pResult) | CCJListCtrl | [protected]
OnDestroy() | CCJListCtrl | [protected]
OnEraseBkgnd(CDC *pDC) | CCJListCtrl | [protected]
OnNotify(WPARAM wParam, LPARAM lParam, LRESULT *pResult) | CCJListCtrl | [protected, virtual]
OnPaint() | CCJListCtrl | [protected]
SaveColumnWidths() | CCJListCtrl | [virtual]
SetColumnWidth(int nCol) | CCJListCtrl | [virtual]
SetExtendedStyle(DWORD dwExStyle) | CCJListCtrl | [virtual]
SetMinimumColSize(int nSize) | CCJListCtrl | [virtual]
SetRowColors(COLORREF clrText, COLORREF clrTextBk) | CCJListCtrl | [virtual]
SortList(int nCol, bool bAscending) | CCJListCtrl | [virtual]
SubclassHeader(bool bBoldFont=false) | CCJListCtrl | [virtual]
~CCJListCtrl() | CCJListCtrl | [virtual]
Generated on Sun Feb 24 01:24:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJListView Member List

This is the complete list of members for CCJListView, including all inherited members.
AddColumn(LPCTSTR lpszColHeading, int nWidth=-1, int nFormat=LVCFMT_LEFT) | CCJListView | [virtual]
AutoSaveColumns(LPCTSTR lpszSection=NULL, LPCTSTR lpszEntry=NULL, LPCTSTR lpszDefault=NULL) | CCJListView | [virtual]
AutoSizeColumn(int nCol=-1) | CCJListView | [virtual]
BuildColumns(int nCols, int *nWidth, CString *strColString) | CCJListView | [virtual]
BuildColumns(int nCols, int *nWidth, int *nColString) | CCJListView | [virtual]
CCJListView() | CCJListView |
CopyRow(int nFrom, int nTo) | CCJListView | [virtual]
DisableColumnSizing(bool bDisable) | CCJListView | [virtual]
GetColumnCount() const | CCJListView | [virtual]
GetExtendedStyle() | CCJListView | [virtual]
GetStoredWidth(int nCol) | CCJListView | [virtual]
HitTestEx(CPoint &point, int *col) const | CCJListView | [virtual]
LoadColumnWidths() | CCJListView | [virtual]
m_bAscending | CCJListView | [private]
m_bAutoSave | CCJListView | [private]
m_bNoColSizing | CCJListView | [protected]
m_clrText | CCJListView | [protected]
m_clrTextBk | CCJListView | [protected]
m_nMaxColWidth | CCJListView | [protected]
m_nMinColWidth | CCJListView | [protected]
m_nMinSize | CCJListView | [protected]
m_nSortedCol | CCJListView | [protected]
m_pHeaderCtrl | CCJListView | [protected]
m_pListCtrl | CCJListView | [protected]
m_strDefault | CCJListView | [protected]
m_strEntry | CCJListView | [protected]
m_strSection | CCJListView | [protected]
MoveRow(int nFrom, int nTo) | CCJListView | [virtual]
OnCustomDraw(NMHDR *pNMHDR, LRESULT *pResult) | CCJListView | [protected]
OnDestroy() | CCJListView | [protected]
OnDraw(CDC *pDC) | CCJListView | [protected, virtual]
OnEraseBkgnd(CDC *pDC) | CCJListView | [protected]
OnInitialUpdate() | CCJListView | [virtual]
OnNotify(WPARAM wParam, LPARAM lParam, LRESULT *pResult) | CCJListView | [protected, virtual]
SaveColumnWidths() | CCJListView | [virtual]
SetColumnWidth(int nCol) | CCJListView | [virtual]
SetExtendedStyle(DWORD dwExStyle) | CCJListView | [virtual]
SetMinimumColSize(int nSize) | CCJListView | [virtual]
SetRowColors(COLORREF clrText, COLORREF clrTextBk) | CCJListView | [virtual]
SortList(int nCol, bool bAscending) | CCJListView | [virtual]
SubclassHeader(bool bBoldFont=false) | CCJListView | [virtual]
~CCJListView() | CCJListView | [virtual]
Generated on Sun Feb 24 01:24:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJLogoPane Member List

This is the complete list of members for CCJLogoPane, including all inherited members.
CCJLogoPane() | CCJLogoPane |
Create(LPCTSTR lpszWindowName, DWORD dwStyle, CWnd *pParentWnd, UINT nID) | CCJLogoPane | [virtual]
GetLogoText() | CCJLogoPane | [virtual]
m_Font | CCJLogoPane |
m_strLogoText | CCJLogoPane |
OnPaint() | CCJLogoPane | [protected]
SetLogoFont(LPCTSTR lpszFontName, int nHeight=24, int nWeight=FW_BOLD, BOOL bItalic=TRUE, BOOL bUnderline=FALSE) | CCJLogoPane | [virtual]
SetLogoText(LPCTSTR lpszLogoText) | CCJLogoPane | [virtual]
~CCJLogoPane() | CCJLogoPane | [virtual]
Generated on Sun Feb 24 01:24:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJMaskEdit Member List

This is the complete list of members for CCJMaskEdit, including all inherited members.
CCJMaskEdit() | CCJMaskEdit |
CheckChar(UINT nChar) | CCJMaskEdit | [virtual]
m_bMaskKeyInProgress | CCJMaskEdit |
m_bUseMask | CCJMaskEdit |
m_Font | CCJMaskEdit |
m_strLiteral | CCJMaskEdit |
m_strMask | CCJMaskEdit |
m_strMaskLiteral | CCJMaskEdit |
m_strValid | CCJMaskEdit |
m_strWindowText | CCJMaskEdit |
OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) | CCJMaskEdit | [protected]
OnEraseBkgnd(CDC *pDC) | CCJMaskEdit | [protected]
OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) | CCJMaskEdit | [protected]
OnPaint() | CCJMaskEdit | [protected]
ProcessMask(UINT nChar, int nEndPos) | CCJMaskEdit | [virtual]
SendChar(UINT nChar) | CCJMaskEdit | [virtual]
SetEditMask(LPCTSTR lpszMask, LPCTSTR lpszLiteral, LPCTSTR lpszWindowText) | CCJMaskEdit | [virtual]
UpdateFont() | CCJMaskEdit | [virtual]
~CCJMaskEdit() | CCJMaskEdit | [virtual]
Generated on Sun Feb 24 01:24:50 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJDateEdit Member List

This is the complete list of members for CCJDateEdit, including all inherited members.
CCJDateEdit() | CCJDateEdit |
CCJMaskEdit() | CCJMaskEdit |
CheckChar(UINT nChar) | CCJMaskEdit | [virtual]
FormatOleDateTime(CString &strData, COleDateTime dt) | CCJDateEdit | [virtual]
GetDateTime() | CCJDateEdit | [virtual]
GetWindowDateTime() | CCJDateEdit | [virtual]
m_bMaskKeyInProgress | CCJMaskEdit |
m_bUseMask | CCJMaskEdit |
m_Font | CCJMaskEdit |
m_strLiteral | CCJMaskEdit |
m_strMask | CCJMaskEdit |
m_strMaskLiteral | CCJMaskEdit |
m_strValid | CCJMaskEdit |
m_strWindowText | CCJMaskEdit |
OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) | CCJMaskEdit | [protected]
OnEraseBkgnd(CDC *pDC) | CCJMaskEdit | [protected]
OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) | CCJMaskEdit | [protected]
OnPaint() | CCJMaskEdit | [protected]
ProcessMask(UINT nChar, int nEndPos) | CCJDateEdit | [virtual]
ReadOleDateTime(LPCTSTR lpszData) | CCJDateEdit | [virtual]
SendChar(UINT nChar) | CCJMaskEdit | [virtual]
SetDateTime(COleDateTime &dt) | CCJDateEdit | [virtual]
SetDateTime(CString strDate) | CCJDateEdit | [virtual]
SetEditMask(LPCTSTR lpszMask, LPCTSTR lpszLiteral, LPCTSTR lpszWindowText) | CCJMaskEdit | [virtual]
UpdateFont() | CCJMaskEdit | [virtual]
~CCJMaskEdit() | CCJMaskEdit | [virtual]
Generated on Sun Feb 24 01:24:32 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJTimeEdit Member List

This is the complete list of members for CCJTimeEdit, including all inherited members.
CCJDateEdit() | CCJDateEdit |
CCJMaskEdit() | CCJMaskEdit |
CCJTimeEdit() | CCJTimeEdit |
CheckChar(UINT nChar) | CCJMaskEdit | [virtual]
FormatOleDateTime(CString &strData, COleDateTime dt) | CCJTimeEdit | [virtual]
GetDateTime() | CCJDateEdit | [virtual]
GetWindowDateTime() | CCJDateEdit | [virtual]
m_bMaskKeyInProgress | CCJMaskEdit |
m_bUseMask | CCJMaskEdit |
m_Font | CCJMaskEdit |
m_strHours | CCJTimeEdit |
m_strLiteral | CCJMaskEdit |
m_strMask | CCJMaskEdit |
m_strMaskLiteral | CCJMaskEdit |
m_strMins | CCJTimeEdit |
m_strValid | CCJMaskEdit |
m_strWindowText | CCJMaskEdit |
OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) | CCJMaskEdit | [protected]
OnEraseBkgnd(CDC *pDC) | CCJMaskEdit | [protected]
OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) | CCJMaskEdit | [protected]
OnPaint() | CCJMaskEdit | [protected]
ProcessMask(UINT nChar, int nEndPos) | CCJTimeEdit | [virtual]
ReadOleDateTime(LPCTSTR lpszData) | CCJDateEdit | [virtual]
SendChar(UINT nChar) | CCJMaskEdit | [virtual]
SetDateTime(COleDateTime &dt) | CCJDateEdit | [virtual]
SetDateTime(CString strDate) | CCJDateEdit | [virtual]
SetEditMask(LPCTSTR lpszMask, LPCTSTR lpszLiteral, LPCTSTR lpszWindowText) | CCJMaskEdit | [virtual]
SetHours(int nHours) | CCJTimeEdit | [virtual]
SetMins(int nMins) | CCJTimeEdit | [virtual]
UpdateFont() | CCJMaskEdit | [virtual]
~CCJMaskEdit() | CCJMaskEdit | [virtual]
Generated on Sun Feb 24 01:25:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJMDIChildWnd Member List

This is the complete list of members for CCJMDIChildWnd, including all inherited members.
brdrAllRaised enum value | CCJMDIChildWnd | [protected]
brdrFlatAll enum value | CCJMDIChildWnd | [protected]
brdrFlatBottom enum value | CCJMDIChildWnd | [protected]
brdrFlatHorizontal enum value | CCJMDIChildWnd | [protected]
brdrFlatLeft enum value | CCJMDIChildWnd | [protected]
brdrFlatRight enum value | CCJMDIChildWnd | [protected]
brdrFlatTop enum value | CCJMDIChildWnd | [protected]
brdrFlatVertical enum value | CCJMDIChildWnd | [protected]
CCJMDIChildWnd() | CCJMDIChildWnd |
DockControlBarLeftOf(CControlBar *Bar, CControlBar *LeftOf) | CCJMDIChildWnd | [protected, virtual]
DockFlatBorders enum name | CCJMDIChildWnd | [protected]
DockSizeBar(CControlBar *pBar, CCJSizeDockBar *pDockBar=NULL, LPRECT lpRect=NULL) | CCJMDIChildWnd | [protected, virtual]
dwDockBarMap | CCJMDIChildWnd | [protected, static]
EnableDocking(DWORD dwDockStyle) | CCJMDIChildWnd | [protected, virtual]
EnableDockingSizeBar(DWORD dwDockStyle, DockFlatBorders FlatFlags=brdrAllRaised) | CCJMDIChildWnd | [protected, virtual]
GetInitializedMenu(UINT nMenuID, UINT nToolBarID) | CCJMDIChildWnd | [virtual]
GetInitializedMenu(UINT nMenuID, UINT *nToolbarIDs, int nSize) | CCJMDIChildWnd | [virtual]
GetMenuID() | CCJMDIChildWnd | [virtual]
GetToolBarID() | CCJMDIChildWnd | [virtual]
GetToolBarIDs(int &nCount) | CCJMDIChildWnd | [virtual]
m_hMenu | CCJMDIChildWnd | [protected]
m_nCount | CCJMDIChildWnd | [protected]
m_nMenuID | CCJMDIChildWnd | [protected]
m_nToolBarID | CCJMDIChildWnd | [protected]
m_nToolBarIDs | CCJMDIChildWnd | [protected]
OnEraseBkgnd(CDC *pDC) | CCJMDIChildWnd | [protected]
RecalcAllExcept(CCJSizeDockBar *pBar) | CCJMDIChildWnd | [protected, virtual]
RecalcLayout(BOOL bNotify=TRUE) | CCJMDIChildWnd | [virtual]
SetResourceIDs(UINT nMenuID, UINT nToolBarID) | CCJMDIChildWnd | [virtual]
SetResourceIDs(UINT nMenuID, UINT *nToolBarIDs, int nCount) | CCJMDIChildWnd | [virtual]
~CCJMDIChildWnd() | CCJMDIChildWnd | [virtual]
Generated on Sun Feb 24 01:24:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJMDIFrameWnd Member List

This is the complete list of members for CCJMDIFrameWnd, including all inherited members.
brdrAllRaised enum value | CCJMDIFrameWnd | [protected]
brdrFlatAll enum value | CCJMDIFrameWnd | [protected]
brdrFlatBottom enum value | CCJMDIFrameWnd | [protected]
brdrFlatHorizontal enum value | CCJMDIFrameWnd | [protected]
brdrFlatLeft enum value | CCJMDIFrameWnd | [protected]
brdrFlatRight enum value | CCJMDIFrameWnd | [protected]
brdrFlatTop enum value | CCJMDIFrameWnd | [protected]
brdrFlatVertical enum value | CCJMDIFrameWnd | [protected]
CCJMDIFrameWnd() | CCJMDIFrameWnd |
DockControlBarLeftOf(CControlBar *Bar, CControlBar *LeftOf) | CCJMDIFrameWnd | [virtual]
DockFlatBorders enum name | CCJMDIFrameWnd | [protected]
DockSizeBar(CControlBar *pBar, CCJSizeDockBar *pDockBar=NULL, LPRECT lpRect=NULL) | CCJMDIFrameWnd | [virtual]
dwDockBarMap | CCJMDIFrameWnd | [protected, static]
EnableDocking(DWORD dwDockStyle) | CCJMDIFrameWnd | [virtual]
EnableDockingSizeBar(DWORD dwDockStyle, DockFlatBorders FlatFlags=brdrAllRaised) | CCJMDIFrameWnd | [virtual]
InitializeMenu(CMultiDocTemplate *pDocTemplate, UINT nMenuID, UINT *nToolbarIDs=NULL, int nSize=0, UINT nDefaultMenuID=NULL) | CCJMDIFrameWnd | [virtual]
InitializeMenu(CMultiDocTemplate *pDocTemplate, UINT nMenuID, UINT nToolbarID=NULL, UINT nDefaultMenuID=NULL) | CCJMDIFrameWnd | [virtual]
InitializeMenu(HMENU *phMenu, UINT nMenuID, UINT nToolbarID=NULL) | CCJMDIFrameWnd | [virtual]
InitializeMenu(HMENU *phMenu, UINT nMenuID, UINT *nToolbarIDs=NULL, int nSize=NULL) | CCJMDIFrameWnd | [virtual]
LoadBarState(LPCTSTR lpszProfileName) | CCJMDIFrameWnd | [virtual]
m_menuList | CCJMDIFrameWnd | [protected]
m_wndMenuBar | CCJMDIFrameWnd | [protected]
NewMenu(UINT nMenuID, UINT *nToolbarIDs=NULL, int nSize=0) | CCJMDIFrameWnd | [protected, virtual]
NewMenu(UINT nMenuID, UINT nToolbarID=NULL) | CCJMDIFrameWnd | [protected, virtual]
OnClose() | CCJMDIFrameWnd | [protected]
OnInitMenuPopup(CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu) | CCJMDIFrameWnd | [protected]
OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct) | CCJMDIFrameWnd | [protected]
OnMenuChar(UINT nChar, UINT nFlags, CMenu *pMenu) | CCJMDIFrameWnd | [protected]
PreCreateWindow(CREATESTRUCT &cs) | CCJMDIFrameWnd | [protected, virtual]
PreCreateWindow(CREATESTRUCT &cs, UINT nIconID) | CCJMDIFrameWnd | [protected, virtual]
RecalcAllExcept(CCJSizeDockBar *pBar) | CCJMDIFrameWnd | [virtual]
RecalcLayout(BOOL bNotify=TRUE) | CCJMDIFrameWnd | [virtual]
SaveBarState(LPCTSTR lpszProfileName) const | CCJMDIFrameWnd | [virtual]
~CCJMDIFrameWnd() | CCJMDIFrameWnd | [virtual]
Generated on Sun Feb 24 01:24:52 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJMemFile Member List

This is the complete list of members for CCJMemFile, including all inherited members.
Append(CFile *fApp) | CCJMemFile | [protected, virtual]
CCJMemFile(UINT nGrowBytes=1024) | CCJMemFile |
CCJMemFile(BYTE *lpBuffer, UINT nBufferSize, UINT nGrowBytes=0) | CCJMemFile |
CCJMemFile(LPCTSTR lpstFilename, UINT uiOpenFlags) | CCJMemFile |
Close() | CCJMemFile | [virtual]
Discard() | CCJMemFile | [virtual]
Duplicate(CFile *fDuplicate) | CCJMemFile | [virtual]
Duplicate(CString strDup) | CCJMemFile | [virtual]
Extract(CFile *fDest, DWORD dwStartPos, DWORD dwBytes) | CCJMemFile | [virtual]
Extract(CString strDest, DWORD dwStartPos, DWORD dwBytes) | CCJMemFile | [virtual]
FindData(void *pData, DWORD dwDataLen, LONG lStartPos) | CCJMemFile |
Flush() | CCJMemFile | [virtual]
Import(CFile *fImp) | CCJMemFile | [protected, virtual]
Insert(CFile *fSrc, DWORD dwSourcePos, DWORD dwDestPos, DWORD dwBytes) | CCJMemFile | [virtual]
Insert(CString strSrc, DWORD dwSourcePos, DWORD dwDestPos, DWORD dwBytes) | CCJMemFile | [virtual]
Load() | CCJMemFile | [protected, virtual]
m_bOpen | CCJMemFile | [private]
m_File | CCJMemFile | [private]
m_pError | CCJMemFile | [private]
m_uiOpenFlags | CCJMemFile | [private]
Open(CString strFilename, UINT uiOpenFlags, CFileException *pError=NULL) | CCJMemFile | [virtual]
operator+=(CFile *fApp) | CCJMemFile |
operator+=(CString strApp) | CCJMemFile |
operator=(CFile *fDup) | CCJMemFile |
operator=(CString strDup) | CCJMemFile |
operator=(DWORD dwFilePos) | CCJMemFile |
operator[](DWORD dwFilePos) | CCJMemFile |
ReadString(CString &rString) | CCJMemFile | [virtual]
Save() | CCJMemFile | [protected, virtual]
WriteString(LPCTSTR lpsz) | CCJMemFile | [virtual]
~CCJMemFile() | CCJMemFile | [virtual]
Generated on Sun Feb 24 01:24:53 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJMenuData Member List

This is the complete list of members for CCJMenuData, including all inherited members.
bitmap | CCJMenuData |
CCJMenuData() | CCJMenuData | [inline]
GetString(void) | CCJMenuData |
GetWideString(void) | CCJMenuData | [inline]
m_szMenuText | CCJMenuData | [private]
menuIconNormal | CCJMenuData |
nFlags | CCJMenuData |
nID | CCJMenuData |
SetAnsiString(LPCSTR szAnsiString) | CCJMenuData |
SetWideString(const wchar_t *szWideString) | CCJMenuData |
syncflag | CCJMenuData |
xoffset | CCJMenuData |
~CCJMenuData() | CCJMenuData |
Generated on Sun Feb 24 01:24:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CMenuItemInfo Member List

This is the complete list of members for CMenuItemInfo, including all inherited members.
CMenuItemInfo() CMenuItemInfo [inline]
Generated on Sun Feb 24 01:26:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJMenu Member List

This is the complete list of members for CCJMenu, including all inherited members.
AddBitmapToImageList(CImageList *list, UINT nResourceID) | CCJMenu |
AddFromToolBar(CToolBar *pToolBar, int nResourceID) | CCJMenu |
AppendMenuA(UINT nFlags, UINT nIDNewItem=0, LPCTSTR lpszNewItem=NULL) | CCJMenu | [inline]
AppendMenuA(UINT nFlags, UINT nIDNewItem, const CBitmap *pBmp) | CCJMenu | [inline]
AppendMenuA(UINT nFlags, UINT nIDNewItem, const char *lpszNewItem, int nIconNormal=-1) | CCJMenu |
AppendMenuA(UINT nFlags, UINT nIDNewItem, const char *lpszNewItem, CImageList *il, int xoffset) | CCJMenu |
AppendMenuA(UINT nFlags, UINT nIDNewItem, const char *lpszNewItem, CBitmap *bmp) | CCJMenu |
AppendMenuW(UINT nFlags, UINT nIDNewItem, wchar_t *lpszNewItem, int nIconNormal=-1) | CCJMenu |
AppendMenuW(UINT nFlags, UINT nIDNewItem, wchar_t *lpszNewItem, CImageList *il, int xoffset) | CCJMenu |
AppendMenuW(UINT nFlags, UINT nIDNewItem, wchar_t *lpszNewItem, CBitmap *bmp) | CCJMenu |
AppendODMenuA(LPCSTR lpstrText, UINT nFlags=MF_OWNERDRAW, UINT nID=0, int nIconNormal=-1) | CCJMenu |
AppendODMenuA(LPCSTR lpstrText, UINT nFlags, UINT nID, CImageList *il, int xoffset) | CCJMenu |
AppendODMenuW(wchar_t *lpstrText, UINT nFlags=MF_OWNERDRAW, UINT nID=0, int nIconNormal=-1) | CCJMenu |
AppendODMenuW(wchar_t *lpstrText, UINT nFlags, UINT nID, CImageList *il, int xoffset) | CCJMenu |
AppendODPopupMenuA(LPCSTR lpstrText) | CCJMenu |
AppendODPopupMenuW(wchar_t *lpstrText) | CCJMenu |
CCJMenu() | CCJMenu |
checkmaps | CCJMenu |
checkmapsshare | CCJMenu |
DeleteMenu(UINT uiId, UINT nFlags) | CCJMenu |
DeleteMenuList(void) | CCJMenu |
DestroyMenu() | CCJMenu | [virtual]
disable_old_style | CCJMenu | [protected]
DitherBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HBITMAP hbm, int nXSrc, int nYSrc) | CCJMenu |
DitherBlt2(CDC *drawdc, int nXDest, int nYDest, int nWidth, int nHeight, CBitmap &bmp, int nXSrc, int nYSrc) | CCJMenu |
Draw3DCheckmark(CDC *dc, const CRect &rc, BOOL bSelected, HBITMAP hbmCheck) | CCJMenu |
DrawCheckMark(CDC *pDC, int x, int y, COLORREF color) | CCJMenu |
DrawItem(LPDRAWITEMSTRUCT) | CCJMenu | [virtual]
DrawRadioDot(CDC *pDC, int x, int y, COLORREF color) | CCJMenu |
FindKeyboardShortcut(UINT nChar, UINT nFlags, CMenu *pMenu) | CCJMenu | [static]
FindMenuList(UINT nID) | CCJMenu |
FindMenuOption(int nId, int &nLoc) | CCJMenu |
FindMenuOption(wchar_t *lpstrText) | CCJMenu |
GetBitmapFromImageList(CDC *pDC, CImageList *imglist, int nIndex, CBitmap &bmp) | CCJMenu |
GetDisableOldStyle(void) | CCJMenu |
GetMenuText(UINT id, CString &string, UINT nFlags=MF_BYPOSITION) | CCJMenu |
InitializeMenuList(int value) | CCJMenu |
InsertMenuA(UINT nPosition, UINT nFlags, UINT nIDNewItem, const char *lpszNewItem, int nIconNormal=-1) | CCJMenu |
InsertMenuA(UINT nPosition, UINT nFlags, UINT nIDNewItem, const char *lpszNewItem, CImageList *il, int xoffset) | CCJMenu |
InsertMenuA(UINT nPosition, UINT nFlags, UINT nIDNewItem, const char *lpszNewItem, CBitmap *bmp) | CCJMenu |
InsertMenuW(UINT nPosition, UINT nFlags, UINT nIDNewItem, wchar_t *lpszNewItem, int nIconNormal=-1) | CCJMenu |
InsertMenuW(UINT nPosition, UINT nFlags, UINT nIDNewItem, wchar_t *lpszNewItem, CImageList *il, int xoffset) | CCJMenu |
InsertMenuW(UINT nPosition, UINT nFlags, UINT nIDNewItem, wchar_t *lpszNewItem, CBitmap *bmp) | CCJMenu |
InsertODMenuA(UINT nPosition, LPCSTR lpstrText, UINT nFlags=MF_OWNERDRAW, UINT nID=0, int nIconNormal=-1) | CCJMenu |
InsertODMenuA(UINT nPosition, LPCSTR lpstrText, UINT nFlags, UINT nID, CImageList *il, int xoffset) | CCJMenu |
InsertODMenuW(UINT nPosition, wchar_t *lpstrText, UINT nFlags=MF_OWNERDRAW, UINT nID=0, int nIconNormal=-1) | CCJMenu |
InsertODMenuW(UINT nPosition, wchar_t *lpstrText, UINT nFlags, UINT nID, CImageList *il, int xoffset) | CCJMenu |
InsertSpaces(void) | CCJMenu |
IsMenu(CMenu *submenu) | CCJMenu | [static]
IsMenu(HMENU submenu) | CCJMenu | [static]
IsNewShell(void) | CCJMenu | [static]
LoadCheckmarkBitmap(int unselect, int select) | CCJMenu |
LoadFromToolBar(UINT nID, UINT nToolBar, int &xoffset) | CCJMenu |
LoadMenu(LPCTSTR lpszResourceName) | CCJMenu | [virtual]
LoadMenu(int nResource) | CCJMenu | [virtual]
LoadSysColorBitmap(int nResourceId) | CCJMenu | [static]
LoadToolbar(UINT nToolBar) | CCJMenu |
LoadToolbars(const UINT *arID, int n) | CCJMenu |
m_AllSubMenus | CCJMenu | [protected, static]
m_bitmapBackground | CCJMenu | [protected]
m_bitmapBackgroundFlag | CCJMenu | [protected]
m_iconX | CCJMenu | [protected]
m_iconY | CCJMenu | [protected]
m_MenuList | CCJMenu | [protected]
m_selectcheck | CCJMenu |
m_SubMenus | CCJMenu | [protected]
m_unselectcheck | CCJMenu |
MeasureItem(LPMEASUREITEMSTRUCT) | CCJMenu | [virtual]
ModifyODMenuA(const char *lpstrText, UINT nID=0, int nIconNormal=-1) | CCJMenu |
ModifyODMenuA(const char *lpstrText, UINT nID, CImageList *il, int xoffset) | CCJMenu |
ModifyODMenuA(const char *lpstrText, UINT nID, CBitmap *bmp) | CCJMenu |
ModifyODMenuA(const char *lpstrText, const char *OptionText, int nIconNormal) | CCJMenu |
ModifyODMenuW(wchar_t *lpstrText, UINT nID=0, int nIconNormal=-1) | CCJMenu |
ModifyODMenuW(wchar_t *lpstrText, UINT nID, CImageList *il, int xoffset) | CCJMenu |
ModifyODMenuW(wchar_t *lpstrText, UINT nID, CBitmap *bmp) | CCJMenu |
ModifyODMenuW(wchar_t *lpstrText, wchar_t *OptionText, int nIconNormal) | CCJMenu |
NewODMenu(UINT pos, UINT nFlags, UINT nID, CString string) | CCJMenu |
RemoveMenu(UINT uiId, UINT nFlags) | CCJMenu |
SetBitmapBackground(COLORREF color) | CCJMenu |
SetDisableOldStyle(void) | CCJMenu |
SetIconSize(int, int) | CCJMenu |
SynchronizeMenu(void) | CCJMenu |
UnSetBitmapBackground(void) | CCJMenu |
UnSetDisableOldStyle(void) | CCJMenu |
UpdateMenu(CMenu *pmenu) | CCJMenu | [static]
~CCJMenu() | CCJMenu | [virtual]
Generated on Sun Feb 24 01:24:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJMenuBarFrameHook Member List

This is the complete list of members for CCJMenuBarFrameHook, including all inherited members.
CCJMenuBar class | CCJMenuBarFrameHook | [friend]
CCJMenuBarFrameHook() | CCJMenuBarFrameHook | [protected]
CSubclassWnd() | CSubclassWnd |
CSubclassWndMap class | CSubclassWnd | [friend]
DECLARE_DYNAMIC(CSubclassWnd) | CSubclassWnd |
Default() | CSubclassWnd | [protected, virtual]
HookWindow(HWND hwnd) | CSubclassWnd | [virtual]
HookWindow(CWnd *pWnd) | CSubclassWnd | [inline, virtual]
HookWndProc(HWND, UINT, WPARAM, LPARAM) | CSubclassWnd | [friend]
Install(CCJMenuBar *pMenuBar, HWND hWndToHook) | CCJMenuBarFrameHook | [protected]
IsHooked() | CSubclassWnd | [inline, virtual]
m_hWnd | CSubclassWnd | [protected]
m_pMenuBar | CCJMenuBarFrameHook | [protected]
m_pNext | CSubclassWnd | [protected]
m_pOldWndProc | CSubclassWnd | [protected]
WindowProc(UINT msg, WPARAM wp, LPARAM lp) | CCJMenuBarFrameHook | [protected, virtual]
~CCJMenuBarFrameHook() | CCJMenuBarFrameHook | [protected]
~CSubclassWnd() | CSubclassWnd |
Generated on Sun Feb 24 01:24:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJMenuBar Member List

This is the complete list of members for CCJMenuBar, including all inherited members.
AddButtons(int nNumButtons, LPTBBUTTON lpButtons) | CCJToolBar |
AddDropDownButton(UINT nIDButton, UINT nIDMenu, BOOL bArrow=TRUE) | CCJToolBar |
AddReplaceBitmap(HBITMAP hbmImageWell) | CCJToolBar |
AddStrings(LPCTSTR lpszStrings) | CCJToolBar |
AutoSize() | CCJToolBar |
bTRACE | CCJMenuBar | [static]
CalcDynamicLayout(int nLength, DWORD nMode) | CCJToolBar | [virtual]
CalcFixedLayout(BOOL bStretch, BOOL bHorz) | CCJMenuBar | [protected, virtual]
CalcInsideRect(CRect &rect, BOOL bHorz) const | CCJToolBarBase |
CalcLayout(DWORD nMode, int nLength=-1) | CCJToolBar | [protected]
CalcSize(TBBUTTON *pData, int nCount) | CCJToolBar | [protected]
CancelMenuAndTrackNewOne(int iButton) | CCJMenuBar | [protected]
CCJMenuBar() | CCJMenuBar |
CCJMenuBarFrameHook class | CCJMenuBar | [friend]
CCJToolBar() | CCJToolBar |
CCJToolBarBase() | CCJToolBarBase | [protected]
CheckButton(int nID, BOOL bCheck) | CCJToolBar |
CommandToIndex(UINT nIDFind) const | CCJToolBar |
ComputeMenuTrackPoint(const CRect &rcButn, TPMPARAMS &tpm) | CCJMenuBar | [protected]
Create(CWnd *pParentWnd, DWORD dwStyle=WS_CHILD|WS_VISIBLE|CBRS_TOP, UINT nID=AFX_IDW_TOOLBAR) | CCJMenuBar | [virtual]
CreateEx(CWnd *pParentWnd, DWORD dwCtrlStyle=TBSTYLE_FLAT, DWORD dwStyle=WS_CHILD|WS_VISIBLE|CBRS_ALIGN_TOP, CRect rcBorders=CRect(0, 0, 0, 0), UINT nID=AFX_IDW_TOOLBAR) | CCJMenuBar | [virtual]
Customize() | CCJToolBar |
DeleteButton(int nIndex) | CCJToolBar |
DoPaint(CDC *pDC) | CCJToolBarBase | [virtual]
DrawBorders(CDC *pDC, CRect &rect) | CCJToolBarBase |
DrawGripper(CDC *pDC, const CRect &rect) | CCJToolBarBase |
EnableButton(int nID, BOOL bEnable) | CCJToolBar |
EraseNonClient() | CCJToolBarBase |
FindDropDownButton(UINT nID) | CCJToolBar |
GetBitmap(UINT nIdButton) const | CCJToolBar |
GetBitmapFlags() const | CCJToolBar |
GetBorders() const | CCJToolBarBase | [protected]
GetButton(int nIndex, TBBUTTON *pButton) const | CCJToolBar |
GetButtonCount() const | CCJToolBar |
GetButtonInfo(int nIndex, UINT &nID, UINT &nStyle, int &iImage) const | CCJToolBar |
GetButtonSize(TBBUTTON *pData, int iButton) | CCJToolBar | [virtual]
GetButtonStyle(int nIndex) const | CCJToolBar |
GetButtonText(int nIndex) const | CCJToolBar |
GetButtonText(int nIndex, CString &rString) const | CCJToolBar |
GetHotItem() const | CCJToolBar |
GetImageList() const | CCJToolBar |
GetItemID(int nIndex) const | CCJToolBar |
GetItemRect(int nIndex, LPRECT lpRect) const | CCJToolBar | [virtual]
GetMenu() | CCJMenuBar |
GetNextOrPrevButton(int iButton, BOOL bPrev) | CCJMenuBar | [protected]
GetPadding() const | CCJToolBar |
GetRect(UINT nIdButton, RECT &rc) const | CCJToolBar |
GetRows() const | CCJToolBar |
GetState(int nID) const | CCJToolBar |
GetToolBarCtrl() const | CCJToolBar |
GetToolbarStyle() const | CCJToolBar |
GetToolTips() const | CCJToolBar |
GetTrackingState(int &iPopup) | CCJMenuBar |
HideButton(int nID, BOOL bHide) | CCJToolBar |
HitTest(CPoint p) const | CCJMenuBar | [protected]
Indeterminate(int nID, BOOL bIndeterminate) | CCJToolBar |
InsertButton(int nIndex, LPTBBUTTON lpButton) | CCJToolBar |
InsertControl(CRuntimeClass *pClass, LPCTSTR lpszWindowName, CRect &rect, UINT nID, DWORD dwStyle) | CCJToolBar |
InsertControl(CWnd *pCtrl, CRect &rect, UINT nID) | CCJToolBar |
InvalidateOldPos(const CRect &rcInvalid) | CCJToolBar | [virtual]
IsButtonChecked(int nID) const | CCJToolBar |
IsButtonEnabled(int nID) const | CCJToolBar |
IsButtonHidden(int nID) const | CCJToolBar |
IsButtonIndeterminate(int nID) const | CCJToolBar |
IsButtonPressed(int nID) const | CCJToolBar |
IsValidButton(int iButton) const | CCJMenuBar | [protected]
Layout() | CCJToolBar | [protected]
LoadBitmap(LPCTSTR lpszResourceName) | CCJToolBar |
LoadBitmap(UINT nIDResource) | CCJToolBar |
LoadMenu(UINT nID) | CCJMenuBar |
LoadToolBar(LPCTSTR lpszResourceName, TOOLBARINFO *pBarInfo=NULL) | CCJToolBar |
LoadToolBar(UINT nIDResource, TOOLBARINFO *pBarInfo=NULL) | CCJToolBar |
m_arStrings | CCJMenuBar | [protected]
m_bAutoRemoveFrameMenu | CCJMenuBar |
m_bDelayedButtonLayout | CCJToolBar | [protected]
m_bEscapeWasPressed | CCJMenuBar | [protected]
m_bExStyle | CCJToolBarBase |
m_bInReBar | CCJToolBarBase |
m_bProcessLeftArrow | CCJMenuBar | [protected]
m_bProcessRightArrow | CCJMenuBar | [protected]
m_bShowDropArrow | CCJToolBar | [protected]
m_Font | CCJMenuBar | [protected]
m_frameHook | CCJMenuBar | [protected]
m_hbmImageWell | CCJToolBar | [protected]
m_hInstImageWell | CCJToolBar | [protected]
m_hKeyRoot | CCJToolBar | [protected]
m_hMenuTracking | CCJMenuBar | [protected]
m_hRsrcImageWell | CCJToolBar | [protected]
m_iNewPopup | CCJMenuBar | [protected]
m_iPopupTracking | CCJMenuBar | [protected]
m_iTrackingState | CCJMenuBar | [protected]
m_nBarNumber | CCJToolBar | [protected, static]
m_nButtons | CCJToolBar | [protected]
m_nMenuID | CCJMenuBar | [protected]
m_pBarInfo | CCJToolBar | [protected]
m_pControls | CCJToolBar | [protected]
m_pDropButtons | CCJToolBar | [protected]
m_popupMenu | CCJMenuBar | [protected]
m_pStringMap | CCJToolBar | [protected]
m_ptMouse | CCJMenuBar | [protected]
m_rcOldPos | CCJToolBar | [protected]
m_sizeButton | CCJToolBar | [protected]
m_sizeImage | CCJToolBar | [protected]
m_strSubKey | CCJToolBar | [protected]
m_strValueName | CCJToolBar | [protected]
MapAccelerator(TCHAR ch, UINT &nID) const | CCJToolBar |
MenuInputFilter(int code, WPARAM wp, LPARAM lp) | CCJMenuBar | [protected, static]
OnBarStyleChange(DWORD dwOldStyle, DWORD dwNewStyle) | CCJMenuBar | [protected, virtual]
OnDestroy() | CCJToolBar | [protected]
OnDropDownButton(const NMTOOLBAR &nmtb, UINT nID, CRect rc) | CCJToolBar | [virtual]
OnEraseBkgnd(CDC *pDC) | CCJToolBar | [protected]
OnLButtonDown(UINT nFlags, CPoint point) | CCJMenuBar | [protected]
OnMenuInput(MSG &m) | CCJMenuBar | [protected, virtual]
OnMenuSelect(HMENU hmenu, UINT nItemID) | CCJMenuBar | [protected]
OnMouseMove(UINT nFlags, CPoint point) | CCJMenuBar | [protected]
OnNcCalcSize(BOOL, NCCALCSIZE_PARAMS *) | CCJToolBar | [protected]
OnNcCreate(LPCREATESTRUCT) | CCJToolBar | [protected]
OnNcHitTest(CPoint) | CCJToolBar | [protected]
OnNcPaint() | CCJToolBar | [protected]
OnPaint() | CCJToolBar | [protected]
OnPreserveZeroBorderHelper(WPARAM, LPARAM) | CCJToolBar | [protected]
OnRButtonDown(UINT nFlags, CPoint point) | CCJToolBar | [protected]
OnSetBitmapSize(WPARAM, LPARAM) | CCJToolBar | [protected]
OnSetButtonSize(WPARAM, LPARAM) | CCJToolBar | [protected]
OnSetSizeHelper(CSize &size, LPARAM lParam) | CCJToolBar | [protected]
OnSize(UINT nType, int cx, int cy) | CCJMenuBar | [protected]
OnSysColorChange() | CCJToolBar | [protected]
OnToolBarBeginAdjust(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarBeginDrag(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarBtnDropDown(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarChange(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarCustomHelp(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarEndAdjust(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarEndDrag(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarGetButtonInfo(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarQueryDelete(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarQueryInsert(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarReset(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolHitTest(CPoint point, TOOLINFO *pTI) const | CCJToolBar | [virtual]
OnUpdateCmdUI(CFrameWnd *pTarget, BOOL bDisableIfNoHndler) | CCJToolBar | [virtual]
OnUpdateMenuButton(CCmdUI *pCmdUI) | CCJMenuBar | [protected]
OnWindowPosChanged(WINDOWPOS *lpwndpos) | CCJToolBar | [protected]
OnWindowPosChanging(LPWINDOWPOS) | CCJToolBar | [protected]
PreCreateWindow(CREATESTRUCT &cs) | CCJToolBar | [virtual]
PressButton(int nID, BOOL bPress) | CCJToolBar |
RecomputeMenuLayout() | CCJMenuBar | [protected]
RecomputeToolbarSize() | CCJMenuBar | [protected]
RestoreState() | CCJToolBar |
SaveState() | CCJToolBar |
SendMessageC(UINT m, WPARAM wp=0, LPARAM lp=0) const | CCJToolBar |
SetBitmap(HBITMAP hbmImageWell) | CCJToolBar |
SetBitmapSize(CSize sz) | CCJToolBar |
SetBorders(LPCRECT lpRect) | CCJToolBarBase | [protected]
SetBorders(int cxLeft=0, int cyTop=0, int cxRight=0, int cyBottom=0) | CCJToolBarBase | [protected]
SetButton(int nIndex, TBBUTTON *pButton) | CCJToolBar |
SetButtonInfo(int nIndex, UINT nID, UINT nStyle, int iImage) | CCJToolBar |
SetButtons(const UINT *lpIDArray, int nIDCount) | CCJToolBar |
SetButtonSize(CSize sz) | CCJToolBar |
SetButtonStructSize(int nSize) | CCJToolBar |
SetButtonStyle(int nIndex, UINT nStyle) | CCJToolBar |
SetButtonText(int nIndex, LPCTSTR lpszText) | CCJToolBar |
SetCmdID(int nIndex, UINT nID) | CCJToolBar |
SetExtendedStyle(DWORD dwStyle) | CCJToolBar |
SetHeight(int cyHeight) | CCJToolBar |
SetHotItem(int iHot) | CCJToolBar |
SetImageList(HIMAGELIST hImgList) | CCJToolBar |
SetIndent(int indent) | CCJToolBar |
SetOwner(CWnd *pOwnerWnd) | CCJToolBar |
SetPadding(CSize sz) | CCJToolBar |
SetRows(int nRows, BOOL bLarger, LPRECT lpRect) | CCJToolBar |
SetSizes(SIZE sizeButton, SIZE sizeImage) | CCJToolBar |
SetState(int nID, UINT nState) | CCJToolBar |
SetToolbarStyle(DWORD dwStyle) | CCJToolBar |
SetToolTips(CToolTipCtrl *pTip) | CCJToolBar |
SetTrackingState(TRACKINGSTATE iState, int iButton=-1) | CCJMenuBar | [protected]
SizeToolBar(TBBUTTON *pData, int nCount, int nLength, BOOL bVert=FALSE) | CCJToolBar | [protected]
ToggleTrackButtonMode() | CCJMenuBar | [protected]
TrackPopup(int iButton) | CCJMenuBar | [protected]
TranslateFrameMessage(MSG *pMsg) | CCJMenuBar | [virtual]
UpdateFont() | CCJMenuBar | [protected]
WindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam) | CCJToolBarBase | [virtual]
WrapToolBar(TBBUTTON *pData, int nCount, int nWidth) | CCJToolBar | [protected]
~CCJMenuBar() | CCJMenuBar | [virtual]
~CCJToolBar() | CCJToolBar | [virtual]
~CCJToolBarBase() | CCJToolBarBase | [virtual]
Generated on Sun Feb 24 01:24:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJMetaFileButton Member List

This is the complete list of members for CCJMetaFileButton, including all inherited members.
CCJMetaFileButton() | CCJMetaFileButton |
DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) | CCJMetaFileButton | [virtual]
m_hEnhMetaFile | CCJMetaFileButton | [private]
m_hEnhMetaFileDisabled | CCJMetaFileButton | [private]
m_hEnhMetaFileFocus | CCJMetaFileButton | [private]
m_hEnhMetaFileSel | CCJMetaFileButton | [private]
OnEraseBkgnd(CDC *pDC) | CCJMetaFileButton | [protected]
OnLButtonDblClk(UINT nFlags, CPoint point) | CCJMetaFileButton | [protected]
OnPaint() | CCJMetaFileButton | [protected]
SetMetaFiles(HENHMETAFILE hMetaFile, HENHMETAFILE hMetaFileSel=NULL, HENHMETAFILE hMetaFileFocus=NULL, HENHMETAFILE hMetaFileDisabled=NULL) | CCJMetaFileButton | [virtual]
~CCJMetaFileButton() | CCJMetaFileButton | [virtual]
Generated on Sun Feb 24 01:24:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJMiniDockFrameWnd Member List

This is the complete list of members for CCJMiniDockFrameWnd, including all inherited members.
CCJMiniDockFrameWnd() | CCJMiniDockFrameWnd |
CDockBar class | CCJMiniDockFrameWnd | [friend]
Create(CWnd *pParent, DWORD dwBarStyle) | CCJMiniDockFrameWnd | [virtual]
OnNcLButtonDblClk(UINT nHitTest, CPoint point) | CCJMiniDockFrameWnd | [protected]
OnNcLButtonDown(UINT nHitTest, CPoint point) | CCJMiniDockFrameWnd | [protected]
~CCJMiniDockFrameWnd() | CCJMiniDockFrameWnd | [virtual]
Generated on Sun Feb 24 01:24:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CContentItems Member List

This is the complete list of members for CContentItems, including all inherited members.
CContentItems(UINT nID, CString str) | CContentItems |
GetImageID() | CContentItems | [virtual]
GetText() | CContentItems | [virtual]
m_csText | CContentItems | [protected]
m_nImageID | CContentItems | [protected]
operator=(CContentItems &pItems) | CContentItems |
Generated on Sun Feb 24 01:25:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJOutlookBar Member List

This is the complete list of members for CCJOutlookBar, including all inherited members.
CCJOutlookBar() | CCJOutlookBar |
DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) | CCJOutlookBar | [virtual]
m_bHilight | CCJOutlookBar | [protected]
m_bLBDown | CCJOutlookBar | [protected]
m_clrDkShad | CCJOutlookBar | [protected]
m_clrHilite | CCJOutlookBar | [protected]
m_clrNormal | CCJOutlookBar | [protected]
m_clrShadow | CCJOutlookBar | [protected]
m_clrTextNm | CCJOutlookBar | [protected]
m_Font | CCJOutlookBar | [protected]
m_nIndex | CCJOutlookBar | [protected]
m_nNumItems | CCJOutlookBar | [protected]
m_pContents | CCJOutlookBar | [protected]
m_pImageListLarge | CCJOutlookBar | [protected]
m_pImageListSmall | CCJOutlookBar | [protected]
m_point | CCJOutlookBar | [protected]
m_pOwner | CCJOutlookBar | [protected]
MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct) | CCJOutlookBar | [virtual]
OnEraseBkgnd(CDC *pDC) | CCJOutlookBar | [protected]
OnLButtonDown(UINT nFlags, CPoint point) | CCJOutlookBar | [protected]
OnLButtonUp(UINT nFlags, CPoint point) | CCJOutlookBar | [protected]
OnMouseMove(UINT nFlags, CPoint point) | CCJOutlookBar | [protected]
OnPaint() | CCJOutlookBar | [protected]
OnSysColorChange() | CCJOutlookBar | [protected]
OnTimer(UINT nIDEvent) | CCJOutlookBar | [protected]
SetImageLists(CImageList *pImageListSmall=NULL, CImageList *pImageListLarge=NULL) | CCJOutlookBar | [virtual]
SetItems(CContentItems *pItems, int nNumItems) | CCJOutlookBar | [virtual]
SetOwner(CWnd *pWnd) | CCJOutlookBar | [virtual]
UpdateFont() | CCJOutlookBar | [virtual]
~CCJOutlookBar() | CCJOutlookBar | [virtual]
Generated on Sun Feb 24 01:25:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJPagerCtrl Member List

This is the complete list of members for CCJPagerCtrl, including all inherited members.
CCJPagerCtrl() | CCJPagerCtrl |
Create(DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID) | CCJPagerCtrl | [virtual]
ForwardMouse(BOOL bForward) | CCJPagerCtrl |
GetBkColor() | CCJPagerCtrl |
GetBorder() | CCJPagerCtrl |
GetButtonSize() | CCJPagerCtrl |
GetButtonState(int iButton) | CCJPagerCtrl |
GetDropTarget(IDropTarget **ppdt) | CCJPagerCtrl |
GetPos() | CCJPagerCtrl |
m_nHeight | CCJPagerCtrl | [protected]
m_nWidth | CCJPagerCtrl | [protected]
OnPagerCalcSize(NMPGCALCSIZE *pNMPGCalcSize, LRESULT *pResult) | CCJPagerCtrl | [protected, virtual]
OnPagerScroll(NMPGSCROLL *pNMPGScroll, LRESULT *pResult) | CCJPagerCtrl | [protected, virtual]
RecalcSize() | CCJPagerCtrl |
SetBkColor(COLORREF clr) | CCJPagerCtrl |
SetBorder(int iBorder) | CCJPagerCtrl |
SetButtonSize(int iSize) | CCJPagerCtrl |
SetChild(HWND hwndChild) | CCJPagerCtrl |
SetPos(int iPos) | CCJPagerCtrl |
SetScrollArea(int nWidth, int nHeight) | CCJPagerCtrl |
~CCJPagerCtrl() | CCJPagerCtrl | [virtual]
Generated on Sun Feb 24 01:25:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJReBar Member List

This is the complete list of members for CCJReBar, including all inherited members.
_AddBar(CWnd *pBar, REBARBANDINFO *pRBBI) | CCJReBar | [protected]
AddBar(CWnd *pBar, LPCTSTR pszText=NULL, CBitmap *pbmp=NULL, DWORD dwStyle=RBBS_GRIPPERALWAYS|RBBS_FIXEDBMP) | CCJReBar |
AddBar(CWnd *pBar, COLORREF clrFore, COLORREF clrBack, LPCTSTR pszText=NULL, DWORD dwStyle=RBBS_GRIPPERALWAYS) | CCJReBar |
CalcDynamicLayout(int nLength, DWORD nMode) | CCJReBar | [virtual]
CalcFixedLayout(BOOL bStretch, BOOL bHorz) | CCJReBar | [virtual]
CalcInsideRect(CRect &rect, BOOL bHorz) const | CCJToolBarBase |
CCJReBar() | CCJReBar |
CCJToolBarBase() | CCJToolBarBase | [protected]
Create(CWnd *pParentWnd, DWORD dwCtrlStyle=RBS_BANDBORDERS, DWORD dwStyle=WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|CBRS_TOP, UINT nID=AFX_IDW_REBAR) | CCJReBar |
DoPaint(CDC *pDC) | CCJToolBarBase | [virtual]
DrawBorders(CDC *pDC, CRect &rect) | CCJToolBarBase |
DrawGripper(CDC *pDC, const CRect &rect) | CCJToolBarBase |
EraseNonClient() | CCJToolBarBase |
GetBorders() const | CCJToolBarBase | [protected]
GetReBarCtrl() const | CCJReBar |
m_bExStyle | CCJToolBarBase |
m_bInReBar | CCJToolBarBase |
OnEraseBkgnd(CDC *pDC) | CCJReBar | [protected]
OnHeightChange(NMHDR *pNMHDR, LRESULT *pResult) | CCJReBar | [protected]
OnNcCalcSize(BOOL, NCCALCSIZE_PARAMS *) | CCJReBar | [protected]
OnNcCreate(LPCREATESTRUCT) | CCJReBar | [protected]
OnNcPaint() | CCJReBar | [protected]
OnPaint() | CCJReBar | [protected]
OnRecalcParent() | CCJReBar | [protected]
OnShowBand(WPARAM wParam, LPARAM lParam) | CCJReBar | [protected]
OnToolHitTest(CPoint point, TOOLINFO *pTI) const | CCJReBar | [virtual]
OnUpdateCmdUI(CFrameWnd *pTarget, BOOL bDisableIfNoHndler) | CCJReBar | [virtual]
OnWindowPosChanging(LPWINDOWPOS lpWndPos) | CCJToolBarBase |
SetBorders(LPCRECT lpRect) | CCJToolBarBase | [protected]
SetBorders(int cxLeft=0, int cyTop=0, int cxRight=0, int cyBottom=0) | CCJToolBarBase | [protected]
WindowProc(UINT message, WPARAM wParam, LPARAM lParam) | CCJReBar | [protected, virtual]
~CCJToolBarBase() | CCJToolBarBase | [virtual]
Generated on Sun Feb 24 01:25:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJReBarCtrl Member List

This is the complete list of members for CCJReBarCtrl, including all inherited members.
BeginDrag(UINT uBand, DWORD dwPos=(DWORD)-1) | CCJReBarCtrl
CCJReBarCtrl() | CCJReBarCtrl
Create(DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID) | CCJReBarCtrl
DeleteBand(UINT uBand) | CCJReBarCtrl
DragMove(DWORD dwPos=(DWORD)-1) | CCJReBarCtrl
EndDrag() | CCJReBarCtrl
GetBandBorders(UINT uBand, LPRECT prc) const | CCJReBarCtrl
GetBandCount() const | CCJReBarCtrl
GetBandInfo(UINT uBand, REBARBANDINFO *prbbi) const | CCJReBarCtrl
GetBarHeight() const | CCJReBarCtrl
GetBarInfo(REBARINFO *prbi) const | CCJReBarCtrl
GetBkColor() const | CCJReBarCtrl
GetColorScheme(COLORSCHEME *lpcs) | CCJReBarCtrl
GetDropTarget() const | CCJReBarCtrl
GetImageList() const | CCJReBarCtrl
GetPalette() const | CCJReBarCtrl
GetRect(UINT uBand, LPRECT prc) const | CCJReBarCtrl
GetRowCount() const | CCJReBarCtrl
GetRowHeight(UINT uRow) const | CCJReBarCtrl
GetTextColor() const | CCJReBarCtrl
GetToolTips() const | CCJReBarCtrl
HitTest(RBHITTESTINFO *prbht) | CCJReBarCtrl
IDToIndex(UINT uBandID) const | CCJReBarCtrl
InsertBand(UINT uIndex, REBARBANDINFO *prbbi) | CCJReBarCtrl
MaximizeBand(UINT uBand) | CCJReBarCtrl
MinimizeBand(UINT uBand) | CCJReBarCtrl
MoveBand(UINT uFrom, UINT uTo) | CCJReBarCtrl
SetBandInfo(UINT uBand, REBARBANDINFO *prbbi) | CCJReBarCtrl
SetBarInfo(REBARINFO *prbi) | CCJReBarCtrl
SetBkColor(COLORREF clr) | CCJReBarCtrl
SetColorScheme(const COLORSCHEME *lpcs) | CCJReBarCtrl
SetImageList(CImageList *pImageList) | CCJReBarCtrl
SetOwner(CWnd *pWnd) | CCJReBarCtrl
SetPalette(HPALETTE hPal) | CCJReBarCtrl
SetTextColor(COLORREF clr) | CCJReBarCtrl
SetToolTips(CToolTipCtrl *pToolTip) | CCJReBarCtrl
ShowBand(UINT uBand, BOOL fShow=TRUE) | CCJReBarCtrl
SizeToRect(CRect &rect) | CCJReBarCtrl
Generated on Sun Feb 24 01:25:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJSizeDockBar Member List

This is the complete list of members for CCJSizeDockBar, including all inherited members.
CalcDynamicLayout(int nLength, DWORD nMode) | CCJSizeDockBar | [virtual]
CalcSizeBarLayout() | CCJSizeDockBar |
CCJSizeDockBar() | CCJSizeDockBar |
DoPaint(CDC *pDC) | CCJSizeDockBar | [virtual]
DrawBorders(CDC *pDC, CRect &rect) | CCJSizeDockBar |
EraseNonClient() | CCJSizeDockBar |
FlatBorder(BOOL bFlat=TRUE) | CCJSizeDockBar |
GetAvailableRect(CRect &rect) | CCJSizeDockBar | [protected]
GetDockedSizeBar(int nPos) | CCJSizeDockBar |
HitTest(const CPoint &point) | CCJSizeDockBar | [virtual]
IsDockBar() const | CCJSizeDockBar | [virtual]
IsDockSizeBar() const | CCJSizeDockBar | [virtual]
IsLastControlBar(int index) | CCJSizeDockBar | [protected]
m_bDragging | CCJSizeDockBar | [protected]
m_bFlatBorder | CCJSizeDockBar | [protected]
m_bIsDockBar | CCJSizeDockBar | [static]
m_bOkToDrag | CCJSizeDockBar | [protected]
m_curHSplitBar | CCJSizeDockBar | [protected]
m_curVSplitBar | CCJSizeDockBar | [protected]
m_iActualSize | CCJSizeDockBar | [protected]
m_iSafeSpace | CCJSizeDockBar | [protected]
m_ptCurDrag | CCJSizeDockBar | [protected]
m_ptCurrent | CCJSizeDockBar | [protected]
m_ptStartDrag | CCJSizeDockBar | [protected]
m_rcTrack | CCJSizeDockBar | [protected]
Maximize(CCJControlBar *) | CCJSizeDockBar |
Normalize(CCJControlBar *) | CCJSizeDockBar |
OnInvertTracker(const CRect &) | CCJSizeDockBar | [virtual]
OnLButtonUp(UINT nFlags, CPoint point) | CCJSizeDockBar | [protected]
OnMouseMove(UINT nFlags, CPoint point) | CCJSizeDockBar | [protected]
OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR *lpncsp) | CCJSizeDockBar | [protected]
OnNcHitTest(CPoint point) | CCJSizeDockBar | [protected]
OnNcLButtonDown(UINT nHitTest, CPoint point) | CCJSizeDockBar | [protected]
OnNcPaint() | CCJSizeDockBar | [protected]
OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) | CCJSizeDockBar | [protected]
RecalcAllExcept(CCJSizeDockBar *pBar) | CCJSizeDockBar |
SetActualSize(int iSize) | CCJSizeDockBar |
~CCJSizeDockBar() | CCJSizeDockBar | [virtual]
Generated on Sun Feb 24 01:25:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJSortClass Member List

This is the complete list of members for CCJSortClass, including all inherited members.
CCJSortClass(CListCtrl *pWnd, const int nCol) | CCJSortClass |
Compare(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort) | CCJSortClass | [protected, static]
m_pWnd | CCJSortClass | [protected]
Sort(bool bAsc, DATA_TYPE eType) | CCJSortClass | [virtual]
~CCJSortClass() | CCJSortClass | [virtual]
Generated on Sun Feb 24 01:25:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJSortClass::CSortItem Member List

This is the complete list of members for CCJSortClass::CSortItem, including all inherited members.
CSortItem(const DWORD dwData, const CString &strItemText) | CCJSortClass::CSortItem
m_dwData | CCJSortClass::CSortItem
m_strItemText | CCJSortClass::CSortItem
Generated on Sun Feb 24 01:25:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJStatusBarPaneControlInfo Member List

This is the complete list of members for CCJStatusBarPaneControlInfo, including all inherited members.
CCJStatusBarPaneControlInfo() | CCJStatusBarPaneControlInfo |
m_bAutodelete | CCJStatusBarPaneControlInfo |
m_nPaneID | CCJStatusBarPaneControlInfo |
m_pWnd | CCJStatusBarPaneControlInfo |
~CCJStatusBarPaneControlInfo() | CCJStatusBarPaneControlInfo | [virtual]
Generated on Sun Feb 24 01:25:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJStatusBarPane Member List

This is the complete list of members for CCJStatusBarPane, including all inherited members.
CCJStatusBarPane() | CCJStatusBarPane |
CCJStatusBarPane(CCJStatusBarPane &rPane) | CCJStatusBarPane |
m_cxText | CCJStatusBarPane |
m_nFlags | CCJStatusBarPane |
m_nID | CCJStatusBarPane |
m_nStyle | CCJStatusBarPane |
m_strText | CCJStatusBarPane |
operator=(CCJStatusBarPane &rPane) | CCJStatusBarPane |
~CCJStatusBarPane() | CCJStatusBarPane | [virtual]
Generated on Sun Feb 24 01:25:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJStatusBar Member List

This is the complete list of members for CCJStatusBar, including all inherited members.
AddControl(CWnd *pWnd, int nPaneID, BOOL bAutodeleteControl=TRUE) | CCJStatusBar | [virtual]
AddIndicator(int position, UINT paneID) | CCJStatusBar | [virtual]
CCJStatusBar() | CCJStatusBar |
GetPanControl(int nPaneID) | CCJStatusBar | [virtual]
GetStatusPane(int nIndex, CCJStatusBarPane &xfxpane) | CCJStatusBar | [virtual]
m_aPans | CCJStatusBar | [private]
OnSize(UINT nType, int cx, int cy) | CCJStatusBar | [protected]
PositionControls() | CCJStatusBar | [virtual]
RemovePane(int nPaneID) | CCJStatusBar | [virtual]
SetPaneWidth(int index, int cxWidth) | CCJStatusBar | [virtual]
~CCJStatusBar() | CCJStatusBar | [virtual]
Generated on Sun Feb 24 01:25:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJTabCtrl Member List

This is the complete list of members for CCJTabCtrl, including all inherited members.
CCJTabCtrl() | CCJTabCtrl |
Create(CWnd *pParentWnd, UINT nID=AFX_IDC_TAB_CONTROL, DWORD dwStyle=WS_VISIBLE|WS_CHILD|TCS_BOTTOM|TCS_TOOLTIPS|WS_CLIPSIBLINGS|WS_CLIPCHILDREN, const CRect &rect=CRect(0, 0, 0, 0)) | CCJTabCtrl | [virtual]
GetMenuID() | CCJTabCtrl | [virtual]
m_Font | CCJTabCtrl |
m_nPos | CCJTabCtrl |
m_popToolbarID | CCJTabCtrl |
m_popupMenu | CCJTabCtrl |
m_popupMenuID | CCJTabCtrl |
OnEraseBkgnd(CDC *pDC) | CCJTabCtrl | [protected]
OnInitMenuPopup(CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu) | CCJTabCtrl | [protected]
OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct) | CCJTabCtrl | [protected]
OnMenuChar(UINT nChar, UINT nFlags, CMenu *pMenu) | CCJTabCtrl | [protected]
OnPaint() | CCJTabCtrl | [protected]
OnRButtonDown(UINT nFlags, CPoint point) | CCJTabCtrl | [protected]
SetMenuID(UINT popupMenuID, UINT popToolbarID=0, int nPos=0) | CCJTabCtrl | [virtual]
UpdateFont() | CCJTabCtrl | [virtual]
~CCJTabCtrl() | CCJTabCtrl | [virtual]
Generated on Sun Feb 24 01:25:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

tagTCB_ITEM Member List

This is the complete list of members for tagTCB_ITEM, including all inherited members.
pWnd | tagTCB_ITEM
szTabLabel | tagTCB_ITEM
szToolTipLabel | tagTCB_ITEM
uiToolTipId | tagTCB_ITEM
Generated on Sun Feb 24 01:27:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJTabCtrlBar Member List

This is the complete list of members for CCJTabCtrlBar, including all inherited members.
AddToolTip(TCB_ITEM *pMember, LPCTSTR lpszLabel) | CCJTabCtrlBar | [protected, virtual]
AddView(LPCTSTR lpszLabel, CRuntimeClass *pViewClass, CDocument *pDoc=NULL, UINT nIndex=-1, CCreateContext *pContext=NULL) | CCJTabCtrlBar | [virtual]
AssociateImageIndexWithRuntimeClass(int nIndex, CRuntimeClass *pRuntimeClass) | CCJTabCtrlBar | [virtual]
AssociateImageIndexWithRuntimeClass(int nIndex, LPCTSTR lpszRuntimeClassName) | CCJTabCtrlBar |
CalcDynamicLayout(int nLength, DWORD nMode) | CCJControlBar | [virtual]
CCJControlBar() | CCJControlBar |
CCJTabCtrlBar() | CCJTabCtrlBar |
Create(CWnd *pParentWnd, UINT nID, LPCTSTR lpszWindowName=NULL, CSize sizeDefault=CSize(200, 100), DWORD dwStyle=CBRS_LEFT, BOOL bFlatBorders=FALSE) | CCJControlBar | [virtual]
CreateTabListItem(LPCTSTR lpszLabel) | CCJTabCtrlBar | [protected, virtual]
CreateTabView(CRuntimeClass *pViewClass, CDocument *pDocument, CCreateContext *pContext) | CCJTabCtrlBar | [protected, virtual]
DeleteView(int nView) | CCJTabCtrlBar | [virtual]
DeleteView(CRuntimeClass *pViewClass) | CCJTabCtrlBar | [virtual]
DrawBorders(CDC *pDC, CRect &rect) | CCJControlBar | [protected, virtual]
DrawGriperCaption(CDC *pDC, LPRECT pRect) | CCJControlBar | [protected, virtual]
DrawGripper(CDC *pDC) | CCJControlBar | [protected, virtual]
EnableDockingOnSizeBar(DWORD dwDockStyle) | CCJControlBar | [virtual]
EnableFlatLook(BOOL bFlat=TRUE) | CCJControlBar | [virtual]
EnableFlatLook(BOOL bGripper, BOOL bBorder, BOOL bButtons) | CCJControlBar | [virtual]
EnableSaveState(bool bAutoSave=true) | CCJControlBar | [virtual]
EnableToolTips(BOOL bEnable) | CCJTabCtrlBar | [protected, virtual]
EraseNonClient() | CCJControlBar | [protected, virtual]
GetActiveView() | CCJTabCtrlBar | [virtual]
GetButtonRect() | CCJControlBar | [protected, virtual]
GetChildRect(CRect &rect) | CCJTabCtrlBar | [virtual]
GetGripperRect() | CCJControlBar | [protected, virtual]
GetHorzSize() | CCJControlBar | [virtual]
GetImageIndexFromRuntimeClass(CRuntimeClass *pRuntimeClass) | CCJTabCtrlBar | [protected, virtual]
GetMenuID() | CCJControlBar | [virtual]
GetMinExt() | CCJControlBar | [virtual]
GetTabFromPoint(CPoint point=CPoint(0, 0)) | CCJTabCtrlBar | [virtual]
GetToolTip() | CCJTabCtrlBar | [protected, virtual]
GetVertSize() | CCJControlBar | [virtual]
GetView(int nView) | CCJTabCtrlBar | [virtual]
GetView(CRuntimeClass *pViewClass) | CCJTabCtrlBar | [virtual]
GetViewName(int nView) | CCJTabCtrlBar | [virtual]
GetViewName(CRuntimeClass *pViewClass) | CCJTabCtrlBar | [virtual]
HitTest(CPoint &point) | CCJControlBar | [protected, virtual]
IsBottomDocked() const | CCJControlBar | [virtual]
IsFloating() const | CCJControlBar | [virtual]
IsHorzDocked() const | CCJControlBar | [virtual]
IsLeftDocked() const | CCJControlBar | [virtual]
IsRightDocked() const | CCJControlBar | [virtual]
IsTopDocked() const | CCJControlBar | [virtual]
IsVertDocked() const | CCJControlBar | [virtual]
LoadBarState(CSize &size, int nID) | CCJControlBar | [protected, virtual]
m_bAutoSave | CCJControlBar | [protected]
m_bButtons | CCJControlBar | [protected]
m_bDragging | CCJControlBar | [protected]
m_bFlatBorder | CCJControlBar | [protected]
m_bFlatGripper | CCJControlBar | [protected]
m_bFloating | CCJControlBar | [protected]
m_bGripper | CCJControlBar | [protected]
m_bMaximized | CCJControlBar | [protected]
m_bOkToDrag | CCJControlBar | [protected]
m_btnClose | CCJControlBar | [protected]
m_btnMinim | CCJControlBar | [protected]
m_bToFit | CCJControlBar |
m_bToolTipsEnabled | CCJTabCtrlBar | [protected]
m_bUnique | CCJControlBar |
m_ClassNameToImageIndexMap | CCJTabCtrlBar | [protected]
m_cxOffset | CCJControlBar | [protected]
m_cyOffset | CCJControlBar | [protected]
m_eAuxIndex | CCJControlBar | [protected]
m_eChildBorder | CCJControlBar |
m_hAuxIcon | CCJControlBar | [protected]
m_hIcon | CCJControlBar | [protected]
m_ImageList | CCJControlBar | [protected]
m_nActiveTab | CCJTabCtrlBar | [protected]
m_nID | CCJControlBar | [protected]
m_nNextToolTipId | CCJTabCtrlBar | [protected]
m_nPointTab | CCJTabCtrlBar | [protected]
m_nPos | CCJControlBar | [protected]
m_pActiveView | CCJTabCtrlBar | [protected]
m_pChildWnd | CCJControlBar | [protected]
m_popToolbarID | CCJControlBar | [protected]
m_popupMenu | CCJControlBar | [protected]
m_popupMenuID | CCJControlBar | [protected]
m_ptCurDrag | CCJControlBar | [protected]
m_ptStartDrag | CCJControlBar | [protected]
m_rcTrack | CCJControlBar | [protected]
m_sizeDesired | CCJControlBar | [protected]
m_sizeFloat | CCJControlBar | [protected]
m_sizeHorz | CCJControlBar | [protected]
m_sizeNormal | CCJControlBar | [protected]
m_sizeVert | CCJControlBar | [protected]
m_strSection | CCJControlBar | [protected]
m_TabCtrl | CCJTabCtrlBar | [protected]
m_ToolTip | CCJControlBar | [protected]
m_viewList | CCJTabCtrlBar | [protected]
Maximize(int size) | CCJControlBar | [virtual]
Minimize() | CCJControlBar | [virtual]
ModifyTabStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags=0) | CCJTabCtrlBar | [virtual]
Normalize() | CCJControlBar | [virtual]
OnButtonClose() | CCJControlBar | [protected]
OnButtonMinimize() | CCJControlBar | [protected]
OnCreate(LPCREATESTRUCT lpCreateStruct) | CCJTabCtrlBar | [protected]
OnEraseBkgnd(CDC *pDC) | CCJControlBar | [protected]
OnInitMenuPopup(CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu) | CCJControlBar | [protected]
OnInvertTracker(const CRect &rect) | CCJControlBar | [protected, virtual]
OnLButtonDown(UINT nFlags, CPoint point) | CCJControlBar | [protected]
OnLButtonUp(UINT nFlags, CPoint point) | CCJControlBar | [protected]
OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct) | CCJControlBar | [protected]
OnMenuChar(UINT nChar, UINT nFlags, CMenu *pMenu) | CCJControlBar | [protected]
OnMouseMove(UINT nFlags, CPoint point) | CCJControlBar | [protected]
OnNcHitTest(CPoint point) | CCJControlBar | [protected]
OnNcPaint() | CCJControlBar | [protected]
OnPaint() | CCJControlBar | [protected]
OnRButtonDown(UINT nFlags, CPoint point) | CCJControlBar | [protected]
OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) | CCJControlBar | [protected]
OnTabSelChange(NMHDR *pNMHDR, LRESULT *pResult) | CCJTabCtrlBar | [protected]
OnUpdateButtonClose(CCmdUI *pCmdUI) | CCJControlBar | [protected]
OnUpdateButtonMinimize(CCmdUI *pCmdUI) | CCJControlBar | [protected]
OnUpdateCmdUI(CFrameWnd *pTarget, BOOL bDisableIfNoHndler) | CCJControlBar | [virtual]
OnWindowPosChanged(WINDOWPOS FAR *lpwndpos) | CCJTabCtrlBar | [protected]
OverkillAssert(CRuntimeClass *pViewClass) | CCJTabCtrlBar | [protected, virtual]
PreTranslateMessage(MSG *pMsg) | CCJTabCtrlBar | [virtual]
RemoveAllTabs() | CCJTabCtrlBar | [virtual]
RemoveListItem(POSITION pos) | CCJTabCtrlBar | [protected, virtual]
RemoveView(int nView) | CCJTabCtrlBar | [virtual]
ResetToolTips(CToolTipCtrl *pToolTip) | CCJTabCtrlBar | [protected, virtual]
SaveBarState(CSize &size) | CCJControlBar | [protected, virtual]
SetActiveView(int nView) | CCJTabCtrlBar | [virtual]
SetActiveView(CRuntimeClass *pViewClass) | CCJTabCtrlBar | [virtual]
SetActiveView(CView *pUserView) | CCJTabCtrlBar | [virtual]
SetChild(CWnd *pWnd) | CCJControlBar | [protected, virtual]
SetMenuID(UINT popupMenuID, UINT popToolbarID=0, int nPos=0) | CCJControlBar | [virtual]
SetNormalSize(const CSize &cs) | CCJControlBar | [virtual]
SetTabImageList(CImageList *pImageList) | CCJTabCtrlBar | [virtual]
SetTabMenuID(UINT popupMenuID, UINT popToolbarID=0, int nPos=0) | CCJTabCtrlBar | [virtual]
SetViewToolTip(int nView, LPCTSTR lpszLabel) | CCJTabCtrlBar | [virtual]
SetViewToolTip(CRuntimeClass *pViewClass, LPCTSTR lpszLabel) | CCJTabCtrlBar | [virtual]
ShowFrameControls(BOOL bGripper=TRUE, BOOL bButtons=TRUE) | CCJControlBar | [virtual]
SizeTabView(CWnd *pWnd) | CCJTabCtrlBar | [protected, virtual]
~CCJControlBar() | CCJControlBar | [virtual]
~CCJTabCtrlBar() | CCJTabCtrlBar | [virtual]
Generated on Sun Feb 24 01:25:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

tagCTV_ITEM Member List

This is the complete list of members for tagCTV_ITEM, including all inherited members.
pWnd | tagCTV_ITEM
szLabel | tagCTV_ITEM
Generated on Sun Feb 24 01:27:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJTabView Member List

This is the complete list of members for CCJTabView, including all inherited members.
AddView(LPCTSTR lpszLabel, CRuntimeClass *pViewClass, CDocument *pDoc=NULL, CCreateContext *pContext=NULL) | CCJTabView | [virtual]
CalcViewRect(CRect *pRect) | CCJTabView | [private]
CCJTabView() | CCJTabView | [protected]
GetActiveView() | CCJTabView | [virtual]
GetChildRect(CRect &rect) | CCJTabView | [virtual]
GetTabCtrl() | CCJTabView | [virtual]
GetView(CRuntimeClass *pViewClass) | CCJTabView | [virtual]
GetView(int nView) | CCJTabView | [virtual]
m_nActiveTab | CCJTabView | [protected]
m_pActiveView | CCJTabView | [protected]
m_pTabCtrl | CCJTabView | [protected]
m_pToolTip | CCJTabView | [protected]
m_TabFont | CCJTabView | [protected]
m_views | CCJTabView | [protected]
ModifyTabStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags=0) | CCJTabView | [virtual]
OnCreate(LPCREATESTRUCT lpCreateStruct) | CCJTabView | [protected]
OnEraseBkgnd(CDC *pDC) | CCJTabView | [protected]
OnSelchange(NMHDR *pNMHDR, LRESULT *pResult) | CCJTabView | [protected]
OnWindowPosChanged(WINDOWPOS FAR *lpwndpos) | CCJTabView | [protected]
RemoveView(int nView) | CCJTabView | [virtual]
SetActiveView(CRuntimeClass *pViewClass) | CCJTabView | [virtual]
SetActiveView(int nNewTab) | CCJTabView | [virtual]
SetTabImageList(CImageList *pImageList) | CCJTabView | [virtual]
~CCJTabView() | CCJTabView | [protected, virtual]
Generated on Sun Feb 24 01:25:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

DROPDOWNBUTTON Member List

This is the complete list of members for DROPDOWNBUTTON, including all inherited members.
idButton | DROPDOWNBUTTON
idMenu | DROPDOWNBUTTON
next | DROPDOWNBUTTON
Generated on Sun Feb 24 01:25:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TOOLBARINFO Member List

This is the complete list of members for TOOLBARINFO, including all inherited members.
btnText | TOOLBARINFO
tbButton | TOOLBARINFO
Generated on Sun Feb 24 01:28:18 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJToolBar Member List

This is the complete list of members for CCJToolBar, including all inherited members.
AddButtons(int nNumButtons, LPTBBUTTON lpButtons) | CCJToolBar |
AddDropDownButton(UINT nIDButton, UINT nIDMenu, BOOL bArrow=TRUE) | CCJToolBar |
AddReplaceBitmap(HBITMAP hbmImageWell) | CCJToolBar |
AddStrings(LPCTSTR lpszStrings) | CCJToolBar |
AutoSize() | CCJToolBar |
CalcDynamicLayout(int nLength, DWORD nMode) | CCJToolBar | [virtual]
CalcFixedLayout(BOOL bStretch, BOOL bHorz) | CCJToolBar | [virtual]
CalcInsideRect(CRect &rect, BOOL bHorz) const | CCJToolBarBase |
CalcLayout(DWORD nMode, int nLength=-1) | CCJToolBar | [protected]
CalcSize(TBBUTTON *pData, int nCount) | CCJToolBar | [protected]
CCJToolBar() | CCJToolBar |
CCJToolBarBase() | CCJToolBarBase | [protected]
CheckButton(int nID, BOOL bCheck) | CCJToolBar |
CommandToIndex(UINT nIDFind) const | CCJToolBar |
Create(CWnd *pParentWnd, DWORD dwStyle=WS_CHILD|WS_VISIBLE|CBRS_TOP, UINT nID=AFX_IDW_TOOLBAR) | CCJToolBar | [virtual]
CreateEx(CWnd *pParentWnd, DWORD dwCtrlStyle=TBSTYLE_FLAT, DWORD dwStyle=WS_CHILD|WS_VISIBLE|CBRS_ALIGN_TOP, CRect rcBorders=CRect(0, 0, 0, 0), UINT nID=AFX_IDW_TOOLBAR) | CCJToolBar | [virtual]
Customize() | CCJToolBar |
DeleteButton(int nIndex) | CCJToolBar |
DoPaint(CDC *pDC) | CCJToolBarBase | [virtual]
DrawBorders(CDC *pDC, CRect &rect) | CCJToolBarBase |
DrawGripper(CDC *pDC, const CRect &rect) | CCJToolBarBase |
EnableButton(int nID, BOOL bEnable) | CCJToolBar |
EraseNonClient() | CCJToolBarBase |
FindDropDownButton(UINT nID) | CCJToolBar |
GetBitmap(UINT nIdButton) const | CCJToolBar |
GetBitmapFlags() const | CCJToolBar |
GetBorders() const | CCJToolBarBase | [protected]
GetButton(int nIndex, TBBUTTON *pButton) const | CCJToolBar |
GetButtonCount() const | CCJToolBar |
GetButtonInfo(int nIndex, UINT &nID, UINT &nStyle, int &iImage) const | CCJToolBar |
GetButtonSize(TBBUTTON *pData, int iButton) | CCJToolBar | [virtual]
GetButtonStyle(int nIndex) const | CCJToolBar |
GetButtonText(int nIndex) const | CCJToolBar |
GetButtonText(int nIndex, CString &rString) const | CCJToolBar |
GetHotItem() const | CCJToolBar |
GetImageList() const | CCJToolBar |
GetItemID(int nIndex) const | CCJToolBar |
GetItemRect(int nIndex, LPRECT lpRect) const | CCJToolBar | [virtual]
GetPadding() const | CCJToolBar |
GetRect(UINT nIdButton, RECT &rc) const | CCJToolBar |
GetRows() const | CCJToolBar |
GetState(int nID) const | CCJToolBar |
GetToolBarCtrl() const | CCJToolBar |
GetToolbarStyle() const | CCJToolBar |
GetToolTips() const | CCJToolBar |
HideButton(int nID, BOOL bHide) | CCJToolBar |
HitTest(CPoint p) const | CCJToolBar |
Indeterminate(int nID, BOOL bIndeterminate) | CCJToolBar |
InsertButton(int nIndex, LPTBBUTTON lpButton) | CCJToolBar |
InsertControl(CRuntimeClass *pClass, LPCTSTR lpszWindowName, CRect &rect, UINT nID, DWORD dwStyle) | CCJToolBar |
InsertControl(CWnd *pCtrl, CRect &rect, UINT nID) | CCJToolBar |
InvalidateOldPos(const CRect &rcInvalid) | CCJToolBar | [virtual]
IsButtonChecked(int nID) const | CCJToolBar |
IsButtonEnabled(int nID) const | CCJToolBar |
IsButtonHidden(int nID) const | CCJToolBar |
IsButtonIndeterminate(int nID) const | CCJToolBar |
IsButtonPressed(int nID) const | CCJToolBar |
Layout() | CCJToolBar | [protected]
LoadBitmap(LPCTSTR lpszResourceName) | CCJToolBar |
LoadBitmap(UINT nIDResource) | CCJToolBar |
LoadToolBar(LPCTSTR lpszResourceName, TOOLBARINFO *pBarInfo=NULL) | CCJToolBar |
LoadToolBar(UINT nIDResource, TOOLBARINFO *pBarInfo=NULL) | CCJToolBar |
m_bDelayedButtonLayout | CCJToolBar | [protected]
m_bExStyle | CCJToolBarBase |
m_bInReBar | CCJToolBarBase |
m_bShowDropArrow | CCJToolBar | [protected]
m_hbmImageWell | CCJToolBar | [protected]
m_hInstImageWell | CCJToolBar | [protected]
m_hKeyRoot | CCJToolBar | [protected]
m_hRsrcImageWell | CCJToolBar | [protected]
m_nBarNumber | CCJToolBar | [protected, static]
m_nButtons | CCJToolBar | [protected]
m_pBarInfo | CCJToolBar | [protected]
m_pControls | CCJToolBar | [protected]
m_pDropButtons | CCJToolBar | [protected]
m_pStringMap | CCJToolBar | [protected]
m_rcOldPos | CCJToolBar | [protected]
m_sizeButton | CCJToolBar | [protected]
m_sizeImage | CCJToolBar | [protected]
m_strSubKey | CCJToolBar | [protected]
m_strValueName | CCJToolBar | [protected]
MapAccelerator(TCHAR ch, UINT &nID) const | CCJToolBar |
OnBarStyleChange(DWORD dwOldStyle, DWORD dwNewStyle) | CCJToolBar | [virtual]
OnDestroy() | CCJToolBar | [protected]
OnDropDownButton(const NMTOOLBAR &nmtb, UINT nID, CRect rc) | CCJToolBar | [virtual]
OnEraseBkgnd(CDC *pDC) | CCJToolBar | [protected]
OnNcCalcSize(BOOL, NCCALCSIZE_PARAMS *) | CCJToolBar | [protected]
OnNcCreate(LPCREATESTRUCT) | CCJToolBar | [protected]
OnNcHitTest(CPoint) | CCJToolBar | [protected]
OnNcPaint() | CCJToolBar | [protected]
OnPaint() | CCJToolBar | [protected]
OnPreserveZeroBorderHelper(WPARAM, LPARAM) | CCJToolBar | [protected]
OnRButtonDown(UINT nFlags, CPoint point) | CCJToolBar | [protected]
OnSetBitmapSize(WPARAM, LPARAM) | CCJToolBar | [protected]
OnSetButtonSize(WPARAM, LPARAM) | CCJToolBar | [protected]
OnSetSizeHelper(CSize &size, LPARAM lParam) | CCJToolBar | [protected]
OnSysColorChange() | CCJToolBar | [protected]
OnToolBarBeginAdjust(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarBeginDrag(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarBtnDropDown(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarChange(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarCustomHelp(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarEndAdjust(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarEndDrag(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarGetButtonInfo(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarQueryDelete(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarQueryInsert(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolBarReset(NMHDR *pNMHDR, LRESULT *pResult) | CCJToolBar | [protected]
OnToolHitTest(CPoint point, TOOLINFO *pTI) const | CCJToolBar | [virtual]
OnUpdateCmdUI(CFrameWnd *pTarget, BOOL bDisableIfNoHndler) | CCJToolBar | [virtual]
OnWindowPosChanged(WINDOWPOS *lpwndpos) | CCJToolBar | [protected]
OnWindowPosChanging(LPWINDOWPOS) | CCJToolBar | [protected]
PreCreateWindow(CREATESTRUCT &cs) | CCJToolBar | [virtual]
PressButton(int nID, BOOL bPress) | CCJToolBar |
RestoreState() | CCJToolBar |
SaveState() | CCJToolBar |
SendMessageC(UINT m, WPARAM wp=0, LPARAM lp=0) const | CCJToolBar |
SetBitmap(HBITMAP hbmImageWell) | CCJToolBar |
SetBitmapSize(CSize sz) | CCJToolBar |
SetBorders(LPCRECT lpRect) | CCJToolBarBase | [protected]
SetBorders(int cxLeft=0, int cyTop=0, int cxRight=0, int cyBottom=0) | CCJToolBarBase | [protected]
SetButton(int nIndex, TBBUTTON *pButton) | CCJToolBar |
SetButtonInfo(int nIndex, UINT nID, UINT nStyle, int iImage) | CCJToolBar |
SetButtons(const UINT *lpIDArray, int nIDCount) | CCJToolBar |
SetButtonSize(CSize sz) | CCJToolBar |
SetButtonStructSize(int nSize) | CCJToolBar |
SetButtonStyle(int nIndex, UINT nStyle) | CCJToolBar |
SetButtonText(int nIndex, LPCTSTR lpszText) | CCJToolBar |
SetCmdID(int nIndex, UINT nID) | CCJToolBar |
SetExtendedStyle(DWORD dwStyle) | CCJToolBar |
SetHeight(int cyHeight) | CCJToolBar |
SetHotItem(int iHot) | CCJToolBar |
SetImageList(HIMAGELIST hImgList) | CCJToolBar |
SetIndent(int indent) | CCJToolBar |
SetOwner(CWnd *pOwnerWnd) | CCJToolBar |
SetPadding(CSize sz) | CCJToolBar |
SetRows(int nRows, BOOL bLarger, LPRECT lpRect) | CCJToolBar |
SetSizes(SIZE sizeButton, SIZE sizeImage) | CCJToolBar |
SetState(int nID, UINT nState) | CCJToolBar |
SetToolbarStyle(DWORD dwStyle) | CCJToolBar |
SetToolTips(CToolTipCtrl *pTip) | CCJToolBar |
SizeToolBar(TBBUTTON *pData, int nCount, int nLength, BOOL bVert=FALSE) | CCJToolBar | [protected]
WindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam) | CCJToolBarBase | [virtual]
WrapToolBar(TBBUTTON *pData, int nCount, int nWidth) | CCJToolBar | [protected]
~CCJToolBar() | CCJToolBar | [virtual]
~CCJToolBarBase() | CCJToolBarBase | [virtual]
Generated on Sun Feb 24 01:25:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJToolBarBase Member List

This is the complete list of members for CCJToolBarBase, including all inherited members.
CalcInsideRect(CRect &rect, BOOL bHorz) const | CCJToolBarBase |
CCJToolBarBase() | CCJToolBarBase | [protected]
DoPaint(CDC *pDC) | CCJToolBarBase | [virtual]
DrawBorders(CDC *pDC, CRect &rect) | CCJToolBarBase |
DrawGripper(CDC *pDC, const CRect &rect) | CCJToolBarBase |
EraseNonClient() | CCJToolBarBase |
GetBorders() const | CCJToolBarBase | [protected]
m_bExStyle | CCJToolBarBase |
m_bInReBar | CCJToolBarBase |
OnPaint() | CCJToolBarBase |
OnWindowPosChanging(LPWINDOWPOS lpWndPos) | CCJToolBarBase |
SetBorders(LPCRECT lpRect) | CCJToolBarBase | [protected]
SetBorders(int cxLeft=0, int cyTop=0, int cxRight=0, int cyBottom=0) | CCJToolBarBase | [protected]
WindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam) | CCJToolBarBase | [virtual]
~CCJToolBarBase() | CCJToolBarBase | [virtual]
Generated on Sun Feb 24 01:25:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJToolBarCtrl Member List

This is the complete list of members for CCJToolBarCtrl, including all inherited members.
CCJToolBarCtrl() | CCJToolBarCtrl |
Create(DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID) | CCJToolBarCtrl |
GetAnchorHighlight() const | CCJToolBarCtrl |
GetButtonInfo(int nID, TBBUTTONINFO *ptbbi) const | CCJToolBarCtrl |
GetButtonSize() const | CCJToolBarCtrl |
GetDisabledImageList() const | CCJToolBarCtrl |
GetDropTarget(IDropTarget **ppDropTarget) const | CCJToolBarCtrl |
GetExtendedStyle() const | CCJToolBarCtrl |
GetHotImageList() const | CCJToolBarCtrl |
GetHotItem() const | CCJToolBarCtrl |
GetImageList() const | CCJToolBarCtrl |
GetInsertMark(TBINSERTMARK *ptbim) const | CCJToolBarCtrl |
GetInsertMarkColor() const | CCJToolBarCtrl |
GetMaxSize(LPSIZE pSize) const | CCJToolBarCtrl |
GetMaxTextRows() const | CCJToolBarCtrl |
GetStyle() const | CCJToolBarCtrl |
HitTest(LPPOINT ppt) const | CCJToolBarCtrl |
InsertMarkHitTest(LPPOINT ppt, LPTBINSERTMARK ptbim) const | CCJToolBarCtrl |
IsButtonHighlighted(int nID) const | CCJToolBarCtrl |
MapAccelerator(TCHAR chAccel, UINT *pIDBtn) | CCJToolBarCtrl |
MarkButton(int nID, BOOL bHighlight=TRUE) | CCJToolBarCtrl |
MoveButton(UINT nOldPos, UINT nNewPos) | CCJToolBarCtrl |
OnCreate(LPCREATESTRUCT lpCreateStruct) | CCJToolBarCtrl | [protected]
SetAnchorHighlight(BOOL fAnchor=TRUE) | CCJToolBarCtrl |
SetButtonInfo(int nID, TBBUTTONINFO *ptbbi) | CCJToolBarCtrl |
SetButtonWidth(int cxMin, int cxMax) | CCJToolBarCtrl |
SetDisabledImageList(CImageList *pImageList) | CCJToolBarCtrl |
SetDrawTextFlags(DWORD dwMask, DWORD dwDTFlags) | CCJToolBarCtrl |
SetExtendedStyle(DWORD dwExStyle) | CCJToolBarCtrl |
SetHotImageList(CImageList *pImageList) | CCJToolBarCtrl |
SetHotItem(int nHot) | CCJToolBarCtrl |
SetImageList(CImageList *pImageList) | CCJToolBarCtrl |
SetIndent(int iIndent) | CCJToolBarCtrl |
SetInsertMark(TBINSERTMARK *ptbim) | CCJToolBarCtrl |
SetInsertMarkColor(COLORREF clrNew) | CCJToolBarCtrl |
SetMaxTextRows(int iMaxRows) | CCJToolBarCtrl |
SetStyle(DWORD dwStyle) | CCJToolBarCtrl |
~CCJToolBarCtrl() | CCJToolBarCtrl | [virtual]
Generated on Sun Feb 24 01:25:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJTreeCtrl Member List

This is the complete list of members for CCJTreeCtrl, including all inherited members.
CCJTreeCtrl() | CCJTreeCtrl |
ClearSelection() | CCJTreeCtrl | [virtual]
EnableMultiSelect(BOOL bMultiSelect=TRUE) | CCJTreeCtrl | [virtual]
FindItem(LPCTSTR lpszSearch, BOOL bCaseSensitive=FALSE, BOOL bDownDir=TRUE, BOOL bWholeWord=FALSE, HTREEITEM hItem=NULL) | CCJTreeCtrl | [virtual]
GetFirstSelectedItem() | CCJTreeCtrl | [virtual]
GetItemBold(HTREEITEM hItem) | CCJTreeCtrl | [virtual]
GetItemColor(HTREEITEM hItem) | CCJTreeCtrl | [virtual]
GetItemFont(HTREEITEM hItem, LOGFONT *plogfont) | CCJTreeCtrl | [virtual]
GetLastItem(HTREEITEM hItem) | CCJTreeCtrl | [virtual]
GetNextItem(HTREEITEM hItem, UINT nCode) | CCJTreeCtrl | [virtual]
GetNextItem(HTREEITEM hItem) | CCJTreeCtrl | [virtual]
GetNextSelectedItem(HTREEITEM hItem) | CCJTreeCtrl | [virtual]
GetPrevItem(HTREEITEM hItem) | CCJTreeCtrl | [virtual]
GetPrevSelectedItem(HTREEITEM hItem) | CCJTreeCtrl | [virtual]
IsFindValid(HTREEITEM hti) | CCJTreeCtrl | [protected, virtual]
m_bMultiSelect | CCJTreeCtrl | [protected]
m_dwDragStart | CCJTreeCtrl | [protected]
m_hItemFirstSel | CCJTreeCtrl | [protected]
m_mapColorFont | CCJTreeCtrl | [protected]
OnEraseBkgnd(CDC *pDC) | CCJTreeCtrl | [protected]
OnLButtonDown(UINT nFlags, CPoint point) | CCJTreeCtrl | [protected]
OnPaint() | CCJTreeCtrl | [protected]
PreCreateWindow(CREATESTRUCT &cs) | CCJTreeCtrl | [protected, virtual]
SelectItems(HTREEITEM hItemFrom, HTREEITEM hItemTo) | CCJTreeCtrl | [virtual]
SetItemBold(HTREEITEM hItem, BOOL bBold=TRUE) | CCJTreeCtrl | [virtual]
SetItemColor(HTREEITEM hItem, COLORREF color) | CCJTreeCtrl | [virtual]
SetItemFont(HTREEITEM hItem, LOGFONT &logfont) | CCJTreeCtrl | [virtual]
~CCJTreeCtrl() | CCJTreeCtrl | [virtual]
Generated on Sun Feb 24 01:25:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJTreeCtrl::Color_Font Member List

This is the complete list of members for CCJTreeCtrl::Color_Font, including all inherited members.
color | CCJTreeCtrl::Color_Font
logfont | CCJTreeCtrl::Color_Font
Generated on Sun Feb 24 01:25:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCJWindowPlacement Member List

This is the complete list of members for CCJWindowPlacement, including all inherited members.
CCJWindowPlacement() | CCJWindowPlacement |
LoadWindowPos(CFrameWnd *pFrameWnd, LPCTSTR lpszFormat=NULL, LPCTSTR lpszSection=NULL, LPCTSTR lpszWndPos=NULL) | CCJWindowPlacement | [virtual]
m_strFormat | CCJWindowPlacement | [private]
m_strSection | CCJWindowPlacement | [private]
m_strWndPos | CCJWindowPlacement | [private]
SaveWindowPos(CFrameWnd *pFrameWnd) | CCJWindowPlacement | [virtual]
~CCJWindowPlacement() | CCJWindowPlacement | [virtual]
Generated on Sun Feb 24 01:25:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CGfxGroupEdit Member List

This is the complete list of members for CGfxGroupEdit, including all inherited members.
bEscapeKey | CGfxGroupEdit |
bNoDown | CGfxGroupEdit |
CGfxGroupEdit() | CGfxGroupEdit |
iIndex | CGfxGroupEdit |
msgSend | CGfxGroupEdit |
OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) | CGfxGroupEdit | [protected]
OnCreate(LPCREATESTRUCT lpCreateStruct) | CGfxGroupEdit | [protected]
OnKillFocus(CWnd *pNewWnd) | CGfxGroupEdit | [protected]
PostNcDestroy() | CGfxGroupEdit | [protected, virtual]
PreTranslateMessage(MSG *pMsg) | CGfxGroupEdit | [virtual]
text | CGfxGroupEdit |
~CGfxGroupEdit() | CGfxGroupEdit | [virtual]
Generated on Sun Feb 24 01:26:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

OUTBAR_INFO Member List

This is the complete list of members for OUTBAR_INFO, including all inherited members.
cText | OUTBAR_INFO
iDragFrom | OUTBAR_INFO
iDragTo | OUTBAR_INFO
index | OUTBAR_INFO
Generated on Sun Feb 24 01:27:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CGfxOutBarCtrl Member List

This is the complete list of members for CGfxOutBarCtrl, including all inherited members.
AddFolder(LPCTSTR cFolderName, const DWORD exData) | CGfxOutBarCtrl | [virtual]
AddFolderBar(LPCTSTR pFolder, CWnd *pSon, const DWORD exData=0) | CGfxOutBarCtrl | [virtual]
AnimateFolderScroll(const int iFrom, const int iTo) | CGfxOutBarCtrl | [virtual]
arFolder | CGfxOutBarCtrl |
bDownArrow | CGfxOutBarCtrl |
bDownPressed | CGfxOutBarCtrl |
bLooping | CGfxOutBarCtrl |
bPressedHighlight | CGfxOutBarCtrl |
bUpArrow | CGfxOutBarCtrl |
bUpPressed | CGfxOutBarCtrl |
CGfxOutBarCtrl() | CGfxOutBarCtrl |
cr3dFace | CGfxOutBarCtrl |
crBackGroundColor | CGfxOutBarCtrl |
crBackGroundColor1 | CGfxOutBarCtrl |
crDkShadowBorder | CGfxOutBarCtrl |
Create(DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID, const DWORD dwFlag=fDragItems|fEditGroups|fEditItems|fRemoveGroups|fRemoveItems|fAddGroups|fAnimation|fSelHighlight) | CGfxOutBarCtrl | [virtual]
crHilightBorder | CGfxOutBarCtrl |
crLightBorder | CGfxOutBarCtrl |
crShadowBorder | CGfxOutBarCtrl |
crTextColor | CGfxOutBarCtrl |
DrawAnimItem(const int xoffset, const int yoffset, const int index) | CGfxOutBarCtrl | [virtual]
DrawDragArrow(CDC *pDC, const int iFrom, const int iTo) | CGfxOutBarCtrl | [virtual]
DrawFolder(CDC *pDC, const int iIdx, CRect rect, const bool bSelected) | CGfxOutBarCtrl | [protected]
DrawItem(CDC *pDC, const int iFolder, CRect rc, const int index, const bool bOnlyImage=false) | CGfxOutBarCtrl | [virtual]
dwFlags | CGfxOutBarCtrl |
fAddGroups enum value | CGfxOutBarCtrl |
fAnimation enum value | CGfxOutBarCtrl |
fDragItems enum value | CGfxOutBarCtrl |
fEditGroups enum value | CGfxOutBarCtrl |
fEditItems enum value | CGfxOutBarCtrl |
fLargeIcon enum value | CGfxOutBarCtrl |
fRemoveGroups enum value | CGfxOutBarCtrl |
fRemoveItems enum value | CGfxOutBarCtrl |
fSelHighlight enum value | CGfxOutBarCtrl |
fSmallIcon enum value | CGfxOutBarCtrl |
GetAnimationTickCount() | CGfxOutBarCtrl | [inline, virtual]
GetCountPerPage() const | CGfxOutBarCtrl | [virtual]
GetDragItemRect(const int index, CRect &rect) | CGfxOutBarCtrl | [virtual]
GetFlag() const | CGfxOutBarCtrl | [virtual]
GetFolderChild(int iFolder=-1) | CGfxOutBarCtrl | [virtual]
GetFolderCount() const | CGfxOutBarCtrl | [virtual]
GetFolderData(int iFolder=-1) | CGfxOutBarCtrl | [virtual]
GetFolderImageList(const int index, const bool bSmall) const | CGfxOutBarCtrl | [virtual]
GetFolderRect(const int iIndex, CRect &rect) const | CGfxOutBarCtrl | [virtual]
GetIconRect(const int iFolder, const int iIndex, CRect &rect) | CGfxOutBarCtrl | [virtual]
GetImageList(CImageList *pImageList, int nImageList) | CGfxOutBarCtrl | [virtual]
GetInsideRect(CRect &rect) const | CGfxOutBarCtrl | [virtual]
GetItemCount() const | CGfxOutBarCtrl | [virtual]
GetItemData(const int index) const | CGfxOutBarCtrl | [virtual]
GetItemImage(const int index) const | CGfxOutBarCtrl | [virtual]
GetItemRect(const int iFolder, const int iIndex, CRect &rect) | CGfxOutBarCtrl | [virtual]
GetItemSize(const int iFolder, const int index, const int type) | CGfxOutBarCtrl | [virtual]
GetItemText(const int index) | CGfxOutBarCtrl | [virtual]
GetLabelRect(const int iFolder, const int iIndex, CRect &rect) | CGfxOutBarCtrl | [virtual]
GetSelFolder() const | CGfxOutBarCtrl | [virtual]
GetVisibleRange(const int iFolder, int &first, int &last) | CGfxOutBarCtrl | [virtual]
hDragCursor | CGfxOutBarCtrl |
hHandCursor | CGfxOutBarCtrl |
HighlightFolder(const int index) | CGfxOutBarCtrl | [virtual]
HighlightItem(const int index, const bool bPressed=false) | CGfxOutBarCtrl | [virtual]
HitTestEx(const CPoint &point, int &index) | CGfxOutBarCtrl | [virtual]
hNoDragCursor | CGfxOutBarCtrl |
htDownScroll enum value | CGfxOutBarCtrl |
htFolder enum value | CGfxOutBarCtrl |
htItem enum value | CGfxOutBarCtrl |
htNothing enum value | CGfxOutBarCtrl |
htUpScroll enum value | CGfxOutBarCtrl |
iFirstItem | CGfxOutBarCtrl |
iFolderHeight | CGfxOutBarCtrl |
iHitInternal1 | CGfxOutBarCtrl |
iHitInternal2 | CGfxOutBarCtrl |
iLastDragItemDraw | CGfxOutBarCtrl |
iLastDragItemDrawType | CGfxOutBarCtrl |
iLastFolderHighlighted | CGfxOutBarCtrl |
iLastItemHighlighted | CGfxOutBarCtrl |
iLastSel | CGfxOutBarCtrl |
iLastSelectedFolder | CGfxOutBarCtrl |
InsertItem(const int folder, const int index, LPCTSTR text, const int image=-1, const DWORD exData=0) | CGfxOutBarCtrl | [virtual]
ircAll enum value | CGfxOutBarCtrl |
ircIcon enum value | CGfxOutBarCtrl |
ircLabel enum value | CGfxOutBarCtrl |
iSelAnimCount | CGfxOutBarCtrl |
iSelAnimTiming | CGfxOutBarCtrl |
iSelFolder | CGfxOutBarCtrl |
IsSmallIconView() const | CGfxOutBarCtrl | [virtual]
IsValidItem(const int index) const | CGfxOutBarCtrl | [virtual]
lAnimationTickCount | CGfxOutBarCtrl |
m_popupMenu | CGfxOutBarCtrl |
m_strRemoveItem | CGfxOutBarCtrl |
m_strRenameItem | CGfxOutBarCtrl |
ModifyFlag(const DWORD &dwRemove, const DWORD &dwAdd, const UINT redraw=0) | CGfxOutBarCtrl | [virtual]
OnCreate(LPCREATESTRUCT lpCreateStruct) | CGfxOutBarCtrl | [protected]
OnEndLabelEdit(WPARAM wParam, LPARAM lParam) | CGfxOutBarCtrl | [protected]
OnEraseBkgnd(CDC *pDC) | CGfxOutBarCtrl | [protected]
OnGfxLargeicon() | CGfxOutBarCtrl | [protected]
OnGfxRemoveitem() | CGfxOutBarCtrl | [protected]
OnGfxRenameitem() | CGfxOutBarCtrl | [protected]
OnGfxSmallicon() | CGfxOutBarCtrl | [protected]
OnLButtonDown(UINT nFlags, CPoint point) | CGfxOutBarCtrl | [protected]
OnMouseMove(UINT nFlags, CPoint point) | CGfxOutBarCtrl | [protected]
OnPaint() | CGfxOutBarCtrl | [protected]
OnRButtonDown(UINT nFlags, CPoint point) | CGfxOutBarCtrl | [protected]
OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) | CGfxOutBarCtrl | [protected]
OnSize(UINT nType, int cx, int cy) | CGfxOutBarCtrl | [protected]
OnSysColorChange() | CGfxOutBarCtrl | [protected]
OnTimer(UINT nIDEvent) | CGfxOutBarCtrl | [protected]
OnUpdateGfxLargeicon(CCmdUI *pCmdUI) | CGfxOutBarCtrl | [protected]
OnUpdateGfxRemoveitem(CCmdUI *pCmdUI) | CGfxOutBarCtrl | [protected]
OnUpdateGfxRenameitem(CCmdUI *pCmdUI) | CGfxOutBarCtrl | [protected]
OnUpdateGfxSmallicon(CCmdUI *pCmdUI) | CGfxOutBarCtrl | [protected]
PaintItems(CDC *pDC, const int iFolder, CRect rc) | CGfxOutBarCtrl | [virtual]
pBlackPen | CGfxOutBarCtrl |
pLargeImageList | CGfxOutBarCtrl |
pSmallImageList | CGfxOutBarCtrl |
rcDownArrow | CGfxOutBarCtrl |
rcUpArrow | CGfxOutBarCtrl |
RemoveFolder(const int index) | CGfxOutBarCtrl | [virtual]
RemoveItem(const int index) | CGfxOutBarCtrl | [virtual]
SetAnimationTickCount(const long value) | CGfxOutBarCtrl | [inline, virtual]
SetAnimSelHighlight(const int iTime) | CGfxOutBarCtrl | [virtual]
SetFolderImageList(const int folder, CImageList *pImageList, int nImageList) | CGfxOutBarCtrl | [virtual]
SetFolderText(const int index, LPCTSTR text) | CGfxOutBarCtrl | [virtual]
SetImageList(CImageList *pImageList, int nImageList) | CGfxOutBarCtrl | [virtual]
SetItemData(const int index, const DWORD dwData) | CGfxOutBarCtrl | [virtual]
SetItemImage(const int index, const int iImage) | CGfxOutBarCtrl | [virtual]
SetItemText(const int index, LPCTSTR text) | CGfxOutBarCtrl | [virtual]
SetSelFolder(const int index) | CGfxOutBarCtrl | [virtual]
SetSmallIconView(const bool bSet) | CGfxOutBarCtrl | [virtual]
StartGroupEdit(const int index) | CGfxOutBarCtrl | [virtual]
StartItemEdit(const int index) | CGfxOutBarCtrl | [virtual]
xLeftMargin | CGfxOutBarCtrl |
xSmallIconLabelOffset | CGfxOutBarCtrl |
yLargeIconLabelOffset | CGfxOutBarCtrl |
yLargeIconSpacing | CGfxOutBarCtrl |
ySmallIconSpacing | CGfxOutBarCtrl |
yTopMargin | CGfxOutBarCtrl |
~CGfxOutBarCtrl() | CGfxOutBarCtrl | [virtual]
Generated on Sun Feb 24 01:26:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CGfxOutBarCtrl::CBarItem Member List

This is the complete list of members for CGfxOutBarCtrl::CBarItem, including all inherited members.
CBarItem(LPCTSTR name, const int image, DWORD exData) | CGfxOutBarCtrl::CBarItem |
cItem | CGfxOutBarCtrl::CBarItem |
dwData | CGfxOutBarCtrl::CBarItem |
iImageIndex | CGfxOutBarCtrl::CBarItem |
~CBarItem() | CGfxOutBarCtrl::CBarItem | [virtual]
Generated on Sun Feb 24 01:26:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CGfxOutBarCtrl::CBarFolder Member List

This is the complete list of members for CGfxOutBarCtrl::CBarFolder, including all inherited members.
arItems | CGfxOutBarCtrl::CBarFolder |
CBarFolder(LPCTSTR name, DWORD exData) | CGfxOutBarCtrl::CBarFolder |
cName | CGfxOutBarCtrl::CBarFolder |
dwData | CGfxOutBarCtrl::CBarFolder |
GetItemCount() | CGfxOutBarCtrl::CBarFolder |
InsertItem(int index, LPCTSTR text, const int image, const DWORD exData) | CGfxOutBarCtrl::CBarFolder |
pChild | CGfxOutBarCtrl::CBarFolder |
pLargeImageList | CGfxOutBarCtrl::CBarFolder |
pSmallImageList | CGfxOutBarCtrl::CBarFolder |
~CBarFolder() | CGfxOutBarCtrl::CBarFolder | [virtual]
Generated on Sun Feb 24 01:26:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CGfxSplitterWnd Member List

This is the complete list of members for CGfxSplitterWnd, including all inherited members.
bWhiteLine | CGfxSplitterWnd |
CGfxSplitterWnd() | CGfxSplitterWnd |
GetInsideRect(CRect &rect) const | CGfxSplitterWnd | [protected, virtual]
m_upBorder | CGfxSplitterWnd |
OnDrawSplitter(CDC *pDC, ESplitType nType, const CRect &rectArg) | CGfxSplitterWnd | [virtual]
OnEraseBkgnd(CDC *pDC) | CGfxSplitterWnd | [protected]
OnInvertTracker(const CRect &rect) | CGfxSplitterWnd | [virtual]
OnPaint() | CGfxSplitterWnd | [protected]
RecalcLayout() | CGfxSplitterWnd | [virtual]
~CGfxSplitterWnd() | CGfxSplitterWnd | [virtual]
Generated on Sun Feb 24 01:26:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CSubclassWnd Member List

This is the complete list of members for CSubclassWnd, including all inherited members.
CSubclassWnd() | CSubclassWnd |
CSubclassWndMap class | CSubclassWnd | [friend]
DECLARE_DYNAMIC(CSubclassWnd) | CSubclassWnd |
Default() | CSubclassWnd | [protected, virtual]
HookWindow(HWND hwnd) | CSubclassWnd | [virtual]
HookWindow(CWnd *pWnd) | CSubclassWnd | [inline, virtual]
HookWndProc(HWND, UINT, WPARAM, LPARAM) | CSubclassWnd | [friend]
IsHooked() | CSubclassWnd | [inline, virtual]
m_hWnd | CSubclassWnd | [protected]
m_pNext | CSubclassWnd | [protected]
m_pOldWndProc | CSubclassWnd | [protected]
WindowProc(UINT msg, WPARAM wp, LPARAM lp) | CSubclassWnd | [protected, virtual]
~CSubclassWnd() | CSubclassWnd |
Generated on Sun Feb 24 01:27:54 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CColorStatic Member List

This is the complete list of members for CColorStatic, including all inherited members.
CColorStatic() | CColorStatic |
GetColor() | CColorStatic |
m_color | CColorStatic | [private]
OnPaint() | CColorStatic | [protected]
SetColor(COLORREF color) | CColorStatic |
~CColorStatic() | CColorStatic | [virtual]
Generated on Sun Feb 24 01:25:24 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CBarConsole Member List

This is the complete list of members for CBarConsole, including all inherited members.
CalcDynamicLayout(int nLength, DWORD nMode) | CCJControlBar | [virtual]
CBarConsole() | CBarConsole |
CCJControlBar() | CCJControlBar |
Create(CWnd *pParentWnd, UINT nID, LPCTSTR lpszWindowName=NULL, CSize sizeDefault=CSize(200, 100), DWORD dwStyle=CBRS_LEFT, BOOL bFlatBorders=FALSE) | CCJControlBar | [virtual]
DrawBorders(CDC *pDC, CRect &rect) | CCJControlBar | [protected, virtual]
DrawGriperCaption(CDC *pDC, LPRECT pRect) | CCJControlBar | [protected, virtual]
DrawGripper(CDC *pDC) | CCJControlBar | [protected, virtual]
EnableDockingOnSizeBar(DWORD dwDockStyle) | CCJControlBar | [virtual]
EnableFlatLook(BOOL bFlat=TRUE) | CCJControlBar | [virtual]
EnableFlatLook(BOOL bGripper, BOOL bBorder, BOOL bButtons) | CCJControlBar | [virtual]
EnableSaveState(bool bAutoSave=true) | CCJControlBar | [virtual]
EraseNonClient() | CCJControlBar | [protected, virtual]
GetButtonRect() | CCJControlBar | [protected, virtual]
GetChildRect(CRect &rect) | CCJControlBar | [virtual]
GetGripperRect() | CCJControlBar | [protected, virtual]
GetHorzSize() | CCJControlBar | [virtual]
GetMenuID() | CCJControlBar | [virtual]
GetMinExt() | CCJControlBar | [virtual]
GetVertSize() | CCJControlBar | [virtual]
HitTest(CPoint &point) | CCJControlBar | [protected, virtual]
IsBottomDocked() const | CCJControlBar | [virtual]
IsFloating() const | CCJControlBar | [virtual]
IsHorzDocked() const | CCJControlBar | [virtual]
IsLeftDocked() const | CCJControlBar | [virtual]
IsRightDocked() const | CCJControlBar | [virtual]
IsTopDocked() const | CCJControlBar | [virtual]
IsVertDocked() const | CCJControlBar | [virtual]
LoadBarState(CSize &size, int nID) | CCJControlBar | [protected, virtual]
m_bAutoSave | CCJControlBar | [protected]
m_bButtons | CCJControlBar | [protected]
m_bDragging | CCJControlBar | [protected]
m_bFlatBorder | CCJControlBar | [protected]
m_bFlatGripper | CCJControlBar | [protected]
m_bFloating | CCJControlBar | [protected]
m_bGripper | CCJControlBar | [protected]
m_bMaximized | CCJControlBar | [protected]
m_bOkToDrag | CCJControlBar | [protected]
m_btnClose | CCJControlBar | [protected]
m_btnMinim | CCJControlBar | [protected]
m_bToFit | CCJControlBar |
m_bUnique | CCJControlBar |
m_cxOffset | CCJControlBar | [protected]
m_cyOffset | CCJControlBar | [protected]
m_eAuxIndex | CCJControlBar | [protected]
m_eChildBorder | CCJControlBar |
m_hAuxIcon | CCJControlBar | [protected]
m_hIcon | CCJControlBar | [protected]
m_ImageList | CCJControlBar | [protected]
m_nID | CCJControlBar | [protected]
m_nPos | CCJControlBar | [protected]
m_pChildWnd | CCJControlBar | [protected]
m_popToolbarID | CCJControlBar | [protected]
m_popupMenu | CCJControlBar | [protected]
m_popupMenuID | CCJControlBar | [protected]
m_ptCurDrag | CCJControlBar | [protected]
m_ptStartDrag | CCJControlBar | [protected]
m_rcTrack | CCJControlBar | [protected]
m_sizeDesired | CCJControlBar | [protected]
m_sizeFloat | CCJControlBar | [protected]
m_sizeHorz | CCJControlBar | [protected]
m_sizeNormal | CCJControlBar | [protected]
m_sizeVert | CCJControlBar | [protected]
m_strSection | CCJControlBar | [protected]
m_ToolTip | CCJControlBar | [protected]
m_view | CBarConsole |
Maximize(int size) | CCJControlBar | [virtual]
Minimize() | CCJControlBar | [virtual]
Normalize() | CCJControlBar | [virtual]
OnButtonClose() | CCJControlBar | [protected]
OnButtonMinimize() | CCJControlBar | [protected]
OnCreate(LPCREATESTRUCT lpCreateStruct) | CBarConsole | [protected]
OnEraseBkgnd(CDC *pDC) | CCJControlBar | [protected]
OnInitMenuPopup(CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu) | CCJControlBar | [protected]
OnInvertTracker(const CRect &rect) | CCJControlBar | [protected, virtual]
OnLButtonDown(UINT nFlags, CPoint point) | CCJControlBar | [protected]
OnLButtonUp(UINT nFlags, CPoint point) | CCJControlBar | [protected]
OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct) | CCJControlBar | [protected]
OnMenuChar(UINT nChar, UINT nFlags, CMenu *pMenu) | CCJControlBar | [protected]
OnMouseMove(UINT nFlags, CPoint point) | CCJControlBar | [protected]
OnNcHitTest(CPoint point) | CCJControlBar | [protected]
OnNcPaint() | CCJControlBar | [protected]
OnPaint() | CCJControlBar | [protected]
OnRButtonDown(UINT nFlags, CPoint point) | CCJControlBar | [protected]
OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) | CCJControlBar | [protected]
OnUpdateButtonClose(CCmdUI *pCmdUI) | CCJControlBar | [protected]
OnUpdateButtonMinimize(CCmdUI *pCmdUI) | CCJControlBar | [protected]
OnUpdateCmdUI(CFrameWnd *pTarget, BOOL bDisableIfNoHndler) | CCJControlBar | [virtual]
OnWindowPosChanged(WINDOWPOS FAR *lpwndpos) | CCJControlBar | [protected]
PreTranslateMessage(MSG *pMsg) | CCJControlBar | [virtual]
SaveBarState(CSize &size) | CCJControlBar | [protected, virtual]
SetChild(CWnd *pWnd) | CCJControlBar | [protected, virtual]
SetMenuID(UINT popupMenuID, UINT popToolbarID=0, int nPos=0) | CCJControlBar | [virtual]
SetNormalSize(const CSize &cs) | CCJControlBar | [virtual]
ShowFrameControls(BOOL bGripper=TRUE, BOOL bButtons=TRUE) | CCJControlBar | [virtual]
~CBarConsole() | CBarConsole | [virtual]
~CCJControlBar() | CCJControlBar | [virtual]
Generated on Sun Feb 24 01:24:19 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

ICvsCoworker Member List

This is the complete list of members for ICvsCoworker, including all inherited members.
AddFiles([in] int handle,[in, string] const char *sOptionsAndFilenames,[in, string] const char *sComment) | ICvsCoworker
CheckinFiles([in] int handle,[in, string] const char *sFilenames,[in] BOOL bKeepCheckedOut) | ICvsCoworker
CheckoutFiles([in] int handle,[in, string] const char *sFilenames) | ICvsCoworker
CloseProject([in] int handle) | ICvsCoworker
DiffFile([in] int handle,[in, string] const char *sFilename,[in] BOOL bIgnoreCase,[in] BOOL bIgnoreBlanks) | ICvsCoworker
GetErrorMessage([in] int handle,[in] int iError,[in] int cbErrorBuffer,[out, string, size_is(cbErrorBuffer)] char *sErrorBuffer) | ICvsCoworker
GetFileChanges([in] int handle,[in] int cbFilenameBuffer,[out, string, size_is(cbFilenameBuffer)] char *sFilenameBuffer) | ICvsCoworker
GetFilesToAdd([in] int handle,[in] int cbFilenamesBuffer,[out, string, size_is(cbFilenamesBuffer)] char *sFilenamesBuffer) | ICvsCoworker
GetLastError([in] int handle,[out] int *piError) | ICvsCoworker
GetProject([out] int *pHandle,[in] const char *sUsername,[in] int cbProjectNameBuffer,[in, out, string, size_is(cbProjectNameBuffer)] char *sProjectName,[in] int cbProjectHomeBuffer,[in, out, string, size_is(cbProjectHomeBuffer)] char *sProjectHome,[in] BOOL bAllowPathChange,[in] BOOL bAllowNewProject,[out] BOOL *pbNewProject) | ICvsCoworker
HasAdvancedOptionsForCommand([in] int handle,[in] CvsCommand command,[out, retval] BOOL *pbAdvancedOptions) | ICvsCoworker
OpenProject([out] int *pHandle,[in, string] const char *sUsername,[in, string] const char *sProjectName,[in, string] const char *sProjectHome) | ICvsCoworker
RemoveFiles([in] int handle,[in, string] const char *sFilenames) | ICvsCoworker
RenameFile([in] int handle,[in, string] const char *sOldFilename,[in, string] const char *sNewFilename) | ICvsCoworker
ShowAdvancedOptionsForCommand([in] int handle,[in] CvsCommand command) | ICvsCoworker
ShowFileHistory([in] int handle,[in, string] const char *sFilenames) | ICvsCoworker
ShowFileProperties([in] int handle,[in, string] const char *sFilename) | ICvsCoworker
ShowUserInterface([in] int handle,[in, string] const char *sFilenames) | ICvsCoworker
UncheckoutFiles([in] int handle,[in, string] const char *sFilenames) | ICvsCoworker
UpdateFiles([in] int handle,[in, string] const char *sFilenames,[in] BOOL bDirectories,[in] BOOL bRecurse) | ICvsCoworker
Generated on Sun Feb 24 01:26:16 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

_IID Member List

This is the complete list of members for _IID, including all inherited members.
c | _IID
s1 | _IID
s2 | _IID
x | _IID
Generated on Sun Feb 24 01:24:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

_MIDL_TYPE_FORMAT_STRING Member List

This is the complete list of members for _MIDL_TYPE_FORMAT_STRING, including all inherited members.
Format | _MIDL_TYPE_FORMAT_STRING
Pad | _MIDL_TYPE_FORMAT_STRING
Generated on Sun Feb 24 01:24:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

_MIDL_PROC_FORMAT_STRING Member List

This is the complete list of members for _MIDL_PROC_FORMAT_STRING, including all inherited members.
Format | _MIDL_PROC_FORMAT_STRING
Pad | _MIDL_PROC_FORMAT_STRING
Generated on Sun Feb 24 01:24:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CvsCoworker Member List

This is the complete list of members for CvsCoworker, including all inherited members.
AddFiles(int handle, const unsigned char *sOptionsAndFilenames, const unsigned char *sComment) | CvsCoworker |
CheckinFiles(int handle, const unsigned char *sFilenames, BOOL bKeepCheckedOut) | CvsCoworker |
CheckoutFiles(int handle, const unsigned char *sFilenames) | CvsCoworker |
CloseProject(int handle) | CvsCoworker |
CvsCoworker() | CvsCoworker | [inline]
DiffFile(int handle, const unsigned char *sFilename, BOOL bIgnoreCase, BOOL bIgnoreWhitespace) | CvsCoworker |
GetErrorMessage(int handle, int iError, int cbErrorBuffer, unsigned char *sError) | CvsCoworker |
GetFileChanges(int handle, int cbFilenameBuffer, unsigned char *sFilenameBuffer) | CvsCoworker |
GetFilesToAdd(int handle, int cbFilenamesBuffer, unsigned char *sFilenamesBuffer) | CvsCoworker |
GetLastError(int handle, int *piError) | CvsCoworker |
GetProject(int *pHandle, const unsigned char *sUsername, int cbProjectNameBuffer, unsigned char *sProjectName, int cbProjectHomeBuffer, unsigned char *sProjectHome, BOOL bAllowPathChange, BOOL bAllowNewProject, BOOL *pbNewProject) | CvsCoworker |
HasAdvancedOptionsForCommand(int handle, CvsCommand command, BOOL *pbAdvancedOptions) | CvsCoworker |
InterfaceSupportsErrorInfo(REFIID riid) | CvsCoworker |
OpenProject(int *pHandle, const unsigned char *sUsername, const unsigned char *sProjectName, const unsigned char *sProjectHome) | CvsCoworker |
RemoveFiles(int handle, const unsigned char *sFilenames) | CvsCoworker |
RenameFile(int handle, const unsigned char *sOldFilename, const unsigned char *sNewFilename) | CvsCoworker |
ShowAdvancedOptionsForCommand(int handle, CvsCommand command) | CvsCoworker |
ShowFileHistory(int handle, const unsigned char *sFilenames) | CvsCoworker |
ShowFileProperties(int handle, const unsigned char *sFilename) | CvsCoworker |
ShowUserInterface(int handle, const unsigned char *sFilenames) | CvsCoworker |
UncheckoutFiles(int handle, const unsigned char *sFilenames) | CvsCoworker |
UpdateFiles(int handle, const unsigned char *sFilenames, BOOL bDirectories, BOOL bRecurse) | CvsCoworker |
Generated on Sun Feb 24 01:28:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CvsFilenames Member List

This is the complete list of members for CvsFilenames, including all inherited members.
CvsFilenames(const unsigned char *) | CvsFilenames |
getFilename(int) | CvsFilenames |
getNumberOfFilenames() | CvsFilenames | [inline]
getOptionsAndFilename(int i, CvsString &, CvsString &) | CvsFilenames |
m_arrayOffsetName | CvsFilenames | [protected]
m_nFilenames | CvsFilenames | [protected]
m_sBuffer | CvsFilenames | [protected]
~CvsFilenames() | CvsFilenames |
Generated on Sun Feb 24 01:28:35 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CvsProject Member List

This is the complete list of members for CvsProject, including all inherited members.
addFiles(CvsFilenames &, const char *) | CvsProject |
checkinFiles(CvsFilenames &, BOOL) | CvsProject |
checkoutFiles(CvsFilenames &) | CvsProject |
closeProject() | CvsProject |
CvsProject() | CvsProject |
diffFile(const char *, BOOL, BOOL) | CvsProject |
FindProject(int) | CvsProject | [static]
getErrorMessage(int, CvsString &) | CvsProject |
getFileChanges(CvsString &) | CvsProject |
getFilesToAdd(CvsString &) | CvsProject |
getLastError() | CvsProject | [inline]
getProject(const char *, const char *, const char *, BOOL, BOOL, BOOL &) | CvsProject |
getProjectHandle() | CvsProject | [inline]
getProjectHome() | CvsProject | [inline]
getProjectName() | CvsProject | [inline]
hasAdvancedOptionsForCommand(CvsCommand, BOOL &) | CvsProject |
isFileDifferent(const char *, CvsOption, BOOL &) | CvsProject |
m_hProject | CvsProject | [protected]
m_iLastError | CvsProject | [protected]
m_pNextProject | CvsProject | [protected]
m_sProjectHome | CvsProject | [protected]
m_sProjectName | CvsProject | [protected]
m_sUsername | CvsProject | [protected]
openProject(const char *, const char *, const char *) | CvsProject |
removeFiles(CvsFilenames &) | CvsProject |
renameFile(const char *, const char *) | CvsProject |
showAdvancedOptionsForCommand(CvsCommand) | CvsProject |
showFileHistory(CvsFilenames &) | CvsProject |
showFileProperties(const char *) | CvsProject |
showUserInterface(CvsFilenames &) | CvsProject |
uncheckoutFiles(CvsFilenames &) | CvsProject |
updateFiles(CvsFilenames &, BOOL, BOOL) | CvsProject |
~CvsProject() | CvsProject |
Generated on Sun Feb 24 01:28:42 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CvsString Member List

This is the complete list of members for CvsString, including all inherited members.
CvsString() | CvsString | [inline]
CvsString(const char *s) | CvsString | [inline]
CvsString(const CvsString &s) | CvsString | [inline]
getBuffer() | CvsString | [inline]
getBufferMax() const | CvsString | [inline]
m_cbBufferMax | CvsString | [protected]
m_sBuffer | CvsString | [protected]
operator const char *() const | CvsString | [inline]
operator+(const char *s) const | CvsString | [inline]
operator+=(const char *s) | CvsString | [inline]
operator=(const char *s) | CvsString | [inline]
operator=(const CvsString &s) | CvsString | [inline]
operator==(const char *s) const | CvsString | [inline]
operator[](int i) | CvsString | [inline]
recycle(char *, int) | CvsString | [protected, static]
requireSize(int) | CvsString | [inline]
resize(int) | CvsString | [protected]
strcat(const char *) | CvsString | [inline]
strcpy(const char *) | CvsString | [inline]
strlen() const | CvsString | [inline]
strncpy(const char *, int) | CvsString | [inline]
~CvsString() | CvsString |
Generated on Sun Feb 24 01:28:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CvsTrace Member List

This is the complete list of members for CvsTrace, including all inherited members.
CvsTrace(const char *) | CvsTrace |
m_sOuter | CvsTrace | [private]
~CvsTrace() | CvsTrace |
Generated on Sun Feb 24 01:28:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCustInvertTable Member List

This is the complete list of members for CCustInvertTable, including all inherited members.
CCustInvertTable() | CCustInvertTable |
Initialize() | CCustInvertTable |
m_garbage | CCustInvertTable | [protected]
~CCustInvertTable() | CCustInvertTable | [virtual]
Generated on Sun Feb 24 01:25:27 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CustInvertTable Member List

This is the complete list of members for CustInvertTable, including all inherited members.
cmd | CustInvertTable
key | CustInvertTable
title | CustInvertTable
Generated on Sun Feb 24 01:28:33 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CMMenuString Member List

This is the complete list of members for CMMenuString, including all inherited members.
_GetBaseClass() | CPersistent | [protected, static]
classCPersistent | CPersistent | [protected, static]
classUObject | UObject | [protected, static]
CMMenuString(unsigned int maxstr, const char *uniqueName, char *const *defaultStr=0L) | CMMenuString |
CPersistent(const char *uniqueName, kClassPersistent pclass) | CPersistent |
CreateObject(const char *className) | UObject | [static]
fAllEntries | CPersistent | [protected, static]
fAllStrs | CMMenuString | [protected]
fBuf | CMMenuString | [protected]
Find(const char *uniqueName) | CPersistent | [static]
fMaxStr | CMMenuString | [protected]
fTimeStamp | CPersistent | [protected]
GetData(void) const | CMMenuString | [virtual]
GetList(void) const | CMMenuString | [inline]
GetList(void) | CMMenuString | [inline]
GetRuntimeClass() const | CPersistent | [virtual]
GetTimeStamp() const | CPersistent | [inline]
Insert(const char *newstr) | CMMenuString |
IsKindOf(const URuntimeClass *pClass) const | UObject |
LoadAll(void) | CPersistent | [static]
NeedSave(bool onlySettings=false) | CPersistent | [static]
ResetTimeStamp() | CPersistent | [inline]
rtCPersistent(void) | CPersistent | [static]
rtUObject() | UObject | [static]
SaveAll(void) | CPersistent | [static]
SaveAllSettings(const char *settingFileName, const char *forPath) | CPersistent | [static]
SetData(const void *ptr, unsigned int size) | CMMenuString | [virtual]
SizeOf(void) const | CMMenuString | [virtual]
TouchTimeStamp() | CPersistent | [inline]
UObject() | UObject | [inline, protected]
~CMMenuString() | CMMenuString | [virtual]
~CPersistent() | CPersistent | [virtual]
~UObject() | UObject | [inline, virtual]
Generated on Sun Feb 24 01:26:57 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCustomizeMenus Member List

This is the complete list of members for CCustomizeMenus, including all inherited members.
CCustomizeMenus(CMMenuString *fromMenu, CWnd *pParent=NULL) | CCustomizeMenus |
DoDataExchange(CDataExchange *pDX) | CCustomizeMenus | [protected, virtual]
GetIcon(const CustInvertTable *entry) | CCustomizeMenus | [protected]
IDD enum value | CCustomizeMenus |
m_addbtn | CCustomizeMenus |
m_cmdsList | CCustomizeMenus |
m_downbtn | CCustomizeMenus |
m_Menu | CCustomizeMenus | [protected]
m_menuList | CCustomizeMenus |
m_removebtn | CCustomizeMenus |
m_SmallImageList | CCustomizeMenus | [protected]
m_upbtn | CCustomizeMenus |
OnAdd() | CCustomizeMenus | [protected]
OnBegindragMenulist(NMHDR *pNMHDR, LRESULT *pResult) | CCustomizeMenus | [protected]
OnDblclkAllcmds(NMHDR *pNMHDR, LRESULT *pResult) | CCustomizeMenus | [protected]
OnDblclkMenulist(NMHDR *pNMHDR, LRESULT *pResult) | CCustomizeMenus | [protected]
OnDown() | CCustomizeMenus | [protected]
OnInitDialog() | CCustomizeMenus | [protected, virtual]
OnItemchangedAllcmds(NMHDR *pNMHDR, LRESULT *pResult) | CCustomizeMenus | [protected]
OnItemchangedMenulist(NMHDR *pNMHDR, LRESULT *pResult) | CCustomizeMenus | [protected]
OnMove(int offset) | CCustomizeMenus | [protected]
OnOK() | CCustomizeMenus | [protected, virtual]
OnRemove() | CCustomizeMenus | [protected]
OnUp() | CCustomizeMenus | [protected]
Generated on Sun Feb 24 01:25:28 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCvsStatusBar Member List

This is the complete list of members for CCvsStatusBar, including all inherited members.
CCvsStatusBar() | CCvsStatusBar |
DrawItem(LPDRAWITEMSTRUCT) | CCvsStatusBar | [virtual]
m_indic | CCvsStatusBar | [protected]
m_settimer | CCvsStatusBar | [protected]
m_step | CCvsStatusBar | [protected]
OnTimer(UINT nIDEvent) | CCvsStatusBar | [protected]
~CCvsStatusBar() | CCvsStatusBar | [virtual]
Generated on Sun Feb 24 01:25:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CMyShellTree Member List

This is the complete list of members for CMyShellTree, including all inherited members.
DisableCommon() | CMyShellTree | [protected]
OnDeleteitem(NMHDR *pNMHDR, LRESULT *pResult) | CMyShellTree | [protected]
OnItemexpanding(NMHDR *pNMHDR, LRESULT *pResult) | CMyShellTree | [protected]
OnRclick(NMHDR *pNMHDR, LRESULT *pResult) | CMyShellTree | [protected]
OnSelchanged(NMHDR *pNMHDR, LRESULT *pResult) | CMyShellTree | [protected]
Generated on Sun Feb 24 01:27:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CExploreBar Member List

This is the complete list of members for CExploreBar, including all inherited members.
CExploreBar() | CExploreBar | [protected]
Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID, CCreateContext *pContext=NULL) | CExploreBar | [virtual]
DisableCommon() | CExploreBar | [protected]
m_TreeCtrl | CExploreBar |
OnDraw(CDC *pDC) | CExploreBar | [protected, virtual]
OnUpdateCmd(CCmdUI *pCmdUI) | CExploreBar | [protected]
OnUpdateViewCheckout(CCmdUI *pCmdUI) | CExploreBar | [protected]
OnUpdateViewImport(CCmdUI *pCmdUI) | CExploreBar | [protected]
OnViewCheckout() | CExploreBar | [protected]
OnViewImport() | CExploreBar | [protected]
OnWindowPosChanged(WINDOWPOS FAR *lpwndpos) | CExploreBar | [protected]
~CExploreBar() | CExploreBar | [protected, virtual]
Generated on Sun Feb 24 01:25:55 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

KoWatcher Member List

This is the complete list of members for KoWatcher, including all inherited members.
DelegateRun(LPVOID p) | KoWatcher | [inline, private, static]
KoWatcher(HWND hWnd) | KoWatcher | [inline]
m_count | KoWatcher | [private]
m_eventStartWatching | KoWatcher | [private]
m_eventTerminate | KoWatcher | [private]
m_handles | KoWatcher | [private]
m_hWnd | KoWatcher | [private]
m_isRecursive | KoWatcher | [private]
m_path | KoWatcher | [private]
m_section | KoWatcher | [private]
Run() | KoWatcher | [private]
SignalStartWatch(LPCTSTR path, bool isRecursive) | KoWatcher | [inline]
SignalTerminate() | KoWatcher | [inline]
StartWatch() | KoWatcher | [private]
StopWatch() | KoWatcher | [private]
WM_FILECHANGE enum value | KoWatcher |
~KoWatcher() | KoWatcher | [inline, private]
Generated on Sun Feb 24 01:26:38 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CGraphDoc Member List

This is the complete list of members for CGraphDoc, including all inherited members.
CGraphDoc() | CGraphDoc | [protected]
fData | CGraphDoc | [protected]
fDir | CGraphDoc | [protected]
fName | CGraphDoc | [protected]
fNode | CGraphDoc | [protected]
GetDir(void) const | CGraphDoc | [inline]
GetEntryInfo(void) | CGraphDoc | [inline]
GetName(void) const | CGraphDoc | [inline]
GetNode(void) | CGraphDoc | [inline]
GetTreeView(void) | CGraphDoc |
NumNodes() | CGraphDoc | [protected]
OnNewDocument() | CGraphDoc | [virtual]
PrepareNew(void) | CGraphDoc | [protected]
Serialize(CArchive &ar) | CGraphDoc | [virtual]
SetNode(CLogNode *node, const char *dir) | CGraphDoc |
~CGraphDoc() | CGraphDoc | [virtual]
Generated on Sun Feb 24 01:26:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CGraphFrame Member List

This is the complete list of members for CGraphFrame, including all inherited members.
brdrAllRaised enum value | CCJMDIChildWnd | [protected]
brdrFlatAll enum value | CCJMDIChildWnd | [protected]
brdrFlatBottom enum value | CCJMDIChildWnd | [protected]
brdrFlatHorizontal enum value | CCJMDIChildWnd | [protected]
brdrFlatLeft enum value | CCJMDIChildWnd | [protected]
brdrFlatRight enum value | CCJMDIChildWnd | [protected]
brdrFlatTop enum value | CCJMDIChildWnd | [protected]
brdrFlatVertical enum value | CCJMDIChildWnd | [protected]
CCJMDIChildWnd() | CCJMDIChildWnd |
CGraphFrame() | CGraphFrame |
DockControlBarLeftOf(CControlBar *Bar, CControlBar *LeftOf) | CCJMDIChildWnd | [protected, virtual]
DockFlatBorders enum name | CCJMDIChildWnd | [protected]
DockSizeBar(CControlBar *pBar, CCJSizeDockBar *pDockBar=NULL, LPRECT lpRect=NULL) | CCJMDIChildWnd | [protected, virtual]
dwDockBarMap | CCJMDIChildWnd | [protected, static]
EnableDocking(DWORD dwDockStyle) | CCJMDIChildWnd | [protected, virtual]
EnableDockingSizeBar(DWORD dwDockStyle, DockFlatBorders FlatFlags=brdrAllRaised) | CCJMDIChildWnd | [protected, virtual]
GetInitializedMenu(UINT nMenuID, UINT nToolBarID) | CCJMDIChildWnd | [virtual]
GetInitializedMenu(UINT nMenuID, UINT *nToolbarIDs, int nSize) | CCJMDIChildWnd | [virtual]
GetMenuID() | CCJMDIChildWnd | [virtual]
GetToolBarID() | CCJMDIChildWnd | [virtual]
GetToolBarIDs(int &nCount) | CCJMDIChildWnd | [virtual]
m_hMenu | CCJMDIChildWnd | [protected]
m_nCount | CCJMDIChildWnd | [protected]
m_nMenuID | CCJMDIChildWnd | [protected]
m_nToolBarID | CCJMDIChildWnd | [protected]
m_nToolBarIDs | CCJMDIChildWnd | [protected]
OnCmdMsg(UINT nID, int nCode, void *pExtra, AFX_CMDHANDLERINFO *pHandlerInfo) | CGraphFrame | [virtual]
OnEraseBkgnd(CDC *pDC) | CCJMDIChildWnd | [protected]
RecalcAllExcept(CCJSizeDockBar *pBar) | CCJMDIChildWnd | [protected, virtual]
RecalcLayout(BOOL bNotify=TRUE) | CCJMDIChildWnd | [virtual]
SetResourceIDs(UINT nMenuID, UINT nToolBarID) | CCJMDIChildWnd | [virtual]
SetResourceIDs(UINT nMenuID, UINT *nToolBarIDs, int nCount) | CCJMDIChildWnd | [virtual]
~CCJMDIChildWnd() | CCJMDIChildWnd | [virtual]
~CGraphFrame() | CGraphFrame | [virtual]
Generated on Sun Feb 24 01:26:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CGraphRectTracker Member List

This is the complete list of members for CGraphRectTracker, including all inherited members.
CGraphRectTracker(CGraphView *view) | CGraphRectTracker | [inline]
mView | CGraphRectTracker | [protected]
OnChangedRect(const CRect &rectOld) | CGraphRectTracker | [virtual]
Generated on Sun Feb 24 01:26:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TGraph Member List

This is the complete list of members for TGraph, including all inherited members.
TraverseGraph(CLogNode *node) | TGraph |
TraverseNode(CLogNode *node)=0 | TGraph | [pure virtual]
Generated on Sun Feb 24 01:28:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TGraphRectSelect Member List

This is the complete list of members for TGraphRectSelect, including all inherited members.
mR | TGraphRectSelect | [protected]
mShiftOn | TGraphRectSelect | [protected]
mView | TGraphRectSelect | [protected]
TGraphRectSelect(bool shiftOn, CGraphView *view, CRect &r) | TGraphRectSelect | [inline]
TraverseGraph(CLogNode *node) | TGraph |
TraverseNode(CLogNode *node) | TGraphRectSelect | [inline, virtual]
Generated on Sun Feb 24 01:28:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TGraphCmdStatus Member List

This is the complete list of members for TGraphCmdStatus, including all inherited members.
fCountSel | TGraphCmdStatus |
fSel1 | TGraphCmdStatus |
fSel2 | TGraphCmdStatus |
TGraphCmdStatus() | TGraphCmdStatus | [inline]
TraverseGraph(CLogNode *node) | TGraph |
TraverseNode(CLogNode *node) | TGraphCmdStatus | [inline, virtual]
Generated on Sun Feb 24 01:28:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CGraphConsole Member List

This is the complete list of members for CGraphConsole, including all inherited members.
CGraphConsole() | CGraphConsole | [inline]
cvs_err(char *txt, long len) | CGraphConsole | [inline, virtual]
cvs_out(char *txt, long len) | CGraphConsole | [inline, virtual]
view | CGraphConsole |
Generated on Sun Feb 24 01:26:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TGraphDelCmd Member List

This is the complete list of members for TGraphDelCmd, including all inherited members.
fAllRevs | TGraphDelCmd |
fCountSel | TGraphDelCmd |
fOnlyRev | TGraphDelCmd |
TGraphDelCmd() | TGraphDelCmd | [inline]
TraverseGraph(CLogNode *node) | TGraph |
TraverseNode(CLogNode *node) | TGraphDelCmd | [inline, virtual]
Generated on Sun Feb 24 01:28:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

TGraphSelNonSig Member List

This is the complete list of members for TGraphSelNonSig, including all inherited members.
fView | TGraphSelNonSig |
TGraphSelNonSig(CGraphView *view) | TGraphSelNonSig | [inline]
TraverseGraph(CLogNode *node) | TGraph |
TraverseNode(CLogNode *node) | TGraphSelNonSig | [inline, virtual]
Generated on Sun Feb 24 01:28:11 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CRevisionConsole Member List

This is the complete list of members for CRevisionConsole, including all inherited members.
CRevisionConsole() | CRevisionConsole | [inline]
cvs_err(char *txt, long len) | CRevisionConsole | [inline, virtual]
cvs_out(char *txt, long len) | CRevisionConsole | [inline, virtual]
fOut | CRevisionConsole | [protected]
init(LPCTSTR path, LPCTSTR fname) | CRevisionConsole | [inline]
~CRevisionConsole() | CRevisionConsole | [inline]
Generated on Sun Feb 24 01:27:40 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CGraphView Member List

This is the complete list of members for CGraphView, including all inherited members.
CalcImageSize(void) | CGraphView |
CGraphView() | CGraphView | [protected]
DisableCommon() | CGraphView | [protected]
DisableUpdate(CCmdUI *pCmdUI) | CGraphView | [protected]
fFirstTime | CGraphView | [protected]
GetDeviceScrollPosition() | CScrollView | [inline]
GetImgList(void) | CGraphView | [inline, static]
InvalidateRect(const URECT *r) | CScrollView | [inline]
IsSelSingleNode(kLogNode type, bool equal=true) | CGraphView | [protected]
m_ImageList | CGraphView | [protected, static]
m_numberOfPages | CGraphView | [protected]
m_pageHeight | CGraphView | [protected]
OnBeginPrinting(CDC *pDC, CPrintInfo *pInfo) | CGraphView | [protected, virtual]
OnContextMenu(CWnd *pWnd, CPoint point) | CGraphView | [protected]
OnDraw(CDC *pDC) | CGraphView | [protected, virtual]
OnEndPrinting(CDC *pDC, CPrintInfo *pInfo) | CGraphView | [protected, virtual]
OnGraphChangelogmessage() | CGraphView | [protected]
OnGraphGraphoptions() | CGraphView | [protected]
OnGraphSetdescription() | CGraphView | [protected]
OnGraphSetstate() | CGraphView | [protected]
OnInitialUpdate() | CGraphView | [protected, virtual]
OnInitMenuPopup(CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu) | CGraphView | [protected]
OnLButtonDown(UINT nFlags, CPoint point) | CGraphView | [protected]
OnPreparePrinting(CPrintInfo *pInfo) | CGraphView | [protected, virtual]
OnPrint(CDC *pDC, CPrintInfo *pInfo) | CGraphView | [protected, virtual]
OnQueryAnnotate() | CGraphView | [protected]
OnUpdateGraphChangelogmessage(CCmdUI *pCmdUI) | CGraphView | [protected]
OnUpdateGraphSetdescription(CCmdUI *pCmdUI) | CGraphView | [protected]
OnUpdateGraphSetstate(CCmdUI *pCmdUI) | CGraphView | [protected]
OnUpdateQueryAnnotate(CCmdUI *pCmdUI) | CGraphView | [protected]
OnUpdateViewDelrev(CCmdUI *pCmdUI) | CGraphView | [protected]
OnUpdateViewDiff(CCmdUI *pCmdUI) | CGraphView | [protected]
OnUpdateViewReload(CCmdUI *pCmdUI) | CGraphView | [protected]
OnUpdateViewRetrieve(CCmdUI *pCmdUI) | CGraphView | [protected]
OnUpdateViewSelnonsig(CCmdUI *pCmdUI) | CGraphView | [protected]
OnUpdateViewTag(CCmdUI *pCmdUI) | CGraphView | [protected]
OnUpdateViewUnlockf(CCmdUI *pCmdUI) | CGraphView | [protected]
OnUpdateViewUpdate(CCmdUI *pCmdUI) | CGraphView | [protected]
OnViewDelrev() | CGraphView | [protected]
OnViewDiff() | CGraphView | [protected]
OnViewReload() | CGraphView | [protected]
OnViewRetrieve() | CGraphView | [protected]
OnViewSelnonsig() | CGraphView | [protected]
OnViewTag() | CGraphView | [protected]
OnViewUnlockf() | CGraphView | [protected]
OnViewUpdate() | CGraphView | [protected]
~CGraphView() | CGraphView | [protected, virtual]
Generated on Sun Feb 24 01:26:14 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CHistComboBoxEx Member List

This is the complete list of members for CHistComboBoxEx, including all inherited members.
AddString(LPCTSTR lpszString) | CHistComboBoxEx |
AutoDropWidth enum value | USmartCombo |
CalcDroppedWidth() | CHistComboBoxEx | [private, virtual]
CHistComboBoxEx(int feature=USmartCombo::DefaultFeature) | CHistComboBoxEx |
DefaultFeature enum value | USmartCombo |
DelKeyTest(MSG *pMsg) | CHistComboBoxEx | [private]
Feature enum name | USmartCombo |
FindBestRoot(CMString &strItems, const char *path, bool mustExist=false) | CHistComboBoxEx | [static]
GetItems() | USmartCombo |
GetOldLoc() | CHistComboBoxEx |
HasFeature(int feature) const | USmartCombo |
InsertString(int nIndex, LPCTSTR lpszString) | CHistComboBoxEx |
m_ImageList | CHistComboBoxEx | [private]
NewRoot(const char *root) | CHistComboBoxEx |
None enum value | USmartCombo |
OnDropdown() | CHistComboBoxEx | [protected]
PreTranslateMessage(MSG *pMsg) | CHistComboBoxEx | [virtual]
ReadOnly enum value | USmartCombo |
RemoveItem(const char *strItem) | USmartCombo | [virtual]
RemoveItems enum value | USmartCombo |
SetFeature(int feature) | USmartCombo |
SetIcon(COMBOBOXEXITEM cbi) | CHistComboBoxEx |
SetItems(CMString *pstrItems) | USmartCombo |
SetReadOnly(bool readOnly=true) | USmartCombo | [virtual]
USmartCombo(int feature) | USmartCombo |
~CHistComboBoxEx() | CHistComboBoxEx | [virtual]
~USmartCombo() | USmartCombo | [virtual]
Generated on Sun Feb 24 01:26:15 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CLogFrame Member List

This is the complete list of members for CLogFrame, including all inherited members.
brdrAllRaised enum value | CCJMDIChildWnd | [protected]
brdrFlatAll enum value | CCJMDIChildWnd | [protected]
brdrFlatBottom enum value | CCJMDIChildWnd | [protected]
brdrFlatHorizontal enum value | CCJMDIChildWnd | [protected]
brdrFlatLeft enum value | CCJMDIChildWnd | [protected]
brdrFlatRight enum value | CCJMDIChildWnd | [protected]
brdrFlatTop enum value | CCJMDIChildWnd | [protected]
brdrFlatVertical enum value | CCJMDIChildWnd | [protected]
CCJMDIChildWnd() | CCJMDIChildWnd |
CLogFrame() | CLogFrame |
DockControlBarLeftOf(CControlBar *Bar, CControlBar *LeftOf) | CCJMDIChildWnd | [protected, virtual]
DockFlatBorders enum name | CCJMDIChildWnd | [protected]
DockSizeBar(CControlBar *pBar, CCJSizeDockBar *pDockBar=NULL, LPRECT lpRect=NULL) | CCJMDIChildWnd | [protected, virtual]
dwDockBarMap | CCJMDIChildWnd | [protected, static]
EnableDocking(DWORD dwDockStyle) | CCJMDIChildWnd | [protected, virtual]
EnableDockingSizeBar(DWORD dwDockStyle, DockFlatBorders FlatFlags=brdrAllRaised) | CCJMDIChildWnd | [protected, virtual]
GetInitializedMenu(UINT nMenuID, UINT nToolBarID) | CCJMDIChildWnd | [virtual]
GetInitializedMenu(UINT nMenuID, UINT *nToolbarIDs, int nSize) | CCJMDIChildWnd | [virtual]
GetMenuID() | CCJMDIChildWnd | [virtual]
GetToolBarID() | CCJMDIChildWnd | [virtual]
GetToolBarIDs(int &nCount) | CCJMDIChildWnd | [virtual]
m_hMenu | CCJMDIChildWnd | [protected]
m_nCount | CCJMDIChildWnd | [protected]
m_nMenuID | CCJMDIChildWnd | [protected]
m_nToolBarID | CCJMDIChildWnd | [protected]
m_nToolBarIDs | CCJMDIChildWnd | [protected]
OnClose() | CLogFrame | [protected]
OnCmdMsg(UINT nID, int nCode, void *pExtra, AFX_CMDHANDLERINFO *pHandlerInfo) | CLogFrame | [virtual]
OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext *pContext) | CLogFrame | [virtual]
OnEraseBkgnd(CDC *pDC) | CCJMDIChildWnd | [protected]
PreTranslateMessage(MSG *pMsg) | CLogFrame | [virtual]
RecalcAllExcept(CCJSizeDockBar *pBar) | CCJMDIChildWnd | [protected, virtual]
RecalcLayout(BOOL bNotify=TRUE) | CCJMDIChildWnd | [virtual]
SetResourceIDs(UINT nMenuID, UINT nToolBarID) | CCJMDIChildWnd | [virtual]
SetResourceIDs(UINT nMenuID, UINT *nToolBarIDs, int nCount) | CCJMDIChildWnd | [virtual]
~CCJMDIChildWnd() | CCJMDIChildWnd | [virtual]
~CLogFrame() | CLogFrame | [virtual]
Generated on Sun Feb 24 01:26:43 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CWinPlacement Member List

This is the complete list of members for CWinPlacement, including all inherited members.
_GetBaseClass() | CPersistent | [protected, static]
classCPersistent | CPersistent | [protected, static]
classUObject | UObject | [protected, static]
CPersistent(const char *uniqueName, kClassPersistent pclass) | CPersistent |
CreateObject(const char *className) | UObject | [static]
CWinPlacement(const char *uniqueName) | CWinPlacement | [inline]
fAllEntries | CPersistent | [protected, static]
Find(const char *uniqueName) | CPersistent | [static]
fTimeStamp | CPersistent | [protected]
GetData(void) const | CWinPlacement | [inline, virtual]
GetRuntimeClass() const | CPersistent | [virtual]
GetTimeStamp() const | CPersistent | [inline]
hasOne | CWinPlacement |
IsKindOf(const URuntimeClass *pClass) const | UObject |
LoadAll(void) | CPersistent | [static]
NeedSave(bool onlySettings=false) | CPersistent | [static]
operator=(const WINDOWPLACEMENT &newplace) | CWinPlacement | [inline]
placement | CWinPlacement |
ResetTimeStamp() | CPersistent | [inline]
rtCPersistent(void) | CPersistent | [static]
rtUObject() | UObject | [static]
SaveAll(void) | CPersistent | [static]
SaveAllSettings(const char *settingFileName, const char *forPath) | CPersistent | [static]
SetData(const void *ptr, unsigned int size) | CWinPlacement | [inline, virtual]
SizeOf(void) const | CWinPlacement | [inline, virtual]
TouchTimeStamp() | CPersistent | [inline]
UObject() | UObject | [inline, protected]
~CPersistent() | CPersistent | [virtual]
~CWinPlacement() | CWinPlacement | [inline, virtual]
~UObject() | UObject | [inline, virtual]
Generated on Sun Feb 24 01:29:08 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CMainFrame Member List

This is the complete list of members for CMainFrame, including all inherited members.
brdrAllRaised enum value | CCJMDIFrameWnd | [protected]
brdrFlatAll enum value | CCJMDIFrameWnd | [protected]
brdrFlatBottom enum value | CCJMDIFrameWnd | [protected]
brdrFlatHorizontal enum value | CCJMDIFrameWnd | [protected]
brdrFlatLeft enum value | CCJMDIFrameWnd | [protected]
brdrFlatRight enum value | CCJMDIFrameWnd | [protected]
brdrFlatTop enum value | CCJMDIFrameWnd | [protected]
brdrFlatVertical enum value | CCJMDIFrameWnd | [protected]
CCJMDIFrameWnd() | CCJMDIFrameWnd |
ChangeLocation() | CMainFrame |
CMainFrame() | CMainFrame |
DockControlBarLeftOf(CToolBar *Bar, CToolBar *LeftOf) | CMainFrame | [protected]
CCJMDIFrameWnd::DockControlBarLeftOf(CControlBar *Bar, CControlBar *LeftOf) | CCJMDIFrameWnd | [virtual]
DockFlatBorders enum name | CCJMDIFrameWnd | [protected]
DockSizeBar(CControlBar *pBar, CCJSizeDockBar *pDockBar=NULL, LPRECT lpRect=NULL) | CCJMDIFrameWnd | [virtual]
DropFiles(HDROP hDropInfo) | CMainFrame |
dwDockBarMap | CCJMDIFrameWnd | [protected, static]
EnableDocking(DWORD dwDockStyle) | CCJMDIFrameWnd | [virtual]
EnableDockingSizeBar(DWORD dwDockStyle, DockFlatBorders FlatFlags=brdrAllRaised) | CCJMDIFrameWnd | [virtual]
FreshenFileMask() | CMainFrame | [protected]
GetBrowseHistory(void) | CMainFrame | [inline]
GetBrowserView() | CMainFrame |
GetConsoleView() | CMainFrame | [inline]
GetEnvMainThread(const char *name) | CMainFrame |
GetExplorerView() | CMainFrame |
GetFilterModel() | CMainFrame | [inline]
GetIgnoreModel() | CMainFrame | [inline]
GetMenuList(void) | CMainFrame | [inline]
GetRecursionModel() | CMainFrame | [inline]
GetStatusBar() | CMainFrame | [inline]
GetWorkspace() | CMainFrame | [inline]
InitializeDockingWindows() | CMainFrame | [protected]
InitializeMenu(CMultiDocTemplate *pDocTemplate, UINT nMenuID, UINT *nToolbarIDs=NULL, int nSize=0, UINT nDefaultMenuID=NULL) | CCJMDIFrameWnd | [virtual]
InitializeMenu(CMultiDocTemplate *pDocTemplate, UINT nMenuID, UINT nToolbarID=NULL, UINT nDefaultMenuID=NULL) | CCJMDIFrameWnd | [virtual]
InitializeMenu(HMENU *phMenu, UINT nMenuID, UINT nToolbarID=NULL) | CCJMDIFrameWnd | [virtual]
InitializeMenu(HMENU *phMenu, UINT nMenuID, UINT *nToolbarIDs=NULL, int nSize=NULL) | CCJMDIFrameWnd | [virtual]
InitialShowWindow(int nCmdShow) | CMainFrame |
LoadBarState(LPCTSTR lpszProfileName) | CCJMDIFrameWnd | [virtual]
m_bRestoreFocus | CMainFrame | [private]
m_browseHist | CMainFrame | [protected]
m_comboFilterMask | CMainFrame | [protected]
m_consolebar | CMainFrame | [protected]
m_filter | CMainFrame | [protected]
m_fontNormal | CMainFrame | [protected]
m_ignore | CMainFrame | [protected]
m_menuList | CCJMDIFrameWnd | [protected]
m_recursion | CMainFrame | [protected]
m_state | CMainFrame | [protected]
m_TabImages | CMainFrame | [protected]
m_wndBrowser | CMainFrame | [protected]
m_wndFilter | CMainFrame | [protected]
m_wndList | CMainFrame | [protected]
m_wndMenuBar | CCJMDIFrameWnd | [protected]
m_wndMultiUser | CMainFrame | [protected]
m_wndStatusBar | CMainFrame | [protected]
m_wndTags | CMainFrame | [protected]
m_wndToolBar | CMainFrame | [protected]
m_wndWorkspace | CMainFrame | [protected]
NewMenu(UINT nMenuID, UINT *nToolbarIDs=NULL, int nSize=0) | CCJMDIFrameWnd | [protected, virtual]
NewMenu(UINT nMenuID, UINT nToolbarID=NULL) | CCJMDIFrameWnd | [protected, virtual]
OnActivate(UINT nState, CWnd *pWndOther, BOOL bMinimized) | CMainFrame | [protected]
OnBroadcastCmdMsg(UINT nID, int nCode, void *pExtra, AFX_CMDHANDLERINFO *pHandlerInfo) | CMainFrame |
OnClose() | CMainFrame | [protected]
OnCreate(LPCREATESTRUCT lpCreateStruct) | CMainFrame | [protected]
OnDropFiles(HDROP hDropInfo) | CMainFrame | [protected]
OnFilterMaskEntered() | CMainFrame |
OnHistorySelect() | CMainFrame | [protected]
OnInitMenu(CMenu *pMenu) | CMainFrame | [protected]
OnInitMenuPopup(CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu) | CCJMDIFrameWnd | [protected]
OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct) | CCJMDIFrameWnd | [protected]
OnMenuChar(UINT nChar, UINT nFlags, CMenu *pMenu) | CCJMDIFrameWnd | [protected]
OnSysCommand(UINT nID, LPARAM lParam) | CMainFrame | [protected]
OnTimer(UINT nIDEvent) | CMainFrame | [protected]
OnUpdateFilterMask(CCmdUI *pCmdUI) | CMainFrame | [protected]
OnUpdateHistory(CCmdUI *pCmdUI) | CMainFrame | [protected]
OnUpdateViewAdded(CCmdUI *pCmdUI) | CMainFrame | [protected]
OnUpdateViewChanged(CCmdUI *pCmdUI) | CMainFrame | [protected]
OnUpdateViewConflict(CCmdUI *pCmdUI) | CMainFrame | [protected]
OnUpdateViewHideunknown(CCmdUI *pCmdUI) | CMainFrame | [protected]
OnUpdateViewIgnore(CCmdUI *pCmdUI) | CMainFrame | [protected]
OnUpdateViewMissing(CCmdUI *pCmdUI) | CMainFrame | [protected]
OnUpdateViewModified(CCmdUI *pCmdUI) | CMainFrame | [protected]
OnUpdateViewRecursive(CCmdUI *pCmdUI) | CMainFrame | [protected]
OnUpdateViewRemoved(CCmdUI *pCmdUI) | CMainFrame | [protected]
OnUpdateViewUnknown(CCmdUI *pCmdUI) | CMainFrame | [protected]
OnViewAdded() | CMainFrame | [protected]
OnViewChanged() | CMainFrame | [protected]
OnViewConflict() | CMainFrame | [protected]
OnViewHideunknown() | CMainFrame | [protected]
OnViewIgnore() | CMainFrame | [protected]
OnViewMissing() | CMainFrame | [protected]
OnViewModified() | CMainFrame | [protected]
OnViewRecursive() | CMainFrame | [protected]
OnViewRemoved() | CMainFrame | [protected]
OnViewUnknown() | CMainFrame | [protected]
PreCreateWindow(CREATESTRUCT &cs) | CMainFrame | [virtual]
CCJMDIFrameWnd::PreCreateWindow(CREATESTRUCT &cs, UINT nIconID) | CCJMDIFrameWnd | [protected, virtual]
RecalcAllExcept(CCJSizeDockBar *pBar) | CCJMDIFrameWnd | [virtual]
RecalcLayout(BOOL bNotify=TRUE) | CCJMDIFrameWnd | [virtual]
SaveBarState(LPCTSTR lpszProfileName) const | CCJMDIFrameWnd | [virtual]
~CCJMDIFrameWnd() | CCJMDIFrameWnd | [virtual]
~CMainFrame() | CMainFrame | [virtual]
Generated on Sun Feb 24 01:26:53 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

direct Member List

This is the complete list of members for direct, including all inherited members.
d_ino | direct
d_name | direct
d_namlen | direct
d_reclen | direct
Generated on Sun Feb 24 01:25:48 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

_dircontents Member List

This is the complete list of members for _dircontents, including all inherited members.
_d_entry | _dircontents
_d_next | _dircontents
Generated on Sun Feb 24 01:24:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

_dirdesc Member List

This is the complete list of members for _dirdesc, including all inherited members.
dd_contents | _dirdesc
dd_cp | _dirdesc
dd_id | _dirdesc
dd_loc | _dirdesc
Generated on Sun Feb 24 01:24:06 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CNoPython Member List

This is the complete list of members for CNoPython, including all inherited members.
CNoPython(CWnd *pParent=NULL) | CNoPython |
DoDataExchange(CDataExchange *pDX) | CNoPython | [protected, virtual]
IDD enum value | CNoPython |
m_remind | CNoPython |
m_url | CNoPython |
OnInitDialog() | CNoPython | [protected, virtual]
Generated on Sun Feb 24 01:27:01 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CProgress Member List

This is the complete list of members for CProgress, including all inherited members.
CProgress(bool interruptable, const char *title=0L) | CProgress |
DoAbort(void) | CProgress |
HasAborted(void) const | CProgress | [inline]
m_abort | CProgress | [protected]
m_dlg | CProgress | [protected]
SetProgress(int percent) | CProgress |
~CProgress() | CProgress |
Generated on Sun Feb 24 01:27:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CProgressDialog Member List

This is the complete list of members for CProgressDialog, including all inherited members.
CProgressDialog(bool &abort, bool interruptable, CWnd *pParent=NULL) | CProgressDialog |
Create() | CProgressDialog |
DoDataExchange(CDataExchange *pDX) | CProgressDialog | [protected, virtual]
hWndParent | CProgressDialog | [protected]
IDD enum value | CProgressDialog |
m_abort | CProgressDialog | [protected]
m_pParent | CProgressDialog | [protected]
m_progress | CProgressDialog |
m_stopable | CProgressDialog | [protected]
OnInitDialog() | CProgressDialog | [protected, virtual]
OnOK() | CProgressDialog | [protected, virtual]
PostNcDestroy() | CProgressDialog | [protected, virtual]
Generated on Sun Feb 24 01:27:13 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CSortHeaderCtrl Member List

This is the complete list of members for CSortHeaderCtrl, including all inherited members.
CSortHeaderCtrl() | CSortHeaderCtrl |
DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) | CSortHeaderCtrl | [virtual]
m_bSortAsc | CSortHeaderCtrl | [protected]
m_nSortCol | CSortHeaderCtrl | [protected]
SetSortImage(int nCol, BOOL bAsc) | CSortHeaderCtrl | [virtual]
~CSortHeaderCtrl() | CSortHeaderCtrl | [virtual]
Generated on Sun Feb 24 01:27:49 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CSplashWnd Member List

This is the complete list of members for CSplashWnd, including all inherited members.
c_bShowSplashWnd | CSplashWnd | [protected, static]
c_pSplashWnd | CSplashWnd | [protected, static]
CloseSplashScreen() | CSplashWnd | [static]
Create(CWnd *pParentWnd=NULL) | CSplashWnd | [protected]
CSplashWnd() | CSplashWnd | [protected]
EnableSplashScreen(BOOL bEnable=TRUE) | CSplashWnd | [static]
HideSplashScreen() | CSplashWnd | [protected]
m_bitmap | CSplashWnd |
OnCreate(LPCREATESTRUCT lpCreateStruct) | CSplashWnd | [protected]
OnPaint() | CSplashWnd | [protected]
OnTimer(UINT nIDEvent) | CSplashWnd | [protected]
PostNcDestroy() | CSplashWnd | [virtual]
PreTranslateAppMessage(MSG *pMsg) | CSplashWnd | [static]
ShowSplashScreen(CWnd *pParentWnd=NULL) | CSplashWnd | [static]
~CSplashWnd() | CSplashWnd |
Generated on Sun Feb 24 01:27:51 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCVS_CoworkerModule Member List

This is the complete list of members for CCVS_CoworkerModule, including all inherited members.
dwThreadID | CCVS_CoworkerModule
FindOneOf(LPCTSTR p1, LPCTSTR p2) | CCVS_CoworkerModule
Lock() | CCVS_CoworkerModule
Unlock() | CCVS_CoworkerModule
Generated on Sun Feb 24 01:25:29 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

wnt_stat Member List

This is the complete list of members for wnt_stat, including all inherited members.
st_atime | wnt_stat
st_ctime | wnt_stat
st_dev | wnt_stat
st_gid | wnt_stat
st_ino | wnt_stat
st_mode | wnt_stat
st_mtime | wnt_stat
st_nlink | wnt_stat
st_rdev | wnt_stat
st_size | wnt_stat
st_uid | wnt_stat
Generated on Sun Feb 24 01:29:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CTbEdit Member List

This is the complete list of members for CTbEdit, including all inherited members.
CTbEdit() | CTbEdit |
PreTranslateMessage(MSG *pMsg) | CTbEdit | [virtual]
WM_CONTENTCHANGE enum value | CTbEdit |
~CTbEdit() | CTbEdit | [virtual]
Generated on Sun Feb 24 01:27:58 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CTipDlg Member List

This is the complete list of members for CTipDlg, including all inherited members.
CTipDlg(CWnd *pParent=NULL) | CTipDlg |
DoDataExchange(CDataExchange *pDX) | CTipDlg | [protected, virtual]
GetNextTipString(CString &strNext) | CTipDlg | [protected]
m_bStartup | CTipDlg |
m_pStream | CTipDlg |
m_strTip | CTipDlg |
OnCtlColor(CDC *pDC, CWnd *pWnd, UINT nCtlColor) | CTipDlg | [protected]
OnInitDialog() | CTipDlg | [protected, virtual]
OnNextTip() | CTipDlg | [protected]
OnOK() | CTipDlg | [protected, virtual]
OnPaint() | CTipDlg | [protected]
~CTipDlg() | CTipDlg | [virtual]
Generated on Sun Feb 24 01:28:12 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CToolbarCombo Member List

This is the complete list of members for CToolbarCombo, including all inherited members.
Create(DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID) | CToolbarCombo |
CToolbarCombo() | CToolbarCombo |
GetItemText(int pos, LPTSTR buffer, int count) | CToolbarCombo |
GetManager() | CToolbarCombo | [inline]
GetText() | CToolbarCombo | [inline]
m_edit | CToolbarCombo | [private]
m_manager | CToolbarCombo | [private]
m_text | CToolbarCombo | [private]
OnContentChange(WPARAM wp, LPARAM lp) | CToolbarCombo | [protected]
OnSelendcancel() | CToolbarCombo | [protected]
OnSelendok() | CToolbarCombo | [protected]
ResetText() | CToolbarCombo | [protected]
SetText(const CString &text) | CToolbarCombo | [protected]
~CToolbarCombo() | CToolbarCombo | [virtual]
Generated on Sun Feb 24 01:28:17 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

Win32wstring Member List

This is the complete list of members for Win32wstring, including all inherited members.
convert(unsigned int codepage, const char *s, int inLen) | Win32wstring | [inline, private]
Win32wstring(unsigned int codepage, std::string *s) | Win32wstring | [inline]
Win32wstring(unsigned int codepage, std::string &s) | Win32wstring | [inline]
Generated on Sun Feb 24 01:28:52 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CLogoutThread Member List

This is the complete list of members for CLogoutThread, including all inherited members.
CLogoutThread() | CLogoutThread |
Delete() | CLogoutThread | [virtual]
InitInstance() | CLogoutThread | [protected, virtual]
KillThread(void) | CLogoutThread | [inline]
m_term | CLogoutThread | [protected]
~CLogoutThread() | CLogoutThread | [virtual]
Generated on Sun Feb 24 01:26:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CAboutDlg Member List

This is the complete list of members for CAboutDlg, including all inherited members.
CAboutDlg() | CAboutDlg |
DoDataExchange(CDataExchange *pDX) | CAboutDlg | [protected, virtual]
IDD enum value | CAboutDlg |
m_url | CAboutDlg |
m_vers | CAboutDlg |
OnInitDialog() | CAboutDlg | [protected, virtual]
Generated on Sun Feb 24 01:24:07 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CWincvsApp Member List

This is the complete list of members for CWincvsApp, including all inherited members.
ActivateBrowserView(void) | CWincvsApp |
CWincvsApp() | CWincvsApp |
ExitInstance() | CWincvsApp | [virtual]
gCvsProcess | CWincvsApp |
gCvsRunning | CWincvsApp |
gCvsStopping | CWincvsApp |
GetAppModule(UStr &module) const | CWincvsApp |
GetAppPath(UStr &path) const | CWincvsApp |
GetAppVersion(UStr &vers) const | CWincvsApp |
GetBrowserView(void) | CWincvsApp |
GetConsoleView(void) | CWincvsApp |
GetDocument(void) | CWincvsApp |
GetEnvMainThread(const char *name) | CWincvsApp |
GetExplorerView(void) | CWincvsApp |
GetFileView(void) | CWincvsApp |
GetFilterModel() const | CWincvsApp |
GetIdleTime(void) const | CWincvsApp | [inline]
GetIgnoreModel() const | CWincvsApp |
GetMainFrame(void) | CWincvsApp | [inline]
GetRecursionModel() const | CWincvsApp |
GetRoot() | CWincvsApp |
GetStatusBar() | CWincvsApp |
gLastCvsResult | CWincvsApp |
gLogGraph | CWincvsApp |
gLogHtml | CWincvsApp |
gLogTempl | CWincvsApp |
IdleCvsProgress(void) | CWincvsApp |
InitATL() | CWincvsApp | [protected]
InitInstance() | CWincvsApp | [virtual]
LookForResourceFile(const char *what, UStr &path) | CWincvsApp | [protected]
m_bATLInited | CWincvsApp | [protected]
m_idletime | CWincvsApp | [protected]
m_isBackgroundProcess | CWincvsApp |
m_mainFrame | CWincvsApp | [protected]
m_server | CWincvsApp | [protected]
OnAppAbout() | CWincvsApp | [protected]
OnAppCopyrights() | CWincvsApp | [protected]
OnAppCredits() | CWincvsApp | [protected]
OnFileNew() | CWincvsApp | [protected]
OnHelpCvs() | CWincvsApp | [protected]
OnHelpCvsclient() | CWincvsApp | [protected]
OnLogWindowIsPresent(CCmdUI *pCmdUI) | CWincvsApp | [protected]
PeekPumpAndIdle(void) | CWincvsApp |
PreTranslateMessage(MSG *pMsg) | CWincvsApp | [virtual]
ResetIdleTime(void) | CWincvsApp | [inline]
SaveAllModified() | CWincvsApp | [virtual]
ShowTipAtStartup(void) | CWincvsApp | [private]
ShowTipOfTheDay(void) | CWincvsApp | [private]
UpdateAllDocsView() | CWincvsApp |
Generated on Sun Feb 24 01:28:56 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

Wincvs::IWincvs Member List

This is the complete list of members for Wincvs::IWincvs, including all inherited members.
ViewPath Wincvs::IWincvs
Generated on Sun Feb 24 01:29:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CWndRedrawMngr Member List

This is the complete list of members for CWndRedrawMngr, including all inherited members.
CWndRedrawMngr(CWnd *pWnd, BOOL bRedraw=FALSE) | CWndRedrawMngr |
m_pWnd | CWndRedrawMngr | [private]
SetRedraw(BOOL bRedraw) | CWndRedrawMngr |
~CWndRedrawMngr() | CWndRedrawMngr | [virtual]
Generated on Sun Feb 24 01:29:09 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CWinCvsBrowser Member List

This is the complete list of members for CWinCvsBrowser, including all inherited members.
Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID, CCreateContext *pContext=NULL) | CWinCvsBrowser | [virtual]
CSelectionChangeNotifier | CWinCvsBrowser |
CWinCvsBrowser() | CWinCvsBrowser | [protected]
DeleteAllItems(HTREEITEM root=0L) | CWinCvsBrowser |
DisableCommon() | CWinCvsBrowser | [protected]
GetItemByLocation(const char *path) | CWinCvsBrowser | [protected]
GetRoot(void) const | CWinCvsBrowser | [inline]
m_Imagelist | CWinCvsBrowser | [protected, static]
m_isResetViewPending | CWinCvsBrowser | [protected]
m_isSelectionChanged | CWinCvsBrowser | [protected]
m_isSelectionNotificationLocked | CWinCvsBrowser | [protected]
m_root | CWinCvsBrowser | [protected]
NotifySelectionChange() | CWinCvsBrowser |
OnCustomize(UINT nID) | CWinCvsBrowser | [protected]
OnDestroy() | CWinCvsBrowser | [protected]
OnDraw(CDC *pDC) | CWinCvsBrowser | [protected, virtual]
OnIgnoreChanged() | CWinCvsBrowser |
OnInitialUpdate() | CWinCvsBrowser | [virtual]
OnItemexpanding(NMHDR *pNMHDR, LRESULT *pResult) | CWinCvsBrowser | [protected]
OnMacro(UINT nID) | CWinCvsBrowser | [protected]
OnRButtonDown(UINT nFlags, CPoint point) | CWinCvsBrowser | [protected]
OnResetView(WPARAM, LPARAM) | CWinCvsBrowser | [protected]
OnSelchanged(NMHDR *pNMHDR, LRESULT *pResult) | CWinCvsBrowser | [protected]
OnSelchanging(NMHDR *pNMHDR, LRESULT *pResult) | CWinCvsBrowser | [protected]
OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) | CWinCvsBrowser | [protected]
OnUpdateCmd(CCmdUI *pCmdUI, BOOL needCvsInfos) | CWinCvsBrowser | [protected]
OnUpdateCustomize(CCmdUI *pCmdUI) | CWinCvsBrowser | [protected]
OnUpdateMacro(CCmdUI *pCmdUI) | CWinCvsBrowser | [protected]
OnUpdateViewAdd(CCmdUI *pCmdUI) | CWinCvsBrowser | [protected]
OnUpdateViewCheckout(CCmdUI *pCmdUI) | CWinCvsBrowser | [protected]
OnUpdateViewExplore(CCmdUI *pCmdUI) | CWinCvsBrowser | [protected]
OnUpdateViewImport(CCmdUI *pCmdUI) | CWinCvsBrowser | [protected]
OnUpdateViewReload(CCmdUI *pCmdUI) | CWinCvsBrowser | [protected]
OnUpdateViewUpdate(CCmdUI *pCmdUI) | CWinCvsBrowser | [protected]
OnViewAdd() | CWinCvsBrowser | [protected]
OnViewCheckout() | CWinCvsBrowser | [protected]
OnViewCommit() | CWinCvsBrowser | [protected]
OnViewDiff() | CWinCvsBrowser | [protected]
OnViewEdit() | CWinCvsBrowser | [protected]
OnViewEditors() | CWinCvsBrowser | [protected]
OnViewExplore() | CWinCvsBrowser | [protected]
OnViewForceedit() | CWinCvsBrowser | [protected]
OnViewImport() | CWinCvsBrowser | [protected]
OnViewLog() | CWinCvsBrowser | [protected]
OnViewQueryUpdate() | CWinCvsBrowser | [protected]
OnViewRelease() | CWinCvsBrowser | [protected]
OnViewReload() | CWinCvsBrowser | [protected]
OnViewReservededit() | CWinCvsBrowser | [protected]
OnViewStatus() | CWinCvsBrowser | [protected]
OnViewTagBranch() | CWinCvsBrowser | [protected]
OnViewTagDelete() | CWinCvsBrowser | [protected]
OnViewTagNew() | CWinCvsBrowser | [protected]
OnViewUnedit() | CWinCvsBrowser | [protected]
OnViewUnlock() | CWinCvsBrowser | [protected]
OnViewUpdate() | CWinCvsBrowser | [protected]
OnViewWatchers() | CWinCvsBrowser | [protected]
OnViewWatchOff() | CWinCvsBrowser | [protected]
OnViewWatchOn() | CWinCvsBrowser | [protected]
PreCreateWindow(CREATESTRUCT &cs) | CWinCvsBrowser | [protected, virtual]
ResetBrowser(const char *path, bool notifyView=false) | CWinCvsBrowser |
ResetView(bool forceReload=false, bool notifyView=false) | CWinCvsBrowser |
RetrievePath(HTREEITEM item, UStr &path) | CWinCvsBrowser |
SetNewStyle(long lStyleMask, BOOL bSetBits) | CWinCvsBrowser |
StepToLocation(const char *path, bool notifyView=false) | CWinCvsBrowser |
StoreExpanded(std::vector< UStr > &allExpanded, HTREEITEM root=0L) | CWinCvsBrowser | [protected]
~CWinCvsBrowser() | CWinCvsBrowser | [protected, virtual]
Generated on Sun Feb 24 01:29:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CWinCvsBrowser::CSelectionChangeNotifier Member List

This is the complete list of members for CWinCvsBrowser::CSelectionChangeNotifier, including all inherited members.
CSelectionChangeNotifier(CWinCvsBrowser *view, bool notify) | CWinCvsBrowser::CSelectionChangeNotifier | [inline]
m_notify | CWinCvsBrowser::CSelectionChangeNotifier | [protected]
m_view | CWinCvsBrowser::CSelectionChangeNotifier | [protected]
m_wasLocked | CWinCvsBrowser::CSelectionChangeNotifier | [protected]
~CSelectionChangeNotifier() | CWinCvsBrowser::CSelectionChangeNotifier | [inline]
Generated on Sun Feb 24 01:29:00 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

_afxRichEditCookie Member List

This is the complete list of members for _afxRichEditCookie, including all inherited members.
_afxRichEditCookie(CArchive &ar) | _afxRichEditCookie | [inline]
m_ar | _afxRichEditCookie |
m_dwError | _afxRichEditCookie |
Generated on Sun Feb 24 01:24:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CWincvsDoc Member List

This is the complete list of members for CWincvsDoc, including all inherited members.
CWincvsDoc() | CWincvsDoc |
m_viewPath | CWincvsDoc | [protected]
OnAppCmdline() | CWincvsDoc | [protected]
OnAppLogin() | CWincvsDoc | [protected]
OnAppLogout() | CWincvsDoc | [protected]
OnAppPreferences() | CWincvsDoc | [protected]
OnAppRtagBranch() | CWincvsDoc | [protected]
OnAppRtagDelete() | CWincvsDoc | [protected]
OnAppRtagNew() | CWincvsDoc | [protected]
OnBrowserOpen() | CWincvsDoc | [protected]
OnMacroAdmin(UINT nID) | CWincvsDoc | [protected]
OnNewDocument() | CWincvsDoc | [virtual]
OnSavesettings() | CWincvsDoc | [protected]
OnStopcvs() | CWincvsDoc | [protected]
OnUpdateCvsCmd(CCmdUI *pCmdUI) | CWincvsDoc | [protected]
OnUpdateMacroAdmin(CCmdUI *pCmdUI) | CWincvsDoc | [protected]
OnUpdatePrefs(CCmdUI *pCmdUI) | CWincvsDoc | [protected]
OnUpdateSavesettings(CCmdUI *pCmdUI) | CWincvsDoc | [protected]
OnUpdateStopcvs(CCmdUI *pCmdUI) | CWincvsDoc | [protected]
OnUpdateUsePyshell(CCmdUI *pCmdUI) | CWincvsDoc | [protected]
OnUpdateUseTclshell(CCmdUI *pCmdUI) | CWincvsDoc | [protected]
OnUsePyshell() | CWincvsDoc | [protected]
OnUseTclshell() | CWincvsDoc | [protected]
OnViewBrowselocationRemoveunwanted() | CWincvsDoc | [protected]
OnViewInit() | CWincvsDoc | [protected]
OnViewPathChanged() | CWincvsDoc | [protected]
Serialize(CArchive &ar) | CWincvsDoc | [virtual]
~CWincvsDoc() | CWincvsDoc | [virtual]
Generated on Sun Feb 24 01:29:02 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCharFormat Member List

This is the complete list of members for CCharFormat, including all inherited members.
CCharFormat() | CCharFormat | [inline]
CCharFormat(const CHARFORMAT &newf) | CCharFormat | [inline]
operator CHARFORMAT &() | CCharFormat | [inline]
Generated on Sun Feb 24 01:24:23 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CCvsThreadLock Member List

This is the complete list of members for CCvsThreadLock, including all inherited members.
CCvsThreadLock() | CCvsThreadLock | [inline]
m_lock | CCvsThreadLock | [static]
~CCvsThreadLock() | CCvsThreadLock | [inline]
Generated on Sun Feb 24 01:25:44 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Member List

CWincvsView Member List

This is the complete list of members for CWincvsView, including all inherited members.
CanPaste() const | CWincvsView |
CWincvsView() | CWincvsView | [protected]
FeedThisLine(const char *buf, int numbuf, bool isStderr) | CWincvsView | [protected]
fRtfFormat | CWincvsView | [protected]
GetCurFormat(bool jumpEnd=true) | CWincvsView |
GetDocument() | CWincvsView | [inline]
IsSelected(const CObject *pDocItem) const | CWincvsView | [protected, virtual]
OnBeginPrinting(CDC *pDC, CPrintInfo *pInfo) | CWincvsView | [protected, virtual]
OnDestroy() | CWincvsView | [protected]
OnDraw(CDC *pDC) | CWincvsView | [virtual]
OnDropFiles(HDROP hDropInfo) | CWincvsView | [protected]
OnEditClearAll() | CWincvsView | [protected]
OnEndPrinting(CDC *pDC, CPrintInfo *pInfo) | CWincvsView | [protected, virtual]
OnGetDlgCode() | CWincvsView | [protected]
OnInitialUpdate() | CWincvsView | [protected, virtual]
OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) | CWincvsView | [protected]
OnMyFormatFont() | CWincvsView | [protected]
OnPreparePrinting(CPrintInfo *pInfo) | CWincvsView | [protected, virtual]
OnRButtonDown(UINT nFlags, CPoint point) | CWincvsView | [protected]
OnSetFocus(CWnd *pOldWnd) | CWincvsView | [protected]
OnSize(UINT nType, int cx, int cy) | CWincvsView | [protected]
OutColor(const char *txt, long len) | CWincvsView |
OutColor(kConsoleColor color) | CWincvsView |
OutColor(CHARFORMAT &format) | CWincvsView |
OutConsole(const char *txt, long len, bool isStderr=false) | CWincvsView |
PreCreateWindow(CREATESTRUCT &cs) | CWincvsView | [virtual]
QueryAcceptData(LPDATAOBJECT, CLIPFORMAT *, DWORD, BOOL, HGLOBAL) | CWincvsView | [protected, virtual]
sbuf | CWincvsView | [protected, static]
snumbuf | CWincvsView | [protected, static]
~CWincvsView() | CWincvsView | [virtual]
Generated on Sun Feb 24 01:29:04 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Alphabetical index

WinCvs Source Compound Index

_
CCJTimeEdit ImportReport mircAttrCvt CTabCtrl
_afxRichEditCookie CCJToolBar CImportWarning CMMenuString TAdorner
_CvsProcess CCJToolBarBase CInit_MAIN CMPString CTag_MAIN
_dircontents CCJToolBarCtrl irciiAttrCvt CMsg tagCTV_ITEM
_dirdesc CCJToolCmdUI ISupportErrorInfo UMSGMAP tagMENUITEMINFOA
_frameRec CCJTreeCtrl IUnknown UMSGMAP_ENTRY tagTCB_ITEM
_IID CCJTreeCtrl::Color_Font IWincvs (Wincvs) CMString UTB_BUTTON
_MIDL_PROC_FORMAT_STRING CCJWindowPlacement
J
MultiFiles UTB_DROPDOWN
_MIDL_TYPE_FORMAT_STRING CCmdLine_MAIN CJX_COLORMAP MultiFilesEntry UTB_INIT
_WireHandler UCmdTarget CJX_CONTROLPOS CMyShellTree CTbEdit
_WireMessage UCmdUI
K
N
TBehavior
A
CCmdUI CKeyString CNoPython TbEntry
CAboutDlg UCOLOR KiColumn NotificationManager TbEntryButton
AddBinCvsArgs UColor KiColumnModel NotificationManager::Node TbEntryChkButton
AddCvsArgs CColorConsole KiFilterModel
O
TbEntryDropDown
AddUnicodeCvsArgs CColorMenu KiIgnoreModel CObject TbEntrySeparator
CAdminOptionDlg CColorStatic KiRecursionModel UObject TBrowserFill
AFX_DLLVERSIONINFO CComboBox KiSelectionHandler ColorTableEntry TBrowserFillDummy
CAllHandlers CComboBoxEx KoAddBinaryHandler ControlCvsArgs TBuggyPopup
CAllTargets CComCoClass KoAddHandler option CTcl_Interp
CAnnotate_MAIN CCommit_MAIN KoAddUnicodeHandler COptionalPropertySheet CTCLBrowserEnt
ansiAttrCvt CCommit_OPTIONS KoAnnotateHandler OUTBAR_INFO CTCLCvsConsole
ansiAttrCvt::AnsiSeq CComModule KoBranchTagHandler
P
CTCP2Parse
AREF CComObjectRootEx KoColumnContext PCPStr CTCP2Parse::RGBColor
aref CContentItems KoCommitHandler PCStr TEditText
CAskYesNo CControlBar KoConflictColumn UPen CTempToggleBool
Authen CCtrlView KoCreateTagHandler CPersistent TGraph
UAuthen_Gserver CCustInvertTable KoDateColumn CPersistent::CPersistentEntry TGraphCmdStatus
UAuthen_Kserver CCustomizeMenus KoDeleteTagHandler CPersistentBool TGraphDelCmd
UAuthen_Pserver CCVS_CoworkerModule KoDiffHandler CPersistentInt TGraphRectSelect
UAuthen_Rhosts CCVSAlert KoEditHandler CPersistentT TGraphSelNonSig
UAuthen_SSH UCvsApp KoEditorsHandler UPoint TIconButton
AuthenGserver UCvsConsole KoFileRemoveHandler UPOINT TIconCheckBox
AuthenKserver CCvsConsole KoFilterModel poolRec TIconPopup
AuthenLocal UCvsFiles KoForceEditHandler UPPMenu UTimer
AuthenModel UCvsFolders KoGraphHandler CProgress CTipDlg
AuthenNtserver UCvsFrame KoIgnoreModel CProgressDialog TMPersistent
AuthenPserver UCvsGraph KoLockHandler UPromptMessage CTmpFiles
AuthenRhosts UCvsMenubar KoLogHandler CPropertyPage TMString
CAuthenSetUp CCvsStatusBar KoMoveToTrashHandler CPropertySheet UToolbar
AuthenSSH CCvsThreadLock KoNameColumn CPseudoButton CToolbarCombo
awidget UCvsToolbar KoOptionColumn UPseudoCmdStatusWrapper CToolBarCtrl
B
D
KoPathColumn CPseudoDlg CToolBarData
CBarConsole UDC KoQueryUpdateHandler CPseudoDraw TOOLBARINFO
CBrowseFileView CDestroyThreadLock KoRecursionModel UPseudoFakePane TPopup
CBrowserBar CDialog KoRecursiveModel CPseudoItem TPseudoAppBehavior
UBrush CDiff_MAIN KoRegularModel CPseudoList TPseudoCustomView
CBuffer direct KoReleaseHandler UPseudoPageHider TPseudoDoubleNumberText
CButton CDockBar KoReservedEditHandler UPseudoPlaceHolder TPseudoIconButton
C
CDockContext KoRevisionColumn CPseudoRotButton TPseudoIconCheckBox
CCharFormat CDocument KoStatusColumn UPseudoRotButton TPseudoIconPopup
CCheckout_MAIN DROPDOWNBUTTON KoStatusHandler CPseudoToggle TPseudoRotateIconButton
CCheckout_OPTIONS CDummyClass KoTagColumn UPStr TPseudoScrollBar
CCJBrowseButton CDummyInit KoTraversalContext PyAutoObject TPseudoTextListView
CCJBrowseEdit DYN_LIST KoUneditHandler PyCmdUI TPseudoWinAdorner
CCJCaption CDynToolBar KoUnlockHandler PyCmdUI::obj_t TPseudoWinBehavior
CCJCaptionButton
E
KoUpdateHandler PyColorConsole TraversalReport
CCJCaptionPopupWnd CEdit KoUpdateMoveToTrashHandler PyColorConsole::obj_t UTREE_INFO
CCJCBarButton UEditMessage KoWatcher PyContainer UTREE_INSERT
CCJColorPicker CEditorMonDlg KoWatchersHandler CPyCvsConsole CTreeCtrl
CCJColorPopup ENTNODE KoWatchOffHandler PyCvsEntry CTreeView
CCJComboBoxEx EntnodeData KoWatchOnHandler PyCvsEntry::obj_t TScrollBar
CCJControlBar EntnodeFile
L
PyMenuMgr TTextListView
CCJDateEdit EntnodeFolder LAttachment PyMenuMgr::obj_t CTurnOffDispatching
CCJDateTimeCtrl EntnodePath LBevelButton PyPersistent TView
CCJDockBar CExploreBar LCommander PyPersistent::obj_t TViewFill
CCJDockContext
F
ULIST_INFO PyRegistry
U
CCJExplorerBar FileEntry ULIST_INSERT CPython_Interp CUpdateMain
CCJFlatButton CFillPyEntries CListBox CPyThreadState CUpdateMerge
CCJFlatComboBox CFillTclEntries CListCtrl
R
CUpdateSticky
CCJFlatHeaderCtrl CFindSettings CListView URect CustInvertTable
CCJFlatSplitterWnd CFormView LListener URECT
V
CCJFlatTabCtrl CFrameWnd LMainPseudoAttachment CRectTracker vector
CCJFontCombo
G
CLogFilters CRecursionLock CView
CCJFrameWnd garbyRec CLogFrame CReleaseDlg CViewInfo
CCJHexEdit GetPassword CLogMain RemoveCvsArgs CvsArgs
CCJHtmlView CGetPrefs_CVSCMD_DIALOGS CLogNodeData ReportConflict CvsCoworker
CCJHyperLink CGetPrefs_CVSROOT CLogoutThread ReportWarning CvsFilenames
CCJListBox CGetPrefs_GLOBALS LOutlineItem CRevisionConsole CvsPrefs
CCJListCtrl CGetPrefs_WINCVS LOutlineTable CRichEditView CvsProcessCallbacks
CCJListView GetValue LPane CRtag_MAIN CvsProject
CCJLogoPane CGfxGroupEdit LPeriodical CRtag_OPTIONS CvsString
CCJMaskEdit CGfxOutBarCtrl LPlaceHolder URuntimeClass CvsTrace
CCJMDIChildWnd CGfxOutBarCtrl::CBarFolder LPseudoDrawAttachment
S
W
CCJMDIFrameWnd CGfxOutBarCtrl::CBarItem LPseudoWinAttachment USaveSettings UWaitCursor
CCJMemFile CGfxSplitterWnd LSReport CScrollView UWidget
CCJMenu GPT_CONSOLE
M
USemaphore Win32wstring
CCJMenuBar GPT_GETENV UMacAppMenu USize CWinApp
CCJMenuBarFrameHook GPT_QUIT CMacBinItem USIZE CWincvsApp
CCJMenuData CGraphConsole MACBINMAP USLIDER CWinCvsBrowser
CCJMetaFileButton CGraphDoc MACBINMAPENTRIES USmartCombo CWinCvsBrowser::CSelectionChangeNotifier
CCJMiniDockFrameWnd CGraphFrame MacBinMaps CSmartComboBox CWincvsDoc
CCJMonthCalCtrl CGraphOptDlg CMacBinTable CSortHeaderCtrl CWincvsView
CCJOutlookBar CGraphRectTracker CMacroEntry CSortList WINDOWPLACEMENT
CCJPagerCtrl CGraphView CMacroSet CSortParam WININFO
CCJReBar
H
MacroTraversal CSplashWnd CWinLogBranchData
CCJReBarCtrl CHARFORMAT CMainFrame CSplitterWnd CWinLogData
CCJShellTree CHeaderCtrl CMapPtrToPtr CStackThreadLock CWinLogHeaderData
CCJSizeDockBar CHistComboBoxEx CMDIChildWnd CStatic CWinLogRevData
CCJSortClass
I
CMDIFrameWnd CStaticAllocT CWinLogTagData
CCJSortClass::CSortItem ICvsCoworker CMemFile CStatusBar CWinPlacement
CCJStatusBar ICvsCoworker CMenu UStr CWinThread
CCJStatusBarPane CImport_MAIN UMenu CStreamConsole CWnd
CCJStatusBarPaneControlInfo CImport_OPTIONS CMenuItemInfo CSubclassWnd CWndRedrawMngr
CCJTabCtrl CImportEntry UMessageMapFunctions CSubclassWndMap wnt_stat
CCJTabCtrlBar CImportFilterDlg CMiniDockFrameWnd
T
wstring
CCJTabView
Generated on Sun Feb 24 01:24:05 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002


Graph Legend

This page explains how to interpret the graphs that are generated by doxygen.

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };

/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };

/* Class not documented with doxygen comments */
class Undocumented { };

/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };

/*! A template class */
template<class T> class Templ { };

/*! Class that is inherited using protected inheritance */
class ProtectedBase { };

/*! Class that is inherited using private inheritance */
class PrivateBase { };

/*! Class that is used by the Inherited class */
class Used { };

/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
                  protected ProtectedBase,
                  private PrivateBase,
                  public Undocumented
                  public Templ<int>
{
  private:
    Used *m_usedClass;
};
If the MAX_DOT_GRAPH_HEIGHT tag in the configuration file is set to 240 this will result in the following graph:

The boxes in the above graph have the following meaning:

  • A filled black box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
The arrows have the following meaning:
  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
  • A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.
Generated on Sun Feb 24 01:29:10 2002 for WinCvs Source by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002